[
  {
    "path": ".appveyor.yml",
    "content": "version: '{build}'\nimage: Visual Studio 2019\n\nenvironment:\n  nodejs_version: 16\n\ninstall:\n  - ps: Install-Product node $env:nodejs_version\n  - npm install\n\nbuild_script:\n  - md src\\preview\\core\\bin\\src\\preview\n  - md src\\preview\\core\\bin\\src\\simulator\n  - npm run setup:build\n\nafter_build:\n  - ps: |\n      Push-AppveyorArtifact \"fuse-*.exe\"\n\ntest_script:\n  - echo TODO npm test\n"
  },
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\nindent_style = tab\nindent_size = 4\n\n# 4 space indentation\n[*.py]\nindent_style = space\nindent_size = 4\n\n\n\n[*.cs]\nindent_style = tab\nindent_size = 4\ninsert_final_newline = true\ncsharp_new_line_before_open_brace = accessors,control_blocks,events,indexers,local_functions,methods,properties,types\ncsharp_new_line_before_else = true\ncsharp_new_line_before_catch = true\ncsharp_new_line_before_finally = true\ncsharp_new_line_before_members_in_object_initializers = true\n"
  },
  {
    "path": ".gitattributes",
    "content": "# Third-party code\n3rdparty/**/*           linguist-vendored\nsetup/nsis/tools/**/*   linguist-vendored\n\n# We don't really care about the order of changelog entries\nCHANGELOG.md merge=union\n\n# Auto detect text files and perform LF normalization\n* text=auto\n\n# Use CRLF line endings for bat files\n*.bat    crlf\n\n# Custom for Visual Studio\n*.cs     diff=csharp\n*.sln    merge=union\n*.csproj merge=union\n*.vbproj merge=union\n*.fsproj merge=union\n*.dbproj merge=union\n\n# Standard to msysgit\n*.doc\t diff=astextplain\n*.DOC\t diff=astextplain\n*.docx diff=astextplain\n*.DOCX diff=astextplain\n*.dot  diff=astextplain\n*.DOT  diff=astextplain\n*.pdf  diff=astextplain\n*.PDF\t diff=astextplain\n*.rtf\t diff=astextplain\n*.RTF\t diff=astextplain\n\n# Useful for certain integration tests\n*.crlf    crlf\n"
  },
  {
    "path": ".gitignore",
    "content": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n#\n# If you find yourself ignoring temporary files generated by your text editor\n# or operating system, you probably want to add a global ignore instead:\n#   git config --global core.excludesfile ~/.gitignore_global\n\n*.iml\n.idea/\n\n# Ignore OS specific and temporary files.\n*.swp\n*.swo\n.DS_Store\nThumbs.db\n\n# Locally installed NuGet packages.\npackages/\n/RealtimeStudio/Installer/packages/\n/RealtimeStudio/Ultimate/packages/\n/nuget/\n/ /\n\n# Generated files\n*.aab\n*.apk\n*.deb\n*.tgz\n*.dll\n*.dll.config\n*.dylib\n*.opensdf\n*.msi\n*.pdb\n*.sdf\n*.suo\n*.uduser\n*.user\n*.userprefs\n*.mdf\n*.ldf\n.uno/\n.Build/\n.Cache/\n.CodeDruid/\n.CodeMage/\n.CodeNinja/\nipch/\nbin/\nobj/\n/Offline\n/Release\n**/build/\nTests/SystemTest\n\n# Sublime files\n*.sublime-project\n*.sublime-workspace\n\n# WiX objects\n*.wixobj\n*.wixpdb\n/packages-wix.xml\nVcRedistLog.txt\n\n#UnoTest generated files\n*_actual_render.png\n\n#RS tests generated files\n**/GeneratedTestData/*\n\n# Misc\nbuildlog.txt\nOpenTK.GLControl.xml\nOpenTK.xml\n*.GhostDoc.xml\nTMP_DL\n\n#StdLibBuilder\nStdLibBuilder.exe*\n.LastStdLibBuild\nDependencyCache\n\n/Uno/UnoCompiler/Tests/RenderingTests/Newtonsoft.Json.xml\n/Uno/UnoCompiler/Tests/RenderingTests/Uno/Audio/NAudio/license.txt\n/Uno/UnoCompiler/Tests/RenderingTests/Uno/Audio/NAudio/readme.txt\n\n#Generated packages\nUno/Packages/**/*\n\n# Build\n.build-inited\n.dotnet-run\n\n# STUFF\n.stuff/\n*.zip\n\n# unoconfig\n!/.unoconfig\n\nbuild-uno.unoconfig\nauto_test_app_uno.pid\n\n# Visual studio 2015+ user specific directory\n.vs\ntools/mono\nsrc/Fuse/Sandbox/AutoReloadContent.cs\n\n# unpacked Sketch43 test-files\nfiles/output\n\n#NUnit\nTestResult.xml\n\n# Node.js\nnode_modules/\n\n# Installers\n*.dmg\n*.pkg\n*.exe\n\n# Logs\nunohost-*.txt\ndebug.log\n"
  },
  {
    "path": ".npmignore",
    "content": "README.md"
  },
  {
    "path": ".unoconfig",
    "content": "Fuse.Bin: bin/$(Configuration)\nFuse.Components: components\nFuse.Templates: templates\n\nFuse.Simulator: src/simulator/main/obj/Fuse.Simulator.dll\n\nif MAC {\n    Fuse.Exe: bin/$(Configuration)/fuse\n    Fuse.CodeAssistance: bin/$(Configuration)/fuse-lang\n    Fuse.LogServer: bin/$(Configuration)/fuse-logserver\n    Fuse.Studio: \"bin/$(Configuration)/fuse X.app\"\n    Fuse.Tray: \"bin/$(Configuration)/fuse X (menu bar).app\"\n    Fuse.UnoHost: bin/$(Configuration)/UnoHost.app\n} else if WIN32 {\n    Fuse.Exe: bin/$(Configuration)/fuse.exe\n    Fuse.CodeAssistance: bin/$(Configuration)/fuse-lang.exe\n    Fuse.Studio: bin/$(Configuration)/fuse-studio.exe\n    Fuse.Tray: bin/$(Configuration)/fuse-tray.exe\n    Fuse.UnoHost: bin/$(Configuration)/unohost.exe\n}\n\nPackages.SourcePaths += [\n    src/simulator\n    src/preview\n]\n\nif WIN32 {\n    // Global Android Build Tools config (#92).\n    require `%PROGRAMDATA%\\fuse X\\.unoconfig`\n    // We've seen %PROGRAMDATA% being empty on some systems.\n    require `%SYSTEMDRIVE%\\ProgramData\\fuse X\\.unoconfig`\n    // Local config should take precedence.\n    require ~/.unoconfig\n}\n"
  },
  {
    "path": ".vscode/.gitignore",
    "content": "ipch/\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n    \"files.associations\": {\n        \"*.plist\": \"xml\",\n        \"*.uxl\": \"xml\"\n    },\n    \"files.exclude\": {\n        \"**/.uno\": true,\n        \"**/.vs\": true,\n        \"**/bin\": true,\n        \"**/build\": true,\n        \"**/node_modules\": true,\n        \"**/packages\": true,\n        \"**/obj\": true,\n        \"**/*.user\": true,\n        \"*.apk\": true,\n        \"*.dmg\": true,\n        \"*.exe\": true,\n        \"*.pkg\": true,\n        \"*.tgz\": true\n    }\n}"
  },
  {
    "path": "3rdparty/ColorPicker/AlphaDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.AlphaDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n           >\n    <UserControl.Resources>\n        <ResourceDictionary>\n            <ResourceDictionary.MergedDictionaries>\n                <ResourceDictionary Source=\"SliderResources.xaml\"/>\n                <ResourceDictionary Source=\"CheckerBoardBrush.xaml\"/>\n            </ResourceDictionary.MergedDictionaries>\n        </ResourceDictionary>\n    </UserControl.Resources>\n    <Grid  Width=\"48\">\n     \n        <Grid.RowDefinitions>\n            <RowDefinition />\n            <RowDefinition Height=\"24\" />\n        </Grid.RowDefinitions>\n        <TextBox Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"0,0,0,0\" Name=\"txtAlpha\" VerticalAlignment=\"Top\" Width=\"28\" \n                 Grid.Row=\"1\"\n                 Text=\"{Binding ElementName=sAlpha, Path=Value, StringFormat=\\{0:N0\\}}\" />\n\n        <Rectangle Fill=\"{Binding Source={StaticResource CheckerBoard}}\"  Width=\"24\"  Margin=\"2,4,2,4\"  HorizontalAlignment=\"Left\" ></Rectangle>\n        <Border  BorderBrush=\"Gray\" BorderThickness=\"2\"   Grid.Column=\"0\"   Margin=\"0,4,0,4\"  SnapsToDevicePixels=\"True\" Width=\"28\" HorizontalAlignment=\"Left\"  VerticalAlignment=\"Stretch\"  >\n\n\n\n\n            <Image   Name=\"imgTransparency\" Stretch=\"Fill\" MouseDown=\"imgTransparency_MouseDown\" MouseMove=\"imgTransparency_MouseMove\" />\n        </Border>\n        <Slider   HorizontalAlignment=\"Left\" Margin=\"18,0,0,0\" Name=\"sAlpha\" VerticalAlignment=\"Stretch\"   Orientation=\"Vertical\"  Width=\"28\"\n                 Style=\"{DynamicResource SliderStyle}\"\n                Maximum=\"100\" Minimum=\"0\" IsSnapToTickEnabled=\"True\" Value=\"100\" ValueChanged=\"sAlpha_ValueChanged\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/AlphaDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker\n{\n    /// <summary>\n    /// Interaction logic for AlphaDisplay.xaml\n    /// </summary>\n    public partial class AlphaDisplay : UserControl\n    {\n        public static Type ClassType\n        {\n            get { return typeof(AlphaDisplay); }\n        }\n\n        public event EventHandler<EventArgs<byte>> AlphaChanged;\n\n        public AlphaDisplay()\n        {\n            InitializeComponent();\n            imgTransparency.Source = mTransparencyBitmap;\n        }\n        private WriteableBitmap mTransparencyBitmap = new WriteableBitmap(24, 256, 96, 96, PixelFormats.Bgra32, null); \n\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n             new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n\n        [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var color = (Color)e.NewValue;\n            var rd = (AlphaDisplay)d;\n            rd.OnColorChanged(color);\n        }\n\n        private void OnColorChanged(Color color)\n        {\n            unsafe\n            {\n                mTransparencyBitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)mTransparencyBitmap.BackBuffer;\n                for (int iRow = 0; iRow < mTransparencyBitmap.PixelHeight; iRow++)\n                {\n                    for (int iCol = 0; iCol < mTransparencyBitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 4 + 0) = color.B; //Blue\n                        *(pStart + currentPixel * 4 + 1) = color.G; //Green \n                        *(pStart + currentPixel * 4 + 2) = color.R; //red\n                        *(pStart + currentPixel * 4 + 3) = (byte)(255 - iRow); //alpha\n                    }\n                }\n\n                mTransparencyBitmap.AddDirtyRect(new Int32Rect(0, 0, mTransparencyBitmap.PixelWidth, mTransparencyBitmap.PixelHeight));\n                mTransparencyBitmap.Unlock();\n            }\n\n          \n        }\n\n        #endregion\n\n        #region Alpha\n\n        public static DependencyProperty AlphaProperty = DependencyProperty.Register(\"Alpha\", typeof(byte), ClassType, new PropertyMetadata((byte)255, new PropertyChangedCallback(OnAlphaChanged)));\n\n        public byte Alpha\n        {\n            get\n            {\n                return (byte)GetValue(AlphaProperty);\n            }\n            set\n            {\n                SetValue(AlphaProperty, value);\n            }\n        }\n\n        private static void OnAlphaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var display = (AlphaDisplay) d;\n            display.sAlpha.Value = (byte)e.NewValue/2.55 ;\n            if (display.AlphaChanged != null)\n            {\n                display.AlphaChanged(display,new EventArgs<byte>(display.Alpha));\n            }\n        }\n\n        #endregion\n\n        private void sAlpha_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)\n        {\n            Alpha = Convert.ToByte( e.NewValue*2.55);\n        }\n\n        private void imgTransparency_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)\n        {\n            var alphaPercent = 100 * (imgTransparency.ActualHeight - (e.GetPosition((IInputElement)sender)).Y) / imgTransparency.ActualHeight;\n            sAlpha.Value = alphaPercent;\n\t\t\te.Handled = true;\n        }\n\n        private void imgTransparency_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)\n        {\n            if (Mouse.LeftButton == MouseButtonState.Pressed)\n            {\n                var alphaPercent = 100 * (imgTransparency.ActualHeight - (e.GetPosition((IInputElement)sender)).Y) / imgTransparency.ActualHeight;\n                sAlpha.Value = alphaPercent;\n            }\n\t        e.Handled = true;\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/CheckerBoardBrush.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n<DrawingBrush Viewport=\"0.0,0.0,0.5,0.05\" TileMode=\"Tile\"    x:Key=\"CheckerBoard\"  Stretch=\"Uniform\">\n\n    <DrawingBrush.Drawing>\n        <DrawingGroup>\n            <GeometryDrawing Brush=\"White\">\n                <GeometryDrawing.Geometry>\n                    <RectangleGeometry Rect=\"0,0,100,100\" />\n                </GeometryDrawing.Geometry>\n            </GeometryDrawing>\n\n            <GeometryDrawing>\n                <GeometryDrawing.Geometry>\n                    <GeometryGroup>\n                        <RectangleGeometry Rect=\"0,0,50,50\" />\n                        <RectangleGeometry Rect=\"50,50,50,50\" />\n                    </GeometryGroup>\n                </GeometryDrawing.Geometry>\n                <GeometryDrawing.Brush>\n                        <SolidColorBrush Color=\"#d7d7d7\"/>\n            \n                </GeometryDrawing.Brush>\n            </GeometryDrawing>\n        </DrawingGroup>\n    </DrawingBrush.Drawing>\n    </DrawingBrush>\n\n</ResourceDictionary>"
  },
  {
    "path": "3rdparty/ColorPicker/ColorDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.ColorDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             d:DesignHeight=\"300\" d:DesignWidth=\"300\">\n    <UserControl.Resources>\n        <DrawingBrush Viewport=\"0.0,0.0,0.5,0.5\" TileMode=\"Tile\"    x:Key=\"CheckerBoard\"   >\n\n            <DrawingBrush.Drawing>\n                <DrawingGroup>\n                    <GeometryDrawing Brush=\"White\">\n                        <GeometryDrawing.Geometry>\n                            <RectangleGeometry Rect=\"0,0,10,10\" />\n                        </GeometryDrawing.Geometry>\n                    </GeometryDrawing>\n\n                    <GeometryDrawing>\n                        <GeometryDrawing.Geometry>\n                            <GeometryGroup>\n                                <RectangleGeometry Rect=\"0,0,5,5\" />\n                                <RectangleGeometry Rect=\"5,5,5,5\" />\n                            </GeometryGroup>\n                        </GeometryDrawing.Geometry>\n                        <GeometryDrawing.Brush>\n                            <SolidColorBrush Color=\"#d7d7d7\"/>\n\n                        </GeometryDrawing.Brush>\n                    </GeometryDrawing>\n                </DrawingGroup>\n            </DrawingBrush.Drawing>\n        </DrawingBrush>\n\n    </UserControl.Resources>\n    <Grid>\n        <Border Margin=\"2,2,2,2\" Background=\"{StaticResource CheckerBoard}\"   VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\" >\n\n        </Border>\n        <Border  VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\"  BorderBrush=\"#FFCACACA\" BorderThickness=\"1\"  >\n            <Border  VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\"  BorderBrush=\"white\" BorderThickness=\"1\"  >\n                <Border Name=\"colorRect\" Background=\"Gray\"/>\n            </Border>\n        </Border>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace ColorPicker\n{\n    /// <summary>\n    /// Interaction logic for ColorDisplay.xaml\n    /// </summary>\n    public partial class ColorDisplay : UserControl\n    {\n\n        public static Type ClassType\n        {\n            get { return typeof(ColorDisplay); }\n        }\n\n\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType, new PropertyMetadata(Colors.Gray, OnColorChanged));\n        [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var display = (ColorDisplay)d;\n            var color = (Color)e.NewValue;\n            display.OnColorChanged(color);\n        }\n\n        private void OnColorChanged(Color color)\n        {\n            \n            colorRect.Background = new SolidColorBrush(color);\n        }\n        #endregion\n\n        public ColorDisplay()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMY/CMYDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.ColorModels.CMY.CMYDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             Width=\"auto\" Height=\"auto\">\n    <Grid>\n        <Grid.Resources>\n            <Style TargetType=\"{x:Type TextBox}\">\n                <Setter Property=\"Width\" Value=\"40\" />\n                <Setter Property=\"Height\" Value=\"23\"/>\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n                <Setter Property=\"Margin\" Value=\"2,2,2,2\"/>\n            </Style>\n            <Style TargetType=\"{x:Type RadioButton}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n                <Setter Property=\"Height\" Value=\"16\"/>\n            </Style>\n            <Style TargetType=\"{x:Type TextBlock}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n        </Grid.Resources>\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"auto\" />\n            <ColumnDefinition Width=\"auto\" />\n            <ColumnDefinition Width=\"auto\" />\n        </Grid.ColumnDefinitions>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"auto\" />\n            <RowDefinition Height=\"auto\" />\n            <RowDefinition Height=\"auto\" />\n        </Grid.RowDefinitions>\n        <!--Row 1-->\n        <TextBlock  >C:</TextBlock>\n        <TextBox Grid.Column=\"1\" Name=\"txtC\" PreviewTextInput=\"txtR_PreviewTextInput\" TextChanged=\"TextChanged\"   />\n        <TextBlock  Grid.Row=\"0\" Grid.Column=\"2\" Name=\"txtCUnit\"></TextBlock>\n        <!--Row 2-->\n        <TextBlock Grid.Row=\"1\"   >M:</TextBlock>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"1\"    Name=\"txtM\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"1\" Grid.Column=\"2\" Name=\"txtMUnit\"></TextBlock>\n        <!--Row 3-->\n        <TextBlock Grid.Row=\"2\"  >Y:</TextBlock>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"2\"      Name=\"txtY\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"2\" Grid.Column=\"2\" Name=\"txtYUnit\"></TextBlock>\n\n      \n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMY/CMYDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.CMY\n{\n    /// <summary>\n    /// Interaction logic for CMYDisplay.xaml\n    /// </summary>\n    public partial class CMYDisplay : UserControl\n    {\n        public enum EDisplayMode\n        {\n            ByteDisplay,\n            PercentNoDecimal\n        }\n\n        private static CMYModel sModel = new CMYModel();\n        private static Cyan sCyan = new Cyan();\n        private static Magenta sMagenta = new Magenta();\n        private static Yellow sYellow = new Yellow();\n        private Func<Color, string> c;\n        private Func<Color, string> m;\n        private Func<Color, string> y;\n         \n        public CMYDisplay()\n        {\n            InitializeComponent();\n            txtCUnit.Text = \"\";\n            txtMUnit.Text = \"\";\n            txtYUnit.Text = \"\";\n\t\t\tc = color => sCyan.Value(color).ToString(CultureInfo.InvariantCulture);\n\t\t\tm = color => sMagenta.Value(color).ToString(CultureInfo.InvariantCulture);\n\t\t\ty = color => sYellow.Value(color).ToString(CultureInfo.InvariantCulture);\n            CyanFormat = \"N0\";\n           MagentaFormat = \"N0\";\n            YellowFormat = \"N0\";\n        }\n\n        public static Type ClassType\n        {\n            get { return typeof(CMYDisplay); \n            }\n        }\n\n\n        public string CyanFormat { get; set; }\n        public string MagentaFormat { get; set; }\n        public string YellowFormat { get; set; }\n\n        #region DisplayMode\n\n        public static DependencyProperty DisplayModeProperty = DependencyProperty.Register(\"DisplayMode\", typeof(EDisplayMode), ClassType, new PropertyMetadata(EDisplayMode.ByteDisplay, new PropertyChangedCallback(OnDisplayModeChanged)));\n\n        public EDisplayMode DisplayMode\n        {\n            get\n            {\n                return (EDisplayMode)GetValue(DisplayModeProperty);\n            }\n            set\n            {\n                SetValue(DisplayModeProperty, value);\n            }\n        }\n\n        private static void OnDisplayModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var display = (CMYDisplay)d;\n            var displayMode = (EDisplayMode)e.NewValue;\n            display.OnDisplayModeChanged(displayMode);\n\n        }\n\n        private void OnDisplayModeChanged(EDisplayMode displayMode)\n        {\n            switch (displayMode)\n            {\n                case EDisplayMode.ByteDisplay:\n                    txtCUnit.Text = \"\";\n                    txtMUnit.Text = \"\";\n                    txtYUnit.Text = \"\";\n\t\t\t\t\tc = color => sCyan.Value(color).ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\tm = color => sMagenta.Value(color).ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\ty = color => sYellow.Value(color).ToString(CultureInfo.InvariantCulture);\n                    break;\n                case EDisplayMode.PercentNoDecimal:\n                    txtCUnit.Text = \"%\";\n                    txtMUnit.Text = \"%\";\n                    txtYUnit.Text = \"%\";\n\n                    c = color => sModel.CComponent(color).PercentageOf(255).ToString(CyanFormat);\n                    m = color => sModel.MComponent(color).PercentageOf(255).ToString(MagentaFormat);\n                    y = color => sModel.YComponent(color).PercentageOf(255).ToString(YellowFormat);\n                    break;\n\n            }\n        }\n\n        \n        #endregion\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n             new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var color = (Color)e.NewValue;\n            var display = (CMYDisplay)d;\n            display.OnColorChanged(color);\n        }\n\n        private void OnColorChanged(Color color)\n        {\n            txtC.Text = c(color) ;\n            txtM.Text = m(color);\n            txtY.Text = y(color);\n             \n\n            if (ColorChanged != null)\n            {\n                ColorChanged(this, new EventArgs<Color>(color));\n            }\n        }\n\n        #endregion\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n\n\n        private void txtR_PreviewTextInput(object sender, TextCompositionEventArgs e)\n        {\n            e.Handled = NumbersOnly(e.Text);\n            base.OnPreviewTextInput(e);\n\n        }\n\n        private bool NumbersOnly(string text)\n        {\n            String okChars = \"0123456789\";\n            return text.ToCharArray().All(c => okChars.IndexOf(c) == -1);\n        }\n\n\n        private void TextChanged(object sender, TextChangedEventArgs e)\n        {\n            try\n            {\n                //Color = System.Windows.Media.Color.FromRgb(byte.Parse(txtR.Text), byte.Parse(txtG.Text),\n                //                                           byte.Parse(txtB.Text));\n            }\n            catch\n            {\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMY/CMYModel.cs",
    "content": "﻿using System;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.CMY\n{\n  public class CMYModel\n    {\n        public enum ECMYComponent\n        {\n            Cyan = 0,\n            Magenta = 1,\n            Yellow = 2,\n        }\n\n\n        #region components\n\n        public double CComponent(Color color)\n        {\n            return 255 - color.R ;\n        }\n\n\n        public Double MComponent(Color color)\n        {\n            return 255 - color.G ;\n        }\n\n        public Double YComponent(Color color)\n        {\n            return 255 - color.B;\n        }\n\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMY/Cyan.cs",
    "content": "﻿namespace ColorPicker.ColorModels.CMY\n{\n    class Cyan : ColorComponent\n    {\n        public static CMYModel sModel = new CMYModel();\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 100; }\n        }\n\n\n        public override int Value(System.Windows.Media.Color color)\n        {\n           return (int)sModel.CComponent(color);\n        }\n\n        public override string Name\n        {\n            get {return \"CMY_Cyan\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMY/Magenta.cs",
    "content": "﻿namespace ColorPicker.ColorModels.CMY \n{\n    class Magenta : ColorComponent\n    {\n        public static CMYModel sModel = new CMYModel();\n\n        public override int MinValue\n        {\n            get {return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get {return 100; }\n        }\n\n        public override int Value(System.Windows.Media.Color color)\n        {\n            return (int) sModel.MComponent(color);\n        }\n\n        public override string Name\n        {\n            get { return \"CMY_magenta\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMYK/Black.cs",
    "content": "﻿using ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.CMYK\n{\n    class Black : ColorComponent\n    {\n        public static CMYKModel sModel = new CMYKModel();\n\n        public override int MinValue\n        {\n            get {return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 100; }\n        }\n\n        public override int Value(System.Windows.Media.Color color)\n        {\n           return sModel.KComponent(color).AsPercent();\n        }\n\n        public override string Name\n        {\n            get { return  \"CMYK_Black\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMYK/CMYKDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.ColorModels.CMYK.CMYKDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             Width=\"auto\" Height=\"auto\">\n    <Grid>\n        <Grid.Resources>\n            <Style TargetType=\"{x:Type TextBox}\">\n                <Setter Property=\"Width\" Value=\"40\" />\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n            <Style TargetType=\"{x:Type RadioButton}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n                <Setter Property=\"Height\" Value=\"16\"/>\n            </Style>\n            <Style TargetType=\"{x:Type TextBlock}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n        </Grid.Resources>\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"auto\" />\n            <ColumnDefinition Width=\"auto\" />\n            <ColumnDefinition Width=\"auto\" />\n        </Grid.ColumnDefinitions>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"28\" />\n            <RowDefinition Height=\"28\" />\n            <RowDefinition Height=\"28\" />\n            <RowDefinition Height=\"28\" />\n        </Grid.RowDefinitions>\n        <!--Row 1-->\n        <TextBlock  >C:</TextBlock>\n        <TextBox Grid.Column=\"1\"  Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtC\" PreviewTextInput=\"txtR_PreviewTextInput\" TextChanged=\"TextChanged\" Margin=\"0,0,0,2\" VerticalAlignment=\"Bottom\" />\n        <TextBlock  Grid.Row=\"0\" Grid.Column=\"2\" Name=\"txtCUnit\" Margin=\"4,0,0,0\"></TextBlock>\n        <!--Row 2-->\n        <TextBlock Grid.Row=\"1\"   >M:</TextBlock>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtM\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"1\" Grid.Column=\"2\" Name=\"txtMUnit\" Margin=\"4,0,0,0\"></TextBlock>\n        <!--Row 3-->\n        <TextBlock Grid.Row=\"2\"  >Y:</TextBlock>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"2\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtY\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"2\" Grid.Column=\"2\" Name=\"txtYUnit\" Margin=\"4,0,0,0\"></TextBlock>\n\n        <!--Row 4-->\n        <TextBlock Grid.Row=\"3\"  >K:</TextBlock>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"3\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtK\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"3\" Grid.Column=\"2\" Name=\"txtKUnit\" Margin=\"4,0,0,0\" />        \n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMYK/CMYKDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.CMYK\n{\n    /// <summary>\n    /// Interaction logic for CMYKDisplay.xaml\n    /// </summary>\n    public partial class CMYKDisplay : UserControl\n    {\n        public enum EDisplayMode\n        {\n            ByteDisplay,\n            PercentNoDecimal\n        }\n        private bool processEvents = true;\n        private static CMYKModel sModel = new CMYKModel();\n        private Func<Color, string> c;\n        private Func<Color, string> m;\n        private Func<Color, string> y;\n        private Func<Color, string> k;\n\n        private Color setColor = Colors.Black;\n        public string CyanFormat { get; set; }\n        public string MagentaFormat { get; set; }\n        public string YellowFormat { get; set; }\n        public string BlackFormat { get; set; }\n        public CMYKDisplay()\n        {\n            InitializeComponent();\n            c = color => sModel.CComponent(color, KGreedieness).ToString(CyanFormat);\n            m = color => sModel.MComponent(color, KGreedieness).ToString(MagentaFormat);\n            y = color => sModel.YComponent(color, KGreedieness).ToString(YellowFormat);\n            k = color => sModel.KComponent(color, KGreedieness).ToString(BlackFormat);\n            CyanFormat = \"N0\";\n            MagentaFormat = \"N0\";\n            YellowFormat = \"N0\";\n            BlackFormat = \"N0\";\n        }\n\n        public static Type ClassType\n        {\n            get { return typeof(CMYKDisplay); }\n        }\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n             new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n\n\n        [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {       var color = (Color) e.NewValue;\n                var display = (CMYKDisplay) d;\n\n            if ((Color)e.NewValue != (Color)e.OldValue && display.setColor != color )\n            {\n                display.OnColorChanged(color);\n            }\n        }\n\n        private void OnColorChanged(Color color)\n        {\n            displayComponents(color);\n            if (ColorChanged != null)\n            {\n                ColorChanged(this, new EventArgs<Color>(color));\n            }\n        }\n\n        #endregion\n\n        #region DisplayMode\n\n        private void displayComponents(Color color)\n        {\n              processEvents = false;\n            txtC.Text = c(color);\n            txtM.Text = m(color);\n            txtY.Text = y(color);\n            txtK.Text = k(color);\n            processEvents =true;\n        }\n\n        public static DependencyProperty DisplayModeProperty = DependencyProperty.Register(\"DisplayMode\", typeof(EDisplayMode), ClassType, new PropertyMetadata(EDisplayMode.ByteDisplay, new PropertyChangedCallback(OnDisplayModeChanged)));\n\n        [Category(\"ColorPicker\")]\n        public EDisplayMode DisplayMode\n        {\n            get\n            {\n                return (EDisplayMode)GetValue(DisplayModeProperty);\n            }\n            set\n            {\n                SetValue(DisplayModeProperty, value);\n            }\n        }\n\n        private static void OnDisplayModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var display = (CMYKDisplay)d;\n            var displayMode = (EDisplayMode)e.NewValue;\n            display.OnDisplayModeChanged(displayMode);\n\n        }\n\n        private void OnDisplayModeChanged(EDisplayMode displayMode)\n        {\n            switch (displayMode)\n            {\n                case EDisplayMode.ByteDisplay:\n                    txtCUnit.Text = \"\";\n                    txtMUnit.Text = \"\";\n                    txtYUnit.Text = \"\";\n                    txtKUnit.Text = \"\";\n                    c = color => sModel.CComponent(color, KGreedieness).ToString(CyanFormat);\n                    m = color => sModel.MComponent(color, KGreedieness).ToString(MagentaFormat);\n                    y = color => sModel.YComponent(color, KGreedieness).ToString(YellowFormat);\n                    k = color => sModel.KComponent(color, KGreedieness).ToString(BlackFormat);\n                    break;\n                case EDisplayMode.PercentNoDecimal:\n                    txtCUnit.Text = \"%\";\n                    txtMUnit.Text = \"%\";\n                    txtYUnit.Text = \"%\";\n                    txtKUnit.Text = \"%\";\n\n                    c = color => sModel.CComponent(color, KGreedieness).PercentageOf(255).ToString(CyanFormat);\n                    m = color => sModel.MComponent(color, KGreedieness).PercentageOf(255).ToString(MagentaFormat);\n                    y = color => sModel.YComponent(color, KGreedieness).PercentageOf(255).ToString(YellowFormat);\n                   k = color => sModel.KComponent(color, KGreedieness).PercentageOf(255).ToString(BlackFormat);\n                    break;\n\n            }\n        }\n\n\n        #endregion\n\n\n        #region KGreedieness\n\npublic static DependencyProperty KGreedienessProperty   = DependencyProperty.Register(\"KGreedieness\", typeof(double), ClassType,\n    new PropertyMetadata(.7,new PropertyChangedCallback(OnKGreedienessChanged),CoerceKGreedieness));\n  [Category(\"ColorPicker\")]\npublic double KGreedieness\n  {\n    get\n        {\n            return (double)GetValue(KGreedienessProperty);\n        }\n        set\n        {\n            SetValue(KGreedienessProperty, value);\n        }\n    }\n\nprivate static object CoerceKGreedieness(DependencyObject d, object value)\n{\n    \nreturn value;\n\n}\n\nprivate static void OnKGreedienessChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n{\n \n}\n\n#endregion\n\n\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n\n\n        private void txtR_PreviewTextInput(object sender, TextCompositionEventArgs e)\n        {\n            e.Handled = NumbersOnly(e.Text);\n            base.OnPreviewTextInput(e);\n\n        }\n\n        private bool NumbersOnly(string text)\n        {\n            String okChars = \"0123456789\";\n            return text.ToCharArray().All(c => okChars.IndexOf(c) == -1);\n        }\n\n\n        private void TextChanged(object sender, TextChangedEventArgs e)\n        {\n            if (processEvents) { \n                try\n                {\n\t\t\t\t\tsetColor = sModel.Color(\n\t\t\t\t\t\tdouble.Parse(txtC.Text, CultureInfo.InvariantCulture),\n\t\t\t\t\t\tdouble.Parse(txtM.Text, CultureInfo.InvariantCulture),\n\t\t\t\t\t\tdouble.Parse(txtY.Text, CultureInfo.InvariantCulture),\n\t\t\t\t\t\tdouble.Parse(txtK.Text, CultureInfo.InvariantCulture));\n                    Color = setColor;                                      \n                }\n                catch\n                {\n                }\n\n            }\n        }\n\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMYK/CMYKModel.cs",
    "content": "﻿using System;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.CMYK\n{\n  public  class CMYKModel\n  {\n\n\n      #region Color\n\n      public enum ECMYKComponent\n      {\n          Cyan = 0,\n          Magenta = 1,\n          Yellow = 2,\n          Black =3\n      }\n\n\n      Color Color(double[] components)\n      {\n          return Color(components[0], components[1], components[2], components[3]);\n      }\n\n      public Color Color(double cyan, double magenta, double yellow, double black)\n      {\n\n          var red =   (255 - cyan - black  ).RestrictToByte()  ;\n          var green = (255 - magenta - black).RestrictToByte();\n          var blue =  (255 - yellow - black).RestrictToByte();\n          return System.Windows.Media.Color.FromRgb( red, green, blue);\n\n      }\n\n       \n\n\n      #endregion\n\n      #region components\n\n      private double MinComponent(Color color)\n      {\n          double c = 255 - color.R;\n          double m = 255 - color.G ;\n          double y = 255 - color.B;\n\n         return   Math.Min(c, Math.Min(m, y));\n      }\n\n      public double CComponent(Color color , Double greedieness)\n      {\n          if (greedieness > 1 || greedieness < 0)\n          {\n              throw new Exception(\"Greedieness must be between 0 and 1\");\n          }\n          var min = MinComponent(color);\n          return 255 - color.R - min * greedieness ;\n      }\n\n      public double CComponent(Color color)\n      {\n          var min = MinComponent(color);\n          return 255 - color.R - min;\n      }\n\n      public Double MComponent(Color color, Double greedieness)\n      {\n          if (greedieness > 1 || greedieness < 0)\n          {\n              throw new Exception(\"Greedieness must be between 0 and 1\");\n          }\n          var min = MinComponent(color);\n          return 255 - color.G - min*greedieness;\n      }\n\n      public Double MComponent(Color color)\n      {\n          var min = MinComponent(color);\n          return 255 - color.G - min;\n      }\n\n      public Double YComponent(Color color, Double greedieness)\n      {\n          var min = MinComponent(color);\n          return 255 - color.B - min * greedieness;\n      }\n\n\n      public Double YComponent(Color color)\n      {\n          var min = MinComponent(color);\n          return 255 - color.B - min;\n      }\n\n      public Double KComponent(Color color, Double greedieness)\n      {\n          var min = MinComponent(color);\n          return min*greedieness;  \n      }\n\n\n       public Double KComponent(Color color)\n       {\n           var min = MinComponent(color);\n           return min;\n       }\n\n      #endregion\n  }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMYK/Cyan.cs",
    "content": "﻿using ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.CMYK\n{\n    class Cyan : ColorComponent\n    {\n        public static CMYKModel sModel = new CMYKModel();\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 100; }\n        }\n\n\n        public override int Value(System.Windows.Media.Color color)\n        {\n           return sModel.CComponent(color).AsPercent();\n        }\n\n        public override string Name\n        {\n            get { return \"CMYK_Cyan\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMYK/Magenta.cs",
    "content": "﻿using ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.CMYK\n{\n    class Magenta : ColorComponent\n    {\n        public static CMYKModel sModel = new CMYKModel();\n\n        public override int MinValue\n        {\n            get {return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get {return 100; }\n        }\n\n        public override int Value(System.Windows.Media.Color color)\n        {\n            return sModel.MComponent(color).AsPercent();\n        }\n\n        public override string Name\n        {\n            get {  return \"CMYK_Magenta\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/CMYK/Yellow.cs",
    "content": "﻿using ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.CMYK\n{\n    class Yellow:ColorComponent \n    {\n        public static CMYKModel sModel = new CMYKModel();\n\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 100; }\n        }\n\n        \n\n        public override int Value(System.Windows.Media.Color color)\n        {\n            return sModel.YComponent(color).AsPercent();\n        }\n\n        public override string Name\n        {\n            get { return \"CMYK_Yellow\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/ColorComponent.cs",
    "content": "﻿using System.Windows.Media;\n\nnamespace ColorPicker.ColorModels\n{\n   public abstract class ColorComponent\n    {\n        //The largest possible value for a component (value when slider at top)\n        public abstract int MaxValue { get; }\n\n        //The smallest possible value for a component (value when slider at bottom)\n        public abstract int MinValue { get; }\n\n       //The value of the component for a given color\n        public abstract int Value(Color color);\n\n       //The name of the color component (used to avoid reflection)\n        public abstract string Name{ get; }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/ColorModel.cs",
    "content": "﻿namespace ColorPicker.ColorModels\n{\n  public abstract   class ColorModel\n    {\n      \n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/HSB/Brightness.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker.ColorModels.HSB\n{\n    class Brightness:NormalComponent \n    {\n        private static readonly HSBModel sModel = new HSBModel();\n\n        public override int MinValue\n        {\n            get {return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get {return 100; }\n        }\n\n        public override void UpdateNormalBitmap(WriteableBitmap bitmap, Color color)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                double iRowUnit = (double)1 / 256;\n                double iRowCurrent = 1;\n                double hue = sModel.HComponent(color);\n                double saturation = sModel.SComponent(color);\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n\n                    Color hueColor = sModel.Color(hue, saturation, iRowCurrent);\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = hueColor.B; //Blue\n                        *(pStart + currentPixel * 3 + 1) = hueColor.G; //Green \n                        *(pStart + currentPixel * 3 + 2) = hueColor.R; //red\n                    }\n\n                    iRowCurrent -= iRowUnit;\n\n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                int currentPixel = -1;\n                double iRowUnit = (double)1 / 256;\n                double iColUnit = (double)360 / 256;\n                double iRowCurrent = 1;\n\n                double r = 0;\n                double g = 0;\n                double b = 0;\n                double brightness = (double)(normalComponentValue)/100;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    double iColCurrent = 359;\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        double hue = iColCurrent;\n                        double saturation  = iRowCurrent;\n                        //Taken from HSBModel for speed purposes\n\n\n\n                        if (saturation == 0)\n                        {\n                            r = g = b = brightness;\n                        }\n                        else\n                        {\n                            // the color wheel consists of 6 sectors. Figure out which sector you're in.\n                            double sectorPos = hue / 60.0;\n                            int sectorNumber = (int)(Math.Floor(sectorPos));\n                            // get the fractional part of the sector\n                            double fractionalSector = sectorPos - sectorNumber;\n\n                            // calculate values for the three axes of the color. \n                            double p = brightness * (1.0 - saturation);\n                            double q = brightness * (1.0 - (saturation * fractionalSector));\n                            double t = brightness * (1.0 - (saturation * (1 - fractionalSector)));\n\n                            // assign the fractional colors to r, g, and b based on the sector the angle is in.\n                            switch (sectorNumber)\n                            {\n                                case 0:\n                                    r = brightness;\n                                    g = t;\n                                    b = p;\n                                    break;\n                                case 1:\n                                    r = q;\n                                    g = brightness;\n                                    b = p;\n                                    break;\n                                case 2:\n                                    r = p;\n                                    g = brightness;\n                                    b = t;\n                                    break;\n                                case 3:\n                                    r = p;\n                                    g = q;\n                                    b = brightness;\n                                    break;\n                                case 4:\n                                    r = t;\n                                    g = p;\n                                    b = brightness;\n                                    break;\n                                case 5:\n                                    r = brightness;\n                                    g = p;\n                                    b = q;\n                                    break;\n                            }\n                        }\n\n\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = Convert.ToByte(g * 255); //Blue\n                        *(pStart + currentPixel * 3 + 1) = Convert.ToByte(b * 255); //Green \n                        *(pStart + currentPixel * 3 + 2) = Convert.ToByte(r * 255); //red\n                        iColCurrent -= iColUnit;\n                    }\n                    iRowCurrent -= iRowUnit;\n                }\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var hue = (359 * selectionPoint.X / 255);\n            var brightness =(double)colorComponentValue/100;\n            var saturation = (1 - (double)selectionPoint.Y / 255);\n            return sModel.Color(hue, saturation, brightness);\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            int x = Convert.ToInt32(sModel.HComponent(color) /359 * 255);\n            int y = 255 - Convert.ToInt32(sModel.SComponent(color) * 255);\n            return new Point(x, y);\n        }\n\n        public override int Value(Color color)\n        {\n            double max = Math.Max(color.R, Math.Max(color.G, color.B));\n            int b =Convert.ToInt32(max*100/255 ) ;\n            return b;\n        }\n\n        public override string Name\n        {\n            get { return \"HSB_Brightness\"; }\n        }\n\n        public override bool IsNormalIndependantOfColor\n        {\n            get { return false; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/HSB/HSBModel.cs",
    "content": "﻿using System;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.HSB\n{\n public  class HSBModel\n    {\n    public enum EHSBComponent\n     {\n         Hue=0,\n         Saturation= 1,\n         Brightness =2\n     }\n\n        Color Color(double[] components)\n        {\n            return Color(components[0], components[1], components[2]);\n        }\n\n        public Color Color(double hue, double saturation, double brightness)\n        {\n            double r = 0;\n            double g = 0;\n            double b = 0;\n\n            if (saturation == 0)\n            {\n                r = g = b =brightness;\n            }\n            else\n            {\n                // the color wheel consists of 6 sectors. Figure out which sector you're in.\n                double sectorPos = hue / 60.0;\n                int sectorNumber = (int)(Math.Floor(sectorPos));\n                // get the fractional part of the sector\n                double fractionalSector = sectorPos - sectorNumber;\n\n                // calculate values for the three axes of the color. \n                double p = brightness * (1.0 - saturation);\n                double q = brightness * (1.0 - (saturation * fractionalSector));\n                double t = brightness * (1.0 - (saturation * (1 - fractionalSector)));\n\n                // assign the fractional colors to r, g, and b based on the sector the angle is in.\n                switch (sectorNumber)\n                {\n                    case 0:\n                        r = brightness;\n                        g = t;\n                        b = p;\n                        break;\n                    case 1:\n                        r = q;\n                        g = brightness;\n                        b = p;\n                        break;\n                    case 2:\n                        r = p;\n                        g = brightness;\n                        b = t;\n                        break;\n                    case 3:\n                        r = p;\n                        g = q;\n                        b = brightness;\n                        break;\n                    case 4:\n                        r = t;\n                        g = p;\n                        b = brightness;\n                        break;\n                    case 5:\n                        r = brightness;\n                        g = p;\n                        b = q;\n                        break;\n                }\n            }\n       \n         \n            return System.Windows.Media.Color.FromRgb(\n                Convert.ToByte(( r * 255.0)),\n                Convert.ToByte(( g * 255.0)),\n                Convert.ToByte(( b * 255.0))\n                );\n\n\n        }\n\n        public double HComponent(Color color)\n        {\n            System.Drawing.Color c = System.Drawing.Color.FromArgb(255,color.R,color.G,color.B );\n            return  c.GetHue();\n        }\n\n        public Double SComponent(Color color)\n        {\n            return color.SaturationHSB();\n        }\n\n        public Double BComponent(Color color)\n        {\n            return color.Brightness();\n        }\n\n     public Double Component(Color color ,int pos)\n     {\n         if (pos == 0)\n         {\n             return HComponent(color);\n         }\n         else if (pos == 1)\n         {\n             return SComponent(color);\n         }\n         else if (pos == 2)\n         {\n             return BComponent(color);\n         }\n         else\n         {\n             throw new Exception(\"The HSB model has only 3 components\");\n         }\n     }\n\n\n     public Double Component(Color color, EHSBComponent component)\n     {\n         return Component(color,(int) component );\n     }\n\n\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/HSB/HsbDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.ColorModels.HSB.HsbDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             Width=\"94\" Height=\"90\">\n    <Grid>\n        <Grid.Resources>\n            <Style TargetType=\"{x:Type TextBox}\">\n                <Setter Property=\"Width\" Value=\"40\" />\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n            <Style TargetType=\"{x:Type RadioButton}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n                <Setter Property=\"Height\" Value=\"16\"/>\n            </Style>\n            <Style TargetType=\"{x:Type TextBlock}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n        </Grid.Resources>\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"30\" />\n            <ColumnDefinition Width=\"44\" />\n            <ColumnDefinition Width=\"20\" />\n        </Grid.ColumnDefinitions>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"28\" />\n            <RowDefinition Height=\"28\" />\n            <RowDefinition Height=\"28\" />\n        </Grid.RowDefinitions>\n        <!--Row 1-->\n        <RadioButton Name=\"rH\"  IsChecked=\"False\" Checked=\"rH_Checked\">H:</RadioButton>\n        <TextBox Grid.Column=\"1\"  Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtH\" PreviewTextInput=\"txtR_PreviewTextInput\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"0\" Grid.Column=\"2\" >°</TextBlock>\n        <!--Row 2-->\n        <RadioButton Grid.Row=\"1\" Name=\"rS\" Checked=\"rS_Checked\">S:</RadioButton>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtS\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"1\" Grid.Column=\"2\" >%</TextBlock>\n        <!--Row 3-->\n        <RadioButton Grid.Row=\"2\" Name=\"rB\" Checked=\"rB_Checked\">B:</RadioButton>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"2\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtB\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"2\" Grid.Column=\"2\" >%</TextBlock>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/HSB/HsbDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.HSB\n{\n    /// <summary>\n    /// Interaction logic for HsbDisplay.xaml\n    /// </summary>\n    public partial class HsbDisplay : UserControl\n    {\n        private static HSBModel sModel = new HSBModel();\n        private static Hue sHue = new Hue();\n        private static Brightness sBrightness = new Brightness();\n        private static Saturation sSaturation = new Saturation();\n\n        public event EventHandler<EventArgs<NormalComponent>> ColorComponentChanged;\n        public static Type ClassType\n        {\n            get { return typeof(HsbDisplay); }\n        }\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n             new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n\n         [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var c = (Color)e.NewValue;\n            var rd = (HsbDisplay)d;\n            rd.OnColorChanged(c);\n        }\n\n        private void OnColorChanged(Color c)\n        {\n            txtH.Text = sHue.Value(c).ToString(CultureInfo.InvariantCulture);\n\t\t\ttxtS.Text = sSaturation.Value(c).ToString(CultureInfo.InvariantCulture);\n\t\t\ttxtB.Text = sBrightness.Value(c).ToString(CultureInfo.InvariantCulture);\n\n            if (ColorChanged != null)\n            {\n                ColorChanged(this, new EventArgs<Color>(c));\n            }\n        }\n\n        #endregion\n\n        #region NormalComponent\n\n        public static DependencyProperty NormalComponentProperty = DependencyProperty.Register(\"NormalComponent\", typeof(NormalComponent), ClassType,\n            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorComponentChanged));\n\n        [Category(\"ColorPicker\")]\n        public NormalComponent NormalComponent\n        {\n            get\n            {\n                return (NormalComponent)GetValue(NormalComponentProperty);\n            }\n            set\n            {\n                SetValue(NormalComponentProperty, value);\n            }\n        }\n\n        private static void OnColorComponentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            try\n            {\n                var cp = (NormalComponent)e.NewValue;\n               \n                var rd = (HsbDisplay)d;\n                rd.OnColorComponentChanged(cp);\n            }\n            catch\n            {\n            }\n        }\n\n        private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)\n        {\n\n            if (colorPlaneColorComponent.Name == \"HSB_Hue\")\n            {\n                rH.IsChecked = true;\n            }\n            else if (colorPlaneColorComponent.Name == \"HSB_Saturation\")\n            {\n                rS.IsChecked = true;\n            }\n            else if (colorPlaneColorComponent.Name == \"HSB_Brightness\")\n            {\n                rB.IsChecked = true;\n            }\n            else\n            {\n                rH.IsChecked = false;\n                rS.IsChecked = false;\n                rB.IsChecked = false;\n            }\n\n            if (ColorComponentChanged != null)\n            {\n                ColorComponentChanged(this, new EventArgs<NormalComponent>(colorPlaneColorComponent));\n            }\n\n\n\n        }\n\n        #endregion\n\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n\n\n        public HsbDisplay()\n        {\n            InitializeComponent();\n\t\t}\n\n\n        private void txtR_PreviewTextInput(object sender, TextCompositionEventArgs e)\n        {\n            e.Handled = NumbersOnly(e.Text);\n            base.OnPreviewTextInput(e);\n\n        }\n\n        private bool NumbersOnly(string text)\n        {\n            String okChars = \"0123456789\";\n            return text.ToCharArray().All(c => okChars.IndexOf(c) == -1);\n        }\n\n\n        private void TextChanged(object sender, TextChangedEventArgs e)\n\t\t{\n\t        if (string.IsNullOrWhiteSpace(txtH.Text) ||\n\t\t        string.IsNullOrWhiteSpace(txtS.Text) ||\n\t\t        string.IsNullOrWhiteSpace(txtB.Text))\n\t        {\n\t\t        return;\n\t        }\n\n\t        try\n            {\n                Color = sModel.Color(\n\t\t\t\t\tConvert.ToDouble(txtH.Text, CultureInfo.InvariantCulture),\n\t\t\t\t\tConvert.ToDouble(txtS.Text, CultureInfo.InvariantCulture) / 100,\n\t\t\t\t\tConvert.ToDouble(txtB.Text, CultureInfo.InvariantCulture) / 100);\n            }\n            catch\n            {\n            }\n        }\n\n        private void rH_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sHue;\n        }\n\n        private void rS_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sSaturation;\n        }\n\n        private void rB_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sBrightness;\n        }\n    }\n\n\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/HSB/Hue.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker.ColorModels.HSB\n{\n    class Hue : NormalComponent \n    {\n        private static readonly HSBModel  sModel = new HSBModel();\n        \n        \n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get {return 359; }\n        }\n\n        public override void UpdateNormalBitmap(WriteableBitmap bitmap, Color color)\n        {\n\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                double iRowUnit = (double)360/256;\n               double iRowCurrent = 359;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n\n                    Color hueColor = sModel.Color(iRowCurrent, 1, 1);\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = hueColor.B ; //Blue\n                        *(pStart + currentPixel * 3 + 1) = hueColor.G; //Green \n                        *(pStart + currentPixel * 3 + 2) = hueColor.R; //red\n                    }\n                         \n                    iRowCurrent -= iRowUnit;\n                  \n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n\n\n        }\n\n        public override void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                int currentPixel = -1;\n                double iRowUnit = (double)1 / 256;\n                double iColUnit = (double)1 / 256;\n                double iRowCurrent = 1;\n                \n                  double r = 0;\n                  double g = 0;\n                  double b = 0;\n                double hue = 359 - normalComponentValue;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                   double iColCurrent = 0;\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        double saturation = iColCurrent;\n                        double brightness = iRowCurrent;\n                        //Taken from HSBModel for speed purposes\n\n                     \n\n                        if (saturation == 0)\n                        {\n                            r = g = b = brightness;\n                        }\n                        else\n                        {\n                            // the color wheel consists of 6 sectors. Figure out which sector you're in.\n                            double sectorPos = hue / 60.0;\n                            int sectorNumber = (int)(Math.Floor(sectorPos));\n                            // get the fractional part of the sector\n                            double fractionalSector = sectorPos - sectorNumber;\n\n                            // calculate values for the three axes of the color. \n                            double p = brightness * (1.0 - saturation);\n                            double q = brightness * (1.0 - (saturation * fractionalSector));\n                            double t = brightness * (1.0 - (saturation * (1 - fractionalSector)));\n\n                            // assign the fractional colors to r, g, and b based on the sector the angle is in.\n                            switch (sectorNumber)\n                            {\n                                case 0:\n                                    r = brightness;\n                                    g = t;\n                                    b = p;\n                                    break;\n                                case 1:\n                                    r = q;\n                                    g = brightness;\n                                    b = p;\n                                    break;\n                                case 2:\n                                    r = p;\n                                    g = brightness;\n                                    b = t;\n                                    break;\n                                case 3:\n                                    r = p;\n                                    g = q;\n                                    b = brightness;\n                                    break;\n                                case 4:\n                                    r = t;\n                                    g = p;\n                                    b = brightness;\n                                    break;\n                                case 5:\n                                    r = brightness;\n                                    g = p;\n                                    b = q;\n                                    break;\n                            }\n                        }\n\n                       \n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = Convert.ToByte( g*255); //Blue\n                        *(pStart + currentPixel * 3 + 1) = Convert.ToByte(b * 255); //Green \n                        *(pStart + currentPixel * 3 + 2) = Convert.ToByte(r * 255); //red\n                        iColCurrent += iColUnit;\n                    }\n                    iRowCurrent -= iRowUnit;\n                }\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n\n        //Original version , however too slow so the hsb calculation was inlined into the function so as to avoid conversion to \n        //color and back.\n        //public override void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue)\n        //{\n        //    unsafe\n        //    {\n        //        bitmap.Lock();\n        //        byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n        //        int currentPixel = -1;\n        //        double iRowUnit = (double)1 / 256;\n        //        double iColUnit = (double)1 / 256;\n        //        double iRowCurrent = 1;\n\n\n        //        for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n        //        {\n        //            double iColCurrent = 0;\n        //            for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n        //            {\n        //                Color hueColor = sModel.Color(normalComponentValue, iColCurrent, iRowCurrent);\n        //                currentPixel++;\n        //                *(pStart + currentPixel * 3 + 0) = hueColor.B; //Blue\n        //                *(pStart + currentPixel * 3 + 1) = hueColor.G; //Green \n        //                *(pStart + currentPixel * 3 + 2) = hueColor.R; //red\n        //                iColCurrent += iColUnit;\n        //            }\n        //            iRowCurrent -= iRowUnit;\n        //        }\n        //        bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n        //        bitmap.Unlock();\n        //    }\n        //}\n\n\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var hue = colorComponentValue;\n            var brightness =  (1 - selectionPoint.Y/255);\n            var saturation =  (selectionPoint.X/255);\n            return sModel.Color(hue, saturation, brightness);\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            int x = Convert.ToInt32(sModel.SComponent(color) * 255);\n            int y = 255 - Convert.ToInt32(sModel.BComponent(color) * 255);\n            return new Point(x,y);\n        }\n\n        public override int Value(Color color)\n        {\n            return Convert.ToInt32(sModel.HComponent( color));\n        }\n\n        public override string Name\n        {\n            get { return \"HSB_Blue\"; }\n        }\n\n        public override bool IsNormalIndependantOfColor\n        {\n            get { return true; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/HSB/Saturation.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker.ColorModels.HSB\n{\n    class Saturation:NormalComponent \n    {\n\n        private static readonly HSBModel sModel = new HSBModel();\n\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 100; }\n        }\n\n        public override void UpdateNormalBitmap(WriteableBitmap bitmap, Color color)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                double iRowUnit = (double)1 / 256;\n                double iRowCurrent = 1;\n                double hue = sModel.HComponent(color);\n                double brightness = sModel.BComponent(color);\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n\n                    Color hueColor = sModel.Color(hue,iRowCurrent,  brightness);\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = hueColor.B; //Blue\n                        *(pStart + currentPixel * 3 + 1) = hueColor.G; //Green \n                        *(pStart + currentPixel * 3 + 2) = hueColor.R; //red\n                    }\n\n                    iRowCurrent -= iRowUnit;\n\n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                int currentPixel = -1;\n                double iRowUnit = (double)1 / 256;\n                double iColUnit = (double)360 / 256;\n                double iRowCurrent = 1;\n\n                double r = 0;\n                double g = 0;\n                double b = 0;\n                double saturation = (double)normalComponentValue/ 100;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    double iColCurrent = 359;\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        double hue = iColCurrent;\n                        double brightness = iRowCurrent;\n                        //Taken from HSBModel for speed purposes\n\n\n\n                        if (saturation == 0)\n                        {\n                            r = g = b = brightness;\n                        }\n                        else\n                        {\n                            // the color wheel consists of 6 sectors. Figure out which sector you're in.\n                            double sectorPos = hue / 60.0;\n                            int sectorNumber = (int)(Math.Floor(sectorPos));\n                            // get the fractional part of the sector\n                            double fractionalSector = sectorPos - sectorNumber;\n\n                            // calculate values for the three axes of the color. \n                            double p = brightness * (1.0 - saturation);\n                            double q = brightness * (1.0 - (saturation * fractionalSector));\n                            double t = brightness * (1.0 - (saturation * (1 - fractionalSector)));\n\n                            // assign the fractional colors to r, g, and b based on the sector the angle is in.\n                            switch (sectorNumber)\n                            {\n                                case 0:\n                                    r = brightness;\n                                    g = t;\n                                    b = p;\n                                    break;\n                                case 1:\n                                    r = q;\n                                    g = brightness;\n                                    b = p;\n                                    break;\n                                case 2:\n                                    r = p;\n                                    g = brightness;\n                                    b = t;\n                                    break;\n                                case 3:\n                                    r = p;\n                                    g = q;\n                                    b = brightness;\n                                    break;\n                                case 4:\n                                    r = t;\n                                    g = p;\n                                    b = brightness;\n                                    break;\n                                case 5:\n                                    r = brightness;\n                                    g = p;\n                                    b = q;\n                                    break;\n                            }\n                        }\n\n\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = Convert.ToByte(g * 255); //Blue\n                        *(pStart + currentPixel * 3 + 1) = Convert.ToByte(b * 255); //Green \n                        *(pStart + currentPixel * 3 + 2) = Convert.ToByte(r * 255); //red\n                        iColCurrent -= iColUnit;\n                    }\n                    iRowCurrent -= iRowUnit;\n                }\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var hue = (359 * selectionPoint.X / 255);\n            var brightness =(1 - selectionPoint.Y / 255);\n            var saturation = (double) colorComponentValue / 100;\n            var color = sModel.Color(hue, saturation, brightness);\n            \n            return color;\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            int x = Convert.ToInt32(sModel.HComponent(color)/359 * 255);\n            int y = 255 - Convert.ToInt32(sModel.BComponent(color) * 255);\n            return new Point(x, y);\n        }\n\n        public override int Value(System.Windows.Media.Color color)\n        {\n\n         \n            return Convert.ToInt32((sModel.SComponent(color)) * 100);\n        }\n\n        public override string Name\n        {\n            get { return \"HSB_Saturation\"; }\n        }\n\n        public override bool IsNormalIndependantOfColor\n        {\n            get {return false; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/HSB/Yellow.cs",
    "content": "﻿namespace ColorPicker.ColorModels.CMY \n{\n    class Yellow:ColorComponent \n    {\n        public static CMYModel sModel = new CMYModel();\n\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 100; }\n        }\n\n        \n\n        public override int Value(System.Windows.Media.Color color)\n        {\n            return (int)sModel.YComponent(color);\n        }\n\n        public override string Name\n        {\n            get { return \"CMY_Yellow\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/Lab/A.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.Lab\n{\n public  sealed class A : NormalComponent \n    {\n        private const double D65X = 0.9505;\n        private const double D65Y = 1.0;\n        private const double D65Z = 1.0890;\n\n        private static LabModel sModel = new LabModel();\n        public override bool IsNormalIndependantOfColor\n        {\n            get { return false; }\n        }\n\n        public override void UpdateNormalBitmap(System.Windows.Media.Imaging.WriteableBitmap bitmap, Color color)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                double iRowUnit = (double) (MaxValue - MinValue )/bitmap.PixelHeight ;\n                double iRowCurrent = 100;\n                double l = sModel.LComponent(color);\n                double b = sModel.BComponent(color);\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n\n                    Color lightness = sModel.Color(l, iRowCurrent, b);\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = lightness.B; //Blue\n                        *(pStart + currentPixel * 3 + 1) = lightness.G; //Green \n                        *(pStart + currentPixel * 3 + 2) = lightness.R; //red\n                    }\n\n                    iRowCurrent -= iRowUnit;\n\n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override void UpdateColorPlaneBitmap(System.Windows.Media.Imaging.WriteableBitmap bitmap, int normalComponentValue)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                int currentPixel = -1;\n                double iRowUnit = (double)100/bitmap.PixelHeight ;\n                var iColUnit = (double)1;\n                double iRowCurrent = 100;\n\n\n                var a = (double)normalComponentValue;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    double l = iRowCurrent;\n                    double iColCurrent = -128;\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        double theta = 6.0 / 29.0;\n                        double b = iColCurrent;\n                        double fy = (l + 16) / 116.0;\n                        double fx = fy + (a / 500.0);\n                        double fz = fy - (b / 200.0);\n\n                        var x = (fx > theta) ? D65X * (fx * fx * fx) : (fx - 16.0 / 116.0) * 3 * (theta * theta) * D65X;\n                        var y = (fy > theta) ? D65Y * (fy * fy * fy) : (fy - 16.0 / 116.0) * 3 * (theta * theta) * D65Y;\n                        var z = (fz > theta) ? D65Z * (fz * fz * fz) : (fz - 16.0 / 116.0) * 3 * (theta * theta) * D65Z;\n\n                        x = (x > 0.9505) ? 0.9505 : ((x < 0) ? 0 : x);\n                        y = (y > 1.0) ? 1.0 : ((y < 0) ? 0 : y);\n                        z = (z > 1.089) ? 1.089 : ((z < 0) ? 0 : z);\n\n                        double[] Clinear = new double[3];\n                        Clinear[0] = x * 3.2410 - y * 1.5374 - z * 0.4986; // red\n                        Clinear[1] = -x * 0.9692 + y * 1.8760 - z * 0.0416; // green\n                        Clinear[2] = x * 0.0556 - y * 0.2040 + z * 1.0570; // blue\n\n                        for (int i = 0; i < 3; i++)\n                        {\n                            Clinear[i] = (Clinear[i] <= 0.0031308) ? 12.92 * Clinear[i] : (1 + 0.055) * Math.Pow(Clinear[i], (1.0 / 2.4)) - 0.055;\n                            Clinear[i] = Math.Min(Clinear[i], 1);\n                            Clinear[i] = Math.Max(Clinear[i], 0);\n\n                        }\n\n\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = Convert.ToByte(Clinear[2] * 255); //Blue\n                        *(pStart + currentPixel * 3 + 1) = Convert.ToByte(Clinear[1] * 255); //Green \n                        *(pStart + currentPixel * 3 + 2) = Convert.ToByte(Clinear[0] * 255); //red\n                        iColCurrent += iColUnit;\n                    }\n                    iRowCurrent -= iRowUnit;\n                }\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var l = (100 - selectionPoint.Y*100/256);\n             var a =  colorComponentValue;\n            var b =selectionPoint.X - 128;\n           \n            return sModel.Color(l, a, b);\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            int x = 128 + Convert.ToInt32(sModel.BComponent(color));\n            int y = 100 - Convert.ToInt32(sModel.LComponent(color));\n            return new Point(x, y);\n        }\n\n        public override int MinValue\n        {\n            get { return -128; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 127; }\n        }\n\n        public override int Value(Color color)\n        {\n           return Convert.ToInt32( sModel.AComponent( color ));\n        }\n\n        public override string Name\n        {\n            get {return \"LAB_A\"; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/Lab/B.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.Lab\n{\n    class B : NormalComponent \n    {\n\n        private const double D65X = 0.9505;\n        private const double D65Y = 1.0;\n        private const double D65Z = 1.0890;\n\n        private static LabModel sModel = new LabModel();\n\n\n        public override bool IsNormalIndependantOfColor\n        {\n            get { return false; }\n        }\n\n        public override void UpdateNormalBitmap(System.Windows.Media.Imaging.WriteableBitmap bitmap, System.Windows.Media.Color color)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                double iRowUnit = (double)(MaxValue - MinValue) / bitmap.PixelHeight;\n                double iRowCurrent = 100;\n                double l = sModel.LComponent(color);\n                double a = sModel.AComponent(color);\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n\n                    Color lightness = sModel.Color(l,a,  iRowCurrent );\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = lightness.B; //Blue\n                        *(pStart + currentPixel * 3 + 1) = lightness.G; //Green \n                        *(pStart + currentPixel * 3 + 2) = lightness.R; //red\n                    }\n\n                    iRowCurrent -= iRowUnit;\n\n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override void UpdateColorPlaneBitmap(System.Windows.Media.Imaging.WriteableBitmap bitmap, int normalComponentValue)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                int currentPixel = -1;\n                double iRowUnit = (double)100 / bitmap.PixelHeight;\n                double iColUnit = (double)1;\n                double iRowCurrent = 100;\n\n\n                double b = (double)normalComponentValue;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    double l = iRowCurrent;\n                    double iColCurrent = -128;\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        double theta = 6.0 / 29.0;\n                        double a = iColCurrent;\n                        double fy = (l + 16) / 116.0;\n                        double fx = fy + (a / 500.0);\n                        double fz = fy - (b / 200.0);\n\n                        var x = (fx > theta) ? D65X * (fx * fx * fx) : (fx - 16.0 / 116.0) * 3 * (theta * theta) * D65X;\n                        var y = (fy > theta) ? D65Y * (fy * fy * fy) : (fy - 16.0 / 116.0) * 3 * (theta * theta) * D65Y;\n                        var z = (fz > theta) ? D65Z * (fz * fz * fz) : (fz - 16.0 / 116.0) * 3 * (theta * theta) * D65Z;\n\n                        x = (x > 0.9505) ? 0.9505 : ((x < 0) ? 0 : x);\n                        y = (y > 1.0) ? 1.0 : ((y < 0) ? 0 : y);\n                        z = (z > 1.089) ? 1.089 : ((z < 0) ? 0 : z);\n\n                        double[] Clinear = new double[3];\n                        Clinear[0] = x * 3.2410 - y * 1.5374 - z * 0.4986; // red\n                        Clinear[1] = -x * 0.9692 + y * 1.8760 - z * 0.0416; // green\n                        Clinear[2] = x * 0.0556 - y * 0.2040 + z * 1.0570; // blue\n\n                        for (int i = 0; i < 3; i++)\n                        {\n                            Clinear[i] = (Clinear[i] <= 0.0031308) ? 12.92 * Clinear[i] : (1 + 0.055) * Math.Pow(Clinear[i], (1.0 / 2.4)) - 0.055;\n                            Clinear[i] = Math.Min(Clinear[i], 1);\n                            Clinear[i] = Math.Max(Clinear[i], 0);\n\n                        }\n\n\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = Convert.ToByte(Clinear[2] * 255); //Blue\n                        *(pStart + currentPixel * 3 + 1) = Convert.ToByte(Clinear[1] * 255); //Green \n                        *(pStart + currentPixel * 3 + 2) = Convert.ToByte(Clinear[0] * 255); //red\n                        iColCurrent += iColUnit;\n                    }\n                    iRowCurrent -= iRowUnit;\n                }\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var l = (100 - (double)selectionPoint.Y * 100 / 256);\n            var a = selectionPoint.X - 128;\n            var b = colorComponentValue;\n\n            return sModel.Color(l, a, b);\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            int x = 128 + Convert.ToInt32(sModel.AComponent(color));\n            int y = 100 - Convert.ToInt32(sModel.LComponent(color));\n            return new Point(x, y);\n        }\n\n        public override int MinValue\n        {\n            get { return -128; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 127; }\n        }\n\n        public override string Name\n        {\n            get { return \"LAB_B\"; }\n        }\n\n        public override int Value(Color color)\n        {\n           return Convert.ToInt32( sModel.BComponent(color));\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/Lab/LabDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.ColorModels.Lab.LabDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n              Width=\"94\" Height=\"90\">\n    <Grid>\n        <Grid.Resources>\n            <Style TargetType=\"{x:Type TextBox}\">\n                <Setter Property=\"Width\" Value=\"40\" />\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n            <Style TargetType=\"{x:Type RadioButton}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n                <Setter Property=\"Height\" Value=\"16\"/>\n            </Style>\n            <Style TargetType=\"{x:Type TextBlock}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n        </Grid.Resources>\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"30\" />\n            <ColumnDefinition Width=\"44\" />\n            <ColumnDefinition Width=\"20\" />\n        </Grid.ColumnDefinitions>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"28\" />\n            <RowDefinition Height=\"28\" />\n            <RowDefinition Height=\"28\" />\n        </Grid.RowDefinitions>\n        <!--Row 1-->\n        <RadioButton Name=\"rL\"  IsChecked=\"False\" Checked=\"rL_Checked\">L:</RadioButton>\n        <TextBox Grid.Column=\"1\"  Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtL\" PreviewTextInput=\"txtR_PreviewTextInput\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"0\" Grid.Column=\"2\" ></TextBlock>\n        <!--Row 2-->\n        <RadioButton Grid.Row=\"1\" Name=\"rA\" Checked=\"rA_Checked\">a:</RadioButton>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtA\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"1\" Grid.Column=\"2\" ></TextBlock>\n        <!--Row 3-->\n        <RadioButton Grid.Row=\"2\" Name=\"rB\" Checked=\"rB_Checked\">b:</RadioButton>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"2\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtB\" TextChanged=\"TextChanged\" />\n        <TextBlock  Grid.Row=\"2\" Grid.Column=\"2\" ></TextBlock>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/Lab/LabDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.Lab\n{\n    /// <summary>\n    /// Interaction logic for LabDisplay.xaml\n    /// </summary>\n    public partial class LabDisplay : UserControl\n    {\n        private bool mProcessEvents = true;\n\n        private static LabModel sModel = new LabModel();\n        private static Lightness sLightness = new Lightness();\n        private static A sA = new A();\n        private static B sB = new B();\n        public static Type ClassType\n        {\n            get { return typeof(LabDisplay); }\n        }\n        public LabDisplay()\n        {\n            InitializeComponent();\n            l = color => sModel.LComponent(color).ToString(LFormat);\n            a = color => sModel.AComponent(color).ToString(AFormat);\n            b = color => sModel.BComponent(color).ToString(BFormat);\n            LFormat = \"N0\";\n            AFormat = \"N0\";\n            BFormat = \"N0\";\n        }\n\n        private Func<Color, string> l;\n        private Func<Color, string> a;\n        private Func<Color, string> b;\n        public string LFormat { get; set; }\n        public string AFormat { get; set; }\n        public string BFormat { get; set; }\n\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n             new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n\n          [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var color = (Color)e.NewValue;\n            var display = (LabDisplay)d;\n            display.OnColorChanged(color);\n        }\n\n        private void OnColorChanged(Color color)\n        {\n            mProcessEvents = false;\n            txtL.Text = l(color);\n            txtA.Text = a(color);\n            txtB.Text = b(color);\n            mProcessEvents = true;\n\n            if (ColorChanged != null)\n            {\n                ColorChanged(this, new EventArgs<Color>(color));\n            }\n        }\n\n        #endregion\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n\n\n        #region NormalComponent\n\n        public static DependencyProperty NormalComponentProperty = DependencyProperty.Register(\"NormalComponent\", typeof(NormalComponent), ClassType,\n            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorComponentChanged));\n\n        [Category(\"ColorPicker\")]\n        public NormalComponent NormalComponent\n        {\n            get\n            {\n                return (NormalComponent)GetValue(NormalComponentProperty);\n            }\n            set\n            {\n                SetValue(NormalComponentProperty, value);\n            }\n        }\n\n        private static void OnColorComponentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            try\n            {\n                var cp = (NormalComponent)e.NewValue;\n                var rd = (LabDisplay)d;\n                rd.OnColorComponentChanged(cp);\n            }\n            catch\n            {\n            }\n        }\n\n        #endregion\n\n        private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)\n        {\n\n            if (colorPlaneColorComponent.Name == \"LAB_Lightness\")\n            {\n                rL.IsChecked = true;\n            }\n            else if (colorPlaneColorComponent.Name == \"LAB_A\")\n            {\n                rA.IsChecked = true;\n            }\n            else if (colorPlaneColorComponent.Name == \"LAB_B\")\n            {\n                rB.IsChecked = true;\n            }\n            else\n            {\n                rL.IsChecked = false;\n                rA.IsChecked = false;\n                rB.IsChecked = false;\n            }\n\n         \n\n\n        }\n\n\n\n        private void txtR_PreviewTextInput(object sender, TextCompositionEventArgs e)\n        {\n            e.Handled = NumbersOnly(e.Text);\n            base.OnPreviewTextInput(e);\n\n        }\n\n        private bool NumbersOnly(string text)\n        {\n            String okChars = \"0123456789\";\n            return text.ToCharArray().All(c => okChars.IndexOf(c) == -1);\n        }\n\n\n        private void TextChanged(object sender, TextChangedEventArgs e)\n        {\n            if (mProcessEvents)\n            {\n                try\n                {\n                    Color = sModel.Color(\n\t\t\t\t\t\tConvert.ToDouble(txtL.Text, CultureInfo.InvariantCulture),\n\t\t\t\t\t\tConvert.ToDouble(txtA.Text, CultureInfo.InvariantCulture),\n\t\t\t\t\t\tConvert.ToDouble(txtB.Text, CultureInfo.InvariantCulture));\n                }\n                catch (Exception ex)\n                {\n                    Debug.WriteLine(ex.Message);\n                }\n            }\n        }\n\n        private void rL_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sLightness;\n        }\n\n        private void rA_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sA;\n        }\n\n        private void rB_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sB;\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/Lab/LabModel.cs",
    "content": "﻿using System;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.Lab\n{\n\tclass LabModel\n\t{\n\t\tprivate const double D65X = 0.9505;\n\t\t private const double D65Y =1.0;\n\t\t private const double D65Z = 1.0890;\n\n\t\tpublic Color Color (double l, double a , double b)\n\t\t{\n\t\t\tdouble theta = 6.0/29.0;\n\n\t\t\tdouble fy = (l+16)/116.0;\n\t\t\tdouble fx = fy + (a/500.0);\n\t\t\tdouble fz = fy - (b/200.0);\n\n\t\t\tvar x = (fx > theta) ? D65X*(fx*fx*fx) : (fx - 16.0/116.0)*3*(theta*theta)*D65X;\n\t\t\tvar y = (fy > theta) ? D65Y*(fy*fy*fy) : (fy - 16.0/116.0)*3*(theta*theta)*D65Y;\n\t\t\tvar z =\t(fz > theta)?D65Z * (fz*fz*fz) : (fz - 16.0/116.0)*3*(theta*theta)*D65Z;\n\n            x = (x > 0.9505) ? 0.9505 : ((x < 0) ? 0 : x);\n            y = (y > 1.0) ? 1.0 : ((y < 0) ? 0 : y);\n            z = (z > 1.089) ? 1.089 : ((z < 0) ? 0 : z);\n\n\t\t\tdouble[] Clinear = new double[3];\n\t\t\tClinear[0] = x*3.2410 - y*1.5374 - z*0.4986; // red\n\t\t\tClinear[1] = -x*0.9692 + y*1.8760 - z*0.0416; // green\n\t\t\tClinear[2] = x*0.0556 - y*0.2040 + z*1.0570; // blue\n\n\t\t\tfor(int i=0; i<3; i++)\n\t\t\t{\n\t\t\t\tClinear[i] = (Clinear[i]<=0.0031308)? 12.92*Clinear[i] : (1+0.055)* Math.Pow(Clinear[i], (1.0/2.4)) - 0.055;\n\t\t\t\tClinear[i] = Math.Min(Clinear[i], 1);\n\t\t\t\tClinear[i] = Math.Max(Clinear[i], 0);\n\t\t\t}\n\n\t\t\treturn System.Windows.Media.Color.FromRgb(\n\t\t\t\tConvert.ToByte(Clinear[0]*255.0),\n\t\t\t\tConvert.ToByte(Clinear[1]*255.0),\n\t\t\t\tConvert.ToByte(Clinear[2]*255.0));\n\t\t\t\t\n\n\t\t\t \n\t\t}\n\t\tpublic double LComponent(Color color)\n\t\t{\n\t\t\t// normalize red, green, blue values\n\t\t\tdouble rLinear = color.R / 255.0;\n\t\t\tdouble gLinear = color.G / 255.0;\n\t\t\tdouble bLinear = color.B / 255.0;\n\n\t\t\tdouble r = (rLinear > 0.04045) ? Math.Pow((rLinear + 0.055) / (1 + 0.055), 2.2) : (rLinear / 12.92);\n\t\t\tdouble g = (gLinear > 0.04045) ? Math.Pow((gLinear + 0.055) / (1 + 0.055), 2.2) : (gLinear / 12.92);\n\t\t\tdouble b = (bLinear > 0.04045) ? Math.Pow((bLinear + 0.055) / (1 + 0.055), 2.2) : (bLinear / 12.92);\n\n\t\t \n\t\t\tdouble CIEY = r * 0.2126 + g * 0.7152 + b * 0.0722;\n\t\t\t \n\n\t\t\tdouble l = 116.0 * Fxyz(CIEY / D65Y) - 16;\n\t\t\treturn l;\n\t\t}\n\n\t\tpublic double AComponent(Color color)\n\t\t{\n\t\t\tdouble rLinear = color.R / 255.0;\n\t\t\tdouble gLinear = color.G / 255.0;\n\t\t\tdouble bLinear = color.B / 255.0;\n\n\t\t\tdouble r = (rLinear > 0.04045) ? Math.Pow((rLinear + 0.055) / (1 + 0.055), 2.2) : (rLinear / 12.92);\n\t\t\tdouble g = (gLinear > 0.04045) ? Math.Pow((gLinear + 0.055) / (1 + 0.055), 2.2) : (gLinear / 12.92);\n\t\t\tdouble b = (bLinear > 0.04045) ? Math.Pow((bLinear + 0.055) / (1 + 0.055), 2.2) : (bLinear / 12.92);\n\n\t\t\tdouble CIEX = r * 0.4124 + g * 0.3576 + b * 0.1805;\n\t\t\tdouble CIEY = r * 0.2126 + g * 0.7152 + b * 0.0722;\n\t\t \n\n\n\t\t\tdouble a = 500.0 * (Fxyz(CIEX / D65X) - Fxyz(CIEY / D65Y));\n\t\t\treturn a;\n\t\t}\n\t\t\t\n\t\t\n\t\tpublic double BComponent(Color color)\n\t\t{\n\t\t\tdouble rLinear = color.R / 255.0;\n\t\t\tdouble gLinear = color.G / 255.0;\n\t\t\tdouble bLinear = color.B / 255.0;\n\n\t\t\tdouble r = (rLinear > 0.04045) ? Math.Pow((rLinear + 0.055) / (1 + 0.055), 2.2) : (rLinear / 12.92);\n\t\t\tdouble g = (gLinear > 0.04045) ? Math.Pow((gLinear + 0.055) / (1 + 0.055), 2.2) : (gLinear / 12.92);\n\t\t\tdouble b = (bLinear > 0.04045) ? Math.Pow((bLinear + 0.055) / (1 + 0.055), 2.2) : (bLinear / 12.92);\n\n\t\t\n\t\t\tdouble CIEY = r * 0.2126 + g * 0.7152 + b * 0.0722;\n\t\t\tdouble CIEZ = r * 0.0193 + g * 0.1192 + b * 0.9505;\n\n\n\t\t\treturn  200.0 * (Fxyz(CIEY / D65Y) - Fxyz(CIEZ / D65Z));\n\t\t\t \n\t\t}\n\t\t \n\t\tprivate static double Fxyz(double t)\n\t\t{\n\n\t\t\treturn ((t > 0.008856)? Math.Pow(t, (1.0/3.0)) : (7.787*t + 16.0/116.0));\n\t\t}\n\t\t \n\t}\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/Lab/Lightness.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.Lab\n{\nsealed\tclass Lightness:NormalComponent \n\t{\n\t\tprivate static LabModel sModel = new LabModel();\n\t\tpublic override bool IsNormalIndependantOfColor\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override void UpdateNormalBitmap(System.Windows.Media.Imaging.WriteableBitmap bitmap, System.Windows.Media.Color color)\n\t\t{\n\t\t\tunsafe\n\t\t\t{\n\t\t\t\tbitmap.Lock();\n\t\t\t\tint currentPixel = -1;\n\t\t\t\tbyte* pStart = (byte*)(void*)bitmap.BackBuffer;\n\t\t\t\tdouble iRowUnit = (double)100 / 256;\n\t\t\t\tdouble iRowCurrent = 100;\n\t\t\t\tdouble a = sModel.AComponent(color);\n\t\t\t\tdouble b = sModel.BComponent(color);\n\t\t\t\tfor (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n\t\t\t\t{\n\n\t\t\t\t\tColor lightness = sModel.Color(iRowCurrent, a, b);\n\t\t\t\t\tfor (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentPixel++;\n\t\t\t\t\t\t*(pStart + currentPixel * 3 + 0) = lightness.B; //Blue\n\t\t\t\t\t\t*(pStart + currentPixel * 3 + 1) = lightness.G; //Green \n\t\t\t\t\t\t*(pStart + currentPixel * 3 + 2) = lightness.R; //red\n\t\t\t\t\t}\n\n\t\t\t\t\tiRowCurrent -= iRowUnit;\n\n\t\t\t\t}\n\n\t\t\t\tbitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n\t\t\t\tbitmap.Unlock();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void UpdateColorPlaneBitmap(System.Windows.Media.Imaging.WriteableBitmap bitmap, int normalComponentValue)\n\t\t{\n\t\t\tunsafe\n\t\t\t{\n\t\t\t\tbitmap.Lock();\n\t\t\t\tbyte* pStart = (byte*)(void*)bitmap.BackBuffer;\n\t\t\t\tint currentPixel = -1;\n\t\t\t\tdouble iRowUnit = (double)1  ;\n\t\t\t\tdouble iColUnit = (double)1 ;\n\t\t\t\tdouble iRowCurrent = 127;\n\n\t\t\t  \n\t\t\t\tdouble l = (double)normalComponentValue ;\n\t\t\t\tfor (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n\t\t\t\t{\n\t\t\t\t\tdouble b= iRowCurrent;\n\t\t\t\t\tdouble iColCurrent = -128;\n\t\t\t\t\tfor (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble theta = 6.0 / 29.0;\n\t\t\t\t\t\tdouble a = iColCurrent;\n\t\t\t\t\t\tdouble fy = (l + 16) / 116.0;\n\t\t\t\t\t\tdouble fx = fy + (a / 500.0);\n\t\t\t\t\t\tdouble fz = fy - (b / 200.0);\n\n\t\t\t\t\t\tvar x = (fx > theta) ? D65X * (fx * fx * fx) : (fx - 16.0 / 116.0) * 3 * (theta * theta) * D65X;\n\t\t\t\t\t\tvar y = (fy > theta) ? D65Y * (fy * fy * fy) : (fy - 16.0 / 116.0) * 3 * (theta * theta) * D65Y;\n\t\t\t\t\t\tvar z = (fz > theta) ? D65Z * (fz * fz * fz) : (fz - 16.0 / 116.0) * 3 * (theta * theta) * D65Z;\n\n                        x = (x > 0.9505) ? 0.9505 : ((x < 0) ? 0 : x);\n                        y = (y > 1.0) ? 1.0 : ((y < 0) ? 0 : y);\n                        z = (z > 1.089) ? 1.089 : ((z < 0) ? 0 : z);\n\n\t\t\t\t\t\tdouble[] Clinear = new double[3];\n\t\t\t\t\t\tClinear[0] = x * 3.2410 - y * 1.5374 - z * 0.4986; // red\n\t\t\t\t\t\tClinear[1] = -x * 0.9692 + y * 1.8760 - z * 0.0416; // green\n\t\t\t\t\t\tClinear[2] = x * 0.0556 - y * 0.2040 + z * 1.0570; // blue\n\n\t\t\t\t\t\tfor (int i = 0; i < 3; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tClinear[i] = (Clinear[i] <= 0.0031308) ? 12.92 * Clinear[i] : (1 + 0.055) * Math.Pow(Clinear[i], (1.0 / 2.4)) - 0.055;\n                            Clinear[i] = Math.Min(Clinear[i], 1);\n                            Clinear[i] = Math.Max(Clinear[i], 0);\n\t\t\t \n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tcurrentPixel++;\n\t\t\t\t\t\t*(pStart + currentPixel * 3 + 0) = Convert.ToByte(Clinear[2] * 255); //Blue\n\t\t\t\t\t\t*(pStart + currentPixel * 3 + 1) = Convert.ToByte(Clinear[1] * 255); //Green \n\t\t\t\t\t\t*(pStart + currentPixel * 3 + 2) = Convert.ToByte(Clinear[0] * 255); //red\n\t\t\t\t\t\tiColCurrent += iColUnit;\n\t\t\t\t\t}\n\t\t\t\t\tiRowCurrent -= iRowUnit;\n\t\t\t\t}\n\t\t\t\tbitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n\t\t\t\tbitmap.Unlock();\n\t\t\t}\n\t\t}\n\n\t\tpublic override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n\t\t{\n\t\t\tvar l = colorComponentValue;\n\t\t\tvar b = ( 127 - selectionPoint.Y  );\n\t\t\tvar a =  selectionPoint.X -128;\n\t\t\treturn sModel.Color(l, a, b);\n\t\t}\n\n\t\tpublic override Point PointFromColor(Color color)\n\t\t{\n\t\t\tint x =128 + Convert.ToInt32(sModel.AComponent(color));\n            int y = 128 - Convert.ToInt32(sModel.BComponent(color));\n\t\t\treturn new Point(x, y);\n\t\t}\n\n\t\tpublic override int MinValue\n\t\t{\n\t\t\tget { return 0; }\n\t\t}\n\n\t\tpublic override int MaxValue\n\t\t{\n\t\t\tget { return 100; }\n\t\t}\n\n\t\tpublic override int Value(System.Windows.Media.Color color)\n\t\t{\n\t\t   return Convert.ToInt32( sModel.LComponent(color));\n\t\t}\n\n\t\tpublic override string Name\n\t\t{\n\t\t\tget {return \"LAB_Lightness\"; }\n\t\t}\n\t\tprivate const double D65X = 0.9505;\n\t\tprivate const double D65Y = 1.0;\n\t\tprivate const double D65Z = 1.0890;\n\t\tprivate static double Fxyz(double t)\n\t\t{\n\n\t\t\treturn ((t > 0.008856) ? Math.Pow(t, (1.0 / 3.0)) : (7.787 * t + 16.0 / 116.0));\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/NormalComponent.cs",
    "content": "﻿using System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker.ColorModels\n{\n    public abstract class NormalComponent : ColorComponent\n    {\n        //Is the Normal bitmap independent of the specific color (false for all but Hue of HSB)\n        public abstract bool IsNormalIndependantOfColor { get; } \n\n        //Updates the normal Bitmap (The bitmap with the slider)\n        public abstract void UpdateNormalBitmap(WriteableBitmap bitmap, Color color);\n\n        //Updates the color plane bitmap (the bitmap where one selects the colors)\n        public abstract void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue);\n\n        //Gets the color corresponding to a selected point (with 255 alpha)\n        public abstract Color  ColorAtPoint(Point selectionPoint,int colorComponentValue);\n\n        //Gets the point on the color plane that corresponds to the color (alpha ignored)\n        public abstract Point PointFromColor(Color color);\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/RGB/Blue.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker.ColorModels.RGB\n{\n  public  class Blue : NormalComponent\n    {\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 255; }\n        }\n\n        public override void UpdateNormalBitmap(WriteableBitmap bitmap, Color color)\n        {\n\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = (byte)(255 - iRow); //Blue\n                        *(pStart + currentPixel * 3 + 1) = color.G; //Green \n                        *(pStart + currentPixel * 3 + 2) = color.R; //red\n                    }\n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n\n             \n        }\n\n        public override void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue)\n        {\n                    unsafe\n                    {\n                        bitmap.Lock();\n                        byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                        int currentPixel = -1;\n                        for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                        {\n                            for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                                {\n                                        currentPixel++;\n                                        *(pStart + currentPixel * 3 + 0) = (byte)normalComponentValue; //Blue\n                                        *(pStart + currentPixel * 3 + 1) = (byte)(255 - iRow); //Green \n                                        *(pStart + currentPixel * 3 + 2) = (byte)(iCol); //red\n                                }\n                        }\n                        bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                        bitmap.Unlock();\n                    }\n        }\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var blue = (byte)colorComponentValue ;\n            var green= (byte)Math.Round(255 - selectionPoint.Y);\n            var red = (byte)Math.Round(selectionPoint.X);\n            return Color.FromRgb(red, green, blue);\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            return new Point(color.R, 255 - color.G);\n        }\n\n        public override int Value(Color color)\n        {\n            return color.B;\n        }\n\n        public override string Name\n        {\n            get { return \"RGB_Blue\"; }\n        }\n\n        public override bool IsNormalIndependantOfColor\n        {\n            get { return false; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/RGB/Green.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker.ColorModels.RGB\n{\n public   class Green : NormalComponent\n    {\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 255; }\n        }\n\n        public override void UpdateNormalBitmap(WriteableBitmap bitmap, Color color)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = color.B; //Blue\n                        *(pStart + currentPixel * 3 + 1) = (byte)(255 - iRow); //Green \n                        *(pStart + currentPixel * 3 + 2) = color.R; //red\n                    }\n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = (byte)(iCol); //Blue\n                        *(pStart + currentPixel * 3 + 1) = (byte)normalComponentValue; //Green \n                        *(pStart + currentPixel * 3 + 2) = (byte)(255 - iRow); //red\n                    }\n                }\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var blue = (byte)Math.Round(selectionPoint.X);\n            var green = (byte)colorComponentValue;\n            var red = (byte)Math.Round(255 - selectionPoint.Y);\n            return Color.FromRgb(red, green, blue);\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            return new Point(color.B, 255 - color.R);\n        }\n\n        public override int Value(Color color)\n        {\n            return color.G;\n        }\n\n        public override string Name\n        {\n            get { return \"RGB_Green\"; }\n        }\n\n        public override bool IsNormalIndependantOfColor\n        {\n            get { return false; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/RGB/RGBModel.cs",
    "content": "﻿using System;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ColorModels.RGB\n{\n    class RGBModel:ColorModel\n    {\n        public enum EComponents\n        {\n            Red,\n            Green, \n            Blue\n        }\n\n        public double Distance (Color  color1, Color color2)\n        {\n            return Math.Sqrt(\n                Math.Pow(color1.R - color2.R,2) + \n                Math.Pow(color1.G - color2.G,2) + \n                Math.Pow(color1.B - color2.B,2)  \n                );\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/RGB/Red.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace ColorPicker.ColorModels.RGB\n{\n  public  class Red : NormalComponent\n    {\n        public override int MinValue\n        {\n            get { return 0; }\n        }\n\n        public override int MaxValue\n        {\n            get { return 255; }\n        }\n\n        public override void UpdateNormalBitmap(WriteableBitmap bitmap, Color color)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = color.B; //Blue\n                        *(pStart + currentPixel * 3 + 1) = color.G; //Green \n                        *(pStart + currentPixel * 3 + 2) = (byte)(255 - iRow); //red\n                    }\n                }\n\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n\n        }\n\n        public override void UpdateColorPlaneBitmap(WriteableBitmap bitmap, int normalComponentValue)\n        {\n            unsafe\n            {\n                bitmap.Lock();\n                int currentPixel = -1;\n                byte* pStart = (byte*)(void*)bitmap.BackBuffer;\n                for (int iRow = 0; iRow < bitmap.PixelHeight; iRow++)\n                {\n                    for (int iCol = 0; iCol < bitmap.PixelWidth; iCol++)\n                    {\n                        currentPixel++;\n                        *(pStart + currentPixel * 3 + 0) = (byte)(iCol); //Blue\n                        *(pStart + currentPixel * 3 + 1) = (byte)(255 - iRow); //Green \n                        *(pStart + currentPixel * 3 + 2) = (byte) normalComponentValue; //red\n                    }\n                }\n                bitmap.AddDirtyRect(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight));\n                bitmap.Unlock();\n            }\n        }\n\n        public override Color ColorAtPoint(Point selectionPoint, int colorComponentValue)\n        {\n            var blue = (byte)Math.Round(selectionPoint.X);\n            var green = (byte)Math.Round(255 - selectionPoint.Y);\n            var red = (byte)colorComponentValue;\n            return Color.FromRgb(red, green, blue);\n        }\n\n        public override Point PointFromColor(Color color)\n        {\n            return new Point(color.B, 255 - color.G);\n        }\n\n        public override int Value(Color color)\n        {\n            return color.R;\n        }\n\n        public override string Name\n        {\n            get {return \"RGB_Red\"; }\n        }\n\n        public override bool IsNormalIndependantOfColor\n        {\n            get { return false; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/RGB/RgbDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.ColorModels.RGB.RgbDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" Width=\"auto\"\n             Height=\"auto\">\n    <Grid>\n        <Grid.Resources>\n            <Style TargetType=\"{x:Type TextBox}\">\n                <Setter Property=\"Width\" Value=\"40\" />\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n                <Setter Property=\"Margin\" Value=\"2,2,2,2\"/>\n            </Style>\n            <Style TargetType=\"{x:Type RadioButton}\">\n                <Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n            </Style>\n        </Grid.Resources>\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"auto\" />\n            <ColumnDefinition Width=\"auto\" />\n            <ColumnDefinition Width=\"auto\" />\n        </Grid.ColumnDefinitions>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"auto\" />\n            <RowDefinition Height=\"auto\" />\n            <RowDefinition Height=\"auto\" />\n        </Grid.RowDefinitions>\n        <!--Row 1-->\n        <RadioButton Name=\"rR\" Checked=\"rR_Checked\" IsChecked=\"False\">R:</RadioButton>\n        <TextBox Grid.Column=\"1\"  Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtR\" PreviewTextInput=\"txtR_PreviewTextInput\" TextChanged=\"TextChanged\" />\n        <TextBlock Text=\"\" Grid.Column=\"2\" Name=\"txtRUnit\" />\n        <!--Row 2-->\n        <RadioButton Grid.Row=\"1\" Name=\"rG\" Checked=\"rG_Checked\">G:</RadioButton>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtG\" TextChanged=\"TextChanged\" />\n        <TextBlock Text=\"\" Grid.Column=\"2\" Name=\"txtGUnit\" Grid.Row=\"1\"/>\n        <!--Row 3-->\n        <RadioButton Grid.Row=\"2\" Name=\"rB\" Checked=\"rB_Checked\">B:</RadioButton>\n        <TextBox Grid.Column=\"1\" Grid.Row=\"2\" Height=\"23\" HorizontalAlignment=\"Left\"  Name=\"txtB\" TextChanged=\"TextChanged\" />\n        <TextBlock Text=\"\" Grid.Column=\"2\" Name=\"txtBUnit\" Grid.Row=\"2\"/>\n    </Grid>\n    \n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorModels/RGB/RgbDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker.ColorModels.RGB\n{\n    /// <summary>\n    /// Interaction logic for RgbDisplay.xaml\n    /// </summary>\n    public partial class RgbDisplay : UserControl\n    {\n        public enum EDisplayMode\n        {\n            ByteDisplay,\n            PercentNoDecimal\n        }\n\n        private bool processEvents = true;\n\n        private Func< Color,string> r;\n        private Func<Color, string> g;\n        private Func<Color, string> b;\n\n        private Func<Color, byte, Color> setR;\n        private Func<Color, byte, Color> setG;\n        private Func<Color, byte, Color> setB;\n\n        public static Type ClassType\n        {\n            get { return typeof (RgbDisplay); }\n        }\n        public RgbDisplay()\n        {\n            InitializeComponent();\n\t\t\tr = c => c.R.ToString(CultureInfo.InvariantCulture);\n\t\t\tg = c => c.G.ToString(CultureInfo.InvariantCulture);\n\t\t\tb = c => c.B.ToString(CultureInfo.InvariantCulture);\n\n\n            setR = (c, newR) => c.WithR(newR);\n            setG = (c, newG) => c.WithG(newG);\n            setB = (c, newB) => c.WithB(newB);\n        }\n\n\n\n\n        private static  Red sRed = new Red();\n        private static Green sGreen = new Green();\n        private static Blue sBlue = new Blue();\n\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n        \n        public event EventHandler<EventArgs<NormalComponent>> ColorComponentChanged;\n\n\n        #region DisplayMode\n\n        public static DependencyProperty DisplayModeProperty = DependencyProperty.Register(\"DisplayMode\", typeof(EDisplayMode), ClassType, new PropertyMetadata(EDisplayMode.ByteDisplay, OnDisplayModeChanged));\n\n        [Category(\"ColorPicker\")]\n        public EDisplayMode DisplayMode\n        {\n            get\n            {\n                return (EDisplayMode)GetValue(DisplayModeProperty);\n            }\n            set\n            {\n                SetValue(DisplayModeProperty, value);\n            }\n        }\n\n        private static void OnDisplayModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var display = (RgbDisplay) d;\n            var displayMode = (EDisplayMode) e.NewValue;\n            display.OnDisplayModeChanged(displayMode);\n\n        }\n\n        private void OnDisplayModeChanged( EDisplayMode displayMode)\n        {\n           switch (displayMode)\n           {\n               case EDisplayMode.ByteDisplay :\n                   txtRUnit.Text  = \"\";\n                   txtGUnit.Text = \"\";\n                   txtBUnit.Text = \"\";\n\n\t\t\t\t   r = c => c.R.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t   g = c => c.G.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t   b = c => c.B.ToString(CultureInfo.InvariantCulture);\n\n                   setR = (c, newR) => c.WithR(newR);\n                   setG = (c, newG) => c.WithG(newG);\n                   setB = (c, newB) => c.WithB(newB);\n\n                   break;\n               case EDisplayMode.PercentNoDecimal :\n                   txtRUnit.Text  = \"%\";\n                   txtGUnit.Text = \"%\";\n                   txtBUnit.Text = \"%\";\n\n\t\t\t\t   r = c => c.R.AsPercent().ToString(CultureInfo.InvariantCulture);\n\t\t\t\t   g = c => c.G.AsPercent().ToString(CultureInfo.InvariantCulture);\n\t\t\t\t   b = c => c.B.AsPercent().ToString(CultureInfo.InvariantCulture);\n\n                  setR = (c, newR) => c.WithR(FromPercent(newR));\n                   setG = (c, newG) => c.WithG(FromPercent(newG));\n                   setB = (c, newB) => c.WithB(FromPercent(newB));\n                   break;\n\n           }\n                   processEvents = false;\n                   txtR.Text = r(Color);\n                   txtG.Text = g(Color);\n                   txtB.Text = b(Color);\n                   processEvents = true;\n        }\n\n        #endregion\n\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n             new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n\n        [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var c = (Color) e.NewValue;\n            var rd = (RgbDisplay) d;\n            rd.OnColorChanged(c);\n        }\n\n        private void OnColorChanged(Color c)\n        {\n            \n           processEvents = false;\n           txtR.Text = r(c);\n           txtG.Text = g(c);\n           txtB.Text = b(c);\n           processEvents = true;\n            if (ColorChanged != null)\n            {\n                ColorChanged(this, new EventArgs<Color>(c));\n            }\n        }\n\n        #endregion\n\n\n        #region NormalComponent\n\n        public static DependencyProperty NormalComponentProperty = DependencyProperty.Register(\"NormalComponent\", typeof(NormalComponent), ClassType,\n            new FrameworkPropertyMetadata(sRed, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,OnColorComponentChanged));\n\n        [Category(\"ColorPicker\")]\n        public NormalComponent NormalComponent\n        {\n            get\n            {\n                return (NormalComponent)GetValue(NormalComponentProperty);\n            }\n            set\n            {\n                SetValue(NormalComponentProperty, value);\n            }\n        }\n\n        private static void OnColorComponentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            try\n            {\n                var cp = (NormalComponent)e.NewValue;\n                var rd = (RgbDisplay) d;\n                rd.OnColorComponentChanged(cp);\n            }catch\n            {\n            }\n        }\n\n        #endregion\n\n        private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent)\n        {\n\n            if (colorPlaneColorComponent.Name == \"RGB_Red\")\n            {\n                 rR.IsChecked = true;\n            }\n            else if (colorPlaneColorComponent.Name == \"RGB_Green\")\n            {\n                 rG.IsChecked = true;\n            }\n            else if (colorPlaneColorComponent.Name == \"RGB_Blue\")\n            {\n                rB.IsChecked = true;\n            }\n            else\n            {\n                rR.IsChecked = false;\n                rG.IsChecked = false;\n                rB.IsChecked = false;\n            }\n\n            if (ColorComponentChanged != null)\n            {\n                ColorComponentChanged(this, new EventArgs<NormalComponent>(colorPlaneColorComponent));\n            }\n\n           \n            \n        }\n\n\n   \n\n        private void rR_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sRed;\n            if (ColorComponentChanged != null)\n            {\n                ColorComponentChanged(this, new EventArgs<NormalComponent>(sRed));\n            }\n        }\n\n        private void rG_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sGreen;\n            if (ColorComponentChanged != null)\n            {\n                ColorComponentChanged(this, new EventArgs<NormalComponent>(sGreen));\n            }\n        }\n\n        private void rB_Checked(object sender, RoutedEventArgs e)\n        {\n            NormalComponent = sBlue;\n            if (ColorComponentChanged != null)\n            {\n                ColorComponentChanged(this, new EventArgs<NormalComponent>(sBlue));\n            }\n        }\n\n\n\n\n\n\n\n        private void TextChanged(object sender, TextChangedEventArgs e)\n        {\n            try\n            {\n                if (processEvents)\n                {\n                    if (sender == txtR)\n                    {\n                        Color = setR(Color, byte.Parse(txtR.Text, CultureInfo.InvariantCulture));\n                    }\n                    else if (sender == txtG)\n                    {\n                        Color = setG(Color, byte.Parse(txtG.Text, CultureInfo.InvariantCulture));\n                    }\n                    else if (sender == txtB)\n                    {\n\t\t\t\t\t\tColor = setB(Color, byte.Parse(txtB.Text, CultureInfo.InvariantCulture));\n                    }\n                    //Color = System.Windows.Media.Color.FromRgb(byte.Parse(txtR.Text), byte.Parse(txtG.Text),\n                    //                                           byte.Parse(txtB.Text));\n                }\n            }catch(Exception ex)\n            {\n                Debug.WriteLine(ex.Message);\n            }\n        }\n\n\n\n        private void txtR_PreviewTextInput(object sender, TextCompositionEventArgs e)\n        {\n            if (processEvents) \n            {\n                e.Handled = NumbersOnly(e.Text);\n                base.OnPreviewTextInput(e); \n            }\n        }\n\n        private bool NumbersOnly(string text)\n        {\n            String okChars = \"0123456789\";\n            return text.ToCharArray().All(c => okChars.IndexOf(c) == -1);\n        }\n\n        public static byte FromPercent(  int percent)\n        {\n            return Convert.ToByte((double)percent / 100 * 255);\n        }\n\n        \n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorPicker.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{059DC6C7-59C6-4ADF-8960-976A02E7498E}</ProjectGuid>\n    <OutputType>library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>ColorPicker</RootNamespace>\n    <AssemblyName>ColorPicker</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <TargetFrameworkProfile>\n    </TargetFrameworkProfile>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AlphaDisplay.xaml.cs\">\n      <DependentUpon>AlphaDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ColorDisplay.xaml.cs\">\n      <DependentUpon>ColorDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ColorModels\\CMYK\\Black.cs\" />\n    <Compile Include=\"ColorModels\\CMYK\\CMYKDisplay.xaml.cs\">\n      <DependentUpon>CMYKDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ColorModels\\CMYK\\CMYKModel.cs\" />\n    <Compile Include=\"ColorModels\\CMYK\\Cyan.cs\" />\n    <Compile Include=\"ColorModels\\CMYK\\Magenta.cs\" />\n    <Compile Include=\"ColorModels\\CMYK\\Yellow.cs\" />\n    <Compile Include=\"ColorModels\\CMY\\CMYDisplay.xaml.cs\">\n      <DependentUpon>CMYDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ColorModels\\CMY\\CMYModel.cs\" />\n    <Compile Include=\"ColorModels\\CMY\\Cyan.cs\" />\n    <Compile Include=\"ColorModels\\CMY\\Magenta.cs\" />\n    <Compile Include=\"ColorModels\\HSB\\Yellow.cs\" />\n    <Compile Include=\"ColorModels\\ColorComponent.cs\" />\n    <Compile Include=\"ColorModels\\NormalComponent.cs\" />\n    <Compile Include=\"ColorModels\\ColorModel.cs\" />\n    <Compile Include=\"ColorModels\\HSB\\Brightness.cs\" />\n    <Compile Include=\"ColorModels\\HSB\\HsbDisplay.xaml.cs\">\n      <DependentUpon>HsbDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ColorModels\\HSB\\HSBModel.cs\" />\n    <Compile Include=\"ColorModels\\HSB\\Hue.cs\" />\n    <Compile Include=\"ColorModels\\HSB\\Saturation.cs\" />\n    <Compile Include=\"ColorModels\\Lab\\A.cs\" />\n    <Compile Include=\"ColorModels\\Lab\\B.cs\" />\n    <Compile Include=\"ColorModels\\Lab\\LabDisplay.xaml.cs\">\n      <DependentUpon>LabDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ColorModels\\Lab\\LabModel.cs\" />\n    <Compile Include=\"ColorModels\\Lab\\Lightness.cs\" />\n    <Compile Include=\"ColorModels\\RGB\\Blue.cs\" />\n    <Compile Include=\"ColorModels\\RGB\\Green.cs\" />\n    <Compile Include=\"ColorModels\\RGB\\Red.cs\" />\n    <Compile Include=\"ColorModels\\RGB\\RgbDisplay.xaml.cs\">\n      <DependentUpon>RgbDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"ColorModels\\RGB\\RGBModel.cs\" />\n    <Compile Include=\"ColorSelector.xaml.cs\">\n      <DependentUpon>ColorSelector.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"EventArgs.cs\" />\n    <Compile Include=\"ExtensionMethods\\ByteExtensionMethods.cs\" />\n    <Compile Include=\"ExtensionMethods\\ColorExtensionMethods.cs\" />\n    <Compile Include=\"ExtensionMethods\\DoubleExtensionMethods.cs\" />\n    <Compile Include=\"HexDisplay.xaml.cs\">\n      <DependentUpon>HexDisplay.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"NewCurrent.xaml.cs\">\n      <DependentUpon>NewCurrent.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <AppDesigner Include=\"Properties\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Page Include=\"AlphaDisplay.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"CheckerBoardBrush.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"ColorDisplay.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"ColorModels\\CMYK\\CMYKDisplay.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"ColorModels\\CMY\\CMYDisplay.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"ColorModels\\HSB\\HsbDisplay.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"ColorModels\\Lab\\LabDisplay.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"ColorModels\\RGB\\RgbDisplay.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"ColorSelector.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"HexDisplay.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"NewCurrent.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"SliderResources.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Resources\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "3rdparty/ColorPicker/ColorSelector.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.ColorSelector\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n            \n             mc:Ignorable=\"d\" Height=\"270\" Width=\"314\"  >\n    <UserControl.Resources>\n        <ResourceDictionary>\n            <ResourceDictionary.MergedDictionaries>\n                <ResourceDictionary Source=\"SliderResources.xaml\"/>\n            </ResourceDictionary.MergedDictionaries>\n        </ResourceDictionary>\n    </UserControl.Resources>\n    <Grid>\n        <Border BorderBrush=\"Gray\" BorderThickness=\"2\"    Margin=\"0,0,0,0\" SnapsToDevicePixels=\"True\"  Height=\"260\" Width=\"260\" HorizontalAlignment=\"Left\" >\n            <Grid ClipToBounds=\"True\">\n                <Image HorizontalAlignment=\"Left\" Name=\"colorPlane\" Stretch=\"Uniform\" VerticalAlignment=\"Top\" SnapsToDevicePixels=\"True\"  Height=\"256\" Width=\"256\" MouseMove=\"colorPlane_MouseMove\" />\n                <Ellipse Width=\"11\" Height=\"11\" Stroke=\"White\" Name=\"selectionEllipse\" />\n                <Ellipse Width=\"13\" Height=\"13\" Stroke=\"Black\" Name=\"selectionOuterEllipse\" />\n            </Grid>\n        </Border>\n\n        <Border  BorderBrush=\"Gray\" BorderThickness=\"2\"   Grid.Column=\"1\" Grid.Row=\"1\" Margin=\"272,0,0,0\"  SnapsToDevicePixels=\"True\" Width=\"28\" Height=\"260\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\" >\n            <Image Height=\"256\" HorizontalAlignment=\"Left\"  Name=\"normalColorImage\" Stretch=\"Fill\" VerticalAlignment=\"Top\" Width=\"24\"  SnapsToDevicePixels=\"True\" MouseDown=\"normalColorImage_MouseDown\" MouseMove=\"normalColorImage_MouseMove\" />\n        </Border>\n        <Slider Height=\"268\" HorizontalAlignment=\"Left\" Margin=\"292,0,0,0\" Maximum=\"255\" Name=\"sNormal\" Orientation=\"Vertical\" Style=\"{DynamicResource SliderStyle}\" VerticalAlignment=\"center\" Width=\"28\" ValueChanged=\"sNormal_ValueChanged\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/ColorSelector.xaml.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing ColorPicker.ColorModels;\nusing ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker\n{\n    /// <summary>\n    /// Interaction logic for ColorSelector.xaml\n    /// </summary>\n    public partial class ColorSelector : UserControl\n    {\n        \n        public enum ESelectionRingMode\n        {\n            white,\n            Black,\n            BlackAndWhite,\n            BlackOrWhite\n        }\n\n        private enum EColorChangeSource\n        {\n            ColorPropertySet,\n            MouseDown,\n            SliderMove,\n\n        }\n\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n\n        private bool ProcessSliderEvents { get; set; }\n\n        private EColorChangeSource mColorChangeSource = EColorChangeSource.ColorPropertySet;\n        private readonly TranslateTransform selectionTransform = new TranslateTransform();\n\n\n\n        private readonly WriteableBitmap mSelectionPane = new WriteableBitmap(256, 256, 96, 96, PixelFormats.Bgr24, null);\n        private readonly WriteableBitmap mNormalPane = new WriteableBitmap(24, 256, 96, 96, PixelFormats.Bgr24, null);\n\n        public static Type ClassType\n        {\n            get { return typeof(ColorSelector); }\n        }\n\n        public ColorSelector()\n        {\n            InitializeComponent();\n\n\n\n            NormalComponent = new ColorModels.HSB.Hue();\n            colorPlane.Source = mSelectionPane;\n            normalColorImage.Source = mNormalPane;\n\n            colorPlane.MouseDown += colorPlane_MouseDown;\n            selectionEllipse.RenderTransform = selectionTransform;\n            selectionOuterEllipse.RenderTransform = selectionTransform;\n            ProcessSliderEvents = true;\n        }\n\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n        [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n             \n            var c = (Color)e.NewValue;\n            var oldC = (Color)e.OldValue;\n            if (c != oldC)\n            {\n                var cs = (ColorSelector)d;\n                cs.OnColorChanged(c);\n            }\n        }\n\n        private void OnColorChanged(Color color)\n        {\n            if (mColorChangeSource == EColorChangeSource.ColorPropertySet)\n            {\n                UpdateColorPlaneBitmap(NormalComponent.Value(color));\n                SelectionPoint = NormalComponent.PointFromColor(color);\n                selectionTransform.X = SelectionPoint.X - (mSelectionPane.PixelWidth / 2.0);\n                selectionTransform.Y = SelectionPoint.Y - (mSelectionPane.PixelHeight / 2.0);\n\n\n                sNormal.Value = NormalComponent.Value(color);\n\n                if (!NormalComponent.IsNormalIndependantOfColor)\n                {\n                    NormalComponent.UpdateNormalBitmap(mNormalPane, color);\n                }\n\n            }\n\n            if (SelectionRingMode == ESelectionRingMode.BlackOrWhite)\n            {\n                AdjustSelectionRing(color);\n            }\n            if (ColorChanged != null)\n            {\n                ColorChanged(this, new EventArgs<Color>(color));\n            }\n        }\n\n        private  void AdjustSelectionRing(Color c)\n        {\n            if (Color.Brightness() > .6)\n            {\n                selectionEllipse.Stroke = new SolidColorBrush(Colors.Black);\n            }\n            else\n            {\n                selectionEllipse.Stroke = new SolidColorBrush(Colors.White);\n            };\n        }\n\n\n        #endregion\n\n        #region NormalComponent\n\n        public static DependencyProperty NormalComponentProperty = DependencyProperty.Register(\"NormalComponent\", typeof(NormalComponent),\n            ClassType, new FrameworkPropertyMetadata(new ColorModels.HSB.Hue(), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnNormalComponentChanged));\n        [Category(\"ColorPicker\")]\n        public NormalComponent NormalComponent\n        {\n            get\n            {\n                return (NormalComponent)GetValue(NormalComponentProperty);\n            }\n            set\n            {\n                SetValue(NormalComponentProperty, value);\n            }\n        }\n\n        private static void OnNormalComponentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            try\n            {\n                var cc = (NormalComponent)e.NewValue;\n                var cs = (ColorSelector)d;\n                cs.OnNormalComponentChanged(cc);\n            }\n            catch (Exception ex)\n            {\n                Debug.WriteLine(ex.Message);\n            }\n        }\n\n        private void OnNormalComponentChanged(NormalComponent cc)\n        {\n\n            SelectionPoint = cc.PointFromColor(Color);\n            selectionTransform.X = SelectionPoint.X - (colorPlane.ActualWidth / 2);\n            selectionTransform.Y = SelectionPoint.Y - (colorPlane.ActualHeight / 2);\n            ProcessSliderEvents = false;\n            sNormal.Minimum = cc.MinValue;\n            sNormal.Maximum = cc.MaxValue;\n            sNormal.Value = cc.Value(Color);\n            ProcessSliderEvents = true;\n            cc.UpdateNormalBitmap(mNormalPane, Color);\n            cc.UpdateColorPlaneBitmap(mSelectionPane, cc.Value(Color));\n\n        }\n\n\n        #endregion\n\n        #region SelectionRingMode\n\n        public static DependencyProperty SelectionRingModeProperty = DependencyProperty.Register(\"SelectionRingMode\", typeof(ESelectionRingMode), ClassType, new PropertyMetadata(ESelectionRingMode.BlackAndWhite, OnSelectionRingModeChanged));\n\n         [Category(\"ColorPicker\")]\n        public ESelectionRingMode SelectionRingMode\n        {\n            get\n            {\n                return (ESelectionRingMode)GetValue(SelectionRingModeProperty);\n            }\n            set\n            {\n                SetValue(SelectionRingModeProperty, value);\n            }\n        }\n\n        private static void OnSelectionRingModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var colorSelector = (ColorSelector) d;\n            var selectionRingMode = (ESelectionRingMode) e.NewValue;\n            colorSelector.OnSelectionRingModeChanged(selectionRingMode);\n        }\n\n        private void  OnSelectionRingModeChanged(ESelectionRingMode selectionRingMode)\n        {\n            switch (selectionRingMode )\n            {\n                case ESelectionRingMode.Black:\n                    selectionEllipse.Stroke = new SolidColorBrush(Colors.Black);\n                    selectionOuterEllipse.Visibility = Visibility.Collapsed;\n                    break;\n                case ESelectionRingMode.white:\n                    selectionEllipse.Stroke = new SolidColorBrush(Colors.White);\n                    selectionOuterEllipse.Visibility = Visibility.Collapsed;\n                    break;\n                case ESelectionRingMode.BlackAndWhite:\n                      selectionEllipse.Stroke = new SolidColorBrush(Colors.White);\n                    selectionOuterEllipse.Visibility = Visibility.Visible ;\n                    break;\n                case ESelectionRingMode.BlackOrWhite:\n                    AdjustSelectionRing(Color);\n                       \n                    selectionOuterEllipse.Visibility = Visibility.Collapsed;\n                    break;  \n            }\n        }\n\n        #endregion\n\n\n        #region Event Handlers\n\n        void colorPlane_MouseDown(object sender, MouseButtonEventArgs e)\n        {\n\n            mColorChangeSource = EColorChangeSource.MouseDown;\n\n            ProcessMousedown(e.GetPosition((IInputElement)sender));\n\n\n            mColorChangeSource = EColorChangeSource.ColorPropertySet;\n\t\t\te.Handled = true;\n        }\n\n        private void ProcessMousedown(Point selectionPoint)\n        {\n            SelectionPoint = selectionPoint;\n            selectionTransform.X = SelectionPoint.X - (colorPlane.ActualWidth / 2);\n            selectionTransform.Y = SelectionPoint.Y - (colorPlane.ActualHeight / 2);\n            var newColor = NormalComponent.ColorAtPoint(SelectionPoint, (int)sNormal.Value);\n            if (!NormalComponent.IsNormalIndependantOfColor)\n            {\n                NormalComponent.UpdateNormalBitmap(mNormalPane, newColor);\n            }\n            Color = newColor;\n\n        }\n\n\n        private void sNormal_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)\n        {\n\n            mColorChangeSource = EColorChangeSource.SliderMove;\n            if (ProcessSliderEvents)\n            {\n                ProcessSliderEvents = false;\n                Color = NormalComponent.ColorAtPoint(SelectionPoint, (int)e.NewValue);\n                UpdateColorPlaneBitmap((int)e.NewValue);\n                ProcessSliderEvents = true;\n            }\n            mColorChangeSource = EColorChangeSource.ColorPropertySet;\n\n        }\n\n        private void colorPlane_MouseMove(object sender, MouseEventArgs e)\n        {\n            mColorChangeSource = EColorChangeSource.MouseDown;\n\n            if (Mouse.LeftButton == MouseButtonState.Pressed)\n            {\n                var point = e.GetPosition((IInputElement)sender);\n                if (point.X != 256 && point.Y != 256) //Avoids problem that occurs when dragging to edge of colorPane\n                {\n\n                    ProcessMousedown(point);\n                }\n            }\n\n\n            mColorChangeSource = EColorChangeSource.ColorPropertySet;\n\t\t\te.Handled = true;\n        }\n\n        private void normalColorImage_MouseDown(object sender, MouseButtonEventArgs e)\n        {\n            var yPos = (e.GetPosition((IInputElement)sender)).Y;\n            var proportion = 1 - yPos / 255;\n            var componentRange = NormalComponent.MaxValue - NormalComponent.MinValue;\n\n            var normalValue = NormalComponent.MinValue + proportion * componentRange;\n\n            sNormal.Value = normalValue;\n\t        e.Handled = true;\n        }\n        #endregion\n\n\n        private int lastColorComponentValue = -1;\n        private string lastComponentName = \"\";\n        private void UpdateColorPlaneBitmap(int colorComponentValue)\n        {\n\n            if (lastColorComponentValue != colorComponentValue || lastComponentName != NormalComponent.Name)\n            {\n                NormalComponent.UpdateColorPlaneBitmap(mSelectionPane, colorComponentValue);\n                lastColorComponentValue = colorComponentValue;\n                lastComponentName = NormalComponent.Name;\n            }\n        }\n\n\n\n        private Point SelectionPoint { get; set; }\n\n\n        public void IncrementNormalSlider()\n        {\n            sNormal.Value++;\n        }\n\n        private void normalColorImage_MouseMove(object sender, MouseEventArgs e)\n        {\n            if (Mouse.LeftButton == MouseButtonState.Pressed)\n            {\n                var yPos = (e.GetPosition((IInputElement)sender)).Y;\n                var proportion = 1 - yPos / 255;\n                var componentRange = NormalComponent.MaxValue - NormalComponent.MinValue;\n\n                var normalValue = NormalComponent.MinValue + proportion * componentRange;\n\n                sNormal.Value = normalValue;\n\t            e.Handled = true;\n            }\n\n        }\n\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/EventArgs.cs",
    "content": "﻿using System;\n\nnamespace ColorPicker\n{\n    public class EventArgs<T> : EventArgs\n    {\n        public EventArgs(T value)\n        {\n            mValue = value;\n        }\n\n        private readonly T mValue;\n\n        public T Value\n        {\n            get { return mValue; }\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ExtensionMethods/ByteExtensionMethods.cs",
    "content": "﻿using System;\n\nnamespace ColorPicker.ExtensionMethods\n{\n    public static class ByteExtensionMethods\n    {\n        public static int AsPercent(this byte number)\n        {\n            return Convert.ToInt32((double)number / 255 * 100);\n        }\n\n    }\n\n     \n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/ExtensionMethods/ColorExtensionMethods.cs",
    "content": "﻿using System;\nusing System.Windows.Media;\n\nnamespace ColorPicker.ExtensionMethods\n{\n    public static class ColorExtensionMethods\n    {\n        public static double Intensity(this Color color)\n        {\n            return (double)(color.R  + color.G  + color.B  ) /( 3 * 255);\n        }\n\n        public static double Brightness(this Color color)\n        {\n            return (double)Math.Max(Math.Max(color.R, color.G), color.B) / 255;\n        }\n\n        public static double SaturationHSB(this Color color)\n        {\n            var max = (double)Math.Max(Math.Max(color.R, color.G), color.B) / 255;\n            if (max == 0) return 0;\n            var min = (double)Math.Min(Math.Min(color.R, color.G), color.B) / 255;\n            return (max - min)/max;\n        }\n\n        public static double Lightness(this Color color)\n        {\n             var max = (double)Math.Max(Math.Max(color.R, color.G), color.B) / 255;\n             var min = (double)Math.Min(Math.Min(color.R, color.G), color.B) / 255;\n             return (max + min)/2;\n        }\n\n        public static double Chroma(this Color color)\n        {\n            var max = (double)Math.Max(Math.Max(color.R, color.G), color.B) / 255;\n            var min = (double)Math.Min(Math.Min(color.R, color.G), color.B) / 255;\n            return max - min;\n        }\n\n        public static double SaturationHSL(this Color color)\n        {\n            var max = (double)Math.Max(Math.Max(color.R, color.G), color.B) / 255;\n            var min = (double)Math.Min(Math.Min(color.R, color.G), color.B) / 255;\n            var chroma = max - min;\n\n            var lightness = (max + min)/2;\n            if (lightness <= .5)\n            {\n                return chroma/(2*lightness);\n            }\n            return chroma / (2 - 2 * lightness);\n        }\n\n\n        public static Color WithAlpha(this Color color, byte alpha)\n        {\n            return Color.FromArgb(alpha, color.R, color.G, color.B);\n        }\n\n        public static Color WithR(this Color color, byte r)\n        {\n            return Color.FromArgb(color.A , r, color.G, color.B);\n        }\n\n        public static Color WithG(this Color color, byte g)\n        {\n            return Color.FromArgb(color.A, color.R,g, color.B);\n        }\n        public static Color WithB(this Color color, byte b)\n        {\n            return Color.FromArgb(color.A, color.R, color.G, b);\n        }\n       \n    }\n}"
  },
  {
    "path": "3rdparty/ColorPicker/ExtensionMethods/DoubleExtensionMethods.cs",
    "content": "﻿using System;\n\nnamespace ColorPicker.ExtensionMethods\n{\n public static   class DoubleExtensionMethods\n    {\n\n     public static int AsPercent (this double number)\n     {\n         return Convert.ToInt32(number*100);\n     }\n\n     public static  double PercentageOf(this double number , double value)\n     {\n         return (number/value)*100;\n     }\n\n     public static double RestrictToRange(this double number , double min, double max)\n     {\n         return Math.Min(Math.Max(number, min), max);\n     }\n\n     public static byte RestrictToByte(this double number)\n     {\n         return Convert.ToByte(number.RestrictToRange(0,255));\n     }\n\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/HexDisplay.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.HexDisplay\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n            Height=\"25\" Width=\"60\">\n    <Grid>\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"10\" />\n            <ColumnDefinition Width=\"60\" />\n        </Grid.ColumnDefinitions>\n        <TextBlock >#</TextBlock>\n        <TextBox Grid.Column=\"1\" Name=\"txtHex\"> </TextBox>\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/HexDisplay.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace ColorPicker\n{\n    /// <summary>\n    /// Interaction logic for HexDisplay.xaml\n    /// </summary>\n    public partial class HexDisplay : UserControl\n    {\n\n        public enum EAlphaByteVisibility\n        {\n            visible,\n            hidden, \n            auto //show if Alpha byte not ff\n        }\n        public static Type ClassType\n        {\n            get { return typeof(HexDisplay); }\n        }\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType,\n             new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnColorChanged));\n\n        [ Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var c = (Color)e.NewValue;\n            var rd = (HexDisplay)d;\n            rd.OnColorChanged(c);\n        }\n\n        private void OnColorChanged(Color c)\n        {\n            string colorText = \"\";\n\n            if (IsNumberSignIncludedInText)\n            {\n                colorText=\"#\";\n            }\n           switch (AlphaByteVisibility )\n           {\n               case EAlphaByteVisibility.visible:\n                    colorText += c.ToString().Substring(1);\n                   break;\n               case EAlphaByteVisibility.hidden :\n                    colorText += c.ToString().Substring(3);\n                   break;\n               case EAlphaByteVisibility.auto :\n                   break;\n           }\n\n\n            txtHex.Text = colorText;\n            if (ColorChanged != null)\n            {\n                ColorChanged(this, new EventArgs<Color>(c));\n            }\n        }\n\n        #endregion\n\n        #region Text\n\n        public static DependencyProperty TextProperty = DependencyProperty.Register(\"Text\", typeof(string), ClassType, new PropertyMetadata(\"\", new PropertyChangedCallback(OnTextChanged)));\n\n        public string Text\n        {\n            get\n            {\n                return (string)GetValue(TextProperty);\n            }\n            set\n            {\n                SetValue(TextProperty, value);\n            }\n        }\n\n        private static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var display = (HexDisplay) d;\n            var oldtext = (string) e.OldValue;\n            var newText = (String) e.NewValue;\n\n        }\n\n        #endregion\n\n        #region IsNumberSignIncludedInText\n\n        public static DependencyProperty IsNumberSignIncludedInTextProperty = DependencyProperty.Register(\"IsNumberSignIncludedInText\", typeof(bool), ClassType, \n            new PropertyMetadata(false, OnIsNumberSignIncludedInTextChanged));\n\n         [Category(\"ColorPicker\")]\n        public bool IsNumberSignIncludedInText\n        {\n            get\n            {\n                return (bool)GetValue(IsNumberSignIncludedInTextProperty);\n            }\n            set\n            {\n                SetValue(IsNumberSignIncludedInTextProperty, value);\n            }\n        }\n\n        private static void OnIsNumberSignIncludedInTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n\n        }\n\n        #endregion\n\n        #region AlphaByteVisibility\n\n        public static DependencyProperty AlphaByteVisibilityProperty = DependencyProperty.Register(\"AlphaByteVisibility\", typeof(EAlphaByteVisibility), ClassType,\n            new PropertyMetadata(EAlphaByteVisibility.hidden, OnAlphaByteVisibilityChanged));\n         [Category(\"ColorPicker\")]\n        public EAlphaByteVisibility AlphaByteVisibility\n        {\n            get\n            {\n                return (EAlphaByteVisibility)GetValue(AlphaByteVisibilityProperty);\n            }\n            set\n            {\n                SetValue(AlphaByteVisibilityProperty, value);\n            }\n        }\n\n        private static void OnAlphaByteVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n\n        }\n\n        #endregion\n\n\n\n        public HexDisplay()\n        {\n            InitializeComponent();\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/NewCurrent.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPicker.NewCurrent\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             d:DesignHeight=\"100\" d:DesignWidth=\"100\">\n    <UserControl.Resources>\n        <DrawingBrush Viewport=\"0.0,0.0,0.1,0.4\" TileMode=\"Tile\"    x:Key=\"CheckerBoard\"   >\n\n            <DrawingBrush.Drawing>\n                <DrawingGroup>\n                    <GeometryDrawing Brush=\"White\">\n                        <GeometryDrawing.Geometry>\n                            <RectangleGeometry Rect=\"0,0,10,10\" />\n                        </GeometryDrawing.Geometry>\n                    </GeometryDrawing>\n\n                    <GeometryDrawing>\n                        <GeometryDrawing.Geometry>\n                            <GeometryGroup>\n                                <RectangleGeometry Rect=\"0,0,5,5\" />\n                                <RectangleGeometry Rect=\"5,5,5,5\" />\n                            </GeometryGroup>\n                        </GeometryDrawing.Geometry>\n                        <GeometryDrawing.Brush>\n                            <SolidColorBrush Color=\"#d7d7d7\"/>\n\n                        </GeometryDrawing.Brush>\n                    </GeometryDrawing>\n                </DrawingGroup>\n            </DrawingBrush.Drawing>\n        </DrawingBrush>\n\n    </UserControl.Resources>\n    <Grid Name=\"LayoutRoot\">\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"*\"/>\n        </Grid.ColumnDefinitions>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"auto\" />\n            <RowDefinition Height=\"35*\" />\n        </Grid.RowDefinitions>\n        <TextBlock HorizontalAlignment=\"Center\" Name=\"tbNew\">new</TextBlock>\n        <Rectangle Grid.Row=\"1\" Name=\"rNewBG\" Fill=\"{StaticResource CheckerBoard}\" />\n        <Rectangle Grid.Row=\"1\" Name=\"rNew\" Fill=\"gray\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPicker/NewCurrent.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\n\nnamespace ColorPicker\n{\n    /// <summary>\n    /// Interaction logic for NewCurrent.xaml\n    /// </summary>\n    public partial class NewCurrent : UserControl\n    {\n        public static Type ClassType\n        {\n            get { return typeof(NewCurrent); }\n        }\n\n        public NewCurrent()\n        {\n            InitializeComponent();\n        }\n\n        #region NewColor\n\n        public static DependencyProperty NewColorProperty = DependencyProperty.Register(\"NewColor\", typeof(Color), ClassType, \n            new FrameworkPropertyMetadata(Colors.Gray, new PropertyChangedCallback(OnNewColorChanged)));\n         [Category(\"ColorPicker\")]\n        public Color NewColor\n        {\n            get\n            {\n                return (Color)GetValue(NewColorProperty);\n            }\n            set\n            {\n                SetValue(NewColorProperty, value);\n            }\n        }\n\n        private static void OnNewColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var nc = (NewCurrent)d;\n            nc.rNew.Fill = new SolidColorBrush(((Color)e.NewValue).WithAlpha(nc.Alpha));\n\n        }\n\n        #endregion\n\n        #region CurrentColor\n\n        public static DependencyProperty CurrentColorProperty = DependencyProperty.Register(\"CurrentColor\", typeof(Color), ClassType, \n            new FrameworkPropertyMetadata(Colors.Black, new PropertyChangedCallback(OnCurrentColorChanged)));\n\n        /// <summary>\n        /// The color being selected \n        /// </summary>\n         [Category(\"ColorPicker\")]\n        public Color CurrentColor\n        {\n            get\n            {\n                return (Color)GetValue(CurrentColorProperty);\n            }\n            set\n            {\n                SetValue(CurrentColorProperty, value);\n            }\n        }\n\n        private static void OnCurrentColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n\t\t\t//Ignore\n        }\n\n        #endregion\n\n        #region Alpha\n\n        public static DependencyProperty AlphaProperty = DependencyProperty.Register(\"Alpha\", typeof(byte), ClassType, new PropertyMetadata((byte)255, new PropertyChangedCallback(OnAlphaChanged)));\n        /// <summary>\n        /// The Alpha Component of the currrent color\n        /// </summary>\n          [Category(\"ColorPicker\")]\n        public byte Alpha\n        {\n            get\n            {\n                return (byte)GetValue(AlphaProperty);\n            }\n            set\n            {\n                SetValue(AlphaProperty, value);\n            }\n        }\n\n        private static void OnAlphaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var nc = (NewCurrent)d;\n            nc.rNew.Fill = new SolidColorBrush(nc.NewColor.WithAlpha(Convert.ToByte(e.NewValue)));\n        }\n\n        #endregion\n\n        //public bool ShowLabels { get; set; }\n\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ColorPicker\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Microsoft\")]\n[assembly: AssemblyProduct(\"ColorPicker\")]\n[assembly: AssemblyCopyright(\"Copyright © Microsoft 2010\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n    //(used if a resource is not found in the page, \n    // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n    //(used if a resource is not found in the page, \n    // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n\n[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(\"ColorPickerTests\")]"
  },
  {
    "path": "3rdparty/ColorPicker/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace ColorPicker.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"ColorPicker.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "3rdparty/ColorPicker/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace ColorPicker.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPicker/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "3rdparty/ColorPicker/SliderResources.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n    <LinearGradientBrush x:Key=\"BrightnessGradient\" StartPoint=\"0,1\" EndPoint=\"0,0\" \n        ColorInterpolationMode=\"ScRgbLinearInterpolation\">\n        <GradientStop Offset=\"0\" Color=\"sc# 1, 0,0,0\" />\n        <GradientStop Offset=\"0.5\" Color=\"sc# 1, 0.5,0.5,0.5\" />\n        <GradientStop Offset=\"1\" Color=\"sc# 1, 1,1,1\" />\n    </LinearGradientBrush>\n    <SolidColorBrush x:Key=\"HorizontalSliderTrackNormalBackground\" Color=\"#FFF0EDE0\"/>\n    <LinearGradientBrush x:Key=\"HorizontalSliderTrackNormalBorder\" EndPoint=\"0,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FFAEB1AF\" Offset=\"0.1\"/>\n        <GradientStop Color=\"White\" Offset=\".9\"/>\n    </LinearGradientBrush>\n    <Style x:Key=\"SliderRepeatButtonStyle\" TargetType=\"{x:Type RepeatButton}\">\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Setter Property=\"IsTabStop\" Value=\"false\"/>\n        <Setter Property=\"Focusable\" Value=\"false\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n                    <Border Background=\"Transparent\"/>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <SolidColorBrush x:Key=\"SliderThumbBackground\" Color=\"#F3F3EF\"/>\n    <Geometry x:Key=\"SliderThumbOuterBorderGeometry\">M 5,-9 A 1.5 1.5 0 0 0 3.5,-10.5 L -3.5,-10.5 A 1.5 1.5 0 0 0 -5,-9 L -5,9 A 1.5 1.5 0 0 0 -3.5,10.5 L 3.5,10.5 A 1.5 1.5 0 0 0 5,9 Z</Geometry>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbTopAccent\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#70D66F\" Offset=\"0\"/>\n        <GradientStop Color=\"#46CA44\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <Geometry x:Key=\"SliderThumbTopAccentGeometry\">M 4.5,-8 L 4.5,-10 L -4.5,-10 L -4.5,-8 Z</Geometry>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbBottomAccent\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#46CA44\" Offset=\"0\"/>\n        <GradientStop Color=\"#1B9B1A\" Offset=\".8\"/>\n    </LinearGradientBrush>\n    <Geometry x:Key=\"SliderThumbBottomAccentGeometry\">M 4.5,8 L 4.5,10 L -4.5,10 L -4.5,8 Z</Geometry>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbShadeGradient\" EndPoint=\"1,0\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#40FFFFFF\" Offset=\"0\"/>\n        <GradientStop Color=\"#00FFFFFF\" Offset=\".3\"/>\n        <GradientStop Color=\"#00000000\" Offset=\".7\"/>\n        <GradientStop Color=\"#40000000\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbBorder\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FFBECBD3\" Offset=\"0\"/>\n        <GradientStop Color=\"#FF72838D\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbTopAccentHover\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FBCE7C\" Offset=\"0\"/>\n        <GradientStop Color=\"#F7B335\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbBottomAccentHover\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FAC055\" Offset=\"0\"/>\n        <GradientStop Color=\"#C7902A\" Offset=\".8\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbTopAccentPressed\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#70BA66\" Offset=\"0\"/>\n        <GradientStop Color=\"#229412\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbBottomAccentPressed\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#46A638\" Offset=\"0\"/>\n        <GradientStop Color=\"#1B770E\" Offset=\".8\"/>\n    </LinearGradientBrush>\n    <Style x:Key=\"HorizontalSliderThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Setter Property=\"Height\" Value=\"22\"/>\n        <Setter Property=\"Width\" Value=\"11\"/>\n        <Setter Property=\"Foreground\" Value=\"Green\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Canvas SnapsToDevicePixels=\"true\">\n                        <Canvas.RenderTransform>\n                            <TranslateTransform X=\"5.5\" Y=\"11\"/>\n                        </Canvas.RenderTransform>\n                        <Path x:Name=\"Background\" Fill=\"{StaticResource SliderThumbBackground}\" Data=\"{StaticResource SliderThumbOuterBorderGeometry}\"/>\n                        <Path x:Name=\"TopAccent\" Fill=\"{StaticResource HorizontalSliderThumbTopAccent}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderThumbTopAccentGeometry}\"/>\n                        <Path x:Name=\"BottomAccent\" Fill=\"{StaticResource HorizontalSliderThumbBottomAccent}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderThumbBottomAccentGeometry}\"/>\n                        <Path x:Name=\"OuterBorder\" Fill=\"{StaticResource HorizontalSliderThumbShadeGradient}\" Stroke=\"{StaticResource HorizontalSliderThumbBorder}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderThumbOuterBorderGeometry}\"/>\n                      \n                    </Canvas>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentHover}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentHover}\"/>\n                        </Trigger>\n                        <Trigger Property=\"Foreground\" Value=\"Orange\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentHover}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentHover}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsDragging\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentPressed}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentPressed}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsEnabled\" Value=\"false\">\n                            <Setter Property=\"Fill\" TargetName=\"Background\" Value=\"#FFF5F4EA\"/>\n                            <Setter Property=\"Stroke\" TargetName=\"OuterBorder\" Value=\"#FFD6D4C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"#FFD2D0C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"#FFBCBAAE\"/>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <SolidColorBrush x:Key=\"SliderThumbBackgroundInverted\" Color=\"#F3F3EF\"/>\n    <Geometry x:Key=\"SliderPointedThumbOuterBorderGeometry\">M 5,-8 A 1.5 1.5 0 0 0 3.5,-9.5 L -3.5,-9.5 A 1.5 1.5 0 0 0 -5,-8 L -5,5.5 L 0,10.5 L 5,5.5 Z</Geometry>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbTopAccentInverted\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#46CA44\" Offset=\"1\"/>\n        <GradientStop Color=\"#1B9B1A\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <Geometry x:Key=\"SliderPointedThumbTopAccentGeometry\">M 4.5,-6 L 4.5,-9 L -4.5,-9 L -4.5,-6 Z</Geometry>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbBottomAccentInverted\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#70D66F\" Offset=\"1\"/>\n        <GradientStop Color=\"#46CA44\" Offset=\".2\"/>\n    </LinearGradientBrush>\n    <Geometry x:Key=\"SliderPointedThumbBottomAccentGeometry\">M 4.5,4 L 0,8.5 L -4.5,4 L -4.5,5 L 0,10 L 4.5,5 Z</Geometry>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbShadeGradientInverted\" EndPoint=\"1,0\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#40FFFFFF\" Offset=\"1\"/>\n        <GradientStop Color=\"#00FFFFFF\" Offset=\".7\"/>\n        <GradientStop Color=\"#00000000\" Offset=\".3\"/>\n        <GradientStop Color=\"#40000000\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbBorderInverted\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FFBECBD3\" Offset=\"1\"/>\n        <GradientStop Color=\"#FF72838D\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbTopAccentHoverInverted\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FAC055\" Offset=\"1\"/>\n        <GradientStop Color=\"#C7902A\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbBottomAccentHoverInverted\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FBCE7C\" Offset=\"1\"/>\n        <GradientStop Color=\"#F7B335\" Offset=\".2\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"HorizontalSliderThumbTopAccentPressedInverted\" EndPoint=\"1,1\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#46A638\" Offset=\"1\"/>\n        <GradientStop Color=\"#1B770E\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <Style x:Key=\"HorizontalSliderUpThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Setter Property=\"Height\" Value=\"22\"/>\n        <Setter Property=\"Width\" Value=\"11\"/>\n        <Setter Property=\"Foreground\" Value=\"Green\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Canvas SnapsToDevicePixels=\"true\">\n                        <Canvas.RenderTransform>\n                            <TransformGroup>\n                                <TransformGroup.Children>\n                                    <TransformCollection>\n                                        <RotateTransform Angle=\"180\"/>\n                                        <TranslateTransform X=\"5.5\" Y=\"11\"/>\n                                    </TransformCollection>\n                                </TransformGroup.Children>\n                            </TransformGroup>\n                        </Canvas.RenderTransform>\n                        <Path x:Name=\"Background\" Fill=\"{StaticResource SliderThumbBackgroundInverted}\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                        <Path x:Name=\"TopAccent\" Fill=\"{StaticResource HorizontalSliderThumbTopAccentInverted}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbTopAccentGeometry}\"/>\n                        <Path x:Name=\"BottomAccent\" Fill=\"{StaticResource HorizontalSliderThumbBottomAccentInverted}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbBottomAccentGeometry}\"/>\n                        <Path x:Name=\"OuterBorder\" Fill=\"{StaticResource HorizontalSliderThumbShadeGradientInverted}\" Stroke=\"{StaticResource HorizontalSliderThumbBorderInverted}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                    </Canvas>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentHoverInverted}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentHoverInverted}\"/>\n                        </Trigger>\n                        <Trigger Property=\"Foreground\" Value=\"Orange\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentHoverInverted}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentHoverInverted}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsDragging\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentPressedInverted}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentPressedInverted}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsEnabled\" Value=\"false\">\n                            <Setter Property=\"Fill\" TargetName=\"Background\" Value=\"#FFF5F4EA\"/>\n                            <Setter Property=\"Stroke\" TargetName=\"OuterBorder\" Value=\"#FFD6D4C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"#BBB9AD\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"Transparent\"/>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"HorizontalSliderDownThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Setter Property=\"Height\" Value=\"22\"/>\n        <Setter Property=\"Width\" Value=\"11\"/>\n        <Setter Property=\"Foreground\" Value=\"Green\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Canvas SnapsToDevicePixels=\"true\">\n                        <Canvas.RenderTransform>\n                            <TranslateTransform X=\"5.5\" Y=\"11\"/>\n                        </Canvas.RenderTransform>\n                        <Path x:Name=\"Background\" Fill=\"{StaticResource SliderThumbBackground}\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                        <Path x:Name=\"TopAccent\" Fill=\"{StaticResource HorizontalSliderThumbTopAccent}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbTopAccentGeometry}\"/>\n                        <Path x:Name=\"BottomAccent\" Fill=\"{StaticResource HorizontalSliderThumbBottomAccent}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbBottomAccentGeometry}\"/>\n                        <Path x:Name=\"OuterBorder\" Fill=\"{StaticResource HorizontalSliderThumbShadeGradient}\" Stroke=\"{StaticResource HorizontalSliderThumbBorder}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                    </Canvas>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentHover}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentHover}\"/>\n                        </Trigger>\n                        <Trigger Property=\"Foreground\" Value=\"Orange\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentHover}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentHover}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsDragging\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource HorizontalSliderThumbTopAccentPressed}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource HorizontalSliderThumbBottomAccentPressed}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsEnabled\" Value=\"false\">\n                            <Setter Property=\"Fill\" TargetName=\"Background\" Value=\"#FFF5F4EA\"/>\n                            <Setter Property=\"Stroke\" TargetName=\"OuterBorder\" Value=\"#FFD6D4C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"#FFD2D0C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"Transparent\"/>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <SolidColorBrush x:Key=\"VerticalSliderTrackNormalBackground\" Color=\"#FFF0EDE0\"/>\n    <LinearGradientBrush x:Key=\"VerticalSliderTrackNormalBorder\" EndPoint=\"1,0\" StartPoint=\"0,0\">\n        <GradientStop Color=\"#FFAEB1AF\" Offset=\"0.1\"/>\n        <GradientStop Color=\"White\" Offset=\".9\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbTopAccent\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#70D66F\" Offset=\"0\"/>\n        <GradientStop Color=\"#46CA44\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbBottomAccent\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#46CA44\" Offset=\"0\"/>\n        <GradientStop Color=\"#1B9B1A\" Offset=\".8\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbShadeGradient\" EndPoint=\"0,0\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#40FFFFFF\" Offset=\"0\"/>\n        <GradientStop Color=\"#00FFFFFF\" Offset=\".3\"/>\n        <GradientStop Color=\"#00000000\" Offset=\".7\"/>\n        <GradientStop Color=\"#40000000\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbBorder\" EndPoint=\"0,.5\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#FFBECBD3\" Offset=\"0\"/>\n        <GradientStop Color=\"#FF72838D\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbTopAccentHover\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#FBCE7C\" Offset=\"0\"/>\n        <GradientStop Color=\"#F7B335\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbBottomAccentHover\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#FAC055\" Offset=\"0\"/>\n        <GradientStop Color=\"#C7902A\" Offset=\".8\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbTopAccentPressed\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#70BA66\" Offset=\"0\"/>\n        <GradientStop Color=\"#229412\" Offset=\"1\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbBottomAccentPressed\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#46A638\" Offset=\"0\"/>\n        <GradientStop Color=\"#1B770E\" Offset=\".8\"/>\n    </LinearGradientBrush>\n    <Style x:Key=\"VerticalSliderThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Setter Property=\"Width\" Value=\"22\"/>\n        <Setter Property=\"Height\" Value=\"11\"/>\n        <Setter Property=\"Foreground\" Value=\"Green\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Canvas SnapsToDevicePixels=\"true\">\n                        <Canvas.RenderTransform>\n                            <TransformGroup>\n                                <TransformGroup.Children>\n                                    <TransformCollection>\n                                        <RotateTransform Angle=\"-90\"/>\n                                        <TranslateTransform X=\"11\" Y=\"5.5\"/>\n                                    </TransformCollection>\n                                </TransformGroup.Children>\n                            </TransformGroup>\n                        </Canvas.RenderTransform>\n                        <Rectangle Width=\"8.75\" Height=\"8.792\" Canvas.Left=\"-4.25\" Canvas.Top=\"-10.209\" Fill=\"Transparent\" />\n                        <Path Width=\"8.75\" Height=\"8.792\" Fill=\"#FFA5452A\" Stretch=\"Fill\" Stroke=\"#FFA5452A\" Data=\"M9.5,-1.625 L5.4166667,-9.4157592 1.75,-1.625 z\" Canvas.Left=\"-4.25\" Canvas.Top=\"-10.209\"/>\n                        <Path HorizontalAlignment=\"Stretch\" x:Name=\"OuterBorder\" VerticalAlignment=\"Stretch\" Width=\"9.5\" Height=\"9.625\" Fill=\"{StaticResource VerticalSliderThumbShadeGradient}\" Stroke=\"{x:Null}\" StrokeThickness=\"1\" Panel.ZIndex=\"-1\" Data=\"M4.5312501,6.9388954E-18 A1.5,1.5,0,0,0,4.46875,0.15624998 L4.5833334,0.083666627 A1.5,1.5,0,0,0,4.4375001,0.15625 L6.9009491E-05,9.5006667 A1.5,1.5,0,0,0,0.00024812574,9.5423334 L9.499915,9.6250697 A1.5,1.5,0,0,0,9.125,8.78125 z\" Canvas.Left=\"-4.625\" Canvas.Top=\"-10.75\"/>\n                      \n                    </Canvas>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\"/>\n                        <Trigger Property=\"Foreground\" Value=\"Orange\"/>\n                        <Trigger Property=\"IsDragging\" Value=\"true\"/>\n                        <Trigger Property=\"IsEnabled\" Value=\"false\">\n                            <Setter Property=\"Stroke\" TargetName=\"OuterBorder\" Value=\"#FFD6D4C6\"/>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbTopAccentInverted\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#46CA44\" Offset=\"1\"/>\n        <GradientStop Color=\"#1B9B1A\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbBottomAccentInverted\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#70D66F\" Offset=\"1\"/>\n        <GradientStop Color=\"#46CA44\" Offset=\".2\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbShadeGradientInverted\" EndPoint=\"0,0\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#40FFFFFF\" Offset=\"1\"/>\n        <GradientStop Color=\"#00FFFFFF\" Offset=\".7\"/>\n        <GradientStop Color=\"#00000000\" Offset=\".3\"/>\n        <GradientStop Color=\"#40000000\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbBorderInverted\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#FFBECBD3\" Offset=\"1\"/>\n        <GradientStop Color=\"#FF72838D\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbTopAccentHoverInverted\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#FAC055\" Offset=\"1\"/>\n        <GradientStop Color=\"#C7902A\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbBottomAccentHoverInverted\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#FBCE7C\" Offset=\"1\"/>\n        <GradientStop Color=\"#F7B335\" Offset=\".2\"/>\n    </LinearGradientBrush>\n    <LinearGradientBrush x:Key=\"VerticalSliderThumbTopAccentPressedInverted\" EndPoint=\"0,1\" StartPoint=\"1,0\">\n        <GradientStop Color=\"#46A638\" Offset=\"1\"/>\n        <GradientStop Color=\"#1B770E\" Offset=\"0\"/>\n    </LinearGradientBrush>\n    <Style x:Key=\"VerticalSliderLeftThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Setter Property=\"Width\" Value=\"22\"/>\n        <Setter Property=\"Height\" Value=\"11\"/>\n        <Setter Property=\"Foreground\" Value=\"Green\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Canvas SnapsToDevicePixels=\"true\">\n                        <Canvas.RenderTransform>\n                            <TransformGroup>\n                                <TransformGroup.Children>\n                                    <TransformCollection>\n                                        <RotateTransform Angle=\"90\"/>\n                                        <TranslateTransform X=\"11\" Y=\"5.5\"/>\n                                    </TransformCollection>\n                                </TransformGroup.Children>\n                            </TransformGroup>\n                        </Canvas.RenderTransform>\n                        <Path x:Name=\"Background\" Fill=\"{StaticResource SliderThumbBackground}\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                        <Path x:Name=\"TopAccent\" Fill=\"{StaticResource VerticalSliderThumbTopAccentInverted}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbTopAccentGeometry}\"/>\n                        <Path x:Name=\"BottomAccent\" Fill=\"{StaticResource VerticalSliderThumbBottomAccentInverted}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbBottomAccentGeometry}\"/>\n                        <Path x:Name=\"OuterBorder\" Fill=\"{StaticResource VerticalSliderThumbShadeGradientInverted}\" Stroke=\"{StaticResource VerticalSliderThumbBorderInverted}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                        \n                    </Canvas>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource VerticalSliderThumbTopAccentHoverInverted}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource VerticalSliderThumbBottomAccentHoverInverted}\"/>\n                        </Trigger>\n                        <Trigger Property=\"Foreground\" Value=\"Orange\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource VerticalSliderThumbTopAccentHoverInverted}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource VerticalSliderThumbBottomAccentHoverInverted}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsDragging\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource VerticalSliderThumbTopAccentPressedInverted}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource VerticalSliderThumbTopAccentPressedInverted}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsEnabled\" Value=\"false\">\n                            <Setter Property=\"Fill\" TargetName=\"Background\" Value=\"#FFF5F4EA\"/>\n                            <Setter Property=\"Stroke\" TargetName=\"OuterBorder\" Value=\"#FFD6D4C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"#BBB9AD\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"Transparent\"/>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"VerticalSliderRightThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Setter Property=\"Width\" Value=\"22\"/>\n        <Setter Property=\"Height\" Value=\"11\"/>\n        <Setter Property=\"Foreground\" Value=\"Green\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Canvas SnapsToDevicePixels=\"true\">\n                        <Canvas.RenderTransform>\n                            <TransformGroup>\n                                <TransformGroup.Children>\n                                    <TransformCollection>\n                                        <RotateTransform Angle=\"-90\"/>\n                                        <TranslateTransform X=\"11\" Y=\"5.5\"/>\n                                    </TransformCollection>\n                                </TransformGroup.Children>\n                            </TransformGroup>\n                        </Canvas.RenderTransform>\n                        <Path x:Name=\"Background\" Fill=\"{StaticResource SliderThumbBackgroundInverted}\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                        <Path x:Name=\"TopAccent\" Fill=\"{StaticResource VerticalSliderThumbTopAccent}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbTopAccentGeometry}\"/>\n                        <Path x:Name=\"BottomAccent\" Fill=\"{StaticResource VerticalSliderThumbBottomAccent}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbBottomAccentGeometry}\"/>\n                        <Path x:Name=\"OuterBorder\" Fill=\"{StaticResource VerticalSliderThumbShadeGradient}\" Stroke=\"{StaticResource VerticalSliderThumbBorder}\" StrokeThickness=\"1\" Data=\"{StaticResource SliderPointedThumbOuterBorderGeometry}\"/>\n                       \n                    </Canvas>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource VerticalSliderThumbTopAccentHover}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource VerticalSliderThumbBottomAccentHover}\"/>\n                        </Trigger>\n                        <Trigger Property=\"Foreground\" Value=\"Orange\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource VerticalSliderThumbTopAccentHover}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource VerticalSliderThumbBottomAccentHover}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsDragging\" Value=\"true\">\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"{StaticResource VerticalSliderThumbTopAccentPressed}\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"{StaticResource VerticalSliderThumbBottomAccentPressed}\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsEnabled\" Value=\"false\">\n                            <Setter Property=\"Fill\" TargetName=\"Background\" Value=\"#FFF5F4EA\"/>\n                            <Setter Property=\"Stroke\" TargetName=\"OuterBorder\" Value=\"#FFD6D4C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"TopAccent\" Value=\"#FFD2D0C6\"/>\n                            <Setter Property=\"Fill\" TargetName=\"BottomAccent\" Value=\"Transparent\"/>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"SliderStyle\" TargetType=\"{x:Type Slider}\">\n        <Setter Property=\"Stylus.IsPressAndHoldEnabled\" Value=\"false\"/>\n        <Setter Property=\"Background\" Value=\"Transparent\"/>\n        <Setter Property=\"Foreground\" Value=\"#FFA1A192\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Slider}\">\n                    <Border SnapsToDevicePixels=\"true\" Background=\"{TemplateBinding Background}\" BorderBrush=\"{TemplateBinding BorderBrush}\" BorderThickness=\"{TemplateBinding BorderThickness}\">\n                        <Grid>\n                            <Grid.RowDefinitions>\n                                <RowDefinition Height=\"Auto\"/>\n                                <RowDefinition Height=\"Auto\" MinHeight=\"{TemplateBinding MinHeight}\"/>\n                                <RowDefinition Height=\"Auto\"/>\n                            </Grid.RowDefinitions>\n                            <TickBar Visibility=\"Collapsed\" x:Name=\"TopTick\" Height=\"4\" Grid.Row=\"0\" Fill=\"{TemplateBinding Foreground}\" Placement=\"Top\"/>\n                            <TickBar Visibility=\"Collapsed\" x:Name=\"BottomTick\" Height=\"4\" Grid.Row=\"2\" Fill=\"{TemplateBinding Foreground}\" Placement=\"Bottom\"/>\n                            <Border Margin=\"5,0\" VerticalAlignment=\"Center\" Height=\"4.0\" Grid.Row=\"1\" Background=\"{StaticResource HorizontalSliderTrackNormalBackground}\" BorderBrush=\"{StaticResource HorizontalSliderTrackNormalBorder}\" BorderThickness=\"1\" CornerRadius=\"1\">\n                                <Canvas Margin=\"-6,-1\">\n                                    <Rectangle Visibility=\"Hidden\" x:Name=\"PART_SelectionRange\" Height=\"4.0\" Fill=\"{DynamicResource {x:Static SystemColors.HighlightBrushKey}}\" Stroke=\"{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}\" StrokeThickness=\"1.0\"/>\n                                </Canvas>\n                            </Border>\n                            <Track x:Name=\"PART_Track\" Grid.Row=\"1\">\n                                <Track.Thumb>\n                                    <Thumb x:Name=\"Thumb\" Style=\"{StaticResource HorizontalSliderThumbStyle}\"/>\n                                </Track.Thumb>\n                                <Track.IncreaseRepeatButton>\n                                    <RepeatButton Style=\"{StaticResource SliderRepeatButtonStyle}\" Command=\"{x:Static Slider.IncreaseLarge}\"/>\n                                </Track.IncreaseRepeatButton>\n                                <Track.DecreaseRepeatButton>\n                                    <RepeatButton Style=\"{StaticResource SliderRepeatButtonStyle}\" Command=\"{x:Static Slider.DecreaseLarge}\"/>\n                                </Track.DecreaseRepeatButton>\n                            </Track>\n                        </Grid>\n                    </Border>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"TickPlacement\" Value=\"TopLeft\">\n                            <Setter Property=\"Visibility\" TargetName=\"TopTick\" Value=\"Visible\"/>\n                            <Setter Property=\"Style\" TargetName=\"Thumb\" Value=\"{StaticResource HorizontalSliderUpThumbStyle}\"/>\n                        </Trigger>\n                        <Trigger Property=\"TickPlacement\" Value=\"BottomRight\">\n                            <Setter Property=\"Visibility\" TargetName=\"BottomTick\" Value=\"Visible\"/>\n                            <Setter Property=\"Style\" TargetName=\"Thumb\" Value=\"{StaticResource HorizontalSliderDownThumbStyle}\"/>\n                        </Trigger>\n                        <Trigger Property=\"TickPlacement\" Value=\"Both\">\n                            <Setter Property=\"Visibility\" TargetName=\"TopTick\" Value=\"Visible\"/>\n                            <Setter Property=\"Visibility\" TargetName=\"BottomTick\" Value=\"Visible\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsSelectionRangeEnabled\" Value=\"true\">\n                            <Setter Property=\"Visibility\" TargetName=\"PART_SelectionRange\" Value=\"Visible\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsKeyboardFocused\" Value=\"true\">\n                            <Setter Property=\"Foreground\" TargetName=\"Thumb\" Value=\"Orange\"/>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n        <Style.Triggers>\n            <Trigger Property=\"Orientation\" Value=\"Vertical\">\n                <Setter Property=\"Template\">\n                    <Setter.Value>\n                        <ControlTemplate TargetType=\"{x:Type Slider}\">\n                            <Border SnapsToDevicePixels=\"true\" Background=\"{TemplateBinding Background}\" BorderBrush=\"{TemplateBinding BorderBrush}\" BorderThickness=\"{TemplateBinding BorderThickness}\" Width=\"9\">\n                                <Grid>\n                                    <Grid.ColumnDefinitions>\n                                        <ColumnDefinition Width=\"Auto\"/>\n                                        <ColumnDefinition MinWidth=\"{TemplateBinding MinWidth}\" Width=\"Auto\"/>\n                                        <ColumnDefinition Width=\"Auto\"/>\n                                    </Grid.ColumnDefinitions>\n                                    <TickBar Visibility=\"Collapsed\" x:Name=\"LeftTick\" Width=\"4\" Grid.Column=\"0\" Fill=\"{TemplateBinding Foreground}\" Placement=\"Left\"/>\n                                    <TickBar Visibility=\"Collapsed\" x:Name=\"RightTick\" Width=\"4\" Grid.Column=\"2\" Fill=\"{TemplateBinding Foreground}\" Placement=\"Right\"/>\n                                    <Border HorizontalAlignment=\"Right\" Margin=\"0,0,10,0\" Width=\"3\" Grid.Column=\"1\" Background=\"{StaticResource VerticalSliderTrackNormalBackground}\" BorderBrush=\"{StaticResource VerticalSliderTrackNormalBorder}\" BorderThickness=\"1\" CornerRadius=\"1\" RenderTransformOrigin=\"0.5,0.5\" Grid.ColumnSpan=\"1\">\n                                        <Border.RenderTransform>\n                                            <TransformGroup>\n                    \n                            <ScaleTransform ScaleX=\"1\" ScaleY=\"1\"/>\n                                                <SkewTransform AngleX=\"0\" AngleY=\"0\"/>\n                                                <RotateTransform Angle=\"0\"/>\n                                                <TranslateTransform X=\"0\" Y=\"0\"/>\n                                            </TransformGroup>\n                                        </Border.RenderTransform>\n                                        <Canvas Margin=\"-1,-6\">\n                                            <Rectangle Visibility=\"Hidden\" x:Name=\"PART_SelectionRange\" Width=\"4.0\" Fill=\"{DynamicResource {x:Static SystemColors.HighlightBrushKey}}\" Stroke=\"{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}\" StrokeThickness=\"1.0\"/>\n                                        </Canvas>\n                                    </Border>\n                                    <Track x:Name=\"PART_Track\" Grid.Column=\"1\">\n                                        <Track.Thumb>\n                                            <Thumb x:Name=\"Thumb\" Style=\"{StaticResource VerticalSliderThumbStyle}\"/>\n                                        </Track.Thumb>\n                                        <Track.IncreaseRepeatButton>\n                                            <RepeatButton Style=\"{StaticResource SliderRepeatButtonStyle}\" Command=\"{x:Static Slider.IncreaseLarge}\"/>\n                                        </Track.IncreaseRepeatButton>\n                                        <Track.DecreaseRepeatButton>\n                                            <RepeatButton Style=\"{StaticResource SliderRepeatButtonStyle}\" Command=\"{x:Static Slider.DecreaseLarge}\"/>\n                                        </Track.DecreaseRepeatButton>\n                                    </Track>\n                                </Grid>\n                            </Border>\n                            <ControlTemplate.Triggers>\n                                <Trigger Property=\"TickPlacement\" Value=\"TopLeft\">\n                                    <Setter Property=\"Visibility\" TargetName=\"LeftTick\" Value=\"Visible\"/>\n                                    <Setter Property=\"Style\" TargetName=\"Thumb\" Value=\"{StaticResource VerticalSliderLeftThumbStyle}\"/>\n                                </Trigger>\n                                <Trigger Property=\"TickPlacement\" Value=\"BottomRight\">\n                                    <Setter Property=\"Visibility\" TargetName=\"RightTick\" Value=\"Visible\"/>\n                                    <Setter Property=\"Style\" TargetName=\"Thumb\" Value=\"{StaticResource VerticalSliderRightThumbStyle}\"/>\n                                </Trigger>\n                                <Trigger Property=\"TickPlacement\" Value=\"Both\">\n                                    <Setter Property=\"Visibility\" TargetName=\"LeftTick\" Value=\"Visible\"/>\n                                    <Setter Property=\"Visibility\" TargetName=\"RightTick\" Value=\"Visible\"/>\n                                </Trigger>\n                                <Trigger Property=\"IsSelectionRangeEnabled\" Value=\"true\">\n                                    <Setter Property=\"Visibility\" TargetName=\"PART_SelectionRange\" Value=\"Visible\"/>\n                                </Trigger>\n                                <Trigger Property=\"IsKeyboardFocused\" Value=\"true\">\n                                    <Setter Property=\"Foreground\" TargetName=\"Thumb\" Value=\"Orange\"/>\n                                </Trigger>\n                            </ControlTemplate.Triggers>\n                        </ControlTemplate>\n                    </Setter.Value>\n                </Setter>\n            </Trigger>\n        </Style.Triggers>\n    </Style>\n</ResourceDictionary>"
  },
  {
    "path": "3rdparty/ColorPickerControls/Chips/ColorChip.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPickerControls.Chips.ColorChip\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n            Width=\"30\" Height=\"20\" MouseDown=\"UserControl_MouseDown\" MouseUp=\"UserControl_MouseUp\" MouseDoubleClick=\"UserControl_MouseDoubleClick\">\n    <UserControl.Resources>\n        <DrawingBrush Viewport=\"0.0,0.0,0.5,0.5\" TileMode=\"Tile\"    x:Key=\"CheckerBoard\"   >\n\n            <DrawingBrush.Drawing>\n                <DrawingGroup>\n                    <GeometryDrawing Brush=\"White\">\n                        <GeometryDrawing.Geometry>\n                            <RectangleGeometry Rect=\"0,0,10,10\" />\n                        </GeometryDrawing.Geometry>\n                    </GeometryDrawing>\n\n                    <GeometryDrawing>\n                        <GeometryDrawing.Geometry>\n                            <GeometryGroup>\n                                <RectangleGeometry Rect=\"0,0,5,5\" />\n                                <RectangleGeometry Rect=\"5,5,5,5\" />\n                            </GeometryGroup>\n                        </GeometryDrawing.Geometry>\n                        <GeometryDrawing.Brush>\n                            <SolidColorBrush Color=\"#d7d7d7\"/>\n\n                        </GeometryDrawing.Brush>\n                    </GeometryDrawing>\n                </DrawingGroup>\n            </DrawingBrush.Drawing>\n        </DrawingBrush>\n\n    </UserControl.Resources>\n    <Grid>\n        <Border Margin=\"2,2,2,2\" Background=\"{StaticResource CheckerBoard}\"   VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\" >\n            \n        </Border>\n\t\t<Border  VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\"  BorderBrush=\"#FF3D3F4B\" BorderThickness=\"1\"  >\n            <Border  VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\"  BorderBrush=\"Transparent\" BorderThickness=\"1\"  >\n\t\t\t\t<Border Name=\"colorRect\" Background=\"#FF3D3F4B\"/>\n            </Border>\n        </Border>\n   </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Chips/ColorChip.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ColorPickerControls.Dialogs;\nusing ColorPicker;\nnamespace ColorPickerControls.Chips\n{\n    /// <summary>\n    /// Interaction logic for ColorChip.xaml\n    /// </summary>\n    public partial class ColorChip : UserControl\n    {\n\n        public enum EMouseEvent\n        {\n            mouseDown,\n            mouseUp,\n            mouseDoubleClick\n        }\n\n        public event EventHandler<EventArgs<Color>> ColorChanged;\n\n        public ColorChip()\n        {\n            InitializeComponent();\n        }\n\n        private EColorDialog mColorDialog = EColorDialog.Full;\n        [Category(\"ColorPicker\")]\n        public EColorDialog ColorDialog\n        {\n            get { return mColorDialog; }\n            set { mColorDialog = value; }\n        }\n \n\n        private EMouseEvent mDialogEvent = EMouseEvent.mouseDown;\n\n        [Category(\"ColorPicker\")]\n        public EMouseEvent DialogEvent\n        {\n            get{ return mDialogEvent;}\n            set { mDialogEvent = value; }\n        }\n\n        public static Type ClassType\n        {\n            get { return typeof(ColorChip); }\n        }\n\n        #region Color\n\n        public static DependencyProperty ColorProperty = DependencyProperty.Register(\"Color\", typeof(Color), ClassType, new PropertyMetadata(Colors.Gray, new PropertyChangedCallback(OnColorChanged)));\n          [Category(\"ColorPicker\")]\n        public Color Color\n        {\n            get\n            {\n                return (Color)GetValue(ColorProperty);\n            }\n            set\n            {\n                SetValue(ColorProperty, value);\n            }\n        }\n\n        private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ColorChip) d;\n            var color = (Color) e.NewValue;\n            chip.OnColorChanged(color);\n        }\n\n        private void OnColorChanged(Color color)\n        {\n            Brush = new SolidColorBrush(color);\n            colorRect.Background =  Brush;\n        }\n        #endregion\n\n\n        #region Brush\n\n        public static DependencyProperty BrushProperty = DependencyProperty.Register(\"Brush\", typeof(SolidColorBrush), ClassType, new PropertyMetadata(null, OnBrushChanged));\n\n        public SolidColorBrush Brush\n        {\n            get\n            {\n                return (SolidColorBrush)GetValue(BrushProperty);\n            }\n            set\n            {\n                SetValue(BrushProperty, value);\n            }\n        }\n\n        private static void OnBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ColorChip)d;\n            var brush = (SolidColorBrush) e.NewValue;\n            chip.Color = brush.Color;\n        }\n\n        #endregion\n\n\n\n\n\n        private IColorDialog CreateDialog()\n        {\n            IColorDialog dialog = null;\n            switch (ColorDialog)\n            {\n                case EColorDialog.Full:\n                   dialog = new ColorPickerFullDialog();\n                    break;\n                case EColorDialog.FullWithAlpha:\n                    dialog = new ColorPickerFullWithAlphaDialog();\n                    break;\n                case EColorDialog.Standard:\n                    dialog = new ColorPickerStandardDialog();\n                    break;\n                case EColorDialog.StandardWithAlpha :\n                    dialog = new ColorPickerStandardWithAlphaDialog();\n                    break;\n            }\n            return dialog;\n        }\n\n\t    public event EventHandler<EventArgs<Color>> PreviewColor;\n\n\t    protected void OnPreviewColor(EventArgs<Color> color)\n\t    {\n\t\t\tColor = color.Value; \n\t\t    var handler = PreviewColor;\n\t\t    if (handler != null)\n\t\t\t    handler(this, color);\n\t    }\n\n        private void ShowDialog()\n        {\n            var dia =  CreateDialog();\n            var initialColor =  ((SolidColorBrush)colorRect.Background).Color;\n            dia.InitialColor = initialColor; //set the initial color\n\t        dia.PreviewColor += (s, a) => OnPreviewColor(a);\n\n\t        if (dia.ShowDialog() == true)\n\t        {\n\t\t        if (dia.SelectedColor != initialColor)\n\t\t        {\n\t\t\t        Color = dia.SelectedColor; \n\t\t\t        if (ColorChanged != null)\n\t\t\t        {\n\t\t\t\t        ColorChanged(this, new EventArgs<Color>(dia.SelectedColor));\n\t\t\t        }\n\t\t        }\n\t        }\n\t        else\n\t        {\n\t\t\t\tColor = initialColor; \n\t\t\t\tif (ColorChanged != null)\n\t\t\t\t{\n\t\t\t\t\tColorChanged(this, new EventArgs<Color>(initialColor));\n\t\t\t\t}\n\t        }\n        }\n\n        private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)\n        {\n            if (DialogEvent == EMouseEvent.mouseDown)\n            {\n                ShowDialog();\n                e.Handled = true;\n            }\n        }\n\n        private void UserControl_MouseUp(object sender, MouseButtonEventArgs e)\n        {\n            if (DialogEvent == EMouseEvent.mouseUp)\n            {\n                ShowDialog();\n                e.Handled = true;\n            }\n        }\n\n        private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)\n        {\n            if (DialogEvent == EMouseEvent.mouseDoubleClick )\n            {\n                ShowDialog();\n                e.Handled = true;\n            }\n        }\n       \n\n\n\n    }\n\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Chips/ForegroundBackgroundChip.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPickerControls.Chips.ForegroundBackgroundChip\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\"  Width=\"auto\" Height=\"auto\"\n            xmlns:my=\"clr-namespace:ColorPickerControls.Chips\"  >\n    <UserControl.Resources>\n        <DrawingBrush x:Key=\"SwitchBrush\" Viewbox=\"0,0,11.381,12.011\" ViewboxUnits=\"Absolute\"  Stretch=\"Uniform\">\n            <DrawingBrush.Drawing>\n                <DrawingGroup>\n                    <GeometryDrawing Brush=\"#FF231F20\" Geometry=\"M3.45,5.3119929 L-3.0517605E-06,2.6559988 3.45,4.6386617E-06 z\"/>\n                    <DrawingGroup>\n                        <DrawingGroup.Transform>\n                            <MatrixTransform Matrix=\"1,0,0,1,6.069,8.561\"/>\n                        </DrawingGroup.Transform>\n                        <GeometryDrawing Brush=\"#FF231F20\" Geometry=\"M5.3120054,0 L2.6560036,3.4499878 1.8798841E-06,0 z\"/>\n                    </DrawingGroup>\n                    <DrawingGroup>\n                        <DrawingGroup.Transform>\n                            <MatrixTransform Matrix=\"1,0,0,1,2.009,2.1\"/>\n                        </DrawingGroup.Transform>\n                        <GeometryDrawing Geometry=\"M6.5110028,6.5119882 C6.5110028,3.1890015 3.8230035,0.50001216 0.50000435,0.50001216\">\n                            <GeometryDrawing.Pen>\n                                <Pen Brush=\"#FF231F20\" DashCap=\"Flat\" EndLineCap=\"Flat\" LineJoin=\"Miter\" MiterLimit=\"10\" StartLineCap=\"Flat\" Thickness=\"1\"/>\n                            </GeometryDrawing.Pen>\n                        </GeometryDrawing>\n                    </DrawingGroup>\n                </DrawingGroup>\n            </DrawingBrush.Drawing>\n        </DrawingBrush>\n\n    </UserControl.Resources>\n    <Grid>\n        <my:ColorChip HorizontalAlignment=\"Left\" Margin=\"16,36,0,0\" x:Name=\"backChip\" VerticalAlignment=\"Top\" Height=\"30\" Width=\"30\" Color=\"White\" />\n        <my:ColorChip HorizontalAlignment=\"Left\" Margin=\"0,21,0,0\" x:Name=\"foreChip\" VerticalAlignment=\"Top\" Height=\"30\" Width=\"30\" Color=\"Black\"  />\n        <Rectangle Height=\"11\" HorizontalAlignment=\"Left\" Margin=\"5,4,0,0\" Name=\"rBackgroundDefault\" Stroke=\"Black\" VerticalAlignment=\"Top\" Width=\"11\" MouseDown=\"rBackgroundDefault_MouseDown\" Fill=\"White\" />\n        <Rectangle Height=\"11\" HorizontalAlignment=\"Left\" Name=\"rForegroundDefault\" Stroke=\"Black\" VerticalAlignment=\"Top\" Width=\"11\" Fill=\"Black\" MouseDown=\"rForegroundDefault_MouseDown\" />\n        <Rectangle Height=\"15\" HorizontalAlignment=\"Left\" Margin=\"30,0,0,0\" Name=\"rSwitch\" Stroke=\"{x:Null}\" VerticalAlignment=\"Top\" \n                   Width=\"16\" Fill=\"{StaticResource SwitchBrush}\" MouseDown=\"rSwitch_MouseDown\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Chips/ForegroundBackgroundChip.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ColorPickerControls.Dialogs;\nusing ColorPicker;\nnamespace ColorPickerControls.Chips\n{\n    /// <summary>\n    /// Interaction logic for ForegroundBackgroundChip.xaml\n    /// </summary>\n    public partial class ForegroundBackgroundChip : UserControl\n    {\n        public ForegroundBackgroundChip()\n        {\n            InitializeComponent();\n            foreChip.ColorChanged += (s, ea) => ForegroundColor = ea.Value;\n            backChip.ColorChanged += (s, ea) => BackgroundColor = ea.Value;\n        }\n\n        public event EventHandler<EventArgs<Color>> ForegroundColorChanged;\n        public event EventHandler<EventArgs<SolidColorBrush>> ForegroundBrushChanged;\n        public event EventHandler<EventArgs<Color>> BackgroundColorChanged;\n        public event EventHandler<EventArgs<SolidColorBrush>> BackgroundBrushChanged;\n\n        public static Type ClassType\n        {\n            get { return typeof(ForegroundBackgroundChip); }\n        }\n\n        #region DefaultForeground\n\n        public static DependencyProperty DefaultForegroundProperty = DependencyProperty.Register(\"DefaultForeground\", typeof(Color), ClassType, new PropertyMetadata(Colors.Black , OnDefaultForegroundChanged));\n        [Category(\"ColorPicker\")]\n        public Color DefaultForeground\n        {\n            get\n            {\n                return (Color)GetValue(DefaultForegroundProperty);\n            }\n            set\n            {\n                SetValue(DefaultForegroundProperty, value);\n            }\n        }\n\n        private static void OnDefaultForegroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ForegroundBackgroundChip)d;\n            chip.rForegroundDefault.Fill = new SolidColorBrush((Color)e.NewValue);\n        }\n\n        #endregion\n\n        #region DefaultBackground\n\n        public static DependencyProperty DefaultBackgroundProperty = DependencyProperty.Register(\"DefaultBackground\", typeof(Color), ClassType, \n            new PropertyMetadata(Colors.White ,  OnDefaultBackgroundChanged));\n           \n\n        [Category(\"ColorPicker\")]\n        public Color DefaultBackground\n        {\n            get\n            {\n                return (Color)GetValue(DefaultBackgroundProperty);\n            }\n            set\n            {\n                SetValue(DefaultBackgroundProperty, value);\n            }\n        }\n\n        private static void OnDefaultBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ForegroundBackgroundChip) d;\n            chip.rBackgroundDefault.Fill = new SolidColorBrush((Color)e.NewValue);\n        }\n\n        #endregion\n\n        #region ForegroundColor\n\n        public static DependencyProperty ForegroundColorProperty = DependencyProperty.Register(\"ForegroundColor\", typeof(Color), ClassType, new PropertyMetadata(Colors.Black, OnForegroundColorChanged));\n         [Category(\"ColorPicker\")]\n        public Color ForegroundColor\n        {\n            get\n            {\n                return (Color)GetValue(ForegroundColorProperty);\n            }\n            set\n            {\n                SetValue(ForegroundColorProperty, value);\n            }\n        }\n\n        private static void OnForegroundColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ForegroundBackgroundChip) d;\n            chip.foreChip.Color =(Color) e.NewValue;\n            chip.ForegroundBrush = new SolidColorBrush(chip.foreChip.Color);\n            if (chip.ForegroundColorChanged != null)\n            {\n                chip.ForegroundColorChanged(chip, new EventArgs<Color>(chip.foreChip.Color));\n            }\n        }\n\n        #endregion\n\n\n        #region BackgroundColor\n\n        public static DependencyProperty BackgroundColorProperty = DependencyProperty.Register(\"BackgroundColor\", typeof(Color), ClassType, new PropertyMetadata(Colors.Black, OnBackgroundColorChanged));\n         [Category(\"ColorPicker\")]\n        public Color BackgroundColor\n        {\n            get\n            {\n                return (Color)GetValue(BackgroundColorProperty);\n            }\n            set\n            {\n                SetValue(BackgroundColorProperty, value);\n            }\n        }\n\n        private static void OnBackgroundColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ForegroundBackgroundChip)d;\n            chip.backChip.Color = (Color)e.NewValue;\n            chip.BackgroundBrush = new SolidColorBrush(chip.backChip.Color);\n            if (chip.BackgroundColorChanged != null)\n            {\n                chip.BackgroundColorChanged(chip, new EventArgs<Color>(chip.backChip.Color));\n            }\n        }\n\n        #endregion\n\n        #region BackgroundBrush\n\n        public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register(\"BackgroundBrush\", typeof(SolidColorBrush), ClassType, \n            new PropertyMetadata(new SolidColorBrush(Colors.White ), OnBackgroundBrushChanged));\n\n        public SolidColorBrush BackgroundBrush\n        {\n            get\n            {\n                return (SolidColorBrush)GetValue(BackgroundBrushProperty);\n            }\n            set\n            {\n                SetValue(BackgroundBrushProperty, value);\n            }\n        }\n\n        private static void OnBackgroundBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ForegroundBackgroundChip)d;\n            if (chip.BackgroundBrushChanged != null)\n            {\n                chip.BackgroundBrushChanged(chip, new EventArgs<SolidColorBrush>(chip.backChip.Brush));\n            }\n\n        }\n\n        #endregion\n\n        #region ForegroundBrush\n\n        public static DependencyProperty ForegroundBrushProperty = DependencyProperty.Register(\"ForegroundBrush\", typeof(SolidColorBrush), ClassType, \n            new PropertyMetadata(new SolidColorBrush(Colors.Black ), OnForegroundBrushChanged));\n          [Category(\"ColorPicker\")]\n        public SolidColorBrush ForegroundBrush\n        {\n            get\n            {\n                return (SolidColorBrush)GetValue(ForegroundBrushProperty);\n            }\n            set\n            {\n                SetValue(ForegroundBrushProperty, value);\n            }\n        }\n\n        private static void OnForegroundBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var chip = (ForegroundBackgroundChip)d;\n            if (chip.ForegroundBrushChanged != null)\n            {\n                chip.ForegroundBrushChanged(chip, new EventArgs<SolidColorBrush>(chip.foreChip.Brush));\n            }\n        }\n\n        #endregion\n\n\n\n\n        private EColorDialog mColorDialog = EColorDialog.Full;\n        [Category(\"ColorPicker\")]\n        public EColorDialog ColorDialog\n        {\n            get { return mColorDialog; }\n            set { mColorDialog = value;\n                foreChip.ColorDialog = value;\n                backChip.ColorDialog = value;\n            }\n        }\n\n        private void rForegroundDefault_MouseDown(object sender, MouseButtonEventArgs e)\n        {\n            ForegroundColor = DefaultForeground;\n            BackgroundColor = DefaultBackground;\n        }\n\n        private void rBackgroundDefault_MouseDown(object sender, MouseButtonEventArgs e)\n        {\n            ForegroundColor = DefaultForeground;\n            BackgroundColor = DefaultBackground;\n        }\n\n        private void rSwitch_MouseDown(object sender, MouseButtonEventArgs e)\n        {\n            var color = ForegroundColor;\n            ForegroundColor = BackgroundColor;\n            BackgroundColor = color;\n        }\n\n      \n\n        \n\n\n\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/ColorPickerControls.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{02E6C16F-757F-44AC-BE66-C0D79C0EBE0B}</ProjectGuid>\n    <OutputType>library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>ColorPickerControls</RootNamespace>\n    <AssemblyName>ColorPickerControls</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <TargetFrameworkProfile>\n    </TargetFrameworkProfile>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Xaml\">\n      <RequiredTargetFramework>4.0</RequiredTargetFramework>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Chips\\ColorChip.xaml.cs\">\n      <DependentUpon>ColorChip.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Chips\\ForegroundBackgroundChip.xaml.cs\">\n      <DependentUpon>ForegroundBackgroundChip.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Dialogs\\ColorPickerFullDialog.xaml.cs\">\n      <DependentUpon>ColorPickerFullDialog.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Dialogs\\ColorPickerStandardDialog.xaml.cs\">\n      <DependentUpon>ColorPickerStandardDialog.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Dialogs\\ColorPickerStandardWithAlphaDialog.xaml.cs\">\n      <DependentUpon>ColorPickerStandardWithAlphaDialog.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Dialogs\\EColorDialog.cs\" />\n    <Compile Include=\"Dialogs\\IColorDialog.cs\" />\n    <Compile Include=\"Pickers\\ColorPickerFull.xaml.cs\">\n      <DependentUpon>ColorPickerFull.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Pickers\\ColorPickerFullWithAlpha.xaml.cs\">\n      <DependentUpon>ColorPickerFullWithAlpha.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Dialogs\\ColorPickerFullWithAlphaDialog.xaml.cs\">\n      <DependentUpon>ColorPickerFullWithAlphaDialog.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Pickers\\ColorPickerStandard.xaml.cs\">\n      <DependentUpon>ColorPickerStandard.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Pickers\\ColorPickerStandardWithAlpha.xaml.cs\">\n      <DependentUpon>ColorPickerStandardWithAlpha.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n    <None Include=\"packages.config\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <AppDesigner Include=\"Properties\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Page Include=\"Chips\\ColorChip.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Chips\\ForegroundBackgroundChip.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Dialogs\\ColorPickerFullDialog.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Dialogs\\ColorPickerStandardDialog.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"Dialogs\\ColorPickerStandardWithAlphaDialog.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"Pickers\\ColorPickerFull.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Pickers\\ColorPickerFullWithAlpha.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Dialogs\\ColorPickerFullWithAlphaDialog.xaml\">\n      <SubType>Designer</SubType>\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"Pickers\\ColorPickerStandard.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"Pickers\\ColorPickerStandardWithAlpha.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\ColorPicker\\ColorPicker.csproj\">\n      <Project>{059DC6C7-59C6-4ADF-8960-976A02E7498E}</Project>\n      <Name>ColorPicker</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerFullDialog.xaml",
    "content": "﻿<Window x:Class=\"ColorPickerControls.Dialogs.ColorPickerFullDialog\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        Title=\"Color Picker\" Height=\"334\" Width=\"532\"    xmlns:Pickers=\"clr-namespace:ColorPickerControls.Pickers\" WindowStyle=\"SingleBorderWindow\" ResizeMode=\"NoResize\">\n    <Grid Background=\"#FFE8E8E8\">\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"270\" />\n            <RowDefinition Height=\"30\" />\n        </Grid.RowDefinitions>\n        <Pickers:ColorPickerFull HorizontalAlignment=\"Left\" x:Name=\"colorPickerFull\" VerticalAlignment=\"Top\" Margin=\"4,0,0,0\"/>\n        <StackPanel Orientation=\"Horizontal\" Grid.Row=\"1\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\" Margin=\"189,0,0,0\">\n        <Button Content=\"OK\"  Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"0,0,4,0\" Name=\"btOk\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btOk_Click\" />\n        <Button Content=\"Cancel\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"8,0,0,0\" Name=\"btCancel\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btCancel_Click\" /></StackPanel>\n    </Grid>\n</Window>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerFullDialog.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Media;\nusing ColorPicker;\n\nnamespace ColorPickerControls.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerFullDialog.xaml\n    /// </summary>\n    public partial class ColorPickerFullDialog : Window  , IColorDialog\n    {\n\t    public event EventHandler<EventArgs<Color>> PreviewColor\n\t    {\n\t\t\tadd { colorPickerFull.SelectedColorChanged += value; }\n\t\t\tremove { colorPickerFull.SelectedColorChanged -= value; }\n\t    }\n\n        public ColorPickerFullDialog()\n        {\n            InitializeComponent();\n        }\n\n        private void btOk_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = true;\n        }\n\n        private void btCancel_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = false;\n             \n        }\n\n         [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get { return colorPickerFull.SelectedColor; }\n            set { colorPickerFull.SelectedColor = value; }\n        }\n\n         [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get { return colorPickerFull.InitialColor; }\n            set\n            {\n                colorPickerFull.InitialColor = value;\n                colorPickerFull.SelectedColor = value;\n            }\n        }\n\n         [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorPickerFull.SelectionRingMode; }\n            set { colorPickerFull.SelectionRingMode = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerFullWithAlphaDialog.xaml",
    "content": "﻿<Window x:Class=\"ColorPickerControls.Dialogs.ColorPickerFullWithAlphaDialog\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        Title=\"Color Picker\" Height=\"344\" Width=\"570\"   xmlns:Pickers=\"clr-namespace:ColorPickerControls.Pickers\" ResizeMode=\"NoResize\">\n    <Grid Background=\"#FFE8E8E8\">\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"274\" />\n            <RowDefinition Height=\"36\" />\n        </Grid.RowDefinitions>\n        <Pickers:ColorPickerFullWithAlpha HorizontalAlignment=\"Left\" Margin=\"8,4,0,0\" x:Name=\"colorPickerFullWithAlpha\" VerticalAlignment=\"Top\" />\n        <StackPanel Grid.Row=\"1\" Orientation=\"Horizontal\" Margin=\"214,0,0,0\" VerticalAlignment=\"Center\"  >\n        <Button Content=\"OK\"  Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"0,0,4,0\" Name=\"btOk\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btOk_Click\" />\n        <Button Content=\"Cancel\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"8,0,0,0\" Name=\"btCancel\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btCancel_Click\" />\n        </StackPanel>\n\n    </Grid>\n</Window>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerFullWithAlphaDialog.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Media;\nusing ColorPicker;\n\nnamespace ColorPickerControls.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerFullWithAlphaDialog.xaml\n    /// </summary>\n    public partial class ColorPickerFullWithAlphaDialog : Window, IColorDialog\n    {\n\t\tpublic event EventHandler<EventArgs<Color>> PreviewColor\n\t\t{\n\t\t\tadd { colorPickerFullWithAlpha.SelectedColorChanged += value; }\n\t\t\tremove { colorPickerFullWithAlpha.SelectedColorChanged -= value; }\n\t\t}\n\n        public ColorPickerFullWithAlphaDialog()\n        {\n            InitializeComponent();\n        }\n\n        private void btOk_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = true;\n        }\n\n        private void btCancel_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = false;\n        }\n\n         [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get { return colorPickerFullWithAlpha.SelectedColor; }\n            set { colorPickerFullWithAlpha.SelectedColor = value; }\n        }\n\n         [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get { return colorPickerFullWithAlpha.InitialColor; }\n            set\n            {\n                colorPickerFullWithAlpha.InitialColor = value;\n                colorPickerFullWithAlpha.SelectedColor = value;\n            }\n        }\n\n         [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorPickerFullWithAlpha.SelectionRingMode; }\n            set { colorPickerFullWithAlpha.SelectionRingMode = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerStandardDialog.xaml",
    "content": "﻿<Window x:Class=\"ColorPickerControls.Dialogs.ColorPickerStandardDialog\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        Title=\"Color Picker\" Height=\"334\" Width=\"442\"    xmlns:Pickers=\"clr-namespace:ColorPickerControls.Pickers\" WindowStyle=\"SingleBorderWindow\" ResizeMode=\"NoResize\">\n    <Grid Background=\"#FFE8E8E8\">\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"270\" />\n            <RowDefinition Height=\"30\" />\n        </Grid.RowDefinitions>\n        <Pickers:ColorPickerStandard HorizontalAlignment=\"Left\" x:Name=\"colorPickerFull\" VerticalAlignment=\"Top\" Margin=\"4,0,0,0\"/>\n        <StackPanel Orientation=\"Horizontal\" Grid.Row=\"1\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\" Margin=\"140,0,0,0\">\n        <Button Content=\"OK\"  Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"0,0,4,0\" Name=\"btOk\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btOk_Click\" />\n        <Button Content=\"Cancel\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"8,0,0,0\" Name=\"btCancel\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btCancel_Click\" /></StackPanel>\n    </Grid>\n</Window>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerStandardDialog.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Media;\nusing ColorPicker;\n\nnamespace ColorPickerControls.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerDialog.xaml\n    /// </summary>\n    public partial class ColorPickerStandardDialog : Window  , IColorDialog\n    {\n\t\tpublic event EventHandler<EventArgs<Color>> PreviewColor\n\t\t{\n\t\t\tadd { colorPickerFull.SelectedColorChanged += value; }\n\t\t\tremove { colorPickerFull.SelectedColorChanged -= value; }\n\t\t}\n\n        public ColorPickerStandardDialog()\n        {\n            InitializeComponent();\n        }\n\n        private void btOk_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = true;\n        }\n\n        private void btCancel_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = false;\n             \n        }\n         [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get { return colorPickerFull.SelectedColor; }\n            set { colorPickerFull.SelectedColor = value; }\n        }\n\n         [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get { return colorPickerFull.InitialColor; }\n            set\n            {\n                colorPickerFull.InitialColor = value;\n                colorPickerFull.SelectedColor = value;\n            }\n        }\n\n         [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorPickerFull.SelectionRingMode; }\n            set { colorPickerFull.SelectionRingMode = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerStandardWithAlphaDialog.xaml",
    "content": "﻿<Window x:Class=\"ColorPickerControls.Dialogs.ColorPickerStandardWithAlphaDialog\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n        Title=\"Color Picker\" Height=\"334\" Width=\"480\"    xmlns:Pickers=\"clr-namespace:ColorPickerControls.Pickers\" WindowStyle=\"SingleBorderWindow\" ResizeMode=\"NoResize\">\n    <Grid Background=\"#FFE8E8E8\">\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"270\" />\n            <RowDefinition Height=\"30\" />\n        </Grid.RowDefinitions>\n        <Pickers:ColorPickerStandardWithAlpha HorizontalAlignment=\"Left\" x:Name=\"colorPickerFull\" VerticalAlignment=\"Top\" Margin=\"4,0,0,0\"/>\n        <StackPanel Orientation=\"Horizontal\" Grid.Row=\"1\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\" Margin=\"142,0,0,0\">\n        <Button Content=\"OK\"  Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"0,0,4,0\" Name=\"btOk\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btOk_Click\" />\n        <Button Content=\"Cancel\" Grid.Row=\"1\" Height=\"23\" HorizontalAlignment=\"Left\" Margin=\"8,0,0,0\" Name=\"btCancel\" VerticalAlignment=\"Top\" Width=\"75\" Click=\"btCancel_Click\" /></StackPanel>\n    </Grid>\n</Window>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/ColorPickerStandardWithAlphaDialog.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Media;\nusing ColorPicker;\n\nnamespace ColorPickerControls.Dialogs\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerDialog.xaml\n    /// </summary>\n    public partial class ColorPickerStandardWithAlphaDialog : Window  , IColorDialog\n    {\n\t\tpublic event EventHandler<EventArgs<Color>> PreviewColor\n\t\t{\n\t\t\tadd { colorPickerFull.SelectedColorChanged += value; }\n\t\t\tremove { colorPickerFull.SelectedColorChanged -= value; }\n\t\t}\n\n        public ColorPickerStandardWithAlphaDialog()\n        {\n            InitializeComponent();\n        }\n\n        private void btOk_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = true;\n        }\n\n        private void btCancel_Click(object sender, RoutedEventArgs e)\n        {\n            this.DialogResult = false;\n             \n        }\n\n         [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get { return colorPickerFull.SelectedColor; }\n            set { colorPickerFull.SelectedColor = value; }\n        }\n\n         [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get { return colorPickerFull.InitialColor; }\n            set\n            {\n                colorPickerFull.InitialColor = value;\n                colorPickerFull.SelectedColor = value;\n            }\n        }\n\n        [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorPickerFull.SelectionRingMode; }\n            set { colorPickerFull.SelectionRingMode = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/EColorDialog.cs",
    "content": "﻿namespace ColorPickerControls.Dialogs\n{\n    public enum EColorDialog\n    {\n        Standard,\n        Full,\n        StandardWithAlpha,\n        FullWithAlpha\n        \n    }\n\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Dialogs/IColorDialog.cs",
    "content": "﻿using System;\nusing System.Windows.Media;\nusing ColorPicker;\n\nnamespace ColorPickerControls.Dialogs\n{\n    interface IColorDialog\n    {\n\t    event EventHandler<EventArgs<Color>> PreviewColor;\n        Color SelectedColor { get; set; }\n        Color InitialColor { get; set; }\n        bool? ShowDialog();\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerFull.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPickerControls.Pickers.ColorPickerFull\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n            Height=\"268\" Width=\"524\" xmlns:my=\"clr-namespace:ColorPicker;assembly=ColorPicker\" xmlns:my1=\"clr-namespace:ColorPicker.ColorModels.RGB;assembly=ColorPicker\"   xmlns:my3=\"clr-namespace:ColorPicker.ColorModels.HSB;assembly=ColorPicker\" xmlns:my4=\"clr-namespace:ColorPicker.ColorModels.Lab;assembly=ColorPicker\" xmlns:my5=\"clr-namespace:ColorPicker.ColorModels.CMYK;assembly=ColorPicker\">\n    <Grid Height=\"275\" Width=\"528\">\n        <my:ColorSelector Height=\"270\" HorizontalAlignment=\"Left\" Margin=\"0,0,0,0\" Name=\"colorSelector\" VerticalAlignment=\"Top\" Width=\"314\" SelectionRingMode=\"BlackAndWhite\" />\n        <my1:RgbDisplay Color=\"{Binding ElementName=colorSelector, Path=Color, Mode=TwoWay}\" \n\t\t\t\t\t\tHeight=\"84\" HorizontalAlignment=\"Left\" Margin=\"319,157,0,0\" Name=\"rgbDisplay\" \n\t\t\t\t\t\tNormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent, Mode=TwoWay}\" \n\t\t\t\t\t\tVerticalAlignment=\"Top\" Width=\"90\" />\n        \n\t\t<my3:HsbDisplay Color=\"{Binding Path=Color, ElementName=colorSelector}\" \n\t\t\t\t\t\tHeight=\"90\" HorizontalAlignment=\"Left\" Margin=\"318,58,0,0\" Name=\"hsbDisplay1\" \n                        NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent, Mode=TwoWay}\" \n\t\t\t\t\t\tVerticalAlignment=\"Top\" Width=\"94\" />\n        <my4:LabDisplay Color=\"{Binding Path=Color, ElementName=colorSelector}\" Height=\"90\" \n                        HorizontalAlignment=\"Left\" Margin=\"427,58,0,0\" Name=\"labDisplay1\" \n                        NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent, Mode=TwoWay}\" \n\t\t\t\t\t\tVerticalAlignment=\"Top\" Width=\"90\" />\n        <my:HexDisplay  Height=\"25\" HorizontalAlignment=\"Left\" Margin=\"336,239,0,0\" Color=\"{Binding Path=Color, ElementName=colorSelector}\"\n                       Name=\"hexDisplay1\" VerticalAlignment=\"Top\" Width=\"67\" />\n        <my5:CMYKDisplay Color=\"{Binding Path=Color, ElementName=colorSelector}\" Height=\"112\" HorizontalAlignment=\"Left\"  Margin=\"444,155,0,0\" Name=\"cMYKDisplay2\" VerticalAlignment=\"Top\" Width=\"73\" DisplayMode=\"PercentNoDecimal\" />\n        <my:NewCurrent HorizontalAlignment=\"Left\" Margin=\"320,8,0,0\" Name=\"newCurrent\" VerticalAlignment=\"Top\" Height=\"40\" Width=\"177\"\n                       NewColor=\"{Binding ElementName=colorSelector, Path=Color}\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerFull.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ColorPicker;\nnamespace ColorPickerControls.Pickers\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerFull.xaml\n    /// </summary>\n    public partial class ColorPickerFull : UserControl\n    {\n\n        public static Type ClassType\n        {\n            get { return typeof(ColorPickerFull); }\n        }\n\n        #region InitialColor\n\n        public static DependencyProperty InitialColorProperty = DependencyProperty.Register(\"InitialColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnInitialColorChanged));\n         [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get\n            {\n                return (Color)GetValue(InitialColorProperty);\n            }\n            set\n            {\n                SetValue(InitialColorProperty, value);\n            }\n        }\n\n\n        private static void OnInitialColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerFull) d;\n           cpf.newCurrent.CurrentColor = (Color) e.NewValue ;\n         \n        }\n\n\n        #endregion\n\n        public event EventHandler<EventArgs<Color>> SelectedColorChanged;\n        #region SelectedColor\n\n        public static DependencyProperty SelectedColorProperty = DependencyProperty.Register(\"SelectedColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedColorChanged));\n         [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get\n            {\n                return (Color)GetValue(SelectedColorProperty);\n            }\n            set\n            {\n                SetValue(SelectedColorProperty, value);\n            }\n        }\n\n\n        private static void OnSelectedColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerFull)d;\n            cpf.colorSelector.Color = (Color)e.NewValue;\n            if (cpf.SelectedColorChanged != null)\n            {\n                cpf.SelectedColorChanged(cpf, new EventArgs<Color>((Color)e.NewValue));\n            }\n            \n        }\n\n\n        #endregion\n\n\n         [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorSelector.SelectionRingMode; }\n            set { colorSelector.SelectionRingMode = value;}\n        }\n\n        public ColorPickerFull()\n        {\n            InitializeComponent();\n  \n            SetBinding(SelectedColorProperty, \"Color\");\n            DataContext = colorSelector;\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerFullWithAlpha.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPickerControls.Pickers.ColorPickerFullWithAlpha\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             d:DesignHeight=\"269\" d:DesignWidth=\"546\" \n             xmlns:my=\"clr-namespace:ColorPicker;assembly=ColorPicker\" \n             xmlns:my1=\"clr-namespace:ColorPicker.ColorModels.RGB;assembly=ColorPicker\" \n             xmlns:my2=\"clr-namespace:ColorPicker.ColorModels.HSB;assembly=ColorPicker\" xmlns:my3=\"clr-namespace:ColorPicker.ColorModels.Lab;assembly=ColorPicker\" xmlns:my4=\"clr-namespace:ColorPicker.ColorModels.CMYK;assembly=ColorPicker\">\n    <Grid>\n        <my:ColorSelector Height=\"270\" HorizontalAlignment=\"Left\" Margin=\"2,1,0,0\" Name=\"colorSelector\" VerticalAlignment=\"Top\" Width=\"314\" />\n        <my:HexDisplay Height=\"25\" HorizontalAlignment=\"Left\" Margin=\"325,242,0,0\" Name=\"hexDisplay\" VerticalAlignment=\"Top\" Width=\"79\" \n                       Color=\"{Binding Path=Color, ElementName=colorSelector}\" AlphaByteVisibility=\"visible\" />\n        <my1:RgbDisplay HorizontalAlignment=\"Left\" Margin=\"325,157,0,0\" Name=\"rgbDisplay\" VerticalAlignment=\"Top\"\n                        Color=\"{Binding Path=Color, ElementName=colorSelector}\" \n                        NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent}\" />\n        <my2:HsbDisplay Height=\"90\" HorizontalAlignment=\"Left\" Margin=\"325,56,0,0\" Name=\"hsbDisplay\" VerticalAlignment=\"Top\" Width=\"94\" Color=\"{Binding Path=Color, ElementName=colorSelector}\" NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent}\" />\n        <my3:LabDisplay Height=\"90\" HorizontalAlignment=\"Left\" Margin=\"421,57,0,0\" Name=\"labDisplay\" VerticalAlignment=\"Top\" Width=\"75\" Color=\"{Binding Path=Color, ElementName=colorSelector}\" NormalComponent=\"{Binding Path=NormalComponent, ElementName=colorSelector}\" />\n        <my:NewCurrent HorizontalAlignment=\"Left\" Margin=\"325,1,0,0\" Name=\"newCurrent\" VerticalAlignment=\"Top\" Height=\"40\" Width=\"169\" \n                       NewColor=\"{Binding ElementName=colorSelector, Path=Color}\" \n                       Alpha=\"{Binding ElementName=alphaDisplay, Path=Alpha, Mode=OneWay}\" />\n        <my:AlphaDisplay HorizontalAlignment=\"Left\" Margin=\"504,2,0,0\" Name=\"alphaDisplay\" VerticalAlignment=\"Top\" Height=\"266\"\n                         Color=\"{Binding Path=Color, ElementName=colorSelector}\" />\n        <my4:CMYKDisplay HorizontalAlignment=\"Left\" Margin=\"437,157,0,0\" Name=\"cMYKDisplay\" VerticalAlignment=\"Top\" Color=\"{Binding Path=Color, ElementName=colorSelector}\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerFullWithAlpha.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\nusing ColorPicker;\nnamespace ColorPickerControls.Pickers\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerFullWithAlpha.xaml\n    /// </summary>\n    public partial class ColorPickerFullWithAlpha : UserControl\n    {\n        public   ColorPickerFullWithAlpha()\n        {\n            InitializeComponent();\n            colorSelector.ColorChanged += colorSelector_ColorChanged;\n\n            alphaDisplay.AlphaChanged += alphaDisplay_AlphaChanged;\n\n\n\t        SelectedColorChanged += (s, a) => _selectedColorChanged.OnNext(a.Value);\n\n        }\n\n        void alphaDisplay_AlphaChanged(object sender, ColorPicker.EventArgs<byte> e)\n        {\n            SetValue(SelectedColorProperty,SelectedColor.WithAlpha(e.Value));\n            if (SelectedColorChanged != null)\n            {\n                SelectedColorChanged(this, new EventArgs<Color>(SelectedColor));\n            }\n        }\n\n        void colorSelector_ColorChanged(object sender, ColorPicker.EventArgs<Color> e)\n        {\n            SetValue(SelectedColorProperty, e.Value.WithAlpha(alphaDisplay.Alpha ));\n            if (SelectedColorChanged != null)\n            {\n                SelectedColorChanged(this, new EventArgs<Color>(SelectedColor));\n            }\n        }\n\n        public static Type ClassType\n        {\n            get { return typeof(ColorPickerFullWithAlpha); }\n        }\n        #region InitialColor\n\n        public static DependencyProperty InitialColorProperty = DependencyProperty.Register(\"InitialColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnInitialColorChanged));\n        [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get\n            {\n                return (Color)GetValue(InitialColorProperty);\n            }\n            set\n            {\n                SetValue(InitialColorProperty, value);\n            }\n        }\n\n\n        private static void OnInitialColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerFullWithAlpha)d;\n            cpf.newCurrent.CurrentColor = (Color)e.NewValue;\n\n        }\n\n\n        #endregion\n\n\t    bool _isUpdatingView = true;\n\t    readonly Subject<Color> _selectedColorChanged = new Subject<Color>();\n\n\t    public IObservable<Color> UserChangedColor\n\t    {\n\t\t\tget { return _selectedColorChanged.Where(_ => !_isUpdatingView); }\n\t    }\n\n        public event EventHandler<EventArgs<Color>> SelectedColorChanged;\n        #region SelectedColor\n\n        public static DependencyProperty SelectedColorProperty = DependencyProperty.Register(\"SelectedColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedColorChanged));\n        [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get\n            {\n                return (Color)GetValue(SelectedColorProperty);\n            }\n            set\n            {\n\t            _isUpdatingView = true;\n\t            try\n\t            {\n\t\t\t\t\tSetValue(SelectedColorProperty, value);\n\t            }\n\t            finally\n\t            {\n\t\t            _isUpdatingView = false;\n\t            }\n            }\n        }\n\n\n        private static void OnSelectedColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerFullWithAlpha)d;\n            var color =  (Color)e.NewValue;\n            cpf.colorSelector.Color = color;\n            cpf.alphaDisplay.Alpha = color.A;\n\n            if (cpf.SelectedColorChanged != null)\n            {\n                cpf.SelectedColorChanged(cpf, new EventArgs<Color>(color ));\n            }\n\n        }\n\n\n        #endregion\n\n         [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorSelector.SelectionRingMode; }\n            set { colorSelector.SelectionRingMode = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerStandard.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPickerControls.Pickers.ColorPickerStandard\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n            Height=\"271\" Width=\"414\" xmlns:my=\"clr-namespace:ColorPicker;assembly=ColorPicker\" xmlns:my1=\"clr-namespace:ColorPicker.ColorModels.RGB;assembly=ColorPicker\"   xmlns:my3=\"clr-namespace:ColorPicker.ColorModels.HSB;assembly=ColorPicker\" xmlns:my4=\"clr-namespace:ColorPicker.ColorModels.Lab;assembly=ColorPicker\" xmlns:my5=\"clr-namespace:ColorPicker.ColorModels.CMYK;assembly=ColorPicker\">\n    <Grid  >\n        <my:ColorSelector Height=\"270\" HorizontalAlignment=\"Left\" Margin=\"0,0,0,0\" Name=\"colorSelector\" VerticalAlignment=\"Top\" Width=\"314\" />\n        <my1:RgbDisplay Color=\"{Binding ElementName=colorSelector, Path=Color, Mode=TwoWay}\" Height=\"84\" HorizontalAlignment=\"Left\" Margin=\"318,157,0,0\" Name=\"rgbDisplay\" NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent, Mode=TwoWay}\" VerticalAlignment=\"Top\" Width=\"90\" />\n        <my3:HsbDisplay Color=\"{Binding Path=Color, ElementName=colorSelector}\" Height=\"86\" HorizontalAlignment=\"Left\" Margin=\"317,71,0,0\" Name=\"hsbDisplay1\" \n                        NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent, Mode=TwoWay}\" VerticalAlignment=\"Top\" Width=\"94\" />\n        <my:HexDisplay  Height=\"25\" HorizontalAlignment=\"Left\" Margin=\"336,239,0,0\" Color=\"{Binding Path=Color, ElementName=colorSelector}\"\n                       Name=\"hexDisplay1\" VerticalAlignment=\"Top\" Width=\"67\" />\n        <my:NewCurrent HorizontalAlignment=\"Left\" Margin=\"320,0,0,0\" Name=\"newCurrent\" VerticalAlignment=\"Top\" Height=\"65\" Width=\"89\" \n                       NewColor=\"{Binding ElementName=colorSelector, Path=Color}\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerStandard.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ColorPicker;\nnamespace ColorPickerControls.Pickers\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerFull.xaml\n    /// </summary>\n    public partial class ColorPickerStandard : UserControl\n    {\n\n        public static Type ClassType\n        {\n            get { return typeof(ColorPickerStandard); }\n        }\n\n        #region InitialColor\n\n        public static DependencyProperty InitialColorProperty = DependencyProperty.Register(\"InitialColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnInitialColorChanged));\n         [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get\n            {\n                return (Color)GetValue(InitialColorProperty);\n            }\n            set\n            {\n                SetValue(InitialColorProperty, value);\n            }\n        }\n\n\n        private static void OnInitialColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerStandard)d;\n           cpf.newCurrent.CurrentColor = (Color) e.NewValue ;\n         \n        }\n\n\n        #endregion\n\n        public event EventHandler<EventArgs<Color>> SelectedColorChanged;\n        #region SelectedColor\n\n        public static DependencyProperty SelectedColorProperty = DependencyProperty.Register(\"SelectedColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedColorChanged));\n         [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get\n            {\n                return (Color)GetValue(SelectedColorProperty);\n            }\n            set\n            {\n                SetValue(SelectedColorProperty, value);\n            }\n        }\n\n\n        private static void OnSelectedColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerStandard)d;\n            cpf.colorSelector.Color = (Color)e.NewValue;\n            if (cpf.SelectedColorChanged != null)\n            {\n                cpf.SelectedColorChanged(cpf, new EventArgs<Color>((Color)e.NewValue));\n            }\n            \n        }\n\n\n        #endregion\n\n\n        public ColorPickerStandard()\n        {\n            InitializeComponent();\n  \n            SetBinding(SelectedColorProperty, \"Color\");\n            DataContext = colorSelector;\n        }\n\n         [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorSelector.SelectionRingMode; }\n            set { colorSelector.SelectionRingMode = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerStandardWithAlpha.xaml",
    "content": "﻿<UserControl x:Class=\"ColorPickerControls.Pickers.ColorPickerStandardWithAlpha\"\n             xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n             xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \n             xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\" \n             mc:Ignorable=\"d\" \n             d:DesignHeight=\"269\" d:DesignWidth=\"473\" \n             xmlns:my=\"clr-namespace:ColorPicker;assembly=ColorPicker\" \n             xmlns:my1=\"clr-namespace:ColorPicker.ColorModels.RGB;assembly=ColorPicker\" \n             xmlns:my2=\"clr-namespace:ColorPicker.ColorModels.HSB;assembly=ColorPicker\" xmlns:my3=\"clr-namespace:ColorPicker.ColorModels.Lab;assembly=ColorPicker\" xmlns:my4=\"clr-namespace:ColorPicker.ColorModels.CMYK;assembly=ColorPicker\">\n    <Grid>\n        <my:ColorSelector Height=\"270\" HorizontalAlignment=\"Left\" Margin=\"2,1,0,0\" Name=\"colorSelector\" VerticalAlignment=\"Top\" Width=\"314\" />\n        <my:HexDisplay Height=\"25\" HorizontalAlignment=\"Left\" Margin=\"325,242,0,0\" Name=\"hexDisplay\" VerticalAlignment=\"Top\" Width=\"79\" \n                       Color=\"{Binding Path=Color, ElementName=colorSelector}\" AlphaByteVisibility=\"visible\" />\n        <my1:RgbDisplay HorizontalAlignment=\"Left\" Margin=\"325,157,0,0\" Name=\"rgbDisplay\" VerticalAlignment=\"Top\"\n                        Color=\"{Binding Path=Color, ElementName=colorSelector}\" \n                        NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent}\" />\n        <my2:HsbDisplay Height=\"90\" HorizontalAlignment=\"Left\" Margin=\"325,71,0,0\" Name=\"hsbDisplay\" VerticalAlignment=\"Top\" Width=\"94\" Color=\"{Binding Path=Color, ElementName=colorSelector}\" NormalComponent=\"{Binding ElementName=colorSelector, Path=NormalComponent}\" />\n        <my:NewCurrent HorizontalAlignment=\"Left\" Margin=\"325,1,0,0\" Name=\"newCurrent\" VerticalAlignment=\"Top\" Height=\"73\" Width=\"71\" \n                       NewColor=\"{Binding ElementName=colorSelector, Path=Color}\"\n                       Alpha=\"{Binding ElementName=alphaDisplay, Path=Alpha, Mode=OneWay}\" />\n        <my:AlphaDisplay HorizontalAlignment=\"Left\" Margin=\"423,2,0,0\" Name=\"alphaDisplay\" VerticalAlignment=\"Top\" Height=\"266\"\n                         Color=\"{Binding Path=Color, ElementName=colorSelector}\" />\n    </Grid>\n</UserControl>\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Pickers/ColorPickerStandardWithAlpha.xaml.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ColorPicker.ExtensionMethods;\nusing ColorPicker;\nnamespace ColorPickerControls.Pickers\n{\n    /// <summary>\n    /// Interaction logic for ColorPickerFullWithAlpha.xaml\n    /// </summary>\n    public partial class ColorPickerStandardWithAlpha : UserControl\n    {\n        public ColorPickerStandardWithAlpha()\n        {\n            InitializeComponent();\n            colorSelector.ColorChanged += colorSelector_ColorChanged;\n\n            alphaDisplay.AlphaChanged += alphaDisplay_AlphaChanged;\n        }\n\n        void alphaDisplay_AlphaChanged(object sender, ColorPicker.EventArgs<byte> e)\n        {\n            SetValue(SelectedColorProperty,SelectedColor.WithAlpha(e.Value));\n            if (SelectedColorChanged != null)\n            {\n                SelectedColorChanged(this, new EventArgs<Color>(SelectedColor));\n            }\n        }\n\n        void colorSelector_ColorChanged(object sender, ColorPicker.EventArgs<Color> e)\n        {\n            SetValue(SelectedColorProperty, e.Value.WithAlpha(alphaDisplay.Alpha ));\n            if (SelectedColorChanged != null)\n            {\n                SelectedColorChanged(this, new EventArgs<Color>(SelectedColor));\n            }\n        }\n\n        public static Type ClassType\n        {\n            get { return typeof(ColorPickerStandardWithAlpha); }\n        }\n        #region InitialColor\n\n        public static DependencyProperty InitialColorProperty = DependencyProperty.Register(\"InitialColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnInitialColorChanged));\n        [Category(\"ColorPicker\")]\n        public Color InitialColor\n        {\n            get\n            {\n                return (Color)GetValue(InitialColorProperty);\n            }\n            set\n            {\n                SetValue(InitialColorProperty, value);\n            }\n        }\n\n\n        private static void OnInitialColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerStandardWithAlpha)d;\n            cpf.newCurrent.CurrentColor = (Color)e.NewValue;\n            if (cpf.SelectedColorChanged != null)\n            {\n                cpf.SelectedColorChanged(cpf, new EventArgs<Color>((Color)e.NewValue));\n            }\n        }\n\n\n        #endregion\n\n        public event EventHandler<EventArgs<Color>> SelectedColorChanged;\n        #region SelectedColor\n\n        public static DependencyProperty SelectedColorProperty = DependencyProperty.Register(\"SelectedColor\", typeof(Color), ClassType,\n            new FrameworkPropertyMetadata(Colors.Transparent, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedColorChanged));\n        [Category(\"ColorPicker\")]\n        public Color SelectedColor\n        {\n            get\n            {\n                return (Color)GetValue(SelectedColorProperty);\n            }\n            set\n            {\n                SetValue(SelectedColorProperty, value);\n            }\n        }\n\n\n        private static void OnSelectedColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\n        {\n            var cpf = (ColorPickerStandardWithAlpha)d;\n            var color =  (Color)e.NewValue;\n            cpf.colorSelector.Color = color;\n            cpf.alphaDisplay.Alpha = color.A;\n\n        }\n\n\n        #endregion\n\n         [Category(\"ColorPicker\")]\n        public ColorSelector.ESelectionRingMode SelectionRingMode\n        {\n            get { return colorSelector.SelectionRingMode; }\n            set { colorSelector.SelectionRingMode = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ColorPickerControls\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Microsoft\")]\n[assembly: AssemblyProduct(\"ColorPickerControls\")]\n[assembly: AssemblyCopyright(\"Copyright © Microsoft 2010\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>.  For example, if you are using US english\n//in your source files, set the <UICulture> to en-US.  Then uncomment\n//the NeutralResourceLanguage attribute below.  Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n    //(used if a resource is not found in the page, \n    // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n    //(used if a resource is not found in the page, \n    // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace ColorPickerControls.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"ColorPickerControls.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "3rdparty/ColorPickerControls/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace ColorPickerControls.Properties {\n    \n    \n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"14.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n        \n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n        \n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/ColorPickerControls/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n  <Profiles>\n    <Profile Name=\"(Default)\" />\n  </Profiles>\n  <Settings />\n</SettingsFile>"
  },
  {
    "path": "3rdparty/ColorPickerControls/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "3rdparty/NRefactory/.gitattributes",
    "content": "*.cs text diff=csharp\n*.sln text eol=crlf\n*.csproj text eol=crlf\n"
  },
  {
    "path": "3rdparty/NRefactory/.gitignore",
    "content": "bin\nobj\n*.suo\n/lib/*.dll\n/ICSharpCode.NRefactory.Tests/PartCover/*\n_ReSharper*/*\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Analysis/AbiComparer.cs",
    "content": "//\n// ABIComparer.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.Analysis\n{\n\t/// <summary>\n\t/// Used to check the compatibility state of two compilations.\n\t/// </summary>\n\tpublic enum AbiCompatibility\n\t{\n\t\t/// <summary>\n\t\t/// The ABI is equal\n\t\t/// </summary>\n\t\tEqual,\n\n\t\t/// <summary>\n\t\t/// Some items got added, but the ABI remains to be compatible\n\t\t/// </summary>\n\t\tBigger,\n\n\t\t/// <summary>\n\t\t/// The ABI has changed\n\t\t/// </summary>\n\t\tIncompatible\n\t}\n\n\t[Serializable]\n\tpublic sealed class AbiEventArgs : EventArgs\n\t{\n\t\tpublic string Message { get; set; }\n\n\t\tpublic AbiEventArgs(string message)\n\t\t{\n\t\t\tthis.Message = message;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// The Abi comparer checks the public API of two compilation and determines the compatibility state.\n\t/// </summary>\n\tpublic class AbiComparer\n\t{\n\t\tpublic bool StopOnIncompatibility {\n\t\t\tget; \n\t\t\tset;\n\t\t}\n\t\tvoid CheckContstraints(IType otype, ITypeParameter p1, ITypeParameter p2, ref AbiCompatibility compatibility)\n\t\t{\n\t\t\tif (p1.DirectBaseTypes.Count () != p2.DirectBaseTypes.Count () ||\n\t\t\t    p1.HasReferenceTypeConstraint != p2.HasReferenceTypeConstraint ||\n\t\t\t    p1.HasValueTypeConstraint != p2.HasValueTypeConstraint ||\n\t\t\t    p1.HasDefaultConstructorConstraint != p2.HasDefaultConstructorConstraint) {\n\t\t\t\tOnIncompatibilityFound (new AbiEventArgs (string.Format (TranslateString (\"Type parameter constraints of type {0} have changed.\"), otype.FullName)));\n\t\t\t\tcompatibility = AbiCompatibility.Incompatible;\n\t\t\t}\n\t\t}\n\n\t\tvoid CheckContstraints(IMethod omethod, ITypeParameter p1, ITypeParameter p2, ref AbiCompatibility compatibility)\n\t\t{\n\t\t\tif (p1.DirectBaseTypes.Count () != p2.DirectBaseTypes.Count () ||\n\t\t\t    p1.HasReferenceTypeConstraint != p2.HasReferenceTypeConstraint ||\n\t\t\t    p1.HasValueTypeConstraint != p2.HasValueTypeConstraint ||\n\t\t\t    p1.HasDefaultConstructorConstraint != p2.HasDefaultConstructorConstraint) {\n\t\t\t\tOnIncompatibilityFound (new AbiEventArgs (string.Format (TranslateString (\"Type parameter constraints of method {0} have changed.\"), omethod.FullName)));\n\t\t\t\tcompatibility = AbiCompatibility.Incompatible;\n\t\t\t}\n\t\t}\n\n\t\tvoid CheckTypes (ITypeDefinition oType, ITypeDefinition nType, ref AbiCompatibility compatibility)\n\t\t{\n\t\t\tint oldMemberCount = 0;\n\t\t\tPredicate<IUnresolvedMember> pred = null;\n\t\t\tif (oType.Kind == TypeKind.Class || oType.Kind == TypeKind.Struct)\n\t\t\t\tpred = m => (m.IsPublic || m.IsProtected) && !m.IsOverride && !m.IsSynthetic;\n\n\t\t\tfor (int i = 0; i < oType.TypeParameterCount; i++) {\n\t\t\t\tCheckContstraints (oType, oType.TypeParameters[i], nType.TypeParameters[i], ref compatibility);\n\t\t\t\tif (compatibility == AbiCompatibility.Incompatible && StopOnIncompatibility)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach (var member in oType.GetMembers (pred, GetMemberOptions.IgnoreInheritedMembers)) {\n\t\t\t\tvar newMember = nType.GetMembers (m => member.UnresolvedMember.Name == m.Name && m.IsPublic == member.IsPublic && m.IsProtected == member.IsProtected);\n\t\t\t\tvar equalMember = newMember.FirstOrDefault (m => SignatureComparer.Ordinal.Equals (member, m));\n\t\t\t\tif (equalMember == null) {\n\t\t\t\t\tcompatibility = AbiCompatibility.Incompatible;\n\t\t\t\t\tif (StopOnIncompatibility)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar om = member as IMethod;\n\t\t\t\tif (om != null) {\n\t\t\t\t\tfor (int i = 0; i < om.TypeParameters.Count; i++) {\n\t\t\t\t\t\tCheckContstraints (om, om.TypeParameters[i], ((IMethod)equalMember).TypeParameters[i], ref compatibility);\n\t\t\t\t\t\tif (compatibility == AbiCompatibility.Incompatible && StopOnIncompatibility)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\toldMemberCount++;\n\t\t\t}\n\t\t\tif (compatibility == AbiCompatibility.Bigger && oType.Kind != TypeKind.Interface)\n\t\t\t\treturn;\n\t\t\tif (oldMemberCount != nType.GetMembers (pred, GetMemberOptions.IgnoreInheritedMembers).Count ()) {\n\t\t\t\tif (oType.Kind == TypeKind.Interface) {\n\t\t\t\t\tOnIncompatibilityFound (new AbiEventArgs (string.Format (TranslateString (\"Interafce {0} has changed.\"), oType.FullName)));\n\t\t\t\t\tcompatibility = AbiCompatibility.Incompatible;\n\t\t\t\t} else {\n\t\t\t\t\tif (compatibility == AbiCompatibility.Equal)\n\t\t\t\t\t\tcompatibility = AbiCompatibility.Bigger;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid CheckNamespace(INamespace oNs, INamespace nNs, ref AbiCompatibility compatibility)\n\t\t{\n\t\t\tforeach (var type in oNs.Types) {\n\t\t\t\tif (!type.IsPublic && !type.IsProtected)\n\t\t\t\t\tcontinue;\n\t\t\t\tvar newType = nNs.GetTypeDefinition (type.Name, type.TypeParameterCount);\n\t\t\t\tif (newType == null) {\n\t\t\t\t\tOnIncompatibilityFound (new AbiEventArgs (string.Format (TranslateString (\"Type definition {0} is missing.\"), type.FullName)));\n\t\t\t\t\tcompatibility = AbiCompatibility.Incompatible;\n\t\t\t\t\tif (StopOnIncompatibility) \n\t\t\t\t\t\treturn;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tCheckTypes (type, newType, ref compatibility);\n\t\t\t\tif (compatibility == AbiCompatibility.Incompatible && StopOnIncompatibility)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (compatibility == AbiCompatibility.Bigger)\n\t\t\t\treturn;\n\t\t\tforeach (var type in nNs.Types) {\n\t\t\t\tif (!type.IsPublic && !type.IsProtected)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (oNs.GetTypeDefinition (type.Name, type.TypeParameterCount) == null) {\n\t\t\t\t\tif (compatibility == AbiCompatibility.Equal)\n\t\t\t\t\t\tcompatibility = AbiCompatibility.Bigger;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool ContainsPublicTypes(INamespace testNs)\n\t\t{\n\t\t\tvar stack = new Stack<INamespace> ();\n\t\t\tstack.Push (testNs);\n\t\t\twhile (stack.Count > 0) {\n\t\t\t\tvar ns = stack.Pop ();\n\t\t\t\tif (ns.Types.Any (t => t.IsPublic))\n\t\t\t\t\treturn true;\n\t\t\t\tforeach (var child in ns.ChildNamespaces)\n\t\t\t\t\tstack.Push (child);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check the specified oldProject and newProject if they're compatible.\n\t\t/// </summary>\n\t\t/// <param name=\"oldProject\">Old project.</param>\n\t\t/// <param name=\"newProject\">New project.</param>\n\t\tpublic AbiCompatibility Check (ICompilation oldProject, ICompilation newProject)\n\t\t{\n\t\t\tvar oldStack = new Stack<INamespace> ();\n\t\t\tvar newStack = new Stack<INamespace> ();\n\t\t\toldStack.Push (oldProject.MainAssembly.RootNamespace);\n\t\t\tnewStack.Push (newProject.MainAssembly.RootNamespace);\n\n\t\t\tAbiCompatibility compatibility = AbiCompatibility.Equal;\n\t\t\twhile (oldStack.Count > 0) {\n\t\t\t\tvar oNs = oldStack.Pop ();\n\t\t\t\tvar nNs = newStack.Pop ();\n\n\t\t\t\tCheckNamespace (oNs, nNs, ref compatibility);\n\t\t\t\tif (compatibility == AbiCompatibility.Incompatible && StopOnIncompatibility)\n\t\t\t\t\treturn AbiCompatibility.Incompatible;\n\t\t\t\tforeach (var child in oNs.ChildNamespaces) {\n\t\t\t\t\tvar newChild = nNs.GetChildNamespace (child.Name);\n\t\t\t\t\tif (newChild == null) {\n\t\t\t\t\t\tOnIncompatibilityFound (new AbiEventArgs (string.Format (TranslateString (\"Namespace {0} is missing.\"), child.FullName)));\n\t\t\t\t\t\tif (StopOnIncompatibility)\n\t\t\t\t\t\t\treturn AbiCompatibility.Incompatible;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\toldStack.Push (child);\n\t\t\t\t\tnewStack.Push (newChild);\n\t\t\t\t}\n\n\t\t\t\t// check if namespaces are added\n\t\t\t\tif (compatibility != AbiCompatibility.Bigger) {\n\t\t\t\t\tforeach (var child in nNs.ChildNamespaces) {\n\t\t\t\t\t\tif (oNs.GetChildNamespace (child.Name) == null) {\n\t\t\t\t\t\t\tif (compatibility == AbiCompatibility.Equal && ContainsPublicTypes (child))\n\t\t\t\t\t\t\t\tcompatibility = AbiCompatibility.Bigger;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn compatibility;\n\t\t}\n\n\t\tpublic virtual string TranslateString(string str)\n\t\t{\n\t\t\treturn str;\n\t\t}\n\n\t\tpublic event EventHandler<AbiEventArgs> IncompatibilityFound;\n\n\t\tprotected virtual void OnIncompatibilityFound(AbiEventArgs e)\n\t\t{\n\t\t\tvar handler = IncompatibilityFound;\n\t\t\tif (handler != null)\n\t\t\t\thandler(this, e);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Analysis/SymbolCollector.cs",
    "content": "// Copyright (c) 2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.Analysis\n{\n\t/// <summary>\n\t/// The symbol collector collects related symbols that form a group of symbols that should be renamed\n\t/// when a name of one symbol changes. For example if a type definition name should be changed\n\t/// the constructors and destructor names should change as well.\n\t/// </summary>\n\tpublic class SymbolCollector\n\t{\n\t\t/// <summary>\n\t\t/// Gets or sets a value indicating whether this <see cref=\"ICSharpCode.NRefactory.Analysis.SymbolCollector\"/> should include overloads.\n\t\t/// </summary>\n\t\t/// <value><c>true</c> if overloads should be included; otherwise, <c>false</c>.</value>\n\t\tpublic bool IncludeOverloads { \n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool GroupForRenaming {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tstatic IEnumerable<ISymbol> CollectTypeRelatedMembers (ITypeDefinition type)\n\t\t{\n\t\t\tyield return type;\n\t\t\tforeach (var c in type.GetDefinition ().GetMembers (m => !m.IsSynthetic && (m.SymbolKind == SymbolKind.Constructor || m.SymbolKind == SymbolKind.Destructor), GetMemberOptions.IgnoreInheritedMembers)) {\n\t\t\t\tyield return c;\n\t\t\t}\n\t\t}\n\n\t\tstatic IEnumerable<ISymbol> CollectOverloads (IMethod method)\n\t\t{\n\t\t\treturn method.DeclaringType\n\t\t\t\t.GetMethods (m => m.Name == method.Name)\n\t\t\t\t.Where (m => m != method);\n\t\t}\n\n\t\tstatic IMember SearchMember (ITypeDefinition derivedType, IMember method)\n\t\t{\n\t\t\tforeach (var m in derivedType.Members) {\n\t\t\t\tif (m.ImplementedInterfaceMembers.Contains (method))\n\t\t\t\t\treturn m;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic IEnumerable<ISymbol> MakeUnique (List<ISymbol> symbols)\n\t\t{\n\t\t\tHashSet<ISymbol> taken = new HashSet<ISymbol> ();\n\t\t\tforeach (var sym in symbols) {\n\t\t\t\tif (taken.Contains (sym))\n\t\t\t\t\tcontinue;\n\t\t\t\ttaken.Add (sym);\n\t\t\t\tyield return sym;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the related symbols.\n\t\t/// </summary>\n\t\t/// <returns>The related symbols.</returns>\n\t\t/// <param name=\"g\">The type graph.</param>\n\t\t/// <param name=\"m\">The symbol to search</param>\n\t\tpublic IEnumerable<ISymbol> GetRelatedSymbols(Lazy<TypeGraph> g, ISymbol m)\n\t\t{\n\t\t\tswitch (m.SymbolKind) {\n\t\t\tcase SymbolKind.TypeDefinition:\n\t\t\t\treturn CollectTypeRelatedMembers ((ITypeDefinition)m);\n\t\n\t\t\tcase SymbolKind.Field:\n\t\t\tcase SymbolKind.Operator:\n\t\t\tcase SymbolKind.Variable:\n\t\t\tcase SymbolKind.Parameter:\n\t\t\tcase SymbolKind.TypeParameter:\n\t\t\t\treturn new ISymbol[] { m };\n\t\n\t\t\tcase SymbolKind.Constructor:\n\t\t\t\tif (GroupForRenaming)\n\t\t\t\t\treturn GetRelatedSymbols (g, ((IMethod)m).DeclaringTypeDefinition);\n\t\t\t\tList<ISymbol> constructorSymbols = new List<ISymbol> ();\n\t\t\t\tif (IncludeOverloads) {\n\t\t\t\t\tforeach (var m3 in CollectOverloads ((IMethod)m)) {\n\t\t\t\t\t\tconstructorSymbols.Add (m3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn constructorSymbols;\n\n\t\t\tcase SymbolKind.Destructor:\n\t\t\t\tif (GroupForRenaming)\n\t\t\t\t\treturn GetRelatedSymbols (g, ((IMethod)m).DeclaringTypeDefinition);\n\t\t\t\treturn new ISymbol[] { m };\n\n\t\t\tcase SymbolKind.Indexer:\n\t\t\tcase SymbolKind.Event:\n\t\t\tcase SymbolKind.Property:\n\t\t\tcase SymbolKind.Method: {\n\t\t\t\tvar member = (IMember)m;\n\t\t\t\tList<ISymbol> symbols = new List<ISymbol> ();\n\t\t\t\tif (!member.IsExplicitInterfaceImplementation)\n\t\t\t\t\tsymbols.Add (member);\n\t\t\t\tif (GroupForRenaming) {\n\t\t\t\t\tforeach (var m2 in member.ImplementedInterfaceMembers) {\n\t\t\t\t\t\tsymbols.AddRange (GetRelatedSymbols (g, m2));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsymbols.AddRange(member.ImplementedInterfaceMembers);\n\t\t\t\t}\n\n\t\t\t\tif (member.DeclaringType.Kind == TypeKind.Interface) {\n\t\t\t\t\tvar declaringTypeNode = g.Value.GetNode(member.DeclaringTypeDefinition);\n\t\t\t\t\tif (declaringTypeNode != null) {\n\t\t\t\t\t\tforeach (var derivedType in declaringTypeNode.DerivedTypes) {\n\t\t\t\t\t\t\tvar mem = SearchMember (derivedType.TypeDefinition, member);\n\t\t\t\t\t\t\tif (mem != null)\n\t\t\t\t\t\t\t\tsymbols.Add (mem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tif (IncludeOverloads) {\n\t\t\t\t\tIncludeOverloads = false;\n\t\t\t\t\tif (member is IMethod) {\n\t\t\t\t\t\tforeach (var m3 in CollectOverloads ((IMethod)member)) {\n\t\t\t\t\t\t\tsymbols.AddRange (GetRelatedSymbols (g, m3));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (member.SymbolKind == SymbolKind.Indexer) {\n\t\t\t\t\t\tsymbols.AddRange (member.DeclaringTypeDefinition.GetProperties (p => p.IsIndexer));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn MakeUnique (symbols);\n\t\t\t}\n\t\t\tcase SymbolKind.Namespace:\n\t\t\t\t// TODO?\n\t\t\t\treturn new ISymbol[] { m };\n\t\t\tdefault:\n\t\t\t\tthrow new ArgumentOutOfRangeException (\"symbol:\"+m.SymbolKind);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Analysis/TypeGraph.cs",
    "content": "﻿// Copyright (c) 2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Analysis\n{\n\t/// <summary>\n\t/// A graph where type definitions are nodes; and edges are given by inheritance.\n\t/// </summary>\n\tpublic class TypeGraph\n\t{\n\t\tDictionary<AssemblyQualifiedTypeName, TypeGraphNode> dict;\n\t\t\n\t\t/// <summary>\n\t\t/// Builds a graph of all type definitions in the specified set of assemblies.\n\t\t/// </summary>\n\t\t/// <param name=\"assemblies\">The input assemblies. The assemblies may belong to multiple compilations.</param>\n\t\t/// <remarks>The resulting graph may be cyclic if there are cyclic type definitions.</remarks>\n\t\tpublic TypeGraph(IEnumerable<IAssembly> assemblies)\n\t\t{\n\t\t\tif (assemblies == null)\n\t\t\t\tthrow new ArgumentNullException(\"assemblies\");\n\t\t\tdict = new Dictionary<AssemblyQualifiedTypeName, TypeGraphNode>();\n\t\t\tforeach (IAssembly assembly in assemblies) {\n\t\t\t\tforeach (ITypeDefinition typeDef in assembly.GetAllTypeDefinitions()) {\n\t\t\t\t\t// Overwrite previous entry - duplicates can occur if there are multiple versions of the\n\t\t\t\t\t// same project loaded in the solution (e.g. separate .csprojs for separate target frameworks)\n\t\t\t\t\tdict[new AssemblyQualifiedTypeName(typeDef)] = new TypeGraphNode(typeDef);\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach (IAssembly assembly in assemblies) {\n\t\t\t\tforeach (ITypeDefinition typeDef in assembly.GetAllTypeDefinitions()) {\n\t\t\t\t\tTypeGraphNode typeNode = dict[new AssemblyQualifiedTypeName(typeDef)];\n\t\t\t\t\tforeach (IType baseType in typeDef.DirectBaseTypes) {\n\t\t\t\t\t\tITypeDefinition baseTypeDef = baseType.GetDefinition();\n\t\t\t\t\t\tif (baseTypeDef != null) {\n\t\t\t\t\t\t\tTypeGraphNode baseTypeNode;\n\t\t\t\t\t\t\tif (dict.TryGetValue(new AssemblyQualifiedTypeName(baseTypeDef), out baseTypeNode)) {\n\t\t\t\t\t\t\t\ttypeNode.BaseTypes.Add(baseTypeNode);\n\t\t\t\t\t\t\t\tbaseTypeNode.DerivedTypes.Add(typeNode);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic TypeGraphNode GetNode(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (typeDefinition == null)\n\t\t\t\treturn null;\n\t\t\treturn GetNode(new AssemblyQualifiedTypeName(typeDefinition));\n\t\t}\n\t\t\n\t\tpublic TypeGraphNode GetNode(AssemblyQualifiedTypeName typeName)\n\t\t{\n\t\t\tTypeGraphNode node;\n\t\t\tif (dict.TryGetValue(typeName, out node))\n\t\t\t\treturn node;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Analysis/TypeGraphNode.cs",
    "content": "﻿// Copyright (c) 2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Analysis\n{\n\tpublic sealed class TypeGraphNode\n\t{\n\t\treadonly ITypeDefinition typeDef;\n\t\treadonly List<TypeGraphNode> baseTypes = new List<TypeGraphNode>();\n\t\treadonly List<TypeGraphNode> derivedTypes = new List<TypeGraphNode>();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new unconnected type graph node.\n\t\t/// </summary>\n\t\tpublic TypeGraphNode(ITypeDefinition typeDef)\n\t\t{\n\t\t\tthis.typeDef = typeDef;\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition TypeDefinition {\n\t\t\tget { return typeDef; }\n\t\t}\n\t\t\n\t\tpublic IList<TypeGraphNode> DerivedTypes {\n\t\t\tget { return derivedTypes; }\n\t\t}\n\t\t\n\t\tpublic IList<TypeGraphNode> BaseTypes {\n\t\t\tget { return baseTypes; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/CompletionCategory.cs",
    "content": "﻿// \n// CompletionCategory.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\tpublic abstract class CompletionCategory : IComparable<CompletionCategory>\n\t{\n\t\tpublic string DisplayText { get; set; }\n\t\t\n\t\tpublic string Icon { get; set; }\n\t\t\n\t\tprotected CompletionCategory ()\n\t\t{\n\t\t}\n\t\t\n\t\tprotected CompletionCategory (string displayText, string icon)\n\t\t{\n\t\t\tthis.DisplayText = displayText;\n\t\t\tthis.Icon = icon;\n\t\t}\n\t\t\n\t\tpublic abstract int CompareTo (CompletionCategory other);\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/CompletionExtensionMethods.cs",
    "content": "//\n// CompletionExtensionMethods.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\tpublic static class CompletionExtensionMethods\n\t{\n\t\t/// <summary>\n\t\t/// Gets the EditorBrowsableState of an entity.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The editor browsable state.\n\t\t/// </returns>\n\t\t/// <param name='entity'>\n\t\t/// Entity.\n\t\t/// </param>\n\t\tpublic static System.ComponentModel.EditorBrowsableState GetEditorBrowsableState(this IEntity entity)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException (\"entity\");\n\n\t\t\tvar browsableState = entity.Attributes.FirstOrDefault(attr => attr.AttributeType.Name == \"EditorBrowsableAttribute\" && attr.AttributeType.Namespace == \"System.ComponentModel\");\n\t\t\tif (browsableState != null && browsableState.PositionalArguments.Count == 1) {\n\t\t\t\tif (browsableState.PositionalArguments [0].ConstantValue is int)\n\t\t\t\t\treturn (System.ComponentModel.EditorBrowsableState)(int)browsableState.PositionalArguments [0].ConstantValue;\n\t\t\t}\n\t\t\treturn System.ComponentModel.EditorBrowsableState.Always;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Determines if an entity should be shown in the code completion window. This is the same as:\n\t\t/// <c>GetEditorBrowsableState (entity) != System.ComponentModel.EditorBrowsableState.Never</c>\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// <c>true</c> if the entity should be shown; otherwise, <c>false</c>.\n\t\t/// </returns>\n\t\t/// <param name='entity'>\n\t\t/// The entity.\n\t\t/// </param>\n\t\tpublic static bool IsBrowsable(this IEntity entity)\n\t\t{\n\t\t\treturn GetEditorBrowsableState (entity) != System.ComponentModel.EditorBrowsableState.Never;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/DisplayFlags.cs",
    "content": "// \n// DisplayFlags.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\t[Flags]\n\tpublic enum DisplayFlags\n\t{\n\t\tNone = 0,\n\t\tHidden = 1,\n\t\tObsolete = 2,\n\t\tDescriptionHasMarkup = 4,\n\t\tNamedArgument = 8,\n\t\tIsImportCompletion = 16,\n\t\tMarkedBold = 32\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/FrameworkLookup.cs",
    "content": "//\n// FrameworkLookup.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\t/// <summary>\n\t/// The framework lookup provides a fast lookup where an unknow type or extension method may be defined in.\n\t/// </summary>\n\tpublic sealed class FrameworkLookup \n\t{\n\t\t/*\t\t Binary format:\n\t\t * [Header]\n\t\t *    [Version] : [Major (byte)] [Minor (byte)] [Build  (byte)]\n\t\t * \t  [#Types (int)]\n\t\t *    [#Methods (int)]\n\t\t *    [#Assemblies (int)]\n\t\t * [AssemblyListTable] : #Assemblies x [OffsetToAssemblyLists (int)]\n\t\t * [TypeLookupTable] : #Types x ( [NameHash (int)] [AssemblyPtrToAssemblyListTable (ushort)]\n\t\t * [ExtMethodLookupTable] : #Methods x ( [NameHash (int)] [AssemblyPtrToAssemblyListTable (ushort)]\n\t\t * [AssemblyLists] \n\t\t *    [#Count (byte)]\n\t\t *    #Count x [AssemblyLookup] : [Package (string)] [FullName (string)] [Namespace (string)] \n\t\t*/\n\t\tconst int headerSize = \n\t\t\t3 + // Version\n\t\t\t4 + // #Types\n\t\t\t4 + // #Methods\n\t\t\t4   // #Assembly\n\t\t\t/*\t\t\t+ 4*/;\n\n\t\tpublic static readonly Version CurrentVersion = new Version (2, 0, 1);\n\t\tpublic static readonly FrameworkLookup Empty = new FrameworkLookup ();\n\n\t\tstring fileName;\n\t\tint[] assemblyListTable;\n\t\tint[] typeLookupTable;\n\t\tint[] extLookupTable;\n\n\t\t/// <summary>\n\t\t/// This method tries to get a matching extension method.\n\t\t/// </summary>\n\t\t/// <returns>The extension method lookups.</returns>\n\t\t/// <param name=\"resolveResult\">The resolve result.</param>\n\t\tpublic IEnumerable<AssemblyLookup> GetExtensionMethodLookups (UnknownMemberResolveResult resolveResult)\n\t\t{\n\t\t\treturn GetLookup (resolveResult.MemberName, extLookupTable, headerSize + assemblyListTable.Length * 4 + typeLookupTable.Length * 8);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Tries to get a type out of an unknow identifier result.\n\t\t/// </summary>\n\t\t/// <returns>The assemblies the type may be defined (if any).</returns>\n\t\t/// <param name=\"resolveResult\">The resolve result.</param>\n\t\t/// <param name=\"typeParameterCount\">Type parameter count.</param>\n\t\t/// <param name=\"isInsideAttributeType\">If set to <c>true</c> this resolve result may be inside an attribute.</param>\n\t\tpublic IEnumerable<AssemblyLookup> GetLookups (UnknownIdentifierResolveResult resolveResult, int typeParameterCount, bool isInsideAttributeType)\n\t\t{\n\t\t\tstring name = isInsideAttributeType ? resolveResult.Identifier + \"Attribute\" : resolveResult.Identifier;\n\n\t\t\tvar identifier = GetIdentifier (name, typeParameterCount);\n\t\t\treturn GetLookup (identifier, typeLookupTable, headerSize + assemblyListTable.Length * 4);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Tries to get a type out of an unknow member resolve result. (In case of fully qualified names)\n\t\t/// </summary>\n\t\t/// <returns>The assemblies the type may be defined (if any).</returns>\n\t\t/// <param name=\"resolveResult\">The resolve result.</param>\n\t\t/// <param name=\"fullMemberName\"></param>\n\t\t/// <param name=\"typeParameterCount\">Type parameter count.</param>\n\t\t/// <param name=\"isInsideAttributeType\">If set to <c>true</c> this resolve result may be inside an attribute.</param>\n\t\tpublic IEnumerable<AssemblyLookup> GetLookups (UnknownMemberResolveResult resolveResult, string fullMemberName, int typeParameterCount, bool isInsideAttributeType)\n\t\t{\n\t\t\tstring name = isInsideAttributeType ? resolveResult.MemberName + \"Attribute\" : resolveResult.MemberName;\n\n\t\t\tvar identifier = GetIdentifier (name, typeParameterCount);\n\t\t\tforeach (var lookup in GetLookup (identifier, typeLookupTable, headerSize + assemblyListTable.Length * 4)) {\n\t\t\t\tif (fullMemberName.StartsWith (lookup.Namespace, StringComparison.Ordinal))\n\t\t\t\t\tyield return lookup;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The assembly lookup determines where a type might be defined.\n\t\t/// It contains the assembly &amp; the namespace.\n\t\t/// </summary>\n\t\tpublic struct AssemblyLookup\n\t\t{\n\t\t\treadonly string nspace;\n\n\t\t\t/// <summary>\n\t\t\t/// The namespace the requested type is in.\n\t\t\t/// </summary>\n\t\t\tpublic string Namespace {\n\t\t\t\tget {\n\t\t\t\t\treturn nspace;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treadonly string fullName;\n\t\t\t/// <summary>\n\t\t\t/// Gets the full name af the assembly.\n\t\t\t/// </summary>\n\t\t\tpublic string FullName {\n\t\t\t\tget {\n\t\t\t\t\treturn fullName;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treadonly string package;\n\t\t\t/// <summary>\n\t\t\t/// Gets the package the assembly is in.\n\t\t\t/// </summary>\n\t\t\tpublic string Package {\n\t\t\t\tget {\n\t\t\t\t\treturn package;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Initializes a new instance of the <see cref=\"AssemblyLookup\"/> struct.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"package\">The package name.</param>\n\t\t\t/// <param name=\"fullName\">The full name of the assembly.</param>\n\t\t\t/// <param name=\"nspace\">The namespace the type is in.</param>\n\t\t\tinternal AssemblyLookup (string package, string fullName, string nspace)\n\t\t\t{\n\t\t\t\tif (nspace == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"nspace\");\n\t\t\t\tif (fullName == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"fullName\");\n\t\t\t\tthis.package = package;\n\t\t\t\tthis.fullName = fullName;\n\t\t\t\tthis.nspace = nspace;\n\t\t\t}\n\n\t\t\tpublic override string ToString ()\n\t\t\t{\n\t\t\t\treturn string.Format (\"[AssemblyLookup: Namespace={0}, FullName={1}, Package={2}]\", Namespace, FullName, Package);\n\t\t\t}\n\n\t\t\tpublic override bool Equals (object obj)\n\t\t\t{\n\t\t\t\tif (obj == null)\n\t\t\t\t\treturn false;\n\t\t\t\t//\t\t\t\t\tif (ReferenceEquals (this, obj))\n\t\t\t\t//\t\t\t\t\t\treturn true;\n\t\t\t\tif (obj.GetType () != typeof(AssemblyLookup))\n\t\t\t\t\treturn false;\n\t\t\t\tvar other = (AssemblyLookup)obj;\n\t\t\t\treturn Namespace == other.Namespace && FullName == other.FullName && Package == other.Package;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode ()\n\t\t\t{\n\t\t\t\tunchecked {\n\t\t\t\t\treturn (Namespace != null ? Namespace.GetHashCode () : 0) ^\n\t\t\t\t\t\t(FullName != null ? FullName.GetHashCode () : 0) ^ \n\t\t\t\t\t\t(Package != null ? Package.GetHashCode () : 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This method returns a new framework builder to build a new framework lookup data file.\n\t\t/// </summary>\n\t\t/// <param name=\"fileName\">The file name of the data file.</param>\n\t\tpublic static FrameworkBuilder Create (string fileName)\n\t\t{\n\t\t\treturn new FrameworkBuilder (fileName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Loads a framework lookup object from a file. May return null, if the file wasn't found or has a version mismatch.\n\t\t/// </summary>\n\t\t/// <param name=\"fileName\">File name.</param>\n\t\tpublic static FrameworkLookup Load (string fileName)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (!File.Exists (fileName))\n\t\t\t\t\treturn null;\n\t\t\t} catch (Exception) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar result = new FrameworkLookup ();\n\t\t\tresult.fileName = fileName;\n\t\t\tvar fs = File.OpenRead (fileName);\n\t\t\tusing (var reader = new BinaryReader (fs, Encoding.UTF8)) {\n\t\t\t\tvar major = reader.ReadByte ();\n\t\t\t\tvar minor = reader.ReadByte ();\n\t\t\t\tvar build = reader.ReadByte ();\n\t\t\t\tvar version = new Version (major, minor, build);\n\t\t\t\tif (version != CurrentVersion)\n\t\t\t\t\treturn null;\n\t\t\t\tint typeLookupListCount = reader.ReadInt32 ();\n\t\t\t\tint extLookupListCount = reader.ReadInt32 ();\n\t\t\t\tint assemblyLookupCount = reader.ReadInt32 ();\n\n\t\t\t\tresult.assemblyListTable = new int[assemblyLookupCount];\n\t\t\t\tfor (int i = 0; i < assemblyLookupCount; i++) {\n\t\t\t\t\tresult.assemblyListTable[i] = reader.ReadInt32 ();\n\t\t\t\t}\n\n\t\t\t\tresult.typeLookupTable = new int[typeLookupListCount];\n\t\t\t\tfor (int i = 0; i < typeLookupListCount; i++) {\n\t\t\t\t\tresult.typeLookupTable [i] = reader.ReadInt32 ();\n\t\t\t\t\t// skip list offset\n\t\t\t\t\treader.ReadInt32 ();\n\t\t\t\t}\n\n\t\t\t\tresult.extLookupTable = new int[extLookupListCount];\n\t\t\t\tfor (int i = 0; i < extLookupListCount; i++) {\n\t\t\t\t\tresult.extLookupTable [i] = reader.ReadInt32 ();\n\t\t\t\t\t// skip list offset\n\t\t\t\t\treader.ReadInt32 ();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tFrameworkLookup ()\n\t\t{\n\t\t}\n\n\t\tIEnumerable<AssemblyLookup> GetLookup (string identifier, int[] lookupTable, int tableOffset)\n\t\t{\n\t\t\tif (lookupTable == null)\n\t\t\t\tyield break;\n\n\t\t\tint index = Array.BinarySearch (lookupTable, GetStableHashCode (identifier));\n\t\t\tif (index < 0)\n\t\t\t\tyield break;\n\n\t\t\tusing (var reader = new BinaryReader (File.Open (fileName, FileMode.Open, FileAccess.Read, FileShare.Read), Encoding.UTF8)) {\n\t\t\t\treader.BaseStream.Seek (tableOffset + index * 8 + 4, SeekOrigin.Begin);\n\t\t\t\tint listPtr = reader.ReadInt32 ();\n\n\t\t\t\treader.BaseStream.Seek (listPtr, SeekOrigin.Begin);\n\t\t\t\tvar b = reader.ReadInt32 ();\n\t\t\t\tvar assemblies = new List<ushort> ();\n\t\t\t\twhile (b-- > 0) {\n\t\t\t\t\tvar assembly = reader.ReadUInt16 ();\n\t\t\t\t\tif (assembly < 0 || assembly >= assemblyListTable.Length)\n\t\t\t\t\t\tthrow new InvalidDataException (\"Assembly lookup was \" + assembly + \" but only \" + assemblyListTable.Length + \" are known.\");\n\t\t\t\t\tassemblies.Add (assembly);\n\t\t\t\t}\n\t\t\t\tforeach (var assembly in assemblies) {\n\t\t\t\t\treader.BaseStream.Seek (assemblyListTable [assembly], SeekOrigin.Begin);\n\n\t\t\t\t\tvar package = reader.ReadString ();\n\t\t\t\t\tvar fullName = reader.ReadString ();\n\t\t\t\t\tvar ns = reader.ReadString ();\n\t\t\t\t\tyield return new AssemblyLookup (package, fullName, ns);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Retrieves a hash code for the specified string that is stable across\n\t\t/// .NET upgrades.\n\t\t/// \n\t\t/// Use this method instead of the normal <c>string.GetHashCode</c> if the hash code\n\t\t/// is persisted to disk.\n\t\t/// </summary>\n\t\tstatic int GetStableHashCode(string text)\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint h = 0;\n\t\t\t\tforeach (char c in text) {\n\t\t\t\t\th = (h << 5) - h + c;\n\t\t\t\t}\n\t\t\t\treturn h;\n\t\t\t}\n\t\t}\n\n\t\tstatic string GetIdentifier (string identifier, int tc)\n\t\t{\n\t\t\tif (tc == 0)\n\t\t\t\treturn identifier;\n\t\t\treturn identifier + \"`\" + tc;\n\t\t}\n\n\t\tpublic class FrameworkBuilder : IDisposable\n\t\t{\n\t\t\treadonly string fileName;\n\n\t\t\tDictionary<int, List<ushort>> typeLookup = new Dictionary<int, List<ushort>>  ();\n\t\t\tDictionary<int, List<ushort>> extensionMethodLookup = new Dictionary<int, List<ushort>>  ();\n\t\t\tList<AssemblyLookup> assemblyLookups = new List<AssemblyLookup> ();\n\t\t\tDictionary<int, string> methodCheck = new Dictionary<int, string> ();\n\t\t\tDictionary<int, string> typeCheck = new Dictionary<int, string> ();\n\n\t\t\tinternal FrameworkBuilder (string fileName)\n\t\t\t{\n\t\t\t\tthis.fileName = fileName;\n\t\t\t}\n\n\t\t\tstatic int[] WriteTable (MemoryStream stream, Dictionary<int, List<ushort>> table, out List<KeyValuePair<int, List<ushort>>> list)\n\t\t\t{\n\t\t\t\tlist = new List<KeyValuePair<int, List<ushort>>> (table);\n\t\t\t\tlist.Sort ((x, y) => x.Key.CompareTo (y.Key));\n\n\t\t\t\tvar result = new int[list.Count];\n\t\t\t\tusing (var bw = new BinaryWriter (stream)) {\n\t\t\t\t\tfor (int i = 0; i < result.Length; i++) {\n\t\t\t\t\t\tresult [i] = (int)stream.Length;\n\t\t\t\t\t\tbw.Write (list [i].Value.Count);\n\t\t\t\t\t\tforeach (var ii in list [i].Value)\n\t\t\t\t\t\t\tbw.Write (ii);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#region IDisposable implementation\n\n\t\t\tvoid IDisposable.Dispose ()\n\t\t\t{\n\t\t\t\tvar typeLookupMemory = new MemoryStream ();\n\t\t\t\tList<KeyValuePair<int, List<ushort>>> typeLookupList;\n\t\t\t\tvar typeTable = WriteTable (typeLookupMemory, typeLookup, out typeLookupList);\n\n\t\t\t\tvar extMethodLookupMemory = new MemoryStream ();\n\t\t\t\tList<KeyValuePair<int, List<ushort>>> extMethodLookuplist;\n\t\t\t\tvar extMethodTable = WriteTable (extMethodLookupMemory, extensionMethodLookup, out extMethodLookuplist);\n\n\t\t\t\tvar assemblyLookupMemory = new MemoryStream ();\n\t\t\t\tvar assemblyPositionTable = new int[assemblyLookups.Count];\n\t\t\t\tusing (var writer = new BinaryWriter (assemblyLookupMemory, Encoding.UTF8)) {\n\t\t\t\t\tfor (int i = 0; i < assemblyLookups.Count; i++) {\n\t\t\t\t\t\tvar lookup = assemblyLookups[i];\n\t\t\t\t\t\tassemblyPositionTable[i] = (int)assemblyLookupMemory.Length;\n\t\t\t\t\t\twriter.Write (lookup.Package);\n\t\t\t\t\t\twriter.Write (lookup.FullName);\n\t\t\t\t\t\twriter.Write (lookup.Namespace);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tusing (var stream = new BinaryWriter (File.OpenWrite (fileName), Encoding.UTF8)) {\n\t\t\t\t\tstream.Write ((byte)CurrentVersion.Major);\n\t\t\t\t\tstream.Write ((byte)CurrentVersion.Minor);\n\t\t\t\t\tstream.Write ((byte)CurrentVersion.Build);\n\n\t\t\t\t\tstream.Write (typeLookupList.Count);\n\t\t\t\t\tstream.Write (extMethodLookuplist.Count);\n\t\t\t\t\tstream.Write (assemblyLookups.Count);\n\n\t\t\t\t\tvar typeBuffer = typeLookupMemory.ToArray ();\n\t\t\t\t\tvar extMethodBuffer = extMethodLookupMemory.ToArray ();\n\n\t\t\t\t\tint dataOffset = \n\t\t\t\t\t\theaderSize + \n\t\t\t\t\t\tassemblyLookups.Count * 4 + \n\t\t\t\t\t\ttypeLookupList.Count * (4 + 4) + \n\t\t\t\t\t\textMethodLookuplist.Count * (4 + 4);\n\n\t\t\t\t\tfor (int i = 0; i < assemblyLookups.Count; i++) {\n\t\t\t\t\t\tstream.Write ((int)(dataOffset + typeBuffer.Length + extMethodBuffer.Length + assemblyPositionTable[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < typeLookupList.Count; i++) {\n\t\t\t\t\t\tstream.Write (typeLookupList [i].Key);\n\t\t\t\t\t\tstream.Write (dataOffset + typeTable[i]);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < extMethodLookuplist.Count; i++) {\n\t\t\t\t\t\tstream.Write (extMethodLookuplist [i].Key);\n\t\t\t\t\t\tstream.Write (dataOffset + typeBuffer.Length + extMethodTable[i]);\n\t\t\t\t\t}\n\n\t\t\t\t\tstream.Write (typeBuffer);\n\t\t\t\t\tstream.Write (extMethodBuffer);\n\t\t\t\t\tstream.Write (assemblyLookupMemory.ToArray ());\n\t\t\t\t\tstream.Flush ();\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\tstruct FrameworkLookupId \n\t\t\t{\n\t\t\t\tpublic string PackageName;\n\t\t\t\tpublic string AssemblyName;\n\t\t\t\tpublic string NameSpace;\n\t\t\t}\n\n\t\t\tDictionary<FrameworkLookupId, ushort> frameworkLookupTable = new Dictionary<FrameworkLookupId, ushort> ();\n\t\t\tushort GetLookup (string packageName, string assemblyName, string ns)\n\t\t\t{\n\t\t\t\tvar id = new FrameworkLookupId {\n\t\t\t\t\tPackageName = packageName,\n\t\t\t\t\tAssemblyName = assemblyName,\n\t\t\t\t\tNameSpace = ns\n\t\t\t\t};\n\t\t\t\tushort value;\n\t\t\t\tif (frameworkLookupTable.TryGetValue (id, out value))\n\t\t\t\t\treturn value;\n\n\t\t\t\tvar result = new AssemblyLookup (packageName, assemblyName, ns);\n\t\t\t\tassemblyLookups.Add (result);\n\t\t\t\tvar index = assemblyLookups.Count - 1;\n\t\t\t\tif (index > ushort.MaxValue)\n\t\t\t\t\tthrow new InvalidOperationException (\"Assembly lookup list overflow > \" + ushort.MaxValue + \" assemblies.\");\n\t\t\t\tframeworkLookupTable.Add (id, (ushort)index);\n\t\t\t\treturn (ushort)index;\n\t\t\t}\n\n\t\t\tbool AddToTable (string packageName, string assemblyName, Dictionary<int, List<ushort>> table, Dictionary<int, string> checkTable, string id, string ns)\n\t\t\t{\n\t\t\t\tList<ushort> list;\n\t\t\t\tvar hash = GetStableHashCode (id);\n\n\t\t\t\tif (!table.TryGetValue (hash, out list)) {\n\t\t\t\t\tlist = new List<ushort> ();\n\t\t\t\t\ttable [hash] = list;\n\t\t\t\t} else {\n\t\t\t\t\tstring existingString;\n\t\t\t\t\tif (checkTable.TryGetValue (hash, out existingString)) {\n\t\t\t\t\t\tif (existingString != id)\n\t\t\t\t\t\t\tthrow new InvalidOperationException (\"Duplicate hash for \" + existingString + \" and \"+ id); \n\t\t\t\t\t} else {\n\t\t\t\t\t\tcheckTable.Add (hash, id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar assemblyLookup = GetLookup (packageName, assemblyName, ns);\n\t\t\t\tif (!list.Any (a => a.Equals (assemblyLookup))) {\n\t\t\t\t\tlist.Add (assemblyLookup);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Add a type to the framework lookup.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"packageName\">The package the assembly of the type is defined (can be null).</param>\n\t\t\t/// <param name=\"fullAssemblyName\">The full assembly name the type is defined (needs to be != null).</param>\n\t\t\t/// <param name=\"type\">The type definition  (needs to be != null).</param>\n\t\t\tpublic void AddLookup (string packageName, string fullAssemblyName, IUnresolvedTypeDefinition type)\n\t\t\t{\n\t\t\t\tif (fullAssemblyName == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"fullAssemblyName\");\n\t\t\t\tif (type == null)\n\t\t\t\t\tthrow new ArgumentNullException (\"type\");\n\t\t\t\tvar id = GetIdentifier (type.Name, type.TypeParameters.Count);\n\t\t\t\tif (AddToTable (packageName, fullAssemblyName, typeLookup, typeCheck, id, type.Namespace)) {\n\t\t\t\t\tif (type.IsSealed || type.IsStatic) {\n\t\t\t\t\t\tforeach (var method in type.Methods) {\n\t\t\t\t\t\t\tvar m = method as DefaultUnresolvedMethod;\n\t\t\t\t\t\t\tif (m == null || !m.IsExtensionMethod)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tAddToTable (packageName, fullAssemblyName, extensionMethodLookup, methodCheck, method.Name, method.DeclaringTypeDefinition.Namespace);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/ICompletionData.cs",
    "content": "// \n// ICompletionData.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\tpublic interface ICompletionData\n\t{\n\t\tCompletionCategory CompletionCategory { get; set; }\n\t\t\n\t\tstring DisplayText { get; set; }\n\n\t\tstring Description { get; set; }\n\t\t\n\t\tstring CompletionText { get; set; }\n\t\t\n\t\tDisplayFlags DisplayFlags { get; set; }\n\t\t\n\t\tbool HasOverloads { \n\t\t\tget;\n\t\t}\n\t\t\n\t\tIEnumerable<ICompletionData> OverloadedData {\n\t\t\tget;\n\t\t}\n\t\t\n\t\tvoid AddOverload (ICompletionData data);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/IEntityCompletionData.cs",
    "content": "// \n// IEntityCompletionData.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\tpublic interface IEntityCompletionData : ICompletionData\n\t{\n\t\tIEntity Entity {\n\t\t\tget;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/IParameterDataProvider.cs",
    "content": "// \n// IParameterDataProvider.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\t/// <summary>\n\t/// Provides intellisense information for a collection of parametrized members.\n\t/// </summary>\n\tpublic interface IParameterDataProvider\n\t{\n\t\t/// <summary>\n\t\t/// Gets the overload count.\n\t\t/// </summary>\n\t\tint Count { \n\t\t\tget; \n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the start offset of the parameter expression node.\n\t\t/// </summary>\n\t\tint StartOffset { \n\t\t\tget; \n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the markup to use to represent the specified method overload\n\t\t/// in the parameter information window.\n\t\t/// </summary>\n\t\tstring GetHeading (int overload, string[] parameterDescription, int currentParameter);\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the markup for the description to use to represent the specified method overload\n\t\t/// in the parameter information window.\n\t\t/// </summary>\n\t\tstring GetDescription (int overload, int currentParameter);\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the text to use to represent the specified parameter\n\t\t/// </summary>\n\t\tstring GetParameterDescription (int overload, int paramIndex);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name of the parameter.\n\t\t/// </summary>\n\t\tstring GetParameterName (int overload, int currentParameter);\n\n\t\t/// <summary>\n\t\t/// Returns the number of parameters of the specified method\n\t\t/// </summary>\n\t\tint GetParameterCount (int overload);\n\t\t\n\t\t/// <summary>\n\t\t/// Used for the params lists. (for example \"params\" in c#).\n\t\t/// </summary>\n\t\tbool AllowParameterList (int overload);\n\t}\n}\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Completion/IVariableCompletionData.cs",
    "content": "// \n// IVariableCompletionData.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Completion\n{\n\tpublic interface IVariableCompletionData : ICompletionData\n\t{\n\t\tIVariable Variable {\n\t\t\tget;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Documentation/DocumentationComment.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t/// <summary>\n\t/// Represents a documentation comment.\n\t/// </summary>\n\tpublic class DocumentationComment\n\t{\n\t\tITextSource xml;\n\t\tprotected readonly ITypeResolveContext context;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the XML code for this documentation comment.\n\t\t/// </summary>\n\t\tpublic ITextSource Xml {\n\t\t\tget { return xml; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new DocumentationComment.\n\t\t/// </summary>\n\t\t/// <param name=\"xml\">The XML text.</param>\n\t\t/// <param name=\"context\">Context for resolving cref attributes.</param>\n\t\tpublic DocumentationComment(ITextSource xml, ITypeResolveContext context)\n\t\t{\n\t\t\tif (xml == null)\n\t\t\t\tthrow new ArgumentNullException(\"xml\");\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tthis.xml = xml;\n\t\t\tthis.context = context;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new DocumentationComment.\n\t\t/// </summary>\n\t\t/// <param name=\"xml\">The XML text.</param>\n\t\t/// <param name=\"context\">Context for resolving cref attributes.</param>\n\t\tpublic DocumentationComment(string xml, ITypeResolveContext context)\n\t\t{\n\t\t\tif (xml == null)\n\t\t\t\tthrow new ArgumentNullException(\"xml\");\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tthis.xml = new StringTextSource(xml);\n\t\t\tthis.context = context;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the given cref value to an entity.\n\t\t/// Returns null if the entity is not found, or if the cref attribute is syntactically invalid.\n\t\t/// </summary>\n\t\tpublic virtual IEntity ResolveCref(string cref)\n\t\t{\n\t\t\ttry {\n\t\t\t\treturn IdStringProvider.FindEntity(cref, context);\n\t\t\t} catch (ReflectionNameParseException) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn Xml.Text;\n\t\t}\n\t\t\n\t\tpublic static implicit operator string (DocumentationComment documentationComment)\n\t\t{\n\t\t\tif (documentationComment != null)\n\t\t\t\treturn documentationComment.ToString ();\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Documentation/GetPotentiallyNestedClassTypeReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t/// <summary>\n\t/// A type reference of the form 'Some.Namespace.TopLevelType.NestedType`n'.\n\t/// We do not know the boundary between namespace name and top level type, so we have to try\n\t/// all possibilities.\n\t/// The type parameter count only applies to the innermost type, all outer types must be non-generic.\n\t/// </summary>\n\t[Serializable]\n\tclass GetPotentiallyNestedClassTypeReference : ITypeReference\n\t{\n\t\treadonly string typeName;\n\t\treadonly int typeParameterCount;\n\t\t\n\t\tpublic GetPotentiallyNestedClassTypeReference(string typeName, int typeParameterCount)\n\t\t{\n\t\t\tthis.typeName = typeName;\n\t\t\tthis.typeParameterCount = typeParameterCount;\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tstring[] parts = typeName.Split('.');\n\t\t\tvar assemblies = new [] { context.CurrentAssembly }.Concat(context.Compilation.Assemblies);\n\t\t\tfor (int i = parts.Length - 1; i >= 0; i--) {\n\t\t\t\tstring ns = string.Join(\".\", parts, 0, i);\n\t\t\t\tstring name = parts[i];\n\t\t\t\tint topLevelTPC = (i == parts.Length - 1 ? typeParameterCount : 0);\n\t\t\t\tforeach (var asm in assemblies) {\n\t\t\t\t\tif (asm == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tITypeDefinition typeDef = asm.GetTypeDefinition(new TopLevelTypeName(ns, name, topLevelTPC));\n\t\t\t\t\tfor (int j = i + 1; j < parts.Length && typeDef != null; j++) {\n\t\t\t\t\t\tint tpc = (j == parts.Length - 1 ? typeParameterCount : 0);\n\t\t\t\t\t\ttypeDef = typeDef.NestedTypes.FirstOrDefault(n => n.Name == parts[j] && n.TypeParameterCount == tpc);\n\t\t\t\t\t}\n\t\t\t\t\tif (typeDef != null)\n\t\t\t\t\t\treturn typeDef;\n\t\t\t\t}\n\t\t\t}\n\t\t\tint idx = typeName.LastIndexOf('.');\n\t\t\tif (idx < 0)\n\t\t\t\treturn new UnknownType(\"\", typeName, typeParameterCount);\n\t\t\t// give back a guessed namespace/type name\n\t\t\treturn  new UnknownType(typeName.Substring(0, idx), typeName.Substring(idx + 1), typeParameterCount);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Documentation/IDocumentationProvider.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t/// <summary>\n\t/// Provides XML documentation for entities.\n\t/// </summary>\n\tpublic interface IDocumentationProvider\n\t{\n\t\t/// <summary>\n\t\t/// Gets the XML documentation for the specified entity.\n\t\t/// </summary>\n\t\tDocumentationComment GetDocumentation(IEntity entity);\n\t}\n\t\n\t/// <summary>\n\t/// Provides XML documentation for entities.\n\t/// </summary>\n\tpublic interface IUnresolvedDocumentationProvider\n\t{\n\t\t/// <summary>\n\t\t/// Gets the XML documentation for the specified entity.\n\t\t/// </summary>\n\t\tstring GetDocumentation(IUnresolvedEntity entity);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the XML documentation for the specified entity.\n\t\t/// </summary>\n\t\tDocumentationComment GetDocumentation(IUnresolvedEntity entity, IEntity resolvedEntity);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Documentation/IdStringMemberReference.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t[Serializable]\n\tclass IdStringMemberReference : IMemberReference\n\t{\n\t\treadonly ITypeReference declaringTypeReference;\n\t\treadonly char memberType;\n\t\treadonly string memberIdString;\n\t\t\n\t\tpublic IdStringMemberReference(ITypeReference declaringTypeReference, char memberType, string memberIdString)\n\t\t{\n\t\t\tthis.declaringTypeReference = declaringTypeReference;\n\t\t\tthis.memberType = memberType;\n\t\t\tthis.memberIdString = memberIdString;\n\t\t}\n\t\t\n\t\tbool CanMatch(IUnresolvedMember member)\n\t\t{\n\t\t\tswitch (member.SymbolKind) {\n\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\treturn memberType == 'F';\n\t\t\t\tcase SymbolKind.Property:\n\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\t\treturn memberType == 'P';\n\t\t\t\tcase SymbolKind.Event:\n\t\t\t\t\treturn memberType == 'E';\n\t\t\t\tcase SymbolKind.Method:\n\t\t\t\tcase SymbolKind.Operator:\n\t\t\t\tcase SymbolKind.Constructor:\n\t\t\t\tcase SymbolKind.Destructor:\n\t\t\t\t\treturn memberType == 'M';\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(member.SymbolKind.ToString());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ITypeReference DeclaringTypeReference {\n\t\t\tget { return declaringTypeReference; }\n\t\t}\n\t\t\n\t\tpublic IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIType declaringType = declaringTypeReference.Resolve(context);\n\t\t\tforeach (var member in declaringType.GetMembers(CanMatch, GetMemberOptions.IgnoreInheritedMembers)) {\n\t\t\t\tif (IdStringProvider.GetIdString(member) == memberIdString)\n\t\t\t\t\treturn member;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn Resolve(context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Documentation/IdStringProvider.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t/// <summary>\n\t/// Provides ID strings for entities. (C# 4.0 spec, §A.3.1)\n\t/// ID strings are used to identify members in XML documentation files.\n\t/// </summary>\n\tpublic static class IdStringProvider\n\t{\n\t\t#region GetIdString\n\t\t/// <summary>\n\t\t/// Gets the ID string (C# 4.0 spec, §A.3.1) for the specified entity.\n\t\t/// </summary>\n\t\tpublic static string GetIdString(this IEntity entity)\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tswitch (entity.SymbolKind) {\n\t\t\t\tcase SymbolKind.TypeDefinition:\n\t\t\t\t\tb.Append(\"T:\");\n\t\t\t\t\tAppendTypeName(b, (ITypeDefinition)entity, false);\n\t\t\t\t\treturn b.ToString();\n\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\tb.Append(\"F:\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase SymbolKind.Property:\n\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\t\tb.Append(\"P:\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase SymbolKind.Event:\n\t\t\t\t\tb.Append(\"E:\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tb.Append(\"M:\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tIMember member = (IMember)entity;\n\t\t\tAppendTypeName(b, member.DeclaringType, false);\n\t\t\tb.Append('.');\n\t\t\tif (member.IsExplicitInterfaceImplementation && member.Name.IndexOf('.') < 0 && member.ImplementedInterfaceMembers.Count == 1) {\n\t\t\t\tAppendTypeName(b, member.ImplementedInterfaceMembers[0].DeclaringType, true);\n\t\t\t\tb.Append('#');\n\t\t\t}\n\t\t\tb.Append(member.Name.Replace('.', '#'));\n\t\t\tIMethod method = member as IMethod;\n\t\t\tif (method != null && method.TypeParameters.Count > 0) {\n\t\t\t\tb.Append(\"``\");\n\t\t\t\tb.Append(method.TypeParameters.Count);\n\t\t\t}\n\t\t\tIParameterizedMember parameterizedMember = member as IParameterizedMember;\n\t\t\tif (parameterizedMember != null && parameterizedMember.Parameters.Count > 0) {\n\t\t\t\tb.Append('(');\n\t\t\t\tvar parameters = parameterizedMember.Parameters;\n\t\t\t\tfor (int i = 0; i < parameters.Count; i++) {\n\t\t\t\t\tif (i > 0) b.Append(',');\n\t\t\t\t\tAppendTypeName(b, parameters[i].Type, false);\n\t\t\t\t}\n\t\t\t\tb.Append(')');\n\t\t\t}\n\t\t\tif (member.SymbolKind == SymbolKind.Operator && (member.Name == \"op_Implicit\" || member.Name == \"op_Explicit\")) {\n\t\t\t\tb.Append('~');\n\t\t\t\tAppendTypeName(b, member.ReturnType, false);\n\t\t\t}\n\t\t\treturn b.ToString();\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetTypeName\n\t\tpublic static string GetTypeName(IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tAppendTypeName(b, type, false);\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tstatic void AppendTypeName(StringBuilder b, IType type, bool explicitInterfaceImpl)\n\t\t{\n\t\t\tswitch (type.Kind) {\n\t\t\t\tcase TypeKind.Dynamic:\n\t\t\t\t\tb.Append(explicitInterfaceImpl ? \"System#Object\" : \"System.Object\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeKind.TypeParameter:\n\t\t\t\t\tITypeParameter tp = (ITypeParameter)type;\n\t\t\t\t\tif (explicitInterfaceImpl) {\n\t\t\t\t\t\tb.Append(tp.Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tb.Append('`');\n\t\t\t\t\t\tif (tp.OwnerType == SymbolKind.Method)\n\t\t\t\t\t\t\tb.Append('`');\n\t\t\t\t\t\tb.Append(tp.Index);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeKind.Array:\n\t\t\t\t\tArrayType array = (ArrayType)type;\n\t\t\t\t\tAppendTypeName(b, array.ElementType, explicitInterfaceImpl);\n\t\t\t\t\tb.Append('[');\n\t\t\t\t\tif (array.Dimensions > 1) {\n\t\t\t\t\t\tfor (int i = 0; i < array.Dimensions; i++) {\n\t\t\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\t\t\tb.Append(explicitInterfaceImpl ? '@' : ',');\n\t\t\t\t\t\t\tif (!explicitInterfaceImpl)\n\t\t\t\t\t\t\t\tb.Append(\"0:\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tb.Append(']');\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeKind.Pointer:\n\t\t\t\t\tAppendTypeName(b, ((PointerType)type).ElementType, explicitInterfaceImpl);\n\t\t\t\t\tb.Append('*');\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeKind.ByReference:\n\t\t\t\t\tAppendTypeName(b, ((ByReferenceType)type).ElementType, explicitInterfaceImpl);\n\t\t\t\t\tb.Append('@');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tIType declType = type.DeclaringType;\n\t\t\t\t\tif (declType != null) {\n\t\t\t\t\t\tAppendTypeName(b, declType, explicitInterfaceImpl);\n\t\t\t\t\t\tb.Append(explicitInterfaceImpl ? '#' : '.');\n\t\t\t\t\t\tb.Append(type.Name);\n\t\t\t\t\t\tAppendTypeParameters(b, type, declType.TypeParameterCount, explicitInterfaceImpl);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (explicitInterfaceImpl)\n\t\t\t\t\t\t\tb.Append(type.FullName.Replace('.', '#'));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tb.Append(type.FullName);\n\t\t\t\t\t\tAppendTypeParameters(b, type, 0, explicitInterfaceImpl);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void AppendTypeParameters(StringBuilder b, IType type, int outerTypeParameterCount, bool explicitInterfaceImpl)\n\t\t{\n\t\t\tint tpc = type.TypeParameterCount - outerTypeParameterCount;\n\t\t\tif (tpc > 0) {\n\t\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\t\tif (pt != null) {\n\t\t\t\t\tb.Append('{');\n\t\t\t\t\tvar ta = pt.TypeArguments;\n\t\t\t\t\tfor (int i = outerTypeParameterCount; i < ta.Count; i++) {\n\t\t\t\t\t\tif (i > outerTypeParameterCount)\n\t\t\t\t\t\t\tb.Append(explicitInterfaceImpl ? '@' : ',');\n\t\t\t\t\t\tAppendTypeName(b, ta[i], explicitInterfaceImpl);\n\t\t\t\t\t}\n\t\t\t\t\tb.Append('}');\n\t\t\t\t} else {\n\t\t\t\t\tb.Append('`');\n\t\t\t\t\tb.Append(tpc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ParseMemberName\n\t\t/// <summary>\n\t\t/// Parse the ID string into a member reference.\n\t\t/// </summary>\n\t\t/// <param name=\"memberIdString\">The ID string representing the member (with \"M:\", \"F:\", \"P:\" or \"E:\" prefix).</param>\n\t\t/// <returns>A member reference that represents the ID string.</returns>\n\t\t/// <exception cref=\"ReflectionNameParseException\">The syntax of the ID string is invalid</exception>\n\t\t/// <remarks>\n\t\t/// The member reference will look in <see cref=\"ITypeResolveContext.CurrentAssembly\"/> first,\n\t\t/// and if the member is not found there,\n\t\t/// it will look in all other assemblies of the compilation.\n\t\t/// </remarks>\n\t\tpublic static IMemberReference ParseMemberIdString(string memberIdString)\n\t\t{\n\t\t\tif (memberIdString == null)\n\t\t\t\tthrow new ArgumentNullException(\"memberIdString\");\n\t\t\tif (memberIdString.Length < 2 || memberIdString[1] != ':')\n\t\t\t\tthrow new ReflectionNameParseException(0, \"Missing type tag\");\n\t\t\tchar typeChar = memberIdString[0];\n\t\t\tint parenPos = memberIdString.IndexOf('(');\n\t\t\tif (parenPos < 0)\n\t\t\t\tparenPos = memberIdString.LastIndexOf('~');\n\t\t\tif (parenPos < 0)\n\t\t\t\tparenPos = memberIdString.Length;\n\t\t\tint dotPos = memberIdString.LastIndexOf('.', parenPos - 1);\n\t\t\tif (dotPos < 0)\n\t\t\t\tthrow new ReflectionNameParseException(0, \"Could not find '.' separating type name from member name\");\n\t\t\tstring typeName = memberIdString.Substring(0, dotPos);\n\t\t\tint pos = 2;\n\t\t\tITypeReference typeReference = ParseTypeName(typeName, ref pos);\n\t\t\tif (pos != typeName.Length)\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected end of type name\");\n//\t\t\tstring memberName = memberIDString.Substring(dotPos + 1, parenPos - (dotPos + 1));\n//\t\t\tpos = memberName.LastIndexOf(\"``\");\n//\t\t\tif (pos > 0)\n//\t\t\t\tmemberName = memberName.Substring(0, pos);\n//\t\t\tmemberName = memberName.Replace('#', '.');\n\t\t\treturn new IdStringMemberReference(typeReference, typeChar, memberIdString);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ParseTypeName\n\t\t/// <summary>\n\t\t/// Parse the ID string type name into a type reference.\n\t\t/// </summary>\n\t\t/// <param name=\"typeName\">The ID string representing the type (the \"T:\" prefix is optional).</param>\n\t\t/// <returns>A type reference that represents the ID string.</returns>\n\t\t/// <exception cref=\"ReflectionNameParseException\">The syntax of the ID string is invalid</exception>\n\t\t/// <remarks>\n\t\t/// <para>\n\t\t/// The type reference will look in <see cref=\"ITypeResolveContext.CurrentAssembly\"/> first,\n\t\t/// and if the type is not found there,\n\t\t/// it will look in all other assemblies of the compilation.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// If the type is open (contains type parameters '`0' or '``0'),\n\t\t/// an <see cref=\"ITypeResolveContext\"/> with the appropriate CurrentTypeDefinition/CurrentMember is required\n\t\t/// to resolve the reference to the ITypeParameter.\n\t\t/// </para>\n\t\t/// </remarks>\n\t\tpublic static ITypeReference ParseTypeName(string typeName)\n\t\t{\n\t\t\tif (typeName == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeName\");\n\t\t\tint pos = 0;\n\t\t\tif (typeName.StartsWith(\"T:\", StringComparison.Ordinal))\n\t\t\t\tpos = 2;\n\t\t\tITypeReference r = ParseTypeName(typeName, ref pos);\n\t\t\tif (pos < typeName.Length)\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected end of type name\");\n\t\t\treturn r;\n\t\t}\n\t\t\n\t\tstatic bool IsIDStringSpecialCharacter(char c)\n\t\t{\n\t\t\tswitch (c) {\n\t\t\t\tcase ':':\n\t\t\t\tcase '{':\n\t\t\t\tcase '}':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '`':\n\t\t\t\tcase '*':\n\t\t\t\tcase '@':\n\t\t\t\tcase ',':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic ITypeReference ParseTypeName(string typeName, ref int pos)\n\t\t{\n\t\t\tstring reflectionTypeName = typeName;\n\t\t\tif (pos == typeName.Length)\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected end\");\n\t\t\tITypeReference result;\n\t\t\tif (reflectionTypeName[pos] == '`') {\n\t\t\t\t// type parameter reference\n\t\t\t\tpos++;\n\t\t\t\tif (pos == reflectionTypeName.Length)\n\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected end\");\n\t\t\t\tif (reflectionTypeName[pos] == '`') {\n\t\t\t\t\t// method type parameter reference\n\t\t\t\t\tpos++;\n\t\t\t\t\tint index = ReflectionHelper.ReadTypeParameterCount(reflectionTypeName, ref pos);\n\t\t\t\t\tresult = TypeParameterReference.Create(SymbolKind.Method, index);\n\t\t\t\t} else {\n\t\t\t\t\t// class type parameter reference\n\t\t\t\t\tint index = ReflectionHelper.ReadTypeParameterCount(reflectionTypeName, ref pos);\n\t\t\t\t\tresult = TypeParameterReference.Create(SymbolKind.TypeDefinition, index);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// not a type parameter reference: read the actual type name\n\t\t\t\tList<ITypeReference> typeArguments = new List<ITypeReference>();\n\t\t\t\tint typeParameterCount;\n\t\t\t\tstring typeNameWithoutSuffix = ReadTypeName(typeName, ref pos, true, out typeParameterCount, typeArguments);\n\t\t\t\tresult = new GetPotentiallyNestedClassTypeReference(typeNameWithoutSuffix, typeParameterCount);\n\t\t\t\twhile (pos < typeName.Length && typeName[pos] == '.') {\n\t\t\t\t\tpos++;\n\t\t\t\t\tstring nestedTypeName = ReadTypeName(typeName, ref pos, false, out typeParameterCount, typeArguments);\n\t\t\t\t\tresult = new NestedTypeReference(result, nestedTypeName, typeParameterCount);\n\t\t\t\t}\n\t\t\t\tif (typeArguments.Count > 0) {\n\t\t\t\t\tresult = new ParameterizedTypeReference(result, typeArguments);\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (pos < typeName.Length) {\n\t\t\t\tswitch (typeName[pos]) {\n\t\t\t\t\tcase '[':\n\t\t\t\t\t\tint dimensions = 1;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\tif (pos == typeName.Length)\n\t\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected end\");\n\t\t\t\t\t\t\tif (typeName[pos] == ',')\n\t\t\t\t\t\t\t\tdimensions++;\n\t\t\t\t\t\t} while (typeName[pos] != ']');\n\t\t\t\t\t\tresult = new ArrayTypeReference(result, dimensions);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\tresult = new PointerTypeReference(result);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '@':\n\t\t\t\t\t\tresult = new ByReferenceTypeReference(result);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tstatic string ReadTypeName(string typeName, ref int pos, bool allowDottedName, out int typeParameterCount, List<ITypeReference> typeArguments)\n\t\t{\n\t\t\tint startPos = pos;\n\t\t\t// skip the simple name portion:\n\t\t\twhile (pos < typeName.Length && !IsIDStringSpecialCharacter(typeName[pos]) && (allowDottedName || typeName[pos] != '.'))\n\t\t\t\tpos++;\n\t\t\tif (pos == startPos)\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected type name\");\n\t\t\tstring shortTypeName = typeName.Substring(startPos, pos - startPos);\n\t\t\t// read type arguments:\n\t\t\ttypeParameterCount = 0;\n\t\t\tif (pos < typeName.Length && typeName[pos] == '`') {\n\t\t\t\t// unbound generic type\n\t\t\t\tpos++;\n\t\t\t\ttypeParameterCount = ReflectionHelper.ReadTypeParameterCount(typeName, ref pos);\n\t\t\t} else if (pos < typeName.Length && typeName[pos] == '{') {\n\t\t\t\t// bound generic type\n\t\t\t\ttypeArguments = new List<ITypeReference>();\n\t\t\t\tdo {\n\t\t\t\t\tpos++;\n\t\t\t\t\ttypeArguments.Add(ParseTypeName(typeName, ref pos));\n\t\t\t\t\ttypeParameterCount++;\n\t\t\t\t\tif (pos == typeName.Length)\n\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected end\");\n\t\t\t\t} while (typeName[pos] == ',');\n\t\t\t\tif (typeName[pos] != '}')\n\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected '}'\");\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\treturn shortTypeName;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region FindEntity\n\t\t/// <summary>\n\t\t/// Finds the entity in the given type resolve context.\n\t\t/// </summary>\n\t\t/// <param name=\"idString\">ID string of the entity.</param>\n\t\t/// <param name=\"context\">Type resolve context</param>\n\t\t/// <returns>Returns the entity, or null if it is not found.</returns>\n\t\t/// <exception cref=\"ReflectionNameParseException\">The syntax of the ID string is invalid</exception>\n\t\tpublic static IEntity FindEntity(string idString, ITypeResolveContext context)\n\t\t{\n\t\t\tif (idString == null)\n\t\t\t\tthrow new ArgumentNullException(\"idString\");\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tif (idString.StartsWith(\"T:\", StringComparison.Ordinal)) {\n\t\t\t\treturn ParseTypeName(idString.Substring(2)).Resolve(context).GetDefinition();\n\t\t\t} else {\n\t\t\t\treturn ParseMemberIdString(idString).Resolve(context);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Documentation/XmlDocumentationProvider.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Xml;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t/// <summary>\n\t/// Provides documentation from an .xml file (as generated by the Microsoft C# compiler).\n\t/// </summary>\n\t/// <remarks>\n\t/// This class first creates an in-memory index of the .xml file, and then uses that to read only the requested members.\n\t/// This way, we avoid keeping all the documentation in memory.\n\t/// The .xml file is only opened when necessary, the file handle is not kept open all the time.\n\t/// If the .xml file is changed, the index will automatically be recreated.\n\t/// </remarks>\n\t[Serializable]\n\tpublic class XmlDocumentationProvider : IDocumentationProvider, IDeserializationCallback\n\t{\n\t\t#region Cache\n\t\tsealed class XmlDocumentationCache\n\t\t{\n\t\t\treadonly KeyValuePair<string, string>[] entries;\n\t\t\tint pos;\n\t\t\t\n\t\t\tpublic XmlDocumentationCache(int size = 50)\n\t\t\t{\n\t\t\t\tif (size <= 0)\n\t\t\t\t\tthrow new ArgumentOutOfRangeException(\"size\", size, \"Value must be positive\");\n\t\t\t\tthis.entries = new KeyValuePair<string, string>[size];\n\t\t\t}\n\t\t\t\n\t\t\tinternal bool TryGet(string key, out string value)\n\t\t\t{\n\t\t\t\tforeach (var pair in entries) {\n\t\t\t\t\tif (pair.Key == key) {\n\t\t\t\t\t\tvalue = pair.Value;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalue = null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tinternal void Add(string key, string value)\n\t\t\t{\n\t\t\t\tentries[pos++] = new KeyValuePair<string, string>(key, value);\n\t\t\t\tif (pos == entries.Length)\n\t\t\t\t\tpos = 0;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t[Serializable]\n\t\tstruct IndexEntry : IComparable<IndexEntry>\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Hash code of the documentation tag\n\t\t\t/// </summary>\n\t\t\tinternal readonly int HashCode;\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Position in the .xml file where the documentation starts\n\t\t\t/// </summary>\n\t\t\tinternal readonly int PositionInFile;\n\t\t\t\n\t\t\tinternal IndexEntry(int hashCode, int positionInFile)\n\t\t\t{\n\t\t\t\tthis.HashCode = hashCode;\n\t\t\t\tthis.PositionInFile = positionInFile;\n\t\t\t}\n\t\t\t\n\t\t\tpublic int CompareTo(IndexEntry other)\n\t\t\t{\n\t\t\t\treturn this.HashCode.CompareTo(other.HashCode);\n\t\t\t}\n\t\t}\n\t\t\n\t\t[NonSerialized]\n\t\tXmlDocumentationCache cache = new XmlDocumentationCache();\n\t\t\n\t\treadonly string fileName;\n\t\tvolatile IndexEntry[] index; // SORTED array of index entries\n\t\t\n\t\t#region Constructor / Redirection support\n\t\t/// <summary>\n\t\t/// Creates a new XmlDocumentationProvider.\n\t\t/// </summary>\n\t\t/// <param name=\"fileName\">Name of the .xml file.</param>\n\t\t/// <exception cref=\"IOException\">Error reading from XML file (or from redirected file)</exception>\n\t\t/// <exception cref=\"XmlException\">Invalid XML file</exception>\n\t\tpublic XmlDocumentationProvider(string fileName)\n\t\t{\n\t\t\tif (fileName == null)\n\t\t\t\tthrow new ArgumentNullException(\"fileName\");\n\t\t\t\n\t\t\tusing (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete)) {\n\t\t\t\tusing (XmlTextReader xmlReader = new XmlTextReader(fs)) {\n\t\t\t\t\txmlReader.XmlResolver = null; // no DTD resolving\n\t\t\t\t\txmlReader.MoveToContent();\n\t\t\t\t\tif (string.IsNullOrEmpty(xmlReader.GetAttribute(\"redirect\"))) {\n\t\t\t\t\t\tthis.fileName = fileName;\n\t\t\t\t\t\tReadXmlDoc(xmlReader);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstring redirectionTarget = GetRedirectionTarget(fileName, xmlReader.GetAttribute(\"redirect\"));\n\t\t\t\t\t\tif (redirectionTarget != null) {\n\t\t\t\t\t\t\tDebug.WriteLine(\"XmlDoc \" + fileName + \" is redirecting to \" + redirectionTarget);\n\t\t\t\t\t\t\tusing (FileStream redirectedFs = new FileStream(redirectionTarget, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete)) {\n\t\t\t\t\t\t\t\tusing (XmlTextReader redirectedXmlReader = new XmlTextReader(redirectedFs)) {\n\t\t\t\t\t\t\t\t\tredirectedXmlReader.XmlResolver = null; // no DTD resolving\n\t\t\t\t\t\t\t\t\tthis.fileName = redirectionTarget;\n\t\t\t\t\t\t\t\t\tReadXmlDoc(redirectedXmlReader);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new XmlException(\"XmlDoc \" + fileName + \" is redirecting to \" + xmlReader.GetAttribute(\"redirect\") + \", but that file was not found.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic string GetRedirectionTarget(string xmlFileName, string target)\n\t\t{\n\t\t\tstring programFilesDir = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);\n\t\t\tprogramFilesDir = AppendDirectorySeparator(programFilesDir);\n\t\t\t\n\t\t\tstring corSysDir = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();\n\t\t\tcorSysDir = AppendDirectorySeparator(corSysDir);\n\t\t\t\n\t\t\tvar fileName = target.Replace (\"%PROGRAMFILESDIR%\", programFilesDir)\n\t\t\t\t.Replace (\"%CORSYSDIR%\", corSysDir);\n\t\t\tif (!Path.IsPathRooted (fileName))\n\t\t\t\tfileName = Path.Combine (Path.GetDirectoryName (xmlFileName), fileName);\n\t\t\treturn LookupLocalizedXmlDoc(fileName);\n\t\t}\n\t\t\n\t\tstatic string AppendDirectorySeparator(string dir)\n\t\t{\n\t\t\tif (dir.EndsWith(\"\\\\\", StringComparison.Ordinal) || dir.EndsWith(\"/\", StringComparison.Ordinal))\n\t\t\t\treturn dir;\n\t\t\telse\n\t\t\t\treturn dir + Path.DirectorySeparatorChar;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Given the assembly file name, looks up the XML documentation file name.\n\t\t/// Returns null if no XML documentation file is found.\n\t\t/// </summary>\n\t\tpublic static string LookupLocalizedXmlDoc(string fileName)\n\t\t{\n\t\t\tstring xmlFileName = Path.ChangeExtension(fileName, \".xml\");\n\t\t\tstring currentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName;\n\t\t\tstring localizedXmlDocFile = GetLocalizedName(xmlFileName, currentCulture);\n\t\t\t\n\t\t\tDebug.WriteLine(\"Try find XMLDoc @\" + localizedXmlDocFile);\n\t\t\tif (File.Exists(localizedXmlDocFile)) {\n\t\t\t\treturn localizedXmlDocFile;\n\t\t\t}\n\t\t\tDebug.WriteLine(\"Try find XMLDoc @\" + xmlFileName);\n\t\t\tif (File.Exists(xmlFileName)) {\n\t\t\t\treturn xmlFileName;\n\t\t\t}\n\t\t\tif (currentCulture != \"en\") {\n\t\t\t\tstring englishXmlDocFile = GetLocalizedName(xmlFileName, \"en\");\n\t\t\t\tDebug.WriteLine(\"Try find XMLDoc @\" + englishXmlDocFile);\n\t\t\t\tif (File.Exists(englishXmlDocFile)) {\n\t\t\t\t\treturn englishXmlDocFile;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tstatic string GetLocalizedName(string fileName, string language)\n\t\t{\n\t\t\tstring localizedXmlDocFile = Path.GetDirectoryName(fileName);\n\t\t\tlocalizedXmlDocFile = Path.Combine(localizedXmlDocFile, language);\n\t\t\tlocalizedXmlDocFile = Path.Combine(localizedXmlDocFile, Path.GetFileName(fileName));\n\t\t\treturn localizedXmlDocFile;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Load / Create Index\n\t\tvoid ReadXmlDoc(XmlTextReader reader)\n\t\t{\n\t\t\t//lastWriteDate = File.GetLastWriteTimeUtc(fileName);\n\t\t\t// Open up a second file stream for the line<->position mapping\n\t\t\tusing (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete)) {\n\t\t\t\tLinePositionMapper linePosMapper = new LinePositionMapper(fs);\n\t\t\t\tList<IndexEntry> indexList = new List<IndexEntry>();\n\t\t\t\twhile (reader.Read()) {\n\t\t\t\t\tif (reader.IsStartElement()) {\n\t\t\t\t\t\tswitch (reader.LocalName) {\n\t\t\t\t\t\t\tcase \"members\":\n\t\t\t\t\t\t\t\tReadMembersSection(reader, linePosMapper, indexList);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindexList.Sort();\n\t\t\t\tthis.index = indexList.ToArray(); // volatile write\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class LinePositionMapper\n\t\t{\n\t\t\treadonly FileStream fs;\n\t\t\tint currentLine = 1;\n\t\t\t\n\t\t\tpublic LinePositionMapper(FileStream fs)\n\t\t\t{\n\t\t\t\tthis.fs = fs;\n\t\t\t}\n\t\t\t\n\t\t\tpublic int GetPositionForLine(int line)\n\t\t\t{\n\t\t\t\tDebug.Assert(line >= currentLine);\n\t\t\t\twhile (line > currentLine) {\n\t\t\t\t\tint b = fs.ReadByte();\n\t\t\t\t\tif (b < 0)\n\t\t\t\t\t\tthrow new EndOfStreamException();\n\t\t\t\t\tif (b == '\\n') {\n\t\t\t\t\t\tcurrentLine++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn checked((int)fs.Position);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void ReadMembersSection(XmlTextReader reader, LinePositionMapper linePosMapper, List<IndexEntry> indexList)\n\t\t{\n\t\t\twhile (reader.Read()) {\n\t\t\t\tswitch (reader.NodeType) {\n\t\t\t\t\tcase XmlNodeType.EndElement:\n\t\t\t\t\t\tif (reader.LocalName == \"members\") {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase XmlNodeType.Element:\n\t\t\t\t\t\tif (reader.LocalName == \"member\") {\n\t\t\t\t\t\t\tint pos = linePosMapper.GetPositionForLine(reader.LineNumber) + Math.Max(reader.LinePosition - 2, 0);\n\t\t\t\t\t\t\tstring memberAttr = reader.GetAttribute(\"name\");\n\t\t\t\t\t\t\tif (memberAttr != null)\n\t\t\t\t\t\t\t\tindexList.Add(new IndexEntry(GetHashCode(memberAttr), pos));\n\t\t\t\t\t\t\treader.Skip();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Hash algorithm used for the index.\n\t\t/// This is a custom implementation so that old index files work correctly\n\t\t/// even when the .NET string.GetHashCode implementation changes\n\t\t/// (e.g. due to .NET 4.5 hash randomization)\n\t\t/// </summary>\n\t\tstatic int GetHashCode(string key)\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint h = 0;\n\t\t\t\tforeach (char c in key) {\n\t\t\t\t\th = (h << 5) - h + c;\n\t\t\t\t}\n\t\t\t\treturn h;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetDocumentation\n\t\t/// <summary>\n\t\t/// Get the documentation for the member with the specified documentation key.\n\t\t/// </summary>\n\t\tpublic string GetDocumentation(string key)\n\t\t{\n\t\t\tif (key == null)\n\t\t\t\tthrow new ArgumentNullException(\"key\");\n\t\t\treturn GetDocumentation(key, true);\n\t\t}\n\t\t\n\t\tstring GetDocumentation(string key, bool allowReload)\n\t\t{\n\t\t\tint hashcode = GetHashCode(key);\n\t\t\tvar index = this.index; // read volatile field\n\t\t\t// index is sorted, so we can use binary search\n\t\t\tint m = Array.BinarySearch(index, new IndexEntry(hashcode, 0));\n\t\t\tif (m < 0)\n\t\t\t\treturn null;\n\t\t\t// correct hash code found.\n\t\t\t// possibly there are multiple items with the same hash, so go to the first.\n\t\t\twhile (--m >= 0 && index[m].HashCode == hashcode);\n\t\t\t// m is now 1 before the first item with the correct hash\n\t\t\t\n\t\t\tXmlDocumentationCache cache = this.cache;\n\t\t\tlock (cache) {\n\t\t\t\tstring val;\n\t\t\t\tif (!cache.TryGet(key, out val)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// go through all items that have the correct hash\n\t\t\t\t\t\twhile (++m < index.Length && index[m].HashCode == hashcode) {\n\t\t\t\t\t\t\tval = LoadDocumentation(key, index[m].PositionInFile);\n\t\t\t\t\t\t\tif (val != null)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// cache the result (even if it is null)\n\t\t\t\t\t\tcache.Add(key, val);\n\t\t\t\t\t} catch (IOException) {\n\t\t\t\t\t\t// may happen if the documentation file was deleted/is inaccessible/changed (EndOfStreamException)\n\t\t\t\t\t\treturn allowReload ? ReloadAndGetDocumentation(key) : null;\n\t\t\t\t\t} catch (XmlException) {\n\t\t\t\t\t\t// may happen if the documentation file was changed so that the file position no longer starts on a valid XML element\n\t\t\t\t\t\treturn allowReload ? ReloadAndGetDocumentation(key) : null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn val;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstring ReloadAndGetDocumentation(string key)\n\t\t{\n\t\t\ttry {\n\t\t\t\t// Reload the index\n\t\t\t\tusing (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete)) {\n\t\t\t\t\tusing (XmlTextReader xmlReader = new XmlTextReader(fs)) {\n\t\t\t\t\t\txmlReader.XmlResolver = null; // no DTD resolving\n\t\t\t\t\t\txmlReader.MoveToContent();\n\t\t\t\t\t\tReadXmlDoc(xmlReader);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException) {\n\t\t\t\t// Ignore errors on reload; IEntity.Documentation callers aren't prepared to handle exceptions\n\t\t\t\tthis.index = new IndexEntry[0]; // clear index to avoid future load attempts\n\t\t\t\treturn null;\n\t\t\t} catch (XmlException) {\n\t\t\t\tthis.index = new IndexEntry[0]; // clear index to avoid future load attempts\n\t\t\t\treturn null;\t\t\t\t\n\t\t\t}\n\t\t\treturn GetDocumentation(key, allowReload: false); // prevent infinite reload loops\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetDocumentation for entity\n\t\t/// <inheritdoc/>\n\t\tpublic DocumentationComment GetDocumentation(IEntity entity)\n\t\t{\n\t\t\tstring xmlDoc = GetDocumentation(IdStringProvider.GetIdString(entity));\n\t\t\tif (xmlDoc != null) {\n\t\t\t\treturn new DocumentationComment(new StringTextSource(xmlDoc), new SimpleTypeResolveContext(entity));\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Load / Read XML\n\t\tstring LoadDocumentation(string key, int positionInFile)\n\t\t{\n\t\t\tusing (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete)) {\n\t\t\t\tfs.Position = positionInFile;\n\t\t\t\tusing (XmlTextReader r = new XmlTextReader(fs, XmlNodeType.Element, null)) {\n\t\t\t\t\tr.XmlResolver = null; // no DTD resolving\n\t\t\t\t\twhile (r.Read()) {\n\t\t\t\t\t\tif (r.NodeType == XmlNodeType.Element) {\n\t\t\t\t\t\t\tstring memberAttr = r.GetAttribute(\"name\");\n\t\t\t\t\t\t\tif (memberAttr == key) {\n\t\t\t\t\t\t\t\treturn r.ReadInnerXml();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic virtual void OnDeserialization(object sender)\n\t\t{\n\t\t\tcache = new XmlDocumentationCache();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/IDocument.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// A document representing a source code file for refactoring.\n\t/// Line and column counting starts at 1.\n\t/// Offset counting starts at 0.\n\t/// </summary>\n\tpublic interface IDocument : ITextSource, IServiceProvider\n\t{\n\t\t/// <summary>\n\t\t/// Creates an immutable snapshot of this document.\n\t\t/// </summary>\n\t\tIDocument CreateDocumentSnapshot();\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the text of the whole document..\n\t\t/// </summary>\n\t\tnew string Text { get; set; } // hides ITextSource.Text to add the setter\n\t\t\n\t\t/// <summary>\n\t\t/// This event is called directly before a change is applied to the document.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// It is invalid to modify the document within this event handler.\n\t\t/// Aborting the change (by throwing an exception) is likely to cause corruption of data structures\n\t\t/// that listen to the Changing and Changed events.\n\t\t/// </remarks>\n\t\tevent EventHandler<TextChangeEventArgs> TextChanging;\n\t\t\n\t\t/// <summary>\n\t\t/// This event is called directly after a change is applied to the document.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// It is invalid to modify the document within this event handler.\n\t\t/// Aborting the event handler (by throwing an exception) is likely to cause corruption of data structures\n\t\t/// that listen to the Changing and Changed events.\n\t\t/// </remarks>\n\t\tevent EventHandler<TextChangeEventArgs> TextChanged;\n\t\t\n\t\t/// <summary>\n\t\t/// This event is called after a group of changes is completed.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"EndUndoableAction\"/>\n\t\tevent EventHandler ChangeCompleted;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the number of lines in the document.\n\t\t/// </summary>\n\t\tint LineCount { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the document line with the specified number.\n\t\t/// </summary>\n\t\t/// <param name=\"lineNumber\">The number of the line to retrieve. The first line has number 1.</param>\n\t\tIDocumentLine GetLineByNumber(int lineNumber);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the document line that contains the specified offset.\n\t\t/// </summary>\n\t\tIDocumentLine GetLineByOffset(int offset);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the offset from a text location.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"GetLocation\"/>\n\t\tint GetOffset(int line, int column);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the offset from a text location.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"GetLocation\"/>\n\t\tint GetOffset(TextLocation location);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the location from an offset.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"GetOffset(TextLocation)\"/>\n\t\tTextLocation GetLocation(int offset);\n\t\t\n\t\t/// <summary>\n\t\t/// Inserts text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">The offset at which the text is inserted.</param>\n\t\t/// <param name=\"text\">The new text.</param>\n\t\t/// <remarks>\n\t\t/// Anchors positioned exactly at the insertion offset will move according to their movement type.\n\t\t/// For AnchorMovementType.Default, they will move behind the inserted text.\n\t\t/// The caret will also move behind the inserted text.\n\t\t/// </remarks>\n\t\tvoid Insert(int offset, string text);\n\t\t\n\t\t/// <summary>\n\t\t/// Inserts text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">The offset at which the text is inserted.</param>\n\t\t/// <param name=\"text\">The new text.</param>\n\t\t/// <remarks>\n\t\t/// Anchors positioned exactly at the insertion offset will move according to their movement type.\n\t\t/// For AnchorMovementType.Default, they will move behind the inserted text.\n\t\t/// The caret will also move behind the inserted text.\n\t\t/// </remarks>\n\t\tvoid Insert(int offset, ITextSource text);\n\t\t\n\t\t/// <summary>\n\t\t/// Inserts text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">The offset at which the text is inserted.</param>\n\t\t/// <param name=\"text\">The new text.</param>\n\t\t/// <param name=\"defaultAnchorMovementType\">\n\t\t/// Anchors positioned exactly at the insertion offset will move according to the anchor's movement type.\n\t\t/// For AnchorMovementType.Default, they will move according to the movement type specified by this parameter.\n\t\t/// The caret will also move according to the <paramref name=\"defaultAnchorMovementType\"/> parameter.\n\t\t/// </param>\n\t\tvoid Insert(int offset, string text, AnchorMovementType defaultAnchorMovementType);\n\t\t\n\t\t/// <summary>\n\t\t/// Inserts text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">The offset at which the text is inserted.</param>\n\t\t/// <param name=\"text\">The new text.</param>\n\t\t/// <param name=\"defaultAnchorMovementType\">\n\t\t/// Anchors positioned exactly at the insertion offset will move according to the anchor's movement type.\n\t\t/// For AnchorMovementType.Default, they will move according to the movement type specified by this parameter.\n\t\t/// The caret will also move according to the <paramref name=\"defaultAnchorMovementType\"/> parameter.\n\t\t/// </param>\n\t\tvoid Insert(int offset, ITextSource text, AnchorMovementType defaultAnchorMovementType);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">Starting offset of the text to be removed.</param>\n\t\t/// <param name=\"length\">Length of the text to be removed.</param>\n\t\tvoid Remove(int offset, int length);\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">The starting offset of the text to be replaced.</param>\n\t\t/// <param name=\"length\">The length of the text to be replaced.</param>\n\t\t/// <param name=\"newText\">The new text.</param>\n\t\tvoid Replace(int offset, int length, string newText);\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">The starting offset of the text to be replaced.</param>\n\t\t/// <param name=\"length\">The length of the text to be replaced.</param>\n\t\t/// <param name=\"newText\">The new text.</param>\n\t\tvoid Replace(int offset, int length, ITextSource newText);\n\t\t\n\t\t/// <summary>\n\t\t/// Make the document combine the following actions into a single\n\t\t/// action for undo purposes.\n\t\t/// </summary>\n\t\tvoid StartUndoableAction();\n\t\t\n\t\t/// <summary>\n\t\t/// Ends the undoable action started with <see cref=\"StartUndoableAction\"/>.\n\t\t/// </summary>\n\t\tvoid EndUndoableAction();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an undo group. Dispose the returned value to close the undo group.\n\t\t/// </summary>\n\t\t/// <returns>An object that closes the undo group when Dispose() is called.</returns>\n\t\tIDisposable OpenUndoGroup();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new <see cref=\"ITextAnchor\"/> at the specified offset.\n\t\t/// </summary>\n\t\t/// <inheritdoc cref=\"ITextAnchor\" select=\"remarks|example\"/>\n\t\tITextAnchor CreateAnchor(int offset);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name of the file the document is stored in.\n\t\t/// Could also be a non-existent dummy file name or null if no name has been set.\n\t\t/// </summary>\n\t\tstring FileName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Fired when the file name of the document changes.\n\t\t/// </summary>\n\t\tevent EventHandler FileNameChanged;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// A line inside a <see cref=\"IDocument\"/>.\n\t/// </summary>\n\tpublic interface IDocumentLine : ISegment\n\t{\n\t\t/// <summary>\n\t\t/// Gets the length of this line, including the line delimiter.\n\t\t/// </summary>\n\t\tint TotalLength { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the length of the line terminator.\n\t\t/// Returns 1 or 2; or 0 at the end of the document.\n\t\t/// </summary>\n\t\tint DelimiterLength { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the number of this line.\n\t\t/// The first line has the number 1.\n\t\t/// </summary>\n\t\tint LineNumber { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the previous line. Returns null if this is the first line in the document.\n\t\t/// </summary>\n\t\tIDocumentLine PreviousLine { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the next line. Returns null if this is the last line in the document.\n\t\t/// </summary>\n\t\tIDocumentLine NextLine { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the line was deleted.\n\t\t/// </summary>\n\t\tbool IsDeleted { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/ISegment.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// An (Offset,Length)-pair.\n\t/// </summary>\n\tpublic interface ISegment\n\t{\n\t\t/// <summary>\n\t\t/// Gets the start offset of the segment.\n\t\t/// </summary>\n\t\tint Offset { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the length of the segment.\n\t\t/// </summary>\n\t\t/// <remarks>For line segments (IDocumentLine), the length does not include the line delimeter.</remarks>\n\t\tint Length { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the end offset of the segment.\n\t\t/// </summary>\n\t\t/// <remarks>EndOffset = Offset + Length;</remarks>\n\t\tint EndOffset { get; }\n\t}\n\t\n\t/// <summary>\n\t/// Extension methods for <see cref=\"ISegment\"/>.\n\t/// </summary>\n\tpublic static class ISegmentExtensions\n\t{\n\t\t/// <summary>\n\t\t/// Gets whether <paramref name=\"segment\"/> fully contains the specified segment.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Use <c>segment.Contains(offset, 0)</c> to detect whether a segment (end inclusive) contains offset;\n\t\t/// use <c>segment.Contains(offset, 1)</c> to detect whether a segment (end exclusive) contains offset.\n\t\t/// </remarks>\n\t\tpublic static bool Contains (this ISegment segment, int offset, int length)\n\t\t{\n\t\t\treturn segment.Offset <= offset && offset + length <= segment.EndOffset;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether <paramref name=\"thisSegment\"/> fully contains the specified segment.\n\t\t/// </summary>\n\t\tpublic static bool Contains (this ISegment thisSegment, ISegment segment)\n\t\t{\n\t\t\treturn segment != null && thisSegment.Offset <= segment.Offset && segment.EndOffset <= thisSegment.EndOffset;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/ITextAnchor.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// The TextAnchor class references an offset (a position between two characters).\n\t/// It automatically updates the offset when text is inserted/removed in front of the anchor.\n\t/// </summary>\n\t/// <remarks>\n\t/// <para>Use the <see cref=\"ITextAnchor.Offset\"/> property to get the offset from a text anchor.\n\t/// Use the <see cref=\"IDocument.CreateAnchor\"/> method to create an anchor from an offset.\n\t/// </para>\n\t/// <para>\n\t/// The document will automatically update all text anchors; and because it uses weak references to do so,\n\t/// the garbage collector can simply collect the anchor object when you don't need it anymore.\n\t/// </para>\n\t/// <para>Moreover, the document is able to efficiently update a large number of anchors without having to look\n\t/// at each anchor object individually. Updating the offsets of all anchors usually only takes time logarithmic\n\t/// to the number of anchors. Retrieving the <see cref=\"ITextAnchor.Offset\"/> property also runs in O(lg N).</para>\n\t/// </remarks>\n\t/// <example>\n\t/// Usage:\n\t/// <code>TextAnchor anchor = document.CreateAnchor(offset);\n\t/// ChangeMyDocument();\n\t/// int newOffset = anchor.Offset;\n\t/// </code>\n\t/// </example>\n\tpublic interface ITextAnchor\n\t{\n\t\t/// <summary>\n\t\t/// Gets the text location of this anchor.\n\t\t/// </summary>\n\t\t/// <exception cref=\"InvalidOperationException\">Thrown when trying to get the Offset from a deleted anchor.</exception>\n\t\tTextLocation Location { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the offset of the text anchor.\n\t\t/// </summary>\n\t\t/// <exception cref=\"InvalidOperationException\">Thrown when trying to get the Offset from a deleted anchor.</exception>\n\t\tint Offset { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls how the anchor moves.\n\t\t/// </summary>\n\t\t/// <remarks>Anchor movement is ambiguous if text is inserted exactly at the anchor's location.\n\t\t/// Does the anchor stay before the inserted text, or does it move after it?\n\t\t/// The property <see cref=\"MovementType\"/> will be used to determine which of these two options the anchor will choose.\n\t\t/// The default value is <see cref=\"AnchorMovementType.Default\"/>.</remarks>\n\t\tAnchorMovementType MovementType { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// <para>\n\t\t/// Specifies whether the anchor survives deletion of the text containing it.\n\t\t/// </para><para>\n\t\t/// <c>false</c>: The anchor is deleted when the a selection that includes the anchor is deleted.\n\t\t/// <c>true</c>: The anchor is not deleted.\n\t\t/// </para>\n\t\t/// </summary>\n\t\t/// <remarks><inheritdoc cref=\"IsDeleted\" /></remarks>\n\t\tbool SurviveDeletion { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the anchor was deleted.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// <para>When a piece of text containing an anchor is removed, then that anchor will be deleted.\n\t\t/// First, the <see cref=\"IsDeleted\"/> property is set to true on all deleted anchors,\n\t\t/// then the <see cref=\"Deleted\"/> events are raised.\n\t\t/// You cannot retrieve the offset from an anchor that has been deleted.</para>\n\t\t/// <para>This deletion behavior might be useful when using anchors for building a bookmark feature,\n\t\t/// but in other cases you want to still be able to use the anchor. For those cases, set <c><see cref=\"SurviveDeletion\"/> = true</c>.</para>\n\t\t/// </remarks>\n\t\tbool IsDeleted { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Occurs after the anchor was deleted.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// <inheritdoc cref=\"IsDeleted\" />\n\t\t/// <para>Due to the 'weak reference' nature of text anchors, you will receive\n\t\t/// the Deleted event only while your code holds a reference to the TextAnchor object.\n\t\t/// </para>\n\t\t/// </remarks>\n\t\tevent EventHandler Deleted;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the line number of the anchor.\n\t\t/// </summary>\n\t\t/// <exception cref=\"InvalidOperationException\">Thrown when trying to get the Offset from a deleted anchor.</exception>\n\t\tint Line { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the column number of this anchor.\n\t\t/// </summary>\n\t\t/// <exception cref=\"InvalidOperationException\">Thrown when trying to get the Offset from a deleted anchor.</exception>\n\t\tint Column { get; }\n\t}\n\t\n\t/// <summary>\n\t/// Defines how a text anchor moves.\n\t/// </summary>\n\tpublic enum AnchorMovementType\n\t{\n\t\t/// <summary>\n\t\t/// When text is inserted at the anchor position, the type of the insertion\n\t\t/// determines where the caret moves to. For normal insertions, the anchor will move\n\t\t/// after the inserted text.\n\t\t/// </summary>\n\t\tDefault,\n\t\t/// <summary>\n\t\t/// Behaves like a start marker - when text is inserted at the anchor position, the anchor will stay\n\t\t/// before the inserted text.\n\t\t/// </summary>\n\t\tBeforeInsertion,\n\t\t/// <summary>\n\t\t/// Behave like an end marker - when text is insered at the anchor position, the anchor will move\n\t\t/// after the inserted text.\n\t\t/// </summary>\n\t\tAfterInsertion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/ITextPasteHandler.cs",
    "content": "﻿// ITextPasteHandler.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (c) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// The text paste handler can do formattings to a text that is about to be pasted\n\t/// into the text document.\n\t/// </summary>\n\tpublic interface ITextPasteHandler\n\t{\n\t\t/// <summary>\n\t\t/// Formats plain text that is inserted at a specified offset.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The text that will get inserted at that position.\n\t\t/// </returns>\n\t\t/// <param name=\"offset\">The offset where the text will be inserted.</param>\n\t\t/// <param name=\"text\">The text to be inserted.</param>\n\t\t/// <param name=\"copyData\">Additional data in case the text was copied from a Mono.TextEditor.</param>\n\t\tstring FormatPlainText(int offset, string text, byte[] copyData);\n\n\t\t/// <summary>\n\t\t/// Gets the copy data for a specific segment inside the document. This can contain additional information.\n\t\t/// </summary>\n\t\t/// <param name=\"segment\">The text segment that is about to be copied.</param>\n\t\tbyte[] GetCopyData(ISegment segment);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/ITextSource.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// A read-only view on a (potentially mutable) text source.\n\t/// The IDocument interface derives from this interface.\n\t/// </summary>\n\tpublic interface ITextSource\n\t{\n\t\t/// <summary>\n\t\t/// Gets a version identifier for this text source.\n\t\t/// Returns null for unversioned text sources.\n\t\t/// </summary>\n\t\tITextSourceVersion Version { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an immutable snapshot of this text source.\n\t\t/// Unlike all other methods in this interface, this method is thread-safe.\n\t\t/// </summary>\n\t\tITextSource CreateSnapshot();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an immutable snapshot of a part of this text source.\n\t\t/// Unlike all other methods in this interface, this method is thread-safe.\n\t\t/// </summary>\n\t\tITextSource CreateSnapshot(int offset, int length);\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new TextReader to read from this text source.\n\t\t/// </summary>\n\t\tTextReader CreateReader();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new TextReader to read from this text source.\n\t\t/// </summary>\n\t\tTextReader CreateReader(int offset, int length);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the total text length.\n\t\t/// </summary>\n\t\t/// <returns>The length of the text, in characters.</returns>\n\t\t/// <remarks>This is the same as Text.Length, but is more efficient because\n\t\t///  it doesn't require creating a String object.</remarks>\n\t\tint TextLength { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the whole text as string.\n\t\t/// </summary>\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1721:PropertyNamesShouldNotMatchGetMethods\")]\n\t\tstring Text { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a character at the specified position in the document.\n\t\t/// </summary>\n\t\t/// <paramref name=\"offset\">The index of the character to get.</paramref>\n\t\t/// <exception cref=\"ArgumentOutOfRangeException\">Offset is outside the valid range (0 to TextLength-1).</exception>\n\t\t/// <returns>The character at the specified position.</returns>\n\t\t/// <remarks>This is the same as Text[offset], but is more efficient because\n\t\t///  it doesn't require creating a String object.</remarks>\n\t\tchar GetCharAt(int offset);\n\t\t\n\t\t/// <summary>\n\t\t/// Retrieves the text for a portion of the document.\n\t\t/// </summary>\n\t\t/// <exception cref=\"ArgumentOutOfRangeException\">offset or length is outside the valid range.</exception>\n\t\t/// <remarks>This is the same as Text.Substring, but is more efficient because\n\t\t///  it doesn't require creating a String object for the whole document.</remarks>\n\t\tstring GetText(int offset, int length);\n\t\t\n\t\t/// <summary>\n\t\t/// Retrieves the text for a portion of the document.\n\t\t/// </summary>\n\t\t/// <exception cref=\"ArgumentOutOfRangeException\">offset or length is outside the valid range.</exception>\n\t\tstring GetText(ISegment segment);\n\t\t\n\t\t/// <summary>\n\t\t/// Writes the text from this document into the TextWriter.\n\t\t/// </summary>\n\t\tvoid WriteTextTo(TextWriter writer);\n\t\t\n\t\t/// <summary>\n\t\t/// Writes the text from this document into the TextWriter.\n\t\t/// </summary>\n\t\tvoid WriteTextTo(TextWriter writer, int offset, int length);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the index of the first occurrence of the character in the specified array.\n\t\t/// </summary>\n\t\t/// <param name=\"c\">Character to search for</param>\n\t\t/// <param name=\"startIndex\">Start index of the area to search.</param>\n\t\t/// <param name=\"count\">Length of the area to search.</param>\n\t\t/// <returns>The first index where the character was found; or -1 if no occurrence was found.</returns>\n\t\tint IndexOf(char c, int startIndex, int count);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the index of the first occurrence of any character in the specified array.\n\t\t/// </summary>\n\t\t/// <param name=\"anyOf\">Characters to search for</param>\n\t\t/// <param name=\"startIndex\">Start index of the area to search.</param>\n\t\t/// <param name=\"count\">Length of the area to search.</param>\n\t\t/// <returns>The first index where any character was found; or -1 if no occurrence was found.</returns>\n\t\tint IndexOfAny(char[] anyOf, int startIndex, int count);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the index of the first occurrence of the specified search text in this text source.\n\t\t/// </summary>\n\t\t/// <param name=\"searchText\">The search text</param>\n\t\t/// <param name=\"startIndex\">Start index of the area to search.</param>\n\t\t/// <param name=\"count\">Length of the area to search.</param>\n\t\t/// <param name=\"comparisonType\">String comparison to use.</param>\n\t\t/// <returns>The first index where the search term was found; or -1 if no occurrence was found.</returns>\n\t\tint IndexOf(string searchText, int startIndex, int count, StringComparison comparisonType);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the index of the last occurrence of the specified character in this text source.\n\t\t/// </summary>\n\t\t/// <param name=\"c\">The search character</param>\n\t\t/// <param name=\"startIndex\">Start index of the area to search.</param>\n\t\t/// <param name=\"count\">Length of the area to search.</param>\n\t\t/// <returns>The last index where the search term was found; or -1 if no occurrence was found.</returns>\n\t\t/// <remarks>The search proceeds backwards from (startIndex+count) to startIndex.\n\t\t/// This is different than the meaning of the parameters on string.LastIndexOf!</remarks>\n\t\tint LastIndexOf(char c, int startIndex, int count);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the index of the last occurrence of the specified search text in this text source.\n\t\t/// </summary>\n\t\t/// <param name=\"searchText\">The search text</param>\n\t\t/// <param name=\"startIndex\">Start index of the area to search.</param>\n\t\t/// <param name=\"count\">Length of the area to search.</param>\n\t\t/// <param name=\"comparisonType\">String comparison to use.</param>\n\t\t/// <returns>The last index where the search term was found; or -1 if no occurrence was found.</returns>\n\t\t/// <remarks>The search proceeds backwards from (startIndex+count) to startIndex.\n\t\t/// This is different than the meaning of the parameters on string.LastIndexOf!</remarks>\n\t\tint LastIndexOf(string searchText, int startIndex, int count, StringComparison comparisonType);\n\t\t\n\t\t/* What about:\n\t\tvoid Insert (int offset, string value);\n\t\tvoid Remove (int offset, int count);\n\t\tvoid Remove (ISegment segment);\n\t\t\n\t\tvoid Replace (int offset, int count, string value);\n\t\t\n\t\tOr more search operations:\n\t\t\n\t\tIEnumerable<int> SearchForward (string pattern, int startIndex);\n\t\tIEnumerable<int> SearchForwardIgnoreCase (string pattern, int startIndex);\n\t\t\n\t\tIEnumerable<int> SearchBackward (string pattern, int startIndex);\n\t\tIEnumerable<int> SearchBackwardIgnoreCase (string pattern, int startIndex);\n\t\t */\n\t}\n\t\n\t/// <summary>\n\t/// Represents a version identifier for a text source.\n\t/// </summary>\n\t/// <remarks>\n\t/// Verions can be used to efficiently detect whether a document has changed and needs reparsing;\n\t/// or even to implement incremental parsers.\n\t/// It is a separate class from ITextSource to allow the GC to collect the text source while\n\t/// the version checkpoint is still in use.\n\t/// </remarks>\n\tpublic interface ITextSourceVersion\n\t{\n\t\t/// <summary>\n\t\t/// Gets whether this checkpoint belongs to the same document as the other checkpoint.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Returns false when given <c>null</c>.\n\t\t/// </remarks>\n\t\tbool BelongsToSameDocumentAs(ITextSourceVersion other);\n\t\t\n\t\t/// <summary>\n\t\t/// Compares the age of this checkpoint to the other checkpoint.\n\t\t/// </summary>\n\t\t/// <remarks>This method is thread-safe.</remarks>\n\t\t/// <exception cref=\"ArgumentException\">Raised if 'other' belongs to a different document than this version.</exception>\n\t\t/// <returns>-1 if this version is older than <paramref name=\"other\"/>.\n\t\t/// 0 if <c>this</c> version instance represents the same version as <paramref name=\"other\"/>.\n\t\t/// 1 if this version is newer than <paramref name=\"other\"/>.</returns>\n\t\tint CompareAge(ITextSourceVersion other);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the changes from this checkpoint to the other checkpoint.\n\t\t/// If 'other' is older than this checkpoint, reverse changes are calculated.\n\t\t/// </summary>\n\t\t/// <remarks>This method is thread-safe.</remarks>\n\t\t/// <exception cref=\"ArgumentException\">Raised if 'other' belongs to a different document than this checkpoint.</exception>\n\t\tIEnumerable<TextChangeEventArgs> GetChangesTo(ITextSourceVersion other);\n\t\t\n\t\t/// <summary>\n\t\t/// Calculates where the offset has moved in the other buffer version.\n\t\t/// </summary>\n\t\t/// <exception cref=\"ArgumentException\">Raised if 'other' belongs to a different document than this checkpoint.</exception>\n\t\tint MoveOffsetTo(ITextSourceVersion other, int oldOffset, AnchorMovementType movement = AnchorMovementType.Default);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// Read-only implementation of <see cref=\"IDocument\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class ReadOnlyDocument : IDocument\n\t{\n\t\treadonly ITextSource textSource;\n\t\treadonly string fileName;\n\t\tint[] lines;\n\t\t\n\t\tstatic readonly char[] newline = { '\\r', '\\n' };\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new ReadOnlyDocument from the given text source.\n\t\t/// </summary>\n\t\tpublic ReadOnlyDocument(ITextSource textSource)\n\t\t{\n\t\t\tif (textSource == null)\n\t\t\t\tthrow new ArgumentNullException(\"textSource\");\n\t\t\t// ensure that underlying buffer is immutable\n\t\t\tthis.textSource = textSource.CreateSnapshot();\n\t\t\tList<int> lines = new List<int>();\n\t\t\tlines.Add(0);\n\t\t\tint offset = 0;\n\t\t\tint textLength = textSource.TextLength;\n\t\t\twhile ((offset = textSource.IndexOfAny(newline, offset, textLength - offset)) >= 0) {\n\t\t\t\toffset++;\n\t\t\t\tif (textSource.GetCharAt(offset - 1) == '\\r' && offset < textLength && textSource.GetCharAt(offset) == '\\n') {\n\t\t\t\t\toffset++;\n\t\t\t\t}\n\t\t\t\tlines.Add(offset);\n\t\t\t}\n\t\t\tthis.lines = lines.ToArray();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new ReadOnlyDocument from the given string.\n\t\t/// </summary>\n\t\tpublic ReadOnlyDocument(string text)\n\t\t\t: this(new StringTextSource(text))\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new ReadOnlyDocument from the given text source;\n\t\t/// and sets IDocument.FileName to the specified file name.\n\t\t/// </summary>\n\t\tpublic ReadOnlyDocument(ITextSource textSource, string fileName)\n\t\t\t: this(textSource)\n\t\t{\n\t\t\tthis.fileName = fileName;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic IDocumentLine GetLineByNumber(int lineNumber)\n\t\t{\n\t\t\tif (lineNumber < 1 || lineNumber > lines.Length)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"lineNumber\", lineNumber, \"Value must be between 1 and \" + lines.Length);\n\t\t\treturn new ReadOnlyDocumentLine(this, lineNumber);\n\t\t}\n\t\t\n\t\tsealed class ReadOnlyDocumentLine : IDocumentLine\n\t\t{\n\t\t\treadonly ReadOnlyDocument doc;\n\t\t\treadonly int lineNumber;\n\t\t\treadonly int offset, endOffset;\n\t\t\t\n\t\t\tpublic ReadOnlyDocumentLine(ReadOnlyDocument doc, int lineNumber)\n\t\t\t{\n\t\t\t\tthis.doc = doc;\n\t\t\t\tthis.lineNumber = lineNumber;\n\t\t\t\tthis.offset = doc.GetStartOffset(lineNumber);\n\t\t\t\tthis.endOffset = doc.GetEndOffset(lineNumber);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn doc.GetHashCode() ^ lineNumber;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tReadOnlyDocumentLine other = obj as ReadOnlyDocumentLine;\n\t\t\t\treturn other != null && doc == other.doc && lineNumber == other.lineNumber;\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Offset {\n\t\t\t\tget { return offset; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Length {\n\t\t\t\tget { return endOffset - offset; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int EndOffset {\n\t\t\t\tget { return endOffset; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int TotalLength {\n\t\t\t\tget {\n\t\t\t\t\treturn doc.GetTotalEndOffset(lineNumber) - offset;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic int DelimiterLength {\n\t\t\t\tget {\n\t\t\t\t\treturn doc.GetTotalEndOffset(lineNumber) - endOffset;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic int LineNumber {\n\t\t\t\tget { return lineNumber; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IDocumentLine PreviousLine {\n\t\t\t\tget {\n\t\t\t\t\tif (lineNumber == 1)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn new ReadOnlyDocumentLine(doc, lineNumber - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic IDocumentLine NextLine {\n\t\t\t\tget {\n\t\t\t\t\tif (lineNumber == doc.LineCount)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn new ReadOnlyDocumentLine(doc, lineNumber + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool IsDeleted {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t}\n\t\t\n\t\tint GetStartOffset(int lineNumber)\n\t\t{\n\t\t\treturn lines[lineNumber-1];\n\t\t}\n\t\t\n\t\tint GetTotalEndOffset(int lineNumber)\n\t\t{\n\t\t\treturn lineNumber < lines.Length ? lines[lineNumber] : textSource.TextLength;\n\t\t}\n\t\t\n\t\tint GetEndOffset(int lineNumber)\n\t\t{\n\t\t\tif (lineNumber == lines.Length)\n\t\t\t\treturn textSource.TextLength;\n\t\t\tint off = lines[lineNumber] - 1;\n\t\t\tif (off > 0 && textSource.GetCharAt(off - 1) == '\\r' && textSource.GetCharAt(off) == '\\n')\n\t\t\t\toff--;\n\t\t\treturn off;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic IDocumentLine GetLineByOffset(int offset)\n\t\t{\n\t\t\treturn GetLineByNumber(GetLineNumberForOffset(offset));\n\t\t}\n\t\t\n\t\tint GetLineNumberForOffset(int offset)\n\t\t{\n\t\t\tint r = Array.BinarySearch(lines, offset);\n\t\t\treturn r < 0 ? ~r : r + 1;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int GetOffset(int line, int column)\n\t\t{\n\t\t\tif (line < 1 || line > lines.Length)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"line\", line, \"Value must be between 1 and \" + lines.Length);\n\t\t\tint lineStart = GetStartOffset(line);\n\t\t\tif (column <= 1)\n\t\t\t\treturn lineStart;\n\t\t\tint lineEnd = GetEndOffset(line);\n\t\t\tif (column - 1 >= lineEnd - lineStart)\n\t\t\t\treturn lineEnd;\n\t\t\treturn lineStart + column - 1;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int GetOffset(TextLocation location)\n\t\t{\n\t\t\treturn GetOffset(location.Line, location.Column);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic TextLocation GetLocation(int offset)\n\t\t{\n\t\t\tif (offset < 0 || offset > textSource.TextLength)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\", offset, \"Value must be between 0 and \" + textSource.TextLength);\n\t\t\tint line = GetLineNumberForOffset(offset);\n\t\t\treturn new TextLocation(line, offset-GetStartOffset(line)+1);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string Text {\n\t\t\tget { return textSource.Text; }\n\t\t\tset {\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int LineCount {\n\t\t\tget { return lines.Length; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSourceVersion Version {\n\t\t\tget { return textSource.Version; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int TextLength {\n\t\t\tget { return textSource.TextLength; }\n\t\t}\n\t\t\n\t\tevent EventHandler<TextChangeEventArgs> IDocument.TextChanging { add {} remove {} }\n\t\t\n\t\tevent EventHandler<TextChangeEventArgs> IDocument.TextChanged { add {} remove {} }\n\t\t\n\t\tevent EventHandler IDocument.ChangeCompleted { add {} remove {} }\n\t\t\n\t\tvoid IDocument.Insert(int offset, string text)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IDocument.Insert(int offset, string text, AnchorMovementType defaultAnchorMovementType)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IDocument.Remove(int offset, int length)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IDocument.Replace(int offset, int length, string newText)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IDocument.Insert(int offset, ITextSource text)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IDocument.Insert(int offset, ITextSource text, AnchorMovementType defaultAnchorMovementType)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IDocument.Replace(int offset, int length, ITextSource newText)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IDocument.StartUndoableAction()\n\t\t{\n\t\t}\n\t\t\n\t\tvoid IDocument.EndUndoableAction()\n\t\t{\n\t\t}\n\t\t\n\t\tIDisposable IDocument.OpenUndoGroup()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextAnchor CreateAnchor(int offset)\n\t\t{\n\t\t\treturn new ReadOnlyDocumentTextAnchor(GetLocation(offset), offset);\n\t\t}\n\t\t\n\t\tsealed class ReadOnlyDocumentTextAnchor : ITextAnchor\n\t\t{\n\t\t\treadonly TextLocation location;\n\t\t\treadonly int offset;\n\t\t\t\n\t\t\tpublic ReadOnlyDocumentTextAnchor(TextLocation location, int offset)\n\t\t\t{\n\t\t\t\tthis.location = location;\n\t\t\t\tthis.offset = offset;\n\t\t\t}\n\t\t\t\n\t\t\tpublic event EventHandler Deleted { add {} remove {} }\n\t\t\t\n\t\t\tpublic TextLocation Location {\n\t\t\t\tget { return location; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Offset {\n\t\t\t\tget { return offset; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic AnchorMovementType MovementType { get; set; }\n\t\t\t\n\t\t\tpublic bool SurviveDeletion { get; set; }\n\t\t\t\n\t\t\tpublic bool IsDeleted {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Line {\n\t\t\t\tget { return location.Line; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Column {\n\t\t\t\tget { return location.Column; }\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSource CreateSnapshot()\n\t\t{\n\t\t\treturn textSource; // textBuffer is immutable\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSource CreateSnapshot(int offset, int length)\n\t\t{\n\t\t\treturn textSource.CreateSnapshot(offset, length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic IDocument CreateDocumentSnapshot()\n\t\t{\n\t\t\treturn this; // ReadOnlyDocument is immutable\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic System.IO.TextReader CreateReader()\n\t\t{\n\t\t\treturn textSource.CreateReader();\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic System.IO.TextReader CreateReader(int offset, int length)\n\t\t{\n\t\t\treturn textSource.CreateReader(offset, length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void WriteTextTo(System.IO.TextWriter writer)\n\t\t{\n\t\t\ttextSource.WriteTextTo(writer);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void WriteTextTo(System.IO.TextWriter writer, int offset, int length)\n\t\t{\n\t\t\ttextSource.WriteTextTo(writer, offset, length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic char GetCharAt(int offset)\n\t\t{\n\t\t\treturn textSource.GetCharAt(offset);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string GetText(int offset, int length)\n\t\t{\n\t\t\treturn textSource.GetText(offset, length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string GetText(ISegment segment)\n\t\t{\n\t\t\treturn textSource.GetText(segment);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOf(char c, int startIndex, int count)\n\t\t{\n\t\t\treturn textSource.IndexOf(c, startIndex, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOfAny(char[] anyOf, int startIndex, int count)\n\t\t{\n\t\t\treturn textSource.IndexOfAny(anyOf, startIndex, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOf(string searchText, int startIndex, int count, StringComparison comparisonType)\n\t\t{\n\t\t\treturn textSource.IndexOf(searchText, startIndex, count, comparisonType);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int LastIndexOf(char c, int startIndex, int count)\n\t\t{\n\t\t\treturn textSource.LastIndexOf(c, startIndex, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int LastIndexOf(string searchText, int startIndex, int count, StringComparison comparisonType)\n\t\t{\n\t\t\treturn textSource.LastIndexOf(searchText, startIndex, count, comparisonType);\n\t\t}\n\t\t\n\t\tobject IServiceProvider.GetService(Type serviceType)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\t/// <remarks>Will never be raised on <see cref=\"ReadOnlyDocument\" />.</remarks>\n\t\tpublic event EventHandler FileNameChanged { add {} remove {} }\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string FileName {\n\t\t\tget { return fileName; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/StringBuilderDocument.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// Document based on a string builder.\n\t/// This class serves as a reference implementation for the IDocument interface.\n\t/// </summary>\n\tpublic class StringBuilderDocument : IDocument\n\t{\n\t\treadonly StringBuilder b;\n\t\treadonly TextSourceVersionProvider versionProvider = new TextSourceVersionProvider();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new StringBuilderDocument.\n\t\t/// </summary>\n\t\tpublic StringBuilderDocument()\n\t\t{\n\t\t\tb = new StringBuilder();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new StringBuilderDocument with the specified initial text.\n\t\t/// </summary>\n\t\tpublic StringBuilderDocument(string text)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\tthrow new ArgumentNullException(\"text\");\n\t\t\tb = new StringBuilder(text);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new StringBuilderDocument with the initial text copied from the specified text source.\n\t\t/// </summary>\n\t\tpublic StringBuilderDocument(ITextSource textSource)\n\t\t{\n\t\t\tif (textSource == null)\n\t\t\t\tthrow new ArgumentNullException(\"textSource\");\n\t\t\tb = new StringBuilder(textSource.TextLength);\n\t\t\ttextSource.WriteTextTo(new StringWriter(b));\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic event EventHandler<TextChangeEventArgs> TextChanging;\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic event EventHandler<TextChangeEventArgs> TextChanged;\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic event EventHandler ChangeCompleted;\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSourceVersion Version {\n\t\t\tget { return versionProvider.CurrentVersion; }\n\t\t}\n\t\t\n\t\t#region Line<->Offset\n\t\t/// <inheritdoc/>\n\t\tpublic int LineCount {\n\t\t\tget { return CreateDocumentSnapshot().LineCount; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic IDocumentLine GetLineByNumber(int lineNumber)\n\t\t{\n\t\t\treturn CreateDocumentSnapshot().GetLineByNumber(lineNumber);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic IDocumentLine GetLineByOffset(int offset)\n\t\t{\n\t\t\treturn CreateDocumentSnapshot().GetLineByOffset(offset);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int GetOffset(int line, int column)\n\t\t{\n\t\t\treturn CreateDocumentSnapshot().GetOffset(line, column);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int GetOffset(TextLocation location)\n\t\t{\n\t\t\treturn CreateDocumentSnapshot().GetOffset(location);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic TextLocation GetLocation(int offset)\n\t\t{\n\t\t\treturn CreateDocumentSnapshot().GetLocation(offset);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Insert/Remove/Replace\n\t\t/// <inheritdoc/>\n\t\tpublic void Insert(int offset, string text)\n\t\t{\n\t\t\tReplace(offset, 0, text);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void Insert(int offset, ITextSource text)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\tthrow new ArgumentNullException(\"text\");\n\t\t\tReplace(offset, 0, text.Text);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void Insert(int offset, string text, AnchorMovementType defaultAnchorMovementType)\n\t\t{\n\t\t\tif (offset < 0 || offset > this.TextLength)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\");\n\t\t\tif (text == null)\n\t\t\t\tthrow new ArgumentNullException(\"text\");\n\t\t\tif (defaultAnchorMovementType == AnchorMovementType.BeforeInsertion)\n\t\t\t\tPerformChange(new InsertionWithMovementBefore(offset, text));\n\t\t\telse\n\t\t\t\tReplace(offset, 0, text);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void Insert(int offset, ITextSource text, AnchorMovementType defaultAnchorMovementType)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\tthrow new ArgumentNullException(\"text\");\n\t\t\tInsert(offset, text.Text, defaultAnchorMovementType);\n\t\t}\n\t\t\n\t\t[Serializable]\n\t\tsealed class InsertionWithMovementBefore : TextChangeEventArgs\n\t\t{\n\t\t\tpublic InsertionWithMovementBefore(int offset, string newText) : base(offset, string.Empty, newText)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetNewOffset(int offset, AnchorMovementType movementType)\n\t\t\t{\n\t\t\t\tif (offset == this.Offset && movementType == AnchorMovementType.Default)\n\t\t\t\t\treturn offset;\n\t\t\t\telse\n\t\t\t\t\treturn base.GetNewOffset(offset, movementType);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void Remove(int offset, int length)\n\t\t{\n\t\t\tReplace(offset, length, string.Empty);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void Replace(int offset, int length, string newText)\n\t\t{\n\t\t\tif (offset < 0 || offset > this.TextLength)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\");\n\t\t\tif (length < 0 || length > this.TextLength - offset)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"length\");\n\t\t\tif (newText == null)\n\t\t\t\tthrow new ArgumentNullException(\"newText\");\n\t\t\tPerformChange(new TextChangeEventArgs(offset, b.ToString(offset, length), newText));\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void Replace(int offset, int length, ITextSource newText)\n\t\t{\n\t\t\tif (newText == null)\n\t\t\t\tthrow new ArgumentNullException(\"newText\");\n\t\t\tReplace(offset, length, newText.Text);\n\t\t}\n\t\t\n\t\tbool isInChange;\n\t\t\n\t\tvoid PerformChange(TextChangeEventArgs change)\n\t\t{\n\t\t\t// Ensure that all changes take place inside an update group.\n\t\t\t// Will also take care of throwing an exception if isInChange is set.\n\t\t\tStartUndoableAction();\n\t\t\ttry {\n\t\t\t\tisInChange = true;\n\t\t\t\ttry {\n\t\t\t\t\tif (TextChanging != null)\n\t\t\t\t\t\tTextChanging(this, change);\n\t\t\t\t\t\n\t\t\t\t\t// Perform changes to document and Version property\n\t\t\t\t\tdocumentSnapshot = null;\n\t\t\t\t\tcachedText = null;\n\t\t\t\t\tb.Remove(change.Offset, change.RemovalLength);\n\t\t\t\t\tb.Insert(change.Offset, change.InsertedText.Text);\n\t\t\t\t\tversionProvider.AppendChange(change);\n\t\t\t\t\t\n\t\t\t\t\t// Update anchors and fire Deleted events\n\t\t\t\t\tUpdateAnchors(change);\n\t\t\t\t\t\n\t\t\t\t\tif (TextChanged != null)\n\t\t\t\t\t\tTextChanged(this, change);\n\t\t\t\t} finally {\n\t\t\t\t\tisInChange = false;\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tEndUndoableAction();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Undo\n\t\tint undoGroupNesting = 0;\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void StartUndoableAction()\n\t\t{\n\t\t\t// prevent changes from within the TextChanging/TextChanged event handlers\n\t\t\tif (isInChange)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\tundoGroupNesting++;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void EndUndoableAction()\n\t\t{\n\t\t\tundoGroupNesting--;\n\t\t\tif (undoGroupNesting == 0) {\n\t\t\t\tif (ChangeCompleted != null)\n\t\t\t\t\tChangeCompleted(this, EventArgs.Empty);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic IDisposable OpenUndoGroup()\n\t\t{\n\t\t\tStartUndoableAction();\n\t\t\treturn new CallbackOnDispose(EndUndoableAction);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region CreateSnapshot/CreateReader\n\t\tReadOnlyDocument documentSnapshot;\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic IDocument CreateDocumentSnapshot()\n\t\t{\n\t\t\tif (documentSnapshot == null)\n\t\t\t\tdocumentSnapshot = new ReadOnlyDocument(this, this.FileName);\n\t\t\treturn documentSnapshot;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSource CreateSnapshot()\n\t\t{\n\t\t\treturn new StringTextSource(this.Text, versionProvider.CurrentVersion);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSource CreateSnapshot(int offset, int length)\n\t\t{\n\t\t\treturn new StringTextSource(GetText(offset, length));\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic TextReader CreateReader()\n\t\t{\n\t\t\treturn new StringReader(this.Text);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic TextReader CreateReader(int offset, int length)\n\t\t{\n\t\t\treturn new StringReader(GetText(offset, length));\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void WriteTextTo(TextWriter writer)\n\t\t{\n\t\t\tif (writer == null)\n\t\t\t\tthrow new ArgumentNullException(\"writer\");\n\t\t\twriter.Write(this.Text);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void WriteTextTo(TextWriter writer, int offset, int length)\n\t\t{\n\t\t\tif (writer == null)\n\t\t\t\tthrow new ArgumentNullException(\"writer\");\n\t\t\twriter.Write(GetText(offset, length));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetText / IndexOf\n\t\tstring cachedText;\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string Text {\n\t\t\tget {\n\t\t\t\tif (cachedText == null)\n\t\t\t\t\tcachedText = b.ToString();\n\t\t\t\treturn cachedText;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tReplace(0, b.Length, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int TextLength {\n\t\t\tget { return b.Length; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic char GetCharAt(int offset)\n\t\t{\n\t\t\treturn b[offset];\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string GetText(int offset, int length)\n\t\t{\n\t\t\treturn b.ToString(offset, length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string GetText(ISegment segment)\n\t\t{\n\t\t\tif (segment == null)\n\t\t\t\tthrow new ArgumentNullException(\"segment\");\n\t\t\treturn b.ToString(segment.Offset, segment.Length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOf(char c, int startIndex, int count)\n\t\t{\n\t\t\treturn this.Text.IndexOf(c, startIndex, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOfAny(char[] anyOf, int startIndex, int count)\n\t\t{\n\t\t\treturn this.Text.IndexOfAny(anyOf, startIndex, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOf(string searchText, int startIndex, int count, StringComparison comparisonType)\n\t\t{\n\t\t\treturn this.Text.IndexOf(searchText, startIndex, count, comparisonType);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int LastIndexOf(char c, int startIndex, int count)\n\t\t{\n\t\t\treturn this.Text.LastIndexOf(c, startIndex + count - 1, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int LastIndexOf(string searchText, int startIndex, int count, StringComparison comparisonType)\n\t\t{\n\t\t\treturn this.Text.LastIndexOf(searchText, startIndex + count - 1, count, comparisonType);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region CreateAnchor\n\t\treadonly List<WeakReference> anchors = new List<WeakReference>();\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextAnchor CreateAnchor(int offset)\n\t\t{\n\t\t\tvar newAnchor = new SimpleAnchor(this, offset);\n\t\t\tfor (int i = 0; i < anchors.Count; i++) {\n\t\t\t\tif (!anchors[i].IsAlive)\n\t\t\t\t\tanchors[i] = new WeakReference(newAnchor);\n\t\t\t}\n\t\t\tanchors.Add(new WeakReference(newAnchor));\n\t\t\treturn newAnchor;\n\t\t}\n\t\t\n\t\tvoid UpdateAnchors(TextChangeEventArgs change)\n\t\t{\n\t\t\t// First update all anchors, then fire the deleted events.\n\t\t\tList<int> deletedAnchors = new List<int>();\n\t\t\tfor (int i = 0; i < anchors.Count; i++) {\n\t\t\t\tvar anchor = anchors[i].Target as SimpleAnchor;\n\t\t\t\tif (anchor != null) {\n\t\t\t\t\tanchor.Update(change);\n\t\t\t\t\tif (anchor.IsDeleted)\n\t\t\t\t\t\tdeletedAnchors.Add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeletedAnchors.Reverse();\n\t\t\tforeach (var index in deletedAnchors) {\n\t\t\t\tvar anchor = anchors[index].Target as SimpleAnchor;\n\t\t\t\tif (anchor != null)\n\t\t\t\t\tanchor.RaiseDeletedEvent();\n\t\t\t\tanchors.RemoveAt(index);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class SimpleAnchor : ITextAnchor\n\t\t{\n\t\t\treadonly StringBuilderDocument document;\n\t\t\tint offset;\n\t\t\t\n\t\t\tpublic SimpleAnchor(StringBuilderDocument document, int offset)\n\t\t\t{\n\t\t\t\tthis.document = document;\n\t\t\t\tthis.offset = offset;\n\t\t\t}\n\t\t\t\n\t\t\tpublic event EventHandler Deleted;\n\t\t\t\n\t\t\tpublic TextLocation Location {\n\t\t\t\tget {\n\t\t\t\t\tif (IsDeleted)\n\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\treturn document.GetLocation(offset);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Offset {\n\t\t\t\tget {\n\t\t\t\t\tif (IsDeleted)\n\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\treturn offset;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic AnchorMovementType MovementType { get; set; }\n\t\t\t\n\t\t\tpublic bool SurviveDeletion { get; set; }\n\t\t\t\n\t\t\tpublic bool IsDeleted {\n\t\t\t\tget { return offset < 0; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Update(TextChangeEventArgs change)\n\t\t\t{\n\t\t\t\tif (SurviveDeletion || offset <= change.Offset || offset >= change.Offset + change.RemovalLength) {\n\t\t\t\t\toffset = change.GetNewOffset(offset, MovementType);\n\t\t\t\t} else {\n\t\t\t\t\toffset = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic void RaiseDeletedEvent()\n\t\t\t{\n\t\t\t\tif (Deleted != null)\n\t\t\t\t\tDeleted(this, EventArgs.Empty);\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Line {\n\t\t\t\tget { return this.Location.Line; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Column {\n\t\t\t\tget { return this.Location.Column; }\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic virtual object GetService(Type serviceType)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic virtual event EventHandler FileNameChanged { add {} remove {} }\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic virtual string FileName {\n\t\t\tget { return string.Empty; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/StringTextSource.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// Implements the ITextSource interface using a string.\n\t/// </summary>\n\t[Serializable]\n\tpublic class StringTextSource : ITextSource\n\t{\n\t\t/// <summary>\n\t\t/// Gets a text source containing the empty string.\n\t\t/// </summary>\n\t\tpublic static readonly StringTextSource Empty = new StringTextSource(string.Empty);\n\t\t\n\t\treadonly string text;\n\t\treadonly ITextSourceVersion version;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new StringTextSource with the given text.\n\t\t/// </summary>\n\t\tpublic StringTextSource(string text)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\tthrow new ArgumentNullException(\"text\");\n\t\t\tthis.text = text;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new StringTextSource with the given text.\n\t\t/// </summary>\n\t\tpublic StringTextSource(string text, ITextSourceVersion version)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\tthrow new ArgumentNullException(\"text\");\n\t\t\tthis.text = text;\n\t\t\tthis.version = version;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSourceVersion Version {\n\t\t\tget { return version; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int TextLength {\n\t\t\tget { return text.Length; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string Text {\n\t\t\tget { return text; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSource CreateSnapshot()\n\t\t{\n\t\t\treturn this; // StringTextSource is immutable\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ITextSource CreateSnapshot(int offset, int length)\n\t\t{\n\t\t\treturn new StringTextSource(text.Substring(offset, length));\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic TextReader CreateReader()\n\t\t{\n\t\t\treturn new StringReader(text);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic TextReader CreateReader(int offset, int length)\n\t\t{\n\t\t\treturn new StringReader(text.Substring(offset, length));\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void WriteTextTo(TextWriter writer)\n\t\t{\n\t\t\twriter.Write(text);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void WriteTextTo(TextWriter writer, int offset, int length)\n\t\t{\n\t\t\twriter.Write(text.Substring(offset, length));\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic char GetCharAt(int offset)\n\t\t{\n\t\t\treturn text[offset];\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string GetText(int offset, int length)\n\t\t{\n\t\t\treturn text.Substring(offset, length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic string GetText(ISegment segment)\n\t\t{\n\t\t\tif (segment == null)\n\t\t\t\tthrow new ArgumentNullException(\"segment\");\n\t\t\treturn text.Substring(segment.Offset, segment.Length);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOf(char c, int startIndex, int count)\n\t\t{\n\t\t\treturn text.IndexOf(c, startIndex, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOfAny(char[] anyOf, int startIndex, int count)\n\t\t{\n\t\t\treturn text.IndexOfAny(anyOf, startIndex, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int IndexOf(string searchText, int startIndex, int count, StringComparison comparisonType)\n\t\t{\n\t\t\treturn text.IndexOf(searchText, startIndex, count, comparisonType);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int LastIndexOf(char c, int startIndex, int count)\n\t\t{\n\t\t\treturn text.LastIndexOf(c, startIndex + count - 1, count);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int LastIndexOf(string searchText, int startIndex, int count, StringComparison comparisonType)\n\t\t{\n\t\t\treturn text.LastIndexOf(searchText, startIndex + count - 1, count, comparisonType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/TextChangeEventArgs.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// Describes a change of the document text.\n\t/// This class is thread-safe.\n\t/// </summary>\n\t[Serializable]\n\tpublic class TextChangeEventArgs : EventArgs\n\t{\n\t\treadonly int offset;\n\t\treadonly ITextSource removedText;\n\t\treadonly ITextSource insertedText;\n\t\t\n\t\t/// <summary>\n\t\t/// The offset at which the change occurs.\n\t\t/// </summary>\n\t\tpublic int Offset {\n\t\t\tget { return offset; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The text that was removed.\n\t\t/// </summary>\n\t\tpublic ITextSource RemovedText {\n\t\t\tget { return removedText; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The number of characters removed.\n\t\t/// </summary>\n\t\tpublic int RemovalLength {\n\t\t\tget { return removedText.TextLength; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The text that was inserted.\n\t\t/// </summary>\n\t\tpublic ITextSource InsertedText {\n\t\t\tget { return insertedText; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The number of characters inserted.\n\t\t/// </summary>\n\t\tpublic int InsertionLength {\n\t\t\tget { return insertedText.TextLength; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new TextChangeEventArgs object.\n\t\t/// </summary>\n\t\tpublic TextChangeEventArgs(int offset, string removedText, string insertedText)\n\t\t{\n\t\t\tif (offset < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\", offset, \"offset must not be negative\");\n\t\t\tthis.offset = offset;\n\t\t\tthis.removedText = removedText != null ? new StringTextSource(removedText) : StringTextSource.Empty;\n\t\t\tthis.insertedText = insertedText != null ? new StringTextSource(insertedText) : StringTextSource.Empty;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new TextChangeEventArgs object.\n\t\t/// </summary>\n\t\tpublic TextChangeEventArgs(int offset, ITextSource removedText, ITextSource insertedText)\n\t\t{\n\t\t\tif (offset < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\", offset, \"offset must not be negative\");\n\t\t\tthis.offset = offset;\n\t\t\tthis.removedText = removedText ?? StringTextSource.Empty;\n\t\t\tthis.insertedText = insertedText ?? StringTextSource.Empty;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the new offset where the specified offset moves after this document change.\n\t\t/// </summary>\n\t\tpublic virtual int GetNewOffset(int offset, AnchorMovementType movementType = AnchorMovementType.Default)\n\t\t{\n\t\t\tif (offset >= this.Offset && offset <= this.Offset + this.RemovalLength) {\n\t\t\t\tif (movementType == AnchorMovementType.BeforeInsertion)\n\t\t\t\t\treturn this.Offset;\n\t\t\t\telse\n\t\t\t\t\treturn this.Offset + this.InsertionLength;\n\t\t\t} else if (offset > this.Offset) {\n\t\t\t\treturn offset + this.InsertionLength - this.RemovalLength;\n\t\t\t} else {\n\t\t\t\treturn offset;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates TextChangeEventArgs for the reverse change.\n\t\t/// </summary>\n\t\tpublic virtual TextChangeEventArgs Invert()\n\t\t{\n\t\t\treturn new TextChangeEventArgs(offset, insertedText, removedText);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/TextSourceVersionProvider.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t/// <summary>\n\t/// Provides ITextSourceVersion instances.\n\t/// </summary>\n\tpublic class TextSourceVersionProvider\n\t{\n\t\tVersion currentVersion;\n\t\t\n\t\tpublic TextSourceVersionProvider()\n\t\t{\n\t\t\tthis.currentVersion = new Version(this);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current version.\n\t\t/// </summary>\n\t\tpublic ITextSourceVersion CurrentVersion {\n\t\t\tget { return currentVersion; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces the current version with a new version.\n\t\t/// </summary>\n\t\t/// <param name=\"change\">Change from current version to new version</param>\n\t\tpublic void AppendChange(TextChangeEventArgs change)\n\t\t{\n\t\t\tif (change == null)\n\t\t\t\tthrow new ArgumentNullException(\"change\");\n\t\t\tcurrentVersion.change = change;\n\t\t\tcurrentVersion.next = new Version(currentVersion);\n\t\t\tcurrentVersion = currentVersion.next;\n\t\t}\n\t\t\n\t\t[DebuggerDisplay(\"Version #{id}\")]\n\t\tsealed class Version : ITextSourceVersion\n\t\t{\n\t\t\t// Reference back to the provider.\n\t\t\t// Used to determine if two checkpoints belong to the same document.\n\t\t\treadonly TextSourceVersionProvider provider;\n\t\t\t// ID used for CompareAge()\n\t\t\treadonly int id;\n\t\t\t\n\t\t\t// the change from this version to the next version\n\t\t\tinternal TextChangeEventArgs change;\n\t\t\tinternal Version next;\n\t\t\t\n\t\t\tinternal Version(TextSourceVersionProvider provider)\n\t\t\t{\n\t\t\t\tthis.provider = provider;\n\t\t\t}\n\t\t\t\n\t\t\tinternal Version(Version prev)\n\t\t\t{\n\t\t\t\tthis.provider = prev.provider;\n\t\t\t\tthis.id = unchecked( prev.id + 1 );\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool BelongsToSameDocumentAs(ITextSourceVersion other)\n\t\t\t{\n\t\t\t\tVersion o = other as Version;\n\t\t\t\treturn o != null && provider == o.provider;\n\t\t\t}\n\t\t\t\n\t\t\tpublic int CompareAge(ITextSourceVersion other)\n\t\t\t{\n\t\t\t\tif (other == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"other\");\n\t\t\t\tVersion o = other as Version;\n\t\t\t\tif (o == null || provider != o.provider)\n\t\t\t\t\tthrow new ArgumentException(\"Versions do not belong to the same document.\");\n\t\t\t\t// We will allow overflows, but assume that the maximum distance between checkpoints is 2^31-1.\n\t\t\t\t// This is guaranteed on x86 because so many checkpoints don't fit into memory.\n\t\t\t\treturn Math.Sign(unchecked( this.id - o.id ));\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerable<TextChangeEventArgs> GetChangesTo(ITextSourceVersion other)\n\t\t\t{\n\t\t\t\tint result = CompareAge(other);\n\t\t\t\tVersion o = (Version)other;\n\t\t\t\tif (result < 0)\n\t\t\t\t\treturn GetForwardChanges(o);\n\t\t\t\telse if (result > 0)\n\t\t\t\t\treturn o.GetForwardChanges(this).Reverse().Select(change => change.Invert());\n\t\t\t\telse\n\t\t\t\t\treturn EmptyList<TextChangeEventArgs>.Instance;\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<TextChangeEventArgs> GetForwardChanges(Version other)\n\t\t\t{\n\t\t\t\t// Return changes from this(inclusive) to other(exclusive).\n\t\t\t\tfor (Version node = this; node != other; node = node.next) {\n\t\t\t\t\tyield return node.change;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic int MoveOffsetTo(ITextSourceVersion other, int oldOffset, AnchorMovementType movement)\n\t\t\t{\n\t\t\t\tint offset = oldOffset;\n\t\t\t\tforeach (var e in GetChangesTo(other)) {\n\t\t\t\t\toffset = e.GetNewOffset(offset, movement);\n\t\t\t\t}\n\t\t\t\treturn offset;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Editor/UnicodeNewline.cs",
    "content": "//\n// UnicodeNewline.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory\n{\n\tpublic enum UnicodeNewline {\n\t\tUnknown,\n\n\t\t/// <summary>\n\t\t/// Line Feed, U+000A\n\t\t/// </summary>\n\t\tLF = 0x0A,\n\n\n\t\tCRLF = 0x0D0A,\n\n\t\t/// <summary>\n\t\t/// Carriage Return, U+000D\n\t\t/// </summary>\n\t\tCR = 0x0D,\n\n\t\t/// <summary>\n\t\t/// Next Line, U+0085\n\t\t/// </summary>\n\t\tNEL = 0x85,\n\n\t\t/// <summary>\n\t\t/// Vertical Tab, U+000B\n\t\t/// </summary>\n\t\tVT = 0x0B,\n\n\t\t/// <summary>\n\t\t/// Form Feed, U+000C\n\t\t/// </summary>\n\t\tFF = 0x0C,\n\n\t\t/// <summary>\n\t\t/// Line Separator, U+2028\n\t\t/// </summary>\n\t\tLS = 0x2028,\n\n\t\t/// <summary>\n\t\t/// Paragraph Separator, U+2029\n\t\t/// </summary>\n\t\tPS = 0x2029\n\t}\n\n\n\t/// <summary>\n\t/// Defines unicode new lines according to  Unicode Technical Report #13\n\t/// http://www.unicode.org/standard/reports/tr13/tr13-5.html\n\t/// </summary>\n\tpublic static class NewLine\n\t{\n\t\t/// <summary>\n\t\t/// Carriage Return, U+000D\n\t\t/// </summary>\n\t\tpublic const char CR = (char)0x0D;\n\n\t\t/// <summary>\n\t\t/// Line Feed, U+000A\n\t\t/// </summary>\n\t\tpublic const char LF = (char)0x0A;\n\n\t\t/// <summary>\n\t\t/// Next Line, U+0085\n\t\t/// </summary>\n\t\tpublic const char NEL = (char)0x85;\n\n\t\t/// <summary>\n\t\t/// Vertical Tab, U+000B\n\t\t/// </summary>\n\t\tpublic const char VT  = (char)0x0B;\n\n\t\t/// <summary>\n\t\t/// Form Feed, U+000C\n\t\t/// </summary>\n\t\tpublic const char FF  = (char)0x0C;\n\n\t\t/// <summary>\n\t\t/// Line Separator, U+2028\n\t\t/// </summary>\n\t\tpublic const char LS  = (char)0x2028;\n\n\t\t/// <summary>\n\t\t/// Paragraph Separator, U+2029\n\t\t/// </summary>\n\t\tpublic const char PS  = (char)0x2029;\n\n\t\t/// <summary>\n\t\t/// Determines if a char is a new line delimiter.\n\t\t/// </summary>\n\t\t/// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>\n\t\t/// <param name=\"curChar\">The current character.</param>\n\t\t/// <param name=\"nextChar\">A callback getting the next character (may be null).</param>\n\t\tpublic static int GetDelimiterLength (char curChar, Func<char> nextChar = null)\n\t\t{\n\t\t\tif (curChar == CR) {\n\t\t\t\tif (nextChar != null && nextChar () == LF)\n\t\t\t\t\treturn 2;\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif (curChar == LF || curChar == NEL || curChar == VT || curChar == FF || curChar == LS || curChar == PS)\n\t\t\t\treturn 1;\n\t\t\treturn 0;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines if a char is a new line delimiter.\n\t\t/// </summary>\n\t\t/// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>\n\t\t/// <param name=\"curChar\">The current character.</param>\n\t\t/// <param name=\"nextChar\">The next character (if != LF then length will always be 0 or 1).</param>\n\t\tpublic static int GetDelimiterLength (char curChar, char nextChar)\n\t\t{\n\t\t\tif (curChar == CR) {\n\t\t\t\tif (nextChar == LF)\n\t\t\t\t\treturn 2;\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif (curChar == LF || curChar == NEL || curChar == VT || curChar == FF || curChar == LS || curChar == PS)\n\t\t\t\treturn 1;\n\t\t\treturn 0;\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Determines if a char is a new line delimiter.\n\t\t/// </summary>\n\t\t/// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>\n\t\t/// <param name=\"curChar\">The current character.</param>\n\t\t/// <param name = \"length\">The length of the delimiter</param>\n\t\t/// <param name = \"type\">The type of the delimiter</param>\n\t\t/// <param name=\"nextChar\">A callback getting the next character (may be null).</param>\n\t\tpublic static bool TryGetDelimiterLengthAndType (char curChar, out int length, out UnicodeNewline type, Func<char> nextChar = null)\n\t\t{\n\t\t\tif (curChar == CR) {\n\t\t\t\tif (nextChar != null && nextChar () == LF) {\n\t\t\t\t\tlength = 2;\n\t\t\t\t\ttype = UnicodeNewline.CRLF;\n\t\t\t\t} else {\n\t\t\t\t\tlength = 1;\n\t\t\t\t\ttype = UnicodeNewline.CR;\n\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tswitch (curChar) {\n\t\t\tcase LF:\n\t\t\t\ttype = UnicodeNewline.LF;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase NEL:\n\t\t\t\ttype = UnicodeNewline.NEL;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase VT:\n\t\t\t\ttype = UnicodeNewline.VT;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase FF:\n\t\t\t\ttype = UnicodeNewline.FF;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase LS:\n\t\t\t\ttype = UnicodeNewline.LS;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase PS:\n\t\t\t\ttype = UnicodeNewline.PS;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tlength = -1;\n\t\t\ttype = UnicodeNewline.Unknown;\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines if a char is a new line delimiter.\n\t\t/// </summary>\n\t\t/// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>\n\t\t/// <param name=\"curChar\">The current character.</param>\n\t\t/// <param name = \"length\">The length of the delimiter</param>\n\t\t/// <param name = \"type\">The type of the delimiter</param>\n\t\t/// <param name=\"nextChar\">The next character (if != LF then length will always be 0 or 1).</param>\n\t\tpublic static bool TryGetDelimiterLengthAndType (char curChar, out int length, out UnicodeNewline type, char nextChar)\n\t\t{\n\t\t\tif (curChar == CR) {\n\t\t\t\tif (nextChar == LF) {\n\t\t\t\t\tlength = 2;\n\t\t\t\t\ttype = UnicodeNewline.CRLF;\n\t\t\t\t} else {\n\t\t\t\t\tlength = 1;\n\t\t\t\t\ttype = UnicodeNewline.CR;\n\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tswitch (curChar) {\n\t\t\tcase LF:\n\t\t\t\ttype = UnicodeNewline.LF;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase NEL:\n\t\t\t\ttype = UnicodeNewline.NEL;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase VT:\n\t\t\t\ttype = UnicodeNewline.VT;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase FF:\n\t\t\t\ttype = UnicodeNewline.FF;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase LS:\n\t\t\t\ttype = UnicodeNewline.LS;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\tcase PS:\n\t\t\t\ttype = UnicodeNewline.PS;\n\t\t\t\tlength = 1;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tlength = -1;\n\t\t\ttype = UnicodeNewline.Unknown;\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the new line type of a given char/next char.\n\t\t/// </summary>\n\t\t/// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>\n\t\t/// <param name=\"curChar\">The current character.</param>\n\t\t/// <param name=\"nextChar\">A callback getting the next character (may be null).</param>\n\t\tpublic static UnicodeNewline GetDelimiterType (char curChar, Func<char> nextChar = null)\n\t\t{\n\t\t\tswitch (curChar) {\n\t\t\t\tcase CR:\n\t\t\t\tif (nextChar != null && nextChar () == LF)\n\t\t\t\t\treturn UnicodeNewline.CRLF;\n\t\t\t\treturn UnicodeNewline.CR;\n\t\t\t\tcase LF:\n\t\t\t\treturn UnicodeNewline.LF;\n\t\t\t\tcase NEL:\n\t\t\t\treturn UnicodeNewline.NEL;\n\t\t\t\tcase VT:\n\t\t\t\treturn UnicodeNewline.VT;\n\t\t\t\tcase FF:\n\t\t\t\treturn UnicodeNewline.FF;\n\t\t\t\tcase LS:\n\t\t\t\treturn UnicodeNewline.LS;\n\t\t\t\tcase PS:\n\t\t\t\treturn UnicodeNewline.PS;\n\t\t\t}\n\t\t\treturn UnicodeNewline.Unknown;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the new line type of a given char/next char.\n\t\t/// </summary>\n\t\t/// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>\n\t\t/// <param name=\"curChar\">The current character.</param>\n\t\t/// <param name=\"nextChar\">The next character (if != LF then length will always be 0 or 1).</param>\n\t\tpublic static UnicodeNewline GetDelimiterType (char curChar, char nextChar)\n\t\t{\n\t\t\tswitch (curChar) {\n\t\t\tcase CR:\n\t\t\t\tif (nextChar == LF)\n\t\t\t\t\treturn UnicodeNewline.CRLF;\n\t\t\t\treturn UnicodeNewline.CR;\n\t\t\tcase LF:\n\t\t\t\treturn UnicodeNewline.LF;\n\t\t\tcase NEL:\n\t\t\t\treturn UnicodeNewline.NEL;\n\t\t\tcase VT:\n\t\t\t\treturn UnicodeNewline.VT;\n\t\t\tcase FF:\n\t\t\t\treturn UnicodeNewline.FF;\n\t\t\tcase LS:\n\t\t\t\treturn UnicodeNewline.LS;\n\t\t\tcase PS:\n\t\t\t\treturn UnicodeNewline.PS;\n\t\t\t}\n\t\t\treturn UnicodeNewline.Unknown;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines if a char is a new line delimiter. \n\t\t/// \n\t\t/// Note that the only 2 char wide new line is CR LF and both chars are new line\n\t\t/// chars on their own. For most cases GetDelimiterLength is the better choice.\n\t\t/// </summary>\n\t\tpublic static bool IsNewLine(char ch)\n\t\t{\n\t\t\treturn\n\t\t\t\tch == NewLine.CR ||\n\t\t\t\tch == NewLine.LF ||\n\t\t\t\tch == NewLine.NEL ||\n\t\t\t\tch == NewLine.VT ||\n\t\t\t\tch == NewLine.FF ||\n\t\t\t\tch == NewLine.LS ||\n\t\t\t\tch == NewLine.PS;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the new line as a string.\n\t\t/// </summary>\n\t\tpublic static string GetString (UnicodeNewline newLine)\n\t\t{\n\t\t\tswitch (newLine) {\n\t\t\tcase UnicodeNewline.Unknown:\n\t\t\t\treturn \"\";\n\t\t\tcase UnicodeNewline.LF:\n\t\t\t\treturn \"\\n\";\n\t\t\tcase UnicodeNewline.CRLF:\n\t\t\t\treturn \"\\r\\n\";\n\t\t\tcase UnicodeNewline.CR:\n\t\t\t\treturn \"\\r\";\n\t\t\tcase UnicodeNewline.NEL:\n\t\t\t\treturn \"\\u0085\";\n\t\t\tcase UnicodeNewline.VT:\n\t\t\t\treturn \"\\u000B\";\n\t\t\tcase UnicodeNewline.FF:\n\t\t\t\treturn \"\\u000C\";\n\t\t\tcase UnicodeNewline.LS:\n\t\t\t\treturn \"\\u2028\";\n\t\t\tcase UnicodeNewline.PS:\n\t\t\t\treturn \"\\u2029\";\n\t\t\tdefault:\n\t\t\t\tthrow new ArgumentOutOfRangeException ();\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/IAnnotatable.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory\n{\n\t/// <summary>\n\t/// Provides an interface to handle annotations in an object.\n\t/// </summary>\n\tpublic interface IAnnotatable\n\t{\n\t\t/// <summary>\n\t\t/// Gets all annotations stored on this IAnnotatable.\n\t\t/// </summary>\n\t\tIEnumerable<object> Annotations {\n\t\t\tget;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the first annotation of the specified type.\n\t\t/// Returns null if no matching annotation exists.\n\t\t/// </summary>\n\t\t/// <typeparam name='T'>\n\t\t/// The type of the annotation.\n\t\t/// </typeparam>\n\t\tT Annotation<T> () where T: class;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the first annotation of the specified type.\n\t\t/// Returns null if no matching annotation exists.\n\t\t/// </summary>\n\t\t/// <param name='type'>\n\t\t/// The type of the annotation.\n\t\t/// </param>\n\t\tobject Annotation (Type type);\n\t\t\n\t\t/// <summary>\n\t\t/// Adds an annotation to this instance.\n\t\t/// </summary>\n\t\t/// <param name='annotation'>\n\t\t/// The annotation to add.\n\t\t/// </param>\n\t\tvoid AddAnnotation (object annotation);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes all annotations of the specified type.\n\t\t/// </summary>\n\t\t/// <typeparam name='T'>\n\t\t/// The type of the annotations to remove.\n\t\t/// </typeparam>\n\t\tvoid RemoveAnnotations<T> () where T : class;\n\t\t\n\t\t/// <summary>\n\t\t/// Removes all annotations of the specified type.\n\t\t/// </summary>\n\t\t/// <param name='type'>\n\t\t/// The type of the annotations to remove.\n\t\t/// </param>\n\t\tvoid RemoveAnnotations(Type type);\n\t}\n\t\n\t/// <summary>\n\t/// Base class used to implement the IAnnotatable interface.\n\t/// This implementation is thread-safe.\n\t/// </summary>\n\t[Serializable]\n\tpublic abstract class AbstractAnnotatable : IAnnotatable\n\t{\n\t\t// Annotations: points either null (no annotations), to the single annotation,\n\t\t// or to an AnnotationList.\n\t\t// Once it is pointed at an AnnotationList, it will never change (this allows thread-safety support by locking the list)\n\t\t\n\t\tobject annotations;\n\t\t\n\t\t/// <summary>\n\t\t/// Clones all annotations.\n\t\t/// This method is intended to be called by Clone() implementations in derived classes.\n\t\t/// <code>\n\t\t/// AstNode copy = (AstNode)MemberwiseClone();\n\t\t/// copy.CloneAnnotations();\n\t\t/// </code>\n\t\t/// </summary>\n\t\tprotected void CloneAnnotations()\n\t\t{\n\t\t\tICloneable cloneable = annotations as ICloneable;\n\t\t\tif (cloneable != null)\n\t\t\t\tannotations = cloneable.Clone();\n\t\t}\n\n\t\tsealed class AnnotationList : List<object>, ICloneable\n\t\t{\n\t\t\t// There are two uses for this custom list type:\n\t\t\t// 1) it's private, and thus (unlike List<object>) cannot be confused with real annotations\n\t\t\t// 2) It allows us to simplify the cloning logic by making the list behave the same as a clonable annotation.\n\t\t\tpublic AnnotationList (int initialCapacity) : base(initialCapacity)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic object Clone ()\n\t\t\t{\n\t\t\t\tlock (this) {\n\t\t\t\t\tAnnotationList copy = new AnnotationList (this.Count);\n\t\t\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\t\t\tobject obj = this [i];\n\t\t\t\t\t\tICloneable c = obj as ICloneable;\n\t\t\t\t\t\tcopy.Add (c != null ? c.Clone () : obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual void AddAnnotation (object annotation)\n\t\t{\n\t\t\tif (annotation == null)\n\t\t\t\tthrow new ArgumentNullException (\"annotation\");\n\t\tretry: // Retry until successful\n\t\t\tobject oldAnnotation = Interlocked.CompareExchange (ref this.annotations, annotation, null);\n\t\t\tif (oldAnnotation == null) {\n\t\t\t\treturn; // we successfully added a single annotation\n\t\t\t}\n\t\t\tAnnotationList list = oldAnnotation as AnnotationList;\n\t\t\tif (list == null) {\n\t\t\t\t// we need to transform the old annotation into a list\n\t\t\t\tlist = new AnnotationList (4);\n\t\t\t\tlist.Add (oldAnnotation);\n\t\t\t\tlist.Add (annotation);\n\t\t\t\tif (Interlocked.CompareExchange (ref this.annotations, list, oldAnnotation) != oldAnnotation) {\n\t\t\t\t\t// the transformation failed (some other thread wrote to this.annotations first)\n\t\t\t\t\tgoto retry;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// once there's a list, use simple locking\n\t\t\t\tlock (list) {\n\t\t\t\t\tlist.Add (annotation);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual void RemoveAnnotations<T> () where T : class\n\t\t{\n\t\tretry: // Retry until successful\n\t\t\tobject oldAnnotations = this.annotations;\n\t\t\tAnnotationList list = oldAnnotations as AnnotationList;\n\t\t\tif (list != null) {\n\t\t\t\tlock (list)\n\t\t\t\t\tlist.RemoveAll (obj => obj is T);\n\t\t\t} else if (oldAnnotations is T) {\n\t\t\t\tif (Interlocked.CompareExchange (ref this.annotations, null, oldAnnotations) != oldAnnotations) {\n\t\t\t\t\t// Operation failed (some other thread wrote to this.annotations first)\n\t\t\t\t\tgoto retry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual void RemoveAnnotations (Type type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException (\"type\");\n\t\tretry: // Retry until successful\n\t\t\tobject oldAnnotations = this.annotations;\n\t\t\tAnnotationList list = oldAnnotations as AnnotationList;\n\t\t\tif (list != null) {\n\t\t\t\tlock (list)\n\t\t\t\t\tlist.RemoveAll(type.IsInstanceOfType);\n\t\t\t} else if (type.IsInstanceOfType (oldAnnotations)) {\n\t\t\t\tif (Interlocked.CompareExchange (ref this.annotations, null, oldAnnotations) != oldAnnotations) {\n\t\t\t\t\t// Operation failed (some other thread wrote to this.annotations first)\n\t\t\t\t\tgoto retry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic T Annotation<T> () where T: class\n\t\t{\n\t\t\tobject annotations = this.annotations;\n\t\t\tAnnotationList list = annotations as AnnotationList;\n\t\t\tif (list != null) {\n\t\t\t\tlock (list) {\n\t\t\t\t\tforeach (object obj in list) {\n\t\t\t\t\t\tT t = obj as T;\n\t\t\t\t\t\tif (t != null)\n\t\t\t\t\t\t\treturn t;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn annotations as T;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic object Annotation (Type type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException (\"type\");\n\t\t\tobject annotations = this.annotations;\n\t\t\tAnnotationList list = annotations as AnnotationList;\n\t\t\tif (list != null) {\n\t\t\t\tlock (list) {\n\t\t\t\t\tforeach (object obj in list) {\n\t\t\t\t\t\tif (type.IsInstanceOfType (obj))\n\t\t\t\t\t\t\treturn obj;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (type.IsInstanceOfType (annotations))\n\t\t\t\t\treturn annotations;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all annotations stored on this AstNode.\n\t\t/// </summary>\n\t\tpublic IEnumerable<object> Annotations {\n\t\t\tget {\n\t\t\t\tobject annotations = this.annotations;\n\t\t\t\tAnnotationList list = annotations as AnnotationList;\n\t\t\t\tif (list != null) {\n\t\t\t\t\tlock (list) {\n\t\t\t\t\t\treturn list.ToArray ();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (annotations != null)\n\t\t\t\t\t\treturn new object[] { annotations };\n\t\t\t\t\telse\n\t\t\t\t\t\treturn Enumerable.Empty<object> ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" DefaultTargets=\"Build\">\r\n  <PropertyGroup>\r\n    <ProjectGuid>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</ProjectGuid>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory</AssemblyName>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>\r\n    <NoStdLib>False</NoStdLib>\r\n    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>\r\n    <RunCodeAnalysis>False</RunCodeAnalysis>\r\n    <CodeAnalysisRules>-Microsoft.Design#CA1000;-Microsoft.Design#CA1004;-Microsoft.Design#CA1005;-Microsoft.Design#CA1006;-Microsoft.Design#CA1026;-Microsoft.Design#CA1033;-Microsoft.Design#CA1051;-Microsoft.Design#CA1063;-Microsoft.Naming#CA1702;-Microsoft.Naming#CA1704;-Microsoft.Naming#CA1710;-Microsoft.Naming#CA1716;-Microsoft.Naming#CA1720;-Microsoft.Performance#CA1800;-Microsoft.Security#CA2104</CodeAnalysisRules>\r\n    <SignAssembly>True</SignAssembly>\r\n    <AssemblyOriginatorKeyFile>..\\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>\r\n    <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>\r\n    <WarningLevel>4</WarningLevel>\r\n    <NoWarn>1591</NoWarn>\r\n    <OutputPath>..\\bin\\$(Configuration)\\</OutputPath>\r\n    <DocumentationFile>..\\bin\\$(Configuration)\\ICSharpCode.NRefactory.xml</DocumentationFile>\r\n    <NoWin32Manifest>False</NoWin32Manifest>\r\n    <IntermediateOutputPath>obj\\$(Configuration)\\</IntermediateOutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n    <RegisterForComInterop>False</RegisterForComInterop>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <BaseAddress>465371136</BaseAddress>\r\n    <FileAlignment>4096</FileAlignment>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <StartAction>Project</StartAction>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <Optimize>True</Optimize>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <BaseIntermediateOutputPath>obj\\</BaseIntermediateOutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <OutputPath>..\\bin\\Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <OutputPath>..\\bin\\Release\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <DefineConstants>DEBUG;TRACE;NET_4_5</DefineConstants>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <StartAction>Project</StartAction>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Release' \">\r\n    <Optimize>True</Optimize>\r\n    <DefineConstants>TRACE;NET_4_5</DefineConstants>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Release\\</OutputPath>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\" />\r\n    <Reference Include=\"System.Xml\" />\r\n    <Reference Include=\"System.Xml.Linq\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Analysis\\AbiComparer.cs\" />\r\n    <Compile Include=\"Analysis\\TypeGraph.cs\" />\r\n    <Compile Include=\"Analysis\\TypeGraphNode.cs\" />\r\n    <Compile Include=\"Documentation\\DocumentationComment.cs\" />\r\n    <Compile Include=\"Documentation\\GetPotentiallyNestedClassTypeReference.cs\" />\r\n    <Compile Include=\"Documentation\\IDocumentationProvider.cs\" />\r\n    <Compile Include=\"Editor\\IDocument.cs\" />\r\n    <Compile Include=\"Editor\\IDocumentLine.cs\" />\r\n    <Compile Include=\"Editor\\ISegment.cs\" />\r\n    <Compile Include=\"Editor\\ITextAnchor.cs\" />\r\n    <Compile Include=\"Editor\\ITextSource.cs\" />\r\n    <Compile Include=\"Editor\\ReadOnlyDocument.cs\" />\r\n    <Compile Include=\"Editor\\StringBuilderDocument.cs\" />\r\n    <Compile Include=\"Editor\\StringTextSource.cs\" />\r\n    <Compile Include=\"Editor\\TextChangeEventArgs.cs\" />\r\n    <Compile Include=\"Editor\\TextSourceVersionProvider.cs\" />\r\n    <Compile Include=\"IAnnotatable.cs\" />\r\n    <Compile Include=\"PatternMatching\\BacktrackingInfo.cs\" />\r\n    <Compile Include=\"PatternMatching\\Choice.cs\" />\r\n    <Compile Include=\"PatternMatching\\AnyNode.cs\" />\r\n    <Compile Include=\"PatternMatching\\Backreference.cs\" />\r\n    <Compile Include=\"PatternMatching\\INode.cs\" />\r\n    <Compile Include=\"PatternMatching\\Match.cs\" />\r\n    <Compile Include=\"PatternMatching\\NamedNode.cs\" />\r\n    <Compile Include=\"PatternMatching\\OptionalNode.cs\" />\r\n    <Compile Include=\"PatternMatching\\Repeat.cs\" />\r\n    <Compile Include=\"PatternMatching\\Pattern.cs\" />\r\n    <Compile Include=\"Documentation\\XmlDocumentationProvider.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"Properties\\GlobalAssemblyInfo.cs\" />\r\n    <Compile Include=\"Role.cs\" />\r\n    <Compile Include=\"Semantics\\AmbiguousResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ArrayAccessResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ArrayCreateResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ByReferenceResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ConstantResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ConversionResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\SizeOfResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ErrorResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\Conversion.cs\" />\r\n    <Compile Include=\"Semantics\\ForEachResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\InitializedObjectResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\InvocationResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\LocalResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\MemberResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\NamedArgumentResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\NamespaceResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\OperatorResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\ThisResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\TypeIsResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\TypeOfResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\TypeResolveResult.cs\" />\r\n    <Compile Include=\"Semantics\\UnknownMemberResolveResult.cs\" />\r\n    <Compile Include=\"TextLocation.cs\" />\r\n    <Compile Include=\"TypeSystem\\Accessibility.cs\" />\r\n    <Compile Include=\"TypeSystem\\AnonymousType.cs\" />\r\n    <Compile Include=\"TypeSystem\\ArrayType.cs\" />\r\n    <Compile Include=\"TypeSystem\\AssemblyQualifiedTypeName.cs\" />\r\n    <Compile Include=\"TypeSystem\\ByReferenceType.cs\" />\r\n    <Compile Include=\"TypeSystem\\ComHelper.cs\" />\r\n    <Compile Include=\"TypeSystem\\DefaultSolutionSnapshot.cs\" />\r\n    <Compile Include=\"TypeSystem\\DomRegion.cs\" />\r\n    <Compile Include=\"TypeSystem\\EntityType.cs\" />\r\n    <Compile Include=\"TypeSystem\\ICodeContext.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\BlobReader.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultVariable.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\ResolvedAttributeBlob.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\UnresolvedAttributeBlob.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\UnresolvedSecurityDeclarationBlob.cs\" />\r\n    <Compile Include=\"TypeSystem\\ISymbol.cs\" />\r\n    <Compile Include=\"TypeSystem\\TaskType.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeParameterSubstitution.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeSystemExtensions.cs\" />\r\n    <Compile Include=\"TypeSystem\\FullTypeName.cs\" />\r\n    <Compile Include=\"TypeSystem\\IAmbience.cs\" />\r\n    <Compile Include=\"TypeSystem\\IAssembly.cs\" />\r\n    <Compile Include=\"TypeSystem\\IAttribute.cs\" />\r\n    <Compile Include=\"TypeSystem\\ICompilation.cs\" />\r\n    <Compile Include=\"TypeSystem\\IConstantValue.cs\" />\r\n    <Compile Include=\"TypeSystem\\IEntity.cs\" />\r\n    <Compile Include=\"TypeSystem\\IEvent.cs\" />\r\n    <Compile Include=\"TypeSystem\\IField.cs\" />\r\n    <Compile Include=\"TypeSystem\\IFreezable.cs\" />\r\n    <Compile Include=\"TypeSystem\\IInterningProvider.cs\" />\r\n    <Compile Include=\"TypeSystem\\IMember.cs\" />\r\n    <Compile Include=\"TypeSystem\\IMethod.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AbstractFreezable.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AbstractResolvedEntity.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AbstractResolvedMember.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AbstractResolvedTypeParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AbstractType.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AbstractUnresolvedEntity.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AbstractUnresolvedMember.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\AccessorOwnerMemberReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\BaseTypeCollector.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultAssemblyReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultAttribute.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultMemberReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultResolvedEvent.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultResolvedField.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultResolvedMethod.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultResolvedProperty.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultResolvedTypeDefinition.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultResolvedTypeParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedAssembly.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedAttribute.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedEvent.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedField.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedMethod.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedProperty.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedTypeDefinition.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DefaultUnresolvedTypeParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\DummyTypeParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\ExplicitInterfaceImplementationMemberReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\FullNameAndTypeParameterCount.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\GetClassTypeReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\GetMembersHelper.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\KnownTypeCache.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\MergedNamespace.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\MinimalCorlib.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\NestedTypeReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SimpleCompilation.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SimpleConstantValue.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SimpleInterningProvider.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SpecializedEvent.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SpecializedField.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SpecializedMember.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SpecializedMethod.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SpecializedProperty.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\SpecializingMemberReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\TypeParameterReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\TypeWithElementType.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\UnknownType.cs\" />\r\n    <Compile Include=\"TypeSystem\\Implementation\\VoidTypeDefinition.cs\" />\r\n    <Compile Include=\"TypeSystem\\INamedElement.cs\" />\r\n    <Compile Include=\"TypeSystem\\INamespace.cs\" />\r\n    <Compile Include=\"TypeSystem\\InheritanceHelper.cs\" />\r\n    <Compile Include=\"TypeSystem\\IntersectionType.cs\" />\r\n    <Compile Include=\"TypeSystem\\IParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\IParameterizedMember.cs\" />\r\n    <Compile Include=\"TypeSystem\\IUnresolvedFile.cs\" />\r\n    <Compile Include=\"TypeSystem\\IProjectContent.cs\" />\r\n    <Compile Include=\"TypeSystem\\IProperty.cs\" />\r\n    <Compile Include=\"TypeSystem\\ISolutionSnapshot.cs\" />\r\n    <Compile Include=\"TypeSystem\\ISupportsInterning.cs\" />\r\n    <Compile Include=\"TypeSystem\\IType.cs\" />\r\n    <Compile Include=\"TypeSystem\\ITypeDefinition.cs\" />\r\n    <Compile Include=\"TypeSystem\\ITypeParameter.cs\" />\r\n    <Compile Include=\"TypeSystem\\ITypeReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\KnownTypeReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\NullableType.cs\" />\r\n    <Compile Include=\"TypeSystem\\ParameterizedType.cs\" />\r\n    <Compile Include=\"TypeSystem\\ParameterListComparer.cs\" />\r\n    <Compile Include=\"TypeSystem\\ProjectReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\ReflectionNameParseException.cs\" />\r\n    <Compile Include=\"TypeSystem\\SimpleTypeResolveContext.cs\" />\r\n    <Compile Include=\"TypeSystem\\TopLevelTypeName.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeKind.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeVisitor.cs\" />\r\n    <Compile Include=\"TypeSystem\\IVariable.cs\" />\r\n    <Compile Include=\"TypeSystem\\PointerType.cs\" />\r\n    <Compile Include=\"TypeSystem\\ReflectionHelper.cs\" />\r\n    <Compile Include=\"TypeSystem\\SpecialType.cs\" />\r\n    <Compile Include=\"Utils\\7BitEncodedInts.cs\" />\r\n    <Compile Include=\"Utils\\BitVector16.cs\" />\r\n    <Compile Include=\"Utils\\BusyManager.cs\" />\r\n    <Compile Include=\"Utils\\CacheManager.cs\" />\r\n    <Compile Include=\"Utils\\CallbackOnDispose.cs\" />\r\n    <Compile Include=\"Utils\\CSharpPrimitiveCast.cs\" />\r\n    <Compile Include=\"Utils\\EmptyList.cs\" />\r\n    <Compile Include=\"Utils\\ExtensionMethods.cs\" />\r\n    <Compile Include=\"Utils\\FastSerializer.cs\" />\r\n    <Compile Include=\"Utils\\GraphVizGraph.cs\" />\r\n    <Compile Include=\"Utils\\ImmutableStack.cs\" />\r\n    <Compile Include=\"Utils\\KeyComparer.cs\" />\r\n    <Compile Include=\"Utils\\LazyInit.cs\" />\r\n    <Compile Include=\"Utils\\MultiDictionary.cs\" />\r\n    <Compile Include=\"Utils\\Platform.cs\" />\r\n    <Compile Include=\"Utils\\ProjectedList.cs\" />\r\n    <Compile Include=\"Utils\\ReferenceComparer.cs\" />\r\n    <Compile Include=\"Utils\\TreeTraversal.cs\" />\r\n    <Compile Include=\"TypeSystem\\Error.cs\" />\r\n    <Compile Include=\"Completion\\ICompletionData.cs\" />\r\n    <Compile Include=\"Completion\\DisplayFlags.cs\" />\r\n    <Compile Include=\"Completion\\IEntityCompletionData.cs\" />\r\n    <Compile Include=\"Completion\\CompletionCategory.cs\" />\r\n    <Compile Include=\"Completion\\IParameterDataProvider.cs\" />\r\n    <Compile Include=\"Completion\\IVariableCompletionData.cs\" />\r\n    <Compile Include=\"Documentation\\IdStringProvider.cs\" />\r\n    <Compile Include=\"Documentation\\IdStringMemberReference.cs\" />\r\n    <Compile Include=\"Utils\\CompositeFormatStringParser\\CompositeFormatStringParser.cs\" />\r\n    <Compile Include=\"Utils\\CompositeFormatStringParser\\TextSegment.cs\" />\r\n    <Compile Include=\"Utils\\CompositeFormatStringParser\\FormatItem.cs\" />\r\n    <Compile Include=\"Utils\\CompositeFormatStringParser\\FormatStringSegmentBase.cs\" />\r\n    <Compile Include=\"Utils\\CompositeFormatStringParser\\IFormatStringSegment.cs\" />\r\n    <Compile Include=\"Utils\\CompositeFormatStringParser\\IFormatStringError.cs\" />\r\n    <Compile Include=\"Completion\\CompletionExtensionMethods.cs\" />\r\n    <Compile Include=\"Refactoring\\IssueMarker.cs\" />\r\n    <Compile Include=\"Refactoring\\Severity.cs\" />\r\n    <Compile Include=\"Analysis\\SymbolCollector.cs\" />\r\n    <Compile Include=\"TypeSystem\\AssemblyLoader.cs\" />\r\n    <Compile Include=\"Editor\\UnicodeNewline.cs\" />\r\n    <Compile Include=\"Completion\\FrameworkLookup.cs\" />\r\n    <Compile Include=\"Utils\\ComparableList.cs\" />\r\n    <Compile Include=\"PatternMatching\\AnyNodeOrNull.cs\" />\r\n    <Compile Include=\"Editor\\ITextPasteHandler.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Folder Include=\"Completion\\\" />\r\n    <Folder Include=\"TypeSystem\\\" />\r\n    <Folder Include=\"Utils\\CompositeFormatStringParser\\\" />\r\n    <Folder Include=\"Refactoring\\\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\doc\\Pattern Matching.html\">\r\n      <Link>PatternMatching\\Pattern Matching.html</Link>\r\n    </None>\r\n    <None Include=\"..\\doc\\XML Documentation.html\">\r\n      <Link>Documentation\\XML Documentation.html</Link>\r\n    </None>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/AnyNode.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Matches any node.\n\t/// </summary>\n\t/// <remarks>Does not match null nodes.</remarks>\n\tpublic class AnyNode : Pattern\n\t{\n\t\treadonly string groupName;\n\t\t\n\t\tpublic string GroupName {\n\t\t\tget { return groupName; }\n\t\t}\n\t\t\n\t\tpublic AnyNode(string groupName = null)\n\t\t{\n\t\t\tthis.groupName = groupName;\n\t\t}\n\t\t\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tmatch.Add(this.groupName, other);\n\t\t\treturn other != null && !other.IsNull;\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/AnyNodeOrNull.cs",
    "content": "//\n// AnyNodeOrNull.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Matches any node.\n\t/// </summary>\n\t/// <remarks>Does not match null nodes.</remarks>\n\tpublic class AnyNodeOrNull : Pattern\n\t{\n\t\treadonly string groupName;\n\n\t\tpublic string GroupName {\n\t\t\tget { return groupName; }\n\t\t}\n\n\t\tpublic AnyNodeOrNull(string groupName = null)\n\t\t{\n\t\t\tthis.groupName = groupName;\n\t\t}\n\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tif (other == null) {\n\t\t\t\tmatch.AddNull(this.groupName);\n\t\t\t} else {\n\t\t\t\tmatch.Add(this.groupName, other);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/Backreference.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Matches the last entry in the specified named group.\n\t/// </summary>\n\tpublic class Backreference : Pattern\n\t{\n\t\treadonly string referencedGroupName;\n\t\t\n\t\tpublic string ReferencedGroupName {\n\t\t\tget { return referencedGroupName; }\n\t\t}\n\t\t\n\t\tpublic Backreference(string referencedGroupName)\n\t\t{\n\t\t\tif (referencedGroupName == null)\n\t\t\t\tthrow new ArgumentNullException(\"referencedGroupName\");\n\t\t\tthis.referencedGroupName = referencedGroupName;\n\t\t}\n\t\t\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tvar last = match.Get (referencedGroupName).Last ();\n\t\t\tif (last == null && other == null)\n\t\t\t\treturn true;\n\t\t\treturn last.IsMatch(other);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/BacktrackingInfo.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Container for the backtracking info.\n\t/// </summary>\n\tpublic class BacktrackingInfo\n\t{\n\t\tinternal Stack<Pattern.PossibleMatch> backtrackingStack = new Stack<Pattern.PossibleMatch>();\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/Choice.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Matches one of several alternatives.\n\t/// </summary>\n\tpublic class Choice : Pattern, IEnumerable<INode>\n\t{\n\t\treadonly List<INode> alternatives = new List<INode>();\n\t\t\n\t\tpublic void Add(string name, INode alternative)\n\t\t{\n\t\t\tif (alternative == null)\n\t\t\t\tthrow new ArgumentNullException(\"alternative\");\n\t\t\talternatives.Add(new NamedNode(name, alternative));\n\t\t}\n\t\t\n\t\tpublic void Add(INode alternative)\n\t\t{\n\t\t\tif (alternative == null)\n\t\t\t\tthrow new ArgumentNullException(\"alternative\");\n\t\t\talternatives.Add(alternative);\n\t\t}\n\t\t\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tvar checkPoint = match.CheckPoint();\n\t\t\tforeach (INode alt in alternatives) {\n\t\t\t\tif (alt.DoMatch(other, match))\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\tmatch.RestoreCheckPoint(checkPoint);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tIEnumerator<INode> IEnumerable<INode>.GetEnumerator()\n\t\t{\n\t\t\treturn alternatives.GetEnumerator();\n\t\t}\n\t\t\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn alternatives.GetEnumerator();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/INode.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// AST node that supports pattern matching.\n\t/// </summary>\n\tpublic interface INode\n\t{\n\t\tRole Role { get; }\n\t\tINode FirstChild { get; }\n\t\tINode NextSibling { get; }\n\t\tbool IsNull { get; }\n\t\t\n\t\tbool DoMatch(INode other, Match match);\n\t\tbool DoMatchCollection(Role role, INode pos, Match match, BacktrackingInfo backtrackingInfo);\n\t}\n\t\n\tpublic static class PatternExtensions\n\t{\n\t\t/// <summary>\n\t\t/// Performs a pattern matching operation.\n\t\t/// <c>this</c> is the pattern, <paramref name=\"other\"/> is the AST that is being matched.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A match object. Check <see cref=\"PatternMatching.Match.Success\"/> to see whether the match was successful.\n\t\t/// </returns>\n\t\t/// <remarks>\n\t\t/// Patterns are ASTs that contain special pattern nodes (from the PatternMatching namespace).\n\t\t/// However, it is also possible to match two ASTs without any pattern nodes -\n\t\t/// doing so will produce a successful match if the two ASTs are structurally identical.\n\t\t/// </remarks>\n\t\tpublic static Match Match(this INode pattern, INode other)\n\t\t{\n\t\t\tif (pattern == null)\n\t\t\t\tthrow new ArgumentNullException(\"pattern\");\n\t\t\tMatch match = PatternMatching.Match.CreateNew();\n\t\t\tif (pattern.DoMatch(other, match))\n\t\t\t\treturn match;\n\t\t\telse\n\t\t\t\treturn default(PatternMatching.Match);\n\t\t}\n\t\t\n\t\tpublic static bool IsMatch(this INode pattern, INode other)\n\t\t{\n\t\t\tif (pattern == null)\n\t\t\t\tthrow new ArgumentNullException(\"pattern\");\n\t\t\treturn pattern.DoMatch(other, PatternMatching.Match.CreateNew());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/Match.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Represents the result of a pattern matching operation.\n\t/// </summary>\n\tpublic struct Match\n\t{\n\t\t// TODO: maybe we should add an implicit Match->bool conversion? (implicit operator bool(Match m) { return m != null; })\n\t\t\n\t\tList<KeyValuePair<string, INode>> results;\n\t\t\n\t\tpublic bool Success {\n\t\t\tget { return results != null; }\n\t\t}\n\t\t\n\t\tinternal static Match CreateNew()\n\t\t{\n\t\t\tMatch m;\n\t\t\tm.results = new List<KeyValuePair<string, INode>>();\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\tinternal int CheckPoint()\n\t\t{\n\t\t\treturn results.Count;\n\t\t}\n\t\t\n\t\tinternal void RestoreCheckPoint(int checkPoint)\n\t\t{\n\t\t\tresults.RemoveRange(checkPoint, results.Count - checkPoint);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<INode> Get(string groupName)\n\t\t{\n\t\t\tif (results == null)\n\t\t\t\tyield break;\n\t\t\tforeach (var pair in results) {\n\t\t\t\tif (pair.Key == groupName)\n\t\t\t\t\tyield return pair.Value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<T> Get<T>(string groupName) where T : INode\n\t\t{\n\t\t\tif (results == null)\n\t\t\t\tyield break;\n\t\t\tforeach (var pair in results) {\n\t\t\t\tif (pair.Key == groupName)\n\t\t\t\t\tyield return (T)pair.Value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool Has(string groupName)\n\t\t{\n\t\t\tif (results == null)\n\t\t\t\treturn false;\n\t\t\tforeach (var pair in results) {\n\t\t\t\tif (pair.Key == groupName)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic void Add(string groupName, INode node)\n\t\t{\n\t\t\tif (groupName != null && node != null) {\n\t\t\t\tresults.Add(new KeyValuePair<string, INode>(groupName, node));\n\t\t\t}\n\t\t}\n\n\t\tinternal void AddNull (string groupName)\n\t\t{\n\t\t\tif (groupName != null) {\n\t\t\t\tresults.Add(new KeyValuePair<string, INode>(groupName, null));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/NamedNode.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Represents a named node within a pattern.\n\t/// </summary>\n\tpublic class NamedNode : Pattern\n\t{\n\t\treadonly string groupName;\n\t\treadonly INode childNode;\n\t\t\n\t\tpublic string GroupName {\n\t\t\tget { return groupName; }\n\t\t}\n\t\t\n\t\tpublic INode ChildNode {\n\t\t\tget { return childNode; }\n\t\t}\n\t\t\n\t\tpublic NamedNode(string groupName, INode childNode)\n\t\t{\n\t\t\tif (childNode == null)\n\t\t\t\tthrow new ArgumentNullException(\"childNode\");\n\t\t\tthis.groupName = groupName;\n\t\t\tthis.childNode = childNode;\n\t\t}\n\t\t\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tmatch.Add(this.groupName, other);\n\t\t\treturn childNode.DoMatch(other, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/OptionalNode.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\tpublic class OptionalNode : Pattern\n\t{\n\t\treadonly INode childNode;\n\t\t\n\t\tpublic INode ChildNode {\n\t\t\tget { return childNode; }\n\t\t}\n\t\t\n\t\tpublic OptionalNode(INode childNode)\n\t\t{\n\t\t\tif (childNode == null)\n\t\t\t\tthrow new ArgumentNullException(\"childNode\");\n\t\t\tthis.childNode = childNode;\n\t\t}\n\t\t\n\t\tpublic OptionalNode(string groupName, INode childNode) : this(new NamedNode(groupName, childNode))\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override bool DoMatchCollection(Role role, INode pos, Match match, BacktrackingInfo backtrackingInfo)\n\t\t{\n\t\t\tbacktrackingInfo.backtrackingStack.Push(new PossibleMatch(pos, match.CheckPoint()));\n\t\t\treturn childNode.DoMatch(pos, match);\n\t\t}\n\t\t\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tif (other == null || other.IsNull)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn childNode.DoMatch(other, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/Pattern.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Base class for all patterns.\n\t/// </summary>\n\tpublic abstract class Pattern : INode\n\t{\n\t\t/// <summary>\n\t\t/// Gets the string that matches any string.\n\t\t/// </summary>\n\t\tpublic static readonly string AnyString = \"$any$\";\n\t\t\n\t\tpublic static bool MatchString(string pattern, string text)\n\t\t{\n\t\t\treturn pattern == AnyString || pattern == text;\n\t\t}\n\t\t\n\t\tinternal struct PossibleMatch\n\t\t{\n\t\t\tpublic readonly INode NextOther; // next node after the last matched node\n\t\t\tpublic readonly int Checkpoint; // checkpoint\n\t\t\t\n\t\t\tpublic PossibleMatch(INode nextOther, int checkpoint)\n\t\t\t{\n\t\t\t\tthis.NextOther = nextOther;\n\t\t\t\tthis.Checkpoint = checkpoint;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool INode.IsNull {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tRole INode.Role {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tINode INode.NextSibling {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tINode INode.FirstChild {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tpublic abstract bool DoMatch(INode other, Match match);\n\t\t\n\t\tpublic virtual bool DoMatchCollection(Role role, INode pos, Match match, BacktrackingInfo backtrackingInfo)\n\t\t{\n\t\t\treturn DoMatch (pos, match);\n\t\t}\n\t\t\n\t\tpublic static bool DoMatchCollection(Role role, INode firstPatternChild, INode firstOtherChild, Match match)\n\t\t{\n\t\t\tBacktrackingInfo backtrackingInfo = new BacktrackingInfo();\n\t\t\tStack<INode> patternStack = new Stack<INode>();\n\t\t\tStack<PossibleMatch> stack = backtrackingInfo.backtrackingStack;\n\t\t\tpatternStack.Push(firstPatternChild);\n\t\t\tstack.Push(new PossibleMatch(firstOtherChild, match.CheckPoint()));\n\t\t\twhile (stack.Count > 0) {\n\t\t\t\tINode cur1 = patternStack.Pop();\n\t\t\t\tINode cur2 = stack.Peek().NextOther;\n\t\t\t\tmatch.RestoreCheckPoint(stack.Pop().Checkpoint);\n\t\t\t\tbool success = true;\n\t\t\t\twhile (cur1 != null && success) {\n\t\t\t\t\twhile (cur1 != null && cur1.Role != role)\n\t\t\t\t\t\tcur1 = cur1.NextSibling;\n\t\t\t\t\twhile (cur2 != null && cur2.Role != role)\n\t\t\t\t\t\tcur2 = cur2.NextSibling;\n\t\t\t\t\tif (cur1 == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tDebug.Assert(stack.Count == patternStack.Count);\n\t\t\t\t\tsuccess = cur1.DoMatchCollection(role, cur2, match, backtrackingInfo);\n\t\t\t\t\tDebug.Assert(stack.Count >= patternStack.Count);\n\t\t\t\t\twhile (stack.Count > patternStack.Count)\n\t\t\t\t\t\tpatternStack.Push(cur1.NextSibling);\n\t\t\t\t\t\n\t\t\t\t\tcur1 = cur1.NextSibling;\n\t\t\t\t\tif (cur2 != null)\n\t\t\t\t\t\tcur2 = cur2.NextSibling;\n\t\t\t\t}\n\t\t\t\twhile (cur2 != null && cur2.Role != role)\n\t\t\t\t\tcur2 = cur2.NextSibling;\n\t\t\t\tif (success && cur2 == null)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/PatternMatching/Repeat.cs",
    "content": "﻿// Copyright (c) 2011-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\t/// <summary>\n\t/// Represents an optional node.\n\t/// </summary>\n\tpublic class Repeat : Pattern\n\t{\n\t\treadonly INode childNode;\n\t\t\n\t\tpublic int MinCount { get; set; }\n\t\tpublic int MaxCount { get; set; }\n\t\t\n\t\tpublic INode ChildNode {\n\t\t\tget { return childNode; }\n\t\t}\n\t\t\n\t\tpublic Repeat(INode childNode)\n\t\t{\n\t\t\tif (childNode == null)\n\t\t\t\tthrow new ArgumentNullException(\"childNode\");\n\t\t\tthis.childNode = childNode;\n\t\t\tthis.MinCount = 0;\n\t\t\tthis.MaxCount = int.MaxValue;\n\t\t}\n\t\t\n\t\tpublic override bool DoMatchCollection(Role role, INode pos, Match match, BacktrackingInfo backtrackingInfo)\n\t\t{\n\t\t\tvar backtrackingStack = backtrackingInfo.backtrackingStack;\n\t\t\tDebug.Assert(pos == null || pos.Role == role);\n\t\t\tint matchCount = 0;\n\t\t\tif (this.MinCount <= 0)\n\t\t\t\tbacktrackingStack.Push(new PossibleMatch(pos, match.CheckPoint()));\n\t\t\twhile (matchCount < this.MaxCount && pos != null && childNode.DoMatch(pos, match)) {\n\t\t\t\tmatchCount++;\n\t\t\t\tdo {\n\t\t\t\t\tpos = pos.NextSibling;\n\t\t\t\t} while (pos != null && pos.Role != role);\n\t\t\t\tif (matchCount >= this.MinCount)\n\t\t\t\t\tbacktrackingStack.Push(new PossibleMatch(pos, match.CheckPoint()));\n\t\t\t}\n\t\t\treturn false; // never do a normal (single-element) match; always make the caller look at the results on the back-tracking stack.\n\t\t}\n\t\t\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tif (other == null || other.IsNull)\n\t\t\t\treturn this.MinCount <= 0;\n\t\t\telse\n\t\t\t\treturn this.MaxCount >= 1 && childNode.DoMatch(other, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Properties/AssemblyInfo.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\nusing System.Runtime.CompilerServices;\n\n#region Using directives\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#endregion\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory\")]\n[assembly: AssemblyDescription(\"Type system and other language-independent parts of NRefactory\")]\n\n[assembly: CLSCompliant(true)]\n\n[assembly: InternalsVisibleTo(\"ICSharpCode.NRefactory.Cecil, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf\")]\n[assembly: InternalsVisibleTo(\"ICSharpCode.NRefactory.IKVM, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf\")]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Properties/GlobalAssemblyInfo.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\n#region Using directives\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#endregion\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyCompany(\"ICSharpCode\")]\n[assembly: AssemblyProduct(\"SharpDevelop/MonoDevelop\")]\n[assembly: AssemblyCopyright(\"Copyright 2010-2014 AlphaSierraPapa and Xamarin Inc.\")]\n\n// This sets the default COM visibility of types in the assembly to invisible.\n// If you need to expose a type to COM, use [ComVisible(true)] on that type.\n[assembly: ComVisible(false)]\n\n// We keep the AssemblyVersion at 5.0.0.0 for all versions of NRefactory 5.\n// This eliminates the need for binding redirects.\n[assembly: AssemblyVersion(\"5.0.0.0\")]\n\n// [AssemblyFileVersion] is the version of the NuGet package,\n// Versions with breaking changes / new features should increment the 'minor' (2nd) number.\n// Bugfix releases should increment the 'build' (3rd) number.\n[assembly: AssemblyFileVersion(\"5.4.0\")]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Refactoring/IssueMarker.cs",
    "content": "// \n// IssueMarker.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.Refactoring\n{\n\t/// <summary>\n\t/// The issue marker is used to set how an issue should be marked inside the text editor.\n\t/// </summary>\n\tpublic enum IssueMarker\n\t{\n\t\t/// <summary>\n\t\t/// The issue is not shown inside the text editor. (But in the task bar)\n\t\t/// </summary>\n\t\tNone,\n\n\t\t/// <summary>\n\t\t/// The region is marked as underline in the severity color.\n\t\t/// </summary>\n\t\tWavedLine,\n\n\t\t/// <summary>\n\t\t/// The region is marked as dotted line in the severity color.\n\t\t/// </summary>\n\t\tDottedLine,\n\n\t\t/// <summary>\n\t\t/// The text is grayed out.\n\t\t/// </summary>\n\t\tGrayOut\n\t}\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Refactoring/Severity.cs",
    "content": "// \n// Severity.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.Refactoring\n{\n\t/// <summary>\n\t/// The severity influences how the task bar reacts on found issues.\n\t/// </summary>\n\tpublic enum Severity\n\t{\n\t\t/// <summary>\n\t\t/// None means that the task bar doesn't show the issue.\n\t\t/// </summary>\n\t\tNone,\n\n\t\t/// <summary>\n\t\t/// Errors are shown in red and that the task bar is in error state if 1 error is found.\n\t\t/// </summary>\n\t\tError,\n\n\t\t/// <summary>\n\t\t/// Warnings are shown in yellow and set the task bar to warning state (if no error is found).\n\t\t/// </summary>\n\t\tWarning,\n\n\t\t/// <summary>\n\t\t/// Suggestions are shown in green and doesn't influence the task bar state\n\t\t/// </summary>\n\t\tSuggestion,\n\n\t\t/// <summary>\n\t\t/// Hints are shown in blue and doesn't influence the task bar state\n\t\t/// </summary>\n\t\tHint\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Role.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory\n{\n\t/// <summary>\n\t/// Represents the role a node plays within its parent.\n\t/// </summary>\n\tpublic abstract class Role\n\t{\n\t\tpublic const int RoleIndexBits = 9;\n\t\t\n\t\tstatic readonly Role[] roles = new Role[1 << RoleIndexBits];\n\t\tstatic int nextRoleIndex = 0;\n\t\t\n\t\treadonly uint index;\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic uint Index {\n\t\t\tget { return index; }\n\t\t}\n\t\t\n\t\t// don't allow NRefactory consumers to derive from Role\n\t\tinternal Role()\n\t\t{\n\t\t\tthis.index = (uint)Interlocked.Increment(ref nextRoleIndex);\n\t\t\tif (this.index >= roles.Length)\n\t\t\t\tthrow new InvalidOperationException(\"Too many roles\");\n\t\t\troles[this.index] = this;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the specified node is valid in this role.\n\t\t/// </summary>\n\t\tpublic abstract bool IsValid(object node);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the role with the specified index.\n\t\t/// </summary>\n\t\t[CLSCompliant(false)]\n\t\tpublic static Role GetByIndex(uint index)\n\t\t{\n\t\t\treturn roles[index];\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents the role a node plays within its parent.\n\t/// All nodes with this role have type T.\n\t/// </summary>\n\tpublic class Role<T> : Role where T : class\n\t{\n\t\treadonly string name; // helps with debugging the AST\n\t\treadonly T nullObject;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the null object used when there's no node with this role.\n\t\t/// Not every role has a null object; this property returns null for roles without a null object.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Roles used for non-collections should always have a null object, so that no AST property returns null.\n\t\t/// However, if a role used for collections only, it may leave out the null object.\n\t\t/// </remarks>\n\t\tpublic T NullObject {\n\t\t\tget { return nullObject; }\n\t\t}\n\t\t\n\t\tpublic override bool IsValid(object node)\n\t\t{\n\t\t\treturn node is T;\n\t\t}\n\t\t\n\t\tpublic Role(string name)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.name = name;\n\t\t}\n\t\t\n\t\tpublic Role(string name, T nullObject)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tif (nullObject == null)\n\t\t\t\tthrow new ArgumentNullException (\"nullObject\");\n\t\t\tthis.nullObject = nullObject;\n\t\t\tthis.name = name;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn name;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/AmbiguousResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents an ambiguous type resolve result.\n\t/// </summary>\n\tpublic class AmbiguousTypeResolveResult : TypeResolveResult\n\t{\n\t\tpublic AmbiguousTypeResolveResult(IType type) : base(type)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return true; }\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents an ambiguous field/property/event access.\n\t/// </summary>\n\tpublic class AmbiguousMemberResolveResult : MemberResolveResult\n\t{\n\t\tpublic AmbiguousMemberResolveResult(ResolveResult targetResult, IMember member) : base(targetResult, member)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return true; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ArrayAccessResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Resolve result representing an array access.\n\t/// </summary>\n\tpublic class ArrayAccessResolveResult : ResolveResult\n\t{\n\t\tpublic readonly ResolveResult Array;\n\t\tpublic readonly IList<ResolveResult> Indexes;\n\t\t\n\t\tpublic ArrayAccessResolveResult(IType elementType, ResolveResult array, IList<ResolveResult> indexes) : base(elementType)\n\t\t{\n\t\t\tif (array == null)\n\t\t\t\tthrow new ArgumentNullException(\"array\");\n\t\t\tif (indexes == null)\n\t\t\t\tthrow new ArgumentNullException(\"indexes\");\n\t\t\tthis.Array = array;\n\t\t\tthis.Indexes = indexes;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\treturn new [] { Array }.Concat(Indexes);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ArrayCreateResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Resolve result representing an array creation.\n\t/// </summary>\n\tpublic class ArrayCreateResolveResult : ResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// Gets the size arguments.\n\t\t/// </summary>\n\t\tpublic readonly IList<ResolveResult> SizeArguments;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the initializer elements.\n\t\t/// This field may be null if no initializer was specified.\n\t\t/// </summary>\n\t\tpublic readonly IList<ResolveResult> InitializerElements;\n\t\t\n\t\tpublic ArrayCreateResolveResult(IType arrayType, IList<ResolveResult> sizeArguments, IList<ResolveResult> initializerElements)\n\t\t\t: base(arrayType)\n\t\t{\n\t\t\tif (sizeArguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"sizeArguments\");\n\t\t\tthis.SizeArguments = sizeArguments;\n\t\t\tthis.InitializerElements = initializerElements;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\tif (InitializerElements != null)\n\t\t\t\treturn SizeArguments.Concat(InitializerElements);\n\t\t\telse\n\t\t\t\treturn SizeArguments;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ByReferenceResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents the resolve result of an 'ref x' or 'out x' expression.\n\t/// </summary>\n\tpublic class ByReferenceResolveResult : ResolveResult\n\t{\n\t\tpublic bool IsOut { get; private set; }\n\t\tpublic bool IsRef { get { return !IsOut;} }\n\t\t\n\t\tpublic readonly ResolveResult ElementResult;\n\t\t\n\t\tpublic ByReferenceResolveResult(ResolveResult elementResult, bool isOut)\n\t\t\t: this(elementResult.Type, isOut)\n\t\t{\n\t\t\tthis.ElementResult = elementResult;\n\t\t}\n\t\t\n\t\tpublic ByReferenceResolveResult(IType elementType, bool isOut)\n\t\t\t: base(new ByReferenceType(elementType))\n\t\t{\n\t\t\tthis.IsOut = isOut;\n\t\t}\n\t\t\n\t\tpublic IType ElementType {\n\t\t\tget { return ((ByReferenceType)this.Type).ElementType; }\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\tif (ElementResult != null)\n\t\t\t\treturn new[] { ElementResult };\n\t\t\telse\n\t\t\t\treturn Enumerable.Empty<ResolveResult>();\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} {1} {2}]\", GetType().Name, IsOut ? \"out\" : \"ref\", ElementType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ConstantResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// ResolveResult representing a compile-time constant.\n\t/// Note: this class is mainly used for literals; there may be other ResolveResult classes\n\t/// which are compile-time constants as well.\n\t/// For example, a reference to a <c>const</c> field results in a <see cref=\"MemberResolveResult\"/>.\n\t/// \n\t/// Check <see cref=\"ResolveResult.IsCompileTimeConstant\"/> to determine is a resolve result is a constant.\n\t/// </summary>\n\tpublic class ConstantResolveResult : ResolveResult\n\t{\n\t\tobject constantValue;\n\t\t\n\t\tpublic ConstantResolveResult(IType type, object constantValue) : base(type)\n\t\t{\n\t\t\tthis.constantValue = constantValue;\n\t\t}\n\t\t\n\t\tpublic override bool IsCompileTimeConstant {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tpublic override object ConstantValue {\n\t\t\tget { return constantValue; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} {1} = {2}]\", GetType().Name, this.Type, constantValue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/Conversion.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Holds information about a conversion between two types.\n\t/// </summary>\n\tpublic abstract class Conversion : IEquatable<Conversion>\n\t{\n\t\t#region Conversion factory methods\n\t\t/// <summary>\n\t\t/// Not a valid conversion.\n\t\t/// </summary>\n\t\tpublic static readonly Conversion None = new InvalidConversion();\n\t\t\n\t\t/// <summary>\n\t\t/// Identity conversion.\n\t\t/// </summary>\n\t\tpublic static readonly Conversion IdentityConversion = new BuiltinConversion(true, 0);\n\t\t\n\t\tpublic static readonly Conversion ImplicitNumericConversion = new NumericOrEnumerationConversion(true, false);\n\t\tpublic static readonly Conversion ExplicitNumericConversion = new NumericOrEnumerationConversion(false, false);\n\t\tpublic static readonly Conversion ImplicitLiftedNumericConversion = new NumericOrEnumerationConversion(true, true);\n\t\tpublic static readonly Conversion ExplicitLiftedNumericConversion = new NumericOrEnumerationConversion(false, true);\n\t\t\n\t\tpublic static Conversion EnumerationConversion(bool isImplicit, bool isLifted)\n\t\t{\n\t\t\treturn new NumericOrEnumerationConversion(isImplicit, isLifted, true);\n\t\t}\n\t\t\n\t\tpublic static readonly Conversion NullLiteralConversion = new BuiltinConversion(true, 1);\n\t\t\n\t\t/// <summary>\n\t\t/// The numeric conversion of a constant expression.\n\t\t/// </summary>\n\t\tpublic static readonly Conversion ImplicitConstantExpressionConversion = new BuiltinConversion(true, 2);\n\t\t\n\t\tpublic static readonly Conversion ImplicitReferenceConversion = new BuiltinConversion(true, 3);\n\t\tpublic static readonly Conversion ExplicitReferenceConversion = new BuiltinConversion(false, 3);\n\t\t\n\t\tpublic static readonly Conversion ImplicitDynamicConversion = new BuiltinConversion(true, 4);\n\t\tpublic static readonly Conversion ExplicitDynamicConversion = new BuiltinConversion(false, 4);\n\t\t\n\t\tpublic static readonly Conversion ImplicitNullableConversion = new BuiltinConversion(true, 5);\n\t\tpublic static readonly Conversion ExplicitNullableConversion = new BuiltinConversion(false, 5);\n\t\t\n\t\tpublic static readonly Conversion ImplicitPointerConversion = new BuiltinConversion(true, 6);\n\t\tpublic static readonly Conversion ExplicitPointerConversion = new BuiltinConversion(false, 6);\n\t\t\n\t\tpublic static readonly Conversion BoxingConversion = new BuiltinConversion(true, 7);\n\t\tpublic static readonly Conversion UnboxingConversion = new BuiltinConversion(false, 8);\n\t\t\n\t\t/// <summary>\n\t\t/// C# 'as' cast.\n\t\t/// </summary>\n\t\tpublic static readonly Conversion TryCast = new BuiltinConversion(false, 9);\n\t\t\n\t\t[Obsolete(\"Use UserDefinedConversion() instead\")]\n\t\tpublic static Conversion UserDefinedImplicitConversion(IMethod operatorMethod, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted)\n\t\t{\n\t\t\tif (operatorMethod == null)\n\t\t\t\tthrow new ArgumentNullException(\"operatorMethod\");\n\t\t\treturn new UserDefinedConv(true, operatorMethod, conversionBeforeUserDefinedOperator, conversionAfterUserDefinedOperator, isLifted, false);\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use UserDefinedConversion() instead\")]\n\t\tpublic static Conversion UserDefinedExplicitConversion(IMethod operatorMethod, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted)\n\t\t{\n\t\t\tif (operatorMethod == null)\n\t\t\t\tthrow new ArgumentNullException(\"operatorMethod\");\n\t\t\treturn new UserDefinedConv(false, operatorMethod, conversionBeforeUserDefinedOperator, conversionAfterUserDefinedOperator, isLifted, false);\n\t\t}\n\t\t\n\t\tpublic static Conversion UserDefinedConversion(IMethod operatorMethod, bool isImplicit, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted = false, bool isAmbiguous = false)\n\t\t{\n\t\t\tif (operatorMethod == null)\n\t\t\t\tthrow new ArgumentNullException(\"operatorMethod\");\n\t\t\treturn new UserDefinedConv(isImplicit, operatorMethod, conversionBeforeUserDefinedOperator, conversionAfterUserDefinedOperator, isLifted, isAmbiguous);\n\t\t}\n\t\t\n\t\tpublic static Conversion MethodGroupConversion(IMethod chosenMethod, bool isVirtualMethodLookup, bool delegateCapturesFirstArgument)\n\t\t{\n\t\t\tif (chosenMethod == null)\n\t\t\t\tthrow new ArgumentNullException(\"chosenMethod\");\n\t\t\treturn new MethodGroupConv(chosenMethod, isVirtualMethodLookup, delegateCapturesFirstArgument, isValid: true);\n\t\t}\n\t\t\n\t\tpublic static Conversion InvalidMethodGroupConversion(IMethod chosenMethod, bool isVirtualMethodLookup, bool delegateCapturesFirstArgument)\n\t\t{\n\t\t\tif (chosenMethod == null)\n\t\t\t\tthrow new ArgumentNullException(\"chosenMethod\");\n\t\t\treturn new MethodGroupConv(chosenMethod, isVirtualMethodLookup, delegateCapturesFirstArgument, isValid: false);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Inner classes\n\t\tsealed class InvalidConversion : Conversion\n\t\t{\n\t\t\tpublic override bool IsValid {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"None\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class NumericOrEnumerationConversion : Conversion\n\t\t{\n\t\t\treadonly bool isImplicit;\n\t\t\treadonly bool isLifted;\n\t\t\treadonly bool isEnumeration;\n\t\t\t\n\t\t\tpublic NumericOrEnumerationConversion(bool isImplicit, bool isLifted, bool isEnumeration = false)\n\t\t\t{\n\t\t\t\tthis.isImplicit = isImplicit;\n\t\t\t\tthis.isLifted = isLifted;\n\t\t\t\tthis.isEnumeration = isEnumeration;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicit {\n\t\t\t\tget { return isImplicit; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsExplicit {\n\t\t\t\tget { return !isImplicit; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsNumericConversion {\n\t\t\t\tget { return !isEnumeration; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsEnumerationConversion {\n\t\t\t\tget { return isEnumeration; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsLifted {\n\t\t\t\tget { return isLifted; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn (isImplicit ? \"implicit\" : \"explicit\")\n\t\t\t\t\t+ (isLifted ? \" lifted\" : \"\")\n\t\t\t\t\t+ (isEnumeration ? \" enumeration\" : \" numeric\")\n\t\t\t\t\t+ \" conversion\";\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(Conversion other)\n\t\t\t{\n\t\t\t\tNumericOrEnumerationConversion o = other as NumericOrEnumerationConversion;\n\t\t\t\treturn o != null && isImplicit == o.isImplicit && isLifted == o.isLifted && isEnumeration == o.isEnumeration;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn (isImplicit ? 1 : 0) + (isLifted ? 2 : 0) + (isEnumeration ? 4 : 0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class BuiltinConversion : Conversion\n\t\t{\n\t\t\treadonly bool isImplicit;\n\t\t\treadonly byte type;\n\t\t\t\n\t\t\tpublic BuiltinConversion(bool isImplicit, byte type)\n\t\t\t{\n\t\t\t\tthis.isImplicit = isImplicit;\n\t\t\t\tthis.type = type;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicit {\n\t\t\t\tget { return isImplicit; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsExplicit {\n\t\t\t\tget { return !isImplicit; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsIdentityConversion {\n\t\t\t\tget { return type == 0; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsNullLiteralConversion {\n\t\t\t\tget { return type == 1; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsConstantExpressionConversion {\n\t\t\t\tget { return type == 2; }\n\t\t\t}\n\n\t\t\tpublic override bool IsReferenceConversion {\n\t\t\t\tget { return type == 3; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsDynamicConversion {\n\t\t\t\tget { return type == 4; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsNullableConversion {\n\t\t\t\tget { return type == 5; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsPointerConversion {\n\t\t\t\tget { return type == 6; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsBoxingConversion {\n\t\t\t\tget { return type == 7; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsUnboxingConversion {\n\t\t\t\tget { return type == 8; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsTryCast {\n\t\t\t\tget { return type == 9; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tstring name = null;\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\treturn \"identity conversion\";\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\treturn \"null-literal conversion\";\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tname = \"constant-expression\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tname = \"reference\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tname = \"dynamic\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tname = \"nullable\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tname = \"pointer\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\treturn \"boxing conversion\";\n\t\t\t\t\tcase 8:\n\t\t\t\t\t\treturn \"unboxing conversion\";\n\t\t\t\t\tcase 9:\n\t\t\t\t\t\treturn \"try cast\";\n\t\t\t\t}\n\t\t\t\treturn (isImplicit ? \"implicit \" : \"explicit \") + name + \" conversion\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class UserDefinedConv : Conversion\n\t\t{\n\t\t\treadonly IMethod method;\n\t\t\treadonly bool isLifted;\n\t\t\treadonly Conversion conversionBeforeUserDefinedOperator;\n\t\t\treadonly Conversion conversionAfterUserDefinedOperator;\n\t\t\treadonly bool isImplicit;\n\t\t\treadonly bool isValid;\n\t\t\t\n\t\t\tpublic UserDefinedConv(bool isImplicit, IMethod method, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted, bool isAmbiguous)\n\t\t\t{\n\t\t\t\tthis.method = method;\n\t\t\t\tthis.isLifted = isLifted;\n\t\t\t\tthis.conversionBeforeUserDefinedOperator = conversionBeforeUserDefinedOperator;\n\t\t\t\tthis.conversionAfterUserDefinedOperator = conversionAfterUserDefinedOperator;\n\t\t\t\tthis.isImplicit = isImplicit;\n\t\t\t\tthis.isValid = !isAmbiguous;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsValid {\n\t\t\t\tget { return isValid; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicit {\n\t\t\t\tget { return isImplicit; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsExplicit {\n\t\t\t\tget { return !isImplicit; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsLifted {\n\t\t\t\tget { return isLifted; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsUserDefined {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Conversion ConversionBeforeUserDefinedOperator {\n\t\t\t\tget { return conversionBeforeUserDefinedOperator; }\n\t\t\t}\n\t\t\n\t\t\tpublic override Conversion ConversionAfterUserDefinedOperator {\n\t\t\t\tget { return conversionAfterUserDefinedOperator; }\n\t\t\t}\n\n\t\t\tpublic override IMethod Method {\n\t\t\t\tget { return method; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(Conversion other)\n\t\t\t{\n\t\t\t\tUserDefinedConv o = other as UserDefinedConv;\n\t\t\t\treturn o != null && isLifted == o.isLifted && isImplicit == o.isImplicit && isValid == o.isValid && method.Equals(o.method);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn unchecked(method.GetHashCode() + (isLifted ? 31 : 27) + (isImplicit ? 71 : 61) + (isValid ? 107 : 109));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn (isImplicit ? \"implicit\" : \"explicit\")\n\t\t\t\t\t+ (isLifted ? \" lifted\" : \"\")\n\t\t\t\t\t+ (isValid ? \"\" : \" ambiguous\")\n\t\t\t\t\t+ \"user-defined conversion (\" + method + \")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class MethodGroupConv : Conversion\n\t\t{\n\t\t\treadonly IMethod method;\n\t\t\treadonly bool isVirtualMethodLookup;\n\t\t\treadonly bool delegateCapturesFirstArgument;\n\t\t\treadonly bool isValid;\n\t\t\t\n\t\t\tpublic MethodGroupConv(IMethod method, bool isVirtualMethodLookup, bool delegateCapturesFirstArgument, bool isValid)\n\t\t\t{\n\t\t\t\tthis.method = method;\n\t\t\t\tthis.isVirtualMethodLookup = isVirtualMethodLookup;\n\t\t\t\tthis.delegateCapturesFirstArgument = delegateCapturesFirstArgument;\n\t\t\t\tthis.isValid = isValid;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsValid {\n\t\t\t\tget { return isValid; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicit {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsMethodGroupConversion {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsVirtualMethodLookup {\n\t\t\t\tget { return isVirtualMethodLookup; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool DelegateCapturesFirstArgument {\n\t\t\t\tget { return delegateCapturesFirstArgument; }\n\t\t\t}\n\n\t\t\tpublic override IMethod Method {\n\t\t\t\tget { return method; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(Conversion other)\n\t\t\t{\n\t\t\t\tMethodGroupConv o = other as MethodGroupConv;\n\t\t\t\treturn o != null && method.Equals(o.method);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn method.GetHashCode();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the conversion is valid.\n\t\t/// </summary>\n\t\tpublic virtual bool IsValid {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsImplicit {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsExplicit {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the conversion is an '<c>as</c>' cast.\n\t\t/// </summary>\n\t\tpublic virtual bool IsTryCast {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsIdentityConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsNullLiteralConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsConstantExpressionConversion {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic virtual bool IsNumericConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this conversion is a lifted version of another conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsLifted {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the conversion is dynamic.\n\t\t/// </summary>\n\t\tpublic virtual bool IsDynamicConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the conversion is a reference conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsReferenceConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the conversion is an enumeration conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsEnumerationConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the conversion is a nullable conversion\n\t\t/// (conversion between a nullable type and the regular type).\n\t\t/// </summary>\n\t\tpublic virtual bool IsNullableConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this conversion is user-defined (op_Implicit or op_Explicit).\n\t\t/// </summary>\n\t\tpublic virtual bool IsUserDefined {\n\t\t\tget { return false; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The conversion that is applied to the input before the user-defined conversion operator is invoked.\n\t\t/// </summary>\n\t\tpublic virtual Conversion ConversionBeforeUserDefinedOperator {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The conversion that is applied to the result of the user-defined conversion operator.\n\t\t/// </summary>\n\t\tpublic virtual Conversion ConversionAfterUserDefinedOperator {\n\t\t\tget { return null; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets whether this conversion is a boxing conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsBoxingConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this conversion is an unboxing conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsUnboxingConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this conversion is a pointer conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsPointerConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this conversion is a method group conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsMethodGroupConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// For method-group conversions, gets whether to perform a virtual method lookup at runtime.\n\t\t/// </summary>\n\t\tpublic virtual bool IsVirtualMethodLookup {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// For method-group conversions, gets whether the conversion captures the first argument.\n\t\t/// \n\t\t/// For instance methods, this property always returns true for C# method-group conversions.\n\t\t/// For static methods, this property returns true for method-group conversions of an extension method performed on an instance (eg. <c>Func&lt;int&gt; f = myEnumerable.Single</c>).\n\t\t/// </summary>\n\t\tpublic virtual bool DelegateCapturesFirstArgument {\n\t\t\tget { return false; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets whether this conversion is an anonymous function conversion.\n\t\t/// </summary>\n\t\tpublic virtual bool IsAnonymousFunctionConversion {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the method associated with this conversion.\n\t\t/// For user-defined conversions, this is the method being called.\n\t\t/// For method-group conversions, this is the method that was chosen from the group.\n\t\t/// </summary>\n\t\tpublic virtual IMethod Method {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tpublic override sealed bool Equals(object obj)\n\t\t{\n\t\t\treturn Equals(obj as Conversion);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn base.GetHashCode();\n\t\t}\n\t\t\n\t\tpublic virtual bool Equals(Conversion other)\n\t\t{\n\t\t\treturn this == other;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ConversionResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents an implicit or explicit type conversion.\n\t/// <c>conversionResolveResult.Input.Type</c> is the source type;\n\t/// <c>conversionResolveResult.Type</c> is the target type.\n\t/// The <see cref=\"Conversion\"/> property provides details about the kind of conversion.\n\t/// </summary>\n\tpublic class ConversionResolveResult : ResolveResult\n\t{\n\t\tpublic readonly ResolveResult Input;\n\t\tpublic readonly Conversion Conversion;\n\t\t\n\t\t/// <summary>\n\t\t/// For numeric conversions, specifies whether overflow checking is enabled.\n\t\t/// </summary>\n\t\tpublic readonly bool CheckForOverflow;\n\t\t\n\t\tpublic ConversionResolveResult(IType targetType, ResolveResult input, Conversion conversion)\n\t\t\t: base(targetType)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\tthrow new ArgumentNullException(\"input\");\n\t\t\tif (conversion == null)\n\t\t\t\tthrow new ArgumentNullException(\"conversion\");\n\t\t\tthis.Input = input;\n\t\t\tthis.Conversion = conversion;\n\t\t}\n\t\t\n\t\tpublic ConversionResolveResult(IType targetType, ResolveResult input, Conversion conversion, bool checkForOverflow)\n\t\t\t: this(targetType, input, conversion)\n\t\t{\n\t\t\tthis.CheckForOverflow = checkForOverflow;\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return !Conversion.IsValid; }\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\treturn new [] { Input };\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ErrorResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents a resolve error.\n\t/// \n\t/// Note: some errors are represented by other classes; for example a <see cref=\"ConversionResolveResult\"/> may\n\t/// be erroneous if the conversion is invalid.\n\t/// </summary>\n\t/// <seealso cref=\"ResolveResult.IsError\"/>.\n\tpublic class ErrorResolveResult : ResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// Gets an ErrorResolveResult instance with <c>Type</c> = <c>SpecialType.UnknownType</c>.\n\t\t/// </summary>\n\t\tpublic static readonly ErrorResolveResult UnknownError = new ErrorResolveResult(SpecialType.UnknownType);\n\t\t\n\t\tpublic ErrorResolveResult(IType type) : base(type)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ErrorResolveResult(IType type, string message, TextLocation location) : base(type)\n\t\t{\n\t\t\tthis.Message = message;\n\t\t\tthis.Location = location;\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tpublic string Message { get; private set; }\n\t\t\n\t\tpublic TextLocation Location { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ForEachResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Resolve result representing a 'foreach' loop.\n\t/// </summary>\n\tpublic class ForEachResolveResult : ResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// Gets the semantic tree for the call to GetEnumerator.\n\t\t/// </summary>\n\t\tpublic readonly ResolveResult GetEnumeratorCall;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the collection type.\n\t\t/// </summary>\n\t\tpublic readonly IType CollectionType;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the enumerator type.\n\t\t/// </summary>\n\t\tpublic readonly IType EnumeratorType;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the element type.\n\t\t/// This is the type that would be inferred for an implicitly-typed element variable.\n\t\t/// For explicitly-typed element variables, this type may differ from <c>ElementVariable.Type</c>.\n\t\t/// </summary>\n\t\tpublic readonly IType ElementType;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the element variable.\n\t\t/// </summary>\n\t\tpublic readonly IVariable ElementVariable;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the Current property on the IEnumerator.\n\t\t/// Returns null if the property is not found.\n\t\t/// </summary>\n\t\tpublic readonly IProperty CurrentProperty;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the MoveNext() method on the IEnumerator.\n\t\t/// Returns null if the method is not found.\n\t\t/// </summary>\n\t\tpublic readonly IMethod MoveNextMethod;\n\t\t\n\t\tpublic ForEachResolveResult(ResolveResult getEnumeratorCall, IType collectionType, IType enumeratorType, IType elementType, IVariable elementVariable, IProperty currentProperty, IMethod moveNextMethod, IType voidType)\n\t\t\t: base(voidType)\n\t\t{\n\t\t\tif (getEnumeratorCall == null)\n\t\t\t\tthrow new ArgumentNullException(\"getEnumeratorCall\");\n\t\t\tif (collectionType == null)\n\t\t\t\tthrow new ArgumentNullException(\"collectionType\");\n\t\t\tif (enumeratorType == null)\n\t\t\t\tthrow new ArgumentNullException(\"enumeratorType\");\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\tif (elementVariable == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementVariable\");\n\t\t\tthis.GetEnumeratorCall = getEnumeratorCall;\n\t\t\tthis.CollectionType = collectionType;\n\t\t\tthis.EnumeratorType = enumeratorType;\n\t\t\tthis.ElementType = elementType;\n\t\t\tthis.ElementVariable = elementVariable;\n\t\t\tthis.CurrentProperty = currentProperty;\n\t\t\tthis.MoveNextMethod = moveNextMethod;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/InitializedObjectResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Refers to the object that is currently being initialized.\n\t/// Used within <see cref=\"InvocationResolveResult.InitializerStatements\"/>.\n\t/// </summary>\n\tpublic class InitializedObjectResolveResult : ResolveResult\n\t{\n\t\tpublic InitializedObjectResolveResult(IType type) : base(type)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/InvocationResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents the result of a method, constructor or indexer invocation.\n\t/// </summary>\n\tpublic class InvocationResolveResult : MemberResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// Gets the arguments that are being passed to the method, in the order the arguments are being evaluated.\n\t\t/// </summary>\n\t\tpublic readonly IList<ResolveResult> Arguments;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of initializer statements that are appplied to the result of this invocation.\n\t\t/// This is used to represent object and collection initializers.\n\t\t/// With the initializer statements, the <see cref=\"InitializedObjectResolveResult\"/> is used\n\t\t/// to refer to the result of this invocation.\n\t\t/// </summary>\n\t\tpublic readonly IList<ResolveResult> InitializerStatements;\n\t\t\n\t\tpublic InvocationResolveResult(ResolveResult targetResult, IParameterizedMember member,\n\t\t                               IList<ResolveResult> arguments = null,\n\t\t                               IList<ResolveResult> initializerStatements = null,\n\t\t                               IType returnTypeOverride = null)\n\t\t\t: base(targetResult, member, returnTypeOverride)\n\t\t{\n\t\t\tthis.Arguments = arguments ?? EmptyList<ResolveResult>.Instance;\n\t\t\tthis.InitializerStatements = initializerStatements ?? EmptyList<ResolveResult>.Instance;\n\t\t}\n\t\t\n\t\tpublic new IParameterizedMember Member {\n\t\t\tget { return (IParameterizedMember)base.Member; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the arguments in the order they are being passed to the method.\n\t\t/// For parameter arrays (params), this will return an ArrayCreateResolveResult.\n\t\t/// </summary>\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1024:UsePropertiesWhereAppropriate\",\n\t\t                                                 Justification = \"Derived methods may be expensive and create new lists\")]\n\t\tpublic virtual IList<ResolveResult> GetArgumentsForCall()\n\t\t{\n\t\t\treturn Arguments;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\treturn base.GetChildResults().Concat(this.Arguments).Concat(this.InitializerStatements);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/LocalResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents a local variable or parameter.\n\t/// </summary>\n\tpublic class LocalResolveResult : ResolveResult\n\t{\n\t\treadonly IVariable variable;\n\t\t\n\t\tpublic LocalResolveResult(IVariable variable)\n\t\t\t: base(UnpackTypeIfByRefParameter(variable))\n\t\t{\n\t\t\tthis.variable = variable;\n\t\t}\n\t\t\n\t\tstatic IType UnpackTypeIfByRefParameter(IVariable variable)\n\t\t{\n\t\t\tif (variable == null)\n\t\t\t\tthrow new ArgumentNullException(\"variable\");\n\t\t\tIType type = variable.Type;\n\t\t\tif (type.Kind == TypeKind.ByReference) {\n\t\t\t\tIParameter p = variable as IParameter;\n\t\t\t\tif (p != null && (p.IsRef || p.IsOut))\n\t\t\t\t\treturn ((ByReferenceType)type).ElementType;\n\t\t\t}\n\t\t\treturn type;\n\t\t}\n\t\t\n\t\tpublic IVariable Variable {\n\t\t\tget { return variable; }\n\t\t}\n\t\t\n\t\tpublic bool IsParameter {\n\t\t\tget { return variable is IParameter; }\n\t\t}\n\t\t\n\t\tpublic override bool IsCompileTimeConstant {\n\t\t\tget { return variable.IsConst; }\n\t\t}\n\t\t\n\t\tpublic override object ConstantValue {\n\t\t\tget { return IsParameter ? null : variable.ConstantValue; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[LocalResolveResult {0}]\", variable);\n\t\t}\n\t\t\n\t\tpublic override DomRegion GetDefinitionRegion()\n\t\t{\n\t\t\treturn variable.Region;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/MemberResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents the result of a member invocation.\n\t/// Used for field/property/event access.\n\t/// Also, <see cref=\"InvocationResolveResult\"/> derives from MemberResolveResult.\n\t/// </summary>\n\tpublic class MemberResolveResult : ResolveResult\n\t{\n\t\treadonly IMember member;\n\t\treadonly bool isConstant;\n\t\treadonly object constantValue;\n\t\treadonly ResolveResult targetResult;\n\t\treadonly bool isVirtualCall;\n\t\t\n\t\tpublic MemberResolveResult(ResolveResult targetResult, IMember member, IType returnTypeOverride = null)\n\t\t\t: base(returnTypeOverride ?? ComputeType(member))\n\t\t{\n\t\t\tthis.targetResult = targetResult;\n\t\t\tthis.member = member;\n\t\t\tvar thisRR = targetResult as ThisResolveResult;\n\t\t\tthis.isVirtualCall = member.IsOverridable && !(thisRR != null && thisRR.CausesNonVirtualInvocation);\n\t\t\t\n\t\t\tIField field = member as IField;\n\t\t\tif (field != null) {\n\t\t\t\tisConstant = field.IsConst;\n\t\t\t\tif (isConstant)\n\t\t\t\t\tconstantValue = field.ConstantValue;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic MemberResolveResult(ResolveResult targetResult, IMember member, bool isVirtualCall, IType returnTypeOverride = null)\n\t\t\t: base(returnTypeOverride ?? ComputeType(member))\n\t\t{\n\t\t\tthis.targetResult = targetResult;\n\t\t\tthis.member = member;\n\t\t\tthis.isVirtualCall = isVirtualCall;\n\t\t\tIField field = member as IField;\n\t\t\tif (field != null) {\n\t\t\t\tisConstant = field.IsConst;\n\t\t\t\tif (isConstant)\n\t\t\t\t\tconstantValue = field.ConstantValue;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IType ComputeType(IMember member)\n\t\t{\n\t\t\tswitch (member.SymbolKind) {\n\t\t\t\tcase SymbolKind.Constructor:\n\t\t\t\t\treturn member.DeclaringType;\n\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\tif (((IField)member).IsFixed)\n\t\t\t\t\t\treturn new PointerType(member.ReturnType);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn member.ReturnType;\n\t\t}\n\t\t\n\t\tpublic MemberResolveResult(ResolveResult targetResult, IMember member, IType returnType, bool isConstant, object constantValue)\n\t\t\t: base(returnType)\n\t\t{\n\t\t\tthis.targetResult = targetResult;\n\t\t\tthis.member = member;\n\t\t\tthis.isConstant = isConstant;\n\t\t\tthis.constantValue = constantValue;\n\t\t}\n\t\t\n\t\tpublic MemberResolveResult(ResolveResult targetResult, IMember member, IType returnType, bool isConstant, object constantValue, bool isVirtualCall)\n\t\t\t: base(returnType)\n\t\t{\n\t\t\tthis.targetResult = targetResult;\n\t\t\tthis.member = member;\n\t\t\tthis.isConstant = isConstant;\n\t\t\tthis.constantValue = constantValue;\n\t\t\tthis.isVirtualCall = isVirtualCall;\n\t\t}\n\t\t\n\t\tpublic ResolveResult TargetResult {\n\t\t\tget { return targetResult; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the member.\n\t\t/// This property never returns null.\n\t\t/// </summary>\n\t\tpublic IMember Member {\n\t\t\tget { return member; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this MemberResolveResult is a virtual call.\n\t\t/// </summary>\n\t\tpublic bool IsVirtualCall {\n\t\t\tget { return isVirtualCall; }\n\t\t}\n\t\t\n\t\tpublic override bool IsCompileTimeConstant {\n\t\t\tget { return isConstant; }\n\t\t}\n\t\t\n\t\tpublic override object ConstantValue {\n\t\t\tget { return constantValue; }\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\tif (targetResult != null)\n\t\t\t\treturn new[] { targetResult };\n\t\t\telse\n\t\t\t\treturn Enumerable.Empty<ResolveResult>();\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} {1}]\", GetType().Name, member);\n\t\t}\n\t\t\n\t\tpublic override DomRegion GetDefinitionRegion()\n\t\t{\n\t\t\treturn member.Region;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/NamedArgumentResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents a named argument.\n\t/// </summary>\n\tpublic class NamedArgumentResolveResult : ResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// Gets the member to which the parameter belongs.\n\t\t/// This field can be null.\n\t\t/// </summary>\n\t\tpublic readonly IParameterizedMember Member;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the parameter.\n\t\t/// This field can be null.\n\t\t/// </summary>\n\t\tpublic readonly IParameter Parameter;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the parameter name.\n\t\t/// </summary>\n\t\tpublic readonly string ParameterName;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the argument passed to the parameter.\n\t\t/// </summary>\n\t\tpublic readonly ResolveResult Argument;\n\t\t\n\t\tpublic NamedArgumentResolveResult(IParameter parameter, ResolveResult argument, IParameterizedMember member = null)\n\t\t\t: base(argument.Type)\n\t\t{\n\t\t\tif (parameter == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameter\");\n\t\t\tif (argument == null)\n\t\t\t\tthrow new ArgumentNullException(\"argument\");\n\t\t\tthis.Member = member;\n\t\t\tthis.Parameter = parameter;\n\t\t\tthis.ParameterName = parameter.Name;\n\t\t\tthis.Argument = argument;\n\t\t}\n\t\t\n\t\tpublic NamedArgumentResolveResult(string parameterName, ResolveResult argument)\n\t\t\t: base(argument.Type)\n\t\t{\n\t\t\tif (parameterName == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameterName\");\n\t\t\tif (argument == null)\n\t\t\t\tthrow new ArgumentNullException(\"argument\");\n\t\t\tthis.ParameterName = parameterName;\n\t\t\tthis.Argument = argument;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\treturn new [] { Argument };\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/NamespaceResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents that an expression resolved to a namespace.\n\t/// </summary>\n\tpublic class NamespaceResolveResult : ResolveResult\n\t{\n\t\treadonly INamespace ns;\n\t\t\n\t\tpublic NamespaceResolveResult(INamespace ns) : base(SpecialType.UnknownType)\n\t\t{\n\t\t\tthis.ns = ns;\n\t\t}\n\t\t\n\t\tpublic INamespace Namespace {\n\t\t\tget { return ns; }\n\t\t}\n\t\t\n\t\tpublic string NamespaceName {\n\t\t\tget { return ns.FullName; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} {1}]\", GetType().Name, ns);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/OperatorResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq.Expressions;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents a unary/binary/ternary operator invocation.\n\t/// </summary>\n\tpublic class OperatorResolveResult : ResolveResult\n\t{\n\t\treadonly ExpressionType operatorType;\n\t\treadonly IMethod userDefinedOperatorMethod;\n\t\treadonly IList<ResolveResult> operands;\n\t\treadonly bool isLiftedOperator;\n\t\t\n\t\tpublic OperatorResolveResult(IType resultType, ExpressionType operatorType, params ResolveResult[] operands)\n\t\t\t: base(resultType)\n\t\t{\n\t\t\tif (operands == null)\n\t\t\t\tthrow new ArgumentNullException(\"operands\");\n\t\t\tthis.operatorType = operatorType;\n\t\t\tthis.operands = operands;\n\t\t}\n\t\t\n\t\tpublic OperatorResolveResult(IType resultType, ExpressionType operatorType, IMethod userDefinedOperatorMethod, bool isLiftedOperator, IList<ResolveResult> operands)\n\t\t\t: base(resultType)\n\t\t{\n\t\t\tif (operands == null)\n\t\t\t\tthrow new ArgumentNullException(\"operands\");\n\t\t\tthis.operatorType = operatorType;\n\t\t\tthis.userDefinedOperatorMethod = userDefinedOperatorMethod;\n\t\t\tthis.isLiftedOperator = isLiftedOperator;\n\t\t\tthis.operands = operands;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the operator type.\n\t\t/// </summary>\n\t\tpublic ExpressionType OperatorType {\n\t\t\tget { return operatorType; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the operands.\n\t\t/// </summary>\n\t\tpublic IList<ResolveResult> Operands {\n\t\t\tget { return operands; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the user defined operator method.\n\t\t/// Returns null if this is a predefined operator.\n\t\t/// </summary>\n\t\tpublic IMethod UserDefinedOperatorMethod {\n\t\t\tget { return userDefinedOperatorMethod; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this is a lifted operator.\n\t\t/// </summary>\n\t\tpublic bool IsLiftedOperator {\n\t\t\tget { return isLiftedOperator; }\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\treturn operands;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents the result of resolving an expression.\n\t/// </summary>\n\tpublic class ResolveResult\n\t{\n\t\treadonly IType type;\n\t\t\n\t\tpublic ResolveResult(IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tthis.type = type;\n\t\t}\n\t\t\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1721:PropertyNamesShouldNotMatchGetMethods\",\n\t\t                                                 Justification = \"Unrelated to object.GetType()\")]\n\t\tpublic IType Type {\n\t\t\tget { return type; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsCompileTimeConstant {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic virtual object ConstantValue {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsError {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[\" + GetType().Name + \" \" + type + \"]\";\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\treturn Enumerable.Empty<ResolveResult>();\n\t\t}\n\t\t\n\t\tpublic virtual DomRegion GetDefinitionRegion()\n\t\t{\n\t\t\treturn DomRegion.Empty;\n\t\t}\n\t\t\n\t\tpublic virtual ResolveResult ShallowClone()\n\t\t{\n\t\t\treturn (ResolveResult)MemberwiseClone();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/SizeOfResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents the 'sizeof'.\n\t/// </summary>\n\tpublic class SizeOfResolveResult : ResolveResult\n\t{\n\t\treadonly IType referencedType;\n\t\treadonly int? constantValue;\n\t\t\n\t\tpublic SizeOfResolveResult(IType int32, IType referencedType, int? constantValue)\n\t\t\t: base(int32)\n\t\t{\n\t\t\tif (referencedType == null)\n\t\t\t\tthrow new ArgumentNullException(\"referencedType\");\n\t\t\tthis.referencedType = referencedType;\n\t\t\tthis.constantValue = constantValue;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The type referenced by the 'sizeof'.\n\t\t/// </summary>\n\t\tpublic IType ReferencedType {\n\t\t\tget { return referencedType; }\n\t\t}\n\n\t\tpublic override bool IsCompileTimeConstant {\n\t\t\tget {\n\t\t\t\treturn constantValue != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic override object ConstantValue {\n\t\t\tget {\n\t\t\t\treturn constantValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsError {\n\t\t\tget {\n\t\t\t\treturn referencedType.IsReferenceType != false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/ThisResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents the 'this' reference.\n\t/// Also used for the 'base' reference.\n\t/// </summary>\n\tpublic class ThisResolveResult : ResolveResult\n\t{\n\t\tbool causesNonVirtualInvocation;\n\t\t\n\t\tpublic ThisResolveResult(IType type, bool causesNonVirtualInvocation = false) : base(type)\n\t\t{\n\t\t\tthis.causesNonVirtualInvocation = causesNonVirtualInvocation;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this resolve result causes member invocations to be non-virtual.\n\t\t/// </summary>\n\t\tpublic bool CausesNonVirtualInvocation {\n\t\t\tget { return causesNonVirtualInvocation; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/TypeIsResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Resolve result for a C# 'is' expression.\n\t/// \"Input is TargetType\".\n\t/// </summary>\n\tpublic class TypeIsResolveResult : ResolveResult\n\t{\n\t\tpublic readonly ResolveResult Input;\n\t\t/// <summary>\n\t\t/// Type that is being compared with.\n\t\t/// </summary>\n\t\tpublic readonly IType TargetType;\n\t\t\n\t\tpublic TypeIsResolveResult(ResolveResult input, IType targetType, IType booleanType)\n\t\t\t: base(booleanType)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\tthrow new ArgumentNullException(\"input\");\n\t\t\tif (targetType == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetType\");\n\t\t\tthis.Input = input;\n\t\t\tthis.TargetType = targetType;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/TypeOfResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents the 'typeof'.\n\t/// </summary>\n\tpublic class TypeOfResolveResult : ResolveResult\n\t{\n\t\treadonly IType referencedType;\n\t\t\n\t\tpublic TypeOfResolveResult(IType systemType, IType referencedType)\n\t\t\t: base(systemType)\n\t\t{\n\t\t\tif (referencedType == null)\n\t\t\t\tthrow new ArgumentNullException(\"referencedType\");\n\t\t\tthis.referencedType = referencedType;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The type referenced by the 'typeof'.\n\t\t/// </summary>\n\t\tpublic IType ReferencedType {\n\t\t\tget { return referencedType; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/TypeResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// The resolved expression refers to a type name.\n\t/// </summary>\n\tpublic class TypeResolveResult : ResolveResult\n\t{\n\t\tpublic TypeResolveResult(IType type)\n\t\t\t: base(type)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return this.Type.Kind == TypeKind.Unknown; }\n\t\t}\n\t\t\n\t\tpublic override DomRegion GetDefinitionRegion()\n\t\t{\n\t\t\tITypeDefinition def = this.Type.GetDefinition();\n\t\t\tif (def != null)\n\t\t\t\treturn def.Region;\n\t\t\telse\n\t\t\t\treturn DomRegion.Empty;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Semantics/UnknownMemberResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Semantics\n{\n\t/// <summary>\n\t/// Represents an unknown member.\n\t/// </summary>\n\tpublic class UnknownMemberResolveResult : ResolveResult\n\t{\n\t\treadonly IType targetType;\n\t\treadonly string memberName;\n\t\treadonly ReadOnlyCollection<IType> typeArguments;\n\t\t\n\t\tpublic UnknownMemberResolveResult(IType targetType, string memberName, IEnumerable<IType> typeArguments)\n\t\t\t: base(SpecialType.UnknownType)\n\t\t{\n\t\t\tif (targetType == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetType\");\n\t\t\tthis.targetType = targetType;\n\t\t\tthis.memberName = memberName;\n\t\t\tthis.typeArguments = new ReadOnlyCollection<IType>(typeArguments.ToArray());\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The type on which the method is being called.\n\t\t/// </summary>\n\t\tpublic IType TargetType {\n\t\t\tget { return targetType; }\n\t\t}\n\t\t\n\t\tpublic string MemberName {\n\t\t\tget { return memberName; }\n\t\t}\n\t\t\n\t\tpublic ReadOnlyCollection<IType> TypeArguments {\n\t\t\tget { return typeArguments; }\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} {1}.{2}]\", GetType().Name, targetType, memberName);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents an unknown method.\n\t/// </summary>\n\tpublic class UnknownMethodResolveResult : UnknownMemberResolveResult\n\t{\n\t\treadonly ReadOnlyCollection<IParameter> parameters;\n\t\t\n\t\tpublic UnknownMethodResolveResult(IType targetType, string methodName, IEnumerable<IType> typeArguments, IEnumerable<IParameter> parameters)\n\t\t\t: base(targetType, methodName, typeArguments)\n\t\t{\n\t\t\tthis.parameters = new ReadOnlyCollection<IParameter>(parameters.ToArray());\n\t\t}\n\t\t\n\t\tpublic ReadOnlyCollection<IParameter> Parameters {\n\t\t\tget { return parameters; }\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents an unknown identifier.\n\t/// </summary>\n\tpublic class UnknownIdentifierResolveResult : ResolveResult\n\t{\n\t\treadonly string identifier;\n\t\treadonly int typeArgumentCount;\n\t\t\n\t\tpublic UnknownIdentifierResolveResult(string identifier, int typeArgumentCount = 0)\n\t\t\t: base(SpecialType.UnknownType)\n\t\t{\n\t\t\tthis.identifier = identifier;\n\t\t\tthis.typeArgumentCount = typeArgumentCount;\n\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget { return identifier; }\n\t\t}\n\t\t\n\t\tpublic int TypeArgumentCount {\n\t\t\tget { return typeArgumentCount; }\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} {1}]\", GetType().Name, identifier);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TextLocation.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.ComponentModel;\nusing System.Globalization;\n\nnamespace ICSharpCode.NRefactory\n{\n\t/// <summary>\n\t/// A line/column position.\n\t/// Text editor lines/columns are counted started from one.\n\t/// </summary>\n\t/// <remarks>\n\t/// The document provides the methods <see cref=\"Editor.IDocument.GetLocation\"/> and\n\t/// <see cref=\"Editor.IDocument.GetOffset(TextLocation)\"/> to convert between offsets and TextLocations.\n\t/// </remarks>\n\t[Serializable]\n\t[TypeConverter(typeof(TextLocationConverter))]\n\tpublic struct TextLocation : IComparable<TextLocation>, IEquatable<TextLocation>\n\t{\n\t\t/// <summary>\n\t\t/// Represents no text location (0, 0).\n\t\t/// </summary>\n\t\tpublic static readonly TextLocation Empty = new TextLocation(0, 0);\n\t\t\n\t\t/// <summary>\n\t\t/// Constant of the minimum line.\n\t\t/// </summary>\n\t\tpublic const int MinLine   = 1;\n\t\t\n\t\t/// <summary>\n\t\t/// Constant of the minimum column.\n\t\t/// </summary>\n\t\tpublic const int MinColumn = 1;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a TextLocation instance.\n\t\t/// </summary>\n\t\tpublic TextLocation(int line, int column)\n\t\t{\n\t\t\tthis.line = line;\n\t\t\tthis.column = column;\n\t\t}\n\t\t\n\t\tint column, line;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the line number.\n\t\t/// </summary>\n\t\tpublic int Line {\n\t\t\tget { return line; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the column number.\n\t\t/// </summary>\n\t\tpublic int Column {\n\t\t\tget { return column; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the TextLocation instance is empty.\n\t\t/// </summary>\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn column < MinLine && line < MinColumn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a string representation for debugging purposes.\n\t\t/// </summary>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"(Line {1}, Col {0})\", this.column, this.line);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a hash code.\n\t\t/// </summary>\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn unchecked (191 * column.GetHashCode() ^ line.GetHashCode());\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Equality test.\n\t\t/// </summary>\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (!(obj is TextLocation)) return false;\n\t\t\treturn (TextLocation)obj == this;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Equality test.\n\t\t/// </summary>\n\t\tpublic bool Equals(TextLocation other)\n\t\t{\n\t\t\treturn this == other;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Equality test.\n\t\t/// </summary>\n\t\tpublic static bool operator ==(TextLocation left, TextLocation right)\n\t\t{\n\t\t\treturn left.column == right.column && left.line == right.line;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Inequality test.\n\t\t/// </summary>\n\t\tpublic static bool operator !=(TextLocation left, TextLocation right)\n\t\t{\n\t\t\treturn left.column != right.column || left.line != right.line;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Compares two text locations.\n\t\t/// </summary>\n\t\tpublic static bool operator <(TextLocation left, TextLocation right)\n\t\t{\n\t\t\tif (left.line < right.line)\n\t\t\t\treturn true;\n\t\t\telse if (left.line == right.line)\n\t\t\t\treturn left.column < right.column;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Compares two text locations.\n\t\t/// </summary>\n\t\tpublic static bool operator >(TextLocation left, TextLocation right)\n\t\t{\n\t\t\tif (left.line > right.line)\n\t\t\t\treturn true;\n\t\t\telse if (left.line == right.line)\n\t\t\t\treturn left.column > right.column;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Compares two text locations.\n\t\t/// </summary>\n\t\tpublic static bool operator <=(TextLocation left, TextLocation right)\n\t\t{\n\t\t\treturn !(left > right);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Compares two text locations.\n\t\t/// </summary>\n\t\tpublic static bool operator >=(TextLocation left, TextLocation right)\n\t\t{\n\t\t\treturn !(left < right);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Compares two text locations.\n\t\t/// </summary>\n\t\tpublic int CompareTo(TextLocation other)\n\t\t{\n\t\t\tif (this == other)\n\t\t\t\treturn 0;\n\t\t\tif (this < other)\n\t\t\t\treturn -1;\n\t\t\telse\n\t\t\t\treturn 1;\n\t\t}\n\t}\n\t\n\tpublic class TextLocationConverter : TypeConverter\n\t{\n\t\tpublic override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)\n\t\t{\n\t\t\treturn sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);\n\t\t}\n\t\t\n\t\tpublic override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)\n\t\t{\n\t\t\treturn destinationType == typeof(TextLocation) || base.CanConvertTo(context, destinationType);\n\t\t}\n\t\t\n\t\tpublic override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)\n\t\t{\n\t\t\tif (value is string) {\n\t\t\t\tstring[] parts = ((string)value).Split(';', ',');\n\t\t\t\tif (parts.Length == 2) {\n\t\t\t\t\treturn new TextLocation(int.Parse(parts[0]), int.Parse(parts[1]));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn base.ConvertFrom(context, culture, value);\n\t\t}\n\t\t\n\t\tpublic override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)\n\t\t{\n\t\t\tif (value is TextLocation) {\n\t\t\t\tvar loc = (TextLocation)value;\n\t\t\t\treturn loc.Line + \";\" + loc.Column;\n\t\t\t}\n\t\t\treturn base.ConvertTo(context, culture, value, destinationType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Accessibility.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Enum that describes the accessibility of an entity.\n\t/// </summary>\n\tpublic enum Accessibility : byte\n\t{\n\t\t// note: some code depends on the fact that these values are within the range 0-7\n\t\t\n\t\t/// <summary>\n\t\t/// The entity is completely inaccessible. This is used for C# explicit interface implementations.\n\t\t/// </summary>\n\t\tNone,\n\t\t/// <summary>\n\t\t/// The entity is only accessible within the same class.\n\t\t/// </summary>\n\t\tPrivate,\n\t\t/// <summary>\n\t\t/// The entity is accessible everywhere.\n\t\t/// </summary>\n\t\tPublic,\n\t\t/// <summary>\n\t\t/// The entity is only accessible within the same class and in derived classes.\n\t\t/// </summary>\n\t\tProtected,\n\t\t/// <summary>\n\t\t/// The entity is accessible within the same project content.\n\t\t/// </summary>\n\t\tInternal,\n\t\t/// <summary>\n\t\t/// The entity is accessible both everywhere in the project content, and in all derived classes.\n\t\t/// </summary>\n\t\t/// <remarks>This corresponds to C# 'protected internal'.</remarks>\n\t\tProtectedOrInternal,\n\t\t/// <summary>\n\t\t/// The entity is accessible in derived classes within the same project content.\n\t\t/// </summary>\n\t\t/// <remarks>C# does not support this accessibility.</remarks>\n\t\tProtectedAndInternal,\n\t}\n\t\n\tpublic interface IHasAccessibility\n\t{\n\t\t/// <summary>\n\t\t/// Gets the accessibility of this entity.\n\t\t/// </summary>\n\t\tAccessibility Accessibility { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance is private.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if this instance is private; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tbool IsPrivate { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance is public.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if this instance is public; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tbool IsPublic { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance is protected.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if this instance is protected; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tbool IsProtected { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance is internal.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if this instance is internal; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tbool IsInternal { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance is protected or internal.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if this instance is protected or internal; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tbool IsProtectedOrInternal { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance is protected and internal.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if this instance is protected and internal; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tbool IsProtectedAndInternal { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/AnonymousType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Anonymous type.\n\t/// </summary>\n\tpublic class AnonymousType : AbstractType\n\t{\n\t\tICompilation compilation;\n\t\tIUnresolvedProperty[] unresolvedProperties;\n\t\tIList<IProperty> resolvedProperties;\n\t\t\n\t\tpublic AnonymousType(ICompilation compilation, IList<IUnresolvedProperty> properties)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (properties == null)\n\t\t\t\tthrow new ArgumentNullException(\"properties\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.unresolvedProperties = properties.ToArray();\n\t\t\tvar context = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\tthis.resolvedProperties = new ProjectedList<ITypeResolveContext, IUnresolvedProperty, IProperty>(context, unresolvedProperties, (c, p) => new AnonymousTypeProperty(p, c, this));\n\t\t}\n\t\t\n\t\tsealed class AnonymousTypeProperty : DefaultResolvedProperty\n\t\t{\n\t\t\treadonly AnonymousType declaringType;\n\t\t\t\n\t\t\tpublic AnonymousTypeProperty(IUnresolvedProperty unresolved, ITypeResolveContext parentContext, AnonymousType declaringType)\n\t\t\t\t: base(unresolved, parentContext)\n\t\t\t{\n\t\t\t\tthis.declaringType = declaringType;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType DeclaringType {\n\t\t\t\tget { return declaringType; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tAnonymousTypeProperty p = obj as AnonymousTypeProperty;\n\t\t\t\treturn p != null && this.Name == p.Name && declaringType.Equals(p.declaringType);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn declaringType.GetHashCode() ^ unchecked(27 * this.Name.GetHashCode());\n\t\t\t}\n\t\t\t\n\t\t\tprotected override IMethod CreateResolvedAccessor(IUnresolvedMethod unresolvedAccessor)\n\t\t\t{\n\t\t\t\treturn new AnonymousTypeAccessor(unresolvedAccessor, context, this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class AnonymousTypeAccessor : DefaultResolvedMethod\n\t\t{\n\t\t\treadonly AnonymousTypeProperty owner;\n\t\t\t\n\t\t\tpublic AnonymousTypeAccessor(IUnresolvedMethod unresolved, ITypeResolveContext parentContext, AnonymousTypeProperty owner)\n\t\t\t\t: base(unresolved, parentContext, isExtensionMethod: false)\n\t\t\t{\n\t\t\t\tthis.owner = owner;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IMember AccessorOwner {\n\t\t\t\tget { return owner; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType DeclaringType {\n\t\t\t\tget { return owner.DeclaringType; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tAnonymousTypeAccessor p = obj as AnonymousTypeAccessor;\n\t\t\t\treturn p != null && this.Name == p.Name && owner.DeclaringType.Equals(p.owner.DeclaringType);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn owner.DeclaringType.GetHashCode() ^ unchecked(27 * this.Name.GetHashCode());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn new AnonymousTypeReference(unresolvedProperties);\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget { return \"Anonymous Type\"; }\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.Anonymous; }\n\t\t}\n\n\t\tpublic override IEnumerable<IType> DirectBaseTypes {\n\t\t\tget {\n\t\t\t\tyield return compilation.FindType(KnownTypeCode.Object);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tpublic IList<IProperty> Properties {\n\t\t\tget { return resolvedProperties; }\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Object).GetMethods(filter, options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Object).GetMethods(typeArguments, filter, options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tfor (int i = 0; i < unresolvedProperties.Length; i++) {\n\t\t\t\tif (filter == null || filter(unresolvedProperties[i]))\n\t\t\t\t\tyield return resolvedProperties[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\tfor (int i = 0; i < unresolvedProperties.Length; i++) {\n\t\t\t\tif (unresolvedProperties[i].CanGet) {\n\t\t\t\t\tif (filter == null || filter(unresolvedProperties[i].Getter))\n\t\t\t\t\t\tyield return resolvedProperties[i].Getter;\n\t\t\t\t}\n\t\t\t\tif (unresolvedProperties[i].CanSet) {\n\t\t\t\t\tif (filter == null || filter(unresolvedProperties[i].Setter))\n\t\t\t\t\t\tyield return resolvedProperties[i].Setter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hashCode = resolvedProperties.Count;\n\t\t\t\tforeach (var p in resolvedProperties) {\n\t\t\t\t\thashCode *= 31;\n\t\t\t\t\thashCode += p.Name.GetHashCode() ^ p.ReturnType.GetHashCode();\n\t\t\t\t}\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool Equals(IType other)\n\t\t{\n\t\t\tAnonymousType o = other as AnonymousType;\n\t\t\tif (o == null || resolvedProperties.Count != o.resolvedProperties.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < resolvedProperties.Count; i++) {\n\t\t\t\tIProperty p1 = resolvedProperties[i];\n\t\t\t\tIProperty p2 = o.resolvedProperties[i];\n\t\t\t\tif (p1.Name != p2.Name || !p1.ReturnType.Equals(p2.ReturnType))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Anonymous type reference.\n\t/// </summary>\n\t[Serializable]\n\tpublic class AnonymousTypeReference : ITypeReference\n\t{\n\t\treadonly IUnresolvedProperty[] unresolvedProperties;\n\t\t\n\t\tpublic AnonymousTypeReference(IUnresolvedProperty[] properties)\n\t\t{\n\t\t\tif (properties == null)\n\t\t\t\tthrow new ArgumentNullException(\"properties\");\n\t\t\tthis.unresolvedProperties = properties;\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new AnonymousType(context.Compilation, unresolvedProperties);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ArrayType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an array type.\n\t/// </summary>\n\tpublic sealed class ArrayType : TypeWithElementType, ICompilationProvider\n\t{\n\t\treadonly int dimensions;\n\t\treadonly ICompilation compilation;\n\t\t\n\t\tpublic ArrayType(ICompilation compilation, IType elementType, int dimensions = 1) : base(elementType)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (dimensions <= 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"dimensions\", dimensions, \"dimensions must be positive\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.dimensions = dimensions;\n\t\t\t\n\t\t\tICompilationProvider p = elementType as ICompilationProvider;\n\t\t\tif (p != null && p.Compilation != compilation)\n\t\t\t\tthrow new InvalidOperationException(\"Cannot create an array type using a different compilation from the element type.\");\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.Array; }\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return compilation; }\n\t\t}\n\t\t\n\t\tpublic int Dimensions {\n\t\t\tget { return dimensions; }\n\t\t}\n\t\t\n\t\tpublic override string NameSuffix {\n\t\t\tget {\n\t\t\t\treturn \"[\" + new string(',', dimensions-1) + \"]\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn unchecked(elementType.GetHashCode() * 71681 + dimensions);\n\t\t}\n\t\t\n\t\tpublic override bool Equals(IType other)\n\t\t{\n\t\t\tArrayType a = other as ArrayType;\n\t\t\treturn a != null && elementType.Equals(a.elementType) && a.dimensions == dimensions;\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn new ArrayTypeReference(elementType.ToTypeReference(), dimensions);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IType> DirectBaseTypes {\n\t\t\tget {\n\t\t\t\tList<IType> baseTypes = new List<IType>();\n\t\t\t\tIType t = compilation.FindType(KnownTypeCode.Array);\n\t\t\t\tif (t.Kind != TypeKind.Unknown)\n\t\t\t\t\tbaseTypes.Add(t);\n\t\t\t\tif (dimensions == 1 && elementType.Kind != TypeKind.Pointer) {\n\t\t\t\t\t// single-dimensional arrays implement IList<T>\n\t\t\t\t\tITypeDefinition def = compilation.FindType(KnownTypeCode.IListOfT) as ITypeDefinition;\n\t\t\t\t\tif (def != null)\n\t\t\t\t\t\tbaseTypes.Add(new ParameterizedType(def, new[] { elementType }));\n\t\t\t\t\t// And in .NET 4.5 they also implement IReadOnlyList<T>\n\t\t\t\t\tdef = compilation.FindType(KnownTypeCode.IReadOnlyListOfT) as ITypeDefinition;\n\t\t\t\t\tif (def != null)\n\t\t\t\t\t\tbaseTypes.Add(new ParameterizedType(def, new[] { elementType }));\n\t\t\t\t}\n\t\t\t\treturn baseTypes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Array).GetMethods(filter, options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Array).GetMethods(typeArguments, filter, options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Array).GetAccessors(filter, options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IProperty>.Instance;\n\t\t\telse\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Array).GetProperties(filter, options);\n\t\t}\n\t\t\n\t\t// NestedTypes, Events, Fields: System.Array doesn't have any; so we can use the AbstractType default implementation\n\t\t// that simply returns an empty list\n\t\t\n\t\tpublic override IType AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitArrayType(this);\n\t\t}\n\t\t\n\t\tpublic override IType VisitChildren(TypeVisitor visitor)\n\t\t{\n\t\t\tIType e = elementType.AcceptVisitor(visitor);\n\t\t\tif (e == elementType)\n\t\t\t\treturn this;\n\t\t\telse\n\t\t\t\treturn new ArrayType(compilation, e, dimensions);\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ArrayTypeReference : ITypeReference, ISupportsInterning\n\t{\n\t\treadonly ITypeReference elementType;\n\t\treadonly int dimensions;\n\t\t\n\t\tpublic ArrayTypeReference(ITypeReference elementType, int dimensions = 1)\n\t\t{\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\tif (dimensions <= 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"dimensions\", dimensions, \"dimensions must be positive\");\n\t\t\tthis.elementType = elementType;\n\t\t\tthis.dimensions = dimensions;\n\t\t}\n\t\t\n\t\tpublic ITypeReference ElementType {\n\t\t\tget { return elementType; }\n\t\t}\n\t\t\n\t\tpublic int Dimensions {\n\t\t\tget { return dimensions; }\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ArrayType(context.Compilation, elementType.Resolve(context), dimensions);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn elementType.ToString() + \"[\" + new string(',', dimensions - 1) + \"]\";\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn elementType.GetHashCode() ^ dimensions;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tArrayTypeReference o = other as ArrayTypeReference;\n\t\t\treturn o != null && elementType == o.elementType && dimensions == o.dimensions;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/AssemblyLoader.cs",
    "content": "//\n// AssemblyLoader.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Reflection;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic enum AssemblyLoaderBackend {\n\t\tAuto,\n\t\tCecil,\n\t\tIKVM\n\t}\n\n\tpublic abstract class AssemblyLoader\n\t{\n\t\tpublic static AssemblyLoader Create ()\n\t\t{\n\t\t\treturn Create (AssemblyLoaderBackend.Auto);\n\t\t}\n\t\t\n\t\tpublic static AssemblyLoader Create (AssemblyLoaderBackend backend)\n\t\t{\n\t\t\tswitch (backend) {\n\t\t\t\tcase AssemblyLoaderBackend.Auto:\n\t\t\t\tcase AssemblyLoaderBackend.Cecil:\n\t\t\t\t\treturn (AssemblyLoader)Assembly.Load (\"ICSharpCode.NRefactory.Cecil\").CreateInstance (\"ICSharpCode.NRefactory.TypeSystem.CecilLoader\");\n\t\t\t\tcase AssemblyLoaderBackend.IKVM:\n\t\t\t\t\treturn (AssemblyLoader)Assembly.Load (\"ICSharpCode.NRefactory.IKVM\").CreateInstance (\"ICSharpCode.NRefactory.TypeSystem.IkvmLoader\");\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException ();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Specifies whether to include internal members. The default is false.\n\t\t/// </summary>\n\t\tpublic bool IncludeInternalMembers { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the cancellation token used by the assembly loader.\n\t\t/// </summary>\n\t\tpublic CancellationToken CancellationToken { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the documentation provider that is used to retrieve the XML documentation for all members.\n\t\t/// </summary>\n\t\tpublic IDocumentationProvider DocumentationProvider { get; set; }\n\n\t\t[CLSCompliant(false)]\n\t\tprotected InterningProvider interningProvider = new SimpleInterningProvider();\n\n\t\t/// <summary>\n\t\t/// Gets/Sets the interning provider.\n\t\t/// </summary>\n\t\tpublic InterningProvider InterningProvider {\n\t\t\tget { return interningProvider; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\tinterningProvider = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic abstract IUnresolvedAssembly LoadAssemblyFile(string fileName);\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/AssemblyQualifiedTypeName.cs",
    "content": "﻿// Copyright (c) 2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic struct AssemblyQualifiedTypeName : IEquatable<AssemblyQualifiedTypeName>\n\t{\n\t\tpublic readonly string AssemblyName;\n\t\tpublic readonly FullTypeName TypeName;\n\t\t\n\t\tpublic AssemblyQualifiedTypeName(FullTypeName typeName, string assemblyName)\n\t\t{\n\t\t\tthis.AssemblyName = assemblyName;\n\t\t\tthis.TypeName = typeName;\n\t\t}\n\t\t\n\t\tpublic AssemblyQualifiedTypeName(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tthis.AssemblyName = typeDefinition.ParentAssembly.AssemblyName;\n\t\t\tthis.TypeName = typeDefinition.FullTypeName;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(AssemblyName))\n\t\t\t\treturn TypeName.ToString();\n\t\t\telse\n\t\t\t\treturn TypeName.ToString() + \", \" + AssemblyName;\n\t\t}\n\t\t\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn (obj is AssemblyQualifiedTypeName) && Equals((AssemblyQualifiedTypeName)obj);\n\t\t}\n\t\t\n\t\tpublic bool Equals(AssemblyQualifiedTypeName other)\n\t\t{\n\t\t\treturn this.AssemblyName == other.AssemblyName && this.TypeName == other.TypeName;\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tint hashCode = 0;\n\t\t\tunchecked {\n\t\t\t\tif (AssemblyName != null)\n\t\t\t\t\thashCode += 1000000007 * AssemblyName.GetHashCode();\n\t\t\t\thashCode += TypeName.GetHashCode();\n\t\t\t}\n\t\t\treturn hashCode;\n\t\t}\n\t\t\n\t\tpublic static bool operator ==(AssemblyQualifiedTypeName lhs, AssemblyQualifiedTypeName rhs)\n\t\t{\n\t\t\treturn lhs.Equals(rhs);\n\t\t}\n\t\t\n\t\tpublic static bool operator !=(AssemblyQualifiedTypeName lhs, AssemblyQualifiedTypeName rhs)\n\t\t{\n\t\t\treturn !lhs.Equals(rhs);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ByReferenceType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic sealed class ByReferenceType : TypeWithElementType\n\t{\n\t\tpublic ByReferenceType(IType elementType) : base(elementType)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.ByReference; }\n\t\t}\n\t\t\n\t\tpublic override string NameSuffix {\n\t\t\tget {\n\t\t\t\treturn \"&\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn elementType.GetHashCode() ^ 91725813;\n\t\t}\n\t\t\n\t\tpublic override bool Equals(IType other)\n\t\t{\n\t\t\tByReferenceType a = other as ByReferenceType;\n\t\t\treturn a != null && elementType.Equals(a.elementType);\n\t\t}\n\t\t\n\t\tpublic override IType AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitByReferenceType(this);\n\t\t}\n\t\t\n\t\tpublic override IType VisitChildren(TypeVisitor visitor)\n\t\t{\n\t\t\tIType e = elementType.AcceptVisitor(visitor);\n\t\t\tif (e == elementType)\n\t\t\t\treturn this;\n\t\t\telse\n\t\t\t\treturn new ByReferenceType(e);\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn new ByReferenceTypeReference(elementType.ToTypeReference());\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ByReferenceTypeReference : ITypeReference, ISupportsInterning\n\t{\n\t\treadonly ITypeReference elementType;\n\t\t\n\t\tpublic ByReferenceTypeReference(ITypeReference elementType)\n\t\t{\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\tthis.elementType = elementType;\n\t\t}\n\t\t\n\t\tpublic ITypeReference ElementType {\n\t\t\tget { return elementType; }\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ByReferenceType(elementType.Resolve(context));\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn elementType.ToString() + \"&\";\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn elementType.GetHashCode() ^ 91725814;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tByReferenceTypeReference brt = other as ByReferenceTypeReference;\n\t\t\treturn brt != null && this.elementType == brt.elementType;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ComHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Helper methods for COM.\n\t/// </summary>\n\tpublic static class ComHelper\n\t{\n\t\tstatic bool IsComAttribute(IAttribute attribute, string name)\n\t\t{\n\t\t\treturn attribute.AttributeType.Name == name && attribute.AttributeType.Namespace == \"System.Runtime.InteropServices\";\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the specified type is imported from COM.\n\t\t/// </summary>\n\t\tpublic static bool IsComImport(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\treturn typeDefinition != null\n\t\t\t\t&& typeDefinition.Kind == TypeKind.Interface\n\t\t\t\t&& typeDefinition.Attributes.Any(a => IsComAttribute(a, \"ComImportAttribute\"));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the CoClass of the specified COM interface.\n\t\t/// </summary>\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1709:IdentifiersShouldBeCasedCorrectly\", MessageId = \"Co\",\n\t\t                                                 Justification = \"Consistent with CoClassAttribute\")]\n\t\tpublic static IType GetCoClass(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (typeDefinition == null)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\tvar coClassAttribute = typeDefinition.Attributes.FirstOrDefault(a => IsComAttribute(a, \"CoClassAttribute\"));\n\t\t\tif (coClassAttribute != null && coClassAttribute.PositionalArguments.Count == 1) {\n\t\t\t\tvar rr = coClassAttribute.PositionalArguments[0] as TypeOfResolveResult;\n\t\t\t\tif (rr != null)\n\t\t\t\t\treturn rr.ReferencedType;\n\t\t\t}\n\t\t\treturn SpecialType.UnknownType;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/DefaultSolutionSnapshot.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\n\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Default implementation of ISolutionSnapshot.\n\t/// </summary>\n\tpublic class DefaultSolutionSnapshot : ISolutionSnapshot\n\t{\n\t\treadonly Dictionary<string, IProjectContent> projectDictionary = new Dictionary<string, IProjectContent>(Platform.FileNameComparer);\n\t\tConcurrentDictionary<IProjectContent, ICompilation> dictionary = new ConcurrentDictionary<IProjectContent, ICompilation>();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new DefaultSolutionSnapshot with the specified projects.\n\t\t/// </summary>\n\t\tpublic DefaultSolutionSnapshot(IEnumerable<IProjectContent> projects)\n\t\t{\n\t\t\tforeach (var project in projects) {\n\t\t\t\tif (project.ProjectFileName != null)\n\t\t\t\t\tprojectDictionary.Add(project.ProjectFileName, project);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new DefaultSolutionSnapshot that does not support <see cref=\"ProjectReference\"/>s.\n\t\t/// </summary>\n\t\tpublic DefaultSolutionSnapshot()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic IProjectContent GetProjectContent(string projectFileName)\n\t\t{\n\t\t\tIProjectContent pc;\n\t\t\tlock (projectDictionary) {\n\t\t\t\tif (projectDictionary.TryGetValue(projectFileName, out pc))\n\t\t\t\t\treturn pc;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ICompilation GetCompilation(IProjectContent project)\n\t\t{\n\t\t\tif (project == null)\n\t\t\t\tthrow new ArgumentNullException(\"project\");\n\t\t\treturn dictionary.GetOrAdd(project, p => p.CreateCompilation(this));\n\t\t}\n\t\t\n\t\tpublic void AddCompilation(IProjectContent project, ICompilation compilation)\n\t\t{\n\t\t\tif (project == null)\n\t\t\t\tthrow new ArgumentNullException(\"project\");\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (!dictionary.TryAdd(project, compilation))\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\tif (project.ProjectFileName != null) {\n\t\t\t\tlock (projectDictionary) {\n\t\t\t\t\tprojectDictionary.Add(project.ProjectFileName, project);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/DomRegion.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[Serializable]\n\tpublic struct DomRegion : IEquatable<DomRegion>\n\t{\n\t\treadonly string fileName;\n\t\treadonly int beginLine;\n\t\treadonly int endLine;\n\t\treadonly int beginColumn;\n\t\treadonly int endColumn;\n\t\t\n\t\tpublic readonly static DomRegion Empty = new DomRegion();\n\t\t\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn BeginLine <= 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string FileName {\n\t\t\tget { return fileName; }\n\t\t}\n\t\t\n\t\tpublic int BeginLine {\n\t\t\tget {\n\t\t\t\treturn beginLine;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <value>\n\t\t/// if the end line is == -1 the end column is -1 too\n\t\t/// this stands for an unknwon end\n\t\t/// </value>\n\t\tpublic int EndLine {\n\t\t\tget {\n\t\t\t\treturn endLine;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int BeginColumn {\n\t\t\tget {\n\t\t\t\treturn beginColumn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <value>\n\t\t/// if the end column is == -1 the end line is -1 too\n\t\t/// this stands for an unknown end\n\t\t/// </value>\n\t\tpublic int EndColumn {\n\t\t\tget {\n\t\t\t\treturn endColumn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic TextLocation Begin {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (beginLine, beginColumn);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic TextLocation End {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (endLine, endColumn);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic DomRegion (int beginLine, int beginColumn, int endLine, int endColumn) : this (null, beginLine, beginColumn, endLine, endColumn)\n\t\t{\n\t\t}\n\n\t\tpublic DomRegion(string fileName, int beginLine, int beginColumn, int endLine, int endColumn)\n\t\t{\n\t\t\tthis.fileName = fileName;\n\t\t\tthis.beginLine   = beginLine;\n\t\t\tthis.beginColumn = beginColumn;\n\t\t\tthis.endLine     = endLine;\n\t\t\tthis.endColumn   = endColumn;\n\t\t}\n\t\t\n\t\tpublic DomRegion (int beginLine, int beginColumn) : this (null, beginLine, beginColumn)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DomRegion (string fileName, int beginLine, int beginColumn)\n\t\t{\n\t\t\tthis.fileName = fileName;\n\t\t\tthis.beginLine = beginLine;\n\t\t\tthis.beginColumn = beginColumn;\n\t\t\tthis.endLine = -1;\n\t\t\tthis.endColumn = -1;\n\t\t}\n\t\t\n\t\tpublic DomRegion (TextLocation begin, TextLocation end) : this (null, begin, end)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DomRegion (string fileName, TextLocation begin, TextLocation end)\n\t\t{\n\t\t\tthis.fileName = fileName;\n\t\t\tthis.beginLine = begin.Line;\n\t\t\tthis.beginColumn = begin.Column;\n\t\t\tthis.endLine = end.Line;\n\t\t\tthis.endColumn = end.Column;\n\t\t}\n\t\t\n\t\tpublic DomRegion (TextLocation begin) : this (null, begin)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DomRegion (string fileName, TextLocation begin)\n\t\t{\n\t\t\tthis.fileName = fileName;\n\t\t\tthis.beginLine = begin.Line;\n\t\t\tthis.beginColumn = begin.Column;\n\t\t\tthis.endLine = -1;\n\t\t\tthis.endColumn = -1;\n\t\t}\n\t\t\n\t\t/// <remarks>\n\t\t/// Returns true, if the given coordinates (line, column) are in the region.\n\t\t/// This method assumes that for an unknown end the end line is == -1\n\t\t/// </remarks>\n\t\tpublic bool IsInside(int line, int column)\n\t\t{\n\t\t\tif (IsEmpty)\n\t\t\t\treturn false;\n\t\t\treturn line >= BeginLine &&\n\t\t\t\t(line <= EndLine   || EndLine == -1) &&\n\t\t\t\t(line != BeginLine || column >= BeginColumn) &&\n\t\t\t\t(line != EndLine   || column <= EndColumn);\n\t\t}\n\n\t\tpublic bool IsInside(TextLocation location)\n\t\t{\n\t\t\treturn IsInside(location.Line, location.Column);\n\t\t}\n\n\t\t/// <remarks>\n\t\t/// Returns true, if the given coordinates (line, column) are in the region.\n\t\t/// This method assumes that for an unknown end the end line is == -1\n\t\t/// </remarks>\n\t\tpublic bool Contains(int line, int column)\n\t\t{\n\t\t\tif (IsEmpty)\n\t\t\t\treturn false;\n\t\t\treturn line >= BeginLine &&\n\t\t\t\t(line <= EndLine   || EndLine == -1) &&\n\t\t\t\t(line != BeginLine || column >= BeginColumn) &&\n\t\t\t\t(line != EndLine   || column < EndColumn);\n\t\t}\n\n\t\tpublic bool Contains(TextLocation location)\n\t\t{\n\t\t\treturn Contains(location.Line, location.Column);\n\t\t}\n\n\t\tpublic bool IntersectsWith (DomRegion region)\n\t\t{\n\t\t\treturn region.Begin <= End && region.End >= Begin;\n\t\t}\n\n\t\tpublic bool OverlapsWith (DomRegion region)\n\t\t{\n\t\t\tvar maxBegin = Begin > region.Begin ? Begin : region.Begin;\n\t\t\tvar minEnd = End < region.End ? End : region.End;\n\t\t\treturn maxBegin < minEnd;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\n\t\t\t\tCultureInfo.InvariantCulture,\n\t\t\t\t\"[DomRegion FileName={0}, Begin=({1}, {2}), End=({3}, {4})]\",\n\t\t\t\tfileName, beginLine, beginColumn, endLine, endColumn);\n\t\t}\n\t\t\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is DomRegion && Equals((DomRegion)obj);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hashCode = fileName != null ? fileName.GetHashCode() : 0;\n\t\t\t\thashCode ^= beginColumn + 1100009 * beginLine + 1200007 * endLine + 1300021 * endColumn;\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool Equals(DomRegion other)\n\t\t{\n\t\t\treturn beginLine == other.beginLine && beginColumn == other.beginColumn\n\t\t\t\t&& endLine == other.endLine && endColumn == other.endColumn\n\t\t\t\t&& fileName == other.fileName;\n\t\t}\n\t\t\n\t\tpublic static bool operator ==(DomRegion left, DomRegion right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\t\t\n\t\tpublic static bool operator !=(DomRegion left, DomRegion right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/EntityType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[Obsolete(\"Use SymbolKind instead\")]\n\tpublic enum EntityType : byte\n\t{\n\t\tNone = SymbolKind.None,\n\t\t/// <seealso cref=\"ITypeDefinition\"/>\n\t\tTypeDefinition = SymbolKind.TypeDefinition,\n\t\t/// <seealso cref=\"IField\"/>\n\t\tField = SymbolKind.Field,\n\t\t/// <summary>\n\t\t/// The symbol is a property, but not an indexer.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IProperty\"/>\n\t\tProperty = SymbolKind.Property,\n\t\t/// <summary>\n\t\t/// The symbol is an indexer, not a regular property.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IProperty\"/>\n\t\tIndexer = SymbolKind.Indexer,\n\t\t/// <seealso cref=\"IEvent\"/>\n\t\tEvent = SymbolKind.Event,\n\t\t/// <summary>\n\t\t/// The symbol is a method which is not an operator/constructor/destructor or accessor.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tMethod = SymbolKind.Method,\n\t\t/// <summary>\n\t\t/// The symbol is a user-defined operator.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tOperator = SymbolKind.Operator,\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tConstructor = SymbolKind.Constructor,\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tDestructor = SymbolKind.Destructor,\n\t\t/// <summary>\n\t\t/// The accessor method for a property getter/setter or event add/remove.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tAccessor = SymbolKind.Accessor,\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Error.cs",
    "content": "﻿// \n// Error.cs\n//  \n// Author:\n//       Mike Krüger <mike@icsharpcode.net>\n// \n// Copyright (c) 2011 Mike Krüger <mike@icsharpcode.net>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Enum that describes the type of an error.\n\t/// </summary>\n\tpublic enum ErrorType\n\t{\n\t\tUnknown,\n\t\tError,\n\t\tWarning\n\t}\n\t\n\t/// <summary>\n\t/// Descibes an error during parsing.\n\t/// </summary>\n\t[Serializable]\n\tpublic class Error\n\t{\n\t\treadonly ErrorType errorType;\n\t\treadonly string message;\n\t\treadonly DomRegion region;\n\t\t\n\t\t/// <summary>\n\t\t/// The type of the error.\n\t\t/// </summary>\n\t\tpublic ErrorType ErrorType { get { return errorType; } }\n\t\t\n\t\t/// <summary>\n\t\t/// The error description.\n\t\t/// </summary>\n\t\tpublic string Message { get { return message; } }\n\t\t\n\t\t/// <summary>\n\t\t/// The region of the error.\n\t\t/// </summary>\n\t\tpublic DomRegion Region { get { return region; } }\n\t\t\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.TypeSystem.Error\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='errorType'>\n\t\t/// The error type.\n\t\t/// </param>\n\t\t/// <param name='message'>\n\t\t/// The description of the error.\n\t\t/// </param>\n\t\t/// <param name='region'>\n\t\t/// The region of the error.\n\t\t/// </param>\n\t\tpublic Error (ErrorType errorType, string message, DomRegion region)\n\t\t{\n\t\t\tthis.errorType = errorType;\n\t\t\tthis.message = message;\n\t\t\tthis.region = region;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.TypeSystem.Error\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='errorType'>\n\t\t/// The error type.\n\t\t/// </param>\n\t\t/// <param name='message'>\n\t\t/// The description of the error.\n\t\t/// </param>\n\t\t/// <param name='location'>\n\t\t/// The location of the error.\n\t\t/// </param>\n\t\tpublic Error (ErrorType errorType, string message, TextLocation location)\n\t\t{\n\t\t\tthis.errorType = errorType;\n\t\t\tthis.message = message;\n\t\t\tthis.region = new DomRegion (location, location);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.TypeSystem.Error\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='errorType'>\n\t\t/// The error type.\n\t\t/// </param>\n\t\t/// <param name='message'>\n\t\t/// The description of the error.\n\t\t/// </param>\n\t\t/// <param name='line'>\n\t\t/// The line of the error.\n\t\t/// </param>\n\t\t/// <param name='col'>\n\t\t/// The column of the error.\n\t\t/// </param>\n\t\tpublic Error (ErrorType errorType, string message, int line, int col) : this (errorType, message, new TextLocation (line, col))\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.TypeSystem.Error\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='errorType'>\n\t\t/// The error type.\n\t\t/// </param>\n\t\t/// <param name='message'>\n\t\t/// The description of the error.\n\t\t/// </param>\n\t\tpublic Error (ErrorType errorType, string message)\n\t\t{\n\t\t\tthis.errorType = errorType;\n\t\t\tthis.message = message;\n\t\t\tthis.region = DomRegion.Empty;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/FullTypeName.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Holds the full name of a type definition.\n\t/// A full type name uniquely identifies a type definition within a single assembly.\n\t/// </summary>\n\t/// <remarks>\n\t/// A full type name can only represent type definitions, not arbitrary types.\n\t/// It does not include any type arguments, and can not refer to array or pointer types.\n\t/// \n\t/// A full type name represented as reflection name has the syntax:\n\t/// <c>NamespaceName '.' TopLevelTypeName ['`'#] { '+' NestedTypeName ['`'#] }</c>\n\t/// </remarks>\n\t[Serializable]\n\tpublic struct FullTypeName : IEquatable<FullTypeName>\n\t{\n\t\t[Serializable]\n\t\tstruct NestedTypeName\n\t\t{\n\t\t\tpublic readonly string Name;\n\t\t\tpublic readonly int AdditionalTypeParameterCount;\n\t\t\t\n\t\t\tpublic NestedTypeName(string name, int additionalTypeParameterCount)\n\t\t\t{\n\t\t\t\tif (name == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\t\tthis.Name = name;\n\t\t\t\tthis.AdditionalTypeParameterCount = additionalTypeParameterCount;\n\t\t\t}\n\t\t}\n\t\t\n\t\treadonly TopLevelTypeName topLevelType;\n\t\treadonly NestedTypeName[] nestedTypes;\n\t\t\n\t\tFullTypeName(TopLevelTypeName topLevelTypeName, NestedTypeName[] nestedTypes)\n\t\t{\n\t\t\tthis.topLevelType = topLevelTypeName;\n\t\t\tthis.nestedTypes = nestedTypes;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Constructs a FullTypeName representing the given top-level type.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// FullTypeName has an implicit conversion operator from TopLevelTypeName,\n\t\t/// so you can simply write:\n\t\t/// <c>FullTypeName f = new TopLevelTypeName(...);</c>\n\t\t/// </remarks>\n\t\tpublic FullTypeName(TopLevelTypeName topLevelTypeName)\n\t\t{\n\t\t\tthis.topLevelType = topLevelTypeName;\n\t\t\tthis.nestedTypes = null;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Constructs a FullTypeName by parsing the given reflection name.\n\t\t/// Note that FullTypeName can only represent type definition names. If the reflection name\n\t\t/// might refer to a parameterized type or array etc., use\n\t\t/// <see cref=\"ReflectionHelper.ParseReflectionName(string)\"/> instead.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Expected syntax: <c>NamespaceName '.' TopLevelTypeName ['`'#] { '+' NestedTypeName ['`'#] }</c>\n\t\t/// where # are type parameter counts\n\t\t/// </remarks>\n\t\tpublic FullTypeName(string reflectionName)\n\t\t{\n\t\t\tint pos = reflectionName.IndexOf('+');\n\t\t\tif (pos < 0) {\n\t\t\t\t// top-level type\n\t\t\t\tthis.topLevelType = new TopLevelTypeName(reflectionName);\n\t\t\t\tthis.nestedTypes = null;\n\t\t\t} else {\n\t\t\t\t// nested type\n\t\t\t\tstring[] parts = reflectionName.Split('+');\n\t\t\t\tthis.topLevelType = new TopLevelTypeName(parts[0]);\n\t\t\t\tthis.nestedTypes = new NestedTypeName[parts.Length - 1];\n\t\t\t\tfor (int i = 0; i < nestedTypes.Length; i++) {\n\t\t\t\t\tint tpc;\n\t\t\t\t\tstring name = ReflectionHelper.SplitTypeParameterCountFromReflectionName(parts[i + 1], out tpc);\n\t\t\t\t\tnestedTypes[i] = new NestedTypeName(name, tpc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the top-level type name.\n\t\t/// </summary>\n\t\tpublic TopLevelTypeName TopLevelTypeName {\n\t\t\tget { return topLevelType; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this is a nested type.\n\t\t/// </summary>\n\t\tpublic bool IsNested {\n\t\t\tget {\n\t\t\t\treturn nestedTypes != null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the nesting level.\n\t\t/// </summary>\n\t\tpublic int NestingLevel {\n\t\t\tget {\n\t\t\t\treturn nestedTypes != null ? nestedTypes.Length : 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name of the type.\n\t\t/// For nested types, this is the name of the innermost type.\n\t\t/// </summary>\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\tif (nestedTypes != null)\n\t\t\t\t\treturn nestedTypes[nestedTypes.Length - 1].Name;\n\t\t\t\telse\n\t\t\t\t\treturn topLevelType.Name;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string ReflectionName {\n\t\t\tget {\n\t\t\t\tif (nestedTypes == null)\n\t\t\t\t\treturn topLevelType.ReflectionName;\n\t\t\t\tStringBuilder b = new StringBuilder(topLevelType.ReflectionName);\n\t\t\t\tforeach (NestedTypeName nt in nestedTypes) {\n\t\t\t\t\tb.Append('+');\n\t\t\t\t\tb.Append(nt.Name);\n\t\t\t\t\tif (nt.AdditionalTypeParameterCount > 0) {\n\t\t\t\t\t\tb.Append('`');\n\t\t\t\t\t\tb.Append(nt.AdditionalTypeParameterCount);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn b.ToString();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the total type parameter count.\n\t\t/// </summary>\n\t\tpublic int TypeParameterCount {\n\t\t\tget {\n\t\t\t\tint tpc = topLevelType.TypeParameterCount;\n\t\t\t\tif (nestedTypes != null) {\n\t\t\t\t\tforeach (var nt in nestedTypes) {\n\t\t\t\t\t\ttpc += nt.AdditionalTypeParameterCount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn tpc;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name of the nested type at the given level.\n\t\t/// </summary>\n\t\tpublic string GetNestedTypeName(int nestingLevel)\n\t\t{\n\t\t\tif (nestedTypes == null)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\treturn nestedTypes[nestingLevel].Name;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the number of additional type parameters of the nested type at the given level.\n\t\t/// </summary>\n\t\tpublic int GetNestedTypeAdditionalTypeParameterCount(int nestingLevel)\n\t\t{\n\t\t\tif (nestedTypes == null)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\treturn nestedTypes[nestingLevel].AdditionalTypeParameterCount;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the declaring type name.\n\t\t/// </summary>\n\t\t/// <exception cref=\"InvalidOperationException\">This is a top-level type name.</exception>\n\t\t/// <example><c>new FullTypeName(\"NS.A+B+C\").GetDeclaringType()</c> will return <c>new FullTypeName(\"NS.A+B\")</c></example>\n\t\tpublic FullTypeName GetDeclaringType()\n\t\t{\n\t\t\tif (nestedTypes == null)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\tif (nestedTypes.Length == 1)\n\t\t\t\treturn topLevelType;\n\t\t\tNestedTypeName[] outerNestedTypeNames = new NestedTypeName[nestedTypes.Length - 1];\n\t\t\tArray.Copy(nestedTypes, 0, outerNestedTypeNames, 0, outerNestedTypeNames.Length);\n\t\t\treturn new FullTypeName(topLevelType, nestedTypes);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a nested type name.\n\t\t/// </summary>\n\t\t/// <example><c>new FullTypeName(\"NS.A+B\").NestedType(\"C\", 1)</c> will return <c>new FullTypeName(\"NS.A+B+C`1\")</c></example>\n\t\tpublic FullTypeName NestedType(string name, int additionalTypeParameterCount)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tvar newNestedType = new NestedTypeName(name, additionalTypeParameterCount);\n\t\t\tif (nestedTypes == null)\n\t\t\t\treturn new FullTypeName(topLevelType, new[] { newNestedType });\n\t\t\tNestedTypeName[] newNestedTypeNames = new NestedTypeName[nestedTypes.Length + 1];\n\t\t\tnestedTypes.CopyTo(newNestedTypeNames, 0);\n\t\t\tnewNestedTypeNames[newNestedTypeNames.Length - 1] = newNestedType;\n\t\t\treturn new FullTypeName(topLevelType, newNestedTypeNames);\n\t\t}\n\t\t\n\t\tpublic static implicit operator FullTypeName(TopLevelTypeName topLevelTypeName)\n\t\t{\n\t\t\treturn new FullTypeName(topLevelTypeName);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn this.ReflectionName;\n\t\t}\n\t\t\n\t\t#region Equals and GetHashCode implementation\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is FullTypeName && Equals((FullTypeName)obj);\n\t\t}\n\t\t\n\t\tpublic bool Equals(FullTypeName other)\n\t\t{\n\t\t\treturn FullTypeNameComparer.Ordinal.Equals(this, other);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn FullTypeNameComparer.Ordinal.GetHashCode(this);\n\t\t}\n\t\t\n\t\tpublic static bool operator ==(FullTypeName left, FullTypeName right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\t\t\n\t\tpublic static bool operator !=(FullTypeName left, FullTypeName right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\t\t#endregion\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class FullTypeNameComparer : IEqualityComparer<FullTypeName>\n\t{\n\t\tpublic static readonly FullTypeNameComparer Ordinal = new FullTypeNameComparer(StringComparer.Ordinal);\n\t\tpublic static readonly FullTypeNameComparer OrdinalIgnoreCase = new FullTypeNameComparer(StringComparer.OrdinalIgnoreCase);\n\t\t\n\t\tpublic readonly StringComparer NameComparer;\n\t\t\n\t\tpublic FullTypeNameComparer(StringComparer nameComparer)\n\t\t{\n\t\t\tthis.NameComparer = nameComparer;\n\t\t}\n\t\t\n\t\tpublic bool Equals(FullTypeName x, FullTypeName y)\n\t\t{\n\t\t\tif (x.NestingLevel != y.NestingLevel)\n\t\t\t\treturn false;\n\t\t\tTopLevelTypeName topX = x.TopLevelTypeName;\n\t\t\tTopLevelTypeName topY = y.TopLevelTypeName;\n\t\t\tif (topX.TypeParameterCount == topY.TypeParameterCount\n\t\t\t    && NameComparer.Equals(topX.Name, topY.Name)\n\t\t\t    && NameComparer.Equals(topX.Namespace, topY.Namespace))\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < x.NestingLevel; i++) {\n\t\t\t\t\tif (x.GetNestedTypeAdditionalTypeParameterCount(i) != y.GetNestedTypeAdditionalTypeParameterCount(i))\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tif (!NameComparer.Equals(x.GetNestedTypeName(i), y.GetNestedTypeName(i)))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic int GetHashCode(FullTypeName obj)\n\t\t{\n\t\t\tTopLevelTypeName top = obj.TopLevelTypeName;\n\t\t\tint hash = NameComparer.GetHashCode(top.Name) ^ NameComparer.GetHashCode(top.Namespace) ^ top.TypeParameterCount;\n\t\t\tunchecked {\n\t\t\t\tfor (int i = 0; i < obj.NestingLevel; i++) {\n\t\t\t\t\thash *= 31;\n\t\t\t\t\thash += NameComparer.GetHashCode(obj.Name) ^ obj.TypeParameterCount;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hash;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAmbience.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[Flags]\n\tpublic enum ConversionFlags\n\t{\n\t\t/// <summary>\n\t\t/// Convert only the name.\n\t\t/// </summary>\n\t\tNone = 0,\n\t\t/// <summary>\n\t\t/// Show the parameter list\n\t\t/// </summary>\n\t\tShowParameterList      = 1,\n\t\t/// <summary>\n\t\t/// Show names for parameters\n\t\t/// </summary>\n\t\tShowParameterNames     = 2,\n\t\t/// <summary>\n\t\t/// Show the accessibility (private, public, etc.)\n\t\t/// </summary>\n\t\tShowAccessibility      = 4,\n\t\t/// <summary>\n\t\t/// Show the definition key word (class, struct, Sub, Function, etc.)\n\t\t/// </summary>\n\t\tShowDefinitionKeyword  = 8,\n\t\t/// <summary>\n\t\t/// Show the declaring type for the member\n\t\t/// </summary>\n\t\tShowDeclaringType = 0x10,\n\t\t/// <summary>\n\t\t/// Show modifiers (virtual, override, etc.)\n\t\t/// </summary>\n\t\tShowModifiers          = 0x20,\n\t\t/// <summary>\n\t\t/// Show the return type\n\t\t/// </summary>\n\t\tShowReturnType = 0x40,\n\t\t/// <summary>\n\t\t/// Use fully qualified names for types.\n\t\t/// </summary>\n\t\tUseFullyQualifiedTypeNames = 0x80,\n\t\t/// <summary>\n\t\t/// Show the list of type parameters on method and class declarations.\n\t\t/// Type arguments for parameter/return types are always shown.\n\t\t/// </summary>\n\t\tShowTypeParameterList = 0x100,\n\t\t/// <summary>\n\t\t/// For fields, events and methods: adds a semicolon at the end.\n\t\t/// For properties: shows \"{ get; }\" or similar.\n\t\t/// </summary>\n\t\tShowBody = 0x200,\n\t\t\n\t\t/// <summary>\n\t\t/// Use fully qualified names for members.\n\t\t/// </summary>\n\t\tUseFullyQualifiedEntityNames = 0x400,\n\t\t\n\t\tStandardConversionFlags = ShowParameterNames |\n\t\t\tShowAccessibility |\n\t\t\tShowParameterList |\n\t\t\tShowReturnType |\n\t\t\tShowModifiers |\n\t\t\tShowTypeParameterList |\n\t\t\tShowDefinitionKeyword |\n\t\t\tShowBody,\n\t\t\n\t\tAll = 0x7ff,\n\t}\n\t\n\t/// <summary>\n\t/// Ambiences are used to convert type system symbols to text (usually for displaying the symbol to the user; e.g. in editor tooltips).\n\t/// </summary>\n\tpublic interface IAmbience\n\t{\n\t\tConversionFlags ConversionFlags { get; set; }\n\t\t\n\t\t[Obsolete(\"Use ConvertSymbol() instead\")]\n\t\tstring ConvertEntity(IEntity entity);\n\t\tstring ConvertSymbol(ISymbol symbol);\n\t\tstring ConvertType(IType type);\n\t\t[Obsolete(\"Use ConvertSymbol() instead\")]\n\t\tstring ConvertVariable(IVariable variable);\n\t\tstring ConvertConstantValue(object constantValue);\n\t\t\n\t\tstring WrapComment(string comment);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAssembly.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an unresolved assembly.\n\t/// </summary>\n\tpublic interface IUnresolvedAssembly : IAssemblyReference\n\t{\n\t\t/// <summary>\n\t\t/// Gets the assembly name (short name).\n\t\t/// </summary>\n\t\tstring AssemblyName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the full assembly name (including public key token etc.)\n\t\t/// </summary>\n\t\tstring FullAssemblyName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the path to the assembly location. \n\t\t/// For projects it is the same as the output path.\n\t\t/// </summary>\n\t\tstring Location { get; }\n\n\t\t/// <summary>\n\t\t/// Gets the list of all assembly attributes in the project.\n\t\t/// </summary>\n\t\tIEnumerable<IUnresolvedAttribute> AssemblyAttributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of all module attributes in the project.\n\t\t/// </summary>\n\t\tIEnumerable<IUnresolvedAttribute> ModuleAttributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all non-nested types in the assembly.\n\t\t/// </summary>\n\t\tIEnumerable<IUnresolvedTypeDefinition> TopLevelTypeDefinitions { get; }\n\t}\n\t\n\tpublic interface IAssemblyReference\n\t{\n\t\t/// <summary>\n\t\t/// Resolves this assembly.\n\t\t/// </summary>\n\t\tIAssembly Resolve(ITypeResolveContext context);\n\t}\n\t\n\t/// <summary>\n\t/// Represents an assembly.\n\t/// </summary>\n\tpublic interface IAssembly : ICompilationProvider\n\t{\n\t\t/// <summary>\n\t\t/// Gets the original unresolved assembly.\n\t\t/// </summary>\n\t\tIUnresolvedAssembly UnresolvedAssembly { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this assembly is the main assembly of the compilation.\n\t\t/// </summary>\n\t\tbool IsMainAssembly { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the assembly name (short name).\n\t\t/// </summary>\n\t\tstring AssemblyName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the full assembly name (including public key token etc.)\n\t\t/// </summary>\n\t\tstring FullAssemblyName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of all assembly attributes in the project.\n\t\t/// </summary>\n\t\tIList<IAttribute> AssemblyAttributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of all module attributes in the project.\n\t\t/// </summary>\n\t\tIList<IAttribute> ModuleAttributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the internals of this assembly are visible in the specified assembly.\n\t\t/// </summary>\n\t\tbool InternalsVisibleTo(IAssembly assembly);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the root namespace for this assembly.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This always is the namespace without a name - it's unrelated to the 'root namespace' project setting.\n\t\t/// </remarks>\n\t\tINamespace RootNamespace { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type definition for a top-level type.\n\t\t/// </summary>\n\t\t/// <remarks>This method uses ordinal name comparison, not the compilation's name comparer.</remarks>\n\t\tITypeDefinition GetTypeDefinition(TopLevelTypeName topLevelTypeName);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all non-nested types in the assembly.\n\t\t/// </summary>\n\t\tIEnumerable<ITypeDefinition> TopLevelTypeDefinitions { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAttribute.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an unresolved attribute.\n\t/// </summary>\n\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n\tpublic interface IUnresolvedAttribute\n\t{\n\t\t/// <summary>\n\t\t/// Gets the code region of this attribute.\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the attribute.\n\t\t/// </summary>\n\t\tIAttribute CreateResolvedAttribute(ITypeResolveContext context);\n\t}\n\t\n\t/// <summary>\n\t/// Represents an attribute.\n\t/// </summary>\n\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n\tpublic interface IAttribute\n\t{\n\t\t/// <summary>\n\t\t/// Gets the code region of this attribute.\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type of the attribute.\n\t\t/// </summary>\n\t\tIType AttributeType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the constructor being used.\n\t\t/// This property may return null if no matching constructor was found.\n\t\t/// </summary>\n\t\tIMethod Constructor { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the positional arguments.\n\t\t/// </summary>\n\t\tIList<ResolveResult> PositionalArguments { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the named arguments passed to the attribute.\n\t\t/// </summary>\n\t\tIList<KeyValuePair<IMember, ResolveResult>> NamedArguments { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ICodeContext.cs",
    "content": "﻿// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic interface ICodeContext : ITypeResolveContext\n\t{\n\t\t/// <summary>\n\t\t/// Gets all currently visible local variables and lambda parameters.\n\t\t/// Does not include method parameters.\n\t\t/// </summary>\n\t\tIEnumerable<IVariable> LocalVariables { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the context is within a lambda expression or anonymous method.\n\t\t/// </summary>\n\t\tbool IsWithinLambdaExpression { get; }\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ICompilation.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic interface ICompilation\n\t{\n\t\t/// <summary>\n\t\t/// Gets the current assembly.\n\t\t/// </summary>\n\t\tIAssembly MainAssembly { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type resolve context that specifies this compilation and no current assembly or entity.\n\t\t/// </summary>\n\t\tITypeResolveContext TypeResolveContext { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of all assemblies in the compilation.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This main assembly is the first entry in the list.\n\t\t/// </remarks>\n\t\tIList<IAssembly> Assemblies { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the referenced assemblies.\n\t\t/// This list does not include the main assembly.\n\t\t/// </summary>\n\t\tIList<IAssembly> ReferencedAssemblies { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the root namespace of this compilation.\n\t\t/// This is a merged version of the root namespaces of all assemblies.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This always is the namespace without a name - it's unrelated to the 'root namespace' project setting.\n\t\t/// </remarks>\n\t\tINamespace RootNamespace { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the root namespace for a given extern alias.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// If <paramref name=\"alias\"/> is <c>null</c> or an empty string, this method\n\t\t/// returns the global root namespace.\n\t\t/// If no alias with the specified name exists, this method returns null.\n\t\t/// </remarks>\n\t\tINamespace GetNamespaceForExternAlias(string alias);\n\t\t\n\t\tIType FindType(KnownTypeCode typeCode);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name comparer for the language being compiled.\n\t\t/// This is the string comparer used for the INamespace.GetTypeDefinition method.\n\t\t/// </summary>\n\t\tStringComparer NameComparer { get; }\n\t\t\n\t\tISolutionSnapshot SolutionSnapshot { get; }\n\t\t\n\t\tCacheManager CacheManager { get; }\n\t}\n\t\n\tpublic interface ICompilationProvider\n\t{\n\t\t/// <summary>\n\t\t/// Gets the parent compilation.\n\t\t/// This property never returns null.\n\t\t/// </summary>\n\t\tICompilation Compilation { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IConstantValue.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics.Contracts;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an unresolved constant value.\n\t/// </summary>\n\tpublic interface IConstantValue\n\t{\n\t\t/// <summary>\n\t\t/// Resolves the value of this constant.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">Context where the constant value will be used.</param>\n\t\t/// <returns>Resolve result representing the constant value.\n\t\t/// This method never returns null; in case of errors, an ErrorResolveResult will be returned.</returns>\n\t\tResolveResult Resolve(ITypeResolveContext context);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IEntity.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\nusing ICSharpCode.NRefactory.Documentation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an unresolved entity.\n\t/// </summary>\n\tpublic interface IUnresolvedEntity : INamedElement, IHasAccessibility\n\t{\n\t\t/// <summary>\n\t\t/// Gets the entity type.\n\t\t/// </summary>\n\t\tSymbolKind SymbolKind { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the complete entity region (including header+body)\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the entity body region.\n\t\t/// </summary>\n\t\tDomRegion BodyRegion { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the declaring class.\n\t\t/// For members, this is the class that contains the member.\n\t\t/// For nested classes, this is the outer class. For top-level entities, this property returns null.\n\t\t/// </summary>\n\t\tIUnresolvedTypeDefinition DeclaringTypeDefinition { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the parsed file in which this entity is defined.\n\t\t/// Returns null if this entity wasn't parsed from source code (e.g. loaded from a .dll with CecilLoader).\n\t\t/// </summary>\n\t\tIUnresolvedFile UnresolvedFile { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attributes on this entity.\n\t\t/// </summary>\n\t\tIList<IUnresolvedAttribute> Attributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this entity is static.\n\t\t/// Returns true if either the 'static' or the 'const' modifier is set.\n\t\t/// </summary>\n\t\tbool IsStatic { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Returns whether this entity is abstract.\n\t\t/// </summary>\n\t\t/// <remarks>Static classes also count as abstract classes.</remarks>\n\t\tbool IsAbstract { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Returns whether this entity is sealed.\n\t\t/// </summary>\n\t\t/// <remarks>Static classes also count as sealed classes.</remarks>\n\t\tbool IsSealed { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is declared to be shadowing another member with the same name.\n\t\t/// </summary>\n\t\tbool IsShadowing { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is generated by a macro/compiler feature.\n\t\t/// </summary>\n\t\tbool IsSynthetic { get; }\n\t}\n\t\n\t/// <summary>\n\t/// Represents a resolved entity.\n\t/// </summary>\n\tpublic interface IEntity : ISymbol, ICompilationProvider, INamedElement, IHasAccessibility\n\t{\n\t\t/// <summary>\n\t\t/// Gets the entity type.\n\t\t/// </summary>\n\t\t[Obsolete(\"Use the SymbolKind property instead.\")]\n\t\tEntityType EntityType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the short name of the entity.\n\t\t/// </summary>\n\t\tnew string Name { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the complete entity region (including header+body)\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the entity body region.\n\t\t/// </summary>\n\t\tDomRegion BodyRegion { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the declaring class.\n\t\t/// For members, this is the class that contains the member.\n\t\t/// For nested classes, this is the outer class. For top-level entities, this property returns null.\n\t\t/// </summary>\n\t\tITypeDefinition DeclaringTypeDefinition { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the declaring type (incl. type arguments, if any).\n\t\t/// This property never returns null -- for top-level entities, it returns SharedTypes.UnknownType.\n\t\t/// If this is not a specialized member, the value returned is equal to <see cref=\"DeclaringTypeDefinition\"/>.\n\t\t/// </summary>\n\t\tIType DeclaringType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// The assembly in which this entity is defined.\n\t\t/// This property never returns null.\n\t\t/// </summary>\n\t\tIAssembly ParentAssembly { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attributes on this entity.\n\t\t/// </summary>\n\t\tIList<IAttribute> Attributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the documentation for this entity.\n\t\t/// </summary>\n\t\tDocumentationComment Documentation { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this entity is static.\n\t\t/// Returns true if either the 'static' or the 'const' modifier is set.\n\t\t/// </summary>\n\t\tbool IsStatic { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Returns whether this entity is abstract.\n\t\t/// </summary>\n\t\t/// <remarks>Static classes also count as abstract classes.</remarks>\n\t\tbool IsAbstract { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Returns whether this entity is sealed.\n\t\t/// </summary>\n\t\t/// <remarks>Static classes also count as sealed classes.</remarks>\n\t\tbool IsSealed { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is declared to be shadowing another member with the same name.\n\t\t/// (C# 'new' keyword)\n\t\t/// </summary>\n\t\tbool IsShadowing { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is generated by a macro/compiler feature.\n\t\t/// </summary>\n\t\tbool IsSynthetic { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IEvent.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics.Contracts;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic interface IUnresolvedEvent : IUnresolvedMember\n\t{\n\t\tbool CanAdd { get; }\n\t\tbool CanRemove { get; }\n\t\tbool CanInvoke { get; }\n\t\t\n\t\tIUnresolvedMethod AddAccessor { get; }\n\t\tIUnresolvedMethod RemoveAccessor { get; }\n\t\tIUnresolvedMethod InvokeAccessor { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the member.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context for looking up the member. The context must specify the current assembly.\n\t\t/// A <see cref=\"SimpleTypeResolveContext\"/> that specifies the current assembly is sufficient.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved member, or <c>null</c> if the member could not be found.\n\t\t/// </returns>\n\t\tnew IEvent Resolve(ITypeResolveContext context);\n\t}\n\t\n\tpublic interface IEvent : IMember\n\t{\n\t\tbool CanAdd { get; }\n\t\tbool CanRemove { get; }\n\t\tbool CanInvoke { get; }\n\t\t\n\t\tIMethod AddAccessor { get; }\n\t\tIMethod RemoveAccessor { get; }\n\t\tIMethod InvokeAccessor { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IField.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics.Contracts;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a field or constant.\n\t/// </summary>\n\tpublic interface IUnresolvedField : IUnresolvedMember\n\t{\n\t\t/// <summary>\n\t\t/// Gets whether this field is readonly.\n\t\t/// </summary>\n\t\tbool IsReadOnly { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this field is volatile.\n\t\t/// </summary>\n\t\tbool IsVolatile { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this field is a constant (C#-like const).\n\t\t/// </summary>\n\t\tbool IsConst { get; }\n\n\t\t/// <summary>\n\t\t/// Gets whether this field is a fixed size buffer (C#-like fixed).\n\t\t/// If this is true, then ConstantValue contains the size of the buffer.\n\t\t/// </summary>\n\t\tbool IsFixed { get; }\n\n\n\t\tIConstantValue ConstantValue { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the member.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context for looking up the member. The context must specify the current assembly.\n\t\t/// A <see cref=\"SimpleTypeResolveContext\"/> that specifies the current assembly is sufficient.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved member, or <c>null</c> if the member could not be found.\n\t\t/// </returns>\n\t\tnew IField Resolve(ITypeResolveContext context);\n\t}\n\t\n\t/// <summary>\n\t/// Represents a field or constant.\n\t/// </summary>\n\tpublic interface IField : IMember, IVariable\n\t{\n\t\t/// <summary>\n\t\t/// Gets the name of the field.\n\t\t/// </summary>\n\t\tnew string Name { get; } // solve ambiguity between IMember.Name and IVariable.Name\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the region where the field is declared.\n\t\t/// </summary>\n\t\tnew DomRegion Region { get; } // solve ambiguity between IEntity.Region and IVariable.Region\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this field is readonly.\n\t\t/// </summary>\n\t\tbool IsReadOnly { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this field is volatile.\n\t\t/// </summary>\n\t\tbool IsVolatile { get; }\n\n\t\t/// <summary>\n\t\t/// Gets whether this field is a fixed size buffer (C#-like fixed).\n\t\t/// If this is true, then ConstantValue contains the size of the buffer.\n\t\t/// </summary>\n\t\tbool IsFixed { get; }\n\t\t\n\t\tnew IMemberReference ToReference(); // solve ambiguity between IMember.ToReference() and IVariable.ToReference()\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IFreezable.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic interface IFreezable\n\t{\n\t\t/// <summary>\n\t\t/// Gets if this instance is frozen. Frozen instances are immutable and thus thread-safe.\n\t\t/// </summary>\n\t\tbool IsFrozen { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Freezes this instance.\n\t\t/// </summary>\n\t\tvoid Freeze();\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IInterningProvider.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Provider used for interning.\n\t/// </summary>\n\t/// <remarks>\n\t/// A simple IInterningProvider implementation could use 3 dictionaries:\n\t///  1. using value equality comparer (for certain types known to implement value equality, e.g. string and IType)\n\t///  2. using comparer that calls into ISupportsInterning (for types implementing ISupportsInterning)\n\t///  3. list comparer (for InternList method)\n\t/// \n\t/// On the first Intern()-call, the provider tells the object to prepare for interning (ISupportsInterning.PrepareForInterning)\n\t/// and stores it into a dictionary. On further Intern() calls, the original object is returned for all equal objects.\n\t/// This allows reducing the memory usage by using a single object instance where possible.\n\t/// \n\t/// Interning provider implementations could also use the interning logic for different purposes:\n\t/// for example, it could be used to determine which objects are used jointly between multiple type definitions\n\t/// and which are used only within a single type definition. Then a persistent file format could be organized so\n\t/// that shared objects are loaded only once, yet non-shared objects get loaded lazily together with the class.\n\t/// </remarks>\n\tpublic abstract class InterningProvider\n\t{\n\t\tpublic static readonly InterningProvider Dummy = new DummyInterningProvider();\n\t\t\n\t\t/// <summary>\n\t\t/// Interns the specified object.\n\t\t/// \n\t\t/// If the object is freezable, it will be frozen.\n\t\t/// </summary>\n\t\tpublic abstract ISupportsInterning Intern(ISupportsInterning obj);\n\t\t\n\t\t/// <summary>\n\t\t/// Interns the specified object.\n\t\t/// \n\t\t/// If the object is freezable, it will be frozen.\n\t\t/// </summary>\n\t\tpublic T Intern<T>(T obj) where T : class, ISupportsInterning\n\t\t{\n\t\t\tISupportsInterning input = obj;\n\t\t\treturn (T)Intern(input);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Interns the specified string.\n\t\t/// </summary>\n\t\tpublic abstract string Intern(string text);\n\t\t\n\t\t/// <summary>\n\t\t/// Inters a boxed value type.\n\t\t/// </summary>\n\t\tpublic abstract object InternValue(object obj);\n\t\t\n\t\t/// <summary>\n\t\t/// Interns the given list. Uses reference equality to compare the list elements.\n\t\t/// </summary>\n\t\tpublic abstract IList<T> InternList<T>(IList<T> list) where T : class;\n\t\t\n\t\tsealed class DummyInterningProvider : InterningProvider\n\t\t{\n\t\t\tpublic override ISupportsInterning Intern(ISupportsInterning obj)\n\t\t\t{\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string Intern(string text)\n\t\t\t{\n\t\t\t\treturn text;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object InternValue(object obj)\n\t\t\t{\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IList<T> InternList<T>(IList<T> list)\n\t\t\t{\n\t\t\t\treturn list;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IMember.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Method/field/property/event.\n\t/// </summary>\n\tpublic interface IUnresolvedMember : IUnresolvedEntity, IMemberReference\n\t{\n\t\t/// <summary>\n\t\t/// Gets the return type of this member.\n\t\t/// This property never returns null.\n\t\t/// </summary>\n\t\tITypeReference ReturnType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is explicitly implementing an interface.\n\t\t/// If this property is true, the member can only be called through the interfaces it implements.\n\t\t/// </summary>\n\t\tbool IsExplicitInterfaceImplementation { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the interfaces that are explicitly implemented by this member.\n\t\t/// </summary>\n\t\tIList<IMemberReference> ExplicitInterfaceImplementations { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if the member is virtual. Is true only if the \"virtual\" modifier was used, but non-virtual\n\t\t/// members can be overridden, too; if they are abstract or overriding a method.\n\t\t/// </summary>\n\t\tbool IsVirtual { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is overriding another member.\n\t\t/// </summary>\n\t\tbool IsOverride { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if the member can be overridden. Returns true when the member is \"abstract\", \"virtual\" or \"override\" but not \"sealed\".\n\t\t/// </summary>\n\t\tbool IsOverridable { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the member.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context for looking up the member. The context must specify the current assembly.\n\t\t/// A <see cref=\"SimpleTypeResolveContext\"/> that specifies the current assembly is sufficient.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved member, or <c>null</c> if the member could not be found.\n\t\t/// </returns>\n\t\tnew IMember Resolve(ITypeResolveContext context);\n\t\t\n\t\t/// <summary>\n\t\t/// Creates the resolved member.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// The language-specific context that includes the parent type definition.\n\t\t/// <see cref=\"IUnresolvedTypeDefinition.CreateResolveContext\"/>\n\t\t/// </param>\n\t\tIMember CreateResolved(ITypeResolveContext context);\n\t}\n\t\n\tpublic interface IMemberReference : ISymbolReference\n\t{\n\t\t/// <summary>\n\t\t/// Gets the declaring type reference for the member.\n\t\t/// </summary>\n\t\tITypeReference DeclaringTypeReference { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the member.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context to use for resolving this member reference.\n\t\t/// Which kind of context is required depends on the which kind of member reference this is;\n\t\t/// please consult the documentation of the method that was used to create this member reference,\n\t\t/// or that of the class implementing this method.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved member, or <c>null</c> if the member could not be found.\n\t\t/// </returns>\n\t\tnew IMember Resolve(ITypeResolveContext context);\n\t}\n\t\n\t/// <summary>\n\t/// Method/field/property/event.\n\t/// </summary>\n\tpublic interface IMember : IEntity\n\t{\n\t\t/// <summary>\n\t\t/// Gets the original member definition for this member.\n\t\t/// Returns <c>this</c> if this is not a specialized member.\n\t\t/// Specialized members are the result of overload resolution with type substitution.\n\t\t/// </summary>\n\t\tIMember MemberDefinition { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the unresolved member instance from which this member was created.\n\t\t/// This property may return <c>null</c> for special members that do not have a corresponding unresolved member instance.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// For specialized members, this property returns the unresolved member for the original member definition.\n\t\t/// For partial methods, this property returns the implementing partial method declaration, if one exists, and the\n\t\t/// defining partial method declaration otherwise.\n\t\t/// For the members used to represent the built-in C# operators like \"operator +(int, int);\", this property returns <c>null</c>.\n\t\t/// </remarks>\n\t\tIUnresolvedMember UnresolvedMember { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the return type of this member.\n\t\t/// This property never returns <c>null</c>.\n\t\t/// </summary>\n\t\tIType ReturnType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the interface members implemented by this member (both implicitly and explicitly).\n\t\t/// </summary>\n\t\tIList<IMember> ImplementedInterfaceMembers { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is explicitly implementing an interface.\n\t\t/// </summary>\n\t\tbool IsExplicitInterfaceImplementation { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if the member is virtual. Is true only if the \"virtual\" modifier was used, but non-virtual\n\t\t/// members can be overridden, too; if they are abstract or overriding a method.\n\t\t/// </summary>\n\t\tbool IsVirtual { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this member is overriding another member.\n\t\t/// </summary>\n\t\tbool IsOverride { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if the member can be overridden. Returns true when the member is \"abstract\", \"virtual\" or \"override\" but not \"sealed\".\n\t\t/// </summary>\n\t\tbool IsOverridable { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a member reference that can be used to rediscover this member in another compilation.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context.\n\t\t/// Otherwise, the main resolve context of a compilation is sufficient.\n\t\t/// </remarks>\n\t\t[Obsolete(\"Use the ToReference method instead.\")]\n\t\tIMemberReference ToMemberReference();\n\t\t\n\t\t\t\t/// <summary>\n\t\t/// Creates a member reference that can be used to rediscover this member in another compilation.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context.\n\t\t/// Otherwise, the main resolve context of a compilation is sufficient.\n\t\t/// </remarks>\n\t\tnew IMemberReference ToReference();\n\n\t\t/// <summary>\n\t\t/// Gets the substitution belonging to this specialized member.\n\t\t/// Returns TypeParameterSubstitution.Identity for not specialized members.\n\t\t/// </summary>\n\t\tTypeParameterSubstitution Substitution {\n\t\t\tget;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Specializes this member with the given substitution.\n\t\t/// If this member is already specialized, the new substitution is composed with the existing substition.\n\t\t/// </summary>\n\t\tIMember Specialize(TypeParameterSubstitution substitution);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IMethod.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic interface IUnresolvedMethod : IUnresolvedParameterizedMember\n\t{\n\t\t/// <summary>\n\t\t/// Gets the attributes associated with the return type. (e.g. [return: MarshalAs(...)])\n\t\t/// </summary>\n\t\tIList<IUnresolvedAttribute> ReturnTypeAttributes { get; }\n\t\t\n\t\tIList<IUnresolvedTypeParameter> TypeParameters { get; }\n\t\t\n\t\tbool IsConstructor { get; }\n\t\tbool IsDestructor { get; }\n\t\tbool IsOperator { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the method is a C#-style partial method.\n\t\t/// Check <see cref=\"HasBody\"/> to test if it is a partial method declaration or implementation.\n\t\t/// </summary>\n\t\tbool IsPartial { get; }\n\n\t\t/// <summary>\n\t\t/// Gets whether the method is a C#-style async method.\n\t\t/// </summary>\n\t\tbool IsAsync { get; }\n\n\t\t[Obsolete(\"Use IsPartial && !HasBody instead\")]\n\t\tbool IsPartialMethodDeclaration { get; }\n\t\t\n\t\t[Obsolete(\"Use IsPartial && HasBody instead\")]\n\t\tbool IsPartialMethodImplementation { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the method has a body.\n\t\t/// This property returns <c>false</c> for <c>abstract</c> or <c>extern</c> methods,\n\t\t/// or for <c>partial</c> methods without implementation.\n\t\t/// </summary>\n\t\tbool HasBody { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// If this method is an accessor, returns a reference to the corresponding property/event.\n\t\t/// Otherwise, returns null.\n\t\t/// </summary>\n\t\tIUnresolvedMember AccessorOwner { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the member.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context for looking up the member. The context must specify the current assembly.\n\t\t/// A <see cref=\"SimpleTypeResolveContext\"/> that specifies the current assembly is sufficient.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved member, or <c>null</c> if the member could not be found.\n\t\t/// </returns>\n\t\tnew IMethod Resolve(ITypeResolveContext context);\n\t}\n\t\n\t/// <summary>\n\t/// Represents a method, constructor, destructor or operator.\n\t/// </summary>\n\tpublic interface IMethod : IParameterizedMember\n\t{\n\t\t/// <summary>\n\t\t/// Gets the unresolved method parts.\n\t\t/// For partial methods, this returns all parts.\n\t\t/// Otherwise, this returns an array with a single element (new[] { UnresolvedMember }).\n\t\t/// NOTE: The type will change to IReadOnlyList&lt;IUnresolvedMethod&gt; in future versions.\n\t\t/// </summary>\n\t\tIList<IUnresolvedMethod> Parts { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attributes associated with the return type. (e.g. [return: MarshalAs(...)])\n\t\t/// NOTE: The type will change to IReadOnlyList&lt;IAttribute&gt; in future versions.\n\t\t/// </summary>\n\t\tIList<IAttribute> ReturnTypeAttributes { get; }\n\n\t\t/// <summary>\n\t\t/// Gets the type parameters of this method; or an empty list if the method is not generic.\n\t\t/// NOTE: The type will change to IReadOnlyList&lt;ITypeParameter&gt; in future versions.\n\t\t/// </summary>\n\t\tIList<ITypeParameter> TypeParameters { get; }\n\n\t\t/// <summary>\n\t\t/// Gets whether this is a generic method that has been parameterized.\n\t\t/// </summary>\n\t\tbool IsParameterized { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type arguments passed to this method.\n\t\t/// If the method is generic but not parameterized yet, this property returns the type parameters,\n\t\t/// as if the method was parameterized with its own type arguments (<c>void M&lt;T&gt;() { M&lt;T&gt;(); }</c>).\n\t\t/// \n\t\t/// NOTE: The type will change to IReadOnlyList&lt;IType&gt; in future versions.\n\t\t/// </summary>\n\t\tIList<IType> TypeArguments { get; }\n\n\t\tbool IsExtensionMethod { get; }\n\t\tbool IsConstructor { get; }\n\t\tbool IsDestructor { get; }\n\t\tbool IsOperator { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the method is a C#-style partial method.\n\t\t/// A call to such a method is ignored by the compiler if the partial method has no body.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"HasBody\"/>\n\t\tbool IsPartial { get; }\n\n\t\t/// <summary>\n\t\t/// Gets whether the method is a C#-style async method.\n\t\t/// </summary>\n\t\tbool IsAsync { get; }\n\n\t\t/// <summary>\n\t\t/// Gets whether the method has a body.\n\t\t/// This property returns <c>false</c> for <c>abstract</c> or <c>extern</c> methods,\n\t\t/// or for <c>partial</c> methods without implementation.\n\t\t/// </summary>\n\t\tbool HasBody { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the method is a property/event accessor.\n\t\t/// </summary>\n\t\tbool IsAccessor { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// If this method is an accessor, returns the corresponding property/event.\n\t\t/// Otherwise, returns null.\n\t\t/// </summary>\n\t\tIMember AccessorOwner { get; }\n\n\t\t/// <summary>\n\t\t/// If this method is reduced from an extension method return the original method, <c>null</c> otherwise.\n\t\t/// A reduced method doesn't contain the extension method parameter. That means that has one parameter less than it's definition.\n\t\t/// </summary>\n\t\tIMethod ReducedFrom { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Specializes this method with the given substitution.\n\t\t/// If this method is already specialized, the new substitution is composed with the existing substition.\n\t\t/// </summary>\n\t\tnew IMethod Specialize(TypeParameterSubstitution substitution);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/INamedElement.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics.Contracts;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic interface INamedElement\n\t{\n\t\t/// <summary>\n\t\t/// Gets the fully qualified name of the class the return type is pointing to.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// \"System.Int32[]\" for int[]<br/>\n\t\t/// \"System.Collections.Generic.List\" for List&lt;string&gt;\n\t\t/// \"System.Environment.SpecialFolder\" for Environment.SpecialFolder\n\t\t/// </returns>\n\t\tstring FullName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the short name of the class the return type is pointing to.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// \"Int32[]\" for int[]<br/>\n\t\t/// \"List\" for List&lt;string&gt;\n\t\t/// \"SpecialFolder\" for Environment.SpecialFolder\n\t\t/// </returns>\n\t\tstring Name { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the full reflection name of the element.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// For types, the reflection name can be parsed back into a ITypeReference by using\n\t\t/// <see cref=\"ReflectionHelper.ParseReflectionName(string)\"/>.\n\t\t/// </remarks>\n\t\t/// <returns>\n\t\t/// \"System.Int32[]\" for int[]<br/>\n\t\t/// \"System.Int32[][,]\" for C# int[,][]<br/>\n\t\t/// \"System.Collections.Generic.List`1[[System.String]]\" for List&lt;string&gt;\n\t\t/// \"System.Environment+SpecialFolder\" for Environment.SpecialFolder\n\t\t/// </returns>\n\t\tstring ReflectionName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the full name of the namespace containing this entity.\n\t\t/// </summary>\n\t\tstring Namespace { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/INamespace.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a resolved namespace.\n\t/// </summary>\n\tpublic interface INamespace : ISymbol, ICompilationProvider\n\t{\n\t\t// No pointer back to unresolved namespace:\n\t\t// multiple unresolved namespaces (from different assemblies) get\n\t\t// merged into one INamespace.\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the extern alias for this namespace.\n\t\t/// Returns an empty string for normal namespaces.\n\t\t/// </summary>\n\t\tstring ExternAlias { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the full name of this namespace. (e.g. \"System.Collections\")\n\t\t/// </summary>\n\t\tstring FullName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the short name of this namespace (e.g. \"Collections\").\n\t\t/// </summary>\n\t\tnew string Name { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the parent namespace.\n\t\t/// Returns null if this is the root namespace.\n\t\t/// </summary>\n\t\tINamespace ParentNamespace { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the child namespaces in this namespace.\n\t\t/// </summary>\n\t\tIEnumerable<INamespace> ChildNamespaces { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the types in this namespace.\n\t\t/// </summary>\n\t\tIEnumerable<ITypeDefinition> Types { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the assemblies that contribute types to this namespace (or to child namespaces).\n\t\t/// </summary>\n\t\tIEnumerable<IAssembly> ContributingAssemblies { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a direct child namespace by its short name.\n\t\t/// Returns null when the namespace cannot be found.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method uses the compilation's current string comparer.\n\t\t/// </remarks>\n\t\tINamespace GetChildNamespace(string name);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type with the specified short name and type parameter count.\n\t\t/// Returns null if the type cannot be found.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method uses the compilation's current string comparer.\n\t\t/// </remarks>\n\t\tITypeDefinition GetTypeDefinition(string name, int typeParameterCount);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic interface IUnresolvedParameter\n\t{\n\t\t/// <summary>\n\t\t/// Gets the name of the variable.\n\t\t/// </summary>\n\t\tstring Name { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the declaration region of the variable.\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type of the variable.\n\t\t/// </summary>\n\t\tITypeReference Type { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of attributes.\n\t\t/// </summary>\n\t\tIList<IUnresolvedAttribute> Attributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is a C# 'ref' parameter.\n\t\t/// </summary>\n\t\tbool IsRef { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is a C# 'out' parameter.\n\t\t/// </summary>\n\t\tbool IsOut { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is a C# 'params' parameter.\n\t\t/// </summary>\n\t\tbool IsParams { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is optional.\n\t\t/// </summary>\n\t\tbool IsOptional { get; }\n\t\t\n\t\tIParameter CreateResolvedParameter(ITypeResolveContext context);\n\t}\n\t\n\tpublic interface IParameter : IVariable\n\t{\n\t\t/// <summary>\n\t\t/// Gets the list of attributes.\n\t\t/// </summary>\n\t\tIList<IAttribute> Attributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is a C# 'ref' parameter.\n\t\t/// </summary>\n\t\tbool IsRef { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is a C# 'out' parameter.\n\t\t/// </summary>\n\t\tbool IsOut { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is a C# 'params' parameter.\n\t\t/// </summary>\n\t\tbool IsParams { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this parameter is optional.\n\t\t/// The default value is given by the <see cref=\"IVariable.ConstantValue\"/> property.\n\t\t/// </summary>\n\t\tbool IsOptional { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the owner of this parameter.\n\t\t/// May return null; for example when parameters belong to lambdas or anonymous methods.\n\t\t/// </summary>\n\t\tIParameterizedMember Owner { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IParameterizedMember.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a method or property.\n\t/// </summary>\n\tpublic interface IUnresolvedParameterizedMember : IUnresolvedMember\n\t{\n\t\tIList<IUnresolvedParameter> Parameters { get; }\n\t}\n\t\n\t/// <summary>\n\t/// Represents a method or property.\n\t/// </summary>\n\tpublic interface IParameterizedMember : IMember\n\t{\n\t\tIList<IParameter> Parameters { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IProjectContent.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an assembly consisting of source code (parsed files).\n\t/// </summary>\n\tpublic interface IProjectContent : IUnresolvedAssembly\n\t{\n\t\t/// <summary>\n\t\t/// Gets the path to the project file (e.g. .csproj).\n\t\t/// </summary>\n\t\tstring ProjectFileName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a parsed file by its file name.\n\t\t/// </summary>\n\t\tIUnresolvedFile GetFile(string fileName);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of all files in the project content.\n\t\t/// </summary>\n\t\tIEnumerable<IUnresolvedFile> Files { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the referenced assemblies.\n\t\t/// </summary>\n\t\tIEnumerable<IAssemblyReference> AssemblyReferences { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the compiler settings object.\n\t\t/// The concrete type of the settings object depends on the programming language used to implement this project.\n\t\t/// </summary>\n\t\tobject CompilerSettings { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new <see cref=\"ICompilation\"/> that allows resolving within this project.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method does not support <see cref=\"ProjectReference\"/>s. When dealing with a solution\n\t\t/// containing multiple projects, consider using <see cref=\"ISolutionSnapshot.GetCompilation\"/> instead.\n\t\t/// </remarks>\n\t\tICompilation CreateCompilation();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new <see cref=\"ICompilation\"/> that allows resolving within this project.\n\t\t/// </summary>\n\t\t/// <param name=\"solutionSnapshot\">The parent solution snapshot to use for the compilation.</param>\n\t\t/// <remarks>\n\t\t/// This method is intended to be called by ISolutionSnapshot implementations. Other code should\n\t\t/// call <see cref=\"ISolutionSnapshot.GetCompilation\"/> instead.\n\t\t/// This method always creates a new compilation, even if the solution snapshot already contains\n\t\t/// one for this project.\n\t\t/// </remarks>\n\t\tICompilation CreateCompilation(ISolutionSnapshot solutionSnapshot);\n\t\t\n\t\t/// <summary>\n\t\t/// Changes the assembly name of this project content.\n\t\t/// </summary>\n\t\tIProjectContent SetAssemblyName(string newAssemblyName);\n\n\t\t/// <summary>\n\t\t/// Changes the project file name of this project content.\n\t\t/// </summary>\n\t\tIProjectContent SetProjectFileName(string newProjectFileName);\n\t\t\n\t\t/// <summary>\n\t\t/// Changes the path to the assembly location (the output path where the project compiles to).\n\t\t/// </summary>\n\t\tIProjectContent SetLocation(string newLocation);\n\n\t\t/// <summary>\n\t\t/// Add assembly references to this project content.\n\t\t/// </summary>\n\t\tIProjectContent AddAssemblyReferences(IEnumerable<IAssemblyReference> references);\n\t\t\n\t\t/// <summary>\n\t\t/// Add assembly references to this project content.\n\t\t/// </summary>\n\t\tIProjectContent AddAssemblyReferences(params IAssemblyReference[] references);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes assembly references from this project content.\n\t\t/// </summary>\n\t\tIProjectContent RemoveAssemblyReferences(IEnumerable<IAssemblyReference> references);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes assembly references from this project content.\n\t\t/// </summary>\n\t\tIProjectContent RemoveAssemblyReferences(params IAssemblyReference[] references);\n\t\t\n\t\t/// <summary>\n\t\t/// Adds the specified files to the project content.\n\t\t/// If a file with the same name already exists, updated the existing file.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// You can create an unresolved file by calling <c>ToTypeSystem()</c> on a syntax tree.\n\t\t/// </remarks>\n\t\tIProjectContent AddOrUpdateFiles(IEnumerable<IUnresolvedFile> newFiles);\n\t\t\n\t\t/// <summary>\n\t\t/// Adds the specified files to the project content.\n\t\t/// If a file with the same name already exists, this method updates the existing file.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// You can create an unresolved file by calling <c>ToTypeSystem()</c> on a syntax tree.\n\t\t/// </remarks>\n\t\tIProjectContent AddOrUpdateFiles(params IUnresolvedFile[] newFiles);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes the files with the specified names.\n\t\t/// </summary>\n\t\tIProjectContent RemoveFiles(IEnumerable<string> fileNames);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes the files with the specified names.\n\t\t/// </summary>\n\t\tIProjectContent RemoveFiles(params string[] fileNames);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes types and attributes from oldFile from the project, and adds those from newFile.\n\t\t/// </summary>\n\t\t[Obsolete(\"Use RemoveFiles()/AddOrUpdateFiles() instead\")]\n\t\tIProjectContent UpdateProjectContent(IUnresolvedFile oldFile, IUnresolvedFile newFile);\n\t\t\n\t\t/// <summary>\n\t\t/// Removes types and attributes from oldFiles from the project, and adds those from newFiles.\n\t\t/// </summary>\n\t\t[Obsolete(\"Use RemoveFiles()/AddOrUpdateFiles() instead\")]\n\t\tIProjectContent UpdateProjectContent(IEnumerable<IUnresolvedFile> oldFiles, IEnumerable<IUnresolvedFile> newFiles);\n\t\t\n\t\t/// <summary>\n\t\t/// Sets the compiler settings object.\n\t\t/// The concrete type of the settings object depends on the programming language used to implement this project.\n\t\t/// Using the incorrect type of settings object results in an <see cref=\"ArgumentException\"/>.\n\t\t/// </summary>\n\t\tIProjectContent SetCompilerSettings(object compilerSettings);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IProperty.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a property or indexer.\n\t/// </summary>\n\tpublic interface IUnresolvedProperty : IUnresolvedParameterizedMember\n\t{\n\t\tbool CanGet { get; }\n\t\tbool CanSet { get; }\n\t\t\n\t\tIUnresolvedMethod Getter { get; }\n\t\tIUnresolvedMethod Setter { get; }\n\t\t\n\t\tbool IsIndexer { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the member.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context for looking up the member. The context must specify the current assembly.\n\t\t/// A <see cref=\"SimpleTypeResolveContext\"/> that specifies the current assembly is sufficient.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved member, or <c>null</c> if the member could not be found.\n\t\t/// </returns>\n\t\tnew IProperty Resolve(ITypeResolveContext context);\n\t}\n\t\n\t/// <summary>\n\t/// Represents a property or indexer.\n\t/// </summary>\n\tpublic interface IProperty : IParameterizedMember\n\t{\n\t\tbool CanGet { get; }\n\t\tbool CanSet { get; }\n\t\t\n\t\tIMethod Getter { get; }\n\t\tIMethod Setter { get; }\n\t\t\n\t\tbool IsIndexer { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ISolutionSnapshot.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a snapshot of the whole solution (multiple compilations).\n\t/// </summary>\n\tpublic interface ISolutionSnapshot\n\t{\n\t\t/// <summary>\n\t\t/// Gets the project content with the specified file name.\n\t\t/// Returns null if no such project exists in the solution.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method is used by the <see cref=\"ProjectReference\"/> class.\n\t\t/// </remarks>\n\t\tIProjectContent GetProjectContent(string projectFileName);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the compilation for the specified project.\n\t\t/// The project must be a part of the solution (passed to the solution snapshot's constructor).\n\t\t/// </summary>\n\t\tICompilation GetCompilation(IProjectContent project);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ISupportsInterning.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Interface for TypeSystem objects that support interning.\n\t/// See <see cref=\"InterningProvider\"/> for more information.\n\t/// </summary>\n\tpublic interface ISupportsInterning\n\t{\n\t\t/// <summary>\n\t\t/// Gets a hash code for interning.\n\t\t/// </summary>\n\t\tint GetHashCodeForInterning();\n\t\t\n\t\t/// <summary>\n\t\t/// Equality test for interning.\n\t\t/// </summary>\n\t\tbool EqualsForInterning(ISupportsInterning other);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ISymbol.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic enum SymbolKind : byte\n\t{\n\t\tNone,\n\t\t/// <seealso cref=\"ITypeDefinition\"/>\n\t\tTypeDefinition,\n\t\t/// <seealso cref=\"IField\"/>\n\t\tField,\n\t\t/// <summary>\n\t\t/// The symbol is a property, but not an indexer.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IProperty\"/>\n\t\tProperty,\n\t\t/// <summary>\n\t\t/// The symbol is an indexer, not a regular property.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IProperty\"/>\n\t\tIndexer,\n\t\t/// <seealso cref=\"IEvent\"/>\n\t\tEvent,\n\t\t/// <summary>\n\t\t/// The symbol is a method which is not an operator/constructor/destructor or accessor.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tMethod,\n\t\t/// <summary>\n\t\t/// The symbol is a user-defined operator.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tOperator,\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tConstructor,\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tDestructor,\n\t\t/// <summary>\n\t\t/// The accessor method for a property getter/setter or event add/remove.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IMethod\"/>\n\t\tAccessor,\n\t\t/// <seealso cref=\"INamespace\"/>\n\t\tNamespace,\n\t\t/// <summary>\n\t\t/// The symbol is a variable, but not a parameter.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IVariable\"/>\n\t\tVariable,\n\t\t/// <seealso cref=\"IParameter\"/>\n\t\tParameter,\n\t\t/// <seealso cref=\"ITypeParameter\"/>\n\t\tTypeParameter,\n\t}\n\t\n\t/// <summary>\n\t/// Interface for type system symbols.\n\t/// </summary>\n\tpublic interface ISymbol\n\t{\n\t\t/// <summary>\n\t\t/// This property returns an enum specifying which kind of symbol this is\n\t\t/// (which derived interfaces of ISymbol are implemented)\n\t\t/// </summary>\n\t\tSymbolKind SymbolKind { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the short name of the symbol.\n\t\t/// </summary>\n\t\tstring Name { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a symbol reference that can be used to rediscover this symbol in another compilation.\n\t\t/// </summary>\n\t\tISymbolReference ToReference();\n\t}\n\t\n\tpublic interface ISymbolReference\n\t{\n\t\tISymbol Resolve(ITypeResolveContext context);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// This interface represents a resolved type in the type system.\n\t/// </summary>\n\t/// <remarks>\n\t/// <para>\n\t/// A type is potentially\n\t/// - a type definition (<see cref=\"ITypeDefinition\"/>, i.e. a class, struct, interface, delegate, or built-in primitive type)\n\t/// - a parameterized type (<see cref=\"ParameterizedType\"/>, e.g. List&lt;int>)\n\t/// - a type parameter (<see cref=\"ITypeParameter\"/>, e.g. T)\n\t/// - an array (<see cref=\"ArrayType\"/>)\n\t/// - a pointer (<see cref=\"PointerType\"/>)\n\t/// - a managed reference (<see cref=\"ByReferenceType\"/>)\n\t/// - one of the special types (<see cref=\"SpecialType.UnknownType\"/>, <see cref=\"SpecialType.NullType\"/>,\n\t///      <see cref=\"SpecialType.Dynamic\"/>, <see cref=\"SpecialType.UnboundTypeArgument\"/>)\n\t/// \n\t/// The <see cref=\"IType.Kind\"/> property can be used to switch on the kind of a type.\n\t/// </para>\n\t/// <para>\n\t/// IType uses the null object pattern: <see cref=\"SpecialType.UnknownType\"/> serves as the null object.\n\t/// Methods or properties returning IType never return null unless documented otherwise.\n\t/// </para>\n\t/// <para>\n\t/// Types should be compared for equality using the <see cref=\"IEquatable{IType}.Equals(IType)\"/> method.\n\t/// Identical types do not necessarily use the same object reference.\n\t/// </para>\n\t/// </remarks>\n\tpublic interface IType : INamedElement, IEquatable<IType>\n\t{\n\t\t/// <summary>\n\t\t/// Gets the type kind.\n\t\t/// </summary>\n\t\tTypeKind Kind { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the type is a reference type or value type.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// true, if the type is a reference type.\n\t\t/// false, if the type is a value type.\n\t\t/// null, if the type is not known (e.g. unconstrained generic type parameter or type not found)\n\t\t/// </returns>\n\t\tbool? IsReferenceType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the underlying type definition.\n\t\t/// Can return null for types which do not have a type definition (for example arrays, pointers, type parameters).\n\t\t/// </summary>\n\t\tITypeDefinition GetDefinition();\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the parent type, if this is a nested type.\n\t\t/// Returns null for top-level types.\n\t\t/// </summary>\n\t\tIType DeclaringType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the number of type parameters.\n\t\t/// </summary>\n\t\tint TypeParameterCount { get; }\n\n\t\t/// <summary>\n\t\t/// Gets the type arguments passed to this type.\n\t\t/// If this type is a generic type definition that is not parameterized, this property returns the type parameters,\n\t\t/// as if the type was parameterized with its own type arguments (<c>class C&lt;T&gt; { C&lt;T&gt; field; }</c>).\n\t\t/// \n\t\t/// NOTE: The type will change to IReadOnlyList&lt;IType&gt; in future versions.\n\t\t/// </summary>\n\t\tIList<IType> TypeArguments { get; }\n\n\t\t/// <summary>\n\t\t/// If true the type represents an instance of a generic type.\n\t\t/// </summary>\n\t\tbool IsParameterized { get; }\n\n\t\t/// <summary>\n\t\t/// Calls ITypeVisitor.Visit for this type.\n\t\t/// </summary>\n\t\t/// <returns>The return value of the ITypeVisitor.Visit call</returns>\n\t\tIType AcceptVisitor(TypeVisitor visitor);\n\t\t\n\t\t/// <summary>\n\t\t/// Calls ITypeVisitor.Visit for all children of this type, and reconstructs this type with the children based\n\t\t/// on the return values of the visit calls.\n\t\t/// </summary>\n\t\t/// <returns>A copy of this type, with all children replaced by the return value of the corresponding visitor call.\n\t\t/// If the visitor returned the original types for all children (or if there are no children), returns <c>this</c>.\n\t\t/// </returns>\n\t\tIType VisitChildren(TypeVisitor visitor);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the direct base types.\n\t\t/// </summary>\n\t\t/// <returns>Returns the direct base types including interfaces</returns>\n\t\tIEnumerable<IType> DirectBaseTypes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a type reference that can be used to look up a type equivalent to this type in another compilation.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// If this type contains open generics, the resulting type reference will need to be looked up in an appropriate generic context.\n\t\t/// Otherwise, the main resolve context of a compilation is sufficient.\n\t\t/// </remarks>\n\t\tITypeReference ToTypeReference();\n\n\t\t/// <summary>\n\t\t/// Gets a type visitor that performs the substitution of class type parameters with the type arguments\n\t\t/// of this parameterized type.\n\t\t/// Returns TypeParameterSubstitution.Identity if the type is not parametrized.\n\t\t/// </summary>\n\t\tTypeParameterSubstitution GetSubstitution();\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type visitor that performs the substitution of class type parameters with the type arguments\n\t\t/// of this parameterized type,\n\t\t/// and also substitutes method type parameters with the specified method type arguments.\n\t\t/// Returns TypeParameterSubstitution.Identity if the type is not parametrized.\n\t\t/// </summary>\n\t\tTypeParameterSubstitution GetSubstitution(IList<IType> methodTypeArguments);\n\n\t\t\n\t\t/// <summary>\n\t\t/// Gets inner classes (including inherited inner classes).\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which types to return.\n\t\t/// The filter is tested on the original type definitions (before parameterization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// <para>\n\t\t/// If the nested type is generic, this method will return a parameterized type,\n\t\t/// where the additional type parameters are set to <see cref=\"SpecialType.UnboundTypeArgument\"/>.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// Type parameters belonging to the outer class will have the value copied from the outer type\n\t\t/// if it is a parameterized type. Otherwise, those existing type parameters will be self-parameterized,\n\t\t/// and thus 'leaked' to the caller in the same way the GetMembers() method does not specialize members\n\t\t/// from an <see cref=\"ITypeDefinition\"/> and 'leaks' type parameters in member signatures.\n\t\t/// </para>\n\t\t/// </remarks>\n\t\t/// <example>\n\t\t/// <code>\n\t\t/// class Base&lt;T> {\n\t\t/// \tclass Nested&lt;X> {}\n\t\t/// }\n\t\t/// class Derived&lt;A, B> : Base&lt;B> {}\n\t\t/// \n\t\t/// Derived[string,int].GetNestedTypes() = { Base`1+Nested`1[int, unbound] }\n\t\t/// Derived.GetNestedTypes() = { Base`1+Nested`1[`1, unbound] }\n\t\t/// Base[`1].GetNestedTypes() = { Base`1+Nested`1[`1, unbound] }\n\t\t/// Base.GetNestedTypes() = { Base`1+Nested`1[`0, unbound] }\n\t\t/// </code>\n\t\t/// </example>\n\t\tIEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t// Note that we cannot 'leak' the additional type parameter as we leak the normal type parameters, because\n\t\t// the index might collide. For example,\n\t\t//   class Base<T> { class Nested<X> {} }\n\t\t//   class Derived<A, B> : Base<B> { }\n\t\t// \n\t\t// Derived<string, int>.GetNestedTypes() = Base+Nested<int, UnboundTypeArgument>\n\t\t// Derived.GetNestedTypes() = Base+Nested<`1, >\n\t\t//  Here `1 refers to B, and there's no way to return X as it would collide with B.\n\t\t\n\t\t/// <summary>\n\t\t/// Gets inner classes (including inherited inner classes)\n\t\t/// that have <c>typeArguments.Count</c> additional type parameters.\n\t\t/// </summary>\n\t\t/// <param name=\"typeArguments\">The type arguments passed to the inner class</param>\n\t\t/// <param name=\"filter\">The filter used to select which types to return.\n\t\t/// The filter is tested on the original type definitions (before parameterization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// Type parameters belonging to the outer class will have the value copied from the outer type\n\t\t/// if it is a parameterized type. Otherwise, those existing type parameters will be self-parameterized,\n\t\t/// and thus 'leaked' to the caller in the same way the GetMembers() method does not specialize members\n\t\t/// from an <see cref=\"ITypeDefinition\"/> and 'leaks' type parameters in member signatures.\n\t\t/// </remarks>\n\t\tIEnumerable<IType> GetNestedTypes(IList<IType> typeArguments, Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all instance constructors for this type.\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which constructors to return.\n\t\t/// The filter is tested on the original method definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// <para>The result does not include static constructors.\n\t\t/// Constructors in base classes are not returned by default, as GetMemberOptions.IgnoreInheritedMembers is the default value.</para>\n\t\t/// <para>\n\t\t/// For methods on parameterized types, type substitution will be performed on the method signature,\n\t\t/// and the appropriate <see cref=\"Implementation.SpecializedMethod\"/> will be returned.\n\t\t/// </para>\n\t\t/// </remarks>\n\t\tIEnumerable<IMethod> GetConstructors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all methods that can be called on this type.\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which methods to return.\n\t\t/// The filter is tested on the original method definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// <para>\n\t\t/// The result does not include constructors or accessors.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// For methods on parameterized types, type substitution will be performed on the method signature,\n\t\t/// and the appropriate <see cref=\"Implementation.SpecializedMethod\"/> will be returned.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// If the method being returned is generic, and this type is a parameterized type where the type\n\t\t/// arguments involve another method's type parameters, the resulting specialized signature\n\t\t/// will be ambiguous as to which method a type parameter belongs to.\n\t\t/// For example, \"List[[``0]].GetMethods()\" will return \"ConvertAll(Converter`2[[``0, ``0]])\".\n\t\t/// \n\t\t/// If possible, use the other GetMethods() overload to supply type arguments to the method,\n\t\t/// so that both class and method type parameter can be substituted at the same time, so that\n\t\t/// the ambiguity can be avoided.\n\t\t/// </para>\n\t\t/// </remarks>\n\t\tIEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all generic methods that can be called on this type with the specified type arguments.\n\t\t/// </summary>\n\t\t/// <param name=\"typeArguments\">The type arguments used for the method call.</param>\n\t\t/// <param name=\"filter\">The filter used to select which methods to return.\n\t\t/// The filter is tested on the original method definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// <para>The result does not include constructors or accessors.</para>\n\t\t/// <para>\n\t\t/// Type substitution will be performed on the method signature, creating a <see cref=\"Implementation.SpecializedMethod\"/>\n\t\t/// with the specified type arguments.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// When the list of type arguments is empty, this method acts like the GetMethods() overload without\n\t\t/// the type arguments parameter - that is, it also returns generic methods,\n\t\t/// and the other overload's remarks about ambiguous signatures apply here as well.\n\t\t/// </para>\n\t\t/// </remarks>\n\t\tIEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all properties that can be called on this type.\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which properties to return.\n\t\t/// The filter is tested on the original property definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// For properties on parameterized types, type substitution will be performed on the property signature,\n\t\t/// and the appropriate <see cref=\"Implementation.SpecializedProperty\"/> will be returned.\n\t\t/// </remarks>\n\t\tIEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all fields that can be accessed on this type.\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which constructors to return.\n\t\t/// The filter is tested on the original field definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// For fields on parameterized types, type substitution will be performed on the field's return type,\n\t\t/// and the appropriate <see cref=\"Implementation.SpecializedField\"/> will be returned.\n\t\t/// </remarks>\n\t\tIEnumerable<IField> GetFields(Predicate<IUnresolvedField> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all events that can be accessed on this type.\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which events to return.\n\t\t/// The filter is tested on the original event definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// For fields on parameterized types, type substitution will be performed on the event's return type,\n\t\t/// and the appropriate <see cref=\"Implementation.SpecializedEvent\"/> will be returned.\n\t\t/// </remarks>\n\t\tIEnumerable<IEvent> GetEvents(Predicate<IUnresolvedEvent> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all members that can be called on this type.\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which members to return.\n\t\t/// The filter is tested on the original member definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// <para>\n\t\t/// The resulting list is the union of GetFields(), GetProperties(), GetMethods() and GetEvents().\n\t\t/// It does not include constructors.\n\t\t/// For parameterized types, type substitution will be performed.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// For generic methods, the remarks about ambiguous signatures from the\n\t\t/// <see cref=\"GetMethods(Predicate{IUnresolvedMethod}, GetMemberOptions)\"/> method apply here as well.\n\t\t/// </para>\n\t\t/// </remarks>\n\t\tIEnumerable<IMember> GetMembers(Predicate<IUnresolvedMember> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all accessors belonging to properties or events on this type.\n\t\t/// </summary>\n\t\t/// <param name=\"filter\">The filter used to select which members to return.\n\t\t/// The filter is tested on the original member definitions (before specialization).</param>\n\t\t/// <param name=\"options\">Specified additional options for the GetMembers() operation.</param>\n\t\t/// <remarks>\n\t\t/// Accessors are not returned by GetMembers() or GetMethods().\n\t\t/// </remarks>\n\t\tIEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None);\n\t}\n\t\n\t[Flags]\n\tpublic enum GetMemberOptions\n\t{\n\t\t/// <summary>\n\t\t/// No options specified - this is the default.\n\t\t/// Members will be specialized, and inherited members will be included.\n\t\t/// </summary>\n\t\tNone = 0x00,\n\t\t/// <summary>\n\t\t/// Do not specialize the returned members - directly return the definitions.\n\t\t/// </summary>\n\t\tReturnMemberDefinitions = 0x01,\n\t\t/// <summary>\n\t\t/// Do not list inherited members - only list members defined directly on this type.\n\t\t/// </summary>\n\t\tIgnoreInheritedMembers = 0x02\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ITypeDefinition.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an unresolved class, enum, interface, struct, delegate or VB module.\n\t/// For partial classes, an unresolved type definition represents only a single part.\n\t/// </summary>\n\tpublic interface IUnresolvedTypeDefinition : ITypeReference, IUnresolvedEntity\n\t{\n\t\tTypeKind Kind { get; }\n\t\t\n\t\tFullTypeName FullTypeName { get; }\n\t\tIList<ITypeReference> BaseTypes { get; }\n\t\tIList<IUnresolvedTypeParameter> TypeParameters { get; }\n\t\t\n\t\tIList<IUnresolvedTypeDefinition> NestedTypes { get; }\n\t\tIList<IUnresolvedMember> Members { get; }\n\t\t\n\t\tIEnumerable<IUnresolvedMethod> Methods { get; }\n\t\tIEnumerable<IUnresolvedProperty> Properties { get; }\n\t\tIEnumerable<IUnresolvedField> Fields { get; }\n\t\tIEnumerable<IUnresolvedEvent> Events { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the type definition contains extension methods.\n\t\t/// Returns null when the type definition needs to be resolved in order to determine whether\n\t\t/// methods are extension methods.\n\t\t/// </summary>\n\t\tbool? HasExtensionMethods { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the partial modifier is set on this part of the type definition.\n\t\t/// </summary>\n\t\tbool IsPartial { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this unresolved type definition causes the addition of a default constructor\n\t\t/// if no other constructor is present.\n\t\t/// </summary>\n\t\tbool AddDefaultConstructorIfRequired { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Looks up the resolved type definition from the <paramref name=\"context\"/> corresponding to this unresolved\n\t\t/// type definition.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context for looking up the type. The context must specify the current assembly.\n\t\t/// A <see cref=\"SimpleTypeResolveContext\"/> that specifies the current assembly is sufficient.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved type definition.\n\t\t/// In case of an error, returns an <see cref=\"Implementation.UnknownType\"/> instance.\n\t\t/// Never returns null.\n\t\t/// </returns>\n\t\tnew IType Resolve(ITypeResolveContext context);\n\t\t\n\t\t/// <summary>\n\t\t/// This method is used to add language-specific elements like the C# UsingScope\n\t\t/// to the type resolve context.\n\t\t/// </summary>\n\t\t/// <param name=\"parentContext\">The parent context (e.g. the parent assembly),\n\t\t/// including the parent type definition for inner classes.</param>\n\t\t/// <returns>\n\t\t/// The parent context, modified to include language-specific elements (e.g. using scope)\n\t\t/// associated with this type definition.\n\t\t/// </returns>\n\t\t/// <remarks>\n\t\t/// Use <c>unresolvedTypeDef.CreateResolveContext(parentContext).WithTypeDefinition(typeDef)</c> to\n\t\t/// create the context for use within the type definition.\n\t\t/// </remarks>\n\t\tITypeResolveContext CreateResolveContext(ITypeResolveContext parentContext);\n\t}\n\t\n\t/// <summary>\n\t/// Represents a class, enum, interface, struct, delegate or VB module.\n\t/// For partial classes, this represents the whole class.\n\t/// </summary>\n\tpublic interface ITypeDefinition : IType, IEntity\n\t{\n\t\t/// <summary>\n\t\t/// Returns all parts that contribute to this type definition.\n\t\t/// Non-partial classes have a single part that represents the whole class.\n\t\t/// </summary>\n\t\tIList<IUnresolvedTypeDefinition> Parts { get; }\n\t\t\n\t\tIList<ITypeParameter> TypeParameters { get; }\n\t\t\n\t\tIList<ITypeDefinition> NestedTypes { get; }\n\t\tIList<IMember> Members { get; }\n\t\t\n\t\tIEnumerable<IField> Fields { get; }\n\t\tIEnumerable<IMethod> Methods { get; }\n\t\tIEnumerable<IProperty> Properties { get; }\n\t\tIEnumerable<IEvent> Events { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the known type code for this type definition.\n\t\t/// </summary>\n\t\tKnownTypeCode KnownTypeCode { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// For enums: returns the underlying primitive type.\n\t\t/// For all other types: returns <see cref=\"SpecialType.UnknownType\"/>.\n\t\t/// </summary>\n\t\tIType EnumUnderlyingType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the full name of this type.\n\t\t/// </summary>\n\t\tFullTypeName FullTypeName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the declaring type (incl. type arguments, if any).\n\t\t/// This property never returns null -- for top-level entities, it returns SharedTypes.UnknownType.\n\t\t/// </summary>\n\t\tnew IType DeclaringType { get; } // solves ambiguity between IType.DeclaringType and IEntity.DeclaringType\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this type contains extension methods.\n\t\t/// </summary>\n\t\t/// <remarks>This property is used to speed up the search for extension methods.</remarks>\n\t\tbool HasExtensionMethods { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this type definition is made up of one or more partial classes.\n\t\t/// </summary>\n\t\tbool IsPartial { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Determines how this type is implementing the specified interface member.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The method on this type that implements the interface member;\n\t\t/// or null if the type does not implement the interface.\n\t\t/// </returns>\n\t\tIMember GetInterfaceImplementation(IMember interfaceMember);\n\t\t\n\t\t/// <summary>\n\t\t/// Determines how this type is implementing the specified interface members.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// For each interface member, this method returns the class member \n\t\t/// that implements the interface member.\n\t\t/// For interface members that are missing an implementation, the\n\t\t/// result collection will contain a null element.\n\t\t/// </returns>\n\t\tIList<IMember> GetInterfaceImplementation(IList<IMember> interfaceMembers);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ITypeParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Type parameter of a generic class/method.\n\t/// </summary>\n\tpublic interface IUnresolvedTypeParameter : INamedElement\n\t{\n\t\t/// <summary>\n\t\t/// Get the type of this type parameter's owner.\n\t\t/// </summary>\n\t\t/// <returns>SymbolKind.TypeDefinition or SymbolKind.Method</returns>\n\t\tSymbolKind OwnerType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the index of the type parameter in the type parameter list of the owning method/class.\n\t\t/// </summary>\n\t\tint Index { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of attributes declared on this type parameter.\n\t\t/// </summary>\n\t\tIList<IUnresolvedAttribute> Attributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the variance of this type parameter.\n\t\t/// </summary>\n\t\tVarianceModifier Variance { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the region where the type parameter is defined.\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\tITypeParameter CreateResolvedTypeParameter(ITypeResolveContext context);\n\t}\n\t\n\t/// <summary>\n\t/// Type parameter of a generic class/method.\n\t/// </summary>\n\tpublic interface ITypeParameter : IType, ISymbol\n\t{\n\t\t/// <summary>\n\t\t/// Get the type of this type parameter's owner.\n\t\t/// </summary>\n\t\t/// <returns>SymbolKind.TypeDefinition or SymbolKind.Method</returns>\n\t\tSymbolKind OwnerType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the owning method/class.\n\t\t/// This property may return null (for example for the dummy type parameters used by <see cref=\"ParameterListComparer.NormalizeMethodTypeParameters\"/>).\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// For \"class Outer&lt;T&gt; { class Inner {} }\",\n\t\t/// inner.TypeParameters[0].Owner will be the outer class, because the same\n\t\t/// ITypeParameter instance is used both on Outer`1 and Outer`1+Inner.\n\t\t/// </remarks>\n\t\tIEntity Owner { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the index of the type parameter in the type parameter list of the owning method/class.\n\t\t/// </summary>\n\t\tint Index { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name of the type parameter.\n\t\t/// </summary>\n\t\tnew string Name { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of attributes declared on this type parameter.\n\t\t/// </summary>\n\t\tIList<IAttribute> Attributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the variance of this type parameter.\n\t\t/// </summary>\n\t\tVarianceModifier Variance { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the region where the type parameter is defined.\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the effective base class of this type parameter.\n\t\t/// </summary>\n\t\tIType EffectiveBaseClass { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the effective interface set of this type parameter.\n\t\t/// </summary>\n\t\tICollection<IType> EffectiveInterfaceSet { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if the type parameter has the 'new()' constraint.\n\t\t/// </summary>\n\t\tbool HasDefaultConstructorConstraint { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if the type parameter has the 'class' constraint.\n\t\t/// </summary>\n\t\tbool HasReferenceTypeConstraint { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if the type parameter has the 'struct' constraint.\n\t\t/// </summary>\n\t\tbool HasValueTypeConstraint { get; }\n\t}\n\t\n\t/// <summary>\n\t/// Represents the variance of a type parameter.\n\t/// </summary>\n\tpublic enum VarianceModifier : byte\n\t{\n\t\t/// <summary>\n\t\t/// The type parameter is not variant.\n\t\t/// </summary>\n\t\tInvariant,\n\t\t/// <summary>\n\t\t/// The type parameter is covariant (used in output position).\n\t\t/// </summary>\n\t\tCovariant,\n\t\t/// <summary>\n\t\t/// The type parameter is contravariant (used in input position).\n\t\t/// </summary>\n\t\tContravariant\n\t};\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ITypeReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a reference to a type.\n\t/// Must be resolved before it can be used as type.\n\t/// </summary>\n\tpublic interface ITypeReference\n\t{\n\t\t// Keep this interface simple: I decided against having GetMethods/GetEvents etc. here,\n\t\t// so that the Resolve step is never hidden from the consumer.\n\t\t\n\t\t// I decided against implementing IFreezable here: IUnresolvedTypeDefinition can be used as ITypeReference,\n\t\t// but when freezing the reference, one wouldn't expect the definition to freeze.\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves this type reference.\n\t\t/// </summary>\n\t\t/// <param name=\"context\">\n\t\t/// Context to use for resolving this type reference.\n\t\t/// Which kind of context is required depends on the which kind of type reference this is;\n\t\t/// please consult the documentation of the method that was used to create this type reference,\n\t\t/// or that of the class implementing this method.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the resolved type.\n\t\t/// In case of an error, returns an unknown type (<see cref=\"TypeKind.Unknown\"/>).\n\t\t/// Never returns null.\n\t\t/// </returns>\n\t\tIType Resolve(ITypeResolveContext context);\n\t}\n\t\n\tpublic interface ITypeResolveContext : ICompilationProvider\n\t{\n\t\t/// <summary>\n\t\t/// Gets the current assembly.\n\t\t/// This property may return null if this context does not specify any assembly.\n\t\t/// </summary>\n\t\tIAssembly CurrentAssembly { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current type definition.\n\t\t/// </summary>\n\t\tITypeDefinition CurrentTypeDefinition { get ;}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current member.\n\t\t/// </summary>\n\t\tIMember CurrentMember { get; }\n\t\t\n\t\tITypeResolveContext WithCurrentTypeDefinition(ITypeDefinition typeDefinition);\n\t\tITypeResolveContext WithCurrentMember(IMember member);\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IUnresolvedFile.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[Obsolete(\"IParsedFile was renamed to IUnresolvedFile\", true)]\n\tpublic interface IParsedFile {}\n\t\n\t/// <summary>\n\t/// Represents a single file that was parsed.\n\t/// </summary>\n\tpublic interface IUnresolvedFile\n\t{\n\t\t/// <summary>\n\t\t/// Returns the full path of the file.\n\t\t/// </summary>\n\t\tstring FileName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the time when the file was last written.\n\t\t/// </summary>\n\t\tDateTime? LastWriteTime { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all top-level type definitions.\n\t\t/// </summary>\n\t\tIList<IUnresolvedTypeDefinition> TopLevelTypeDefinitions { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all assembly attributes that are defined in this file.\n\t\t/// </summary>\n\t\tIList<IUnresolvedAttribute> AssemblyAttributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all module attributes that are defined in this file.\n\t\t/// </summary>\n\t\tIList<IUnresolvedAttribute> ModuleAttributes { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the top-level type defined at the specified location.\n\t\t/// Returns null if no type is defined at that location.\n\t\t/// </summary>\n\t\tIUnresolvedTypeDefinition GetTopLevelTypeDefinition(TextLocation location);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type (potentially a nested type) defined at the specified location.\n\t\t/// Returns null if no type is defined at that location.\n\t\t/// </summary>\n\t\tIUnresolvedTypeDefinition GetInnermostTypeDefinition(TextLocation location);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the member defined at the specified location.\n\t\t/// Returns null if no member is defined at that location.\n\t\t/// </summary>\n\t\tIUnresolvedMember GetMember(TextLocation location);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the parser errors.\n\t\t/// </summary>\n\t\tIList<Error> Errors { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IVariable.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a variable (name/type pair).\n\t/// </summary>\n\tpublic interface IVariable : ISymbol\n\t{\n\t\t/// <summary>\n\t\t/// Gets the name of the variable.\n\t\t/// </summary>\n\t\tnew string Name { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the declaration region of the variable.\n\t\t/// </summary>\n\t\tDomRegion Region { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type of the variable.\n\t\t/// </summary>\n\t\tIType Type { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this variable is a constant (C#-like const).\n\t\t/// </summary>\n\t\tbool IsConst { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// If this field is a constant, retrieves the value.\n\t\t/// For parameters, this is the default value.\n\t\t/// </summary>\n\t\tobject ConstantValue { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractFreezable.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic static class FreezableHelper\n\t{\n\t\tpublic static void ThrowIfFrozen(IFreezable freezable)\n\t\t{\n\t\t\tif (freezable.IsFrozen)\n\t\t\t\tthrow new InvalidOperationException(\"Cannot mutate frozen \" + freezable.GetType().Name);\n\t\t}\n\t\t\n\t\tpublic static IList<T> FreezeListAndElements<T>(IList<T> list)\n\t\t{\n\t\t\tif (list != null) {\n\t\t\t\tforeach (T item in list)\n\t\t\t\t\tFreeze(item);\n\t\t\t}\n\t\t\treturn FreezeList(list);\n\t\t}\n\t\t\n\t\tpublic static IList<T> FreezeList<T>(IList<T> list)\n\t\t{\n\t\t\tif (list == null || list.Count == 0)\n\t\t\t\treturn EmptyList<T>.Instance;\n\t\t\tif (list.IsReadOnly) {\n\t\t\t\t// If the list is already read-only, return it directly.\n\t\t\t\t// This is important, otherwise we might undo the effects of interning.\n\t\t\t\treturn list;\n\t\t\t} else {\n\t\t\t\treturn new ReadOnlyCollection<T>(list.ToArray());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static void Freeze(object item)\n\t\t{\n\t\t\tIFreezable f = item as IFreezable;\n\t\t\tif (f != null)\n\t\t\t\tf.Freeze();\n\t\t}\n\t\t\n\t\tpublic static T FreezeAndReturn<T>(T item) where T : IFreezable\n\t\t{\n\t\t\titem.Freeze();\n\t\t\treturn item;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// If the item is not frozen, this method creates and returns a frozen clone.\n\t\t/// If the item is already frozen, it is returned without creating a clone.\n\t\t/// </summary>\n\t\tpublic static T GetFrozenClone<T>(T item) where T : IFreezable, ICloneable\n\t\t{\n\t\t\tif (!item.IsFrozen) {\n\t\t\t\titem = (T)item.Clone();\n\t\t\t\titem.Freeze();\n\t\t\t}\n\t\t\treturn item;\n\t\t}\n\t}\n\n\t[Serializable]\n\tpublic abstract class AbstractFreezable : IFreezable\n\t{\n\t\tbool isFrozen;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if this instance is frozen. Frozen instances are immutable and thus thread-safe.\n\t\t/// </summary>\n\t\tpublic bool IsFrozen {\n\t\t\tget { return isFrozen; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Freezes this instance.\n\t\t/// </summary>\n\t\tpublic void Freeze()\n\t\t{\n\t\t\tif (!isFrozen) {\n\t\t\t\tFreezeInternal();\n\t\t\t\tisFrozen = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected virtual void FreezeInternal()\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractResolvedEntity.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Documentation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Implementation of <see cref=\"IEntity\"/> that resolves an unresolved entity.\n\t/// </summary>\n\tpublic abstract class AbstractResolvedEntity : IEntity\n\t{\n\t\tprotected readonly IUnresolvedEntity unresolved;\n\t\tprotected readonly ITypeResolveContext parentContext;\n\t\t\n\t\tprotected AbstractResolvedEntity(IUnresolvedEntity unresolved, ITypeResolveContext parentContext)\n\t\t{\n\t\t\tif (unresolved == null)\n\t\t\t\tthrow new ArgumentNullException(\"unresolved\");\n\t\t\tif (parentContext == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentContext\");\n\t\t\tthis.unresolved = unresolved;\n\t\t\tthis.parentContext = parentContext;\n\t\t\tthis.Attributes = unresolved.Attributes.CreateResolvedAttributes(parentContext);\n\t\t}\n\t\t\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget { return unresolved.SymbolKind; }\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use the SymbolKind property instead.\")]\n\t\tpublic EntityType EntityType {\n\t\t\tget { return (EntityType)unresolved.SymbolKind; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return unresolved.Region; }\n\t\t}\n\t\t\n\t\tpublic DomRegion BodyRegion {\n\t\t\tget { return unresolved.BodyRegion; }\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition DeclaringTypeDefinition {\n\t\t\tget { return parentContext.CurrentTypeDefinition; }\n\t\t}\n\t\t\n\t\tpublic virtual IType DeclaringType {\n\t\t\tget { return parentContext.CurrentTypeDefinition ?? (IType)SpecialType.UnknownType; }\n\t\t}\n\t\t\n\t\tpublic IAssembly ParentAssembly {\n\t\t\tget { return parentContext.CurrentAssembly; }\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> Attributes { get; protected set; }\n\t\t\n\t\tpublic virtual DocumentationComment Documentation {\n\t\t\tget {\n\t\t\t\tIDocumentationProvider provider = FindDocumentation(parentContext);\n\t\t\t\tif (provider != null)\n\t\t\t\t\treturn provider.GetDocumentation(this);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static IDocumentationProvider FindDocumentation(ITypeResolveContext context)\n\t\t{\n\t\t\tIAssembly asm = context.CurrentAssembly;\n\t\t\tif (asm != null)\n\t\t\t\treturn asm.UnresolvedAssembly as IDocumentationProvider;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\n\t\tpublic abstract ISymbolReference ToReference();\n\t\t\n\t\tpublic bool IsStatic { get { return unresolved.IsStatic; } }\n\t\tpublic bool IsAbstract { get { return unresolved.IsAbstract; } }\n\t\tpublic bool IsSealed { get { return unresolved.IsSealed; } }\n\t\tpublic bool IsShadowing { get { return unresolved.IsShadowing; } }\n\t\tpublic bool IsSynthetic { get { return unresolved.IsSynthetic; } }\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return parentContext.Compilation; }\n\t\t}\n\t\t\n\t\tpublic string FullName { get { return unresolved.FullName; } }\n\t\tpublic string Name { get { return unresolved.Name; } }\n\t\tpublic string ReflectionName { get { return unresolved.ReflectionName; } }\n\t\tpublic string Namespace { get { return unresolved.Namespace; } }\n\t\t\n\t\tpublic Accessibility Accessibility { get { return unresolved.Accessibility; } }\n\t\tpublic bool IsPrivate { get { return unresolved.IsPrivate; } }\n\t\tpublic bool IsPublic { get { return unresolved.IsPublic; } }\n\t\tpublic bool IsProtected { get { return unresolved.IsProtected; } }\n\t\tpublic bool IsInternal { get { return unresolved.IsInternal; } }\n\t\tpublic bool IsProtectedOrInternal { get { return unresolved.IsProtectedOrInternal; } }\n\t\tpublic bool IsProtectedAndInternal { get { return unresolved.IsProtectedAndInternal; } }\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[\" + this.SymbolKind.ToString() + \" \" + this.ReflectionName + \"]\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractResolvedMember.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Implementation of <see cref=\"IMember\"/> that resolves an unresolved member.\n\t/// </summary>\n\tpublic abstract class AbstractResolvedMember : AbstractResolvedEntity, IMember\n\t{\n\t\tprotected new readonly IUnresolvedMember unresolved;\n\t\tprotected readonly ITypeResolveContext context;\n\t\tvolatile IType returnType;\n\t\tIList<IMember> implementedInterfaceMembers;\n\t\t\n\t\tprotected AbstractResolvedMember(IUnresolvedMember unresolved, ITypeResolveContext parentContext)\n\t\t\t: base(unresolved, parentContext)\n\t\t{\n\t\t\tthis.unresolved = unresolved;\n\t\t\tthis.context = parentContext.WithCurrentMember(this);\n\t\t}\n\t\t\n\t\tIMember IMember.MemberDefinition {\n\t\t\tget { return this; }\n\t\t}\n\t\t\n\t\tpublic IType ReturnType {\n\t\t\tget {\n\t\t\t\treturn this.returnType ?? (this.returnType = unresolved.ReturnType.Resolve(context));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMember UnresolvedMember {\n\t\t\tget { return unresolved; }\n\t\t}\n\t\t\n\t\tpublic IList<IMember> ImplementedInterfaceMembers {\n\t\t\tget {\n\t\t\t\tIList<IMember> result = LazyInit.VolatileRead(ref this.implementedInterfaceMembers);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref implementedInterfaceMembers, FindImplementedInterfaceMembers());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<IMember> FindImplementedInterfaceMembers()\n\t\t{\n\t\t\tif (unresolved.IsExplicitInterfaceImplementation) {\n\t\t\t\tList<IMember> result = new List<IMember>();\n\t\t\t\tforeach (var memberReference in unresolved.ExplicitInterfaceImplementations) {\n\t\t\t\t\tIMember member = memberReference.Resolve(context);\n\t\t\t\t\tif (member != null)\n\t\t\t\t\t\tresult.Add(member);\n\t\t\t\t}\n\t\t\t\treturn result.ToArray();\n\t\t\t} else if (unresolved.IsStatic || !unresolved.IsPublic || DeclaringTypeDefinition == null || DeclaringTypeDefinition.Kind == TypeKind.Interface) {\n\t\t\t\treturn EmptyList<IMember>.Instance;\n\t\t\t} else {\n\t\t\t\t// TODO: implement interface member mappings correctly\n\t\t\t\tvar result = InheritanceHelper.GetBaseMembers(this, true)\n\t\t\t\t\t.Where(m => m.DeclaringTypeDefinition != null && m.DeclaringTypeDefinition.Kind == TypeKind.Interface)\n\t\t\t\t\t.ToArray();\n\n\t\t\t\tIEnumerable<IMember> otherMembers = DeclaringTypeDefinition.Members;\n\t\t\t\tif (SymbolKind == SymbolKind.Accessor)\n\t\t\t\t\totherMembers = DeclaringTypeDefinition.GetAccessors(options: GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\tresult = result.Where(item => !otherMembers.Any(m => m.IsExplicitInterfaceImplementation && m.ImplementedInterfaceMembers.Contains(item))).ToArray();\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override DocumentationComment Documentation {\n\t\t\tget {\n\t\t\t\tIUnresolvedDocumentationProvider docProvider = unresolved.UnresolvedFile as IUnresolvedDocumentationProvider;\n\t\t\t\tif (docProvider != null) {\n\t\t\t\t\tvar doc = docProvider.GetDocumentation(unresolved, this);\n\t\t\t\t\tif (doc != null)\n\t\t\t\t\t\treturn doc;\n\t\t\t\t}\n\t\t\t\treturn base.Documentation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsExplicitInterfaceImplementation {\n\t\t\tget { return unresolved.IsExplicitInterfaceImplementation; }\n\t\t}\n\t\t\n\t\tpublic bool IsVirtual {\n\t\t\tget { return unresolved.IsVirtual; }\n\t\t}\n\t\t\n\t\tpublic bool IsOverride {\n\t\t\tget { return unresolved.IsOverride; }\n\t\t}\n\t\t\n\t\tpublic bool IsOverridable {\n\t\t\tget { return unresolved.IsOverridable; }\n\t\t}\n\n\t\tpublic TypeParameterSubstitution Substitution {\n\t\t\tget { return TypeParameterSubstitution.Identity; }\n\t\t}\n\n\t\tpublic abstract IMember Specialize(TypeParameterSubstitution substitution);\n\t\t\n\t\tIMemberReference IMember.ToReference()\n\t\t{\n\t\t\treturn (IMemberReference)ToReference();\n\t\t}\n\t\t\n\t\tpublic override ISymbolReference ToReference()\n\t\t{\n\t\t\tvar declTypeRef = this.DeclaringType.ToTypeReference();\n\t\t\tif (IsExplicitInterfaceImplementation && ImplementedInterfaceMembers.Count == 1) {\n\t\t\t\treturn new ExplicitInterfaceImplementationMemberReference(declTypeRef, ImplementedInterfaceMembers[0].ToReference());\n\t\t\t} else {\n\t\t\t\treturn new DefaultMemberReference(this.SymbolKind, declTypeRef, this.Name);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IMemberReference ToMemberReference()\n\t\t{\n\t\t\treturn (IMemberReference)ToReference();\n\t\t}\n\t\t\n\t\tinternal IMethod GetAccessor(ref IMethod accessorField, IUnresolvedMethod unresolvedAccessor)\n\t\t{\n\t\t\tif (unresolvedAccessor == null)\n\t\t\t\treturn null;\n\t\t\tIMethod result = LazyInit.VolatileRead(ref accessorField);\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn LazyInit.GetOrSet(ref accessorField, CreateResolvedAccessor(unresolvedAccessor));\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected virtual IMethod CreateResolvedAccessor(IUnresolvedMethod unresolvedAccessor)\n\t\t{\n\t\t\treturn (IMethod)unresolvedAccessor.CreateResolved(context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractResolvedTypeParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic abstract class AbstractTypeParameter : ITypeParameter, ICompilationProvider\n\t{\n\t\treadonly ICompilation compilation;\n\t\treadonly SymbolKind ownerType;\n\t\treadonly IEntity owner;\n\t\treadonly int index;\n\t\treadonly string name;\n\t\treadonly IList<IAttribute> attributes;\n\t\treadonly DomRegion region;\n\t\treadonly VarianceModifier variance;\n\t\t\n\t\tprotected AbstractTypeParameter(IEntity owner, int index, string name, VarianceModifier variance, IList<IAttribute> attributes, DomRegion region)\n\t\t{\n\t\t\tif (owner == null)\n\t\t\t\tthrow new ArgumentNullException(\"owner\");\n\t\t\tthis.owner = owner;\n\t\t\tthis.compilation = owner.Compilation;\n\t\t\tthis.ownerType = owner.SymbolKind;\n\t\t\tthis.index = index;\n\t\t\tthis.name = name ?? ((this.OwnerType == SymbolKind.Method ? \"!!\" : \"!\") + index.ToString(CultureInfo.InvariantCulture));\n\t\t\tthis.attributes = attributes ?? EmptyList<IAttribute>.Instance;\n\t\t\tthis.region = region;\n\t\t\tthis.variance = variance;\n\t\t}\n\t\t\n\t\tprotected AbstractTypeParameter(ICompilation compilation, SymbolKind ownerType, int index, string name, VarianceModifier variance, IList<IAttribute> attributes, DomRegion region)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.ownerType = ownerType;\n\t\t\tthis.index = index;\n\t\t\tthis.name = name ?? ((this.OwnerType == SymbolKind.Method ? \"!!\" : \"!\") + index.ToString(CultureInfo.InvariantCulture));\n\t\t\tthis.attributes = attributes ?? EmptyList<IAttribute>.Instance;\n\t\t\tthis.region = region;\n\t\t\tthis.variance = variance;\n\t\t}\n\t\t\n\t\tSymbolKind ISymbol.SymbolKind {\n\t\t\tget { return SymbolKind.TypeParameter; }\n\t\t}\n\t\t\n\t\tpublic SymbolKind OwnerType {\n\t\t\tget { return ownerType; }\n\t\t}\n\t\t\n\t\tpublic IEntity Owner {\n\t\t\tget { return owner; }\n\t\t}\n\t\t\n\t\tpublic int Index {\n\t\t\tget { return index; }\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> Attributes {\n\t\t\tget { return attributes; }\n\t\t}\n\t\t\n\t\tpublic VarianceModifier Variance {\n\t\t\tget { return variance; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return compilation; }\n\t\t}\n\t\t\n\t\tvolatile IType effectiveBaseClass;\n\t\t\n\t\tpublic IType EffectiveBaseClass {\n\t\t\tget {\n\t\t\t\tif (effectiveBaseClass == null) {\n\t\t\t\t\t// protect against cyclic type parameters\n\t\t\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\t\t\tif (!busyLock.Success)\n\t\t\t\t\t\t\treturn SpecialType.UnknownType; // don't cache this error\n\t\t\t\t\t\teffectiveBaseClass = CalculateEffectiveBaseClass();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn effectiveBaseClass;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIType CalculateEffectiveBaseClass()\n\t\t{\n\t\t\tif (HasValueTypeConstraint)\n\t\t\t\treturn this.Compilation.FindType(KnownTypeCode.ValueType);\n\t\t\t\n\t\t\tList<IType> classTypeConstraints = new List<IType>();\n\t\t\tforeach (IType constraint in this.DirectBaseTypes) {\n\t\t\t\tif (constraint.Kind == TypeKind.Class) {\n\t\t\t\t\tclassTypeConstraints.Add(constraint);\n\t\t\t\t} else if (constraint.Kind == TypeKind.TypeParameter) {\n\t\t\t\t\tIType baseClass = ((ITypeParameter)constraint).EffectiveBaseClass;\n\t\t\t\t\tif (baseClass.Kind == TypeKind.Class)\n\t\t\t\t\t\tclassTypeConstraints.Add(baseClass);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (classTypeConstraints.Count == 0)\n\t\t\t\treturn this.Compilation.FindType(KnownTypeCode.Object);\n\t\t\t// Find the derived-most type in the resulting set:\n\t\t\tIType result = classTypeConstraints[0];\n\t\t\tfor (int i = 1; i < classTypeConstraints.Count; i++) {\n\t\t\t\tif (classTypeConstraints[i].GetDefinition().IsDerivedFrom(result.GetDefinition()))\n\t\t\t\t\tresult = classTypeConstraints[i];\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tICollection<IType> effectiveInterfaceSet;\n\t\t\n\t\tpublic ICollection<IType> EffectiveInterfaceSet {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref effectiveInterfaceSet);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\t// protect against cyclic type parameters\n\t\t\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\t\t\tif (!busyLock.Success)\n\t\t\t\t\t\t\treturn EmptyList<IType>.Instance; // don't cache this error\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref effectiveInterfaceSet, CalculateEffectiveInterfaceSet());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tICollection<IType> CalculateEffectiveInterfaceSet()\n\t\t{\n\t\t\tHashSet<IType> result = new HashSet<IType>();\n\t\t\tforeach (IType constraint in this.DirectBaseTypes) {\n\t\t\t\tif (constraint.Kind == TypeKind.Interface) {\n\t\t\t\t\tresult.Add(constraint);\n\t\t\t\t} else if (constraint.Kind == TypeKind.TypeParameter) {\n\t\t\t\t\tresult.UnionWith(((ITypeParameter)constraint).EffectiveInterfaceSet);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tpublic abstract bool HasDefaultConstructorConstraint { get; }\n\t\tpublic abstract bool HasReferenceTypeConstraint { get; }\n\t\tpublic abstract bool HasValueTypeConstraint { get; }\n\t\t\n\t\tpublic TypeKind Kind {\n\t\t\tget { return TypeKind.TypeParameter; }\n\t\t}\n\t\t\n\t\tpublic bool? IsReferenceType {\n\t\t\tget {\n\t\t\t\tif (this.HasValueTypeConstraint)\n\t\t\t\t\treturn false;\n\t\t\t\tif (this.HasReferenceTypeConstraint)\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t// A type parameter is known to be a reference type if it has the reference type constraint\n\t\t\t\t// or its effective base class is not object or System.ValueType.\n\t\t\t\tIType effectiveBaseClass = this.EffectiveBaseClass;\n\t\t\t\tif (effectiveBaseClass.Kind == TypeKind.Class || effectiveBaseClass.Kind == TypeKind.Delegate) {\n\t\t\t\t\tITypeDefinition effectiveBaseClassDef = effectiveBaseClass.GetDefinition();\n\t\t\t\t\tif (effectiveBaseClassDef != null) {\n\t\t\t\t\t\tswitch (effectiveBaseClassDef.KnownTypeCode) {\n\t\t\t\t\t\t\tcase KnownTypeCode.Object:\n\t\t\t\t\t\t\tcase KnownTypeCode.ValueType:\n\t\t\t\t\t\t\tcase KnownTypeCode.Enum:\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (effectiveBaseClass.Kind == TypeKind.Struct || effectiveBaseClass.Kind == TypeKind.Enum) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIType IType.DeclaringType {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tint IType.TypeParameterCount {\n\t\t\tget { return 0; }\n\t\t}\n\n\t\tbool IType.IsParameterized { \n\t\t\tget { return false; }\n\t\t}\n\n\t\treadonly static IList<IType> emptyTypeArguments = new IType[0];\n\t\tIList<IType> IType.TypeArguments {\n\t\t\tget { return emptyTypeArguments; }\n\t\t}\n\n\t\tpublic abstract IEnumerable<IType> DirectBaseTypes { get; }\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tstring INamedElement.Namespace {\n\t\t\tget { return string.Empty; }\n\t\t}\n\t\t\n\t\tstring INamedElement.FullName {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tpublic string ReflectionName {\n\t\t\tget {\n\t\t\t\treturn (this.OwnerType == SymbolKind.Method ? \"``\" : \"`\") + index.ToString(CultureInfo.InvariantCulture);\n\t\t\t}\n\t\t}\n\t\t\n\t\tITypeDefinition IType.GetDefinition()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IType AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitTypeParameter(this);\n\t\t}\n\t\t\n\t\tpublic IType VisitChildren(TypeVisitor visitor)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn TypeParameterReference.Create(this.OwnerType, this.Index);\n\t\t}\n\t\t\n\t\tIEnumerable<IType> IType.GetNestedTypes(Predicate<ITypeDefinition> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IType>.Instance;\n\t\t}\n\t\t\n\t\tIEnumerable<IType> IType.GetNestedTypes(IList<IType> typeArguments, Predicate<ITypeDefinition> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IType>.Instance;\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetConstructors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\tif (this.HasDefaultConstructorConstraint || this.HasValueTypeConstraint) {\n\t\t\t\t\tif (filter == null || filter(DefaultUnresolvedMethod.DummyConstructor)) {\n\t\t\t\t\t\treturn new [] { DefaultResolvedMethod.GetDummyConstructor(compilation, this) };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetConstructors(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetMethods(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetMethods(this, typeArguments, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IProperty>.Instance;\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetProperties(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IField> GetFields(Predicate<IUnresolvedField> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IField>.Instance;\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetFields(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IEvent> GetEvents(Predicate<IUnresolvedEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IEvent>.Instance;\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetEvents(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMember> GetMembers(Predicate<IUnresolvedMember> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMember>.Instance;\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetMembers(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetAccessors(this, FilterNonStatic(filter), options);\n\t\t}\n\n\t\tpublic TypeParameterSubstitution GetSubstitution()\n\t\t{\n\t\t\treturn TypeParameterSubstitution.Identity;\n\t\t}\n\t\t\n\t\tpublic TypeParameterSubstitution GetSubstitution(IList<IType> methodTypeArguments)\n\t\t{\n\t\t\treturn TypeParameterSubstitution.Identity;\n\t\t}\n\n\t\tstatic Predicate<T> FilterNonStatic<T>(Predicate<T> filter) where T : class, IUnresolvedMember\n\t\t{\n\t\t\tif (filter == null)\n\t\t\t\treturn member => !member.IsStatic;\n\t\t\telse\n\t\t\t\treturn member => !member.IsStatic && filter(member);\n\t\t}\n\t\t\n\t\tpublic sealed override bool Equals(object obj)\n\t\t{\n\t\t\treturn Equals(obj as IType);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn base.GetHashCode();\n\t\t}\n\t\t\n\t\tpublic virtual bool Equals(IType other)\n\t\t{\n\t\t\treturn this == other; // use reference equality for type parameters\n\t\t}\n\n\t\tpublic virtual ISymbolReference ToReference()\n\t\t{\n\t\t\tif (owner == null)\n\t\t\t\treturn TypeParameterReference.Create(ownerType, index);\n\t\t\treturn new OwnedTypeParameterReference(owner.ToReference(), index);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn this.ReflectionName + \" (owner=\" + owner + \")\";\n\t\t}\n\t}\n\t\n\tpublic sealed class OwnedTypeParameterReference : ISymbolReference\n\t{\n\t\tISymbolReference owner;\n\t\tint index;\n\t\t\n\t\tpublic OwnedTypeParameterReference(ISymbolReference owner, int index)\n\t\t{\n\t\t\tif (owner == null)\n\t\t\t\tthrow new ArgumentNullException(\"owner\");\n\t\t\tthis.owner = owner;\n\t\t\tthis.index = index;\n\t\t}\n\t\t\n\t\tpublic ISymbol Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tvar entity = owner.Resolve(context) as IEntity;\n\t\t\tif (entity is ITypeDefinition)\n\t\t\t\treturn ((ITypeDefinition)entity).TypeParameters[index];\n\t\t\tif (entity is IMethod)\n\t\t\t\treturn ((IMethod)entity).TypeParameters[index];\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation for IType interface.\n\t/// </summary>\n\t[Serializable]\n\tpublic abstract class AbstractType : IType\n\t{\n\t\tpublic virtual string FullName {\n\t\t\tget {\n\t\t\t\tstring ns = this.Namespace;\n\t\t\t\tstring name = this.Name;\n\t\t\t\tif (string.IsNullOrEmpty(ns)) {\n\t\t\t\t\treturn name;\n\t\t\t\t} else {\n\t\t\t\t\treturn ns + \".\" + name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic abstract string Name { get; }\n\t\t\n\t\tpublic virtual string Namespace {\n\t\t\tget { return string.Empty; }\n\t\t}\n\t\t\n\t\tpublic virtual string ReflectionName {\n\t\t\tget { return this.FullName; }\n\t\t}\n\t\t\n\t\tpublic abstract bool? IsReferenceType  { get; }\n\t\t\n\t\tpublic abstract TypeKind Kind { get; }\n\t\t\n\t\tpublic virtual int TypeParameterCount {\n\t\t\tget { return 0; }\n\t\t}\n\n\t\treadonly static IList<IType> emptyTypeArguments = new IType[0];\n\t\tpublic virtual IList<IType> TypeArguments {\n\t\t\tget { return emptyTypeArguments; }\n\t\t}\n\n\t\tpublic virtual IType DeclaringType {\n\t\t\tget { return null; }\n\t\t}\n\n\t\tpublic virtual bool IsParameterized { \n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic virtual ITypeDefinition GetDefinition()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IType> DirectBaseTypes {\n\t\t\tget { return EmptyList<IType>.Instance; }\n\t\t}\n\t\t\n\t\tpublic abstract ITypeReference ToTypeReference();\n\t\t\n\t\tpublic virtual IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IType>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IType> GetNestedTypes(IList<IType> typeArguments, Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IType>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetConstructors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)\n\t\t{\n\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IProperty>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IField> GetFields(Predicate<IUnresolvedField> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IField>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IEvent> GetEvents(Predicate<IUnresolvedEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IEvent>.Instance;\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMember> GetMembers(Predicate<IUnresolvedMember> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tIEnumerable<IMember> members = GetMethods(filter, options);\n\t\t\treturn members\n\t\t\t\t.Concat(GetProperties(filter, options))\n\t\t\t\t.Concat(GetFields(filter, options))\n\t\t\t\t.Concat(GetEvents(filter, options));\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t}\n\t\t\n\t\tpublic TypeParameterSubstitution GetSubstitution()\n\t\t{\n\t\t\treturn TypeParameterSubstitution.Identity;\n\t\t}\n\t\t\n\t\tpublic TypeParameterSubstitution GetSubstitution(IList<IType> methodTypeArguments)\n\t\t{\n\t\t\treturn TypeParameterSubstitution.Identity;\n\t\t}\n\n\t\tpublic override sealed bool Equals(object obj)\n\t\t{\n\t\t\treturn Equals(obj as IType);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn base.GetHashCode();\n\t\t}\n\t\t\n\t\tpublic virtual bool Equals(IType other)\n\t\t{\n\t\t\treturn this == other; // use reference equality by default\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn this.ReflectionName;\n\t\t}\n\t\t\n\t\tpublic virtual IType AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitOtherType(this);\n\t\t}\n\t\t\n\t\tpublic virtual IType VisitChildren(TypeVisitor visitor)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractUnresolvedEntity.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Base class for <see cref=\"IUnresolvedEntity\"/> implementations.\n\t/// </summary>\n\t[Serializable]\n\tpublic abstract class AbstractUnresolvedEntity : IUnresolvedEntity, IFreezable\n\t{\n\t\t// possible optimizations to reduce the memory usage of AbstractUnresolvedEntity:\n\t\t// - store regions in more compact form (e.g. assume both file names are identical; use ushort for columns)\n\t\t\n\t\tIUnresolvedTypeDefinition declaringTypeDefinition;\n\t\t\n\t\tstring name = string.Empty;\n\t\tIList<IUnresolvedAttribute> attributes;\n\t\tinternal RareFields rareFields;\n\t\t\n\t\t// 1 byte per enum + 2 bytes for flags\n\t\tSymbolKind symbolKind;\n\t\tAccessibility accessibility;\n\t\tinternal BitVector16 flags;\n\t\t\n\t\t// flags for AbstractUnresolvedEntity:\n\t\tinternal const ushort FlagFrozen    = 0x0001;\n\t\tinternal const ushort FlagSealed    = 0x0002;\n\t\tinternal const ushort FlagAbstract  = 0x0004;\n\t\tinternal const ushort FlagShadowing = 0x0008;\n\t\tinternal const ushort FlagSynthetic = 0x0010;\n\t\tinternal const ushort FlagStatic    = 0x0020;\n\t\t// flags for DefaultUnresolvedTypeDefinition/LazyCecilTypeDefinition\n\t\tinternal const ushort FlagAddDefaultConstructorIfRequired = 0x0040;\n\t\tinternal const ushort FlagHasExtensionMethods = 0x0080;\n\t\tinternal const ushort FlagHasNoExtensionMethods = 0x0100;\n\t\tinternal const ushort FlagPartialTypeDefinition = 0x0200;\n\t\t// flags for AbstractUnresolvedMember:\n\t\tinternal const ushort FlagExplicitInterfaceImplementation = 0x0040;\n\t\tinternal const ushort FlagVirtual = 0x0080;\n\t\tinternal const ushort FlagOverride = 0x0100;\n\t\t// flags for DefaultField:\n\t\tinternal const ushort FlagFieldIsReadOnly = 0x1000;\n\t\tinternal const ushort FlagFieldIsVolatile = 0x2000;\n\t\tinternal const ushort FlagFieldIsFixedSize = 0x4000;\n\t\t// flags for DefaultMethod:\n\t\tinternal const ushort FlagExtensionMethod = 0x1000;\n\t\tinternal const ushort FlagPartialMethod = 0x2000;\n\t\tinternal const ushort FlagHasBody = 0x4000;\n\t\tinternal const ushort FlagAsyncMethod = 0x8000;\n\t\t\n\t\tpublic bool IsFrozen {\n\t\t\tget { return flags[FlagFrozen]; }\n\t\t}\n\t\t\n\t\tpublic void Freeze()\n\t\t{\n\t\t\tif (!flags[FlagFrozen]) {\n\t\t\t\tFreezeInternal();\n\t\t\t\tflags[FlagFrozen] = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected virtual void FreezeInternal()\n\t\t{\n\t\t\tattributes = FreezableHelper.FreezeListAndElements(attributes);\n\t\t\tif (rareFields != null)\n\t\t\t\trareFields.FreezeInternal();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Uses the specified interning provider to intern\n\t\t/// strings and lists in this entity.\n\t\t/// This method does not test arbitrary objects to see if they implement ISupportsInterning;\n\t\t/// instead we assume that those are interned immediately when they are created (before they are added to this entity).\n\t\t/// </summary>\n\t\tpublic virtual void ApplyInterningProvider(InterningProvider provider)\n\t\t{\n\t\t\tif (provider == null)\n\t\t\t\tthrow new ArgumentNullException(\"provider\");\n\t\t\tThrowIfFrozen();\n\t\t\tname = provider.Intern(name);\n\t\t\tattributes = provider.InternList(attributes);\n\t\t\tif (rareFields != null)\n\t\t\t\trareFields.ApplyInterningProvider(provider);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a shallow clone of this entity.\n\t\t/// Collections (e.g. a type's member list) will be cloned as well, but the elements\n\t\t/// of said list will not be.\n\t\t/// If this instance is frozen, the clone will be unfrozen.\n\t\t/// </summary>\n\t\tpublic virtual object Clone()\n\t\t{\n\t\t\tvar copy = (AbstractUnresolvedEntity)MemberwiseClone();\n\t\t\tcopy.flags[FlagFrozen] = false;\n\t\t\tif (attributes != null)\n\t\t\t\tcopy.attributes = new List<IUnresolvedAttribute>(attributes);\n\t\t\tif (rareFields != null)\n\t\t\t\tcopy.rareFields = (RareFields)rareFields.Clone();\n\t\t\treturn copy;\n\t\t}\n\t\t\n\t\t[Serializable]\n\t\tinternal class RareFields\n\t\t{\n\t\t\tinternal DomRegion region;\n\t\t\tinternal DomRegion bodyRegion;\n\t\t\tinternal IUnresolvedFile unresolvedFile;\n\t\t\t\n\t\t\tprotected internal virtual void FreezeInternal()\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual void ApplyInterningProvider(InterningProvider provider)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual object Clone()\n\t\t\t{\n\t\t\t\treturn MemberwiseClone();\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected void ThrowIfFrozen()\n\t\t{\n\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t}\n\t\t\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget { return symbolKind; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tsymbolKind = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal virtual RareFields WriteRareFields()\n\t\t{\n\t\t\tThrowIfFrozen();\n\t\t\tif (rareFields == null) rareFields = new RareFields();\n\t\t\treturn rareFields;\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return rareFields != null ? rareFields.region : DomRegion.Empty; }\n\t\t\tset {\n\t\t\t\tif (value != DomRegion.Empty || rareFields != null)\n\t\t\t\t\tWriteRareFields().region = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic DomRegion BodyRegion {\n\t\t\tget { return rareFields != null ? rareFields.bodyRegion : DomRegion.Empty; }\n\t\t\tset {\n\t\t\t\tif (value != DomRegion.Empty || rareFields != null)\n\t\t\t\t\tWriteRareFields().bodyRegion = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedFile UnresolvedFile {\n\t\t\tget { return rareFields != null ? rareFields.unresolvedFile : null; }\n\t\t\tset {\n\t\t\t\tif (value != null || rareFields != null)\n\t\t\t\t\tWriteRareFields().unresolvedFile = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedTypeDefinition DeclaringTypeDefinition {\n\t\t\tget { return declaringTypeDefinition; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tdeclaringTypeDefinition = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> Attributes {\n\t\t\tget {\n\t\t\t\tif (attributes == null)\n\t\t\t\t\tattributes = new List<IUnresolvedAttribute>();\n\t\t\t\treturn attributes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tname = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual string FullName {\n\t\t\tget {\n\t\t\t\tif (declaringTypeDefinition != null)\n\t\t\t\t\treturn declaringTypeDefinition.FullName + \".\" + name;\n\t\t\t\telse if (!string.IsNullOrEmpty(this.Namespace))\n\t\t\t\t\treturn this.Namespace + \".\" + name;\n\t\t\t\telse\n\t\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual string Namespace {\n\t\t\tget {\n\t\t\t\tif (declaringTypeDefinition != null)\n\t\t\t\t\treturn declaringTypeDefinition.Namespace;\n\t\t\t\telse\n\t\t\t\t\treturn string.Empty;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual string ReflectionName {\n\t\t\tget {\n\t\t\t\tif (declaringTypeDefinition != null)\n\t\t\t\t\treturn declaringTypeDefinition.ReflectionName + \".\" + name;\n\t\t\t\telse\n\t\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Accessibility Accessibility {\n\t\t\tget { return accessibility; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\taccessibility = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsStatic {\n\t\t\tget { return flags[FlagStatic]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagStatic] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsAbstract {\n\t\t\tget { return flags[FlagAbstract]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagAbstract] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsSealed {\n\t\t\tget { return flags[FlagSealed]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagSealed] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsShadowing {\n\t\t\tget { return flags[FlagShadowing]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagShadowing] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsSynthetic {\n\t\t\tget { return flags[FlagSynthetic]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagSynthetic] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsPrivate {\n\t\t\tget { return accessibility == Accessibility.Private; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsPublic {\n\t\t\tget { return accessibility == Accessibility.Public; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsProtected {\n\t\t\tget { return accessibility == Accessibility.Protected; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsInternal {\n\t\t\tget { return accessibility == Accessibility.Internal; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsProtectedOrInternal {\n\t\t\tget { return accessibility == Accessibility.ProtectedOrInternal; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsProtectedAndInternal {\n\t\t\tget { return accessibility == Accessibility.ProtectedAndInternal; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(\"[\");\n\t\t\tb.Append(GetType().Name);\n\t\t\tb.Append(' ');\n\t\t\tif (this.DeclaringTypeDefinition != null) {\n\t\t\t\tb.Append(this.DeclaringTypeDefinition.Name);\n\t\t\t\tb.Append('.');\n\t\t\t}\n\t\t\tb.Append(this.Name);\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractUnresolvedMember.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Base class for <see cref=\"IUnresolvedMember\"/> implementations.\n\t/// </summary>\n\t[Serializable]\n\tpublic abstract class AbstractUnresolvedMember : AbstractUnresolvedEntity, IUnresolvedMember\n\t{\n\t\tITypeReference returnType = SpecialType.UnknownType;\n\t\tIList<IMemberReference> interfaceImplementations;\n\t\t\n\t\tpublic override void ApplyInterningProvider(InterningProvider provider)\n\t\t{\n\t\t\tbase.ApplyInterningProvider(provider);\n\t\t\tinterfaceImplementations = provider.InternList(interfaceImplementations);\n\t\t}\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tbase.FreezeInternal();\n\t\t\tinterfaceImplementations = FreezableHelper.FreezeList(interfaceImplementations);\n\t\t}\n\t\t\n\t\tpublic override object Clone()\n\t\t{\n\t\t\tvar copy = (AbstractUnresolvedMember)base.Clone();\n\t\t\tif (interfaceImplementations != null)\n\t\t\t\tcopy.interfaceImplementations = new List<IMemberReference>(interfaceImplementations);\n\t\t\treturn copy;\n\t\t}\n\t\t\n\t\t/*\n\t\t[Serializable]\n\t\tinternal new class RareFields : AbstractUnresolvedEntity.RareFields\n\t\t{\n\t\t\tinternal IList<IMemberReference> interfaceImplementations;\n\t\t\t\n\t\t\tpublic override void ApplyInterningProvider(IInterningProvider provider)\n\t\t\t{\n\t\t\t\tbase.ApplyInterningProvider(provider);\n\t\t\t\tinterfaceImplementations = provider.InternList(interfaceImplementations);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override void FreezeInternal()\n\t\t\t{\n\t\t\t\tinterfaceImplementations = FreezableHelper.FreezeListAndElements(interfaceImplementations);\n\t\t\t\tbase.FreezeInternal();\n\t\t\t}\n\t\t\t\n\t\t\toverride Clone(){}\n\t\t}\n\t\t\n\t\tinternal override AbstractUnresolvedEntity.RareFields WriteRareFields()\n\t\t{\n\t\t\tThrowIfFrozen();\n\t\t\tif (rareFields == null) rareFields = new RareFields();\n\t\t\treturn rareFields;\n\t\t}*/\n\t\t\n\t\tpublic ITypeReference ReturnType {\n\t\t\tget { return returnType; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tThrowIfFrozen();\n\t\t\t\treturnType = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsExplicitInterfaceImplementation {\n\t\t\tget { return flags[FlagExplicitInterfaceImplementation]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagExplicitInterfaceImplementation] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IMemberReference> ExplicitInterfaceImplementations {\n\t\t\tget {\n\t\t\t\t/*\n\t\t\t\tRareFields rareFields = (RareFields)this.rareFields;\n\t\t\t\tif (rareFields == null || rareFields.interfaceImplementations == null) {\n\t\t\t\t\trareFields = (RareFields)WriteRareFields();\n\t\t\t\t\treturn rareFields.interfaceImplementations = new List<IMemberReference>();\n\t\t\t\t}\n\t\t\t\treturn rareFields.interfaceImplementations;\n\t\t\t\t*/\n\t\t\t\tif (interfaceImplementations == null)\n\t\t\t\t\tinterfaceImplementations = new List<IMemberReference>();\n\t\t\t\treturn interfaceImplementations;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsVirtual {\n\t\t\tget { return flags[FlagVirtual]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagVirtual] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsOverride {\n\t\t\tget { return flags[FlagOverride]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagOverride] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsOverridable {\n\t\t\tget {\n\t\t\t\t// override or virtual or abstract but not sealed\n\t\t\t\treturn (flags.Data & (FlagOverride | FlagVirtual | FlagAbstract)) != 0 && !this.IsSealed;\n\t\t\t}\n\t\t}\n\t\t\n\t\tITypeReference IMemberReference.DeclaringTypeReference {\n\t\t\tget { return this.DeclaringTypeDefinition; }\n\t\t}\n\t\t\n\t\t#region Resolve\n\t\tpublic abstract IMember CreateResolved(ITypeResolveContext context);\n\t\t\n\t\tpublic virtual IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tITypeReference interfaceTypeReference = null;\n\t\t\tif (this.IsExplicitInterfaceImplementation && this.ExplicitInterfaceImplementations.Count == 1)\n\t\t\t\tinterfaceTypeReference = this.ExplicitInterfaceImplementations[0].DeclaringTypeReference;\n\t\t\treturn Resolve(ExtendContextForType(context, this.DeclaringTypeDefinition), this.SymbolKind, this.Name, interfaceTypeReference);\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn ((IUnresolvedMember)this).Resolve(context);\n\t\t}\n\t\t\n\t\tprotected static ITypeResolveContext ExtendContextForType(ITypeResolveContext assemblyContext, IUnresolvedTypeDefinition typeDef)\n\t\t{\n\t\t\tif (typeDef == null)\n\t\t\t\treturn assemblyContext;\n\t\t\tITypeResolveContext parentContext;\n\t\t\tif (typeDef.DeclaringTypeDefinition != null)\n\t\t\t\tparentContext = ExtendContextForType(assemblyContext, typeDef.DeclaringTypeDefinition);\n\t\t\telse\n\t\t\t\tparentContext = assemblyContext;\n\t\t\tITypeDefinition resolvedTypeDef = typeDef.Resolve(assemblyContext).GetDefinition();\n\t\t\treturn typeDef.CreateResolveContext(parentContext).WithCurrentTypeDefinition(resolvedTypeDef);\n\t\t}\n\t\t\n\t\tpublic static IMember Resolve(ITypeResolveContext context,\n\t\t                              SymbolKind symbolKind,\n\t\t                              string name,\n\t\t                              ITypeReference explicitInterfaceTypeReference = null,\n\t\t                              IList<string> typeParameterNames = null,\n\t\t                              IList<ITypeReference> parameterTypeReferences = null)\n\t\t{\n\t\t\tif (context.CurrentTypeDefinition == null)\n\t\t\t\treturn null;\n\t\t\tif (parameterTypeReferences == null)\n\t\t\t\tparameterTypeReferences = EmptyList<ITypeReference>.Instance;\n\t\t\tif (typeParameterNames == null || typeParameterNames.Count == 0) {\n\t\t\t\t// non-generic member\n\t\t\t\t// In this case, we can simply resolve the parameter types in the given context\n\t\t\t\tvar parameterTypes = parameterTypeReferences.Resolve(context);\n\t\t\t\tif (explicitInterfaceTypeReference == null) {\n\t\t\t\t\tforeach (IMember member in context.CurrentTypeDefinition.Members) {\n\t\t\t\t\t\tif (member.IsExplicitInterfaceImplementation)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (IsNonGenericMatch(member, symbolKind, name, parameterTypes))\n\t\t\t\t\t\t\treturn member;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tIType explicitInterfaceType = explicitInterfaceTypeReference.Resolve(context);\n\t\t\t\t\tforeach (IMember member in context.CurrentTypeDefinition.Members) {\n\t\t\t\t\t\tif (!member.IsExplicitInterfaceImplementation)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (member.ImplementedInterfaceMembers.Count != 1)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (IsNonGenericMatch(member, symbolKind, name, parameterTypes)) {\n\t\t\t\t\t\t\tif (explicitInterfaceType.Equals(member.ImplementedInterfaceMembers[0].DeclaringType))\n\t\t\t\t\t\t\t\treturn member;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// generic member\n\t\t\t\t// In this case, we must specify the correct context for resolving the parameter types\n\t\t\t\tforeach (IMethod method in context.CurrentTypeDefinition.Methods) {\n\t\t\t\t\tif (method.SymbolKind != symbolKind)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (method.Name != name)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (method.Parameters.Count != parameterTypeReferences.Count)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t// Compare type parameter count and names:\n\t\t\t\t\tif (!typeParameterNames.SequenceEqual(method.TypeParameters.Select(tp => tp.Name)))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t// Once we know the type parameter names are fitting, we can resolve the\n\t\t\t\t\t// type references in the context of the method:\n\t\t\t\t\tvar contextForMethod = context.WithCurrentMember(method);\n\t\t\t\t\tvar parameterTypes = parameterTypeReferences.Resolve(contextForMethod);\n\t\t\t\t\tif (!IsParameterTypeMatch(method, parameterTypes))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (explicitInterfaceTypeReference == null) {\n\t\t\t\t\t\tif (!method.IsExplicitInterfaceImplementation)\n\t\t\t\t\t\t\treturn method;\n\t\t\t\t\t} else if (method.IsExplicitInterfaceImplementation && method.ImplementedInterfaceMembers.Count == 1) {\n\t\t\t\t\t\tIType explicitInterfaceType = explicitInterfaceTypeReference.Resolve(contextForMethod);\n\t\t\t\t\t\tif (explicitInterfaceType.Equals(method.ImplementedInterfaceMembers[0].DeclaringType))\n\t\t\t\t\t\t\treturn method;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tstatic bool IsNonGenericMatch(IMember member, SymbolKind symbolKind, string name, IList<IType> parameterTypes)\n\t\t{\n\t\t\tif (member.SymbolKind != symbolKind)\n\t\t\t\treturn false;\n\t\t\tif (member.Name != name)\n\t\t\t\treturn false;\n\t\t\tIMethod method = member as IMethod;\n\t\t\tif (method != null && method.TypeParameters.Count > 0)\n\t\t\t\treturn false;\n\t\t\treturn IsParameterTypeMatch(member, parameterTypes);\n\t\t}\n\t\t\n\t\tstatic bool IsParameterTypeMatch(IMember member, IList<IType> parameterTypes)\n\t\t{\n\t\t\tIParameterizedMember parameterizedMember = member as IParameterizedMember;\n\t\t\tif (parameterizedMember == null) {\n\t\t\t\treturn parameterTypes.Count == 0;\n\t\t\t} else if (parameterTypes.Count == parameterizedMember.Parameters.Count) {\n\t\t\t\tfor (int i = 0; i < parameterTypes.Count; i++) {\n\t\t\t\t\tIType type1 = parameterTypes[i];\n\t\t\t\t\tIType type2 = parameterizedMember.Parameters[i].Type;\n\t\t\t\t\tif (!type1.Equals(type2)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/AccessorOwnerMemberReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Given a reference to an accessor, returns the accessor's owner.\n\t/// </summary>\n\t[Serializable]\n\tsealed class AccessorOwnerMemberReference : IMemberReference\n\t{\n\t\treadonly IMemberReference accessorReference;\n\t\t\n\t\tpublic AccessorOwnerMemberReference(IMemberReference accessorReference)\n\t\t{\n\t\t\tif (accessorReference == null)\n\t\t\t\tthrow new ArgumentNullException(\"accessorReference\");\n\t\t\tthis.accessorReference = accessorReference;\n\t\t}\n\t\t\n\t\tpublic ITypeReference DeclaringTypeReference {\n\t\t\tget { return accessorReference.DeclaringTypeReference; }\n\t\t}\n\t\t\n\t\tpublic IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIMethod method = accessorReference.Resolve(context) as IMethod;\n\t\t\tif (method != null)\n\t\t\t\treturn method.AccessorOwner;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn ((IMemberReference)this).Resolve(context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/BaseTypeCollector.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Helper class for the GetAllBaseTypes() implementation.\n\t/// </summary>\n\tsealed class BaseTypeCollector : List<IType>\n\t{\n\t\treadonly Stack<IType> activeTypes = new Stack<IType>();\n\t\t\n\t\t/// <summary>\n\t\t/// If this option is enabled, the list will not contain interfaces when retrieving the base types\n\t\t/// of a class.\n\t\t/// </summary>\n\t\tinternal bool SkipImplementedInterfaces;\n\t\t\n\t\tpublic void CollectBaseTypes(IType type)\n\t\t{\n\t\t\tIType def = type.GetDefinition() ?? type;\n\t\t\t\n\t\t\t// Maintain a stack of currently active type definitions, and avoid having one definition\n\t\t\t// multiple times on that stack.\n\t\t\t// This is necessary to ensure the output is finite in the presence of cyclic inheritance:\n\t\t\t// class C<X> : C<C<X>> {} would not be caught by the 'no duplicate output' check, yet would\n\t\t\t// produce infinite output.\n\t\t\tif (activeTypes.Contains(def))\n\t\t\t\treturn;\n\t\t\tactiveTypes.Push(def);\n\t\t\t// Note that we also need to push non-type definitions, e.g. for protecting against\n\t\t\t// cyclic inheritance in type parameters (where T : S where S : T).\n\t\t\t// The output check doesn't help there because we call Add(type) only at the end.\n\t\t\t// We can't simply call this.Add(type); at the start because that would return in an incorrect order.\n\t\t\t\n\t\t\t// Avoid outputting a type more than once - necessary for \"diamond\" multiple inheritance\n\t\t\t// (e.g. C implements I1 and I2, and both interfaces derive from Object)\n\t\t\tif (!this.Contains(type)) {\n\t\t\t\tforeach (IType baseType in type.DirectBaseTypes) {\n\t\t\t\t\tif (SkipImplementedInterfaces && def != null && def.Kind != TypeKind.Interface && def.Kind != TypeKind.TypeParameter) {\n\t\t\t\t\t\tif (baseType.Kind == TypeKind.Interface) {\n\t\t\t\t\t\t\t// skip the interface\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tCollectBaseTypes(baseType);\n\t\t\t\t}\n\t\t\t\t// Add(type) at the end - we want a type to be output only after all its base types were added.\n\t\t\t\tthis.Add(type);\n\t\t\t\t// Note that this is not the same as putting the this.Add() call in front and then reversing the list.\n\t\t\t\t// For the diamond inheritance, Add() at the start produces \"C, I1, Object, I2\",\n\t\t\t\t// while Add() at the end produces \"Object, I1, I2, C\".\n\t\t\t}\n\t\t\tactiveTypes.Pop();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/BlobReader.cs",
    "content": "﻿//\n// BlobReader.cs\n//\n// Author:\n//       Daniel Grunwald <daniel@danielgrunwald.de>\n//\n// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tsealed class BlobReader\n\t{\n\t\tinternal static int GetBlobHashCode(byte[] blob)\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hash = 0;\n\t\t\t\tforeach (byte b in blob) {\n\t\t\t\t\thash *= 257;\n\t\t\t\t\thash += b;\n\t\t\t\t}\n\t\t\t\treturn hash;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static bool BlobEquals(byte[] a, byte[] b)\n\t\t{\n\t\t\tif (a.Length != b.Length)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < a.Length; i++) {\n\t\t\t\tif (a[i] != b[i])\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tbyte[] buffer;\n\t\tint position;\n\t\treadonly IAssembly currentResolvedAssembly;\n\n\t\tpublic BlobReader(byte[] buffer, IAssembly currentResolvedAssembly)\n\t\t{\n\t\t\tif (buffer == null)\n\t\t\t\tthrow new ArgumentNullException(\"buffer\");\n\t\t\tthis.buffer = buffer;\n\t\t\tthis.currentResolvedAssembly = currentResolvedAssembly;\n\t\t}\n\t\t\n\t\tpublic byte ReadByte()\n\t\t{\n\t\t\treturn buffer[position++];\n\t\t}\n\n\t\tpublic sbyte ReadSByte()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn(sbyte) ReadByte();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic byte[] ReadBytes(int length)\n\t\t{\n\t\t\tvar bytes = new byte[length];\n\t\t\tBuffer.BlockCopy(buffer, position, bytes, 0, length);\n\t\t\tposition += length;\n\t\t\treturn bytes;\n\t\t}\n\n\t\tpublic ushort ReadUInt16()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tushort value =(ushort)(buffer[position]\n\t\t\t\t                       |(buffer[position + 1] << 8));\n\t\t\t\tposition += 2;\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\tpublic short ReadInt16()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn(short) ReadUInt16();\n\t\t\t}\n\t\t}\n\n\t\tpublic uint ReadUInt32()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tuint value =(uint)(buffer[position]\n\t\t\t\t                   |(buffer[position + 1] << 8)\n\t\t\t\t                   |(buffer[position + 2] << 16)\n\t\t\t\t                   |(buffer[position + 3] << 24));\n\t\t\t\tposition += 4;\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int ReadInt32()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn(int) ReadUInt32();\n\t\t\t}\n\t\t}\n\n\t\tpublic ulong ReadUInt64()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tuint low = ReadUInt32();\n\t\t\t\tuint high = ReadUInt32();\n\n\t\t\t\treturn(((ulong) high) << 32) | low;\n\t\t\t}\n\t\t}\n\n\t\tpublic long ReadInt64()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn(long) ReadUInt64();\n\t\t\t}\n\t\t}\n\n\t\tpublic uint ReadCompressedUInt32()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tbyte first = ReadByte();\n\t\t\t\tif((first & 0x80) == 0)\n\t\t\t\t\treturn first;\n\n\t\t\t\tif((first & 0x40) == 0)\n\t\t\t\t\treturn((uint)(first & ~0x80) << 8)\n\t\t\t\t\t\t| ReadByte();\n\n\t\t\t\treturn((uint)(first & ~0xc0) << 24)\n\t\t\t\t\t|(uint) ReadByte() << 16\n\t\t\t\t\t|(uint) ReadByte() << 8\n\t\t\t\t\t| ReadByte();\n\t\t\t}\n\t\t}\n\n\t\tpublic float ReadSingle()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tif(!BitConverter.IsLittleEndian) {\n\t\t\t\t\tvar bytes = ReadBytes(4);\n\t\t\t\t\tArray.Reverse(bytes);\n\t\t\t\t\treturn BitConverter.ToSingle(bytes, 0);\n\t\t\t\t}\n\n\t\t\t\tfloat value = BitConverter.ToSingle(buffer, position);\n\t\t\t\tposition += 4;\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\tpublic double ReadDouble()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tif(!BitConverter.IsLittleEndian) {\n\t\t\t\t\tvar bytes = ReadBytes(8);\n\t\t\t\t\tArray.Reverse(bytes);\n\t\t\t\t\treturn BitConverter.ToDouble(bytes, 0);\n\t\t\t\t}\n\n\t\t\t\tdouble value = BitConverter.ToDouble(buffer, position);\n\t\t\t\tposition += 8;\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ResolveResult ReadFixedArg(IType argType)\n\t\t{\n\t\t\tif (argType.Kind == TypeKind.Array) {\n\t\t\t\tif (((ArrayType)argType).Dimensions != 1) {\n\t\t\t\t\t// Only single-dimensional arrays are supported\n\t\t\t\t\treturn ErrorResolveResult.UnknownError;\n\t\t\t\t}\n\t\t\t\tIType elementType = ((ArrayType)argType).ElementType;\n\t\t\t\tuint numElem = ReadUInt32();\n\t\t\t\tif (numElem == 0xffffffff) {\n\t\t\t\t\t// null reference\n\t\t\t\t\treturn new ConstantResolveResult(argType, null);\n\t\t\t\t} else {\n\t\t\t\t\tResolveResult[] elements = new ResolveResult[numElem];\n\t\t\t\t\tfor (int i = 0; i < elements.Length; i++) {\n\t\t\t\t\t\telements[i] = ReadElem(elementType);\n\t\t\t\t\t\t// Stop decoding when encountering an error:\n\t\t\t\t\t\tif (elements[i].IsError)\n\t\t\t\t\t\t\treturn ErrorResolveResult.UnknownError;\n\t\t\t\t\t}\n\t\t\t\t\tIType int32 = currentResolvedAssembly.Compilation.FindType(KnownTypeCode.Int32);\n\t\t\t\t\tResolveResult[] sizeArgs = { new ConstantResolveResult(int32, elements.Length) };\n\t\t\t\t\treturn new ArrayCreateResolveResult(argType, sizeArgs, elements);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn ReadElem(argType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ResolveResult ReadElem(IType elementType)\n\t\t{\n\t\t\tITypeDefinition underlyingType;\n\t\t\tif (elementType.Kind == TypeKind.Enum) {\n\t\t\t\tunderlyingType = elementType.GetDefinition().EnumUnderlyingType.GetDefinition();\n\t\t\t} else {\n\t\t\t\tunderlyingType = elementType.GetDefinition();\n\t\t\t}\n\t\t\tif (underlyingType == null)\n\t\t\t\treturn ErrorResolveResult.UnknownError;\n\t\t\tKnownTypeCode typeCode = underlyingType.KnownTypeCode;\n\t\t\tif (typeCode == KnownTypeCode.Object) {\n\t\t\t\t// boxed value type\n\t\t\t\tIType boxedTyped = ReadCustomAttributeFieldOrPropType();\n\t\t\t\tResolveResult elem = ReadElem(boxedTyped);\n\t\t\t\tif (elem.IsCompileTimeConstant && elem.ConstantValue == null)\n\t\t\t\t\treturn new ConstantResolveResult(elementType, null);\n\t\t\t\telse\n\t\t\t\t\treturn new ConversionResolveResult(elementType, elem, Conversion.BoxingConversion);\n\t\t\t} else if (typeCode == KnownTypeCode.Type) {\n\t\t\t\treturn new TypeOfResolveResult(underlyingType, ReadType());\n\t\t\t} else {\n\t\t\t\treturn new ConstantResolveResult(elementType, ReadElemValue(typeCode));\n\t\t\t}\n\t\t}\n\t\t\n\t\tobject ReadElemValue(KnownTypeCode typeCode)\n\t\t{\n\t\t\tswitch (typeCode) {\n\t\t\t\tcase KnownTypeCode.Boolean:\n\t\t\t\t\treturn ReadByte() != 0;\n\t\t\t\tcase KnownTypeCode.Char:\n\t\t\t\t\treturn (char)ReadUInt16();\n\t\t\t\tcase KnownTypeCode.SByte:\n\t\t\t\t\treturn ReadSByte();\n\t\t\t\tcase KnownTypeCode.Byte:\n\t\t\t\t\treturn ReadByte();\n\t\t\t\tcase KnownTypeCode.Int16:\n\t\t\t\t\treturn ReadInt16();\n\t\t\t\tcase KnownTypeCode.UInt16:\n\t\t\t\t\treturn ReadUInt16();\n\t\t\t\tcase KnownTypeCode.Int32:\n\t\t\t\t\treturn ReadInt32();\n\t\t\t\tcase KnownTypeCode.UInt32:\n\t\t\t\t\treturn ReadUInt32();\n\t\t\t\tcase KnownTypeCode.Int64:\n\t\t\t\t\treturn ReadInt64();\n\t\t\t\tcase KnownTypeCode.UInt64:\n\t\t\t\t\treturn ReadUInt64();\n\t\t\t\tcase KnownTypeCode.Single:\n\t\t\t\t\treturn ReadSingle();\n\t\t\t\tcase KnownTypeCode.Double:\n\t\t\t\t\treturn ReadDouble();\n\t\t\t\tcase KnownTypeCode.String:\n\t\t\t\t\treturn ReadSerString();\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string ReadSerString ()\n\t\t{\n\t\t\tif (buffer [position] == 0xff) {\n\t\t\t\tposition++;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tint length = (int) ReadCompressedUInt32();\n\t\t\tif (length == 0)\n\t\t\t\treturn string.Empty;\n\n\t\t\tstring @string = System.Text.Encoding.UTF8.GetString(\n\t\t\t\tbuffer, position,\n\t\t\t\tbuffer [position + length - 1] == 0 ? length - 1 : length);\n\n\t\t\tposition += length;\n\t\t\treturn @string;\n\t\t}\n\t\t\n\t\tpublic KeyValuePair<IMember, ResolveResult> ReadNamedArg(IType attributeType)\n\t\t{\n\t\t\tSymbolKind memberType;\n\t\t\tvar b = ReadByte();\n\t\t\tswitch (b) {\n\t\t\t\tcase 0x53:\n\t\t\t\t\tmemberType = SymbolKind.Field;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x54:\n\t\t\t\t\tmemberType = SymbolKind.Property;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(string.Format(\"Custom member type 0x{0:x} is not supported.\", b));\n\t\t\t}\n\t\t\tIType type = ReadCustomAttributeFieldOrPropType();\n\t\t\tstring name = ReadSerString();\n\t\t\tResolveResult val = ReadFixedArg(type);\n\t\t\tIMember member = null;\n\t\t\t// Use last matching member, as GetMembers() returns members from base types first.\n\t\t\tforeach (IMember m in attributeType.GetMembers(m => m.SymbolKind == memberType && m.Name == name)) {\n\t\t\t\tif (m.ReturnType.Equals(type))\n\t\t\t\t\tmember = m;\n\t\t\t}\n\t\t\treturn new KeyValuePair<IMember, ResolveResult>(member, val);\n\t\t}\n\n\t\tIType ReadCustomAttributeFieldOrPropType()\n\t\t{\n\t\t\tICompilation compilation = currentResolvedAssembly.Compilation;\n\t\t\tvar b = ReadByte();\n\t\t\tswitch (b) {\n\t\t\t\tcase 0x02:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Boolean);\n\t\t\t\tcase 0x03:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Char);\n\t\t\t\tcase 0x04:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.SByte);\n\t\t\t\tcase 0x05:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Byte);\n\t\t\t\tcase 0x06:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Int16);\n\t\t\t\tcase 0x07:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.UInt16);\n\t\t\t\tcase 0x08:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Int32);\n\t\t\t\tcase 0x09:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.UInt32);\n\t\t\t\tcase 0x0a:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Int64);\n\t\t\t\tcase 0x0b:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.UInt64);\n\t\t\t\tcase 0x0c:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Single);\n\t\t\t\tcase 0x0d:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Double);\n\t\t\t\tcase 0x0e:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.String);\n\t\t\t\tcase 0x1d:\n\t\t\t\t\treturn new ArrayType(compilation, ReadCustomAttributeFieldOrPropType());\n\t\t\t\tcase 0x50:\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Type);\n\t\t\t\tcase 0x51: // boxed value type\n\t\t\t\t\treturn compilation.FindType(KnownTypeCode.Object);\n\t\t\t\tcase 0x55: // enum\n\t\t\t\t\treturn ReadType();\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(string.Format(\"Custom attribute type 0x{0:x} is not supported.\", b));\n\t\t\t}\n\t\t}\n\t\t\n\t\tIType ReadType()\n\t\t{\n\t\t\tstring typeName = ReadSerString();\n\t\t\tITypeReference typeReference = ReflectionHelper.ParseReflectionName(typeName);\n\t\t\tIType typeInCurrentAssembly = typeReference.Resolve(new SimpleTypeResolveContext(currentResolvedAssembly));\n\t\t\tif (typeInCurrentAssembly.Kind != TypeKind.Unknown)\n\t\t\t\treturn typeInCurrentAssembly;\n\t\t\t\n\t\t\t// look for the type in mscorlib\n\t\t\tITypeDefinition systemObject = currentResolvedAssembly.Compilation.FindType(KnownTypeCode.Object).GetDefinition();\n\t\t\tif (systemObject != null) {\n\t\t\t\treturn typeReference.Resolve(new SimpleTypeResolveContext(systemObject.ParentAssembly));\n\t\t\t} else {\n\t\t\t\t// couldn't find corlib - return the unknown IType for the current assembly\n\t\t\t\treturn typeInCurrentAssembly;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultAssemblyReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// References an existing assembly by name.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class DefaultAssemblyReference : IAssemblyReference, ISupportsInterning\n\t{\n\t\tpublic static readonly IAssemblyReference CurrentAssembly = new CurrentAssemblyReference();\n\t\t\n\t\t[Obsolete(\"The corlib is not always called 'mscorlib' (as returned by this property), but might be 'System.Runtime'.\")]\n\t\tpublic static readonly IAssemblyReference Corlib = new DefaultAssemblyReference(\"mscorlib\");\n\t\t\n\t\treadonly string shortName;\n\t\t\n\t\tpublic DefaultAssemblyReference(string assemblyName)\n\t\t{\n\t\t\tint pos = assemblyName != null ? assemblyName.IndexOf(',') : -1;\n\t\t\tif (pos >= 0)\n\t\t\t\tshortName = assemblyName.Substring(0, pos);\n\t\t\telse\n\t\t\t\tshortName = assemblyName;\n\t\t}\n\t\t\n\t\tpublic IAssembly Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIAssembly current = context.CurrentAssembly;\n\t\t\tif (current != null && string.Equals(shortName, current.AssemblyName, StringComparison.OrdinalIgnoreCase))\n\t\t\t\treturn current;\n\t\t\tforeach (IAssembly asm in context.Compilation.Assemblies) {\n\t\t\t\tif (string.Equals(shortName, asm.AssemblyName, StringComparison.OrdinalIgnoreCase))\n\t\t\t\t\treturn asm;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn shortName;\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn shortName.GetHashCode();\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tDefaultAssemblyReference o = other as DefaultAssemblyReference;\n\t\t\treturn o != null && shortName == o.shortName;\n\t\t}\n\t\t\n\t\t[Serializable]\n\t\tsealed class CurrentAssemblyReference : IAssemblyReference\n\t\t{\n\t\t\tpublic IAssembly Resolve(ITypeResolveContext context)\n\t\t\t{\n\t\t\t\tIAssembly asm = context.CurrentAssembly;\n\t\t\t\tif (asm == null)\n\t\t\t\t\tthrow new ArgumentException(\"A reference to the current assembly cannot be resolved in the compilation's global type resolve context.\");\n\t\t\t\treturn asm;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultAttribute.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// IAttribute implementation for already-resolved attributes.\n\t/// </summary>\n\tpublic class DefaultAttribute : IAttribute\n\t{\n\t\treadonly IType attributeType;\n\t\treadonly IList<ResolveResult> positionalArguments;\n\t\treadonly IList<KeyValuePair<IMember, ResolveResult>> namedArguments;\n\t\treadonly DomRegion region;\n\t\tvolatile IMethod constructor;\n\t\t\n\t\tpublic DefaultAttribute(IType attributeType, IList<ResolveResult> positionalArguments = null,\n\t\t                        IList<KeyValuePair<IMember, ResolveResult>> namedArguments = null,\n\t\t                        DomRegion region = default(DomRegion))\n\t\t{\n\t\t\tif (attributeType == null)\n\t\t\t\tthrow new ArgumentNullException(\"attributeType\");\n\t\t\tthis.attributeType = attributeType;\n\t\t\tthis.positionalArguments = positionalArguments ?? EmptyList<ResolveResult>.Instance;\n\t\t\tthis.namedArguments = namedArguments ?? EmptyList<KeyValuePair<IMember, ResolveResult>>.Instance;\n\t\t\tthis.region = region;\n\t\t}\n\t\t\n\t\tpublic DefaultAttribute(IMethod constructor, IList<ResolveResult> positionalArguments = null,\n\t\t                        IList<KeyValuePair<IMember, ResolveResult>> namedArguments = null,\n\t\t                        DomRegion region = default(DomRegion))\n\t\t{\n\t\t\tif (constructor == null)\n\t\t\t\tthrow new ArgumentNullException(\"constructor\");\n\t\t\tthis.constructor = constructor;\n\t\t\tthis.attributeType = constructor.DeclaringType;\n\t\t\tthis.positionalArguments = positionalArguments ?? EmptyList<ResolveResult>.Instance;\n\t\t\tthis.namedArguments = namedArguments ?? EmptyList<KeyValuePair<IMember, ResolveResult>>.Instance;\n\t\t\tthis.region = region;\n\t\t\tif (this.positionalArguments.Count != constructor.Parameters.Count) {\n\t\t\t\tthrow new ArgumentException(\"Positional argument count must match the constructor's parameter count\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IType AttributeType {\n\t\t\tget { return attributeType; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t}\n\t\t\n\t\tpublic IMethod Constructor {\n\t\t\tget {\n\t\t\t\tIMethod ctor = this.constructor;\n\t\t\t\tif (ctor == null) {\n\t\t\t\t\tforeach (IMethod candidate in this.AttributeType.GetConstructors(m => m.Parameters.Count == positionalArguments.Count)) {\n\t\t\t\t\t\tif (candidate.Parameters.Select(p => p.Type).SequenceEqual(this.PositionalArguments.Select(a => a.Type))) {\n\t\t\t\t\t\t\tctor = candidate;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.constructor = ctor;\n\t\t\t\t}\n\t\t\t\treturn ctor;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<ResolveResult> PositionalArguments {\n\t\t\tget { return positionalArguments; }\n\t\t}\n\t\t\n\t\tpublic IList<KeyValuePair<IMember, ResolveResult>> NamedArguments {\n\t\t\tget { return namedArguments; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultMemberReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// References an entity by its type and name.\n\t/// This class can be used to refer to all members except for constructors and explicit interface implementations.\n\t/// </summary>\n\t/// <remarks>\n\t/// Resolving a DefaultMemberReference requires a context that provides enough information for resolving the declaring type reference\n\t/// and the parameter types references.\n\t/// </remarks>\n\t[Serializable]\n\tpublic sealed class DefaultMemberReference : IMemberReference, ISupportsInterning\n\t{\n\t\treadonly SymbolKind symbolKind;\n\t\treadonly ITypeReference typeReference;\n\t\treadonly string name;\n\t\treadonly int typeParameterCount;\n\t\treadonly IList<ITypeReference> parameterTypes;\n\t\t\n\t\tpublic DefaultMemberReference(SymbolKind symbolKind, ITypeReference typeReference, string name, int typeParameterCount = 0, IList<ITypeReference> parameterTypes = null)\n\t\t{\n\t\t\tif (typeReference == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeReference\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tif (typeParameterCount != 0 && symbolKind != SymbolKind.Method)\n\t\t\t\tthrow new ArgumentException(\"Type parameter count > 0 is only supported for methods.\");\n\t\t\tthis.symbolKind = symbolKind;\n\t\t\tthis.typeReference = typeReference;\n\t\t\tthis.name = name;\n\t\t\tthis.typeParameterCount = typeParameterCount;\n\t\t\tthis.parameterTypes = parameterTypes ?? EmptyList<ITypeReference>.Instance;\n\t\t}\n\t\t\n\t\tpublic ITypeReference DeclaringTypeReference {\n\t\t\tget { return typeReference; }\n\t\t}\n\t\t\n\t\tpublic IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIType type = typeReference.Resolve(context);\n\t\t\tIEnumerable<IMember> members;\n\t\t\tif (symbolKind == SymbolKind.Accessor) {\n\t\t\t\tmembers = type.GetAccessors(\n\t\t\t\t\tm => m.Name == name && !m.IsExplicitInterfaceImplementation,\n\t\t\t\t\tGetMemberOptions.IgnoreInheritedMembers);\n\t\t\t} else if (symbolKind == SymbolKind.Method) {\n\t\t\t\tmembers = type.GetMethods(\n\t\t\t\t\tm => m.Name == name && m.SymbolKind == SymbolKind.Method\n\t\t\t\t\t&& m.TypeParameters.Count == typeParameterCount && !m.IsExplicitInterfaceImplementation,\n\t\t\t\t\tGetMemberOptions.IgnoreInheritedMembers);\n\t\t\t} else {\n\t\t\t\tmembers = type.GetMembers(\n\t\t\t\t\tm => m.Name == name && m.SymbolKind == symbolKind && !m.IsExplicitInterfaceImplementation,\n\t\t\t\t\tGetMemberOptions.IgnoreInheritedMembers);\n\t\t\t}\n\t\t\tvar resolvedParameterTypes = parameterTypes.Resolve(context);\n\t\t\tforeach (IMember member in members) {\n\t\t\t\tIParameterizedMember parameterizedMember = member as IParameterizedMember;\n\t\t\t\tif (parameterizedMember == null) {\n\t\t\t\t\tif (parameterTypes.Count == 0)\n\t\t\t\t\t\treturn member;\n\t\t\t\t} else if (parameterTypes.Count == parameterizedMember.Parameters.Count) {\n\t\t\t\t\tbool signatureMatches = true;\n\t\t\t\t\tfor (int i = 0; i < parameterTypes.Count; i++) {\n\t\t\t\t\t\tIType type1 = DummyTypeParameter.NormalizeAllTypeParameters(resolvedParameterTypes[i]);\n\t\t\t\t\t\tIType type2 = DummyTypeParameter.NormalizeAllTypeParameters(parameterizedMember.Parameters[i].Type);\n\t\t\t\t\t\tif (!type1.Equals(type2)) {\n\t\t\t\t\t\t\tsignatureMatches = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (signatureMatches)\n\t\t\t\t\t\treturn member;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn ((IMemberReference)this).Resolve(context);\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn (int)symbolKind ^ typeReference.GetHashCode() ^ name.GetHashCode() ^ parameterTypes.GetHashCode();\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tDefaultMemberReference o = other as DefaultMemberReference;\n\t\t\treturn o != null && symbolKind == o.symbolKind && typeReference == o.typeReference && name == o.name && parameterTypes == o.parameterTypes;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IParameter\"/>.\n\t/// </summary>\n\tpublic sealed class DefaultParameter : IParameter\n\t{\n\t\treadonly IType type;\n\t\treadonly string name;\n\t\treadonly DomRegion region;\n\t\treadonly IList<IAttribute> attributes;\n\t\treadonly bool isRef, isOut, isParams, isOptional;\n\t\treadonly object defaultValue;\n\t\treadonly IParameterizedMember owner;\n\t\t\n\t\tpublic DefaultParameter(IType type, string name)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.type = type;\n\t\t\tthis.name = name;\n\t\t}\n\t\t\n\t\tpublic DefaultParameter(IType type, string name, IParameterizedMember owner = null, DomRegion region = default(DomRegion), IList<IAttribute> attributes = null,\n\t\t                        bool isRef = false, bool isOut = false, bool isParams = false, bool isOptional = false, object defaultValue = null)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.type = type;\n\t\t\tthis.name = name;\n\t\t\tthis.owner = owner;\n\t\t\tthis.region = region;\n\t\t\tthis.attributes = attributes;\n\t\t\tthis.isRef = isRef;\n\t\t\tthis.isOut = isOut;\n\t\t\tthis.isParams = isParams;\n\t\t\tthis.isOptional = isOptional;\n\t\t\tthis.defaultValue = defaultValue;\n\t\t}\n\t\t\n\t\tSymbolKind ISymbol.SymbolKind {\n\t\t\tget { return SymbolKind.Parameter; }\n\t\t}\n\t\t\n\t\tpublic IParameterizedMember Owner {\n\t\t\tget { return owner; }\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> Attributes {\n\t\t\tget { return attributes; }\n\t\t}\n\t\t\n\t\tpublic bool IsRef {\n\t\t\tget { return isRef; }\n\t\t}\n\t\t\n\t\tpublic bool IsOut {\n\t\t\tget { return isOut; }\n\t\t}\n\t\t\n\t\tpublic bool IsParams {\n\t\t\tget { return isParams; }\n\t\t}\n\t\t\n\t\tpublic bool IsOptional {\n\t\t\tget { return isOptional; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t}\n\t\t\n\t\tpublic IType Type {\n\t\t\tget { return type; }\n\t\t}\n\t\t\n\t\tbool IVariable.IsConst {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic object ConstantValue {\n\t\t\tget { return defaultValue; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ToString(this);\n\t\t}\n\t\t\n\t\tpublic static string ToString(IParameter parameter)\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tif (parameter.IsRef)\n\t\t\t\tb.Append(\"ref \");\n\t\t\tif (parameter.IsOut)\n\t\t\t\tb.Append(\"out \");\n\t\t\tif (parameter.IsParams)\n\t\t\t\tb.Append(\"params \");\n\t\t\tb.Append(parameter.Name);\n\t\t\tb.Append(':');\n\t\t\tb.Append(parameter.Type.ReflectionName);\n\t\t\tif (parameter.IsOptional) {\n\t\t\t\tb.Append(\" = \");\n\t\t\t\tif (parameter.ConstantValue != null)\n\t\t\t\t\tb.Append(parameter.ConstantValue.ToString());\n\t\t\t\telse\n\t\t\t\t\tb.Append(\"null\");\n\t\t\t}\n\t\t\treturn b.ToString();\n\t\t}\n\n\t\tpublic ISymbolReference ToReference()\n\t\t{\n\t\t\tif (owner == null)\n\t\t\t\treturn new ParameterReference(type.ToTypeReference(), name, region, isRef, isOut, isParams, isOptional, defaultValue);\n\t\t\treturn new OwnedParameterReference(owner.ToReference(), owner.Parameters.IndexOf(this));\n\t\t}\n\t}\n\t\n\tsealed class OwnedParameterReference : ISymbolReference\n\t{\n\t\treadonly IMemberReference memberReference;\n\t\treadonly int index;\n\t\t\n\t\tpublic OwnedParameterReference(IMemberReference member, int index)\n\t\t{\n\t\t\tif (member == null)\n\t\t\t\tthrow new ArgumentNullException(\"member\");\n\t\t\tthis.memberReference = member;\n\t\t\tthis.index = index;\n\t\t}\n\t\t\n\t\tpublic ISymbol Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIParameterizedMember member = memberReference.Resolve(context) as IParameterizedMember;\n\t\t\tif (member != null && index >= 0 && index < member.Parameters.Count)\n\t\t\t\treturn member.Parameters[index];\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic sealed class ParameterReference : ISymbolReference\n\t{\n\t\treadonly ITypeReference type;\n\t\treadonly string name;\n\t\treadonly DomRegion region;\n\t\treadonly bool isRef, isOut, isParams, isOptional;\n\t\treadonly object defaultValue;\n\t\t\n\t\tpublic ParameterReference(ITypeReference type, string name, DomRegion region, bool isRef, bool isOut, bool isParams, bool isOptional, object defaultValue)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.type = type;\n\t\t\tthis.name = name;\n\t\t\tthis.region = region;\n\t\t\tthis.isRef = isRef;\n\t\t\tthis.isOut = isOut;\n\t\t\tthis.isParams = isParams;\n\t\t\tthis.isOptional = isOptional;\n\t\t\tthis.defaultValue = defaultValue;\n\t\t}\n\n\t\tpublic ISymbol Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultParameter(type.Resolve(context), name, region: region, isRef: isRef, isOut: isOut, isParams: isParams, isOptional: isOptional, defaultValue: defaultValue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedEvent.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic class DefaultResolvedEvent : AbstractResolvedMember, IEvent\n\t{\n\t\tprotected new readonly IUnresolvedEvent unresolved;\n\t\tIMethod addAccessor;\n\t\tIMethod removeAccessor;\n\t\tIMethod invokeAccessor;\n\t\t\n\t\tpublic DefaultResolvedEvent(IUnresolvedEvent unresolved, ITypeResolveContext parentContext)\n\t\t\t: base(unresolved, parentContext)\n\t\t{\n\t\t\tthis.unresolved = unresolved;\n\t\t}\n\t\t\n\t\tpublic bool CanAdd {\n\t\t\tget { return unresolved.CanAdd; }\n\t\t}\n\t\t\n\t\tpublic bool CanRemove {\n\t\t\tget { return unresolved.CanRemove; }\n\t\t}\n\t\t\n\t\tpublic bool CanInvoke {\n\t\t\tget { return unresolved.CanInvoke; }\n\t\t}\n\t\t\n\t\tpublic IMethod AddAccessor {\n\t\t\tget { return GetAccessor(ref addAccessor, unresolved.AddAccessor); }\n\t\t}\n\t\t\n\t\tpublic IMethod RemoveAccessor {\n\t\t\tget { return GetAccessor(ref removeAccessor, unresolved.RemoveAccessor); }\n\t\t}\n\t\t\n\t\tpublic IMethod InvokeAccessor {\n\t\t\tget { return GetAccessor(ref invokeAccessor, unresolved.InvokeAccessor); }\n\t\t}\n\t\t\n\t\tpublic override IMember Specialize(TypeParameterSubstitution substitution)\n\t\t{\n\t\t\tif (TypeParameterSubstitution.Identity.Equals(substitution))\n\t\t\t\treturn this;\n\t\t\treturn new SpecializedEvent(this, substitution);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedField.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic class DefaultResolvedField : AbstractResolvedMember, IField\n\t{\n\t\tvolatile ResolveResult constantValue;\n\t\t\n\t\tpublic DefaultResolvedField(IUnresolvedField unresolved, ITypeResolveContext parentContext)\n\t\t\t: base(unresolved, parentContext)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic bool IsReadOnly {\n\t\t\tget { return ((IUnresolvedField)unresolved).IsReadOnly; }\n\t\t}\n\t\t\n\t\tpublic bool IsVolatile {\n\t\t\tget { return ((IUnresolvedField)unresolved).IsVolatile; }\n\t\t}\n\t\t\n\t\tIType IVariable.Type {\n\t\t\tget { return this.ReturnType; }\n\t\t}\n\t\t\n\t\tpublic bool IsConst {\n\t\t\tget { return ((IUnresolvedField)unresolved).IsConst; }\n\t\t}\n\n\t\tpublic bool IsFixed {\n\t\t\tget { return ((IUnresolvedField)unresolved).IsFixed; }\n\t\t}\n\n\t\tpublic object ConstantValue {\n\t\t\tget {\n\t\t\t\tResolveResult rr = this.constantValue;\n\t\t\t\tif (rr == null) {\n\t\t\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\t\t\tif (!busyLock.Success)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tIConstantValue unresolvedCV = ((IUnresolvedField)unresolved).ConstantValue;\n\t\t\t\t\t\tif (unresolvedCV != null)\n\t\t\t\t\t\t\trr = unresolvedCV.Resolve(context);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\trr = ErrorResolveResult.UnknownError;\n\t\t\t\t\t\tthis.constantValue = rr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn rr.ConstantValue;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IMember Specialize(TypeParameterSubstitution substitution)\n\t\t{\n\t\t\tif (TypeParameterSubstitution.Identity.Equals(substitution))\n\t\t\t\treturn this;\n\t\t\treturn new SpecializedField(this, substitution);\n\t\t}\n\t\t\n\t\tIMemberReference IField.ToReference()\n\t\t{\n\t\t\treturn (IMemberReference)ToReference();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedMethod.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IMethod\"/> that resolves an unresolved method.\n\t/// </summary>\n\tpublic class DefaultResolvedMethod : AbstractResolvedMember, IMethod\n\t{\n\t\tIUnresolvedMethod[] parts;\n\t\t\n\t\tpublic DefaultResolvedMethod(DefaultUnresolvedMethod unresolved, ITypeResolveContext parentContext)\n\t\t\t: this(unresolved, parentContext, unresolved.IsExtensionMethod)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DefaultResolvedMethod(IUnresolvedMethod unresolved, ITypeResolveContext parentContext, bool isExtensionMethod)\n\t\t\t: base(unresolved, parentContext)\n\t\t{\n\t\t\tthis.Parameters = unresolved.Parameters.CreateResolvedParameters(context);\n\t\t\tthis.ReturnTypeAttributes = unresolved.ReturnTypeAttributes.CreateResolvedAttributes(parentContext);\n\t\t\tthis.TypeParameters = unresolved.TypeParameters.CreateResolvedTypeParameters(context);\n\t\t\tthis.IsExtensionMethod = isExtensionMethod;\n\t\t}\n\n\t\tclass ListOfLists<T> : IList<T>\n\t\t{\n\t\t\tList<IList<T>> lists =new List<IList<T>> ();\n\n\t\t\tpublic void AddList(IList<T> list)\n\t\t\t{\n\t\t\t\tlists.Add (list);\n\t\t\t}\n\n\t\t\t#region IEnumerable implementation\n\t\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t\t{\n\t\t\t\treturn GetEnumerator();\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region IEnumerable implementation\n\t\t\tpublic IEnumerator<T> GetEnumerator ()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\t\tyield return this[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region ICollection implementation\n\t\t\tpublic void Add (T item)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tpublic void Clear ()\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tpublic bool Contains (T item)\n\t\t\t{\n\t\t\t\tvar comparer = EqualityComparer<T>.Default;\n\t\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\t\tif (comparer.Equals(this[i], item))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic void CopyTo (T[] array, int arrayIndex)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < Count; i++) {\n\t\t\t\t\tarray[arrayIndex + i] = this[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool Remove (T item)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tpublic int Count {\n\t\t\t\tget {\n\t\t\t\t\treturn lists.Sum (l => l.Count);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsReadOnly {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region IList implementation\n\t\t\tpublic int IndexOf (T item)\n\t\t\t{\n\t\t\t\tvar comparer = EqualityComparer<T>.Default;\n\t\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\t\tif (comparer.Equals(this[i], item))\n\t\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tpublic void Insert (int index, T item)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tpublic void RemoveAt (int index)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tpublic T this[int index] {\n\t\t\t\tget {\n\t\t\t\t\tforeach (var list in lists){\n\t\t\t\t\t\tif (index < list.Count)\n\t\t\t\t\t\t\treturn list[index];\n\t\t\t\t\t\tindex -= list.Count;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new IndexOutOfRangeException ();\n\t\t\t\t}\n\t\t\t\tset {\n\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\n\t\tpublic static DefaultResolvedMethod CreateFromMultipleParts(IUnresolvedMethod[] parts, ITypeResolveContext[] contexts, bool isExtensionMethod)\n\t\t{\n\t\t\tDefaultResolvedMethod method = new DefaultResolvedMethod(parts[0], contexts[0], isExtensionMethod);\n\t\t\tmethod.parts = parts;\n\t\t\tif (parts.Length > 1) {\n\t\t\t\tvar attrs = new ListOfLists <IAttribute>();\n\t\t\t\tattrs.AddList (method.Attributes);\n\t\t\t\tfor (int i = 1; i < parts.Length; i++) {\n\t\t\t\t\tattrs.AddList (parts[i].Attributes.CreateResolvedAttributes(contexts[i]));\n\t\t\t\t}\n\t\t\t\tmethod.Attributes = attrs;\n\t\t\t}\n\t\t\treturn method;\n\t\t}\n\t\t\n\t\tpublic IList<IParameter> Parameters { get; private set; }\n\t\tpublic IList<IAttribute> ReturnTypeAttributes { get; private set; }\n\t\tpublic IList<ITypeParameter> TypeParameters { get; private set; }\n\n\t\tpublic IList<IType> TypeArguments {\n\t\t\tget {\n\t\t\t\t// ToList() call is necessary because IList<> isn't covariant\n\t\t\t\treturn TypeParameters.ToList<IType>();\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IMethod.IsParameterized {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic bool IsExtensionMethod { get; private set; }\n\t\t\n\t\tpublic IList<IUnresolvedMethod> Parts {\n\t\t\tget {\n\t\t\t\treturn parts ?? new IUnresolvedMethod[] { (IUnresolvedMethod)unresolved };\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsConstructor {\n\t\t\tget { return ((IUnresolvedMethod)unresolved).IsConstructor; }\n\t\t}\n\t\t\n\t\tpublic bool IsDestructor {\n\t\t\tget { return ((IUnresolvedMethod)unresolved).IsDestructor; }\n\t\t}\n\t\t\n\t\tpublic bool IsOperator {\n\t\t\tget { return ((IUnresolvedMethod)unresolved).IsOperator; }\n\t\t}\n\t\t\n\t\tpublic bool IsPartial {\n\t\t\tget { return ((IUnresolvedMethod)unresolved).IsPartial; }\n\t\t}\n\n\t\tpublic bool IsAsync {\n\t\t\tget { return ((IUnresolvedMethod)unresolved).IsAsync; }\n\t\t}\n\n\t\tpublic bool HasBody {\n\t\t\tget { return ((IUnresolvedMethod)unresolved).HasBody; }\n\t\t}\n\t\t\n\t\tpublic bool IsAccessor {\n\t\t\tget { return ((IUnresolvedMethod)unresolved).AccessorOwner != null; }\n\t\t}\n\n\t\tIMethod IMethod.ReducedFrom {\n\t\t\tget { return null; }\n\t\t}\n\n\t\tpublic virtual IMember AccessorOwner {\n\t\t\tget {\n\t\t\t\tvar reference = ((IUnresolvedMethod)unresolved).AccessorOwner;\n\t\t\t\tif (reference != null)\n\t\t\t\t\treturn reference.Resolve(context);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override ISymbolReference ToReference()\n\t\t{\n\t\t\tvar declTypeRef = this.DeclaringType.ToTypeReference();\n\t\t\tif (IsExplicitInterfaceImplementation && ImplementedInterfaceMembers.Count == 1) {\n\t\t\t\treturn new ExplicitInterfaceImplementationMemberReference(declTypeRef, ImplementedInterfaceMembers[0].ToReference());\n\t\t\t} else {\n\t\t\t\treturn new DefaultMemberReference(\n\t\t\t\t\tthis.SymbolKind, declTypeRef, this.Name, this.TypeParameters.Count,\n\t\t\t\t\tthis.Parameters.Select(p => p.Type.ToTypeReference()).ToList());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IMemberReference ToMemberReference()\n\t\t{\n\t\t\treturn (IMemberReference)ToReference();\n\t\t}\n\t\t\n\t\tpublic override IMember Specialize(TypeParameterSubstitution substitution)\n\t\t{\n\t\t\tif (TypeParameterSubstitution.Identity.Equals(substitution))\n\t\t\t\treturn this;\n\t\t\treturn new SpecializedMethod(this, substitution);\n\t\t}\n\t\t\n\t\tIMethod IMethod.Specialize(TypeParameterSubstitution substitution)\n\t\t{\n\t\t\tif (TypeParameterSubstitution.Identity.Equals(substitution))\n\t\t\t\treturn this;\n\t\t\treturn new SpecializedMethod(this, substitution);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(\"[\");\n\t\t\tb.Append(this.SymbolKind);\n\t\t\tb.Append(' ');\n\t\t\tif (this.DeclaringType.Kind != TypeKind.Unknown) {\n\t\t\t\tb.Append(this.DeclaringType.ReflectionName);\n\t\t\t\tb.Append('.');\n\t\t\t}\n\t\t\tb.Append(this.Name);\n\t\t\tif (this.TypeParameters.Count > 0) {\n\t\t\t\tb.Append(\"``\");\n\t\t\t\tb.Append(this.TypeParameters.Count);\n\t\t\t}\n\t\t\tb.Append('(');\n\t\t\tfor (int i = 0; i < this.Parameters.Count; i++) {\n\t\t\t\tif (i > 0) b.Append(\", \");\n\t\t\t\tb.Append(this.Parameters[i].ToString());\n\t\t\t}\n\t\t\tb.Append(\"):\");\n\t\t\tb.Append(this.ReturnType.ReflectionName);\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a dummy constructor for the specified compilation.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A public instance constructor with IsSynthetic=true and no declaring type.\n\t\t/// </returns>\n\t\t/// <seealso cref=\"DefaultUnresolvedMethod.DummyConstructor\"/>\n\t\tpublic static IMethod GetDummyConstructor(ICompilation compilation)\n\t\t{\n\t\t\tvar dummyConstructor = DefaultUnresolvedMethod.DummyConstructor;\n\t\t\t// Reuse the same IMethod instance for all dummy constructors\n\t\t\t// so that two occurrences of 'new T()' refer to the same constructor.\n\t\t\treturn (IMethod)compilation.CacheManager.GetOrAddShared(\n\t\t\t\tdummyConstructor, _ => dummyConstructor.CreateResolved(compilation.TypeResolveContext));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a dummy constructor for the specified type.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A public instance constructor with IsSynthetic=true and the specified declaring type.\n\t\t/// </returns>\n\t\t/// <seealso cref=\"DefaultUnresolvedMethod.DummyConstructor\"/>\n\t\tpublic static IMethod GetDummyConstructor(ICompilation compilation, IType declaringType)\n\t\t{\n\t\t\tvar resolvedCtor = GetDummyConstructor(compilation);\n\t\t\treturn new SpecializedMethod(resolvedCtor, TypeParameterSubstitution.Identity) { DeclaringType = declaringType };\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedProperty.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic class DefaultResolvedProperty : AbstractResolvedMember, IProperty\n\t{\n\t\tprotected new readonly IUnresolvedProperty unresolved;\n\t\treadonly IList<IParameter> parameters;\n\t\tIMethod getter;\n\t\tIMethod setter;\n\t\t\n\t\tpublic DefaultResolvedProperty(IUnresolvedProperty unresolved, ITypeResolveContext parentContext)\n\t\t\t: base(unresolved, parentContext)\n\t\t{\n\t\t\tthis.unresolved = unresolved;\n\t\t\tthis.parameters = unresolved.Parameters.CreateResolvedParameters(context);\n\t\t}\n\t\t\n\t\tpublic IList<IParameter> Parameters {\n\t\t\tget { return parameters; }\n\t\t}\n\t\t\n\t\tpublic bool CanGet {\n\t\t\tget { return unresolved.CanGet; }\n\t\t}\n\t\t\n\t\tpublic bool CanSet {\n\t\t\tget { return unresolved.CanSet; }\n\t\t}\n\t\t\n\t\tpublic IMethod Getter {\n\t\t\tget { return GetAccessor(ref getter, unresolved.Getter); }\n\t\t}\n\t\t\n\t\tpublic IMethod Setter {\n\t\t\tget { return GetAccessor(ref setter, unresolved.Setter); }\n\t\t}\n\t\t\n\t\tpublic bool IsIndexer {\n\t\t\tget { return unresolved.IsIndexer; }\n\t\t}\n\t\t\n\t\tpublic override ISymbolReference ToReference()\n\t\t{\n\t\t\tvar declTypeRef = this.DeclaringType.ToTypeReference();\n\t\t\tif (IsExplicitInterfaceImplementation && ImplementedInterfaceMembers.Count == 1) {\n\t\t\t\treturn new ExplicitInterfaceImplementationMemberReference(declTypeRef, ImplementedInterfaceMembers[0].ToReference());\n\t\t\t} else {\n\t\t\t\treturn new DefaultMemberReference(\n\t\t\t\t\tthis.SymbolKind, declTypeRef, this.Name, 0,\n\t\t\t\t\tthis.Parameters.Select(p => p.Type.ToTypeReference()).ToList());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IMember Specialize(TypeParameterSubstitution substitution)\n\t\t{\n\t\t\tif (TypeParameterSubstitution.Identity.Equals(substitution))\n\t\t\t\treturn this;\n\t\t\treturn new SpecializedProperty(this, substitution);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"ITypeDefinition\"/>.\n\t/// </summary>\n\tpublic class DefaultResolvedTypeDefinition : ITypeDefinition\n\t{\n\t\treadonly ITypeResolveContext parentContext;\n\t\treadonly IUnresolvedTypeDefinition[] parts;\n\t\tAccessibility accessibility = Accessibility.Internal;\n\t\tbool isAbstract, isSealed, isShadowing;\n\t\tbool isSynthetic = true; // true if all parts are synthetic\n\t\t\n\t\tpublic DefaultResolvedTypeDefinition(ITypeResolveContext parentContext, params IUnresolvedTypeDefinition[] parts)\n\t\t{\n\t\t\tif (parentContext == null || parentContext.CurrentAssembly == null)\n\t\t\t\tthrow new ArgumentException(\"Parent context does not specify any assembly\", \"parentContext\");\n\t\t\tif (parts == null || parts.Length == 0)\n\t\t\t\tthrow new ArgumentException(\"No parts were specified\", \"parts\");\n\t\t\tthis.parentContext = parentContext;\n\t\t\tthis.parts = parts;\n\t\t\t\n\t\t\tforeach (IUnresolvedTypeDefinition part in parts) {\n\t\t\t\tisAbstract  |= part.IsAbstract;\n\t\t\t\tisSealed    |= part.IsSealed;\n\t\t\t\tisShadowing |= part.IsShadowing;\n\t\t\t\tisSynthetic &= part.IsSynthetic; // true if all parts are synthetic\n\t\t\t\t\n\t\t\t\t// internal is the default, so use another part's accessibility until we find a non-internal accessibility\n\t\t\t\tif (accessibility == Accessibility.Internal)\n\t\t\t\t\taccessibility = part.Accessibility;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<ITypeParameter> typeParameters;\n\t\t\n\t\tpublic IList<ITypeParameter> TypeParameters {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.typeParameters);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tITypeResolveContext contextForTypeParameters = parts[0].CreateResolveContext(parentContext);\n\t\t\t\tcontextForTypeParameters = contextForTypeParameters.WithCurrentTypeDefinition(this);\n\t\t\t\tif (parentContext.CurrentTypeDefinition == null || parentContext.CurrentTypeDefinition.TypeParameterCount == 0) {\n\t\t\t\t\tresult = parts[0].TypeParameters.CreateResolvedTypeParameters(contextForTypeParameters);\n\t\t\t\t} else {\n\t\t\t\t\t// This is a nested class inside a generic class; copy type parameters from outer class if we can:\n\t\t\t\t\tvar outerClass = parentContext.CurrentTypeDefinition;\n\t\t\t\t\tITypeParameter[] typeParameters = new ITypeParameter[parts[0].TypeParameters.Count];\n\t\t\t\t\tfor (int i = 0; i < typeParameters.Length; i++) {\n\t\t\t\t\t\tvar unresolvedTP = parts[0].TypeParameters[i];\n\t\t\t\t\t\tif (i < outerClass.TypeParameterCount && outerClass.TypeParameters[i].Name == unresolvedTP.Name)\n\t\t\t\t\t\t\ttypeParameters[i] = outerClass.TypeParameters[i];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttypeParameters[i] = unresolvedTP.CreateResolvedTypeParameter(contextForTypeParameters);\n\t\t\t\t\t}\n\t\t\t\t\tresult = Array.AsReadOnly(typeParameters);\n\t\t\t\t}\n\t\t\t\treturn LazyInit.GetOrSet(ref this.typeParameters, result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<IAttribute> attributes;\n\t\t\n\t\tpublic IList<IAttribute> Attributes {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.attributes);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tresult = new List<IAttribute>();\n\t\t\t\tvar context = parentContext.WithCurrentTypeDefinition(this);\n\t\t\t\tforeach (IUnresolvedTypeDefinition part in parts) {\n\t\t\t\t\tITypeResolveContext parentContextForPart = part.CreateResolveContext(context);\n\t\t\t\t\tforeach (var attr in part.Attributes) {\n\t\t\t\t\t\tresult.Add(attr.CreateResolvedAttribute(parentContextForPart));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (result.Count == 0)\n\t\t\t\t\tresult = EmptyList<IAttribute>.Instance;\n\t\t\t\treturn LazyInit.GetOrSet(ref this.attributes, result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedTypeDefinition> Parts {\n\t\t\tget { return parts; }\n\t\t}\n\t\t\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget { return parts[0].SymbolKind; }\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use the SymbolKind property instead.\")]\n\t\tpublic EntityType EntityType {\n\t\t\tget { return (EntityType)parts[0].SymbolKind; }\n\t\t}\n\t\t\n\t\tpublic virtual TypeKind Kind {\n\t\t\tget { return parts[0].Kind; }\n\t\t}\n\t\t\n\t\t#region NestedTypes\n\t\tIList<ITypeDefinition> nestedTypes;\n\t\t\n\t\tpublic IList<ITypeDefinition> NestedTypes {\n\t\t\tget {\n\t\t\t\tIList<ITypeDefinition> result = LazyInit.VolatileRead(ref this.nestedTypes);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tresult = (\n\t\t\t\t\t\tfrom part in parts\n\t\t\t\t\t\tfrom nestedTypeRef in part.NestedTypes\n\t\t\t\t\t\tgroup nestedTypeRef by new { nestedTypeRef.Name, nestedTypeRef.TypeParameters.Count } into g\n\t\t\t\t\t\tselect new DefaultResolvedTypeDefinition(new SimpleTypeResolveContext(this), g.ToArray())\n\t\t\t\t\t).ToList<ITypeDefinition>().AsReadOnly();\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.nestedTypes, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Members\n\t\tsealed class MemberList : IList<IMember>\n\t\t{\n\t\t\tinternal readonly ITypeResolveContext[] contextPerMember;\n\t\t\tinternal readonly IUnresolvedMember[] unresolvedMembers;\n\t\t\tinternal readonly IMember[] resolvedMembers;\n\t\t\tinternal readonly int NonPartialMemberCount;\n\t\t\t\n\t\t\tpublic MemberList(List<ITypeResolveContext> contextPerMember, List<IUnresolvedMember> unresolvedNonPartialMembers, List<PartialMethodInfo> partialMethodInfos)\n\t\t\t{\n\t\t\t\tthis.NonPartialMemberCount = unresolvedNonPartialMembers.Count;\n\t\t\t\tthis.contextPerMember = contextPerMember.ToArray();\n\t\t\t\tthis.unresolvedMembers = unresolvedNonPartialMembers.ToArray();\n\t\t\t\tif (partialMethodInfos == null) {\n\t\t\t\t\tthis.resolvedMembers = new IMember[unresolvedNonPartialMembers.Count];\n\t\t\t\t} else {\n\t\t\t\t\tthis.resolvedMembers = new IMember[unresolvedNonPartialMembers.Count + partialMethodInfos.Count];\n\t\t\t\t\tfor (int i = 0; i < partialMethodInfos.Count; i++) {\n\t\t\t\t\t\tvar info = partialMethodInfos[i];\n\t\t\t\t\t\tint memberIndex = NonPartialMemberCount + i;\n\t\t\t\t\t\tresolvedMembers[memberIndex] = DefaultResolvedMethod.CreateFromMultipleParts(\n\t\t\t\t\t\t\tinfo.Parts.ToArray(), info.Contexts.ToArray (), false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic IMember this[int index] {\n\t\t\t\tget {\n\t\t\t\t\tIMember output = LazyInit.VolatileRead(ref resolvedMembers[index]);\n\t\t\t\t\tif (output != null) {\n\t\t\t\t\t\treturn output;\n\t\t\t\t\t}\n\t\t\t\t\treturn LazyInit.GetOrSet(ref resolvedMembers[index], unresolvedMembers[index].CreateResolved(contextPerMember[index]));\n\t\t\t\t}\n\t\t\t\tset { throw new NotSupportedException(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Count {\n\t\t\t\tget { return resolvedMembers.Length; }\n\t\t\t}\n\t\t\t\n\t\t\tbool ICollection<IMember>.IsReadOnly {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int IndexOf(IMember item)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\t\tif (this[i].Equals(item))\n\t\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\t\n\t\t\tvoid IList<IMember>.Insert(int index, IMember item)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tvoid IList<IMember>.RemoveAt(int index)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tvoid ICollection<IMember>.Add(IMember item)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tvoid ICollection<IMember>.Clear()\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tbool ICollection<IMember>.Contains(IMember item)\n\t\t\t{\n\t\t\t\treturn IndexOf(item) >= 0;\n\t\t\t}\n\t\t\t\n\t\t\tvoid ICollection<IMember>.CopyTo(IMember[] array, int arrayIndex)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\t\tarray[arrayIndex + i] = this[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbool ICollection<IMember>.Remove(IMember item)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerator<IMember> GetEnumerator()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\t\tyield return this[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t\t{\n\t\t\t\treturn GetEnumerator();\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class PartialMethodInfo\n\t\t{\n\t\t\tpublic readonly string Name;\n\t\t\tpublic readonly int TypeParameterCount;\n\t\t\tpublic readonly IList<IParameter> Parameters;\n\t\t\tpublic readonly List<IUnresolvedMethod> Parts = new List<IUnresolvedMethod>();\n\t\t\tpublic readonly List<ITypeResolveContext> Contexts = new List<ITypeResolveContext>();\n\n\t\t\tpublic PartialMethodInfo(IUnresolvedMethod method, ITypeResolveContext context)\n\t\t\t{\n\t\t\t\tthis.Name = method.Name;\n\t\t\t\tthis.TypeParameterCount = method.TypeParameters.Count;\n\t\t\t\tthis.Parameters = method.Parameters.CreateResolvedParameters(context);\n\t\t\t\tthis.Parts.Add(method);\n\t\t\t\tthis.Contexts.Add (context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic void AddPart(IUnresolvedMethod method, ITypeResolveContext context)\n\t\t\t{\n\t\t\t\tif (method.HasBody) {\n\t\t\t\t\t// make the implementation the primary part\n\t\t\t\t\tthis.Parts.Insert(0, method);\n\t\t\t\t\tthis.Contexts.Insert (0, context);\n\t\t\t\t} else {\n\t\t\t\t\tthis.Parts.Add(method);\n\t\t\t\t\tthis.Contexts.Add (context);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool IsSameSignature(PartialMethodInfo other, StringComparer nameComparer)\n\t\t\t{\n\t\t\t\treturn nameComparer.Equals(this.Name, other.Name)\n\t\t\t\t\t&& this.TypeParameterCount == other.TypeParameterCount\n\t\t\t\t\t&& ParameterListComparer.Instance.Equals(this.Parameters, other.Parameters);\n\t\t\t}\n\t\t}\n\t\t\n\t\tMemberList memberList;\n\t\t\n\t\tMemberList GetMemberList()\n\t\t{\n\t\t\tvar result = LazyInit.VolatileRead(ref this.memberList);\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tList<IUnresolvedMember> unresolvedMembers = new List<IUnresolvedMember>();\n\t\t\tList<ITypeResolveContext> contextPerMember = new List<ITypeResolveContext>();\n\t\t\tList<PartialMethodInfo> partialMethodInfos = null;\n\t\t\tbool addDefaultConstructorIfRequired = false;\n\t\t\tforeach (IUnresolvedTypeDefinition part in parts) {\n\t\t\t\tITypeResolveContext parentContextForPart = part.CreateResolveContext(parentContext);\n\t\t\t\tITypeResolveContext contextForPart = parentContextForPart.WithCurrentTypeDefinition(this);\n\t\t\t\tforeach (var member in part.Members) {\n\t\t\t\t\tIUnresolvedMethod method = member as IUnresolvedMethod;\n\t\t\t\t\tif (method != null && method.IsPartial) {\n\t\t\t\t\t\t// Merge partial method declaration and implementation\n\t\t\t\t\t\tif (partialMethodInfos == null)\n\t\t\t\t\t\t\tpartialMethodInfos = new List<PartialMethodInfo>();\n\t\t\t\t\t\tPartialMethodInfo newInfo = new PartialMethodInfo(method, contextForPart);\n\t\t\t\t\t\tPartialMethodInfo existingInfo = null;\n\t\t\t\t\t\tforeach (var info in partialMethodInfos) {\n\t\t\t\t\t\t\tif (newInfo.IsSameSignature(info, Compilation.NameComparer)) {\n\t\t\t\t\t\t\t\texistingInfo = info;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (existingInfo != null) {\n\t\t\t\t\t\t\t// Add the unresolved method to the PartialMethodInfo:\n\t\t\t\t\t\t\texistingInfo.AddPart(method, contextForPart);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpartialMethodInfos.Add(newInfo);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunresolvedMembers.Add(member);\n\t\t\t\t\t\tcontextPerMember.Add(contextForPart);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\taddDefaultConstructorIfRequired |= part.AddDefaultConstructorIfRequired;\n\t\t\t}\n\t\t\tif (addDefaultConstructorIfRequired) {\n\t\t\t\tTypeKind kind = this.Kind;\n\t\t\t\tif (kind == TypeKind.Class && !this.IsStatic && !unresolvedMembers.Any(m => m.SymbolKind == SymbolKind.Constructor && !m.IsStatic)\n\t\t\t\t    || kind == TypeKind.Enum || kind == TypeKind.Struct)\n\t\t\t\t{\n\t\t\t\t\tcontextPerMember.Add(parts[0].CreateResolveContext(parentContext).WithCurrentTypeDefinition(this));\n\t\t\t\t\tunresolvedMembers.Add(DefaultUnresolvedMethod.CreateDefaultConstructor(parts[0]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult = new MemberList(contextPerMember, unresolvedMembers, partialMethodInfos);\n\t\t\treturn LazyInit.GetOrSet(ref this.memberList, result);\n\t\t}\n\t\t\n\t\tpublic IList<IMember> Members {\n\t\t\tget { return GetMemberList(); }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IField> Fields {\n\t\t\tget {\n\t\t\t\tvar members = GetMemberList();\n\t\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\t\tif (members.unresolvedMembers[i].SymbolKind == SymbolKind.Field)\n\t\t\t\t\t\tyield return (IField)members[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> Methods {\n\t\t\tget {\n\t\t\t\tvar members = GetMemberList();\n\t\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\t\tif (members.unresolvedMembers[i] is IUnresolvedMethod)\n\t\t\t\t\t\tyield return (IMethod)members[i];\n\t\t\t\t}\n\t\t\t\tfor (int i = members.unresolvedMembers.Length; i < members.Count; i++) {\n\t\t\t\t\tyield return (IMethod)members[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IProperty> Properties {\n\t\t\tget {\n\t\t\t\tvar members = GetMemberList();\n\t\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\t\tswitch (members.unresolvedMembers[i].SymbolKind) {\n\t\t\t\t\t\tcase SymbolKind.Property:\n\t\t\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\t\t\t\tyield return (IProperty)members[i];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IEvent> Events {\n\t\t\tget {\n\t\t\t\tvar members = GetMemberList();\n\t\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\t\tif (members.unresolvedMembers[i].SymbolKind == SymbolKind.Event)\n\t\t\t\t\t\tyield return (IEvent)members[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tvolatile KnownTypeCode knownTypeCode = (KnownTypeCode)(-1);\n\t\t\n\t\tpublic KnownTypeCode KnownTypeCode {\n\t\t\tget {\n\t\t\t\tKnownTypeCode result = this.knownTypeCode;\n\t\t\t\tif (result == (KnownTypeCode)(-1)) {\n\t\t\t\t\tresult = KnownTypeCode.None;\n\t\t\t\t\tICompilation compilation = this.Compilation;\n\t\t\t\t\tfor (int i = 0; i < KnownTypeReference.KnownTypeCodeCount; i++) {\n\t\t\t\t\t\tif (compilation.FindType((KnownTypeCode)i) == this) {\n\t\t\t\t\t\t\tresult = (KnownTypeCode)i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.knownTypeCode = result;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t\n\t\tvolatile IType enumUnderlyingType;\n\t\t\n\t\tpublic IType EnumUnderlyingType {\n\t\t\tget {\n\t\t\t\tIType result = this.enumUnderlyingType;\n\t\t\t\tif (result == null) {\n\t\t\t\t\tif (this.Kind == TypeKind.Enum) {\n\t\t\t\t\t\tresult = CalculateEnumUnderlyingType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = SpecialType.UnknownType;\n\t\t\t\t\t}\n\t\t\t\t\tthis.enumUnderlyingType = result;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIType CalculateEnumUnderlyingType()\n\t\t{\n\t\t\tforeach (var part in parts) {\n\t\t\t\tvar context = part.CreateResolveContext(parentContext).WithCurrentTypeDefinition(this);\n\t\t\t\tforeach (var baseTypeRef in part.BaseTypes) {\n\t\t\t\t\tIType type = baseTypeRef.Resolve(context);\n\t\t\t\t\tif (type.Kind != TypeKind.Unknown)\n\t\t\t\t\t\treturn type;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.Compilation.FindType(KnownTypeCode.Int32);\n\t\t}\n\t\t\n\t\tvolatile byte hasExtensionMethods; // 0 = unknown, 1 = true, 2 = false\n\t\t\n\t\tpublic bool HasExtensionMethods {\n\t\t\tget {\n\t\t\t\tbyte val = this.hasExtensionMethods;\n\t\t\t\tif (val == 0) {\n\t\t\t\t\tif (CalculateHasExtensionMethods())\n\t\t\t\t\t\tval = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tval = 2;\n\t\t\t\t\tthis.hasExtensionMethods = val;\n\t\t\t\t}\n\t\t\t\treturn val == 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool CalculateHasExtensionMethods()\n\t\t{\n\t\t\tbool noExtensionMethods = true;\n\t\t\tforeach (var part in parts) {\n\t\t\t\t// Return true if any part has extension methods\n\t\t\t\tif (part.HasExtensionMethods == true)\n\t\t\t\t\treturn true;\n\t\t\t\tif (part.HasExtensionMethods == null)\n\t\t\t\t\tnoExtensionMethods = false;\n\t\t\t}\n\t\t\t// Return false if all parts are known to have no extension methods\n\t\t\tif (noExtensionMethods)\n\t\t\t\treturn false;\n\t\t\t// If unsure, look at the resolved methods.\n\t\t\treturn Methods.Any(m => m.IsExtensionMethod);\n\t\t}\n\t\t\n\t\tpublic bool IsPartial {\n\t\t\tget { return parts.Length > 1 || parts[0].IsPartial; }\n\t\t}\n\t\t\n\t\tpublic bool? IsReferenceType {\n\t\t\tget {\n\t\t\t\tswitch (this.Kind) {\n\t\t\t\t\tcase TypeKind.Class:\n\t\t\t\t\tcase TypeKind.Interface:\n\t\t\t\t\tcase TypeKind.Module:\n\t\t\t\t\tcase TypeKind.Delegate:\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tcase TypeKind.Struct:\n\t\t\t\t\tcase TypeKind.Enum:\n\t\t\t\t\tcase TypeKind.Void:\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Invalid value for TypeKind\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int TypeParameterCount {\n\t\t\tget { return parts[0].TypeParameters.Count; }\n\t\t}\n\n\t\tpublic IList<IType> TypeArguments {\n\t\t\tget {\n\t\t\t\t// ToList() call is necessary because IList<> isn't covariant\n\t\t\t\treturn TypeParameters.ToList<IType>();\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsParameterized {\n\t\t\tget { return false; }\n\t\t}\n\n\t\t#region DirectBaseTypes\n\t\tIList<IType> directBaseTypes;\n\t\t\n\t\tpublic IEnumerable<IType> DirectBaseTypes {\n\t\t\tget {\n\t\t\t\tIList<IType> result = LazyInit.VolatileRead(ref this.directBaseTypes);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\t\tif (busyLock.Success) {\n\t\t\t\t\t\tresult = CalculateDirectBaseTypes();\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.directBaseTypes, result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This can happen for \"class Test : $Test.Base$ { public class Base {} }\"\n\t\t\t\t\t\t// and also for the valid code\n\t\t\t\t\t\t// \"class Test : Base<Test.Inner> { public class Inner {} }\"\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Don't cache the error!\n\t\t\t\t\t\treturn EmptyList<IType>.Instance;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<IType> CalculateDirectBaseTypes()\n\t\t{\n\t\t\tList<IType> result = new List<IType>();\n\t\t\tbool hasNonInterface = false;\n\t\t\tif (this.Kind != TypeKind.Enum) {\n\t\t\t\tforeach (var part in parts) {\n\t\t\t\t\tvar context = part.CreateResolveContext(parentContext).WithCurrentTypeDefinition(this);\n\t\t\t\t\tforeach (var baseTypeRef in part.BaseTypes) {\n\t\t\t\t\t\tIType baseType = baseTypeRef.Resolve(context);\n\t\t\t\t\t\tif (!(baseType.Kind == TypeKind.Unknown || result.Contains(baseType))) {\n\t\t\t\t\t\t\tresult.Add(baseType);\n\t\t\t\t\t\t\tif (baseType.Kind != TypeKind.Interface)\n\t\t\t\t\t\t\t\thasNonInterface = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!hasNonInterface && !(this.Name == \"Object\" && this.Namespace == \"System\" && this.TypeParameterCount == 0)) {\n\t\t\t\tKnownTypeCode primitiveBaseType;\n\t\t\t\tswitch (this.Kind) {\n\t\t\t\t\tcase TypeKind.Enum:\n\t\t\t\t\t\tprimitiveBaseType = KnownTypeCode.Enum;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeKind.Struct:\n\t\t\t\t\tcase TypeKind.Void:\n\t\t\t\t\t\tprimitiveBaseType = KnownTypeCode.ValueType;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeKind.Delegate:\n\t\t\t\t\t\tprimitiveBaseType = KnownTypeCode.Delegate;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tprimitiveBaseType = KnownTypeCode.Object;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tIType t = parentContext.Compilation.FindType(primitiveBaseType);\n\t\t\t\tif (t.Kind != TypeKind.Unknown)\n\t\t\t\t\tresult.Add(t);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic string FullName {\n\t\t\tget { return parts[0].FullName; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return parts[0].Name; }\n\t\t}\n\t\t\n\t\tpublic string ReflectionName {\n\t\t\tget { return parts[0].ReflectionName; }\n\t\t}\n\t\t\n\t\tpublic string Namespace {\n\t\t\tget { return parts[0].Namespace; }\n\t\t}\n\t\t\n\t\tpublic FullTypeName FullTypeName {\n\t\t\tget { return parts[0].FullTypeName; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return parts[0].Region; }\n\t\t}\n\t\t\n\t\tpublic DomRegion BodyRegion {\n\t\t\tget { return parts[0].BodyRegion; }\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition DeclaringTypeDefinition {\n\t\t\tget { return parentContext.CurrentTypeDefinition; }\n\t\t}\n\t\t\n\t\tpublic IType DeclaringType {\n\t\t\tget { return parentContext.CurrentTypeDefinition; }\n\t\t}\n\t\t\n\t\tpublic IAssembly ParentAssembly {\n\t\t\tget { return parentContext.CurrentAssembly; }\n\t\t}\n\t\t\n\t\tpublic virtual DocumentationComment Documentation {\n\t\t\tget {\n\t\t\t\tforeach (var part in parts) {\n\t\t\t\t\tvar unresolvedProvider = part.UnresolvedFile as IUnresolvedDocumentationProvider;\n\t\t\t\t\tif (unresolvedProvider != null) {\n\t\t\t\t\t\tvar doc = unresolvedProvider.GetDocumentation(part, this);\n\t\t\t\t\t\tif (doc != null)\n\t\t\t\t\t\t\treturn doc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tIDocumentationProvider provider = AbstractResolvedEntity.FindDocumentation(parentContext);\n\t\t\t\tif (provider != null)\n\t\t\t\t\treturn provider.GetDocumentation(this);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return parentContext.Compilation; }\n\t\t}\n\t\t\n\t\t#region Modifiers\n\t\tpublic bool IsStatic    { get { return isAbstract && isSealed; } }\n\t\tpublic bool IsAbstract  { get { return isAbstract; } }\n\t\tpublic bool IsSealed    { get { return isSealed; } }\n\t\tpublic bool IsShadowing { get { return isShadowing; } }\n\t\tpublic bool IsSynthetic { get { return isSynthetic; } }\n\t\t\n\t\tpublic Accessibility Accessibility {\n\t\t\tget { return accessibility; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsPrivate {\n\t\t\tget { return accessibility == Accessibility.Private; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsPublic {\n\t\t\tget { return accessibility == Accessibility.Public; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsProtected {\n\t\t\tget { return accessibility == Accessibility.Protected; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsInternal {\n\t\t\tget { return accessibility == Accessibility.Internal; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsProtectedOrInternal {\n\t\t\tget { return accessibility == Accessibility.ProtectedOrInternal; }\n\t\t}\n\t\t\n\t\tbool IHasAccessibility.IsProtectedAndInternal {\n\t\t\tget { return accessibility == Accessibility.ProtectedAndInternal; }\n\t\t}\n\t\t#endregion\n\t\t\n\t\tITypeDefinition IType.GetDefinition()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tIType IType.AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitTypeDefinition(this);\n\t\t}\n\t\t\n\t\tIType IType.VisitChildren(TypeVisitor visitor)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic ITypeReference ToTypeReference()\n\t\t{\n\t\t\tITypeDefinition declTypeDef = this.DeclaringTypeDefinition;\n\t\t\tif (declTypeDef != null) {\n\t\t\t\treturn new NestedTypeReference(declTypeDef.ToTypeReference(), this.Name, this.TypeParameterCount - declTypeDef.TypeParameterCount);\n\t\t\t} else {\n\t\t\t\tIAssembly asm = this.ParentAssembly;\n\t\t\t\tIAssemblyReference asmRef;\n\t\t\t\tif (asm != null)\n\t\t\t\t\tasmRef = new DefaultAssemblyReference(asm.AssemblyName);\n\t\t\t\telse\n\t\t\t\t\tasmRef = null;\n\t\t\t\treturn new GetClassTypeReference(asmRef, this.Namespace, this.Name, this.TypeParameterCount);\n\t\t\t}\n\t\t}\n\t\t\n\t\tISymbolReference ISymbol.ToReference()\n\t\t{\n\t\t\treturn (ISymbolReference)ToTypeReference();\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tconst GetMemberOptions opt = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;\n\t\t\tif ((options & opt) == opt) {\n\t\t\t\tif (filter == null)\n\t\t\t\t\treturn this.NestedTypes;\n\t\t\t\telse\n\t\t\t\t\treturn GetNestedTypesImpl(filter);\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetNestedTypes(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIEnumerable<IType> GetNestedTypesImpl(Predicate<ITypeDefinition> filter)\n\t\t{\n\t\t\tforeach (var nestedType in this.NestedTypes) {\n\t\t\t\tif (filter(nestedType))\n\t\t\t\t\tyield return nestedType;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IType> GetNestedTypes(IList<IType> typeArguments, Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn GetMembersHelper.GetNestedTypes(this, typeArguments, filter, options);\n\t\t}\n\t\t\n\t\t#region GetMembers()\n\t\tIEnumerable<IMember> GetFilteredMembers(Predicate<IUnresolvedMember> filter)\n\t\t{\n\t\t\tvar members = GetMemberList();\n\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\tif (filter == null || filter(members.unresolvedMembers[i])) {\n\t\t\t\t\tyield return members[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = members.unresolvedMembers.Length; i < members.Count; i++) {\n\t\t\t\tvar method = (IMethod)members[i];\n\t\t\t\tbool ok = false;\n\t\t\t\tforeach (var part in method.Parts) {\n\t\t\t\t\tif (filter == null || filter(part)) {\n\t\t\t\t\t\tok = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok)\n\t\t\t\t\tyield return method;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIEnumerable<IMethod> GetFilteredMethods(Predicate<IUnresolvedMethod> filter)\n\t\t{\n\t\t\tvar members = GetMemberList();\n\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\tIUnresolvedMethod unresolved = members.unresolvedMembers[i] as IUnresolvedMethod;\n\t\t\t\tif (unresolved != null && (filter == null || filter(unresolved))) {\n\t\t\t\t\tyield return (IMethod)members[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = members.unresolvedMembers.Length; i < members.Count; i++) {\n\t\t\t\tvar method = (IMethod)members[i];\n\t\t\t\tbool ok = false;\n\t\t\t\tforeach (var part in method.Parts) {\n\t\t\t\t\tif (filter == null || filter(part)) {\n\t\t\t\t\t\tok = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok)\n\t\t\t\t\tyield return method;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIEnumerable<TResolved> GetFilteredNonMethods<TUnresolved, TResolved>(Predicate<TUnresolved> filter) where TUnresolved : class, IUnresolvedMember where TResolved : class, IMember\n\t\t{\n\t\t\tvar members = GetMemberList();\n\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\tTUnresolved unresolved = members.unresolvedMembers[i] as TUnresolved;\n\t\t\t\tif (unresolved != null && (filter == null || filter(unresolved))) {\n\t\t\t\t\tyield return (TResolved)members[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFilteredMethods(Utils.ExtensionMethods.And(m => !m.IsConstructor, filter));\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetMethods(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\treturn GetMembersHelper.GetMethods(this, typeArguments, filter, options);\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetConstructors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)\n\t\t{\n\t\t\tif (ComHelper.IsComImport(this)) {\n\t\t\t\tIType coClass = ComHelper.GetCoClass(this);\n\t\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\t\tif (busyLock.Success) {\n\t\t\t\t\t\treturn coClass.GetConstructors(filter, options)\n\t\t\t\t\t\t\t.Select(m => new SpecializedMethod(m, m.Substitution) { DeclaringType = this });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\t}\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFilteredMethods(Utils.ExtensionMethods.And(m => m.IsConstructor && !m.IsStatic, filter));\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetConstructors(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFilteredNonMethods<IUnresolvedProperty, IProperty>(filter);\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetProperties(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IField> GetFields(Predicate<IUnresolvedField> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFilteredNonMethods<IUnresolvedField, IField>(filter);\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetFields(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IEvent> GetEvents(Predicate<IUnresolvedEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFilteredNonMethods<IUnresolvedEvent, IEvent>(filter);\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetEvents(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMember> GetMembers(Predicate<IUnresolvedMember> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFilteredMembers(filter);\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetMembers(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFilteredAccessors(filter);\n\t\t\t} else {\n\t\t\t\treturn GetMembersHelper.GetAccessors(this, filter, options);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIEnumerable<IMethod> GetFilteredAccessors(Predicate<IUnresolvedMethod> filter)\n\t\t{\n\t\t\tvar members = GetMemberList();\n\t\t\tfor (int i = 0; i < members.unresolvedMembers.Length; i++) {\n\t\t\t\tIUnresolvedMember unresolved = members.unresolvedMembers[i];\n\t\t\t\tvar unresolvedProperty = unresolved as IUnresolvedProperty;\n\t\t\t\tvar unresolvedEvent = unresolved as IUnresolvedEvent;\n\t\t\t\tif (unresolvedProperty != null) {\n\t\t\t\t\tif (unresolvedProperty.CanGet && (filter == null || filter(unresolvedProperty.Getter)))\n\t\t\t\t\t\tyield return ((IProperty)members[i]).Getter;\n\t\t\t\t\tif (unresolvedProperty.CanSet && (filter == null || filter(unresolvedProperty.Setter)))\n\t\t\t\t\t\tyield return ((IProperty)members[i]).Setter;\n\t\t\t\t} else if (unresolvedEvent != null) {\n\t\t\t\t\tif (unresolvedEvent.CanAdd && (filter == null || filter(unresolvedEvent.AddAccessor)))\n\t\t\t\t\t\tyield return ((IEvent)members[i]).AddAccessor;\n\t\t\t\t\tif (unresolvedEvent.CanRemove && (filter == null || filter(unresolvedEvent.RemoveAccessor)))\n\t\t\t\t\t\tyield return ((IEvent)members[i]).RemoveAccessor;\n\t\t\t\t\tif (unresolvedEvent.CanInvoke && (filter == null || filter(unresolvedEvent.InvokeAccessor)))\n\t\t\t\t\t\tyield return ((IEvent)members[i]).InvokeAccessor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetInterfaceImplementation\n\t\tpublic IMember GetInterfaceImplementation(IMember interfaceMember)\n\t\t{\n\t\t\treturn GetInterfaceImplementation(new[] { interfaceMember })[0];\n\t\t}\n\t\t\n\t\tpublic IList<IMember> GetInterfaceImplementation(IList<IMember> interfaceMembers)\n\t\t{\n\t\t\t// TODO: review the subtle rules for interface reimplementation,\n\t\t\t// write tests and fix this method.\n\t\t\t// Also virtual/override is going to be tricky -\n\t\t\t// I think we'll need to consider the 'virtual' method first for\n\t\t\t// reimplemenatation purposes, but then actually return the 'override'\n\t\t\t// (as that's the method that ends up getting called)\n\t\t\t\n\t\t\tinterfaceMembers = interfaceMembers.ToList(); // avoid evaluating more than once\n\t\t\t\n\t\t\tvar result = new IMember[interfaceMembers.Count];\n\t\t\tvar signatureToIndexDict = new MultiDictionary<IMember, int>(SignatureComparer.Ordinal);\n\t\t\tfor (int i = 0; i < interfaceMembers.Count; i++) {\n\t\t\t\tsignatureToIndexDict.Add(interfaceMembers[i], i);\n\t\t\t}\n\t\t\tforeach (var member in GetMembers(m => !m.IsExplicitInterfaceImplementation)) {\n\t\t\t\tforeach (int interfaceMemberIndex in signatureToIndexDict[member]) {\n\t\t\t\t\tresult[interfaceMemberIndex] = member;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach (var explicitImpl in GetMembers(m => m.IsExplicitInterfaceImplementation)) {\n\t\t\t\tforeach (var interfaceMember in explicitImpl.ImplementedInterfaceMembers) {\n\t\t\t\t\tforeach (int potentialMatchingIndex in signatureToIndexDict[interfaceMember]) {\n\t\t\t\t\t\tif (interfaceMember.Equals(interfaceMembers[potentialMatchingIndex])) {\n\t\t\t\t\t\t\tresult[potentialMatchingIndex] = explicitImpl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic TypeParameterSubstitution GetSubstitution()\n\t\t{\n\t\t\treturn TypeParameterSubstitution.Identity;\n\t\t}\n\t\t\n\t\tpublic TypeParameterSubstitution GetSubstitution(IList<IType> methodTypeArguments)\n\t\t{\n\t\t\treturn TypeParameterSubstitution.Identity;\n\t\t}\n\n\t\tpublic bool Equals(IType other)\n\t\t{\n\t\t\treturn this == other;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn this.ReflectionName;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultResolvedTypeParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic class DefaultTypeParameter : AbstractTypeParameter\n\t{\n\t\treadonly bool hasValueTypeConstraint;\n\t\treadonly bool hasReferenceTypeConstraint;\n\t\treadonly bool hasDefaultConstructorConstraint;\n\t\treadonly IList<IType> constraints;\n\t\t\n\t\tpublic DefaultTypeParameter(\n\t\t\tIEntity owner,\n\t\t\tint index, string name = null,\n\t\t\tVarianceModifier variance = VarianceModifier.Invariant,\n\t\t\tIList<IAttribute> attributes = null,\n\t\t\tDomRegion region = default(DomRegion),\n\t\t\tbool hasValueTypeConstraint = false, bool hasReferenceTypeConstraint = false, bool hasDefaultConstructorConstraint = false,\n\t\t\tIList<IType> constraints = null)\n\t\t\t: base(owner, index, name, variance, attributes, region)\n\t\t{\n\t\t\tthis.hasValueTypeConstraint = hasValueTypeConstraint;\n\t\t\tthis.hasReferenceTypeConstraint = hasReferenceTypeConstraint;\n\t\t\tthis.hasDefaultConstructorConstraint = hasDefaultConstructorConstraint;\n\t\t\tthis.constraints = constraints ?? EmptyList<IType>.Instance;\n\t\t}\n\t\t\n\t\tpublic DefaultTypeParameter(\n\t\t\tICompilation compilation, SymbolKind ownerType,\n\t\t\tint index, string name = null,\n\t\t\tVarianceModifier variance = VarianceModifier.Invariant,\n\t\t\tIList<IAttribute> attributes = null,\n\t\t\tDomRegion region = default(DomRegion),\n\t\t\tbool hasValueTypeConstraint = false, bool hasReferenceTypeConstraint = false, bool hasDefaultConstructorConstraint = false,\n\t\t\tIList<IType> constraints = null)\n\t\t\t: base(compilation, ownerType, index, name, variance, attributes, region)\n\t\t{\n\t\t\tthis.hasValueTypeConstraint = hasValueTypeConstraint;\n\t\t\tthis.hasReferenceTypeConstraint = hasReferenceTypeConstraint;\n\t\t\tthis.hasDefaultConstructorConstraint = hasDefaultConstructorConstraint;\n\t\t\tthis.constraints = constraints ?? EmptyList<IType>.Instance;\n\t\t}\n\t\t\n\t\tpublic override bool HasValueTypeConstraint {\n\t\t\tget { return hasValueTypeConstraint; }\n\t\t}\n\t\t\n\t\tpublic override bool HasReferenceTypeConstraint {\n\t\t\tget { return hasReferenceTypeConstraint; }\n\t\t}\n\t\t\n\t\tpublic override bool HasDefaultConstructorConstraint {\n\t\t\tget { return hasDefaultConstructorConstraint; }\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IType> DirectBaseTypes {\n\t\t\tget {\n\t\t\t\tbool hasNonInterfaceConstraint = false;\n\t\t\t\tforeach (IType c in constraints) {\n\t\t\t\t\tyield return c;\n\t\t\t\t\tif (c.Kind != TypeKind.Interface)\n\t\t\t\t\t\thasNonInterfaceConstraint = true;\n\t\t\t\t}\n\t\t\t\t// Do not add the 'System.Object' constraint if there is another constraint with a base class.\n\t\t\t\tif (this.HasValueTypeConstraint || !hasNonInterfaceConstraint) {\n\t\t\t\t\tyield return this.Compilation.FindType(this.HasValueTypeConstraint ? KnownTypeCode.ValueType : KnownTypeCode.Object);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/*\n\t/// <summary>\n\t/// Default implementation of <see cref=\"ITypeParameter\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class DefaultTypeParameter : AbstractTypeParameter\n\t{\n\t\tIList<ITypeReference> constraints;\n\t\t\n\t\tBitVector16 flags;\n\t\t\n\t\tconst ushort FlagReferenceTypeConstraint      = 0x0001;\n\t\tconst ushort FlagValueTypeConstraint          = 0x0002;\n\t\tconst ushort FlagDefaultConstructorConstraint = 0x0004;\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tconstraints = FreezeList(constraints);\n\t\t\tbase.FreezeInternal();\n\t\t}\n\t\t\n\t\tpublic DefaultTypeParameter(SymbolKind ownerType, int index, string name)\n\t\t\t: base(ownerType, index, name)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic IList<ITypeReference> Constraints {\n\t\t\tget {\n\t\t\t\tif (constraints == null)\n\t\t\t\t\tconstraints = new List<ITypeReference>();\n\t\t\t\treturn constraints;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool HasDefaultConstructorConstraint {\n\t\t\tget { return flags[FlagDefaultConstructorConstraint]; }\n\t\t\tset {\n\t\t\t\tCheckBeforeMutation();\n\t\t\t\tflags[FlagDefaultConstructorConstraint] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool HasReferenceTypeConstraint {\n\t\t\tget { return flags[FlagReferenceTypeConstraint]; }\n\t\t\tset {\n\t\t\t\tCheckBeforeMutation();\n\t\t\t\tflags[FlagReferenceTypeConstraint] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool HasValueTypeConstraint {\n\t\t\tget { return flags[FlagValueTypeConstraint]; }\n\t\t\tset {\n\t\t\t\tCheckBeforeMutation();\n\t\t\t\tflags[FlagValueTypeConstraint] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType(ITypeResolveContext context)\n\t\t{\n\t\t\tswitch (flags.Data & (FlagReferenceTypeConstraint | FlagValueTypeConstraint)) {\n\t\t\t\tcase FlagReferenceTypeConstraint:\n\t\t\t\t\treturn true;\n\t\t\t\tcase FlagValueTypeConstraint:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn base.IsReferenceTypeHelper(GetEffectiveBaseClass(context));\n\t\t}\n\t\t\n\t\tpublic override IType GetEffectiveBaseClass(ITypeResolveContext context)\n\t\t{\n\t\t\t// protect against cyclic type parameters\n\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\tif (!busyLock.Success)\n\t\t\t\t\treturn SpecialTypes.UnknownType;\n\t\t\t\t\n\t\t\t\tif (HasValueTypeConstraint)\n\t\t\t\t\treturn context.GetTypeDefinition(\"System\", \"ValueType\", 0, StringComparer.Ordinal) ?? SpecialTypes.UnknownType;\n\t\t\t\t\n\t\t\t\tList<IType> classTypeConstraints = new List<IType>();\n\t\t\t\tforeach (ITypeReference constraintRef in this.Constraints) {\n\t\t\t\t\tIType constraint = constraintRef.Resolve(context);\n\t\t\t\t\tif (constraint.Kind == TypeKind.Class) {\n\t\t\t\t\t\tclassTypeConstraints.Add(constraint);\n\t\t\t\t\t} else if (constraint.Kind == TypeKind.TypeParameter) {\n\t\t\t\t\t\tIType baseClass = ((ITypeParameter)constraint).GetEffectiveBaseClass(context);\n\t\t\t\t\t\tif (baseClass.Kind == TypeKind.Class)\n\t\t\t\t\t\t\tclassTypeConstraints.Add(baseClass);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (classTypeConstraints.Count == 0)\n\t\t\t\t\treturn KnownTypeReference.Object.Resolve(context);\n\t\t\t\t// Find the derived-most type in the resulting set:\n\t\t\t\tIType result = classTypeConstraints[0];\n\t\t\t\tfor (int i = 1; i < classTypeConstraints.Count; i++) {\n\t\t\t\t\tif (classTypeConstraints[i].GetDefinition().IsDerivedFrom(result.GetDefinition(), context))\n\t\t\t\t\t\tresult = classTypeConstraints[i];\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IType> GetEffectiveInterfaceSet(ITypeResolveContext context)\n\t\t{\n\t\t\tList<IType> result = new List<IType>();\n\t\t\t// protect against cyclic type parameters\n\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\tif (busyLock.Success) {\n\t\t\t\t\tforeach (ITypeReference constraintRef in this.Constraints) {\n\t\t\t\t\t\tIType constraint = constraintRef.Resolve(context);\n\t\t\t\t\t\tif (constraint.Kind == TypeKind.Interface) {\n\t\t\t\t\t\t\tresult.Add(constraint);\n\t\t\t\t\t\t} else if (constraint.Kind == TypeKind.TypeParameter) {\n\t\t\t\t\t\t\tresult.AddRange(((ITypeParameter)constraint).GetEffectiveInterfaceSet(context));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result.Distinct();\n\t\t}\n\t\t\n\t\tpublic override ITypeParameterConstraints GetConstraints(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultTypeParameterConstraints(\n\t\t\t\tthis.Constraints.Select(c => c.Resolve(context)),\n\t\t\t\tthis.HasDefaultConstructorConstraint, this.HasReferenceTypeConstraint, this.HasValueTypeConstraint);\n\t\t}\n\t\t\n\t\t/*\n\t * Interning for type parameters is disabled; we can't intern cyclic structures as might\n\t * occur in the constraints, and incomplete interning is dangerous for type parameters\n\t * as we use reference equality.\n\t\tvoid ISupportsInterning.PrepareForInterning(IInterningProvider provider)\n\t\t{\n\t\t\t// protect against cyclic constraints\n\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\tif (busyLock.Success) {\n\t\t\t\t\tconstraints = provider.InternList(constraints);\n\t\t\t\t\tbase.PrepareForInterning(provider);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hashCode = base.GetHashCodeForInterning();\n\t\t\t\tif (constraints != null)\n\t\t\t\t\thashCode += constraints.GetHashCode();\n\t\t\t\thashCode += 771 * flags.Data;\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tDefaultTypeParameter o = other as DefaultTypeParameter;\n\t\t\treturn base.EqualsForInterning(o)\n\t\t\t\t&& this.constraints == o.constraints\n\t\t\t\t&& this.flags == o.flags;\n\t\t}\n\t}*/\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Runtime.Serialization;\nusing System.Threading;\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation for <see cref=\"IUnresolvedAssembly\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic class DefaultUnresolvedAssembly : AbstractFreezable, IUnresolvedAssembly\n\t{\n\t\tstring assemblyName;\n\t\tstring fullAssemblyName;\n\t\tIList<IUnresolvedAttribute> assemblyAttributes;\n\t\tIList<IUnresolvedAttribute> moduleAttributes;\n\t\tDictionary<TopLevelTypeName, IUnresolvedTypeDefinition> typeDefinitions = new Dictionary<TopLevelTypeName, IUnresolvedTypeDefinition>(TopLevelTypeNameComparer.Ordinal);\n\t\tDictionary<TopLevelTypeName, ITypeReference> typeForwarders = new Dictionary<TopLevelTypeName, ITypeReference>(TopLevelTypeNameComparer.Ordinal);\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tbase.FreezeInternal();\n\t\t\tassemblyAttributes = FreezableHelper.FreezeListAndElements(assemblyAttributes);\n\t\t\tmoduleAttributes = FreezableHelper.FreezeListAndElements(moduleAttributes);\n\t\t\tforeach (var type in typeDefinitions.Values) {\n\t\t\t\tFreezableHelper.Freeze(type);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new unresolved assembly.\n\t\t/// </summary>\n\t\t/// <param name=\"assemblyName\">Full assembly name</param>\n\t\tpublic DefaultUnresolvedAssembly(string assemblyName)\n\t\t{\n\t\t\tif (assemblyName == null)\n\t\t\t\tthrow new ArgumentNullException(\"assemblyName\");\n\t\t\tthis.fullAssemblyName = assemblyName;\n\t\t\tint pos = assemblyName != null ? assemblyName.IndexOf(',') : -1;\n\t\t\tthis.assemblyName = pos < 0 ? assemblyName : assemblyName.Substring(0, pos);\n\t\t\tthis.assemblyAttributes = new List<IUnresolvedAttribute>();\n\t\t\tthis.moduleAttributes = new List<IUnresolvedAttribute>();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the short assembly name.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This class handles the short and the full name independently;\n\t\t/// if you change the short name, you should also change the full name.\n\t\t/// </remarks>\n\t\tpublic string AssemblyName {\n\t\t\tget { return assemblyName; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tassemblyName = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the full assembly name.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This class handles the short and the full name independently;\n\t\t/// if you change the full name, you should also change the short name.\n\t\t/// </remarks>\n\t\tpublic string FullAssemblyName {\n\t\t\tget { return fullAssemblyName; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tfullAssemblyName = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstring location;\n\t\tpublic string Location {\n\t\t\tget {\n\t\t\t\treturn location;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tlocation = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<IUnresolvedAttribute> AssemblyAttributes {\n\t\t\tget { return assemblyAttributes; }\n\t\t}\n\t\t\n\t\tIEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.AssemblyAttributes {\n\t\t\tget { return assemblyAttributes; }\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> ModuleAttributes {\n\t\t\tget { return moduleAttributes; }\n\t\t}\n\t\t\n\t\tIEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.ModuleAttributes {\n\t\t\tget { return moduleAttributes; }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedTypeDefinition> TopLevelTypeDefinitions {\n\t\t\tget { return typeDefinitions.Values; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds a new top-level type definition to this assembly.\n\t\t/// </summary>\n\t\t/// <remarks>DefaultUnresolvedAssembly does not support partial classes.\n\t\t/// Adding more than one part of a type will cause an ArgumentException.</remarks>\n\t\tpublic void AddTypeDefinition(IUnresolvedTypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (typeDefinition == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeDefinition\");\n\t\t\tif (typeDefinition.DeclaringTypeDefinition != null)\n\t\t\t\tthrow new ArgumentException(\"Cannot add nested types.\");\n\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\tvar key = new TopLevelTypeName(typeDefinition.Namespace, typeDefinition.Name, typeDefinition.TypeParameters.Count);\n\t\t\ttypeDefinitions.Add(key, typeDefinition);\n\t\t}\n\t\t\n\t\tstatic readonly ITypeReference typeForwardedToAttributeTypeRef = typeof(System.Runtime.CompilerServices.TypeForwardedToAttribute).ToTypeReference();\n\t\t\n\t\t/// <summary>\n\t\t/// Adds a type forwarder.\n\t\t/// This adds both an assembly attribute and an internal forwarder entry, which will be used\n\t\t/// by the resolved assembly to provide the forwarded types.\n\t\t/// </summary>\n\t\t/// <param name=\"typeName\">The name of the type.</param>\n\t\t/// <param name=\"referencedType\">The reference used to look up the type in the target assembly.</param>\n\t\tpublic void AddTypeForwarder(TopLevelTypeName typeName, ITypeReference referencedType)\n\t\t{\n\t\t\tif (referencedType == null)\n\t\t\t\tthrow new ArgumentNullException(\"referencedType\");\n\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\tvar attribute = new DefaultUnresolvedAttribute(typeForwardedToAttributeTypeRef, new[] { KnownTypeReference.Type });\n\t\t\tattribute.PositionalArguments.Add(new TypeOfConstantValue(referencedType));\n\t\t\tassemblyAttributes.Add(attribute);\n\t\t\t\n\t\t\ttypeForwarders[typeName] = referencedType;\n\t\t}\n\t\t\n\t\t[Serializable]\n\t\tsealed class TypeOfConstantValue : IConstantValue\n\t\t{\n\t\t\treadonly ITypeReference typeRef;\n\t\t\t\n\t\t\tpublic TypeOfConstantValue(ITypeReference typeRef)\n\t\t\t{\n\t\t\t\tthis.typeRef = typeRef;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t\t{\n\t\t\t\treturn new TypeOfResolveResult(context.Compilation.FindType(KnownTypeCode.Type), typeRef.Resolve(context));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedTypeDefinition GetTypeDefinition(string ns, string name, int typeParameterCount)\n\t\t{\n\t\t\tvar key = new TopLevelTypeName(ns ?? string.Empty, name, typeParameterCount);\n\t\t\tIUnresolvedTypeDefinition td;\n\t\t\tif (typeDefinitions.TryGetValue(key, out td))\n\t\t\t\treturn td;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IAssembly Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tFreeze();\n\t\t\tvar cache = context.Compilation.CacheManager;\n\t\t\tIAssembly asm = (IAssembly)cache.GetShared(this);\n\t\t\tif (asm != null) {\n\t\t\t\treturn asm;\n\t\t\t} else {\n\t\t\t\tasm = new DefaultResolvedAssembly(context.Compilation, this);\n\t\t\t\treturn (IAssembly)cache.GetOrAddShared(this, asm);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[\" + GetType().Name + \" \" + assemblyName + \"]\";\n\t\t}\n\t\t\n\t\t//[NonSerialized]\n\t\t//List<Dictionary<TopLevelTypeName, IUnresolvedTypeDefinition>> cachedTypeDictionariesPerNameComparer;\n\t\t\n\t\tDictionary<TopLevelTypeName, IUnresolvedTypeDefinition> GetTypeDictionary(StringComparer nameComparer)\n\t\t{\n\t\t\tDebug.Assert(IsFrozen);\n\t\t\tif (nameComparer == StringComparer.Ordinal)\n\t\t\t\treturn typeDefinitions;\n\t\t\telse\n\t\t\t\tthrow new NotImplementedException();\n\t\t}\n\t\t\n\t\t#region UnresolvedNamespace\n\t\tsealed class UnresolvedNamespace\n\t\t{\n\t\t\tinternal readonly string FullName;\n\t\t\tinternal readonly string Name;\n\t\t\tinternal readonly List<UnresolvedNamespace> Children = new List<UnresolvedNamespace>();\n\t\t\t\n\t\t\tpublic UnresolvedNamespace(string fullName, string name)\n\t\t\t{\n\t\t\t\tthis.FullName = fullName;\n\t\t\t\tthis.Name = name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t[NonSerialized]\n\t\tList<KeyValuePair<StringComparer, UnresolvedNamespace>> unresolvedNamespacesPerNameComparer;\n\t\t\n\t\tUnresolvedNamespace GetUnresolvedRootNamespace(StringComparer nameComparer)\n\t\t{\n\t\t\tDebug.Assert(IsFrozen);\n\t\t\tLazyInitializer.EnsureInitialized(ref unresolvedNamespacesPerNameComparer);\n\t\t\tlock (unresolvedNamespacesPerNameComparer) {\n\t\t\t\tforeach (var pair in unresolvedNamespacesPerNameComparer) {\n\t\t\t\t\tif (pair.Key == nameComparer)\n\t\t\t\t\t\treturn pair.Value;\n\t\t\t\t}\n\t\t\t\tvar root = new UnresolvedNamespace(string.Empty, string.Empty);\n\t\t\t\tvar dict = new Dictionary<string, UnresolvedNamespace>(nameComparer);\n\t\t\t\tdict.Add(root.FullName, root);\n\t\t\t\tforeach (var typeName in typeDefinitions.Keys) {\n\t\t\t\t\tGetOrAddNamespace(dict, typeName.Namespace);\n\t\t\t\t}\n\t\t\t\tunresolvedNamespacesPerNameComparer.Add(new KeyValuePair<StringComparer, UnresolvedNamespace>(nameComparer, root));\n\t\t\t\treturn root;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic UnresolvedNamespace GetOrAddNamespace(Dictionary<string, UnresolvedNamespace> dict, string fullName)\n\t\t{\n\t\t\tUnresolvedNamespace ns;\n\t\t\tif (dict.TryGetValue(fullName, out ns))\n\t\t\t\treturn ns;\n\t\t\tint pos = fullName.LastIndexOf('.');\n\t\t\tUnresolvedNamespace parent;\n\t\t\tstring name;\n\t\t\tif (pos < 0) {\n\t\t\t\tparent = dict[string.Empty]; // root\n\t\t\t\tname = fullName;\n\t\t\t} else {\n\t\t\t\tparent = GetOrAddNamespace(dict, fullName.Substring(0, pos));\n\t\t\t\tname = fullName.Substring(pos + 1);\n\t\t\t}\n\t\t\tns = new UnresolvedNamespace(fullName, name);\n\t\t\tparent.Children.Add(ns);\n\t\t\tdict.Add(fullName, ns);\n\t\t\treturn ns;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tsealed class DefaultResolvedAssembly : IAssembly\n\t\t{\n\t\t\treadonly DefaultUnresolvedAssembly unresolvedAssembly;\n\t\t\treadonly ICompilation compilation;\n\t\t\treadonly ITypeResolveContext context;\n\t\t\treadonly Dictionary<TopLevelTypeName, IUnresolvedTypeDefinition> unresolvedTypeDict;\n\t\t\treadonly ConcurrentDictionary<IUnresolvedTypeDefinition, ITypeDefinition> typeDict = new ConcurrentDictionary<IUnresolvedTypeDefinition, ITypeDefinition>();\n\t\t\treadonly INamespace rootNamespace;\n\t\t\t\n\t\t\tpublic DefaultResolvedAssembly(ICompilation compilation, DefaultUnresolvedAssembly unresolved)\n\t\t\t{\n\t\t\t\tthis.compilation = compilation;\n\t\t\t\tthis.unresolvedAssembly = unresolved;\n\t\t\t\tthis.unresolvedTypeDict = unresolved.GetTypeDictionary(compilation.NameComparer);\n\t\t\t\tthis.rootNamespace = new NS(this, unresolved.GetUnresolvedRootNamespace(compilation.NameComparer), null);\n\t\t\t\tthis.context = new SimpleTypeResolveContext(this);\n\t\t\t\tthis.AssemblyAttributes = unresolved.AssemblyAttributes.CreateResolvedAttributes(context);\n\t\t\t\tthis.ModuleAttributes = unresolved.ModuleAttributes.CreateResolvedAttributes(context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IUnresolvedAssembly UnresolvedAssembly {\n\t\t\t\tget { return unresolvedAssembly; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool IsMainAssembly {\n\t\t\t\tget { return this.Compilation.MainAssembly == this; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic string AssemblyName {\n\t\t\t\tget { return unresolvedAssembly.AssemblyName; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic string FullAssemblyName {\n\t\t\t\tget { return unresolvedAssembly.FullAssemblyName; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IAttribute> AssemblyAttributes { get; private set; }\n\t\t\tpublic IList<IAttribute> ModuleAttributes { get; private set; }\n\t\t\t\n\t\t\tpublic INamespace RootNamespace {\n\t\t\t\tget { return rootNamespace; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic ICompilation Compilation {\n\t\t\t\tget { return compilation; }\n\t\t\t}\n\t\n\t\t\tpublic bool InternalsVisibleTo(IAssembly assembly)\n\t\t\t{\n\t\t\t\tif (this == assembly)\n\t\t\t\t\treturn true;\n\t\t\t\tforeach (string shortName in GetInternalsVisibleTo()) {\n\t\t\t\t\tif (assembly.AssemblyName == shortName)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvolatile string[] internalsVisibleTo;\n\n\t\t\tstring[] GetInternalsVisibleTo()\n\t\t\t{\n\t\t\t\tvar result = this.internalsVisibleTo;\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\t\t\tDebug.Assert(busyLock.Success);\n\t\t\t\t\t\tif (!busyLock.Success) {\n\t\t\t\t\t\t\treturn new string[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinternalsVisibleTo = (\n\t\t\t\t\t\t\tfrom attr in this.AssemblyAttributes\n\t\t\t\t\t\t\twhere attr.AttributeType.Name == \"InternalsVisibleToAttribute\"\n\t\t\t\t\t\t\t&& attr.AttributeType.Namespace == \"System.Runtime.CompilerServices\"\n\t\t\t\t\t\t\t&& attr.PositionalArguments.Count == 1\n\t\t\t\t\t\t\tselect GetShortName(attr.PositionalArguments.Single().ConstantValue as string)\n\t\t\t\t\t\t).ToArray();\n\t\t\t\t\t}\n\t\t\t\t\treturn internalsVisibleTo;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic string GetShortName(string fullAssemblyName)\n\t\t\t{\n\t\t\t\tif (fullAssemblyName == null)\n\t\t\t\t\treturn null;\n\t\t\t\tint pos = fullAssemblyName.IndexOf(',');\n\t\t\t\tif (pos < 0)\n\t\t\t\t\treturn fullAssemblyName;\n\t\t\t\telse\n\t\t\t\t\treturn fullAssemblyName.Substring(0, pos);\n\t\t\t}\n\n\t\t\tpublic ITypeDefinition GetTypeDefinition(TopLevelTypeName topLevelTypeName)\n\t\t\t{\n\t\t\t\tIUnresolvedTypeDefinition td;\n\t\t\t\tITypeReference typeRef;\n\t\t\t\tif (unresolvedAssembly.typeDefinitions.TryGetValue(topLevelTypeName, out td))\n\t\t\t\t\treturn GetTypeDefinition(td);\n\t\t\t\tif (unresolvedAssembly.typeForwarders.TryGetValue(topLevelTypeName, out typeRef)) {\n\t\t\t\t\t// Protect against cyclic type forwarders:\n\t\t\t\t\tusing (var busyLock = BusyManager.Enter(typeRef)) {\n\t\t\t\t\t\tif (busyLock.Success)\n\t\t\t\t\t\t\treturn typeRef.Resolve(compilation.TypeResolveContext).GetDefinition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tITypeDefinition GetTypeDefinition(IUnresolvedTypeDefinition unresolved)\n\t\t\t{\n\t\t\t\treturn typeDict.GetOrAdd(unresolved, t => CreateTypeDefinition(t));\n\t\t\t}\n\t\t\t\n\t\t\tITypeDefinition CreateTypeDefinition(IUnresolvedTypeDefinition unresolved)\n\t\t\t{\n\t\t\t\tif (unresolved.DeclaringTypeDefinition != null) {\n\t\t\t\t\tITypeDefinition declaringType = GetTypeDefinition(unresolved.DeclaringTypeDefinition);\n\t\t\t\t\treturn new DefaultResolvedTypeDefinition(context.WithCurrentTypeDefinition(declaringType), unresolved);\n\t\t\t\t} else if (unresolved.Name == \"Void\" && unresolved.Namespace == \"System\" && unresolved.TypeParameters.Count == 0) {\n\t\t\t\t\treturn new VoidTypeDefinition(context, unresolved);\n\t\t\t\t} else {\n\t\t\t\t\treturn new DefaultResolvedTypeDefinition(context, unresolved);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerable<ITypeDefinition> TopLevelTypeDefinitions {\n\t\t\t\tget {\n\t\t\t\t\treturn unresolvedAssembly.TopLevelTypeDefinitions.Select(t => GetTypeDefinition(t));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"[DefaultResolvedAssembly \" + AssemblyName + \"]\";\n\t\t\t}\n\t\t\t\n\t\t\tsealed class NS : INamespace\n\t\t\t{\n\t\t\t\treadonly DefaultResolvedAssembly assembly;\n\t\t\t\treadonly UnresolvedNamespace ns;\n\t\t\t\treadonly INamespace parentNamespace;\n\t\t\t\treadonly IList<NS> childNamespaces;\n\t\t\t\tIEnumerable<ITypeDefinition> types;\n\t\t\t\t\n\t\t\t\tpublic NS(DefaultResolvedAssembly assembly, UnresolvedNamespace ns, INamespace parentNamespace)\n\t\t\t\t{\n\t\t\t\t\tthis.assembly = assembly;\n\t\t\t\t\tthis.ns = ns;\n\t\t\t\t\tthis.parentNamespace = parentNamespace;\n\t\t\t\t\tthis.childNamespaces = new ProjectedList<NS, UnresolvedNamespace, NS>(\n\t\t\t\t\t\tthis, ns.Children, (self, c) => new NS(self.assembly, c, self));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tstring INamespace.ExternAlias {\n\t\t\t\t\tget { return null; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tstring INamespace.FullName {\n\t\t\t\t\tget { return ns.FullName; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSymbolKind ISymbol.SymbolKind {\n\t\t\t\t\tget { return SymbolKind.Namespace; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic string Name {\n\t\t\t\t\tget { return ns.Name; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tINamespace INamespace.ParentNamespace {\n\t\t\t\t\tget { return parentNamespace; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIEnumerable<IAssembly> INamespace.ContributingAssemblies {\n\t\t\t\t\tget { return new [] { assembly }; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIEnumerable<INamespace> INamespace.ChildNamespaces {\n\t\t\t\t\tget { return childNamespaces; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tINamespace INamespace.GetChildNamespace(string name)\n\t\t\t\t{\n\t\t\t\t\tvar nameComparer = assembly.compilation.NameComparer;\n\t\t\t\t\tfor (int i = 0; i < childNamespaces.Count; i++) {\n\t\t\t\t\t\tif (nameComparer.Equals(name, ns.Children[i].Name))\n\t\t\t\t\t\t\treturn childNamespaces[i];\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tICompilation ICompilationProvider.Compilation {\n\t\t\t\t\tget { return assembly.compilation; }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIEnumerable<ITypeDefinition> INamespace.Types {\n\t\t\t\t\tget {\n\t\t\t\t\t\tvar result = LazyInit.VolatileRead(ref this.types);\n\t\t\t\t\t\tif (result != null) {\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar hashSet = new HashSet<ITypeDefinition>();\n\t\t\t\t\t\t\tforeach (IUnresolvedTypeDefinition typeDef in assembly.UnresolvedAssembly.TopLevelTypeDefinitions) {\n\t\t\t\t\t\t\t\tif (typeDef.Namespace == ns.FullName)\n\t\t\t\t\t\t\t\t\thashSet.Add(assembly.GetTypeDefinition(typeDef));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.types, hashSet.ToArray());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tITypeDefinition INamespace.GetTypeDefinition(string name, int typeParameterCount)\n\t\t\t\t{\n\t\t\t\t\tvar key = new TopLevelTypeName(ns.FullName, name, typeParameterCount);\n\t\t\t\t\tIUnresolvedTypeDefinition unresolvedTypeDef;\n\t\t\t\t\tif (assembly.unresolvedTypeDict.TryGetValue(key, out unresolvedTypeDef))\n\t\t\t\t\t\treturn assembly.GetTypeDefinition(unresolvedTypeDef);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic ISymbolReference ToReference()\n\t\t\t\t{\n\t\t\t\t\treturn new NamespaceReference(new DefaultAssemblyReference(assembly.AssemblyName), ns.FullName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic sealed class NamespaceReference : ISymbolReference\n\t{\n\t\tIAssemblyReference assemblyReference;\n\t\tstring fullName;\n\t\t\n\t\tpublic NamespaceReference(IAssemblyReference assemblyReference, string fullName)\n\t\t{\n\t\t\tif (assemblyReference == null)\n\t\t\t\tthrow new ArgumentNullException(\"assemblyReference\");\n\t\t\tthis.assemblyReference = assemblyReference;\n\t\t\tthis.fullName = fullName;\n\t\t}\n\t\t\n\t\tpublic ISymbol Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIAssembly assembly = assemblyReference.Resolve(context);\n\t\t\tINamespace parent = assembly.RootNamespace;\n\t\t\t\n\t\t\tstring[] parts = fullName.Split('.');\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < parts.Length && parent != null) {\n\t\t\t\tparent = parent.GetChildNamespace(parts[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\treturn parent;\n\t\t}\n\t}\n\t\n\tpublic sealed class MergedNamespaceReference : ISymbolReference\n\t{\n\t\tstring externAlias;\n\t\tstring fullName;\n\t\t\n\t\tpublic MergedNamespaceReference(string externAlias, string fullName)\n\t\t{\n\t\t\tthis.externAlias = externAlias;\n\t\t\tthis.fullName = fullName;\n\t\t}\n\t\t\n\t\tpublic ISymbol Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tstring[] parts = fullName.Split('.');\n\t\t\tINamespace parent = context.Compilation.GetNamespaceForExternAlias(externAlias);\n\t\t\t\n\t\t\tint i = 0;\n\t\t\twhile (i < parts.Length && parent != null) {\n\t\t\t\tparent = parent.GetChildNamespace(parts[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t\n\t\t\treturn parent;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAttribute.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IUnresolvedAttribute\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class DefaultUnresolvedAttribute : AbstractFreezable, IUnresolvedAttribute, IFreezable, ISupportsInterning\n\t{\n\t\tITypeReference attributeType;\n\t\tDomRegion region;\n\t\tIList<ITypeReference> constructorParameterTypes;\n\t\tIList<IConstantValue> positionalArguments;\n\t\tIList<KeyValuePair<IMemberReference, IConstantValue>> namedArguments;\n\t\t\n\t\tpublic DefaultUnresolvedAttribute(ITypeReference attributeType)\n\t\t{\n\t\t\tif (attributeType == null)\n\t\t\t\tthrow new ArgumentNullException(\"attributeType\");\n\t\t\tthis.attributeType = attributeType;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedAttribute(ITypeReference attributeType, IEnumerable<ITypeReference> constructorParameterTypes)\n\t\t{\n\t\t\tif (attributeType == null)\n\t\t\t\tthrow new ArgumentNullException(\"attributeType\");\n\t\t\tthis.attributeType = attributeType;\n\t\t\tthis.ConstructorParameterTypes.AddRange(constructorParameterTypes);\n\t\t}\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tbase.FreezeInternal();\n\t\t\tconstructorParameterTypes = FreezableHelper.FreezeList(constructorParameterTypes);\n\t\t\tpositionalArguments = FreezableHelper.FreezeListAndElements(positionalArguments);\n\t\t\tnamedArguments = FreezableHelper.FreezeList(namedArguments);\n\t\t\tforeach (var pair in namedArguments) {\n\t\t\t\tFreezableHelper.Freeze(pair.Key);\n\t\t\t\tFreezableHelper.Freeze(pair.Value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ITypeReference AttributeType {\n\t\t\tget { return attributeType; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tregion = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<ITypeReference> ConstructorParameterTypes {\n\t\t\tget {\n\t\t\t\tif (constructorParameterTypes == null)\n\t\t\t\t\tconstructorParameterTypes = new List<ITypeReference>();\n\t\t\t\treturn constructorParameterTypes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IConstantValue> PositionalArguments {\n\t\t\tget {\n\t\t\t\tif (positionalArguments == null)\n\t\t\t\t\tpositionalArguments = new List<IConstantValue>();\n\t\t\t\treturn positionalArguments;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<KeyValuePair<IMemberReference, IConstantValue>> NamedArguments {\n\t\t\tget {\n\t\t\t\tif (namedArguments == null)\n\t\t\t\t\tnamedArguments = new List<KeyValuePair<IMemberReference, IConstantValue>>();\n\t\t\t\treturn namedArguments;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void AddNamedFieldArgument(string fieldName, IConstantValue value)\n\t\t{\n\t\t\tthis.NamedArguments.Add(new KeyValuePair<IMemberReference, IConstantValue>(\n\t\t\t\tnew DefaultMemberReference(SymbolKind.Field, attributeType, fieldName),\n\t\t\t\tvalue\n\t\t\t));\n\t\t}\n\t\t\n\t\tpublic void AddNamedPropertyArgument(string propertyName, IConstantValue value)\n\t\t{\n\t\t\tthis.NamedArguments.Add(new KeyValuePair<IMemberReference, IConstantValue>(\n\t\t\t\tnew DefaultMemberReference(SymbolKind.Property, attributeType, propertyName),\n\t\t\t\tvalue\n\t\t\t));\n\t\t}\n\t\t\n\t\tpublic IAttribute CreateResolvedAttribute(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultResolvedAttribute(this, context);\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tint hash = attributeType.GetHashCode() ^ constructorParameterTypes.GetHashCode();\n\t\t\tunchecked {\n\t\t\t\tif (constructorParameterTypes != null) {\n\t\t\t\t\tforeach (var type in constructorParameterTypes) {\n\t\t\t\t\t\thash *= 27;\n\t\t\t\t\t\thash += type.GetHashCode();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (positionalArguments != null) {\n\t\t\t\t\tforeach (var arg in positionalArguments) {\n\t\t\t\t\t\thash *= 31;\n\t\t\t\t\t\thash += arg.GetHashCode();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (namedArguments != null) {\n\t\t\t\t\tforeach (var pair in namedArguments) {\n\t\t\t\t\t\thash *= 71;\n\t\t\t\t\t\thash += pair.Key.GetHashCode() + pair.Value.GetHashCode() * 73;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hash;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tDefaultUnresolvedAttribute o = other as DefaultUnresolvedAttribute;\n\t\t\treturn o != null && attributeType == o.attributeType\n\t\t\t\t&& ListEquals(constructorParameterTypes, o.constructorParameterTypes)\n\t\t\t\t&& ListEquals(positionalArguments, o.positionalArguments)\n\t\t\t\t&& ListEquals(namedArguments ?? EmptyList<KeyValuePair<IMemberReference, IConstantValue>>.Instance,\n\t\t\t\t              o.namedArguments ?? EmptyList<KeyValuePair<IMemberReference, IConstantValue>>.Instance);\n\t\t}\n\t\t\n\t\tstatic bool ListEquals<T>(IList<T> list1, IList<T> list2) where T : class\n\t\t{\n\t\t\tif (list1 == null)\n\t\t\t\tlist1 = EmptyList<T>.Instance;\n\t\t\tif (list2 == null)\n\t\t\t\tlist2 = EmptyList<T>.Instance;\n\t\t\tif (list1 == list2)\n\t\t\t\treturn true;\n\t\t\tif (list1.Count != list2.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < list1.Count; i++) {\n\t\t\t\tif (list1[i] != list2[i])\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tstatic bool ListEquals(IList<KeyValuePair<IMemberReference, IConstantValue>> list1, IList<KeyValuePair<IMemberReference, IConstantValue>> list2)\n\t\t{\n\t\t\tif (list1 == list2)\n\t\t\t\treturn true;\n\t\t\tif (list1.Count != list2.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < list1.Count; i++) {\n\t\t\t\tvar a = list1[i];\n\t\t\t\tvar b = list2[i];\n\t\t\t\tif (!(a.Key == b.Key && a.Value == b.Value))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tsealed class DefaultResolvedAttribute : IAttribute, ICompilationProvider\n\t\t{\n\t\t\treadonly DefaultUnresolvedAttribute unresolved;\n\t\t\treadonly ITypeResolveContext context;\n\t\t\treadonly IType attributeType;\n\t\t\treadonly IList<ResolveResult> positionalArguments;\n\t\t\t\n\t\t\t// cannot use ProjectedList because KeyValuePair is value type\n\t\t\tIList<KeyValuePair<IMember, ResolveResult>> namedArguments;\n\t\t\t\n\t\t\tIMethod constructor;\n\t\t\tvolatile bool constructorResolved;\n\t\t\t\n\t\t\tpublic DefaultResolvedAttribute(DefaultUnresolvedAttribute unresolved, ITypeResolveContext context)\n\t\t\t{\n\t\t\t\tthis.unresolved = unresolved;\n\t\t\t\tthis.context = context;\n\t\t\t\t\n\t\t\t\tthis.attributeType = unresolved.AttributeType.Resolve(context);\n\t\t\t\tthis.positionalArguments = unresolved.PositionalArguments.Resolve(context);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IType AttributeType {\n\t\t\t\tget { return attributeType; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic DomRegion Region {\n\t\t\t\tget { return unresolved.Region; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IMethod Constructor {\n\t\t\t\tget {\n\t\t\t\t\tif (!constructorResolved) {\n\t\t\t\t\t\tconstructor = ResolveConstructor();\n\t\t\t\t\t\tconstructorResolved = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn constructor;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tIMethod ResolveConstructor()\n\t\t\t{\n\t\t\t\tvar parameterTypes = unresolved.ConstructorParameterTypes.Resolve(context);\n\t\t\t\tforeach (var ctor in attributeType.GetConstructors(m => m.Parameters.Count == parameterTypes.Count)) {\n\t\t\t\t\tbool ok = true;\n\t\t\t\t\tfor (int i = 0; i < parameterTypes.Count; i++) {\n\t\t\t\t\t\tif (!ctor.Parameters[i].Type.Equals(parameterTypes[i])) {\n\t\t\t\t\t\t\tok = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (ok)\n\t\t\t\t\t\treturn ctor;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<ResolveResult> PositionalArguments {\n\t\t\t\tget { return positionalArguments; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<KeyValuePair<IMember, ResolveResult>> NamedArguments {\n\t\t\t\tget {\n\t\t\t\t\tvar namedArgs = LazyInit.VolatileRead(ref this.namedArguments);\n\t\t\t\t\tif (namedArgs != null) {\n\t\t\t\t\t\treturn namedArgs;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnamedArgs = new List<KeyValuePair<IMember, ResolveResult>>();\n\t\t\t\t\t\tforeach (var pair in unresolved.NamedArguments) {\n\t\t\t\t\t\t\tIMember member = pair.Key.Resolve(context);\n\t\t\t\t\t\t\tif (member != null) {\n\t\t\t\t\t\t\t\tResolveResult val = pair.Value.Resolve(context);\n\t\t\t\t\t\t\t\tnamedArgs.Add(new KeyValuePair<IMember, ResolveResult>(member, val));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.namedArguments, namedArgs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic ICompilation Compilation {\n\t\t\t\tget { return context.Compilation; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tif (positionalArguments.Count == 0)\n\t\t\t\t\treturn \"[\" + attributeType.ToString() + \"]\";\n\t\t\t\telse\n\t\t\t\t\treturn \"[\" + attributeType.ToString() + \"(...)]\";\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedEvent.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IUnresolvedEvent\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic class DefaultUnresolvedEvent : AbstractUnresolvedMember, IUnresolvedEvent\n\t{\n\t\tIUnresolvedMethod addAccessor, removeAccessor, invokeAccessor;\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tbase.FreezeInternal();\n\t\t\tFreezableHelper.Freeze(addAccessor);\n\t\t\tFreezableHelper.Freeze(removeAccessor);\n\t\t\tFreezableHelper.Freeze(invokeAccessor);\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedEvent()\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Event;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedEvent(IUnresolvedTypeDefinition declaringType, string name)\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Event;\n\t\t\tthis.DeclaringTypeDefinition = declaringType;\n\t\t\tthis.Name = name;\n\t\t\tif (declaringType != null)\n\t\t\t\tthis.UnresolvedFile = declaringType.UnresolvedFile;\n\t\t}\n\t\t\n\t\tpublic bool CanAdd {\n\t\t\tget { return addAccessor != null; }\n\t\t}\n\t\t\n\t\tpublic bool CanRemove {\n\t\t\tget { return removeAccessor != null; }\n\t\t}\n\t\t\n\t\tpublic bool CanInvoke {\n\t\t\tget { return invokeAccessor != null; }\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMethod AddAccessor {\n\t\t\tget { return addAccessor; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\taddAccessor = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMethod RemoveAccessor {\n\t\t\tget { return removeAccessor; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tremoveAccessor = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMethod InvokeAccessor {\n\t\t\tget { return invokeAccessor; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tinvokeAccessor = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IMember CreateResolved(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultResolvedEvent(this, context);\n\t\t}\n\t\t\n\t\tIEvent IUnresolvedEvent.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn (IEvent)Resolve(context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedField.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IUnresolvedField\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic class DefaultUnresolvedField : AbstractUnresolvedMember, IUnresolvedField\n\t{\n\t\tIConstantValue constantValue;\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tFreezableHelper.Freeze(constantValue);\n\t\t\tbase.FreezeInternal();\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedField()\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Field;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedField(IUnresolvedTypeDefinition declaringType, string name)\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Field;\n\t\t\tthis.DeclaringTypeDefinition = declaringType;\n\t\t\tthis.Name = name;\n\t\t\tif (declaringType != null)\n\t\t\t\tthis.UnresolvedFile = declaringType.UnresolvedFile;\n\t\t}\n\t\t\n\t\tpublic bool IsConst {\n\t\t\tget { return constantValue != null && !IsFixed; }\n\t\t}\n\t\t\n\t\tpublic bool IsReadOnly {\n\t\t\tget { return flags[FlagFieldIsReadOnly]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagFieldIsReadOnly] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsVolatile {\n\t\t\tget { return flags[FlagFieldIsVolatile]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagFieldIsVolatile] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsFixed {\n\t\t\tget { return flags[FlagFieldIsFixedSize]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagFieldIsFixedSize] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IConstantValue ConstantValue {\n\t\t\tget { return constantValue; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tconstantValue = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IMember CreateResolved(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultResolvedField(this, context);\n\t\t}\n\t\t\n\t\tIField IUnresolvedField.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn (IField)Resolve(context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedMethod.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IUnresolvedMethod\" /> interface.\n\t/// </summary>\n\t[Serializable]\n\tpublic class DefaultUnresolvedMethod : AbstractUnresolvedMember, IUnresolvedMethod\n\t{\n\t\tIList<IUnresolvedAttribute> returnTypeAttributes;\n\t\tIList<IUnresolvedTypeParameter> typeParameters;\n\t\tIList<IUnresolvedParameter> parameters;\n\t\tIUnresolvedMember accessorOwner;\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\treturnTypeAttributes = FreezableHelper.FreezeListAndElements(returnTypeAttributes);\n\t\t\ttypeParameters = FreezableHelper.FreezeListAndElements(typeParameters);\n\t\t\tparameters = FreezableHelper.FreezeListAndElements(parameters);\n\t\t\tbase.FreezeInternal();\n\t\t}\n\t\t\n\t\tpublic override object Clone()\n\t\t{\n\t\t\tvar copy = (DefaultUnresolvedMethod)base.Clone();\n\t\t\tif (returnTypeAttributes != null)\n\t\t\t\tcopy.returnTypeAttributes = new List<IUnresolvedAttribute>(returnTypeAttributes);\n\t\t\tif (typeParameters != null)\n\t\t\t\tcopy.typeParameters = new List<IUnresolvedTypeParameter>(typeParameters);\n\t\t\tif (parameters != null)\n\t\t\t\tcopy.parameters = new List<IUnresolvedParameter>(parameters);\n\t\t\treturn copy;\n\t\t}\n\t\t\n\t\tpublic override void ApplyInterningProvider(InterningProvider provider)\n\t\t{\n\t\t\tbase.ApplyInterningProvider(provider);\n\t\t\tif (provider != null) {\n\t\t\t\treturnTypeAttributes = provider.InternList(returnTypeAttributes);\n\t\t\t\ttypeParameters = provider.InternList(typeParameters);\n\t\t\t\tparameters = provider.InternList(parameters);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedMethod()\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Method;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedMethod(IUnresolvedTypeDefinition declaringType, string name)\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Method;\n\t\t\tthis.DeclaringTypeDefinition = declaringType;\n\t\t\tthis.Name = name;\n\t\t\tif (declaringType != null)\n\t\t\t\tthis.UnresolvedFile = declaringType.UnresolvedFile;\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> ReturnTypeAttributes {\n\t\t\tget {\n\t\t\t\tif (returnTypeAttributes == null)\n\t\t\t\t\treturnTypeAttributes = new List<IUnresolvedAttribute>();\n\t\t\t\treturn returnTypeAttributes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedTypeParameter> TypeParameters {\n\t\t\tget {\n\t\t\t\tif (typeParameters == null)\n\t\t\t\t\ttypeParameters = new List<IUnresolvedTypeParameter>();\n\t\t\t\treturn typeParameters;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsExtensionMethod {\n\t\t\tget { return flags[FlagExtensionMethod]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagExtensionMethod] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsConstructor {\n\t\t\tget { return this.SymbolKind == SymbolKind.Constructor; }\n\t\t}\n\t\t\n\t\tpublic bool IsDestructor {\n\t\t\tget { return this.SymbolKind == SymbolKind.Destructor; }\n\t\t}\n\t\t\n\t\tpublic bool IsOperator {\n\t\t\tget { return this.SymbolKind == SymbolKind.Operator; }\n\t\t}\n\t\t\n\t\tpublic bool IsPartial {\n\t\t\tget { return flags[FlagPartialMethod]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagPartialMethod] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAsync {\n\t\t\tget { return flags[FlagAsyncMethod]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagAsyncMethod] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasBody {\n\t\t\tget { return flags[FlagHasBody]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagHasBody] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Obsolete]\n\t\tpublic bool IsPartialMethodDeclaration {\n\t\t\tget { return IsPartial && !HasBody; }\n\t\t\tset {\n\t\t\t\tif (value) {\n\t\t\t\t\tIsPartial = true;\n\t\t\t\t\tHasBody = false;\n\t\t\t\t} else if (!value && IsPartial && !HasBody) {\n\t\t\t\t\tIsPartial = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Obsolete]\n\t\tpublic bool IsPartialMethodImplementation {\n\t\t\tget { return IsPartial && HasBody; }\n\t\t\tset {\n\t\t\t\tif (value) {\n\t\t\t\t\tIsPartial = true;\n\t\t\t\t\tHasBody = true;\n\t\t\t\t} else if (!value && IsPartial && HasBody) {\n\t\t\t\t\tIsPartial = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedParameter> Parameters {\n\t\t\tget {\n\t\t\t\tif (parameters == null)\n\t\t\t\t\tparameters = new List<IUnresolvedParameter>();\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMember AccessorOwner {\n\t\t\tget { return accessorOwner; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\taccessorOwner = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(\"[\");\n\t\t\tb.Append(SymbolKind.ToString());\n\t\t\tb.Append(' ');\n\t\t\tif (DeclaringTypeDefinition != null) {\n\t\t\t\tb.Append(DeclaringTypeDefinition.Name);\n\t\t\t\tb.Append('.');\n\t\t\t}\n\t\t\tb.Append(Name);\n\t\t\tb.Append('(');\n\t\t\tb.Append(string.Join(\", \", this.Parameters));\n\t\t\tb.Append(\"):\");\n\t\t\tb.Append(ReturnType.ToString());\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tpublic override IMember CreateResolved(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultResolvedMethod(this, context);\n\t\t}\n\t\t\n\t\tpublic override IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (accessorOwner != null) {\n\t\t\t\tvar owner = accessorOwner.Resolve(context);\n\t\t\t\tif (owner != null) {\n\t\t\t\t\tIProperty p = owner as IProperty;\n\t\t\t\t\tif (p != null) {\n\t\t\t\t\t\tif (p.CanGet && p.Getter.Name == this.Name)\n\t\t\t\t\t\t\treturn p.Getter;\n\t\t\t\t\t\tif (p.CanSet && p.Setter.Name == this.Name)\n\t\t\t\t\t\t\treturn p.Setter;\n\t\t\t\t\t}\n\t\t\t\t\tIEvent e = owner as IEvent;\n\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\tif (e.CanAdd && e.AddAccessor.Name == this.Name)\n\t\t\t\t\t\t\treturn e.AddAccessor;\n\t\t\t\t\t\tif (e.CanRemove && e.RemoveAccessor.Name == this.Name)\n\t\t\t\t\t\t\treturn e.RemoveAccessor;\n\t\t\t\t\t\tif (e.CanInvoke && e.InvokeAccessor.Name == this.Name)\n\t\t\t\t\t\t\treturn e.InvokeAccessor;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tITypeReference interfaceTypeReference = null;\n\t\t\tif (this.IsExplicitInterfaceImplementation && this.ExplicitInterfaceImplementations.Count == 1)\n\t\t\t\tinterfaceTypeReference = this.ExplicitInterfaceImplementations[0].DeclaringTypeReference;\n\t\t\treturn Resolve(ExtendContextForType(context, this.DeclaringTypeDefinition),\n\t\t\t               this.SymbolKind, this.Name, interfaceTypeReference,\n\t\t\t               this.TypeParameters.Select(tp => tp.Name).ToList(),\n\t\t\t               this.Parameters.Select(p => p.Type).ToList());\n\t\t}\n\t\t\n\t\tIMethod IUnresolvedMethod.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn (IMethod)Resolve(context);\n\t\t}\n\t\t\n\t\tpublic static DefaultUnresolvedMethod CreateDefaultConstructor(IUnresolvedTypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (typeDefinition == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeDefinition\");\n\t\t\tDomRegion region = typeDefinition.Region;\n\t\t\tregion = new DomRegion(region.FileName, region.BeginLine, region.BeginColumn); // remove endline/endcolumn\n\t\t\treturn new DefaultUnresolvedMethod(typeDefinition, \".ctor\") {\n\t\t\t\tSymbolKind = SymbolKind.Constructor,\n\t\t\t\tAccessibility = typeDefinition.IsAbstract ? Accessibility.Protected : Accessibility.Public,\n\t\t\t\tIsSynthetic = true,\n\t\t\t\tHasBody = true,\n\t\t\t\tRegion = region,\n\t\t\t\tBodyRegion = region,\n\t\t\t\tReturnType = KnownTypeReference.Void\n\t\t\t};\n\t\t}\n\t\t\n\t\tstatic readonly IUnresolvedMethod dummyConstructor = CreateDummyConstructor();\n\t\t\n\t\t/// <summary>\n\t\t/// Returns a dummy constructor instance:\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A public instance constructor with IsSynthetic=true and no declaring type.\n\t\t/// </returns>\n\t\tpublic static IUnresolvedMethod DummyConstructor {\n\t\t\tget { return dummyConstructor; }\n\t\t}\n\t\t\n\t\tstatic IUnresolvedMethod CreateDummyConstructor()\n\t\t{\n\t\t\tvar m = new DefaultUnresolvedMethod {\n\t\t\t\tSymbolKind = SymbolKind.Constructor,\n\t\t\t\tName = \".ctor\",\n\t\t\t\tAccessibility = Accessibility.Public,\n\t\t\t\tIsSynthetic = true,\n\t\t\t\tReturnType = KnownTypeReference.Void\n\t\t\t};\n\t\t\tm.Freeze();\n\t\t\treturn m;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation for IUnresolvedParameter.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class DefaultUnresolvedParameter : IUnresolvedParameter, IFreezable, ISupportsInterning\n\t{\n\t\tstring name = string.Empty;\n\t\tITypeReference type = SpecialType.UnknownType;\n\t\tIList<IUnresolvedAttribute> attributes;\n\t\tIConstantValue defaultValue;\n\t\tDomRegion region;\n\t\tbyte flags;\n\t\t\n\t\tpublic DefaultUnresolvedParameter()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedParameter(ITypeReference type, string name)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.type = type;\n\t\t\tthis.name = name;\n\t\t}\n\t\t\n\t\tvoid FreezeInternal()\n\t\t{\n\t\t\tattributes = FreezableHelper.FreezeListAndElements(attributes);\n\t\t\tFreezableHelper.Freeze(defaultValue);\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tname = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ITypeReference Type {\n\t\t\tget { return type; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\ttype = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> Attributes {\n\t\t\tget {\n\t\t\t\tif (attributes == null)\n\t\t\t\t\tattributes = new List<IUnresolvedAttribute>();\n\t\t\t\treturn attributes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IConstantValue DefaultValue {\n\t\t\tget { return defaultValue; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tdefaultValue = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tregion = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool HasFlag(byte flag)\n\t\t{\n\t\t\treturn (this.flags & flag) != 0;\n\t\t}\n\t\tvoid SetFlag(byte flag, bool value)\n\t\t{\n\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\tif (value)\n\t\t\t\tthis.flags |= flag;\n\t\t\telse\n\t\t\t\tthis.flags &= unchecked((byte)~flag);\n\t\t}\n\t\t\n\t\tpublic bool IsFrozen {\n\t\t\tget { return HasFlag(1); }\n\t\t}\n\t\t\n\t\tpublic void Freeze()\n\t\t{\n\t\t\tif (!this.IsFrozen) {\n\t\t\t\tFreezeInternal();\n\t\t\t\tthis.flags |= 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsRef {\n\t\t\tget { return HasFlag(2); }\n\t\t\tset { SetFlag(2, value); }\n\t\t}\n\t\t\n\t\tpublic bool IsOut {\n\t\t\tget { return HasFlag(4); }\n\t\t\tset { SetFlag(4, value); }\n\t\t}\n\t\t\n\t\tpublic bool IsParams {\n\t\t\tget { return HasFlag(8); }\n\t\t\tset { SetFlag(8, value); }\n\t\t}\n\t\t\n\t\tpublic bool IsOptional {\n\t\t\tget { return this.DefaultValue != null; }\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hashCode = 1919191 ^ (flags & ~1);\n\t\t\t\thashCode *= 31;\n\t\t\t\thashCode += type.GetHashCode();\n\t\t\t\thashCode *= 31;\n\t\t\t\thashCode += name.GetHashCode();\n\t\t\t\tif (attributes != null) {\n\t\t\t\t\tforeach (var attr in attributes)\n\t\t\t\t\t\thashCode ^= attr.GetHashCode ();\n\t\t\t\t}\n\t\t\t\tif (defaultValue != null)\n\t\t\t\t\thashCode ^= defaultValue.GetHashCode ();\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\t// compare everything except for the IsFrozen flag\n\t\t\tDefaultUnresolvedParameter p = other as DefaultUnresolvedParameter;\n\t\t\treturn p != null && type == p.type && name == p.name &&\n\t\t\t\tdefaultValue == p.defaultValue && region == p.region && (flags & ~1) == (p.flags & ~1) && ListEquals(attributes, p.attributes);\n\t\t}\n\t\t\n\t\tstatic bool ListEquals(IList<IUnresolvedAttribute> list1, IList<IUnresolvedAttribute> list2)\n\t\t{\n\t\t\treturn (list1 ?? EmptyList<IUnresolvedAttribute>.Instance).SequenceEqual(list2 ?? EmptyList<IUnresolvedAttribute>.Instance);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tif (IsRef)\n\t\t\t\tb.Append(\"ref \");\n\t\t\tif (IsOut)\n\t\t\t\tb.Append(\"out \");\n\t\t\tif (IsParams)\n\t\t\t\tb.Append(\"params \");\n\t\t\tb.Append(name);\n\t\t\tb.Append(':');\n\t\t\tb.Append(type.ToString());\n\t\t\tif (defaultValue != null) {\n\t\t\t\tb.Append(\" = \");\n\t\t\t\tb.Append(defaultValue.ToString());\n\t\t\t}\n\t\t\treturn b.ToString();\n\t\t}\n\n\t\tstatic bool IsOptionalAttribute (IType attributeType)\n\t\t{\n\t\t\treturn attributeType.Name == \"OptionalAttribute\" && attributeType.Namespace == \"System.Runtime.InteropServices\";\n\t\t}\n\t\t\n\t\tpublic IParameter CreateResolvedParameter(ITypeResolveContext context)\n\t\t{\n\t\t\tFreeze();\n\t\t\tif (defaultValue != null) {\n\t\t\t\treturn new ResolvedParameterWithDefaultValue(defaultValue, context) {\n\t\t\t\t\tType = type.Resolve(context),\n\t\t\t\t\tName = name,\n\t\t\t\t\tRegion = region,\n\t\t\t\t\tAttributes = attributes.CreateResolvedAttributes(context),\n\t\t\t\t\tIsRef = this.IsRef,\n\t\t\t\t\tIsOut = this.IsOut,\n\t\t\t\t\tIsParams = this.IsParams\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tvar owner = context.CurrentMember as IParameterizedMember;\n\t\t\t\tvar resolvedAttributes = attributes.CreateResolvedAttributes (context);\n\t\t\t\tbool isOptional = resolvedAttributes != null && resolvedAttributes.Any (a => IsOptionalAttribute (a.AttributeType));\n\t\t\t\treturn new DefaultParameter (type.Resolve (context), name, owner, region,\n\t\t\t\t                             resolvedAttributes, IsRef, IsOut, IsParams, isOptional);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class ResolvedParameterWithDefaultValue : IParameter\n\t\t{\n\t\t\treadonly IConstantValue defaultValue;\n\t\t\treadonly ITypeResolveContext context;\n\t\t\t\n\t\t\tpublic ResolvedParameterWithDefaultValue(IConstantValue defaultValue, ITypeResolveContext context)\n\t\t\t{\n\t\t\t\tthis.defaultValue = defaultValue;\n\t\t\t\tthis.context = context;\n\t\t\t}\n\t\t\t\n\t\t\tSymbolKind ISymbol.SymbolKind { get { return SymbolKind.Parameter; } }\n\t\t\tpublic IParameterizedMember Owner { get { return context.CurrentMember as IParameterizedMember; } }\n\t\t\tpublic IType Type { get; internal set; }\n\t\t\tpublic string Name { get; internal set; }\n\t\t\tpublic DomRegion Region { get; internal set; }\n\t\t\tpublic IList<IAttribute> Attributes { get; internal set; }\n\t\t\tpublic bool IsRef { get; internal set; }\n\t\t\tpublic bool IsOut { get; internal set; }\n\t\t\tpublic bool IsParams { get; internal set; }\n\t\t\tpublic bool IsOptional { get { return true; } }\n\t\t\tbool IVariable.IsConst { get { return false; } }\n\t\t\t\n\t\t\tResolveResult resolvedDefaultValue;\n\t\t\t\n\t\t\tpublic object ConstantValue {\n\t\t\t\tget {\n\t\t\t\t\tResolveResult rr = LazyInit.VolatileRead(ref this.resolvedDefaultValue);\n\t\t\t\t\tif (rr == null) {\n\t\t\t\t\t\trr = defaultValue.Resolve(context);\n\t\t\t\t\t\tLazyInit.GetOrSet(ref this.resolvedDefaultValue, rr);\n\t\t\t\t\t}\n\t\t\t\t\treturn rr.ConstantValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn DefaultParameter.ToString(this);\n\t\t\t}\n\n\t\t\tpublic ISymbolReference ToReference()\n\t\t\t{\n\t\t\t\tif (Owner == null)\n\t\t\t\t\treturn new ParameterReference(Type.ToTypeReference(), Name, Region, IsRef, IsOut, IsParams, true, ConstantValue);\n\t\t\t\treturn new OwnedParameterReference(Owner.ToReference(), Owner.Parameters.IndexOf(this));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedProperty.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IUnresolvedProperty\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic class DefaultUnresolvedProperty : AbstractUnresolvedMember, IUnresolvedProperty\n\t{\n\t\tIUnresolvedMethod getter, setter;\n\t\tIList<IUnresolvedParameter> parameters;\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tparameters = FreezableHelper.FreezeListAndElements(parameters);\n\t\t\tFreezableHelper.Freeze(getter);\n\t\t\tFreezableHelper.Freeze(setter);\n\t\t\tbase.FreezeInternal();\n\t\t}\n\t\t\n\t\tpublic override object Clone()\n\t\t{\n\t\t\tvar copy = (DefaultUnresolvedProperty)base.Clone();\n\t\t\tif (parameters != null)\n\t\t\t\tcopy.parameters = new List<IUnresolvedParameter>(parameters);\n\t\t\treturn copy;\n\t\t}\n\t\t\n\t\tpublic override void ApplyInterningProvider(InterningProvider provider)\n\t\t{\n\t\t\tbase.ApplyInterningProvider(provider);\n\t\t\tparameters = provider.InternList(parameters);\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedProperty()\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Property;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedProperty(IUnresolvedTypeDefinition declaringType, string name)\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.Property;\n\t\t\tthis.DeclaringTypeDefinition = declaringType;\n\t\t\tthis.Name = name;\n\t\t\tif (declaringType != null)\n\t\t\t\tthis.UnresolvedFile = declaringType.UnresolvedFile;\n\t\t}\n\t\t\n\t\tpublic bool IsIndexer {\n\t\t\tget { return this.SymbolKind == SymbolKind.Indexer; }\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedParameter> Parameters {\n\t\t\tget {\n\t\t\t\tif (parameters == null)\n\t\t\t\t\tparameters = new List<IUnresolvedParameter>();\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool CanGet {\n\t\t\tget { return getter != null; }\n\t\t}\n\t\t\n\t\tpublic bool CanSet {\n\t\t\tget { return setter != null; }\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMethod Getter {\n\t\t\tget { return getter; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tgetter = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMethod Setter {\n\t\t\tget { return setter; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tsetter = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IMember CreateResolved(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultResolvedProperty(this, context);\n\t\t}\n\t\t\n\t\tpublic override IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tITypeReference interfaceTypeReference = null;\n\t\t\tif (this.IsExplicitInterfaceImplementation && this.ExplicitInterfaceImplementations.Count == 1)\n\t\t\t\tinterfaceTypeReference = this.ExplicitInterfaceImplementations[0].DeclaringTypeReference;\n\t\t\treturn Resolve(ExtendContextForType(context, this.DeclaringTypeDefinition), \n\t\t\t               this.SymbolKind, this.Name, interfaceTypeReference,\n\t\t\t               parameterTypeReferences: this.Parameters.Select(p => p.Type).ToList());\n\t\t}\n\t\t\n\t\tIProperty IUnresolvedProperty.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn (IProperty)Resolve(context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedTypeDefinition.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Represents an unresolved type definition.\n\t/// </summary>\n\t[Serializable]\n\tpublic class DefaultUnresolvedTypeDefinition : AbstractUnresolvedEntity, IUnresolvedTypeDefinition\n\t{\n\t\tTypeKind kind = TypeKind.Class;\n\t\tstring namespaceName;\n\t\tIList<ITypeReference> baseTypes;\n\t\tIList<IUnresolvedTypeParameter> typeParameters;\n\t\tIList<IUnresolvedTypeDefinition> nestedTypes;\n\t\tIList<IUnresolvedMember> members;\n\t\t\n\t\tpublic DefaultUnresolvedTypeDefinition()\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.TypeDefinition;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedTypeDefinition(string fullName)\n\t\t{\n\t\t\tstring namespaceName;\n\t\t\tstring name;\n\t\t\tint idx = fullName.LastIndexOf ('.');\n\t\t\tif (idx > 0) {\n\t\t\t\tnamespaceName = fullName.Substring (0, idx);\n\t\t\t\tname = fullName.Substring (idx + 1);\n\t\t\t} else {\n\t\t\t\tnamespaceName = \"\";\n\t\t\t\tname = fullName;\n\t\t\t}\n\n\t\t\tthis.SymbolKind = SymbolKind.TypeDefinition;\n\t\t\tthis.namespaceName = namespaceName;\n\t\t\tthis.Name = name;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedTypeDefinition(string namespaceName, string name)\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.TypeDefinition;\n\t\t\tthis.namespaceName = namespaceName;\n\t\t\tthis.Name = name;\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedTypeDefinition(IUnresolvedTypeDefinition declaringTypeDefinition, string name)\n\t\t{\n\t\t\tthis.SymbolKind = SymbolKind.TypeDefinition;\n\t\t\tthis.DeclaringTypeDefinition = declaringTypeDefinition;\n\t\t\tthis.namespaceName = declaringTypeDefinition.Namespace;\n\t\t\tthis.Name = name;\n\t\t\tthis.UnresolvedFile = declaringTypeDefinition.UnresolvedFile;\n\t\t}\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tbase.FreezeInternal();\n\t\t\tbaseTypes = FreezableHelper.FreezeList(baseTypes);\n\t\t\ttypeParameters = FreezableHelper.FreezeListAndElements(typeParameters);\n\t\t\tnestedTypes = FreezableHelper.FreezeListAndElements(nestedTypes);\n\t\t\tmembers = FreezableHelper.FreezeListAndElements(members);\n\t\t}\n\t\t\n\t\tpublic override object Clone()\n\t\t{\n\t\t\tvar copy = (DefaultUnresolvedTypeDefinition)base.Clone();\n\t\t\tif (baseTypes != null)\n\t\t\t\tcopy.baseTypes = new List<ITypeReference>(baseTypes);\n\t\t\tif (typeParameters != null)\n\t\t\t\tcopy.typeParameters = new List<IUnresolvedTypeParameter>(typeParameters);\n\t\t\tif (nestedTypes != null)\n\t\t\t\tcopy.nestedTypes = new List<IUnresolvedTypeDefinition>(nestedTypes);\n\t\t\tif (members != null)\n\t\t\t\tcopy.members = new List<IUnresolvedMember>(members);\n\t\t\treturn copy;\n\t\t}\n\t\t\n\t\tpublic TypeKind Kind {\n\t\t\tget { return kind; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tkind = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool AddDefaultConstructorIfRequired {\n\t\t\tget { return flags[FlagAddDefaultConstructorIfRequired]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagAddDefaultConstructorIfRequired] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool? HasExtensionMethods {\n\t\t\tget {\n\t\t\t\tif (flags[FlagHasExtensionMethods])\n\t\t\t\t\treturn true;\n\t\t\t\telse if (flags[FlagHasNoExtensionMethods])\n\t\t\t\t\treturn false;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagHasExtensionMethods] = (value == true);\n\t\t\t\tflags[FlagHasNoExtensionMethods] = (value == false);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsPartial {\n\t\t\tget { return flags[FlagPartialTypeDefinition]; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tflags[FlagPartialTypeDefinition] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string Namespace {\n\t\t\tget { return namespaceName; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tnamespaceName = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ReflectionName {\n\t\t\tget {\n\t\t\t\treturn this.FullTypeName.ReflectionName;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic FullTypeName FullTypeName {\n\t\t\tget {\n\t\t\t\tIUnresolvedTypeDefinition declaringTypeDef = this.DeclaringTypeDefinition;\n\t\t\t\tif (declaringTypeDef != null) {\n\t\t\t\t\treturn declaringTypeDef.FullTypeName.NestedType(this.Name, this.TypeParameters.Count - declaringTypeDef.TypeParameters.Count);\n\t\t\t\t} else {\n\t\t\t\t\treturn new TopLevelTypeName(namespaceName, this.Name, this.TypeParameters.Count);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<ITypeReference> BaseTypes {\n\t\t\tget {\n\t\t\t\tif (baseTypes == null)\n\t\t\t\t\tbaseTypes = new List<ITypeReference>();\n\t\t\t\treturn baseTypes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedTypeParameter> TypeParameters {\n\t\t\tget {\n\t\t\t\tif (typeParameters == null)\n\t\t\t\t\ttypeParameters = new List<IUnresolvedTypeParameter>();\n\t\t\t\treturn typeParameters;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedTypeDefinition> NestedTypes {\n\t\t\tget {\n\t\t\t\tif (nestedTypes == null)\n\t\t\t\t\tnestedTypes = new List<IUnresolvedTypeDefinition>();\n\t\t\t\treturn nestedTypes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedMember> Members {\n\t\t\tget {\n\t\t\t\tif (members == null)\n\t\t\t\t\tmembers = new List<IUnresolvedMember>();\n\t\t\t\treturn members;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedMethod> Methods {\n\t\t\tget {\n\t\t\t\treturn Members.OfType<IUnresolvedMethod> ();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedProperty> Properties {\n\t\t\tget {\n\t\t\t\treturn Members.OfType<IUnresolvedProperty> ();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedField> Fields {\n\t\t\tget {\n\t\t\t\treturn Members.OfType<IUnresolvedField> ();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedEvent> Events {\n\t\t\tget {\n\t\t\t\treturn Members.OfType<IUnresolvedEvent> ();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tif (context.CurrentAssembly == null)\n\t\t\t\tthrow new ArgumentException(\"An ITypeDefinition cannot be resolved in a context without a current assembly.\");\n\t\t\treturn context.CurrentAssembly.GetTypeDefinition(this.FullTypeName)\n\t\t\t\t?? (IType)new UnknownType(this.Namespace, this.Name, this.TypeParameters.Count);\n\t\t}\n\t\t\n\t\tpublic virtual ITypeResolveContext CreateResolveContext(ITypeResolveContext parentContext)\n\t\t{\n\t\t\treturn parentContext;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedTypeParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IUnresolvedTypeParameter\"/>.\n\t/// </summary>\n\t[Serializable]\n\tpublic class DefaultUnresolvedTypeParameter : IUnresolvedTypeParameter, IFreezable\n\t{\n\t\treadonly int index;\n\t\tIList<IUnresolvedAttribute> attributes;\n\t\tIList<ITypeReference> constraints;\n\t\tstring name;\n\t\tDomRegion region;\n\t\t\n\t\tSymbolKind ownerType;\n\t\tVarianceModifier variance;\n\t\tBitVector16 flags;\n\t\tconst ushort FlagFrozen                       = 0x0001;\n\t\tconst ushort FlagReferenceTypeConstraint      = 0x0002;\n\t\tconst ushort FlagValueTypeConstraint          = 0x0004;\n\t\tconst ushort FlagDefaultConstructorConstraint = 0x0008;\n\t\t\n\t\tpublic void Freeze()\n\t\t{\n\t\t\tif (!flags[FlagFrozen]) {\n\t\t\t\tFreezeInternal();\n\t\t\t\tflags[FlagFrozen] = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected virtual void FreezeInternal()\n\t\t{\n\t\t\tattributes = FreezableHelper.FreezeListAndElements(attributes);\n\t\t\tconstraints = FreezableHelper.FreezeList(constraints);\n\t\t}\n\t\t\n\t\tpublic DefaultUnresolvedTypeParameter(SymbolKind ownerType, int index, string name = null)\n\t\t{\n\t\t\tthis.ownerType = ownerType;\n\t\t\tthis.index = index;\n\t\t\tthis.name = name ?? ((ownerType == SymbolKind.Method ? \"!!\" : \"!\") + index.ToString(CultureInfo.InvariantCulture));\n\t\t}\n\t\t\n\t\tpublic SymbolKind OwnerType {\n\t\t\tget { return ownerType; }\n\t\t}\n\t\t\n\t\tpublic int Index {\n\t\t\tget { return index; }\n\t\t}\n\t\t\n\t\tpublic bool IsFrozen {\n\t\t\tget { return flags[FlagFrozen]; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tname = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstring INamedElement.FullName {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tstring INamedElement.Namespace {\n\t\t\tget { return string.Empty; }\n\t\t}\n\t\t\n\t\tstring INamedElement.ReflectionName {\n\t\t\tget {\n\t\t\t\tif (ownerType == SymbolKind.Method)\n\t\t\t\t\treturn \"``\" + index.ToString(CultureInfo.InvariantCulture);\n\t\t\t\telse\n\t\t\t\t\treturn \"`\" + index.ToString(CultureInfo.InvariantCulture);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> Attributes {\n\t\t\tget {\n\t\t\t\tif (attributes == null)\n\t\t\t\t\tattributes = new List<IUnresolvedAttribute>();\n\t\t\t\treturn attributes;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<ITypeReference> Constraints {\n\t\t\tget {\n\t\t\t\tif (constraints == null)\n\t\t\t\t\tconstraints = new List<ITypeReference>();\n\t\t\t\treturn constraints;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic VarianceModifier Variance {\n\t\t\tget { return variance; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tvariance = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tregion = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool HasDefaultConstructorConstraint {\n\t\t\tget { return flags[FlagDefaultConstructorConstraint]; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tflags[FlagDefaultConstructorConstraint] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool HasReferenceTypeConstraint {\n\t\t\tget { return flags[FlagReferenceTypeConstraint]; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tflags[FlagReferenceTypeConstraint] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool HasValueTypeConstraint {\n\t\t\tget { return flags[FlagValueTypeConstraint]; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tflags[FlagValueTypeConstraint] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Uses the specified interning provider to intern\n\t\t/// strings and lists in this entity.\n\t\t/// This method does not test arbitrary objects to see if they implement ISupportsInterning;\n\t\t/// instead we assume that those are interned immediately when they are created (before they are added to this entity).\n\t\t/// </summary>\n\t\tpublic virtual void ApplyInterningProvider(InterningProvider provider)\n\t\t{\n\t\t\tif (provider == null)\n\t\t\t\tthrow new ArgumentNullException(\"provider\");\n\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\tname = provider.Intern(name);\n\t\t\tattributes = provider.InternList(attributes);\n\t\t\tconstraints = provider.InternList(constraints);\n\t\t}\n\t\t\n\t\tpublic virtual ITypeParameter CreateResolvedTypeParameter(ITypeResolveContext context)\n\t\t{\n\t\t\tIEntity owner = null;\n\t\t\tif (this.OwnerType == SymbolKind.Method) {\n\t\t\t\towner = context.CurrentMember as IMethod;\n\t\t\t} else if (this.OwnerType == SymbolKind.TypeDefinition) {\n\t\t\t\towner = context.CurrentTypeDefinition;\n\t\t\t}\n\t\t\tif (owner == null)\n\t\t\t\tthrow new InvalidOperationException(\"Could not determine the type parameter's owner.\");\n\t\t\treturn new DefaultTypeParameter(\n\t\t\t\towner, index, name, variance,\n\t\t\t\tthis.Attributes.CreateResolvedAttributes(context), this.Region,\n\t\t\t\tthis.HasValueTypeConstraint, this.HasReferenceTypeConstraint, this.HasDefaultConstructorConstraint, this.Constraints.Resolve(context)\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultVariable.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Default implementation of <see cref=\"IVariable\"/>.\n\t/// </summary>\n\tpublic sealed class DefaultVariable : IVariable\n\t{\n\t\treadonly string name;\n\t\treadonly DomRegion region;\n\t\treadonly IType type;\n\t\treadonly object constantValue;\n\t\treadonly bool isConst;\n\t\t\n\t\tpublic DefaultVariable(IType type, string name)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.type = type;\n\t\t\tthis.name = name;\n\t\t}\n\t\t\n\t\tpublic DefaultVariable(IType type, string name, DomRegion region = default(DomRegion),\n\t\t                       bool isConst = false, object constantValue = null)\n\t\t\t: this(type, name)\n\t\t{\n\t\t\tthis.region = region;\n\t\t\tthis.isConst = isConst;\n\t\t\tthis.constantValue = constantValue;\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t}\n\t\t\n\t\tpublic IType Type {\n\t\t\tget { return type; }\n\t\t}\n\t\t\n\t\tpublic bool IsConst {\n\t\t\tget { return isConst; }\n\t\t}\n\t\t\n\t\tpublic object ConstantValue {\n\t\t\tget { return constantValue; }\n\t\t}\n\t\t\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Variable; }\n\t\t}\n\n\t\tpublic ISymbolReference ToReference()\n\t\t{\n\t\t\treturn new VariableReference(type.ToTypeReference(), name, region, isConst, constantValue);\n\t\t}\n\t}\n\t\n\tpublic sealed class VariableReference : ISymbolReference\n\t{\n\t\tITypeReference variableTypeReference;\n\t\tstring name;\n\t\tDomRegion region;\n\t\tbool isConst;\n\t\tobject constantValue;\n\t\t\n\t\tpublic VariableReference(ITypeReference variableTypeReference, string name, DomRegion region, bool isConst, object constantValue)\n\t\t{\n\t\t\tif (variableTypeReference == null)\n\t\t\t\tthrow new ArgumentNullException(\"variableTypeReference\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.variableTypeReference = variableTypeReference;\n\t\t\tthis.name = name;\n\t\t\tthis.region = region;\n\t\t\tthis.isConst = isConst;\n\t\t\tthis.constantValue = constantValue;\n\t\t}\n\t\t\n\t\tpublic ISymbol Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new DefaultVariable(variableTypeReference.Resolve(context), name, region, isConst, constantValue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DummyTypeParameter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic sealed class DummyTypeParameter : AbstractType, ITypeParameter\n\t{\n\t\tstatic ITypeParameter[] methodTypeParameters = { new DummyTypeParameter(SymbolKind.Method, 0) };\n\t\tstatic ITypeParameter[] classTypeParameters = { new DummyTypeParameter(SymbolKind.TypeDefinition, 0) };\n\t\t\n\t\tpublic static ITypeParameter GetMethodTypeParameter(int index)\n\t\t{\n\t\t\treturn GetTypeParameter(ref methodTypeParameters, SymbolKind.Method, index);\n\t\t}\n\t\t\n\t\tpublic static ITypeParameter GetClassTypeParameter(int index)\n\t\t{\n\t\t\treturn GetTypeParameter(ref classTypeParameters, SymbolKind.TypeDefinition, index);\n\t\t}\n\t\t\n\t\tstatic ITypeParameter GetTypeParameter(ref ITypeParameter[] typeParameters, SymbolKind symbolKind, int index)\n\t\t{\n\t\t\tITypeParameter[] tps = typeParameters;\n\t\t\twhile (index >= tps.Length) {\n\t\t\t\t// We don't have a normal type parameter for this index, so we need to extend our array.\n\t\t\t\t// Because the array can be used concurrently from multiple threads, we have to use\n\t\t\t\t// Interlocked.CompareExchange.\n\t\t\t\tITypeParameter[] newTps = new ITypeParameter[index + 1];\n\t\t\t\ttps.CopyTo(newTps, 0);\n\t\t\t\tfor (int i = tps.Length; i < newTps.Length; i++) {\n\t\t\t\t\tnewTps[i] = new DummyTypeParameter(symbolKind, i);\n\t\t\t\t}\n\t\t\t\tITypeParameter[] oldTps = Interlocked.CompareExchange(ref typeParameters, newTps, tps);\n\t\t\t\tif (oldTps == tps) {\n\t\t\t\t\t// exchange successful\n\t\t\t\t\ttps = newTps;\n\t\t\t\t} else {\n\t\t\t\t\t// exchange not successful\n\t\t\t\t\ttps = oldTps;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tps[index];\n\t\t}\n\t\t\n\t\tsealed class NormalizeMethodTypeParametersVisitor : TypeVisitor\n\t\t{\n\t\t\tpublic override IType VisitTypeParameter(ITypeParameter type)\n\t\t\t{\n\t\t\t\tif (type.OwnerType == SymbolKind.Method) {\n\t\t\t\t\treturn DummyTypeParameter.GetMethodTypeParameter(type.Index);\n\t\t\t\t} else {\n\t\t\t\t\treturn base.VisitTypeParameter(type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsealed class NormalizeClassTypeParametersVisitor : TypeVisitor\n\t\t{\n\t\t\tpublic override IType VisitTypeParameter(ITypeParameter type)\n\t\t\t{\n\t\t\t\tif (type.OwnerType == SymbolKind.TypeDefinition) {\n\t\t\t\t\treturn DummyTypeParameter.GetClassTypeParameter(type.Index);\n\t\t\t\t} else {\n\t\t\t\t\treturn base.VisitTypeParameter(type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic readonly NormalizeMethodTypeParametersVisitor normalizeMethodTypeParameters = new NormalizeMethodTypeParametersVisitor();\n\t\tstatic readonly NormalizeClassTypeParametersVisitor normalizeClassTypeParameters = new NormalizeClassTypeParametersVisitor();\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces all occurrences of method type parameters in the given type\n\t\t/// by normalized type parameters. This allows comparing parameter types from different\n\t\t/// generic methods.\n\t\t/// </summary>\n\t\tpublic static IType NormalizeMethodTypeParameters(IType type)\n\t\t{\n\t\t\treturn type.AcceptVisitor(normalizeMethodTypeParameters);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces all occurrences of class type parameters in the given type\n\t\t/// by normalized type parameters. This allows comparing parameter types from different\n\t\t/// generic methods.\n\t\t/// </summary>\n\t\tpublic static IType NormalizeClassTypeParameters(IType type)\n\t\t{\n\t\t\treturn type.AcceptVisitor(normalizeClassTypeParameters);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces all occurrences of class and method type parameters in the given type\n\t\t/// by normalized type parameters. This allows comparing parameter types from different\n\t\t/// generic methods.\n\t\t/// </summary>\n\t\tpublic static IType NormalizeAllTypeParameters(IType type)\n\t\t{\n\t\t\treturn type.AcceptVisitor(normalizeClassTypeParameters).AcceptVisitor(normalizeMethodTypeParameters);\n\t\t}\n\t\t\n\t\treadonly SymbolKind ownerType;\n\t\treadonly int index;\n\t\t\n\t\tprivate DummyTypeParameter(SymbolKind ownerType, int index)\n\t\t{\n\t\t\tthis.ownerType = ownerType;\n\t\t\tthis.index = index;\n\t\t}\n\t\t\n\t\tSymbolKind ISymbol.SymbolKind {\n\t\t\tget { return SymbolKind.TypeParameter; }\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn (ownerType == SymbolKind.Method ? \"!!\" : \"!\") + index;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ReflectionName {\n\t\t\tget {\n\t\t\t\treturn (ownerType == SymbolKind.Method ? \"``\" : \"`\") + index;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ReflectionName + \" (dummy)\";\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.TypeParameter; }\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn TypeParameterReference.Create(ownerType, index);\n\t\t}\n\t\t\n\t\tpublic override IType AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitTypeParameter(this);\n\t\t}\n\t\t\n\t\tpublic int Index {\n\t\t\tget { return index; }\n\t\t}\n\t\t\n\t\tIList<IAttribute> ITypeParameter.Attributes {\n\t\t\tget { return EmptyList<IAttribute>.Instance; }\n\t\t}\n\t\t\n\t\tSymbolKind ITypeParameter.OwnerType {\n\t\t\tget { return ownerType; }\n\t\t}\n\t\t\n\t\tVarianceModifier ITypeParameter.Variance {\n\t\t\tget { return VarianceModifier.Invariant; }\n\t\t}\n\t\t\n\t\tDomRegion ITypeParameter.Region {\n\t\t\tget { return DomRegion.Empty; }\n\t\t}\n\t\t\n\t\tIEntity ITypeParameter.Owner {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tIType ITypeParameter.EffectiveBaseClass {\n\t\t\tget { return SpecialType.UnknownType; }\n\t\t}\n\t\t\n\t\tICollection<IType> ITypeParameter.EffectiveInterfaceSet {\n\t\t\tget { return EmptyList<IType>.Instance; }\n\t\t}\n\t\t\n\t\tbool ITypeParameter.HasDefaultConstructorConstraint {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tbool ITypeParameter.HasReferenceTypeConstraint {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tbool ITypeParameter.HasValueTypeConstraint {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic ISymbolReference ToReference()\n\t\t{\n\t\t\treturn new TypeParameterReference(ownerType, index);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/ExplicitInterfaceImplementationMemberReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// References a member that is an explicit interface implementation.\n\t/// </summary>\n\t/// <remarks>\n\t/// Resolving an ExplicitInterfaceImplementationMemberReference requires a context\n\t/// that provides enough information for resolving the declaring type reference\n\t/// and the interface member reference.\n\t/// Note that the interface member reference is resolved in '<c>context.WithCurrentTypeDefinition(declaringType.GetDefinition())</c>'\n\t/// - this is done to ensure that open generics in the interface member reference resolve to the type parameters of the\n\t/// declaring type.\n\t/// </remarks>\n\t[Serializable]\n\tpublic sealed class ExplicitInterfaceImplementationMemberReference : IMemberReference\n\t{\n\t\tITypeReference typeReference;\n\t\tIMemberReference interfaceMemberReference;\n\t\t\n\t\tpublic ExplicitInterfaceImplementationMemberReference(ITypeReference typeReference, IMemberReference interfaceMemberReference)\n\t\t{\n\t\t\tif (typeReference == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeReference\");\n\t\t\tif (interfaceMemberReference == null)\n\t\t\t\tthrow new ArgumentNullException(\"interfaceMemberReference\");\n\t\t\tthis.typeReference = typeReference;\n\t\t\tthis.interfaceMemberReference = interfaceMemberReference;\n\t\t}\n\t\t\n\t\tpublic ITypeReference DeclaringTypeReference {\n\t\t\tget { return typeReference; }\n\t\t}\n\t\t\n\t\tpublic IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIType declaringType = typeReference.Resolve(context);\n\t\t\tIMember interfaceMember = interfaceMemberReference.Resolve(context.WithCurrentTypeDefinition(declaringType.GetDefinition()));\n\t\t\tif (interfaceMember == null)\n\t\t\t\treturn null;\n\t\t\tIEnumerable<IMember> members;\n\t\t\tif (interfaceMember.SymbolKind == SymbolKind.Accessor) {\n\t\t\t\tmembers = declaringType.GetAccessors(\n\t\t\t\t\tm => m.IsExplicitInterfaceImplementation,\n\t\t\t\t\tGetMemberOptions.IgnoreInheritedMembers);\n\t\t\t} else {\n\t\t\t\tmembers = declaringType.GetMembers(\n\t\t\t\t\tm => m.SymbolKind == interfaceMember.SymbolKind && m.IsExplicitInterfaceImplementation,\n\t\t\t\t\tGetMemberOptions.IgnoreInheritedMembers);\n\t\t\t}\n\t\t\treturn members.FirstOrDefault(m => m.ImplementedInterfaceMembers.Count == 1 && interfaceMember.Equals(m.ImplementedInterfaceMembers[0]));\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn Resolve(context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t[Obsolete(\"This struct was renamed to 'TopLevelTypeName'.\", true)]\n\tpublic struct FullNameAndTypeParameterCount\n\t{\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Type Reference used when the fully qualified type name is known.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class GetClassTypeReference : ITypeReference, ISymbolReference, ISupportsInterning\n\t{\n\t\treadonly IAssemblyReference assembly;\n\t\treadonly FullTypeName fullTypeName;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new GetClassTypeReference that searches a type definition.\n\t\t/// </summary>\n\t\t/// <param name=\"fullTypeName\">The full name of the type.</param>\n\t\t/// <param name=\"assembly\">A reference to the assembly containing this type.\n\t\t/// If this parameter is null, the GetClassTypeReference will search in all\n\t\t/// assemblies belonging to the compilation.\n\t\t/// </param>\n\t\tpublic GetClassTypeReference(FullTypeName fullTypeName, IAssemblyReference assembly = null)\n\t\t{\n\t\t\tthis.fullTypeName = fullTypeName;\n\t\t\tthis.assembly = assembly;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new GetClassTypeReference that searches a top-level type in all assemblies.\n\t\t/// </summary>\n\t\t/// <param name=\"namespaceName\">The namespace name containing the type, e.g. \"System.Collections.Generic\".</param>\n\t\t/// <param name=\"name\">The name of the type, e.g. \"List\".</param>\n\t\t/// <param name=\"typeParameterCount\">The number of type parameters, (e.g. 1 for List&lt;T&gt;).</param>\n\t\tpublic GetClassTypeReference(string namespaceName, string name, int typeParameterCount = 0)\n\t\t{\n\t\t\tthis.fullTypeName = new TopLevelTypeName(namespaceName, name, typeParameterCount);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new GetClassTypeReference that searches a top-level type in the specified assembly.\n\t\t/// </summary>\n\t\t/// <param name=\"assembly\">A reference to the assembly containing this type.\n\t\t/// If this parameter is null, the GetClassTypeReference will search in all assemblies belonging to the ICompilation.</param>\n\t\t/// <param name=\"namespaceName\">The namespace name containing the type, e.g. \"System.Collections.Generic\".</param>\n\t\t/// <param name=\"name\">The name of the type, e.g. \"List\".</param>\n\t\t/// <param name=\"typeParameterCount\">The number of type parameters, (e.g. 1 for List&lt;T&gt;).</param>\n\t\tpublic GetClassTypeReference(IAssemblyReference assembly, string namespaceName, string name, int typeParameterCount = 0)\n\t\t{\n\t\t\tthis.assembly = assembly;\n\t\t\tthis.fullTypeName = new TopLevelTypeName(namespaceName, name, typeParameterCount);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the assembly reference.\n\t\t/// This property returns null if the GetClassTypeReference is searching in all assemblies\n\t\t/// of the compilation.\n\t\t/// </summary>\n\t\tpublic IAssemblyReference Assembly { get { return assembly; } }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the full name of the type this reference is searching for.\n\t\t/// </summary>\n\t\tpublic FullTypeName FullTypeName { get { return fullTypeName; } }\n\t\t\n\t\t[Obsolete(\"Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.\")]\n\t\tpublic string Namespace { get { return fullTypeName.TopLevelTypeName.Namespace; } }\n\t\t[Obsolete(\"Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.\")]\n\t\tpublic string Name { get { return fullTypeName.Name; } }\n\t\t[Obsolete(\"Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.\")]\n\t\tpublic int TypeParameterCount { get { return fullTypeName.TypeParameterCount; } }\n\n\t\tIType ResolveInAllAssemblies(ITypeResolveContext context)\n\t\t{\n\t\t\tvar compilation = context.Compilation;\n\t\t\tforeach (var asm in compilation.Assemblies) {\n\t\t\t\tIType type = asm.GetTypeDefinition(fullTypeName);\n\t\t\t\tif (type != null)\n\t\t\t\t\treturn type;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\t\n\t\t\tIType type = null;\n\t\t\tif (assembly == null) {\n\t\t\t\t// No assembly specified: look in all assemblies, but prefer the current assembly\n\t\t\t\tif (context.CurrentAssembly != null) {\n\t\t\t\t\ttype = context.CurrentAssembly.GetTypeDefinition(fullTypeName);\n\t\t\t\t}\n\t\t\t\tif (type == null) {\n\t\t\t\t\ttype = ResolveInAllAssemblies(context);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Assembly specified: only look in the specified assembly.\n\t\t\t\t// But if that's not loaded in the compilation, allow fall back to other assemblies.\n\t\t\t\t// (the non-loaded assembly might be a facade containing type forwarders -\n\t\t\t\t//  for example, when referencing a portable library from a non-portable project)\n\t\t\t\tIAssembly asm = assembly.Resolve(context);\n\t\t\t\tif (asm != null) {\n\t\t\t\t\ttype = asm.GetTypeDefinition(fullTypeName);\n\t\t\t\t} else {\n\t\t\t\t\ttype = ResolveInAllAssemblies(context);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn type ?? new UnknownType(fullTypeName);\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tvar type = Resolve(context);\n\t\t\tif (type is ITypeDefinition)\n\t\t\t\treturn (ISymbol)type;\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn fullTypeName.ToString() + (assembly != null ? \", \" + assembly.ToString() : null);\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn 33 * assembly.GetHashCode() + fullTypeName.GetHashCode();\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tGetClassTypeReference o = other as GetClassTypeReference;\n\t\t\treturn o != null && assembly == o.assembly && fullTypeName == o.fullTypeName;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/GetMembersHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Provides helper methods for implementing GetMembers() on IType-implementations.\n\t/// Note: GetMembersHelper will recursively call back into IType.GetMembers(), but only with\n\t/// both GetMemberOptions.IgnoreInheritedMembers and GetMemberOptions.ReturnMemberDefinitions set,\n\t/// and only the 'simple' overloads (not taking type arguments).\n\t/// \n\t/// Ensure that your IType implementation does not use the GetMembersHelper if both flags are set,\n\t/// otherwise you'll get a StackOverflowException!\n\t/// </summary>\n\tstatic class GetMembersHelper\n\t{\n\t\t#region GetNestedTypes\n\t\tpublic static IEnumerable<IType> GetNestedTypes(IType type, Predicate<ITypeDefinition> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetNestedTypes(type, null, filter, options);\n\t\t}\n\t\t\n\t\tpublic static IEnumerable<IType> GetNestedTypes(IType type, IList<IType> nestedTypeArguments, Predicate<ITypeDefinition> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetNestedTypesImpl(type, nestedTypeArguments, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetNestedTypesImpl(t, nestedTypeArguments, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IType> GetNestedTypesImpl(IType outerType, IList<IType> nestedTypeArguments, Predicate<ITypeDefinition> filter, GetMemberOptions options)\n\t\t{\n\t\t\tITypeDefinition outerTypeDef = outerType.GetDefinition();\n\t\t\tif (outerTypeDef == null)\n\t\t\t\tyield break;\n\t\t\t\n\t\t\tint outerTypeParameterCount = outerTypeDef.TypeParameterCount;\n\t\t\tParameterizedType pt = outerType as ParameterizedType;\n\t\t\tforeach (ITypeDefinition nestedType in outerTypeDef.NestedTypes) {\n\t\t\t\tint totalTypeParameterCount = nestedType.TypeParameterCount;\n\t\t\t\tif (nestedTypeArguments != null) {\n\t\t\t\t\tif (totalTypeParameterCount - outerTypeParameterCount != nestedTypeArguments.Count)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!(filter == null || filter(nestedType)))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tif (totalTypeParameterCount == 0 || (options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions) {\n\t\t\t\t\tyield return nestedType;\n\t\t\t\t} else {\n\t\t\t\t\t// We need to parameterize the nested type\n\t\t\t\t\tIType[] newTypeArguments = new IType[totalTypeParameterCount];\n\t\t\t\t\tfor (int i = 0; i < outerTypeParameterCount; i++) {\n\t\t\t\t\t\tnewTypeArguments[i] = pt != null ? pt.GetTypeArgument(i) : outerTypeDef.TypeParameters[i];\n\t\t\t\t\t}\n\t\t\t\t\tfor (int i = outerTypeParameterCount; i < totalTypeParameterCount; i++) {\n\t\t\t\t\t\tif (nestedTypeArguments != null)\n\t\t\t\t\t\t\tnewTypeArguments[i] = nestedTypeArguments[i - outerTypeParameterCount];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnewTypeArguments[i] = SpecialType.UnboundTypeArgument;\n\t\t\t\t\t}\n\t\t\t\t\tyield return new ParameterizedType(nestedType, newTypeArguments);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetMethods\n\t\tpublic static IEnumerable<IMethod> GetMethods(IType type, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMethods(type, null, filter, options);\n\t\t}\n\t\t\n\t\tpublic static IEnumerable<IMethod> GetMethods(IType type, IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif (typeArguments != null && typeArguments.Count > 0) {\n\t\t\t\tfilter = FilterTypeParameterCount(typeArguments.Count).And(filter);\n\t\t\t}\n\t\t\t\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetMethodsImpl(type, typeArguments, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetMethodsImpl(t, typeArguments, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic Predicate<IUnresolvedMethod> FilterTypeParameterCount(int expectedTypeParameterCount)\n\t\t{\n\t\t\treturn m => m.TypeParameters.Count == expectedTypeParameterCount;\n\t\t}\n\t\t\n\t\tconst GetMemberOptions declaredMembers = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;\n\t\t\n\t\tstatic IEnumerable<IMethod> GetMethodsImpl(IType baseType, IList<IType> methodTypeArguments, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\tIEnumerable<IMethod> declaredMethods = baseType.GetMethods(filter, options | declaredMembers);\n\t\t\t\n\t\t\tParameterizedType pt = baseType as ParameterizedType;\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == 0\n\t\t\t    && (pt != null || (methodTypeArguments != null && methodTypeArguments.Count > 0)))\n\t\t\t{\n\t\t\t\tTypeParameterSubstitution substitution = null;\n\t\t\t\tforeach (IMethod m in declaredMethods) {\n\t\t\t\t\tif (methodTypeArguments != null && methodTypeArguments.Count > 0) {\n\t\t\t\t\t\tif (m.TypeParameters.Count != methodTypeArguments.Count)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (substitution == null) {\n\t\t\t\t\t\tif (pt != null)\n\t\t\t\t\t\t\tsubstitution = pt.GetSubstitution(methodTypeArguments);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tsubstitution = new TypeParameterSubstitution(null, methodTypeArguments);\n\t\t\t\t\t}\n\t\t\t\t\tyield return new SpecializedMethod(m, substitution);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach (IMethod m in declaredMethods) {\n\t\t\t\t\tyield return m;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetAccessors\n\t\tpublic static IEnumerable<IMethod> GetAccessors(IType type, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetAccessorsImpl(type, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetAccessorsImpl(t, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IMethod> GetAccessorsImpl(IType baseType, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetConstructorsOrAccessorsImpl(baseType, baseType.GetAccessors(filter, options | declaredMembers), filter, options);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetConstructors\n\t\tpublic static IEnumerable<IMethod> GetConstructors(IType type, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetConstructorsImpl(type, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetConstructorsImpl(t, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IMethod> GetConstructorsImpl(IType baseType, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetConstructorsOrAccessorsImpl(baseType, baseType.GetConstructors(filter, options | declaredMembers), filter, options);\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IMethod> GetConstructorsOrAccessorsImpl(IType baseType, IEnumerable<IMethod> declaredMembers, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions) {\n\t\t\t\treturn declaredMembers;\n\t\t\t}\n\t\t\t\n\t\t\tParameterizedType pt = baseType as ParameterizedType;\n\t\t\tif (pt != null) {\n\t\t\t\tvar substitution = pt.GetSubstitution();\n\t\t\t\treturn declaredMembers.Select(m => new SpecializedMethod(m, substitution) { DeclaringType = pt });\n\t\t\t} else {\n\t\t\t\treturn declaredMembers;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetProperties\n\t\tpublic static IEnumerable<IProperty> GetProperties(IType type, Predicate<IUnresolvedProperty> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetPropertiesImpl(type, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetPropertiesImpl(t, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IProperty> GetPropertiesImpl(IType baseType, Predicate<IUnresolvedProperty> filter, GetMemberOptions options)\n\t\t{\n\t\t\tIEnumerable<IProperty> declaredProperties = baseType.GetProperties(filter, options | declaredMembers);\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions) {\n\t\t\t\treturn declaredProperties;\n\t\t\t}\n\t\t\t\n\t\t\tParameterizedType pt = baseType as ParameterizedType;\n\t\t\tif (pt != null) {\n\t\t\t\tvar substitution = pt.GetSubstitution();\n\t\t\t\treturn declaredProperties.Select(m => new SpecializedProperty(m, substitution) { DeclaringType = pt });\n\t\t\t} else {\n\t\t\t\treturn declaredProperties;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetFields\n\t\tpublic static IEnumerable<IField> GetFields(IType type, Predicate<IUnresolvedField> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetFieldsImpl(type, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetFieldsImpl(t, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IField> GetFieldsImpl(IType baseType, Predicate<IUnresolvedField> filter, GetMemberOptions options)\n\t\t{\n\t\t\tIEnumerable<IField> declaredFields = baseType.GetFields(filter, options | declaredMembers);\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions) {\n\t\t\t\treturn declaredFields;\n\t\t\t}\n\t\t\t\n\t\t\tParameterizedType pt = baseType as ParameterizedType;\n\t\t\tif (pt != null) {\n\t\t\t\tvar substitution = pt.GetSubstitution();\n\t\t\t\treturn declaredFields.Select(m => new SpecializedField(m, substitution) { DeclaringType = pt });\n\t\t\t} else {\n\t\t\t\treturn declaredFields;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetEvents\n\t\tpublic static IEnumerable<IEvent> GetEvents(IType type, Predicate<IUnresolvedEvent> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetEventsImpl(type, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetEventsImpl(t, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IEvent> GetEventsImpl(IType baseType, Predicate<IUnresolvedEvent> filter, GetMemberOptions options)\n\t\t{\n\t\t\tIEnumerable<IEvent> declaredEvents = baseType.GetEvents(filter, options | declaredMembers);\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions) {\n\t\t\t\treturn declaredEvents;\n\t\t\t}\n\t\t\t\n\t\t\tParameterizedType pt = baseType as ParameterizedType;\n\t\t\tif (pt != null) {\n\t\t\t\tvar substitution = pt.GetSubstitution();\n\t\t\t\treturn declaredEvents.Select(m => new SpecializedEvent(m, substitution) { DeclaringType = pt });\n\t\t\t} else {\n\t\t\t\treturn declaredEvents;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetMembers\n\t\tpublic static IEnumerable<IMember> GetMembers(IType type, Predicate<IUnresolvedMember> filter, GetMemberOptions options)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers) {\n\t\t\t\treturn GetMembersImpl(type, filter, options);\n\t\t\t} else {\n\t\t\t\treturn type.GetNonInterfaceBaseTypes().SelectMany(t => GetMembersImpl(t, filter, options));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IMember> GetMembersImpl(IType baseType, Predicate<IUnresolvedMember> filter, GetMemberOptions options)\n\t\t{\n\t\t\tforeach (var m in GetMethodsImpl(baseType, null, filter, options))\n\t\t\t\tyield return m;\n\t\t\tforeach (var m in GetPropertiesImpl(baseType, filter, options))\n\t\t\t\tyield return m;\n\t\t\tforeach (var m in GetFieldsImpl(baseType, filter, options))\n\t\t\t\tyield return m;\n\t\t\tforeach (var m in GetEventsImpl(baseType, filter, options))\n\t\t\t\tyield return m;\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/KnownTypeCache.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Cache for KnownTypeReferences.\n\t/// </summary>\n\tsealed class KnownTypeCache\n\t{\n\t\treadonly ICompilation compilation;\n\t\treadonly IType[] knownTypes = new IType[KnownTypeReference.KnownTypeCodeCount];\n\t\t\n\t\tpublic KnownTypeCache(ICompilation compilation)\n\t\t{\n\t\t\tthis.compilation = compilation;\n\t\t}\n\t\t\n\t\tpublic IType FindType(KnownTypeCode typeCode)\n\t\t{\n\t\t\tIType type = LazyInit.VolatileRead(ref knownTypes[(int)typeCode]);\n\t\t\tif (type != null) {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t\treturn LazyInit.GetOrSet(ref knownTypes[(int)typeCode], SearchType(typeCode));\n\t\t}\n\t\t\n\t\tIType SearchType(KnownTypeCode typeCode)\n\t\t{\n\t\t\tKnownTypeReference typeRef = KnownTypeReference.Get(typeCode);\n\t\t\tif (typeRef == null)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\tvar typeName = new TopLevelTypeName(typeRef.Namespace, typeRef.Name, typeRef.TypeParameterCount);\n\t\t\tforeach (IAssembly asm in compilation.Assemblies) {\n\t\t\t\tvar typeDef = asm.GetTypeDefinition(typeName);\n\t\t\t\tif (typeDef != null)\n\t\t\t\t\treturn typeDef;\n\t\t\t}\n\t\t\treturn new UnknownType(typeName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// A merged namespace.\n\t/// </summary>\n\tpublic sealed class MergedNamespace : INamespace\n\t{\n\t\treadonly string externAlias;\n\t\treadonly ICompilation compilation;\n\t\treadonly INamespace parentNamespace;\n\t\treadonly INamespace[] namespaces;\n\t\tDictionary<string, INamespace> childNamespaces;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new merged root namespace.\n\t\t/// </summary>\n\t\t/// <param name=\"compilation\">The main compilation.</param>\n\t\t/// <param name=\"namespaces\">The individual namespaces being merged.</param>\n\t\t/// <param name=\"externAlias\">The extern alias for this namespace.</param>\n\t\tpublic MergedNamespace(ICompilation compilation, INamespace[] namespaces, string externAlias = null)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (namespaces == null)\n\t\t\t\tthrow new ArgumentNullException(\"namespaces\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.namespaces = namespaces;\n\t\t\tthis.externAlias = externAlias;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new merged child namespace.\n\t\t/// </summary>\n\t\t/// <param name=\"parentNamespace\">The parent merged namespace.</param>\n\t\t/// <param name=\"namespaces\">The individual namespaces being merged.</param>\n\t\tpublic MergedNamespace(INamespace parentNamespace, INamespace[] namespaces)\n\t\t{\n\t\t\tif (parentNamespace == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentNamespace\");\n\t\t\tif (namespaces == null)\n\t\t\t\tthrow new ArgumentNullException(\"namespaces\");\n\t\t\tthis.parentNamespace = parentNamespace;\n\t\t\tthis.namespaces = namespaces;\n\t\t\tthis.compilation = parentNamespace.Compilation;\n\t\t\tthis.externAlias = parentNamespace.ExternAlias;\n\t\t}\n\t\t\n\t\tpublic string ExternAlias {\n\t\t\tget { return externAlias; }\n\t\t}\n\t\t\n\t\tpublic string FullName {\n\t\t\tget { return namespaces[0].FullName; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return namespaces[0].Name; }\n\t\t}\n\t\t\n\t\tpublic INamespace ParentNamespace {\n\t\t\tget { return parentNamespace; }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<ITypeDefinition> Types {\n\t\t\tget {\n\t\t\t\treturn namespaces.SelectMany(ns => ns.Types);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Namespace; }\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return compilation; }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IAssembly> ContributingAssemblies {\n\t\t\tget { return namespaces.SelectMany(ns => ns.ContributingAssemblies); }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<INamespace> ChildNamespaces {\n\t\t\tget { return GetChildNamespaces().Values; }\n\t\t}\n\t\t\n\t\tpublic INamespace GetChildNamespace(string name)\n\t\t{\n\t\t\tINamespace ns;\n\t\t\tif (GetChildNamespaces().TryGetValue(name, out ns))\n\t\t\t\treturn ns;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tDictionary<string, INamespace> GetChildNamespaces()\n\t\t{\n\t\t\tvar result = LazyInit.VolatileRead(ref this.childNamespaces);\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tresult = new Dictionary<string, INamespace>(compilation.NameComparer);\n\t\t\t\tforeach (var g in namespaces.SelectMany(ns => ns.ChildNamespaces).GroupBy(ns => ns.Name, compilation.NameComparer)) {\n\t\t\t\t\tresult.Add(g.Key, new MergedNamespace(this, g.ToArray()));\n\t\t\t\t}\n\t\t\t\treturn LazyInit.GetOrSet(ref this.childNamespaces, result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition GetTypeDefinition(string name, int typeParameterCount)\n\t\t{\n\t\t\tITypeDefinition anyTypeDef = null;\n\t\t\tforeach (var ns in namespaces) {\n\t\t\t\tITypeDefinition typeDef = ns.GetTypeDefinition(name, typeParameterCount);\n\t\t\t\tif (typeDef != null) {\n\t\t\t\t\tif (typeDef.IsPublic) {\n\t\t\t\t\t\t// Prefer accessible types over non-accessible types.\n\t\t\t\t\t\treturn typeDef;\n\t\t\t\t\t\t// || (typeDef.IsInternal && typeDef.ParentAssembly.InternalsVisibleTo(...))\n\t\t\t\t\t\t// We can't call InternalsVisibleTo() here as we don't know the correct 'current' assembly,\n\t\t\t\t\t\t// and using the main assembly can cause a stack overflow if there\n\t\t\t\t\t\t// are internal assembly attributes.\n\t\t\t\t\t}\n\t\t\t\t\tanyTypeDef = typeDef;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn anyTypeDef;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[MergedNamespace {0}{1} (from {2} assemblies)]\",\n\t\t\t                     externAlias != null ? externAlias + \"::\" : null, this.FullName, this.namespaces.Length);\n\t\t}\n\n\t\tpublic ISymbolReference ToReference()\n\t\t{\n\t\t\treturn new MergedNamespaceReference(externAlias, FullName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/MinimalCorlib.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Resolve context represents the minimal mscorlib required for evaluating constants.\n\t/// This contains all known types (<see cref=\"KnownTypeCode\"/>) and no other types.\n\t/// </summary>\n\tpublic sealed class MinimalCorlib : DefaultUnresolvedAssembly\n\t{\n\t\tstatic readonly Lazy<MinimalCorlib> instance = new Lazy<MinimalCorlib>(() => new MinimalCorlib());\n\t\t\n\t\tpublic static MinimalCorlib Instance {\n\t\t\tget { return instance.Value; }\n\t\t}\n\t\t\n\t\tpublic ICompilation CreateCompilation()\n\t\t{\n\t\t\treturn new SimpleCompilation(new DefaultSolutionSnapshot(), this);\n\t\t}\n\t\t\n\t\tprivate MinimalCorlib() : base(\"corlib\")\n\t\t{\n\t\t\tvar types = new DefaultUnresolvedTypeDefinition[KnownTypeReference.KnownTypeCodeCount];\n\t\t\tfor (int i = 0; i < types.Length; i++) {\n\t\t\t\tvar typeRef = KnownTypeReference.Get((KnownTypeCode)i);\n\t\t\t\tif (typeRef != null) {\n\t\t\t\t\ttypes[i] = new DefaultUnresolvedTypeDefinition(typeRef.Namespace, typeRef.Name);\n\t\t\t\t\tfor (int j = 0; j < typeRef.TypeParameterCount; j++) {\n\t\t\t\t\t\ttypes[i].TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, j));\n\t\t\t\t\t}\n\t\t\t\t\tAddTypeDefinition(types[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int i = 0; i < types.Length; i++) {\n\t\t\t\tvar typeRef = KnownTypeReference.Get((KnownTypeCode)i);\n\t\t\t\tif (typeRef != null && typeRef.baseType != KnownTypeCode.None) {\n\t\t\t\t\ttypes[i].BaseTypes.Add(types[(int)typeRef.baseType]);\n\t\t\t\t\tif (typeRef.baseType == KnownTypeCode.ValueType && i != (int)KnownTypeCode.Enum) {\n\t\t\t\t\t\ttypes[i].Kind = TypeKind.Struct;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tFreeze();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/NestedTypeReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Type reference used to reference nested types.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class NestedTypeReference : ITypeReference, ISymbolReference, ISupportsInterning\n\t{\n\t\treadonly ITypeReference declaringTypeRef;\n\t\treadonly string name;\n\t\treadonly int additionalTypeParameterCount;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new NestedTypeReference.\n\t\t/// </summary>\n\t\t/// <param name=\"declaringTypeRef\">Reference to the declaring type.</param>\n\t\t/// <param name=\"name\">Name of the nested class</param>\n\t\t/// <param name=\"additionalTypeParameterCount\">Number of type parameters on the inner class (without type parameters on baseTypeRef)</param>\n\t\t/// <remarks>\n\t\t/// <paramref name=\"declaringTypeRef\"/> must be exactly the (unbound) declaring type, not a derived type, not a parameterized type.\n\t\t/// NestedTypeReference thus always resolves to a type definition, never to (partially) parameterized types.\n\t\t/// </remarks>\n\t\tpublic NestedTypeReference(ITypeReference declaringTypeRef, string name, int additionalTypeParameterCount)\n\t\t{\n\t\t\tif (declaringTypeRef == null)\n\t\t\t\tthrow new ArgumentNullException(\"declaringTypeRef\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.declaringTypeRef = declaringTypeRef;\n\t\t\tthis.name = name;\n\t\t\tthis.additionalTypeParameterCount = additionalTypeParameterCount;\n\t\t}\n\t\t\n\t\tpublic ITypeReference DeclaringTypeReference {\n\t\t\tget { return declaringTypeRef; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tpublic int AdditionalTypeParameterCount {\n\t\t\tget { return additionalTypeParameterCount; }\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tITypeDefinition declaringType = declaringTypeRef.Resolve(context) as ITypeDefinition;\n\t\t\tif (declaringType != null) {\n\t\t\t\tint tpc = declaringType.TypeParameterCount;\n\t\t\t\tforeach (IType type in declaringType.NestedTypes) {\n\t\t\t\t\tif (type.Name == name && type.TypeParameterCount == tpc + additionalTypeParameterCount)\n\t\t\t\t\t\treturn type;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new UnknownType(null, name, additionalTypeParameterCount);\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tvar type = Resolve(context);\n\t\t\tif (type is ITypeDefinition)\n\t\t\t\treturn (ISymbol)type;\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (additionalTypeParameterCount == 0)\n\t\t\t\treturn declaringTypeRef + \"+\" + name;\n\t\t\telse\n\t\t\t\treturn declaringTypeRef + \"+\" + name + \"`\" + additionalTypeParameterCount;\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn declaringTypeRef.GetHashCode() ^ name.GetHashCode() ^ additionalTypeParameterCount;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tNestedTypeReference o = other as NestedTypeReference;\n\t\t\treturn o != null && declaringTypeRef == o.declaringTypeRef && name == o.name && additionalTypeParameterCount == o.additionalTypeParameterCount;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/ResolvedAttributeBlob.cs",
    "content": "﻿//\n// ResolvedAttributeBlob.cs\n//\n// Author:\n//       Daniel Grunwald <daniel@danielgrunwald.de>\n//\n// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tsealed class CecilResolvedAttribute : IAttribute\n\t{\n\t\treadonly ITypeResolveContext context;\n\t\treadonly byte[] blob;\n\t\treadonly IList<ITypeReference> ctorParameterTypes;\n\t\treadonly IType attributeType;\n\t\t\n\t\tIMethod constructor;\n\t\tvolatile bool constructorResolved;\n\t\t\n\t\tIList<ResolveResult> positionalArguments;\n\t\tIList<KeyValuePair<IMember, ResolveResult>> namedArguments;\n\t\t\n\t\tpublic CecilResolvedAttribute(ITypeResolveContext context, UnresolvedAttributeBlob unresolved)\n\t\t{\n\t\t\tthis.context = context;\n\t\t\tthis.blob = unresolved.blob;\n\t\t\tthis.ctorParameterTypes = unresolved.ctorParameterTypes;\n\t\t\tthis.attributeType = unresolved.attributeType.Resolve(context);\n\t\t}\n\t\t\n\t\tpublic CecilResolvedAttribute(ITypeResolveContext context, IType attributeType)\n\t\t{\n\t\t\tthis.context = context;\n\t\t\tthis.attributeType = attributeType;\n\t\t\tthis.ctorParameterTypes = EmptyList<ITypeReference>.Instance;\n\t\t}\n\t\t\n\t\tDomRegion IAttribute.Region {\n\t\t\tget { return DomRegion.Empty; }\n\t\t}\n\t\t\n\t\tpublic IType AttributeType {\n\t\t\tget { return attributeType; }\n\t\t}\n\t\t\n\t\tpublic IMethod Constructor {\n\t\t\tget {\n\t\t\t\tif (!constructorResolved) {\n\t\t\t\t\tconstructor = ResolveConstructor();\n\t\t\t\t\tconstructorResolved = true;\n\t\t\t\t}\n\t\t\t\treturn constructor;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIMethod ResolveConstructor()\n\t\t{\n\t\t\tvar parameterTypes = ctorParameterTypes.Resolve(context);\n\t\t\tforeach (var ctor in attributeType.GetConstructors(m => m.Parameters.Count == parameterTypes.Count)) {\n\t\t\t\tbool ok = true;\n\t\t\t\tfor (int i = 0; i < parameterTypes.Count; i++) {\n\t\t\t\t\tif (!ctor.Parameters[i].Type.Equals(parameterTypes[i])) {\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok)\n\t\t\t\t\treturn ctor;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IList<ResolveResult> PositionalArguments {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.positionalArguments);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tDecodeBlob();\n\t\t\t\treturn positionalArguments;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<KeyValuePair<IMember, ResolveResult>> NamedArguments {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.namedArguments);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tDecodeBlob();\n\t\t\t\treturn namedArguments;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[\" + attributeType.ToString() + \"(...)]\";\n\t\t}\n\t\t\n\t\tvoid DecodeBlob()\n\t\t{\n\t\t\tvar positionalArguments = new List<ResolveResult>();\n\t\t\tvar namedArguments = new List<KeyValuePair<IMember, ResolveResult>>();\n\t\t\tDecodeBlob(positionalArguments, namedArguments);\n\t\t\tInterlocked.CompareExchange(ref this.positionalArguments, positionalArguments, null);\n\t\t\tInterlocked.CompareExchange(ref this.namedArguments, namedArguments, null);\n\t\t}\n\t\t\n\t\tvoid DecodeBlob(List<ResolveResult> positionalArguments, List<KeyValuePair<IMember, ResolveResult>> namedArguments)\n\t\t{\n\t\t\tif (blob == null)\n\t\t\t\treturn;\n\t\t\tBlobReader reader = new BlobReader(blob, context.CurrentAssembly);\n\t\t\tif (reader.ReadUInt16() != 0x0001) {\n\t\t\t\tDebug.WriteLine(\"Unknown blob prolog\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tforeach (var ctorParameter in ctorParameterTypes.Resolve(context)) {\n\t\t\t\tResolveResult arg;\n\t\t\t\tbool isError;\n\t\t\t\ttry {\n\t\t\t\t\targ = reader.ReadFixedArg (ctorParameter);\n\t\t\t\t\tpositionalArguments.Add(arg);\n\t\t\t\t\tisError = arg.IsError;\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tDebug.WriteLine(\"Crash during blob decoding: \" + ex);\n\t\t\t\t\tisError = true;\n\t\t\t\t}\n\t\t\t\tif (isError) {\n\t\t\t\t\t// After a decoding error, we must stop decoding the blob because\n\t\t\t\t\t// we might have read too few bytes due to the error.\n\t\t\t\t\t// Just fill up the remaining arguments with ErrorResolveResult:\n\t\t\t\t\twhile (positionalArguments.Count < ctorParameterTypes.Count)\n\t\t\t\t\t\tpositionalArguments.Add(ErrorResolveResult.UnknownError);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tushort numNamed = reader.ReadUInt16();\n\t\t\t\tfor (int i = 0; i < numNamed; i++) {\n\t\t\t\t\tvar namedArg = reader.ReadNamedArg(attributeType);\n\t\t\t\t\tif (namedArg.Key != null)\n\t\t\t\t\t\tnamedArguments.Add(namedArg);\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tDebug.WriteLine(\"Crash during blob decoding: \" + ex);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleCompilation.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Simple compilation implementation.\n\t/// </summary>\n\tpublic class SimpleCompilation : ICompilation\n\t{\n\t\treadonly ISolutionSnapshot solutionSnapshot;\n\t\treadonly ITypeResolveContext context;\n\t\treadonly CacheManager cacheManager = new CacheManager();\n\t\treadonly KnownTypeCache knownTypeCache;\n\t\treadonly IAssembly mainAssembly;\n\t\treadonly IList<IAssembly> assemblies;\n\t\treadonly IList<IAssembly> referencedAssemblies;\n\t\tINamespace rootNamespace;\n\t\t\n\t\tpublic SimpleCompilation(IUnresolvedAssembly mainAssembly, params IAssemblyReference[] assemblyReferences)\n\t\t\t: this(new DefaultSolutionSnapshot(), mainAssembly, (IEnumerable<IAssemblyReference>)assemblyReferences)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic SimpleCompilation(IUnresolvedAssembly mainAssembly, IEnumerable<IAssemblyReference> assemblyReferences)\n\t\t\t: this(new DefaultSolutionSnapshot(), mainAssembly, assemblyReferences)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic SimpleCompilation(ISolutionSnapshot solutionSnapshot, IUnresolvedAssembly mainAssembly, params IAssemblyReference[] assemblyReferences)\n\t\t\t: this(solutionSnapshot, mainAssembly, (IEnumerable<IAssemblyReference>)assemblyReferences)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic SimpleCompilation(ISolutionSnapshot solutionSnapshot, IUnresolvedAssembly mainAssembly, IEnumerable<IAssemblyReference> assemblyReferences)\n\t\t{\n\t\t\tif (solutionSnapshot == null)\n\t\t\t\tthrow new ArgumentNullException(\"solutionSnapshot\");\n\t\t\tif (mainAssembly == null)\n\t\t\t\tthrow new ArgumentNullException(\"mainAssembly\");\n\t\t\tif (assemblyReferences == null)\n\t\t\t\tthrow new ArgumentNullException(\"assemblyReferences\");\n\t\t\tthis.solutionSnapshot = solutionSnapshot;\n\t\t\tthis.context = new SimpleTypeResolveContext(this);\n\t\t\tthis.mainAssembly = mainAssembly.Resolve(context);\n\t\t\tList<IAssembly> assemblies = new List<IAssembly>();\n\t\t\tassemblies.Add(this.mainAssembly);\n\t\t\tList<IAssembly> referencedAssemblies = new List<IAssembly>();\n\t\t\tforeach (var asmRef in assemblyReferences) {\n\t\t\t\tIAssembly asm;\n\t\t\t\ttry {\n\t\t\t\t\tasm = asmRef.Resolve(context);\n\t\t\t\t} catch (InvalidOperationException) {\n\t\t\t\t\tthrow new InvalidOperationException(\"Tried to initialize compilation with an invalid assembly reference. (Forgot to load the assembly reference ? - see CecilLoader)\");\n\t\t\t\t}\n\t\t\t\tif (asm != null && !assemblies.Contains(asm))\n\t\t\t\t\tassemblies.Add(asm);\n\t\t\t\tif (asm != null && !referencedAssemblies.Contains(asm))\n\t\t\t\t\treferencedAssemblies.Add(asm);\n\t\t\t}\n\t\t\tthis.assemblies = assemblies.AsReadOnly();\n\t\t\tthis.referencedAssemblies = referencedAssemblies.AsReadOnly();\n\t\t\tthis.knownTypeCache = new KnownTypeCache(this);\n\t\t}\n\t\t\n\t\tpublic IAssembly MainAssembly {\n\t\t\tget {\n\t\t\t\tif (mainAssembly == null)\n\t\t\t\t\tthrow new InvalidOperationException(\"Compilation isn't initialized yet\");\n\t\t\t\treturn mainAssembly;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IAssembly> Assemblies {\n\t\t\tget {\n\t\t\t\tif (assemblies == null)\n\t\t\t\t\tthrow new InvalidOperationException(\"Compilation isn't initialized yet\");\n\t\t\t\treturn assemblies;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IAssembly> ReferencedAssemblies {\n\t\t\tget {\n\t\t\t\tif (referencedAssemblies == null)\n\t\t\t\t\tthrow new InvalidOperationException(\"Compilation isn't initialized yet\");\n\t\t\t\treturn referencedAssemblies;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ITypeResolveContext TypeResolveContext {\n\t\t\tget { return context; }\n\t\t}\n\t\t\n\t\tpublic INamespace RootNamespace {\n\t\t\tget {\n\t\t\t\tINamespace ns = LazyInit.VolatileRead(ref this.rootNamespace);\n\t\t\t\tif (ns != null) {\n\t\t\t\t\treturn ns;\n\t\t\t\t} else {\n\t\t\t\t\tif (referencedAssemblies == null)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Compilation isn't initialized yet\");\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.rootNamespace, CreateRootNamespace());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected virtual INamespace CreateRootNamespace()\n\t\t{\n\t\t\t// SimpleCompilation does not support extern aliases; but derived classes might.\n\t\t\t// CreateRootNamespace() is virtual so that derived classes can change the global namespace.\n\t\t\tINamespace[] namespaces = new INamespace[referencedAssemblies.Count + 1];\n\t\t\tnamespaces[0] = mainAssembly.RootNamespace;\n\t\t\tfor (int i = 0; i < referencedAssemblies.Count; i++) {\n\t\t\t\tnamespaces[i + 1] = referencedAssemblies[i].RootNamespace;\n\t\t\t}\n\t\t\treturn new MergedNamespace(this, namespaces);\n\t\t}\n\t\t\n\t\tpublic CacheManager CacheManager {\n\t\t\tget { return cacheManager; }\n\t\t}\n\t\t\n\t\tpublic virtual INamespace GetNamespaceForExternAlias(string alias)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(alias))\n\t\t\t\treturn this.RootNamespace;\n\t\t\t// SimpleCompilation does not support extern aliases; but derived classes might.\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IType FindType(KnownTypeCode typeCode)\n\t\t{\n\t\t\treturn knownTypeCache.FindType(typeCode);\n\t\t}\n\t\t\n\t\tpublic StringComparer NameComparer {\n\t\t\tget { return StringComparer.Ordinal; }\n\t\t}\n\t\t\n\t\tpublic ISolutionSnapshot SolutionSnapshot {\n\t\t\tget { return solutionSnapshot; }\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[SimpleCompilation \" + mainAssembly.AssemblyName + \"]\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleConstantValue.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// A simple constant value that is independent of the resolve context.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class SimpleConstantValue : IConstantValue, ISupportsInterning\n\t{\n\t\treadonly ITypeReference type;\n\t\treadonly object value;\n\t\t\n\t\tpublic SimpleConstantValue(ITypeReference type, object value)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tthis.type = type;\n\t\t\tthis.value = value;\n\t\t}\n\t\t\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ConstantResolveResult(type.Resolve(context), value);\n\t\t}\n\t\t\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \"CA1308:NormalizeStringsToUppercase\",\n\t\t                                                 Justification = \"The C# keyword is lower case\")]\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\treturn \"null\";\n\t\t\telse if (value is bool)\n\t\t\t\treturn value.ToString().ToLowerInvariant();\n\t\t\telse\n\t\t\t\treturn value.ToString();\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn type.GetHashCode() ^ (value != null ? value.GetHashCode() : 0);\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tSimpleConstantValue scv = other as SimpleConstantValue;\n\t\t\treturn scv != null && type == scv.type && value == scv.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleInterningProvider.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Simple interning provider.\n\t/// </summary>\n\tpublic sealed class SimpleInterningProvider : InterningProvider\n\t{\n\t\tsealed class InterningComparer : IEqualityComparer<ISupportsInterning>\n\t\t{\n\t\t\tpublic bool Equals(ISupportsInterning x, ISupportsInterning y)\n\t\t\t{\n\t\t\t\treturn x.EqualsForInterning(y);\n\t\t\t}\n\t\t\t\n\t\t\tpublic int GetHashCode(ISupportsInterning obj)\n\t\t\t{\n\t\t\t\treturn obj.GetHashCodeForInterning();\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class ListComparer : IEqualityComparer<IEnumerable>\n\t\t{\n\t\t\tpublic bool Equals(IEnumerable a, IEnumerable b)\n\t\t\t{\n\t\t\t\tif (a.GetType() != b.GetType())\n\t\t\t\t\treturn false;\n\t\t\t\tIEnumerator e1 = a.GetEnumerator();\n\t\t\t\tIEnumerator e2 = b.GetEnumerator();\n\t\t\t\twhile (e1.MoveNext()) {\n\t\t\t\t\t// e1 has more elements than e2; or elements are different\n\t\t\t\t\tif (!e2.MoveNext() || e1.Current != e2.Current)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (e2.MoveNext()) // e2 has more elements than e1\n\t\t\t\t\treturn false;\n\t\t\t\t// No need to dispose e1/e2: non-generic IEnumerator doesn't implement IDisposable,\n\t\t\t\t// and the underlying enumerator will likely be a List<T>.Enumerator which has an empty Dispose() method.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tpublic int GetHashCode(IEnumerable obj)\n\t\t\t{\n\t\t\t\tint hashCode = obj.GetType().GetHashCode();\n\t\t\t\tunchecked {\n\t\t\t\t\tforeach (object o in obj) {\n\t\t\t\t\t\thashCode *= 27;\n\t\t\t\t\t\thashCode += RuntimeHelpers.GetHashCode(o);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tDictionary<object, object> byValueDict = new Dictionary<object, object>();\n\t\tDictionary<ISupportsInterning, ISupportsInterning> supportsInternDict = new Dictionary<ISupportsInterning, ISupportsInterning>(new InterningComparer());\n\t\tDictionary<IEnumerable, IEnumerable> listDict = new Dictionary<IEnumerable, IEnumerable>(new ListComparer());\n\t\t\n\t\tpublic override ISupportsInterning Intern(ISupportsInterning obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t// ensure objects are frozen when we put them into the dictionary\n\t\t\t// note that Freeze may change the hash code of the object\n\t\t\tFreezableHelper.Freeze(obj);\n\n\t\t\tISupportsInterning output;\n\t\t\tif (supportsInternDict.TryGetValue(obj, out output)) {\n\t\t\t\treturn output;\n\t\t\t} else {\n\t\t\t\tsupportsInternDict.Add(obj, obj);\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string Intern(string text)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tobject output;\n\t\t\tif (byValueDict.TryGetValue(text, out output))\n\t\t\t\treturn (string)output;\n\t\t\telse\n\t\t\t\treturn text;\n\t\t}\n\t\t\n\t\tpublic override object InternValue(object obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tobject output;\n\t\t\tif (byValueDict.TryGetValue(obj, out output))\n\t\t\t\treturn output;\n\t\t\telse\n\t\t\t\treturn obj;\n\t\t}\n\t\t\n\t\tpublic override IList<T> InternList<T>(IList<T> list)\n\t\t{\n\t\t\tif (list == null)\n\t\t\t\treturn null;\n\t\t\tif (list.Count == 0)\n\t\t\t\treturn EmptyList<T>.Instance;\n\t\t\tif (!list.IsReadOnly)\n\t\t\t\tlist = new ReadOnlyCollection<T>(list);\n\t\t\tIEnumerable output;\n\t\t\tif (listDict.TryGetValue(list, out output))\n\t\t\t\tlist = (IList<T>)output;\n\t\t\telse\n\t\t\t\tlistDict.Add(list, list);\n\t\t\treturn list;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedEvent.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Represents a specialized IEvent (event after type substitution).\n\t/// </summary>\n\tpublic class SpecializedEvent : SpecializedMember, IEvent\n\t{\n\t\treadonly IEvent eventDefinition;\n\t\t\n\t\tpublic SpecializedEvent(IEvent eventDefinition, TypeParameterSubstitution substitution)\n\t\t\t: base(eventDefinition)\n\t\t{\n\t\t\tthis.eventDefinition = eventDefinition;\n\t\t\tAddSubstitution(substitution);\n\t\t}\n\t\t\n\t\tpublic bool CanAdd {\n\t\t\tget { return eventDefinition.CanAdd; }\n\t\t}\n\t\t\n\t\tpublic bool CanRemove {\n\t\t\tget { return eventDefinition.CanRemove; }\n\t\t}\n\t\t\n\t\tpublic bool CanInvoke {\n\t\t\tget { return eventDefinition.CanInvoke; }\n\t\t}\n\t\t\n\t\tIMethod addAccessor, removeAccessor, invokeAccessor;\n\t\t\n\t\tpublic IMethod AddAccessor {\n\t\t\tget { return WrapAccessor(ref this.addAccessor, eventDefinition.AddAccessor); }\n\t\t}\n\t\t\n\t\tpublic IMethod RemoveAccessor {\n\t\t\tget { return WrapAccessor(ref this.removeAccessor, eventDefinition.RemoveAccessor); }\n\t\t}\n\t\t\n\t\tpublic IMethod InvokeAccessor {\n\t\t\tget { return WrapAccessor(ref this.invokeAccessor, eventDefinition.InvokeAccessor); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedField.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Represents a specialized IField (field after type substitution).\n\t/// </summary>\n\tpublic class SpecializedField : SpecializedMember, IField\n\t{\n\t\treadonly IField fieldDefinition;\n\t\t\n\t\tpublic SpecializedField(IField fieldDefinition, TypeParameterSubstitution substitution)\n\t\t\t: base(fieldDefinition)\n\t\t{\n\t\t\tthis.fieldDefinition = fieldDefinition;\n\t\t\tAddSubstitution(substitution);\n\t\t}\n\t\t\n\t\tpublic bool IsReadOnly {\n\t\t\tget { return fieldDefinition.IsReadOnly; }\n\t\t}\n\t\t\n\t\tpublic bool IsVolatile {\n\t\t\tget { return fieldDefinition.IsVolatile; }\n\t\t}\n\t\t\n\t\tIType IVariable.Type {\n\t\t\tget { return this.ReturnType; }\n\t\t}\n\t\t\n\t\tpublic bool IsConst {\n\t\t\tget { return fieldDefinition.IsConst; }\n\t\t}\n\n\t\tpublic bool IsFixed {\n\t\t\tget { return fieldDefinition.IsFixed; }\n\t\t}\n\n\t\tpublic object ConstantValue {\n\t\t\tget { return fieldDefinition.ConstantValue; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedMember.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Represents a SpecializedMember (a member on which type substitution has been performed).\n\t/// </summary>\n\tpublic abstract class SpecializedMember : IMember\n\t{\n\t\tprotected readonly IMember baseMember;\n\t\tTypeParameterSubstitution substitution;\n\t\t\n\t\tIType declaringType;\n\t\tIType returnType;\n\t\t\n\t\tprotected SpecializedMember(IMember memberDefinition)\n\t\t{\n\t\t\tif (memberDefinition == null)\n\t\t\t\tthrow new ArgumentNullException(\"memberDefinition\");\n\t\t\tif (memberDefinition is SpecializedMember)\n\t\t\t\tthrow new ArgumentException(\"Member definition cannot be specialized. Please use IMember.Specialize() instead of directly constructing SpecializedMember instances.\");\n\t\t\t\n\t\t\tthis.baseMember = memberDefinition;\n\t\t\tthis.substitution = TypeParameterSubstitution.Identity;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Performs a substitution. This method may only be called by constructors in derived classes.\n\t\t/// </summary>\n\t\tprotected void AddSubstitution(TypeParameterSubstitution newSubstitution)\n\t\t{\n\t\t\tDebug.Assert(declaringType == null);\n\t\t\tDebug.Assert(returnType == null);\n\t\t\tthis.substitution = TypeParameterSubstitution.Compose(newSubstitution, this.substitution);\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use IMember.Specialize() instead\")]\n\t\tpublic static IMember Create(IMember memberDefinition, TypeParameterSubstitution substitution)\n\t\t{\n\t\t\tif (memberDefinition == null) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\treturn memberDefinition.Specialize(substitution);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual IMemberReference ToMemberReference()\n\t\t{\n\t\t\treturn ToReference();\n\t\t}\n\t\t\n\t\tpublic virtual IMemberReference ToReference()\n\t\t{\n\t\t\treturn new SpecializingMemberReference(\n\t\t\t\tbaseMember.ToReference(),\n\t\t\t\tToTypeReference(substitution.ClassTypeArguments),\n\t\t\t\tnull);\n\t\t}\n\t\t\n\t\tISymbolReference ISymbol.ToReference()\n\t\t{\n\t\t\treturn ToReference();\n\t\t}\n\t\t\n\t\tinternal static IList<ITypeReference> ToTypeReference(IList<IType> typeArguments)\n\t\t{\n\t\t\tif (typeArguments == null)\n\t\t\t\treturn null;\n\t\t\telse\n\t\t\t\treturn typeArguments.Select(t => t.ToTypeReference()).ToArray();\n\t\t}\n\t\t\n\t\tinternal IMethod WrapAccessor(ref IMethod cachingField, IMethod accessorDefinition)\n\t\t{\n\t\t\tif (accessorDefinition == null)\n\t\t\t\treturn null;\n\t\t\tvar result = LazyInit.VolatileRead(ref cachingField);\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tvar sm = accessorDefinition.Specialize(substitution);\n\t\t\t\t//sm.AccessorOwner = this;\n\t\t\t\treturn LazyInit.GetOrSet(ref cachingField, sm);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the substitution belonging to this specialized member.\n\t\t/// </summary>\n\t\tpublic TypeParameterSubstitution Substitution {\n\t\t\tget { return substitution; }\n\t\t}\n\t\t\n\t\tpublic IType DeclaringType {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.declaringType);\n\t\t\t\tif (result != null)\n\t\t\t\t\treturn result;\n\t\t\t\tIType definitionDeclaringType = baseMember.DeclaringType;\n\t\t\t\tITypeDefinition definitionDeclaringTypeDef = definitionDeclaringType as ITypeDefinition;\n\t\t\t\tif (definitionDeclaringTypeDef != null && definitionDeclaringType.TypeParameterCount > 0) {\n\t\t\t\t\tif (substitution.ClassTypeArguments != null && substitution.ClassTypeArguments.Count == definitionDeclaringType.TypeParameterCount) {\n\t\t\t\t\t\tresult = new ParameterizedType(definitionDeclaringTypeDef, substitution.ClassTypeArguments);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = new ParameterizedType(definitionDeclaringTypeDef, definitionDeclaringTypeDef.TypeParameters).AcceptVisitor(substitution);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult = definitionDeclaringType.AcceptVisitor(substitution);\n\t\t\t\t}\n\t\t\t\treturn LazyInit.GetOrSet(ref this.declaringType, result);\n\t\t\t}\n\t\t\tinternal set {\n\t\t\t\t// This setter is used as an optimization when the code constructing\n\t\t\t\t// the SpecializedMember already knows the declaring type.\n\t\t\t\tDebug.Assert(this.declaringType == null);\n\t\t\t\tDebug.Assert(value != null);\n\t\t\t\t// As this setter is used only during construction before the member is published\n\t\t\t\t// to other threads, we don't need a volatile write.\n\t\t\t\tthis.declaringType = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IMember MemberDefinition {\n\t\t\tget { return baseMember.MemberDefinition; }\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMember UnresolvedMember {\n\t\t\tget { return baseMember.UnresolvedMember; }\n\t\t}\n\t\t\n\t\tpublic IType ReturnType {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.returnType);\n\t\t\t\tif (result != null)\n\t\t\t\t\treturn result;\n\t\t\t\telse\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.returnType, baseMember.ReturnType.AcceptVisitor(substitution));\n\t\t\t}\n\t\t\tprotected set {\n\t\t\t\t// This setter is used for LiftedUserDefinedOperator, a special case of specialized member\n\t\t\t\t// (not a normal type parameter substitution).\n\t\t\t\t\n\t\t\t\t// As this setter is used only during construction before the member is published\n\t\t\t\t// to other threads, we don't need a volatile write.\n\t\t\t\tthis.returnType = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsVirtual {\n\t\t\tget { return baseMember.IsVirtual; }\n\t\t}\n\t\t\n\t\tpublic bool IsOverride {\n\t\t\tget { return baseMember.IsOverride; }\n\t\t}\n\t\t\n\t\tpublic bool IsOverridable {\n\t\t\tget { return baseMember.IsOverridable; }\n\t\t}\n\t\t\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget { return baseMember.SymbolKind; }\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use the SymbolKind property instead.\")]\n\t\tpublic EntityType EntityType {\n\t\t\tget { return baseMember.EntityType; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return baseMember.Region; }\n\t\t}\n\t\t\n\t\tpublic DomRegion BodyRegion {\n\t\t\tget { return baseMember.BodyRegion; }\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition DeclaringTypeDefinition {\n\t\t\tget { return baseMember.DeclaringTypeDefinition; }\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> Attributes {\n\t\t\tget { return baseMember.Attributes; }\n\t\t}\n\t\t\n\t\tIList<IMember> implementedInterfaceMembers;\n\t\t\n\t\tpublic IList<IMember> ImplementedInterfaceMembers {\n\t\t\tget {\n\t\t\t\treturn LazyInitializer.EnsureInitialized(ref implementedInterfaceMembers, FindImplementedInterfaceMembers);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<IMember> FindImplementedInterfaceMembers()\n\t\t{\n\t\t\tvar definitionImplementations = baseMember.ImplementedInterfaceMembers;\n\t\t\tIMember[] result = new IMember[definitionImplementations.Count];\n\t\t\tfor (int i = 0; i < result.Length; i++) {\n\t\t\t\tresult[i] = definitionImplementations[i].Specialize(substitution);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tpublic bool IsExplicitInterfaceImplementation {\n\t\t\tget { return baseMember.IsExplicitInterfaceImplementation; }\n\t\t}\n\t\t\n\t\tpublic DocumentationComment Documentation {\n\t\t\tget { return baseMember.Documentation; }\n\t\t}\n\t\t\n\t\tpublic Accessibility Accessibility {\n\t\t\tget { return baseMember.Accessibility; }\n\t\t}\n\t\t\n\t\tpublic bool IsStatic {\n\t\t\tget { return baseMember.IsStatic; }\n\t\t}\n\t\t\n\t\tpublic bool IsAbstract {\n\t\t\tget { return baseMember.IsAbstract; }\n\t\t}\n\t\t\n\t\tpublic bool IsSealed {\n\t\t\tget { return baseMember.IsSealed; }\n\t\t}\n\t\t\n\t\tpublic bool IsShadowing {\n\t\t\tget { return baseMember.IsShadowing; }\n\t\t}\n\t\t\n\t\tpublic bool IsSynthetic {\n\t\t\tget { return baseMember.IsSynthetic; }\n\t\t}\n\t\t\n\t\tpublic bool IsPrivate {\n\t\t\tget { return baseMember.IsPrivate; }\n\t\t}\n\t\t\n\t\tpublic bool IsPublic {\n\t\t\tget { return baseMember.IsPublic; }\n\t\t}\n\t\t\n\t\tpublic bool IsProtected {\n\t\t\tget { return baseMember.IsProtected; }\n\t\t}\n\t\t\n\t\tpublic bool IsInternal {\n\t\t\tget { return baseMember.IsInternal; }\n\t\t}\n\t\t\n\t\tpublic bool IsProtectedOrInternal {\n\t\t\tget { return baseMember.IsProtectedOrInternal; }\n\t\t}\n\t\t\n\t\tpublic bool IsProtectedAndInternal {\n\t\t\tget { return baseMember.IsProtectedAndInternal; }\n\t\t}\n\t\t\n\t\tpublic string FullName {\n\t\t\tget { return baseMember.FullName; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return baseMember.Name; }\n\t\t}\n\t\t\n\t\tpublic string Namespace {\n\t\t\tget { return baseMember.Namespace; }\n\t\t}\n\t\t\n\t\tpublic string ReflectionName {\n\t\t\tget { return baseMember.ReflectionName; }\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return baseMember.Compilation; }\n\t\t}\n\t\t\n\t\tpublic IAssembly ParentAssembly {\n\t\t\tget { return baseMember.ParentAssembly; }\n\t\t}\n\n\t\tpublic virtual IMember Specialize(TypeParameterSubstitution newSubstitution)\n\t\t{\n\t\t\treturn baseMember.Specialize(TypeParameterSubstitution.Compose(newSubstitution, this.substitution));\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tSpecializedMember other = obj as SpecializedMember;\n\t\t\tif (other == null)\n\t\t\t\treturn false;\n\t\t\treturn this.baseMember.Equals(other.baseMember) && this.substitution.Equals(other.substitution);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn 1000000007 * baseMember.GetHashCode() + 1000000009 * substitution.GetHashCode();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(\"[\");\n\t\t\tb.Append(GetType().Name);\n\t\t\tb.Append(' ');\n\t\t\tb.Append(this.DeclaringType.ToString());\n\t\t\tb.Append('.');\n\t\t\tb.Append(this.Name);\n\t\t\tb.Append(':');\n\t\t\tb.Append(this.ReturnType.ToString());\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t}\n\t\n\tpublic abstract class SpecializedParameterizedMember : SpecializedMember, IParameterizedMember\n\t{\n\t\tIList<IParameter> parameters;\n\t\t\n\t\tprotected SpecializedParameterizedMember(IParameterizedMember memberDefinition)\n\t\t\t: base(memberDefinition)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic IList<IParameter> Parameters {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.parameters);\n\t\t\t\tif (result != null)\n\t\t\t\t\treturn result;\n\t\t\t\telse\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.parameters, CreateParameters(this.Substitution));\n\t\t\t}\n\t\t\tprotected set {\n\t\t\t\t// This setter is used for LiftedUserDefinedOperator, a special case of specialized member\n\t\t\t\t// (not a normal type parameter substitution).\n\t\t\t\t\n\t\t\t\t// As this setter is used only during construction before the member is published\n\t\t\t\t// to other threads, we don't need a volatile write.\n\t\t\t\tthis.parameters = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected IList<IParameter> CreateParameters(TypeVisitor substitution)\n\t\t{\n\t\t\tvar paramDefs = ((IParameterizedMember)this.baseMember).Parameters;\n\t\t\tif (paramDefs.Count == 0) {\n\t\t\t\treturn EmptyList<IParameter>.Instance;\n\t\t\t} else {\n\t\t\t\tvar parameters = new IParameter[paramDefs.Count];\n\t\t\t\tfor (int i = 0; i < parameters.Length; i++) {\n\t\t\t\t\tvar p = paramDefs[i];\n\t\t\t\t\tIType newType = p.Type.AcceptVisitor(substitution);\n\t\t\t\t\tparameters[i] = new DefaultParameter(\n\t\t\t\t\t\tnewType, p.Name, this,\n\t\t\t\t\t\tp.Region, p.Attributes, p.IsRef, p.IsOut,\n\t\t\t\t\t\tp.IsParams, p.IsOptional, p.ConstantValue\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn Array.AsReadOnly(parameters);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(\"[\");\n\t\t\tb.Append(GetType().Name);\n\t\t\tb.Append(' ');\n\t\t\tb.Append(this.DeclaringType.ReflectionName);\n\t\t\tb.Append('.');\n\t\t\tb.Append(this.Name);\n\t\t\tb.Append('(');\n\t\t\tfor (int i = 0; i < this.Parameters.Count; i++) {\n\t\t\t\tif (i > 0) b.Append(\", \");\n\t\t\t\tb.Append(this.Parameters[i].ToString());\n\t\t\t}\n\t\t\tb.Append(\"):\");\n\t\t\tb.Append(this.ReturnType.ReflectionName);\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedMethod.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Represents a specialized IMethod (e.g. after type substitution).\n\t/// </summary>\n\tpublic class SpecializedMethod : SpecializedParameterizedMember, IMethod\n\t{\n\t\treadonly IMethod methodDefinition;\n\t\treadonly ITypeParameter[] specializedTypeParameters;\n\t\treadonly bool isParameterized;\n\t\treadonly TypeParameterSubstitution substitutionWithoutSpecializedTypeParameters;\n\t\t\n\t\tpublic SpecializedMethod(IMethod methodDefinition, TypeParameterSubstitution substitution)\n\t\t\t: base(methodDefinition)\n\t\t{\n\t\t\tif (substitution == null)\n\t\t\t\tthrow new ArgumentNullException(\"substitution\");\n\t\t\tthis.methodDefinition = methodDefinition;\n\t\t\tthis.isParameterized = substitution.MethodTypeArguments != null;\n\t\t\tif (methodDefinition.TypeParameters.Count > 0) {\n\t\t\t\t// The method is generic, so we need to specialize the type parameters\n\t\t\t\t// (for specializing the constraints, and also to set the correct Owner)\n\t\t\t\tspecializedTypeParameters = new ITypeParameter[methodDefinition.TypeParameters.Count];\n\t\t\t\tfor (int i = 0; i < specializedTypeParameters.Length; i++) {\n\t\t\t\t\tspecializedTypeParameters[i] = new SpecializedTypeParameter(methodDefinition.TypeParameters[i], this);\n\t\t\t\t}\n\t\t\t\tif (!isParameterized) {\n\t\t\t\t\t// Add substitution that replaces the base method's type parameters with our specialized version\n\t\t\t\t\t// but do this only if the type parameters on the baseMember have not already been substituted\n\t\t\t\t\tsubstitutionWithoutSpecializedTypeParameters = this.Substitution;\n\t\t\t\t\tAddSubstitution(new TypeParameterSubstitution(null, specializedTypeParameters));\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Add the main substitution after the method type parameter specialization.\n\t\t\tAddSubstitution(substitution);\n\t\t\tif (substitutionWithoutSpecializedTypeParameters != null) {\n\t\t\t\t// If we already have a substitution without specialized type parameters, update that:\n\t\t\t\tsubstitutionWithoutSpecializedTypeParameters = TypeParameterSubstitution.Compose(substitution, substitutionWithoutSpecializedTypeParameters);\n\t\t\t} else {\n\t\t\t\t// Otherwise just use the whole substitution, as that doesn't contain specialized type parameters\n\t\t\t\t// in this case.\n\t\t\t\tsubstitutionWithoutSpecializedTypeParameters = this.Substitution;\n\t\t\t}\n\t\t\tif (specializedTypeParameters != null) {\n\t\t\t\t// Set the substitution on the type parameters to the final composed substitution\n\t\t\t\tforeach (var tp in specializedTypeParameters.OfType<SpecializedTypeParameter>()) {\n\t\t\t\t\tif (tp.Owner == this)\n\t\t\t\t\t\ttp.substitution = base.Substitution;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IType> TypeArguments {\n\t\t\tget { return this.Substitution.MethodTypeArguments ?? EmptyList<IType>.Instance; }\n\t\t}\n\t\t\n\t\tpublic bool IsParameterized {\n\t\t\tget { return isParameterized; }\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedMethod> Parts {\n\t\t\tget { return methodDefinition.Parts; }\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> ReturnTypeAttributes {\n\t\t\tget { return methodDefinition.ReturnTypeAttributes; }\n\t\t}\n\t\t\n\t\tpublic IList<ITypeParameter> TypeParameters {\n\t\t\tget {\n\t\t\t\treturn specializedTypeParameters ?? methodDefinition.TypeParameters;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsExtensionMethod {\n\t\t\tget { return methodDefinition.IsExtensionMethod; }\n\t\t}\n\t\t\n\t\tpublic bool IsConstructor {\n\t\t\tget { return methodDefinition.IsConstructor; }\n\t\t}\n\t\t\n\t\tpublic bool IsDestructor {\n\t\t\tget { return methodDefinition.IsDestructor; }\n\t\t}\n\t\t\n\t\tpublic bool IsOperator {\n\t\t\tget { return methodDefinition.IsOperator; }\n\t\t}\n\t\t\n\t\tpublic bool IsPartial {\n\t\t\tget { return methodDefinition.IsPartial; }\n\t\t}\n\t\t\n\t\tpublic bool IsAsync {\n\t\t\tget { return methodDefinition.IsAsync; }\n\t\t}\n\t\t\n\t\tpublic bool HasBody {\n\t\t\tget { return methodDefinition.HasBody; }\n\t\t}\n\t\t\n\t\tpublic bool IsAccessor {\n\t\t\tget { return methodDefinition.IsAccessor; }\n\t\t}\n\n\t\tpublic IMethod ReducedFrom {\n\t\t\tget { return null; }\n\t\t}\n\n\t\tIMember accessorOwner;\n\t\t\n\t\tpublic IMember AccessorOwner {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref accessorOwner);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tvar ownerDefinition = methodDefinition.AccessorOwner;\n\t\t\t\t\tif (ownerDefinition == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tresult = ownerDefinition.Specialize(this.Substitution);\n\t\t\t\t\treturn LazyInit.GetOrSet(ref accessorOwner, result);\n\t\t\t\t}\n\t\t\t}\n\t\t\tinternal set {\n\t\t\t\taccessorOwner = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override IMemberReference ToReference()\n\t\t{\n\t\t\t// Pass the MethodTypeArguments to the SpecializingMemberReference only if\n\t\t\t// the generic method itself is parameterized, not if the generic method is only\n\t\t\t// specialized with class type arguments.\n\t\t\t\n\t\t\t// This is necessary due to this part of the ToMemberReference() contract:\n\t\t\t//   If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context.\n\t\t\t//   Otherwise, the main resolve context of a compilation is sufficient.\n\t\t\t// ->\n\t\t\t// This means that if the method itself isn't specialized,\n\t\t\t// we must not include TypeParameterReferences for the specialized type parameters\n\t\t\t// in the resulting member reference.\n\t\t\tif (isParameterized) {\n\t\t\t\treturn new SpecializingMemberReference(\n\t\t\t\t\tbaseMember.ToReference(),\n\t\t\t\t\tToTypeReference(base.Substitution.ClassTypeArguments),\n\t\t\t\t\tToTypeReference(base.Substitution.MethodTypeArguments));\n\t\t\t} else {\n\t\t\t\treturn base.ToReference();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override IMemberReference ToMemberReference()\n\t\t{\n\t\t\treturn ToReference();\n\t\t}\n\t\t\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tSpecializedMethod other = obj as SpecializedMethod;\n\t\t\tif (other == null)\n\t\t\t\treturn false;\n\t\t\treturn this.baseMember.Equals(other.baseMember) && this.substitutionWithoutSpecializedTypeParameters.Equals(other.substitutionWithoutSpecializedTypeParameters);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn 1000000013 * baseMember.GetHashCode() + 1000000009 * substitutionWithoutSpecializedTypeParameters.GetHashCode();\n\t\t\t}\n\t\t}\n\n\t\tpublic override IMember Specialize(TypeParameterSubstitution newSubstitution)\n\t\t{\n\t\t\treturn methodDefinition.Specialize(TypeParameterSubstitution.Compose(newSubstitution, substitutionWithoutSpecializedTypeParameters));\n\t\t}\n\t\t\n\t\tIMethod IMethod.Specialize(TypeParameterSubstitution newSubstitution)\n\t\t{\n\t\t\treturn methodDefinition.Specialize(TypeParameterSubstitution.Compose(newSubstitution, substitutionWithoutSpecializedTypeParameters));\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(\"[\");\n\t\t\tb.Append(GetType().Name);\n\t\t\tb.Append(' ');\n\t\t\tb.Append(this.DeclaringType.ReflectionName);\n\t\t\tb.Append('.');\n\t\t\tb.Append(this.Name);\n\t\t\tif (this.TypeArguments.Count > 0) {\n\t\t\t\tb.Append('[');\n\t\t\t\tfor (int i = 0; i < this.TypeArguments.Count; i++) {\n\t\t\t\t\tif (i > 0) b.Append(\", \");\n\t\t\t\t\tb.Append(this.TypeArguments[i].ReflectionName);\n\t\t\t\t}\n\t\t\t\tb.Append(']');\n\t\t\t} else if (this.TypeParameters.Count > 0) {\n\t\t\t\tb.Append(\"``\");\n\t\t\t\tb.Append(this.TypeParameters.Count);\n\t\t\t}\n\t\t\tb.Append('(');\n\t\t\tfor (int i = 0; i < this.Parameters.Count; i++) {\n\t\t\t\tif (i > 0) b.Append(\", \");\n\t\t\t\tb.Append(this.Parameters[i].ToString());\n\t\t\t}\n\t\t\tb.Append(\"):\");\n\t\t\tb.Append(this.ReturnType.ReflectionName);\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tsealed class SpecializedTypeParameter : AbstractTypeParameter\n\t\t{\n\t\t\treadonly ITypeParameter baseTp;\n\t\t\t\n\t\t\t// The substition is set at the end of SpecializedMethod constructor\n\t\t\tinternal TypeVisitor substitution;\n\t\t\t\n\t\t\tpublic SpecializedTypeParameter(ITypeParameter baseTp, IMethod specializedOwner)\n\t\t\t\t: base(specializedOwner, baseTp.Index, baseTp.Name, baseTp.Variance, baseTp.Attributes, baseTp.Region)\n\t\t\t{\n\t\t\t\t// We don't have to consider already-specialized baseTps because\n\t\t\t\t// we read the baseTp directly from the unpacked memberDefinition.\n\t\t\t\tthis.baseTp = baseTp;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn baseTp.GetHashCode() ^ this.Owner.GetHashCode();\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(IType other)\n\t\t\t{\n\t\t\t\t// Compare the owner, not the substitution, because the substitution may contain this specialized type parameter recursively\n\t\t\t\tSpecializedTypeParameter o = other as SpecializedTypeParameter;\n\t\t\t\treturn o != null && baseTp.Equals(o.baseTp) && this.Owner.Equals(o.Owner);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasValueTypeConstraint {\n\t\t\t\tget { return baseTp.HasValueTypeConstraint; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasReferenceTypeConstraint {\n\t\t\t\tget { return baseTp.HasReferenceTypeConstraint; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasDefaultConstructorConstraint {\n\t\t\t\tget { return baseTp.HasDefaultConstructorConstraint; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IEnumerable<IType> DirectBaseTypes {\n\t\t\t\tget {\n\t\t\t\t\treturn baseTp.DirectBaseTypes.Select(t => t.AcceptVisitor(substitution));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedProperty.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Represents a specialized IProperty (property after type substitution).\n\t/// </summary>\n\tpublic class SpecializedProperty : SpecializedParameterizedMember, IProperty\n\t{\n\t\treadonly IProperty propertyDefinition;\n\t\t\n\t\tpublic SpecializedProperty(IProperty propertyDefinition, TypeParameterSubstitution substitution)\n\t\t\t: base(propertyDefinition)\n\t\t{\n\t\t\tthis.propertyDefinition = propertyDefinition;\n\t\t\tAddSubstitution(substitution);\n\t\t}\n\t\t\n\t\tpublic bool CanGet {\n\t\t\tget { return propertyDefinition.CanGet; }\n\t\t}\n\t\t\n\t\tpublic bool CanSet {\n\t\t\tget { return propertyDefinition.CanSet; }\n\t\t}\n\t\t\n\t\tIMethod getter, setter;\n\t\t\n\t\tpublic IMethod Getter {\n\t\t\tget { return WrapAccessor(ref this.getter, propertyDefinition.Getter); }\n\t\t}\n\t\t\n\t\tpublic IMethod Setter {\n\t\t\tget { return WrapAccessor(ref this.setter, propertyDefinition.Setter); }\n\t\t}\n\t\t\n\t\tpublic bool IsIndexer {\n\t\t\tget { return propertyDefinition.IsIndexer; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializingMemberReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t[Serializable]\n\tpublic sealed class SpecializingMemberReference : IMemberReference\n\t{\n\t\tIMemberReference memberDefinitionReference;\n\t\tIList<ITypeReference> classTypeArgumentReferences;\n\t\tIList<ITypeReference> methodTypeArgumentReferences;\n\t\t\n\t\tpublic SpecializingMemberReference(IMemberReference memberDefinitionReference, IList<ITypeReference> classTypeArgumentReferences = null, IList<ITypeReference> methodTypeArgumentReferences = null)\n\t\t{\n\t\t\tif (memberDefinitionReference == null)\n\t\t\t\tthrow new ArgumentNullException(\"memberDefinitionReference\");\n\t\t\tthis.memberDefinitionReference = memberDefinitionReference;\n\t\t\tthis.classTypeArgumentReferences = classTypeArgumentReferences;\n\t\t\tthis.methodTypeArgumentReferences = methodTypeArgumentReferences;\n\t\t}\n\t\t\n\t\tpublic IMember Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tvar memberDefinition = memberDefinitionReference.Resolve(context);\n\t\t\tif (memberDefinition == null)\n\t\t\t\treturn null;\n\t\t\treturn memberDefinition.Specialize(\n\t\t\t\tnew TypeParameterSubstitution(\n\t\t\t\t\tclassTypeArgumentReferences != null ? classTypeArgumentReferences.Resolve(context) : null,\n\t\t\t\t\tmethodTypeArgumentReferences != null ? methodTypeArgumentReferences.Resolve(context) : null\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn Resolve(context);\n\t\t}\n\t\t\n\t\tpublic ITypeReference DeclaringTypeReference {\n\t\t\tget {\n\t\t\t\tif (classTypeArgumentReferences != null)\n\t\t\t\t\treturn new ParameterizedTypeReference(memberDefinitionReference.DeclaringTypeReference, classTypeArgumentReferences);\n\t\t\t\telse\n\t\t\t\t\treturn memberDefinitionReference.DeclaringTypeReference;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/TypeParameterReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t[Serializable]\n\tpublic sealed class TypeParameterReference : ITypeReference, ISymbolReference\n\t{\n\t\tstatic readonly TypeParameterReference[] classTypeParameterReferences = new TypeParameterReference[8];\n\t\tstatic readonly TypeParameterReference[] methodTypeParameterReferences = new TypeParameterReference[8];\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a type parameter reference.\n\t\t/// For common type parameter references, this method may return a shared instance.\n\t\t/// </summary>\n\t\tpublic static TypeParameterReference Create(SymbolKind ownerType, int index)\n\t\t{\n\t\t\tif (index >= 0 && index < 8 && (ownerType == SymbolKind.TypeDefinition || ownerType == SymbolKind.Method)) {\n\t\t\t\tTypeParameterReference[] arr = (ownerType == SymbolKind.TypeDefinition) ? classTypeParameterReferences : methodTypeParameterReferences;\n\t\t\t\tTypeParameterReference result = LazyInit.VolatileRead(ref arr[index]);\n\t\t\t\tif (result == null) {\n\t\t\t\t\tresult = LazyInit.GetOrSet(ref arr[index], new TypeParameterReference(ownerType, index));\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn new TypeParameterReference(ownerType, index);\n\t\t\t}\n\t\t}\n\t\t\n\t\treadonly SymbolKind ownerType;\n\t\treadonly int index;\n\n\t\tpublic int Index {\n\t\t\tget {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterReference(SymbolKind ownerType, int index)\n\t\t{\n\t\t\tthis.ownerType = ownerType;\n\t\t\tthis.index = index;\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (ownerType == SymbolKind.Method) {\n\t\t\t\tIMethod method = context.CurrentMember as IMethod;\n\t\t\t\tif (method != null && index < method.TypeParameters.Count) {\n\t\t\t\t\treturn method.TypeParameters[index];\n\t\t\t\t}\n\t\t\t\treturn DummyTypeParameter.GetMethodTypeParameter(index);\n\t\t\t} else if (ownerType == SymbolKind.TypeDefinition) {\n\t\t\t\tITypeDefinition typeDef = context.CurrentTypeDefinition;\n\t\t\t\tif (typeDef != null && index < typeDef.TypeParameters.Count) {\n\t\t\t\t\treturn typeDef.TypeParameters[index];\n\t\t\t\t}\n\t\t\t\treturn DummyTypeParameter.GetClassTypeParameter(index);\n\t\t\t} else {\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t}\n\t\t}\n\t\t\n\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn Resolve(context) as ISymbol;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (ownerType == SymbolKind.Method)\n\t\t\t\treturn \"!!\" + index.ToString(CultureInfo.InvariantCulture);\n\t\t\telse\n\t\t\t\treturn \"!\" + index.ToString(CultureInfo.InvariantCulture);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/TypeWithElementType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tpublic abstract class TypeWithElementType : AbstractType\n\t{\n\t\t[CLSCompliant(false)]\n\t\tprotected IType elementType;\n\t\t\n\t\tprotected TypeWithElementType(IType elementType)\n\t\t{\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\tthis.elementType = elementType;\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget { return elementType.Name + NameSuffix; }\n\t\t}\n\t\t\n\t\tpublic override string Namespace {\n\t\t\tget { return elementType.Namespace; }\n\t\t}\n\t\t\n\t\tpublic override string FullName {\n\t\t\tget { return elementType.FullName + NameSuffix; }\n\t\t}\n\t\t\n\t\tpublic override string ReflectionName {\n\t\t\tget { return elementType.ReflectionName + NameSuffix; }\n\t\t}\n\t\t\n\t\tpublic abstract string NameSuffix { get; }\n\t\t\n\t\tpublic IType ElementType {\n\t\t\tget { return elementType; }\n\t\t}\n\t\t\n\t\t// Force concrete implementations to override VisitChildren - the base implementation\n\t\t// in AbstractType assumes there are no children, but we know there is (at least) 1.\n\t\tpublic abstract override IType VisitChildren(TypeVisitor visitor);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/UnknownType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// An unknown type where (part) of the name is known.\n\t/// </summary>\n\t[Serializable]\n\tpublic class UnknownType : AbstractType, ITypeReference\n\t{\n\t\treadonly bool namespaceKnown;\n\t\treadonly FullTypeName fullTypeName;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new unknown type.\n\t\t/// </summary>\n\t\t/// <param name=\"namespaceName\">Namespace name, if known. Can be null if unknown.</param>\n\t\t/// <param name=\"name\">Name of the type, must not be null.</param>\n\t\t/// <param name=\"typeParameterCount\">Type parameter count, zero if unknown.</param>\n\t\tpublic UnknownType(string namespaceName, string name, int typeParameterCount = 0)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.namespaceKnown = namespaceName != null;\n\t\t\tthis.fullTypeName = new TopLevelTypeName(namespaceName ?? string.Empty, name, typeParameterCount);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new unknown type.\n\t\t/// </summary>\n\t\t/// <param name=\"fullTypeName\">Full name of the unknown type.</param>\n\t\tpublic UnknownType(FullTypeName fullTypeName)\n\t\t{\n\t\t\tif (fullTypeName.Name == null) {\n\t\t\t\tDebug.Assert(fullTypeName == default(FullTypeName));\n\t\t\t\tthis.namespaceKnown = false;\n\t\t\t\tthis.fullTypeName = new TopLevelTypeName(string.Empty, \"?\", 0);\n\t\t\t} else {\n\t\t\t\tthis.namespaceKnown = true;\n\t\t\t\tthis.fullTypeName = fullTypeName;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.Unknown; }\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tIType ITypeReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget { return fullTypeName.Name; }\n\t\t}\n\t\t\n\t\tpublic override string Namespace {\n\t\t\tget { return fullTypeName.TopLevelTypeName.Namespace; }\n\t\t}\n\t\t\n\t\tpublic override string ReflectionName {\n\t\t\tget { return namespaceKnown ? fullTypeName.ReflectionName : \"?\"; }\n\t\t}\n\t\t\n\t\tpublic override int TypeParameterCount {\n\t\t\tget { return fullTypeName.TypeParameterCount; }\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (namespaceKnown ? 812571 : 12651) ^ fullTypeName.GetHashCode();\n\t\t}\n\t\t\n\t\tpublic override bool Equals(IType other)\n\t\t{\n\t\t\tUnknownType o = other as UnknownType;\n\t\t\tif (o == null)\n\t\t\t\treturn false;\n\t\t\treturn this.namespaceKnown == o.namespaceKnown && this.fullTypeName == o.fullTypeName;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[UnknownType \" + fullTypeName.ReflectionName + \"]\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/UnresolvedAttributeBlob.cs",
    "content": "﻿//\n// UnresolvedAttributeBlob.cs\n//\n// Author:\n//       Daniel Grunwald <daniel@danielgrunwald.de>\n//\n// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// <c>IUnresolvedAttribute</c> implementation that loads the arguments from a binary blob.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class UnresolvedAttributeBlob : IUnresolvedAttribute, ISupportsInterning\n\t{\n\t\tinternal readonly ITypeReference attributeType;\n\t\tinternal readonly IList<ITypeReference> ctorParameterTypes;\n\t\tinternal readonly byte[] blob;\n\t\t\n\t\tpublic UnresolvedAttributeBlob(ITypeReference attributeType, IList<ITypeReference> ctorParameterTypes, byte[] blob)\n\t\t{\n\t\t\tif (attributeType == null)\n\t\t\t\tthrow new ArgumentNullException(\"attributeType\");\n\t\t\tif (ctorParameterTypes == null)\n\t\t\t\tthrow new ArgumentNullException(\"ctorParameterTypes\");\n\t\t\tif (blob == null)\n\t\t\t\tthrow new ArgumentNullException(\"blob\");\n\t\t\tthis.attributeType = attributeType;\n\t\t\tthis.ctorParameterTypes = ctorParameterTypes;\n\t\t\tthis.blob = blob;\n\t\t}\n\t\t\n\t\tDomRegion IUnresolvedAttribute.Region {\n\t\t\tget { return DomRegion.Empty; }\n\t\t}\n\t\t\n\t\tpublic IAttribute CreateResolvedAttribute(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context.CurrentAssembly == null)\n\t\t\t\tthrow new InvalidOperationException(\"Cannot resolve CecilUnresolvedAttribute without a parent assembly\");\n\t\t\treturn new CecilResolvedAttribute(context, this);\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn attributeType.GetHashCode() ^ ctorParameterTypes.GetHashCode() ^ BlobReader.GetBlobHashCode(blob);\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tUnresolvedAttributeBlob o = other as UnresolvedAttributeBlob;\n\t\t\treturn o != null && attributeType == o.attributeType && ctorParameterTypes == o.ctorParameterTypes\n\t\t\t\t&& BlobReader.BlobEquals(blob, o.blob);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/UnresolvedSecurityDeclarationBlob.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t[Serializable]\n\tpublic sealed class UnresolvedSecurityDeclarationBlob\n\t{\n\t\tstatic readonly ITypeReference securityActionTypeReference = typeof(System.Security.Permissions.SecurityAction).ToTypeReference();\n\t\tstatic readonly ITypeReference permissionSetAttributeTypeReference = typeof(System.Security.Permissions.PermissionSetAttribute).ToTypeReference();\n\t\t\n\t\treadonly IConstantValue securityAction;\n\t\treadonly byte[] blob;\n\t\treadonly IList<IUnresolvedAttribute> unresolvedAttributes = new List<IUnresolvedAttribute>();\n\t\t\n\t\tpublic UnresolvedSecurityDeclarationBlob(int securityAction, byte[] blob)\n\t\t{\n\t\t\tBlobReader reader = new BlobReader(blob, null);\n\t\t\tthis.securityAction = new SimpleConstantValue(securityActionTypeReference, securityAction);\n\t\t\tthis.blob = blob;\n\t\t\tif (reader.ReadByte() == '.') {\n\t\t\t\t// binary attribute\n\t\t\t\tuint attributeCount = reader.ReadCompressedUInt32();\n\t\t\t\tfor (uint i = 0; i < attributeCount; i++) {\n\t\t\t\t\tunresolvedAttributes.Add(new UnresolvedSecurityAttribute(this, (int)i));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// for backward compatibility with .NET 1.0: XML-encoded attribute\n\t\t\t\tvar attr = new DefaultUnresolvedAttribute(permissionSetAttributeTypeReference);\n\t\t\t\tattr.ConstructorParameterTypes.Add(securityActionTypeReference);\n\t\t\t\tattr.PositionalArguments.Add(this.securityAction);\n\t\t\t\tstring xml = System.Text.Encoding.Unicode.GetString(blob);\n\t\t\t\tattr.AddNamedPropertyArgument(\"XML\", new SimpleConstantValue(KnownTypeReference.String, xml));\n\t\t\t\tunresolvedAttributes.Add(attr);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> UnresolvedAttributes {\n\t\t\tget { return unresolvedAttributes; }\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> Resolve(IAssembly currentAssembly)\n\t\t{\n\t\t\t// TODO: make this a per-assembly cache\n//\t\t\t\tCacheManager cache = currentAssembly.Compilation.CacheManager;\n//\t\t\t\tIList<IAttribute> result = (IList<IAttribute>)cache.GetShared(this);\n//\t\t\t\tif (result != null)\n//\t\t\t\t\treturn result;\n\t\t\t\n\t\t\tITypeResolveContext context = new SimpleTypeResolveContext(currentAssembly);\n\t\t\tBlobReader reader = new BlobReader(blob, currentAssembly);\n\t\t\tif (reader.ReadByte() != '.') {\n\t\t\t\t// should not use UnresolvedSecurityDeclaration for XML secdecls\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\tResolveResult securityActionRR = securityAction.Resolve(context);\n\t\t\tuint attributeCount = reader.ReadCompressedUInt32();\n\t\t\tIAttribute[] attributes = new IAttribute[attributeCount];\n\t\t\ttry {\n\t\t\t\tReadSecurityBlob(reader, attributes, context, securityActionRR);\n\t\t\t} catch (NotSupportedException ex) {\n\t\t\t\t// ignore invalid blobs\n\t\t\t\tDebug.WriteLine(ex.ToString());\n\t\t\t}\n\t\t\tfor (int i = 0; i < attributes.Length; i++) {\n\t\t\t\tif (attributes[i] == null)\n\t\t\t\t\tattributes[i] = new CecilResolvedAttribute(context, SpecialType.UnknownType);\n\t\t\t}\n\t\t\treturn attributes;\n//\t\t\t\treturn (IList<IAttribute>)cache.GetOrAddShared(this, attributes);\n\t\t}\n\t\t\n\t\tvoid ReadSecurityBlob(BlobReader reader, IAttribute[] attributes, ITypeResolveContext context, ResolveResult securityActionRR)\n\t\t{\n\t\t\tfor (int i = 0; i < attributes.Length; i++) {\n\t\t\t\tstring attributeTypeName = reader.ReadSerString();\n\t\t\t\tITypeReference attributeTypeRef = ReflectionHelper.ParseReflectionName(attributeTypeName);\n\t\t\t\tIType attributeType = attributeTypeRef.Resolve(context);\n\t\t\t\t\n\t\t\t\treader.ReadCompressedUInt32(); // ??\n\t\t\t\t// The specification seems to be incorrect here, so I'm using the logic from Cecil instead.\n\t\t\t\tuint numNamed = reader.ReadCompressedUInt32();\n\t\t\t\t\n\t\t\t\tvar namedArgs = new List<KeyValuePair<IMember, ResolveResult>>((int)numNamed);\n\t\t\t\tfor (uint j = 0; j < numNamed; j++) {\n\t\t\t\t\tvar namedArg = reader.ReadNamedArg(attributeType);\n\t\t\t\t\tif (namedArg.Key != null)\n\t\t\t\t\t\tnamedArgs.Add(namedArg);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tattributes[i] = new DefaultAttribute(\n\t\t\t\t\tattributeType,\n\t\t\t\t\tpositionalArguments: new ResolveResult[] { securityActionRR },\n\t\t\t\t\tnamedArguments: namedArgs);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tsealed class UnresolvedSecurityAttribute : IUnresolvedAttribute, ISupportsInterning\n\t{\n\t\treadonly UnresolvedSecurityDeclarationBlob secDecl;\n\t\treadonly int index;\n\t\t\n\t\tpublic UnresolvedSecurityAttribute(UnresolvedSecurityDeclarationBlob secDecl, int index)\n\t\t{\n\t\t\tDebug.Assert(secDecl != null);\n\t\t\tthis.secDecl = secDecl;\n\t\t\tthis.index = index;\n\t\t}\n\t\t\n\t\tDomRegion IUnresolvedAttribute.Region {\n\t\t\tget { return DomRegion.Empty; }\n\t\t}\n\t\t\n\t\tIAttribute IUnresolvedAttribute.CreateResolvedAttribute(ITypeResolveContext context)\n\t\t{\n\t\t\treturn secDecl.Resolve(context.CurrentAssembly)[index];\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn index ^ secDecl.GetHashCode();\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tUnresolvedSecurityAttribute attr = other as UnresolvedSecurityAttribute;\n\t\t\treturn attr != null && index == attr.index && secDecl == attr.secDecl;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/VoidTypeDefinition.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\t/// <summary>\n\t/// Special type definition for 'void'.\n\t/// </summary>\n\tpublic class VoidTypeDefinition : DefaultResolvedTypeDefinition\n\t{\n\t\tpublic VoidTypeDefinition(ITypeResolveContext parentContext, params IUnresolvedTypeDefinition[] parts)\n\t\t\t: base(parentContext, parts)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.Void; }\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetConstructors(Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IEvent> GetEvents(Predicate<IUnresolvedEvent> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IEvent>.Instance;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IField> GetFields(Predicate<IUnresolvedField> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IField>.Instance;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IProperty>.Instance;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMember> GetMembers(Predicate<IUnresolvedMember> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn EmptyList<IMember>.Instance;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/InheritanceHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Provides helper methods for inheritance.\n\t/// </summary>\n\tpublic static class InheritanceHelper\n\t{\n\t\t// TODO: maybe these should be extension methods?\n\t\t// or even part of the interface itself? (would allow for easy caching)\n\t\t\n\t\t#region GetBaseMember\n\t\t/// <summary>\n\t\t/// Gets the base member that has the same signature.\n\t\t/// </summary>\n\t\tpublic static IMember GetBaseMember(IMember member)\n\t\t{\n\t\t\treturn GetBaseMembers(member, false).FirstOrDefault();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets all base members that have the same signature.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// List of base members with the same signature. The member from the derived-most base class is returned first.\n\t\t/// </returns>\n\t\tpublic static IEnumerable<IMember> GetBaseMembers(IMember member, bool includeImplementedInterfaces)\n\t\t{\n\t\t\tif (member == null)\n\t\t\t\tthrow new ArgumentNullException(\"member\");\n\n\t\t\tif (member.IsExplicitInterfaceImplementation && member.ImplementedInterfaceMembers.Count == 1) {\n\t\t\t\t// C#-style explicit interface implementation\n\t\t\t\tmember = member.ImplementedInterfaceMembers[0];\n\t\t\t\tyield return member;\n\t\t\t}\n\t\t\t\n\t\t\t// Remove generic specialization\n\t\t\tvar substitution = member.Substitution;\n\t\t\tmember = member.MemberDefinition;\n\t\t\t\n\t\t\tif (member.DeclaringTypeDefinition == null) {\n\t\t\t\t// For global methods, return empty list. (prevent SharpDevelop UDC crash 4524)\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<IType> allBaseTypes;\n\t\t\tif (includeImplementedInterfaces) {\n\t\t\t\tallBaseTypes = member.DeclaringTypeDefinition.GetAllBaseTypes();\n\t\t\t} else {\n\t\t\t\tallBaseTypes = member.DeclaringTypeDefinition.GetNonInterfaceBaseTypes();\n\t\t\t}\n\t\t\tforeach (IType baseType in allBaseTypes.Reverse()) {\n\t\t\t\tif (baseType == member.DeclaringTypeDefinition)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tIEnumerable<IMember> baseMembers;\n\t\t\t\tif (member.SymbolKind == SymbolKind.Accessor) {\n\t\t\t\t\tbaseMembers = baseType.GetAccessors(m => m.Name == member.Name && !m.IsExplicitInterfaceImplementation, GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\t} else {\n\t\t\t\t\tbaseMembers = baseType.GetMembers(m => m.Name == member.Name && !m.IsExplicitInterfaceImplementation, GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\t}\n\t\t\t\tforeach (IMember baseMember in baseMembers) {\n\t\t\t\t\tif (SignatureComparer.Ordinal.Equals(member, baseMember)) {\n\t\t\t\t\t\tyield return baseMember.Specialize(substitution);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetDerivedMember\n\t\t/// <summary>\n\t\t/// Finds the member declared in 'derivedType' that has the same signature (could override) 'baseMember'.\n\t\t/// </summary>\n\t\tpublic static IMember GetDerivedMember(IMember baseMember, ITypeDefinition derivedType)\n\t\t{\n\t\t\tif (baseMember == null)\n\t\t\t\tthrow new ArgumentNullException(\"baseMember\");\n\t\t\tif (derivedType == null)\n\t\t\t\tthrow new ArgumentNullException(\"derivedType\");\n\t\t\t\n\t\t\tif (baseMember.Compilation != derivedType.Compilation)\n\t\t\t\tthrow new ArgumentException(\"baseMember and derivedType must be from the same compilation\");\n\t\t\t\n\t\t\tbaseMember = baseMember.MemberDefinition;\n\t\t\tbool includeInterfaces = baseMember.DeclaringTypeDefinition.Kind == TypeKind.Interface;\n\t\t\tIMethod method = baseMember as IMethod;\n\t\t\tif (method != null) {\n\t\t\t\tforeach (IMethod derivedMethod in derivedType.Methods) {\n\t\t\t\t\tif (derivedMethod.Name == method.Name && derivedMethod.Parameters.Count == method.Parameters.Count) {\n\t\t\t\t\t\tif (derivedMethod.TypeParameters.Count == method.TypeParameters.Count) {\n\t\t\t\t\t\t\t// The method could override the base method:\n\t\t\t\t\t\t\tif (GetBaseMembers(derivedMethod, includeInterfaces).Any(m => m.MemberDefinition == baseMember))\n\t\t\t\t\t\t\t\treturn derivedMethod;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tIProperty property = baseMember as IProperty;\n\t\t\tif (property != null) {\n\t\t\t\tforeach (IProperty derivedProperty in derivedType.Properties) {\n\t\t\t\t\tif (derivedProperty.Name == property.Name && derivedProperty.Parameters.Count == property.Parameters.Count) {\n\t\t\t\t\t\t// The property could override the base property:\n\t\t\t\t\t\tif (GetBaseMembers(derivedProperty, includeInterfaces).Any(m => m.MemberDefinition == baseMember))\n\t\t\t\t\t\t\treturn derivedProperty;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (baseMember is IEvent) {\n\t\t\t\tforeach (IEvent derivedEvent in derivedType.Events) {\n\t\t\t\t\tif (derivedEvent.Name == baseMember.Name)\n\t\t\t\t\t\treturn derivedEvent;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (baseMember is IField) {\n\t\t\t\tforeach (IField derivedField in derivedType.Fields) {\n\t\t\t\t\tif (derivedField.Name == baseMember.Name)\n\t\t\t\t\t\treturn derivedField;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/IntersectionType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\n\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents the intersection of several types.\n\t/// </summary>\n\tpublic class IntersectionType : AbstractType\n\t{\n\t\treadonly ReadOnlyCollection<IType> types;\n\t\t\n\t\tpublic ReadOnlyCollection<IType> Types {\n\t\t\tget { return types; }\n\t\t}\n\t\t\n\t\tprivate IntersectionType(IType[] types)\n\t\t{\n\t\t\tDebug.Assert(types.Length >= 2);\n\t\t\tthis.types = Array.AsReadOnly(types);\n\t\t}\n\t\t\n\t\tpublic static IType Create(IEnumerable<IType> types)\n\t\t{\n\t\t\tIType[] arr = types.Distinct().ToArray();\n\t\t\tforeach (IType type in arr) {\n\t\t\t\tif (type == null)\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tif (arr.Length == 0)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\telse if (arr.Length == 1)\n\t\t\t\treturn arr[0];\n\t\t\telse\n\t\t\t\treturn new IntersectionType(arr);\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.Intersection; }\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\tStringBuilder b = new StringBuilder();\n\t\t\t\tforeach (var t in types) {\n\t\t\t\t\tif (b.Length > 0)\n\t\t\t\t\t\tb.Append(\" & \");\n\t\t\t\t\tb.Append(t.Name);\n\t\t\t\t}\n\t\t\t\treturn b.ToString();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ReflectionName {\n\t\t\tget {\n\t\t\t\tStringBuilder b = new StringBuilder();\n\t\t\t\tforeach (var t in types) {\n\t\t\t\t\tif (b.Length > 0)\n\t\t\t\t\t\tb.Append(\" & \");\n\t\t\t\t\tb.Append(t.ReflectionName);\n\t\t\t\t}\n\t\t\t\treturn b.ToString();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget {\n\t\t\t\tforeach (var t in types) {\n\t\t\t\t\tbool? isReferenceType = t.IsReferenceType;\n\t\t\t\t\tif (isReferenceType.HasValue)\n\t\t\t\t\t\treturn isReferenceType.Value;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tint hashCode = 0;\n\t\t\tunchecked {\n\t\t\t\tforeach (var t in types) {\n\t\t\t\t\thashCode *= 7137517;\n\t\t\t\t\thashCode += t.GetHashCode();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hashCode;\n\t\t}\n\t\t\n\t\tpublic override bool Equals(IType other)\n\t\t{\n\t\t\tIntersectionType o = other as IntersectionType;\n\t\t\tif (o != null && types.Count == o.types.Count) {\n\t\t\t\tfor (int i = 0; i < types.Count; i++) {\n\t\t\t\t\tif (!types[i].Equals(o.types[i]))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IType> DirectBaseTypes {\n\t\t\tget { return types; }\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMembersHelper.GetMethods(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMembersHelper.GetMethods(this, typeArguments, filter, options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMembersHelper.GetProperties(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IField> GetFields(Predicate<IUnresolvedField> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMembersHelper.GetFields(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IEvent> GetEvents(Predicate<IUnresolvedEvent> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMembersHelper.GetEvents(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMember> GetMembers(Predicate<IUnresolvedMember> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMembersHelper.GetMembers(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter, GetMemberOptions options)\n\t\t{\n\t\t\treturn GetMembersHelper.GetAccessors(this, FilterNonStatic(filter), options);\n\t\t}\n\t\t\n\t\tstatic Predicate<T> FilterNonStatic<T>(Predicate<T> filter) where T : class, IUnresolvedMember\n\t\t{\n\t\t\tif (filter == null)\n\t\t\t\treturn member => !member.IsStatic;\n\t\t\telse\n\t\t\t\treturn member => !member.IsStatic && filter(member);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/KnownTypeReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents some well-known types.\n\t/// </summary>\n\tpublic enum KnownTypeCode\n\t{\n\t\t// Note: DefaultResolvedTypeDefinition uses (KnownTypeCode)-1 as special value for \"not yet calculated\".\n\t\t// The order of type codes at the beginning must correspond to those in System.TypeCode.\n\t\t\n\t\t/// <summary>\n\t\t/// Not one of the known types.\n\t\t/// </summary>\n\t\tNone,\n\t\t/// <summary><c>object</c> (System.Object)</summary>\n\t\tObject,\n\t\t/// <summary><c>System.DBNull</c></summary>\n\t\tDBNull,\n\t\t/// <summary><c>bool</c> (System.Boolean)</summary>\n\t\tBoolean,\n\t\t/// <summary><c>char</c> (System.Char)</summary>\n\t\tChar,\n\t\t/// <summary><c>sbyte</c> (System.SByte)</summary>\n\t\tSByte,\n\t\t/// <summary><c>byte</c> (System.Byte)</summary>\n\t\tByte,\n\t\t/// <summary><c>short</c> (System.Int16)</summary>\n\t\tInt16,\n\t\t/// <summary><c>ushort</c> (System.UInt16)</summary>\n\t\tUInt16,\n\t\t/// <summary><c>int</c> (System.Int32)</summary>\n\t\tInt32,\n\t\t/// <summary><c>uint</c> (System.UInt32)</summary>\n\t\tUInt32,\n\t\t/// <summary><c>long</c> (System.Int64)</summary>\n\t\tInt64,\n\t\t/// <summary><c>ulong</c> (System.UInt64)</summary>\n\t\tUInt64,\n\t\t/// <summary><c>float</c> (System.Single)</summary>\n\t\tSingle,\n\t\t/// <summary><c>double</c> (System.Double)</summary>\n\t\tDouble,\n\t\t/// <summary><c>decimal</c> (System.Decimal)</summary>\n\t\tDecimal,\n\t\t/// <summary><c>System.DateTime</c></summary>\n\t\tDateTime,\n\t\t/// <summary><c>string</c> (System.String)</summary>\n\t\tString = 18,\n\t\t\n\t\t// String was the last element from System.TypeCode, now our additional known types start\n\t\t\n\t\t/// <summary><c>void</c> (System.Void)</summary>\n\t\tVoid,\n\t\t/// <summary><c>System.Type</c></summary>\n\t\tType,\n\t\t/// <summary><c>System.Array</c></summary>\n\t\tArray,\n\t\t/// <summary><c>System.Attribute</c></summary>\n\t\tAttribute,\n\t\t/// <summary><c>System.ValueType</c></summary>\n\t\tValueType,\n\t\t/// <summary><c>System.Enum</c></summary>\n\t\tEnum,\n\t\t/// <summary><c>System.Delegate</c></summary>\n\t\tDelegate,\n\t\t/// <summary><c>System.MulticastDelegate</c></summary>\n\t\tMulticastDelegate,\n\t\t/// <summary><c>System.Exception</c></summary>\n\t\tException,\n\t\t/// <summary><c>System.IntPtr</c></summary>\n\t\tIntPtr,\n\t\t/// <summary><c>System.UIntPtr</c></summary>\n\t\tUIntPtr,\n\t\t/// <summary><c>System.Collections.IEnumerable</c></summary>\n\t\tIEnumerable,\n\t\t/// <summary><c>System.Collections.IEnumerator</c></summary>\n\t\tIEnumerator,\n\t\t/// <summary><c>System.Collections.Generic.IEnumerable{T}</c></summary>\n\t\tIEnumerableOfT,\n\t\t/// <summary><c>System.Collections.Generic.IEnumerator{T}</c></summary>\n\t\tIEnumeratorOfT,\n\t\t/// <summary><c>System.Collections.Generic.ICollection</c></summary>\n\t\tICollection,\n\t\t/// <summary><c>System.Collections.Generic.ICollection{T}</c></summary>\n\t\tICollectionOfT,\n\t\t/// <summary><c>System.Collections.Generic.IList</c></summary>\n\t\tIList,\n\t\t/// <summary><c>System.Collections.Generic.IList{T}</c></summary>\n\t\tIListOfT,\n\t\t/// <summary><c>System.Collections.Generic.IReadOnlyCollection{T}</c></summary>\n\t\tIReadOnlyCollectionOfT,\n\t\t/// <summary><c>System.Collections.Generic.IReadOnlyList{T}</c></summary>\n\t\tIReadOnlyListOfT,\n\t\t/// <summary><c>System.Threading.Tasks.Task</c></summary>\n\t\tTask,\n\t\t/// <summary><c>System.Threading.Tasks.Task{T}</c></summary>\n\t\tTaskOfT,\n\t\t/// <summary><c>System.Nullable{T}</c></summary>\n\t\tNullableOfT,\n\t\t/// <summary><c>System.IDisposable</c></summary>\n\t\tIDisposable,\n\t\t/// <summary><c>System.Runtime.CompilerServices.INotifyCompletion</c></summary>\n\t\tINotifyCompletion,\n\t\t/// <summary><c>System.Runtime.CompilerServices.ICriticalNotifyCompletion</c></summary>\n\t\tICriticalNotifyCompletion,\n\t}\n\t\n\t/// <summary>\n\t/// Contains well-known type references.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class KnownTypeReference : ITypeReference\n\t{\n\t\tinternal const int KnownTypeCodeCount = (int)KnownTypeCode.ICriticalNotifyCompletion + 1;\n\t\t\n\t\tstatic readonly KnownTypeReference[] knownTypeReferences = new KnownTypeReference[KnownTypeCodeCount] {\n\t\t\tnull, // None\n\t\t\tnew KnownTypeReference(KnownTypeCode.Object,   \"System\", \"Object\", baseType: KnownTypeCode.None),\n\t\t\tnew KnownTypeReference(KnownTypeCode.DBNull,   \"System\", \"DBNull\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Boolean,  \"System\", \"Boolean\",  baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Char,     \"System\", \"Char\",     baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.SByte,    \"System\", \"SByte\",    baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Byte,     \"System\", \"Byte\",     baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Int16,    \"System\", \"Int16\",    baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.UInt16,   \"System\", \"UInt16\",   baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Int32,    \"System\", \"Int32\",    baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.UInt32,   \"System\", \"UInt32\",   baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Int64,    \"System\", \"Int64\",    baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.UInt64,   \"System\", \"UInt64\",   baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Single,   \"System\", \"Single\",   baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Double,   \"System\", \"Double\",   baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Decimal,  \"System\", \"Decimal\",  baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.DateTime, \"System\", \"DateTime\", baseType: KnownTypeCode.ValueType),\n\t\t\tnull,\n\t\t\tnew KnownTypeReference(KnownTypeCode.String,    \"System\", \"String\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Void,      \"System\", \"Void\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Type,      \"System\", \"Type\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Array,     \"System\", \"Array\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Attribute, \"System\", \"Attribute\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.ValueType, \"System\", \"ValueType\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Enum,      \"System\", \"Enum\", baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Delegate,  \"System\", \"Delegate\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.MulticastDelegate, \"System\", \"MulticastDelegate\", baseType: KnownTypeCode.Delegate),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Exception, \"System\", \"Exception\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IntPtr,    \"System\", \"IntPtr\", baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.UIntPtr,   \"System\", \"UIntPtr\", baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IEnumerable,    \"System.Collections\", \"IEnumerable\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IEnumerator,    \"System.Collections\", \"IEnumerator\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IEnumerableOfT, \"System.Collections.Generic\", \"IEnumerable\", 1),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IEnumeratorOfT, \"System.Collections.Generic\", \"IEnumerator\", 1),\n\t\t\tnew KnownTypeReference(KnownTypeCode.ICollection,    \"System.Collections\", \"ICollection\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.ICollectionOfT, \"System.Collections.Generic\", \"ICollection\", 1),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IList,          \"System.Collections\", \"IList\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IListOfT,       \"System.Collections.Generic\", \"IList\", 1),\n\n\t\t\tnew KnownTypeReference(KnownTypeCode.IReadOnlyCollectionOfT, \"System.Collections.Generic\", \"IReadOnlyCollection\", 1),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IReadOnlyListOfT, \"System.Collections.Generic\", \"IReadOnlyList\", 1),\n\t\t\tnew KnownTypeReference(KnownTypeCode.Task,        \"System.Threading.Tasks\", \"Task\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.TaskOfT,     \"System.Threading.Tasks\", \"Task\", 1, baseType: KnownTypeCode.Task),\n\t\t\tnew KnownTypeReference(KnownTypeCode.NullableOfT, \"System\", \"Nullable\", 1, baseType: KnownTypeCode.ValueType),\n\t\t\tnew KnownTypeReference(KnownTypeCode.IDisposable, \"System\", \"IDisposable\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.INotifyCompletion, \"System.Runtime.CompilerServices\", \"INotifyCompletion\"),\n\t\t\tnew KnownTypeReference(KnownTypeCode.ICriticalNotifyCompletion, \"System.Runtime.CompilerServices\", \"ICriticalNotifyCompletion\"),\n\t\t};\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the known type reference for the specified type code.\n\t\t/// Returns null for KnownTypeCode.None.\n\t\t/// </summary>\n\t\tpublic static KnownTypeReference Get(KnownTypeCode typeCode)\n\t\t{\n\t\t\treturn knownTypeReferences[(int)typeCode];\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>object</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Object = Get(KnownTypeCode.Object);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.DBNull</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference DBNull = Get(KnownTypeCode.DBNull);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>bool</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Boolean = Get(KnownTypeCode.Boolean);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>char</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Char = Get(KnownTypeCode.Char);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>sbyte</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference SByte = Get(KnownTypeCode.SByte);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>byte</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Byte = Get(KnownTypeCode.Byte);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>short</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Int16 = Get(KnownTypeCode.Int16);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>ushort</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference UInt16 = Get(KnownTypeCode.UInt16);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>int</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Int32 = Get(KnownTypeCode.Int32);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>uint</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference UInt32 = Get(KnownTypeCode.UInt32);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>long</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Int64 = Get(KnownTypeCode.Int64);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>ulong</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference UInt64 = Get(KnownTypeCode.UInt64);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>float</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Single = Get(KnownTypeCode.Single);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>double</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Double = Get(KnownTypeCode.Double);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>decimal</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Decimal = Get(KnownTypeCode.Decimal);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.DateTime</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference DateTime = Get(KnownTypeCode.DateTime);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>string</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference String = Get(KnownTypeCode.String);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>void</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Void = Get(KnownTypeCode.Void);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Type</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Type = Get(KnownTypeCode.Type);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Array</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Array = Get(KnownTypeCode.Array);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Attribute</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Attribute = Get(KnownTypeCode.Attribute);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.ValueType</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference ValueType = Get(KnownTypeCode.ValueType);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Enum</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Enum = Get(KnownTypeCode.Enum);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Delegate</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Delegate = Get(KnownTypeCode.Delegate);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.MulticastDelegate</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference MulticastDelegate = Get(KnownTypeCode.MulticastDelegate);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Exception</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Exception = Get(KnownTypeCode.Exception);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.IntPtr</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IntPtr = Get(KnownTypeCode.IntPtr);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.UIntPtr</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference UIntPtr = Get(KnownTypeCode.UIntPtr);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.IEnumerable</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IEnumerable = Get(KnownTypeCode.IEnumerable);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.IEnumerator</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IEnumerator = Get(KnownTypeCode.IEnumerator);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.Generic.IEnumerable{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IEnumerableOfT = Get(KnownTypeCode.IEnumerableOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.Generic.IEnumerator{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IEnumeratorOfT = Get(KnownTypeCode.IEnumeratorOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.ICollection</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference ICollection = Get(KnownTypeCode.ICollection);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.Generic.ICollection{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference ICollectionOfT = Get(KnownTypeCode.ICollectionOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.IList</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IList = Get(KnownTypeCode.IList);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.Generic.IList{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IListOfT = Get(KnownTypeCode.IListOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.Generic.IReadOnlyCollection{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IReadOnlyCollectionOfT = Get(KnownTypeCode.IReadOnlyCollectionOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Collections.Generic.IReadOnlyList{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IReadOnlyListOfT = Get(KnownTypeCode.IReadOnlyListOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Threading.Tasks.Task</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference Task = Get(KnownTypeCode.Task);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Threading.Tasks.Task{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference TaskOfT = Get(KnownTypeCode.TaskOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Nullable{T}</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference NullableOfT = Get(KnownTypeCode.NullableOfT);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.IDisposable</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference IDisposable = Get(KnownTypeCode.IDisposable);\n\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Runtime.CompilerServices.INotifyCompletion</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference INotifyCompletion = Get(KnownTypeCode.INotifyCompletion);\n\n\t\t/// <summary>\n\t\t/// Gets a type reference pointing to the <c>System.Runtime.CompilerServices.ICriticalNotifyCompletion</c> type.\n\t\t/// </summary>\n\t\tpublic static readonly KnownTypeReference ICriticalNotifyCompletion = Get(KnownTypeCode.ICriticalNotifyCompletion);\n\n\t\treadonly KnownTypeCode knownTypeCode;\n\t\treadonly string namespaceName;\n\t\treadonly string name;\n\t\treadonly int typeParameterCount;\n\t\tinternal readonly KnownTypeCode baseType;\n\t\t\n\t\tprivate KnownTypeReference(KnownTypeCode knownTypeCode, string namespaceName, string name, int typeParameterCount = 0, KnownTypeCode baseType = KnownTypeCode.Object)\n\t\t{\n\t\t\tthis.knownTypeCode = knownTypeCode;\n\t\t\tthis.namespaceName = namespaceName;\n\t\t\tthis.name = name;\n\t\t\tthis.typeParameterCount = typeParameterCount;\n\t\t\tthis.baseType = baseType;\n\t\t}\n\t\t\n\t\tpublic KnownTypeCode KnownTypeCode {\n\t\t\tget { return knownTypeCode; }\n\t\t}\n\t\t\n\t\tpublic string Namespace {\n\t\t\tget { return namespaceName; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tpublic int TypeParameterCount {\n\t\t\tget { return typeParameterCount; }\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn context.Compilation.FindType(knownTypeCode);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn GetCSharpNameByTypeCode(knownTypeCode) ?? (this.Namespace + \".\" + this.Name);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the C# primitive type name from the known type code.\n\t\t/// Returns null if there is no primitive name for the specified type.\n\t\t/// </summary>\n\t\tpublic static string GetCSharpNameByTypeCode(KnownTypeCode knownTypeCode)\n\t\t{\n\t\t\tswitch (knownTypeCode) {\n\t\t\t\tcase KnownTypeCode.Object:\n\t\t\t\t\treturn \"object\";\n\t\t\t\tcase KnownTypeCode.Boolean:\n\t\t\t\t\treturn \"bool\";\n\t\t\t\tcase KnownTypeCode.Char:\n\t\t\t\t\treturn \"char\";\n\t\t\t\tcase KnownTypeCode.SByte:\n\t\t\t\t\treturn \"sbyte\";\n\t\t\t\tcase KnownTypeCode.Byte:\n\t\t\t\t\treturn \"byte\";\n\t\t\t\tcase KnownTypeCode.Int16:\n\t\t\t\t\treturn \"short\";\n\t\t\t\tcase KnownTypeCode.UInt16:\n\t\t\t\t\treturn \"ushort\";\n\t\t\t\tcase KnownTypeCode.Int32:\n\t\t\t\t\treturn \"int\";\n\t\t\t\tcase KnownTypeCode.UInt32:\n\t\t\t\t\treturn \"uint\";\n\t\t\t\tcase KnownTypeCode.Int64:\n\t\t\t\t\treturn \"long\";\n\t\t\t\tcase KnownTypeCode.UInt64:\n\t\t\t\t\treturn \"ulong\";\n\t\t\t\tcase KnownTypeCode.Single:\n\t\t\t\t\treturn \"float\";\n\t\t\t\tcase KnownTypeCode.Double:\n\t\t\t\t\treturn \"double\";\n\t\t\t\tcase KnownTypeCode.Decimal:\n\t\t\t\t\treturn \"decimal\";\n\t\t\t\tcase KnownTypeCode.String:\n\t\t\t\t\treturn \"string\";\n\t\t\t\tcase KnownTypeCode.Void:\n\t\t\t\t\treturn \"void\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/NullableType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Static helper methods for working with nullable types.\n\t/// </summary>\n\tpublic static class NullableType\n\t{\n\t\t/// <summary>\n\t\t/// Gets whether the specified type is a nullable type.\n\t\t/// </summary>\n\t\tpublic static bool IsNullable(IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\treturn pt != null && pt.TypeParameterCount == 1 && pt.GetDefinition().KnownTypeCode == KnownTypeCode.NullableOfT;\n\t\t}\n\t\t\n\t\tpublic static bool IsNonNullableValueType(IType type)\n\t\t{\n\t\t\treturn type.IsReferenceType == false && !IsNullable(type);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the element type, if <paramref name=\"type\"/> is a nullable type.\n\t\t/// Otherwise, returns the type itself.\n\t\t/// </summary>\n\t\tpublic static IType GetUnderlyingType(IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\tif (pt != null && pt.TypeParameterCount == 1 && pt.FullName == \"System.Nullable\")\n\t\t\t\treturn pt.GetTypeArgument(0);\n\t\t\telse\n\t\t\t\treturn type;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a nullable type.\n\t\t/// </summary>\n\t\tpublic static IType Create(ICompilation compilation, IType elementType)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\t\n\t\t\tIType nullableType = compilation.FindType(KnownTypeCode.NullableOfT);\n\t\t\tITypeDefinition nullableTypeDef = nullableType.GetDefinition();\n\t\t\tif (nullableTypeDef != null)\n\t\t\t\treturn new ParameterizedType(nullableTypeDef, new [] { elementType });\n\t\t\telse\n\t\t\t\treturn nullableType;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a nullable type reference.\n\t\t/// </summary>\n\t\tpublic static ParameterizedTypeReference Create(ITypeReference elementType)\n\t\t{\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\treturn new ParameterizedTypeReference(KnownTypeReference.NullableOfT, new [] { elementType });\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ParameterListComparer.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Compares parameter lists by comparing the types of all parameters.\n\t/// </summary>\n\t/// <remarks>\n\t/// 'ref int' and 'out int' are considered to be equal.\n\t/// 'object' and 'dynamic' are also equal.\n\t/// For generic methods, \"Method{T}(T a)\" and \"Method{S}(S b)\" are considered equal.\n\t/// However, \"Method(T a)\" and \"Method(S b)\" are not considered equal when the type parameters T and S belong to classes.\n\t/// </remarks>\n\tpublic sealed class ParameterListComparer : IEqualityComparer<IList<IParameter>>\n\t{\n\t\tpublic static readonly ParameterListComparer Instance = new ParameterListComparer();\n\t\t\n\t\tsealed class NormalizeTypeVisitor : TypeVisitor\n\t\t{\n\t\t\tpublic override IType VisitTypeParameter(ITypeParameter type)\n\t\t\t{\n\t\t\t\tif (type.OwnerType == SymbolKind.Method) {\n\t\t\t\t\treturn DummyTypeParameter.GetMethodTypeParameter(type.Index);\n\t\t\t\t} else {\n\t\t\t\t\treturn base.VisitTypeParameter(type);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitTypeDefinition(ITypeDefinition type)\n\t\t\t{\n\t\t\t\tif (type.KnownTypeCode == KnownTypeCode.Object)\n\t\t\t\t\treturn SpecialType.Dynamic;\n\t\t\t\treturn base.VisitTypeDefinition(type);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic readonly NormalizeTypeVisitor normalizationVisitor = new NormalizeTypeVisitor();\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces all occurrences of method type parameters in the given type\n\t\t/// by normalized type parameters. This allows comparing parameter types from different\n\t\t/// generic methods.\n\t\t/// </summary>\n\t\t[Obsolete(\"Use DummyTypeParameter.NormalizeMethodTypeParameters instead if you only need to normalize type parameters. Also, consider if you need to normalize object vs. dynamic as well.\")]\n\t\tpublic IType NormalizeMethodTypeParameters(IType type)\n\t\t{\n\t\t\treturn DummyTypeParameter.NormalizeMethodTypeParameters(type);\n\t\t}\n\t\t\n\t\tpublic bool Equals(IList<IParameter> x, IList<IParameter> y)\n\t\t{\n\t\t\tif (x == y)\n\t\t\t\treturn true;\n\t\t\tif (x == null || y == null || x.Count != y.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < x.Count; i++) {\n\t\t\t\tvar a = x[i];\n\t\t\t\tvar b = y[i];\n\t\t\t\tif (a == null && b == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (a == null || b == null)\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t// We want to consider the parameter lists \"Method<T>(T a)\" and \"Method<S>(S b)\" as equal.\n\t\t\t\t// However, the parameter types are not considered equal, as T is a different type parameter than S.\n\t\t\t\t// In order to compare the method signatures, we will normalize all method type parameters.\n\t\t\t\tIType aType = a.Type.AcceptVisitor(normalizationVisitor);\n\t\t\t\tIType bType = b.Type.AcceptVisitor(normalizationVisitor);\n\t\t\t\t\n\t\t\t\tif (!aType.Equals(bType))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tpublic int GetHashCode(IList<IParameter> obj)\n\t\t{\n\t\t\tint hashCode = obj.Count;\n\t\t\tunchecked {\n\t\t\t\tforeach (IParameter p in obj) {\n\t\t\t\t\thashCode *= 27;\n\t\t\t\t\tIType type = p.Type.AcceptVisitor(normalizationVisitor);\n\t\t\t\t\thashCode += type.GetHashCode();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hashCode;\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Compares member signatures.\n\t/// </summary>\n\t/// <remarks>\n\t/// This comparer checks for equal short name, equal type parameter count, and equal parameter types (using ParameterListComparer).\n\t/// </remarks>\n\tpublic sealed class SignatureComparer : IEqualityComparer<IMember>\n\t{\n\t\tStringComparer nameComparer;\n\t\t\n\t\tpublic SignatureComparer(StringComparer nameComparer)\n\t\t{\n\t\t\tif (nameComparer == null)\n\t\t\t\tthrow new ArgumentNullException(\"nameComparer\");\n\t\t\tthis.nameComparer = nameComparer;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a signature comparer that uses an ordinal comparison for the member name.\n\t\t/// </summary>\n\t\tpublic static readonly SignatureComparer Ordinal = new SignatureComparer(StringComparer.Ordinal);\n\t\t\n\t\tpublic bool Equals(IMember x, IMember y)\n\t\t{\n\t\t\tif (x == y)\n\t\t\t\treturn true;\n\t\t\tif (x == null || y == null || x.SymbolKind != y.SymbolKind || !nameComparer.Equals(x.Name, y.Name))\n\t\t\t\treturn false;\n\t\t\tIParameterizedMember px = x as IParameterizedMember;\n\t\t\tIParameterizedMember py = y as IParameterizedMember;\n\t\t\tif (px != null && py != null) {\n\t\t\t\tIMethod mx = x as IMethod;\n\t\t\t\tIMethod my = y as IMethod;\n\t\t\t\tif (mx != null && my != null && mx.TypeParameters.Count != my.TypeParameters.Count)\n\t\t\t\t\treturn false;\n\t\t\t\treturn ParameterListComparer.Instance.Equals(px.Parameters, py.Parameters);\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int GetHashCode(IMember obj)\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hash = (int)obj.SymbolKind * 33 + nameComparer.GetHashCode(obj.Name);\n\t\t\t\tIParameterizedMember pm = obj as IParameterizedMember;\n\t\t\t\tif (pm != null) {\n\t\t\t\t\thash *= 27;\n\t\t\t\t\thash += ParameterListComparer.Instance.GetHashCode(pm.Parameters);\n\t\t\t\t\tIMethod m = pm as IMethod;\n\t\t\t\t\tif (m != null)\n\t\t\t\t\t\thash += m.TypeParameters.Count;\n\t\t\t\t}\n\t\t\t\treturn hash;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ParameterizedType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\n\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// ParameterizedType represents an instance of a generic type.\n\t/// Example: List&lt;string&gt;\n\t/// </summary>\n\t/// <remarks>\n\t/// When getting the members, this type modifies the lists so that\n\t/// type parameters in the signatures of the members are replaced with\n\t/// the type arguments.\n\t/// </remarks>\n\t[Serializable]\n\tpublic sealed class ParameterizedType : IType, ICompilationProvider\n\t{\n\t\treadonly ITypeDefinition genericType;\n\t\treadonly IType[] typeArguments;\n\t\t\n\t\tpublic ParameterizedType(ITypeDefinition genericType, IEnumerable<IType> typeArguments)\n\t\t{\n\t\t\tif (genericType == null)\n\t\t\t\tthrow new ArgumentNullException(\"genericType\");\n\t\t\tif (typeArguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeArguments\");\n\t\t\tthis.genericType = genericType;\n\t\t\tthis.typeArguments = typeArguments.ToArray(); // copy input array to ensure it isn't modified\n\t\t\tif (this.typeArguments.Length == 0)\n\t\t\t\tthrow new ArgumentException(\"Cannot use ParameterizedType with 0 type arguments.\");\n\t\t\tif (genericType.TypeParameterCount != this.typeArguments.Length)\n\t\t\t\tthrow new ArgumentException(\"Number of type arguments must match the type definition's number of type parameters\");\n\t\t\tfor (int i = 0; i < this.typeArguments.Length; i++) {\n\t\t\t\tif (this.typeArguments[i] == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"typeArguments[\" + i + \"]\");\n\t\t\t\tICompilationProvider p = this.typeArguments[i] as ICompilationProvider;\n\t\t\t\tif (p != null && p.Compilation != genericType.Compilation)\n\t\t\t\t\tthrow new InvalidOperationException(\"Cannot parameterize a type with type arguments from a different compilation.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Fast internal version of the constructor. (no safety checks)\n\t\t/// Keeps the array that was passed and assumes it won't be modified.\n\t\t/// </summary>\n\t\tinternal ParameterizedType(ITypeDefinition genericType, IType[] typeArguments)\n\t\t{\n\t\t\tDebug.Assert(genericType.TypeParameterCount == typeArguments.Length);\n\t\t\tthis.genericType = genericType;\n\t\t\tthis.typeArguments = typeArguments;\n\t\t}\n\t\t\n\t\tpublic TypeKind Kind {\n\t\t\tget { return genericType.Kind; }\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return genericType.Compilation; }\n\t\t}\n\t\t\n\t\tpublic bool? IsReferenceType {\n\t\t\tget { return genericType.IsReferenceType; }\n\t\t}\n\t\t\n\t\tpublic IType DeclaringType {\n\t\t\tget {\n\t\t\t\tITypeDefinition declaringTypeDef = genericType.DeclaringTypeDefinition;\n\t\t\t\tif (declaringTypeDef != null && declaringTypeDef.TypeParameterCount > 0\n\t\t\t\t    && declaringTypeDef.TypeParameterCount <= genericType.TypeParameterCount)\n\t\t\t\t{\n\t\t\t\t\tIType[] newTypeArgs = new IType[declaringTypeDef.TypeParameterCount];\n\t\t\t\t\tArray.Copy(this.typeArguments, 0, newTypeArgs, 0, newTypeArgs.Length);\n\t\t\t\t\treturn new ParameterizedType(declaringTypeDef, newTypeArgs);\n\t\t\t\t}\n\t\t\t\treturn declaringTypeDef;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int TypeParameterCount {\n\t\t\tget { return typeArguments.Length; }\n\t\t}\n\t\t\n\t\tpublic string FullName {\n\t\t\tget { return genericType.FullName; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return genericType.Name; }\n\t\t}\n\t\t\n\t\tpublic string Namespace {\n\t\t\tget { return genericType.Namespace; }\n\t\t}\n\t\t\n\t\tpublic string ReflectionName {\n\t\t\tget {\n\t\t\t\tStringBuilder b = new StringBuilder(genericType.ReflectionName);\n\t\t\t\tb.Append('[');\n\t\t\t\tfor (int i = 0; i < typeArguments.Length; i++) {\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tb.Append(',');\n\t\t\t\t\tb.Append('[');\n\t\t\t\t\tb.Append(typeArguments[i].ReflectionName);\n\t\t\t\t\tb.Append(']');\n\t\t\t\t}\n\t\t\t\tb.Append(']');\n\t\t\t\treturn b.ToString();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ReflectionName;\n\t\t}\n\t\t\n\t\tpublic IList<IType> TypeArguments {\n\t\t\tget {\n\t\t\t\treturn typeArguments;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsParameterized { \n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Same as 'parameterizedType.TypeArguments[index]', but is a bit more efficient (doesn't require the read-only wrapper).\n\t\t/// </summary>\n\t\tpublic IType GetTypeArgument(int index)\n\t\t{\n\t\t\treturn typeArguments[index];\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the definition of the generic type.\n\t\t/// For <c>ParameterizedType</c>, this method never returns null.\n\t\t/// </summary>\n\t\tpublic ITypeDefinition GetDefinition()\n\t\t{\n\t\t\treturn genericType;\n\t\t}\n\t\t\n\t\tpublic ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn new ParameterizedTypeReference(genericType.ToTypeReference(), typeArguments.Select(t => t.ToTypeReference()));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type visitor that performs the substitution of class type parameters with the type arguments\n\t\t/// of this parameterized type.\n\t\t/// </summary>\n\t\tpublic TypeParameterSubstitution GetSubstitution()\n\t\t{\n\t\t\treturn new TypeParameterSubstitution(typeArguments, null);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a type visitor that performs the substitution of class type parameters with the type arguments\n\t\t/// of this parameterized type,\n\t\t/// and also substitutes method type parameters with the specified method type arguments.\n\t\t/// </summary>\n\t\tpublic TypeParameterSubstitution GetSubstitution(IList<IType> methodTypeArguments)\n\t\t{\n\t\t\treturn new TypeParameterSubstitution(typeArguments, methodTypeArguments);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IType> DirectBaseTypes {\n\t\t\tget {\n\t\t\t\tvar substitution = GetSubstitution();\n\t\t\t\treturn genericType.DirectBaseTypes.Select(t => t.AcceptVisitor(substitution));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IType> GetNestedTypes(Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetNestedTypes(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetNestedTypes(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IType> GetNestedTypes(IList<IType> typeArguments, Predicate<ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetNestedTypes(typeArguments, filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetNestedTypes(this, typeArguments, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetConstructors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetConstructors(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetConstructors(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetMethods(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetMethods(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetMethods(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetMethods(IList<IType> typeArguments, Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetMethods(typeArguments, filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetMethods(this, typeArguments, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IProperty> GetProperties(Predicate<IUnresolvedProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetProperties(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetProperties(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IField> GetFields(Predicate<IUnresolvedField> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetFields(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetFields(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IEvent> GetEvents(Predicate<IUnresolvedEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetEvents(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetEvents(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMember> GetMembers(Predicate<IUnresolvedMember> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetMembers(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetMembers(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IMethod> GetAccessors(Predicate<IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)\n\t\t{\n\t\t\tif ((options & GetMemberOptions.ReturnMemberDefinitions) == GetMemberOptions.ReturnMemberDefinitions)\n\t\t\t\treturn genericType.GetAccessors(filter, options);\n\t\t\telse\n\t\t\t\treturn GetMembersHelper.GetAccessors(this, filter, options);\n\t\t}\n\t\t\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn Equals(obj as IType);\n\t\t}\n\t\t\n\t\tpublic bool Equals(IType other)\n\t\t{\n\t\t\tParameterizedType c = other as ParameterizedType;\n\t\t\tif (c == null || !genericType.Equals(c.genericType) || typeArguments.Length != c.typeArguments.Length)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < typeArguments.Length; i++) {\n\t\t\t\tif (!typeArguments[i].Equals(c.typeArguments[i]))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tint hashCode = genericType.GetHashCode();\n\t\t\tunchecked {\n\t\t\t\tforeach (var ta in typeArguments) {\n\t\t\t\t\thashCode *= 1000000007;\n\t\t\t\t\thashCode += 1000000009 * ta.GetHashCode();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hashCode;\n\t\t}\n\t\t\n\t\tpublic IType AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitParameterizedType(this);\n\t\t}\n\t\t\n\t\tpublic IType VisitChildren(TypeVisitor visitor)\n\t\t{\n\t\t\tIType g = genericType.AcceptVisitor(visitor);\n\t\t\tITypeDefinition def = g as ITypeDefinition;\n\t\t\tif (def == null)\n\t\t\t\treturn g;\n\t\t\t// Keep ta == null as long as no elements changed, allocate the array only if necessary.\n\t\t\tIType[] ta = (g != genericType) ? new IType[typeArguments.Length] : null;\n\t\t\tfor (int i = 0; i < typeArguments.Length; i++) {\n\t\t\t\tIType r = typeArguments[i].AcceptVisitor(visitor);\n\t\t\t\tif (r == null)\n\t\t\t\t\tthrow new NullReferenceException(\"TypeVisitor.Visit-method returned null\");\n\t\t\t\tif (ta == null && r != typeArguments[i]) {\n\t\t\t\t\t// we found a difference, so we need to allocate the array\n\t\t\t\t\tta = new IType[typeArguments.Length];\n\t\t\t\t\tfor (int j = 0; j < i; j++) {\n\t\t\t\t\t\tta[j] = typeArguments[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ta != null)\n\t\t\t\t\tta[i] = r;\n\t\t\t}\n\t\t\tif (def == genericType && ta == null)\n\t\t\t\treturn this;\n\t\t\telse\n\t\t\t\treturn new ParameterizedType(def, ta ?? typeArguments);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// ParameterizedTypeReference is a reference to generic class that specifies the type parameters.\n\t/// Example: List&lt;string&gt;\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class ParameterizedTypeReference : ITypeReference, ISupportsInterning\n\t{\n\t\treadonly ITypeReference genericType;\n\t\treadonly ITypeReference[] typeArguments;\n\t\t\n\t\tpublic ParameterizedTypeReference(ITypeReference genericType, IEnumerable<ITypeReference> typeArguments)\n\t\t{\n\t\t\tif (genericType == null)\n\t\t\t\tthrow new ArgumentNullException(\"genericType\");\n\t\t\tif (typeArguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeArguments\");\n\t\t\tthis.genericType = genericType;\n\t\t\tthis.typeArguments = typeArguments.ToArray();\n\t\t\tfor (int i = 0; i < this.typeArguments.Length; i++) {\n\t\t\t\tif (this.typeArguments[i] == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"typeArguments[\" + i + \"]\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ITypeReference GenericType {\n\t\t\tget { return genericType; }\n\t\t}\n\t\t\n\t\tpublic ReadOnlyCollection<ITypeReference> TypeArguments {\n\t\t\tget {\n\t\t\t\treturn Array.AsReadOnly(typeArguments);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIType baseType = genericType.Resolve(context);\n\t\t\tITypeDefinition baseTypeDef = baseType.GetDefinition();\n\t\t\tif (baseTypeDef == null)\n\t\t\t\treturn baseType;\n\t\t\tint tpc = baseTypeDef.TypeParameterCount;\n\t\t\tif (tpc == 0)\n\t\t\t\treturn baseTypeDef;\n\t\t\tIType[] resolvedTypes = new IType[tpc];\n\t\t\tfor (int i = 0; i < resolvedTypes.Length; i++) {\n\t\t\t\tif (i < typeArguments.Length)\n\t\t\t\t\tresolvedTypes[i] = typeArguments[i].Resolve(context);\n\t\t\t\telse\n\t\t\t\t\tresolvedTypes[i] = SpecialType.UnknownType;\n\t\t\t}\n\t\t\treturn new ParameterizedType(baseTypeDef, resolvedTypes);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(genericType.ToString());\n\t\t\tb.Append('[');\n\t\t\tfor (int i = 0; i < typeArguments.Length; i++) {\n\t\t\t\tif (i > 0)\n\t\t\t\t\tb.Append(',');\n\t\t\t\tb.Append('[');\n\t\t\t\tb.Append(typeArguments[i].ToString());\n\t\t\t\tb.Append(']');\n\t\t\t}\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tint hashCode = genericType.GetHashCode();\n\t\t\tunchecked {\n\t\t\t\tforeach (ITypeReference t in typeArguments) {\n\t\t\t\t\thashCode *= 27;\n\t\t\t\t\thashCode += t.GetHashCode();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hashCode;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tParameterizedTypeReference o = other as ParameterizedTypeReference;\n\t\t\tif (o != null && genericType == o.genericType && typeArguments.Length == o.typeArguments.Length) {\n\t\t\t\tfor (int i = 0; i < typeArguments.Length; i++) {\n\t\t\t\t\tif (typeArguments[i] != o.typeArguments[i])\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/PointerType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic sealed class PointerType : TypeWithElementType\n\t{\n\t\tpublic PointerType(IType elementType) : base(elementType)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return TypeKind.Pointer; }\n\t\t}\n\t\t\n\t\tpublic override string NameSuffix {\n\t\t\tget {\n\t\t\t\treturn \"*\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget { return null; }\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn elementType.GetHashCode() ^ 91725811;\n\t\t}\n\t\t\n\t\tpublic override bool Equals(IType other)\n\t\t{\n\t\t\tPointerType a = other as PointerType;\n\t\t\treturn a != null && elementType.Equals(a.elementType);\n\t\t}\n\t\t\n\t\tpublic override IType AcceptVisitor(TypeVisitor visitor)\n\t\t{\n\t\t\treturn visitor.VisitPointerType(this);\n\t\t}\n\t\t\n\t\tpublic override IType VisitChildren(TypeVisitor visitor)\n\t\t{\n\t\t\tIType e = elementType.AcceptVisitor(visitor);\n\t\t\tif (e == elementType)\n\t\t\t\treturn this;\n\t\t\telse\n\t\t\t\treturn new PointerType(e);\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn new PointerTypeReference(elementType.ToTypeReference());\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class PointerTypeReference : ITypeReference, ISupportsInterning\n\t{\n\t\treadonly ITypeReference elementType;\n\t\t\n\t\tpublic PointerTypeReference(ITypeReference elementType)\n\t\t{\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\tthis.elementType = elementType;\n\t\t}\n\t\t\n\t\tpublic ITypeReference ElementType {\n\t\t\tget { return elementType; }\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new PointerType(elementType.Resolve(context));\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn elementType.ToString() + \"*\";\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn elementType.GetHashCode() ^ 91725812;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tPointerTypeReference o = other as PointerTypeReference;\n\t\t\treturn o != null && this.elementType == o.elementType;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ProjectReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// References another project content in the same solution.\n\t/// Using the <see cref=\"ProjectReference\"/> class requires that you \n\t/// </summary>\n\t[Serializable]\n\tpublic class ProjectReference : IAssemblyReference\n\t{\n\t\treadonly string projectFileName;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new reference to the specified project (must be part of the same solution).\n\t\t/// </summary>\n\t\t/// <param name=\"projectFileName\">Full path to the file name. Must be identical to <see cref=\"IProjectContent.ProjectFileName\"/> of the target project; do not use a relative path.</param>\n\t\tpublic ProjectReference(string projectFileName)\n\t\t{\n\t\t\tthis.projectFileName = projectFileName;\n\t\t}\n\t\t\n\t\tpublic IAssembly Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tvar solution = context.Compilation.SolutionSnapshot;\n\t\t\tvar pc = solution.GetProjectContent(projectFileName);\n\t\t\tif (pc != null)\n\t\t\t\treturn pc.Resolve(context);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"[ProjectReference {0}]\", projectFileName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ReflectionHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Static helper methods for reflection names.\n\t/// </summary>\n\tpublic static class ReflectionHelper\n\t{\n\t\t/// <summary>\n\t\t/// A reflection class used to represent <c>null</c>.\n\t\t/// </summary>\n\t\tpublic sealed class Null {}\n\t\t\n\t\t/// <summary>\n\t\t/// A reflection class used to represent <c>dynamic</c>.\n\t\t/// </summary>\n\t\tpublic sealed class Dynamic {}\n\t\t\n\t\t/// <summary>\n\t\t/// A reflection class used to represent an unbound type argument.\n\t\t/// </summary>\n\t\tpublic sealed class UnboundTypeArgument {}\n\t\t\n\t\t#region ICompilation.FindType\n\t\t/// <summary>\n\t\t/// Retrieves the specified type in this compilation.\n\t\t/// Returns <see cref=\"SpecialType.UnknownType\"/> if the type cannot be found in this compilation.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method cannot be used with open types; all type parameters will be substituted\n\t\t/// with <see cref=\"SpecialType.UnknownType\"/>.\n\t\t/// </remarks>\n\t\tpublic static IType FindType(this ICompilation compilation, Type type)\n\t\t{\n\t\t\treturn type.ToTypeReference().Resolve(compilation.TypeResolveContext);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type.ToTypeReference()\n\t\t/// <summary>\n\t\t/// Creates a reference to the specified type.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">The type to be converted.</param>\n\t\t/// <returns>Returns the type reference.</returns>\n\t\t/// <remarks>\n\t\t/// If the type is open (contains type parameters '`0' or '``0'),\n\t\t/// an <see cref=\"ITypeResolveContext\"/> with the appropriate CurrentTypeDefinition/CurrentMember is required\n\t\t/// to resolve the type reference.\n\t\t/// For closed types, the root type resolve context for the compilation is sufficient.\n\t\t/// </remarks>\n\t\tpublic static ITypeReference ToTypeReference(this Type type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\tif (type.IsGenericType && !type.IsGenericTypeDefinition) {\n\t\t\t\tITypeReference def = ToTypeReference(type.GetGenericTypeDefinition());\n\t\t\t\tType[] arguments = type.GetGenericArguments();\n\t\t\t\tITypeReference[] args = new ITypeReference[arguments.Length];\n\t\t\t\tbool allUnbound = true;\n\t\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\t\targs[i] = ToTypeReference(arguments[i]);\n\t\t\t\t\tallUnbound &= args[i].Equals(SpecialType.UnboundTypeArgument);\n\t\t\t\t}\n\t\t\t\tif (allUnbound)\n\t\t\t\t\treturn def;\n\t\t\t\telse\n\t\t\t\t\treturn new ParameterizedTypeReference(def, args);\n\t\t\t} else if (type.IsArray) {\n\t\t\t\treturn new ArrayTypeReference(ToTypeReference(type.GetElementType()), type.GetArrayRank());\n\t\t\t} else if (type.IsPointer) {\n\t\t\t\treturn new PointerTypeReference(ToTypeReference(type.GetElementType()));\n\t\t\t} else if (type.IsByRef) {\n\t\t\t\treturn new ByReferenceTypeReference(ToTypeReference(type.GetElementType()));\n\t\t\t} else if (type.IsGenericParameter) {\n\t\t\t\tif (type.DeclaringMethod != null) {\n\t\t\t\t\treturn TypeParameterReference.Create(SymbolKind.Method, type.GenericParameterPosition);\n\t\t\t\t} else {\n\t\t\t\t\treturn TypeParameterReference.Create(SymbolKind.TypeDefinition, type.GenericParameterPosition);\n\t\t\t\t}\n\t\t\t} else if (type.DeclaringType != null) {\n\t\t\t\tif (type == typeof(Dynamic))\n\t\t\t\t\treturn SpecialType.Dynamic;\n\t\t\t\telse if (type == typeof(Null))\n\t\t\t\t\treturn SpecialType.NullType;\n\t\t\t\telse if (type == typeof(UnboundTypeArgument))\n\t\t\t\t\treturn SpecialType.UnboundTypeArgument;\n\t\t\t\tITypeReference baseTypeRef = ToTypeReference(type.DeclaringType);\n\t\t\t\tint typeParameterCount;\n\t\t\t\tstring name = SplitTypeParameterCountFromReflectionName(type.Name, out typeParameterCount);\n\t\t\t\treturn new NestedTypeReference(baseTypeRef, name, typeParameterCount);\n\t\t\t} else {\n\t\t\t\tIAssemblyReference assemblyReference = new DefaultAssemblyReference(type.Assembly.FullName);\n\t\t\t\tint typeParameterCount;\n\t\t\t\tstring name = SplitTypeParameterCountFromReflectionName(type.Name, out typeParameterCount);\n\t\t\t\treturn new GetClassTypeReference(assemblyReference, type.Namespace, name, typeParameterCount);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region SplitTypeParameterCountFromReflectionName\n\t\t/// <summary>\n\t\t/// Removes the ` with type parameter count from the reflection name.\n\t\t/// </summary>\n\t\t/// <remarks>Do not use this method with the full name of inner classes.</remarks>\n\t\tpublic static string SplitTypeParameterCountFromReflectionName(string reflectionName)\n\t\t{\n\t\t\tint pos = reflectionName.LastIndexOf('`');\n\t\t\tif (pos < 0) {\n\t\t\t\treturn reflectionName;\n\t\t\t} else {\n\t\t\t\treturn reflectionName.Substring(0, pos);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Removes the ` with type parameter count from the reflection name.\n\t\t/// </summary>\n\t\t/// <remarks>Do not use this method with the full name of inner classes.</remarks>\n\t\tpublic static string SplitTypeParameterCountFromReflectionName(string reflectionName, out int typeParameterCount)\n\t\t{\n\t\t\tint pos = reflectionName.LastIndexOf('`');\n\t\t\tif (pos < 0) {\n\t\t\t\ttypeParameterCount = 0;\n\t\t\t\treturn reflectionName;\n\t\t\t} else {\n\t\t\t\tstring typeCount = reflectionName.Substring(pos + 1);\n\t\t\t\tif (int.TryParse(typeCount, out typeParameterCount))\n\t\t\t\t\treturn reflectionName.Substring(0, pos);\n\t\t\t\telse\n\t\t\t\t\treturn reflectionName;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region TypeCode support\n\t\t/// <summary>\n\t\t/// Retrieves a built-in type using the specified type code.\n\t\t/// </summary>\n\t\tpublic static IType FindType(this ICompilation compilation, TypeCode typeCode)\n\t\t{\n\t\t\treturn compilation.FindType((KnownTypeCode)typeCode);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a reference to the specified type.\n\t\t/// </summary>\n\t\t/// <param name=\"typeCode\">The type to be converted.</param>\n\t\t/// <returns>Returns the type reference.</returns>\n\t\tpublic static ITypeReference ToTypeReference(this TypeCode typeCode)\n\t\t{\n\t\t\treturn KnownTypeReference.Get((KnownTypeCode)typeCode);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type code for the specified type, or TypeCode.Empty if none of the other type codes match.\n\t\t/// </summary>\n\t\tpublic static TypeCode GetTypeCode(IType type)\n\t\t{\n\t\t\tITypeDefinition def = type as ITypeDefinition;\n\t\t\tif (def != null) {\n\t\t\t\tKnownTypeCode typeCode = def.KnownTypeCode;\n\t\t\t\tif (typeCode <= KnownTypeCode.String && typeCode != KnownTypeCode.Void)\n\t\t\t\t\treturn (TypeCode)typeCode;\n\t\t\t\telse\n\t\t\t\t\treturn TypeCode.Empty;\n\t\t\t}\n\t\t\treturn TypeCode.Empty;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ParseReflectionName\n\t\t/// <summary>\n\t\t/// Parses a reflection name into a type reference.\n\t\t/// </summary>\n\t\t/// <param name=\"reflectionTypeName\">The reflection name of the type.</param>\n\t\t/// <returns>A type reference that represents the reflection name.</returns>\n\t\t/// <exception cref=\"ReflectionNameParseException\">The syntax of the reflection type name is invalid</exception>\n\t\t/// <remarks>\n\t\t/// If the type is open (contains type parameters '`0' or '``0'),\n\t\t/// an <see cref=\"ITypeResolveContext\"/> with the appropriate CurrentTypeDefinition/CurrentMember is required\n\t\t/// to resolve the reference to the ITypeParameter.\n\t\t/// For looking up closed, assembly qualified type names, the root type resolve context for the compilation\n\t\t/// is sufficient.\n\t\t/// When looking up a type name that isn't assembly qualified, the type reference will look in\n\t\t/// <see cref=\"ITypeResolveContext.CurrentAssembly\"/> first, and if the type is not found there,\n\t\t/// it will look in all other assemblies of the compilation.\n\t\t/// </remarks>\n\t\t/// <seealso cref=\"FullTypeName(string)\"/>\n\t\tpublic static ITypeReference ParseReflectionName(string reflectionTypeName)\n\t\t{\n\t\t\tif (reflectionTypeName == null)\n\t\t\t\tthrow new ArgumentNullException(\"reflectionTypeName\");\n\t\t\tint pos = 0;\n\t\t\tITypeReference r = ParseReflectionName(reflectionTypeName, ref pos);\n\t\t\tif (pos < reflectionTypeName.Length)\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected end of type name\");\n\t\t\treturn r;\n\t\t}\n\t\t\n\t\tstatic bool IsReflectionNameSpecialCharacter(char c)\n\t\t{\n\t\t\tswitch (c) {\n\t\t\t\tcase '+':\n\t\t\t\tcase '`':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\tcase ',':\n\t\t\t\tcase '*':\n\t\t\t\tcase '&':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic ITypeReference ParseReflectionName(string reflectionTypeName, ref int pos)\n\t\t{\n\t\t\tif (pos == reflectionTypeName.Length)\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected end\");\n\t\t\tITypeReference reference;\n\t\t\tif (reflectionTypeName[pos] == '`') {\n\t\t\t\t// type parameter reference\n\t\t\t\tpos++;\n\t\t\t\tif (pos == reflectionTypeName.Length)\n\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected end\");\n\t\t\t\tif (reflectionTypeName[pos] == '`') {\n\t\t\t\t\t// method type parameter reference\n\t\t\t\t\tpos++;\n\t\t\t\t\tint index = ReadTypeParameterCount(reflectionTypeName, ref pos);\n\t\t\t\t\treference = TypeParameterReference.Create(SymbolKind.Method, index);\n\t\t\t\t} else {\n\t\t\t\t\t// class type parameter reference\n\t\t\t\t\tint index = ReadTypeParameterCount(reflectionTypeName, ref pos);\n\t\t\t\t\treference = TypeParameterReference.Create(SymbolKind.TypeDefinition, index);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// not a type parameter reference: read the actual type name\n\t\t\t\tint tpc;\n\t\t\t\tstring typeName = ReadTypeName(reflectionTypeName, ref pos, out tpc);\n\t\t\t\tstring assemblyName = SkipAheadAndReadAssemblyName(reflectionTypeName, pos);\n\t\t\t\treference = CreateGetClassTypeReference(assemblyName, typeName, tpc);\n\t\t\t}\n\t\t\t// read type suffixes\n\t\t\twhile (pos < reflectionTypeName.Length) {\n\t\t\t\tswitch (reflectionTypeName[pos++]) {\n\t\t\t\t\tcase '+':\n\t\t\t\t\t\tint tpc;\n\t\t\t\t\t\tstring typeName = ReadTypeName(reflectionTypeName, ref pos, out tpc);\n\t\t\t\t\t\treference = new NestedTypeReference(reference, typeName, tpc);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\treference = new PointerTypeReference(reference);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '&':\n\t\t\t\t\t\treference = new ByReferenceTypeReference(reference);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '[':\n\t\t\t\t\t\t// this might be an array or a generic type\n\t\t\t\t\t\tif (pos == reflectionTypeName.Length)\n\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected end\");\n\t\t\t\t\t\tif (reflectionTypeName[pos] == '[') {\n\t\t\t\t\t\t\t// it's a generic type\n\t\t\t\t\t\t\tList<ITypeReference> typeArguments = new List<ITypeReference>();\n\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\ttypeArguments.Add(ParseReflectionName(reflectionTypeName, ref pos));\n\t\t\t\t\t\t\tif (pos < reflectionTypeName.Length && reflectionTypeName[pos] == ']')\n\t\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected end of type argument\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile (pos < reflectionTypeName.Length && reflectionTypeName[pos] == ',') {\n\t\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\t\tif (pos < reflectionTypeName.Length && reflectionTypeName[pos] == '[')\n\t\t\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected another type argument\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttypeArguments.Add(ParseReflectionName(reflectionTypeName, ref pos));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (pos < reflectionTypeName.Length && reflectionTypeName[pos] == ']')\n\t\t\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected end of type argument\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (pos < reflectionTypeName.Length && reflectionTypeName[pos] == ']') {\n\t\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\t\treference = new ParameterizedTypeReference(reference, typeArguments);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected end of generic type\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// it's an array\n\t\t\t\t\t\t\tint dimensions = 1;\n\t\t\t\t\t\t\twhile (pos < reflectionTypeName.Length && reflectionTypeName[pos] == ',') {\n\t\t\t\t\t\t\t\tdimensions++;\n\t\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (pos < reflectionTypeName.Length && reflectionTypeName[pos] == ']') {\n\t\t\t\t\t\t\t\tpos++; // end of array\n\t\t\t\t\t\t\t\treference = new ArrayTypeReference(reference, dimensions);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Invalid array modifier\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ',':\n\t\t\t\t\t\t// assembly qualified name, ignore everything up to the end/next ']'\n\t\t\t\t\t\twhile (pos < reflectionTypeName.Length && reflectionTypeName[pos] != ']')\n\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tpos--; // reset pos to the character we couldn't read\n\t\t\t\t\t\tif (reflectionTypeName[pos] == ']')\n\t\t\t\t\t\t\treturn reference; // return from a nested generic\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new ReflectionNameParseException(pos, \"Unexpected character: '\" + reflectionTypeName[pos] + \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn reference;\n\t\t}\n\t\t\n\t\tstatic ITypeReference CreateGetClassTypeReference(string assemblyName, string typeName, int tpc)\n\t\t{\n\t\t\tIAssemblyReference assemblyReference;\n\t\t\tif (assemblyName != null) {\n\t\t\t\tassemblyReference = new DefaultAssemblyReference(assemblyName);\n\t\t\t} else {\n\t\t\t\tassemblyReference = null;\n\t\t\t}\n\t\t\tint pos = typeName.LastIndexOf('.');\n\t\t\tif (pos < 0)\n\t\t\t\treturn new GetClassTypeReference(assemblyReference, string.Empty, typeName, tpc);\n\t\t\telse\n\t\t\t\treturn new GetClassTypeReference(assemblyReference, typeName.Substring(0, pos), typeName.Substring(pos + 1), tpc);\n\t\t}\n\t\t\n\t\tstatic string SkipAheadAndReadAssemblyName(string reflectionTypeName, int pos)\n\t\t{\n\t\t\tint nestingLevel = 0;\n\t\t\twhile (pos < reflectionTypeName.Length) {\n\t\t\t\tswitch (reflectionTypeName[pos++]) {\n\t\t\t\t\tcase '[':\n\t\t\t\t\t\tnestingLevel++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ']':\n\t\t\t\t\t\tif (nestingLevel == 0)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tnestingLevel--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ',':\n\t\t\t\t\t\tif (nestingLevel == 0) {\n\t\t\t\t\t\t\t// first skip the whitespace\n\t\t\t\t\t\t\twhile (pos < reflectionTypeName.Length && reflectionTypeName[pos] == ' ')\n\t\t\t\t\t\t\t\tpos++;\n\t\t\t\t\t\t\t// everything up to the end/next ']' is the assembly name\n\t\t\t\t\t\t\tint endPos = pos;\n\t\t\t\t\t\t\twhile (endPos < reflectionTypeName.Length && reflectionTypeName[endPos] != ']')\n\t\t\t\t\t\t\t\tendPos++;\n\t\t\t\t\t\t\treturn reflectionTypeName.Substring(pos, endPos - pos);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tstatic string ReadTypeName(string reflectionTypeName, ref int pos, out int tpc)\n\t\t{\n\t\t\tint startPos = pos;\n\t\t\t// skip the simple name portion:\n\t\t\twhile (pos < reflectionTypeName.Length && !IsReflectionNameSpecialCharacter(reflectionTypeName[pos]))\n\t\t\t\tpos++;\n\t\t\tif (pos == startPos)\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected type name\");\n\t\t\tstring typeName = reflectionTypeName.Substring(startPos, pos - startPos);\n\t\t\tif (pos < reflectionTypeName.Length && reflectionTypeName[pos] == '`') {\n\t\t\t\tpos++;\n\t\t\t\ttpc = ReadTypeParameterCount(reflectionTypeName, ref pos);\n\t\t\t} else {\n\t\t\t\ttpc = 0;\n\t\t\t}\n\t\t\treturn typeName;\n\t\t}\n\t\t\n\t\tinternal static int ReadTypeParameterCount(string reflectionTypeName, ref int pos)\n\t\t{\n\t\t\tint startPos = pos;\n\t\t\twhile (pos < reflectionTypeName.Length) {\n\t\t\t\tchar c = reflectionTypeName[pos];\n\t\t\t\tif (c < '0' || c > '9')\n\t\t\t\t\tbreak;\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\tint tpc;\n\t\t\tif (!int.TryParse(reflectionTypeName.Substring(startPos, pos - startPos), out tpc))\n\t\t\t\tthrow new ReflectionNameParseException(pos, \"Expected type parameter count\");\n\t\t\treturn tpc;\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/ReflectionNameParseException.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Runtime.Serialization;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Represents an error while parsing a reflection name.\n\t/// </summary>\n\t[Serializable]\n\tpublic class ReflectionNameParseException : Exception\n\t{\n\t\tint position;\n\t\t\n\t\tpublic int Position {\n\t\t\tget { return position; }\n\t\t}\n\t\t\n\t\tpublic ReflectionNameParseException(int position)\n\t\t{\n\t\t\tthis.position = position;\n\t\t}\n\t\t\n\t\tpublic ReflectionNameParseException(int position, string message) : base(message)\n\t\t{\n\t\t\tthis.position = position;\n\t\t}\n\t\t\n\t\tpublic ReflectionNameParseException(int position, string message, Exception innerException) : base(message, innerException)\n\t\t{\n\t\t\tthis.position = position;\n\t\t}\n\t\t\n\t\t// This constructor is needed for serialization.\n\t\tprotected ReflectionNameParseException(SerializationInfo info, StreamingContext context) : base(info, context)\n\t\t{\n\t\t\tposition = info.GetInt32(\"position\");\n\t\t}\n\t\t\n\t\tpublic override void GetObjectData(SerializationInfo info, StreamingContext context)\n\t\t{\n\t\t\tbase.GetObjectData(info, context);\n\t\t\tinfo.AddValue(\"position\", position);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/SimpleTypeResolveContext.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Default ITypeResolveContext implementation.\n\t/// </summary>\n\tpublic class SimpleTypeResolveContext : ITypeResolveContext\n\t{\n\t\treadonly ICompilation compilation;\n\t\treadonly IAssembly currentAssembly;\n\t\treadonly ITypeDefinition currentTypeDefinition;\n\t\treadonly IMember currentMember;\n\t\t\n\t\tpublic SimpleTypeResolveContext(ICompilation compilation)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tthis.compilation = compilation;\n\t\t}\n\t\t\n\t\tpublic SimpleTypeResolveContext(IAssembly assembly)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tthrow new ArgumentNullException(\"assembly\");\n\t\t\tthis.compilation = assembly.Compilation;\n\t\t\tthis.currentAssembly = assembly;\n\t\t}\n\t\t\n\t\tpublic SimpleTypeResolveContext(IEntity entity)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\tthis.compilation = entity.Compilation;\n\t\t\tthis.currentAssembly = entity.ParentAssembly;\n\t\t\tthis.currentTypeDefinition = (entity as ITypeDefinition) ?? entity.DeclaringTypeDefinition;\n\t\t\tthis.currentMember = entity as IMember;\n\t\t}\n\t\t\n\t\tprivate SimpleTypeResolveContext(ICompilation compilation, IAssembly currentAssembly, ITypeDefinition currentTypeDefinition, IMember currentMember)\n\t\t{\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.currentAssembly = currentAssembly;\n\t\t\tthis.currentTypeDefinition = currentTypeDefinition;\n\t\t\tthis.currentMember = currentMember;\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return compilation; }\n\t\t}\n\t\t\n\t\tpublic IAssembly CurrentAssembly {\n\t\t\tget { return currentAssembly; }\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition CurrentTypeDefinition {\n\t\t\tget { return currentTypeDefinition; }\n\t\t}\n\t\t\n\t\tpublic IMember CurrentMember {\n\t\t\tget { return currentMember; }\n\t\t}\n\t\t\n\t\tpublic ITypeResolveContext WithCurrentTypeDefinition(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\treturn new SimpleTypeResolveContext(compilation, currentAssembly, typeDefinition, currentMember);\n\t\t}\n\t\t\n\t\tpublic ITypeResolveContext WithCurrentMember(IMember member)\n\t\t{\n\t\t\treturn new SimpleTypeResolveContext(compilation, currentAssembly, currentTypeDefinition, member);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/SpecialType.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Contains static implementations of special types.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class SpecialType : AbstractType, ITypeReference\n\t{\n\t\t/// <summary>\n\t\t/// Gets the type representing resolve errors.\n\t\t/// </summary>\n\t\tpublic readonly static SpecialType UnknownType = new SpecialType(TypeKind.Unknown, \"?\", isReferenceType: null);\n\t\t\n\t\t/// <summary>\n\t\t/// The null type is used as type of the null literal. It is a reference type without any members; and it is a subtype of all reference types.\n\t\t/// </summary>\n\t\tpublic readonly static SpecialType NullType = new SpecialType(TypeKind.Null, \"null\", isReferenceType: true);\n\t\t\n\t\t/// <summary>\n\t\t/// Type representing the C# 'dynamic' type.\n\t\t/// </summary>\n\t\tpublic readonly static SpecialType Dynamic = new SpecialType(TypeKind.Dynamic, \"dynamic\", isReferenceType: true);\n\t\t\n\t\t/// <summary>\n\t\t/// A type used for unbound type arguments in partially parameterized types.\n\t\t/// </summary>\n\t\t/// <see cref=\"IType.GetNestedTypes(Predicate{ITypeDefinition}, GetMemberOptions)\"/>\n\t\tpublic readonly static SpecialType UnboundTypeArgument = new SpecialType(TypeKind.UnboundTypeArgument, \"\", isReferenceType: null);\n\t\t\n\t\treadonly TypeKind kind;\n\t\treadonly string name;\n\t\treadonly bool? isReferenceType;\n\t\t\n\t\tprivate SpecialType(TypeKind kind, string name, bool? isReferenceType)\n\t\t{\n\t\t\tthis.kind = kind;\n\t\t\tthis.name = name;\n\t\t\tthis.isReferenceType = isReferenceType;\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tpublic override TypeKind Kind {\n\t\t\tget { return kind; }\n\t\t}\n\t\t\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget { return isReferenceType; }\n\t\t}\n\t\t\n\t\tIType ITypeReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\t#pragma warning disable 809\n\t\t[Obsolete(\"Please compare special types using the kind property instead.\")]\n\t\tpublic override bool Equals(IType other)\n\t\t{\n\t\t\t// We consider a special types equal when they have equal types.\n\t\t\t// However, an unknown type with additional information is not considered to be equal to the SpecialType with TypeKind.Unknown.\n\t\t\treturn other is SpecialType && other.Kind == kind;\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn 81625621 ^ (int)kind;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/TaskType.cs",
    "content": "﻿// Copyright (c) 2010-2014 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Helper class for dealing with System.Threading.Tasks.Task.\n\t/// </summary>\n\tpublic static class TaskType\n\t{\n\t\t/// <summary>\n\t\t/// Gets the T in Task&lt;T&gt;.\n\t\t/// Returns void for non-generic Task.\n\t\t/// Any other type is returned unmodified.\n\t\t/// </summary>\n\t\tpublic static IType UnpackTask(ICompilation compilation, IType type)\n\t\t{\n\t\t\tif (!IsTask(type))\n\t\t\t\treturn type;\n\t\t\tif (type.TypeParameterCount == 0)\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Void);\n\t\t\telse\n\t\t\t\treturn type.TypeArguments[0];\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the specified type is Task or Task&lt;T&gt;.\n\t\t/// </summary>\n\t\tpublic static bool IsTask(IType type)\n\t\t{\n\t\t\tITypeDefinition def = type.GetDefinition();\n\t\t\tif (def != null) {\n\t\t\t\tif (def.KnownTypeCode == KnownTypeCode.Task)\n\t\t\t\t\treturn true;\n\t\t\t\tif (def.KnownTypeCode == KnownTypeCode.TaskOfT)\n\t\t\t\t\treturn type is ParameterizedType;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a task type.\n\t\t/// </summary>\n\t\tpublic static IType Create(ICompilation compilation, IType elementType)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (elementType == null)\n\t\t\t\tthrow new ArgumentNullException(\"elementType\");\n\t\t\t\n\t\t\tif (elementType.Kind == TypeKind.Void)\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Task);\n\t\t\tIType taskType = compilation.FindType(KnownTypeCode.TaskOfT);\n\t\t\tITypeDefinition taskTypeDef = taskType.GetDefinition();\n\t\t\tif (taskTypeDef != null)\n\t\t\t\treturn new ParameterizedType(taskTypeDef, new [] { elementType });\n\t\t\telse\n\t\t\t\treturn taskType;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/TopLevelTypeName.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Holds the name of a top-level type.\n\t/// This struct cannot refer to nested classes.\n\t/// </summary>\n\t[Serializable]\n\tpublic struct TopLevelTypeName : IEquatable<TopLevelTypeName>\n\t{\n\t\treadonly string namespaceName;\n\t\treadonly string name;\n\t\treadonly int typeParameterCount;\n\t\t\n\t\tpublic TopLevelTypeName(string namespaceName, string name, int typeParameterCount = 0)\n\t\t{\n\t\t\tif (namespaceName == null)\n\t\t\t\tthrow new ArgumentNullException(\"namespaceName\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.namespaceName = namespaceName;\n\t\t\tthis.name = name;\n\t\t\tthis.typeParameterCount = typeParameterCount;\n\t\t}\n\t\t\n\t\tpublic TopLevelTypeName(string reflectionName)\n\t\t{\n\t\t\tint pos = reflectionName.LastIndexOf('.');\n\t\t\tif (pos < 0) {\n\t\t\t\tnamespaceName = string.Empty;\n\t\t\t\tname = reflectionName;\n\t\t\t} else {\n\t\t\t\tnamespaceName = reflectionName.Substring(0, pos);\n\t\t\t\tname = reflectionName.Substring(pos + 1);\n\t\t\t}\n\t\t\tname = ReflectionHelper.SplitTypeParameterCountFromReflectionName(name, out typeParameterCount);\n\t\t}\n\t\t\n\t\tpublic string Namespace {\n\t\t\tget { return namespaceName; }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\t\t\n\t\tpublic int TypeParameterCount {\n\t\t\tget { return typeParameterCount; }\n\t\t}\n\t\t\n\t\tpublic string ReflectionName {\n\t\t\tget {\n\t\t\t\tStringBuilder b = new StringBuilder();\n\t\t\t\tif (!string.IsNullOrEmpty(namespaceName)) {\n\t\t\t\t\tb.Append(namespaceName);\n\t\t\t\t\tb.Append('.');\n\t\t\t\t}\n\t\t\t\tb.Append(name);\n\t\t\t\tif (typeParameterCount > 0) {\n\t\t\t\t\tb.Append('`');\n\t\t\t\t\tb.Append(typeParameterCount);\n\t\t\t\t}\n\t\t\t\treturn b.ToString();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn this.ReflectionName;\n\t\t}\n\t\t\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn (obj is TopLevelTypeName) && Equals((TopLevelTypeName)obj);\n\t\t}\n\t\t\n\t\tpublic bool Equals(TopLevelTypeName other)\n\t\t{\n\t\t\treturn this.namespaceName == other.namespaceName && this.name == other.name && this.typeParameterCount == other.typeParameterCount;\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (name != null ? name.GetHashCode() : 0) ^ (namespaceName != null ? namespaceName.GetHashCode() : 0) ^ typeParameterCount;\n\t\t}\n\t\t\n\t\tpublic static bool operator ==(TopLevelTypeName lhs, TopLevelTypeName rhs)\n\t\t{\n\t\t\treturn lhs.Equals(rhs);\n\t\t}\n\t\t\n\t\tpublic static bool operator !=(TopLevelTypeName lhs, TopLevelTypeName rhs)\n\t\t{\n\t\t\treturn !lhs.Equals(rhs);\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class TopLevelTypeNameComparer : IEqualityComparer<TopLevelTypeName>\n\t{\n\t\tpublic static readonly TopLevelTypeNameComparer Ordinal = new TopLevelTypeNameComparer(StringComparer.Ordinal);\n\t\tpublic static readonly TopLevelTypeNameComparer OrdinalIgnoreCase = new TopLevelTypeNameComparer(StringComparer.OrdinalIgnoreCase);\n\t\t\n\t\tpublic readonly StringComparer NameComparer;\n\t\t\n\t\tpublic TopLevelTypeNameComparer(StringComparer nameComparer)\n\t\t{\n\t\t\tthis.NameComparer = nameComparer;\n\t\t}\n\t\t\n\t\tpublic bool Equals(TopLevelTypeName x, TopLevelTypeName y)\n\t\t{\n\t\t\treturn x.TypeParameterCount == y.TypeParameterCount\n\t\t\t\t&& NameComparer.Equals(x.Name, y.Name)\n\t\t\t\t&& NameComparer.Equals(x.Namespace, y.Namespace);\n\t\t}\n\t\t\n\t\tpublic int GetHashCode(TopLevelTypeName obj)\n\t\t{\n\t\t\treturn NameComparer.GetHashCode(obj.Name) ^ NameComparer.GetHashCode(obj.Namespace) ^ obj.TypeParameterCount;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/TypeKind.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// .\n\t/// </summary>\n\tpublic enum TypeKind : byte\n\t{\n\t\t/// <summary>Language-specific type that is not part of NRefactory.TypeSystem itself.</summary>\n\t\tOther,\n\t\t\n\t\t/// <summary>A <see cref=\"ITypeDefinition\"/> or <see cref=\"ParameterizedType\"/> that is a class.</summary>\n\t\tClass,\n\t\t/// <summary>A <see cref=\"ITypeDefinition\"/> or <see cref=\"ParameterizedType\"/> that is an interface.</summary>\n\t\tInterface,\n\t\t/// <summary>A <see cref=\"ITypeDefinition\"/> or <see cref=\"ParameterizedType\"/> that is a struct.</summary>\n\t\tStruct,\n\t\t/// <summary>A <see cref=\"ITypeDefinition\"/> or <see cref=\"ParameterizedType\"/> that is a delegate.</summary>\n\t\t/// <remarks><c>System.Delegate</c> itself is TypeKind.Class</remarks>\n\t\tDelegate,\n\t\t/// <summary>A <see cref=\"ITypeDefinition\"/> that is an enum.</summary>\n\t\t/// <remarks><c>System.Enum</c> itself is TypeKind.Class</remarks>\n\t\tEnum,\n\t\t/// <summary>A <see cref=\"ITypeDefinition\"/> that is a module (VB).</summary>\n\t\tModule,\n\t\t\n\t\t/// <summary>The <c>System.Void</c> type.</summary>\n\t\t/// <see cref=\"KnownTypeReference.Void\"/>\n\t\tVoid,\n\t\t\n\t\t/// <see cref=\"SpecialType.UnknownType\"/>\n\t\tUnknown,\n\t\t/// <summary>The type of the null literal.</summary>\n\t\t/// <see cref=\"SpecialType.NullType\"/>\n\t\tNull,\n\t\t/// <summary>Type representing the C# 'dynamic' type.</summary>\n\t\t/// <see cref=\"SpecialType.Dynamic\"/>\n\t\tDynamic,\n\t\t/// <summary>Represents missing type arguments in partially parameterized types.</summary>\n\t\t/// <see cref=\"SpecialType.UnboundTypeArgument\"/>\n\t\t/// <see cref=\"IType.GetNestedTypes(Predicate{ITypeDefinition}, GetMemberOptions)\"/>\n\t\tUnboundTypeArgument,\n\t\t\n\t\t/// <summary>The type is a type parameter.</summary>\n\t\t/// <see cref=\"ITypeParameter\"/>\n\t\tTypeParameter,\n\t\t\n\t\t/// <summary>An array type</summary>\n\t\t/// <see cref=\"ArrayType\"/>\n\t\tArray,\n\t\t/// <summary>A pointer type</summary>\n\t\t/// <see cref=\"PointerType\"/>\n\t\tPointer,\n\t\t/// <summary>A managed reference type</summary>\n\t\t/// <see cref=\"ByReferenceType\"/>\n\t\tByReference,\n\t\t/// <summary>An anonymous type</summary>\n\t\t/// <see cref=\"AnonymousType\"/>\n\t\tAnonymous,\n\t\t\n\t\t/// <summary>Intersection of several types</summary>\n\t\t/// <see cref=\"IntersectionType\"/>\n\t\tIntersection\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/TypeParameterSubstitution.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Substitutes class and method type parameters.\n\t/// </summary>\n\tpublic class TypeParameterSubstitution : TypeVisitor\n\t{\n\t\t/// <summary>\n\t\t/// The identity function.\n\t\t/// </summary>\n\t\tpublic static readonly TypeParameterSubstitution Identity = new TypeParameterSubstitution(null, null);\n\t\t\n\t\treadonly IList<IType> classTypeArguments;\n\t\treadonly IList<IType> methodTypeArguments;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new type parameter substitution.\n\t\t/// </summary>\n\t\t/// <param name=\"classTypeArguments\">\n\t\t/// The type arguments to substitute for class type parameters.\n\t\t/// Pass <c>null</c> to keep class type parameters unmodified.\n\t\t/// </param>\n\t\t/// <param name=\"methodTypeArguments\">\n\t\t/// The type arguments to substitute for method type parameters.\n\t\t/// Pass <c>null</c> to keep method type parameters unmodified.\n\t\t/// </param>\n\t\tpublic TypeParameterSubstitution(IList<IType> classTypeArguments, IList<IType> methodTypeArguments)\n\t\t{\n\t\t\tthis.classTypeArguments = classTypeArguments;\n\t\t\tthis.methodTypeArguments = methodTypeArguments;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of class type arguments.\n\t\t/// Returns <c>null</c> if this substitution keeps class type parameters unmodified.\n\t\t/// </summary>\n\t\tpublic IList<IType> ClassTypeArguments {\n\t\t\tget { return classTypeArguments; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of method type arguments.\n\t\t/// Returns <c>null</c> if this substitution keeps method type parameters unmodified.\n\t\t/// </summary>\n\t\tpublic IList<IType> MethodTypeArguments {\n\t\t\tget { return methodTypeArguments; }\n\t\t}\n\t\t\n\t\t#region Compose\n\t\t/// <summary>\n\t\t/// Computes a single TypeParameterSubstitution so that for all types <c>t</c>:\n\t\t/// <c>t.AcceptVisitor(Compose(g, f)) equals t.AcceptVisitor(f).AcceptVisitor(g)</c>\n\t\t/// </summary>\n\t\t/// <remarks>If you consider type parameter substitution to be a function, this is function composition.</remarks>\n\t\tpublic static TypeParameterSubstitution Compose(TypeParameterSubstitution g, TypeParameterSubstitution f)\n\t\t{\n\t\t\tif (g == null)\n\t\t\t\treturn f;\n\t\t\tif (f == null || (f.classTypeArguments == null && f.methodTypeArguments == null))\n\t\t\t\treturn g;\n\t\t\t// The composition is a copy of 'f', with 'g' applied on the array elements.\n\t\t\t// If 'f' has a null list (keeps type parameters unmodified), we have to treat it as\n\t\t\t// the identity function, and thus use the list from 'g'.\n\t\t\tvar classTypeArguments = f.classTypeArguments != null ? GetComposedTypeArguments(f.classTypeArguments, g) : g.classTypeArguments;\n\t\t\tvar methodTypeArguments = f.methodTypeArguments != null ? GetComposedTypeArguments(f.methodTypeArguments, g) : g.methodTypeArguments;\n\t\t\treturn new TypeParameterSubstitution(classTypeArguments, methodTypeArguments);\n\t\t}\n\t\t\n\t\tstatic IList<IType> GetComposedTypeArguments(IList<IType> input, TypeParameterSubstitution substitution)\n\t\t{\n\t\t\tIType[] result = new IType[input.Count];\n\t\t\tfor (int i = 0; i < result.Length; i++) {\n\t\t\t\tresult[i] = input[i].AcceptVisitor(substitution);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Equals and GetHashCode implementation\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tTypeParameterSubstitution other = obj as TypeParameterSubstitution;\n\t\t\tif (other == null)\n\t\t\t\treturn false;\n\t\t\treturn TypeListEquals(classTypeArguments, other.classTypeArguments)\n\t\t\t\t&& TypeListEquals(methodTypeArguments, other.methodTypeArguments);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn 1124131 * TypeListHashCode(classTypeArguments) + 1821779 * TypeListHashCode(methodTypeArguments);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool TypeListEquals(IList<IType> a, IList<IType> b)\n\t\t{\n\t\t\tif (a == b)\n\t\t\t\treturn true;\n\t\t\tif (a == null || b == null)\n\t\t\t\treturn false;\n\t\t\tif (a.Count != b.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < a.Count; i++) {\n\t\t\t\tif (!a[i].Equals(b[i]))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tstatic int TypeListHashCode(IList<IType> obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn 0;\n\t\t\tunchecked {\n\t\t\t\tint hashCode = 1;\n\t\t\t\tforeach (var element in obj) {\n\t\t\t\t\thashCode *= 27;\n\t\t\t\t\thashCode += element.GetHashCode();\n\t\t\t\t}\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override IType VisitTypeParameter(ITypeParameter type)\n\t\t{\n\t\t\tint index = type.Index;\n\t\t\tif (classTypeArguments != null && type.OwnerType == SymbolKind.TypeDefinition) {\n\t\t\t\tif (index >= 0 && index < classTypeArguments.Count)\n\t\t\t\t\treturn classTypeArguments[index];\n\t\t\t\telse\n\t\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t} else if (methodTypeArguments != null && type.OwnerType == SymbolKind.Method) {\n\t\t\t\tif (index >= 0 && index < methodTypeArguments.Count)\n\t\t\t\t\treturn methodTypeArguments[index];\n\t\t\t\telse\n\t\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t} else {\n\t\t\t\treturn base.VisitTypeParameter(type);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tb.Append('[');\n\t\t\tbool first = true;\n\t\t\tif (classTypeArguments != null) {\n\t\t\t\tfor (int i = 0; i < classTypeArguments.Count; i++) {\n\t\t\t\t\tif (first) first = false; else b.Append(\", \");\n\t\t\t\t\tb.Append('`');\n\t\t\t\t\tb.Append(i);\n\t\t\t\t\tb.Append(\" -> \");\n\t\t\t\t\tb.Append(classTypeArguments[i].ReflectionName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (methodTypeArguments != null) {\n\t\t\t\tfor (int i = 0; i < methodTypeArguments.Count; i++) {\n\t\t\t\t\tif (first) first = false; else b.Append(\", \");\n\t\t\t\t\tb.Append(\"``\");\n\t\t\t\t\tb.Append(i);\n\t\t\t\t\tb.Append(\" -> \");\n\t\t\t\t\tb.Append(methodTypeArguments[i].ReflectionName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/TypeSystemExtensions.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Contains extension methods for the type system.\n\t/// </summary>\n\tpublic static class TypeSystemExtensions\n\t{\n\t\t#region GetAllBaseTypes\n\t\t/// <summary>\n\t\t/// Gets all base types.\n\t\t/// </summary>\n\t\t/// <remarks>This is the reflexive and transitive closure of <see cref=\"IType.DirectBaseTypes\"/>.\n\t\t/// Note that this method does not return all supertypes - doing so is impossible due to contravariance\n\t\t/// (and undesirable for covariance as the list could become very large).\n\t\t/// \n\t\t/// The output is ordered so that base types occur before derived types.\n\t\t/// </remarks>\n\t\tpublic static IEnumerable<IType> GetAllBaseTypes(this IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tBaseTypeCollector collector = new BaseTypeCollector();\n\t\t\tcollector.CollectBaseTypes(type);\n\t\t\treturn collector;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all non-interface base types.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// When <paramref name=\"type\"/> is an interface, this method will also return base interfaces (return same output as GetAllBaseTypes()).\n\t\t/// \n\t\t/// The output is ordered so that base types occur before derived types.\n\t\t/// </remarks>\n\t\tpublic static IEnumerable<IType> GetNonInterfaceBaseTypes(this IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tBaseTypeCollector collector = new BaseTypeCollector();\n\t\t\tcollector.SkipImplementedInterfaces = true;\n\t\t\tcollector.CollectBaseTypes(type);\n\t\t\treturn collector;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetAllBaseTypeDefinitions\n\t\t/// <summary>\n\t\t/// Gets all base type definitions.\n\t\t/// The output is ordered so that base types occur before derived types.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This is equivalent to type.GetAllBaseTypes().Select(t => t.GetDefinition()).Where(d => d != null).Distinct().\n\t\t/// </remarks>\n\t\tpublic static IEnumerable<ITypeDefinition> GetAllBaseTypeDefinitions(this IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\t\n\t\t\treturn type.GetAllBaseTypes().Select(t => t.GetDefinition()).Where(d => d != null).Distinct();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this type definition is derived from the base type definition.\n\t\t/// </summary>\n\t\tpublic static bool IsDerivedFrom(this ITypeDefinition type, ITypeDefinition baseType)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (baseType == null)\n\t\t\t\treturn false;\n\t\t\tif (type.Compilation != baseType.Compilation) {\n\t\t\t\tthrow new InvalidOperationException(\"Both arguments to IsDerivedFrom() must be from the same compilation.\");\n\t\t\t}\n\t\t\treturn type.GetAllBaseTypeDefinitions().Contains(baseType);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this type definition is derived from a given known type.\n\t\t/// </summary>\n\t\tpublic static bool IsDerivedFrom(this ITypeDefinition type, KnownTypeCode baseType)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (baseType == KnownTypeCode.None)\n\t\t\t\treturn false;\n\t\t\treturn IsDerivedFrom(type, type.Compilation.FindType(baseType).GetDefinition());\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region IsOpen / IsUnbound / IsKnownType\n\t\tsealed class TypeClassificationVisitor : TypeVisitor\n\t\t{\n\t\t\tinternal bool isOpen;\n\t\t\tinternal IEntity typeParameterOwner;\n\t\t\tint typeParameterOwnerNestingLevel;\n\t\t\t\n\t\t\tpublic override IType VisitTypeParameter(ITypeParameter type)\n\t\t\t{\n\t\t\t\tisOpen = true;\n\t\t\t\t// If both classes and methods, or different classes (nested types)\n\t\t\t\t// are involved, find the most specific one\n\t\t\t\tint newNestingLevel = GetNestingLevel(type.Owner);\n\t\t\t\tif (newNestingLevel > typeParameterOwnerNestingLevel) {\n\t\t\t\t\ttypeParameterOwner = type.Owner;\n\t\t\t\t\ttypeParameterOwnerNestingLevel = newNestingLevel;\n\t\t\t\t}\n\t\t\t\treturn base.VisitTypeParameter(type);\n\t\t\t}\n\t\t\t\n\t\t\tstatic int GetNestingLevel(IEntity entity)\n\t\t\t{\n\t\t\t\tint level = 0;\n\t\t\t\twhile (entity != null) {\n\t\t\t\t\tlevel++;\n\t\t\t\t\tentity = entity.DeclaringTypeDefinition;\n\t\t\t\t}\n\t\t\t\treturn level;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the type is an open type (contains type parameters).\n\t\t/// </summary>\n\t\t/// <example>\n\t\t/// <code>\n\t\t/// class X&lt;T&gt; {\n\t\t///   List&lt;T&gt; open;\n\t\t///   X&lt;X&lt;T[]&gt;&gt; open;\n\t\t///   X&lt;string&gt; closed;\n\t\t///   int closed;\n\t\t/// }\n\t\t/// </code>\n\t\t/// </example>\n\t\tpublic static bool IsOpen(this IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tTypeClassificationVisitor v = new TypeClassificationVisitor();\n\t\t\ttype.AcceptVisitor(v);\n\t\t\treturn v.isOpen;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the entity that owns the type parameters occurring in the specified type.\n\t\t/// If both class and method type parameters are present, the method is returned.\n\t\t/// Returns null if the specified type is closed.\n\t\t/// </summary>\n\t\t/// <seealso cref=\"IsOpen\"/>\n\t\tstatic IEntity GetTypeParameterOwner(IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tTypeClassificationVisitor v = new TypeClassificationVisitor();\n\t\t\ttype.AcceptVisitor(v);\n\t\t\treturn v.typeParameterOwner;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the type is unbound (is a generic type, but no type arguments were provided).\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// In \"<c>typeof(List&lt;Dictionary&lt;,&gt;&gt;)</c>\", only the Dictionary is unbound, the List is considered\n\t\t/// bound despite containing an unbound type.\n\t\t/// This method returns false for partially parameterized types (<c>Dictionary&lt;string, &gt;</c>).\n\t\t/// </remarks>\n\t\tpublic static bool IsUnbound(this IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\treturn type is ITypeDefinition && type.TypeParameterCount > 0;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the type is the specified known type.\n\t\t/// For generic known types, this returns true any parameterization of the type (and also for the definition itself).\n\t\t/// </summary>\n\t\tpublic static bool IsKnownType(this IType type, KnownTypeCode knownType)\n\t\t{\n\t\t\tvar def = type.GetDefinition();\n\t\t\treturn def != null && def.KnownTypeCode == knownType;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Import\n\t\t/// <summary>\n\t\t/// Imports a symbol from another compilation.\n\t\t/// </summary>\n\t\tpublic static ISymbol Import(this ICompilation compilation, ISymbol symbol)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (symbol == null)\n\t\t\t\treturn null;\n\t\t\tswitch (symbol.SymbolKind) {\n\t\t\t\tcase SymbolKind.TypeParameter:\n\t\t\t\t\treturn (ITypeParameter)Import(compilation, (IType)symbol);\n\t\t\t\tcase SymbolKind.Variable:\n\t\t\t\t\tIVariable v = (IVariable)symbol;\n\t\t\t\t\treturn new DefaultVariable(\n\t\t\t\t\t\tImport(compilation, v.Type),\n\t\t\t\t\t\tv.Name, v.Region, v.IsConst, v.ConstantValue\n\t\t\t\t\t);\n\t\t\t\tcase SymbolKind.Parameter:\n\t\t\t\t\tIParameter p = (IParameter)symbol;\n\t\t\t\t\tif (p.Owner != null) {\n\t\t\t\t\t\tint index = p.Owner.Parameters.IndexOf(p);\n\t\t\t\t\t\tvar owner = (IParameterizedMember)Import(compilation, p.Owner);\n\t\t\t\t\t\tif (owner == null || index < 0 || index >= owner.Parameters.Count)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\treturn owner.Parameters[index];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new DefaultParameter(\n\t\t\t\t\t\t\tImport(compilation, p.Type),\n\t\t\t\t\t\t\tp.Name, null, p.Region,\n\t\t\t\t\t\t\tnull, p.IsRef, p.IsOut, p.IsParams\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\tcase SymbolKind.Namespace:\n\t\t\t\t\treturn Import(compilation, (INamespace)symbol);\n\t\t\t\tdefault:\n\t\t\t\t\tif (symbol is IEntity)\n\t\t\t\t\t\treturn Import(compilation, (IEntity)symbol);\n\t\t\t\t\tthrow new NotSupportedException(\"Unsupported symbol kind: \" + symbol.SymbolKind);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a type from another compilation.\n\t\t/// </summary>\n\t\tpublic static IType Import(this ICompilation compilation, IType type)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\t\t\tvar compilationProvider = type as ICompilationProvider;\n\t\t\tif (compilationProvider != null && compilationProvider.Compilation == compilation)\n\t\t\t\treturn type;\n\t\t\tIEntity typeParameterOwner = GetTypeParameterOwner(type);\n\t\t\tIEntity importedTypeParameterOwner = compilation.Import(typeParameterOwner);\n\t\t\tif (importedTypeParameterOwner != null) {\n\t\t\t\treturn type.ToTypeReference().Resolve(new SimpleTypeResolveContext(importedTypeParameterOwner));\n\t\t\t} else {\n\t\t\t\treturn type.ToTypeReference().Resolve(compilation.TypeResolveContext);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a type from another compilation.\n\t\t/// </summary>\n\t\tpublic static ITypeDefinition Import(this ICompilation compilation, ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (typeDefinition == null)\n\t\t\t\treturn null;\n\t\t\tif (typeDefinition.Compilation == compilation)\n\t\t\t\treturn typeDefinition;\n\t\t\treturn typeDefinition.ToTypeReference().Resolve(compilation.TypeResolveContext).GetDefinition();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports an entity from another compilation.\n\t\t/// </summary>\n\t\tpublic static IEntity Import(this ICompilation compilation, IEntity entity)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (entity == null)\n\t\t\t\treturn null;\n\t\t\tif (entity.Compilation == compilation)\n\t\t\t\treturn entity;\n\t\t\tif (entity is IMember)\n\t\t\t\treturn ((IMember)entity).ToReference().Resolve(compilation.TypeResolveContext);\n\t\t\telse if (entity is ITypeDefinition)\n\t\t\t\treturn ((ITypeDefinition)entity).ToTypeReference().Resolve(compilation.TypeResolveContext).GetDefinition();\n\t\t\telse\n\t\t\t\tthrow new NotSupportedException(\"Unknown entity type\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a member from another compilation.\n\t\t/// </summary>\n\t\tpublic static IMember Import(this ICompilation compilation, IMember member)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (member == null)\n\t\t\t\treturn null;\n\t\t\tif (member.Compilation == compilation)\n\t\t\t\treturn member;\n\t\t\treturn member.ToReference().Resolve(compilation.TypeResolveContext);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a member from another compilation.\n\t\t/// </summary>\n\t\tpublic static IMethod Import(this ICompilation compilation, IMethod method)\n\t\t{\n\t\t\treturn (IMethod)compilation.Import((IMember)method);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a member from another compilation.\n\t\t/// </summary>\n\t\tpublic static IField Import(this ICompilation compilation, IField field)\n\t\t{\n\t\t\treturn (IField)compilation.Import((IMember)field);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a member from another compilation.\n\t\t/// </summary>\n\t\tpublic static IEvent Import(this ICompilation compilation, IEvent ev)\n\t\t{\n\t\t\treturn (IEvent)compilation.Import((IMember)ev);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a member from another compilation.\n\t\t/// </summary>\n\t\tpublic static IProperty Import(this ICompilation compilation, IProperty property)\n\t\t{\n\t\t\treturn (IProperty)compilation.Import((IMember)property);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Imports a namespace from another compilation.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method may return null if the namespace does not exist in the target compilation.\n\t\t/// </remarks>\n\t\tpublic static INamespace Import(this ICompilation compilation, INamespace ns)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (ns == null)\n\t\t\t\treturn null;\n\t\t\tif (ns.ParentNamespace == null) {\n\t\t\t\t// root namespace\n\t\t\t\treturn compilation.GetNamespaceForExternAlias(ns.ExternAlias);\n\t\t\t} else {\n\t\t\t\tINamespace parent = Import(compilation, ns.ParentNamespace);\n\t\t\t\tif (parent != null)\n\t\t\t\t\treturn parent.GetChildNamespace(ns.Name);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetDelegateInvokeMethod\n\t\t/// <summary>\n\t\t/// Gets the invoke method for a delegate type.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Returns null if the type is not a delegate type; or if the invoke method could not be found.\n\t\t/// </remarks>\n\t\tpublic static IMethod GetDelegateInvokeMethod(this IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (type.Kind == TypeKind.Delegate)\n\t\t\t\treturn type.GetMethods(m => m.Name == \"Invoke\", GetMemberOptions.IgnoreInheritedMembers).FirstOrDefault();\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetType/Member\n\t\t/// <summary>\n\t\t/// Gets all unresolved type definitions from the file.\n\t\t/// For partial classes, each part is returned.\n\t\t/// </summary>\n\t\tpublic static IEnumerable<IUnresolvedTypeDefinition> GetAllTypeDefinitions (this IUnresolvedFile file)\n\t\t{\n\t\t\treturn TreeTraversal.PreOrder(file.TopLevelTypeDefinitions, t => t.NestedTypes);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all unresolved type definitions from the assembly.\n\t\t/// For partial classes, each part is returned.\n\t\t/// </summary>\n\t\tpublic static IEnumerable<IUnresolvedTypeDefinition> GetAllTypeDefinitions (this IUnresolvedAssembly assembly)\n\t\t{\n\t\t\treturn TreeTraversal.PreOrder(assembly.TopLevelTypeDefinitions, t => t.NestedTypes);\n\t\t}\n\t\t\n\t\tpublic static IEnumerable<ITypeDefinition> GetAllTypeDefinitions (this IAssembly assembly)\n\t\t{\n\t\t\treturn TreeTraversal.PreOrder(assembly.TopLevelTypeDefinitions, t => t.NestedTypes);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all type definitions in the compilation.\n\t\t/// This may include types from referenced assemblies that are not accessible in the main assembly.\n\t\t/// </summary>\n\t\tpublic static IEnumerable<ITypeDefinition> GetAllTypeDefinitions (this ICompilation compilation)\n\t\t{\n\t\t\treturn compilation.Assemblies.SelectMany(a => a.GetAllTypeDefinitions());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets all top level type definitions in the compilation.\n\t\t/// This may include types from referenced assemblies that are not accessible in the main assembly.\n\t\t/// </summary>\n\t\tpublic static IEnumerable<ITypeDefinition> GetTopLevelTypeDefinitons (this ICompilation compilation)\n\t\t{\n\t\t\treturn compilation.Assemblies.SelectMany(a => a.TopLevelTypeDefinitions);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type (potentially a nested type) defined at the specified location.\n\t\t/// Returns null if no type is defined at that location.\n\t\t/// </summary>\n\t\tpublic static IUnresolvedTypeDefinition GetInnermostTypeDefinition (this IUnresolvedFile file, int line, int column)\n\t\t{\n\t\t\treturn file.GetInnermostTypeDefinition (new TextLocation (line, column));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the member defined at the specified location.\n\t\t/// Returns null if no member is defined at that location.\n\t\t/// </summary>\n\t\tpublic static IUnresolvedMember GetMember (this IUnresolvedFile file, int line, int column)\n\t\t{\n\t\t\treturn file.GetMember (new TextLocation (line, column));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Resolve on collections\n\t\tpublic static IList<IAttribute> CreateResolvedAttributes(this IList<IUnresolvedAttribute> attributes, ITypeResolveContext context)\n\t\t{\n\t\t\tif (attributes == null)\n\t\t\t\tthrow new ArgumentNullException(\"attributes\");\n\t\t\tif (attributes.Count == 0)\n\t\t\t\treturn EmptyList<IAttribute>.Instance;\n\t\t\telse\n\t\t\t\treturn new ProjectedList<ITypeResolveContext, IUnresolvedAttribute, IAttribute>(context, attributes, (c, a) => a.CreateResolvedAttribute(c));\n\t\t}\n\t\t\n\t\tpublic static IList<ITypeParameter> CreateResolvedTypeParameters(this IList<IUnresolvedTypeParameter> typeParameters, ITypeResolveContext context)\n\t\t{\n\t\t\tif (typeParameters == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeParameters\");\n\t\t\tif (typeParameters.Count == 0)\n\t\t\t\treturn EmptyList<ITypeParameter>.Instance;\n\t\t\telse\n\t\t\t\treturn new ProjectedList<ITypeResolveContext, IUnresolvedTypeParameter, ITypeParameter>(context, typeParameters, (c, a) => a.CreateResolvedTypeParameter(c));\n\t\t}\n\t\t\n\t\tpublic static IList<IParameter> CreateResolvedParameters(this IList<IUnresolvedParameter> parameters, ITypeResolveContext context)\n\t\t{\n\t\t\tif (parameters == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameters\");\n\t\t\tif (parameters.Count == 0)\n\t\t\t\treturn EmptyList<IParameter>.Instance;\n\t\t\telse\n\t\t\t\treturn new ProjectedList<ITypeResolveContext, IUnresolvedParameter, IParameter>(context, parameters, (c, a) => a.CreateResolvedParameter(c));\n\t\t}\n\t\t\n\t\tpublic static IList<IType> Resolve(this IList<ITypeReference> typeReferences, ITypeResolveContext context)\n\t\t{\n\t\t\tif (typeReferences == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeReferences\");\n\t\t\tif (typeReferences.Count == 0)\n\t\t\t\treturn EmptyList<IType>.Instance;\n\t\t\telse\n\t\t\t\treturn new ProjectedList<ITypeResolveContext, ITypeReference, IType>(context, typeReferences, (c, t) => t.Resolve(c));\n\t\t}\n\t\t\n\t\t// There is intentionally no Resolve() overload for IList<IMemberReference>: the resulting IList<Member> would\n\t\t// contains nulls when there are resolve errors.\n\t\t\n\t\tpublic static IList<ResolveResult> Resolve(this IList<IConstantValue> constantValues, ITypeResolveContext context)\n\t\t{\n\t\t\tif (constantValues == null)\n\t\t\t\tthrow new ArgumentNullException(\"constantValues\");\n\t\t\tif (constantValues.Count == 0)\n\t\t\t\treturn EmptyList<ResolveResult>.Instance;\n\t\t\telse\n\t\t\t\treturn new ProjectedList<ITypeResolveContext, IConstantValue, ResolveResult>(context, constantValues, (c, t) => t.Resolve(c));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetSubTypeDefinitions\n\t\tpublic static IEnumerable<ITypeDefinition> GetSubTypeDefinitions (this IType baseType)\n\t\t{\n\t\t\tif (baseType == null)\n\t\t\t\tthrow new ArgumentNullException (\"baseType\");\n\t\t\tvar def = baseType.GetDefinition ();\n\t\t\tif (def == null)\n\t\t\t\treturn Enumerable.Empty<ITypeDefinition> ();\n\t\t\treturn def.GetSubTypeDefinitions ();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all sub type definitions defined in a context.\n\t\t/// </summary>\n\t\tpublic static IEnumerable<ITypeDefinition> GetSubTypeDefinitions (this ITypeDefinition baseType)\n\t\t{\n\t\t\tif (baseType == null)\n\t\t\t\tthrow new ArgumentNullException (\"baseType\");\n\t\t\tforeach (var contextType in baseType.Compilation.GetAllTypeDefinitions ()) {\n\t\t\t\tif (contextType.IsDerivedFrom (baseType))\n\t\t\t\t\tyield return contextType;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region IAssembly.GetTypeDefinition()\n\t\t/// <summary>\n\t\t/// Retrieves the specified type in this compilation.\n\t\t/// Returns an <see cref=\"UnknownType\"/> if the type cannot be found in this compilation.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// There can be multiple types with the same full name in a compilation, as a\n\t\t/// full type name is only unique per assembly.\n\t\t/// If there are multiple possible matches, this method will return just one of them.\n\t\t/// When possible, use <see cref=\"IAssembly.GetTypeDefinition\"/> instead to\n\t\t/// retrieve a type from a specific assembly.\n\t\t/// </remarks>\n\t\tpublic static IType FindType(this ICompilation compilation, FullTypeName fullTypeName)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tforeach (IAssembly asm in compilation.Assemblies) {\n\t\t\t\tITypeDefinition def = asm.GetTypeDefinition(fullTypeName);\n\t\t\t\tif (def != null)\n\t\t\t\t\treturn def;\n\t\t\t}\n\t\t\treturn new UnknownType(fullTypeName);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type definition for the specified unresolved type.\n\t\t/// Returns null if the unresolved type does not belong to this assembly.\n\t\t/// </summary>\n\t\tpublic static ITypeDefinition GetTypeDefinition(this IAssembly assembly, FullTypeName fullTypeName)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tthrow new ArgumentNullException(\"assembly\");\n\t\t\tTopLevelTypeName topLevelTypeName = fullTypeName.TopLevelTypeName;\n\t\t\tITypeDefinition typeDef = assembly.GetTypeDefinition(topLevelTypeName);\n\t\t\tif (typeDef == null)\n\t\t\t\treturn null;\n\t\t\tint typeParameterCount = topLevelTypeName.TypeParameterCount;\n\t\t\tfor (int i = 0; i < fullTypeName.NestingLevel; i++) {\n\t\t\t\tstring name = fullTypeName.GetNestedTypeName(i);\n\t\t\t\ttypeParameterCount += fullTypeName.GetNestedTypeAdditionalTypeParameterCount(i);\n\t\t\t\ttypeDef = FindNestedType(typeDef, name, typeParameterCount);\n\t\t\t\tif (typeDef == null)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn typeDef;\n\t\t}\n\t\t\n\t\tstatic ITypeDefinition FindNestedType(ITypeDefinition typeDef, string name, int typeParameterCount)\n\t\t{\n\t\t\tforeach (var nestedType in typeDef.NestedTypes) {\n\t\t\t\tif (nestedType.Name == name && nestedType.TypeParameterCount == typeParameterCount)\n\t\t\t\t\treturn nestedType;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\n\t\t#region ITypeReference.Resolve(ICompilation)\n\n\t\t/// <summary>\n\t\t/// Resolves a type reference in the compilation's main type resolve context.\n\t\t/// Some type references require a more specific type resolve context and will not resolve using this method.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Returns the resolved type.\n\t\t/// In case of an error, returns <see cref=\"SpecialType.UnknownType\"/>.\n\t\t/// Never returns null.\n\t\t/// </returns>\n\t\tpublic static IType Resolve (this ITypeReference reference, ICompilation compilation)\n\t\t{\n\t\t\tif (reference == null)\n\t\t\t\tthrow new ArgumentNullException (\"reference\");\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException (\"compilation\");\n\t\t\treturn reference.Resolve (compilation.TypeResolveContext);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ITypeDefinition.GetAttribute\n\t\t/// <summary>\n\t\t/// Gets the attribute of the specified attribute type (or derived attribute types).\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity on which the attributes are declared.</param>\n\t\t/// <param name=\"attributeType\">The attribute type to look for.</param>\n\t\t/// <param name=\"inherit\">\n\t\t/// Specifies whether attributes inherited from base classes and base members (if the given <paramref name=\"entity\"/> in an <c>override</c>)\n\t\t/// should be returned. The default is <c>true</c>.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the attribute that was found; or <c>null</c> if none was found.\n\t\t/// If inherit is true, an from the entity itself will be returned if possible;\n\t\t/// and the base entity will only be searched if none exists.\n\t\t/// </returns>\n\t\tpublic static IAttribute GetAttribute(this IEntity entity, IType attributeType, bool inherit = true)\n\t\t{\n\t\t\treturn GetAttributes(entity, attributeType, inherit).FirstOrDefault();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attributes of the specified attribute type (or derived attribute types).\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity on which the attributes are declared.</param>\n\t\t/// <param name=\"attributeType\">The attribute type to look for.</param>\n\t\t/// <param name=\"inherit\">\n\t\t/// Specifies whether attributes inherited from base classes and base members (if the given <paramref name=\"entity\"/> in an <c>override</c>)\n\t\t/// should be returned. The default is <c>true</c>.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the list of attributes that were found.\n\t\t/// If inherit is true, attributes from the entity itself are returned first; followed by attributes inherited from the base entity.\n\t\t/// </returns>\n\t\tpublic static IEnumerable<IAttribute> GetAttributes(this IEntity entity, IType attributeType, bool inherit = true)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\tif (attributeType == null)\n\t\t\t\tthrow new ArgumentNullException(\"attributeType\");\n\t\t\treturn GetAttributes(entity, attributeType.Equals, inherit);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attribute of the specified attribute type (or derived attribute types).\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity on which the attributes are declared.</param>\n\t\t/// <param name=\"attributeType\">The attribute type to look for.</param>\n\t\t/// <param name=\"inherit\">\n\t\t/// Specifies whether attributes inherited from base classes and base members (if the given <paramref name=\"entity\"/> in an <c>override</c>)\n\t\t/// should be returned. The default is <c>true</c>.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the attribute that was found; or <c>null</c> if none was found.\n\t\t/// If inherit is true, an from the entity itself will be returned if possible;\n\t\t/// and the base entity will only be searched if none exists.\n\t\t/// </returns>\n\t\tpublic static IAttribute GetAttribute(this IEntity entity, FullTypeName attributeType, bool inherit = true)\n\t\t{\n\t\t\treturn GetAttributes(entity, attributeType, inherit).FirstOrDefault();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attributes of the specified attribute type (or derived attribute types).\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity on which the attributes are declared.</param>\n\t\t/// <param name=\"attributeType\">The attribute type to look for.</param>\n\t\t/// <param name=\"inherit\">\n\t\t/// Specifies whether attributes inherited from base classes and base members (if the given <paramref name=\"entity\"/> in an <c>override</c>)\n\t\t/// should be returned. The default is <c>true</c>.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the list of attributes that were found.\n\t\t/// If inherit is true, attributes from the entity itself are returned first; followed by attributes inherited from the base entity.\n\t\t/// </returns>\n\t\tpublic static IEnumerable<IAttribute> GetAttributes(this IEntity entity, FullTypeName attributeType, bool inherit = true)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\treturn GetAttributes(entity, attrType => {\n\t\t\t                     \tITypeDefinition typeDef = attrType.GetDefinition();\n\t\t\t                     \treturn typeDef != null && typeDef.FullTypeName == attributeType;\n\t\t\t                     }, inherit);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the attribute of the specified attribute type (or derived attribute types).\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity on which the attributes are declared.</param>\n\t\t/// <param name=\"inherit\">\n\t\t/// Specifies whether attributes inherited from base classes and base members (if the given <paramref name=\"entity\"/> in an <c>override</c>)\n\t\t/// should be returned. The default is <c>true</c>.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// Returns the attribute that was found; or <c>null</c> if none was found.\n\t\t/// If inherit is true, an from the entity itself will be returned if possible;\n\t\t/// and the base entity will only be searched if none exists.\n\t\t/// </returns>\n\t\tpublic static IEnumerable<IAttribute> GetAttributes(this IEntity entity, bool inherit = true)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException (\"entity\");\n\t\t\treturn GetAttributes(entity, a => true, inherit);\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IAttribute> GetAttributes(IEntity entity, Predicate<IType> attributeTypePredicate, bool inherit)\n\t\t{\n\t\t\tif (!inherit) {\n\t\t\t\tforeach (var attr in entity.Attributes) {\n\t\t\t\t\tif (attributeTypePredicate(attr.AttributeType))\n\t\t\t\t\t\tyield return attr;\n\t\t\t\t}\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tITypeDefinition typeDef = entity as ITypeDefinition;\n\t\t\tif (typeDef != null) {\n\t\t\t\tforeach (var baseType in typeDef.GetNonInterfaceBaseTypes().Reverse()) {\n\t\t\t\t\tITypeDefinition baseTypeDef = baseType.GetDefinition();\n\t\t\t\t\tif (baseTypeDef == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tforeach (var attr in baseTypeDef.Attributes) {\n\t\t\t\t\t\tif (attributeTypePredicate(attr.AttributeType))\n\t\t\t\t\t\t\tyield return attr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tIMember member = entity as IMember;\n\t\t\tif (member != null) {\n\t\t\t\tHashSet<IMember> visitedMembers = new HashSet<IMember>();\n\t\t\t\tdo {\n\t\t\t\t\tmember = member.MemberDefinition; // it's sufficient to look at the definitions\n\t\t\t\t\tif (!visitedMembers.Add(member)) {\n\t\t\t\t\t\t// abort if we seem to be in an infinite loop (cyclic inheritance)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tforeach (var attr in member.Attributes) {\n\t\t\t\t\t\tif (attributeTypePredicate(attr.AttributeType))\n\t\t\t\t\t\t\tyield return attr;\n\t\t\t\t\t}\n\t\t\t\t} while (member.IsOverride && (member = InheritanceHelper.GetBaseMember(member)) != null);\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tthrow new NotSupportedException(\"Unknown entity type\");\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region IAssembly.GetTypeDefinition(string,string,int)\n\t\t/// <summary>\n\t\t/// Gets the type definition for a top-level type.\n\t\t/// </summary>\n\t\t/// <remarks>This method uses ordinal name comparison, not the compilation's name comparer.</remarks>\n\t\tpublic static ITypeDefinition GetTypeDefinition(this IAssembly assembly, string namespaceName, string name, int typeParameterCount = 0)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tthrow new ArgumentNullException (\"assembly\");\n\t\t\treturn assembly.GetTypeDefinition (new TopLevelTypeName (namespaceName, name, typeParameterCount));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveResult\n\t\tpublic static ISymbol GetSymbol(this ResolveResult rr)\n\t\t{\n\t\t\tif (rr is LocalResolveResult) {\n\t\t\t\treturn ((LocalResolveResult)rr).Variable;\n\t\t\t} else if (rr is MemberResolveResult) {\n\t\t\t\treturn ((MemberResolveResult)rr).Member;\n\t\t\t} else if (rr is TypeResolveResult) {\n\t\t\t\treturn ((TypeResolveResult)rr).Type.GetDefinition();\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/TypeSystem/TypeVisitor.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Base class for the visitor pattern on <see cref=\"IType\"/>.\n\t/// </summary>\n\tpublic abstract class TypeVisitor\n\t{\n\t\tpublic virtual IType VisitTypeDefinition(ITypeDefinition type)\n\t\t{\n\t\t\treturn type.VisitChildren(this);\n\t\t}\n\t\t\n\t\tpublic virtual IType VisitTypeParameter(ITypeParameter type)\n\t\t{\n\t\t\treturn type.VisitChildren(this);\n\t\t}\n\t\t\n\t\tpublic virtual IType VisitParameterizedType(ParameterizedType type)\n\t\t{\n\t\t\treturn type.VisitChildren(this);\n\t\t}\n\t\t\n\t\tpublic virtual IType VisitArrayType(ArrayType type)\n\t\t{\n\t\t\treturn type.VisitChildren(this);\n\t\t}\n\t\t\n\t\tpublic virtual IType VisitPointerType(PointerType type)\n\t\t{\n\t\t\treturn type.VisitChildren(this);\n\t\t}\n\t\t\n\t\tpublic virtual IType VisitByReferenceType(ByReferenceType type)\n\t\t{\n\t\t\treturn type.VisitChildren(this);\n\t\t}\n\t\t\n\t\tpublic virtual IType VisitOtherType(IType type)\n\t\t{\n\t\t\treturn type.VisitChildren(this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/7BitEncodedInts.cs",
    "content": "﻿// Copyright (c) 2011 Daniel Grunwald\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// A binary reader that can read the output of BinaryWriterWith7BitEncodedInts.\n\t/// </summary>\n\tpublic sealed class BinaryReaderWith7BitEncodedInts : BinaryReader\n\t{\n\t\tpublic BinaryReaderWith7BitEncodedInts(Stream stream) : base(stream)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override short ReadInt16()\n\t\t{\n\t\t\treturn unchecked((short)(ushort)base.Read7BitEncodedInt());\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic override ushort ReadUInt16()\n\t\t{\n\t\t\treturn unchecked((ushort)base.Read7BitEncodedInt());\n\t\t}\n\t\t\n\t\tpublic override int ReadInt32()\n\t\t{\n\t\t\treturn base.Read7BitEncodedInt();\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic override uint ReadUInt32()\n\t\t{\n\t\t\treturn unchecked((uint)base.Read7BitEncodedInt());\n\t\t}\n\t\t\n\t\tpublic override long ReadInt64()\n\t\t{\n\t\t\treturn unchecked((long)this.ReadUInt64());\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic override ulong ReadUInt64()\n\t\t{\n\t\t\tulong num = 0;\n\t\t\tint shift = 0;\n\t\t\twhile (shift < 64) {\n\t\t\t\tbyte b = this.ReadByte();\n\t\t\t\tnum |= (ulong)(b & 127) << shift;\n\t\t\t\tshift += 7;\n\t\t\t\tif ((b & 128) == 0) {\n\t\t\t\t\treturn num;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new FormatException(\"Invalid 7-bit int64\");\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// A binary writer that encodes all integers as 7-bit-encoded-ints.\n\t/// </summary>\n\tpublic sealed class BinaryWriterWith7BitEncodedInts : BinaryWriter\n\t{\n\t\tpublic BinaryWriterWith7BitEncodedInts(Stream stream) : base(stream)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void Write(short value)\n\t\t{\n\t\t\tbase.Write7BitEncodedInt(unchecked((ushort)value));\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic override void Write(ushort value)\n\t\t{\n\t\t\tbase.Write7BitEncodedInt(value);\n\t\t}\n\t\t\n\t\tpublic override void Write(int value)\n\t\t{\n\t\t\tbase.Write7BitEncodedInt(value);\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic override void Write(uint value)\n\t\t{\n\t\t\tbase.Write7BitEncodedInt(unchecked((int)value));\n\t\t}\n\t\t\n\t\tpublic override void Write(long value)\n\t\t{\n\t\t\tthis.Write(unchecked((ulong)value));\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic override void Write(ulong value)\n\t\t{\n\t\t\twhile (value >= 128) {\n\t\t\t\tthis.Write(unchecked((byte)(value | 128u)));\n\t\t\t\tvalue >>= 7;\n\t\t\t}\n\t\t\tthis.Write(unchecked((byte)value));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/BitVector16.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Holds 16 boolean values.\n\t/// </summary>\n\t[Serializable]\n\t[CLSCompliant(false)]\n\tpublic struct BitVector16 : IEquatable<BitVector16>\n\t{\n\t\tushort data;\n\t\t\n\t\tpublic bool this[ushort mask] {\n\t\t\tget { return (data & mask) != 0; }\n\t\t\tset {\n\t\t\t\tif (value)\n\t\t\t\t\tdata |= mask;\n\t\t\t\telse\n\t\t\t\t\tdata &= unchecked((ushort)~mask);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ushort Data {\n\t\t\tget { return data; }\n\t\t\tset { data = value; }\n\t\t}\n\t\t\n\t\t#region Equals and GetHashCode implementation\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (obj is BitVector16)\n\t\t\t\treturn Equals((BitVector16)obj); // use Equals method below\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic bool Equals(BitVector16 other)\n\t\t{\n\t\t\treturn this.data == other.data;\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn data;\n\t\t}\n\t\t\n\t\tpublic static bool operator ==(BitVector16 left, BitVector16 right)\n\t\t{\n\t\t\treturn left.data == right.data;\n\t\t}\n\t\t\n\t\tpublic static bool operator !=(BitVector16 left, BitVector16 right)\n\t\t{\n\t\t\treturn left.data != right.data;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn data.ToString(\"x4\", CultureInfo.InvariantCulture);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/BusyManager.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// This class is used to prevent stack overflows by representing a 'busy' flag\n\t/// that prevents reentrance when another call is running.\n\t/// However, using a simple 'bool busy' is not thread-safe, so we use a\n\t/// thread-static BusyManager.\n\t/// </summary>\n\tpublic static class BusyManager\n\t{\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Performance\", \"CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes\")]\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1034:NestedTypesShouldNotBeVisible\",\n\t\t                                                 Justification = \"Should always be used with 'var'\")]\n\t\tpublic struct BusyLock : IDisposable\n\t\t{\n\t\t\tpublic static readonly BusyLock Failed = new BusyLock(null);\n\t\t\t\n\t\t\treadonly List<object> objectList;\n\t\t\t\n\t\t\tinternal BusyLock(List<object> objectList)\n\t\t\t{\n\t\t\t\tthis.objectList = objectList;\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool Success {\n\t\t\t\tget { return objectList != null; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tif (objectList != null) {\n\t\t\t\t\tobjectList.RemoveAt(objectList.Count - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[ThreadStatic] static List<object> _activeObjects;\n\t\t\n\t\tpublic static BusyLock Enter(object obj)\n\t\t{\n\t\t\tList<object> activeObjects = _activeObjects;\n\t\t\tif (activeObjects == null)\n\t\t\t\tactiveObjects = _activeObjects = new List<object>();\n\t\t\tfor (int i = 0; i < activeObjects.Count; i++) {\n\t\t\t\tif (activeObjects[i] == obj)\n\t\t\t\t\treturn BusyLock.Failed;\n\t\t\t}\n\t\t\tactiveObjects.Add(obj);\n\t\t\treturn new BusyLock(activeObjects);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CSharpPrimitiveCast.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Static helper method for converting between primitive types.\n\t/// </summary>\n\tpublic static class CSharpPrimitiveCast\n\t{\n\t\t/// <summary>\n\t\t/// Performs a conversion between primitive types.\n\t\t/// Unfortunately we cannot use Convert.ChangeType because it has different semantics\n\t\t/// (e.g. rounding behavior for floats, overflow, etc.), so we write down every possible primitive C# cast\n\t\t/// and let the compiler figure out the exact semantics.\n\t\t/// And we have to do everything twice, once in a checked-block, once in an unchecked-block.\n\t\t/// </summary>\n\t\t/// <exception cref=\"OverflowException\">Overflow checking is enabled and an overflow occurred.</exception>\n\t\t/// <exception cref=\"InvalidCastException\">The cast is invalid, e.g. casting a boolean to an integer.</exception>\n\t\tpublic static object Cast(TypeCode targetType, object input, bool checkForOverflow)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\treturn null;\n\t\t\tif (checkForOverflow)\n\t\t\t\treturn CSharpPrimitiveCastChecked(targetType, input);\n\t\t\telse\n\t\t\t\treturn CSharpPrimitiveCastUnchecked(targetType, input);\n\t\t}\n\t\t\n\t\tstatic object CSharpPrimitiveCastChecked(TypeCode targetType, object input)\n\t\t{\n\t\t\tchecked {\n\t\t\t\tTypeCode sourceType = Type.GetTypeCode(input.GetType());\n\t\t\t\tif (sourceType == targetType)\n\t\t\t\t\treturn input;\n\t\t\t\tswitch (targetType) {\n\t\t\t\t\tcase TypeCode.Char:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (char)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (char)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (char)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (char)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (char)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (char)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (char)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (char)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (char)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (char)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (char)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (sbyte)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (sbyte)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (sbyte)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (sbyte)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (sbyte)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (sbyte)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (sbyte)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (sbyte)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (sbyte)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (sbyte)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (sbyte)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (byte)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (byte)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (byte)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (byte)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (byte)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (byte)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (byte)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (byte)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (byte)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (byte)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (byte)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (short)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (short)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (short)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (short)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (short)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (short)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (short)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (short)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (short)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (short)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (short)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (ushort)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (ushort)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (ushort)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (ushort)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (ushort)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (ushort)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (ushort)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (ushort)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (ushort)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (ushort)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (ushort)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (int)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (int)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (int)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (int)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (int)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (int)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (int)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (int)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (int)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (int)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (int)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (uint)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (uint)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (uint)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (uint)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (uint)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (uint)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (uint)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (uint)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (uint)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (uint)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (uint)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (long)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (long)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (long)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (long)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (long)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (long)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (long)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (long)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (long)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (long)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (long)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (ulong)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (ulong)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (ulong)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (ulong)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (ulong)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (ulong)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (ulong)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (ulong)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (ulong)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (ulong)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (ulong)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (float)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (float)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (float)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (float)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (float)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (float)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (float)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (float)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (float)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (float)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (float)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (double)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (double)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (double)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (double)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (double)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (double)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (double)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (double)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (double)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (double)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (double)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Decimal:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (decimal)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (decimal)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (decimal)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (decimal)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (decimal)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (decimal)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (decimal)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (decimal)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (decimal)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (decimal)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (decimal)(double)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthrow new InvalidCastException(\"Cast from \" + sourceType + \" to \" + targetType + \"not supported.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic object CSharpPrimitiveCastUnchecked(TypeCode targetType, object input)\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tTypeCode sourceType = Type.GetTypeCode(input.GetType());\n\t\t\t\tif (sourceType == targetType)\n\t\t\t\t\treturn input;\n\t\t\t\tswitch (targetType) {\n\t\t\t\t\tcase TypeCode.Char:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (char)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (char)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (char)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (char)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (char)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (char)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (char)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (char)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (char)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (char)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (char)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (sbyte)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (sbyte)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (sbyte)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (sbyte)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (sbyte)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (sbyte)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (sbyte)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (sbyte)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (sbyte)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (sbyte)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (sbyte)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (byte)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (byte)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (byte)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (byte)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (byte)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (byte)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (byte)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (byte)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (byte)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (byte)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (byte)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (short)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (short)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (short)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (short)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (short)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (short)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (short)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (short)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (short)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (short)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (short)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (ushort)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (ushort)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (ushort)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (ushort)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (ushort)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (ushort)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (ushort)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (ushort)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (ushort)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (ushort)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (ushort)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (int)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (int)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (int)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (int)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (int)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (int)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (int)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (int)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (int)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (int)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (int)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (uint)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (uint)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (uint)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (uint)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (uint)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (uint)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (uint)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (uint)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (uint)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (uint)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (uint)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (long)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (long)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (long)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (long)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (long)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (long)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (long)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (long)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (long)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (long)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (long)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (ulong)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (ulong)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (ulong)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (ulong)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (ulong)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (ulong)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (ulong)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (ulong)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (ulong)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (ulong)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (ulong)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (float)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (float)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (float)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (float)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (float)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (float)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (float)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (float)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (float)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (float)(double)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (float)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (double)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (double)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (double)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (double)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (double)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (double)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (double)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (double)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (double)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (double)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Decimal: return (double)(decimal)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Decimal:\n\t\t\t\t\t\tswitch (sourceType) {\n\t\t\t\t\t\t\t\tcase TypeCode.Char:    return (decimal)(char)input;\n\t\t\t\t\t\t\t\tcase TypeCode.SByte:   return (decimal)(sbyte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Byte:    return (decimal)(byte)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int16:   return (decimal)(short)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt16:  return (decimal)(ushort)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int32:   return (decimal)(int)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt32:  return (decimal)(uint)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Int64:   return (decimal)(long)input;\n\t\t\t\t\t\t\t\tcase TypeCode.UInt64:  return (decimal)(ulong)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Single:  return (decimal)(float)input;\n\t\t\t\t\t\t\t\tcase TypeCode.Double:  return (decimal)(double)input;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthrow new InvalidCastException(\"Cast from \" + sourceType + \" to \" + targetType + \" not supported.\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CacheManager.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Allows caching values for a specific compilation.\n\t/// A CacheManager consists of a for shared instances (shared among all threads working with that resolve context).\n\t/// </summary>\n\t/// <remarks>This class is thread-safe</remarks>\n\tpublic sealed class CacheManager\n\t{\n\t\treadonly ConcurrentDictionary<object, object> sharedDict = new ConcurrentDictionary<object, object>(ReferenceComparer.Instance);\n\t\t// There used to be a thread-local dictionary here, but I removed it as it was causing memory\n\t\t// leaks in some use cases.\n\t\t\n\t\tpublic object GetShared(object key)\n\t\t{\n\t\t\tobject value;\n\t\t\tsharedDict.TryGetValue(key, out value);\n\t\t\treturn value;\n\t\t}\n\t\t\n\t\tpublic object GetOrAddShared(object key, Func<object, object> valueFactory)\n\t\t{\n\t\t\treturn sharedDict.GetOrAdd(key, valueFactory);\n\t\t}\n\t\t\n\t\tpublic object GetOrAddShared(object key, object value)\n\t\t{\n\t\t\treturn sharedDict.GetOrAdd(key, value);\n\t\t}\n\t\t\n\t\tpublic void SetShared(object key, object value)\n\t\t{\n\t\t\tsharedDict[key] = value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CallbackOnDispose.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Invokes an action when it is disposed.\n\t/// </summary>\n\t/// <remarks>\n\t/// This class ensures the callback is invoked at most once,\n\t/// even when Dispose is called on multiple threads.\n\t/// </remarks>\n\tpublic sealed class CallbackOnDispose : IDisposable\n\t{\n\t\tAction action;\n\t\t\n\t\tpublic CallbackOnDispose(Action action)\n\t\t{\n\t\t\tif (action == null)\n\t\t\t\tthrow new ArgumentNullException(\"action\");\n\t\t\tthis.action = action;\n\t\t}\n\t\t\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tAction a = Interlocked.Exchange(ref action, null);\n\t\t\tif (a != null) {\n\t\t\t\ta();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/ComparableList.cs",
    "content": "//\n// NullValueAnalysisTests.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// A list that can be compared to other ComparableLists for equality.\n\t/// Can not be used to store null values.\n\t/// </summary>\n\tpublic sealed class ComparableList<T> : IList<T>, IEquatable<ComparableList<T>>\n\t{\n\t\tList<T> elements;\n\n\t\tpublic ComparableList()\n\t\t{\n\t\t\telements = new List<T> ();\n\t\t}\n\n\t\tpublic ComparableList(IEnumerable<T> values)\n\t\t{\n\t\t\telements = new List<T> (values);\n\t\t}\n\n\t\tpublic int IndexOf (T item)\n\t\t{\n\t\t\tif (item == null)\n\t\t\t\tthrow new ArgumentNullException (\"item\");\n\t\t\treturn elements.IndexOf (item);\n\t\t}\n\n\t\tpublic void Insert (int index, T item)\n\t\t{\n\t\t\telements.Insert (index, item);\n\t\t}\n\n\t\tpublic void RemoveAt (int index)\n\t\t{\n\t\t\telements.RemoveAt (index);\n\t\t}\n\n\t\tpublic T this [int index] {\n\t\t\tget {\n\t\t\t\treturn elements [index];\n\t\t\t}\n\t\t\tset {\n\t\t\t\telements [index] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Add (T item)\n\t\t{\n\t\t\telements.Add (item);\n\t\t}\n\n\t\tpublic void Clear ()\n\t\t{\n\t\t\telements.Clear ();\n\t\t}\n\n\t\tpublic bool Contains (T item)\n\t\t{\n\t\t\treturn elements.Contains (item);\n\t\t}\n\n\t\tpublic void CopyTo (T[] array, int arrayIndex)\n\t\t{\n\t\t\telements.CopyTo (array, arrayIndex);\n\t\t}\n\n\t\tpublic bool Remove (T item)\n\t\t{\n\t\t\treturn elements.Remove (item);\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn elements.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\treturn elements.GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator ();\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\treturn Equals (obj as ComparableList<T>);\n\t\t}\n\n\t\tpublic bool Equals (ComparableList<T> obj)\n\t\t{\n\t\t\tif (obj == null || Count != obj.Count) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (int index = 0; index < Count; ++index) {\n\t\t\t\tif (!this [index].Equals(obj [index])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\tint hash = 19;\n\t\t\tforeach (var item in this) {\n\t\t\t\tunchecked {\n\t\t\t\t\thash *= 31;\n\t\t\t\t\thash += item.GetHashCode();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn hash;\n\t\t}\n\n\t\tpublic static bool operator==(ComparableList<T> item1, ComparableList<T> item2) {\n\t\t\tif (object.ReferenceEquals (item1, null))\n\t\t\t\treturn object.ReferenceEquals (item2, null);\n\t\t\treturn item1.Equals (item2);\n\t\t}\n\n\t\tpublic static bool operator!=(ComparableList<T> item1, ComparableList<T> item2) {\n\t\t\treturn !(item1 == item2);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CompositeFormatStringParser/CompositeFormatStringParser.cs",
    "content": "//\n// CompositeFormatStringParser.cs\n//\n// Authors:\n//   Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Composite format string parser.\n\t/// </summary>\n\t/// <remarks>\n\t/// Implements a complete parser for valid strings as well as\n\t/// error reporting and best-effort parsing for invalid strings.\n\t/// </remarks>\t\t\n\tpublic class CompositeFormatStringParser\n\t{\n\n\t\tpublic CompositeFormatStringParser ()\n\t\t{\n\t\t\terrors = new List<IFormatStringError> ();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parse the specified format string.\n\t\t/// </summary>\n\t\t/// <param name='format'>\n\t\t/// The format string.\n\t\t/// </param>\n\t\tpublic FormatStringParseResult Parse (string format)\n\t\t{\n\t\t\tif (format == null)\n\t\t\t\tthrow new ArgumentNullException (\"format\");\n\n\t\t\tvar result = new FormatStringParseResult();\n\n\t\t\t// Format string syntax: http://msdn.microsoft.com/en-us/library/txafckwd.aspx\n\t\t\tint textStart = 0;\n\t\t\tvar length = format.Length;\n\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\t// Get fixed text\n\t\t\t\tGetText (format, ref i);\n\n\t\t\t\tif (i < format.Length && format [i] == '{') {\n\t\t\t\t\tint formatItemStart = i;\n\t\t\t\t\tint index;\n\t\t\t\t\tint? alignment;\n\t\t\t\t\tstring argumentFormat;\n\t\t\t\t\tvar textSegmentErrors = new List<IFormatStringError>(GetErrors());\n\n\t\t\t\t\t// Try to parse the parts of the format item\n\t\t\t\t\t++i;\n\t\t\t\t\tindex = ParseIndex (format, ref i);\n\t\t\t\t\tCheckForMissingEndBrace (format, i, length);\n\n\t\t\t\t\talignment = ParseAlignment (format, ref i, length);\n\t\t\t\t\tCheckForMissingEndBrace (format, i, length);\n\n\t\t\t\t\targumentFormat = ParseSubFormatString (format, ref i, length);\n\t\t\t\t\tCheckForMissingEndBrace (format, i, length);\n\n\t\t\t\t\t// Check what we parsed\n\t\t\t\t\tif (i == formatItemStart + 1 && (i == length || (i < length && format[i] != '}'))) {\n\t\t\t\t\t\t// There were no format item after all, this was just an\n\t\t\t\t\t\t// unescaped left brace, or the initial brace of an escape sequence\n\t\t\t\t\t\tSetErrors(textSegmentErrors);\n\t\t\t\t\t\tif (i >= length || format[i] != '{') {\n\t\t\t\t\t\t\tAddError (new DefaultFormatStringError {\n\t\t\t\t\t\t\t\tMessage = \"Unescaped '{'\",\n\t\t\t\t\t\t\t\tStartLocation = formatItemStart,\n\t\t\t\t\t\t\t\tEndLocation = formatItemStart + 1,\n\t\t\t\t\t\t\t\tOriginalText = \"{\",\n\t\t\t\t\t\t\t\tSuggestedReplacementText = \"{{\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (formatItemStart - textStart > 0) {\n\t\t\t\t\t\t// We have parsed a format item, end the text segment\n\t\t\t\t\t\tvar textSegment = new TextSegment (UnEscape (format.Substring (textStart, formatItemStart - textStart)));\n\t\t\t\t\t\ttextSegment.Errors = textSegmentErrors;\n\t\t\t\t\t\tresult.Segments.Add (textSegment);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Unclosed format items in fixed text advances i one step too far\n\t\t\t\t\tif (i < length && format [i] != '}')\n\t\t\t\t\t\t--i;\n\n\t\t\t\t\t// i may actually point outside of format if there is a syntactical error\n\t\t\t\t\t// if that happens, we want the last position\n\t\t\t\t\tvar endLocation = Math.Min (length, i + 1);\n\t\t\t\t\tresult.Segments.Add (new FormatItem (index, alignment, argumentFormat) {\n\t\t\t\t\t\tStartLocation = formatItemStart,\n\t\t\t\t\t\tEndLocation = endLocation,\n\t\t\t\t\t\tErrors = GetErrors ()\n\t\t\t\t\t});\n\t\t\t\t\tClearErrors ();\n\n\t\t\t\t\t// The next potential text segment starts after this format item\n\t\t\t\t\ttextStart = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Handle remaining text\n\t\t\tif (textStart < length) {\n\t\t\t\tvar textSegment = new TextSegment (UnEscape (format.Substring (textStart)), textStart);\n\t\t\t\ttextSegment.Errors = GetErrors();\n\t\t\t\tresult.Segments.Add (textSegment);\n\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tint ParseIndex (string format, ref int i)\n\t\t{\n\t\t\tint parsedCharacters;\n\t\t\tint? maybeIndex = GetAndCheckNumber (format, \",:}\", ref i, i, out parsedCharacters);\n\t\t\tif (parsedCharacters == 0) {\n\t\t\t\tAddError (new DefaultFormatStringError {\n\t\t\t\t\tStartLocation = i,\n\t\t\t\t\tEndLocation = i,\n\t\t\t\t\tMessage = \"Missing index\",\n\t\t\t\t\tOriginalText = \"\",\n\t\t\t\t\tSuggestedReplacementText = \"0\"\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn maybeIndex ?? 0;\n\t\t}\n\n\t\tint? ParseAlignment(string format, ref int i, int length)\n\t\t{\n\t\t\tif (i < length && format [i] == ',') {\n\t\t\t\tint alignmentBegin = i;\n\t\t\t\t++i;\n\t\t\t\twhile (i < length && char.IsWhiteSpace(format [i]))\n\t\t\t\t\t++i;\n\n\t\t\t\tint parsedCharacters;\n\t\t\t\tvar number = GetAndCheckNumber (format, \",:}\", ref i, alignmentBegin + 1, out parsedCharacters);\n\t\t\t\tif (parsedCharacters == 0) {\n\t\t\t\t\tAddError (new DefaultFormatStringError {\n\t\t\t\t\t\tStartLocation = i,\n\t\t\t\t\t\tEndLocation = i,\n\t\t\t\t\t\tMessage = \"Missing alignment\",\n\t\t\t\t\t\tOriginalText = \"\",\n\t\t\t\t\t\tSuggestedReplacementText = \"0\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn number ?? 0;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tstring ParseSubFormatString(string format, ref int i, int length)\n\t\t{\n\t\t\tif (i < length && format [i] == ':') {\n\t\t\t\t++i;\n\t\t\t\tint begin = i;\n\t\t\t\tGetText(format, ref i, \"\", true);\n\t\t\t\tvar escaped = format.Substring (begin, i - begin);\n\t\t\t\treturn UnEscape (escaped);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tvoid CheckForMissingEndBrace (string format, int i, int length)\n\t\t{\n\t\t\tif (i == length) {\n\t\t\t\tint j;\n\t\t\t\tfor (j = i - 1; format[j] == '}'; j--);\n\t\t\t\tvar oddEndBraceCount = (i - j) % 2 == 1;\n\t\t\t\tif (oddEndBraceCount) {\n\t\t\t\t\tAddMissingEndBraceError(i, i, \"Missing '}'\", \"\");\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvoid GetText (string format, ref int index, string delimiters = \"\", bool allowEscape = false)\n\t\t{\n\t\t\twhile (index < format.Length) {\n\t\t\t\tif (format [index] == '{' || format[index] == '}') {\n\t\t\t\t\tif (index + 1 < format.Length && format [index + 1] == format[index] && allowEscape)\n\t\t\t\t\t\t++index;\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t} else if (delimiters.Contains(format[index].ToString())) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t++index;\n\t\t\t};\n\t\t}\n\t\t\n\t\tint? GetNumber (string format, ref int index)\n\t\t{\n\t\t\tif (format.Length == 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tint sum = 0;\n\t\t\tint i = index;\n\t\t\tbool positive = format [i] != '-';\n\t\t\tif (!positive)\n\t\t\t\t++i;\n\t\t\tint numberStartIndex = i;\n\t\t\twhile (i < format.Length && format[i] >= '0' && format[i] <= '9') {\n\t\t\t\tsum = 10 * sum + format [i] - '0';\n\t\t\t\t++i;\n\t\t\t}\n\t\t\tif (i == numberStartIndex)\n\t\t\t\treturn null;\n\n\t\t\tindex = i;\n\t\t\treturn positive ? sum : -sum;\n\t\t}\n\n\t\tint? GetAndCheckNumber (string format, string delimiters, ref int index, int numberFieldStart, out int parsedCharacters)\n\t\t{\n\t\t\tint fieldIndex = index;\n\t\t\tGetText (format, ref fieldIndex, delimiters);\n\t\t\tint fieldEnd = fieldIndex;\n\t\t\tvar numberText = format.Substring(index, fieldEnd - index);\n\t\t\tparsedCharacters = numberText.Length;\n\t\t\tint numberLength = 0;\n\t\t\tint? number = GetNumber (numberText, ref numberLength);\n\t\t\tif (numberLength != parsedCharacters && fieldEnd < format.Length && delimiters.Contains (format [fieldEnd])) {\n\t\t\t\t// Not the entire number field could be parsed\n\t\t\t\t// The field actually ended as intended, so set the index to the end of the field\n\t\t\t\tindex = fieldEnd;\n\t\t\t\tvar suggestedNumber = (number ?? 0).ToString ();\n\t\t\t\tAddInvalidNumberFormatError (numberFieldStart, format.Substring (numberFieldStart, index - numberFieldStart), suggestedNumber);\n\t\t\t} else {\n\t\t\t\tvar endingChar = index + numberLength;\n\t\t\t\tif (numberLength != parsedCharacters) {\n\t\t\t\t\t// Not the entire number field could be parsed\n\t\t\t\t\t// The field didn't end, it was cut off so we are missing an ending brace\n\t\t\t\t\tindex = endingChar;\n\t\t\t\t\tAddMissingEndBraceError (index, index, \"Missing ending '}'\", \"\");\n\t\t\t\t} else {\n\t\t\t\t\tindex = endingChar;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn number;\n\t\t}\n\n\t\tpublic static string UnEscape (string unEscaped)\n\t\t{\n\t\t\treturn unEscaped.Replace (\"{{\", \"{\").Replace (\"}}\", \"}\");\n\t\t}\n\n\t\tIList<IFormatStringError> errors;\n\t\t\n\t\tbool hasMissingEndBrace = false;\n\n\t\tvoid AddError (IFormatStringError error)\n\t\t{\n\t\t\terrors.Add (error);\n\t\t}\n\n\t\tvoid AddMissingEndBraceError(int start, int end, string message, string originalText)\n\t\t{\n\t\t\t// Only add a single missing end brace per format item\n\t\t\tif (hasMissingEndBrace)\n\t\t\t\treturn;\n\t\t\tAddError (new DefaultFormatStringError {\n\t\t\t\tStartLocation = start,\n\t\t\t\tEndLocation = end,\n\t\t\t\tMessage = message,\n\t\t\t\tOriginalText = originalText,\n\t\t\t\tSuggestedReplacementText = \"}\"\n\t\t\t});\n\t\t\thasMissingEndBrace = true;\n\t\t}\n\n\t\tvoid AddInvalidNumberFormatError (int i, string number, string replacementText)\n\t\t{\n\t\t\tAddError (new DefaultFormatStringError {\n\t\t\t\tStartLocation = i,\n\t\t\t\tEndLocation = i + number.Length,\n\t\t\t\tMessage = string.Format (\"Invalid number '{0}'\", number),\n\t\t\t\tOriginalText = number,\n\t\t\t\tSuggestedReplacementText = replacementText\n\t\t\t});\n\t\t}\n\n\t\tIList<IFormatStringError> GetErrors ()\n\t\t{\n\t\t\treturn errors;\n\t\t}\n\t\t\n\t\tvoid SetErrors (IList<IFormatStringError> errors)\n\t\t{\n\t\t\tthis.errors = errors;\n\t\t}\n\n\t\tvoid ClearErrors ()\n\t\t{\n\t\t\thasMissingEndBrace = false;\n\t\t\terrors = new List<IFormatStringError> ();\n\t\t}\n\t}\n\n\tpublic class FormatStringParseResult\n\t{\n\t\tpublic FormatStringParseResult()\n\t\t{\n\t\t\tSegments = new List<IFormatStringSegment>();\n\t\t}\n\n\t\tpublic IList<IFormatStringSegment> Segments { get; private set; }\n\n\t\tpublic bool HasErrors\n\t\t{\n\t\t\tget {\n\t\t\t\treturn Segments.SelectMany(segment => segment.Errors).Any();\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CompositeFormatStringParser/FormatItem.cs",
    "content": "//\n// FormatItem.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic class FormatItem : FormatStringSegmentBase\n\t{\n\t\tpublic FormatItem (int index, int? alignment = null, string formatString = null)\n\t\t{\n\t\t\tIndex = index;\n\t\t\tAlignment = alignment;\n\t\t\tFormatString = formatString;\n\t\t}\n\n\t\tpublic int Index { get; private set; }\n\n\t\tpublic int? Alignment { get; private set; }\n\n\t\tpublic string FormatString { get; private set; }\n\n\t\t#region Equality\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn false;\n\t\t\tif (obj.GetType () != typeof(FormatItem))\n\t\t\t\treturn false;\n\t\t\tvar other = (FormatItem)obj;\n\t\t\t\t\n\t\t\treturn FieldsEquals (other);\n\t\t}\n\t\t\t\n\t\tpublic bool Equals (FormatItem other)\n\t\t{\n\t\t\tif (other == null)\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\treturn FieldsEquals (other);\n\t\t}\n\n\t\tbool FieldsEquals (FormatItem other)\n\t\t{\n\t\t\treturn Index == other.Index &&\n\t\t\t\tAlignment == other.Alignment &&\n\t\t\t\tFormatString == other.FormatString &&\n\t\t\t\tStartLocation == other.StartLocation &&\n\t\t\t\tEndLocation == other.EndLocation;\n\t\t}\n\t\t\t\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hash = 23;\n\t\t\t\thash = hash * 37 + Index.GetHashCode ();\n\t\t\t\thash = hash * 37 + Alignment.GetHashCode ();\n\t\t\t\thash = hash * 37 + FormatString.GetHashCode ();\n\t\t\t\thash = hash * 37 + StartLocation.GetHashCode ();\n\t\t\t\thash = hash * 37 + EndLocation.GetHashCode ();\n\t\t\t\treturn hash;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn string.Format (\"[FormatItem: Index={0}, Alignment={1}, FormatString={2}, StartLocation={3}, EndLocation={4}]\", Index, Alignment, FormatString, StartLocation, EndLocation);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CompositeFormatStringParser/FormatStringSegmentBase.cs",
    "content": "//\n// FormatStringSegmentBase.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Composite format string parser.\n\t/// </summary>\n\t/// <remarks>\n\t/// Implements a complete parser for valid strings as well as\n\t/// error reporting and best-effort parsing for invalid strings.\n\t/// </remarks>\t\t\n\tpublic abstract class FormatStringSegmentBase : IFormatStringSegment\n\t{\n\t\tpublic FormatStringSegmentBase ()\n\t\t{\n\t\t\tErrors = new List<IFormatStringError> ();\n\t\t}\n\n\t\t#region IFormatStringSegment implementation\n\t\tpublic int StartLocation { get; set; }\n\n\t\tpublic int EndLocation { get; set; }\n\n\t\tpublic bool HasErrors {\n\t\t\tget {\n\t\t\t\treturn Errors.Any ();\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<IFormatStringError> Errors { get; set; }\n\n\t\tIEnumerable<IFormatStringError> IFormatStringSegment.Errors {\n\t\t\tget {\n\t\t\t\treturn Errors;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CompositeFormatStringParser/IFormatStringError.cs",
    "content": "//\n// IFormatStringError.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic interface IFormatStringError\n\t{\n\t\tint StartLocation { get; }\n\n\t\tint EndLocation { get; }\n\n\t\tstring Message { get; }\n\n\t\tstring OriginalText { get; }\n\n\t\tstring SuggestedReplacementText { get; }\n\t}\n\n\tpublic class DefaultFormatStringError : IFormatStringError\n\t{\n\t\tpublic DefaultFormatStringError()\n\t\t{\n\t\t\tMessage = \"\";\n\t\t\tOriginalText = \"\";\n\t\t\tSuggestedReplacementText = \"\";\n\t\t}\n\n\t\t#region IFormatStringError implementation\n\t\tpublic int StartLocation { get; set; }\n\t\t\n\t\tpublic int EndLocation { get; set; }\n\t\t\n\t\tpublic string Message { get; set; }\n\t\t\n\t\tpublic string OriginalText { get; set; }\n\t\t\n\t\tpublic string SuggestedReplacementText { get; set; }\n\t\t#endregion\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn string.Format (\"[DefaultFormatStringError: StartLocation={0}, EndLocation={1}, Message={2}, OriginalText={3}, SuggestedReplacementText={4}]\", StartLocation, EndLocation, Message, OriginalText, SuggestedReplacementText);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CompositeFormatStringParser/IFormatStringSegment.cs",
    "content": "//\n// IFormatStringSegment.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Composite format string parser.\n\t/// </summary>\n\t/// <remarks>\n\t/// Implements a complete parser for valid strings as well as\n\t/// error reporting and best-effort parsing for invalid strings.\n\t/// </remarks>\t\t\n\tpublic interface IFormatStringSegment\n\t{\n\t\tint StartLocation { get; set; }\n\n\t\tint EndLocation { get; set; }\n\n\t\tbool HasErrors { get; }\n\n\t\tIEnumerable<IFormatStringError> Errors { get; }\n\t}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/CompositeFormatStringParser/TextSegment.cs",
    "content": "//\n// TextSegment.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic class TextSegment : FormatStringSegmentBase\n\t{\n\t\tpublic TextSegment (string text, int startLocation = 0, int? endLocation = null)\n\t\t{\n\t\t\tText = text;\n\t\t\tStartLocation = startLocation;\n\t\t\tEndLocation = endLocation ?? startLocation + text.Length;\n\t\t}\n\n\t\tpublic string Text { get; set; }\n\n\t\t#region Equality\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn false;\n\t\t\tif (obj.GetType () != typeof(TextSegment))\n\t\t\t\treturn false;\n\t\t\tvar other = (TextSegment)obj;\n\t\t\t\n\t\t\treturn Equals (Text, other.Text);\n\t\t}\n\t\t\n\t\tpublic bool Equals (TextSegment other)\n\t\t{\n\t\t\tif (other == null)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\treturn Equals (Text, other.Text) &&\n\t\t\t\tStartLocation == other.StartLocation &&\n\t\t\t\tEndLocation == other.EndLocation;\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\tint hash = 23;\n\t\t\t\thash = hash * 37 + Text.GetHashCode ();\n\t\t\t\thash = hash * 37 + StartLocation.GetHashCode ();\n\t\t\t\thash = hash * 37 + EndLocation.GetHashCode ();\n\t\t\t\treturn hash;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn string.Format (\"[TextSegment: Text={0}, StartLocation={1}, EndLocation={2}]\", Text, StartLocation, EndLocation);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/EmptyList.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nnamespace ICSharpCode.NRefactory\n{\n\t[Serializable]\n\tpublic sealed class EmptyList<T> : IList<T>, IEnumerator<T>\n\t\t#if NET_4_5\n\t\t, IReadOnlyList<T>\n\t\t#endif\n\t{\n\t\tpublic static readonly EmptyList<T> Instance = new EmptyList<T>();\n\t\t\n\t\tprivate EmptyList() {}\n\t\t\n\t\tpublic T this[int index] {\n\t\t\tget { throw new ArgumentOutOfRangeException(\"index\"); }\n\t\t\tset { throw new ArgumentOutOfRangeException(\"index\"); }\n\t\t}\n\t\t\n\t\tpublic int Count {\n\t\t\tget { return 0; }\n\t\t}\n\t\t\n\t\tbool ICollection<T>.IsReadOnly {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tint IList<T>.IndexOf(T item)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tvoid IList<T>.Insert(int index, T item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IList<T>.RemoveAt(int index)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid ICollection<T>.Add(T item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid ICollection<T>.Clear()\n\t\t{\n\t\t}\n\t\t\n\t\tbool ICollection<T>.Contains(T item)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid ICollection<T>.CopyTo(T[] array, int arrayIndex)\n\t\t{\n\t\t}\n\t\t\n\t\tbool ICollection<T>.Remove(T item)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tIEnumerator<T> IEnumerable<T>.GetEnumerator()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tT IEnumerator<T>.Current {\n\t\t\tget { return default(T); }\n\t\t}\n\t\t\n\t\tobject IEnumerator.Current {\n\t\t\tget { return default(T); }\n\t\t}\n\t\t\n\t\tvoid IDisposable.Dispose()\n\t\t{\n\t\t}\n\t\t\n\t\tbool IEnumerator.MoveNext()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid IEnumerator.Reset()\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/ExtensionMethods.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Contains extension methods for use within NRefactory.\n\t/// </summary>\n\tstatic class ExtensionMethods\n\t{\n\t\tpublic static void AddRange<T>(this ICollection<T> target, IEnumerable<T> input)\n\t\t{\n\t\t\tforeach (T item in input)\n\t\t\t\ttarget.Add(item);\n\t\t}\n\t\t\n\t\tpublic static Predicate<T> And<T>(this Predicate<T> filter1, Predicate<T> filter2)\n\t\t{\n\t\t\tif (filter1 == null)\n\t\t\t\treturn filter2;\n\t\t\tif (filter2 == null)\n\t\t\t\treturn filter1;\n\t\t\treturn m => filter1(m) && filter2(m);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/FastSerializer.cs",
    "content": "﻿// Copyright (c) 2011 Daniel Grunwald\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.Runtime.Serialization;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic class FastSerializer\n\t{\n\t\t#region Properties\n\t\t/// <summary>\n\t\t/// Gets/Sets the serialization binder that is being used.\n\t\t/// The default value is null, which will cause the FastSerializer to use the\n\t\t/// full assembly and type names.\n\t\t/// </summary>\n\t\tpublic SerializationBinder SerializationBinder { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Can be used to set several 'fixed' instances.\n\t\t/// When serializing, such instances will not be included; and any references to a fixed instance\n\t\t/// will be stored as the index in this array.\n\t\t/// When deserializing, the same (or equivalent) instances must be specified, and the deserializer\n\t\t/// will use them in place of the fixed instances.\n\t\t/// </summary>\n\t\tpublic object[] FixedInstances { get; set; }\n\t\t#endregion\n\t\t\n\t\t#region Constants\n\t\tconst int magic = 0x71D28A5E;\n\t\t\n\t\tconst byte Type_ReferenceType = 1;\n\t\tconst byte Type_ValueType = 2;\n\t\tconst byte Type_SZArray = 3;\n\t\tconst byte Type_ParameterizedType = 4;\n\t\t#endregion\n\t\t\n\t\t#region Serialization\n\t\tsealed class SerializationType\n\t\t{\n\t\t\tpublic readonly int ID;\n\t\t\tpublic readonly Type Type;\n\t\t\t\n\t\t\tpublic SerializationType(int iD, Type type)\n\t\t\t{\n\t\t\t\tthis.ID = iD;\n\t\t\t\tthis.Type = type;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ObjectScanner Scanner;\n\t\t\tpublic ObjectWriter Writer;\n\t\t\tpublic string TypeName;\n\t\t\tpublic int AssemblyNameID;\n\t\t}\n\t\t\n\t\tsealed class SerializationContext\n\t\t{\n\t\t\treadonly Dictionary<object, int> objectToID = new Dictionary<object, int>(ReferenceComparer.Instance);\n\t\t\treadonly List<object> instances = new List<object>(); // index: object ID\n\t\t\treadonly List<SerializationType> objectTypes = new List<SerializationType>(); // index: object ID\n\t\t\tSerializationType stringType;\n\t\t\t\n\t\t\treadonly Dictionary<Type, SerializationType> typeMap = new Dictionary<Type, SerializationType>();\n\t\t\treadonly List<SerializationType> types = new List<SerializationType>();\n\t\t\t\n\t\t\treadonly Dictionary<string, int> assemblyNameToID = new Dictionary<string, int>();\n\t\t\treadonly List<string> assemblyNames = new List<string>();\n\t\t\t\n\t\t\treadonly FastSerializer fastSerializer;\n\t\t\tpublic readonly BinaryWriter writer;\n\t\t\tint fixedInstanceCount;\n\t\t\t\n\t\t\tinternal SerializationContext(FastSerializer fastSerializer, BinaryWriter writer)\n\t\t\t{\n\t\t\t\tthis.fastSerializer = fastSerializer;\n\t\t\t\tthis.writer = writer;\n\t\t\t\tinstances.Add(null); // use object ID 0 for null\n\t\t\t\tobjectTypes.Add(null);\n\t\t\t}\n\t\t\t\n\t\t\t#region Scanning\n\t\t\tpublic void MarkFixedInstances(object[] fixedInstances)\n\t\t\t{\n\t\t\t\tif (fixedInstances == null)\n\t\t\t\t\treturn;\n\t\t\t\tforeach (object obj in fixedInstances) {\n\t\t\t\t\tif (!objectToID.ContainsKey(obj)) {\n\t\t\t\t\t\tobjectToID.Add(obj, instances.Count);\n\t\t\t\t\t\tinstances.Add(obj);\n\t\t\t\t\t\tfixedInstanceCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Marks an instance for future scanning.\n\t\t\t/// </summary>\n\t\t\tpublic void Mark(object instance)\n\t\t\t{\n\t\t\t\tif (instance == null || objectToID.ContainsKey(instance))\n\t\t\t\t\treturn;\n\t\t\t\tLog(\" Mark {0}\", instance.GetType().Name);\n\t\t\t\t\n\t\t\t\tobjectToID.Add(instance, instances.Count);\n\t\t\t\tinstances.Add(instance);\n\t\t\t}\n\t\t\t\n\t\t\tinternal void Scan()\n\t\t\t{\n\t\t\t\tLog(\"Scanning...\");\n\t\t\t\t// starting from 1, because index 0 is null\n\t\t\t\t// Also, do not scan any of the 'fixed instances'.\n\t\t\t\tfor (int i = 1 + fixedInstanceCount; i < instances.Count; i++) {\n\t\t\t\t\tobject instance = instances[i];\n\t\t\t\t\tISerializable serializable = instance as ISerializable;\n\t\t\t\t\tType type = instance.GetType();\n\t\t\t\t\tLog(\"Scan #{0}: {1}\", i, type.Name);\n\t\t\t\t\tSerializationType sType = MarkType(type);\n\t\t\t\t\tobjectTypes.Add(sType);\n\t\t\t\t\tif (serializable != null) {\n\t\t\t\t\t\tSerializationInfo info = new SerializationInfo(type, fastSerializer.formatterConverter);\n\t\t\t\t\t\tserializable.GetObjectData(info, fastSerializer.streamingContext);\n\t\t\t\t\t\tinstances[i] = info;\n\t\t\t\t\t\tforeach (SerializationEntry entry in info) {\n\t\t\t\t\t\t\tMark(entry.Value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsType.Writer = serializationInfoWriter;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tObjectScanner objectScanner = sType.Scanner;\n\t\t\t\t\t\tif (objectScanner == null) {\n\t\t\t\t\t\t\tobjectScanner = fastSerializer.GetScanner(type);\n\t\t\t\t\t\t\tsType.Scanner = objectScanner;\n\t\t\t\t\t\t\tsType.Writer = fastSerializer.GetWriter(type);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobjectScanner(this, instance);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t\t#region Scan Types\n\t\t\tSerializationType MarkType(Type type)\n\t\t\t{\n\t\t\t\tSerializationType sType;\n\t\t\t\tif (!typeMap.TryGetValue(type, out sType)) {\n\t\t\t\t\tstring assemblyName = null;\n\t\t\t\t\tstring typeName = null;\n\t\t\t\t\tif (type.HasElementType) {\n\t\t\t\t\t\tDebug.Assert(type.IsArray);\n\t\t\t\t\t\tMarkType(type.GetElementType());\n\t\t\t\t\t} else if (type.IsGenericType && !type.IsGenericTypeDefinition) {\n\t\t\t\t\t\tMarkType(type.GetGenericTypeDefinition());\n\t\t\t\t\t\tforeach (Type typeArg in type.GetGenericArguments())\n\t\t\t\t\t\t\tMarkType(typeArg);\n\t\t\t\t\t} else if (type.IsGenericParameter) {\n\t\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar serializationBinder = fastSerializer.SerializationBinder;\n\t\t\t\t\t\tif (serializationBinder != null) {\n\t\t\t\t\t\t\tserializationBinder.BindToName(type, out assemblyName, out typeName);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tassemblyName = type.Assembly.FullName;\n\t\t\t\t\t\t\ttypeName = type.FullName;\n\t\t\t\t\t\t\tDebug.Assert(typeName != null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tsType = new SerializationType(typeMap.Count, type);\n\t\t\t\t\tsType.TypeName = typeName;\n\t\t\t\t\tif (assemblyName != null) {\n\t\t\t\t\t\tif (!assemblyNameToID.TryGetValue(assemblyName, out sType.AssemblyNameID)) {\n\t\t\t\t\t\t\tsType.AssemblyNameID = assemblyNames.Count;\n\t\t\t\t\t\t\tassemblyNameToID.Add(assemblyName, sType.AssemblyNameID);\n\t\t\t\t\t\t\tassemblyNames.Add(assemblyName);\n\t\t\t\t\t\t\tLog(\"Registered assembly #{0}: {1}\", sType.AssemblyNameID, assemblyName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttypeMap.Add(type, sType);\n\t\t\t\t\ttypes.Add(sType);\n\t\t\t\t\tLog(\"Registered type %{0}: {1}\", sType.ID, type);\n\t\t\t\t\tif (type == typeof(string)) {\n\t\t\t\t\t\tstringType = sType;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn sType;\n\t\t\t}\n\t\t\t\n\t\t\tinternal void ScanTypes()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < types.Count; i++) {\n\t\t\t\t\tType type = types[i].Type;\n\t\t\t\t\tif (type.IsGenericTypeDefinition || type.HasElementType)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (typeof(ISerializable).IsAssignableFrom(type))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tforeach (FieldInfo field in GetSerializableFields(type)) {\n\t\t\t\t\t\tMarkType(field.FieldType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t\t#region Writing\n\t\t\tpublic void WriteObjectID(object instance)\n\t\t\t{\n\t\t\t\tint id = (instance == null) ? 0 : objectToID[instance];\n\t\t\t\tif (instances.Count <= ushort.MaxValue)\n\t\t\t\t\twriter.Write((ushort)id);\n\t\t\t\telse\n\t\t\t\t\twriter.Write(id);\n\t\t\t}\n\t\t\t\n\t\t\tvoid WriteTypeID(Type type)\n\t\t\t{\n\t\t\t\tDebug.Assert(typeMap.ContainsKey(type));\n\t\t\t\tint typeID = typeMap[type].ID;\n\t\t\t\tif (types.Count <= ushort.MaxValue)\n\t\t\t\t\twriter.Write((ushort)typeID);\n\t\t\t\telse\n\t\t\t\t\twriter.Write(typeID);\n\t\t\t}\n\t\t\t\n\t\t\tinternal void Write()\n\t\t\t{\n\t\t\t\tLog(\"Writing...\");\n\t\t\t\twriter.Write(magic);\n\t\t\t\t// Write out type information\n\t\t\t\twriter.Write(instances.Count);\n\t\t\t\twriter.Write(types.Count);\n\t\t\t\twriter.Write(assemblyNames.Count);\n\t\t\t\twriter.Write(fixedInstanceCount);\n\t\t\t\t\n\t\t\t\tforeach (string assemblyName in assemblyNames) {\n\t\t\t\t\twriter.Write(assemblyName);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach (SerializationType sType in types) {\n\t\t\t\t\tType type = sType.Type;\n\t\t\t\t\tif (type.HasElementType) {\n\t\t\t\t\t\tif (type.IsArray) {\n\t\t\t\t\t\t\tif (type.GetArrayRank() == 1)\n\t\t\t\t\t\t\t\twriter.Write(Type_SZArray);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tWriteTypeID(type.GetElementType());\n\t\t\t\t\t} else if (type.IsGenericType && !type.IsGenericTypeDefinition) {\n\t\t\t\t\t\twriter.Write(Type_ParameterizedType);\n\t\t\t\t\t\tWriteTypeID(type.GetGenericTypeDefinition());\n\t\t\t\t\t\tforeach (Type typeArg in type.GetGenericArguments()) {\n\t\t\t\t\t\t\tWriteTypeID(typeArg);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (type.IsValueType) {\n\t\t\t\t\t\t\twriter.Write(Type_ValueType);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twriter.Write(Type_ReferenceType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (assemblyNames.Count <= ushort.MaxValue)\n\t\t\t\t\t\t\twriter.Write((ushort)sType.AssemblyNameID);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\twriter.Write(sType.AssemblyNameID);\n\t\t\t\t\t\twriter.Write(sType.TypeName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (SerializationType sType in types) {\n\t\t\t\t\tType type = sType.Type;\n\t\t\t\t\tif (type.IsGenericTypeDefinition || type.HasElementType)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\twriter.Write(FastSerializerVersionAttribute.GetVersionNumber(type));\n\t\t\t\t\tif (type.IsPrimitive || typeof(ISerializable).IsAssignableFrom(type)) {\n\t\t\t\t\t\twriter.Write(byte.MaxValue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar fields = GetSerializableFields(type);\n\t\t\t\t\t\tif (fields.Count >= byte.MaxValue)\n\t\t\t\t\t\t\tthrow new SerializationException(\"Too many fields.\");\n\t\t\t\t\t\twriter.Write((byte)fields.Count);\n\t\t\t\t\t\tforeach (var field in fields) {\n\t\t\t\t\t\t\tWriteTypeID(field.FieldType);\n\t\t\t\t\t\t\twriter.Write(field.Name);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Write out information necessary to create the instances\n\t\t\t\t// starting from 1, because index 0 is null\n\t\t\t\tfor (int i = 1 + fixedInstanceCount; i < instances.Count; i++) {\n\t\t\t\t\tSerializationType sType = objectTypes[i];\n\t\t\t\t\tif (types.Count <= ushort.MaxValue)\n\t\t\t\t\t\twriter.Write((ushort)sType.ID);\n\t\t\t\t\telse\n\t\t\t\t\t\twriter.Write(sType.ID);\n\t\t\t\t\tif (sType == stringType) {\n\t\t\t\t\t\t// Strings are written to the output immediately\n\t\t\t\t\t\t// - we can't create an empty string and fill it later\n\t\t\t\t\t\twriter.Write((string)instances[i]);\n\t\t\t\t\t} else if (sType.Type.IsArray) {\n\t\t\t\t\t\t// For arrays, write down the length, because we need that to create the array instance\n\t\t\t\t\t\twriter.Write(((Array)instances[i]).Length);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Write out information necessary to fill data into the instances\n\t\t\t\tfor (int i = 1 + fixedInstanceCount; i < instances.Count; i++) {\n\t\t\t\t\tLog(\"0x{2:x6}, Write #{0}: {1}\", i, objectTypes[i].Type.Name, writer.BaseStream.Position);\n\t\t\t\t\tobjectTypes[i].Writer(this, instances[i]);\n\t\t\t\t}\n\t\t\t\tLog(\"Serialization done.\");\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t\t\n\t\t#region Object Scanners\n\t\tdelegate void ObjectScanner(SerializationContext context, object instance);\n\t\t\n\t\tstatic readonly MethodInfo mark = typeof(SerializationContext).GetMethod(\"Mark\", new[] { typeof(object) });\n\t\tstatic readonly FieldInfo writerField = typeof(SerializationContext).GetField(\"writer\");\n\t\t\n\t\tDictionary<Type, ObjectScanner> scanners = new Dictionary<Type, ObjectScanner>();\n\t\t\n\t\tObjectScanner GetScanner(Type type)\n\t\t{\n\t\t\tObjectScanner scanner;\n\t\t\tif (!scanners.TryGetValue(type, out scanner)) {\n\t\t\t\tscanner = CreateScanner(type);\n\t\t\t\tscanners.Add(type, scanner);\n\t\t\t}\n\t\t\treturn scanner;\n\t\t}\n\t\t\n\t\tObjectScanner CreateScanner(Type type)\n\t\t{\n\t\t\tbool isArray = type.IsArray;\n\t\t\tif (isArray) {\n\t\t\t\tif (type.GetArrayRank() != 1)\n\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\ttype = type.GetElementType();\n\t\t\t\tif (!type.IsValueType) {\n\t\t\t\t\treturn delegate (SerializationContext context, object array) {\n\t\t\t\t\t\tforeach (object val in (object[])array) {\n\t\t\t\t\t\t\tcontext.Mark(val);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Type baseType = type; baseType != null; baseType = baseType.BaseType) {\n\t\t\t\tif (!baseType.IsSerializable)\n\t\t\t\t\tthrow new SerializationException(\"Type \" + baseType + \" is not [Serializable].\");\n\t\t\t}\n\t\t\tList<FieldInfo> fields = GetSerializableFields(type);\n\t\t\tfields.RemoveAll(f => !IsReferenceOrContainsReferences(f.FieldType));\n\t\t\tif (fields.Count == 0) {\n\t\t\t\t// The scanner has nothing to do for this object.\n\t\t\t\treturn delegate { };\n\t\t\t}\n\t\t\t\n\t\t\tDynamicMethod dynamicMethod = new DynamicMethod(\n\t\t\t\t(isArray ? \"ScanArray_\" : \"Scan_\") + type.Name,\n\t\t\t\ttypeof(void), new [] { typeof(SerializationContext), typeof(object) },\n\t\t\t\ttrue);\n\t\t\tILGenerator il = dynamicMethod.GetILGenerator();\n\t\t\t\n\t\t\t\n\t\t\tif (isArray) {\n\t\t\t\tvar instance = il.DeclareLocal(type.MakeArrayType());\n\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\til.Emit(OpCodes.Castclass, type.MakeArrayType());\n\t\t\t\til.Emit(OpCodes.Stloc, instance); // instance = (type[])arg_1;\n\t\t\t\t\n\t\t\t\t// for (int i = 0; i < instance.Length; i++) scan instance[i];\n\t\t\t\tvar loopStart = il.DefineLabel();\n\t\t\t\tvar loopHead = il.DefineLabel();\n\t\t\t\tvar loopVariable = il.DeclareLocal(typeof(int));\n\t\t\t\til.Emit(OpCodes.Ldc_I4_0);\n\t\t\t\til.Emit(OpCodes.Stloc, loopVariable); // loopVariable = 0\n\t\t\t\til.Emit(OpCodes.Br, loopHead); // goto loopHead;\n\t\t\t\t\n\t\t\t\til.MarkLabel(loopStart);\n\t\t\t\t\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable\n\t\t\t\til.Emit(OpCodes.Ldelem, type); // &instance[loopVariable]\n\t\t\t\tEmitScanValueType(il, type);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // loopVariable\n\t\t\t\til.Emit(OpCodes.Ldc_I4_1); // loopVariable, 1\n\t\t\t\til.Emit(OpCodes.Add); // loopVariable+1\n\t\t\t\til.Emit(OpCodes.Stloc, loopVariable); // loopVariable++;\n\t\t\t\t\n\t\t\t\til.MarkLabel(loopHead);\n\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // loopVariable\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // loopVariable, instance\n\t\t\t\til.Emit(OpCodes.Ldlen); // loopVariable, instance.Length\n\t\t\t\til.Emit(OpCodes.Conv_I4);\n\t\t\t\til.Emit(OpCodes.Blt, loopStart); // if (loopVariable < instance.Length) goto loopStart;\n\t\t\t} else if (type.IsValueType) {\n\t\t\t\t// boxed value type\n\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\til.Emit(OpCodes.Unbox_Any, type);\n\t\t\t\tEmitScanValueType(il, type);\n\t\t\t} else {\n\t\t\t\t// reference type\n\t\t\t\tvar instance = il.DeclareLocal(type);\n\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\til.Emit(OpCodes.Castclass, type);\n\t\t\t\til.Emit(OpCodes.Stloc, instance); // instance = (type)arg_1;\n\t\t\t\t\n\t\t\t\tforeach (FieldInfo field in fields) {\n\t\t\t\t\tEmitScanField(il, instance, field); // scan instance.Field\n\t\t\t\t}\n\t\t\t}\n\t\t\til.Emit(OpCodes.Ret);\n\t\t\treturn (ObjectScanner)dynamicMethod.CreateDelegate(typeof(ObjectScanner));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Emit 'scan instance.Field'.\n\t\t/// Stack transition: ... => ...\n\t\t/// </summary>\n\t\tvoid EmitScanField(ILGenerator il, LocalBuilder instance, FieldInfo field)\n\t\t{\n\t\t\tif (field.FieldType.IsValueType) {\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\til.Emit(OpCodes.Ldfld, field); // instance.field\n\t\t\t\tEmitScanValueType(il, field.FieldType);\n\t\t\t} else {\n\t\t\t\til.Emit(OpCodes.Ldarg_0); // context\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // context, instance\n\t\t\t\til.Emit(OpCodes.Ldfld, field); // context, instance.field\n\t\t\t\til.Emit(OpCodes.Call, mark); // context.Mark(instance.field);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Stack transition: ..., value => ...\n\t\t/// </summary>\n\t\tvoid EmitScanValueType(ILGenerator il, Type valType)\n\t\t{\n\t\t\tvar fieldRef = il.DeclareLocal(valType);\n\t\t\til.Emit(OpCodes.Stloc, fieldRef);\n\t\t\t\n\t\t\tforeach (FieldInfo field in GetSerializableFields(valType)) {\n\t\t\t\tif (IsReferenceOrContainsReferences(field.FieldType)) {\n\t\t\t\t\tEmitScanField(il, fieldRef, field);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic List<FieldInfo> GetSerializableFields(Type type)\n\t\t{\n\t\t\tList<FieldInfo> fields = new List<FieldInfo>();\n\t\t\tfor (Type baseType = type; baseType != null; baseType = baseType.BaseType) {\n\t\t\t\tFieldInfo[] declFields = baseType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly);\n\t\t\t\tArray.Sort(declFields, (a,b) => string.Compare(a.Name, b.Name, StringComparison.Ordinal));\n\t\t\t\tfields.AddRange(declFields);\n\t\t\t}\n\t\t\tfields.RemoveAll(f => f.IsNotSerialized);\n\t\t\treturn fields;\n\t\t}\n\n\t\tstatic bool IsReferenceOrContainsReferences(Type type)\n\t\t{\n\t\t\tif (!type.IsValueType)\n\t\t\t\treturn true;\n\t\t\tif (type.IsPrimitive)\n\t\t\t\treturn false;\n\t\t\tforeach (FieldInfo field in GetSerializableFields(type)) {\n\t\t\t\tif (IsReferenceOrContainsReferences(field.FieldType))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\n\t\t#region Object Writers\n\t\tdelegate void ObjectWriter(SerializationContext context, object instance);\n\n\t\tstatic readonly MethodInfo writeObjectID = typeof(SerializationContext).GetMethod(\"WriteObjectID\", new[] { typeof(object) });\n\n\t\tstatic readonly MethodInfo writeByte = typeof(BinaryWriter).GetMethod(\"Write\", new[] { typeof(byte) });\n\t\tstatic readonly MethodInfo writeShort = typeof(BinaryWriter).GetMethod(\"Write\", new[] { typeof(short) });\n\t\tstatic readonly MethodInfo writeInt = typeof(BinaryWriter).GetMethod(\"Write\", new[] { typeof(int) });\n\t\tstatic readonly MethodInfo writeLong = typeof(BinaryWriter).GetMethod(\"Write\", new[] { typeof(long) });\n\t\tstatic readonly MethodInfo writeFloat = typeof(BinaryWriter).GetMethod(\"Write\", new[] { typeof(float) });\n\t\tstatic readonly MethodInfo writeDouble = typeof(BinaryWriter).GetMethod(\"Write\", new[] { typeof(double) });\n\t\tOpCode callVirt = OpCodes.Callvirt;\n\n\t\tstatic readonly ObjectWriter serializationInfoWriter = delegate(SerializationContext context, object instance) {\n\t\t\tBinaryWriter writer = context.writer;\n\t\t\tSerializationInfo info = (SerializationInfo)instance;\n\t\t\twriter.Write(info.MemberCount);\n\t\t\tforeach (SerializationEntry entry in info) {\n\t\t\t\twriter.Write(entry.Name);\n\t\t\t\tcontext.WriteObjectID(entry.Value);\n\t\t\t}\n\t\t};\n\n\t\tDictionary<Type, ObjectWriter> writers = new Dictionary<Type, ObjectWriter>();\n\n\t\tObjectWriter GetWriter(Type type)\n\t\t{\n\t\t\tObjectWriter writer;\n\t\t\tif (!writers.TryGetValue(type, out writer)) {\n\t\t\t\twriter = CreateWriter(type);\n\t\t\t\twriters.Add(type, writer);\n\t\t\t}\n\t\t\treturn writer;\n\t\t}\n\n\t\tObjectWriter CreateWriter(Type type)\n\t\t{\n\t\t\tif (type == typeof(string)) {\n\t\t\t\t// String contents are written in the object creation section,\n\t\t\t\t// not into the field value section.\n\t\t\t\treturn delegate {};\n\t\t\t}\n\t\t\tbool isArray = type.IsArray;\n\t\t\tif (isArray) {\n\t\t\t\tif (type.GetArrayRank() != 1)\n\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\ttype = type.GetElementType();\n\t\t\t\tif (!type.IsValueType) {\n\t\t\t\t\treturn delegate (SerializationContext context, object array) {\n\t\t\t\t\t\tforeach (object val in (object[])array) {\n\t\t\t\t\t\t\tcontext.WriteObjectID(val);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t} else if (type == typeof(byte)) {\n\t\t\t\t\treturn delegate (SerializationContext context, object array) {\n\t\t\t\t\t\tcontext.writer.Write((byte[])array);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tList<FieldInfo> fields = GetSerializableFields(type);\n\t\t\tif (fields.Count == 0) {\n\t\t\t\t// The writer has nothing to do for this object.\n\t\t\t\treturn delegate { };\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tDynamicMethod dynamicMethod = new DynamicMethod(\n\t\t\t\t(isArray ? \"WriteArray_\" : \"Write_\") + type.Name,\n\t\t\t\ttypeof(void), new [] { typeof(SerializationContext), typeof(object) },\n\t\t\t\ttrue);\n\t\t\tILGenerator il = dynamicMethod.GetILGenerator();\n\t\t\t\n\t\t\tvar writer = il.DeclareLocal(typeof(BinaryWriter));\n\t\t\t\n\t\t\til.Emit(OpCodes.Ldarg_0);\n\t\t\til.Emit(OpCodes.Ldfld, writerField);\n\t\t\til.Emit(OpCodes.Stloc, writer); // writer = context.writer;\n\t\t\t\n\t\t\tif (isArray) {\n\t\t\t\tvar instance = il.DeclareLocal(type.MakeArrayType());\n\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\til.Emit(OpCodes.Castclass, type.MakeArrayType());\n\t\t\t\til.Emit(OpCodes.Stloc, instance); // instance = (type[])arg_1;\n\t\t\t\t\n\t\t\t\t// for (int i = 0; i < instance.Length; i++) write instance[i];\n\t\t\t\t\n\t\t\t\tvar loopStart = il.DefineLabel();\n\t\t\t\tvar loopHead = il.DefineLabel();\n\t\t\t\tvar loopVariable = il.DeclareLocal(typeof(int));\n\t\t\t\til.Emit(OpCodes.Ldc_I4_0);\n\t\t\t\til.Emit(OpCodes.Stloc, loopVariable); // loopVariable = 0\n\t\t\t\til.Emit(OpCodes.Br, loopHead); // goto loopHead;\n\t\t\t\t\n\t\t\t\til.MarkLabel(loopStart);\n\t\t\t\t\n\t\t\t\tif (type.IsEnum || type.IsPrimitive) {\n\t\t\t\t\tif (type.IsEnum) {\n\t\t\t\t\t\ttype = type.GetEnumUnderlyingType();\n\t\t\t\t\t}\n\t\t\t\t\tDebug.Assert(type.IsPrimitive);\n\t\t\t\t\til.Emit(OpCodes.Ldloc, writer); // writer\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // writer, instance\n\t\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // writer, instance, loopVariable\n\t\t\t\t\tswitch (Type.GetTypeCode(type)) {\n\t\t\t\t\t\tcase TypeCode.Boolean:\n\t\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\t\t\til.Emit(OpCodes.Ldelem_I1); // writer, instance[loopVariable]\n\t\t\t\t\t\t\til.Emit(callVirt, writeByte); // writer.Write(instance[loopVariable]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Char:\n\t\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\t\t\til.Emit(OpCodes.Ldelem_I2); // writer, instance[loopVariable]\n\t\t\t\t\t\t\til.Emit(callVirt, writeShort); // writer.Write(instance[loopVariable]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\t\t\til.Emit(OpCodes.Ldelem_I4);  // writer, instance[loopVariable]\n\t\t\t\t\t\t\til.Emit(callVirt, writeInt); // writer.Write(instance[loopVariable]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\t\t\til.Emit(OpCodes.Ldelem_I8);  // writer, instance[loopVariable]\n\t\t\t\t\t\t\til.Emit(callVirt, writeLong); // writer.Write(instance[loopVariable]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\t\t\til.Emit(OpCodes.Ldelem_R4);  // writer, instance[loopVariable]\n\t\t\t\t\t\t\til.Emit(callVirt, writeFloat); // writer.Write(instance[loopVariable]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\t\t\til.Emit(OpCodes.Ldelem_R8);  // writer, instance[loopVariable]\n\t\t\t\t\t\t\til.Emit(callVirt, writeDouble); // writer.Write(instance[loopVariable]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new NotSupportedException(\"Unknown primitive type \" + type);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable\n\t\t\t\t\til.Emit(OpCodes.Ldelem, type); // instance[loopVariable]\n\t\t\t\t\tEmitWriteValueType(il, writer, type);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // loopVariable\n\t\t\t\til.Emit(OpCodes.Ldc_I4_1); // loopVariable, 1\n\t\t\t\til.Emit(OpCodes.Add); // loopVariable+1\n\t\t\t\til.Emit(OpCodes.Stloc, loopVariable); // loopVariable++;\n\t\t\t\t\n\t\t\t\til.MarkLabel(loopHead);\n\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // loopVariable\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // loopVariable, instance\n\t\t\t\til.Emit(OpCodes.Ldlen); // loopVariable, instance.Length\n\t\t\t\til.Emit(OpCodes.Conv_I4);\n\t\t\t\til.Emit(OpCodes.Blt, loopStart); // if (loopVariable < instance.Length) goto loopStart;\n\t\t\t} else if (type.IsValueType) {\n\t\t\t\t// boxed value type\n\t\t\t\tif (type.IsEnum || type.IsPrimitive) {\n\t\t\t\t\til.Emit(OpCodes.Ldloc, writer);\n\t\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\t\til.Emit(OpCodes.Unbox_Any, type);\n\t\t\t\t\tWritePrimitiveValue(il, type);\n\t\t\t\t} else {\n\t\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\t\til.Emit(OpCodes.Unbox_Any, type);\n\t\t\t\t\tEmitWriteValueType(il, writer, type);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// reference type\n\t\t\t\tvar instance = il.DeclareLocal(type);\n\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\til.Emit(OpCodes.Castclass, type);\n\t\t\t\til.Emit(OpCodes.Stloc, instance); // instance = (type)arg_1;\n\t\t\t\t\n\t\t\t\tforeach (FieldInfo field in fields) {\n\t\t\t\t\tEmitWriteField(il, writer, instance, field); // write instance.Field\n\t\t\t\t}\n\t\t\t}\n\t\t\til.Emit(OpCodes.Ret);\n\t\t\treturn (ObjectWriter)dynamicMethod.CreateDelegate(typeof(ObjectWriter));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Emit 'write instance.Field'.\n\t\t/// Stack transition: ... => ...\n\t\t/// </summary>\n\t\tvoid EmitWriteField(ILGenerator il, LocalBuilder writer, LocalBuilder instance, FieldInfo field)\n\t\t{\n\t\t\tType fieldType = field.FieldType;\n\t\t\tif (fieldType.IsValueType) {\n\t\t\t\tif (fieldType.IsPrimitive || fieldType.IsEnum) {\n\t\t\t\t\til.Emit(OpCodes.Ldloc, writer); // writer\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // writer, instance\n\t\t\t\t\til.Emit(OpCodes.Ldfld, field); // writer, instance.field\n\t\t\t\t\tWritePrimitiveValue(il, fieldType);\n\t\t\t\t} else {\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\t\til.Emit(OpCodes.Ldfld, field); // instance.field\n\t\t\t\t\tEmitWriteValueType(il, writer, fieldType);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\til.Emit(OpCodes.Ldarg_0); // context\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // context, instance\n\t\t\t\til.Emit(OpCodes.Ldfld, field); // context, instance.field\n\t\t\t\til.Emit(OpCodes.Call, writeObjectID); // context.WriteObjectID(instance.field);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Writes a primitive value of the specified type.\n\t\t/// Stack transition: ..., writer, value => ...\n\t\t/// </summary>\n\t\tvoid WritePrimitiveValue(ILGenerator il, Type fieldType)\n\t\t{\n\t\t\tif (fieldType.IsEnum) {\n\t\t\t\tfieldType = fieldType.GetEnumUnderlyingType();\n\t\t\t\tDebug.Assert(fieldType.IsPrimitive);\n\t\t\t}\n\t\t\tswitch (Type.GetTypeCode(fieldType)) {\n\t\t\t\tcase TypeCode.Boolean:\n\t\t\t\tcase TypeCode.SByte:\n\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\til.Emit(callVirt, writeByte); // writer.Write(value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Char:\n\t\t\t\tcase TypeCode.Int16:\n\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\til.Emit(callVirt, writeShort); // writer.Write(value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Int32:\n\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\til.Emit(callVirt, writeInt); // writer.Write(value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Int64:\n\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\til.Emit(callVirt, writeLong); // writer.Write(value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\til.Emit(callVirt, writeFloat); // writer.Write(value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\til.Emit(callVirt, writeDouble); // writer.Write(value);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Unknown primitive type \" + fieldType);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Stack transition: ..., value => ...\n\t\t/// </summary>\n\t\tvoid EmitWriteValueType(ILGenerator il, LocalBuilder writer, Type valType)\n\t\t{\n\t\t\tDebug.Assert(valType.IsValueType);\n\t\t\tDebug.Assert(!(valType.IsEnum || valType.IsPrimitive));\n\t\t\t\n\t\t\tvar fieldVal = il.DeclareLocal(valType);\n\t\t\til.Emit(OpCodes.Stloc, fieldVal);\n\t\t\t\n\t\t\tforeach (FieldInfo field in GetSerializableFields(valType)) {\n\t\t\t\tEmitWriteField(il, writer, fieldVal, field);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tStreamingContext streamingContext = new StreamingContext(StreamingContextStates.All);\n\t\tFormatterConverter formatterConverter = new FormatterConverter();\n\n\t\tpublic void Serialize(Stream stream, object instance)\n\t\t{\n\t\t\tSerialize(new BinaryWriterWith7BitEncodedInts(stream), instance);\n\t\t}\n\n\t\tpublic void Serialize(BinaryWriter writer, object instance)\n\t\t{\n\t\t\tSerializationContext context = new SerializationContext(this, writer);\n\t\t\tcontext.MarkFixedInstances(this.FixedInstances);\n\t\t\tcontext.Mark(instance);\n\t\t\tcontext.Scan();\n\t\t\tcontext.ScanTypes();\n\t\t\tcontext.Write();\n\t\t\tcontext.WriteObjectID(instance);\n\t\t}\n\n\t\tdelegate void TypeSerializer(object instance, SerializationContext context);\n\t\t#endregion\n\n\t\t#region Deserialization\n\t\tsealed class DeserializationContext\n\t\t{\n\t\t\tpublic Type[] Types; // index: type ID\n\t\t\t\n\t\t\tpublic object[] Objects; // index: object ID\n\t\t\t\n\t\t\tpublic BinaryReader Reader;\n\t\t\t\n\t\t\tpublic object ReadObject()\n\t\t\t{\n\t\t\t\tif (this.Objects.Length <= ushort.MaxValue)\n\t\t\t\t\treturn this.Objects[Reader.ReadUInt16()];\n\t\t\t\telse\n\t\t\t\t\treturn this.Objects[Reader.ReadInt32()];\n\t\t\t}\n\t\t\t\n\t\t\t#region DeserializeTypeDescriptions\n\t\t\tinternal int ReadTypeID()\n\t\t\t{\n\t\t\t\tif (this.Types.Length <= ushort.MaxValue)\n\t\t\t\t\treturn Reader.ReadUInt16();\n\t\t\t\telse\n\t\t\t\t\treturn Reader.ReadInt32();\n\t\t\t}\n\t\t\t\n\t\t\tinternal void DeserializeTypeDescriptions()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.Types.Length; i++) {\n\t\t\t\t\tType type = this.Types[i];\n\t\t\t\t\tif (type.IsGenericTypeDefinition || type.HasElementType)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tint versionNumber = Reader.ReadInt32();\n\t\t\t\t\tif (versionNumber != FastSerializerVersionAttribute.GetVersionNumber(type))\n\t\t\t\t\t\tthrow new SerializationException(\"Type '\" + type.FullName + \"' was serialized with version \" + versionNumber + \", but is version \" + FastSerializerVersionAttribute.GetVersionNumber(type));\n\t\t\t\t\t\n\t\t\t\t\tbool isCustomSerialization = typeof(ISerializable).IsAssignableFrom(type);\n\t\t\t\t\tbool typeIsSpecial = type.IsPrimitive || isCustomSerialization;\n\t\t\t\t\t\n\t\t\t\t\tbyte serializedFieldCount = Reader.ReadByte();\n\t\t\t\t\tif (serializedFieldCount == byte.MaxValue) {\n\t\t\t\t\t\t// special type\n\t\t\t\t\t\tif (!typeIsSpecial)\n\t\t\t\t\t\t\tthrow new SerializationException(\"Type '\" + type.FullName + \"' was serialized as special type, but isn't special now.\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (typeIsSpecial)\n\t\t\t\t\t\t\tthrow new SerializationException(\"Type '\" + type.FullName + \"' wasn't serialized as special type, but is special now.\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar availableFields = GetSerializableFields(this.Types[i]);\n\t\t\t\t\t\tif (availableFields.Count != serializedFieldCount)\n\t\t\t\t\t\t\tthrow new SerializationException(\"Number of fields on \" + type.FullName + \" has changed.\");\n\t\t\t\t\t\tfor (int j = 0; j < serializedFieldCount; j++) {\n\t\t\t\t\t\t\tint fieldTypeID = ReadTypeID();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tstring fieldName = Reader.ReadString();\n\t\t\t\t\t\t\tFieldInfo fieldInfo = availableFields[j];\n\t\t\t\t\t\t\tif (fieldInfo.Name != fieldName)\n\t\t\t\t\t\t\t\tthrow new SerializationException(\"Field mismatch on type \" + type.FullName);\n\t\t\t\t\t\t\tif (fieldInfo.FieldType != this.Types[fieldTypeID])\n\t\t\t\t\t\t\t\tthrow new SerializationException(type.FullName + \".\" + fieldName + \" was serialized as \" + this.Types[fieldTypeID] + \", but now is \" + fieldInfo.FieldType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t\t\n\t\tdelegate void ObjectReader(DeserializationContext context, object instance);\n\t\t\n\t\tpublic object Deserialize(Stream stream)\n\t\t{\n\t\t\treturn Deserialize(new BinaryReaderWith7BitEncodedInts(stream));\n\t\t}\n\t\t\n\t\tpublic object Deserialize(BinaryReader reader)\n\t\t{\n\t\t\tif (reader.ReadInt32() != magic)\n\t\t\t\tthrow new SerializationException(\"The data cannot be read by FastSerializer (unknown magic value)\");\n\t\t\t\n\t\t\tDeserializationContext context = new DeserializationContext();\n\t\t\tcontext.Reader = reader;\n\t\t\tcontext.Objects = new object[reader.ReadInt32()];\n\t\t\tcontext.Types = new Type[reader.ReadInt32()];\n\t\t\tstring[] assemblyNames = new string[reader.ReadInt32()];\n\t\t\tint fixedInstanceCount = reader.ReadInt32();\n\t\t\t\n\t\t\tif (fixedInstanceCount != 0) {\n\t\t\t\tif (this.FixedInstances == null || this.FixedInstances.Length != fixedInstanceCount)\n\t\t\t\t\tthrow new SerializationException(\"Number of fixed instances doesn't match\");\n\t\t\t\tfor (int i = 0; i < fixedInstanceCount; i++) {\n\t\t\t\t\tcontext.Objects[i + 1] = this.FixedInstances[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < assemblyNames.Length; i++) {\n\t\t\t\tassemblyNames[i] = reader.ReadString();\n\t\t\t}\n\t\t\tint stringTypeID = -1;\n\t\t\tfor (int i = 0; i < context.Types.Length; i++) {\n\t\t\t\tbyte typeKind = reader.ReadByte();\n\t\t\t\tswitch (typeKind) {\n\t\t\t\t\tcase Type_ReferenceType:\n\t\t\t\t\tcase Type_ValueType:\n\t\t\t\t\t\tint assemblyID;\n\t\t\t\t\t\tif (assemblyNames.Length <= ushort.MaxValue)\n\t\t\t\t\t\t\tassemblyID = reader.ReadUInt16();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tassemblyID = reader.ReadInt32();\n\t\t\t\t\t\tstring assemblyName = assemblyNames[assemblyID];\n\t\t\t\t\t\tstring typeName = reader.ReadString();\n\t\t\t\t\t\tType type;\n\t\t\t\t\t\tif (SerializationBinder != null) {\n\t\t\t\t\t\t\ttype = SerializationBinder.BindToType(assemblyName, typeName);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttype = Assembly.Load(assemblyName).GetType(typeName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (type == null)\n\t\t\t\t\t\t\tthrow new SerializationException(\"Could not find '\" + typeName + \"' in '\" + assemblyName + \"'\");\n\t\t\t\t\t\tif (typeKind == Type_ValueType && !type.IsValueType)\n\t\t\t\t\t\t\tthrow new SerializationException(\"Expected '\" + typeName + \"' to be a value type, but it is reference type\");\n\t\t\t\t\t\tif (typeKind == Type_ReferenceType && type.IsValueType)\n\t\t\t\t\t\t\tthrow new SerializationException(\"Expected '\" + typeName + \"' to be a reference type, but it is value type\");\n\t\t\t\t\t\tcontext.Types[i] = type;\n\t\t\t\t\t\tif (type == typeof(string))\n\t\t\t\t\t\t\tstringTypeID = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Type_SZArray:\n\t\t\t\t\t\tcontext.Types[i] = context.Types[context.ReadTypeID()].MakeArrayType();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Type_ParameterizedType:\n\t\t\t\t\t\tType genericType = context.Types[context.ReadTypeID()];\n\t\t\t\t\t\tint typeParameterCount = genericType.GetGenericArguments().Length;\n\t\t\t\t\t\tType[] typeArguments = new Type[typeParameterCount];\n\t\t\t\t\t\tfor (int j = 0; j < typeArguments.Length; j++) {\n\t\t\t\t\t\t\ttypeArguments[j] = context.Types[context.ReadTypeID()];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontext.Types[i] = genericType.MakeGenericType(typeArguments);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new SerializationException(\"Unknown type kind\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontext.DeserializeTypeDescriptions();\n\t\t\tint[] typeIDByObjectID = new int[context.Objects.Length];\n\t\t\tfor (int i = 1 + fixedInstanceCount; i < context.Objects.Length; i++) {\n\t\t\t\tint typeID = context.ReadTypeID();\n\t\t\t\t\n\t\t\t\tobject instance;\n\t\t\t\tif (typeID == stringTypeID) {\n\t\t\t\t\tinstance = reader.ReadString();\n\t\t\t\t} else {\n\t\t\t\t\tType type = context.Types[typeID];\n\t\t\t\t\tif (type.IsArray) {\n\t\t\t\t\t\tint length = reader.ReadInt32();\n\t\t\t\t\t\tinstance = Array.CreateInstance(type.GetElementType(), length);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinstance = FormatterServices.GetUninitializedObject(type);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontext.Objects[i] = instance;\n\t\t\t\ttypeIDByObjectID[i] = typeID;\n\t\t\t}\n\t\t\tList<CustomDeserialization> customDeserializatons = new List<CustomDeserialization>();\n\t\t\tObjectReader[] objectReaders = new ObjectReader[context.Types.Length]; // index: type ID\n\t\t\tfor (int i = 1 + fixedInstanceCount; i < context.Objects.Length; i++) {\n\t\t\t\tobject instance = context.Objects[i];\n\t\t\t\tint typeID = typeIDByObjectID[i];\n\t\t\t\tLog(\"0x{2:x6} Read #{0}: {1}\", i, context.Types[typeID].Name, reader.BaseStream.Position);\n\t\t\t\tISerializable serializable = instance as ISerializable;\n\t\t\t\tif (serializable != null) {\n\t\t\t\t\tType type = context.Types[typeID];\n\t\t\t\t\tSerializationInfo info = new SerializationInfo(type, formatterConverter);\n\t\t\t\t\tint count = reader.ReadInt32();\n\t\t\t\t\tfor (int j = 0; j < count; j++) {\n\t\t\t\t\t\tstring name = reader.ReadString();\n\t\t\t\t\t\tobject val = context.ReadObject();\n\t\t\t\t\t\tinfo.AddValue(name, val);\n\t\t\t\t\t}\n\t\t\t\t\tCustomDeserializationAction action = GetCustomDeserializationAction(type);\n\t\t\t\t\tcustomDeserializatons.Add(new CustomDeserialization(instance, info, action));\n\t\t\t\t} else {\n\t\t\t\t\tObjectReader objectReader = objectReaders[typeID];\n\t\t\t\t\tif (objectReader == null) {\n\t\t\t\t\t\tobjectReader = GetReader(context.Types[typeID]);\n\t\t\t\t\t\tobjectReaders[typeID] = objectReader;\n\t\t\t\t\t}\n\t\t\t\t\tobjectReader(context, instance);\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog(\"File was read successfully, now running {0} custom deserializations...\", customDeserializatons.Count);\n\t\t\tforeach (CustomDeserialization customDeserializaton in customDeserializatons) {\n\t\t\t\tcustomDeserializaton.Run(streamingContext);\n\t\t\t}\n\t\t\tfor (int i = 1 + fixedInstanceCount; i < context.Objects.Length; i++) {\n\t\t\t\tIDeserializationCallback dc = context.Objects[i] as IDeserializationCallback;\n\t\t\t\tif (dc != null)\n\t\t\t\t\tdc.OnDeserialization(null);\n\t\t\t}\n\t\t\t\n\t\t\treturn context.ReadObject();\n\t\t}\n\t\t\n\t\t#region Object Reader\n\t\tstatic readonly FieldInfo readerField = typeof(DeserializationContext).GetField(\"Reader\");\n\t\tstatic readonly MethodInfo readObject = typeof(DeserializationContext).GetMethod(\"ReadObject\");\n\t\t\n\t\tstatic readonly MethodInfo readByte = typeof(BinaryReader).GetMethod(\"ReadByte\");\n\t\tstatic readonly MethodInfo readShort = typeof(BinaryReader).GetMethod(\"ReadInt16\");\n\t\tstatic readonly MethodInfo readInt = typeof(BinaryReader).GetMethod(\"ReadInt32\");\n\t\tstatic readonly MethodInfo readLong = typeof(BinaryReader).GetMethod(\"ReadInt64\");\n\t\tstatic readonly MethodInfo readFloat = typeof(BinaryReader).GetMethod(\"ReadSingle\");\n\t\tstatic readonly MethodInfo readDouble = typeof(BinaryReader).GetMethod(\"ReadDouble\");\n\t\t\n\t\tDictionary<Type, ObjectReader> readers = new Dictionary<Type, ObjectReader>();\n\n\t\tObjectReader GetReader(Type type)\n\t\t{\n\t\t\tObjectReader reader;\n\t\t\tif (!readers.TryGetValue(type, out reader)) {\n\t\t\t\treader = CreateReader(type);\n\t\t\t\treaders.Add(type, reader);\n\t\t\t}\n\t\t\treturn reader;\n\t\t}\n\t\t\n\t\tObjectReader CreateReader(Type type)\n\t\t{\n\t\t\tif (type == typeof(string)) {\n\t\t\t\t// String contents are written in the object creation section,\n\t\t\t\t// not into the field value section; so there's nothing to read here.\n\t\t\t\treturn delegate {};\n\t\t\t}\n\t\t\tbool isArray = type.IsArray;\n\t\t\tif (isArray) {\n\t\t\t\tif (type.GetArrayRank() != 1)\n\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\ttype = type.GetElementType();\n\t\t\t\tif (!type.IsValueType) {\n\t\t\t\t\treturn delegate (DeserializationContext context, object arrayInstance) {\n\t\t\t\t\t\tobject[] array = (object[])arrayInstance;\n\t\t\t\t\t\tfor (int i = 0; i < array.Length; i++) {\n\t\t\t\t\t\t\tarray[i] = context.ReadObject();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t} else if (type == typeof(byte)) {\n\t\t\t\t\treturn delegate (DeserializationContext context, object arrayInstance) {\n\t\t\t\t\t\tbyte[] array = (byte[])arrayInstance;\n\t\t\t\t\t\tBinaryReader binaryReader = context.Reader;\n\t\t\t\t\t\tint pos = 0;\n\t\t\t\t\t\tint bytesRead;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tbytesRead = binaryReader.Read(array, pos, array.Length - pos);\n\t\t\t\t\t\t\tpos += bytesRead;\n\t\t\t\t\t\t} while (bytesRead > 0);\n\t\t\t\t\t\tif (pos != array.Length)\n\t\t\t\t\t\t\tthrow new EndOfStreamException();\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar fields = GetSerializableFields(type);\n\t\t\tif (fields.Count == 0) {\n\t\t\t\t// The reader has nothing to do for this object.\n\t\t\t\treturn delegate { };\n\t\t\t}\n\t\t\t\n\t\t\tDynamicMethod dynamicMethod = new DynamicMethod(\n\t\t\t\t(isArray ? \"ReadArray_\" : \"Read_\") + type.Name,\n\t\t\t\tMethodAttributes.Public | MethodAttributes.Static,\n\t\t\t\tCallingConventions.Standard,\n\t\t\t\ttypeof(void), new [] { typeof(DeserializationContext), typeof(object) },\n\t\t\t\ttype,\n\t\t\t\ttrue);\n\t\t\tILGenerator il = dynamicMethod.GetILGenerator();\n\t\t\t\n\t\t\tvar reader = il.DeclareLocal(typeof(BinaryReader));\n\t\t\t\n\t\t\til.Emit(OpCodes.Ldarg_0);\n\t\t\til.Emit(OpCodes.Ldfld, readerField);\n\t\t\til.Emit(OpCodes.Stloc, reader); // reader = context.reader;\n\t\t\t\n\t\t\tif (isArray) {\n\t\t\t\tvar instance = il.DeclareLocal(type.MakeArrayType());\n\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\til.Emit(OpCodes.Castclass, type.MakeArrayType());\n\t\t\t\til.Emit(OpCodes.Stloc, instance); // instance = (type[])arg_1;\n\t\t\t\t\n\t\t\t\t// for (int i = 0; i < instance.Length; i++) read &instance[i];\n\t\t\t\t\n\t\t\t\tvar loopStart = il.DefineLabel();\n\t\t\t\tvar loopHead = il.DefineLabel();\n\t\t\t\tvar loopVariable = il.DeclareLocal(typeof(int));\n\t\t\t\til.Emit(OpCodes.Ldc_I4_0);\n\t\t\t\til.Emit(OpCodes.Stloc, loopVariable); // loopVariable = 0\n\t\t\t\til.Emit(OpCodes.Br, loopHead); // goto loopHead;\n\t\t\t\t\n\t\t\t\til.MarkLabel(loopStart);\n\t\t\t\t\n\t\t\t\tif (type.IsEnum || type.IsPrimitive) {\n\t\t\t\t\tif (type.IsEnum) {\n\t\t\t\t\t\ttype = type.GetEnumUnderlyingType();\n\t\t\t\t\t}\n\t\t\t\t\tDebug.Assert(type.IsPrimitive);\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable\n\t\t\t\t\tReadPrimitiveValue(il, reader, type); // instance, loopVariable, value\n\t\t\t\t\tswitch (Type.GetTypeCode(type)) {\n\t\t\t\t\t\tcase TypeCode.Boolean:\n\t\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stelem_I1); // instance[loopVariable] = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Char:\n\t\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stelem_I2); // instance[loopVariable] = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stelem_I4); // instance[loopVariable] = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stelem_I8); // instance[loopVariable] = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stelem_R4); // instance[loopVariable] = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stelem_R8); // instance[loopVariable] = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new NotSupportedException(\"Unknown primitive type \" + type);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable\n\t\t\t\t\til.Emit(OpCodes.Ldelema, type); // instance[loopVariable]\n\t\t\t\t\tEmitReadValueType(il, reader, type);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // loopVariable\n\t\t\t\til.Emit(OpCodes.Ldc_I4_1); // loopVariable, 1\n\t\t\t\til.Emit(OpCodes.Add); // loopVariable+1\n\t\t\t\til.Emit(OpCodes.Stloc, loopVariable); // loopVariable++;\n\t\t\t\t\n\t\t\t\til.MarkLabel(loopHead);\n\t\t\t\til.Emit(OpCodes.Ldloc, loopVariable); // loopVariable\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // loopVariable, instance\n\t\t\t\til.Emit(OpCodes.Ldlen); // loopVariable, instance.Length\n\t\t\t\til.Emit(OpCodes.Conv_I4);\n\t\t\t\til.Emit(OpCodes.Blt, loopStart); // if (loopVariable < instance.Length) goto loopStart;\n\t\t\t} else if (type.IsValueType) {\n\t\t\t\t// boxed value type\n\t\t\t\til.Emit(OpCodes.Ldarg_1); // instance\n\t\t\t\til.Emit(OpCodes.Unbox, type); // &(Type)instance\n\t\t\t\tif (type.IsEnum || type.IsPrimitive) {\n\t\t\t\t\tif (type.IsEnum) {\n\t\t\t\t\t\ttype = type.GetEnumUnderlyingType();\n\t\t\t\t\t}\n\t\t\t\t\tDebug.Assert(type.IsPrimitive);\n\t\t\t\t\tReadPrimitiveValue(il, reader, type); // &(Type)instance, value\n\t\t\t\t\tswitch (Type.GetTypeCode(type)) {\n\t\t\t\t\t\tcase TypeCode.Boolean:\n\t\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stind_I1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Char:\n\t\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stind_I2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stind_I4);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stind_I8);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stind_R4);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\t\t\til.Emit(OpCodes.Stind_R8);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new NotSupportedException(\"Unknown primitive type \" + type);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tEmitReadValueType(il, reader, type);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// reference type\n\t\t\t\tvar instance = il.DeclareLocal(type);\n\t\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\t\til.Emit(OpCodes.Castclass, type);\n\t\t\t\til.Emit(OpCodes.Stloc, instance); // instance = (type)arg_1;\n\t\t\t\t\n\t\t\t\tforeach (FieldInfo field in fields) {\n\t\t\t\t\tEmitReadField(il, reader, instance, field); // read instance.Field\n\t\t\t\t}\n\t\t\t}\n\t\t\til.Emit(OpCodes.Ret);\n\t\t\treturn (ObjectReader)dynamicMethod.CreateDelegate(typeof(ObjectReader));\n\t\t}\n\n\t\tvoid EmitReadField(ILGenerator il, LocalBuilder reader, LocalBuilder instance, FieldInfo field)\n\t\t{\n\t\t\tType fieldType = field.FieldType;\n\t\t\tif (fieldType.IsValueType) {\n\t\t\t\tif (fieldType.IsPrimitive || fieldType.IsEnum) {\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\t\tReadPrimitiveValue(il, reader, fieldType); // instance, value\n\t\t\t\t\til.Emit(OpCodes.Stfld, field); // instance.field = value;\n\t\t\t\t} else {\n\t\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\t\til.Emit(OpCodes.Ldflda, field); // &instance.field\n\t\t\t\t\tEmitReadValueType(il, reader, fieldType);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\til.Emit(OpCodes.Ldloc, instance); // instance\n\t\t\t\til.Emit(OpCodes.Ldarg_0); // instance, context\n\t\t\t\til.Emit(OpCodes.Call, readObject); // instance, context.ReadObject()\n\t\t\t\til.Emit(OpCodes.Castclass, fieldType);\n\t\t\t\til.Emit(OpCodes.Stfld, field); // instance.field = (fieldType) context.ReadObject();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Reads a primitive value of the specified type.\n\t\t/// Stack transition: ... => ..., value\n\t\t/// </summary>\n\t\tvoid ReadPrimitiveValue(ILGenerator il, LocalBuilder reader, Type fieldType)\n\t\t{\n\t\t\tif (fieldType.IsEnum) {\n\t\t\t\tfieldType = fieldType.GetEnumUnderlyingType();\n\t\t\t\tDebug.Assert(fieldType.IsPrimitive);\n\t\t\t}\n\t\t\til.Emit(OpCodes.Ldloc, reader);\n\t\t\tswitch (Type.GetTypeCode(fieldType)) {\n\t\t\t\tcase TypeCode.Boolean:\n\t\t\t\tcase TypeCode.SByte:\n\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\til.Emit(callVirt, readByte);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Char:\n\t\t\t\tcase TypeCode.Int16:\n\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\til.Emit(callVirt, readShort);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Int32:\n\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\til.Emit(callVirt, readInt);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Int64:\n\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\til.Emit(callVirt, readLong);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\til.Emit(callVirt, readFloat);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\til.Emit(callVirt, readDouble);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Unknown primitive type \" + fieldType);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Stack transition: ..., field-ref => ...\n\t\t/// </summary>\n\t\tvoid EmitReadValueType(ILGenerator il, LocalBuilder reader, Type valType)\n\t\t{\n\t\t\tDebug.Assert(valType.IsValueType);\n\t\t\tDebug.Assert(!(valType.IsEnum || valType.IsPrimitive));\n\t\t\t\n\t\t\tvar fieldRef = il.DeclareLocal(valType.MakeByRefType());\n\t\t\til.Emit(OpCodes.Stloc, fieldRef);\n\t\t\t\n\t\t\tforeach (FieldInfo field in GetSerializableFields(valType)) {\n\t\t\t\tEmitReadField(il, reader, fieldRef, field);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Custom Deserialization\n\t\tstruct CustomDeserialization\n\t\t{\n\t\t\treadonly object instance;\n\t\t\treadonly SerializationInfo serializationInfo;\n\t\t\treadonly CustomDeserializationAction action;\n\t\t\t\n\t\t\tpublic CustomDeserialization(object instance, SerializationInfo serializationInfo, CustomDeserializationAction action)\n\t\t\t{\n\t\t\t\tthis.instance = instance;\n\t\t\t\tthis.serializationInfo = serializationInfo;\n\t\t\t\tthis.action = action;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Run(StreamingContext context)\n\t\t\t{\n\t\t\t\taction(instance, serializationInfo, context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tdelegate void CustomDeserializationAction(object instance, SerializationInfo info, StreamingContext context);\n\t\t\n\t\tDictionary<Type, CustomDeserializationAction> customDeserializationActions = new Dictionary<Type, CustomDeserializationAction>();\n\t\t\n\t\tCustomDeserializationAction GetCustomDeserializationAction(Type type)\n\t\t{\n\t\t\tCustomDeserializationAction action;\n\t\t\tif (!customDeserializationActions.TryGetValue(type, out action)) {\n\t\t\t\taction = CreateCustomDeserializationAction(type);\n\t\t\t\tcustomDeserializationActions.Add(type, action);\n\t\t\t}\n\t\t\treturn action;\n\t\t}\n\t\t\n\t\tstatic CustomDeserializationAction CreateCustomDeserializationAction(Type type)\n\t\t{\n\t\t\tConstructorInfo ctor = type.GetConstructor(\n\t\t\t\tBindingFlags.DeclaredOnly | BindingFlags.ExactBinding | BindingFlags.Instance\n\t\t\t\t| BindingFlags.NonPublic | BindingFlags.Public,\n\t\t\t\tnull,\n\t\t\t\tnew Type [] { typeof(SerializationInfo), typeof(StreamingContext) },\n\t\t\t\tnull);\n\t\t\tif (ctor == null)\n\t\t\t\tthrow new SerializationException(\"Could not find deserialization constructor for \" + type.FullName);\n\t\t\t\n\t\t\tDynamicMethod dynamicMethod = new DynamicMethod(\n\t\t\t\t\"CallCtor_\" + type.Name,\n\t\t\t\tMethodAttributes.Public | MethodAttributes.Static,\n\t\t\t\tCallingConventions.Standard,\n\t\t\t\ttypeof(void), new [] { typeof(object), typeof(SerializationInfo), typeof(StreamingContext) },\n\t\t\t\ttype,\n\t\t\t\ttrue);\n\t\t\tILGenerator il = dynamicMethod.GetILGenerator();\n\t\t\til.Emit(OpCodes.Ldarg_0);\n\t\t\til.Emit(OpCodes.Ldarg_1);\n\t\t\til.Emit(OpCodes.Ldarg_2);\n\t\t\til.Emit(OpCodes.Call, ctor);\n\t\t\til.Emit(OpCodes.Ret);\n\t\t\treturn (CustomDeserializationAction)dynamicMethod.CreateDelegate(typeof(CustomDeserializationAction));\n\t\t}\n\t\t#endregion\n\t\t#endregion\n\t\t\n\t\t[Conditional(\"DEBUG_SERIALIZER\")]\n\t\tstatic void Log(string format, params object[] args)\n\t\t{\n\t\t\tDebug.WriteLine(format, args);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Specifies the version of the class.\n\t/// The <see cref=\"FastSerializer\"/> will refuse to deserialize an instance that was stored by\n\t/// a different version of the class than the current one.\n\t/// </summary>\n\t[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum)]\n\tpublic class FastSerializerVersionAttribute : Attribute\n\t{\n\t\treadonly int versionNumber;\n\t\t\n\t\tpublic FastSerializerVersionAttribute(int versionNumber)\n\t\t{\n\t\t\tthis.versionNumber = versionNumber;\n\t\t}\n\t\t\n\t\tpublic int VersionNumber {\n\t\t\tget {\n\t\t\t\treturn versionNumber;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static int GetVersionNumber(Type type)\n\t\t{\n\t\t\tvar arr = type.GetCustomAttributes(typeof(FastSerializerVersionAttribute), false);\n\t\t\tif (arr.Length == 0)\n\t\t\t\treturn 0;\n\t\t\telse\n\t\t\t\treturn ((FastSerializerVersionAttribute)arr[0]).VersionNumber;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/GraphVizGraph.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Text.RegularExpressions;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// GraphViz graph.\n\t/// </summary>\n\tpublic sealed class GraphVizGraph\n\t{\n\t\tList<GraphVizNode> nodes = new List<GraphVizNode>();\n\t\tList<GraphVizEdge> edges = new List<GraphVizEdge>();\n\t\t\n\t\tpublic string rankdir;\n\t\tpublic string Title;\n\t\t\n\t\tpublic void AddEdge(GraphVizEdge edge)\n\t\t{\n\t\t\tedges.Add(edge);\n\t\t}\n\t\t\n\t\tpublic void AddNode(GraphVizNode node)\n\t\t{\n\t\t\tnodes.Add(node);\n\t\t}\n\t\t\n\t\tpublic void Save(string fileName)\n\t\t{\n\t\t\tusing (StreamWriter writer = new StreamWriter(fileName))\n\t\t\t\tSave(writer);\n\t\t}\n\t\t\n\t\tpublic void Show()\n\t\t{\n\t\t\tShow(null);\n\t\t}\n\t\t\n\t\tpublic void Show(string name)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tname = Title;\n\t\t\tif (name != null)\n\t\t\t\tforeach (char c in Path.GetInvalidFileNameChars())\n\t\t\t\t\tname = name.Replace(c, '-');\n\t\t\tstring fileName = name != null ? Path.Combine(Path.GetTempPath(), name) : Path.GetTempFileName();\n\t\t\tSave(fileName + \".gv\");\n\t\t\tProcess.Start(\"dot\", \"\\\"\" + fileName + \".gv\\\" -Tpng -o \\\"\" + fileName + \".png\\\"\").WaitForExit();\n\t\t\tProcess.Start(fileName + \".png\");\n\t\t}\n\t\t\n\t\tstatic string Escape(string text)\n\t\t{\n\t\t\tif (Regex.IsMatch(text, @\"^[\\w\\d]+$\")) {\n\t\t\t\treturn text;\n\t\t\t} else {\n\t\t\t\treturn \"\\\"\" + text.Replace(\"\\\\\", \"\\\\\\\\\").Replace(\"\\r\", \"\").Replace(\"\\n\", \"\\\\n\").Replace(\"\\\"\", \"\\\\\\\"\") + \"\\\"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void WriteGraphAttribute(TextWriter writer, string name, string value)\n\t\t{\n\t\t\tif (value != null)\n\t\t\t\twriter.WriteLine(\"{0}={1};\", name, Escape(value));\n\t\t}\n\t\t\n\t\tinternal static void WriteAttribute(TextWriter writer, string name, double? value, ref bool isFirst)\n\t\t{\n\t\t\tif (value != null) {\n\t\t\t\tWriteAttribute(writer, name, value.Value.ToString(CultureInfo.InvariantCulture), ref isFirst);\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static void WriteAttribute(TextWriter writer, string name, bool? value, ref bool isFirst)\n\t\t{\n\t\t\tif (value != null) {\n\t\t\t\tWriteAttribute(writer, name, value.Value ? \"true\" : \"false\", ref isFirst);\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static void WriteAttribute(TextWriter writer, string name, string value, ref bool isFirst)\n\t\t{\n\t\t\tif (value != null) {\n\t\t\t\tif (isFirst)\n\t\t\t\t\tisFirst = false;\n\t\t\t\telse\n\t\t\t\t\twriter.Write(',');\n\t\t\t\twriter.Write(\"{0}={1}\", name, Escape(value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void Save(TextWriter writer)\n\t\t{\n\t\t\tif (writer == null)\n\t\t\t\tthrow new ArgumentNullException(\"writer\");\n\t\t\twriter.WriteLine(\"digraph G {\");\n\t\t\twriter.WriteLine(\"node [fontsize = 16];\");\n\t\t\tWriteGraphAttribute(writer, \"rankdir\", rankdir);\n\t\t\tforeach (GraphVizNode node in nodes) {\n\t\t\t\tnode.Save(writer);\n\t\t\t}\n\t\t\tforeach (GraphVizEdge edge in edges) {\n\t\t\t\tedge.Save(writer);\n\t\t\t}\n\t\t\twriter.WriteLine(\"}\");\n\t\t}\n\t}\n\t\n\tpublic sealed class GraphVizEdge\n\t{\n\t\tpublic readonly string Source, Target;\n\t\t\n\t\t/// <summary>edge stroke color</summary>\n\t\tpublic string color;\n\t\t/// <summary>use edge to affect node ranking</summary>\n\t\tpublic bool? constraint;\n\t\t\n\t\tpublic string label;\n\t\t\n\t\tpublic string style;\n\t\t\n\t\t/// <summary>point size of label</summary>\n\t\tpublic int? fontsize;\n\t\t\n\t\tpublic GraphVizEdge(string source, string target)\n\t\t{\n\t\t\tif (source == null)\n\t\t\t\tthrow new ArgumentNullException(\"source\");\n\t\t\tif (target == null)\n\t\t\t\tthrow new ArgumentNullException(\"target\");\n\t\t\tthis.Source = source;\n\t\t\tthis.Target = target;\n\t\t}\n\t\t\n\t\tpublic GraphVizEdge(int source, int target)\n\t\t{\n\t\t\tthis.Source = source.ToString(CultureInfo.InvariantCulture);\n\t\t\tthis.Target = target.ToString(CultureInfo.InvariantCulture);\n\t\t}\n\t\t\n\t\tpublic void Save(TextWriter writer)\n\t\t{\n\t\t\twriter.Write(\"{0} -> {1} [\", Source, Target);\n\t\t\tbool isFirst = true;\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"label\", label, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"style\", style, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"fontsize\", fontsize, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"color\", color, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"constraint\", constraint, ref isFirst);\n\t\t\twriter.WriteLine(\"];\");\n\t\t}\n\t}\n\t\n\tpublic sealed class GraphVizNode\n\t{\n\t\tpublic readonly string ID;\n\t\tpublic string label;\n\t\t\n\t\tpublic string labelloc;\n\t\t\n\t\t/// <summary>point size of label</summary>\n\t\tpublic int? fontsize;\n\t\t\n\t\t/// <summary>minimum height in inches</summary>\n\t\tpublic double? height;\n\t\t\n\t\t/// <summary>space around label</summary>\n\t\tpublic string margin;\n\t\t\n\t\t/// <summary>node shape</summary>\n\t\tpublic string shape;\n\t\t\n\t\tpublic GraphVizNode(string id)\n\t\t{\n\t\t\tif (id == null)\n\t\t\t\tthrow new ArgumentNullException(\"id\");\n\t\t\tthis.ID = id;\n\t\t}\n\t\t\n\t\tpublic GraphVizNode(int id)\n\t\t{\n\t\t\tthis.ID = id.ToString(CultureInfo.InvariantCulture);\n\t\t}\n\t\t\n\t\tpublic void Save(TextWriter writer)\n\t\t{\n\t\t\twriter.Write(ID);\n\t\t\twriter.Write(\" [\");\n\t\t\tbool isFirst = true;\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"label\", label, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"labelloc\", labelloc, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"fontsize\", fontsize, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"margin\", margin, ref isFirst);\n\t\t\tGraphVizGraph.WriteAttribute(writer, \"shape\", shape, ref isFirst);\n\t\t\twriter.WriteLine(\"];\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/ImmutableStack.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// An immutable stack.\n\t/// \n\t/// Using 'foreach' on the stack will return the items from top to bottom (in the order they would be popped).\n\t/// </summary>\n\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1710:IdentifiersShouldHaveCorrectSuffix\")]\n\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n\t[Serializable]\n\tpublic sealed class ImmutableStack<T> : IEnumerable<T>\n\t{\n\t\t/// <summary>\n\t\t/// Gets the empty stack instance.\n\t\t/// </summary>\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Security\", \"CA2104:DoNotDeclareReadOnlyMutableReferenceTypes\", Justification = \"ImmutableStack is immutable\")]\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n\t\tpublic static readonly ImmutableStack<T> Empty = new ImmutableStack<T>();\n\t\t\n\t\treadonly T value;\n\t\treadonly ImmutableStack<T> next;\n\t\t\n\t\tprivate ImmutableStack()\n\t\t{\n\t\t}\n\t\t\n\t\tprivate ImmutableStack(T value, ImmutableStack<T> next)\n\t\t{\n\t\t\tthis.value = value;\n\t\t\tthis.next = next;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Pushes an item on the stack. This does not modify the stack itself, but returns a new\n\t\t/// one with the value pushed.\n\t\t/// </summary>\n\t\tpublic ImmutableStack<T> Push(T item)\n\t\t{\n\t\t\treturn new ImmutableStack<T>(item, this);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the item on the top of the stack.\n\t\t/// </summary>\n\t\t/// <exception cref=\"InvalidOperationException\">The stack is empty.</exception>\n\t\tpublic T Peek()\n\t\t{\n\t\t\tif (IsEmpty)\n\t\t\t\tthrow new InvalidOperationException(\"Operation not valid on empty stack.\");\n\t\t\treturn value;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the item on the top of the stack.\n\t\t/// Returns <c>default(T)</c> if the stack is empty.\n\t\t/// </summary>\n\t\tpublic T PeekOrDefault()\n\t\t{\n\t\t\treturn value;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the stack with the top item removed.\n\t\t/// </summary>\n\t\t/// <exception cref=\"InvalidOperationException\">The stack is empty.</exception>\n\t\tpublic ImmutableStack<T> Pop()\n\t\t{\n\t\t\tif (IsEmpty)\n\t\t\t\tthrow new InvalidOperationException(\"Operation not valid on empty stack.\");\n\t\t\treturn next;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets if this stack is empty.\n\t\t/// </summary>\n\t\tpublic bool IsEmpty {\n\t\t\tget { return next == null; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets an enumerator that iterates through the stack top-to-bottom.\n\t\t/// </summary>\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\tImmutableStack<T> t = this;\n\t\t\twhile (!t.IsEmpty) {\n\t\t\t\tyield return t.value;\n\t\t\t\tt = t.next;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn this.GetEnumerator();\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder(\"[Stack\");\n\t\t\tforeach (T val in this) {\n\t\t\t\tb.Append(' ');\n\t\t\t\tb.Append(val);\n\t\t\t}\n\t\t\tb.Append(']');\n\t\t\treturn b.ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/KeyComparer.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic static class KeyComparer\n\t{\n\t\tpublic static KeyComparer<TElement, TKey> Create<TElement, TKey>(Func<TElement, TKey> keySelector)\n\t\t{\n\t\t\treturn new KeyComparer<TElement, TKey>(keySelector, Comparer<TKey>.Default, EqualityComparer<TKey>.Default);\n\t\t}\n\t\t\n\t\tpublic static KeyComparer<TElement, TKey> Create<TElement, TKey>(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, IEqualityComparer<TKey> equalityComparer)\n\t\t{\n\t\t\treturn new KeyComparer<TElement, TKey>(keySelector, comparer, equalityComparer);\n\t\t}\n\t\t\n\t\tpublic static IComparer<TElement> Create<TElement, TKey>(Func<TElement, TKey> keySelector, IComparer<TKey> comparer)\n\t\t{\n\t\t\treturn new KeyComparer<TElement, TKey>(keySelector, comparer, EqualityComparer<TKey>.Default);\n\t\t}\n\t\t\n\t\tpublic static IEqualityComparer<TElement> Create<TElement, TKey>(Func<TElement, TKey> keySelector, IEqualityComparer<TKey> equalityComparer)\n\t\t{\n\t\t\treturn new KeyComparer<TElement, TKey>(keySelector, Comparer<TKey>.Default, equalityComparer);\n\t\t}\n\t}\n\t\n\tpublic class KeyComparer<TElement, TKey> : IComparer<TElement>, IEqualityComparer<TElement>\n\t{\n\t\treadonly Func<TElement, TKey> keySelector;\n\t\treadonly IComparer<TKey> keyComparer;\n\t\treadonly IEqualityComparer<TKey> keyEqualityComparer;\n\t\t\n\t\tpublic KeyComparer(Func<TElement, TKey> keySelector, IComparer<TKey> keyComparer, IEqualityComparer<TKey> keyEqualityComparer)\n\t\t{\n\t\t\tif (keySelector == null)\n\t\t\t\tthrow new ArgumentNullException(\"keySelector\");\n\t\t\tif (keyComparer == null)\n\t\t\t\tthrow new ArgumentNullException(\"keyComparer\");\n\t\t\tif (keyEqualityComparer == null)\n\t\t\t\tthrow new ArgumentNullException(\"keyEqualityComparer\");\n\t\t\tthis.keySelector = keySelector;\n\t\t\tthis.keyComparer = keyComparer;\n\t\t\tthis.keyEqualityComparer = keyEqualityComparer;\n\t\t}\n\t\t\n\t\tpublic int Compare(TElement x, TElement y)\n\t\t{\n\t\t\treturn keyComparer.Compare(keySelector(x), keySelector(y));\n\t\t}\n\t\t\n\t\tpublic bool Equals(TElement x, TElement y)\n\t\t{\n\t\t\treturn keyEqualityComparer.Equals(keySelector(x), keySelector(y));\n\t\t}\n\t\t\n\t\tpublic int GetHashCode(TElement obj)\n\t\t{\n\t\t\treturn keyEqualityComparer.GetHashCode(keySelector(obj));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/LazyInit.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic static class LazyInit\n\t{\n\t\tpublic static T VolatileRead<T>(ref T location) where T : class\n\t\t{\n\t\t\t#if NET_4_5\n\t\t\treturn Volatile.Read(ref location);\n\t\t\t#else\n\t\t\tT result = location;\n\t\t\tThread.MemoryBarrier();\n\t\t\treturn result;\n\t\t\t#endif\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Atomically performs the following operation:\n\t\t/// - If target is null: stores newValue in target and returns newValue.\n\t\t/// - If target is not null: returns target.\n\t\t/// </summary>\n\t\tpublic static T GetOrSet<T>(ref T target, T newValue) where T : class\n\t\t{\n\t\t\tT oldValue = Interlocked.CompareExchange(ref target, newValue, null);\n\t\t\treturn oldValue ?? newValue;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/MultiDictionary.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// A dictionary that allows multiple pairs with the same key.\n\t/// </summary>\n\tpublic class MultiDictionary<TKey, TValue> : ILookup<TKey, TValue>\n\t{\n\t\treadonly Dictionary<TKey, List<TValue>> dict;\n\t\t\n\t\tpublic MultiDictionary()\n\t\t{\n\t\t\tdict = new Dictionary<TKey, List<TValue>>();\n\t\t}\n\t\t\n\t\tpublic MultiDictionary(IEqualityComparer<TKey> comparer)\n\t\t{\n\t\t\tdict = new Dictionary<TKey, List<TValue>>(comparer);\n\t\t}\n\t\t\n\t\tpublic void Add(TKey key, TValue value)\n\t\t{\n\t\t\tList<TValue> valueList;\n\t\t\tif (!dict.TryGetValue(key, out valueList)) {\n\t\t\t\tvalueList = new List<TValue>();\n\t\t\t\tdict.Add(key, valueList);\n\t\t\t}\n\t\t\tvalueList.Add(value);\n\t\t}\n\n\t\tpublic bool Remove(TKey key, TValue value)\n\t\t{\n\t\t\tList<TValue> valueList;\n\t\t\tif (dict.TryGetValue(key, out valueList)) {\n\t\t\t\tif (valueList.Remove(value)) {\n\t\t\t\t\tif (valueList.Count == 0)\n\t\t\t\t\t\tdict.Remove(key);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Removes all entries with the specified key.\n\t\t/// </summary>\n\t\t/// <returns>Returns true if at least one entry was removed.</returns>\n\t\tpublic bool RemoveAll(TKey key)\n\t\t{\n\t\t\treturn dict.Remove(key);\n\t\t}\n\t\t\n\t\tpublic void Clear()\n\t\t{\n\t\t\tdict.Clear();\n\t\t}\n\t\t\n\t\t#if NET_4_5\n\t\tpublic IReadOnlyList<TValue> this[TKey key] {\n\t\t#else\n\t\tpublic IList<TValue> this[TKey key] {\n\t\t#endif\n\t\t\tget {\n\t\t\t\tList<TValue> list;\n\t\t\t\tif (dict.TryGetValue(key, out list))\n\t\t\t\t\treturn list;\n\t\t\t\telse\n\t\t\t\t\treturn EmptyList<TValue>.Instance;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the number of different keys.\n\t\t/// </summary>\n\t\tpublic int Count {\n\t\t\tget { return dict.Count; }\n\t\t}\n\t\t\n\t\tpublic ICollection<TKey> Keys {\n\t\t\tget { return dict.Keys; }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<TValue> Values {\n\t\t\tget { return dict.Values.SelectMany(list => list); }\n\t\t}\n\t\t\n\t\tIEnumerable<TValue> ILookup<TKey, TValue>.this[TKey key] {\n\t\t\tget { return this[key]; }\n\t\t}\n\t\t\n\t\tbool ILookup<TKey, TValue>.Contains(TKey key)\n\t\t{\n\t\t\treturn dict.ContainsKey(key);\n\t\t}\n\t\t\n\t\tpublic IEnumerator<IGrouping<TKey, TValue>> GetEnumerator()\n\t\t{\n\t\t\tforeach (var pair in dict)\n\t\t\t\tyield return new Grouping(pair.Key, pair.Value);\n\t\t}\n\t\t\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\t\t\n\t\tsealed class Grouping : IGrouping<TKey, TValue>\n\t\t{\n\t\t\treadonly TKey key;\n\t\t\treadonly List<TValue> values;\n\t\t\t\n\t\t\tpublic Grouping(TKey key, List<TValue> values)\n\t\t\t{\n\t\t\t\tthis.key = key;\n\t\t\t\tthis.values = values;\n\t\t\t}\n\t\t\t\n\t\t\tpublic TKey Key {\n\t\t\t\tget { return key; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerator<TValue> GetEnumerator()\n\t\t\t{\n\t\t\t\treturn values.GetEnumerator();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t\t{\n\t\t\t\treturn values.GetEnumerator();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/Platform.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Platform-specific code.\n\t/// </summary>\n\tpublic static class Platform\n\t{\n\t\tpublic static StringComparer FileNameComparer {\n\t\t\tget {\n\t\t\t\tswitch (Environment.OSVersion.Platform) {\n\t\t\t\t\tcase PlatformID.Unix:\n\t\t\t\t\tcase PlatformID.MacOSX:\n\t\t\t\t\t\treturn StringComparer.Ordinal;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn StringComparer.OrdinalIgnoreCase;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/ProjectedList.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic sealed class ProjectedList<TInput, TOutput> : IList<TOutput> where TOutput : class\n\t{\n\t\treadonly IList<TInput> input;\n\t\treadonly Func<TInput, TOutput> projection;\n\t\treadonly TOutput[] items;\n\t\t\n\t\tpublic ProjectedList(IList<TInput> input, Func<TInput, TOutput> projection)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\tthrow new ArgumentNullException(\"input\");\n\t\t\tif (projection == null)\n\t\t\t\tthrow new ArgumentNullException(\"projection\");\n\t\t\tthis.input = input;\n\t\t\tthis.projection = projection;\n\t\t\tthis.items = new TOutput[input.Count];\n\t\t}\n\t\t\n\t\tpublic TOutput this[int index] {\n\t\t\tget {\n\t\t\t\tTOutput output = LazyInit.VolatileRead(ref items[index]);\n\t\t\t\tif (output != null) {\n\t\t\t\t\treturn output;\n\t\t\t\t}\n\t\t\t\treturn LazyInit.GetOrSet(ref items[index], projection(input[index]));\n\t\t\t}\n\t\t}\n\t\t\n\t\tTOutput IList<TOutput>.this[int index] {\n\t\t\tget { return this[index]; }\n\t\t\tset {\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int Count {\n\t\t\tget { return items.Length; }\n\t\t}\n\t\t\n\t\tbool ICollection<TOutput>.IsReadOnly {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tint IList<TOutput>.IndexOf(TOutput item)\n\t\t{\n\t\t\tvar comparer = EqualityComparer<TOutput>.Default;\n\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\tif (comparer.Equals(this[i], item))\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tvoid IList<TOutput>.Insert(int index, TOutput item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IList<TOutput>.RemoveAt(int index)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid ICollection<TOutput>.Add(TOutput item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid ICollection<TOutput>.Clear()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tbool ICollection<TOutput>.Contains(TOutput item)\n\t\t{\n\t\t\tvar comparer = EqualityComparer<TOutput>.Default;\n\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\tif (comparer.Equals(this[i], item))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid ICollection<TOutput>.CopyTo(TOutput[] array, int arrayIndex)\n\t\t{\n\t\t\tfor (int i = 0; i < items.Length; i++) {\n\t\t\t\tarray[arrayIndex + i] = this[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ICollection<TOutput>.Remove(TOutput item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tpublic IEnumerator<TOutput> GetEnumerator()\n\t\t{\n\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\tyield return this[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\t}\n\t\n\tpublic sealed class ProjectedList<TContext, TInput, TOutput> : IList<TOutput> where TOutput : class\n\t{\n\t\treadonly IList<TInput> input;\n\t\treadonly TContext context;\n\t\treadonly Func<TContext, TInput, TOutput> projection;\n\t\treadonly TOutput[] items;\n\t\t\n\t\tpublic ProjectedList(TContext context, IList<TInput> input, Func<TContext, TInput, TOutput> projection)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\tthrow new ArgumentNullException(\"input\");\n\t\t\tif (projection == null)\n\t\t\t\tthrow new ArgumentNullException(\"projection\");\n\t\t\tthis.input = input;\n\t\t\tthis.context = context;\n\t\t\tthis.projection = projection;\n\t\t\tthis.items = new TOutput[input.Count];\n\t\t}\n\t\t\n\t\tpublic TOutput this[int index] {\n\t\t\tget {\n\t\t\t\tTOutput output = LazyInit.VolatileRead(ref items[index]);\n\t\t\t\tif (output != null) {\n\t\t\t\t\treturn output;\n\t\t\t\t}\n\t\t\t\treturn LazyInit.GetOrSet(ref items[index], projection(context, input[index]));\n\t\t\t}\n\t\t}\n\t\t\n\t\tTOutput IList<TOutput>.this[int index] {\n\t\t\tget { return this[index]; }\n\t\t\tset {\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int Count {\n\t\t\tget { return items.Length; }\n\t\t}\n\t\t\n\t\tbool ICollection<TOutput>.IsReadOnly {\n\t\t\tget { return true; }\n\t\t}\n\t\t\n\t\tint IList<TOutput>.IndexOf(TOutput item)\n\t\t{\n\t\t\tvar comparer = EqualityComparer<TOutput>.Default;\n\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\tif (comparer.Equals(this[i], item))\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tvoid IList<TOutput>.Insert(int index, TOutput item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid IList<TOutput>.RemoveAt(int index)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid ICollection<TOutput>.Add(TOutput item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tvoid ICollection<TOutput>.Clear()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tbool ICollection<TOutput>.Contains(TOutput item)\n\t\t{\n\t\t\tvar comparer = EqualityComparer<TOutput>.Default;\n\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\tif (comparer.Equals(this[i], item))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid ICollection<TOutput>.CopyTo(TOutput[] array, int arrayIndex)\n\t\t{\n\t\t\tfor (int i = 0; i < items.Length; i++) {\n\t\t\t\tarray[arrayIndex + i] = this[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ICollection<TOutput>.Remove(TOutput item)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tpublic IEnumerator<TOutput> GetEnumerator()\n\t\t{\n\t\t\tfor (int i = 0; i < this.Count; i++) {\n\t\t\t\tyield return this[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/ReferenceComparer.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\tpublic sealed class ReferenceComparer : IEqualityComparer<object>\n\t{\n\t\tpublic readonly static ReferenceComparer Instance = new ReferenceComparer();\n\t\t\n\t\tpublic new bool Equals(object x, object y)\n\t\t{\n\t\t\treturn x == y;\n\t\t}\n\t\t\n\t\tpublic int GetHashCode(object obj)\n\t\t{\n\t\t\treturn RuntimeHelpers.GetHashCode(obj);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory/Utils/TreeTraversal.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t/// <summary>\n\t/// Static helper methods for traversing trees.\n\t/// </summary>\n\tpublic static class TreeTraversal\n\t{\n\t\t/// <summary>\n\t\t/// Converts a tree data structure into a flat list by traversing it in pre-order.\n\t\t/// </summary>\n\t\t/// <param name=\"root\">The root element of the tree.</param>\n\t\t/// <param name=\"recursion\">The function that gets the children of an element.</param>\n\t\t/// <returns>Iterator that enumerates the tree structure in pre-order.</returns>\n\t\tpublic static IEnumerable<T> PreOrder<T>(T root, Func<T, IEnumerable<T>> recursion)\n\t\t{\n\t\t\treturn PreOrder(new T[] { root }, recursion);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts a tree data structure into a flat list by traversing it in pre-order.\n\t\t/// </summary>\n\t\t/// <param name=\"input\">The root elements of the forest.</param>\n\t\t/// <param name=\"recursion\">The function that gets the children of an element.</param>\n\t\t/// <returns>Iterator that enumerates the tree structure in pre-order.</returns>\n\t\tpublic static IEnumerable<T> PreOrder<T>(IEnumerable<T> input, Func<T, IEnumerable<T>> recursion)\n\t\t{\n\t\t\tStack<IEnumerator<T>> stack = new Stack<IEnumerator<T>>();\n\t\t\ttry {\n\t\t\t\tstack.Push(input.GetEnumerator());\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\twhile (stack.Peek().MoveNext()) {\n\t\t\t\t\t\tT element = stack.Peek().Current;\n\t\t\t\t\t\tyield return element;\n\t\t\t\t\t\tIEnumerable<T> children = recursion(element);\n\t\t\t\t\t\tif (children != null) {\n\t\t\t\t\t\t\tstack.Push(children.GetEnumerator());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tstack.Pop().Dispose();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\tstack.Pop().Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts a tree data structure into a flat list by traversing it in post-order.\n\t\t/// </summary>\n\t\t/// <param name=\"root\">The root element of the tree.</param>\n\t\t/// <param name=\"recursion\">The function that gets the children of an element.</param>\n\t\t/// <returns>Iterator that enumerates the tree structure in post-order.</returns>\n\t\tpublic static IEnumerable<T> PostOrder<T>(T root, Func<T, IEnumerable<T>> recursion)\n\t\t{\n\t\t\treturn PostOrder(new T[] { root }, recursion);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts a tree data structure into a flat list by traversing it in post-order.\n\t\t/// </summary>\n\t\t/// <param name=\"input\">The root elements of the forest.</param>\n\t\t/// <param name=\"recursion\">The function that gets the children of an element.</param>\n\t\t/// <returns>Iterator that enumerates the tree structure in post-order.</returns>\n\t\tpublic static IEnumerable<T> PostOrder<T>(IEnumerable<T> input, Func<T, IEnumerable<T>> recursion)\n\t\t{\n\t\t\tStack<IEnumerator<T>> stack = new Stack<IEnumerator<T>>();\n\t\t\ttry {\n\t\t\t\tstack.Push(input.GetEnumerator());\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\twhile (stack.Peek().MoveNext()) {\n\t\t\t\t\t\tT element = stack.Peek().Current;\n\t\t\t\t\t\tIEnumerable<T> children = recursion(element);\n\t\t\t\t\t\tif (children != null) {\n\t\t\t\t\t\t\tstack.Push(children.GetEnumerator());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tyield return element;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tstack.Pop().Dispose();\n\t\t\t\t\tif (stack.Count > 0)\n\t\t\t\t\t\tyield return stack.Peek().Current;\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\tstack.Pop().Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/AnnotationNames.cs",
    "content": "// \n// Annotations.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic static class AnnotationNames\n\t{\n\t\t//Used const instead of readonly to allow values to be used in switch cases.\n\n\t\tpublic const string AssertionMethodAttribute = \"JetBrains.Annotations.AssertionMethodAttribute\";\n\t\tpublic const string AssertionConditionAttribute = \"JetBrains.Annotations.AssertionConditionAttribute\";\n\t\tpublic const string AssertionConditionTypeAttribute = \"JetBrains.Annotations.AssertionConditionType\";\n\n\t\tpublic const string AssertionConditionTypeIsTrue = \"JetBrains.Annotations.AssertionConditionType.IS_TRUE\";\n\t\tpublic const string AssertionConditionTypeIsFalse = \"JetBrains.Annotations.AssertionConditionType.IS_FALSE\";\n\t\tpublic const string AssertionConditionTypeIsNull = \"JetBrains.Annotations.AssertionConditionType.IS_NULL\";\n\t\tpublic const string AssertionConditionTypeIsNotNull = \"JetBrains.Annotations.AssertionConditionType.IS_NOT_NULL\";\n\n\t\tpublic const string NotNullAttribute = \"JetBrains.Annotations.NotNullAttribute\";\n\t\tpublic const string CanBeNullAttribute = \"JetBrains.Annotations.CanBeNullAttribute\";\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t/// <summary>\n\t/// Represents a node in the control flow graph of a C# method.\n\t/// </summary>\n\tpublic class ControlFlowNode\n\t{\n\t\tpublic readonly Statement PreviousStatement;\n\t\tpublic readonly Statement NextStatement;\n\t\t\n\t\tpublic readonly ControlFlowNodeType Type;\n\t\t\n\t\tpublic readonly List<ControlFlowEdge> Outgoing = new List<ControlFlowEdge>();\n\t\tpublic readonly List<ControlFlowEdge> Incoming = new List<ControlFlowEdge>();\n\t\t\n\t\tpublic ControlFlowNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)\n\t\t{\n\t\t\tif (previousStatement == null && nextStatement == null)\n\t\t\t\tthrow new ArgumentException(\"previousStatement and nextStatement must not be both null\");\n\t\t\tthis.PreviousStatement = previousStatement;\n\t\t\tthis.NextStatement = nextStatement;\n\t\t\tthis.Type = type;\n\t\t}\n\t}\n\t\n\tpublic enum ControlFlowNodeType\n\t{\n\t\t/// <summary>\n\t\t/// Unknown node type\n\t\t/// </summary>\n\t\tNone,\n\t\t/// <summary>\n\t\t/// Node in front of a statement\n\t\t/// </summary>\n\t\tStartNode,\n\t\t/// <summary>\n\t\t/// Node between two statements\n\t\t/// </summary>\n\t\tBetweenStatements,\n\t\t/// <summary>\n\t\t/// Node at the end of a statement list\n\t\t/// </summary>\n\t\tEndNode,\n\t\t/// <summary>\n\t\t/// Node representing the position before evaluating the condition of a loop.\n\t\t/// </summary>\n\t\tLoopCondition\n\t}\n\t\n\tpublic class ControlFlowEdge\n\t{\n\t\tpublic readonly ControlFlowNode From;\n\t\tpublic readonly ControlFlowNode To;\n\t\tpublic readonly ControlFlowEdgeType Type;\n\t\t\n\t\tList<TryCatchStatement> jumpOutOfTryFinally;\n\t\t\n\t\tpublic ControlFlowEdge(ControlFlowNode from, ControlFlowNode to, ControlFlowEdgeType type)\n\t\t{\n\t\t\tif (from == null)\n\t\t\t\tthrow new ArgumentNullException(\"from\");\n\t\t\tif (to == null)\n\t\t\t\tthrow new ArgumentNullException(\"to\");\n\t\t\tthis.From = from;\n\t\t\tthis.To = to;\n\t\t\tthis.Type = type;\n\t\t}\n\t\t\n\t\tinternal void AddJumpOutOfTryFinally(TryCatchStatement tryFinally)\n\t\t{\n\t\t\tif (jumpOutOfTryFinally == null)\n\t\t\t\tjumpOutOfTryFinally = new List<TryCatchStatement>();\n\t\t\tjumpOutOfTryFinally.Add(tryFinally);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this control flow edge is leaving any try-finally statements.\n\t\t/// </summary>\n\t\tpublic bool IsLeavingTryFinally {\n\t\t\tget { return jumpOutOfTryFinally != null; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the try-finally statements that this control flow edge is leaving.\n\t\t/// </summary>\n\t\tpublic IEnumerable<TryCatchStatement> TryFinallyStatements {\n\t\t\tget { return jumpOutOfTryFinally ?? Enumerable.Empty<TryCatchStatement>(); }\n\t\t}\n\t}\n\t\n\tpublic enum ControlFlowEdgeType\n\t{\n\t\t/// <summary>\n\t\t/// Regular control flow.\n\t\t/// </summary>\n\t\tNormal,\n\t\t/// <summary>\n\t\t/// Conditional control flow (edge taken if condition is true)\n\t\t/// </summary>\n\t\tConditionTrue,\n\t\t/// <summary>\n\t\t/// Conditional control flow (edge taken if condition is false)\n\t\t/// </summary>\n\t\tConditionFalse,\n\t\t/// <summary>\n\t\t/// A jump statement (goto, goto case, break or continue)\n\t\t/// </summary>\n\t\tJump\n\t}\n\t\n\t/// <summary>\n\t/// Constructs the control flow graph for C# statements.\n\t/// </summary>\n\tpublic class ControlFlowGraphBuilder\n\t{\n\t\t// Written according to the reachability rules in the C# spec (§8.1 End points and reachability)\n\t\t\n\t\tprotected virtual ControlFlowNode CreateNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)\n\t\t{\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\treturn new ControlFlowNode(previousStatement, nextStatement, type);\n\t\t}\n\t\t\n\t\tprotected virtual ControlFlowEdge CreateEdge(ControlFlowNode from, ControlFlowNode to, ControlFlowEdgeType type)\n\t\t{\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\treturn new ControlFlowEdge(from, to, type);\n\t\t}\n\t\t\n\t\tStatement rootStatement;\n\t\tCSharpTypeResolveContext typeResolveContext;\n\t\tFunc<AstNode, CancellationToken, ResolveResult> resolver;\n\t\tList<ControlFlowNode> nodes;\n\t\tDictionary<string, ControlFlowNode> labels;\n\t\tList<ControlFlowNode> gotoStatements;\n\t\tCancellationToken cancellationToken;\n\t\t\n\t\tpublic IList<ControlFlowNode> BuildControlFlowGraph(Statement statement, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (statement == null)\n\t\t\t\tthrow new ArgumentNullException(\"statement\");\n\t\t\tCSharpResolver r = new CSharpResolver(MinimalCorlib.Instance.CreateCompilation());\n\t\t\treturn BuildControlFlowGraph(statement, new CSharpAstResolver(r, statement), cancellationToken);\n\t\t}\n\t\t\n\t\tpublic IList<ControlFlowNode> BuildControlFlowGraph(Statement statement, CSharpAstResolver resolver, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (statement == null)\n\t\t\t\tthrow new ArgumentNullException(\"statement\");\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\treturn BuildControlFlowGraph(statement, resolver.Resolve, resolver.TypeResolveContext, cancellationToken);\n\t\t}\n\t\t\n\t\tinternal IList<ControlFlowNode> BuildControlFlowGraph(Statement statement, Func<AstNode, CancellationToken, ResolveResult> resolver, CSharpTypeResolveContext typeResolveContext, CancellationToken cancellationToken)\n\t\t{\n\t\t\tNodeCreationVisitor nodeCreationVisitor = new NodeCreationVisitor();\n\t\t\tnodeCreationVisitor.builder = this;\n\t\t\ttry {\n\t\t\t\tthis.nodes = new List<ControlFlowNode>();\n\t\t\t\tthis.labels = new Dictionary<string, ControlFlowNode>();\n\t\t\t\tthis.gotoStatements = new List<ControlFlowNode>();\n\t\t\t\tthis.rootStatement = statement;\n\t\t\t\tthis.resolver = resolver;\n\t\t\t\tthis.typeResolveContext = typeResolveContext;\n\t\t\t\tthis.cancellationToken = cancellationToken;\n\t\t\t\t\n\t\t\t\tControlFlowNode entryPoint = CreateStartNode(statement);\n\t\t\t\tstatement.AcceptVisitor(nodeCreationVisitor, entryPoint);\n\t\t\t\t\n\t\t\t\t// Resolve goto statements:\n\t\t\t\tforeach (ControlFlowNode gotoStmt in gotoStatements) {\n\t\t\t\t\tstring label = ((GotoStatement)gotoStmt.NextStatement).Label;\n\t\t\t\t\tControlFlowNode labelNode;\n\t\t\t\t\tif (labels.TryGetValue(label, out labelNode))\n\t\t\t\t\t\tnodeCreationVisitor.Connect(gotoStmt, labelNode, ControlFlowEdgeType.Jump);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAnnotateLeaveEdgesWithTryFinallyBlocks();\n\t\t\t\t\n\t\t\t\treturn nodes;\n\t\t\t} finally {\n\t\t\t\tthis.nodes = null;\n\t\t\t\tthis.labels = null;\n\t\t\t\tthis.gotoStatements = null;\n\t\t\t\tthis.rootStatement = null;\n\t\t\t\tthis.resolver = null;\n\t\t\t\tthis.typeResolveContext = null;\n\t\t\t\tthis.cancellationToken = CancellationToken.None;\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid AnnotateLeaveEdgesWithTryFinallyBlocks()\n\t\t{\n\t\t\tforeach (ControlFlowEdge edge in nodes.SelectMany(n => n.Outgoing)) {\n\t\t\t\tif (edge.Type != ControlFlowEdgeType.Jump) {\n\t\t\t\t\t// Only jumps are potential candidates for leaving try-finally blocks.\n\t\t\t\t\t// Note that the regular edges leaving try or catch blocks are already annotated by the visitor.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tStatement gotoStatement = edge.From.NextStatement;\n\t\t\t\tDebug.Assert(gotoStatement is GotoStatement || gotoStatement is GotoDefaultStatement || gotoStatement is GotoCaseStatement || gotoStatement is BreakStatement || gotoStatement is ContinueStatement);\n\t\t\t\tStatement targetStatement = edge.To.PreviousStatement ?? edge.To.NextStatement;\n\t\t\t\tif (gotoStatement.Parent == targetStatement.Parent)\n\t\t\t\t\tcontinue;\n\t\t\t\tHashSet<TryCatchStatement> targetParentTryCatch = new HashSet<TryCatchStatement>(targetStatement.Ancestors.OfType<TryCatchStatement>());\n\t\t\t\tfor (AstNode node = gotoStatement.Parent; node != null; node = node.Parent) {\n\t\t\t\t\tTryCatchStatement leftTryCatch = node as TryCatchStatement;\n\t\t\t\t\tif (leftTryCatch != null) {\n\t\t\t\t\t\tif (targetParentTryCatch.Contains(leftTryCatch))\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tif (!leftTryCatch.FinallyBlock.IsNull)\n\t\t\t\t\t\t\tedge.AddJumpOutOfTryFinally(leftTryCatch);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t#region Create*Node\n\t\tControlFlowNode CreateStartNode(Statement statement)\n\t\t{\n\t\t\tif (statement.IsNull)\n\t\t\t\treturn null;\n\t\t\tControlFlowNode node = CreateNode(null, statement, ControlFlowNodeType.StartNode);\n\t\t\tnodes.Add(node);\n\t\t\treturn node;\n\t\t}\n\t\t\n\t\tControlFlowNode CreateSpecialNode(Statement statement, ControlFlowNodeType type, bool addToNodeList = true)\n\t\t{\n\t\t\tControlFlowNode node = CreateNode(null, statement, type);\n\t\t\tif (addToNodeList)\n\t\t\t\tnodes.Add(node);\n\t\t\treturn node;\n\t\t}\n\t\t\n\t\tControlFlowNode CreateEndNode(Statement statement, bool addToNodeList = true)\n\t\t{\n\t\t\tStatement nextStatement;\n\t\t\tif (statement == rootStatement) {\n\t\t\t\tnextStatement = null;\n\t\t\t} else {\n\t\t\t\t// Find the next statement in the same role:\n\t\t\t\tAstNode next = statement;\n\t\t\t\tdo {\n\t\t\t\t\tnext = next.NextSibling;\n\t\t\t\t} while (next != null && next.Role != statement.Role);\n\t\t\t\tnextStatement = next as Statement;\n\t\t\t}\n\t\t\tControlFlowNodeType type = nextStatement != null ? ControlFlowNodeType.BetweenStatements : ControlFlowNodeType.EndNode;\n\t\t\tControlFlowNode node = CreateNode(statement, nextStatement, type);\n\t\t\tif (addToNodeList)\n\t\t\t\tnodes.Add(node);\n\t\t\treturn node;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Constant evaluation\n\t\t/// <summary>\n\t\t/// Gets/Sets whether to handle only primitive expressions as constants (no complex expressions like \"a + b\").\n\t\t/// </summary>\n\t\tpublic bool EvaluateOnlyPrimitiveConstants { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Evaluates an expression.\n\t\t/// </summary>\n\t\t/// <returns>The constant value of the expression; or null if the expression is not a constant.</returns>\n\t\tResolveResult EvaluateConstant(Expression expr)\n\t\t{\n\t\t\tif (expr.IsNull)\n\t\t\t\treturn null;\n\t\t\tif (EvaluateOnlyPrimitiveConstants) {\n\t\t\t\tif (!(expr is PrimitiveExpression || expr is NullReferenceExpression))\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn resolver(expr, cancellationToken);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Evaluates an expression.\n\t\t/// </summary>\n\t\t/// <returns>The value of the constant boolean expression; or null if the value is not a constant boolean expression.</returns>\n\t\tbool? EvaluateCondition(Expression expr)\n\t\t{\n\t\t\tResolveResult rr = EvaluateConstant(expr);\n\t\t\tif (rr != null && rr.IsCompileTimeConstant)\n\t\t\t\treturn rr.ConstantValue as bool?;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tbool AreEqualConstants(ResolveResult c1, ResolveResult c2)\n\t\t{\n\t\t\tif (c1 == null || c2 == null || !c1.IsCompileTimeConstant || !c2.IsCompileTimeConstant)\n\t\t\t\treturn false;\n\t\t\tCSharpResolver r = new CSharpResolver(typeResolveContext);\n\t\t\tResolveResult c = r.ResolveBinaryOperator(BinaryOperatorType.Equality, c1, c2);\n\t\t\treturn c.IsCompileTimeConstant && (c.ConstantValue as bool?) == true;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tsealed class NodeCreationVisitor : DepthFirstAstVisitor<ControlFlowNode, ControlFlowNode>\n\t\t{\n\t\t\t// 'data' parameter: input control flow node (start of statement being visited)\n\t\t\t// Return value: result control flow node (end of statement being visited)\n\t\t\t\n\t\t\tinternal ControlFlowGraphBuilder builder;\n\t\t\tStack<ControlFlowNode> breakTargets = new Stack<ControlFlowNode>();\n\t\t\tStack<ControlFlowNode> continueTargets = new Stack<ControlFlowNode>();\n\t\t\tList<ControlFlowNode> gotoCaseOrDefault = new List<ControlFlowNode>();\n\t\t\t\n\t\t\tinternal ControlFlowEdge Connect(ControlFlowNode from, ControlFlowNode to, ControlFlowEdgeType type = ControlFlowEdgeType.Normal)\n\t\t\t{\n\t\t\t\tif (from == null || to == null)\n\t\t\t\t\treturn null;\n\t\t\t\tControlFlowEdge edge = builder.CreateEdge(from, to, type);\n\t\t\t\tfrom.Outgoing.Add(edge);\n\t\t\t\tto.Incoming.Add(edge);\n\t\t\t\treturn edge;\n\t\t\t}\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Creates an end node for <c>stmt</c> and connects <c>from</c> with the new node.\n\t\t\t/// </summary>\n\t\t\tControlFlowNode CreateConnectedEndNode(Statement stmt, ControlFlowNode from)\n\t\t\t{\n\t\t\t\tControlFlowNode newNode = builder.CreateEndNode(stmt);\n\t\t\t\tConnect(from, newNode);\n\t\t\t\treturn newNode;\n\t\t\t}\n\t\t\t\n\t\t\tprotected override ControlFlowNode VisitChildren(AstNode node, ControlFlowNode data)\n\t\t\t{\n\t\t\t\t// We have overrides for all possible statements and should visit statements only.\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitBlockStatement(BlockStatement blockStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\t// C# 4.0 spec: §8.2 Blocks\n\t\t\t\tControlFlowNode childNode = HandleStatementList(blockStatement.Statements, data);\n\t\t\t\treturn CreateConnectedEndNode(blockStatement, childNode);\n\t\t\t}\n\t\t\t\n\t\t\tControlFlowNode HandleStatementList(AstNodeCollection<Statement> statements, ControlFlowNode source)\n\t\t\t{\n\t\t\t\tControlFlowNode childNode = null;\n\t\t\t\tforeach (Statement stmt in statements) {\n\t\t\t\t\tif (childNode == null) {\n\t\t\t\t\t\tchildNode = builder.CreateStartNode(stmt);\n\t\t\t\t\t\tif (source != null)\n\t\t\t\t\t\t\tConnect(source, childNode);\n\t\t\t\t\t}\n\t\t\t\t\tDebug.Assert(childNode.NextStatement == stmt);\n\t\t\t\t\tchildNode = stmt.AcceptVisitor(this, childNode);\n\t\t\t\t\tDebug.Assert(childNode.PreviousStatement == stmt);\n\t\t\t\t}\n\t\t\t\treturn childNode ?? source;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitEmptyStatement(EmptyStatement emptyStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\treturn CreateConnectedEndNode(emptyStatement, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitLabelStatement(LabelStatement labelStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tControlFlowNode end = CreateConnectedEndNode(labelStatement, data);\n\t\t\t\tbuilder.labels[labelStatement.Label] = end;\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\treturn CreateConnectedEndNode(variableDeclarationStatement, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitExpressionStatement(ExpressionStatement expressionStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\treturn CreateConnectedEndNode(expressionStatement, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitIfElseStatement(IfElseStatement ifElseStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tbool? cond = builder.EvaluateCondition(ifElseStatement.Condition);\n\t\t\t\t\n\t\t\t\tControlFlowNode trueBegin = builder.CreateStartNode(ifElseStatement.TrueStatement);\n\t\t\t\tif (cond != false)\n\t\t\t\t\tConnect(data, trueBegin, ControlFlowEdgeType.ConditionTrue);\n\t\t\t\tControlFlowNode trueEnd = ifElseStatement.TrueStatement.AcceptVisitor(this, trueBegin);\n\t\t\t\t\n\t\t\t\tControlFlowNode falseBegin = builder.CreateStartNode(ifElseStatement.FalseStatement);\n\t\t\t\tif (cond != true)\n\t\t\t\t\tConnect(data, falseBegin, ControlFlowEdgeType.ConditionFalse);\n\t\t\t\tControlFlowNode falseEnd = ifElseStatement.FalseStatement.AcceptVisitor(this, falseBegin);\n\t\t\t\t// (if no else statement exists, both falseBegin and falseEnd will be null)\n\t\t\t\t\n\t\t\t\tControlFlowNode end = builder.CreateEndNode(ifElseStatement);\n\t\t\t\tConnect(trueEnd, end);\n\t\t\t\tif (falseEnd != null) {\n\t\t\t\t\tConnect(falseEnd, end);\n\t\t\t\t} else if (cond != true) {\n\t\t\t\t\tConnect(data, end, ControlFlowEdgeType.ConditionFalse);\n\t\t\t\t}\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitSwitchStatement(SwitchStatement switchStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\t// First, figure out which switch section will get called (if the expression is constant):\n\t\t\t\tResolveResult constant = builder.EvaluateConstant(switchStatement.Expression);\n\t\t\t\tSwitchSection defaultSection = null;\n\t\t\t\tSwitchSection sectionMatchedByConstant = null;\n\t\t\t\tforeach (SwitchSection section in switchStatement.SwitchSections) {\n\t\t\t\t\tforeach (CaseLabel label in section.CaseLabels) {\n\t\t\t\t\t\tif (label.Expression.IsNull) {\n\t\t\t\t\t\t\tdefaultSection = section;\n\t\t\t\t\t\t} else if (constant != null && constant.IsCompileTimeConstant) {\n\t\t\t\t\t\t\tResolveResult labelConstant = builder.EvaluateConstant(label.Expression);\n\t\t\t\t\t\t\tif (builder.AreEqualConstants(constant, labelConstant))\n\t\t\t\t\t\t\t\tsectionMatchedByConstant = section;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (constant != null && constant.IsCompileTimeConstant && sectionMatchedByConstant == null)\n\t\t\t\t\tsectionMatchedByConstant = defaultSection;\n\t\t\t\t\n\t\t\t\tint gotoCaseOrDefaultInOuterScope = gotoCaseOrDefault.Count;\n\t\t\t\tList<ControlFlowNode> sectionStartNodes = new List<ControlFlowNode>();\n\t\t\t\t\n\t\t\t\tControlFlowNode end = builder.CreateEndNode(switchStatement, addToNodeList: false);\n\t\t\t\tbreakTargets.Push(end);\n\t\t\t\tforeach (SwitchSection section in switchStatement.SwitchSections) {\n\t\t\t\t\tint sectionStartNodeID = builder.nodes.Count;\n\t\t\t\t\tif (constant == null || !constant.IsCompileTimeConstant || section == sectionMatchedByConstant) {\n\t\t\t\t\t\tHandleStatementList(section.Statements, data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This section is unreachable: pass null to HandleStatementList.\n\t\t\t\t\t\tHandleStatementList(section.Statements, null);\n\t\t\t\t\t}\n\t\t\t\t\t// Don't bother connecting the ends of the sections: the 'break' statement takes care of that.\n\t\t\t\t\t\n\t\t\t\t\t// Store the section start node for 'goto case' statements.\n\t\t\t\t\tsectionStartNodes.Add(sectionStartNodeID < builder.nodes.Count ? builder.nodes[sectionStartNodeID] : null);\n\t\t\t\t}\n\t\t\t\tbreakTargets.Pop();\n\t\t\t\tif (defaultSection == null && sectionMatchedByConstant == null) {\n\t\t\t\t\tConnect(data, end);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (gotoCaseOrDefault.Count > gotoCaseOrDefaultInOuterScope) {\n\t\t\t\t\t// Resolve 'goto case' statements:\n\t\t\t\t\tfor (int i = gotoCaseOrDefaultInOuterScope; i < gotoCaseOrDefault.Count; i++) {\n\t\t\t\t\t\tControlFlowNode gotoCaseNode = gotoCaseOrDefault[i];\n\t\t\t\t\t\tGotoCaseStatement gotoCaseStatement = gotoCaseNode.NextStatement as GotoCaseStatement;\n\t\t\t\t\t\tResolveResult gotoCaseConstant = null;\n\t\t\t\t\t\tif (gotoCaseStatement != null) {\n\t\t\t\t\t\t\tgotoCaseConstant = builder.EvaluateConstant(gotoCaseStatement.LabelExpression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tint targetSectionIndex = -1;\n\t\t\t\t\t\tint currentSectionIndex = 0;\n\t\t\t\t\t\tforeach (SwitchSection section in switchStatement.SwitchSections) {\n\t\t\t\t\t\t\tforeach (CaseLabel label in section.CaseLabels) {\n\t\t\t\t\t\t\t\tif (gotoCaseStatement != null) {\n\t\t\t\t\t\t\t\t\t// goto case\n\t\t\t\t\t\t\t\t\tif (!label.Expression.IsNull) {\n\t\t\t\t\t\t\t\t\t\tResolveResult labelConstant = builder.EvaluateConstant(label.Expression);\n\t\t\t\t\t\t\t\t\t\tif (builder.AreEqualConstants(gotoCaseConstant, labelConstant))\n\t\t\t\t\t\t\t\t\t\t\ttargetSectionIndex = currentSectionIndex;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// goto default\n\t\t\t\t\t\t\t\t\tif (label.Expression.IsNull)\n\t\t\t\t\t\t\t\t\t\ttargetSectionIndex = currentSectionIndex;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcurrentSectionIndex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (targetSectionIndex >= 0 && sectionStartNodes[targetSectionIndex] != null)\n\t\t\t\t\t\t\tConnect(gotoCaseNode, sectionStartNodes[targetSectionIndex], ControlFlowEdgeType.Jump);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tConnect(gotoCaseNode, end, ControlFlowEdgeType.Jump);\n\t\t\t\t\t}\n\t\t\t\t\tgotoCaseOrDefault.RemoveRange(gotoCaseOrDefaultInOuterScope, gotoCaseOrDefault.Count - gotoCaseOrDefaultInOuterScope);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbuilder.nodes.Add(end);\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tgotoCaseOrDefault.Add(data);\n\t\t\t\treturn builder.CreateEndNode(gotoCaseStatement);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tgotoCaseOrDefault.Add(data);\n\t\t\t\treturn builder.CreateEndNode(gotoDefaultStatement);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitWhileStatement(WhileStatement whileStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\t// <data> <condition> while (cond) { <bodyStart> embeddedStmt; <bodyEnd> } <end>\n\t\t\t\tControlFlowNode end = builder.CreateEndNode(whileStatement, addToNodeList: false);\n\t\t\t\tControlFlowNode conditionNode = builder.CreateSpecialNode(whileStatement, ControlFlowNodeType.LoopCondition);\n\t\t\t\tbreakTargets.Push(end);\n\t\t\t\tcontinueTargets.Push(conditionNode);\n\t\t\t\t\n\t\t\t\tConnect(data, conditionNode);\n\t\t\t\t\n\t\t\t\tbool? cond = builder.EvaluateCondition(whileStatement.Condition);\n\t\t\t\tControlFlowNode bodyStart = builder.CreateStartNode(whileStatement.EmbeddedStatement);\n\t\t\t\tif (cond != false)\n\t\t\t\t\tConnect(conditionNode, bodyStart, ControlFlowEdgeType.ConditionTrue);\n\t\t\t\tControlFlowNode bodyEnd = whileStatement.EmbeddedStatement.AcceptVisitor(this, bodyStart);\n\t\t\t\tConnect(bodyEnd, conditionNode);\n\t\t\t\tif (cond != true)\n\t\t\t\t\tConnect(conditionNode, end, ControlFlowEdgeType.ConditionFalse);\n\t\t\t\t\n\t\t\t\tbreakTargets.Pop();\n\t\t\t\tcontinueTargets.Pop();\n\t\t\t\tbuilder.nodes.Add(end);\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitDoWhileStatement(DoWhileStatement doWhileStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\t// <data> do { <bodyStart> embeddedStmt; <bodyEnd>} <condition> while(cond); <end>\n\t\t\t\tControlFlowNode end = builder.CreateEndNode(doWhileStatement, addToNodeList: false);\n\t\t\t\tControlFlowNode conditionNode = builder.CreateSpecialNode(doWhileStatement, ControlFlowNodeType.LoopCondition, addToNodeList: false);\n\t\t\t\tbreakTargets.Push(end);\n\t\t\t\tcontinueTargets.Push(conditionNode);\n\t\t\t\t\n\t\t\t\tControlFlowNode bodyStart = builder.CreateStartNode(doWhileStatement.EmbeddedStatement);\n\t\t\t\tConnect(data, bodyStart);\n\t\t\t\tControlFlowNode bodyEnd = doWhileStatement.EmbeddedStatement.AcceptVisitor(this, bodyStart);\n\t\t\t\tConnect(bodyEnd, conditionNode);\n\t\t\t\t\n\t\t\t\tbool? cond = builder.EvaluateCondition(doWhileStatement.Condition);\n\t\t\t\tif (cond != false)\n\t\t\t\t\tConnect(conditionNode, bodyStart, ControlFlowEdgeType.ConditionTrue);\n\t\t\t\tif (cond != true)\n\t\t\t\t\tConnect(conditionNode, end, ControlFlowEdgeType.ConditionFalse);\n\t\t\t\t\n\t\t\t\tbreakTargets.Pop();\n\t\t\t\tcontinueTargets.Pop();\n\t\t\t\tbuilder.nodes.Add(conditionNode);\n\t\t\t\tbuilder.nodes.Add(end);\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitForStatement(ForStatement forStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tdata = HandleStatementList(forStatement.Initializers, data);\n\t\t\t\t// for (initializers <data>; <condition>cond; <iteratorStart>iterators<iteratorEnd>) { <bodyStart> embeddedStmt; <bodyEnd> } <end>\n\t\t\t\tControlFlowNode end = builder.CreateEndNode(forStatement, addToNodeList: false);\n\t\t\t\tControlFlowNode conditionNode = builder.CreateSpecialNode(forStatement, ControlFlowNodeType.LoopCondition);\n\t\t\t\tConnect(data, conditionNode);\n\t\t\t\t\n\t\t\t\tint iteratorStartNodeID = builder.nodes.Count;\n\t\t\t\tControlFlowNode iteratorEnd = HandleStatementList(forStatement.Iterators, null);\n\t\t\t\tControlFlowNode iteratorStart;\n\t\t\t\tif (iteratorEnd != null) {\n\t\t\t\t\titeratorStart = builder.nodes[iteratorStartNodeID];\n\t\t\t\t\tConnect(iteratorEnd, conditionNode);\n\t\t\t\t} else {\n\t\t\t\t\titeratorStart = conditionNode;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreakTargets.Push(end);\n\t\t\t\tcontinueTargets.Push(iteratorStart);\n\t\t\t\t\n\t\t\t\tControlFlowNode bodyStart = builder.CreateStartNode(forStatement.EmbeddedStatement);\n\t\t\t\tControlFlowNode bodyEnd = forStatement.EmbeddedStatement.AcceptVisitor(this, bodyStart);\n\t\t\t\tConnect(bodyEnd, iteratorStart);\n\t\t\t\t\n\t\t\t\tbreakTargets.Pop();\n\t\t\t\tcontinueTargets.Pop();\n\t\t\t\t\n\t\t\t\tbool? cond = forStatement.Condition.IsNull ? true : builder.EvaluateCondition(forStatement.Condition);\n\t\t\t\tif (cond != false)\n\t\t\t\t\tConnect(conditionNode, bodyStart, ControlFlowEdgeType.ConditionTrue);\n\t\t\t\tif (cond != true)\n\t\t\t\t\tConnect(conditionNode, end, ControlFlowEdgeType.ConditionFalse);\n\t\t\t\t\n\t\t\t\tbuilder.nodes.Add(end);\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tControlFlowNode HandleEmbeddedStatement(Statement embeddedStatement, ControlFlowNode source)\n\t\t\t{\n\t\t\t\tif (embeddedStatement == null || embeddedStatement.IsNull)\n\t\t\t\t\treturn source;\n\t\t\t\tControlFlowNode bodyStart = builder.CreateStartNode(embeddedStatement);\n\t\t\t\tif (source != null)\n\t\t\t\t\tConnect(source, bodyStart);\n\t\t\t\treturn embeddedStatement.AcceptVisitor(this, bodyStart);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitForeachStatement(ForeachStatement foreachStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\t// <data> foreach (<condition>...) { <bodyStart>embeddedStmt<bodyEnd> } <end>\n\t\t\t\tControlFlowNode end = builder.CreateEndNode(foreachStatement, addToNodeList: false);\n\t\t\t\tControlFlowNode conditionNode = builder.CreateSpecialNode(foreachStatement, ControlFlowNodeType.LoopCondition);\n\t\t\t\tConnect(data, conditionNode);\n\t\t\t\t\n\t\t\t\tbreakTargets.Push(end);\n\t\t\t\tcontinueTargets.Push(conditionNode);\n\t\t\t\t\n\t\t\t\tControlFlowNode bodyEnd = HandleEmbeddedStatement(foreachStatement.EmbeddedStatement, conditionNode);\n\t\t\t\tConnect(bodyEnd, conditionNode);\n\t\t\t\t\n\t\t\t\tbreakTargets.Pop();\n\t\t\t\tcontinueTargets.Pop();\n\t\t\t\t\n\t\t\t\tConnect(conditionNode, end);\n\t\t\t\tbuilder.nodes.Add(end);\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitBreakStatement(BreakStatement breakStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tif (breakTargets.Count > 0)\n\t\t\t\t\tConnect(data, breakTargets.Peek(), ControlFlowEdgeType.Jump);\n\t\t\t\treturn builder.CreateEndNode(breakStatement);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitContinueStatement(ContinueStatement continueStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tif (continueTargets.Count > 0)\n\t\t\t\t\tConnect(data, continueTargets.Peek(), ControlFlowEdgeType.Jump);\n\t\t\t\treturn builder.CreateEndNode(continueStatement);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitGotoStatement(GotoStatement gotoStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tbuilder.gotoStatements.Add(data);\n\t\t\t\treturn builder.CreateEndNode(gotoStatement);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitReturnStatement(ReturnStatement returnStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\treturn builder.CreateEndNode(returnStatement); // end not connected with data\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitThrowStatement(ThrowStatement throwStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\treturn builder.CreateEndNode(throwStatement); // end not connected with data\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitTryCatchStatement(TryCatchStatement tryCatchStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tControlFlowNode end = builder.CreateEndNode(tryCatchStatement, addToNodeList: false);\n\t\t\t\tvar edge = Connect(HandleEmbeddedStatement(tryCatchStatement.TryBlock, data), end);\n\t\t\t\tif (!tryCatchStatement.FinallyBlock.IsNull)\n\t\t\t\t\tedge.AddJumpOutOfTryFinally(tryCatchStatement);\n\t\t\t\tforeach (CatchClause cc in tryCatchStatement.CatchClauses) {\n\t\t\t\t\tedge = Connect(HandleEmbeddedStatement(cc.Body, data), end);\n\t\t\t\t\tif (!tryCatchStatement.FinallyBlock.IsNull)\n\t\t\t\t\t\tedge.AddJumpOutOfTryFinally(tryCatchStatement);\n\t\t\t\t}\n\t\t\t\tif (!tryCatchStatement.FinallyBlock.IsNull) {\n\t\t\t\t\t// Don't connect the end of the try-finally block to anything.\n\t\t\t\t\t// Consumers of the CFG will have to special-case try-finally.\n\t\t\t\t\tHandleEmbeddedStatement(tryCatchStatement.FinallyBlock, data);\n\t\t\t\t}\n\t\t\t\tbuilder.nodes.Add(end);\n\t\t\t\treturn end;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitCheckedStatement(CheckedStatement checkedStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tControlFlowNode bodyEnd = HandleEmbeddedStatement(checkedStatement.Body, data);\n\t\t\t\treturn CreateConnectedEndNode(checkedStatement, bodyEnd);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitUncheckedStatement(UncheckedStatement uncheckedStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tControlFlowNode bodyEnd = HandleEmbeddedStatement(uncheckedStatement.Body, data);\n\t\t\t\treturn CreateConnectedEndNode(uncheckedStatement, bodyEnd);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitLockStatement(LockStatement lockStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tControlFlowNode bodyEnd = HandleEmbeddedStatement(lockStatement.EmbeddedStatement, data);\n\t\t\t\treturn CreateConnectedEndNode(lockStatement, bodyEnd);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitUsingStatement(UsingStatement usingStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tdata = HandleEmbeddedStatement(usingStatement.ResourceAcquisition as Statement, data);\n\t\t\t\tControlFlowNode bodyEnd = HandleEmbeddedStatement(usingStatement.EmbeddedStatement, data);\n\t\t\t\treturn CreateConnectedEndNode(usingStatement, bodyEnd);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitYieldReturnStatement(YieldReturnStatement yieldStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\treturn CreateConnectedEndNode(yieldStatement, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\treturn builder.CreateEndNode(yieldBreakStatement); // end not connected with data\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitUnsafeStatement(UnsafeStatement unsafeStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tControlFlowNode bodyEnd = HandleEmbeddedStatement(unsafeStatement.Body, data);\n\t\t\t\treturn CreateConnectedEndNode(unsafeStatement, bodyEnd);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ControlFlowNode VisitFixedStatement(FixedStatement fixedStatement, ControlFlowNode data)\n\t\t\t{\n\t\t\t\tControlFlowNode bodyEnd = HandleEmbeddedStatement(fixedStatement.EmbeddedStatement, data);\n\t\t\t\treturn CreateConnectedEndNode(fixedStatement, bodyEnd);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Debugging helper that exports a control flow graph.\n\t\t/// </summary>\n\t\tpublic static GraphVizGraph ExportGraph(IList<ControlFlowNode> nodes)\n\t\t{\n\t\t\tGraphVizGraph g = new GraphVizGraph();\n\t\t\tGraphVizNode[] n = new GraphVizNode[nodes.Count];\n\t\t\tDictionary<ControlFlowNode, int> dict = new Dictionary<ControlFlowNode, int>();\n\t\t\tfor (int i = 0; i < n.Length; i++) {\n\t\t\t\tdict.Add(nodes[i], i);\n\t\t\t\tn[i] = new GraphVizNode(i);\n\t\t\t\tstring name = \"#\" + i + \" = \";\n\t\t\t\tswitch (nodes[i].Type) {\n\t\t\t\t\tcase ControlFlowNodeType.StartNode:\n\t\t\t\t\tcase ControlFlowNodeType.BetweenStatements:\n\t\t\t\t\t\tname += nodes[i].NextStatement.DebugToString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ControlFlowNodeType.EndNode:\n\t\t\t\t\t\tname += \"End of \" + nodes[i].PreviousStatement.DebugToString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ControlFlowNodeType.LoopCondition:\n\t\t\t\t\t\tname += \"Condition in \" + nodes[i].NextStatement.DebugToString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tname += \"?\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tn[i].label = name;\n\t\t\t\tg.AddNode(n[i]);\n\t\t\t}\n\t\t\tfor (int i = 0; i < n.Length; i++) {\n\t\t\t\tforeach (ControlFlowEdge edge in nodes[i].Outgoing) {\n\t\t\t\t\tGraphVizEdge ge = new GraphVizEdge(i, dict[edge.To]);\n\t\t\t\t\tif (edge.IsLeavingTryFinally)\n\t\t\t\t\t\tge.style = \"dashed\";\n\t\t\t\t\tswitch (edge.Type) {\n\t\t\t\t\t\tcase ControlFlowEdgeType.ConditionTrue:\n\t\t\t\t\t\t\tge.color = \"green\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ControlFlowEdgeType.ConditionFalse:\n\t\t\t\t\t\t\tge.color = \"red\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ControlFlowEdgeType.Jump:\n\t\t\t\t\t\t\tge.color = \"blue\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tg.AddEdge(ge);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn g;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/DeclarationSpace/LocalDeclarationSpace.cs",
    "content": "// \n// LovalVariableDeclarationSpace.cs\n//  \n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n// \n// Copyright (c) 2013 Simon Lindgren\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Utils;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t/// <summary>\n\t/// Represents a declaration space. (§3.3)\n\t/// </summary>\n\tpublic class LocalDeclarationSpace\n\t{\n\t\t/// <summary>\n\t\t/// Maps from variable name to the declarations in this declaration space.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This maps from variable name\n\t\t/// </remarks>\n\t\tMultiDictionary<string, AstNode> declarations = new MultiDictionary<string, AstNode> ();\n\n\t\tpublic LocalDeclarationSpace()\n\t\t{\n\t\t\tChildren = new List<LocalDeclarationSpace> ();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The child declaration spaces.\n\t\t/// </summary>\n\t\tpublic IList<LocalDeclarationSpace> Children {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The parent declaration space.\n\t\t/// </summary>\n\t\t/// <value>The parent.</value>\n\t\tpublic LocalDeclarationSpace Parent {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The names declared in this declaration space, excluding child spaces.\n\t\t/// </summary>\n\t\t/// <value>The declared names.</value>\n\t\tpublic ICollection<string> DeclaredNames {\n\t\t\tget {\n\t\t\t\treturn declarations.Keys;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get all nodes declaring the name specified in <paramref name=\"name\"/>.\n\t\t/// </summary>\n\t\t/// <returns>The declaring nodes.</returns>\n\t\t/// <param name=\"name\">The declaration name.</param>\n\t\tpublic IEnumerable<AstNode> GetNameDeclarations(string name)\n\t\t{\n\t\t\treturn declarations [name].Concat(Children.SelectMany(child => child.GetNameDeclarations(name)));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Adds a child declaration space.\n\t\t/// </summary>\n\t\t/// <param name=\"child\">The <see cref=\"LocalDeclarationSpace\"/> to add.</param>\n\t\tpublic void AddChildSpace(LocalDeclarationSpace child)\n\t\t{\n\t\t\tif (child == null)\n\t\t\t\tthrow new ArgumentNullException(\"child\");\n\t\t\tif (Children.Contains(child))\n\t\t\t\tthrow new InvalidOperationException(\"the child was already added\");\n\n\t\t\tChildren.Add(child);\n\t\t\tchild.Parent = this;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Adds a new declaration to the declaration space.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">The name of the declared variable.</param>\n\t\t/// <param name=\"node\">A node associated with the declaration.</param>\n\t\tpublic void AddDeclaration(string name, AstNode node)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tif (node == null)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\tdeclarations.Add(name, node);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines if the name exists in the this declaration space.\n\t\t/// </summary>\n\t\t/// <returns><c>true</c>, if the name specified in <paramref name=\"name\"/> is used in this variable declaration space, <c>false</c> otherwise.</returns>\n\t\t/// <param name=\"name\">The name to look for.</param>\n\t\t/// <param name=\"includeChildren\">When <c>true</c>, child declaration spaces are included in the search.</param>\n\t\tpublic bool ContainsName(string name, bool includeChildren)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\n\t\t\tif (declarations.Keys.Contains(name)) \n\t\t\t\treturn true;\n\t\t\treturn includeChildren && Children.Any(child => child.ContainsName(name, true));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Determines whether the name specified in <paramref name=\"name\"/> is used in surrouding code.\n\t\t/// </summary>\n\t\t/// <returns><c>true</c> if the name is used, <c>false</c> otherwise.</returns>\n\t\t/// <param name=\"name\">The name to check.</param>\n\t\t/// <remarks>\n\t\t/// Contrary to <see cref=\"ContainsName\"/>, this method also checks parent declaration spaces\n\t\t/// for name conflicts. Typically, this will be the right method to use when determining if a name can be used.\n\t\t/// </remarks>\n\t\tpublic bool IsNameUsed(string name)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\n\t\t\treturn IsNameUsedBySelfOrParent(name) || Children.Any(child => child.ContainsName(name, true));\n\t\t}\n\n\t\tbool IsNameUsedBySelfOrParent(string name)\n\t\t{\n\t\t\tif (declarations.Keys.Contains(name))\n\t\t\t\treturn true;\n\t\t\treturn Parent != null && Parent.IsNameUsedBySelfOrParent(name);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/DeclarationSpace/LocalDeclarationSpaceVisitor.cs",
    "content": "//\n// LocalDeclarationSpaceVisitor.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2013 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\tpublic class LocalDeclarationSpaceVisitor : DepthFirstAstVisitor\n\t{\n\t\tLocalDeclarationSpace currentDeclarationSpace;\n\t\tDictionary<AstNode, LocalDeclarationSpace> nodeDeclarationSpaces = new Dictionary<AstNode, LocalDeclarationSpace>();\n\t\t\n\t\tpublic LocalDeclarationSpace GetDeclarationSpace(AstNode node)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\twhile (node != null) {\n\t\t\t\tLocalDeclarationSpace declarationSpace;\n\t\t\t\tif (nodeDeclarationSpaces.TryGetValue(node, out declarationSpace))\n\t\t\t\t\treturn declarationSpace;\n\t\t\t\tnode = node.Parent;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t#region Visitor\n\n\t\tvoid AddDeclaration(string name, AstNode node)\n\t\t{\n\t\t\tif (currentDeclarationSpace != null)\n\t\t\t\tcurrentDeclarationSpace.AddDeclaration(name, node);\n\t\t}\n\n\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\tAddDeclaration(variableInitializer.Name, variableInitializer);\n\t\t\tbase.VisitVariableInitializer(variableInitializer);\n\t\t}\n\n\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tAddDeclaration(parameterDeclaration.Name, parameterDeclaration);\n\t\t\tbase.VisitParameterDeclaration(parameterDeclaration);\n\t\t}\n\n\t\tvoid VisitNewDeclarationSpace(AstNode node)\n\t\t{\n\t\t\tvar oldDeclarationSpace = currentDeclarationSpace;\n\t\t\tcurrentDeclarationSpace = new LocalDeclarationSpace();\n\t\t\tif (oldDeclarationSpace != null)\n\t\t\t\toldDeclarationSpace.AddChildSpace(currentDeclarationSpace);\n\n\t\t\tVisitChildren(node);\n\n\t\t\tnodeDeclarationSpaces.Add(node, currentDeclarationSpace);\n\t\t\tcurrentDeclarationSpace = oldDeclarationSpace;\n\t\t}\n\n\t\t#region Declaration space creating nodes\n\t\t\n\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(methodDeclaration);\n\t\t}\n\n\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(blockStatement);\n\t\t}\n\n\t\tpublic override void VisitSwitchStatement(SwitchStatement switchStatement)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(switchStatement);\n\t\t}\n\n\t\tpublic override void VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t{\n\t\t\tAddDeclaration(foreachStatement.VariableName, foreachStatement);\n\t\t\tVisitNewDeclarationSpace(foreachStatement);\n\t\t}\n\t\t\n\t\tpublic override void VisitForStatement(ForStatement forStatement)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(forStatement);\n\t\t}\n\n\t\tpublic override void VisitUsingStatement(UsingStatement usingStatement)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(usingStatement);\n\t\t}\n\n\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(lambdaExpression);\n\t\t}\n\n\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(anonymousMethodExpression);\n\t\t}\n\n\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tAddDeclaration(eventDeclaration.Name, eventDeclaration);\n\t\t}\n\n\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\tVisitNewDeclarationSpace(eventDeclaration);\n\t\t}\n\n\t\t#endregion\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/DefiniteAssignmentAnalysis.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\n\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t/// <summary>\n\t/// Represents the definite assignment status of a variable at a specific location.\n\t/// </summary>\n\tpublic enum DefiniteAssignmentStatus\n\t{\n\t\t/// <summary>\n\t\t/// The variable might be assigned or unassigned.\n\t\t/// </summary>\n\t\tPotentiallyAssigned,\n\t\t/// <summary>\n\t\t/// The variable is definitely assigned.\n\t\t/// </summary>\n\t\tDefinitelyAssigned,\n\t\t/// <summary>\n\t\t/// The variable is definitely assigned iff the expression results in the value 'true'.\n\t\t/// </summary>\n\t\tAssignedAfterTrueExpression,\n\t\t/// <summary>\n\t\t/// The variable is definitely assigned iff the expression results in the value 'false'.\n\t\t/// </summary>\n\t\tAssignedAfterFalseExpression,\n\t\t/// <summary>\n\t\t/// The code is unreachable.\n\t\t/// </summary>\n\t\tCodeUnreachable\n\t}\n\t\n\t/// <summary>\n\t/// Implements the C# definite assignment analysis (C# 4.0 Spec: §5.3 Definite assignment)\n\t/// </summary>\n\tpublic class DefiniteAssignmentAnalysis\n\t{\n\t\tsealed class DefiniteAssignmentNode : ControlFlowNode\n\t\t{\n\t\t\tpublic int Index;\n\t\t\tpublic DefiniteAssignmentStatus NodeStatus;\n\t\t\t\n\t\t\tpublic DefiniteAssignmentNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)\n\t\t\t\t: base(previousStatement, nextStatement, type)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class DerivedControlFlowGraphBuilder : ControlFlowGraphBuilder\n\t\t{\n\t\t\tprotected override ControlFlowNode CreateNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)\n\t\t\t{\n\t\t\t\treturn new DefiniteAssignmentNode(previousStatement, nextStatement, type);\n\t\t\t}\n\t\t}\n\t\t\n\t\treadonly DefiniteAssignmentVisitor visitor = new DefiniteAssignmentVisitor();\n\t\treadonly List<DefiniteAssignmentNode> allNodes = new List<DefiniteAssignmentNode>();\n\t\treadonly Dictionary<Statement, DefiniteAssignmentNode> beginNodeDict = new Dictionary<Statement, DefiniteAssignmentNode>();\n\t\treadonly Dictionary<Statement, DefiniteAssignmentNode> endNodeDict = new Dictionary<Statement, DefiniteAssignmentNode>();\n\t\treadonly Dictionary<Statement, DefiniteAssignmentNode> conditionNodeDict = new Dictionary<Statement, DefiniteAssignmentNode>();\n\t\treadonly CSharpAstResolver resolver;\n\t\tDictionary<ControlFlowEdge, DefiniteAssignmentStatus> edgeStatus = new Dictionary<ControlFlowEdge, DefiniteAssignmentStatus>();\n\t\t\n\t\tstring variableName;\n\t\tList<IdentifierExpression> unassignedVariableUses = new List<IdentifierExpression>();\n\t\tint analyzedRangeStart, analyzedRangeEnd;\n\t\tCancellationToken analysisCancellationToken;\n\t\t\n\t\tQueue<DefiniteAssignmentNode> nodesWithModifiedInput = new Queue<DefiniteAssignmentNode>();\n\t\t\n\t\tpublic DefiniteAssignmentAnalysis(Statement rootStatement, CancellationToken cancellationToken)\n\t\t\t: this(rootStatement,\n\t\t\t       new CSharpAstResolver(new CSharpResolver(MinimalCorlib.Instance.CreateCompilation()), rootStatement),\n\t\t\t       cancellationToken)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DefiniteAssignmentAnalysis(Statement rootStatement, CSharpAstResolver resolver, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (rootStatement == null)\n\t\t\t\tthrow new ArgumentNullException(\"rootStatement\");\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\tthis.resolver = resolver;\n\t\t\t\n\t\t\tvisitor.analysis = this;\n\t\t\tDerivedControlFlowGraphBuilder cfgBuilder = new DerivedControlFlowGraphBuilder();\n\t\t\tif (resolver.TypeResolveContext.Compilation.MainAssembly.UnresolvedAssembly is MinimalCorlib) {\n\t\t\t\tcfgBuilder.EvaluateOnlyPrimitiveConstants = true;\n\t\t\t}\n\t\t\tallNodes.AddRange(cfgBuilder.BuildControlFlowGraph(rootStatement, resolver, cancellationToken).Cast<DefiniteAssignmentNode>());\n\t\t\tfor (int i = 0; i < allNodes.Count; i++) {\n\t\t\t\tDefiniteAssignmentNode node = allNodes[i];\n\t\t\t\tnode.Index = i; // assign numbers to the nodes\n\t\t\t\tif (node.Type == ControlFlowNodeType.StartNode || node.Type == ControlFlowNodeType.BetweenStatements) {\n\t\t\t\t\t// Anonymous methods have separate control flow graphs, but we also need to analyze those.\n\t\t\t\t\t// Iterate backwards so that anonymous methods are inserted in the correct order\n\t\t\t\t\tfor (AstNode child = node.NextStatement.LastChild; child != null; child = child.PrevSibling) {\n\t\t\t\t\t\tInsertAnonymousMethods(i + 1, child, cfgBuilder, cancellationToken);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Now register the node in the dictionaries:\n\t\t\t\tif (node.Type == ControlFlowNodeType.StartNode || node.Type == ControlFlowNodeType.BetweenStatements)\n\t\t\t\t\tbeginNodeDict.Add(node.NextStatement, node);\n\t\t\t\tif (node.Type == ControlFlowNodeType.BetweenStatements || node.Type == ControlFlowNodeType.EndNode)\n\t\t\t\t\tendNodeDict.Add(node.PreviousStatement, node);\n\t\t\t\tif (node.Type == ControlFlowNodeType.LoopCondition)\n\t\t\t\t\tconditionNodeDict.Add(node.NextStatement, node);\n\t\t\t}\n\t\t\t// Verify that we created nodes for all statements:\n\t\t\tDebug.Assert(!rootStatement.DescendantsAndSelf.OfType<Statement>().Except(allNodes.Select(n => n.NextStatement)).Any());\n\t\t\t// Verify that we put all nodes into the dictionaries:\n\t\t\tDebug.Assert(rootStatement.DescendantsAndSelf.OfType<Statement>().All(stmt => beginNodeDict.ContainsKey(stmt)));\n\t\t\tDebug.Assert(rootStatement.DescendantsAndSelf.OfType<Statement>().All(stmt => endNodeDict.ContainsKey(stmt)));\n\t\t\t\n\t\t\tthis.analyzedRangeStart = 0;\n\t\t\tthis.analyzedRangeEnd = allNodes.Count - 1;\n\t\t}\n\t\t\n\t\tvoid InsertAnonymousMethods(int insertPos, AstNode node, ControlFlowGraphBuilder cfgBuilder, CancellationToken cancellationToken)\n\t\t{\n\t\t\t// Ignore any statements, as those have their own ControlFlowNode and get handled separately\n\t\t\tif (node is Statement)\n\t\t\t\treturn;\n\t\t\tAnonymousMethodExpression ame = node as AnonymousMethodExpression;\n\t\t\tif (ame != null) {\n\t\t\t\tallNodes.InsertRange(insertPos, cfgBuilder.BuildControlFlowGraph(ame.Body, resolver, cancellationToken).Cast<DefiniteAssignmentNode>());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tLambdaExpression lambda = node as LambdaExpression;\n\t\t\tif (lambda != null && lambda.Body is Statement) {\n\t\t\t\tallNodes.InsertRange(insertPos, cfgBuilder.BuildControlFlowGraph((Statement)lambda.Body, resolver, cancellationToken).Cast<DefiniteAssignmentNode>());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Descend into child expressions\n\t\t\t// Iterate backwards so that anonymous methods are inserted in the correct order\n\t\t\tfor (AstNode child = node.LastChild; child != null; child = child.PrevSibling) {\n\t\t\t\tInsertAnonymousMethods(insertPos, child, cfgBuilder, cancellationToken);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the unassigned usages of the previously analyzed variable.\n\t\t/// </summary>\n\t\tpublic IList<IdentifierExpression> UnassignedVariableUses {\n\t\t\tget {\n\t\t\t\treturn unassignedVariableUses.AsReadOnly();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets the range of statements to be analyzed.\n\t\t/// This method can be used to restrict the analysis to only a part of the method.\n\t\t/// Only the control flow paths that are fully contained within the selected part will be analyzed.\n\t\t/// </summary>\n\t\t/// <remarks>By default, both 'start' and 'end' are inclusive.</remarks>\n\t\tpublic void SetAnalyzedRange(Statement start, Statement end, bool startInclusive = true, bool endInclusive = true)\n\t\t{\n\t\t\tvar dictForStart = startInclusive ? beginNodeDict : endNodeDict;\n\t\t\tvar dictForEnd = endInclusive ? endNodeDict : beginNodeDict;\n\t\t\tDebug.Assert(dictForStart.ContainsKey(start) && dictForEnd.ContainsKey(end));\n\t\t\tint startIndex = dictForStart[start].Index;\n\t\t\tint endIndex = dictForEnd[end].Index;\n\t\t\tif (startIndex > endIndex)\n\t\t\t\tthrow new ArgumentException(\"The start statement must be lexically preceding the end statement\");\n\t\t\tthis.analyzedRangeStart = startIndex;\n\t\t\tthis.analyzedRangeEnd = endIndex;\n\t\t}\n\t\t\n\t\tpublic void Analyze(string variable, DefiniteAssignmentStatus initialStatus = DefiniteAssignmentStatus.PotentiallyAssigned, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tthis.analysisCancellationToken = cancellationToken;\n\t\t\tthis.variableName = variable;\n\t\t\ttry {\n\t\t\t\t// Reset the status:\n\t\t\t\tunassignedVariableUses.Clear();\n\t\t\t\tforeach (DefiniteAssignmentNode node in allNodes) {\n\t\t\t\t\tnode.NodeStatus = DefiniteAssignmentStatus.CodeUnreachable;\n\t\t\t\t\tforeach (ControlFlowEdge edge in node.Outgoing)\n\t\t\t\t\t\tedgeStatus[edge] = DefiniteAssignmentStatus.CodeUnreachable;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tChangeNodeStatus(allNodes[analyzedRangeStart], initialStatus);\n\t\t\t\t// Iterate as long as the input status of some nodes is changing:\n\t\t\t\twhile (nodesWithModifiedInput.Count > 0) {\n\t\t\t\t\tDefiniteAssignmentNode node = nodesWithModifiedInput.Dequeue();\n\t\t\t\t\tDefiniteAssignmentStatus inputStatus = DefiniteAssignmentStatus.CodeUnreachable;\n\t\t\t\t\tforeach (ControlFlowEdge edge in node.Incoming) {\n\t\t\t\t\t\tinputStatus = MergeStatus(inputStatus, edgeStatus[edge]);\n\t\t\t\t\t}\n\t\t\t\t\tChangeNodeStatus(node, inputStatus);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.analysisCancellationToken = CancellationToken.None;\n\t\t\t\tthis.variableName = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic DefiniteAssignmentStatus GetStatusBefore(Statement statement)\n\t\t{\n\t\t\treturn beginNodeDict[statement].NodeStatus;\n\t\t}\n\t\t\n\t\tpublic DefiniteAssignmentStatus GetStatusAfter(Statement statement)\n\t\t{\n\t\t\treturn endNodeDict[statement].NodeStatus;\n\t\t}\n\t\t\n\t\tpublic DefiniteAssignmentStatus GetStatusBeforeLoopCondition(Statement statement)\n\t\t{\n\t\t\treturn conditionNodeDict[statement].NodeStatus;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Exports the CFG. This method is intended to help debugging issues related to definite assignment.\n\t\t/// </summary>\n\t\tpublic GraphVizGraph ExportGraph()\n\t\t{\n\t\t\tGraphVizGraph g = new GraphVizGraph();\n\t\t\tg.Title = \"DefiniteAssignment - \" + variableName;\n\t\t\tfor (int i = 0; i < allNodes.Count; i++) {\n\t\t\t\tstring name = \"#\" + i + \" = \" + allNodes[i].NodeStatus.ToString() + Environment.NewLine;\n\t\t\t\tswitch (allNodes[i].Type) {\n\t\t\t\t\tcase ControlFlowNodeType.StartNode:\n\t\t\t\t\tcase ControlFlowNodeType.BetweenStatements:\n\t\t\t\t\t\tname += allNodes[i].NextStatement.ToString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ControlFlowNodeType.EndNode:\n\t\t\t\t\t\tname += \"End of \" + allNodes[i].PreviousStatement.ToString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ControlFlowNodeType.LoopCondition:\n\t\t\t\t\t\tname += \"Condition in \" + allNodes[i].NextStatement.ToString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tname += allNodes[i].Type.ToString();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tg.AddNode(new GraphVizNode(i) { label = name });\n\t\t\t\tforeach (ControlFlowEdge edge in allNodes[i].Outgoing) {\n\t\t\t\t\tGraphVizEdge ge = new GraphVizEdge(i, ((DefiniteAssignmentNode)edge.To).Index);\n\t\t\t\t\tif (edgeStatus.Count > 0)\n\t\t\t\t\t\tge.label = edgeStatus[edge].ToString();\n\t\t\t\t\tif (edge.IsLeavingTryFinally)\n\t\t\t\t\t\tge.style = \"dashed\";\n\t\t\t\t\tswitch (edge.Type) {\n\t\t\t\t\t\tcase ControlFlowEdgeType.ConditionTrue:\n\t\t\t\t\t\t\tge.color = \"green\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ControlFlowEdgeType.ConditionFalse:\n\t\t\t\t\t\t\tge.color = \"red\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ControlFlowEdgeType.Jump:\n\t\t\t\t\t\t\tge.color = \"blue\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tg.AddEdge(ge);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn g;\n\t\t}\n\t\t\n\t\tstatic DefiniteAssignmentStatus MergeStatus(DefiniteAssignmentStatus a, DefiniteAssignmentStatus b)\n\t\t{\n\t\t\t// The result will be DefinitelyAssigned if at least one incoming edge is DefinitelyAssigned and all others are unreachable.\n\t\t\t// The result will be DefinitelyUnassigned if at least one incoming edge is DefinitelyUnassigned and all others are unreachable.\n\t\t\t// The result will be Unreachable if all incoming edges are unreachable.\n\t\t\t// Otherwise, the result will be PotentiallyAssigned.\n\t\t\t\n\t\t\tif (a == b)\n\t\t\t\treturn a;\n\t\t\telse if (a == DefiniteAssignmentStatus.CodeUnreachable)\n\t\t\t\treturn b;\n\t\t\telse if (b == DefiniteAssignmentStatus.CodeUnreachable)\n\t\t\t\treturn a;\n\t\t\telse\n\t\t\t\treturn DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t}\n\t\t\n\t\tvoid ChangeNodeStatus (DefiniteAssignmentNode node, DefiniteAssignmentStatus inputStatus)\n\t\t{\n\t\t\tif (node.NodeStatus == inputStatus)\n\t\t\t\treturn;\n\t\t\tnode.NodeStatus = inputStatus;\n\t\t\tDefiniteAssignmentStatus outputStatus;\n\t\t\tswitch (node.Type) {\n\t\t\tcase ControlFlowNodeType.StartNode:\n\t\t\tcase ControlFlowNodeType.BetweenStatements:\n\t\t\t\tif (node.NextStatement is IfElseStatement) {\n\t\t\t\t\t// Handle if-else as a condition node\n\t\t\t\t\t\tgoto case ControlFlowNodeType.LoopCondition;\n\t\t\t\t}\n\t\t\t\tif (inputStatus == DefiniteAssignmentStatus.DefinitelyAssigned) {\n\t\t\t\t\t// There isn't any way to un-assign variables, so we don't have to check the expression\n\t\t\t\t\t// if the status already is definitely assigned.\n\t\t\t\t\toutputStatus = DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t} else {\n\t\t\t\t\toutputStatus = CleanSpecialValues (node.NextStatement.AcceptVisitor (visitor, inputStatus));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ControlFlowNodeType.EndNode:\n\t\t\t\toutputStatus = inputStatus;\n\t\t\t\tif (node.PreviousStatement.Role == TryCatchStatement.FinallyBlockRole\n\t\t\t\t\t&& (outputStatus == DefiniteAssignmentStatus.DefinitelyAssigned || outputStatus == DefiniteAssignmentStatus.PotentiallyAssigned)) {\n\t\t\t\t\tTryCatchStatement tryFinally = (TryCatchStatement)node.PreviousStatement.Parent;\n\t\t\t\t\t// Changing the status on a finally block potentially changes the status of all edges leaving that finally block:\n\t\t\t\t\tforeach (ControlFlowEdge edge in allNodes.SelectMany(n => n.Outgoing)) {\n\t\t\t\t\t\tif (edge.IsLeavingTryFinally && edge.TryFinallyStatements.Contains (tryFinally)) {\n\t\t\t\t\t\t\tDefiniteAssignmentStatus s = edgeStatus [edge];\n\t\t\t\t\t\t\tif (s == DefiniteAssignmentStatus.PotentiallyAssigned) {\n\t\t\t\t\t\t\t\tChangeEdgeStatus (edge, outputStatus);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ControlFlowNodeType.LoopCondition:\n\t\t\t\tForeachStatement foreachStmt = node.NextStatement as ForeachStatement;\n\t\t\t\tif (foreachStmt != null) {\n\t\t\t\t\toutputStatus = CleanSpecialValues (foreachStmt.InExpression.AcceptVisitor (visitor, inputStatus));\n\t\t\t\t\tif (foreachStmt.VariableName == this.variableName)\n\t\t\t\t\t\toutputStatus = DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tDebug.Assert (node.NextStatement is IfElseStatement || node.NextStatement is WhileStatement || node.NextStatement is ForStatement || node.NextStatement is DoWhileStatement);\n\t\t\t\t\tExpression condition = node.NextStatement.GetChildByRole (Roles.Condition);\n\t\t\t\t\t\tif (condition.IsNull)\n\t\t\t\t\t\t\toutputStatus = inputStatus;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\toutputStatus = condition.AcceptVisitor(visitor, inputStatus);\n\t\t\t\t\t\tforeach (ControlFlowEdge edge in node.Outgoing) {\n\t\t\t\t\t\t\tif (edge.Type == ControlFlowEdgeType.ConditionTrue && outputStatus == DefiniteAssignmentStatus.AssignedAfterTrueExpression) {\n\t\t\t\t\t\t\t\tChangeEdgeStatus(edge, DefiniteAssignmentStatus.DefinitelyAssigned);\n\t\t\t\t\t\t\t} else if (edge.Type == ControlFlowEdgeType.ConditionFalse && outputStatus == DefiniteAssignmentStatus.AssignedAfterFalseExpression) {\n\t\t\t\t\t\t\t\tChangeEdgeStatus(edge, DefiniteAssignmentStatus.DefinitelyAssigned);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tChangeEdgeStatus(edge, CleanSpecialValues(outputStatus));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\tforeach (ControlFlowEdge edge in node.Outgoing) {\n\t\t\t\tChangeEdgeStatus(edge, outputStatus);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid ChangeEdgeStatus(ControlFlowEdge edge, DefiniteAssignmentStatus newStatus)\n\t\t{\n\t\t\tDefiniteAssignmentStatus oldStatus = edgeStatus[edge];\n\t\t\tif (oldStatus == newStatus)\n\t\t\t\treturn;\n\t\t\t// Ensure that status can cannot change back to CodeUnreachable after it once was reachable.\n\t\t\t// Also, don't ever use AssignedAfter... for statements.\n\t\t\tif (newStatus == DefiniteAssignmentStatus.CodeUnreachable\n\t\t\t    || newStatus == DefiniteAssignmentStatus.AssignedAfterFalseExpression\n\t\t\t    || newStatus == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\t// Note that the status can change from DefinitelyAssigned\n\t\t\t// back to PotentiallyAssigned as unreachable input edges are\n\t\t\t// discovered to be reachable.\n\t\t\t\n\t\t\tedgeStatus[edge] = newStatus;\n\t\t\tDefiniteAssignmentNode targetNode = (DefiniteAssignmentNode)edge.To;\n\t\t\tif (analyzedRangeStart <= targetNode.Index && targetNode.Index <= analyzedRangeEnd) {\n\t\t\t\t// TODO: potential optimization: visit previously unreachable nodes with higher priority\n\t\t\t\t// (e.g. use Deque and enqueue previously unreachable nodes at the front, but\n\t\t\t\t// other nodes at the end)\n\t\t\t\tnodesWithModifiedInput.Enqueue(targetNode);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Evaluates an expression.\n\t\t/// </summary>\n\t\t/// <returns>The constant value of the expression; or null if the expression is not a constant.</returns>\n\t\tResolveResult EvaluateConstant(Expression expr)\n\t\t{\n\t\t\treturn resolver.Resolve(expr, analysisCancellationToken);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Evaluates an expression.\n\t\t/// </summary>\n\t\t/// <returns>The value of the constant boolean expression; or null if the value is not a constant boolean expression.</returns>\n\t\tbool? EvaluateCondition(Expression expr)\n\t\t{\n\t\t\tResolveResult rr = EvaluateConstant(expr);\n\t\t\tif (rr != null && rr.IsCompileTimeConstant)\n\t\t\t\treturn rr.ConstantValue as bool?;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tstatic DefiniteAssignmentStatus CleanSpecialValues(DefiniteAssignmentStatus status)\n\t\t{\n\t\t\tif (status == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t\treturn DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\telse if (status == DefiniteAssignmentStatus.AssignedAfterFalseExpression)\n\t\t\t\treturn DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\telse\n\t\t\t\treturn status;\n\t\t}\n\t\t\n\t\tsealed class DefiniteAssignmentVisitor : DepthFirstAstVisitor<DefiniteAssignmentStatus, DefiniteAssignmentStatus>\n\t\t{\n\t\t\tinternal DefiniteAssignmentAnalysis analysis;\n\t\t\t\n\t\t\t// The general approach for unknown nodes is to pass the status through all child nodes in order\n\t\t\tprotected override DefiniteAssignmentStatus VisitChildren(AstNode node, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\t// the special values are valid as output only, not as input\n\t\t\t\tDebug.Assert(data == CleanSpecialValues(data));\n\t\t\t\tDefiniteAssignmentStatus status = data;\n\t\t\t\tfor (AstNode child = node.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\t\tanalysis.analysisCancellationToken.ThrowIfCancellationRequested();\n\t\t\t\t\t\n\t\t\t\t\tDebug.Assert(!(child is Statement)); // statements are visited with the CFG, not with the visitor pattern\n\t\t\t\t\tstatus = child.AcceptVisitor(this, status);\n\t\t\t\t\tstatus = CleanSpecialValues(status);\n\t\t\t\t}\n\t\t\t\treturn status;\n\t\t\t}\n\t\t\t\n\t\t\t#region Statements\n\t\t\t// For statements, the visitor only describes the effect of the statement itself;\n\t\t\t// we do not consider the effect of any nested statements.\n\t\t\t// This is done because the nested statements will be reached using the control flow graph.\n\t\t\t\n\t\t\t// In fact, these methods are present so that the default logic in VisitChildren does not try to visit the nested statements.\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitBlockStatement(BlockStatement blockStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitCheckedStatement(CheckedStatement checkedStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitUncheckedStatement(UncheckedStatement uncheckedStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\t\n\t\t\t// ExpressionStatement handled by default logic\n\t\t\t// VariableDeclarationStatement handled by default logic\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitVariableInitializer(VariableInitializer variableInitializer, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tif (variableInitializer.Initializer.IsNull) {\n\t\t\t\t\treturn data;\n\t\t\t\t} else {\n\t\t\t\t\tDefiniteAssignmentStatus status = variableInitializer.Initializer.AcceptVisitor(this, data);\n\t\t\t\t\tif (variableInitializer.Name == analysis.variableName)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn status;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// IfStatement not handled by visitor, but special-cased in the code consuming the control flow graph\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitSwitchStatement(SwitchStatement switchStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn switchStatement.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitWhileStatement(WhileStatement whileStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data; // condition is handled by special condition CFG node\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitDoWhileStatement(DoWhileStatement doWhileStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data; // condition is handled by special condition CFG node\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitForStatement(ForStatement forStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data; // condition is handled by special condition CFG node; initializer and iterator statements are handled by CFG\n\t\t\t}\n\t\t\t\n\t\t\t// Break/Continue/Goto: handled by default logic\n\t\t\t\n\t\t\t// ThrowStatement: handled by default logic (just visit the expression)\n\t\t\t// ReturnStatement: handled by default logic (just visit the expression)\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitTryCatchStatement(TryCatchStatement tryCatchStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data; // no special logic when entering the try-catch-finally statement\n\t\t\t\t// TODO: where to put the special logic when exiting the try-finally statement?\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitForeachStatement(ForeachStatement foreachStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data; // assignment of the foreach loop variable is done when handling the condition node\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitUsingStatement(UsingStatement usingStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tif (usingStatement.ResourceAcquisition is Expression)\n\t\t\t\t\treturn usingStatement.ResourceAcquisition.AcceptVisitor(this, data);\n\t\t\t\telse\n\t\t\t\t\treturn data; // don't handle resource acquisition statements, as those are connected in the control flow graph\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitLockStatement(LockStatement lockStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn lockStatement.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\t\t\t\n\t\t\t// Yield statements use the default logic\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitUnsafeStatement(UnsafeStatement unsafeStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitFixedStatement(FixedStatement fixedStatement, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tDefiniteAssignmentStatus status = data;\n\t\t\t\tforeach (var variable in fixedStatement.Variables)\n\t\t\t\t\tstatus = variable.AcceptVisitor(this, status);\n\t\t\t\treturn status;\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t\t#region Expressions\n\t\t\tpublic override DefiniteAssignmentStatus VisitDirectionExpression(DirectionExpression directionExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tif (directionExpression.FieldDirection == FieldDirection.Out) {\n\t\t\t\t\treturn HandleAssignment(directionExpression.Expression, null, data);\n\t\t\t\t} else {\n\t\t\t\t\t// use default logic for 'ref'\n\t\t\t\t\treturn VisitChildren(directionExpression, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitAssignmentExpression(AssignmentExpression assignmentExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tif (assignmentExpression.Operator == AssignmentOperatorType.Assign) {\n\t\t\t\t\treturn HandleAssignment(assignmentExpression.Left, assignmentExpression.Right, data);\n\t\t\t\t} else {\n\t\t\t\t\t// use default logic for compound assignment operators\n\t\t\t\t\treturn VisitChildren(assignmentExpression, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tDefiniteAssignmentStatus HandleAssignment(Expression left, Expression right, DefiniteAssignmentStatus initialStatus)\n\t\t\t{\n\t\t\t\tIdentifierExpression ident = left as IdentifierExpression;\n\t\t\t\tif (ident != null && ident.Identifier == analysis.variableName) {\n\t\t\t\t\t// right==null is special case when handling 'out' expressions\n\t\t\t\t\tif (right != null)\n\t\t\t\t\t\tright.AcceptVisitor(this, initialStatus);\n\t\t\t\t\treturn DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t} else {\n\t\t\t\t\tDefiniteAssignmentStatus status = left.AcceptVisitor(this, initialStatus);\n\t\t\t\t\tif (right != null)\n\t\t\t\t\t\tstatus = right.AcceptVisitor(this, CleanSpecialValues(status));\n\t\t\t\t\treturn CleanSpecialValues(status);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\t// Don't use the default logic here because we don't want to clean up the special values.\n\t\t\t\treturn parenthesizedExpression.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitCheckedExpression(CheckedExpression checkedExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn checkedExpression.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitUncheckedExpression(UncheckedExpression uncheckedExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\treturn uncheckedExpression.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.ConditionalAnd) {\n\t\t\t\t\t// Handle constant left side of && expressions (not in the C# spec, but done by the MS compiler)\n\t\t\t\t\tbool? cond = analysis.EvaluateCondition(binaryOperatorExpression.Left);\n\t\t\t\t\tif (cond == true)\n\t\t\t\t\t\treturn binaryOperatorExpression.Right.AcceptVisitor(this, data); // right operand gets evaluated unconditionally\n\t\t\t\t\telse if (cond == false)\n\t\t\t\t\t\treturn data; // right operand never gets evaluated\n\t\t\t\t\t// C# 4.0 spec: §5.3.3.24 Definite Assignment for && expressions\n\t\t\t\t\tDefiniteAssignmentStatus afterLeft = binaryOperatorExpression.Left.AcceptVisitor(this, data);\n\t\t\t\t\tDefiniteAssignmentStatus beforeRight;\n\t\t\t\t\tif (afterLeft == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t\t\t\tbeforeRight = DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\telse if (afterLeft == DefiniteAssignmentStatus.AssignedAfterFalseExpression)\n\t\t\t\t\t\tbeforeRight = DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\t\t\telse\n\t\t\t\t\t\tbeforeRight = afterLeft;\n\t\t\t\t\tDefiniteAssignmentStatus afterRight = binaryOperatorExpression.Right.AcceptVisitor(this, beforeRight);\n\t\t\t\t\tif (afterLeft == DefiniteAssignmentStatus.DefinitelyAssigned)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\telse if (afterRight == DefiniteAssignmentStatus.DefinitelyAssigned && afterLeft == DefiniteAssignmentStatus.AssignedAfterFalseExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\telse if (afterRight == DefiniteAssignmentStatus.DefinitelyAssigned || afterRight == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.AssignedAfterTrueExpression;\n\t\t\t\t\telse if (afterLeft == DefiniteAssignmentStatus.AssignedAfterFalseExpression && afterRight == DefiniteAssignmentStatus.AssignedAfterFalseExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.AssignedAfterFalseExpression;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\t\t} else if (binaryOperatorExpression.Operator == BinaryOperatorType.ConditionalOr) {\n\t\t\t\t\t// C# 4.0 spec: §5.3.3.25 Definite Assignment for || expressions\n\t\t\t\t\tbool? cond = analysis.EvaluateCondition(binaryOperatorExpression.Left);\n\t\t\t\t\tif (cond == false)\n\t\t\t\t\t\treturn binaryOperatorExpression.Right.AcceptVisitor(this, data); // right operand gets evaluated unconditionally\n\t\t\t\t\telse if (cond == true)\n\t\t\t\t\t\treturn data; // right operand never gets evaluated\n\t\t\t\t\tDefiniteAssignmentStatus afterLeft = binaryOperatorExpression.Left.AcceptVisitor(this, data);\n\t\t\t\t\tDefiniteAssignmentStatus beforeRight;\n\t\t\t\t\tif (afterLeft == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t\t\t\tbeforeRight = DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\t\t\telse if (afterLeft == DefiniteAssignmentStatus.AssignedAfterFalseExpression)\n\t\t\t\t\t\tbeforeRight = DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\telse\n\t\t\t\t\t\tbeforeRight = afterLeft;\n\t\t\t\t\tDefiniteAssignmentStatus afterRight = binaryOperatorExpression.Right.AcceptVisitor(this, beforeRight);\n\t\t\t\t\tif (afterLeft == DefiniteAssignmentStatus.DefinitelyAssigned)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\telse if (afterRight == DefiniteAssignmentStatus.DefinitelyAssigned && afterLeft == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\telse if (afterRight == DefiniteAssignmentStatus.DefinitelyAssigned || afterRight == DefiniteAssignmentStatus.AssignedAfterFalseExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.AssignedAfterFalseExpression;\n\t\t\t\t\telse if (afterLeft == DefiniteAssignmentStatus.AssignedAfterTrueExpression && afterRight == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.AssignedAfterTrueExpression;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\t\t} else if (binaryOperatorExpression.Operator == BinaryOperatorType.NullCoalescing) {\n\t\t\t\t\t// C# 4.0 spec: §5.3.3.27 Definite assignment for ?? expressions\n\t\t\t\t\tResolveResult crr = analysis.EvaluateConstant(binaryOperatorExpression.Left);\n\t\t\t\t\tif (crr != null && crr.IsCompileTimeConstant && crr.ConstantValue == null)\n\t\t\t\t\t\treturn binaryOperatorExpression.Right.AcceptVisitor(this, data);\n\t\t\t\t\tDefiniteAssignmentStatus status = CleanSpecialValues(binaryOperatorExpression.Left.AcceptVisitor(this, data));\n\t\t\t\t\tbinaryOperatorExpression.Right.AcceptVisitor(this, status);\n\t\t\t\t\treturn status;\n\t\t\t\t} else {\n\t\t\t\t\t// use default logic for other operators\n\t\t\t\t\treturn VisitChildren(binaryOperatorExpression, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tif (unaryOperatorExpression.Operator == UnaryOperatorType.Not) {\n\t\t\t\t\t// C# 4.0 spec: §5.3.3.26 Definite assignment for ! expressions\n\t\t\t\t\tDefiniteAssignmentStatus status = unaryOperatorExpression.Expression.AcceptVisitor(this, data);\n\t\t\t\t\tif (status == DefiniteAssignmentStatus.AssignedAfterFalseExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.AssignedAfterTrueExpression;\n\t\t\t\t\telse if (status == DefiniteAssignmentStatus.AssignedAfterTrueExpression)\n\t\t\t\t\t\treturn DefiniteAssignmentStatus.AssignedAfterFalseExpression;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn status;\n\t\t\t\t} else {\n\t\t\t\t\t// use default logic for other operators\n\t\t\t\t\treturn VisitChildren(unaryOperatorExpression, data);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitConditionalExpression(ConditionalExpression conditionalExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\t// C# 4.0 spec: §5.3.3.28 Definite assignment for ?: expressions\n\t\t\t\tbool? cond = analysis.EvaluateCondition(conditionalExpression.Condition);\n\t\t\t\tif (cond == true) {\n\t\t\t\t\treturn conditionalExpression.TrueExpression.AcceptVisitor(this, data);\n\t\t\t\t} else if (cond == false) {\n\t\t\t\t\treturn conditionalExpression.FalseExpression.AcceptVisitor(this, data);\n\t\t\t\t} else {\n\t\t\t\t\tDefiniteAssignmentStatus afterCondition = conditionalExpression.Condition.AcceptVisitor(this, data);\n\t\t\t\t\t\n\t\t\t\t\tDefiniteAssignmentStatus beforeTrue, beforeFalse;\n\t\t\t\t\tif (afterCondition == DefiniteAssignmentStatus.AssignedAfterTrueExpression) {\n\t\t\t\t\t\tbeforeTrue = DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\t\tbeforeFalse = DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\t\t\t} else if (afterCondition == DefiniteAssignmentStatus.AssignedAfterFalseExpression) {\n\t\t\t\t\t\tbeforeTrue = DefiniteAssignmentStatus.PotentiallyAssigned;\n\t\t\t\t\t\tbeforeFalse = DefiniteAssignmentStatus.DefinitelyAssigned;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbeforeTrue = afterCondition;\n\t\t\t\t\t\tbeforeFalse = afterCondition;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tDefiniteAssignmentStatus afterTrue = conditionalExpression.TrueExpression.AcceptVisitor(this, beforeTrue);\n\t\t\t\t\tDefiniteAssignmentStatus afterFalse = conditionalExpression.FalseExpression.AcceptVisitor(this, beforeFalse);\n\t\t\t\t\treturn MergeStatus(CleanSpecialValues(afterTrue), CleanSpecialValues(afterFalse));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tBlockStatement body = anonymousMethodExpression.Body;\n\t\t\t\tanalysis.ChangeNodeStatus(analysis.beginNodeDict[body], data);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitLambdaExpression(LambdaExpression lambdaExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tStatement body = lambdaExpression.Body as Statement;\n\t\t\t\tif (body != null) {\n\t\t\t\t\tanalysis.ChangeNodeStatus(analysis.beginNodeDict[body], data);\n\t\t\t\t} else {\n\t\t\t\t\tlambdaExpression.Body.AcceptVisitor(this, data);\n\t\t\t\t}\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override DefiniteAssignmentStatus VisitIdentifierExpression(IdentifierExpression identifierExpression, DefiniteAssignmentStatus data)\n\t\t\t{\n\t\t\t\tif (data != DefiniteAssignmentStatus.DefinitelyAssigned\n\t\t\t\t    && identifierExpression.Identifier == analysis.variableName && identifierExpression.TypeArguments.Count == 0)\n\t\t\t\t{\n\t\t\t\t\tanalysis.unassignedVariableUses.Add(identifierExpression);\n\t\t\t\t}\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/NullValueAnalysis.cs",
    "content": "// \n// NullValueAnalysis.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing System.Text;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\tpublic class NullValueAnalysis\n\t{\n\t\tsealed class VariableStatusInfo : IEquatable<VariableStatusInfo>, IEnumerable<KeyValuePair<string, NullValueStatus>>\n\t\t{\n\t\t\treadonly Dictionary<string, NullValueStatus> VariableStatus = new Dictionary<string, NullValueStatus>();\n\n\t\t\tpublic NullValueStatus this[string name]\n\t\t\t{\n\t\t\t\tget {\n\t\t\t\t\tNullValueStatus status;\n\t\t\t\t\tif (VariableStatus.TryGetValue(name, out status)) {\n\t\t\t\t\t\treturn status;\n\t\t\t\t\t}\n\t\t\t\t\treturn NullValueStatus.UnreachableOrInexistent;\n\t\t\t\t}\n\t\t\t\tset {\n\t\t\t\t\tif (value == NullValueStatus.UnreachableOrInexistent) {\n\t\t\t\t\t\tVariableStatus.Remove(name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tVariableStatus [name] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Modifies the variable state to consider a new incoming path\n\t\t\t/// </summary>\n\t\t\t/// <returns><c>true</c>, if the state has changed, <c>false</c> otherwise.</returns>\n\t\t\t/// <param name=\"incomingState\">The variable state of the incoming path</param>\n\t\t\tpublic bool ReceiveIncoming(VariableStatusInfo incomingState)\n\t\t\t{\n\t\t\t\tbool changed = false;\n\t\t\t\tvar listOfVariables = VariableStatus.Keys.Concat(incomingState.VariableStatus.Keys).ToList();\n\t\t\t\tforeach (string variable in listOfVariables)\n\t\t\t\t{\n\t\t\t\t\tvar newValue = CombineStatus(this [variable], incomingState [variable]);\n\t\t\t\t\tif (this [variable] != newValue) {\n\t\t\t\t\t\tthis [variable] = newValue;\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn changed;\n\t\t\t}\n\n\t\t\tpublic static NullValueStatus CombineStatus(NullValueStatus oldValue, NullValueStatus incomingValue)\n\t\t\t{\n\t\t\t\tif (oldValue == NullValueStatus.Error || incomingValue == NullValueStatus.Error)\n\t\t\t\t\treturn NullValueStatus.Error;\n\n\t\t\t\tif (oldValue == NullValueStatus.UnreachableOrInexistent ||\n\t\t\t\t    oldValue == NullValueStatus.Unassigned)\n\t\t\t\t\treturn incomingValue;\n\n\t\t\t\tif (incomingValue == NullValueStatus.Unassigned) {\n\t\t\t\t\treturn NullValueStatus.Unassigned;\n\t\t\t\t}\n\n\t\t\t\tif (oldValue == NullValueStatus.CapturedUnknown || incomingValue == NullValueStatus.CapturedUnknown) {\n\t\t\t\t\t//TODO: Check if this is right\n\t\t\t\t\treturn NullValueStatus.CapturedUnknown;\n\t\t\t\t}\n\n\t\t\t\tif (oldValue == NullValueStatus.Unknown) {\n\t\t\t\t\treturn NullValueStatus.Unknown;\n\t\t\t\t}\n\n\t\t\t\tif (oldValue == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\treturn incomingValue == NullValueStatus.DefinitelyNull ?\n\t\t\t\t\t\tNullValueStatus.DefinitelyNull : NullValueStatus.PotentiallyNull;\n\t\t\t\t}\n\n\t\t\t\tif (oldValue == NullValueStatus.DefinitelyNotNull) {\n\t\t\t\t\tif (incomingValue == NullValueStatus.Unknown)\n\t\t\t\t\t\treturn NullValueStatus.Unknown;\n\t\t\t\t\tif (incomingValue == NullValueStatus.DefinitelyNotNull)\n\t\t\t\t\t\treturn NullValueStatus.DefinitelyNotNull;\n\t\t\t\t\treturn NullValueStatus.PotentiallyNull;\n\t\t\t\t}\n\n\t\t\t\tDebug.Assert(oldValue == NullValueStatus.PotentiallyNull);\n\t\t\t\treturn NullValueStatus.PotentiallyNull;\n\t\t\t}\n\n\t\t\tpublic bool HasVariable(string variable) {\n\t\t\t\treturn VariableStatus.ContainsKey(variable);\n\t\t\t}\n\n\t\t\tpublic VariableStatusInfo Clone() {\n\t\t\t\tvar clone = new VariableStatusInfo();\n\t\t\t\tforeach (var item in VariableStatus) {\n\t\t\t\t\tclone.VariableStatus.Add(item.Key, item.Value);\n\t\t\t\t}\n\t\t\t\treturn clone;\n\t\t\t}\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\treturn Equals(obj as VariableStatusInfo);\n\t\t\t}\n\n\t\t\tpublic bool Equals(VariableStatusInfo obj)\n\t\t\t{\n\t\t\t\tif (obj == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (VariableStatus.Count != obj.VariableStatus.Count)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn VariableStatus.All(item => item.Value == obj[item.Key]);\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\t//STUB\n\t\t\t\treturn VariableStatus.Count.GetHashCode();\n\t\t\t}\n\n\t\t\tpublic static bool operator ==(VariableStatusInfo obj1, VariableStatusInfo obj2) {\n\t\t\t\treturn object.ReferenceEquals(obj1, null) ?\n\t\t\t\t\tobject.ReferenceEquals(obj2, null) : obj1.Equals(obj2);\n\t\t\t}\n\n\t\t\tpublic static bool operator !=(VariableStatusInfo obj1, VariableStatusInfo obj2) {\n\t\t\t\treturn !(obj1 == obj2);\n\t\t\t}\n\n\t\t\tpublic IEnumerator<KeyValuePair<string, NullValueStatus>> GetEnumerator()\n\t\t\t{\n\t\t\t\treturn VariableStatus.GetEnumerator();\n\t\t\t}\n\n\t\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t\t{\n\t\t\t\treturn GetEnumerator();\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tvar builder = new StringBuilder(\"[\");\n\t\t\t\tforeach (var item in this) {\n\t\t\t\t\tbuilder.Append(item.Key);\n\t\t\t\t\tbuilder.Append(\"=\");\n\t\t\t\t\tbuilder.Append(item.Value);\n\t\t\t\t}\n\t\t\t\tbuilder.Append(\"]\");\n\t\t\t\treturn builder.ToString();\n\t\t\t}\n\t\t}\n\n\t\tsealed class NullAnalysisNode : ControlFlowNode\n\t\t{\n\t\t\tpublic readonly VariableStatusInfo VariableState = new VariableStatusInfo();\n\t\t\tpublic bool Visited { get; private set; }\n\n\t\t\tpublic NullAnalysisNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)\n\t\t\t\t: base(previousStatement, nextStatement, type)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic bool ReceiveIncoming(VariableStatusInfo incomingState)\n\t\t\t{\n\t\t\t\tbool changed = VariableState.ReceiveIncoming(incomingState);\n\t\t\t\tif (!Visited) {\n\t\t\t\t\tVisited = true;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn changed;\n\t\t\t}\n\t\t}\n\n\t\tsealed class NullAnalysisGraphBuilder : ControlFlowGraphBuilder\n\t\t{\n\t\t\tprotected override ControlFlowNode CreateNode(Statement previousStatement, Statement nextStatement, ControlFlowNodeType type)\n\t\t\t{\n\t\t\t\treturn new NullAnalysisNode(previousStatement, nextStatement, type);\n\t\t\t}\n\t\t}\n\n\t\tclass PendingNode : IEquatable<PendingNode> {\n\t\t\tinternal readonly NullAnalysisNode nodeToVisit;\n\t\t\tinternal readonly VariableStatusInfo statusInfo;\n\t\t\tinternal readonly ComparableList<NullAnalysisNode> pendingTryFinallyNodes;\n\t\t\tinternal readonly NullAnalysisNode nodeAfterFinally;\n\n\t\t\tinternal PendingNode(NullAnalysisNode nodeToVisit, VariableStatusInfo statusInfo)\n\t\t\t\t: this(nodeToVisit, statusInfo, new ComparableList<NullAnalysisNode>(), null)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic PendingNode(NullAnalysisNode nodeToVisit, VariableStatusInfo statusInfo, ComparableList<NullAnalysisNode> pendingFinallyNodes, NullAnalysisNode nodeAfterFinally)\n\t\t\t{\n\t\t\t\tthis.nodeToVisit = nodeToVisit;\n\t\t\t\tthis.statusInfo = statusInfo;\n\t\t\t\tthis.pendingTryFinallyNodes = pendingFinallyNodes;\n\t\t\t\tthis.nodeAfterFinally = nodeAfterFinally;\n\t\t\t}\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\treturn Equals(obj as PendingNode);\n\t\t\t}\n\n\t\t\tpublic bool Equals(PendingNode obj) {\n\t\t\t\tif (obj == null) return false;\n\n\t\t\t\tif (nodeToVisit != obj.nodeToVisit) return false;\n\t\t\t\tif (statusInfo != obj.statusInfo) return false;\n\t\t\t\tif (pendingTryFinallyNodes != obj.pendingTryFinallyNodes) return false;\n\t\t\t\tif (nodeAfterFinally != obj.nodeAfterFinally) return false;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn nodeToVisit.GetHashCode() ^\n\t\t\t\t\tstatusInfo.GetHashCode() ^\n\t\t\t\t\tpendingTryFinallyNodes.GetHashCode() ^\n\t\t\t\t\t(nodeAfterFinally == null ? 0 : nodeAfterFinally.GetHashCode());\n\t\t\t}\n\t\t}\n\n\t\treadonly BaseRefactoringContext context;\n\t\treadonly NullAnalysisVisitor visitor;\n\t\tList<NullAnalysisNode> allNodes;\n\t\treadonly HashSet<PendingNode> nodesToVisit = new HashSet<PendingNode>();\n\t\tDictionary<Statement, NullAnalysisNode> nodeBeforeStatementDict;\n\t\tDictionary<Statement, NullAnalysisNode> nodeAfterStatementDict;\n\t\treadonly Dictionary<Expression, NullValueStatus> expressionResult = new Dictionary<Expression, NullValueStatus>();\n\n\t\tpublic NullValueAnalysis(BaseRefactoringContext context, MethodDeclaration methodDeclaration, CancellationToken cancellationToken)\n\t\t\t: this(context, methodDeclaration.Body, methodDeclaration.Parameters, cancellationToken)\n\t\t{\n\t\t}\n\n\t\treadonly IEnumerable<ParameterDeclaration> parameters;\n\t\treadonly Statement rootStatement;\n\n\t\treadonly CancellationToken cancellationToken;\n\n\t\tpublic NullValueAnalysis(BaseRefactoringContext context, Statement rootStatement, IEnumerable<ParameterDeclaration> parameters, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (rootStatement == null)\n\t\t\t\tthrow new ArgumentNullException(\"rootStatement\");\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\n\t\t\tthis.context = context;\n\t\t\tthis.rootStatement = rootStatement;\n\t\t\tthis.parameters = parameters;\n\t\t\tthis.visitor = new NullAnalysisVisitor(this);\n\t\t\tthis.cancellationToken = cancellationToken;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Sets the local variable value.\n\t\t/// This method does not change anything if identifier does not refer to a local variable.\n\t\t/// Do not use this in variable declarations since resolving the variable won't work yet.\n\t\t/// </summary>\n\t\t/// <returns><c>true</c>, if local variable value was set, <c>false</c> otherwise.</returns>\n\t\t/// <param name=\"data\">The variable status data to change.</param>\n\t\t/// <param name=\"identifierNode\">The identifier to set.</param>\n\t\t/// <param name=\"identifierName\">The name of the identifier to set.</param>\n\t\t/// <param name=\"value\">The value to set the identifier.</param>\n\t\tbool SetLocalVariableValue (VariableStatusInfo data, AstNode identifierNode, string identifierName, NullValueStatus value) {\n\t\t\tvar resolveResult = context.Resolve(identifierNode);\n\t\t\tif (resolveResult is LocalResolveResult) {\n\t\t\t\tif (data [identifierName] != NullValueStatus.CapturedUnknown) {\n\t\t\t\t\tdata [identifierName] = value;\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tbool SetLocalVariableValue (VariableStatusInfo data, IdentifierExpression identifierExpression, NullValueStatus value) {\n\t\t\treturn SetLocalVariableValue(data, identifierExpression, identifierExpression.Identifier, value);\n\t\t}\n\n\t\tbool SetLocalVariableValue (VariableStatusInfo data, Identifier identifier, NullValueStatus value) {\n\t\t\treturn SetLocalVariableValue(data, identifier, identifier.Name, value);\n\t\t}\n\n\t\tvoid SetupNode(NullAnalysisNode node)\n\t\t{\n\t\t\tforeach (var parameter in parameters) {\n\t\t\t\tvar resolveResult = context.Resolve(parameter.Type);\n\t\t\t\tnode.VariableState[parameter.Name] = GetInitialVariableStatus(resolveResult);\n\t\t\t}\n\n\t\t\tnodesToVisit.Add(new PendingNode(node, node.VariableState));\n\t\t}\n\n\t\tstatic bool IsTypeNullable(IType type)\n\t\t{\n\t\t\treturn type.IsReferenceType == true || type.FullName == \"System.Nullable\";\n\t\t}\n\n\t\tpublic bool IsParametersAreUninitialized {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tNullValueStatus GetInitialVariableStatus(ResolveResult resolveResult)\n\t\t{\n\t\t\tvar typeResolveResult = resolveResult as TypeResolveResult;\n\t\t\tif (typeResolveResult == null) {\n\t\t\t\treturn NullValueStatus.Error;\n\t\t\t}\n\t\t\tvar type = typeResolveResult.Type;\n\t\t\tif (type.IsReferenceType == null) {\n\t\t\t\treturn NullValueStatus.Error;\n\t\t\t}\n\t\t\tif (!IsParametersAreUninitialized)\n\t\t\t\treturn NullValueStatus.DefinitelyNotNull;\n\t\t\treturn IsTypeNullable(type) ? NullValueStatus.PotentiallyNull : NullValueStatus.DefinitelyNotNull;\n\t\t}\n\n\t\tpublic void Analyze()\n\t\t{\n\t\t\tvar cfgBuilder = new NullAnalysisGraphBuilder();\n\t\t\tallNodes = cfgBuilder.BuildControlFlowGraph(rootStatement, cancellationToken).Cast<NullAnalysisNode>().ToList();\n\t\t\tnodeBeforeStatementDict = allNodes.Where(node => node.Type == ControlFlowNodeType.StartNode || node.Type == ControlFlowNodeType.BetweenStatements)\n\t\t\t\t.ToDictionary(node => node.NextStatement);\n\t\t\tnodeAfterStatementDict = allNodes.Where(node => node.Type == ControlFlowNodeType.BetweenStatements || node.Type == ControlFlowNodeType.EndNode)\n\t\t\t\t.ToDictionary(node => node.PreviousStatement);\n\n\t\t\tforeach (var node in allNodes) {\n\t\t\t\tif (node.Type == ControlFlowNodeType.StartNode && node.NextStatement == rootStatement) {\n\t\t\t\t\tDebug.Assert(!nodesToVisit.Any());\n\n\t\t\t\t\tSetupNode(node);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (nodesToVisit.Any()) {\n\t\t\t\tvar nodeToVisit = nodesToVisit.First();\n\t\t\t\tnodesToVisit.Remove(nodeToVisit);\n\n\t\t\t\tVisit(nodeToVisit);\n\t\t\t}\n\t\t}\n\n\t\tint visits = 0;\n\n\t\tpublic int NodeVisits\n\t\t{\n\t\t\tget {\n\t\t\t\treturn visits;\n\t\t\t}\n\t\t}\n\n\t\tvoid Visit(PendingNode nodeInfo)\n\t\t{\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\n\t\t\tvar node = nodeInfo.nodeToVisit;\n\t\t\tvar statusInfo = nodeInfo.statusInfo;\n\n\t\t\tvisits++;\n\t\t\tif (visits > 100) {\n\t\t\t\t//Visiting way too often, let's enter fast mode\n\t\t\t\t//Fast mode is slighly less accurate but visits each node less times\n\t\t\t\tnodesToVisit.RemoveWhere(candidate => candidate.nodeToVisit == nodeInfo.nodeToVisit &&\n\t\t\t\t                         candidate.pendingTryFinallyNodes.Equals(nodeInfo.pendingTryFinallyNodes) &&\n\t\t\t\t                         candidate.nodeAfterFinally == nodeInfo.nodeAfterFinally);\n\t\t\t\tstatusInfo = node.VariableState;\n\t\t\t}\n\n\t\t\tvar nextStatement = node.NextStatement;\n\t\t\tVariableStatusInfo outgoingStatusInfo = statusInfo;\n\t\t\tVisitorResult result = null;\n\n\t\t\tif (nextStatement != null && (!(nextStatement is DoWhileStatement) || node.Type == ControlFlowNodeType.LoopCondition)) {\n\t\t\t\tresult = nextStatement.AcceptVisitor(visitor, statusInfo);\n\t\t\t\tif (result == null) {\n\t\t\t\t\tConsole.WriteLine(\"Failure in {0}\", nextStatement);\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t}\n\n\t\t\t\toutgoingStatusInfo = result.Variables;\n\t\t\t}\n\n\t\t\tif ((result == null || !result.ThrowsException) && node.Outgoing.Any()) {\n\t\t\t\tvar tryFinallyStatement = nextStatement as TryCatchStatement;\n\n\t\t\t\tforeach (var outgoingEdge in node.Outgoing) {\n\t\t\t\t\tVariableStatusInfo edgeInfo;\n\t\t\t\t\tedgeInfo = outgoingStatusInfo.Clone();\n\n\t\t\t\t\tif (node.Type == ControlFlowNodeType.EndNode) {\n\t\t\t\t\t\tvar previousBlock = node.PreviousStatement as BlockStatement;\n\t\t\t\t\t\tif (previousBlock != null) {\n\t\t\t\t\t\t\t//We're leaving a block statement.\n\t\t\t\t\t\t\t//As such, we'll remove the variables that were declared *in* the loop\n\t\t\t\t\t\t\t//This helps GetVariableStatusAfter/BeforeStatement be more accurate\n\t\t\t\t\t\t\t//and prevents some redundant revisiting.\n\n\t\t\t\t\t\t\tforeach (var variableInitializer in previousBlock.Statements\n\t\t\t\t\t\t\t         .OfType<VariableDeclarationStatement>()\n\t\t\t\t\t\t\t         .SelectMany(declaration => declaration.Variables)) {\n\n\t\t\t\t\t\t\t\tedgeInfo [variableInitializer.Name] = NullValueStatus.UnreachableOrInexistent;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tryFinallyStatement != null) {\n\t\t\t\t\t\t//With the exception of try statements, this needs special handling:\n\t\t\t\t\t\t//we'll set all changed variables to Unknown or CapturedUnknown\n\t\t\t\t\t\tif (outgoingEdge.To.NextStatement == tryFinallyStatement.FinallyBlock) {\n\t\t\t\t\t\t\tforeach (var identifierExpression in tryFinallyStatement.TryBlock.Descendants.OfType<IdentifierExpression>()) {\n\t\t\t\t\t\t\t\t//TODO: Investigate CaptureUnknown\n\t\t\t\t\t\t\t\tSetLocalVariableValue(edgeInfo, identifierExpression, NullValueStatus.Unknown);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar clause = tryFinallyStatement.CatchClauses\n\t\t\t\t\t\t\t\t.FirstOrDefault(candidateClause => candidateClause.Body == outgoingEdge.To.NextStatement);\n\n\t\t\t\t\t\t\tif (clause != null) {\n\t\t\t\t\t\t\t\tSetLocalVariableValue(edgeInfo, clause.VariableNameToken, NullValueStatus.DefinitelyNotNull);\n\n\t\t\t\t\t\t\t\tforeach (var identifierExpression in tryFinallyStatement.TryBlock.Descendants.OfType<IdentifierExpression>()) {\n\t\t\t\t\t\t\t\t\t//TODO: Investigate CaptureUnknown\n\t\t\t\t\t\t\t\t\tSetLocalVariableValue(edgeInfo, identifierExpression, NullValueStatus.Unknown);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result != null) {\n\t\t\t\t\t\tswitch (outgoingEdge.Type) {\n\t\t\t\t\t\t\tcase ControlFlowEdgeType.ConditionTrue:\n\t\t\t\t\t\t\t\tif (result.KnownBoolResult == false) {\n\t\t\t\t\t\t\t\t\t//No need to explore this path -- expression is known to be false\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tedgeInfo = result.TruePathVariables;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase ControlFlowEdgeType.ConditionFalse:\n\t\t\t\t\t\t\t\tif (result.KnownBoolResult == true) {\n\t\t\t\t\t\t\t\t\t//No need to explore this path -- expression is known to be true\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tedgeInfo = result.FalsePathVariables;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (outgoingEdge.IsLeavingTryFinally) {\n\t\t\t\t\t\tvar nodeAfterFinally = (NullAnalysisNode)outgoingEdge.To;\n\t\t\t\t\t\tvar finallyNodes = outgoingEdge.TryFinallyStatements.Select(tryFinally => nodeBeforeStatementDict [tryFinally.FinallyBlock]).ToList();\n\t\t\t\t\t\tvar nextNode = finallyNodes.First();\n\t\t\t\t\t\tvar remainingFinallyNodes = new ComparableList<NullAnalysisNode>(finallyNodes.Skip(1));\n\t\t\t\t\t\t//We have to visit the node even if ReceiveIncoming returns false\n\t\t\t\t\t\t//since the finallyNodes/nodeAfterFinally might be different even if the values of variables are the same -- and they need to be visited either way!\n\t\t\t\t\t\t//TODO 1: Is there any point in visiting the finally statement here?\n\t\t\t\t\t\t//TODO 2: Do we need the ReceiveIncoming at all?\n\t\t\t\t\t\tnextNode.ReceiveIncoming(edgeInfo);\n\t\t\t\t\t\tnodesToVisit.Add(new PendingNode(nextNode, edgeInfo, remainingFinallyNodes, nodeAfterFinally));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar outgoingNode = (NullAnalysisNode)outgoingEdge.To;\n\t\t\t\t\t\tif (outgoingNode.ReceiveIncoming(edgeInfo)) {\n\t\t\t\t\t\t\tnodesToVisit.Add(new PendingNode(outgoingNode, edgeInfo));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//We found a return/throw/yield break or some other termination node\n\t\t\t\tvar finallyBlockStarts = nodeInfo.pendingTryFinallyNodes;\n\t\t\t\tvar nodeAfterFinally = nodeInfo.nodeAfterFinally;\n\n\t\t\t\tif (finallyBlockStarts.Any()) {\n\t\t\t\t\tvar nextNode = finallyBlockStarts.First();\n\t\t\t\t\tif (nextNode.ReceiveIncoming(outgoingStatusInfo))\n\t\t\t\t\t\tnodesToVisit.Add(new PendingNode(nextNode, outgoingStatusInfo, new ComparableList<NullAnalysisNode>(finallyBlockStarts.Skip(1)), nodeInfo.nodeAfterFinally));\n\t\t\t\t} else if (nodeAfterFinally != null && nodeAfterFinally.ReceiveIncoming(outgoingStatusInfo)) {\n\t\t\t\t\tnodesToVisit.Add(new PendingNode(nodeAfterFinally, outgoingStatusInfo));\n\t\t\t\t} else {\n\t\t\t\t\t//Maybe we finished a try/catch/finally statement the \"normal\" way (no direct jumps)\n\t\t\t\t\t//so let's check that case\n\t\t\t\t\tvar statement = node.PreviousStatement ?? node.NextStatement;\n\t\t\t\t\tDebug.Assert(statement != null);\n\t\t\t\t\tvar parent = statement.GetParent<Statement>();\n\t\t\t\t\tvar parentTryCatch = parent as TryCatchStatement;\n\t\t\t\t\tif (parentTryCatch != null) {\n\t\t\t\t\t\tvar nextNode = nodeAfterStatementDict [parentTryCatch];\n\t\t\t\t\t\tif (nextNode.ReceiveIncoming(outgoingStatusInfo)) {\n\t\t\t\t\t\t\tnodesToVisit.Add(new PendingNode(nextNode, outgoingStatusInfo));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic NullValueStatus GetExpressionResult(Expression expr)\n\t\t{\n\t\t\tif (expr == null)\n\t\t\t\tthrow new ArgumentNullException(\"expr\");\n\n\t\t\tNullValueStatus info;\n\t\t\tif (expressionResult.TryGetValue(expr, out info)) {\n\t\t\t\treturn info;\n\t\t\t}\n\n\t\t\treturn NullValueStatus.UnreachableOrInexistent;\n\t\t}\n\n\t\tpublic NullValueStatus GetVariableStatusBeforeStatement(Statement stmt, string variableName)\n\t\t{\n\t\t\tif (stmt == null)\n\t\t\t\tthrow new ArgumentNullException(\"stmt\");\n\t\t\tif (variableName == null)\n\t\t\t\tthrow new ArgumentNullException(\"variableName\");\n\n\t\t\tNullAnalysisNode node;\n\t\t\tif (nodeBeforeStatementDict.TryGetValue(stmt, out node)) {\n\t\t\t\treturn node.VariableState [variableName];\n\t\t\t}\n\n\t\t\treturn NullValueStatus.UnreachableOrInexistent;\n\t\t}\n\n\t\tpublic NullValueStatus GetVariableStatusAfterStatement(Statement stmt, string variableName)\n\t\t{\n\t\t\tif (stmt == null)\n\t\t\t\tthrow new ArgumentNullException(\"stmt\");\n\t\t\tif (variableName == null)\n\t\t\t\tthrow new ArgumentNullException(\"variableName\");\n\n\t\t\tNullAnalysisNode node;\n\t\t\tif (nodeAfterStatementDict.TryGetValue(stmt, out node)) {\n\t\t\t\treturn node.VariableState [variableName];\n\t\t\t}\n\n\t\t\treturn NullValueStatus.UnreachableOrInexistent;\n\t\t}\n\n\t\tclass ConditionalBranchInfo\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// True if the variable is null for the true path, false if it is false for the true path.\n\t\t\t/// </summary>\n\t\t\tpublic Dictionary<string, bool> TrueResultVariableNullStates = new Dictionary<string, bool>();\n\t\t\t/// <summary>\n\t\t\t/// True if the variable is null for the false path, false if it is false for the false path.\n\t\t\t/// </summary>\n\t\t\tpublic Dictionary<string, bool> FalseResultVariableNullStates = new Dictionary<string, bool>();\n\t\t}\n\n\t\tclass VisitorResult\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Indicates the return value of the expression.\n\t\t\t/// </summary>\n\t\t\t/// <remarks>\n\t\t\t/// Only applicable for expressions.\n\t\t\t/// </remarks>\n\t\t\tpublic NullValueStatus NullableReturnResult;\n\n\t\t\t/// <summary>\n\t\t\t/// Indicates the value of each item in an array or linq query.\n\t\t\t/// </summary>\n\t\t\tpublic NullValueStatus EnumeratedValueResult;\n\n\t\t\t/// <summary>\n\t\t\t/// Information that indicates the restrictions to add\n\t\t\t/// when branching.\n\t\t\t/// </summary>\n\t\t\t/// <remarks>\n\t\t\t/// Used in if/else statements, conditional expressions and\n\t\t\t/// while statements.\n\t\t\t/// </remarks>\n\t\t\tpublic ConditionalBranchInfo ConditionalBranchInfo;\n\n\t\t\t/// <summary>\n\t\t\t/// The state of the variables after the expression is executed.\n\t\t\t/// </summary>\n\t\t\tpublic VariableStatusInfo Variables;\n\n\t\t\t/// <summary>\n\t\t\t/// The expression is known to be invalid and trigger an error\n\t\t\t/// (e.g. a NullReferenceException)\n\t\t\t/// </summary>\n\t\t\tpublic bool ThrowsException;\n\n\t\t\t/// <summary>\n\t\t\t/// The known bool result of an expression.\n\t\t\t/// </summary>\n\t\t\tpublic bool? KnownBoolResult;\n\n\t\t\tpublic static VisitorResult ForEnumeratedValue(VariableStatusInfo variables, NullValueStatus itemValues)\n\t\t\t{\n\t\t\t\tvar result = new VisitorResult();\n\t\t\t\tresult.NullableReturnResult = NullValueStatus.DefinitelyNotNull;\n\t\t\t\tresult.EnumeratedValueResult = itemValues;\n\t\t\t\tresult.Variables = variables.Clone();\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic static VisitorResult ForValue(VariableStatusInfo variables, NullValueStatus returnValue)\n\t\t\t{\n\t\t\t\tvar result = new VisitorResult();\n\t\t\t\tresult.NullableReturnResult = returnValue;\n\t\t\t\tresult.Variables = variables.Clone();\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic static VisitorResult ForBoolValue(VariableStatusInfo variables, bool newValue)\n\t\t\t{\n\t\t\t\tvar result = new VisitorResult();\n\t\t\t\tresult.NullableReturnResult = NullValueStatus.DefinitelyNotNull; //Bool expressions are never null\n\t\t\t\tresult.KnownBoolResult = newValue;\n\t\t\t\tresult.Variables = variables.Clone();\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic static VisitorResult ForException(VariableStatusInfo variables) {\n\t\t\t\tvar result = new VisitorResult();\n\t\t\t\tresult.NullableReturnResult = NullValueStatus.UnreachableOrInexistent;\n\t\t\t\tresult.ThrowsException = true;\n\t\t\t\tresult.Variables = variables.Clone();\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic VisitorResult Negated {\n\t\t\t\tget {\n\t\t\t\t\tvar result = new VisitorResult();\n\t\t\t\t\tif (NullableReturnResult.IsDefiniteValue()) {\n\t\t\t\t\t\tresult.NullableReturnResult = NullableReturnResult == NullValueStatus.DefinitelyNull\n\t\t\t\t\t\t\t? NullValueStatus.DefinitelyNotNull : NullValueStatus.DefinitelyNull;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.NullableReturnResult = NullableReturnResult;\n\t\t\t\t\t}\n\t\t\t\t\tresult.Variables = Variables.Clone();\n\t\t\t\t\tresult.KnownBoolResult = !KnownBoolResult;\n\t\t\t\t\tif (ConditionalBranchInfo != null) {\n\t\t\t\t\t\tresult.ConditionalBranchInfo = new ConditionalBranchInfo();\n\t\t\t\t\t\tforeach (var item in ConditionalBranchInfo.TrueResultVariableNullStates) {\n\t\t\t\t\t\t\tresult.ConditionalBranchInfo.FalseResultVariableNullStates [item.Key] = item.Value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach (var item in ConditionalBranchInfo.FalseResultVariableNullStates) {\n\t\t\t\t\t\t\tresult.ConditionalBranchInfo.TrueResultVariableNullStates [item.Key] = item.Value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic VariableStatusInfo TruePathVariables {\n\t\t\t\tget {\n\t\t\t\t\tvar variables = Variables.Clone();\n\t\t\t\t\tif (ConditionalBranchInfo != null) {\n\t\t\t\t\t\tforeach (var item in ConditionalBranchInfo.TrueResultVariableNullStates) {\n\t\t\t\t\t\t\tvariables [item.Key] = item.Value ? NullValueStatus.DefinitelyNull : NullValueStatus.DefinitelyNotNull;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn variables;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic VariableStatusInfo FalsePathVariables {\n\t\t\t\tget {\n\t\t\t\t\tvar variables = Variables.Clone();\n\t\t\t\t\tif (ConditionalBranchInfo != null) {\n\t\t\t\t\t\tforeach (var item in ConditionalBranchInfo.FalseResultVariableNullStates) {\n\t\t\t\t\t\t\tvariables [item.Key] = item.Value ? NullValueStatus.DefinitelyNull : NullValueStatus.DefinitelyNotNull;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn variables;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic static VisitorResult AndOperation(VisitorResult tentativeLeftResult, VisitorResult tentativeRightResult)\n\t\t\t{\n\t\t\t\tvar result = new VisitorResult();\n\t\t\t\tresult.KnownBoolResult = tentativeLeftResult.KnownBoolResult & tentativeRightResult.KnownBoolResult;\n\n\t\t\t\tvar trueTruePath = tentativeRightResult.TruePathVariables;\n\t\t\t\tvar trueFalsePath = tentativeRightResult.FalsePathVariables;\n\t\t\t\tvar falsePath = tentativeLeftResult.FalsePathVariables;\n\n\t\t\t\tvar trueVariables = trueTruePath;\n\n\t\t\t\tvar falseVariables = trueFalsePath.Clone();\n\t\t\t\tfalseVariables.ReceiveIncoming(falsePath);\n\t\t\t\tresult.Variables = trueVariables.Clone();\n\t\t\t\tresult.Variables.ReceiveIncoming(falseVariables);\n\n\t\t\t\tresult.ConditionalBranchInfo = new ConditionalBranchInfo();\n\n\t\t\t\tforeach (var variable in trueVariables) {\n\t\t\t\t\tif (!variable.Value.IsDefiniteValue())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tstring variableName = variable.Key;\n\n\t\t\t\t\tif (variable.Value != result.Variables[variableName]) {\n\t\t\t\t\t\tbool isNull = variable.Value == NullValueStatus.DefinitelyNull;\n\t\t\t\t\t\tresult.ConditionalBranchInfo.TrueResultVariableNullStates.Add(variableName, isNull);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach (var variable in falseVariables) {\n\t\t\t\t\tif (!variable.Value.IsDefiniteValue())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tstring variableName = variable.Key;\n\n\t\t\t\t\tif (variable.Value != result.Variables [variableName]) {\n\t\t\t\t\t\tbool isNull = variable.Value == NullValueStatus.DefinitelyNull;\n\t\t\t\t\t\tresult.ConditionalBranchInfo.FalseResultVariableNullStates.Add(variableName, isNull);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic static VisitorResult OrOperation(VisitorResult tentativeLeftResult, VisitorResult tentativeRightResult)\n\t\t\t{\n\t\t\t\treturn VisitorResult.AndOperation(tentativeLeftResult.Negated, tentativeRightResult.Negated).Negated;\n\t\t\t}\n\t\t}\n\n\t\tclass NullAnalysisVisitor : DepthFirstAstVisitor<VariableStatusInfo, VisitorResult>\n\t\t{\n\t\t\tNullValueAnalysis analysis;\n\n\t\t\tpublic NullAnalysisVisitor(NullValueAnalysis analysis) {\n\t\t\t\tthis.analysis = analysis;\n\t\t\t}\n\n\t\t\tprotected override VisitorResult VisitChildren(AstNode node, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tDebug.Fail(\"Missing override for \" + node.GetType().Name);\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override VisitorResult VisitNullNode(AstNode nullNode, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t// can occur due to syntax errors\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override VisitorResult VisitEmptyStatement(EmptyStatement emptyStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitBlockStatement(BlockStatement blockStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//We'll visit the child statements later (we'll visit each one directly from the CFG)\n\t\t\t\t//As such this is mostly a dummy node.\n\t\t\t\treturn new VisitorResult { Variables = data };\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tforeach (var variable in variableDeclarationStatement.Variables) {\n\t\t\t\t\tvar result = variable.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn result;\n\t\t\t\t\tdata = result.Variables;\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitVariableInitializer(VariableInitializer variableInitializer, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tif (variableInitializer.Initializer.IsNull) {\n\t\t\t\t\tdata = data.Clone();\n\t\t\t\t\tdata[variableInitializer.Name] = NullValueStatus.Unassigned;\n\t\t\t\t} else {\n\t\t\t\t\tvar result = variableInitializer.Initializer.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn result;\n\t\t\t\t\tdata = result.Variables.Clone();\n\t\t\t\t\tdata[variableInitializer.Name] = result.NullableReturnResult;\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(data, data [variableInitializer.Name]);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitIfElseStatement(IfElseStatement ifElseStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//We'll visit the true/false statements later (directly from the CFG)\n\t\t\t\treturn ifElseStatement.Condition.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitWhileStatement(WhileStatement whileStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn whileStatement.Condition.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitDoWhileStatement(DoWhileStatement doWhileStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn doWhileStatement.Condition.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitForStatement(ForStatement forStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//The initializers, the embedded statement and the iterators aren't visited here\n\t\t\t\t//because they have their own CFG nodes.\n\t\t\t\tif (forStatement.Condition.IsNull)\n\t\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t\treturn forStatement.Condition.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitForeachStatement(ForeachStatement foreachStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar newVariable = foreachStatement.VariableNameToken;\n\t\t\t\tvar inExpressionResult = foreachStatement.InExpression.AcceptVisitor(this, data);\n\t\t\t\tif (inExpressionResult.ThrowsException)\n\t\t\t\t\treturn inExpressionResult;\n\n\t\t\t\tvar newData = inExpressionResult.Variables.Clone();\n\n\t\t\t\tvar resolveResult = analysis.context.Resolve(foreachStatement.VariableNameToken) as LocalResolveResult;\n\t\t\t\tif (resolveResult != null) {\n\t\t\t\t\t//C# 5.0 changed the meaning of foreach so that each iteration declares a new variable\n\t\t\t\t\t//as such, the variable is \"uncaptured\" only for C# >= 5.0\n\t\t\t\t\tif (analysis.context.Supports(new Version(5, 0)) || data[newVariable.Name] != NullValueStatus.CapturedUnknown) {\n\t\t\t\t\t\tnewData[newVariable.Name] = NullValueAnalysis.IsTypeNullable(resolveResult.Type) ? inExpressionResult.EnumeratedValueResult : NullValueStatus.DefinitelyNotNull;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(newData, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitUsingStatement(UsingStatement usingStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn usingStatement.ResourceAcquisition.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitFixedStatement(FixedStatement fixedStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tforeach (var variable in fixedStatement.Variables) {\n\t\t\t\t\tvar result = variable.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn result;\n\t\t\t\t\tdata = result.Variables;\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitSwitchStatement(SwitchStatement switchStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//We could do better than this, but it would require special handling outside the visitor\n\t\t\t\t//so for now, for simplicity, we'll just take the easy way\n\n\t\t\t\tvar tentativeResult = switchStatement.Expression.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeResult.ThrowsException) {\n\t\t\t\t\treturn tentativeResult;\n\t\t\t\t}\n\n\t\t\t\tforeach (var section in switchStatement.SwitchSections) {\n\t\t\t\t\t//No need to check for ThrowsException, since it will always be false (see VisitSwitchSection)\n\t\t\t\t\tsection.AcceptVisitor(this, tentativeResult.Variables);\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(tentativeResult.Variables, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitSwitchSection(SwitchSection switchSection, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitExpressionStatement(ExpressionStatement expressionStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn expressionStatement.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitReturnStatement(ReturnStatement returnStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tif (returnStatement.Expression.IsNull)\n\t\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t\treturn returnStatement.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitTryCatchStatement(TryCatchStatement tryCatchStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//The needs special treatment in the analyser itself\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitBreakStatement(BreakStatement breakStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitContinueStatement(ContinueStatement continueStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitGotoStatement(GotoStatement gotoStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitLabelStatement(LabelStatement labelStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitUnsafeStatement(UnsafeStatement unsafeStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitLockStatement(LockStatement lockStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar expressionResult = lockStatement.Expression.AcceptVisitor(this, data);\n\t\t\t\tif (expressionResult.ThrowsException)\n\t\t\t\t\treturn expressionResult;\n\n\t\t\t\tif (expressionResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\treturn VisitorResult.ForException(expressionResult.Variables);\n\t\t\t\t}\n\n\t\t\t\tvar identifier = CSharpUtil.GetInnerMostExpression(lockStatement.Expression) as IdentifierExpression;\n\t\t\t\tif (identifier != null) {\n\t\t\t\t\tvar identifierValue = expressionResult.Variables [identifier.Identifier];\n\t\t\t\t\tif (identifierValue != NullValueStatus.CapturedUnknown) {\n\t\t\t\t\t\tvar newVariables = expressionResult.Variables.Clone();\n\t\t\t\t\t\tanalysis.SetLocalVariableValue(newVariables, identifier, NullValueStatus.DefinitelyNotNull);\n\n\t\t\t\t\t\treturn VisitorResult.ForValue(newVariables, NullValueStatus.Unknown);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(expressionResult.Variables, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitThrowStatement(ThrowStatement throwStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tif (throwStatement.Expression.IsNull)\n\t\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.DefinitelyNotNull);\n\t\t\t\treturn throwStatement.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitYieldReturnStatement(YieldReturnStatement yieldReturnStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn yieldReturnStatement.Expression.AcceptVisitor(this, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitCheckedStatement(CheckedStatement checkedStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitUncheckedStatement(UncheckedStatement uncheckedStatement, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tvoid RegisterExpressionResult(Expression expression, NullValueStatus expressionResult)\n\t\t\t{\n\t\t\t\tNullValueStatus oldStatus;\n\t\t\t\tif (analysis.expressionResult.TryGetValue(expression, out oldStatus)) {\n\t\t\t\t\tanalysis.expressionResult[expression] = VariableStatusInfo.CombineStatus(analysis.expressionResult[expression], expressionResult);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tanalysis.expressionResult[expression] = expressionResult;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tVisitorResult HandleExpressionResult(Expression expression, VariableStatusInfo dataAfterExpression, NullValueStatus expressionResult) {\n\t\t\t\tRegisterExpressionResult(expression, expressionResult);\n\n\t\t\t\treturn VisitorResult.ForValue(dataAfterExpression, expressionResult);\n\t\t\t}\n\n\t\t\tVisitorResult HandleExpressionResult(Expression expression, VariableStatusInfo dataAfterExpression, bool expressionResult) {\n\t\t\t\tRegisterExpressionResult(expression, NullValueStatus.DefinitelyNotNull);\n\n\t\t\t\treturn VisitorResult.ForBoolValue(dataAfterExpression, expressionResult);\n\t\t\t}\n\n\t\t\tVisitorResult HandleExpressionResult(Expression expression, VisitorResult result) {\n\t\t\t\tRegisterExpressionResult(expression, result.NullableReturnResult);\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitAssignmentExpression(AssignmentExpression assignmentExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeResult = assignmentExpression.Left.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeResult.ThrowsException)\n\t\t\t\t\treturn HandleExpressionResult(assignmentExpression, tentativeResult);\n\t\t\t\ttentativeResult = assignmentExpression.Right.AcceptVisitor(this, tentativeResult.Variables);\n\t\t\t\tif (tentativeResult.ThrowsException)\n\t\t\t\t\treturn HandleExpressionResult(assignmentExpression, tentativeResult);\n\n\t\t\t\tvar leftIdentifier = assignmentExpression.Left as IdentifierExpression;\n\t\t\t\tif (leftIdentifier != null) {\n\t\t\t\t\tvar resolveResult = analysis.context.Resolve(leftIdentifier);\n\t\t\t\t\tif (resolveResult.IsError) {\n\t\t\t\t\t\treturn HandleExpressionResult(assignmentExpression, data, NullValueStatus.Error);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (resolveResult is LocalResolveResult) {\n\t\t\t\t\t\tvar result = new VisitorResult();\n\t\t\t\t\t\tresult.NullableReturnResult = tentativeResult.NullableReturnResult;\n\t\t\t\t\t\tresult.Variables = tentativeResult.Variables.Clone();\n\t\t\t\t\t\tvar oldValue = result.Variables [leftIdentifier.Identifier];\n\n\t\t\t\t\t\tif (assignmentExpression.Operator == AssignmentOperatorType.Assign ||\n\t\t\t\t\t\t    oldValue == NullValueStatus.Unassigned ||\n\t\t\t\t\t\t    oldValue == NullValueStatus.DefinitelyNotNull ||\n\t\t\t\t\t\t    tentativeResult.NullableReturnResult == NullValueStatus.Error ||\n\t\t\t\t\t\t    tentativeResult.NullableReturnResult == NullValueStatus.Unknown) {\n\t\t\t\t\t\t\tanalysis.SetLocalVariableValue(result.Variables, leftIdentifier, tentativeResult.NullableReturnResult);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (oldValue == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\t\t\t//Do nothing --it'll remain null\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tanalysis.SetLocalVariableValue(result.Variables, leftIdentifier, NullValueStatus.PotentiallyNull);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn HandleExpressionResult(assignmentExpression, result);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn HandleExpressionResult(assignmentExpression, tentativeResult);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitIdentifierExpression(IdentifierExpression identifierExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar resolveResult = analysis.context.Resolve(identifierExpression);\n\t\t\t\tif (resolveResult.IsError) {\n\t\t\t\t\treturn HandleExpressionResult(identifierExpression, data, NullValueStatus.Error);\n\t\t\t\t}\n\t\t\t\tvar local = resolveResult as LocalResolveResult;\n\t\t\t\tif (local != null) {\n\t\t\t\t\tvar value = data [local.Variable.Name];\n\t\t\t\t\tif (value == NullValueStatus.CapturedUnknown)\n\t\t\t\t\t\tvalue = NullValueStatus.Unknown;\n\t\t\t\t\treturn HandleExpressionResult(identifierExpression, data, value);\n\t\t\t\t}\n\t\t\t\tif (resolveResult.IsCompileTimeConstant) {\n\t\t\t\t\tobject value = resolveResult.ConstantValue;\n\t\t\t\t\tif (value == null) {\n\t\t\t\t\t\treturn HandleExpressionResult(identifierExpression, data, NullValueStatus.DefinitelyNull);\n\t\t\t\t\t}\n\t\t\t\t\tvar boolValue = value as bool?;\n\t\t\t\t\tif (boolValue != null) {\n\t\t\t\t\t\treturn VisitorResult.ForBoolValue(data, (bool)boolValue);\n\t\t\t\t\t}\n\t\t\t\t\treturn HandleExpressionResult(identifierExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t}\n\n\t\t\t\tvar memberResolveResult = resolveResult as MemberResolveResult;\n\n\t\t\t\tvar returnValue = GetFieldReturnValue(memberResolveResult, data);\n\n\t\t\t\treturn HandleExpressionResult(identifierExpression, data, returnValue);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar resolveResult = analysis.context.Resolve(defaultValueExpression);\n\t\t\t\tif (resolveResult.IsError) {\n\t\t\t\t\treturn HandleExpressionResult(defaultValueExpression, data, NullValueStatus.Unknown);\n\t\t\t\t}\n\n\t\t\t\tDebug.Assert(resolveResult.IsCompileTimeConstant);\n\n\t\t\t\tvar status = resolveResult.ConstantValue == null  && resolveResult.Type.IsReferenceType != false ? NullValueStatus.DefinitelyNull : NullValueStatus.DefinitelyNotNull;\n\t\t\t\treturn HandleExpressionResult(defaultValueExpression, data, status);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(nullReferenceExpression, data, NullValueStatus.DefinitelyNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(primitiveExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(parenthesizedExpression, parenthesizedExpression.Expression.AcceptVisitor(this, data));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitConditionalExpression(ConditionalExpression conditionalExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeBaseResult = conditionalExpression.Condition.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeBaseResult.ThrowsException)\n\t\t\t\t\treturn HandleExpressionResult(conditionalExpression, tentativeBaseResult);\n\n\t\t\t\tvar conditionResolveResult = analysis.context.Resolve(conditionalExpression.Condition);\n\n\t\t\t\tif (tentativeBaseResult.KnownBoolResult == true || true.Equals(conditionResolveResult.ConstantValue)) {\n\t\t\t\t\treturn HandleExpressionResult(conditionalExpression, conditionalExpression.TrueExpression.AcceptVisitor(this, tentativeBaseResult.TruePathVariables));\n\t\t\t\t}\n\t\t\t\tif (tentativeBaseResult.KnownBoolResult == false || false.Equals(conditionResolveResult.ConstantValue)) {\n\t\t\t\t\treturn HandleExpressionResult(conditionalExpression, conditionalExpression.FalseExpression.AcceptVisitor(this, tentativeBaseResult.FalsePathVariables));\n\t\t\t\t}\n\n\t\t\t\t//No known bool result\n\t\t\t\tvar trueCaseResult = conditionalExpression.TrueExpression.AcceptVisitor(this, tentativeBaseResult.TruePathVariables);\n\t\t\t\tif (trueCaseResult.ThrowsException) {\n\t\t\t\t\t//We know that the true case will never be completed, then the right case is the only possible route.\n\t\t\t\t\treturn HandleExpressionResult(conditionalExpression, conditionalExpression.FalseExpression.AcceptVisitor(this, tentativeBaseResult.FalsePathVariables));\n\t\t\t\t}\n\t\t\t\tvar falseCaseResult = conditionalExpression.FalseExpression.AcceptVisitor(this, tentativeBaseResult.FalsePathVariables);\n\t\t\t\tif (falseCaseResult.ThrowsException) {\n\t\t\t\t\treturn HandleExpressionResult(conditionalExpression, trueCaseResult.Variables, true);\n\t\t\t\t}\n\n\t\t\t\treturn HandleExpressionResult(conditionalExpression, VisitorResult.OrOperation(trueCaseResult, falseCaseResult));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//Let's not evaluate the sides just yet because of ??, && and ||\n\n\t\t\t\t//We'll register the results here (with HandleExpressionResult)\n\t\t\t\t//so each Visit*Expression won't have to do it itself\n\t\t\t\tswitch (binaryOperatorExpression.Operator) {\n\t\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\t\treturn HandleExpressionResult(binaryOperatorExpression, VisitConditionalAndExpression(binaryOperatorExpression, data));\n\t\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\t\treturn HandleExpressionResult(binaryOperatorExpression, VisitConditionalOrExpression(binaryOperatorExpression, data));\n\t\t\t\t\tcase BinaryOperatorType.NullCoalescing:\n\t\t\t\t\t\treturn HandleExpressionResult(binaryOperatorExpression, VisitNullCoalescing(binaryOperatorExpression, data));\n\t\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\t\t\treturn HandleExpressionResult(binaryOperatorExpression, VisitEquality(binaryOperatorExpression, data));\n\t\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\t\treturn HandleExpressionResult(binaryOperatorExpression, VisitEquality(binaryOperatorExpression, data).Negated);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn HandleExpressionResult(binaryOperatorExpression, VisitOtherBinaryExpression(binaryOperatorExpression, data));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tVisitorResult VisitOtherBinaryExpression(BinaryOperatorExpression binaryOperatorExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar leftTentativeResult = binaryOperatorExpression.Left.AcceptVisitor(this, data);\n\t\t\t\tif (leftTentativeResult.ThrowsException)\n\t\t\t\t\treturn leftTentativeResult;\n\t\t\t\tvar rightTentativeResult = binaryOperatorExpression.Right.AcceptVisitor(this, leftTentativeResult.Variables);\n\t\t\t\tif (rightTentativeResult.ThrowsException)\n\t\t\t\t\treturn rightTentativeResult;\n\n\t\t\t\t//TODO: Assuming operators are not overloaded by users\n\t\t\t\t// (or, if they are, that they retain similar behavior to the default ones)\n\n\t\t\t\tswitch (binaryOperatorExpression.Operator) {\n\t\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\t\t//Operations < and > with nulls always return false\n\t\t\t\t\t\t//Those same operations will other values may or may not return false\n\t\t\t\t\t\tif (leftTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull &&\n\t\t\t\t\t\t\trightTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\t\treturn VisitorResult.ForBoolValue(rightTentativeResult.Variables, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//We don't know what the value is, but we know that both true and false are != null.\n\t\t\t\t\t\treturn VisitorResult.ForValue(rightTentativeResult.Variables, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\t\tif (leftTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\t\tif (rightTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull)\n\t\t\t\t\t\t\t\treturn VisitorResult.ForBoolValue(rightTentativeResult.Variables, true);\n\t\t\t\t\t\t\tif (rightTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNotNull)\n\t\t\t\t\t\t\t\treturn VisitorResult.ForBoolValue(rightTentativeResult.Variables, false);\n\t\t\t\t\t\t} else if (leftTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNotNull) {\n\t\t\t\t\t\t\tif (rightTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull)\n\t\t\t\t\t\t\t\treturn VisitorResult.ForBoolValue(rightTentativeResult.Variables, false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn VisitorResult.ForValue(rightTentativeResult.Variables, NullValueStatus.Unknown);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//Anything else: null + anything == anything + null == null.\n\t\t\t\t\t\t//not null + not null = not null\n\t\t\t\t\t\tif (leftTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\t\treturn VisitorResult.ForValue(rightTentativeResult.Variables, NullValueStatus.DefinitelyNull);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (leftTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNotNull) {\n\t\t\t\t\t\t\tif (rightTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull)\n\t\t\t\t\t\t\t\treturn VisitorResult.ForValue(rightTentativeResult.Variables, NullValueStatus.DefinitelyNull);\n\t\t\t\t\t\t\tif (rightTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNotNull)\n\t\t\t\t\t\t\t\treturn VisitorResult.ForValue(rightTentativeResult.Variables, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn VisitorResult.ForValue(rightTentativeResult.Variables, NullValueStatus.Unknown);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tVisitorResult WithVariableValue(VisitorResult result, IdentifierExpression identifier, bool isNull)\n\t\t\t{\n\t\t\t\tvar localVariableResult = analysis.context.Resolve(identifier) as LocalResolveResult;\n\t\t\t\tif (localVariableResult != null) {\n\t\t\t\t\tresult.ConditionalBranchInfo.TrueResultVariableNullStates[identifier.Identifier] = isNull;\n\t\t\t\t\tif (isNull) {\n\t\t\t\t\t\tresult.ConditionalBranchInfo.FalseResultVariableNullStates[identifier.Identifier] = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tVisitorResult VisitEquality(BinaryOperatorExpression binaryOperatorExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//TODO: Should this check for user operators?\n\n\t\t\t\tvar tentativeLeftResult = binaryOperatorExpression.Left.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeLeftResult.ThrowsException)\n\t\t\t\t\treturn tentativeLeftResult;\n\t\t\t\tvar tentativeRightResult = binaryOperatorExpression.Right.AcceptVisitor(this, tentativeLeftResult.Variables);\n\t\t\t\tif (tentativeRightResult.ThrowsException)\n\t\t\t\t\treturn tentativeRightResult;\n\n\t\t\t\tif (tentativeLeftResult.KnownBoolResult != null && tentativeLeftResult.KnownBoolResult == tentativeRightResult.KnownBoolResult) {\n\t\t\t\t\treturn VisitorResult.ForBoolValue(tentativeRightResult.Variables, true);\n\t\t\t\t}\n\n\t\t\t\tif (tentativeLeftResult.KnownBoolResult != null && tentativeLeftResult.KnownBoolResult == !tentativeRightResult.KnownBoolResult) {\n\t\t\t\t\treturn VisitorResult.ForBoolValue(tentativeRightResult.Variables, false);\n\t\t\t\t}\n\n\t\t\t\tif (tentativeLeftResult.NullableReturnResult.IsDefiniteValue()) {\n\t\t\t\t\tif (tentativeRightResult.NullableReturnResult.IsDefiniteValue()) {\n\t\t\t\t\t\tif (tentativeLeftResult.NullableReturnResult == NullValueStatus.DefinitelyNull || tentativeRightResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\t\treturn VisitorResult.ForBoolValue(tentativeRightResult.Variables, tentativeLeftResult.NullableReturnResult == tentativeRightResult.NullableReturnResult);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar result = new VisitorResult();\n\t\t\t\tresult.Variables = tentativeRightResult.Variables;\n\t\t\t\tresult.NullableReturnResult = NullValueStatus.Unknown;\n\t\t\t\tresult.ConditionalBranchInfo = new ConditionalBranchInfo();\n\n\t\t\t\tif (tentativeRightResult.NullableReturnResult.IsDefiniteValue()) {\n\t\t\t\t\tvar identifier = CSharpUtil.GetInnerMostExpression(binaryOperatorExpression.Left) as IdentifierExpression;\n\n\t\t\t\t\tif (identifier != null) {\n\t\t\t\t\t\tbool isNull = (tentativeRightResult.NullableReturnResult == NullValueStatus.DefinitelyNull);\n\n\t\t\t\t\t\tWithVariableValue(result, identifier, isNull);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (tentativeLeftResult.NullableReturnResult.IsDefiniteValue()) {\n\t\t\t\t\tvar identifier = CSharpUtil.GetInnerMostExpression(binaryOperatorExpression.Right) as IdentifierExpression;\n\n\t\t\t\t\tif (identifier != null) {\n\t\t\t\t\t\tbool isNull = (tentativeLeftResult.NullableReturnResult == NullValueStatus.DefinitelyNull);\n\n\t\t\t\t\t\tWithVariableValue(result, identifier, isNull);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tVisitorResult VisitConditionalAndExpression(BinaryOperatorExpression binaryOperatorExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeLeftResult = binaryOperatorExpression.Left.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeLeftResult.KnownBoolResult == false || tentativeLeftResult.ThrowsException) {\n\t\t\t\t\treturn tentativeLeftResult;\n\t\t\t\t}\n\n\t\t\t\tvar truePath = tentativeLeftResult.TruePathVariables;\n\t\t\t\tvar tentativeRightResult = binaryOperatorExpression.Right.AcceptVisitor(this, truePath);\n\t\t\t\tif (tentativeRightResult.ThrowsException) {\n\t\t\t\t\t//If the true path throws an exception, then the only way for the expression to complete\n\t\t\t\t\t//successfully is if the left expression is false\n\t\t\t\t\treturn VisitorResult.ForBoolValue(tentativeLeftResult.FalsePathVariables, false);\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.AndOperation(tentativeLeftResult, tentativeRightResult);\n\t\t\t}\n\n\t\t\tVisitorResult VisitConditionalOrExpression(BinaryOperatorExpression binaryOperatorExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeLeftResult = binaryOperatorExpression.Left.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeLeftResult.KnownBoolResult == true || tentativeLeftResult.ThrowsException) {\n\t\t\t\t\treturn tentativeLeftResult;\n\t\t\t\t}\n\n\t\t\t\tvar falsePath = tentativeLeftResult.FalsePathVariables;\n\t\t\t\tvar tentativeRightResult = binaryOperatorExpression.Right.AcceptVisitor(this, falsePath);\n\t\t\t\tif (tentativeRightResult.ThrowsException) {\n\t\t\t\t\t//If the false path throws an exception, then the only way for the expression to complete\n\t\t\t\t\t//successfully is if the left expression is true\n\t\t\t\t\treturn VisitorResult.ForBoolValue(tentativeLeftResult.TruePathVariables, true);\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.OrOperation(tentativeLeftResult, tentativeRightResult);\n\t\t\t}\n\n\t\t\tVisitorResult VisitNullCoalescing(BinaryOperatorExpression binaryOperatorExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar leftTentativeResult = binaryOperatorExpression.Left.AcceptVisitor(this, data);\n\t\t\t\tif (leftTentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNotNull || leftTentativeResult.ThrowsException) {\n\t\t\t\t\treturn leftTentativeResult;\n\t\t\t\t}\n\n\t\t\t\t//If the right side is found, then the left side is known to be null\n\t\t\t\tvar newData = leftTentativeResult.Variables;\n\t\t\t\tvar leftIdentifier = CSharpUtil.GetInnerMostExpression(binaryOperatorExpression.Left) as IdentifierExpression;\n\t\t\t\tif (leftIdentifier != null) {\n\t\t\t\t\tnewData = newData.Clone();\n\t\t\t\t\tanalysis.SetLocalVariableValue(newData, leftIdentifier, NullValueStatus.DefinitelyNull);\n\t\t\t\t}\n\n\t\t\t\tvar rightTentativeResult = binaryOperatorExpression.Right.AcceptVisitor(this, newData);\n\t\t\t\tif (rightTentativeResult.ThrowsException) {\n\t\t\t\t\t//This means the left expression was not null all along (or else the expression will throw an exception)\n\n\t\t\t\t\tif (leftIdentifier != null) {\n\t\t\t\t\t\tnewData = newData.Clone();\n\t\t\t\t\t\tanalysis.SetLocalVariableValue(newData, leftIdentifier, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\t\treturn VisitorResult.ForValue(newData, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn VisitorResult.ForValue(leftTentativeResult.Variables, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t}\n\n\t\t\t\tvar mergedVariables = rightTentativeResult.Variables;\n\t\t\t\tvar nullValue = rightTentativeResult.NullableReturnResult;\n\n\t\t\t\tif (leftTentativeResult.NullableReturnResult != NullValueStatus.DefinitelyNull) {\n\t\t\t\t\tmergedVariables = mergedVariables.Clone();\n\t\t\t\t\tmergedVariables.ReceiveIncoming(leftTentativeResult.Variables);\n\t\t\t\t\tif (nullValue == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\tnullValue = NullValueStatus.PotentiallyNull;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(mergedVariables, nullValue);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//TODO: Again, what to do when overloaded operators are found?\n\n\t\t\t\tvar tentativeResult = unaryOperatorExpression.Expression.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeResult.ThrowsException)\n\t\t\t\t\treturn HandleExpressionResult(unaryOperatorExpression, tentativeResult);\n\n\t\t\t\tif (unaryOperatorExpression.Operator == UnaryOperatorType.Not) {\n\t\t\t\t\treturn HandleExpressionResult(unaryOperatorExpression, tentativeResult.Negated);\n\t\t\t\t}\n\t\t\t\treturn HandleExpressionResult(unaryOperatorExpression, tentativeResult);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitInvocationExpression(InvocationExpression invocationExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//TODO: Handle some common methods such as string.IsNullOrEmpty\n\n\t\t\t\tvar targetResult = invocationExpression.Target.AcceptVisitor(this, data);\n\t\t\t\tif (targetResult.ThrowsException)\n\t\t\t\t\treturn HandleExpressionResult(invocationExpression, targetResult);\n\n\t\t\t\tdata = targetResult.Variables;\n\n\t\t\t\tvar methodResolveResult = analysis.context.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\n\t\t\t\tList<VisitorResult> parameterResults = new List<VisitorResult>();\n\n\t\t\t\tforeach (var argumentToHandle in invocationExpression.Arguments.Select((argument, parameterIndex) => new { argument, parameterIndex })) {\n\t\t\t\t\tvar argument = argumentToHandle.argument;\n\t\t\t\t\tvar parameterIndex = argumentToHandle.parameterIndex;\n\n\t\t\t\t\tvar result = argument.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn HandleExpressionResult(invocationExpression, result);\n\t\t\t\t\tparameterResults.Add(result);\n\n\t\t\t\t\tvar namedArgument = argument as NamedArgumentExpression;\n\t\t\t\t\t\n\t\t\t\t\tvar directionExpression = (namedArgument == null ? argument : namedArgument.Expression) as DirectionExpression;\n\t\t\t\t\tif (directionExpression != null && methodResolveResult != null) {\n\t\t\t\t\t\tvar identifier = directionExpression.Expression as IdentifierExpression;\n\t\t\t\t\t\tif (identifier != null) {\n\t\t\t\t\t\t\t//out and ref parameters do *NOT* capture the variable (since they must stop changing it by the time they return)\n\t\t\t\t\t\t\tvar identifierResolveResult = analysis.context.Resolve(identifier) as LocalResolveResult;\n\t\t\t\t\t\t\tif (identifierResolveResult != null && IsTypeNullable(identifierResolveResult.Type)) {\n\t\t\t\t\t\t\t\tdata = data.Clone();\n\n\t\t\t\t\t\t\t\tFixParameter(argument, methodResolveResult.Member.Parameters, parameterIndex, identifier, data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tdata = result.Variables;\n\t\t\t\t}\n\n\t\t\t\tvar identifierExpression = CSharpUtil.GetInnerMostExpression(invocationExpression.Target) as IdentifierExpression;\n\t\t\t\tif (identifierExpression != null) {\n\t\t\t\t\tif (targetResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\treturn HandleExpressionResult(invocationExpression, VisitorResult.ForException(data));\n\t\t\t\t\t}\n\n\t\t\t\t\tvar descendentIdentifiers = invocationExpression.Arguments.SelectMany(argument => argument.DescendantsAndSelf).OfType<IdentifierExpression>();\n\t\t\t\t\tif (!descendentIdentifiers.Any(identifier => identifier.Identifier == identifierExpression.Identifier)) {\n\t\t\t\t\t\t//TODO: We can make this check better (see VisitIndexerExpression for more details)\n\t\t\t\t\t\tdata = data.Clone();\n\t\t\t\t\t\tanalysis.SetLocalVariableValue(data, identifierExpression, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn HandleExpressionResult(invocationExpression, GetMethodVisitorResult(methodResolveResult, data, parameterResults));\n\t\t\t}\n\n\t\t\tstatic VisitorResult GetMethodVisitorResult(CSharpInvocationResolveResult methodResolveResult, VariableStatusInfo data, List<VisitorResult> parameterResults)\n\t\t\t{\n\t\t\t\tif (methodResolveResult == null)\n\t\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\n\t\t\t\tvar method = methodResolveResult.Member as IMethod;\n\t\t\t\tif (method != null) {\n\t\t\t\t\tif (method.GetAttribute(new FullTypeName(AnnotationNames.AssertionMethodAttribute)) != null) {\n\t\t\t\t\t\tvar assertionParameters = method.Parameters.Select((parameter, index) => new { index, parameter })\n\t\t\t\t\t\t\t.Select(parameter => new { parameter.index, parameter.parameter, attributes = parameter.parameter.Attributes.Where(attribute => attribute.AttributeType.FullName == AnnotationNames.AssertionConditionAttribute).ToList() })\n\t\t\t\t\t\t\t.Where(parameter => parameter.attributes.Count() == 1)\n\t\t\t\t\t\t\t.Select(parameter => new { parameter.index, parameter.parameter, attribute = parameter.attributes[0] })\n\t\t\t\t\t\t\t.ToList();\n\n\t\t\t\t\t\t//Unclear what should be done if there are multiple assertion conditions\n\t\t\t\t\t\tif (assertionParameters.Count() == 1) {\n\t\t\t\t\t\t\tDebug.Assert(methodResolveResult.Arguments.Count == parameterResults.Count);\n\n\t\t\t\t\t\t\tvar assertionParameter = assertionParameters [0];\n\t\t\t\t\t\t\tVisitorResult assertionParameterResult = null;\n\n\t\t\t\t\t\t\tobject intendedResult = true;\n\t\t\t\t\t\t\tvar positionalArgument = assertionParameter.attribute.PositionalArguments.FirstOrDefault() as MemberResolveResult;\n\t\t\t\t\t\t\tif (positionalArgument != null && positionalArgument.Type.FullName == AnnotationNames.AssertionConditionTypeAttribute) {\n\t\t\t\t\t\t\t\tswitch (positionalArgument.Member.FullName) {\n\t\t\t\t\t\t\t\t\tcase AnnotationNames.AssertionConditionTypeIsTrue:\n\t\t\t\t\t\t\t\t\t\tintendedResult = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase AnnotationNames.AssertionConditionTypeIsFalse:\n\t\t\t\t\t\t\t\t\t\tintendedResult = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase AnnotationNames.AssertionConditionTypeIsNull:\n\t\t\t\t\t\t\t\t\t\tintendedResult = null;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase AnnotationNames.AssertionConditionTypeIsNotNull:\n\t\t\t\t\t\t\t\t\t\tintendedResult = \"<not-null>\";\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tint parameterIndex = assertionParameter.index;\n\t\t\t\t\t\t\tif (assertionParameter.index < methodResolveResult.Arguments.Count && !(methodResolveResult.Arguments [assertionParameter.index] is NamedArgumentResolveResult)) {\n\t\t\t\t\t\t\t\t//Use index\n\t\t\t\t\t\t\t\tassertionParameterResult = parameterResults [assertionParameter.index];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//Use named argument\n\t\t\t\t\t\t\t\tint? nameIndex = methodResolveResult.Arguments.Select((argument, index) => new { argument, index})\n\t\t\t\t\t\t\t\t\t.Where(argument => {\n\t\t\t\t\t\t\t\t\t\tvar namedArgument = argument.argument as NamedArgumentResolveResult;\n\t\t\t\t\t\t\t\t\t\treturn namedArgument != null && namedArgument.ParameterName == assertionParameter.parameter.Name;\n\t\t\t\t\t\t\t\t\t}).Select(argument => (int?)argument.index).FirstOrDefault();\n\n\t\t\t\t\t\t\t\tif (nameIndex != null) {\n\t\t\t\t\t\t\t\t\tparameterIndex = nameIndex.Value;\n\t\t\t\t\t\t\t\t\tassertionParameterResult = parameterResults [nameIndex.Value];\n\t\t\t\t\t\t\t\t} else if (assertionParameter.parameter.IsOptional) {\n\t\t\t\t\t\t\t\t\t//Try to use default value\n\n\t\t\t\t\t\t\t\t\tif (intendedResult is string) {\n\t\t\t\t\t\t\t\t\t\tif (assertionParameter.parameter.ConstantValue == null) {\n\t\t\t\t\t\t\t\t\t\t\treturn VisitorResult.ForException(data);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif (!object.Equals(assertionParameter.parameter.ConstantValue, intendedResult)) {\n\t\t\t\t\t\t\t\t\t\t\treturn VisitorResult.ForException(data);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//The parameter was not specified, yet it is not optional?\n\t\t\t\t\t\t\t\t\treturn VisitorResult.ForException(data);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//Now check assertion\n\t\t\t\t\t\t\tif (assertionParameterResult != null) {\n\t\t\t\t\t\t\t\tif (intendedResult is bool) {\n\t\t\t\t\t\t\t\t\tif (assertionParameterResult.KnownBoolResult == !(bool)intendedResult) {\n\t\t\t\t\t\t\t\t\t\treturn VisitorResult.ForException(data);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tdata = (bool)intendedResult ? assertionParameterResult.TruePathVariables : assertionParameterResult.FalsePathVariables;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbool shouldBeNull = intendedResult == null;\n\n\t\t\t\t\t\t\t\t\tif (assertionParameterResult.NullableReturnResult == (shouldBeNull ? NullValueStatus.DefinitelyNotNull : NullValueStatus.DefinitelyNull)) {\n\t\t\t\t\t\t\t\t\t\treturn VisitorResult.ForException(data);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tvar parameterResolveResult = methodResolveResult.Arguments [parameterIndex];\n\n\t\t\t\t\t\t\t\t\tLocalResolveResult localVariableResult = null;\n\n\t\t\t\t\t\t\t\t\tvar conversionResolveResult = parameterResolveResult as ConversionResolveResult;\n\t\t\t\t\t\t\t\t\tif (conversionResolveResult != null) {\n\t\t\t\t\t\t\t\t\t\tif (!IsTypeNullable(conversionResolveResult.Type)) {\n\t\t\t\t\t\t\t\t\t\t\tif (intendedResult == null) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn VisitorResult.ForException(data);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tlocalVariableResult = conversionResolveResult.Input as LocalResolveResult;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlocalVariableResult = parameterResolveResult as LocalResolveResult;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (localVariableResult != null && data[localVariableResult.Variable.Name] != NullValueStatus.CapturedUnknown) {\n\t\t\t\t\t\t\t\t\t\tdata = data.Clone();\n\t\t\t\t\t\t\t\t\t\tdata [localVariableResult.Variable.Name] = shouldBeNull ? NullValueStatus.DefinitelyNull : NullValueStatus.DefinitelyNotNull;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbool isNullable = IsTypeNullable(methodResolveResult.Type);\n\t\t\t\tif (!isNullable) {\n\t\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t}\n\n\t\t\t\tif (method != null)\n\t\t\t\t\treturn VisitorResult.ForValue(data, GetNullableStatus(method));\n\n\t\t\t\treturn VisitorResult.ForValue(data, GetNullableStatus(methodResolveResult.TargetResult.Type.GetDefinition()));\n\t\t\t}\n\n\t\t\tstatic NullValueStatus GetNullableStatus(IEntity entity)\n\t\t\t{\n\t\t\t\tif (entity.DeclaringType != null && entity.DeclaringType.Kind == TypeKind.Delegate) {\n\t\t\t\t\t//Handle Delegate.Invoke method\n\t\t\t\t\treturn GetNullableStatus(entity.DeclaringTypeDefinition);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn GetNullableStatus(fullTypeName => entity.GetAttribute(new FullTypeName(fullTypeName)));\n\t\t\t}\n\n\t\t\tstatic NullValueStatus GetNullableStatus(IParameter parameter)\n\t\t\t{\n\t\t\t\treturn GetNullableStatus(fullTypeName => parameter.Attributes.FirstOrDefault(attribute => attribute.AttributeType.FullName == fullTypeName));\n\t\t\t}\n\n\t\t\tstatic NullValueStatus GetNullableStatus(Func<string, IAttribute> attributeGetter)\n\t\t\t{\n\t\t\t\tif (attributeGetter(AnnotationNames.NotNullAttribute) != null) {\n\t\t\t\t\treturn NullValueStatus.DefinitelyNotNull;\n\t\t\t\t}\n\t\t\t\tif (attributeGetter(AnnotationNames.CanBeNullAttribute) != null) {\n\t\t\t\t\treturn NullValueStatus.PotentiallyNull;\n\t\t\t\t}\n\t\t\t\treturn NullValueStatus.Unknown;\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar targetResult = memberReferenceExpression.Target.AcceptVisitor(this, data);\n\t\t\t\tif (targetResult.ThrowsException)\n\t\t\t\t\treturn HandleExpressionResult(memberReferenceExpression, targetResult);\n\n\t\t\t\tvar variables = targetResult.Variables;\n\n\t\t\t\tvar memberResolveResult = analysis.context.Resolve(memberReferenceExpression) as MemberResolveResult;\n\n\t\t\t\tvar targetIdentifier = CSharpUtil.GetInnerMostExpression(memberReferenceExpression.Target) as IdentifierExpression;\n\t\t\t\tif (targetIdentifier != null) {\n\t\t\t\t\tif (memberResolveResult == null) {\n\t\t\t\t\t\tvar invocation = memberReferenceExpression.Parent as InvocationExpression;\n\t\t\t\t\t\tif (invocation != null) {\n\t\t\t\t\t\t\tmemberResolveResult = analysis.context.Resolve(invocation) as MemberResolveResult;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (memberResolveResult != null && memberResolveResult.Member.FullName != \"System.Nullable.HasValue\") {\n\t\t\t\t\t\tvar method = memberResolveResult.Member as IMethod;\n\t\t\t\t\t\tif (method == null || !method.IsExtensionMethod) {\n\t\t\t\t\t\t\tif (targetResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\t\t\treturn HandleExpressionResult(memberReferenceExpression, VisitorResult.ForException(variables));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (variables [targetIdentifier.Identifier] != NullValueStatus.CapturedUnknown) {\n\t\t\t\t\t\t\t\tvariables = variables.Clone();\n\t\t\t\t\t\t\t\tanalysis.SetLocalVariableValue(variables, targetIdentifier, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar returnValue = GetFieldReturnValue(memberResolveResult, data);\n\t\t\t\treturn HandleExpressionResult(memberReferenceExpression, variables, returnValue);\n\t\t\t}\n\n\t\t\tstatic NullValueStatus GetFieldReturnValue(MemberResolveResult memberResolveResult, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tbool isNullable = memberResolveResult == null || IsTypeNullable(memberResolveResult.Type);\n\t\t\t\tif (!isNullable) {\n\t\t\t\t\treturn NullValueStatus.DefinitelyNotNull;\n\t\t\t\t}\n\n\t\t\t\tif (memberResolveResult != null) {\n\t\t\t\t\treturn GetNullableStatus(memberResolveResult.Member);\n\t\t\t\t}\n\n\t\t\t\treturn NullValueStatus.Unknown;\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(typeReferenceExpression, data, NullValueStatus.Unknown);\n\n\t\t\t}\n\n\t\t\tvoid FixParameter(Expression argument, IList<IParameter> parameters, int parameterIndex, IdentifierExpression identifier, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tNullValueStatus newValue = NullValueStatus.Unknown;\n\t\t\t\tif (argument is NamedArgumentExpression) {\n\t\t\t\t\tvar namedResolveResult = analysis.context.Resolve(argument) as NamedArgumentResolveResult;\n\t\t\t\t\tif (namedResolveResult != null) {\n\t\t\t\t\t\tnewValue = GetNullableStatus(namedResolveResult.Parameter);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar parameter = parameters[parameterIndex];\n\t\t\t\t\tnewValue = GetNullableStatus(parameter);\n\t\t\t\t}\n\t\t\t\tanalysis.SetLocalVariableValue(data, identifier, newValue);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tforeach (var argumentToHandle in objectCreateExpression.Arguments.Select((argument, parameterIndex) => new { argument, parameterIndex })) {\n\t\t\t\t\tvar argument = argumentToHandle.argument;\n\t\t\t\t\tvar parameterIndex = argumentToHandle.parameterIndex;\n\n\t\t\t\t\tvar namedArgument = argument as NamedArgumentExpression;\n\n\t\t\t\t\tvar directionExpression = (namedArgument == null ? argument : namedArgument.Expression) as DirectionExpression;\n\t\t\t\t\tif (directionExpression != null) {\n\t\t\t\t\t\tvar identifier = directionExpression.Expression as IdentifierExpression;\n\t\t\t\t\t\tif (identifier != null && data [identifier.Identifier] != NullValueStatus.CapturedUnknown) {\n\t\t\t\t\t\t\t//out and ref parameters do *NOT* capture the variable (since they must stop changing it by the time they return)\n\t\t\t\t\t\t\tdata = data.Clone();\n\n\t\t\t\t\t\t\tvar constructorResolveResult = analysis.context.Resolve(objectCreateExpression) as CSharpInvocationResolveResult;\n\t\t\t\t\t\t\tif (constructorResolveResult != null)\n\t\t\t\t\t\t\t\tFixParameter(argument, constructorResolveResult.Member.Parameters, parameterIndex, identifier, data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar argumentResult = argument.AcceptVisitor(this, data);\n\t\t\t\t\tif (argumentResult.ThrowsException)\n\t\t\t\t\t\treturn argumentResult;\n\n\t\t\t\t\tdata = argumentResult.Variables;\n\t\t\t\t}\n\n\t\t\t\t//Constructors never return null\n\t\t\t\treturn HandleExpressionResult(objectCreateExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tforeach (var argument in arrayCreateExpression.Arguments) {\n\t\t\t\t\tvar result = argument.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn result;\n\t\t\t\t\tdata = result.Variables.Clone();\n\t\t\t\t}\n\n\t\t\t\tif (arrayCreateExpression.Initializer.IsNull) {\n\t\t\t\t\treturn HandleExpressionResult(arrayCreateExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t}\n\n\t\t\t\treturn HandleExpressionResult(arrayCreateExpression, arrayCreateExpression.Initializer.AcceptVisitor(this, data));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tif (arrayInitializerExpression.IsSingleElement) {\n\t\t\t\t\treturn HandleExpressionResult(arrayInitializerExpression, arrayInitializerExpression.Elements.Single().AcceptVisitor(this, data));\n\t\t\t\t}\n\t\t\t\tif (!arrayInitializerExpression.Elements.Any()) {\n\t\t\t\t\t//Empty array\n\t\t\t\t\treturn HandleExpressionResult(arrayInitializerExpression, VisitorResult.ForValue(data, NullValueStatus.Unknown));\n\t\t\t\t}\n\n\t\t\t\tNullValueStatus enumeratedValue = NullValueStatus.UnreachableOrInexistent;\n\t\t\t\tforeach (var element in arrayInitializerExpression.Elements) {\n\t\t\t\t\tvar result = element.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn result;\n\t\t\t\t\tdata = result.Variables.Clone();\n\t\t\t\t\tenumeratedValue = VariableStatusInfo.CombineStatus(enumeratedValue, result.NullableReturnResult);\n\n\t\t\t\t}\n\t\t\t\treturn HandleExpressionResult(arrayInitializerExpression, VisitorResult.ForEnumeratedValue(data, enumeratedValue));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tforeach (var initializer in anonymousTypeCreateExpression.Initializers) {\n\t\t\t\t\tvar result = initializer.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn result;\n\t\t\t\t\tdata = result.Variables;\n\t\t\t\t}\n\n\t\t\t\treturn HandleExpressionResult(anonymousTypeCreateExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitLambdaExpression(LambdaExpression lambdaExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar newData = data.Clone();\n\n\t\t\t\tvar identifiers = lambdaExpression.Descendants.OfType<IdentifierExpression>();\n\t\t\t\tforeach (var identifier in identifiers) {\n\t\t\t\t\t//Check if it is in a \"change-null-state\" context\n\t\t\t\t\t//For instance, x++ does not change the null state\n\t\t\t\t\t//but `x = y` does.\n\t\t\t\t\tif (identifier.Parent is AssignmentExpression && identifier.Role == AssignmentExpression.LeftRole) {\n\t\t\t\t\t\tvar parent = (AssignmentExpression)identifier.Parent;\n\t\t\t\t\t\tif (parent.Operator != AssignmentOperatorType.Assign) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//No other context matters\n\t\t\t\t\t\t//Captured variables are never passed by reference (out/ref)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//At this point, we know there's a good chance the variable has been changed\n\t\t\t\t\tvar identifierResolveResult = analysis.context.Resolve(identifier) as LocalResolveResult;\n\t\t\t\t\tif (identifierResolveResult != null && IsTypeNullable(identifierResolveResult.Type)) {\n\t\t\t\t\t\tanalysis.SetLocalVariableValue(newData, identifier, NullValueStatus.CapturedUnknown);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//The lambda itself is known not to be null\n\t\t\t\treturn HandleExpressionResult(lambdaExpression, newData, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar newData = data.Clone();\n\n\t\t\t\tvar identifiers = anonymousMethodExpression.Descendants.OfType<IdentifierExpression>();\n\t\t\t\tforeach (var identifier in identifiers) {\n\t\t\t\t\t//Check if it is in a \"change-null-state\" context\n\t\t\t\t\t//For instance, x++ does not change the null state\n\t\t\t\t\t//but `x = y` does.\n\t\t\t\t\tif (identifier.Parent is AssignmentExpression && identifier.Role == AssignmentExpression.LeftRole) {\n\t\t\t\t\t\tvar parent = (AssignmentExpression)identifier.Parent;\n\t\t\t\t\t\tif (parent.Operator != AssignmentOperatorType.Assign) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//No other context matters\n\t\t\t\t\t\t//Captured variables are never passed by reference (out/ref)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//At this point, we know there's a good chance the variable has been changed\n\t\t\t\t\tvar identifierResolveResult = analysis.context.Resolve(identifier) as LocalResolveResult;\n\t\t\t\t\tif (identifierResolveResult != null && IsTypeNullable(identifierResolveResult.Type)) {\n\t\t\t\t\t\tanalysis.SetLocalVariableValue(newData, identifier, NullValueStatus.CapturedUnknown);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//The anonymous method itself is known not to be null\n\t\t\t\treturn HandleExpressionResult(anonymousMethodExpression, newData, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\n\t\t\tpublic override VisitorResult VisitNamedExpression(NamedExpression namedExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(namedExpression, namedExpression.Expression.AcceptVisitor(this, data));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitAsExpression(AsExpression asExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeResult = asExpression.Expression.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeResult.ThrowsException)\n\t\t\t\t\treturn tentativeResult;\n\n\t\t\t\tNullValueStatus result;\n\t\t\t\tif (tentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\tresult = NullValueStatus.DefinitelyNull;\n\t\t\t\t} else {\n\t\t\t\t\tvar asResolveResult = analysis.context.Resolve(asExpression) as CastResolveResult;\n\t\t\t\t\tif (asResolveResult == null ||\n\t\t\t\t\t    asResolveResult.IsError ||\n\t\t\t\t\t    asResolveResult.Input.Type.Kind == TypeKind.Unknown ||\n\t\t\t\t\t    asResolveResult.Type.Kind == TypeKind.Unknown) {\n\n\t\t\t\t\t\tresult = NullValueStatus.Unknown;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar conversion = new CSharpConversions(analysis.context.Compilation);\n\t\t\t\t\t\tvar foundConversion = conversion.ExplicitConversion(asResolveResult.Input.Type, asResolveResult.Type);\n\n\t\t\t\t\t\tif (foundConversion == Conversion.None) {\n\t\t\t\t\t\t\tresult = NullValueStatus.DefinitelyNull;\n\t\t\t\t\t\t} else if (foundConversion == Conversion.IdentityConversion) {\n\t\t\t\t\t\t\tresult = tentativeResult.NullableReturnResult;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = NullValueStatus.PotentiallyNull;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn HandleExpressionResult(asExpression, tentativeResult.Variables, result);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitCastExpression(CastExpression castExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeResult = castExpression.Expression.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeResult.ThrowsException)\n\t\t\t\t\treturn tentativeResult;\n\n\t\t\t\tNullValueStatus result;\n\t\t\t\tif (tentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\tresult = NullValueStatus.DefinitelyNull;\n\t\t\t\t} else {\n\t\t\t\t\tresult = NullValueStatus.Unknown;\n\t\t\t\t}\n\n\t\t\t\tVariableStatusInfo variables = tentativeResult.Variables;\n\n\t\t\t\tvar resolveResult = analysis.context.Resolve(castExpression) as CastResolveResult;\n\t\t\t\tif (resolveResult != null && !IsTypeNullable(resolveResult.Type)) {\n\t\t\t\t\tif (result == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\t\treturn HandleExpressionResult(castExpression, VisitorResult.ForException(tentativeResult.Variables));\n\t\t\t\t\t}\n\n\t\t\t\t\tvar identifierExpression = CSharpUtil.GetInnerMostExpression(castExpression.Expression) as IdentifierExpression;\n\t\t\t\t\tif (identifierExpression != null) {\n\t\t\t\t\t\tvar currentValue = variables [identifierExpression.Identifier];\n\t\t\t\t\t\tif (currentValue != NullValueStatus.CapturedUnknown &&\n\t\t\t\t\t\t    currentValue != NullValueStatus.UnreachableOrInexistent &&\n\t\t\t\t\t\t    currentValue != NullValueStatus.DefinitelyNotNull) {\n\t\t\t\t\t\t\t//DefinitelyNotNull is included in this list because if that's the status\n\t\t\t\t\t\t\t// then we don't need to change anything\n\n\t\t\t\t\t\t\tvariables = variables.Clone();\n\t\t\t\t\t\t\tvariables [identifierExpression.Identifier] = NullValueStatus.DefinitelyNotNull;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresult = NullValueStatus.DefinitelyNotNull;\n\t\t\t\t}\n\n\t\t\t\treturn HandleExpressionResult(castExpression, variables, result);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitIsExpression(IsExpression isExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeResult = isExpression.Expression.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeResult.ThrowsException)\n\t\t\t\t\treturn tentativeResult;\n\n\t\t\t\t//TODO: Consider, for instance: new X() is X. The result is known to be true, so we can use KnownBoolValue\n\t\t\t\treturn HandleExpressionResult(isExpression, tentativeResult.Variables, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitDirectionExpression(DirectionExpression directionExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(directionExpression, directionExpression.Expression.AcceptVisitor(this, data));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitCheckedExpression(CheckedExpression checkedExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(checkedExpression, checkedExpression.Expression.AcceptVisitor(this, data));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitUncheckedExpression(UncheckedExpression uncheckedExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(uncheckedExpression, uncheckedExpression.Expression.AcceptVisitor(this, data));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(thisReferenceExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitIndexerExpression(IndexerExpression indexerExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar tentativeResult = indexerExpression.Target.AcceptVisitor(this, data);\n\t\t\t\tif (tentativeResult.ThrowsException)\n\t\t\t\t\treturn tentativeResult;\n\n\t\t\t\tdata = tentativeResult.Variables;\n\n\t\t\t\tforeach (var argument in indexerExpression.Arguments) {\n\t\t\t\t\tvar result = argument.AcceptVisitor(this, data);\n\t\t\t\t\tif (result.ThrowsException)\n\t\t\t\t\t\treturn result;\n\t\t\t\t\tdata = result.Variables.Clone();\n\t\t\t\t}\n\n\t\t\t\tIdentifierExpression targetAsIdentifier = CSharpUtil.GetInnerMostExpression(indexerExpression.Target) as IdentifierExpression;\n\t\t\t\tif (targetAsIdentifier != null) {\n\t\t\t\t\tif (tentativeResult.NullableReturnResult == NullValueStatus.DefinitelyNull)\n\t\t\t\t\t\treturn HandleExpressionResult(indexerExpression, VisitorResult.ForException(data));\n\n\t\t\t\t\t//If this doesn't cause an exception, then the target is not null\n\t\t\t\t\t//But we won't set it if it has been changed\n\t\t\t\t\tvar descendentIdentifiers = indexerExpression.Arguments\n\t\t\t\t\t\t.SelectMany(argument => argument.DescendantsAndSelf).OfType<IdentifierExpression>();\n\t\t\t\t\tif (!descendentIdentifiers.Any(identifier => identifier.Identifier == targetAsIdentifier.Identifier)) {\n\t\t\t\t\t\t//TODO: this check might be improved to include more legitimate cases\n\t\t\t\t\t\t//A good check will necessarily have to consider captured variables\n\t\t\t\t\t\tdata = data.Clone();\n\t\t\t\t\t\tanalysis.SetLocalVariableValue(data, targetAsIdentifier, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar indexerResolveResult = analysis.context.Resolve(indexerExpression) as CSharpInvocationResolveResult;\n\t\t\t\tbool isNullable = indexerResolveResult == null || IsTypeNullable(indexerResolveResult.Type);\n\t\t\t\t\n\t\t\t\tvar returnValue = isNullable ? NullValueStatus.Unknown : NullValueStatus.DefinitelyNotNull;\n\t\t\t\treturn HandleExpressionResult(indexerExpression, data, returnValue);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(baseReferenceExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitTypeOfExpression(TypeOfExpression typeOfExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(typeOfExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitSizeOfExpression(SizeOfExpression sizeOfExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(sizeOfExpression, data, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar targetResult = pointerReferenceExpression.Target.AcceptVisitor(this, data);\n\t\t\t\tif (targetResult.ThrowsException)\n\t\t\t\t\treturn targetResult;\n\t\t\t\treturn HandleExpressionResult(pointerReferenceExpression, targetResult.Variables, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitStackAllocExpression(StackAllocExpression stackAllocExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar countResult = stackAllocExpression.CountExpression.AcceptVisitor(this, data);\n\t\t\t\tif (countResult.ThrowsException)\n\t\t\t\t\treturn countResult;\n\t\t\t\treturn HandleExpressionResult(stackAllocExpression, countResult.Variables, NullValueStatus.DefinitelyNotNull);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn HandleExpressionResult(namedArgumentExpression, namedArgumentExpression.Expression.AcceptVisitor(this, data));\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryExpression(QueryExpression queryExpression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tVariableStatusInfo outgoingData = data.Clone();\n\t\t\t\tNullValueStatus? outgoingEnumeratedValue = null;\n\t\t\t\tvar clauses = queryExpression.Clauses.ToList();\n\n\t\t\t\tvar backtracingClauses = (from item in clauses.Select((clause, i) => new { clause, i })\n\t\t\t\t                                where item.clause is QueryFromClause || item.clause is QueryJoinClause || item.clause is QueryContinuationClause\n\t\t\t\t                                select item.i).ToList();\n\n\t\t\t\tvar beforeClauseVariableStates = Enumerable.Range(0, clauses.Count).ToDictionary(clauseIndex => clauseIndex,\n\t\t\t\t                                                                                 clauseIndex => new VariableStatusInfo());\n\t\t\t\tvar afterClauseVariableStates = Enumerable.Range(0, clauses.Count).ToDictionary(clauseIndex => clauseIndex,\n\t\t\t\t                                                                                clauseIndex => new VariableStatusInfo());\n\n\t\t\t\tVisitorResult lastValidResult = null;\n\t\t\t\tint currentClauseIndex = 0;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tVisitorResult result = null;\n\t\t\t\t\tQueryClause clause = null;\n\t\t\t\t\tbool backtrack = false;\n\n\t\t\t\t\tif (currentClauseIndex >= clauses.Count) {\n\t\t\t\t\t\tbacktrack = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclause = clauses [currentClauseIndex];\n\t\t\t\t\t\tbeforeClauseVariableStates [currentClauseIndex].ReceiveIncoming(data);\n\t\t\t\t\t\tresult = clause.AcceptVisitor(this, data);\n\t\t\t\t\t\tdata = result.Variables;\n\t\t\t\t\t\tlastValidResult = result;\n\t\t\t\t\t\tif (result.KnownBoolResult == false) {\n\t\t\t\t\t\t\tbacktrack = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (result.ThrowsException) {\n\t\t\t\t\t\t\t//Don't backtrack. Exceptions completely stop the query.\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tafterClauseVariableStates [currentClauseIndex].ReceiveIncoming(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (backtrack) {\n\t\t\t\t\t\tint? newIndex;\n\t\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\t\tnewIndex = backtracingClauses.LastOrDefault(index => index < currentClauseIndex);\n\t\t\t\t\t\t\tif (newIndex == null) {\n\t\t\t\t\t\t\t\t//We've reached the end\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcurrentClauseIndex = (int)newIndex + 1;\n\n\t\t\t\t\t\t\tif (!beforeClauseVariableStates[currentClauseIndex].ReceiveIncoming(lastValidResult.Variables)) {\n\t\t\t\t\t\t\t\tnewIndex = null;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (newIndex == null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (clause is QuerySelectClause) {\n\t\t\t\t\t\t\toutgoingData.ReceiveIncoming(data);\n\t\t\t\t\t\t\tif (outgoingEnumeratedValue == null)\n\t\t\t\t\t\t\t\toutgoingEnumeratedValue = result.EnumeratedValueResult;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\toutgoingEnumeratedValue = VariableStatusInfo.CombineStatus(outgoingEnumeratedValue.Value, result.EnumeratedValueResult);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t++currentClauseIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar finalData = new VariableStatusInfo();\n\t\t\t\tvar endingClauseIndices = from item in clauses.Select((clause, i) => new { clause, i })\n\t\t\t\t\tlet clause = item.clause\n\t\t\t\t\t\twhere clause is QueryFromClause ||\n\t\t\t\t\tclause is QueryContinuationClause ||\n\t\t\t\t\tclause is QueryJoinClause ||\n\t\t\t\t\tclause is QuerySelectClause ||\n\t\t\t\t\tclause is QueryWhereClause\n\t\t\t\t\t\tselect item.i;\n\t\t\t\tforeach (var clauseIndex in endingClauseIndices) {\n\t\t\t\t\tfinalData.ReceiveIncoming(afterClauseVariableStates [clauseIndex]);\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForEnumeratedValue(finalData, outgoingEnumeratedValue ?? NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn IntroduceVariableFromEnumeratedValue(queryContinuationClause.Identifier, queryContinuationClause.PrecedingQuery, data);\n\t\t\t}\n\n\t\t\tVisitorResult IntroduceVariableFromEnumeratedValue(string newVariable, Expression expression, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar result = expression.AcceptVisitor(this, data);\n\t\t\t\tvar newVariables = result.Variables.Clone();\n\t\t\t\tnewVariables[newVariable] = result.EnumeratedValueResult;\n\t\t\t\treturn VisitorResult.ForValue(newVariables, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryFromClause(QueryFromClause queryFromClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn IntroduceVariableFromEnumeratedValue(queryFromClause.Identifier, queryFromClause.Expression, data);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryJoinClause(QueryJoinClause queryJoinClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\t//TODO: Check if this really works in weird edge-cases.\n\t\t\t\tvar tentativeResult = IntroduceVariableFromEnumeratedValue(queryJoinClause.JoinIdentifier, queryJoinClause.InExpression, data);\n\t\t\t\ttentativeResult = queryJoinClause.OnExpression.AcceptVisitor(this, tentativeResult.Variables);\n\t\t\t\ttentativeResult = queryJoinClause.EqualsExpression.AcceptVisitor(this, tentativeResult.Variables);\n\n\t\t\t\tif (queryJoinClause.IsGroupJoin) {\n\t\t\t\t\tvar newVariables = tentativeResult.Variables.Clone();\n\t\t\t\t\tanalysis.SetLocalVariableValue(newVariables, queryJoinClause.IntoIdentifierToken, NullValueStatus.DefinitelyNotNull);\n\t\t\t\t\treturn VisitorResult.ForValue(newVariables, NullValueStatus.Unknown);\n\t\t\t\t}\n\n\t\t\t\treturn tentativeResult;\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryLetClause(QueryLetClause queryLetClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar result = queryLetClause.Expression.AcceptVisitor(this, data);\n\n\t\t\t\tstring newVariable = queryLetClause.Identifier;\n\t\t\t\tvar newVariables = result.Variables.Clone();\n\t\t\t\tnewVariables [newVariable] = result.NullableReturnResult;\n\n\t\t\t\treturn VisitorResult.ForValue(newVariables, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQuerySelectClause(QuerySelectClause querySelectClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar result = querySelectClause.Expression.AcceptVisitor(this, data);\n\n\t\t\t\t//The value of the expression in select becomes the \"enumerated\" value\n\t\t\t\treturn VisitorResult.ForEnumeratedValue(result.Variables, result.NullableReturnResult);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryWhereClause(QueryWhereClause queryWhereClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar result = queryWhereClause.Condition.AcceptVisitor(this, data);\n\n\t\t\t\treturn VisitorResult.ForEnumeratedValue(result.TruePathVariables, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryOrderClause(QueryOrderClause queryOrderClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tforeach (var ordering in queryOrderClause.Orderings) {\n\t\t\t\t\tdata = ordering.AcceptVisitor(this, data).Variables;\n\t\t\t\t}\n\n\t\t\t\treturn VisitorResult.ForValue(data, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryOrdering(QueryOrdering queryOrdering, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\treturn VisitorResult.ForValue(queryOrdering.Expression.AcceptVisitor(this, data).Variables, NullValueStatus.Unknown);\n\t\t\t}\n\n\t\t\tpublic override VisitorResult VisitQueryGroupClause(QueryGroupClause queryGroupClause, VariableStatusInfo data)\n\t\t\t{\n\t\t\t\tvar projectionResult = queryGroupClause.Projection.AcceptVisitor(this, data);\n\t\t\t\tdata = projectionResult.Variables;\n\t\t\t\tdata = queryGroupClause.Key.AcceptVisitor(this, data).Variables;\n\n\t\t\t\treturn VisitorResult.ForEnumeratedValue(data, projectionResult.NullableReturnResult);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/NullValueStatus.cs",
    "content": "// \n// NullValueAnalysis.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t/// <summary>\n\t/// Represents the null value status of a variable at a specific location.\n\t/// </summary>\n\tpublic enum NullValueStatus\n\t{\n\t\t/// <summary>\n\t\t/// The value of the variable is unknown, possibly due to limitations\n\t\t/// of the null value analysis.\n\t\t/// </summary>\n\t\tUnknown = 0,\n\t\t/// <summary>\n\t\t/// The value of the variable is unknown and even assigning it to a\n\t\t/// value won't change its state, since it has been captured by a lambda\n\t\t/// that may change it at any time (potentially even from a different thread).\n\t\t/// Only going out of scope and creating a new variable may change the value\n\t\t/// of this variable.\n\t\t/// </summary>\n\t\tCapturedUnknown,\n\t\t/// <summary>\n\t\t/// This variable is potentially unassigned.\n\t\t/// </summary>\n\t\tUnassigned,\n\t\t/// <summary>\n\t\t/// The value of the variable is provably null.\n\t\t/// </summary>\n\t\tDefinitelyNull,\n\t\t/// <summary>\n\t\t/// The value of the variable might or might not be null\n\t\t/// </summary>\n\t\tPotentiallyNull,\n\t\t/// <summary>\n\t\t/// The value of the variable is provably not null\n\t\t/// </summary>\n\t\tDefinitelyNotNull,\n\t\t/// <summary>\n\t\t/// The position of this node is unreachable, therefore the value\n\t\t/// of the variable is not meaningful.\n\t\t/// Alternatively, it might mean no local variable exists with the requested name.\n\t\t/// </summary>\n\t\tUnreachableOrInexistent,\n\t\t/// <summary>\n\t\t/// The analyser has encountered an error when attempting to find the value\n\t\t/// of this variable.\n\t\t/// </summary>\n\t\tError\n\t}\n\n\tpublic static class NullValueStatusExtensions\n\t{\n\t\tpublic static bool IsDefiniteValue (this NullValueStatus self) {\n\t\t\treturn self == NullValueStatus.DefinitelyNull || self == NullValueStatus.DefinitelyNotNull;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ReachabilityAnalysis.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t/// <summary>\n\t/// Statement reachability analysis.\n\t/// </summary>\n\tpublic sealed class ReachabilityAnalysis\n\t{\n\t\tHashSet<Statement> reachableStatements = new HashSet<Statement>();\n\t\tHashSet<Statement> reachableEndPoints = new HashSet<Statement>();\n\t\tHashSet<ControlFlowNode> visitedNodes = new HashSet<ControlFlowNode>();\n\t\tStack<ControlFlowNode> stack = new Stack<ControlFlowNode>();\n\t\tRecursiveDetectorVisitor recursiveDetectorVisitor = null;\n\t\t\n\t\tprivate ReachabilityAnalysis() {}\n\t\t\n\t\tpublic static ReachabilityAnalysis Create(Statement statement, CSharpAstResolver resolver = null, RecursiveDetectorVisitor recursiveDetectorVisitor = null, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tvar cfgBuilder = new ControlFlowGraphBuilder();\n\t\t\tvar cfg = cfgBuilder.BuildControlFlowGraph(statement, resolver, cancellationToken);\n\t\t\treturn Create(cfg, recursiveDetectorVisitor, cancellationToken);\n\t\t}\n\t\t\n\t\tinternal static ReachabilityAnalysis Create(Statement statement, Func<AstNode, CancellationToken, ResolveResult> resolver, CSharpTypeResolveContext typeResolveContext, CancellationToken cancellationToken)\n\t\t{\n\t\t\tvar cfgBuilder = new ControlFlowGraphBuilder();\n\t\t\tvar cfg = cfgBuilder.BuildControlFlowGraph(statement, resolver, typeResolveContext, cancellationToken);\n\t\t\treturn Create(cfg, null, cancellationToken);\n\t\t}\n\t\t\n\t\tpublic static ReachabilityAnalysis Create(IList<ControlFlowNode> controlFlowGraph, RecursiveDetectorVisitor recursiveDetectorVisitor = null, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (controlFlowGraph == null)\n\t\t\t\tthrow new ArgumentNullException(\"controlFlowGraph\");\n\t\t\tReachabilityAnalysis ra = new ReachabilityAnalysis();\n\t\t\tra.recursiveDetectorVisitor = recursiveDetectorVisitor;\n\t\t\t// Analysing a null node can result in an empty control flow graph\n\t\t\tif (controlFlowGraph.Count > 0) {\n\t\t\t\tra.stack.Push(controlFlowGraph[0]);\n\t\t\t\twhile (ra.stack.Count > 0) {\n\t\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\t\tra.MarkReachable(ra.stack.Pop());\n\t\t\t\t}\n\t\t\t}\n\t\t\tra.stack = null;\n\t\t\tra.visitedNodes = null;\n\t\t\treturn ra;\n\t\t}\n\t\t\n\t\tvoid MarkReachable(ControlFlowNode node)\n\t\t{\n\t\t\tif (node.PreviousStatement != null) {\n\t\t\t\tif (node.PreviousStatement is LabelStatement) {\n\t\t\t\t\treachableStatements.Add(node.PreviousStatement);\n\t\t\t\t}\n\t\t\t\treachableEndPoints.Add(node.PreviousStatement);\n\t\t\t}\n\t\t\tif (node.NextStatement != null) {\n\t\t\t\treachableStatements.Add(node.NextStatement);\n\t\t\t\tif (IsRecursive(node.NextStatement)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach (var edge in node.Outgoing) {\n\t\t\t\tif (visitedNodes.Add(edge.To))\n\t\t\t\t\tstack.Push(edge.To);\n\t\t\t}\n\t\t}\n\n\t\tbool IsRecursive(Statement statement)\n\t\t{\n\t\t\treturn recursiveDetectorVisitor != null && statement.AcceptVisitor(recursiveDetectorVisitor);\n\t\t}\n\t\t\n\t\tpublic IEnumerable<Statement> ReachableStatements {\n\t\t\tget { return reachableStatements; }\n\t\t}\n\t\t\n\t\tpublic bool IsReachable(Statement statement)\n\t\t{\n\t\t\treturn reachableStatements.Contains(statement);\n\t\t}\n\t\t\n\t\tpublic bool IsEndpointReachable(Statement statement)\n\t\t{\n\t\t\treturn reachableEndPoints.Contains(statement);\n\t\t}\n\n\t\tpublic class RecursiveDetectorVisitor : DepthFirstAstVisitor<bool>\n\t\t{\n\t\t\tpublic override bool VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tif (conditionalExpression.Condition.AcceptVisitor(this))\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (!conditionalExpression.TrueExpression.AcceptVisitor(this))\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn conditionalExpression.FalseExpression.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tpublic override bool VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.NullCoalescing) {\n\t\t\t\t\treturn binaryOperatorExpression.Left.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t\treturn base.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t}\n\n\t\t\tpublic override bool VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tif (ifElseStatement.Condition.AcceptVisitor(this))\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (!ifElseStatement.TrueStatement.AcceptVisitor(this))\n\t\t\t\t\treturn false;\n\n\t\t\t\t//No need to worry about null ast nodes, since AcceptVisitor will just\n\t\t\t\t//return false in those cases\n\t\t\t\treturn ifElseStatement.FalseStatement.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tpublic override bool VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\t//Even if the body is always recursive, the function may stop if the collection\n\t\t\t\t// is empty.\n\t\t\t\treturn foreachStatement.InExpression.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tpublic override bool VisitForStatement(ForStatement forStatement)\n\t\t\t{\n\t\t\t\tif (forStatement.Initializers.Any(initializer => initializer.AcceptVisitor(this)))\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn forStatement.Condition.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tpublic override bool VisitSwitchStatement(SwitchStatement switchStatement)\n\t\t\t{\n\t\t\t\tif (switchStatement.Expression.AcceptVisitor(this)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tbool foundDefault = false;\n\t\t\t\tforeach (var section in switchStatement.SwitchSections) {\n\t\t\t\t\tfoundDefault = foundDefault || section.CaseLabels.Any(label => label.Expression.IsNull);\n\t\t\t\t\tif (!section.AcceptVisitor(this))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn foundDefault;\n\t\t\t}\n\n\t\t\tpublic override bool VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t//If the block has a recursive statement, then that statement will be visited\n\t\t\t\t//individually by the CFG construction algorithm later.\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tprotected override bool VisitChildren(AstNode node)\n\t\t\t{\n\t\t\t\treturn VisitNodeList(node.Children);\n\t\t\t}\n\n\t\t\tbool VisitNodeList(IEnumerable<AstNode> nodes) {\n\t\t\t\treturn nodes.Any(node => node.AcceptVisitor(this));\n\t\t\t}\n\n\t\t\tpublic override bool VisitQueryExpression(QueryExpression queryExpression)\n\t\t\t{\n\t\t\t\t//We only care about the first from clause because:\n\t\t\t\t//in \"from x in Method() select x\", Method() might be recursive\n\t\t\t\t//but in \"from x in Bar() from y in Method() select x + y\", even if Method() is recursive\n\t\t\t\t//Bar might still be empty.\n\t\t\t\tvar queryFromClause = queryExpression.Clauses.OfType<QueryFromClause>().FirstOrDefault();\n\t\t\t\tif (queryFromClause == null)\n\t\t\t\t\treturn true;\n\t\t\t\treturn queryFromClause.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/SemanticHighlightingVisitor.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Completion;\nusing System.Collections.ObjectModel;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t/// <summary>\n\t/// C# Semantic highlighter.\n\t/// </summary>\n\tpublic abstract class SemanticHighlightingVisitor<TColor> : DepthFirstAstVisitor\n\t{\n\t\tprotected CancellationToken cancellationToken = default (CancellationToken);\n\t\t\n\t\tprotected TColor defaultTextColor;\n\t\tprotected TColor referenceTypeColor;\n\t\tprotected TColor valueTypeColor;\n\t\tprotected TColor interfaceTypeColor;\n\t\tprotected TColor enumerationTypeColor;\n\t\tprotected TColor typeParameterTypeColor;\n\t\tprotected TColor delegateTypeColor;\n\t\t\n\t\tprotected TColor methodCallColor;\n\t\tprotected TColor methodDeclarationColor;\n\t\t\n\t\tprotected TColor eventDeclarationColor;\n\t\tprotected TColor eventAccessColor;\n\t\t\n\t\tprotected TColor propertyDeclarationColor;\n\t\tprotected TColor propertyAccessColor;\n\t\t\n\t\tprotected TColor fieldDeclarationColor;\n\t\tprotected TColor fieldAccessColor;\n\t\t\n\t\tprotected TColor variableDeclarationColor;\n\t\tprotected TColor variableAccessColor;\n\t\t\n\t\tprotected TColor parameterDeclarationColor;\n\t\tprotected TColor parameterAccessColor;\n\t\t\n\t\tprotected TColor valueKeywordColor;\n\t\tprotected TColor externAliasKeywordColor;\n\t\tprotected TColor varKeywordTypeColor;\n\n\t\t/// <summary>\n\t\t/// Used for 'in' modifiers on type parameters.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// 'in' may have a different color when used with 'foreach'.\n\t\t/// 'out' is not colored by semantic highlighting, as syntax highlighting can already detect it as a parameter modifier.\n\t\t/// </remarks>\n\t\tprotected TColor parameterModifierColor;\n\t\t\n\t\t/// <summary>\n\t\t/// Used for inactive code (excluded by preprocessor or ConditionalAttribute)\n\t\t/// </summary>\n\t\tprotected TColor inactiveCodeColor;\n\n\t\tprotected TColor stringFormatItemColor;\n\n\n\t\tprotected TColor syntaxErrorColor;\n\t\t\n\t\tprotected TextLocation regionStart;\n\t\tprotected TextLocation regionEnd;\n\t\t\n\t\tprotected CSharpAstResolver resolver;\n\t\tprotected bool isInAccessorContainingValueParameter;\n\t\t\n\t\tprotected abstract void Colorize(TextLocation start, TextLocation end, TColor color);\n\t\t\n\t\t#region Colorize helper methods\n\t\tprotected void Colorize(Identifier identifier, ResolveResult rr)\n\t\t{\n\t\t\tif (identifier.IsNull)\n\t\t\t\treturn;\n\t\t\tif (rr.IsError) {\n\t\t\t\tColorize(identifier, syntaxErrorColor);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (rr is TypeResolveResult) {\n\t\t\t\tif (blockDepth > 0 && identifier.Name == \"var\" && rr.Type.Kind != TypeKind.Null && rr.Type.Name != \"var\" ) {\n\t\t\t\t\tColorize(identifier, varKeywordTypeColor);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tTColor color;\n\t\t\t\tif (TryGetTypeHighlighting (rr.Type.Kind, out color)) {\n\t\t\t\t\tColorize(identifier, color);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar mrr = rr as MemberResolveResult;\n\t\t\tif (mrr != null) {\n\t\t\t\tTColor color;\n\t\t\t\tif (TryGetMemberColor (mrr.Member, out color)) {\n\t\t\t\t\tColorize(identifier, color);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (rr is MethodGroupResolveResult) {\n\t\t\t\tColorize (identifier, methodCallColor);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tvar localResult = rr as LocalResolveResult;\n\t\t\tif (localResult != null) {\n\t\t\t\tif (localResult.Variable is IParameter) {\n\t\t\t\t\tColorize (identifier, parameterAccessColor);\n\t\t\t\t} else {\n\t\t\t\t\tColorize (identifier, variableAccessColor);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tVisitIdentifier(identifier); // un-colorize contextual keywords\n\t\t}\n\t\t\n\t\tprotected void Colorize(AstNode node, TColor color)\n\t\t{\n\t\t\tif (node.IsNull)\n\t\t\t\treturn;\n\t\t\tColorize(node.StartLocation, node.EndLocation, color);\n\t\t}\n\t\t#endregion\n\t\t\n\t\tprotected override void VisitChildren(AstNode node)\n\t\t{\n\t\t\tfor (var child = node.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\tif (child.StartLocation < regionEnd && child.EndLocation > regionStart)\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Visit all children of <c>node</c> until (but excluding) <c>end</c>.\n\t\t/// If <c>end</c> is a null node, nothing will be visited.\n\t\t/// </summary>\n\t\tprotected void VisitChildrenUntil(AstNode node, AstNode end)\n\t\t{\n\t\t\tif (end.IsNull)\n\t\t\t\treturn;\n\t\t\tDebug.Assert(node == end.Parent);\n\t\t\tfor (var child = node.FirstChild; child != end; child = child.NextSibling) {\n\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\tif (child.StartLocation < regionEnd && child.EndLocation > regionStart)\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Visit all children of <c>node</c> after (excluding) <c>start</c>.\n\t\t/// If <c>start</c> is a null node, all children will be visited.\n\t\t/// </summary>\n\t\tprotected void VisitChildrenAfter(AstNode node, AstNode start)\n\t\t{\n\t\t\tDebug.Assert(start.IsNull || start.Parent == node);\n\t\t\tfor (var child = (start.IsNull ? node.FirstChild : start.NextSibling); child != null; child = child.NextSibling) {\n\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\tif (child.StartLocation < regionEnd && child.EndLocation > regionStart)\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitIdentifier(Identifier identifier)\n\t\t{\n\t\t\tswitch (identifier.Name) {\n\t\t\t\tcase \"add\":\n\t\t\t\tcase \"async\":\n\t\t\t\tcase \"await\":\n\t\t\t\tcase \"get\":\n\t\t\t\tcase \"partial\":\n\t\t\t\tcase \"remove\":\n\t\t\t\tcase \"set\":\n\t\t\t\tcase \"where\":\n\t\t\t\tcase \"yield\":\n\t\t\t\tcase \"from\":\n\t\t\t\tcase \"select\":\n\t\t\t\tcase \"group\":\n\t\t\t\tcase \"into\":\n\t\t\t\tcase \"orderby\":\n\t\t\t\tcase \"join\":\n\t\t\t\tcase \"let\":\n\t\t\t\tcase \"on\":\n\t\t\t\tcase \"equals\":\n\t\t\t\tcase \"by\":\n\t\t\t\tcase \"ascending\":\n\t\t\t\tcase \"descending\":\n\t\t\t\tcase \"dynamic\":\n\t\t\t\tcase \"var\":\n\t\t\t\t\t// Reset color of contextual keyword to default if it's used as an identifier.\n\t\t\t\t\t// Note that this method does not get called when 'var' or 'dynamic' is used as a type,\n\t\t\t\t\t// because types get highlighted with valueTypeColor/referenceTypeColor instead.\n\t\t\t\t\tColorize(identifier, defaultTextColor);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"global\":\n\t\t\t\t\t// Reset color of 'global' keyword to default unless its used as part of 'global::'.\n\t\t\t\t\tMemberType parentMemberType = identifier.Parent as MemberType;\n\t\t\t\t\tif (parentMemberType == null || !parentMemberType.IsDoubleColon)\n\t\t\t\t\t\tColorize(identifier, defaultTextColor);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// \"value\" is handled in VisitIdentifierExpression()\n\t\t\t// \"alias\" is handled in VisitExternAliasDeclaration()\n\t\t}\n\t\t\n\t\tpublic override void VisitSimpleType(SimpleType simpleType)\n\t\t{\n\t\t\tvar identifierToken = simpleType.IdentifierToken;\n\t\t\tVisitChildrenUntil(simpleType, identifierToken);\n\t\t\tColorize(identifierToken, resolver.Resolve(simpleType, cancellationToken));\n\t\t\tVisitChildrenAfter(simpleType, identifierToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitMemberType(MemberType memberType)\n\t\t{\n\t\t\tvar memberNameToken = memberType.MemberNameToken;\n\t\t\tVisitChildrenUntil(memberType, memberNameToken);\n\t\t\tColorize(memberNameToken, resolver.Resolve(memberType, cancellationToken));\n\t\t\tVisitChildrenAfter(memberType, memberNameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tvar identifier = identifierExpression.IdentifierToken;\n\t\t\tVisitChildrenUntil(identifierExpression, identifier);\n\t\t\tif (isInAccessorContainingValueParameter && identifierExpression.Identifier == \"value\") {\n\t\t\t\tColorize(identifier, valueKeywordColor);\n\t\t\t} else {\n\t\t\t\tColorize(identifier, resolver.Resolve(identifierExpression, cancellationToken));\n\t\t\t}\n\t\t\tVisitChildrenAfter(identifierExpression, identifier);\n\t\t}\n\t\t\n\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tvar memberNameToken = memberReferenceExpression.MemberNameToken;\n\t\t\tVisitChildrenUntil(memberReferenceExpression, memberNameToken);\n\t\t\tResolveResult rr = resolver.Resolve(memberReferenceExpression, cancellationToken);\n\t\t\tColorize(memberNameToken, rr);\n\t\t\tVisitChildrenAfter(memberReferenceExpression, memberNameToken);\n\t\t}\n\n\t\tvoid HighlightStringFormatItems(PrimitiveExpression expr)\n\t\t{\n\t\t\tif (!(expr.Value is string))\n\t\t\t\treturn;\n\t\t\tint line = expr.StartLocation.Line;\n\t\t\tint col = expr.StartLocation.Column;\n\t\t\tTextLocation start = TextLocation.Empty;\n\t\t\tfor (int i = 0; i < expr.LiteralValue.Length; i++) {\n\t\t\t\tchar ch = expr.LiteralValue [i];\n\n\t\t\t\tif (NewLine.GetDelimiterType(ch, i + 1 < expr.LiteralValue.Length ? expr.LiteralValue [i + 1] : '\\0') != UnicodeNewline.Unknown) {\n\t\t\t\t\tline++;\n\t\t\t\t\tcol = 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\n\t\t\t\tif (ch == '{' && start.IsEmpty) {\n\t\t\t\t\tchar next = i + 1 < expr.LiteralValue.Length ? expr.LiteralValue [i + 1] : '\\0';\n\t\t\t\t\tif (next == '{') {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tcol += 2;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstart = new TextLocation(line, col);\n\t\t\t\t}\n\t\t\t\tif (ch == '}' &&!start.IsEmpty) {\n\t\t\t\t\tColorize(start, new TextLocation(line, col + 1), stringFormatItemColor);\n\t\t\t\t\tstart = TextLocation.Empty;\n\t\t\t\t}\n\t\t\t\tcol++;\n\t\t\t}\n\n\t\t}\n\n\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\tExpression target = invocationExpression.Target;\n\t\t\tif (target is IdentifierExpression || target is MemberReferenceExpression || target is PointerReferenceExpression) {\n\t\t\t\tvar invocationRR = resolver.Resolve(invocationExpression, cancellationToken) as CSharpInvocationResolveResult;\n\t\t\t\tif (invocationRR != null) {\n\t\t\t\t\tif (invocationExpression.Parent is ExpressionStatement && (IsInactiveConditionalMethod(invocationRR.Member) || IsEmptyPartialMethod(invocationRR.Member))) {\n\t\t\t\t\t\t// mark the whole invocation statement as inactive code\n\t\t\t\t\t\tColorize(invocationExpression.Parent, inactiveCodeColor);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tExpression fmtArgumets;\n\t\t\t\t\tIList<Expression> args;\n\t\t\t\t\tif (invocationRR.Arguments.Count > 1 && FormatStringHelper.TryGetFormattingParameters(invocationRR, invocationExpression, out fmtArgumets, out args, null)) {\n\t\t\t\t\t\tvar expr = invocationExpression.Arguments.First() as PrimitiveExpression; \n\t\t\t\t\t\tif (expr != null)\n\t\t\t\t\t\t\tHighlightStringFormatItems(expr);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tVisitChildrenUntil(invocationExpression, target);\n\t\t\t\t\n\t\t\t\t// highlight the method call\n\t\t\t\tvar identifier = target.GetChildByRole(Roles.Identifier);\n\t\t\t\tVisitChildrenUntil(target, identifier);\n\t\t\t\tif (invocationRR != null && !invocationRR.IsDelegateInvocation) {\n\t\t\t\t\tColorize(identifier, methodCallColor);\n\t\t\t\t} else {\n\t\t\t\t\tResolveResult targetRR = resolver.Resolve(target, cancellationToken);\n\t\t\t\t\tColorize(identifier, targetRR);\n\t\t\t\t}\n\t\t\t\tVisitChildrenAfter(target, identifier);\n\t\t\t\tVisitChildrenAfter(invocationExpression, target);\n\t\t\t} else {\n\t\t\t\tVisitChildren(invocationExpression);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#region IsInactiveConditional helper methods\n\t\tbool IsInactiveConditionalMethod(IParameterizedMember member)\n\t\t{\n\t\t\tif (member.SymbolKind != SymbolKind.Method || member.ReturnType.Kind != TypeKind.Void)\n\t\t\t\treturn false;\n\t\t\tforeach (var baseMember in InheritanceHelper.GetBaseMembers(member, false)) {\n\t\t\t\tif (IsInactiveConditional (baseMember.Attributes))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn IsInactiveConditional(member.Attributes);\n\t\t}\n\n\t\tstatic bool IsEmptyPartialMethod(IParameterizedMember member)\n\t\t{\n\t\t\tif (member.SymbolKind != SymbolKind.Method || member.ReturnType.Kind != TypeKind.Void)\n\t\t\t\treturn false;\n\t\t\tvar method = (IMethod)member;\n\t\t\treturn method.IsPartial && !method.HasBody;\n\t\t}\n\n\t\tbool IsInactiveConditional(IList<IAttribute> attributes)\n\t\t{\n\t\t\tbool hasConditionalAttribute = false;\n\t\t\tforeach (var attr in attributes) {\n\t\t\t\tif (attr.AttributeType.Name == \"ConditionalAttribute\" && attr.AttributeType.Namespace == \"System.Diagnostics\" && attr.PositionalArguments.Count == 1) {\n\t\t\t\t\tstring symbol = attr.PositionalArguments[0].ConstantValue as string;\n\t\t\t\t\tif (symbol != null) {\n\t\t\t\t\t\thasConditionalAttribute = true;\n\t\t\t\t\t\tvar cu = this.resolver.RootNode as SyntaxTree;\n\t\t\t\t\t\tif (cu != null) {\n\t\t\t\t\t\t\tif (cu.ConditionalSymbols.Contains(symbol))\n\t\t\t\t\t\t\t\treturn false; // conditional is active\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn hasConditionalAttribute;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override void VisitExternAliasDeclaration (ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\tvar aliasToken = externAliasDeclaration.AliasToken;\n\t\t\tVisitChildrenUntil(externAliasDeclaration, aliasToken);\n\t\t\tColorize (aliasToken, externAliasKeywordColor);\n\t\t\tVisitChildrenAfter(externAliasDeclaration, aliasToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitAccessor(Accessor accessor)\n\t\t{\n\t\t\tisInAccessorContainingValueParameter = accessor.Role != PropertyDeclaration.GetterRole;\n\t\t\ttry {\n\t\t\t\tVisitChildren(accessor);\n\t\t\t} finally {\n\t\t\t\tisInAccessorContainingValueParameter = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool CheckInterfaceImplementation (EntityDeclaration entityDeclaration)\n\t\t{\n\t\t\tvar result = resolver.Resolve (entityDeclaration, cancellationToken) as MemberResolveResult;\n\t\t\tif (result == null)\n\t\t\t\treturn false;\n\t\t\tif (result.Member.ImplementedInterfaceMembers.Count == 0) {\n\t\t\t\tColorize (entityDeclaration.NameToken, syntaxErrorColor);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tvar nameToken = methodDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(methodDeclaration, nameToken);\n\t\t\tif (!methodDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\tif (!CheckInterfaceImplementation (methodDeclaration)) {\n\t\t\t\t\tVisitChildrenAfter(methodDeclaration, nameToken);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tColorize(nameToken, methodDeclarationColor);\n\t\t\tVisitChildrenAfter(methodDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tvar nameToken = parameterDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(parameterDeclaration, nameToken);\n\t\t\tColorize(nameToken, parameterDeclarationColor);\n\t\t\tVisitChildrenAfter(parameterDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tvar nameToken = eventDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(eventDeclaration, nameToken);\n\t\t\tColorize(nameToken, eventDeclarationColor);\n\t\t\tVisitChildrenAfter(eventDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\tvar nameToken = eventDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(eventDeclaration, nameToken);\n\t\t\tif (!eventDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\tif (!CheckInterfaceImplementation (eventDeclaration)) {\n\t\t\t\t\tVisitChildrenAfter(eventDeclaration, nameToken);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tColorize(nameToken, eventDeclarationColor);\n\t\t\tVisitChildrenAfter(eventDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tvar nameToken = propertyDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(propertyDeclaration, nameToken);\n\t\t\tif (!propertyDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\tif (!CheckInterfaceImplementation (propertyDeclaration)) {\n\t\t\t\t\tVisitChildrenAfter(propertyDeclaration, nameToken);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tColorize(nameToken, propertyDeclarationColor);\n\t\t\tVisitChildrenAfter(propertyDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\tbase.VisitIndexerDeclaration(indexerDeclaration);\n\t\t\tif (!indexerDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\tCheckInterfaceImplementation (indexerDeclaration);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tfieldDeclaration.ReturnType.AcceptVisitor (this);\n\t\t\tforeach (var init in fieldDeclaration.Variables) {\n\t\t\t\tColorize (init.NameToken, fieldDeclarationColor);\n\t\t\t\tinit.Initializer.AcceptVisitor (this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\tfixedFieldDeclaration.ReturnType.AcceptVisitor (this);\n\t\t\tforeach (var init in fixedFieldDeclaration.Variables) {\n\t\t\t\tColorize (init.NameToken, fieldDeclarationColor);\n\t\t\t\tinit.CountExpression.AcceptVisitor (this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\tHandleConstructorOrDestructor(constructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\tHandleConstructorOrDestructor(destructorDeclaration);\n\t\t}\n\t\t\n\t\tvoid HandleConstructorOrDestructor(AstNode constructorDeclaration)\n\t\t{\n\t\t\tIdentifier nameToken = constructorDeclaration.GetChildByRole(Roles.Identifier);\n\t\t\tVisitChildrenUntil(constructorDeclaration, nameToken);\n\t\t\tvar currentTypeDef = resolver.GetResolverStateBefore(constructorDeclaration).CurrentTypeDefinition;\n\t\t\tif (currentTypeDef != null && nameToken.Name == currentTypeDef.Name) {\n\t\t\t\tTColor color;\n\t\t\t\tif (TryGetTypeHighlighting (currentTypeDef.Kind, out color))\n\t\t\t\t\tColorize(nameToken, color);\n\t\t\t}\n\t\t\tVisitChildrenAfter(constructorDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tbool TryGetMemberColor(IMember member, out TColor color)\n\t\t{\n\t\t\tswitch (member.SymbolKind) {\n\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\tcolor = fieldAccessColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase SymbolKind.Property:\n\t\t\t\t\tcolor = propertyAccessColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase SymbolKind.Event:\n\t\t\t\t\tcolor = eventAccessColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase SymbolKind.Method:\n\t\t\t\t\tcolor = methodCallColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase SymbolKind.Constructor:\n\t\t\t\tcase SymbolKind.Destructor:\n\t\t\t\t\treturn TryGetTypeHighlighting (member.DeclaringType.Kind, out color);\n\t\t\t\tdefault:\n\t\t\t\t\tcolor = default (TColor);\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTColor GetTypeHighlighting (ClassType classType)\n\t\t{\n\t\t\tswitch (classType) {\n\t\t\t\tcase ClassType.Class:\n\t\t\t\t\treturn referenceTypeColor;\n\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\treturn valueTypeColor;\n\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\treturn interfaceTypeColor;\n\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\treturn enumerationTypeColor;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException (\"Unknown class type :\" + classType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool TryGetTypeHighlighting (TypeKind kind, out TColor color)\n\t\t{\n\t\t\tswitch (kind) {\n\t\t\t\tcase TypeKind.Class:\n\t\t\t\t\tcolor = referenceTypeColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase TypeKind.Struct:\n\t\t\t\t\tcolor = valueTypeColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase TypeKind.Interface:\n\t\t\t\t\tcolor = interfaceTypeColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase TypeKind.Enum:\n\t\t\t\t\tcolor = enumerationTypeColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase TypeKind.TypeParameter:\n\t\t\t\t\tcolor = typeParameterTypeColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase TypeKind.Delegate:\n\t\t\t\t\tcolor = delegateTypeColor;\n\t\t\t\t\treturn true;\n\t\t\t\tcase TypeKind.Unknown:\n\t\t\t\tcase TypeKind.Null:\n\t\t\t\t\tcolor = syntaxErrorColor;\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\tcolor = default (TColor);\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\tvar nameToken = typeDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(typeDeclaration, nameToken);\n\t\t\tColorize(nameToken, GetTypeHighlighting (typeDeclaration.ClassType));\n\t\t\tVisitChildrenAfter(typeDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration)\n\t\t{\n\t\t\tif (typeParameterDeclaration.Variance == VarianceModifier.Contravariant)\n\t\t\t\tColorize(typeParameterDeclaration.VarianceToken, parameterModifierColor);\n\t\t\t\n\t\t\t//\t\t\tbool isValueType = false;\n\t\t\t//\t\t\tif (typeParameterDeclaration.Parent != null) {\n\t\t\t//\t\t\t\tforeach (var constraint in typeParameterDeclaration.Parent.GetChildrenByRole(Roles.Constraint)) {\n\t\t\t//\t\t\t\t\tif (constraint.TypeParameter.Identifier == typeParameterDeclaration.Name) {\n\t\t\t//\t\t\t\t\t\tisValueType = constraint.BaseTypes.OfType<PrimitiveType>().Any(p => p.Keyword == \"struct\");\n\t\t\t//\t\t\t\t\t}\n\t\t\t//\t\t\t\t}\n\t\t\t//\t\t\t}\n\t\t\tvar nameToken = typeParameterDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(typeParameterDeclaration, nameToken);\n\t\t\tColorize(nameToken, typeParameterTypeColor);  /*isValueType ? valueTypeColor : referenceTypeColor*/\n\t\t\tVisitChildrenAfter(typeParameterDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\tvar nameToken = delegateDeclaration.NameToken;\n\t\t\tVisitChildrenUntil(delegateDeclaration, nameToken);\n\t\t\tColorize(nameToken, delegateTypeColor);\n\t\t\tVisitChildrenAfter(delegateDeclaration, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\tvar nameToken = variableInitializer.NameToken;\n\t\t\tVisitChildrenUntil(variableInitializer, nameToken);\n\t\t\tif (variableInitializer.Parent is FieldDeclaration) {\n\t\t\t\tColorize(nameToken, fieldDeclarationColor);\n\t\t\t} else if (variableInitializer.Parent is EventDeclaration) {\n\t\t\t\tColorize(nameToken, eventDeclarationColor);\n\t\t\t} else {\n\t\t\t\tColorize(nameToken, variableDeclarationColor);\n\t\t\t}\n\t\t\tVisitChildrenAfter(variableInitializer, nameToken);\n\t\t}\n\t\t\n\t\tpublic override void VisitComment(Comment comment)\n\t\t{\n\t\t\tif (comment.CommentType == CommentType.InactiveCode) {\n\t\t\t\tColorize(comment, inactiveCodeColor);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void VisitAttribute(ICSharpCode.NRefactory.CSharp.Attribute attribute)\n\t\t{\n\t\t\tITypeDefinition attrDef = resolver.Resolve(attribute.Type, cancellationToken).Type.GetDefinition();\n\t\t\tif (attrDef != null && IsInactiveConditional(attrDef.Attributes)) {\n\t\t\t\tColorize(attribute, inactiveCodeColor);\n\t\t\t} else {\n\t\t\t\tVisitChildren(attribute);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\tforeach (var a in arrayInitializerExpression.Elements) {\n\t\t\t\tvar namedElement = a as NamedExpression;\n\t\t\t\tif (namedElement != null) {\n\t\t\t\t\tvar result = resolver.Resolve (namedElement, cancellationToken);\n\t\t\t\t\tif (result.IsError)\n\t\t\t\t\t\tColorize (namedElement.NameToken, syntaxErrorColor);\n\t\t\t\t\tnamedElement.Expression.AcceptVisitor (this);\n\t\t\t\t} else {\n\t\t\t\t\ta.AcceptVisitor (this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint blockDepth;\n\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t{\n\t\t\tblockDepth++;\n\t\t\tbase.VisitBlockStatement(blockStatement);\n\t\t\tblockDepth--;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs",
    "content": "﻿// \n// AstNode.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic abstract class AstNode : AbstractAnnotatable, ICSharpCode.NRefactory.TypeSystem.IFreezable, PatternMatching.INode, ICloneable\n\t{\n\t\t// the Root role must be available when creating the null nodes, so we can't put it in the Roles class\n\t\tinternal static readonly Role<AstNode> RootRole = new Role<AstNode> (\"Root\");\n\t\t\n\t\t#region Null\n\t\tpublic static readonly AstNode Null = new NullAstNode ();\n\t\t\n\t\tsealed class NullAstNode : AstNode\n\t\t{\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget {\n\t\t\t\t\treturn NodeType.Unknown;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch (AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator AstNode (PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder (pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : AstNode, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder (PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder (this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch (AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch (other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection (Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection (role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tAstNode parent;\n\t\tAstNode prevSibling;\n\t\tAstNode nextSibling;\n\t\tAstNode firstChild;\n\t\tAstNode lastChild;\n\t\t\n\t\t// Flags, from least significant to most significant bits:\n\t\t// - Role.RoleIndexBits: role index\n\t\t// - 1 bit: IsFrozen\n\t\tprotected uint flags = RootRole.Index;\n\t\t// Derived classes may also use a few bits,\n\t\t// for example Identifier uses 1 bit for IsVerbatim\n\t\t\n\t\tconst uint roleIndexMask = (1u << Role.RoleIndexBits) - 1;\n\t\tconst uint frozenBit = 1u << Role.RoleIndexBits;\n\t\tprotected const int AstNodeFlagsUsedBits = Role.RoleIndexBits + 1;\n\t\t\n\t\tprotected AstNode()\n\t\t{\n\t\t\tif (IsNull)\n\t\t\t\tFreeze();\n\t\t}\n\t\t\n\t\tpublic bool IsFrozen {\n\t\t\tget { return (flags & frozenBit) != 0; }\n\t\t}\n\t\t\n\t\tpublic void Freeze()\n\t\t{\n\t\t\tif (!IsFrozen) {\n\t\t\t\tfor (AstNode child = firstChild; child != null; child = child.nextSibling)\n\t\t\t\t\tchild.Freeze();\n\t\t\t\tflags |= frozenBit;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected void ThrowIfFrozen()\n\t\t{\n\t\t\tif (IsFrozen)\n\t\t\t\tthrow new InvalidOperationException(\"Cannot mutate frozen \" + GetType().Name);\n\t\t}\n\t\t\n\t\tpublic abstract NodeType NodeType {\n\t\t\tget;\n\t\t}\n\t\t\n\t\tpublic virtual bool IsNull {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\tvar child = firstChild;\n\t\t\t\tif (child == null)\n\t\t\t\t\treturn TextLocation.Empty;\n\t\t\t\treturn child.StartLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\tvar child = lastChild;\n\t\t\t\tif (child == null)\n\t\t\t\t\treturn TextLocation.Empty;\n\t\t\t\treturn child.EndLocation;\n\t\t\t}\n\t\t}\n\n\t\tpublic DomRegion Region {\n\t\t\tget {\n\t\t\t\treturn new DomRegion (StartLocation, EndLocation);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the region from StartLocation to EndLocation for this node.\n\t\t/// The file name of the region is set based on the parent SyntaxTree's file name.\n\t\t/// If this node is not connected to a whole compilation, the file name will be null.\n\t\t/// </summary>\n\t\tpublic ICSharpCode.NRefactory.TypeSystem.DomRegion GetRegion()\n\t\t{\n\t\t\tvar syntaxTree = (this.Ancestors.LastOrDefault() ?? this) as SyntaxTree;\n\t\t\tstring fileName = (syntaxTree != null ? syntaxTree.FileName : null);\n\t\t\treturn new ICSharpCode.NRefactory.TypeSystem.DomRegion(fileName, this.StartLocation, this.EndLocation);\n\t\t}\n\t\t\n\t\tpublic AstNode Parent {\n\t\t\tget { return parent; }\n\t\t}\n\t\t\n\t\tpublic Role Role {\n\t\t\tget {\n\t\t\t\treturn Role.GetByIndex(flags & roleIndexMask);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tif (!value.IsValid(this))\n\t\t\t\t\tthrow new ArgumentException(\"This node is not valid in the new role.\");\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tSetRole(value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal uint RoleIndex {\n\t\t\tget { return flags & roleIndexMask; }\n\t\t}\n\t\t\n\t\tvoid SetRole(Role role)\n\t\t{\n\t\t\tflags = (flags & ~roleIndexMask) | role.Index;\n\t\t}\n\t\t\n\t\tpublic AstNode NextSibling {\n\t\t\tget { return nextSibling; }\n\t\t}\n\t\t\n\t\tpublic AstNode PrevSibling {\n\t\t\tget { return prevSibling; }\n\t\t}\n\t\t\n\t\tpublic AstNode FirstChild {\n\t\t\tget { return firstChild; }\n\t\t}\n\t\t\n\t\tpublic AstNode LastChild {\n\t\t\tget { return lastChild; }\n\t\t}\n\t\t\n\t\tpublic bool HasChildren {\n\t\t\tget {\n\t\t\t\treturn firstChild != null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<AstNode> Children {\n\t\t\tget {\n\t\t\t\tAstNode next;\n\t\t\t\tfor (AstNode cur = firstChild; cur != null; cur = next) {\n\t\t\t\t\tDebug.Assert (cur.parent == this);\n\t\t\t\t\t// Remember next before yielding cur.\n\t\t\t\t\t// This allows removing/replacing nodes while iterating through the list.\n\t\t\t\t\tnext = cur.nextSibling;\n\t\t\t\t\tyield return cur;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the ancestors of this node (excluding this node itself)\n\t\t/// </summary>\n\t\tpublic IEnumerable<AstNode> Ancestors {\n\t\t\tget {\n\t\t\t\tfor (AstNode cur = parent; cur != null; cur = cur.parent) {\n\t\t\t\t\tyield return cur;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the ancestors of this node (including this node itself)\n\t\t/// </summary>\n\t\tpublic IEnumerable<AstNode> AncestorsAndSelf {\n\t\t\tget {\n\t\t\t\tfor (AstNode cur = this; cur != null; cur = cur.parent) {\n\t\t\t\t\tyield return cur;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all descendants of this node (excluding this node itself) in pre-order.\n\t\t/// </summary>\n\t\tpublic IEnumerable<AstNode> Descendants {\n\t\t\tget { return GetDescendantsImpl(false); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all descendants of this node (including this node itself) in pre-order.\n\t\t/// </summary>\n\t\tpublic IEnumerable<AstNode> DescendantsAndSelf {\n\t\t\tget { return GetDescendantsImpl(true); }\n\t\t}\n\n\t\tstatic bool IsInsideRegion(DomRegion region, AstNode pos)\n\t\t{\n\t\t\tif (region.IsEmpty)\n\t\t\t\treturn true;\n\t\t\tvar nodeRegion = pos.Region;\n\t\t\treturn region.IntersectsWith(nodeRegion) || region.OverlapsWith(nodeRegion);\n\t\t}\n\n\t\tpublic IEnumerable<AstNode> DescendantNodes (Func<AstNode, bool> descendIntoChildren = null)\n\t\t{\n\t\t\treturn GetDescendantsImpl(false, new DomRegion (), descendIntoChildren);\n\t\t}\n\n\t\tpublic IEnumerable<AstNode> DescendantNodes (DomRegion region, Func<AstNode, bool> descendIntoChildren = null)\n\t\t{\n\t\t\treturn GetDescendantsImpl(false, region, descendIntoChildren);\n\t\t}\n\n\t\tpublic IEnumerable<AstNode> DescendantNodesAndSelf (Func<AstNode, bool> descendIntoChildren = null)\n\t\t{\n\t\t\treturn GetDescendantsImpl(true, new DomRegion (), descendIntoChildren);\n\t\t}\n\n\t\tpublic IEnumerable<AstNode> DescendantNodesAndSelf (DomRegion region, Func<AstNode, bool> descendIntoChildren = null)\n\t\t{\n\t\t\treturn GetDescendantsImpl(true, region, descendIntoChildren);\n\t\t}\n\n\t\tIEnumerable<AstNode> GetDescendantsImpl(bool includeSelf, DomRegion region = new DomRegion (), Func<AstNode, bool> descendIntoChildren = null)\n\t\t{\n\t\t\tif (includeSelf) {\n\t\t\t\tif (IsInsideRegion (region, this))\n\t\t\t\t\tyield return this;\n\t\t\t\tif (descendIntoChildren != null && !descendIntoChildren(this))\n\t\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tStack<AstNode> nextStack = new Stack<AstNode>();\n\t\t\tnextStack.Push(null);\n\t\t\tAstNode pos = firstChild;\n\t\t\twhile (pos != null) {\n\t\t\t\t// Remember next before yielding pos.\n\t\t\t\t// This allows removing/replacing nodes while iterating through the list.\n\t\t\t\tif (pos.nextSibling != null)\n\t\t\t\t\tnextStack.Push(pos.nextSibling);\n\t\t\t\tif (IsInsideRegion(region, pos))\n\t\t\t\t\tyield return pos;\n\t\t\t\tif (pos.firstChild != null && (descendIntoChildren == null || descendIntoChildren(pos)))\n\t\t\t\t\tpos = pos.firstChild;\n\t\t\t\telse\n\t\t\t\t\tpos = nextStack.Pop();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the first child with the specified role.\n\t\t/// Returns the role's null object if the child is not found.\n\t\t/// </summary>\n\t\tpublic T GetChildByRole<T>(Role<T> role) where T : AstNode\n\t\t{\n\t\t\tif (role == null)\n\t\t\t\tthrow new ArgumentNullException (\"role\");\n\t\t\tuint roleIndex = role.Index;\n\t\t\tfor (var cur = firstChild; cur != null; cur = cur.nextSibling) {\n\t\t\t\tif ((cur.flags & roleIndexMask) == roleIndex)\n\t\t\t\t\treturn (T)cur;\n\t\t\t}\n\t\t\treturn role.NullObject;\n\t\t}\n\t\t\n\t\tpublic T GetParent<T>() where T : AstNode\n\t\t{\n\t\t\treturn Ancestors.OfType<T>().FirstOrDefault();\n\t\t}\n\n\t\tpublic AstNode GetParent(Func<AstNode, bool> pred)\n\t\t{\n\t\t\treturn Ancestors.FirstOrDefault(pred);\n\t\t}\n\n\t\tpublic AstNodeCollection<T> GetChildrenByRole<T> (Role<T> role) where T : AstNode\n\t\t{\n\t\t\treturn new AstNodeCollection<T> (this, role);\n\t\t}\n\t\t\n\t\tprotected void SetChildByRole<T> (Role<T> role, T newChild) where T : AstNode\n\t\t{\n\t\t\tAstNode oldChild = GetChildByRole (role);\n\t\t\tif (oldChild.IsNull)\n\t\t\t\tAddChild (newChild, role);\n\t\t\telse\n\t\t\t\toldChild.ReplaceWith (newChild);\n\t\t}\n\t\t\n\t\tpublic void AddChild<T> (T child, Role<T> role) where T : AstNode\n\t\t{\n\t\t\tif (role == null)\n\t\t\t\tthrow new ArgumentNullException (\"role\");\n\t\t\tif (child == null || child.IsNull)\n\t\t\t\treturn;\n\t\t\tThrowIfFrozen();\n\t\t\tif (child == this)\n\t\t\t\tthrow new ArgumentException (\"Cannot add a node to itself as a child.\", \"child\");\n\t\t\tif (child.parent != null)\n\t\t\t\tthrow new ArgumentException (\"Node is already used in another tree.\", \"child\");\n\t\t\tif (child.IsFrozen)\n\t\t\t\tthrow new ArgumentException (\"Cannot add a frozen node.\", \"child\");\n\t\t\tAddChildUnsafe (child, role);\n\t\t}\n\t\t\n\t\tpublic void AddChildWithExistingRole (AstNode child)\n\t\t{\n\t\t\tif (child == null || child.IsNull)\n\t\t\t\treturn;\n\t\t\tThrowIfFrozen();\n\t\t\tif (child == this)\n\t\t\t\tthrow new ArgumentException (\"Cannot add a node to itself as a child.\", \"child\");\n\t\t\tif (child.parent != null)\n\t\t\t\tthrow new ArgumentException (\"Node is already used in another tree.\", \"child\");\n\t\t\tif (child.IsFrozen)\n\t\t\t\tthrow new ArgumentException (\"Cannot add a frozen node.\", \"child\");\n\t\t\tAddChildUnsafe (child, child.Role);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds a child without performing any safety checks.\n\t\t/// </summary>\n\t\tinternal void AddChildUnsafe (AstNode child, Role role)\n\t\t{\n\t\t\tchild.parent = this;\n\t\t\tchild.SetRole(role);\n\t\t\tif (firstChild == null) {\n\t\t\t\tlastChild = firstChild = child;\n\t\t\t} else {\n\t\t\t\tlastChild.nextSibling = child;\n\t\t\t\tchild.prevSibling = lastChild;\n\t\t\t\tlastChild = child;\n\t\t\t}\n\t\t}\n\n\t\tpublic void InsertChildBefore<T> (AstNode nextSibling, T child, Role<T> role) where T : AstNode\n\t\t{\n\t\t\tif (role == null)\n\t\t\t\tthrow new ArgumentNullException (\"role\");\n\t\t\tif (nextSibling == null || nextSibling.IsNull) {\n\t\t\t\tAddChild (child, role);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (child == null || child.IsNull)\n\t\t\t\treturn;\n\t\t\tThrowIfFrozen();\n\t\t\tif (child.parent != null)\n\t\t\t\tthrow new ArgumentException (\"Node is already used in another tree.\", \"child\");\n\t\t\tif (child.IsFrozen)\n\t\t\t\tthrow new ArgumentException (\"Cannot add a frozen node.\", \"child\");\n\t\t\tif (nextSibling.parent != this)\n\t\t\t\tthrow new ArgumentException (\"NextSibling is not a child of this node.\", \"nextSibling\");\n\t\t\t// No need to test for \"Cannot add children to null nodes\",\n\t\t\t// as there isn't any valid nextSibling in null nodes.\n\t\t\tInsertChildBeforeUnsafe (nextSibling, child, role);\n\t\t}\n\t\t\n\t\tinternal void InsertChildBeforeUnsafe (AstNode nextSibling, AstNode child, Role role)\n\t\t{\n\t\t\tchild.parent = this;\n\t\t\tchild.SetRole(role);\n\t\t\tchild.nextSibling = nextSibling;\n\t\t\tchild.prevSibling = nextSibling.prevSibling;\n\t\t\t\n\t\t\tif (nextSibling.prevSibling != null) {\n\t\t\t\tDebug.Assert (nextSibling.prevSibling.nextSibling == nextSibling);\n\t\t\t\tnextSibling.prevSibling.nextSibling = child;\n\t\t\t} else {\n\t\t\t\tDebug.Assert (firstChild == nextSibling);\n\t\t\t\tfirstChild = child;\n\t\t\t}\n\t\t\tnextSibling.prevSibling = child;\n\t\t}\n\t\t\n\t\tpublic void InsertChildAfter<T> (AstNode prevSibling, T child, Role<T> role) where T : AstNode\n\t\t{\n\t\t\tInsertChildBefore ((prevSibling == null || prevSibling.IsNull) ? firstChild : prevSibling.nextSibling, child, role);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Removes this node from its parent.\n\t\t/// </summary>\n\t\tpublic void Remove ()\n\t\t{\n\t\t\tif (parent != null) {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tif (prevSibling != null) {\n\t\t\t\t\tDebug.Assert (prevSibling.nextSibling == this);\n\t\t\t\t\tprevSibling.nextSibling = nextSibling;\n\t\t\t\t} else {\n\t\t\t\t\tDebug.Assert (parent.firstChild == this);\n\t\t\t\t\tparent.firstChild = nextSibling;\n\t\t\t\t}\n\t\t\t\tif (nextSibling != null) {\n\t\t\t\t\tDebug.Assert (nextSibling.prevSibling == this);\n\t\t\t\t\tnextSibling.prevSibling = prevSibling;\n\t\t\t\t} else {\n\t\t\t\t\tDebug.Assert (parent.lastChild == this);\n\t\t\t\t\tparent.lastChild = prevSibling;\n\t\t\t\t}\n\t\t\t\tparent = null;\n\t\t\t\tprevSibling = null;\n\t\t\t\tnextSibling = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces this node with the new node.\n\t\t/// </summary>\n\t\tpublic void ReplaceWith (AstNode newNode)\n\t\t{\n\t\t\tif (newNode == null || newNode.IsNull) {\n\t\t\t\tRemove ();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (newNode == this)\n\t\t\t\treturn; // nothing to do...\n\t\t\tif (parent == null) {\n\t\t\t\tthrow new InvalidOperationException (this.IsNull ? \"Cannot replace the null nodes\" : \"Cannot replace the root node\");\n\t\t\t}\n\t\t\tThrowIfFrozen();\n\t\t\t// Because this method doesn't statically check the new node's type with the role,\n\t\t\t// we perform a runtime test:\n\t\t\tif (!this.Role.IsValid (newNode)) {\n\t\t\t\tthrow new ArgumentException (string.Format (\"The new node '{0}' is not valid in the role {1}\", newNode.GetType ().Name, this.Role.ToString ()), \"newNode\");\n\t\t\t}\n\t\t\tif (newNode.parent != null) {\n\t\t\t\t// newNode is used within this tree?\n\t\t\t\tif (newNode.Ancestors.Contains (this)) {\n\t\t\t\t\t// e.g. \"parenthesizedExpr.ReplaceWith(parenthesizedExpr.Expression);\"\n\t\t\t\t\t// enable automatic removal\n\t\t\t\t\tnewNode.Remove ();\n\t\t\t\t} else {\n\t\t\t\t\tthrow new ArgumentException (\"Node is already used in another tree.\", \"newNode\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (newNode.IsFrozen)\n\t\t\t\tthrow new ArgumentException (\"Cannot add a frozen node.\", \"newNode\");\n\t\t\t\n\t\t\tnewNode.parent = parent;\n\t\t\tnewNode.SetRole(this.Role);\n\t\t\tnewNode.prevSibling = prevSibling;\n\t\t\tnewNode.nextSibling = nextSibling;\n\n\t\t\tif (prevSibling != null) {\n\t\t\t\tDebug.Assert (prevSibling.nextSibling == this);\n\t\t\t\tprevSibling.nextSibling = newNode;\n\t\t\t} else {\n\t\t\t\tDebug.Assert (parent.firstChild == this);\n\t\t\t\tparent.firstChild = newNode;\n\t\t\t}\n\t\t\tif (nextSibling != null) {\n\t\t\t\tDebug.Assert (nextSibling.prevSibling == this);\n\t\t\t\tnextSibling.prevSibling = newNode;\n\t\t\t} else {\n\t\t\t\tDebug.Assert (parent.lastChild == this);\n\t\t\t\tparent.lastChild = newNode;\n\t\t\t}\n\t\t\tparent = null;\n\t\t\tprevSibling = null;\n\t\t\tnextSibling = null;\n\t\t}\n\t\t\n\t\tpublic AstNode ReplaceWith (Func<AstNode, AstNode> replaceFunction)\n\t\t{\n\t\t\tif (replaceFunction == null)\n\t\t\t\tthrow new ArgumentNullException (\"replaceFunction\");\n\t\t\tif (parent == null) {\n\t\t\t\tthrow new InvalidOperationException (this.IsNull ? \"Cannot replace the null nodes\" : \"Cannot replace the root node\");\n\t\t\t}\n\t\t\tAstNode oldParent = parent;\n\t\t\tAstNode oldSuccessor = nextSibling;\n\t\t\tRole oldRole = this.Role;\n\t\t\tRemove ();\n\t\t\tAstNode replacement = replaceFunction (this);\n\t\t\tif (oldSuccessor != null && oldSuccessor.parent != oldParent)\n\t\t\t\tthrow new InvalidOperationException (\"replace function changed nextSibling of node being replaced?\");\n\t\t\tif (!(replacement == null || replacement.IsNull)) {\n\t\t\t\tif (replacement.parent != null)\n\t\t\t\t\tthrow new InvalidOperationException (\"replace function must return the root of a tree\");\n\t\t\t\tif (!oldRole.IsValid (replacement)) {\n\t\t\t\t\tthrow new InvalidOperationException (string.Format (\"The new node '{0}' is not valid in the role {1}\", replacement.GetType ().Name, oldRole.ToString ()));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (oldSuccessor != null)\n\t\t\t\t\toldParent.InsertChildBeforeUnsafe (oldSuccessor, replacement, oldRole);\n\t\t\t\telse\n\t\t\t\t\toldParent.AddChildUnsafe (replacement, oldRole);\n\t\t\t}\n\t\t\treturn replacement;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Clones the whole subtree starting at this AST node.\n\t\t/// </summary>\n\t\t/// <remarks>Annotations are copied over to the new nodes; and any annotations implementing ICloneable will be cloned.</remarks>\n\t\tpublic AstNode Clone ()\n\t\t{\n\t\t\tAstNode copy = (AstNode)MemberwiseClone ();\n\t\t\t// First, reset the shallow pointer copies\n\t\t\tcopy.parent = null;\n\t\t\tcopy.firstChild = null;\n\t\t\tcopy.lastChild = null;\n\t\t\tcopy.prevSibling = null;\n\t\t\tcopy.nextSibling = null;\n\t\t\tcopy.flags &= ~frozenBit; // unfreeze the copy\n\t\t\t\n\t\t\t// Then perform a deep copy:\n\t\t\tfor (AstNode cur = firstChild; cur != null; cur = cur.nextSibling) {\n\t\t\t\tcopy.AddChildUnsafe (cur.Clone (), cur.Role);\n\t\t\t}\n\t\t\t\n\t\t\t// Finally, clone the annotation, if necessary\n\t\t\tcopy.CloneAnnotations();\n\t\t\t\n\t\t\treturn copy;\n\t\t}\n\t\t\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\t\t\n\t\tpublic abstract void AcceptVisitor (IAstVisitor visitor);\n\t\t\n\t\tpublic abstract T AcceptVisitor<T> (IAstVisitor<T> visitor);\n\t\t\n\t\tpublic abstract S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data);\n\t\t\n\t\t#region Pattern Matching\n\t\tprotected static bool MatchString (string pattern, string text)\n\t\t{\n\t\t\treturn PatternMatching.Pattern.MatchString(pattern, text);\n\t\t}\n\t\t\n\t\tprotected internal abstract bool DoMatch (AstNode other, PatternMatching.Match match);\n\t\t\n\t\tbool PatternMatching.INode.DoMatch (PatternMatching.INode other, PatternMatching.Match match)\n\t\t{\n\t\t\tAstNode o = other as AstNode;\n\t\t\t// try matching if other is null, or if other is an AstNode\n\t\t\treturn (other == null || o != null) && DoMatch (o, match);\n\t\t}\n\t\t\n\t\tbool PatternMatching.INode.DoMatchCollection (Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t{\n\t\t\tAstNode o = pos as AstNode;\n\t\t\treturn (pos == null || o != null) && DoMatch (o, match);\n\t\t}\n\t\t\n\t\tPatternMatching.INode PatternMatching.INode.NextSibling {\n\t\t\tget { return nextSibling; }\n\t\t}\n\t\t\n\t\tPatternMatching.INode PatternMatching.INode.FirstChild {\n\t\t\tget { return firstChild; }\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\tpublic AstNode GetNextNode ()\n\t\t{\n\t\t\tif (NextSibling != null)\n\t\t\t\treturn NextSibling;\n\t\t\tif (Parent != null)\n\t\t\t\treturn Parent.GetNextNode ();\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the next node which fullfills a given predicate\n\t\t/// </summary>\n\t\t/// <returns>The next node.</returns>\n\t\t/// <param name=\"pred\">The predicate.</param>\n\t\tpublic AstNode GetNextNode (Func<AstNode, bool> pred)\n\t\t{\n\t\t\tvar next = GetNextNode();\n\t\t\twhile (next != null && !pred (next))\n\t\t\t\tnext = next.GetNextNode();\n\t\t\treturn next;\n\t\t}\n\n\t\tpublic AstNode GetPrevNode ()\n\t\t{\n\t\t\tif (PrevSibling != null)\n\t\t\t\treturn PrevSibling;\n\t\t\tif (Parent != null)\n\t\t\t\treturn Parent.GetPrevNode ();\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the previous node which fullfills a given predicate\n\t\t/// </summary>\n\t\t/// <returns>The next node.</returns>\n\t\t/// <param name=\"pred\">The predicate.</param>\n\t\tpublic AstNode GetPrevNode (Func<AstNode, bool> pred)\n\t\t{\n\t\t\tvar prev = GetPrevNode();\n\t\t\twhile (prev != null && !pred (prev))\n\t\t\t\tprev = prev.GetPrevNode();\n\t\t\treturn prev;\n\t\t}\n\t\t// filters all non c# nodes (comments, white spaces or pre processor directives)\n\t\tpublic AstNode GetCSharpNodeBefore (AstNode node)\n\t\t{\n\t\t\tvar n = node.PrevSibling;\n\t\t\twhile (n != null) {\n\t\t\t\tif (n.Role != Roles.Comment)\n\t\t\t\t\treturn n;\n\t\t\t\tn = n.GetPrevNode ();\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the next sibling which fullfills a given predicate\n\t\t/// </summary>\n\t\t/// <returns>The next node.</returns>\n\t\t/// <param name=\"pred\">The predicate.</param>\n\t\tpublic AstNode GetNextSibling (Func<AstNode, bool> pred)\n\t\t{\n\t\t\tvar next = NextSibling;\n\t\t\twhile (next != null && !pred (next))\n\t\t\t\tnext = next.NextSibling;\n\t\t\treturn next;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the next sibling which fullfills a given predicate\n\t\t/// </summary>\n\t\t/// <returns>The next node.</returns>\n\t\t/// <param name=\"pred\">The predicate.</param>\n\t\tpublic AstNode GetPrevSibling (Func<AstNode, bool> pred)\n\t\t{\n\t\t\tvar prev = PrevSibling;\n\t\t\twhile (prev != null && !pred (prev))\n\t\t\t\tprev = prev.PrevSibling;\n\t\t\treturn prev;\n\t\t}\n\t\t\n\t\t#region GetNodeAt\n\t\t/// <summary>\n\t\t/// Gets the node specified by T at the location line, column. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End exclusive)\n\t\t/// </summary>\n\t\tpublic AstNode GetNodeAt (int line, int column, Predicate<AstNode> pred = null)\n\t\t{\n\t\t\treturn GetNodeAt (new TextLocation (line, column), pred);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the node specified by pred at location. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End exclusive)\n\t\t/// </summary>\n\t\tpublic AstNode GetNodeAt (TextLocation location, Predicate<AstNode> pred = null)\n\t\t{\n\t\t\tAstNode result = null;\n\t\t\tAstNode node = this;\n\t\t\twhile (node.LastChild != null) {\n\t\t\t\tvar child = node.LastChild;\n\t\t\t\twhile (child != null && child.StartLocation > location)\n\t\t\t\t\tchild = child.prevSibling;\n\t\t\t\tif (child != null && location < child.EndLocation) {\n\t\t\t\t\tif (pred == null || pred (child))\n\t\t\t\t\t\tresult = child;\n\t\t\t\t\tnode = child;\n\t\t\t\t} else {\n\t\t\t\t\t// found no better child node - therefore the parent is the right one.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the node specified by T at the location line, column. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End exclusive)\n\t\t/// </summary>\n\t\tpublic T GetNodeAt<T> (int line, int column) where T : AstNode\n\t\t{\n\t\t\treturn GetNodeAt<T> (new TextLocation (line, column));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the node specified by T at location. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End exclusive)\n\t\t/// </summary>\n\t\tpublic T GetNodeAt<T> (TextLocation location) where T : AstNode\n\t\t{\n\t\t\tT result = null;\n\t\t\tAstNode node = this;\n\t\t\twhile (node.LastChild != null) {\n\t\t\t\tvar child = node.LastChild;\n\t\t\t\twhile (child != null && child.StartLocation > location)\n\t\t\t\t\tchild = child.prevSibling;\n\t\t\t\tif (child != null && location < child.EndLocation) {\n\t\t\t\t\tif (child is T)\n\t\t\t\t\t\tresult = (T)child;\n\t\t\t\t\tnode = child;\n\t\t\t\t} else {\n\t\t\t\t\t// found no better child node - therefore the parent is the right one.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region GetAdjacentNodeAt\n\t\t/// <summary>\n\t\t/// Gets the node specified by pred at the location line, column. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End inclusive)\n\t\t/// </summary>\n\t\tpublic AstNode GetAdjacentNodeAt(int line, int column, Predicate<AstNode> pred = null)\n\t\t{\n\t\t\treturn GetAdjacentNodeAt (new TextLocation (line, column), pred);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the node specified by pred at location. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End inclusive)\n\t\t/// </summary>\n\t\tpublic AstNode GetAdjacentNodeAt (TextLocation location, Predicate<AstNode> pred = null)\n\t\t{\n\t\t\tAstNode result = null;\n\t\t\tAstNode node = this;\n\t\t\twhile (node.LastChild != null) {\n\t\t\t\tvar child = node.LastChild;\n\t\t\t\twhile (child != null && child.StartLocation > location)\n\t\t\t\t\tchild = child.prevSibling;\n\t\t\t\tif (child != null && location <= child.EndLocation) {\n\t\t\t\t\tif (pred == null || pred (child))\n\t\t\t\t\t\tresult = child;\n\t\t\t\t\tnode = child;\n\t\t\t\t} else {\n\t\t\t\t\t// found no better child node - therefore the parent is the right one.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the node specified by T at the location line, column. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End inclusive)\n\t\t/// </summary>\n\t\tpublic T GetAdjacentNodeAt<T>(int line, int column) where T : AstNode\n\t\t{\n\t\t\treturn GetAdjacentNodeAt<T> (new TextLocation (line, column));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the node specified by T at location. This is useful for getting a specific node from the tree. For example searching\n\t\t/// the current method declaration.\n\t\t/// (End inclusive)\n\t\t/// </summary>\n\t\tpublic T GetAdjacentNodeAt<T> (TextLocation location) where T : AstNode\n\t\t{\n\t\t\tT result = null;\n\t\t\tAstNode node = this;\n\t\t\twhile (node.LastChild != null) {\n\t\t\t\tvar child = node.LastChild;\n\t\t\t\twhile (child != null && child.StartLocation > location)\n\t\t\t\t\tchild = child.prevSibling;\n\t\t\t\tif (child != null && location <= child.EndLocation) {\n\t\t\t\t\tif (child is T)\n\t\t\t\t\t\tresult = (T)child;\n\t\t\t\t\tnode = child;\n\t\t\t\t} else {\n\t\t\t\t\t// found no better child node - therefore the parent is the right one.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\n\n\t\t/// <summary>\n\t\t/// Gets the node that fully contains the range from startLocation to endLocation.\n\t\t/// </summary>\n\t\tpublic AstNode GetNodeContaining(TextLocation startLocation, TextLocation endLocation)\n\t\t{\n\t\t\tfor (AstNode child = firstChild; child != null; child = child.nextSibling) {\n\t\t\t\tif (child.StartLocation <= startLocation && endLocation <= child.EndLocation)\n\t\t\t\t\treturn child.GetNodeContaining(startLocation, endLocation);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the root nodes of all subtrees that are fully contained in the specified region.\n\t\t/// </summary>\n\t\tpublic IEnumerable<AstNode> GetNodesBetween (int startLine, int startColumn, int endLine, int endColumn)\n\t\t{\n\t\t\treturn GetNodesBetween (new TextLocation (startLine, startColumn), new TextLocation (endLine, endColumn));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the root nodes of all subtrees that are fully contained between <paramref name=\"start\"/> and <paramref name=\"end\"/> (inclusive).\n\t\t/// </summary>\n\t\tpublic IEnumerable<AstNode> GetNodesBetween (TextLocation start, TextLocation end)\n\t\t{\n\t\t\tAstNode node = this;\n\t\t\twhile (node != null) {\n\t\t\t\tAstNode next;\n\t\t\t\tif (start <= node.StartLocation && node.EndLocation <= end) {\n\t\t\t\t\t// Remember next before yielding node.\n\t\t\t\t\t// This allows iteration to continue when the caller removes/replaces the node.\n\t\t\t\t\tnext = node.GetNextNode();\n\t\t\t\t\tyield return node;\n\t\t\t\t} else {\n\t\t\t\t\tif (node.EndLocation <= start) {\n\t\t\t\t\t\tnext = node.GetNextNode();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnext = node.FirstChild;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (next != null && next.StartLocation > end)\n\t\t\t\t\tyield break;\n\t\t\t\tnode = next;\n\t\t\t}\n\t\t}\n\t\t[Obsolete(\"Use ToString(options).\")]\n\t\tpublic string GetText (CSharpFormattingOptions formattingOptions = null)\n\t\t{\n\t\t\treturn ToString(formattingOptions);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the node as formatted C# output.\n\t\t/// </summary>\n\t\t/// <param name='formattingOptions'>\n\t\t/// Formatting options.\n\t\t/// </param>\n\t\tpublic virtual string ToString (CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\tif (IsNull)\n\t\t\t\treturn \"\";\n\t\t\tvar w = new StringWriter ();\n\t\t\tAcceptVisitor (new CSharpOutputVisitor (w, formattingOptions ?? FormattingOptionsFactory.CreateMono ()));\n\t\t\treturn w.ToString ();\n\t\t}\n\n\t\tpublic sealed override string ToString()\n\t\t{\n\t\t\treturn ToString(null);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true, if the given coordinates (line, column) are in the node.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// True, if the given coordinates are between StartLocation and EndLocation (exclusive); otherwise, false.\n\t\t/// </returns>\n\t\tpublic bool Contains (int line, int column)\n\t\t{\n\t\t\treturn Contains (new TextLocation (line, column));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns true, if the given coordinates are in the node.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// True, if location is between StartLocation and EndLocation (exclusive); otherwise, false.\n\t\t/// </returns>\n\t\tpublic bool Contains (TextLocation location)\n\t\t{\n\t\t\treturn this.StartLocation <= location && location < this.EndLocation;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns true, if the given coordinates (line, column) are in the node.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// True, if the given coordinates are between StartLocation and EndLocation (inclusive); otherwise, false.\n\t\t/// </returns>\n\t\tpublic bool IsInside (int line, int column)\n\t\t{\n\t\t\treturn IsInside (new TextLocation (line, column));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns true, if the given coordinates are in the node.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// True, if location is between StartLocation and EndLocation (inclusive); otherwise, false.\n\t\t/// </returns>\n\t\tpublic bool IsInside (TextLocation location)\n\t\t{\n\t\t\treturn this.StartLocation <= location && location <= this.EndLocation;\n\t\t}\n\t\t\n\t\tpublic override void AddAnnotation (object annotation)\n\t\t{\n\t\t\tif (this.IsNull)\n\t\t\t\tthrow new InvalidOperationException (\"Cannot add annotations to the null node\");\n\t\t\tbase.AddAnnotation (annotation);\n\t\t}\n\t\t\n\t\tinternal string DebugToString()\n\t\t{\n\t\t\tif (IsNull)\n\t\t\t\treturn \"Null\";\n\t\t\tstring text = ToString();\n\t\t\ttext = text.TrimEnd().Replace(\"\\t\", \"\").Replace(Environment.NewLine, \" \");\n\t\t\tif (text.Length > 100)\n\t\t\t\treturn text.Substring(0, 97) + \"...\";\n\t\t\telse\n\t\t\t\treturn text;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNodeCollection.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Represents the children of an AstNode that have a specific role.\n\t/// </summary>\n\tpublic class AstNodeCollection<T> : ICollection<T>\n\t\t#if NET_4_5\n\t\t, IReadOnlyCollection<T>\n\t\t#endif\n\t\twhere T : AstNode\n\t{\n\t\treadonly AstNode node;\n\t\treadonly Role<T> role;\n\t\t\n\t\tpublic AstNodeCollection(AstNode node, Role<T> role)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\tif (role == null)\n\t\t\t\tthrow new ArgumentNullException(\"role\");\n\t\t\tthis.node = node;\n\t\t\tthis.role = role;\n\t\t}\n\t\t\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\tint count = 0;\n\t\t\t\tuint roleIndex = role.Index;\n\t\t\t\tfor (AstNode cur = node.FirstChild; cur != null; cur = cur.NextSibling) {\n\t\t\t\t\tif (cur.RoleIndex == roleIndex)\n\t\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void Add(T element)\n\t\t{\n\t\t\tnode.AddChild(element, role);\n\t\t}\n\t\t\n\t\tpublic void AddRange(IEnumerable<T> nodes)\n\t\t{\n\t\t\t// Evaluate 'nodes' first, since it might change when we add the new children\n\t\t\t// Example: collection.AddRange(collection);\n\t\t\tif (nodes != null) {\n\t\t\t\tforeach (T node in nodes.ToList())\n\t\t\t\t\tAdd(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void AddRange(T[] nodes)\n\t\t{\n\t\t\t// Fast overload for arrays - we don't need to create a copy\n\t\t\tif (nodes != null) {\n\t\t\t\tforeach (T node in nodes)\n\t\t\t\t\tAdd(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void ReplaceWith(IEnumerable<T> nodes)\n\t\t{\n\t\t\t// Evaluate 'nodes' first, since it might change when we call Clear()\n\t\t\t// Example: collection.ReplaceWith(collection);\n\t\t\tif (nodes != null)\n\t\t\t\tnodes = nodes.ToList();\n\t\t\tClear();\n\t\t\tif (nodes != null) {\n\t\t\t\tforeach (T node in nodes)\n\t\t\t\t\tAdd(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void MoveTo(ICollection<T> targetCollection)\n\t\t{\n\t\t\tif (targetCollection == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetCollection\");\n\t\t\tforeach (T node in this) {\n\t\t\t\tnode.Remove();\n\t\t\t\ttargetCollection.Add(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool Contains(T element)\n\t\t{\n\t\t\treturn element != null && element.Parent == node && element.RoleIndex == role.Index;\n\t\t}\n\t\t\n\t\tpublic bool Remove(T element)\n\t\t{\n\t\t\tif (Contains(element)) {\n\t\t\t\telement.Remove();\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void CopyTo(T[] array, int arrayIndex)\n\t\t{\n\t\t\tforeach (T item in this)\n\t\t\t\tarray[arrayIndex++] = item;\n\t\t}\n\t\t\n\t\tpublic void Clear()\n\t\t{\n\t\t\tforeach (T item in this)\n\t\t\t\titem.Remove();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the first element for which the predicate returns true,\n\t\t/// or the null node (AstNode with IsNull=true) if no such object is found.\n\t\t/// </summary>\n\t\tpublic T FirstOrNullObject(Func<T, bool> predicate = null)\n\t\t{\n\t\t\tforeach (T item in this)\n\t\t\t\tif (predicate == null || predicate(item))\n\t\t\t\t\treturn item;\n\t\t\treturn role.NullObject;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the last element for which the predicate returns true,\n\t\t/// or the null node (AstNode with IsNull=true) if no such object is found.\n\t\t/// </summary>\n\t\tpublic T LastOrNullObject(Func<T, bool> predicate = null)\n\t\t{\n\t\t\tT result = role.NullObject;\n\t\t\tforeach (T item in this)\n\t\t\t\tif (predicate == null || predicate(item))\n\t\t\t\t\tresult = item;\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tbool ICollection<T>.IsReadOnly {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\tuint roleIndex = role.Index;\n\t\t\tAstNode next;\n\t\t\tfor (AstNode cur = node.FirstChild; cur != null; cur = next) {\n\t\t\t\tDebug.Assert(cur.Parent == node);\n\t\t\t\t// Remember next before yielding cur.\n\t\t\t\t// This allows removing/replacing nodes while iterating through the list.\n\t\t\t\tnext = cur.NextSibling;\n\t\t\t\tif (cur.RoleIndex == roleIndex)\n\t\t\t\t\tyield return (T)cur;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\t\t\n\t\t#region Equals and GetHashCode implementation\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn node.GetHashCode() ^ role.GetHashCode();\n\t\t}\n\t\t\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tAstNodeCollection<T> other = obj as AstNodeCollection<T>;\n\t\t\tif (other == null)\n\t\t\t\treturn false;\n\t\t\treturn this.node == other.node && this.role == other.role;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tinternal bool DoMatch(AstNodeCollection<T> other, Match match)\n\t\t{\n\t\t\treturn Pattern.DoMatchCollection(role, node.FirstChild, other.node.FirstChild, match);\n\t\t}\n\t\t\n\t\tpublic void InsertAfter(T existingItem, T newItem)\n\t\t{\n\t\t\tnode.InsertChildAfter(existingItem, newItem, role);\n\t\t}\n\t\t\n\t\tpublic void InsertBefore(T existingItem, T newItem)\n\t\t{\n\t\t\tnode.InsertChildBefore(existingItem, newItem, role);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Applies the <paramref name=\"visitor\"/> to all nodes in this collection.\n\t\t/// </summary>\n\t\tpublic void AcceptVisitor(IAstVisitor visitor)\n\t\t{\n\t\t\tuint roleIndex = role.Index;\n\t\t\tAstNode next;\n\t\t\tfor (AstNode cur = node.FirstChild; cur != null; cur = next) {\n\t\t\t\tDebug.Assert(cur.Parent == node);\n\t\t\t\t// Remember next before yielding cur.\n\t\t\t\t// This allows removing/replacing nodes while iterating through the list.\n\t\t\t\tnext = cur.NextSibling;\n\t\t\t\tif (cur.RoleIndex == roleIndex)\n\t\t\t\t\tcur.AcceptVisitor(visitor);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// A type reference in the C# AST.\n\t/// </summary>\n\tpublic abstract class AstType : AstNode\n\t{\n\t\t#region Null\n\t\tpublic new static readonly AstType Null = new NullAstType ();\n\t\t\n\t\tsealed class NullAstType : AstType\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider)\n\t\t\t{\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator AstType(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : AstType, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder (this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.TypeReference; }\n\t\t}\n\t\t\n\t\tpublic new AstType Clone()\n\t\t{\n\t\t\treturn (AstType)base.Clone();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this type is a SimpleType \"var\".\n\t\t/// </summary>\n\t\tpublic bool IsVar()\n\t\t{\n\t\t\tSimpleType st = this as SimpleType;\n\t\t\treturn st != null && st.Identifier == \"var\" && st.TypeArguments.Count == 0;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Create an ITypeReference for this AstType.\n\t\t/// Uses the context (ancestors of this node) to determine the correct <see cref=\"NameLookupMode\"/>.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// The resulting type reference will read the context information from the\n\t\t/// <see cref=\"ITypeResolveContext\"/>:\n\t\t/// For resolving type parameters, the CurrentTypeDefinition/CurrentMember is used.\n\t\t/// For resolving simple names, the current namespace and usings from the CurrentUsingScope\n\t\t/// (on CSharpTypeResolveContext only) is used.\n\t\t/// </remarks>\n\t\tpublic ITypeReference ToTypeReference(InterningProvider interningProvider = null)\n\t\t{\n\t\t\treturn ToTypeReference(GetNameLookupMode(), interningProvider);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Create an ITypeReference for this AstType.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// The resulting type reference will read the context information from the\n\t\t/// <see cref=\"ITypeResolveContext\"/>:\n\t\t/// For resolving type parameters, the CurrentTypeDefinition/CurrentMember is used.\n\t\t/// For resolving simple names, the current namespace and usings from the CurrentUsingScope\n\t\t/// (on CSharpTypeResolveContext only) is used.\n\t\t/// </remarks>\n\t\tpublic abstract ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name lookup mode from the context (looking at the ancestors of this <see cref=\"AstType\"/>).\n\t\t/// </summary>\n\t\tpublic NameLookupMode GetNameLookupMode()\n\t\t{\n\t\t\tAstType outermostType = this;\n\t\t\twhile (outermostType.Parent is AstType)\n\t\t\t\toutermostType = (AstType)outermostType.Parent;\n\t\t\t\n\t\t\tif (outermostType.Parent is UsingDeclaration || outermostType.Parent is UsingAliasDeclaration) {\n\t\t\t\treturn NameLookupMode.TypeInUsingDeclaration;\n\t\t\t} else if (outermostType.Role == Roles.BaseType) {\n\t\t\t\t// Use BaseTypeReference for a type's base type, and for a constraint on a type.\n\t\t\t\t// Do not use it for a constraint on a method.\n\t\t\t\tif (outermostType.Parent is TypeDeclaration || (outermostType.Parent is Constraint && outermostType.Parent.Parent is TypeDeclaration))\n\t\t\t\t\treturn NameLookupMode.BaseTypeReference;\n\t\t\t}\n\t\t\treturn NameLookupMode.Type;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a pointer type from this type by nesting it in a <see cref=\"ComposedType\"/>.\n\t\t/// If this type already is a pointer type, this method just increases the PointerRank of the existing pointer type.\n\t\t/// </summary>\n\t\tpublic virtual AstType MakePointerType()\n\t\t{\n\t\t\treturn new ComposedType { BaseType = this }.MakePointerType();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an array type from this type by nesting it in a <see cref=\"ComposedType\"/>.\n\t\t/// If this type already is an array type, the additional rank is prepended to the existing array specifier list.\n\t\t/// Thus, <c>new SimpleType(\"T\").MakeArrayType(1).MakeArrayType(2)</c> will result in \"T[,][]\".\n\t\t/// </summary>\n\t\tpublic virtual AstType MakeArrayType(int rank = 1)\n\t\t{\n\t\t\treturn new ComposedType { BaseType = this }.MakeArrayType(rank);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a nullable type from this type by nesting it in a <see cref=\"ComposedType\"/>.\n\t\t/// </summary>\n\t\tpublic AstType MakeNullableType()\n\t\t{\n\t\t\treturn new ComposedType { BaseType = this, HasNullableSpecifier = true };\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an expression that can be used to access a static member on this type.\n\t\t/// </summary>\n\t\tpublic MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new TypeReferenceExpression { Type = this }.Member(memberName);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an expression that can be used to access a static member on this type.\n\t\t/// </summary>\n\t\tpublic MemberType MemberType(string memberName, params AstType[] typeArguments)\n\t\t{\n\t\t\tvar memberType = new MemberType(this, memberName);\n\t\t\tmemberType.TypeArguments.AddRange(typeArguments);\n\t\t\treturn memberType;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an expression that can be used to access a static member on this type.\n\t\t/// </summary>\n\t\tpublic MemberType MemberType(string memberName, IEnumerable<AstType> typeArguments)\n\t\t{\n\t\t\tvar memberType = new MemberType(this, memberName);\n\t\t\tmemberType.TypeArguments.AddRange(typeArguments);\n\t\t\treturn memberType;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this type as target.\n\t\t/// </summary>\n\t\tpublic InvocationExpression Invoke(string methodName, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\treturn new TypeReferenceExpression { Type = this }.Invoke(methodName, arguments);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this type as target.\n\t\t/// </summary>\n\t\tpublic InvocationExpression Invoke(string methodName, params Expression[] arguments)\n\t\t{\n\t\t\treturn new TypeReferenceExpression { Type = this }.Invoke(methodName, arguments);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this type as target.\n\t\t/// </summary>\n\t\tpublic InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\treturn new TypeReferenceExpression { Type = this }.Invoke(methodName, typeArguments, arguments);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a simple AstType from a dotted name.\n\t\t/// Does not support generics, arrays, etc. - just simple dotted names,\n\t\t/// e.g. namespace names.\n\t\t/// </summary>\n\t\tpublic static AstType Create(string dottedName)\n\t\t{\n\t\t\tstring[] parts = dottedName.Split('.');\n\t\t\tAstType type = new SimpleType(parts[0]);\n\t\t\tfor (int i = 1; i < parts.Length; i++) {\n\t\t\t\ttype = new MemberType(type, parts[i]);\n\t\t\t}\n\t\t\treturn type;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpModifierToken.cs",
    "content": "﻿// \n// CSharpModifierToken.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class CSharpModifierToken : CSharpTokenNode\n\t{\n\t\tModifiers modifier;\n\t\t\n\t\tpublic Modifiers Modifier {\n\t\t\tget { return modifier; }\n\t\t\tset { \n\t\t\t\tThrowIfFrozen();\n\t\t\t\tthis.modifier = value; \n\t\t\t}\n\t\t}\n\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (StartLocation.Line, StartLocation.Column + GetModifierLength (Modifier));\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\treturn GetModifierName (Modifier);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCSharpModifierToken o = other as CSharpModifierToken;\n\t\t\treturn o != null && this.modifier == o.modifier;\n\t\t}\n\t\t\n\t\t// Not worth using a dictionary for such few elements.\n\t\t// This table is sorted in the order that modifiers should be output when generating code.\n\t\tstatic readonly Modifiers[] allModifiers = {\n\t\t\tModifiers.Public, Modifiers.Protected, Modifiers.Private, Modifiers.Internal,\n\t\t\tModifiers.New,\n\t\t\tModifiers.Unsafe,\n\t\t\tModifiers.Abstract, Modifiers.Virtual, Modifiers.Sealed, Modifiers.Static, Modifiers.Override,\n\t\t\tModifiers.Readonly, Modifiers.Volatile,\n\t\t\tModifiers.Extern, Modifiers.Partial, Modifiers.Const,\n\t\t\tModifiers.Async,\n\t\t\tModifiers.Any\n\t\t};\n\t\t\n\t\tpublic static IEnumerable<Modifiers> AllModifiers {\n\t\t\tget { return allModifiers; }\n\t\t}\n\t\t\n\t\tpublic CSharpModifierToken (TextLocation location, Modifiers modifier) : base (location, null)\n\t\t{\n\t\t\tthis.Modifier = modifier;\n\t\t}\n\t\t\n\t\tpublic static string GetModifierName(Modifiers modifier)\n\t\t{\n\t\t\tswitch (modifier) {\n\t\t\t\tcase Modifiers.Private:\n\t\t\t\t\treturn \"private\";\n\t\t\t\tcase Modifiers.Internal:\n\t\t\t\t\treturn \"internal\";\n\t\t\t\tcase Modifiers.Protected:\n\t\t\t\t\treturn \"protected\";\n\t\t\t\tcase Modifiers.Public:\n\t\t\t\t\treturn \"public\";\n\t\t\t\tcase Modifiers.Abstract:\n\t\t\t\t\treturn \"abstract\";\n\t\t\t\tcase Modifiers.Virtual:\n\t\t\t\t\treturn \"virtual\";\n\t\t\t\tcase Modifiers.Sealed:\n\t\t\t\t\treturn \"sealed\";\n\t\t\t\tcase Modifiers.Static:\n\t\t\t\t\treturn \"static\";\n\t\t\t\tcase Modifiers.Override:\n\t\t\t\t\treturn \"override\";\n\t\t\t\tcase Modifiers.Readonly:\n\t\t\t\t\treturn \"readonly\";\n\t\t\t\tcase Modifiers.Const:\n\t\t\t\t\treturn \"const\";\n\t\t\t\tcase Modifiers.New:\n\t\t\t\t\treturn \"new\";\n\t\t\t\tcase Modifiers.Partial:\n\t\t\t\t\treturn \"partial\";\n\t\t\t\tcase Modifiers.Extern:\n\t\t\t\t\treturn \"extern\";\n\t\t\t\tcase Modifiers.Volatile:\n\t\t\t\t\treturn \"volatile\";\n\t\t\t\tcase Modifiers.Unsafe:\n\t\t\t\t\treturn \"unsafe\";\n\t\t\t\tcase Modifiers.Async:\n\t\t\t\t\treturn \"async\";\n\t\t\t\tcase Modifiers.Any:\n\t\t\t\t\t// even though it's used for pattern matching only, 'any' needs to be in this list to be usable in the AST\n\t\t\t\t\treturn \"any\";\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for Modifiers\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static int GetModifierLength(Modifiers modifier)\n\t\t{\n\t\t\tswitch (modifier) {\n\t\t\t\tcase Modifiers.Private:\n\t\t\t\t\treturn \"private\".Length;\n\t\t\t\tcase Modifiers.Internal:\n\t\t\t\t\treturn \"internal\".Length;\n\t\t\t\tcase Modifiers.Protected:\n\t\t\t\t\treturn \"protected\".Length;\n\t\t\t\tcase Modifiers.Public:\n\t\t\t\t\treturn \"public\".Length;\n\t\t\t\tcase Modifiers.Abstract:\n\t\t\t\t\treturn \"abstract\".Length;\n\t\t\t\tcase Modifiers.Virtual:\n\t\t\t\t\treturn \"virtual\".Length;\n\t\t\t\tcase Modifiers.Sealed:\n\t\t\t\t\treturn \"sealed\".Length;\n\t\t\t\tcase Modifiers.Static:\n\t\t\t\t\treturn \"static\".Length;\n\t\t\t\tcase Modifiers.Override:\n\t\t\t\t\treturn \"override\".Length;\n\t\t\t\tcase Modifiers.Readonly:\n\t\t\t\t\treturn \"readonly\".Length;\n\t\t\t\tcase Modifiers.Const:\n\t\t\t\t\treturn \"const\".Length;\n\t\t\t\tcase Modifiers.New:\n\t\t\t\t\treturn \"new\".Length;\n\t\t\t\tcase Modifiers.Partial:\n\t\t\t\t\treturn \"partial\".Length;\n\t\t\t\tcase Modifiers.Extern:\n\t\t\t\t\treturn \"extern\".Length;\n\t\t\t\tcase Modifiers.Volatile:\n\t\t\t\t\treturn \"volatile\".Length;\n\t\t\t\tcase Modifiers.Unsafe:\n\t\t\t\t\treturn \"unsafe\".Length;\n\t\t\t\tcase Modifiers.Async:\n\t\t\t\t\treturn \"async\".Length;\n\t\t\t\tcase Modifiers.Any:\n\t\t\t\t\t// even though it's used for pattern matching only, 'any' needs to be in this list to be usable in the AST\n\t\t\t\t\treturn \"any\".Length;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for Modifiers\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static Modifiers GetModifierValue(string modifier)\n\t\t{\n\t\t\tswitch (modifier) {\n\t\t\t\tcase \"private\":\n\t\t\t\t\treturn Modifiers.Private;\n\t\t\t\tcase \"internal\":\n\t\t\t\t\treturn Modifiers.Internal;\n\t\t\t\tcase \"protected\":\n\t\t\t\t\treturn Modifiers.Protected;\n\t\t\t\tcase \"public\":\n\t\t\t\t\treturn Modifiers.Public;\n\t\t\t\tcase \"abstract\":\n\t\t\t\t\treturn Modifiers.Abstract;\n\t\t\t\tcase \"virtual\":\n\t\t\t\t\treturn Modifiers.Virtual;\n\t\t\t\tcase \"sealed\":\n\t\t\t\t\treturn Modifiers.Sealed;\n\t\t\t\tcase \"static\":\n\t\t\t\t\treturn Modifiers.Static;\n\t\t\t\tcase \"override\":\n\t\t\t\t\treturn Modifiers.Override;\n\t\t\t\tcase \"readonly\":\n\t\t\t\t\treturn Modifiers.Readonly;\n\t\t\t\tcase \"const\":\n\t\t\t\t\treturn Modifiers.Const;\n\t\t\t\tcase \"new\":\n\t\t\t\t\treturn Modifiers.New;\n\t\t\t\tcase \"partial\":\n\t\t\t\t\treturn Modifiers.Partial;\n\t\t\t\tcase \"extern\":\n\t\t\t\t\treturn Modifiers.Extern;\n\t\t\t\tcase \"volatile\":\n\t\t\t\t\treturn Modifiers.Volatile;\n\t\t\t\tcase \"unsafe\":\n\t\t\t\t\treturn Modifiers.Unsafe;\n\t\t\t\tcase \"async\":\n\t\t\t\t\treturn Modifiers.Async;\n\t\t\t\tcase \"any\":\n\t\t\t\t\t// even though it's used for pattern matching only, 'any' needs to be in this list to be usable in the AST\n\t\t\t\t\treturn Modifiers.Any;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for Modifiers\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs",
    "content": "﻿// \n// TokenNode.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Represents a token in C#. Note that the type of the token is defined through the TokenRole.\n\t/// </summary>\n\t/// <remarks>\n\t/// In all non null c# token nodes the Role of a CSharpToken must be a TokenRole.\n\t/// </remarks>\n\tpublic class CSharpTokenNode : AstNode\n\t{\n\t\tpublic static new readonly CSharpTokenNode Null = new NullCSharpTokenNode ();\n\t\tclass NullCSharpTokenNode : CSharpTokenNode\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic NullCSharpTokenNode () : base (TextLocation.Empty, null)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Token;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\n\t\tint TokenLength {\n\t\t\tget {\n\t\t\t\treturn TokenRole.TokenLengths [(int)(this.flags >> AstNodeFlagsUsedBits)];\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (StartLocation.Line, StartLocation.Column + TokenLength);\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode (TextLocation location, TokenRole role)\n\t\t{\n\t\t\tthis.startLocation = location;\n\t\t\tif (role != null)\n\t\t\t\tthis.flags |= role.TokenIndex << AstNodeFlagsUsedBits;\n\t\t}\n\n\t\tpublic override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\treturn TokenRole.Tokens [(int)(this.flags >> AstNodeFlagsUsedBits)];\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitCSharpTokenNode (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitCSharpTokenNode (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitCSharpTokenNode (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCSharpTokenNode o = other as CSharpTokenNode;\n\t\t\treturn o != null && !o.IsNull && !(o is CSharpModifierToken);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpUtil.cs",
    "content": "// \n// CSharpUtil.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic static class CSharpUtil\n\t{\n\t\t/// <summary>\n\t\t/// Inverts a boolean condition. Note: The condition object can be frozen (from AST) it's cloned internally.\n\t\t/// </summary>\n\t\t/// <param name=\"condition\">The condition to invert.</param>\n\t\tpublic static Expression InvertCondition(Expression condition)\n\t\t{\n\t\t\treturn InvertConditionInternal(condition);\n\t\t}\n\t\t\n\t\tstatic Expression InvertConditionInternal(Expression condition)\n\t\t{\n\t\t\tif (condition is ParenthesizedExpression) {\n\t\t\t\treturn new ParenthesizedExpression(InvertCondition(((ParenthesizedExpression)condition).Expression));\n\t\t\t}\n\t\t\t\n\t\t\tif (condition is UnaryOperatorExpression) {\n\t\t\t\tvar uOp = (UnaryOperatorExpression)condition;\n\t\t\t\tif (uOp.Operator == UnaryOperatorType.Not) {\n\t\t\t\t\tif (!(uOp.Parent is Expression))\n\t\t\t\t\t\treturn GetInnerMostExpression(uOp.Expression).Clone();\n\t\t\t\t\treturn uOp.Expression.Clone();\n\t\t\t\t}\n\t\t\t\treturn new UnaryOperatorExpression(UnaryOperatorType.Not, uOp.Clone());\n\t\t\t}\n\t\t\t\n\t\t\tif (condition is BinaryOperatorExpression) {\n\t\t\t\tvar bOp = (BinaryOperatorExpression)condition;\n\n\t\t\t\tif ((bOp.Operator == BinaryOperatorType.ConditionalAnd) || (bOp.Operator == BinaryOperatorType.ConditionalOr)) {\n\t\t\t\t\treturn new BinaryOperatorExpression(InvertCondition(bOp.Left), NegateConditionOperator(bOp.Operator), InvertCondition(bOp.Right));\n\t\t\t\t} else if ((bOp.Operator == BinaryOperatorType.Equality) || (bOp.Operator == BinaryOperatorType.InEquality) || (bOp.Operator == BinaryOperatorType.GreaterThan)\n\t\t\t\t\t|| (bOp.Operator == BinaryOperatorType.GreaterThanOrEqual) || (bOp.Operator == BinaryOperatorType.LessThan) || \n\t\t\t\t\t(bOp.Operator == BinaryOperatorType.LessThanOrEqual)) {\n\t\t\t\t\treturn new BinaryOperatorExpression(bOp.Left.Clone(), NegateRelationalOperator(bOp.Operator), bOp.Right.Clone());\n\t\t\t\t} else {\n\t\t\t\t\tvar negatedOp = NegateRelationalOperator(bOp.Operator);\n\t\t\t\t\tif (negatedOp == BinaryOperatorType.Any)\n\t\t\t\t\t\treturn new UnaryOperatorExpression(UnaryOperatorType.Not, new ParenthesizedExpression(condition.Clone()));\n\t\t\t\t\tbOp = (BinaryOperatorExpression)bOp.Clone();\n\t\t\t\t\tbOp.Operator = negatedOp;\n\t\t\t\t\treturn bOp;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (condition is ConditionalExpression) {\n\t\t\t\tvar cEx = condition.Clone() as ConditionalExpression;\n\t\t\t\tcEx.Condition = InvertCondition(cEx.Condition);\n\t\t\t\treturn cEx;\n\t\t\t}\n\t\t\tif (condition is PrimitiveExpression) {\n\t\t\t\tvar pex = condition as PrimitiveExpression;\n\t\t\t\tif (pex.Value is bool) {\n\t\t\t\t\treturn new PrimitiveExpression(!((bool)pex.Value)); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn new UnaryOperatorExpression(UnaryOperatorType.Not, AddParensForUnaryExpressionIfRequired(condition.Clone()));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When negating an expression this is required, otherwise you would end up with\n\t\t/// a or b -> !a or b\n\t\t/// </summary>\n\t\tinternal static Expression AddParensForUnaryExpressionIfRequired(Expression expression)\n\t\t{\n\t\t\tif ((expression is BinaryOperatorExpression) ||\n\t\t\t    (expression is AssignmentExpression) ||\n\t\t\t    (expression is CastExpression) ||\n\t\t\t    (expression is AsExpression) ||\n\t\t\t    (expression is IsExpression) ||\n\t\t\t    (expression is LambdaExpression) ||\n\t\t\t    (expression is ConditionalExpression)) {\n\t\t\t\treturn new ParenthesizedExpression(expression);\n\t\t\t}\n\n\t\t\treturn expression;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get negation of the specified relational operator\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// negation of the specified relational operator, or BinaryOperatorType.Any if it's not a relational operator\n\t\t/// </returns>\n\t\tpublic static BinaryOperatorType NegateRelationalOperator(BinaryOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\treturn BinaryOperatorType.LessThanOrEqual;\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\treturn BinaryOperatorType.LessThan;\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\t\treturn BinaryOperatorType.InEquality;\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\treturn BinaryOperatorType.Equality;\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\treturn BinaryOperatorType.GreaterThanOrEqual;\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\treturn BinaryOperatorType.GreaterThan;\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\treturn BinaryOperatorType.ConditionalAnd;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\treturn BinaryOperatorType.ConditionalOr;\n\t\t\t}\n\t\t\treturn BinaryOperatorType.Any;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true, if the specified operator is a relational operator\n\t\t/// </summary>\n\t\tpublic static bool IsRelationalOperator(BinaryOperatorType op)\n\t\t{\n\t\t\treturn NegateRelationalOperator(op) != BinaryOperatorType.Any;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get negation of the condition operator\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// negation of the specified condition operator, or BinaryOperatorType.Any if it's not a condition operator\n\t\t/// </returns>\n\t\tpublic static BinaryOperatorType NegateConditionOperator(BinaryOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\treturn BinaryOperatorType.ConditionalAnd;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\treturn BinaryOperatorType.ConditionalOr;\n\t\t\t}\n\t\t\treturn BinaryOperatorType.Any;\n\t\t}\n\n\t\tpublic static bool AreConditionsEqual(Expression cond1, Expression cond2)\n\t\t{\n\t\t\tif (cond1 == null || cond2 == null)\n\t\t\t\treturn false;\n\t\t\treturn GetInnerMostExpression(cond1).IsMatch(GetInnerMostExpression(cond2));\n\t\t}\n\n\t\tpublic static Expression GetInnerMostExpression(Expression target)\n\t\t{\n\t\t\twhile (target is ParenthesizedExpression)\n\t\t\t\ttarget = ((ParenthesizedExpression)target).Expression;\n\t\t\treturn target;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs",
    "content": "﻿// \n// ComposedType.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class ComposedType : AstType\n\t{\n\t\tpublic static readonly TokenRole NullableRole = new TokenRole(\"?\");\n\t\tpublic static readonly TokenRole PointerRole = new TokenRole(\"*\");\n\t\tpublic static readonly Role<ArraySpecifier> ArraySpecifierRole = new Role<ArraySpecifier>(\"ArraySpecifier\");\n\t\t\n\t\tpublic AstType BaseType {\n\t\t\tget { return GetChildByRole(Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic bool HasNullableSpecifier {\n\t\t\tget {\n\t\t\t\treturn !GetChildByRole(NullableRole).IsNull;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(NullableRole, value ? new CSharpTokenNode(TextLocation.Empty, null) : null);\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode NullableSpecifierToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole(NullableRole);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int PointerRank {\n\t\t\tget {\n\t\t\t\treturn GetChildrenByRole(PointerRole).Count;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value < 0)\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t\tint d = this.PointerRank;\n\t\t\t\twhile (d > value) {\n\t\t\t\t\tGetChildByRole(PointerRole).Remove();\n\t\t\t\t\td--;\n\t\t\t\t}\n\t\t\t\twhile (d < value) {\n\t\t\t\t\tInsertChildBefore(GetChildByRole(PointerRole), new CSharpTokenNode(TextLocation.Empty, PointerRole), PointerRole);\n\t\t\t\t\td++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ArraySpecifier> ArraySpecifiers {\n\t\t\tget { return GetChildrenByRole (ArraySpecifierRole); }\n\t\t}\n\n\t\tpublic AstNodeCollection<CSharpTokenNode> PointerTokens {\n\t\t\tget { return GetChildrenByRole (PointerRole); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitComposedType (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitComposedType (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitComposedType (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tComposedType o = other as ComposedType;\n\t\t\treturn o != null && this.HasNullableSpecifier == o.HasNullableSpecifier && this.PointerRank == o.PointerRank\n\t\t\t\t&& this.BaseType.DoMatch(o.BaseType, match)\n\t\t\t\t&& this.ArraySpecifiers.DoMatch(o.ArraySpecifiers, match);\n\t\t}\n\n\t\tpublic override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tb.Append(this.BaseType.ToString());\n\t\t\tif (this.HasNullableSpecifier)\n\t\t\t\tb.Append('?');\n\t\t\tb.Append('*', this.PointerRank);\n\t\t\tforeach (var arraySpecifier in this.ArraySpecifiers) {\n\t\t\t\tb.Append('[');\n\t\t\t\tb.Append(',', arraySpecifier.Dimensions - 1);\n\t\t\t\tb.Append(']');\n\t\t\t}\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tpublic override AstType MakePointerType()\n\t\t{\n\t\t\tif (ArraySpecifiers.Any()) {\n\t\t\t\treturn base.MakePointerType();\n\t\t\t} else {\n\t\t\t\tthis.PointerRank++;\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override AstType MakeArrayType(int dimensions)\n\t\t{\n\t\t\tInsertChildBefore(this.ArraySpecifiers.FirstOrDefault(), new ArraySpecifier(dimensions), ArraySpecifierRole);\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null)\n\t\t{\n\t\t\tif (interningProvider == null)\n\t\t\t\tinterningProvider = InterningProvider.Dummy;\n\t\t\tITypeReference t = this.BaseType.ToTypeReference(lookupMode, interningProvider);\n\t\t\tif (this.HasNullableSpecifier) {\n\t\t\t\tt = interningProvider.Intern(NullableType.Create(t));\n\t\t\t}\n\t\t\tint pointerRank = this.PointerRank;\n\t\t\tfor (int i = 0; i < pointerRank; i++) {\n\t\t\t\tt = interningProvider.Intern(new PointerTypeReference(t));\n\t\t\t}\n\t\t\tforeach (var a in this.ArraySpecifiers.Reverse()) {\n\t\t\t\tt = interningProvider.Intern(new ArrayTypeReference(t, a.Dimensions));\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// [,,,]\n\t/// </summary>\n\tpublic class ArraySpecifier : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ArraySpecifier()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ArraySpecifier(int dimensions)\n\t\t{\n\t\t\tthis.Dimensions = dimensions;\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBracketToken {\n\t\t\tget { return GetChildByRole (Roles.LBracket); }\n\t\t}\n\t\t\n\t\tpublic int Dimensions {\n\t\t\tget { return 1 + GetChildrenByRole(Roles.Comma).Count; }\n\t\t\tset {\n\t\t\t\tint d = this.Dimensions;\n\t\t\t\twhile (d > value) {\n\t\t\t\t\tGetChildByRole(Roles.Comma).Remove();\n\t\t\t\t\td--;\n\t\t\t\t}\n\t\t\t\twhile (d < value) {\n\t\t\t\t\tInsertChildBefore(GetChildByRole(Roles.Comma), new CSharpTokenNode(TextLocation.Empty, Roles.Comma), Roles.Comma);\n\t\t\t\t\td++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBracketToken {\n\t\t\tget { return GetChildByRole (Roles.RBracket); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitArraySpecifier (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitArraySpecifier (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitArraySpecifier(this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tArraySpecifier o = other as ArraySpecifier;\n\t\t\treturn o != null && this.Dimensions == o.Dimensions;\n\t\t}\n\n\t\tpublic override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\treturn \"[\" + new string(',', this.Dimensions - 1) + \"]\";\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs",
    "content": "﻿// \n// IAstVisitor.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// AST visitor with a default implementation that visits all node depth-first.\n\t/// </summary>\n\tpublic abstract class DepthFirstAstVisitor : IAstVisitor\n\t{\n\t\tprotected virtual void VisitChildren (AstNode node)\n\t\t{\n\t\t\tAstNode next;\n\t\t\tfor (var child = node.FirstChild; child != null; child = next) {\n\t\t\t\t// Store next to allow the loop to continue\n\t\t\t\t// if the visitor removes/replaces child.\n\t\t\t\tnext = child.NextSibling;\n\t\t\t\tchild.AcceptVisitor (this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual void VisitNullNode(AstNode nullNode)\n\t\t{\n\t\t\t// Should we call VisitChildren here?\n\t\t\t// We usually want to ignore null nodes.\n\t\t\t// Older NR versions (before VisitNullNode was introduced) didn't call VisitChildren() with null nodes;\n\t\t\t// so changing this might break VisitChildren() overrides that expect the node to be part of the AST.\n\t\t}\n\t\t\n\t\tpublic virtual void VisitSyntaxTree (SyntaxTree syntaxTree)\n\t\t{\n\t\t\tVisitChildren (syntaxTree);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitComment(Comment comment)\n\t\t{\n\t\t\tVisitChildren(comment);\n\t\t}\n\n\t\tpublic virtual void VisitNewLine(NewLineNode newLineNode)\n\t\t{\n\t\t\tVisitChildren(newLineNode);\n\t\t}\n\n\t\tpublic virtual void VisitWhitespace(WhitespaceNode whitespaceNode)\n\t\t{\n\t\t\tVisitChildren(whitespaceNode);\n\t\t}\n\n\t\tpublic virtual void VisitText(TextNode textNode)\n\t\t{\n\t\t\tVisitChildren(textNode);\n\t\t}\n\n\t\tpublic virtual void VisitDocumentationReference (DocumentationReference documentationReference)\n\t\t{\n\t\t\tVisitChildren (documentationReference);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t\tVisitChildren (preProcessorDirective);\n\t\t}\n\n\t\tpublic virtual void VisitIdentifier (Identifier identifier)\n\t\t{\n\t\t\tVisitChildren (identifier);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitCSharpTokenNode (CSharpTokenNode token)\n\t\t{\n\t\t\tVisitChildren (token);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitPrimitiveType (PrimitiveType primitiveType)\n\t\t{\n\t\t\tVisitChildren (primitiveType);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitComposedType (ComposedType composedType)\n\t\t{\n\t\t\tVisitChildren (composedType);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitSimpleType(SimpleType simpleType)\n\t\t{\n\t\t\tVisitChildren (simpleType);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitMemberType(MemberType memberType)\n\t\t{\n\t\t\tVisitChildren (memberType);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitAttribute (Attribute attribute)\n\t\t{\n\t\t\tVisitChildren (attribute);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitAttributeSection (AttributeSection attributeSection)\n\t\t{\n\t\t\tVisitChildren (attributeSection);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\tVisitChildren (delegateDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\tVisitChildren (namespaceDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitTypeDeclaration (TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\tVisitChildren (typeDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitTypeParameterDeclaration (TypeParameterDeclaration typeParameterDeclaration)\n\t\t{\n\t\t\tVisitChildren (typeParameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\tVisitChildren (enumMemberDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUsingDeclaration (UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\tVisitChildren (usingDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUsingAliasDeclaration (UsingAliasDeclaration usingDeclaration)\n\t\t{\n\t\t\tVisitChildren (usingDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\tVisitChildren (externAliasDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\tVisitChildren (constructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitConstructorInitializer (ConstructorInitializer constructorInitializer)\n\t\t{\n\t\t\tVisitChildren (constructorInitializer);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\tVisitChildren (destructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitEventDeclaration (EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tVisitChildren (eventDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\tVisitChildren (eventDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitFieldDeclaration (FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tVisitChildren (fieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\tVisitChildren (fixedFieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer)\n\t\t{\n\t\t\tVisitChildren (fixedVariableInitializer);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\tVisitChildren (indexerDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitMethodDeclaration (MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tVisitChildren (methodDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\tVisitChildren (operatorDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tVisitChildren (propertyDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitAccessor (Accessor accessor)\n\t\t{\n\t\t\tVisitChildren (accessor);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitVariableInitializer (VariableInitializer variableInitializer)\n\t\t{\n\t\t\tVisitChildren (variableInitializer);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tVisitChildren (parameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitConstraint (Constraint constraint)\n\t\t{\n\t\t\tVisitChildren (constraint);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitBlockStatement (BlockStatement blockStatement)\n\t\t{\n\t\t\tVisitChildren (blockStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitExpressionStatement (ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tVisitChildren (expressionStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitBreakStatement (BreakStatement breakStatement)\n\t\t{\n\t\t\tVisitChildren (breakStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitCheckedStatement (CheckedStatement checkedStatement)\n\t\t{\n\t\t\tVisitChildren (checkedStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitContinueStatement (ContinueStatement continueStatement)\n\t\t{\n\t\t\tVisitChildren (continueStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitDoWhileStatement (DoWhileStatement doWhileStatement)\n\t\t{\n\t\t\tVisitChildren (doWhileStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitEmptyStatement (EmptyStatement emptyStatement)\n\t\t{\n\t\t\tVisitChildren (emptyStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitFixedStatement (FixedStatement fixedStatement)\n\t\t{\n\t\t\tVisitChildren (fixedStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitForeachStatement (ForeachStatement foreachStatement)\n\t\t{\n\t\t\tVisitChildren (foreachStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitForStatement (ForStatement forStatement)\n\t\t{\n\t\t\tVisitChildren (forStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitGotoCaseStatement (GotoCaseStatement gotoCaseStatement)\n\t\t{\n\t\t\tVisitChildren (gotoCaseStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement)\n\t\t{\n\t\t\tVisitChildren (gotoDefaultStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitGotoStatement (GotoStatement gotoStatement)\n\t\t{\n\t\t\tVisitChildren (gotoStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitIfElseStatement (IfElseStatement ifElseStatement)\n\t\t{\n\t\t\tVisitChildren (ifElseStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitLabelStatement (LabelStatement labelStatement)\n\t\t{\n\t\t\tVisitChildren (labelStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitLockStatement (LockStatement lockStatement)\n\t\t{\n\t\t\tVisitChildren (lockStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitReturnStatement (ReturnStatement returnStatement)\n\t\t{\n\t\t\tVisitChildren (returnStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitSwitchStatement (SwitchStatement switchStatement)\n\t\t{\n\t\t\tVisitChildren (switchStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitSwitchSection (SwitchSection switchSection)\n\t\t{\n\t\t\tVisitChildren (switchSection);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitCaseLabel (CaseLabel caseLabel)\n\t\t{\n\t\t\tVisitChildren (caseLabel);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitThrowStatement (ThrowStatement throwStatement)\n\t\t{\n\t\t\tVisitChildren (throwStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitTryCatchStatement (TryCatchStatement tryCatchStatement)\n\t\t{\n\t\t\tVisitChildren (tryCatchStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitCatchClause (CatchClause catchClause)\n\t\t{\n\t\t\tVisitChildren (catchClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUncheckedStatement (UncheckedStatement uncheckedStatement)\n\t\t{\n\t\t\tVisitChildren (uncheckedStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUnsafeStatement (UnsafeStatement unsafeStatement)\n\t\t{\n\t\t\tVisitChildren (unsafeStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUsingStatement (UsingStatement usingStatement)\n\t\t{\n\t\t\tVisitChildren (usingStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitVariableDeclarationStatement (VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\tVisitChildren (variableDeclarationStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitWhileStatement (WhileStatement whileStatement)\n\t\t{\n\t\t\tVisitChildren (whileStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitYieldBreakStatement (YieldBreakStatement yieldBreakStatement)\n\t\t{\n\t\t\tVisitChildren (yieldBreakStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement)\n\t\t{\n\t\t\tVisitChildren (yieldReturnStatement);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\tVisitChildren (anonymousMethodExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitLambdaExpression (LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tVisitChildren (lambdaExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitAssignmentExpression (AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\tVisitChildren (assignmentExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression)\n\t\t{\n\t\t\tVisitChildren (baseReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\tVisitChildren (binaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitCastExpression (CastExpression castExpression)\n\t\t{\n\t\t\tVisitChildren (castExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitCheckedExpression (CheckedExpression checkedExpression)\n\t\t{\n\t\t\tVisitChildren (checkedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitConditionalExpression (ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\tVisitChildren (conditionalExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitIdentifierExpression (IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tVisitChildren (identifierExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitIndexerExpression (IndexerExpression indexerExpression)\n\t\t{\n\t\t\tVisitChildren (indexerExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitInvocationExpression (InvocationExpression invocationExpression)\n\t\t{\n\t\t\tVisitChildren (invocationExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitDirectionExpression (DirectionExpression directionExpression)\n\t\t{\n\t\t\tVisitChildren (directionExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tVisitChildren (memberReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression)\n\t\t{\n\t\t\tVisitChildren (nullReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression)\n\t\t{\n\t\t\tVisitChildren (objectCreateExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t{\n\t\t\tVisitChildren (anonymousTypeCreateExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression)\n\t\t{\n\t\t\tVisitChildren (arrayCreateExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\tVisitChildren (parenthesizedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\tVisitChildren (pointerReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t{\n\t\t\tVisitChildren (primitiveExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitSizeOfExpression (SizeOfExpression sizeOfExpression)\n\t\t{\n\t\t\tVisitChildren (sizeOfExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitStackAllocExpression (StackAllocExpression stackAllocExpression)\n\t\t{\n\t\t\tVisitChildren (stackAllocExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t{\n\t\t\tVisitChildren (thisReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitTypeOfExpression (TypeOfExpression typeOfExpression)\n\t\t{\n\t\t\tVisitChildren (typeOfExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression)\n\t\t{\n\t\t\tVisitChildren (typeReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tVisitChildren (unaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUncheckedExpression (UncheckedExpression uncheckedExpression)\n\t\t{\n\t\t\tVisitChildren (uncheckedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\tVisitChildren (queryExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t{\n\t\t\tVisitChildren (queryContinuationClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t{\n\t\t\tVisitChildren (queryFromClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t{\n\t\t\tVisitChildren (queryLetClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryWhereClause(QueryWhereClause queryWhereClause)\n\t\t{\n\t\t\tVisitChildren (queryWhereClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryJoinClause(QueryJoinClause queryJoinClause)\n\t\t{\n\t\t\tVisitChildren (queryJoinClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryOrderClause(QueryOrderClause queryOrderClause)\n\t\t{\n\t\t\tVisitChildren (queryOrderClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryOrdering(QueryOrdering queryOrdering)\n\t\t{\n\t\t\tVisitChildren (queryOrdering);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQuerySelectClause(QuerySelectClause querySelectClause)\n\t\t{\n\t\t\tVisitChildren (querySelectClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitQueryGroupClause(QueryGroupClause queryGroupClause)\n\t\t{\n\t\t\tVisitChildren (queryGroupClause);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitAsExpression (AsExpression asExpression)\n\t\t{\n\t\t\tVisitChildren (asExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitIsExpression (IsExpression isExpression)\n\t\t{\n\t\t\tVisitChildren (isExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression)\n\t\t{\n\t\t\tVisitChildren (defaultValueExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression)\n\t\t{\n\t\t\tVisitChildren (undocumentedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\tVisitChildren (arrayInitializerExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitArraySpecifier (ArraySpecifier arraySpecifier)\n\t\t{\n\t\t\tVisitChildren (arraySpecifier);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression)\n\t\t{\n\t\t\tVisitChildren (namedArgumentExpression);\n\t\t}\n\t\t\n\t\tpublic virtual void VisitNamedExpression (NamedExpression namedExpression)\n\t\t{\n\t\t\tVisitChildren (namedExpression);\n\t\t}\n\n\t\tpublic virtual void VisitErrorNode(AstNode errorNode)\n\t\t{\n\t\t\tVisitChildren(errorNode);\n\t\t}\n\n\t\tpublic virtual void VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern)\n\t\t{\n\t\t\tVisitChildren (placeholder);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// AST visitor with a default implementation that visits all node depth-first.\n\t/// </summary>\n\tpublic abstract class DepthFirstAstVisitor<T> : IAstVisitor<T>\n\t{\n\t\tprotected virtual T VisitChildren (AstNode node)\n\t\t{\n\t\t\tAstNode next;\n\t\t\tfor (var child = node.FirstChild; child != null; child = next) {\n\t\t\t\t// Store next to allow the loop to continue\n\t\t\t\t// if the visitor removes/replaces child.\n\t\t\t\tnext = child.NextSibling;\n\t\t\t\tchild.AcceptVisitor (this);\n\t\t\t}\n\t\t\treturn default (T);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitNullNode(AstNode nullNode)\n\t\t{\n\t\t\t// Should we call VisitChildren here?\n\t\t\t// We usually want to ignore null nodes.\n\t\t\t// Older NR versions (before VisitNullNode was introduced) didn't call VisitChildren() with null nodes;\n\t\t\t// so changing this might break VisitChildren() overrides that expect the node to be part of the AST.\n\t\t\treturn default (T);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitSyntaxTree (SyntaxTree unit)\n\t\t{\n\t\t\treturn VisitChildren (unit);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitComment (Comment comment)\n\t\t{\n\t\t\treturn VisitChildren (comment);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitNewLine(NewLineNode newLineNode)\n\t\t{\n\t\t\treturn VisitChildren(newLineNode);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitWhitespace(WhitespaceNode whitespaceNode)\n\t\t{\n\t\t\treturn VisitChildren(whitespaceNode);\n\t\t}\n\n\t\tpublic virtual T VisitText(TextNode textNode)\n\t\t{\n\t\t\treturn VisitChildren(textNode);\n\t\t}\n\n\t\tpublic virtual T VisitDocumentationReference (DocumentationReference documentationReference)\n\t\t{\n\t\t\treturn VisitChildren (documentationReference);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t\treturn VisitChildren (preProcessorDirective);\n\t\t}\n\n\t\tpublic virtual T VisitIdentifier (Identifier identifier)\n\t\t{\n\t\t\treturn VisitChildren (identifier);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitCSharpTokenNode (CSharpTokenNode token)\n\t\t{\n\t\t\treturn VisitChildren (token);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitPrimitiveType (PrimitiveType primitiveType)\n\t\t{\n\t\t\treturn VisitChildren (primitiveType);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitComposedType (ComposedType composedType)\n\t\t{\n\t\t\treturn VisitChildren (composedType);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitSimpleType(SimpleType simpleType)\n\t\t{\n\t\t\treturn VisitChildren (simpleType);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitMemberType(MemberType memberType)\n\t\t{\n\t\t\treturn VisitChildren (memberType);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitAttribute (Attribute attribute)\n\t\t{\n\t\t\treturn VisitChildren (attribute);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitAttributeSection (AttributeSection attributeSection)\n\t\t{\n\t\t\treturn VisitChildren (attributeSection);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (delegateDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (namespaceDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitTypeDeclaration (TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (typeDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitTypeParameterDeclaration (TypeParameterDeclaration typeParameterDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (typeParameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (enumMemberDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUsingDeclaration (UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (usingDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUsingAliasDeclaration (UsingAliasDeclaration usingDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (usingDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (externAliasDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (constructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitConstructorInitializer (ConstructorInitializer constructorInitializer)\n\t\t{\n\t\t\treturn VisitChildren (constructorInitializer);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (destructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitEventDeclaration (EventDeclaration eventDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (eventDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (eventDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitFieldDeclaration (FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (fieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (fixedFieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer)\n\t\t{\n\t\t\treturn VisitChildren (fixedVariableInitializer);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (indexerDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitMethodDeclaration (MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (methodDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (operatorDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (propertyDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitAccessor (Accessor accessor)\n\t\t{\n\t\t\treturn VisitChildren (accessor);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitVariableInitializer (VariableInitializer variableInitializer)\n\t\t{\n\t\t\treturn VisitChildren (variableInitializer);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitParameterDeclaration (ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\treturn VisitChildren (parameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitConstraint (Constraint constraint)\n\t\t{\n\t\t\treturn VisitChildren (constraint);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitBlockStatement (BlockStatement blockStatement)\n\t\t{\n\t\t\treturn VisitChildren (blockStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitExpressionStatement (ExpressionStatement expressionStatement)\n\t\t{\n\t\t\treturn VisitChildren (expressionStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitBreakStatement (BreakStatement breakStatement)\n\t\t{\n\t\t\treturn VisitChildren (breakStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitCheckedStatement (CheckedStatement checkedStatement)\n\t\t{\n\t\t\treturn VisitChildren (checkedStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitContinueStatement (ContinueStatement continueStatement)\n\t\t{\n\t\t\treturn VisitChildren (continueStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitDoWhileStatement (DoWhileStatement doWhileStatement)\n\t\t{\n\t\t\treturn VisitChildren (doWhileStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitEmptyStatement (EmptyStatement emptyStatement)\n\t\t{\n\t\t\treturn VisitChildren (emptyStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitFixedStatement (FixedStatement fixedStatement)\n\t\t{\n\t\t\treturn VisitChildren (fixedStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitForeachStatement (ForeachStatement foreachStatement)\n\t\t{\n\t\t\treturn VisitChildren (foreachStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitForStatement (ForStatement forStatement)\n\t\t{\n\t\t\treturn VisitChildren (forStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitGotoCaseStatement (GotoCaseStatement gotoCaseStatement)\n\t\t{\n\t\t\treturn VisitChildren (gotoCaseStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement)\n\t\t{\n\t\t\treturn VisitChildren (gotoDefaultStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitGotoStatement (GotoStatement gotoStatement)\n\t\t{\n\t\t\treturn VisitChildren (gotoStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitIfElseStatement (IfElseStatement ifElseStatement)\n\t\t{\n\t\t\treturn VisitChildren (ifElseStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitLabelStatement (LabelStatement labelStatement)\n\t\t{\n\t\t\treturn VisitChildren (labelStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitLockStatement (LockStatement lockStatement)\n\t\t{\n\t\t\treturn VisitChildren (lockStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitReturnStatement (ReturnStatement returnStatement)\n\t\t{\n\t\t\treturn VisitChildren (returnStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitSwitchStatement (SwitchStatement switchStatement)\n\t\t{\n\t\t\treturn VisitChildren (switchStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitSwitchSection (SwitchSection switchSection)\n\t\t{\n\t\t\treturn VisitChildren (switchSection);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitCaseLabel (CaseLabel caseLabel)\n\t\t{\n\t\t\treturn VisitChildren (caseLabel);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitThrowStatement (ThrowStatement throwStatement)\n\t\t{\n\t\t\treturn VisitChildren (throwStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitTryCatchStatement (TryCatchStatement tryCatchStatement)\n\t\t{\n\t\t\treturn VisitChildren (tryCatchStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitCatchClause (CatchClause catchClause)\n\t\t{\n\t\t\treturn VisitChildren (catchClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUncheckedStatement (UncheckedStatement uncheckedStatement)\n\t\t{\n\t\t\treturn VisitChildren (uncheckedStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUnsafeStatement (UnsafeStatement unsafeStatement)\n\t\t{\n\t\t\treturn VisitChildren (unsafeStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUsingStatement (UsingStatement usingStatement)\n\t\t{\n\t\t\treturn VisitChildren (usingStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitVariableDeclarationStatement (VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\treturn VisitChildren (variableDeclarationStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitWhileStatement (WhileStatement whileStatement)\n\t\t{\n\t\t\treturn VisitChildren (whileStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitYieldBreakStatement (YieldBreakStatement yieldBreakStatement)\n\t\t{\n\t\t\treturn VisitChildren (yieldBreakStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement)\n\t\t{\n\t\t\treturn VisitChildren (yieldReturnStatement);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\treturn VisitChildren (anonymousMethodExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitLambdaExpression (LambdaExpression lambdaExpression)\n\t\t{\n\t\t\treturn VisitChildren (lambdaExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitAssignmentExpression (AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\treturn VisitChildren (assignmentExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression)\n\t\t{\n\t\t\treturn VisitChildren (baseReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\treturn VisitChildren (binaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitCastExpression (CastExpression castExpression)\n\t\t{\n\t\t\treturn VisitChildren (castExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitCheckedExpression (CheckedExpression checkedExpression)\n\t\t{\n\t\t\treturn VisitChildren (checkedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitConditionalExpression (ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\treturn VisitChildren (conditionalExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitIdentifierExpression (IdentifierExpression identifierExpression)\n\t\t{\n\t\t\treturn VisitChildren (identifierExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitIndexerExpression (IndexerExpression indexerExpression)\n\t\t{\n\t\t\treturn VisitChildren (indexerExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitInvocationExpression (InvocationExpression invocationExpression)\n\t\t{\n\t\t\treturn VisitChildren (invocationExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitDirectionExpression (DirectionExpression directionExpression)\n\t\t{\n\t\t\treturn VisitChildren (directionExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\treturn VisitChildren (memberReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression)\n\t\t{\n\t\t\treturn VisitChildren (nullReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression)\n\t\t{\n\t\t\treturn VisitChildren (objectCreateExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t{\n\t\t\treturn VisitChildren (anonymousTypeCreateExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression)\n\t\t{\n\t\t\treturn VisitChildren (arrayCreateExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\treturn VisitChildren (parenthesizedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\treturn VisitChildren (pointerReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t{\n\t\t\treturn VisitChildren (primitiveExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitSizeOfExpression (SizeOfExpression sizeOfExpression)\n\t\t{\n\t\t\treturn VisitChildren (sizeOfExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitStackAllocExpression (StackAllocExpression stackAllocExpression)\n\t\t{\n\t\t\treturn VisitChildren (stackAllocExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t{\n\t\t\treturn VisitChildren (thisReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitTypeOfExpression (TypeOfExpression typeOfExpression)\n\t\t{\n\t\t\treturn VisitChildren (typeOfExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression)\n\t\t{\n\t\t\treturn VisitChildren (typeReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\treturn VisitChildren (unaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUncheckedExpression (UncheckedExpression uncheckedExpression)\n\t\t{\n\t\t\treturn VisitChildren (uncheckedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\treturn VisitChildren (queryExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t{\n\t\t\treturn VisitChildren (queryContinuationClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t{\n\t\t\treturn VisitChildren (queryFromClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t{\n\t\t\treturn VisitChildren (queryLetClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryWhereClause(QueryWhereClause queryWhereClause)\n\t\t{\n\t\t\treturn VisitChildren (queryWhereClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryJoinClause(QueryJoinClause queryJoinClause)\n\t\t{\n\t\t\treturn VisitChildren (queryJoinClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryOrderClause(QueryOrderClause queryOrderClause)\n\t\t{\n\t\t\treturn VisitChildren (queryOrderClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryOrdering(QueryOrdering queryOrdering)\n\t\t{\n\t\t\treturn VisitChildren (queryOrdering);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQuerySelectClause(QuerySelectClause querySelectClause)\n\t\t{\n\t\t\treturn VisitChildren (querySelectClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitQueryGroupClause(QueryGroupClause queryGroupClause)\n\t\t{\n\t\t\treturn VisitChildren (queryGroupClause);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitAsExpression (AsExpression asExpression)\n\t\t{\n\t\t\treturn VisitChildren (asExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitIsExpression (IsExpression isExpression)\n\t\t{\n\t\t\treturn VisitChildren (isExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression)\n\t\t{\n\t\t\treturn VisitChildren (defaultValueExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression)\n\t\t{\n\t\t\treturn VisitChildren (undocumentedExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\treturn VisitChildren (arrayInitializerExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitArraySpecifier (ArraySpecifier arraySpecifier)\n\t\t{\n\t\t\treturn VisitChildren (arraySpecifier);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression)\n\t\t{\n\t\t\treturn VisitChildren (namedArgumentExpression);\n\t\t}\n\t\t\n\t\tpublic virtual T VisitNamedExpression (NamedExpression namedExpression)\n\t\t{\n\t\t\treturn VisitChildren (namedExpression);\n\t\t}\n\n\t\tpublic virtual T VisitErrorNode(AstNode errorNode)\n\t\t{\n\t\t\treturn VisitChildren(errorNode);\n\t\t}\n\n\t\tpublic virtual T VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn VisitChildren (placeholder);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// AST visitor with a default implementation that visits all node depth-first.\n\t/// </summary>\n\tpublic abstract class DepthFirstAstVisitor<T, S> : IAstVisitor<T, S>\n\t{\n\t\tprotected virtual S VisitChildren (AstNode node, T data)\n\t\t{\n\t\t\tAstNode next;\n\t\t\tfor (var child = node.FirstChild; child != null; child = next) {\n\t\t\t\t// Store next to allow the loop to continue\n\t\t\t\t// if the visitor removes/replaces child.\n\t\t\t\tnext = child.NextSibling;\n\t\t\t\tchild.AcceptVisitor (this, data);\n\t\t\t}\n\t\t\treturn default (S);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitNullNode(AstNode nullNode, T data)\n\t\t{\n\t\t\t// Should we call VisitChildren here?\n\t\t\t// We usually want to ignore null nodes.\n\t\t\t// Older NR versions (before VisitNullNode was introduced) didn't call VisitChildren() with null nodes;\n\t\t\t// so changing this might break VisitChildren() overrides that expect the node to be part of the AST.\n\t\t\treturn default (S);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitSyntaxTree (SyntaxTree unit, T data)\n\t\t{\n\t\t\treturn VisitChildren (unit, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitComment (Comment comment, T data)\n\t\t{\n\t\t\treturn VisitChildren (comment, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitNewLine(NewLineNode newLineNode, T data)\n\t\t{\n\t\t\treturn VisitChildren(newLineNode, data);\n\t\t}\n\n\t\tpublic virtual S VisitWhitespace(WhitespaceNode whitespaceNode, T data)\n\t\t{\n\t\t\treturn VisitChildren(whitespaceNode, data);\n\t\t}\n\n\t\tpublic virtual S VisitText(TextNode textNode, T data)\n\t\t{\n\t\t\treturn VisitChildren(textNode, data);\n\t\t}\n\n\t\tpublic virtual S VisitDocumentationReference (DocumentationReference documentationReference, T data)\n\t\t{\n\t\t\treturn VisitChildren (documentationReference, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective, T data)\n\t\t{\n\t\t\treturn VisitChildren (preProcessorDirective, data);\n\t\t}\n\n\t\tpublic virtual S VisitIdentifier (Identifier identifier, T data)\n\t\t{\n\t\t\treturn VisitChildren (identifier, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitCSharpTokenNode (CSharpTokenNode token, T data)\n\t\t{\n\t\t\treturn VisitChildren (token, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitPrimitiveType (PrimitiveType primitiveType, T data)\n\t\t{\n\t\t\treturn VisitChildren (primitiveType, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitComposedType (ComposedType composedType, T data)\n\t\t{\n\t\t\treturn VisitChildren (composedType, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitSimpleType(SimpleType simpleType, T data)\n\t\t{\n\t\t\treturn VisitChildren (simpleType, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitMemberType(MemberType memberType, T data)\n\t\t{\n\t\t\treturn VisitChildren (memberType, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitAttribute (Attribute attribute, T data)\n\t\t{\n\t\t\treturn VisitChildren (attribute, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitAttributeSection (AttributeSection attributeSection, T data)\n\t\t{\n\t\t\treturn VisitChildren (attributeSection, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (delegateDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (namespaceDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitTypeDeclaration (TypeDeclaration typeDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (typeDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitTypeParameterDeclaration (TypeParameterDeclaration typeParameterDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (typeParameterDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (enumMemberDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUsingDeclaration (UsingDeclaration usingDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (usingDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUsingAliasDeclaration (UsingAliasDeclaration usingDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (usingDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (externAliasDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (constructorDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitConstructorInitializer (ConstructorInitializer constructorInitializer, T data)\n\t\t{\n\t\t\treturn VisitChildren (constructorInitializer, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (destructorDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitEventDeclaration (EventDeclaration eventDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (eventDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (eventDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitFieldDeclaration (FieldDeclaration fieldDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (fieldDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (fixedFieldDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer, T data)\n\t\t{\n\t\t\treturn VisitChildren (fixedVariableInitializer, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (indexerDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitMethodDeclaration (MethodDeclaration methodDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (methodDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (operatorDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (propertyDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitAccessor (Accessor accessor, T data)\n\t\t{\n\t\t\treturn VisitChildren (accessor, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitVariableInitializer (VariableInitializer variableInitializer, T data)\n\t\t{\n\t\t\treturn VisitChildren (variableInitializer, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitParameterDeclaration (ParameterDeclaration parameterDeclaration, T data)\n\t\t{\n\t\t\treturn VisitChildren (parameterDeclaration, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitConstraint (Constraint constraint, T data)\n\t\t{\n\t\t\treturn VisitChildren (constraint, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitBlockStatement (BlockStatement blockStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (blockStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitExpressionStatement (ExpressionStatement expressionStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (expressionStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitBreakStatement (BreakStatement breakStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (breakStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitCheckedStatement (CheckedStatement checkedStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (checkedStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitContinueStatement (ContinueStatement continueStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (continueStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitDoWhileStatement (DoWhileStatement doWhileStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (doWhileStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitEmptyStatement (EmptyStatement emptyStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (emptyStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitFixedStatement (FixedStatement fixedStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (fixedStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitForeachStatement (ForeachStatement foreachStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (foreachStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitForStatement (ForStatement forStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (forStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitGotoCaseStatement (GotoCaseStatement gotoCaseStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (gotoCaseStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (gotoDefaultStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitGotoStatement (GotoStatement gotoStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (gotoStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitIfElseStatement (IfElseStatement ifElseStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (ifElseStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitLabelStatement (LabelStatement labelStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (labelStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitLockStatement (LockStatement lockStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (lockStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitReturnStatement (ReturnStatement returnStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (returnStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitSwitchStatement (SwitchStatement switchStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (switchStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitSwitchSection (SwitchSection switchSection, T data)\n\t\t{\n\t\t\treturn VisitChildren (switchSection, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitCaseLabel (CaseLabel caseLabel, T data)\n\t\t{\n\t\t\treturn VisitChildren (caseLabel, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitThrowStatement (ThrowStatement throwStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (throwStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitTryCatchStatement (TryCatchStatement tryCatchStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (tryCatchStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitCatchClause (CatchClause catchClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (catchClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUncheckedStatement (UncheckedStatement uncheckedStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (uncheckedStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUnsafeStatement (UnsafeStatement unsafeStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (unsafeStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUsingStatement (UsingStatement usingStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (usingStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitVariableDeclarationStatement (VariableDeclarationStatement variableDeclarationStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (variableDeclarationStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitWhileStatement (WhileStatement whileStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (whileStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitYieldBreakStatement (YieldBreakStatement yieldBreakStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (yieldBreakStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement, T data)\n\t\t{\n\t\t\treturn VisitChildren (yieldReturnStatement, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (anonymousMethodExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitLambdaExpression (LambdaExpression lambdaExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (lambdaExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitAssignmentExpression (AssignmentExpression assignmentExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (assignmentExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (baseReferenceExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (binaryOperatorExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitCastExpression (CastExpression castExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (castExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitCheckedExpression (CheckedExpression checkedExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (checkedExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitConditionalExpression (ConditionalExpression conditionalExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (conditionalExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitIdentifierExpression (IdentifierExpression identifierExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (identifierExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitIndexerExpression (IndexerExpression indexerExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (indexerExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitInvocationExpression (InvocationExpression invocationExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (invocationExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitDirectionExpression (DirectionExpression directionExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (directionExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (memberReferenceExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (nullReferenceExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (objectCreateExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (anonymousTypeCreateExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (arrayCreateExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (parenthesizedExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (pointerReferenceExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (primitiveExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitSizeOfExpression (SizeOfExpression sizeOfExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (sizeOfExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitStackAllocExpression (StackAllocExpression stackAllocExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (stackAllocExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (thisReferenceExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitTypeOfExpression (TypeOfExpression typeOfExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (typeOfExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (typeReferenceExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (unaryOperatorExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUncheckedExpression (UncheckedExpression uncheckedExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (uncheckedExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryExpression(QueryExpression queryExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryContinuationClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryFromClause(QueryFromClause queryFromClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryFromClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryLetClause(QueryLetClause queryLetClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryLetClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryWhereClause(QueryWhereClause queryWhereClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryWhereClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryJoinClause(QueryJoinClause queryJoinClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryJoinClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryOrderClause(QueryOrderClause queryOrderClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryOrderClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryOrdering(QueryOrdering queryOrdering, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryOrdering, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQuerySelectClause(QuerySelectClause querySelectClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (querySelectClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitQueryGroupClause(QueryGroupClause queryGroupClause, T data)\n\t\t{\n\t\t\treturn VisitChildren (queryGroupClause, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitAsExpression (AsExpression asExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (asExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitIsExpression (IsExpression isExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (isExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (defaultValueExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (undocumentedExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (arrayInitializerExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitArraySpecifier (ArraySpecifier arraySpecifier, T data)\n\t\t{\n\t\t\treturn VisitChildren (arraySpecifier, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (namedArgumentExpression, data);\n\t\t}\n\t\t\n\t\tpublic virtual S VisitNamedExpression (NamedExpression namedExpression, T data)\n\t\t{\n\t\t\treturn VisitChildren (namedExpression, data);\n\t\t}\n\n\t\tpublic virtual S VisitErrorNode(AstNode errorNode, T data)\n\t\t{\n\t\t\treturn VisitChildren(errorNode, data);\n\t\t}\n\n\t\tpublic virtual S VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern, T data)\n\t\t{\n\t\t\treturn VisitChildren (placeholder, data);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/DocumentationReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Represents a 'cref' reference in XML documentation.\n\t/// </summary>\n\tpublic class DocumentationReference : AstNode\n\t{\n\t\tpublic static readonly Role<AstType> DeclaringTypeRole = new Role<AstType>(\"DeclaringType\", AstType.Null);\n\t\tpublic static readonly Role<AstType> ConversionOperatorReturnTypeRole = new Role<AstType>(\"ConversionOperatorReturnType\", AstType.Null);\n\t\t\n\t\tSymbolKind symbolKind;\n\t\tOperatorType operatorType;\n\t\tbool hasParameterList;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the entity type.\n\t\t/// Possible values are:\n\t\t///   <c>SymbolKind.Operator</c> for operators,\n\t\t///   <c>SymbolKind.Indexer</c> for indexers,\n\t\t///   <c>SymbolKind.TypeDefinition</c> for references to primitive types,\n\t\t///   and <c>SymbolKind.None</c> for everything else.\n\t\t/// </summary>\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget { return symbolKind; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tsymbolKind = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the operator type.\n\t\t/// This property is only used when SymbolKind==Operator.\n\t\t/// </summary>\n\t\tpublic OperatorType OperatorType {\n\t\t\tget { return operatorType; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\toperatorType = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether a parameter list was provided.\n\t\t/// </summary>\n\t\tpublic bool HasParameterList {\n\t\t\tget { return hasParameterList; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\thasParameterList = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.Unknown; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the declaring type.\n\t\t/// </summary>\n\t\tpublic AstType DeclaringType {\n\t\t\tget { return GetChildByRole(DeclaringTypeRole); }\n\t\t\tset { SetChildByRole(DeclaringTypeRole, value); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/sets the member name.\n\t\t/// This property is only used when SymbolKind==None.\n\t\t/// </summary>\n\t\tpublic string MemberName {\n\t\t\tget { return GetChildByRole(Roles.Identifier).Name; }\n\t\t\tset { SetChildByRole(Roles.Identifier, Identifier.Create(value)); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the return type of conversion operators.\n\t\t/// This property is only used when SymbolKind==Operator and OperatorType is explicit or implicit.\n\t\t/// </summary>\n\t\tpublic AstType ConversionOperatorReturnType {\n\t\t\tget { return GetChildByRole(ConversionOperatorReturnTypeRole); }\n\t\t\tset { SetChildByRole(ConversionOperatorReturnTypeRole, value); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstType> TypeArguments {\n\t\t\tget { return GetChildrenByRole (Roles.TypeArgument); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)\n\t\t{\n\t\t\tDocumentationReference o = other as DocumentationReference;\n\t\t\tif (!(o != null && this.SymbolKind == o.SymbolKind && this.HasParameterList == o.HasParameterList))\n\t\t\t\treturn false;\n\t\t\tif (this.SymbolKind == SymbolKind.Operator) {\n\t\t\t\tif (this.OperatorType != o.OperatorType)\n\t\t\t\t\treturn false;\n\t\t\t\tif (this.OperatorType == OperatorType.Implicit || this.OperatorType == OperatorType.Explicit) {\n\t\t\t\t\tif (!this.ConversionOperatorReturnType.DoMatch(o.ConversionOperatorReturnType, match))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (this.SymbolKind == SymbolKind.None) {\n\t\t\t\tif (!MatchString(this.MemberName, o.MemberName))\n\t\t\t\t\treturn false;\n\t\t\t\tif (!this.TypeArguments.DoMatch(o.TypeArguments, match))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn this.Parameters.DoMatch(o.Parameters, match);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitDocumentationReference (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitDocumentationReference (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitDocumentationReference (this, data);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ErrorNode.cs",
    "content": "﻿// \n// ErrorNode.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Xamarin (http://www.xamarin.com);\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Represents a parsing error in the ast. At the moment it only represents missing closing bracket.\n\t/// This closing bracket is replaced by a node at the highest possible position.\n\t/// (To make GetAstNodeAt (line, col) working).\n\t/// </summary>\n\tpublic class ErrorNode : AstNode\n\t{\n\t\tstatic TextLocation maxLoc = new TextLocation (int.MaxValue, int.MaxValue);\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn maxLoc;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn maxLoc;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ErrorNode ()\n\t\t{\n\t\t}\n\n\t\tpublic override void AcceptVisitor(IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitErrorNode(this);\n\t\t}\n\n\t\tpublic override T AcceptVisitor<T>(IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitErrorNode(this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitErrorNode(this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as ErrorNode;\n\t\t\treturn o != null;\n\t\t}\n\n\t\tpublic override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\treturn \"[ErrorNode]\";\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousMethodExpression.cs",
    "content": "﻿// \n// AnonymousMethodExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// [async] delegate(Parameters) {Body}\n\t/// </summary>\n\tpublic class AnonymousMethodExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole DelegateKeywordRole = new TokenRole (\"delegate\");\n\t\tpublic readonly static TokenRole AsyncModifierRole = LambdaExpression.AsyncModifierRole;\n\t\t\n\t\tbool isAsync;\n\t\t\n\t\tpublic bool IsAsync {\n\t\t\tget { return isAsync; }\n\t\t\tset { ThrowIfFrozen(); isAsync = value; }\n\t\t}\n\t\t\n\t\t// used to tell the difference between delegate {} and delegate () {}\n\t\tbool hasParameterList;\n\t\t\n\t\tpublic bool HasParameterList {\n\t\t\tget { return hasParameterList || Parameters.Any(); }\n\t\t\tset { ThrowIfFrozen(); hasParameterList = value; }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode DelegateToken {\n\t\t\tget { return GetChildByRole (DelegateKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic AnonymousMethodExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic AnonymousMethodExpression (BlockStatement body, IEnumerable<ParameterDeclaration> parameters = null)\n\t\t{\n\t\t\tif (parameters != null) {\n\t\t\t\thasParameterList = true;\n\t\t\t\tforeach (var parameter in parameters) {\n\t\t\t\t\tAddChild (parameter, Roles.Parameter);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddChild (body, Roles.Body);\n\t\t}\n\t\t\n\t\tpublic AnonymousMethodExpression (BlockStatement body, params ParameterDeclaration[] parameters) : this (body, (IEnumerable<ParameterDeclaration>)parameters)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAnonymousMethodExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitAnonymousMethodExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitAnonymousMethodExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tAnonymousMethodExpression o = other as AnonymousMethodExpression;\n\t\t\treturn o != null && this.IsAsync == o.IsAsync && this.HasParameterList == o.HasParameterList\n\t\t\t\t&& this.Parameters.DoMatch(o.Parameters, match) && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs",
    "content": "﻿// \n// AnonymousTypeCreateExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// new { [ExpressionList] }\n\t/// </summary>\n\tpublic class AnonymousTypeCreateExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole NewKeywordRole = new TokenRole (\"new\");\n\t\t\n\t\tpublic CSharpTokenNode NewToken {\n\t\t\tget { return GetChildByRole (NewKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Initializers {\n\t\t\tget { return GetChildrenByRole (Roles.Expression); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic AnonymousTypeCreateExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic AnonymousTypeCreateExpression (IEnumerable<Expression> initializers)\n\t\t{\n\t\t\tforeach (var ini in initializers) {\n\t\t\t\tAddChild (ini, Roles.Expression);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AnonymousTypeCreateExpression (params Expression[] initializer) : this ((IEnumerable<Expression>)initializer)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAnonymousTypeCreateExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitAnonymousTypeCreateExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitAnonymousTypeCreateExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as AnonymousTypeCreateExpression;\n\t\t\treturn o != null && this.Initializers.DoMatch(o.Initializers, match);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayCreateExpression.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// new Type[Dimensions]\n\t/// </summary>\n\tpublic class ArrayCreateExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole NewKeywordRole = new TokenRole (\"new\");\n\t\tpublic readonly static Role<ArraySpecifier> AdditionalArraySpecifierRole = new Role<ArraySpecifier>(\"AdditionalArraySpecifier\");\n\t\tpublic readonly static Role<ArrayInitializerExpression> InitializerRole = new Role<ArrayInitializerExpression>(\"Initializer\", ArrayInitializerExpression.Null);\n\t\t\n\t\tpublic CSharpTokenNode NewToken {\n\t\t\tget { return GetChildByRole (NewKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Arguments {\n\t\t\tget { return GetChildrenByRole (Roles.Argument); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets additional array ranks (those without size info).\n\t\t/// Empty for \"new int[5,1]\"; will contain a single element for \"new int[5][]\".\n\t\t/// </summary>\n\t\tpublic AstNodeCollection<ArraySpecifier> AdditionalArraySpecifiers {\n\t\t\tget { return GetChildrenByRole(AdditionalArraySpecifierRole); }\n\t\t}\n\t\t\n\t\tpublic ArrayInitializerExpression Initializer {\n\t\t\tget { return GetChildByRole (InitializerRole); }\n\t\t\tset { SetChildByRole (InitializerRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitArrayCreateExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitArrayCreateExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitArrayCreateExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tArrayCreateExpression o = other as ArrayCreateExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match) && this.Arguments.DoMatch(o.Arguments, match) && this.AdditionalArraySpecifiers.DoMatch(o.AdditionalArraySpecifiers, match) && this.Initializer.DoMatch(o.Initializer, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayInitializerExpression.cs",
    "content": "﻿// \n// ArrayInitializerExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// { Elements }\n\t/// </summary>\n\tpublic class ArrayInitializerExpression : Expression\n\t{\n\t\t/// <summary>\n\t\t/// For ease of use purposes in the resolver the ast representation\n\t\t/// of { a, b, c }  is { {a}, {b}, {c} }.\n\t\t/// If IsSingleElement is true then this array initializer expression is a generated one.\n\t\t/// That has no meaning in the source code (and contains no brace tokens).\n\t\t/// </summary>\n\t\tpublic virtual bool IsSingleElement {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic ArrayInitializerExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ArrayInitializerExpression(IEnumerable<Expression> elements)\n\t\t{\n\t\t\tthis.Elements.AddRange(elements);\n\t\t}\n\t\t\n\t\tpublic ArrayInitializerExpression(params Expression[] elements)\n\t\t{\n\t\t\tthis.Elements.AddRange(elements);\n\t\t}\n\t\t\n\t\t#region Null\n\t\tpublic new static readonly ArrayInitializerExpression Null = new NullArrayInitializerExpression ();\n\t\t\n\t\tsealed class NullArrayInitializerExpression : ArrayInitializerExpression\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole (Roles.LBrace); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Elements {\n\t\t\tget { return GetChildrenByRole(Roles.Expression); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole (Roles.RBrace); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitArrayInitializerExpression (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitArrayInitializerExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitArrayInitializerExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tArrayInitializerExpression o = other as ArrayInitializerExpression;\n\t\t\treturn o != null && this.Elements.DoMatch(o.Elements, match);\n\t\t}\n\n\t\tpublic static ArrayInitializerExpression CreateSingleElementInitializer ()\n\t\t{\n\t\t\treturn new SingleArrayInitializerExpression();\n\t\t}\n\t\t/// <summary>\n\t\t/// Single elements in array initializers are represented with this special class.\n\t\t/// </summary>\n\t\tclass SingleArrayInitializerExpression : ArrayInitializerExpression\n\t\t{\n\t\t\tpublic override bool IsSingleElement {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator ArrayInitializerExpression(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : ArrayInitializerExpression, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AsExpression.cs",
    "content": "﻿// \n// AsExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Expression as TypeReference\n\t/// </summary>\n\tpublic class AsExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole AsKeywordRole = new TokenRole (\"as\");\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole(Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode AsToken {\n\t\t\tget { return GetChildByRole (AsKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic AsExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic AsExpression (Expression expression, AstType type)\n\t\t{\n\t\t\tAddChild (expression, Roles.Expression);\n\t\t\tAddChild (type, Roles.Type);\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAsExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitAsExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitAsExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tAsExpression o = other as AsExpression;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match) && this.Type.DoMatch(o.Type, match);\n\t\t}\n\n\t\t#region Builder methods\n\t\tpublic override MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = new ParenthesizedExpression(this);\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AssignmentExpression.cs",
    "content": "﻿// \n// AssignmentExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq.Expressions;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Left Operator= Right\n\t/// </summary>\n\tpublic class AssignmentExpression : Expression\n\t{\n\t\t// reuse roles from BinaryOperatorExpression\n\t\tpublic readonly static Role<Expression> LeftRole = BinaryOperatorExpression.LeftRole;\n\t\tpublic readonly static Role<Expression> RightRole = BinaryOperatorExpression.RightRole;\n\t\t\n\t\tpublic readonly static TokenRole AssignRole = new TokenRole (\"=\");\n\t\tpublic readonly static TokenRole AddRole = new TokenRole (\"+=\");\n\t\tpublic readonly static TokenRole SubtractRole = new TokenRole (\"-=\");\n\t\tpublic readonly static TokenRole MultiplyRole = new TokenRole (\"*=\");\n\t\tpublic readonly static TokenRole DivideRole = new TokenRole (\"/=\");\n\t\tpublic readonly static TokenRole ModulusRole = new TokenRole (\"%=\");\n\t\tpublic readonly static TokenRole ShiftLeftRole = new TokenRole (\"<<=\");\n\t\tpublic readonly static TokenRole ShiftRightRole = new TokenRole (\">>=\");\n\t\tpublic readonly static TokenRole BitwiseAndRole = new TokenRole (\"&=\");\n\t\tpublic readonly static TokenRole BitwiseOrRole = new TokenRole (\"|=\");\n\t\tpublic readonly static TokenRole ExclusiveOrRole = new TokenRole (\"^=\");\n\t\t\n\t\tpublic AssignmentExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic AssignmentExpression(Expression left, Expression right)\n\t\t{\n\t\t\tthis.Left = left;\n\t\t\tthis.Right = right;\n\t\t}\n\t\t\n\t\tpublic AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right)\n\t\t{\n\t\t\tthis.Left = left;\n\t\t\tthis.Operator = op;\n\t\t\tthis.Right = right;\n\t\t}\n\t\t\n\t\tpublic AssignmentOperatorType Operator {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic Expression Left {\n\t\t\tget { return GetChildByRole (LeftRole); }\n\t\t\tset { SetChildByRole(LeftRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode OperatorToken {\n\t\t\tget { return GetChildByRole (GetOperatorRole(Operator)); }\n\t\t}\n\t\t\n\t\tpublic Expression Right {\n\t\t\tget { return GetChildByRole (RightRole); }\n\t\t\tset { SetChildByRole(RightRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAssignmentExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitAssignmentExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitAssignmentExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tAssignmentExpression o = other as AssignmentExpression;\n\t\t\treturn o != null && (this.Operator == AssignmentOperatorType.Any || this.Operator == o.Operator)\n\t\t\t\t&& this.Left.DoMatch(o.Left, match) && this.Right.DoMatch(o.Right, match);\n\t\t}\n\t\t\n\t\tpublic static TokenRole GetOperatorRole(AssignmentOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase AssignmentOperatorType.Assign:\n\t\t\t\t\treturn AssignRole;\n\t\t\t\tcase AssignmentOperatorType.Add:\n\t\t\t\t\treturn AddRole;\n\t\t\t\tcase AssignmentOperatorType.Subtract:\n\t\t\t\t\treturn SubtractRole;\n\t\t\t\tcase AssignmentOperatorType.Multiply:\n\t\t\t\t\treturn MultiplyRole;\n\t\t\t\tcase AssignmentOperatorType.Divide:\n\t\t\t\t\treturn DivideRole;\n\t\t\t\tcase AssignmentOperatorType.Modulus:\n\t\t\t\t\treturn ModulusRole;\n\t\t\t\tcase AssignmentOperatorType.ShiftLeft:\n\t\t\t\t\treturn ShiftLeftRole;\n\t\t\t\tcase AssignmentOperatorType.ShiftRight:\n\t\t\t\t\treturn ShiftRightRole;\n\t\t\t\tcase AssignmentOperatorType.BitwiseAnd:\n\t\t\t\t\treturn BitwiseAndRole;\n\t\t\t\tcase AssignmentOperatorType.BitwiseOr:\n\t\t\t\t\treturn BitwiseOrRole;\n\t\t\t\tcase AssignmentOperatorType.ExclusiveOr:\n\t\t\t\t\treturn ExclusiveOrRole;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for AssignmentOperatorType\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the binary operator for the specified compound assignment operator.\n\t\t/// Returns null if 'op' is not a compound assignment.\n\t\t/// </summary>\n\t\tpublic static BinaryOperatorType? GetCorrespondingBinaryOperator(AssignmentOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase AssignmentOperatorType.Assign:\n\t\t\t\t\treturn null;\n\t\t\t\tcase AssignmentOperatorType.Add:\n\t\t\t\t\treturn BinaryOperatorType.Add;\n\t\t\t\tcase AssignmentOperatorType.Subtract:\n\t\t\t\t\treturn BinaryOperatorType.Subtract;\n\t\t\t\tcase AssignmentOperatorType.Multiply:\n\t\t\t\t\treturn BinaryOperatorType.Multiply;\n\t\t\t\tcase AssignmentOperatorType.Divide:\n\t\t\t\t\treturn BinaryOperatorType.Divide;\n\t\t\t\tcase AssignmentOperatorType.Modulus:\n\t\t\t\t\treturn BinaryOperatorType.Modulus;\n\t\t\t\tcase AssignmentOperatorType.ShiftLeft:\n\t\t\t\t\treturn BinaryOperatorType.ShiftLeft;\n\t\t\t\tcase AssignmentOperatorType.ShiftRight:\n\t\t\t\t\treturn BinaryOperatorType.ShiftRight;\n\t\t\t\tcase AssignmentOperatorType.BitwiseAnd:\n\t\t\t\t\treturn BinaryOperatorType.BitwiseAnd;\n\t\t\t\tcase AssignmentOperatorType.BitwiseOr:\n\t\t\t\t\treturn BinaryOperatorType.BitwiseOr;\n\t\t\t\tcase AssignmentOperatorType.ExclusiveOr:\n\t\t\t\t\treturn BinaryOperatorType.ExclusiveOr;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for AssignmentOperatorType\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static ExpressionType GetLinqNodeType(AssignmentOperatorType op, bool checkForOverflow)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase AssignmentOperatorType.Assign:\n\t\t\t\t\treturn ExpressionType.Assign;\n\t\t\t\tcase AssignmentOperatorType.Add:\n\t\t\t\t\treturn checkForOverflow ? ExpressionType.AddAssignChecked : ExpressionType.AddAssign;\n\t\t\t\tcase AssignmentOperatorType.Subtract:\n\t\t\t\t\treturn checkForOverflow ? ExpressionType.SubtractAssignChecked : ExpressionType.SubtractAssign;\n\t\t\t\tcase AssignmentOperatorType.Multiply:\n\t\t\t\t\treturn checkForOverflow ? ExpressionType.MultiplyAssignChecked : ExpressionType.MultiplyAssign;\n\t\t\t\tcase AssignmentOperatorType.Divide:\n\t\t\t\t\treturn ExpressionType.DivideAssign;\n\t\t\t\tcase AssignmentOperatorType.Modulus:\n\t\t\t\t\treturn ExpressionType.ModuloAssign;\n\t\t\t\tcase AssignmentOperatorType.ShiftLeft:\n\t\t\t\t\treturn ExpressionType.LeftShiftAssign;\n\t\t\t\tcase AssignmentOperatorType.ShiftRight:\n\t\t\t\t\treturn ExpressionType.RightShiftAssign;\n\t\t\t\tcase AssignmentOperatorType.BitwiseAnd:\n\t\t\t\t\treturn ExpressionType.AndAssign;\n\t\t\t\tcase AssignmentOperatorType.BitwiseOr:\n\t\t\t\t\treturn ExpressionType.OrAssign;\n\t\t\t\tcase AssignmentOperatorType.ExclusiveOr:\n\t\t\t\t\treturn ExpressionType.ExclusiveOrAssign;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for AssignmentOperatorType\");\n\t\t\t}\n\t\t}\n\n\t\t#region Builder methods\n\t\tpublic override MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = new ParenthesizedExpression(this);\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\t\t#endregion\n\t}\n\t\n\tpublic enum AssignmentOperatorType\n\t{\n\t\t/// <summary>left = right</summary>\n\t\tAssign,\n\t\t\n\t\t/// <summary>left += right</summary>\n\t\tAdd,\n\t\t/// <summary>left -= right</summary>\n\t\tSubtract,\n\t\t/// <summary>left *= right</summary>\n\t\tMultiply,\n\t\t/// <summary>left /= right</summary>\n\t\tDivide,\n\t\t/// <summary>left %= right</summary>\n\t\tModulus,\n\t\t\n\t\t/// <summary>left <<= right</summary>\n\t\tShiftLeft,\n\t\t/// <summary>left >>= right</summary>\n\t\tShiftRight,\n\t\t\n\t\t/// <summary>left &= right</summary>\n\t\tBitwiseAnd,\n\t\t/// <summary>left |= right</summary>\n\t\tBitwiseOr,\n\t\t/// <summary>left ^= right</summary>\n\t\tExclusiveOr,\n\t\t\n\t\t/// <summary>Any operator (for pattern matching)</summary>\n\t\tAny\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BaseReferenceExpression.cs",
    "content": "﻿// \n// BaseReferenceExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// base\n\t/// </summary>\n\tpublic class BaseReferenceExpression : Expression\n\t{\n\t\tpublic TextLocation Location {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn Location;\n\t\t\t}\n\t\t}\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (Location.Line, Location.Column + \"base\".Length);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitBaseReferenceExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitBaseReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitBaseReferenceExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tBaseReferenceExpression o = other as BaseReferenceExpression;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BinaryOperatorExpression.cs",
    "content": "﻿// \n// BinaryOperatorExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq.Expressions;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Left Operator Right\n\t/// </summary>\n\tpublic class BinaryOperatorExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole BitwiseAndRole = new TokenRole (\"&\");\n\t\tpublic readonly static TokenRole BitwiseOrRole = new TokenRole (\"|\");\n\t\tpublic readonly static TokenRole ConditionalAndRole = new TokenRole (\"&&\");\n\t\tpublic readonly static TokenRole ConditionalOrRole = new TokenRole (\"||\");\n\t\tpublic readonly static TokenRole ExclusiveOrRole = new TokenRole (\"^\");\n\t\tpublic readonly static TokenRole GreaterThanRole = new TokenRole (\">\");\n\t\tpublic readonly static TokenRole GreaterThanOrEqualRole = new TokenRole (\">=\");\n\t\tpublic readonly static TokenRole EqualityRole = new TokenRole (\"==\");\n\t\tpublic readonly static TokenRole InEqualityRole = new TokenRole (\"!=\");\n\t\tpublic readonly static TokenRole LessThanRole = new TokenRole (\"<\");\n\t\tpublic readonly static TokenRole LessThanOrEqualRole = new TokenRole (\"<=\");\n\t\tpublic readonly static TokenRole AddRole = new TokenRole (\"+\");\n\t\tpublic readonly static TokenRole SubtractRole = new TokenRole (\"-\");\n\t\tpublic readonly static TokenRole MultiplyRole = new TokenRole (\"*\");\n\t\tpublic readonly static TokenRole DivideRole = new TokenRole (\"/\");\n\t\tpublic readonly static TokenRole ModulusRole = new TokenRole (\"%\");\n\t\tpublic readonly static TokenRole ShiftLeftRole = new TokenRole (\"<<\");\n\t\tpublic readonly static TokenRole ShiftRightRole = new TokenRole (\">>\");\n\t\tpublic readonly static TokenRole NullCoalescingRole = new TokenRole (\"??\");\n\t\t\n\t\tpublic readonly static Role<Expression> LeftRole = new Role<Expression>(\"Left\", Expression.Null);\n\t\tpublic readonly static Role<Expression> RightRole = new Role<Expression>(\"Right\", Expression.Null);\n\t\t\n\t\tpublic BinaryOperatorExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic BinaryOperatorExpression(Expression left, BinaryOperatorType op, Expression right)\n\t\t{\n\t\t\tthis.Left = left;\n\t\t\tthis.Operator = op;\n\t\t\tthis.Right = right;\n\t\t}\n\t\t\n\t\tpublic BinaryOperatorType Operator {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic Expression Left {\n\t\t\tget { return GetChildByRole (LeftRole); }\n\t\t\tset { SetChildByRole(LeftRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode OperatorToken {\n\t\t\tget { return GetChildByRole (GetOperatorRole (Operator)); }\n\t\t}\n\t\t\n\t\tpublic Expression Right {\n\t\t\tget { return GetChildByRole (RightRole); }\n\t\t\tset { SetChildByRole (RightRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitBinaryOperatorExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitBinaryOperatorExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitBinaryOperatorExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tBinaryOperatorExpression o = other as BinaryOperatorExpression;\n\t\t\treturn o != null && (this.Operator == BinaryOperatorType.Any || this.Operator == o.Operator)\n\t\t\t\t&& this.Left.DoMatch(o.Left, match) && this.Right.DoMatch(o.Right, match);\n\t\t}\n\t\t\n\t\tpublic static TokenRole GetOperatorRole (BinaryOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\treturn BitwiseAndRole;\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\treturn BitwiseOrRole;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\treturn ConditionalAndRole;\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\treturn ConditionalOrRole;\n\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\treturn ExclusiveOrRole;\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\treturn GreaterThanRole;\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\treturn GreaterThanOrEqualRole;\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\t\treturn EqualityRole;\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\treturn InEqualityRole;\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\treturn LessThanRole;\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\treturn LessThanOrEqualRole;\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\t\treturn AddRole;\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\treturn SubtractRole;\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\t\treturn MultiplyRole;\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\t\treturn DivideRole;\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\treturn ModulusRole;\n\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\t\treturn ShiftLeftRole;\n\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\treturn ShiftRightRole;\n\t\t\t\tcase BinaryOperatorType.NullCoalescing:\n\t\t\t\t\treturn NullCoalescingRole;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for BinaryOperatorType\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static ExpressionType GetLinqNodeType(BinaryOperatorType op, bool checkForOverflow)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\treturn ExpressionType.And;\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\treturn ExpressionType.Or;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\treturn ExpressionType.AndAlso;\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\treturn ExpressionType.OrElse;\n\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\treturn ExpressionType.ExclusiveOr;\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\treturn ExpressionType.GreaterThan;\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\treturn ExpressionType.GreaterThanOrEqual;\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\t\treturn ExpressionType.Equal;\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\treturn ExpressionType.NotEqual;\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\treturn ExpressionType.LessThan;\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\treturn ExpressionType.LessThanOrEqual;\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\t\treturn checkForOverflow ? ExpressionType.AddChecked : ExpressionType.Add;\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\treturn checkForOverflow ? ExpressionType.SubtractChecked : ExpressionType.Subtract;\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\t\treturn checkForOverflow ? ExpressionType.MultiplyChecked : ExpressionType.Multiply;\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\t\treturn ExpressionType.Divide;\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\treturn ExpressionType.Modulo;\n\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\t\treturn ExpressionType.LeftShift;\n\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\treturn ExpressionType.RightShift;\n\t\t\t\tcase BinaryOperatorType.NullCoalescing:\n\t\t\t\t\treturn ExpressionType.Coalesce;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for BinaryOperatorType\");\n\t\t\t}\n\t\t}\n\t\t#region Builder methods\n\t\tpublic override MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = new ParenthesizedExpression(this);\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\t\t#endregion\n\t}\n\t\n\tpublic enum BinaryOperatorType\n\t{\n\t\t/// <summary>\n\t\t/// Any binary operator (used in pattern matching)\n\t\t/// </summary>\n\t\tAny,\n\t\t\n\t\t// We avoid 'logical or' on purpose, because it's not clear if that refers to the bitwise\n\t\t// or to the short-circuiting (conditional) operator:\n\t\t// MCS and old NRefactory used bitwise='|', logical='||'\n\t\t// but the C# spec uses logical='|', conditional='||'\n\t\t/// <summary>left &amp; right</summary>\n\t\tBitwiseAnd,\n\t\t/// <summary>left | right</summary>\n\t\tBitwiseOr,\n\t\t/// <summary>left &amp;&amp; right</summary>\n\t\tConditionalAnd,\n\t\t/// <summary>left || right</summary>\n\t\tConditionalOr,\n\t\t/// <summary>left ^ right</summary>\n\t\tExclusiveOr,\n\t\t\n\t\t/// <summary>left &gt; right</summary>\n\t\tGreaterThan,\n\t\t/// <summary>left &gt;= right</summary>\n\t\tGreaterThanOrEqual,\n\t\t/// <summary>left == right</summary>\n\t\tEquality,\n\t\t/// <summary>left != right</summary>\n\t\tInEquality,\n\t\t/// <summary>left &lt; right</summary>\n\t\tLessThan,\n\t\t/// <summary>left &lt;= right</summary>\n\t\tLessThanOrEqual,\n\t\t\n\t\t/// <summary>left + right</summary>\n\t\tAdd,\n\t\t/// <summary>left - right</summary>\n\t\tSubtract,\n\t\t/// <summary>left * right</summary>\n\t\tMultiply,\n\t\t/// <summary>left / right</summary>\n\t\tDivide,\n\t\t/// <summary>left % right</summary>\n\t\tModulus,\n\t\t\n\t\t/// <summary>left &lt;&lt; right</summary>\n\t\tShiftLeft,\n\t\t/// <summary>left &gt;&gt; right</summary>\n\t\tShiftRight,\n\t\t\n\t\t/// <summary>left ?? right</summary>\n\t\tNullCoalescing\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CastExpression.cs",
    "content": "﻿// \n// CastExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// (CastTo)Expression\n\t/// </summary>\n\tpublic class CastExpression : Expression\n\t{\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CastExpression ()\n\t\t{\n\t\t}\n\n\t\tpublic CastExpression (AstType castToType, Expression expression)\n\t\t{\n\t\t\tAddChild (castToType, Roles.Type);\n\t\t\tAddChild (expression, Roles.Expression);\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitCastExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitCastExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitCastExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCastExpression o = other as CastExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\n\t\t#region Builder methods\n\t\tpublic override MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = new ParenthesizedExpression(this);\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CheckedExpression.cs",
    "content": "﻿// \n// CheckedExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// checked(Expression)\n\t/// </summary>\n\tpublic class CheckedExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole CheckedKeywordRole = new TokenRole (\"checked\");\n\t\t\n\t\tpublic CSharpTokenNode CheckedToken {\n\t\t\tget { return GetChildByRole (CheckedKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole(Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic CheckedExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic CheckedExpression (Expression expression)\n\t\t{\n\t\t\tAddChild (expression, Roles.Expression);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitCheckedExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitCheckedExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitCheckedExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCheckedExpression o = other as CheckedExpression;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ConditionalExpression.cs",
    "content": "﻿// \n// ConditionalExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Condition ? TrueExpression : FalseExpression\n\t/// </summary>\n\tpublic class ConditionalExpression : Expression\n\t{\n\t\tpublic readonly static Role<Expression> ConditionRole = Roles.Condition;\n\t\tpublic readonly static TokenRole QuestionMarkRole = new TokenRole(\"?\");\n\t\tpublic readonly static Role<Expression> TrueRole = new Role<Expression>(\"True\", Expression.Null);\n\t\tpublic readonly static TokenRole ColonRole = Roles.Colon;\n\t\tpublic readonly static Role<Expression> FalseRole = new Role<Expression>(\"False\", Expression.Null);\n\t\t\n\t\tpublic Expression Condition {\n\t\t\tget { return GetChildByRole(ConditionRole); }\n\t\t\tset { SetChildByRole(ConditionRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode QuestionMarkToken {\n\t\t\tget { return GetChildByRole (QuestionMarkRole); }\n\t\t}\n\t\t\n\t\tpublic Expression TrueExpression {\n\t\t\tget { return GetChildByRole(TrueRole); }\n\t\t\tset { SetChildByRole(TrueRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode ColonToken {\n\t\t\tget { return GetChildByRole (ColonRole); }\n\t\t}\n\t\t\n\t\tpublic Expression FalseExpression {\n\t\t\tget { return GetChildByRole(FalseRole); }\n\t\t\tset { SetChildByRole(FalseRole, value); }\n\t\t}\n\t\t\n\t\tpublic ConditionalExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ConditionalExpression (Expression condition, Expression trueExpression, Expression falseExpression)\n\t\t{\n\t\t\tAddChild (condition, ConditionRole);\n\t\t\tAddChild (trueExpression, TrueRole);\n\t\t\tAddChild (falseExpression, FalseRole);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitConditionalExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitConditionalExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitConditionalExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tConditionalExpression o = other as ConditionalExpression;\n\t\t\treturn o != null && this.Condition.DoMatch(o.Condition, match) && this.TrueExpression.DoMatch(o.TrueExpression, match) && this.FalseExpression.DoMatch(o.FalseExpression, match);\n\t\t}\n\n\t\t#region Builder methods\n\t\tpublic override MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = new ParenthesizedExpression(this);\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DefaultValueExpression.cs",
    "content": "﻿// \n// DefaultValueExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// default(Type)\n\t/// </summary>\n\tpublic class DefaultValueExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole DefaultKeywordRole = new TokenRole (\"default\");\n\n\t\tpublic CSharpTokenNode DefaultToken {\n\t\t\tget { return GetChildByRole (DefaultKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic DefaultValueExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DefaultValueExpression (AstType type)\n\t\t{\n\t\t\tAddChild (type, Roles.Type);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitDefaultValueExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitDefaultValueExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitDefaultValueExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tDefaultValueExpression o = other as DefaultValueExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DirectionExpression.cs",
    "content": "﻿// \n// DirectionExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum FieldDirection\n\t{\n\t\tNone,\n\t\tOut,\n\t\tRef\n\t}\n\t\n\t/// <summary>\n\t/// ref Expression\n\t/// </summary>\n\tpublic class DirectionExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole RefKeywordRole = new TokenRole (\"ref\");\n\t\tpublic readonly static TokenRole OutKeywordRole = new TokenRole (\"out\");\n\t\t\n\t\tpublic FieldDirection FieldDirection {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode FieldDirectionToken {\n\t\t\tget { return FieldDirection == ICSharpCode.NRefactory.CSharp.FieldDirection.Ref ? GetChildByRole (RefKeywordRole) : GetChildByRole (OutKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic DirectionExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic DirectionExpression (FieldDirection direction, Expression expression)\n\t\t{\n\t\t\tthis.FieldDirection = direction;\n\t\t\tAddChild (expression, Roles.Expression);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitDirectionExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitDirectionExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitDirectionExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tDirectionExpression o = other as DirectionExpression;\n\t\t\treturn o != null && this.FieldDirection == o.FieldDirection && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ErrorExpression.cs",
    "content": "﻿// \n// ErrorExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[Obsolete(\"This class is obsolete. Remove all referencing code.\")]\n\tpublic class EmptyExpression : AstNode\n\t{\n\t\t#region implemented abstract members of AstNode\n\n\t\tpublic override void AcceptVisitor(IAstVisitor visitor)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic override T AcceptVisitor<T>(IAstVisitor<T> visitor)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tprotected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\n\t}\n\n\tpublic class ErrorExpression : Expression\n\t{\n\t\tTextLocation location;\n\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Error {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\tpublic ErrorExpression ()\n\t\t{\n\t\t}\n\n\t\tpublic ErrorExpression (TextLocation location)\n\t\t{\n\t\t\tthis.location = location;\n\t\t}\n\n\t\tpublic ErrorExpression (string error)\n\t\t{\n\t\t\tthis.Error = error;\n\t\t}\n\n\t\tpublic ErrorExpression (string error, TextLocation location)\n\t\t{\n\t\t\tthis.location = location;\n\t\t\tthis.Error = error;\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitErrorNode(this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitErrorNode(this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitErrorNode(this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch (AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as ErrorExpression;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/Expression.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Base class for expressions.\n\t/// </summary>\n\t/// <remarks>\n\t/// This class is useful even though it doesn't provide any additional functionality:\n\t/// It can be used to communicate more information in APIs, e.g. \"this subnode will always be an expression\"\n\t/// </remarks>\n\tpublic abstract class Expression : AstNode\n\t{\n\t\t#region Null\n\t\tpublic new static readonly Expression Null = new NullExpression ();\n\t\t\n\t\tsealed class NullExpression : Expression\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator Expression(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : Expression, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Expression;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic new Expression Clone()\n\t\t{\n\t\t\treturn (Expression)base.Clone();\n\t\t}\n\n\t\tpublic Expression ReplaceWith(Func<Expression, Expression> replaceFunction)\n\t\t{\n\t\t\tif (replaceFunction == null)\n\t\t\t\tthrow new ArgumentNullException(\"replaceFunction\");\n\t\t\treturn (Expression)base.ReplaceWith(node => replaceFunction((Expression)node));\n\t\t}\n\t\t\n\t\t#region Builder methods\n\t\t/// <summary>\n\t\t/// Builds an member reference expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an indexer expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = this;\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an indexer expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = this;\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual InvocationExpression Invoke(string methodName, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\treturn Invoke(methodName, null, arguments);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual InvocationExpression Invoke(string methodName, params Expression[] arguments)\n\t\t{\n\t\t\treturn Invoke(methodName, null, arguments);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = this;\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = this;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Builds an invocation expression using this expression as target.\n\t\t/// </summary>\n\t\tpublic virtual InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = this;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\t\t\n\t\tpublic virtual CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = this };\n\t\t}\n\t\t\n\t\tpublic virtual AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = this };\n\t\t}\n\t\t\n\t\tpublic virtual IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = this };\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IdentifierExpression.cs",
    "content": "﻿// \n// IdentifierExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class IdentifierExpression : Expression\n\t{\n\t\tpublic IdentifierExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic IdentifierExpression(string identifier)\n\t\t{\n\t\t\tthis.Identifier = identifier;\n\t\t}\n\t\t\n\t\tpublic IdentifierExpression(string identifier, TextLocation location)\n\t\t{\n\t\t\tSetChildByRole(Roles.Identifier, CSharp.Identifier.Create (identifier, location));\n\t\t}\n\t\t\n//\t\tpublic Identifier IdentifierToken {\n//\t\t\tget { return GetChildByRole (Roles.Identifier); }\n//\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\n\t\tpublic Identifier IdentifierToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic AstNodeCollection<AstType> TypeArguments {\n\t\t\tget { return GetChildrenByRole (Roles.TypeArgument); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitIdentifierExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitIdentifierExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitIdentifierExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tIdentifierExpression o = other as IdentifierExpression;\n\t\t\treturn o != null && MatchString(this.Identifier, o.Identifier) && this.TypeArguments.DoMatch(o.TypeArguments, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IndexerExpression.cs",
    "content": "﻿// \n// IndexerExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Target[Arguments]\n\t/// </summary>\n\tpublic class IndexerExpression : Expression\n\t{\n\t\tpublic Expression Target {\n\t\t\tget { return GetChildByRole (Roles.TargetExpression); }\n\t\t\tset { SetChildByRole(Roles.TargetExpression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBracketToken {\n\t\t\tget { return GetChildByRole (Roles.LBracket); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Arguments {\n\t\t\tget { return GetChildrenByRole<Expression>(Roles.Argument); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBracketToken {\n\t\t\tget { return GetChildByRole (Roles.RBracket); }\n\t\t}\n\t\t\n\t\tpublic IndexerExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic IndexerExpression (Expression target, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tAddChild (target, Roles.TargetExpression);\n\t\t\tif (arguments != null) {\n\t\t\t\tforeach (var arg in arguments) {\n\t\t\t\t\tAddChild (arg, Roles.Argument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IndexerExpression (Expression target, params Expression[] arguments) : this (target, (IEnumerable<Expression>)arguments)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitIndexerExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitIndexerExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitIndexerExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tIndexerExpression o = other as IndexerExpression;\n\t\t\treturn o != null && this.Target.DoMatch(o.Target, match) && this.Arguments.DoMatch(o.Arguments, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/InvocationExpression.cs",
    "content": "﻿// \n// InvocationExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Target(Arguments)\n\t/// </summary>\n\tpublic class InvocationExpression : Expression\n\t{\n\t\tpublic Expression Target {\n\t\t\tget { return GetChildByRole (Roles.TargetExpression); }\n\t\t\tset { SetChildByRole(Roles.TargetExpression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Arguments {\n\t\t\tget { return GetChildrenByRole<Expression>(Roles.Argument); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitInvocationExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitInvocationExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitInvocationExpression (this, data);\n\t\t}\n\t\t\n\t\tpublic InvocationExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic InvocationExpression (Expression target, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tAddChild (target, Roles.TargetExpression);\n\t\t\tif (arguments != null) {\n\t\t\t\tforeach (var arg in arguments) {\n\t\t\t\t\tAddChild (arg, Roles.Argument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic InvocationExpression (Expression target, params Expression[] arguments) : this (target, (IEnumerable<Expression>)arguments)\n\t\t{\n\t\t}\t\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tInvocationExpression o = other as InvocationExpression;\n\t\t\treturn o != null && this.Target.DoMatch(o.Target, match) && this.Arguments.DoMatch(o.Arguments, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IsExpression.cs",
    "content": "﻿// \n// TypeOfIsExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Expression is Type\n\t/// </summary>\n\tpublic class IsExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole IsKeywordRole = new TokenRole (\"is\");\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole(Roles.Expression); }\n\t\t\tset { SetChildByRole(Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode IsToken {\n\t\t\tget { return GetChildByRole (IsKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole(Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\n\t\tpublic IsExpression()\n\t\t{\n\t\t}\n\n\t\tpublic IsExpression (Expression expression, AstType type)\n\t\t{\n\t\t\tAddChild (expression, Roles.Expression);\n\t\t\tAddChild (type, Roles.Type);\n\t\t}\n\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitIsExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitIsExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitIsExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tIsExpression o = other as IsExpression;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match) && this.Type.DoMatch(o.Type, match);\n\t\t}\n\n\t\t#region Builder methods\n\t\tpublic override MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = new ParenthesizedExpression(this);\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/LambdaExpression.cs",
    "content": "﻿// \n// LambdaExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// [async] Parameters => Body\n\t/// </summary>\n\tpublic class LambdaExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole AsyncModifierRole = new TokenRole (\"async\");\n\t\tpublic readonly static TokenRole ArrowRole = new TokenRole (\"=>\");\n\t\tpublic static readonly Role<AstNode> BodyRole = new Role<AstNode>(\"Body\", AstNode.Null);\n\t\t\n\t\tbool isAsync;\n\t\t\n\t\tpublic bool IsAsync {\n\t\t\tget { return isAsync; }\n\t\t\tset { ThrowIfFrozen(); isAsync = value; }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\n\t\tpublic CSharpTokenNode ArrowToken {\n\t\t\tget { return GetChildByRole (ArrowRole); }\n\t\t}\n\t\t\n\t\tpublic AstNode Body {\n\t\t\tget { return GetChildByRole (BodyRole); }\n\t\t\tset { SetChildByRole (BodyRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitLambdaExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitLambdaExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitLambdaExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tLambdaExpression o = other as LambdaExpression;\n\t\t\treturn o != null && this.IsAsync == o.IsAsync && this.Parameters.DoMatch(o.Parameters, match) && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/MemberReferenceExpression.cs",
    "content": "﻿// \n// MemberReferenceExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Target.MemberName\n\t/// </summary>\n\tpublic class MemberReferenceExpression : Expression\n\t{\n\t\tpublic Expression Target {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole(Roles.TargetExpression);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.TargetExpression, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode DotToken {\n\t\t\tget { return GetChildByRole (Roles.Dot); }\n\t\t}\n\t\t\n\t\tpublic string MemberName {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier MemberNameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LChevronToken {\n\t\t\tget { return GetChildByRole (Roles.LChevron); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstType> TypeArguments {\n\t\t\tget { return GetChildrenByRole (Roles.TypeArgument); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RChevronToken {\n\t\t\tget { return GetChildByRole (Roles.RChevron); }\n\t\t}\n\t\t\n\t\tpublic MemberReferenceExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic MemberReferenceExpression (Expression target, string memberName, IEnumerable<AstType> arguments = null)\n\t\t{\n\t\t\tAddChild (target, Roles.TargetExpression);\n\t\t\tMemberName = memberName;\n\t\t\tif (arguments != null) {\n\t\t\t\tforeach (var arg in arguments) {\n\t\t\t\t\tAddChild (arg, Roles.TypeArgument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic MemberReferenceExpression (Expression target, string memberName, params AstType[] arguments) : this (target, memberName, (IEnumerable<AstType>)arguments)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitMemberReferenceExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitMemberReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitMemberReferenceExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tMemberReferenceExpression o = other as MemberReferenceExpression;\n\t\t\treturn o != null && this.Target.DoMatch(o.Target, match) && MatchString(this.MemberName, o.MemberName) && this.TypeArguments.DoMatch(o.TypeArguments, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedArgumentExpression.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Represents a named argument passed to a method or attribute.\n\t/// name: expression\n\t/// </summary>\n\tpublic class NamedArgumentExpression : Expression\n\t{\n\t\tpublic NamedArgumentExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic NamedArgumentExpression(string name, Expression expression)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Expression = expression;\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier NameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode ColonToken {\n\t\t\tget { return GetChildByRole (Roles.Colon); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitNamedArgumentExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitNamedArgumentExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitNamedArgumentExpression(this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tNamedArgumentExpression o = other as NamedArgumentExpression;\n\t\t\treturn o != null && MatchString(this.Name, o.Name) && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedExpression.cs",
    "content": "﻿// \n// NamedExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// name = expression\n\t/// This isn't the same as 'assign' even though it has the same syntax.\n\t/// This expression is used in object initializers and for named attribute arguments [Attr(FieldName = value)].\n\t/// </summary>\n\tpublic class NamedExpression : Expression\n\t{\n\t\tpublic NamedExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic NamedExpression (string name, Expression expression)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Expression = expression;\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier NameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode AssignToken {\n\t\t\tget { return GetChildByRole (Roles.Assign); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitNamedExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitNamedExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitNamedExpression(this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as NamedExpression;\n\t\t\treturn o != null && MatchString(this.Name, o.Name) && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NullReferenceExpression.cs",
    "content": "﻿// \n// NullReferenceExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// null\n\t/// </summary>\n\tpublic class NullReferenceExpression : Expression\n\t{\n\t\tTextLocation location;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal void SetStartLocation(TextLocation value)\n\t\t{\n\t\t\tThrowIfFrozen();\n\t\t\tthis.location = value;\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (location.Line, location.Column + \"null\".Length);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic NullReferenceExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic NullReferenceExpression (TextLocation location)\n\t\t{\n\t\t\tthis.location = location;\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitNullReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitNullReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitNullReferenceExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tNullReferenceExpression o = other as NullReferenceExpression;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ObjectCreateExpression.cs",
    "content": "﻿// \n// ObjectCreateExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// new Type(Arguments) { Initializer }\n\t/// </summary>\n\tpublic class ObjectCreateExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole NewKeywordRole = new TokenRole (\"new\");\n\t\tpublic readonly static Role<ArrayInitializerExpression> InitializerRole = ArrayCreateExpression.InitializerRole;\n\t\t\n\t\tpublic CSharpTokenNode NewToken {\n\t\t\tget { return GetChildByRole (NewKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Arguments {\n\t\t\tget { return GetChildrenByRole (Roles.Argument); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic ArrayInitializerExpression Initializer {\n\t\t\tget { return GetChildByRole (InitializerRole); }\n\t\t\tset { SetChildByRole (InitializerRole, value); }\n\t\t}\n\t\t\n\t\tpublic ObjectCreateExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ObjectCreateExpression (AstType type, IEnumerable<Expression> arguments = null)\n\t\t{\n\t\t\tAddChild (type, Roles.Type);\n\t\t\tif (arguments != null) {\n\t\t\t\tforeach (var arg in arguments) {\n\t\t\t\t\tAddChild (arg, Roles.Argument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ObjectCreateExpression (AstType type, params Expression[] arguments) : this (type, (IEnumerable<Expression>)arguments)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitObjectCreateExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitObjectCreateExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitObjectCreateExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tObjectCreateExpression o = other as ObjectCreateExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match) && this.Arguments.DoMatch(o.Arguments, match) && this.Initializer.DoMatch(o.Initializer, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ParenthesizedExpression.cs",
    "content": "﻿// \n// ParenthesizedExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// ( Expression )\n\t/// </summary>\n\tpublic class ParenthesizedExpression : Expression\n\t{\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic ParenthesizedExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ParenthesizedExpression(Expression expr)\n\t\t{\n\t\t\tExpression = expr;\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitParenthesizedExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitParenthesizedExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitParenthesizedExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tParenthesizedExpression o = other as ParenthesizedExpression;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the expression acts like a parenthesized expression,\n\t\t/// i.e. whether information about the expected type (for lambda type inference) flows\n\t\t/// into the inner expression.\n\t\t/// </summary>\n\t\t/// <returns>Returns true for ParenthesizedExpression, CheckedExpression or UncheckedExpression; false otherwise.</returns>\n\t\tpublic static bool ActsAsParenthesizedExpression(AstNode expression)\n\t\t{\n\t\t\treturn expression is ParenthesizedExpression || expression is CheckedExpression || expression is UncheckedExpression;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Unpacks the given expression if it is a ParenthesizedExpression, CheckedExpression or UncheckedExpression.\n\t\t/// </summary>\n\t\tpublic static Expression UnpackParenthesizedExpression(Expression expr)\n\t\t{\n\t\t\twhile (ActsAsParenthesizedExpression(expr))\n\t\t\t\texpr = expr.GetChildByRole(Roles.Expression);\n\t\t\treturn expr;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PointerReferenceExpression.cs",
    "content": "﻿// \n// PointerReferenceExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Target->MemberName\n\t/// </summary>\n\tpublic class PointerReferenceExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole ArrowRole = new TokenRole (\"->\");\n\t\t\n\t\tpublic Expression Target {\n\t\t\tget { return GetChildByRole (Roles.TargetExpression); }\n\t\t\tset { SetChildByRole(Roles.TargetExpression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode ArrowToken {\n\t\t\tget { return GetChildByRole (ArrowRole); }\n\t\t}\n\t\t\n\t\tpublic string MemberName {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier MemberNameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstType> TypeArguments {\n\t\t\tget { return GetChildrenByRole (Roles.TypeArgument); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitPointerReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitPointerReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitPointerReferenceExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tPointerReferenceExpression o = other as PointerReferenceExpression;\n\t\t\treturn o != null && MatchString(this.MemberName, o.MemberName) && this.TypeArguments.DoMatch(o.TypeArguments, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs",
    "content": "﻿// \n// PrimitiveExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Represents a literal value.\n\t/// </summary>\n\tpublic class PrimitiveExpression : Expression\n\t{\n\t\tpublic static readonly object AnyValue = new object();\n\t\t\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal void SetStartLocation(TextLocation value)\n\t\t{\n\t\t\tThrowIfFrozen();\n\t\t\tthis.startLocation = value;\n\t\t\tthis.endLocation = null;\n\t\t}\n\t\t\n\t\tstring literalValue;\n\t\tTextLocation? endLocation;\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\tif (!endLocation.HasValue) {\n\t\t\t\t\tendLocation = value is string ? AdvanceLocation (StartLocation, literalValue ?? \"\") :\n\t\t\t\t\t\tnew TextLocation (StartLocation.Line, StartLocation.Column + (literalValue ?? \"\").Length);\n\t\t\t\t}\n\t\t\t\treturn endLocation.Value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tobject value;\n\t\t\n\t\tpublic object Value {\n\t\t\tget { return this.value; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tthis.value = value;\n\t\t\t\tliteralValue = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <remarks>Never returns null.</remarks>\n\t\tpublic string LiteralValue {\n\t\t\tget { return literalValue ?? \"\"; }\n\t\t}\n\t\t\n\t\t/// <remarks>Can be null.</remarks>\n\t\tpublic string UnsafeLiteralValue {\n\t\t\tget { return literalValue; }\n\t\t}\n\t\t\n\t\tpublic void SetValue(object value, string literalValue)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\tThrowIfFrozen();\n\t\t\tthis.value = value;\n\t\t\tthis.literalValue = literalValue;\n\t\t}\n\t\t\n\t\tpublic PrimitiveExpression (object value)\n\t\t{\n\t\t\tthis.Value = value;\n\t\t\tthis.literalValue = null;\n\t\t}\n\t\t\n\t\tpublic PrimitiveExpression (object value, string literalValue)\n\t\t{\n\t\t\tthis.Value = value;\n\t\t\tthis.literalValue = literalValue;\n\t\t}\n\t\t\n\t\tpublic PrimitiveExpression (object value, TextLocation startLocation, string literalValue)\n\t\t{\n\t\t\tthis.Value = value;\n\t\t\tthis.startLocation = startLocation;\n\t\t\tthis.literalValue = literalValue;\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitPrimitiveExpression (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitPrimitiveExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitPrimitiveExpression (this, data);\n\t\t}\n\n\t\tunsafe static TextLocation AdvanceLocation(TextLocation startLocation, string str)\n\t\t{\n\t\t\tint line = startLocation.Line;\n\t\t\tint col  = startLocation.Column;\n\t\t\tfixed (char* start = str) {\n\t\t\t\tchar* p = start;\n\t\t\t\tchar* endPtr = start + str.Length;\n\t\t\t\twhile (p < endPtr) {\n\t\t\t\t\tvar nl = NewLine.GetDelimiterLength(*p, () => {\n\t\t\t\t\t\tchar* nextp = p + 1;\n\t\t\t\t\t\tif (nextp < endPtr)\n\t\t\t\t\t\t\treturn *nextp;\n\t\t\t\t\t\treturn '\\0';\n\t\t\t\t\t});\n\t\t\t\t\tif (nl > 0) {\n\t\t\t\t\t\tline++;\n\t\t\t\t\t\tcol = 1;\n\t\t\t\t\t\tif (nl == 2)\n\t\t\t\t\t\t\tp++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcol++;\n\t\t\t\t\t}\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new TextLocation (line, col);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tPrimitiveExpression o = other as PrimitiveExpression;\n\t\t\treturn o != null && (this.Value == AnyValue || object.Equals(this.Value, o.Value));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class QueryExpression : Expression\n\t{\n\t\tpublic static readonly Role<QueryClause> ClauseRole = new Role<QueryClause>(\"Clause\");\n\t\t\n\t\t#region Null\n\t\tpublic new static readonly QueryExpression Null = new NullQueryExpression ();\n\t\t\n\t\tsealed class NullQueryExpression : QueryExpression\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic AstNodeCollection<QueryClause> Clauses {\n\t\t\tget { return GetChildrenByRole(ClauseRole); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryExpression o = other as QueryExpression;\n\t\t\treturn o != null && !o.IsNull && this.Clauses.DoMatch(o.Clauses, match);\n\t\t}\n\n\t\t#region Builder methods\n\t\tpublic override MemberReferenceExpression Member(string memberName)\n\t\t{\n\t\t\treturn new MemberReferenceExpression { Target = this, MemberName = memberName };\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override IndexerExpression Indexer(params Expression[] arguments)\n\t\t{\n\t\t\tIndexerExpression expr = new IndexerExpression();\n\t\t\texpr.Target = new ParenthesizedExpression(this);\n\t\t\texpr.Arguments.AddRange(arguments);\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tMemberReferenceExpression mre = new MemberReferenceExpression();\n\t\t\tmre.Target = new ParenthesizedExpression(this);\n\t\t\tmre.MemberName = methodName;\n\t\t\tmre.TypeArguments.AddRange(typeArguments);\n\t\t\tie.Target = mre;\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override InvocationExpression Invoke(params Expression[] arguments)\n\t\t{\n\t\t\tInvocationExpression ie = new InvocationExpression();\n\t\t\tie.Target = new ParenthesizedExpression(this);\n\t\t\tie.Arguments.AddRange(arguments);\n\t\t\treturn ie;\n\t\t}\n\n\t\tpublic override CastExpression CastTo(AstType type)\n\t\t{\n\t\t\treturn new CastExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override AsExpression CastAs(AstType type)\n\t\t{\n\t\t\treturn new AsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\n\t\tpublic override IsExpression IsType(AstType type)\n\t\t{\n\t\t\treturn new IsExpression { Type = type,  Expression = new ParenthesizedExpression(this) };\n\t\t}\n\t\t#endregion\n\t}\n\t\n\tpublic abstract class QueryClause : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.QueryClause; }\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents a query continuation.\n\t/// \"(from .. select ..) into Identifier\" or \"(from .. group .. by ..) into Identifier\"\n\t/// Note that \"join .. into ..\" is not a query continuation!\n\t/// \n\t/// This is always the first(!!) clause in a query expression.\n\t/// The tree for \"from a in b select c into d select e\" looks like this:\n\t/// new QueryExpression {\n\t/// \tnew QueryContinuationClause {\n\t/// \t\tPrecedingQuery = new QueryExpression {\n\t/// \t\t\tnew QueryFromClause(a in b),\n\t/// \t\t\tnew QuerySelectClause(c)\n\t/// \t\t},\n\t/// \t\tIdentifier = d\n\t/// \t},\n\t/// \tnew QuerySelectClause(e)\n\t/// }\n\t/// </summary>\n\tpublic class QueryContinuationClause : QueryClause\n\t{\n\t\tpublic static readonly Role<QueryExpression> PrecedingQueryRole = new Role<QueryExpression>(\"PrecedingQuery\", QueryExpression.Null);\n\t\tpublic static readonly TokenRole IntoKeywordRole = new TokenRole (\"into\");\n\t\t\n\t\tpublic QueryExpression PrecedingQuery {\n\t\t\tget { return GetChildByRole(PrecedingQueryRole); }\n\t\t\tset { SetChildByRole(PrecedingQueryRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode IntoKeyword {\n\t\t\tget { return GetChildByRole (IntoKeywordRole); }\n\t\t}\n\n\t\tpublic string Identifier {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier IdentifierToken {\n\t\t\tget { return GetChildByRole (Roles.Identifier); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryContinuationClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryContinuationClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryContinuationClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryContinuationClause o = other as QueryContinuationClause;\n\t\t\treturn o != null && MatchString(this.Identifier, o.Identifier) && this.PrecedingQuery.DoMatch(o.PrecedingQuery, match);\n\t\t}\n\t}\n\t\n\tpublic class QueryFromClause : QueryClause\n\t{\n\t\tpublic static readonly TokenRole FromKeywordRole =  new TokenRole (\"from\");\n\t\tpublic static readonly TokenRole InKeywordRole =  new TokenRole (\"in\");\n\t\t\n\t\tpublic CSharpTokenNode FromKeyword {\n\t\t\tget { return GetChildByRole (FromKeywordRole); }\n\t\t}\n\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier IdentifierToken {\n\t\t\tget { return GetChildByRole(Roles.Identifier); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode InKeyword {\n\t\t\tget { return GetChildByRole (InKeywordRole); }\n\t\t}\n\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryFromClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryFromClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryFromClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryFromClause o = other as QueryFromClause;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match) && MatchString(this.Identifier, o.Identifier)\n\t\t\t\t&& this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n\t\n\tpublic class QueryLetClause : QueryClause\n\t{\n\t\tpublic readonly static TokenRole LetKeywordRole = new TokenRole (\"let\");\n\t\t\n\t\tpublic CSharpTokenNode LetKeyword {\n\t\t\tget { return GetChildByRole(LetKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole(Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier IdentifierToken {\n\t\t\tget { return GetChildByRole(Roles.Identifier); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode AssignToken {\n\t\t\tget { return GetChildByRole(Roles.Assign); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole(Roles.Expression); }\n\t\t\tset { SetChildByRole(Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryLetClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryLetClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryLetClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryLetClause o = other as QueryLetClause;\n\t\t\treturn o != null && MatchString(this.Identifier, o.Identifier) && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n\t\n\t\n\tpublic class QueryWhereClause : QueryClause\n\t{\n\t\tpublic readonly static TokenRole WhereKeywordRole = new TokenRole (\"where\");\n\n\t\tpublic CSharpTokenNode WhereKeyword {\n\t\t\tget { return GetChildByRole (WhereKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Condition {\n\t\t\tget { return GetChildByRole (Roles.Condition); }\n\t\t\tset { SetChildByRole (Roles.Condition, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryWhereClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryWhereClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryWhereClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryWhereClause o = other as QueryWhereClause;\n\t\t\treturn o != null && this.Condition.DoMatch(o.Condition, match);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents a join or group join clause.\n\t/// </summary>\n\tpublic class QueryJoinClause : QueryClause\n\t{\n\t\tpublic static readonly TokenRole JoinKeywordRole = new TokenRole (\"join\");\n\t\tpublic static readonly Role<AstType> TypeRole = Roles.Type;\n\t\tpublic static readonly Role<Identifier> JoinIdentifierRole = Roles.Identifier;\n\t\tpublic static readonly TokenRole InKeywordRole =  new TokenRole (\"in\");\n\t\tpublic static readonly Role<Expression> InExpressionRole = Roles.Expression;\n\t\tpublic static readonly TokenRole OnKeywordRole =  new TokenRole (\"on\");\n\t\tpublic static readonly Role<Expression> OnExpressionRole = new Role<Expression>(\"OnExpression\", Expression.Null);\n\t\tpublic static readonly TokenRole EqualsKeywordRole =  new TokenRole (\"equals\");\n\t\tpublic static readonly Role<Expression> EqualsExpressionRole = new Role<Expression>(\"EqualsExpression\", Expression.Null);\n\t\tpublic static readonly TokenRole IntoKeywordRole =  new TokenRole (\"into\");\n\t\tpublic static readonly Role<Identifier> IntoIdentifierRole = new Role<Identifier>(\"IntoIdentifier\", Identifier.Null);\n\t\t\n\t\tpublic bool IsGroupJoin {\n\t\t\tget { return !string.IsNullOrEmpty(this.IntoIdentifier); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode JoinKeyword {\n\t\t\tget { return GetChildByRole (JoinKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (TypeRole); }\n\t\t\tset { SetChildByRole (TypeRole, value); }\n\t\t}\n\t\t\n\t\tpublic string JoinIdentifier {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole(JoinIdentifierRole).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(JoinIdentifierRole, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier JoinIdentifierToken {\n\t\t\tget { return GetChildByRole(JoinIdentifierRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode InKeyword {\n\t\t\tget { return GetChildByRole (InKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression InExpression {\n\t\t\tget { return GetChildByRole (InExpressionRole); }\n\t\t\tset { SetChildByRole (InExpressionRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode OnKeyword {\n\t\t\tget { return GetChildByRole (OnKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression OnExpression {\n\t\t\tget { return GetChildByRole (OnExpressionRole); }\n\t\t\tset { SetChildByRole (OnExpressionRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode EqualsKeyword {\n\t\t\tget { return GetChildByRole (EqualsKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression EqualsExpression {\n\t\t\tget { return GetChildByRole (EqualsExpressionRole); }\n\t\t\tset { SetChildByRole (EqualsExpressionRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode IntoKeyword {\n\t\t\tget { return GetChildByRole (IntoKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic string IntoIdentifier {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (IntoIdentifierRole).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(IntoIdentifierRole, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier IntoIdentifierToken {\n\t\t\tget { return GetChildByRole(IntoIdentifierRole); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryJoinClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryJoinClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryJoinClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryJoinClause o = other as QueryJoinClause;\n\t\t\treturn o != null && this.IsGroupJoin == o.IsGroupJoin\n\t\t\t\t&& this.Type.DoMatch(o.Type, match) && MatchString(this.JoinIdentifier, o.JoinIdentifier)\n\t\t\t\t&& this.InExpression.DoMatch(o.InExpression, match) && this.OnExpression.DoMatch(o.OnExpression, match)\n\t\t\t\t&& this.EqualsExpression.DoMatch(o.EqualsExpression, match)\n\t\t\t\t&& MatchString(this.IntoIdentifier, o.IntoIdentifier);\n\t\t}\n\t}\n\t\n\tpublic class QueryOrderClause : QueryClause\n\t{\n\t\tpublic static readonly TokenRole OrderbyKeywordRole = new TokenRole (\"orderby\");\n\t\tpublic static readonly Role<QueryOrdering> OrderingRole = new Role<QueryOrdering>(\"Ordering\");\n\t\t\n\t\tpublic CSharpTokenNode OrderbyToken {\n\t\t\tget { return GetChildByRole (OrderbyKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<QueryOrdering> Orderings {\n\t\t\tget { return GetChildrenByRole (OrderingRole); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryOrderClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryOrderClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryOrderClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryOrderClause o = other as QueryOrderClause;\n\t\t\treturn o != null && this.Orderings.DoMatch(o.Orderings, match);\n\t\t}\n\t}\n\t\n\tpublic class QueryOrdering : AstNode\n\t{\n\t\tpublic readonly static TokenRole AscendingKeywordRole = new TokenRole (\"ascending\");\n\t\tpublic readonly static TokenRole DescendingKeywordRole = new TokenRole (\"descending\");\n\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.Unknown; }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic QueryOrderingDirection Direction {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode DirectionToken {\n\t\t\tget { return Direction == QueryOrderingDirection.Ascending ? GetChildByRole (AscendingKeywordRole) : GetChildByRole (DescendingKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryOrdering (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryOrdering (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryOrdering (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryOrdering o = other as QueryOrdering;\n\t\t\treturn o != null && this.Direction == o.Direction && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n\t\n\tpublic enum QueryOrderingDirection\n\t{\n\t\tNone,\n\t\tAscending,\n\t\tDescending\n\t}\n\t\n\tpublic class QuerySelectClause : QueryClause\n\t{\n\t\tpublic readonly static TokenRole SelectKeywordRole = new TokenRole (\"select\");\n\n\t\tpublic CSharpTokenNode SelectKeyword {\n\t\t\tget { return GetChildByRole (SelectKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQuerySelectClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQuerySelectClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQuerySelectClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQuerySelectClause o = other as QuerySelectClause;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n\t\n\tpublic class QueryGroupClause : QueryClause\n\t{\n\t\tpublic static readonly TokenRole GroupKeywordRole = new TokenRole (\"group\");\n\t\tpublic static readonly Role<Expression> ProjectionRole = new Role<Expression>(\"Projection\", Expression.Null);\n\t\tpublic static readonly TokenRole ByKeywordRole = new TokenRole (\"by\");\n\t\tpublic static readonly Role<Expression> KeyRole = new Role<Expression>(\"Key\", Expression.Null);\n\t\t\n\t\tpublic CSharpTokenNode GroupKeyword {\n\t\t\tget { return GetChildByRole (GroupKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Projection {\n\t\t\tget { return GetChildByRole (ProjectionRole); }\n\t\t\tset { SetChildByRole (ProjectionRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode ByKeyword {\n\t\t\tget { return GetChildByRole (ByKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Key {\n\t\t\tget { return GetChildByRole (KeyRole); }\n\t\t\tset { SetChildByRole (KeyRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitQueryGroupClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitQueryGroupClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitQueryGroupClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tQueryGroupClause o = other as QueryGroupClause;\n\t\t\treturn o != null && this.Projection.DoMatch(o.Projection, match) && this.Key.DoMatch(o.Key, match);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/SizeOfExpression.cs",
    "content": "﻿// \n// SizeOfExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// sizeof(Type)\n\t/// </summary>\n\tpublic class SizeOfExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole SizeofKeywordRole = new TokenRole (\"sizeof\");\n\t\t\n\t\tpublic CSharpTokenNode SizeOfToken {\n\t\t\tget { return GetChildByRole (SizeofKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic SizeOfExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic SizeOfExpression (AstType type)\n\t\t{\n\t\t\tAddChild (type, Roles.Type);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitSizeOfExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitSizeOfExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitSizeOfExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tSizeOfExpression o = other as SizeOfExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/StackAllocExpression.cs",
    "content": "﻿// \n// StackAllocExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// stackalloc Type[Count]\n\t/// </summary>\n\tpublic class StackAllocExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole StackallocKeywordRole = new TokenRole (\"stackalloc\");\n\t\t\n\t\tpublic CSharpTokenNode StackAllocToken {\n\t\t\tget { return GetChildByRole (StackallocKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBracketToken {\n\t\t\tget { return GetChildByRole (Roles.LBracket); }\n\t\t}\n\t\t\n\t\tpublic Expression CountExpression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBracketToken {\n\t\t\tget { return GetChildByRole (Roles.RBracket); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitStackAllocExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitStackAllocExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitStackAllocExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tStackAllocExpression o = other as StackAllocExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match) && this.CountExpression.DoMatch(o.CountExpression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ThisReferenceExpression.cs",
    "content": "﻿// \n// ThisReferenceExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// this\n\t/// </summary>\n\tpublic class ThisReferenceExpression : Expression\n\t{\n\t\tpublic TextLocation Location {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn Location;\n\t\t\t}\n\t\t}\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (Location.Line, Location.Column + \"this\".Length);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitThisReferenceExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitThisReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitThisReferenceExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tThisReferenceExpression o = other as ThisReferenceExpression;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeOfExpression.cs",
    "content": "﻿// \n// TypeOfExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// typeof(Type)\n\t/// </summary>\n\tpublic class TypeOfExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole TypeofKeywordRole = new TokenRole (\"typeof\");\n\t\t\n\t\tpublic CSharpTokenNode TypeOfToken {\n\t\t\tget { return GetChildByRole (TypeofKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic TypeOfExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic TypeOfExpression (AstType type)\n\t\t{\n\t\t\tAddChild (type, Roles.Type);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitTypeOfExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitTypeOfExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitTypeOfExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tTypeOfExpression o = other as TypeOfExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeReferenceExpression.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Represents an AstType as an expression.\n\t/// This is used when calling a method on a primitive type: \"int.Parse()\"\n\t/// </summary>\n\tpublic class TypeReferenceExpression : Expression\n\t{\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole(Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitTypeReferenceExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitTypeReferenceExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitTypeReferenceExpression(this, data);\n\t\t}\n\t\t\n\t\tpublic TypeReferenceExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic TypeReferenceExpression (AstType type)\n\t\t{\n\t\t\tAddChild (type, Roles.Type);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tTypeReferenceExpression o = other as TypeReferenceExpression;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UnaryOperatorExpression.cs",
    "content": "﻿// \n// UnaryOperatorExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq.Expressions;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Operator Expression\n\t/// </summary>\n\tpublic class UnaryOperatorExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole NotRole = new TokenRole (\"!\");\n\t\tpublic readonly static TokenRole BitNotRole = new TokenRole (\"~\");\n\t\tpublic readonly static TokenRole MinusRole = new TokenRole (\"-\");\n\t\tpublic readonly static TokenRole PlusRole = new TokenRole (\"+\");\n\t\tpublic readonly static TokenRole IncrementRole = new TokenRole (\"++\");\n\t\tpublic readonly static TokenRole DecrementRole = new TokenRole (\"--\");\n\t\tpublic readonly static TokenRole DereferenceRole = new TokenRole (\"*\");\n\t\tpublic readonly static TokenRole AddressOfRole = new TokenRole (\"&\");\n\t\tpublic readonly static TokenRole AwaitRole = new TokenRole (\"await\");\n\t\t\n\t\tpublic UnaryOperatorExpression()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic UnaryOperatorExpression(UnaryOperatorType op, Expression expression)\n\t\t{\n\t\t\tthis.Operator = op;\n\t\t\tthis.Expression = expression;\n\t\t}\n\t\t\n\t\tpublic UnaryOperatorType Operator {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode OperatorToken {\n\t\t\tget { return GetChildByRole (GetOperatorRole (Operator)); }\n\t\t}\n\n\t\tstatic Expression NoUnaryExpressionError = new ErrorExpression (\"No unary expression\");\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression) ?? NoUnaryExpressionError; }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUnaryOperatorExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUnaryOperatorExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUnaryOperatorExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUnaryOperatorExpression o = other as UnaryOperatorExpression;\n\t\t\treturn o != null && (this.Operator == UnaryOperatorType.Any || this.Operator == o.Operator)\n\t\t\t\t&& this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t\t\n\t\tpublic static TokenRole GetOperatorRole(UnaryOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\t\treturn NotRole;\n\t\t\t\tcase UnaryOperatorType.BitNot:\n\t\t\t\t\treturn BitNotRole;\n\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\treturn MinusRole;\n\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\t\treturn PlusRole;\n\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\t\treturn IncrementRole;\n\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\t\treturn DecrementRole;\n\t\t\t\tcase UnaryOperatorType.Dereference:\n\t\t\t\t\treturn DereferenceRole;\n\t\t\t\tcase UnaryOperatorType.AddressOf:\n\t\t\t\t\treturn AddressOfRole;\n\t\t\t\tcase UnaryOperatorType.Await:\n\t\t\t\t\treturn AwaitRole;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for UnaryOperatorType\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static ExpressionType GetLinqNodeType(UnaryOperatorType op, bool checkForOverflow)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\t\treturn ExpressionType.Not;\n\t\t\t\tcase UnaryOperatorType.BitNot:\n\t\t\t\t\treturn ExpressionType.OnesComplement;\n\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\treturn checkForOverflow ? ExpressionType.NegateChecked : ExpressionType.Negate;\n\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\t\treturn ExpressionType.UnaryPlus;\n\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\t\treturn ExpressionType.PreIncrementAssign;\n\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\t\treturn ExpressionType.PreDecrementAssign;\n\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\t\treturn ExpressionType.PostIncrementAssign;\n\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\t\treturn ExpressionType.PostDecrementAssign;\n\t\t\t\tcase UnaryOperatorType.Dereference:\n\t\t\t\tcase UnaryOperatorType.AddressOf:\n\t\t\t\tcase UnaryOperatorType.Await:\n\t\t\t\t\treturn ExpressionType.Extension;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for UnaryOperatorType\");\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic enum UnaryOperatorType\n\t{\n\t\t/// <summary>\n\t\t/// Any unary operator (used in pattern matching)\n\t\t/// </summary>\n\t\tAny,\n\t\t\n\t\t/// <summary>Logical not (!a)</summary>\n\t\tNot,\n\t\t/// <summary>Bitwise not (~a)</summary>\n\t\tBitNot,\n\t\t/// <summary>Unary minus (-a)</summary>\n\t\tMinus,\n\t\t/// <summary>Unary plus (+a)</summary>\n\t\tPlus,\n\t\t/// <summary>Pre increment (++a)</summary>\n\t\tIncrement,\n\t\t/// <summary>Pre decrement (--a)</summary>\n\t\tDecrement,\n\t\t/// <summary>Post increment (a++)</summary>\n\t\tPostIncrement,\n\t\t/// <summary>Post decrement (a--)</summary>\n\t\tPostDecrement,\n\t\t/// <summary>Dereferencing (*a)</summary>\n\t\tDereference,\n\t\t/// <summary>Get address (&a)</summary>\n\t\tAddressOf,\n\t\t/// <summary>C# 5.0 await</summary>\n\t\tAwait\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UncheckedExpression.cs",
    "content": "﻿// \n// UncheckedExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// unchecked(Expression)\n\t/// </summary>\n\tpublic class UncheckedExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole UncheckedKeywordRole = new TokenRole (\"unchecked\");\n\n\t\tpublic CSharpTokenNode UncheckedToken {\n\t\t\tget { return GetChildByRole (UncheckedKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole(Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic UncheckedExpression ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic UncheckedExpression (Expression expression)\n\t\t{\n\t\t\tAddChild (expression, Roles.Expression);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUncheckedExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUncheckedExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUncheckedExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUncheckedExpression o = other as UncheckedExpression;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UndocumentedExpression.cs",
    "content": "﻿// \n// UndocumentedExpression.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum UndocumentedExpressionType\n\t{\n\t\tArgListAccess, // __arglist\n\t\tArgList, // __arglist (a1, a2, ..., an)\n\t\tRefValue, // __refvalue (expr , type)\n\t\tRefType, // __reftype (expr)\n\t\tMakeRef // __makeref (expr)\n\t}\n\t\n\t/// <summary>\n\t/// Represents undocumented expressions.\n\t/// </summary>\n\tpublic class UndocumentedExpression : Expression\n\t{\n\t\tpublic readonly static TokenRole ArglistKeywordRole = new TokenRole (\"__arglist\");\n\t\tpublic readonly static TokenRole RefvalueKeywordRole = new TokenRole (\"__refvalue\");\n\t\tpublic readonly static TokenRole ReftypeKeywordRole = new TokenRole (\"__reftype\");\n\t\tpublic readonly static TokenRole MakerefKeywordRole = new TokenRole (\"__makeref\");\n\t\t\n\t\tpublic UndocumentedExpressionType UndocumentedExpressionType {\n\t\t\tget; set;\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode UndocumentedToken {\n\t\t\tget {\n\t\t\t\tswitch (UndocumentedExpressionType) {\n\t\t\t\tcase ICSharpCode.NRefactory.CSharp.UndocumentedExpressionType.ArgListAccess:\n\t\t\t\tcase ICSharpCode.NRefactory.CSharp.UndocumentedExpressionType.ArgList:\n\t\t\t\t\treturn GetChildByRole (ArglistKeywordRole);\n\t\t\t\tcase ICSharpCode.NRefactory.CSharp.UndocumentedExpressionType.RefValue:\n\t\t\t\t\treturn GetChildByRole (RefvalueKeywordRole);\n\t\t\t\tcase ICSharpCode.NRefactory.CSharp.UndocumentedExpressionType.RefType:\n\t\t\t\t\treturn GetChildByRole (ReftypeKeywordRole);\n\t\t\t\tcase ICSharpCode.NRefactory.CSharp.UndocumentedExpressionType.MakeRef:\n\t\t\t\t\treturn GetChildByRole (MakerefKeywordRole);\n\t\t\t\t}\n\t\t\t\treturn CSharpTokenNode.Null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Arguments {\n\t\t\tget { return GetChildrenByRole(Roles.Argument); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUndocumentedExpression (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUndocumentedExpression (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUndocumentedExpression (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUndocumentedExpression o = other as UndocumentedExpression;\n\t\t\treturn o != null && this.UndocumentedExpressionType == o.UndocumentedExpressionType && this.Arguments.DoMatch(o.Arguments, match);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Attribute.cs",
    "content": "﻿// \n// Attribute.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Attribute(Arguments)\n\t/// </summary>\n\tpublic class Attribute : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\n\t\tpublic AstNodeCollection<Expression> Arguments {\n\t\t\tget { return base.GetChildrenByRole (Roles.Argument); }\n\t\t}\n\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\n\t\t// HasArgumentList == false: [Empty]\n\t\tpublic bool HasArgumentList {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAttribute (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitAttribute (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitAttribute (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch (AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tAttribute o = other as Attribute;\n\t\t\treturn o != null && this.Type.DoMatch (o.Type, match) && this.Arguments.DoMatch (o.Arguments, match);\n\t\t}\n\n\t\tpublic override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\tif (IsNull)\n\t\t\t\treturn \"Null\";\n\t\t\treturn base.ToString(formattingOptions);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/AttributeSection.cs",
    "content": "﻿// \n// AttributeSection.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// [AttributeTarget: Attributes]\n\t/// </summary>\n\tpublic class AttributeSection : AstNode\n\t{\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator AttributeSection(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : AttributeSection, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\t\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBracketToken {\n\t\t\tget { return GetChildByRole (Roles.LBracket); }\n\t\t}\n\t\t\n\t\tpublic string AttributeTarget {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier AttributeTargetToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Attribute> Attributes {\n\t\t\tget { return base.GetChildrenByRole (Roles.Attribute); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBracketToken {\n\t\t\tget { return GetChildByRole (Roles.RBracket); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAttributeSection (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitAttributeSection (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitAttributeSection (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tAttributeSection o = other as AttributeSection;\n\t\t\treturn o != null && MatchString(this.AttributeTarget, o.AttributeTarget) && this.Attributes.DoMatch(o.Attributes, match);\n\t\t}\n\t\t\n\t\tpublic AttributeSection()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic AttributeSection(Attribute attr)\n\t\t{\n\t\t\tthis.Attributes.Add(attr);\n\t\t}\n\t\t\n//\t\tpublic static string GetAttributeTargetName(AttributeTarget attributeTarget)\n//\t\t{\n//\t\t\tswitch (attributeTarget) {\n//\t\t\t\tcase AttributeTarget.None:\n//\t\t\t\t\treturn null;\n//\t\t\t\tcase AttributeTarget.Assembly:\n//\t\t\t\t\treturn \"assembly\";\n//\t\t\t\tcase AttributeTarget.Module:\n//\t\t\t\t\treturn \"module\";\n//\t\t\t\tcase AttributeTarget.Type:\n//\t\t\t\t\treturn \"type\";\n//\t\t\t\tcase AttributeTarget.Param:\n//\t\t\t\t\treturn \"param\";\n//\t\t\t\tcase AttributeTarget.Field:\n//\t\t\t\t\treturn \"field\";\n//\t\t\t\tcase AttributeTarget.Return:\n//\t\t\t\t\treturn \"return\";\n//\t\t\t\tcase AttributeTarget.Method:\n//\t\t\t\t\treturn \"method\";\n//\t\t\t\tdefault:\n//\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for AttributeTarget\");\n//\t\t\t}\n//\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Comment.cs",
    "content": "﻿// \n// Comment.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum CommentType \n\t{\n\t\t/// <summary>\n\t\t/// \"//\" comment\n\t\t/// </summary>\n\t\tSingleLine,\n\t\t/// <summary>\n\t\t/// \"/* */\" comment\n\t\t/// </summary>\n\t\tMultiLine,\n\t\t/// <summary>\n\t\t/// \"///\" comment\n\t\t/// </summary>\n\t\tDocumentation,\n\t\t/// <summary>\n\t\t/// Inactive code (code in non-taken \"#if\")\n\t\t/// </summary>\n\t\tInactiveCode,\n\t\t/// <summary>\n\t\t/// \"/** */\" comment\n\t\t/// </summary>\n\t\tMultiLineDocumentation\n\t}\n\t\n\tpublic class Comment : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Whitespace;\n\t\t\t}\n\t\t}\n\t\t\n\t\tCommentType commentType;\n\t\t\n\t\tpublic CommentType CommentType {\n\t\t\tget { return commentType; }\n\t\t\tset { ThrowIfFrozen(); commentType = value; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns true if the <see cref=\"CommentType\"/> is Documentation or MultiLineDocumentation.\n\t\t/// </summary>\n\t\tpublic bool IsDocumentation {\n\t\t\tget {\n\t\t\t\treturn commentType == CommentType.Documentation || commentType == CommentType.MultiLineDocumentation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool startsLine;\n\t\t\n\t\tpublic bool StartsLine {\n\t\t\tget { return startsLine; }\n\t\t\tset { ThrowIfFrozen(); startsLine = value; }\n\t\t}\n\t\t\n\t\tstring content;\n\t\t\n\t\tpublic string Content {\n\t\t\tget { return content; }\n\t\t\tset { ThrowIfFrozen(); content = value; }\n\t\t}\n\t\t\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget { \n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTextLocation endLocation;\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn endLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Comment (string content, CommentType type = CommentType.SingleLine)\n\t\t{\n\t\t\tthis.CommentType = type;\n\t\t\tthis.Content = content;\n\t\t}\n\t\t\n\t\tpublic Comment (CommentType commentType, TextLocation startLocation, TextLocation endLocation)\n\t\t{\n\t\t\tthis.CommentType = commentType;\n\t\t\tthis.startLocation = startLocation;\n\t\t\tthis.endLocation = endLocation;\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitComment (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitComment (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitComment (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tComment o = other as Comment;\n\t\t\treturn o != null && this.CommentType == o.CommentType && MatchString(this.Content, o.Content);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs",
    "content": "﻿// \n// Constraint.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// where TypeParameter : BaseTypes\n\t/// </summary>\n\t/// <remarks>\n\t/// new(), struct and class constraints are represented using a PrimitiveType \"new\", \"struct\" or \"class\"\n\t/// </remarks>\n\tpublic class Constraint : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode WhereKeyword {\n\t\t\tget { return GetChildByRole (Roles.WhereKeyword); }\n\t\t}\n\n\t\tpublic SimpleType TypeParameter {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.ConstraintTypeParameter);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.ConstraintTypeParameter, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstType> BaseTypes {\n\t\t\tget {\n\t\t\t\treturn GetChildrenByRole(Roles.BaseType); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitConstraint (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitConstraint (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitConstraint (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tConstraint o = other as Constraint;\n\t\t\treturn o != null && this.TypeParameter.DoMatch (o.TypeParameter, match) && this.BaseTypes.DoMatch(o.BaseTypes, match);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/DelegateDeclaration.cs",
    "content": "﻿// \n// DelegateDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// delegate ReturnType Name&lt;TypeParameters&gt;(Parameters) where Constraints;\n\t/// </summary>\n\tpublic class DelegateDeclaration : EntityDeclaration\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.TypeDeclaration; }\n\t\t}\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.TypeDefinition; }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode DelegateToken {\n\t\t\tget { return GetChildByRole(Roles.DelegateKeyword); }\n\t\t}\n\n\t\tpublic AstNodeCollection<TypeParameterDeclaration> TypeParameters {\n\t\t\tget { return GetChildrenByRole (Roles.TypeParameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Constraint> Constraints {\n\t\t\tget { return GetChildrenByRole (Roles.Constraint); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitDelegateDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitDelegateDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitDelegateDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tDelegateDeclaration o = other as DelegateDeclaration;\n\t\t\treturn o != null && MatchString(this.Name, o.Name) \n\t\t\t\t&& this.MatchAttributesAndModifiers(o, match) && this.ReturnType.DoMatch(o.ReturnType, match)\n\t\t\t\t&& this.TypeParameters.DoMatch(o.TypeParameters, match) && this.Parameters.DoMatch(o.Parameters, match)\n\t\t\t\t&& this.Constraints.DoMatch(o.Constraints, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/ExternAliasDeclaration.cs",
    "content": "﻿// \n// ExternAliasDeclaration.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// extern alias <Identifier>;\n\t/// </summary>\n\tpublic class ExternAliasDeclaration : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode ExternToken {\n\t\t\tget { return GetChildByRole (Roles.ExternKeyword); }\n\t\t}\n\n\t\tpublic CSharpTokenNode AliasToken {\n\t\t\tget { return GetChildByRole (Roles.AliasKeyword); }\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier NameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitExternAliasDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitExternAliasDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitExternAliasDeclaration (this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch (AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as ExternAliasDeclaration;\n\t\t\treturn o != null && MatchString (this.Name, o.Name);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs",
    "content": "﻿// \n// NamespaceDeclaration.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// namespace Name { Members }\n\t/// </summary>\n\tpublic class NamespaceDeclaration : AstNode\n\t{\n\t\tpublic static readonly Role<AstNode> MemberRole = SyntaxTree.MemberRole;\n\t\tpublic static readonly Role<AstType> NamespaceNameRole = new Role<AstType>(\"NamespaceName\", AstType.Null);\n\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode NamespaceToken {\n\t\t\tget { return GetChildByRole(Roles.NamespaceKeyword); }\n\t\t}\n\n\t\tpublic AstType NamespaceName {\n\t\t\tget { return GetChildByRole(NamespaceNameRole) ?? AstType.Null; }\n\t\t\tset { SetChildByRole(NamespaceNameRole, value); }\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn UsingDeclaration.ConstructNamespace(NamespaceName);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tvar arr = value.Split('.');\n\t\t\t\tNamespaceName = ConstructType(arr, arr.Length - 1);\n\t\t\t}\n\t\t}\n\n\t\tstatic AstType ConstructType(string[] arr, int i)\n\t\t{\n\t\t\tif (i < 0 || i >= arr.Length)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"i\");\n\t\t\tif (i == 0)\n\t\t\t\treturn new SimpleType(arr[i]);\n\t\t\treturn new MemberType(ConstructType(arr, i - 1), arr[i]);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the full namespace name (including any parent namespaces)\n\t\t/// </summary>\n\t\tpublic string FullName {\n\t\t\tget {\n\t\t\t\tNamespaceDeclaration parentNamespace = Parent as NamespaceDeclaration;\n\t\t\t\tif (parentNamespace != null)\n\t\t\t\t\treturn BuildQualifiedName(parentNamespace.FullName, Name);\n\t\t\t\treturn Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<string> Identifiers {\n\t\t\tget {\n\t\t\t\tvar result = new Stack<string>();\n\t\t\t\tAstType type = NamespaceName;\n\t\t\t\twhile (type is MemberType) {\n\t\t\t\t\tvar mt = (MemberType)type;\n\t\t\t\t\tresult.Push(mt.MemberName);\n\t\t\t\t\ttype = mt.Target;\n\t\t\t\t}\n\t\t\t\tif (type is SimpleType)\n\t\t\t\t\tresult.Push(((SimpleType)type).Identifier);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole(Roles.LBrace); }\n\t\t}\n\n\t\tpublic AstNodeCollection<AstNode> Members {\n\t\t\tget { return GetChildrenByRole(MemberRole); }\n\t\t}\n\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole(Roles.RBrace); }\n\t\t}\n\n\t\tpublic NamespaceDeclaration()\n\t\t{\n\t\t}\n\n\t\tpublic NamespaceDeclaration(string name)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t}\n\n\t\tpublic static string BuildQualifiedName(string name1, string name2)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(name1))\n\t\t\t\treturn name2;\n\t\t\tif (string.IsNullOrEmpty(name2))\n\t\t\t\treturn name1;\n\t\t\treturn name1 + \".\" + name2;\n\t\t}\n\n\t\tpublic void AddMember(AstNode child)\n\t\t{\n\t\t\tAddChild(child, MemberRole);\n\t\t}\n\n\t\tpublic override void AcceptVisitor(IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitNamespaceDeclaration(this);\n\t\t}\n\n\t\tpublic override T AcceptVisitor<T>(IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitNamespaceDeclaration(this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitNamespaceDeclaration(this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tNamespaceDeclaration o = other as NamespaceDeclaration;\n\t\t\treturn o != null && MatchString(this.Name, o.Name) && this.Members.DoMatch(o.Members, match);\n\t\t}\n\t}\n}\t\t\t;\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NewLineNode.cs",
    "content": "using System;\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\n\t/// <summary>\n\t/// A New line node represents a line break in the text.\n\t/// </summary>\n\tpublic sealed class NewLineNode : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Whitespace;\n\t\t\t}\n\t\t}\n\n\t\tconst uint newLineMask = 0xfu << AstNodeFlagsUsedBits;\n\t\tstatic readonly UnicodeNewline[] newLineTypes = {\n\t\t\tUnicodeNewline.Unknown,\n\t\t\tUnicodeNewline.LF,\n\t\t\tUnicodeNewline.CRLF,\n\t\t\tUnicodeNewline.CR,\n\t\t\tUnicodeNewline.NEL,\n\t\t\tUnicodeNewline.VT,\n\t\t\tUnicodeNewline.FF,\n\t\t\tUnicodeNewline.LS,\n\t\t\tUnicodeNewline.PS\n\t\t};\n\t\t\n\t\tpublic UnicodeNewline NewLineType {\n\t\t\tget {\n\t\t\t\treturn newLineTypes[(flags & newLineMask) >> AstNodeFlagsUsedBits];\n\t\t\t}\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tint pos = Array.IndexOf(newLineTypes, value);\n\t\t\t\tif (pos < 0)\n\t\t\t\t\tpos = 0;\n\t\t\t\tflags &= ~newLineMask; // clear old newline type\n\t\t\t\tflags |= (uint)pos << AstNodeFlagsUsedBits;\n\t\t\t}\n\t\t}\n\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget { \n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (startLocation.Line + 1, 1);\n\t\t\t}\n\t\t}\n\n\t\tpublic NewLineNode() : this (TextLocation.Empty)\n\t\t{\n\t\t}\n\n\t\tpublic NewLineNode(TextLocation startLocation)\n\t\t{\n\t\t\tthis.startLocation = startLocation;\n\t\t}\n\n\t\tpublic sealed override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\treturn NewLine.GetString (NewLineType);\n\t\t}\n\n\t\tpublic override void AcceptVisitor(IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitNewLine (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T>(IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitNewLine (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitNewLine (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)\n\t\t{\n\t\t\treturn other is NewLineNode;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/PreProcessorDirective.cs",
    "content": "﻿// \n// PreProcessorDirective.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum PreProcessorDirectiveType : byte\n\t{\n\t\tInvalid = 0,\n\t\tRegion = 1,\n\t\tEndregion = 2,\n\t\t\n\t\tIf = 3,\n\t\tEndif = 4,\n\t\tElif = 5,\n\t\tElse = 6,\n\t\t\n\t\tDefine = 7,\n\t\tUndef = 8,\n\t\tError = 9,\n\t\tWarning = 10,\n\t\tPragma = 11,\n\t\tLine = 12\n\t}\n\n\tpublic class LinePreprocessorDirective : PreProcessorDirective\n\t{\n\t\tpublic int LineNumber {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic string FileName {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic LinePreprocessorDirective(TextLocation startLocation, TextLocation endLocation) : base (PreProcessorDirectiveType.Line, startLocation, endLocation)\n\t\t{\n\t\t}\n\n\t\tpublic LinePreprocessorDirective(string argument = null) : base (PreProcessorDirectiveType.Line, argument)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class PragmaWarningPreprocessorDirective : PreProcessorDirective\n\t{\n\t\tpublic static readonly Role<PrimitiveExpression>  WarningRole = new Role<PrimitiveExpression> (\"Warning\");\n\n\t\tpublic static readonly TokenRole PragmaKeywordRole = new TokenRole (\"#pragma\");\n\t\tpublic static readonly TokenRole WarningKeywordRole = new TokenRole (\"warning\");\n\t\tpublic static readonly TokenRole DisableKeywordRole = new TokenRole (\"disable\");\n\t\tpublic static readonly TokenRole RestoreKeywordRole = new TokenRole (\"restore\");\n\n\t\tpublic bool Disable {\n\t\t\tget {\n\t\t\t\treturn !DisableToken.IsNull;\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode PragmaToken {\n\t\t\tget { return GetChildByRole (PragmaKeywordRole); }\n\t\t}\n\n\t\tpublic CSharpTokenNode WarningToken {\n\t\t\tget { return GetChildByRole (WarningKeywordRole); }\n\t\t}\n\n\t\tpublic CSharpTokenNode DisableToken {\n\t\t\tget { return GetChildByRole (DisableKeywordRole); }\n\t\t}\n\n\t\tpublic CSharpTokenNode RestoreToken {\n\t\t\tget { return GetChildByRole (RestoreKeywordRole); }\n\t\t}\n\n\t\tpublic AstNodeCollection<PrimitiveExpression> Warnings {\n\t\t\tget { return GetChildrenByRole(WarningRole); }\n\t\t}\n\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\tvar child = LastChild;\n\t\t\t\tif (child == null)\n\t\t\t\t\treturn base.EndLocation;\n\t\t\t\treturn child.EndLocation;\n\t\t\t}\n\t\t}\n\n\t\tpublic PragmaWarningPreprocessorDirective(TextLocation startLocation, TextLocation endLocation) : base (PreProcessorDirectiveType.Pragma, startLocation, endLocation)\n\t\t{\n\t\t}\n\n\t\tpublic PragmaWarningPreprocessorDirective(string argument = null) : base (PreProcessorDirectiveType.Pragma, argument)\n\t\t{\n\t\t}\n\n\t\tpublic bool IsDefined(int pragmaWarning)\n\t\t{\n\t\t\treturn Warnings.Select(w => (int)w.Value).Any(n => n == pragmaWarning);\n\t\t}\n\t}\n\t\n\tpublic class PreProcessorDirective : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Whitespace;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic PreProcessorDirectiveType Type {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic string Argument {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// For an '#if' directive, specifies whether the condition evaluated to true.\n\t\t/// </summary>\n\t\tpublic bool Take {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget { \n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTextLocation endLocation;\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn endLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic PreProcessorDirective(PreProcessorDirectiveType type, TextLocation startLocation, TextLocation endLocation)\n\t\t{\n\t\t\tthis.Type = type;\n\t\t\tthis.startLocation = startLocation;\n\t\t\tthis.endLocation = endLocation;\n\t\t}\n\n\t\tpublic PreProcessorDirective(PreProcessorDirectiveType type, string argument = null)\n\t\t{\n\t\t\tthis.Type = type;\n\t\t\tthis.Argument = argument;\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitPreProcessorDirective (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitPreProcessorDirective (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitPreProcessorDirective (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tPreProcessorDirective o = other as PreProcessorDirective;\n\t\t\treturn o != null && Type == o.Type && MatchString(Argument, o.Argument);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TextNode.cs",
    "content": "// \n// TextNode.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// A text node contains text without syntactic or semantic information.\n\t/// (non parseable part of a text)\n\t/// </summary>\n\tpublic class TextNode : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Whitespace;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Text {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget { \n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTextLocation endLocation;\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn endLocation;\n\t\t\t}\n\t\t}\n\n\t\tpublic TextNode(string text) : this (text, TextLocation.Empty, TextLocation.Empty)\n\t\t{\n\t\t}\n\n\t\tpublic TextNode(string text, TextLocation startLocation, TextLocation endLocation)\n\t\t{\n\t\t\tthis.Text = text;\n\t\t\tthis.startLocation = startLocation;\n\t\t\tthis.endLocation = endLocation;\n\t\t}\n\n\t\tpublic override void AcceptVisitor(IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitText (this);\n\t\t}\n\n\t\tpublic override T AcceptVisitor<T>(IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitText (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitText (this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as TextNode;\n\t\t\treturn o != null && o.Text == Text;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs",
    "content": "﻿// \n// TypeDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum ClassType\n\t{\n\t\tClass,\n\t\tStruct,\n\t\tInterface,\n\t\tEnum\n\t}\n\t\n\t/// <summary>\n\t/// class Name&lt;TypeParameters&gt; : BaseTypes where Constraints;\n\t/// </summary>\n\tpublic class TypeDeclaration : EntityDeclaration\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.TypeDeclaration; }\n\t\t}\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.TypeDefinition; }\n\t\t}\n\t\t\n\t\tClassType classType;\n\n\t\tpublic CSharpTokenNode TypeKeyword {\n\t\t\tget {\n\t\t\t\tswitch (classType) {\n\t\t\t\t\tcase ClassType.Class:\n\t\t\t\t\t\treturn GetChildByRole(Roles.ClassKeyword);\n\t\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\t\treturn GetChildByRole(Roles.StructKeyword);\n\t\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\t\treturn GetChildByRole(Roles.InterfaceKeyword);\n\t\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\t\treturn GetChildByRole(Roles.EnumKeyword);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn CSharpTokenNode.Null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ClassType ClassType {\n\t\t\tget { return classType; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tclassType = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode LChevronToken {\n\t\t\tget { return GetChildByRole (Roles.LChevron); }\n\t\t}\n\n\t\tpublic AstNodeCollection<TypeParameterDeclaration> TypeParameters {\n\t\t\tget { return GetChildrenByRole (Roles.TypeParameter); }\n\t\t}\n\n\t\tpublic CSharpTokenNode RChevronToken {\n\t\t\tget { return GetChildByRole (Roles.RChevron); }\n\t\t}\n\n\n\n\t\tpublic CSharpTokenNode ColonToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole(Roles.Colon);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstType> BaseTypes {\n\t\t\tget { return GetChildrenByRole(Roles.BaseType); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Constraint> Constraints {\n\t\t\tget { return GetChildrenByRole(Roles.Constraint); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole (Roles.LBrace); }\n\t\t}\n\n\t\tpublic AstNodeCollection<EntityDeclaration> Members {\n\t\t\tget { return GetChildrenByRole (Roles.TypeMemberRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole (Roles.RBrace); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitTypeDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitTypeDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitTypeDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tTypeDeclaration o = other as TypeDeclaration;\n\t\t\treturn o != null && this.ClassType == o.ClassType && MatchString(this.Name, o.Name)\n\t\t\t\t&& this.MatchAttributesAndModifiers(o, match) && this.TypeParameters.DoMatch(o.TypeParameters, match)\n\t\t\t\t&& this.BaseTypes.DoMatch(o.BaseTypes, match) && this.Constraints.DoMatch(o.Constraints, match)\n\t\t\t\t&& this.Members.DoMatch(o.Members, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// [in|out] Name\n\t/// \n\t/// Represents a type parameter.\n\t/// Note: mirroring the C# syntax, constraints are not part of the type parameter declaration, but belong\n\t/// to the parent type or method.\n\t/// </summary>\n\tpublic class TypeParameterDeclaration : AstNode\n\t{\n\t\tpublic static readonly Role<AttributeSection> AttributeRole = EntityDeclaration.AttributeRole;\n\t\tpublic static readonly TokenRole OutVarianceKeywordRole = new TokenRole (\"out\");\n\t\tpublic static readonly TokenRole InVarianceKeywordRole = new TokenRole (\"in\");\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.Unknown; }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AttributeSection> Attributes {\n\t\t\tget { return GetChildrenByRole (AttributeRole); }\n\t\t}\n\t\t\n\t\tVarianceModifier variance;\n\t\t\n\t\tpublic VarianceModifier Variance {\n\t\t\tget { return variance; }\n\t\t\tset { ThrowIfFrozen(); variance = value; }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode VarianceToken {\n\t\t\tget {\n\t\t\t\tswitch (Variance) {\n\t\t\t\t\tcase VarianceModifier.Covariant:\n\t\t\t\t\t\treturn GetChildByRole(OutVarianceKeywordRole);\n\t\t\t\t\tcase VarianceModifier.Contravariant:\n\t\t\t\t\t\treturn GetChildByRole(InVarianceKeywordRole);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn CSharpTokenNode.Null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier NameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterDeclaration ()\n\t\t{\n\t\t}\n\n\t\tpublic TypeParameterDeclaration (string name)\n\t\t{\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitTypeParameterDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitTypeParameterDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitTypeParameterDeclaration(this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tTypeParameterDeclaration o = other as TypeParameterDeclaration;\n\t\t\treturn o != null && this.Variance == o.Variance && MatchString(this.Name, o.Name) && this.Attributes.DoMatch(o.Attributes, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs",
    "content": "﻿// \n// UsingAliasDeclaration.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// using Alias = Import;\n\t/// </summary>\n\tpublic class UsingAliasDeclaration : AstNode\n\t{\n\t\tpublic static readonly TokenRole UsingKeywordRole = new TokenRole (\"using\");\n\t\tpublic static readonly Role<Identifier> AliasRole = new Role<Identifier>(\"Alias\", Identifier.Null);\n\t\tpublic static readonly Role<AstType> ImportRole = UsingDeclaration.ImportRole;\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode UsingToken {\n\t\t\tget { return GetChildByRole (UsingKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic string Alias {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (AliasRole).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(AliasRole, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode AssignToken {\n\t\t\tget { return GetChildByRole (Roles.Assign); }\n\t\t}\n\t\t\n\t\tpublic AstType Import {\n\t\t\tget { return GetChildByRole (ImportRole); }\n\t\t\tset { SetChildByRole (ImportRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic UsingAliasDeclaration ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic UsingAliasDeclaration (string alias, string nameSpace)\n\t\t{\n\t\t\tAddChild (Identifier.Create (alias), AliasRole);\n\t\t\tAddChild (new SimpleType (nameSpace), ImportRole);\n\t\t}\n\t\t\n\t\tpublic UsingAliasDeclaration (string alias, AstType import)\n\t\t{\n\t\t\tAddChild (Identifier.Create (alias), AliasRole);\n\t\t\tAddChild (import, ImportRole);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUsingAliasDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUsingAliasDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUsingAliasDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUsingAliasDeclaration o = other as UsingAliasDeclaration;\n\t\t\treturn o != null && MatchString(this.Alias, o.Alias) && this.Import.DoMatch(o.Import, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingDeclaration.cs",
    "content": "﻿// \n// UsingDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Text;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// using Import;\n\t/// </summary>\n\tpublic class UsingDeclaration : AstNode\n\t{\n\t\tpublic static readonly TokenRole UsingKeywordRole = new TokenRole (\"using\");\n\t\tpublic static readonly Role<AstType> ImportRole = new Role<AstType>(\"Import\", AstType.Null);\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode UsingToken {\n\t\t\tget { return GetChildByRole (UsingKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstType Import {\n\t\t\tget { return GetChildByRole (ImportRole); }\n\t\t\tset { SetChildByRole (ImportRole, value); }\n\t\t}\n\t\t\n\t\tpublic string Namespace {\n\t\t\tget { return ConstructNamespace (Import); }\n\t\t}\n\n\t\tinternal static string ConstructNamespace (AstType type)\n\t\t{\n\t\t\tvar stack = new Stack<string>();\n\t\t\twhile (type is MemberType) {\n\t\t\t\tvar mt = (MemberType)type;\n\t\t\t\tstack.Push(mt.MemberName);\n\t\t\t\ttype = mt.Target;\n\t\t\t\tif (mt.IsDoubleColon) {\n\t\t\t\t\tstack.Push(\"::\");\n\t\t\t\t} else {\n\t\t\t\t\tstack.Push(\".\"); \n\t\t\t\t}\n\t\t\t}\n\t\t\tif (type is SimpleType)\n\t\t\t\tstack.Push(((SimpleType)type).Identifier);\n\n\t\t\tvar result = new StringBuilder();\n\t\t\twhile (stack.Count > 0)\n\t\t\t\tresult.Append(stack.Pop());\n\t\t\treturn result.ToString();\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic UsingDeclaration ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic UsingDeclaration (string nameSpace)\n\t\t{\n\t\t\tAddChild (AstType.Create (nameSpace), ImportRole);\n\t\t}\n\t\t\n\t\tpublic UsingDeclaration (AstType import)\n\t\t{\n\t\t\tAddChild (import, ImportRole);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUsingDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUsingDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUsingDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUsingDeclaration o = other as UsingDeclaration;\n\t\t\treturn o != null && this.Import.DoMatch(o.Import, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/WhitespaceNode.cs",
    "content": "// \n// WhitespaceNode.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// A Whitespace node contains only whitespaces.\n\t/// </summary>\n\tpublic class WhitespaceNode : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Whitespace;\n\t\t\t}\n\t\t}\n\n\t\tpublic string WhiteSpaceText {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget { \n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (startLocation.Line, startLocation.Column + WhiteSpaceText.Length);\n\t\t\t}\n\t\t}\n\n\t\tpublic WhitespaceNode(string whiteSpaceText) : this (whiteSpaceText, TextLocation.Empty)\n\t\t{\n\t\t}\n\n\t\tpublic WhitespaceNode(string whiteSpaceText, TextLocation startLocation)\n\t\t{\n\t\t\tthis.WhiteSpaceText = WhiteSpaceText;\n\t\t\tthis.startLocation = startLocation;\n\t\t}\n\n\t\tpublic override void AcceptVisitor(IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitWhitespace (this);\n\t\t}\n\n\t\tpublic override T AcceptVisitor<T>(IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitWhitespace (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitWhitespace (this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as WhitespaceNode;\n\t\t\treturn o != null && o.WhiteSpaceText == WhiteSpaceText;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/IAstVisitor.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// AST visitor.\n\t/// </summary>\n\tpublic interface IAstVisitor\n\t{\n\t\tvoid VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression);\n\t\tvoid VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression);\n\t\tvoid VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression);\n\t\tvoid VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression);\n\t\tvoid VisitAsExpression(AsExpression asExpression);\n\t\tvoid VisitAssignmentExpression(AssignmentExpression assignmentExpression);\n\t\tvoid VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression);\n\t\tvoid VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression);\n\t\tvoid VisitCastExpression(CastExpression castExpression);\n\t\tvoid VisitCheckedExpression(CheckedExpression checkedExpression);\n\t\tvoid VisitConditionalExpression(ConditionalExpression conditionalExpression);\n\t\tvoid VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression);\n\t\tvoid VisitDirectionExpression(DirectionExpression directionExpression);\n\t\tvoid VisitIdentifierExpression(IdentifierExpression identifierExpression);\n\t\tvoid VisitIndexerExpression(IndexerExpression indexerExpression);\n\t\tvoid VisitInvocationExpression(InvocationExpression invocationExpression);\n\t\tvoid VisitIsExpression(IsExpression isExpression);\n\t\tvoid VisitLambdaExpression(LambdaExpression lambdaExpression);\n\t\tvoid VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression);\n\t\tvoid VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression);\n\t\tvoid VisitNamedExpression(NamedExpression namedExpression);\n\t\tvoid VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression);\n\t\tvoid VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression);\n\t\tvoid VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression);\n\t\tvoid VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression);\n\t\tvoid VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression);\n\t\tvoid VisitPrimitiveExpression(PrimitiveExpression primitiveExpression);\n\t\tvoid VisitSizeOfExpression(SizeOfExpression sizeOfExpression);\n\t\tvoid VisitStackAllocExpression(StackAllocExpression stackAllocExpression);\n\t\tvoid VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression);\n\t\tvoid VisitTypeOfExpression(TypeOfExpression typeOfExpression);\n\t\tvoid VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression);\n\t\tvoid VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression);\n\t\tvoid VisitUncheckedExpression(UncheckedExpression uncheckedExpression);\n\n\t\tvoid VisitQueryExpression(QueryExpression queryExpression);\n\t\tvoid VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause);\n\t\tvoid VisitQueryFromClause(QueryFromClause queryFromClause);\n\t\tvoid VisitQueryLetClause(QueryLetClause queryLetClause);\n\t\tvoid VisitQueryWhereClause(QueryWhereClause queryWhereClause);\n\t\tvoid VisitQueryJoinClause(QueryJoinClause queryJoinClause);\n\t\tvoid VisitQueryOrderClause(QueryOrderClause queryOrderClause);\n\t\tvoid VisitQueryOrdering(QueryOrdering queryOrdering);\n\t\tvoid VisitQuerySelectClause(QuerySelectClause querySelectClause);\n\t\tvoid VisitQueryGroupClause(QueryGroupClause queryGroupClause);\n\t\t\n\t\tvoid VisitAttribute(Attribute attribute);\n\t\tvoid VisitAttributeSection(AttributeSection attributeSection);\n\t\tvoid VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration);\n\t\tvoid VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration);\n\t\tvoid VisitTypeDeclaration(TypeDeclaration typeDeclaration);\n\t\tvoid VisitUsingAliasDeclaration(UsingAliasDeclaration usingAliasDeclaration);\n\t\tvoid VisitUsingDeclaration(UsingDeclaration usingDeclaration);\n\t\tvoid VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration);\n\t\t\n\t\tvoid VisitBlockStatement(BlockStatement blockStatement);\n\t\tvoid VisitBreakStatement(BreakStatement breakStatement);\n\t\tvoid VisitCheckedStatement(CheckedStatement checkedStatement);\n\t\tvoid VisitContinueStatement(ContinueStatement continueStatement);\n\t\tvoid VisitDoWhileStatement(DoWhileStatement doWhileStatement);\n\t\tvoid VisitEmptyStatement(EmptyStatement emptyStatement);\n\t\tvoid VisitExpressionStatement(ExpressionStatement expressionStatement);\n\t\tvoid VisitFixedStatement(FixedStatement fixedStatement);\n\t\tvoid VisitForeachStatement(ForeachStatement foreachStatement);\n\t\tvoid VisitForStatement(ForStatement forStatement);\n\t\tvoid VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement);\n\t\tvoid VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement);\n\t\tvoid VisitGotoStatement(GotoStatement gotoStatement);\n\t\tvoid VisitIfElseStatement(IfElseStatement ifElseStatement);\n\t\tvoid VisitLabelStatement(LabelStatement labelStatement);\n\t\tvoid VisitLockStatement(LockStatement lockStatement);\n\t\tvoid VisitReturnStatement(ReturnStatement returnStatement);\n\t\tvoid VisitSwitchStatement(SwitchStatement switchStatement);\n\t\tvoid VisitSwitchSection(SwitchSection switchSection);\n\t\tvoid VisitCaseLabel(CaseLabel caseLabel);\n\t\tvoid VisitThrowStatement(ThrowStatement throwStatement);\n\t\tvoid VisitTryCatchStatement(TryCatchStatement tryCatchStatement);\n\t\tvoid VisitCatchClause(CatchClause catchClause);\n\t\tvoid VisitUncheckedStatement(UncheckedStatement uncheckedStatement);\n\t\tvoid VisitUnsafeStatement(UnsafeStatement unsafeStatement);\n\t\tvoid VisitUsingStatement(UsingStatement usingStatement);\n\t\tvoid VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement);\n\t\tvoid VisitWhileStatement(WhileStatement whileStatement);\n\t\tvoid VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement);\n\t\tvoid VisitYieldReturnStatement(YieldReturnStatement yieldReturnStatement);\n\t\t\n\t\tvoid VisitAccessor(Accessor accessor);\n\t\tvoid VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration);\n\t\tvoid VisitConstructorInitializer(ConstructorInitializer constructorInitializer);\n\t\tvoid VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration);\n\t\tvoid VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration);\n\t\tvoid VisitEventDeclaration(EventDeclaration eventDeclaration);\n\t\tvoid VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration);\n\t\tvoid VisitFieldDeclaration(FieldDeclaration fieldDeclaration);\n\t\tvoid VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration);\n\t\tvoid VisitMethodDeclaration(MethodDeclaration methodDeclaration);\n\t\tvoid VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration);\n\t\tvoid VisitParameterDeclaration(ParameterDeclaration parameterDeclaration);\n\t\tvoid VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration);\n\t\tvoid VisitVariableInitializer(VariableInitializer variableInitializer);\n\t\tvoid VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration);\n\t\tvoid VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer);\n\t\t\n\t\tvoid VisitSyntaxTree(SyntaxTree syntaxTree);\n\t\tvoid VisitSimpleType(SimpleType simpleType);\n\t\tvoid VisitMemberType(MemberType memberType);\n\t\tvoid VisitComposedType(ComposedType composedType);\n\t\tvoid VisitArraySpecifier(ArraySpecifier arraySpecifier);\n\t\tvoid VisitPrimitiveType(PrimitiveType primitiveType);\n\t\t\n\t\tvoid VisitComment(Comment comment);\n\t\tvoid VisitNewLine(NewLineNode newLineNode);\n\t\tvoid VisitWhitespace(WhitespaceNode whitespaceNode);\n\t\tvoid VisitText(TextNode textNode);\n\t\tvoid VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective);\n\t\tvoid VisitDocumentationReference(DocumentationReference documentationReference);\n\t\t\n\t\tvoid VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration);\n\t\tvoid VisitConstraint(Constraint constraint);\n\t\tvoid VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode);\n\t\tvoid VisitIdentifier(Identifier identifier);\n\t\t\n\t\tvoid VisitNullNode(AstNode nullNode);\n\t\tvoid VisitErrorNode(AstNode errorNode);\n\t\tvoid VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern);\n\t}\n\t\n\t/// <summary>\n\t/// AST visitor.\n\t/// </summary>\n\tpublic interface IAstVisitor<out S>\n\t{\n\t\tS VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression);\n\t\tS VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression);\n\t\tS VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression);\n\t\tS VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression);\n\t\tS VisitAsExpression(AsExpression asExpression);\n\t\tS VisitAssignmentExpression(AssignmentExpression assignmentExpression);\n\t\tS VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression);\n\t\tS VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression);\n\t\tS VisitCastExpression(CastExpression castExpression);\n\t\tS VisitCheckedExpression(CheckedExpression checkedExpression);\n\t\tS VisitConditionalExpression(ConditionalExpression conditionalExpression);\n\t\tS VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression);\n\t\tS VisitDirectionExpression(DirectionExpression directionExpression);\n\t\tS VisitIdentifierExpression(IdentifierExpression identifierExpression);\n\t\tS VisitIndexerExpression(IndexerExpression indexerExpression);\n\t\tS VisitInvocationExpression(InvocationExpression invocationExpression);\n\t\tS VisitIsExpression(IsExpression isExpression);\n\t\tS VisitLambdaExpression(LambdaExpression lambdaExpression);\n\t\tS VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression);\n\t\tS VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression);\n\t\tS VisitNamedExpression(NamedExpression namedExpression);\n\t\tS VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression);\n\t\tS VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression);\n\t\tS VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression);\n\t\tS VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression);\n\t\tS VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression);\n\t\tS VisitPrimitiveExpression(PrimitiveExpression primitiveExpression);\n\t\tS VisitSizeOfExpression(SizeOfExpression sizeOfExpression);\n\t\tS VisitStackAllocExpression(StackAllocExpression stackAllocExpression);\n\t\tS VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression);\n\t\tS VisitTypeOfExpression(TypeOfExpression typeOfExpression);\n\t\tS VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression);\n\t\tS VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression);\n\t\tS VisitUncheckedExpression(UncheckedExpression uncheckedExpression);\n\n\t\tS VisitQueryExpression(QueryExpression queryExpression);\n\t\tS VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause);\n\t\tS VisitQueryFromClause(QueryFromClause queryFromClause);\n\t\tS VisitQueryLetClause(QueryLetClause queryLetClause);\n\t\tS VisitQueryWhereClause(QueryWhereClause queryWhereClause);\n\t\tS VisitQueryJoinClause(QueryJoinClause queryJoinClause);\n\t\tS VisitQueryOrderClause(QueryOrderClause queryOrderClause);\n\t\tS VisitQueryOrdering(QueryOrdering queryOrdering);\n\t\tS VisitQuerySelectClause(QuerySelectClause querySelectClause);\n\t\tS VisitQueryGroupClause(QueryGroupClause queryGroupClause);\n\t\t\n\t\tS VisitAttribute(Attribute attribute);\n\t\tS VisitAttributeSection(AttributeSection attributeSection);\n\t\tS VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration);\n\t\tS VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration);\n\t\tS VisitTypeDeclaration(TypeDeclaration typeDeclaration);\n\t\tS VisitUsingAliasDeclaration(UsingAliasDeclaration usingAliasDeclaration);\n\t\tS VisitUsingDeclaration(UsingDeclaration usingDeclaration);\n\t\tS VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration);\n\t\t\n\t\tS VisitBlockStatement(BlockStatement blockStatement);\n\t\tS VisitBreakStatement(BreakStatement breakStatement);\n\t\tS VisitCheckedStatement(CheckedStatement checkedStatement);\n\t\tS VisitContinueStatement(ContinueStatement continueStatement);\n\t\tS VisitDoWhileStatement(DoWhileStatement doWhileStatement);\n\t\tS VisitEmptyStatement(EmptyStatement emptyStatement);\n\t\tS VisitExpressionStatement(ExpressionStatement expressionStatement);\n\t\tS VisitFixedStatement(FixedStatement fixedStatement);\n\t\tS VisitForeachStatement(ForeachStatement foreachStatement);\n\t\tS VisitForStatement(ForStatement forStatement);\n\t\tS VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement);\n\t\tS VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement);\n\t\tS VisitGotoStatement(GotoStatement gotoStatement);\n\t\tS VisitIfElseStatement(IfElseStatement ifElseStatement);\n\t\tS VisitLabelStatement(LabelStatement labelStatement);\n\t\tS VisitLockStatement(LockStatement lockStatement);\n\t\tS VisitReturnStatement(ReturnStatement returnStatement);\n\t\tS VisitSwitchStatement(SwitchStatement switchStatement);\n\t\tS VisitSwitchSection(SwitchSection switchSection);\n\t\tS VisitCaseLabel(CaseLabel caseLabel);\n\t\tS VisitThrowStatement(ThrowStatement throwStatement);\n\t\tS VisitTryCatchStatement(TryCatchStatement tryCatchStatement);\n\t\tS VisitCatchClause(CatchClause catchClause);\n\t\tS VisitUncheckedStatement(UncheckedStatement uncheckedStatement);\n\t\tS VisitUnsafeStatement(UnsafeStatement unsafeStatement);\n\t\tS VisitUsingStatement(UsingStatement usingStatement);\n\t\tS VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement);\n\t\tS VisitWhileStatement(WhileStatement whileStatement);\n\t\tS VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement);\n\t\tS VisitYieldReturnStatement(YieldReturnStatement yieldReturnStatement);\n\t\t\n\t\tS VisitAccessor(Accessor accessor);\n\t\tS VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration);\n\t\tS VisitConstructorInitializer(ConstructorInitializer constructorInitializer);\n\t\tS VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration);\n\t\tS VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration);\n\t\tS VisitEventDeclaration(EventDeclaration eventDeclaration);\n\t\tS VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration);\n\t\tS VisitFieldDeclaration(FieldDeclaration fieldDeclaration);\n\t\tS VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration);\n\t\tS VisitMethodDeclaration(MethodDeclaration methodDeclaration);\n\t\tS VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration);\n\t\tS VisitParameterDeclaration(ParameterDeclaration parameterDeclaration);\n\t\tS VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration);\n\t\tS VisitVariableInitializer(VariableInitializer variableInitializer);\n\t\tS VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration);\n\t\tS VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer);\n\t\t\n\t\tS VisitSyntaxTree(SyntaxTree syntaxTree);\n\t\tS VisitSimpleType(SimpleType simpleType);\n\t\tS VisitMemberType(MemberType memberType);\n\t\tS VisitComposedType(ComposedType composedType);\n\t\tS VisitArraySpecifier(ArraySpecifier arraySpecifier);\n\t\tS VisitPrimitiveType(PrimitiveType primitiveType);\n\t\t\n\t\tS VisitComment(Comment comment);\n\t\tS VisitWhitespace(WhitespaceNode whitespaceNode);\n\t\tS VisitText(TextNode textNode);\n\t\tS VisitNewLine(NewLineNode newLineNode);\n\t\tS VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective);\n\t\tS VisitDocumentationReference(DocumentationReference documentationReference);\n\t\t\n\t\tS VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration);\n\t\tS VisitConstraint(Constraint constraint);\n\t\tS VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode);\n\t\tS VisitIdentifier(Identifier identifier);\n\t\t\n\t\tS VisitNullNode(AstNode nullNode);\n\t\tS VisitErrorNode(AstNode errorNode);\n\t\tS VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern);\n\t}\n\t\n\t/// <summary>\n\t/// AST visitor.\n\t/// </summary>\n\tpublic interface IAstVisitor<in T, out S>\n\t{\n\t\tS VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, T data);\n\t\tS VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression, T data);\n\t\tS VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, T data);\n\t\tS VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression, T data);\n\t\tS VisitAsExpression(AsExpression asExpression, T data);\n\t\tS VisitAssignmentExpression(AssignmentExpression assignmentExpression, T data);\n\t\tS VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, T data);\n\t\tS VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, T data);\n\t\tS VisitCastExpression(CastExpression castExpression, T data);\n\t\tS VisitCheckedExpression(CheckedExpression checkedExpression, T data);\n\t\tS VisitConditionalExpression(ConditionalExpression conditionalExpression, T data);\n\t\tS VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, T data);\n\t\tS VisitDirectionExpression(DirectionExpression directionExpression, T data);\n\t\tS VisitIdentifierExpression(IdentifierExpression identifierExpression, T data);\n\t\tS VisitIndexerExpression(IndexerExpression indexerExpression, T data);\n\t\tS VisitInvocationExpression(InvocationExpression invocationExpression, T data);\n\t\tS VisitIsExpression(IsExpression isExpression, T data);\n\t\tS VisitLambdaExpression(LambdaExpression lambdaExpression, T data);\n\t\tS VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, T data);\n\t\tS VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, T data);\n\t\tS VisitNamedExpression(NamedExpression namedExpression, T data);\n\t\tS VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression, T data);\n\t\tS VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, T data);\n\t\tS VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, T data);\n\t\tS VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, T data);\n\t\tS VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, T data);\n\t\tS VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, T data);\n\t\tS VisitSizeOfExpression(SizeOfExpression sizeOfExpression, T data);\n\t\tS VisitStackAllocExpression(StackAllocExpression stackAllocExpression, T data);\n\t\tS VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, T data);\n\t\tS VisitTypeOfExpression(TypeOfExpression typeOfExpression, T data);\n\t\tS VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, T data);\n\t\tS VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, T data);\n\t\tS VisitUncheckedExpression(UncheckedExpression uncheckedExpression, T data);\n\n\t\tS VisitQueryExpression(QueryExpression queryExpression, T data);\n\t\tS VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause, T data);\n\t\tS VisitQueryFromClause(QueryFromClause queryFromClause, T data);\n\t\tS VisitQueryLetClause(QueryLetClause queryLetClause, T data);\n\t\tS VisitQueryWhereClause(QueryWhereClause queryWhereClause, T data);\n\t\tS VisitQueryJoinClause(QueryJoinClause queryJoinClause, T data);\n\t\tS VisitQueryOrderClause(QueryOrderClause queryOrderClause, T data);\n\t\tS VisitQueryOrdering(QueryOrdering queryOrdering, T data);\n\t\tS VisitQuerySelectClause(QuerySelectClause querySelectClause, T data);\n\t\tS VisitQueryGroupClause(QueryGroupClause queryGroupClause, T data);\n\t\t\n\t\tS VisitAttribute(Attribute attribute, T data);\n\t\tS VisitAttributeSection(AttributeSection attributeSection, T data);\n\t\tS VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, T data);\n\t\tS VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, T data);\n\t\tS VisitTypeDeclaration(TypeDeclaration typeDeclaration, T data);\n\t\tS VisitUsingAliasDeclaration(UsingAliasDeclaration usingAliasDeclaration, T data);\n\t\tS VisitUsingDeclaration(UsingDeclaration usingDeclaration, T data);\n\t\tS VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration, T data);\n\t\t\n\t\tS VisitBlockStatement(BlockStatement blockStatement, T data);\n\t\tS VisitBreakStatement(BreakStatement breakStatement, T data);\n\t\tS VisitCheckedStatement(CheckedStatement checkedStatement, T data);\n\t\tS VisitContinueStatement(ContinueStatement continueStatement, T data);\n\t\tS VisitDoWhileStatement(DoWhileStatement doWhileStatement, T data);\n\t\tS VisitEmptyStatement(EmptyStatement emptyStatement, T data);\n\t\tS VisitExpressionStatement(ExpressionStatement expressionStatement, T data);\n\t\tS VisitFixedStatement(FixedStatement fixedStatement, T data);\n\t\tS VisitForeachStatement(ForeachStatement foreachStatement, T data);\n\t\tS VisitForStatement(ForStatement forStatement, T data);\n\t\tS VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, T data);\n\t\tS VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, T data);\n\t\tS VisitGotoStatement(GotoStatement gotoStatement, T data);\n\t\tS VisitIfElseStatement(IfElseStatement ifElseStatement, T data);\n\t\tS VisitLabelStatement(LabelStatement labelStatement, T data);\n\t\tS VisitLockStatement(LockStatement lockStatement, T data);\n\t\tS VisitReturnStatement(ReturnStatement returnStatement, T data);\n\t\tS VisitSwitchStatement(SwitchStatement switchStatement, T data);\n\t\tS VisitSwitchSection(SwitchSection switchSection, T data);\n\t\tS VisitCaseLabel(CaseLabel caseLabel, T data);\n\t\tS VisitThrowStatement(ThrowStatement throwStatement, T data);\n\t\tS VisitTryCatchStatement(TryCatchStatement tryCatchStatement, T data);\n\t\tS VisitCatchClause(CatchClause catchClause, T data);\n\t\tS VisitUncheckedStatement(UncheckedStatement uncheckedStatement, T data);\n\t\tS VisitUnsafeStatement(UnsafeStatement unsafeStatement, T data);\n\t\tS VisitUsingStatement(UsingStatement usingStatement, T data);\n\t\tS VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, T data);\n\t\tS VisitWhileStatement(WhileStatement whileStatement, T data);\n\t\tS VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement, T data);\n\t\tS VisitYieldReturnStatement(YieldReturnStatement yieldReturnStatement, T data);\n\t\t\n\t\tS VisitAccessor(Accessor accessor, T data);\n\t\tS VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, T data);\n\t\tS VisitConstructorInitializer(ConstructorInitializer constructorInitializer, T data);\n\t\tS VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, T data);\n\t\tS VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration, T data);\n\t\tS VisitEventDeclaration(EventDeclaration eventDeclaration, T data);\n\t\tS VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration, T data);\n\t\tS VisitFieldDeclaration(FieldDeclaration fieldDeclaration, T data);\n\t\tS VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration, T data);\n\t\tS VisitMethodDeclaration(MethodDeclaration methodDeclaration, T data);\n\t\tS VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, T data);\n\t\tS VisitParameterDeclaration(ParameterDeclaration parameterDeclaration, T data);\n\t\tS VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, T data);\n\t\tS VisitVariableInitializer(VariableInitializer variableInitializer, T data);\n\t\tS VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, T data);\n\t\tS VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer, T data);\n\t\t\n\t\tS VisitSyntaxTree(SyntaxTree syntaxTree, T data);\n\t\tS VisitSimpleType(SimpleType simpleType, T data);\n\t\tS VisitMemberType(MemberType memberType, T data);\n\t\tS VisitComposedType(ComposedType composedType, T data);\n\t\tS VisitArraySpecifier(ArraySpecifier arraySpecifier, T data);\n\t\tS VisitPrimitiveType(PrimitiveType primitiveType, T data);\n\t\t\n\t\tS VisitComment(Comment comment, T data);\n\t\tS VisitNewLine(NewLineNode newLineNode, T data);\n\t\tS VisitWhitespace(WhitespaceNode whitespaceNode, T data);\n\t\tS VisitText(TextNode textNode, T data);\n\t\tS VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective, T data);\n\t\tS VisitDocumentationReference(DocumentationReference documentationReference, T data);\n\t\t\n\t\tS VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration, T data);\n\t\tS VisitConstraint(Constraint constraint, T data);\n\t\tS VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode, T data);\n\t\tS VisitIdentifier(Identifier identifier, T data);\n\t\t\n\t\tS VisitNullNode(AstNode nullNode, T data);\n\t\tS VisitErrorNode(AstNode errorNode, T data);\n\t\tS VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern, T data);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs",
    "content": "﻿// \n// Identifier.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class Identifier : AstNode\n\t{\n\t\tpublic new static readonly Identifier Null = new NullIdentifier ();\n\t\tsealed class NullIdentifier : Identifier\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Token;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstring name;\n\t\tpublic string Name {\n\t\t\tget { return this.name; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tthis.name = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTextLocation startLocation;\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn startLocation;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal void SetStartLocation(TextLocation value)\n\t\t{\n\t\t\tThrowIfFrozen();\n\t\t\tthis.startLocation = value;\n\t\t}\n\t\t\n\t\tconst uint verbatimBit = 1u << AstNodeFlagsUsedBits;\n\t\t\n\t\tpublic bool IsVerbatim {\n\t\t\tget {\n\t\t\t\treturn (flags & verbatimBit) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tif (value)\n\t\t\t\t\tflags |= verbatimBit;\n\t\t\t\telse\n\t\t\t\t\tflags &= ~verbatimBit;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (StartLocation.Line, StartLocation.Column + (Name ?? \"\").Length + (IsVerbatim ? 1 : 0));\n\t\t\t}\n\t\t}\n\t\t\n\t\tIdentifier ()\n\t\t{\n\t\t\tthis.name = string.Empty;\n\t\t}\n\t\t\n\t\tprotected Identifier (string name, TextLocation location)\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tthis.Name = name;\n\t\t\tthis.startLocation = location;\n\t\t}\n\n\t\tpublic static Identifier Create (string name)\n\t\t{\n\t\t\treturn Create (name, TextLocation.Empty);\n\t\t}\n\n\t\tpublic static Identifier Create (string name, TextLocation location)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(name))\n\t\t\t\treturn Identifier.Null;\n\t\t\tif (name[0] == '@')\n\t\t\t\treturn new Identifier (name.Substring (1), new TextLocation (location.Line, location.Column + 1)) { IsVerbatim = true };\n\t\t\telse\n\t\t\t\treturn new Identifier (name, location);\n\t\t}\n\t\t\n\t\tpublic static Identifier Create (string name, TextLocation location, bool isVerbatim)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty (name))\n\t\t\t\treturn Identifier.Null;\n\t\t\t\n\t\t\tif (isVerbatim)\n\t\t\t\treturn new Identifier (name, location) { IsVerbatim = true };\n\t\t\treturn new Identifier (name, location);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitIdentifier (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitIdentifier (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitIdentifier (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tIdentifier o = other as Identifier;\n\t\t\treturn o != null && !o.IsNull && MatchString(this.Name, o.Name);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/IdentifierExpressionBackreference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Matches identifier expressions that have the same identifier as the referenced variable/type definition/method definition.\n\t/// </summary>\n\tpublic class IdentifierExpressionBackreference : Pattern\n\t{\n\t\treadonly string referencedGroupName;\n\t\t\n\t\tpublic string ReferencedGroupName {\n\t\t\tget { return referencedGroupName; }\n\t\t}\n\t\t\n\t\tpublic IdentifierExpressionBackreference(string referencedGroupName)\n\t\t{\n\t\t\tif (referencedGroupName == null)\n\t\t\t\tthrow new ArgumentNullException(\"referencedGroupName\");\n\t\t\tthis.referencedGroupName = referencedGroupName;\n\t\t}\n\t\t\n\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t{\n\t\t\tCSharp.IdentifierExpression ident = other as CSharp.IdentifierExpression;\n\t\t\tif (ident == null || ident.TypeArguments.Any())\n\t\t\t\treturn false;\n\t\t\tCSharp.AstNode referenced = (CSharp.AstNode)match.Get(referencedGroupName).Last();\n\t\t\tif (referenced == null)\n\t\t\t\treturn false;\n\t\t\treturn ident.Identifier == referenced.GetChildByRole(CSharp.Roles.Identifier).Name;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs",
    "content": "﻿// \n// FullTypeName.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class MemberType : AstType\n\t{\n\t\tpublic static readonly Role<AstType> TargetRole = new Role<AstType>(\"Target\", AstType.Null);\n\t\t\n\t\tbool isDoubleColon;\n\t\t\n\t\tpublic bool IsDoubleColon {\n\t\t\tget { return isDoubleColon; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tisDoubleColon = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstType Target {\n\t\t\tget { return GetChildByRole(TargetRole); }\n\t\t\tset { SetChildByRole(TargetRole, value); }\n\t\t}\n\t\t\n\t\tpublic string MemberName {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier MemberNameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstType> TypeArguments {\n\t\t\tget { return GetChildrenByRole (Roles.TypeArgument); }\n\t\t}\n\t\t\n\t\tpublic MemberType ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic MemberType (AstType target, string memberName)\n\t\t{\n\t\t\tthis.Target = target;\n\t\t\tthis.MemberName = memberName;\n\t\t}\n\t\t\n\t\tpublic MemberType (AstType target, string memberName, IEnumerable<AstType> typeArguments)\n\t\t{\n\t\t\tthis.Target = target;\n\t\t\tthis.MemberName = memberName;\n\t\t\tforeach (var arg in typeArguments) {\n\t\t\t\tAddChild (arg, Roles.TypeArgument);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic MemberType (AstType target, string memberName, params AstType[] typeArguments) : this (target, memberName, (IEnumerable<AstType>)typeArguments)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitMemberType (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitMemberType (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitMemberType (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tMemberType o = other as MemberType;\n\t\t\treturn o != null && this.IsDoubleColon == o.IsDoubleColon\n\t\t\t\t&& MatchString(this.MemberName, o.MemberName) && this.Target.DoMatch(o.Target, match)\n\t\t\t\t&& this.TypeArguments.DoMatch(o.TypeArguments, match);\n\t\t}\n\n\t\tpublic override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null)\n\t\t{\n\t\t\tif (interningProvider == null)\n\t\t\t\tinterningProvider = InterningProvider.Dummy;\n\t\t\t\n\t\t\tTypeOrNamespaceReference t;\n\t\t\tif (this.IsDoubleColon) {\n\t\t\t\tSimpleType st = this.Target as SimpleType;\n\t\t\t\tif (st != null) {\n\t\t\t\t\tt = interningProvider.Intern(new AliasNamespaceReference(interningProvider.Intern(st.Identifier)));\n\t\t\t\t} else {\n\t\t\t\t\tt = null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tt = this.Target.ToTypeReference(lookupMode, interningProvider) as TypeOrNamespaceReference;\n\t\t\t}\n\t\t\tif (t == null)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\tvar typeArguments = new List<ITypeReference>();\n\t\t\tforeach (var ta in this.TypeArguments) {\n\t\t\t\ttypeArguments.Add(ta.ToTypeReference(lookupMode, interningProvider));\n\t\t\t}\n\t\t\tstring memberName = interningProvider.Intern(this.MemberName);\n\t\t\treturn interningProvider.Intern(new MemberTypeOrNamespaceReference(t, memberName, interningProvider.InternList(typeArguments), lookupMode));\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Modifiers.cs",
    "content": "﻿//\n// Modifiers.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[Flags]\n\tpublic enum Modifiers\n\t{\n\t\tNone       = 0,\n\t\t\n\t\tPrivate   = 0x0001,\n\t\tInternal  = 0x0002,\n\t\tProtected = 0x0004,\n\t\tPublic    = 0x0008,\n\t\t\n\t\tAbstract  = 0x0010,\n\t\tVirtual   = 0x0020,\n\t\tSealed    = 0x0040,\n\t\tStatic    = 0x0080,\n\t\tOverride  = 0x0100,\n\t\tReadonly  = 0x0200,\n\t\tConst     = 0x0400,\n\t\tNew       = 0x0800,\n\t\tPartial   = 0x1000,\n\t\t\n\t\tExtern    = 0x2000,\n\t\tVolatile  = 0x4000,\n\t\tUnsafe    = 0x8000,\n\t\tAsync     = 0x10000,\n\t\t\n\t\tVisibilityMask = Private | Internal | Protected | Public,\n\t\t\n\t\t/// <summary>\n\t\t/// Special value used to match any modifiers during pattern matching.\n\t\t/// </summary>\n\t\tAny = unchecked((int)0x80000000)\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/NodeType.cs",
    "content": "﻿// \n// NodeType.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum NodeType\n\t{\n\t\tUnknown,\n\t\t/// <summary>\n\t\t/// AstType\n\t\t/// </summary>\n\t\tTypeReference,\n\t\t/// <summary>\n\t\t/// Type or delegate declaration\n\t\t/// </summary>\n\t\tTypeDeclaration,\n\t\tMember,\n\t\tStatement,\n\t\tExpression,\n\t\tToken,\n\t\tQueryClause,\n\t\t/// <summary>\n\t\t/// Comment or whitespace or pre-processor directive \n\t\t/// </summary>\n\t\tWhitespace,\n\t\t/// <summary>\n\t\t/// Placeholder for a pattern\n\t\t/// </summary>\n\t\tPattern\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ObservableAstVisitor.cs",
    "content": "﻿// \n// ObservableAstVisitor.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class ObservableAstVisitor : IAstVisitor\n\t{\n\t\tvoid Visit<T>(Action<T> enter, Action<T> leave, T node) where T : AstNode\n\t\t{\n\t\t\tif (enter != null)\n\t\t\t\tenter(node);\n\t\t\tAstNode next;\n\t\t\tfor (var child = node.FirstChild; child != null; child = next) {\n\t\t\t\t// Store next to allow the loop to continue\n\t\t\t\t// if the visitor removes/replaces children.\n\t\t\t\tnext = child.NextSibling;\n\t\t\t\tchild.AcceptVisitor (this);\n\t\t\t}\n\t\t\tif (leave != null)\n\t\t\t\tleave(node);\n\t\t}\n\n\t\tvoid IAstVisitor.VisitNullNode(AstNode nullNode)\n\t\t{\n\t\t}\n\n\t\tvoid IAstVisitor.VisitErrorNode(AstNode nullNode)\n\t\t{\n\t\t}\n\n\t\tpublic event Action<SyntaxTree> EnterSyntaxTree, LeaveSyntaxTree;\n\t\t\n\t\tvoid IAstVisitor.VisitSyntaxTree(SyntaxTree unit)\n\t\t{\n\t\t\tVisit(EnterSyntaxTree, LeaveSyntaxTree, unit);\n\t\t}\n\t\t\n\t\tpublic event Action<Comment> EnterComment, LeaveComment;\n\t\t\n\t\tvoid IAstVisitor.VisitComment(Comment comment)\n\t\t{\n\t\t\tVisit(EnterComment, LeaveComment, comment);\n\t\t}\n\t\t\n\t\tpublic event Action<NewLineNode> EnterNewLine, LeaveNewLine;\n\t\t\n\t\tvoid IAstVisitor.VisitNewLine(NewLineNode newLineNode)\n\t\t{\n\t\t\tVisit(EnterNewLine, LeaveNewLine, newLineNode);\n\t\t}\n\t\t\n\t\tpublic event Action<WhitespaceNode> EnterWhitespace, LeaveWhitespace;\n\t\t\n\t\tvoid IAstVisitor.VisitWhitespace(WhitespaceNode whitespace)\n\t\t{\n\t\t\tVisit(EnterWhitespace, LeaveWhitespace, whitespace);\n\t\t}\n\t\t\n\t\tpublic event Action<TextNode> EnterText, LeaveText;\n\t\t\n\t\tvoid IAstVisitor.VisitText(TextNode textNode)\n\t\t{\n\t\t\tVisit(EnterText, LeaveText, textNode);\n\t\t}\n\t\t\n\t\tpublic event Action<PreProcessorDirective> EnterPreProcessorDirective, LeavePreProcessorDirective;\n\t\tvoid IAstVisitor.VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t\tVisit(EnterPreProcessorDirective, LeavePreProcessorDirective, preProcessorDirective);\n\t\t}\n\t\t\n\t\tpublic event Action<DocumentationReference> EnterDocumentationReference, LeaveDocumentationReference;\n\t\t\n\t\tvoid IAstVisitor.VisitDocumentationReference(DocumentationReference documentationReference)\n\t\t{\n\t\t\tVisit(EnterDocumentationReference, LeaveDocumentationReference, documentationReference);\n\t\t}\n\t\t\n\t\tpublic event Action<Identifier> EnterIdentifier, LeaveIdentifier;\n\t\t\n\t\tvoid IAstVisitor.VisitIdentifier(Identifier identifier)\n\t\t{\n\t\t\tVisit(EnterIdentifier, LeaveIdentifier, identifier);\n\t\t}\n\t\t\n\t\tpublic event Action<CSharpTokenNode> EnterCSharpTokenNode, LeaveCSharpTokenNode;\n\t\t\n\t\tvoid IAstVisitor.VisitCSharpTokenNode(CSharpTokenNode token)\n\t\t{\n\t\t\tVisit(EnterCSharpTokenNode, LeaveCSharpTokenNode, token);\n\t\t}\n\t\t\n\t\tpublic event Action<PrimitiveType> EnterPrimitiveType, LeavePrimitiveType;\n\t\t\n\t\tvoid IAstVisitor.VisitPrimitiveType(PrimitiveType primitiveType)\n\t\t{\n\t\t\tVisit(EnterPrimitiveType, LeavePrimitiveType, primitiveType);\n\t\t}\n\t\t\n\t\tpublic event Action<ComposedType> EnterComposedType, LeaveComposedType;\n\t\t\n\t\tvoid IAstVisitor.VisitComposedType(ComposedType composedType)\n\t\t{\n\t\t\tVisit(EnterComposedType, LeaveComposedType, composedType);\n\t\t}\n\t\t\n\t\tpublic event Action<SimpleType> EnterSimpleType, LeaveSimpleType;\n\t\t\n\t\tvoid IAstVisitor.VisitSimpleType(SimpleType simpleType)\n\t\t{\n\t\t\tVisit(EnterSimpleType, LeaveSimpleType, simpleType);\n\t\t}\n\t\t\n\t\tpublic event Action<MemberType> EnterMemberType, LeaveMemberType;\n\t\t\n\t\tvoid IAstVisitor.VisitMemberType(MemberType memberType)\n\t\t{\n\t\t\tVisit(EnterMemberType, LeaveMemberType, memberType);\n\t\t}\n\t\t\n\t\tpublic event Action<Attribute> EnterAttribute, LeaveAttribute;\n\t\t\n\t\tvoid IAstVisitor.VisitAttribute(Attribute attribute)\n\t\t{\n\t\t\tVisit(EnterAttribute, LeaveAttribute, attribute);\n\t\t}\n\t\t\n\t\tpublic event Action<AttributeSection> EnterAttributeSection, LeaveAttributeSection;\n\t\t\n\t\tvoid IAstVisitor.VisitAttributeSection(AttributeSection attributeSection)\n\t\t{\n\t\t\tVisit(EnterAttributeSection, LeaveAttributeSection, attributeSection);\n\t\t}\n\t\t\n\t\tpublic event Action<DelegateDeclaration> EnterDelegateDeclaration, LeaveDelegateDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\tVisit(EnterDelegateDeclaration, LeaveDelegateDeclaration, delegateDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<NamespaceDeclaration> EnterNamespaceDeclaration, LeaveNamespaceDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\tVisit(EnterNamespaceDeclaration, LeaveNamespaceDeclaration, namespaceDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<TypeDeclaration> EnterTypeDeclaration, LeaveTypeDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\tVisit(EnterTypeDeclaration, LeaveTypeDeclaration, typeDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<TypeParameterDeclaration> EnterTypeParameterDeclaration, LeaveTypeParameterDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration)\n\t\t{\n\t\t\tVisit(EnterTypeParameterDeclaration, LeaveTypeParameterDeclaration, typeParameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<EnumMemberDeclaration> EnterEnumMemberDeclaration, LeaveEnumMemberDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\tVisit(EnterEnumMemberDeclaration, LeaveEnumMemberDeclaration, enumMemberDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<UsingDeclaration> EnterUsingDeclaration, LeaveUsingDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\tVisit(EnterUsingDeclaration, LeaveUsingDeclaration, usingDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<UsingAliasDeclaration> EnterUsingAliasDeclaration, LeaveUsingAliasDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitUsingAliasDeclaration(UsingAliasDeclaration usingDeclaration)\n\t\t{\n\t\t\tVisit(EnterUsingAliasDeclaration, LeaveUsingAliasDeclaration, usingDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<ExternAliasDeclaration> EnterExternAliasDeclaration, LeaveExternAliasDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\tVisit(EnterExternAliasDeclaration, LeaveExternAliasDeclaration, externAliasDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<ConstructorDeclaration> EnterConstructorDeclaration, LeaveConstructorDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\tVisit(EnterConstructorDeclaration, LeaveConstructorDeclaration, constructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<ConstructorInitializer> EnterConstructorInitializer, LeaveConstructorInitializer;\n\t\t\n\t\tvoid IAstVisitor.VisitConstructorInitializer(ConstructorInitializer constructorInitializer)\n\t\t{\n\t\t\tVisit(EnterConstructorInitializer, LeaveConstructorInitializer, constructorInitializer);\n\t\t}\n\t\t\n\t\tpublic event Action<DestructorDeclaration> EnterDestructorDeclaration, LeaveDestructorDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\tVisit(EnterDestructorDeclaration, LeaveDestructorDeclaration, destructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<EventDeclaration> EnterEventDeclaration, LeaveEventDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tVisit(EnterEventDeclaration, LeaveEventDeclaration, eventDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<CustomEventDeclaration> EnterCustomEventDeclaration, LeaveCustomEventDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\tVisit(EnterCustomEventDeclaration, LeaveCustomEventDeclaration, eventDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<FieldDeclaration> EnterFieldDeclaration, LeaveFieldDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tVisit(EnterFieldDeclaration, LeaveFieldDeclaration, fieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<FixedFieldDeclaration> EnterFixedFieldDeclaration, LeaveFixedFieldDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\tVisit(EnterFixedFieldDeclaration, LeaveFixedFieldDeclaration, fixedFieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<FixedVariableInitializer> EnterFixedVariableInitializer, LeaveFixedVariableInitializer;\n\t\t\n\t\tvoid IAstVisitor.VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)\n\t\t{\n\t\t\tVisit(EnterFixedVariableInitializer, LeaveFixedVariableInitializer, fixedVariableInitializer);\n\t\t}\n\t\t\n\t\tpublic event Action<IndexerDeclaration> EnterIndexerDeclaration, LeaveIndexerDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\tVisit(EnterIndexerDeclaration, LeaveIndexerDeclaration, indexerDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<MethodDeclaration> EnterMethodDeclaration, LeaveMethodDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tVisit(EnterMethodDeclaration, LeaveMethodDeclaration, methodDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<OperatorDeclaration> EnterOperatorDeclaration, LeaveOperatorDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\tVisit(EnterOperatorDeclaration, LeaveOperatorDeclaration, operatorDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<PropertyDeclaration> EnterPropertyDeclaration, LeavePropertyDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tVisit(EnterPropertyDeclaration, LeavePropertyDeclaration, propertyDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<Accessor> EnterAccessor, LeaveAccessor;\n\t\t\n\t\tvoid IAstVisitor.VisitAccessor(Accessor accessor)\n\t\t{\n\t\t\tVisit(EnterAccessor, LeaveAccessor, accessor);\n\t\t}\n\t\t\n\t\tpublic event Action<VariableInitializer> EnterVariableInitializer, LeaveVariableInitializer;\n\t\t\n\t\tvoid IAstVisitor.VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\tVisit(EnterVariableInitializer, LeaveVariableInitializer, variableInitializer);\n\t\t}\n\t\t\n\t\tpublic event Action<ParameterDeclaration> EnterParameterDeclaration, LeaveParameterDeclaration;\n\t\t\n\t\tvoid IAstVisitor.VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tVisit(EnterParameterDeclaration, LeaveParameterDeclaration, parameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic event Action<Constraint> EnterConstraint, LeaveConstraint;\n\t\t\n\t\tvoid IAstVisitor.VisitConstraint(Constraint constraint)\n\t\t{\n\t\t\tVisit(EnterConstraint, LeaveConstraint, constraint);\n\t\t}\n\t\t\n\t\tpublic event Action<BlockStatement> EnterBlockStatement, LeaveBlockStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitBlockStatement(BlockStatement blockStatement)\n\t\t{\n\t\t\tVisit(EnterBlockStatement, LeaveBlockStatement, blockStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<ExpressionStatement> EnterExpressionStatement, LeaveExpressionStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitExpressionStatement(ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tVisit(EnterExpressionStatement, LeaveExpressionStatement, expressionStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<BreakStatement> EnterBreakStatement, LeaveBreakStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitBreakStatement(BreakStatement breakStatement)\n\t\t{\n\t\t\tVisit(EnterBreakStatement, LeaveBreakStatement, breakStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<CheckedStatement> EnterCheckedStatement, LeaveCheckedStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitCheckedStatement(CheckedStatement checkedStatement)\n\t\t{\n\t\t\tVisit(EnterCheckedStatement, LeaveCheckedStatement, checkedStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<ContinueStatement> EnterContinueStatement, LeaveContinueStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitContinueStatement(ContinueStatement continueStatement)\n\t\t{\n\t\t\tVisit(EnterContinueStatement, LeaveContinueStatement, continueStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<DoWhileStatement> EnterDoWhileStatement, LeaveDoWhileStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitDoWhileStatement(DoWhileStatement doWhileStatement)\n\t\t{\n\t\t\tVisit(EnterDoWhileStatement, LeaveDoWhileStatement, doWhileStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<EmptyStatement> EnterEmptyStatement, LeaveEmptyStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitEmptyStatement(EmptyStatement emptyStatement)\n\t\t{\n\t\t\tVisit(EnterEmptyStatement, LeaveEmptyStatement, emptyStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<FixedStatement> EnterFixedStatement, LeaveFixedStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitFixedStatement(FixedStatement fixedStatement)\n\t\t{\n\t\t\tVisit(EnterFixedStatement, LeaveFixedStatement, fixedStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<ForeachStatement> EnterForeachStatement, LeaveForeachStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t{\n\t\t\tVisit(EnterForeachStatement, LeaveForeachStatement, foreachStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<ForStatement> EnterForStatement, LeaveForStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitForStatement(ForStatement forStatement)\n\t\t{\n\t\t\tVisit(EnterForStatement, LeaveForStatement, forStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<GotoCaseStatement> EnterGotoCaseStatement, LeaveGotoCaseStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement)\n\t\t{\n\t\t\tVisit(EnterGotoCaseStatement, LeaveGotoCaseStatement, gotoCaseStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<GotoDefaultStatement> EnterGotoDefaultStatement, LeaveGotoDefaultStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)\n\t\t{\n\t\t\tVisit(EnterGotoDefaultStatement, LeaveGotoDefaultStatement, gotoDefaultStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<GotoStatement> EnterGotoStatement, LeaveGotoStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitGotoStatement(GotoStatement gotoStatement)\n\t\t{\n\t\t\tVisit(EnterGotoStatement, LeaveGotoStatement, gotoStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<IfElseStatement> EnterIfElseStatement, LeaveIfElseStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t{\n\t\t\tVisit(EnterIfElseStatement, LeaveIfElseStatement, ifElseStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<LabelStatement> EnterLabelStatement, LeaveLabelStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitLabelStatement(LabelStatement labelStatement)\n\t\t{\n\t\t\tVisit(EnterLabelStatement, LeaveLabelStatement, labelStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<LockStatement> EnterLockStatement, LeaveLockStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitLockStatement(LockStatement lockStatement)\n\t\t{\n\t\t\tVisit(EnterLockStatement, LeaveLockStatement, lockStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<ReturnStatement> EnterReturnStatement, LeaveReturnStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitReturnStatement(ReturnStatement returnStatement)\n\t\t{\n\t\t\tVisit(EnterReturnStatement, LeaveReturnStatement, returnStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<SwitchStatement> EnterSwitchStatement, LeaveSwitchStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitSwitchStatement(SwitchStatement switchStatement)\n\t\t{\n\t\t\tVisit(EnterSwitchStatement, LeaveSwitchStatement, switchStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<SwitchSection> EnterSwitchSection, LeaveSwitchSection;\n\t\t\n\t\tvoid IAstVisitor.VisitSwitchSection(SwitchSection switchSection)\n\t\t{\n\t\t\tVisit(EnterSwitchSection, LeaveSwitchSection, switchSection);\n\t\t}\n\t\t\n\t\tpublic event Action<CaseLabel> EnterCaseLabel, LeaveCaseLabel;\n\t\t\n\t\tvoid IAstVisitor.VisitCaseLabel(CaseLabel caseLabel)\n\t\t{\n\t\t\tVisit(EnterCaseLabel, LeaveCaseLabel, caseLabel);\n\t\t}\n\t\t\n\t\tpublic event Action<ThrowStatement> EnterThrowStatement, LeaveThrowStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitThrowStatement(ThrowStatement throwStatement)\n\t\t{\n\t\t\tVisit(EnterThrowStatement, LeaveThrowStatement, throwStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<TryCatchStatement> EnterTryCatchStatement, LeaveTryCatchStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitTryCatchStatement(TryCatchStatement tryCatchStatement)\n\t\t{\n\t\t\tVisit(EnterTryCatchStatement, LeaveTryCatchStatement, tryCatchStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<CatchClause> EnterCatchClause, LeaveCatchClause;\n\t\t\n\t\tvoid IAstVisitor.VisitCatchClause(CatchClause catchClause)\n\t\t{\n\t\t\tVisit(EnterCatchClause, LeaveCatchClause, catchClause);\n\t\t}\n\t\t\n\t\tpublic event Action<UncheckedStatement> EnterUncheckedStatement, LeaveUncheckedStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitUncheckedStatement(UncheckedStatement uncheckedStatement)\n\t\t{\n\t\t\tVisit(EnterUncheckedStatement, LeaveUncheckedStatement, uncheckedStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<UnsafeStatement> EnterUnsafeStatement, LeaveUnsafeStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitUnsafeStatement(UnsafeStatement unsafeStatement)\n\t\t{\n\t\t\tVisit(EnterUnsafeStatement, LeaveUnsafeStatement, unsafeStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<UsingStatement> EnterUsingStatement, LeaveUsingStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitUsingStatement(UsingStatement usingStatement)\n\t\t{\n\t\t\tVisit(EnterUsingStatement, LeaveUsingStatement, usingStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<VariableDeclarationStatement> EnterVariableDeclarationStatement, LeaveVariableDeclarationStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\tVisit(EnterVariableDeclarationStatement, LeaveVariableDeclarationStatement, variableDeclarationStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<WhileStatement> EnterWhileStatement, LeaveWhileStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitWhileStatement(WhileStatement whileStatement)\n\t\t{\n\t\t\tVisit(EnterWhileStatement, LeaveWhileStatement, whileStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<YieldBreakStatement> EnterYieldBreakStatement, LeaveYieldBreakStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement)\n\t\t{\n\t\t\tVisit(EnterYieldBreakStatement, LeaveYieldBreakStatement, yieldBreakStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<YieldReturnStatement> EnterYieldReturnStatement, LeaveYieldReturnStatement;\n\t\t\n\t\tvoid IAstVisitor.VisitYieldReturnStatement(YieldReturnStatement yieldStatement)\n\t\t{\n\t\t\tVisit(EnterYieldReturnStatement, LeaveYieldReturnStatement, yieldStatement);\n\t\t}\n\t\t\n\t\tpublic event Action<AnonymousMethodExpression> EnterAnonymousMethodExpression, LeaveAnonymousMethodExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\tVisit(EnterAnonymousMethodExpression, LeaveAnonymousMethodExpression, anonymousMethodExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<LambdaExpression> EnterLambdaExpression, LeaveLambdaExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tVisit(EnterLambdaExpression, LeaveLambdaExpression, lambdaExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<AssignmentExpression> EnterAssignmentExpression, LeaveAssignmentExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\tVisit(EnterAssignmentExpression, LeaveAssignmentExpression, assignmentExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<BaseReferenceExpression> EnterBaseReferenceExpression, LeaveBaseReferenceExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression)\n\t\t{\n\t\t\tVisit(EnterBaseReferenceExpression, LeaveBaseReferenceExpression, baseReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<BinaryOperatorExpression> EnterBinaryOperatorExpression, LeaveBinaryOperatorExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\tVisit(EnterBinaryOperatorExpression, LeaveBinaryOperatorExpression, binaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<CastExpression> EnterCastExpression, LeaveCastExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitCastExpression(CastExpression castExpression)\n\t\t{\n\t\t\tVisit(EnterCastExpression, LeaveCastExpression, castExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<CheckedExpression> EnterCheckedExpression, LeaveCheckedExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitCheckedExpression(CheckedExpression checkedExpression)\n\t\t{\n\t\t\tVisit(EnterCheckedExpression, LeaveCheckedExpression, checkedExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<ConditionalExpression> EnterConditionalExpression, LeaveConditionalExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\tVisit(EnterConditionalExpression, LeaveConditionalExpression, conditionalExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<IdentifierExpression> EnterIdentifierExpression, LeaveIdentifierExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tVisit(EnterIdentifierExpression, LeaveIdentifierExpression, identifierExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<IndexerExpression> EnterIndexerExpression, LeaveIndexerExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t{\n\t\t\tVisit(EnterIndexerExpression, LeaveIndexerExpression, indexerExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<InvocationExpression> EnterInvocationExpression, LeaveInvocationExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\tVisit(EnterInvocationExpression, LeaveInvocationExpression, invocationExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<DirectionExpression> EnterDirectionExpression, LeaveDirectionExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t{\n\t\t\tVisit(EnterDirectionExpression, LeaveDirectionExpression, directionExpression);\n\t\t}\n\n\t\tpublic event Action<MemberReferenceExpression> EnterMemberReferenceExpression, LeaveMemberReferenceExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tVisit(EnterMemberReferenceExpression, LeaveMemberReferenceExpression, memberReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<NullReferenceExpression> EnterNullReferenceExpression, LeaveNullReferenceExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression)\n\t\t{\n\t\t\tVisit(EnterNullReferenceExpression, LeaveNullReferenceExpression, nullReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<ObjectCreateExpression> EnterObjectCreateExpression, LeaveObjectCreateExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t{\n\t\t\tVisit(EnterObjectCreateExpression, LeaveObjectCreateExpression, objectCreateExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<AnonymousTypeCreateExpression> EnterAnonymousTypeCreateExpression, LeaveAnonymousTypeCreateExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t{\n\t\t\tVisit(EnterAnonymousTypeCreateExpression, LeaveAnonymousTypeCreateExpression, anonymousTypeCreateExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<ArrayCreateExpression> EnterArrayCreateExpression, LeaveArrayCreateExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitArrayCreateExpression(ArrayCreateExpression arraySCreateExpression)\n\t\t{\n\t\t\tVisit(EnterArrayCreateExpression, LeaveArrayCreateExpression, arraySCreateExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<ParenthesizedExpression> EnterParenthesizedExpression, LeaveParenthesizedExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\tVisit(EnterParenthesizedExpression, LeaveParenthesizedExpression, parenthesizedExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<PointerReferenceExpression> EnterPointerReferenceExpression, LeavePointerReferenceExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\tVisit(EnterPointerReferenceExpression, LeavePointerReferenceExpression, pointerReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<PrimitiveExpression> EnterPrimitiveExpression, LeavePrimitiveExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t{\n\t\t\tVisit(EnterPrimitiveExpression, LeavePrimitiveExpression, primitiveExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<SizeOfExpression> EnterSizeOfExpression, LeaveSizeOfExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitSizeOfExpression(SizeOfExpression sizeOfExpression)\n\t\t{\n\t\t\tVisit(EnterSizeOfExpression, LeaveSizeOfExpression, sizeOfExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<StackAllocExpression> EnterStackAllocExpression, LeaveStackAllocExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitStackAllocExpression(StackAllocExpression stackAllocExpression)\n\t\t{\n\t\t\tVisit(EnterStackAllocExpression, LeaveStackAllocExpression, stackAllocExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<ThisReferenceExpression> EnterThisReferenceExpression, LeaveThisReferenceExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t{\n\t\t\tVisit(EnterThisReferenceExpression, LeaveThisReferenceExpression, thisReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<TypeOfExpression> EnterTypeOfExpression, LeaveTypeOfExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitTypeOfExpression(TypeOfExpression typeOfExpression)\n\t\t{\n\t\t\tVisit(EnterTypeOfExpression, LeaveTypeOfExpression, typeOfExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<TypeReferenceExpression> EnterTypeReferenceExpression, LeaveTypeReferenceExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression)\n\t\t{\n\t\t\tVisit(EnterTypeReferenceExpression, LeaveTypeReferenceExpression, typeReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<UnaryOperatorExpression> EnterUnaryOperatorExpression, LeaveUnaryOperatorExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tVisit(EnterUnaryOperatorExpression, LeaveUnaryOperatorExpression, unaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<UncheckedExpression> EnterUncheckedExpression, LeaveUncheckedExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitUncheckedExpression(UncheckedExpression uncheckedExpression)\n\t\t{\n\t\t\tVisit(EnterUncheckedExpression, LeaveUncheckedExpression, uncheckedExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryExpression> EnterQueryExpression, LeaveQueryExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\tVisit(EnterQueryExpression, LeaveQueryExpression, queryExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryContinuationClause> EnterQueryContinuationClause, LeaveQueryContinuationClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t{\n\t\t\tVisit(EnterQueryContinuationClause, LeaveQueryContinuationClause, queryContinuationClause);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryFromClause> EnterQueryFromClause, LeaveQueryFromClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t{\n\t\t\tVisit(EnterQueryFromClause, LeaveQueryFromClause, queryFromClause);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryLetClause> EnterQueryLetClause, LeaveQueryLetClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t{\n\t\t\tVisit(EnterQueryLetClause, LeaveQueryLetClause, queryLetClause);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryWhereClause> EnterQueryWhereClause, LeaveQueryWhereClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryWhereClause(QueryWhereClause queryWhereClause)\n\t\t{\n\t\t\tVisit(EnterQueryWhereClause, LeaveQueryWhereClause, queryWhereClause);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryJoinClause> EnterQueryJoinClause, LeaveQueryJoinClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryJoinClause(QueryJoinClause queryJoinClause)\n\t\t{\n\t\t\tVisit(EnterQueryJoinClause, LeaveQueryJoinClause, queryJoinClause);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryOrderClause> EnterQueryOrderClause, LeaveQueryOrderClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryOrderClause(QueryOrderClause queryOrderClause)\n\t\t{\n\t\t\tVisit(EnterQueryOrderClause, LeaveQueryOrderClause, queryOrderClause);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryOrdering> EnterQueryOrdering, LeaveQueryOrdering;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryOrdering(QueryOrdering queryOrdering)\n\t\t{\n\t\t\tVisit(EnterQueryOrdering, LeaveQueryOrdering, queryOrdering);\n\t\t}\n\t\t\n\t\tpublic event Action<QuerySelectClause> EnterQuerySelectClause, LeaveQuerySelectClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQuerySelectClause(QuerySelectClause querySelectClause)\n\t\t{\n\t\t\tVisit(EnterQuerySelectClause, LeaveQuerySelectClause, querySelectClause);\n\t\t}\n\t\t\n\t\tpublic event Action<QueryGroupClause> EnterQueryGroupClause, LeaveQueryGroupClause;\n\t\t\n\t\tvoid IAstVisitor.VisitQueryGroupClause(QueryGroupClause queryGroupClause)\n\t\t{\n\t\t\tVisit(EnterQueryGroupClause, LeaveQueryGroupClause, queryGroupClause);\n\t\t}\n\t\t\n\t\tpublic event Action<AsExpression> EnterAsExpression, LeaveAsExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitAsExpression(AsExpression asExpression)\n\t\t{\n\t\t\tVisit(EnterAsExpression, LeaveAsExpression, asExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<IsExpression> EnterIsExpression, LeaveIsExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitIsExpression(IsExpression isExpression)\n\t\t{\n\t\t\tVisit(EnterIsExpression, LeaveIsExpression, isExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<DefaultValueExpression> EnterDefaultValueExpression, LeaveDefaultValueExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression)\n\t\t{\n\t\t\tVisit(EnterDefaultValueExpression, LeaveDefaultValueExpression, defaultValueExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<UndocumentedExpression> EnterUndocumentedExpression, LeaveUndocumentedExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression)\n\t\t{\n\t\t\tVisit(EnterUndocumentedExpression, LeaveUndocumentedExpression, undocumentedExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<ArrayInitializerExpression> EnterArrayInitializerExpression, LeaveArrayInitializerExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\tVisit(EnterArrayInitializerExpression, LeaveArrayInitializerExpression, arrayInitializerExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<ArraySpecifier> EnterArraySpecifier, LeaveArraySpecifier;\n\t\t\n\t\tvoid IAstVisitor.VisitArraySpecifier(ArraySpecifier arraySpecifier)\n\t\t{\n\t\t\tVisit(EnterArraySpecifier, LeaveArraySpecifier, arraySpecifier);\n\t\t}\n\t\t\n\t\tpublic event Action<NamedArgumentExpression> EnterNamedArgumentExpression, LeaveNamedArgumentExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)\n\t\t{\n\t\t\tVisit(EnterNamedArgumentExpression, LeaveNamedArgumentExpression, namedArgumentExpression);\n\t\t}\n\t\t\n\t\tpublic event Action<NamedExpression> EnterNamedExpression, LeaveNamedExpression;\n\t\t\n\t\tvoid IAstVisitor.VisitNamedExpression(NamedExpression namedExpression)\n\t\t{\n\t\t\tVisit(EnterNamedExpression, LeaveNamedExpression, namedExpression);\n\t\t}\n\t\t\n\t\tvoid IAstVisitor.VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs",
    "content": "﻿// \n// FullTypeName.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class PrimitiveType : AstType\n\t{\n\t\tTextLocation location;\n\t\tstring keyword = string.Empty;\n\t\t\n\t\tpublic string Keyword {\n\t\t\tget { return keyword; }\n\t\t\tset { \n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tkeyword = value; \n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic KnownTypeCode KnownTypeCode {\n\t\t\tget { return GetTypeCodeForPrimitiveType(this.Keyword); }\n\t\t}\n\t\t\n\t\tpublic PrimitiveType()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic PrimitiveType(string keyword)\n\t\t{\n\t\t\tthis.Keyword = keyword;\n\t\t}\n\t\t\n\t\tpublic PrimitiveType(string keyword, TextLocation location)\n\t\t{\n\t\t\tthis.Keyword = keyword;\n\t\t\tthis.location = location;\n\t\t}\n\t\t\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal void SetStartLocation(TextLocation value)\n\t\t{\n\t\t\tThrowIfFrozen();\n\t\t\tthis.location = value;\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (location.Line, location.Column + keyword.Length);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitPrimitiveType (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitPrimitiveType (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitPrimitiveType (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tPrimitiveType o = other as PrimitiveType;\n\t\t\treturn o != null && MatchString(this.Keyword, o.Keyword);\n\t\t}\n\n\t\tpublic override string ToString(CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\treturn Keyword;\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null)\n\t\t{\n\t\t\tKnownTypeCode typeCode = GetTypeCodeForPrimitiveType(this.Keyword);\n\t\t\tif (typeCode == KnownTypeCode.None)\n\t\t\t\treturn new UnknownType(null, this.Keyword);\n\t\t\telse\n\t\t\t\treturn KnownTypeReference.Get(typeCode);\n\t\t}\n\t\t\n\t\tpublic static KnownTypeCode GetTypeCodeForPrimitiveType(string keyword)\n\t\t{\n\t\t\tswitch (keyword) {\n\t\t\t\tcase \"string\":\n\t\t\t\t\treturn KnownTypeCode.String;\n\t\t\t\tcase \"int\":\n\t\t\t\t\treturn KnownTypeCode.Int32;\n\t\t\t\tcase \"uint\":\n\t\t\t\t\treturn KnownTypeCode.UInt32;\n\t\t\t\tcase \"object\":\n\t\t\t\t\treturn KnownTypeCode.Object;\n\t\t\t\tcase \"bool\":\n\t\t\t\t\treturn KnownTypeCode.Boolean;\n\t\t\t\tcase \"sbyte\":\n\t\t\t\t\treturn KnownTypeCode.SByte;\n\t\t\t\tcase \"byte\":\n\t\t\t\t\treturn KnownTypeCode.Byte;\n\t\t\t\tcase \"short\":\n\t\t\t\t\treturn KnownTypeCode.Int16;\n\t\t\t\tcase \"ushort\":\n\t\t\t\t\treturn KnownTypeCode.UInt16;\n\t\t\t\tcase \"long\":\n\t\t\t\t\treturn KnownTypeCode.Int64;\n\t\t\t\tcase \"ulong\":\n\t\t\t\t\treturn KnownTypeCode.UInt64;\n\t\t\t\tcase \"float\":\n\t\t\t\t\treturn KnownTypeCode.Single;\n\t\t\t\tcase \"double\":\n\t\t\t\t\treturn KnownTypeCode.Double;\n\t\t\t\tcase \"decimal\":\n\t\t\t\t\treturn KnownTypeCode.Decimal;\n\t\t\t\tcase \"char\":\n\t\t\t\t\treturn KnownTypeCode.Char;\n\t\t\t\tcase \"void\":\n\t\t\t\t\treturn KnownTypeCode.Void;\n\t\t\t\tdefault:\n\t\t\t\t\treturn KnownTypeCode.None;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Roles.cs",
    "content": "﻿// \n// Roles.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic static class Roles\n\t{\n\t\tpublic static readonly Role<AstNode> Root = AstNode.RootRole;\n\t\t\n\t\t// some pre defined constants for common roles\n\t\tpublic static readonly Role<Identifier> Identifier = new Role<Identifier> (\"Identifier\", CSharp.Identifier.Null);\n\t\tpublic static readonly Role<BlockStatement> Body = new Role<BlockStatement> (\"Body\", CSharp.BlockStatement.Null);\n\t\tpublic static readonly Role<ParameterDeclaration> Parameter = new Role<ParameterDeclaration> (\"Parameter\");\n\t\tpublic static readonly Role<Expression> Argument = new Role<Expression> (\"Argument\", CSharp.Expression.Null);\n\t\tpublic static readonly Role<AstType> Type = new Role<AstType> (\"Type\", CSharp.AstType.Null);\n\t\tpublic static readonly Role<Expression> Expression = new Role<Expression> (\"Expression\", CSharp.Expression.Null);\n\t\tpublic static readonly Role<Expression> TargetExpression = new Role<Expression> (\"Target\", CSharp.Expression.Null);\n\t\tpublic readonly static Role<Expression> Condition = new Role<Expression> (\"Condition\", CSharp.Expression.Null);\n\t\tpublic static readonly Role<TypeParameterDeclaration> TypeParameter = new Role<TypeParameterDeclaration> (\"TypeParameter\");\n\t\tpublic static readonly Role<AstType> TypeArgument = new Role<AstType> (\"TypeArgument\", CSharp.AstType.Null);\n\t\tpublic readonly static Role<Constraint> Constraint = new Role<Constraint> (\"Constraint\");\n\t\tpublic static readonly Role<VariableInitializer> Variable = new Role<VariableInitializer> (\"Variable\", VariableInitializer.Null);\n\t\tpublic static readonly Role<Statement> EmbeddedStatement = new Role<Statement> (\"EmbeddedStatement\", CSharp.Statement.Null);\n\t\tpublic readonly static Role<EntityDeclaration> TypeMemberRole = new Role<EntityDeclaration> (\"TypeMember\");\n\t\t\n\n\t\t//\t\t\tpublic static readonly TokenRole Keyword = new TokenRole (\"Keyword\", CSharpTokenNode.Null);\n//\t\t\tpublic static readonly TokenRole InKeyword = new TokenRole (\"InKeyword\", CSharpTokenNode.Null);\n\t\t\t\n\t\t// some pre defined constants for most used punctuation\n\t\tpublic static readonly TokenRole LPar = new TokenRole (\"(\");\n\t\tpublic static readonly TokenRole RPar = new TokenRole (\")\");\n\t\tpublic static readonly TokenRole LBracket = new TokenRole (\"[\");\n\t\tpublic static readonly TokenRole RBracket = new TokenRole (\"]\");\n\t\tpublic static readonly TokenRole LBrace = new TokenRole (\"{\");\n\t\tpublic static readonly TokenRole RBrace = new TokenRole (\"}\");\n\t\tpublic static readonly TokenRole LChevron = new TokenRole (\"<\");\n\t\tpublic static readonly TokenRole RChevron = new TokenRole (\">\");\n\t\tpublic static readonly TokenRole Comma = new TokenRole (\",\");\n\t\tpublic static readonly TokenRole Dot = new TokenRole (\".\");\n\t\tpublic static readonly TokenRole Semicolon = new TokenRole (\";\");\n\t\tpublic static readonly TokenRole Assign = new TokenRole (\"=\");\n\t\tpublic static readonly TokenRole Colon = new TokenRole (\":\");\n\t\tpublic static readonly TokenRole DoubleColon = new TokenRole (\"::\");\n\t\tpublic static readonly Role<Comment> Comment = new Role<Comment> (\"Comment\");\n\t\tpublic static readonly Role<NewLineNode> NewLine = new Role<NewLineNode> (\"NewLine\");\n\t\tpublic static readonly Role<WhitespaceNode> Whitespace = new Role<WhitespaceNode> (\"Whitespace\");\n\t\tpublic static readonly Role<TextNode> Text = new Role<TextNode> (\"Text\");\n\t\tpublic static readonly Role<PreProcessorDirective> PreProcessorDirective = new Role<PreProcessorDirective> (\"PreProcessorDirective\");\n\t\tpublic static readonly Role<ErrorNode> Error = new Role<ErrorNode> (\"Error\");\n\t\t\t\n\t\tpublic readonly static Role<AstType> BaseType = new Role<AstType> (\"BaseType\", AstType.Null);\n\n\t\tpublic static readonly Role<Attribute> Attribute = new Role<Attribute> (\"Attribute\");\n\t\tpublic static readonly Role<CSharpTokenNode> AttributeTargetRole = new Role<CSharpTokenNode> (\"AttributeTarget\", CSharpTokenNode.Null);\n\n\t\tpublic readonly static TokenRole WhereKeyword = new TokenRole (\"where\");\n\t\tpublic readonly static Role<SimpleType> ConstraintTypeParameter = new Role<SimpleType> (\"TypeParameter\", SimpleType.Null);\n\t\tpublic readonly static TokenRole DelegateKeyword = new TokenRole (\"delegate\");\n\t\tpublic static readonly TokenRole ExternKeyword = new TokenRole (\"extern\");\n\t\tpublic static readonly TokenRole AliasKeyword = new TokenRole (\"alias\");\n\t\tpublic static readonly TokenRole NamespaceKeyword = new TokenRole (\"namespace\");\n\n\t\tpublic static readonly TokenRole EnumKeyword = new TokenRole (\"enum\");\n\t\tpublic static readonly TokenRole InterfaceKeyword = new TokenRole (\"interface\");\n\t\tpublic static readonly TokenRole StructKeyword = new TokenRole (\"struct\");\n\t\tpublic static readonly TokenRole ClassKeyword = new TokenRole (\"class\");\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs",
    "content": "﻿// \n// FullTypeName.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class SimpleType : AstType\n\t{\n\t\t#region Null\n\t\tpublic new static readonly SimpleType Null = new NullSimpleType ();\n\t\t\n\t\tsealed class NullSimpleType : SimpleType\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider)\n\t\t\t{\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic SimpleType()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic SimpleType(string identifier)\n\t\t{\n\t\t\tthis.Identifier = identifier;\n\t\t}\n\t\t\n\t\tpublic SimpleType (Identifier identifier)\n\t\t{\n\t\t\tthis.IdentifierToken = identifier;\n\t\t}\n\t\t\n\t\tpublic SimpleType(string identifier, TextLocation location)\n\t\t{\n\t\t\tSetChildByRole (Roles.Identifier, CSharp.Identifier.Create (identifier, location));\n\t\t}\n\t\t\n\t\tpublic SimpleType (string identifier, IEnumerable<AstType> typeArguments)\n\t\t{\n\t\t\tthis.Identifier = identifier;\n\t\t\tforeach (var arg in typeArguments) {\n\t\t\t\tAddChild (arg, Roles.TypeArgument);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic SimpleType (string identifier, params AstType[] typeArguments) : this (identifier, (IEnumerable<AstType>)typeArguments)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, CSharp.Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier IdentifierToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstType> TypeArguments {\n\t\t\tget { return GetChildrenByRole (Roles.TypeArgument); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitSimpleType (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitSimpleType (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitSimpleType (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tSimpleType o = other as SimpleType;\n\t\t\treturn o != null && MatchString(this.Identifier, o.Identifier) && this.TypeArguments.DoMatch(o.TypeArguments, match);\n\t\t}\n\t\t\n\t\tpublic override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null)\n\t\t{\n\t\t\tif (interningProvider == null)\n\t\t\t\tinterningProvider = InterningProvider.Dummy;\n\t\t\tvar typeArguments = new List<ITypeReference>();\n\t\t\tforeach (var ta in this.TypeArguments) {\n\t\t\t\ttypeArguments.Add(ta.ToTypeReference(lookupMode, interningProvider));\n\t\t\t}\n\t\t\tstring identifier = interningProvider.Intern(this.Identifier);\n\t\t\tif (typeArguments.Count == 0 && string.IsNullOrEmpty(identifier)) {\n\t\t\t\t// empty SimpleType is used for typeof(List<>).\n\t\t\t\treturn SpecialType.UnboundTypeArgument;\n\t\t\t}\n\t\t\tvar t = new SimpleTypeOrNamespaceReference(identifier, interningProvider.InternList(typeArguments), lookupMode);\n\t\t\treturn interningProvider.Intern(t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BlockStatement.cs",
    "content": "﻿// \n// BlockStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// { Statements }\n\t/// </summary>\n\tpublic class BlockStatement : Statement, IEnumerable<Statement>\n\t{\n\t\tpublic static readonly Role<Statement> StatementRole = new Role<Statement>(\"Statement\", Statement.Null);\n\t\t\n\t\t#region Null\n\t\tpublic static readonly new BlockStatement Null = new NullBlockStatement ();\n\t\tsealed class NullBlockStatement : BlockStatement\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator BlockStatement(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : BlockStatement, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole (Roles.LBrace); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Statement> Statements {\n\t\t\tget { return GetChildrenByRole (StatementRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole (Roles.RBrace); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitBlockStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitBlockStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitBlockStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tBlockStatement o = other as BlockStatement;\n\t\t\treturn o != null && !o.IsNull && this.Statements.DoMatch(o.Statements, match);\n\t\t}\n\t\t\n\t\tpublic void Add(Statement statement)\n\t\t{\n\t\t\tAddChild(statement, StatementRole);\n\t\t}\n\t\t\n\t\tIEnumerator<Statement> IEnumerable<Statement>.GetEnumerator()\n\t\t{\n\t\t\treturn this.Statements.GetEnumerator();\n\t\t}\n\t\t\n\t\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn this.Statements.GetEnumerator();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BreakStatement.cs",
    "content": "﻿// \n// BreakStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// break;\n\t/// </summary>\n\tpublic class BreakStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole BreakKeywordRole = new TokenRole (\"break\");\n\t\t\n\t\tpublic CSharpTokenNode BreakToken {\n\t\t\tget { return GetChildByRole (BreakKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitBreakStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitBreakStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitBreakStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tBreakStatement o = other as BreakStatement;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/CheckedStatement.cs",
    "content": "﻿// \n// CheckedStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// checked BodyBlock\n\t/// </summary>\n\tpublic class CheckedStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole CheckedKeywordRole = new TokenRole (\"checked\");\n\t\t\n\t\tpublic CSharpTokenNode CheckedToken {\n\t\t\tget { return GetChildByRole (CheckedKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic CheckedStatement ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic CheckedStatement (BlockStatement body)\n\t\t{\n\t\t\tAddChild (body, Roles.Body);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitCheckedStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitCheckedStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitCheckedStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCheckedStatement o = other as CheckedStatement;\n\t\t\treturn o != null && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ContinueStatement.cs",
    "content": "﻿// \n// ContinueStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// continue;\n\t/// </summary>\n\tpublic class ContinueStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole ContinueKeywordRole = new TokenRole (\"continue\");\n\t\t\n\t\tpublic CSharpTokenNode ContinueToken {\n\t\t\tget { return GetChildByRole (ContinueKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitContinueStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitContinueStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitContinueStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tContinueStatement o = other as ContinueStatement;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/DoWhileStatement.cs",
    "content": "﻿// \n// DoWhileStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.using System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// \"do EmbeddedStatement while(Condition);\"\n\t/// </summary>\n\tpublic class DoWhileStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole DoKeywordRole = new TokenRole (\"do\");\n\t\tpublic static readonly TokenRole WhileKeywordRole = new TokenRole (\"while\");\n\t\t\n\t\tpublic CSharpTokenNode DoToken {\n\t\t\tget { return GetChildByRole (DoKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Statement EmbeddedStatement {\n\t\t\tget { return GetChildByRole (Roles.EmbeddedStatement); }\n\t\t\tset { SetChildByRole (Roles.EmbeddedStatement, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode WhileToken {\n\t\t\tget { return GetChildByRole (WhileKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Condition {\n\t\t\tget { return GetChildByRole (Roles.Condition); }\n\t\t\tset { SetChildByRole (Roles.Condition, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitDoWhileStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitDoWhileStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitDoWhileStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tDoWhileStatement o = other as DoWhileStatement;\n\t\t\treturn o != null && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match) && this.Condition.DoMatch(o.Condition, match);\n\t\t}\n\n\t\tpublic DoWhileStatement()\n\t\t{\n\t\t}\n\n\t\tpublic DoWhileStatement(Expression condition, Statement embeddedStatement)\n\t\t{\n\t\t\tthis.Condition = condition;\n\t\t\tthis.EmbeddedStatement = embeddedStatement;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/EmptyStatement.cs",
    "content": "﻿// \n// EmptyStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// ;\n\t/// </summary>\n\tpublic class EmptyStatement : Statement\n\t{\n\t\tpublic TextLocation Location {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic override TextLocation StartLocation {\n\t\t\tget {\n\t\t\t\treturn Location;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override TextLocation EndLocation {\n\t\t\tget {\n\t\t\t\treturn new TextLocation (Location.Line, Location.Column + 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitEmptyStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitEmptyStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitEmptyStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tEmptyStatement o = other as EmptyStatement;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ExpressionStatement.cs",
    "content": "﻿// \n// ExpressionStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Expression;\n\t/// </summary>\n\tpublic class ExpressionStatement : Statement\n\t{\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitExpressionStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitExpressionStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitExpressionStatement (this, data);\n\t\t}\n\t\t\n\t\tpublic ExpressionStatement()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ExpressionStatement(Expression expression)\n\t\t{\n\t\t\tthis.Expression = expression;\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tExpressionStatement o = other as ExpressionStatement;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/FixedStatement.cs",
    "content": "﻿// \n// FixedStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// fixed (Type Variables) EmbeddedStatement\n\t/// </summary>\n\tpublic class FixedStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole FixedKeywordRole = new TokenRole (\"fixed\");\n\t\t\n\t\tpublic CSharpTokenNode FixedToken {\n\t\t\tget { return GetChildByRole (FixedKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<VariableInitializer> Variables {\n\t\t\tget { return GetChildrenByRole (Roles.Variable); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Statement EmbeddedStatement {\n\t\t\tget { return GetChildByRole (Roles.EmbeddedStatement); }\n\t\t\tset { SetChildByRole (Roles.EmbeddedStatement, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitFixedStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitFixedStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitFixedStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tFixedStatement o = other as FixedStatement;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match) && this.Variables.DoMatch(o.Variables, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForStatement.cs",
    "content": "﻿// \n// ForStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// for (Initializers; Condition; Iterators) EmbeddedStatement\n\t/// </summary>\n\tpublic class ForStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole ForKeywordRole = new TokenRole (\"for\");\n\t\tpublic readonly static Role<Statement> InitializerRole = new Role<Statement>(\"Initializer\", Statement.Null);\n\t\tpublic readonly static Role<Statement> IteratorRole = new Role<Statement>(\"Iterator\", Statement.Null);\n\t\t\n\t\tpublic CSharpTokenNode ForToken {\n\t\t\tget { return GetChildByRole (ForKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of initializer statements.\n\t\t/// Note: this contains multiple statements for \"for (a = 2, b = 1; a > b; a--)\", but contains\n\t\t/// only a single statement for \"for (int a = 2, b = 1; a > b; a--)\" (a single VariableDeclarationStatement with two variables)\n\t\t/// </summary>\n\t\tpublic AstNodeCollection<Statement> Initializers {\n\t\t\tget { return GetChildrenByRole (InitializerRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Condition {\n\t\t\tget { return GetChildByRole (Roles.Condition); }\n\t\t\tset { SetChildByRole (Roles.Condition, value); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Statement> Iterators {\n\t\t\tget { return GetChildrenByRole (IteratorRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Statement EmbeddedStatement {\n\t\t\tget { return GetChildByRole (Roles.EmbeddedStatement); }\n\t\t\tset { SetChildByRole (Roles.EmbeddedStatement, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitForStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitForStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitForStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tForStatement o = other as ForStatement;\n\t\t\treturn o != null && this.Initializers.DoMatch(o.Initializers, match) && this.Condition.DoMatch(o.Condition, match)\n\t\t\t\t&& this.Iterators.DoMatch(o.Iterators, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForeachStatement.cs",
    "content": "﻿// \n// ForeachStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// foreach (Type VariableName in InExpression) EmbeddedStatement\n\t/// </summary>\n\tpublic class ForeachStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole ForeachKeywordRole = new TokenRole (\"foreach\");\n\t\tpublic static readonly TokenRole InKeywordRole = new TokenRole (\"in\");\n\t\t\n\t\tpublic CSharpTokenNode ForeachToken {\n\t\t\tget { return GetChildByRole (ForeachKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstType VariableType {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic string VariableName {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier VariableNameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode InToken {\n\t\t\tget { return GetChildByRole (InKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression InExpression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Statement EmbeddedStatement {\n\t\t\tget { return GetChildByRole (Roles.EmbeddedStatement); }\n\t\t\tset { SetChildByRole (Roles.EmbeddedStatement, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitForeachStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitForeachStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitForeachStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tForeachStatement o = other as ForeachStatement;\n\t\t\treturn o != null && this.VariableType.DoMatch(o.VariableType, match) && MatchString(this.VariableName, o.VariableName)\n\t\t\t\t&& this.InExpression.DoMatch(o.InExpression, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/GotoStatement.cs",
    "content": "﻿// \n// GotoStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// \"goto Label;\"\n\t/// </summary>\n\tpublic class GotoStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole GotoKeywordRole = new TokenRole (\"goto\");\n\t\t\n\t\tpublic GotoStatement ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic GotoStatement (string label)\n\t\t{\n\t\t\tthis.Label = label;\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode GotoToken {\n\t\t\tget { return GetChildByRole (GotoKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic string Label {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (string.IsNullOrEmpty(value))\n\t\t\t\t\tSetChildByRole(Roles.Identifier, null);\n\t\t\t\telse\n\t\t\t\t\tSetChildByRole(Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitGotoStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitGotoStatement (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitGotoStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tGotoStatement o = other as GotoStatement;\n\t\t\treturn o != null && MatchString(this.Label, o.Label);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// or \"goto case LabelExpression;\"\n\t/// </summary>\n\tpublic class GotoCaseStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole GotoKeywordRole = new TokenRole (\"goto\");\n\t\tpublic static readonly TokenRole CaseKeywordRole = new TokenRole (\"case\");\n\t\t\n\t\tpublic CSharpTokenNode GotoToken {\n\t\t\tget { return GetChildByRole (GotoKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode CaseToken {\n\t\t\tget { return GetChildByRole (CaseKeywordRole); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Used for \"goto case LabelExpression;\"\n\t\t/// </summary>\n\t\tpublic Expression LabelExpression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitGotoCaseStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitGotoCaseStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitGotoCaseStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tGotoCaseStatement o = other as GotoCaseStatement;\n\t\t\treturn o != null && this.LabelExpression.DoMatch(o.LabelExpression, match);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// or \"goto default;\"\n\t/// </summary>\n\tpublic class GotoDefaultStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole GotoKeywordRole = new TokenRole (\"goto\");\n\t\tpublic static readonly TokenRole DefaultKeywordRole = new TokenRole (\"default\");\n\t\t\n\t\tpublic CSharpTokenNode GotoToken {\n\t\t\tget { return GetChildByRole (GotoKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode DefaultToken {\n\t\t\tget { return GetChildByRole (DefaultKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitGotoDefaultStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitGotoDefaultStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitGotoDefaultStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tGotoDefaultStatement o = other as GotoDefaultStatement;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/IfElseStatement.cs",
    "content": "﻿// \n// IfElseStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// if (Condition) TrueStatement else FalseStatement\n\t/// </summary>\n\tpublic class IfElseStatement : Statement\n\t{\n\t\tpublic readonly static TokenRole IfKeywordRole = new TokenRole (\"if\");\n\t\tpublic readonly static Role<Expression> ConditionRole = Roles.Condition;\n\t\tpublic readonly static Role<Statement> TrueRole = new Role<Statement>(\"True\", Statement.Null);\n\t\tpublic readonly static TokenRole ElseKeywordRole = new TokenRole (\"else\");\n\t\tpublic readonly static Role<Statement> FalseRole = new Role<Statement>(\"False\", Statement.Null);\n\t\t\n\t\tpublic CSharpTokenNode IfToken {\n\t\t\tget { return GetChildByRole (IfKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Condition {\n\t\t\tget { return GetChildByRole (ConditionRole); }\n\t\t\tset { SetChildByRole (ConditionRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Statement TrueStatement {\n\t\t\tget { return GetChildByRole (TrueRole); }\n\t\t\tset { SetChildByRole (TrueRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode ElseToken {\n\t\t\tget { return GetChildByRole (ElseKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Statement FalseStatement {\n\t\t\tget { return GetChildByRole (FalseRole); }\n\t\t\tset { SetChildByRole (FalseRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitIfElseStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitIfElseStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitIfElseStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tIfElseStatement o = other as IfElseStatement;\n\t\t\treturn o != null && this.Condition.DoMatch(o.Condition, match) && this.TrueStatement.DoMatch(o.TrueStatement, match) && this.FalseStatement.DoMatch(o.FalseStatement, match);\n\t\t}\n\t\t\n\t\tpublic IfElseStatement()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic IfElseStatement(Expression condition, Statement trueStatement, Statement falseStatement = null)\n\t\t{\n\t\t\tthis.Condition = condition;\n\t\t\tthis.TrueStatement = trueStatement;\n\t\t\tthis.FalseStatement = falseStatement;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LabelStatement.cs",
    "content": "﻿// \n// LabelStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Label:\n\t/// </summary>\n\tpublic class LabelStatement : Statement\n\t{\n\t\tpublic string Label {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier LabelToken {\n\t\t\tget { return GetChildByRole (Roles.Identifier); }\n\t\t\tset { SetChildByRole (Roles.Identifier, value); }\n\t\t}\n\n\t\tpublic CSharpTokenNode ColonToken {\n\t\t\tget { return GetChildByRole (Roles.Colon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitLabelStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitLabelStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitLabelStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tLabelStatement o = other as LabelStatement;\n\t\t\treturn o != null && MatchString(this.Label, o.Label);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LockStatement.cs",
    "content": "﻿// \n// LockStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// lock (Expression) EmbeddedStatement;\n\t/// </summary>\n\tpublic class LockStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole LockKeywordRole = new TokenRole (\"lock\");\n\t\t\n\t\tpublic CSharpTokenNode LockToken {\n\t\t\tget { return GetChildByRole (LockKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Statement EmbeddedStatement {\n\t\t\tget { return GetChildByRole (Roles.EmbeddedStatement); }\n\t\t\tset { SetChildByRole (Roles.EmbeddedStatement, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitLockStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitLockStatement (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitLockStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tLockStatement o = other as LockStatement;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ReturnStatement.cs",
    "content": "﻿// \n// ReturnStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// return Expression;\n\t/// </summary>\n\tpublic class ReturnStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole ReturnKeywordRole = new TokenRole (\"return\");\n\n\t\tpublic CSharpTokenNode ReturnToken {\n\t\t\tget { return GetChildByRole (ReturnKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic ReturnStatement ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ReturnStatement (Expression returnExpression)\n\t\t{\n\t\t\tAddChild (returnExpression, Roles.Expression);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitReturnStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitReturnStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitReturnStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tReturnStatement o = other as ReturnStatement;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/Statement.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Base class for statements.\n\t/// </summary>\n\t/// <remarks>\n\t/// This class is useful even though it doesn't provide any additional functionality:\n\t/// It can be used to communicate more information in APIs, e.g. \"this subnode will always be a statement\"\n\t/// </remarks>\n\tpublic abstract class Statement : AstNode\n\t{\n\t\t#region Null\n\t\tpublic new static readonly Statement Null = new NullStatement ();\n\t\t\n\t\tsealed class NullStatement : Statement\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator Statement(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : Statement, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic new Statement Clone()\n\t\t{\n\t\t\treturn (Statement)base.Clone();\n\t\t}\n\t\t\n\t\tpublic Statement ReplaceWith(Func<Statement, Statement> replaceFunction)\n\t\t{\n\t\t\tif (replaceFunction == null)\n\t\t\t\tthrow new ArgumentNullException(\"replaceFunction\");\n\t\t\treturn (Statement)base.ReplaceWith(node => replaceFunction((Statement)node));\n\t\t}\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.Statement; }\n\t\t}\n\n\t\tpublic static implicit operator Statement (Expression type)\n\t\t{\n\t\t\treturn new ExpressionStatement(type);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/SwitchStatement.cs",
    "content": "﻿// \n// SwitchStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// switch (Expression) { SwitchSections }\n\t/// </summary>\n\tpublic class SwitchStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole SwitchKeywordRole = new TokenRole (\"switch\");\n\t\tpublic static readonly Role<SwitchSection> SwitchSectionRole = new Role<SwitchSection>(\"SwitchSection\");\n\t\t\n\t\tpublic CSharpTokenNode SwitchToken {\n\t\t\tget { return GetChildByRole (SwitchKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole (Roles.LBrace); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<SwitchSection> SwitchSections {\n\t\t\tget { return GetChildrenByRole (SwitchSectionRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole (Roles.RBrace); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitSwitchStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitSwitchStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitSwitchStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tSwitchStatement o = other as SwitchStatement;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match) && this.SwitchSections.DoMatch(o.SwitchSections, match);\n\t\t}\n\t}\n\t\n\tpublic class SwitchSection : AstNode\n\t{\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator SwitchSection(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : SwitchSection, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic static readonly Role<CaseLabel> CaseLabelRole = new Role<CaseLabel>(\"CaseLabel\");\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<CaseLabel> CaseLabels {\n\t\t\tget { return GetChildrenByRole (CaseLabelRole); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Statement> Statements {\n\t\t\tget { return GetChildrenByRole (Roles.EmbeddedStatement); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitSwitchSection (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitSwitchSection (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitSwitchSection (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tSwitchSection o = other as SwitchSection;\n\t\t\treturn o != null && this.CaseLabels.DoMatch(o.CaseLabels, match) && this.Statements.DoMatch(o.Statements, match);\n\t\t}\n\t}\n\t\n\tpublic class CaseLabel : AstNode\n\t{\n\t\tpublic static readonly TokenRole CaseKeywordRole = new TokenRole (\"case\");\n\t\tpublic static readonly TokenRole DefaultKeywordRole = new TokenRole (\"default\");\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets or sets the expression. The expression can be null - if the expression is null, it's the default switch section.\n\t\t/// </summary>\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\n\t\tpublic CSharpTokenNode ColonToken {\n\t\t\tget { return GetChildByRole (Roles.Colon); }\n\t\t}\n\n\t\tpublic CaseLabel ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic CaseLabel (Expression expression)\n\t\t{\n\t\t\tthis.Expression = expression;\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitCaseLabel (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitCaseLabel (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitCaseLabel (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCaseLabel o = other as CaseLabel;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ThrowStatement.cs",
    "content": "﻿// \n// ThrowStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// throw Expression;\n\t/// </summary>\n\tpublic class ThrowStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole ThrowKeywordRole = new TokenRole (\"throw\");\n\t\t\n\t\tpublic CSharpTokenNode ThrowToken {\n\t\t\tget { return GetChildByRole (ThrowKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic ThrowStatement ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ThrowStatement (Expression expression)\n\t\t{\n\t\t\tAddChild (expression, Roles.Expression);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitThrowStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitThrowStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitThrowStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tThrowStatement o = other as ThrowStatement;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs",
    "content": "﻿// \n// TryCatchStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// try TryBlock CatchClauses finally FinallyBlock\n\t/// </summary>\n\tpublic class TryCatchStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole TryKeywordRole = new TokenRole (\"try\");\n\t\tpublic static readonly Role<BlockStatement> TryBlockRole = new Role<BlockStatement>(\"TryBlock\", BlockStatement.Null);\n\t\tpublic static readonly Role<CatchClause> CatchClauseRole = new Role<CatchClause>(\"CatchClause\", CatchClause.Null);\n\t\tpublic static readonly TokenRole FinallyKeywordRole = new TokenRole (\"finally\");\n\t\tpublic static readonly Role<BlockStatement> FinallyBlockRole = new Role<BlockStatement>(\"FinallyBlock\", BlockStatement.Null);\n\t\t\n\t\tpublic CSharpTokenNode TryToken {\n\t\t\tget { return GetChildByRole (TryKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement TryBlock {\n\t\t\tget { return GetChildByRole (TryBlockRole); }\n\t\t\tset { SetChildByRole (TryBlockRole, value); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<CatchClause> CatchClauses {\n\t\t\tget { return GetChildrenByRole (CatchClauseRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode FinallyToken {\n\t\t\tget { return GetChildByRole (FinallyKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement FinallyBlock {\n\t\t\tget { return GetChildByRole (FinallyBlockRole); }\n\t\t\tset { SetChildByRole (FinallyBlockRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitTryCatchStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitTryCatchStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitTryCatchStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tTryCatchStatement o = other as TryCatchStatement;\n\t\t\treturn o != null && this.TryBlock.DoMatch(o.TryBlock, match) && this.CatchClauses.DoMatch(o.CatchClauses, match) && this.FinallyBlock.DoMatch(o.FinallyBlock, match);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// catch (Type VariableName) { Body }\n\t/// </summary>\n\tpublic class CatchClause : AstNode\n\t{\n\t\tpublic static readonly TokenRole CatchKeywordRole = new TokenRole (\"catch\");\n\n\t\t#region Null\n\t\tpublic new static readonly CatchClause Null = new NullCatchClause ();\n\t\t\n\t\tsealed class NullCatchClause : CatchClause\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator CatchClause(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : CatchClause, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\t\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child);\n\t\t\t}\n\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode CatchToken {\n\t\t\tget { return GetChildByRole (CatchKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic string VariableName {\n\t\t\tget { return GetChildByRole (Roles.Identifier).Name; }\n\t\t\tset {\n\t\t\t\tif (string.IsNullOrEmpty(value))\n\t\t\t\t\tSetChildByRole (Roles.Identifier, null);\n\t\t\t\telse\n\t\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier VariableNameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole(Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitCatchClause (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitCatchClause (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitCatchClause (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCatchClause o = other as CatchClause;\n\t\t\treturn o != null && this.Type.DoMatch(o.Type, match) && MatchString(this.VariableName, o.VariableName) && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UncheckedStatement.cs",
    "content": "﻿// \n// UncheckedStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// unchecked BodyBlock\n\t/// </summary>\n\tpublic class UncheckedStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole UncheckedKeywordRole = new TokenRole (\"unchecked\");\n\t\t\n\t\tpublic CSharpTokenNode UncheckedToken {\n\t\t\tget { return GetChildByRole (UncheckedKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic UncheckedStatement ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic UncheckedStatement (BlockStatement body)\n\t\t{\n\t\t\tAddChild (body, Roles.Body);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUncheckedStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUncheckedStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUncheckedStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUncheckedStatement o = other as UncheckedStatement;\n\t\t\treturn o != null && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UnsafeStatement.cs",
    "content": "﻿// \n// UnsafeStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// unsafe { Body }\n\t/// </summary>\n\tpublic class UnsafeStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole UnsafeKeywordRole = new TokenRole (\"unsafe\");\n\t\t\n\t\tpublic CSharpTokenNode UnsafeToken {\n\t\t\tget { return GetChildByRole (UnsafeKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUnsafeStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUnsafeStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUnsafeStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUnsafeStatement o = other as UnsafeStatement;\n\t\t\treturn o != null && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UsingStatement.cs",
    "content": "﻿// \n// UsingStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// using (ResourceAcquisition) EmbeddedStatement\n\t/// </summary>\n\tpublic class UsingStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole UsingKeywordRole = new TokenRole (\"using\");\n\t\tpublic static readonly Role<AstNode> ResourceAcquisitionRole = new Role<AstNode>(\"ResourceAcquisition\", AstNode.Null);\n\t\t\n\t\tpublic CSharpTokenNode UsingToken {\n\t\t\tget { return GetChildByRole (UsingKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Either a VariableDeclarationStatement, or an Expression.\n\t\t/// </summary>\n\t\tpublic AstNode ResourceAcquisition {\n\t\t\tget { return GetChildByRole (ResourceAcquisitionRole); }\n\t\t\tset { SetChildByRole (ResourceAcquisitionRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Statement EmbeddedStatement {\n\t\t\tget { return GetChildByRole (Roles.EmbeddedStatement); }\n\t\t\tset { SetChildByRole (Roles.EmbeddedStatement, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitUsingStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitUsingStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitUsingStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tUsingStatement o = other as UsingStatement;\n\t\t\treturn o != null && this.ResourceAcquisition.DoMatch(o.ResourceAcquisition, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/VariableDeclarationStatement.cs",
    "content": "﻿// \n// VariableDeclarationStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class VariableDeclarationStatement : Statement\n\t{\n\t\tpublic static readonly Role<CSharpModifierToken> ModifierRole = EntityDeclaration.ModifierRole;\n\t\t\n\t\tpublic VariableDeclarationStatement()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic VariableDeclarationStatement(AstType type, string name, Expression initializer = null)\n\t\t{\n\t\t\tthis.Type = type;\n\t\t\tthis.Variables.Add(new VariableInitializer(name, initializer));\n\t\t}\n\t\t\n\t\tpublic Modifiers Modifiers {\n\t\t\tget { return EntityDeclaration.GetModifiers(this); }\n\t\t\tset { EntityDeclaration.SetModifiers(this, value); }\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<VariableInitializer> Variables {\n\t\t\tget { return GetChildrenByRole (Roles.Variable); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic VariableInitializer GetVariable (string name)\n\t\t{\n\t\t\treturn Variables.FirstOrNullObject (vi => vi.Name == name);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitVariableDeclarationStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitVariableDeclarationStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitVariableDeclarationStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tVariableDeclarationStatement o = other as VariableDeclarationStatement;\n\t\t\treturn o != null && this.Modifiers == o.Modifiers && this.Type.DoMatch(o.Type, match) && this.Variables.DoMatch(o.Variables, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/WhileStatement.cs",
    "content": "﻿// \n// WhileStatement.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// \"while (Condition) EmbeddedStatement\"\n\t/// </summary>\n\tpublic class WhileStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole WhileKeywordRole = new TokenRole (\"while\");\n\t\t\n\t\tpublic CSharpTokenNode WhileToken {\n\t\t\tget { return GetChildByRole (WhileKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic Expression Condition {\n\t\t\tget { return GetChildByRole (Roles.Condition); }\n\t\t\tset { SetChildByRole (Roles.Condition, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic Statement EmbeddedStatement {\n\t\t\tget { return GetChildByRole (Roles.EmbeddedStatement); }\n\t\t\tset { SetChildByRole (Roles.EmbeddedStatement, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitWhileStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitWhileStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitWhileStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tWhileStatement o = other as WhileStatement;\n\t\t\treturn o != null && this.Condition.DoMatch(o.Condition, match) && this.EmbeddedStatement.DoMatch(o.EmbeddedStatement, match);\n\t\t}\n\n\t\tpublic WhileStatement()\n\t\t{\n\t\t}\n\n\t\tpublic WhileStatement(Expression condition, Statement embeddedStatement)\n\t\t{\n\t\t\tthis.Condition = condition;\n\t\t\tthis.EmbeddedStatement = embeddedStatement;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldBreakStatement.cs",
    "content": "﻿// \n// YieldBreakStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// yield break;\n\t/// </summary>\n\tpublic class YieldBreakStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole YieldKeywordRole = new TokenRole (\"yield\");\n\t\tpublic static readonly TokenRole BreakKeywordRole = new TokenRole (\"break\");\n\t\t\n\t\tpublic CSharpTokenNode YieldToken {\n\t\t\tget { return GetChildByRole (YieldKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode BreakToken {\n\t\t\tget { return GetChildByRole (BreakKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitYieldBreakStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitYieldBreakStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitYieldBreakStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tYieldBreakStatement o = other as YieldBreakStatement;\n\t\t\treturn o != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldReturnStatement.cs",
    "content": "﻿// \n// YieldStatement.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// yield return Expression;\n\t/// </summary>\n\tpublic class YieldReturnStatement : Statement\n\t{\n\t\tpublic static readonly TokenRole YieldKeywordRole = new TokenRole (\"yield\");\n\t\tpublic static readonly TokenRole ReturnKeywordRole = new TokenRole (\"return\");\n\t\t\n\t\tpublic CSharpTokenNode YieldToken {\n\t\t\tget { return GetChildByRole (YieldKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode ReturnToken {\n\t\t\tget { return GetChildByRole (ReturnKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitYieldReturnStatement (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitYieldReturnStatement (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitYieldReturnStatement (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tYieldReturnStatement o = other as YieldReturnStatement;\n\t\t\treturn o != null && this.Expression.DoMatch(o.Expression, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SyntaxExtensions.cs",
    "content": "﻿// Copyright (c) 2013 Daniel Grunwald\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Extension methods for the syntax tree.\n\t/// </summary>\n\tpublic static class SyntaxExtensions\n\t{\n\t\tpublic static bool IsComparisonOperator(this OperatorType operatorType)\n\t\t{\n\t\t\tswitch (operatorType) {\n\t\t\t\tcase OperatorType.Equality:\n\t\t\t\tcase OperatorType.Inequality:\n\t\t\t\tcase OperatorType.GreaterThan:\n\t\t\t\tcase OperatorType.LessThan:\n\t\t\t\tcase OperatorType.GreaterThanOrEqual:\n\t\t\t\tcase OperatorType.LessThanOrEqual:\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SyntaxTree.cs",
    "content": "﻿// \n// SyntaxTree.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing Mono.CSharp;\nusing System.IO;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[Obsolete(\"CompilationUnit was renamed to SyntaxTree\", true)]\n\tpublic class CompilationUnit {}\n\t\n\tpublic class SyntaxTree : AstNode\n\t{\n\t\tpublic static readonly Role<AstNode> MemberRole = new Role<AstNode>(\"Member\", AstNode.Null);\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstring fileName;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the file name of this syntax tree.\n\t\t/// </summary>\n\t\tpublic string FileName {\n\t\t\tget { return fileName; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tfileName = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AstNode> Members {\n\t\t\tget { return GetChildrenByRole(MemberRole); }\n\t\t}\n\n\t\tIList<string> conditionalSymbols = null;\n\n\t\tList<Error> errors = new List<Error> ();\n\t\t\n\t\tpublic List<Error> Errors {\n\t\t\tget { return errors; }\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Gets the conditional symbols used to parse the source file. Note that this list contains\n\t\t/// the conditional symbols at the start of the first token in the file - including the ones defined\n\t\t/// in the source file.\n\t\t/// </summary>\n\t\tpublic IList<string> ConditionalSymbols {\n\t\t\tget {\n\t\t\t\treturn conditionalSymbols ?? EmptyList<string>.Instance;\n\t\t\t}\n\t\t\tinternal set {\n\t\t\t\tconditionalSymbols = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the expression that was on top of the parse stack.\n\t\t/// This is the only way to get an expression that isn't part of a statment.\n\t\t/// (eg. when an error follows an expression).\n\t\t/// \n\t\t/// This is used for code completion to 'get the expression before a token - like ., &lt;, ('.\n\t\t/// </summary>\n\t\tpublic AstNode TopExpression {\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\t\t\n\t\tpublic SyntaxTree ()\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all defined types in this syntax tree.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A list containing <see cref=\"TypeDeclaration\"/> or <see cref=\"DelegateDeclaration\"/> nodes.\n\t\t/// </returns>\n\t\tpublic IEnumerable<EntityDeclaration> GetTypes(bool includeInnerTypes = false)\n\t\t{\n\t\t\tStack<AstNode> nodeStack = new Stack<AstNode> ();\n\t\t\tnodeStack.Push(this);\n\t\t\twhile (nodeStack.Count > 0) {\n\t\t\t\tvar curNode = nodeStack.Pop();\n\t\t\t\tif (curNode is TypeDeclaration || curNode is DelegateDeclaration) {\n\t\t\t\t\tyield return (EntityDeclaration)curNode;\n\t\t\t\t}\n\t\t\t\tforeach (var child in curNode.Children) {\n\t\t\t\t\tif (!(child is Statement || child is Expression) &&\n\t\t\t\t\t    (child.Role != Roles.TypeMemberRole || ((child is TypeDeclaration || child is DelegateDeclaration) && includeInnerTypes)))\n\t\t\t\t\t\tnodeStack.Push (child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tSyntaxTree o = other as SyntaxTree;\n\t\t\treturn o != null && this.Members.DoMatch(o.Members, match);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitSyntaxTree (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitSyntaxTree (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitSyntaxTree (this, data);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts this syntax tree into a parsed file that can be stored in the type system.\n\t\t/// </summary>\n\t\tpublic CSharpUnresolvedFile ToTypeSystem ()\n\t\t{\n\t\t\tif (string.IsNullOrEmpty (this.FileName))\n\t\t\t\tthrow new InvalidOperationException (\"Cannot use ToTypeSystem() on a syntax tree without file name.\");\n\t\t\tvar v = new TypeSystemConvertVisitor (this.FileName);\n\t\t\tv.VisitSyntaxTree (this);\n\t\t\treturn v.UnresolvedFile;\n\t\t}\n\t\t\n\t\tpublic static SyntaxTree Parse (string program, string fileName = \"\", CompilerSettings settings = null, CancellationToken cancellationToken = default (CancellationToken))\n\t\t{\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\tvar parser = new CSharpParser (settings);\n\t\t\treturn parser.Parse (program, fileName);\n\t\t}\n\t\t\n\t\tpublic static SyntaxTree Parse (TextReader reader, string fileName = \"\", CompilerSettings settings = null, CancellationToken cancellationToken = default (CancellationToken))\n\t\t{\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\tvar parser = new CSharpParser (settings);\n\t\t\treturn parser.Parse (reader, fileName);\n\t\t}\n\t\t\n\t\tpublic static SyntaxTree Parse (Stream stream, string fileName = \"\", CompilerSettings settings = null, CancellationToken cancellationToken = default (CancellationToken))\n\t\t{\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\tvar parser = new CSharpParser (settings);\n\t\t\treturn parser.Parse (stream, fileName);\n\t\t}\n\t\t\n\t\tpublic static SyntaxTree Parse (ITextSource textSource, string fileName = \"\", CompilerSettings settings = null, CancellationToken cancellationToken = default (CancellationToken))\n\t\t{\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\tvar parser = new CSharpParser (settings);\n\t\t\treturn parser.Parse (textSource, fileName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TokenRole.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// A specific role only used for C# tokens\n\t/// </summary>\n\tpublic sealed class TokenRole : Role<CSharpTokenNode>\n\t{\n\t\tinternal readonly static List<string> Tokens = new List<string> ();\n\t\tinternal readonly static List<int>    TokenLengths = new List<int> ();\n\t\tinternal readonly uint TokenIndex;\n\n\t\tstatic TokenRole ()\n\t\t{\n\t\t\t// null token\n\t\t\tTokens.Add (\"\");\n\t\t\tTokenLengths.Add (0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the token as string. Note that the token Name and Token value may differ.\n\t\t/// </summary>\n\t\tpublic string Token {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the char length of the token.\n\t\t/// </summary>\n\t\tpublic int Length {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\n\t\tpublic TokenRole(string token) : base (token, CSharpTokenNode.Null)\n\t\t{\n\t\t\tthis.Token = token;\n\t\t\tthis.Length = token.Length;\n\n\t\t\tbool found = false;\n\t\t\tfor (int i = 0; i < Tokens.Count; i++) {\n\t\t\t\tvar existingToken = Tokens [i];\n\t\t\t\tif (existingToken == token) {\n\t\t\t\t\tTokenIndex = (uint)i;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\tTokenIndex = (uint)Tokens.Count;\n\t\t\t\tTokens.Add (token);\n\t\t\t\tTokenLengths.Add (this.Length);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/Accessor.cs",
    "content": "﻿// \n// PropertyDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// get/set/add/remove\n\t/// </summary>\n\tpublic class Accessor : EntityDeclaration\n\t{\n\t\tpublic static readonly new Accessor Null = new NullAccessor ();\n\t\tsealed class NullAccessor : Accessor\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.Unknown; }\n\t\t}\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Method; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the 'get'/'set'/'add'/'remove' keyword\n\t\t/// </summary>\n\t\tpublic CSharpTokenNode Keyword {\n\t\t\tget {\n\t\t\t\tfor (AstNode child = this.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\t\tif (child.Role == PropertyDeclaration.GetKeywordRole || child.Role == PropertyDeclaration.SetKeywordRole\n\t\t\t\t\t    || child.Role == CustomEventDeclaration.AddKeywordRole || child.Role == CustomEventDeclaration.RemoveKeywordRole)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn (CSharpTokenNode)child;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn CSharpTokenNode.Null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAccessor (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitAccessor (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitAccessor (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tAccessor o = other as Accessor;\n\t\t\treturn o != null && !o.IsNull && this.MatchAttributesAndModifiers(o, match) && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ConstructorDeclaration.cs",
    "content": "﻿// \n// ConstructorDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class ConstructorDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly Role<ConstructorInitializer> InitializerRole = new Role<ConstructorInitializer>(\"Initializer\", ConstructorInitializer.Null);\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Constructor; }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode ColonToken {\n\t\t\tget { return GetChildByRole (Roles.Colon); }\n\t\t}\n\t\t\n\t\tpublic ConstructorInitializer Initializer {\n\t\t\tget { return GetChildByRole (InitializerRole); }\n\t\t\tset { SetChildByRole( InitializerRole, value); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitConstructorDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitConstructorDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitConstructorDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tConstructorDeclaration o = other as ConstructorDeclaration;\n\t\t\treturn o != null && this.MatchAttributesAndModifiers(o, match) && this.Parameters.DoMatch(o.Parameters, match)\n\t\t\t\t&& this.Initializer.DoMatch(o.Initializer, match) && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n\t\n\tpublic enum ConstructorInitializerType {\n\t\tAny,\n\t\tBase,\n\t\tThis\n\t}\n\t\n\tpublic class ConstructorInitializer : AstNode\n\t{\n\t\tpublic static readonly TokenRole BaseKeywordRole = new TokenRole (\"base\");\n\t\tpublic static readonly TokenRole ThisKeywordRole = new TokenRole (\"this\");\n\t\t\n\t\tpublic static readonly new ConstructorInitializer Null = new NullConstructorInitializer ();\n\t\tclass NullConstructorInitializer : ConstructorInitializer\n\t\t{\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget {\n\t\t\t\t\treturn NodeType.Unknown;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ConstructorInitializerType ConstructorInitializerType {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode Keyword {\n\t\t\tget {\n\t\t\t\tif (ConstructorInitializerType == ConstructorInitializerType.Base)\n\t\t\t\t\treturn GetChildByRole(BaseKeywordRole);\n\t\t\t\telse\n\t\t\t\t\treturn GetChildByRole(ThisKeywordRole);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Expression> Arguments {\n\t\t\tget { return GetChildrenByRole (Roles.Argument); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitConstructorInitializer (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitConstructorInitializer (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitConstructorInitializer (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tConstructorInitializer o = other as ConstructorInitializer;\n\t\t\treturn o != null && !o.IsNull \n\t\t\t\t&& (this.ConstructorInitializerType == ConstructorInitializerType.Any || this.ConstructorInitializerType == o.ConstructorInitializerType)\n\t\t\t\t&& this.Arguments.DoMatch(o.Arguments, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/DestructorDeclaration.cs",
    "content": "﻿// \n// DestructorDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class DestructorDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly TokenRole TildeRole = new TokenRole (\"~\");\n\t\t\n\t\tpublic CSharpTokenNode TildeToken {\n\t\t\tget { return GetChildByRole (TildeRole); }\n\t\t}\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Destructor; }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitDestructorDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitDestructorDeclaration (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitDestructorDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tDestructorDeclaration o = other as DestructorDeclaration;\n\t\t\treturn o != null && this.MatchAttributesAndModifiers(o, match) && this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EntityDeclaration.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic abstract class EntityDeclaration : AstNode\n\t{\n\t\tpublic static readonly Role<AttributeSection> AttributeRole = new Role<AttributeSection>(\"Attribute\");\n\t\tpublic static readonly Role<AttributeSection> UnattachedAttributeRole = new Role<AttributeSection>(\"UnattachedAttribute\");\n\t\tpublic static readonly Role<CSharpModifierToken> ModifierRole = new Role<CSharpModifierToken>(\"Modifier\");\n\t\tpublic static readonly Role<AstType> PrivateImplementationTypeRole = new Role<AstType>(\"PrivateImplementationType\", AstType.Null);\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget { return NodeType.Member; }\n\t\t}\n\t\t\n\t\tpublic abstract NRefactory.TypeSystem.SymbolKind SymbolKind { get; }\n\t\t\n\t\tpublic AstNodeCollection<AttributeSection> Attributes {\n\t\t\tget { return base.GetChildrenByRole (AttributeRole); }\n\t\t}\n\t\t\n\t\tpublic Modifiers Modifiers {\n\t\t\tget { return GetModifiers(this); }\n\t\t\tset { SetModifiers(this, value); }\n\t\t}\n\t\t\n\t\tpublic bool HasModifier (Modifiers mod)\n\t\t{\n\t\t\treturn (Modifiers & mod) == mod;\n\t\t}\n\t\t\n\t\tpublic IEnumerable<CSharpModifierToken> ModifierTokens {\n\t\t\tget { return GetChildrenByRole (ModifierRole); }\n\t\t}\n\t\t\n\t\tpublic virtual string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value, TextLocation.Empty));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual Identifier NameToken {\n\t\t\tget { return GetChildByRole (Roles.Identifier); }\n\t\t\tset { SetChildByRole (Roles.Identifier, value); }\n\t\t}\n\t\t\n\t\tpublic virtual AstType ReturnType {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole(Roles.Type, value); }\n\t\t}\n\n\t\tpublic CSharpTokenNode SemicolonToken {\n\t\t\tget { return GetChildByRole (Roles.Semicolon); }\n\t\t}\n\n\t\tinternal static Modifiers GetModifiers(AstNode node)\n\t\t{\n\t\t\tModifiers m = 0;\n\t\t\tforeach (CSharpModifierToken t in node.GetChildrenByRole (ModifierRole)) {\n\t\t\t\tm |= t.Modifier;\n\t\t\t}\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\tinternal static void SetModifiers(AstNode node, Modifiers newValue)\n\t\t{\n\t\t\tModifiers oldValue = GetModifiers(node);\n\t\t\tAstNode insertionPos = node.GetChildrenByRole(AttributeRole).LastOrDefault();\n\t\t\tforeach (Modifiers m in CSharpModifierToken.AllModifiers) {\n\t\t\t\tif ((m & newValue) != 0) {\n\t\t\t\t\tif ((m & oldValue) == 0) {\n\t\t\t\t\t\t// Modifier was added\n\t\t\t\t\t\tvar newToken = new CSharpModifierToken(TextLocation.Empty, m);\n\t\t\t\t\t\tnode.InsertChildAfter(insertionPos, newToken, ModifierRole);\n\t\t\t\t\t\tinsertionPos = newToken;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Modifier already exists\n\t\t\t\t\t\tinsertionPos = node.GetChildrenByRole(ModifierRole).First(t => t.Modifier == m);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ((m & oldValue) != 0) {\n\t\t\t\t\t\t// Modifier was removed\n\t\t\t\t\t\tnode.GetChildrenByRole (ModifierRole).First(t => t.Modifier == m).Remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected bool MatchAttributesAndModifiers (EntityDeclaration o, PatternMatching.Match match)\n\t\t{\n\t\t\treturn (this.Modifiers == Modifiers.Any || this.Modifiers == o.Modifiers) && this.Attributes.DoMatch (o.Attributes, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EnumMemberDeclaration.cs",
    "content": "﻿// \n// EnumMemberDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class EnumMemberDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly Role<Expression> InitializerRole = new Role<Expression>(\"Initializer\", Expression.Null);\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Field; }\n\t\t}\n\n\t\tpublic CSharpTokenNode AssignToken {\n\t\t\tget { return GetChildByRole (Roles.Assign); }\n\t\t}\n\n\t\tpublic Expression Initializer {\n\t\t\tget { return GetChildByRole (InitializerRole); }\n\t\t\tset { SetChildByRole (InitializerRole, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitEnumMemberDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitEnumMemberDeclaration (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitEnumMemberDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tEnumMemberDeclaration o = other as EnumMemberDeclaration;\n\t\t\treturn o != null && this.MatchAttributesAndModifiers(o, match)\n\t\t\t\t&& MatchString(this.Name, o.Name) && this.Initializer.DoMatch(o.Initializer, match);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs",
    "content": "﻿// \n// EventDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class EventDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly TokenRole EventKeywordRole = new TokenRole (\"event\");\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Event; }\n\t\t}\n\n\t\tpublic CSharpTokenNode EventToken {\n\t\t\tget { return GetChildByRole (EventKeywordRole); }\n\t\t}\n\n\t\tpublic AstNodeCollection<VariableInitializer> Variables {\n\t\t\tget { return GetChildrenByRole (Roles.Variable); }\n\t\t}\n\t\t\n\t\t// Hide .Name and .NameToken from users; the actual field names\n\t\t// are stored in the VariableInitializer.\n\t\t[EditorBrowsable(EditorBrowsableState.Never)]\n\t\tpublic override string Name {\n\t\t\tget { return string.Empty; }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\t\t\n\t\t[EditorBrowsable(EditorBrowsableState.Never)]\n\t\tpublic override Identifier NameToken {\n\t\t\tget { return Identifier.Null; }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitEventDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitEventDeclaration (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitEventDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tEventDeclaration o = other as EventDeclaration;\n\t\t\treturn o != null && this.MatchAttributesAndModifiers(o, match)\n\t\t\t\t&& this.ReturnType.DoMatch(o.ReturnType, match) && this.Variables.DoMatch(o.Variables, match);\n\t\t}\n\t}\n\t\n\tpublic class CustomEventDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly TokenRole EventKeywordRole = new TokenRole (\"event\");\n\t\tpublic static readonly TokenRole AddKeywordRole = new TokenRole (\"add\");\n\t\tpublic static readonly TokenRole RemoveKeywordRole = new TokenRole (\"remove\");\n\t\t\n\t\tpublic static readonly Role<Accessor> AddAccessorRole = new Role<Accessor>(\"AddAccessor\", Accessor.Null);\n\t\tpublic static readonly Role<Accessor> RemoveAccessorRole = new Role<Accessor>(\"RemoveAccessor\", Accessor.Null);\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Event; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the type reference of the interface that is explicitly implemented.\n\t\t/// Null node if this member is not an explicit interface implementation.\n\t\t/// </summary>\n\t\tpublic AstType PrivateImplementationType {\n\t\t\tget { return GetChildByRole (PrivateImplementationTypeRole); }\n\t\t\tset { SetChildByRole (PrivateImplementationTypeRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole (Roles.LBrace); }\n\t\t}\n\t\t\n\t\tpublic Accessor AddAccessor {\n\t\t\tget { return GetChildByRole (AddAccessorRole); }\n\t\t\tset { SetChildByRole (AddAccessorRole, value); }\n\t\t}\n\t\t\n\t\tpublic Accessor RemoveAccessor {\n\t\t\tget { return GetChildByRole (RemoveAccessorRole); }\n\t\t\tset { SetChildByRole (RemoveAccessorRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole (Roles.RBrace); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitCustomEventDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitCustomEventDeclaration (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitCustomEventDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tCustomEventDeclaration o = other as CustomEventDeclaration;\n\t\t\treturn o != null && MatchString(this.Name, o.Name)\n\t\t\t\t&& this.MatchAttributesAndModifiers(o, match) && this.ReturnType.DoMatch(o.ReturnType, match)\n\t\t\t\t&& this.PrivateImplementationType.DoMatch(o.PrivateImplementationType, match)\n\t\t\t\t&& this.AddAccessor.DoMatch(o.AddAccessor, match) && this.RemoveAccessor.DoMatch(o.RemoveAccessor, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs",
    "content": "﻿// \n// FieldDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.ComponentModel;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class FieldDeclaration : EntityDeclaration\n\t{\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Field; }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<VariableInitializer> Variables {\n\t\t\tget { return GetChildrenByRole (Roles.Variable); }\n\t\t}\n\t\t\n\t\t// Hide .Name and .NameToken from users; the actual field names\n\t\t// are stored in the VariableInitializer.\n\t\t[EditorBrowsable(EditorBrowsableState.Never)]\n\t\tpublic override string Name {\n\t\t\tget { return string.Empty; }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\t\t\n\t\t[EditorBrowsable(EditorBrowsableState.Never)]\n\t\tpublic override Identifier NameToken {\n\t\t\tget { return Identifier.Null; }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitFieldDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitFieldDeclaration (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitFieldDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tFieldDeclaration o = other as FieldDeclaration;\n\t\t\treturn o != null && this.MatchAttributesAndModifiers(o, match)\n\t\t\t\t&& this.ReturnType.DoMatch(o.ReturnType, match) && this.Variables.DoMatch(o.Variables, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedFieldDeclaration.cs",
    "content": "﻿// \n// FixedFieldDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class FixedFieldDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly TokenRole FixedKeywordRole = new TokenRole (\"fixed\");\n\t\tpublic static readonly Role<FixedVariableInitializer> VariableRole = new Role<FixedVariableInitializer> (\"FixedVariable\");\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Field; }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode FixedToken {\n\t\t\tget { return GetChildByRole (FixedKeywordRole); }\n\t\t}\n\n\t\tpublic AstNodeCollection<FixedVariableInitializer> Variables {\n\t\t\tget { return GetChildrenByRole (VariableRole); }\n\t\t}\n\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitFixedFieldDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitFixedFieldDeclaration (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitFixedFieldDeclaration (this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch (AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as FixedFieldDeclaration;\n\t\t\treturn o != null && this.MatchAttributesAndModifiers (o, match)\n\t\t\t\t&& this.ReturnType.DoMatch (o.ReturnType, match) && this.Variables.DoMatch (o.Variables, match);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedVariableInitializer.cs",
    "content": "﻿// \n// FixedFieldDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Name [ CountExpression ]\n\t/// </summary>\n\tpublic class FixedVariableInitializer : AstNode\n\t{\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic FixedVariableInitializer()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic FixedVariableInitializer (string name, Expression initializer = null)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.CountExpression = initializer;\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier NameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBracketToken {\n\t\t\tget { return GetChildByRole (Roles.LBracket); }\n\t\t}\n\n\t\tpublic Expression CountExpression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\n\t\tpublic CSharpTokenNode RBracketToken {\n\t\t\tget { return GetChildByRole (Roles.RBracket); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitFixedVariableInitializer (this);\n\t\t}\n\t\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitFixedVariableInitializer (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitFixedVariableInitializer (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch (AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)\n\t\t{\n\t\t\tvar o = other as FixedVariableInitializer;\n\t\t\treturn o != null && MatchString (this.Name, o.Name) && this.CountExpression.DoMatch (o.CountExpression, match);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs",
    "content": "﻿// \n// IndexerDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.ComponentModel;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class IndexerDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly TokenRole ThisKeywordRole = new TokenRole (\"this\");\n\t\tpublic static readonly Role<Accessor> GetterRole = PropertyDeclaration.GetterRole;\n\t\tpublic static readonly Role<Accessor> SetterRole = PropertyDeclaration.SetterRole;\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Indexer; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the type reference of the interface that is explicitly implemented.\n\t\t/// Null node if this member is not an explicit interface implementation.\n\t\t/// </summary>\n\t\tpublic AstType PrivateImplementationType {\n\t\t\tget { return GetChildByRole (PrivateImplementationTypeRole); }\n\t\t\tset { SetChildByRole (PrivateImplementationTypeRole, value); }\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget { return \"Item\"; }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\t\t\n\t\t[EditorBrowsable(EditorBrowsableState.Never)]\n\t\tpublic override Identifier NameToken {\n\t\t\tget { return Identifier.Null; }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\n\t\tpublic CSharpTokenNode LBracketToken {\n\t\t\tget { return GetChildByRole (Roles.LBracket); }\n\t\t}\n\n\t\tpublic CSharpTokenNode ThisToken {\n\t\t\tget { return GetChildByRole (ThisKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBracketToken {\n\t\t\tget { return GetChildByRole (Roles.RBracket); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole (Roles.LBrace); }\n\t\t}\n\t\t\n\t\tpublic Accessor Getter {\n\t\t\tget { return GetChildByRole(GetterRole); }\n\t\t\tset { SetChildByRole(GetterRole, value); }\n\t\t}\n\t\t\n\t\tpublic Accessor Setter {\n\t\t\tget { return GetChildByRole(SetterRole); }\n\t\t\tset { SetChildByRole(SetterRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole (Roles.RBrace); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitIndexerDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitIndexerDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitIndexerDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tIndexerDeclaration o = other as IndexerDeclaration;\n\t\t\treturn o != null\n\t\t\t\t&& this.MatchAttributesAndModifiers(o, match) && this.ReturnType.DoMatch(o.ReturnType, match)\n\t\t\t\t&& this.PrivateImplementationType.DoMatch(o.PrivateImplementationType, match)\n\t\t\t\t&& this.Parameters.DoMatch(o.Parameters, match)\n\t\t\t\t&& this.Getter.DoMatch(o.Getter, match) && this.Setter.DoMatch(o.Setter, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MethodDeclaration.cs",
    "content": "﻿// \n// MethodDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class MethodDeclaration : EntityDeclaration\n\t{\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Method; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the type reference of the interface that is explicitly implemented.\n\t\t/// Null node if this member is not an explicit interface implementation.\n\t\t/// </summary>\n\t\tpublic AstType PrivateImplementationType {\n\t\t\tget { return GetChildByRole (PrivateImplementationTypeRole); }\n\t\t\tset { SetChildByRole (PrivateImplementationTypeRole, value); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<TypeParameterDeclaration> TypeParameters {\n\t\t\tget { return GetChildrenByRole (Roles.TypeParameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<Constraint> Constraints {\n\t\t\tget { return GetChildrenByRole (Roles.Constraint); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\tpublic bool IsExtensionMethod {\n\t\t\tget {\n\t\t\t\tParameterDeclaration pd = (ParameterDeclaration)GetChildByRole (Roles.Parameter);\n\t\t\t\treturn pd != null && pd.ParameterModifier == ParameterModifier.This;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitMethodDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitMethodDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitMethodDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tMethodDeclaration o = other as MethodDeclaration;\n\t\t\treturn o != null && MatchString(this.Name, o.Name)\n\t\t\t\t&& this.MatchAttributesAndModifiers(o, match) && this.ReturnType.DoMatch(o.ReturnType, match)\n\t\t\t\t&& this.PrivateImplementationType.DoMatch(o.PrivateImplementationType, match)\n\t\t\t\t&& this.TypeParameters.DoMatch(o.TypeParameters, match)\n\t\t\t\t&& this.Parameters.DoMatch(o.Parameters, match) && this.Constraints.DoMatch(o.Constraints, match)\n\t\t\t\t&& this.Body.DoMatch(o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs",
    "content": "﻿// \n// OperatorDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.ComponentModel;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum OperatorType\n\t{\n\t\t// Values must correspond to Mono.CSharp.Operator.OpType\n\t\t// due to the casts used in OperatorDeclaration.\n\t\t\n\t\t// Unary operators\n\t\tLogicalNot = Mono.CSharp.Operator.OpType.LogicalNot,\n\t\tOnesComplement = Mono.CSharp.Operator.OpType.OnesComplement,\n\t\tIncrement = Mono.CSharp.Operator.OpType.Increment,\n\t\tDecrement = Mono.CSharp.Operator.OpType.Decrement,\n\t\tTrue = Mono.CSharp.Operator.OpType.True,\n\t\tFalse = Mono.CSharp.Operator.OpType.False,\n\n\t\t// Unary and Binary operators\n\t\tAddition = Mono.CSharp.Operator.OpType.Addition,\n\t\tSubtraction = Mono.CSharp.Operator.OpType.Subtraction,\n\n\t\tUnaryPlus = Mono.CSharp.Operator.OpType.UnaryPlus,\n\t\tUnaryNegation = Mono.CSharp.Operator.OpType.UnaryNegation,\n\t\t\n\t\t// Binary operators\n\t\tMultiply = Mono.CSharp.Operator.OpType.Multiply,\n\t\tDivision = Mono.CSharp.Operator.OpType.Division,\n\t\tModulus = Mono.CSharp.Operator.OpType.Modulus,\n\t\tBitwiseAnd = Mono.CSharp.Operator.OpType.BitwiseAnd,\n\t\tBitwiseOr = Mono.CSharp.Operator.OpType.BitwiseOr,\n\t\tExclusiveOr = Mono.CSharp.Operator.OpType.ExclusiveOr,\n\t\tLeftShift = Mono.CSharp.Operator.OpType.LeftShift,\n\t\tRightShift = Mono.CSharp.Operator.OpType.RightShift,\n\t\tEquality = Mono.CSharp.Operator.OpType.Equality,\n\t\tInequality = Mono.CSharp.Operator.OpType.Inequality,\n\t\tGreaterThan = Mono.CSharp.Operator.OpType.GreaterThan,\n\t\tLessThan = Mono.CSharp.Operator.OpType.LessThan,\n\t\tGreaterThanOrEqual = Mono.CSharp.Operator.OpType.GreaterThanOrEqual,\n\t\tLessThanOrEqual = Mono.CSharp.Operator.OpType.LessThanOrEqual,\n\n\t\t// Implicit and Explicit\n\t\tImplicit = Mono.CSharp.Operator.OpType.Implicit,\n\t\tExplicit = Mono.CSharp.Operator.OpType.Explicit\n\t}\n\t\n\tpublic class OperatorDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly TokenRole OperatorKeywordRole = new TokenRole (\"operator\");\n\t\t\n\t\t// Unary operators\n\t\tpublic static readonly TokenRole LogicalNotRole = new TokenRole (\"!\");\n\t\tpublic static readonly TokenRole OnesComplementRole = new TokenRole (\"~\");\n\t\tpublic static readonly TokenRole IncrementRole = new TokenRole (\"++\");\n\t\tpublic static readonly TokenRole DecrementRole = new TokenRole (\"--\");\n\t\tpublic static readonly TokenRole TrueRole = new TokenRole (\"true\");\n\t\tpublic static readonly TokenRole FalseRole = new TokenRole (\"false\");\n\n\t\t// Unary and Binary operators\n\t\tpublic static readonly TokenRole AdditionRole = new TokenRole (\"+\");\n\t\tpublic static readonly TokenRole SubtractionRole = new TokenRole (\"-\");\n\n\t\t// Binary operators\n\t\tpublic static readonly TokenRole MultiplyRole = new TokenRole (\"*\");\n\t\tpublic static readonly TokenRole DivisionRole = new TokenRole (\"/\");\n\t\tpublic static readonly TokenRole ModulusRole = new TokenRole (\"%\");\n\t\tpublic static readonly TokenRole BitwiseAndRole = new TokenRole (\"&\");\n\t\tpublic static readonly TokenRole BitwiseOrRole = new TokenRole (\"|\");\n\t\tpublic static readonly TokenRole ExclusiveOrRole = new TokenRole (\"^\");\n\t\tpublic static readonly TokenRole LeftShiftRole = new TokenRole (\"<<\");\n\t\tpublic static readonly TokenRole RightShiftRole = new TokenRole (\">>\");\n\t\tpublic static readonly TokenRole EqualityRole = new TokenRole (\"==\");\n\t\tpublic static readonly TokenRole InequalityRole = new TokenRole (\"!=\");\n\t\tpublic static readonly TokenRole GreaterThanRole = new TokenRole (\">\");\n\t\tpublic static readonly TokenRole LessThanRole = new TokenRole (\"<\");\n\t\tpublic static readonly TokenRole GreaterThanOrEqualRole = new TokenRole (\">=\");\n\t\tpublic static readonly TokenRole LessThanOrEqualRole = new TokenRole (\"<=\");\n\t\t\n\t\tpublic static readonly TokenRole ExplicitRole = new TokenRole (\"explicit\");\n\t\tpublic static readonly TokenRole ImplicitRole = new TokenRole (\"implicit\");\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Operator; }\n\t\t}\n\t\t\n\t\tOperatorType operatorType;\n\t\t\n\t\tpublic OperatorType OperatorType {\n\t\t\tget { return operatorType; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\toperatorType = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode OperatorToken {\n\t\t\tget { return GetChildByRole (OperatorKeywordRole); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode OperatorTypeToken {\n\t\t\tget { return GetChildByRole (GetRole (OperatorType)); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LParToken {\n\t\t\tget { return GetChildByRole (Roles.LPar); }\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<ParameterDeclaration> Parameters {\n\t\t\tget { return GetChildrenByRole (Roles.Parameter); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RParToken {\n\t\t\tget { return GetChildByRole (Roles.RPar); }\n\t\t}\n\t\t\n\t\tpublic BlockStatement Body {\n\t\t\tget { return GetChildByRole (Roles.Body); }\n\t\t\tset { SetChildByRole (Roles.Body, value); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the operator type from the method name, or null, if the method does not represent one of the known operator types.\n\t\t/// </summary>\n\t\tpublic static OperatorType? GetOperatorType(string methodName)\n\t\t{\n\t\t\treturn (OperatorType?)Mono.CSharp.Operator.GetType(methodName);\n\t\t}\n\t\t\n\t\tpublic static TokenRole GetRole (OperatorType type)\n\t\t{\n\t\t\tswitch (type) {\n\t\t\tcase OperatorType.LogicalNot:\n\t\t\t\treturn LogicalNotRole;\n\t\t\tcase OperatorType.OnesComplement:\n\t\t\t\treturn OnesComplementRole;\n\t\t\tcase OperatorType.Increment:\n\t\t\t\treturn IncrementRole;\n\t\t\tcase OperatorType.Decrement:\n\t\t\t\treturn DecrementRole;\n\t\t\tcase OperatorType.True:\n\t\t\t\treturn TrueRole;\n\t\t\tcase OperatorType.False:\n\t\t\t\treturn FalseRole;\n\t\t\t\n\t\t\tcase OperatorType.Addition:\n\t\t\tcase OperatorType.UnaryPlus:\n\t\t\t\treturn AdditionRole;\n\t\t\tcase OperatorType.Subtraction:\n\t\t\tcase OperatorType.UnaryNegation:\n\t\t\t\treturn SubtractionRole;\n\t\t\t\n\t\t\tcase OperatorType.Multiply:\n\t\t\t\treturn MultiplyRole;\n\t\t\tcase OperatorType.Division:\n\t\t\t\treturn DivisionRole;\n\t\t\tcase OperatorType.Modulus:\n\t\t\t\treturn ModulusRole;\n\t\t\tcase OperatorType.BitwiseAnd:\n\t\t\t\treturn BitwiseAndRole;\n\t\t\tcase OperatorType.BitwiseOr:\n\t\t\t\treturn BitwiseOrRole;\n\t\t\tcase OperatorType.ExclusiveOr:\n\t\t\t\treturn ExclusiveOrRole;\n\t\t\tcase OperatorType.LeftShift:\n\t\t\t\treturn LeftShiftRole;\n\t\t\tcase OperatorType.RightShift:\n\t\t\t\treturn RightShiftRole;\n\t\t\tcase OperatorType.Equality:\n\t\t\t\treturn EqualityRole;\n\t\t\tcase OperatorType.Inequality:\n\t\t\t\treturn InequalityRole;\n\t\t\tcase OperatorType.GreaterThan:\n\t\t\t\treturn GreaterThanRole;\n\t\t\tcase OperatorType.LessThan:\n\t\t\t\treturn LessThanRole;\n\t\t\tcase OperatorType.GreaterThanOrEqual:\n\t\t\t\treturn GreaterThanOrEqualRole;\n\t\t\tcase OperatorType.LessThanOrEqual:\n\t\t\t\treturn LessThanOrEqualRole;\n\t\t\t\n\t\t\tcase OperatorType.Implicit:\n\t\t\t\treturn ImplicitRole;\n\t\t\tcase OperatorType.Explicit:\n\t\t\t\treturn ExplicitRole;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tthrow new System.ArgumentOutOfRangeException ();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the method name for the operator type. (\"op_Addition\", \"op_Implicit\", etc.)\n\t\t/// </summary>\n\t\tpublic static string GetName (OperatorType type)\n\t\t{\n\t\t\treturn Mono.CSharp.Operator.GetMetadataName ((Mono.CSharp.Operator.OpType)type);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the token for the operator type (\"+\", \"implicit\", etc.)\n\t\t/// </summary>\n\t\tpublic static string GetToken (OperatorType type)\n\t\t{\n\t\t\treturn Mono.CSharp.Operator.GetName ((Mono.CSharp.Operator.OpType)type);\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitOperatorDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitOperatorDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitOperatorDeclaration (this, data);\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget { return GetName (this.OperatorType); }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\t\t\n\t\t[EditorBrowsable(EditorBrowsableState.Never)]\n\t\tpublic override Identifier NameToken {\n\t\t\tget { return Identifier.Null; }\n\t\t\tset { throw new NotSupportedException(); }\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch (AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tOperatorDeclaration o = other as OperatorDeclaration;\n\t\t\treturn o != null && this.MatchAttributesAndModifiers (o, match) && this.OperatorType == o.OperatorType\n\t\t\t\t&& this.ReturnType.DoMatch (o.ReturnType, match)\n\t\t\t\t&& this.Parameters.DoMatch (o.Parameters, match) && this.Body.DoMatch (o.Body, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ParameterDeclaration.cs",
    "content": "﻿// \n// ParameterDeclarationExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum ParameterModifier {\n\t\tNone,\n\t\tRef,\n\t\tOut,\n\t\tParams,\n\t\tThis\n\t}\n\t\n\tpublic class ParameterDeclaration : AstNode\n\t{\n\t\tpublic static readonly Role<AttributeSection> AttributeRole = EntityDeclaration.AttributeRole;\n\t\tpublic static readonly TokenRole RefModifierRole = new TokenRole(\"ref\");\n\t\tpublic static readonly TokenRole OutModifierRole = new TokenRole(\"out\");\n\t\tpublic static readonly TokenRole ParamsModifierRole = new TokenRole(\"params\");\n\t\tpublic static readonly TokenRole ThisModifierRole = new TokenRole(\"this\");\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstNodeCollection<AttributeSection> Attributes {\n\t\t\tget { return GetChildrenByRole (AttributeRole); }\n\t\t}\n\t\t\n\t\tParameterModifier parameterModifier;\n\t\t\n\t\tpublic ParameterModifier ParameterModifier {\n\t\t\tget { return parameterModifier; }\n\t\t\tset {\n\t\t\t\tThrowIfFrozen();\n\t\t\t\tparameterModifier = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstType Type {\n\t\t\tget { return GetChildByRole (Roles.Type); }\n\t\t\tset { SetChildByRole (Roles.Type, value); }\n\t\t}\n\t\t\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier NameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpTokenNode AssignToken {\n\t\t\tget { return GetChildByRole (Roles.Assign); }\n\t\t}\n\n\t\tpublic Expression DefaultExpression {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitParameterDeclaration (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitParameterDeclaration (this);\n\t\t}\n\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitParameterDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tParameterDeclaration o = other as ParameterDeclaration;\n\t\t\treturn o != null && this.Attributes.DoMatch(o.Attributes, match) && this.ParameterModifier == o.ParameterModifier\n\t\t\t\t&& this.Type.DoMatch(o.Type, match) && MatchString(this.Name, o.Name)\n\t\t\t\t&& this.DefaultExpression.DoMatch(o.DefaultExpression, match);\n\t\t}\n\t\t\n\t\tpublic ParameterDeclaration()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ParameterDeclaration(AstType type, string name, ParameterModifier modifier = ParameterModifier.None)\n\t\t{\n\t\t\tType = type;\n\t\t\tName = name;\n\t\t\tParameterModifier = modifier;\n\t\t}\n\n\t\tpublic ParameterDeclaration(string name, ParameterModifier modifier = ParameterModifier.None)\n\t\t{\n\t\t\tName = name;\n\t\t\tParameterModifier = modifier;\n\t\t}\n\n\t\tpublic new ParameterDeclaration Clone()\n\t\t{\n\t\t\treturn (ParameterDeclaration)base.Clone();\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/PropertyDeclaration.cs",
    "content": "﻿// \n// PropertyDeclaration.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class PropertyDeclaration : EntityDeclaration\n\t{\n\t\tpublic static readonly TokenRole GetKeywordRole = new TokenRole (\"get\");\n\t\tpublic static readonly TokenRole SetKeywordRole = new TokenRole (\"set\");\n\t\tpublic static readonly Role<Accessor> GetterRole = new Role<Accessor>(\"Getter\", Accessor.Null);\n\t\tpublic static readonly Role<Accessor> SetterRole = new Role<Accessor>(\"Setter\", Accessor.Null);\n\t\t\n\t\tpublic override SymbolKind SymbolKind {\n\t\t\tget { return SymbolKind.Property; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the type reference of the interface that is explicitly implemented.\n\t\t/// Null node if this member is not an explicit interface implementation.\n\t\t/// </summary>\n\t\tpublic AstType PrivateImplementationType {\n\t\t\tget { return GetChildByRole (PrivateImplementationTypeRole); }\n\t\t\tset { SetChildByRole (PrivateImplementationTypeRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode LBraceToken {\n\t\t\tget { return GetChildByRole (Roles.LBrace); }\n\t\t}\n\t\t\n\t\tpublic Accessor Getter {\n\t\t\tget { return GetChildByRole(GetterRole); }\n\t\t\tset { SetChildByRole(GetterRole, value); }\n\t\t}\n\t\t\n\t\tpublic Accessor Setter {\n\t\t\tget { return GetChildByRole(SetterRole); }\n\t\t\tset { SetChildByRole(SetterRole, value); }\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode RBraceToken {\n\t\t\tget { return GetChildByRole (Roles.RBrace); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitPropertyDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitPropertyDeclaration (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitPropertyDeclaration (this, data);\n\t\t}\n\t\t\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tPropertyDeclaration o = other as PropertyDeclaration;\n\t\t\treturn o != null && MatchString(this.Name, o.Name)\n\t\t\t\t&& this.MatchAttributesAndModifiers(o, match) && this.ReturnType.DoMatch(o.ReturnType, match)\n\t\t\t\t&& this.PrivateImplementationType.DoMatch(o.PrivateImplementationType, match)\n\t\t\t\t&& this.Getter.DoMatch(o.Getter, match) && this.Setter.DoMatch(o.Setter, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/VariableInitializer.cs",
    "content": "﻿// \n// VariableInitializer.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class VariableInitializer : AstNode\n\t{\n\t\t#region Null\n\t\tpublic new static readonly VariableInitializer Null = new NullVariableInitializer ();\n\t\t\n\t\tsealed class NullVariableInitializer : VariableInitializer\n\t\t{\n\t\t\tpublic override bool IsNull {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitNullNode(this, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn other == null || other.IsNull;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region PatternPlaceholder\n\t\tpublic static implicit operator VariableInitializer(PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn pattern != null ? new PatternPlaceholder(pattern) : null;\n\t\t}\n\t\t\n\t\tsealed class PatternPlaceholder : VariableInitializer, PatternMatching.INode\n\t\t{\n\t\t\treadonly PatternMatching.Pattern child;\n\t\t\t\n\t\t\tpublic PatternPlaceholder(PatternMatching.Pattern child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override NodeType NodeType {\n\t\t\t\tget { return NodeType.Pattern; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\t\t\t\t\n\t\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder (this, child);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)\n\t\t\t{\n\t\t\t\treturn visitor.VisitPatternPlaceholder(this, child, data);\n\t\t\t}\n\t\t\t\n\t\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t\t{\n\t\t\t\treturn child.DoMatch(other, match);\n\t\t\t}\n\t\t\t\n\t\t\tbool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo)\n\t\t\t{\n\t\t\t\treturn child.DoMatchCollection(role, pos, match, backtrackingInfo);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic override NodeType NodeType {\n\t\t\tget {\n\t\t\t\treturn NodeType.Unknown;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic VariableInitializer()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic VariableInitializer(string name, Expression initializer = null)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Initializer = initializer;\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier).Name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, Identifier.Create (value));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Identifier NameToken {\n\t\t\tget {\n\t\t\t\treturn GetChildByRole (Roles.Identifier);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tSetChildByRole (Roles.Identifier, value);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpTokenNode AssignToken {\n\t\t\tget { return GetChildByRole (Roles.Assign); }\n\t\t}\n\t\t\n\t\tpublic Expression Initializer {\n\t\t\tget { return GetChildByRole (Roles.Expression); }\n\t\t\tset { SetChildByRole (Roles.Expression, value); }\n\t\t}\n\t\t\n\t\tpublic override void AcceptVisitor (IAstVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitVariableInitializer (this);\n\t\t}\n\t\t\t\n\t\tpublic override T AcceptVisitor<T> (IAstVisitor<T> visitor)\n\t\t{\n\t\t\treturn visitor.VisitVariableInitializer (this);\n\t\t}\n\t\t\n\t\tpublic override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)\n\t\t{\n\t\t\treturn visitor.VisitVariableInitializer (this, data);\n\t\t}\n\n\t\tprotected internal override bool DoMatch(AstNode other, PatternMatching.Match match)\n\t\t{\n\t\t\tVariableInitializer o = other as VariableInitializer;\n\t\t\treturn o != null && MatchString(this.Name, o.Name) && this.Initializer.DoMatch(o.Initializer, match);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/CSharpProjectContent.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.Serialization;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[Serializable]\n\tpublic class CSharpProjectContent : IProjectContent\n\t{\n\t\tstring assemblyName;\n\t\tstring fullAssemblyName;\n\t\tstring projectFileName;\n\t\tstring location;\n\t\tDictionary<string, IUnresolvedFile> unresolvedFiles;\n\t\tList<IAssemblyReference> assemblyReferences;\n\t\tCompilerSettings compilerSettings;\n\t\t\n\t\tpublic CSharpProjectContent()\n\t\t{\n\t\t\tthis.unresolvedFiles = new Dictionary<string, IUnresolvedFile>(Platform.FileNameComparer);\n\t\t\tthis.assemblyReferences = new List<IAssemblyReference>();\n\t\t\tthis.compilerSettings = new CompilerSettings();\n\t\t\tcompilerSettings.Freeze();\n\t\t}\n\t\t\n\t\tprotected CSharpProjectContent(CSharpProjectContent pc)\n\t\t{\n\t\t\tthis.assemblyName = pc.assemblyName;\n\t\t\tthis.fullAssemblyName = pc.fullAssemblyName;\n\t\t\tthis.projectFileName = pc.projectFileName;\n\t\t\tthis.location = pc.location;\n\t\t\tthis.unresolvedFiles = new Dictionary<string, IUnresolvedFile>(pc.unresolvedFiles, Platform.FileNameComparer);\n\t\t\tthis.assemblyReferences = new List<IAssemblyReference>(pc.assemblyReferences);\n\t\t\tthis.compilerSettings = pc.compilerSettings;\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedFile> Files {\n\t\t\tget { return unresolvedFiles.Values; }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IAssemblyReference> AssemblyReferences {\n\t\t\tget { return assemblyReferences; }\n\t\t}\n\t\t\n\t\tpublic string ProjectFileName {\n\t\t\tget { return projectFileName; }\n\t\t}\n\t\t\n\t\tpublic string AssemblyName {\n\t\t\tget { return assemblyName; }\n\t\t}\n\n\t\tpublic string FullAssemblyName {\n\t\t\tget { return fullAssemblyName; }\n\t\t}\n\n\t\tpublic string Location {\n\t\t\tget { return location; }\n\t\t}\n\n\t\tpublic CompilerSettings CompilerSettings {\n\t\t\tget { return compilerSettings; }\n\t\t}\n\t\t\n\t\tobject IProjectContent.CompilerSettings {\n\t\t\tget { return compilerSettings; }\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedAttribute> AssemblyAttributes {\n\t\t\tget {\n\t\t\t\treturn this.Files.SelectMany(f => f.AssemblyAttributes);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedAttribute> ModuleAttributes {\n\t\t\tget {\n\t\t\t\treturn this.Files.SelectMany(f => f.ModuleAttributes);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IEnumerable<IUnresolvedTypeDefinition> TopLevelTypeDefinitions {\n\t\t\tget {\n\t\t\t\treturn this.Files.SelectMany(f => f.TopLevelTypeDefinitions);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IUnresolvedFile GetFile(string fileName)\n\t\t{\n\t\t\tIUnresolvedFile file;\n\t\t\tif (unresolvedFiles.TryGetValue(fileName, out file))\n\t\t\t\treturn file;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual ICompilation CreateCompilation()\n\t\t{\n\t\t\tvar solutionSnapshot = new DefaultSolutionSnapshot();\n\t\t\tICompilation compilation = new SimpleCompilation(solutionSnapshot, this, assemblyReferences);\n\t\t\tsolutionSnapshot.AddCompilation(this, compilation);\n\t\t\treturn compilation;\n\t\t}\n\t\t\n\t\tpublic virtual ICompilation CreateCompilation(ISolutionSnapshot solutionSnapshot)\n\t\t{\n\t\t\treturn new SimpleCompilation(solutionSnapshot, this, assemblyReferences);\n\t\t}\n\t\t\n\t\tprotected virtual CSharpProjectContent Clone()\n\t\t{\n\t\t\treturn new CSharpProjectContent(this);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets both the short and the full assembly names.\n\t\t/// </summary>\n\t\t/// <param name=\"newAssemblyName\">New full assembly name.</param>\n\t\tpublic IProjectContent SetAssemblyName(string newAssemblyName)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tpc.fullAssemblyName = newAssemblyName;\n\t\t\tint pos = newAssemblyName != null ? newAssemblyName.IndexOf(',') : -1;\n\t\t\tpc.assemblyName = pos < 0 ? newAssemblyName : newAssemblyName.Substring(0, pos);\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\tpublic IProjectContent SetProjectFileName(string newProjectFileName)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tpc.projectFileName = newProjectFileName;\n\t\t\treturn pc;\n\t\t}\n\n\t\tpublic IProjectContent SetLocation(string newLocation)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tpc.location = newLocation;\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\tpublic IProjectContent SetCompilerSettings(object compilerSettings)\n\t\t{\n\t\t\tif (!(compilerSettings is CompilerSettings))\n\t\t\t\tthrow new ArgumentException(\"Settings must be an instance of \" + typeof(CompilerSettings).FullName, \"compilerSettings\");\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tpc.compilerSettings = (CompilerSettings)compilerSettings;\n\t\t\tpc.compilerSettings.Freeze();\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\tpublic IProjectContent AddAssemblyReferences(IEnumerable<IAssemblyReference> references)\n\t\t{\n\t\t\treturn AddAssemblyReferences(references.ToArray());\n\t\t}\n\t\t\n\t\tpublic IProjectContent AddAssemblyReferences(params IAssemblyReference[] references)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tpc.assemblyReferences.AddRange(references);\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\tpublic IProjectContent RemoveAssemblyReferences(IEnumerable<IAssemblyReference> references)\n\t\t{\n\t\t\treturn RemoveAssemblyReferences(references.ToArray());\n\t\t}\n\t\t\n\t\tpublic IProjectContent RemoveAssemblyReferences(params IAssemblyReference[] references)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tforeach (var r in references)\n\t\t\t\tpc.assemblyReferences.Remove(r);\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds the specified files to the project content.\n\t\t/// If a file with the same name already exists, updated the existing file.\n\t\t/// </summary>\n\t\tpublic IProjectContent AddOrUpdateFiles(IEnumerable<IUnresolvedFile> newFiles)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tforeach (var file in newFiles) {\n\t\t\t\tpc.unresolvedFiles[file.FileName] = file;\n\t\t\t}\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds the specified files to the project content.\n\t\t/// If a file with the same name already exists, this method updates the existing file.\n\t\t/// </summary>\n\t\tpublic IProjectContent AddOrUpdateFiles(params IUnresolvedFile[] newFiles)\n\t\t{\n\t\t\treturn AddOrUpdateFiles((IEnumerable<IUnresolvedFile>)newFiles);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Removes the files with the specified names.\n\t\t/// </summary>\n\t\tpublic IProjectContent RemoveFiles(IEnumerable<string> fileNames)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tforeach (var fileName in fileNames) {\n\t\t\t\tpc.unresolvedFiles.Remove(fileName);\n\t\t\t}\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Removes the files with the specified names.\n\t\t/// </summary>\n\t\tpublic IProjectContent RemoveFiles(params string[] fileNames)\n\t\t{\n\t\t\treturn RemoveFiles((IEnumerable<string>)fileNames);\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use RemoveFiles/AddOrUpdateFiles instead\")]\n\t\tpublic IProjectContent UpdateProjectContent(IUnresolvedFile oldFile, IUnresolvedFile newFile)\n\t\t{\n\t\t\tif (oldFile == null && newFile == null)\n\t\t\t\treturn this;\n\t\t\tif (oldFile != null && newFile != null) {\n\t\t\t\tif (!Platform.FileNameComparer.Equals(oldFile.FileName, newFile.FileName))\n\t\t\t\t\tthrow new ArgumentException(\"When both oldFile and newFile are specified, they must use the same file name.\");\n\t\t\t}\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tif (newFile == null)\n\t\t\t\tpc.unresolvedFiles.Remove(oldFile.FileName);\n\t\t\telse\n\t\t\t\tpc.unresolvedFiles[newFile.FileName] = newFile;\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use RemoveFiles/AddOrUpdateFiles instead\")]\n\t\tpublic IProjectContent UpdateProjectContent(IEnumerable<IUnresolvedFile> oldFiles, IEnumerable<IUnresolvedFile> newFiles)\n\t\t{\n\t\t\tCSharpProjectContent pc = Clone();\n\t\t\tif (oldFiles != null) {\n\t\t\t\tforeach (var oldFile in oldFiles) {\n\t\t\t\t\tpc.unresolvedFiles.Remove(oldFile.FileName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (newFiles != null) {\n\t\t\t\tforeach (var newFile in newFiles) {\n\t\t\t\t\tpc.unresolvedFiles.Add(newFile.FileName, newFile);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn pc;\n\t\t}\n\t\t\n\t\tIAssembly IAssemblyReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tvar cache = context.Compilation.CacheManager;\n\t\t\tIAssembly asm = (IAssembly)cache.GetShared(this);\n\t\t\tif (asm != null) {\n\t\t\t\treturn asm;\n\t\t\t} else {\n\t\t\t\tasm = new CSharpAssembly(context.Compilation, this);\n\t\t\t\treturn (IAssembly)cache.GetOrAddShared(this, asm);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/CombineQueryExpressions.cs",
    "content": "//\n// CombineQueryExpressions.cs\n//\n// Modified by Luís Reis <luiscubal@gmail.com> (Copyright (C) 2013)\n//\n// Copyright header of the original version follows:\n//\n// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Combines query expressions and removes transparent identifiers.\n\t/// </summary>\n\tpublic class CombineQueryExpressions\n\t{\n\t\tstatic readonly InvocationExpression castPattern = new InvocationExpression {\n\t\t\tTarget = new MemberReferenceExpression {\n\t\t\t\tTarget = new AnyNode(\"inExpr\"),\n\t\t\t\tMemberName = \"Cast\",\n\t\t\t\tTypeArguments = { new AnyNode(\"targetType\") }\n\t\t\t}};\n\n\t\tpublic string CombineQuery(AstNode node, AstNode rootQuery = null)\n\t\t{\n\t\t\tif (rootQuery == null) {\n\t\t\t\trootQuery = node;\n\t\t\t}\n\n\t\t\tQueryExpression query = node as QueryExpression;\n\t\t\tif (query != null) {\n\t\t\t\tstring continuationIdentifier = null;\n\n\t\t\t\tforeach (var clause in query.Clauses) {\n\t\t\t\t\tvar continuation = clause as QueryContinuationClause;\n\t\t\t\t\tif (continuation != null) {\n\t\t\t\t\t\tCombineQuery(continuation.PrecedingQuery);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar from = clause as QueryFromClause;\n\t\t\t\t\tif (from != null) {\n\t\t\t\t\t\tcontinuationIdentifier = CombineQuery(from.Expression, rootQuery);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tQueryFromClause fromClause = (QueryFromClause)query.Clauses.First();\n\t\t\t\tQueryExpression innerQuery = fromClause.Expression as QueryExpression;\n\t\t\t\tif (innerQuery != null) {\n\t\t\t\t\tcontinuationIdentifier = continuationIdentifier ?? ((QueryFromClause)innerQuery.Clauses.First()).Identifier;\n\n\t\t\t\t\tstring transparentIdentifier;\n\t\t\t\t\tif (TryRemoveTransparentIdentifier(query, fromClause, innerQuery, continuationIdentifier, out transparentIdentifier)) {\n\t\t\t\t\t\tRemoveTransparentIdentifierReferences(rootQuery, transparentIdentifier);\n\t\t\t\t\t} else if (fromClause.Type.IsNull) {\n\t\t\t\t\t\tQueryContinuationClause continuation = new QueryContinuationClause();\n\t\t\t\t\t\tcontinuation.PrecedingQuery = innerQuery.Detach();\n\t\t\t\t\t\tcontinuation.Identifier = fromClause.Identifier;\n\t\t\t\t\t\tfromClause.ReplaceWith(continuation);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn transparentIdentifier;\n\t\t\t\t} else {\n\t\t\t\t\tMatch m = castPattern.Match(fromClause.Expression);\n\t\t\t\t\tif (m.Success) {\n\t\t\t\t\t\tfromClause.Type = m.Get<AstType>(\"targetType\").Single().Detach();\n\t\t\t\t\t\tfromClause.Expression = m.Get<Expression>(\"inExpr\").Single().Detach();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic readonly QuerySelectClause selectTransparentIdentifierPattern = new QuerySelectClause {\n\t\t\tExpression = new AnonymousTypeCreateExpression {\n\t\t\t\t\tInitializers = {\n\t\t\t\t\t\tnew AnyNode(\"nae1\"),\n\t\t\t\t\t\tnew AnyNode(\"nae2\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\tbool TryRemoveTransparentIdentifier(QueryExpression query, QueryFromClause fromClause, QueryExpression innerQuery, string continuationIdentifier, out string transparentIdentifier)\n\t\t{\n\t\t\ttransparentIdentifier = fromClause.Identifier;\n\n\t\t\tMatch match = selectTransparentIdentifierPattern.Match(innerQuery.Clauses.Last());\n\t\t\tif (!match.Success)\n\t\t\t\treturn false;\n\t\t\tQuerySelectClause selectClause = (QuerySelectClause)innerQuery.Clauses.Last();\n\t\t\tExpression nae1 = match.Get<Expression>(\"nae1\").SingleOrDefault();\n\t\t\tstring nae1Name = ExtractExpressionName(ref nae1);\n\t\t\tif (nae1Name == null)\n\t\t\t\treturn false;\n\n\t\t\tExpression nae2 = match.Get<Expression>(\"nae2\").SingleOrDefault();\n\t\t\tstring nae2Name = ExtractExpressionName(ref nae2);\n\t\t\tif (nae1Name == null)\n\t\t\t\treturn false;\n\n\t\t\tbool introduceLetClause = true;\n\t\t\tvar nae1Identifier = nae1 as IdentifierExpression;\n\t\t\tvar nae2Identifier = nae2 as IdentifierExpression;\n\t\t\tif (nae1Identifier != null && nae2Identifier != null && nae1Identifier.Identifier == nae1Name && nae2Identifier.Identifier == nae2Name) {\n\t\t\t\tintroduceLetClause = false;\n\t\t\t}\n\n\t\t\tif (nae1Name != continuationIdentifier) {\n\t\t\t\tif (nae2Name == continuationIdentifier) {\n\t\t\t\t\t//Members are in reversed order\n\t\t\t\t\tstring tempName = nae1Name;\n\t\t\t\t\tExpression tempNae = nae1;\n\n\t\t\t\t\tnae1Name = nae2Name;\n\t\t\t\t\tnae1 = nae2;\n\t\t\t\t\tnae2Name = tempName;\n\t\t\t\t\tnae2 = tempNae;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (introduceLetClause && innerQuery.Clauses.OfType<QueryFromClause>().Any(from => from.Identifier == nae2Name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (introduceLetClause && innerQuery.Clauses.OfType<QueryJoinClause>().Any(join => join.JoinIdentifier == nae2Name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// from * in (from x in ... select new { x = x, y = expr }) ...\n\t\t\t// =>\n\t\t\t// from x in ... let y = expr ...\n\t\t\tfromClause.Remove();\n\t\t\tselectClause.Remove();\n\t\t\t// Move clauses from innerQuery to query\n\t\t\tQueryClause insertionPos = null;\n\t\t\tforeach (var clause in innerQuery.Clauses) {\n\t\t\t\tquery.Clauses.InsertAfter(insertionPos, insertionPos = clause.Detach());\n\t\t\t}\n\t\t\tif (introduceLetClause) {\n\t\t\t\tquery.Clauses.InsertAfter(insertionPos, new QueryLetClause { Identifier = nae2Name, Expression = nae2.Detach() });\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Removes all occurrences of transparent identifiers\n\t\t/// </summary>\n\t\tvoid RemoveTransparentIdentifierReferences(AstNode node, string transparentIdentifier)\n\t\t{\n\t\t\tforeach (AstNode child in node.Children) {\n\t\t\t\tRemoveTransparentIdentifierReferences(child, transparentIdentifier);\n\t\t\t}\n\t\t\tMemberReferenceExpression mre = node as MemberReferenceExpression;\n\t\t\tif (mre != null) {\n\t\t\t\tIdentifierExpression ident = mre.Target as IdentifierExpression;\n\t\t\t\tif (ident != null && ident.Identifier == transparentIdentifier) {\n\t\t\t\t\tIdentifierExpression newIdent = new IdentifierExpression(mre.MemberName);\n\t\t\t\t\tmre.TypeArguments.MoveTo(newIdent.TypeArguments);\n\t\t\t\t\tnewIdent.CopyAnnotationsFrom(mre);\n\t\t\t\t\tnewIdent.RemoveAnnotations<PropertyDeclaration>(); // remove the reference to the property of the anonymous type\n\t\t\t\t\tmre.ReplaceWith(newIdent);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (mre.MemberName == transparentIdentifier) {\n\t\t\t\t\tvar newVar = mre.Target.Detach();\n\t\t\t\t\tnewVar.CopyAnnotationsFrom(mre);\n\t\t\t\t\tnewVar.RemoveAnnotations<PropertyDeclaration>(); // remove the reference to the property of the anonymous type\n\t\t\t\t\tmre.ReplaceWith(newVar);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstring ExtractExpressionName(ref Expression expr)\n\t\t{\n\t\t\tNamedExpression namedExpr = expr as NamedExpression;\n\t\t\tif (namedExpr != null) {\n\t\t\t\texpr = namedExpr.Expression;\n\t\t\t\treturn namedExpr.Name;\n\t\t\t}\n\n\t\t\tIdentifierExpression identifier = expr as IdentifierExpression;\n\t\t\tif (identifier != null) {\n\t\t\t\treturn identifier.Identifier;\n\t\t\t}\n\n\t\t\tMemberReferenceExpression memberRef = expr as MemberReferenceExpression;\n\t\t\tif (memberRef != null) {\n\t\t\t\treturn memberRef.MemberName;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs",
    "content": "// \n// CSharpCompletionEngine.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.Completion;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Completion\n{\n\tpublic enum EditorBrowsableBehavior\n\t{\n\t\tIgnore,\n\t\tNormal,\n\t\tIncludeAdvanced\n\t}\n\n\tpublic class CompletionEngineCache\n\t{\n\t\tpublic List<INamespace>  namespaces;\n\t\tpublic ICompletionData[] importCompletion;\n\t}\n\n\tpublic class CSharpCompletionEngine : CSharpCompletionEngineBase\n\t{\n\t\tinternal ICompletionDataFactory factory;\n\n\t\t#region Additional input properties\n\n\t\tpublic CSharpFormattingOptions FormattingPolicy { get; set; }\n\n\t\tpublic string EolMarker { get; set; }\n\n\t\tpublic string IndentString { get; set; }\n\n\t\tpublic bool AutomaticallyAddImports { get; set; }\n\n\t\tpublic bool IncludeKeywordsInCompletionList { get; set; }\n\n\t\tpublic EditorBrowsableBehavior EditorBrowsableBehavior { get; set; }\n\n\t\tpublic CompletionEngineCache CompletionEngineCache { get; set; }\n\n\t\t#endregion\n\n\t\t#region Result properties\n\n\t\tpublic bool AutoCompleteEmptyMatch;\n\t\t/// <summary>\n\t\t/// The auto complete empty match on curly bracket. (only taken into account when AutoCompleteEmptyMatch is true )\n\t\t/// </summary>\n\t\tpublic bool AutoCompleteEmptyMatchOnCurlyBracket = true;\n\t\tpublic bool AutoSelect;\n\t\tpublic string DefaultCompletionString;\n\t\tpublic bool CloseOnSquareBrackets;\n\t\tpublic readonly List<IMethod> PossibleDelegates = new List<IMethod>();\n\n\t\t#endregion\n\n\t\tpublic CSharpCompletionEngine(IDocument document, ICompletionContextProvider completionContextProvider, ICompletionDataFactory factory, IProjectContent content, CSharpTypeResolveContext ctx) : base(content, completionContextProvider, ctx)\n\t\t{\n\t\t\tif (document == null) {\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\t}\n\t\t\tif (factory == null) {\n\t\t\t\tthrow new ArgumentNullException(\"factory\");\n\t\t\t}\n\t\t\tthis.document = document;\n\t\t\tthis.factory = factory;\n\t\t\t// Set defaults for additional input properties\n\t\t\tthis.FormattingPolicy = FormattingOptionsFactory.CreateMono();\n\t\t\tthis.EolMarker = Environment.NewLine;\n\t\t\tthis.IncludeKeywordsInCompletionList = true;\n\t\t\tEditorBrowsableBehavior = EditorBrowsableBehavior.IncludeAdvanced;\n\t\t\tthis.IndentString = \"\\t\";\n\t\t}\n\n\t\tpublic bool TryGetCompletionWord(int offset, out int startPos, out int wordLength)\n\t\t{\n\t\t\tstartPos = wordLength = 0;\n\t\t\tint pos = offset - 1;\n\t\t\twhile (pos >= 0) {\n\t\t\t\tchar c = document.GetCharAt(pos);\n\t\t\t\tif (!char.IsLetterOrDigit(c) && c != '_')\n\t\t\t\t\tbreak;\n\t\t\t\tpos--;\n\t\t\t}\n\t\t\tif (pos == -1)\n\t\t\t\treturn false;\n\n\t\t\tpos++;\n\t\t\tstartPos = pos;\n\n\t\t\twhile (pos < document.TextLength) {\n\t\t\t\tchar c = document.GetCharAt(pos);\n\t\t\t\tif (!char.IsLetterOrDigit(c) && c != '_')\n\t\t\t\t\tbreak;\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\twordLength = pos - startPos;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic IEnumerable<ICompletionData> GetCompletionData(int offset, bool controlSpace)\n\t\t{\n\t\t\tthis.AutoCompleteEmptyMatch = true;\n\t\t\tthis.AutoSelect = true;\n\t\t\tthis.DefaultCompletionString = null;\n\t\t\tSetOffset(offset);\n\t\t\tif (offset > 0) {\n\t\t\t\tchar lastChar = document.GetCharAt(offset - 1);\n\t\t\t\tbool isComplete = false;\n\t\t\t\tvar result = MagicKeyCompletion(lastChar, controlSpace, out isComplete) ?? Enumerable.Empty<ICompletionData>();\n\t\t\t\tif (!isComplete && controlSpace && char.IsWhiteSpace(lastChar)) {\n\t\t\t\t\toffset -= 2;\n\t\t\t\t\twhile (offset >= 0 && char.IsWhiteSpace(document.GetCharAt(offset))) {\n\t\t\t\t\t\toffset--;\n\t\t\t\t\t}\n\t\t\t\t\tif (offset > 0) {\n\t\t\t\t\t\tvar nonWsResult = MagicKeyCompletion(\n\t\t\t\t\t\t\tdocument.GetCharAt(offset),\n\t\t\t\t\t\t\tcontrolSpace,\n\t\t\t\t\t\t\tout isComplete\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (nonWsResult != null) {\n\t\t\t\t\t\t\tvar text = new HashSet<string>(result.Select(r => r.CompletionText));\n\t\t\t\t\t\t\tresult = result.Concat(nonWsResult.Where(r => !text.Contains(r.CompletionText)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the types that needs to be imported via using or full type name.\n\t\t/// </summary>\n\t\tpublic IEnumerable<ICompletionData> GetImportCompletionData(int offset)\n\t\t{\n\t\t\tvar generalLookup = new MemberLookup(null, Compilation.MainAssembly);\n\t\t\tSetOffset(offset);\n\n\t\t\t// flatten usings\n\t\t\tvar namespaces = new List<INamespace>();\n\t\t\tfor (var n = ctx.CurrentUsingScope; n != null; n = n.Parent) {\n\t\t\t\tnamespaces.Add(n.Namespace);\n\t\t\t\tforeach (var u in n.Usings)\n\t\t\t\t\tnamespaces.Add(u);\n\t\t\t}\n\n\t\t\tforeach (var type in Compilation.GetAllTypeDefinitions ()) {\n\t\t\t\tif (!generalLookup.IsAccessible(type, false))\n\t\t\t\t\tcontinue;\t\n\t\t\t\tif (namespaces.Any(n => n.FullName == type.Namespace))\n\t\t\t\t\tcontinue;\n\t\t\t\tbool useFullName = false;\n\t\t\t\tforeach (var ns in namespaces) {\n\t\t\t\t\tif (ns.GetTypeDefinition(type.Name, type.TypeParameterCount) != null) {\n\t\t\t\t\t\tuseFullName = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tyield return factory.CreateImportCompletionData(type, useFullName, false);\n\t\t\t}\n\t\t}\n\n\t\tIEnumerable<string> GenerateNameProposals(AstType type)\n\t\t{\n\t\t\tif (type is PrimitiveType) {\n\t\t\t\tvar pt = (PrimitiveType)type;\n\t\t\t\tswitch (pt.Keyword) {\n\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\tyield return \"o\";\n\t\t\t\t\t\tyield return \"obj\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"bool\":\n\t\t\t\t\t\tyield return \"b\";\n\t\t\t\t\t\tyield return \"pred\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\tcase \"float\":\n\t\t\t\t\tcase \"decimal\":\n\t\t\t\t\t\tyield return \"d\";\n\t\t\t\t\t\tyield return \"f\";\n\t\t\t\t\t\tyield return \"m\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tyield return \"i\";\n\t\t\t\t\t\tyield return \"j\";\n\t\t\t\t\t\tyield return \"k\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tstring name;\n\t\t\tif (type is SimpleType) {\n\t\t\t\tname = ((SimpleType)type).Identifier;\n\t\t\t} else if (type is MemberType) {\n\t\t\t\tname = ((MemberType)type).MemberName;\n\t\t\t} else {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar names = WordParser.BreakWords(name);\n\n\t\t\tvar possibleName = new StringBuilder();\n\t\t\tfor (int i = 0; i < names.Count; i++) {\n\t\t\t\tpossibleName.Length = 0;\n\t\t\t\tfor (int j = i; j < names.Count; j++) {\n\t\t\t\t\tif (string.IsNullOrEmpty(names [j])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (j == i) { \n\t\t\t\t\t\tnames [j] = Char.ToLower(names [j] [0]) + names [j].Substring(1);\n\t\t\t\t\t}\n\t\t\t\t\tpossibleName.Append(names [j]);\n\t\t\t\t}\n\t\t\t\tyield return possibleName.ToString();\n\t\t\t}\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleMemberReferenceCompletion(ExpressionResult expr)\n\t\t{\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\t// do not auto select <number>. (but <number>.<number>.) (0.ToString() is valid)\n\t\t\tif (expr.Node is PrimitiveExpression) {\n\t\t\t\tvar pexpr = (PrimitiveExpression)expr.Node;\n\t\t\t\tif (!(pexpr.Value is string || pexpr.Value is char) && !pexpr.LiteralValue.Contains('.')) {\n\t\t\t\t\tAutoSelect = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar resolveResult = ResolveExpression(expr);\n\n\t\t\tif (resolveResult == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (expr.Node is AstType) {\n\n\t\t\t\t// check for namespace names\n\t\t\t\tif (expr.Node.AncestorsAndSelf\n\t\t\t\t\t.TakeWhile(n => n is AstType)\n\t\t\t\t\t.Any(m => m.Role == NamespaceDeclaration.NamespaceNameRole))\n\t\t\t\t\treturn null;\n\n\t\t\t\t// need to look at paren.parent because of \"catch (<Type>.A\" expression\n\t\t\t\tif (expr.Node.Parent != null && expr.Node.Parent.Parent is CatchClause)\n\t\t\t\t\treturn HandleCatchClauseType(expr);\n\t\t\t\treturn CreateTypeAndNamespaceCompletionData(\n\t\t\t\t\tlocation,\n\t\t\t\t\tresolveResult.Result,\n\t\t\t\t\texpr.Node,\n\t\t\t\t\tresolveResult.Resolver\n\t\t\t\t);\n\t\t\t}\n\n\n\t\t\treturn CreateCompletionData(\n\t\t\t\tlocation,\n\t\t\t\tresolveResult.Result,\n\t\t\t\texpr.Node,\n\t\t\t\tresolveResult.Resolver\n\t\t\t);\n\t\t}\n\n\t\tbool IsInPreprocessorDirective()\n\t\t{\n\t\t\tvar text = GetMemberTextToCaret().Item1;\n\t\t\tvar miniLexer = new MiniLexer(text);\n\t\t\tminiLexer.Parse();\n\t\t\treturn miniLexer.IsInPreprocessorDirective;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleObjectInitializer(SyntaxTree unit, AstNode n)\n\t\t{\n\t\t\tvar p = n.Parent;\n\t\t\twhile (p != null && !(p is ObjectCreateExpression)) {\n\t\t\t\tp = p.Parent;\n\t\t\t}\n\t\t\tvar parent = n.Parent as ArrayInitializerExpression;\n\t\t\tif (parent == null)\n\t\t\t\treturn null;\n\t\t\tif (parent.IsSingleElement)\n\t\t\t\tparent = (ArrayInitializerExpression)parent.Parent;\n\t\t\tif (p != null) {\n\t\t\t\tvar contextList = new CompletionDataWrapper(this);\n\t\t\t\tvar initializerResult = ResolveExpression(p);\n\t\t\t\tIType initializerType = null;\n\n\t\t\t\tif (initializerResult.Result is DynamicInvocationResolveResult) {\n\t\t\t\t\tvar dr = (DynamicInvocationResolveResult)initializerResult.Result;\n\t\t\t\t\tvar constructor = (dr.Target as MethodGroupResolveResult).Methods.FirstOrDefault();\n\t\t\t\t\tif (constructor != null)\n\t\t\t\t\t\tinitializerType = constructor.DeclaringType;\n\t\t\t\t} else {\n\t\t\t\t\tinitializerType = initializerResult != null ? initializerResult.Result.Type : null;\n\t\t\t\t}\n\n\n\t\t\t\tif (initializerType != null && initializerType.Kind != TypeKind.Unknown) {\n\t\t\t\t\t// check 3 cases:\n\t\t\t\t\t// 1) New initalizer { xpr\n\t\t\t\t\t// 2) Object initializer { prop = val1, field = val2, xpr\n\t\t\t\t\t// 3) Array initializer { new Foo (), a, xpr\n\t\t\t\t\t// in case 1 all object/array initializer options should be given - in the others not.\n\n\t\t\t\t\tAstNode prev = null;\n\t\t\t\t\tif (parent.Elements.Count > 1) {\n\t\t\t\t\t\tprev = parent.Elements.First();\n\t\t\t\t\t\tif (prev is ArrayInitializerExpression && ((ArrayInitializerExpression)prev).IsSingleElement)\n\t\t\t\t\t\t\tprev = ((ArrayInitializerExpression)prev).Elements.FirstOrDefault();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (prev != null && !(prev is NamedExpression)) {\n\t\t\t\t\t\tAddContextCompletion(contextList, GetState(), n);\n\t\t\t\t\t\t// case 3)\n\t\t\t\t\t\treturn contextList.Result;\n\t\t\t\t\t}\n\t\t\t\t\tvar lookup = new MemberLookup(ctx.CurrentTypeDefinition, Compilation.MainAssembly);\n\t\t\t\t\tvar list = typeof(System.Collections.IList).ToTypeReference().Resolve(Compilation);\n\t\t\t\t\tvar list1 = typeof(System.Collections.Generic.IList<>).ToTypeReference().Resolve(Compilation);\n\t\t\t\t\tbool isProtectedAllowed = ctx.CurrentTypeDefinition != null && initializerType.GetDefinition() != null ? \n\t\t\t\t\t\tctx.CurrentTypeDefinition.IsDerivedFrom(initializerType.GetDefinition()) : \n\t\t\t\t\t\tfalse;\n\t\t\t\t\tforeach (var m in initializerType.GetMembers (m => m.SymbolKind == SymbolKind.Field)) {\n\t\t\t\t\t\tvar f = m as IField;\n\t\t\t\t\t\tif (f != null && (f.IsReadOnly || f.IsConst))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (lookup.IsAccessible(m, isProtectedAllowed)) {\n\t\t\t\t\t\t\tvar data = contextList.AddMember(m);\n\t\t\t\t\t\t\tif (data != null)\n\t\t\t\t\t\t\t\tdata.DisplayFlags |= DisplayFlags.NamedArgument;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (IProperty m in initializerType.GetMembers (m => m.SymbolKind == SymbolKind.Property)) {\n\t\t\t\t\t\tif (m.CanSet && lookup.IsAccessible(m.Setter, isProtectedAllowed)  || \n\t\t\t\t\t\t\tm.CanGet && lookup.IsAccessible(m.Getter, isProtectedAllowed) && m.ReturnType.GetDefinition() != null && \n\t\t\t\t\t\t\t(m.ReturnType.GetDefinition().IsDerivedFrom(list.GetDefinition()) || m.ReturnType.GetDefinition().IsDerivedFrom(list1.GetDefinition()))) {\n\t\t\t\t\t\t\tvar data = contextList.AddMember(m);\n\t\t\t\t\t\t\tif (data != null)\n\t\t\t\t\t\t\t\tdata.DisplayFlags |= DisplayFlags.NamedArgument;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (prev != null && (prev is NamedExpression)) {\n\t\t\t\t\t\t// case 2)\n\t\t\t\t\t\treturn contextList.Result;\n\t\t\t\t\t}\n\n\t\t\t\t\t// case 1)\n\n\t\t\t\t\t// check if the object is a list, if not only provide object initalizers\n\t\t\t\t\tif (initializerType.Kind != TypeKind.Array && list != null) {\n\t\t\t\t\t\tvar def = initializerType.GetDefinition(); \n\t\t\t\t\t\tif (def != null && !def.IsDerivedFrom(list.GetDefinition()) && !def.IsDerivedFrom(list1.GetDefinition()))\n\t\t\t\t\t\t\treturn contextList.Result;\n\t\t\t\t\t}\n\n\t\t\t\t\tAddContextCompletion(contextList, GetState(), n);\n\t\t\t\t\treturn contextList.Result;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic readonly DateTime curDate = DateTime.Now;\n\n\t\tIEnumerable<ICompletionData> GenerateNumberFormatitems(bool isFloatingPoint)\n\t\t{\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"D\", \"decimal\", 123);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"D5\", \"decimal\", 123);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"C\", \"currency\", 123);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"C0\", \"currency\", 123);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"E\", \"exponential\", 1.23E4);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"E2\", \"exponential\", 1.234);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"e2\", \"exponential\", 1.234);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"F\", \"fixed-point\", 123.45);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"F1\", \"fixed-point\", 123.45);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"G\", \"general\", 1.23E+56);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"g2\", \"general\", 1.23E+56);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"N\", \"number\", 12345.68);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"N1\", \"number\", 12345.68);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"P\", \"percent\", 12.34);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"P1\", \"percent\", 12.34);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"R\", \"round-trip\", 0.1230000001);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"X\", \"hexadecimal\", 1234);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"x8\", \"hexadecimal\", 1234);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"0000\", \"custom\", 123);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"####\", \"custom\", 123);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"##.###\", \"custom\", 1.23);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"##.000\", \"custom\", 1.23);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"## 'items'\", \"custom\", 12);\n\t\t}\n\n\t\tIEnumerable<ICompletionData> GenerateDateTimeFormatitems()\n\t\t{\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"D\", \"long date\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"d\", \"short date\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"F\", \"full date long\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"f\", \"full date short\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"G\", \"general long\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"g\", \"general short\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"M\", \"month\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"O\", \"ISO 8601\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"R\", \"RFC 1123\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"s\", \"sortable\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"T\", \"long time\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"t\", \"short time\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"U\", \"universal full\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"u\", \"universal sortable\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"Y\", \"year month\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"yy-MM-dd\", \"custom\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"yyyy MMMMM dd\", \"custom\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"yy-MMM-dd ddd\", \"custom\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"yyyy-M-d dddd\", \"custom\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"hh:mm:ss t z\", \"custom\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"hh:mm:ss tt zz\", \"custom\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"HH:mm:ss tt zz\", \"custom\", curDate);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"HH:m:s tt zz\", \"custom\", curDate);\n\n\t\t}\n\n\t\t[Flags]\n\t\tenum TestEnum\n\t\t{\n\t\t\tEnumCaseName = 0,\n\t\t\tFlag1 = 1,\n\t\t\tFlag2 = 2,\n\t\t\tFlags\n\n\t\t}\n\n\t\tIEnumerable<ICompletionData> GenerateEnumFormatitems()\n\t\t{\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"G\", \"string value\", TestEnum.EnumCaseName);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"F\", \"flags value\", TestEnum.Flags);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"D\", \"integer value\", TestEnum.Flags);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"X\", \"hexadecimal\", TestEnum.Flags);\n\t\t}\n\n\t\tIEnumerable<ICompletionData> GenerateTimeSpanFormatitems()\n\t\t{\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"c\", \"invariant\", new TimeSpan(0, 1, 23, 456));\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"G\", \"general long\", new TimeSpan(0, 1, 23, 456));\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"g\", \"general short\", new TimeSpan(0, 1, 23, 456));\n\t\t}\n\n\t\tstatic Guid defaultGuid = Guid.NewGuid();\n\n\t\tIEnumerable<ICompletionData> GenerateGuidFormatitems()\n\t\t{\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"N\", \"digits\", defaultGuid);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"D\", \"hypens\", defaultGuid);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"B\", \"braces\", defaultGuid);\n\t\t\tyield return factory.CreateFormatItemCompletionData(\"P\", \"parentheses\", defaultGuid);\n\t\t}\n\n\t\tint GetFormatItemNumber()\n\t\t{\n\t\t\tint number = 0;\n\t\t\tvar o = offset - 2;\n\t\t\twhile (o > 0) {\n\t\t\t\tchar ch = document.GetCharAt(o);\n\t\t\t\tif (ch == '{')\n\t\t\t\t\treturn number;\n\t\t\t\tif (!char.IsDigit(ch))\n\t\t\t\t\tbreak;\n\t\t\t\tnumber = number * 10 + ch - '0';\n\t\t\t\to--;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleStringFormatItems()\n\t\t{\n\t\t\tvar formatArgument = GetFormatItemNumber();\n\t\t\tif (formatArgument < 0)\n\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\tvar followUp = new StringBuilder();\n\n\t\t\tvar o = offset;\n\t\t\twhile (o < document.TextLength) {\n\t\t\t\tchar ch = document.GetCharAt(o);\n\t\t\t\tfollowUp.Append(ch); \n\t\t\t\to++;\n\t\t\t\tif (ch == ';')\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar unit = ParseStub(followUp.ToString(), false);\n\n\t\t\tvar invoke = unit.GetNodeAt<InvocationExpression>(location);\n\n\t\t\tif (invoke != null) {\n\t\t\t\tvar resolveResult = ResolveExpression(new ExpressionResult(invoke, unit));\n\t\t\t\tvar invokeResult = resolveResult.Result as InvocationResolveResult;\n\t\t\t\tif (invokeResult != null) {\n\t\t\t\t\tvar arg = formatArgument + 1; // First argument is the format string\n\t\t\t\t\tif (arg < invoke.Arguments.Count) {\n\t\t\t\t\t\tvar invokeArgument = ResolveExpression(new ExpressionResult(invoke.Arguments.ElementAt(arg), unit));\n\t\t\t\t\t\tif (invokeArgument != null) {\n\t\t\t\t\t\t\tvar provider = GetFormatCompletionData(invokeArgument.Result.Type);\n\t\t\t\t\t\t\tif (provider != null)\n\t\t\t\t\t\t\t\treturn provider;\n\t\t\t\t\t\t\tif (!invokeArgument.Result.Type.IsKnownType(KnownTypeCode.Object))\n\t\t\t\t\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn HandleStringFormatItemsFallback();\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleStringFormatItemsFallback()\n\t\t{\n\t\t\tvar unit = ParseStub(\"a}\\\");\", false);\n\n\t\t\tvar invoke = unit.GetNodeAt<InvocationExpression>(location);\n\n\t\t\tif (invoke == null)\n\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\n\t\t\tvar resolveResult = ResolveExpression(new ExpressionResult(invoke, unit));\n\t\t\tvar invokeResult = resolveResult.Result as CSharpInvocationResolveResult;\n\t\t\tif (invokeResult == null)\n\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\n\t\t\tExpression fmtArgumets;\n\t\t\tIList<Expression> args;\n\t\t\tif (FormatStringHelper.TryGetFormattingParameters(invokeResult, invoke, out fmtArgumets, out args, null)) {\n\t\t\t\treturn GenerateNumberFormatitems(false)\n\t\t\t\t\t.Concat(GenerateDateTimeFormatitems())\n\t\t\t\t\t.Concat(GenerateTimeSpanFormatitems())\n\t\t\t\t\t.Concat(GenerateEnumFormatitems())\n\t\t\t\t\t.Concat(GenerateGuidFormatitems());\n\t\t\t}\n\t\t\treturn Enumerable.Empty<ICompletionData>();\n\n\t\t}\n\n\t\tIEnumerable<ICompletionData> GetFormatCompletionData(IType type)\n\t\t{\n\t\t\tif (type.Namespace != \"System\")\n\t\t\t\treturn null;\n\t\t\tswitch (type.Name) {\n\t\t\t\tcase \"Int64\":\n\t\t\t\tcase \"UInt64\":\n\t\t\t\tcase \"Int32\":\n\t\t\t\tcase \"UInt32\":\n\t\t\t\tcase \"Int16\":\n\t\t\t\tcase \"UInt16\":\n\t\t\t\tcase \"Byte\":\n\t\t\t\tcase \"SByte\":\n\t\t\t\t\treturn GenerateNumberFormatitems(false);\n\t\t\t\tcase \"Single\":\n\t\t\t\tcase \"Double\":\n\t\t\t\tcase \"Decimal\":\n\t\t\t\t\treturn GenerateNumberFormatitems(true);\n\t\t\t\tcase \"Enum\":\n\t\t\t\t\treturn GenerateEnumFormatitems();\n\t\t\t\tcase \"DateTime\":\n\t\t\t\t\treturn GenerateDateTimeFormatitems();\n\t\t\t\tcase \"TimeSpan\":\n\t\t\t\t\treturn GenerateTimeSpanFormatitems();\n\t\t\t\tcase \"Guid\":\n\t\t\t\t\treturn GenerateGuidFormatitems();\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleToStringFormatItems()\n\t\t{\n\t\t\tvar unit = ParseStub(\"\\\");\", false);\n\n\t\t\tvar invoke = unit.GetNodeAt<InvocationExpression>(location);\n\t\t\tif (invoke == null)\n\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\n\t\t\tvar resolveResult = ResolveExpression(new ExpressionResult(invoke, unit));\n\t\t\tvar invokeResult = resolveResult.Result as InvocationResolveResult;\n\t\t\tif (invokeResult == null)\n\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\tif (invokeResult.Member.Name == \"ToString\")\n\t\t\t\treturn GetFormatCompletionData(invokeResult.Member.DeclaringType) ?? Enumerable.Empty<ICompletionData>();\n\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t}\n\n\t\tIEnumerable<ICompletionData> MagicKeyCompletion(char completionChar, bool controlSpace, out bool isComplete)\n\t\t{\n\t\t\tisComplete = false;\n\t\t\tExpressionResolveResult resolveResult;\n\t\t\tswitch (completionChar) {\n\t\t\t\t// Magic key completion\n\t\t\t\tcase ':':\n\t\t\t\t\tvar text = GetMemberTextToCaret();\n\t\t\t\t\tvar lexer = new MiniLexer(text.Item1);\n\t\t\t\t\tlexer.Parse();\n\t\t\t\t\tif (lexer.IsInSingleComment ||\n\t\t\t\t\t\tlexer.IsInChar ||\n\t\t\t\t\t\tlexer.IsInMultiLineComment ||\n\t\t\t\t\t\tlexer.IsInPreprocessorDirective) {\n\t\t\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (lexer.IsInString || lexer.IsInVerbatimString)\n\t\t\t\t\t\treturn HandleStringFormatItems();\n\t\t\t\t\treturn HandleMemberReferenceCompletion(GetExpressionBeforeCursor());\n\t\t\t\tcase '\"':\n\t\t\t\t\ttext = GetMemberTextToCaret();\n\t\t\t\t\tlexer = new MiniLexer(text.Item1);\n\t\t\t\t\tlexer.Parse();\n\t\t\t\t\tif (lexer.IsInSingleComment ||\n\t\t\t\t\t\tlexer.IsInChar ||\n\t\t\t\t\t\tlexer.IsInMultiLineComment ||\n\t\t\t\t\t\tlexer.IsInPreprocessorDirective) {\n\t\t\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (lexer.IsInString || lexer.IsInVerbatimString)\n\t\t\t\t\t\treturn HandleToStringFormatItems();\n\t\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\t\tcase '.':\n\t\t\t\t\tif (IsInsideCommentStringOrDirective()) {\n\t\t\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\t\t\t}\n\t\t\t\t\treturn HandleMemberReferenceCompletion(GetExpressionBeforeCursor());\n\t\t\t\tcase '#':\n\t\t\t\t\tif (!IsInPreprocessorDirective())\n\t\t\t\t\t\treturn null;\n\t\t\t\t\treturn GetDirectiveCompletionData();\n\t\t\t\t\t// XML doc completion\n\t\t\t\tcase '<':\n\t\t\t\t\tif (IsInsideDocComment()) {\n\t\t\t\t\t\treturn GetXmlDocumentationCompletionData();\n\t\t\t\t\t}\n\t\t\t\t\tif (controlSpace) {\n\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete);\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\tcase '>':\n\t\t\t\t\tif (!IsInsideDocComment()) {\n\t\t\t\t\t\tif (offset > 2 && document.GetCharAt(offset - 2) == '-' && !IsInsideCommentStringOrDirective()) {\n\t\t\t\t\t\t\treturn HandleMemberReferenceCompletion(GetExpressionBeforeCursor());\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\n\t\t\t\t\t// Parameter completion\n\t\t\t\tcase '(':\n\t\t\t\t\tif (IsInsideCommentStringOrDirective()) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar invoke = GetInvocationBeforeCursor(true);\n\t\t\t\t\tif (invoke == null) {\n\t\t\t\t\t\tif (controlSpace)\n\t\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete, invoke);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (invoke.Node is TypeOfExpression) {\n\t\t\t\t\t\treturn CreateTypeList();\n\t\t\t\t\t}\n\t\t\t\t\tvar invocationResult = ResolveExpression(invoke);\n\t\t\t\t\tif (invocationResult == null) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar methodGroup = invocationResult.Result as MethodGroupResolveResult;\n\t\t\t\t\tif (methodGroup != null) {\n\t\t\t\t\t\treturn CreateParameterCompletion(\n\t\t\t\t\t\t\tmethodGroup,\n\t\t\t\t\t\t\tinvocationResult.Resolver,\n\t\t\t\t\t\t\tinvoke.Node,\n\t\t\t\t\t\t\tinvoke.Unit,\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\tcontrolSpace\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (controlSpace) {\n\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete, invoke);\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\tcase '=':\n\t\t\t\t\treturn controlSpace ? DefaultControlSpaceItems(ref isComplete) : null;\n\t\t\t\tcase ',':\n\t\t\t\t\tint cpos2;\n\t\t\t\t\tif (!GetParameterCompletionCommandOffset(out cpos2)) { \n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\t//\tcompletionContext = CompletionWidget.CreateCodeCompletionContext (cpos2);\n\t\t\t\t\t//\tint currentParameter2 = MethodParameterDataProvider.GetCurrentParameterIndex (CompletionWidget, completionContext) - 1;\n\t\t\t\t\t//\t\t\t\treturn CreateParameterCompletion (CreateResolver (), location, ExpressionContext.MethodBody, provider.Methods, currentParameter);\t\n\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Completion on space:\n\t\t\t\tcase ' ':\n\t\t\t\t\tint tokenIndex = offset;\n\t\t\t\t\tstring token = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\tif (IsInsideCommentStringOrDirective()) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\t// check propose name, for context <variable name> <ctrl+space> (but only in control space context)\n\t\t\t\t\t//IType isAsType = null;\n\t\t\t\t\tvar isAsExpression = GetExpressionAt(offset);\n\t\t\t\t\tif (controlSpace && isAsExpression != null && isAsExpression.Node is VariableDeclarationStatement && token != \"new\") {\n\t\t\t\t\t\tvar parent = isAsExpression.Node as VariableDeclarationStatement;\n\t\t\t\t\t\tvar proposeNameList = new CompletionDataWrapper(this);\n\t\t\t\t\t\tif (parent.Variables.Count != 1)\n\t\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete, isAsExpression, controlSpace);\n\n\t\t\t\t\t\tforeach (var possibleName in GenerateNameProposals (parent.Type)) {\n\t\t\t\t\t\t\tif (possibleName.Length > 0) {\n\t\t\t\t\t\t\t\tproposeNameList.Result.Add(factory.CreateLiteralCompletionData(possibleName.ToString()));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tAutoSelect = false;\n\t\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t\t\tisComplete = true;\n\t\t\t\t\t\treturn proposeNameList.Result;\n\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\tint tokenIndex = offset;\n\t\t\t\t\t//\t\t\t\tstring token = GetPreviousToken (ref tokenIndex, false);\n\t\t\t\t\t//\t\t\t\tif (result.ExpressionContext == ExpressionContext.ObjectInitializer) {\n\t\t\t\t\t//\t\t\t\t\tresolver = CreateResolver ();\n\t\t\t\t\t//\t\t\t\t\tExpressionContext exactContext = new NewCSharpExpressionFinder (dom).FindExactContextForObjectInitializer (document, resolver.Unit, Document.FileName, resolver.CallingType);\n\t\t\t\t\t//\t\t\t\t\tIReturnType objectInitializer = ((ExpressionContext.TypeExpressionContext)exactContext).UnresolvedType;\n\t\t\t\t\t//\t\t\t\t\tif (objectInitializer != null && objectInitializer.ArrayDimensions == 0 && objectInitializer.PointerNestingLevel == 0 && (token == \"{\" || token == \",\"))\n\t\t\t\t\t//\t\t\t\t\t\treturn CreateCtrlSpaceCompletionData (completionContext, result); \n\t\t\t\t\t//\t\t\t\t}\n\t\t\t\t\tif (token == \"=\") {\n\t\t\t\t\t\tint j = tokenIndex;\n\t\t\t\t\t\tstring prevToken = GetPreviousToken(ref j, false);\n\t\t\t\t\t\tif (prevToken == \"=\" || prevToken == \"+\" || prevToken == \"-\" || prevToken == \"!\") {\n\t\t\t\t\t\t\ttoken = prevToken + token;\n\t\t\t\t\t\t\ttokenIndex = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tswitch (token) {\n\t\t\t\t\t\tcase \"(\":\n\t\t\t\t\t\tcase \",\":\n\t\t\t\t\t\t\tint cpos;\n\t\t\t\t\t\t\tif (!GetParameterCompletionCommandOffset(out cpos)) { \n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tint currentParameter = GetCurrentParameterIndex(cpos - 1, this.offset) - 1;\n\t\t\t\t\t\t\tif (currentParameter < 0) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinvoke = GetInvocationBeforeCursor(token == \"(\");\n\t\t\t\t\t\t\tif (invoke == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinvocationResult = ResolveExpression(invoke);\n\t\t\t\t\t\t\tif (invocationResult == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmethodGroup = invocationResult.Result as MethodGroupResolveResult;\n\t\t\t\t\t\t\tif (methodGroup != null) {\n\t\t\t\t\t\t\t\treturn CreateParameterCompletion(\n\t\t\t\t\t\t\t\t\tmethodGroup,\n\t\t\t\t\t\t\t\t\tinvocationResult.Resolver,\n\t\t\t\t\t\t\t\t\tinvoke.Node,\n\t\t\t\t\t\t\t\t\tinvoke.Unit,\n\t\t\t\t\t\t\t\t\tcurrentParameter,\n\t\t\t\t\t\t\t\t\tcontrolSpace);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tcase \"=\":\n\t\t\t\t\t\tcase \"==\":\n\t\t\t\t\t\tcase \"!=\":\n\t\t\t\t\t\t\tGetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\t\t\tvar expressionOrVariableDeclaration = GetExpressionAt(tokenIndex);\n\t\t\t\t\t\t\tif (expressionOrVariableDeclaration == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresolveResult = ResolveExpression(expressionOrVariableDeclaration);\n\t\t\t\t\t\t\tif (resolveResult == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (resolveResult.Result.Type.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\t\t\t\t\t\tAddContextCompletion(\n\t\t\t\t\t\t\t\t\twrapper,\n\t\t\t\t\t\t\t\t\tresolveResult.Resolver,\n\t\t\t\t\t\t\t\t\texpressionOrVariableDeclaration.Node);\n\t\t\t\t\t\t\t\tAddEnumMembers(wrapper, resolveResult.Result.Type, resolveResult.Resolver);\n\t\t\t\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t\t\t\t\treturn wrapper.Result;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//\t\t\t\t\n\t\t\t\t\t\t\t//\t\t\t\t\tif (resolvedType.FullName == DomReturnType.Bool.FullName) {\n\t\t\t\t\t\t\t//\t\t\t\t\t\tCompletionDataList completionList = new ProjectDomCompletionDataList ();\n\t\t\t\t\t\t\t//\t\t\t\t\t\tCompletionDataCollector cdc = new CompletionDataCollector (this, dom, completionList, Document.CompilationUnit, resolver.CallingType, location);\n\t\t\t\t\t\t\t//\t\t\t\t\t\tcompletionList.AutoCompleteEmptyMatch = false;\n\t\t\t\t\t\t\t//\t\t\t\t\t\tcdc.Add (\"true\", \"md-keyword\");\n\t\t\t\t\t\t\t//\t\t\t\t\t\tcdc.Add (\"false\", \"md-keyword\");\n\t\t\t\t\t\t\t//\t\t\t\t\t\tresolver.AddAccessibleCodeCompletionData (result.ExpressionContext, cdc);\n\t\t\t\t\t\t\t//\t\t\t\t\t\treturn completionList;\n\t\t\t\t\t\t\t//\t\t\t\t\t}\n\t\t\t\t\t\t\t//\t\t\t\t\tif (resolvedType.ClassType == ClassType.Delegate && token == \"=\") {\n\t\t\t\t\t\t\t//\t\t\t\t\t\tCompletionDataList completionList = new ProjectDomCompletionDataList ();\n\t\t\t\t\t\t\t//\t\t\t\t\t\tstring parameterDefinition = AddDelegateHandlers (completionList, resolvedType);\n\t\t\t\t\t\t\t//\t\t\t\t\t\tstring varName = GetPreviousMemberReferenceExpression (tokenIndex);\n\t\t\t\t\t\t\t//\t\t\t\t\t\tcompletionList.Add (new EventCreationCompletionData (document, varName, resolvedType, null, parameterDefinition, resolver.CallingMember, resolvedType));\n\t\t\t\t\t\t\t//\t\t\t\t\t\t\n\t\t\t\t\t\t\t//\t\t\t\t\t\tCompletionDataCollector cdc = new CompletionDataCollector (this, dom, completionList, Document.CompilationUnit, resolver.CallingType, location);\n\t\t\t\t\t\t\t//\t\t\t\t\t\tresolver.AddAccessibleCodeCompletionData (result.ExpressionContext, cdc);\n\t\t\t\t\t\t\t//\t\t\t\t\t\tforeach (var data in completionList) {\n\t\t\t\t\t\t\t//\t\t\t\t\t\t\tif (data is MemberCompletionData) \n\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t((MemberCompletionData)data).IsDelegateExpected = true;\n\t\t\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//\t\t\t\t\t\treturn completionList;\n\t\t\t\t\t\t\t//\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tcase \"+=\":\n\t\t\t\t\t\tcase \"-=\":\n\t\t\t\t\t\t\tvar curTokenIndex = tokenIndex;\n\t\t\t\t\t\t\tGetPreviousToken(ref tokenIndex, false);\n\n\t\t\t\t\t\t\texpressionOrVariableDeclaration = GetExpressionAt(tokenIndex);\n\t\t\t\t\t\t\tif (expressionOrVariableDeclaration == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolveResult = ResolveExpression(expressionOrVariableDeclaration);\n\t\t\t\t\t\t\tif (resolveResult == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tvar mrr = resolveResult.Result as MemberResolveResult;\n\t\t\t\t\t\t\tif (mrr != null) {\n\t\t\t\t\t\t\t\tvar evt = mrr.Member as IEvent;\n\t\t\t\t\t\t\t\tif (evt == null) {\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar delegateType = evt.ReturnType;\n\t\t\t\t\t\t\t\tif (delegateType.Kind != TypeKind.Delegate) {\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\t\t\t\t\t\tif (currentType != null) {\n\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\tbool includeProtected = DomType.IncludeProtected (dom, typeFromDatabase, resolver.CallingType);\n\t\t\t\t\t\t\t\t\tforeach (var method in ctx.CurrentTypeDefinition.Methods) {\n\t\t\t\t\t\t\t\t\t\tif (MatchDelegate(delegateType, method) /*\t\t\t\t\t\t\t\t\t\t&& method.IsAccessibleFrom (dom, resolver.CallingType, resolver.CallingMember, includeProtected) &&*/) {\n\t\t\t\t\t\t\t\t\t\t\twrapper.AddMember(method);\n\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\tdata.SetText (data.CompletionText + \";\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (token == \"+=\") {\n\t\t\t\t\t\t\t\t\tstring parameterDefinition = AddDelegateHandlers(\n\t\t\t\t\t\t\t\t\t\twrapper,\n\t\t\t\t\t\t\t\t\t\tdelegateType,\n\t\t\t\t\t\t\t\t\t\toptDelegateName: GuessEventHandlerMethodName(curTokenIndex)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn wrapper.Result;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tcase \":\":\n\t\t\t\t\t\t\tif (currentMember == null) {\n\t\t\t\t\t\t\t\ttoken = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\t\t\t\ttoken = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\t\t\t\tif (token == \"enum\")\n\t\t\t\t\t\t\t\t\treturn HandleEnumContext();\n\t\t\t\t\t\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\t\t\t\t\t\tAddTypesAndNamespaces(\n\t\t\t\t\t\t\t\t\twrapper,\n\t\t\t\t\t\t\t\t\tGetState(),\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tt =>  {\n\t\t\t\t\t\t\t\t\t\tif (currentType != null && currentType.ReflectionName.Equals(t.ReflectionName))\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\tvar def = t.GetDefinition();\n\t\t\t\t\t\t\t\t\t\tif (def != null && t.Kind != TypeKind.Interface && (def.IsSealed ||def.IsStatic))\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\treturn t;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn wrapper.Result;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar keywordCompletion = HandleKeywordCompletion(tokenIndex, token);\n\t\t\t\t\tif (keywordCompletion == null && controlSpace) {\n\t\t\t\t\t\tgoto default;\n\t\t\t\t\t}\n\t\t\t\t\treturn keywordCompletion;\n\t\t\t\t\t// Automatic completion\n\t\t\t\tdefault:\n\t\t\t\t\tif (IsInsideCommentStringOrDirective()) {\n\t\t\t\t\t\ttokenIndex = offset;\n\t\t\t\t\t\ttoken = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\t\tif (IsInPreprocessorDirective() && (token.Length == 1 && char.IsLetter(completionChar) || controlSpace)) {\n\t\t\t\t\t\t\twhile (token != null && document.GetCharAt(tokenIndex - 1) != '#') {\n\t\t\t\t\t\t\t\ttoken = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (token != null)\n\t\t\t\t\t\t\t\treturn HandleKeywordCompletion(tokenIndex, token);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tchar prevCh = offset > 2 ? document.GetCharAt(offset - 2) : ';';\n\t\t\t\t\tchar nextCh = offset < document.TextLength ? document.GetCharAt(offset) : ' ';\n\t\t\t\t\tconst string allowedChars = \";,.[](){}+-*/%^?:&|~!<>=\";\n\n\t\t\t\t\tif ((!Char.IsWhiteSpace(nextCh) && allowedChars.IndexOf(nextCh) < 0) || !(Char.IsWhiteSpace(prevCh) || allowedChars.IndexOf(prevCh) >= 0)) {\n\t\t\t\t\t\tif (!controlSpace)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (IsInLinqContext(offset)) {\n\t\t\t\t\t\tif (!controlSpace && !(char.IsLetter(completionChar) || completionChar == '_')) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttokenIndex = offset;\n\t\t\t\t\t\ttoken = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\t\t// token last typed\n\t\t\t\t\t\tif (!char.IsWhiteSpace(completionChar) && !linqKeywords.Contains(token)) {\n\t\t\t\t\t\t\ttoken = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// token last typed\n\n\t\t\t\t\t\tif (linqKeywords.Contains(token)) {\n\t\t\t\t\t\t\tif (token == \"from\") {\n\t\t\t\t\t\t\t\t// after from no auto code completion.\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar dataList = new CompletionDataWrapper(this);\n\t\t\t\t\t\tAddKeywords(dataList, linqKeywords);\n\t\t\t\t\t\treturn dataList.Result;\n\t\t\t\t\t}\n\t\t\t\t\tif (currentType != null && currentType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\tif (!char.IsLetter(completionChar))\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\treturn HandleEnumContext();\n\t\t\t\t\t}\n\t\t\t\t\tvar contextList = new CompletionDataWrapper(this);\n\t\t\t\t\tvar identifierStart = GetExpressionAtCursor();\n\t\t\t\t\tif (!(char.IsLetter(completionChar) || completionChar == '_') && (!controlSpace || identifierStart == null)) {\n\t\t\t\t\t\treturn controlSpace ? HandleAccessorContext() ?? DefaultControlSpaceItems(ref isComplete, identifierStart) : null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (identifierStart != null) {\n\t\t\t\t\t\tif (identifierStart.Node is TypeParameterDeclaration) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (identifierStart.Node is MemberReferenceExpression) {\n\t\t\t\t\t\t\treturn HandleMemberReferenceCompletion(\n\t\t\t\t\t\t\t\tnew ExpressionResult(\n\t\t\t\t\t\t\t\t\t((MemberReferenceExpression)identifierStart.Node).Target,\n\t\t\t\t\t\t\t\t\tidentifierStart.Unit\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (identifierStart.Node is Identifier) {\n\t\t\t\t\t\t\tif (identifierStart.Node.Parent is GotoStatement)\n\t\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t\t// May happen in variable names\n\t\t\t\t\t\t\treturn controlSpace ? DefaultControlSpaceItems(ref isComplete, identifierStart) : null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (identifierStart.Node is VariableInitializer && location <= ((VariableInitializer)identifierStart.Node).NameToken.EndLocation) {\n\t\t\t\t\t\t\treturn controlSpace ? HandleAccessorContext() ?? DefaultControlSpaceItems(ref isComplete, identifierStart) : null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (identifierStart.Node is CatchClause) {\n\t\t\t\t\t\t\tif (((CatchClause)identifierStart.Node).VariableNameToken.IsInside(location)) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (identifierStart.Node is AstType && identifierStart.Node.Parent is CatchClause) {\n\t\t\t\t\t\t\treturn HandleCatchClauseType(identifierStart);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar pDecl = identifierStart.Node as ParameterDeclaration;\n\t\t\t\t\t\tif (pDecl != null && pDecl.Parent is LambdaExpression) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// Do not pop up completion on identifier identifier (should be handled by keyword completion).\n\t\t\t\t\ttokenIndex = offset - 1;\n\t\t\t\t\ttoken = GetPreviousToken(ref tokenIndex, false);\n\t\t\t\t\tif (token == \"class\" || token == \"interface\" || token == \"struct\" || token == \"enum\" || token == \"namespace\") {\n\t\t\t\t\t\t// after these always follows a name\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar keywordresult = HandleKeywordCompletion(tokenIndex, token);\n\t\t\t\t\tif (keywordresult != null) {\n\t\t\t\t\t\treturn keywordresult;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((!Char.IsWhiteSpace(nextCh) && allowedChars.IndexOf(nextCh) < 0) || !(Char.IsWhiteSpace(prevCh) || allowedChars.IndexOf(prevCh) >= 0)) {\n\t\t\t\t\t\tif (controlSpace)\n\t\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete, identifierStart);\n\t\t\t\t\t}\n\n\t\t\t\t\tint prevTokenIndex = tokenIndex;\n\t\t\t\t\tvar prevToken2 = GetPreviousToken(ref prevTokenIndex, false);\n\t\t\t\t\tif (prevToken2 == \"delegate\") {\n\t\t\t\t\t\t// after these always follows a name\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (identifierStart == null && !string.IsNullOrEmpty(token) && !IsInsideCommentStringOrDirective() && (prevToken2 == \";\" || prevToken2 == \"{\" || prevToken2 == \"}\")) {\n\t\t\t\t\t\tchar last = token [token.Length - 1];\n\t\t\t\t\t\tif (char.IsLetterOrDigit(last) || last == '_' || token == \">\") {\n\t\t\t\t\t\t\treturn HandleKeywordCompletion(tokenIndex, token);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (identifierStart == null) {\n\t\t\t\t\t\tvar accCtx = HandleAccessorContext();\n\t\t\t\t\t\tif (accCtx != null) {\n\t\t\t\t\t\t\treturn accCtx;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete, null, controlSpace);\n\t\t\t\t\t}\n\t\t\t\t\tCSharpResolver csResolver;\n\t\t\t\t\tAstNode n = identifierStart.Node;\n\t\t\t\t\tif (n.Parent is NamedArgumentExpression)\n\t\t\t\t\t\tn = n.Parent;\n\n\t\t\t\t\tif (n != null && n.Parent is AnonymousTypeCreateExpression) {\n\t\t\t\t\t\tAutoSelect = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// new { b$ } \n\t\t\t\t\tif (n is IdentifierExpression && n.Parent is AnonymousTypeCreateExpression)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t// Handle foreach (type name _\n\t\t\t\t\tif (n is IdentifierExpression) {\n\t\t\t\t\t\tvar prev = n.GetPrevNode() as ForeachStatement;\n\t\t\t\t\t\twhile (prev != null && prev.EmbeddedStatement is ForeachStatement)\n\t\t\t\t\t\t\tprev = (ForeachStatement)prev.EmbeddedStatement;\n\t\t\t\t\t\tif (prev != null && prev.InExpression.IsNull) {\n\t\t\t\t\t\t\tif (IncludeKeywordsInCompletionList)\n\t\t\t\t\t\t\t\tcontextList.AddCustom(\"in\");\n\t\t\t\t\t\t\treturn contextList.Result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Handle object/enumerable initialzer expressions: \"new O () { P$\"\n\t\t\t\t\tif (n is IdentifierExpression && n.Parent is ArrayInitializerExpression && !(n.Parent.Parent is ArrayCreateExpression)) {\n\t\t\t\t\t\tvar result = HandleObjectInitializer(identifierStart.Unit, n);\n\t\t\t\t\t\tif (result != null)\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (n != null && n.Parent is InvocationExpression ||\n\t\t\t\t\t\tn.Parent is ParenthesizedExpression && n.Parent.Parent is InvocationExpression) {\n\t\t\t\t\t\tif (n.Parent is ParenthesizedExpression)\n\t\t\t\t\t\t\tn = n.Parent;\n\t\t\t\t\t\tvar invokeParent = (InvocationExpression)n.Parent;\n\t\t\t\t\t\tvar invokeResult = ResolveExpression(\n\t\t\t\t\t\t\tinvokeParent.Target\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar mgr = invokeResult != null ? invokeResult.Result as MethodGroupResolveResult : null;\n\t\t\t\t\t\tif (mgr != null) {\n\t\t\t\t\t\t\tint idx = 0;\n\t\t\t\t\t\t\tforeach (var arg in invokeParent.Arguments) {\n\t\t\t\t\t\t\t\tif (arg == n) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tidx++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach (var method in mgr.Methods) {\n\t\t\t\t\t\t\t\tif (idx < method.Parameters.Count && method.Parameters [idx].Type.Kind == TypeKind.Delegate) {\n\t\t\t\t\t\t\t\t\tAutoSelect = false;\n\t\t\t\t\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforeach (var p in method.Parameters) {\n\t\t\t\t\t\t\t\t\tcontextList.AddNamedParameterVariable(p);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tidx++;\n\t\t\t\t\t\t\tforeach (var list in mgr.GetEligibleExtensionMethods (true)) {\n\t\t\t\t\t\t\t\tforeach (var method in list) {\n\t\t\t\t\t\t\t\t\tif (idx < method.Parameters.Count && method.Parameters [idx].Type.Kind == TypeKind.Delegate) {\n\t\t\t\t\t\t\t\t\t\tAutoSelect = false;\n\t\t\t\t\t\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (n != null && n.Parent is ObjectCreateExpression) {\n\t\t\t\t\t\tvar invokeResult = ResolveExpression(n.Parent);\n\t\t\t\t\t\tvar mgr = invokeResult != null ? invokeResult.Result as ResolveResult : null;\n\t\t\t\t\t\tif (mgr != null) {\n\t\t\t\t\t\t\tforeach (var constructor in mgr.Type.GetConstructors ()) {\n\t\t\t\t\t\t\t\tforeach (var p in constructor.Parameters) {\n\t\t\t\t\t\t\t\t\tcontextList.AddVariable(p);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (n is IdentifierExpression) {\n\t\t\t\t\t\tvar bop = n.Parent as BinaryOperatorExpression;\n\t\t\t\t\t\tExpression evaluationExpr = null;\n\n\t\t\t\t\t\tif (bop != null && bop.Right == n && (bop.Operator == BinaryOperatorType.Equality || bop.Operator == BinaryOperatorType.InEquality)) {\n\t\t\t\t\t\t\tevaluationExpr = bop.Left;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// check for compare to enum case \n\t\t\t\t\t\tif (evaluationExpr != null) {\n\t\t\t\t\t\t\tresolveResult = ResolveExpression(evaluationExpr);\n\t\t\t\t\t\t\tif (resolveResult != null && resolveResult.Result.Type.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\t\t\t\t\t\tAddContextCompletion(\n\t\t\t\t\t\t\t\t\twrapper,\n\t\t\t\t\t\t\t\t\tresolveResult.Resolver,\n\t\t\t\t\t\t\t\t\tevaluationExpr\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tAddEnumMembers(wrapper, resolveResult.Result.Type, resolveResult.Resolver);\n\t\t\t\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t\t\t\t\treturn wrapper.Result;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (n is Identifier && n.Parent is ForeachStatement) {\n\t\t\t\t\t\tif (controlSpace) {\n\t\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (n is ArrayInitializerExpression) {\n\t\t\t\t\t\t// check for new [] {...} expression -> no need to resolve the type there\n\t\t\t\t\t\tvar parent = n.Parent as ArrayCreateExpression;\n\t\t\t\t\t\tif (parent != null && parent.Type.IsNull) {\n\t\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar initalizerResult = ResolveExpression(n.Parent);\n\n\t\t\t\t\t\tvar concreteNode = identifierStart.Unit.GetNodeAt<IdentifierExpression>(location);\n\t\t\t\t\t\t// check if we're on the right side of an initializer expression\n\t\t\t\t\t\tif (concreteNode != null && concreteNode.Parent != null && concreteNode.Parent.Parent != null && concreteNode.Identifier != \"a\" && concreteNode.Parent.Parent is NamedExpression) {\n\t\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (initalizerResult != null && initalizerResult.Result.Type.Kind != TypeKind.Unknown) { \n\n\t\t\t\t\t\t\tforeach (var property in initalizerResult.Result.Type.GetProperties ()) {\n\t\t\t\t\t\t\t\tif (!property.IsPublic) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar data = contextList.AddMember(property);\n\t\t\t\t\t\t\t\tif (data != null)\n\t\t\t\t\t\t\t\t\tdata.DisplayFlags |= DisplayFlags.NamedArgument;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach (var field in initalizerResult.Result.Type.GetFields ()) {       \n\t\t\t\t\t\t\t\tif (!field.IsPublic) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar data = contextList.AddMember(field);\n\t\t\t\t\t\t\t\tif (data != null)\n\t\t\t\t\t\t\t\t\tdata.DisplayFlags |= DisplayFlags.NamedArgument;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn contextList.Result;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn DefaultControlSpaceItems(ref isComplete);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (IsAttributeContext(n)) {\n\t\t\t\t\t\t// add attribute targets\n\t\t\t\t\t\tif (currentType == null) {\n\t\t\t\t\t\t\tcontextList.AddCustom(\"assembly\");\n\t\t\t\t\t\t\tcontextList.AddCustom(\"module\");\n\t\t\t\t\t\t\tcontextList.AddCustom(\"type\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontextList.AddCustom(\"param\");\n\t\t\t\t\t\t\tcontextList.AddCustom(\"field\");\n\t\t\t\t\t\t\tcontextList.AddCustom(\"property\");\n\t\t\t\t\t\t\tcontextList.AddCustom(\"method\");\n\t\t\t\t\t\t\tcontextList.AddCustom(\"event\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontextList.AddCustom(\"return\");\n\t\t\t\t\t}\n\t\t\t\t\tif (n is MemberType) {\n\t\t\t\t\t\tresolveResult = ResolveExpression(\n\t\t\t\t\t\t\t((MemberType)n).Target\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn CreateTypeAndNamespaceCompletionData(\n\t\t\t\t\t\t\tlocation,\n\t\t\t\t\t\t\tresolveResult.Result,\n\t\t\t\t\t\t\t((MemberType)n).Target,\n\t\t\t\t\t\t\tresolveResult.Resolver\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (n != null/*\t\t\t\t\t && !(identifierStart.Item2 is TypeDeclaration)*/) {\n\t\t\t\t\t\tcsResolver = new CSharpResolver(ctx);\n\t\t\t\t\t\tvar nodes = new List<AstNode>();\n\t\t\t\t\t\tnodes.Add(n);\n\t\t\t\t\t\tif (n.Parent is ICSharpCode.NRefactory.CSharp.Attribute) {\n\t\t\t\t\t\t\tnodes.Add(n.Parent);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar astResolver = CompletionContextProvider.GetResolver(csResolver, identifierStart.Unit);\n\t\t\t\t\t\tastResolver.ApplyNavigator(new NodeListResolveVisitorNavigator(nodes));\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcsResolver = astResolver.GetResolverStateBefore(n);\n\t\t\t\t\t\t} catch (Exception) {\n\t\t\t\t\t\t\tcsResolver = GetState();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// add attribute properties.\n\t\t\t\t\t\tif (n.Parent is ICSharpCode.NRefactory.CSharp.Attribute) {\n\t\t\t\t\t\t\tvar rr = ResolveExpression(n.Parent);\n\t\t\t\t\t\t\tif (rr != null)\n\t\t\t\t\t\t\t\tAddAttributeProperties(contextList, rr.Result);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcsResolver = GetState();\n\t\t\t\t\t}\n\t\t\t\t\t// identifier has already started with the first letter\n\t\t\t\t\toffset--;\n\t\t\t\t\tAddContextCompletion(\n\t\t\t\t\t\tcontextList,\n\t\t\t\t\t\tcsResolver,\n\t\t\t\t\t\tidentifierStart.Node\n\t\t\t\t\t);\n\t\t\t\t\treturn contextList.Result;\n\t\t\t\t\t//\t\t\t\tif (stub.Parent is BlockStatement)\n\n\t\t\t\t\t//\t\t\t\tresult = FindExpression (dom, completionContext, -1);\n\t\t\t\t\t//\t\t\t\tif (result == null)\n\t\t\t\t\t//\t\t\t\t\treturn null;\n\t\t\t\t\t//\t\t\t\t else if (result.ExpressionContext != ExpressionContext.IdentifierExpected) {\n\t\t\t\t\t//\t\t\t\t\ttriggerWordLength = 1;\n\t\t\t\t\t//\t\t\t\t\tbool autoSelect = true;\n\t\t\t\t\t//\t\t\t\t\tIType returnType = null;\n\t\t\t\t\t//\t\t\t\t\tif ((prevCh == ',' || prevCh == '(') && GetParameterCompletionCommandOffset (out cpos)) {\n\t\t\t\t\t//\t\t\t\t\t\tctx = CompletionWidget.CreateCodeCompletionContext (cpos);\n\t\t\t\t\t//\t\t\t\t\t\tNRefactoryParameterDataProvider dataProvider = ParameterCompletionCommand (ctx) as NRefactoryParameterDataProvider;\n\t\t\t\t\t//\t\t\t\t\t\tif (dataProvider != null) {\n\t\t\t\t\t//\t\t\t\t\t\t\tint i = dataProvider.GetCurrentParameterIndex (CompletionWidget, ctx) - 1;\n\t\t\t\t\t//\t\t\t\t\t\t\tforeach (var method in dataProvider.Methods) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\tif (i < method.Parameters.Count) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\treturnType = dom.GetType (method.Parameters [i].ReturnType);\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tautoSelect = returnType == null || returnType.ClassType != ClassType.Delegate;\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t//\t\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t// Bug 677531 - Auto-complete doesn't always highlight generic parameter in method signature\n\t\t\t\t\t//\t\t\t\t\t//if (result.ExpressionContext == ExpressionContext.TypeName)\n\t\t\t\t\t//\t\t\t\t\t//\tautoSelect = false;\n\t\t\t\t\t//\t\t\t\t\tCompletionDataList dataList = CreateCtrlSpaceCompletionData (completionContext, result);\n\t\t\t\t\t//\t\t\t\t\tAddEnumMembers (dataList, returnType);\n\t\t\t\t\t//\t\t\t\t\tdataList.AutoSelect = autoSelect;\n\t\t\t\t\t//\t\t\t\t\treturn dataList;\n\t\t\t\t\t//\t\t\t\t} else {\n\t\t\t\t\t//\t\t\t\t\tresult = FindExpression (dom, completionContext, 0);\n\t\t\t\t\t//\t\t\t\t\ttokenIndex = offset;\n\t\t\t\t\t//\t\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\t// check foreach case, unfortunately the expression finder is too dumb to handle full type names\n\t\t\t\t\t//\t\t\t\t\t// should be overworked if the expression finder is replaced with a mcs ast based analyzer.\n\t\t\t\t\t//\t\t\t\t\tvar possibleForeachToken = GetPreviousToken (ref tokenIndex, false); // starting letter\n\t\t\t\t\t//\t\t\t\t\tpossibleForeachToken = GetPreviousToken (ref tokenIndex, false); // varname\n\t\t\t\t\t//\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\t// read return types to '(' token\n\t\t\t\t\t//\t\t\t\t\tpossibleForeachToken = GetPreviousToken (ref tokenIndex, false); // varType\n\t\t\t\t\t//\t\t\t\t\tif (possibleForeachToken == \">\") {\n\t\t\t\t\t//\t\t\t\t\t\twhile (possibleForeachToken != null && possibleForeachToken != \"(\") {\n\t\t\t\t\t//\t\t\t\t\t\t\tpossibleForeachToken = GetPreviousToken (ref tokenIndex, false);\n\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t} else {\n\t\t\t\t\t//\t\t\t\t\t\tpossibleForeachToken = GetPreviousToken (ref tokenIndex, false); // (\n\t\t\t\t\t//\t\t\t\t\t\tif (possibleForeachToken == \".\")\n\t\t\t\t\t//\t\t\t\t\t\t\twhile (possibleForeachToken != null && possibleForeachToken != \"(\")\n\t\t\t\t\t//\t\t\t\t\t\t\t\tpossibleForeachToken = GetPreviousToken (ref tokenIndex, false);\n\t\t\t\t\t//\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\tpossibleForeachToken = GetPreviousToken (ref tokenIndex, false); // foreach\n\t\t\t\t\t//\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\tif (possibleForeachToken == \"foreach\") {\n\t\t\t\t\t//\t\t\t\t\t\tresult.ExpressionContext = ExpressionContext.ForeachInToken;\n\t\t\t\t\t//\t\t\t\t\t} else {\n\t\t\t\t\t//\t\t\t\t\t\treturn null;\n\t\t\t\t\t//\t\t\t\t\t\t//\t\t\t\t\t\t\t\tresult.ExpressionContext = ExpressionContext.IdentifierExpected;\n\t\t\t\t\t//\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\tresult.Expression = \"\";\n\t\t\t\t\t//\t\t\t\t\tresult.Region = DomRegion.Empty;\n\t\t\t\t\t//\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\treturn CreateCtrlSpaceCompletionData (completionContext, result);\n\t\t\t\t\t//\t\t\t\t}\n\t\t\t\t\t//\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn null;\n\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleCatchClauseType(ExpressionResult identifierStart)\n\t\t{\n\t\t\tFunc<IType, IType> typePred = delegate (IType type) {\n\t\t\t\tif (type.GetAllBaseTypes().Any(t => t.ReflectionName == \"System.Exception\"))\n\t\t\t\t\treturn type;\n\t\t\t\treturn null;\n\t\t\t};\n\t\t\tif (identifierStart.Node.Parent is CatchClause) {\n\t\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\t\tAddTypesAndNamespaces(\n\t\t\t\t\twrapper,\n\t\t\t\t\tGetState(),\n\t\t\t\t\tidentifierStart.Node,\n\t\t\t\t\ttypePred,\n\t\t\t\t\tm => false\n\t\t\t\t);\n\t\t\t\treturn wrapper.Result;\n\t\t\t}\n\n\t\t\tvar resolveResult = ResolveExpression(identifierStart);\n\t\t\treturn CreateCompletionData(\n\t\t\t\tlocation,\n\t\t\t\tresolveResult.Result,\n\t\t\t\tidentifierStart.Node,\n\t\t\t\tresolveResult.Resolver,\n\t\t\t\ttypePred\n\t\t\t);\n\t\t}\n\n\t\tstring[] validEnumBaseTypes = {\n\t\t\t\"byte\",\n\t\t\t\"sbyte\",\n\t\t\t\"short\",\n\t\t\t\"int\",\n\t\t\t\"long\",\n\t\t\t\"ushort\",\n\t\t\t\"uint\",\n\t\t\t\"ulong\"\n\t\t};\n\n\t\tIEnumerable<ICompletionData> HandleEnumContext()\n\t\t{\n\t\t\tvar syntaxTree = ParseStub(\"a\", false);\n\t\t\tif (syntaxTree == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar curType = syntaxTree.GetNodeAt<TypeDeclaration>(location);\n\t\t\tif (curType == null || curType.ClassType != ClassType.Enum) {\n\t\t\t\tsyntaxTree = ParseStub(\"a {}\", false);\n\t\t\t\tvar node = syntaxTree.GetNodeAt<AstType>(location);\n\t\t\t\tif (node != null) {\n\t\t\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\t\t\tAddKeywords(wrapper, validEnumBaseTypes);\n\t\t\t\t\treturn wrapper.Result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar member = syntaxTree.GetNodeAt<EnumMemberDeclaration>(location);\n\t\t\tif (member != null && member.NameToken.EndLocation < location) {\n\t\t\t\tif (currentMember == null && currentType != null) {\n\t\t\t\t\tforeach (var a in currentType.Members)\n\t\t\t\t\t\tif (a.Region.Begin < location && (currentMember == null || a.Region.Begin > currentMember.Region.Begin))\n\t\t\t\t\t\t\tcurrentMember = a;\n\t\t\t\t}\n\t\t\t\tbool isComplete = false;\n\t\t\t\treturn DefaultControlSpaceItems(ref isComplete);\n\t\t\t}\n\n\t\t\tvar attribute = syntaxTree.GetNodeAt<Attribute>(location);\n\t\t\tif (attribute != null) {\n\t\t\t\tvar contextList = new CompletionDataWrapper(this);\n\t\t\t\tvar astResolver = CompletionContextProvider.GetResolver(GetState(), syntaxTree);\n\t\t\t\tvar csResolver = astResolver.GetResolverStateBefore(attribute);\n\t\t\t\tAddContextCompletion(\n\t\t\t\t\tcontextList,\n\t\t\t\t\tcsResolver,\n\t\t\t\t\tattribute\n\t\t\t\t);\n\t\t\t\treturn contextList.Result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tbool IsInLinqContext(int offset)\n\t\t{\n\t\t\tstring token;\n\t\t\twhile (null != (token = GetPreviousToken(ref offset, true)) && !IsInsideCommentStringOrDirective()) {\n\n\t\t\t\tif (token == \"from\") {\n\t\t\t\t\treturn !IsInsideCommentStringOrDirective(offset);\n\t\t\t\t}\n\t\t\t\tif (token == \";\" || token == \"{\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleAccessorContext()\n\t\t{\n\t\t\tvar unit = ParseStub(\"get; }\", false);\n\t\t\tvar node = unit.GetNodeAt(location, cn => !(cn is CSharpTokenNode));\n\t\t\tif (node is Accessor) {\n\t\t\t\tnode = node.Parent;\n\t\t\t}\n\t\t\tvar contextList = new CompletionDataWrapper(this);\n\t\t\tif (node is PropertyDeclaration || node is IndexerDeclaration) {\n\t\t\t\tif (IncludeKeywordsInCompletionList) {\n\t\t\t\t\tcontextList.AddCustom(\"get\");\n\t\t\t\t\tcontextList.AddCustom(\"set\");\n\t\t\t\t\tAddKeywords(contextList, accessorModifierKeywords);\n\t\t\t\t}\n\t\t\t} else if (node is CustomEventDeclaration) {\n\t\t\t\tif (IncludeKeywordsInCompletionList) {\n\t\t\t\t\tcontextList.AddCustom(\"add\");\n\t\t\t\t\tcontextList.AddCustom(\"remove\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn contextList.Result;\n\t\t}\n\n\t\tclass IfVisitor :DepthFirstAstVisitor\n\t\t{\n\t\t\tTextLocation loc;\n\t\t\tICompletionContextProvider completionContextProvider;\n\t\t\tpublic bool IsValid;\n\n\t\t\tpublic IfVisitor(TextLocation loc, ICompletionContextProvider completionContextProvider)\n\t\t\t{\n\t\t\t\tthis.loc = loc;\n\t\t\t\tthis.completionContextProvider = completionContextProvider;\n\n\t\t\t\tthis.IsValid = true;\n\t\t\t}\n\n\t\t\tvoid Check(string argument)\n\t\t\t{\n\t\t\t\t// TODO: evaluate #if epressions\n\t\t\t\tif (argument.Any(c => !(char.IsLetterOrDigit(c) || c == '_')))\n\t\t\t\t\treturn;\n\t\t\t\tIsValid &= completionContextProvider.ConditionalSymbols.Contains(argument);\n\t\t\t}\n\n\t\t\tStack<PreProcessorDirective> ifStack = new Stack<PreProcessorDirective>();\n\n\t\t\tpublic override void VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective)\n\t\t\t{\n\t\t\t\tif (preProcessorDirective.Type == PreProcessorDirectiveType.If) {\n\t\t\t\t\tifStack.Push(preProcessorDirective);\n\t\t\t\t} else if (preProcessorDirective.Type == PreProcessorDirectiveType.Endif) {\n\t\t\t\t\tif (ifStack.Count == 0)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar ifDirective = ifStack.Pop();\n\t\t\t\t\tif (ifDirective.StartLocation < loc && loc < preProcessorDirective.EndLocation) {\n\t\t\t\t\t\tCheck(ifDirective.Argument);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbase.VisitPreProcessorDirective(preProcessorDirective);\n\t\t\t}\n\n\t\t\tpublic void End()\n\t\t\t{\n\t\t\t\twhile (ifStack.Count > 0) {\n\t\t\t\t\tCheck(ifStack.Pop().Argument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tIEnumerable<ICompletionData> DefaultControlSpaceItems(ref bool isComplete, ExpressionResult xp = null, bool controlSpace = true)\n\t\t{\n\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\tif (offset >= document.TextLength) {\n\t\t\t\toffset = document.TextLength - 1;\n\t\t\t}\n\t\t\twhile (offset > 1 && char.IsWhiteSpace(document.GetCharAt(offset))) {\n\t\t\t\toffset--;\n\t\t\t}\n\t\t\tlocation = document.GetLocation(offset);\n\n\t\t\tif (xp == null) {\n\t\t\t\txp = GetExpressionAtCursor();\n\t\t\t}\n\t\t\tAstNode node;\n\t\t\tSyntaxTree unit;\n\t\t\tExpressionResolveResult rr;\n\t\t\tif (xp != null) {\n\t\t\t\tnode = xp.Node;\n\t\t\t\trr = ResolveExpression(node);\n\t\t\t\tunit = xp.Unit;\n\t\t\t} else {\n\t\t\t\tunit = ParseStub(\"foo\", false);\n\t\t\t\tnode = unit.GetNodeAt(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column + 2,\n\t\t\t\t\tn => n is Expression || n is AstType || n is NamespaceDeclaration || n is Attribute\n\t\t\t\t);\n\t\t\t\trr = ResolveExpression(node);\n\t\t\t}\n\t\t\tvar ifvisitor = new IfVisitor(location, CompletionContextProvider);\n\t\t\tunit.AcceptVisitor(ifvisitor);\n\t\t\tifvisitor.End();\n\t\t\tif (!ifvisitor.IsValid)\n\t\t\t\treturn null;\n\t\t\t// namespace name case\n\t\t\tvar ns = node as NamespaceDeclaration;\n\t\t\tif (ns != null) {\n\t\t\t\tvar last = ns.NamespaceName;\n\t\t\t\tif (last != null && location < last.EndLocation)\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (node is Identifier && node.Parent is ForeachStatement) {\n\t\t\t\tvar foreachStmt = (ForeachStatement)node.Parent;\n\t\t\t\tforeach (var possibleName in GenerateNameProposals (foreachStmt.VariableType)) {\n\t\t\t\t\tif (possibleName.Length > 0) {\n\t\t\t\t\t\twrapper.Result.Add(factory.CreateLiteralCompletionData(possibleName.ToString()));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tAutoSelect = false;\n\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\tisComplete = true;\n\t\t\t\treturn wrapper.Result;\n\t\t\t}\n\n\t\t\tif (node is Identifier && node.Parent is ParameterDeclaration) {\n\t\t\t\tif (!controlSpace) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t// Try Parameter name case \n\t\t\t\tvar param = node.Parent as ParameterDeclaration;\n\t\t\t\tif (param != null) {\n\t\t\t\t\tforeach (var possibleName in GenerateNameProposals (param.Type)) {\n\t\t\t\t\t\tif (possibleName.Length > 0) {\n\t\t\t\t\t\t\twrapper.Result.Add(factory.CreateLiteralCompletionData(possibleName.ToString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tAutoSelect = false;\n\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t\tisComplete = true;\n\t\t\t\t\treturn wrapper.Result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pDecl = node as ParameterDeclaration;\n\t\t\tif (pDecl != null && pDecl.Parent is LambdaExpression) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t/*\t\t\t\t\t\tif (Unit != null && (node == null || node is TypeDeclaration)) {\n\t\t\t\tvar constructor = Unit.GetNodeAt<ConstructorDeclaration>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column - 3\n\t\t\t\t);\n\t\t\t\tif (constructor != null && !constructor.ColonToken.IsNull && constructor.Initializer.IsNull) {\n\t\t\t\t\twrapper.AddCustom(\"this\");\n\t\t\t\t\twrapper.AddCustom(\"base\");\n\t\t\t\t\treturn wrapper.Result;\n\t\t\t\t}\n\t\t\t}*/\n\n\t\t\tvar initializer = node != null ? node.Parent as ArrayInitializerExpression : null;\n\t\t\tif (initializer != null) {\n\t\t\t\tvar result = HandleObjectInitializer(unit, initializer);\n\t\t\t\tif (result != null)\n\t\t\t\t\treturn result;\n\t\t\t}\n\t\t\tCSharpResolver csResolver = null;\n\t\t\tif (rr != null) {\n\t\t\t\tcsResolver = rr.Resolver;\n\t\t\t}\n\n\t\t\tif (csResolver == null) {\n\t\t\t\tif (node != null) {\n\t\t\t\t\tcsResolver = GetState();\n\t\t\t\t\t//var astResolver = new CSharpAstResolver (csResolver, node, xp != null ? xp.Item1 : CSharpUnresolvedFile);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t//csResolver = astResolver.GetResolverStateBefore (node);\n\t\t\t\t\t\tConsole.WriteLine(csResolver.LocalVariables.Count());\n\t\t\t\t\t} catch (Exception  e) {\n\t\t\t\t\t\tConsole.WriteLine(\"E!!!\" + e);\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tcsResolver = GetState();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node is Attribute) {\n\t\t\t\t// add attribute properties.\n\t\t\t\tvar astResolver = CompletionContextProvider.GetResolver(csResolver, unit);\n\t\t\t\tvar resolved = astResolver.Resolve(node);\n\t\t\t\tAddAttributeProperties(wrapper, resolved);\n\t\t\t}\n\n\n\t\t\tif (node == null) {\n\t\t\t\t// try lambda\n\t\t\t\tunit = ParseStub(\"foo) => {}\", true);\n\t\t\t\tvar pd = unit.GetNodeAt<ParameterDeclaration>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column\n\t\t\t\t);\n\t\t\t\tif (pd != null) {\n\t\t\t\t\tvar astResolver = unit != null ? CompletionContextProvider.GetResolver(GetState(), unit) : null;\n\t\t\t\t\tvar parameterType = astResolver.Resolve(pd.Type);\n\t\t\t\t\t// Type <name> is always a name context -> return null\n\t\t\t\t\tif (parameterType != null && !parameterType.IsError)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAddContextCompletion(wrapper, csResolver, node);\n\n\t\t\treturn wrapper.Result;\n\t\t}\n\n\t\tstatic void AddAttributeProperties(CompletionDataWrapper wrapper, ResolveResult resolved)\n\t\t{\n\t\t\tif (resolved == null || resolved.Type.Kind == TypeKind.Unknown)\n\t\t\t\treturn;\n\n\t\t\tforeach (var property in resolved.Type.GetProperties (p => p.Accessibility == Accessibility.Public)) {\n\t\t\t\tvar data = wrapper.AddMember(property);\n\t\t\t\tif (data != null)\n\t\t\t\t\tdata.DisplayFlags |= DisplayFlags.NamedArgument;\n\t\t\t}\n\t\t\tforeach (var field in resolved.Type.GetFields (p => p.Accessibility == Accessibility.Public)) {\n\t\t\t\tvar data = wrapper.AddMember(field);\n\t\t\t\tif (data != null)\n\t\t\t\t\tdata.DisplayFlags |= DisplayFlags.NamedArgument;\n\t\t\t}\n\t\t\tforeach (var constructor in resolved.Type.GetConstructors (p => p.Accessibility == Accessibility.Public)) {\n\t\t\t\tforeach (var p in constructor.Parameters) {\n\t\t\t\t\twrapper.AddNamedParameterVariable(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid AddContextCompletion(CompletionDataWrapper wrapper, CSharpResolver state, AstNode node)\n\t\t{\n\t\t\tint i = offset - 1;\n\t\t\tvar isInGlobalDelegate = node == null && state.CurrentTypeDefinition == null && GetPreviousToken(ref i, true) == \"delegate\";\n\n\t\t\tif (state != null && !(node is AstType)) {\n\t\t\t\tforeach (var variable in state.LocalVariables) {\n\t\t\t\t\tif (variable.Region.IsInside(location.Line, location.Column - 1)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\twrapper.AddVariable(variable);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (state.CurrentMember is IParameterizedMember && !(node is AstType)) {\n\t\t\t\tvar param = (IParameterizedMember)state.CurrentMember;\n\t\t\t\tforeach (var p in param.Parameters) {\n\t\t\t\t\twrapper.AddVariable(p);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (state.CurrentMember is IMethod) {\n\t\t\t\tvar method = (IMethod)state.CurrentMember;\n\t\t\t\tforeach (var p in method.TypeParameters) {\n\t\t\t\t\twrapper.AddTypeParameter(p);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFunc<IType, IType> typePred = null;\n\t\t\tif (IsAttributeContext(node)) {\n\t\t\t\tvar attribute = Compilation.FindType(KnownTypeCode.Attribute);\n\t\t\t\ttypePred = t => t.GetAllBaseTypeDefinitions().Any(bt => bt.Equals(attribute)) ? t : null;\n\t\t\t}\n\t\t\tif (node != null && node.Role == Roles.BaseType) {\n\t\t\t\ttypePred = t => {\n\t\t\t\t\tvar def = t.GetDefinition();\n\t\t\t\t\tif (def != null && t.Kind != TypeKind.Interface && (def.IsSealed || def.IsStatic))\n\t\t\t\t\t\treturn null;\n\t\t\t\t\treturn t;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (node != null && !(node is NamespaceDeclaration) || state.CurrentTypeDefinition != null || isInGlobalDelegate) {\n\t\t\t\tAddTypesAndNamespaces(wrapper, state, node, typePred);\n\n\t\t\t\twrapper.Result.Add(factory.CreateLiteralCompletionData(\"global\"));\n\t\t\t}\n\n\t\t\tif (!(node is AstType)) {\n\t\t\t\tif (currentMember != null || node is Expression) {\n\t\t\t\t\tAddKeywords(wrapper, statementStartKeywords);\n\t\t\t\t\tif (LanguageVersion.Major >= 5)\n\t\t\t\t\t\tAddKeywords(wrapper, new [] { \"await\" });\n\t\t\t\t\tAddKeywords(wrapper, expressionLevelKeywords);\n\t\t\t\t\tif (node == null || node is TypeDeclaration)\n\t\t\t\t\t\tAddKeywords(wrapper, typeLevelKeywords);\n\t\t\t\t} else if (currentType != null) {\n\t\t\t\t\tAddKeywords(wrapper, typeLevelKeywords);\n\t\t\t\t} else {\n\t\t\t\t\tif (!isInGlobalDelegate && !(node is Attribute))\n\t\t\t\t\t\tAddKeywords(wrapper, globalLevelKeywords);\n\t\t\t\t}\n\t\t\t\tvar prop = currentMember as IUnresolvedProperty;\n\t\t\t\tif (prop != null && prop.Setter != null && prop.Setter.Region.IsInside(location)) {\n\t\t\t\t\twrapper.AddCustom(\"value\");\n\t\t\t\t} \n\t\t\t\tif (currentMember is IUnresolvedEvent) {\n\t\t\t\t\twrapper.AddCustom(\"value\");\n\t\t\t\t} \n\n\t\t\t\tif (IsInSwitchContext(node)) {\n\t\t\t\t\tif (IncludeKeywordsInCompletionList)\n\t\t\t\t\t\twrapper.AddCustom(\"case\"); \n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (((AstType)node).Parent is ParameterDeclaration) {\n\t\t\t\t\tAddKeywords(wrapper, parameterTypePredecessorKeywords);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node != null || state.CurrentTypeDefinition != null || isInGlobalDelegate)\n\t\t\t\tAddKeywords(wrapper, primitiveTypesKeywords);\n\t\t\tif (currentMember != null && (node is IdentifierExpression || node is SimpleType) && (node.Parent is ExpressionStatement || node.Parent is ForeachStatement || node.Parent is UsingStatement)) {\n\t\t\t\tif (IncludeKeywordsInCompletionList) {\n\t\t\t\t\twrapper.AddCustom(\"var\");\n\t\t\t\t\twrapper.AddCustom(\"dynamic\");\n\t\t\t\t}\n\t\t\t} \n\t\t\twrapper.Result.AddRange(factory.CreateCodeTemplateCompletionData());\n\t\t\tif (node != null && node.Role == Roles.Argument) {\n\t\t\t\tvar resolved = ResolveExpression(node.Parent);\n\t\t\t\tvar invokeResult = resolved != null ? resolved.Result as CSharpInvocationResolveResult : null;\n\t\t\t\tif (invokeResult != null) {\n\t\t\t\t\tint argNum = 0;\n\t\t\t\t\tforeach (var arg in node.Parent.Children.Where (c => c.Role == Roles.Argument)) {\n\t\t\t\t\t\tif (arg == node) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\targNum++;\n\t\t\t\t\t}\n\t\t\t\t\tvar param = argNum < invokeResult.Member.Parameters.Count ? invokeResult.Member.Parameters [argNum] : null;\n\t\t\t\t\tif (param != null && param.Type.Kind == TypeKind.Enum) {\n\t\t\t\t\t\tAddEnumMembers(wrapper, param.Type, state);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node is Expression) {\n\t\t\t\tvar root = node;\n\t\t\t\twhile (root.Parent != null)\n\t\t\t\t\troot = root.Parent;\n\t\t\t\tvar astResolver = CompletionContextProvider.GetResolver(state, root);\n\t\t\t\tforeach (var type in TypeGuessing.GetValidTypes(astResolver, (Expression)node)) {\n\t\t\t\t\tif (type.Kind == TypeKind.Enum) {\n\t\t\t\t\t\tAddEnumMembers(wrapper, type, state);\n\t\t\t\t\t} else if (type.Kind == TypeKind.Delegate) {\n\t\t\t\t\t\tAddDelegateHandlers(wrapper, type, false, true);\n\t\t\t\t\t\tAutoSelect = false;\n\t\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add 'this' keyword for first parameter (extension method case)\n\t\t\tif (node != null && node.Parent is ParameterDeclaration &&\n\t\t\t\tnode.Parent.PrevSibling != null && node.Parent.PrevSibling.Role == Roles.LPar && IncludeKeywordsInCompletionList) {\n\t\t\t\twrapper.AddCustom(\"this\");\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsInSwitchContext(AstNode node)\n\t\t{\n\t\t\tvar n = node;\n\t\t\twhile (n != null && !(n is EntityDeclaration)) {\n\t\t\t\tif (n is SwitchStatement) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (n is BlockStatement) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tn = n.Parent;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic bool ListEquals(List<INamespace> curNamespaces, List<INamespace> oldNamespaces)\n\t\t{\n\t\t\tif (oldNamespaces == null || curNamespaces.Count != oldNamespaces.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < curNamespaces.Count; i++) {\n\t\t\t\tif (curNamespaces [i].FullName != oldNamespaces [i].FullName) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid AddTypesAndNamespaces(CompletionDataWrapper wrapper, CSharpResolver state, AstNode node, Func<IType, IType> typePred = null, Predicate<IMember> memberPred = null, Action<ICompletionData, IType> callback = null, bool onlyAddConstructors = false)\n\t\t{\n\t\t\tvar lookup = new MemberLookup(ctx.CurrentTypeDefinition, Compilation.MainAssembly);\n\n\t\t\tif (currentType != null) {\n\t\t\t\tfor (var ct = ctx.CurrentTypeDefinition; ct != null; ct = ct.DeclaringTypeDefinition) {\n\t\t\t\t\tforeach (var nestedType in ct.GetNestedTypes ()) {\n\t\t\t\t\t\tif (!lookup.IsAccessible(nestedType.GetDefinition(), true))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (onlyAddConstructors) {\n\t\t\t\t\t\t\tif (!nestedType.GetConstructors().Any(c => lookup.IsAccessible(c, true)))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typePred == null) {\n\t\t\t\t\t\t\tif (onlyAddConstructors)\n\t\t\t\t\t\t\t\twrapper.AddConstructors(nestedType, false, IsAttributeContext(node));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twrapper.AddType(nestedType, false, IsAttributeContext(node));\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar type = typePred(nestedType);\n\t\t\t\t\t\tif (type != null) {\n\t\t\t\t\t\t\tvar a2 = onlyAddConstructors ? wrapper.AddConstructors(type, false, IsAttributeContext(node)) : wrapper.AddType(type, false, IsAttributeContext(node));\n\t\t\t\t\t\t\tif (a2 != null && callback != null) {\n\t\t\t\t\t\t\t\tcallback(a2, type);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.currentMember != null && !(node is AstType)) {\n\t\t\t\t\tvar def = ctx.CurrentTypeDefinition;\n\t\t\t\t\tif (def == null && currentType != null)\n\t\t\t\t\t\tdef = Compilation.MainAssembly.GetTypeDefinition(currentType.FullTypeName);\n\t\t\t\t\tif (def != null) {\n\t\t\t\t\t\tbool isProtectedAllowed = true;\n\n\t\t\t\t\t\tforeach (var member in def.GetMembers (m => currentMember.IsStatic ? m.IsStatic : true)) {\n\t\t\t\t\t\t\tif (member is IMethod && ((IMethod)member).FullName == \"System.Object.Finalize\") {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (member.SymbolKind == SymbolKind.Operator) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (member.IsExplicitInterfaceImplementation) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!lookup.IsAccessible(member, isProtectedAllowed)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (memberPred == null || memberPred(member)) {\n\t\t\t\t\t\t\t\twrapper.AddMember(member);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar declaring = def.DeclaringTypeDefinition;\n\t\t\t\t\t\twhile (declaring != null) {\n\t\t\t\t\t\t\tforeach (var member in declaring.GetMembers (m => m.IsStatic)) {\n\t\t\t\t\t\t\t\tif (memberPred == null || memberPred(member)) {\n\t\t\t\t\t\t\t\t\twrapper.AddMember(member);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdeclaring = declaring.DeclaringTypeDefinition;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ctx.CurrentTypeDefinition != null) {\n\t\t\t\t\tforeach (var p in ctx.CurrentTypeDefinition.TypeParameters) {\n\t\t\t\t\t\twrapper.AddTypeParameter(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar scope = ctx.CurrentUsingScope;\n\n\t\t\tfor (var n = scope; n != null; n = n.Parent) {\n\t\t\t\tforeach (var pair in n.UsingAliases) {\n\t\t\t\t\twrapper.AddAlias(pair.Key);\n\t\t\t\t}\n\t\t\t\tforeach (var alias in n.ExternAliases) {\n\t\t\t\t\twrapper.AddAlias(alias);\n\t\t\t\t}\n\t\t\t\tforeach (var u in n.Usings) {\n\t\t\t\t\tforeach (var type in u.Types) {\n\t\t\t\t\t\tif (!lookup.IsAccessible(type, false))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tIType addType = typePred != null ? typePred(type) : type;\n\n\t\t\t\t\t\tif (onlyAddConstructors && addType != null) {\n\t\t\t\t\t\t\tif (!addType.GetConstructors().Any(c => lookup.IsAccessible(c, true)))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (addType != null) {\n\t\t\t\t\t\t\tvar a = onlyAddConstructors ? wrapper.AddConstructors(addType, false, IsAttributeContext(node)) : wrapper.AddType(addType, false, IsAttributeContext(node));\n\t\t\t\t\t\t\tif (a != null && callback != null) {\n\t\t\t\t\t\t\t\tcallback(a, type);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach (var type in n.Namespace.Types) {\n\t\t\t\t\tif (!lookup.IsAccessible(type, false))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tIType addType = typePred != null ? typePred(type) : type;\n\t\t\t\t\tif (onlyAddConstructors && addType != null) {\n\t\t\t\t\t\tif (!addType.GetConstructors().Any(c => lookup.IsAccessible(c, true)))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (addType != null) {\n\t\t\t\t\t\tvar a2 = onlyAddConstructors ? wrapper.AddConstructors(addType, false, IsAttributeContext(node)) : wrapper.AddType(addType, false);\n\t\t\t\t\t\tif (a2 != null && callback != null) {\n\t\t\t\t\t\t\tcallback(a2, type);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var n = scope; n != null; n = n.Parent) {\n\t\t\t\tforeach (var curNs in n.Namespace.ChildNamespaces) {\n\t\t\t\t\twrapper.AddNamespace(lookup, curNs);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node is AstType && node.Parent is Constraint && IncludeKeywordsInCompletionList) {\n\t\t\t\twrapper.AddCustom(\"new()\");\n\t\t\t}\n\n\t\t\tif (AutomaticallyAddImports) {\n\t\t\t\tstate = GetState();\n\t\t\t\tICompletionData[] importData;\n\n\t\t\t\tvar namespaces = new List<INamespace>();\n\t\t\t\tfor (var n = ctx.CurrentUsingScope; n != null; n = n.Parent) {\n\t\t\t\t\tnamespaces.Add(n.Namespace);\n\t\t\t\t\tforeach (var u in n.Usings)\n\t\t\t\t\t\tnamespaces.Add(u);\n\t\t\t\t}\n\n\t\t\t\tif (this.CompletionEngineCache != null && ListEquals(namespaces, CompletionEngineCache.namespaces)) {\n\t\t\t\t\timportData = CompletionEngineCache.importCompletion;\n\t\t\t\t} else {\n\t\t\t\t\t// flatten usings\n\t\t\t\t\tvar importList = new List<ICompletionData>();\n\t\t\t\t\tvar dict = new Dictionary<string, Dictionary<string, ICompletionData>>();\n\t\t\t\t\tforeach (var type in Compilation.GetTopLevelTypeDefinitons ()) {\n\t\t\t\t\t\tif (!lookup.IsAccessible(type, false))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (namespaces.Any(n => n.FullName == type.Namespace))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tbool useFullName = false;\n\t\t\t\t\t\tforeach (var ns in namespaces) {\n\t\t\t\t\t\t\tif (ns.GetTypeDefinition(type.Name, type.TypeParameterCount) != null) {\n\t\t\t\t\t\t\t\tuseFullName = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (onlyAddConstructors) {\n\t\t\t\t\t\t\tif (!type.GetConstructors().Any(c => lookup.IsAccessible(c, true)))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar data = factory.CreateImportCompletionData(type, useFullName, onlyAddConstructors);\n\t\t\t\t\t\tDictionary<string, ICompletionData> createdDict;\n\t\t\t\t\t\tif (!dict.TryGetValue(type.Name, out createdDict)) {\n\t\t\t\t\t\t\tcreatedDict = new Dictionary<string, ICompletionData>();\n\t\t\t\t\t\t\tdict.Add(type.Name, createdDict);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tICompletionData oldData;\n\t\t\t\t\t\tif (!createdDict.TryGetValue(type.Namespace, out oldData)) {\n\t\t\t\t\t\t\timportList.Add(data);\n\t\t\t\t\t\t\tcreatedDict.Add(type.Namespace, data);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toldData.AddOverload(data); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\timportData = importList.ToArray();\n\t\t\t\t\tif (CompletionEngineCache != null) {\n\t\t\t\t\t\tCompletionEngineCache.namespaces = namespaces;\n\t\t\t\t\t\tCompletionEngineCache.importCompletion = importData;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (var data in importData) {\n\t\t\t\t\twrapper.Result.Add(data);\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\t\tIEnumerable<ICompletionData> HandleKeywordCompletion(int wordStart, string word)\n\t\t{\n\t\t\tif (IsInsideCommentStringOrDirective()) {\n\t\t\t\tif (IsInPreprocessorDirective()) {\n\t\t\t\t\tif (word == \"if\" || word == \"elif\") {\n\t\t\t\t\t\tif (wordStart > 0 && document.GetCharAt(wordStart - 1) == '#') {\n\t\t\t\t\t\t\treturn factory.CreatePreProcessorDefinesCompletionData();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tswitch (word) {\n\t\t\t\tcase \"namespace\":\n\t\t\t\t\treturn null;\n\t\t\t\tcase \"using\":\n\t\t\t\t\tif (currentType != null) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\t\t\tAddTypesAndNamespaces(wrapper, GetState(), null, t => null);\n\t\t\t\t\treturn wrapper.Result;\n\t\t\t\tcase \"case\":\n\t\t\t\t\treturn CreateCaseCompletionData(location);\n\t\t\t\t\t//\t\t\t\tcase \",\":\n\t\t\t\t\t//\t\t\t\tcase \":\":\n\t\t\t\t\t//\t\t\t\t\tif (result.ExpressionContext == ExpressionContext.InheritableType) {\n\t\t\t\t\t//\t\t\t\t\t\tIType cls = NRefactoryResolver.GetTypeAtCursor (Document.CompilationUnit, Document.FileName, new TextLocation (completionContext.TriggerLine, completionContext.TriggerLineOffset));\n\t\t\t\t\t//\t\t\t\t\t\tCompletionDataList completionList = new ProjectDomCompletionDataList ();\n\t\t\t\t\t//\t\t\t\t\t\tList<string > namespaceList = GetUsedNamespaces ();\n\t\t\t\t\t//\t\t\t\t\t\tvar col = new CSharpTextEditorCompletion.CompletionDataCollector (this, dom, completionList, Document.CompilationUnit, null, location);\n\t\t\t\t\t//\t\t\t\t\t\tbool isInterface = false;\n\t\t\t\t\t//\t\t\t\t\t\tHashSet<string > baseTypeNames = new HashSet<string> ();\n\t\t\t\t\t//\t\t\t\t\t\tif (cls != null) {\n\t\t\t\t\t//\t\t\t\t\t\t\tbaseTypeNames.Add (cls.Name);\n\t\t\t\t\t//\t\t\t\t\t\t\tif (cls.ClassType == ClassType.Struct)\n\t\t\t\t\t//\t\t\t\t\t\t\t\tisInterface = true;\n\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\tint tokenIndex = offset;\n\t\t\t\t\t//\t\n\t\t\t\t\t//\t\t\t\t\t\t// Search base types \" : [Type1, ... ,TypeN,] <Caret>\"\n\t\t\t\t\t//\t\t\t\t\t\tstring token = null;\n\t\t\t\t\t//\t\t\t\t\t\tdo {\n\t\t\t\t\t//\t\t\t\t\t\t\ttoken = GetPreviousToken (ref tokenIndex, false);\n\t\t\t\t\t//\t\t\t\t\t\t\tif (string.IsNullOrEmpty (token))\n\t\t\t\t\t//\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t//\t\t\t\t\t\t\ttoken = token.Trim ();\n\t\t\t\t\t//\t\t\t\t\t\t\tif (Char.IsLetterOrDigit (token [0]) || token [0] == '_') {\n\t\t\t\t\t//\t\t\t\t\t\t\t\tIType baseType = dom.SearchType (Document.CompilationUnit, cls, result.Region.Start, token);\n\t\t\t\t\t//\t\t\t\t\t\t\t\tif (baseType != null) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tif (baseType.ClassType != ClassType.Interface)\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\tisInterface = true;\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tbaseTypeNames.Add (baseType.Name);\n\t\t\t\t\t//\t\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t} while (token != \":\");\n\t\t\t\t\t//\t\t\t\t\t\tforeach (object o in dom.GetNamespaceContents (namespaceList, true, true)) {\n\t\t\t\t\t//\t\t\t\t\t\t\tIType type = o as IType;\n\t\t\t\t\t//\t\t\t\t\t\t\tif (type != null && (type.IsStatic || type.IsSealed || baseTypeNames.Contains (type.Name) || isInterface && type.ClassType != ClassType.Interface)) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\tif (o is Namespace && !namespaceList.Any (ns => ns.StartsWith (((Namespace)o).FullName)))\n\t\t\t\t\t//\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t\t\t\t\t\t\tcol.Add (o);\n\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t// Add inner classes\n\t\t\t\t\t//\t\t\t\t\t\tStack<IType > innerStack = new Stack<IType> ();\n\t\t\t\t\t//\t\t\t\t\t\tinnerStack.Push (cls);\n\t\t\t\t\t//\t\t\t\t\t\twhile (innerStack.Count > 0) {\n\t\t\t\t\t//\t\t\t\t\t\t\tIType curType = innerStack.Pop ();\n\t\t\t\t\t//\t\t\t\t\t\t\tif (curType == null)\n\t\t\t\t\t//\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t\t\t\t\t\t\tforeach (IType innerType in curType.InnerTypes) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\tif (innerType != cls)\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\t// don't add the calling class as possible base type\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tcol.Add (innerType);\n\t\t\t\t\t//\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\tif (curType.DeclaringType != null)\n\t\t\t\t\t//\t\t\t\t\t\t\t\tinnerStack.Push (curType.DeclaringType);\n\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\treturn completionList;\n\t\t\t\t\t//\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\tbreak;\n\t\t\t\tcase \"is\":\n\t\t\t\tcase \"as\":\n\t\t\t\t\tif (currentType == null) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tIType isAsType = null;\n\t\t\t\t\tvar isAsExpression = GetExpressionAt(wordStart);\n\t\t\t\t\tif (isAsExpression != null) {\n\t\t\t\t\t\tvar parent = isAsExpression.Node.Parent;\n\t\t\t\t\t\tif (parent is VariableInitializer) {\n\t\t\t\t\t\t\tparent = parent.Parent;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar varDecl = parent as VariableDeclarationStatement;\n\t\t\t\t\t\tif (varDecl != null) {\n\t\t\t\t\t\t\tExpressionResolveResult resolved;\n\t\t\t\t\t\t\tif (varDecl.Type.IsVar()) {\n\t\t\t\t\t\t\t\tresolved = null;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresolved = ResolveExpression(parent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (resolved != null) {\n\t\t\t\t\t\t\t\tisAsType = resolved.Result.Type;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar isAsWrapper = new CompletionDataWrapper(this);\n\t\t\t\t\tvar def = isAsType != null ? isAsType.GetDefinition() : null;\n\t\t\t\t\tAddTypesAndNamespaces(\n\t\t\t\t\t\tisAsWrapper,\n\t\t\t\t\t\tGetState(),\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tt => t.GetDefinition() == null || def == null || t.GetDefinition().IsDerivedFrom(def) ? t : null,\n\t\t\t\t\t\tm => false);\n\t\t\t\t\tAddKeywords(isAsWrapper, primitiveTypesKeywords);\n\t\t\t\t\treturn isAsWrapper.Result;\n\t\t\t\t\t//\t\t\t\t\t{\n\t\t\t\t\t//\t\t\t\t\t\tCompletionDataList completionList = new ProjectDomCompletionDataList ();\n\t\t\t\t\t//\t\t\t\t\t\tExpressionResult expressionResult = FindExpression (dom, completionContext, wordStart - document.Caret.Offset);\n\t\t\t\t\t//\t\t\t\t\t\tNRefactoryResolver resolver = CreateResolver ();\n\t\t\t\t\t//\t\t\t\t\t\tResolveResult resolveResult = resolver.Resolve (expressionResult, new TextLocation (completionContext.TriggerLine, completionContext.TriggerLineOffset));\n\t\t\t\t\t//\t\t\t\t\t\tif (resolveResult != null && resolveResult.ResolvedType != null) {\n\t\t\t\t\t//\t\t\t\t\t\t\tCompletionDataCollector col = new CompletionDataCollector (this, dom, completionList, Document.CompilationUnit, resolver.CallingType, location);\n\t\t\t\t\t//\t\t\t\t\t\t\tIType foundType = null;\n\t\t\t\t\t//\t\t\t\t\t\t\tif (word == \"as\") {\n\t\t\t\t\t//\t\t\t\t\t\t\t\tExpressionContext exactContext = new NewCSharpExpressionFinder (dom).FindExactContextForAsCompletion (document, Document.CompilationUnit, Document.FileName, resolver.CallingType);\n\t\t\t\t\t//\t\t\t\t\t\t\t\tif (exactContext is ExpressionContext.TypeExpressionContext) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tfoundType = resolver.SearchType (((ExpressionContext.TypeExpressionContext)exactContext).Type);\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tAddAsCompletionData (col, foundType);\n\t\t\t\t\t//\t\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\t\t\tif (foundType == null)\n\t\t\t\t\t//\t\t\t\t\t\t\t\tfoundType = resolver.SearchType (resolveResult.ResolvedType);\n\t\t\t\t\t//\t\t\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\t\t\tif (foundType != null) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\tif (foundType.ClassType == ClassType.Interface)\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tfoundType = resolver.SearchType (DomReturnType.Object);\n\t\t\t\t\t//\t\t\t\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\t\t\t\tforeach (IType type in dom.GetSubclasses (foundType)) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tif (type.IsSpecialName || type.Name.StartsWith (\"<\"))\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tAddAsCompletionData (col, type);\n\t\t\t\t\t//\t\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\tList<string > namespaceList = GetUsedNamespaces ();\n\t\t\t\t\t//\t\t\t\t\t\t\tforeach (object o in dom.GetNamespaceContents (namespaceList, true, true)) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\tif (o is IType) {\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tIType type = (IType)o;\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tif (type.ClassType != ClassType.Interface || type.IsSpecialName || type.Name.StartsWith (\"<\"))\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t//\t\t\t\t\t\t\t\tif (foundType != null && !dom.GetInheritanceTree (foundType).Any (x => x.FullName == type.FullName))\n\t\t\t\t\t//\t//\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tAddAsCompletionData (col, type);\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\t\tif (o is Namespace)\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t//\t\t\t\t\t\t\t\tcol.Add (o);\n\t\t\t\t\t//\t\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\t\treturn completionList;\n\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t\t//\t\t\t\t\t\tresult.ExpressionContext = ExpressionContext.TypeName;\n\t\t\t\t\t//\t\t\t\t\t\treturn CreateCtrlSpaceCompletionData (completionContext, result);\n\t\t\t\t\t//\t\t\t\t\t}\n\t\t\t\tcase \"override\":\n\t\t\t\t\t// Look for modifiers, in order to find the beginning of the declaration\n\t\t\t\t\tint firstMod = wordStart;\n\t\t\t\t\tint i = wordStart;\n\t\t\t\t\tfor (int n = 0; n < 3; n++) {\n\t\t\t\t\t\tstring mod = GetPreviousToken(ref i, true);\n\t\t\t\t\t\tif (mod == \"public\" || mod == \"protected\" || mod == \"private\" || mod == \"internal\" || mod == \"sealed\") {\n\t\t\t\t\t\t\tfirstMod = i;\n\t\t\t\t\t\t} else if (mod == \"static\") {\n\t\t\t\t\t\t\t// static methods are not overridable\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!IsLineEmptyUpToEol()) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (currentType != null && (currentType.Kind == TypeKind.Class || currentType.Kind == TypeKind.Struct)) {\n\t\t\t\t\t\tstring modifiers = document.GetText(firstMod, wordStart - firstMod);\n\t\t\t\t\t\treturn GetOverrideCompletionData(currentType, modifiers);\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\tcase \"partial\":\n\t\t\t\t\t// Look for modifiers, in order to find the beginning of the declaration\n\t\t\t\t\tfirstMod = wordStart;\n\t\t\t\t\ti = wordStart;\n\t\t\t\t\tfor (int n = 0; n < 3; n++) {\n\t\t\t\t\t\tstring mod = GetPreviousToken(ref i, true);\n\t\t\t\t\t\tif (mod == \"public\" || mod == \"protected\" || mod == \"private\" || mod == \"internal\" || mod == \"sealed\") {\n\t\t\t\t\t\t\tfirstMod = i;\n\t\t\t\t\t\t} else if (mod == \"static\") {\n\t\t\t\t\t\t\t// static methods are not overridable\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!IsLineEmptyUpToEol()) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar state = GetState();\n\n\t\t\t\t\tif (state.CurrentTypeDefinition != null && (state.CurrentTypeDefinition.Kind == TypeKind.Class || state.CurrentTypeDefinition.Kind == TypeKind.Struct)) {\n\t\t\t\t\t\tstring modifiers = document.GetText(firstMod, wordStart - firstMod);\n\t\t\t\t\t\treturn GetPartialCompletionData(state.CurrentTypeDefinition, modifiers);\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\n\t\t\t\tcase \"public\":\n\t\t\t\tcase \"protected\":\n\t\t\t\tcase \"private\":\n\t\t\t\tcase \"internal\":\n\t\t\t\tcase \"sealed\":\n\t\t\t\tcase \"static\":\n\t\t\t\t\tvar accessorContext = HandleAccessorContext();\n\t\t\t\t\tif (accessorContext != null) {\n\t\t\t\t\t\treturn accessorContext;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\tcase \"new\":\n\t\t\t\t\tint j = offset - 4;\n\t\t\t\t\t//\t\t\t\tstring token = GetPreviousToken (ref j, true);\n\n\t\t\t\t\tIType hintType = null;\n\t\t\t\t\tvar expressionOrVariableDeclaration = GetNewExpressionAt(j);\n\t\t\t\t\tif (expressionOrVariableDeclaration == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tvar astResolver = CompletionContextProvider.GetResolver(GetState(), expressionOrVariableDeclaration.Node.Ancestors.FirstOrDefault(n => n is EntityDeclaration || n is SyntaxTree));\n\t\t\t\t\thintType = TypeGuessing.GetValidTypes(\n\t\t\t\t\t\tastResolver,\n\t\t\t\t\t\texpressionOrVariableDeclaration.Node\n\t\t\t\t\t).FirstOrDefault();\n\n\t\t\t\t\treturn CreateConstructorCompletionData(hintType);\n\t\t\t\tcase \"yield\":\n\t\t\t\t\tvar yieldDataList = new CompletionDataWrapper(this);\n\t\t\t\t\tDefaultCompletionString = \"return\";\n\t\t\t\t\tif (IncludeKeywordsInCompletionList) {\n\t\t\t\t\t\tyieldDataList.AddCustom(\"break\");\n\t\t\t\t\t\tyieldDataList.AddCustom(\"return\");\n\t\t\t\t\t}\n\t\t\t\t\treturn yieldDataList.Result;\n\t\t\t\tcase \"in\":\n\t\t\t\t\tvar inList = new CompletionDataWrapper(this);\n\n\t\t\t\t\tvar expr = GetExpressionAtCursor();\n\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tvar rr = ResolveExpression(expr);\n\n\t\t\t\t\tAddContextCompletion(\n\t\t\t\t\t\tinList,\n\t\t\t\t\t\trr != null ? rr.Resolver : GetState(),\n\t\t\t\t\t\texpr.Node\n\t\t\t\t\t);\n\t\t\t\t\treturn inList.Result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tbool IsLineEmptyUpToEol()\n\t\t{\n\t\t\tvar line = document.GetLineByNumber(location.Line);\n\t\t\tfor (int j = offset; j < line.EndOffset; j++) {\n\t\t\t\tchar ch = document.GetCharAt(j);\n\t\t\t\tif (!char.IsWhiteSpace(ch)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tstring GetLineIndent(int lineNr)\n\t\t{\n\t\t\tvar line = document.GetLineByNumber(lineNr);\n\t\t\tfor (int j = line.Offset; j < line.EndOffset; j++) {\n\t\t\t\tchar ch = document.GetCharAt(j);\n\t\t\t\tif (!char.IsWhiteSpace(ch)) {\n\t\t\t\t\treturn document.GetText(line.Offset, j - line.Offset);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\t\t//\t\tstatic CSharpAmbience amb = new CSharpAmbience();\n\t\tclass Category : CompletionCategory\n\t\t{\n\t\t\tpublic Category(string displayText, string icon) : base(displayText, icon)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override int CompareTo(CompletionCategory other)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tIEnumerable<ICompletionData> CreateConstructorCompletionData(IType hintType)\n\t\t{\n\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\tvar state = GetState();\n\t\t\tFunc<IType, IType> pred = null;\n\t\t\tAction<ICompletionData, IType> typeCallback = null;\n\t\t\tvar inferredTypesCategory = new Category(\"Inferred Types\", null);\n\t\t\tvar derivedTypesCategory = new Category(\"Derived Types\", null);\n\n\t\t\tif (hintType != null && (hintType.Kind != TypeKind.TypeParameter || IsTypeParameterInScope(hintType))) {\n\t\t\t\tif (hintType.Kind != TypeKind.Unknown) {\n\t\t\t\t\tvar lookup = new MemberLookup(\n\t\t\t\t\t\tctx.CurrentTypeDefinition,\n\t\t\t\t\t\tCompilation.MainAssembly\n\t\t\t\t\t);\n\t\t\t\t\ttypeCallback = (data, t) => {\n\t\t\t\t\t\t//check if type is in inheritance tree.\n\t\t\t\t\t\tif (hintType.GetDefinition() != null &&\n\t\t\t\t\t\t\tt.GetDefinition() != null &&\n\t\t\t\t\t\t\tt.GetDefinition().IsDerivedFrom(hintType.GetDefinition())) {\n\t\t\t\t\t\t\tdata.CompletionCategory = derivedTypesCategory;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tpred = t => {\n\t\t\t\t\t\tif (t.Kind == TypeKind.Interface && hintType.Kind != TypeKind.Array) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// check for valid constructors\n\t\t\t\t\t\tif (t.GetConstructors().Any()) {\n\t\t\t\t\t\t\tbool isProtectedAllowed = currentType != null ? \n\t\t\t\t\t\t\t\tcurrentType.Resolve(ctx).GetDefinition().IsDerivedFrom(t.GetDefinition()) : false;\n\t\t\t\t\t\t\tif (!t.GetConstructors().Any(m => lookup.IsAccessible(m, isProtectedAllowed))) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// check derived types\n\t\t\t\t\t\tvar typeDef = t.GetDefinition();\n\t\t\t\t\t\tvar hintDef = hintType.GetDefinition();\n\t\t\t\t\t\tif (typeDef != null && hintDef != null && typeDef.IsDerivedFrom(hintDef)) {\n\t\t\t\t\t\t\tvar newType = wrapper.AddType(t, true);\n\t\t\t\t\t\t\tif (newType != null) {\n\t\t\t\t\t\t\t\tnewType.CompletionCategory = inferredTypesCategory;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// check type inference\n\t\t\t\t\t\tvar typeInference = new TypeInference(Compilation);\n\t\t\t\t\t\ttypeInference.Algorithm = TypeInferenceAlgorithm.ImprovedReturnAllResults;\n\n\t\t\t\t\t\tvar inferedType = typeInference.FindTypeInBounds(new [] { t }, new [] { hintType });\n\t\t\t\t\t\tif (inferedType != SpecialType.UnknownType) {\n\t\t\t\t\t\t\tvar newType = wrapper.AddType(inferedType, true);\n\t\t\t\t\t\t\tif (newType != null) {\n\t\t\t\t\t\t\t\tnewType.CompletionCategory = inferredTypesCategory;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn t;\n\t\t\t\t\t};\n\t\t\t\t\tif (!(hintType.Kind == TypeKind.Interface && hintType.Kind != TypeKind.Array)) {\n\t\t\t\t\t\tvar hint = wrapper.AddType(hintType, true);\n\t\t\t\t\t\tif (hint != null) {\n\t\t\t\t\t\t\tDefaultCompletionString = hint.DisplayText;\n\t\t\t\t\t\t\thint.CompletionCategory = derivedTypesCategory;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (hintType is ParameterizedType && hintType.TypeParameterCount == 1 && hintType.FullName == \"System.Collections.Generic.IEnumerable\") {\n\t\t\t\t\t\tvar arg = ((ParameterizedType)hintType).TypeArguments.FirstOrDefault();\n\t\t\t\t\t\tif (arg.Kind != TypeKind.TypeParameter) {\n\t\t\t\t\t\t\tvar array = new ArrayType(ctx.Compilation, arg, 1);\n\t\t\t\t\t\t\twrapper.AddType(array, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar hint = wrapper.AddType(hintType, true);\n\t\t\t\t\tif (hint != null) {\n\t\t\t\t\t\tDefaultCompletionString = hint.DisplayText;\n\t\t\t\t\t\thint.CompletionCategory = derivedTypesCategory;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t\tAddTypesAndNamespaces(wrapper, state, null, pred, m => false, typeCallback, true);\n\t\t\tif (hintType == null || hintType == SpecialType.UnknownType) {\n\t\t\t\tAddKeywords(wrapper, primitiveTypesKeywords.Where(k => k != \"void\"));\n\t\t\t}\n\n\t\t\tCloseOnSquareBrackets = true;\n\t\t\tAutoCompleteEmptyMatch = true;\n\t\t\tAutoCompleteEmptyMatchOnCurlyBracket = false;\n\t\t\treturn wrapper.Result;\n\t\t}\n\n\t\tbool IsTypeParameterInScope(IType hintType)\n\t\t{\n\t\t\tvar tp = hintType as ITypeParameter;\n\t\t\tvar ownerName = tp.Owner.ReflectionName;\n\t\t\tif (currentMember != null && ownerName == currentMember.ReflectionName)\n\t\t\t\treturn true;\n\t\t\tvar ot = currentType;\n\t\t\twhile (ot != null) {\n\t\t\t\tif (ownerName == ot.ReflectionName)\n\t\t\t\t\treturn true;\n\t\t\t\tot = ot.DeclaringTypeDefinition;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> GetOverrideCompletionData(IUnresolvedTypeDefinition type, string modifiers)\n\t\t{\n\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\tvar alreadyInserted = new List<IMember>();\n\t\t\t//bool addedVirtuals = false;\n\n\t\t\tint declarationBegin = offset;\n\t\t\tint j = declarationBegin;\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tswitch (GetPreviousToken(ref j, true)) {\n\t\t\t\t\tcase \"public\":\n\t\t\t\t\tcase \"protected\":\n\t\t\t\t\tcase \"private\":\n\t\t\t\t\tcase \"internal\":\n\t\t\t\t\tcase \"sealed\":\n\t\t\t\t\tcase \"override\":\n\t\t\t\t\tcase \"partial\":\n\t\t\t\t\tcase \"async\":\n\t\t\t\t\t\tdeclarationBegin = j;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"static\":\n\t\t\t\t\t\treturn null; // don't add override completion for static members\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddVirtuals(\n\t\t\t\talreadyInserted,\n\t\t\t\twrapper,\n\t\t\t\tmodifiers,\n\t\t\t\ttype.Resolve(ctx),\n\t\t\t\tdeclarationBegin\n\t\t\t);\n\t\t\treturn wrapper.Result;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> GetPartialCompletionData(ITypeDefinition type, string modifiers)\n\t\t{\n\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\tint declarationBegin = offset;\n\t\t\tint j = declarationBegin;\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tswitch (GetPreviousToken(ref j, true)) {\n\t\t\t\t\tcase \"public\":\n\t\t\t\t\tcase \"protected\":\n\t\t\t\t\tcase \"private\":\n\t\t\t\t\tcase \"internal\":\n\t\t\t\t\tcase \"sealed\":\n\t\t\t\t\tcase \"override\":\n\t\t\t\t\tcase \"partial\":\n\t\t\t\t\tcase \"async\":\n\t\t\t\t\t\tdeclarationBegin = j;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"static\":\n\t\t\t\t\t\treturn null; // don't add override completion for static members\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar methods = new List<IUnresolvedMethod>();\n\n\t\t\tforeach (var part in type.Parts) {\n\t\t\t\tforeach (var method in part.Methods) {\n\t\t\t\t\tif (method.BodyRegion.IsEmpty) {\n\t\t\t\t\t\tif (GetImplementation(type, method) != null) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmethods.Add(method);\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\tforeach (var method in methods) {\n\t\t\t\twrapper.Add(factory.CreateNewPartialCompletionData(\n\t\t\t\t\tdeclarationBegin,\n\t\t\t\t\tmethod.DeclaringTypeDefinition,\n\t\t\t\t\tmethod\n\t\t\t\t)\n\t\t\t\t);\n\t\t\t} \n\n\t\t\treturn wrapper.Result;\n\t\t}\n\n\t\tIMethod GetImplementation(ITypeDefinition type, IUnresolvedMethod method)\n\t\t{\n\t\t\tforeach (var cur in type.Methods) {\n\t\t\t\tif (cur.Name == method.Name && cur.Parameters.Count == method.Parameters.Count && !cur.BodyRegion.IsEmpty) {\n\t\t\t\t\tbool equal = true;\n\t\t\t\t\t/*\t\t\t\t\tfor (int i = 0; i < cur.Parameters.Count; i++) {\n\t\t\t\t\t\tif (!cur.Parameters [i].Type.Equals (method.Parameters [i].Type)) {\n\t\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}*/\n\t\t\t\t\tif (equal) {\n\t\t\t\t\t\treturn cur;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected virtual void AddVirtuals(List<IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin)\n\t\t{\n\t\t\tif (curType == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tforeach (var m in curType.GetMembers ().Reverse ()) {\n\t\t\t\tif (curType.Kind != TypeKind.Interface && !m.IsOverridable) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// filter out the \"Finalize\" methods, because finalizers should be done with destructors.\n\t\t\t\tif (m is IMethod && m.Name == \"Finalize\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar data = factory.CreateNewOverrideCompletionData(\n\t\t\t\t\tdeclarationBegin,\n\t\t\t\t\tcurrentType,\n\t\t\t\t\tm\n\t\t\t\t);\n\t\t\t\t// check if the member is already implemented\n\t\t\t\tbool foundMember = curType.GetMembers().Any(cm => SignatureComparer.Ordinal.Equals(\n\t\t\t\t\tcm,\n\t\t\t\t\tm\n\t\t\t\t) && cm.DeclaringTypeDefinition == curType.GetDefinition()\n\t\t\t\t);\n\t\t\t\tif (foundMember) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (alreadyInserted.Any(cm => SignatureComparer.Ordinal.Equals(cm, m)))\n\t\t\t\t\tcontinue;\n\t\t\t\talreadyInserted.Add(m);\n\t\t\t\tdata.CompletionCategory = col.GetCompletionCategory(m.DeclaringTypeDefinition);\n\t\t\t\tcol.Add(data);\n\t\t\t}\n\t\t}\n\n\t\tvoid AddKeywords(CompletionDataWrapper wrapper, IEnumerable<string> keywords)\n\t\t{\n\t\t\tif (!IncludeKeywordsInCompletionList)\n\t\t\t\treturn;\n\t\t\tforeach (string keyword in keywords) {\n\t\t\t\tif (wrapper.Result.Any(data => data.DisplayText == keyword))\n\t\t\t\t\tcontinue;\n\t\t\t\twrapper.AddCustom(keyword);\n\t\t\t}\n\t\t}\n\n\t\tpublic string GuessEventHandlerMethodName(int tokenIndex)\n\t\t{\n\t\t\tstring result = GetPreviousToken(ref tokenIndex, false);\n\t\t\treturn \"Handle\" + result;\n\t\t}\n\n\t\tbool MatchDelegate(IType delegateType, IMethod method)\n\t\t{\n\t\t\tif (method.SymbolKind != SymbolKind.Method)\n\t\t\t\treturn false;\n\t\t\tvar delegateMethod = delegateType.GetDelegateInvokeMethod();\n\t\t\tif (delegateMethod == null || delegateMethod.Parameters.Count != method.Parameters.Count) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < delegateMethod.Parameters.Count; i++) {\n\t\t\t\tif (!delegateMethod.Parameters [i].Type.Equals(method.Parameters [i].Type)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tstring AddDelegateHandlers(CompletionDataWrapper completionList, IType delegateType, bool addSemicolon = true, bool addDefault = true, string optDelegateName = null)\n\t\t{\n\t\t\tIMethod delegateMethod = delegateType.GetDelegateInvokeMethod();\n\t\t\tPossibleDelegates.Add(delegateMethod);\n\t\t\tvar thisLineIndent = GetLineIndent(location.Line);\n\t\t\tstring delegateEndString = EolMarker + thisLineIndent + \"}\" + (addSemicolon ? \";\" : \"\");\n\t\t\t//bool containsDelegateData = completionList.Result.Any(d => d.DisplayText.StartsWith(\"delegate(\"));\n\t\t\tif (addDefault && !completionList.AnonymousDelegateAdded) {\n\t\t\t\tcompletionList.AnonymousDelegateAdded = true;\n\t\t\t\tvar oldDelegate = completionList.Result.FirstOrDefault(cd => cd.DisplayText == \"delegate\");\n\t\t\t\tif (oldDelegate != null)\n\t\t\t\t\tcompletionList.Result.Remove(oldDelegate);\n\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\"delegate\",\n\t\t\t\t\t\"Creates anonymous delegate.\",\n\t\t\t\t\t\"delegate {\" + EolMarker + thisLineIndent + IndentString + \"|\" + delegateEndString\n\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\tif (LanguageVersion.Major >= 5) {\n\t\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\t\"async delegate\",\n\t\t\t\t\t\t\"Creates anonymous async delegate.\",\n\t\t\t\t\t\t\"async delegate {\" + EolMarker + thisLineIndent + IndentString + \"|\" + delegateEndString\n\t\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar sb = new StringBuilder(\"(\");\n\t\t\tvar sbWithoutTypes = new StringBuilder(\"(\");\n\t\t\tvar state = GetState();\n\t\t\tvar builder = new TypeSystemAstBuilder(state);\n\n\t\t\tfor (int k = 0; k < delegateMethod.Parameters.Count; k++) {\n\n\t\t\t\tif (k > 0) {\n\t\t\t\t\tsb.Append(\", \");\n\t\t\t\t\tsbWithoutTypes.Append(\", \");\n\t\t\t\t}\n\t\t\t\tvar convertedParameter = builder.ConvertParameter(delegateMethod.Parameters [k]);\n\t\t\t\tif (convertedParameter.ParameterModifier == ParameterModifier.Params)\n\t\t\t\t\tconvertedParameter.ParameterModifier = ParameterModifier.None;\n\t\t\t\tsb.Append(convertedParameter.ToString(FormattingPolicy));\n\t\t\t\tsbWithoutTypes.Append(delegateMethod.Parameters [k].Name);\n\t\t\t}\n\n\t\t\tsb.Append(\")\");\n\t\t\tsbWithoutTypes.Append(\")\");\n\t\t\tvar signature = sb.ToString();\n\t\t\tif (!completionList.HasAnonymousDelegateAdded(signature)) {\n\t\t\t\tcompletionList.AddAnonymousDelegateAdded(signature);\n\n\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\"delegate\" + signature,\n\t\t\t\t\t\"Creates anonymous delegate.\",\n\t\t\t\t\t\"delegate\" + signature + \" {\" + EolMarker + thisLineIndent + IndentString + \"|\" + delegateEndString\n\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\tif (LanguageVersion.Major >= 5) {\n\t\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\t\"async delegate\" + signature,\n\t\t\t\t\t\t\"Creates anonymous async delegate.\",\n\t\t\t\t\t\t\"async delegate\" + signature + \" {\" + EolMarker + thisLineIndent + IndentString + \"|\" + delegateEndString\n\t\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\t}\n\t\t\t\tif (!completionList.Result.Any(data => data.DisplayText == sb.ToString())) {\n\t\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\tsignature,\n\t\t\t\t\t\t\"Creates typed lambda expression.\",\n\t\t\t\t\t\tsignature + \" => |\" + (addSemicolon ? \";\" : \"\")\n\t\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\t\tif (LanguageVersion.Major >= 5) {\n\t\t\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\t\t\"async \" + signature,\n\t\t\t\t\t\t\t\"Creates typed async lambda expression.\",\n\t\t\t\t\t\t\t\"async \" + signature + \" => |\" + (addSemicolon ? \";\" : \"\")\n\t\t\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!delegateMethod.Parameters.Any(p => p.IsOut || p.IsRef) && !completionList.Result.Any(data => data.DisplayText == sbWithoutTypes.ToString())) {\n\t\t\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\t\tsbWithoutTypes.ToString(),\n\t\t\t\t\t\t\t\"Creates lambda expression.\",\n\t\t\t\t\t\t\tsbWithoutTypes + \" => |\" + (addSemicolon ? \";\" : \"\")\n\t\t\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\t\t\tif (LanguageVersion.Major >= 5) {\n\t\t\t\t\t\t\tcompletionList.AddCustom(\n\t\t\t\t\t\t\t\t\"async \" + sbWithoutTypes,\n\t\t\t\t\t\t\t\t\"Creates async lambda expression.\",\n\t\t\t\t\t\t\t\t\"async \" + sbWithoutTypes + \" => |\" + (addSemicolon ? \";\" : \"\")\n\t\t\t\t\t\t\t).DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstring varName = optDelegateName ?? \"Handle\" + delegateType.Name;\n\n\t\t\tvar ecd = factory.CreateEventCreationCompletionData(varName, delegateType, null, signature, currentMember, currentType);\n\t\t\tecd.DisplayFlags |= DisplayFlags.MarkedBold;\n\t\t\tcompletionList.Add(ecd);\n\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tbool IsAccessibleFrom(IEntity member, ITypeDefinition calledType, IMember currentMember, bool includeProtected)\n\t\t{\n\t\t\tif (currentMember == null) {\n\t\t\t\treturn member.IsStatic || member.IsPublic;\n\t\t\t}\n\t\t\t//\t\t\tif (currentMember is MonoDevelop.Projects.Dom.BaseResolveResult.BaseMemberDecorator) \n\t\t\t//\t\t\t\treturn member.IsPublic | member.IsProtected;\n\t\t\t//\t\tif (member.IsStatic && !IsStatic)\n\t\t\t//\t\t\treturn false;\n\t\t\tif (member.IsPublic || calledType != null && calledType.Kind == TypeKind.Interface && !member.IsProtected) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (member.DeclaringTypeDefinition != null) {\n\t\t\t\tif (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) { \n\t\t\t\t\treturn IsAccessibleFrom(\n\t\t\t\t\t\tmember.DeclaringTypeDefinition,\n\t\t\t\t\t\tcalledType,\n\t\t\t\t\t\tcurrentMember,\n\t\t\t\t\t\tincludeProtected\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (member.IsProtected && !(member.DeclaringTypeDefinition.IsProtectedOrInternal && !includeProtected)) {\n\t\t\t\t\treturn includeProtected;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (member.IsInternal || member.IsProtectedAndInternal || member.IsProtectedOrInternal) {\n\t\t\t\t//var type1 = member is ITypeDefinition ? (ITypeDefinition)member : member.DeclaringTypeDefinition;\n\t\t\t\t//var type2 = currentMember is ITypeDefinition ? (ITypeDefinition)currentMember : currentMember.DeclaringTypeDefinition;\n\t\t\t\tbool result = true;\n\t\t\t\t// easy case, projects are the same\n\t\t\t\t/*\t\t\t\t//\t\t\t\tif (type1.ProjectContent == type2.ProjectContent) {\n\t\t\t\t//\t\t\t\t\tresult = true; \n\t\t\t\t//\t\t\t\t} else \n\t\t\t\tif (type1.ProjectContent != null) {\n\t\t\t\t\t// maybe type2 hasn't project dom set (may occur in some cases), check if the file is in the project\n\t\t\t\t\t//TODO !!\n\t\t\t\t\t//\t\t\t\t\tresult = type1.ProjectContent.Annotation<MonoDevelop.Projects.Project> ().GetProjectFile (type2.Region.FileName) != null;\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if (type2.ProjectContent != null) {\n\t\t\t\t\t//TODO!!\n\t\t\t\t\t//\t\t\t\t\tresult = type2.ProjectContent.Annotation<MonoDevelop.Projects.Project> ().GetProjectFile (type1.Region.FileName) != null;\n\t\t\t\t\tresult = false;\n\t\t\t\t} else {\n\t\t\t\t\t// should never happen !\n\t\t\t\t\tresult = true;\n\t\t\t\t}*/\n\t\t\t\treturn member.IsProtectedAndInternal ? includeProtected && result : result;\n\t\t\t}\n\n\t\t\tif (!(currentMember is IType) && (currentMember.DeclaringTypeDefinition == null || member.DeclaringTypeDefinition == null)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// inner class \n\t\t\tvar declaringType = currentMember.DeclaringTypeDefinition;\n\t\t\twhile (declaringType != null) {\n\t\t\t\tif (declaringType.ReflectionName == currentMember.DeclaringType.ReflectionName) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tdeclaringType = declaringType.DeclaringTypeDefinition;\n\t\t\t}\n\n\n\t\t\treturn currentMember.DeclaringTypeDefinition != null && member.DeclaringTypeDefinition.FullName == currentMember.DeclaringTypeDefinition.FullName;\n\t\t}\n\n\t\tstatic bool IsAttributeContext(AstNode node)\n\t\t{\n\t\t\tAstNode n = node;\n\t\t\twhile (n is AstType) {\n\t\t\t\tn = n.Parent;\n\t\t\t}\n\t\t\treturn n is Attribute;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> CreateTypeAndNamespaceCompletionData(TextLocation location, ResolveResult resolveResult, AstNode resolvedNode, CSharpResolver state)\n\t\t{\n\t\t\tif (resolveResult == null || resolveResult.IsError) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar exprParent = resolvedNode.GetParent<Expression>();\n\t\t\tvar unit = exprParent != null ? exprParent.GetParent<SyntaxTree>() : null;\n\n\t\t\tvar astResolver = unit != null ? CompletionContextProvider.GetResolver(state, unit) : null;\n\t\t\tIType hintType = exprParent != null && astResolver != null ? \n\t\t\t\tTypeGuessing.GetValidTypes(astResolver, exprParent).FirstOrDefault() :\n\t\t\t\tnull;\n\t\t\tvar result = new CompletionDataWrapper(this);\n\t\t\tvar lookup = new MemberLookup(\n\t\t\t\tctx.CurrentTypeDefinition,\n\t\t\t\tCompilation.MainAssembly\n\t\t\t);\n\t\t\tif (resolveResult is NamespaceResolveResult) {\n\t\t\t\tvar nr = (NamespaceResolveResult)resolveResult;\n\t\t\t\tif (!(resolvedNode.Parent is UsingDeclaration || resolvedNode.Parent != null && resolvedNode.Parent.Parent is UsingDeclaration)) {\n\t\t\t\t\tforeach (var cl in nr.Namespace.Types) {\n\t\t\t\t\t\tif (hintType != null && hintType.Kind != TypeKind.Array && cl.Kind == TypeKind.Interface) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!lookup.IsAccessible(cl, false))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tresult.AddType(cl, false, IsAttributeContext(resolvedNode));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (var ns in nr.Namespace.ChildNamespaces) {\n\t\t\t\t\tresult.AddNamespace(lookup, ns);\n\t\t\t\t}\n\t\t\t} else if (resolveResult is TypeResolveResult) {\n\t\t\t\tvar type = resolveResult.Type;\n\t\t\t\tforeach (var nested in type.GetNestedTypes ()) {\n\t\t\t\t\tif (hintType != null && hintType.Kind != TypeKind.Array && nested.Kind == TypeKind.Interface) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar def = nested.GetDefinition();\n\t\t\t\t\tif (def != null && !lookup.IsAccessible(def, false))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tresult.AddType(nested, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result.Result;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> CreateTypeList()\n\t\t{\n\t\t\tforeach (var cl in Compilation.RootNamespace.Types) {\n\t\t\t\tyield return factory.CreateTypeCompletionData(cl, false, false, false);\n\t\t\t}\n\n\t\t\tforeach (var ns in Compilation.RootNamespace.ChildNamespaces) {\n\t\t\t\tyield return factory.CreateNamespaceCompletionData(ns);\n\t\t\t}\n\t\t}\n\n\t\tvoid CreateParameterForInvocation(CompletionDataWrapper result, IMethod method, CSharpResolver state, int parameter, HashSet<string> addedEnums, HashSet<string> addedDelegates)\n\t\t{\n\t\t\tif (method.Parameters.Count <= parameter) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar resolvedType = method.Parameters [parameter].Type;\n\t\t\tif (resolvedType.Kind == TypeKind.Enum) {\n\t\t\t\tif (addedEnums.Contains(resolvedType.ReflectionName)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\taddedEnums.Add(resolvedType.ReflectionName);\n\t\t\t\tAddEnumMembers(result, resolvedType, state);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (resolvedType.Kind == TypeKind.Delegate) {\n\t\t\t\tif (addedDelegates.Contains(resolvedType.ReflectionName))\n\t\t\t\t\treturn;\n\t\t\t\tAddDelegateHandlers(result, resolvedType, false, true, \"Handle\" + method.Parameters [parameter].Type.Name + method.Parameters [parameter].Name);\n\t\t\t}\n\t\t}\n\n\t\tIEnumerable<ICompletionData> CreateParameterCompletion(MethodGroupResolveResult resolveResult, CSharpResolver state, AstNode invocation, SyntaxTree unit, int parameter, bool controlSpace)\n\t\t{\n\t\t\tvar result = new CompletionDataWrapper(this);\n\t\t\tvar addedEnums = new HashSet<string>();\n\t\t\tvar addedDelegates = new HashSet<string>();\n\n\t\t\tforeach (var method in resolveResult.Methods) {\n\t\t\t\tCreateParameterForInvocation(result, method, state, parameter, addedEnums, addedDelegates);\n\t\t\t}\n\t\t\tforeach (var methods in resolveResult.GetEligibleExtensionMethods (true)) {\n\t\t\t\tforeach (var method in methods) {\n\t\t\t\t\tif (resolveResult.Methods.Contains(method))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tCreateParameterForInvocation(result, new ReducedExtensionMethod(method), state, parameter, addedEnums, addedDelegates);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (var method in resolveResult.Methods) {\n\t\t\t\tif (parameter < method.Parameters.Count && method.Parameters [parameter].Type.Kind == TypeKind.Delegate) {\n\t\t\t\t\tAutoSelect = false;\n\t\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\t}\n\t\t\t\tforeach (var p in method.Parameters) {\n\t\t\t\t\tresult.AddNamedParameterVariable(p);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!controlSpace) {\n\t\t\t\tif (addedEnums.Count + addedDelegates.Count == 0) {\n\t\t\t\t\treturn Enumerable.Empty<ICompletionData>();\n\t\t\t\t}\n\t\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\t\tAutoSelect = false;\n\t\t\t}\n\t\t\tAddContextCompletion(result, state, invocation);\n\n\t\t\t//\t\t\tresolver.AddAccessibleCodeCompletionData (ExpressionContext.MethodBody, cdc);\n\t\t\t//\t\t\tif (addedDelegates.Count > 0) {\n\t\t\t//\t\t\t\tforeach (var data in result.Result) {\n\t\t\t//\t\t\t\t\tif (data is MemberCompletionData) \n\t\t\t//\t\t\t\t\t\t((MemberCompletionData)data).IsDelegateExpected = true;\n\t\t\t//\t\t\t\t}\n\t\t\t//\t\t\t}\n\t\t\treturn result.Result;\n\t\t}\n\n\t\tvoid AddEnumMembers(CompletionDataWrapper completionList, IType resolvedType, CSharpResolver state)\n\t\t{\n\t\t\tif (resolvedType.Kind != TypeKind.Enum) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar type = completionList.AddEnumMembers(resolvedType, state);\n\t\t\tif (type != null)\n\t\t\t\tDefaultCompletionString = type.DisplayText;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> CreateCompletionData(TextLocation location, ResolveResult resolveResult, AstNode resolvedNode, CSharpResolver state, Func<IType, IType> typePred = null)\n\t\t{\n\t\t\tif (resolveResult == null /*\t\t\t|| resolveResult.IsError*/) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar lookup = new MemberLookup(\n\t\t\t\tctx.CurrentTypeDefinition,\n\t\t\t\tCompilation.MainAssembly\n\t\t\t);\n\n\t\t\tif (resolveResult is NamespaceResolveResult) {\n\t\t\t\tvar nr = (NamespaceResolveResult)resolveResult;\n\t\t\t\tvar namespaceContents = new CompletionDataWrapper(this);\n\n\t\t\t\tforeach (var cl in nr.Namespace.Types) {\n\t\t\t\t\tif (!lookup.IsAccessible(cl, false))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tIType addType = typePred != null ? typePred(cl) : cl;\n\t\t\t\t\tif (addType != null)\n\t\t\t\t\t\tnamespaceContents.AddType(addType, false);\n\t\t\t\t}\n\n\t\t\t\tforeach (var ns in nr.Namespace.ChildNamespaces) {\n\t\t\t\t\tnamespaceContents.AddNamespace(lookup, ns);\n\t\t\t\t}\n\t\t\t\treturn namespaceContents.Result;\n\t\t\t}\n\t\t\tIType type = resolveResult.Type;\n\n\t\t\tif (type.Namespace == \"System\" && type.Name == \"Void\")\n\t\t\t\treturn null;\n\n\t\t\tif (resolvedNode.Parent is PointerReferenceExpression && (type is PointerType)) {\n\t\t\t\tresolveResult = new OperatorResolveResult(((PointerType)type).ElementType, System.Linq.Expressions.ExpressionType.Extension, resolveResult);\n\t\t\t}\n\n\t\t\t//var typeDef = resolveResult.Type.GetDefinition();\n\t\t\tvar result = new CompletionDataWrapper(this);\n\t\t\tbool includeStaticMembers = false;\n\n\t\t\tif (resolveResult is LocalResolveResult) {\n\t\t\t\tif (resolvedNode is IdentifierExpression) {\n\t\t\t\t\tvar mrr = (LocalResolveResult)resolveResult;\n\t\t\t\t\tincludeStaticMembers = mrr.Variable.Name == mrr.Type.Name;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (resolveResult is TypeResolveResult && type.Kind == TypeKind.Enum) {\n\t\t\t\tforeach (var field in type.GetFields ()) {\n\t\t\t\t\tif (!lookup.IsAccessible(field, false))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tresult.AddMember(field);\n\t\t\t\t}\n\t\t\t\treturn result.Result;\n\t\t\t}\n\n\t\t\tbool isProtectedAllowed = lookup.IsProtectedAccessAllowed(resolveResult);\n\t\t\tbool skipNonStaticMembers = (resolveResult is TypeResolveResult);\n\n\t\t\tif (resolveResult is MemberResolveResult && resolvedNode is IdentifierExpression) {\n\t\t\t\tvar mrr = (MemberResolveResult)resolveResult;\n\t\t\t\tincludeStaticMembers = mrr.Member.Name == mrr.Type.Name;\n\n\t\t\t\tTypeResolveResult trr;\n\t\t\t\tif (state.IsVariableReferenceWithSameType(\n\t\t\t\t\tresolveResult,\n\t\t\t\t\t((IdentifierExpression)resolvedNode).Identifier,\n\t\t\t\t\tout trr\n\t\t\t\t)) {\n\t\t\t\t\tif (currentMember != null && mrr.Member.IsStatic ^ currentMember.IsStatic) {\n\t\t\t\t\t\tskipNonStaticMembers = true;\n\n\t\t\t\t\t\tif (trr.Type.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\tforeach (var field in trr.Type.GetFields ()) {\n\t\t\t\t\t\t\t\tif (lookup.IsAccessible(field, false))\n\t\t\t\t\t\t\t\t\tresult.AddMember(field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn result.Result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// ADD Aliases\n\t\t\t\tvar scope = ctx.CurrentUsingScope;\n\n\t\t\t\tfor (var n = scope; n != null; n = n.Parent) {\n\t\t\t\t\tforeach (var pair in n.UsingAliases) {\n\t\t\t\t\t\tif (pair.Key == mrr.Member.Name) {\n\t\t\t\t\t\t\tforeach (var r in CreateCompletionData (location, pair.Value, resolvedNode, state)) {\n\t\t\t\t\t\t\t\tif (r is IEntityCompletionData && ((IEntityCompletionData)r).Entity is IMember) {\n\t\t\t\t\t\t\t\t\tresult.AddMember((IMember)((IEntityCompletionData)r).Entity);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresult.Add(r);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\n\n\t\t\t}\n\t\t\tif (resolveResult is TypeResolveResult && (resolvedNode is IdentifierExpression || resolvedNode is MemberReferenceExpression)) {\n\t\t\t\tincludeStaticMembers = true;\n\t\t\t}\n\n\t\t\t//\t\t\tConsole.WriteLine (\"type:\" + type +\"/\"+type.GetType ());\n\t\t\t//\t\t\tConsole.WriteLine (\"current:\" + ctx.CurrentTypeDefinition);\n\t\t\t//\t\t\tConsole.WriteLine (\"IS PROT ALLOWED:\" + isProtectedAllowed + \" static: \"+ includeStaticMembers);\n\t\t\t//\t\t\tConsole.WriteLine (resolveResult);\n\t\t\t//\t\t\tConsole.WriteLine (\"node:\" + resolvedNode);\n\t\t\t//\t\t\tConsole.WriteLine (currentMember !=  null ? currentMember.IsStatic : \"currentMember == null\");\n\n\t\t\tif (resolvedNode.Annotation<ObjectCreateExpression>() == null) {\n\t\t\t\t//tags the created expression as part of an object create expression.\n\t\t\t\t/*\t\t\t\t\n\t\t\t\tvar filteredList = new List<IMember>();\n\t\t\t\tforeach (var member in type.GetMembers ()) {\n\t\t\t\t\tfilteredList.Add(member);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach (var member in filteredList) {\n\t\t\t\t\t//\t\t\t\t\tConsole.WriteLine (\"add:\" + member + \"/\" + member.IsStatic);\n\t\t\t\t\tresult.AddMember(member);\n\t\t\t\t}*/\n\t\t\t\tforeach (var member in lookup.GetAccessibleMembers (resolveResult)) {\n\t\t\t\t\tif (member.SymbolKind == SymbolKind.Indexer || member.SymbolKind == SymbolKind.Operator || member.SymbolKind == SymbolKind.Constructor || member.SymbolKind == SymbolKind.Destructor) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (resolvedNode is BaseReferenceExpression && member.IsAbstract) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (member is IType) {\n\t\t\t\t\t\tif (resolveResult is TypeResolveResult || includeStaticMembers) {\n\t\t\t\t\t\t\tif (!lookup.IsAccessible(member, isProtectedAllowed))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tresult.AddType((IType)member, false);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbool memberIsStatic = member.IsStatic;\n\t\t\t\t\tif (!includeStaticMembers && memberIsStatic && !(resolveResult is TypeResolveResult)) {\n\t\t\t\t\t\t//\t\t\t\t\t\tConsole.WriteLine (\"skip static member: \" + member.FullName);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar field = member as IField;\n\t\t\t\t\tif (field != null) {\n\t\t\t\t\t\tmemberIsStatic |= field.IsConst;\n\t\t\t\t\t}\n\t\t\t\t\tif (!memberIsStatic && skipNonStaticMembers) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (member is IMethod && ((IMethod)member).FullName == \"System.Object.Finalize\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (member.SymbolKind == SymbolKind.Operator) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (member is IMember) {\n\t\t\t\t\t\tresult.AddMember((IMember)member);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!(resolveResult is TypeResolveResult || includeStaticMembers)) {\n\t\t\t\tforeach (var meths in state.GetExtensionMethods (type)) {\n\t\t\t\t\tforeach (var m in meths) {\n\t\t\t\t\t\tif (!lookup.IsAccessible(m, isProtectedAllowed))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tresult.AddMember(new ReducedExtensionMethod(m));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\t\t\tIEnumerable<object> objects = resolveResult.CreateResolveResult (dom, resolver != null ? resolver.CallingMember : null);\n\t\t\t//\t\t\tCompletionDataCollector col = new CompletionDataCollector (this, dom, result, Document.CompilationUnit, resolver != null ? resolver.CallingType : null, location);\n\t\t\t//\t\t\tcol.HideExtensionParameter = !resolveResult.StaticResolve;\n\t\t\t//\t\t\tcol.NamePrefix = expressionResult.Expression;\n\t\t\t//\t\t\tbool showOnlyTypes = expressionResult.Contexts.Any (ctx => ctx == ExpressionContext.InheritableType || ctx == ExpressionContext.Constraints);\n\t\t\t//\t\t\tif (objects != null) {\n\t\t\t//\t\t\t\tforeach (object obj in objects) {\n\t\t\t//\t\t\t\t\tif (expressionResult.ExpressionContext != null && expressionResult.ExpressionContext.FilterEntry (obj))\n\t\t\t//\t\t\t\t\t\tcontinue;\n\t\t\t//\t\t\t\t\tif (expressionResult.ExpressionContext == ExpressionContext.NamespaceNameExcepted && !(obj is Namespace))\n\t\t\t//\t\t\t\t\t\tcontinue;\n\t\t\t//\t\t\t\t\tif (showOnlyTypes && !(obj is IType))\n\t\t\t//\t\t\t\t\t\tcontinue;\n\t\t\t//\t\t\t\t\tCompletionData data = col.Add (obj);\n\t\t\t//\t\t\t\t\tif (data != null && expressionResult.ExpressionContext == ExpressionContext.Attribute && data.CompletionText != null && data.CompletionText.EndsWith (\"Attribute\")) {\n\t\t\t//\t\t\t\t\t\tstring newText = data.CompletionText.Substring (0, data.CompletionText.Length - \"Attribute\".Length);\n\t\t\t//\t\t\t\t\t\tdata.SetText (newText);\n\t\t\t//\t\t\t\t\t}\n\t\t\t//\t\t\t\t}\n\t\t\t//\t\t\t}\n\n\t\t\treturn result.Result;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> CreateCaseCompletionData(TextLocation location)\n\t\t{\n\t\t\tvar unit = ParseStub(\"a: break;\");\n\t\t\tif (unit == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar s = unit.GetNodeAt<SwitchStatement>(location);\n\t\t\tif (s == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar offset = document.GetOffset(s.Expression.StartLocation);\n\t\t\tvar expr = GetExpressionAt(offset);\n\t\t\tif (expr == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar resolveResult = ResolveExpression(expr);\n\t\t\tif (resolveResult == null || resolveResult.Result.Type.Kind != TypeKind.Enum) { \n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar wrapper = new CompletionDataWrapper(this);\n\t\t\tAddEnumMembers(wrapper, resolveResult.Result.Type, resolveResult.Resolver);\n\t\t\tAutoCompleteEmptyMatch = false;\n\t\t\treturn wrapper.Result;\n\t\t}\n\n\t\t#region Parsing methods\n\n\t\tExpressionResult GetExpressionBeforeCursor()\n\t\t{\n\t\t\tSyntaxTree baseUnit;\n\t\t\tif (currentMember == null) {\n\t\t\t\tbaseUnit = ParseStub(\"a\", false);\n\t\t\t\tvar type = baseUnit.GetNodeAt<MemberType>(location);\n\t\t\t\tif (type == null) {\n\t\t\t\t\tbaseUnit = ParseStub(\"a;\", false);\n\t\t\t\t\ttype = baseUnit.GetNodeAt<MemberType>(location);\n\t\t\t\t}\n\n\t\t\t\tif (type == null) {\n\t\t\t\t\tbaseUnit = ParseStub(\"A a;\", false);\n\t\t\t\t\ttype = baseUnit.GetNodeAt<MemberType>(location);\n\t\t\t\t}\n\t\t\t\tif (type != null) {\n\t\t\t\t\treturn new ExpressionResult((AstNode)type.Target, baseUnit);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbaseUnit = ParseStub(\"ToString()\", false);\n\t\t\tvar curNode = baseUnit.GetNodeAt(location);\n\t\t\t// hack for local variable declaration missing ';' issue - remove that if it works.\n\t\t\tif (curNode is EntityDeclaration || baseUnit.GetNodeAt<Expression>(location) == null && baseUnit.GetNodeAt<MemberType>(location) == null) {\n\t\t\t\tbaseUnit = ParseStub(\"a\");\n\t\t\t\tcurNode = baseUnit.GetNodeAt(location);\n\t\t\t}\n\n\t\t\t// Hack for handle object initializer continuation expressions\n\t\t\tif (curNode is EntityDeclaration || baseUnit.GetNodeAt<Expression>(location) == null && baseUnit.GetNodeAt<MemberType>(location) == null) {\n\t\t\t\tbaseUnit = ParseStub(\"a};\");\n\t\t\t}\n\t\t\tvar mref = baseUnit.GetNodeAt<MemberReferenceExpression>(location); \n\t\t\tif (currentMember == null && currentType == null) {\n\t\t\t\tif (mref != null) {\n\t\t\t\t\treturn new ExpressionResult((AstNode)mref.Target, baseUnit);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin;\n\t\t\tif (mref == null) {\n\t\t\t\tvar type = baseUnit.GetNodeAt<MemberType>(location); \n\t\t\t\tif (type != null) {\n\t\t\t\t\treturn new ExpressionResult((AstNode)type.Target, baseUnit);\n\t\t\t\t}\n\n\t\t\t\tvar pref = baseUnit.GetNodeAt<PointerReferenceExpression>(location); \n\t\t\t\tif (pref != null) {\n\t\t\t\t\treturn new ExpressionResult((AstNode)pref.Target, baseUnit);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (mref == null) {\n\t\t\t\tbaseUnit = ParseStub(\"A a;\", false);\n\t\t\t\tvar type = baseUnit.GetNodeAt<MemberType>(location);\n\t\t\t\tif (type != null) {\n\t\t\t\t\treturn new ExpressionResult((AstNode)type.Target, baseUnit);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAstNode expr = null;\n\t\t\tif (mref != null) {\n\t\t\t\texpr = mref.Target;\n\t\t\t} else {\n\t\t\t\tExpression tref = baseUnit.GetNodeAt<TypeReferenceExpression>(location); \n\t\t\t\tMemberType memberType = tref != null ? ((TypeReferenceExpression)tref).Type as MemberType : null;\n\t\t\t\tif (memberType == null) {\n\t\t\t\t\tmemberType = baseUnit.GetNodeAt<MemberType>(location); \n\t\t\t\t\tif (memberType != null) {\n\t\t\t\t\t\tif (memberType.Parent is ObjectCreateExpression) {\n\t\t\t\t\t\t\tvar mt = memberType.Target.Clone();\n\t\t\t\t\t\t\tmemberType.ReplaceWith(mt);\n\t\t\t\t\t\t\texpr = mt;\n\t\t\t\t\t\t\tgoto exit;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttref = baseUnit.GetNodeAt<Expression>(location); \n\t\t\t\t\t\t\tif (tref == null) {\n\t\t\t\t\t\t\t\ttref = new TypeReferenceExpression(memberType.Clone());\n\t\t\t\t\t\t\t\tmemberType.Parent.AddChild(tref, Roles.Expression);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (tref is ObjectCreateExpression) {\n\t\t\t\t\t\t\t\texpr = memberType.Target.Clone();\n\t\t\t\t\t\t\t\texpr.AddAnnotation(new ObjectCreateExpression());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (memberType == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (expr == null) {\n\t\t\t\t\texpr = memberType.Target.Clone();\n\t\t\t\t}\n\t\t\t\ttref.ReplaceWith(expr);\n\t\t\t}\n\t\t\texit:\n\t\t\treturn new ExpressionResult((AstNode)expr, baseUnit);\n\t\t}\n\n\t\tExpressionResult GetExpressionAtCursor()\n\t\t{\n\t\t\t//\t\t\tTextLocation memberLocation;\n\t\t\t//\t\t\tif (currentMember != null) {\n\t\t\t//\t\t\t\tmemberLocation = currentMember.Region.Begin;\n\t\t\t//\t\t\t} else if (currentType != null) {\n\t\t\t//\t\t\t\tmemberLocation = currentType.Region.Begin;\n\t\t\t//\t\t\t} else {\n\t\t\t//\t\t\t\tmemberLocation = location;\n\t\t\t//\t\t\t}\n\t\t\tvar baseUnit = ParseStub(\"a\");\n\t\t\tvar tmpUnit = baseUnit;\n\t\t\tAstNode expr = baseUnit.GetNodeAt(\n\t\t\t\tlocation,\n\t\t\t\tn => n is IdentifierExpression || n is MemberReferenceExpression\n\t\t\t);\n\n\t\t\tif (expr == null) {\n\t\t\t\texpr = baseUnit.GetNodeAt<AstType>(location.Line, location.Column - 1);\n\t\t\t}\n\t\t\tif (expr == null)\n\t\t\t\texpr = baseUnit.GetNodeAt<Identifier>(location.Line, location.Column - 1);\n\t\t\t// try insertStatement\n\t\t\tif (expr == null && baseUnit.GetNodeAt<EmptyStatement>(location.Line, location.Column) != null) {\n\t\t\t\ttmpUnit = baseUnit = ParseStub(\"a();\", false);\n\t\t\t\texpr = baseUnit.GetNodeAt<InvocationExpression>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column + 1\n\t\t\t\t); \n\t\t\t}\n\n\t\t\tif (expr == null) {\n\t\t\t\tbaseUnit = ParseStub(\"()\");\n\t\t\t\texpr = baseUnit.GetNodeAt<IdentifierExpression>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column - 1\n\t\t\t\t); \n\t\t\t\tif (expr == null) {\n\t\t\t\t\texpr = baseUnit.GetNodeAt<MemberType>(location.Line, location.Column - 1); \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr == null) {\n\t\t\t\tbaseUnit = ParseStub(\"a\", false);\n\t\t\t\texpr = baseUnit.GetNodeAt(\n\t\t\t\t\tlocation,\n\t\t\t\t\tn => n is IdentifierExpression || n is MemberReferenceExpression || n is CatchClause\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// try statement \n\t\t\tif (expr == null) {\n\t\t\t\texpr = tmpUnit.GetNodeAt<SwitchStatement>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column - 1\n\t\t\t\t); \n\t\t\t\tbaseUnit = tmpUnit;\n\t\t\t}\n\n\t\t\tif (expr == null) {\n\t\t\t\tvar block = tmpUnit.GetNodeAt<BlockStatement>(location); \n\t\t\t\tvar node = block != null ? block.Statements.LastOrDefault() : null;\n\n\t\t\t\tvar forStmt = node != null ? node.PrevSibling as ForStatement : null;\n\t\t\t\tif (forStmt != null && forStmt.EmbeddedStatement.IsNull) {\n\t\t\t\t\texpr = forStmt;\n\t\t\t\t\tvar id = new IdentifierExpression(\"stub\");\n\t\t\t\t\tforStmt.EmbeddedStatement = new BlockStatement() { Statements = { new ExpressionStatement(id) } };\n\t\t\t\t\texpr = id;\n\t\t\t\t\tbaseUnit = tmpUnit;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr == null) {\n\t\t\t\tvar forStmt = tmpUnit.GetNodeAt<ForeachStatement>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column - 3\n\t\t\t\t); \n\t\t\t\tif (forStmt != null && forStmt.EmbeddedStatement.IsNull) {\n\t\t\t\t\tforStmt.VariableNameToken = Identifier.Create(\"stub\");\n\t\t\t\t\texpr = forStmt.VariableNameToken;\n\t\t\t\t\tbaseUnit = tmpUnit;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (expr == null) {\n\t\t\t\texpr = tmpUnit.GetNodeAt<VariableInitializer>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column - 1\n\t\t\t\t);\n\t\t\t\tbaseUnit = tmpUnit;\n\t\t\t}\n\n\t\t\t// try parameter declaration type\n\t\t\tif (expr == null) {\n\t\t\t\tbaseUnit = ParseStub(\">\", false, \"{}\");\n\t\t\t\texpr = baseUnit.GetNodeAt<TypeParameterDeclaration>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column - 1\n\t\t\t\t); \n\t\t\t}\n\n\t\t\t// try parameter declaration method\n\t\t\tif (expr == null) {\n\t\t\t\tbaseUnit = ParseStub(\"> ()\", false, \"{}\");\n\t\t\t\texpr = baseUnit.GetNodeAt<TypeParameterDeclaration>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column - 1\n\t\t\t\t); \n\t\t\t}\n\n\t\t\t// try expression in anonymous type \"new { sample = x$\" case\n\t\t\tif (expr == null) {\n\t\t\t\tbaseUnit = ParseStub(\"a\", false);\n\t\t\t\texpr = baseUnit.GetNodeAt<AnonymousTypeCreateExpression>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column\n\t\t\t\t); \n\t\t\t\tif (expr != null) {\n\t\t\t\t\texpr = baseUnit.GetNodeAt<Expression>(location.Line, location.Column) ?? expr;\n\t\t\t\t} \n\t\t\t\tif (expr == null) {\n\t\t\t\t\texpr = baseUnit.GetNodeAt<AstType>(location.Line, location.Column);\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t// try lambda \n\t\t\tif (expr == null) {\n\t\t\t\tbaseUnit = ParseStub(\"foo) => {}\", false);\n\t\t\t\texpr = baseUnit.GetNodeAt<ParameterDeclaration>(\n\t\t\t\t\tlocation.Line,\n\t\t\t\t\tlocation.Column\n\t\t\t\t); \n\t\t\t}\n\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\t\t\treturn new ExpressionResult(expr, baseUnit);\n\t\t}\n\n\t\tExpressionResult GetExpressionAt(int offset)\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar text = GetMemberTextToCaret(); \n\n\t\t\tint closingBrackets = 0, generatedLines = 0;\n\t\t\tvar sb = CreateWrapper(\"a;\", false, \"\", text.Item1, text.Item2, ref closingBrackets, ref generatedLines);\n\n\t\t\tvar completionUnit = parser.Parse(sb.ToString());\n\t\t\tvar offsetLocation = document.GetLocation(offset);\n\t\t\tvar loc = new TextLocation(offsetLocation.Line - text.Item2.Line + generatedLines + 1, offsetLocation.Column);\n\n\t\t\tvar expr = completionUnit.GetNodeAt(\n\t\t\t\tloc,\n\t\t\t\tn => n is Expression || n is VariableDeclarationStatement\n\t\t\t);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\t\t\treturn new ExpressionResult(expr, completionUnit);\n\t\t}\n\n\t\tExpressionResult GetNewExpressionAt(int offset)\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar text = GetMemberTextToCaret();\n\t\t\tint closingBrackets = 0, generatedLines = 0;\n\t\t\tvar sb = CreateWrapper(\"a ();\", false, \"\", text.Item1, text.Item2, ref closingBrackets, ref generatedLines);\n\n\t\t\tvar completionUnit = parser.Parse(sb.ToString());\n\t\t\tvar offsetLocation = document.GetLocation(offset);\n\t\t\tvar loc = new TextLocation(offsetLocation.Line - text.Item2.Line + generatedLines + 1, offsetLocation.Column);\n\n\t\t\tvar expr = completionUnit.GetNodeAt(loc, n => n is Expression);\n\t\t\tif (expr == null) {\n\t\t\t\t// try without \";\"\n\t\t\t\tsb = CreateWrapper(\"a ()\", false, \"\", text.Item1, text.Item2, ref closingBrackets, ref generatedLines);\n\t\t\t\tcompletionUnit = parser.Parse(sb.ToString());\n\n\t\t\t\texpr = completionUnit.GetNodeAt(loc, n => n is Expression);\n\t\t\t\tif (expr == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new ExpressionResult(expr, completionUnit);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Helper methods\n\n\t\tstring GetPreviousToken(ref int i, bool allowLineChange)\n\t\t{\n\t\t\tchar c;\n\t\t\tif (i <= 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tdo {\n\t\t\t\tc = document.GetCharAt(--i);\n\t\t\t} while (i > 0 && char.IsWhiteSpace(c) && (allowLineChange ? true : c != '\\n'));\n\n\t\t\tif (i == 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (!char.IsLetterOrDigit(c)) {\n\t\t\t\treturn new string(c, 1);\n\t\t\t}\n\n\t\t\tint endOffset = i + 1;\n\n\t\t\tdo {\n\t\t\t\tc = document.GetCharAt(i - 1);\n\t\t\t\tif (!(char.IsLetterOrDigit(c) || c == '_')) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\ti--;\n\t\t\t} while (i > 0);\n\n\t\t\treturn document.GetText(i, endOffset - i);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Preprocessor\n\n\t\tIEnumerable<ICompletionData> GetDirectiveCompletionData()\n\t\t{\n\t\t\tyield return factory.CreateLiteralCompletionData(\"if\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"else\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"elif\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"endif\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"define\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"undef\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"warning\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"error\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"pragma\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"line\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"line hidden\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"line default\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"region\");\n\t\t\tyield return factory.CreateLiteralCompletionData(\"endregion\");\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Xml Comments\n\n\t\tstatic readonly List<string> commentTags = new List<string>(new string[] {\n\t\t\t\"c\",\n\t\t\t\"code\",\n\t\t\t\"example\",\n\t\t\t\"exception\",\n\t\t\t\"include\",\n\t\t\t\"list\",\n\t\t\t\"listheader\",\n\t\t\t\"item\",\n\t\t\t\"term\",\n\t\t\t\"description\",\n\t\t\t\"para\",\n\t\t\t\"param\",\n\t\t\t\"paramref\",\n\t\t\t\"permission\",\n\t\t\t\"remarks\",\n\t\t\t\"returns\",\n\t\t\t\"see\",\n\t\t\t\"seealso\",\n\t\t\t\"summary\",\n\t\t\t\"value\"\n\t\t}\n\t\t);\n\n\t\tpublic static IEnumerable<string> CommentTags {\n\t\t\tget {\n\t\t\t\treturn commentTags;\n\t\t\t}\n\t\t}\n\n\t\tstring GetLastClosingXmlCommentTag()\n\t\t{\n\t\t\tvar line = document.GetLineByNumber(location.Line);\n\n\t\t\trestart:\n\t\t\tstring lineText = document.GetText(line);\n\t\t\tif (!lineText.Trim().StartsWith(\"///\", StringComparison.Ordinal))\n\t\t\t\treturn null;\n\t\t\tint startIndex = Math.Min(location.Column - 1, lineText.Length - 1) - 1;\n\t\t\twhile (startIndex > 0 && lineText [startIndex] != '<') {\n\t\t\t\t--startIndex;\n\t\t\t\tif (lineText [startIndex] == '/') {\n\t\t\t\t\t// already closed.\n\t\t\t\t\tstartIndex = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (startIndex < 0 && line.PreviousLine != null) {\n\t\t\t\tline = line.PreviousLine;\n\t\t\t\tgoto restart;\n\t\t\t}\n\n\t\t\tif (startIndex >= 0) {\n\t\t\t\tint endIndex = startIndex;\n\t\t\t\twhile (endIndex + 1 < lineText.Length && lineText [endIndex] != '>' && !char.IsWhiteSpace(lineText [endIndex])) {\n\t\t\t\t\tendIndex++;\n\t\t\t\t}\n\t\t\t\tstring tag = endIndex - startIndex - 1 > 0 ? lineText.Substring(\n\t\t\t\t\tstartIndex + 1,\n\t\t\t\t\tendIndex - startIndex - 1\n\t\t\t\t) : null;\n\t\t\t\tif (!string.IsNullOrEmpty(tag) && commentTags.IndexOf(tag) >= 0) {\n\t\t\t\t\treturn tag;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tIEnumerable<ICompletionData> GetXmlDocumentationCompletionData()\n\t\t{\n\t\t\tvar closingTag = GetLastClosingXmlCommentTag();\n\t\t\tif (closingTag != null) {\n\t\t\t\tyield return factory.CreateLiteralCompletionData(\n\t\t\t\t\t\"/\" + closingTag + \">\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"c\",\n\t\t\t\t\"Set text in a code-like font\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"code\",\n\t\t\t\t\"Set one or more lines of source code or program output\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"example\",\n\t\t\t\t\"Indicate an example\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"exception\",\n\t\t\t\t\"Identifies the exceptions a method can throw\",\n\t\t\t\t\"exception cref=\\\"|\\\"></exception\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"include\",\n\t\t\t\t\"Includes comments from a external file\",\n\t\t\t\t\"include file=\\\"|\\\" path=\\\"\\\"\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"inheritdoc\",\n\t\t\t\t\"Inherit documentation from a base class or interface\",\n\t\t\t\t\"inheritdoc/\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"list\",\n\t\t\t\t\"Create a list or table\",\n\t\t\t\t\"list type=\\\"|\\\"\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"listheader\",\n\t\t\t\t\"Define the heading row\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"item\",\n\t\t\t\t\"Defines list or table item\"\n\t\t\t);\n\n\t\t\tyield return factory.CreateXmlDocCompletionData(\"term\", \"A term to define\");\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"description\",\n\t\t\t\t\"Describes a list item\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"para\",\n\t\t\t\t\"Permit structure to be added to text\"\n\t\t\t);\n\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"param\",\n\t\t\t\t\"Describe a parameter for a method or constructor\",\n\t\t\t\t\"param name=\\\"|\\\"\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"paramref\",\n\t\t\t\t\"Identify that a word is a parameter name\",\n\t\t\t\t\"paramref name=\\\"|\\\"/\"\n\t\t\t);\n\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"permission\",\n\t\t\t\t\"Document the security accessibility of a member\",\n\t\t\t\t\"permission cref=\\\"|\\\"\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"remarks\",\n\t\t\t\t\"Describe a type\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"returns\",\n\t\t\t\t\"Describe the return value of a method\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"see\",\n\t\t\t\t\"Specify a link\",\n\t\t\t\t\"see cref=\\\"|\\\"/\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"seealso\",\n\t\t\t\t\"Generate a See Also entry\",\n\t\t\t\t\"seealso cref=\\\"|\\\"/\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"summary\",\n\t\t\t\t\"Describe a member of a type\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"typeparam\",\n\t\t\t\t\"Describe a type parameter for a generic type or method\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"typeparamref\",\n\t\t\t\t\"Identify that a word is a type parameter name\"\n\t\t\t);\n\t\t\tyield return factory.CreateXmlDocCompletionData(\n\t\t\t\t\"value\",\n\t\t\t\t\"Describe a property\"\n\t\t\t);\n\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Keywords\n\n\t\tstatic string[] expressionLevelKeywords = new string [] {\n\t\t\t\"as\",\n\t\t\t\"is\",\n\t\t\t\"else\",\n\t\t\t\"out\",\n\t\t\t\"ref\",\n\t\t\t\"null\",\n\t\t\t\"delegate\",\n\t\t\t\"default\"\n\t\t};\n\t\tstatic string[] primitiveTypesKeywords = new string [] {\n\t\t\t\"void\",\n\t\t\t\"object\",\n\t\t\t\"bool\",\n\t\t\t\"byte\",\n\t\t\t\"sbyte\",\n\t\t\t\"char\",\n\t\t\t\"short\",\n\t\t\t\"int\",\n\t\t\t\"long\",\n\t\t\t\"ushort\",\n\t\t\t\"uint\",\n\t\t\t\"ulong\",\n\t\t\t\"float\",\n\t\t\t\"double\",\n\t\t\t\"decimal\",\n\t\t\t\"string\"\n\t\t};\n\t\tstatic string[] statementStartKeywords = new string [] { \"base\", \"new\", \"sizeof\", \"this\", \n\t\t\t\"true\", \"false\", \"typeof\", \"checked\", \"unchecked\", \"from\", \"break\", \"checked\",\n\t\t\t\"unchecked\", \"const\", \"continue\", \"do\", \"finally\", \"fixed\", \"for\", \"foreach\",\n\t\t\t\"goto\", \"if\", \"lock\", \"return\", \"stackalloc\", \"switch\", \"throw\", \"try\", \"unsafe\", \n\t\t\t\"using\", \"while\", \"yield\",\n\t\t\t\"catch\"\n\t\t};\n\t\tstatic string[] globalLevelKeywords = new string [] {\n\t\t\t\"namespace\", \"using\", \"extern\", \"public\", \"internal\", \n\t\t\t\"class\", \"interface\", \"struct\", \"enum\", \"delegate\",\n\t\t\t\"abstract\", \"sealed\", \"static\", \"unsafe\", \"partial\"\n\t\t};\n\t\tstatic string[] accessorModifierKeywords = new string [] {\n\t\t\t\"public\", \"internal\", \"protected\", \"private\", \"async\"\n\t\t};\n\t\tstatic string[] typeLevelKeywords = new string [] {\n\t\t\t\"public\", \"internal\", \"protected\", \"private\", \"async\",\n\t\t\t\"class\", \"interface\", \"struct\", \"enum\", \"delegate\",\n\t\t\t\"abstract\", \"sealed\", \"static\", \"unsafe\", \"partial\",\n\t\t\t\"const\", \"event\", \"extern\", \"fixed\", \"new\", \n\t\t\t\"operator\", \"explicit\", \"implicit\", \n\t\t\t\"override\", \"readonly\", \"virtual\", \"volatile\"\n\t\t};\n\t\tstatic string[] linqKeywords = new string[] {\n\t\t\t\"from\",\n\t\t\t\"where\",\n\t\t\t\"select\",\n\t\t\t\"group\",\n\t\t\t\"into\",\n\t\t\t\"orderby\",\n\t\t\t\"join\",\n\t\t\t\"let\",\n\t\t\t\"in\",\n\t\t\t\"on\",\n\t\t\t\"equals\",\n\t\t\t\"by\",\n\t\t\t\"ascending\",\n\t\t\t\"descending\"\n\t\t};\n\t\tstatic string[] parameterTypePredecessorKeywords = new string[] {\n\t\t\t\"out\",\n\t\t\t\"ref\",\n\t\t\t\"params\"\n\t\t};\n\n\t\t#endregion\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngineBase.cs",
    "content": "﻿// \n// CSharpCompletionEngineBase.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Completion\n{\n\t/// <summary>\n\t/// Acts as a common base between code completion and parameter completion.\n\t/// </summary>\n\tpublic class CSharpCompletionEngineBase\n\t{\n\t\tprotected IDocument document;\n\t\tprotected int offset;\n\t\tprotected TextLocation location;\n\t\tprotected IUnresolvedTypeDefinition currentType;\n\t\tprotected IUnresolvedMember currentMember;\n\t\t\n\t\t#region Input properties\n\t\tpublic CSharpTypeResolveContext ctx { get; private set; }\n\n\t\tpublic IProjectContent ProjectContent { get; private set; }\n\t\t\n\t\tICompilation compilation;\n\n\t\tprotected ICompilation Compilation {\n\t\t\tget {\n\t\t\t\tif (compilation == null)\n\t\t\t\t\tcompilation = ProjectContent.Resolve (ctx).Compilation;\n\t\t\t\treturn compilation;\n\t\t\t}\n\t\t}\n\n\t\tVersion languageVersion = new Version (5, 0);\n\t\tpublic Version LanguageVersion {\n\t\t\tget {\n\t\t\t\treturn languageVersion;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tlanguageVersion = value;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\tprotected CSharpCompletionEngineBase(IProjectContent content, ICompletionContextProvider completionContextProvider, CSharpTypeResolveContext ctx)\n\t\t{\n\t\t\tif (content == null)\n\t\t\t\tthrow new ArgumentNullException(\"content\");\n\t\t\tif (ctx == null)\n\t\t\t\tthrow new ArgumentNullException(\"ctx\");\n\t\t\tif (completionContextProvider == null)\n\t\t\t\tthrow new ArgumentNullException(\"completionContextProvider\");\n\t\t\t\n\t\t\tthis.ProjectContent = content;\n\t\t\tthis.CompletionContextProvider = completionContextProvider;\n\t\t\tthis.ctx = ctx;\n\t\t}\n\t\t\n\t\t\n\t\tpublic ICompletionContextProvider CompletionContextProvider {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\tpublic void SetOffset (int offset)\n\t\t{\n\t\t\tReset ();\n\t\t\t\n\t\t\tthis.offset = offset;\n\t\t\tthis.location = document.GetLocation (offset);\n\t\t\tCompletionContextProvider.GetCurrentMembers (offset, out currentType, out currentMember);\n\t\t}\n\n\t\tpublic bool GetParameterCompletionCommandOffset (out int cpos)\n\t\t{\n\t\t\t// Start calculating the parameter offset from the beginning of the\n\t\t\t// current member, instead of the beginning of the file. \n\t\t\tcpos = offset - 1;\n\t\t\tvar mem = currentMember;\n\t\t\tif (mem == null || (mem is IType) || IsInsideCommentStringOrDirective ()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tint startPos = document.GetOffset (mem.Region.BeginLine, mem.Region.BeginColumn);\n\t\t\tint parenDepth = 0;\n\t\t\tint chevronDepth = 0;\n\t\t\tStack<int> indexStack = new Stack<int> ();\n\t\t\twhile (cpos > startPos) {\n\t\t\t\tchar c = document.GetCharAt (cpos);\n\t\t\t\tif (c == ')') {\n\t\t\t\t\tparenDepth++;\n\t\t\t\t}\n\t\t\t\tif (c == '>') {\n\t\t\t\t\tchevronDepth++;\n\t\t\t\t}\n\t\t\t\tif (c == '}') {\n\t\t\t\t\tif (indexStack.Count > 0) {\n\t\t\t\t\t\tparenDepth = indexStack.Pop ();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparenDepth = 0;\n\t\t\t\t\t}\n\t\t\t\t\tchevronDepth = 0;\n\t\t\t\t}\n\t\t\t\tif (indexStack.Count == 0 && (parenDepth == 0 && c == '(' || chevronDepth == 0 && c == '<')) {\n\t\t\t\t\tint p = GetCurrentParameterIndex (startPos, cpos + 1);\n\t\t\t\t\tif (p != -1) {\n\t\t\t\t\t\tcpos++;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (c == '(') {\n\t\t\t\t\tparenDepth--;\n\t\t\t\t}\n\t\t\t\tif (c == '<') {\n\t\t\t\t\tchevronDepth--;\n\t\t\t\t}\n\t\t\t\tif (c == '{') {\n\t\t\t\t\tindexStack.Push (parenDepth);\n\t\t\t\t\tchevronDepth = 0;\n\t\t\t\t}\n\t\t\t\tcpos--;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic int GetCurrentParameterIndex(int triggerOffset, int endOffset)\n\t\t{\n\t\t\tList<string> list;\n\t\t\treturn  GetCurrentParameterIndex (triggerOffset, endOffset, out list);\n\t\t}\n\n\t\tpublic int GetCurrentParameterIndex (int triggerOffset, int endOffset, out List<string> usedNamedParameters)\n\t\t{\n\t\t\tusedNamedParameters =new List<string> ();\n\t\t\tvar parameter = new Stack<int> ();\n\t\t\tvar bracketStack = new Stack<Stack<int>> ();\n\t\t\tbool inSingleComment = false, inString = false, inVerbatimString = false, inChar = false, inMultiLineComment = false;\n\t\t\tvar word = new StringBuilder ();\n\t\t\tbool foundCharAfterOpenBracket = false;\n\t\t\tfor (int i = triggerOffset; i < endOffset; i++) {\n\t\t\t\tchar ch = document.GetCharAt (i);\n\t\t\t\tchar nextCh = i + 1 < document.TextLength ? document.GetCharAt (i + 1) : '\\0';\n\t\t\t\tif (ch == ':') {\n\t\t\t\t\tusedNamedParameters.Add (word.ToString ());\n\t\t\t\t\tword.Length = 0;\n\t\t\t\t} else if (char.IsLetterOrDigit (ch) || ch =='_') {\n\t\t\t\t\tword.Append (ch);\n\t\t\t\t} else if (char.IsWhiteSpace (ch)) {\n\n\t\t\t\t} else {\n\t\t\t\t\tword.Length = 0;\n\t\t\t\t}\n\t\t\t\tif (!char.IsWhiteSpace(ch) && parameter.Count > 0)\n\t\t\t\t\tfoundCharAfterOpenBracket = true;\n\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase '{':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbracketStack.Push (parameter);\n\t\t\t\t\t\tparameter = new Stack<int> ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '[':\n\t\t\t\t\tcase '(':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparameter.Push (0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '}':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (bracketStack.Count > 0) {\n\t\t\t\t\t\t\tparameter = bracketStack.Pop ();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ']':\n\t\t\t\t\tcase ')':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (parameter.Count > 0) {\n\t\t\t\t\t\t\tparameter.Pop ();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '<':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparameter.Push (0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '=':\n\t\t\t\t\t\tif (nextCh == '>') {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '>':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (parameter.Count > 0) {\n\t\t\t\t\t\t\tparameter.Pop ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ',':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (parameter.Count > 0) {\n\t\t\t\t\t\t\tparameter.Push (parameter.Pop () + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '/':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tinSingleComment = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nextCh == '*') {\n\t\t\t\t\t\t\tinMultiLineComment = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tinMultiLineComment = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '@':\n\t\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tinVerbatimString = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\tif (inString || inChar) {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\"':\n\t\t\t\t\t\tif (inSingleComment || inMultiLineComment || inChar) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (inVerbatimString) {\n\t\t\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinVerbatimString = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinString = !inString;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\\'':\n\t\t\t\t\t\tif (inSingleComment || inMultiLineComment || inString || inVerbatimString) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinChar = !inChar;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (NewLine.IsNewLine(ch)) {\n\t\t\t\t\t\t\tinSingleComment = false;\n\t\t\t\t\t\t\tinString = false;\n\t\t\t\t\t\t\tinChar = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (parameter.Count != 1 || bracketStack.Count > 0) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (!foundCharAfterOpenBracket)\n\t\t\t\treturn 0;\n\t\t\treturn parameter.Pop() + 1;\n\t\t}\n\n\t\t#region Context helper methods\n\t\tpublic class MiniLexer\n\t\t{\n\t\t\treadonly string text;\n\n\t\t\tpublic bool IsFistNonWs               = true;\n\t\t\tpublic bool IsInSingleComment         = false;\n\t\t\tpublic bool IsInString                = false;\n\t\t\tpublic bool IsInVerbatimString        = false;\n\t\t\tpublic bool IsInChar                  = false;\n\t\t\tpublic bool IsInMultiLineComment      = false;\n\t\t\tpublic bool IsInPreprocessorDirective = false;\n\n\t\t\tpublic MiniLexer(string text)\n\t\t\t{\n\t\t\t\tthis.text = text;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// Parsing all text and calling act delegate on almost every character.\n\t\t\t/// Skipping begining of comments, begining of verbatim strings and escaped characters.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"act\">Return true to abort parsing. Integer argument represent offset in text.</param>\n\t\t\t/// <returns>True if aborted.</returns>\n\t\t\tpublic bool Parse(Func<char, int, bool> act = null)\n\t\t\t{\n\t\t\t\treturn Parse(0, text.Length, act);\n\t\t\t}\n\n\n\t\t\t/// <summary>\n\t\t\t/// Parsing text from start to start+length and calling act delegate on almost every character.\n\t\t\t/// Skipping begining of comments, begining of verbatim strings and escaped characters.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"start\">Start offset.</param>\n\t\t\t/// <param name=\"length\">Lenght to parse.</param>\n\t\t\t/// <param name=\"act\">Return true to abort parsing. Integer argument represent offset in text.</param>\n\t\t\t/// <returns>True if aborted.</returns>\n\t\t\tpublic bool Parse(int start, int length, Func<char, int, bool> act = null)\n\t\t\t{\n\t\t\t\tfor (int i = start; i < length; i++) {\n\t\t\t\t\tchar ch = text [i];\n\t\t\t\t\tchar nextCh = i + 1 < text.Length ? text [i + 1] : '\\0';\n\t\t\t\t\tswitch (ch) {\n\t\t\t\t\t\tcase '#':\n\t\t\t\t\t\t\tif (IsFistNonWs)\n\t\t\t\t\t\t\t\tIsInPreprocessorDirective = true;\n\t\t\t\t\t\t\tbreak; \n\t\t\t\t\t\tcase '/':\n\t\t\t\t\t\t\tif (IsInString || IsInChar || IsInVerbatimString || IsInSingleComment || IsInMultiLineComment)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tIsInSingleComment = true;\n\t\t\t\t\t\t\t\tIsInPreprocessorDirective = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (nextCh == '*' && !IsInPreprocessorDirective) {\n\t\t\t\t\t\t\t\tIsInMultiLineComment = true;\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '*':\n\t\t\t\t\t\t\tif (IsInString || IsInChar || IsInVerbatimString || IsInSingleComment)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tIsInMultiLineComment = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '@':\n\t\t\t\t\t\t\tif (IsInString || IsInChar || IsInVerbatimString || IsInSingleComment || IsInMultiLineComment)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tIsInVerbatimString = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '\\n':\n\t\t\t\t\t\tcase '\\r':\n\t\t\t\t\t\t\tIsInSingleComment = false;\n\t\t\t\t\t\t\tIsInString = false;\n\t\t\t\t\t\t\tIsInChar = false;\n\t\t\t\t\t\t\tIsFistNonWs = true;\n\t\t\t\t\t\t\tIsInPreprocessorDirective = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\t\tif (IsInString || IsInChar)\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '\"':\n\t\t\t\t\t\t\tif (IsInSingleComment || IsInMultiLineComment || IsInChar)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tif (IsInVerbatimString) {\n\t\t\t\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tIsInVerbatimString = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tIsInString = !IsInString;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '\\'':\n\t\t\t\t\t\t\tif (IsInSingleComment || IsInMultiLineComment || IsInString || IsInVerbatimString)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tIsInChar = !IsInChar;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (act != null)\n\t\t\t\t\tif (act (ch, i))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tIsFistNonWs &= ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r';\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tprotected bool IsInsideCommentStringOrDirective(int offset)\n\t\t{\n\t\t\tvar lexer = new MiniLexer(document.Text);\n\t\t\tlexer.Parse(0, offset);\n\t\t\treturn\n\t\t\t\tlexer.IsInSingleComment || \n\t\t\t\tlexer.IsInString ||\n\t\t\t\tlexer.IsInVerbatimString ||\n\t\t\t\tlexer.IsInChar ||\n\t\t\t\tlexer.IsInMultiLineComment || \n\t\t\t\tlexer.IsInPreprocessorDirective;\n\t\t}\n\n\n\t\tprotected bool IsInsideCommentStringOrDirective()\n\t\t{\n\t\t\tvar text = GetMemberTextToCaret();\n\t\t\tvar lexer = new MiniLexer(text.Item1);\n\t\t\tlexer.Parse();\n\t\t\treturn\n\t\t\t\tlexer.IsInSingleComment || \n\t\t\t\t\tlexer.IsInString ||\n\t\t\t\t\tlexer.IsInVerbatimString ||\n\t\t\t\t\tlexer.IsInChar ||\n\t\t\t\t\tlexer.IsInMultiLineComment || \n\t\t\t\t\tlexer.IsInPreprocessorDirective;\n\t\t}\n\n\t\tprotected bool IsInsideDocComment ()\n\t\t{\n\t\t\tvar text = GetMemberTextToCaret ();\n\t\t\tbool inSingleComment = false, inString = false, inVerbatimString = false, inChar = false, inMultiLineComment = false;\n\t\t\tbool singleLineIsDoc = false;\n\t\t\t\n\t\t\tfor (int i = 0; i < text.Item1.Length - 1; i++) {\n\t\t\t\tchar ch = text.Item1 [i];\n\t\t\t\tchar nextCh = text.Item1 [i + 1];\n\t\t\t\t\n\t\t\t\tswitch (ch) {\n\t\t\t\tcase '/':\n\t\t\t\t\tif (inString || inChar || inVerbatimString)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tinSingleComment = true;\n\t\t\t\t\t\tsingleLineIsDoc = i + 1 < text.Item1.Length && text.Item1 [i + 1] == '/';\n\t\t\t\t\t\tif (singleLineIsDoc) {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nextCh == '*')\n\t\t\t\t\t\tinMultiLineComment = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tinMultiLineComment = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '@':\n\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tinVerbatimString = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\n':\n\t\t\t\tcase '\\r':\n\t\t\t\t\tinSingleComment = false;\n\t\t\t\t\tinString = false;\n\t\t\t\t\tinChar = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tif (inString || inChar)\n\t\t\t\t\t\ti++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\"':\n\t\t\t\t\tif (inSingleComment || inMultiLineComment || inChar)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (inVerbatimString) {\n\t\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinVerbatimString = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tinString = !inString;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\'':\n\t\t\t\t\tif (inSingleComment || inMultiLineComment || inString || inVerbatimString)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tinChar = !inChar;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn inSingleComment && singleLineIsDoc;\n\t\t}\n\n\t\tprotected CSharpResolver GetState ()\n\t\t{\n\t\t\treturn new CSharpResolver (ctx);\n\t\t\t/*var state = new CSharpResolver (ctx);\n\t\t\t\n\t\t\tstate.CurrentMember = currentMember;\n\t\t\tstate.CurrentTypeDefinition = currentType;\n\t\t\tstate.CurrentUsingScope = CSharpUnresolvedFile.GetUsingScope (location);\n\t\t\tif (state.CurrentMember != null) {\n\t\t\t\tvar node = Unit.GetNodeAt (location);\n\t\t\t\tif (node == null)\n\t\t\t\t\treturn state;\n\t\t\t\tvar navigator = new NodeListResolveVisitorNavigator (new[] { node });\n\t\t\t\tvar visitor = new ResolveVisitor (state, CSharpUnresolvedFile, navigator);\n\t\t\t\tUnit.AcceptVisitor (visitor, null);\n\t\t\t\ttry {\n\t\t\t\t\tvar newState = visitor.GetResolverStateBefore (node);\n\t\t\t\t\tif (newState != null)\n\t\t\t\t\t\tstate = newState;\n\t\t\t\t} catch (Exception) {\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn state;*/\n\t\t}\n\t\t\t\t#endregion\n\t\t\n\t\t#region Basic parsing/resolving functions\n\t\tstatic Stack<Tuple<char, int>> GetBracketStack (string memberText)\n\t\t{\n\t\t\tvar bracketStack = new Stack<Tuple<char, int>> ();\n\t\t\t\n\t\t\tbool inSingleComment = false, inString = false, inVerbatimString = false, inChar = false, inMultiLineComment = false;\n\t\t\t\n\t\t\tfor (int i = 0; i < memberText.Length; i++) {\n\t\t\t\tchar ch = memberText [i];\n\t\t\t\tchar nextCh = i + 1 < memberText.Length ? memberText [i + 1] : '\\0';\n\t\t\t\tswitch (ch) {\n\t\t\t\tcase '(':\n\t\t\t\tcase '[':\n\t\t\t\tcase '{':\n\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tbracketStack.Push (Tuple.Create (ch, i));\n\t\t\t\t\tbreak;\n\t\t\t\tcase ')':\n\t\t\t\tcase ']':\n\t\t\t\tcase '}':\n\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (bracketStack.Count > 0)\n\t\t\t\t\t\tbracketStack.Pop ();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '/':\n\t\t\t\t\tif (inString || inChar || inVerbatimString)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tinSingleComment = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (nextCh == '*')\n\t\t\t\t\t\tinMultiLineComment = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (nextCh == '/') {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tinMultiLineComment = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '@':\n\t\t\t\t\tif (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tinVerbatimString = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tif (inString || inChar)\n\t\t\t\t\t\ti++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\"':\n\t\t\t\t\tif (inSingleComment || inMultiLineComment || inChar)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (inVerbatimString) {\n\t\t\t\t\t\tif (nextCh == '\"') {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinVerbatimString = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tinString = !inString;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\'':\n\t\t\t\t\tif (inSingleComment || inMultiLineComment || inString || inVerbatimString)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tinChar = !inChar;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tif (NewLine.IsNewLine(ch)) {\n\t\t\t\t\t\tinSingleComment = false;\n\t\t\t\t\t\tinString = false;\n\t\t\t\t\t\tinChar = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn bracketStack;\n\t\t}\n\t\t\n\t\tpublic static void AppendMissingClosingBrackets (StringBuilder wrapper, bool appendSemicolon)\n\t\t{\n\t\t\tvar memberText = wrapper.ToString();\n\t\t\tvar bracketStack = GetBracketStack(memberText);\n\t\t\tbool didAppendSemicolon = !appendSemicolon;\n\t\t\t//char lastBracket = '\\0';\n\t\t\twhile (bracketStack.Count > 0) {\n\t\t\t\tvar t = bracketStack.Pop ();\n\t\t\t\tswitch (t.Item1) {\n\t\t\t\tcase '(':\n\t\t\t\t\twrapper.Append (')');\n\t\t\t\t\tif (appendSemicolon)\n\t\t\t\t\t\tdidAppendSemicolon = false;\n\t\t\t\t\t//lastBracket = ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '[':\n\t\t\t\t\twrapper.Append (']');\n\t\t\t\t\tif (appendSemicolon)\n\t\t\t\t\t\tdidAppendSemicolon = false;\n\t\t\t\t\t//lastBracket = ']';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '<':\n\t\t\t\t\twrapper.Append ('>');\n\t\t\t\t\tif (appendSemicolon)\n\t\t\t\t\t\tdidAppendSemicolon = false;\n\t\t\t\t\t//lastBracket = '>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '{':\n\t\t\t\t\tint o = t.Item2 - 1;\n\t\t\t\t\tif (!didAppendSemicolon) {\n\t\t\t\t\t\tdidAppendSemicolon = true;\n\t\t\t\t\t\twrapper.Append (';');\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tbool didAppendCatch = false;\n\t\t\t\t\twhile (o >= \"try\".Length) {\n\t\t\t\t\t\tchar ch = memberText [o];\n\t\t\t\t\t\tif (!char.IsWhiteSpace (ch)) {\n\t\t\t\t\t\t\t\tif (ch == 'y' && memberText [o - 1] == 'r' && memberText [o - 2] == 't' && (o - 3 < 0 || !char.IsLetterOrDigit(memberText [o - 3]))) {\n\t\t\t\t\t\t\t\twrapper.Append (\"} catch {}\");\n\t\t\t\t\t\t\t\tdidAppendCatch = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\to--;\n\t\t\t\t\t}\n\t\t\t\t\tif (!didAppendCatch)\n\t\t\t\t\t\twrapper.Append ('}');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!didAppendSemicolon)\n\t\t\t\twrapper.Append (';');\n\t\t}\n\n\t\tprotected StringBuilder CreateWrapper(string continuation, bool appendSemicolon, string afterContinuation, string memberText, TextLocation memberLocation, ref int closingBrackets, ref int generatedLines)\n\t\t{\n\t\t\tvar wrapper = new StringBuilder();\n\t\t\tbool wrapInClass = memberLocation != new TextLocation(1, 1);\n\t\t\tif (wrapInClass) {\n\t\t\t\twrapper.Append(\"class Stub {\");\n\t\t\t\twrapper.AppendLine();\n\t\t\t\tclosingBrackets++;\n\t\t\t\tgeneratedLines++;\n\t\t\t}\n\t\t\twrapper.Append(memberText);\n\t\t\twrapper.Append(continuation);\n\t\t\tAppendMissingClosingBrackets(wrapper, appendSemicolon);\n\t\t\twrapper.Append(afterContinuation);\n\t\t\tif (closingBrackets > 0) {\n\t\t\t\twrapper.Append(new string('}', closingBrackets));\n\t\t\t}\n\t\t\treturn wrapper;\n\t\t}\n\n\t\tprotected SyntaxTree ParseStub(string continuation, bool appendSemicolon = true, string afterContinuation = null)\n\t\t{\n\t\t\tvar mt = GetMemberTextToCaret();\n\t\t\tif (mt == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tstring memberText = mt.Item1;\n\t\t\tvar memberLocation = mt.Item2;\n\t\t\tint closingBrackets = 1;\n\t\t\tint generatedLines = 0;\n\t\t\tvar wrapper = CreateWrapper(continuation, appendSemicolon, afterContinuation, memberText, memberLocation, ref closingBrackets, ref generatedLines);\n\t\t\tvar parser = new CSharpParser ();\n\t\t\tforeach (var sym in CompletionContextProvider.ConditionalSymbols)\n\t\t\t\tparser.CompilerSettings.ConditionalSymbols.Add (sym);\n\t\t\tparser.InitialLocation = new TextLocation(memberLocation.Line - generatedLines, 1);\n\t\t\tvar result = parser.Parse(wrapper.ToString ());\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tprotected virtual void Reset ()\n\t\t{\n\t\t\tmemberText = null;\n\t\t}\n\n\t\tTuple<string, TextLocation> memberText;\n\t\tprotected Tuple<string, TextLocation> GetMemberTextToCaret()\n\t\t{\n\t\t\tif (memberText == null)\n\t\t\t\tmemberText = CompletionContextProvider.GetMemberTextToCaret(offset, currentType, currentMember);\n\t\t\treturn memberText;\n\t\t}\n\n\t\tprotected ExpressionResult GetInvocationBeforeCursor(bool afterBracket)\n\t\t{\n\t\t\tSyntaxTree baseUnit;\n\t\t\tbaseUnit = ParseStub(\"a\", false);\n\n\t\t\tvar section = baseUnit.GetNodeAt<AttributeSection>(location.Line, location.Column - 2);\n\t\t\tvar attr = section != null ? section.Attributes.LastOrDefault() : null;\n\t\t\tif (attr != null) {\n\t\t\t\treturn new ExpressionResult((AstNode)attr, baseUnit);\n\t\t\t}\n\n\t\t\t//var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin;\n\t\t\tvar mref = baseUnit.GetNodeAt(location.Line, location.Column - 1, n => n is InvocationExpression || n is ObjectCreateExpression); \n\t\t\tAstNode expr = null;\n\t\t\tif (mref is InvocationExpression) {\n\t\t\t\texpr = ((InvocationExpression)mref).Target;\n\t\t\t} else if (mref is ObjectCreateExpression) {\n\t\t\t\texpr = mref;\n\t\t\t} else {\n\t\t\t\tbaseUnit = ParseStub(\")};\", false);\n\t\t\t\tmref = baseUnit.GetNodeAt(location.Line, location.Column - 1, n => n is InvocationExpression || n is ObjectCreateExpression); \n\t\t\t\tif (mref is InvocationExpression) {\n\t\t\t\t\texpr = ((InvocationExpression)mref).Target;\n\t\t\t\t} else if (mref is ObjectCreateExpression) {\n\t\t\t\t\texpr = mref;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr == null) {\n\t\t\t\t// work around for missing ';' bug in mcs:\n\t\t\t\tbaseUnit = ParseStub(\"a\", true);\n\t\t\t\n\t\t\t\tsection = baseUnit.GetNodeAt<AttributeSection>(location.Line, location.Column - 2);\n\t\t\t\tattr = section != null ? section.Attributes.LastOrDefault() : null;\n\t\t\t\tif (attr != null) {\n\t\t\t\t\treturn new ExpressionResult((AstNode)attr, baseUnit);\n\t\t\t\t}\n\t\n\t\t\t\t//var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin;\n\t\t\t\tmref = baseUnit.GetNodeAt(location.Line, location.Column - 1, n => n is InvocationExpression || n is ObjectCreateExpression); \n\t\t\t\texpr = null;\n\t\t\t\tif (mref is InvocationExpression) {\n\t\t\t\t\texpr = ((InvocationExpression)mref).Target;\n\t\t\t\t} else if (mref is ObjectCreateExpression) {\n\t\t\t\t\texpr = mref;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new ExpressionResult ((AstNode)expr, baseUnit);\n\t\t}\n\t\t\n\t\tpublic class ExpressionResult\n\t\t{\n\t\t\tpublic AstNode Node { get; private set; }\n\t\t\tpublic SyntaxTree Unit  { get; private set; }\n\t\t\t\n\t\t\t\n\t\t\tpublic ExpressionResult (AstNode item2, SyntaxTree item3)\n\t\t\t{\n\t\t\t\tthis.Node = item2;\n\t\t\t\tthis.Unit = item3;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString ()\n\t\t\t{\n\t\t\t\treturn string.Format (\"[ExpressionResult: Node={0}, Unit={1}]\", Node, Unit);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected ExpressionResolveResult ResolveExpression (ExpressionResult tuple)\n\t\t{\n\t\t\treturn ResolveExpression (tuple.Node);\n\t\t}\n\n\t\tprotected class ExpressionResolveResult\n\t\t{\n\t\t\tpublic ResolveResult Result { get; set; }\n\t\t\tpublic CSharpResolver Resolver { get; set; }\n\t\t\tpublic CSharpAstResolver AstResolver { get; set; }\n\n\t\t\tpublic ExpressionResolveResult(ResolveResult item1, CSharpResolver item2, CSharpAstResolver item3)\n\t\t\t{\n\t\t\t\tthis.Result = item1;\n\t\t\t\tthis.Resolver = item2;\n\t\t\t\tthis.AstResolver = item3;\n\t\t\t}\n\t\t}\n\n\t\tprotected ExpressionResolveResult ResolveExpression(AstNode expr)\n\t\t{\n\t\t\tif (expr == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tAstNode resolveNode;\n\t\t\tif (expr is Expression || expr is AstType) {\n\t\t\t\tresolveNode = expr;\n\t\t\t} else if (expr is VariableDeclarationStatement) {\n\t\t\t\tresolveNode = ((VariableDeclarationStatement)expr).Type;\n\t\t\t} else {\n\t\t\t\tresolveNode = expr;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tvar root = expr.AncestorsAndSelf.FirstOrDefault(n => n is EntityDeclaration || n is SyntaxTree);\n\t\t\t\tif (root == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tvar curState = GetState();\n\t\t\t\t// current member needs to be in the setter because of the 'value' parameter\n\t\t\t\tif (root is Accessor) {\n\t\t\t\t\tvar prop = curState.CurrentMember as IProperty;\n\t\t\t\t\tif (prop != null && prop.CanSet && (root.Role == IndexerDeclaration.SetterRole || root.Role == PropertyDeclaration.SetterRole))\n\t\t\t\t\t    curState = curState.WithCurrentMember(prop.Setter);\n\t\t\t\t}\n\n\t\t\t\t// Rood should be the 'body' - otherwise the state -> current member isn't correct.\n\t\t\t\tvar body = root.Children.FirstOrDefault(r => r.Role == Roles.Body);\n\t\t\t\tif (body != null && body.Contains(expr.StartLocation))\n\t\t\t\t\troot = body;\n\n\t\t\t\tvar csResolver = CompletionContextProvider.GetResolver (curState, root);\n\t\t\t\tvar result = csResolver.Resolve(resolveNode);\n\t\t\t\tvar state = csResolver.GetResolverStateBefore(resolveNode);\n\t\t\t\tif (state.CurrentMember == null)\n\t\t\t\t\tstate = state.WithCurrentMember(curState.CurrentMember);\n\t\t\t\tif (state.CurrentTypeDefinition == null)\n\t\t\t\t\tstate = state.WithCurrentTypeDefinition(curState.CurrentTypeDefinition);\n\t\t\t\tif (state.CurrentUsingScope == null)\n\t\t\t\t\tstate = state.WithCurrentUsingScope(curState.CurrentUsingScope);\n\t\t\t\treturn new ExpressionResolveResult(result, state, csResolver);\n\t\t\t} catch (Exception e) {\n\t\t\t\tConsole.WriteLine(e);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpParameterCompletionEngine.cs",
    "content": "﻿// \n// CSharpParameterCompletionEngine.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Completion;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Completion\n{\n\tpublic class CSharpParameterCompletionEngine : CSharpCompletionEngineBase\n\t{\n\t\tinternal IParameterCompletionDataFactory factory;\n\t\t\n\t\tpublic CSharpParameterCompletionEngine(IDocument document, ICompletionContextProvider completionContextProvider, IParameterCompletionDataFactory factory, IProjectContent content, CSharpTypeResolveContext ctx) : base (content, completionContextProvider, ctx)\n\t\t{\n\t\t\tif (document == null) {\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\t}\n\t\t\tif (factory == null) {\n\t\t\t\tthrow new ArgumentNullException(\"factory\");\n\t\t\t}\n\t\t\tthis.document = document;\n\t\t\tthis.factory = factory;\n\t\t}\n\n\t\tpublic ExpressionResult GetIndexerBeforeCursor()\n\t\t{\n\t\t\tSyntaxTree baseUnit;\n\t\t\tif (currentMember == null && currentType == null) { \n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tbaseUnit = ParseStub(\"x]\");\n\t\t\t\n\t\t\t//var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin;\n\t\t\tvar mref = baseUnit.GetNodeAt(location, n => n is IndexerExpression); \n\t\t\tAstNode expr;\n\t\t\tif (mref is IndexerExpression) {\n\t\t\t\texpr = ((IndexerExpression)mref).Target;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn new ExpressionResult((AstNode)expr, baseUnit);\n\t\t}\n\t\t\n\t\tpublic ExpressionResult GetConstructorInitializerBeforeCursor()\n\t\t{\n\t\t\tSyntaxTree baseUnit;\n\t\t\tif (currentMember == null && currentType == null) { \n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tbaseUnit = ParseStub(\"a) {}\", false);\n\t\t\t\n\t\t\tvar expr = baseUnit.GetNodeAt <ConstructorInitializer>(location); \n\t\t\tif (expr == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new ExpressionResult((AstNode)expr, baseUnit);\n\t\t}\n\t\t\n\t\tpublic ExpressionResult GetTypeBeforeCursor()\n\t\t{\n\t\t\tSyntaxTree baseUnit;\n\t\t\tif (currentMember == null && currentType == null) { \n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tbaseUnit = ParseStub(\"x> a\");\n\t\t\t\n\t\t\t//var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin;\n\t\t\tvar expr = baseUnit.GetNodeAt<AstType>(location.Line, location.Column + 1);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\t\t\t// '>' position\n\t\t\treturn new ExpressionResult((AstNode)expr, baseUnit);\n\t\t}\n\n\t\tpublic ExpressionResult GetMethodTypeArgumentInvocationBeforeCursor()\n\t\t{\n\t\t\tSyntaxTree baseUnit;\n\t\t\tif (currentMember == null && currentType == null) { \n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tbaseUnit = ParseStub(\"x>.A ()\");\n\t\t\t\n\t\t\t//var memberLocation = currentMember != null ? currentMember.Region.Begin : currentType.Region.Begin;\n\t\t\tvar expr = baseUnit.GetNodeAt<MemberReferenceExpression>(location.Line, location.Column + 1);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\t\t\treturn new ExpressionResult((AstNode)expr, baseUnit);\n\t\t}\n\n\n\n\t\tIEnumerable<IMethod> CollectMethods(AstNode resolvedNode, MethodGroupResolveResult resolveResult)\n\t\t{\n\t\t\tvar lookup = new MemberLookup(ctx.CurrentTypeDefinition, Compilation.MainAssembly);\n\t\t\tbool onlyStatic = false;\n\t\t\tif (resolvedNode is IdentifierExpression && currentMember != null && currentMember.IsStatic || resolveResult.TargetResult is TypeResolveResult) {\n\t\t\t\tonlyStatic = true;\n\t\t\t}\n\t\t\tvar methods = new List<IMethod>();\n\t\t\tforeach (var method in resolveResult.Methods) {\n\t\t\t\tif (method.IsConstructor) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!lookup.IsAccessible (method, true))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (onlyStatic && !method.IsStatic) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (method.IsShadowing) {\n\t\t\t\t\tfor (int j = 0; j < methods.Count; j++) {\n\t\t\t\t\t\tif (ParameterListComparer.Instance.Equals(methods[j].Parameters, method.Parameters)) {\n\t\t\t\t\t\t\tmethods.RemoveAt (j);\n\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmethods.Add (method);\n\t\t\t}\n\t\t\tforeach (var m in methods) {\n\t\t\t\tyield return m;\n\t\t\t}\n\t\t\tforeach (var extMethods in resolveResult.GetEligibleExtensionMethods (true)) {\n\t\t\t\tforeach (var method in extMethods) {\n\t\t\t\t\tif (methods.Contains (method))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tyield return new ReducedExtensionMethod (method);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tIEnumerable<IProperty> GetAccessibleIndexers(IType type)\n\t\t{\n\t\t\tvar lookup = new MemberLookup(ctx.CurrentTypeDefinition, Compilation.MainAssembly);\n\t\t\tvar properties = new List<IProperty>();\n\t\t\tforeach (var property in type.GetProperties ()) {\n\t\t\t\tif (!property.IsIndexer)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!lookup.IsAccessible (property, true))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (property.IsShadowing) {\n\t\t\t\t\tfor (int j = 0; j < properties.Count; j++) {\n\t\t\t\t\t\tif (ParameterListComparer.Instance.Equals(properties[j].Parameters, property.Parameters)) {\n\t\t\t\t\t\t\tproperties.RemoveAt (j);\n\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tproperties.Add (property);\n\t\t\t}\n\t\t\treturn properties;\n\t\t}\n\t\t\n\t\tpublic IParameterDataProvider GetParameterDataProvider(int offset, char completionChar)\n\t\t{\n\t\t\t//Ignoring completionChar == '\\0' because it usually means moving with arrow keys, tab or enter\n\t\t\t//we don't want to trigger on those events but it probably should be handled somewhere else\n\t\t\t//since our job is to resolve method and not to decide when to display tooltip or not\n\t\t\tif (offset <= 0 || completionChar == '\\0') {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tSetOffset (offset);\n\t\t\tint startOffset;\n\t\t\tstring text;\n\t\t\tif (currentMember == null && currentType == null) {\n\t\t\t\t//In case of attributes parse all file\n\t\t\t\tstartOffset = 0;\n\t\t\t\ttext = document.Text;\n\t\t\t} else {\n\t\t\t\tvar memberText = GetMemberTextToCaret ();\n\t\t\t\ttext = memberText.Item1;\n\t\t\t\tstartOffset = document.GetOffset (memberText.Item2);\n\t\t\t}\n\n\t\t\tvar parenStack = new Stack<int> ();\n\t\t\tvar chevronStack = new Stack<int> ();\n\t\t\tvar squareStack = new Stack<int> ();\n\t\t\tvar bracketStack = new Stack<int> ();\n\n\t\t\tvar lex = new MiniLexer (text);\n\t\t\tbool failed = lex.Parse ((ch, off) => {\n\t\t\t\tif (lex.IsInString || lex.IsInChar || lex.IsInVerbatimString || lex.IsInSingleComment || lex.IsInMultiLineComment || lex.IsInPreprocessorDirective)\n\t\t\t\t\treturn false;\n\t\t\t\tswitch (ch) {\n\t\t\t\tcase '(':\n\t\t\t\t\tparenStack.Push (startOffset + off);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ')':\n\t\t\t\t\tif (parenStack.Count == 0) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tparenStack.Pop ();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '<':\n\t\t\t\t\tchevronStack.Push (startOffset + off);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '>':\n\t\t\t\t\t//Don't abort if we don't have macthing '<' for '>' it could be if (i > 0) Foo($\n\t\t\t\t\tif (chevronStack.Count == 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tchevronStack.Pop ();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '[':\n\t\t\t\t\tsquareStack.Push (startOffset + off);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ']':\n\t\t\t\t\tif (squareStack.Count == 0) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tsquareStack.Pop ();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '{':\n\t\t\t\t\tbracketStack.Push (startOffset + off);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '}':\n\t\t\t\t\tif (bracketStack.Count == 0) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tbracketStack.Pop ();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tif (failed)\n\t\t\t\treturn null;\n\t\t\tint result = -1;\n\t\t\tif (parenStack.Count > 0)\n\t\t\t\tresult = parenStack.Pop ();\n\t\t\tif (squareStack.Count > 0)\n\t\t\t\tresult = Math.Max (result, squareStack.Pop ());\n\t\t\tif (chevronStack.Count > 0)\n\t\t\t\tresult = Math.Max (result, chevronStack.Pop ());\n\n\t\t\t//If we are inside { bracket we don't want to display anything\n\t\t\tif (bracketStack.Count > 0 && bracketStack.Pop () > result)\n\t\t\t\treturn null;\n\t\t\tif (result == -1)\n\t\t\t\treturn null;\n\t\t\tSetOffset (result + 1);\n\t\t\tResolveResult resolveResult;\n\t\t\tswitch (document.GetCharAt (result)) {\n\t\t\t\tcase '(':\n\t\t\t\t\tvar invoke = GetInvocationBeforeCursor(true) ?? GetConstructorInitializerBeforeCursor();\n\t\t\t\t\tif (invoke == null) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (invoke.Node is ConstructorInitializer) {\n\t\t\t\t\t\tvar init = (ConstructorInitializer)invoke.Node;\n\t\t\t\t\t\tif (init.ConstructorInitializerType == ConstructorInitializerType.This) {\n\t\t\t\t\t\t\treturn factory.CreateConstructorProvider(document.GetOffset(invoke.Node.StartLocation), ctx.CurrentTypeDefinition, init);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar baseType = ctx.CurrentTypeDefinition.DirectBaseTypes.FirstOrDefault(bt => bt.Kind != TypeKind.Interface);\n\t\t\t\t\t\t\tif (baseType == null) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn factory.CreateConstructorProvider(document.GetOffset(invoke.Node.StartLocation), baseType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (invoke.Node is ObjectCreateExpression) {\n\t\t\t\t\t\tvar createType = ResolveExpression(((ObjectCreateExpression)invoke.Node).Type);\n\t\t\t\t\t\tif (createType.Result.Type.Kind == TypeKind.Unknown)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\treturn factory.CreateConstructorProvider(document.GetOffset(invoke.Node.StartLocation), createType.Result.Type);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (invoke.Node is ICSharpCode.NRefactory.CSharp.Attribute) {\n\t\t\t\t\t\tvar attribute = ResolveExpression(invoke);\n\t\t\t\t\t\tif (attribute == null || attribute.Result == null) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory.CreateConstructorProvider(document.GetOffset(invoke.Node.StartLocation), attribute.Result.Type);\n\t\t\t\t\t}\n\t\t\t\t\tvar invocationExpression = ResolveExpression(invoke);\n\t\t\t\t\tif (invocationExpression == null || invocationExpression.Result == null || invocationExpression.Result.IsError) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tresolveResult = invocationExpression.Result;\n\t\t\t\t\tif (resolveResult is MethodGroupResolveResult) {\n\t\t\t\t\t\treturn factory.CreateMethodDataProvider(document.GetOffset(invoke.Node.StartLocation), CollectMethods(invoke.Node, resolveResult as MethodGroupResolveResult));\n\t\t\t\t\t}\n\t\t\t\t\tif (resolveResult is MemberResolveResult) {\n\t\t\t\t\t\tvar mr = resolveResult as MemberResolveResult;\n\t\t\t\t\t\tif (mr.Member is IMethod) {\n\t\t\t\t\t\t\treturn factory.CreateMethodDataProvider(document.GetOffset(invoke.Node.StartLocation), new [] { (IMethod)mr.Member });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (resolveResult.Type.Kind == TypeKind.Delegate) {\n\t\t\t\t\t\treturn factory.CreateDelegateDataProvider(document.GetOffset(invoke.Node.StartLocation), resolveResult.Type);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//\t\t\t\t\n\t\t\t\t\t//\t\t\t\tif (result.ExpressionContext == ExpressionContext.BaseConstructorCall) {\n\t\t\t\t\t//\t\t\t\t\tif (resolveResult is ThisResolveResult)\n\t\t\t\t\t//\t\t\t\t\t\treturn new NRefactoryParameterDataProvider (textEditorData, resolver, resolveResult as ThisResolveResult);\n\t\t\t\t\t//\t\t\t\t\tif (resolveResult is BaseResolveResult)\n\t\t\t\t\t//\t\t\t\t\t\treturn new NRefactoryParameterDataProvider (textEditorData, resolver, resolveResult as BaseResolveResult);\n\t\t\t\t\t//\t\t\t\t}\n\t\t\t\t\t//\t\t\t\tIType resolvedType = resolver.SearchType (resolveResult.ResolvedType);\n\t\t\t\t\t//\t\t\t\tif (resolvedType != null && resolvedType.ClassType == ClassType.Delegate) {\n\t\t\t\t\t//\t\t\t\t\treturn new NRefactoryParameterDataProvider (textEditorData, result.Expression, resolvedType);\n\t\t\t\t\t//\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '<':\n\t\t\t\t\tinvoke = GetMethodTypeArgumentInvocationBeforeCursor();\n\t\t\t\t\tif (invoke != null) {\n\t\t\t\t\t\tvar tExpr2 = ResolveExpression(invoke);\n\t\t\t\t\t\tif (tExpr2 != null && tExpr2.Result is MethodGroupResolveResult && !tExpr2.Result.IsError) {\n\t\t\t\t\t\t\treturn factory.CreateTypeParameterDataProvider(document.GetOffset(invoke.Node.StartLocation), CollectMethods(invoke.Node, tExpr2.Result as MethodGroupResolveResult));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tinvoke = GetTypeBeforeCursor();\n\t\t\t\t\tif (invoke == null || invoke.Node.StartLocation.IsEmpty) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar tExpr = ResolveExpression(invoke);\n\t\t\t\t\tif (tExpr == null || tExpr.Result == null || tExpr.Result.IsError) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn factory.CreateTypeParameterDataProvider(document.GetOffset(invoke.Node.StartLocation), CollectAllTypes(tExpr.Result.Type));\n\t\t\t\tcase '[':\n\t\t\t\t\tinvoke = GetIndexerBeforeCursor();\n\t\t\t\t\tif (invoke == null) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tif (invoke.Node is ArrayCreateExpression) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar indexerExpression = ResolveExpression(invoke);\n\t\t\t\t\tif (indexerExpression == null || indexerExpression.Result == null || indexerExpression.Result.IsError) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn factory.CreateIndexerParameterDataProvider(document.GetOffset(invoke.Node.StartLocation), indexerExpression.Result.Type, GetAccessibleIndexers (indexerExpression.Result.Type), invoke.Node);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tIEnumerable<IType> CollectAllTypes(IType baseType)\n\t\t{\n\t\t\tvar state = GetState();\n\t\t\tfor (var n = state.CurrentUsingScope; n != null; n = n.Parent) {\n\t\t\t\tforeach (var u in n.Usings) {\n\t\t\t\t\tforeach (var type in u.Types) {\n\t\t\t\t\t\tif (type.TypeParameterCount > 0 && type.Name == baseType.Name) {\n\t\t\t\t\t\t\tyield return type;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach (var type in n.Namespace.Types) {\n\t\t\t\t\tif (type.TypeParameterCount > 0 && type.Name == baseType.Name) {\n\t\t\t\t\t\tyield return type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<string> GetUsedNamespaces()\n\t\t{\n\t\t\tvar scope = ctx.CurrentUsingScope;\n\t\t\tvar result = new List<string>();\n\t\t\twhile (scope != null) {\n\t\t\t\tresult.Add(scope.Namespace.FullName);\n\t\t\t\t\n\t\t\t\tforeach (var ns in scope.Usings) {\n\t\t\t\t\tresult.Add(ns.FullName);\n\t\t\t\t}\n\t\t\t\tscope = scope.Parent;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs",
    "content": "﻿// \n// CompletionDataWrapper.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Completion;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Completion\n{\n\tpublic class CompletionDataWrapper\n\t{\n\t\tCSharpCompletionEngine completion;\n\t\tList<ICompletionData> result = new List<ICompletionData> ();\n\t\t\n\t\tpublic List<ICompletionData> Result {\n\t\t\tget {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\t\n\t\tICompletionDataFactory Factory {\n\t\t\tget {\n\t\t\t\treturn completion.factory;\n\t\t\t}\n\t\t}\n\n\t\tinternal bool AnonymousDelegateAdded {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic CompletionDataWrapper (CSharpCompletionEngine completion)\n\t\t{\n\t\t\tthis.completion = completion;\n\t\t}\n\t\t\n\t\tpublic void Add (ICompletionData data)\n\t\t{\n\t\t\tresult.Add (data);\n\t\t}\n\n\n\t\tpublic ICompletionData AddCustom (string displayText, string description = null, string completionText = null)\n\t\t{\n\t\t\tvar literalCompletionData = Factory.CreateLiteralCompletionData(displayText, description, completionText);\n\t\t\tresult.Add(literalCompletionData);\n\t\t\treturn literalCompletionData;\n\t\t}\n\t\t\n\t\tHashSet<string> usedNamespaces = new HashSet<string> ();\n\n\t\tbool IsAccessible(MemberLookup lookup, INamespace ns)\n\t\t{\n\t\t\tif (ns.Types.Any (t => lookup.IsAccessible (t, false)))\n\t\t\t\treturn true;\n\t\t\tforeach (var child in ns.ChildNamespaces)\n\t\t\t\tif (IsAccessible (lookup, child))\n\t\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic void AddNamespace (MemberLookup lookup, INamespace ns)\n\t\t{\n\t\t\tif (usedNamespaces.Contains (ns.Name))\n\t\t\t\treturn;\n\t\t\tif (!IsAccessible (lookup, ns)) {\n\t\t\t\tusedNamespaces.Add (ns.Name);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tusedNamespaces.Add (ns.Name);\n\t\t\tresult.Add (Factory.CreateNamespaceCompletionData (ns));\n\t\t}\n\n\t\tpublic void AddAlias(string alias)\n\t\t{\n\t\t\tresult.Add (Factory.CreateLiteralCompletionData (alias));\n\t\t}\n\n\t\tDictionary<string, ICompletionData> typeDisplayText = new Dictionary<string, ICompletionData> ();\n\t\tDictionary<IType, ICompletionData> addedTypes = new Dictionary<IType, ICompletionData> ();\n\n\t\tpublic ICompletionData AddConstructors(IType type, bool showFullName, bool isInAttributeContext = false)\n\t\t{\n\t\t\treturn InternalAddType(type, showFullName, isInAttributeContext, true);\n\t\t}\n\n\t\tpublic ICompletionData AddType(IType type, bool showFullName, bool isInAttributeContext = false)\n\t\t{\n\t\t\treturn InternalAddType(type, showFullName, isInAttributeContext, false);\n\t\t}\n\n\t\tICompletionData InternalAddType(IType type, bool showFullName, bool isInAttributeContext, bool addConstrurs)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (type.Name == \"Void\" && type.Namespace == \"System\" || type.Kind == TypeKind.Unknown)\n\t\t\t\treturn null;\n\t\t\tif (addedTypes.ContainsKey (type))\n\t\t\t\treturn addedTypes[type];\n\t\t\tusedNamespaces.Add(type.Name);\n\t\t\tvar def = type.GetDefinition();\n\t\t\tif (def != null && def.ParentAssembly != completion.ctx.CurrentAssembly) {\n\t\t\t\tswitch (completion.EditorBrowsableBehavior) {\n\t\t\t\t\tcase EditorBrowsableBehavior.Ignore:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EditorBrowsableBehavior.Normal:\n\t\t\t\t\t\tvar state = def.GetEditorBrowsableState();\n\t\t\t\t\t\tif (state != System.ComponentModel.EditorBrowsableState.Always)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EditorBrowsableBehavior.IncludeAdvanced:\n\t\t\t\t\t\tif (!def.IsBrowsable())\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t\t}\n\t\t\t}\n\t\t\tICompletionData usedType;\n\t\t\tvar data = Factory.CreateTypeCompletionData(type, showFullName, isInAttributeContext, addConstrurs);\n\t\t\tvar text = data.DisplayText;\n\t\t\tif (typeDisplayText.TryGetValue(text, out usedType)) {\n\t\t\t\tusedType.AddOverload(data);\n\t\t\t\treturn usedType;\n\t\t\t} \n\t\t\ttypeDisplayText [text] = data;\n\t\t\tresult.Add(data);\n\t\t\taddedTypes[type] = data;\n\t\t\treturn data;\n\t\t}\n\n\t\tDictionary<string, List<ICompletionData>> data = new Dictionary<string, List<ICompletionData>> ();\n\t\t\n\t\tpublic ICompletionData AddVariable(IVariable variable)\n\t\t{\n\t\t\tif (data.ContainsKey(variable.Name))\n\t\t\t\treturn null;\n\t\t\tdata [variable.Name] = new List<ICompletionData>();\n\t\t\tvar cd = Factory.CreateVariableCompletionData(variable);\n\t\t\tresult.Add(cd);\n\t\t\treturn cd;\n\t\t}\n\t\t\n\t\tpublic ICompletionData AddNamedParameterVariable(IVariable variable)\n\t\t{\n\t\t\tvar name = variable.Name + \":\";\n\t\t\tif (data.ContainsKey(name))\n\t\t\t\treturn null;\n\t\t\tdata [name] = new List<ICompletionData>();\n\t\t\t\n\t\t\tvar cd = Factory.CreateVariableCompletionData(variable);\n\t\t\tcd.CompletionText += \":\";\n\t\t\tcd.DisplayText += \":\";\n\t\t\tresult.Add(cd);\n\t\t\treturn cd;\n\t\t}\n\t\t\n\t\tpublic void AddTypeParameter (ITypeParameter variable)\n\t\t{\n\t\t\tif (data.ContainsKey (variable.Name))\n\t\t\t\treturn;\n\t\t\tdata [variable.Name] = new List<ICompletionData> ();\n\t\t\tresult.Add (Factory.CreateVariableCompletionData (variable));\n\t\t}\n\n\t\tpublic void AddTypeImport(ITypeDefinition type, bool useFullName, bool addForTypeCreation)\n\t\t{\n\t\t\tresult.Add(Factory.CreateImportCompletionData(type, useFullName, addForTypeCreation));\n\t\t}\n\n\t\tpublic ICompletionData AddMember (IMember member)\n\t\t{\n\t\t\tvar newData = Factory.CreateEntityCompletionData (member);\n\t\t\t\n\t\t\tif (member.ParentAssembly != completion.ctx.CurrentAssembly) {\n\t\t\t\tswitch (completion.EditorBrowsableBehavior) {\n\t\t\t\t\tcase EditorBrowsableBehavior.Ignore:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EditorBrowsableBehavior.Normal:\n\t\t\t\t\t\tvar state = member.GetEditorBrowsableState();\n\t\t\t\t\t\tif (state != System.ComponentModel.EditorBrowsableState.Always)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EditorBrowsableBehavior.IncludeAdvanced:\n\t\t\t\t\t\tif (!member.IsBrowsable())\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t\t}\n\t\t\t}\n\t\t\tstring memberKey = newData.DisplayText;\n\t\t\tif (memberKey == null)\n\t\t\t\treturn null;\n\n\t\t\tnewData.CompletionCategory = GetCompletionCategory (member.DeclaringTypeDefinition);\n\n\t\t\tList<ICompletionData> existingData;\n\t\t\tdata.TryGetValue (memberKey, out existingData);\n\t\t\tif (existingData != null) {\n\t\t\t\tif (member.SymbolKind == SymbolKind.Field || member.SymbolKind == SymbolKind.Property || member.SymbolKind == SymbolKind.Event)\n\t\t\t\t\treturn null;\n\t\t\t\tvar a = member as IEntity;\n\t\t\t\tforeach (var d in existingData) {\n\t\t\t\t\tif (!(d is IEntityCompletionData))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar b = ((IEntityCompletionData)d).Entity;\n\t\t\t\t\tif (a == null || b == null || a.SymbolKind == b.SymbolKind) {\n\t\t\t\t\t\td.AddOverload (newData);\n\t\t\t\t\t\treturn d;\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\tif (newData != null) {\n\t\t\t\t\tresult.Add (newData);\n\t\t\t\t\tdata [memberKey].Add (newData);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresult.Add (newData);\n\t\t\t\tdata [memberKey] = new List<ICompletionData> ();\n\t\t\t\tdata [memberKey].Add (newData);\n\t\t\t}\n\t\t\treturn newData;\n\t\t}\n\t\t\n\t\tinternal CompletionCategory GetCompletionCategory (IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\t\t\tif (!completionCategories.ContainsKey (type))\n\t\t\t\tcompletionCategories [type] = new TypeCompletionCategory (type);\n\t\t\treturn completionCategories [type];\n\t\t}\n\t\t\n\t\tDictionary<IType, CompletionCategory> completionCategories = new Dictionary<IType, CompletionCategory> ();\n\t\tclass TypeCompletionCategory : CompletionCategory\n\t\t{\n\t\t\tpublic IType Type {\n\t\t\t\tget;\n\t\t\t\tprivate set;\n\t\t\t}\n\t\t\t\n\t\t\tpublic TypeCompletionCategory (IType type) : base (type.FullName, null)\n\t\t\t{\n\t\t\t\tthis.Type = type;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int CompareTo (CompletionCategory other)\n\t\t\t{\n\t\t\t\tvar compareCategory = other as TypeCompletionCategory;\n\t\t\t\tif (compareCategory == null)\n\t\t\t\t\treturn -1;\n\t\t\t\tint result;\n\t\t\t\tif (Type.ReflectionName == compareCategory.Type.ReflectionName) {\n\t\t\t\t\tresult = 0;\n\t\t\t\t} else if (Type.GetAllBaseTypes().Any(t => t.ReflectionName == compareCategory.Type.ReflectionName)) {\n\t\t\t\t\tresult = -1;\n\t\t\t\t} else if (compareCategory.Type.GetAllBaseTypes().Any(t => t.ReflectionName == Type.ReflectionName)) {\n\t\t\t\t\tresult = 1;\n\t\t\t\t} else {\n\t\t\t\t\tvar d = Type.GetDefinition ();\n\t\t\t\t\tvar ct = compareCategory.Type.GetDefinition();\n\t\t\t\t\tif (ct.IsStatic && d.IsStatic) {\n\t\t\t\t\t\tresult = d.FullName.CompareTo (ct.FullName);\n\t\t\t\t\t} else if (d.IsStatic) {\n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t}else if (ct.IsStatic) {\n\t\t\t\t\t\tresult = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\tHashSet<IType> addedEnums = new HashSet<IType> ();\n\t\tpublic ICompletionData AddEnumMembers (IType resolvedType, CSharpResolver state)\n\t\t{\n\t\t\tif (addedEnums.Contains (resolvedType))\n\t\t\t\treturn null;\n\t\t\taddedEnums.Add (resolvedType);\n\t\t\tvar result = AddType(resolvedType, true);\n\t\t\tforeach (var field in resolvedType.GetFields ()) {\n\t\t\t\tif (field.IsPublic && (field.IsConst || field.IsStatic)) {\n\t\t\t\t\tResult.Add(Factory.CreateMemberCompletionData(resolvedType, field));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\tHashSet<string> anonymousSignatures = new HashSet<string> ();\n\n\t\tpublic bool HasAnonymousDelegateAdded(string signature)\n\t\t{\n\t\t\treturn anonymousSignatures.Contains(signature); \n\t\t}\n\n\t\tpublic void AddAnonymousDelegateAdded(string signature)\n\t\t{\n\t\t\tanonymousSignatures.Add(signature); \n\t\t}\n\t}\n}\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionContextProvider.cs",
    "content": "﻿// \n// IMemberProvider.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Completion\n{\n\tpublic interface ICompletionContextProvider\n\t{\n\t\tIList<string> ConditionalSymbols {\n\t\t\tget;\n\t\t}\n\n\t\tvoid GetCurrentMembers (int offset, out IUnresolvedTypeDefinition currentType, out IUnresolvedMember currentMember);\n\n\t\tTuple<string, TextLocation> GetMemberTextToCaret(int caretOffset, IUnresolvedTypeDefinition currentType, IUnresolvedMember currentMember);\n\n\t\tCSharpAstResolver GetResolver (CSharpResolver resolver, AstNode rootNode);\n\t}\n\n\tpublic class DefaultCompletionContextProvider : ICompletionContextProvider\n\t{\n\t\treadonly IDocument document;\n\t\treadonly CSharpUnresolvedFile unresolvedFile;\n\t\treadonly List<string> symbols = new List<string> ();\n\n\t\tpublic IList<string> ConditionalSymbols {\n\t\t\tget {\n\t\t\t\treturn symbols;\n\t\t\t}\n\t\t}\n\n\t\tpublic DefaultCompletionContextProvider (IDocument document, CSharpUnresolvedFile unresolvedFile)\n\t\t{\n\t\t\tif (document == null)\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\tif (unresolvedFile == null)\n\t\t\t\tthrow new ArgumentNullException(\"unresolvedFile\");\n\t\t\tthis.document = document;\n\t\t\tthis.unresolvedFile = unresolvedFile;\n\t\t}\n\n\t\tpublic void AddSymbol (string sym)\n\t\t{\n\t\t\tsymbols.Add (sym);\n\t\t}\n\t\tpublic void GetCurrentMembers(int offset, out IUnresolvedTypeDefinition currentType, out IUnresolvedMember currentMember)\n\t\t{\n\t\t\t//var document = engine.document;\n\t\t\tvar location = document.GetLocation(offset);\n\t\t\t\n\t\t\tcurrentType = null;\n\t\t\t\n\t\t\tforeach (var type in unresolvedFile.TopLevelTypeDefinitions) {\n\t\t\t\tif (type.Region.Begin < location)\n\t\t\t\t\tcurrentType = type;\n\t\t\t}\n\t\t\tcurrentType = FindInnerType (currentType, location);\n\t\t\t\n\t\t\t// location is beyond last reported end region, now we need to check, if the end region changed\n\t\t\tif (currentType != null && currentType.Region.End < location) {\n\t\t\t\tif (!IsInsideType (currentType, location))\n\t\t\t\t\tcurrentType = null;\n\t\t\t}\n\t\t\tcurrentMember = null;\n\t\t\tif (currentType != null) {\n\t\t\t\tforeach (var member in currentType.Members) {\n\t\t\t\t\tif (member.Region.Begin < location && (currentMember == null || currentMember.Region.Begin < member.Region.Begin))\n\t\t\t\t\t\tcurrentMember = member;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// location is beyond last reported end region, now we need to check, if the end region changed\n\t\t\t// NOTE: Enums are a special case, there the \"last\" field needs to be treated as current member\n\t\t\tif (currentMember != null && currentMember.Region.End < location && currentType.Kind != TypeKind.Enum) {\n\t\t\t\tif (!IsInsideType (currentMember, location))\n\t\t\t\t\tcurrentMember = null;\n\t\t\t}/*\n\t\t\tvar stack = GetBracketStack (engine.GetMemberTextToCaret ().Item1);\n\t\t\tif (stack.Count == 0)\n\t\t\t\tcurrentMember = null;*/\n\t\t}\n\n\t\tIUnresolvedTypeDefinition FindInnerType (IUnresolvedTypeDefinition parent, TextLocation location)\n\t\t{\n\t\t\tif (parent == null)\n\t\t\t\treturn null;\n\t\t\tvar currentType = parent;\n\t\t\tforeach (var type in parent.NestedTypes) {\n\t\t\t\tif (type.Region.Begin < location  && location < type.Region.End)\n\t\t\t\t\tcurrentType = FindInnerType (type, location);\n\t\t\t}\n\t\t\t\n\t\t\treturn currentType;\n\t\t}\n\t\t\n\t\tbool IsInsideType (IUnresolvedEntity currentType, TextLocation location)\n\t\t{\n\t\t\tif (currentType.Region.IsEmpty)\n\t\t\t\treturn false;\n\t\t\tint startOffset = document.GetOffset (currentType.Region.Begin);\n\t\t\tint endOffset = document.GetOffset (location);\n\t\t\t//bool foundEndBracket = false;\n\t\t\n\t\t\tvar bracketStack = new Stack<char> ();\n\t\t\n\t\t\tbool isInString = false, isInChar = false;\n\t\t\tbool isInLineComment = false, isInBlockComment = false;\n\t\t\t\n\t\t\tfor (int i = startOffset; i < endOffset; i++) {\n\t\t\t\tchar ch = document.GetCharAt (i);\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase '(':\n\t\t\t\t\tcase '[':\n\t\t\t\t\tcase '{':\n\t\t\t\t\t\tif (!isInString && !isInChar && !isInLineComment && !isInBlockComment)\n\t\t\t\t\t\t\tbracketStack.Push (ch);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ')':\n\t\t\t\t\tcase ']':\n\t\t\t\t\tcase '}':\n\t\t\t\t\t\tif (!isInString && !isInChar && !isInLineComment && !isInBlockComment)\n\t\t\t\t\t\tif (bracketStack.Count > 0)\n\t\t\t\t\t\t\tbracketStack.Pop ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '/':\n\t\t\t\t\t\tif (isInBlockComment) {\n\t\t\t\t\t\t\tif (i > 0 && document.GetCharAt (i - 1) == '*') \n\t\t\t\t\t\t\t\tisInBlockComment = false;\n\t\t\t\t\t\t} else if (!isInString && !isInChar && i + 1 < document.TextLength) {\n\t\t\t\t\t\t\tchar nextChar = document.GetCharAt (i + 1);\n\t\t\t\t\t\t\tif (nextChar == '/')\n\t\t\t\t\t\t\t\tisInLineComment = true;\n\t\t\t\t\t\t\tif (!isInLineComment && nextChar == '*')\n\t\t\t\t\t\t\t\tisInBlockComment = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\"':\n\t\t\t\t\t\tif (!(isInChar || isInLineComment || isInBlockComment)) \n\t\t\t\t\t\t\tisInString = !isInString;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\\'':\n\t\t\t\t\t\tif (!(isInString || isInLineComment || isInBlockComment)) \n\t\t\t\t\t\t\tisInChar = !isInChar;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault :\t\t\t\n\t\t\t\t\t\tif (NewLine.IsNewLine(ch)) {\n\t\t\t\t\t\t\tisInLineComment = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\treturn bracketStack.Any (t => t == '{');\n\t\t}\n\t\n\t\tpublic Tuple<string, TextLocation> GetMemberTextToCaret(int caretOffset, IUnresolvedTypeDefinition currentType, IUnresolvedMember currentMember)\n\t\t{\n\t\t\tint startOffset;\n\t\t\tif (currentMember != null && currentType != null && currentType.Kind != TypeKind.Enum) {\n\t\t\t\tstartOffset = document.GetOffset(currentMember.Region.Begin);\n\t\t\t} else if (currentType != null) {\n\t\t\t\tstartOffset = document.GetOffset(currentType.Region.Begin);\n\t\t\t} else {\n\t\t\t\tstartOffset = 0;\n\t\t\t}\n\t\t\twhile (startOffset > 0) {\n\t\t\t\tchar ch = document.GetCharAt(startOffset - 1);\n\t\t\t\tif (ch != ' ' && ch != '\\t') {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t--startOffset;\n\t\t\t}\n\n\t\t\treturn Tuple.Create (document.GetText (startOffset, caretOffset - startOffset), document.GetLocation (startOffset));\n\t\t}\n\n\n\t\tpublic CSharpAstResolver GetResolver (CSharpResolver resolver, AstNode rootNode)\n\t\t{\n\t\t\treturn new CSharpAstResolver (resolver, rootNode, unresolvedFile);\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/ICompletionDataFactory.cs",
    "content": "﻿// \n// ICompletionDataFactory.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Completion;\n\nnamespace ICSharpCode.NRefactory.CSharp.Completion\n{\n\tpublic interface ICompletionDataFactory\n\t{\n\t\tICompletionData CreateEntityCompletionData (IEntity entity);\n\t\tICompletionData CreateEntityCompletionData (IEntity entity, string text);\n\t\t\n\t\tICompletionData CreateTypeCompletionData (IType type, bool showFullName, bool isInAttributeContext, bool addForTypeCreation);\n\n\t\t/// <summary>\n\t\t/// Creates the member completion data. \n\t\t/// Form: Type.Member\n\t\t/// Used for generating enum members Foo.A, Foo.B where the enum 'Foo' is valid.\n\t\t/// </summary>\n\t\tICompletionData CreateMemberCompletionData(IType type, IEntity member);\n\n\t\t/// <summary>\n\t\t/// Creates a generic completion data.\n\t\t/// </summary>\n\t\t/// <param name='title'>\n\t\t/// The title of the completion data\n\t\t/// </param>\n\t\t/// <param name='description'>\n\t\t/// The description of the literal.\n\t\t/// </param>\n\t\t/// <param name='insertText'>\n\t\t/// The insert text. If null, title is taken.\n\t\t/// </param>\n\t\tICompletionData CreateLiteralCompletionData (string title, string description = null, string insertText = null);\n\t\t\n\t\tICompletionData CreateNamespaceCompletionData (INamespace name);\n\t\t\n\t\tICompletionData CreateVariableCompletionData (IVariable variable);\n\n\t\tICompletionData CreateVariableCompletionData (ITypeParameter parameter);\n\t\t\n\t\tICompletionData CreateEventCreationCompletionData (string delegateMethodName, IType delegateType, IEvent evt, string parameterDefinition, IUnresolvedMember currentMember, IUnresolvedTypeDefinition currentType);\n\n\t\tICompletionData CreateNewOverrideCompletionData (int declarationBegin, IUnresolvedTypeDefinition type, IMember m);\n\t\tICompletionData CreateNewPartialCompletionData (int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember m);\n\t\t\n\t\tIEnumerable<ICompletionData> CreateCodeTemplateCompletionData ();\n\t\t\n\t\tIEnumerable<ICompletionData> CreatePreProcessorDefinesCompletionData ();\n\n\t\t/// <summary>\n\t\t/// Creates a completion data that adds the required using for the created type.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">The type to import</param>\n\t\t/// <param name=\"useFullName\">If set to true the full name of the type needs to be used.</param>\n\t\t/// <param name=\"addForTypeCreation\">If true the completion data is used in 'new' context.</param>\n\t\tICompletionData CreateImportCompletionData(IType type, bool useFullName, bool addForTypeCreation);\n\n\t\tICompletionData CreateFormatItemCompletionData(string format, string description, object example);\n\n\t\tICompletionData CreateXmlDocCompletionData (string tag, string description = null, string tagInsertionText = null);\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/IParameterCompletionDataFactory.cs",
    "content": "// \n// IParameterCopmletionFactory.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Completion;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Completion\n{\n\tpublic interface IParameterCompletionDataFactory\n\t{\n\t\tIParameterDataProvider CreateConstructorProvider (int startOffset, IType type);\n\n\t\t/// <summary>\n\t\t/// Creates a constructor provider skipping the parent of thisInitializer.\n\t\t/// </summary>\n\t\tIParameterDataProvider CreateConstructorProvider (int startOffset, IType type, AstNode thisInitializer);\n\n\t\tIParameterDataProvider CreateMethodDataProvider (int startOffset, IEnumerable<IMethod> methods);\n\n\t\tIParameterDataProvider CreateDelegateDataProvider (int startOffset, IType type);\n\t\t\n\t\tIParameterDataProvider CreateIndexerParameterDataProvider (int startOffset, IType type, IEnumerable<IProperty> accessibleIndexers, AstNode resolvedNode);\n\t\t\n\t\tIParameterDataProvider CreateTypeParameterDataProvider (int startOffset, IEnumerable<IType> types);\n\n\t\tIParameterDataProvider CreateTypeParameterDataProvider (int startOffset, IEnumerable<IMethod> methods);\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/CSharpFormatter.cs",
    "content": "//\n// CSharpFormatter.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Editor;\nusing System.Threading;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum FormattingMode {\n\t\tOnTheFly,\n\t\tIntrusive\n\t}\n\n\t/// <summary>\n\t/// The C# Formatter generates a set of text replace actions to format a region in a C# document.\n\t/// </summary>\n\tpublic class CSharpFormatter\n\t{\n\t\treadonly CSharpFormattingOptions policy;\n\t\treadonly TextEditorOptions options;\n\n\t\t/// <summary>\n\t\t/// Gets the formatting policy the formatter uses.\n\t\t/// </summary>\n\t\tpublic CSharpFormattingOptions Policy {\n\t\t\tget {\n\t\t\t\treturn policy;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the text editor options the formatter uses.\n\t\t/// Note: If none was specified TextEditorOptions.Default gets used.\n\t\t/// </summary>\n\t\tpublic TextEditorOptions TextEditorOptions {\n\t\t\tget {\n\t\t\t\treturn options;\n\t\t\t}\n\t\t}\n\n\t\tList<DomRegion> formattingRegions = new List<DomRegion> ();\n\t\tinternal TextLocation lastFormattingLocation = new TextLocation(int.MaxValue, int.MaxValue);\n\n\t\t/// <summary>\n\t\t/// Gets the formatting regions. NOTE: Will get changed to IReadOnlyList.\n\t\t/// </summary>\n\t\tpublic IList<DomRegion> FormattingRegions {\n\t\t\tget {\n\t\t\t\treturn formattingRegions;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the formatting mode. For on the fly formatting a lightweight formatting mode\n\t\t/// gives better results.\n\t\t/// </summary>\n\t\tpublic FormattingMode FormattingMode {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.CSharpFormatter\"/> class.\n\t\t/// </summary>\n\t\t/// <param name=\"policy\">The formatting policy to use.</param>\n\t\t/// <param name=\"options\">The text editor options (optional). Default is: TextEditorOptions.Default</param>\n\t\tpublic CSharpFormatter(CSharpFormattingOptions policy, TextEditorOptions options = null)\n\t\t{\n\t\t\tif (policy == null)\n\t\t\t\tthrow new ArgumentNullException(\"policy\");\n\t\t\tthis.policy = policy;\n\t\t\tthis.options = options ?? TextEditorOptions.Default;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Format the specified document and gives back the formatted text as result.\n\t\t/// </summary>\n\t\tpublic string Format(IDocument document)\n\t\t{\n\t\t\treturn InternalFormat (new StringBuilderDocument (document.Text));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Format the specified text and gives back the formatted text as result.\n\t\t/// </summary>\n\t\tpublic string Format(string text)\n\t\t{\n\t\t\treturn InternalFormat (new StringBuilderDocument (text));\n\t\t}\n\n\t\tstring InternalFormat(IDocument document)\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse (document, document.FileName);\n\t\t\tvar changes = AnalyzeFormatting(document, syntaxTree);\n\t\t\tchanges.ApplyChanges();\n\t\t\treturn document.Text;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Analyzes the formatting of a given document and syntax tree.\n\t\t/// </summary>\n\t\t/// <param name=\"document\">Document.</param>\n\t\t/// <param name=\"syntaxTree\">Syntax tree.</param>\n\t\t/// <param name=\"token\">The cancellation token.</param>\n\t\tpublic FormattingChanges AnalyzeFormatting(IDocument document, SyntaxTree syntaxTree, CancellationToken token = default (CancellationToken))\n\t\t{\n\t\t\tif (document == null)\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\tif (syntaxTree == null)\n\t\t\t\tthrow new ArgumentNullException(\"syntaxTree\");\n\t\t\tvar result = new FormattingChanges(document);\n\t\t\tvar visitor = new FormattingVisitor(this, document, result, token);\n\t\t\tsyntaxTree.AcceptVisitor(visitor);\n\t\t\treturn result;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Adds a region in the document that should be formatted.\n\t\t/// </summary>\n\t\tpublic void AddFormattingRegion (DomRegion region)\n\t\t{\n\t\t\tformattingRegions.Add(region);\n\t\t\tif (formattingRegions.Count == 1) {\n\t\t\t\tlastFormattingLocation = region.End;\n\t\t\t} else {\n\t\t\t\tlastFormattingLocation = lastFormattingLocation < region.End ? region.End : lastFormattingLocation;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/CSharpFormattingOptions.cs",
    "content": "﻿// \n// CSharpFormattingOptions.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n//  \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Reflection;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum BraceStyle\n\t{\n\t\tDoNotChange,\n\t\tEndOfLine,\n\t\tEndOfLineWithoutSpace,\n\t\tNextLine,\n\t\tNextLineShifted,\n\t\tNextLineShifted2,\n\t\tBannerStyle\n\t}\n\n\tpublic enum PropertyFormatting\n\t{\n\t\tAllowOneLine,\n\t\tForceOneLine,\n\t\tForceNewLine\n\t}\n\n\tpublic enum Wrapping {\n\t\tDoNotChange,\n\t\tDoNotWrap,\n\t\tWrapAlways,\n\t\tWrapIfTooLong\n\t}\n\n\tpublic enum NewLinePlacement {\n\t\tDoNotCare,\n\t\tNewLine,\n\t\tSameLine\n\t}\n\n\tpublic enum UsingPlacement {\n\t\tTopOfFile,\n\t\tInsideNamespace\n\t}\n\n\tpublic enum EmptyLineFormatting {\n\t\tDoNotChange,\n\t\tIndent,\n\t\tDoNotIndent\n\t}\n\n\tpublic class CSharpFormattingOptions\n\t{\n\t\tpublic string Name {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IsBuiltIn {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic CSharpFormattingOptions Clone ()\n\t\t{\n\t\t\treturn (CSharpFormattingOptions)MemberwiseClone ();\n\t\t}\n\n\t\t#region Indentation\n\t\tpublic bool IndentNamespaceBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentClassBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentInterfaceBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentStructBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentEnumBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentMethodBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentPropertyBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentEventBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentBlocks { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentSwitchBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentCaseBody { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentBreakStatements { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AlignEmbeddedStatements { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AlignElseInIfStatements {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\n\n\t\tpublic PropertyFormatting AutoPropertyFormatting { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic PropertyFormatting SimplePropertyFormatting { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic EmptyLineFormatting EmptyLineFormatting {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentPreprocessorDirectives { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AlignToMemberReferenceDot { // TODO!\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IndentBlocksInsideExpressions {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Braces\n\t\tpublic BraceStyle NamespaceBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle ClassBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle InterfaceBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle StructBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle EnumBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle MethodBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle AnonymousMethodBraceStyle {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle ConstructorBraceStyle {  // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle DestructorBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle PropertyBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle PropertyGetBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle PropertySetBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic PropertyFormatting SimpleGetBlockFormatting { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic PropertyFormatting SimpleSetBlockFormatting { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle EventBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle EventAddBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle EventRemoveBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AllowEventAddBlockInline { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AllowEventRemoveBlockInline { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle StatementBraceStyle { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AllowIfBlockInline {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tbool allowOneLinedArrayInitialziers = true;\n\t\tpublic bool AllowOneLinedArrayInitialziers {\n\t\t\tget {\n\t\t\t\treturn allowOneLinedArrayInitialziers;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tallowOneLinedArrayInitialziers = value;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region NewLines\n\t\tpublic NewLinePlacement ElseNewLinePlacement { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement ElseIfNewLinePlacement { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement CatchNewLinePlacement { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement FinallyNewLinePlacement { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement WhileNewLinePlacement { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tNewLinePlacement embeddedStatementPlacement = NewLinePlacement.NewLine;\n\t\tpublic NewLinePlacement EmbeddedStatementPlacement {\n\t\t\tget {\n\t\t\t\treturn embeddedStatementPlacement;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tembeddedStatementPlacement = value;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Spaces\n\t\t// Methods\n\t\tpublic bool SpaceBeforeMethodDeclarationParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBetweenEmptyMethodDeclarationParentheses {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeMethodDeclarationParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterMethodDeclarationParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceWithinMethodDeclarationParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// Method calls\n\t\tpublic bool SpaceBeforeMethodCallParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBetweenEmptyMethodCallParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeMethodCallParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterMethodCallParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceWithinMethodCallParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// fields\n\t\t\n\t\tpublic bool SpaceBeforeFieldDeclarationComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterFieldDeclarationComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// local variables\n\t\t\n\t\tpublic bool SpaceBeforeLocalVariableDeclarationComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterLocalVariableDeclarationComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// constructors\n\t\t\n\t\tpublic bool SpaceBeforeConstructorDeclarationParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBetweenEmptyConstructorDeclarationParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeConstructorDeclarationParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterConstructorDeclarationParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceWithinConstructorDeclarationParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement NewLineBeforeConstructorInitializerColon {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement NewLineAfterConstructorInitializerColon {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// indexer\n\t\tpublic bool SpaceBeforeIndexerDeclarationBracket { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceWithinIndexerDeclarationBracket { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeIndexerDeclarationParameterComma {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterIndexerDeclarationParameterComma {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// delegates\n\t\t\n\t\tpublic bool SpaceBeforeDelegateDeclarationParentheses {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBetweenEmptyDelegateDeclarationParentheses {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeDelegateDeclarationParameterComma {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterDelegateDeclarationParameterComma {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceWithinDelegateDeclarationParentheses {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeNewParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeIfParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeWhileParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeForParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeForeachParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeCatchParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeSwitchParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeLockParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeUsingParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundAssignment { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundLogicalOperator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundEqualityOperator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundRelationalOperator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundBitwiseOperator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundAdditiveOperator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundMultiplicativeOperator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundShiftOperator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundNullCoalescingOperator { // Tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterUnsafeAddressOfOperator { // Tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterUnsafeAsteriskOfOperator { // Tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAroundUnsafeArrowOperator { // Tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinIfParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinWhileParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinForParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinForeachParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinCatchParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinSwitchParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinLockParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinUsingParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinCastParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinSizeOfParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeSizeOfParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinTypeOfParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinNewParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesBetweenEmptyNewParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeNewParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterNewParameterComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeTypeOfParentheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesWithinCheckedExpressionParantheses { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeConditionalOperatorCondition { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterConditionalOperatorCondition { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeConditionalOperatorSeparator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterConditionalOperatorSeparator { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// brackets\n\t\tpublic bool SpacesWithinBrackets { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpacesBeforeBrackets { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeBracketComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterBracketComma { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeForSemicolon { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterForSemicolon { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceAfterTypecast { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeArrayDeclarationBrackets { // tested\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceInNamedArgumentAfterDoubleColon {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool RemoveEndOfLineWhiteSpace {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SpaceBeforeSemicolon {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Blank Lines\n\t\tpublic int MinimumBlankLinesBeforeUsings {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesAfterUsings {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesBeforeFirstDeclaration {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesBetweenTypes {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesBetweenFields {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesBetweenEventFields {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesBetweenMembers {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesAroundRegion {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic int MinimumBlankLinesInsideRegion {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t#endregion\n\n\n\t\t#region Keep formatting\n\t\tpublic bool KeepCommentsAtFirstColumn {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t#endregion\n\n\t\t#region Wrapping\n\n\t\tpublic Wrapping ArrayInitializerWrapping {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic BraceStyle ArrayInitializerBraceStyle {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic Wrapping ChainedMethodCallWrapping {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic Wrapping MethodCallArgumentWrapping {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement NewLineAferMethodCallOpenParentheses {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement MethodCallClosingParenthesesOnNewLine {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic Wrapping IndexerArgumentWrapping {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement NewLineAferIndexerOpenBracket {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement IndexerClosingBracketOnNewLine {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic Wrapping MethodDeclarationParameterWrapping {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement NewLineAferMethodDeclarationOpenParentheses {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement MethodDeclarationClosingParenthesesOnNewLine {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic Wrapping IndexerDeclarationParameterWrapping {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement NewLineAferIndexerDeclarationOpenBracket {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement IndexerDeclarationClosingBracketOnNewLine {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AlignToFirstIndexerArgument {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AlignToFirstIndexerDeclarationParameter {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AlignToFirstMethodCallArgument {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool AlignToFirstMethodDeclarationParameter {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic NewLinePlacement NewLineBeforeNewQueryClause {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Using Declarations\n\t\tpublic UsingPlacement UsingPlacement {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t#endregion\n\n\t\tinternal CSharpFormattingOptions()\n\t\t{\n\t\t}\n\n\t\t/*public static CSharpFormattingOptions Load (FilePath selectedFile)\n\t\t{\n\t\t\tusing (var stream = System.IO.File.OpenRead (selectedFile)) {\n\t\t\t\treturn Load (stream);\n\t\t\t}\n\t\t}\n\n\t\tpublic static CSharpFormattingOptions Load (System.IO.Stream input)\n\t\t{\n\t\t\tCSharpFormattingOptions result = FormattingOptionsFactory.CreateMonoOptions ();\n\t\t\tresult.Name = \"noname\";\n\t\t\tusing (XmlTextReader reader = new XmlTextReader (input)) {\n\t\t\t\twhile (reader.Read ()) {\n\t\t\t\t\tif (reader.NodeType == XmlNodeType.Element) {\n\t\t\t\t\t\tif (reader.LocalName == \"Property\") {\n\t\t\t\t\t\t\tvar info = typeof(CSharpFormattingOptions).GetProperty (reader.GetAttribute (\"name\"));\n\t\t\t\t\t\t\tstring valString = reader.GetAttribute (\"value\");\n\t\t\t\t\t\t\tobject value;\n\t\t\t\t\t\t\tif (info.PropertyType == typeof(bool)) {\n\t\t\t\t\t\t\t\tvalue = Boolean.Parse (valString);\n\t\t\t\t\t\t\t} else if (info.PropertyType == typeof(int)) {\n\t\t\t\t\t\t\t\tvalue = Int32.Parse (valString);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvalue = Enum.Parse (info.PropertyType, valString);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tinfo.SetValue (result, value, null);\n\t\t\t\t\t\t} else if (reader.LocalName == \"FormattingProfile\") {\n\t\t\t\t\t\t\tresult.Name = reader.GetAttribute (\"name\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == \"FormattingProfile\") {\n\t\t\t\t\t\t//Console.WriteLine (\"result:\" + result.Name);\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic void Save (string fileName)\n\t\t{\n\t\t\tusing (var writer = new XmlTextWriter (fileName, Encoding.Default)) {\n\t\t\t\twriter.Formatting = System.Xml.Formatting.Indented;\n\t\t\t\twriter.Indentation = 1;\n\t\t\t\twriter.IndentChar = '\\t';\n\t\t\t\twriter.WriteStartElement (\"FormattingProfile\");\n\t\t\t\twriter.WriteAttributeString (\"name\", Name);\n\t\t\t\tforeach (PropertyInfo info in typeof (CSharpFormattingOptions).GetProperties ()) {\n\t\t\t\t\tif (info.GetCustomAttributes (false).Any (o => o.GetType () == typeof(ItemPropertyAttribute))) {\n\t\t\t\t\t\twriter.WriteStartElement (\"Property\");\n\t\t\t\t\t\twriter.WriteAttributeString (\"name\", info.Name);\n\t\t\t\t\t\twriter.WriteAttributeString (\"value\", info.GetValue (this, null).ToString ());\n\t\t\t\t\t\twriter.WriteEndElement ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twriter.WriteEndElement ();\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Equals (CSharpFormattingOptions other)\n\t\t{\n\t\t\tforeach (PropertyInfo info in typeof (CSharpFormattingOptions).GetProperties ()) {\n\t\t\t\tif (info.GetCustomAttributes (false).Any (o => o.GetType () == typeof(ItemPropertyAttribute))) {\n\t\t\t\t\tobject val = info.GetValue (this, null);\n\t\t\t\t\tobject otherVal = info.GetValue (other, null);\n\t\t\t\t\tif (val == null) {\n\t\t\t\t\t\tif (otherVal == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (!val.Equals (otherVal)) {\n\t\t\t\t\t\t//Console.WriteLine (\"!equal\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Console.WriteLine (\"== equal\");\n\t\t\treturn true;\n\t\t}*/\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/ConstructFixer.cs",
    "content": "﻿//\n// ConstructFixer.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Editor;\nusing System.Text;\nusing System.Reflection;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tabstract class ConstructCompleter\n\t{\n\t\tpublic abstract bool TryFix (ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset);\n\n\t\tprotected AstNode GetLastNonErrorChild (AstNode node)\n\t\t{\n\t\t\tvar lastNode = node.LastChild;\n\n\t\t\twhile (lastNode is ErrorNode) {\n\t\t\t\tlastNode = lastNode.GetPrevNode(FormattingVisitor.NoWhitespacePredicate);\n\t\t\t}\n\t\t\treturn lastNode;\n\t\t}\n\t}\n\n\tclass TypeDeclarationCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar typeDeclaration = syntaxTree.GetNodeAt<TypeDeclaration>(location); \n\t\t\tif (typeDeclaration != null) {\n\t\t\t\tif (typeDeclaration.LBraceToken.IsNull && typeDeclaration.RBraceToken.IsNull) {\n\t\t\t\t\tif (typeDeclaration.Members.Any())\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (typeDeclaration);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (typeDeclaration, fixer.Options.ClassBraceStyle, false, ref newOffset));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass DelegateDeclarationCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar typeDeclaration = syntaxTree.GetNodeAt<DelegateDeclaration>(location); \n\t\t\tif (typeDeclaration != null) {\n\t\t\t\tif (typeDeclaration.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (typeDeclaration);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, \");\\n\");\n\t\t\t\t\tnewOffset += \");\\n\".Length;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass MethodDeclarationCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar methodDeclaration = syntaxTree.GetNodeAt<MethodDeclaration>(location); \n\t\t\tif (methodDeclaration != null) {\n\t\t\t\tif (!methodDeclaration.LParToken.IsNull && methodDeclaration.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (methodDeclaration);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, \")\\n\\t{\\t\\t\\n\\t}\");\n\t\t\t\t\tnewOffset += \")\\n\\t{\\t\\t\".Length;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass IfStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar ifStatement = syntaxTree.GetNodeAt<IfElseStatement>(location); \n\t\t\tif (ifStatement != null) {\n\t\t\t\tif (!ifStatement.LParToken.IsNull && ifStatement.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (ifStatement);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (ifStatement, fixer.Options.StatementBraceStyle, true, ref newOffset));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass ForeachStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar ifStatement = syntaxTree.GetNodeAt<ForeachStatement>(location); \n\t\t\tif (ifStatement != null) {\n\t\t\t\tif (!ifStatement.LParToken.IsNull && ifStatement.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (ifStatement);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (ifStatement, fixer.Options.StatementBraceStyle, true, ref newOffset));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass WhileStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar ifStatement = syntaxTree.GetNodeAt<WhileStatement>(location); \n\t\t\tif (ifStatement != null) {\n\t\t\t\tif (!ifStatement.LParToken.IsNull && ifStatement.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (ifStatement);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (ifStatement, fixer.Options.StatementBraceStyle, true, ref newOffset));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass DoWhileStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<DoWhileStatement>(location); \n\t\t\tif (stmt != null) {\n\t\t\t\tif (!stmt.LParToken.IsNull && stmt.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (stmt);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, \");\");\n\t\t\t\t\tnewOffset = insertionOffset + 2;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass FixedStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<FixedStatement>(location); \n\t\t\tif (stmt != null) {\n\t\t\t\tif (!stmt.LParToken.IsNull && stmt.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (stmt);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (stmt, fixer.Options.StatementBraceStyle, true, ref newOffset));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass SwitchStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar switchStatement = syntaxTree.GetNodeAt<SwitchStatement>(location); \n\t\t\tif (switchStatement != null) {\n\t\t\t\tif (!switchStatement.LParToken.IsNull && switchStatement.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (switchStatement);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (switchStatement, fixer.Options.StatementBraceStyle, true, ref newOffset));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass InvocationCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar invocationExpression = syntaxTree.GetNodeAt<InvocationExpression>(location); \n\n\t\t\tif (invocationExpression != null) {\n\t\t\t\tif (!invocationExpression.LParToken.IsNull && invocationExpression.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (invocationExpression);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\n\t\t\t\t\tnewOffset = insertionOffset;\n\n\n\t\t\t\t\tvar text = \")\";\n\t\t\t\t\tnewOffset++;\n\t\t\t\t\tvar expressionStatement = invocationExpression.Parent as ExpressionStatement;\n\t\t\t\t\tif (expressionStatement != null) {\n\t\t\t\t\t\tif (expressionStatement.SemicolonToken.IsNull)\n\t\t\t\t\t\t\ttext = \");\";\n\t\t\t\t\t\tnewOffset ++;\n\t\t\t\t\t}\n\t\t\t\t\tdocument.Insert(insertionOffset, text);\n\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass BreakStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<BreakStatement>(location); \n\n\t\t\tif (stmt != null && stmt.SemicolonToken.IsNull) {\n\t\t\t\t// TODO !!!!\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass CheckedStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<CheckedExpression>(location); \n\n\t\t\tif (stmt != null && stmt.Parent is ExpressionStatement) {\n\t\t\t\tvar insertionOffset = document.GetOffset(stmt.EndLocation);\n\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (stmt, fixer.Options.StatementBraceStyle, false, ref newOffset));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass UncheckedStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<UncheckedExpression>(location); \n\n\t\t\tif (stmt != null && stmt.Parent is ExpressionStatement) {\n\t\t\t\tvar insertionOffset = document.GetOffset(stmt.EndLocation);\n\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (stmt, fixer.Options.StatementBraceStyle, false, ref newOffset));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass ExpressionStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar expressionStatement = syntaxTree.GetNodeAt<ExpressionStatement>(location); \n\n\t\t\tif (expressionStatement != null) {\n\t\t\t\tint offset = document.GetOffset(expressionStatement.Expression.EndLocation);\n\t\t\t\tif (expressionStatement.SemicolonToken.IsNull) {\n\t\t\t\t\tdocument.Insert(offset, \";\");\n\t\t\t\t\tnewOffset = offset + 1;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass LockStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<LockStatement>(location); \n\t\t\tif (stmt != null) {\n\t\t\t\tif (!stmt.LParToken.IsNull && stmt.RParToken.IsNull) {\n\t\t\t\t\tvar lastNode = GetLastNonErrorChild (stmt);\n\t\t\t\t\tif (lastNode == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar insertionOffset = document.GetOffset(lastNode.EndLocation);\n\t\t\t\t\tdocument.Insert(insertionOffset, fixer.GenerateBody (stmt, fixer.Options.StatementBraceStyle, true, ref newOffset));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass ReturnStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<ReturnStatement>(location); \n\n\t\t\tif (stmt != null && stmt.SemicolonToken.IsNull) {\n\t\t\t\tvar insertionOffset = document.GetOffset(stmt.EndLocation);\n\t\t\t\tdocument.Insert(insertionOffset, \";\");\n\t\t\t\tnewOffset = insertionOffset + 1;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass YieldReturnStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<YieldReturnStatement>(location); \n\n\t\t\tif (stmt != null && stmt.SemicolonToken.IsNull) {\n\t\t\t\tvar insertionOffset = document.GetOffset(stmt.EndLocation);\n\t\t\t\tdocument.Insert(insertionOffset, \";\");\n\t\t\t\tnewOffset = insertionOffset + 1;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass ThrowStatementCompleter : ConstructCompleter\n\t{\n\t\tpublic override bool TryFix(ConstructFixer fixer, SyntaxTree syntaxTree, IDocument document, TextLocation location, ref int newOffset)\n\t\t{\n\t\t\tvar stmt = syntaxTree.GetNodeAt<ThrowStatement>(location); \n\n\t\t\tif (stmt != null && stmt.SemicolonToken.IsNull) {\n\t\t\t\tvar insertionOffset = document.GetOffset(stmt.EndLocation);\n\t\t\t\tdocument.Insert(insertionOffset, \";\");\n\t\t\t\tnewOffset = insertionOffset + 1;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\n\n\tpublic class ConstructFixer\n\t{\n\t\tstatic readonly ConstructCompleter[] completer = {\n\t\t\tnew TypeDeclarationCompleter(),\n\t\t\tnew DelegateDeclarationCompleter (),\n\t\t\tnew MethodDeclarationCompleter (),\n\t\t\tnew IfStatementCompleter (),\n\t\t\tnew ForeachStatementCompleter (),\n\t\t\tnew WhileStatementCompleter (),\n\t\t\tnew LockStatementCompleter (),\n\t\t\tnew FixedStatementCompleter (),\n\t\t\tnew DoWhileStatementCompleter (),\n\t\t\tnew SwitchStatementCompleter (),\n\t\t\tnew BreakStatementCompleter (),\n\t\t\tnew ThrowStatementCompleter (),\n\t\t\tnew ReturnStatementCompleter (),\n\t\t\tnew YieldReturnStatementCompleter (),\n\t\t\tnew CheckedStatementCompleter (),\n\t\t\tnew UncheckedStatementCompleter (),\n\n\t\t\tnew InvocationCompleter (),\n\t\t\tnew ExpressionStatementCompleter ()\n\t\t};\n\n\t\treadonly CSharpFormattingOptions options;\n\t\treadonly TextEditorOptions textEditorOptions;\n\n\t\tpublic CSharpFormattingOptions Options {\n\t\t\tget {\n\t\t\t\treturn options;\n\t\t\t}\n\t\t}\n\n\t\tpublic ConstructFixer(CSharpFormattingOptions options, TextEditorOptions textEditorOptions)\n\t\t{\n\t\t\tthis.options = options;\n\t\t\tthis.textEditorOptions = textEditorOptions;\n\t\t}\n\t\t\n\n\t\tstring GetIndent(AstNode node)\n\t\t{\n\t\t\tif (node == null || node is SyntaxTree)\n\t\t\t\treturn \"\";\n\t\t\tif (node is BlockStatement || node is TypeDeclaration || node is NamespaceDeclaration)\n\t\t\t\treturn \"\\t\" + GetIndent(node.Parent);\n\t\t\treturn GetIndent(node.Parent);\n\t\t}\n\n\t\tinternal string GenerateBody(AstNode node, BraceStyle braceStyle, bool addClosingBracket, ref int newOffset)\n\t\t{\n\t\t\tStringBuilder result = new StringBuilder();\n\t\t\tif (addClosingBracket)\n\t\t\t\tresult.Append(\")\");\n\t\t\tvar nodeIndent = GetIndent(node.Parent);\n\t\t\tswitch (braceStyle) {\n\t\t\t\tcase BraceStyle.DoNotChange:\n\t\t\t\tcase BraceStyle.BannerStyle:\n\t\t\t\tcase BraceStyle.EndOfLine:\n\t\t\t\t\tresult.Append(\" \");\n\t\t\t\t\tresult.Append(\"{\");\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent + \"\\t\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.EndOfLineWithoutSpace:\n\t\t\t\t\tresult.Append(\"{\");\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent + \"\\t\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLine:\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent);\n\t\t\t\t\tresult.Append(\"{\");\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent + \"\\t\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted:\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent + \"\\t\");\n\t\t\t\t\tresult.Append(\"{\");\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent + \"\\t\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted2:\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent + \"\\t\");\n\t\t\t\t\tresult.Append(\"{\");\n\t\t\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tresult.Append(nodeIndent + \"\\t\" + \"\\t\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tnewOffset += result.Length;\n\t\t\tresult.Append(textEditorOptions.EolMarker);\n\t\t\tresult.Append(nodeIndent);\n\t\t\tresult.Append(\"}\");\n\n\t\t\treturn result.ToString();\n\t\t}\n\n\t\tpublic bool TryFix (IDocument document, int offset, out int newOffset)\n\t\t{\n\t\t\tnewOffset = offset;\n\n\t\t\tvar syntaxTree = SyntaxTree.Parse(document, \"a.cs\"); \n\t\t\tvar location = document.GetLocation(offset - 1);\n\t\t\tforeach (var c in completer) {\n\t\t\t\tif (c.TryFix(this, syntaxTree, document, location, ref newOffset)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingChanges.cs",
    "content": "//\n// CSharpFormatter.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Editor;\nusing System.Threading;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// The formatting changes are used to format a specific region inside a document and apply a minimal formatting\n\t/// changeset to a given document. This is useful for a text editor environment.\n\t/// </summary>\n\tpublic class FormattingChanges\n\t{\n\t\treadonly IDocument document;\n\t\treadonly internal List<TextReplaceAction> changes = new List<TextReplaceAction> ();\n\n\t\tinternal FormattingChanges (IDocument document)\n\t\t{\n\t\t\tif (document == null)\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\tthis.document = document;\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn changes.Count;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Applies the changes to the input document.\n\t\t/// </summary>\n\t\tpublic void ApplyChanges()\n\t\t{\n\t\t\tApplyChanges(0, document.TextLength, document.Replace, (o, l, v) => document.GetText(o, l) == v);\n\t\t}\n\n\t\tpublic void ApplyChanges(int startOffset, int length)\n\t\t{\n\t\t\tApplyChanges(startOffset, length, document.Replace, (o, l, v) => document.GetText(o, l) == v);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Applies the changes to the given Script instance.\n\t\t/// </summary>\n\t\tpublic void ApplyChanges(Script script)\n\t\t{\n\t\t\tApplyChanges(0, document.TextLength, script.Replace);\n\t\t}\n\n\t\tpublic void ApplyChanges(int startOffset, int length, Script script)\n\t\t{\n\t\t\tApplyChanges(startOffset, length, script.Replace);\n\t\t}\n\n\t\tpublic void ApplyChanges(int startOffset, int length, Action<int, int, string> documentReplace, Func<int, int, string, bool> filter = null)\n\t\t{\n\t\t\tint endOffset = startOffset + length;\n\t\t\t//\t\t\tConsole.WriteLine (\"apply:\"+ startOffset + \"->\" + endOffset);\n\t\t\t//\t\t\tConsole.WriteLine (document.Text.Substring (0, startOffset) + new string ('x',length) + document.Text.Substring (startOffset+ length));\n\n\t\t\tTextReplaceAction previousChange = null;\n\t\t\tint delta = 0;\n\t\t\tvar depChanges = new List<TextReplaceAction> ();\n\t\t\tforeach (var change in changes.OrderBy(c => c.Offset)) {\n\t\t\t\tif (previousChange != null) {\n\t\t\t\t\tif (change.Equals(previousChange)) {\n\t\t\t\t\t\t// ignore duplicate changes\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (change.Offset < previousChange.Offset + previousChange.RemovalLength) {\n\t\t\t\t\t\tthrow new InvalidOperationException (\"Detected overlapping changes \" + change + \"/\" + previousChange);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpreviousChange = change;\n\t\t\t\tbool skipChange = change.Offset + change.RemovalLength < startOffset || change.Offset > endOffset;\n\t\t\t\tskipChange |= filter != null && filter(change.Offset + delta, change.RemovalLength, change.NewText);\n\t\t\t\tskipChange &= !depChanges.Contains(change);\n\t\t\t\tif (!skipChange) {\n\t\t\t\t\tdocumentReplace(change.Offset + delta, change.RemovalLength, change.NewText);\n\t\t\t\t\tdelta += change.NewText.Length - change.RemovalLength;\n\t\t\t\t\tif (change.DependsOn != null) {\n\t\t\t\t\t\tdepChanges.Add(change.DependsOn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tchanges.Clear();\n\t\t}\n\n\t\tinternal TextReplaceAction AddChange(int offset, int removedChars, string insertedText)\n\t\t{\n\t\t\tif (offset < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\", \"Should be >= 0\");\n\t\t\tif (offset >= document.TextLength)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"offset\", \"Should be < document.TextLength\");\n\t\t\tif (removedChars < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"removedChars\", \"Should be >= 0\");\n\t\t\tif (removedChars > offset + document.TextLength)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"removedChars\", \"Tried to remove beyond end of text\");\n\t\t\tif (removedChars == 0 && string.IsNullOrEmpty (insertedText))\n\t\t\t\treturn null;\n\t\t\tvar action = new TextReplaceAction (offset, removedChars, insertedText);\n\t\t\tchanges.Add(action);\n\t\t\treturn action;\n\t\t}\n\t\t\n\t\tinternal sealed class TextReplaceAction\n\t\t{\n\t\t\tinternal readonly int Offset;\n\t\t\tinternal readonly int RemovalLength;\n\t\t\tinternal readonly string NewText;\n\t\t\tinternal TextReplaceAction DependsOn;\n\n\t\t\tpublic TextReplaceAction (int offset, int removalLength, string newText)\n\t\t\t{\n\t\t\t\tthis.Offset = offset;\n\t\t\t\tthis.RemovalLength = removalLength;\n\t\t\t\tthis.NewText = newText ?? string.Empty;\n\t\t\t}\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tTextReplaceAction other = obj as TextReplaceAction;\n\t\t\t\tif (other == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn this.Offset == other.Offset && this.RemovalLength == other.RemovalLength && this.NewText == other.NewText;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn string.Format(\"[TextReplaceAction: Offset={0}, RemovalLength={1}, NewText={2}]\", Offset, RemovalLength, NewText);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingOptionsFactory.cs",
    "content": "﻿// \n// FormattingOptionsFactory.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// The formatting options factory creates pre defined formatting option styles.\n\t/// </summary>\n\tpublic static class FormattingOptionsFactory\n\t{\n\t\t/// <summary>\n\t\t/// Creates empty CSharpFormatting options.\n\t\t/// </summary>\n\t\tpublic static CSharpFormattingOptions CreateEmpty()\n\t\t{\n\t\t\treturn new CSharpFormattingOptions();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates mono indent style CSharpFormatting options.\n\t\t/// </summary>\n\t\tpublic static CSharpFormattingOptions CreateMono()\n\t\t{\n\t\t\treturn new CSharpFormattingOptions {\n\t\t\t\tIndentNamespaceBody = true,\n\t\t\t\tIndentClassBody = true,\n\t\t\t\tIndentInterfaceBody = true,\n\t\t\t\tIndentStructBody = true,\n\t\t\t\tIndentEnumBody = true,\n\t\t\t\tIndentMethodBody = true,\n\t\t\t\tIndentPropertyBody = true,\n\t\t\t\tIndentEventBody = true,\n\t\t\t\tIndentBlocks = true,\n\t\t\t\tIndentSwitchBody = false,\n\t\t\t\tIndentCaseBody = true,\n\t\t\t\tIndentBreakStatements = true,\n\t\t\t\tIndentPreprocessorDirectives = true,\n\t\t\t\tIndentBlocksInsideExpressions = false,\n\t\t\t\tNamespaceBraceStyle = BraceStyle.NextLine,\n\t\t\t\tClassBraceStyle = BraceStyle.NextLine,\n\t\t\t\tInterfaceBraceStyle = BraceStyle.NextLine,\n\t\t\t\tStructBraceStyle = BraceStyle.NextLine,\n\t\t\t\tEnumBraceStyle = BraceStyle.NextLine,\n\t\t\t\tMethodBraceStyle = BraceStyle.NextLine,\n\t\t\t\tConstructorBraceStyle = BraceStyle.NextLine,\n\t\t\t\tDestructorBraceStyle = BraceStyle.NextLine,\n\t\t\t\tAnonymousMethodBraceStyle = BraceStyle.EndOfLine,\n\t\n\t\t\t\tPropertyBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tPropertyGetBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tPropertySetBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tSimpleGetBlockFormatting = PropertyFormatting.AllowOneLine,\n\t\t\t\tSimpleSetBlockFormatting = PropertyFormatting.AllowOneLine,\n\n\t\t\t\tEventBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tEventAddBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tEventRemoveBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tAllowEventAddBlockInline = true,\n\t\t\t\tAllowEventRemoveBlockInline = true,\n\t\t\t\tStatementBraceStyle = BraceStyle.EndOfLine,\n\t\n\t\t\t\tElseNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tElseIfNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tCatchNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tFinallyNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tWhileNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tArrayInitializerWrapping = Wrapping.WrapIfTooLong,\n\t\t\t\tArrayInitializerBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tAllowOneLinedArrayInitialziers = true,\n\n\t\t\t\tSpaceBeforeMethodCallParentheses = true,\n\t\t\t\tSpaceBeforeMethodDeclarationParentheses = true,\n\t\t\t\tSpaceBeforeConstructorDeclarationParentheses = true,\n\t\t\t\tSpaceBeforeDelegateDeclarationParentheses = true,\n\t\t\t\tSpaceAfterMethodCallParameterComma = true,\n\t\t\t\tSpaceAfterConstructorDeclarationParameterComma = true,\n\n\t\t\t\tSpaceBeforeNewParentheses = true,\n\t\t\t\tSpacesWithinNewParentheses = false,\n\t\t\t\tSpacesBetweenEmptyNewParentheses = false,\n\t\t\t\tSpaceBeforeNewParameterComma = false,\n\t\t\t\tSpaceAfterNewParameterComma = true,\n\t\t\t\t\n\t\t\t\tSpaceBeforeIfParentheses = true,\n\t\t\t\tSpaceBeforeWhileParentheses = true,\n\t\t\t\tSpaceBeforeForParentheses = true,\n\t\t\t\tSpaceBeforeForeachParentheses = true,\n\t\t\t\tSpaceBeforeCatchParentheses = true,\n\t\t\t\tSpaceBeforeSwitchParentheses = true,\n\t\t\t\tSpaceBeforeLockParentheses = true,\n\t\t\t\tSpaceBeforeUsingParentheses = true,\n\t\t\t\tSpaceAroundAssignment = true,\n\t\t\t\tSpaceAroundLogicalOperator = true,\n\t\t\t\tSpaceAroundEqualityOperator = true,\n\t\t\t\tSpaceAroundRelationalOperator = true,\n\t\t\t\tSpaceAroundBitwiseOperator = true,\n\t\t\t\tSpaceAroundAdditiveOperator = true,\n\t\t\t\tSpaceAroundMultiplicativeOperator = true,\n\t\t\t\tSpaceAroundShiftOperator = true,\n\t\t\t\tSpaceAroundNullCoalescingOperator = true,\n\t\t\t\tSpacesWithinParentheses = false,\n\t\t\t\tSpaceWithinMethodCallParentheses = false,\n\t\t\t\tSpaceWithinMethodDeclarationParentheses = false,\n\t\t\t\tSpacesWithinIfParentheses = false,\n\t\t\t\tSpacesWithinWhileParentheses = false,\n\t\t\t\tSpacesWithinForParentheses = false,\n\t\t\t\tSpacesWithinForeachParentheses = false,\n\t\t\t\tSpacesWithinCatchParentheses = false,\n\t\t\t\tSpacesWithinSwitchParentheses = false,\n\t\t\t\tSpacesWithinLockParentheses = false,\n\t\t\t\tSpacesWithinUsingParentheses = false,\n\t\t\t\tSpacesWithinCastParentheses = false,\n\t\t\t\tSpacesWithinSizeOfParentheses = false,\n\t\t\t\tSpacesWithinTypeOfParentheses = false,\n\t\t\t\tSpacesWithinCheckedExpressionParantheses = false,\n\t\t\t\tSpaceBeforeConditionalOperatorCondition = true,\n\t\t\t\tSpaceAfterConditionalOperatorCondition = true,\n\t\t\t\tSpaceBeforeConditionalOperatorSeparator = true,\n\t\t\t\tSpaceAfterConditionalOperatorSeparator = true,\n\t\n\t\t\t\tSpacesWithinBrackets = false,\n\t\t\t\tSpacesBeforeBrackets = true,\n\t\t\t\tSpaceBeforeBracketComma = false,\n\t\t\t\tSpaceAfterBracketComma = true,\n\t\t\t\t\t\t\n\t\t\t\tSpaceBeforeForSemicolon = false,\n\t\t\t\tSpaceAfterForSemicolon = true,\n\t\t\t\tSpaceAfterTypecast = false,\n\t\t\t\t\n\t\t\t\tAlignEmbeddedStatements = true,\n\t\t\t\tSimplePropertyFormatting = PropertyFormatting.AllowOneLine,\n\t\t\t\tAutoPropertyFormatting = PropertyFormatting.AllowOneLine,\n\t\t\t\tEmptyLineFormatting = EmptyLineFormatting.DoNotIndent,\n\t\t\t\tSpaceBeforeMethodDeclarationParameterComma = false,\n\t\t\t\tSpaceAfterMethodDeclarationParameterComma = true,\n\t\t\t\tSpaceAfterDelegateDeclarationParameterComma = true,\n\t\t\t\tSpaceBeforeFieldDeclarationComma = false,\n\t\t\t\tSpaceAfterFieldDeclarationComma = true,\n\t\t\t\tSpaceBeforeLocalVariableDeclarationComma = false,\n\t\t\t\tSpaceAfterLocalVariableDeclarationComma = true,\n\t\t\t\t\n\t\t\t\tSpaceBeforeIndexerDeclarationBracket = true,\n\t\t\t\tSpaceWithinIndexerDeclarationBracket = false,\n\t\t\t\tSpaceBeforeIndexerDeclarationParameterComma = false,\n\t\t\t\tSpaceInNamedArgumentAfterDoubleColon = true,\n\t\t\t\tRemoveEndOfLineWhiteSpace = true,\n\t\t\t\n\t\t\t\tSpaceAfterIndexerDeclarationParameterComma = true,\n\t\t\t\t\n\t\t\t\tMinimumBlankLinesBeforeUsings = 0,\n\t\t\t\tMinimumBlankLinesAfterUsings = 1,\n\t\t\t\tUsingPlacement = UsingPlacement.TopOfFile,\n\t\t\t\t\n\t\t\t\tMinimumBlankLinesBeforeFirstDeclaration = 0,\n\t\t\t\tMinimumBlankLinesBetweenTypes = 1,\n\t\t\t\tMinimumBlankLinesBetweenFields = 0,\n\t\t\t\tMinimumBlankLinesBetweenEventFields = 0,\n\t\t\t\tMinimumBlankLinesBetweenMembers = 1,\n\t\t\t\tMinimumBlankLinesAroundRegion = 1,\n\t\t\t\tMinimumBlankLinesInsideRegion = 1,\n\t\t\t\tAlignToFirstIndexerArgument = false,\n\t\t\t\tAlignToFirstIndexerDeclarationParameter = true,\n\t\t\t\tAlignToFirstMethodCallArgument = false,\n\t\t\t\tAlignToFirstMethodDeclarationParameter = true,\n\t\t\t\tKeepCommentsAtFirstColumn = true,\n\t\t\t\tChainedMethodCallWrapping = Wrapping.DoNotChange,\n\t\t\t\tMethodCallArgumentWrapping = Wrapping.DoNotChange,\n\t\t\t\tNewLineAferMethodCallOpenParentheses = NewLinePlacement.DoNotCare,\n\t\t\t\tMethodCallClosingParenthesesOnNewLine = NewLinePlacement.DoNotCare,\n\n\t\t\t\tIndexerArgumentWrapping = Wrapping.DoNotChange,\n\t\t\t\tNewLineAferIndexerOpenBracket = NewLinePlacement.DoNotCare,\n\t\t\t\tIndexerClosingBracketOnNewLine = NewLinePlacement.DoNotCare,\n\n\t\t\t\tNewLineBeforeNewQueryClause = NewLinePlacement.NewLine\n\t\t\t};\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates sharp develop indent style CSharpFormatting options.\n\t\t/// </summary>\n\t\tpublic static CSharpFormattingOptions CreateSharpDevelop()\n\t\t{\n\t\t\tvar baseOptions = CreateKRStyle();\n\t\t\treturn baseOptions;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The K&R style, so named because it was used in Kernighan and Ritchie's book The C Programming Language,\n\t\t/// is commonly used in C. It is less common for C++, C#, and others.\n\t\t/// </summary>\n\t\tpublic static CSharpFormattingOptions CreateKRStyle()\n\t\t{\n\t\t\treturn new CSharpFormattingOptions() {\n\t\t\t\tIndentNamespaceBody = true,\n\t\t\t\tIndentClassBody = true,\n\t\t\t\tIndentInterfaceBody = true,\n\t\t\t\tIndentStructBody = true,\n\t\t\t\tIndentEnumBody = true,\n\t\t\t\tIndentMethodBody = true,\n\t\t\t\tIndentPropertyBody = true,\n\t\t\t\tIndentEventBody = true,\n\t\t\t\tIndentBlocks = true,\n\t\t\t\tIndentSwitchBody = true,\n\t\t\t\tIndentCaseBody = true,\n\t\t\t\tIndentBreakStatements = true,\n\t\t\t\tIndentPreprocessorDirectives = true,\n\t\t\t\tNamespaceBraceStyle = BraceStyle.NextLine,\n\t\t\t\tClassBraceStyle = BraceStyle.NextLine,\n\t\t\t\tInterfaceBraceStyle = BraceStyle.NextLine,\n\t\t\t\tStructBraceStyle = BraceStyle.NextLine,\n\t\t\t\tEnumBraceStyle = BraceStyle.NextLine,\n\t\t\t\tMethodBraceStyle = BraceStyle.NextLine,\n\t\t\t\tConstructorBraceStyle = BraceStyle.NextLine,\n\t\t\t\tDestructorBraceStyle = BraceStyle.NextLine,\n\t\t\t\tAnonymousMethodBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tPropertyBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tPropertyGetBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tPropertySetBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tSimpleGetBlockFormatting = PropertyFormatting.AllowOneLine,\n\t\t\t\tSimpleSetBlockFormatting = PropertyFormatting.AllowOneLine,\n\t\n\t\t\t\tEventBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tEventAddBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tEventRemoveBraceStyle = BraceStyle.EndOfLine,\n\t\t\t\tAllowEventAddBlockInline = true,\n\t\t\t\tAllowEventRemoveBlockInline = true,\n\t\t\t\tStatementBraceStyle = BraceStyle.EndOfLine,\n\t\n\t\t\t\tElseNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tElseIfNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tCatchNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tFinallyNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tWhileNewLinePlacement = NewLinePlacement.SameLine,\n\t\t\t\tArrayInitializerWrapping = Wrapping.WrapIfTooLong,\n\t\t\t\tArrayInitializerBraceStyle = BraceStyle.EndOfLine,\n\t\n\t\t\t\tSpaceBeforeMethodCallParentheses = false,\n\t\t\t\tSpaceBeforeMethodDeclarationParentheses = false,\n\t\t\t\tSpaceBeforeConstructorDeclarationParentheses = false,\n\t\t\t\tSpaceBeforeDelegateDeclarationParentheses = false,\n\t\t\t\tSpaceBeforeIndexerDeclarationBracket = false,\n\t\t\t\tSpaceAfterMethodCallParameterComma = true,\n\t\t\t\tSpaceAfterConstructorDeclarationParameterComma = true,\n\t\t\t\tNewLineBeforeConstructorInitializerColon = NewLinePlacement.NewLine,\n\t\t\t\tNewLineAfterConstructorInitializerColon = NewLinePlacement.SameLine,\n\t\t\t\t\n\t\t\t\tSpaceBeforeNewParentheses = false,\n\t\t\t\tSpacesWithinNewParentheses = false,\n\t\t\t\tSpacesBetweenEmptyNewParentheses = false,\n\t\t\t\tSpaceBeforeNewParameterComma = false,\n\t\t\t\tSpaceAfterNewParameterComma = true,\n\t\t\t\t\n\t\t\t\tSpaceBeforeIfParentheses = true,\n\t\t\t\tSpaceBeforeWhileParentheses = true,\n\t\t\t\tSpaceBeforeForParentheses = true,\n\t\t\t\tSpaceBeforeForeachParentheses = true,\n\t\t\t\tSpaceBeforeCatchParentheses = true,\n\t\t\t\tSpaceBeforeSwitchParentheses = true,\n\t\t\t\tSpaceBeforeLockParentheses = true,\n\t\t\t\tSpaceBeforeUsingParentheses = true,\n\n\t\t\t\tSpaceAroundAssignment = true,\n\t\t\t\tSpaceAroundLogicalOperator = true,\n\t\t\t\tSpaceAroundEqualityOperator = true,\n\t\t\t\tSpaceAroundRelationalOperator = true,\n\t\t\t\tSpaceAroundBitwiseOperator = true,\n\t\t\t\tSpaceAroundAdditiveOperator = true,\n\t\t\t\tSpaceAroundMultiplicativeOperator = true,\n\t\t\t\tSpaceAroundShiftOperator = true,\n\t\t\t\tSpaceAroundNullCoalescingOperator = true,\n\t\t\t\tSpacesWithinParentheses = false,\n\t\t\t\tSpaceWithinMethodCallParentheses = false,\n\t\t\t\tSpaceWithinMethodDeclarationParentheses = false,\n\t\t\t\tSpacesWithinIfParentheses = false,\n\t\t\t\tSpacesWithinWhileParentheses = false,\n\t\t\t\tSpacesWithinForParentheses = false,\n\t\t\t\tSpacesWithinForeachParentheses = false,\n\t\t\t\tSpacesWithinCatchParentheses = false,\n\t\t\t\tSpacesWithinSwitchParentheses = false,\n\t\t\t\tSpacesWithinLockParentheses = false,\n\t\t\t\tSpacesWithinUsingParentheses = false,\n\t\t\t\tSpacesWithinCastParentheses = false,\n\t\t\t\tSpacesWithinSizeOfParentheses = false,\n\t\t\t\tSpacesWithinTypeOfParentheses = false,\n\t\t\t\tSpacesWithinCheckedExpressionParantheses = false,\n\t\t\t\tSpaceBeforeConditionalOperatorCondition = true,\n\t\t\t\tSpaceAfterConditionalOperatorCondition = true,\n\t\t\t\tSpaceBeforeConditionalOperatorSeparator = true,\n\t\t\t\tSpaceAfterConditionalOperatorSeparator = true,\n\t\t\t\tSpaceBeforeArrayDeclarationBrackets = false,\n\n\t\t\t\tSpacesWithinBrackets = false,\n\t\t\t\tSpacesBeforeBrackets = false,\n\t\t\t\tSpaceBeforeBracketComma = false,\n\t\t\t\tSpaceAfterBracketComma = true,\n\t\t\t\t\t\t\n\t\t\t\tSpaceBeforeForSemicolon = false,\n\t\t\t\tSpaceAfterForSemicolon = true,\n\t\t\t\tSpaceAfterTypecast = false,\n\t\t\t\t\n\t\t\t\tAlignEmbeddedStatements = true,\n\t\t\t\tSimplePropertyFormatting = PropertyFormatting.AllowOneLine,\n\t\t\t\tAutoPropertyFormatting = PropertyFormatting.AllowOneLine,\n\t\t\t\tEmptyLineFormatting = EmptyLineFormatting.DoNotIndent,\n\t\t\t\tSpaceBeforeMethodDeclarationParameterComma = false,\n\t\t\t\tSpaceAfterMethodDeclarationParameterComma = true,\n\t\t\t\tSpaceAfterDelegateDeclarationParameterComma = true,\n\t\t\t\tSpaceBeforeFieldDeclarationComma = false,\n\t\t\t\tSpaceAfterFieldDeclarationComma = true,\n\t\t\t\tSpaceBeforeLocalVariableDeclarationComma = false,\n\t\t\t\tSpaceAfterLocalVariableDeclarationComma = true,\n\t\t\t\t\n\t\t\t\tSpaceWithinIndexerDeclarationBracket = false,\n\t\t\t\tSpaceBeforeIndexerDeclarationParameterComma = false,\n\t\t\t\tSpaceInNamedArgumentAfterDoubleColon = true,\n\t\t\t\n\t\t\t\tSpaceAfterIndexerDeclarationParameterComma = true,\n\t\t\t\tRemoveEndOfLineWhiteSpace = true,\n\t\t\t\t\n\t\t\t\tMinimumBlankLinesBeforeUsings = 0,\n\t\t\t\tMinimumBlankLinesAfterUsings = 1,\n\n\t\t\t\tMinimumBlankLinesBeforeFirstDeclaration = 0,\n\t\t\t\tMinimumBlankLinesBetweenTypes = 1,\n\t\t\t\tMinimumBlankLinesBetweenFields = 0,\n\t\t\t\tMinimumBlankLinesBetweenEventFields = 0,\n\t\t\t\tMinimumBlankLinesBetweenMembers = 1,\n\t\t\t\tMinimumBlankLinesAroundRegion = 1,\n\t\t\t\tMinimumBlankLinesInsideRegion = 1,\n\t\n\t\t\t\tKeepCommentsAtFirstColumn = true,\n\t\t\t\tChainedMethodCallWrapping = Wrapping.DoNotChange,\n\t\t\t\tMethodCallArgumentWrapping = Wrapping.DoNotChange,\n\t\t\t\tNewLineAferMethodCallOpenParentheses = NewLinePlacement.DoNotCare,\n\t\t\t\tMethodCallClosingParenthesesOnNewLine = NewLinePlacement.DoNotCare,\n\n\t\t\t\tIndexerArgumentWrapping = Wrapping.DoNotChange,\n\t\t\t\tNewLineAferIndexerOpenBracket = NewLinePlacement.DoNotCare,\n\t\t\t\tIndexerClosingBracketOnNewLine = NewLinePlacement.DoNotCare,\n\n\t\t\t\tNewLineBeforeNewQueryClause = NewLinePlacement.NewLine\n\t\t\t};\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates allman indent style CSharpFormatting options used in Visual Studio.\n\t\t/// </summary>\n\t\tpublic static CSharpFormattingOptions CreateAllman()\n\t\t{\n\t\t\tvar baseOptions = CreateKRStyle();\n\t\t\tbaseOptions.AnonymousMethodBraceStyle = BraceStyle.NextLine;\n\t\t\tbaseOptions.PropertyBraceStyle = BraceStyle.NextLine;\n\t\t\tbaseOptions.PropertyGetBraceStyle = BraceStyle.NextLine;\n\t\t\tbaseOptions.PropertySetBraceStyle = BraceStyle.NextLine;\n\n\t\t\tbaseOptions.EventBraceStyle = BraceStyle.NextLine;\n\t\t\tbaseOptions.EventAddBraceStyle = BraceStyle.NextLine;\n\t\t\tbaseOptions.EventRemoveBraceStyle = BraceStyle.NextLine;\n\t\t\tbaseOptions.StatementBraceStyle = BraceStyle.NextLine;\n\t\t\tbaseOptions.ArrayInitializerBraceStyle = BraceStyle.NextLine;\n\n\t\t\tbaseOptions.CatchNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\tbaseOptions.ElseNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\tbaseOptions.ElseIfNewLinePlacement = NewLinePlacement.SameLine;\n\n\t\t\tbaseOptions.FinallyNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\tbaseOptions.WhileNewLinePlacement = NewLinePlacement.DoNotCare;\n\t\t\tbaseOptions.ArrayInitializerWrapping = Wrapping.DoNotChange;\n\t\t\tbaseOptions.IndentBlocksInsideExpressions = true;\n\n\t\t\treturn baseOptions;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The Whitesmiths style, also called Wishart style to a lesser extent, is less common today than the previous three. It was originally used in the documentation for the first commercial C compiler, the Whitesmiths Compiler.\n\t\t/// </summary>\n\t\tpublic static CSharpFormattingOptions CreateWhitesmiths()\n\t\t{\n\t\t\tvar baseOptions = CreateKRStyle();\n\t\t\t\t\n\t\t\tbaseOptions.NamespaceBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.ClassBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.InterfaceBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.StructBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.EnumBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.MethodBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.ConstructorBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.DestructorBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.AnonymousMethodBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.PropertyBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.PropertyGetBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.PropertySetBraceStyle = BraceStyle.NextLineShifted;\n\t\n\t\t\tbaseOptions.EventBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.EventAddBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.EventRemoveBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.StatementBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tbaseOptions.IndentBlocksInsideExpressions = true;\n\t\t\treturn baseOptions;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Like the Allman and Whitesmiths styles, GNU style puts braces on a line by themselves, indented by 2 spaces,\n\t\t/// except when opening a function definition, where they are not indented.\n\t\t/// In either case, the contained code is indented by 2 spaces from the braces.\n\t\t/// Popularised by Richard Stallman, the layout may be influenced by his background of writing Lisp code.\n\t\t/// In Lisp the equivalent to a block (a progn) \n\t\t/// is a first class data entity and giving it its own indent level helps to emphasize that,\n\t\t/// whereas in C a block is just syntax.\n\t\t/// Although not directly related to indentation, GNU coding style also includes a space before the bracketed \n\t\t/// list of arguments to a function.\n\t\t/// </summary>\n\t\tpublic static CSharpFormattingOptions CreateGNU()\n\t\t{\n\t\t\tvar baseOptions = CreateAllman();\n\t\t\tbaseOptions.StatementBraceStyle = BraceStyle.NextLineShifted2;\n\t\t\treturn baseOptions;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor.cs",
    "content": "﻿// \n// FormattingVisitor.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Text;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[Obsolete(\"This class was replaced by CSharpFormatter.\")]\n\tpublic class AstFormattingVisitor {}\n\n\tpartial class FormattingVisitor  \n\t{\n\t\treadonly CSharpFormatter formatter;\n\t\treadonly FormattingChanges changes;\n\t\treadonly IDocument document;\n\t\treadonly CancellationToken token;\n\n\t\tIndent curIndent;\n\n\t\tpublic bool HadErrors {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\n\t\tCSharpFormattingOptions policy {\n\t\t\tget {\n\t\t\t\treturn formatter.Policy;\n\t\t\t}\n\t\t}\n\n\t\tTextEditorOptions options {\n\t\t\tget {\n\t\t\t\treturn formatter.TextEditorOptions;\n\t\t\t}\n\t\t}\n\n\t\tFormattingChanges.TextReplaceAction AddChange(int offset, int removedChars, string insertedText)\n\t\t{\n\t\t\treturn changes.AddChange(offset, removedChars, insertedText);\n\t\t}\n\n\t\tpublic FormattingVisitor(CSharpFormatter formatter, IDocument document, FormattingChanges changes, CancellationToken token)\n\t\t{\n\t\t\tif (formatter == null)\n\t\t\t\tthrow new ArgumentNullException(\"formatter\");\n\t\t\tif (document == null)\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\tif (changes == null)\n\t\t\t\tthrow new ArgumentNullException(\"changes\");\n\t\t\n\t\t\tthis.formatter = formatter;\n\t\t\tthis.changes = changes;\n\t\t\tthis.document = document;\n\t\t\tthis.token = token;\n\n\t\t\tcurIndent = new Indent(formatter.TextEditorOptions);\n\t\t}\n\t\t\n\t\tvoid VisitChildrenToFormat (AstNode parent, Action<AstNode> callback)\n\t\t{\n\t\t\tAstNode next;\n\t\t\tfor (var child = parent.FirstChild; child != null; child = next) {\n\t\t\t\ttoken.ThrowIfCancellationRequested();\n\t\t\t\t// Store next to allow the loop to continue\n\t\t\t\t// if the visitor removes/replaces child.\n\t\t\t\tnext = child.GetNextSibling(NoWhitespacePredicate);\n\t\t\t\t\n\t\t\t\tif (formatter.FormattingRegions.Count > 0) {\n\t\t\t\t\tif (formatter.FormattingRegions.Any(r => r.IsInside(child.StartLocation) || r.IsInside(child.EndLocation))) {\n\t\t\t\t\t\tcallback(child);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar childRegion = child.Region;\n\t\t\t\t\t\tif (formatter.FormattingRegions.Any(r => childRegion.IsInside(r.Begin) || childRegion.IsInside(r.End)))\n\t\t\t\t\t\t    callback(child);\n\t\t\t\t\t}\n\t\t\t\t\tif (child.StartLocation > formatter.lastFormattingLocation)\n\t\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcallback(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected override void VisitChildren (AstNode node)\n\t\t{\n\t\t\tVisitChildrenToFormat (node, n => n.AcceptVisitor (this));\n\t\t}\n\n\t\t#region NewLines\n\n\t\tvoid AdjustNewLineBlock(AstNode startNode, int targetMinimumNewLineCount)\n\t\t{\n\t\t\tvar indentString = policy.EmptyLineFormatting == EmptyLineFormatting.Indent ? curIndent.IndentString : \"\";\n\n\t\t\tTextLocation newLineInsertPosition = startNode.EndLocation;\n\t\t\tvar node = startNode.NextSibling;\n\t\t\tint currentNewLineCount = 0;\n\t\t\t// Check the existing newlines\n\t\t\tfor (; currentNewLineCount < targetMinimumNewLineCount; node = node.NextSibling) {\n\t\t\t\tif (node is WhitespaceNode)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!(node is NewLineNode))\n\t\t\t\t\tbreak;\n\t\t\t\tnewLineInsertPosition = node.EndLocation;\n\t\t\t\tcurrentNewLineCount++;\n\t\t\t\tif (policy.EmptyLineFormatting == EmptyLineFormatting.DoNotChange) {\n\t\t\t\t\tif (node.NextSibling == null)\n\t\t\t\t\t\t// end of file/block etc, nothing more to do but break before assigning null to node\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar isBlankLine = IsSpacing(document.GetLineByNumber(node.StartLocation.Line));\n\t\t\t\tif (!isBlankLine) {\n\t\t\t\t\t// remove EOL whitespace if appropriate\n\t\t\t\t\tif (policy.RemoveEndOfLineWhiteSpace) {\n\t\t\t\t\t\tvar offset = document.GetOffset(node.StartLocation);\n\t\t\t\t\t\tvar start = SearchWhitespaceStart(offset);\n\t\t\t\t\t\tif (start != offset)\n\t\t\t\t\t\t\tAddChange(start, offset - start, null);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar actualIndent = GetIndentation(node.StartLocation.Line);\n\t\t\t\t\tif (actualIndent != indentString) {\n\t\t\t\t\t\tvar start = document.GetOffset(new TextLocation(node.StartLocation.Line, 0));\n\t\t\t\t\t\tAddChange(start, actualIndent.Length, indentString);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (node.NextSibling == null)\n\t\t\t\t\t// end of file/block etc, nothing more to do but break before assigning null to node\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (currentNewLineCount < targetMinimumNewLineCount) {\n\t\t\t\t// We need to add more newlines\n\t\t\t\tvar builder = new StringBuilder();\n\t\t\t\tfor (; currentNewLineCount < targetMinimumNewLineCount; currentNewLineCount++) {\n\t\t\t\t\tif (currentNewLineCount > 0)\n\t\t\t\t\t\t// Don't indent the first line in the block since that is not an empty line.\n\t\t\t\t\t\tbuilder.Append(indentString);\n\t\t\t\t\tbuilder.Append(options.EolMarker);\n\t\t\t\t}\n\t\t\t\tvar offset = document.GetOffset(newLineInsertPosition);\n\t\t\t\tif (offset >= 0)\n\t\t\t\t\tAddChange(offset, 0, builder.ToString());\n\t\t\t} else if (currentNewLineCount == targetMinimumNewLineCount && node is NewLineNode){\n//\t\t\t\t// Check to see if there are any newlines to remove\n//\t\t\t\tvar endNode = node.GetNextSibling(n => !(n is NewLineNode || n is WhitespaceNode));\n//\t\t\t\tif (endNode != null) {\n//\t\t\t\t\tvar startOffset = document.GetOffset(newLineInsertPosition);\n//\t\t\t\t\tvar endOffset = document.GetOffset(new TextLocation(endNode.StartLocation.Line, 0));\n//\t\t\t\t\tEnsureText(startOffset, endOffset, null);\n//\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void EnsureMinimumNewLinesAfter(AstNode node, int blankLines)\n\t\t{\n\t\t\tif (node is PreProcessorDirective) {\n\t\t\t\tvar directive = (PreProcessorDirective)node;\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Pragma)\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (blankLines < 0)\n\t\t\t\treturn;\n\t\t\tif (formatter.FormattingMode != FormattingMode.Intrusive)\n\t\t\t\tblankLines = Math.Min(1, blankLines);\n\t\t\tAdjustNewLineBlock(node, blankLines);\n\t\t}\n\t\t\n\t\tpublic void EnsureMinimumBlankLinesBefore(AstNode node, int blankLines)\n\t\t{\n\t\t\tif (formatter.FormattingMode != FormattingMode.Intrusive)\n\t\t\t\treturn;\n\t\t\tvar loc = node.StartLocation;\n\t\t\tint line = loc.Line;\n\t\t\tdo {\n\t\t\t\tline--;\n\t\t\t} while (line > 0 && IsSpacing(document.GetLineByNumber(line)));\n\t\t\tif (line > 0 && !IsSpacing(document.GetLineByNumber(line)))\n\t\t\t    line++;\n\n\t\t\tif (loc.Line - line >= blankLines)\n\t\t\t\treturn;\n\n\t\t\tvar sb = new StringBuilder ();\n\t\t\tfor (int i = 0; i < blankLines; i++)\n\t\t\t\tsb.Append(options.EolMarker);\n\t\t\tint end = document.GetOffset(loc.Line, 1);\n\t\t\tif (loc.Line == line) {\n\t\t\t\tAddChange(end, 0, sb.ToString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (line + 1 > document.LineCount)\n\t\t\t\treturn;\n\t\t\tint start = document.GetOffset(line + 1, 1);\n\t\t\tif (end - start <= 0 && sb.Length == 0)\n\t\t\t\treturn;\n\t\t\tAddChange(start, end - start, sb.ToString());\n\t\t}\n\n\t\t#endregion\n\n\t\tbool IsSimpleAccessor(Accessor accessor)\n\t\t{\n\t\t\tif (accessor.IsNull || accessor.Body.IsNull || accessor.Body.FirstChild == null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tvar firstStatement = accessor.Body.Statements.FirstOrDefault();\n\t\t\tif (firstStatement == null)\n\t\t\t\treturn true;\n\n\t\t\tif (!(firstStatement is ReturnStatement || firstStatement is ExpressionStatement|| firstStatement is EmptyStatement || firstStatement is ThrowStatement))\n\t\t\t\treturn false;\n\n\t\t\tif (firstStatement.GetNextSibling(s => s.Role == BlockStatement.StatementRole) != null)\n\t\t\t\treturn false;\n\n\t\t\treturn !(accessor.Body.Statements.FirstOrDefault() is BlockStatement);\n\t\t}\n\t\t\n\t\tstatic bool IsSpacing(char ch)\n\t\t{\n\t\t\treturn ch == ' ' || ch == '\\t';\n\t\t}\n\t\t\n\t\tbool IsSpacing(ISegment segment)\n\t\t{\n\t\t\tint endOffset = segment.EndOffset;\n\t\t\tfor (int i = segment.Offset; i < endOffset; i++) {\n\t\t\t\tif (!IsSpacing(document.GetCharAt(i))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tint SearchLastNonWsChar(int startOffset, int endOffset)\n\t\t{\n\t\t\tstartOffset = Math.Max(0, startOffset);\n\t\t\tendOffset = Math.Max(startOffset, endOffset);\n\t\t\tif (startOffset >= endOffset) {\n\t\t\t\treturn startOffset;\n\t\t\t}\n\t\t\tint result = -1;\n\t\t\tbool inComment = false;\n\t\t\t\n\t\t\tfor (int i = startOffset; i < endOffset && i < document.TextLength; i++) {\n\t\t\t\tchar ch = document.GetCharAt(i);\n\t\t\t\tif (IsSpacing(ch)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (ch == '/' && i + 1 < document.TextLength && document.GetCharAt(i + 1) == '/') {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tif (ch == '/' && i + 1 < document.TextLength && document.GetCharAt(i + 1) == '*') {\n\t\t\t\t\tinComment = true;\n\t\t\t\t\ti++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (inComment && ch == '*' && i + 1 < document.TextLength && document.GetCharAt(i + 1) == '/') {\n\t\t\t\t\tinComment = false;\n\t\t\t\t\ti++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!inComment) {\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tvoid ForceSpace(int startOffset, int endOffset, bool forceSpace)\n\t\t{\n\t\t\tint lastNonWs = SearchLastNonWsChar(startOffset, endOffset);\n\t\t\tif (lastNonWs < 0)\n\t\t\t\treturn;\n\n\t\t\tvar spaceCount = Math.Max(0, endOffset - lastNonWs - 1);\n\t\t\tif (forceSpace) {\n\t\t\t\tif (spaceCount != 1) {\n\t\t\t\t\t// Here we could technically remove spaceCount - 1 chars instead\n\t\t\t\t\t// and skip replacing that with new space, but we want to trigger the\n\t\t\t\t\t// overlap detection if this space is changed again for some reason\n\t\t\t\t\tAddChange(lastNonWs + 1, spaceCount, \" \");\n\t\t\t\t}\n\t\t\t} else if (spaceCount > 0 && !forceSpace) {\n\t\t\t\tAddChange(lastNonWs + 1, spaceCount, \"\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid ForceSpacesAfter(AstNode n, bool forceSpaces)\n\t\t{\n\t\t\tif (n == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tTextLocation location = n.EndLocation;\n\t\t\tint offset = document.GetOffset(location);\n\t\t\tif (location.Column > document.GetLineByNumber(location.Line).Length) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tint i = offset;\n\t\t\twhile (i < document.TextLength && IsSpacing (document.GetCharAt (i))) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tForceSpace(offset - 1, i, forceSpaces);\n\t\t}\n\n\t\tint ForceSpacesBefore(AstNode n, bool forceSpaces)\n\t\t{\n\t\t\tif (n == null || n.IsNull) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tTextLocation location = n.StartLocation;\n\t\t\t// respect manual line breaks.\n\t\t\tif (location.Column <= 1 || GetIndentation(location.Line).Length == location.Column - 1) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t\tint offset = document.GetOffset(location);\n\t\t\tint i = offset - 1;\n\t\t\twhile (i >= 0 && IsSpacing (document.GetCharAt (i))) {\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tForceSpace(i, offset, forceSpaces);\n\t\t\treturn i;\n\t\t}\n\t\t\n\t\tint ForceSpacesBeforeRemoveNewLines(AstNode n, bool forceSpace = true)\n\t\t{\n\t\t\tif (n == null || n.IsNull) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tint offset = document.GetOffset(n.StartLocation);\n\t\t\tint i = offset - 1;\n\t\t\twhile (i >= 0) {\n\t\t\t\tchar ch = document.GetCharAt(i);\n\t\t\t\tif (!IsSpacing(ch) && ch != '\\r' && ch != '\\n')\n\t\t\t\t\tbreak;\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tvar length = Math.Max(0, (offset - 1) - i);\n\t\t\tAddChange(i + 1, length, forceSpace ? \" \" : \"\");\n\t\t\treturn i;\n\t\t}\n\n\t\tinternal static bool NoWhitespacePredicate(AstNode arg)\n\t\t{\n\t\t\treturn !(arg is NewLineNode || arg is WhitespaceNode);\n\t\t}\n\n\t\tstatic bool IsMember(AstNode nextSibling)\n\t\t{\n\t\t\treturn nextSibling != null && nextSibling.NodeType == NodeType.Member;\n\t\t}\n\n\t\tstatic bool ShouldBreakLine(NewLinePlacement placement, CSharpTokenNode token)\n\t\t{\n\t\t\tif (placement == NewLinePlacement.NewLine)\n\t\t\t\treturn true;\n\t\t\tif (placement == NewLinePlacement.SameLine)\n\t\t\t\treturn false;\n\t\t\tif (token.IsNull)\n\t\t\t\treturn false;\n\t\t\tvar prevMeaningfulNode = token.GetPrevNode (n =>n.Role !=Roles.NewLine && n.Role != Roles.Whitespace && n.Role !=Roles.Comment);\n\t\t\treturn prevMeaningfulNode.EndLocation.Line != token.StartLocation.Line;\n\t\t}\n\n\t\tvoid ForceSpaceBefore(AstNode node, bool forceSpace)\n\t\t{\n\t\t\tvar offset = document.GetOffset(node.StartLocation);\n\t\t\tint end = offset;\n\t\t\t// ForceSpace inserts a space one char after start in the case of a missing space\n\t\t\t// Therefore, make sure that start < offset by starting at offset - 1\n\t\t\tint start = SearchWhitespaceStart(offset - 1);\n\t\t\tForceSpace(start, end, forceSpace);\n\t\t}\n\n\t\tpublic void FixSemicolon(CSharpTokenNode semicolon)\n\t\t{\n\t\t\tif (semicolon.IsNull)\n\t\t\t\treturn;\n\t\t\tint endOffset = document.GetOffset(semicolon.StartLocation);\n\t\t\tint offset = endOffset;\n\t\t\twhile (offset - 1 > 0 && char.IsWhiteSpace (document.GetCharAt (offset - 1))) {\n\t\t\t\toffset--;\n\t\t\t}\n\t\t\tif (policy.SpaceBeforeSemicolon) {\n\t\t\t\tAddChange(offset, endOffset - offset, \" \");\n\t\t\t} else {\n\t\t\t\tif (offset < endOffset)\n\t\t\t\t\tAddChange(offset, endOffset - offset, null);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid PlaceOnNewLine(NewLinePlacement newLine, AstNode keywordNode)\n\t\t{\n\t\t\tif (keywordNode == null || keywordNode.StartLocation.IsEmpty)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tvar prev = keywordNode.GetPrevNode (NoWhitespacePredicate);\n\t\t\tif (prev is Comment || prev is PreProcessorDirective)\n\t\t\t\treturn;\n\n\t\t\tif (newLine == NewLinePlacement.DoNotCare)\n\t\t\t\tnewLine = prev.EndLocation.Line == keywordNode.StartLocation.Line ? NewLinePlacement.SameLine : NewLinePlacement.NewLine;\n\n\t\t\tint offset = document.GetOffset(keywordNode.StartLocation);\n\t\t\t\n\t\t\tint whitespaceStart = SearchWhitespaceStart(offset);\n\t\t\tstring indentString = newLine == NewLinePlacement.NewLine ? options.EolMarker + curIndent.IndentString : \" \";\n\t\t\tAddChange(whitespaceStart, offset - whitespaceStart, indentString);\n\t\t}\n\t\t\n\t\tstring nextStatementIndent;\n\t\t\n\t\tvoid FixStatementIndentation(TextLocation location)\n\t\t{\n\t\t\tif (location.Line < 1 || location.Column < 1) {\n\t\t\t\tConsole.WriteLine(\"invalid location!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tint offset = document.GetOffset(location);\n\t\t\tif (offset <= 0) {\n\t\t\t\tConsole.WriteLine(\"possible wrong offset\");\n\t\t\t\tConsole.WriteLine(Environment.StackTrace);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbool isEmpty = IsLineIsEmptyUpToEol(offset);\n\t\t\tint lineStart = SearchWhitespaceLineStart(offset);\n\t\t\tstring indentString = nextStatementIndent ?? (isEmpty ? \"\" : options.EolMarker) + curIndent.IndentString;\n\t\t\tnextStatementIndent = null;\n\t\t\tEnsureText(lineStart, offset, indentString);\n\t\t}\n\n\t\tvoid FixIndentation (AstNode node)\n\t\t{\n\t\t\tFixIndentation(node.StartLocation, 0);\n\t\t}\n\t\t\n\t\tvoid FixIndentation(TextLocation location, int relOffset)\n\t\t{\n\t\t\tif (location.Line < 1 || location.Line > document.LineCount) {\n\t\t\t\tConsole.WriteLine(\"Invalid location \" + location);\n\t\t\t\tConsole.WriteLine(Environment.StackTrace);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tstring lineIndent = GetIndentation(location.Line);\n\t\t\tstring indentString = curIndent.IndentString;\n\t\t\tif (indentString != lineIndent && location.Column - 1 + relOffset == lineIndent.Length) {\n\t\t\t\tAddChange(document.GetOffset(location.Line, 1), lineIndent.Length, indentString);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid FixIndentationForceNewLine(AstNode node)\n\t\t{\n\t\t\tvar directive = node as PreProcessorDirective;\n\t\t\tif (node.GetPrevNode () is NewLineNode) {\n\t\t\t\tif (directive != null && !policy.IndentPreprocessorDirectives) {\n\t\t\t\t\tvar startNode = node.GetPrevNode ();\n\t\t\t\t\tvar startOffset = document.GetOffset(startNode.EndLocation);\n\t\t\t\t\tint endOffset = document.GetOffset(node.StartLocation);\n\t\t\t\t\tAddChange(startOffset, endOffset - startOffset, \"\");\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tFixIndentation(node);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// if no new line preceeds an #endif directive it's excluded\n\t\t\t\tif (directive != null) {\n\t\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Endif)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar startNode = node.GetPrevSibling(n => !(n is WhitespaceNode)) ?? node;\n\t\t\t\tvar startOffset = document.GetOffset(startNode.EndLocation);\n\t\t\t\tint endOffset = document.GetOffset(node.StartLocation);\n\t\t\t\tif (startOffset >= endOffset)\n\t\t\t\t\treturn;\n\t\t\t\tif (directive != null && !policy.IndentPreprocessorDirectives) {\n\t\t\t\t\tAddChange(startOffset, endOffset - startOffset, \"\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tAddChange(startOffset, endOffset - startOffset, curIndent.IndentString);\n\t\t\t}\n\t\t}\n\n\t\tstring GetIndentation(int lineNumber)\n\t\t{\n\t\t\tvar line = document.GetLineByNumber(lineNumber);\n\t\t\tvar b = new StringBuilder ();\n\t\t\tint endOffset = line.EndOffset;\n\t\t\tfor (int i = line.Offset; i < endOffset; i++) {\n\t\t\t\tchar c = document.GetCharAt(i);\n\t\t\t\tif (!IsSpacing(c)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tb.Append(c);\n\t\t\t}\n\t\t\treturn b.ToString();\n\t\t}\n\n\t\tvoid EnsureText(int start, int end, string replacementText)\n\t\t{\n\t\t\tvar length = end - start;\n\t\t\tif (length == 0 && string.IsNullOrEmpty(replacementText))\n\t\t\t\treturn;\n\t\t\tif (replacementText == null || replacementText.Length != length) {\n\t\t\t\tAddChange(start, length, replacementText);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\tif (document.GetCharAt(start + i) != replacementText[i]) {\n\t\t\t\t\tAddChange(start, length, replacementText);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid FixOpenBrace(BraceStyle braceStyle, AstNode lbrace)\n\t\t{\n\t\t\tif (lbrace.IsNull)\n\t\t\t\treturn;\n\t\t\tswitch (braceStyle) {\n\t\t\t\tcase BraceStyle.DoNotChange:\n\t\t\t\t\treturn;\n\n\t\t\t\tcase BraceStyle.BannerStyle:\n\t\t\t\tcase BraceStyle.EndOfLine:\n\t\t\t\t\tvar prev = lbrace.GetPrevNode (NoWhitespacePredicate);\n\t\t\t\t\tif (prev is PreProcessorDirective)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tint prevOffset = document.GetOffset(prev.EndLocation);\n\n\t\t\t\t\tif (prev is Comment || prev is PreProcessorDirective) {\n\t\t\t\t\t\tint next = document.GetOffset(lbrace.GetNextNode ().StartLocation);\n\t\t\t\t\t\tEnsureText(prevOffset, next, \"\");\n\t\t\t\t\t\twhile (prev is Comment || prev is PreProcessorDirective)\n\t\t\t\t\t\t\tprev = prev.GetPrevNode();\n\t\t\t\t\t\tprevOffset = document.GetOffset(prev.EndLocation);\n\t\t\t\t\t\tAddChange(prevOffset, 0, \" {\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint braceOffset2 = document.GetOffset(lbrace.StartLocation);\n\t\t\t\t\t\tEnsureText(prevOffset, braceOffset2, \" \");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.EndOfLineWithoutSpace:\n\t\t\t\t\tprev = lbrace.GetPrevNode (NoWhitespacePredicate);\n\t\t\t\t\tif (prev is PreProcessorDirective)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tprevOffset = document.GetOffset(prev.EndLocation);\n\t\t\t\t\tint braceOffset = document.GetOffset(lbrace.StartLocation);\n\t\t\t\t\tEnsureText(prevOffset, braceOffset, \"\");\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase BraceStyle.NextLine:\n\t\t\t\t\tprev = lbrace.GetPrevNode (NoWhitespacePredicate);\n\t\t\t\t\tif (prev is PreProcessorDirective)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tprevOffset = document.GetOffset(prev.EndLocation);\n\t\t\t\t\tbraceOffset = document.GetOffset(lbrace.StartLocation);\n\t\t\t\t\tEnsureText(prevOffset, braceOffset, options.EolMarker + curIndent.IndentString);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted:\n\t\t\t\t\tprev = lbrace.GetPrevNode (NoWhitespacePredicate);\n\t\t\t\t\tif (prev is PreProcessorDirective)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tprevOffset = document.GetOffset(prev.EndLocation);\n\t\t\t\t\tbraceOffset = document.GetOffset(lbrace.StartLocation);\n\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\tEnsureText(prevOffset, braceOffset, options.EolMarker + curIndent.IndentString);\n\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted2:\n\t\t\t\t\tprev = lbrace.GetPrevNode (NoWhitespacePredicate);\n\t\t\t\t\tif (prev is PreProcessorDirective)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tprevOffset = document.GetOffset(prev.EndLocation);\n\t\t\t\t\tbraceOffset = document.GetOffset(lbrace.StartLocation);\n\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\tEnsureText(prevOffset, braceOffset, options.EolMarker + curIndent.IndentString);\n\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvoid CorrectClosingBrace (AstNode rbrace)\n\t\t{\n\t\t\tif (rbrace.IsNull)\n\t\t\t\treturn;\n\t\t\tint braceOffset = document.GetOffset(rbrace.StartLocation);\n\t\t\tvar prevNode = rbrace.GetPrevNode();\n\t\t\tint prevNodeOffset = prevNode != null ? document.GetOffset(prevNode.EndLocation) : 0;\n\t\t\tif (prevNode is NewLineNode) {\n\t\t\t\tEnsureText(prevNodeOffset, braceOffset, curIndent.IndentString);\n\t\t\t} else {\n\t\t\t\tEnsureText(prevNodeOffset, braceOffset, options.EolMarker + curIndent.IndentString);\n\t\t\t}\n\t\t}\n\n\t\tvoid FixClosingBrace(BraceStyle braceStyle, AstNode rbrace)\n\t\t{\n\t\t\tif (rbrace.IsNull)\n\t\t\t\treturn;\n\t\t\tswitch (braceStyle) {\n\t\t\t\tcase BraceStyle.DoNotChange:\n\t\t\t\t\treturn;\n\n\t\t\t\tcase BraceStyle.NextLineShifted:\n\t\t\t\tcase BraceStyle.BannerStyle:\n\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\tCorrectClosingBrace (rbrace);\n\t\t\t\t\tcurIndent.Pop ();\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.EndOfLineWithoutSpace:\n\t\t\t\tcase BraceStyle.EndOfLine:\n\t\t\t\tcase BraceStyle.NextLine:\n\t\t\t\t\tCorrectClosingBrace (rbrace);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase BraceStyle.NextLineShifted2:\n\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\tCorrectClosingBrace (rbrace);\n\t\t\t\t\tcurIndent.Pop ();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Expressions.cs",
    "content": "//\n// AstFormattingVisitor_Expressions.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpartial class FormattingVisitor : DepthFirstAstVisitor\n\t{\n\t\tpublic override void VisitComposedType(ComposedType composedType)\n\t\t{\n\t\t\tvar spec = composedType.ArraySpecifiers.FirstOrDefault();\n\t\t\tif (spec != null)\n\t\t\t\tForceSpacesBefore(spec.LBracketToken, policy.SpaceBeforeArrayDeclarationBrackets);\n\n\t\t\tif (composedType.HasNullableSpecifier)\n\t\t\t\tForceSpacesBefore(composedType.NullableSpecifierToken, false);\n\n\t\t\tif (composedType.PointerRank > 0)\n\t\t\t\tforeach (var token in composedType.PointerTokens)\n\t\t\t\t\tForceSpacesBefore(token, false);\n\n\t\t\tbase.VisitComposedType(composedType);\n\t\t}\n\n\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression lambdaExpression)\n\t\t{\n\t\t\tFormatArguments(lambdaExpression);\n\n\t\t\tif (!lambdaExpression.Body.IsNull) {\n\t\t\t\tvar old = curIndent;\n\t\t\t\tthis.curIndent = curIndent.GetIndentWithoutSpace ();\n\t\t\t\tFixOpenBrace(policy.AnonymousMethodBraceStyle, lambdaExpression.Body.LBraceToken);\n\t\t\t\tVisitBlockWithoutFixingBraces(lambdaExpression.Body, policy.IndentBlocks);\n\t\t\t\tFixClosingBrace(policy.AnonymousMethodBraceStyle, lambdaExpression.Body.RBraceToken);\n\t\t\t\tcurIndent = old;\n\t\t\t}\n\n\t\t}\n\n\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\tForceSpacesAround(assignmentExpression.OperatorToken, policy.SpaceAroundAssignment);\n\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t}\n\n\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\tbool forceSpaces = false;\n\t\t\tswitch (binaryOperatorExpression.Operator) {\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundEqualityOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundRelationalOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundLogicalOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundBitwiseOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundAdditiveOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundMultiplicativeOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundShiftOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.NullCoalescing:\n\t\t\t\t\tforceSpaces = policy.SpaceAroundNullCoalescingOperator;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar opToken = binaryOperatorExpression.OperatorToken;\n\t\t\tif (opToken.PrevSibling != null && opToken.PrevSibling.Role != Roles.NewLine) {\n\t\t\t\tForceSpacesBefore(opToken, forceSpaces);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(binaryOperatorExpression.Left, false);\n\t\t\t\tFixIndentation(opToken);\n\t\t\t}\n\t\t\tForceSpacesAfter(opToken, opToken.NextSibling != null && opToken.NextSibling.Role != Roles.NewLine && forceSpaces);\n\n\t\t\tbinaryOperatorExpression.Left.AcceptVisitor(this);\n\t\t\t// Handle line breaks in binary opeartor expression.\n\t\t\tif (binaryOperatorExpression.Left.EndLocation.Line != binaryOperatorExpression.Right.StartLocation.Line) {\n\t\t\t\tif (opToken.StartLocation.Line == binaryOperatorExpression.Right.StartLocation.Line) {\n\t\t\t\t\tFixStatementIndentation(opToken.StartLocation);\n\t\t\t\t} else {\n\t\t\t\t\tFixStatementIndentation(binaryOperatorExpression.Right.StartLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbinaryOperatorExpression.Right.AcceptVisitor(this);\n\t\t}\n\n\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\tForceSpacesBefore(conditionalExpression.QuestionMarkToken, policy.SpaceBeforeConditionalOperatorCondition);\n\t\t\tForceSpacesAfter(conditionalExpression.QuestionMarkToken, policy.SpaceAfterConditionalOperatorCondition);\n\t\t\tForceSpacesBefore(conditionalExpression.ColonToken, policy.SpaceBeforeConditionalOperatorSeparator);\n\t\t\tForceSpacesAfter(conditionalExpression.ColonToken, policy.SpaceAfterConditionalOperatorSeparator);\n\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\t\t}\n\n\t\tpublic override void VisitCastExpression(CastExpression castExpression)\n\t\t{\n\t\t\tif (castExpression.RParToken != null) {\n\t\t\t\tForceSpacesAfter(castExpression.LParToken, policy.SpacesWithinCastParentheses);\n\t\t\t\tForceSpacesBefore(castExpression.RParToken, policy.SpacesWithinCastParentheses);\n\n\t\t\t\tForceSpacesAfter(castExpression.RParToken, policy.SpaceAfterTypecast);\n\t\t\t}\n\t\t\tbase.VisitCastExpression(castExpression);\n\t\t}\n\n\t\tvoid ForceSpacesAround(AstNode node, bool forceSpaces)\n\t\t{\n\t\t\tif (node.IsNull)\n\t\t\t\treturn;\n\t\t\tForceSpacesBefore(node, forceSpaces);\n\t\t\tForceSpacesAfter(node, forceSpaces);\n\t\t}\n\n\t\tvoid FormatCommas(AstNode parent, bool before, bool after)\n\t\t{\n\t\t\tif (parent.IsNull) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tforeach (CSharpTokenNode comma in parent.Children.Where (node => node.Role == Roles.Comma)) {\n\t\t\t\tForceSpacesAfter(comma, after);\n\t\t\t\tForceSpacesBefore(comma, before);\n\t\t\t}\n\t\t}\n\n\t\tbool DoWrap(Wrapping wrapping, AstNode wrapNode, int argumentCount)\n\t\t{\n\t\t\treturn wrapping == Wrapping.WrapAlways || \n\t\t\t\toptions.WrapLineLength > 0 && argumentCount > 1 && wrapping == Wrapping.WrapIfTooLong && wrapNode.StartLocation.Column >= options.WrapLineLength;\n\t\t}\n\n\t\tvoid FormatArguments(AstNode node)\n\t\t{\n\t\t\tWrapping methodCallArgumentWrapping;\n\t\t\tNewLinePlacement newLineAferMethodCallOpenParentheses;\n\t\t\tbool doAlignToFirstArgument;\n\t\t\tNewLinePlacement methodClosingParenthesesOnNewLine;\n\t\t\tbool spaceWithinMethodCallParentheses;\n\t\t\tbool spaceWithinEmptyParentheses;\n\t\t\tbool spaceAfterMethodCallParameterComma;\n\t\t\tbool spaceBeforeMethodCallParameterComma;\n\n\t\t\tCSharpTokenNode rParToken, lParToken;\n\t\t\tList<AstNode> arguments;\n\n\t\t\tvar constructorDeclaration = node as ConstructorDeclaration;\n\t\t\tif (constructorDeclaration != null) {\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodDeclarationParameterWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodDeclarationOpenParentheses;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodDeclarationClosingParenthesesOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodDeclarationParameter;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinConstructorDeclarationParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterConstructorDeclarationParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeConstructorDeclarationParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodDeclarationParentheses;\n\t\t\t\tlParToken = constructorDeclaration.LParToken;\n\t\t\t\trParToken = constructorDeclaration.RParToken;\n\t\t\t\targuments = constructorDeclaration.Parameters.Cast<AstNode>().ToList();\n\t\t\t} else if (node is IndexerDeclaration) {\n\t\t\t\tvar indexer = (IndexerDeclaration)node;\n\t\t\t\tmethodCallArgumentWrapping = policy.IndexerDeclarationParameterWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferIndexerDeclarationOpenBracket;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.IndexerDeclarationClosingBracketOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstIndexerDeclarationParameter;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinIndexerDeclarationBracket;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterIndexerDeclarationParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeIndexerDeclarationParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodDeclarationParentheses;\n\t\t\t\tlParToken = indexer.LBracketToken;\n\t\t\t\trParToken = indexer.RBracketToken;\n\t\t\t\targuments = indexer.Parameters.Cast<AstNode>().ToList();\n\t\t\t} else if (node is OperatorDeclaration) {\n\t\t\t\tvar op = (OperatorDeclaration)node;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodDeclarationParameterWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodDeclarationOpenParentheses;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodDeclarationClosingParenthesesOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodDeclarationParameter;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinMethodDeclarationParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterMethodDeclarationParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeMethodDeclarationParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodDeclarationParentheses;\n\t\t\t\tlParToken = op.LParToken;\n\t\t\t\trParToken = op.RParToken;\n\t\t\t\targuments = op.Parameters.Cast<AstNode>().ToList();\n\t\t\t} else if (node is MethodDeclaration) {\n\t\t\t\tvar methodDeclaration = node as MethodDeclaration;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodDeclarationParameterWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodDeclarationOpenParentheses;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodDeclarationClosingParenthesesOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodDeclarationParameter;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinMethodDeclarationParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterMethodDeclarationParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeMethodDeclarationParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodDeclarationParentheses;\n\t\t\t\tlParToken = methodDeclaration.LParToken;\n\t\t\t\trParToken = methodDeclaration.RParToken;\n\t\t\t\targuments = methodDeclaration.Parameters.Cast<AstNode>().ToList();\n\t\t\t} else if (node is IndexerExpression) {\n\t\t\t\tvar indexer = (IndexerExpression)node;\n\t\t\t\tmethodCallArgumentWrapping = policy.IndexerArgumentWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferIndexerOpenBracket;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstIndexerArgument;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.IndexerClosingBracketOnNewLine;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpacesWithinBrackets;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterBracketComma;\n\t\t\t\tspaceWithinEmptyParentheses = spaceWithinMethodCallParentheses;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeBracketComma;\n\t\t\t\trParToken = indexer.RBracketToken;\n\t\t\t\tlParToken = indexer.LBracketToken;\n\t\t\t\targuments = indexer.Arguments.Cast<AstNode>().ToList();\n\t\t\t} else if (node is ObjectCreateExpression) {\n\t\t\t\tvar oce = node as ObjectCreateExpression;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodCallArgumentWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodCallOpenParentheses;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodCallArgument;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodCallClosingParenthesesOnNewLine;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpacesWithinNewParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterNewParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeNewParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpacesBetweenEmptyNewParentheses;\n\n\t\t\t\trParToken = oce.RParToken;\n\t\t\t\tlParToken = oce.LParToken;\n\t\t\t\targuments = oce.Arguments.Cast<AstNode>().ToList();\n\t\t\t} else if (node is Attribute) {\n\t\t\t\tvar oce = node as Attribute;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodCallArgumentWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodCallOpenParentheses;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodCallArgument;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodCallClosingParenthesesOnNewLine;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpacesWithinNewParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterNewParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeNewParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpacesBetweenEmptyNewParentheses;\n\n\t\t\t\trParToken = oce.RParToken;\n\t\t\t\tlParToken = oce.LParToken;\n\t\t\t\targuments = oce.Arguments.Cast<AstNode>().ToList();\n\t\t\t} else if (node is LambdaExpression) {\n\t\t\t\tvar methodDeclaration = node as LambdaExpression;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodDeclarationParameterWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodDeclarationOpenParentheses;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodDeclarationClosingParenthesesOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodDeclarationParameter;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinMethodDeclarationParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterMethodDeclarationParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeMethodDeclarationParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodDeclarationParentheses;\n\t\t\t\tlParToken = methodDeclaration.LParToken;\n\t\t\t\trParToken = methodDeclaration.RParToken;\n\t\t\t\targuments = methodDeclaration.Parameters.Cast<AstNode>().ToList();\n\t\t\t} else if (node is AnonymousMethodExpression) {\n\t\t\t\tvar methodDeclaration = node as AnonymousMethodExpression;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodDeclarationParameterWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodDeclarationOpenParentheses;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodDeclarationClosingParenthesesOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodDeclarationParameter;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinMethodDeclarationParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterMethodDeclarationParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeMethodDeclarationParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodDeclarationParentheses;\n\t\t\t\tlParToken = methodDeclaration.LParToken;\n\t\t\t\trParToken = methodDeclaration.RParToken;\n\t\t\t\targuments = methodDeclaration.Parameters.Cast<AstNode>().ToList();\n\t\t\t}  else if (node is ConstructorInitializer) {\n\t\t\t\tvar constructorInitializer = node as ConstructorInitializer;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodDeclarationParameterWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodDeclarationOpenParentheses;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodDeclarationClosingParenthesesOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodDeclarationParameter;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinMethodDeclarationParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterMethodDeclarationParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeMethodDeclarationParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodDeclarationParentheses;\n\t\t\t\tlParToken = constructorInitializer.LParToken;\n\t\t\t\trParToken = constructorInitializer.RParToken;\n\t\t\t\targuments = constructorInitializer.Arguments.Cast<AstNode>().ToList();\n\t\t\t} else {\n\t\t\t\tInvocationExpression invocationExpression = node as InvocationExpression;\n\t\t\t\tmethodCallArgumentWrapping = policy.MethodCallArgumentWrapping;\n\t\t\t\tnewLineAferMethodCallOpenParentheses = policy.NewLineAferMethodCallOpenParentheses;\n\t\t\t\tmethodClosingParenthesesOnNewLine = policy.MethodCallClosingParenthesesOnNewLine;\n\t\t\t\tdoAlignToFirstArgument = policy.AlignToFirstMethodCallArgument;\n\t\t\t\tspaceWithinMethodCallParentheses = policy.SpaceWithinMethodCallParentheses;\n\t\t\t\tspaceAfterMethodCallParameterComma = policy.SpaceAfterMethodCallParameterComma;\n\t\t\t\tspaceBeforeMethodCallParameterComma = policy.SpaceBeforeMethodCallParameterComma;\n\t\t\t\tspaceWithinEmptyParentheses = policy.SpaceBetweenEmptyMethodCallParentheses;\n\n\t\t\t\trParToken = invocationExpression.RParToken;\n\t\t\t\tlParToken = invocationExpression.LParToken;\n\t\t\t\targuments = invocationExpression.Arguments.Cast<AstNode>().ToList();\n\t\t\t}\n\n\t\t\tif (formatter.FormattingMode == ICSharpCode.NRefactory.CSharp.FormattingMode.OnTheFly)\n\t\t\t\tmethodCallArgumentWrapping = Wrapping.DoNotChange;\n\t\t\tint argumentStart = 1;\n\t\t\tvar firstarg = arguments.FirstOrDefault();\n\t\t\tif (firstarg != null && firstarg.GetPrevNode().Role == Roles.NewLine) {\n\t\t\t\tdoAlignToFirstArgument = false;\n\t\t\t\targumentStart = 0;\n\t\t\t}\n\t\t\tbool wrapMethodCall = DoWrap(methodCallArgumentWrapping, rParToken, arguments.Count);\n\t\t\tif (wrapMethodCall && arguments.Any()) {\n\t\t\t\tif (ShouldBreakLine(newLineAferMethodCallOpenParentheses, lParToken)) {\n\t\t\t\t\tcurIndent.Push(IndentType.Continuation);\n\t\t\t\t\tforeach (var arg in arguments) {\n\t\t\t\t\t\tFixStatementIndentation(arg.StartLocation);\n\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t} else {\n\t\t\t\t\tif (!doAlignToFirstArgument) {\n\t\t\t\t\t\tcurIndent.Push(IndentType.Continuation);\n\t\t\t\t\t\tforeach (var arg in arguments.Take (argumentStart)) {\n\t\t\t\t\t\t\tFixStatementIndentation(arg.StartLocation);\n\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach (var arg in arguments.Skip (argumentStart)) {\n\t\t\t\t\t\t\tFixStatementIndentation(arg.StartLocation);\n\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint extraSpaces = Math.Max(0, arguments.First().StartLocation.Column - 1 - curIndent.IndentString.Length);\n\t\t\t\t\t\tcurIndent.ExtraSpaces += extraSpaces;\n\t\t\t\t\t\tforeach (var arg in arguments.Take (argumentStart)) {\n\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach (var arg in arguments.Skip(argumentStart)) {\n\t\t\t\t\t\t\tFixStatementIndentation(arg.StartLocation);\n\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurIndent.ExtraSpaces -= extraSpaces;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!rParToken.IsNull) {\n\t\t\t\t\tif (ShouldBreakLine(methodClosingParenthesesOnNewLine, rParToken)) {\n\t\t\t\t\t\tFixStatementIndentation(rParToken.StartLocation);\n\t\t\t\t\t} else if (methodClosingParenthesesOnNewLine == NewLinePlacement.SameLine) {\n\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(rParToken, spaceWithinMethodCallParentheses);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\tforeach (var arg in arguments.Take (argumentStart)) {\n\t\t\t\t\tif (policy.IndentBlocksInsideExpressions)\n\t\t\t\t\t\tcurIndent.Push(IndentType.Continuation);\n\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\tif (policy.IndentBlocksInsideExpressions)\n\t\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t}\n\t\t\t\tforeach (var arg in arguments.Skip(argumentStart)) {\n\t\t\t\t\tif (arg.GetPrevSibling(NoWhitespacePredicate) != null) {\n\t\t\t\t\t\tif (methodCallArgumentWrapping == Wrapping.DoNotWrap) {\n\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(arg, spaceAfterMethodCallParameterComma && arg.GetPrevSibling(NoWhitespacePredicate).Role == Roles.Comma);\n\t\t\t\t\t\t\tif (policy.IndentBlocksInsideExpressions)\n\t\t\t\t\t\t\t\tcurIndent.Push(IndentType.Continuation);\n\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t\tif (policy.IndentBlocksInsideExpressions)\n\t\t\t\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!doAlignToFirstArgument && arg.PrevSibling.Role == Roles.NewLine) {\n\t\t\t\t\t\t\t\tcurIndent.Push(IndentType.Continuation);\n\t\t\t\t\t\t\t\tFixStatementIndentation(arg.StartLocation);\n\t\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (arg.PrevSibling.StartLocation.Line == arg.StartLocation.Line) {\n\t\t\t\t\t\t\t\t\tForceSpacesBefore(arg, spaceAfterMethodCallParameterComma && arg.GetPrevSibling(NoWhitespacePredicate).Role == Roles.Comma);\n\t\t\t\t\t\t\t\t\tif (policy.IndentBlocksInsideExpressions)\n\t\t\t\t\t\t\t\t\t\tcurIndent.Push(IndentType.Continuation);\n\t\t\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t\t\t\tif (policy.IndentBlocksInsideExpressions)\n\t\t\t\t\t\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tint extraSpaces = Math.Max(0, arguments.First().StartLocation.Column - 1 - curIndent.IndentString.Length);\n\t\t\t\t\t\t\t\t\tcurIndent.ExtraSpaces += extraSpaces;\n\t\t\t\t\t\t\t\t\tFixStatementIndentation(arg.StartLocation);\n\t\t\t\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t\t\t\t\tcurIndent.ExtraSpaces -= extraSpaces;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\targ.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!rParToken.IsNull) {\n\t\t\t\t\tif (methodCallArgumentWrapping == Wrapping.DoNotWrap) {\n\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(rParToken, arguments.Any() ? spaceWithinMethodCallParentheses : spaceWithinEmptyParentheses);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbool sameLine = rParToken.GetPrevNode(n => n.Role == Roles.Argument || n.Role == Roles.Parameter || n.Role == Roles.LPar || n.Role == Roles.Comma).EndLocation.Line == rParToken.StartLocation.Line;\n\t\t\t\t\t\tif (sameLine) {\n\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(rParToken, arguments.Any() ? spaceWithinMethodCallParentheses : spaceWithinEmptyParentheses);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tFixStatementIndentation(rParToken.StartLocation);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!rParToken.IsNull) {\n\t\t\t\tforeach (CSharpTokenNode comma in rParToken.Parent.Children.Where(n => n.Role == Roles.Comma)) {\n\t\t\t\t\tForceSpacesBefore(comma, spaceBeforeMethodCallParameterComma);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\tif (!invocationExpression.Target.IsNull)\n\t\t\t\tinvocationExpression.Target.AcceptVisitor(this);\n\n\t\t\tForceSpacesBefore(invocationExpression.LParToken, policy.SpaceBeforeMethodCallParentheses);\n\t\t\tif (invocationExpression.Arguments.Any()) {\n\t\t\t\tForceSpacesAfter(invocationExpression.LParToken, policy.SpaceWithinMethodCallParentheses);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(invocationExpression.LParToken, policy.SpaceBetweenEmptyMethodCallParentheses);\n\t\t\t\tForceSpacesBefore(invocationExpression.RParToken, policy.SpaceBetweenEmptyMethodCallParentheses);\n\t\t\t}\n\t\t\tbool popIndent = false;\n\t\t\tif (invocationExpression.Target is MemberReferenceExpression) {\n\t\t\t\tvar mt = (MemberReferenceExpression)invocationExpression.Target;\n\t\t\t\tif (mt.Target is InvocationExpression) {\n\t\t\t\t\tif (DoWrap(policy.ChainedMethodCallWrapping, mt.DotToken, 2)) {\n\t\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\t\tpopIndent = true;\n\t\t\t\t\t\tFixStatementIndentation(mt.DotToken.StartLocation);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (policy.ChainedMethodCallWrapping == Wrapping.DoNotWrap)\n\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(mt.DotToken, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tFormatArguments(invocationExpression);\n\t\t\tif (popIndent)\n\t\t\t\tcurIndent.Pop();\n\t\t}\n\n\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(indexerExpression.LBracketToken, policy.SpacesBeforeBrackets);\n\t\t\tForceSpacesAfter(indexerExpression.LBracketToken, policy.SpacesWithinBrackets);\n\n\t\t\tif (!indexerExpression.Target.IsNull)\n\t\t\t\tindexerExpression.Target.AcceptVisitor(this);\n\n\t\t\tFormatArguments(indexerExpression);\n\n\n\n\t\t}\n\n\t\tpublic override void VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\tvar lp = parenthesizedExpression.LParToken;\n\t\t\tvar expr = parenthesizedExpression.Expression;\n\t\t\tint extraSpaces = 0;\n\t\t\tif (lp.StartLocation.Line == expr.StartLocation.Line) {\n\t\t\t\tForceSpacesAfter(lp, policy.SpacesWithinParentheses);\n\t\t\t} else {\n\t\t\t\textraSpaces += options.IndentSize;\n\t\t\t\tcurIndent.ExtraSpaces += extraSpaces;\n\t\t\t\tFixIndentation(expr);\n\t\t\t}\n\n\t\t\tbase.VisitParenthesizedExpression(parenthesizedExpression);\n\n\t\t\tvar rp = parenthesizedExpression.RParToken;\n\n\t\t\tcurIndent.ExtraSpaces -= extraSpaces;\n\t\t\tif (rp.StartLocation.Line == expr.EndLocation.Line) {\n\t\t\t\tForceSpacesBefore(rp, policy.SpacesWithinParentheses);\n\t\t\t} else {\n\t\t\t\tFixIndentation(rp);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitSizeOfExpression(SizeOfExpression sizeOfExpression)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(sizeOfExpression.LParToken, policy.SpaceBeforeSizeOfParentheses);\n\t\t\tForceSpacesAfter(sizeOfExpression.LParToken, policy.SpacesWithinSizeOfParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(sizeOfExpression.RParToken, policy.SpacesWithinSizeOfParentheses);\n\t\t\tbase.VisitSizeOfExpression(sizeOfExpression);\n\t\t}\n\n\t\tpublic override void VisitTypeOfExpression(TypeOfExpression typeOfExpression)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(typeOfExpression.LParToken, policy.SpaceBeforeTypeOfParentheses);\n\t\t\tForceSpacesAfter(typeOfExpression.LParToken, policy.SpacesWithinTypeOfParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(typeOfExpression.RParToken, policy.SpacesWithinTypeOfParentheses);\n\t\t\tbase.VisitTypeOfExpression(typeOfExpression);\n\t\t}\n\n\t\tpublic override void VisitCheckedExpression(CheckedExpression checkedExpression)\n\t\t{\n\t\t\tForceSpacesAfter(checkedExpression.LParToken, policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(checkedExpression.RParToken, policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tbase.VisitCheckedExpression(checkedExpression);\n\t\t}\n\n\t\tpublic override void VisitUncheckedExpression(UncheckedExpression uncheckedExpression)\n\t\t{\n\t\t\tForceSpacesAfter(uncheckedExpression.LParToken, policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(uncheckedExpression.RParToken, policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tbase.VisitUncheckedExpression(uncheckedExpression);\n\t\t}\n\n\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(objectCreateExpression.LParToken, policy.SpaceBeforeNewParentheses);\n\n\t\t\tif (objectCreateExpression.Arguments.Any()) {\n\t\t\t\tif (!objectCreateExpression.LParToken.IsNull)\n\t\t\t\t\tForceSpacesAfter(objectCreateExpression.LParToken, policy.SpacesWithinNewParentheses);\n\t\t\t} else {\n\t\t\t\tif (!objectCreateExpression.LParToken.IsNull)\n\t\t\t\t\tForceSpacesAfter(objectCreateExpression.LParToken, policy.SpacesBetweenEmptyNewParentheses);\n\t\t\t}\n\n\t\t\tif (!objectCreateExpression.Type.IsNull)\n\t\t\t\tobjectCreateExpression.Type.AcceptVisitor(this);\n\t\t\tobjectCreateExpression.Initializer.AcceptVisitor(this);\n\t\t\tFormatArguments(objectCreateExpression);\n\t\t}\n\n\t\tpublic override void VisitArrayCreateExpression(ArrayCreateExpression arrayObjectCreateExpression)\n\t\t{\n\t\t\tFormatCommas(arrayObjectCreateExpression, policy.SpaceBeforeMethodCallParameterComma, policy.SpaceAfterMethodCallParameterComma);\n\t\t\tbase.VisitArrayCreateExpression(arrayObjectCreateExpression);\n\t\t}\n\n\t\tpublic override void VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\tvar old = curIndent;\n\t\t\tcurIndent = curIndent.Clone();\n\t\t\tcurIndent.ExtraSpaces = 0;\n\n\t\t\tif (DoWrap(policy.ArrayInitializerWrapping, arrayInitializerExpression.RBraceToken, arrayInitializerExpression.Elements.Count)) {\n\t\t\t\tFixOpenBrace(policy.ArrayInitializerBraceStyle, arrayInitializerExpression.LBraceToken);\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\tforeach (var init in arrayInitializerExpression.Elements) {\n\t\t\t\t\tFixStatementIndentation(init.StartLocation);\n\t\t\t\t\tinit.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t\tcurIndent.Pop();\n\t\t\t\tFixClosingBrace(policy.ArrayInitializerBraceStyle, arrayInitializerExpression.RBraceToken);\n\t\t\t} else if (policy.ArrayInitializerWrapping == Wrapping.DoNotWrap) {\n\t\t\t\tForceSpacesBeforeRemoveNewLines(arrayInitializerExpression.LBraceToken);\n\t\t\t\tforeach (var init in arrayInitializerExpression.Elements) {\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(init);\n\t\t\t\t\tinit.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t\tForceSpacesBeforeRemoveNewLines(arrayInitializerExpression.RBraceToken);\n\t\t\t} else {\n\t\t\t\tvar lBrace = arrayInitializerExpression.LBraceToken;\n\t\t\t\tvar rBrace = arrayInitializerExpression.RBraceToken;\n\n\t\t\t\tforeach (var child in arrayInitializerExpression.Children) {\n\t\t\t\t\tif (child.Role == Roles.LBrace) {\n\t\t\t\t\t\tif (lBrace.StartLocation.Line == rBrace.StartLocation.Line && policy.AllowOneLinedArrayInitialziers) {\n\t\t\t\t\t\t\tForceSpacesAfter(child, true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tFixOpenBrace(policy.ArrayInitializerBraceStyle, child);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (child.Role == Roles.RBrace) {\n\t\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\t\tif (lBrace.StartLocation.Line == rBrace.StartLocation.Line && policy.AllowOneLinedArrayInitialziers) {\n\t\t\t\t\t\t\tForceSpaceBefore(child, true);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tFixClosingBrace(policy.ArrayInitializerBraceStyle, child);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (child.Role == Roles.Expression) {\n\t\t\t\t\t\tif (child.PrevSibling != null) {\n\t\t\t\t\t\t\tif (child.PrevSibling.Role == Roles.NewLine) {\n\t\t\t\t\t\t\t\tFixIndentation(child);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (child.PrevSibling.Role == Roles.Comma) {\n\t\t\t\t\t\t\t\tForceSpaceBefore(child, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t\t\tif (child.NextSibling != null && child.NextSibling.Role == Roles.Comma)\n\t\t\t\t\t\t\tForceSpacesAfter(child, false);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurIndent = old;\n\t\t}\n\n\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tvar assignToken = parameterDeclaration.AssignToken;\n\t\t\tif (!assignToken.IsNull)\n\t\t\t\tForceSpacesAround(assignToken, policy.SpaceAroundAssignment);\n\t\t\tbase.VisitParameterDeclaration(parameterDeclaration);\n\t\t}\n\n\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tFormatArguments(lambdaExpression);\n\t\t\tForceSpacesBeforeRemoveNewLines(lambdaExpression.ArrowToken, true);\n\n\t\t\tif (!lambdaExpression.Body.IsNull) {\n\t\t\t\tvar body = lambdaExpression.Body as BlockStatement;\n\t\t\t\tif (body != null) {\n\t\t\t\t\tvar old = curIndent;\n\t\t\t\t\tthis.curIndent = curIndent.GetIndentWithoutSpace ();\n\t\t\t\t\tFixOpenBrace(policy.AnonymousMethodBraceStyle, body.LBraceToken);\n\t\t\t\t\tVisitBlockWithoutFixingBraces(body, policy.IndentMethodBody);\n\t\t\t\t\tFixClosingBrace(policy.AnonymousMethodBraceStyle, body.RBraceToken);\n\t\t\t\t\tcurIndent = old;\n\t\t\t\t} else {\n\t\t\t\t\tForceSpacesAfter(lambdaExpression.ArrowToken, true);\n\t\t\t\t\tlambdaExpression.Body.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitNamedExpression(NamedExpression namedExpression)\n\t\t{\n\t\t\tForceSpacesAround(namedExpression.AssignToken, policy.SpaceAroundAssignment);\n\t\t\tbase.VisitNamedExpression(namedExpression);\n\t\t}\n\n\t\tpublic override void VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)\n\t\t{\n\t\t\tForceSpacesAfter(namedArgumentExpression.ColonToken, policy.SpaceInNamedArgumentAfterDoubleColon);\n\n\t\t\tbase.VisitNamedArgumentExpression(namedArgumentExpression);\n\t\t}\n\n\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tvar dot = memberReferenceExpression.DotToken;\n\t\t\tif (dot.PrevSibling.EndLocation.Line == dot.StartLocation.Line)\n\t\t\t\tForceSpacesBefore(dot, false);\n\t\t\tForceSpacesAfter(dot, false);\n\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t}\n\n\t\tpublic override void VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\tForceSpacesAround(pointerReferenceExpression.ArrowToken, policy.SpaceAroundUnsafeArrowOperator);\n\t\t\tbase.VisitPointerReferenceExpression(pointerReferenceExpression);\n\t\t}\n\n\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tbase.VisitUnaryOperatorExpression(unaryOperatorExpression);\n\t\t\tswitch (unaryOperatorExpression.Operator) {\n\t\t\t\tcase UnaryOperatorType.Any:\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\tcase UnaryOperatorType.BitNot:\n\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(unaryOperatorExpression.Expression, false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(unaryOperatorExpression.OperatorToken, false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.Dereference:\n\t\t\t\t\tForceSpacesAfter(unaryOperatorExpression.OperatorToken, policy.SpaceAfterUnsafeAsteriskOfOperator);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.AddressOf:\n\t\t\t\t\tForceSpacesAfter(unaryOperatorExpression.OperatorToken, policy.SpaceAfterUnsafeAddressOfOperator);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.Await:\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(unaryOperatorExpression.Expression, true);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs",
    "content": "//\n// AstFormattingVisitor_Global.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpartial class FormattingVisitor : DepthFirstAstVisitor\n\t{\n\t\tint GetGlobalNewLinesFor(AstNode child)\n\t\t{\n\t\t\tif (child.NextSibling == null)\n\t\t\t\t// last node in the document => no extra newlines\n\t\t\t\treturn 0;\n\t\t\tif (child.NextSibling.Role == Roles.RBrace)\n\t\t\t\t// Last node in a block => no extra newlines, it's handled later by FixClosingBrace()\n\t\t\t\treturn 0;\n\n\t\t\tint newLines = 1;\n\t\t\tvar nextSibling = child.GetNextSibling(NoWhitespacePredicate);\n\t\t\tif (nextSibling is PreProcessorDirective) {\n\t\t\t\tvar directive = (PreProcessorDirective)nextSibling;\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Endif)\n\t\t\t\t\treturn -1;\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Undef)\n\t\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ((child is UsingDeclaration || child is UsingAliasDeclaration) && !(nextSibling is UsingDeclaration || nextSibling is UsingAliasDeclaration)) {\n\t\t\t\tnewLines += policy.MinimumBlankLinesAfterUsings;\n\t\t\t} else if ((child is TypeDeclaration) && (nextSibling is TypeDeclaration)) {\n\t\t\t\tnewLines += policy.MinimumBlankLinesBetweenTypes;\n\t\t\t}\n\n\t\t\treturn newLines;\n\t\t}\n\n\t\tpublic override void VisitSyntaxTree(SyntaxTree unit)\n\t\t{\n\t\t\tbool first = true;\n\t\t\tVisitChildrenToFormat(unit, child => {\n\t\t\t\tif (first && (child is UsingDeclaration || child is UsingAliasDeclaration)) {\n\t\t\t\t\tEnsureMinimumBlankLinesBefore(child, policy.MinimumBlankLinesBeforeUsings);\n\t\t\t\t\tfirst = false;\n\t\t\t\t}\n\t\t\t\tif (NoWhitespacePredicate(child))\n\t\t\t\t\tFixIndentation(child);\n\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\tif (NoWhitespacePredicate(child) && !first)\n\t\t\t\t\tEnsureMinimumNewLinesAfter(child, GetGlobalNewLinesFor(child));\n\t\t\t});\n\t\t}\n\n\t\tpublic override void VisitAttributeSection(AttributeSection attributeSection)\n\t\t{\n\t\t\tVisitChildrenToFormat(attributeSection, child => {\n\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\tif (child.NextSibling != null && child.NextSibling.Role == Roles.RBracket) {\n\t\t\t\t\tForceSpacesAfter(child, false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic override void VisitAttribute(Attribute attribute)\n\t\t{\n\t\t\tif (attribute.HasArgumentList) {\n\t\t\t\tForceSpacesBefore(attribute.LParToken, policy.SpaceBeforeMethodCallParentheses);\n\t\t\t\tif (attribute.Arguments.Any()) {\n\t\t\t\t\tForceSpacesAfter(attribute.LParToken, policy.SpaceWithinMethodCallParentheses);\n\t\t\t\t} else {\n\t\t\t\t\tForceSpacesAfter(attribute.LParToken, policy.SpaceBetweenEmptyMethodCallParentheses);\n\t\t\t\t\tForceSpacesBefore(attribute.RParToken, policy.SpaceBetweenEmptyMethodCallParentheses);\n\t\t\t\t}\n\t\t\t\tFormatArguments(attribute);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\tForceSpacesAfter(usingDeclaration.UsingToken, true);\n\t\t\tFixSemicolon(usingDeclaration.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitUsingAliasDeclaration(UsingAliasDeclaration usingDeclaration)\n\t\t{\n\t\t\tForceSpacesAfter(usingDeclaration.UsingToken, true);\n\t\t\tForceSpacesAround(usingDeclaration.AssignToken, policy.SpaceAroundAssignment);\n\t\t\tFixSemicolon(usingDeclaration.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\tFixOpenBrace(policy.NamespaceBraceStyle, namespaceDeclaration.LBraceToken);\n\t\t\tif (policy.IndentNamespaceBody)\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\n\t\t\tbool first = true;\n\t\t\tbool startFormat = false;\n\t\t\tVisitChildrenToFormat(namespaceDeclaration, child => {\n\t\t\t\tif (first) {\n\t\t\t\t\tstartFormat = child.StartLocation > namespaceDeclaration.LBraceToken.StartLocation;\n\t\t\t\t}\n\t\t\t\tif (child.Role == Roles.LBrace) {\n\t\t\t\t\tvar next = child.GetNextSibling(NoWhitespacePredicate);\n\t\t\t\t\tvar blankLines = 1;\n\t\t\t\t\tif (next is UsingDeclaration || next is UsingAliasDeclaration) {\n\t\t\t\t\t\tblankLines += policy.MinimumBlankLinesBeforeUsings;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tblankLines += policy.MinimumBlankLinesBeforeFirstDeclaration;\n\t\t\t\t\t}\n\t\t\t\t\tEnsureMinimumNewLinesAfter(child, blankLines);\n\t\t\t\t\tstartFormat = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (child.Role == Roles.RBrace) {\n\t\t\t\t\tstartFormat = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!startFormat || !NoWhitespacePredicate (child))\n\t\t\t\t\treturn;\n\t\t\t\tif (first && (child is UsingDeclaration || child is UsingAliasDeclaration)) {\n\t\t\t\t\t// TODO: policy.BlankLinesBeforeUsings\n\t\t\t\t\tfirst = false;\n\t\t\t\t}\n\t\t\t\tif (NoWhitespacePredicate(child))\n\t\t\t\t\tFixIndentationForceNewLine(child);\n\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\tif (NoWhitespacePredicate(child))\n\t\t\t\t\tEnsureMinimumNewLinesAfter(child, GetGlobalNewLinesFor(child));\n\t\t\t});\n\n\t\t\tif (policy.IndentNamespaceBody)\n\t\t\t\tcurIndent.Pop();\n\n\t\t\tFixClosingBrace(policy.NamespaceBraceStyle, namespaceDeclaration.RBraceToken);\n\t\t}\n\n\t\tvoid FixAttributesAndDocComment(EntityDeclaration entity)\n\t\t{\n\t\t\tvar node = entity.FirstChild;\n\t\t\twhile (node != null && node.Role == Roles.Comment) {\n\t\t\t\tnode = node.GetNextSibling(NoWhitespacePredicate);\n\t\t\t\tFixIndentation(node);\n\t\t\t}\n\t\t\tif (entity.Attributes.Count > 0) {\n\t\t\t\tAstNode n = null;\n\t\t\t\tentity.Attributes.First().AcceptVisitor(this);\n\t\t\t\tforeach (var attr in entity.Attributes.Skip (1)) {\n\t\t\t\t\tFixIndentation(attr);\n\t\t\t\t\tattr.AcceptVisitor(this);\n\t\t\t\t\tn = attr;\n\t\t\t\t}\n\t\t\t\tif (n != null) {\n\t\t\t\t\tFixIndentation(n.GetNextNode(NoWhitespacePredicate));\n\t\t\t\t} else {\n\t\t\t\t\tFixIndentation(entity.Attributes.First().GetNextNode(NoWhitespacePredicate));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(typeDeclaration);\n\t\t\tBraceStyle braceStyle;\n\t\t\tbool indentBody = false;\n\t\t\tswitch (typeDeclaration.ClassType) {\n\t\t\t\tcase ClassType.Class:\n\t\t\t\t\tbraceStyle = policy.ClassBraceStyle;\n\t\t\t\t\tindentBody = policy.IndentClassBody;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\tbraceStyle = policy.StructBraceStyle;\n\t\t\t\t\tindentBody = policy.IndentStructBody;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\tbraceStyle = policy.InterfaceBraceStyle;\n\t\t\t\t\tindentBody = policy.IndentInterfaceBody;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\tbraceStyle = policy.EnumBraceStyle;\n\t\t\t\t\tindentBody = policy.IndentEnumBody;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException(\"unsupported class type : \" + typeDeclaration.ClassType);\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var constraint in typeDeclaration.Constraints)\n\t\t\t\tconstraint.AcceptVisitor (this);\n\n\t\t\tFixOpenBrace(braceStyle, typeDeclaration.LBraceToken);\n\n\t\t\tif (indentBody)\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\tbool startFormat = true;\n\t\t\tbool first = true;\n\t\t\tVisitChildrenToFormat(typeDeclaration, child => {\n\t\t\t\tif (first) {\n\t\t\t\t\tstartFormat = child.StartLocation > typeDeclaration.LBraceToken.StartLocation;\n\t\t\t\t\tfirst = false;\n\t\t\t\t}\n\t\t\t\tif (child.Role == Roles.LBrace) {\n\t\t\t\t\tstartFormat = true;\n\t\t\t\t\tif (braceStyle != BraceStyle.DoNotChange)\n\t\t\t\t\t\tEnsureMinimumNewLinesAfter(child, GetTypeLevelNewLinesFor(child));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (child.Role == Roles.RBrace) {\n\t\t\t\t\tstartFormat = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!startFormat || !NoWhitespacePredicate (child))\n\t\t\t\t\treturn;\n\t\t\t\tif (child.Role == Roles.Comma) {\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines (child, false);\n\t\t\t\t\tEnsureMinimumNewLinesAfter(child, 1);\n\t\t\t\t\treturn;\n\t\t\t\t} \n\t\t\t\tif (NoWhitespacePredicate(child))\n\t\t\t\t\tFixIndentationForceNewLine(child);\n\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\tif (NoWhitespacePredicate(child) && child.GetNextSibling (NoWhitespacePredicate).Role != Roles.Comma)\n\t\t\t\t\tEnsureMinimumNewLinesAfter(child, GetTypeLevelNewLinesFor(child));\n\t\t\t});\n\n\t\t\tif (indentBody)\n\t\t\t\tcurIndent.Pop();\n\n\t\t\tFixClosingBrace(braceStyle, typeDeclaration.RBraceToken);\n\t\t}\n\n\t\tint GetTypeLevelNewLinesFor(AstNode child)\n\t\t{\n\t\t\tvar blankLines = 1;\n\t\t\tvar nextSibling = child.GetNextSibling(NoWhitespacePredicate);\n\t\t\tif (child is PreProcessorDirective) {\n\t\t\t\tvar directive = (PreProcessorDirective)child;\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Region) {\n\t\t\t\t\tblankLines += policy.MinimumBlankLinesInsideRegion;\n\t\t\t\t}\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Endregion) {\n\t\t\t\t\tif (child.GetNextSibling(NoWhitespacePredicate) is CSharpTokenNode)\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\tblankLines += policy.MinimumBlankLinesAroundRegion;\n\t\t\t\t}\n\t\t\t\treturn blankLines;\n\t\t\t}\n\n\t\t\tif (nextSibling is PreProcessorDirective) {\n\t\t\t\tvar directive = (PreProcessorDirective)nextSibling;\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Region) {\n\t\t\t\t\tif (child is CSharpTokenNode)\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\tblankLines += policy.MinimumBlankLinesAroundRegion;\n\t\t\t\t}\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Endregion)\n\t\t\t\t\tblankLines += policy.MinimumBlankLinesInsideRegion;\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Endif)\n\t\t\t\t\treturn -1;\n\t\t\t\tif (directive.Type == PreProcessorDirectiveType.Undef)\n\t\t\t\t\treturn -1;\n\t\t\t\treturn blankLines;\n\t\t\t}\n\t\t\tif (child.Role == Roles.LBrace)\n\t\t\t\treturn 1;\n\t\t\tif (child is Comment)\n\t\t\t\treturn 1;\n\t\t\tif (child is EventDeclaration) {\n\t\t\t\tif (nextSibling is EventDeclaration) {\n\t\t\t\t\tblankLines += policy.MinimumBlankLinesBetweenEventFields;\n\t\t\t\t\treturn blankLines;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (child is FieldDeclaration || child is FixedFieldDeclaration) {\n\t\t\t\tif (nextSibling is FieldDeclaration || nextSibling is FixedFieldDeclaration) {\n\t\t\t\t\tblankLines += policy.MinimumBlankLinesBetweenFields;\n\t\t\t\t\treturn blankLines;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (child is TypeDeclaration) {\n\t\t\t\tif (nextSibling is TypeDeclaration) {\n\t\t\t\t\tblankLines += policy.MinimumBlankLinesBetweenTypes;\n\t\t\t\t\treturn blankLines;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (nextSibling.Role == Roles.TypeMemberRole)\n\t\t\t\tblankLines += policy.MinimumBlankLinesBetweenMembers;\n\t\t\treturn blankLines;\n\t\t}\n\n\t\tpublic override void VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\tForceSpacesBefore(delegateDeclaration.LParToken, policy.SpaceBeforeDelegateDeclarationParentheses);\n\t\t\tif (delegateDeclaration.Parameters.Any()) {\n\t\t\t\tForceSpacesAfter(delegateDeclaration.LParToken, policy.SpaceWithinDelegateDeclarationParentheses);\n\t\t\t\tForceSpacesBefore(delegateDeclaration.RParToken, policy.SpaceWithinDelegateDeclarationParentheses);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(delegateDeclaration.LParToken, policy.SpaceBetweenEmptyDelegateDeclarationParentheses);\n\t\t\t\tForceSpacesBefore(delegateDeclaration.RParToken, policy.SpaceBetweenEmptyDelegateDeclarationParentheses);\n\t\t\t}\n\t\t\tFormatCommas(delegateDeclaration, policy.SpaceBeforeDelegateDeclarationParameterComma, policy.SpaceAfterDelegateDeclarationParameterComma);\n\n\t\t\tbase.VisitDelegateDeclaration(delegateDeclaration);\n\t\t}\n\n\t\tpublic override void VisitComment(Comment comment)\n\t\t{\n\t\t\tif (comment.StartsLine && !HadErrors && (!policy.KeepCommentsAtFirstColumn || comment.StartLocation.Column > 1))\n\t\t\t\tFixIndentation(comment);\n\t\t}\n\n\t\tpublic override void VisitConstraint(Constraint constraint)\n\t\t{\n\t\t\tVisitChildrenToFormat (constraint, node => {\n\t\t\t\tif (node is AstType) {\n\t\t\t\t\tnode.AcceptVisitor (this);\n\t\t\t\t} else if (node.Role == Roles.LPar) {\n\t\t\t\t\tForceSpacesBefore (node, false);\n\t\t\t\t\tForceSpacesAfter (node, false);\n\t\t\t\t} else if (node.Role ==Roles.Comma) {\n\t\t\t\t\tForceSpacesBefore (node, false);\n\t\t\t\t\tForceSpacesAfter (node, true);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Query.cs",
    "content": "//\n// AstFormattingVisitor_Query.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpartial class FormattingVisitor\n\t{\n\t\tint GetUpdatedStartLocation(QueryExpression queryExpression)\n\t\t{\n\t\t\t//TODO\n\t\t\treturn queryExpression.StartLocation.Column;\n\t\t}\n\n\t\tpublic override void VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\tvar oldIndent = curIndent.Clone();\n\n\t\t\tvar column = GetUpdatedStartLocation(queryExpression);\n\n\t\t\tint extraSpaces = column - 1 - (curIndent.CurIndent / options.TabSize);\n\t\t\tif (extraSpaces < 0) {\n\t\t\t\t//This check should probably be removed in the future, when GetUpdatedStartLocation is implemented\n\t\t\t\textraSpaces = 0;\n\t\t\t}\n\n\t\t\tcurIndent.ExtraSpaces = extraSpaces;\n\t\t\tVisitChildren(queryExpression);\n\n\t\t\tcurIndent = oldIndent;\n\t\t}\n\n\t\tpublic override void VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t{\n\t\t\tFixClauseIndentation(queryFromClause, queryFromClause.FromKeyword);\n\t\t}\n\n\t\tpublic override void VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t{\n\t\t\tVisitChildren(queryContinuationClause);\n\t\t}\n\n\t\tpublic override void VisitQueryGroupClause(QueryGroupClause queryGroupClause)\n\t\t{\n\t\t\tFixClauseIndentation(queryGroupClause, queryGroupClause.GroupKeyword);\n\t\t}\n\n\t\tpublic override void VisitQueryJoinClause(QueryJoinClause queryJoinClause)\n\t\t{\n\t\t\tFixClauseIndentation(queryJoinClause, queryJoinClause.JoinKeyword);\n\t\t}\n\n\t\tpublic override void VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t{\n\t\t\tFixClauseIndentation(queryLetClause, queryLetClause.LetKeyword);\n\t\t}\n\n\t\tpublic override void VisitQuerySelectClause(QuerySelectClause querySelectClause)\n\t\t{\n\t\t\tFixClauseIndentation(querySelectClause, querySelectClause.SelectKeyword);\n\t\t}\n\n\t\tpublic override void VisitQueryOrderClause(QueryOrderClause queryOrderClause)\n\t\t{\n\t\t\tFixClauseIndentation(queryOrderClause, queryOrderClause.OrderbyToken);\n\t\t}\n\n\t\tpublic override void VisitQueryWhereClause(QueryWhereClause queryWhereClause)\n\t\t{\n\t\t\tFixClauseIndentation(queryWhereClause, queryWhereClause.WhereKeyword);\n\t\t}\n\n\t\tvoid FixClauseIndentation(QueryClause clause, AstNode keyword) {\n\t\t\tvar parentExpression = clause.GetParent<QueryExpression>();\n\t\t\tbool isFirstClause = parentExpression.Clauses.First() == clause;\n\t\t\tif (!isFirstClause) {\n\t\t\t\tPlaceOnNewLine(policy.NewLineBeforeNewQueryClause, keyword);\n\t\t\t}\n\n\t\t\tint extraSpaces = options.IndentSize;\n\t\t\tcurIndent.ExtraSpaces += extraSpaces;\n\t\t\tforeach (var child in clause.Children) {\n\t\t\t\tvar expression = child as Expression;\n\t\t\t\tif (expression != null) {\n\t\t\t\t\tFixIndentation(child);\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t}\n\n\t\t\t\tvar tokenNode = child as CSharpTokenNode;\n\t\t\t\tif (tokenNode != null) {\n\t\t\t\t\tif (tokenNode.GetNextSibling(NoWhitespacePredicate).StartLocation.Line != tokenNode.EndLocation.Line) {\n\t\t\t\t\t\tForceSpacesAfter(tokenNode, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurIndent.ExtraSpaces -= extraSpaces;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Statements.cs",
    "content": "//\n// AstFormattingVisitor_Statements.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpartial class FormattingVisitor : DepthFirstAstVisitor\n\t{\n\t\tpublic override void VisitExpressionStatement(ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tbase.VisitExpressionStatement(expressionStatement);\n\t\t\tFixSemicolon(expressionStatement.SemicolonToken);\n\t\t}\n\n\t\tvoid VisitBlockWithoutFixingBraces(BlockStatement blockStatement, bool indent)\n\t\t{\n\t\t\tif (indent) {\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t}\n\n\t\t\tVisitChildrenToFormat (blockStatement, child => {\n\t\t\t\tif (child.Role == Roles.LBrace || child.Role == Roles.RBrace) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (child is Statement) {\n\t\t\t\t\tFixStatementIndentation(child.StartLocation);\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t} else if (child is Comment) {\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t} else if (child is NewLineNode) {\n\t\t\t\t\t// ignore\n\t\t\t\t} else {\n\t\t\t\t\t// pre processor directives at line start, if they are there.\n\t\t\t\t\tif (child.StartLocation.Column > 1)\n\t\t\t\t\t\tFixStatementIndentation(child.StartLocation);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (indent) {\n\t\t\t\tcurIndent.Pop ();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t{\n\t\t\tFixIndentation(blockStatement);\n\t\t\tVisitBlockWithoutFixingBraces(blockStatement, policy.IndentBlocks);\n\t\t\tFixIndentation(blockStatement.RBraceToken);\n\t\t}\n\n\t\tpublic override void VisitBreakStatement(BreakStatement breakStatement)\n\t\t{\n\t\t\tFixSemicolon(breakStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitCheckedStatement(CheckedStatement checkedStatement)\n\t\t{\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, checkedStatement.Body);\n\t\t}\n\n\t\tpublic override void VisitContinueStatement(ContinueStatement continueStatement)\n\t\t{\n\t\t\tFixSemicolon(continueStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitEmptyStatement(EmptyStatement emptyStatement)\n\t\t{\n\t\t\t// Empty\n\t\t}\n\n\t\tpublic override void VisitFixedStatement(FixedStatement fixedStatement)\n\t\t{\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, fixedStatement.EmbeddedStatement);\n\t\t}\n\n\t\tpublic override void VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(foreachStatement.LParToken, policy.SpaceBeforeForeachParentheses);\n\n\t\t\tForceSpacesAfter(foreachStatement.LParToken, policy.SpacesWithinForeachParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(foreachStatement.RParToken, policy.SpacesWithinForeachParentheses);\n\t\t\t\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, foreachStatement.EmbeddedStatement);\n\t\t}\n\n\t\tvoid FixEmbeddedStatment(BraceStyle braceStyle, AstNode node)\n\t\t{\n\t\t\tFixEmbeddedStatment(braceStyle, null, false, node);\n\t\t}\n\n\t\tvoid FixEmbeddedStatment(BraceStyle braceStyle, CSharpTokenNode token, bool allowInLine, AstNode node, bool statementAlreadyIndented = false)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\treturn;\n\t\t\tbool isBlock = node is BlockStatement;\n\t\t\tFormattingChanges.TextReplaceAction beginBraceAction = null;\n\t\t\tFormattingChanges.TextReplaceAction endBraceAction = null;\n\t\t\tBlockStatement closeBlockToBeFixed = null;\n\t\t\tif (isBlock) {\n\t\t\t\tBlockStatement block = node as BlockStatement;\n\t\t\t\tif (allowInLine && block.StartLocation.Line == block.EndLocation.Line && block.Statements.Count() <= 1) {\n\t\t\t\t\tif (block.Statements.Count() == 1)\n\t\t\t\t\t\tnextStatementIndent = \" \";\n\t\t\t\t} else {\n\t\t\t\t\tif (!statementAlreadyIndented)\n\t\t\t\t\t\tFixOpenBrace(braceStyle, block.LBraceToken);\n\t\t\t\t\tcloseBlockToBeFixed = block;\n\t\t\t\t}\n\n\t\t\t\tif (braceStyle == BraceStyle.NextLineShifted2)\n\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t} else {\n\t\t\t\tif (allowInLine && token.StartLocation.Line == node.EndLocation.Line) {\n\t\t\t\t\tnextStatementIndent = \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tbool pushed = false;\n\n\t\t\tif (policy.IndentBlocks && !(\n\t\t\t\tpolicy.AlignEmbeddedStatements && node is IfElseStatement && node.Parent is IfElseStatement || \n\t\t\t\tpolicy.AlignEmbeddedStatements && node is UsingStatement && node.Parent is UsingStatement || \n\t\t\t\tpolicy.AlignEmbeddedStatements && node is LockStatement && node.Parent is LockStatement)) { \n\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\tpushed = true;\n\t\t\t}\n\t\t\tif (isBlock) {\n\t\t\t\tVisitBlockWithoutFixingBraces((BlockStatement)node, false);\n\t\t\t} else {\n\t\t\t\tif (!statementAlreadyIndented) {\n\t\t\t\t\tPlaceOnNewLine(policy.EmbeddedStatementPlacement, node);\n\t\t\t\t\tnextStatementIndent = null;\n\t\t\t\t}\n\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t}\n\t\t\tnextStatementIndent = null;\n\t\t\tif (pushed)\n\t\t\t\tcurIndent.Pop();\n\t\t\tif (beginBraceAction != null && endBraceAction != null) {\n\t\t\t\tbeginBraceAction.DependsOn = endBraceAction;\n\t\t\t\tendBraceAction.DependsOn = beginBraceAction;\n\t\t\t}\n\n\t\t\tif (isBlock && braceStyle == BraceStyle.NextLineShifted2)\n\t\t\t\tcurIndent.Pop();\n\t\t\tif (closeBlockToBeFixed != null) {\n\t\t\t\tFixClosingBrace(braceStyle, closeBlockToBeFixed.RBraceToken);\n\t\t\t}\n\n\t\t}\n\n\t\tpublic bool IsLineIsEmptyUpToEol(TextLocation startLocation)\n\t\t{\n\t\t\treturn IsLineIsEmptyUpToEol(document.GetOffset(startLocation) - 1);\n\t\t}\n\n\t\tbool IsLineIsEmptyUpToEol(int startOffset)\n\t\t{\n\t\t\tfor (int offset = startOffset - 1; offset >= 0; offset--) {\n\t\t\t\tchar ch = document.GetCharAt(offset);\n\t\t\t\tif (ch != ' ' && ch != '\\t') {\n\t\t\t\t\treturn NewLine.IsNewLine (ch);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tint SearchWhitespaceStart(int startOffset)\n\t\t{\n\t\t\tif (startOffset < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException (\"startoffset\", \"value : \" + startOffset);\n\t\t\t}\n\t\t\tfor (int offset = startOffset - 1; offset >= 0; offset--) {\n\t\t\t\tchar ch = document.GetCharAt(offset);\n\t\t\t\tif (!Char.IsWhiteSpace(ch)) {\n\t\t\t\t\treturn offset + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\tint SearchWhitespaceEnd(int startOffset)\n\t\t{\n\t\t\tif (startOffset > document.TextLength) {\n\t\t\t\tthrow new ArgumentOutOfRangeException (\"startoffset\", \"value : \" + startOffset);\n\t\t\t}\n\t\t\tfor (int offset = startOffset + 1; offset < document.TextLength; offset++) {\n\t\t\t\tchar ch = document.GetCharAt(offset);\n\t\t\t\tif (!Char.IsWhiteSpace(ch)) {\n\t\t\t\t\treturn offset + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn document.TextLength - 1;\n\t\t}\n\n\t\tint SearchWhitespaceLineStart(int startOffset)\n\t\t{\n\t\t\tif (startOffset < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException (\"startoffset\", \"value : \" + startOffset);\n\t\t\t}\n\t\t\tfor (int offset = startOffset - 1; offset >= 0; offset--) {\n\t\t\t\tchar ch = document.GetCharAt(offset);\n\t\t\t\tif (ch != ' ' && ch != '\\t') {\n\t\t\t\t\treturn offset + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic override void VisitForStatement(ForStatement forStatement)\n\t\t{\n\t\t\tforeach (AstNode node in forStatement.Children) {\n\t\t\t\tif (node.Role == Roles.Semicolon) {\n\t\t\t\t\tif (node.GetNextSibling(NoWhitespacePredicate) is CSharpTokenNode || node.GetNextSibling(NoWhitespacePredicate) is EmptyStatement) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tForceSpacesBefore(node, policy.SpaceBeforeForSemicolon);\n\t\t\t\t\tForceSpacesAfter(node, policy.SpaceAfterForSemicolon);\n\t\t\t\t} else if (node.Role == Roles.LPar) {\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(node, policy.SpaceBeforeForParentheses);\n\t\t\t\t\tForceSpacesAfter(node, policy.SpacesWithinForParentheses);\n\t\t\t\t} else if (node.Role == Roles.RPar) {\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(node, policy.SpacesWithinForParentheses);\n\t\t\t\t} else if (node.Role == Roles.EmbeddedStatement) {\n\t\t\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, node);\n\t\t\t\t} else {\n\t\t\t\t\tnode.AcceptVisitor(this); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitGotoStatement(GotoStatement gotoStatement)\n\t\t{\n\t\t\tVisitChildren(gotoStatement);\n\t\t\tFixSemicolon(gotoStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(ifElseStatement.LParToken, policy.SpaceBeforeIfParentheses);\n\t\t\tAlign(ifElseStatement.LParToken, ifElseStatement.Condition, policy.SpacesWithinIfParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(ifElseStatement.RParToken, policy.SpacesWithinIfParentheses);\n\n\n\t\t\tif (!ifElseStatement.TrueStatement.IsNull) {\n\t\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, ifElseStatement.IfToken, policy.AllowIfBlockInline, ifElseStatement.TrueStatement);\n\t\t\t}\n\n\t\t\tif (!ifElseStatement.FalseStatement.IsNull) {\n\t\t\t\tvar placeElseOnNewLine = policy.ElseNewLinePlacement;\n\t\t\t\tif (!(ifElseStatement.TrueStatement is BlockStatement)) {\n\t\t\t\t\tplaceElseOnNewLine = NewLinePlacement.NewLine;\n\t\t\t\t}\n\t\t\t\tPlaceOnNewLine(placeElseOnNewLine, ifElseStatement.ElseToken);\n\t\t\t\tif (ifElseStatement.FalseStatement is IfElseStatement) {\n\t\t\t\t\tPlaceOnNewLine(policy.ElseIfNewLinePlacement, ((IfElseStatement)ifElseStatement.FalseStatement).IfToken);\n\t\t\t\t}\n\t\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, ifElseStatement.ElseToken, policy.AllowIfBlockInline, ifElseStatement.FalseStatement, ifElseStatement.FalseStatement is IfElseStatement);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitLabelStatement(LabelStatement labelStatement)\n\t\t{\n\t\t\t// TODO\n\t\t\tVisitChildren(labelStatement);\n\t\t}\n\n\t\tpublic override void VisitLockStatement(LockStatement lockStatement)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(lockStatement.LParToken, policy.SpaceBeforeLockParentheses);\n\n\t\t\tForceSpacesAfter(lockStatement.LParToken, policy.SpacesWithinLockParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(lockStatement.RParToken, policy.SpacesWithinLockParentheses);\n\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, lockStatement.EmbeddedStatement);\n\t\t}\n\n\t\tpublic override void VisitReturnStatement(ReturnStatement returnStatement)\n\t\t{\n\t\t\tVisitChildren(returnStatement);\n\t\t\tFixSemicolon(returnStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitSwitchStatement(SwitchStatement switchStatement)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(switchStatement.LParToken, policy.SpaceBeforeSwitchParentheses);\n\n\t\t\tForceSpacesAfter(switchStatement.LParToken, policy.SpacesWithinSwitchParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(switchStatement.RParToken, policy.SpacesWithinSwitchParentheses);\n\n\t\t\tFixOpenBrace(policy.StatementBraceStyle, switchStatement.LBraceToken);\n\t\t\tVisitChildren(switchStatement);\n\t\t\tFixClosingBrace(policy.StatementBraceStyle, switchStatement.RBraceToken);\n\t\t}\n\n\t\tpublic override void VisitSwitchSection(SwitchSection switchSection)\n\t\t{\n\t\t\tif (policy.IndentSwitchBody) {\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t}\n\n\t\t\tforeach (CaseLabel label in switchSection.CaseLabels) {\n\t\t\t\tFixStatementIndentation(label.StartLocation);\n\t\t\t\tlabel.AcceptVisitor(this);\n\t\t\t}\n\t\t\tif (policy.IndentCaseBody) {\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t}\n\n\t\t\tforeach (var stmt in switchSection.Statements) {\n\t\t\t\tif (stmt is BreakStatement && !policy.IndentBreakStatements && policy.IndentCaseBody) {\n\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\tFixStatementIndentation(stmt.StartLocation);\n\t\t\t\t\tstmt.AcceptVisitor(this);\n\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tFixStatementIndentation(stmt.StartLocation);\n\t\t\t\tstmt.AcceptVisitor(this);\n\t\t\t}\n\t\t\tif (policy.IndentCaseBody) {\n\t\t\t\tcurIndent.Pop ();\n\t\t\t}\n\n\t\t\tif (policy.IndentSwitchBody) {\n\t\t\t\tcurIndent.Pop ();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitCaseLabel(CaseLabel caseLabel)\n\t\t{\n\t\t\tForceSpacesBefore(caseLabel.ColonToken, false);\n\t\t}\n\n\t\tpublic override void VisitThrowStatement(ThrowStatement throwStatement)\n\t\t{\n\t\t\tVisitChildren(throwStatement);\n\t\t\tFixSemicolon(throwStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitTryCatchStatement(TryCatchStatement tryCatchStatement)\n\t\t{\n\t\t\tif (!tryCatchStatement.TryBlock.IsNull) {\n\t\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, tryCatchStatement.TryBlock);\n\t\t\t}\n\n\t\t\tforeach (CatchClause clause in tryCatchStatement.CatchClauses) {\n\t\t\t\tPlaceOnNewLine(policy.CatchNewLinePlacement, clause.CatchToken);\n\t\t\t\tif (!clause.LParToken.IsNull) {\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(clause.LParToken, policy.SpaceBeforeCatchParentheses);\n\n\t\t\t\t\tForceSpacesAfter(clause.LParToken, policy.SpacesWithinCatchParentheses);\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(clause.RParToken, policy.SpacesWithinCatchParentheses);\n\t\t\t\t}\n\t\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, clause.Body);\n\t\t\t}\n\n\t\t\tif (!tryCatchStatement.FinallyBlock.IsNull) {\n\t\t\t\tPlaceOnNewLine(policy.FinallyNewLinePlacement, tryCatchStatement.FinallyToken);\n\n\t\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, tryCatchStatement.FinallyBlock);\n\t\t\t}\n\n\t\t}\n\n\t\tpublic override void VisitCatchClause(CatchClause catchClause)\n\t\t{\n\t\t\t// Handled in TryCatchStatement\n\t\t}\n\n\t\tpublic override void VisitUncheckedStatement(UncheckedStatement uncheckedStatement)\n\t\t{\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, uncheckedStatement.Body);\n\t\t}\n\n\t\tpublic override void VisitUnsafeStatement(UnsafeStatement unsafeStatement)\n\t\t{\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, unsafeStatement.Body);\n\t\t}\n\n\t\tpublic override void VisitUsingStatement(UsingStatement usingStatement)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(usingStatement.LParToken, policy.SpaceBeforeUsingParentheses);\n\n\t\t\tAlign(usingStatement.LParToken, usingStatement.ResourceAcquisition, policy.SpacesWithinUsingParentheses);\n\n\t\t\tForceSpacesBeforeRemoveNewLines(usingStatement.RParToken, policy.SpacesWithinUsingParentheses);\n\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, usingStatement.EmbeddedStatement);\n\t\t}\n\n\t\tpublic override void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\tvar returnType = variableDeclarationStatement.Type;\n\t\t\treturnType.AcceptVisitor(this);\n\t\t\tif ((variableDeclarationStatement.Modifiers & Modifiers.Const) == Modifiers.Const) {\n\t\t\t\tForceSpacesAround(returnType, true);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(returnType, true);\n\t\t\t}\n\t\t\tvar lastLoc = variableDeclarationStatement.StartLocation;\n\t\t\tforeach (var initializer in variableDeclarationStatement.Variables) {\n\t\t\t\tif (lastLoc.Line != initializer.StartLocation.Line) {\n\t\t\t\t\tFixStatementIndentation(initializer.StartLocation);\n\t\t\t\t\tlastLoc = initializer.StartLocation;\n\t\t\t\t}\n\t\t\t\tinitializer.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tFormatCommas(variableDeclarationStatement, policy.SpaceBeforeLocalVariableDeclarationComma, policy.SpaceAfterLocalVariableDeclarationComma);\n\t\t\tFixSemicolon(variableDeclarationStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitDoWhileStatement(DoWhileStatement doWhileStatement)\n\t\t{\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, doWhileStatement.EmbeddedStatement);\n\t\t\tPlaceOnNewLine(doWhileStatement.EmbeddedStatement is BlockStatement ? policy.WhileNewLinePlacement : NewLinePlacement.NewLine, doWhileStatement.WhileToken);\n\n\t\t\tAlign(doWhileStatement.LParToken, doWhileStatement.Condition, policy.SpacesWithinWhileParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(doWhileStatement.RParToken, policy.SpacesWithinWhileParentheses);\n\t\t}\n\n\t\tvoid Align(AstNode lPar, AstNode alignNode, bool space)\n\t\t{\n\t\t\tint extraSpaces = 0;\n\t\t\tvar useExtraSpaces = lPar.StartLocation.Line == alignNode.StartLocation.Line;\n\t\t\tif (useExtraSpaces) {\n\t\t\t\textraSpaces = Math.Max(0, lPar.StartLocation.Column + (space ? 1 : 0) - curIndent.IndentString.Length);\n\t\t\t\tcurIndent.ExtraSpaces += extraSpaces;\n\t\t\t\tForceSpacesAfter(lPar, space);\n\t\t\t} else {\n\t\t\t\tcurIndent.Push(IndentType.Continuation); \n\t\t\t\tFixIndentation(alignNode);\n\t\t\t}\n\t\t\talignNode.AcceptVisitor(this);\n\n\t\t\tif (useExtraSpaces) {\n\t\t\t\tcurIndent.ExtraSpaces -= extraSpaces;\n\t\t\t} else {\n\t\t\t\tcurIndent.Pop();\n\t\t\t}\n\n\t\t}\n\n\t\tpublic override void VisitWhileStatement(WhileStatement whileStatement)\n\t\t{\n\t\t\tForceSpacesBeforeRemoveNewLines(whileStatement.LParToken, policy.SpaceBeforeWhileParentheses);\n\t\t\tAlign(whileStatement.LParToken, whileStatement.Condition, policy.SpacesWithinWhileParentheses);\n\t\t\tForceSpacesBeforeRemoveNewLines(whileStatement.RParToken, policy.SpacesWithinWhileParentheses);\n\n\t\t\tFixEmbeddedStatment(policy.StatementBraceStyle, whileStatement.EmbeddedStatement);\n\t\t}\n\n\t\tpublic override void VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement)\n\t\t{\n\t\t\tFixSemicolon(yieldBreakStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitYieldReturnStatement(YieldReturnStatement yieldStatement)\n\t\t{\n\t\t\tyieldStatement.Expression.AcceptVisitor(this);\n\t\t\tFixSemicolon(yieldStatement.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\tif (!variableInitializer.AssignToken.IsNull) {\n\t\t\t\tForceSpacesAround(variableInitializer.AssignToken, policy.SpaceAroundAssignment);\n\t\t\t}\n\t\t\tif (!variableInitializer.Initializer.IsNull) {\n\t\t\t\tint extraSpaces = 0;\n\t\t\t\tvar useExtraSpaces = variableInitializer.AssignToken.StartLocation.Line == variableInitializer.Initializer.StartLocation.Line;\n\t\t\t\tif (useExtraSpaces) {\n\t\t\t\t\textraSpaces = Math.Max(0, variableInitializer.AssignToken.StartLocation.Column + 1 - curIndent.IndentString.Length);\n\t\t\t\t\tcurIndent.ExtraSpaces += extraSpaces;\n\t\t\t\t} else {\n\t\t\t\t\tcurIndent.Push(IndentType.Continuation); \n\t\t\t\t\tFixIndentation(variableInitializer.Initializer);\n\t\t\t\t}\n\t\t\t\tvariableInitializer.Initializer.AcceptVisitor(this);\n\n\t\t\t\tif (useExtraSpaces) {\n\t\t\t\t\tcurIndent.ExtraSpaces -= extraSpaces;\n\t\t\t\t} else {\n\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_TypeMembers.cs",
    "content": "//\n// AstFormattingVisitor_TypeMembers.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpartial class FormattingVisitor : DepthFirstAstVisitor\n\t{\n\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(propertyDeclaration);\n\t\t\tbool oneLine = false;\n\t\t\tbool fixClosingBrace = false;\n\t\t\tPropertyFormatting propertyFormatting;\n\n\t\t\tif ((propertyDeclaration.Getter.IsNull || propertyDeclaration.Getter.Body.IsNull) &&\n\t\t\t    (propertyDeclaration.Setter.IsNull || propertyDeclaration.Setter.Body.IsNull)) {\n\t\t\t\tpropertyFormatting = policy.AutoPropertyFormatting;\n\t\t\t} else {\n\t\t\t\tpropertyFormatting = policy.SimplePropertyFormatting;\n\t\t\t}\n\n\t\t\tswitch (propertyFormatting) {\n\t\t\t\tcase PropertyFormatting.AllowOneLine:\n\t\t\t\t\tbool isSimple = IsSimpleAccessor(propertyDeclaration.Getter) && IsSimpleAccessor(propertyDeclaration.Setter);\n\t\t\t\t\tint accessorLine = propertyDeclaration.RBraceToken.StartLocation.Line;\n\t\t\t\t\tif (!propertyDeclaration.Getter.IsNull && propertyDeclaration.Setter.IsNull) {\n\t\t\t\t\t\taccessorLine = propertyDeclaration.Getter.StartLocation.Line;\n\t\t\t\t\t} else if (propertyDeclaration.Getter.IsNull && !propertyDeclaration.Setter.IsNull) {\n\t\t\t\t\t\taccessorLine = propertyDeclaration.Setter.StartLocation.Line;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar acc = propertyDeclaration.Getter.StartLocation < propertyDeclaration.Setter.StartLocation ?\n\t\t\t\t\t\t\tpropertyDeclaration.Getter : propertyDeclaration.Setter;\n\t\t\t\t\t\taccessorLine = acc.StartLocation.Line;\n\t\t\t\t\t}\n\t\t\t\t\tif (isSimple && \n\t\t\t\t\t    Math.Min(propertyDeclaration.Getter.StartLocation.Line, propertyDeclaration.Setter.StartLocation.Line) == propertyDeclaration.LBraceToken.StartLocation.Line &&\n\t\t\t\t        propertyDeclaration.Getter.StartLocation.Line != propertyDeclaration.Setter.StartLocation.Line)\n\t\t\t\t\t\tgoto case PropertyFormatting.ForceOneLine;\n\t\t\t\t\tif (!isSimple || propertyDeclaration.LBraceToken.StartLocation.Line != accessorLine) {\n\t\t\t\t\t\tfixClosingBrace = true;\n\t\t\t\t\t\tFixOpenBrace(policy.PropertyBraceStyle, propertyDeclaration.LBraceToken);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tForceSpacesBefore(propertyDeclaration.Getter, true);\n\t\t\t\t\t\tForceSpacesBefore(propertyDeclaration.Setter, true);\n\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(propertyDeclaration.RBraceToken, true);\n\t\t\t\t\t\toneLine = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase PropertyFormatting.ForceNewLine:\n\t\t\t\t\tfixClosingBrace = true;\n\t\t\t\t\tFixOpenBrace(policy.PropertyBraceStyle, propertyDeclaration.LBraceToken);\n\t\t\t\t\tbreak;\n\t\t\t\tcase PropertyFormatting.ForceOneLine:\n\t\t\t\t\tisSimple = IsSimpleAccessor(propertyDeclaration.Getter) && IsSimpleAccessor(propertyDeclaration.Setter);\n\t\t\t\t\tif (isSimple) {\n\t\t\t\t\t\tvar lBraceToken = propertyDeclaration.LBraceToken;\n\t\t\t\t\t\tvar rBraceToken = propertyDeclaration.RBraceToken;\n\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(lBraceToken, true);\n\t\t\t\t\t\tif (!propertyDeclaration.Getter.IsNull)\n\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(propertyDeclaration.Getter, true);\n\t\t\t\t\t\tif (!propertyDeclaration.Setter.IsNull)\n\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(propertyDeclaration.Setter, true);\n\n\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(rBraceToken, true);\n\t\t\t\t\t\toneLine = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfixClosingBrace = true;\n\t\t\t\t\t\tFixOpenBrace(policy.PropertyBraceStyle, propertyDeclaration.LBraceToken);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (policy.IndentPropertyBody)\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\n\t\t\tFormatAccessor(propertyDeclaration.Getter, policy.PropertyGetBraceStyle, policy.SimpleGetBlockFormatting, oneLine);\n\t\t\tFormatAccessor(propertyDeclaration.Setter, policy.PropertySetBraceStyle, policy.SimpleSetBlockFormatting, oneLine);\n\n\t\t\tif (policy.IndentPropertyBody) {\n\t\t\t\tcurIndent.Pop();\n\t\t\t}\n\t\t\tif (fixClosingBrace)\n\t\t\t\tFixClosingBrace(policy.PropertyBraceStyle, propertyDeclaration.RBraceToken);\n\n\t\t}\n\n\t\tvoid FormatAccessor(Accessor accessor, BraceStyle braceStyle, PropertyFormatting blockFormatting, bool oneLine)\n\t\t{\n\t\t\tif (accessor.IsNull)\n\t\t\t\treturn;\n\t\t\tif (!oneLine) {\n\t\t\t\tif (!IsLineIsEmptyUpToEol(accessor.StartLocation)) {\n\t\t\t\t\tint offset = this.document.GetOffset(accessor.StartLocation);\n\t\t\t\t\tint start = SearchWhitespaceStart(offset);\n\t\t\t\t\tstring indentString = this.curIndent.IndentString;\n\t\t\t\t\tAddChange(start, offset - start, this.options.EolMarker + indentString);\n\t\t\t\t} else {\n\t\t\t\t\tFixIndentation(accessor);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tblockFormatting = PropertyFormatting.ForceOneLine;\n\t\t\t\tif (!accessor.Body.IsNull) {\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(accessor.Body.LBraceToken, true);\n\t\t\t\t\tForceSpacesBeforeRemoveNewLines(accessor.Body.RBraceToken, true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\n\t\t\tif (!accessor.IsNull) {\n\t\t\t\tif (!accessor.Body.IsNull) {\n\t\t\t\t\tif (IsSimpleAccessor (accessor)) {\n\t\t\t\t\t\tswitch (blockFormatting) {\n\t\t\t\t\t\t\tcase PropertyFormatting.AllowOneLine:\n\t\t\t\t\t\t\t\tif (accessor.Body.LBraceToken.StartLocation.Line != accessor.Body.RBraceToken.StartLocation.Line)\n\t\t\t\t\t\t\t\t\tgoto case PropertyFormatting.ForceNewLine;\n\t\t\t\t\t\t\t\tnextStatementIndent = \" \";\n\t\t\t\t\t\t\t\tVisitBlockWithoutFixingBraces(accessor.Body, policy.IndentBlocks);\n\t\t\t\t\t\t\t\tnextStatementIndent = null;\n\t\t\t\t\t\t\t\tif (!oneLine)\n\t\t\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(accessor.Body.RBraceToken, true);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase PropertyFormatting.ForceOneLine:\n\t\t\t\t\t\t\t\tFixOpenBrace(BraceStyle.EndOfLine, accessor.Body.LBraceToken);\n\n\n\t\t\t\t\t\t\t\tvar statement = accessor.Body.Statements.FirstOrDefault();\n\t\t\t\t\t\t\t\tif (statement != null) {\n\t\t\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(statement, true);\n\t\t\t\t\t\t\t\t\tstatement.AcceptVisitor(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!oneLine)\n\t\t\t\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(accessor.Body.RBraceToken, true);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase PropertyFormatting.ForceNewLine:\n\t\t\t\t\t\t\t\tFixOpenBrace(braceStyle, accessor.Body.LBraceToken);\n\t\t\t\t\t\t\t\tVisitBlockWithoutFixingBraces(accessor.Body, policy.IndentBlocks);\n\t\t\t\t\t\t\t\tif (!oneLine)\n\t\t\t\t\t\t\t\t\tFixClosingBrace(braceStyle, accessor.Body.RBraceToken);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tFixOpenBrace(braceStyle, accessor.Body.LBraceToken);\n\t\t\t\t\t\tVisitBlockWithoutFixingBraces(accessor.Body, policy.IndentBlocks);\n\t\t\t\t\t\tFixClosingBrace(braceStyle, accessor.Body.RBraceToken);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitAccessor(Accessor accessor)\n\t\t{\n\t\t\tFixAttributesAndDocComment(accessor);\n\n\t\t\tbase.VisitAccessor(accessor);\n\t\t}\n\n\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(indexerDeclaration);\n\n\t\t\tForceSpacesBefore(indexerDeclaration.LBracketToken, policy.SpaceBeforeIndexerDeclarationBracket);\n\t\t\tForceSpacesAfter(indexerDeclaration.LBracketToken, policy.SpaceWithinIndexerDeclarationBracket);\n\n\t\t\tFormatArguments(indexerDeclaration);\n\n\t\t\tbool oneLine = false;\n\t\t\tbool fixClosingBrace = false;\n\t\t\tswitch (policy.SimplePropertyFormatting) {\n\t\t\t\tcase PropertyFormatting.AllowOneLine:\n\t\t\t\t\tbool isSimple = IsSimpleAccessor(indexerDeclaration.Getter) && IsSimpleAccessor(indexerDeclaration.Setter);\n\t\t\t\t\tint accessorLine = indexerDeclaration.RBraceToken.StartLocation.Line;\n\t\t\t\t\tif (!indexerDeclaration.Getter.IsNull && indexerDeclaration.Setter.IsNull) {\n\t\t\t\t\t\taccessorLine = indexerDeclaration.Getter.StartLocation.Line;\n\t\t\t\t\t} else if (indexerDeclaration.Getter.IsNull && !indexerDeclaration.Setter.IsNull) {\n\t\t\t\t\t\taccessorLine = indexerDeclaration.Setter.StartLocation.Line;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar acc = indexerDeclaration.Getter.StartLocation < indexerDeclaration.Setter.StartLocation ?\n\t\t\t\t\t\t\tindexerDeclaration.Getter : indexerDeclaration.Setter;\n\t\t\t\t\t\taccessorLine = acc.StartLocation.Line;\n\t\t\t\t\t}\n\t\t\t\t\tif (!isSimple || indexerDeclaration.LBraceToken.StartLocation.Line != accessorLine) {\n\t\t\t\t\t\tfixClosingBrace = true;\n\t\t\t\t\t\tFixOpenBrace(policy.PropertyBraceStyle, indexerDeclaration.LBraceToken);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tForceSpacesBefore(indexerDeclaration.Getter, true);\n\t\t\t\t\t\tForceSpacesBefore(indexerDeclaration.Setter, true);\n\t\t\t\t\t\tForceSpacesBeforeRemoveNewLines(indexerDeclaration.RBraceToken, true);\n\t\t\t\t\t\toneLine = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase PropertyFormatting.ForceNewLine:\n\t\t\t\t\tfixClosingBrace = true;\n\t\t\t\t\tFixOpenBrace(policy.PropertyBraceStyle, indexerDeclaration.LBraceToken);\n\t\t\t\t\tbreak;\n\t\t\t\tcase PropertyFormatting.ForceOneLine:\n\t\t\t\t\tisSimple = IsSimpleAccessor(indexerDeclaration.Getter) && IsSimpleAccessor(indexerDeclaration.Setter);\n\t\t\t\t\tif (isSimple) {\n\t\t\t\t\t\tint offset = this.document.GetOffset(indexerDeclaration.LBraceToken.StartLocation);\n\n\t\t\t\t\t\tint start = SearchWhitespaceStart(offset);\n\t\t\t\t\t\tint end = SearchWhitespaceEnd(offset);\n\t\t\t\t\t\tAddChange(start, offset - start, \" \");\n\t\t\t\t\t\tAddChange(offset + 1, end - offset - 2, \" \");\n\n\t\t\t\t\t\toffset = this.document.GetOffset(indexerDeclaration.RBraceToken.StartLocation);\n\t\t\t\t\t\tstart = SearchWhitespaceStart(offset);\n\t\t\t\t\t\tAddChange(start, offset - start, \" \");\n\t\t\t\t\t\toneLine = true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfixClosingBrace = true;\n\t\t\t\t\t\tFixOpenBrace(policy.PropertyBraceStyle, indexerDeclaration.LBraceToken);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (policy.IndentPropertyBody)\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\n\t\t\tFormatAccessor(indexerDeclaration.Getter, policy.PropertyGetBraceStyle, policy.SimpleGetBlockFormatting, oneLine);\n\t\t\tFormatAccessor(indexerDeclaration.Setter, policy.PropertySetBraceStyle, policy.SimpleSetBlockFormatting, oneLine);\n\t\t\tif (policy.IndentPropertyBody)\n\t\t\t\tcurIndent.Pop();\n\n\t\t\tif (fixClosingBrace)\n\t\t\t\tFixClosingBrace(policy.PropertyBraceStyle, indexerDeclaration.RBraceToken);\n\t\t}\n\n\t\tstatic bool IsSimpleEvent(AstNode node)\n\t\t{\n\t\t\treturn node is EventDeclaration;\n\t\t}\n\n\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(eventDeclaration);\n\n\t\t\tFixOpenBrace(policy.EventBraceStyle, eventDeclaration.LBraceToken);\n\t\t\tif (policy.IndentEventBody)\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\n\t\t\tif (!eventDeclaration.AddAccessor.IsNull) {\n\t\t\t\tFixIndentation(eventDeclaration.AddAccessor);\n\t\t\t\tif (!eventDeclaration.AddAccessor.Body.IsNull) {\n\t\t\t\t\tif (!policy.AllowEventAddBlockInline || eventDeclaration.AddAccessor.Body.LBraceToken.StartLocation.Line != eventDeclaration.AddAccessor.Body.RBraceToken.StartLocation.Line) {\n\t\t\t\t\t\tFixOpenBrace(policy.EventAddBraceStyle, eventDeclaration.AddAccessor.Body.LBraceToken);\n\t\t\t\t\t\tVisitBlockWithoutFixingBraces(eventDeclaration.AddAccessor.Body, policy.IndentBlocks);\n\t\t\t\t\t\tFixClosingBrace(policy.EventAddBraceStyle, eventDeclaration.AddAccessor.Body.RBraceToken);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnextStatementIndent = \" \";\n\t\t\t\t\t\tVisitBlockWithoutFixingBraces(eventDeclaration.AddAccessor.Body, policy.IndentBlocks);\n\t\t\t\t\t\tnextStatementIndent = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!eventDeclaration.RemoveAccessor.IsNull) {\n\t\t\t\tFixIndentation(eventDeclaration.RemoveAccessor);\n\t\t\t\tif (!eventDeclaration.RemoveAccessor.Body.IsNull) {\n\t\t\t\t\tif (!policy.AllowEventRemoveBlockInline || eventDeclaration.RemoveAccessor.Body.LBraceToken.StartLocation.Line != eventDeclaration.RemoveAccessor.Body.RBraceToken.StartLocation.Line) {\n\t\t\t\t\t\tFixOpenBrace(policy.EventRemoveBraceStyle, eventDeclaration.RemoveAccessor.Body.LBraceToken);\n\t\t\t\t\t\tVisitBlockWithoutFixingBraces(eventDeclaration.RemoveAccessor.Body, policy.IndentBlocks);\n\t\t\t\t\t\tFixClosingBrace(policy.EventRemoveBraceStyle, eventDeclaration.RemoveAccessor.Body.RBraceToken);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnextStatementIndent = \" \";\n\t\t\t\t\t\tVisitBlockWithoutFixingBraces(eventDeclaration.RemoveAccessor.Body, policy.IndentBlocks);\n\t\t\t\t\t\tnextStatementIndent = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (policy.IndentEventBody)\n\t\t\t\tcurIndent.Pop();\n\n\t\t\tFixClosingBrace(policy.EventBraceStyle, eventDeclaration.RBraceToken);\n\t\t}\n\n\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(eventDeclaration);\n\n\t\t\tforeach (var m in eventDeclaration.ModifierTokens) {\n\t\t\t\tForceSpacesAfter(m, true);\n\t\t\t}\n\n\t\t\tForceSpacesBeforeRemoveNewLines(eventDeclaration.EventToken.GetNextSibling(NoWhitespacePredicate), true);\n\t\t\teventDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tForceSpacesAfter(eventDeclaration.ReturnType, true);\n\t\t\t/*\n\t\t\tvar lastLoc = eventDeclaration.StartLocation;\n\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\tforeach (var initializer in eventDeclaration.Variables) {\n\t\t\t\tif (lastLoc.Line != initializer.StartLocation.Line) {\n\t\t\t\t\tFixStatementIndentation(initializer.StartLocation);\n\t\t\t\t\tlastLoc = initializer.StartLocation;\n\t\t\t\t}\n\t\t\t\tinitializer.AcceptVisitor(this);\n\t\t\t}\n\t\t\tcurIndent.Pop ();\n\t\t\t*/\n\t\t\tFixSemicolon(eventDeclaration.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(fieldDeclaration);\n\n\t\t\tfieldDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tForceSpacesAfter(fieldDeclaration.ReturnType, true);\n\n\t\t\tFormatCommas(fieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);\n\n\t\t\tvar lastLoc = fieldDeclaration.ReturnType.StartLocation;\n\t\t\tforeach (var initializer in fieldDeclaration.Variables) {\n\t\t\t\tif (lastLoc.Line != initializer.StartLocation.Line) {\n\t\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\t\tFixStatementIndentation(initializer.StartLocation);\n\t\t\t\t\tcurIndent.Pop();\n\t\t\t\t\tlastLoc = initializer.StartLocation;\n\t\t\t\t}\n\t\t\t\tinitializer.AcceptVisitor(this);\n\t\t\t}\n\t\t\tFixSemicolon(fieldDeclaration.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(fixedFieldDeclaration);\n\n\t\t\tFormatCommas(fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);\n\n\t\t\tvar lastLoc = fixedFieldDeclaration.StartLocation;\n\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\tforeach (var initializer in fixedFieldDeclaration.Variables) {\n\t\t\t\tif (lastLoc.Line != initializer.StartLocation.Line) {\n\t\t\t\t\tFixStatementIndentation(initializer.StartLocation);\n\t\t\t\t\tlastLoc = initializer.StartLocation;\n\t\t\t\t}\n\t\t\t\tinitializer.AcceptVisitor(this);\n\t\t\t}\n\t\t\tcurIndent.Pop();\n\t\t\tFixSemicolon(fixedFieldDeclaration.SemicolonToken);\n\t\t}\n\n\t\tpublic override void VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(enumMemberDeclaration);\n\t\t\tvar initializer = enumMemberDeclaration.Initializer;\n\t\t\tif (!initializer.IsNull) {\n\t\t\t\tForceSpacesAround(enumMemberDeclaration.AssignToken, policy.SpaceAroundAssignment);\n\t\t\t\tinitializer.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(methodDeclaration);\n\n\t\t\tForceSpacesBefore(methodDeclaration.LParToken, policy.SpaceBeforeMethodDeclarationParentheses);\n\t\t\tif (methodDeclaration.Parameters.Any()) {\n\t\t\t\tForceSpacesAfter(methodDeclaration.LParToken, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\t\tFormatArguments(methodDeclaration);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(methodDeclaration.LParToken, policy.SpaceBetweenEmptyMethodDeclarationParentheses);\n\t\t\t\tForceSpacesBefore(methodDeclaration.RParToken, policy.SpaceBetweenEmptyMethodDeclarationParentheses);\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var constraint in methodDeclaration.Constraints)\n\t\t\t\tconstraint.AcceptVisitor(this);\n\n\t\t\tif (!methodDeclaration.Body.IsNull) {\n\t\t\t\tFixOpenBrace(policy.MethodBraceStyle, methodDeclaration.Body.LBraceToken);\n\t\t\t\tVisitBlockWithoutFixingBraces(methodDeclaration.Body, policy.IndentMethodBody);\n\t\t\t\tFixClosingBrace(policy.MethodBraceStyle, methodDeclaration.Body.RBraceToken);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(operatorDeclaration);\n\n\t\t\tForceSpacesBefore(operatorDeclaration.LParToken, policy.SpaceBeforeMethodDeclarationParentheses);\n\t\t\tif (operatorDeclaration.Parameters.Any()) {\n\t\t\t\tForceSpacesAfter(operatorDeclaration.LParToken, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\t\tFormatArguments(operatorDeclaration);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(operatorDeclaration.LParToken, policy.SpaceBetweenEmptyMethodDeclarationParentheses);\n\t\t\t\tForceSpacesBefore(operatorDeclaration.RParToken, policy.SpaceBetweenEmptyMethodDeclarationParentheses);\n\t\t\t}\n\n\t\t\tif (!operatorDeclaration.Body.IsNull) {\n\t\t\t\tFixOpenBrace(policy.MethodBraceStyle, operatorDeclaration.Body.LBraceToken);\n\t\t\t\tVisitBlockWithoutFixingBraces(operatorDeclaration.Body, policy.IndentMethodBody);\n\t\t\t\tFixClosingBrace(policy.MethodBraceStyle, operatorDeclaration.Body.RBraceToken);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(constructorDeclaration);\n\n\t\t\tForceSpacesBefore(constructorDeclaration.LParToken, policy.SpaceBeforeConstructorDeclarationParentheses);\n\t\t\tif (constructorDeclaration.Parameters.Any()) {\n\t\t\t\tForceSpacesAfter(constructorDeclaration.LParToken, policy.SpaceWithinConstructorDeclarationParentheses);\n\t\t\t\tFormatArguments(constructorDeclaration);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(constructorDeclaration.LParToken, policy.SpaceBetweenEmptyConstructorDeclarationParentheses);\n\t\t\t\tForceSpacesBefore(constructorDeclaration.RParToken, policy.SpaceBetweenEmptyConstructorDeclarationParentheses);\n\t\t\t}\n\n\t\t\tvar initializer = constructorDeclaration.Initializer;\n\t\t\tif (!initializer.IsNull) {\n\t\t\t\tcurIndent.Push(IndentType.Block);\n\t\t\t\tPlaceOnNewLine(policy.NewLineBeforeConstructorInitializerColon, constructorDeclaration.ColonToken);\n\t\t\t\tPlaceOnNewLine(policy.NewLineAfterConstructorInitializerColon, initializer);\n\t\t\t\tinitializer.AcceptVisitor(this);\n\t\t\t\tcurIndent.Pop();\n\t\t\t}\n\t\t\tif (!constructorDeclaration.Body.IsNull) {\n\t\t\t\tFixOpenBrace(policy.ConstructorBraceStyle, constructorDeclaration.Body.LBraceToken);\n\t\t\t\tVisitBlockWithoutFixingBraces(constructorDeclaration.Body, policy.IndentMethodBody);\n\t\t\t\tFixClosingBrace(policy.ConstructorBraceStyle, constructorDeclaration.Body.RBraceToken);\n\t\t\t}\n\t\t}\n\t\tpublic override void VisitConstructorInitializer(ConstructorInitializer constructorInitializer)\n\t\t{\n\t\t\tForceSpacesBefore(constructorInitializer.LParToken, policy.SpaceBeforeMethodCallParentheses);\n\t\t\tif (constructorInitializer.Arguments.Any()) {\n\t\t\t\tForceSpacesAfter(constructorInitializer.LParToken, policy.SpaceWithinMethodCallParentheses);\n\t\t\t} else {\n\t\t\t\tForceSpacesAfter(constructorInitializer.LParToken, policy.SpaceBetweenEmptyMethodCallParentheses);\n\t\t\t\tForceSpacesBefore(constructorInitializer.RParToken, policy.SpaceBetweenEmptyMethodCallParentheses);\n\t\t\t}\n\n\t\t\tFormatArguments(constructorInitializer);\n\n\t\t}\n\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\tFixAttributesAndDocComment(destructorDeclaration);\n\n\t\t\tCSharpTokenNode lParen = destructorDeclaration.LParToken;\n\t\t\tForceSpaceBefore(lParen, policy.SpaceBeforeConstructorDeclarationParentheses);\n\n\t\t\tif (!destructorDeclaration.Body.IsNull) {\n\t\t\t\tFixOpenBrace(policy.DestructorBraceStyle, destructorDeclaration.Body.LBraceToken);\n\t\t\t\tVisitBlockWithoutFixingBraces(destructorDeclaration.Body, policy.IndentMethodBody);\n\t\t\t\tFixClosingBrace(policy.DestructorBraceStyle, destructorDeclaration.Body.RBraceToken);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/GeneratedCodeSettings.cs",
    "content": "﻿// \n// GeneratedCodeSettings.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum GeneratedCodeMember\n\t{\n\t\tUnknown,\n\n\t\tStaticFields,\n\t\tInstanceFields,\n\t\tStaticProperties,\n\t\tInstanceProperties,\n\t\tIndexer,\n\t\tConstructors,\n\t\tStaticMethods,\n\t\tInstanceMethods,\n\t\tStaticEvents,\n\t\tInstanceEvents,\n\t\tOperators,\n\t\tNestedTypes\n\t}\n\n\tpublic class GeneratedCodeSettings\n\t{\n\t\tList<GeneratedCodeMember> codeMemberOrder;\n\n\t\tpublic List<GeneratedCodeMember> CodeMemberOrder {\n\t\t\tget {\n\t\t\t\treturn codeMemberOrder;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tcodeMemberOrder = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool GenerateCategoryComments {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool SubOrderAlphabetical {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic void Apply (AstNode rootNode)\n\t\t{\n\t\t\tif (rootNode == null)\n\t\t\t\tthrow new ArgumentNullException (\"rootNode\");\n\t\t\trootNode.AcceptVisitor (new GenerateCodeVisitior (this));\n\t\t}\n\n\t\tpublic virtual string GetCategoryLabel(GeneratedCodeMember memberCategory)\n\t\t{\n\t\t\tswitch (memberCategory) {\n\t\t\t\tcase GeneratedCodeMember.StaticFields:\n\t\t\t\t\treturn \"Static Fields\";\n\t\t\t\tcase GeneratedCodeMember.InstanceFields:\n\t\t\t\t\treturn \"Fields\";\n\t\t\t\tcase GeneratedCodeMember.StaticProperties:\n\t\t\t\t\treturn \"Static Properties\";\n\t\t\t\tcase GeneratedCodeMember.InstanceProperties:\n\t\t\t\t\treturn \"Properties\";\n\t\t\t\tcase GeneratedCodeMember.Indexer:\n\t\t\t\t\treturn \"Indexer\";\n\t\t\t\tcase GeneratedCodeMember.Constructors:\n\t\t\t\t\treturn \"Constructors\";\n\t\t\t\tcase GeneratedCodeMember.StaticMethods:\n\t\t\t\t\treturn \"Static Methods\";\n\t\t\t\tcase GeneratedCodeMember.InstanceMethods:\n\t\t\t\t\treturn \"Methods\";\n\t\t\t\tcase GeneratedCodeMember.StaticEvents:\n\t\t\t\t\treturn \"Static Events\";\n\t\t\t\tcase GeneratedCodeMember.InstanceEvents:\n\t\t\t\t\treturn \"Events\";\n\t\t\t\tcase GeneratedCodeMember.Operators:\n\t\t\t\t\treturn \"Operators\";\n\t\t\t\tcase GeneratedCodeMember.NestedTypes:\n\t\t\t\t\treturn \"Nested Types\";\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tclass GenerateCodeVisitior : DepthFirstAstVisitor\n\t\t{\n\t\t\tGeneratedCodeSettings settings;\n\n\t\t\tpublic GenerateCodeVisitior(GeneratedCodeSettings settings)\n\t\t\t{\n\t\t\t\tif (settings == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"settings\");\n\t\t\t\tthis.settings = settings;\n\t\t\t}\n\n\t\t\tGeneratedCodeMember GetCodeMemberCategory(EntityDeclaration x)\n\t\t\t{\n\t\t\t\tbool isStatic = x.HasModifier(Modifiers.Static) || x.HasModifier(Modifiers.Const);\n\t\t\t\tif (x is FieldDeclaration)\n\t\t\t\t\treturn isStatic ? GeneratedCodeMember.StaticFields : GeneratedCodeMember.InstanceFields;\n\t\t\t\tif (x is IndexerDeclaration)\n\t\t\t\t\treturn GeneratedCodeMember.Indexer;\n\t\t\t\tif (x is PropertyDeclaration)\n\t\t\t\t\treturn isStatic ? GeneratedCodeMember.StaticProperties : GeneratedCodeMember.InstanceProperties;\n\t\t\t\tif (x is ConstructorDeclaration || x is DestructorDeclaration)\n\t\t\t\t\treturn GeneratedCodeMember.Constructors;\n\t\t\t\tif (x is MethodDeclaration)\n\t\t\t\t\treturn isStatic ? GeneratedCodeMember.StaticMethods : GeneratedCodeMember.InstanceMethods;\n\t\t\t\tif (x is OperatorDeclaration)\n\t\t\t\t\treturn GeneratedCodeMember.Operators;\n\t\t\t\tif (x is EventDeclaration || x is CustomEventDeclaration)\n\t\t\t\t\treturn isStatic ? GeneratedCodeMember.StaticEvents : GeneratedCodeMember.InstanceEvents;\n\n\t\t\t\tif (x is TypeDeclaration)\n\t\t\t\t\treturn GeneratedCodeMember.NestedTypes;\n\n\t\t\t\treturn GeneratedCodeMember.Unknown;\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration (TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration.ClassType == ClassType.Enum)\n\t\t\t\t\treturn;\n\t\t\t\tvar entities = new List<EntityDeclaration> (typeDeclaration.Members);\n\t\t\t\tentities.Sort ((x, y) => {\n\t\t\t\t\tint i1 = settings.CodeMemberOrder.IndexOf (GetCodeMemberCategory (x));\n\t\t\t\t\tint i2 = settings.CodeMemberOrder.IndexOf (GetCodeMemberCategory (y));\n\t\t\t\t\tif (i1 != i2)\n\t\t\t\t\t\treturn i1.CompareTo (i2);\n\t\t\t\t\tif (settings.SubOrderAlphabetical)\n\t\t\t\t\t\treturn (x.Name ?? \"\").CompareTo ((y.Name ?? \"\"));\n\t\t\t\t\treturn entities.IndexOf (x).CompareTo (entities.IndexOf (y));\n\t\t\t\t});\n\t\t\t\ttypeDeclaration.Members.Clear ();\n\t\t\t\ttypeDeclaration.Members.AddRange (entities);\n\n\t\t\t\tif (settings.GenerateCategoryComments) {\n\t\t\t\t\tvar curCat = GeneratedCodeMember.Unknown;\n\t\t\t\t\tforeach (var mem in entities) {\n\t\t\t\t\t\tif (mem.NextSibling is EntityDeclaration)\n\t\t\t\t\t\t\tmem.Parent.InsertChildAfter (mem, new NewLineNode (), Roles.NewLine);\n\n\t\t\t\t\t\tvar cat = GetCodeMemberCategory (mem);\n\t\t\t\t\t\tif (cat == curCat)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcurCat = cat;\n\t\t\t\t\t\tvar label = settings.GetCategoryLabel (curCat);\n\t\t\t\t\t\tif (string.IsNullOrEmpty (label))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar cmt = new Comment (\"\", CommentType.SingleLine);\n\t\t\t\t\t\tvar cmt2 = new Comment (\" \" + label, CommentType.SingleLine);\n\t\t\t\t\t\tvar cmt3 = new Comment (\"\", CommentType.SingleLine);\n\t\t\t\t\t\tmem.Parent.InsertChildBefore (mem, cmt, Roles.Comment);\n\t\t\t\t\t\tmem.Parent.InsertChildBefore (mem, cmt2, Roles.Comment);\n\t\t\t\t\t\tmem.Parent.InsertChildBefore (mem, cmt3, Roles.Comment);\n\t\t\t\t\t\tif (cmt.PrevSibling is EntityDeclaration)\n\t\t\t\t\t\t\tmem.Parent.InsertChildBefore (cmt, new NewLineNode (), Roles.NewLine);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic Lazy<GeneratedCodeSettings> defaultSettings = new Lazy<GeneratedCodeSettings>(\n\t\t\t() => new GeneratedCodeSettings() {\n\t\t\t\tCodeMemberOrder = new List<GeneratedCodeMember>() {\n\t\t\t\t\tGeneratedCodeMember.StaticFields,\n\t\t\t\t\tGeneratedCodeMember.InstanceFields,\n\t\t\t\t\tGeneratedCodeMember.StaticProperties,\n\t\t\t\t\tGeneratedCodeMember.InstanceProperties,\n\t\t\t\t\tGeneratedCodeMember.Indexer,\n\t\t\t\t\tGeneratedCodeMember.Constructors,\n\t\t\t\t\tGeneratedCodeMember.StaticMethods,\n\t\t\t\t\tGeneratedCodeMember.InstanceMethods,\n\t\t\t\t\tGeneratedCodeMember.StaticEvents,\n\t\t\t\t\tGeneratedCodeMember.InstanceEvents,\n\t\t\t\t\tGeneratedCodeMember.Operators,\n\t\t\t\t\tGeneratedCodeMember.NestedTypes\n\t\t\t\t},\n\t\t\t\tGenerateCategoryComments = true,\n\t\t\t\tSubOrderAlphabetical = true\n\t\t});\n\n\t\tpublic static GeneratedCodeSettings Default {\n\t\t\tget {\n\t\t\t\treturn defaultSettings.Value;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/Indent.cs",
    "content": "﻿// \n// Indent.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum IndentType\n\t{\n\t\tBlock,\n\t\tDoubleBlock,\n\t\tContinuation,\n\t\tAlignment,\n\t\tLabel,\n\t\tEmpty\n\t}\n\n\tpublic class Indent\n\t{\n\t\treadonly CloneableStack<IndentType> indentStack = new CloneableStack<IndentType>();\n\t\treadonly TextEditorOptions options;\n\t\tint curIndent;\n\t\tint extraSpaces;\n\t\tstring indentString;\n\n\t\tpublic int CurIndent {\n\t\t\tget {\n\t\t\t\treturn curIndent;\n\t\t\t}\n\t\t}\n\n\t\tpublic Indent(TextEditorOptions options)\n\t\t{\n\t\t\tthis.options = options;\n\t\t\tReset();\n\t\t}\n\n\t\tIndent(Indent engine)\n\t\t{\n\t\t\tthis.indentStack = engine.indentStack.Clone();\n\t\t\tthis.options = engine.options;\n\t\t\tthis.curIndent = engine.curIndent;\n\t\t\tthis.extraSpaces = engine.extraSpaces;\n\t\t\tthis.indentString = engine.indentString;\n\t\t}\n\n\t\tpublic Indent Clone()\n\t\t{\n\t\t\treturn new Indent(this);\n\t\t}\n\n\t\tpublic void Reset()\n\t\t{\n\t\t\tcurIndent = 0;\n\t\t\tindentString = \"\";\n\t\t\tindentStack.Clear();\n\t\t}\n\n\t\tpublic void Push(IndentType type)\n\t\t{\n\t\t\tindentStack.Push(type);\n\t\t\tcurIndent += GetIndent(type);\n\t\t\tUpdate();\n\t\t}\n\n\t\tpublic void Push(Indent indent)\n\t\t{\n\t\t\tforeach (var i in indent.indentStack)\n\t\t\t\tPush(i);\n\t\t}\n\n\t\tpublic void Pop()\n\t\t{\n\t\t\tcurIndent -= GetIndent(indentStack.Pop());\n\t\t\tUpdate();\n\t\t}\n\n\t\tpublic bool PopIf(IndentType type)\n\t\t{\n\t\t\tif (Count > 0 && Peek() == type)\n\t\t\t{\n\t\t\t\tPop();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void PopWhile(IndentType type)\n\t\t{\n\t\t\twhile (Count > 0 && Peek() == type)\n\t\t\t{\n\t\t\t\tPop();\n\t\t\t}\n\t\t}\n\n\t\tpublic bool PopTry()\n\t\t{\n\t\t\tif (Count > 0)\n\t\t\t{\n\t\t\t\tPop();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn indentStack.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic IndentType Peek()\n\t\t{\n\t\t\treturn indentStack.Peek();\n\t\t}\n\n\t\tint GetIndent(IndentType indentType)\n\t\t{\n\t\t\tswitch (indentType) {\n\t\t\t\tcase IndentType.Block:\n\t\t\t\t\treturn options.IndentSize;\n\t\t\t\tcase IndentType.DoubleBlock:\n\t\t\t\t\treturn options.IndentSize * 2;\n\t\t\t\tcase IndentType.Alignment:\n\t\t\t\tcase IndentType.Continuation:\n\t\t\t\t\treturn options.ContinuationIndent;\n\t\t\t\tcase IndentType.Label:\n\t\t\t\t\treturn options.LabelIndent;\n\t\t\t\tcase IndentType.Empty:\n\t\t\t\t\treturn 0;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\n\t\tvoid Update()\n\t\t{\n\t\t\tif (options.TabsToSpaces) {\n\t\t\t\tindentString = new string(' ', curIndent + ExtraSpaces);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tindentString = new string('\\t', curIndent / options.TabSize) + new string(' ', curIndent % options.TabSize) + new string(' ', ExtraSpaces);\n\t\t}\n\n\t\tpublic int ExtraSpaces {\n\t\t\tget {\n\t\t\t\treturn extraSpaces;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value < 0)\n\t\t\t\t\tthrow new ArgumentOutOfRangeException(\"ExtraSpaces >= 0 but was \" + value);\n\t\t\t\textraSpaces = value;\n\t\t\t\tUpdate();\n\t\t\t}\n\t\t}\n\n\n\t\tpublic string IndentString {\n\t\t\tget {\n\t\t\t\treturn indentString;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"[Indent: curIndent={0}]\", curIndent);\n\t\t}\n\n\t\tpublic Indent GetIndentWithoutSpace ()\n\t\t{\n\t\t\tvar result = new Indent(options);\n\t\t\tforeach (var i in indentStack)\n\t\t\t\t\tresult.Push(i);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static Indent ConvertFrom(string indentString, Indent correctIndent, TextEditorOptions options = null)\n\t\t{\n\t\t\toptions = options ?? TextEditorOptions.Default;\n\t\t\tvar result = new Indent(options);\n\n\t\t\tvar indent = string.Concat(indentString.Where(c => c == ' ' || c == '\\t'));\n\t\t\tvar indentTypes = new Stack<IndentType>(correctIndent.indentStack);\n\n\t\t\tforeach (var _ in indent.TakeWhile(c => c == '\\t'))\n\t\t\t{\n\t\t\t\tif (indentTypes.Count > 0)\n\t\t\t\t\tresult.Push(indentTypes.Pop());\n\t\t\t\telse\n\t\t\t\t\tresult.Push(IndentType.Continuation);\n\t\t\t}\n\n\t\t\tresult.ExtraSpaces = indent\n\t\t\t\t.SkipWhile(c => c == '\\t')\n\t\t\t\t.TakeWhile(c => c == ' ')\n\t\t\t\t.Count();\n\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic void RemoveAlignment()\n\t\t{\n\t\t\tExtraSpaces = 0;\n\t\t\tif (Count > 0 && Peek() == IndentType.Alignment)\n\t\t\t\tPop();\n\t\t}\n\n\t\tpublic void SetAlignment(int i, bool forceSpaces = false)\n\t\t{\n\t\t\tvar alignChars = Math.Max(0, i);\n\t\t\tif (forceSpaces) {\n\t\t\t\tExtraSpaces = alignChars;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tRemoveAlignment();\n\t\t\tPush(IndentType.Alignment);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/TextEditorOptions.cs",
    "content": "﻿// \n// TextEditorOptions.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// The text editor options class holds basic information about the text editor settings that influences code generation and formatting beside\n\t/// the CSharpFormattingOptions.\n\t/// </summary>\n\tpublic class TextEditorOptions\n\t{\n\t\tpublic static readonly TextEditorOptions Default = new TextEditorOptions ();\n\n\t\t/// <summary>\n\t\t/// Gets or sets a value indicating if tabs need to be replaced by spaces. If that is true, all indenting will be done with spaces only,\n\t\t/// otherwise the indenting will start with tabs.\n\t\t/// </summary>\n\t\tpublic bool TabsToSpaces {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the size of the tab chacter as spaces.\n\t\t/// </summary>\n\t\tpublic int TabSize {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the size of a single indent as spaces.\n\t\t/// </summary>\n\t\tpublic int IndentSize {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the continuation indent. A continuation indent is the indent that will be put after an embedded statement that is no block.\n\t\t/// </summary>\n\t\tpublic int ContinuationIndent {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the label indent. A label indent is the indent that will be put before an label.\n\t\t/// (Note: it may be negative -IndentSize would cause that labels are unindented)\n\t\t/// </summary>\n\t\tpublic int LabelIndent {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the eol marker.\n\t\t/// </summary>\n\t\tpublic string EolMarker {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// If true blank lines will be indented up to the indent level, otherwise blank lines will have the length 0.\n\t\t/// </summary>\n\t\tpublic bool IndentBlankLines {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the length of the desired line length. The formatting engine will wrap at wrap points set to Wrapping.WrapIfTooLong if the line length is too long.\n\t\t/// 0 means do not wrap.\n\t\t/// </summary>\n\t\tpublic int WrapLineLength {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic TextEditorOptions()\n\t\t{\n\t\t\tTabsToSpaces = false;\n\t\t\tTabSize = 4;\n\t\t\tIndentSize = 4;\n\t\t\tContinuationIndent = 4;\n\t\t\tWrapLineLength = 0;\n\t\t\tEolMarker = Environment.NewLine;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" DefaultTargets=\"Build\">\r\n  <PropertyGroup>\r\n    <ProjectGuid>{53DCA265-3C3C-42F9-B647-F72BA678122B}</ProjectGuid>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.CSharp</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.CSharp</AssemblyName>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>\r\n    <NoStdLib>False</NoStdLib>\r\n    <WarningLevel>4</WarningLevel>\r\n    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>\r\n    <ProductVersion>8.0.30703</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <SignAssembly>true</SignAssembly>\r\n    <AssemblyOriginatorKeyFile>..\\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>\r\n    <DelaySign>False</DelaySign>\r\n    <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>\r\n    <DocumentationFile>..\\bin\\$(Configuration)\\ICSharpCode.NRefactory.CSharp.xml</DocumentationFile>\r\n    <NoWarn>1591,1587,1570</NoWarn>\r\n    <OutputPath>..\\bin\\$(Configuration)\\</OutputPath>\r\n    <NoWin32Manifest>False</NoWin32Manifest>\r\n    <IntermediateOutputPath>obj\\$(Configuration)\\</IntermediateOutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n    <RegisterForComInterop>False</RegisterForComInterop>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <BaseAddress>4194304</BaseAddress>\r\n    <FileAlignment>4096</FileAlignment>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE;FULL_AST;NET_4_0</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE;FULL_AST;NET_4_0</DefineConstants>\r\n    <BaseIntermediateOutputPath>obj\\</BaseIntermediateOutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <OutputPath>..\\bin\\Release\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <OutputPath>..\\bin\\Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE;FULL_AST;NET_4_0;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Release' \">\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE;FULL_AST;NET_4_0;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Release\\</OutputPath>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\" />\r\n    <Reference Include=\"System.Xml\" />\r\n    <Reference Include=\"System.Xml.Linq\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"Analysis\\ControlFlow.cs\" />\r\n    <Compile Include=\"Analysis\\DefiniteAssignmentAnalysis.cs\" />\r\n    <Compile Include=\"Analysis\\ReachabilityAnalysis.cs\" />\r\n    <Compile Include=\"Analysis\\SemanticHighlightingVisitor.cs\" />\r\n    <Compile Include=\"Ast\\AstNode.cs\" />\r\n    <Compile Include=\"Ast\\AstNodeCollection.cs\" />\r\n    <Compile Include=\"Ast\\AstType.cs\" />\r\n    <Compile Include=\"Ast\\DocumentationReference.cs\" />\r\n    <Compile Include=\"Ast\\IdentifierExpressionBackreference.cs\" />\r\n    <Compile Include=\"Ast\\SyntaxExtensions.cs\" />\r\n    <Compile Include=\"Ast\\SyntaxTree.cs\" />\r\n    <Compile Include=\"Ast\\ComposedType.cs\" />\r\n    <Compile Include=\"Ast\\CSharpModifierToken.cs\" />\r\n    <Compile Include=\"Ast\\CSharpTokenNode.cs\" />\r\n    <Compile Include=\"Ast\\CSharpUtil.cs\" />\r\n    <Compile Include=\"Ast\\DepthFirstAstVisitor.cs\" />\r\n    <Compile Include=\"Ast\\ErrorNode.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\AnonymousMethodExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\AnonymousTypeCreateExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\ArrayCreateExpression.cs\">\r\n      <DependentUpon>ArrayInitializerExpression.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"Ast\\Expressions\\ArrayInitializerExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\AsExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\AssignmentExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\BaseReferenceExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\BinaryOperatorExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\CastExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\CheckedExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\ConditionalExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\DefaultValueExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\DirectionExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\Expression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\IdentifierExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\IndexerExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\InvocationExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\IsExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\LambdaExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\MemberReferenceExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\NamedArgumentExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\NamedExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\NullReferenceExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\ObjectCreateExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\ParenthesizedExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\PointerReferenceExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\PrimitiveExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\QueryExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\SizeOfExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\StackAllocExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\ThisReferenceExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\TypeOfExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\TypeReferenceExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\UnaryOperatorExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\UncheckedExpression.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\UndocumentedExpression.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\Attribute.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\AttributeSection.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\Comment.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\Constraint.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\DelegateDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\ExternAliasDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\NamespaceDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\TypeDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\TypeParameterDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\UsingAliasDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\UsingDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\IAstVisitor.cs\" />\r\n    <Compile Include=\"Ast\\Identifier.cs\" />\r\n    <Compile Include=\"Ast\\MemberType.cs\" />\r\n    <Compile Include=\"Ast\\Modifiers.cs\" />\r\n    <Compile Include=\"Ast\\NodeType.cs\" />\r\n    <Compile Include=\"Ast\\ObservableAstVisitor.cs\" />\r\n    <Compile Include=\"Ast\\PrimitiveType.cs\" />\r\n    <Compile Include=\"Ast\\SimpleType.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\BlockStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\BreakStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\CheckedStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\ContinueStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\DoWhileStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\EmptyStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\ExpressionStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\FixedStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\ForeachStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\ForStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\GotoStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\IfElseStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\LabelStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\LockStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\ReturnStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\Statement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\SwitchStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\ThrowStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\TryCatchStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\UncheckedStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\UnsafeStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\UsingStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\VariableDeclarationStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\WhileStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\YieldBreakStatement.cs\" />\r\n    <Compile Include=\"Ast\\Statements\\YieldReturnStatement.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\Accessor.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\EntityDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\ConstructorDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\DestructorDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\EnumMemberDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\EventDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\FieldDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\FixedFieldDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\FixedVariableInitializer.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\IndexerDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\MethodDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\OperatorDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\ParameterDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\PropertyDeclaration.cs\" />\r\n    <Compile Include=\"Ast\\TypeMembers\\VariableInitializer.cs\" />\r\n    <Compile Include=\"CSharpProjectContent.cs\" />\r\n    <Compile Include=\"Formatter\\CSharpFormattingOptions.cs\" />\r\n    <Compile Include=\"Formatter\\Indent.cs\" />\r\n    <Compile Include=\"OutputVisitor\\CodeDomConvertVisitor.cs\" />\r\n    <Compile Include=\"OutputVisitor\\CSharpAmbience.cs\" />\r\n    <Compile Include=\"OutputVisitor\\InsertMissingTokensDecorator.cs\" />\r\n    <Compile Include=\"OutputVisitor\\InsertParenthesesVisitor.cs\" />\r\n    <Compile Include=\"OutputVisitor\\InsertRequiredSpacesDecorator.cs\" />\r\n    <Compile Include=\"OutputVisitor\\CSharpOutputVisitor.cs\" />\r\n    <Compile Include=\"OutputVisitor\\InsertSpecialsDecorator.cs\" />\r\n    <Compile Include=\"OutputVisitor\\ITokenWriter.cs\" />\r\n    <Compile Include=\"OutputVisitor\\TextWriterOutputFormatter.cs\" />\r\n    <Compile Include=\"Parser\\CompilerSettings.cs\" />\r\n    <Compile Include=\"Parser\\CSharpParser.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\anonymous.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\argument.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\assembly.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\assign.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\async.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\attribute.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\cfold.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\class.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\codegen.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\complete.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\const.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\constant.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\context.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\convert.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\CryptoConvert.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\cs-parser.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\cs-tokenizer.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\decl.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\delegate.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\doc.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\driver.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\dynamic.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\ecore.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\enum.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\eval.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\expression.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\field.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\flowanalysis.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\generic.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\import.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\iterators.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\lambda.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\linq.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\literal.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\location.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\membercache.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\method.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\modifiers.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\MonoSymbolFile.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\MonoSymbolTable.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\MonoSymbolWriter.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\namespace.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\nullable.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\outline.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\parameter.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\pending.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\property.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\reflection.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\report.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\statement.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\support.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\symbolwriter.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\typemanager.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\typespec.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\visit.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"QueryExpressionExpander.cs\" />\r\n    <Compile Include=\"Refactoring\\DocumentScript.cs\" />\r\n    <Compile Include=\"Refactoring\\UsingHelper.cs\" />\r\n    <Compile Include=\"Refactoring\\LambdaHelper.cs\" />\r\n    <Compile Include=\"Refactoring\\PatternHelper.cs\" />\r\n    <Compile Include=\"Refactoring\\RefactoringAstHelper.cs\" />\r\n    <Compile Include=\"Refactoring\\RefactoringContext.cs\" />\r\n    <Compile Include=\"Refactoring\\Script.cs\" />\r\n    <Compile Include=\"Refactoring\\TypeSystemAstBuilder.cs\" />\r\n    <Compile Include=\"Refactoring\\VariableReferenceGraph.cs\" />\r\n    <Compile Include=\"Resolver\\CompositeResolveVisitorNavigator.cs\" />\r\n    <Compile Include=\"Resolver\\AwaitResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\DynamicInvocationResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\DynamicMemberResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\CSharpConversions.cs\" />\r\n    <Compile Include=\"Resolver\\CSharpAstResolver.cs\" />\r\n    <Compile Include=\"Resolver\\CSharpInvocationResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\CSharpOperators.cs\" />\r\n    <Compile Include=\"Resolver\\CSharpResolver.cs\" />\r\n    <Compile Include=\"Resolver\\DetectSkippableNodesNavigator.cs\" />\r\n    <Compile Include=\"Resolver\\CastResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\FindReferencedEntities.cs\" />\r\n    <Compile Include=\"Resolver\\FindReferences.cs\" />\r\n    <Compile Include=\"Resolver\\FindReferenceSearchScope.cs\" />\r\n    <Compile Include=\"Resolver\\IResolveVisitorNavigator.cs\" />\r\n    <Compile Include=\"Resolver\\LambdaResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\Log.cs\" />\r\n    <Compile Include=\"Resolver\\MemberLookup.cs\" />\r\n    <Compile Include=\"Resolver\\MethodGroupResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\NodeListResolveVisitorNavigator.cs\" />\r\n    <Compile Include=\"Resolver\\OverloadResolution.cs\" />\r\n    <Compile Include=\"Resolver\\OverloadResolutionErrors.cs\" />\r\n    <Compile Include=\"Resolver\\RenameCallbackArguments.cs\" />\r\n    <Compile Include=\"Resolver\\ResolveAtLocation.cs\" />\r\n    <Compile Include=\"Resolver\\ResolveVisitor.cs\" />\r\n    <Compile Include=\"Resolver\\TypeInference.cs\" />\r\n    <Compile Include=\"Completion\\ICompletionDataFactory.cs\" />\r\n    <Compile Include=\"Completion\\IParameterCompletionDataFactory.cs\" />\r\n    <Compile Include=\"NameLookupMode.cs\" />\r\n    <Compile Include=\"TypeSystem\\AliasNamespaceReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\AttributeTypeReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\ConstantValues.cs\" />\r\n    <Compile Include=\"TypeSystem\\CSharpAssembly.cs\" />\r\n    <Compile Include=\"TypeSystem\\CSharpAttribute.cs\" />\r\n    <Compile Include=\"TypeSystem\\CSharpDocumentationComment.cs\" />\r\n    <Compile Include=\"TypeSystem\\CSharpUnresolvedFile.cs\" />\r\n    <Compile Include=\"TypeSystem\\CSharpUnresolvedTypeDefinition.cs\" />\r\n    <Compile Include=\"TypeSystem\\CSharpTypeResolveContext.cs\" />\r\n    <Compile Include=\"TypeSystem\\ResolvedUsingScope.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeOrNamespaceReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\MemberTypeOrNamespaceReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\SimpleTypeOrNamespaceReference.cs\" />\r\n    <Compile Include=\"TypeSystem\\MethodTypeParameterWithInheritedConstraints.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeSystemConvertVisitor.cs\" />\r\n    <Compile Include=\"TypeSystem\\UsingScope.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\PreProcessorDirective.cs\" />\r\n    <Compile Include=\"Ast\\Expressions\\ErrorExpression.cs\" />\r\n    <Compile Include=\"Completion\\CompletionDataWrapper.cs\" />\r\n    <Compile Include=\"Completion\\CSharpCompletionEngine.cs\" />\r\n    <Compile Include=\"Completion\\CSharpCompletionEngineBase.cs\" />\r\n    <Compile Include=\"Completion\\CSharpParameterCompletionEngine.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\module.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\settings.cs\" />\r\n    <Compile Include=\"Parser\\mcs\\SourceMethodBuilder.cs\" />\r\n    <Compile Include=\"Ast\\TokenRole.cs\" />\r\n    <Compile Include=\"Ast\\Roles.cs\" />\r\n    <Compile Include=\"Refactoring\\BaseRefactoringContext.cs\" />\r\n    <Compile Include=\"Refactoring\\CodeIssue.cs\" />\r\n    <Compile Include=\"Refactoring\\CodeAction.cs\" />\r\n    <Compile Include=\"Refactoring\\ContextActionAttribute.cs\" />\r\n    <Compile Include=\"Refactoring\\IssueAttribute.cs\" />\r\n    <Compile Include=\"Formatter\\TextEditorOptions.cs\" />\r\n    <Compile Include=\"Formatter\\GeneratedCodeSettings.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\NewLineNode.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\WhitespaceNode.cs\" />\r\n    <Compile Include=\"Ast\\GeneralScope\\TextNode.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingOptionsFactory.cs\" />\r\n    <Compile Include=\"Completion\\ICompletionContextProvider.cs\" />\r\n    <Compile Include=\"Refactoring\\NamingHelper.cs\" />\r\n    <Compile Include=\"Parser\\SeekableStreamReader.cs\" />\r\n    <Compile Include=\"Refactoring\\LocalReferenceFinder.cs\" />\r\n    <Compile Include=\"Resolver\\AliasTypeResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\AliasNamespaceResolveResult.cs\" />\r\n    <Compile Include=\"Resolver\\ReducedExtensionMethod.cs\" />\r\n    <Compile Include=\"Formatter\\CSharpFormatter.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingVisitor.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingVisitor_TypeMembers.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingVisitor_Global.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingVisitor_Statements.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingVisitor_Expressions.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingChanges.cs\" />\r\n    <Compile Include=\"IntroduceQueryExpressions.cs\" />\r\n    <Compile Include=\"CombineQueryExpressions.cs\" />\r\n    <Compile Include=\"Refactoring\\CodeIssueProvider.cs\" />\r\n    <Compile Include=\"Refactoring\\CodeActionProvider.cs\" />\r\n    <Compile Include=\"Refactoring\\CommonSubIssues.cs\" />\r\n    <Compile Include=\"PatternMatching\\AnyType.cs\" />\r\n    <Compile Include=\"Analysis\\NullValueAnalysis.cs\" />\r\n    <Compile Include=\"Analysis\\NullValueStatus.cs\" />\r\n    <Compile Include=\"Analysis\\DeclarationSpace\\LocalDeclarationSpace.cs\" />\r\n    <Compile Include=\"Analysis\\DeclarationSpace\\LocalDeclarationSpaceVisitor.cs\" />\r\n    <Compile Include=\"Refactoring\\WordParser.cs\" />\r\n    <Compile Include=\"Refactoring\\TypeGuessing.cs\" />\r\n    <Compile Include=\"Refactoring\\FormatStringHelper.cs\" />\r\n    <Compile Include=\"IndentEngine\\CSharpIndentEngine.cs\" />\r\n    <Compile Include=\"IndentEngine\\CacheIndentEngine.cs\" />\r\n    <Compile Include=\"IndentEngine\\IDocumentIndentEngine.cs\" />\r\n    <Compile Include=\"IndentEngine\\IStateMachineIndentEngine.cs\" />\r\n    <Compile Include=\"IndentEngine\\IndentState.cs\" />\r\n    <Compile Include=\"IndentEngine\\TextPasteIndentEngine.cs\" />\r\n    <Compile Include=\"IndentEngine\\NullIStateMachineIndentEngine.cs\" />\r\n    <Compile Include=\"Refactoring\\CodeGenerationService.cs\" />\r\n    <Compile Include=\"Formatter\\FormattingVisitor_Query.cs\" />\r\n    <Compile Include=\"Analysis\\AnnotationNames.cs\" />\r\n    <Compile Include=\"Formatter\\ConstructFixer.cs\" />\r\n    <Compile Include=\"Util\\CloneableStack.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.Targets\" />\r\n  <ItemGroup />\r\n  <ProjectExtensions>\r\n    <MonoDevelop>\r\n      <Properties>\r\n        <Policies>\r\n          <TextStylePolicy TabsToSpaces=\"False\" EolMarker=\"Unix\" inheritsSet=\"VisualStudio\" inheritsScope=\"text/plain\" scope=\"text/plain\" />\r\n          <TextStylePolicy FileWidth=\"120\" TabsToSpaces=\"False\" EolMarker=\"Unix\" inheritsSet=\"VisualStudio\" inheritsScope=\"text/plain\" scope=\"text/x-csharp\" />\r\n          <CSharpFormattingPolicy IndentSwitchBody=\"True\" BeforeMethodDeclarationParentheses=\"False\" BeforeMethodCallParentheses=\"False\" BeforeConstructorDeclarationParentheses=\"False\" BeforeDelegateDeclarationParentheses=\"False\" NewParentheses=\"False\" inheritsSet=\"Mono\" inheritsScope=\"text/x-csharp\" scope=\"text/x-csharp\" />\r\n          <TextStylePolicy inheritsSet=\"null\" scope=\"text/x-jay\" />\r\n        </Policies>\r\n      </Properties>\r\n    </MonoDevelop>\r\n  </ProjectExtensions>\r\n  <ItemGroup>\r\n    <None Include=\"Parser\\mcs\\cs-parser.jay\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Folder Include=\"PatternMatching\\\" />\r\n    <Folder Include=\"IndentEngine\\\" />\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/CSharpIndentEngine.cs",
    "content": "﻿//\n// CSharpIndentEngine.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Editor;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t///     Indentation engine based on a state machine.\n\t///     Supports only pushing new chars to the end.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents the context for transitions between <see cref=\"IndentState\"/>.\n\t///     Delegates the responsibility for pushing a new char to the current \n\t///     state and changes between states depending on the pushed chars.\n\t/// </remarks>\n\tpublic class CSharpIndentEngine : IStateMachineIndentEngine\n\t{\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t///     Formatting options.\n\t\t/// </summary>\n\t\tinternal readonly CSharpFormattingOptions formattingOptions;\n\n\t\t/// <summary>\n\t\t///     Text editor options.\n\t\t/// </summary>\n\t\tinternal readonly TextEditorOptions textEditorOptions;\n\n\t\t/// <summary>\n\t\t///     A readonly reference to the document that's parsed\n\t\t///     by the engine.\n\t\t/// </summary>\n\t\tinternal readonly IDocument document;\n\n\t\t/// <summary>\n\t\t///     Represents the new line character.\n\t\t/// </summary>\n\t\tinternal readonly char newLineChar;\n\n\t\t/// <summary>\n\t\t///     The current indentation state.\n\t\t/// </summary>\n\t\tinternal IndentState currentState;\n\n\t\t/// <summary>\n\t\t///     Stores conditional symbols of #define directives.\n\t\t/// </summary>\n\t\tinternal HashSet<string> conditionalSymbols;\n\n\t\t/// <summary>\n\t\t///     Stores custom conditional symbols.\n\t\t/// </summary>\n\t\tinternal HashSet<string> customConditionalSymbols;\n\n\t\t/// <summary>\n\t\t///     Stores the results of evaluations of the preprocessor if/elif directives \n\t\t///     in the current block (between #if and #endif).\n\t\t/// </summary>\n\t\tinternal CloneableStack<bool> ifDirectiveEvalResults = new CloneableStack<bool> ();\n\n\t\t/// <summary>\n\t\t///     Stores the indentation levels of the if directives in the current block.\n\t\t/// </summary>\n\t\tinternal CloneableStack<Indent> ifDirectiveIndents = new CloneableStack<Indent>();\n\n\t\t/// <summary>\n\t\t///     Stores the last sequence of characters that can form a\n\t\t///     valid keyword or variable name.\n\t\t/// </summary>\n\t\tinternal StringBuilder wordToken;\n\n\t\t/// <summary>\n\t\t///     Stores the previous sequence of chars that formed a\n\t\t///     valid keyword or variable name.\n\t\t/// </summary>\n\t\tinternal string previousKeyword;\n\n\t\t#endregion\n\n\t\t#region IDocumentIndentEngine\n\n\t\t/// <inheritdoc />\n\t\tpublic IDocument Document\n\t\t{\n\t\t\tget { return document; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string ThisLineIndent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\t// OPTION: IndentBlankLines\n\t\t\t\t// remove the indentation of this line if isLineStart is true\n//\t\t\t\tif (!textEditorOptions.IndentBlankLines && isLineStart)\n//\t\t\t\t{\n//\t\t\t\t\treturn string.Empty;\n//\t\t\t\t}\n\n\t\t\t\treturn currentState.ThisLineIndent.IndentString;\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string NextLineIndent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn currentState.NextLineIndent.IndentString;\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string CurrentIndent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn currentIndent.ToString();\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\t/// <remarks>\n\t\t///     This is set depending on the current <see cref=\"Location\"/> and\n\t\t///     can change its value until the <see cref=\"newLineChar\"/> char is\n\t\t///     pushed. If this is true, that doesn't necessarily mean that the\n\t\t///     current line has an incorrect indent (this can be determined\n\t\t///     only at the end of the current line).\n\t\t/// </remarks>\n\t\tpublic bool NeedsReindent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\t// return true if it's the first column of the line and it has an indent\n\t\t\t\tif (Location.Column == 1)\n\t\t\t\t{\n\t\t\t\t\treturn ThisLineIndent.Length > 0;\n\t\t\t\t}\n\n\t\t\t\t// ignore incorrect indentations when there's only ws on this line\n\t\t\t\tif (isLineStart)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn ThisLineIndent != CurrentIndent.ToString();\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic int Offset\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn offset;\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic TextLocation Location\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new TextLocation(line, column);\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic bool EnableCustomIndentLevels\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Fields\n\n\t\t/// <summary>\n\t\t///    Represents the number of pushed chars.\n\t\t/// </summary>\n\t\tinternal int offset = 0;\n\n\t\t/// <summary>\n\t\t///    The current line number.\n\t\t/// </summary>\n\t\tinternal int line = 1;\n\n\t\t/// <summary>\n\t\t///    The current column number.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///    One char can take up multiple columns (e.g. \\t).\n\t\t/// </remarks>\n\t\tinternal int column = 1;\n\n\t\t/// <summary>\n\t\t///    True if <see cref=\"char.IsWhiteSpace(char)\"/> is true for all\n\t\t///    chars at the current line.\n\t\t/// </summary>\n\t\tinternal bool isLineStart = true;\n\n\t\t/// <summary>\n\t\t///    True if <see cref=\"isLineStart\"/> was true before the current\n\t\t///    <see cref=\"wordToken\"/>.\n\t\t/// </summary>\n\t\tinternal bool isLineStartBeforeWordToken = true;\n\n\t\t/// <summary>\n\t\t///    Current char that's being pushed.\n\t\t/// </summary>\n\t\tinternal char currentChar = '\\0';\n\n\t\t/// <summary>\n\t\t///    Last non-whitespace char that has been pushed.\n\t\t/// </summary>\n\t\tinternal char previousChar = '\\0';\n\n\t\t/// <summary>\n\t\t///    Previous new line char\n\t\t/// </summary>\n\t\tinternal char previousNewline = '\\0';\n\n\t\t/// <summary>\n\t\t///    Current indent level on this line.\n\t\t/// </summary>\n\t\tinternal StringBuilder currentIndent = new StringBuilder();\n\n\t\t/// <summary>\n\t\t///     True if this line began in <see cref=\"VerbatimStringState\"/>.\n\t\t/// </summary>\n\t\tinternal bool lineBeganInsideVerbatimString = false;\n\n\t\t/// <summary>\n\t\t///     True if this line began in <see cref=\"MultiLineCommentState\"/>.\n\t\t/// </summary>\n\t\tinternal bool lineBeganInsideMultiLineComment = false;\n\n\t\t#endregion\n\n\t\t#region Constructors\n\n\t\t/// <summary>\n\t\t///     Creates a new CSharpIndentEngine instance.\n\t\t/// </summary>\n\t\t/// <param name=\"document\">\n\t\t///     An instance of <see cref=\"IDocument\"/> which is being parsed.\n\t\t/// </param>\n\t\t/// <param name=\"formattingOptions\">\n\t\t///     C# formatting options.\n\t\t/// </param>\n\t\t/// <param name=\"textEditorOptions\">\n\t\t///    Text editor options for indentation.\n\t\t/// </param>\n\t\tpublic CSharpIndentEngine(IDocument document, TextEditorOptions textEditorOptions, CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\tthis.formattingOptions = formattingOptions;\n\t\t\tthis.textEditorOptions = textEditorOptions;\n\t\t\tthis.document = document;\n\n\t\t\tthis.currentState = new GlobalBodyState(this);\n\n\t\t\tthis.conditionalSymbols = new HashSet<string>();\n\t\t\tthis.customConditionalSymbols = new HashSet<string>();\n\t\t\tthis.wordToken = new StringBuilder();\n\t\t\tthis.previousKeyword = string.Empty;\n\t\t\tthis.newLineChar = textEditorOptions.EolMarker[0];\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Creates a new CSharpIndentEngine instance from the given prototype.\n\t\t/// </summary>\n\t\t/// <param name=\"prototype\">\n\t\t///     An CSharpIndentEngine instance.\n\t\t/// </param>\n\t\tpublic CSharpIndentEngine(CSharpIndentEngine prototype)\n\t\t{\n\t\t\tthis.formattingOptions = prototype.formattingOptions;\n\t\t\tthis.textEditorOptions = prototype.textEditorOptions;\n\t\t\tthis.document = prototype.document;\n\n\t\t\tthis.newLineChar = prototype.newLineChar;\n\t\t\tthis.currentState = prototype.currentState.Clone(this);\n\t\t\tthis.conditionalSymbols = new HashSet<string>(prototype.conditionalSymbols);\n\t\t\tthis.customConditionalSymbols = new HashSet<string>(prototype.customConditionalSymbols);\n\n\t\t\tthis.wordToken = new StringBuilder(prototype.wordToken.ToString());\n\t\t\tthis.previousKeyword = string.Copy(prototype.previousKeyword);\n\n\t\t\tthis.offset = prototype.offset;\n\t\t\tthis.line = prototype.line;\n\t\t\tthis.column = prototype.column;\n\t\t\tthis.isLineStart = prototype.isLineStart;\n\t\t\tthis.isLineStartBeforeWordToken = prototype.isLineStartBeforeWordToken;\n\t\t\tthis.currentChar = prototype.currentChar;\n\t\t\tthis.previousChar = prototype.previousChar;\n\t\t\tthis.previousNewline = prototype.previousNewline;\n\t\t\tthis.currentIndent = new StringBuilder(prototype.CurrentIndent.ToString());\n\t\t\tthis.lineBeganInsideMultiLineComment = prototype.lineBeganInsideMultiLineComment;\n\t\t\tthis.lineBeganInsideVerbatimString = prototype.lineBeganInsideVerbatimString;\n\t\t\tthis.ifDirectiveEvalResults = prototype.ifDirectiveEvalResults.Clone();\n\t\t\tthis.ifDirectiveIndents = prototype.ifDirectiveIndents.Clone();\n\n\t\t\tthis.EnableCustomIndentLevels = prototype.EnableCustomIndentLevels;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IClonable\n\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tIDocumentIndentEngine IDocumentIndentEngine.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\tpublic IStateMachineIndentEngine Clone()\n\t\t{\n\t\t\treturn new CSharpIndentEngine(this);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Methods\n\n\t\t/// <inheritdoc />\n\t\tpublic void Push(char ch)\n\t\t{\n\t\t\t// append this char to the wordbuf if it can form a valid keyword, otherwise check\n\t\t\t// if the last sequence of chars form a valid keyword and reset the wordbuf.\n\t\t\tif ((wordToken.Length == 0 ? char.IsLetter(ch) : char.IsLetterOrDigit(ch)) || ch == '_')\n\t\t\t{\n\t\t\t\twordToken.Append(ch);\n\t\t\t}\n\t\t\telse if (wordToken.Length > 0)\n\t\t\t{\n\t\t\t\tcurrentState.CheckKeyword(wordToken.ToString());\n\t\t\t\tpreviousKeyword = wordToken.ToString();\n\t\t\t\twordToken.Length = 0;\n\t\t\t\tisLineStartBeforeWordToken = false;\n\t\t\t}\n\n\t\t\tvar isNewLine = NewLine.IsNewLine(ch);\n\t\t\tif (!isNewLine) {\n\t\t\t\tcurrentState.Push(currentChar = ch);\n\t\t\t\toffset++;\n\t\t\t\tpreviousNewline = '\\0';\n\t\t\t\t// ignore whitespace and newline chars\n\t\t\t\tvar isWhitespace = currentChar == ' ' || currentChar == '\\t';\n\t\t\t\tif (!isWhitespace)\n\t\t\t\t{\n\t\t\t\t\tpreviousChar = currentChar;\n\t\t\t\t\tisLineStart = false;\n\t\t\t\t}\n\n\t\t\t\tif (isLineStart)\n\t\t\t\t{\n\t\t\t\t\tcurrentIndent.Append(ch);\n\t\t\t\t}\n\n\t\t\t\tif (ch == '\\t')\n\t\t\t\t{\n\t\t\t\t\tvar nextTabStop = (column - 1 + textEditorOptions.IndentSize) / textEditorOptions.IndentSize;\n\t\t\t\t\tcolumn = 1 + nextTabStop * textEditorOptions.IndentSize;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcolumn++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (ch == NewLine.LF && previousNewline == NewLine.CR) {\n\t\t\t\t\toffset++;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcurrentState.Push(currentChar = newLineChar);\n\t\t\t\toffset++;\n\n\t\t\t\tpreviousNewline = ch;\n\t\t\t\t// there can be more than one chars that determine the EOL,\n\t\t\t\t// the engine uses only one of them defined with newLineChar\n\t\t\t\tif (currentChar != newLineChar)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcurrentIndent.Length = 0;\n\t\t\t\tisLineStart = true;\n\t\t\t\tisLineStartBeforeWordToken = true;\n\t\t\t\tcolumn = 1;\n\t\t\t\tline++;\n\n\t\t\t\tlineBeganInsideMultiLineComment = IsInsideMultiLineComment;\n\t\t\t\tlineBeganInsideVerbatimString = IsInsideVerbatimString;\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic void Reset()\n\t\t{\n\t\t\tcurrentState = new GlobalBodyState(this);\n\t\t\tconditionalSymbols.Clear();\n\t\t\tifDirectiveEvalResults.Clear();\n\t\t\tifDirectiveIndents.Clear();\n\n\t\t\toffset = 0;\n\t\t\tline = 1;\n\t\t\tcolumn = 1;\n\t\t\tisLineStart = true;\n\t\t\tcurrentChar = '\\0';\n\t\t\tpreviousChar = '\\0';\n\t\t\tcurrentIndent.Length = 0;\n\t\t\tlineBeganInsideMultiLineComment = false;\n\t\t\tlineBeganInsideVerbatimString = false;\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic void Update(int offset)\n\t\t{\n\t\t\tif (Offset > offset)\n\t\t\t{\n\t\t\t\tReset();\n\t\t\t}\n\n\t\t\twhile (Offset < offset)\n\t\t\t{\n\t\t\t\tPush(Document.GetCharAt(Offset));\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Defines the conditional symbol.\n\t\t/// </summary>\n\t\t/// <param name=\"defineSymbol\">The symbol to define.</param>\n\t\tpublic void DefineSymbol(string defineSymbol)\n\t\t{\n\t\t\tif (!customConditionalSymbols.Contains(defineSymbol))\n\t\t\t\tcustomConditionalSymbols.Add(defineSymbol);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Removes the symbol.\n\t\t/// </summary>\n\t\t/// <param name=\"undefineSymbol\">The symbol to undefine.</param>\n\t\tpublic void RemoveSymbol(string undefineSymbol)\n\t\t{\n\t\t\tif (customConditionalSymbols.Contains(undefineSymbol))\n\t\t\t\tcustomConditionalSymbols.Remove(undefineSymbol);\n\t\t}\n\t\t#endregion\n\n\t\t#region IStateMachineIndentEngine\n\n\t\tpublic bool IsInsidePreprocessorDirective\n\t\t{\n\t\t\tget { return currentState is PreProcessorState; }\n\t\t}\n\n\t\tpublic bool IsInsidePreprocessorComment\n\t\t{\n\t\t\tget { return currentState is PreProcessorCommentState; }\n\t\t}\n\n\t\tpublic bool IsInsideStringLiteral\n\t\t{\n\t\t\tget { return currentState is StringLiteralState; }\n\t\t}\n\n\t\tpublic bool IsInsideVerbatimString\n\t\t{\n\t\t\tget { return currentState is VerbatimStringState; }\n\t\t}\n\n\t\tpublic bool IsInsideCharacter\n\t\t{\n\t\t\tget { return currentState is CharacterState; }\n\t\t}\n\n\t\tpublic bool IsInsideString\n\t\t{\n\t\t\tget { return IsInsideStringLiteral || IsInsideVerbatimString || IsInsideCharacter; }\n\t\t}\n\n\t\tpublic bool IsInsideLineComment\n\t\t{\n\t\t\tget { return currentState is LineCommentState; }\n\t\t}\n\n\t\tpublic bool IsInsideMultiLineComment\n\t\t{\n\t\t\tget { return currentState is MultiLineCommentState; }\n\t\t}\n\n\t\tpublic bool IsInsideDocLineComment\n\t\t{\n\t\t\tget { return currentState is DocCommentState; }\n\t\t}\n\n\t\tpublic bool IsInsideComment\n\t\t{\n\t\t\tget { return IsInsideLineComment || IsInsideMultiLineComment || IsInsideDocLineComment; }\n\t\t}\n\n\t\tpublic bool IsInsideOrdinaryComment\n\t\t{\n\t\t\tget { return IsInsideLineComment || IsInsideMultiLineComment; }\n\t\t}\n\n\t\tpublic bool IsInsideOrdinaryCommentOrString\n\t\t{\n\t\t\tget { return IsInsideOrdinaryComment || IsInsideString; }\n\t\t}\n\n\t\tpublic bool LineBeganInsideVerbatimString\n\t\t{\n\t\t\tget { return lineBeganInsideVerbatimString; }\n\t\t}\n\n\t\tpublic bool LineBeganInsideMultiLineComment\n\t\t{\n\t\t\tget { return lineBeganInsideMultiLineComment; }\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/CacheIndentEngine.cs",
    "content": "﻿//\n// CacheIndentEngine.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Editor;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t///     Represents a decorator of an IStateMachineIndentEngine instance that provides\n\t///     logic for reseting and updating the engine on text changed events.\n\t/// </summary>\n\t/// <remarks>\n\t///     The decorator is based on periodical caching of the engine's state and\n\t///     delegating all logic behind indentation to the currently active engine.\n\t/// </remarks>\n\tpublic class CacheIndentEngine : IStateMachineIndentEngine\n\t{\n\n\t\t#region Properties\n\n\t\tIStateMachineIndentEngine currentEngine;\n\t\tStack<IStateMachineIndentEngine> cachedEngines = new Stack<IStateMachineIndentEngine>();\n\n\t\t#endregion\n\n\t\t#region Constructors\n\n\t\t/// <summary>\n\t\t///     Creates a new CacheIndentEngine instance.\n\t\t/// </summary>\n\t\t/// <param name=\"decoratedEngine\">\n\t\t///     An instance of <see cref=\"IStateMachineIndentEngine\"/> to which the\n\t\t///     logic for indentation will be delegated.\n\t\t/// </param>\n\t\t/// <param name=\"cacheRate\">\n\t\t///     The number of chars between caching.\n\t\t/// </param>\n\t\tpublic CacheIndentEngine(IStateMachineIndentEngine decoratedEngine, int cacheRate = 2000)\n\t\t{\n\t\t\tthis.currentEngine = decoratedEngine;\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Creates a new CacheIndentEngine instance from the given prototype.\n\t\t/// </summary>\n\t\t/// <param name=\"prototype\">\n\t\t///     A CacheIndentEngine instance.\n\t\t/// </param>\n\t\tpublic CacheIndentEngine(CacheIndentEngine prototype)\n\t\t{\n\t\t\tthis.currentEngine = prototype.currentEngine.Clone();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDocumentIndentEngine\n\n\t\t/// <inheritdoc />\n\t\tpublic IDocument Document {\n\t\t\tget { return currentEngine.Document; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string ThisLineIndent {\n\t\t\tget { return currentEngine.ThisLineIndent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string NextLineIndent {\n\t\t\tget { return currentEngine.NextLineIndent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string CurrentIndent {\n\t\t\tget { return currentEngine.CurrentIndent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic bool NeedsReindent {\n\t\t\tget { return currentEngine.NeedsReindent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic int Offset {\n\t\t\tget { return currentEngine.Offset; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic TextLocation Location {\n\t\t\tget { return currentEngine.Location; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic bool EnableCustomIndentLevels\n\t\t{\n\t\t\tget { return currentEngine.EnableCustomIndentLevels; }\n\t\t\tset { currentEngine.EnableCustomIndentLevels = value; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic void Push(char ch)\n\t\t{\n\t\t\tcurrentEngine.Push(ch);\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic void Reset()\n\t\t{\n\t\t\tcurrentEngine.Reset();\n\t\t\tcachedEngines.Clear();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Resets the engine to offset. Clears all cached engines after the given offset.\n\t\t/// </summary>\n\t\tpublic void ResetEngineToPosition(int offset)\n\t\t{\n\t\t\t// We are already there\n\t\t\tif (currentEngine.Offset <= offset)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tbool gotCachedEngine = false;\n\t\t\twhile (cachedEngines.Count > 0) {\n\t\t\t\tvar topEngine = cachedEngines.Peek();\n\t\t\t\tif (topEngine.Offset <= offset) {\n\t\t\t\t\tcurrentEngine = topEngine.Clone();\n\t\t\t\t\tgotCachedEngine = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcachedEngines.Pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!gotCachedEngine)\n\t\t\t\tcurrentEngine.Reset();\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\t/// <remarks>\n\t\t///     If the <paramref name=\"position\"/> is negative, the engine will\n\t\t///     update to: document.TextLength + (offset % document.TextLength+1)\n\t\t///     Otherwise it will update to: offset % document.TextLength+1\n\t\t/// </remarks>\n\t\tpublic void Update(int position)\n\t\t{\n\t\t\tconst int BUFFER_SIZE = 2000;\n\t\t\t\n\t\t\tif (currentEngine.Offset == position) {\n\t\t\t\t//positions match, nothing to be done\n\t\t\t\treturn;\n\t\t\t} else if (currentEngine.Offset > position) {\n\t\t\t\t//moving backwards, so reset from previous saved location\n\t\t\t\tResetEngineToPosition(position);\n\t\t\t}\n\n\t\t\t// get the engine caught up\n\t\t\tint nextSave = (cachedEngines.Count == 0) ? BUFFER_SIZE : cachedEngines.Peek().Offset + BUFFER_SIZE;\n\t\t\tif (currentEngine.Offset + 1 == position) {\n\t\t\t\tchar ch = currentEngine.Document.GetCharAt(currentEngine.Offset);\n\t\t\t\tcurrentEngine.Push(ch);\n\t\t\t\tif (currentEngine.Offset == nextSave)\n\t\t\t\t\tcachedEngines.Push(currentEngine.Clone());\n\t\t\t} else {\n\t\t\t\t//bulk copy characters in case buffer is unmanaged \n\t\t\t\t//(faster if we reduce managed/unmanaged transitions)\n\t\t\t\twhile (currentEngine.Offset < position) {\n\t\t\t\t\tint endCut = currentEngine.Offset + BUFFER_SIZE;\n\t\t\t\t\tif (endCut > position)\n\t\t\t\t\t\tendCut = position;\n\t\t\t\t\tstring buffer = currentEngine.Document.GetText(currentEngine.Offset, endCut - currentEngine.Offset);\n\t\t\t\t\tforeach (char ch in buffer) {\n\t\t\t\t\t\tcurrentEngine.Push(ch);\n\t\t\t\t\t\t//ConsoleWrite (\"pushing character '{0}'\", ch);\n\t\t\t\t\t\tif (currentEngine.Offset == nextSave) {\n\t\t\t\t\t\t\tcachedEngines.Push(currentEngine.Clone());\n\t\t\t\t\t\t\tnextSave += BUFFER_SIZE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic IStateMachineIndentEngine GetEngine(int offset)\n\t\t{\n\t\t\tResetEngineToPosition(offset);\n\t\t\treturn currentEngine;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IClonable\n\n\t\t/// <inheritdoc />\n\t\tpublic IStateMachineIndentEngine Clone()\n\t\t{\n\t\t\treturn new CacheIndentEngine(this);\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tIDocumentIndentEngine IDocumentIndentEngine.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IStateMachineIndentEngine\n\n\t\tpublic bool IsInsidePreprocessorDirective {\n\t\t\tget { return currentEngine.IsInsidePreprocessorDirective; }\n\t\t}\n\n\t\tpublic bool IsInsidePreprocessorComment {\n\t\t\tget { return currentEngine.IsInsidePreprocessorComment; }\n\t\t}\n\n\t\tpublic bool IsInsideStringLiteral {\n\t\t\tget { return currentEngine.IsInsideStringLiteral; }\n\t\t}\n\n\t\tpublic bool IsInsideVerbatimString {\n\t\t\tget { return currentEngine.IsInsideVerbatimString; }\n\t\t}\n\n\t\tpublic bool IsInsideCharacter {\n\t\t\tget { return currentEngine.IsInsideCharacter; }\n\t\t}\n\n\t\tpublic bool IsInsideString {\n\t\t\tget { return currentEngine.IsInsideString; }\n\t\t}\n\n\t\tpublic bool IsInsideLineComment {\n\t\t\tget { return currentEngine.IsInsideLineComment; }\n\t\t}\n\n\t\tpublic bool IsInsideMultiLineComment {\n\t\t\tget { return currentEngine.IsInsideMultiLineComment; }\n\t\t}\n\n\t\tpublic bool IsInsideDocLineComment {\n\t\t\tget { return currentEngine.IsInsideDocLineComment; }\n\t\t}\n\n\t\tpublic bool IsInsideComment {\n\t\t\tget { return currentEngine.IsInsideComment; }\n\t\t}\n\n\t\tpublic bool IsInsideOrdinaryComment {\n\t\t\tget { return currentEngine.IsInsideOrdinaryComment; }\n\t\t}\n\n\t\tpublic bool IsInsideOrdinaryCommentOrString {\n\t\t\tget { return currentEngine.IsInsideOrdinaryCommentOrString; }\n\t\t}\n\n\t\tpublic bool LineBeganInsideVerbatimString {\n\t\t\tget { return currentEngine.LineBeganInsideVerbatimString; }\n\t\t}\n\n\t\tpublic bool LineBeganInsideMultiLineComment {\n\t\t\tget { return currentEngine.LineBeganInsideMultiLineComment; }\n\t\t}\n\n\t\t#endregion\n\n\t}\n\t/*\n/\t\t// <summary>\n\t///     Represents a decorator of an IStateMachineIndentEngine instance that provides\n\t///     logic for reseting and updating the engine on text changed events.\n\t/// </summary>\n\t/// <remarks>\n\t///     The decorator is based on periodical caching of the engine's state and\n\t///     delegating all logic behind indentation to the currently active engine.\n\t/// </remarks>\n\tpublic class CacheIndentEngine : IStateMachineIndentEngine\n\t{\n\t\t#region Properties\n\t\t\n\t\t/// <summary>\n\t\t///     Represents the cache interval in number of chars pushed to the engine.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     When this many new chars are pushed to the engine, the currently active\n\t\t///     engine gets cloned and added to the end of <see cref=\"cachedEngines\"/>.\n\t\t/// </remarks>\n\t\treadonly int cacheRate;\n\t\t\n\t\t/// <summary>\n\t\t///     Determines how much memory to reserve on initialization for the\n\t\t///     cached engines.\n\t\t/// </summary>\n\t\tconst int cacheCapacity = 25;\n\t\t\n\t\t/// <summary>\n\t\t///     Currently active engine.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     Should be equal to the last engine in <see cref=\"cachedEngines\"/>.\n\t\t/// </remarks>\n\t\tIStateMachineIndentEngine currentEngine;\n\t\t\n\t\t/// <summary>\n\t\t///     List of cached engines sorted ascending by \n\t\t///     <see cref=\"IDocumentIndentEngine.Offset\"/>.\n\t\t/// </summary>\n\t\tIStateMachineIndentEngine[] cachedEngines;\n\t\t\n\t\t/// <summary>\n\t\t///     The index of the last cached engine in cachedEngines.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     Should be equal to: currentEngine.Offset / CacheRate\n\t\t/// </remarks>\n\t\tint lastCachedEngine;\n\t\t\n\t\t#endregion\n\t\t\n\t\t#region Constructors\n\t\t\n\t\t/// <summary>\n\t\t///     Creates a new CacheIndentEngine instance.\n\t\t/// </summary>\n\t\t/// <param name=\"decoratedEngine\">\n\t\t///     An instance of <see cref=\"IStateMachineIndentEngine\"/> to which the\n\t\t///     logic for indentation will be delegated.\n\t\t/// </param>\n\t\t/// <param name=\"cacheRate\">\n\t\t///     The number of chars between caching.\n\t\t/// </param>\n\t\tpublic CacheIndentEngine(IStateMachineIndentEngine decoratedEngine, int cacheRate = 2000)\n\t\t{\n\t\t\tthis.cachedEngines = new IStateMachineIndentEngine[cacheCapacity];\n\t\t\t\n\t\t\tthis.cachedEngines[0] = decoratedEngine.Clone();\n\t\t\tthis.currentEngine = this.cachedEngines[0].Clone();\n\t\t\tthis.cacheRate = cacheRate;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///     Creates a new CacheIndentEngine instance from the given prototype.\n\t\t/// </summary>\n\t\t/// <param name=\"prototype\">\n\t\t///     A CacheIndentEngine instance.\n\t\t/// </param>\n\t\tpublic CacheIndentEngine(CacheIndentEngine prototype)\n\t\t{\n\t\t\tthis.cachedEngines = new IStateMachineIndentEngine[prototype.cachedEngines.Length];\n\t\t\tArray.Copy(prototype.cachedEngines, this.cachedEngines, prototype.cachedEngines.Length);\n\t\t\t\n\t\t\tthis.lastCachedEngine = prototype.lastCachedEngine;\n\t\t\tthis.currentEngine = prototype.currentEngine.Clone();\n\t\t\tthis.cacheRate = prototype.cacheRate;\n\t\t}\n\t\t\n\t\t#endregion\n\t\t\n\t\t#region Methods\n\t\t\n\t\t/// <summary>\n\t\t///     Performs caching of the <see cref=\"CacheIndentEngine.currentEngine\"/>.\n\t\t/// </summary>\n\t\tvoid cache()\n\t\t{\n\t\t\tif (currentEngine.Offset % cacheRate != 0)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"The current engine's offset is not divisable with the cacheRate.\");\n\t\t\t}\n\t\t\t\n\t\t\t// determine the new current engine from cachedEngines\n\t\t\tlastCachedEngine = currentEngine.Offset / cacheRate;\n\t\t\t\n\t\t\tif (cachedEngines.Length < lastCachedEngine + 1)\n\t\t\t{\n\t\t\t\tArray.Resize(ref cachedEngines, lastCachedEngine * 2);\n\t\t\t}\n\t\t\t\n\t\t\tcachedEngines[lastCachedEngine] = currentEngine.Clone();\n\t\t}\n\t\t\n\t\t#endregion\n\t\t\n\t\t#region IDocumentIndentEngine\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic IDocument Document\n\t\t{\n\t\t\tget { return currentEngine.Document; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic string ThisLineIndent\n\t\t{\n\t\t\tget { return currentEngine.ThisLineIndent; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic string NextLineIndent\n\t\t{\n\t\t\tget { return currentEngine.NextLineIndent; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic string CurrentIndent\n\t\t{\n\t\t\tget { return currentEngine.CurrentIndent; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic bool NeedsReindent\n\t\t{\n\t\t\tget { return currentEngine.NeedsReindent; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic int Offset\n\t\t{\n\t\t\tget { return currentEngine.Offset; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic TextLocation Location\n\t\t{\n\t\t\tget { return currentEngine.Location; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic void Push(char ch)\n\t\t{\n\t\t\tcurrentEngine.Push(ch);\n\t\t\t\n\t\t\tif (currentEngine.Offset % cacheRate == 0)\n\t\t\t{\n\t\t\t\tcache();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic void Reset()\n\t\t{\n\t\t\tcurrentEngine = cachedEngines[lastCachedEngine = 0];\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\t/// <remarks>\n\t\t///     If the <paramref name=\"offset\"/> is negative, the engine will\n\t\t///     update to: document.TextLength + (offset % document.TextLength+1)\n\t\t///     Otherwise it will update to: offset % document.TextLength+1\n\t\t/// </remarks>\n\t\tpublic void Update(int offset)\n\t\t{\n\t\t\t// map the given offset to the [0, document.TextLength] interval\n\t\t\t// using modulo arithmetics\n\t\t\toffset %= Document.TextLength + 1;\n\t\t\tif (offset < 0)\n\t\t\t{\n\t\t\t\toffset += Document.TextLength + 1;\n\t\t\t}\n\t\t\t\n\t\t\t// check if the engine has to be updated to some previous offset\n\t\t\tif (currentEngine.Offset > offset)\n\t\t\t{\n\t\t\t\t// replace the currentEngine with the first one whose offset\n\t\t\t\t// is less then the given <paramref name=\"offset\"/>\n\t\t\t\tlastCachedEngine =  offset / cacheRate;\n\t\t\t\tcurrentEngine = cachedEngines[lastCachedEngine].Clone();\n\t\t\t}\n\t\t\t\n\t\t\t// update the engine to the given offset\n\t\t\twhile (Offset < offset)\n\t\t\t{\n\t\t\t\tPush(Document.GetCharAt(Offset));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IStateMachineIndentEngine GetEngine(int offset)\n\t\t{\n\t\t\t// map the given offset to the [0, document.TextLength] interval\n\t\t\t// using modulo arithmetics\n\t\t\toffset %= Document.TextLength + 1;\n\t\t\tif (offset < 0)\n\t\t\t{\n\t\t\t\toffset += Document.TextLength + 1;\n\t\t\t}\n\t\t\t\n\t\t\t// check if the engine has to be updated to some previous offset\n\t\t\tif (currentEngine.Offset > offset)\n\t\t\t{\n\t\t\t\t// replace the currentEngine with the first one whose offset\n\t\t\t\t// is less then the given <paramref name=\"offset\"/>\n\t\t\t\tlastCachedEngine =  offset / cacheRate;\n\t\t\t\treturn cachedEngines[lastCachedEngine].Clone();\n\t\t\t}\n\t\t\t\n\t\t\treturn currentEngine;\n\t\t}\n\t\t\n\t\t#endregion\n\t\t\n\t\t#region IClonable\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic IStateMachineIndentEngine Clone()\n\t\t{\n\t\t\treturn new CacheIndentEngine(this);\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tIDocumentIndentEngine IDocumentIndentEngine.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\t\t\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\t\t\n\t\t#endregion\n\t\t\n\t\t#region IStateMachineIndentEngine\n\t\t\n\t\tpublic bool IsInsidePreprocessorDirective\n\t\t{\n\t\t\tget { return currentEngine.IsInsidePreprocessorDirective; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsidePreprocessorComment\n\t\t{\n\t\t\tget { return currentEngine.IsInsidePreprocessorComment; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideStringLiteral\n\t\t{\n\t\t\tget { return currentEngine.IsInsideStringLiteral; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideVerbatimString\n\t\t{\n\t\t\tget { return currentEngine.IsInsideVerbatimString; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideCharacter\n\t\t{\n\t\t\tget { return currentEngine.IsInsideCharacter; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideString\n\t\t{\n\t\t\tget { return currentEngine.IsInsideString; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideLineComment\n\t\t{\n\t\t\tget { return currentEngine.IsInsideLineComment; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideMultiLineComment\n\t\t{\n\t\t\tget { return currentEngine.IsInsideMultiLineComment; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideDocLineComment\n\t\t{\n\t\t\tget { return currentEngine.IsInsideDocLineComment; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideComment\n\t\t{\n\t\t\tget { return currentEngine.IsInsideComment; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideOrdinaryComment\n\t\t{\n\t\t\tget { return currentEngine.IsInsideOrdinaryComment; }\n\t\t}\n\t\t\n\t\tpublic bool IsInsideOrdinaryCommentOrString\n\t\t{\n\t\t\tget { return currentEngine.IsInsideOrdinaryCommentOrString; }\n\t\t}\n\t\t\n\t\tpublic bool LineBeganInsideVerbatimString\n\t\t{\n\t\t\tget { return currentEngine.LineBeganInsideVerbatimString; }\n\t\t}\n\t\t\n\t\tpublic bool LineBeganInsideMultiLineComment\n\t\t{\n\t\t\tget { return currentEngine.LineBeganInsideMultiLineComment; }\n\t\t}\n\t\t\n\t\t#endregion\n\t}\n\t\n\t*/\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IDocumentIndentEngine.cs",
    "content": "﻿//\n// IDocumentIndentEngine.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Editor;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t///     The base interface for all indent engines.\n\t/// </summary>\n\tpublic interface IDocumentIndentEngine : ICloneable\n\t{\n\t\t/// <summary>\n\t\t///     A reference to the document that's parsed by the engine.\n\t\t/// </summary>\n\t\tIDocument Document { get; }\n\n\t\t/// <summary>\n\t\t///     The indentation string of the current line.\n\t\t/// </summary>\n\t\tstring ThisLineIndent { get; }\n\n\t\t/// <summary>\n\t\t///     The indentation string of the next line.\n\t\t/// </summary>\n\t\tstring NextLineIndent { get; }\n\n\t\t/// <summary>\n\t\t///     The indent string on the beginning of the current line.\n\t\t/// </summary>\n\t\tstring CurrentIndent { get; }\n\n\t\t/// <summary>\n\t\t///     True if the current line needs to be reindented.\n\t\t/// </summary>\n\t\tbool NeedsReindent { get; }\n\n\t\t/// <summary>\n\t\t///     The current offset of the engine.\n\t\t/// </summary>\n\t\tint Offset { get; }\n\n\t\t/// <summary>\n\t\t///     The current location of the engine.\n\t\t/// </summary>\n\t\tTextLocation Location { get; }\n\n\t\t/// <summary>\n\t\t///     If this is true, the engine should try to adjust its indent \n\t\t///     levels to manual user's corrections, even if they are wrong.\n\t\t/// </summary>\n\t\tbool EnableCustomIndentLevels { get; set; }\n\n\t\t/// <summary>\n\t\t///     Pushes a new char into the engine which calculates the new\n\t\t///     indentation levels.\n\t\t/// </summary>\n\t\t/// <param name=\"ch\">\n\t\t///     A new character.\n\t\t/// </param>\n\t\tvoid Push(char ch);\n\n\t\t/// <summary>\n\t\t///     Resets the engine.\n\t\t/// </summary>\n\t\tvoid Reset();\n\n\t\t/// <summary>\n\t\t///     Updates the engine to the given offset.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">\n\t\t///     Valid offset in <see cref=\"Document\"/>.\n\t\t/// </param>\n\t\tvoid Update(int offset);\n\n\t\t/// <summary>\n\t\t///     Clones the engine and preserves the current state.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t///     An indentical clone which can operate without interference\n\t\t///     with this engine.\n\t\t/// </returns>\n\t\tnew IDocumentIndentEngine Clone();\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IStateMachineIndentEngine.cs",
    "content": "﻿//\n// IStateMachineIndentEngine.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic interface IStateMachineIndentEngine : IDocumentIndentEngine\n\t{\n\t\tbool IsInsidePreprocessorDirective { get; }\n\n\t\tbool IsInsidePreprocessorComment { get; }\n\n\t\tbool IsInsideStringLiteral { get; }\n\n\t\tbool IsInsideVerbatimString { get; }\n\n\t\tbool IsInsideCharacter { get; }\n\n\t\tbool IsInsideString { get; }\n\n\t\tbool IsInsideLineComment { get; }\n\n\t\tbool IsInsideMultiLineComment { get; }\n\n\t\tbool IsInsideDocLineComment { get; }\n\n\t\tbool IsInsideComment { get; }\n\n\t\tbool IsInsideOrdinaryComment { get; }\n\n\t\tbool IsInsideOrdinaryCommentOrString { get; }\n\n\t\tbool LineBeganInsideVerbatimString { get; }\n\n\t\tbool LineBeganInsideMultiLineComment { get; }\n\n\t\tnew IStateMachineIndentEngine Clone();\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/IndentState.cs",
    "content": "﻿//\n// IndentState.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t#region IndentState\n\n\t/// <summary>\n\t///     The base class for all indentation states. \n\t///     Each state defines the logic for indentation based on chars that\n\t///     are pushed to it.\n\t/// </summary>\n\tpublic abstract class IndentState : ICloneable\n\t{\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t///     The indentation engine using this state.\n\t\t/// </summary>\n\t\tpublic CSharpIndentEngine Engine;\n\n\t\t/// <summary>\n\t\t///     The parent state. \n\t\t///     This state can use the indentation levels of its parent.\n\t\t///     When this state exits, the engine returns to the parent.\n\t\t/// </summary>\n\t\tpublic IndentState Parent;\n\n\t\t/// <summary>\n\t\t///     The indentation of the current line.\n\t\t///     This is set when the state is created and will be changed to\n\t\t///     <see cref=\"NextLineIndent\"/> when the <see cref=\"CSharpIndentEngine.newLineChar\"/> \n\t\t///     is pushed.\n\t\t/// </summary>\n\t\tpublic Indent ThisLineIndent;\n\n\t\t/// <summary>\n\t\t///     The indentation of the next line.\n\t\t///     This is set when the state is created and can change depending\n\t\t///     on the pushed chars.\n\t\t/// </summary>\n\t\tpublic Indent NextLineIndent;\n\n\t\t#endregion\n\n\t\t#region Constructors\n\n\t\tprotected IndentState()\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Creates a new indentation state that is a copy of the given\n\t\t///     prototype.\n\t\t/// </summary>\n\t\t/// <param name=\"prototype\">\n\t\t///     The prototype state.\n\t\t/// </param>\n\t\t/// <param name=\"engine\">\n\t\t///     The engine of the new state.\n\t\t/// </param>\n\t\tprotected IndentState(IndentState prototype, CSharpIndentEngine engine)\n\t\t{\n\t\t\tEngine = engine;\n\t\t\tParent = prototype.Parent != null ? prototype.Parent.Clone(engine) : null;\n\n\t\t\tThisLineIndent = prototype.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = prototype.NextLineIndent.Clone();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IClonable\n\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone(Engine);\n\t\t}\n\n\t\tpublic abstract IndentState Clone(CSharpIndentEngine engine);\n\n\t\t#endregion\n\n\t\t#region Methods\n\n\t\tinternal void Initialize (CSharpIndentEngine engine, IndentState parent = null)\n\t\t{\n\t\t\tParent = parent;\n\t\t\tEngine = engine;\n\n\t\t\tInitializeState();\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Initializes the state:\n\t\t///       - sets the default indentation levels.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     Each state can override this method if it needs a different\n\t\t///     logic for setting up the default indentations.\n\t\t/// </remarks>\n\t\tpublic virtual void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = new Indent(Engine.textEditorOptions);\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Actions performed when this state exits.\n\t\t/// </summary>\n\t\tpublic virtual void OnExit()\n\t\t{\n\t\t\tif (Parent != null)\n\t\t\t{\n\t\t\t\t// if a state exits on the newline character, it has to push\n\t\t\t\t// it back to its parent (and so on recursively if the parent \n\t\t\t\t// state also exits). Otherwise, the parent state wouldn't\n\t\t\t\t// know that the engine isn't on the same line anymore.\n\t\t\t\tif (Engine.currentChar == Engine.newLineChar)\n\t\t\t\t{\n\t\t\t\t\tParent.Push(Engine.newLineChar);\n\t\t\t\t}\n\n\t\t\t\t// when a state exits the engine stays on the same line and this\n\t\t\t\t// state has to override the Parent.ThisLineIndent.\n\t\t\t\tParent.ThisLineIndent = ThisLineIndent.Clone();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Changes the current state of the <see cref=\"CSharpIndentEngine\"/> using the current\n\t\t///     state as the parent for the new one.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">\n\t\t///     The type of the new state. Must be assignable from <see cref=\"IndentState\"/>.\n\t\t/// </typeparam>\n\t\tpublic void ChangeState<T>()\n\t\t\twhere T : IndentState, new ()\n\t\t{\n\t\t\tvar t = new T();\n\t\t\tt.Initialize(Engine, Engine.currentState);\n\t\t\tEngine.currentState = t;\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Exits this state by setting the current state of the\n\t\t///     <see cref=\"CSharpIndentEngine\"/> to this state's parent.\n\t\t/// </summary>\n\t\tpublic void ExitState()\n\t\t{\n\t\t\tOnExit();\n\t\t\tEngine.currentState = Engine.currentState.Parent ?? new GlobalBodyState(Engine);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Common logic behind the push method.\n\t\t///     Each state can override this method and implement its own logic.\n\t\t/// </summary>\n\t\t/// <param name=\"ch\">\n\t\t///     The current character that's being pushed.\n\t\t/// </param>\n\t\tpublic virtual void Push(char ch)\n\t\t{\n\t\t\t// replace ThisLineIndent with NextLineIndent if the newLineChar is pushed\n\t\t\tif (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\tvar delta = Engine.textEditorOptions.ContinuationIndent;\n\t\t\t\twhile (NextLineIndent.CurIndent - ThisLineIndent.CurIndent > delta &&\n\t\t\t\t\t   NextLineIndent.PopIf(IndentType.Continuation)) ;\n\t\t\t\tThisLineIndent = NextLineIndent.Clone();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     When derived, checks if the given sequence of chars form\n\t\t///     a valid keyword or variable name, depending on the state.\n\t\t/// </summary>\n\t\t/// <param name=\"keyword\">\n\t\t///     A possible keyword.\n\t\t/// </param>\n\t\tpublic virtual void CheckKeyword(string keyword)\n\t\t{ }\n\n\t\t/// <summary>\n\t\t///     When derived, checks if the given sequence of chars form\n\t\t///     a valid keyword or variable name, depending on the state.\n\t\t/// </summary>\n\t\t/// <param name=\"keyword\">\n\t\t///     A possible keyword.\n\t\t/// </param>\n\t\t/// <remarks>\n\t\t///     This method should be called from <see cref=\"Push(char)\"/>.\n\t\t///     It is left to derived classes to call this method because of\n\t\t///     performance issues.\n\t\t/// </remarks>\n\t\tpublic virtual void CheckKeywordOnPush(string keyword)\n\t\t{ }\n\n\t\t#endregion\n\t}\n\n\t#endregion\n\n\t#region Null state\n\n\t/// <summary>\n\t///     Null state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Doesn't define any transitions to new states.\n\t/// </remarks>\n\tpublic class NullState : IndentState\n\t{\n\t\tpublic NullState()\n\t\t{ }\n\n\t\tpublic NullState(NullState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{ }\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new NullState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Brackets body states\n\n\t#region Brackets body base\n\n\t/// <summary>\n\t///     The base for all brackets body states.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between a pair of brackets.\n\t/// </remarks>\n\tpublic abstract class BracketsBodyBaseState : IndentState\n\t{\n\t\n\t\t/// <summary>\n\t\t///     When derived in a concrete bracket body state, represents\n\t\t///     the closed bracket character pair.\n\t\t/// </summary>\n\t\tpublic abstract char ClosedBracket { get; }\n\n\t\tprotected BracketsBodyBaseState()\n\t\t{ }\n\n\t\tprotected BracketsBodyBaseState(BracketsBodyBaseState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\t\t\tswitch (ch) {\n\t\t\t\tcase '#':\n\t\t\t\t\tif (Engine.isLineStart)\n\t\t\t\t\t\tChangeState<PreProcessorState>();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '/':\n\t\t\t\t\tif (Engine.previousChar == '/')\n\t\t\t\t\t\tChangeState<LineCommentState>();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\t\tif (Engine.previousChar == '/')\n\t\t\t\t\t\tChangeState<MultiLineCommentState>();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\"':\n\t\t\t\t\tif (Engine.previousChar == '@')\n\t\t\t\t\t{\n\t\t\t\t\t\tChangeState<VerbatimStringState>();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tChangeState<StringLiteralState>();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\'':\n\t\t\t\t\tChangeState<CharacterState>();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '{':\n\t\t\t\t\tChangeState<BracesBodyState>();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '(':\n\t\t\t\t\tChangeState<ParenthesesBodyState>();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '[':\n\t\t\t\t\tChangeState<SquareBracketsBodyState>();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (ch == ClosedBracket)\n\t\t\t\t\t\tExitState();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Braces body state\n\n\t/// <summary>\n\t///     Braces body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between { and }.\n\t/// </remarks>\n\tpublic class BracesBodyState : BracketsBodyBaseState\n\t{\n\t\t/// <summary>\n\t\t///     Type of the current block body.\n\t\t/// </summary>\n\t\tpublic Body CurrentBody;\n\n\t\t/// <summary>\n\t\t///     Type of the next block body.\n\t\t///     Same as <see cref=\"CurrentBody\"/> if none of the\n\t\t///     <see cref=\"Body\"/> keywords have been read.\n\t\t/// </summary>\n\t\tpublic Body NextBody;\n\n\t\t/// <summary>\n\t\t///     Type of the current statement.\n\t\t/// </summary>\n\t\tpublic Statement CurrentStatement\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn currentStatement;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t// clear NestedIfStatementLevels if this statement breaks the sequence\n\t\t\t\tif (currentStatement == Statement.None && value != Statement.Else)\n\t\t\t\t{\n\t\t\t\t\tNestedIfStatementLevels.Clear();\n\t\t\t\t}\n\n\t\t\t\tcurrentStatement = value;\n\t\t\t}\n\t\t}\n\t\tStatement currentStatement;\n\n\t\t/// <summary>\n\t\t///    Contains indent levels of nested if statements.\n\t\t/// </summary>\n\t\tinternal CloneableStack<Indent> NestedIfStatementLevels = new CloneableStack<Indent>();\n\n\t\t/// <summary>\n\t\t///    Contains the indent level of the last statement or body keyword.\n\t\t/// </summary>\n\t\tpublic Indent LastBlockIndent;\n\n\t\t/// <summary>\n\t\t///     True if the engine is on the right side of the equal operator '='.\n\t\t/// </summary>\n\t\tpublic bool IsRightHandExpression;\n\n\t\t/// <summary>\n\t\t///     True if the '=' char has been pushed and it's not\n\t\t///     a part of a relational operator (&gt;=, &lt;=, !=, ==).\n\t\t/// </summary>\n\t\tpublic bool IsEqualCharPushed;\n\n\t\t/// <summary>\n\t\t///     The indentation of the previous line.\n\t\t/// </summary>\n\t\tpublic int PreviousLineIndent;\n\n\t\t/// <summary>\n\t\t///     True if the dot member (e.g. method invocation) indentation has\n\t\t///     been handled in the current statement.\n\t\t/// </summary>\n\t\tpublic bool IsMemberReferenceDotHandled;\n\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return '}'; }\n\t\t}\n\n\t\tpublic BracesBodyState()\n\t\t{\n\t\t}\n\n\t\tpublic BracesBodyState(BracesBodyState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tCurrentBody = prototype.CurrentBody;\n\t\t\tNextBody = prototype.NextBody;\n\t\t\tCurrentStatement = prototype.CurrentStatement;\n\t\t\tNestedIfStatementLevels = prototype.NestedIfStatementLevels.Clone();\n\t\t\tIsRightHandExpression = prototype.IsRightHandExpression;\n\t\t\tIsEqualCharPushed = prototype.IsEqualCharPushed;\n\t\t\tIsMemberReferenceDotHandled = prototype.IsMemberReferenceDotHandled;\n\t\t\tLastBlockIndent = prototype.LastBlockIndent;\n\t\t\tPreviousLineIndent = prototype.PreviousLineIndent;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\t// handle IsRightHandExpression property\n\t\t\tif (IsEqualCharPushed)\n\t\t\t{\n\t\t\t\tif (IsRightHandExpression)\n\t\t\t\t{\n\t\t\t\t\tif (ch == Engine.newLineChar)\n\t\t\t\t\t{\n\t\t\t\t\t\tNextLineIndent.RemoveAlignment();\n\t\t\t\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// ignore \"==\" and \"=>\" operators\n\t\t\t\telse if (ch != '=' && ch != '>')\n\t\t\t\t{\n\t\t\t\t\tIsRightHandExpression = true;\n\n\t\t\t\t\tif (ch == Engine.newLineChar)\n\t\t\t\t\t{\n\t\t\t\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tNextLineIndent.SetAlignment(Engine.column - NextLineIndent.CurIndent);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tIsEqualCharPushed = ch == ' ' || ch == '\\t';\n\t\t\t}\n\n\t\t\tif (ch == ';' || (ch == ',' && IsRightHandExpression))\n\t\t\t{\n\t\t\t\tOnStatementExit();\n\t\t\t}\n\t\t\telse if (ch == '=' && !(Engine.previousChar == '=' || Engine.previousChar == '<' || Engine.previousChar == '>' || Engine.previousChar == '!'))\n\t\t\t{\n\t\t\t\tIsEqualCharPushed = true;\n\t\t\t}\n\t\t\telse if (ch == '.' && !IsMemberReferenceDotHandled)\n\t\t\t{\n\t\t\t\t// OPTION: CSharpFormattingOptions.AlignToMemberReferenceDot\n\t\t\t\tif (Engine.formattingOptions.AlignToMemberReferenceDot && !Engine.isLineStart)\n\t\t\t\t{\n\t\t\t\t\tIsMemberReferenceDotHandled = true;\n\t\t\t\t\tNextLineIndent.RemoveAlignment();\n\t\t\t\t\tNextLineIndent.SetAlignment(Engine.column - NextLineIndent.CurIndent - 1, true);\n\t\t\t\t}\n\t\t\t\telse if (Engine.isLineStart)\n\t\t\t\t{\n\t\t\t\t\tIsMemberReferenceDotHandled = true;\n\n\t\t\t\t\tThisLineIndent.RemoveAlignment();\n\t\t\t\t\twhile (ThisLineIndent.CurIndent > PreviousLineIndent && \n\t\t\t\t\t       ThisLineIndent.PopIf(IndentType.Continuation)) ;\n\t\t\t\t\tThisLineIndent.Push(IndentType.Continuation);\n\t\t\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (ch == ':' && Engine.isLineStart && !IsRightHandExpression)\n\t\t\t{\n\t\t\t\t// try to capture ': base(...)', ': this(...)' and inherit statements when they are on a new line\n\t\t\t\tThisLineIndent.Push(IndentType.Continuation);\n\t\t\t}\n\t\t\telse if (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\tPreviousLineIndent = ThisLineIndent.CurIndent;\n\t\t\t}\n\n\t\t\tif (Engine.wordToken.ToString() == \"else\")\n\t\t\t{\n\t\t\t\tCheckKeywordOnPush(\"else\");\n\t\t\t}\n\n\t\t\tbase.Push(ch);\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\n\t\t\t// OPTION: IDocumentIndentEngine.EnableCustomIndentLevels\n\t\t\tvar parent = Parent as BracesBodyState;\n\t\t\tif (parent == null || parent.LastBlockIndent == null || !Engine.EnableCustomIndentLevels)\n\t\t\t{\n\t\t\t\tNextLineIndent.RemoveAlignment();\n\t\t\t\tNextLineIndent.PopIf(IndentType.Continuation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tNextLineIndent = parent.LastBlockIndent.Clone();\n\t\t\t}\n\n\t\t\tif (Engine.isLineStart)\n\t\t\t{\n\t\t\t\tThisLineIndent = NextLineIndent.Clone();\n\t\t\t}\n\n\t\t\tCurrentBody = extractBody(Parent);\n\t\t\tNextBody = Body.None;\n\t\t\tCurrentStatement = Statement.None;\n\n\t\t\tAddIndentation(CurrentBody);\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new BracesBodyState(this, engine);\n\t\t}\n\n\t\tpublic override void OnExit()\n\t\t{\n\t\t\tif (Parent is BracesBodyState && !((BracesBodyState)Parent).IsRightHandExpression)\n\t\t\t{\n\t\t\t\t((BracesBodyState)Parent).OnStatementExit();\n\t\t\t}\n\n\t\t\tif (Engine.isLineStart)\n\t\t\t{\n\t\t\t\tThisLineIndent.RemoveAlignment();\n\t\t\t\tThisLineIndent.PopTry();\n\t\t\t\tBraceStyle style;\n\t\t\t\tif (TryGetBraceStyle(this.CurrentBody, out style)) {\n\t\t\t\t\tif (style == BraceStyle.NextLineShifted ||\n\t\t\t\t\t\tstyle == BraceStyle.NextLineShifted2||\n\t\t\t\t\t\tstyle == BraceStyle.BannerStyle) {\n\t\t\t\t\t\tThisLineIndent.Push(IndentType.Block);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.OnExit();\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Actions performed when the current statement exits.\n\t\t/// </summary>\n\t\tpublic virtual void OnStatementExit()\n\t\t{\n\t\t\tIsRightHandExpression = false;\n\t\t\tIsMemberReferenceDotHandled = false;\n\n\t\t\tNextLineIndent.RemoveAlignment();\n\t\t\tNextLineIndent.PopWhile(IndentType.Continuation);\n\n\t\t\tCurrentStatement = Statement.None;\n\t\t\tNextBody = Body.None;\n\t\t\tLastBlockIndent = null;\n\t\t}\n\n\t\t#region Helpers\n\n\t\t/// <summary>\n\t\t///     Types of braces bodies.\n\t\t/// </summary>\n\t\tpublic enum Body\n\t\t{\n\t\t\tNone,\n\t\t\tNamespace,\n\t\t\tClass,\n\t\t\tStruct,\n\t\t\tInterface,\n\t\t\tEnum,\n\t\t\tSwitch,\n\t\t\tCase,\n\t\t\tTry,\n\t\t\tCatch,\n\t\t\tFinally\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Types of statements.\n\t\t/// </summary>\n\t\tpublic enum Statement\n\t\t{\n\t\t\tNone,\n\t\t\tIf,\n\t\t\tElse,\n\t\t\tDo,\n\t\t\tWhile,\n\t\t\tFor,\n\t\t\tForeach,\n\t\t\tLock,\n\t\t\tUsing,\n\t\t\tReturn\n\t\t}\n\n\t\tstatic readonly Dictionary<string, Body> bodies = new Dictionary<string, Body>\n\t\t{\n\t\t\t{ \"namespace\", Body.Namespace },\n\t\t\t{ \"class\", Body.Class },\n\t\t\t{ \"struct\", Body.Struct },\n\t\t\t{ \"interface\", Body.Interface },\n\t\t\t{ \"enum\", Body.Enum },\n\t\t\t{ \"switch\", Body.Switch },\n\t\t\t{ \"try\", Body.Try },\n\t\t\t{ \"catch\", Body.Catch },\n\t\t\t{ \"finally\", Body.Finally },\n\t\t};\n\n\t\tstatic readonly Dictionary<string, Statement> statements = new Dictionary<string, Statement>\n\t\t{\n\t\t\t{ \"if\", Statement.If },\n\t\t\t// { \"else\", Statement.Else }, // should be handled in CheckKeywordAtPush\n\t\t\t{ \"do\", Statement.Do },\n\t\t\t{ \"while\", Statement.While },\n\t\t\t{ \"for\", Statement.For },\n\t\t\t{ \"foreach\", Statement.Foreach },\n\t\t\t{ \"lock\", Statement.Lock },\n\t\t\t{ \"using\", Statement.Using },\n\t\t\t{ \"return\", Statement.Return },\n\t\t};\n\n\t\tstatic readonly HashSet<string> blocks = new HashSet<string>\n\t\t{\n\t\t\t\"namespace\",\n\t\t\t\"class\",\n\t\t\t\"struct\",\n\t\t\t\"interface\",\n\t\t\t\"enum\",\n\t\t\t\"switch\",\n\t\t\t\"try\",\n\t\t\t\"catch\",\n\t\t\t\"finally\",\n\t\t\t\"if\",\n\t\t\t\"else\",\n\t\t\t\"do\",\n\t\t\t\"while\",\n\t\t\t\"for\",\n\t\t\t\"foreach\",\n\t\t\t\"lock\",\n\t\t\t\"using\",\n\t\t};\n\n\t\treadonly string[] caseDefaultKeywords = {\n\t\t\t\"case\",\n\t\t\t\"default\"\n\t\t};\n\n\t\treadonly string[] classStructKeywords = {\n\t\t\t\"class\",\n\t\t\t\"struct\"\n\t\t};\n\n\t\t/// <summary>\n\t\t///     Checks if the given string is a keyword and sets the\n\t\t///     <see cref=\"NextBody\"/> and the <see cref=\"CurrentStatement\"/>\n\t\t///     variables appropriately.\n\t\t/// </summary>\n\t\t/// <param name=\"keyword\">\n\t\t///     A possible keyword.\n\t\t/// </param>\n\t\t/// <remarks>\n\t\t///     This method is called from <see cref=\"Push(char)\"/>\n\t\t/// </remarks>\n\t\tpublic override void CheckKeywordOnPush(string keyword)\n\t\t{\n\t\t\tif (keyword == \"else\")\n\t\t\t{\n\t\t\t\tCurrentStatement = Statement.Else;\n\n\t\t\t\t// OPTION: CSharpFormattingOptions.AlignElseInIfStatements\n\t\t\t\tif (!Engine.formattingOptions.AlignElseInIfStatements && NestedIfStatementLevels.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent = NestedIfStatementLevels.Pop().Clone();\n\t\t\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t\t}\n\n\t\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t\t}\n\n\t\t\tif (blocks.Contains(keyword) && Engine.NeedsReindent)\n\t\t\t{\n\t\t\t\tLastBlockIndent = Indent.ConvertFrom(Engine.CurrentIndent, ThisLineIndent, Engine.textEditorOptions);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Checks if the given string is a keyword and sets the\n\t\t///     <see cref=\"NextBody\"/> and the <see cref=\"CurrentStatement\"/>\n\t\t///     variables appropriately.\n\t\t/// </summary>\n\t\t/// <param name=\"keyword\">\n\t\t///     A possible keyword.\n\t\t/// </param>\n\t\tpublic override void CheckKeyword(string keyword)\n\t\t{\n\t\t\tif (bodies.ContainsKey(keyword))\n\t\t\t{\n\t\t\t\tvar isKeywordTemplateConstraint =\n\t\t\t\t\tclassStructKeywords.Contains(keyword) &&\n\t\t\t\t\t(NextBody == Body.Class || NextBody == Body.Struct || NextBody == Body.Interface);\n\n\t\t\t\tif (!isKeywordTemplateConstraint)\n\t\t\t\t{\n\t\t\t\t\tNextBody = bodies[keyword];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (caseDefaultKeywords.Contains(keyword) && CurrentBody == Body.Switch && Engine.isLineStartBeforeWordToken)\n\t\t\t{\n\t\t\t\tChangeState<SwitchCaseState>();\n\t\t\t}\n\t\t\telse if (keyword == \"where\" && Engine.isLineStartBeforeWordToken)\n\t\t\t{\n\t\t\t\t// try to capture where (generic type constraint)\n\t\t\t\tThisLineIndent.Push(IndentType.Continuation);\n\t\t\t}\n\t\t\telse if (statements.ContainsKey(keyword))\n\t\t\t{\n\t\t\t\tStatement previousStatement = CurrentStatement;\n\t\t\t\tCurrentStatement = statements[keyword];\n\n\t\t\t\t// return if this is a using declaration or alias\n\t\t\t\tif (CurrentStatement == Statement.Using &&\n\t\t\t\t   (this is GlobalBodyState || CurrentBody == Body.Namespace))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// OPTION: CSharpFormattingOptions.AlignEmbeddedIfStatements\n\t\t\t\tif (Engine.formattingOptions.AlignEmbeddedStatements &&\n\t\t\t\t\tpreviousStatement == Statement.If &&\n\t\t\t\t\tCurrentStatement == Statement.If)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent.PopIf(IndentType.Continuation);\n\t\t\t\t\tNextLineIndent.PopIf(IndentType.Continuation);\n\t\t\t\t}\n\n\t\t\t\t// OPTION: CSharpFormattingOptions.AlignEmbeddedStatements\n\t\t\t\tif (Engine.formattingOptions.AlignEmbeddedStatements &&\n\t\t\t\t\tpreviousStatement == Statement.Lock &&\n\t\t\t\t\tCurrentStatement == Statement.Lock)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent.PopIf(IndentType.Continuation);\n\t\t\t\t\tNextLineIndent.PopIf(IndentType.Continuation);\n\t\t\t\t}\n\n\t\t\t\t// OPTION: CSharpFormattingOptions.AlignEmbeddedUsingStatements\n\t\t\t\tif (Engine.formattingOptions.AlignEmbeddedStatements &&\n\t\t\t\t\tpreviousStatement == Statement.Using &&\n\t\t\t\t\tCurrentStatement == Statement.Using)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent.PopIf(IndentType.Continuation);\n\t\t\t\t\tNextLineIndent.PopIf(IndentType.Continuation);\n\t\t\t\t}\n\n\t\t\t\t// only add continuation for 'else' in 'else if' statement.\n\t\t\t\tif (!(CurrentStatement == Statement.If && previousStatement == Statement.Else && !Engine.isLineStartBeforeWordToken))\n\t\t\t\t{\n\t\t\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t\t\t}\n\n\t\t\t\tif (CurrentStatement == Statement.If)\n\t\t\t\t{\n\t\t\t\t\tNestedIfStatementLevels.Push(ThisLineIndent);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (blocks.Contains(keyword) && Engine.NeedsReindent)\n\t\t\t{\n\t\t\t\tLastBlockIndent = Indent.ConvertFrom(Engine.CurrentIndent, ThisLineIndent, Engine.textEditorOptions);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Pushes a new level of indentation depending on the given\n\t\t///     <paramref name=\"braceStyle\"/>.\n\t\t/// </summary>\n\t\tvoid AddIndentation(BraceStyle braceStyle)\n\t\t{\n\t\t\tswitch (braceStyle)\n\t\t\t{\n\t\t\t\tcase BraceStyle.NextLineShifted:\n\t\t\t\t\tThisLineIndent.Push(IndentType.Block);\n\t\t\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.DoNotChange:\n\t\t\t\tcase BraceStyle.EndOfLine:\n\t\t\t\tcase BraceStyle.EndOfLineWithoutSpace:\n\t\t\t\tcase BraceStyle.NextLine:\n\t\t\t\tcase BraceStyle.BannerStyle:\n\t\t\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted2:\n\t\t\t\t\tThisLineIndent.Push(IndentType.Block);\n\t\t\t\t\tNextLineIndent.Push(IndentType.DoubleBlock);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tbool TryGetBraceStyle (Body body, out BraceStyle style)\n\t\t{\n\t\t\tstyle = BraceStyle.DoNotChange;\n\t\t\tswitch (body)\n\t\t\t{\n\t\t\t\tcase Body.None:\n\t\t\t\t\tif (!Engine.formattingOptions.IndentBlocks)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tstyle = Engine.formattingOptions.StatementBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t\tcase Body.Namespace:\n\t\t\t\t\tif (!Engine.formattingOptions.IndentNamespaceBody)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tstyle = Engine.formattingOptions.NamespaceBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t\tcase Body.Class:\n\t\t\t\t\tif (!Engine.formattingOptions.IndentClassBody)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tstyle = Engine.formattingOptions.ClassBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t\tcase Body.Struct:\n\t\t\t\t\tif (!Engine.formattingOptions.IndentStructBody)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tstyle = Engine.formattingOptions.StructBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t\tcase Body.Interface:\n\t\t\t\t\tif (!Engine.formattingOptions.IndentInterfaceBody)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tstyle = Engine.formattingOptions.InterfaceBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t\tcase Body.Enum:\n\t\t\t\t\tif (!Engine.formattingOptions.IndentEnumBody)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tstyle = Engine.formattingOptions.EnumBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t\tcase Body.Switch:\n\t\t\t\t\tif (!Engine.formattingOptions.IndentSwitchBody)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tstyle = Engine.formattingOptions.StatementBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t\tcase Body.Try:\n\t\t\t\tcase Body.Catch:\n\t\t\t\tcase Body.Finally:\n\t\t\t\t\tstyle = Engine.formattingOptions.StatementBraceStyle;\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Pushes a new level of indentation depending on the given\n\t\t///     <paramref name=\"body\"/>.\n\t\t/// </summary>\n\t\tvoid AddIndentation(Body body)\n\t\t{\n\t\t\tvar isExpression = Parent is ParenthesesBodyState || Parent is SquareBracketsBodyState ||\n\t\t\t\t(Parent is BracesBodyState && ((BracesBodyState)Parent).IsRightHandExpression);\n\t\t\tif (isExpression && Engine.formattingOptions.IndentBlocksInsideExpressions && Engine.isLineStart)\n\t\t\t{\n\t\t\t\tAddIndentation(BraceStyle.NextLineShifted);\n\t\t\t}\n\n\t\t\tBraceStyle style;\n\t\t\tif (TryGetBraceStyle(body, out style))\n\t\t\t{\n\t\t\t\tAddIndentation(style);\n\t\t\t} else {\n\t\t\t\tNextLineIndent.Push(IndentType.Empty);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Extracts the <see cref=\"CurrentBody\"/> from the given state.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t///     The correct <see cref=\"Body\"/> type for this state.\n\t\t/// </returns>\n\t\tstatic Body extractBody(IndentState state)\n\t\t{\n\t\t\tif (state != null && state is BracesBodyState)\n\t\t\t{\n\t\t\t\treturn ((BracesBodyState)state).NextBody;\n\t\t\t}\n\n\t\t\treturn Body.None;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t#endregion\n\n\t#region Global body state\n\n\t/// <summary>\n\t///     Global body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents the global space of the program.\n\t/// </remarks>\n\tpublic class GlobalBodyState : BracesBodyState\n\t{\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return '\\0'; }\n\t\t}\n\n\t\tpublic GlobalBodyState()\n\t\t{ }\n\n\n\t\tpublic GlobalBodyState(CSharpIndentEngine engine)\n\t\t{\n\t\t\tInitialize (engine, null);\n\t\t}\n\n\t\tpublic GlobalBodyState(GlobalBodyState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{ }\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new GlobalBodyState(this, engine);\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = new Indent(Engine.textEditorOptions);\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Switch-case body state\n\n\t/// <summary>\n\t///     Switch-case statement state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents the block of code in one switch case (including default).\n\t/// </remarks>\n\tpublic class SwitchCaseState : BracesBodyState\n\t{\n\t\tpublic SwitchCaseState()\n\t\t{ }\n\n\t\tpublic SwitchCaseState(SwitchCaseState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\t// on ClosedBracket both this state (a case or a default statement)\n\t\t\t// and also the whole switch block (handled in the base class) must exit.\n\t\t\tif (ch == ClosedBracket)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t\tif (Parent is BracesBodyState)\n\t\t\t\t\tParent.OnExit();\n\t\t\t}\n\n\t\t\tbase.Push(ch);\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\n\t\t\t// remove all continuations and extra spaces\n\t\t\tThisLineIndent.RemoveAlignment(); \n\t\t\tThisLineIndent.PopWhile(IndentType.Continuation);\n\n\t\t\tNextLineIndent.RemoveAlignment();\n\t\t\tNextLineIndent.PopWhile(IndentType.Continuation);\n\n\t\t\tif (Engine.formattingOptions.IndentCaseBody)\n\t\t\t{\n\t\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tNextLineIndent.Push(IndentType.Empty);\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly string[] caseDefaultKeywords = {\n\t\t\t\"case\",\n\t\t\t\"default\"\n\t\t};\n\n\t\tstatic readonly string[] breakContinueReturnGotoKeywords = {\n\t\t\t\"break\",\n\t\t\t\"continue\",\n\t\t\t\"return\",\n\t\t\t\"goto\"\n\t\t};\n\n\t\tpublic override void CheckKeyword(string keyword)\n\t\t{\n\t\t\tif (caseDefaultKeywords.Contains(keyword) && Engine.isLineStartBeforeWordToken)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t\tChangeState<SwitchCaseState>();\n\t\t\t}\n\t\t\telse if (breakContinueReturnGotoKeywords.Contains(keyword) && Engine.isLineStartBeforeWordToken)\n\t\t\t{\n\t\t\t\t// OPTION: Engine.formattingOptions.IndentBreakStatements\n\t\t\t\tif (!Engine.formattingOptions.IndentBreakStatements)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.CheckKeyword(keyword);\n\t\t}\n\n\n\t\tpublic override void OnExit()\n\t\t{\n\t\t\t//Parent.OnExit();\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new SwitchCaseState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Parentheses body state\n\n\t/// <summary>\n\t///     Parentheses body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between ( and ).\n\t/// </remarks>\n\tpublic class ParenthesesBodyState : BracketsBodyBaseState\n\t{\n\t\t/// <summary>\n\t\t///     True if any char has been pushed.\n\t\t/// </summary>\n\t\tpublic bool IsSomethingPushed;\n\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return ')'; }\n\t\t}\n\n\t\tpublic ParenthesesBodyState()\n\t\t{ }\n\n\t\tpublic ParenthesesBodyState(ParenthesesBodyState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tIsSomethingPushed = prototype.IsSomethingPushed;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tif (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\tif (Engine.formattingOptions.AnonymousMethodBraceStyle == BraceStyle.EndOfLine || \n\t\t\t\t\tEngine.formattingOptions.AnonymousMethodBraceStyle == BraceStyle.EndOfLineWithoutSpace) {\n\t\t\t\t\tif (NextLineIndent.PopIf(IndentType.Continuation)) {\n\t\t\t\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!IsSomethingPushed)\n\t\t\t{\n\t\t\t\t// OPTION: CSharpFormattingOptions.AlignToFirstMethodCallArgument\n\t\t\t\tif (Engine.formattingOptions.AlignToFirstMethodCallArgument)\n\t\t\t\t{\n\t\t\t\t\tNextLineIndent.PopTry();\n\t\t\t\t\t// align the next line at the beginning of the open bracket\n\t\t\t\t\tNextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.Push(ch);\n\t\t\tIsSomethingPushed = true;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new ParenthesesBodyState(this, engine);\n\t\t}\n\n\t\tpublic override void OnExit()\n\t\t{\n\t\t\tif (Engine.isLineStart)\n\t\t\t{\n\t\t\t\tif (ThisLineIndent.ExtraSpaces > 0)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent.ExtraSpaces--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent.PopTry();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.OnExit();\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Square brackets body state\n\n\t/// <summary>\n\t///     Square brackets body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between [ and ].\n\t/// </remarks>\n\tpublic class SquareBracketsBodyState : BracketsBodyBaseState\n\t{\n\t\t/// <summary>\n\t\t///     True if any char has been pushed.\n\t\t/// </summary>\n\t\tpublic bool IsSomethingPushed;\n\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return ']'; }\n\t\t}\n\n\t\tpublic SquareBracketsBodyState()\n\t\t{ }\n\n\t\tpublic SquareBracketsBodyState(SquareBracketsBodyState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tIsSomethingPushed = prototype.IsSomethingPushed;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tif (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\tif (NextLineIndent.PopIf(IndentType.Continuation))\n\t\t\t\t{\n\t\t\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!IsSomethingPushed)\n\t\t\t{\n\t\t\t\t// OPTION: CSharpFormattingOptions.AlignToFirstIndexerArgument\n\t\t\t\tif (Engine.formattingOptions.AlignToFirstIndexerArgument)\n\t\t\t\t{\n\t\t\t\t\tNextLineIndent.PopTry();\n\t\t\t\t\t// align the next line at the beginning of the open bracket\n\t\t\t\t\tNextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.Push(ch);\n\t\t\tIsSomethingPushed = true;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new SquareBracketsBodyState(this, engine);\n\t\t}\n\n\t\tpublic override void OnExit()\n\t\t{\n\t\t\tif (Engine.isLineStart)\n\t\t\t{\n\t\t\t\tif (ThisLineIndent.ExtraSpaces > 0)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent.ExtraSpaces--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent.PopTry();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.OnExit();\n\t\t}\n\t}\n\n\t#endregion\n\n\t#endregion\n\n\t#region PreProcessor state\n\n\t/// <summary>\n\t///     PreProcessor directive state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Activated when the '#' char is pushed and the \n\t///     <see cref=\"CSharpIndentEngine.isLineStart\"/> is true.\n\t/// </remarks>\n\tpublic class PreProcessorState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     The type of the preprocessor directive.\n\t\t/// </summary>\n\t\tpublic PreProcessorDirective DirectiveType;\n\n\t\t/// <summary>\n\t\t///     If <see cref=\"DirectiveType\"/> is set (not equal to 'None'), this\n\t\t///     stores the expression of the directive.\n\t\t/// </summary>\n\t\tpublic StringBuilder DirectiveStatement;\n\n\t\tpublic PreProcessorState()\n\t\t{\n\t\t\tDirectiveType = PreProcessorDirective.None;\n\t\t\tDirectiveStatement = new StringBuilder();\n\t\t}\n\n\t\tpublic PreProcessorState(PreProcessorState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tDirectiveType = prototype.DirectiveType;\n\t\t\tDirectiveStatement = new StringBuilder(prototype.DirectiveStatement.ToString());\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\t// HACK: if this change would be left for the CheckKeyword method, we will lose\n\t\t\t//       it if the next pushed char is newLineChar since ThisLineIndent will be \n\t\t\t//       immediately replaced with NextLineIndent. As this most likely will\n\t\t\t//       happen, we check for \"endregion\" on every push.\n\t\t\tif (Engine.wordToken.ToString() == \"endregion\")\n\t\t\t{\n\t\t\t\tCheckKeywordOnPush(\"endregion\");\n\t\t\t}\n\n\t\t\tbase.Push(ch);\n\n\t\t\tif (DirectiveType != PreProcessorDirective.None)\n\t\t\t{\n\t\t\t\tDirectiveStatement.Append(ch);\n\t\t\t}\n\n\t\t\tif (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t\tswitch (DirectiveType)\n\t\t\t\t{\n\t\t\t\t\tcase PreProcessorDirective.If:\n\t\t\t\t\t\tEngine.ifDirectiveEvalResults.Push(eval(DirectiveStatement.ToString()));\n\t\t\t\t\t\tif (Engine.ifDirectiveEvalResults.Peek())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// the if/elif directive is true -> continue with the previous state\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// the if/elif directive is false -> change to a state that will \n\t\t\t\t\t\t\t// ignore any chars until #endif or #elif\n\t\t\t\t\t\t\tChangeState<PreProcessorCommentState>();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Elif:\n\t\t\t\t\t\tif (Engine.ifDirectiveEvalResults.Count > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!Engine.ifDirectiveEvalResults.Peek())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEngine.ifDirectiveEvalResults.Pop();\n\t\t\t\t\t\t\t\tgoto case PreProcessorDirective.If;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// previous if was true -> comment\n\t\t\t\t\t\tChangeState<PreProcessorCommentState>();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Else:\n\t\t\t\t\t\tif (Engine.ifDirectiveEvalResults.Count > 0 && Engine.ifDirectiveEvalResults.Peek())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// some if/elif directive was true -> change to a state that will \n\t\t\t\t\t\t\t// ignore any chars until #endif\n\t\t\t\t\t\t\tChangeState<PreProcessorCommentState>();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// none if/elif directives were true -> continue with the previous state\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Define:\n\t\t\t\t\t\tvar defineSymbol = DirectiveStatement.ToString().Trim();\n\t\t\t\t\t\tif (!Engine.conditionalSymbols.Contains(defineSymbol))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEngine.conditionalSymbols.Add(defineSymbol);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Undef:\n\t\t\t\t\t\tvar undefineSymbol = DirectiveStatement.ToString().Trim();\n\t\t\t\t\t\tif (Engine.conditionalSymbols.Contains(undefineSymbol))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEngine.conditionalSymbols.Remove(undefineSymbol);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Endif:\n\t\t\t\t\t\t// marks the end of this block\n\t\t\t\t\t\tEngine.ifDirectiveEvalResults.Pop();\n\t\t\t\t\t\tEngine.ifDirectiveIndents.Pop();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Region:\n\t\t\t\t\tcase PreProcessorDirective.Pragma:\n\t\t\t\t\tcase PreProcessorDirective.Warning:\n\t\t\t\t\tcase PreProcessorDirective.Error:\n\t\t\t\t\tcase PreProcessorDirective.Line:\n\t\t\t\t\t\t// continue with the previous state\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\t// OPTION: IndentPreprocessorStatements\n\t\t\tif (Engine.formattingOptions.IndentPreprocessorDirectives)\n\t\t\t{\n\t\t\t\tif (Engine.ifDirectiveIndents.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent = Engine.ifDirectiveIndents.Peek().Clone();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tThisLineIndent = new Indent(Engine.textEditorOptions);\n\t\t\t}\n\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tstatic readonly Dictionary<string, PreProcessorDirective> preProcessorDirectives = new Dictionary<string, PreProcessorDirective>\n\t\t{\n\t\t\t{ \"if\", PreProcessorDirective.If },\n\t\t\t{ \"elif\", PreProcessorDirective.Elif },\n\t\t\t{ \"else\", PreProcessorDirective.Else },\n\t\t\t{ \"endif\", PreProcessorDirective.Endif },\n\t\t\t{ \"region\", PreProcessorDirective.Region },\n\t\t\t{ \"endregion\", PreProcessorDirective.Endregion },\n\t\t\t{ \"pragma\", PreProcessorDirective.Pragma },\n\t\t\t{ \"warning\", PreProcessorDirective.Warning },\n\t\t\t{ \"error\", PreProcessorDirective.Error },\n\t\t\t{ \"line\", PreProcessorDirective.Line },\n\t\t\t{ \"define\", PreProcessorDirective.Define },\n\t\t\t{ \"undef\", PreProcessorDirective.Undef }\n\t\t};\n\n\t\tpublic override void CheckKeywordOnPush(string keyword)\n\t\t{\n\t\t\tif (keyword == \"endregion\")\n\t\t\t{\n\t\t\t\tDirectiveType = PreProcessorDirective.Endregion;\n\t\t\t\tThisLineIndent = Parent.NextLineIndent.Clone();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void CheckKeyword(string keyword)\n\t\t{\n\t\t\t// check if the directive type has already been set\n\t\t\tif (DirectiveType != PreProcessorDirective.None)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (preProcessorDirectives.ContainsKey(keyword))\n\t\t\t{\n\t\t\t\tDirectiveType = preProcessorDirectives[keyword];\n\n\t\t\t\t// adjust the indentation for the region directive\n\t\t\t\tif (DirectiveType == PreProcessorDirective.Region)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent = Parent.NextLineIndent.Clone();\n\t\t\t\t}\n\t\t\t\telse if (DirectiveType == PreProcessorDirective.If)\n\t\t\t\t{\n\t\t\t\t\tEngine.ifDirectiveIndents.Push(ThisLineIndent.Clone());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new PreProcessorState(this, engine);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Types of preprocessor directives.\n\t\t/// </summary>\n\t\tpublic enum PreProcessorDirective\n\t\t{\n\t\t\tNone,\n\t\t\tIf,\n\t\t\tElif,\n\t\t\tElse,\n\t\t\tEndif,\n\t\t\tRegion,\n\t\t\tEndregion,\n\t\t\tPragma,\n\t\t\tWarning,\n\t\t\tError,\n\t\t\tLine,\n\t\t\tDefine,\n\t\t\tUndef\n\t\t}\n\n\t\t#region Pre processor evaluation (from cs-tokenizer.cs)\n\n\t\tstatic bool is_identifier_start_character(int c)\n\t\t{\n\t\t\treturn (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || Char.IsLetter((char)c);\n\t\t}\n\n\t\tstatic bool is_identifier_part_character(char c)\n\t\t{\n\t\t\tif (c >= 'a' && c <= 'z')\n\t\t\t\treturn true;\n\n\t\t\tif (c >= 'A' && c <= 'Z')\n\t\t\t\treturn true;\n\n\t\t\tif (c == '_' || (c >= '0' && c <= '9'))\n\t\t\t\treturn true;\n\n\t\t\tif (c < 0x80)\n\t\t\t\treturn false;\n\n\t\t\treturn Char.IsLetter(c) || Char.GetUnicodeCategory(c) == UnicodeCategory.ConnectorPunctuation;\n\t\t}\n\n\t\tbool eval_val(string s)\n\t\t{\n\t\t\tif (s == \"true\")\n\t\t\t\treturn true;\n\t\t\tif (s == \"false\")\n\t\t\t\treturn false;\n\n\t\t\treturn Engine.conditionalSymbols != null && Engine.conditionalSymbols.Contains(s) ||\n\t\t\t\tEngine.customConditionalSymbols != null && Engine.customConditionalSymbols.Contains(s);\n\t\t}\n\n\t\tbool pp_primary(ref string s)\n\t\t{\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tchar c = s[0];\n\n\t\t\t\tif (c == '(')\n\t\t\t\t{\n\t\t\t\t\ts = s.Substring(1);\n\t\t\t\t\tbool val = pp_expr(ref s, false);\n\t\t\t\t\tif (s.Length > 0 && s[0] == ')')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(1);\n\t\t\t\t\t\treturn val;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (is_identifier_start_character(c))\n\t\t\t\t{\n\t\t\t\t\tint j = 1;\n\n\t\t\t\t\twhile (j < len)\n\t\t\t\t\t{\n\t\t\t\t\t\tc = s[j];\n\n\t\t\t\t\t\tif (is_identifier_part_character(c))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbool v = eval_val(s.Substring(0, j));\n\t\t\t\t\t\ts = s.Substring(j);\n\t\t\t\t\t\treturn v;\n\t\t\t\t\t}\n\t\t\t\t\tbool vv = eval_val(s);\n\t\t\t\t\ts = \"\";\n\t\t\t\t\treturn vv;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tbool pp_unary(ref string s)\n\t\t{\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tif (s[0] == '!')\n\t\t\t\t{\n\t\t\t\t\tif (len > 1 && s[1] == '=')\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\ts = s.Substring(1);\n\t\t\t\t\treturn !pp_primary(ref s);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn pp_primary(ref s);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool pp_eq(ref string s)\n\t\t{\n\t\t\tbool va = pp_unary(ref s);\n\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tif (s[0] == '=')\n\t\t\t\t{\n\t\t\t\t\tif (len > 2 && s[1] == '=')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(2);\n\t\t\t\t\t\treturn va == pp_unary(ref s);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (s[0] == '!' && len > 1 && s[1] == '=')\n\t\t\t\t{\n\t\t\t\t\ts = s.Substring(2);\n\n\t\t\t\t\treturn va != pp_unary(ref s);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn va;\n\n\t\t}\n\n\t\tbool pp_and(ref string s)\n\t\t{\n\t\t\tbool va = pp_eq(ref s);\n\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tif (s[0] == '&')\n\t\t\t\t{\n\t\t\t\t\tif (len > 2 && s[1] == '&')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(2);\n\t\t\t\t\t\treturn (va & pp_and(ref s));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn va;\n\t\t}\n\n\t\t//\n\t\t// Evaluates an expression for `#if' or `#elif'\n\t\t//\n\t\tbool pp_expr(ref string s, bool isTerm)\n\t\t{\n\t\t\tbool va = pp_and(ref s);\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tchar c = s[0];\n\n\t\t\t\tif (c == '|')\n\t\t\t\t{\n\t\t\t\t\tif (len > 2 && s[1] == '|')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(2);\n\t\t\t\t\t\treturn va | pp_expr(ref s, isTerm);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isTerm)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn va;\n\t\t}\n\n\t\tbool eval(string s)\n\t\t{\n\t\t\tbool v = pp_expr(ref s, true);\n\t\t\ts = s.Trim();\n\t\t\tif (s.Length != 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn v;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t#endregion\n\n\t#region PreProcessorComment state\n\n\t/// <summary>\n\t///     PreProcessor comment state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Activates when the #if or #elif directive is false and ignores\n\t///     all pushed chars until the next '#'.\n\t/// </remarks>\n\tpublic class PreProcessorCommentState : IndentState\n\t{\n\t\tpublic PreProcessorCommentState()\n\t\t{ }\n\n\t\tpublic PreProcessorCommentState(PreProcessorCommentState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == '#' && Engine.isLineStart)\n\t\t\t{\n\t\t\t\t// TODO: Return back only on #if/#elif/#else/#endif\n\t\t\t\t// Ignore any of the other directives (especially #define/#undef)\n\t\t\t\tExitState();\n\t\t\t\tChangeState<PreProcessorState>();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tif (Engine.formattingOptions.IndentPreprocessorDirectives &&\n\t\t\t    Engine.ifDirectiveIndents.Count > 0)\n\t\t\t{\n\t\t\t\tThisLineIndent = Engine.ifDirectiveIndents.Peek().Clone();\n\t\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tThisLineIndent = Parent.NextLineIndent.Clone();\n\t\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t}\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new PreProcessorCommentState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region LineComment state\n\n\t/// <summary>\n\t///     Single-line comment state.\n\t/// </summary>\n\tpublic class LineCommentState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     It's possible that this should be the DocComment state:\n\t\t///         check if the first next pushed char is equal to '/'.\n\t\t/// </summary>\n\t\tpublic bool CheckForDocComment = true;\n\n\t\tpublic LineCommentState()\n\t\t{\n\t\t\t/*\t\t\tif (engine.formattingOptions.KeepCommentsAtFirstColumn && engine.column == 2)\n\t\t\t\tThisLineIndent.Reset();*/\n\t\t}\n\n\t\tpublic LineCommentState(LineCommentState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tCheckForDocComment = prototype.CheckForDocComment;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\t// to handle cases like //\\n/*\n\t\t\t\t// Otherwise line 2 would be treated as line comment.\n\t\t\t\tEngine.previousChar = '\\0';\n\t\t\t\tExitState();\n\t\t\t}\n\t\t\telse if (ch == '/' && CheckForDocComment)\n\t\t\t{\n\t\t\t\t// wrong state, should be DocComment.\n\t\t\t\tExitState();\n\t\t\t\tChangeState<DocCommentState>();\n\t\t\t}\n\n\t\t\tCheckForDocComment = false;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new LineCommentState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region DocComment state\n\n\t/// <summary>\n\t///     XML documentation comment state.\n\t/// </summary>\n\tpublic class DocCommentState : IndentState\n\t{\n\t\tpublic DocCommentState()\n\t\t{ }\n\n\t\tpublic DocCommentState(DocCommentState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new DocCommentState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region MultiLineComment state\n\n\t/// <summary>\n\t///     Multi-line comment state.\n\t/// </summary>\n\tpublic class MultiLineCommentState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if any char has been pushed to this state.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     Needed to resolve an issue when the first pushed char is '/'.\n\t\t///     The state would falsely exit on this sequence of chars '/*/',\n\t\t///     since it only checks if the last two chars are '/' and '*'.\n\t\t/// </remarks>\n\t\tpublic bool IsAnyCharPushed;\n\n\t\tpublic MultiLineCommentState()\n\t\t{ }\n\n\t\tpublic MultiLineCommentState(MultiLineCommentState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tIsAnyCharPushed = prototype.IsAnyCharPushed;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == '/' && Engine.previousChar == '*' && IsAnyCharPushed)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\n\t\t\tIsAnyCharPushed = true;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new MultiLineCommentState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region StringLiteral state\n\n\t/// <summary>\n\t///     StringLiteral state.\n\t/// </summary>\n\tpublic class StringLiteralState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if the next char is escaped with '\\'.\n\t\t/// </summary>\n\t\tpublic bool IsEscaped;\n\n\t\tpublic StringLiteralState()\n\t\t{ }\n\n\t\tpublic StringLiteralState(StringLiteralState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tIsEscaped = prototype.IsEscaped;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.newLineChar || (!IsEscaped && ch == '\"')) {\n\t\t\t\tExitState();\n\t\t\t} else {\n\t\t\t\tIsEscaped = ch == '\\\\' && !IsEscaped;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new StringLiteralState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Verbatim string state\n\n\t/// <summary>\n\t///     Verbatim string state.\n\t/// </summary>\n\tpublic class VerbatimStringState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if there is an odd number of '\"' in a row.\n\t\t/// </summary>\n\t\tpublic bool IsEscaped;\n\n\t\tpublic VerbatimStringState()\n\t\t{ }\n\n\t\tpublic VerbatimStringState(VerbatimStringState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tIsEscaped = prototype.IsEscaped;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (IsEscaped && ch != '\"')\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t\t// the char has been pushed to the wrong state, push it back\n\t\t\t\tEngine.currentState.Push(ch);\n\t\t\t}\n\n\t\t\tIsEscaped = ch == '\"' && !IsEscaped;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = new Indent(Engine.textEditorOptions);\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new VerbatimStringState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Character state\n\n\t/// <summary>\n\t///     Character state.\n\t/// </summary>\n\tpublic class CharacterState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if the next char is escaped with '\\'.\n\t\t/// </summary>\n\t\tpublic bool IsEscaped;\n\n\t\tpublic CharacterState()\n\t\t{ }\n\n\t\tpublic CharacterState(CharacterState prototype, CSharpIndentEngine engine)\n\t\t\t: base(prototype, engine)\n\t\t{\n\t\t\tIsEscaped = prototype.IsEscaped;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.newLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\t\t\telse if (!IsEscaped && ch == '\\'')\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\n\t\t\tIsEscaped = ch == '\\\\' && !IsEscaped;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone(CSharpIndentEngine engine)\n\t\t{\n\t\t\treturn new CharacterState(this, engine);\n\t\t}\n\t}\n\n\t#endregion\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/NullIStateMachineIndentEngine.cs",
    "content": "//\n// NullIStateMachineIndentEngine.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// An empty IStateMachineIndentEngine implementation that does nothing.\n\t/// </summary>\n\tpublic sealed class NullIStateMachineIndentEngine : IStateMachineIndentEngine\n\t{\n\t\treadonly ICSharpCode.NRefactory.Editor.IDocument document;\n\t\tint offset;\n\n\t\tpublic NullIStateMachineIndentEngine(ICSharpCode.NRefactory.Editor.IDocument document)\n\t\t{\n\t\t\tif (document == null)\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\tthis.document = document;\n\t\t}\n\n\t\t#region IStateMachineIndentEngine implementation\n\t\tpublic IStateMachineIndentEngine Clone()\n\t\t{\n\t\t\treturn new NullIStateMachineIndentEngine(document) { offset = this.offset };\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsidePreprocessorDirective {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsidePreprocessorComment {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideStringLiteral {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideVerbatimString {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideCharacter {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideString {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideLineComment {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideMultiLineComment {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideDocLineComment {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideComment {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideOrdinaryComment {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.IsInsideOrdinaryCommentOrString {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.LineBeganInsideVerbatimString {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IStateMachineIndentEngine.LineBeganInsideMultiLineComment {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region IDocumentIndentEngine implementation\n\t\tvoid IDocumentIndentEngine.Push(char ch)\n\t\t{\n\t\t\toffset++;\n\t\t}\n\n\t\tvoid IDocumentIndentEngine.Reset()\n\t\t{\n\t\t\tthis.offset = 0;\n\t\t}\n\n\t\tvoid IDocumentIndentEngine.Update(int offset)\n\t\t{\n\t\t\tthis.offset = offset;\n\t\t}\n\n\t\tIDocumentIndentEngine IDocumentIndentEngine.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\tICSharpCode.NRefactory.Editor.IDocument IDocumentIndentEngine.Document {\n\t\t\tget {\n\t\t\t\treturn document;\n\t\t\t}\n\t\t}\n\n\t\tstring IDocumentIndentEngine.ThisLineIndent {\n\t\t\tget {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\n\t\tstring IDocumentIndentEngine.NextLineIndent {\n\t\t\tget {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\n\t\tstring IDocumentIndentEngine.CurrentIndent {\n\t\t\tget {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\n\t\tbool IDocumentIndentEngine.NeedsReindent {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tint IDocumentIndentEngine.Offset {\n\t\t\tget {\n\t\t\t\treturn offset;\n\t\t\t}\n\t\t}\n\t\tTextLocation IDocumentIndentEngine.Location {\n\t\t\tget {\n\t\t\t\treturn TextLocation.Empty;\n\t\t\t}\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic bool EnableCustomIndentLevels\n\t\t{\n\t\t\tget { return false; }\n\t\t\tset { }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ICloneable implementation\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IndentEngine/TextPasteIndentEngine.cs",
    "content": "﻿//\n// TextPasteIndentEngine.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Editor;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t///     Represents a decorator of an IStateMachineIndentEngine instance\n\t///     that provides logic for text paste events.\n\t/// </summary>\n\tpublic class TextPasteIndentEngine : IDocumentIndentEngine, ITextPasteHandler\n\t{\n\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t///     An instance of IStateMachineIndentEngine which handles\n\t\t///     the indentation logic.\n\t\t/// </summary>\n\t\tIStateMachineIndentEngine engine;\n\t\t/// <summary>\n\t\t///     Text editor options.\n\t\t/// </summary>\n\t\tinternal readonly TextEditorOptions textEditorOptions;\n\t\tinternal readonly CSharpFormattingOptions formattingOptions;\n\t\t#endregion\n\n\t\t#region Constructors\n\n\t\t/// <summary>\n\t\t///     Creates a new TextPasteIndentEngine instance.\n\t\t/// </summary>\n\t\t/// <param name=\"decoratedEngine\">\n\t\t///     An instance of <see cref=\"IStateMachineIndentEngine\"/> to which the\n\t\t///     logic for indentation will be delegated.\n\t\t/// </param>\n\t\t/// <param name=\"textEditorOptions\">\n\t\t///    Text editor options for indentation.\n\t\t/// </param>\n\t\t/// <param name=\"formattingOptions\">\n\t\t///     C# formatting options.\n\t\t/// </param>\n\t\tpublic TextPasteIndentEngine(IStateMachineIndentEngine decoratedEngine, TextEditorOptions textEditorOptions, CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\tthis.engine = decoratedEngine;\n\t\t\tthis.textEditorOptions = textEditorOptions;\n\t\t\tthis.formattingOptions = formattingOptions;\n\n\t\t\tthis.engine.EnableCustomIndentLevels = false;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ITextPasteHandler\n\n\t\t/// <inheritdoc />\n\t\tstring ITextPasteHandler.FormatPlainText(int offset, string text, byte[] copyData)\n\t\t{\n\t\t\tif (copyData != null && copyData.Length == 1) {\n\t\t\t\tvar strategy = TextPasteUtils.Strategies [(PasteStrategy)copyData [0]];\n\t\t\t\ttext = strategy.Decode(text);\n\t\t\t}\n\t\t\tengine.Update(offset);\n\t\t\tif (engine.IsInsideStringLiteral) {\n\t\t\t\tint idx = text.IndexOf('\"');\n\t\t\t\tif (idx > 0) {\n\t\t\t\t\tvar o = offset;\n\t\t\t\t\twhile (o < engine.Document.TextLength) {\n\t\t\t\t\t\tchar ch = engine.Document.GetCharAt(o);\n\t\t\t\t\t\tengine.Push(ch); \n\t\t\t\t\t\tif (NewLine.IsNewLine(ch))\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\to++;\n\t\t\t\t\t\tif (!engine.IsInsideStringLiteral)\n\t\t\t\t\t\t\treturn TextPasteUtils.StringLiteralStrategy.Encode(text);\n\t\t\t\t\t}\n\t\t\t\t\treturn TextPasteUtils.StringLiteralStrategy.Encode(text.Substring(0, idx)) + text.Substring(idx);\n\t\t\t\t}\n\t\t\t\treturn TextPasteUtils.StringLiteralStrategy.Encode(text);\n\n\t\t\t} else if (engine.IsInsideVerbatimString) {\n\n\t\t\t\tint idx = text.IndexOf('\"');\n\t\t\t\tif (idx > 0) {\n\t\t\t\t\tvar o = offset;\n\t\t\t\t\twhile (o < engine.Document.TextLength) {\n\t\t\t\t\t\tchar ch = engine.Document.GetCharAt(o);\n\t\t\t\t\t\tengine.Push(ch); \n\t\t\t\t\t\to++;\n\t\t\t\t\t\tif (!engine.IsInsideVerbatimString)\n\t\t\t\t\t\t\treturn TextPasteUtils.VerbatimStringStrategy.Encode(text);\n\t\t\t\t\t}\n\t\t\t\t\treturn TextPasteUtils.VerbatimStringStrategy.Encode(text.Substring(0, idx)) + text.Substring(idx);\n\t\t\t\t}\n\n\t\t\t\treturn TextPasteUtils.VerbatimStringStrategy.Encode(text);\n\t\t\t}\n\t\t\tvar line = engine.Document.GetLineByOffset(offset);\n\t\t\tvar pasteAtLineStart = line.Offset == offset;\n\t\t\tvar indentedText = new StringBuilder();\n\t\t\tvar curLine = new StringBuilder();\n\t\t\tvar clonedEngine = engine.Clone();\n\t\t\tbool isNewLine = false, gotNewLine = false;\n\t\t\tfor (int i = 0; i < text.Length; i++) {\n\t\t\t\tvar ch = text [i];\n\t\t\t\tif (clonedEngine.IsInsideVerbatimString || clonedEngine.IsInsideMultiLineComment) {\n\t\t\t\t\tclonedEngine.Push(ch);\n\t\t\t\t\tcurLine.Append(ch);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar delimiterLength = NewLine.GetDelimiterLength(ch, i + 1 < text.Length ? text[i + 1] : ' ');\n\t\t\t\tif (delimiterLength > 0) {\n\t\t\t\t\tisNewLine = true;\n\t\t\t\t\tif (gotNewLine || pasteAtLineStart) {\n\t\t\t\t\t\tif (curLine.Length > 0 || formattingOptions.EmptyLineFormatting == EmptyLineFormatting.Indent)\n\t\t\t\t\t\t\tindentedText.Append(clonedEngine.ThisLineIndent);\n\t\t\t\t\t}\n\t\t\t\t\tindentedText.Append(curLine);\n\t\t\t\t\tindentedText.Append(textEditorOptions.EolMarker);\n\t\t\t\t\tcurLine.Length = 0;\n\t\t\t\t\tgotNewLine = true;\n\t\t\t\t\ti += delimiterLength - 1;\n\t\t\t\t\t// textEditorOptions.EolMarker[0] is the newLineChar used by the indentation engine.\n\t\t\t\t\tclonedEngine.Push(textEditorOptions.EolMarker[0]);\n\t\t\t\t} else {\n\t\t\t\t\tif (isNewLine) {\n\t\t\t\t\t\tif (ch == '\\t' || ch == ' ') {\n\t\t\t\t\t\t\tclonedEngine.Push(ch);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisNewLine = false;\n\t\t\t\t\t}\n\t\t\t\t\tcurLine.Append(ch);\n\t\t\t\t\tclonedEngine.Push(ch);\n\t\t\t\t}\n\t\t\t\tif (clonedEngine.IsInsideVerbatimString || clonedEngine.IsInsideMultiLineComment && \n\t\t\t\t    !(clonedEngine.LineBeganInsideVerbatimString || clonedEngine.LineBeganInsideMultiLineComment)) {\n\t\t\t\t\tif (gotNewLine) {\n\t\t\t\t\t\tif (curLine.Length > 0 || formattingOptions.EmptyLineFormatting == EmptyLineFormatting.Indent)\n\t\t\t\t\t\t\tindentedText.Append(clonedEngine.ThisLineIndent);\n\t\t\t\t\t}\n\t\t\t\t\tpasteAtLineStart = false;\n\t\t\t\t\tindentedText.Append(curLine);\n\t\t\t\t\tcurLine.Length = 0;\n\t\t\t\t\tgotNewLine = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (gotNewLine && (!pasteAtLineStart || curLine.Length > 0)) {\n\t\t\t\tindentedText.Append(clonedEngine.ThisLineIndent);\n\t\t\t}\n\t\t\tif (curLine.Length > 0) {\n\t\t\t\tindentedText.Append(curLine);\n\t\t\t}\n\t\t\treturn indentedText.ToString();\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tbyte[] ITextPasteHandler.GetCopyData(ISegment segment)\n\t\t{\n\t\t\tengine.Update(segment.Offset);\n\t\t\t\n\t\t\tif (engine.IsInsideStringLiteral) {\n\t\t\t\treturn new[] { (byte)PasteStrategy.StringLiteral };\n\t\t\t} else if (engine.IsInsideVerbatimString) {\n\t\t\t\treturn new[] { (byte)PasteStrategy.VerbatimString };\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDocumentIndentEngine\n\n\t\t/// <inheritdoc />\n\t\tpublic IDocument Document {\n\t\t\tget { return engine.Document; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string ThisLineIndent {\n\t\t\tget { return engine.ThisLineIndent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string NextLineIndent {\n\t\t\tget { return engine.NextLineIndent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic string CurrentIndent {\n\t\t\tget { return engine.CurrentIndent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic bool NeedsReindent {\n\t\t\tget { return engine.NeedsReindent; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic int Offset {\n\t\t\tget { return engine.Offset; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic TextLocation Location {\n\t\t\tget { return engine.Location; }\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic bool EnableCustomIndentLevels {\n\t\t\tget { return engine.EnableCustomIndentLevels; }\n\t\t\tset { engine.EnableCustomIndentLevels = value; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc />\n\t\tpublic void Push(char ch)\n\t\t{\n\t\t\tengine.Push(ch);\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic void Reset()\n\t\t{\n\t\t\tengine.Reset();\n\t\t}\n\n\t\t/// <inheritdoc />\n\t\tpublic void Update(int offset)\n\t\t{\n\t\t\tengine.Update(offset);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IClonable\n\n\t\tpublic IDocumentIndentEngine Clone()\n\t\t{\n\t\t\treturn new TextPasteIndentEngine(engine, textEditorOptions, formattingOptions);\n\t\t}\n\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\t#endregion\n\n\t}\n\n\t/// <summary>\n\t///     Types of text-paste strategies.\n\t/// </summary>\n\tpublic enum PasteStrategy : byte\n\t{\n\t\tPlainText = 0,\n\t\tStringLiteral = 1,\n\t\tVerbatimString = 2\n\t}\n\n\t/// <summary>\n\t///     Defines some helper methods for dealing with text-paste events.\n\t/// </summary>\n\tpublic static class TextPasteUtils\n\t{\n\t\t/// <summary>\n\t\t///     Collection of text-paste strategies.\n\t\t/// </summary>\n\t\tpublic static TextPasteStrategies Strategies = new TextPasteStrategies();\n\n\t\t/// <summary>\n\t\t///     The interface for a text-paste strategy.\n\t\t/// </summary>\n\t\tpublic interface IPasteStrategy\n\t\t{\n\t\t\t/// <summary>\n\t\t\t///     Formats the given text according with this strategy rules.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"text\">\n\t\t\t///    The text to format.\n\t\t\t/// </param>\n\t\t\t/// <returns>\n\t\t\t///     Formatted text.\n\t\t\t/// </returns>\n\t\t\tstring Encode(string text);\n\n\t\t\t/// <summary>\n\t\t\t///     Converts text formatted according with this strategy rules\n\t\t\t///     to its original form.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"text\">\n\t\t\t///     Formatted text to convert.\n\t\t\t/// </param>\n\t\t\t/// <returns>\n\t\t\t///     Original form of the given formatted text.\n\t\t\t/// </returns>\n\t\t\tstring Decode(string text);\n\n\t\t\t/// <summary>\n\t\t\t///     Type of this strategy.\n\t\t\t/// </summary>\n\t\t\tPasteStrategy Type { get; }\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Wrapper that discovers all defined text-paste strategies and defines a way\n\t\t///     to easily access them through their <see cref=\"PasteStrategy\"/> type.\n\t\t/// </summary>\n\t\tpublic sealed class TextPasteStrategies\n\t\t{\n\t\t\t/// <summary>\n\t\t\t///     Collection of discovered text-paste strategies.\n\t\t\t/// </summary>\n\t\t\tIDictionary<PasteStrategy, IPasteStrategy> strategies;\n\n\t\t\t/// <summary>\n\t\t\t///     Uses reflection to find all types derived from <see cref=\"IPasteStrategy\"/>\n\t\t\t///     and adds an instance of each strategy to <see cref=\"strategies\"/>.\n\t\t\t/// </summary>\n\t\t\tpublic TextPasteStrategies()\n\t\t\t{\n\t\t\t\tstrategies = Assembly.GetExecutingAssembly()\n\t\t\t\t     .GetTypes()\n\t\t\t\t.Where(t => typeof(IPasteStrategy).IsAssignableFrom(t) && t.IsClass)\n\t\t\t\t.Select(t => (IPasteStrategy)t.GetProperty(\"Instance\").GetValue(null, null))\n\t\t\t\t.ToDictionary(s => s.Type);\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t///     Checks if there is a strategy of the given type and returns it.\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"strategy\">\n\t\t\t///     Type of the strategy instance.\n\t\t\t/// </param>\n\t\t\t/// <returns>\n\t\t\t///     A strategy instance of the requested type,\n\t\t\t///     or <see cref=\"DefaultStrategy\"/> if it wasn't found.\n\t\t\t/// </returns>\n\t\t\tpublic IPasteStrategy this [PasteStrategy strategy] {\n\t\t\t\tget {\n\t\t\t\t\tif (strategies.ContainsKey(strategy)) {\n\t\t\t\t\t\treturn strategies [strategy];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn DefaultStrategy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Doesn't do any formatting. Serves as the default strategy.\n\t\t/// </summary>\n\t\tpublic class PlainTextPasteStrategy : IPasteStrategy\n\t\t{\n\n\t\t\t#region Singleton\n\n\t\t\tpublic static IPasteStrategy Instance {\n\t\t\t\tget {\n\t\t\t\t\treturn instance ?? (instance = new PlainTextPasteStrategy());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic PlainTextPasteStrategy instance;\n\n\t\t\tprotected PlainTextPasteStrategy()\n\t\t\t{\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic string Encode(string text)\n\t\t\t{\n\t\t\t\treturn text;\n\t\t\t}\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic string Decode(string text)\n\t\t\t{\n\t\t\t\treturn text;\n\t\t\t}\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic PasteStrategy Type {\n\t\t\t\tget { return PasteStrategy.PlainText; }\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Escapes chars in the given text so that they don't\n\t\t///     break a valid string literal.\n\t\t/// </summary>\n\t\tpublic class StringLiteralPasteStrategy : IPasteStrategy\n\t\t{\n\n\t\t\t#region Singleton\n\n\t\t\tpublic static IPasteStrategy Instance {\n\t\t\t\tget {\n\t\t\t\t\treturn instance ?? (instance = new StringLiteralPasteStrategy());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic StringLiteralPasteStrategy instance;\n\n\t\t\tprotected StringLiteralPasteStrategy()\n\t\t\t{\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic string Encode(string text)\n\t\t\t{\n\t\t\t\treturn CSharpOutputVisitor.ConvertString(text);\n\t\t\t}\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic string Decode(string text)\n\t\t\t{\n\t\t\t\tvar result = new StringBuilder();\n\t\t\t\tbool isEscaped = false;\n\n\t\t\t\tfor (int i = 0; i < text.Length; i++) {\n\t\t\t\t\tvar ch = text[i];\n\t\t\t\t\tif (isEscaped) {\n\t\t\t\t\t\tswitch (ch) {\n\t\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\t\t\tresult.Append('\\a');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\t\t\tresult.Append('\\b');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'n':\n\t\t\t\t\t\t\t\tresult.Append('\\n');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 't':\n\t\t\t\t\t\t\t\tresult.Append('\\t');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'v':\n\t\t\t\t\t\t\t\tresult.Append('\\v');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'r':\n\t\t\t\t\t\t\t\tresult.Append('\\r');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\t\t\tresult.Append('\\\\');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'f':\n\t\t\t\t\t\t\t\tresult.Append('\\f');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\t\t\tresult.Append(0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '\"':\n\t\t\t\t\t\t\t\tresult.Append('\"');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase '\\'':\n\t\t\t\t\t\t\t\tresult.Append('\\'');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'x':\n\t\t\t\t\t\t\t\tchar r;\n\t\t\t\t\t\t\t\tif (TryGetHex(text, -1, ref i, out r)) {\n\t\t\t\t\t\t\t\t\tresult.Append(r);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgoto default;\n\t\t\t\t\t\t\tcase 'u':\n\t\t\t\t\t\t\t\tif (TryGetHex(text, 4, ref i, out r)) {\n\t\t\t\t\t\t\t\t\tresult.Append(r);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgoto default;\n\t\t\t\t\t\t\tcase 'U':\n\t\t\t\t\t\t\t\tif (TryGetHex(text, 8, ref i, out r)) {\n\t\t\t\t\t\t\t\t\tresult.Append(r);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgoto default;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tresult.Append('\\\\');\n\t\t\t\t\t\t\t\tresult.Append(ch);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisEscaped = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (ch != '\\\\') {\n\t\t\t\t\t\tresult.Append(ch);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tisEscaped = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn result.ToString();\n\t\t\t}\n\n\t\t\tstatic bool TryGetHex(string text, int count, ref int idx, out char r)\n\t\t\t{\n\t\t\t\tint i;\n\t\t\t\tint total = 0;\n\t\t\t\tint top = count != -1 ? count : 4;\n\n\t\t\t\tfor (i = 0; i < top; i++) {\n\t\t\t\t\tint c = text[idx + 1 + i];\n\n\t\t\t\t\tif (c >= '0' && c <= '9')\n\t\t\t\t\t\tc = (int) c - (int) '0';\n\t\t\t\t\telse if (c >= 'A' && c <= 'F')\n\t\t\t\t\t\tc = (int) c - (int) 'A' + 10;\n\t\t\t\t\telse if (c >= 'a' && c <= 'f')\n\t\t\t\t\t\tc = (int) c - (int) 'a' + 10;\n\t\t\t\t\telse {\n\t\t\t\t\t\tr = '\\0';\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\ttotal = (total * 16) + c;\n\t\t\t\t}\n\n\t\t\t\tif (top == 8) {\n\t\t\t\t\tif (total > 0x0010FFFF) {\n\t\t\t\t\t\tr = '\\0';\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (total >= 0x00010000)\n\t\t\t\t\t\ttotal = ((total - 0x00010000) / 0x0400 + 0xD800);\n\t\t\t\t}\n\t\t\t\tr = (char)total;\n\t\t\t\tidx += top;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic PasteStrategy Type {\n\t\t\t\tget { return PasteStrategy.StringLiteral; }\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Escapes chars in the given text so that they don't\n\t\t///     break a valid verbatim string.\n\t\t/// </summary>\n\t\tpublic class VerbatimStringPasteStrategy : IPasteStrategy\n\t\t{\n\n\t\t\t#region Singleton\n\n\t\t\tpublic static IPasteStrategy Instance {\n\t\t\t\tget {\n\t\t\t\t\treturn instance ?? (instance = new VerbatimStringPasteStrategy());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic VerbatimStringPasteStrategy instance;\n\n\t\t\tprotected VerbatimStringPasteStrategy()\n\t\t\t{\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\tstatic readonly Dictionary<char, IEnumerable<char>> encodeReplace = new Dictionary<char, IEnumerable<char>> {\n\t\t\t\t{ '\\\"', \"\\\"\\\"\" },\n\t\t\t};\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic string Encode(string text)\n\t\t\t{\n\t\t\t\treturn string.Concat(text.SelectMany(c => encodeReplace.ContainsKey(c) ? encodeReplace [c] : new[] { c }));\n\t\t\t}\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic string Decode(string text)\n\t\t\t{\n\t\t\t\tbool isEscaped = false;\n\t\t\t\treturn string.Concat(text.Where(c => !(isEscaped = !isEscaped && c == '\"')));\n\t\t\t}\n\n\t\t\t/// <inheritdoc />\n\t\t\tpublic PasteStrategy Type {\n\t\t\t\tget { return PasteStrategy.VerbatimString; }\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     The default text-paste strategy.\n\t\t/// </summary>\n\t\tpublic static IPasteStrategy DefaultStrategy = PlainTextPasteStrategy.Instance;\n\t\t/// <summary>\n\t\t///     String literal text-paste strategy.\n\t\t/// </summary>\n\t\tpublic static IPasteStrategy StringLiteralStrategy = StringLiteralPasteStrategy.Instance;\n\t\t/// <summary>\n\t\t///     Verbatim string text-paste strategy.\n\t\t/// </summary>\n\t\tpublic static IPasteStrategy VerbatimStringStrategy = VerbatimStringPasteStrategy.Instance;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/IntroduceQueryExpressions.cs",
    "content": "//\n// IntroduceQueryExpressions.cs\n//\n// Modified by Luís Reis <luiscubal@gmail.com> (Copyright (C) 2013)\n//\n// Copyright header of the original version follows:\n//\n// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\nusing System;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tstatic class NRefactoryExtensions\n\t{\n\t\tpublic static T Detach<T>(this T node) where T : AstNode\n\t\t{\n\t\t\tnode.Remove();\n\t\t\treturn node;\n\t\t}\n\n\t\tpublic static T CopyAnnotationsFrom<T>(this T node, AstNode other) where T : AstNode\n\t\t{\n\t\t\tforeach (object annotation in other.Annotations) {\n\t\t\t\tnode.AddAnnotation(annotation);\n\t\t\t}\n\t\t\treturn node;\n\t\t}\n\n\t\tpublic static Expression WithName(this Expression node, string patternGroupName)\n\t\t{\n\t\t\treturn new NamedNode(patternGroupName, node);\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Decompiles query expressions.\n\t/// Based on C# 4.0 spec, §7.16.2 Query expression translation\n\t/// </summary>\n\tpublic class IntroduceQueryExpressions\n\t{\n\t\tstatic readonly InvocationExpression castPattern = new InvocationExpression {\n\t\t\tTarget = new MemberReferenceExpression {\n\t\t\t\tTarget = new AnyNode(\"inExpr\"),\n\t\t\t\tMemberName = \"Cast\",\n\t\t\t\tTypeArguments = { new AnyNode(\"targetType\") }\n\t\t\t}};\n\n\t\tpublic Expression ConvertFluentToQuery(Expression node)\n\t\t{\n\t\t\tnode = node.Clone();\n\n\t\t\tvar artificialParent = new ExpressionStatement();\n\t\t\tartificialParent.Expression = node;\n\n\t\t\tDecompileQueries(node);\n\t\t\t// After all queries were decompiled, detect degenerate queries (queries not property terminated with 'select' or 'group')\n\t\t\t// and fix them, either by adding a degenerate select, or by combining them with another query.\n\t\t\tforeach (QueryExpression query in artificialParent.Descendants.OfType<QueryExpression>()) {\n\t\t\t\tQueryFromClause fromClause = (QueryFromClause)query.Clauses.First();\n\t\t\t\tif (IsDegenerateQuery(query)) {\n\t\t\t\t\tstring identifierName = fromClause.Identifier;\n\n\t\t\t\t\t// introduce select for degenerate query\n\t\t\t\t\tquery.Clauses.Add(new QuerySelectClause { Expression = new IdentifierExpression(identifierName) });\n\t\t\t\t}\n\n\t\t\t\tif (fromClause.Type.IsNull) {\n\t\t\t\t\t// See if the data source of this query is a degenerate query,\n\t\t\t\t\t// and combine the queries if possible.\n\t\t\t\t\tQueryExpression innerQuery = fromClause.Expression as QueryExpression;\n\t\t\t\t\twhile (IsDegenerateQuery(innerQuery)) {\n\t\t\t\t\t\tQueryFromClause innerFromClause = (QueryFromClause)innerQuery.Clauses.First();\n\t\t\t\t\t\tif (fromClause.Identifier != innerFromClause.Identifier && !innerFromClause.Identifier.StartsWith(\"<>\"))\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Replace the fromClause with all clauses from the inner query\n\t\t\t\t\t\tfromClause.Remove();\n\t\t\t\t\t\tforeach (var identifierChild in innerQuery.Descendants.OfType<Identifier>().Where(identifier => identifier.Name == innerFromClause.Identifier)) {\n\t\t\t\t\t\t\t//When the identifier is \"<>X\", then replace it with the outer one\n\t\t\t\t\t\t\tidentifierChild.ReplaceWith(fromClause.IdentifierToken.Clone());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tQueryClause insertionPos = null;\n\t\t\t\t\t\tforeach (var clause in innerQuery.Clauses) {\n\t\t\t\t\t\t\tquery.Clauses.InsertAfter(insertionPos, insertionPos = clause.Detach());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfromClause = innerFromClause;\n\t\t\t\t\t\tinnerQuery = fromClause.Expression as QueryExpression;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn artificialParent.Expression.Clone();\n\t\t}\n\n\t\tbool IsDegenerateQuery(QueryExpression query)\n\t\t{\n\t\t\tif (query == null)\n\t\t\t\treturn false;\n\t\t\tvar lastClause = query.Clauses.LastOrDefault();\n\t\t\treturn !(lastClause is QuerySelectClause || lastClause is QueryGroupClause);\n\t\t}\n\n\t\tvoid DecompileQueries(AstNode node)\n\t\t{\n\t\t\tQueryExpression query = DecompileQuery(node as InvocationExpression);\n\t\t\tif (query != null)\n\t\t\t\tnode.ReplaceWith(query);\n\t\t}\n\n\t\tExpression ExtractQuery(MemberReferenceExpression mre)\n\t\t{\n\t\t\tvar inExpression = mre.Target.Clone();\n\t\t\tvar inContent = DecompileQuery(inExpression as InvocationExpression) ?? inExpression;\n\t\t\treturn inContent;\n\t\t}\n\n\t\tQueryExpression DecompileQuery(InvocationExpression invocation)\n\t\t{\n\t\t\tif (invocation == null)\n\t\t\t\treturn null;\n\t\t\tMemberReferenceExpression mre = invocation.Target as MemberReferenceExpression;\n\t\t\tif (mre == null)\n\t\t\t\treturn null;\n\n\t\t\tswitch (mre.MemberName) {\n\t\t\t\tcase \"Select\":\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Count != 1)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tstring parameterName;\n\t\t\t\t\t\tExpression body;\n\t\t\t\t\t\tif (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out body)) {\n\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = ExtractQuery(mre) });\n\t\t\t\t\t\t\tquery.Clauses.Add(new QuerySelectClause { Expression = body.Detach() });\n\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\tcase \"Cast\":\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Count == 0 && mre.TypeArguments.Count == 1) {\n\t\t\t\t\t\t\tvar typeArgument = mre.TypeArguments.First();\n\n\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\tstring varName = GenerateVariableName();\n\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause {\n\t\t\t\t\t\t\t\tIdentifier = varName,\n\t\t\t\t\t\t\t\tExpression = ExtractQuery(mre),\n\t\t\t\t\t\t\t\tType = typeArgument.Detach()\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn query;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\tcase \"GroupBy\":\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Count == 2) {\n\t\t\t\t\t\t\tstring parameterName1, parameterName2;\n\t\t\t\t\t\t\tExpression keySelector, elementSelector;\n\t\t\t\t\t\t\tif (MatchSimpleLambda(invocation.Arguments.ElementAt(0), out parameterName1, out keySelector)\n\t\t\t\t\t\t\t\t&& MatchSimpleLambda(invocation.Arguments.ElementAt(1), out parameterName2, out elementSelector)\n\t\t\t\t\t\t\t\t&& parameterName1 == parameterName2) {\n\t\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = parameterName1, Expression = ExtractQuery(mre) });\n\t\t\t\t\t\t\t\tquery.Clauses.Add(new QueryGroupClause { Projection = elementSelector.Detach(), Key = keySelector.Detach() });\n\t\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (invocation.Arguments.Count == 1) {\n\t\t\t\t\t\t\tstring parameterName;\n\t\t\t\t\t\t\tExpression keySelector;\n\t\t\t\t\t\t\tif (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out keySelector)) {\n\t\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = ExtractQuery(mre) });\n\t\t\t\t\t\t\t\tquery.Clauses.Add(new QueryGroupClause {\n\t\t\t\t\t\t\t\t\tProjection = new IdentifierExpression(parameterName),\n\t\t\t\t\t\t\t\t\tKey = keySelector.Detach()\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\tcase \"SelectMany\":\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Count != 2)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tstring parameterName;\n\t\t\t\t\t\tExpression collectionSelector;\n\t\t\t\t\t\tif (!MatchSimpleLambda(invocation.Arguments.ElementAt(0), out parameterName, out collectionSelector))\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tLambdaExpression lambda = invocation.Arguments.ElementAt(1) as LambdaExpression;\n\t\t\t\t\t\tif (lambda != null && lambda.Parameters.Count == 2 && lambda.Body is Expression) {\n\t\t\t\t\t\t\tParameterDeclaration p1 = lambda.Parameters.ElementAt(0);\n\t\t\t\t\t\t\tParameterDeclaration p2 = lambda.Parameters.ElementAt(1);\n\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = p1.Name, Expression = ExtractQuery(mre) });\n\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = p2.Name, Expression = collectionSelector.Detach() });\n\t\t\t\t\t\t\tquery.Clauses.Add(new QuerySelectClause { Expression = ((Expression)lambda.Body).Detach() });\n\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\tcase \"Where\":\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Count != 1)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tstring parameterName;\n\t\t\t\t\t\tExpression body;\n\t\t\t\t\t\tif (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out body)) {\n\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = ExtractQuery(mre) });\n\t\t\t\t\t\t\tquery.Clauses.Add(new QueryWhereClause { Condition = body.Detach() });\n\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\tcase \"OrderBy\":\n\t\t\t\tcase \"OrderByDescending\":\n\t\t\t\tcase \"ThenBy\":\n\t\t\t\tcase \"ThenByDescending\":\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Count != 1)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tstring parameterName;\n\t\t\t\t\t\tExpression orderExpression;\n\t\t\t\t\t\tif (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out orderExpression)) {\n\t\t\t\t\t\t\tif (ValidateThenByChain(invocation, parameterName)) {\n\t\t\t\t\t\t\t\tQueryOrderClause orderClause = new QueryOrderClause();\n\t\t\t\t\t\t\t\tInvocationExpression tmp = invocation;\n\t\t\t\t\t\t\t\twhile (mre.MemberName == \"ThenBy\" || mre.MemberName == \"ThenByDescending\") {\n\t\t\t\t\t\t\t\t\t// insert new ordering at beginning\n\t\t\t\t\t\t\t\t\torderClause.Orderings.InsertAfter(\n\t\t\t\t\t\t\t\t\t\tnull, new QueryOrdering {\n\t\t\t\t\t\t\t\t\t\tExpression = orderExpression.Detach(),\n\t\t\t\t\t\t\t\t\t\tDirection = (mre.MemberName == \"ThenBy\" ? QueryOrderingDirection.None : QueryOrderingDirection.Descending)\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\ttmp = (InvocationExpression)mre.Target;\n\t\t\t\t\t\t\t\t\tmre = (MemberReferenceExpression)tmp.Target;\n\t\t\t\t\t\t\t\t\tMatchSimpleLambda(tmp.Arguments.Single(), out parameterName, out orderExpression);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// insert new ordering at beginning\n\t\t\t\t\t\t\t\torderClause.Orderings.InsertAfter(\n\t\t\t\t\t\t\t\t\tnull, new QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = orderExpression.Detach(),\n\t\t\t\t\t\t\t\t\tDirection = (mre.MemberName == \"OrderBy\" ? QueryOrderingDirection.None : QueryOrderingDirection.Descending)\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = ExtractQuery(mre) });\n\t\t\t\t\t\t\t\tquery.Clauses.Add(orderClause);\n\t\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\tcase \"Join\":\n\t\t\t\tcase \"GroupJoin\":\n\t\t\t\t\t{\n\t\t\t\t\t\tif (invocation.Arguments.Count != 4)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tExpression source1 = mre.Target;\n\t\t\t\t\t\tExpression source2 = invocation.Arguments.ElementAt(0);\n\t\t\t\t\t\tstring elementName1, elementName2;\n\t\t\t\t\t\tExpression key1, key2;\n\t\t\t\t\t\tif (!MatchSimpleLambda(invocation.Arguments.ElementAt(1), out elementName1, out key1))\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tif (!MatchSimpleLambda(invocation.Arguments.ElementAt(2), out elementName2, out key2))\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\tLambdaExpression lambda = invocation.Arguments.ElementAt(3) as LambdaExpression;\n\t\t\t\t\t\tif (lambda != null && lambda.Parameters.Count == 2 && lambda.Body is Expression) {\n\t\t\t\t\t\t\tParameterDeclaration p1 = lambda.Parameters.ElementAt(0);\n\t\t\t\t\t\t\tParameterDeclaration p2 = lambda.Parameters.ElementAt(1);\n\t\t\t\t\t\t\tQueryExpression query = new QueryExpression();\n\t\t\t\t\t\t\tquery.Clauses.Add(new QueryFromClause { Identifier = elementName1, Expression = source1.Detach() });\n\t\t\t\t\t\t\tQueryJoinClause joinClause = new QueryJoinClause();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjoinClause.JoinIdentifier = elementName2;    // join elementName2\n\t\t\t\t\t\t\tjoinClause.InExpression = source2.Detach();  // in source2\n\n\t\t\t\t\t\t\tMatch castMatch = castPattern.Match(source2);\n\t\t\t\t\t\t\tif (castMatch.Success) {\n\t\t\t\t\t\t\t\tExpression target = castMatch.Get<Expression>(\"inExpr\").Single().Detach();\n\t\t\t\t\t\t\t\tjoinClause.Type = castMatch.Get<AstType>(\"targetType\").Single().Detach();\n\t\t\t\t\t\t\t\tjoinClause.InExpression = target;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tjoinClause.OnExpression = key1.Detach();     // on key1\n\t\t\t\t\t\t\tjoinClause.EqualsExpression = key2.Detach(); // equals key2\n\t\t\t\t\t\t\tif (mre.MemberName == \"GroupJoin\") {\n\t\t\t\t\t\t\t\tjoinClause.IntoIdentifier = p2.Name; // into p2.Name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tquery.Clauses.Add(joinClause);\n\t\t\t\t\t\t\tExpression resultExpr = ((Expression)lambda.Body).Detach();\n\t\t\t\t\t\t\tif (p1.Name != elementName1) {\n\t\t\t\t\t\t\t\tforeach (var identifier in resultExpr.Descendants.OfType<Identifier>().Where(id => id.Name == p1.Name))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tidentifier.Name = elementName1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (p2.Name != elementName2 && mre.MemberName != \"GroupJoin\") {\n\t\t\t\t\t\t\t\tforeach (var identifier in resultExpr.Descendants.OfType<Identifier>().Where(id => id.Name == p2.Name))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tidentifier.Name = elementName2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tquery.Clauses.Add(new QuerySelectClause { Expression = resultExpr });\n\t\t\t\t\t\t\treturn query;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tint id = 1;\n\t\tstring GenerateVariableName()\n\t\t{\n\t\t\treturn \"<>\" + id++;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Ensure that all ThenBy's are correct, and that the list of ThenBy's is terminated by an 'OrderBy' invocation.\n\t\t/// </summary>\n\t\tbool ValidateThenByChain(InvocationExpression invocation, string expectedParameterName)\n\t\t{\n\t\t\tif (invocation == null || invocation.Arguments.Count != 1)\n\t\t\t\treturn false;\n\t\t\tMemberReferenceExpression mre = invocation.Target as MemberReferenceExpression;\n\t\t\tif (mre == null)\n\t\t\t\treturn false;\n\t\t\tstring parameterName;\n\t\t\tExpression body;\n\t\t\tif (!MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out body))\n\t\t\t\treturn false;\n\t\t\tif (parameterName != expectedParameterName)\n\t\t\t\treturn false;\n\n\t\t\tif (mre.MemberName == \"OrderBy\" || mre.MemberName == \"OrderByDescending\")\n\t\t\t\treturn true;\n\t\t\telse if (mre.MemberName == \"ThenBy\" || mre.MemberName == \"ThenByDescending\")\n\t\t\t\treturn ValidateThenByChain(mre.Target as InvocationExpression, expectedParameterName);\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>Matches simple lambdas of the form \"a => b\"</summary>\n\t\tbool MatchSimpleLambda(Expression expr, out string parameterName, out Expression body)\n\t\t{\n\t\t\tLambdaExpression lambda = expr as LambdaExpression;\n\t\t\tif (lambda != null && lambda.Parameters.Count == 1 && lambda.Body is Expression) {\n\t\t\t\tParameterDeclaration p = lambda.Parameters.Single();\n\t\t\t\tif (p.ParameterModifier == ParameterModifier.None) {\n\t\t\t\t\tparameterName = p.Name;\n\t\t\t\t\tbody = (Expression)lambda.Body;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tparameterName = null;\n\t\t\tbody = null;\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/NameLookupMode.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic enum NameLookupMode\n\t{\n\t\t/// <summary>\n\t\t/// Normal name lookup in expressions\n\t\t/// </summary>\n\t\tExpression,\n\t\t/// <summary>\n\t\t/// Name lookup in expression, where the expression is the target of an invocation.\n\t\t/// Such a lookup will only return methods and delegate-typed fields.\n\t\t/// </summary>\n\t\tInvocationTarget,\n\t\t/// <summary>\n\t\t/// Normal name lookup in type references.\n\t\t/// </summary>\n\t\tType,\n\t\t/// <summary>\n\t\t/// Name lookup in the type reference inside a using declaration.\n\t\t/// </summary>\n\t\tTypeInUsingDeclaration,\n\t\t/// <summary>\n\t\t/// Name lookup for base type references.\n\t\t/// </summary>\n\t\tBaseTypeReference\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// C# ambience. Used to convert type system symbols to text (usually for displaying the symbol to the user; e.g. in editor tooltips)\n\t/// </summary>\n\tpublic class CSharpAmbience : IAmbience\n\t{\n\t\tpublic ConversionFlags ConversionFlags { get; set; }\n\t\t\n\t\t#region ConvertSymbol\n\t\t[Obsolete(\"Use ConvertSymbol() instead\")]\n\t\tpublic string ConvertEntity(IEntity entity)\n\t\t{\n\t\t\treturn ConvertSymbol(entity);\n\t\t}\n\t\t\n\t\tpublic string ConvertSymbol(ISymbol symbol)\n\t\t{\n\t\t\tif (symbol == null)\n\t\t\t\tthrow new ArgumentNullException(\"symbol\");\n\t\t\t\n\t\t\tStringWriter writer = new StringWriter();\n\t\t\tConvertSymbol(symbol, new TextWriterTokenWriter(writer), FormattingOptionsFactory.CreateMono ());\n\t\t\treturn writer.ToString();\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use ConvertSymbol() instead\")]\n\t\tpublic void ConvertEntity(IEntity entity, TokenWriter writer, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tConvertSymbol(entity, writer, formattingPolicy);\n\t\t}\n\t\t\n\t\tpublic void ConvertSymbol(ISymbol symbol, TokenWriter writer, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tif (symbol == null)\n\t\t\t\tthrow new ArgumentNullException(\"symbol\");\n\t\t\tif (writer == null)\n\t\t\t\tthrow new ArgumentNullException(\"writer\");\n\t\t\tif (formattingPolicy == null)\n\t\t\t\tthrow new ArgumentNullException(\"formattingPolicy\");\n\t\t\t\n\t\t\tTypeSystemAstBuilder astBuilder = CreateAstBuilder();\n\t\t\tAstNode node = astBuilder.ConvertSymbol(symbol);\n\t\t\tEntityDeclaration entityDecl = node as EntityDeclaration;\n\t\t\tif (entityDecl != null)\n\t\t\t\tPrintModifiers(entityDecl.Modifiers, writer);\n\t\t\t\n\t\t\tif ((ConversionFlags & ConversionFlags.ShowDefinitionKeyword) == ConversionFlags.ShowDefinitionKeyword) {\n\t\t\t\tif (node is TypeDeclaration) {\n\t\t\t\t\tswitch (((TypeDeclaration)node).ClassType) {\n\t\t\t\t\t\tcase ClassType.Class:\n\t\t\t\t\t\t\twriter.WriteKeyword(Roles.ClassKeyword, \"class\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\t\t\twriter.WriteKeyword(Roles.StructKeyword, \"struct\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\t\t\twriter.WriteKeyword(Roles.InterfaceKeyword, \"interface\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\t\t\twriter.WriteKeyword(Roles.EnumKeyword, \"enum\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new Exception(\"Invalid value for ClassType\");\n\t\t\t\t\t}\n\t\t\t\t\twriter.Space();\n\t\t\t\t} else if (node is DelegateDeclaration) {\n\t\t\t\t\twriter.WriteKeyword(Roles.DelegateKeyword, \"delegate\");\n\t\t\t\t\twriter.Space();\n\t\t\t\t} else if (node is EventDeclaration) {\n\t\t\t\t\twriter.WriteKeyword(EventDeclaration.EventKeywordRole, \"event\");\n\t\t\t\t\twriter.Space();\n\t\t\t\t} else if (node is NamespaceDeclaration) {\n\t\t\t\t\twriter.WriteKeyword(Roles.NamespaceKeyword, \"namespace\");\n\t\t\t\t\twriter.Space();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ((ConversionFlags & ConversionFlags.ShowReturnType) == ConversionFlags.ShowReturnType) {\n\t\t\t\tvar rt = node.GetChildByRole(Roles.Type);\n\t\t\t\tif (!rt.IsNull) {\n\t\t\t\t\trt.AcceptVisitor(new CSharpOutputVisitor(writer, formattingPolicy));\n\t\t\t\t\twriter.Space();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (symbol is ITypeDefinition)\n\t\t\t\tWriteTypeDeclarationName((ITypeDefinition)symbol, writer, formattingPolicy);\n\t\t\telse if (symbol is IMember)\n\t\t\t\tWriteMemberDeclarationName((IMember)symbol, writer, formattingPolicy);\n\t\t\telse\n\t\t\t\twriter.WriteIdentifier(Identifier.Create(symbol.Name));\n\t\t\t\n\t\t\tif ((ConversionFlags & ConversionFlags.ShowParameterList) == ConversionFlags.ShowParameterList && HasParameters(symbol)) {\n\t\t\t\twriter.WriteToken(symbol.SymbolKind == SymbolKind.Indexer ? Roles.LBracket : Roles.LPar, symbol.SymbolKind == SymbolKind.Indexer ? \"[\" : \"(\");\n\t\t\t\tbool first = true;\n\t\t\t\tforeach (var param in node.GetChildrenByRole(Roles.Parameter)) {\n\t\t\t\t\tif (first) {\n\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\twriter.WriteToken(Roles.Comma, \",\");\n\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t}\n\t\t\t\t\tparam.AcceptVisitor(new CSharpOutputVisitor(writer, formattingPolicy));\n\t\t\t\t}\n\t\t\t\twriter.WriteToken(symbol.SymbolKind == SymbolKind.Indexer ? Roles.RBracket : Roles.RPar, symbol.SymbolKind == SymbolKind.Indexer ? \"]\" : \")\");\n\t\t\t}\n\t\t\t\n\t\t\tif ((ConversionFlags & ConversionFlags.ShowBody) == ConversionFlags.ShowBody && !(node is TypeDeclaration)) {\n\t\t\t\tIProperty property = symbol as IProperty;\n\t\t\t\tif (property != null) {\n\t\t\t\t\twriter.Space();\n\t\t\t\t\twriter.WriteToken(Roles.LBrace, \"{\");\n\t\t\t\t\twriter.Space();\n\t\t\t\t\tif (property.CanGet) {\n\t\t\t\t\t\twriter.WriteKeyword(PropertyDeclaration.GetKeywordRole, \"get\");\n\t\t\t\t\t\twriter.WriteToken(Roles.Semicolon, \";\");\n\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t}\n\t\t\t\t\tif (property.CanSet) {\n\t\t\t\t\t\twriter.WriteKeyword(PropertyDeclaration.SetKeywordRole, \"set\");\n\t\t\t\t\t\twriter.WriteToken(Roles.Semicolon, \";\");\n\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t}\n\t\t\t\t\twriter.WriteToken(Roles.RBrace, \"}\");\n\t\t\t\t} else {\n\t\t\t\t\twriter.WriteToken(Roles.Semicolon, \";\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool HasParameters(ISymbol e)\n\t\t{\n\t\t\tswitch (e.SymbolKind) {\n\t\t\t\tcase SymbolKind.TypeDefinition:\n\t\t\t\t\treturn ((ITypeDefinition)e).Kind == TypeKind.Delegate;\n\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\tcase SymbolKind.Method:\n\t\t\t\tcase SymbolKind.Operator:\n\t\t\t\tcase SymbolKind.Constructor:\n\t\t\t\tcase SymbolKind.Destructor:\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTypeSystemAstBuilder CreateAstBuilder()\n\t\t{\n\t\t\tTypeSystemAstBuilder astBuilder = new TypeSystemAstBuilder();\n\t\t\tastBuilder.AddAnnotations = true;\n\t\t\tastBuilder.ShowModifiers = (ConversionFlags & ConversionFlags.ShowModifiers) == ConversionFlags.ShowModifiers;\n\t\t\tastBuilder.ShowAccessibility = (ConversionFlags & ConversionFlags.ShowAccessibility) == ConversionFlags.ShowAccessibility;\n\t\t\tastBuilder.AlwaysUseShortTypeNames = (ConversionFlags & ConversionFlags.UseFullyQualifiedTypeNames) != ConversionFlags.UseFullyQualifiedTypeNames;\n\t\t\tastBuilder.ShowParameterNames = (ConversionFlags & ConversionFlags.ShowParameterNames) == ConversionFlags.ShowParameterNames;\n\t\t\treturn astBuilder;\n\t\t}\n\t\t\n\t\tvoid WriteTypeDeclarationName(ITypeDefinition typeDef, TokenWriter writer, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tTypeSystemAstBuilder astBuilder = CreateAstBuilder();\n\t\t\tEntityDeclaration node = astBuilder.ConvertEntity(typeDef);\n\t\t\tif (typeDef.DeclaringTypeDefinition != null) {\n\t\t\t\tWriteTypeDeclarationName(typeDef.DeclaringTypeDefinition, writer, formattingPolicy);\n\t\t\t\twriter.WriteToken(Roles.Dot, \".\");\n\t\t\t} else if ((ConversionFlags & ConversionFlags.UseFullyQualifiedEntityNames) == ConversionFlags.UseFullyQualifiedEntityNames) {\n\t\t\t\tif (!string.IsNullOrEmpty(typeDef.Namespace)) {\n\t\t\t\t\tWriteQualifiedName(typeDef.Namespace, writer, formattingPolicy);\n\t\t\t\t\twriter.WriteToken(Roles.Dot, \".\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.WriteIdentifier(node.NameToken);\n\t\t\tif ((ConversionFlags & ConversionFlags.ShowTypeParameterList) == ConversionFlags.ShowTypeParameterList) {\n\t\t\t\tvar outputVisitor = new CSharpOutputVisitor(writer, formattingPolicy);\n\t\t\t\toutputVisitor.WriteTypeParameters(node.GetChildrenByRole(Roles.TypeParameter));\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteMemberDeclarationName(IMember member, TokenWriter writer, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tTypeSystemAstBuilder astBuilder = CreateAstBuilder();\n\t\t\tEntityDeclaration node = astBuilder.ConvertEntity(member);\n\t\t\tif ((ConversionFlags & ConversionFlags.ShowDeclaringType) == ConversionFlags.ShowDeclaringType) {\n\t\t\t\tConvertType(member.DeclaringType, writer, formattingPolicy);\n\t\t\t\twriter.WriteToken(Roles.Dot, \".\");\n\t\t\t}\n\t\t\tswitch (member.SymbolKind) {\n\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\t\twriter.WriteKeyword(Roles.Identifier, \"this\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase SymbolKind.Constructor:\n\t\t\t\t\tWriteQualifiedName(member.DeclaringType.Name, writer, formattingPolicy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SymbolKind.Destructor:\n\t\t\t\t\twriter.WriteToken(DestructorDeclaration.TildeRole, \"~\");\n\t\t\t\t\tWriteQualifiedName(member.DeclaringType.Name, writer, formattingPolicy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SymbolKind.Operator:\n\t\t\t\t\tswitch (member.Name) {\n\t\t\t\t\t\tcase \"op_Implicit\":\n\t\t\t\t\t\t\twriter.WriteKeyword(OperatorDeclaration.ImplicitRole, \"implicit\");\n\t\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t\t\twriter.WriteKeyword(OperatorDeclaration.OperatorKeywordRole, \"operator\");\n\t\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t\t\tConvertType(member.ReturnType, writer, formattingPolicy);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"op_Explicit\":\n\t\t\t\t\t\t\twriter.WriteKeyword(OperatorDeclaration.ExplicitRole, \"explicit\");\n\t\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t\t\twriter.WriteKeyword(OperatorDeclaration.OperatorKeywordRole, \"operator\");\n\t\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t\t\tConvertType(member.ReturnType, writer, formattingPolicy);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\twriter.WriteKeyword(OperatorDeclaration.OperatorKeywordRole, \"operator\");\n\t\t\t\t\t\t\twriter.Space();\n\t\t\t\t\t\t\tvar operatorType = OperatorDeclaration.GetOperatorType(member.Name);\n\t\t\t\t\t\t\tif (operatorType.HasValue)\n\t\t\t\t\t\t\t\twriter.WriteToken(OperatorDeclaration.GetRole(operatorType.Value), OperatorDeclaration.GetToken(operatorType.Value));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\twriter.WriteIdentifier(node.NameToken);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twriter.WriteIdentifier(Identifier.Create(member.Name));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ((ConversionFlags & ConversionFlags.ShowTypeParameterList) == ConversionFlags.ShowTypeParameterList && member.SymbolKind == SymbolKind.Method) {\n\t\t\t\tvar outputVisitor = new CSharpOutputVisitor(writer, formattingPolicy);\n\t\t\t\toutputVisitor.WriteTypeParameters(node.GetChildrenByRole(Roles.TypeParameter));\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid PrintModifiers(Modifiers modifiers, TokenWriter writer)\n\t\t{\n\t\t\tforeach (var m in CSharpModifierToken.AllModifiers) {\n\t\t\t\tif ((modifiers & m) == m) {\n\t\t\t\t\twriter.WriteKeyword(EntityDeclaration.ModifierRole, CSharpModifierToken.GetModifierName(m));\n\t\t\t\t\twriter.Space();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteQualifiedName(string name, TokenWriter writer, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tvar node = AstType.Create(name);\n\t\t\tvar outputVisitor = new CSharpOutputVisitor(writer, formattingPolicy);\n\t\t\tnode.AcceptVisitor(outputVisitor);\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic string ConvertVariable(IVariable v)\n\t\t{\n\t\t\tTypeSystemAstBuilder astBuilder = CreateAstBuilder();\n\t\t\tAstNode astNode = astBuilder.ConvertVariable(v);\n\t\t\treturn astNode.ToString().TrimEnd(';', '\\r', '\\n', (char)8232);\n\t\t}\n\t\t\n\t\tpublic string ConvertType(IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\t\n\t\t\tTypeSystemAstBuilder astBuilder = CreateAstBuilder();\n\t\t\tastBuilder.AlwaysUseShortTypeNames = (ConversionFlags & ConversionFlags.UseFullyQualifiedEntityNames) != ConversionFlags.UseFullyQualifiedEntityNames;\n\t\t\tAstType astType = astBuilder.ConvertType(type);\n\t\t\treturn astType.ToString();\n\t\t}\n\t\t\n\t\tpublic void ConvertType(IType type, TokenWriter writer, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tTypeSystemAstBuilder astBuilder = CreateAstBuilder();\n\t\t\tastBuilder.AlwaysUseShortTypeNames = (ConversionFlags & ConversionFlags.UseFullyQualifiedEntityNames) != ConversionFlags.UseFullyQualifiedEntityNames;\n\t\t\tAstType astType = astBuilder.ConvertType(type);\n\t\t\tastType.AcceptVisitor(new CSharpOutputVisitor(writer, formattingPolicy));\n\t\t}\n\t\t\n\t\tpublic string ConvertConstantValue(object constantValue)\n\t\t{\n\t\t\treturn TextWriterTokenWriter.PrintPrimitiveValue(constantValue);\n\t\t}\n\t\t\n\t\tpublic string WrapComment(string comment)\n\t\t{\n\t\t\treturn \"// \" + comment;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Outputs the AST.\n\t/// </summary>\n\tpublic class CSharpOutputVisitor : IAstVisitor\n\t{\n\t\treadonly TokenWriter writer;\n\t\treadonly CSharpFormattingOptions policy;\n\t\treadonly Stack<AstNode> containerStack = new Stack<AstNode> ();\n\t\t\n\t\tpublic CSharpOutputVisitor (TextWriter textWriter, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tif (textWriter == null) {\n\t\t\t\tthrow new ArgumentNullException (\"textWriter\");\n\t\t\t}\n\t\t\tif (formattingPolicy == null) {\n\t\t\t\tthrow new ArgumentNullException (\"formattingPolicy\");\n\t\t\t}\n\t\t\tthis.writer = TokenWriter.Create(textWriter);\n\t\t\tthis.policy = formattingPolicy;\n\t\t}\n\t\t\n\t\tpublic CSharpOutputVisitor (TokenWriter writer, CSharpFormattingOptions formattingPolicy)\n\t\t{\n\t\t\tif (writer == null) {\n\t\t\t\tthrow new ArgumentNullException (\"writer\");\n\t\t\t}\n\t\t\tif (formattingPolicy == null) {\n\t\t\t\tthrow new ArgumentNullException (\"formattingPolicy\");\n\t\t\t}\n\t\t\tthis.writer = new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(writer));\n\t\t\tthis.policy = formattingPolicy;\n\t\t}\n\t\t\n\t\t#region StartNode/EndNode\n\t\tvoid StartNode(AstNode node)\n\t\t{\n\t\t\t// Ensure that nodes are visited in the proper nested order.\n\t\t\t// Jumps to different subtrees are allowed only for the child of a placeholder node.\n\t\t\tDebug.Assert(containerStack.Count == 0 || node.Parent == containerStack.Peek() || containerStack.Peek().NodeType == NodeType.Pattern);\n\t\t\tcontainerStack.Push(node);\n\t\t\twriter.StartNode(node);\n\t\t}\n\t\t\n\t\tvoid EndNode(AstNode node)\n\t\t{\n\t\t\tDebug.Assert(node == containerStack.Peek());\n\t\t\tcontainerStack.Pop();\n\t\t\twriter.EndNode(node);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Comma\n\t\t/// <summary>\n\t\t/// Writes a comma.\n\t\t/// </summary>\n\t\t/// <param name=\"nextNode\">The next node after the comma.</param>\n\t\t/// <param name=\"noSpaceAfterComma\">When set prevents printing a space after comma.</param>\n\t\tvoid Comma(AstNode nextNode, bool noSpaceAfterComma = false)\n\t\t{\n\t\t\tSpace(policy.SpaceBeforeBracketComma);\n\t\t\t// TODO: Comma policy has changed.\n\t\t\twriter.WriteToken(Roles.Comma, \",\");\n\t\t\tSpace(!noSpaceAfterComma && policy.SpaceAfterBracketComma);\n\t\t\t// TODO: Comma policy has changed.\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Writes an optional comma, e.g. at the end of an enum declaration or in an array initializer\n\t\t/// </summary>\n\t\tvoid OptionalComma(AstNode pos)\n\t\t{\n\t\t\t// Look if there's a comma after the current node, and insert it if it exists.\n\t\t\twhile (pos != null && pos.NodeType == NodeType.Whitespace) {\n\t\t\t\tpos = pos.NextSibling;\n\t\t\t}\n\t\t\tif (pos != null && pos.Role == Roles.Comma) {\n\t\t\t\tComma(null, noSpaceAfterComma: true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Writes an optional semicolon, e.g. at the end of a type or namespace declaration.\n\t\t/// </summary>\n\t\tvoid OptionalSemicolon(AstNode pos)\n\t\t{\n\t\t\t// Look if there's a semicolon after the current node, and insert it if it exists.\n\t\t\twhile (pos != null && pos.NodeType == NodeType.Whitespace) {\n\t\t\t\tpos = pos.PrevSibling;\n\t\t\t}\n\t\t\tif (pos != null && pos.Role == Roles.Semicolon) {\n\t\t\t\tSemicolon();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteCommaSeparatedList(IEnumerable<AstNode> list)\n\t\t{\n\t\t\tbool isFirst = true;\n\t\t\tforeach (AstNode node in list) {\n\t\t\t\tif (isFirst) {\n\t\t\t\t\tisFirst = false;\n\t\t\t\t} else {\n\t\t\t\t\tComma(node);\n\t\t\t\t}\n\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteCommaSeparatedListInParenthesis(IEnumerable<AstNode> list, bool spaceWithin)\n\t\t{\n\t\t\tLPar();\n\t\t\tif (list.Any()) {\n\t\t\t\tSpace(spaceWithin);\n\t\t\t\tWriteCommaSeparatedList(list);\n\t\t\t\tSpace(spaceWithin);\n\t\t\t}\n\t\t\tRPar();\n\t\t}\n\t\t\n\t\t#if DOTNET35\n\t\tvoid WriteCommaSeparatedList(IEnumerable<VariableInitializer> list)\n\t\t{\n\t\t\tWriteCommaSeparatedList(list.SafeCast<VariableInitializer, AstNode>());\n\t\t}\n\t\t\n\t\tvoid WriteCommaSeparatedList(IEnumerable<AstType> list)\n\t\t{\n\t\t\tWriteCommaSeparatedList(list.SafeCast<AstType, AstNode>());\n\t\t}\n\t\t\n\t\tvoid WriteCommaSeparatedListInParenthesis(IEnumerable<Expression> list, bool spaceWithin)\n\t\t{\n\t\t\tWriteCommaSeparatedListInParenthesis(list.SafeCast<Expression, AstNode>(), spaceWithin);\n\t\t}\n\t\t\n\t\tvoid WriteCommaSeparatedListInParenthesis(IEnumerable<ParameterDeclaration> list, bool spaceWithin)\n\t\t{\n\t\t\tWriteCommaSeparatedListInParenthesis(list.SafeCast<ParameterDeclaration, AstNode>(), spaceWithin);\n\t\t}\n\n\t\t#endif\n\n\t\tvoid WriteCommaSeparatedListInBrackets(IEnumerable<ParameterDeclaration> list, bool spaceWithin)\n\t\t{\n\t\t\tWriteToken(Roles.LBracket);\n\t\t\tif (list.Any()) {\n\t\t\t\tSpace(spaceWithin);\n\t\t\t\tWriteCommaSeparatedList(list);\n\t\t\t\tSpace(spaceWithin);\n\t\t\t}\n\t\t\tWriteToken(Roles.RBracket);\n\t\t}\n\n\t\tvoid WriteCommaSeparatedListInBrackets(IEnumerable<Expression> list)\n\t\t{\n\t\t\tWriteToken(Roles.LBracket);\n\t\t\tif (list.Any()) {\n\t\t\t\tSpace(policy.SpacesWithinBrackets);\n\t\t\t\tWriteCommaSeparatedList(list);\n\t\t\t\tSpace(policy.SpacesWithinBrackets);\n\t\t\t}\n\t\t\tWriteToken(Roles.RBracket);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Write tokens\n\t\tbool isAtStartOfLine = true;\n\t\t\n\t\t/// <summary>\n\t\t/// Writes a keyword, and all specials up to\n\t\t/// </summary>\n\t\tvoid WriteKeyword(TokenRole tokenRole)\n\t\t{\n\t\t\tWriteKeyword(tokenRole.Token, tokenRole);\n\t\t}\n\t\t\n\t\tvoid WriteKeyword(string token, Role tokenRole = null)\n\t\t{\n\t\t\twriter.WriteKeyword(tokenRole, token);\n\t\t\tisAtStartOfLine = false;\n\t\t}\n\t\t\n\t\tvoid WriteIdentifier(Identifier identifier)\n\t\t{\n\t\t\twriter.WriteIdentifier(identifier);\n\t\t\tisAtStartOfLine = false;\n\t\t}\n\t\t\n\t\tvoid WriteIdentifier(string identifier)\n\t\t{\n\t\t\tAstType.Create(identifier).AcceptVisitor(this);\n\t\t\tisAtStartOfLine = false;\n\t\t}\n\t\t\n\t\tvoid WriteToken(TokenRole tokenRole)\n\t\t{\n\t\t\tWriteToken(tokenRole.Token, tokenRole);\n\t\t}\n\t\t\n\t\tvoid WriteToken(string token, Role tokenRole)\n\t\t{\n\t\t\twriter.WriteToken(tokenRole, token);\n\t\t\tisAtStartOfLine = false;\n\t\t}\n\t\t\n\t\tvoid LPar()\n\t\t{\n\t\t\tWriteToken(Roles.LPar);\n\t\t}\n\t\t\n\t\tvoid RPar()\n\t\t{\n\t\t\tWriteToken(Roles.RPar);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Marks the end of a statement\n\t\t/// </summary>\n\t\tvoid Semicolon()\n\t\t{\n\t\t\tRole role = containerStack.Peek().Role;\n\t\t\t// get the role of the current node\n\t\t\tif (!(role == ForStatement.InitializerRole || role == ForStatement.IteratorRole || role == UsingStatement.ResourceAcquisitionRole)) {\n\t\t\t\tWriteToken(Roles.Semicolon);\n\t\t\t\tNewLine();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Writes a space depending on policy.\n\t\t/// </summary>\n\t\tvoid Space(bool addSpace = true)\n\t\t{\n\t\t\tif (addSpace) {\n\t\t\t\twriter.Space();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid NewLine()\n\t\t{\n\t\t\twriter.NewLine();\n\t\t\tisAtStartOfLine = true;\n\t\t}\n\t\t\n\t\tvoid OpenBrace(BraceStyle style)\n\t\t{\n\t\t\tswitch (style) {\n\t\t\t\tcase BraceStyle.DoNotChange:\n\t\t\t\tcase BraceStyle.EndOfLine:\n\t\t\t\tcase BraceStyle.BannerStyle:\n\t\t\t\t\tif (!isAtStartOfLine)\n\t\t\t\t\t\twriter.Space();\n\t\t\t\t\twriter.WriteToken(Roles.LBrace, \"{\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.EndOfLineWithoutSpace:\n\t\t\t\t\twriter.WriteToken(Roles.LBrace, \"{\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLine:\n\t\t\t\t\tif (!isAtStartOfLine)\n\t\t\t\t\t\tNewLine();\n\t\t\t\t\twriter.WriteToken(Roles.LBrace, \"{\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted:\n\t\t\t\t\tNewLine();\n\t\t\t\t\twriter.Indent();\n\t\t\t\t\twriter.WriteToken(Roles.LBrace, \"{\");\n\t\t\t\t\tNewLine();\n\t\t\t\t\treturn;\n\t\t\t\tcase BraceStyle.NextLineShifted2:\n\t\t\t\t\tNewLine();\n\t\t\t\t\twriter.Indent();\n\t\t\t\t\twriter.WriteToken(Roles.LBrace, \"{\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException ();\n\t\t\t}\n\t\t\twriter.Indent();\n\t\t\tNewLine();\n\t\t}\n\t\t\n\t\tvoid CloseBrace(BraceStyle style)\n\t\t{\n\t\t\tswitch (style) {\n\t\t\t\tcase BraceStyle.DoNotChange:\n\t\t\t\tcase BraceStyle.EndOfLine:\n\t\t\t\tcase BraceStyle.EndOfLineWithoutSpace:\n\t\t\t\tcase BraceStyle.NextLine:\n\t\t\t\t\twriter.Unindent();\n\t\t\t\t\twriter.WriteToken(Roles.RBrace, \"}\");\n\t\t\t\t\tisAtStartOfLine = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.BannerStyle:\n\t\t\t\tcase BraceStyle.NextLineShifted:\n\t\t\t\t\twriter.WriteToken(Roles.RBrace, \"}\");\n\t\t\t\t\tisAtStartOfLine = false;\n\t\t\t\t\twriter.Unindent();\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted2:\n\t\t\t\t\twriter.Unindent();\n\t\t\t\t\twriter.WriteToken(Roles.RBrace, \"}\");\n\t\t\t\t\tisAtStartOfLine = false;\n\t\t\t\t\twriter.Unindent();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region IsKeyword Test\n\t\tstatic readonly HashSet<string> unconditionalKeywords = new HashSet<string> {\n\t\t\t\"abstract\", \"as\", \"base\", \"bool\", \"break\", \"byte\", \"case\", \"catch\",\n\t\t\t\"char\", \"checked\", \"class\", \"const\", \"continue\", \"decimal\", \"default\", \"delegate\",\n\t\t\t\"do\", \"double\", \"else\", \"enum\", \"event\", \"explicit\", \"extern\", \"false\",\n\t\t\t\"finally\", \"fixed\", \"float\", \"for\", \"foreach\", \"goto\", \"if\", \"implicit\",\n\t\t\t\"in\", \"int\", \"interface\", \"internal\", \"is\", \"lock\", \"long\", \"namespace\",\n\t\t\t\"new\", \"null\", \"object\", \"operator\", \"out\", \"override\", \"params\", \"private\",\n\t\t\t\"protected\", \"public\", \"readonly\", \"ref\", \"return\", \"sbyte\", \"sealed\", \"short\",\n\t\t\t\"sizeof\", \"stackalloc\", \"static\", \"string\", \"struct\", \"switch\", \"this\", \"throw\",\n\t\t\t\"true\", \"try\", \"typeof\", \"uint\", \"ulong\", \"unchecked\", \"unsafe\", \"ushort\",\n\t\t\t\"using\", \"virtual\", \"void\", \"volatile\", \"while\"\n\t\t};\n\t\tstatic readonly HashSet<string> queryKeywords = new HashSet<string> {\n\t\t\t\"from\", \"where\", \"join\", \"on\", \"equals\", \"into\", \"let\", \"orderby\",\n\t\t\t\"ascending\", \"descending\", \"select\", \"group\", \"by\"\n\t\t};\n\t\t\n\t\t/// <summary>\n\t\t/// Determines whether the specified identifier is a keyword in the given context.\n\t\t/// </summary>\n\t\tpublic static bool IsKeyword(string identifier, AstNode context)\n\t\t{\n\t\t\tif (unconditionalKeywords.Contains(identifier)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tforeach (AstNode ancestor in context.Ancestors) {\n\t\t\t\tif (ancestor is QueryExpression && queryKeywords.Contains(identifier)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (identifier == \"await\") {\n\t\t\t\t\t// with lambdas/anonymous methods,\n\t\t\t\t\tif (ancestor is LambdaExpression) {\n\t\t\t\t\t\treturn ((LambdaExpression)ancestor).IsAsync;\n\t\t\t\t\t}\n\t\t\t\t\tif (ancestor is AnonymousMethodExpression) {\n\t\t\t\t\t\treturn ((AnonymousMethodExpression)ancestor).IsAsync;\n\t\t\t\t\t}\n\t\t\t\t\tif (ancestor is EntityDeclaration) {\n\t\t\t\t\t\treturn (((EntityDeclaration)ancestor).Modifiers & Modifiers.Async) == Modifiers.Async;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Write constructs\n\t\tvoid WriteTypeArguments(IEnumerable<AstType> typeArguments)\n\t\t{\n\t\t\tif (typeArguments.Any()) {\n\t\t\t\tWriteToken(Roles.LChevron);\n\t\t\t\tWriteCommaSeparatedList(typeArguments);\n\t\t\t\tWriteToken(Roles.RChevron);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void WriteTypeParameters(IEnumerable<TypeParameterDeclaration> typeParameters)\n\t\t{\n\t\t\tif (typeParameters.Any()) {\n\t\t\t\tWriteToken(Roles.LChevron);\n\t\t\t\tWriteCommaSeparatedList(typeParameters);\n\t\t\t\tWriteToken(Roles.RChevron);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteModifiers(IEnumerable<CSharpModifierToken> modifierTokens)\n\t\t{\n\t\t\tforeach (CSharpModifierToken modifier in modifierTokens) {\n\t\t\t\tmodifier.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteQualifiedIdentifier(IEnumerable<Identifier> identifiers)\n\t\t{\n\t\t\tbool first = true;\n\t\t\tforeach (Identifier ident in identifiers) {\n\t\t\t\tif (first) {\n\t\t\t\t\tfirst = false;\n\t\t\t\t} else {\n\t\t\t\t\twriter.WriteToken(Roles.Dot, \".\");\n\t\t\t\t}\n\t\t\t\twriter.WriteIdentifier(ident);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteEmbeddedStatement(Statement embeddedStatement)\n\t\t{\n\t\t\tif (embeddedStatement.IsNull) {\n\t\t\t\tNewLine();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBlockStatement block = embeddedStatement as BlockStatement;\n\t\t\tif (block != null) {\n\t\t\t\tVisitBlockStatement(block);\n\t\t\t} else {\n\t\t\t\tNewLine();\n\t\t\t\twriter.Indent();\n\t\t\t\tembeddedStatement.AcceptVisitor(this);\n\t\t\t\twriter.Unindent();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteMethodBody(BlockStatement body)\n\t\t{\n\t\t\tif (body.IsNull) {\n\t\t\t\tSemicolon();\n\t\t\t} else {\n\t\t\t\tVisitBlockStatement(body);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WriteAttributes(IEnumerable<AttributeSection> attributes)\n\t\t{\n\t\t\tforeach (AttributeSection attr in attributes) {\n\t\t\t\tattr.AcceptVisitor(this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid WritePrivateImplementationType(AstType privateImplementationType)\n\t\t{\n\t\t\tif (!privateImplementationType.IsNull) {\n\t\t\t\tprivateImplementationType.AcceptVisitor(this);\n\t\t\t\tWriteToken(Roles.Dot);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region Expressions\n\t\tpublic void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\tStartNode(anonymousMethodExpression);\n\t\t\tif (anonymousMethodExpression.IsAsync) {\n\t\t\t\tWriteKeyword(AnonymousMethodExpression.AsyncModifierRole);\n\t\t\t\tSpace();\n\t\t\t}\n\t\t\tWriteKeyword(AnonymousMethodExpression.DelegateKeywordRole);\n\t\t\tif (anonymousMethodExpression.HasParameterList) {\n\t\t\t\tSpace(policy.SpaceBeforeMethodDeclarationParentheses);\n\t\t\t\tWriteCommaSeparatedListInParenthesis(anonymousMethodExpression.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\t}\n\t\t\tanonymousMethodExpression.Body.AcceptVisitor(this);\n\t\t\tEndNode(anonymousMethodExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression)\n\t\t{\n\t\t\tStartNode(undocumentedExpression);\n\t\t\tswitch (undocumentedExpression.UndocumentedExpressionType) {\n\t\t\t\tcase UndocumentedExpressionType.ArgList:\n\t\t\t\tcase UndocumentedExpressionType.ArgListAccess:\n\t\t\t\t\tWriteKeyword(UndocumentedExpression.ArglistKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UndocumentedExpressionType.MakeRef:\n\t\t\t\t\tWriteKeyword(UndocumentedExpression.MakerefKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UndocumentedExpressionType.RefType:\n\t\t\t\t\tWriteKeyword(UndocumentedExpression.ReftypeKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UndocumentedExpressionType.RefValue:\n\t\t\t\t\tWriteKeyword(UndocumentedExpression.RefvalueKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (undocumentedExpression.Arguments.Count > 0) {\n\t\t\t\tSpace(policy.SpaceBeforeMethodCallParentheses);\n\t\t\t\tWriteCommaSeparatedListInParenthesis(undocumentedExpression.Arguments, policy.SpaceWithinMethodCallParentheses);\n\t\t\t}\n\t\t\tEndNode(undocumentedExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t{\n\t\t\tStartNode(arrayCreateExpression);\n\t\t\tWriteKeyword(ArrayCreateExpression.NewKeywordRole);\n\t\t\tarrayCreateExpression.Type.AcceptVisitor(this);\n\t\t\tif (arrayCreateExpression.Arguments.Count > 0) {\n\t\t\t\tWriteCommaSeparatedListInBrackets(arrayCreateExpression.Arguments);\n\t\t\t}\n\t\t\tforeach (var specifier in arrayCreateExpression.AdditionalArraySpecifiers) {\n\t\t\t\tspecifier.AcceptVisitor(this);\n\t\t\t}\n\t\t\tarrayCreateExpression.Initializer.AcceptVisitor(this);\n\t\t\tEndNode(arrayCreateExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\tStartNode(arrayInitializerExpression);\n\t\t\t// \"new List<int> { { 1 } }\" and \"new List<int> { 1 }\" are the same semantically.\n\t\t\t// We also use the same AST for both: we always use two nested ArrayInitializerExpressions\n\t\t\t// for collection initializers, even if the user did not write nested brackets.\n\t\t\t// The output visitor will output nested braces only if they are necessary,\n\t\t\t// or if the braces tokens exist in the AST.\n\t\t\tbool bracesAreOptional = arrayInitializerExpression.Elements.Count == 1\n\t\t\t\t&& IsObjectOrCollectionInitializer(arrayInitializerExpression.Parent)\n\t\t\t\t&& !CanBeConfusedWithObjectInitializer(arrayInitializerExpression.Elements.Single());\n\t\t\tif (bracesAreOptional && arrayInitializerExpression.LBraceToken.IsNull) {\n\t\t\t\tarrayInitializerExpression.Elements.Single().AcceptVisitor(this);\n\t\t\t} else {\n\t\t\t\tPrintInitializerElements(arrayInitializerExpression.Elements);\n\t\t\t}\n\t\t\tEndNode(arrayInitializerExpression);\n\t\t}\n\t\t\n\t\tbool CanBeConfusedWithObjectInitializer(Expression expr)\n\t\t{\n\t\t\t// \"int a; new List<int> { a = 1 };\" is an object initalizers and invalid, but\n\t\t\t// \"int a; new List<int> { { a = 1 } };\" is a valid collection initializer.\n\t\t\tAssignmentExpression ae = expr as AssignmentExpression;\n\t\t\treturn ae != null && ae.Operator == AssignmentOperatorType.Assign;\n\t\t}\n\t\t\n\t\tbool IsObjectOrCollectionInitializer(AstNode node)\n\t\t{\n\t\t\tif (!(node is ArrayInitializerExpression)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (node.Parent is ObjectCreateExpression) {\n\t\t\t\treturn node.Role == ObjectCreateExpression.InitializerRole;\n\t\t\t}\n\t\t\tif (node.Parent is NamedExpression) {\n\t\t\t\treturn node.Role == Roles.Expression;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid PrintInitializerElements(AstNodeCollection<Expression> elements)\n\t\t{\n\t\t\tBraceStyle style;\n\t\t\tif (policy.ArrayInitializerWrapping == Wrapping.WrapAlways) {\n\t\t\t\tstyle = BraceStyle.NextLine;\n\t\t\t} else {\n\t\t\t\tstyle = BraceStyle.EndOfLine;\n\t\t\t}\n\t\t\tOpenBrace(style);\n\t\t\tbool isFirst = true;\n\t\t\tAstNode last = null;\n\t\t\tforeach (AstNode node in elements) {\n\t\t\t\tif (isFirst) {\n\t\t\t\t\tisFirst = false;\n\t\t\t\t} else {\n\t\t\t\t\tComma(node, noSpaceAfterComma: true);\n\t\t\t\t\tNewLine();\n\t\t\t\t}\n\t\t\t\tlast = node;\n\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t}\n\t\t\tif (last != null)\n\t\t\t\tOptionalComma(last.NextSibling);\n\t\t\tNewLine();\n\t\t\tCloseBrace(style);\n\t\t}\n\t\t\n\t\tpublic void VisitAsExpression(AsExpression asExpression)\n\t\t{\n\t\t\tStartNode(asExpression);\n\t\t\tasExpression.Expression.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteKeyword(AsExpression.AsKeywordRole);\n\t\t\tSpace();\n\t\t\tasExpression.Type.AcceptVisitor(this);\n\t\t\tEndNode(asExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\tStartNode(assignmentExpression);\n\t\t\tassignmentExpression.Left.AcceptVisitor(this);\n\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\tWriteToken(AssignmentExpression.GetOperatorRole(assignmentExpression.Operator));\n\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\tassignmentExpression.Right.AcceptVisitor(this);\n\t\t\tEndNode(assignmentExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression)\n\t\t{\n\t\t\tStartNode(baseReferenceExpression);\n\t\t\tWriteKeyword(\"base\", baseReferenceExpression.Role);\n\t\t\tEndNode(baseReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\tStartNode(binaryOperatorExpression);\n\t\t\tbinaryOperatorExpression.Left.AcceptVisitor(this);\n\t\t\tbool spacePolicy;\n\t\t\tswitch (binaryOperatorExpression.Operator) {\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\tspacePolicy = policy.SpaceAroundBitwiseOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\tspacePolicy = policy.SpaceAroundLogicalOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\tspacePolicy = policy.SpaceAroundRelationalOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\tspacePolicy = policy.SpaceAroundEqualityOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\tspacePolicy = policy.SpaceAroundAdditiveOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\tspacePolicy = policy.SpaceAroundMultiplicativeOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\tspacePolicy = policy.SpaceAroundShiftOperator;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.NullCoalescing:\n\t\t\t\t\tspacePolicy = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException (\"Invalid value for BinaryOperatorType\");\n\t\t\t}\n\t\t\tSpace(spacePolicy);\n\t\t\tWriteToken(BinaryOperatorExpression.GetOperatorRole(binaryOperatorExpression.Operator));\n\t\t\tSpace(spacePolicy);\n\t\t\tbinaryOperatorExpression.Right.AcceptVisitor(this);\n\t\t\tEndNode(binaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitCastExpression(CastExpression castExpression)\n\t\t{\n\t\t\tStartNode(castExpression);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinCastParentheses);\n\t\t\tcastExpression.Type.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinCastParentheses);\n\t\t\tRPar();\n\t\t\tSpace(policy.SpaceAfterTypecast);\n\t\t\tcastExpression.Expression.AcceptVisitor(this);\n\t\t\tEndNode(castExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitCheckedExpression(CheckedExpression checkedExpression)\n\t\t{\n\t\t\tStartNode(checkedExpression);\n\t\t\tWriteKeyword(CheckedExpression.CheckedKeywordRole);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tcheckedExpression.Expression.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tRPar();\n\t\t\tEndNode(checkedExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\tStartNode(conditionalExpression);\n\t\t\tconditionalExpression.Condition.AcceptVisitor(this);\n\t\t\t\n\t\t\tSpace(policy.SpaceBeforeConditionalOperatorCondition);\n\t\t\tWriteToken(ConditionalExpression.QuestionMarkRole);\n\t\t\tSpace(policy.SpaceAfterConditionalOperatorCondition);\n\t\t\t\n\t\t\tconditionalExpression.TrueExpression.AcceptVisitor(this);\n\t\t\t\n\t\t\tSpace(policy.SpaceBeforeConditionalOperatorSeparator);\n\t\t\tWriteToken(ConditionalExpression.ColonRole);\n\t\t\tSpace(policy.SpaceAfterConditionalOperatorSeparator);\n\t\t\t\n\t\t\tconditionalExpression.FalseExpression.AcceptVisitor(this);\n\t\t\t\n\t\t\tEndNode(conditionalExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression)\n\t\t{\n\t\t\tStartNode(defaultValueExpression);\n\t\t\t\n\t\t\tWriteKeyword(DefaultValueExpression.DefaultKeywordRole);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinTypeOfParentheses);\n\t\t\tdefaultValueExpression.Type.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinTypeOfParentheses);\n\t\t\tRPar();\n\t\t\t\n\t\t\tEndNode(defaultValueExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t{\n\t\t\tStartNode(directionExpression);\n\t\t\t\n\t\t\tswitch (directionExpression.FieldDirection) {\n\t\t\t\tcase FieldDirection.Out:\n\t\t\t\t\tWriteKeyword(DirectionExpression.OutKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FieldDirection.Ref:\n\t\t\t\t\tWriteKeyword(DirectionExpression.RefKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException (\"Invalid value for FieldDirection\");\n\t\t\t}\n\t\t\tSpace();\n\t\t\tdirectionExpression.Expression.AcceptVisitor(this);\n\t\t\t\n\t\t\tEndNode(directionExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tStartNode(identifierExpression);\n\t\t\tWriteIdentifier(identifierExpression.IdentifierToken);\n\t\t\tWriteTypeArguments(identifierExpression.TypeArguments);\n\t\t\tEndNode(identifierExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t{\n\t\t\tStartNode(indexerExpression);\n\t\t\tindexerExpression.Target.AcceptVisitor(this);\n\t\t\tSpace(policy.SpaceBeforeMethodCallParentheses);\n\t\t\tWriteCommaSeparatedListInBrackets(indexerExpression.Arguments);\n\t\t\tEndNode(indexerExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\tStartNode(invocationExpression);\n\t\t\tinvocationExpression.Target.AcceptVisitor(this);\n\t\t\tSpace(policy.SpaceBeforeMethodCallParentheses);\n\t\t\tWriteCommaSeparatedListInParenthesis(invocationExpression.Arguments, policy.SpaceWithinMethodCallParentheses);\n\t\t\tEndNode(invocationExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitIsExpression(IsExpression isExpression)\n\t\t{\n\t\t\tStartNode(isExpression);\n\t\t\tisExpression.Expression.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteKeyword(IsExpression.IsKeywordRole);\n\t\t\tisExpression.Type.AcceptVisitor(this);\n\t\t\tEndNode(isExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tStartNode(lambdaExpression);\n\t\t\tif (lambdaExpression.IsAsync) {\n\t\t\t\tWriteKeyword(LambdaExpression.AsyncModifierRole);\n\t\t\t\tSpace();\n\t\t\t}\n\t\t\tif (LambdaNeedsParenthesis(lambdaExpression)) {\n\t\t\t\tWriteCommaSeparatedListInParenthesis(lambdaExpression.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\t} else {\n\t\t\t\tlambdaExpression.Parameters.Single().AcceptVisitor(this);\n\t\t\t}\n\t\t\tSpace();\n\t\t\tWriteToken(LambdaExpression.ArrowRole);\n\t\t\tSpace();\n\t\t\tlambdaExpression.Body.AcceptVisitor(this);\n\t\t\tEndNode(lambdaExpression);\n\t\t}\n\t\t\n\t\tbool LambdaNeedsParenthesis(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tif (lambdaExpression.Parameters.Count != 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tvar p = lambdaExpression.Parameters.Single();\n\t\t\treturn !(p.Type.IsNull && p.ParameterModifier == ParameterModifier.None);\n\t\t}\n\t\t\n\t\tpublic void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tStartNode(memberReferenceExpression);\n\t\t\tmemberReferenceExpression.Target.AcceptVisitor(this);\n\t\t\tWriteToken(Roles.Dot);\n\t\t\tWriteIdentifier(memberReferenceExpression.MemberNameToken);\n\t\t\tWriteTypeArguments(memberReferenceExpression.TypeArguments);\n\t\t\tEndNode(memberReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)\n\t\t{\n\t\t\tStartNode(namedArgumentExpression);\n\t\t\tWriteIdentifier(namedArgumentExpression.NameToken);\n\t\t\tWriteToken(Roles.Colon);\n\t\t\tSpace();\n\t\t\tnamedArgumentExpression.Expression.AcceptVisitor(this);\n\t\t\tEndNode(namedArgumentExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitNamedExpression(NamedExpression namedExpression)\n\t\t{\n\t\t\tStartNode(namedExpression);\n\t\t\tWriteIdentifier(namedExpression.NameToken);\n\t\t\tSpace();\n\t\t\tWriteToken(Roles.Assign);\n\t\t\tSpace();\n\t\t\tnamedExpression.Expression.AcceptVisitor(this);\n\t\t\tEndNode(namedExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression)\n\t\t{\n\t\t\tStartNode(nullReferenceExpression);\n\t\t\twriter.WritePrimitiveValue(null);\n\t\t\tEndNode(nullReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t{\n\t\t\tStartNode(objectCreateExpression);\n\t\t\tWriteKeyword(ObjectCreateExpression.NewKeywordRole);\n\t\t\tobjectCreateExpression.Type.AcceptVisitor(this);\n\t\t\tbool useParenthesis = objectCreateExpression.Arguments.Any() || objectCreateExpression.Initializer.IsNull;\n\t\t\t// also use parenthesis if there is an '(' token\n\t\t\tif (!objectCreateExpression.LParToken.IsNull) {\n\t\t\t\tuseParenthesis = true;\n\t\t\t}\n\t\t\tif (useParenthesis) {\n\t\t\t\tSpace(policy.SpaceBeforeMethodCallParentheses);\n\t\t\t\tWriteCommaSeparatedListInParenthesis(objectCreateExpression.Arguments, policy.SpaceWithinMethodCallParentheses);\n\t\t\t}\n\t\t\tobjectCreateExpression.Initializer.AcceptVisitor(this);\n\t\t\tEndNode(objectCreateExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t{\n\t\t\tStartNode(anonymousTypeCreateExpression);\n\t\t\tWriteKeyword(AnonymousTypeCreateExpression.NewKeywordRole);\n\t\t\tPrintInitializerElements(anonymousTypeCreateExpression.Initializers);\n\t\t\tEndNode(anonymousTypeCreateExpression);\n\t\t}\n\n\t\tpublic void VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\tStartNode(parenthesizedExpression);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinParentheses);\n\t\t\tparenthesizedExpression.Expression.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinParentheses);\n\t\t\tRPar();\n\t\t\tEndNode(parenthesizedExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\tStartNode(pointerReferenceExpression);\n\t\t\tpointerReferenceExpression.Target.AcceptVisitor(this);\n\t\t\tWriteToken(PointerReferenceExpression.ArrowRole);\n\t\t\tWriteIdentifier(pointerReferenceExpression.MemberNameToken);\n\t\t\tWriteTypeArguments(pointerReferenceExpression.TypeArguments);\n\t\t\tEndNode(pointerReferenceExpression);\n\t\t}\n\t\t\n\t\t#region VisitPrimitiveExpression\n\t\tpublic void VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t{\n\t\t\tStartNode(primitiveExpression);\n\t\t\twriter.WritePrimitiveValue(primitiveExpression.Value, primitiveExpression.UnsafeLiteralValue);\n\t\t\tEndNode(primitiveExpression);\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic void VisitSizeOfExpression(SizeOfExpression sizeOfExpression)\n\t\t{\n\t\t\tStartNode(sizeOfExpression);\n\t\t\t\n\t\t\tWriteKeyword(SizeOfExpression.SizeofKeywordRole);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinSizeOfParentheses);\n\t\t\tsizeOfExpression.Type.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinSizeOfParentheses);\n\t\t\tRPar();\n\t\t\t\n\t\t\tEndNode(sizeOfExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitStackAllocExpression(StackAllocExpression stackAllocExpression)\n\t\t{\n\t\t\tStartNode(stackAllocExpression);\n\t\t\tWriteKeyword(StackAllocExpression.StackallocKeywordRole);\n\t\t\tstackAllocExpression.Type.AcceptVisitor(this);\n\t\t\tWriteCommaSeparatedListInBrackets(new[] { stackAllocExpression.CountExpression });\n\t\t\tEndNode(stackAllocExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t{\n\t\t\tStartNode(thisReferenceExpression);\n\t\t\tWriteKeyword(\"this\", thisReferenceExpression.Role);\n\t\t\tEndNode(thisReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitTypeOfExpression(TypeOfExpression typeOfExpression)\n\t\t{\n\t\t\tStartNode(typeOfExpression);\n\t\t\t\n\t\t\tWriteKeyword(TypeOfExpression.TypeofKeywordRole);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinTypeOfParentheses);\n\t\t\ttypeOfExpression.Type.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinTypeOfParentheses);\n\t\t\tRPar();\n\t\t\t\n\t\t\tEndNode(typeOfExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression)\n\t\t{\n\t\t\tStartNode(typeReferenceExpression);\n\t\t\ttypeReferenceExpression.Type.AcceptVisitor(this);\n\t\t\tEndNode(typeReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tStartNode(unaryOperatorExpression);\n\t\t\tUnaryOperatorType opType = unaryOperatorExpression.Operator;\n\t\t\tvar opSymbol = UnaryOperatorExpression.GetOperatorRole(opType);\n\t\t\tif (opType == UnaryOperatorType.Await) {\n\t\t\t\tWriteKeyword(opSymbol);\n\t\t\t} else if (!(opType == UnaryOperatorType.PostIncrement || opType == UnaryOperatorType.PostDecrement)) {\n\t\t\t\tWriteToken(opSymbol);\n\t\t\t}\n\t\t\tunaryOperatorExpression.Expression.AcceptVisitor(this);\n\t\t\tif (opType == UnaryOperatorType.PostIncrement || opType == UnaryOperatorType.PostDecrement) {\n\t\t\t\tWriteToken(opSymbol);\n\t\t\t}\n\t\t\tEndNode(unaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitUncheckedExpression(UncheckedExpression uncheckedExpression)\n\t\t{\n\t\t\tStartNode(uncheckedExpression);\n\t\t\tWriteKeyword(UncheckedExpression.UncheckedKeywordRole);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tuncheckedExpression.Expression.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinCheckedExpressionParantheses);\n\t\t\tRPar();\n\t\t\tEndNode(uncheckedExpression);\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region Query Expressions\n\t\tpublic void VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\tStartNode(queryExpression);\n\t\t\tbool indent = queryExpression.Parent is QueryClause && !(queryExpression.Parent is QueryContinuationClause);\n\t\t\tif (indent) {\n\t\t\t\twriter.Indent();\n\t\t\t\tNewLine();\n\t\t\t}\n\t\t\tbool first = true;\n\t\t\tforeach (var clause in queryExpression.Clauses) {\n\t\t\t\tif (first) {\n\t\t\t\t\tfirst = false;\n\t\t\t\t} else {\n\t\t\t\t\tif (!(clause is QueryContinuationClause)) {\n\t\t\t\t\t\tNewLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclause.AcceptVisitor(this);\n\t\t\t}\n\t\t\tif (indent) {\n\t\t\t\twriter.Unindent();\n\t\t\t}\n\t\t\tEndNode(queryExpression);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t{\n\t\t\tStartNode(queryContinuationClause);\n\t\t\tqueryContinuationClause.PrecedingQuery.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteKeyword(QueryContinuationClause.IntoKeywordRole);\n\t\t\tSpace();\n\t\t\tWriteIdentifier(queryContinuationClause.IdentifierToken);\n\t\t\tEndNode(queryContinuationClause);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t{\n\t\t\tStartNode(queryFromClause);\n\t\t\tWriteKeyword(QueryFromClause.FromKeywordRole);\n\t\t\tqueryFromClause.Type.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteIdentifier(queryFromClause.IdentifierToken);\n\t\t\tSpace();\n\t\t\tWriteKeyword(QueryFromClause.InKeywordRole);\n\t\t\tSpace();\n\t\t\tqueryFromClause.Expression.AcceptVisitor(this);\n\t\t\tEndNode(queryFromClause);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t{\n\t\t\tStartNode(queryLetClause);\n\t\t\tWriteKeyword(QueryLetClause.LetKeywordRole);\n\t\t\tSpace();\n\t\t\tWriteIdentifier(queryLetClause.IdentifierToken);\n\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\tWriteToken(Roles.Assign);\n\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\tqueryLetClause.Expression.AcceptVisitor(this);\n\t\t\tEndNode(queryLetClause);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryWhereClause(QueryWhereClause queryWhereClause)\n\t\t{\n\t\t\tStartNode(queryWhereClause);\n\t\t\tWriteKeyword(QueryWhereClause.WhereKeywordRole);\n\t\t\tSpace();\n\t\t\tqueryWhereClause.Condition.AcceptVisitor(this);\n\t\t\tEndNode(queryWhereClause);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryJoinClause(QueryJoinClause queryJoinClause)\n\t\t{\n\t\t\tStartNode(queryJoinClause);\n\t\t\tWriteKeyword(QueryJoinClause.JoinKeywordRole);\n\t\t\tqueryJoinClause.Type.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteIdentifier(queryJoinClause.JoinIdentifierToken);\n\t\t\tSpace();\n\t\t\tWriteKeyword(QueryJoinClause.InKeywordRole);\n\t\t\tSpace();\n\t\t\tqueryJoinClause.InExpression.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteKeyword(QueryJoinClause.OnKeywordRole);\n\t\t\tSpace();\n\t\t\tqueryJoinClause.OnExpression.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteKeyword(QueryJoinClause.EqualsKeywordRole);\n\t\t\tSpace();\n\t\t\tqueryJoinClause.EqualsExpression.AcceptVisitor(this);\n\t\t\tif (queryJoinClause.IsGroupJoin) {\n\t\t\t\tSpace();\n\t\t\t\tWriteKeyword(QueryJoinClause.IntoKeywordRole);\n\t\t\t\tWriteIdentifier(queryJoinClause.IntoIdentifierToken);\n\t\t\t}\n\t\t\tEndNode(queryJoinClause);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryOrderClause(QueryOrderClause queryOrderClause)\n\t\t{\n\t\t\tStartNode(queryOrderClause);\n\t\t\tWriteKeyword(QueryOrderClause.OrderbyKeywordRole);\n\t\t\tSpace();\n\t\t\tWriteCommaSeparatedList(queryOrderClause.Orderings);\n\t\t\tEndNode(queryOrderClause);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryOrdering(QueryOrdering queryOrdering)\n\t\t{\n\t\t\tStartNode(queryOrdering);\n\t\t\tqueryOrdering.Expression.AcceptVisitor(this);\n\t\t\tswitch (queryOrdering.Direction) {\n\t\t\t\tcase QueryOrderingDirection.Ascending:\n\t\t\t\t\tSpace();\n\t\t\t\t\tWriteKeyword(QueryOrdering.AscendingKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase QueryOrderingDirection.Descending:\n\t\t\t\t\tSpace();\n\t\t\t\t\tWriteKeyword(QueryOrdering.DescendingKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tEndNode(queryOrdering);\n\t\t}\n\t\t\n\t\tpublic void VisitQuerySelectClause(QuerySelectClause querySelectClause)\n\t\t{\n\t\t\tStartNode(querySelectClause);\n\t\t\tWriteKeyword(QuerySelectClause.SelectKeywordRole);\n\t\t\tSpace();\n\t\t\tquerySelectClause.Expression.AcceptVisitor(this);\n\t\t\tEndNode(querySelectClause);\n\t\t}\n\t\t\n\t\tpublic void VisitQueryGroupClause(QueryGroupClause queryGroupClause)\n\t\t{\n\t\t\tStartNode(queryGroupClause);\n\t\t\tWriteKeyword(QueryGroupClause.GroupKeywordRole);\n\t\t\tSpace();\n\t\t\tqueryGroupClause.Projection.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteKeyword(QueryGroupClause.ByKeywordRole);\n\t\t\tSpace();\n\t\t\tqueryGroupClause.Key.AcceptVisitor(this);\n\t\t\tEndNode(queryGroupClause);\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region GeneralScope\n\t\tpublic void VisitAttribute(Attribute attribute)\n\t\t{\n\t\t\tStartNode(attribute);\n\t\t\tattribute.Type.AcceptVisitor(this);\n\t\t\tif (attribute.Arguments.Count != 0 || !attribute.GetChildByRole(Roles.LPar).IsNull) {\n\t\t\t\tSpace(policy.SpaceBeforeMethodCallParentheses);\n\t\t\t\tWriteCommaSeparatedListInParenthesis(attribute.Arguments, policy.SpaceWithinMethodCallParentheses);\n\t\t\t}\n\t\t\tEndNode(attribute);\n\t\t}\n\t\t\n\t\tpublic void VisitAttributeSection(AttributeSection attributeSection)\n\t\t{\n\t\t\tStartNode(attributeSection);\n\t\t\tWriteToken(Roles.LBracket);\n\t\t\tif (!string.IsNullOrEmpty(attributeSection.AttributeTarget)) {\n\t\t\t\tWriteIdentifier(attributeSection.AttributeTargetToken);\n\t\t\t\tWriteToken(Roles.Colon);\n\t\t\t\tSpace();\n\t\t\t}\n\t\t\tWriteCommaSeparatedList(attributeSection.Attributes);\n\t\t\tWriteToken(Roles.RBracket);\n\t\t\tif (attributeSection.Parent is ParameterDeclaration || attributeSection.Parent is TypeParameterDeclaration) {\n\t\t\t\tSpace();\n\t\t\t} else {\n\t\t\t\tNewLine();\n\t\t\t}\n\t\t\tEndNode(attributeSection);\n\t\t}\n\t\t\n\t\tpublic void VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\tStartNode(delegateDeclaration);\n\t\t\tWriteAttributes(delegateDeclaration.Attributes);\n\t\t\tWriteModifiers(delegateDeclaration.ModifierTokens);\n\t\t\tWriteKeyword(Roles.DelegateKeyword);\n\t\t\tdelegateDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteIdentifier(delegateDeclaration.NameToken);\n\t\t\tWriteTypeParameters(delegateDeclaration.TypeParameters);\n\t\t\tSpace(policy.SpaceBeforeDelegateDeclarationParentheses);\n\t\t\tWriteCommaSeparatedListInParenthesis(delegateDeclaration.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\tforeach (Constraint constraint in delegateDeclaration.Constraints) {\n\t\t\t\tconstraint.AcceptVisitor(this);\n\t\t\t}\n\t\t\tSemicolon();\n\t\t\tEndNode(delegateDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\tStartNode(namespaceDeclaration);\n\t\t\tWriteKeyword(Roles.NamespaceKeyword);\n\t\t\tnamespaceDeclaration.NamespaceName.AcceptVisitor (this);\n\t\t\tOpenBrace(policy.NamespaceBraceStyle);\n\t\t\tforeach (var member in namespaceDeclaration.Members) {\n\t\t\t\tmember.AcceptVisitor(this);\n\t\t\t\tMaybeNewLinesAfterUsings(member);\n\t\t\t}\n\t\t\tCloseBrace(policy.NamespaceBraceStyle);\n\t\t\tOptionalSemicolon(namespaceDeclaration.LastChild);\n\t\t\tNewLine();\n\t\t\tEndNode(namespaceDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\tStartNode(typeDeclaration);\n\t\t\tWriteAttributes(typeDeclaration.Attributes);\n\t\t\tWriteModifiers(typeDeclaration.ModifierTokens);\n\t\t\tBraceStyle braceStyle;\n\t\t\tswitch (typeDeclaration.ClassType) {\n\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\tWriteKeyword(Roles.EnumKeyword);\n\t\t\t\t\tbraceStyle = policy.EnumBraceStyle;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\tWriteKeyword(Roles.InterfaceKeyword);\n\t\t\t\t\tbraceStyle = policy.InterfaceBraceStyle;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\tWriteKeyword(Roles.StructKeyword);\n\t\t\t\t\tbraceStyle = policy.StructBraceStyle;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tWriteKeyword(Roles.ClassKeyword);\n\t\t\t\t\tbraceStyle = policy.ClassBraceStyle;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tWriteIdentifier(typeDeclaration.NameToken);\n\t\t\tWriteTypeParameters(typeDeclaration.TypeParameters);\n\t\t\tif (typeDeclaration.BaseTypes.Any()) {\n\t\t\t\tSpace();\n\t\t\t\tWriteToken(Roles.Colon);\n\t\t\t\tSpace();\n\t\t\t\tWriteCommaSeparatedList(typeDeclaration.BaseTypes);\n\t\t\t}\n\t\t\tforeach (Constraint constraint in typeDeclaration.Constraints) {\n\t\t\t\tconstraint.AcceptVisitor(this);\n\t\t\t}\n\t\t\tOpenBrace(braceStyle);\n\t\t\tif (typeDeclaration.ClassType == ClassType.Enum) {\n\t\t\t\tbool first = true;\n\t\t\t\tAstNode last = null;\n\t\t\t\tforeach (var member in typeDeclaration.Members) {\n\t\t\t\t\tif (first) {\n\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tComma(member, noSpaceAfterComma: true);\n\t\t\t\t\t\tNewLine();\n\t\t\t\t\t}\n\t\t\t\t\tlast = member;\n\t\t\t\t\tmember.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t\tif (last != null)\n\t\t\t\t\tOptionalComma(last.NextSibling);\n\t\t\t\tNewLine();\n\t\t\t} else {\n\t\t\t\tbool first = true;\n\t\t\t\tforeach (var member in typeDeclaration.Members) {\n\t\t\t\t\tif (!first) {\n\t\t\t\t\t\tfor (int i = 0; i < policy.MinimumBlankLinesBetweenMembers; i++)\n\t\t\t\t\t\t\tNewLine();\n\t\t\t\t\t}\n\t\t\t\t\tfirst = false;\n\t\t\t\t\tmember.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\tCloseBrace(braceStyle);\n\t\t\tOptionalSemicolon(typeDeclaration.LastChild);\n\t\t\tNewLine();\n\t\t\tEndNode(typeDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitUsingAliasDeclaration(UsingAliasDeclaration usingAliasDeclaration)\n\t\t{\n\t\t\tStartNode(usingAliasDeclaration);\n\t\t\tWriteKeyword(UsingAliasDeclaration.UsingKeywordRole);\n\t\t\tWriteIdentifier(usingAliasDeclaration.GetChildByRole(UsingAliasDeclaration.AliasRole));\n\t\t\tSpace(policy.SpaceAroundEqualityOperator);\n\t\t\tWriteToken(Roles.Assign);\n\t\t\tSpace(policy.SpaceAroundEqualityOperator);\n\t\t\tusingAliasDeclaration.Import.AcceptVisitor(this);\n\t\t\tSemicolon();\n\t\t\tEndNode(usingAliasDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\tStartNode(usingDeclaration);\n\t\t\tWriteKeyword(UsingDeclaration.UsingKeywordRole);\n\t\t\tusingDeclaration.Import.AcceptVisitor(this);\n\t\t\tSemicolon();\n\t\t\tEndNode(usingDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\tStartNode(externAliasDeclaration);\n\t\t\tWriteKeyword(Roles.ExternKeyword);\n\t\t\tSpace();\n\t\t\tWriteKeyword(Roles.AliasKeyword);\n\t\t\tSpace();\n\t\t\tWriteIdentifier(externAliasDeclaration.NameToken);\n\t\t\tSemicolon();\n\t\t\tEndNode(externAliasDeclaration);\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region Statements\n\t\tpublic void VisitBlockStatement(BlockStatement blockStatement)\n\t\t{\n\t\t\tStartNode(blockStatement);\n\t\t\tBraceStyle style;\n\t\t\tif (blockStatement.Parent is AnonymousMethodExpression || blockStatement.Parent is LambdaExpression) {\n\t\t\t\tstyle = policy.AnonymousMethodBraceStyle;\n\t\t\t} else if (blockStatement.Parent is ConstructorDeclaration) {\n\t\t\t\tstyle = policy.ConstructorBraceStyle;\n\t\t\t} else if (blockStatement.Parent is DestructorDeclaration) {\n\t\t\t\tstyle = policy.DestructorBraceStyle;\n\t\t\t} else if (blockStatement.Parent is MethodDeclaration) {\n\t\t\t\tstyle = policy.MethodBraceStyle;\n\t\t\t} else if (blockStatement.Parent is Accessor) {\n\t\t\t\tif (blockStatement.Parent.Role == PropertyDeclaration.GetterRole) {\n\t\t\t\t\tstyle = policy.PropertyGetBraceStyle;\n\t\t\t\t} else if (blockStatement.Parent.Role == PropertyDeclaration.SetterRole) {\n\t\t\t\t\tstyle = policy.PropertySetBraceStyle;\n\t\t\t\t} else if (blockStatement.Parent.Role == CustomEventDeclaration.AddAccessorRole) {\n\t\t\t\t\tstyle = policy.EventAddBraceStyle;\n\t\t\t\t} else if (blockStatement.Parent.Role == CustomEventDeclaration.RemoveAccessorRole) {\n\t\t\t\t\tstyle = policy.EventRemoveBraceStyle;\n\t\t\t\t} else {\n\t\t\t\t\tstyle = policy.StatementBraceStyle;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstyle = policy.StatementBraceStyle;\n\t\t\t}\n\t\t\tOpenBrace(style);\n\t\t\tforeach (var node in blockStatement.Statements) {\n\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t}\n\t\t\tEndNode(blockStatement);\n\t\t\tCloseBrace(style);\n\t\t\tif (!(blockStatement.Parent is Expression))\n\t\t\t\tNewLine();\n\t\t}\n\t\t\n\t\tpublic void VisitBreakStatement(BreakStatement breakStatement)\n\t\t{\n\t\t\tStartNode(breakStatement);\n\t\t\tWriteKeyword(\"break\", BreakStatement.BreakKeywordRole);\n\t\t\tSemicolon();\n\t\t\tEndNode(breakStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitCheckedStatement(CheckedStatement checkedStatement)\n\t\t{\n\t\t\tStartNode(checkedStatement);\n\t\t\tWriteKeyword(CheckedStatement.CheckedKeywordRole);\n\t\t\tcheckedStatement.Body.AcceptVisitor(this);\n\t\t\tEndNode(checkedStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitContinueStatement(ContinueStatement continueStatement)\n\t\t{\n\t\t\tStartNode(continueStatement);\n\t\t\tWriteKeyword(\"continue\", ContinueStatement.ContinueKeywordRole);\n\t\t\tSemicolon();\n\t\t\tEndNode(continueStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitDoWhileStatement(DoWhileStatement doWhileStatement)\n\t\t{\n\t\t\tStartNode(doWhileStatement);\n\t\t\tWriteKeyword(DoWhileStatement.DoKeywordRole);\n\t\t\tWriteEmbeddedStatement(doWhileStatement.EmbeddedStatement);\n\t\t\tWriteKeyword(DoWhileStatement.WhileKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeWhileParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinWhileParentheses);\n\t\t\tdoWhileStatement.Condition.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinWhileParentheses);\n\t\t\tRPar();\n\t\t\tSemicolon();\n\t\t\tEndNode(doWhileStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitEmptyStatement(EmptyStatement emptyStatement)\n\t\t{\n\t\t\tStartNode(emptyStatement);\n\t\t\tSemicolon();\n\t\t\tEndNode(emptyStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitExpressionStatement(ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tStartNode(expressionStatement);\n\t\t\texpressionStatement.Expression.AcceptVisitor(this);\n\t\t\tSemicolon();\n\t\t\tEndNode(expressionStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitFixedStatement(FixedStatement fixedStatement)\n\t\t{\n\t\t\tStartNode(fixedStatement);\n\t\t\tWriteKeyword(FixedStatement.FixedKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeUsingParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinUsingParentheses);\n\t\t\tfixedStatement.Type.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteCommaSeparatedList(fixedStatement.Variables);\n\t\t\tSpace(policy.SpacesWithinUsingParentheses);\n\t\t\tRPar();\n\t\t\tWriteEmbeddedStatement(fixedStatement.EmbeddedStatement);\n\t\t\tEndNode(fixedStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t{\n\t\t\tStartNode(foreachStatement);\n\t\t\tWriteKeyword(ForeachStatement.ForeachKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeForeachParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinForeachParentheses);\n\t\t\tforeachStatement.VariableType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteIdentifier(foreachStatement.VariableNameToken);\n\t\t\tWriteKeyword(ForeachStatement.InKeywordRole);\n\t\t\tSpace();\n\t\t\tforeachStatement.InExpression.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinForeachParentheses);\n\t\t\tRPar();\n\t\t\tWriteEmbeddedStatement(foreachStatement.EmbeddedStatement);\n\t\t\tEndNode(foreachStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitForStatement(ForStatement forStatement)\n\t\t{\n\t\t\tStartNode(forStatement);\n\t\t\tWriteKeyword(ForStatement.ForKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeForParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinForParentheses);\n\t\t\t\n\t\t\tWriteCommaSeparatedList(forStatement.Initializers);\n\t\t\tSpace(policy.SpaceBeforeForSemicolon);\n\t\t\tWriteToken(Roles.Semicolon);\n\t\t\tSpace(policy.SpaceAfterForSemicolon);\n\t\t\t\n\t\t\tforStatement.Condition.AcceptVisitor(this);\n\t\t\tSpace(policy.SpaceBeforeForSemicolon);\n\t\t\tWriteToken(Roles.Semicolon);\n\t\t\tif (forStatement.Iterators.Any()) {\n\t\t\t\tSpace(policy.SpaceAfterForSemicolon);\n\t\t\t\tWriteCommaSeparatedList(forStatement.Iterators);\n\t\t\t}\n\t\t\t\n\t\t\tSpace(policy.SpacesWithinForParentheses);\n\t\t\tRPar();\n\t\t\tWriteEmbeddedStatement(forStatement.EmbeddedStatement);\n\t\t\tEndNode(forStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement)\n\t\t{\n\t\t\tStartNode(gotoCaseStatement);\n\t\t\tWriteKeyword(GotoCaseStatement.GotoKeywordRole);\n\t\t\tWriteKeyword(GotoCaseStatement.CaseKeywordRole);\n\t\t\tSpace();\n\t\t\tgotoCaseStatement.LabelExpression.AcceptVisitor(this);\n\t\t\tSemicolon();\n\t\t\tEndNode(gotoCaseStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)\n\t\t{\n\t\t\tStartNode(gotoDefaultStatement);\n\t\t\tWriteKeyword(GotoDefaultStatement.GotoKeywordRole);\n\t\t\tWriteKeyword(GotoDefaultStatement.DefaultKeywordRole);\n\t\t\tSemicolon();\n\t\t\tEndNode(gotoDefaultStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitGotoStatement(GotoStatement gotoStatement)\n\t\t{\n\t\t\tStartNode(gotoStatement);\n\t\t\tWriteKeyword(GotoStatement.GotoKeywordRole);\n\t\t\tWriteIdentifier(gotoStatement.GetChildByRole(Roles.Identifier));\n\t\t\tSemicolon();\n\t\t\tEndNode(gotoStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t{\n\t\t\tStartNode(ifElseStatement);\n\t\t\tWriteKeyword(IfElseStatement.IfKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeIfParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinIfParentheses);\n\t\t\tifElseStatement.Condition.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinIfParentheses);\n\t\t\tRPar();\n\t\t\tWriteEmbeddedStatement(ifElseStatement.TrueStatement);\n\t\t\tif (!ifElseStatement.FalseStatement.IsNull) {\n\t\t\t\tWriteKeyword(IfElseStatement.ElseKeywordRole);\n\t\t\t\tWriteEmbeddedStatement(ifElseStatement.FalseStatement);\n\t\t\t}\n\t\t\tEndNode(ifElseStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitLabelStatement(LabelStatement labelStatement)\n\t\t{\n\t\t\tStartNode(labelStatement);\n\t\t\tWriteIdentifier(labelStatement.GetChildByRole(Roles.Identifier));\n\t\t\tWriteToken(Roles.Colon);\n\t\t\tbool foundLabelledStatement = false;\n\t\t\tfor (AstNode tmp = labelStatement.NextSibling; tmp != null; tmp = tmp.NextSibling) {\n\t\t\t\tif (tmp.Role == labelStatement.Role) {\n\t\t\t\t\tfoundLabelledStatement = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!foundLabelledStatement) {\n\t\t\t\t// introduce an EmptyStatement so that the output becomes syntactically valid\n\t\t\t\tWriteToken(Roles.Semicolon);\n\t\t\t}\n\t\t\tNewLine();\n\t\t\tEndNode(labelStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitLockStatement(LockStatement lockStatement)\n\t\t{\n\t\t\tStartNode(lockStatement);\n\t\t\tWriteKeyword(LockStatement.LockKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeLockParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinLockParentheses);\n\t\t\tlockStatement.Expression.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinLockParentheses);\n\t\t\tRPar();\n\t\t\tWriteEmbeddedStatement(lockStatement.EmbeddedStatement);\n\t\t\tEndNode(lockStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitReturnStatement(ReturnStatement returnStatement)\n\t\t{\n\t\t\tStartNode(returnStatement);\n\t\t\tWriteKeyword(ReturnStatement.ReturnKeywordRole);\n\t\t\tif (!returnStatement.Expression.IsNull) {\n\t\t\t\tSpace();\n\t\t\t\treturnStatement.Expression.AcceptVisitor(this);\n\t\t\t}\n\t\t\tSemicolon();\n\t\t\tEndNode(returnStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitSwitchStatement(SwitchStatement switchStatement)\n\t\t{\n\t\t\tStartNode(switchStatement);\n\t\t\tWriteKeyword(SwitchStatement.SwitchKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeSwitchParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinSwitchParentheses);\n\t\t\tswitchStatement.Expression.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinSwitchParentheses);\n\t\t\tRPar();\n\t\t\tOpenBrace(policy.StatementBraceStyle);\n\t\t\tif (!policy.IndentSwitchBody) {\n\t\t\t\twriter.Unindent();\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var section in switchStatement.SwitchSections) {\n\t\t\t\tsection.AcceptVisitor(this);\n\t\t\t}\n\t\t\t\n\t\t\tif (!policy.IndentSwitchBody) {\n\t\t\t\twriter.Indent();\n\t\t\t}\n\t\t\tCloseBrace(policy.StatementBraceStyle);\n\t\t\tNewLine();\n\t\t\tEndNode(switchStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitSwitchSection(SwitchSection switchSection)\n\t\t{\n\t\t\tStartNode(switchSection);\n\t\t\tbool first = true;\n\t\t\tforeach (var label in switchSection.CaseLabels) {\n\t\t\t\tif (!first) {\n\t\t\t\t\tNewLine();\n\t\t\t\t}\n\t\t\t\tlabel.AcceptVisitor(this);\n\t\t\t\tfirst = false;\n\t\t\t}\n\t\t\tbool isBlock = switchSection.Statements.Count == 1 && switchSection.Statements.Single() is BlockStatement;\n\t\t\tif (policy.IndentCaseBody && !isBlock) {\n\t\t\t\twriter.Indent();\n\t\t\t}\n\t\t\t\n\t\t\tif (!isBlock)\n\t\t\t\tNewLine();\n\t\t\t\n\t\t\tforeach (var statement in switchSection.Statements) {\n\t\t\t\tstatement.AcceptVisitor(this);\n\t\t\t}\n\t\t\t\n\t\t\tif (policy.IndentCaseBody && !isBlock) {\n\t\t\t\twriter.Unindent();\n\t\t\t}\n\t\t\t\n\t\t\tEndNode(switchSection);\n\t\t}\n\t\t\n\t\tpublic void VisitCaseLabel(CaseLabel caseLabel)\n\t\t{\n\t\t\tStartNode(caseLabel);\n\t\t\tif (caseLabel.Expression.IsNull) {\n\t\t\t\tWriteKeyword(CaseLabel.DefaultKeywordRole);\n\t\t\t} else {\n\t\t\t\tWriteKeyword(CaseLabel.CaseKeywordRole);\n\t\t\t\tSpace();\n\t\t\t\tcaseLabel.Expression.AcceptVisitor(this);\n\t\t\t}\n\t\t\tWriteToken(Roles.Colon);\n\t\t\tEndNode(caseLabel);\n\t\t}\n\t\t\n\t\tpublic void VisitThrowStatement(ThrowStatement throwStatement)\n\t\t{\n\t\t\tStartNode(throwStatement);\n\t\t\tWriteKeyword(ThrowStatement.ThrowKeywordRole);\n\t\t\tif (!throwStatement.Expression.IsNull) {\n\t\t\t\tSpace();\n\t\t\t\tthrowStatement.Expression.AcceptVisitor(this);\n\t\t\t}\n\t\t\tSemicolon();\n\t\t\tEndNode(throwStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitTryCatchStatement(TryCatchStatement tryCatchStatement)\n\t\t{\n\t\t\tStartNode(tryCatchStatement);\n\t\t\tWriteKeyword(TryCatchStatement.TryKeywordRole);\n\t\t\ttryCatchStatement.TryBlock.AcceptVisitor(this);\n\t\t\tforeach (var catchClause in tryCatchStatement.CatchClauses) {\n\t\t\t\tcatchClause.AcceptVisitor(this);\n\t\t\t}\n\t\t\tif (!tryCatchStatement.FinallyBlock.IsNull) {\n\t\t\t\tWriteKeyword(TryCatchStatement.FinallyKeywordRole);\n\t\t\t\ttryCatchStatement.FinallyBlock.AcceptVisitor(this);\n\t\t\t}\n\t\t\tEndNode(tryCatchStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitCatchClause(CatchClause catchClause)\n\t\t{\n\t\t\tStartNode(catchClause);\n\t\t\tWriteKeyword(CatchClause.CatchKeywordRole);\n\t\t\tif (!catchClause.Type.IsNull) {\n\t\t\t\tSpace(policy.SpaceBeforeCatchParentheses);\n\t\t\t\tLPar();\n\t\t\t\tSpace(policy.SpacesWithinCatchParentheses);\n\t\t\t\tcatchClause.Type.AcceptVisitor(this);\n\t\t\t\tif (!string.IsNullOrEmpty(catchClause.VariableName)) {\n\t\t\t\t\tSpace();\n\t\t\t\t\tWriteIdentifier(catchClause.VariableNameToken);\n\t\t\t\t}\n\t\t\t\tSpace(policy.SpacesWithinCatchParentheses);\n\t\t\t\tRPar();\n\t\t\t}\n\t\t\tcatchClause.Body.AcceptVisitor(this);\n\t\t\tEndNode(catchClause);\n\t\t}\n\t\t\n\t\tpublic void VisitUncheckedStatement(UncheckedStatement uncheckedStatement)\n\t\t{\n\t\t\tStartNode(uncheckedStatement);\n\t\t\tWriteKeyword(UncheckedStatement.UncheckedKeywordRole);\n\t\t\tuncheckedStatement.Body.AcceptVisitor(this);\n\t\t\tEndNode(uncheckedStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitUnsafeStatement(UnsafeStatement unsafeStatement)\n\t\t{\n\t\t\tStartNode(unsafeStatement);\n\t\t\tWriteKeyword(UnsafeStatement.UnsafeKeywordRole);\n\t\t\tunsafeStatement.Body.AcceptVisitor(this);\n\t\t\tEndNode(unsafeStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitUsingStatement(UsingStatement usingStatement)\n\t\t{\n\t\t\tStartNode(usingStatement);\n\t\t\tWriteKeyword(UsingStatement.UsingKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeUsingParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinUsingParentheses);\n\t\t\t\n\t\t\tusingStatement.ResourceAcquisition.AcceptVisitor(this);\n\t\t\t\n\t\t\tSpace(policy.SpacesWithinUsingParentheses);\n\t\t\tRPar();\n\t\t\t\n\t\t\tWriteEmbeddedStatement(usingStatement.EmbeddedStatement);\n\t\t\t\n\t\t\tEndNode(usingStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\tStartNode(variableDeclarationStatement);\n\t\t\tWriteModifiers(variableDeclarationStatement.GetChildrenByRole(VariableDeclarationStatement.ModifierRole));\n\t\t\tvariableDeclarationStatement.Type.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteCommaSeparatedList(variableDeclarationStatement.Variables);\n\t\t\tSemicolon();\n\t\t\tEndNode(variableDeclarationStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitWhileStatement(WhileStatement whileStatement)\n\t\t{\n\t\t\tStartNode(whileStatement);\n\t\t\tWriteKeyword(WhileStatement.WhileKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeWhileParentheses);\n\t\t\tLPar();\n\t\t\tSpace(policy.SpacesWithinWhileParentheses);\n\t\t\twhileStatement.Condition.AcceptVisitor(this);\n\t\t\tSpace(policy.SpacesWithinWhileParentheses);\n\t\t\tRPar();\n\t\t\tWriteEmbeddedStatement(whileStatement.EmbeddedStatement);\n\t\t\tEndNode(whileStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement)\n\t\t{\n\t\t\tStartNode(yieldBreakStatement);\n\t\t\tWriteKeyword(YieldBreakStatement.YieldKeywordRole);\n\t\t\tWriteKeyword(YieldBreakStatement.BreakKeywordRole);\n\t\t\tSemicolon();\n\t\t\tEndNode(yieldBreakStatement);\n\t\t}\n\t\t\n\t\tpublic void VisitYieldReturnStatement(YieldReturnStatement yieldReturnStatement)\n\t\t{\n\t\t\tStartNode(yieldReturnStatement);\n\t\t\tWriteKeyword(YieldReturnStatement.YieldKeywordRole);\n\t\t\tWriteKeyword(YieldReturnStatement.ReturnKeywordRole);\n\t\t\tSpace();\n\t\t\tyieldReturnStatement.Expression.AcceptVisitor(this);\n\t\t\tSemicolon();\n\t\t\tEndNode(yieldReturnStatement);\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region TypeMembers\n\t\tpublic void VisitAccessor(Accessor accessor)\n\t\t{\n\t\t\tStartNode(accessor);\n\t\t\tWriteAttributes(accessor.Attributes);\n\t\t\tWriteModifiers(accessor.ModifierTokens);\n\t\t\tif (accessor.Role == PropertyDeclaration.GetterRole) {\n\t\t\t\tWriteKeyword(\"get\", PropertyDeclaration.GetKeywordRole);\n\t\t\t} else if (accessor.Role == PropertyDeclaration.SetterRole) {\n\t\t\t\tWriteKeyword(\"set\", PropertyDeclaration.SetKeywordRole);\n\t\t\t} else if (accessor.Role == CustomEventDeclaration.AddAccessorRole) {\n\t\t\t\tWriteKeyword(\"add\", CustomEventDeclaration.AddKeywordRole);\n\t\t\t} else if (accessor.Role == CustomEventDeclaration.RemoveAccessorRole) {\n\t\t\t\tWriteKeyword(\"remove\", CustomEventDeclaration.RemoveKeywordRole);\n\t\t\t}\n\t\t\tWriteMethodBody(accessor.Body);\n\t\t\tEndNode(accessor);\n\t\t}\n\t\t\n\t\tpublic void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\tStartNode(constructorDeclaration);\n\t\t\tWriteAttributes(constructorDeclaration.Attributes);\n\t\t\tWriteModifiers(constructorDeclaration.ModifierTokens);\n\t\t\tTypeDeclaration type = constructorDeclaration.Parent as TypeDeclaration;\n\t\t\tif (type != null && type.Name != constructorDeclaration.Name)\n\t\t\t\tWriteIdentifier((Identifier)type.NameToken.Clone());\n\t\t\telse\n\t\t\t\tWriteIdentifier(constructorDeclaration.NameToken);\n\t\t\tSpace(policy.SpaceBeforeConstructorDeclarationParentheses);\n\t\t\tWriteCommaSeparatedListInParenthesis(constructorDeclaration.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\tif (!constructorDeclaration.Initializer.IsNull) {\n\t\t\t\tSpace();\n\t\t\t\tconstructorDeclaration.Initializer.AcceptVisitor(this);\n\t\t\t}\n\t\t\tWriteMethodBody(constructorDeclaration.Body);\n\t\t\tEndNode(constructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitConstructorInitializer(ConstructorInitializer constructorInitializer)\n\t\t{\n\t\t\tStartNode(constructorInitializer);\n\t\t\tWriteToken(Roles.Colon);\n\t\t\tSpace();\n\t\t\tif (constructorInitializer.ConstructorInitializerType == ConstructorInitializerType.This) {\n\t\t\t\tWriteKeyword(ConstructorInitializer.ThisKeywordRole);\n\t\t\t} else {\n\t\t\t\tWriteKeyword(ConstructorInitializer.BaseKeywordRole);\n\t\t\t}\n\t\t\tSpace(policy.SpaceBeforeMethodCallParentheses);\n\t\t\tWriteCommaSeparatedListInParenthesis(constructorInitializer.Arguments, policy.SpaceWithinMethodCallParentheses);\n\t\t\tEndNode(constructorInitializer);\n\t\t}\n\t\t\n\t\tpublic void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\tStartNode(destructorDeclaration);\n\t\t\tWriteAttributes(destructorDeclaration.Attributes);\n\t\t\tWriteModifiers(destructorDeclaration.ModifierTokens);\n\t\t\tWriteToken(DestructorDeclaration.TildeRole);\n\t\t\tTypeDeclaration type = destructorDeclaration.Parent as TypeDeclaration;\n\t\t\tif (type != null && type.Name != destructorDeclaration.Name)\n\t\t\t\tWriteIdentifier((Identifier)type.NameToken.Clone());\n\t\t\telse\n\t\t\t\tWriteIdentifier(destructorDeclaration.NameToken);\n\t\t\tSpace(policy.SpaceBeforeConstructorDeclarationParentheses);\n\t\t\tLPar();\n\t\t\tRPar();\n\t\t\tWriteMethodBody(destructorDeclaration.Body);\n\t\t\tEndNode(destructorDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\tStartNode(enumMemberDeclaration);\n\t\t\tWriteAttributes(enumMemberDeclaration.Attributes);\n\t\t\tWriteModifiers(enumMemberDeclaration.ModifierTokens);\n\t\t\tWriteIdentifier(enumMemberDeclaration.NameToken);\n\t\t\tif (!enumMemberDeclaration.Initializer.IsNull) {\n\t\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\t\tWriteToken(Roles.Assign);\n\t\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\t\tenumMemberDeclaration.Initializer.AcceptVisitor(this);\n\t\t\t}\n\t\t\tEndNode(enumMemberDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tStartNode(eventDeclaration);\n\t\t\tWriteAttributes(eventDeclaration.Attributes);\n\t\t\tWriteModifiers(eventDeclaration.ModifierTokens);\n\t\t\tWriteKeyword(EventDeclaration.EventKeywordRole);\n\t\t\teventDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteCommaSeparatedList(eventDeclaration.Variables);\n\t\t\tSemicolon();\n\t\t\tEndNode(eventDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration)\n\t\t{\n\t\t\tStartNode(customEventDeclaration);\n\t\t\tWriteAttributes(customEventDeclaration.Attributes);\n\t\t\tWriteModifiers(customEventDeclaration.ModifierTokens);\n\t\t\tWriteKeyword(CustomEventDeclaration.EventKeywordRole);\n\t\t\tcustomEventDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWritePrivateImplementationType(customEventDeclaration.PrivateImplementationType);\n\t\t\tWriteIdentifier(customEventDeclaration.NameToken);\n\t\t\tOpenBrace(policy.EventBraceStyle);\n\t\t\t// output add/remove in their original order\n\t\t\tforeach (AstNode node in customEventDeclaration.Children) {\n\t\t\t\tif (node.Role == CustomEventDeclaration.AddAccessorRole || node.Role == CustomEventDeclaration.RemoveAccessorRole) {\n\t\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\tCloseBrace(policy.EventBraceStyle);\n\t\t\tNewLine();\n\t\t\tEndNode(customEventDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tStartNode(fieldDeclaration);\n\t\t\tWriteAttributes(fieldDeclaration.Attributes);\n\t\t\tWriteModifiers(fieldDeclaration.ModifierTokens);\n\t\t\tfieldDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteCommaSeparatedList(fieldDeclaration.Variables);\n\t\t\tSemicolon();\n\t\t\tEndNode(fieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\tStartNode(fixedFieldDeclaration);\n\t\t\tWriteAttributes(fixedFieldDeclaration.Attributes);\n\t\t\tWriteModifiers(fixedFieldDeclaration.ModifierTokens);\n\t\t\tWriteKeyword(FixedFieldDeclaration.FixedKeywordRole);\n\t\t\tSpace();\n\t\t\tfixedFieldDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteCommaSeparatedList(fixedFieldDeclaration.Variables);\n\t\t\tSemicolon();\n\t\t\tEndNode(fixedFieldDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)\n\t\t{\n\t\t\tStartNode(fixedVariableInitializer);\n\t\t\tWriteIdentifier(fixedVariableInitializer.NameToken);\n\t\t\tif (!fixedVariableInitializer.CountExpression.IsNull) {\n\t\t\t\tWriteToken(Roles.LBracket);\n\t\t\t\tSpace(policy.SpacesWithinBrackets);\n\t\t\t\tfixedVariableInitializer.CountExpression.AcceptVisitor(this);\n\t\t\t\tSpace(policy.SpacesWithinBrackets);\n\t\t\t\tWriteToken(Roles.RBracket);\n\t\t\t}\n\t\t\tEndNode(fixedVariableInitializer);\n\t\t}\n\t\t\n\t\tpublic void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\tStartNode(indexerDeclaration);\n\t\t\tWriteAttributes(indexerDeclaration.Attributes);\n\t\t\tWriteModifiers(indexerDeclaration.ModifierTokens);\n\t\t\tindexerDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWritePrivateImplementationType(indexerDeclaration.PrivateImplementationType);\n\t\t\tWriteKeyword(IndexerDeclaration.ThisKeywordRole);\n\t\t\tSpace(policy.SpaceBeforeMethodDeclarationParentheses);\n\t\t\tWriteCommaSeparatedListInBrackets(indexerDeclaration.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\tOpenBrace(policy.PropertyBraceStyle);\n\t\t\t// output get/set in their original order\n\t\t\tforeach (AstNode node in indexerDeclaration.Children) {\n\t\t\t\tif (node.Role == IndexerDeclaration.GetterRole || node.Role == IndexerDeclaration.SetterRole) {\n\t\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\tCloseBrace(policy.PropertyBraceStyle);\n\t\t\tNewLine();\n\t\t\tEndNode(indexerDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tStartNode(methodDeclaration);\n\t\t\tWriteAttributes(methodDeclaration.Attributes);\n\t\t\tWriteModifiers(methodDeclaration.ModifierTokens);\n\t\t\tmethodDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWritePrivateImplementationType(methodDeclaration.PrivateImplementationType);\n\t\t\tWriteIdentifier(methodDeclaration.NameToken);\n\t\t\tWriteTypeParameters(methodDeclaration.TypeParameters);\n\t\t\tSpace(policy.SpaceBeforeMethodDeclarationParentheses);\n\t\t\tWriteCommaSeparatedListInParenthesis(methodDeclaration.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\tforeach (Constraint constraint in methodDeclaration.Constraints) {\n\t\t\t\tconstraint.AcceptVisitor(this);\n\t\t\t}\n\t\t\tWriteMethodBody(methodDeclaration.Body);\n\t\t\tEndNode(methodDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\tStartNode(operatorDeclaration);\n\t\t\tWriteAttributes(operatorDeclaration.Attributes);\n\t\t\tWriteModifiers(operatorDeclaration.ModifierTokens);\n\t\t\tif (operatorDeclaration.OperatorType == OperatorType.Explicit) {\n\t\t\t\tWriteKeyword(OperatorDeclaration.ExplicitRole);\n\t\t\t} else if (operatorDeclaration.OperatorType == OperatorType.Implicit) {\n\t\t\t\tWriteKeyword(OperatorDeclaration.ImplicitRole);\n\t\t\t} else {\n\t\t\t\toperatorDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\t}\n\t\t\tWriteKeyword(OperatorDeclaration.OperatorKeywordRole);\n\t\t\tSpace();\n\t\t\tif (operatorDeclaration.OperatorType == OperatorType.Explicit\n\t\t\t    || operatorDeclaration.OperatorType == OperatorType.Implicit) {\n\t\t\t\toperatorDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\t} else {\n\t\t\t\tWriteToken(OperatorDeclaration.GetToken(operatorDeclaration.OperatorType), OperatorDeclaration.GetRole(operatorDeclaration.OperatorType));\n\t\t\t}\n\t\t\tSpace(policy.SpaceBeforeMethodDeclarationParentheses);\n\t\t\tWriteCommaSeparatedListInParenthesis(operatorDeclaration.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\tWriteMethodBody(operatorDeclaration.Body);\n\t\t\tEndNode(operatorDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tStartNode(parameterDeclaration);\n\t\t\tWriteAttributes(parameterDeclaration.Attributes);\n\t\t\tswitch (parameterDeclaration.ParameterModifier) {\n\t\t\t\tcase ParameterModifier.Ref:\n\t\t\t\t\tWriteKeyword(ParameterDeclaration.RefModifierRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.Out:\n\t\t\t\t\tWriteKeyword(ParameterDeclaration.OutModifierRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.Params:\n\t\t\t\t\tWriteKeyword(ParameterDeclaration.ParamsModifierRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.This:\n\t\t\t\t\tWriteKeyword(ParameterDeclaration.ThisModifierRole);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tparameterDeclaration.Type.AcceptVisitor(this);\n\t\t\tif (!parameterDeclaration.Type.IsNull && !string.IsNullOrEmpty(parameterDeclaration.Name)) {\n\t\t\t\tSpace();\n\t\t\t}\n\t\t\tif (!string.IsNullOrEmpty(parameterDeclaration.Name)) {\n\t\t\t\tWriteIdentifier(parameterDeclaration.NameToken);\n\t\t\t}\n\t\t\tif (!parameterDeclaration.DefaultExpression.IsNull) {\n\t\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\t\tWriteToken(Roles.Assign);\n\t\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\t\tparameterDeclaration.DefaultExpression.AcceptVisitor(this);\n\t\t\t}\n\t\t\tEndNode(parameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tStartNode(propertyDeclaration);\n\t\t\tWriteAttributes(propertyDeclaration.Attributes);\n\t\t\tWriteModifiers(propertyDeclaration.ModifierTokens);\n\t\t\tpropertyDeclaration.ReturnType.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWritePrivateImplementationType(propertyDeclaration.PrivateImplementationType);\n\t\t\tWriteIdentifier(propertyDeclaration.NameToken);\n\t\t\tOpenBrace(policy.PropertyBraceStyle);\n\t\t\t// output get/set in their original order\n\t\t\tforeach (AstNode node in propertyDeclaration.Children) {\n\t\t\t\tif (node.Role == IndexerDeclaration.GetterRole || node.Role == IndexerDeclaration.SetterRole) {\n\t\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\tCloseBrace(policy.PropertyBraceStyle);\n\t\t\tNewLine();\n\t\t\tEndNode(propertyDeclaration);\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region Other nodes\n\t\tpublic void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\tStartNode(variableInitializer);\n\t\t\tWriteIdentifier(variableInitializer.NameToken);\n\t\t\tif (!variableInitializer.Initializer.IsNull) {\n\t\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\t\tWriteToken(Roles.Assign);\n\t\t\t\tSpace(policy.SpaceAroundAssignment);\n\t\t\t\tvariableInitializer.Initializer.AcceptVisitor(this);\n\t\t\t}\n\t\t\tEndNode(variableInitializer);\n\t\t}\n\n\t\tvoid MaybeNewLinesAfterUsings(AstNode node)\n\t\t{\n\t\t\tvar nextSibling = node.NextSibling;\n\t\t\twhile (nextSibling is WhitespaceNode || nextSibling is NewLineNode)\n\t\t\t\tnextSibling = nextSibling.NextSibling;\n\n\t\t\tif ((node is UsingDeclaration || node is UsingAliasDeclaration) && !(nextSibling is UsingDeclaration || nextSibling is UsingAliasDeclaration)) {\n\t\t\t\tfor (int i = 0; i < policy.MinimumBlankLinesAfterUsings; i++)\n\t\t\t\t\tNewLine();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t{\n\t\t\t// don't do node tracking as we visit all children directly\n\t\t\tforeach (AstNode node in syntaxTree.Children) {\n\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t\tMaybeNewLinesAfterUsings(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void VisitSimpleType(SimpleType simpleType)\n\t\t{\n\t\t\tStartNode(simpleType);\n\t\t\tWriteIdentifier(simpleType.IdentifierToken);\n\t\t\tWriteTypeArguments(simpleType.TypeArguments);\n\t\t\tEndNode(simpleType);\n\t\t}\n\t\t\n\t\tpublic void VisitMemberType(MemberType memberType)\n\t\t{\n\t\t\tStartNode(memberType);\n\t\t\tmemberType.Target.AcceptVisitor(this);\n\t\t\tif (memberType.IsDoubleColon) {\n\t\t\t\tWriteToken(Roles.DoubleColon);\n\t\t\t} else {\n\t\t\t\tWriteToken(Roles.Dot);\n\t\t\t}\n\t\t\tWriteIdentifier(memberType.MemberNameToken);\n\t\t\tWriteTypeArguments(memberType.TypeArguments);\n\t\t\tEndNode(memberType);\n\t\t}\n\t\t\n\t\tpublic void VisitComposedType(ComposedType composedType)\n\t\t{\n\t\t\tStartNode(composedType);\n\t\t\tcomposedType.BaseType.AcceptVisitor(this);\n\t\t\tif (composedType.HasNullableSpecifier) {\n\t\t\t\tWriteToken(ComposedType.NullableRole);\n\t\t\t}\n\t\t\tfor (int i = 0; i < composedType.PointerRank; i++) {\n\t\t\t\tWriteToken(ComposedType.PointerRole);\n\t\t\t}\n\t\t\tforeach (var node in composedType.ArraySpecifiers) {\n\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t}\n\t\t\tEndNode(composedType);\n\t\t}\n\t\t\n\t\tpublic void VisitArraySpecifier(ArraySpecifier arraySpecifier)\n\t\t{\n\t\t\tStartNode(arraySpecifier);\n\t\t\tWriteToken(Roles.LBracket);\n\t\t\tforeach (var comma in arraySpecifier.GetChildrenByRole(Roles.Comma)) {\n\t\t\t\twriter.WriteToken(Roles.Comma, \",\");\n\t\t\t}\n\t\t\tWriteToken(Roles.RBracket);\n\t\t\tEndNode(arraySpecifier);\n\t\t}\n\t\t\n\t\tpublic void VisitPrimitiveType(PrimitiveType primitiveType)\n\t\t{\n\t\t\tStartNode(primitiveType);\n\t\t\twriter.WritePrimitiveType(primitiveType.Keyword);\n\t\t\tEndNode(primitiveType);\n\t\t}\n\t\t\n\t\tpublic void VisitComment(Comment comment)\n\t\t{\n\t\t\twriter.StartNode(comment);\n\t\t\twriter.WriteComment(comment.CommentType, comment.Content);\n\t\t\twriter.EndNode(comment);\n\t\t}\n\n\t\tpublic void VisitNewLine(NewLineNode newLineNode)\n\t\t{\n//\t\t\tformatter.StartNode(newLineNode);\n//\t\t\tformatter.NewLine();\n//\t\t\tformatter.EndNode(newLineNode);\n\t\t}\n\n\t\tpublic void VisitWhitespace(WhitespaceNode whitespaceNode)\n\t\t{\n\t\t\t// unused\n\t\t}\n\n\t\tpublic void VisitText(TextNode textNode)\n\t\t{\n\t\t\t// unused\n\t\t}\n\n\t\tpublic void VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t\twriter.StartNode(preProcessorDirective);\n\t\t\twriter.WritePreProcessorDirective(preProcessorDirective.Type, preProcessorDirective.Argument);\n\t\t\twriter.EndNode(preProcessorDirective);\n\t\t}\n\t\t\n\t\tpublic void VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration)\n\t\t{\n\t\t\tStartNode(typeParameterDeclaration);\n\t\t\tWriteAttributes(typeParameterDeclaration.Attributes);\n\t\t\tswitch (typeParameterDeclaration.Variance) {\n\t\t\t\tcase VarianceModifier.Invariant:\n\t\t\t\t\tbreak;\n\t\t\t\tcase VarianceModifier.Covariant:\n\t\t\t\t\tWriteKeyword(TypeParameterDeclaration.OutVarianceKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase VarianceModifier.Contravariant:\n\t\t\t\t\tWriteKeyword(TypeParameterDeclaration.InVarianceKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException (\"Invalid value for VarianceModifier\");\n\t\t\t}\n\t\t\tWriteIdentifier(typeParameterDeclaration.NameToken);\n\t\t\tEndNode(typeParameterDeclaration);\n\t\t}\n\t\t\n\t\tpublic void VisitConstraint(Constraint constraint)\n\t\t{\n\t\t\tStartNode(constraint);\n\t\t\tSpace();\n\t\t\tWriteKeyword(Roles.WhereKeyword);\n\t\t\tconstraint.TypeParameter.AcceptVisitor(this);\n\t\t\tSpace();\n\t\t\tWriteToken(Roles.Colon);\n\t\t\tSpace();\n\t\t\tWriteCommaSeparatedList(constraint.BaseTypes);\n\t\t\tEndNode(constraint);\n\t\t}\n\t\t\n\t\tpublic void VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode)\n\t\t{\n\t\t\tCSharpModifierToken mod = cSharpTokenNode as CSharpModifierToken;\n\t\t\tif (mod != null) {\n\t\t\t\t// ITokenWriter assumes that each node processed between a\n\t\t\t\t// StartNode(parentNode)-EndNode(parentNode)-pair is a child of parentNode.\n\t\t\t\tWriteKeyword(CSharpModifierToken.GetModifierName(mod.Modifier), cSharpTokenNode.Role);\n\t\t\t} else {\n\t\t\t\tthrow new NotSupportedException (\"Should never visit individual tokens\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void VisitIdentifier(Identifier identifier)\n\t\t{\n\t\t\t// Do not call StartNode and EndNode for Identifier, because they are handled by the ITokenWriter.\n\t\t\t// ITokenWriter assumes that each node processed between a\n\t\t\t// StartNode(parentNode)-EndNode(parentNode)-pair is a child of parentNode.\n\t\t\tWriteIdentifier(identifier);\n\t\t}\n\n\t\tvoid IAstVisitor.VisitNullNode(AstNode nullNode)\n\t\t{\n\t\t}\n\n\t\tvoid IAstVisitor.VisitErrorNode(AstNode errorNode)\n\t\t{\n\t\t\tStartNode(errorNode);\n\t\t\tEndNode(errorNode);\n\t\t}\n\t\t#endregion\n\n\t\t#region Pattern Nodes\n\t\tpublic void VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern)\n\t\t{\n\t\t\tStartNode(placeholder);\n\t\t\tVisitNodeInPattern(pattern);\n\t\t\tEndNode(placeholder);\n\t\t}\n\t\t\n\t\tvoid VisitAnyNode(AnyNode anyNode)\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(anyNode.GroupName)) {\n\t\t\t\tWriteIdentifier(anyNode.GroupName);\n\t\t\t\tWriteToken(Roles.Colon);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid VisitBackreference(Backreference backreference)\n\t\t{\n\t\t\tWriteKeyword(\"backreference\");\n\t\t\tLPar();\n\t\t\tWriteIdentifier(backreference.ReferencedGroupName);\n\t\t\tRPar();\n\t\t}\n\t\t\n\t\tvoid VisitIdentifierExpressionBackreference(IdentifierExpressionBackreference identifierExpressionBackreference)\n\t\t{\n\t\t\tWriteKeyword(\"identifierBackreference\");\n\t\t\tLPar();\n\t\t\tWriteIdentifier(identifierExpressionBackreference.ReferencedGroupName);\n\t\t\tRPar();\n\t\t}\n\t\t\n\t\tvoid VisitChoice(Choice choice)\n\t\t{\n\t\t\tWriteKeyword(\"choice\");\n\t\t\tSpace();\n\t\t\tLPar();\n\t\t\tNewLine();\n\t\t\twriter.Indent();\n\t\t\tforeach (INode alternative in choice) {\n\t\t\t\tVisitNodeInPattern(alternative);\n\t\t\t\tif (alternative != choice.Last()) {\n\t\t\t\t\tWriteToken(Roles.Comma);\n\t\t\t\t}\n\t\t\t\tNewLine();\n\t\t\t}\n\t\t\twriter.Unindent();\n\t\t\tRPar();\n\t\t}\n\t\t\n\t\tvoid VisitNamedNode(NamedNode namedNode)\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty(namedNode.GroupName)) {\n\t\t\t\tWriteIdentifier(namedNode.GroupName);\n\t\t\t\tWriteToken(Roles.Colon);\n\t\t\t}\n\t\t\tVisitNodeInPattern(namedNode.ChildNode);\n\t\t}\n\t\t\n\t\tvoid VisitRepeat(Repeat repeat)\n\t\t{\n\t\t\tWriteKeyword(\"repeat\");\n\t\t\tLPar();\n\t\t\tif (repeat.MinCount != 0 || repeat.MaxCount != int.MaxValue) {\n\t\t\t\tWriteIdentifier(repeat.MinCount.ToString());\n\t\t\t\tWriteToken(Roles.Comma);\n\t\t\t\tWriteIdentifier(repeat.MaxCount.ToString());\n\t\t\t\tWriteToken(Roles.Comma);\n\t\t\t}\n\t\t\tVisitNodeInPattern(repeat.ChildNode);\n\t\t\tRPar();\n\t\t}\n\t\t\n\t\tvoid VisitOptionalNode(OptionalNode optionalNode)\n\t\t{\n\t\t\tWriteKeyword(\"optional\");\n\t\t\tLPar();\n\t\t\tVisitNodeInPattern(optionalNode.ChildNode);\n\t\t\tRPar();\n\t\t}\n\t\t\n\t\tvoid VisitNodeInPattern(INode childNode)\n\t\t{\n\t\t\tif (childNode is AstNode) {\n\t\t\t\t((AstNode)childNode).AcceptVisitor(this);\n\t\t\t} else if (childNode is IdentifierExpressionBackreference) {\n\t\t\t\tVisitIdentifierExpressionBackreference((IdentifierExpressionBackreference)childNode);\n\t\t\t} else if (childNode is Choice) {\n\t\t\t\tVisitChoice((Choice)childNode);\n\t\t\t} else if (childNode is AnyNode) {\n\t\t\t\tVisitAnyNode((AnyNode)childNode);\n\t\t\t} else if (childNode is Backreference) {\n\t\t\t\tVisitBackreference((Backreference)childNode);\n\t\t\t} else if (childNode is NamedNode) {\n\t\t\t\tVisitNamedNode((NamedNode)childNode);\n\t\t\t} else if (childNode is OptionalNode) {\n\t\t\t\tVisitOptionalNode((OptionalNode)childNode);\n\t\t\t} else if (childNode is Repeat) {\n\t\t\t\tVisitRepeat((Repeat)childNode);\n\t\t\t} else {\n\t\t\t\tTextWriterTokenWriter.PrintPrimitiveValue(childNode);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Documentation Reference\n\t\tpublic void VisitDocumentationReference(DocumentationReference documentationReference)\n\t\t{\n\t\t\tStartNode(documentationReference);\n\t\t\tif (!documentationReference.DeclaringType.IsNull) {\n\t\t\t\tdocumentationReference.DeclaringType.AcceptVisitor(this);\n\t\t\t\tif (documentationReference.SymbolKind != SymbolKind.TypeDefinition) {\n\t\t\t\t\tWriteToken(Roles.Dot);\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch (documentationReference.SymbolKind) {\n\t\t\t\tcase SymbolKind.TypeDefinition:\n\t\t\t\t\t// we already printed the DeclaringType\n\t\t\t\t\tbreak;\n\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\t\tWriteKeyword(IndexerDeclaration.ThisKeywordRole);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SymbolKind.Operator:\n\t\t\t\t\tvar opType = documentationReference.OperatorType;\n\t\t\t\t\tif (opType == OperatorType.Explicit) {\n\t\t\t\t\t\tWriteKeyword(OperatorDeclaration.ExplicitRole);\n\t\t\t\t\t} else if (opType == OperatorType.Implicit) {\n\t\t\t\t\t\tWriteKeyword(OperatorDeclaration.ImplicitRole);\n\t\t\t\t\t}\n\t\t\t\t\tWriteKeyword(OperatorDeclaration.OperatorKeywordRole);\n\t\t\t\t\tSpace();\n\t\t\t\t\tif (opType == OperatorType.Explicit || opType == OperatorType.Implicit) {\n\t\t\t\t\t\tdocumentationReference.ConversionOperatorReturnType.AcceptVisitor(this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWriteToken(OperatorDeclaration.GetToken(opType), OperatorDeclaration.GetRole(opType));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tWriteIdentifier(documentationReference.GetChildByRole(Roles.Identifier));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tWriteTypeArguments(documentationReference.TypeArguments);\n\t\t\tif (documentationReference.HasParameterList) {\n\t\t\t\tSpace(policy.SpaceBeforeMethodDeclarationParentheses);\n\t\t\t\tif (documentationReference.SymbolKind == SymbolKind.Indexer) {\n\t\t\t\t\tWriteCommaSeparatedListInBrackets(documentationReference.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\t\t} else {\n\t\t\t\t\tWriteCommaSeparatedListInParenthesis(documentationReference.Parameters, policy.SpaceWithinMethodDeclarationParentheses);\n\t\t\t\t}\n\t\t\t}\n\t\t\tEndNode(documentationReference);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t/// <summary>\n\t\t/// Converts special characters to escape sequences within the given string.\n\t\t/// </summary>\n\t\tpublic static string ConvertString(string text)\n\t\t{\n\t\t\treturn TextWriterTokenWriter.ConvertString(text);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CodeDomConvertVisitor.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.CodeDom;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Converts from C# AST to CodeDom.\n\t/// </summary>\n\t/// <remarks>\n\t/// The conversion is intended for use in the SharpDevelop forms designer.\n\t/// </remarks>\n\tpublic class CodeDomConvertVisitor : IAstVisitor<CodeObject>\n\t{\n\t\tCSharpAstResolver resolver;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether the visitor should convert short type names into\n\t\t/// fully qualified type names.\n\t\t/// The default is <c>false</c>.\n\t\t/// </summary>\n\t\tpublic bool UseFullyQualifiedTypeNames { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the visitor is allowed to produce snippet nodes for\n\t\t/// code that cannot be converted.\n\t\t/// The default is <c>true</c>. If this property is set to <c>false</c>,\n\t\t/// unconvertible code will throw a NotSupportedException.\n\t\t/// </summary>\n\t\tpublic bool AllowSnippetNodes { get; set; }\n\t\t\n\t\tpublic CodeDomConvertVisitor()\n\t\t{\n\t\t\tthis.AllowSnippetNodes = true;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts a syntax tree to CodeDom.\n\t\t/// </summary>\n\t\t/// <param name=\"syntaxTree\">The input syntax tree.</param>\n\t\t/// <param name=\"compilation\">The current compilation.</param>\n\t\t/// <param name=\"unresolvedFile\">CSharpUnresolvedFile, used for resolving.</param>\n\t\t/// <returns>Converted CodeCompileUnit</returns>\n\t\t/// <remarks>\n\t\t/// This conversion process requires a resolver because it needs to distinguish field/property/event references etc.\n\t\t/// </remarks>\n\t\tpublic CodeCompileUnit Convert(ICompilation compilation, SyntaxTree syntaxTree, CSharpUnresolvedFile unresolvedFile)\n\t\t{\n\t\t\tif (syntaxTree == null)\n\t\t\t\tthrow new ArgumentNullException(\"syntaxTree\");\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\t\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(compilation, syntaxTree, unresolvedFile);\n\t\t\treturn (CodeCompileUnit)Convert(syntaxTree, resolver);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts a C# AST node to CodeDom.\n\t\t/// </summary>\n\t\t/// <param name=\"node\">The input node.</param>\n\t\t/// <param name=\"resolver\">The AST resolver.</param>\n\t\t/// <returns>The node converted into CodeDom</returns>\n\t\t/// <remarks>\n\t\t/// This conversion process requires a resolver because it needs to distinguish field/property/event references etc.\n\t\t/// </remarks>\n\t\tpublic CodeObject Convert(AstNode node, CSharpAstResolver resolver)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\ttry {\n\t\t\t\tthis.resolver = resolver;\n\t\t\t\treturn node.AcceptVisitor(this);\n\t\t\t} finally {\n\t\t\t\tthis.resolver = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult Resolve(AstNode node)\n\t\t{\n\t\t\tif (resolver == null)\n\t\t\t\treturn ErrorResolveResult.UnknownError;\n\t\t\telse\n\t\t\t\treturn resolver.Resolve(node);\n\t\t}\n\t\t\n\t\tCodeExpression Convert(Expression expr)\n\t\t{\n\t\t\treturn (CodeExpression)expr.AcceptVisitor(this);\n\t\t}\n\t\t\n\t\tCodeExpression[] Convert(IEnumerable<Expression> expressions)\n\t\t{\n\t\t\tList<CodeExpression> result = new List<CodeExpression>();\n\t\t\tforeach (Expression expr in expressions) {\n\t\t\t\tCodeExpression e = Convert(expr);\n\t\t\t\tif (e != null)\n\t\t\t\t\tresult.Add(e);\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\t\n\t\tCodeTypeReference Convert(AstType type)\n\t\t{\n\t\t\treturn (CodeTypeReference)type.AcceptVisitor(this);\n\t\t}\n\t\t\n\t\tCodeTypeReference[] Convert(IEnumerable<AstType> types)\n\t\t{\n\t\t\tList<CodeTypeReference> result = new List<CodeTypeReference>();\n\t\t\tforeach (AstType type in types) {\n\t\t\t\tCodeTypeReference e = Convert(type);\n\t\t\t\tif (e != null)\n\t\t\t\t\tresult.Add(e);\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\t\n\t\tpublic CodeTypeReference Convert(IType type)\n\t\t{\n\t\t\tif (type.Kind == TypeKind.Array) {\n\t\t\t\tArrayType a = (ArrayType)type;\n\t\t\t\treturn new CodeTypeReference(Convert(a.ElementType), a.Dimensions);\n\t\t\t} else if (type is ParameterizedType) {\n\t\t\t\tvar pt = (ParameterizedType)type;\n\t\t\t\treturn new CodeTypeReference(pt.GetDefinition().ReflectionName, pt.TypeArguments.Select(Convert).ToArray());\n\t\t\t} else {\n\t\t\t\treturn new CodeTypeReference(type.ReflectionName);\n\t\t\t}\n\t\t}\n\t\t\n\t\tCodeStatement Convert(Statement stmt)\n\t\t{\n\t\t\treturn (CodeStatement)stmt.AcceptVisitor(this);\n\t\t}\n\t\t\n\t\tCodeStatement[] ConvertBlock(BlockStatement block)\n\t\t{\n\t\t\tList<CodeStatement> result = new List<CodeStatement>();\n\t\t\tforeach (Statement stmt in block.Statements) {\n\t\t\t\tif (stmt is EmptyStatement)\n\t\t\t\t\tcontinue;\n\t\t\t\tCodeStatement s = Convert(stmt);\n\t\t\t\tif (s != null)\n\t\t\t\t\tresult.Add(s);\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\t\n\t\tCodeStatement[] ConvertEmbeddedStatement(Statement embeddedStatement)\n\t\t{\n\t\t\tBlockStatement block = embeddedStatement as BlockStatement;\n\t\t\tif (block != null) {\n\t\t\t\treturn ConvertBlock(block);\n\t\t\t} else if (embeddedStatement is EmptyStatement) {\n\t\t\t\treturn new CodeStatement[0];\n\t\t\t}\n\t\t\tCodeStatement s = Convert(embeddedStatement);\n\t\t\tif (s != null)\n\t\t\t\treturn new CodeStatement[] { s };\n\t\t\telse\n\t\t\t\treturn new CodeStatement[0];\n\t\t}\n\t\t\n\t\tstring MakeSnippet(AstNode node)\n\t\t{\n\t\t\tif (!AllowSnippetNodes)\n\t\t\t\tthrow new NotSupportedException();\n\t\t\tStringWriter w = new StringWriter();\n\t\t\tCSharpOutputVisitor v = new CSharpOutputVisitor(w, FormattingOptionsFactory.CreateMono ());\n\t\t\tnode.AcceptVisitor(v);\n\t\t\treturn w.ToString();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts an expression by storing it as C# snippet.\n\t\t/// This is used for expressions that cannot be represented in CodeDom.\n\t\t/// </summary>\n\t\tCodeSnippetExpression MakeSnippetExpression(Expression expr)\n\t\t{\n\t\t\treturn new CodeSnippetExpression(MakeSnippet(expr));\n\t\t}\n\t\t\n\t\tCodeSnippetStatement MakeSnippetStatement(Statement stmt)\n\t\t{\n\t\t\treturn new CodeSnippetStatement(MakeSnippet(stmt));\n\t\t}\n\n\t\tCodeObject IAstVisitor<CodeObject>.VisitNullNode(AstNode nullNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tCodeObject IAstVisitor<CodeObject>.VisitErrorNode(AstNode errorNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tCodeObject IAstVisitor<CodeObject>.VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(anonymousMethodExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(undocumentedExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t{\n\t\t\tCodeArrayCreateExpression ace = new CodeArrayCreateExpression();\n\t\t\tint dimensions = arrayCreateExpression.Arguments.Count;\n\t\t\tint nestingDepth = arrayCreateExpression.AdditionalArraySpecifiers.Count;\n\t\t\tif (dimensions > 0)\n\t\t\t\tnestingDepth++;\n\t\t\tif (nestingDepth > 1 || dimensions > 1) {\n\t\t\t\t// CodeDom does not support jagged or multi-dimensional arrays\n\t\t\t\treturn MakeSnippetExpression(arrayCreateExpression);\n\t\t\t}\n\t\t\tif (arrayCreateExpression.Type.IsNull) {\n\t\t\t\tace.CreateType = Convert(Resolve(arrayCreateExpression).Type);\n\t\t\t} else {\n\t\t\t\tace.CreateType = Convert(arrayCreateExpression.Type);\n\t\t\t}\n\t\t\tif (arrayCreateExpression.Arguments.Count == 1) {\n\t\t\t\tace.SizeExpression = Convert(arrayCreateExpression.Arguments.Single());\n\t\t\t}\n\t\t\tace.Initializers.AddRange(Convert(arrayCreateExpression.Initializer.Elements));\n\t\t\treturn ace;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\t// Array initializers should be handled by the parent node\n\t\t\treturn MakeSnippetExpression(arrayInitializerExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitAsExpression(AsExpression asExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(asExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\t// assignments are only supported as statements, not as expressions\n\t\t\treturn MakeSnippetExpression(assignmentExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression)\n\t\t{\n\t\t\treturn new CodeBaseReferenceExpression();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\tCodeBinaryOperatorType op;\n\t\t\tswitch (binaryOperatorExpression.Operator) {\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\top = CodeBinaryOperatorType.BitwiseAnd;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\top = CodeBinaryOperatorType.BitwiseOr;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\top = CodeBinaryOperatorType.BooleanAnd;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\top = CodeBinaryOperatorType.BooleanOr;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\top = CodeBinaryOperatorType.GreaterThan;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\top = CodeBinaryOperatorType.GreaterThanOrEqual;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\top = CodeBinaryOperatorType.LessThan;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\top = CodeBinaryOperatorType.LessThanOrEqual;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\t\top = CodeBinaryOperatorType.Add;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\top = CodeBinaryOperatorType.Subtract;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\t\top = CodeBinaryOperatorType.Multiply;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\t\top = CodeBinaryOperatorType.Divide;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\top = CodeBinaryOperatorType.Modulus;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\tOperatorResolveResult rr = Resolve(binaryOperatorExpression) as OperatorResolveResult;\n\t\t\t\t\tif (rr != null && rr.GetChildResults().Any(cr => cr.Type.IsReferenceType == true)) {\n\t\t\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.Equality)\n\t\t\t\t\t\t\top = CodeBinaryOperatorType.IdentityEquality;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\top = CodeBinaryOperatorType.IdentityInequality;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.Equality) {\n\t\t\t\t\t\t\top = CodeBinaryOperatorType.ValueEquality;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// CodeDom is retarded and does not support ValueInequality, so we'll simulate it using\n\t\t\t\t\t\t\t// ValueEquality and Not... but CodeDom doesn't have Not either, so we use\n\t\t\t\t\t\t\t// '(a == b) == false'\n\t\t\t\t\t\t\treturn new CodeBinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew CodeBinaryOperatorExpression(\n\t\t\t\t\t\t\t\t\tConvert(binaryOperatorExpression.Left),\n\t\t\t\t\t\t\t\t\tCodeBinaryOperatorType.ValueEquality,\n\t\t\t\t\t\t\t\t\tConvert(binaryOperatorExpression.Right)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tCodeBinaryOperatorType.ValueEquality,\n\t\t\t\t\t\t\t\tnew CodePrimitiveExpression(false)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// not supported: xor, shift, null coalescing\n\t\t\t\t\treturn MakeSnippetExpression(binaryOperatorExpression);\n\t\t\t}\n\t\t\treturn new CodeBinaryOperatorExpression(Convert(binaryOperatorExpression.Left), op, Convert(binaryOperatorExpression.Right));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitCastExpression(CastExpression castExpression)\n\t\t{\n\t\t\treturn new CodeCastExpression(Convert(castExpression.Type), Convert(castExpression.Expression));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitCheckedExpression(CheckedExpression checkedExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(checkedExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(conditionalExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression)\n\t\t{\n\t\t\treturn new CodeDefaultValueExpression(Convert(defaultValueExpression.Type));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t{\n\t\t\tSystem.CodeDom.FieldDirection direction;\n\t\t\tif (directionExpression.FieldDirection == FieldDirection.Out) {\n\t\t\t\tdirection = System.CodeDom.FieldDirection.Out;\n\t\t\t} else {\n\t\t\t\tdirection = System.CodeDom.FieldDirection.Ref;\n\t\t\t}\n\t\t\treturn new CodeDirectionExpression(direction, Convert(directionExpression.Expression));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tResolveResult rr = Resolve(identifierExpression);\n\t\t\tLocalResolveResult lrr = rr as LocalResolveResult;\n\t\t\tif (lrr != null && lrr.IsParameter) {\n\t\t\t\tif (lrr.Variable.Name == \"value\" && identifierExpression.Ancestors.Any(a => a is Accessor)) {\n\t\t\t\t\treturn new CodePropertySetValueReferenceExpression();\n\t\t\t\t} else {\n\t\t\t\t\treturn new CodeArgumentReferenceExpression(lrr.Variable.Name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\tif (mrr != null) {\n\t\t\t\treturn HandleMemberReference(null, identifierExpression.Identifier, identifierExpression.TypeArguments, mrr);\n\t\t\t}\n\t\t\tTypeResolveResult trr = rr as TypeResolveResult;\n\t\t\tif (trr != null) {\n\t\t\t\tCodeTypeReference typeRef;\n\t\t\t\tif (UseFullyQualifiedTypeNames) {\n\t\t\t\t\ttypeRef = Convert(trr.Type);\n\t\t\t\t} else {\n\t\t\t\t\ttypeRef = new CodeTypeReference(identifierExpression.Identifier);\n\t\t\t\t\ttypeRef.TypeArguments.AddRange(Convert(identifierExpression.TypeArguments));\n\t\t\t\t}\n\t\t\t\treturn new CodeTypeReferenceExpression(typeRef);\n\t\t\t}\n\t\t\tMethodGroupResolveResult mgrr = rr as MethodGroupResolveResult;\n\t\t\tif (mgrr != null || identifierExpression.TypeArguments.Any()) {\n\t\t\t\treturn new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), identifierExpression.Identifier, Convert(identifierExpression.TypeArguments));\n\t\t\t}\n\t\t\treturn new CodeVariableReferenceExpression(identifierExpression.Identifier);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t{\n\t\t\tif (Resolve(indexerExpression) is ArrayAccessResolveResult)\n\t\t\t\treturn new CodeArrayIndexerExpression(Convert(indexerExpression.Target), Convert(indexerExpression.Arguments));\n\t\t\telse\n\t\t\t\treturn new CodeIndexerExpression(Convert(indexerExpression.Target), Convert(indexerExpression.Arguments));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\tMemberResolveResult rr = Resolve(invocationExpression) as MemberResolveResult;\n\t\t\tCSharpInvocationResolveResult csRR = rr as CSharpInvocationResolveResult;\n\t\t\tif (csRR != null && csRR.IsDelegateInvocation) {\n\t\t\t\treturn new CodeDelegateInvokeExpression(Convert(invocationExpression.Target), Convert(invocationExpression.Arguments));\n\t\t\t}\n\t\t\t\n\t\t\tExpression methodExpr = invocationExpression.Target;\n\t\t\twhile (methodExpr is ParenthesizedExpression)\n\t\t\t\tmethodExpr = ((ParenthesizedExpression)methodExpr).Expression;\n\t\t\tCodeMethodReferenceExpression mr = null;\n\t\t\tMemberReferenceExpression mre = methodExpr as MemberReferenceExpression;\n\t\t\tif (mre != null) {\n\t\t\t\tmr = new CodeMethodReferenceExpression(Convert(mre.Target), mre.MemberName, Convert(mre.TypeArguments));\n\t\t\t}\n\t\t\tIdentifierExpression id = methodExpr as IdentifierExpression;\n\t\t\tif (id != null) {\n\t\t\t\tCodeExpression target;\n\t\t\t\tif (rr != null && rr.Member.IsStatic)\n\t\t\t\t\ttarget = new CodeTypeReferenceExpression(Convert(rr.Member.DeclaringType));\n\t\t\t\telse\n\t\t\t\t\ttarget = new CodeThisReferenceExpression();\n\t\t\t\t\n\t\t\t\tmr = new CodeMethodReferenceExpression(target, id.Identifier, Convert(id.TypeArguments));\n\t\t\t}\n\t\t\tif (mr != null)\n\t\t\t\treturn new CodeMethodInvokeExpression(mr, Convert(invocationExpression.Arguments));\n\t\t\telse\n\t\t\t\treturn MakeSnippetExpression(invocationExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitIsExpression(IsExpression isExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(isExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(lambdaExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tCodeExpression target = Convert(memberReferenceExpression.Target);\n\t\t\tResolveResult rr = Resolve(memberReferenceExpression);\n\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\tTypeResolveResult trr = rr as TypeResolveResult;\n\t\t\tif (mrr != null) {\n\t\t\t\treturn HandleMemberReference(target, memberReferenceExpression.MemberName, memberReferenceExpression.TypeArguments, mrr);\n\t\t\t} else if (trr != null) {\n\t\t\t\treturn new CodeTypeReferenceExpression(Convert(trr.Type));\n\t\t\t} else {\n\t\t\t\tif (memberReferenceExpression.TypeArguments.Any() || rr is MethodGroupResolveResult) {\n\t\t\t\t\treturn new CodeMethodReferenceExpression(target, memberReferenceExpression.MemberName, Convert(memberReferenceExpression.TypeArguments));\n\t\t\t\t} else {\n\t\t\t\t\treturn new CodePropertyReferenceExpression(target, memberReferenceExpression.MemberName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tCodeExpression HandleMemberReference(CodeExpression target, string identifier, AstNodeCollection<AstType> typeArguments, MemberResolveResult mrr)\n\t\t{\n\t\t\tif (target == null) {\n\t\t\t\tif (mrr.Member.IsStatic)\n\t\t\t\t\ttarget = new CodeTypeReferenceExpression(Convert(mrr.Member.DeclaringType));\n\t\t\t\telse\n\t\t\t\t\ttarget = new CodeThisReferenceExpression();\n\t\t\t}\n\t\t\tif (mrr.Member is IField) {\n\t\t\t\treturn new CodeFieldReferenceExpression(target, identifier);\n\t\t\t} else if (mrr.Member is IMethod) {\n\t\t\t\treturn new CodeMethodReferenceExpression(target, identifier, Convert(typeArguments));\n\t\t\t} else if (mrr.Member is IEvent) {\n\t\t\t\treturn new CodeEventReferenceExpression(target, identifier);\n\t\t\t} else {\n\t\t\t\treturn new CodePropertyReferenceExpression(target, identifier);\n\t\t\t}\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(namedArgumentExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitNamedExpression(NamedExpression namedExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(namedExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression)\n\t\t{\n\t\t\treturn new CodePrimitiveExpression(null);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t{\n\t\t\tif (!objectCreateExpression.Initializer.IsNull)\n\t\t\t\treturn MakeSnippetExpression(objectCreateExpression);\n\t\t\treturn new CodeObjectCreateExpression(Convert(objectCreateExpression.Type), Convert(objectCreateExpression.Arguments));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(anonymousTypeCreateExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\t// CodeDom generators will insert parentheses where necessary\n\t\t\treturn Convert(parenthesizedExpression.Expression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(pointerReferenceExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t{\n\t\t\treturn new CodePrimitiveExpression(primitiveExpression.Value);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitSizeOfExpression(SizeOfExpression sizeOfExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(sizeOfExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitStackAllocExpression(StackAllocExpression stackAllocExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(stackAllocExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t{\n\t\t\treturn new CodeThisReferenceExpression();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitTypeOfExpression(TypeOfExpression typeOfExpression)\n\t\t{\n\t\t\treturn new CodeTypeOfExpression(Convert(typeOfExpression.Type));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression)\n\t\t{\n\t\t\treturn new CodeTypeReferenceExpression(Convert(typeReferenceExpression.Type));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tswitch (unaryOperatorExpression.Operator) {\n\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\t\treturn new CodeBinaryOperatorExpression(\n\t\t\t\t\t\tConvert(unaryOperatorExpression.Expression),\n\t\t\t\t\t\tCodeBinaryOperatorType.ValueEquality,\n\t\t\t\t\t\tnew CodePrimitiveExpression(false));\n\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\treturn new CodeBinaryOperatorExpression(\n\t\t\t\t\t\tnew CodePrimitiveExpression(0),\n\t\t\t\t\t\tCodeBinaryOperatorType.Subtract,\n\t\t\t\t\t\tConvert(unaryOperatorExpression.Expression));\n\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\t\treturn Convert(unaryOperatorExpression.Expression);\n\t\t\t\tdefault:\n\t\t\t\t\treturn MakeSnippetExpression(unaryOperatorExpression);\n\t\t\t}\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUncheckedExpression(UncheckedExpression uncheckedExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(uncheckedExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\treturn MakeSnippetExpression(queryExpression);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryWhereClause(QueryWhereClause queryWhereClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryJoinClause(QueryJoinClause queryJoinClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryOrderClause(QueryOrderClause queryOrderClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryOrdering(QueryOrdering queryOrdering)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQuerySelectClause(QuerySelectClause querySelectClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitQueryGroupClause(QueryGroupClause queryGroupClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitAttribute(Attribute attribute)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitAttributeSection(AttributeSection attributeSection)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeAttributeDeclaration Convert(Attribute attribute)\n\t\t{\n\t\t\tvar attr = new CodeAttributeDeclaration(Convert(attribute.Type));\n\t\t\tforeach (Expression expr in attribute.Arguments) {\n\t\t\t\tNamedExpression ne = expr as NamedExpression;\n\t\t\t\tif (ne != null)\n\t\t\t\t\tattr.Arguments.Add(new CodeAttributeArgument(ne.Name, Convert(ne.Expression)));\n\t\t\t\telse\n\t\t\t\t\tattr.Arguments.Add(new CodeAttributeArgument(Convert(expr)));\n\t\t\t}\n\t\t\treturn attr;\n\t\t}\n\t\t\n\t\tCodeAttributeDeclaration[] Convert(IEnumerable<AttributeSection> attributeSections)\n\t\t{\n\t\t\tList<CodeAttributeDeclaration> result = new List<CodeAttributeDeclaration>();\n\t\t\tforeach (AttributeSection section in attributeSections) {\n\t\t\t\tforeach (Attribute attr in section.Attributes) {\n\t\t\t\t\tCodeAttributeDeclaration attrDecl = Convert(attr);\n\t\t\t\t\tif (attrDecl != null)\n\t\t\t\t\t\tresult.Add(attrDecl);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\tCodeTypeDelegate d = new CodeTypeDelegate(delegateDeclaration.Name);\n\t\t\td.Attributes = ConvertMemberAttributes(delegateDeclaration.Modifiers, SymbolKind.TypeDefinition);\n\t\t\td.CustomAttributes.AddRange(Convert(delegateDeclaration.Attributes));\n\t\t\td.ReturnType = Convert(delegateDeclaration.ReturnType);\n\t\t\td.Parameters.AddRange(Convert(delegateDeclaration.Parameters));\n\t\t\td.TypeParameters.AddRange(ConvertTypeParameters(delegateDeclaration.TypeParameters, delegateDeclaration.Constraints));\n\t\t\treturn d;\n\t\t}\n\t\t\n\t\tMemberAttributes ConvertMemberAttributes(Modifiers modifiers, SymbolKind symbolKind)\n\t\t{\n\t\t\tMemberAttributes a = 0;\n\t\t\tif ((modifiers & Modifiers.Abstract) != 0)\n\t\t\t\ta |= MemberAttributes.Abstract;\n\t\t\tif ((modifiers & Modifiers.Sealed) != 0)\n\t\t\t\ta |= MemberAttributes.Final;\n\t\t\tif (symbolKind != SymbolKind.TypeDefinition && (modifiers & (Modifiers.Abstract | Modifiers.Override | Modifiers.Virtual)) == 0)\n\t\t\t\ta |= MemberAttributes.Final;\n\t\t\tif ((modifiers & Modifiers.Static) != 0)\n\t\t\t\ta |= MemberAttributes.Static;\n\t\t\tif ((modifiers & Modifiers.Override) != 0)\n\t\t\t\ta |= MemberAttributes.Override;\n\t\t\tif ((modifiers & Modifiers.Const) != 0)\n\t\t\t\ta |= MemberAttributes.Const;\n\t\t\tif ((modifiers & Modifiers.New) != 0)\n\t\t\t\ta |= MemberAttributes.New;\n\t\t\t\n\t\t\tif ((modifiers & Modifiers.Public) != 0)\n\t\t\t\ta |= MemberAttributes.Public;\n\t\t\telse if ((modifiers & (Modifiers.Protected | Modifiers.Internal)) == (Modifiers.Protected | Modifiers.Internal))\n\t\t\t\ta |= MemberAttributes.FamilyOrAssembly;\n\t\t\telse if ((modifiers & Modifiers.Protected) != 0)\n\t\t\t\ta |= MemberAttributes.Family;\n\t\t\telse if ((modifiers & Modifiers.Internal) != 0)\n\t\t\t\ta |= MemberAttributes.Assembly;\n\t\t\telse if ((modifiers & Modifiers.Private) != 0)\n\t\t\t\ta |= MemberAttributes.Private;\n\t\t\t\n\t\t\treturn a;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\tCodeNamespace ns = new CodeNamespace(namespaceDeclaration.Name);\n\t\t\tforeach (AstNode node in namespaceDeclaration.Members) {\n\t\t\t\tCodeObject r = node.AcceptVisitor(this);\n\t\t\t\t\n\t\t\t\tCodeNamespaceImport import = r as CodeNamespaceImport;\n\t\t\t\tif (import != null)\n\t\t\t\t\tns.Imports.Add(import);\n\t\t\t\t\n\t\t\t\tCodeTypeDeclaration typeDecl = r as CodeTypeDeclaration;\n\t\t\t\tif (typeDecl != null)\n\t\t\t\t\tns.Types.Add(typeDecl);\n\t\t\t}\n\t\t\treturn ns;\n\t\t}\n\t\t\n\t\tStack<CodeTypeDeclaration> typeStack = new Stack<CodeTypeDeclaration>();\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\t//bool isNestedType = typeStack.Count > 0;\n\t\t\tCodeTypeDeclaration typeDecl = new CodeTypeDeclaration(typeDeclaration.Name);\n\t\t\ttypeDecl.Attributes = ConvertMemberAttributes(typeDeclaration.Modifiers, SymbolKind.TypeDefinition);\n\t\t\ttypeDecl.CustomAttributes.AddRange(Convert(typeDeclaration.Attributes));\n\t\t\t\n\t\t\tswitch (typeDeclaration.ClassType) {\n\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\ttypeDecl.IsStruct = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\ttypeDecl.IsInterface = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\ttypeDecl.IsEnum = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ttypeDecl.IsClass = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttypeDecl.IsPartial = (typeDeclaration.Modifiers & Modifiers.Partial) == Modifiers.Partial;\n\t\t\t\n\t\t\ttypeDecl.BaseTypes.AddRange(Convert(typeDeclaration.BaseTypes));\n\t\t\ttypeDecl.TypeParameters.AddRange(ConvertTypeParameters(typeDeclaration.TypeParameters, typeDeclaration.Constraints));\n\t\t\t\n\t\t\ttypeStack.Push(typeDecl);\n\t\t\tforeach (var member in typeDeclaration.Members) {\n\t\t\t\tCodeTypeMember m = member.AcceptVisitor(this) as CodeTypeMember;\n\t\t\t\tif (m != null)\n\t\t\t\t\ttypeDecl.Members.Add(m);\n\t\t\t}\n\t\t\ttypeStack.Pop();\n\t\t\treturn typeDecl;\n\t\t}\n\t\t\n\t\tvoid AddTypeMember(CodeTypeMember member)\n\t\t{\n\t\t\tif (typeStack.Count != 0)\n\t\t\t\ttypeStack.Peek().Members.Add(member);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUsingAliasDeclaration(UsingAliasDeclaration usingAliasDeclaration)\n\t\t{\n\t\t\treturn new CodeSnippetTypeMember(MakeSnippet(usingAliasDeclaration));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\treturn new CodeNamespaceImport(usingDeclaration.Namespace);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\treturn new CodeSnippetTypeMember(MakeSnippet(externAliasDeclaration));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitBlockStatement(BlockStatement blockStatement)\n\t\t{\n\t\t\treturn new CodeConditionStatement(new CodePrimitiveExpression(true), ConvertBlock(blockStatement));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitBreakStatement(BreakStatement breakStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(breakStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitCheckedStatement(CheckedStatement checkedStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(checkedStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitContinueStatement(ContinueStatement continueStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(continueStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitDoWhileStatement(DoWhileStatement doWhileStatement)\n\t\t{\n\t\t\t// do { } while (expr);\n\t\t\t//\n\t\t\t// emulate with:\n\t\t\t//  for (bool _do = true; _do; _do = expr) {}\n\t\t\tstring varName = \"_do\" + doWhileStatement.Ancestors.OfType<DoWhileStatement>().Count();\n\t\t\treturn new CodeIterationStatement(\n\t\t\t\tnew CodeVariableDeclarationStatement(typeof(bool), varName, new CodePrimitiveExpression(true)),\n\t\t\t\tnew CodeVariableReferenceExpression(varName),\n\t\t\t\tnew CodeAssignStatement(new CodeVariableReferenceExpression(varName), Convert(doWhileStatement.Condition)),\n\t\t\t\tConvertEmbeddedStatement(doWhileStatement.EmbeddedStatement)\n\t\t\t);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitEmptyStatement(EmptyStatement emptyStatement)\n\t\t{\n\t\t\treturn EmptyStatement();\n\t\t}\n\t\t\n\t\tCodeStatement EmptyStatement()\n\t\t{\n\t\t\treturn new CodeExpressionStatement(new CodeObjectCreateExpression(new CodeTypeReference(typeof(object))));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitExpressionStatement(ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tAssignmentExpression assignment = expressionStatement.Expression as AssignmentExpression;\n\t\t\tif (assignment != null && assignment.Operator == AssignmentOperatorType.Assign) {\n\t\t\t\treturn new CodeAssignStatement(Convert(assignment.Left), Convert(assignment.Right));\n\t\t\t} else if (assignment != null && CanBeDuplicatedForCompoundAssignment(assignment.Left)) {\n\t\t\t\tCodeBinaryOperatorType op;\n\t\t\t\tswitch (assignment.Operator) {\n\t\t\t\t\tcase AssignmentOperatorType.Add:\n\t\t\t\t\t\top = CodeBinaryOperatorType.Add;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AssignmentOperatorType.Subtract:\n\t\t\t\t\t\top = CodeBinaryOperatorType.Subtract;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AssignmentOperatorType.Multiply:\n\t\t\t\t\t\top = CodeBinaryOperatorType.Multiply;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AssignmentOperatorType.Divide:\n\t\t\t\t\t\top = CodeBinaryOperatorType.Divide;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AssignmentOperatorType.Modulus:\n\t\t\t\t\t\top = CodeBinaryOperatorType.Modulus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AssignmentOperatorType.BitwiseAnd:\n\t\t\t\t\t\top = CodeBinaryOperatorType.BitwiseAnd;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AssignmentOperatorType.BitwiseOr:\n\t\t\t\t\t\top = CodeBinaryOperatorType.BitwiseOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn MakeSnippetStatement(expressionStatement);\n\t\t\t\t}\n\t\t\t\tvar cboe = new CodeBinaryOperatorExpression(Convert(assignment.Left), op, Convert(assignment.Right));\n\t\t\t\treturn new CodeAssignStatement(Convert(assignment.Left), cboe);\n\t\t\t}\n\t\t\tUnaryOperatorExpression unary = expressionStatement.Expression as UnaryOperatorExpression;\n\t\t\tif (unary != null && CanBeDuplicatedForCompoundAssignment(unary.Expression)) {\n\t\t\t\tvar op = unary.Operator;\n\t\t\t\tif (op == UnaryOperatorType.Increment || op == UnaryOperatorType.PostIncrement) {\n\t\t\t\t\tvar cboe = new CodeBinaryOperatorExpression(Convert(unary.Expression), CodeBinaryOperatorType.Add, new CodePrimitiveExpression(1));\n\t\t\t\t\treturn new CodeAssignStatement(Convert(unary.Expression), cboe);\n\t\t\t\t} else if (op == UnaryOperatorType.Decrement || op == UnaryOperatorType.PostDecrement) {\n\t\t\t\t\tvar cboe = new CodeBinaryOperatorExpression(Convert(unary.Expression), CodeBinaryOperatorType.Subtract, new CodePrimitiveExpression(1));\n\t\t\t\t\treturn new CodeAssignStatement(Convert(unary.Expression), cboe);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (assignment != null && assignment.Operator == AssignmentOperatorType.Add) {\n\t\t\t\tvar rr = Resolve(assignment.Left);\n\t\t\t\tif (!rr.IsError && rr.Type.Kind == TypeKind.Delegate) {\n\t\t\t\t\tvar expr = (MemberReferenceExpression)assignment.Left;\n\t\t\t\t\tvar memberRef = (CodeEventReferenceExpression)HandleMemberReference(Convert(expr.Target), expr.MemberName, expr.TypeArguments, (MemberResolveResult)rr);\n\t\t\t\t\treturn new CodeAttachEventStatement(memberRef, Convert(assignment.Right));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new CodeExpressionStatement(Convert(expressionStatement.Expression));\n\t\t}\n\t\t\n\t\tbool CanBeDuplicatedForCompoundAssignment(Expression expr)\n\t\t{\n\t\t\treturn expr is IdentifierExpression;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitFixedStatement(FixedStatement fixedStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(fixedStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(foreachStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitForStatement(ForStatement forStatement)\n\t\t{\n\t\t\tif (forStatement.Initializers.Count != 1 || forStatement.Iterators.Count != 1)\n\t\t\t\treturn MakeSnippetStatement(forStatement);\n\t\t\treturn new CodeIterationStatement(\n\t\t\t\tConvert(forStatement.Initializers.Single()),\n\t\t\t\tConvert(forStatement.Condition),\n\t\t\t\tConvert(forStatement.Iterators.Single()),\n\t\t\t\tConvertEmbeddedStatement(forStatement.EmbeddedStatement)\n\t\t\t);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(gotoCaseStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(gotoDefaultStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitGotoStatement(GotoStatement gotoStatement)\n\t\t{\n\t\t\treturn new CodeGotoStatement(gotoStatement.Label);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t{\n\t\t\treturn new CodeConditionStatement(\n\t\t\t\tConvert(ifElseStatement.Condition),\n\t\t\t\tConvertEmbeddedStatement(ifElseStatement.TrueStatement),\n\t\t\t\tConvertEmbeddedStatement(ifElseStatement.FalseStatement));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitLabelStatement(LabelStatement labelStatement)\n\t\t{\n\t\t\treturn new CodeLabeledStatement(labelStatement.Label);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitLockStatement(LockStatement lockStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(lockStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitReturnStatement(ReturnStatement returnStatement)\n\t\t{\n\t\t\treturn new CodeMethodReturnStatement(Convert(returnStatement.Expression));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitSwitchStatement(SwitchStatement switchStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(switchStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitSwitchSection(SwitchSection switchSection)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitCaseLabel(CaseLabel caseLabel)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitThrowStatement(ThrowStatement throwStatement)\n\t\t{\n\t\t\treturn new CodeThrowExceptionStatement(Convert(throwStatement.Expression));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitTryCatchStatement(TryCatchStatement tryCatchStatement)\n\t\t{\n\t\t\tList<CodeCatchClause> catchClauses = new List<CodeCatchClause>();\n\t\t\tforeach (var catchClause in tryCatchStatement.CatchClauses) {\n\t\t\t\tcatchClauses.Add(new CodeCatchClause(catchClause.VariableName, Convert(catchClause.Type), ConvertBlock(catchClause.Body)));\n\t\t\t}\n\t\t\treturn new CodeTryCatchFinallyStatement(\n\t\t\t\tConvertBlock(tryCatchStatement.TryBlock),\n\t\t\t\tcatchClauses.ToArray(),\n\t\t\t\tConvertBlock(tryCatchStatement.FinallyBlock));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitCatchClause(CatchClause catchClause)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUncheckedStatement(UncheckedStatement uncheckedStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(uncheckedStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUnsafeStatement(UnsafeStatement unsafeStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(unsafeStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitUsingStatement(UsingStatement usingStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(usingStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\tif (variableDeclarationStatement.Variables.Count != 1)\n\t\t\t\treturn MakeSnippetStatement(variableDeclarationStatement);\n\t\t\tVariableInitializer vi = variableDeclarationStatement.Variables.Single();\n\t\t\treturn new CodeVariableDeclarationStatement(\n\t\t\t\tConvert(variableDeclarationStatement.Type),\n\t\t\t\tvi.Name,\n\t\t\t\tConvertVariableInitializer(vi.Initializer, variableDeclarationStatement.Type));\n\t\t}\n\t\t\n\t\tCodeExpression ConvertVariableInitializer(Expression expr, AstType type)\n\t\t{\n\t\t\tArrayInitializerExpression aie = expr as ArrayInitializerExpression;\n\t\t\tif (aie != null) {\n\t\t\t\treturn new CodeArrayCreateExpression(Convert(type), Convert(aie.Elements));\n\t\t\t} else {\n\t\t\t\treturn Convert(expr);\n\t\t\t}\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitWhileStatement(WhileStatement whileStatement)\n\t\t{\n\t\t\treturn new CodeIterationStatement(EmptyStatement(), Convert(whileStatement.Condition), EmptyStatement(), ConvertEmbeddedStatement(whileStatement.EmbeddedStatement));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(yieldBreakStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitYieldReturnStatement(YieldReturnStatement yieldStatement)\n\t\t{\n\t\t\treturn MakeSnippetStatement(yieldStatement);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitAccessor(Accessor accessor)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\tCodeConstructor ctor = new CodeConstructor();\n\t\t\tctor.Attributes = ConvertMemberAttributes(constructorDeclaration.Modifiers, SymbolKind.Constructor);\n\t\t\tctor.CustomAttributes.AddRange(Convert(constructorDeclaration.Attributes));\n\t\t\tif (constructorDeclaration.Initializer.ConstructorInitializerType == ConstructorInitializerType.This) {\n\t\t\t\tctor.ChainedConstructorArgs.AddRange(Convert(constructorDeclaration.Initializer.Arguments));\n\t\t\t} else {\n\t\t\t\tctor.BaseConstructorArgs.AddRange(Convert(constructorDeclaration.Initializer.Arguments));\n\t\t\t}\n\t\t\tctor.Parameters.AddRange(Convert(constructorDeclaration.Parameters));\n\t\t\t\n\t\t\tctor.Statements.AddRange(ConvertBlock(constructorDeclaration.Body));\n\t\t\treturn ctor;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitConstructorInitializer(ConstructorInitializer constructorInitializer)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\treturn new CodeSnippetTypeMember(MakeSnippet(destructorDeclaration));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\tTypeDeclaration td = enumMemberDeclaration.Parent as TypeDeclaration;\n\t\t\tCodeMemberField f = new CodeMemberField(td != null ? td.Name : \"Enum\", enumMemberDeclaration.Name);\n\t\t\tf.Attributes = MemberAttributes.Public | MemberAttributes.Static;\n\t\t\tf.CustomAttributes.AddRange(Convert(enumMemberDeclaration.Attributes));\n\t\t\tf.InitExpression = Convert(enumMemberDeclaration.Initializer);\n\t\t\treturn f;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tforeach (VariableInitializer vi in eventDeclaration.Variables) {\n\t\t\t\tif (!vi.Initializer.IsNull) {\n\t\t\t\t\tAddTypeMember(new CodeSnippetTypeMember(MakeSnippet(eventDeclaration)));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tCodeMemberEvent e = new CodeMemberEvent();\n\t\t\t\te.Attributes = ConvertMemberAttributes(eventDeclaration.Modifiers, SymbolKind.Event);\n\t\t\t\te.CustomAttributes.AddRange(Convert(eventDeclaration.Attributes));\n\t\t\t\te.Name = vi.Name;\n\t\t\t\te.Type = Convert(eventDeclaration.ReturnType);\n\t\t\t\tAddTypeMember(e);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration)\n\t\t{\n\t\t\treturn new CodeSnippetTypeMember(MakeSnippet(customEventDeclaration));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tforeach (VariableInitializer vi in fieldDeclaration.Variables) {\n\t\t\t\tCodeMemberField f = new CodeMemberField(Convert(fieldDeclaration.ReturnType), vi.Name);\n\t\t\t\tf.Attributes = ConvertMemberAttributes(fieldDeclaration.Modifiers, SymbolKind.Field);\n\t\t\t\tf.CustomAttributes.AddRange(Convert(fieldDeclaration.Attributes));\n\t\t\t\tf.InitExpression = ConvertVariableInitializer(vi.Initializer, fieldDeclaration.ReturnType);\n\t\t\t\tAddTypeMember(f);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\tCodeMemberProperty p = new CodeMemberProperty();\n\t\t\tp.Attributes = ConvertMemberAttributes(indexerDeclaration.Modifiers, SymbolKind.Indexer);\n\t\t\tp.CustomAttributes.AddRange(Convert(indexerDeclaration.Attributes));\n\t\t\tp.Name = \"Items\";\n\t\t\tp.PrivateImplementationType = Convert(indexerDeclaration.PrivateImplementationType);\n\t\t\tp.Parameters.AddRange(Convert(indexerDeclaration.Parameters));\n\t\t\tp.Type = Convert(indexerDeclaration.ReturnType);\n\t\t\t\n\t\t\tif (!indexerDeclaration.Getter.IsNull) {\n\t\t\t\tp.HasGet = true;\n\t\t\t\tp.GetStatements.AddRange(ConvertBlock(indexerDeclaration.Getter.Body));\n\t\t\t}\n\t\t\tif (!indexerDeclaration.Setter.IsNull) {\n\t\t\t\tp.HasSet = true;\n\t\t\t\tp.SetStatements.AddRange(ConvertBlock(indexerDeclaration.Setter.Body));\n\t\t\t}\n\t\t\treturn p;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tCodeMemberMethod m = new CodeMemberMethod();\n\t\t\tm.Attributes = ConvertMemberAttributes(methodDeclaration.Modifiers, SymbolKind.Method);\n\t\t\t\n\t\t\tm.CustomAttributes.AddRange(Convert(methodDeclaration.Attributes.Where(a => a.AttributeTarget != \"return\")));\n\t\t\tm.ReturnTypeCustomAttributes.AddRange(Convert(methodDeclaration.Attributes.Where(a => a.AttributeTarget == \"return\")));\n\t\t\t\n\t\t\tm.ReturnType = Convert(methodDeclaration.ReturnType);\n\t\t\tm.PrivateImplementationType = Convert(methodDeclaration.PrivateImplementationType);\n\t\t\tm.Name = methodDeclaration.Name;\n\t\t\tm.TypeParameters.AddRange(ConvertTypeParameters(methodDeclaration.TypeParameters, methodDeclaration.Constraints));\n\t\t\tm.Parameters.AddRange(Convert(methodDeclaration.Parameters));\n\t\t\t\n\t\t\tm.Statements.AddRange(ConvertBlock(methodDeclaration.Body));\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\tCodeMemberMethod m = new CodeMemberMethod();\n\t\t\tm.Attributes = ConvertMemberAttributes(operatorDeclaration.Modifiers, SymbolKind.Method);\n\t\t\t\n\t\t\tm.CustomAttributes.AddRange(Convert(operatorDeclaration.Attributes.Where(a => a.AttributeTarget != \"return\")));\n\t\t\tm.ReturnTypeCustomAttributes.AddRange(Convert(operatorDeclaration.Attributes.Where(a => a.AttributeTarget == \"return\")));\n\t\t\t\n\t\t\tm.ReturnType = Convert(operatorDeclaration.ReturnType);\n\t\t\tm.Name = operatorDeclaration.Name;\n\t\t\tm.Parameters.AddRange(Convert(operatorDeclaration.Parameters));\n\t\t\t\n\t\t\tm.Statements.AddRange(ConvertBlock(operatorDeclaration.Body));\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tvar p = new CodeParameterDeclarationExpression(Convert(parameterDeclaration.Type), parameterDeclaration.Name);\n\t\t\tp.CustomAttributes.AddRange(Convert(parameterDeclaration.Attributes));\n\t\t\tswitch (parameterDeclaration.ParameterModifier) {\n\t\t\t\tcase ParameterModifier.Ref:\n\t\t\t\t\tp.Direction = System.CodeDom.FieldDirection.Ref;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.Out:\n\t\t\t\t\tp.Direction = System.CodeDom.FieldDirection.Out;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn p;\n\t\t}\n\t\t\n\t\tCodeParameterDeclarationExpression[] Convert(IEnumerable<ParameterDeclaration> parameters)\n\t\t{\n\t\t\tList<CodeParameterDeclarationExpression> result = new List<CodeParameterDeclarationExpression>();\n\t\t\tforeach (ParameterDeclaration pd in parameters) {\n\t\t\t\tCodeParameterDeclarationExpression pde = pd.AcceptVisitor(this) as CodeParameterDeclarationExpression;\n\t\t\t\tif (pde != null)\n\t\t\t\t\tresult.Add(pde);\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tCodeMemberProperty p = new CodeMemberProperty();\n\t\t\tp.Attributes = ConvertMemberAttributes(propertyDeclaration.Modifiers, SymbolKind.Property);\n\t\t\tp.CustomAttributes.AddRange(Convert(propertyDeclaration.Attributes));\n\t\t\tp.Name = propertyDeclaration.Name;\n\t\t\tp.PrivateImplementationType = Convert(propertyDeclaration.PrivateImplementationType);\n\t\t\tp.Type = Convert(propertyDeclaration.ReturnType);\n\t\t\t\n\t\t\tif (!propertyDeclaration.Getter.IsNull) {\n\t\t\t\tp.HasGet = true;\n\t\t\t\tp.GetStatements.AddRange(ConvertBlock(propertyDeclaration.Getter.Body));\n\t\t\t}\n\t\t\tif (!propertyDeclaration.Setter.IsNull) {\n\t\t\t\tp.HasSet = true;\n\t\t\t\tp.SetStatements.AddRange(ConvertBlock(propertyDeclaration.Setter.Body));\n\t\t\t}\n\t\t\treturn p;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\tthrow new NotSupportedException(); // should be handled by the parent node\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\treturn new CodeSnippetTypeMember(MakeSnippet(fixedFieldDeclaration));\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)\n\t\t{\n\t\t\tthrow new NotSupportedException(); // should be handled by the parent node\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t{\n\t\t\tCodeCompileUnit cu = new CodeCompileUnit();\n\t\t\tvar globalImports = new List<CodeNamespaceImport> ();\n\t\t\tforeach (AstNode node in syntaxTree.Children) {\n\t\t\t\tCodeObject o = node.AcceptVisitor(this);\n\t\t\t\t\n\t\t\t\tCodeNamespace ns = o as CodeNamespace;\n\t\t\t\tif (ns != null) {\n\t\t\t\t\tcu.Namespaces.Add(ns);\n\t\t\t\t}\n\t\t\t\tCodeTypeDeclaration td = o as CodeTypeDeclaration;\n\t\t\t\tif (td != null) {\n\t\t\t\t\tcu.Namespaces.Add(new CodeNamespace() { Types = { td } });\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar import = o as CodeNamespaceImport;\n\t\t\t\tif (import != null)\n\t\t\t\t\tglobalImports.Add (import);\n\t\t\t}\n\t\t\tforeach (var gi in globalImports) {\n\t\t\t\tfor (int j = 0; j < cu.Namespaces.Count; j++) {\n\t\t\t\t\tvar cn = cu.Namespaces [j];\n\t\t\t\t\tbool found = cn.Imports\n\t\t\t\t\t\t.Cast<CodeNamespaceImport> ()\n\t\t\t\t\t\t.Any (ns => ns.Namespace == gi.Namespace);\n\t\t\t\t\tif (!found)\n\t\t\t\t\t\tcn.Imports.Add (gi);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn cu;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitSimpleType(SimpleType simpleType)\n\t\t{\n\t\t\tif (UseFullyQualifiedTypeNames) {\n\t\t\t\tIType type = Resolve(simpleType).Type;\n\t\t\t\tif (type.Kind != TypeKind.Unknown)\n\t\t\t\t\treturn Convert(type);\n\t\t\t}\n\t\t\tvar tr = new CodeTypeReference(simpleType.Identifier);\n\t\t\ttr.TypeArguments.AddRange(Convert(simpleType.TypeArguments));\n\t\t\treturn tr;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitMemberType(MemberType memberType)\n\t\t{\n\t\t\tif (memberType.IsDoubleColon && new SimpleType(\"global\").IsMatch(memberType.Target)) {\n\t\t\t\tvar tr = new CodeTypeReference(memberType.MemberName, CodeTypeReferenceOptions.GlobalReference);\n\t\t\t\ttr.TypeArguments.AddRange(Convert(memberType.TypeArguments));\n\t\t\t\treturn tr;\n\t\t\t}\n\t\t\tif (UseFullyQualifiedTypeNames || memberType.IsDoubleColon) {\n\t\t\t\tIType type = Resolve(memberType).Type;\n\t\t\t\tif (type.Kind != TypeKind.Unknown)\n\t\t\t\t\treturn Convert(type);\n\t\t\t}\n\t\t\tCodeTypeReference target = Convert(memberType.Target);\n\t\t\tif (target == null)\n\t\t\t\treturn null;\n\t\t\ttarget.BaseType = target.BaseType + \".\" + memberType.MemberName;\n\t\t\ttarget.TypeArguments.AddRange(Convert(memberType.TypeArguments));\n\t\t\treturn target;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitComposedType(ComposedType composedType)\n\t\t{\n\t\t\tCodeTypeReference typeRef = Convert(composedType.BaseType);\n\t\t\tif (typeRef == null)\n\t\t\t\treturn null;\n\t\t\tif (composedType.HasNullableSpecifier) {\n\t\t\t\ttypeRef = new CodeTypeReference(\"System.Nullable\") { TypeArguments = { typeRef } };\n\t\t\t}\n\t\t\tforeach (ArraySpecifier s in composedType.ArraySpecifiers.Reverse()) {\n\t\t\t\ttypeRef = new CodeTypeReference(typeRef, s.Dimensions);\n\t\t\t}\n\t\t\treturn typeRef;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitArraySpecifier(ArraySpecifier arraySpecifier)\n\t\t{\n\t\t\tthrow new NotSupportedException(); // handled by parent node\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitPrimitiveType(PrimitiveType primitiveType)\n\t\t{\n\t\t\tKnownTypeCode typeCode = primitiveType.KnownTypeCode;\n\t\t\tif (typeCode != KnownTypeCode.None) {\n\t\t\t\tKnownTypeReference ktr = KnownTypeReference.Get(typeCode);\n\t\t\t\treturn new CodeTypeReference(ktr.Namespace + \".\" + ktr.Name);\n\t\t\t}\n\t\t\treturn new CodeTypeReference(primitiveType.Keyword);\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitComment (Comment comment)\n\t\t{\n\t\t\treturn new CodeComment (comment.Content, comment.CommentType == CommentType.Documentation);\n\t\t}\n\n\t\tCodeObject IAstVisitor<CodeObject>.VisitNewLine(NewLineNode newLineNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tCodeObject IAstVisitor<CodeObject>.VisitWhitespace(WhitespaceNode whitespaceNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tCodeObject IAstVisitor<CodeObject>.VisitText(TextNode textNode)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tCodeObject IAstVisitor<CodeObject>.VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t\treturn new CodeComment (\"#\" + preProcessorDirective.Type.ToString ().ToLowerInvariant ());\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration)\n\t\t{\n\t\t\tthrow new NotSupportedException(); // type parameters and constraints are handled together\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitConstraint(Constraint constraint)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tCodeTypeParameter[] ConvertTypeParameters(IEnumerable<TypeParameterDeclaration> typeParameters, IEnumerable<Constraint> constraints)\n\t\t{\n\t\t\tList<CodeTypeParameter> result = new List<CodeTypeParameter>();\n\t\t\tforeach (TypeParameterDeclaration tpDecl in typeParameters) {\n\t\t\t\tCodeTypeParameter tp = new CodeTypeParameter(tpDecl.Name);\n\t\t\t\ttp.CustomAttributes.AddRange(Convert(tpDecl.Attributes));\n\t\t\t\tforeach (Constraint constraint in constraints) {\n\t\t\t\t\tif (constraint.TypeParameter.Identifier == tp.Name) {\n\t\t\t\t\t\tforeach (AstType baseType in constraint.BaseTypes) {\n\t\t\t\t\t\t\tif (baseType is PrimitiveType && ((PrimitiveType)baseType).Keyword == \"new\") {\n\t\t\t\t\t\t\t\ttp.HasConstructorConstraint = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tCodeTypeReference tr = Convert(baseType);\n\t\t\t\t\t\t\t\tif (tr != null)\n\t\t\t\t\t\t\t\t\ttp.Constraints.Add(tr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult.Add(tp);\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitIdentifier(Identifier identifier)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitPatternPlaceholder(AstNode placeholder, Pattern pattern)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tCodeObject IAstVisitor<CodeObject>.VisitDocumentationReference(DocumentationReference documentationReference)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/ITokenWriter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic abstract class TokenWriter\n\t{\n\t\tpublic abstract void StartNode(AstNode node);\n\t\tpublic abstract void EndNode(AstNode node);\n\t\t\n\t\t/// <summary>\n\t\t/// Writes an identifier.\n\t\t/// </summary>\n\t\tpublic abstract void WriteIdentifier(Identifier identifier);\n\t\t\n\t\t/// <summary>\n\t\t/// Writes a keyword to the output.\n\t\t/// </summary>\n\t\tpublic abstract void WriteKeyword(Role role, string keyword);\n\t\t\n\t\t/// <summary>\n\t\t/// Writes a token to the output.\n\t\t/// </summary>\n\t\tpublic abstract void WriteToken(Role role, string token);\n\t\t\n\t\t/// <summary>\n\t\t/// Writes a primitive/literal value\n\t\t/// </summary>\n\t\tpublic abstract void WritePrimitiveValue(object value, string literalValue = null);\n\t\t\n\t\tpublic abstract void WritePrimitiveType(string type);\n\t\t\n\t\tpublic abstract void Space();\n\t\tpublic abstract void Indent();\n\t\tpublic abstract void Unindent();\n\t\tpublic abstract void NewLine();\n\t\t\n\t\tpublic abstract void WriteComment(CommentType commentType, string content);\n\t\tpublic abstract void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument);\n\t\t\n\t\tpublic static TokenWriter Create(TextWriter writer, string indentation = \"\\t\")\n\t\t{\n\t\t\treturn new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(new TextWriterTokenWriter(writer) { IndentationString = indentation }));\n\t\t}\n\t\t\n\t\tpublic static TokenWriter CreateWriterThatSetsLocationsInAST(TextWriter writer, string indentation = \"\\t\")\n\t\t{\n\t\t\tvar target = new TextWriterTokenWriter(writer) { IndentationString = indentation };\n\t\t\treturn new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(new InsertMissingTokensDecorator(target, target)));\n\t\t}\n\t\t\n\t\tpublic static TokenWriter WrapInWriterThatSetsLocationsInAST(TokenWriter writer)\n\t\t{\n\t\t\tif (!(writer is ILocatable))\n\t\t\t\tthrow new InvalidOperationException(\"writer does not provide locations!\");\n\t\t\treturn new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(new InsertMissingTokensDecorator(writer, (ILocatable)writer)));\n\t\t}\n\t}\n\t\n\tpublic interface ILocatable\n\t{\n\t\tTextLocation Location { get; }\n\t}\n\t\n\tpublic abstract class DecoratingTokenWriter : TokenWriter\n\t{\n\t\tTokenWriter decoratedWriter;\n\t\t\n\t\tprotected DecoratingTokenWriter(TokenWriter decoratedWriter)\n\t\t{\n\t\t\tif (decoratedWriter == null)\n\t\t\t\tthrow new ArgumentNullException(\"decoratedWriter\");\n\t\t\tthis.decoratedWriter = decoratedWriter;\n\t\t}\n\t\t\n\t\tpublic override void StartNode(AstNode node)\n\t\t{\n\t\t\tdecoratedWriter.StartNode(node);\n\t\t}\n\t\t\n\t\tpublic override void EndNode(AstNode node)\n\t\t{\n\t\t\tdecoratedWriter.EndNode(node);\n\t\t}\n\t\t\n\t\tpublic override void WriteIdentifier(Identifier identifier)\n\t\t{\n\t\t\tdecoratedWriter.WriteIdentifier(identifier);\n\t\t}\n\t\t\n\t\tpublic override void WriteKeyword(Role role, string keyword)\n\t\t{\n\t\t\tdecoratedWriter.WriteKeyword(role, keyword);\n\t\t}\n\t\t\n\t\tpublic override void WriteToken(Role role, string token)\n\t\t{\n\t\t\tdecoratedWriter.WriteToken(role, token);\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveValue(object value, string literalValue = null)\n\t\t{\n\t\t\tdecoratedWriter.WritePrimitiveValue(value, literalValue);\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveType(string type)\n\t\t{\n\t\t\tdecoratedWriter.WritePrimitiveType(type);\n\t\t}\n\t\t\n\t\tpublic override void Space()\n\t\t{\n\t\t\tdecoratedWriter.Space();\n\t\t}\n\t\t\n\t\tpublic override void Indent()\n\t\t{\n\t\t\tdecoratedWriter.Indent();\n\t\t}\n\t\t\n\t\tpublic override void Unindent()\n\t\t{\n\t\t\tdecoratedWriter.Unindent();\n\t\t}\n\t\t\n\t\tpublic override void NewLine()\n\t\t{\n\t\t\tdecoratedWriter.NewLine();\n\t\t}\n\t\t\n\t\tpublic override void WriteComment(CommentType commentType, string content)\n\t\t{\n\t\t\tdecoratedWriter.WriteComment(commentType, content);\n\t\t}\n\t\t\n\t\tpublic override void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument)\n\t\t{\n\t\t\tdecoratedWriter.WritePreProcessorDirective(type, argument);\n\t\t}\n\t}\n}\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tclass InsertMissingTokensDecorator : DecoratingTokenWriter\n\t{\n\t\treadonly Stack<List<AstNode>> nodes = new Stack<List<AstNode>>();\n\t\tList<AstNode> currentList;\n\t\treadonly ILocatable locationProvider;\n\t\t\n\t\tpublic InsertMissingTokensDecorator(TokenWriter writer, ILocatable locationProvider)\n\t\t\t: base(writer)\n\t\t{\n\t\t\tthis.locationProvider = locationProvider;\n\t\t\tcurrentList = new List<AstNode>();\n\t\t}\n\t\t\n\t\tpublic override void StartNode(AstNode node)\n\t\t{\n\t\t\tcurrentList.Add(node);\n\t\t\tnodes.Push(currentList);\n\t\t\tcurrentList = new List<AstNode>();\n\t\t\tbase.StartNode(node);\n\t\t}\n\t\t\n\t\tpublic override void EndNode(AstNode node)\n\t\t{\n\t\t\tSystem.Diagnostics.Debug.Assert(currentList != null);\n\t\t\tforeach (var removable in node.Children.Where(n => n is CSharpTokenNode)) {\n\t\t\t\tremovable.Remove();\n\t\t\t}\n\t\t\tforeach (var child in currentList) {\n\t\t\t\tSystem.Diagnostics.Debug.Assert(child.Parent == null || node == child.Parent);\n\t\t\t\tchild.Remove();\n\t\t\t\tnode.AddChildWithExistingRole(child);\n\t\t\t}\n\t\t\tcurrentList = nodes.Pop();\n\t\t\tbase.EndNode(node);\n\t\t}\n\t\t\n\t\tpublic override void WriteToken(Role role, string token)\n\t\t{\n\t\t\tCSharpTokenNode t = new CSharpTokenNode(locationProvider.Location, (TokenRole)role);\n\t\t\tt.Role = role;\n\t\t\tEmptyStatement node = nodes.Peek().LastOrDefault() as EmptyStatement;\n\t\t\tif (node == null)\n\t\t\t\tcurrentList.Add(t);\n\t\t\telse {\n\t\t\t\tnode.Location = locationProvider.Location;\n\t\t\t}\n\t\t\tbase.WriteToken(role, token);\n\t\t}\n\t\t\n\t\tpublic override void WriteKeyword(Role role, string keyword)\n\t\t{\n\t\t\tTextLocation start = locationProvider.Location;\n\t\t\tCSharpTokenNode t = null;\n\t\t\tif (role is TokenRole)\n\t\t\t\tt = new CSharpTokenNode(start, (TokenRole)role);\n\t\t\telse if (role == EntityDeclaration.ModifierRole)\n\t\t\t\tt = new CSharpModifierToken(start, CSharpModifierToken.GetModifierValue(keyword));\n\t\t\telse if (keyword == \"this\") {\n\t\t\t\tThisReferenceExpression node = nodes.Peek().LastOrDefault() as ThisReferenceExpression;\n\t\t\t\tif (node != null)\n\t\t\t\t\tnode.Location = start;\n\t\t\t} else if (keyword == \"base\") {\n\t\t\t\tBaseReferenceExpression node = nodes.Peek().LastOrDefault() as BaseReferenceExpression;\n\t\t\t\tif (node != null)\n\t\t\t\t\tnode.Location = start;\n\t\t\t}\n\t\t\tif (t != null) currentList.Add(t);\n\t\t\tbase.WriteKeyword(role, keyword);\n\t\t}\n\t\t\n\t\tpublic override void WriteIdentifier(Identifier identifier)\n\t\t{\n\t\t\tif (!identifier.IsNull)\n\t\t\t\tidentifier.SetStartLocation(locationProvider.Location);\n\t\t\tcurrentList.Add(identifier);\n\t\t\tbase.WriteIdentifier(identifier);\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveValue(object value, string literalValue = null)\n\t\t{\n\t\t\tExpression node = nodes.Peek().LastOrDefault() as Expression;\n\t\t\tif (node is PrimitiveExpression) {\n\t\t\t\t((PrimitiveExpression)node).SetStartLocation(locationProvider.Location);\n\t\t\t}\n\t\t\tif (node is NullReferenceExpression) {\n\t\t\t\t((NullReferenceExpression)node).SetStartLocation(locationProvider.Location);\n\t\t\t}\n\t\t\tbase.WritePrimitiveValue(value, literalValue);\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveType(string type)\n\t\t{\n\t\t\tPrimitiveType node = nodes.Peek().LastOrDefault() as PrimitiveType;\n\t\t\tif (node != null)\n\t\t\t\tnode.SetStartLocation(locationProvider.Location);\n\t\t\tbase.WritePrimitiveType(type);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertParenthesesVisitor.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Inserts the parentheses into the AST that are needed to ensure the AST can be printed correctly.\n\t/// For example, if the AST contains\n\t/// BinaryOperatorExpresson(2, Mul, BinaryOperatorExpression(1, Add, 1))); printing that AST\n\t/// would incorrectly result in \"2 * 1 + 1\". By running InsertParenthesesVisitor, the necessary\n\t/// parentheses are inserted: \"2 * (1 + 1)\".\n\t/// </summary>\n\tpublic class InsertParenthesesVisitor : DepthFirstAstVisitor\n\t{\n\t\t/// <summary>\n\t\t/// Gets/Sets whether the visitor should insert parentheses to make the code better looking.\n\t\t/// If this property is false, it will insert parentheses only where strictly required by the language spec.\n\t\t/// </summary>\n\t\tpublic bool InsertParenthesesForReadability { get; set; }\n\t\t\n\t\tconst int Primary = 16;\n\t\tconst int QueryOrLambda = 15;\n\t\tconst int Unary = 14;\n\t\tconst int RelationalAndTypeTesting = 10;\n\t\tconst int Equality = 9;\n\t\tconst int Conditional = 2;\n\t\tconst int Assignment = 1;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the row number in the C# 4.0 spec operator precedence table.\n\t\t/// </summary>\n\t\tstatic int GetPrecedence(Expression expr)\n\t\t{\n\t\t\t// Note: the operator precedence table on MSDN is incorrect\n\t\t\tif (expr is QueryExpression) {\n\t\t\t\t// Not part of the table in the C# spec, but we need to ensure that queries within\n\t\t\t\t// primary expressions get parenthesized.\n\t\t\t\treturn QueryOrLambda;\n\t\t\t}\n\t\t\tUnaryOperatorExpression uoe = expr as UnaryOperatorExpression;\n\t\t\tif (uoe != null) {\n\t\t\t\tif (uoe.Operator == UnaryOperatorType.PostDecrement || uoe.Operator == UnaryOperatorType.PostIncrement)\n\t\t\t\t\treturn Primary;\n\t\t\t\telse\n\t\t\t\t\treturn Unary;\n\t\t\t}\n\t\t\tif (expr is CastExpression)\n\t\t\t\treturn Unary;\n\t\t\tBinaryOperatorExpression boe = expr as BinaryOperatorExpression;\n\t\t\tif (boe != null) {\n\t\t\t\tswitch (boe.Operator) {\n\t\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\t\treturn 13; // multiplicative\n\t\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\t\treturn 12; // additive\n\t\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\t\treturn 11;\n\t\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\t\treturn RelationalAndTypeTesting;\n\t\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\t\treturn Equality;\n\t\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\t\treturn 8;\n\t\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\t\treturn 7;\n\t\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\t\treturn 6;\n\t\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\t\treturn 5;\n\t\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\t\treturn 4;\n\t\t\t\t\tcase BinaryOperatorType.NullCoalescing:\n\t\t\t\t\t\treturn 3;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for BinaryOperatorType\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (expr is IsExpression || expr is AsExpression)\n\t\t\t\treturn RelationalAndTypeTesting;\n\t\t\tif (expr is ConditionalExpression)\n\t\t\t\treturn Conditional;\n\t\t\tif (expr is AssignmentExpression || expr is LambdaExpression)\n\t\t\t\treturn Assignment;\n\t\t\t// anything else: primary expression\n\t\t\treturn Primary;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Parenthesizes the expression if it does not have the minimum required precedence.\n\t\t/// </summary>\n\t\tstatic void ParenthesizeIfRequired(Expression expr, int minimumPrecedence)\n\t\t{\n\t\t\tif (GetPrecedence(expr) < minimumPrecedence) {\n\t\t\t\tParenthesize(expr);\n\t\t\t}\n\t\t}\n\n\t\tstatic void Parenthesize(Expression expr)\n\t\t{\n\t\t\texpr.ReplaceWith(e => new ParenthesizedExpression { Expression = e });\n\t\t}\n\t\t\n\t\t// Primary expressions\n\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tParenthesizeIfRequired(memberReferenceExpression.Target, Primary);\n\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic override void VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\tParenthesizeIfRequired(pointerReferenceExpression.Target, Primary);\n\t\t\tbase.VisitPointerReferenceExpression(pointerReferenceExpression);\n\t\t}\n\t\t\n\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\tParenthesizeIfRequired(invocationExpression.Target, Primary);\n\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t}\n\t\t\n\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t{\n\t\t\tParenthesizeIfRequired(indexerExpression.Target, Primary);\n\t\t\tArrayCreateExpression ace = indexerExpression.Target as ArrayCreateExpression;\n\t\t\tif (ace != null && (InsertParenthesesForReadability || ace.Initializer.IsNull)) {\n\t\t\t\t// require parentheses for \"(new int[1])[0]\"\n\t\t\t\tParenthesize(indexerExpression.Target);\n\t\t\t}\n\t\t\tbase.VisitIndexerExpression(indexerExpression);\n\t\t}\n\t\t\n\t\t// Unary expressions\n\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tParenthesizeIfRequired(unaryOperatorExpression.Expression, GetPrecedence(unaryOperatorExpression));\n\t\t\tUnaryOperatorExpression child = unaryOperatorExpression.Expression as UnaryOperatorExpression;\n\t\t\tif (child != null && InsertParenthesesForReadability)\n\t\t\t\tParenthesize(child);\n\t\t\tbase.VisitUnaryOperatorExpression(unaryOperatorExpression);\n\t\t}\n\t\t\n\t\tpublic override void VisitCastExpression(CastExpression castExpression)\n\t\t{\n\t\t\tParenthesizeIfRequired(castExpression.Expression, InsertParenthesesForReadability ? Primary : Unary);\n\t\t\t// There's a nasty issue in the C# grammar: cast expressions including certain operators are ambiguous in some cases\n\t\t\t// \"(int)-1\" is fine, but \"(A)-b\" is not a cast.\n\t\t\tUnaryOperatorExpression uoe = castExpression.Expression as UnaryOperatorExpression;\n\t\t\tif (uoe != null && !(uoe.Operator == UnaryOperatorType.BitNot || uoe.Operator == UnaryOperatorType.Not)) {\n\t\t\t\tif (TypeCanBeMisinterpretedAsExpression(castExpression.Type)) {\n\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// The above issue can also happen with PrimitiveExpressions representing negative values:\n\t\t\tPrimitiveExpression pe = castExpression.Expression as PrimitiveExpression;\n\t\t\tif (pe != null && pe.Value != null && TypeCanBeMisinterpretedAsExpression(castExpression.Type)) {\n\t\t\t\tTypeCode typeCode = Type.GetTypeCode(pe.Value.GetType());\n\t\t\t\tswitch (typeCode) {\n\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\tif ((sbyte)pe.Value < 0)\n\t\t\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\t\tif ((short)pe.Value < 0)\n\t\t\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\t\tif ((int)pe.Value < 0)\n\t\t\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\t\tif ((long)pe.Value < 0)\n\t\t\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\t\tif ((float)pe.Value < 0)\n\t\t\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\t\tif ((double)pe.Value < 0)\n\t\t\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Decimal:\n\t\t\t\t\t\tif ((decimal)pe.Value < 0)\n\t\t\t\t\t\t\tParenthesize(castExpression.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.VisitCastExpression(castExpression);\n\t\t}\n\t\t\n\t\tstatic bool TypeCanBeMisinterpretedAsExpression(AstType type)\n\t\t{\n\t\t\t// SimpleTypes can always be misinterpreted as IdentifierExpressions\n\t\t\t// MemberTypes can be misinterpreted as MemberReferenceExpressions if they don't use double colon\n\t\t\t// PrimitiveTypes or ComposedTypes can never be misinterpreted as expressions.\n\t\t\tMemberType mt = type as MemberType;\n\t\t\tif (mt != null)\n\t\t\t\treturn !mt.IsDoubleColon;\n\t\t\telse\n\t\t\t\treturn type is SimpleType;\n\t\t}\n\t\t\n\t\t// Binary Operators\n\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\tint precedence = GetPrecedence(binaryOperatorExpression);\n\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.NullCoalescing) {\n\t\t\t\tif (InsertParenthesesForReadability) {\n\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Left, Primary);\n\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Right, Primary);\n\t\t\t\t} else {\n\t\t\t\t\t// ?? is right-associative\n\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Left, precedence + 1);\n\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Right, precedence);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (InsertParenthesesForReadability && precedence < Equality) {\n\t\t\t\t\t// In readable mode, boost the priority of the left-hand side if the operator\n\t\t\t\t\t// there isn't the same as the operator on this expression.\n\t\t\t\t\tif (GetBinaryOperatorType(binaryOperatorExpression.Left) == binaryOperatorExpression.Operator) {\n\t\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Left, precedence);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Left, Equality);\n\t\t\t\t\t}\n\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Right, Equality);\n\t\t\t\t} else {\n\t\t\t\t\t// all other binary operators are left-associative\n\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Left, precedence);\n\t\t\t\t\tParenthesizeIfRequired(binaryOperatorExpression.Right, precedence + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t}\n\t\t\n\t\tBinaryOperatorType? GetBinaryOperatorType(Expression expr)\n\t\t{\n\t\t\tBinaryOperatorExpression boe = expr as BinaryOperatorExpression;\n\t\t\tif (boe != null)\n\t\t\t\treturn boe.Operator;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override void VisitIsExpression(IsExpression isExpression)\n\t\t{\n\t\t\tif (InsertParenthesesForReadability) {\n\t\t\t\t// few people know the precedence of 'is', so always put parentheses in nice-looking mode.\n\t\t\t\tParenthesizeIfRequired(isExpression.Expression, Primary);\n\t\t\t} else {\n\t\t\t\tParenthesizeIfRequired(isExpression.Expression, RelationalAndTypeTesting);\n\t\t\t}\n\t\t\tbase.VisitIsExpression(isExpression);\n\t\t}\n\t\t\n\t\tpublic override void VisitAsExpression(AsExpression asExpression)\n\t\t{\n\t\t\tif (InsertParenthesesForReadability) {\n\t\t\t\t// few people know the precedence of 'as', so always put parentheses in nice-looking mode.\n\t\t\t\tParenthesizeIfRequired(asExpression.Expression, Primary);\n\t\t\t} else {\n\t\t\t\tParenthesizeIfRequired(asExpression.Expression, RelationalAndTypeTesting);\n\t\t\t}\n\t\t\tbase.VisitAsExpression(asExpression);\n\t\t}\n\t\t\n\t\t// Conditional operator\n\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\t// Associativity here is a bit tricky:\n\t\t\t// (a ? b : c ? d : e) == (a ? b : (c ? d : e))\n\t\t\t// (a ? b ? c : d : e) == (a ? (b ? c : d) : e)\n\t\t\t// Only ((a ? b : c) ? d : e) strictly needs the additional parentheses\n\t\t\tif (InsertParenthesesForReadability) {\n\t\t\t\t// Precedence of ?: can be confusing; so always put parentheses in nice-looking mode.\n\t\t\t\tParenthesizeIfRequired(conditionalExpression.Condition, Primary);\n\t\t\t\tParenthesizeIfRequired(conditionalExpression.TrueExpression, Primary);\n\t\t\t\tParenthesizeIfRequired(conditionalExpression.FalseExpression, Primary);\n\t\t\t} else {\n\t\t\t\tParenthesizeIfRequired(conditionalExpression.Condition, Conditional + 1);\n\t\t\t\tParenthesizeIfRequired(conditionalExpression.TrueExpression, Conditional);\n\t\t\t\tParenthesizeIfRequired(conditionalExpression.FalseExpression, Conditional);\n\t\t\t}\n\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\t\t}\n\t\t\n\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\t// assignment is right-associative\n\t\t\tParenthesizeIfRequired(assignmentExpression.Left, Assignment + 1);\n\t\t\tif (InsertParenthesesForReadability) {\n\t\t\t\tParenthesizeIfRequired(assignmentExpression.Right, RelationalAndTypeTesting + 1);\n\t\t\t} else {\n\t\t\t\tParenthesizeIfRequired(assignmentExpression.Right, Assignment);\n\t\t\t}\n\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t}\n\t\t\n\t\t// don't need to handle lambdas, they have lowest precedence and unambiguous associativity\n\t\t\n\t\tpublic override void VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\t// Query expressions are strange beasts:\n\t\t\t// \"var a = -from b in c select d;\" is valid, so queries bind stricter than unary expressions.\n\t\t\t// However, the end of the query is greedy. So their start sort of has a high precedence,\n\t\t\t// while their end has a very low precedence. We handle this by checking whether a query is used\n\t\t\t// as left part of a binary operator, and parenthesize it if required.\n\t\t\tif (queryExpression.Role == BinaryOperatorExpression.LeftRole)\n\t\t\t\tParenthesize(queryExpression);\n\t\t\tif (queryExpression.Parent is IsExpression || queryExpression.Parent is AsExpression)\n\t\t\t\tParenthesize(queryExpression);\n\t\t\tif (InsertParenthesesForReadability) {\n\t\t\t\t// when readability is desired, always parenthesize query expressions within unary or binary operators\n\t\t\t\tif (queryExpression.Parent is UnaryOperatorExpression || queryExpression.Parent is BinaryOperatorExpression)\n\t\t\t\t\tParenthesize(queryExpression);\n\t\t\t}\n\t\t\tbase.VisitQueryExpression(queryExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertRequiredSpacesDecorator.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tclass InsertRequiredSpacesDecorator : DecoratingTokenWriter\n\t{\n\t\t/// <summary>\n\t\t/// Used to insert the minimal amount of spaces so that the lexer recognizes the tokens that were written.\n\t\t/// </summary>\n\t\tLastWritten lastWritten;\n\t\t\n\t\tenum LastWritten\n\t\t{\n\t\t\tWhitespace,\n\t\t\tOther,\n\t\t\tKeywordOrIdentifier,\n\t\t\tPlus,\n\t\t\tMinus,\n\t\t\tAmpersand,\n\t\t\tQuestionMark,\n\t\t\tDivision\n\t\t}\n\t\t\n\t\tpublic InsertRequiredSpacesDecorator(TokenWriter writer)\n\t\t\t: base(writer)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void WriteIdentifier(Identifier identifier)\n\t\t{\n\t\t\tif (identifier.IsVerbatim || CSharpOutputVisitor.IsKeyword(identifier.Name, identifier)) {\n\t\t\t\tif (lastWritten == LastWritten.KeywordOrIdentifier) {\n\t\t\t\t\t// this space is not strictly required, so we call Space()\n\t\t\t\t\tSpace();\n\t\t\t\t}\n\t\t\t} else if (lastWritten == LastWritten.KeywordOrIdentifier) {\n\t\t\t\t// this space is strictly required, so we directly call the formatter\n\t\t\t\tbase.Space();\n\t\t\t}\n\t\t\tbase.WriteIdentifier(identifier);\n\t\t\tlastWritten = LastWritten.KeywordOrIdentifier;\n\t\t}\n\t\t\n\t\tpublic override void WriteKeyword(Role role, string keyword)\n\t\t{\n\t\t\tif (lastWritten == LastWritten.KeywordOrIdentifier) {\n\t\t\t\tSpace();\n\t\t\t}\n\t\t\tbase.WriteKeyword(role, keyword);\n\t\t\tlastWritten = LastWritten.KeywordOrIdentifier;\n\t\t}\n\t\t\n\t\tpublic override void WriteToken(Role role, string token)\n\t\t{\n\t\t\t// Avoid that two +, - or ? tokens are combined into a ++, -- or ?? token.\n\t\t\t// Note that we don't need to handle tokens like = because there's no valid\n\t\t\t// C# program that contains the single token twice in a row.\n\t\t\t// (for +, - and &, this can happen with unary operators;\n\t\t\t// for ?, this can happen in \"a is int? ? b : c\" or \"a as int? ?? 0\";\n\t\t\t// and for /, this can happen with \"1/ *ptr\" or \"1/ //comment\".)\n\t\t\tif (lastWritten == LastWritten.Plus && token[0] == '+' ||\n\t\t\t    lastWritten == LastWritten.Minus && token[0] == '-' ||\n\t\t\t    lastWritten == LastWritten.Ampersand && token[0] == '&' ||\n\t\t\t    lastWritten == LastWritten.QuestionMark && token[0] == '?' ||\n\t\t\t    lastWritten == LastWritten.Division && token[0] == '*') {\n\t\t\t\tbase.Space();\n\t\t\t}\n\t\t\tbase.WriteToken(role, token);\n\t\t\tif (token == \"+\") {\n\t\t\t\tlastWritten = LastWritten.Plus;\n\t\t\t} else if (token == \"-\") {\n\t\t\t\tlastWritten = LastWritten.Minus;\n\t\t\t} else if (token == \"&\") {\n\t\t\t\tlastWritten = LastWritten.Ampersand;\n\t\t\t} else if (token == \"?\") {\n\t\t\t\tlastWritten = LastWritten.QuestionMark;\n\t\t\t} else if (token == \"/\") {\n\t\t\t\tlastWritten = LastWritten.Division;\n\t\t\t} else {\n\t\t\t\tlastWritten = LastWritten.Other;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void Space()\n\t\t{\n\t\t\tbase.Space();\n\t\t\tlastWritten = LastWritten.Whitespace;\n\t\t}\n\t\t\n\t\tpublic override void NewLine()\n\t\t{\n\t\t\tbase.NewLine();\n\t\t\tlastWritten = LastWritten.Whitespace;\n\t\t}\n\t\t\n\t\tpublic override void WriteComment(CommentType commentType, string content)\n\t\t{\n\t\t\tif (lastWritten == LastWritten.Division) {\n\t\t\t\t// When there's a comment starting after a division operator\n\t\t\t\t// \"1.0 / /*comment*/a\", then we need to insert a space in front of the comment.\n\t\t\t\tbase.Space();\n\t\t\t}\n\t\t\tbase.WriteComment(commentType, content);\n\t\t\tlastWritten = LastWritten.Whitespace;\n\t\t}\n\t\t\n\t\tpublic override void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument)\n\t\t{\n\t\t\tbase.WritePreProcessorDirective(type, argument);\n\t\t\tlastWritten = LastWritten.Whitespace;\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveValue(object value, string literalValue = null)\n\t\t{\n\t\t\tbase.WritePrimitiveValue(value, literalValue);\n\t\t\tif (value == null || value is bool)\n\t\t\t\treturn;\n\t\t\tif (value is string) {\n\t\t\t\tlastWritten = LastWritten.Other;\n\t\t\t} else if (value is char) {\n\t\t\t\tlastWritten = LastWritten.Other;\n\t\t\t} else if (value is decimal) {\n\t\t\t\tlastWritten = LastWritten.Other;\n\t\t\t} else if (value is float) {\n\t\t\t\tfloat f = (float)value;\n\t\t\t\tif (float.IsInfinity(f) || float.IsNaN(f)) return;\n\t\t\t\tlastWritten = LastWritten.Other;\n\t\t\t} else if (value is double) {\n\t\t\t\tdouble f = (double)value;\n\t\t\t\tif (double.IsInfinity(f) || double.IsNaN(f)) return;\n\t\t\t\t// needs space if identifier follows number;\n\t\t\t\t// this avoids mistaking the following identifier as type suffix\n\t\t\t\tlastWritten = LastWritten.KeywordOrIdentifier;\n\t\t\t} else if (value is IFormattable) {\n\t\t\t\t// needs space if identifier follows number;\n\t\t\t\t// this avoids mistaking the following identifier as type suffix\n\t\t\t\tlastWritten = LastWritten.KeywordOrIdentifier;\n\t\t\t} else {\n\t\t\t\tlastWritten = LastWritten.Other;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveType(string type)\n\t\t{\n\t\t\tif (lastWritten == LastWritten.KeywordOrIdentifier) {\n\t\t\t\tSpace();\n\t\t\t}\n\t\t\tbase.WritePrimitiveType(type);\n\t\t\tif (type == \"new\") {\n\t\t\t\tlastWritten = LastWritten.Other;\n\t\t\t} else {\n\t\t\t\tlastWritten = LastWritten.KeywordOrIdentifier;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertSpecialsDecorator.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tclass InsertSpecialsDecorator : DecoratingTokenWriter\n\t{\n\t\treadonly Stack<AstNode> positionStack = new Stack<AstNode>();\n\t\tint visitorWroteNewLine = 0;\n\t\t\n\t\tpublic InsertSpecialsDecorator(TokenWriter writer) : base(writer)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override void StartNode(AstNode node)\n\t\t{\n\t\t\tif (positionStack.Count > 0) {\n\t\t\t\tWriteSpecialsUpToNode(node);\n\t\t\t}\n\t\t\tpositionStack.Push(node.FirstChild);\n\t\t\tbase.StartNode(node);\n\t\t}\n\t\t\n\t\tpublic override void EndNode(AstNode node)\n\t\t{\n\t\t\tbase.EndNode(node);\n\t\t\tAstNode pos = positionStack.Pop();\n\t\t\tDebug.Assert(pos == null || pos.Parent == node);\n\t\t\tWriteSpecials(pos, null);\n\t\t}\n\t\t\n\t\tpublic override void WriteKeyword(Role role, string keyword)\n\t\t{\n\t\t\tif (role != null) {\n\t\t\t\tWriteSpecialsUpToRole(role);\n\t\t\t}\n\t\t\tbase.WriteKeyword(role, keyword);\n\t\t}\n\t\t\n\t\tpublic override void WriteIdentifier(Identifier identifier)\n\t\t{\n\t\t\tWriteSpecialsUpToRole(identifier.Role ?? Roles.Identifier);\n\t\t\tbase.WriteIdentifier(identifier);\n\t\t}\n\t\t\n\t\tpublic override void WriteToken(Role role, string token)\n\t\t{\n\t\t\tWriteSpecialsUpToRole(role);\n\t\t\tbase.WriteToken(role, token);\n\t\t}\n\t\t\n\t\tpublic override void NewLine()\n\t\t{\n\t\t\tif (visitorWroteNewLine >= 0)\n\t\t\t\tbase.NewLine();\n\t\t\tvisitorWroteNewLine++;\n\t\t}\n\t\t\n\t\t#region WriteSpecials\n\t\t/// <summary>\n\t\t/// Writes all specials from start to end (exclusive). Does not touch the positionStack.\n\t\t/// </summary>\n\t\tvoid WriteSpecials(AstNode start, AstNode end)\n\t\t{\n\t\t\tfor (AstNode pos = start; pos != end; pos = pos.NextSibling) {\n\t\t\t\tif (pos.Role == Roles.Comment) {\n\t\t\t\t\tvar node = (Comment)pos;\n\t\t\t\t\tbase.WriteComment(node.CommentType, node.Content);\n\t\t\t\t}\n\t\t\t\t// see CSharpOutputVisitor.VisitNewLine()\n\t\t\t\t//\t\t\t\tif (pos.Role == Roles.NewLine) {\n\t\t\t\t//\t\t\t\t\tif (visitorWroteNewLine <= 0)\n\t\t\t\t//\t\t\t\t\t\tbase.NewLine();\n\t\t\t\t//\t\t\t\t\tvisitorWroteNewLine--;\n\t\t\t\t//\t\t\t\t}\n\t\t\t\tif (pos.Role == Roles.PreProcessorDirective) {\n\t\t\t\t\tvar node = (PreProcessorDirective)pos;\n\t\t\t\t\tbase.WritePreProcessorDirective(node.Type, node.Argument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Writes all specials between the current position (in the positionStack) and the next\n\t\t/// node with the specified role. Advances the current position.\n\t\t/// </summary>\n\t\tvoid WriteSpecialsUpToRole(Role role)\n\t\t{\n\t\t\tWriteSpecialsUpToRole(role, null);\n\t\t}\n\t\t\n\t\tvoid WriteSpecialsUpToRole(Role role, AstNode nextNode)\n\t\t{\n\t\t\tif (positionStack.Count == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Look for the role between the current position and the nextNode.\n\t\t\tfor (AstNode pos = positionStack.Peek(); pos != null && pos != nextNode; pos = pos.NextSibling) {\n\t\t\t\tif (pos.Role == role) {\n\t\t\t\t\tWriteSpecials(positionStack.Pop(), pos);\n\t\t\t\t\t// Push the next sibling because the node matching the role is not a special,\n\t\t\t\t\t// and should be considered to be already handled.\n\t\t\t\t\tpositionStack.Push(pos.NextSibling);\n\t\t\t\t\t// This is necessary for OptionalComma() to work correctly.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Writes all specials between the current position (in the positionStack) and the specified node.\n\t\t/// Advances the current position.\n\t\t/// </summary>\n\t\tvoid WriteSpecialsUpToNode(AstNode node)\n\t\t{\n\t\t\tif (positionStack.Count == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (AstNode pos = positionStack.Peek(); pos != null; pos = pos.NextSibling) {\n\t\t\t\tif (pos == node) {\n\t\t\t\t\tWriteSpecials(positionStack.Pop(), pos);\n\t\t\t\t\t// Push the next sibling because the node itself is not a special,\n\t\t\t\t\t// and should be considered to be already handled.\n\t\t\t\t\tpositionStack.Push(pos.NextSibling);\n\t\t\t\t\t// This is necessary for OptionalComma() to work correctly.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n\n\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Writes C# code into a TextWriter.\n\t/// </summary>\n\tpublic class TextWriterTokenWriter : TokenWriter, ILocatable\n\t{\n\t\treadonly TextWriter textWriter;\n\t\tint indentation;\n\t\tbool needsIndent = true;\n\t\tbool isAtStartOfLine = true;\n\t\tint line, column;\n\n\t\tpublic int Indentation {\n\t\t\tget { return this.indentation; }\n\t\t\tset { this.indentation = value; }\n\t\t}\n\t\t\n\t\tpublic TextLocation Location {\n\t\t\tget { return new TextLocation(line, column + (needsIndent ? indentation * IndentationString.Length : 0)); }\n\t\t}\n\t\t\n\t\tpublic string IndentationString { get; set; }\n\t\t\n\t\tpublic TextWriterTokenWriter(TextWriter textWriter)\n\t\t{\n\t\t\tif (textWriter == null)\n\t\t\t\tthrow new ArgumentNullException(\"textWriter\");\n\t\t\tthis.textWriter = textWriter;\n\t\t\tthis.IndentationString = \"\\t\";\n\t\t\tthis.line = 1;\n\t\t\tthis.column = 1;\n\t\t}\n\t\t\n\t\tpublic override void WriteIdentifier(Identifier identifier)\n\t\t{\n\t\t\tWriteIndentation();\n\t\t\tif (identifier.IsVerbatim || CSharpOutputVisitor.IsKeyword(identifier.Name, identifier)) {\n\t\t\t\ttextWriter.Write('@');\n\t\t\t\tcolumn++;\n\t\t\t}\n\t\t\ttextWriter.Write(identifier.Name);\n\t\t\tcolumn += identifier.Name.Length;\n\t\t\tisAtStartOfLine = false;\n\t\t}\n\t\t\n\t\tpublic override void WriteKeyword(Role role, string keyword)\n\t\t{\n\t\t\tWriteIndentation();\n\t\t\tcolumn += keyword.Length;\n\t\t\ttextWriter.Write(keyword);\n\t\t\tisAtStartOfLine = false;\n\t\t}\n\t\t\n\t\tpublic override void WriteToken(Role role, string token)\n\t\t{\n\t\t\tWriteIndentation();\n\t\t\tcolumn += token.Length;\n\t\t\ttextWriter.Write(token);\n\t\t\tisAtStartOfLine = false;\n\t\t}\n\t\t\n\t\tpublic override void Space()\n\t\t{\n\t\t\tWriteIndentation();\n\t\t\tcolumn++;\n\t\t\ttextWriter.Write(' ');\n\t\t}\n\t\t\n\t\tprotected void WriteIndentation()\n\t\t{\n\t\t\tif (needsIndent) {\n\t\t\t\tneedsIndent = false;\n\t\t\t\tfor (int i = 0; i < indentation; i++) {\n\t\t\t\t\ttextWriter.Write(this.IndentationString);\n\t\t\t\t}\n\t\t\t\tcolumn += indentation * IndentationString.Length;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void NewLine()\n\t\t{\n\t\t\ttextWriter.WriteLine();\n\t\t\tcolumn = 1;\n\t\t\tline++;\n\t\t\tneedsIndent = true;\n\t\t\tisAtStartOfLine = true;\n\t\t}\n\t\t\n\t\tpublic override void Indent()\n\t\t{\n\t\t\tindentation++;\n\t\t}\n\t\t\n\t\tpublic override void Unindent()\n\t\t{\n\t\t\tindentation--;\n\t\t}\n\t\t\n\t\tpublic override void WriteComment(CommentType commentType, string content)\n\t\t{\n\t\t\tWriteIndentation();\n\t\t\tswitch (commentType) {\n\t\t\t\tcase CommentType.SingleLine:\n\t\t\t\t\ttextWriter.Write(\"//\");\n\t\t\t\t\ttextWriter.WriteLine(content);\n\t\t\t\t\tcolumn += 2 + content.Length;\n\t\t\t\t\tneedsIndent = true;\n\t\t\t\t\tisAtStartOfLine = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CommentType.MultiLine:\n\t\t\t\t\ttextWriter.Write(\"/*\");\n\t\t\t\t\ttextWriter.Write(content);\n\t\t\t\t\ttextWriter.Write(\"*/\");\n\t\t\t\t\tcolumn += 2;\n\t\t\t\t\tUpdateEndLocation(content, ref line, ref column);\n\t\t\t\t\tcolumn += 2;\n\t\t\t\t\tisAtStartOfLine = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CommentType.Documentation:\n\t\t\t\t\ttextWriter.Write(\"///\");\n\t\t\t\t\ttextWriter.WriteLine(content);\n\t\t\t\t\tcolumn += 3 + content.Length;\n\t\t\t\t\tneedsIndent = true;\n\t\t\t\t\tisAtStartOfLine = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CommentType.MultiLineDocumentation:\n\t\t\t\t\ttextWriter.Write(\"/**\");\n\t\t\t\t\ttextWriter.Write(content);\n\t\t\t\t\ttextWriter.Write(\"*/\");\n\t\t\t\t\tcolumn += 3;\n\t\t\t\t\tUpdateEndLocation(content, ref line, ref column);\n\t\t\t\t\tcolumn += 2;\n\t\t\t\t\tisAtStartOfLine = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ttextWriter.Write(content);\n\t\t\t\t\tcolumn += content.Length;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void UpdateEndLocation(string content, ref int line, ref int column)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(content))\n\t\t\t\treturn;\n\t\t\tfor (int i = 0; i < content.Length; i++) {\n\t\t\t\tchar ch = content[i];\n\t\t\t\tswitch (ch) {\n\t\t\t\t\tcase '\\r':\n\t\t\t\t\t\tif (i + 1 < content.Length && content[i + 1] == '\\n')\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\tgoto case '\\n';\n\t\t\t\t\tcase '\\n':\n\t\t\t\t\t\tline++;\n\t\t\t\t\t\tcolumn = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcolumn++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void WritePreProcessorDirective(PreProcessorDirectiveType type, string argument)\n\t\t{\n\t\t\t// pre-processor directive must start on its own line\n\t\t\tif (!isAtStartOfLine)\n\t\t\t\tNewLine();\n\t\t\tWriteIndentation();\n\t\t\ttextWriter.Write('#');\n\t\t\tstring directive = type.ToString().ToLowerInvariant();\n\t\t\ttextWriter.Write(directive);\n\t\t\tcolumn += 1 + directive.Length;\n\t\t\tif (!string.IsNullOrEmpty(argument)) {\n\t\t\t\ttextWriter.Write(' ');\n\t\t\t\ttextWriter.Write(argument);\n\t\t\t\tcolumn += 1 + argument.Length;\n\t\t\t}\n\t\t\tNewLine();\n\t\t}\n\t\t\n\t\tpublic static string PrintPrimitiveValue(object value)\n\t\t{\n\t\t\tTextWriter writer = new StringWriter();\n\t\t\tTextWriterTokenWriter tokenWriter = new TextWriterTokenWriter(writer);\n\t\t\ttokenWriter.WritePrimitiveValue(value);\n\t\t\treturn writer.ToString();\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveValue(object value, string literalValue = null)\n\t\t{\n\t\t\tif (literalValue != null) {\n\t\t\t\ttextWriter.Write(literalValue);\n\t\t\t\tcolumn += literalValue.Length;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (value == null) {\n\t\t\t\t// usually NullReferenceExpression should be used for this, but we'll handle it anyways\n\t\t\t\ttextWriter.Write(\"null\");\n\t\t\t\tcolumn += 4;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (value is bool) {\n\t\t\t\tif ((bool)value) {\n\t\t\t\t\ttextWriter.Write(\"true\");\n\t\t\t\t\tcolumn += 4;\n\t\t\t\t} else {\n\t\t\t\t\ttextWriter.Write(\"false\");\n\t\t\t\t\tcolumn += 5;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (value is string) {\n\t\t\t\tstring tmp = \"\\\"\" + ConvertString(value.ToString()) + \"\\\"\";\n\t\t\t\tcolumn += tmp.Length;\n\t\t\t\ttextWriter.Write(tmp);\n\t\t\t} else if (value is char) {\n\t\t\t\tstring tmp = \"'\" + ConvertCharLiteral((char)value) + \"'\";\n\t\t\t\tcolumn += tmp.Length;\n\t\t\t\ttextWriter.Write(tmp);\n\t\t\t} else if (value is decimal) {\n\t\t\t\tstring str = ((decimal)value).ToString(NumberFormatInfo.InvariantInfo) + \"m\";\n\t\t\t\tcolumn += str.Length;\n\t\t\t\ttextWriter.Write(str);\n\t\t\t} else if (value is float) {\n\t\t\t\tfloat f = (float)value;\n\t\t\t\tif (float.IsInfinity(f) || float.IsNaN(f)) {\n\t\t\t\t\t// Strictly speaking, these aren't PrimitiveExpressions;\n\t\t\t\t\t// but we still support writing these to make life easier for code generators.\n\t\t\t\t\ttextWriter.Write(\"float\");\n\t\t\t\t\tcolumn += 5;\n\t\t\t\t\tWriteToken(Roles.Dot, \".\");\n\t\t\t\t\tif (float.IsPositiveInfinity(f)) {\n\t\t\t\t\t\ttextWriter.Write(\"PositiveInfinity\");\n\t\t\t\t\t\tcolumn += \"PositiveInfinity\".Length;\n\t\t\t\t\t} else if (float.IsNegativeInfinity(f)) {\n\t\t\t\t\t\ttextWriter.Write(\"NegativeInfinity\");\n\t\t\t\t\t\tcolumn += \"NegativeInfinity\".Length;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttextWriter.Write(\"NaN\");\n\t\t\t\t\t\tcolumn += 3;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (f == 0 && 1 / f == float.NegativeInfinity) {\n\t\t\t\t\t// negative zero is a special case\n\t\t\t\t\t// (again, not a primitive expression, but it's better to handle\n\t\t\t\t\t// the special case here than to do it in all code generators)\n\t\t\t\t\ttextWriter.Write(\"-\");\n\t\t\t\t\tcolumn++;\n\t\t\t\t}\n\t\t\t\tvar str = f.ToString(\"R\", NumberFormatInfo.InvariantInfo) + \"f\";\n\t\t\t\tcolumn += str.Length;\n\t\t\t\ttextWriter.Write(str);\n\t\t\t} else if (value is double) {\n\t\t\t\tdouble f = (double)value;\n\t\t\t\tif (double.IsInfinity(f) || double.IsNaN(f)) {\n\t\t\t\t\t// Strictly speaking, these aren't PrimitiveExpressions;\n\t\t\t\t\t// but we still support writing these to make life easier for code generators.\n\t\t\t\t\ttextWriter.Write(\"double\");\n\t\t\t\t\tcolumn += 6;\n\t\t\t\t\tWriteToken(Roles.Dot, \".\");\n\t\t\t\t\tif (double.IsPositiveInfinity(f)) {\n\t\t\t\t\t\ttextWriter.Write(\"PositiveInfinity\");\n\t\t\t\t\t\tcolumn += \"PositiveInfinity\".Length;\n\t\t\t\t\t} else if (double.IsNegativeInfinity(f)) {\n\t\t\t\t\t\ttextWriter.Write(\"NegativeInfinity\");\n\t\t\t\t\t\tcolumn += \"NegativeInfinity\".Length;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttextWriter.Write(\"NaN\");\n\t\t\t\t\t\tcolumn += 3;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (f == 0 && 1 / f == double.NegativeInfinity) {\n\t\t\t\t\t// negative zero is a special case\n\t\t\t\t\t// (again, not a primitive expression, but it's better to handle\n\t\t\t\t\t// the special case here than to do it in all code generators)\n\t\t\t\t\ttextWriter.Write(\"-\");\n\t\t\t\t}\n\t\t\t\tstring number = f.ToString(\"R\", NumberFormatInfo.InvariantInfo);\n\t\t\t\tif (number.IndexOf('.') < 0 && number.IndexOf('E') < 0) {\n\t\t\t\t\tnumber += \".0\";\n\t\t\t\t}\n\t\t\t\ttextWriter.Write(number);\n\t\t\t} else if (value is IFormattable) {\n\t\t\t\tStringBuilder b = new StringBuilder ();\n//\t\t\t\tif (primitiveExpression.LiteralFormat == LiteralFormat.HexadecimalNumber) {\n//\t\t\t\t\tb.Append(\"0x\");\n//\t\t\t\t\tb.Append(((IFormattable)val).ToString(\"x\", NumberFormatInfo.InvariantInfo));\n//\t\t\t\t} else {\n\t\t\t\t\tb.Append(((IFormattable)value).ToString(null, NumberFormatInfo.InvariantInfo));\n//\t\t\t\t}\n\t\t\t\tif (value is uint || value is ulong) {\n\t\t\t\t\tb.Append(\"u\");\n\t\t\t\t}\n\t\t\t\tif (value is long || value is ulong) {\n\t\t\t\t\tb.Append(\"L\");\n\t\t\t\t}\n\t\t\t\ttextWriter.Write(b.ToString());\n\t\t\t\tcolumn += b.Length;\n\t\t\t} else {\n\t\t\t\ttextWriter.Write(value.ToString());\n\t\t\t\tcolumn += value.ToString().Length;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the escape sequence for the specified character within a char literal.\n\t\t/// Does not include the single quotes surrounding the char literal.\n\t\t/// </summary>\n\t\tpublic static string ConvertCharLiteral(char ch)\n\t\t{\n\t\t\tif (ch == '\\'') {\n\t\t\t\treturn \"\\\\'\";\n\t\t\t}\n\t\t\treturn ConvertChar(ch);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the escape sequence for the specified character.\n\t\t/// </summary>\n\t\t/// <remarks>This method does not convert ' or \".</remarks>\n\t\tstatic string ConvertChar(char ch)\n\t\t{\n\t\t\tswitch (ch) {\n\t\t\t\tcase '\\\\':\n\t\t\t\t\treturn \"\\\\\\\\\";\n\t\t\t\tcase '\\0':\n\t\t\t\t\treturn \"\\\\0\";\n\t\t\t\tcase '\\a':\n\t\t\t\t\treturn \"\\\\a\";\n\t\t\t\tcase '\\b':\n\t\t\t\t\treturn \"\\\\b\";\n\t\t\t\tcase '\\f':\n\t\t\t\t\treturn \"\\\\f\";\n\t\t\t\tcase '\\n':\n\t\t\t\t\treturn \"\\\\n\";\n\t\t\t\tcase '\\r':\n\t\t\t\t\treturn \"\\\\r\";\n\t\t\t\tcase '\\t':\n\t\t\t\t\treturn \"\\\\t\";\n\t\t\t\tcase '\\v':\n\t\t\t\t\treturn \"\\\\v\";\n\t\t\t\tdefault:\n\t\t\t\t\tif (char.IsControl(ch) || char.IsSurrogate(ch) ||\n\t\t\t\t\t    // print all uncommon white spaces as numbers\n\t\t\t\t\t    (char.IsWhiteSpace(ch) && ch != ' ')) {\n\t\t\t\t\t\treturn \"\\\\u\" + ((int)ch).ToString(\"x4\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ch.ToString();\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts special characters to escape sequences within the given string.\n\t\t/// </summary>\n\t\tpublic static string ConvertString(string str)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tforeach (char ch in str) {\n\t\t\t\tif (ch == '\"') {\n\t\t\t\t\tsb.Append(\"\\\\\\\"\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.Append(ConvertChar(ch));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\t\t\n\t\tpublic override void WritePrimitiveType(string type)\n\t\t{\n\t\t\ttextWriter.Write(type);\n\t\t\tcolumn += type.Length;\n\t\t\tif (type == \"new\") {\n\t\t\t\ttextWriter.Write(\"()\");\n\t\t\t\tcolumn += 2;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void StartNode(AstNode node)\n\t\t{\n\t\t\t// Write out the indentation, so that overrides of this method\n\t\t\t// can rely use the current output length to identify the position of the node\n\t\t\t// in the output.\n\t\t\tWriteIndentation();\n\t\t}\n\t\t\n\t\tpublic override void EndNode(AstNode node)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs",
    "content": "// \n// CSharpParser.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.IO;\nusing ICSharpCode.NRefactory.Editor;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class CSharpParser\n\t{\n\t\tCompilerSettings compilerSettings;\n\n\t\tclass ConversionVisitor : StructuralVisitor\n\t\t{\n\t\t\tSyntaxTree unit = new SyntaxTree();\n\t\t\tinternal bool convertTypeSystemMode;\n\n\t\t\tpublic SyntaxTree Unit {\n\t\t\t\tget {\n\t\t\t\t\treturn unit;\n\t\t\t\t}\n\t\t\t\tset {\n\t\t\t\t\tunit = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic LocationsBag LocationsBag {\n\t\t\t\tget;\n\t\t\t\tprivate set;\n\t\t\t}\n\n\t\t\tpublic ConversionVisitor(bool convertTypeSystemMode, LocationsBag locationsBag)\n\t\t\t{\n\t\t\t\tthis.convertTypeSystemMode = convertTypeSystemMode;\n\t\t\t\tthis.LocationsBag = locationsBag;\n\t\t\t}\n\n\t\t\tpublic static TextLocation Convert(Location loc)\n\t\t\t{\n\t\t\t\treturn new TextLocation(loc.Row, loc.Column);\n\t\t\t}\n\n\t\t\tpublic override void Visit(ModuleContainer mc)\n\t\t\t{\n\t\t\t\tbool first = true;\n\t\t\t\tforeach (var container in mc.Containers) {\n\t\t\t\t\tvar nspace = container as NamespaceContainer;\n\t\t\t\t\tif (nspace == null) {\n\t\t\t\t\t\tcontainer.Accept(this);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tNamespaceDeclaration nDecl = null;\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(nspace);\n\t\t\t\t\t\n\t\t\t\t\tif (nspace.NS != null && !string.IsNullOrEmpty(nspace.NS.Name)) {\n\t\t\t\t\t\tnDecl = new NamespaceDeclaration();\n\t\t\t\t\t\tif (loc != null) {\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.NamespaceKeyword), Roles.NamespaceKeyword);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnDecl.AddChild(ConvertNamespaceName(nspace.RealMemberName), NamespaceDeclaration.NamespaceNameRole);\n\t\t\t\t\t\tif (loc != null && loc.Count > 1) {\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tAddToNamespace(nDecl);\n\t\t\t\t\t\tnamespaceStack.Push(nDecl);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (nspace.Usings != null) {\n\t\t\t\t\t\tforeach (var us in nspace.Usings) {\n\t\t\t\t\t\t\tus.Accept(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (first) {\n\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t\tif (mc.OptAttributes != null) {\n\t\t\t\t\t\t\tforeach (var attr in mc.OptAttributes.Sections) {\n\t\t\t\t\t\t\t\tvar section = ConvertAttributeSection(attr);\n\t\t\t\t\t\t\t\tif (section !=\tnull)\n\t\t\t\t\t\t\t\t\tunit.AddChild(section, SyntaxTree.MemberRole);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (nspace.Containers != null) {\n\t\t\t\t\t\tforeach (var subContainer in nspace.Containers) {\n\t\t\t\t\t\t\tsubContainer.Accept(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nDecl != null) {\n\t\t\t\t\t\tAddAttributeSection(nDecl, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\t\t\tif (loc != null && loc.Count > 2)\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [2]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t\tif (loc != null && loc.Count > 3)\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnamespaceStack.Pop();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAddAttributeSection(unit, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAddAttributeSection(unit, mc.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t}\n\n\t\t\t#region Global\n\n\t\t\treadonly Stack<NamespaceDeclaration> namespaceStack = new Stack<NamespaceDeclaration>();\n\n\t\t\tvoid AddTypeArguments(ATypeNameExpression texpr, AstType result)\n\t\t\t{\n\t\t\t\tvar unbound = texpr.TypeArguments as UnboundTypeArguments;\n\t\t\t\tif (unbound != null) { \n\t\t\t\t\tvar loc2 = LocationsBag.GetLocations(texpr.TypeArguments);\n\t\t\t\t\tif (loc2 == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tif (j < loc2.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc2 [j++]), Roles.LChevron), Roles.LChevron);\n\t\t\t\t\twhile (j < loc2.Count - 1) {\n\t\t\t\t\t\tresult.AddChild (new SimpleType (), Roles.TypeArgument);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc2 [j++]), Roles.LChevron), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t\tif (j < loc2.Count) {\n\t\t\t\t\t\tresult.AddChild (new SimpleType (), Roles.TypeArgument);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc2 [j++]), Roles.RChevron), Roles.RChevron);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (texpr.TypeArguments == null || texpr.TypeArguments.Args == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar loc = LocationsBag.GetLocations(texpr.TypeArguments);\n\t\t\t\tif (loc != null && loc.Count >= 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [loc.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (var arg in texpr.TypeArguments.Args) {\n\t\t\t\t\tresult.AddChild(ConvertToType(arg), Roles.TypeArgument);\n\t\t\t\t\tif (loc != null && i < loc.Count - 2)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [i++]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\tif (loc != null && loc.Count >= 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [loc.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tstatic AstType ConvertToType(TypeParameter spec)\n\t\t\t{\n\t\t\t\tAstType result;\n\t\t\t\tresult = new SimpleType { IdentifierToken = Identifier.Create(spec.Name, Convert(spec.Location)) };\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tAstType ConvertToType(MemberName memberName)\n\t\t\t{\n\t\t\t\tAstType result;\n\t\t\t\tif (memberName.Left != null) {\n\t\t\t\t\tresult = new MemberType();\n\t\t\t\t\tresult.AddChild(ConvertToType(memberName.Left), MemberType.TargetRole);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(memberName);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\t\t\t\t\tresult.AddChild(Identifier.Create(memberName.Name, Convert(memberName.Location)), Roles.Identifier);\n\t\t\t\t} else {\n\t\t\t\t\tresult = new SimpleType { IdentifierToken = Identifier.Create(memberName.Name, Convert(memberName.Location)) };\n\t\t\t\t}\n\t\t\t\tif (memberName.TypeParameters != null) {\n\t\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeParameters);\n\t\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\t\tfor (int i = 0; i < memberName.TypeParameters.Count; i++) {\n\t\t\t\t\t\tvar param = memberName.TypeParameters [i];\n\t\t\t\t\t\tresult.AddChild(new SimpleType(Identifier.Create(param.Name, Convert(param.Location))), Roles.TypeArgument);\n\t\t\t\t\t\tif (chevronLocs != null && i < chevronLocs.Count - 2)\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(chevronLocs [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tAstType ConvertToType(Mono.CSharp.Expression typeName)\n\t\t\t{\n\t\t\t\tif (typeName == null) // may happen in typeof(Generic<,,,,>)\n\t\t\t\t\treturn new SimpleType();\n\t\t\t\t\n\t\t\t\tvar typeExpr = typeName as TypeExpression;\n\t\t\t\tif (typeExpr != null) {\n\t\t\t\t\treturn new PrimitiveType(typeExpr.GetSignatureForError(), Convert(typeExpr.Location));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar qam = typeName as QualifiedAliasMember;\n\t\t\t\tif (qam != null) {\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(typeName);\n\t\t\t\t\tvar memberType = new MemberType();\n\t\t\t\t\tmemberType.Target = new SimpleType(qam.alias, Convert(qam.Location));\n\t\t\t\t\tmemberType.IsDoubleColon = true;\n\n\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\tmemberType.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.DoubleColon), Roles.DoubleColon);\n\n\t\t\t\t\tmemberType.MemberNameToken = Identifier.Create(qam.Name, loc != null ? Convert(loc [1]) : TextLocation.Empty);\n\t\t\t\t\tAddTypeArguments(qam, memberType);\n\t\t\t\t\treturn memberType;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar ma = typeName as MemberAccess;\n\t\t\t\tif (ma != null) {\n\t\t\t\t\tvar memberType = new MemberType();\n\t\t\t\t\tmemberType.AddChild(ConvertToType(ma.LeftExpression), MemberType.TargetRole);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(ma);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tmemberType.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\n\t\t\t\t\tmemberType.MemberNameToken = Identifier.Create(ma.Name, Convert(ma.Location));\n\t\t\t\t\t\n\t\t\t\t\tAddTypeArguments(ma, memberType);\n\t\t\t\t\treturn memberType;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar sn = typeName as SimpleName;\n\t\t\t\tif (sn != null) {\n\t\t\t\t\tvar result = new SimpleType(sn.Name, Convert(sn.Location));\n\t\t\t\t\tAddTypeArguments(sn, result);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar cc = typeName as ComposedCast;\n\t\t\t\tif (cc != null) {\n\t\t\t\t\tvar baseType = ConvertToType(cc.Left);\n\t\t\t\t\tvar result = new ComposedType { BaseType = baseType };\n\t\t\t\t\tvar ccSpec = cc.Spec;\n\t\t\t\t\twhile (ccSpec != null) {\n\t\t\t\t\t\tif (ccSpec.IsNullable) {\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ccSpec.Location), ComposedType.NullableRole), ComposedType.NullableRole);\n\t\t\t\t\t\t} else if (ccSpec.IsPointer) {\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ccSpec.Location), ComposedType.PointerRole), ComposedType.PointerRole);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar location = LocationsBag.GetLocations(ccSpec);\n\t\t\t\t\t\t\tvar spec = new ArraySpecifier { Dimensions = ccSpec.Dimension };\n\t\t\t\t\t\t\tspec.AddChild(new CSharpTokenNode(Convert(ccSpec.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tspec.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tresult.ArraySpecifiers.Add(spec);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tccSpec = ccSpec.Next;\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar sce = typeName as SpecialContraintExpr;\n\t\t\t\tif (sce != null) {\n\t\t\t\t\tswitch (sce.Constraint) {\n\t\t\t\t\t\tcase SpecialConstraint.Class:\n\t\t\t\t\t\t\treturn new PrimitiveType(\"class\", Convert(sce.Location));\n\t\t\t\t\t\tcase SpecialConstraint.Struct:\n\t\t\t\t\t\t\treturn new PrimitiveType(\"struct\", Convert(sce.Location));\n\t\t\t\t\t\tcase SpecialConstraint.Constructor:\n\t\t\t\t\t\t\treturn new PrimitiveType(\"new\", Convert(sce.Location));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new SimpleType(\"unknown\");\n\t\t\t}\n\n\t\t\tIEnumerable<Attribute> GetAttributes(IEnumerable<Mono.CSharp.Attribute> optAttributes)\n\t\t\t{\n\t\t\t\tif (optAttributes == null)\n\t\t\t\t\tyield break;\n\t\t\t\tforeach (var attr in optAttributes) {\n\t\t\t\t\tvar result = new Attribute();\n\t\t\t\t\tresult.Type = ConvertToType(attr.TypeNameExpression);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(attr);\n\t\t\t\t\tresult.HasArgumentList = loc != null;\n\t\t\t\t\tint pos = 0;\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\n\t\t\t\t\tif (attr.PositionalArguments != null) {\n\t\t\t\t\t\tforeach (var arg in attr.PositionalArguments) {\n\t\t\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tvar na = arg as NamedArgument;\n\t\t\t\t\t\t\tif (na != null) {\n\t\t\t\t\t\t\t\tvar newArg = new NamedArgumentExpression();\n\t\t\t\t\t\t\t\tnewArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar argLoc = LocationsBag.GetLocations(na);\n\t\t\t\t\t\t\t\tif (argLoc != null)\n\t\t\t\t\t\t\t\t\tnewArg.AddChild(new CSharpTokenNode(Convert(argLoc [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\t\t\tif (na.Expr != null)\n\t\t\t\t\t\t\t\t\tnewArg.AddChild((Expression)na.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t\tresult.AddChild(newArg, Roles.Argument);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (arg.Expr != null)\n\t\t\t\t\t\t\t\t\tresult.AddChild((Expression)arg.Expr.Accept(this), Roles.Argument);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (loc != null && pos + 1 < loc.Count)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (attr.NamedArguments != null) {\n\t\t\t\t\t\tforeach (var arg in attr.NamedArguments) {\n\t\t\t\t\t\t\tvar na = (NamedArgument)arg;\n\t\t\t\t\t\t\tvar newArg = new NamedExpression();\n\t\t\t\t\t\t\tnewArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar argLoc = LocationsBag.GetLocations(na);\n\t\t\t\t\t\t\tif (argLoc != null)\n\t\t\t\t\t\t\t\tnewArg.AddChild(new CSharpTokenNode(Convert(argLoc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tif (na.Expr != null)\n\t\t\t\t\t\t\t\tnewArg.AddChild((Expression)na.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\tresult.AddChild(newArg, Roles.Argument);\n\t\t\t\t\t\t\tif (loc != null && pos + 1 < loc.Count)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (loc != null && pos < loc.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\n\t\t\t\t\tyield return result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAttributeSection ConvertAttributeSection(IEnumerable<Mono.CSharp.Attribute> optAttributes)\n\t\t\t{\n\t\t\t\tif (optAttributes == null)\n\t\t\t\t\treturn null;\n\t\t\t\tvar result = new AttributeSection();\n\t\t\t\tvar loc = LocationsBag.GetLocations(optAttributes);\n\t\t\t\tint pos = 0;\n\t\t\t\tif (loc != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.LBracket), Roles.LBracket);\n\t\t\t\tvar first = optAttributes.FirstOrDefault();\n\t\t\t\tstring target = first != null ? first.ExplicitTarget : null;\n\t\t\t\t\n\t\t\t\tif (!string.IsNullOrEmpty(target)) {\n\t\t\t\t\tif (loc != null && pos < loc.Count - 1) {\n\t\t\t\t\t\tresult.AddChild(Identifier.Create(target, Convert(loc [pos++])), Roles.Identifier);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.AddChild(Identifier.Create(target), Roles.Identifier);\n\t\t\t\t\t}\n\t\t\t\t\tif (loc != null && pos < loc.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Colon), Roles.Colon);\n\t\t\t\t}\n\n\t\t\t\tint attributeCount = 0;\n\t\t\t\tforeach (var attr in GetAttributes (optAttributes)) {\n\t\t\t\t\tresult.AddChild(attr, Roles.Attribute);\n\t\t\t\t\tif (loc != null && pos + 1 < loc.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\n\t\t\t\t\tattributeCount++;\n\t\t\t\t}\n\t\t\t\tif (attributeCount == 0)\n\t\t\t\t\treturn null;\n\t\t\t\t// Left and right bracket + commas between the attributes\n\t\t\t\tint locCount = 2 + attributeCount - 1;\n\t\t\t\t// optional comma\n\t\t\t\tif (loc != null && pos < loc.Count - 1 && loc.Count == locCount + 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\t\t\t\tif (loc != null && pos < loc.Count)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.RBracket), Roles.RBracket);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override void Visit(NamespaceContainer ns)\n\t\t\t{\n\t\t\t\tNamespaceDeclaration nDecl = null;\n\t\t\t\tvar loc = LocationsBag.GetLocations(ns);\n\t\t\t\t// <invalid> is caused by the parser - see Bug 12383 - [AST] Non existing namespaces generated\n\t\t\t\tif (ns.NS != null && !string.IsNullOrEmpty(ns.NS.Name) && !ns.NS.Name.EndsWith(\"<invalid>\", StringComparison.Ordinal)) {\n\t\t\t\t\tnDecl = new NamespaceDeclaration();\n\t\t\t\t\tif (loc != null) {\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.NamespaceKeyword), Roles.NamespaceKeyword);\n\t\t\t\t\t}\n\t\t\t\t\tnDecl.AddChild(ConvertNamespaceName(ns.RealMemberName), NamespaceDeclaration.NamespaceNameRole);\n\t\t\t\t\tif (loc != null && loc.Count > 1) {\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\t}\n\n\t\t\t\t\tAddToNamespace(nDecl);\n\t\t\t\t\tnamespaceStack.Push(nDecl);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ns.Usings != null) {\n\t\t\t\t\tforeach (var us in ns.Usings) {\n\t\t\t\t\t\tus.Accept(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ns.Containers != null) {\n\t\t\t\t\tforeach (var container in ns.Containers) {\n\t\t\t\t\t\tcontainer.Accept(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (nDecl != null) {\n\t\t\t\t\tAddAttributeSection(nDecl, ns.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\t\tif (loc != null && loc.Count > 2)\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [2]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (loc != null && loc.Count > 3)\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t\n\t\t\t\t\tnamespaceStack.Pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//\t\t\tpublic override void Visit (UsingsBag.Namespace nspace)\n\t\t\t//\t\t\t{\n\t\t\t//\n\t\t\t//\n\t\t\t//\t\t\t\tVisitNamespaceUsings (nspace);\n\t\t\t//\t\t\t\tVisitNamespaceBody (nspace);\n\t\t\t//\n\t\t\t//\t\t\t}\n\t\t\t//\n\t\t\tAstType ConvertNamespaceName(MemberName memberName)\n\t\t\t{\n\t\t\t\t// HACK for a parser 'bug' - sometimes it generates \"<invalid>\" identifiers in namespace names (on certain bugs in the input file)\n\t\t\t\tif (memberName.Name == \"<invalid>\")\n\t\t\t\t\treturn AstType.Null;\n\t\t\t\treturn ConvertToType(memberName);\n\t\t\t}\n\n\t\t\tpublic override void Visit(UsingNamespace un)\n\t\t\t{\n\t\t\t\tvar ud = new UsingDeclaration();\n\t\t\t\tvar loc = LocationsBag.GetLocations(un);\n\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(un.Location), UsingDeclaration.UsingKeywordRole), UsingDeclaration.UsingKeywordRole);\n\t\t\t\tif (un.NamespaceExpression != null)\n\t\t\t\t\tud.AddChild(ConvertToType(un.NamespaceExpression), UsingDeclaration.ImportRole);\n\t\t\t\tif (loc != null)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tAddToNamespace(ud);\n\t\t\t}\n\n\t\t\tpublic override void Visit(UsingAliasNamespace uan)\n\t\t\t{\n\t\t\t\tvar ud = new UsingAliasDeclaration();\n\t\t\t\tvar loc = LocationsBag.GetLocations(uan);\n\t\t\t\t\n\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(uan.Location), UsingAliasDeclaration.UsingKeywordRole), UsingAliasDeclaration.UsingKeywordRole);\n\t\t\t\tud.AddChild(Identifier.Create(uan.Alias.Value, Convert(uan.Alias.Location)), UsingAliasDeclaration.AliasRole);\n\t\t\t\tif (loc != null)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\tif (uan.NamespaceExpression != null)\n\t\t\t\t\tud.AddChild(ConvertToType(uan.NamespaceExpression), UsingAliasDeclaration.ImportRole);\n\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tAddToNamespace(ud);\n\t\t\t}\n\n\t\t\tpublic override void Visit(UsingExternAlias uea)\n\t\t\t{\n\t\t\t\tvar ud = new ExternAliasDeclaration();\n\t\t\t\tvar loc = LocationsBag.GetLocations(uea);\n\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(uea.Location), Roles.ExternKeyword), Roles.ExternKeyword);\n\t\t\t\tif (loc != null)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.AliasKeyword), Roles.AliasKeyword);\n\t\t\t\tud.AddChild(Identifier.Create(uea.Alias.Value, Convert(uea.Alias.Location)), Roles.Identifier);\n\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tAddToNamespace(ud);\n\t\t\t}\n\n\t\t\tAstType ConvertImport(MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName.Left != null) {\n\t\t\t\t\t// left.name\n\t\t\t\t\tvar t = new MemberType();\n//\t\t\t\t\tt.IsDoubleColon = memberName.IsDoubleColon;\n\t\t\t\t\tt.AddChild(ConvertImport(memberName.Left), MemberType.TargetRole);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(memberName);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tt.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\t\t\t\t\t\n\t\t\t\t\tt.AddChild(Identifier.Create(memberName.Name, Convert(memberName.Location)), Roles.Identifier);\n\t\t\t\t\tAddTypeArguments(t, memberName);\n\t\t\t\t\treturn t;\n\t\t\t\t} else {\n\t\t\t\t\tvar t = new SimpleType();\n\t\t\t\t\tt.AddChild(Identifier.Create(memberName.Name, Convert(memberName.Location)), Roles.Identifier);\n\t\t\t\t\tAddTypeArguments(t, memberName);\n\t\t\t\t\treturn t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Visit(MemberCore member)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Unknown member:\");\n\t\t\t\tConsole.WriteLine(member.GetType() + \"-> Member {0}\", member.GetSignatureForError());\n\t\t\t}\n\n\t\t\treadonly Stack<TypeDeclaration> typeStack = new Stack<TypeDeclaration>();\n\n\t\t\tpublic override void Visit(Class c)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Class;\n\t\t\t\tAddAttributeSection(newType, c);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(c);\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.ClassKeyword), Roles.ClassKeyword);\n\t\t\t\t\n\t\t\t\tnewType.AddChild(Identifier.Create(c.MemberName.Name, Convert(c.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newType, c.MemberName);\n\t\t\t\t\n\t\t\t\tif (c.TypeBaseExpressions != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(c.TypeBaseExpressions);\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var baseTypes in c.TypeBaseExpressions) {\n\t\t\t\t\t\tnewType.AddChild(ConvertToType(baseTypes), Roles.BaseType);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAddConstraints(newType, c.CurrentTypeParameters);\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\tbase.Visit(c);\n\t\t\t\tAddAttributeSection(newType, c.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\n\t\t\t\tif (location != null && curLoc < location.Count) {\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Struct s)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Struct;\n\t\t\t\tAddAttributeSection(newType, s);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(s);\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.StructKeyword), Roles.StructKeyword);\n\t\t\t\tnewType.AddChild(Identifier.Create(s.MemberName.Name, Convert(s.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newType, s.MemberName);\n\t\t\t\t\n\t\t\t\tif (s.TypeBaseExpressions != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(s.TypeBaseExpressions);\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var baseTypes in s.TypeBaseExpressions) {\n\t\t\t\t\t\tnewType.AddChild(ConvertToType(baseTypes), Roles.BaseType);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAddConstraints(newType, s.CurrentTypeParameters);\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\tbase.Visit(s);\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Interface i)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Interface;\n\t\t\t\tAddAttributeSection(newType, i);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(i);\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.InterfaceKeyword), Roles.InterfaceKeyword);\n\t\t\t\tnewType.AddChild(Identifier.Create(i.MemberName.Name, Convert(i.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newType, i.MemberName);\n\t\t\t\t\n\t\t\t\tif (i.TypeBaseExpressions != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(i.TypeBaseExpressions);\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tforeach (var baseTypes in i.TypeBaseExpressions) {\n\t\t\t\t\t\tnewType.AddChild(ConvertToType(baseTypes), Roles.BaseType);\n\t\t\t\t\t\tif (commaLocations != null && j < commaLocations.Count) {\n\t\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(commaLocations [j]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAddConstraints(newType, i.CurrentTypeParameters);\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\tbase.Visit(i);\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Mono.CSharp.Delegate d)\n\t\t\t{\n\t\t\t\tvar newDelegate = new DelegateDeclaration();\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(d);\n\t\t\t\tAddAttributeSection(newDelegate, d);\n\t\t\t\tAddModifiers(newDelegate, location);\n\t\t\t\tif (location != null && location.Count > 0) {\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.DelegateKeyword), Roles.DelegateKeyword);\n\t\t\t\t}\n\t\t\t\tif (d.ReturnType != null)\n\t\t\t\t\tnewDelegate.AddChild(ConvertToType(d.ReturnType), Roles.Type);\n\t\t\t\tnewDelegate.AddChild(Identifier.Create(d.MemberName.Name, Convert(d.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newDelegate, d.MemberName);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddParameter(newDelegate, d.Parameters);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t}\n\t\t\t\tAddConstraints(newDelegate, d.CurrentTypeParameters);\n\t\t\t\tif (location != null && location.Count > 3) {\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\tAddType(newDelegate);\n\t\t\t}\n\n\t\t\tvoid AddType(EntityDeclaration child)\n\t\t\t{\n\t\t\t\tif (typeStack.Count > 0) {\n\t\t\t\t\ttypeStack.Peek().AddChild(child, Roles.TypeMemberRole);\n\t\t\t\t} else {\n\t\t\t\t\tAddToNamespace(child);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddToNamespace(AstNode child)\n\t\t\t{\n\t\t\t\tif (namespaceStack.Count > 0) {\n\t\t\t\t\tnamespaceStack.Peek().AddChild(child, NamespaceDeclaration.MemberRole);\n\t\t\t\t} else {\n\t\t\t\t\tunit.AddChild(child, SyntaxTree.MemberRole);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Visit(Mono.CSharp.Enum e)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Enum;\n\t\t\t\tAddAttributeSection(newType, e);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(e);\n\t\t\t\t\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.EnumKeyword), Roles.EnumKeyword);\n\t\t\t\tnewType.AddChild(Identifier.Create(e.MemberName.Name, Convert(e.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (e.BaseTypeExpression != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tnewType.AddChild(ConvertToType(e.BaseTypeExpression), Roles.BaseType);\n\t\t\t\t}\n\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\t\n\t\t\t\tforeach (var m in e.Members) {\n\t\t\t\t\tvar member = m as EnumMember;\n\t\t\t\t\tif (member == null) {\n\t\t\t\t\t\tConsole.WriteLine(\"WARNING - ENUM MEMBER: \" + m);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tVisit(member);\n\t\t\t\t\tif (location != null && curLoc < location.Count - 1) //last one is closing brace\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\n\t\t\t\tAddAttributeSection(newType, e.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(EnumMember em)\n\t\t\t{\n\t\t\t\tvar newField = new EnumMemberDeclaration();\n\t\t\t\tAddAttributeSection(newField, em);\n\t\t\t\tnewField.AddChild(Identifier.Create(em.Name, Convert(em.Location)), Roles.Identifier);\n\t\t\t\tif (em.Initializer != null) {\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(em.Initializer.Location), Roles.Assign), Roles.Assign);\n\t\t\t\t\tnewField.AddChild((Expression)em.Initializer.Accept(this), EnumMemberDeclaration.InitializerRole);\n\t\t\t\t}\n\t\t\t\t//Console.WriteLine (newField.StartLocation +\"-\" + newField.EndLocation);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Type members\n\n\t\t\tpublic override void Visit(FixedField f)\n\t\t\t{\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(f);\n\t\t\t\tint locationIdx = 0;\n\t\t\t\t\n\t\t\t\tvar newField = new FixedFieldDeclaration();\n\t\t\t\tAddAttributeSection(newField, f);\n\t\t\t\tAddModifiers(newField, location);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), FixedFieldDeclaration.FixedKeywordRole), FixedFieldDeclaration.FixedKeywordRole);\n\n\t\t\t\tif (f.TypeExpression != null)\n\t\t\t\t\tnewField.AddChild(ConvertToType(f.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new FixedVariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(f.MemberName.Name, Convert(f.MemberName.Location)), Roles.Identifier);\n\t\t\t\tif (f.Initializer != null && !f.Initializer.IsNull) {\n\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(f.Initializer.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\n\t\t\t\t\tvariable.AddChild((Expression)f.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\tvar bracketLocations = LocationsBag.GetLocations(f.Initializer);\n\t\t\t\t\tif (bracketLocations != null)\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t}\n\t\t\t\tnewField.AddChild(variable, FixedFieldDeclaration.VariableRole);\n\t\t\t\t\n\t\t\t\tif (f.Declarators != null) {\n\t\t\t\t\tforeach (var decl in f.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new FixedVariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(decl.Initializer.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\tvar bracketLocations = LocationsBag.GetLocations(decl.Initializer);\n\t\t\t\t\t\tif (bracketLocations != null)\n\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);\n\n\t\t\t\t\t\tnewField.AddChild(variable, FixedFieldDeclaration.VariableRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > locationIdx)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [locationIdx]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\t\t\t\t\n\t\t\t}\n\n\t\t\tpublic override void Visit(Field f)\n\t\t\t{\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(f);\n\t\t\t\t\n\t\t\t\tvar newField = new FieldDeclaration();\n\t\t\t\tAddAttributeSection(newField, f);\n\t\t\t\tAddModifiers(newField, location);\n\t\t\t\tnewField.AddChild(ConvertToType(f.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new VariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(f.MemberName.Name, Convert(f.MemberName.Location)), Roles.Identifier);\n\t\t\t\tint locationIdx = 0;\n\t\t\t\tif (f.Initializer != null) {\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvariable.AddChild((Expression)f.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\tif (f.Declarators != null) {\n\t\t\t\t\tforeach (var decl in f.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new VariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(declLoc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > locationIdx)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), Roles.Semicolon), Roles.Semicolon);\n\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Const c)\n\t\t\t{\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(c);\n\t\t\t\t\n\t\t\t\tvar newField = new FieldDeclaration();\n\t\t\t\tAddAttributeSection(newField, c);\n\t\t\t\tAddModifiers(newField, location);\n\t\t\t\tif (location != null)\n\t\t\t\t\tnewField.AddChild(new CSharpModifierToken(Convert(location [0]), Modifiers.Const), EntityDeclaration.ModifierRole);\n\t\t\t\tnewField.AddChild(ConvertToType(c.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new VariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(c.MemberName.Name, Convert(c.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (c.Initializer != null) {\n\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(c.Initializer.Location), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvariable.AddChild((Expression)c.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\tif (c.Declarators != null) {\n\t\t\t\t\tforeach (var decl in c.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new VariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(decl.Initializer.Location), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\n\t\t\t\t\n\t\t\t}\n\n\t\t\tpublic override void Visit(Operator o)\n\t\t\t{\n\t\t\t\tvar newOperator = new OperatorDeclaration();\n\t\t\t\tnewOperator.OperatorType = (OperatorType)o.OperatorType;\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(o);\n\t\t\t\tAddAttributeSection(newOperator, o);\n\t\t\t\tAddModifiers(newOperator, location);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (o.OperatorType == Operator.OpType.Implicit) {\n\t\t\t\t\tif (location != null && location.Count > 0) {\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [0]), OperatorDeclaration.ImplicitRole), OperatorDeclaration.ImplicitRole);\n\t\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [1]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole);\n\t\t\t\t\t}\n\t\t\t\t\tnewOperator.AddChild(ConvertToType(o.TypeExpression), Roles.Type);\n\t\t\t\t} else if (o.OperatorType == Operator.OpType.Explicit) {\n\t\t\t\t\tif (location != null && location.Count > 0) {\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [0]), OperatorDeclaration.ExplicitRole), OperatorDeclaration.ExplicitRole);\n\t\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [1]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole);\n\t\t\t\t\t}\n\t\t\t\t\tnewOperator.AddChild(ConvertToType(o.TypeExpression), Roles.Type);\n\t\t\t\t} else {\n\t\t\t\t\tnewOperator.AddChild(ConvertToType(o.TypeExpression), Roles.Type);\n\n\t\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [0]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (location != null && location.Count > 1) {\n\t\t\t\t\t\tvar r = OperatorDeclaration.GetRole(newOperator.OperatorType);\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [1]), r), r);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddParameter(newOperator, o.ParameterInfo);\n\t\t\t\tif (location != null && location.Count > 3)\n\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (o.Block != null) {\n\t\t\t\t\tnewOperator.AddChild((BlockStatement)o.Block.Accept(this), Roles.Body);\n\t\t\t\t} else {\n\t\t\t\t\tif (location != null && location.Count >= 5)\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [4]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\ttypeStack.Peek().AddChild(newOperator, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic void AddAttributeSection(AstNode parent, Attributable a)\n\t\t\t{\n\t\t\t\tif (a == null || a.OptAttributes == null)\n\t\t\t\t\treturn;\n\t\t\t\tAddAttributeSection(parent, a.OptAttributes);\n\t\t\t}\n\n\t\t\tpublic void AddAttributeSection(AstNode parent, Attributes attrs, Role<AttributeSection> role)\n\t\t\t{\n\t\t\t\tif (attrs == null)\n\t\t\t\t\treturn;\n\t\t\t\tforeach (var attr in attrs.Sections) {\n\t\t\t\t\tvar section = ConvertAttributeSection(attr);\n\t\t\t\t\tif (section == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tparent.AddChild(section, role);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void AddAttributeSection(AstNode parent, Attributes attrs)\n\t\t\t{\n\t\t\t\tAddAttributeSection(parent, attrs, EntityDeclaration.AttributeRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Indexer i)\n\t\t\t{\n\t\t\t\tvar newIndexer = new IndexerDeclaration();\n\t\t\t\tAddAttributeSection(newIndexer, i);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(i);\n\t\t\t\tAddModifiers(newIndexer, location);\n\t\t\t\tnewIndexer.AddChild(ConvertToType(i.TypeExpression), Roles.Type);\n\t\t\t\tAddExplicitInterface(newIndexer, i.MemberName);\n\t\t\t\tvar name = i.MemberName;\n\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(name.Location), IndexerDeclaration.ThisKeywordRole), IndexerDeclaration.ThisKeywordRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBracket), Roles.LBracket);\n\t\t\t\tAddParameter(newIndexer, i.ParameterInfo);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.LBrace), Roles.LBrace);\n\t\t\t\tif (i.Get != null) {\n\t\t\t\t\tvar getAccessor = new Accessor();\n\t\t\t\t\tvar getLocation = LocationsBag.GetMemberLocation(i.Get);\n\t\t\t\t\tAddAttributeSection(getAccessor, i.Get);\n\t\t\t\t\tAddModifiers(getAccessor, getLocation);\n\t\t\t\t\tif (getLocation != null)\n\t\t\t\t\t\tgetAccessor.AddChild(new CSharpTokenNode(Convert(i.Get.Location), PropertyDeclaration.GetKeywordRole), PropertyDeclaration.GetKeywordRole);\n\t\t\t\t\tif (i.Get.Block != null) {\n\t\t\t\t\t\tgetAccessor.AddChild((BlockStatement)i.Get.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (getLocation != null && getLocation.Count > 0)\n\t\t\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(getLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t\tnewIndexer.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (i.Set != null) {\n\t\t\t\t\tvar setAccessor = new Accessor();\n\t\t\t\t\tvar setLocation = LocationsBag.GetMemberLocation(i.Set);\n\t\t\t\t\tAddAttributeSection(setAccessor, i.Set);\n\t\t\t\t\tAddModifiers(setAccessor, setLocation);\n\t\t\t\t\tif (setLocation != null)\n\t\t\t\t\t\tsetAccessor.AddChild(new CSharpTokenNode(Convert(i.Set.Location), PropertyDeclaration.SetKeywordRole), PropertyDeclaration.SetKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (i.Set.Block != null) {\n\t\t\t\t\t\tsetAccessor.AddChild((BlockStatement)i.Set.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (setLocation != null && setLocation.Count > 0)\n\t\t\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(setLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t\tnewIndexer.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null) {\n\t\t\t\t\tif (location.Count > 3)\n\t\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewIndexer.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Peek().AddChild(newIndexer, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Method m)\n\t\t\t{\n\t\t\t\tvar newMethod = new MethodDeclaration();\n\t\t\t\tAddAttributeSection(newMethod, m);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(m);\n\t\t\t\tAddModifiers(newMethod, location);\n\t\t\t\tnewMethod.AddChild(ConvertToType(m.TypeExpression), Roles.Type);\n\t\t\t\tAddExplicitInterface(newMethod, m.MethodName);\n\t\t\t\tnewMethod.AddChild(Identifier.Create(m.MethodName.Name, Convert(m.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tAddTypeParameters(newMethod, m.MemberName);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewMethod.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddParameter(newMethod, m.ParameterInfo);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewMethod.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tAddConstraints(newMethod, m.CurrentTypeParameters);\n\t\t\t\t\n\t\t\t\tif (m.Block != null) {\n\t\t\t\t\tvar bodyBlock = (BlockStatement)m.Block.Accept(this);\n//\t\t\t\t\tif (m.Block is ToplevelBlock) {\n//\t\t\t\t\t\tnewMethod.AddChild (bodyBlock.FirstChild.NextSibling, Roles.Body);\n//\t\t\t\t\t} else {\n\t\t\t\t\tnewMethod.AddChild(bodyBlock, Roles.Body);\n//\t\t\t\t\t}\n\t\t\t\t} else if (location != null) {\n\t\t\t\t\tif (location.Count < 3) {\n\t\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\t\tnewMethod.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewMethod.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttypeStack.Peek().AddChild(newMethod, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tstatic readonly Dictionary<Mono.CSharp.Modifiers, Modifiers> modifierTable = new Dictionary<Mono.CSharp.Modifiers, Modifiers>();\n\t\t\tstatic readonly string[] keywordTable;\n\n\t\t\tstatic ConversionVisitor()\n\t\t\t{\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.NEW] = Modifiers.New;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PUBLIC] = Modifiers.Public;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PROTECTED] = Modifiers.Protected;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PRIVATE] = Modifiers.Private;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.INTERNAL] = Modifiers.Internal;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.ABSTRACT] = Modifiers.Abstract;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.VIRTUAL] = Modifiers.Virtual;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.SEALED] = Modifiers.Sealed;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.STATIC] = Modifiers.Static;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.OVERRIDE] = Modifiers.Override;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.READONLY] = Modifiers.Readonly;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PARTIAL] = Modifiers.Partial;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.EXTERN] = Modifiers.Extern;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.VOLATILE] = Modifiers.Volatile;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.UNSAFE] = Modifiers.Unsafe;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.ASYNC] = Modifiers.Async;\n\t\t\t\t\n\t\t\t\tkeywordTable = new string[255];\n\t\t\t\tfor (int i = 0; i< keywordTable.Length; i++)\n\t\t\t\t\tkeywordTable [i] = \"unknown\";\n\t\t\t\t\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Other] = \"void\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.String] = \"string\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Int] = \"int\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Object] = \"object\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Float] = \"float\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Double] = \"double\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Long] = \"long\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Byte] = \"byte\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.UInt] = \"uint\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.ULong] = \"ulong\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Short] = \"short\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.UShort] = \"ushort\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.SByte] = \"sbyte\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Decimal] = \"decimal\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Char] = \"char\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Bool] = \"bool\";\n\t\t\t}\n\n\t\t\tstatic void AddModifiers(EntityDeclaration parent, LocationsBag.MemberLocations location)\n\t\t\t{\n\t\t\t\tif (location == null || location.Modifiers == null)\n\t\t\t\t\treturn;\n\t\t\t\tforeach (var modifier in location.Modifiers) {\n\t\t\t\t\tModifiers mod;\n\t\t\t\t\tif (!modifierTable.TryGetValue(modifier.Item1, out mod)) {\n\t\t\t\t\t\tConsole.WriteLine(\"modifier \" + modifier.Item1 + \" can't be converted,\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tparent.AddChild(new CSharpModifierToken(Convert(modifier.Item2), mod), EntityDeclaration.ModifierRole);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Visit(Property p)\n\t\t\t{\n\t\t\t\tvar newProperty = new PropertyDeclaration();\n\t\t\t\tAddAttributeSection(newProperty, p);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(p);\n\t\t\t\tAddModifiers(newProperty, location);\n\t\t\t\tnewProperty.AddChild(ConvertToType(p.TypeExpression), Roles.Type);\n\t\t\t\tAddExplicitInterface(newProperty, p.MemberName);\n\t\t\t\tnewProperty.AddChild(Identifier.Create(p.MemberName.Name, Convert(p.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewProperty.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\n\t\t\t\tAccessor getAccessor = null;\n\t\t\t\tif (p.Get != null) {\n\t\t\t\t\tgetAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(getAccessor, p.Get);\n\t\t\t\t\tvar getLocation = LocationsBag.GetMemberLocation(p.Get);\n\t\t\t\t\tAddModifiers(getAccessor, getLocation);\n\t\t\t\t\tgetAccessor.AddChild(new CSharpTokenNode(Convert(p.Get.Location), PropertyDeclaration.GetKeywordRole), PropertyDeclaration.GetKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (p.Get.Block != null) {\n\t\t\t\t\t\tgetAccessor.AddChild((BlockStatement)p.Get.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (getLocation != null && getLocation.Count > 0)\n\t\t\t\t\t\t\tgetAccessor.AddChild(new CSharpTokenNode(Convert(getLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAccessor setAccessor = null;\n\t\t\t\tif (p.Set != null) {\n\t\t\t\t\tsetAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(setAccessor, p.Set);\n\t\t\t\t\tvar setLocation = LocationsBag.GetMemberLocation(p.Set);\n\t\t\t\t\tAddModifiers(setAccessor, setLocation);\n\t\t\t\t\tsetAccessor.AddChild(new CSharpTokenNode(Convert(p.Set.Location), PropertyDeclaration.SetKeywordRole), PropertyDeclaration.SetKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (p.Set.Block != null) {\n\t\t\t\t\t\tsetAccessor.AddChild((BlockStatement)p.Set.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (setLocation != null && setLocation.Count > 0)\n\t\t\t\t\t\t\tsetAccessor.AddChild(new CSharpTokenNode(Convert(setLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (getAccessor != null && setAccessor != null) {\n\t\t\t\t\tif (getAccessor.StartLocation < setAccessor.StartLocation) {\n\t\t\t\t\t\tnewProperty.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t\t\tnewProperty.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewProperty.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t\t\tnewProperty.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (getAccessor != null)\n\t\t\t\t\t\tnewProperty.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t\tif (setAccessor != null)\n\t\t\t\t\t\tnewProperty.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1) {\n\t\t\t\t\tnewProperty.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewProperty.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newProperty, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Constructor c)\n\t\t\t{\n\t\t\t\tvar newConstructor = new ConstructorDeclaration();\n\t\t\t\tAddAttributeSection(newConstructor, c);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(c);\n\t\t\t\tAddModifiers(newConstructor, location);\n\t\t\t\tnewConstructor.AddChild(Identifier.Create(c.MemberName.Name, Convert(c.MemberName.Location)), Roles.Identifier);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewConstructor.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tAddParameter(newConstructor, c.ParameterInfo);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewConstructor.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (c.Initializer != null) {\n\t\t\t\t\tvar initializer = new ConstructorInitializer();\n\t\t\t\t\tinitializer.ConstructorInitializerType = c.Initializer is ConstructorBaseInitializer ? ConstructorInitializerType.Base : ConstructorInitializerType.This;\n\t\t\t\t\tvar initializerLocation = LocationsBag.GetLocations(c.Initializer);\n\t\t\t\t\t\n\t\t\t\t\tif (initializerLocation != null)\n\t\t\t\t\t\tnewConstructor.AddChild(new CSharpTokenNode(Convert(initializerLocation [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\n\t\t\t\t\tif (initializerLocation != null && initializerLocation.Count > 1) {\n\t\t\t\t\t\t// this and base has the same length\n\t\t\t\t\t\tvar r = initializer.ConstructorInitializerType == ConstructorInitializerType.This ? ConstructorInitializer.ThisKeywordRole : ConstructorInitializer.BaseKeywordRole;\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(c.Initializer.Location), r), r);\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initializerLocation [1]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\tAddArguments(initializer, c.Initializer.Arguments);\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initializerLocation [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\tnewConstructor.AddChild(initializer, ConstructorDeclaration.InitializerRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (c.Block != null)\n\t\t\t\t\tnewConstructor.AddChild((BlockStatement)c.Block.Accept(this), Roles.Body);\n\t\t\t\ttypeStack.Peek().AddChild(newConstructor, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Destructor d)\n\t\t\t{\n\t\t\t\tvar newDestructor = new DestructorDeclaration();\n\t\t\t\tAddAttributeSection(newDestructor, d);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(d);\n\t\t\t\tAddModifiers(newDestructor, location);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewDestructor.AddChild(new CSharpTokenNode(Convert(location [0]), DestructorDeclaration.TildeRole), DestructorDeclaration.TildeRole);\n\t\t\t\tnewDestructor.AddChild(Identifier.Create(d.Identifier, Convert(d.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1) {\n\t\t\t\t\tnewDestructor.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\n\t\t\t\t\tif (location.Count > 2)\n\t\t\t\t\t\tnewDestructor.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (d.Block != null)\n\t\t\t\t\tnewDestructor.AddChild((BlockStatement)d.Block.Accept(this), Roles.Body);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newDestructor, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(EventField e)\n\t\t\t{\n\t\t\t\tvar newEvent = new EventDeclaration();\n\t\t\t\tAddAttributeSection(newEvent, e);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(e);\n\t\t\t\tint l = 0;\n\t\t\t\tAddModifiers(newEvent, location);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [l++]), EventDeclaration.EventKeywordRole), EventDeclaration.EventKeywordRole);\n\t\t\t\tnewEvent.AddChild(ConvertToType(e.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new VariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(e.MemberName.Name, Convert(e.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (e.Initializer != null) {\n\t\t\t\t\tif (location != null && location.Count > l)\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvariable.AddChild((Expression)e.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\tnewEvent.AddChild(variable, Roles.Variable);\n\t\t\t\tif (e.Declarators != null) {\n\t\t\t\t\tforeach (var decl in e.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new VariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(declLoc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewEvent.AddChild(variable, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > l)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newEvent, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tvoid AddExplicitInterface(AstNode parent, MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || memberName.ExplicitInterface == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tparent.AddChild(ConvertToType(memberName.ExplicitInterface), EntityDeclaration.PrivateImplementationTypeRole);\n\t\t\t\tvar privateImplTypeLoc = LocationsBag.GetLocations(memberName.ExplicitInterface);\n\t\t\t\tif (privateImplTypeLoc != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(privateImplTypeLoc [0]), Roles.Dot), Roles.Dot);\n\t\t\t}\n\n\t\t\tpublic override void Visit(EventProperty ep)\n\t\t\t{\n\t\t\t\tvar newEvent = new CustomEventDeclaration();\n\t\t\t\tAddAttributeSection(newEvent, ep);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(ep);\n\t\t\t\tAddModifiers(newEvent, location);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [0]), CustomEventDeclaration.EventKeywordRole), CustomEventDeclaration.EventKeywordRole);\n\t\t\t\tnewEvent.AddChild(ConvertToType(ep.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tAddExplicitInterface(newEvent, ep.MemberName);\n\t\t\t\t\n\t\t\t\tnewEvent.AddChild(Identifier.Create(ep.MemberName.Name, Convert(ep.Location)), Roles.Identifier);\n\n\t\t\t\tif (location != null && location.Count >= 2)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\n\t\t\t\tif (ep.Add != null) {\n\t\t\t\t\tvar addAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(addAccessor, ep.Add);\n\t\t\t\t\tvar addLocation = LocationsBag.GetMemberLocation(ep.Add);\n\t\t\t\t\tAddModifiers(addAccessor, addLocation);\n\t\t\t\t\taddAccessor.AddChild(new CSharpTokenNode(Convert(ep.Add.Location), CustomEventDeclaration.AddKeywordRole), CustomEventDeclaration.AddKeywordRole);\n\t\t\t\t\tif (ep.Add.Block != null)\n\t\t\t\t\t\taddAccessor.AddChild((BlockStatement)ep.Add.Block.Accept(this), Roles.Body);\n\t\t\t\t\tnewEvent.AddChild(addAccessor, CustomEventDeclaration.AddAccessorRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ep.Remove != null) {\n\t\t\t\t\tvar removeAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(removeAccessor, ep.Remove);\n\t\t\t\t\tvar removeLocation = LocationsBag.GetMemberLocation(ep.Remove);\n\t\t\t\t\tAddModifiers(removeAccessor, removeLocation);\n\t\t\t\t\tremoveAccessor.AddChild(new CSharpTokenNode(Convert(ep.Remove.Location), CustomEventDeclaration.RemoveKeywordRole), CustomEventDeclaration.RemoveKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (ep.Remove.Block != null)\n\t\t\t\t\t\tremoveAccessor.AddChild((BlockStatement)ep.Remove.Block.Accept(this), Roles.Body);\n\t\t\t\t\tnewEvent.AddChild(removeAccessor, CustomEventDeclaration.RemoveAccessorRole);\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count >= 3) {\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewEvent.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newEvent, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Statements\n\n\t\t\tpublic override object Visit(Mono.CSharp.Statement stmt)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"unknown statement:\" + stmt);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BlockVariable blockVariableDeclaration)\n\t\t\t{\n\t\t\t\tvar result = new VariableDeclarationStatement();\n\t\t\t\tresult.AddChild(ConvertToType(blockVariableDeclaration.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar varInit = new VariableInitializer();\n\t\t\t\tvar location = LocationsBag.GetLocations(blockVariableDeclaration);\n\t\t\t\tvarInit.AddChild(Identifier.Create(blockVariableDeclaration.Variable.Name, Convert(blockVariableDeclaration.Variable.Location)), Roles.Identifier);\n\t\t\t\tif (blockVariableDeclaration.Initializer != null) {\n\t\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\t\tvarInit.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvarInit.AddChild((Expression)blockVariableDeclaration.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult.AddChild(varInit, Roles.Variable);\n\t\t\t\t\n\t\t\t\tif (blockVariableDeclaration.Declarators != null) {\n\t\t\t\t\tforeach (var decl in blockVariableDeclaration.Declarators) {\n\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult.AddChild(init, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && (blockVariableDeclaration.Initializer == null || location.Count > 1))\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [location.Count - 1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BlockConstant blockConstantDeclaration)\n\t\t\t{\n\t\t\t\tvar result = new VariableDeclarationStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(blockConstantDeclaration);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tresult.AddChild(new CSharpModifierToken(Convert(location [0]), Modifiers.Const), VariableDeclarationStatement.ModifierRole);\n\t\t\t\t\n\t\t\t\tresult.AddChild(ConvertToType(blockConstantDeclaration.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar varInit = new VariableInitializer();\n\t\t\t\tvarInit.AddChild(Identifier.Create(blockConstantDeclaration.Variable.Name, Convert(blockConstantDeclaration.Variable.Location)), Roles.Identifier);\n\t\t\t\tif (blockConstantDeclaration.Initializer != null) {\n\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\tvarInit.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvarInit.AddChild((Expression)blockConstantDeclaration.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult.AddChild(varInit, Roles.Variable);\n\t\t\t\t\n\t\t\t\tif (blockConstantDeclaration.Declarators != null) {\n\t\t\t\t\tforeach (var decl in blockConstantDeclaration.Declarators) {\n\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult.AddChild(init, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [location.Count - 1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tresult.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.EmptyStatement emptyStatement)\n\t\t\t{\n\t\t\t\tvar result = new EmptyStatement();\n\t\t\t\tresult.Location = Convert(emptyStatement.loc);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.ErrorExpression errorExpression)\n\t\t\t{\n\t\t\t\treturn new ErrorExpression(Convert(errorExpression.Location));\n\t\t\t}\n\n\t\t\tpublic override object Visit(EmptyExpressionStatement emptyExpressionStatement)\n\t\t\t{\n\t\t\t\t// Should never happen.\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tpublic override object Visit(If ifStatement)\n\t\t\t{\n\t\t\t\tvar result = new IfElseStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(ifStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ifStatement.loc), IfElseStatement.IfKeywordRole), IfElseStatement.IfKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (ifStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)ifStatement.Expr.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (ifStatement.TrueStatement != null)\n\t\t\t\t\tresult.AddChild((Statement)ifStatement.TrueStatement.Accept(this), IfElseStatement.TrueRole);\n\t\t\t\t\n\t\t\t\tif (ifStatement.FalseStatement != null) {\n\t\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), IfElseStatement.ElseKeywordRole), IfElseStatement.ElseKeywordRole);\n\t\t\t\t\tresult.AddChild((Statement)ifStatement.FalseStatement.Accept(this), IfElseStatement.FalseRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Do doStatement)\n\t\t\t{\n\t\t\t\tvar result = new DoWhileStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(doStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(doStatement.loc), DoWhileStatement.DoKeywordRole), DoWhileStatement.DoKeywordRole);\n\t\t\t\tif (doStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)doStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), DoWhileStatement.WhileKeywordRole), DoWhileStatement.WhileKeywordRole);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (doStatement.expr != null)\n\t\t\t\t\tresult.AddChild((Expression)doStatement.expr.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t\tif (location.Count > 3)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(While whileStatement)\n\t\t\t{\n\t\t\t\tvar result = new WhileStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(whileStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(whileStatement.loc), WhileStatement.WhileKeywordRole), WhileStatement.WhileKeywordRole);\n\t\t\t\t\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (whileStatement.expr != null)\n\t\t\t\t\tresult.AddChild((Expression)whileStatement.expr.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (whileStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)whileStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvoid AddStatementOrList(ForStatement forStatement, Mono.CSharp.Statement init, Role<Statement> role)\n\t\t\t{\n\t\t\t\tif (init == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar stmtList = init as StatementList;\n\t\t\t\tif (stmtList != null) {\n\t\t\t\t\tforeach (var stmt in stmtList.Statements) {\n\t\t\t\t\t\tforStatement.AddChild((Statement)stmt.Accept(this), role);\n\t\t\t\t\t}\n\t\t\t\t} else if (init is Mono.CSharp.EmptyStatement) {\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tforStatement.AddChild((Statement)init.Accept(this), role);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(For forStatement)\n\t\t\t{\n\t\t\t\tvar result = new ForStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(forStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(forStatement.loc), ForStatement.ForKeywordRole), ForStatement.ForKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tAddStatementOrList(result, forStatement.Initializer, ForStatement.InitializerRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tif (forStatement.Condition != null)\n\t\t\t\t\tresult.AddChild((Expression)forStatement.Condition.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count >= 3)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\tAddStatementOrList(result, forStatement.Iterator, ForStatement.IteratorRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count >= 4)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (forStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)forStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(StatementExpression statementExpression)\n\t\t\t{\n\t\t\t\tvar result = new ExpressionStatement();\n\t\t\t\tvar expr = statementExpression.Expr.Accept(this) as Expression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\tresult.AddChild(expr, Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(statementExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(StatementErrorExpression errorStatement)\n\t\t\t{\n\t\t\t\tvar result = new ExpressionStatement();\n\t\t\t\tvar expr = errorStatement.Expr.Accept(this) as Expression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\tresult.AddChild(expr, Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(errorStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(InvalidStatementExpression invalidStatementExpression)\n\t\t\t{\n\t\t\t\tvar result = new ExpressionStatement();\n\t\t\t\tif (invalidStatementExpression.Expression == null)\n\t\t\t\t\treturn result;\n\t\t\t\tvar expr = invalidStatementExpression.Expression.Accept(this) as Expression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\tresult.AddChild(expr, Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(invalidStatementExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Return returnStatement)\n\t\t\t{\n\t\t\t\tvar result = new ReturnStatement();\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(returnStatement.loc), ReturnStatement.ReturnKeywordRole), ReturnStatement.ReturnKeywordRole);\n\t\t\t\tif (returnStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)returnStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(returnStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Goto gotoStatement)\n\t\t\t{\n\t\t\t\tvar result = new GotoStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(gotoStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(gotoStatement.loc), GotoStatement.GotoKeywordRole), GotoStatement.GotoKeywordRole);\n\t\t\t\tvar loc = location != null ? Convert(location [0]) : TextLocation.Empty;\n\t\t\t\tresult.AddChild(Identifier.Create(gotoStatement.Target, loc), Roles.Identifier);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(LabeledStatement labeledStatement)\n\t\t\t{\n\t\t\t\tvar result = new LabelStatement();\n\t\t\t\tresult.AddChild(Identifier.Create(labeledStatement.Name, Convert(labeledStatement.loc)), Roles.Identifier);\n\t\t\t\tvar location = LocationsBag.GetLocations(labeledStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Colon), Roles.Colon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(GotoDefault gotoDefault)\n\t\t\t{\n\t\t\t\tvar result = new GotoDefaultStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(gotoDefault.loc), GotoDefaultStatement.GotoKeywordRole), GotoDefaultStatement.GotoKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(gotoDefault);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), GotoDefaultStatement.DefaultKeywordRole), GotoDefaultStatement.DefaultKeywordRole);\n\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(GotoCase gotoCase)\n\t\t\t{\n\t\t\t\tvar result = new GotoCaseStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(gotoCase.loc), GotoCaseStatement.GotoKeywordRole), GotoCaseStatement.GotoKeywordRole);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(gotoCase);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), GotoCaseStatement.CaseKeywordRole), GotoCaseStatement.CaseKeywordRole);\n\t\t\t\tif (gotoCase.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)gotoCase.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Throw throwStatement)\n\t\t\t{\n\t\t\t\tvar result = new ThrowStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(throwStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(throwStatement.loc), ThrowStatement.ThrowKeywordRole), ThrowStatement.ThrowKeywordRole);\n\t\t\t\tif (throwStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)throwStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Break breakStatement)\n\t\t\t{\n\t\t\t\tvar result = new BreakStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(breakStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(breakStatement.loc), BreakStatement.BreakKeywordRole), BreakStatement.BreakKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Continue continueStatement)\n\t\t\t{\n\t\t\t\tvar result = new ContinueStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(continueStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(continueStatement.loc), ContinueStatement.ContinueKeywordRole), ContinueStatement.ContinueKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic static bool IsLower(Location left, Location right)\n\t\t\t{\n\t\t\t\treturn left.Row < right.Row || left.Row == right.Row && left.Column < right.Column;\n\t\t\t}\n\n\t\t\tpublic UsingStatement CreateUsingStatement(Block blockStatement)\n\t\t\t{\n\t\t\t\tvar usingResult = new UsingStatement();\n\t\t\t\tMono.CSharp.Statement cur = blockStatement.Statements [0];\n\t\t\t\tvar u = cur as Using;\n\t\t\t\tif (u != null) {\n\t\t\t\t\tusingResult.AddChild(new CSharpTokenNode(Convert(u.loc), UsingStatement.UsingKeywordRole), UsingStatement.UsingKeywordRole);\n\t\t\t\t\tusingResult.AddChild(new CSharpTokenNode(Convert(blockStatement.StartLocation), Roles.LPar), Roles.LPar);\n\t\t\t\t\tif (u.Variables != null) {\n\t\t\t\t\t\tvar initializer = new VariableInitializer {\n\t\t\t\t\t\t\tNameToken = Identifier.Create(u.Variables.Variable.Name, Convert(u.Variables.Variable.Location)),\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(u.Variables);\n\t\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\tif (u.Variables.Initializer != null)\n\t\t\t\t\t\t\tinitializer.Initializer = u.Variables.Initializer.Accept(this) as Expression;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar varDec = new VariableDeclarationStatement {\n\t\t\t\t\t\t\tType = ConvertToType(u.Variables.TypeExpression),\n\t\t\t\t\t\t\tVariables = { initializer }\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (u.Variables.Declarators != null) {\n\t\t\t\t\t\t\tforeach (var decl in u.Variables.Declarators) {\n\t\t\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\t\t\tif (declLoc != null && declLoc.Count > 0)\n\t\t\t\t\t\t\t\t\tvarDec.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\t\t\tif (declLoc != null && declLoc.Count > 1)\n\t\t\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(declLoc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvarDec.AddChild(init, Roles.Variable);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusingResult.AddChild(varDec, UsingStatement.ResourceAcquisitionRole);\n\t\t\t\t\t}\n\t\t\t\t\tcur = u.Statement;\n\t\t\t\t\tusingResult.AddChild(new CSharpTokenNode(Convert(blockStatement.EndLocation), Roles.RPar), Roles.RPar);\n\t\t\t\t\tif (cur != null)\n\t\t\t\t\t\tusingResult.AddChild((Statement)cur.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t}\n\t\t\t\treturn usingResult;\n\t\t\t}\n\n\t\t\tvoid AddBlockChildren(BlockStatement result, Block blockStatement, ref int curLocal)\n\t\t\t{\n\t\t\t\tif (convertTypeSystemMode) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tforeach (Mono.CSharp.Statement stmt in blockStatement.Statements) {\n\t\t\t\t\tif (stmt == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t/*\t\t\t\t\tif (curLocal < localVariables.Count && IsLower (localVariables[curLocal].Location, stmt.loc)) {\n\t\t\t\t\t\tresult.AddChild (CreateVariableDeclaration (localVariables[curLocal]), Roles.Statement);\n\t\t\t\t\t\tcurLocal++;\n\t\t\t\t\t}*/\n\t\t\t\t\tif (stmt is Block && !(stmt is ToplevelBlock || stmt is ExplicitBlock)) {\n\t\t\t\t\t\tAddBlockChildren(result, (Block)stmt, ref curLocal);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.AddChild((Statement)stmt.Accept(this), BlockStatement.StatementRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(Block blockStatement)\n\t\t\t{\n\t\t\t\tif (blockStatement.IsCompilerGenerated && blockStatement.Statements.Any()) {\n\t\t\t\t\tif (blockStatement.Statements.First() is Using)\n\t\t\t\t\t\treturn CreateUsingStatement(blockStatement);\n\t\t\t\t\treturn blockStatement.Statements.Last().Accept(this);\n\t\t\t\t}\n\t\t\t\tvar result = new BlockStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(blockStatement.StartLocation), Roles.LBrace), Roles.LBrace);\n\t\t\t\tint curLocal = 0;\n\t\t\t\tAddBlockChildren(result, blockStatement, ref curLocal);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(blockStatement.EndLocation), Roles.RBrace), Roles.RBrace);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Switch switchStatement)\n\t\t\t{\n\t\t\t\tvar result = new SwitchStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(switchStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(switchStatement.loc), SwitchStatement.SwitchKeywordRole), SwitchStatement.SwitchKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (switchStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)switchStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.LBrace), Roles.LBrace);\n\t\t\t\tSwitchSection newSection = null;\n\t\t\t\tbool lastWasCase = false, added = true;\n\t\t\t\tif (switchStatement.Block != null) {\n\t\t\t\t\tforeach (var child in switchStatement.Block.Statements) {\n\t\t\t\t\t\tvar statement = child.Accept(this);\n\t\t\t\t\t\tvar caseLabel = statement as CaseLabel;\n\t\t\t\t\t\tif (caseLabel != null) {\n\t\t\t\t\t\t\tif (!lastWasCase) {\n\t\t\t\t\t\t\t\tnewSection = new SwitchSection();\n\t\t\t\t\t\t\t\tadded = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewSection.AddChild(caseLabel, SwitchSection.CaseLabelRole);\n\t\t\t\t\t\t\tlastWasCase = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (lastWasCase) {\n\t\t\t\t\t\t\t\tresult.AddChild(newSection, SwitchStatement.SwitchSectionRole);\n\t\t\t\t\t\t\t\tlastWasCase = false;\n\t\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewSection.AddChild((Statement)statement, Roles.EmbeddedStatement);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!added)\n\t\t\t\t\tresult.AddChild(newSection, SwitchStatement.SwitchSectionRole);\n\n\t\t\t\tif (location != null && location.Count > 3) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tresult.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SwitchLabel switchLabel)\n\t\t\t{\n\t\t\t\tvar newLabel = new CaseLabel();\n\t\t\t\tif (!switchLabel.IsDefault) {\n\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(Convert(switchLabel.Location), CaseLabel.CaseKeywordRole), CaseLabel.CaseKeywordRole);\n\t\t\t\t\tif (switchLabel.Label != null)\n\t\t\t\t\t\tnewLabel.AddChild((Expression)switchLabel.Label.Accept(this), Roles.Expression);\n\t\t\t\t\tvar colonLocation = LocationsBag.GetLocations(switchLabel);\n\t\t\t\t\tif (colonLocation != null)\n\t\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(Convert(colonLocation [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t} else {\n\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(Convert(switchLabel.Location), CaseLabel.DefaultKeywordRole), CaseLabel.DefaultKeywordRole);\n\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(new TextLocation(switchLabel.Location.Row, switchLabel.Location.Column + \"default\".Length), Roles.Colon), Roles.Colon);\n\t\t\t\t}\n\t\t\t\treturn newLabel;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Lock lockStatement)\n\t\t\t{\n\t\t\t\tvar result = new LockStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(lockStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(lockStatement.loc), LockStatement.LockKeywordRole), LockStatement.LockKeywordRole);\n\t\t\t\t\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (lockStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)lockStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (lockStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)lockStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Unchecked uncheckedStatement)\n\t\t\t{\n\t\t\t\tvar result = new UncheckedStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(uncheckedStatement.loc), UncheckedStatement.UncheckedKeywordRole), UncheckedStatement.UncheckedKeywordRole);\n\t\t\t\tif (uncheckedStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)uncheckedStatement.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Checked checkedStatement)\n\t\t\t{\n\t\t\t\tvar result = new CheckedStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(checkedStatement.loc), CheckedStatement.CheckedKeywordRole), CheckedStatement.CheckedKeywordRole);\n\t\t\t\tif (checkedStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)checkedStatement.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Unsafe unsafeStatement)\n\t\t\t{\n\t\t\t\tvar result = new UnsafeStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unsafeStatement.loc), UnsafeStatement.UnsafeKeywordRole), UnsafeStatement.UnsafeKeywordRole);\n\t\t\t\tif (unsafeStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)unsafeStatement.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Fixed fixedStatement)\n\t\t\t{\n\t\t\t\tvar result = new FixedStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(fixedStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(fixedStatement.loc), FixedStatement.FixedKeywordRole), FixedStatement.FixedKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tif (fixedStatement.Variables != null) {\n\t\t\t\t\tvar blockVariableDeclaration = fixedStatement.Variables;\n\t\t\t\t\tresult.AddChild(ConvertToType(blockVariableDeclaration.TypeExpression), Roles.Type);\n\t\t\t\t\tvar varInit = new VariableInitializer();\n\t\t\t\t\tvar initLocation = LocationsBag.GetLocations(blockVariableDeclaration);\n\t\t\t\t\tvarInit.AddChild(Identifier.Create(blockVariableDeclaration.Variable.Name, Convert(blockVariableDeclaration.Variable.Location)), Roles.Identifier);\n\t\t\t\t\tif (blockVariableDeclaration.Initializer != null) {\n\t\t\t\t\t\tif (initLocation != null)\n\t\t\t\t\t\t\tvarInit.AddChild(new CSharpTokenNode(Convert(initLocation [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\tvarInit.AddChild((Expression)blockVariableDeclaration.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tresult.AddChild(varInit, Roles.Variable);\n\t\t\t\t\t\n\t\t\t\t\tif (blockVariableDeclaration.Declarators != null) {\n\t\t\t\t\t\tforeach (var decl in blockVariableDeclaration.Declarators) {\n\t\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresult.AddChild(init, Roles.Variable);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (fixedStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)fixedStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(TryFinally tryFinallyStatement)\n\t\t\t{\n\t\t\t\tTryCatchStatement result;\n\t\t\t\tvar location = LocationsBag.GetLocations(tryFinallyStatement);\n\t\t\t\t\n\t\t\t\tif (tryFinallyStatement.Stmt is TryCatch) {\n\t\t\t\t\tresult = (TryCatchStatement)tryFinallyStatement.Stmt.Accept(this);\n\t\t\t\t} else {\n\t\t\t\t\tresult = new TryCatchStatement();\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(tryFinallyStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole);\n\t\t\t\t\tif (tryFinallyStatement.Stmt != null)\n\t\t\t\t\t\tresult.AddChild((BlockStatement)tryFinallyStatement.Stmt.Accept(this), TryCatchStatement.TryBlockRole);\n\t\t\t\t}\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), TryCatchStatement.FinallyKeywordRole), TryCatchStatement.FinallyKeywordRole);\n\t\t\t\tif (tryFinallyStatement.Fini != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)tryFinallyStatement.Fini.Accept(this), TryCatchStatement.FinallyBlockRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tCatchClause ConvertCatch(Catch ctch)\n\t\t\t{\n\t\t\t\tvar result = new CatchClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(ctch);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ctch.loc), CatchClause.CatchKeywordRole), CatchClause.CatchKeywordRole);\n\t\t\t\tif (ctch.TypeExpression != null) {\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\n\t\t\t\t\tif (ctch.TypeExpression != null)\n\t\t\t\t\t\tresult.AddChild(ConvertToType(ctch.TypeExpression), Roles.Type);\n\t\t\t\t\tif (ctch.Variable != null && !string.IsNullOrEmpty(ctch.Variable.Name))\n\t\t\t\t\t\tresult.AddChild(Identifier.Create(ctch.Variable.Name, Convert(ctch.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\n\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t}\n\n\t\t\t\tif (ctch.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)ctch.Block.Accept(this), Roles.Body);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(TryCatch tryCatchStatement)\n\t\t\t{\n\t\t\t\tvar result = new TryCatchStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(tryCatchStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole);\n\t\t\t\tif (tryCatchStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)tryCatchStatement.Block.Accept(this), TryCatchStatement.TryBlockRole);\n\t\t\t\tif (tryCatchStatement.Clauses != null) {\n\t\t\t\t\tforeach (var ctch in tryCatchStatement.Clauses) {\n\t\t\t\t\t\tresult.AddChild(ConvertCatch(ctch), TryCatchStatement.CatchClauseRole);\n\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\tif (tryCatchStatement.General != null)\n//\t\t\t\t\tresult.AddChild (ConvertCatch (tryCatchStatement.General), TryCatchStatement.CatchClauseRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Using usingStatement)\n\t\t\t{\n\t\t\t\tvar result = new UsingStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(usingStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(usingStatement.loc), UsingStatement.UsingKeywordRole), UsingStatement.UsingKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (usingStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((AstNode)usingStatement.Expr.Accept(this), UsingStatement.ResourceAcquisitionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (usingStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)usingStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Foreach foreachStatement)\n\t\t\t{\n\t\t\t\tvar result = new ForeachStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(foreachStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(foreachStatement.loc), ForeachStatement.ForeachKeywordRole), ForeachStatement.ForeachKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(foreachStatement.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.Variable != null)\n\t\t\t\t\tresult.AddChild(Identifier.Create(foreachStatement.Variable.Name, Convert(foreachStatement.Variable.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), ForeachStatement.InKeywordRole), ForeachStatement.InKeywordRole);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)foreachStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)foreachStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Yield yieldStatement)\n\t\t\t{\n\t\t\t\tvar result = new YieldReturnStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(yieldStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(yieldStatement.loc), YieldReturnStatement.YieldKeywordRole), YieldReturnStatement.YieldKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), YieldReturnStatement.ReturnKeywordRole), YieldReturnStatement.ReturnKeywordRole);\n\t\t\t\tif (yieldStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)yieldStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(YieldBreak yieldBreakStatement)\n\t\t\t{\n\t\t\t\tvar result = new YieldBreakStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(yieldBreakStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(yieldBreakStatement.loc), YieldBreakStatement.YieldKeywordRole), YieldBreakStatement.YieldKeywordRole);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), YieldBreakStatement.BreakKeywordRole), YieldBreakStatement.BreakKeywordRole);\n\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Expression\n\n\t\t\tpublic override object Visit(Mono.CSharp.Expression expression)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Visit unknown expression:\" + expression);\n\t\t\t\tConsole.WriteLine(Environment.StackTrace);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(DefaultParameterValueExpression defaultParameterValueExpression)\n\t\t\t{\n\t\t\t\treturn defaultParameterValueExpression.Child.Accept(this);\n\t\t\t}\n\n\t\t\tpublic override object Visit(TypeExpression typeExpression)\n\t\t\t{\n\t\t\t\treturn new TypeReferenceExpression(new PrimitiveType(keywordTable [(int)typeExpression.Type.BuiltinType], Convert(typeExpression.Location)));\n\t\t\t}\n\n\t\t\tpublic override object Visit(LocalVariableReference localVariableReference)\n\t\t\t{\n\t\t\t\treturn Identifier.Create(localVariableReference.Name, Convert(localVariableReference.Location));\n\t\t\t}\n\n\t\t\tpublic override object Visit(MemberAccess memberAccess)\n\t\t\t{\n\t\t\t\tExpression result;\n\t\t\t\tvar ind = memberAccess.LeftExpression as Indirection;\n\t\t\t\tif (ind != null) {\n\t\t\t\t\tresult = new PointerReferenceExpression();\n\t\t\t\t\tresult.AddChild((Expression)ind.Expr.Accept(this), Roles.TargetExpression);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ind.Location), PointerReferenceExpression.ArrowRole), PointerReferenceExpression.ArrowRole);\n\t\t\t\t} else {\n\t\t\t\t\tresult = new MemberReferenceExpression();\n\t\t\t\t\tif (memberAccess.LeftExpression != null) {\n\t\t\t\t\t\tvar leftExpr = memberAccess.LeftExpression.Accept(this);\n\t\t\t\t\t\tresult.AddChild((Expression)leftExpr, Roles.TargetExpression);\n\t\t\t\t\t}\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(memberAccess);\n\n\t\t\t\t\tif (loc != null) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult.AddChild(Identifier.Create(memberAccess.Name, Convert(memberAccess.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tAddTypeArguments(result, memberAccess);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(QualifiedAliasMember qualifiedAliasMember)\n\t\t\t{\n\t\t\t\tvar result = new MemberType();\n\t\t\t\tresult.Target = new SimpleType(qualifiedAliasMember.alias, Convert(qualifiedAliasMember.Location));\n\t\t\t\tresult.IsDoubleColon = true;\n\t\t\t\tvar location = LocationsBag.GetLocations(qualifiedAliasMember);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.DoubleColon), Roles.DoubleColon);\n\n\t\t\t\tAddTypeArguments(result, qualifiedAliasMember);\n\t\t\t\tresult.AddChild(Identifier.Create(qualifiedAliasMember.Name, location != null && location.Count > 1 ? Convert(location [1]) : TextLocation.Empty), Roles.Identifier);\n\t\t\t\treturn  new TypeReferenceExpression { Type = result };\n\t\t\t}\n\n\t\t\tpublic override object Visit(Constant constant)\n\t\t\t{\n\t\t\t\tif (constant.GetValue() == null)\n\t\t\t\t\treturn new NullReferenceExpression(Convert(constant.Location));\n\t\t\t\tstring literalValue;\n\t\t\t\tvar literalConstant = constant as ILiteralConstant;\n\t\t\t\tliteralValue = literalConstant != null ? new string(literalConstant.ParsedValue) : constant.GetValueAsLiteral();\n\t\t\t\tobject val = constant.GetValue();\n\t\t\t\tif (val is bool)\n\t\t\t\t\tliteralValue = (bool)val ? \"true\" : \"false\";\n\t\t\t\tvar result = new PrimitiveExpression(val, Convert(constant.Location), literalValue);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SimpleName simpleName)\n\t\t\t{\n\t\t\t\tvar result = new IdentifierExpression();\n\t\t\t\tresult.AddChild(Identifier.Create(simpleName.Name, Convert(simpleName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeArguments(result, simpleName);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BooleanExpression booleanExpression)\n\t\t\t{\n\t\t\t\treturn booleanExpression.Expr.Accept(this);\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.ParenthesizedExpression parenthesizedExpression)\n\t\t\t{\n\t\t\t\tvar result = new ParenthesizedExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(parenthesizedExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (parenthesizedExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)parenthesizedExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Unary unaryExpression)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tswitch (unaryExpression.Oper) {\n\t\t\t\t\tcase Unary.Operator.UnaryPlus:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Plus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.UnaryNegation:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Minus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.LogicalNot:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Not;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.OnesComplement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.BitNot;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.AddressOf:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.AddressOf;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar r = UnaryOperatorExpression.GetOperatorRole(result.Operator);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryExpression.Location), r), r);\n\t\t\t\tif (unaryExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)unaryExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(UnaryMutator unaryMutatorExpression)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tif (unaryMutatorExpression.Expr == null)\n\t\t\t\t\treturn result;\n\t\t\t\tvar expression = (Expression)unaryMutatorExpression.Expr.Accept(this);\n\t\t\t\tswitch (unaryMutatorExpression.UnaryMutatorMode) {\n\t\t\t\t\tcase UnaryMutator.Mode.PostDecrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.PostDecrement;\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.DecrementRole), UnaryOperatorExpression.DecrementRole);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase UnaryMutator.Mode.PostIncrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.PostIncrement;\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.IncrementRole), UnaryOperatorExpression.IncrementRole);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase UnaryMutator.Mode.PreIncrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Increment;\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.IncrementRole), UnaryOperatorExpression.IncrementRole);\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase UnaryMutator.Mode.PreDecrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Decrement;\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.DecrementRole), UnaryOperatorExpression.DecrementRole);\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Indirection indirectionExpression)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tresult.Operator = UnaryOperatorType.Dereference;\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(indirectionExpression.Location), UnaryOperatorExpression.DereferenceRole), UnaryOperatorExpression.DereferenceRole);\n\t\t\t\tif (indirectionExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)indirectionExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Is isExpression)\n\t\t\t{\n\t\t\t\tvar result = new IsExpression();\n\t\t\t\tif (isExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)isExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(isExpression.Location), IsExpression.IsKeywordRole), IsExpression.IsKeywordRole);\n\t\t\t\t\n\t\t\t\tif (isExpression.ProbeType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(isExpression.ProbeType), Roles.Type);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(As asExpression)\n\t\t\t{\n\t\t\t\tvar result = new AsExpression();\n\t\t\t\tif (asExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)asExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(asExpression.Location), AsExpression.AsKeywordRole), AsExpression.AsKeywordRole);\n\t\t\t\tif (asExpression.ProbeType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(asExpression.ProbeType), Roles.Type);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Cast castExpression)\n\t\t\t{\n\t\t\t\tvar result = new CastExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(castExpression);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(castExpression.Location), Roles.LPar), Roles.LPar);\n\t\t\t\tif (castExpression.TargetType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(castExpression.TargetType), Roles.Type);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (castExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)castExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ComposedCast composedCast)\n\t\t\t{\n\t\t\t\tvar result = new ComposedType();\n\t\t\t\tresult.AddChild(ConvertToType(composedCast.Left), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar spec = composedCast.Spec;\n\t\t\t\twhile (spec != null) {\n\t\t\t\t\tif (spec.IsNullable) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(spec.Location), ComposedType.NullableRole), ComposedType.NullableRole);\n\t\t\t\t\t} else if (spec.IsPointer) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(spec.Location), ComposedType.PointerRole), ComposedType.PointerRole);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar aSpec = new ArraySpecifier();\n\t\t\t\t\t\taSpec.AddChild(new CSharpTokenNode(Convert(spec.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\tvar location = LocationsBag.GetLocations(spec);\n\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\taSpec.AddChild(new CSharpTokenNode(Convert(spec.Location), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\t\tresult.AddChild(aSpec, ComposedType.ArraySpecifierRole);\n\t\t\t\t\t}\n\t\t\t\t\tspec = spec.Next;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.DefaultValueExpression defaultValueExpression)\n\t\t\t{\n\t\t\t\tvar result = new DefaultValueExpression();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(defaultValueExpression.Location), DefaultValueExpression.DefaultKeywordRole), DefaultValueExpression.DefaultKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(defaultValueExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tresult.AddChild(ConvertToType(defaultValueExpression.Expr), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Binary binaryExpression)\n\t\t\t{\n\t\t\t\tvar result = new BinaryOperatorExpression();\n\t\t\t\tswitch (binaryExpression.Oper) {\n\t\t\t\t\tcase Binary.Operator.Multiply:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Multiply;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Division:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Divide;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Modulus:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Modulus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Addition:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Add;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Subtraction:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Subtract;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LeftShift:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ShiftLeft;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.RightShift:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ShiftRight;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LessThan:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.LessThan;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.GreaterThan:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.GreaterThan;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LessThanOrEqual:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.LessThanOrEqual;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.GreaterThanOrEqual:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.GreaterThanOrEqual;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Equality:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Equality;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Inequality:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.InEquality;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseAnd:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.BitwiseAnd;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.ExclusiveOr:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ExclusiveOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseOr:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.BitwiseOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LogicalAnd:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ConditionalAnd;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LogicalOr:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ConditionalOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (binaryExpression.Left != null)\n\t\t\t\t\tresult.AddChild((Expression)binaryExpression.Left.Accept(this), BinaryOperatorExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(binaryExpression);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tvar r = BinaryOperatorExpression.GetOperatorRole(result.Operator);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), r), r);\n\t\t\t\t}\n\t\t\t\tif (binaryExpression.Right != null)\n\t\t\t\t\tresult.AddChild((Expression)binaryExpression.Right.Accept(this), BinaryOperatorExpression.RightRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Nullable.NullCoalescingOperator nullCoalescingOperator)\n\t\t\t{\n\t\t\t\tvar result = new BinaryOperatorExpression();\n\t\t\t\tresult.Operator = BinaryOperatorType.NullCoalescing;\n\t\t\t\tif (nullCoalescingOperator.LeftExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)nullCoalescingOperator.LeftExpression.Accept(this), BinaryOperatorExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(nullCoalescingOperator);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), BinaryOperatorExpression.NullCoalescingRole), BinaryOperatorExpression.NullCoalescingRole);\n\t\t\t\tif (nullCoalescingOperator.RightExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)nullCoalescingOperator.RightExpression.Accept(this), BinaryOperatorExpression.RightRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Conditional conditionalExpression)\n\t\t\t{\n\t\t\t\tvar result = new ConditionalExpression();\n\t\t\t\t\n\t\t\t\tif (conditionalExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)conditionalExpression.Expr.Accept(this), Roles.Condition);\n\t\t\t\tvar location = LocationsBag.GetLocations(conditionalExpression);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(conditionalExpression.Location), ConditionalExpression.QuestionMarkRole), ConditionalExpression.QuestionMarkRole);\n\t\t\t\tif (conditionalExpression.TrueExpr != null)\n\t\t\t\t\tresult.AddChild((Expression)conditionalExpression.TrueExpr.Accept(this), ConditionalExpression.TrueRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), ConditionalExpression.ColonRole), ConditionalExpression.ColonRole);\n\t\t\t\tif (conditionalExpression.FalseExpr != null)\n\t\t\t\t\tresult.AddChild((Expression)conditionalExpression.FalseExpr.Accept(this), ConditionalExpression.FalseRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvoid AddParameter(AstNode parent, AParametersCollection parameters)\n\t\t\t{\n\t\t\t\tif (parameters == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar paramLocation = LocationsBag.GetLocations(parameters);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < parameters.Count; i++) {\n\t\t\t\t\tvar p = (Parameter)parameters.FixedParameters [i];\n\t\t\t\t\tif (p == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar location = LocationsBag.GetLocations(p);\n\t\t\t\t\tvar parameterDeclarationExpression = new ParameterDeclaration();\n\t\t\t\t\tAddAttributeSection(parameterDeclarationExpression, p);\n\t\t\t\t\tswitch (p.ModFlags) {\n\t\t\t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.Out;\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.OutModifierRole), ParameterDeclaration.OutModifierRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.Ref;\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.RefModifierRole), ParameterDeclaration.RefModifierRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Parameter.Modifier.PARAMS:\n\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.Params;\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.ParamsModifierRole), ParameterDeclaration.ParamsModifierRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (p.HasExtensionMethodModifier) {\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.This;\n\t\t\t\t\t\t\t\tif (location != null) {\n\t\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.ThisModifierRole), ParameterDeclaration.ThisModifierRole);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (p.TypeExpression != null) // lambdas may have no types (a, b) => ...\n\t\t\t\t\t\tparameterDeclarationExpression.AddChild(ConvertToType(p.TypeExpression), Roles.Type);\n\t\t\t\t\tif (p.Name != null)\n\t\t\t\t\t\tparameterDeclarationExpression.AddChild(Identifier.Create(p.Name, Convert(p.Location)), Roles.Identifier);\n\t\t\t\t\tif (p.HasDefaultValue) {\n\t\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\tparameterDeclarationExpression.AddChild((Expression)p.DefaultValue.Accept(this), Roles.Expression);\n\t\t\t\t\t}\n\t\t\t\t\tparent.AddChild(parameterDeclarationExpression, Roles.Parameter);\n\t\t\t\t\tif (paramLocation != null && i < paramLocation.Count) {\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(paramLocation [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddTypeParameters(AstNode parent, MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || memberName.TypeParameters == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeParameters);\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\tfor (int i = 0; i < memberName.TypeParameters.Count; i++) {\n\t\t\t\t\tif (chevronLocs != null && i > 0 && i - 1 < chevronLocs.Count)\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [i - 1]), Roles.Comma), Roles.Comma);\n\t\t\t\t\tvar arg = memberName.TypeParameters [i];\n\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar tp = new TypeParameterDeclaration();\n\t\t\t\t\t\n\t\t\t\t\tList<Location> varianceLocation;\n\t\t\t\t\tswitch (arg.Variance) {\n\t\t\t\t\t\tcase Variance.Contravariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Contravariant;\n\t\t\t\t\t\t\tvarianceLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\t\t\tif (varianceLocation != null)\n\t\t\t\t\t\t\t\ttp.AddChild(new CSharpTokenNode(Convert(varianceLocation [0]), TypeParameterDeclaration.InVarianceKeywordRole), TypeParameterDeclaration.InVarianceKeywordRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Variance.Covariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Covariant;\n\t\t\t\t\t\t\tvarianceLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\t\t\tif (varianceLocation != null)\n\t\t\t\t\t\t\t\ttp.AddChild(new CSharpTokenNode(Convert(varianceLocation [0]), TypeParameterDeclaration.OutVarianceKeywordRole), TypeParameterDeclaration.OutVarianceKeywordRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Invariant;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tAddAttributeSection(tp, arg.OptAttributes);\n\n\t\t\t\t\tswitch (arg.Variance) {\n\t\t\t\t\t\tcase Variance.Covariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Covariant;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Variance.Contravariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Contravariant;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ttp.AddChild(Identifier.Create(arg.Name, Convert(arg.Location)), Roles.Identifier);\n\t\t\t\t\tparent.AddChild(tp, Roles.TypeParameter);\n\t\t\t\t}\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tvoid AddTypeArguments(AstNode parent, MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || memberName.TypeParameters == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeParameters);\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < memberName.TypeParameters.Count; i++) {\n\t\t\t\t\tvar arg = memberName.TypeParameters [i];\n\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tparent.AddChild(ConvertToType(arg), Roles.TypeArgument);\n\t\t\t\t\tif (chevronLocs != null && i < chevronLocs.Count - 2)\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tvoid AddTypeArguments(AstNode parent, ATypeNameExpression memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || !memberName.HasTypeArguments)\n\t\t\t\t\treturn;\n\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeArguments);\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < memberName.TypeArguments.Count; i++) {\n\t\t\t\t\tvar arg = memberName.TypeArguments.Args [i];\n\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tparent.AddChild(ConvertToType(arg), Roles.TypeArgument);\n\t\t\t\t\tif (chevronLocs != null && i < chevronLocs.Count - 2)\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tvoid AddConstraints(AstNode parent, TypeParameters d)\n\t\t\t{\n\t\t\t\tif (d == null)\n\t\t\t\t\treturn;\n\t\t\t\tfor (int i = 0; i < d.Count; i++) {\n\t\t\t\t\tvar typeParameter = d [i];\n\t\t\t\t\tif (typeParameter == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar c = typeParameter.Constraints;\n\t\t\t\t\tif (c == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar location = LocationsBag.GetLocations(c);\n\t\t\t\t\tvar constraint = new Constraint();\n\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(c.Location), Roles.WhereKeyword), Roles.WhereKeyword);\n\t\t\t\t\tconstraint.AddChild(new SimpleType(Identifier.Create(c.TypeParameter.Value, Convert(c.TypeParameter.Location))), Roles.ConstraintTypeParameter);\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tvar commaLocs = LocationsBag.GetLocations(c.ConstraintExpressions);\n\t\t\t\t\tint curComma = 0;\n\t\t\t\t\tif (c.ConstraintExpressions != null) {\n\t\t\t\t\t\tforeach (var expr in c.ConstraintExpressions) {\n\t\t\t\t\t\t\tconstraint.AddChild(ConvertToType(expr), Roles.BaseType);\n\t\t\t\t\t\t\tvar sce = expr as SpecialContraintExpr;\n\t\t\t\t\t\t\tif (sce != null) {\n\t\t\t\t\t\t\t\tswitch (sce.Constraint) {\n\t\t\t\t\t\t\t\t\tcase SpecialConstraint.Class:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase SpecialConstraint.Struct:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase SpecialConstraint.Constructor:\n\t\t\t\t\t\t\t\t\t\tvar bl = LocationsBag.GetLocations(expr);\n\t\t\t\t\t\t\t\t\t\tif (bl != null) {\n\t\t\t\t\t\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(bl [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(bl [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (commaLocs != null && curComma < commaLocs.Count)\n\t\t\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(commaLocs [curComma++]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// We need to sort the constraints by position; as they might be in a different order than the type parameters\n\t\t\t\t\tAstNode prevSibling = parent.LastChild;\n\t\t\t\t\twhile (prevSibling.StartLocation > constraint.StartLocation && prevSibling.PrevSibling != null)\n\t\t\t\t\t\tprevSibling = prevSibling.PrevSibling;\n\t\t\t\t\tparent.InsertChildAfter(prevSibling, constraint, Roles.Constraint);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tExpression ConvertArgument(Argument arg)\n\t\t\t{\n\t\t\t\tvar na = arg as NamedArgument;\n\t\t\t\tif (na != null) {\n\t\t\t\t\tvar newArg = new NamedArgumentExpression();\n\t\t\t\t\tnewArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);\n\t\t\t\t\t\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(na);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tnewArg.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\n\t\t\t\t\tif (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) {\n\t\t\t\t\t\tvar direction = new DirectionExpression();\n\t\t\t\t\t\tdirection.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref;\n\t\t\t\t\t\tvar argLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\t\tif (argLocation != null) {\n\t\t\t\t\t\t\tvar r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole;\n\t\t\t\t\t\t\tdirection.AddChild(new CSharpTokenNode(Convert(argLocation [0]), r), r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdirection.AddChild((Expression)arg.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\tnewArg.AddChild(direction, Roles.Expression);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewArg.AddChild(na.Expr != null ? (Expression)na.Expr.Accept(this) : new ErrorExpression(\"Named argument expression parse error\"), Roles.Expression);\n\t\t\t\t\t}\n\t\t\t\t\treturn newArg;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) {\n\t\t\t\t\tvar direction = new DirectionExpression();\n\t\t\t\t\tdirection.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref;\n\t\t\t\t\tvar argLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\tif (argLocation != null) {\n\t\t\t\t\t\tvar r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole;\n\t\t\t\t\t\tdirection.AddChild(new CSharpTokenNode(Convert(argLocation [0]), r), r);\n\t\t\t\t\t}\n\t\t\t\t\tdirection.AddChild((Expression)arg.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\treturn direction;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn (Expression)arg.Expr.Accept(this);\n\t\t\t}\n\n\t\t\tvoid AddArguments(AstNode parent, Arguments args)\n\t\t\t{\n\t\t\t\tif (args == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar commaLocations = LocationsBag.GetLocations(args);\n\t\t\t\tfor (int i = 0; i < args.Count; i++) {\n\t\t\t\t\tparent.AddChild(ConvertArgument(args [i]), Roles.Argument);\n\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (commaLocations != null && commaLocations.Count > args.Count)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(commaLocations [args.Count]), Roles.Comma), Roles.Comma);\n\t\t\t}\n\n\t\t\tpublic override object Visit(Invocation invocationExpression)\n\t\t\t{\n\t\t\t\tvar result = new InvocationExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(invocationExpression);\n\t\t\t\tif (invocationExpression.Exp != null)\n\t\t\t\t\tresult.AddChild((Expression)invocationExpression.Exp.Accept(this), Roles.TargetExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddArguments(result, invocationExpression.Arguments);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(New newExpression)\n\t\t\t{\n\t\t\t\tvar result = new ObjectCreateExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(newExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(newExpression.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole);\n\t\t\t\t\n\t\t\t\tif (newExpression.TypeRequested != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(newExpression.TypeRequested), Roles.Type);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddArguments(result, newExpression.Arguments);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(NewAnonymousType newAnonymousType)\n\t\t\t{\n\t\t\t\tvar result = new AnonymousTypeCreateExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(newAnonymousType);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(newAnonymousType.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBrace), Roles.LBrace);\n\t\t\t\tif (newAnonymousType.Parameters != null) {\n\t\t\t\t\tforeach (var par in newAnonymousType.Parameters) {\n\t\t\t\t\t\tif (par == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar parLocation = LocationsBag.GetLocations(par);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (parLocation == null) {\n\t\t\t\t\t\t\tif (par.Expr != null)\n\t\t\t\t\t\t\t\tresult.AddChild((Expression)par.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar namedExpression = new NamedExpression();\n\t\t\t\t\t\t\tnamedExpression.AddChild(Identifier.Create(par.Name, Convert(par.Location)), Roles.Identifier);\n\t\t\t\t\t\t\tnamedExpression.AddChild(new CSharpTokenNode(Convert(parLocation [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tif (par.Expr != null)\n\t\t\t\t\t\t\t\tnamedExpression.AddChild((Expression)par.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\tresult.AddChild(namedExpression, Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tArrayInitializerExpression ConvertCollectionOrObjectInitializers(CollectionOrObjectInitializers minit)\n\t\t\t{\n\t\t\t\tif (minit == null)\n\t\t\t\t\treturn null;\n\t\t\t\tvar init = new ArrayInitializerExpression();\n\t\t\t\tAddConvertCollectionOrObjectInitializers(init, minit);\n\t\t\t\treturn init;\n\t\t\t}\n\n\t\t\tvoid AddConvertCollectionOrObjectInitializers(Expression init, CollectionOrObjectInitializers minit)\n\t\t\t{\n\t\t\t\tvar initLoc = LocationsBag.GetLocations(minit);\n\t\t\t\tvar commaLoc = LocationsBag.GetLocations(minit.Initializers);\n\t\t\t\tint curComma = 0;\n\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(minit.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\tforeach (var expr in minit.Initializers) {\n\t\t\t\t\tvar collectionInit = expr as CollectionElementInitializer;\n\t\t\t\t\tif (collectionInit != null) {\n\t\t\t\t\t\tAstNode parent;\n\t\t\t\t\t\t// For ease of use purposes in the resolver the ast representation\n\t\t\t\t\t\t// of { a, b, c }  is { {a}, {b}, {c} } - but the generated ArrayInitializerExpression\n\t\t\t\t\t\t// can be identified by expr.IsSingleElement.\n\t\t\t\t\t\tif (!collectionInit.IsSingle) {\n\t\t\t\t\t\t\tparent = new ArrayInitializerExpression();\n\t\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(collectionInit.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent = ArrayInitializerExpression.CreateSingleElementInitializer();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (collectionInit.Arguments != null) {\n\t\t\t\t\t\t\tfor (int i = 0; i < collectionInit.Arguments.Count; i++) {\n\t\t\t\t\t\t\t\tvar arg = collectionInit.Arguments [i] as CollectionElementInitializer.ElementInitializerArgument;\n\t\t\t\t\t\t\t\tif (arg == null || arg.Expr == null)\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\tparent.AddChild(\n\t\t\t\t\t\t\t\t\t(Expression)arg.Expr.Accept(this),\n\t\t\t\t\t\t\t\t\tRoles.Expression\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!collectionInit.IsSingle) {\n\t\t\t\t\t\t\tvar braceLocs = LocationsBag.GetLocations(expr);\n\t\t\t\t\t\t\tif (braceLocs != null)\n\t\t\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(braceLocs [0]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinit.AddChild((ArrayInitializerExpression)parent, Roles.Expression);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar eleInit = expr as ElementInitializer;\n\t\t\t\t\t\tif (eleInit != null) {\n\t\t\t\t\t\t\tvar nexpr = new NamedExpression();\n\t\t\t\t\t\t\tnexpr.AddChild(\n\t\t\t\t\t\t\t\tIdentifier.Create(eleInit.Name, Convert(eleInit.Location)),\n\t\t\t\t\t\t\t\tRoles.Identifier\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tvar assignLoc = LocationsBag.GetLocations(eleInit);\n\t\t\t\t\t\t\tif (assignLoc != null)\n\t\t\t\t\t\t\t\tnexpr.AddChild(new CSharpTokenNode(Convert(assignLoc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tif (eleInit.Source != null) {\n\t\t\t\t\t\t\t\tvar colInit = eleInit.Source as CollectionOrObjectInitializers;\n\t\t\t\t\t\t\t\tif (colInit != null) {\n\t\t\t\t\t\t\t\t\tvar arrInit = new ArrayInitializerExpression();\n\t\t\t\t\t\t\t\t\tAddConvertCollectionOrObjectInitializers(\n\t\t\t\t\t\t\t\t\t\tarrInit,\n\t\t\t\t\t\t\t\t\t\tcolInit\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tnexpr.AddChild(arrInit, Roles.Expression);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnexpr.AddChild((Expression)eleInit.Source.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tinit.AddChild(nexpr, Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (commaLoc != null && curComma < commaLoc.Count)\n\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(commaLoc [curComma++]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\n\t\t\t\tif (initLoc != null) {\n\t\t\t\t\tif (initLoc.Count == 2) // optional comma\n\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(initLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(initLoc [initLoc.Count - 1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(NewInitialize newInitializeExpression)\n\t\t\t{\n\t\t\t\tvar result = new ObjectCreateExpression();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(newInitializeExpression.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole);\n\t\t\t\t\n\t\t\t\tif (newInitializeExpression.TypeRequested != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(newInitializeExpression.TypeRequested), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(newInitializeExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddArguments(result, newInitializeExpression.Arguments);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tvar init = ConvertCollectionOrObjectInitializers(newInitializeExpression.Initializers);\n\t\t\t\tif (init != null)\n\t\t\t\t\tresult.AddChild(init, ObjectCreateExpression.InitializerRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ArrayCreation arrayCreationExpression)\n\t\t\t{\n\t\t\t\tvar result = new ArrayCreateExpression();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(arrayCreationExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(arrayCreationExpression.Location), ArrayCreateExpression.NewKeywordRole), ArrayCreateExpression.NewKeywordRole);\n\t\t\t\tif (arrayCreationExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(arrayCreationExpression.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar next = arrayCreationExpression.Rank;\n\t\t\t\tif (arrayCreationExpression.Arguments != null) {\n\t\t\t\t\t// skip first array rank.\n\t\t\t\t\tnext = next.Next;\n\t\t\t\t\t\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(arrayCreationExpression.Arguments);\n\t\t\t\t\tfor (int i = 0; i < arrayCreationExpression.Arguments.Count; i++) {\n\t\t\t\t\t\tvar arg = arrayCreationExpression.Arguments [i];\n\t\t\t\t\t\tif (arg != null)\n\t\t\t\t\t\t\tresult.AddChild((Expression)arg.Accept(this), Roles.Argument);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count)\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twhile (next != null) {\n\t\t\t\t\tvar spec = new ArraySpecifier(next.Dimension);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(next);\n\t\t\t\t\tspec.AddChild(new CSharpTokenNode(Convert(next.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\tresult.AddChild(spec, ArrayCreateExpression.AdditionalArraySpecifierRole);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\tnext = next.Next;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (arrayCreationExpression.Initializers != null) {\n\t\t\t\t\tvar initLocation = LocationsBag.GetLocations(arrayCreationExpression.Initializers);\n\t\t\t\t\tvar initializer = new ArrayInitializerExpression();\n\t\t\t\t\t\n\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(arrayCreationExpression.Initializers.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(arrayCreationExpression.Initializers.Elements);\n\t\t\t\t\tfor (int i = 0; i < arrayCreationExpression.Initializers.Count; i++) {\n\t\t\t\t\t\tvar init = arrayCreationExpression.Initializers [i];\n\t\t\t\t\t\tif (init == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tinitializer.AddChild((Expression)init.Accept(this), Roles.Expression);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (initLocation != null) {\n\t\t\t\t\t\tif (initLocation.Count == 2) // optional comma\n\t\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initLocation [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initLocation [initLocation.Count - 1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t}\n\t\t\t\t\tresult.AddChild(initializer, ArrayCreateExpression.InitializerRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(This thisExpression)\n\t\t\t{\n\t\t\t\tvar result = new ThisReferenceExpression();\n\t\t\t\tresult.Location = Convert(thisExpression.Location);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ArglistAccess argListAccessExpression)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression {\n\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.ArgListAccess\n\t\t\t\t};\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(argListAccessExpression.Location), UndocumentedExpression.ArglistKeywordRole), UndocumentedExpression.ArglistKeywordRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#region Undocumented expressions\n\n\t\t\tpublic override object Visit(Arglist argListExpression)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.ArgList };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(argListExpression.Location), UndocumentedExpression.ArglistKeywordRole), UndocumentedExpression.ArglistKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(argListExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tAddArguments(result, argListExpression.Arguments);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(MakeRefExpr makeRefExpr)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.MakeRef };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(makeRefExpr.Location), UndocumentedExpression.MakerefKeywordRole), UndocumentedExpression.MakerefKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(makeRefExpr);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (makeRefExpr.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)makeRefExpr.Expr.Accept(this), Roles.Argument);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(RefTypeExpr refTypeExpr)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.RefType };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(refTypeExpr.Location), UndocumentedExpression.ReftypeKeywordRole), UndocumentedExpression.ReftypeKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(refTypeExpr);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tif (refTypeExpr.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)refTypeExpr.Expr.Accept(this), Roles.Argument);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(RefValueExpr refValueExpr)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.RefValue };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(refValueExpr.Location), UndocumentedExpression.RefvalueKeywordRole), UndocumentedExpression.RefvalueKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(refValueExpr);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (refValueExpr.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)refValueExpr.Expr.Accept(this), Roles.Argument);\n\n\t\t\t\tif (refValueExpr.FullNamedExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)refValueExpr.FullNamedExpression.Accept(this), Roles.Argument);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\tpublic override object Visit(TypeOf typeOfExpression)\n\t\t\t{\n\t\t\t\tvar result = new TypeOfExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(typeOfExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(typeOfExpression.Location), TypeOfExpression.TypeofKeywordRole), TypeOfExpression.TypeofKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (typeOfExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(typeOfExpression.TypeExpression), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SizeOf sizeOfExpression)\n\t\t\t{\n\t\t\t\tvar result = new SizeOfExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(sizeOfExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(sizeOfExpression.Location), SizeOfExpression.SizeofKeywordRole), SizeOfExpression.SizeofKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (sizeOfExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(sizeOfExpression.TypeExpression), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(CheckedExpr checkedExpression)\n\t\t\t{\n\t\t\t\tvar result = new CheckedExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(checkedExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(checkedExpression.Location), CheckedExpression.CheckedKeywordRole), CheckedExpression.CheckedKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (checkedExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)checkedExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(UnCheckedExpr uncheckedExpression)\n\t\t\t{\n\t\t\t\tvar result = new UncheckedExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(uncheckedExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(uncheckedExpression.Location), UncheckedExpression.UncheckedKeywordRole), UncheckedExpression.UncheckedKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (uncheckedExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)uncheckedExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ElementAccess elementAccessExpression)\n\t\t\t{\n\t\t\t\tvar result = new IndexerExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(elementAccessExpression);\n\t\t\t\t\n\t\t\t\tif (elementAccessExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)elementAccessExpression.Expr.Accept(this), Roles.TargetExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(elementAccessExpression.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\tAddArguments(result, elementAccessExpression.Arguments);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BaseThis baseAccessExpression)\n\t\t\t{\n\t\t\t\tvar result = new BaseReferenceExpression();\n\t\t\t\tresult.Location = Convert(baseAccessExpression.Location);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(StackAlloc stackAllocExpression)\n\t\t\t{\n\t\t\t\tvar result = new StackAllocExpression();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(stackAllocExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), StackAllocExpression.StackallocKeywordRole), StackAllocExpression.StackallocKeywordRole);\n\t\t\t\tif (stackAllocExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(stackAllocExpression.TypeExpression), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LBracket), Roles.LBracket);\n\t\t\t\tif (stackAllocExpression.CountExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)stackAllocExpression.CountExpression.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RBracket), Roles.RBracket);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SimpleAssign simpleAssign)\n\t\t\t{\n\t\t\t\tvar result = new AssignmentExpression();\n\t\t\t\t\n\t\t\t\tresult.Operator = AssignmentOperatorType.Assign;\n\t\t\t\tif (simpleAssign.Target != null)\n\t\t\t\t\tresult.AddChild((Expression)simpleAssign.Target.Accept(this), AssignmentExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(simpleAssign);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), AssignmentExpression.AssignRole), AssignmentExpression.AssignRole);\n\t\t\t\tif (simpleAssign.Source != null) {\n\t\t\t\t\tresult.AddChild((Expression)simpleAssign.Source.Accept(this), AssignmentExpression.RightRole);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(CompoundAssign compoundAssign)\n\t\t\t{\n\t\t\t\tvar result = new AssignmentExpression();\n\t\t\t\tswitch (compoundAssign.Op) {\n\t\t\t\t\tcase Binary.Operator.Multiply:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Multiply;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Division:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Divide;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Modulus:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Modulus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Addition:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Add;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Subtraction:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Subtract;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LeftShift:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.ShiftLeft;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.RightShift:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.ShiftRight;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseAnd:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.BitwiseAnd;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseOr:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.BitwiseOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.ExclusiveOr:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.ExclusiveOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (compoundAssign.Target != null)\n\t\t\t\t\tresult.AddChild((Expression)compoundAssign.Target.Accept(this), AssignmentExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(compoundAssign);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tvar r = AssignmentExpression.GetOperatorRole(result.Operator);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), r), r);\n\t\t\t\t}\n\t\t\t\tif (compoundAssign.Source != null)\n\t\t\t\t\tresult.AddChild((Expression)compoundAssign.Source.Accept(this), AssignmentExpression.RightRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tvar result = new AnonymousMethodExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(anonymousMethodExpression);\n\t\t\t\tint l = 0;\n\t\t\t\tif (anonymousMethodExpression.IsAsync) {\n\t\t\t\t\tresult.IsAsync = true;\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), AnonymousMethodExpression.AsyncModifierRole), AnonymousMethodExpression.AsyncModifierRole);\n\t\t\t\t}\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), AnonymousMethodExpression.DelegateKeywordRole), AnonymousMethodExpression.DelegateKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (location.Count > l) {\n\t\t\t\t\t\tresult.HasParameterList = true;\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\tAddParameter(result, anonymousMethodExpression.Parameters);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (anonymousMethodExpression.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)anonymousMethodExpression.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tvar result = new LambdaExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(lambdaExpression);\n\t\t\t\tint l = 0;\n\t\t\t\tif (lambdaExpression.IsAsync) {\n\t\t\t\t\tresult.IsAsync = true;\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), LambdaExpression.AsyncModifierRole), LambdaExpression.AsyncModifierRole);\n\t\t\t\t}\n\t\t\t\tif (location == null || location.Count == l + 1) {\n\t\t\t\t\tif (lambdaExpression.Block != null)\n\t\t\t\t\t\tAddParameter(result, lambdaExpression.Parameters);\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), LambdaExpression.ArrowRole), LambdaExpression.ArrowRole);\n\t\t\t\t} else {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.LPar), Roles.LPar);\n\t\t\t\t\tif (lambdaExpression.Block != null)\n\t\t\t\t\t\tAddParameter(result, lambdaExpression.Parameters);\n\t\t\t\t\tif (location != null) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), LambdaExpression.ArrowRole), LambdaExpression.ArrowRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lambdaExpression.Block != null) {\n\t\t\t\t\tif (lambdaExpression.Block.IsCompilerGenerated) {\n\t\t\t\t\t\tvar generatedReturn = (ContextualReturn)lambdaExpression.Block.Statements [0];\n\t\t\t\t\t\tresult.AddChild((AstNode)generatedReturn.Expr.Accept(this), LambdaExpression.BodyRole);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.AddChild((AstNode)lambdaExpression.Block.Accept(this), LambdaExpression.BodyRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ConstInitializer constInitializer)\n\t\t\t{\n\t\t\t\treturn constInitializer.Expr.Accept(this);\n\t\t\t}\n\n\t\t\tpublic override object Visit(ArrayInitializer arrayInitializer)\n\t\t\t{\n\t\t\t\tvar result = new ArrayInitializerExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(arrayInitializer);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(arrayInitializer.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\tvar commaLocations = LocationsBag.GetLocations(arrayInitializer.Elements);\n\t\t\t\tfor (int i = 0; i < arrayInitializer.Count; i++) {\n\t\t\t\t\tvar init = arrayInitializer [i];\n\t\t\t\t\tif (init == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tresult.AddChild((Expression)init.Accept(this), Roles.Expression);\n\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null) {\n\t\t\t\t\tif (location.Count == 2) // optional comma\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [location.Count - 1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region LINQ expressions\n\n\t\t\tQueryOrderClause currentQueryOrderClause;\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.QueryExpression queryExpression)\n\t\t\t{\n\t\t\t\tvar oldQueryOrderClause = currentQueryOrderClause;\n\t\t\t\ttry {\n\t\t\t\t\tcurrentQueryOrderClause = null;\n\t\t\t\t\tvar result = new QueryExpression();\n\t\t\t\t\t\n\t\t\t\t\tvar currentClause = queryExpression.next;\n\t\t\t\t\t\n\t\t\t\t\twhile (currentClause != null) {\n\t\t\t\t\t\tvar clause = (QueryClause)currentClause.Accept(this);\n\t\t\t\t\t\tif (clause is QueryContinuationClause) {\n\t\t\t\t\t\t\t// insert preceding query at beginning of QueryContinuationClause\n\t\t\t\t\t\t\tclause.InsertChildAfter(null, result, QueryContinuationClause.PrecedingQueryRole);\n\t\t\t\t\t\t\t// create a new QueryExpression for the remaining query\n\t\t\t\t\t\t\tresult = new QueryExpression();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (clause != null) {\n\t\t\t\t\t\t\tresult.AddChild(clause, QueryExpression.ClauseRole);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentClause = currentClause.next;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn result;\n\t\t\t\t} finally {\n\t\t\t\t\tcurrentQueryOrderClause = oldQueryOrderClause;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.QueryStartClause queryExpression)\n\t\t\t{\n\t\t\t\tif (queryExpression.Expr == null) {\n\t\t\t\t\tvar intoClause = new QueryContinuationClause();\n\t\t\t\t\tintoClause.AddChild(new CSharpTokenNode(Convert(queryExpression.Location), QueryContinuationClause.IntoKeywordRole), QueryContinuationClause.IntoKeywordRole);\n\t\t\t\t\tintoClause.AddChild(Identifier.Create(queryExpression.IntoVariable.Name, Convert(queryExpression.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\t\treturn intoClause;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar fromClause = new QueryFromClause();\n\n\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(queryExpression.Location), QueryFromClause.FromKeywordRole), QueryFromClause.FromKeywordRole);\n\t\t\t\t\n\t\t\t\tif (queryExpression.IdentifierType != null)\n\t\t\t\t\tfromClause.AddChild(ConvertToType(queryExpression.IdentifierType), Roles.Type);\n\t\t\t\t\n\t\t\t\tfromClause.AddChild(Identifier.Create(queryExpression.IntoVariable.Name, Convert(queryExpression.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(queryExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(location [0]), QueryFromClause.InKeywordRole), QueryFromClause.InKeywordRole);\n\n\t\t\t\tif (queryExpression.Expr != null)\n\t\t\t\t\tfromClause.AddChild((Expression)queryExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn fromClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.SelectMany selectMany)\n\t\t\t{\n\t\t\t\tvar fromClause = new QueryFromClause();\n\n\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(selectMany.Location), QueryFromClause.FromKeywordRole), QueryFromClause.FromKeywordRole);\n\t\t\t\t\n\t\t\t\tif (selectMany.IdentifierType != null)\n\t\t\t\t\tfromClause.AddChild(ConvertToType(selectMany.IdentifierType), Roles.Type);\n\t\t\t\t\n\t\t\t\tfromClause.AddChild(Identifier.Create(selectMany.IntoVariable.Name, Convert(selectMany.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(selectMany);\n\t\t\t\tif (location != null)\n\t\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(location [0]), QueryFromClause.InKeywordRole), QueryFromClause.InKeywordRole);\n\n\t\t\t\tif (selectMany.Expr != null)\n\t\t\t\t\tfromClause.AddChild((Expression)selectMany.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn fromClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Select select)\n\t\t\t{\n\t\t\t\tvar result = new QuerySelectClause();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(select.Location), QuerySelectClause.SelectKeywordRole), QuerySelectClause.SelectKeywordRole);\n\t\t\t\tif (select.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)select.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.GroupBy groupBy)\n\t\t\t{\n\t\t\t\tvar result = new QueryGroupClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(groupBy);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(groupBy.Location), QueryGroupClause.GroupKeywordRole), QueryGroupClause.GroupKeywordRole);\n\t\t\t\tif (groupBy.ElementSelector != null)\n\t\t\t\t\tresult.AddChild((Expression)groupBy.ElementSelector.Accept(this), QueryGroupClause.ProjectionRole);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tvar byLoc = Convert(location[0]);\n\t\t\t\t\tif (byLoc.Line > 1 || byLoc.Column > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(byLoc, QueryGroupClause.ByKeywordRole), QueryGroupClause.ByKeywordRole);\n\t\t\t\t}\n\t\t\t\tif (groupBy.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)groupBy.Expr.Accept(this), QueryGroupClause.KeyRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Let let)\n\t\t\t{\n\t\t\t\tvar result = new QueryLetClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(let);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(let.Location), QueryLetClause.LetKeywordRole), QueryLetClause.LetKeywordRole);\n\t\t\t\tresult.AddChild(Identifier.Create(let.IntoVariable.Name, Convert(let.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Assign), Roles.Assign);\n\t\t\t\tif (let.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)let.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Where where)\n\t\t\t{\n\t\t\t\tvar result = new QueryWhereClause();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(where.Location), QueryWhereClause.WhereKeywordRole), QueryWhereClause.WhereKeywordRole);\n\t\t\t\tif (where.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)where.Expr.Accept(this), Roles.Condition);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Join join)\n\t\t\t{\n\t\t\t\tvar result = new QueryJoinClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(join);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(join.Location), QueryJoinClause.JoinKeywordRole), QueryJoinClause.JoinKeywordRole);\n\n\t\t\t\tif (join.IdentifierType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(join.IdentifierType), QueryJoinClause.TypeRole);\n\n\t\t\t\tresult.AddChild(Identifier.Create(join.JoinVariable.Name, Convert(join.JoinVariable.Location)), QueryJoinClause.JoinIdentifierRole);\n\n\t\t\t\tif (join.IdentifierType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(join.IdentifierType), QueryJoinClause.TypeRole);\n\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), QueryJoinClause.InKeywordRole), QueryJoinClause.InKeywordRole);\n\n\t\t\t\tif (join.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)join.Expr.Accept(this), QueryJoinClause.InExpressionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), QueryJoinClause.OnKeywordRole), QueryJoinClause.OnKeywordRole);\n\t\t\t\t\n\t\t\t\tvar outer = join.OuterSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (outer != null)\n\t\t\t\t\tresult.AddChild((Expression)outer.Expr.Accept(this), QueryJoinClause.OnExpressionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), QueryJoinClause.EqualsKeywordRole), QueryJoinClause.EqualsKeywordRole);\n\t\t\t\t\n\t\t\t\tvar inner = join.InnerSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (inner != null)\n\t\t\t\t\tresult.AddChild((Expression)inner.Expr.Accept(this), QueryJoinClause.EqualsExpressionRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.GroupJoin groupJoin)\n\t\t\t{\n\t\t\t\tvar result = new QueryJoinClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(groupJoin);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(groupJoin.Location), QueryJoinClause.JoinKeywordRole), QueryJoinClause.JoinKeywordRole);\n\t\t\t\t\n\t\t\t\t// mcs seems to have swapped IntoVariable with JoinVariable, so we'll swap it back here\n\t\t\t\tresult.AddChild(Identifier.Create(groupJoin.IntoVariable.Name, Convert(groupJoin.IntoVariable.Location)), QueryJoinClause.JoinIdentifierRole);\n\t\t\t\t\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), QueryJoinClause.InKeywordRole), QueryJoinClause.InKeywordRole);\n\n\t\t\t\tif (groupJoin.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)groupJoin.Expr.Accept(this), QueryJoinClause.InExpressionRole);\n\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), QueryJoinClause.OnKeywordRole), QueryJoinClause.OnKeywordRole);\n\n\t\t\t\tvar outer = groupJoin.OuterSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (outer != null)\n\t\t\t\t\tresult.AddChild((Expression)outer.Expr.Accept(this), QueryJoinClause.OnExpressionRole);\n\t\t\t\t\n\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), QueryJoinClause.EqualsKeywordRole), QueryJoinClause.EqualsKeywordRole);\n\t\t\t\tvar inner = groupJoin.InnerSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (inner != null)\n\t\t\t\t\tresult.AddChild((Expression)inner.Expr.Accept(this), QueryJoinClause.EqualsExpressionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 3)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), QueryJoinClause.IntoKeywordRole), QueryJoinClause.IntoKeywordRole);\n\t\t\t\t\n\t\t\t\tresult.AddChild(Identifier.Create(groupJoin.JoinVariable.Name, Convert(groupJoin.JoinVariable.Location)), QueryJoinClause.IntoIdentifierRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.OrderByAscending orderByAscending)\n\t\t\t{\n\t\t\t\tcurrentQueryOrderClause = new QueryOrderClause();\n\t\t\t\tvar location2 = LocationsBag.GetLocations(orderByAscending.block);\n\t\t\t\tif (location2 != null)\n\t\t\t\t\tcurrentQueryOrderClause.AddChild(new CSharpTokenNode(Convert(location2 [0]), QueryOrderClause.OrderbyKeywordRole), QueryOrderClause.OrderbyKeywordRole);\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (orderByAscending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)orderByAscending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(orderByAscending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Ascending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.AscendingKeywordRole), QueryOrdering.AscendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn currentQueryOrderClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.OrderByDescending orderByDescending)\n\t\t\t{\n\t\t\t\tcurrentQueryOrderClause = new QueryOrderClause();\n\t\t\t\t\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (orderByDescending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)orderByDescending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(orderByDescending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Descending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn currentQueryOrderClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.ThenByAscending thenByAscending)\n\t\t\t{\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (thenByAscending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)thenByAscending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(thenByAscending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Ascending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.AscendingKeywordRole), QueryOrdering.AscendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.ThenByDescending thenByDescending)\n\t\t\t{\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (thenByDescending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)thenByDescending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(thenByDescending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Descending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Await awaitExpr)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tresult.Operator = UnaryOperatorType.Await;\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(awaitExpr.Location), UnaryOperatorExpression.AwaitRole), UnaryOperatorExpression.AwaitRole);\n\t\t\t\tif (awaitExpr.Expression != null)\n\t\t\t\t\tresult.AddChild((Expression)awaitExpr.Expression.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region XmlDoc\n\n\t\t\tpublic DocumentationReference ConvertXmlDoc(DocumentationBuilder doc)\n\t\t\t{\n\t\t\t\tvar result = new DocumentationReference();\n\t\t\t\tif (doc.ParsedName != null) {\n\t\t\t\t\tif (doc.ParsedName.Name == \"<this>\") {\n\t\t\t\t\t\tresult.SymbolKind = SymbolKind.Indexer;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.MemberName = doc.ParsedName.Name;\n\t\t\t\t\t}\n\t\t\t\t\tif (doc.ParsedName.Left != null) {\n\t\t\t\t\t\tresult.DeclaringType = ConvertToType(doc.ParsedName.Left);\n\t\t\t\t\t} else if (doc.ParsedBuiltinType != null) {\n\t\t\t\t\t\tresult.DeclaringType = ConvertToType(doc.ParsedBuiltinType);\n\t\t\t\t\t}\n\t\t\t\t\tif (doc.ParsedName.TypeParameters != null) {\n\t\t\t\t\t\tfor (int i = 0; i < doc.ParsedName.TypeParameters.Count; i++) {\n\t\t\t\t\t\t\tresult.TypeArguments.Add(ConvertToType(doc.ParsedName.TypeParameters [i]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (doc.ParsedBuiltinType != null) {\n\t\t\t\t\tresult.SymbolKind = SymbolKind.TypeDefinition;\n\t\t\t\t\tresult.DeclaringType = ConvertToType(doc.ParsedBuiltinType);\n\t\t\t\t}\n\t\t\t\tif (doc.ParsedParameters != null) {\n\t\t\t\t\tresult.HasParameterList = true;\n\t\t\t\t\tresult.Parameters.AddRange(doc.ParsedParameters.Select(ConvertXmlDocParameter));\n\t\t\t\t}\n\t\t\t\tif (doc.ParsedOperator != null) {\n\t\t\t\t\tresult.SymbolKind = SymbolKind.Operator;\n\t\t\t\t\tresult.OperatorType = (OperatorType)doc.ParsedOperator;\n\t\t\t\t\tif (result.OperatorType == OperatorType.Implicit || result.OperatorType == OperatorType.Explicit) {\n\t\t\t\t\t\tvar returnTypeParam = result.Parameters.LastOrNullObject();\n\t\t\t\t\t\treturnTypeParam.Remove(); // detach from parameter list\n\t\t\t\t\t\tvar returnType = returnTypeParam.Type;\n\t\t\t\t\t\treturnType.Remove();\n\t\t\t\t\t\tresult.ConversionOperatorReturnType = returnType;\n\t\t\t\t\t}\n\t\t\t\t\tif (result.Parameters.Count == 0) {\n\t\t\t\t\t\t// reset HasParameterList if necessary\n\t\t\t\t\t\tresult.HasParameterList = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tParameterDeclaration ConvertXmlDocParameter(DocumentationParameter p)\n\t\t\t{\n\t\t\t\tvar result = new ParameterDeclaration();\n\t\t\t\tswitch (p.Modifier) {\n\t\t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\t\tresult.ParameterModifier = ParameterModifier.Out;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\t\tresult.ParameterModifier = ParameterModifier.Ref;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Parameter.Modifier.PARAMS:\n\t\t\t\t\t\tresult.ParameterModifier = ParameterModifier.Params;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (p.Type != null) {\n\t\t\t\t\tresult.Type = ConvertToType(p.Type);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t}\n\n\t\tpublic CSharpParser()\n\t\t{\n\t\t\tcompilerSettings = new CompilerSettings();\n\t\t}\n\n\t\tpublic CSharpParser(CompilerSettings args)\n\t\t{\n\t\t\tcompilerSettings = args ?? new CompilerSettings();\n\t\t}\n\n\t\tvoid InsertComments(CompilerCompilationUnit top, ConversionVisitor conversionVisitor)\n\t\t{\n\t\t\tAstNode insertionPoint = conversionVisitor.Unit.FirstChild;\n\t\t\tforeach (var special in top.SpecialsBag.Specials) {\n\t\t\t\tAstNode newLeaf = null;\n\t\t\t\tRole role = null;\n\t\t\t\tbool isDocumentationComment = false;\n\t\t\t\tvar comment = special as SpecialsBag.Comment;\n\t\t\t\tif (comment != null) {\n\t\t\t\t\t// HACK: multiline documentation comment detection; better move this logic into the mcs tokenizer\n\t\t\t\t\tbool isMultilineDocumentationComment = (comment.CommentType == SpecialsBag.CommentType.Multi && comment.Content.StartsWith(\"*\", StringComparison.Ordinal) && !comment.Content.StartsWith(\"**\", StringComparison.Ordinal));\n\t\t\t\t\tisDocumentationComment = comment.CommentType == SpecialsBag.CommentType.Documentation || isMultilineDocumentationComment;\n\t\t\t\t\tif (conversionVisitor.convertTypeSystemMode && !isDocumentationComment)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar type = isMultilineDocumentationComment ? CommentType.MultiLineDocumentation : (CommentType)comment.CommentType;\n\t\t\t\t\tvar start = new TextLocation(comment.Line, comment.Col);\n\t\t\t\t\tvar end = new TextLocation(comment.EndLine, comment.EndCol);\n\t\t\t\t\tnewLeaf = new Comment(type, start, end) {\n\t\t\t\t\t\tStartsLine = comment.StartsLine,\n\t\t\t\t\t\tContent = isMultilineDocumentationComment ? comment.Content.Substring(1) : comment.Content\n\t\t\t\t\t};\n\t\t\t\t\trole = Roles.Comment;\n\t\t\t\t} else if (!GenerateTypeSystemMode) {\n\t\t\t\t\tvar pragmaDirective = special as SpecialsBag.PragmaPreProcessorDirective;\n\t\t\t\t\tif (pragmaDirective != null) {\n\t\t\t\t\t\tvar pragma = new PragmaWarningPreprocessorDirective(new TextLocation(pragmaDirective.Line, pragmaDirective.Col), new TextLocation(pragmaDirective.EndLine, pragmaDirective.EndCol));\n\t\t\t\t\t\tpragma.AddChild(new CSharpTokenNode(new TextLocation(pragmaDirective.Line, pragmaDirective.Col), PragmaWarningPreprocessorDirective.PragmaKeywordRole), PragmaWarningPreprocessorDirective.PragmaKeywordRole);\n\t\t\t\t\t\tpragma.AddChild(new CSharpTokenNode(new TextLocation(pragmaDirective.Line, pragmaDirective.WarningColumn), PragmaWarningPreprocessorDirective.WarningKeywordRole), PragmaWarningPreprocessorDirective.WarningKeywordRole);\n\t\t\t\t\t\tvar pragmaRole = pragmaDirective.Disalbe ? PragmaWarningPreprocessorDirective.DisableKeywordRole : PragmaWarningPreprocessorDirective.RestoreKeywordRole;\n\t\t\t\t\t\tpragma.AddChild(new CSharpTokenNode(new TextLocation(pragmaDirective.Line, pragmaDirective.DisableRestoreColumn), pragmaRole), pragmaRole);\n\t\t\t\t\t\tforeach (var code in pragmaDirective.Codes) {\n\t\t\t\t\t\t\tpragma.AddChild((PrimitiveExpression)conversionVisitor.Visit(code), PragmaWarningPreprocessorDirective.WarningRole);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewLeaf = pragma;\n\t\t\t\t\t\trole = Roles.PreProcessorDirective;\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\t\tvar lineDirective = special as SpecialsBag.LineProcessorDirective;\n\t\t\t\t\tif (lineDirective != null) {\n\t\t\t\t\t\tvar pragma = new LinePreprocessorDirective(new TextLocation(lineDirective.Line, lineDirective.Col), new TextLocation(lineDirective.EndLine, lineDirective.EndCol));\n\t\t\t\t\t\tpragma.LineNumber = lineDirective.LineNumber;\n\t\t\t\t\t\tpragma.FileName = lineDirective.FileName;\n\t\t\t\t\t\tnewLeaf = pragma;\n\t\t\t\t\t\trole = Roles.PreProcessorDirective;\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\t\tvar directive = special as SpecialsBag.PreProcessorDirective;\n\t\t\t\t\tif (directive != null) {\n\t\t\t\t\t\tnewLeaf = new PreProcessorDirective((PreProcessorDirectiveType)((int)directive.Cmd & 0xF), new TextLocation(directive.Line, directive.Col), new TextLocation(directive.EndLine, directive.EndCol)) {\n\t\t\t\t\t\t\tArgument = directive.Arg,\n\t\t\t\t\t\t\tTake = directive.Take\n\t\t\t\t\t\t};\n\t\t\t\t\t\trole = Roles.PreProcessorDirective;\n\t\t\t\t\t}\n\t\t\t\t\tend:\n\t\t\t\t\t;\n\t\t\t\t}\n\t\t\t\tif (newLeaf != null) {\n\t\t\t\t\tInsertComment(ref insertionPoint, newLeaf, role, isDocumentationComment, conversionVisitor.Unit);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!GenerateTypeSystemMode) {\n\t\t\t\t// We cannot insert newlines in the same loop as comments/preprocessor directives\n\t\t\t\t// because they are not correctly ordered in the specials bag\n\t\t\t\tinsertionPoint = conversionVisitor.Unit.FirstChild;\n\t\t\t\tfor (int i = 0; i < top.SpecialsBag.Specials.Count; i++) {\n\t\t\t\t\tvar newLine = top.SpecialsBag.Specials [i] as SpecialsBag.NewLineToken;\n\t\t\t\t\tif (newLine != null) {\n\t\t\t\t\t\tvar newLeaf = new NewLineNode(new TextLocation(newLine.Line, newLine.Col + 1));\n\t\t\t\t\t\tnewLeaf.NewLineType = newLine.NewLine == SpecialsBag.NewLine.Unix ? UnicodeNewline.LF : UnicodeNewline.CRLF;\n\t\t\t\t\t\tInsertComment(ref insertionPoint, newLeaf, Roles.NewLine, false, conversionVisitor.Unit);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic void InsertComment(ref AstNode insertionPoint, AstNode newNode, Role role, bool isDocumentationComment, AstNode rootNode)\n\t\t{\n\t\t\tTextLocation insertAt = newNode.StartLocation;\n\t\t\t// Advance insertionPoint to the first node that has a start location >= insertAt\n\t\t\twhile (insertionPoint != null && insertionPoint.StartLocation < insertAt) {\n\t\t\t\t// Enter the current node if insertAt is within\n\t\t\t\twhile (insertAt < insertionPoint.EndLocation && insertionPoint.FirstChild != null) {\n\t\t\t\t\tinsertionPoint = insertionPoint.FirstChild;\n\t\t\t\t}\n\t\t\t\t// Go to next node (insertionPoint.NextSibling if it exists; otherwise the next sibling of the parent node etc.)\n\t\t\t\tinsertionPoint = insertionPoint.GetNextNode();\n\t\t\t}\n\t\t\t// As a special case, XmlDoc gets inserted at the beginning of the entity declaration\n\t\t\tif (isDocumentationComment && insertionPoint is EntityDeclaration && insertionPoint.FirstChild != null) {\n\t\t\t\tinsertionPoint = insertionPoint.FirstChild;\n\t\t\t}\n\t\t\tif (insertionPoint == null) {\n\t\t\t\t// we're at the end of the compilation unit\n\t\t\t\trootNode.AddChildUnsafe(newNode, role);\n\t\t\t} else {\n\t\t\t\tinsertionPoint.Parent.InsertChildBeforeUnsafe(insertionPoint, newNode, role);\n\t\t\t}\n\t\t}\n\n\t\tpublic class ErrorReportPrinter : ReportPrinter\n\t\t{\n\t\t\treadonly string fileName;\n\t\t\tpublic readonly List<Error> Errors = new List<Error>();\n\n\t\t\tpublic ErrorReportPrinter(string fileName)\n\t\t\t{\n\t\t\t\tthis.fileName = fileName;\n\t\t\t}\n\n\t\t\tpublic override void Print(AbstractMessage msg, bool showFullPath)\n\t\t\t{\n\t\t\t\tbase.Print(msg, showFullPath);\n\t\t\t\tvar newError = new Error(msg.IsWarning ? ErrorType.Warning : ErrorType.Error, msg.Text, new DomRegion(fileName, msg.Location.Row, msg.Location.Column));\n\t\t\t\tErrors.Add(newError);\n\t\t\t}\n\t\t}\n\n\t\tErrorReportPrinter errorReportPrinter = new ErrorReportPrinter(null);\n\n\t\t[Obsolete(\"Use the Errors/Warnings/ErrorsAndWarnings properties instead\")]\n\t\tpublic ErrorReportPrinter ErrorPrinter {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasErrors {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.ErrorsCount > 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasWarnings {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.WarningsCount > 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Error> Errors {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.Errors.Where(e => e.ErrorType == ErrorType.Error);\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Error> Warnings {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.Errors.Where(e => e.ErrorType == ErrorType.Warning);\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Error> ErrorsAndWarnings {\n\t\t\tget { return errorReportPrinter.Errors; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"program\">The source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(string program, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(new StringTextSource(program), fileName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"reader\">The text reader containing the source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(TextReader reader, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(new StringTextSource(reader.ReadToEnd()), fileName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Converts a Mono.CSharp syntax tree into an NRefactory syntax tree.\n\t\t/// </summary>\n\t\tpublic SyntaxTree Parse(CompilerCompilationUnit top, string fileName)\n\t\t{\n\t\t\tif (top == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tCSharpParser.ConversionVisitor conversionVisitor = new ConversionVisitor(GenerateTypeSystemMode, top.LocationsBag);\n\t\t\ttop.ModuleCompiled.Accept(conversionVisitor);\n\t\t\tInsertComments(top, conversionVisitor);\n\t\t\tif (CompilationUnitCallback != null) {\n\t\t\t\tCompilationUnitCallback(top);\n\t\t\t}\n\t\t\tvar expr = top.LastYYValue as Mono.CSharp.Expression;\n\t\t\tif (expr != null)\n\t\t\t\tconversionVisitor.Unit.TopExpression = expr.Accept(conversionVisitor) as AstNode;\n\n\t\t\tconversionVisitor.Unit.FileName = fileName;\n\t\t\tvar conditionals = new List<string>();\n\t\t\tforeach (var settings in compilerSettings.ConditionalSymbols) {\n\t\t\t\tif (top.Conditionals.ContainsKey(settings) && !top.Conditionals [settings])\n\t\t\t\t\tcontinue;\n\t\t\t\tconditionals.Add(settings);\n\t\t\t}\n\t\t\tforeach (var kv in top.Conditionals) {\n\t\t\t\tif (!kv.Value || compilerSettings.ConditionalSymbols.Contains(kv.Key))\n\t\t\t\t\tcontinue;\n\t\t\t\tconditionals.Add(kv.Key);\n\t\t\t}\n\t\t\tconversionVisitor.Unit.ConditionalSymbols = conditionals;\n\t\t\treturn conversionVisitor.Unit;\n\t\t}\n\n\t\tpublic CompilerSettings CompilerSettings {\n\t\t\tget { return compilerSettings; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\tcompilerSettings = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Callback that gets called with the Mono.CSharp syntax tree whenever some code is parsed.\n\t\t/// </summary>\n\t\tpublic Action<CompilerCompilationUnit> CompilationUnitCallback {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Specifies whether to run the parser in a special mode for generating the type system.\n\t\t/// If this property is true, the syntax tree will only contain nodes relevant for the\n\t\t/// <see cref=\"SyntaxTree.ToTypeSystem()\"/> call and might be missing other nodes (e.g. method bodies).\n\t\t/// The default is false.\n\t\t/// </summary>\n\t\tpublic bool GenerateTypeSystemMode {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tTextLocation initialLocation = new TextLocation(1, 1);\n\n\t\t/// <summary>\n\t\t/// Specifies the text location where parsing starts.\n\t\t/// This property can be used when parsing a part of a file to make the locations of the AstNodes\n\t\t/// refer to the position in the whole file.\n\t\t/// The default is (1,1).\n\t\t/// </summary>\n\t\tpublic TextLocation InitialLocation {\n\t\t\tget { return initialLocation; }\n\t\t\tset { initialLocation = value; }\n\t\t}\n\n\t\tinternal static object parseLock = new object();\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"stream\">The stream containing the source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(Stream stream, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(new StreamReader(stream), fileName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"program\">The source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(ITextSource program, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(program, fileName, initialLocation.Line, initialLocation.Column);\n\t\t}\n\n\t\tSyntaxTree Parse(ITextSource program, string fileName, int initialLine, int initialColumn)\n\t\t{\n\t\t\tlock (parseLock) {\n\t\t\t\terrorReportPrinter = new ErrorReportPrinter(\"\");\n\t\t\t\tvar ctx = new CompilerContext(compilerSettings.ToMono(), errorReportPrinter);\n\t\t\t\tctx.Settings.TabSize = 1;\n\t\t\t\tvar reader = new SeekableStreamReader(program);\n\t\t\t\tvar file = new SourceFile(fileName, fileName, 0);\n\t\t\t\tLocation.Initialize(new List<SourceFile>(new [] { file }));\n\t\t\t\tvar module = new ModuleContainer(ctx);\n\t\t\t\tvar session = new ParserSession();\n\t\t\t\tsession.LocationsBag = new LocationsBag();\n\t\t\t\tvar report = new Report(ctx, errorReportPrinter);\n\t\t\t\tvar parser = Driver.Parse(reader, file, module, session, report, initialLine - 1, initialColumn - 1);\n\t\t\t\tvar top = new CompilerCompilationUnit {\n\t\t\t\t\tModuleCompiled = module,\n\t\t\t\t\tLocationsBag = session.LocationsBag,\n\t\t\t\t\tSpecialsBag = parser.Lexer.sbag,\n\t\t\t\t\tConditionals = parser.Lexer.SourceFile.Conditionals\n\t\t\t\t};\n\t\t\t\tvar unit = Parse(top, fileName);\n\t\t\t\tunit.Errors.AddRange(errorReportPrinter.Errors);\n\t\t\t\tCompilerCallableEntryPoint.Reset();\n\t\t\t\treturn unit;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<EntityDeclaration> ParseTypeMembers(string code)\n\t\t{\n\t\t\treturn ParseTypeMembers(code, initialLocation.Line, initialLocation.Column);\n\t\t}\n\n\t\tIEnumerable<EntityDeclaration> ParseTypeMembers(string code, int initialLine, int initialColumn)\n\t\t{\n\t\t\tconst string prefix = \"unsafe partial class MyClass { \";\n\t\t\tvar syntaxTree = Parse(new StringTextSource(prefix + code + \"}\"), \"parsed.cs\", initialLine, initialColumn - prefix.Length);\n\t\t\tif (syntaxTree == null)\n\t\t\t\treturn Enumerable.Empty<EntityDeclaration>();\n\t\t\tvar td = syntaxTree.FirstChild as TypeDeclaration;\n\t\t\tif (td != null) {\n\t\t\t\tvar members = td.Members.ToArray();\n\t\t\t\t// detach members from parent\n\t\t\t\tforeach (var m in members)\n\t\t\t\t\tm.Remove();\n\t\t\t\treturn members;\n\t\t\t}\n\t\t\treturn Enumerable.Empty<EntityDeclaration>();\n\t\t}\n\n\t\tpublic IEnumerable<Statement> ParseStatements(string code)\n\t\t{\n\t\t\treturn ParseStatements(code, initialLocation.Line, initialLocation.Column);\n\t\t}\n\n\t\tIEnumerable<Statement> ParseStatements(string code, int initialLine, int initialColumn)\n\t\t{\n\t\t\t// the dummy method is async so that 'await' expressions are parsed as expected\n\t\t\tconst string prefix = \"async void M() { \";\n\t\t\tvar members = ParseTypeMembers(prefix + code + \"}\", initialLine, initialColumn - prefix.Length);\n\t\t\tvar method = members.FirstOrDefault() as MethodDeclaration;\n\t\t\tif (method != null && method.Body != null) {\n\t\t\t\tvar statements = method.Body.Statements.ToArray();\n\t\t\t\t// detach statements from parent\n\t\t\t\tforeach (var st in statements)\n\t\t\t\t\tst.Remove();\n\t\t\t\treturn statements;\n\t\t\t}\n\t\t\treturn Enumerable.Empty<Statement>();\n\t\t}\n\n\t\tpublic AstType ParseTypeReference(string code)\n\t\t{\n\t\t\tvar members = ParseTypeMembers(code + \" a;\");\n\t\t\tvar field = members.FirstOrDefault() as FieldDeclaration;\n\t\t\tif (field != null) {\n\t\t\t\tAstType type = field.ReturnType;\n\t\t\t\ttype.Remove();\n\t\t\t\treturn type;\n\t\t\t}\n\t\t\treturn AstType.Null;\n\t\t}\n\n\t\tpublic Expression ParseExpression(string code)\n\t\t{\n\t\t\tconst string prefix = \"tmp = \";\n\t\t\tvar statements = ParseStatements(prefix + code + \";\", initialLocation.Line, initialLocation.Column - prefix.Length);\n\t\t\tvar es = statements.FirstOrDefault() as ExpressionStatement;\n\t\t\tif (es != null) {\n\t\t\t\tvar ae = es.Expression as AssignmentExpression;\n\t\t\t\tif (ae != null) {\n\t\t\t\t\tExpression expr = ae.Right;\n\t\t\t\t\texpr.Remove();\n\t\t\t\t\treturn expr;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Expression.Null;\n\t\t}\n\t\t/*\n\t\t/// <summary>\n\t\t/// Parses a file snippet; guessing what the code snippet represents (whole file, type members, block, type reference, expression).\n\t\t/// </summary>\n\t\tpublic AstNode ParseSnippet (string code)\n\t\t{\n\t\t\t// TODO: add support for parsing a part of a file\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\t */\n\t\tpublic DocumentationReference ParseDocumentationReference(string cref)\n\t\t{\n\t\t\t// see Mono.CSharp.DocumentationBuilder.HandleXrefCommon\n\t\t\tif (cref == null)\n\t\t\t\tthrow new ArgumentNullException(\"cref\");\n\t\t\t\n\t\t\t// Additional symbols for < and > are allowed for easier XML typing\n\t\t\tcref = cref.Replace('{', '<').Replace('}', '>');\n\t\t\t\n\t\t\tlock (parseLock) {\n\t\t\t\terrorReportPrinter = new ErrorReportPrinter(\"\");\n\t\t\t\tvar ctx = new CompilerContext(compilerSettings.ToMono(), errorReportPrinter);\n\t\t\t\tctx.Settings.TabSize = 1;\n\t\t\t\tvar reader = new SeekableStreamReader(new StringTextSource(cref));\n\t\t\t\tvar file = new SourceFile(\"\", \"\", 0);\n\t\t\t\tLocation.Initialize(new List<SourceFile>(new [] { file }));\n\t\t\t\tvar module = new ModuleContainer(ctx);\n\t\t\t\tmodule.DocumentationBuilder = new DocumentationBuilder(module);\n\t\t\t\tvar source_file = new CompilationSourceFile(module);\n\t\t\t\tvar report = new Report(ctx, errorReportPrinter);\n\t\t\t\tvar session = new ParserSession();\n\t\t\t\tsession.LocationsBag = new LocationsBag();\n\t\t\t\tvar parser = new Mono.CSharp.CSharpParser(reader, source_file, report, session);\n\t\t\t\tparser.Lexer.Line += initialLocation.Line - 1;\n\t\t\t\tparser.Lexer.Column += initialLocation.Column - 1;\n\t\t\t\tparser.Lexer.putback_char = Tokenizer.DocumentationXref;\n\t\t\t\tparser.Lexer.parsing_generic_declaration_doc = true;\n\t\t\t\tparser.parse();\n\t\t\t\tif (report.Errors > 0) {\n//\t\t\t\t\tReport.Warning (1584, 1, mc.Location, \"XML comment on `{0}' has syntactically incorrect cref attribute `{1}'\",\n//\t\t\t\t\t                mc.GetSignatureForError (), cref);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar conversionVisitor = new ConversionVisitor(false, session.LocationsBag);\n\t\t\t\tvar docRef = conversionVisitor.ConvertXmlDoc(module.DocumentationBuilder);\n\t\t\t\tCompilerCallableEntryPoint.Reset();\n\t\t\t\treturn docRef;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CompilerSettings.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// C# compiler settings.\n\t/// </summary>\n\t[Serializable]\n\tpublic class CompilerSettings : AbstractFreezable\n\t{\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tconditionalSymbols = FreezableHelper.FreezeList(conditionalSymbols);\n\t\t\tspecificWarningsAsErrors = FreezableHelper.FreezeList(specificWarningsAsErrors);\n\t\t\tdisabledWarnings = FreezableHelper.FreezeList(disabledWarnings);\n\t\t\tbase.FreezeInternal();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new CompilerSettings instance.\n\t\t/// </summary>\n\t\tpublic CompilerSettings()\n\t\t{\n\t\t}\n\t\t\n\t\tbool allowUnsafeBlocks = true;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether <c>unsafe</c> code is allowed.\n\t\t/// The default is <c>true</c>. If set to false, parsing unsafe code will result in parser errors.\n\t\t/// </summary>\n\t\tpublic bool AllowUnsafeBlocks {\n\t\t\tget { return allowUnsafeBlocks; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tallowUnsafeBlocks = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool checkForOverflow;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether overflow checking is enabled.\n\t\t/// The default is <c>false</c>. This setting effects semantic analysis.\n\t\t/// </summary>\n\t\tpublic bool CheckForOverflow {\n\t\t\tget { return checkForOverflow; }\n\t\t\tset { checkForOverflow = value; }\n\t\t}\n\t\t\n\t\tVersion languageVersion = new Version((int)Mono.CSharp.LanguageVersion.Default, 0);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the language version used by the parser.\n\t\t/// Using language constructs newer than the supplied version will result in parser errors.\n\t\t/// </summary>\n\t\tpublic Version LanguageVersion {\n\t\t\tget { return languageVersion; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\tlanguageVersion = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<string> conditionalSymbols = new List<string>();\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the list of conditional symbols that are defined project-wide.\n\t\t/// </summary>\n\t\tpublic IList<string> ConditionalSymbols {\n\t\t\tget { return conditionalSymbols; }\n\t\t}\n\t\t\n\t\tbool treatWarningsAsErrors;\n\t\t\n\t\tpublic bool TreatWarningsAsErrors {\n\t\t\tget { return treatWarningsAsErrors; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\ttreatWarningsAsErrors = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<int> specificWarningsAsErrors = new List<int>();\n\t\t\n\t\t/// <summary>\n\t\t/// Allows treating specific warnings as errors without setting <see cref=\"TreatWarningsAsErrors\"/> to true.\n\t\t/// </summary>\n\t\tpublic IList<int> SpecificWarningsAsErrors {\n\t\t\tget { return specificWarningsAsErrors; }\n\t\t}\n\t\t\n\t\tint warningLevel = 4;\n\t\t\n\t\tpublic int WarningLevel {\n\t\t\tget { return warningLevel; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\twarningLevel = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<int> disabledWarnings = new List<int>();\n\t\t\n\t\t/// <summary>\n\t\t/// Disables the specified warnings.\n\t\t/// </summary>\n\t\tpublic IList<int> DisabledWarnings {\n\t\t\tget { return disabledWarnings; }\n\t\t}\n\t\t\n\t\tinternal Mono.CSharp.CompilerSettings ToMono()\n\t\t{\n\t\t\tvar s = new Mono.CSharp.CompilerSettings();\n\t\t\ts.Unsafe = allowUnsafeBlocks;\n\t\t\ts.Checked = checkForOverflow;\n\t\t\ts.Version = (Mono.CSharp.LanguageVersion)languageVersion.Major;\n\t\t\ts.WarningsAreErrors = treatWarningsAsErrors;\n\t\t\ts.WarningLevel = warningLevel;\n\t\t\tforeach (int code in disabledWarnings)\n\t\t\t\ts.SetIgnoreWarning(code);\n\t\t\tforeach (int code in specificWarningsAsErrors)\n\t\t\t\ts.AddWarningAsError(code);\n\t\t\tforeach (string sym in conditionalSymbols)\n\t\t\t\ts.AddConditionalSymbol(sym);\n\t\t\treturn s;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/SeekableStreamReader.cs",
    "content": "//\n// SeekableStreamReader.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Editor;\nusing System.IO;\nusing System.Text;\n\nnamespace Mono.CSharp\n{\n\tpublic class SeekableStreamReader : IDisposable\n\t{\n\t\tpublic const int DefaultReadAheadSize = 2048;\n\n\t\treadonly ITextSource textSource;\n\n\t\tint pos;\n\n\t\tstatic string GetAllText(Stream stream, Encoding encoding) {\n\t\t\tusing (var rdr = new StreamReader(stream, encoding)) {\n\t\t\t\treturn rdr.ReadToEnd();\n\t\t\t}\n\t\t}\n\n\t\tpublic SeekableStreamReader (Stream stream, Encoding encoding, char[] sharedBuffer = null) : this(new StringTextSource(GetAllText(stream, encoding)))\n\t\t{\n\t\t}\n\n\t\tpublic SeekableStreamReader (ITextSource source)\n\t\t{\n\t\t\tthis.textSource = source;\n\t\t}\n\n\n\t\tpublic void Dispose ()\n\t\t{\n\t\t}\n\t\t\n\t\t/// <remarks>\n\t\t///   This value corresponds to the current position in a stream of characters.\n\t\t///   The StreamReader hides its manipulation of the underlying byte stream and all\n\t\t///   character set/decoding issues.  Thus, we cannot use this position to guess at\n\t\t///   the corresponding position in the underlying byte stream even though there is\n\t\t///   a correlation between them.\n\t\t/// </remarks>\n\t\tpublic int Position {\n\t\t\tget {\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t\t\n\t\t\tset {\n\t\t\t\tpos = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic char GetChar (int position)\n\t\t{\n\t\t\treturn textSource.GetCharAt (position);\n\t\t}\n\t\t\n\t\tpublic char[] ReadChars (int fromPosition, int toPosition)\n\t\t{\n\t\t\treturn textSource.GetText (fromPosition, toPosition - fromPosition).ToCharArray ();\n\t\t}\n\t\t\n\t\tpublic int Peek ()\n\t\t{\n\t\t\tif (pos >= textSource.TextLength)\n\t\t\t\treturn -1;\n\t\t\treturn textSource.GetCharAt (pos);\n\t\t}\n\t\t\n\t\tpublic int Read ()\n\t\t{\n\t\t\tif (pos >= textSource.TextLength)\n\t\t\t\treturn -1;\n\t\t\treturn textSource.GetCharAt (pos++);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/CryptoConvert.cs",
    "content": "//\n// CryptoConvert.cs - Crypto Convertion Routines\n//\n// Author:\n//\tSebastien Pouliot  <sebastien@ximian.com>\n//\n// (C) 2003 Motus Technologies Inc. (http://www.motus.com)\n// Copyright (C) 2004-2006 Novell Inc. (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing System.Globalization;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace Mono.Security.Cryptography {\n\n#if INSIDE_CORLIB\n\tinternal\n#else\n\tpublic\n#endif\n\tsealed class CryptoConvert {\n\n\t\tprivate CryptoConvert () \n\t\t{\n\t\t}\n\n\t\tstatic private int ToInt32LE (byte [] bytes, int offset)\n\t\t{\n\t\t\treturn (bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset];\n\t\t}\n\n\t\tstatic private uint ToUInt32LE (byte [] bytes, int offset)\n\t\t{\n\t\t\treturn (uint)((bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset]);\n\t\t}\n\n\t\tstatic private byte [] GetBytesLE (int val)\n\t\t{\n\t\t\treturn new byte [] { \n\t\t\t\t(byte) (val & 0xff), \n\t\t\t\t(byte) ((val >> 8) & 0xff), \n\t\t\t\t(byte) ((val >> 16) & 0xff), \n\t\t\t\t(byte) ((val >> 24) & 0xff)\n\t\t\t};\n                }\n\n\t\tstatic private byte[] Trim (byte[] array) \n\t\t{\n\t\t\tfor (int i=0; i < array.Length; i++) {\n\t\t\t\tif (array [i] != 0x00) {\n\t\t\t\t\tbyte[] result = new byte [array.Length - i];\n\t\t\t\t\tBuffer.BlockCopy (array, i, result, 0, result.Length);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t// convert the key from PRIVATEKEYBLOB to RSA\n\t\t// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/private_key_blobs.asp\n\t\t// e.g. SNK files, PVK files\n\t\tstatic public RSA FromCapiPrivateKeyBlob (byte[] blob) \n\t\t{\n\t\t\treturn FromCapiPrivateKeyBlob (blob, 0);\n\t\t}\n\n\t\tstatic public RSA FromCapiPrivateKeyBlob (byte[] blob, int offset) \n\t\t{\n\t\t\tif (blob == null)\n\t\t\t\tthrow new ArgumentNullException (\"blob\");\n\t\t\tif (offset >= blob.Length)\n\t\t\t\tthrow new ArgumentException (\"blob is too small.\");\n\n\t\t\tRSAParameters rsap = new RSAParameters ();\n\t\t\ttry {\n\t\t\t\tif ((blob [offset]   != 0x07) ||\t\t\t\t// PRIVATEKEYBLOB (0x07)\n\t\t\t\t    (blob [offset+1] != 0x02) ||\t\t\t\t// Version (0x02)\n\t\t\t\t    (blob [offset+2] != 0x00) ||\t\t\t\t// Reserved (word)\n\t\t\t\t    (blob [offset+3] != 0x00) ||\n\t\t\t\t    (ToUInt32LE (blob, offset+8) != 0x32415352))\t// DWORD magic = RSA2\n\t\t\t\t\tthrow new CryptographicException (\"Invalid blob header\");\n\t\t\t\t\n\t\t\t\t// ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)\n\t\t\t\t// int algId = ToInt32LE (blob, offset+4);\n\n\t\t\t\t// DWORD bitlen\n\t\t\t\tint bitLen = ToInt32LE (blob, offset+12);\n\n\t\t\t\t// DWORD public exponent\n\t\t\t\tbyte[] exp = new byte [4];\n\t\t\t\tBuffer.BlockCopy (blob, offset+16, exp, 0, 4);\n\t\t\t\tArray.Reverse (exp);\n\t\t\t\trsap.Exponent = Trim (exp);\n\t\t\t\n\t\t\t\tint pos = offset+20;\n\t\t\t\t// BYTE modulus[rsapubkey.bitlen/8];\n\t\t\t\tint byteLen = (bitLen >> 3);\n\t\t\t\trsap.Modulus = new byte [byteLen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);\n\t\t\t\tArray.Reverse (rsap.Modulus);\n\t\t\t\tpos += byteLen;\n\n\t\t\t\t// BYTE prime1[rsapubkey.bitlen/16];\n\t\t\t\tint byteHalfLen = (byteLen >> 1);\n\t\t\t\trsap.P = new byte [byteHalfLen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.P, 0, byteHalfLen);\n\t\t\t\tArray.Reverse (rsap.P);\n\t\t\t\tpos += byteHalfLen;\n\n\t\t\t\t// BYTE prime2[rsapubkey.bitlen/16];\n\t\t\t\trsap.Q = new byte [byteHalfLen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.Q, 0, byteHalfLen);\n\t\t\t\tArray.Reverse (rsap.Q);\n\t\t\t\tpos += byteHalfLen;\n\n\t\t\t\t// BYTE exponent1[rsapubkey.bitlen/16];\n\t\t\t\trsap.DP = new byte [byteHalfLen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.DP, 0, byteHalfLen);\n\t\t\t\tArray.Reverse (rsap.DP);\n\t\t\t\tpos += byteHalfLen;\n\n\t\t\t\t// BYTE exponent2[rsapubkey.bitlen/16];\n\t\t\t\trsap.DQ = new byte [byteHalfLen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.DQ, 0, byteHalfLen);\n\t\t\t\tArray.Reverse (rsap.DQ);\n\t\t\t\tpos += byteHalfLen;\n\n\t\t\t\t// BYTE coefficient[rsapubkey.bitlen/16];\n\t\t\t\trsap.InverseQ = new byte [byteHalfLen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.InverseQ, 0, byteHalfLen);\n\t\t\t\tArray.Reverse (rsap.InverseQ);\n\t\t\t\tpos += byteHalfLen;\n\n\t\t\t\t// ok, this is hackish but CryptoAPI support it so...\n\t\t\t\t// note: only works because CRT is used by default\n\t\t\t\t// http://bugzilla.ximian.com/show_bug.cgi?id=57941\n\t\t\t\trsap.D = new byte [byteLen]; // must be allocated\n\t\t\t\tif (pos + byteLen + offset <= blob.Length) {\n\t\t\t\t\t// BYTE privateExponent[rsapubkey.bitlen/8];\n\t\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.D, 0, byteLen);\n\t\t\t\t\tArray.Reverse (rsap.D);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow new CryptographicException (\"Invalid blob.\", e);\n\t\t\t}\n\n#if NET_2_1\n\t\t\tRSA rsa = RSA.Create ();\n\t\t\trsa.ImportParameters (rsap);\n#else\n\t\t\tRSA rsa = null;\n\t\t\ttry {\n\t\t\t\trsa = RSA.Create ();\n\t\t\t\trsa.ImportParameters (rsap);\n\t\t\t}\n\t\t\tcatch (CryptographicException ce) {\n\t\t\t\t// this may cause problem when this code is run under\n\t\t\t\t// the SYSTEM identity on Windows (e.g. ASP.NET). See\n\t\t\t\t// http://bugzilla.ximian.com/show_bug.cgi?id=77559\n\t\t\t\ttry {\n\t\t\t\t\tCspParameters csp = new CspParameters ();\n\t\t\t\t\tcsp.Flags = CspProviderFlags.UseMachineKeyStore;\n\t\t\t\t\trsa = new RSACryptoServiceProvider (csp);\n\t\t\t\t\trsa.ImportParameters (rsap);\n\t\t\t\t}\n\t\t\t\tcatch {\n\t\t\t\t\t// rethrow original, not the later, exception if this fails\n\t\t\t\t\tthrow ce;\n\t\t\t\t}\n\t\t\t}\n#endif\n\t\t\treturn rsa;\n\t\t}\n\n\t\tstatic public DSA FromCapiPrivateKeyBlobDSA (byte[] blob)\n\t\t{\n\t\t\treturn FromCapiPrivateKeyBlobDSA (blob, 0);\n\t\t}\n\n\t\tstatic public DSA FromCapiPrivateKeyBlobDSA (byte[] blob, int offset)\n\t\t{\n\t\t\tif (blob == null)\n\t\t\t\tthrow new ArgumentNullException (\"blob\");\n\t\t\tif (offset >= blob.Length)\n\t\t\t\tthrow new ArgumentException (\"blob is too small.\");\n\n\t\t\tDSAParameters dsap = new DSAParameters ();\n\t\t\ttry {\n\t\t\t\tif ((blob [offset] != 0x07) ||\t\t\t\t// PRIVATEKEYBLOB (0x07)\n\t\t\t\t    (blob [offset + 1] != 0x02) ||\t\t\t// Version (0x02)\n\t\t\t\t    (blob [offset + 2] != 0x00) ||\t\t\t// Reserved (word)\n\t\t\t\t    (blob [offset + 3] != 0x00) ||\n\t\t\t\t    (ToUInt32LE (blob, offset + 8) != 0x32535344))\t// DWORD magic\n\t\t\t\t\tthrow new CryptographicException (\"Invalid blob header\");\n\n\t\t\t\tint bitlen = ToInt32LE (blob, offset + 12);\n\t\t\t\tint bytelen = bitlen >> 3;\n\t\t\t\tint pos = offset + 16;\n\n\t\t\t\tdsap.P = new byte [bytelen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.P, 0, bytelen);\n\t\t\t\tArray.Reverse (dsap.P);\n\t\t\t\tpos += bytelen;\n\n\t\t\t\tdsap.Q = new byte [20];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.Q, 0, 20);\n\t\t\t\tArray.Reverse (dsap.Q);\n\t\t\t\tpos += 20;\n\n\t\t\t\tdsap.G = new byte [bytelen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.G, 0, bytelen);\n\t\t\t\tArray.Reverse (dsap.G);\n\t\t\t\tpos += bytelen;\n\n\t\t\t\tdsap.X = new byte [20];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.X, 0, 20);\n\t\t\t\tArray.Reverse (dsap.X);\n\t\t\t\tpos += 20;\n\n\t\t\t\tdsap.Counter = ToInt32LE (blob, pos);\n\t\t\t\tpos += 4;\n\n\t\t\t\tdsap.Seed = new byte [20];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.Seed, 0, 20);\n\t\t\t\tArray.Reverse (dsap.Seed);\n\t\t\t\tpos += 20;\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow new CryptographicException (\"Invalid blob.\", e);\n\t\t\t}\n\n#if NET_2_1\n\t\t\tDSA dsa = (DSA)DSA.Create ();\n\t\t\tdsa.ImportParameters (dsap);\n#else\n\t\t\tDSA dsa = null;\n\t\t\ttry {\n\t\t\t\tdsa = (DSA)DSA.Create ();\n\t\t\t\tdsa.ImportParameters (dsap);\n\t\t\t}\n\t\t\tcatch (CryptographicException ce) {\n\t\t\t\t// this may cause problem when this code is run under\n\t\t\t\t// the SYSTEM identity on Windows (e.g. ASP.NET). See\n\t\t\t\t// http://bugzilla.ximian.com/show_bug.cgi?id=77559\n\t\t\t\ttry {\n\t\t\t\t\tCspParameters csp = new CspParameters ();\n\t\t\t\t\tcsp.Flags = CspProviderFlags.UseMachineKeyStore;\n\t\t\t\t\tdsa = new DSACryptoServiceProvider (csp);\n\t\t\t\t\tdsa.ImportParameters (dsap);\n\t\t\t\t}\n\t\t\t\tcatch {\n\t\t\t\t\t// rethrow original, not the later, exception if this fails\n\t\t\t\t\tthrow ce;\n\t\t\t\t}\n\t\t\t}\n#endif\n\t\t\treturn dsa;\n\t\t}\n\n\t\tstatic public byte[] ToCapiPrivateKeyBlob (RSA rsa) \n\t\t{\n\t\t\tRSAParameters p = rsa.ExportParameters (true);\n\t\t\tint keyLength = p.Modulus.Length; // in bytes\n\t\t\tbyte[] blob = new byte [20 + (keyLength << 2) + (keyLength >> 1)];\n\n\t\t\tblob [0] = 0x07;\t// Type - PRIVATEKEYBLOB (0x07)\n\t\t\tblob [1] = 0x02;\t// Version - Always CUR_BLOB_VERSION (0x02)\n\t\t\t// [2], [3]\t\t// RESERVED - Always 0\n\t\t\tblob [5] = 0x24;\t// ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)\n\t\t\tblob [8] = 0x52;\t// Magic - RSA2 (ASCII in hex)\n\t\t\tblob [9] = 0x53;\n\t\t\tblob [10] = 0x41;\n\t\t\tblob [11] = 0x32;\n\n\t\t\tbyte[] bitlen = GetBytesLE (keyLength << 3);\n\t\t\tblob [12] = bitlen [0];\t// bitlen\n\t\t\tblob [13] = bitlen [1];\t\n\t\t\tblob [14] = bitlen [2];\t\n\t\t\tblob [15] = bitlen [3];\n\n\t\t\t// public exponent (DWORD)\n\t\t\tint pos = 16;\n\t\t\tint n = p.Exponent.Length;\n\t\t\twhile (n > 0)\n\t\t\t\tblob [pos++] = p.Exponent [--n];\n\t\t\t// modulus\n\t\t\tpos = 20;\n\t\t\tbyte[] part = p.Modulus;\n\t\t\tint len = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\t\t\tpos += len;\n\t\t\t// private key\n\t\t\tpart = p.P;\n\t\t\tlen = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\t\t\tpos += len;\n\n\t\t\tpart = p.Q;\n\t\t\tlen = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\t\t\tpos += len;\n\n\t\t\tpart = p.DP;\n\t\t\tlen = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\t\t\tpos += len;\n\n\t\t\tpart = p.DQ;\n\t\t\tlen = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\t\t\tpos += len;\n\n\t\t\tpart = p.InverseQ;\n\t\t\tlen = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\t\t\tpos += len;\n\n\t\t\tpart = p.D;\n\t\t\tlen = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\n\t\t\treturn blob;\n\t\t}\n\n\t\tstatic public byte[] ToCapiPrivateKeyBlob (DSA dsa)\n\t\t{\n\t\t\tDSAParameters p = dsa.ExportParameters (true);\n\t\t\tint keyLength = p.P.Length; // in bytes\n\n\t\t\t// header + P + Q + G + X + count + seed\n\t\t\tbyte[] blob = new byte [16 + keyLength + 20 + keyLength + 20 + 4 + 20];\n\n\t\t\tblob [0] = 0x07;\t// Type - PRIVATEKEYBLOB (0x07)\n\t\t\tblob [1] = 0x02;\t// Version - Always CUR_BLOB_VERSION (0x02)\n\t\t\t// [2], [3]\t\t// RESERVED - Always 0\n\t\t\tblob [5] = 0x22;\t// ALGID\n\t\t\tblob [8] = 0x44;\t// Magic\n\t\t\tblob [9] = 0x53;\n\t\t\tblob [10] = 0x53;\n\t\t\tblob [11] = 0x32;\n\n\t\t\tbyte[] bitlen = GetBytesLE (keyLength << 3);\n\t\t\tblob [12] = bitlen [0];\n\t\t\tblob [13] = bitlen [1];\n\t\t\tblob [14] = bitlen [2];\n\t\t\tblob [15] = bitlen [3];\n\n\t\t\tint pos = 16;\n\t\t\tbyte[] part = p.P;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, keyLength);\n\t\t\tpos += keyLength;\n\n\t\t\tpart = p.Q;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, 20);\n\t\t\tpos += 20;\n\n\t\t\tpart = p.G;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, keyLength);\n\t\t\tpos += keyLength;\n\n\t\t\tpart = p.X;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, 20);\n\t\t\tpos += 20;\n\n\t\t\tBuffer.BlockCopy (GetBytesLE (p.Counter), 0, blob, pos, 4);\n\t\t\tpos += 4;\n\n\t\t\tpart = p.Seed;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, 20);\n\n\t\t\treturn blob;\n\t\t}\n\n\t\tstatic public RSA FromCapiPublicKeyBlob (byte[] blob) \n\t\t{\n\t\t\treturn FromCapiPublicKeyBlob (blob, 0);\n\t\t}\n\n\t\tstatic public RSA FromCapiPublicKeyBlob (byte[] blob, int offset) \n\t\t{\n\t\t\tif (blob == null)\n\t\t\t\tthrow new ArgumentNullException (\"blob\");\n\t\t\tif (offset >= blob.Length)\n\t\t\t\tthrow new ArgumentException (\"blob is too small.\");\n\n\t\t\ttry {\n\t\t\t\tif ((blob [offset]   != 0x06) ||\t\t\t\t// PUBLICKEYBLOB (0x06)\n\t\t\t\t    (blob [offset+1] != 0x02) ||\t\t\t\t// Version (0x02)\n\t\t\t\t    (blob [offset+2] != 0x00) ||\t\t\t\t// Reserved (word)\n\t\t\t\t    (blob [offset+3] != 0x00) || \n\t\t\t\t    (ToUInt32LE (blob, offset+8) != 0x31415352))\t// DWORD magic = RSA1\n\t\t\t\t\tthrow new CryptographicException (\"Invalid blob header\");\n\n\t\t\t\t// ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)\n\t\t\t\t// int algId = ToInt32LE (blob, offset+4);\n\n\t\t\t\t// DWORD bitlen\n\t\t\t\tint bitLen = ToInt32LE (blob, offset+12);\n\n\t\t\t\t// DWORD public exponent\n\t\t\t\tRSAParameters rsap = new RSAParameters ();\n\t\t\t\trsap.Exponent = new byte [3];\n\t\t\t\trsap.Exponent [0] = blob [offset+18];\n\t\t\t\trsap.Exponent [1] = blob [offset+17];\n\t\t\t\trsap.Exponent [2] = blob [offset+16];\n\t\t\t\n\t\t\t\tint pos = offset+20;\n\t\t\t\t// BYTE modulus[rsapubkey.bitlen/8];\n\t\t\t\tint byteLen = (bitLen >> 3);\n\t\t\t\trsap.Modulus = new byte [byteLen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);\n\t\t\t\tArray.Reverse (rsap.Modulus);\n#if NET_2_1\n\t\t\t\tRSA rsa = RSA.Create ();\n\t\t\t\trsa.ImportParameters (rsap);\n#else\n\t\t\t\tRSA rsa = null;\n\t\t\t\ttry {\n\t\t\t\t\trsa = RSA.Create ();\n\t\t\t\t\trsa.ImportParameters (rsap);\n\t\t\t\t}\n\t\t\t\tcatch (CryptographicException) {\n\t\t\t\t\t// this may cause problem when this code is run under\n\t\t\t\t\t// the SYSTEM identity on Windows (e.g. ASP.NET). See\n\t\t\t\t\t// http://bugzilla.ximian.com/show_bug.cgi?id=77559\n\t\t\t\t\tCspParameters csp = new CspParameters ();\n\t\t\t\t\tcsp.Flags = CspProviderFlags.UseMachineKeyStore;\n\t\t\t\t\trsa = new RSACryptoServiceProvider (csp);\n\t\t\t\t\trsa.ImportParameters (rsap);\n\t\t\t\t}\n#endif\n\t\t\t\treturn rsa;\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow new CryptographicException (\"Invalid blob.\", e);\n\t\t\t}\n\t\t}\n\n\t\tstatic public DSA FromCapiPublicKeyBlobDSA (byte[] blob)\n\t\t{\n\t\t\treturn FromCapiPublicKeyBlobDSA (blob, 0);\n\t\t}\n\n\t\tstatic public DSA FromCapiPublicKeyBlobDSA (byte[] blob, int offset)\n\t\t{\n\t\t\tif (blob == null)\n\t\t\t\tthrow new ArgumentNullException (\"blob\");\n\t\t\tif (offset >= blob.Length)\n\t\t\t\tthrow new ArgumentException (\"blob is too small.\");\n\n\t\t\ttry {\n\t\t\t\tif ((blob [offset] != 0x06) ||\t\t\t\t// PUBLICKEYBLOB (0x06)\n\t\t\t\t    (blob [offset + 1] != 0x02) ||\t\t\t// Version (0x02)\n\t\t\t\t    (blob [offset + 2] != 0x00) ||\t\t\t// Reserved (word)\n\t\t\t\t    (blob [offset + 3] != 0x00) ||\n\t\t\t\t    (ToUInt32LE (blob, offset + 8) != 0x31535344))\t// DWORD magic\n\t\t\t\t\tthrow new CryptographicException (\"Invalid blob header\");\n\n\t\t\t\tint bitlen = ToInt32LE (blob, offset + 12);\n\t\t\t\tDSAParameters dsap = new DSAParameters ();\n\t\t\t\tint bytelen = bitlen >> 3;\n\t\t\t\tint pos = offset + 16;\n\n\t\t\t\tdsap.P = new byte [bytelen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.P, 0, bytelen);\n\t\t\t\tArray.Reverse (dsap.P);\n\t\t\t\tpos += bytelen;\n\n\t\t\t\tdsap.Q = new byte [20];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.Q, 0, 20);\n\t\t\t\tArray.Reverse (dsap.Q);\n\t\t\t\tpos += 20;\n\n\t\t\t\tdsap.G = new byte [bytelen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.G, 0, bytelen);\n\t\t\t\tArray.Reverse (dsap.G);\n\t\t\t\tpos += bytelen;\n\n\t\t\t\tdsap.Y = new byte [bytelen];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.Y, 0, bytelen);\n\t\t\t\tArray.Reverse (dsap.Y);\n\t\t\t\tpos += bytelen;\n\n\t\t\t\tdsap.Counter = ToInt32LE (blob, pos);\n\t\t\t\tpos += 4;\n\n\t\t\t\tdsap.Seed = new byte [20];\n\t\t\t\tBuffer.BlockCopy (blob, pos, dsap.Seed, 0, 20);\n\t\t\t\tArray.Reverse (dsap.Seed);\n\t\t\t\tpos += 20;\n\n\t\t\t\tDSA dsa = (DSA)DSA.Create ();\n\t\t\t\tdsa.ImportParameters (dsap);\n\t\t\t\treturn dsa;\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow new CryptographicException (\"Invalid blob.\", e);\n\t\t\t}\n\t\t}\n\n\t\tstatic public byte[] ToCapiPublicKeyBlob (RSA rsa) \n\t\t{\n\t\t\tRSAParameters p = rsa.ExportParameters (false);\n\t\t\tint keyLength = p.Modulus.Length; // in bytes\n\t\t\tbyte[] blob = new byte [20 + keyLength];\n\n\t\t\tblob [0] = 0x06;\t// Type - PUBLICKEYBLOB (0x06)\n\t\t\tblob [1] = 0x02;\t// Version - Always CUR_BLOB_VERSION (0x02)\n\t\t\t// [2], [3]\t\t// RESERVED - Always 0\n\t\t\tblob [5] = 0x24;\t// ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)\n\t\t\tblob [8] = 0x52;\t// Magic - RSA1 (ASCII in hex)\n\t\t\tblob [9] = 0x53;\n\t\t\tblob [10] = 0x41;\n\t\t\tblob [11] = 0x31;\n\n\t\t\tbyte[] bitlen = GetBytesLE (keyLength << 3);\n\t\t\tblob [12] = bitlen [0];\t// bitlen\n\t\t\tblob [13] = bitlen [1];\t\n\t\t\tblob [14] = bitlen [2];\t\n\t\t\tblob [15] = bitlen [3];\n\n\t\t\t// public exponent (DWORD)\n\t\t\tint pos = 16;\n\t\t\tint n = p.Exponent.Length;\n\t\t\twhile (n > 0)\n\t\t\t\tblob [pos++] = p.Exponent [--n];\n\t\t\t// modulus\n\t\t\tpos = 20;\n\t\t\tbyte[] part = p.Modulus;\n\t\t\tint len = part.Length;\n\t\t\tArray.Reverse (part, 0, len);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, len);\n\t\t\tpos += len;\n\t\t\treturn blob;\n\t\t}\n\n\t\tstatic public byte[] ToCapiPublicKeyBlob (DSA dsa)\n\t\t{\n\t\t\tDSAParameters p = dsa.ExportParameters (false);\n\t\t\tint keyLength = p.P.Length; // in bytes\n\n\t\t\t// header + P + Q + G + Y + count + seed\n\t\t\tbyte[] blob = new byte [16 + keyLength + 20 + keyLength + keyLength + 4 + 20];\n\n\t\t\tblob [0] = 0x06;\t// Type - PUBLICKEYBLOB (0x06)\n\t\t\tblob [1] = 0x02;\t// Version - Always CUR_BLOB_VERSION (0x02)\n\t\t\t// [2], [3]\t\t// RESERVED - Always 0\n\t\t\tblob [5] = 0x22;\t// ALGID\n\t\t\tblob [8] = 0x44;\t// Magic\n\t\t\tblob [9] = 0x53;\n\t\t\tblob [10] = 0x53;\n\t\t\tblob [11] = 0x31;\n\n\t\t\tbyte[] bitlen = GetBytesLE (keyLength << 3);\n\t\t\tblob [12] = bitlen [0];\n\t\t\tblob [13] = bitlen [1];\n\t\t\tblob [14] = bitlen [2];\n\t\t\tblob [15] = bitlen [3];\n\n\t\t\tint pos = 16;\n\t\t\tbyte[] part;\n\n\t\t\tpart = p.P;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, keyLength);\n\t\t\tpos += keyLength;\n\n\t\t\tpart = p.Q;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, 20);\n\t\t\tpos += 20;\n\n\t\t\tpart = p.G;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, keyLength);\n\t\t\tpos += keyLength;\n\n\t\t\tpart = p.Y;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, keyLength);\n\t\t\tpos += keyLength;\n\n\t\t\tBuffer.BlockCopy (GetBytesLE (p.Counter), 0, blob, pos, 4);\n\t\t\tpos += 4;\n\n\t\t\tpart = p.Seed;\n\t\t\tArray.Reverse (part);\n\t\t\tBuffer.BlockCopy (part, 0, blob, pos, 20);\n\n\t\t\treturn blob;\n\t\t}\n\n\t\t// PRIVATEKEYBLOB\n\t\t// PUBLICKEYBLOB\n\t\tstatic public RSA FromCapiKeyBlob (byte[] blob) \n\t\t{\n\t\t\treturn FromCapiKeyBlob (blob, 0);\n\t\t}\n\n\t\tstatic public RSA FromCapiKeyBlob (byte[] blob, int offset) \n\t\t{\n\t\t\tif (blob == null)\n\t\t\t\tthrow new ArgumentNullException (\"blob\");\n\t\t\tif (offset >= blob.Length)\n\t\t\t\tthrow new ArgumentException (\"blob is too small.\");\n\n\t\t\tswitch (blob [offset]) {\n\t\t\t\tcase 0x00:\n\t\t\t\t\t// this could be a public key inside an header\n\t\t\t\t\t// like \"sn -e\" would produce\n\t\t\t\t\tif (blob [offset + 12] == 0x06) {\n\t\t\t\t\t\treturn FromCapiPublicKeyBlob (blob, offset + 12);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x06:\n\t\t\t\t\treturn FromCapiPublicKeyBlob (blob, offset);\n\t\t\t\tcase 0x07:\n\t\t\t\t\treturn FromCapiPrivateKeyBlob (blob, offset);\n\t\t\t}\n\t\t\tthrow new CryptographicException (\"Unknown blob format.\");\n\t\t}\n\n\t\tstatic public DSA FromCapiKeyBlobDSA (byte[] blob)\n\t\t{\n\t\t\treturn FromCapiKeyBlobDSA (blob, 0);\n\t\t}\n\n\t\tstatic public DSA FromCapiKeyBlobDSA (byte[] blob, int offset)\n\t\t{\n\t\t\tif (blob == null)\n\t\t\t\tthrow new ArgumentNullException (\"blob\");\n\t\t\tif (offset >= blob.Length)\n\t\t\t\tthrow new ArgumentException (\"blob is too small.\");\n\n\t\t\tswitch (blob [offset]) {\n\t\t\t\tcase 0x06:\n\t\t\t\t\treturn FromCapiPublicKeyBlobDSA (blob, offset);\n\t\t\t\tcase 0x07:\n\t\t\t\t\treturn FromCapiPrivateKeyBlobDSA (blob, offset);\n\t\t\t}\n\t\t\tthrow new CryptographicException (\"Unknown blob format.\");\n\t\t}\n\n\t\tstatic public byte[] ToCapiKeyBlob (AsymmetricAlgorithm keypair, bool includePrivateKey) \n\t\t{\n\t\t\tif (keypair == null)\n\t\t\t\tthrow new ArgumentNullException (\"keypair\");\n\n\t\t\t// check between RSA and DSA (and potentially others like DH)\n\t\t\tif (keypair is RSA)\n\t\t\t\treturn ToCapiKeyBlob ((RSA)keypair, includePrivateKey);\n\t\t\telse if (keypair is DSA)\n\t\t\t\treturn ToCapiKeyBlob ((DSA)keypair, includePrivateKey);\n\t\t\telse\n\t\t\t\treturn null;\t// TODO\n\t\t}\n\n\t\tstatic public byte[] ToCapiKeyBlob (RSA rsa, bool includePrivateKey) \n\t\t{\n\t\t\tif (rsa == null)\n\t\t\t\tthrow new ArgumentNullException (\"rsa\");\n\n\t\t\tif (includePrivateKey)\n\t\t\t\treturn ToCapiPrivateKeyBlob (rsa);\n\t\t\telse\n\t\t\t\treturn ToCapiPublicKeyBlob (rsa);\n\t\t}\n\n\t\tstatic public byte[] ToCapiKeyBlob (DSA dsa, bool includePrivateKey)\n\t\t{\n\t\t\tif (dsa == null)\n\t\t\t\tthrow new ArgumentNullException (\"dsa\");\n\n\t\t\tif (includePrivateKey)\n\t\t\t\treturn ToCapiPrivateKeyBlob (dsa);\n\t\t\telse\n\t\t\t\treturn ToCapiPublicKeyBlob (dsa);\n\t\t}\n\n\t\tstatic public string ToHex (byte[] input) \n\t\t{\n\t\t\tif (input == null)\n\t\t\t\treturn null;\n\n\t\t\tStringBuilder sb = new StringBuilder (input.Length * 2);\n\t\t\tforeach (byte b in input) {\n\t\t\t\tsb.Append (b.ToString (\"X2\", CultureInfo.InvariantCulture));\n\t\t\t}\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tstatic private byte FromHexChar (char c) \n\t\t{\n\t\t\tif ((c >= 'a') && (c <= 'f'))\n\t\t\t\treturn (byte) (c - 'a' + 10);\n\t\t\tif ((c >= 'A') && (c <= 'F'))\n\t\t\t\treturn (byte) (c - 'A' + 10);\n\t\t\tif ((c >= '0') && (c <= '9'))\n\t\t\t\treturn (byte) (c - '0');\n\t\t\tthrow new ArgumentException (\"invalid hex char\");\n\t\t}\n\n\t\tstatic public byte[] FromHex (string hex) \n\t\t{\n\t\t\tif (hex == null)\n\t\t\t\treturn null;\n\t\t\tif ((hex.Length & 0x1) == 0x1)\n\t\t\t\tthrow new ArgumentException (\"Length must be a multiple of 2\");\n\n\t\t\tbyte[] result = new byte [hex.Length >> 1];\n\t\t\tint n = 0;\n\t\t\tint i = 0;\n\t\t\twhile (n < result.Length) {\n\t\t\t\tresult [n] = (byte) (FromHexChar (hex [i++]) << 4);\n\t\t\t\tresult [n++] += FromHexChar (hex [i++]);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/MonoSymbolFile.cs",
    "content": "//\n// MonoSymbolFile.cs\n//\n// Authors:\n//   Martin Baulig (martin@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// (C) 2003 Ximian, Inc.  http://www.ximian.com\n// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)\n//\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing System.Reflection;\nusing System.Collections.Generic;\nusing System.IO;\n\t\nnamespace Mono.CompilerServices.SymbolWriter\n{\n\tpublic class MonoSymbolFileException : Exception\n\t{\n\t\tpublic MonoSymbolFileException ()\n\t\t\t: base ()\n\t\t{ }\n\n\t\tpublic MonoSymbolFileException (string message, params object[] args)\n\t\t\t: base (String.Format (message, args))\n\t\t{\n\t\t}\n\n\t\tpublic MonoSymbolFileException (string message, Exception innerException)\n\t\t\t: base (message, innerException)\n\t\t{\n\t\t}\n\t}\n\n\tsealed class MyBinaryWriter : BinaryWriter\n\t{\n\t\tpublic MyBinaryWriter (Stream stream)\n\t\t\t: base (stream)\n\t\t{ }\n\n\t\tpublic void WriteLeb128 (int value)\n\t\t{\n\t\t\tbase.Write7BitEncodedInt (value);\n\t\t}\n\t}\n\n\tinternal class MyBinaryReader : BinaryReader\n\t{\n\t\tpublic MyBinaryReader (Stream stream)\n\t\t\t: base (stream)\n\t\t{ }\n\n\t\tpublic int ReadLeb128 ()\n\t\t{\n\t\t\treturn base.Read7BitEncodedInt ();\n\t\t}\n\n\t\tpublic string ReadString (int offset)\n\t\t{\n\t\t\tlong old_pos = BaseStream.Position;\n\t\t\tBaseStream.Position = offset;\n\n\t\t\tstring text = ReadString ();\n\n\t\t\tBaseStream.Position = old_pos;\n\t\t\treturn text;\n\t\t}\n\t}\n\n\tpublic interface ISourceFile\n\t{\n\t\tSourceFileEntry Entry {\n\t\t\tget;\n\t\t}\n\t}\n\n\tpublic interface ICompileUnit\n\t{\n\t\tCompileUnitEntry Entry {\n\t\t\tget;\n\t\t}\n\t}\n\n\tpublic interface IMethodDef\n\t{\n\t\tstring Name {\n\t\t\tget;\n\t\t}\n\n\t\tint Token {\n\t\t\tget;\n\t\t}\n\t}\n\n\tpublic class MonoSymbolFile : IDisposable\n\t{\n\t\tList<MethodEntry> methods = new List<MethodEntry> ();\n\t\tList<SourceFileEntry> sources = new List<SourceFileEntry> ();\n\t\tList<CompileUnitEntry> comp_units = new List<CompileUnitEntry> ();\n\t\tDictionary<int, AnonymousScopeEntry> anonymous_scopes;\n\n\t\tOffsetTable ot;\n\t\tint last_type_index;\n\t\tint last_method_index;\n\t\tint last_namespace_index;\n\n\t\tpublic readonly int MajorVersion = OffsetTable.MajorVersion;\n\t\tpublic readonly int MinorVersion = OffsetTable.MinorVersion;\n\n\t\tpublic int NumLineNumbers;\n\n\t\tpublic MonoSymbolFile ()\n\t\t{\n\t\t\tot = new OffsetTable ();\n\t\t}\n\n\t\tpublic int AddSource (SourceFileEntry source)\n\t\t{\n\t\t\tsources.Add (source);\n\t\t\treturn sources.Count;\n\t\t}\n\n\t\tpublic int AddCompileUnit (CompileUnitEntry entry)\n\t\t{\n\t\t\tcomp_units.Add (entry);\n\t\t\treturn comp_units.Count;\n\t\t}\n\n\t\tpublic void AddMethod (MethodEntry entry)\n\t\t{\n\t\t\tmethods.Add (entry);\n\t\t}\n\n\t\tpublic MethodEntry DefineMethod (CompileUnitEntry comp_unit, int token,\n\t\t\t\t\t\t ScopeVariable[] scope_vars, LocalVariableEntry[] locals,\n\t\t\t\t\t\t LineNumberEntry[] lines, CodeBlockEntry[] code_blocks,\n\t\t\t\t\t\t string real_name, MethodEntry.Flags flags,\n\t\t\t\t\t\t int namespace_id)\n\t\t{\n\t\t\tif (reader != null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tMethodEntry method = new MethodEntry (\n\t\t\t\tthis, comp_unit, token, scope_vars, locals, lines, code_blocks, \n\t\t\t\treal_name, flags, namespace_id);\n\t\t\tAddMethod (method);\n\t\t\treturn method;\n\t\t}\n\n\t\tinternal void DefineAnonymousScope (int id)\n\t\t{\n\t\t\tif (reader != null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tif (anonymous_scopes == null)\n\t\t\t\tanonymous_scopes = new Dictionary<int, AnonymousScopeEntry>  ();\n\n\t\t\tanonymous_scopes.Add (id, new AnonymousScopeEntry (id));\n\t\t}\n\n\t\tinternal void DefineCapturedVariable (int scope_id, string name, string captured_name,\n\t\t\t\t\t\t      CapturedVariable.CapturedKind kind)\n\t\t{\n\t\t\tif (reader != null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tAnonymousScopeEntry scope = anonymous_scopes [scope_id];\n\t\t\tscope.AddCapturedVariable (name, captured_name, kind);\n\t\t}\n\n\t\tinternal void DefineCapturedScope (int scope_id, int id, string captured_name)\n\t\t{\n\t\t\tif (reader != null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tAnonymousScopeEntry scope = anonymous_scopes [scope_id];\n\t\t\tscope.AddCapturedScope (id, captured_name);\n\t\t}\n\n\t\tinternal int GetNextTypeIndex ()\n\t\t{\n\t\t\treturn ++last_type_index;\n\t\t}\n\n\t\tinternal int GetNextMethodIndex ()\n\t\t{\n\t\t\treturn ++last_method_index;\n\t\t}\n\n\t\tinternal int GetNextNamespaceIndex ()\n\t\t{\n\t\t\treturn ++last_namespace_index;\n\t\t}\n\t\t\n\t\tvoid Write (MyBinaryWriter bw, Guid guid)\n\t\t{\n\t\t\t// Magic number and file version.\n\t\t\tbw.Write (OffsetTable.Magic);\n\t\t\tbw.Write (MajorVersion);\n\t\t\tbw.Write (MinorVersion);\n\n\t\t\tbw.Write (guid.ToByteArray ());\n\n\t\t\t//\n\t\t\t// Offsets of file sections; we must write this after we're done\n\t\t\t// writing the whole file, so we just reserve the space for it here.\n\t\t\t//\n\t\t\tlong offset_table_offset = bw.BaseStream.Position;\n\t\t\tot.Write (bw, MajorVersion, MinorVersion);\n\n\t\t\t//\n\t\t\t// Sort the methods according to their tokens and update their index.\n\t\t\t//\n\t\t\tmethods.Sort ();\n\t\t\tfor (int i = 0; i < methods.Count; i++)\n\t\t\t\tmethods [i].Index = i + 1;\n\n\t\t\t//\n\t\t\t// Write data sections.\n\t\t\t//\n\t\t\tot.DataSectionOffset = (int) bw.BaseStream.Position;\n\t\t\tforeach (SourceFileEntry source in sources)\n\t\t\t\tsource.WriteData (bw);\n\t\t\tforeach (CompileUnitEntry comp_unit in comp_units)\n\t\t\t\tcomp_unit.WriteData (bw);\n\t\t\tforeach (MethodEntry method in methods)\n\t\t\t\tmethod.WriteData (this, bw);\n\t\t\tot.DataSectionSize = (int) bw.BaseStream.Position - ot.DataSectionOffset;\n\n\t\t\t//\n\t\t\t// Write the method index table.\n\t\t\t//\n\t\t\tot.MethodTableOffset = (int) bw.BaseStream.Position;\n\t\t\tfor (int i = 0; i < methods.Count; i++) {\n\t\t\t\tMethodEntry entry = methods [i];\n\t\t\t\tentry.Write (bw);\n\t\t\t}\n\t\t\tot.MethodTableSize = (int) bw.BaseStream.Position - ot.MethodTableOffset;\n\n\t\t\t//\n\t\t\t// Write source table.\n\t\t\t//\n\t\t\tot.SourceTableOffset = (int) bw.BaseStream.Position;\n\t\t\tfor (int i = 0; i < sources.Count; i++) {\n\t\t\t\tSourceFileEntry source = sources [i];\n\t\t\t\tsource.Write (bw);\n\t\t\t}\n\t\t\tot.SourceTableSize = (int) bw.BaseStream.Position - ot.SourceTableOffset;\n\n\t\t\t//\n\t\t\t// Write compilation unit table.\n\t\t\t//\n\t\t\tot.CompileUnitTableOffset = (int) bw.BaseStream.Position;\n\t\t\tfor (int i = 0; i < comp_units.Count; i++) {\n\t\t\t\tCompileUnitEntry unit = comp_units [i];\n\t\t\t\tunit.Write (bw);\n\t\t\t}\n\t\t\tot.CompileUnitTableSize = (int) bw.BaseStream.Position - ot.CompileUnitTableOffset;\n\n\t\t\t//\n\t\t\t// Write anonymous scope table.\n\t\t\t//\n\t\t\tot.AnonymousScopeCount = anonymous_scopes != null ? anonymous_scopes.Count : 0;\n\t\t\tot.AnonymousScopeTableOffset = (int) bw.BaseStream.Position;\n\t\t\tif (anonymous_scopes != null) {\n\t\t\t\tforeach (AnonymousScopeEntry scope in anonymous_scopes.Values)\n\t\t\t\t\tscope.Write (bw);\n\t\t\t}\n\t\t\tot.AnonymousScopeTableSize = (int) bw.BaseStream.Position - ot.AnonymousScopeTableOffset;\n\n\t\t\t//\n\t\t\t// Fixup offset table.\n\t\t\t//\n\t\t\tot.TypeCount = last_type_index;\n\t\t\tot.MethodCount = methods.Count;\n\t\t\tot.SourceCount = sources.Count;\n\t\t\tot.CompileUnitCount = comp_units.Count;\n\n\t\t\t//\n\t\t\t// Write offset table.\n\t\t\t//\n\t\t\tot.TotalFileSize = (int) bw.BaseStream.Position;\n\t\t\tbw.Seek ((int) offset_table_offset, SeekOrigin.Begin);\n\t\t\tot.Write (bw, MajorVersion, MinorVersion);\n\t\t\tbw.Seek (0, SeekOrigin.End);\n\n#if false\n\t\t\tConsole.WriteLine (\"TOTAL: {0} line numbes, {1} bytes, extended {2} bytes, \" +\n\t\t\t\t\t   \"{3} methods.\", NumLineNumbers, LineNumberSize,\n\t\t\t\t\t   ExtendedLineNumberSize, methods.Count);\n#endif\n\t\t}\n\n\t\tpublic void CreateSymbolFile (Guid guid, FileStream fs)\n\t\t{\n\t\t\tif (reader != null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tWrite (new MyBinaryWriter (fs), guid);\n\t\t}\n\n\t\tMyBinaryReader reader;\n\t\tDictionary<int, SourceFileEntry> source_file_hash;\n\t\tDictionary<int, CompileUnitEntry> compile_unit_hash;\n\n\t\tList<MethodEntry> method_list;\n\t\tDictionary<int, MethodEntry> method_token_hash;\n\t\tDictionary<string, int> source_name_hash;\n\n\t\tGuid guid;\n\n\t\tMonoSymbolFile (Stream stream)\n\t\t{\n\t\t\treader = new MyBinaryReader (stream);\n\n\t\t\ttry {\n\t\t\t\tlong magic = reader.ReadInt64 ();\n\t\t\t\tint major_version = reader.ReadInt32 ();\n\t\t\t\tint minor_version = reader.ReadInt32 ();\n\n\t\t\t\tif (magic != OffsetTable.Magic)\n\t\t\t\t\tthrow new MonoSymbolFileException (\"Symbol file is not a valid\");\n\t\t\t\tif (major_version != OffsetTable.MajorVersion)\n\t\t\t\t\tthrow new MonoSymbolFileException (\n\t\t\t\t\t\t\"Symbol file has version {0} but expected {1}\", major_version, OffsetTable.MajorVersion);\n\t\t\t\tif (minor_version != OffsetTable.MinorVersion)\n\t\t\t\t\tthrow new MonoSymbolFileException (\"Symbol file has version {0}.{1} but expected {2}.{3}\",\n\t\t\t\t\t\tmajor_version, minor_version,\n\t\t\t\t\t\tOffsetTable.MajorVersion, OffsetTable.MinorVersion);\n\n\t\t\t\tMajorVersion = major_version;\n\t\t\t\tMinorVersion = minor_version;\n\t\t\t\tguid = new Guid (reader.ReadBytes (16));\n\n\t\t\t\tot = new OffsetTable (reader, major_version, minor_version);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new MonoSymbolFileException (\"Cannot read symbol file\", e);\n\t\t\t}\n\n\t\t\tsource_file_hash = new Dictionary<int, SourceFileEntry> ();\n\t\t\tcompile_unit_hash = new Dictionary<int, CompileUnitEntry> ();\n\t\t}\n\n\t\tpublic static MonoSymbolFile ReadSymbolFile (Assembly assembly)\n\t\t{\n\t\t\tstring filename = assembly.Location;\n\t\t\tstring name = filename + \".mdb\";\n\n\t\t\tModule[] modules = assembly.GetModules ();\n\t\t\tGuid assembly_guid = modules[0].ModuleVersionId;\n\n\t\t\treturn ReadSymbolFile (name, assembly_guid);\n\t\t}\n\n\t\tpublic static MonoSymbolFile ReadSymbolFile (string mdbFilename)\n\t\t{\n\t\t\treturn ReadSymbolFile (new FileStream (mdbFilename, FileMode.Open, FileAccess.Read));\n\t\t}\n\n\t\tpublic static MonoSymbolFile ReadSymbolFile (string mdbFilename, Guid assemblyGuid)\n\t\t{\n\t\t\tvar sf = ReadSymbolFile (mdbFilename);\n\t\t\tif (assemblyGuid != sf.guid)\n\t\t\t\tthrow new MonoSymbolFileException (\"Symbol file `{0}' does not match assembly\", mdbFilename);\n\n\t\t\treturn sf;\n\t\t}\n\n\t\tpublic static MonoSymbolFile ReadSymbolFile (Stream stream)\n\t\t{\n\t\t\treturn new MonoSymbolFile (stream);\n\t\t}\n\n\t\tpublic int CompileUnitCount {\n\t\t\tget { return ot.CompileUnitCount; }\n\t\t}\n\n\t\tpublic int SourceCount {\n\t\t\tget { return ot.SourceCount; }\n\t\t}\n\n\t\tpublic int MethodCount {\n\t\t\tget { return ot.MethodCount; }\n\t\t}\n\n\t\tpublic int TypeCount {\n\t\t\tget { return ot.TypeCount; }\n\t\t}\n\n\t\tpublic int AnonymousScopeCount {\n\t\t\tget { return ot.AnonymousScopeCount; }\n\t\t}\n\n\t\tpublic int NamespaceCount {\n\t\t\tget { return last_namespace_index; }\n\t\t}\n\n\t\tpublic Guid Guid {\n\t\t\tget { return guid; }\n\t\t}\n\n\t\tpublic OffsetTable OffsetTable {\n\t\t\tget { return ot; }\n\t\t}\n\n\t\tinternal int LineNumberCount = 0;\n\t\tinternal int LocalCount = 0;\n\t\tinternal int StringSize = 0;\n\n\t\tinternal int LineNumberSize = 0;\n\t\tinternal int ExtendedLineNumberSize = 0;\n\n\t\tpublic SourceFileEntry GetSourceFile (int index)\n\t\t{\n\t\t\tif ((index < 1) || (index > ot.SourceCount))\n\t\t\t\tthrow new ArgumentException ();\n\t\t\tif (reader == null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tlock (this) {\n\t\t\t\tSourceFileEntry source;\n\t\t\t\tif (source_file_hash.TryGetValue (index, out source))\n\t\t\t\t\treturn source;\n\n\t\t\t\tlong old_pos = reader.BaseStream.Position;\n\n\t\t\t\treader.BaseStream.Position = ot.SourceTableOffset +\n\t\t\t\t\tSourceFileEntry.Size * (index - 1);\n\t\t\t\tsource = new SourceFileEntry (this, reader);\n\t\t\t\tsource_file_hash.Add (index, source);\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\tpublic SourceFileEntry[] Sources {\n\t\t\tget {\n\t\t\t\tif (reader == null)\n\t\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\t\tSourceFileEntry[] retval = new SourceFileEntry [SourceCount];\n\t\t\t\tfor (int i = 0; i < SourceCount; i++)\n\t\t\t\t\tretval [i] = GetSourceFile (i + 1);\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t}\n\n\t\tpublic CompileUnitEntry GetCompileUnit (int index)\n\t\t{\n\t\t\tif ((index < 1) || (index > ot.CompileUnitCount))\n\t\t\t\tthrow new ArgumentException ();\n\t\t\tif (reader == null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tlock (this) {\n\t\t\t\tCompileUnitEntry unit;\n\t\t\t\tif (compile_unit_hash.TryGetValue (index, out unit))\n\t\t\t\t\treturn unit;\n\n\t\t\t\tlong old_pos = reader.BaseStream.Position;\n\n\t\t\t\treader.BaseStream.Position = ot.CompileUnitTableOffset +\n\t\t\t\t\tCompileUnitEntry.Size * (index - 1);\n\t\t\t\tunit = new CompileUnitEntry (this, reader);\n\t\t\t\tcompile_unit_hash.Add (index, unit);\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t\treturn unit;\n\t\t\t}\n\t\t}\n\n\t\tpublic CompileUnitEntry[] CompileUnits {\n\t\t\tget {\n\t\t\t\tif (reader == null)\n\t\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\t\tCompileUnitEntry[] retval = new CompileUnitEntry [CompileUnitCount];\n\t\t\t\tfor (int i = 0; i < CompileUnitCount; i++)\n\t\t\t\t\tretval [i] = GetCompileUnit (i + 1);\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t}\n\n\t\tvoid read_methods ()\n\t\t{\n\t\t\tlock (this) {\n\t\t\t\tif (method_token_hash != null)\n\t\t\t\t\treturn;\n\n\t\t\t\tmethod_token_hash = new Dictionary<int, MethodEntry> ();\n\t\t\t\tmethod_list = new List<MethodEntry> ();\n\n\t\t\t\tlong old_pos = reader.BaseStream.Position;\n\t\t\t\treader.BaseStream.Position = ot.MethodTableOffset;\n\n\t\t\t\tfor (int i = 0; i < MethodCount; i++) {\n\t\t\t\t\tMethodEntry entry = new MethodEntry (this, reader, i + 1);\n\t\t\t\t\tmethod_token_hash.Add (entry.Token, entry);\n\t\t\t\t\tmethod_list.Add (entry);\n\t\t\t\t}\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodEntry GetMethodByToken (int token)\n\t\t{\n\t\t\tif (reader == null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tlock (this) {\n\t\t\t\tread_methods ();\n\t\t\t\tMethodEntry me;\n\t\t\t\tmethod_token_hash.TryGetValue (token, out me);\n\t\t\t\treturn me;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodEntry GetMethod (int index)\n\t\t{\n\t\t\tif ((index < 1) || (index > ot.MethodCount))\n\t\t\t\tthrow new ArgumentException ();\n\t\t\tif (reader == null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tlock (this) {\n\t\t\t\tread_methods ();\n\t\t\t\treturn method_list [index - 1];\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodEntry[] Methods {\n\t\t\tget {\n\t\t\t\tif (reader == null)\n\t\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\t\tlock (this) {\n\t\t\t\t\tread_methods ();\n\t\t\t\t\tMethodEntry[] retval = new MethodEntry [MethodCount];\n\t\t\t\t\tmethod_list.CopyTo (retval, 0);\n\t\t\t\t\treturn retval;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic int FindSource (string file_name)\n\t\t{\n\t\t\tif (reader == null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tlock (this) {\n\t\t\t\tif (source_name_hash == null) {\n\t\t\t\t\tsource_name_hash = new Dictionary<string, int> ();\n\n\t\t\t\t\tfor (int i = 0; i < ot.SourceCount; i++) {\n\t\t\t\t\t\tSourceFileEntry source = GetSourceFile (i + 1);\n\t\t\t\t\t\tsource_name_hash.Add (source.FileName, i);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tint value;\n\t\t\t\tif (!source_name_hash.TryGetValue (file_name, out value))\n\t\t\t\t\treturn -1;\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\tpublic AnonymousScopeEntry GetAnonymousScope (int id)\n\t\t{\n\t\t\tif (reader == null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tAnonymousScopeEntry scope;\n\t\t\tlock (this) {\n\t\t\t\tif (anonymous_scopes != null) {\n\t\t\t\t\tanonymous_scopes.TryGetValue (id, out scope);\n\t\t\t\t\treturn scope;\n\t\t\t\t}\n\n\t\t\t\tanonymous_scopes = new Dictionary<int, AnonymousScopeEntry> ();\n\t\t\t\treader.BaseStream.Position = ot.AnonymousScopeTableOffset;\n\t\t\t\tfor (int i = 0; i < ot.AnonymousScopeCount; i++) {\n\t\t\t\t\tscope = new AnonymousScopeEntry (reader);\n\t\t\t\t\tanonymous_scopes.Add (scope.ID, scope);\n\t\t\t\t}\n\n\t\t\t\treturn anonymous_scopes [id];\n\t\t\t}\n\t\t}\n\n\t\tinternal MyBinaryReader BinaryReader {\n\t\t\tget {\n\t\t\t\tif (reader == null)\n\t\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\t\treturn reader;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\tDispose (true);\n\t\t}\n\n\t\tprotected virtual void Dispose (bool disposing)\n\t\t{\n\t\t\tif (disposing) {\n\t\t\t\tif (reader != null) {\n\t\t\t\t\treader.Close ();\n\t\t\t\t\treader = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/MonoSymbolTable.cs",
    "content": "//\n// Mono.CSharp.Debugger/MonoSymbolTable.cs\n//\n// Author:\n//   Martin Baulig (martin@ximian.com)\n//\n// (C) 2002 Ximian, Inc.  http://www.ximian.com\n//\n\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing System.Security.Cryptography;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\n//\n// Parts which are actually written into the symbol file are marked with\n//\n//         #region This is actually written to the symbol file\n//         #endregion\n//\n// Please do not modify these regions without previously talking to me.\n//\n// All changes to the file format must be synchronized in several places:\n//\n// a) The fields in these regions (and their order) must match the actual\n//    contents of the symbol file.\n//\n//    This helps people to understand the symbol file format without reading\n//    too much source code, ie. you look at the appropriate region and then\n//    you know what's actually in the file.\n//\n//    It is also required to help me enforce b).\n//\n// b) The regions must be kept in sync with the unmanaged code in\n//    mono/metadata/debug-mono-symfile.h\n//\n// When making changes to the file format, you must also increase two version\n// numbers:\n//\n// i)  OffsetTable.Version in this file.\n// ii) MONO_SYMBOL_FILE_VERSION in mono/metadata/debug-mono-symfile.h\n//\n// After doing so, recompile everything, including the debugger.  Symbol files\n// with different versions are incompatible to each other and the debugger and\n// the runtime enfore this, so you need to recompile all your assemblies after\n// changing the file format.\n//\n\nnamespace Mono.CompilerServices.SymbolWriter\n{\n\tpublic class OffsetTable\n\t{\n\t\tpublic const int  MajorVersion = 50;\n\t\tpublic const int  MinorVersion = 0;\n\t\tpublic const long Magic        = 0x45e82623fd7fa614;\n\n\t\t#region This is actually written to the symbol file\n\t\tpublic int TotalFileSize;\n\t\tpublic int DataSectionOffset;\n\t\tpublic int DataSectionSize;\n\t\tpublic int CompileUnitCount;\n\t\tpublic int CompileUnitTableOffset;\n\t\tpublic int CompileUnitTableSize;\n\t\tpublic int SourceCount;\n\t\tpublic int SourceTableOffset;\n\t\tpublic int SourceTableSize;\n\t\tpublic int MethodCount;\n\t\tpublic int MethodTableOffset;\n\t\tpublic int MethodTableSize;\n\t\tpublic int TypeCount;\n\t\tpublic int AnonymousScopeCount;\n\t\tpublic int AnonymousScopeTableOffset;\n\t\tpublic int AnonymousScopeTableSize;\n\n\t\t[Flags]\n\t\tpublic enum Flags\n\t\t{\n\t\t\tIsAspxSource\t\t= 1,\n\t\t\tWindowsFileNames\t= 2\n\t\t}\n\n\t\tpublic Flags FileFlags;\n\n\t\tpublic int LineNumberTable_LineBase = LineNumberTable.Default_LineBase;\n\t\tpublic int LineNumberTable_LineRange = LineNumberTable.Default_LineRange;\n\t\tpublic int LineNumberTable_OpcodeBase = LineNumberTable.Default_OpcodeBase;\n\t\t#endregion\n\n\t\tinternal OffsetTable ()\n\t\t{\n\t\t\tint platform = (int) Environment.OSVersion.Platform;\n\t\t\tif ((platform != 4) && (platform != 128))\n\t\t\t\tFileFlags |= Flags.WindowsFileNames;\n\t\t}\n\n\t\tinternal OffsetTable (BinaryReader reader, int major_version, int minor_version)\n\t\t{\n\t\t\tTotalFileSize = reader.ReadInt32 ();\n\t\t\tDataSectionOffset = reader.ReadInt32 ();\n\t\t\tDataSectionSize = reader.ReadInt32 ();\n\t\t\tCompileUnitCount = reader.ReadInt32 ();\n\t\t\tCompileUnitTableOffset = reader.ReadInt32 ();\n\t\t\tCompileUnitTableSize = reader.ReadInt32 ();\n\t\t\tSourceCount = reader.ReadInt32 ();\n\t\t\tSourceTableOffset = reader.ReadInt32 ();\n\t\t\tSourceTableSize = reader.ReadInt32 ();\n\t\t\tMethodCount = reader.ReadInt32 ();\n\t\t\tMethodTableOffset = reader.ReadInt32 ();\n\t\t\tMethodTableSize = reader.ReadInt32 ();\n\t\t\tTypeCount = reader.ReadInt32 ();\n\n\t\t\tAnonymousScopeCount = reader.ReadInt32 ();\n\t\t\tAnonymousScopeTableOffset = reader.ReadInt32 ();\n\t\t\tAnonymousScopeTableSize = reader.ReadInt32 ();\n\n\t\t\tLineNumberTable_LineBase = reader.ReadInt32 ();\n\t\t\tLineNumberTable_LineRange = reader.ReadInt32 ();\n\t\t\tLineNumberTable_OpcodeBase = reader.ReadInt32 ();\n\n\t\t\tFileFlags = (Flags) reader.ReadInt32 ();\n\t\t}\n\n\t\tinternal void Write (BinaryWriter bw, int major_version, int minor_version)\n\t\t{\n\t\t\tbw.Write (TotalFileSize);\n\t\t\tbw.Write (DataSectionOffset);\n\t\t\tbw.Write (DataSectionSize);\n\t\t\tbw.Write (CompileUnitCount);\n\t\t\tbw.Write (CompileUnitTableOffset);\n\t\t\tbw.Write (CompileUnitTableSize);\n\t\t\tbw.Write (SourceCount);\n\t\t\tbw.Write (SourceTableOffset);\n\t\t\tbw.Write (SourceTableSize);\n\t\t\tbw.Write (MethodCount);\n\t\t\tbw.Write (MethodTableOffset);\n\t\t\tbw.Write (MethodTableSize);\n\t\t\tbw.Write (TypeCount);\n\n\t\t\tbw.Write (AnonymousScopeCount);\n\t\t\tbw.Write (AnonymousScopeTableOffset);\n\t\t\tbw.Write (AnonymousScopeTableSize);\n\n\t\t\tbw.Write (LineNumberTable_LineBase);\n\t\t\tbw.Write (LineNumberTable_LineRange);\n\t\t\tbw.Write (LineNumberTable_OpcodeBase);\n\n\t\t\tbw.Write ((int) FileFlags);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\n\t\t\t\t\"OffsetTable [{0} - {1}:{2} - {3}:{4}:{5} - {6}:{7}:{8} - {9}]\",\n\t\t\t\tTotalFileSize, DataSectionOffset, DataSectionSize, SourceCount,\n\t\t\t\tSourceTableOffset, SourceTableSize, MethodCount, MethodTableOffset,\n\t\t\t\tMethodTableSize, TypeCount);\n\t\t}\n\t}\n\n\tpublic class LineNumberEntry\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int Row;\n\t\tpublic int Column;\n\t\tpublic int EndRow, EndColumn;\n\t\tpublic readonly int File;\n\t\tpublic readonly int Offset;\n\t\tpublic readonly bool IsHidden;\t// Obsolete is never used\n\t\t#endregion\n\n\t\tpublic sealed class LocationComparer : IComparer<LineNumberEntry>\n\t\t{\n\t\t\tpublic static readonly LocationComparer Default = new LocationComparer ();\n\n\t\t\tpublic int Compare (LineNumberEntry l1, LineNumberEntry l2)\n\t\t\t{\n\t\t\t\treturn l1.Row == l2.Row ?\n\t\t\t\t\tl1.Column.CompareTo (l2.Column) :\n\t\t\t\t\tl1.Row.CompareTo (l2.Row);\n\t\t\t}\n\t\t}\n\n\t\tpublic static readonly LineNumberEntry Null = new LineNumberEntry (0, 0, 0, 0);\n\n\t\tpublic LineNumberEntry (int file, int row, int column, int offset)\n\t\t\t: this (file, row, offset, column, false)\n\t\t{\n\t\t}\n\n\t\tpublic LineNumberEntry (int file, int row, int offset)\n\t\t\t: this (file, row, -1, offset, false)\n\t\t{\n\t\t}\n\n\t\tpublic LineNumberEntry (int file, int row, int column, int offset, bool is_hidden)\n\t\t: this (file, row, column, -1, -1, offset, is_hidden)\n\t\t{\n\t\t}\n\n\t\tpublic LineNumberEntry (int file, int row, int column, int end_row, int end_column, int offset, bool is_hidden)\n\t\t{\n\t\t\tthis.File = file;\n\t\t\tthis.Row = row;\n\t\t\tthis.Column = column;\n\t\t\tthis.EndRow = end_row;\n\t\t\tthis.EndColumn = end_column;\n\t\t\tthis.Offset = offset;\n\t\t\tthis.IsHidden = is_hidden;\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[Line {0}:{1,2}-{3,4}:{5}]\", File, Row, Column, EndRow, EndColumn, Offset);\n\t\t}\n\t}\n\n\tpublic class CodeBlockEntry\n\t{\n\t\tpublic int Index;\n\t\t#region This is actually written to the symbol file\n\t\tpublic int Parent;\n\t\tpublic Type BlockType;\n\t\tpublic int StartOffset;\n\t\tpublic int EndOffset;\n\t\t#endregion\n\n\t\tpublic enum Type {\n\t\t\tLexical\t\t\t= 1,\n\t\t\tCompilerGenerated\t= 2,\n\t\t\tIteratorBody\t\t= 3,\n\t\t\tIteratorDispatcher\t= 4\n\t\t}\n\n\t\tpublic CodeBlockEntry (int index, int parent, Type type, int start_offset)\n\t\t{\n\t\t\tthis.Index = index;\n\t\t\tthis.Parent = parent;\n\t\t\tthis.BlockType = type;\n\t\t\tthis.StartOffset = start_offset;\n\t\t}\n\n\t\tinternal CodeBlockEntry (int index, MyBinaryReader reader)\n\t\t{\n\t\t\tthis.Index = index;\n\t\t\tint type_flag = reader.ReadLeb128 ();\n\t\t\tBlockType = (Type) (type_flag & 0x3f);\n\t\t\tthis.Parent = reader.ReadLeb128 ();\n\t\t\tthis.StartOffset = reader.ReadLeb128 ();\n\t\t\tthis.EndOffset = reader.ReadLeb128 ();\n\n\t\t\t/* Reserved for future extensions. */\n\t\t\tif ((type_flag & 0x40) != 0) {\n\t\t\t\tint data_size = reader.ReadInt16 ();\n\t\t\t\treader.BaseStream.Position += data_size;\n\t\t\t}\t\t\t\t\n\t\t}\n\n\t\tpublic void Close (int end_offset)\n\t\t{\n\t\t\tthis.EndOffset = end_offset;\n\t\t}\n\n\t\tinternal void Write (MyBinaryWriter bw)\n\t\t{\n\t\t\tbw.WriteLeb128 ((int) BlockType);\n\t\t\tbw.WriteLeb128 (Parent);\n\t\t\tbw.WriteLeb128 (StartOffset);\n\t\t\tbw.WriteLeb128 (EndOffset);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[CodeBlock {0}:{1}:{2}:{3}:{4}]\",\n\t\t\t\t\t      Index, Parent, BlockType, StartOffset, EndOffset);\n\t\t}\n\t}\n\n\tpublic struct LocalVariableEntry\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int Index;\n\t\tpublic readonly string Name;\n\t\tpublic readonly int BlockIndex;\n\t\t#endregion\n\n\t\tpublic LocalVariableEntry (int index, string name, int block)\n\t\t{\n\t\t\tthis.Index = index;\n\t\t\tthis.Name = name;\n\t\t\tthis.BlockIndex = block;\n\t\t}\n\n\t\tinternal LocalVariableEntry (MonoSymbolFile file, MyBinaryReader reader)\n\t\t{\n\t\t\tIndex = reader.ReadLeb128 ();\n\t\t\tName = reader.ReadString ();\n\t\t\tBlockIndex = reader.ReadLeb128 ();\n\t\t}\n\n\t\tinternal void Write (MonoSymbolFile file, MyBinaryWriter bw)\n\t\t{\n\t\t\tbw.WriteLeb128 (Index);\n\t\t\tbw.Write (Name);\n\t\t\tbw.WriteLeb128 (BlockIndex);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[LocalVariable {0}:{1}:{2}]\",\n\t\t\t\t\t      Name, Index, BlockIndex - 1);\n\t\t}\n\t}\n\n\tpublic struct CapturedVariable\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly string Name;\n\t\tpublic readonly string CapturedName;\n\t\tpublic readonly CapturedKind Kind;\n\t\t#endregion\n\n\t\tpublic enum CapturedKind : byte\n\t\t{\n\t\t\tLocal,\n\t\t\tParameter,\n\t\t\tThis\n\t\t}\n\n\t\tpublic CapturedVariable (string name, string captured_name,\n\t\t\t\t\t CapturedKind kind)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.CapturedName = captured_name;\n\t\t\tthis.Kind = kind;\n\t\t}\n\n\t\tinternal CapturedVariable (MyBinaryReader reader)\n\t\t{\n\t\t\tName = reader.ReadString ();\n\t\t\tCapturedName = reader.ReadString ();\n\t\t\tKind = (CapturedKind) reader.ReadByte ();\n\t\t}\n\n\t\tinternal void Write (MyBinaryWriter bw)\n\t\t{\n\t\t\tbw.Write (Name);\n\t\t\tbw.Write (CapturedName);\n\t\t\tbw.Write ((byte) Kind);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[CapturedVariable {0}:{1}:{2}]\",\n\t\t\t\t\t      Name, CapturedName, Kind);\n\t\t}\n\t}\n\n\tpublic struct CapturedScope\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int Scope;\n\t\tpublic readonly string CapturedName;\n\t\t#endregion\n\n\t\tpublic CapturedScope (int scope, string captured_name)\n\t\t{\n\t\t\tthis.Scope = scope;\n\t\t\tthis.CapturedName = captured_name;\n\t\t}\n\n\t\tinternal CapturedScope (MyBinaryReader reader)\n\t\t{\n\t\t\tScope = reader.ReadLeb128 ();\n\t\t\tCapturedName = reader.ReadString ();\n\t\t}\n\n\t\tinternal void Write (MyBinaryWriter bw)\n\t\t{\n\t\t\tbw.WriteLeb128 (Scope);\n\t\t\tbw.Write (CapturedName);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[CapturedScope {0}:{1}]\",\n\t\t\t\t\t      Scope, CapturedName);\n\t\t}\n\t}\n\n\tpublic struct ScopeVariable\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int Scope;\n\t\tpublic readonly int Index;\n\t\t#endregion\n\n\t\tpublic ScopeVariable (int scope, int index)\n\t\t{\n\t\t\tthis.Scope = scope;\n\t\t\tthis.Index = index;\n\t\t}\n\n\t\tinternal ScopeVariable (MyBinaryReader reader)\n\t\t{\n\t\t\tScope = reader.ReadLeb128 ();\n\t\t\tIndex = reader.ReadLeb128 ();\n\t\t}\n\n\t\tinternal void Write (MyBinaryWriter bw)\n\t\t{\n\t\t\tbw.WriteLeb128 (Scope);\n\t\t\tbw.WriteLeb128 (Index);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[ScopeVariable {0}:{1}]\", Scope, Index);\n\t\t}\n\t}\n\n\tpublic class AnonymousScopeEntry\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int ID;\n\t\t#endregion\n\n\t\tList<CapturedVariable> captured_vars = new List<CapturedVariable> ();\n\t\tList<CapturedScope> captured_scopes = new List<CapturedScope> ();\n\n\t\tpublic AnonymousScopeEntry (int id)\n\t\t{\n\t\t\tthis.ID = id;\n\t\t}\n\n\t\tinternal AnonymousScopeEntry (MyBinaryReader reader)\n\t\t{\n\t\t\tID = reader.ReadLeb128 ();\n\n\t\t\tint num_captured_vars = reader.ReadLeb128 ();\n\t\t\tfor (int i = 0; i < num_captured_vars; i++)\n\t\t\t\tcaptured_vars.Add (new CapturedVariable (reader));\n\n\t\t\tint num_captured_scopes = reader.ReadLeb128 ();\n\t\t\tfor (int i = 0; i < num_captured_scopes; i++)\n\t\t\t\tcaptured_scopes.Add (new CapturedScope (reader));\n\t\t}\n\n\t\tinternal void AddCapturedVariable (string name, string captured_name,\n\t\t\t\t\t\t   CapturedVariable.CapturedKind kind)\n\t\t{\n\t\t\tcaptured_vars.Add (new CapturedVariable (name, captured_name, kind));\n\t\t}\n\n\t\tpublic CapturedVariable[] CapturedVariables {\n\t\t\tget {\n\t\t\t\tCapturedVariable[] retval = new CapturedVariable [captured_vars.Count];\n\t\t\t\tcaptured_vars.CopyTo (retval, 0);\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t}\n\n\t\tinternal void AddCapturedScope (int scope, string captured_name)\n\t\t{\n\t\t\tcaptured_scopes.Add (new CapturedScope (scope, captured_name));\n\t\t}\n\n\t\tpublic CapturedScope[] CapturedScopes {\n\t\t\tget {\n\t\t\t\tCapturedScope[] retval = new CapturedScope [captured_scopes.Count];\n\t\t\t\tcaptured_scopes.CopyTo (retval, 0);\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t}\n\n\t\tinternal void Write (MyBinaryWriter bw)\n\t\t{\n\t\t\tbw.WriteLeb128 (ID);\n\n\t\t\tbw.WriteLeb128 (captured_vars.Count);\n\t\t\tforeach (CapturedVariable cv in captured_vars)\n\t\t\t\tcv.Write (bw);\n\n\t\t\tbw.WriteLeb128 (captured_scopes.Count);\n\t\t\tforeach (CapturedScope cs in captured_scopes)\n\t\t\t\tcs.Write (bw);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[AnonymousScope {0}]\", ID);\n\t\t}\n\t}\n\n\tpublic class CompileUnitEntry : ICompileUnit\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int Index;\n\t\tint DataOffset;\n\t\t#endregion\n\n\t\tMonoSymbolFile file;\n\t\tSourceFileEntry source;\n\t\tList<SourceFileEntry> include_files;\n\t\tList<NamespaceEntry> namespaces;\n\n\t\tbool creating;\n\n\t\tpublic static int Size {\n\t\t\tget { return 8; }\n\t\t}\n\n\t\tCompileUnitEntry ICompileUnit.Entry {\n\t\t\tget { return this; }\n\t\t}\n\n\t\tpublic CompileUnitEntry (MonoSymbolFile file, SourceFileEntry source)\n\t\t{\n\t\t\tthis.file = file;\n\t\t\tthis.source = source;\n\n\t\t\tthis.Index = file.AddCompileUnit (this);\n\n\t\t\tcreating = true;\n\t\t\tnamespaces = new List<NamespaceEntry> ();\n\t\t}\n\n\t\tpublic void AddFile (SourceFileEntry file)\n\t\t{\n\t\t\tif (!creating)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tif (include_files == null)\n\t\t\t\tinclude_files = new List<SourceFileEntry> ();\n\n\t\t\tinclude_files.Add (file);\n\t\t}\n\n\t\tpublic SourceFileEntry SourceFile {\n\t\t\tget {\n\t\t\t\tif (creating)\n\t\t\t\t\treturn source;\n\n\t\t\t\tReadData ();\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\tpublic int DefineNamespace (string name, string[] using_clauses, int parent)\n\t\t{\n\t\t\tif (!creating)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tint index = file.GetNextNamespaceIndex ();\n\t\t\tNamespaceEntry ns = new NamespaceEntry (name, index, using_clauses, parent);\n\t\t\tnamespaces.Add (ns);\n\t\t\treturn index;\n\t\t}\n\n\t\tinternal void WriteData (MyBinaryWriter bw)\n\t\t{\n\t\t\tDataOffset = (int) bw.BaseStream.Position;\n\t\t\tbw.WriteLeb128 (source.Index);\n\n\t\t\tint count_includes = include_files != null ? include_files.Count : 0;\n\t\t\tbw.WriteLeb128 (count_includes);\n\t\t\tif (include_files != null) {\n\t\t\t\tforeach (SourceFileEntry entry in include_files)\n\t\t\t\t\tbw.WriteLeb128 (entry.Index);\n\t\t\t}\n\n\t\t\tbw.WriteLeb128 (namespaces.Count);\n\t\t\tforeach (NamespaceEntry ns in namespaces)\n\t\t\t\tns.Write (file, bw);\n\t\t}\n\n\t\tinternal void Write (BinaryWriter bw)\n\t\t{\n\t\t\tbw.Write (Index);\n\t\t\tbw.Write (DataOffset);\n\t\t}\n\n\t\tinternal CompileUnitEntry (MonoSymbolFile file, MyBinaryReader reader)\n\t\t{\n\t\t\tthis.file = file;\n\n\t\t\tIndex = reader.ReadInt32 ();\n\t\t\tDataOffset = reader.ReadInt32 ();\n\t\t}\n\n\t\tpublic void ReadAll ()\n\t\t{\n\t\t\tReadData ();\n\t\t}\n\n\t\tvoid ReadData ()\n\t\t{\n\t\t\tif (creating)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tlock (file) {\n\t\t\t\tif (namespaces != null)\n\t\t\t\t\treturn;\n\n\t\t\t\tMyBinaryReader reader = file.BinaryReader;\n\t\t\t\tint old_pos = (int) reader.BaseStream.Position;\n\n\t\t\t\treader.BaseStream.Position = DataOffset;\n\n\t\t\t\tint source_idx = reader.ReadLeb128 ();\n\t\t\t\tsource = file.GetSourceFile (source_idx);\n\n\t\t\t\tint count_includes = reader.ReadLeb128 ();\n\t\t\t\tif (count_includes > 0) {\n\t\t\t\t\tinclude_files = new List<SourceFileEntry> ();\n\t\t\t\t\tfor (int i = 0; i < count_includes; i++)\n\t\t\t\t\t\tinclude_files.Add (file.GetSourceFile (reader.ReadLeb128 ()));\n\t\t\t\t}\n\n\t\t\t\tint count_ns = reader.ReadLeb128 ();\n\t\t\t\tnamespaces = new List<NamespaceEntry> ();\n\t\t\t\tfor (int i = 0; i < count_ns; i ++)\n\t\t\t\t\tnamespaces.Add (new NamespaceEntry (file, reader));\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t}\n\t\t}\n\n\t\tpublic NamespaceEntry[] Namespaces {\n\t\t\tget {\n\t\t\t\tReadData ();\n\t\t\t\tNamespaceEntry[] retval = new NamespaceEntry [namespaces.Count];\n\t\t\t\tnamespaces.CopyTo (retval, 0);\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t}\n\n\t\tpublic SourceFileEntry[] IncludeFiles {\n\t\t\tget {\n\t\t\t\tReadData ();\n\t\t\t\tif (include_files == null)\n\t\t\t\t\treturn new SourceFileEntry [0];\n\n\t\t\t\tSourceFileEntry[] retval = new SourceFileEntry [include_files.Count];\n\t\t\t\tinclude_files.CopyTo (retval, 0);\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class SourceFileEntry\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int Index;\n\t\tint DataOffset;\n\t\t#endregion\n\n\t\tMonoSymbolFile file;\n\t\tstring file_name;\n\t\tbyte[] guid;\n\t\tbyte[] hash;\n\t\tbool creating;\n\t\tbool auto_generated;\n\n\t\tpublic static int Size {\n\t\t\tget { return 8; }\n\t\t}\n\n\t\tpublic SourceFileEntry (MonoSymbolFile file, string file_name)\n\t\t{\n\t\t\tthis.file = file;\n\t\t\tthis.file_name = file_name;\n\t\t\tthis.Index = file.AddSource (this);\n\n\t\t\tcreating = true;\n\t\t}\n\n\t\tpublic SourceFileEntry (MonoSymbolFile file, string file_name, byte[] guid, byte[] checksum)\n\t\t\t: this (file, file_name)\n\t\t{\n\t\t\tthis.guid = guid;\n\t\t\tthis.hash = checksum;\n\t\t}\n\n\t\tpublic byte[] Checksum {\n\t\t\tget {\n\t\t\t\treturn hash;\n\t\t\t}\n\t\t}\n\n\t\tinternal void WriteData (MyBinaryWriter bw)\n\t\t{\n\t\t\tDataOffset = (int) bw.BaseStream.Position;\n\t\t\tbw.Write (file_name);\n\n\t\t\tif (guid == null)\n\t\t\t\tguid = new byte[16];\n\n\t\t\tif (hash == null) {\n\t\t\t\ttry {\n\t\t\t\t    using (FileStream fs = new FileStream (file_name, FileMode.Open, FileAccess.Read)) {\n\t\t\t\t        MD5 md5 = MD5.Create ();\n\t\t\t\t        hash = md5.ComputeHash (fs);\n\t\t\t\t    }\n\t\t\t\t} catch {\n\t\t\t\t\thash = new byte [16];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbw.Write (guid);\n\t\t\tbw.Write (hash);\n\t\t\tbw.Write ((byte) (auto_generated ? 1 : 0));\n\t\t}\n\n\t\tinternal void Write (BinaryWriter bw)\n\t\t{\n\t\t\tbw.Write (Index);\n\t\t\tbw.Write (DataOffset);\n\t\t}\n\n\t\tinternal SourceFileEntry (MonoSymbolFile file, MyBinaryReader reader)\n\t\t{\n\t\t\tthis.file = file;\n\n\t\t\tIndex = reader.ReadInt32 ();\n\t\t\tDataOffset = reader.ReadInt32 ();\n\n\t\t\tint old_pos = (int) reader.BaseStream.Position;\n\t\t\treader.BaseStream.Position = DataOffset;\n\n\t\t\tfile_name = reader.ReadString ();\n\t\t\tguid = reader.ReadBytes (16);\n\t\t\thash = reader.ReadBytes (16);\n\t\t\tauto_generated = reader.ReadByte () == 1;\n\n\t\t\treader.BaseStream.Position = old_pos;\n\t\t}\n\n\t\tpublic string FileName {\n\t\t\tget { return file_name; }\n\t\t\tset { file_name = value; }\n\t\t}\n\n\t\tpublic bool AutoGenerated {\n\t\t\tget { return auto_generated; }\n\t\t}\n\n\t\tpublic void SetAutoGenerated ()\n\t\t{\n\t\t\tif (!creating)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tauto_generated = true;\n\t\t\tfile.OffsetTable.FileFlags |= OffsetTable.Flags.IsAspxSource;\n\t\t}\n\n\t\tpublic bool CheckChecksum ()\n\t\t{\n\t\t\ttry {\n\t\t\t\tusing (FileStream fs = new FileStream (file_name, FileMode.Open)) {\n\t\t\t\t\tMD5 md5 = MD5.Create ();\n\t\t\t\t\tbyte[] data = md5.ComputeHash (fs);\n\t\t\t\t\tfor (int i = 0; i < 16; i++)\n\t\t\t\t\t\tif (data [i] != hash [i])\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"SourceFileEntry ({0}:{1})\", Index, DataOffset);\n\t\t}\n\t}\n\n\tpublic class LineNumberTable\n\t{\n\t\tprotected LineNumberEntry[] _line_numbers;\n\t\tpublic LineNumberEntry[] LineNumbers {\n\t\t\tget { return _line_numbers; }\n\t\t}\n\n\t\tpublic readonly int LineBase;\n\t\tpublic readonly int LineRange;\n\t\tpublic readonly byte OpcodeBase;\n\t\tpublic readonly int MaxAddressIncrement;\n\n#region Configurable constants\n\t\tpublic const int Default_LineBase = -1;\n\t\tpublic const int Default_LineRange = 8;\n\t\tpublic const byte Default_OpcodeBase = 9;\n\n#endregion\n\n\t\tpublic const byte DW_LNS_copy = 1;\n\t\tpublic const byte DW_LNS_advance_pc = 2;\n\t\tpublic const byte DW_LNS_advance_line = 3;\n\t\tpublic const byte DW_LNS_set_file = 4;\n\t\tpublic const byte DW_LNS_const_add_pc = 8;\n\n\t\tpublic const byte DW_LNE_end_sequence = 1;\n\n\t\t// MONO extensions.\n\t\tpublic const byte DW_LNE_MONO_negate_is_hidden = 0x40;\n\n\t\tinternal const byte DW_LNE_MONO__extensions_start = 0x40;\n\t\tinternal const byte DW_LNE_MONO__extensions_end   = 0x7f;\n\n\t\tprotected LineNumberTable (MonoSymbolFile file)\n\t\t{\n\t\t\tthis.LineBase = file.OffsetTable.LineNumberTable_LineBase;\n\t\t\tthis.LineRange = file.OffsetTable.LineNumberTable_LineRange;\n\t\t\tthis.OpcodeBase = (byte) file.OffsetTable.LineNumberTable_OpcodeBase;\n\t\t\tthis.MaxAddressIncrement = (255 - OpcodeBase) / LineRange;\n\t\t}\n\n\t\tinternal LineNumberTable (MonoSymbolFile file, LineNumberEntry[] lines)\n\t\t\t: this (file)\n\t\t{\n\t\t\tthis._line_numbers = lines;\n\t\t}\n\n\t\tinternal void Write (MonoSymbolFile file, MyBinaryWriter bw, bool hasColumnsInfo, bool hasEndInfo)\n\t\t{\n\t\t\tint start = (int) bw.BaseStream.Position;\n\n\t\t\tbool last_is_hidden = false;\n\t\t\tint last_line = 1, last_offset = 0, last_file = 1;\n\t\t\tfor (int i = 0; i < LineNumbers.Length; i++) {\n\t\t\t\tint line_inc = LineNumbers [i].Row - last_line;\n\t\t\t\tint offset_inc = LineNumbers [i].Offset - last_offset;\n\n\t\t\t\tif (LineNumbers [i].File != last_file) {\n\t\t\t\t\tbw.Write (DW_LNS_set_file);\n\t\t\t\t\tbw.WriteLeb128 (LineNumbers [i].File);\n\t\t\t\t\tlast_file = LineNumbers [i].File;\n\t\t\t\t}\n\n\t\t\t\tif (LineNumbers [i].IsHidden != last_is_hidden) {\n\t\t\t\t\tbw.Write ((byte) 0);\n\t\t\t\t\tbw.Write ((byte) 1);\n\t\t\t\t\tbw.Write (DW_LNE_MONO_negate_is_hidden);\n\t\t\t\t\tlast_is_hidden = LineNumbers [i].IsHidden;\n\t\t\t\t}\n\n\t\t\t\tif (offset_inc >= MaxAddressIncrement) {\n\t\t\t\t\tif (offset_inc < 2 * MaxAddressIncrement) {\n\t\t\t\t\t\tbw.Write (DW_LNS_const_add_pc);\n\t\t\t\t\t\toffset_inc -= MaxAddressIncrement;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbw.Write (DW_LNS_advance_pc);\n\t\t\t\t\t\tbw.WriteLeb128 (offset_inc);\n\t\t\t\t\t\toffset_inc = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((line_inc < LineBase) || (line_inc >= LineBase + LineRange)) {\n\t\t\t\t\tbw.Write (DW_LNS_advance_line);\n\t\t\t\t\tbw.WriteLeb128 (line_inc);\n\t\t\t\t\tif (offset_inc != 0) {\n\t\t\t\t\t\tbw.Write (DW_LNS_advance_pc);\n\t\t\t\t\t\tbw.WriteLeb128 (offset_inc);\n\t\t\t\t\t}\n\t\t\t\t\tbw.Write (DW_LNS_copy);\n\t\t\t\t} else {\n\t\t\t\t\tbyte opcode;\n\t\t\t\t\topcode = (byte) (line_inc - LineBase + (LineRange * offset_inc) +\n\t\t\t\t\t\t\t OpcodeBase);\n\t\t\t\t\tbw.Write (opcode);\n\t\t\t\t}\n\n\t\t\t\tlast_line = LineNumbers [i].Row;\n\t\t\t\tlast_offset = LineNumbers [i].Offset;\n\t\t\t}\n\n\t\t\tbw.Write ((byte) 0);\n\t\t\tbw.Write ((byte) 1);\n\t\t\tbw.Write (DW_LNE_end_sequence);\n\n\t\t\tif (hasColumnsInfo) {\n\t\t\t\tfor (int i = 0; i < LineNumbers.Length; i++) {\n\t\t\t\t\tvar ln = LineNumbers [i];\n\t\t\t\t\tif (ln.Row >= 0)\n\t\t\t\t\t\tbw.WriteLeb128 (ln.Column);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hasEndInfo) {\n\t\t\t\tfor (int i = 0; i < LineNumbers.Length; i++) {\n\t\t\t\t\tvar ln = LineNumbers [i];\n\t\t\t\t\tif (ln.EndRow == -1 || ln.EndColumn == -1 || ln.Row > ln.EndRow) {\n\t\t\t\t\t\tbw.WriteLeb128 (0xffffff);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbw.WriteLeb128 (ln.EndRow - ln.Row);\n\t\t\t\t\t\tbw.WriteLeb128 (ln.EndColumn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfile.ExtendedLineNumberSize += (int) bw.BaseStream.Position - start;\n\t\t}\n\n\t\tinternal static LineNumberTable Read (MonoSymbolFile file, MyBinaryReader br, bool readColumnsInfo, bool readEndInfo)\n\t\t{\n\t\t\tLineNumberTable lnt = new LineNumberTable (file);\n\t\t\tlnt.DoRead (file, br, readColumnsInfo, readEndInfo);\n\t\t\treturn lnt;\n\t\t}\n\n\t\tvoid DoRead (MonoSymbolFile file, MyBinaryReader br, bool includesColumns, bool includesEnds)\n\t\t{\n\t\t\tvar lines = new List<LineNumberEntry> ();\n\n\t\t\tbool is_hidden = false, modified = false;\n\t\t\tint stm_line = 1, stm_offset = 0, stm_file = 1;\n\t\t\twhile (true) {\n\t\t\t\tbyte opcode = br.ReadByte ();\n\n\t\t\t\tif (opcode == 0) {\n\t\t\t\t\tbyte size = br.ReadByte ();\n\t\t\t\t\tlong end_pos = br.BaseStream.Position + size;\n\t\t\t\t\topcode = br.ReadByte ();\n\n\t\t\t\t\tif (opcode == DW_LNE_end_sequence) {\n\t\t\t\t\t\tif (modified)\n\t\t\t\t\t\t\tlines.Add (new LineNumberEntry (\n\t\t\t\t\t\t\t\tstm_file, stm_line, -1, stm_offset, is_hidden));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (opcode == DW_LNE_MONO_negate_is_hidden) {\n\t\t\t\t\t\tis_hidden = !is_hidden;\n\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t} else if ((opcode >= DW_LNE_MONO__extensions_start) &&\n\t\t\t\t\t\t   (opcode <= DW_LNE_MONO__extensions_end)) {\n\t\t\t\t\t\t; // reserved for future extensions\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new MonoSymbolFileException (\"Unknown extended opcode {0:x}\", opcode);\n\t\t\t\t\t}\n\n\t\t\t\t\tbr.BaseStream.Position = end_pos;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (opcode < OpcodeBase) {\n\t\t\t\t\tswitch (opcode) {\n\t\t\t\t\tcase DW_LNS_copy:\n\t\t\t\t\t\tlines.Add (new LineNumberEntry (\n\t\t\t\t\t\t\tstm_file, stm_line, -1, stm_offset, is_hidden));\n\t\t\t\t\t\tmodified = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DW_LNS_advance_pc:\n\t\t\t\t\t\tstm_offset += br.ReadLeb128 ();\n\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DW_LNS_advance_line:\n\t\t\t\t\t\tstm_line += br.ReadLeb128 ();\n\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DW_LNS_set_file:\n\t\t\t\t\t\tstm_file = br.ReadLeb128 ();\n\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DW_LNS_const_add_pc:\n\t\t\t\t\t\tstm_offset += MaxAddressIncrement;\n\t\t\t\t\t\tmodified = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new MonoSymbolFileException (\n\t\t\t\t\t\t\t\"Unknown standard opcode {0:x} in LNT\",\n\t\t\t\t\t\t\topcode);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\topcode -= OpcodeBase;\n\n\t\t\t\t\tstm_offset += opcode / LineRange;\n\t\t\t\t\tstm_line += LineBase + (opcode % LineRange);\n\t\t\t\t\tlines.Add (new LineNumberEntry (\n\t\t\t\t\t\tstm_file, stm_line, -1, stm_offset, is_hidden));\n\t\t\t\t\tmodified = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_line_numbers = lines.ToArray ();\n\n\t\t\tif (includesColumns) {\n\t\t\t\tfor (int i = 0; i < _line_numbers.Length; ++i) {\n\t\t\t\t\tvar ln = _line_numbers[i];\n\t\t\t\t\tif (ln.Row >= 0)\n\t\t\t\t\t\tln.Column = br.ReadLeb128 ();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (includesEnds) {\n\t\t\t\tfor (int i = 0; i < _line_numbers.Length; ++i) {\n\t\t\t\t\tvar ln = _line_numbers[i];\n\n\t\t\t\t\tint row = br.ReadLeb128 ();\n\t\t\t\t\tif (row == 0xffffff) {\n\t\t\t\t\t\tln.EndRow = -1;\n\t\t\t\t\t\tln.EndColumn = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tln.EndRow = ln.Row + row;\n\t\t\t\t\t\tln.EndColumn = br.ReadLeb128 ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool GetMethodBounds (out LineNumberEntry start, out LineNumberEntry end)\n\t\t{\n\t\t\tif (_line_numbers.Length > 1) {\n\t\t\t\tstart = _line_numbers [0];\n\t\t\t\tend = _line_numbers [_line_numbers.Length - 1];\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tstart = LineNumberEntry.Null;\n\t\t\tend = LineNumberEntry.Null;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic class MethodEntry : IComparable\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly int CompileUnitIndex;\n\t\tpublic readonly int Token;\n\t\tpublic readonly int NamespaceID;\n\n\t\tint DataOffset;\n\t\tint LocalVariableTableOffset;\n\t\tint LineNumberTableOffset;\n\t\tint CodeBlockTableOffset;\n\t\tint ScopeVariableTableOffset;\n\t\tint RealNameOffset;\n\t\tFlags flags;\n\t\t#endregion\n\n\t\tint index;\n\n\t\tpublic Flags MethodFlags {\n\t\t\tget { return flags; }\n\t\t}\n\n\t\tpublic readonly CompileUnitEntry CompileUnit;\n\n\t\tLocalVariableEntry[] locals;\n\t\tCodeBlockEntry[] code_blocks;\n\t\tScopeVariable[] scope_vars;\n\t\tLineNumberTable lnt;\n\t\tstring real_name;\n\n\t\tpublic readonly MonoSymbolFile SymbolFile;\n\n\t\tpublic int Index {\n\t\t\tget { return index; }\n\t\t\tset { index = value; }\n\t\t}\n\n\t\t[Flags]\n\t\tpublic enum Flags\n\t\t{\n\t\t\tLocalNamesAmbiguous\t= 1,\n\t\t\tColumnsInfoIncluded = 1 << 1,\n\t\t\tEndInfoIncluded = 1 << 2\n\t\t}\n\n\t\tpublic const int Size = 12;\n\n\t\tinternal MethodEntry (MonoSymbolFile file, MyBinaryReader reader, int index)\n\t\t{\n\t\t\tthis.SymbolFile = file;\n\t\t\tthis.index = index;\n\n\t\t\tToken = reader.ReadInt32 ();\n\t\t\tDataOffset = reader.ReadInt32 ();\n\t\t\tLineNumberTableOffset = reader.ReadInt32 ();\n\n\t\t\tlong old_pos = reader.BaseStream.Position;\n\t\t\treader.BaseStream.Position = DataOffset;\n\n\t\t\tCompileUnitIndex = reader.ReadLeb128 ();\n\t\t\tLocalVariableTableOffset = reader.ReadLeb128 ();\n\t\t\tNamespaceID = reader.ReadLeb128 ();\n\n\t\t\tCodeBlockTableOffset = reader.ReadLeb128 ();\n\t\t\tScopeVariableTableOffset = reader.ReadLeb128 ();\n\n\t\t\tRealNameOffset = reader.ReadLeb128 ();\n\n\t\t\tflags = (Flags) reader.ReadLeb128 ();\n\n\t\t\treader.BaseStream.Position = old_pos;\n\n\t\t\tCompileUnit = file.GetCompileUnit (CompileUnitIndex);\n\t\t}\n\n\t\tinternal MethodEntry (MonoSymbolFile file, CompileUnitEntry comp_unit,\n\t\t\t\t      int token, ScopeVariable[] scope_vars,\n\t\t\t\t      LocalVariableEntry[] locals, LineNumberEntry[] lines,\n\t\t\t\t      CodeBlockEntry[] code_blocks, string real_name,\n\t\t\t\t      Flags flags, int namespace_id)\n\t\t{\n\t\t\tthis.SymbolFile = file;\n\t\t\tthis.real_name = real_name;\n\t\t\tthis.locals = locals;\n\t\t\tthis.code_blocks = code_blocks;\n\t\t\tthis.scope_vars = scope_vars;\n\t\t\tthis.flags = flags;\n\n\t\t\tindex = -1;\n\n\t\t\tToken = token;\n\t\t\tCompileUnitIndex = comp_unit.Index;\n\t\t\tCompileUnit = comp_unit;\n\t\t\tNamespaceID = namespace_id;\n\n\t\t\tCheckLineNumberTable (lines);\n\t\t\tlnt = new LineNumberTable (file, lines);\n\t\t\tfile.NumLineNumbers += lines.Length;\n\n\t\t\tint num_locals = locals != null ? locals.Length : 0;\n\n\t\t\tif (num_locals <= 32) {\n\t\t\t\t// Most of the time, the O(n^2) factor is actually\n\t\t\t\t// less than the cost of allocating the hash table,\n\t\t\t\t// 32 is a rough number obtained through some testing.\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < num_locals; i ++) {\n\t\t\t\t\tstring nm = locals [i].Name;\n\t\t\t\t\t\n\t\t\t\t\tfor (int j = i + 1; j < num_locals; j ++) {\n\t\t\t\t\t\tif (locals [j].Name == nm) {\n\t\t\t\t\t\t\tflags |= Flags.LocalNamesAmbiguous;\n\t\t\t\t\t\t\tgoto locals_check_done;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tlocals_check_done :\n\t\t\t\t;\n\t\t\t} else {\n\t\t\t\tvar local_names = new Dictionary<string, LocalVariableEntry> ();\n\t\t\t\tforeach (LocalVariableEntry local in locals) {\n\t\t\t\t\tif (local_names.ContainsKey (local.Name)) {\n\t\t\t\t\t\tflags |= Flags.LocalNamesAmbiguous;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tlocal_names.Add (local.Name, local);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void CheckLineNumberTable (LineNumberEntry[] line_numbers)\n\t\t{\n\t\t\tint last_offset = -1;\n\t\t\tint last_row = -1;\n\n\t\t\tif (line_numbers == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tfor (int i = 0; i < line_numbers.Length; i++) {\n\t\t\t\tLineNumberEntry line = line_numbers [i];\n\n\t\t\t\tif (line.Equals (LineNumberEntry.Null))\n\t\t\t\t\tthrow new MonoSymbolFileException ();\n\n\t\t\t\tif (line.Offset < last_offset)\n\t\t\t\t\tthrow new MonoSymbolFileException ();\n\n\t\t\t\tif (line.Offset > last_offset) {\n\t\t\t\t\tlast_row = line.Row;\n\t\t\t\t\tlast_offset = line.Offset;\n\t\t\t\t} else if (line.Row > last_row) {\n\t\t\t\t\tlast_row = line.Row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tinternal void Write (MyBinaryWriter bw)\n\t\t{\n\t\t\tif ((index <= 0) || (DataOffset == 0))\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tbw.Write (Token);\n\t\t\tbw.Write (DataOffset);\n\t\t\tbw.Write (LineNumberTableOffset);\n\t\t}\n\n\t\tinternal void WriteData (MonoSymbolFile file, MyBinaryWriter bw)\n\t\t{\n\t\t\tif (index <= 0)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tLocalVariableTableOffset = (int) bw.BaseStream.Position;\n\t\t\tint num_locals = locals != null ? locals.Length : 0;\n\t\t\tbw.WriteLeb128 (num_locals);\n\t\t\tfor (int i = 0; i < num_locals; i++)\n\t\t\t\tlocals [i].Write (file, bw);\n\t\t\tfile.LocalCount += num_locals;\n\n\t\t\tCodeBlockTableOffset = (int) bw.BaseStream.Position;\n\t\t\tint num_code_blocks = code_blocks != null ? code_blocks.Length : 0;\n\t\t\tbw.WriteLeb128 (num_code_blocks);\n\t\t\tfor (int i = 0; i < num_code_blocks; i++)\n\t\t\t\tcode_blocks [i].Write (bw);\n\n\t\t\tScopeVariableTableOffset = (int) bw.BaseStream.Position;\n\t\t\tint num_scope_vars = scope_vars != null ? scope_vars.Length : 0;\n\t\t\tbw.WriteLeb128 (num_scope_vars);\n\t\t\tfor (int i = 0; i < num_scope_vars; i++)\n\t\t\t\tscope_vars [i].Write (bw);\n\n\t\t\tif (real_name != null) {\n\t\t\t\tRealNameOffset = (int) bw.BaseStream.Position;\n\t\t\t\tbw.Write (real_name);\n\t\t\t}\n\n\t\t\tforeach (var lne in lnt.LineNumbers) {\n\t\t\t\tif (lne.EndRow != -1 || lne.EndColumn != -1)\n\t\t\t\t\tflags |= Flags.EndInfoIncluded;\n\t\t\t}\n\n\t\t\tLineNumberTableOffset = (int) bw.BaseStream.Position;\n\t\t\tlnt.Write (file, bw, (flags & Flags.ColumnsInfoIncluded) != 0, (flags & Flags.EndInfoIncluded) != 0);\n\n\t\t\tDataOffset = (int) bw.BaseStream.Position;\n\n\t\t\tbw.WriteLeb128 (CompileUnitIndex);\n\t\t\tbw.WriteLeb128 (LocalVariableTableOffset);\n\t\t\tbw.WriteLeb128 (NamespaceID);\n\n\t\t\tbw.WriteLeb128 (CodeBlockTableOffset);\n\t\t\tbw.WriteLeb128 (ScopeVariableTableOffset);\n\n\t\t\tbw.WriteLeb128 (RealNameOffset);\n\t\t\tbw.WriteLeb128 ((int) flags);\n\t\t}\n\n\t\tpublic void ReadAll ()\n\t\t{\n\t\t\tGetLineNumberTable ();\n\t\t\tGetLocals ();\n\t\t\tGetCodeBlocks ();\n\t\t\tGetScopeVariables ();\n\t\t\tGetRealName ();\n\t\t}\n\n\t\tpublic LineNumberTable GetLineNumberTable ()\n\t\t{\n\t\t\tlock (SymbolFile) {\n\t\t\t\tif (lnt != null)\n\t\t\t\t\treturn lnt;\n\n\t\t\t\tif (LineNumberTableOffset == 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tMyBinaryReader reader = SymbolFile.BinaryReader;\n\t\t\t\tlong old_pos = reader.BaseStream.Position;\n\t\t\t\treader.BaseStream.Position = LineNumberTableOffset;\n\n\t\t\t\tlnt = LineNumberTable.Read (SymbolFile, reader, (flags & Flags.ColumnsInfoIncluded) != 0, (flags & Flags.EndInfoIncluded) != 0);\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t\treturn lnt;\n\t\t\t}\n\t\t}\n\n\t\tpublic LocalVariableEntry[] GetLocals ()\n\t\t{\n\t\t\tlock (SymbolFile) {\n\t\t\t\tif (locals != null)\n\t\t\t\t\treturn locals;\n\n\t\t\t\tif (LocalVariableTableOffset == 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tMyBinaryReader reader = SymbolFile.BinaryReader;\n\t\t\t\tlong old_pos = reader.BaseStream.Position;\n\t\t\t\treader.BaseStream.Position = LocalVariableTableOffset;\n\n\t\t\t\tint num_locals = reader.ReadLeb128 ();\n\t\t\t\tlocals = new LocalVariableEntry [num_locals];\n\n\t\t\t\tfor (int i = 0; i < num_locals; i++)\n\t\t\t\t\tlocals [i] = new LocalVariableEntry (SymbolFile, reader);\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t\treturn locals;\n\t\t\t}\n\t\t}\n\n\t\tpublic CodeBlockEntry[] GetCodeBlocks ()\n\t\t{\n\t\t\tlock (SymbolFile) {\n\t\t\t\tif (code_blocks != null)\n\t\t\t\t\treturn code_blocks;\n\n\t\t\t\tif (CodeBlockTableOffset == 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tMyBinaryReader reader = SymbolFile.BinaryReader;\n\t\t\t\tlong old_pos = reader.BaseStream.Position;\n\t\t\t\treader.BaseStream.Position = CodeBlockTableOffset;\n\n\t\t\t\tint num_code_blocks = reader.ReadLeb128 ();\n\t\t\t\tcode_blocks = new CodeBlockEntry [num_code_blocks];\n\n\t\t\t\tfor (int i = 0; i < num_code_blocks; i++)\n\t\t\t\t\tcode_blocks [i] = new CodeBlockEntry (i, reader);\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t\treturn code_blocks;\n\t\t\t}\n\t\t}\n\n\t\tpublic ScopeVariable[] GetScopeVariables ()\n\t\t{\n\t\t\tlock (SymbolFile) {\n\t\t\t\tif (scope_vars != null)\n\t\t\t\t\treturn scope_vars;\n\n\t\t\t\tif (ScopeVariableTableOffset == 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tMyBinaryReader reader = SymbolFile.BinaryReader;\n\t\t\t\tlong old_pos = reader.BaseStream.Position;\n\t\t\t\treader.BaseStream.Position = ScopeVariableTableOffset;\n\n\t\t\t\tint num_scope_vars = reader.ReadLeb128 ();\n\t\t\t\tscope_vars = new ScopeVariable [num_scope_vars];\n\n\t\t\t\tfor (int i = 0; i < num_scope_vars; i++)\n\t\t\t\t\tscope_vars [i] = new ScopeVariable (reader);\n\n\t\t\t\treader.BaseStream.Position = old_pos;\n\t\t\t\treturn scope_vars;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetRealName ()\n\t\t{\n\t\t\tlock (SymbolFile) {\n\t\t\t\tif (real_name != null)\n\t\t\t\t\treturn real_name;\n\n\t\t\t\tif (RealNameOffset == 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\treal_name = SymbolFile.BinaryReader.ReadString (RealNameOffset);\n\t\t\t\treturn real_name;\n\t\t\t}\n\t\t}\n\n\t\tpublic int CompareTo (object obj)\n\t\t{\n\t\t\tMethodEntry method = (MethodEntry) obj;\n\n\t\t\tif (method.Token < Token)\n\t\t\t\treturn 1;\n\t\t\telse if (method.Token > Token)\n\t\t\t\treturn -1;\n\t\t\telse\n\t\t\t\treturn 0;\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[Method {0}:{1:x}:{2}:{3}]\",\n\t\t\t\t\t      index, Token, CompileUnitIndex, CompileUnit);\n\t\t}\n\t}\n\n\tpublic struct NamespaceEntry\n\t{\n\t\t#region This is actually written to the symbol file\n\t\tpublic readonly string Name;\n\t\tpublic readonly int Index;\n\t\tpublic readonly int Parent;\n\t\tpublic readonly string[] UsingClauses;\n\t\t#endregion\n\n\t\tpublic NamespaceEntry (string name, int index, string[] using_clauses, int parent)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Index = index;\n\t\t\tthis.Parent = parent;\n\t\t\tthis.UsingClauses = using_clauses != null ? using_clauses : new string [0];\n\t\t}\n\n\t\tinternal NamespaceEntry (MonoSymbolFile file, MyBinaryReader reader)\n\t\t{\n\t\t\tName = reader.ReadString ();\n\t\t\tIndex = reader.ReadLeb128 ();\n\t\t\tParent = reader.ReadLeb128 ();\n\n\t\t\tint count = reader.ReadLeb128 ();\n\t\t\tUsingClauses = new string [count];\n\t\t\tfor (int i = 0; i < count; i++)\n\t\t\t\tUsingClauses [i] = reader.ReadString ();\n\t\t}\n\n\t\tinternal void Write (MonoSymbolFile file, MyBinaryWriter bw)\n\t\t{\n\t\t\tbw.Write (Name);\n\t\t\tbw.WriteLeb128 (Index);\n\t\t\tbw.WriteLeb128 (Parent);\n\t\t\tbw.WriteLeb128 (UsingClauses.Length);\n\t\t\tforeach (string uc in UsingClauses)\n\t\t\t\tbw.Write (uc);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"[Namespace {0}:{1}:{2}]\", Name, Index, Parent);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/MonoSymbolWriter.cs",
    "content": "//\n// Mono.CSharp.Debugger/MonoSymbolWriter.cs\n//\n// Author:\n//   Martin Baulig (martin@ximian.com)\n//\n// This is the default implementation of the System.Diagnostics.SymbolStore.ISymbolWriter\n// interface.\n//\n// (C) 2002 Ximian, Inc.  http://www.ximian.com\n//\n\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing System.Runtime.CompilerServices;\nusing System.Collections.Generic;\nusing System.IO;\n\t\nnamespace Mono.CompilerServices.SymbolWriter\n{\n\tpublic class MonoSymbolWriter\n\t{\n\t\tList<SourceMethodBuilder> methods;\n\t\tList<SourceFileEntry> sources;\n\t\tList<CompileUnitEntry> comp_units;\n\t\tprotected readonly MonoSymbolFile file;\n\t\tstring filename;\n\t\t\n\t\tprivate SourceMethodBuilder current_method;\n\t\tStack<SourceMethodBuilder> current_method_stack = new Stack<SourceMethodBuilder> ();\n\n\t\tpublic MonoSymbolWriter (string filename)\n\t\t{\n\t\t\tthis.methods = new List<SourceMethodBuilder> ();\n\t\t\tthis.sources = new List<SourceFileEntry> ();\n\t\t\tthis.comp_units = new List<CompileUnitEntry> ();\n\t\t\tthis.file = new MonoSymbolFile ();\n\n\t\t\tthis.filename = filename + \".mdb\";\n\t\t}\n\n\t\tpublic MonoSymbolFile SymbolFile {\n\t\t\tget { return file; }\n\t\t}\n\n\t\tpublic void CloseNamespace ()\n\t\t{ }\n\n\t\tpublic void DefineLocalVariable (int index, string name)\n\t\t{\n\t\t\tif (current_method == null)\n\t\t\t\treturn;\n\n\t\t\tcurrent_method.AddLocal (index, name);\n\t\t}\n\n\t\tpublic void DefineCapturedLocal (int scope_id, string name, string captured_name)\n\t\t{\n\t\t\tfile.DefineCapturedVariable (scope_id, name, captured_name,\n\t\t\t\t\t\t     CapturedVariable.CapturedKind.Local);\n\t\t}\n\n\t\tpublic void DefineCapturedParameter (int scope_id, string name, string captured_name)\n\t\t{\n\t\t\tfile.DefineCapturedVariable (scope_id, name, captured_name,\n\t\t\t\t\t\t     CapturedVariable.CapturedKind.Parameter);\n\t\t}\n\n\t\tpublic void DefineCapturedThis (int scope_id, string captured_name)\n\t\t{\n\t\t\tfile.DefineCapturedVariable (scope_id, \"this\", captured_name,\n\t\t\t\t\t\t     CapturedVariable.CapturedKind.This);\n\t\t}\n\n\t\tpublic void DefineCapturedScope (int scope_id, int id, string captured_name)\n\t\t{\n\t\t\tfile.DefineCapturedScope (scope_id, id, captured_name);\n\t\t}\n\n\t\tpublic void DefineScopeVariable (int scope, int index)\n\t\t{\n\t\t\tif (current_method == null)\n\t\t\t\treturn;\n\n\t\t\tcurrent_method.AddScopeVariable (scope, index);\n\t\t}\n\n\t\tpublic void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column,\n\t\t\t\t\t       bool is_hidden)\n\t\t{\n\t\t\tif (current_method == null)\n\t\t\t\treturn;\n\n\t\t\tcurrent_method.MarkSequencePoint (offset, file, line, column, is_hidden);\n\t\t}\n\n\t\tpublic SourceMethodBuilder OpenMethod (ICompileUnit file, int ns_id, IMethodDef method)\n\t\t{\n\t\t\tSourceMethodBuilder builder = new SourceMethodBuilder (file, ns_id, method);\n\t\t\tcurrent_method_stack.Push (current_method);\n\t\t\tcurrent_method = builder;\n\t\t\tmethods.Add (current_method);\n\t\t\treturn builder;\n\t\t}\n\n\t\tpublic void CloseMethod ()\n\t\t{\n\t\t\tcurrent_method = (SourceMethodBuilder) current_method_stack.Pop ();\n\t\t}\n\n\t\tpublic SourceFileEntry DefineDocument (string url)\n\t\t{\n\t\t\tSourceFileEntry entry = new SourceFileEntry (file, url);\n\t\t\tsources.Add (entry);\n\t\t\treturn entry;\n\t\t}\n\n\t\tpublic SourceFileEntry DefineDocument (string url, byte[] guid, byte[] checksum)\n\t\t{\n\t\t\tSourceFileEntry entry = new SourceFileEntry (file, url, guid, checksum);\n\t\t\tsources.Add (entry);\n\t\t\treturn entry;\n\t\t}\n\n\t\tpublic CompileUnitEntry DefineCompilationUnit (SourceFileEntry source)\n\t\t{\n\t\t\tCompileUnitEntry entry = new CompileUnitEntry (file, source);\n\t\t\tcomp_units.Add (entry);\n\t\t\treturn entry;\n\t\t}\n\n\t\tpublic int DefineNamespace (string name, CompileUnitEntry unit,\n\t\t\t\t\t    string[] using_clauses, int parent)\n\t\t{\n\t\t\tif ((unit == null) || (using_clauses == null))\n\t\t\t\tthrow new NullReferenceException ();\n\n\t\t\treturn unit.DefineNamespace (name, using_clauses, parent);\n\t\t}\n\n\t\tpublic int OpenScope (int start_offset)\n\t\t{\n\t\t\tif (current_method == null)\n\t\t\t\treturn 0;\n\n\t\t\tcurrent_method.StartBlock (CodeBlockEntry.Type.Lexical, start_offset);\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic void CloseScope (int end_offset)\n\t\t{\n\t\t\tif (current_method == null)\n\t\t\t\treturn;\n\n\t\t\tcurrent_method.EndBlock (end_offset);\n\t\t}\n\n\t\tpublic void OpenCompilerGeneratedBlock (int start_offset)\n\t\t{\n\t\t\tif (current_method == null)\n\t\t\t\treturn;\n\n\t\t\tcurrent_method.StartBlock (CodeBlockEntry.Type.CompilerGenerated,\n\t\t\t\t\t\t   start_offset);\n\t\t}\n\n\t\tpublic void CloseCompilerGeneratedBlock (int end_offset)\n\t\t{\n\t\t\tif (current_method == null)\n\t\t\t\treturn;\n\n\t\t\tcurrent_method.EndBlock (end_offset);\n\t\t}\n\n\t\tpublic void StartIteratorBody (int start_offset)\n\t\t{\n\t\t\tcurrent_method.StartBlock (CodeBlockEntry.Type.IteratorBody,\n\t\t\t\t\t\t   start_offset);\n\t\t}\n\n\t\tpublic void EndIteratorBody (int end_offset)\n\t\t{\n\t\t\tcurrent_method.EndBlock (end_offset);\n\t\t}\n\n\t\tpublic void StartIteratorDispatcher (int start_offset)\n\t\t{\n\t\t\tcurrent_method.StartBlock (CodeBlockEntry.Type.IteratorDispatcher,\n\t\t\t\t\t\t   start_offset);\n\t\t}\n\n\t\tpublic void EndIteratorDispatcher (int end_offset)\n\t\t{\n\t\t\tcurrent_method.EndBlock (end_offset);\n\t\t}\n\n\t\tpublic void DefineAnonymousScope (int id)\n\t\t{\n\t\t\tfile.DefineAnonymousScope (id);\n\t\t}\n\n\t\tpublic void WriteSymbolFile (Guid guid)\n\t\t{\n\t\t\tforeach (SourceMethodBuilder method in methods)\n\t\t\t\tmethod.DefineMethod (file);\n\n\t\t\ttry {\n\t\t\t\t// We mmap the file, so unlink the previous version since it may be in use\n\t\t\t\tFile.Delete (filename);\n\t\t\t} catch {\n\t\t\t\t// We can safely ignore\n\t\t\t}\n\t\t\tusing (FileStream fs = new FileStream (filename, FileMode.Create, FileAccess.Write)) {\n\t\t\t\tfile.CreateSymbolFile (guid, fs);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/SourceMethodBuilder.cs",
    "content": "//\n// SourceMethodBuilder.cs\n//\n// Authors:\n//   Martin Baulig (martin@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// (C) 2002 Ximian, Inc.  http://www.ximian.com\n// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System.Collections.Generic;\n\nnamespace Mono.CompilerServices.SymbolWriter\n{\n\tpublic class SourceMethodBuilder\n\t{\n\t\tList<LocalVariableEntry> _locals;\n\t\tList<CodeBlockEntry> _blocks;\n\t\tList<ScopeVariable> _scope_vars;\n\t\tStack<CodeBlockEntry> _block_stack;\n\t\treadonly List<LineNumberEntry> method_lines;\n\n\t\treadonly ICompileUnit _comp_unit;\n\t\treadonly int ns_id;\n\t\treadonly IMethodDef method;\n\n\t\tpublic SourceMethodBuilder (ICompileUnit comp_unit)\n\t\t{\n\t\t\tthis._comp_unit = comp_unit;\n\t\t\tmethod_lines = new List<LineNumberEntry> ();\n\t\t}\n\n\t\tpublic SourceMethodBuilder (ICompileUnit comp_unit, int ns_id, IMethodDef method)\n\t\t\t: this (comp_unit)\n\t\t{\n\t\t\tthis.ns_id = ns_id;\n\t\t\tthis.method = method;\n\t\t}\n\n\t\tpublic void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column, bool is_hidden)\n\t\t{\n\t\t\tMarkSequencePoint (offset, file, line, column, -1, -1, is_hidden);\n\t\t}\n\n\t\tpublic void MarkSequencePoint (int offset, SourceFileEntry file, int line, int column, int end_line, int end_column, bool is_hidden)\n\t\t{\n\t\t\tint file_idx = file != null ? file.Index : 0;\n\t\t\tvar lne = new LineNumberEntry (file_idx, line, column, end_line, end_column, offset, is_hidden);\n\n\t\t\tif (method_lines.Count > 0) {\n\t\t\t\tvar prev = method_lines[method_lines.Count - 1];\n\n\t\t\t\t//\n\t\t\t\t// Same offset cannot be used for multiple lines\n\t\t\t\t// \n\t\t\t\tif (prev.Offset == offset) {\n\t\t\t\t\t//\n\t\t\t\t\t// Use the new location because debugger will adjust\n\t\t\t\t\t// the breakpoint to next line with sequence point\n\t\t\t\t\t//\n\t\t\t\t\tif (LineNumberEntry.LocationComparer.Default.Compare (lne, prev) > 0)\n\t\t\t\t\t\tmethod_lines[method_lines.Count - 1] = lne;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmethod_lines.Add (lne);\n\t\t}\n\n\t\tpublic void StartBlock (CodeBlockEntry.Type type, int start_offset)\n\t\t{\n\t\t\tif (_block_stack == null) {\n\t\t\t\t_block_stack = new Stack<CodeBlockEntry> ();\n\t\t\t}\n\t\t\t\n\t\t\tif (_blocks == null)\n\t\t\t\t_blocks = new List<CodeBlockEntry> ();\n\n\t\t\tint parent = CurrentBlock != null ? CurrentBlock.Index : -1;\n\n\t\t\tCodeBlockEntry block = new CodeBlockEntry (\n\t\t\t\t_blocks.Count + 1, parent, type, start_offset);\n\n\t\t\t_block_stack.Push (block);\n\t\t\t_blocks.Add (block);\n\t\t}\n\n\t\tpublic void EndBlock (int end_offset)\n\t\t{\n\t\t\tCodeBlockEntry block = (CodeBlockEntry) _block_stack.Pop ();\n\t\t\tblock.Close (end_offset);\n\t\t}\n\n\t\tpublic CodeBlockEntry[] Blocks {\n\t\t\tget {\n\t\t\t\tif (_blocks == null)\n\t\t\t\t\treturn new CodeBlockEntry [0];\n\n\t\t\t\tCodeBlockEntry[] retval = new CodeBlockEntry [_blocks.Count];\n\t\t\t\t_blocks.CopyTo (retval, 0);\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t}\n\n\t\tpublic CodeBlockEntry CurrentBlock {\n\t\t\tget {\n\t\t\t\tif ((_block_stack != null) && (_block_stack.Count > 0))\n\t\t\t\t\treturn (CodeBlockEntry) _block_stack.Peek ();\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic LocalVariableEntry[] Locals {\n\t\t\tget {\n\t\t\t\tif (_locals == null)\n\t\t\t\t\treturn new LocalVariableEntry [0];\n\t\t\t\telse {\n\t\t\t\t\treturn _locals.ToArray ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic ICompileUnit SourceFile {\n\t\t\tget {\n\t\t\t\treturn _comp_unit;\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddLocal (int index, string name)\n\t\t{\n\t\t\tif (_locals == null)\n\t\t\t\t_locals = new List<LocalVariableEntry> ();\n\t\t\tint block_idx = CurrentBlock != null ? CurrentBlock.Index : 0;\n\t\t\t_locals.Add (new LocalVariableEntry (index, name, block_idx));\n\t\t}\n\n\t\tpublic ScopeVariable[] ScopeVariables {\n\t\t\tget {\n\t\t\t\tif (_scope_vars == null)\n\t\t\t\t\treturn new ScopeVariable [0];\n\n\t\t\t\treturn _scope_vars.ToArray ();\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddScopeVariable (int scope, int index)\n\t\t{\n\t\t\tif (_scope_vars == null)\n\t\t\t\t_scope_vars = new List<ScopeVariable> ();\n\t\t\t_scope_vars.Add (\n\t\t\t\tnew ScopeVariable (scope, index));\n\t\t}\n\n\t\tpublic void DefineMethod (MonoSymbolFile file)\n\t\t{\n\t\t\tDefineMethod (file, method.Token);\n\t\t}\n\n\t\tpublic void DefineMethod (MonoSymbolFile file, int token)\n\t\t{\n\t\t\tMethodEntry entry = new MethodEntry (\n\t\t\t\tfile, _comp_unit.Entry, token, ScopeVariables,\n\t\t\t\tLocals, method_lines.ToArray (), Blocks, null, MethodEntry.Flags.ColumnsInfoIncluded, ns_id);\n\n\t\t\tfile.AddMethod (entry);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs",
    "content": "//\n// anonymous.cs: Support for anonymous methods and types\n//\n// Author:\n//   Miguel de Icaza (miguel@ximain.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n// Copyright 2003-2011 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\nusing Mono.CompilerServices.SymbolWriter;\nusing System.Diagnostics;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\nusing System.Diagnostics;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\tpublic abstract class CompilerGeneratedContainer : ClassOrStruct\n\t{\n\t\tprotected CompilerGeneratedContainer (TypeContainer parent, MemberName name, Modifiers mod)\n\t\t\t: this (parent, name, mod, MemberKind.Class)\n\t\t{\n\t\t}\n\n\t\tprotected CompilerGeneratedContainer (TypeContainer parent, MemberName name, Modifiers mod, MemberKind kind)\n\t\t\t: base (parent, name, null, kind)\n\t\t{\n\t\t\tDebug.Assert ((mod & Modifiers.AccessibilityMask) != 0);\n\n\t\t\tModFlags = mod | Modifiers.COMPILER_GENERATED | Modifiers.SEALED;\n\t\t\tspec = new TypeSpec (Kind, null, this, null, ModFlags);\n\t\t}\n\n\t\tprotected void CheckMembersDefined ()\n\t\t{\n\t\t\tif (HasMembersDefined)\n\t\t\t\tthrow new InternalErrorException (\"Helper class already defined!\");\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tif (Kind == MemberKind.Class && !IsStatic && !PartialContainer.HasInstanceConstructor) {\n\t\t\t\tDefineDefaultConstructor (false);\n\t\t\t}\n\n\t\t\treturn base.DoDefineMembers ();\n\t\t}\n\n\t\tprotected static MemberName MakeMemberName (MemberBase host, string name, int unique_id, TypeParameters tparams, Location loc)\n\t\t{\n\t\t\tstring host_name = host == null ? null : host is InterfaceMemberBase ? ((InterfaceMemberBase)host).GetFullName (host.MemberName) : host.MemberName.Name;\n\t\t\tstring tname = MakeName (host_name, \"c\", name, unique_id);\n\t\t\tTypeParameters args = null;\n\t\t\tif (tparams != null) {\n\t\t\t\targs = new TypeParameters (tparams.Count);\n\n\t\t\t\t// Type parameters will be filled later when we have TypeContainer\n\t\t\t\t// instance, for now we need only correct arity to create valid name\n\t\t\t\tfor (int i = 0; i < tparams.Count; ++i)\n\t\t\t\t\targs.Add ((TypeParameter) null);\n\t\t\t}\n\n\t\t\treturn new MemberName (tname, args, loc);\n\t\t}\n\n\t\tpublic static string MakeName (string host, string typePrefix, string name, int id)\n\t\t{\n\t\t\treturn \"<\" + host + \">\" + typePrefix + \"__\" + name + id.ToString (\"X\");\n\t\t}\n\n\t\tprotected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tbase_type = Compiler.BuiltinTypes.Object;\n\n\t\t\tbase_class = null;\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class HoistedStoreyClass : CompilerGeneratedContainer\n\t{\n\t\tpublic sealed class HoistedField : Field\n\t\t{\n\t\t\tpublic HoistedField (HoistedStoreyClass parent, FullNamedExpression type, Modifiers mod, string name,\n\t\t\t\t  Attributes attrs, Location loc)\n\t\t\t\t: base (parent, type, mod, new MemberName (name, loc), attrs)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override bool ResolveMemberType ()\n\t\t\t{\n\t\t\t\tif (!base.ResolveMemberType ())\n\t\t\t\t\treturn false;\n\n\t\t\t\tHoistedStoreyClass parent = ((HoistedStoreyClass) Parent).GetGenericStorey ();\n\t\t\t\tif (parent != null && parent.Mutator != null)\n\t\t\t\t\tmember_type = parent.Mutator.Mutate (MemberType);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tprotected TypeParameterMutator mutator;\n\n\t\tpublic HoistedStoreyClass (TypeDefinition parent, MemberName name, TypeParameters tparams, Modifiers mods, MemberKind kind)\n\t\t\t: base (parent, name, mods | Modifiers.PRIVATE, kind)\n\t\t{\n\n\t\t\tif (tparams != null) {\n\t\t\t\tvar type_params = name.TypeParameters;\n\t\t\t\tvar src = new TypeParameterSpec[tparams.Count];\n\t\t\t\tvar dst = new TypeParameterSpec[tparams.Count];\n\n\t\t\t\tfor (int i = 0; i < tparams.Count; ++i) {\n\t\t\t\t\ttype_params[i] = tparams[i].CreateHoistedCopy (spec);\n\n\t\t\t\t\tsrc[i] = tparams[i].Type;\n\t\t\t\t\tdst[i] = type_params[i].Type;\n\t\t\t\t}\n\n\t\t\t\t// A copy is not enough, inflate any type parameter constraints\n\t\t\t\t// using a new type parameters\n\t\t\t\tvar inflator = new TypeParameterInflator (this, null, src, dst);\n\t\t\t\tfor (int i = 0; i < tparams.Count; ++i) {\n\t\t\t\t\tsrc[i].InflateConstraints (inflator, dst[i]);\n\t\t\t\t}\n\n\t\t\t\tmutator = new TypeParameterMutator (tparams, type_params);\n\t\t\t}\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic TypeParameterMutator Mutator {\n\t\t\tget {\n\t\t\t\treturn mutator;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tmutator = value;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic HoistedStoreyClass GetGenericStorey ()\n\t\t{\n\t\t\tTypeContainer storey = this;\n\t\t\twhile (storey != null && storey.CurrentTypeParameters == null)\n\t\t\t\tstorey = storey.Parent;\n\n\t\t\treturn storey as HoistedStoreyClass;\n\t\t}\n\t}\n\n\n\t//\n\t// Anonymous method storey is created when an anonymous method uses\n\t// variable or parameter from outer scope. They are then hoisted to\n\t// anonymous method storey (captured)\n\t//\n\tpublic class AnonymousMethodStorey : HoistedStoreyClass\n\t{\n\t\tstruct StoreyFieldPair\n\t\t{\n\t\t\tpublic readonly AnonymousMethodStorey Storey;\n\t\t\tpublic readonly Field Field;\n\n\t\t\tpublic StoreyFieldPair (AnonymousMethodStorey storey, Field field)\n\t\t\t{\n\t\t\t\tthis.Storey = storey;\n\t\t\t\tthis.Field = field;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Needed to delay hoisted _this_ initialization. When an anonymous\n\t\t// method is used inside ctor and _this_ is hoisted, base ctor has to\n\t\t// be called first, otherwise _this_ will be initialized with \n\t\t// uninitialized value.\n\t\t//\n\t\tsealed class ThisInitializer : Statement\n\t\t{\n\t\t\treadonly HoistedThis hoisted_this;\n\t\t\treadonly AnonymousMethodStorey parent;\n\n\t\t\tpublic ThisInitializer (HoistedThis hoisted_this, AnonymousMethodStorey parent)\n\t\t\t{\n\t\t\t\tthis.hoisted_this = hoisted_this;\n\t\t\t\tthis.parent = parent;\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\tExpression source;\n\n\t\t\t\tif (parent == null)\n\t\t\t\t\tsource = new CompilerGeneratedThis (ec.CurrentType, loc);\n\t\t\t\telse {\n\t\t\t\t\tsource = new FieldExpr (parent.HoistedThis.Field, Location.Null) {\n\t\t\t\t\t\tInstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location.Null)\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\thoisted_this.EmitAssign (ec, source, false, false);\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t\t// Nothing to clone\n\t\t\t}\n\t\t}\n\n\t\t// Unique storey ID\n\t\tpublic readonly int ID;\n\n\t\tpublic readonly ExplicitBlock OriginalSourceBlock;\n\n\t\t// A list of StoreyFieldPair with local field keeping parent storey instance\n\t\tList<StoreyFieldPair> used_parent_storeys;\n\t\tList<ExplicitBlock> children_references;\n\n\t\t// A list of hoisted parameters\n\t\tprotected List<HoistedParameter> hoisted_params;\n\t\tList<HoistedParameter> hoisted_local_params;\n\t\tprotected List<HoistedVariable> hoisted_locals;\n\n\t\t// Hoisted this\n\t\tprotected HoistedThis hoisted_this;\n\n\t\t// Local variable which holds this storey instance\n\t\tpublic Expression Instance;\n\n\t\tbool initialize_hoisted_this;\n\t\tAnonymousMethodStorey hoisted_this_parent;\n\n\t\tpublic AnonymousMethodStorey (ExplicitBlock block, TypeDefinition parent, MemberBase host, TypeParameters tparams, string name, MemberKind kind)\n\t\t\t: base (parent, MakeMemberName (host, name, parent.PartialContainer.CounterAnonymousContainers, tparams, block.StartLocation),\n\t\t\t\ttparams, 0, kind)\n\t\t{\n\t\t\tOriginalSourceBlock = block;\n\t\t\tID = parent.PartialContainer.CounterAnonymousContainers++;\n\t\t}\n\n\t\tpublic void AddCapturedThisField (EmitContext ec, AnonymousMethodStorey parent)\n\t\t{\n\t\t\tTypeExpr type_expr = new TypeExpression (ec.CurrentType, Location);\n\t\t\tField f = AddCompilerGeneratedField (\"$this\", type_expr);\n\t\t\thoisted_this = new HoistedThis (this, f);\n\n\t\t\tinitialize_hoisted_this = true;\n\t\t\thoisted_this_parent = parent;\n\t\t}\n\n\t\tpublic Field AddCapturedVariable (string name, TypeSpec type)\n\t\t{\n\t\t\tCheckMembersDefined ();\n\n\t\t\tFullNamedExpression field_type = new TypeExpression (type, Location);\n\t\t\tif (!spec.IsGenericOrParentIsGeneric)\n\t\t\t\treturn AddCompilerGeneratedField (name, field_type);\n\n\t\t\tconst Modifiers mod = Modifiers.INTERNAL | Modifiers.COMPILER_GENERATED;\n\t\t\tField f = new HoistedField (this, field_type, mod, name, null, Location);\n\t\t\tAddField (f);\n\t\t\treturn f;\n\t\t}\n\n\t\tprotected Field AddCompilerGeneratedField (string name, FullNamedExpression type)\n\t\t{\n\t\t\treturn AddCompilerGeneratedField (name, type, false);\n\t\t}\n\n\t\tprotected Field AddCompilerGeneratedField (string name, FullNamedExpression type, bool privateAccess)\n\t\t{\n\t\t\tModifiers mod = Modifiers.COMPILER_GENERATED | (privateAccess ? Modifiers.PRIVATE : Modifiers.INTERNAL);\n\t\t\tField f = new Field (this, type, mod, new MemberName (name, Location), null);\n\t\t\tAddField (f);\n\t\t\treturn f;\n\t\t}\n\n\t\t//\n\t\t// Creates a link between hoisted variable block and the anonymous method storey\n\t\t//\n\t\t// An anonymous method can reference variables from any outer block, but they are\n\t\t// hoisted in their own ExplicitBlock. When more than one block is referenced we\n\t\t// need to create another link between those variable storeys\n\t\t//\n\t\tpublic void AddReferenceFromChildrenBlock (ExplicitBlock block)\n\t\t{\n\t\t\tif (children_references == null)\n\t\t\t\tchildren_references = new List<ExplicitBlock> ();\n\n\t\t\tif (!children_references.Contains (block))\n\t\t\t\tchildren_references.Add (block);\n\t\t}\n\n\t\tpublic void AddParentStoreyReference (EmitContext ec, AnonymousMethodStorey storey)\n\t\t{\n\t\t\tCheckMembersDefined ();\n\n\t\t\tif (used_parent_storeys == null)\n\t\t\t\tused_parent_storeys = new List<StoreyFieldPair> ();\n\t\t\telse if (used_parent_storeys.Exists (i => i.Storey == storey))\n\t\t\t\treturn;\n\n\t\t\tTypeExpr type_expr = storey.CreateStoreyTypeExpression (ec);\n\t\t\tField f = AddCompilerGeneratedField (\"<>f__ref$\" + storey.ID, type_expr);\n\t\t\tused_parent_storeys.Add (new StoreyFieldPair (storey, f));\n\t\t}\n\n\t\tpublic void CaptureLocalVariable (ResolveContext ec, LocalVariable localVariable)\n\t\t{\n\t\t\tif (this is StateMachine) {\n\t\t\t\tif (ec.CurrentBlock.ParametersBlock != localVariable.Block.ParametersBlock)\n\t\t\t\t\tec.CurrentBlock.Explicit.HasCapturedVariable = true;\n\t\t\t} else {\n\t\t\t\tec.CurrentBlock.Explicit.HasCapturedVariable = true;\n\t\t\t}\n\n\t\t\tvar hoisted = localVariable.HoistedVariant;\n\t\t\tif (hoisted != null && hoisted.Storey != this && hoisted.Storey is StateMachine) {\n\t\t\t\t//\n\t\t\t\t// Variable is already hoisted but we need it in storey which can be shared\n\t\t\t\t//\n\t\t\t\thoisted.Storey.hoisted_locals.Remove (hoisted);\n\t\t\t\thoisted.Storey.Members.Remove (hoisted.Field);\n\t\t\t\thoisted = null;\n\t\t\t}\n\n\t\t\tif (hoisted == null) {\n\t\t\t\thoisted = new HoistedLocalVariable (this, localVariable, GetVariableMangledName (localVariable));\n\t\t\t\tlocalVariable.HoistedVariant = hoisted;\n\n\t\t\t\tif (hoisted_locals == null)\n\t\t\t\t\thoisted_locals = new List<HoistedVariable> ();\n\n\t\t\t\thoisted_locals.Add (hoisted);\n\t\t\t}\n\n\t\t\tif (ec.CurrentBlock.Explicit != localVariable.Block.Explicit && !(hoisted.Storey is StateMachine))\n\t\t\t\thoisted.Storey.AddReferenceFromChildrenBlock (ec.CurrentBlock.Explicit);\n\t\t}\n\n\t\tpublic void CaptureParameter (ResolveContext ec, ParametersBlock.ParameterInfo parameterInfo, ParameterReference parameterReference)\n\t\t{\n\t\t\tif (!(this is StateMachine)) {\n\t\t\t\tec.CurrentBlock.Explicit.HasCapturedVariable = true;\n\t\t\t}\n\n\t\t\tvar hoisted = parameterInfo.Parameter.HoistedVariant;\n\n\t\t\tif (parameterInfo.Block.StateMachine != null) {\n\t\t\t\t//\n\t\t\t\t// Another storey in same block exists but state machine does not\n\t\t\t\t// have parameter captured. We need to add it there as well to\n\t\t\t\t// proxy parameter value correctly.\n\t\t\t\t//\n\t\t\t\tif (hoisted == null && parameterInfo.Block.StateMachine != this) {\n\t\t\t\t\tvar storey = parameterInfo.Block.StateMachine;\n\n\t\t\t\t\thoisted = new HoistedParameter (storey, parameterReference);\n\t\t\t\t\tparameterInfo.Parameter.HoistedVariant = hoisted;\n\n\t\t\t\t\tif (storey.hoisted_params == null)\n\t\t\t\t\t\tstorey.hoisted_params = new List<HoistedParameter> ();\n\n\t\t\t\t\tstorey.hoisted_params.Add (hoisted);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Lift captured parameter from value type storey to reference type one. Otherwise\n\t\t\t\t// any side effects would be done on a copy\n\t\t\t\t//\n\t\t\t\tif (hoisted != null && hoisted.Storey != this && hoisted.Storey is StateMachine) {\n\t\t\t\t\tif (hoisted_local_params == null)\n\t\t\t\t\t\thoisted_local_params = new List<HoistedParameter> ();\n\n\t\t\t\t\thoisted_local_params.Add (hoisted);\n\t\t\t\t\thoisted = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hoisted == null) {\n\t\t\t\thoisted = new HoistedParameter (this, parameterReference);\n\t\t\t\tparameterInfo.Parameter.HoistedVariant = hoisted;\n\n\t\t\t\tif (hoisted_params == null)\n\t\t\t\t\thoisted_params = new List<HoistedParameter> ();\n\n\t\t\t\thoisted_params.Add (hoisted);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Register link between current block and parameter storey. It will\n\t\t\t// be used when setting up storey definition to deploy storey reference\n\t\t\t// when parameters are used from multiple blocks\n\t\t\t//\n\t\t\tif (ec.CurrentBlock.Explicit != parameterInfo.Block) {\n\t\t\t\thoisted.Storey.AddReferenceFromChildrenBlock (ec.CurrentBlock.Explicit);\n\t\t\t}\n\t\t}\n\n\t\tTypeExpr CreateStoreyTypeExpression (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Create an instance of storey type\n\t\t\t//\n\t\t\tTypeExpr storey_type_expr;\n\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\t//\n\t\t\t\t// Use current method type parameter (MVAR) for top level storey only. All\n\t\t\t\t// nested storeys use class type parameter (VAR)\n\t\t\t\t//\n\t\t\t\tvar tparams = ec.CurrentAnonymousMethod != null && ec.CurrentAnonymousMethod.Storey != null ?\n\t\t\t\t\tec.CurrentAnonymousMethod.Storey.CurrentTypeParameters :\n\t\t\t\t\tec.CurrentTypeParameters;\n\n\t\t\t\tTypeArguments targs = new TypeArguments ();\n\n\t\t\t\t//\n\t\t\t\t// Use type parameter name instead of resolved type parameter\n\t\t\t\t// specification to resolve to correctly nested type parameters\n\t\t\t\t//\n\t\t\t\tfor (int i = 0; i < tparams.Count; ++i)\n\t\t\t\t\ttargs.Add (new SimpleName (tparams [i].Name, Location)); //  new TypeParameterExpr (tparams[i], Location));\n\n\t\t\t\tstorey_type_expr = new GenericTypeExpr (Definition, targs, Location);\n\t\t\t} else {\n\t\t\t\tstorey_type_expr = new TypeExpression (CurrentType, Location);\n\t\t\t}\n\n\t\t\treturn storey_type_expr;\n\t\t}\n\n\t\tpublic void SetNestedStoryParent (AnonymousMethodStorey parentStorey)\n\t\t{\n\t\t\tParent = parentStorey;\n\t\t\tspec.IsGeneric = false;\n\t\t\tspec.DeclaringType = parentStorey.CurrentType;\n\t\t\tMemberName.TypeParameters = null;\n\t\t}\n\n\t\tprotected override bool DoResolveTypeParameters ()\n\t\t{\n\t\t\t// Although any storey can have type parameters they are all clones of method type\n\t\t\t// parameters therefore have to mutate MVAR references in any of cloned constraints\n\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\t\tvar spec = CurrentTypeParameters[i].Type;\n\t\t\t\t\tspec.BaseType = mutator.Mutate (spec.BaseType);\n\t\t\t\t\tif (spec.InterfacesDefined != null) {\n\t\t\t\t\t\tvar mutated = new TypeSpec[spec.InterfacesDefined.Length];\n\t\t\t\t\t\tfor (int ii = 0; ii < mutated.Length; ++ii) {\n\t\t\t\t\t\t\tmutated[ii] = mutator.Mutate (spec.InterfacesDefined[ii]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tspec.InterfacesDefined = mutated;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (spec.TypeArguments != null) {\n\t\t\t\t\t\tspec.TypeArguments = mutator.Mutate (spec.TypeArguments);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Update parent cache as we most likely passed the point\n\t\t\t// where the cache was constructed\n\t\t\t//\n\t\t\tParent.CurrentType.MemberCache.AddMember (this.spec);\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Initializes all hoisted variables\n\t\t//\n\t\tpublic void EmitStoreyInstantiation (EmitContext ec, ExplicitBlock block)\n\t\t{\n\t\t\t// There can be only one instance variable for each storey type\n\t\t\tif (Instance != null)\n\t\t\t\tthrow new InternalErrorException ();\n\n\t\t\t//\n\t\t\t// Create an instance of this storey\n\t\t\t//\n\t\t\tResolveContext rc = new ResolveContext (ec.MemberContext);\n\t\t\trc.CurrentBlock = block;\n\n\t\t\tvar storey_type_expr = CreateStoreyTypeExpression (ec);\n\t\t\tvar source = new New (storey_type_expr, null, Location).Resolve (rc);\n\n\t\t\t//\n\t\t\t// When the current context is async (or iterator) lift local storey\n\t\t\t// instantiation to the currect storey\n\t\t\t//\n\t\t\tif (ec.CurrentAnonymousMethod is StateMachineInitializer && (block.HasYield || block.HasAwait)) {\n\t\t\t\t//\n\t\t\t\t// Unfortunately, normal capture mechanism could not be used because we are\n\t\t\t\t// too late in the pipeline and standart assign cannot be used either due to\n\t\t\t\t// recursive nature of GetStoreyInstanceExpression\n\t\t\t\t//\n\t\t\t\tvar field = ec.CurrentAnonymousMethod.Storey.AddCompilerGeneratedField (\n\t\t\t\t\tLocalVariable.GetCompilerGeneratedName (block), storey_type_expr, true);\n\n\t\t\t\tfield.Define ();\n\t\t\t\tfield.Emit ();\n\n\t\t\t\tvar fexpr = new FieldExpr (field, Location);\n\t\t\t\tfexpr.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location);\n\t\t\t\tfexpr.EmitAssign (ec, source, false, false);\n\t\t\t\tInstance = fexpr;\n\t\t\t} else {\n\t\t\t\tvar local = TemporaryVariableReference.Create (source.Type, block, Location);\n\t\t\t\tif (source.Type.IsStruct) {\n\t\t\t\t\tlocal.LocalInfo.CreateBuilder (ec);\n\t\t\t\t} else {\n\t\t\t\t\tlocal.EmitAssign (ec, source);\n\t\t\t\t}\n\n\t\t\t\tInstance = local;\n\t\t\t}\n\n\t\t\tEmitHoistedFieldsInitialization (rc, ec);\n\n\t\t\t// TODO: Implement properly\n\t\t\t//SymbolWriter.DefineScopeVariable (ID, Instance.Builder);\n\t\t}\n\n\t\tvoid EmitHoistedFieldsInitialization (ResolveContext rc, EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Initialize all storey reference fields by using local or hoisted variables\n\t\t\t//\n\t\t\tif (used_parent_storeys != null) {\n\t\t\t\tforeach (StoreyFieldPair sf in used_parent_storeys) {\n\t\t\t\t\t//\n\t\t\t\t\t// Get instance expression of storey field\n\t\t\t\t\t//\n\t\t\t\t\tExpression instace_expr = GetStoreyInstanceExpression (ec);\n\t\t\t\t\tvar fs = sf.Field.Spec;\n\t\t\t\t\tif (TypeManager.IsGenericType (instace_expr.Type))\n\t\t\t\t\t\tfs = MemberCache.GetMember (instace_expr.Type, fs);\n\n\t\t\t\t\tFieldExpr f_set_expr = new FieldExpr (fs, Location);\n\t\t\t\t\tf_set_expr.InstanceExpression = instace_expr;\n\n\t\t\t\t\t// TODO: CompilerAssign expression\n\t\t\t\t\tSimpleAssign a = new SimpleAssign (f_set_expr, sf.Storey.GetStoreyInstanceExpression (ec));\n\t\t\t\t\tif (a.Resolve (rc) != null)\n\t\t\t\t\t\ta.EmitStatement (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Initialize hoisted `this' only once, everywhere else will be\n\t\t\t// referenced indirectly\n\t\t\t//\n\t\t\tif (initialize_hoisted_this) {\n\t\t\t\trc.CurrentBlock.AddScopeStatement (new ThisInitializer (hoisted_this, hoisted_this_parent));\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Setting currect anonymous method to null blocks any further variable hoisting\n\t\t\t//\n\t\t\tAnonymousExpression ae = ec.CurrentAnonymousMethod;\n\t\t\tec.CurrentAnonymousMethod = null;\n\n\t\t\tif (hoisted_params != null) {\n\t\t\t\tEmitHoistedParameters (ec, hoisted_params);\n\t\t\t}\n\n\t\t\tec.CurrentAnonymousMethod = ae;\n\t\t}\n\n\t\tprotected virtual void EmitHoistedParameters (EmitContext ec, List<HoistedParameter> hoisted)\n\t\t{\n\t\t\tforeach (HoistedParameter hp in hoisted) {\n\t\t\t\tif (hp == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//\n\t\t\t\t// Parameters could be proxied via local fields for value type storey\n\t\t\t\t//\n\t\t\t\tif (hoisted_local_params != null) {\n\t\t\t\t\tvar local_param = hoisted_local_params.Find (l => l.Parameter.Parameter == hp.Parameter.Parameter);\n\t\t\t\t\tvar source = new FieldExpr (local_param.Field, Location);\n\t\t\t\t\tsource.InstanceExpression = new CompilerGeneratedThis (CurrentType, Location);\n\t\t\t\t\thp.EmitAssign (ec, source, false, false);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\thp.EmitHoistingAssignment (ec);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns a field which holds referenced storey instance\n\t\t//\n\t\tField GetReferencedStoreyField (AnonymousMethodStorey storey)\n\t\t{\n\t\t\tif (used_parent_storeys == null)\n\t\t\t\treturn null;\n\n\t\t\tforeach (StoreyFieldPair sf in used_parent_storeys) {\n\t\t\t\tif (sf.Storey == storey)\n\t\t\t\t\treturn sf.Field;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Creates storey instance expression regardless of currect IP\n\t\t//\n\t\tpublic Expression GetStoreyInstanceExpression (EmitContext ec)\n\t\t{\n\t\t\tAnonymousExpression am = ec.CurrentAnonymousMethod;\n\n\t\t\t//\n\t\t\t// Access from original block -> storey\n\t\t\t//\n\t\t\tif (am == null)\n\t\t\t\treturn Instance;\n\n\t\t\t//\n\t\t\t// Access from anonymous method implemented as a static -> storey\n\t\t\t//\n\t\t\tif (am.Storey == null)\n\t\t\t\treturn Instance;\n\n\t\t\tField f = am.Storey.GetReferencedStoreyField (this);\n\t\t\tif (f == null) {\n\t\t\t\tif (am.Storey == this) {\n\t\t\t\t\t//\n\t\t\t\t\t// Access from inside of same storey (S -> S)\n\t\t\t\t\t//\n\t\t\t\t\treturn new CompilerGeneratedThis (CurrentType, Location);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// External field access\n\t\t\t\t//\n\t\t\t\treturn Instance;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Storey was cached to local field\n\t\t\t//\n\t\t\tFieldExpr f_ind = new FieldExpr (f, Location);\n\t\t\tf_ind.InstanceExpression = new CompilerGeneratedThis (CurrentType, Location);\n\t\t\treturn f_ind;\n\t\t}\n\n\t\tprotected virtual string GetVariableMangledName (LocalVariable local_info)\n\t\t{\n\t\t\t//\n\t\t\t// No need to mangle anonymous method hoisted variables cause they\n\t\t\t// are hoisted in their own scopes\n\t\t\t//\n\t\t\treturn local_info.Name;\n\t\t}\n\n\t\tpublic HoistedThis HoistedThis {\n\t\t\tget {\n\t\t\t\treturn hoisted_this;\n\t\t\t}\n\t\t\tset {\n\t\t\t\thoisted_this = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<ExplicitBlock> ReferencesFromChildrenBlock {\n\t\t\tget { return children_references; }\n\t\t}\n\t}\n\n\tpublic abstract class HoistedVariable\n\t{\n\t\t//\n\t\t// Hoisted version of variable references used in expression\n\t\t// tree has to be delayed until we know its location. The variable\n\t\t// doesn't know its location until all stories are calculated\n\t\t//\n\t\tclass ExpressionTreeVariableReference : Expression\n\t\t{\n\t\t\treadonly HoistedVariable hv;\n\n\t\t\tpublic ExpressionTreeVariableReference (HoistedVariable hv)\n\t\t\t{\n\t\t\t\tthis.hv = hv;\n\t\t\t}\n\n\t\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\treturn hv.CreateExpressionTree ();\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\teclass = ExprClass.Value;\n\t\t\t\ttype = ec.Module.PredefinedTypes.Expression.Resolve ();\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tResolveContext rc = new ResolveContext (ec.MemberContext);\n\t\t\t\tExpression e = hv.GetFieldExpression (ec).CreateExpressionTree (rc, false);\n\t\t\t\t// This should never fail\n\t\t\t\te = e.Resolve (rc);\n\t\t\t\tif (e != null)\n\t\t\t\t\te.Emit (ec);\n\t\t\t}\n\t\t}\n\t\n\t\tprotected readonly AnonymousMethodStorey storey;\n\t\tprotected Field field;\n\t\tDictionary<AnonymousExpression, FieldExpr> cached_inner_access; // TODO: Hashtable is too heavyweight\n\t\tFieldExpr cached_outer_access;\n\n\t\tprotected HoistedVariable (AnonymousMethodStorey storey, string name, TypeSpec type)\n\t\t\t: this (storey, storey.AddCapturedVariable (name, type))\n\t\t{\n\t\t}\n\n\t\tprotected HoistedVariable (AnonymousMethodStorey storey, Field field)\n\t\t{\n\t\t\tthis.storey = storey;\n\t\t\tthis.field = field;\n\t\t}\n\n\t\tpublic Field Field {\n\t\t\tget {\n\t\t\t\treturn field;\n\t\t\t}\n\t\t}\n\n\t\tpublic AnonymousMethodStorey Storey {\n\t\t\tget {\n\t\t\t\treturn storey;\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tGetFieldExpression (ec).AddressOf (ec, mode);\n\t\t}\n\n\t\tpublic Expression CreateExpressionTree ()\n\t\t{\n\t\t\treturn new ExpressionTreeVariableReference (this);\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec)\n\t\t{\n\t\t\tGetFieldExpression (ec).Emit (ec);\n\t\t}\n\n\t\tpublic Expression EmitToField (EmitContext ec)\n\t\t{\n\t\t\treturn GetFieldExpression (ec);\n\t\t}\n\n\t\t//\n\t\t// Creates field access expression for hoisted variable\n\t\t//\n\t\tprotected virtual FieldExpr GetFieldExpression (EmitContext ec)\n\t\t{\n\t\t\tif (ec.CurrentAnonymousMethod == null || ec.CurrentAnonymousMethod.Storey == null) {\n\t\t\t\tif (cached_outer_access != null)\n\t\t\t\t\treturn cached_outer_access;\n\n\t\t\t\t//\n\t\t\t\t// When setting top-level hoisted variable in generic storey\n\t\t\t\t// change storey generic types to method generic types (VAR -> MVAR)\n\t\t\t\t//\n\t\t\t\tif (storey.Instance.Type.IsGenericOrParentIsGeneric) {\n\t\t\t\t\tvar fs = MemberCache.GetMember (storey.Instance.Type, field.Spec);\n\t\t\t\t\tcached_outer_access = new FieldExpr (fs, field.Location);\n\t\t\t\t} else {\n\t\t\t\t\tcached_outer_access = new FieldExpr (field, field.Location);\n\t\t\t\t}\n\n\t\t\t\tcached_outer_access.InstanceExpression = storey.GetStoreyInstanceExpression (ec);\n\t\t\t\treturn cached_outer_access;\n\t\t\t}\n\n\t\t\tFieldExpr inner_access;\n\t\t\tif (cached_inner_access != null) {\n\t\t\t\tif (!cached_inner_access.TryGetValue (ec.CurrentAnonymousMethod, out inner_access))\n\t\t\t\t\tinner_access = null;\n\t\t\t} else {\n\t\t\t\tinner_access = null;\n\t\t\t\tcached_inner_access = new Dictionary<AnonymousExpression, FieldExpr> (4);\n\t\t\t}\n\n\t\t\tif (inner_access == null) {\n\t\t\t\tif (field.Parent.IsGenericOrParentIsGeneric) {\n\t\t\t\t\tvar fs = MemberCache.GetMember (field.Parent.CurrentType, field.Spec);\n\t\t\t\t\tinner_access = new FieldExpr (fs, field.Location);\n\t\t\t\t} else {\n\t\t\t\t\tinner_access = new FieldExpr (field, field.Location);\n\t\t\t\t}\n\n\t\t\t\tinner_access.InstanceExpression = storey.GetStoreyInstanceExpression (ec);\n\t\t\t\tcached_inner_access.Add (ec.CurrentAnonymousMethod, inner_access);\n\t\t\t}\n\n\t\t\treturn inner_access;\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tGetFieldExpression (ec).Emit (ec, leave_copy);\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tGetFieldExpression (ec).EmitAssign (ec, source, leave_copy, false);\n\t\t}\n\t}\n\n\tpublic class HoistedParameter : HoistedVariable\n\t{\n\t\tsealed class HoistedFieldAssign : CompilerAssign\n\t\t{\n\t\t\tpublic HoistedFieldAssign (Expression target, Expression source)\n\t\t\t\t: base (target, source, target.Location)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override Expression ResolveConversions (ResolveContext ec)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Implicit conversion check fails for hoisted type arguments\n\t\t\t\t// as they are of different types (!!0 x !0)\n\t\t\t\t//\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\treadonly ParameterReference parameter;\n\n\t\tpublic HoistedParameter (AnonymousMethodStorey scope, ParameterReference par)\n\t\t\t: base (scope, par.Name, par.Type)\n\t\t{\n\t\t\tthis.parameter = par;\n\t\t}\n\n\t\tpublic HoistedParameter (HoistedParameter hp, string name)\n\t\t\t: base (hp.storey, name, hp.parameter.Type)\n\t\t{\n\t\t\tthis.parameter = hp.parameter;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsAssigned { get; set; }\n\n\t\tpublic ParameterReference Parameter {\n\t\t\tget {\n\t\t\t\treturn parameter;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void EmitHoistingAssignment (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Remove hoisted redirection to emit assignment from original parameter\n\t\t\t//\n\t\t\tvar temp = parameter.Parameter.HoistedVariant;\n\t\t\tparameter.Parameter.HoistedVariant = null;\n\n\t\t\tvar a = new HoistedFieldAssign (GetFieldExpression (ec), parameter);\n\t\t\ta.EmitStatement (ec);\n\n\t\t\tparameter.Parameter.HoistedVariant = temp;\n\t\t}\n\t}\n\n\tclass HoistedLocalVariable : HoistedVariable\n\t{\n\t\tpublic HoistedLocalVariable (AnonymousMethodStorey storey, LocalVariable local, string name)\n\t\t\t: base (storey, name, local.Type)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class HoistedThis : HoistedVariable\n\t{\n\t\tpublic HoistedThis (AnonymousMethodStorey storey, Field field)\n\t\t\t: base (storey, field)\n\t\t{\n\t\t}\n\t}\n\n\t//\n\t// Anonymous method expression as created by parser\n\t//\n\tpublic class AnonymousMethodExpression : Expression\n\t{\n\t\t//\n\t\t// Special conversion for nested expression tree lambdas\n\t\t//\n\t\tclass Quote : ShimExpression\n\t\t{\n\t\t\tpublic Quote (Expression expr)\n\t\t\t\t: base (expr)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\tvar args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (expr.CreateExpressionTree (ec)));\n\t\t\t\treturn CreateExpressionFactoryCall (ec, \"Quote\", args);\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t\t{\n\t\t\t\texpr = expr.Resolve (rc);\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\teclass = expr.eclass;\n\t\t\t\ttype = expr.Type;\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\treadonly Dictionary<TypeSpec, Expression> compatibles;\n\n\t\tpublic ParametersBlock Block;\n\n\t\tpublic AnonymousMethodExpression (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t\tthis.compatibles = new Dictionary<TypeSpec, Expression> ();\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override string ExprClassName {\n\t\t\tget {\n\t\t\t\treturn \"anonymous method\";\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool HasExplicitParameters {\n\t\t\tget {\n\t\t\t\treturn Parameters != ParametersCompiled.Undefined;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic ParametersCompiled Parameters {\n\t\t\tget {\n\t\t\t\treturn Block.Parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAsync {\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\n\t\tpublic ReportPrinter TypeInferenceReportPrinter {\n\t\t\tget; set;\n\t\t}\n\n\t\t#endregion\n\n\t\t//\n\t\t// Returns true if the body of lambda expression can be implicitly\n\t\t// converted to the delegate of type `delegate_type'\n\t\t//\n\t\tpublic bool ImplicitStandardConversionExists (ResolveContext ec, TypeSpec delegate_type)\n\t\t{\n\t\t\tusing (ec.With (ResolveContext.Options.InferReturnType, false)) {\n\t\t\t\tusing (ec.Set (ResolveContext.Options.ProbingMode)) {\n\t\t\t\t\tvar prev = ec.Report.SetPrinter (TypeInferenceReportPrinter ?? new NullReportPrinter ());\n\n\t\t\t\t\tvar res = Compatible (ec, delegate_type) != null;\n\n\t\t\t\t\tec.Report.SetPrinter (prev);\n\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTypeSpec CompatibleChecks (ResolveContext ec, TypeSpec delegate_type)\n\t\t{\n\t\t\tif (delegate_type.IsDelegate)\n\t\t\t\treturn delegate_type;\n\n\t\t\tif (delegate_type.IsExpressionTreeType) {\n\t\t\t\tdelegate_type = delegate_type.TypeArguments [0];\n\t\t\t\tif (delegate_type.IsDelegate)\n\t\t\t\t\treturn delegate_type;\n\n\t\t\t\tec.Report.Error (835, loc, \"Cannot convert `{0}' to an expression tree of non-delegate type `{1}'\",\n\t\t\t\t\tGetSignatureForError (), delegate_type.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tec.Report.Error (1660, loc, \"Cannot convert `{0}' to non-delegate type `{1}'\",\n\t\t\t\t      GetSignatureForError (), delegate_type.GetSignatureForError ());\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected bool VerifyExplicitParameters (ResolveContext ec, TypeInferenceContext tic, TypeSpec delegate_type, AParametersCollection parameters)\n\t\t{\n\t\t\tif (VerifyParameterCompatibility (ec, tic, delegate_type, parameters, ec.IsInProbingMode))\n\t\t\t\treturn true;\n\n\t\t\tif (!ec.IsInProbingMode)\n\t\t\t\tec.Report.Error (1661, loc,\n\t\t\t\t\t\"Cannot convert `{0}' to delegate type `{1}' since there is a parameter mismatch\",\n\t\t\t\t\tGetSignatureForError (), delegate_type.GetSignatureForError ());\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected bool VerifyParameterCompatibility (ResolveContext ec, TypeInferenceContext tic, TypeSpec delegate_type, AParametersCollection invoke_pd, bool ignore_errors)\n\t\t{\n\t\t\tif (Parameters.Count != invoke_pd.Count) {\n\t\t\t\tif (ignore_errors)\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\tec.Report.Error (1593, loc, \"Delegate `{0}' does not take `{1}' arguments\",\n\t\t\t\t\t      delegate_type.GetSignatureForError (), Parameters.Count.ToString ());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool has_implicit_parameters = !HasExplicitParameters;\n\t\t\tbool error = false;\n\n\t\t\tfor (int i = 0; i < Parameters.Count; ++i) {\n\t\t\t\tParameter.Modifier p_mod = invoke_pd.FixedParameters [i].ModFlags;\n\t\t\t\tif (Parameters.FixedParameters [i].ModFlags != p_mod && p_mod != Parameter.Modifier.PARAMS) {\n\t\t\t\t\tif (ignore_errors)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t\tif (p_mod == Parameter.Modifier.NONE)\n\t\t\t\t\t\tec.Report.Error (1677, Parameters[i].Location, \"Parameter `{0}' should not be declared with the `{1}' keyword\",\n\t\t\t\t\t\t\t      (i + 1).ToString (), Parameter.GetModifierSignature (Parameters [i].ModFlags));\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Report.Error (1676, Parameters[i].Location, \"Parameter `{0}' must be declared with the `{1}' keyword\",\n\t\t\t\t\t\t\t      (i+1).ToString (), Parameter.GetModifierSignature (p_mod));\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\n\t\t\t\tif (has_implicit_parameters)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tTypeSpec type = invoke_pd.Types [i];\n\n\t\t\t\tif (tic != null)\n\t\t\t\t\ttype = tic.InflateGenericArgument (ec, type);\n\t\t\t\t\n\t\t\t\tif (!TypeSpecComparer.IsEqual (type, Parameters.Types [i])) {\n\t\t\t\t\tif (ignore_errors)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t\tec.Report.Error (1678, Parameters [i].Location, \"Parameter `{0}' is declared as type `{1}' but should be `{2}'\",\n\t\t\t\t\t\t      (i+1).ToString (),\n\t\t\t\t\t\t      Parameters.Types [i].GetSignatureForError (),\n\t\t\t\t\t\t      invoke_pd.Types [i].GetSignatureForError ());\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn !error;\n\t\t}\n\n\t\t//\n\t\t// Infers type arguments based on explicit arguments\n\t\t//\n\t\tpublic bool ExplicitTypeInference (TypeInferenceContext type_inference, TypeSpec delegate_type)\n\t\t{\n\t\t\tif (!HasExplicitParameters)\n\t\t\t\treturn false;\n\n\t\t\tif (!delegate_type.IsDelegate) {\n\t\t\t\tif (!delegate_type.IsExpressionTreeType)\n\t\t\t\t\treturn false;\n\n\t\t\t\tdelegate_type = TypeManager.GetTypeArguments (delegate_type) [0];\n\t\t\t\tif (!delegate_type.IsDelegate)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tAParametersCollection d_params = Delegate.GetParameters (delegate_type);\n\t\t\tif (d_params.Count != Parameters.Count)\n\t\t\t\treturn false;\n\n\t\t\tvar ptypes = Parameters.Types;\n\t\t\tvar dtypes = d_params.Types;\n\t\t\tfor (int i = 0; i < Parameters.Count; ++i) {\n\t\t\t\tif (type_inference.ExactInference (ptypes[i], dtypes[i]) == 0) {\n\t\t\t\t\t//\n\t\t\t\t\t// Continue when 0 (quick path) does not mean inference failure. Checking for\n\t\t\t\t\t// same type handles cases like int -> int\n\t\t\t\t\t//\n\t\t\t\t\tif (ptypes[i] == dtypes[i])\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic TypeSpec InferReturnType (ResolveContext ec, TypeInferenceContext tic, TypeSpec delegate_type)\n\t\t{\n\t\t\tExpression expr;\n\t\t\tAnonymousExpression am;\n\n\t\t\tif (compatibles.TryGetValue (delegate_type, out expr)) {\n\t\t\t\tam = expr as AnonymousExpression;\n\t\t\t\treturn am == null ? null : am.ReturnType;\n\t\t\t}\n\n\t\t\tusing (ec.Set (ResolveContext.Options.ProbingMode | ResolveContext.Options.InferReturnType)) {\n\t\t\t\tReportPrinter prev;\n\t\t\t\tif (TypeInferenceReportPrinter != null) {\n\t\t\t\t\tprev = ec.Report.SetPrinter (TypeInferenceReportPrinter);\n\t\t\t\t} else {\n\t\t\t\t\tprev = null;\n\t\t\t\t}\n\n\t\t\t\tvar body = CompatibleMethodBody (ec, tic, null, delegate_type);\n\t\t\t\tif (body != null) {\n\t\t\t\t\tam = body.Compatible (ec, body);\n\t\t\t\t} else {\n\t\t\t\t\tam = null;\n\t\t\t\t}\n\n\t\t\t\tif (TypeInferenceReportPrinter != null) {\n\t\t\t\t\tec.Report.SetPrinter (prev);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (am == null)\n\t\t\t\treturn null;\n\n//\t\t\tcompatibles.Add (delegate_type, am);\n\t\t\treturn am.ReturnType;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\t\t// Returns AnonymousMethod container if this anonymous method\n\t\t// expression can be implicitly converted to the delegate type `delegate_type'\n\t\t//\n\t\tpublic Expression Compatible (ResolveContext ec, TypeSpec type)\n\t\t{\n\t\t\tExpression am;\n\t\t\tif (compatibles.TryGetValue (type, out am))\n\t\t\t\treturn am;\n\n\t\t\tTypeSpec delegate_type = CompatibleChecks (ec, type);\n\t\t\tif (delegate_type == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// At this point its the first time we know the return type that is \n\t\t\t// needed for the anonymous method.  We create the method here.\n\t\t\t//\n\n\t\t\tvar invoke_mb = Delegate.GetInvokeMethod (delegate_type);\n\t\t\tTypeSpec return_type = invoke_mb.ReturnType;\n\n\t\t\t//\n\t\t\t// Second: the return type of the delegate must be compatible with \n\t\t\t// the anonymous type.   Instead of doing a pass to examine the block\n\t\t\t// we satisfy the rule by setting the return type on the EmitContext\n\t\t\t// to be the delegate type return type.\n\t\t\t//\n\n\t\t\tvar body = CompatibleMethodBody (ec, null, return_type, delegate_type);\n\t\t\tif (body == null)\n\t\t\t\treturn null;\n\n\t\t\tbool etree_conversion = delegate_type != type;\n\n\t\t\ttry {\n\t\t\t\tif (etree_conversion) {\n\t\t\t\t\tif (ec.HasSet (ResolveContext.Options.ExpressionTreeConversion)) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Nested expression tree lambda use same scope as parent\n\t\t\t\t\t\t// lambda, this also means no variable capturing between this\n\t\t\t\t\t\t// and parent scope\n\t\t\t\t\t\t//\n\t\t\t\t\t\tam = body.Compatible (ec, ec.CurrentAnonymousMethod);\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Quote nested expression tree\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (am != null)\n\t\t\t\t\t\t\tam = new Quote (am);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tint errors = ec.Report.Errors;\n\n\t\t\t\t\t\tif (Block.IsAsync) {\n\t\t\t\t\t\t\tec.Report.Error (1989, loc, \"Async lambda expressions cannot be converted to expression trees\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tusing (ec.Set (ResolveContext.Options.ExpressionTreeConversion)) {\n\t\t\t\t\t\t\tam = body.Compatible (ec);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Rewrite expressions into expression tree when targeting Expression<T>\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (am != null && errors == ec.Report.Errors)\n\t\t\t\t\t\t\tam = CreateExpressionTree (ec, delegate_type);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tam = body.Compatible (ec);\n\n\t\t\t\t\tif (body.DirectMethodGroupConversion != null) {\n\t\t\t\t\t\tvar errors_printer = new SessionReportPrinter ();\n\t\t\t\t\t\tvar old = ec.Report.SetPrinter (errors_printer);\n\t\t\t\t\t\tvar expr = new ImplicitDelegateCreation (delegate_type, body.DirectMethodGroupConversion, loc) {\n\t\t\t\t\t\t\tAllowSpecialMethodsInvocation = true\n\t\t\t\t\t\t}.Resolve (ec);\n\t\t\t\t\t\tec.Report.SetPrinter (old);\n\t\t\t\t\t\tif (expr != null && errors_printer.ErrorsCount == 0)\n\t\t\t\t\t\t\tam = expr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (CompletionResult) {\n\t\t\t\tthrow;\n\t\t\t} catch (FatalException) {\n\t\t\t\tthrow;\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (e, loc);\n\t\t\t}\n\n\t\t\tif (!ec.IsInProbingMode && !etree_conversion) {\n\t\t\t\tcompatibles.Add (type, am ?? EmptyExpression.Null);\n\t\t\t}\n\n\t\t\treturn am;\n\t\t}\n\n\t\tprotected virtual Expression CreateExpressionTree (ResolveContext ec, TypeSpec delegate_type)\n\t\t{\n\t\t\treturn CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (1946, loc, \"An anonymous method cannot be converted to an expression tree\");\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected virtual ParametersCompiled ResolveParameters (ResolveContext ec, TypeInferenceContext tic, TypeSpec delegate_type)\n\t\t{\n\t\t\tvar delegate_parameters = Delegate.GetParameters (delegate_type);\n\n\t\t\tif (Parameters == ParametersCompiled.Undefined) {\n\t\t\t\t//\n\t\t\t\t// We provide a set of inaccessible parameters\n\t\t\t\t//\n\t\t\t\tParameter[] fixedpars = new Parameter[delegate_parameters.Count];\n\n\t\t\t\tfor (int i = 0; i < delegate_parameters.Count; i++) {\n\t\t\t\t\tParameter.Modifier i_mod = delegate_parameters.FixedParameters [i].ModFlags;\n\t\t\t\t\tif ((i_mod & Parameter.Modifier.OUT) != 0) {\n\t\t\t\t\t\tif (!ec.IsInProbingMode) {\n\t\t\t\t\t\t\tec.Report.Error (1688, loc,\n\t\t\t\t\t\t\t\t\"Cannot convert anonymous method block without a parameter list to delegate type `{0}' because it has one or more `out' parameters\",\n\t\t\t\t\t\t\t\tdelegate_type.GetSignatureForError ());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tfixedpars[i] = new Parameter (\n\t\t\t\t\t\tnew TypeExpression (delegate_parameters.Types [i], loc), null,\n\t\t\t\t\t\tdelegate_parameters.FixedParameters [i].ModFlags, null, loc);\n\t\t\t\t}\n\n\t\t\t\treturn ParametersCompiled.CreateFullyResolved (fixedpars, delegate_parameters.Types);\n\t\t\t}\n\n\t\t\tif (!VerifyExplicitParameters (ec, tic, delegate_type, delegate_parameters)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn Parameters;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tif (rc.HasSet (ResolveContext.Options.ConstantScope)) {\n\t\t\t\trc.Report.Error (1706, loc, \"Anonymous methods and lambda expressions cannot be used in the current context\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Update top-level block generated duting parsing with actual top-level block\n\t\t\t//\n\t\t\tif (rc.HasAny (ResolveContext.Options.FieldInitializerScope | ResolveContext.Options.BaseInitializer) && rc.CurrentMemberDefinition.Parent.PartialContainer.PrimaryConstructorParameters != null) {\n\t\t\t\tvar tb = rc.ConstructorBlock.ParametersBlock.TopBlock;\n\t\t\t\tif (Block.TopBlock != tb) {\n\t\t\t\t\tBlock b = Block;\n\t\t\t\t\twhile (b.Parent != Block.TopBlock && b != Block.TopBlock)\n\t\t\t\t\t\tb = b.Parent;\n\n\t\t\t\t\tb.Parent = tb;\n\t\t\t\t\ttb.IncludeBlock (Block, Block.TopBlock);\n\t\t\t\t\tb.ParametersBlock.TopBlock = tb;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\teclass = ExprClass.Value;\n\n\t\t\t//\n\t\t\t// This hack means `The type is not accessible\n\t\t\t// anywhere', we depend on special conversion\n\t\t\t// rules.\n\t\t\t// \n\t\t\ttype = InternalType.AnonymousMethod;\n\n\t\t\tif (!DoResolveParameters (rc))\n\t\t\t\treturn null;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected virtual bool DoResolveParameters (ResolveContext rc)\n\t\t{\n\t\t\treturn Parameters.Resolve (rc);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// nothing, as we only exist to not do anything.\n\t\t}\n\n\t\tpublic static void Error_AddressOfCapturedVar (ResolveContext rc, IVariableReference var, Location loc)\n\t\t{\n\t\t\tif (rc.CurrentAnonymousMethod is AsyncInitializer)\n\t\t\t\treturn;\n\n\t\t\trc.Report.Error (1686, loc,\n\t\t\t\t\"Local variable or parameter `{0}' cannot have their address taken and be used inside an anonymous method, lambda expression or query expression\",\n\t\t\t\tvar.Name);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn ExprClassName;\n\t\t}\n\n\t\tAnonymousMethodBody CompatibleMethodBody (ResolveContext ec, TypeInferenceContext tic, TypeSpec return_type, TypeSpec delegate_type)\n\t\t{\n\t\t\tParametersCompiled p = ResolveParameters (ec, tic, delegate_type);\n\t\t\tif (p == null)\n\t\t\t\treturn null;\n\n\t\t\tParametersBlock b = ec.IsInProbingMode ? (ParametersBlock) Block.PerformClone () : Block;\n\n\t\t\tif (b.IsAsync) {\n\t\t\t\tvar rt = return_type;\n\t\t\t\tif (rt != null && rt.Kind != MemberKind.Void && rt != ec.Module.PredefinedTypes.Task.TypeSpec && !rt.IsGenericTask) {\n\t\t\t\t\tec.Report.Error (4010, loc, \"Cannot convert async {0} to delegate type `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), delegate_type.GetSignatureForError ());\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tb = b.ConvertToAsyncTask (ec, ec.CurrentMemberDefinition.Parent.PartialContainer, p, return_type, delegate_type, loc);\n\t\t\t}\n\n\t\t\treturn CompatibleMethodFactory (return_type ?? InternalType.ErrorType, delegate_type, p, b);\n\t\t}\n\n\t\tprotected virtual AnonymousMethodBody CompatibleMethodFactory (TypeSpec return_type, TypeSpec delegate_type, ParametersCompiled p, ParametersBlock b)\n\t\t{\n\t\t\treturn new AnonymousMethodBody (p, b, return_type, delegate_type, loc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tAnonymousMethodExpression target = (AnonymousMethodExpression) t;\n\n\t\t\ttarget.Block = (ParametersBlock) clonectx.LookupBlock (Block);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// Abstract expression for any block which requires variables hoisting\n\t//\n\tpublic abstract class AnonymousExpression : ExpressionStatement\n\t{\n\t\tprotected class AnonymousMethodMethod : Method\n\t\t{\n\t\t\tpublic readonly AnonymousExpression AnonymousMethod;\n\t\t\tpublic readonly AnonymousMethodStorey Storey;\n\n\t\t\tpublic AnonymousMethodMethod (TypeDefinition parent, AnonymousExpression am, AnonymousMethodStorey storey,\n\t\t\t\t\t\t\t  TypeExpr return_type,\n\t\t\t\t\t\t\t  Modifiers mod, MemberName name,\n\t\t\t\t\t\t\t  ParametersCompiled parameters)\n\t\t\t\t: base (parent, return_type, mod | Modifiers.COMPILER_GENERATED,\n\t\t\t\t\t\tname, parameters, null)\n\t\t\t{\n\t\t\t\tthis.AnonymousMethod = am;\n\t\t\t\tthis.Storey = storey;\n\n\t\t\t\tParent.PartialContainer.Members.Add (this);\n\t\t\t\tBlock = new ToplevelBlock (am.block, parameters);\n\t\t\t}\n\n\t\t\tpublic override EmitContext CreateEmitContext (ILGenerator ig, SourceMethodBuilder sourceMethod)\n\t\t\t{\n\t\t\t\tEmitContext ec = new EmitContext (this, ig, ReturnType, sourceMethod);\n\t\t\t\tec.CurrentAnonymousMethod = AnonymousMethod;\n\t\t\t\treturn ec;\n\t\t\t}\n\n\t\t\tprotected override void DefineTypeParameters ()\n\t\t\t{\n\t\t\t\t// Type parameters were cloned\n\t\t\t}\n\n\t\t\tprotected override bool ResolveMemberType ()\n\t\t\t{\n\t\t\t\tif (!base.ResolveMemberType ())\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (Storey != null && Storey.Mutator != null) {\n\t\t\t\t\tif (!parameters.IsEmpty) {\n\t\t\t\t\t\tvar mutated = Storey.Mutator.Mutate (parameters.Types);\n\t\t\t\t\t\tif (mutated != parameters.Types)\n\t\t\t\t\t\t\tparameters = ParametersCompiled.CreateFullyResolved ((Parameter[]) parameters.FixedParameters, mutated);\n\t\t\t\t\t}\n\n\t\t\t\t\tmember_type = Storey.Mutator.Mutate (member_type);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override void Emit ()\n\t\t\t{\n\t\t\t\tif (MethodBuilder == null) {\n\t\t\t\t\tDefine ();\n\t\t\t\t}\n\n\t\t\t\tbase.Emit ();\n\t\t\t}\n\t\t}\n\n\t\tprotected readonly ParametersBlock block;\n\n\t\tpublic TypeSpec ReturnType;\n\n\t\tprotected AnonymousExpression (ParametersBlock block, TypeSpec return_type, Location loc)\n\t\t{\n\t\t\tthis.ReturnType = return_type;\n\t\t\tthis.block = block;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic abstract string ContainerType { get; }\n\t\tpublic abstract bool IsIterator { get; }\n\t\tpublic abstract AnonymousMethodStorey Storey { get; }\n\n\t\t//\n\t\t// The block that makes up the body for the anonymous method\n\t\t//\n\t\tpublic ParametersBlock Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\t\t}\n\n\t\tpublic AnonymousExpression Compatible (ResolveContext ec)\n\t\t{\n\t\t\treturn Compatible (ec, this);\n\t\t}\n\n\t\tpublic AnonymousExpression Compatible (ResolveContext ec, AnonymousExpression ae)\n\t\t{\n\t\t\tif (block.Resolved)\n\t\t\t\treturn this;\n\n\t\t\t// TODO: Implement clone\n\t\t\tBlockContext aec = new BlockContext (ec, block, ReturnType);\n\t\t\taec.CurrentAnonymousMethod = ae;\n\n\t\t\tvar am = this as AnonymousMethodBody;\n\n\t\t\tif (ec.HasSet (ResolveContext.Options.InferReturnType) && am != null) {\n\t\t\t\tam.ReturnTypeInference = new TypeInferenceContext ();\n\t\t\t}\n\n\t\t\tvar bc = ec as BlockContext;\n\n\t\t\tif (bc != null) {\n\t\t\t\taec.AssignmentInfoOffset = bc.AssignmentInfoOffset;\n\t\t\t\taec.EnclosingLoop = bc.EnclosingLoop;\n\t\t\t\taec.EnclosingLoopOrSwitch = bc.EnclosingLoopOrSwitch;\n\t\t\t\taec.Switch = bc.Switch;\n\t\t\t}\n\n\t\t\tvar errors = ec.Report.Errors;\n\n\t\t\tbool res = Block.Resolve (aec);\n\n\t\t\tif (res && errors == ec.Report.Errors) {\n\t\t\t\tMarkReachable (new Reachability ());\n\n\t\t\t\tif (!CheckReachableExit (ec.Report)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (bc != null)\n\t\t\t\t\tbc.AssignmentInfoOffset = aec.AssignmentInfoOffset;\n\t\t\t}\n\n\t\t\tif (am != null && am.ReturnTypeInference != null) {\n\t\t\t\tam.ReturnTypeInference.FixAllTypes (ec);\n\t\t\t\tReturnType = am.ReturnTypeInference.InferredTypeArguments [0];\n\t\t\t\tam.ReturnTypeInference = null;\n\n\t\t\t\t//\n\t\t\t\t// If e is synchronous the inferred return type is T\n\t\t\t\t// If e is asynchronous and the body of F is either an expression classified as nothing\n\t\t\t\t// or a statement block where no return statements have expressions, the inferred return type is Task\n\t\t\t\t// If e is async and has an inferred result type T, the inferred return type is Task<T>\n\t\t\t\t//\n\t\t\t\tif (block.IsAsync && ReturnType != null) {\n\t\t\t\t\tReturnType = ReturnType.Kind == MemberKind.Void ?\n\t\t\t\t\t\tec.Module.PredefinedTypes.Task.TypeSpec :\n\t\t\t\t\t\tec.Module.PredefinedTypes.TaskGeneric.TypeSpec.MakeGenericType (ec, new [] { ReturnType });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (res && errors != ec.Report.Errors)\n\t\t\t\treturn null;\n\n\t\t\treturn res ? this : null;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tbool CheckReachableExit (Report report)\n\t\t{\n\t\t\tif (block.HasReachableClosingBrace && ReturnType.Kind != MemberKind.Void) {\n\t\t\t\t// FIXME: Flow-analysis on MoveNext generated code\n\t\t\t\tif (!IsIterator) {\n\t\t\t\t\treport.Error (1643, StartLocation,\n\t\t\t\t\t\t\t\"Not all code paths return a value in anonymous method of type `{0}'\", GetSignatureForError ());\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\t// We are reachable, mark block body reachable too\n\t\t\tMarkReachable (new Reachability ());\n\n\t\t\tCheckReachableExit (fc.Report);\n\n\t\t\tvar das = fc.BranchDefiniteAssignment ();\n\t\t\tvar prev_pb = fc.ParametersBlock;\n\t\t\tfc.ParametersBlock = Block;\n\t\t\tvar da_ontrue = fc.DefiniteAssignmentOnTrue;\n\t\t\tvar da_onfalse = fc.DefiniteAssignmentOnFalse;\n\n\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null;\n\t\t\tblock.FlowAnalysis (fc);\n\n\t\t\tfc.ParametersBlock = prev_pb;\n\t\t\tfc.DefiniteAssignment = das;\n\t\t\tfc.DefiniteAssignmentOnTrue = da_ontrue;\n\t\t\tfc.DefiniteAssignmentOnFalse = da_onfalse;\n\t\t}\n\n\t\tpublic override void MarkReachable (Reachability rc)\n\t\t{\n\t\t\tblock.MarkReachable (rc);\n\t\t}\n\n\t\tpublic void SetHasThisAccess ()\n\t\t{\n\t\t\tExplicitBlock b = block;\n\t\t\tdo {\n\t\t\t\tif (b.HasCapturedThis)\n\t\t\t\t\treturn;\n\n\t\t\t\tb.HasCapturedThis = true;\n\t\t\t\tb = b.Parent == null ? null : b.Parent.Explicit;\n\t\t\t} while (b != null);\n\t\t}\n\t}\n\n\tpublic class AnonymousMethodBody : AnonymousExpression\n\t{\n\t\tprotected readonly ParametersCompiled parameters;\n\t\tAnonymousMethodStorey storey;\n\n\t\tAnonymousMethodMethod method;\n\t\tField am_cache;\n\t\tstring block_name;\n\t\tTypeInferenceContext return_inference;\n\n\t\tpublic AnonymousMethodBody (ParametersCompiled parameters,\n\t\t\t\t\tParametersBlock block, TypeSpec return_type, TypeSpec delegate_type,\n\t\t\t\t\tLocation loc)\n\t\t\t: base (block, return_type, loc)\n\t\t{\n\t\t\tthis.type = delegate_type;\n\t\t\tthis.parameters = parameters;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override string ContainerType {\n\t\t\tget { return \"anonymous method\"; }\n\t\t}\n\n\t\t//\n\t\t// Method-group instance for lambdas which can be replaced with\n\t\t// simple method group call\n\t\t//\n\t\tpublic MethodGroupExpr DirectMethodGroupConversion {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic override bool IsIterator {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic ParametersCompiled Parameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeInferenceContext ReturnTypeInference {\n\t\t\tget {\n\t\t\t\treturn return_inference;\n\t\t\t}\n\t\t\tset {\n\t\t\t\treturn_inference = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override AnonymousMethodStorey Storey {\n\t\t\tget {\n\t\t\t\treturn storey;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (1945, loc, \"An expression tree cannot contain an anonymous method expression\");\n\t\t\treturn null;\n\t\t}\n\n\t\tbool Define (ResolveContext ec)\n\t\t{\n\t\t\tif (!Block.Resolved && Compatible (ec) == null)\n\t\t\t\treturn false;\n\n\t\t\tif (block_name == null) {\n\t\t\t\tMemberCore mc = (MemberCore) ec.MemberContext;\n\t\t\t\tblock_name = mc.MemberName.Basename;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Creates a host for the anonymous method\n\t\t//\n\t\tAnonymousMethodMethod DoCreateMethodHost (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Anonymous method body can be converted to\n\t\t\t//\n\t\t\t// 1, an instance method in current scope when only `this' is hoisted\n\t\t\t// 2, a static method in current scope when neither `this' nor any variable is hoisted\n\t\t\t// 3, an instance method in compiler generated storey when any hoisted variable exists\n\t\t\t//\n\n\t\t\tModifiers modifiers;\n\t\t\tTypeDefinition parent = null;\n\t\t\tTypeParameters hoisted_tparams = null;\n\t\t\tParametersCompiled method_parameters = parameters;\n\n\t\t\tvar src_block = Block.Original.Explicit;\n\t\t\tif (src_block.HasCapturedVariable || src_block.HasCapturedThis) {\n\t\t\t\tparent = storey = FindBestMethodStorey ();\n\n\t\t\t\tif (storey == null) {\n\t\t\t\t\tvar top_block = src_block.ParametersBlock.TopBlock;\n\t\t\t\t\tvar sm = top_block.StateMachine;\n\n\t\t\t\t\tif (src_block.HasCapturedThis) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Remove hoisted 'this' request when simple instance method is\n\t\t\t\t\t\t// enough. No hoisted variables only 'this' and don't need to\n\t\t\t\t\t\t// propagate this to value type state machine.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tStateMachine sm_parent;\n\t\t\t\t\t\tvar pb = src_block.ParametersBlock;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tsm_parent = pb.StateMachine;\n\t\t\t\t\t\t\tpb = pb.Parent == null ? null : pb.Parent.ParametersBlock;\n\t\t\t\t\t\t} while (sm_parent == null && pb != null);\n\n\t\t\t\t\t\tif (sm_parent == null) {\n\t\t\t\t\t\t\ttop_block.RemoveThisReferenceFromChildrenBlock (src_block);\n\t\t\t\t\t\t} else if (sm_parent.Kind == MemberKind.Struct) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Special case where parent class is used to emit instance method\n\t\t\t\t\t\t\t// because currect storey is of value type (async host) and we cannot\n\t\t\t\t\t\t\t// use ldftn on non-boxed instances either to share mutated state\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tparent = sm_parent.Parent.PartialContainer;\n\t\t\t\t\t\t\thoisted_tparams = sm_parent.OriginalTypeParameters;\n\t\t\t\t\t\t} else if (sm is IteratorStorey) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// For iterators we can host everything in one class\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tparent = storey = sm;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmodifiers = storey != null ? Modifiers.INTERNAL : Modifiers.PRIVATE;\n\t\t\t} else {\n\t\t\t\tif (ec.CurrentAnonymousMethod != null)\n\t\t\t\t\tparent = storey = ec.CurrentAnonymousMethod.Storey;\n\n\t\t\t\tmodifiers = Modifiers.STATIC | Modifiers.PRIVATE;\n\n\t\t\t\t//\n\t\t\t\t// Convert generated method to closed delegate method where unused\n\t\t\t\t// this argument is generated during compilation which speeds up dispatch\n\t\t\t\t// by about 25%\n\t\t\t\t//\n\t\t\t\tmethod_parameters = ParametersCompiled.Prefix (method_parameters,\n\t\t\t\t\tnew Parameter (null, null, 0, null, loc), ec.Module.Compiler.BuiltinTypes.Object);\n\t\t\t}\n\n\t\t\tif (storey == null && hoisted_tparams == null)\n\t\t\t\thoisted_tparams = ec.CurrentTypeParameters;\n\n\t\t\tif (parent == null)\n\t\t\t\tparent = ec.CurrentTypeDefinition.Parent.PartialContainer;\n\n\t\t\tstring name = CompilerGeneratedContainer.MakeName (parent != storey ? block_name : null,\n\t\t\t\t\"m\", null, parent.PartialContainer.CounterAnonymousMethods++);\n\n\t\t\tMemberName member_name;\n\t\t\tif (hoisted_tparams != null) {\n\t\t\t\tvar type_params = new TypeParameters (hoisted_tparams.Count);\n\t\t\t\tfor (int i = 0; i < hoisted_tparams.Count; ++i) {\n\t\t\t\t    type_params.Add (hoisted_tparams[i].CreateHoistedCopy (null));\n\t\t\t\t}\n\n\t\t\t\tmember_name = new MemberName (name, type_params, Location);\n\t\t\t} else {\n\t\t\t\tmember_name = new MemberName (name, Location);\n\t\t\t}\n\n\t\t\treturn new AnonymousMethodMethod (parent,\n\t\t\t\tthis, storey, new TypeExpression (ReturnType, Location), modifiers,\n\t\t\t\tmember_name, method_parameters);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (!Define (ec))\n\t\t\t\treturn null;\n\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Use same anonymous method implementation for scenarios where same\n\t\t\t// code is used from multiple blocks, e.g. field initializers\n\t\t\t//\n\t\t\tif (method == null) {\n\t\t\t\t//\n\t\t\t\t// Delay an anonymous method definition to avoid emitting unused code\n\t\t\t\t// for unreachable blocks or expression trees\n\t\t\t\t//\n\t\t\t\tmethod = DoCreateMethodHost (ec);\n\t\t\t\tmethod.Define ();\n\t\t\t\tmethod.PrepareEmit ();\n\t\t\t}\n\n\t\t\tbool is_static = (method.ModFlags & Modifiers.STATIC) != 0;\n\t\t\tif (is_static && am_cache == null && !ec.IsStaticConstructor) {\n\t\t\t\t//\n\t\t\t\t// Creates a field cache to store delegate instance if it's not generic\n\t\t\t\t//\n\t\t\t\tif (!method.MemberName.IsGeneric) {\n\t\t\t\t\tvar parent = method.Parent.PartialContainer;\n\t\t\t\t\tint id = parent.AnonymousMethodsCounter++;\n\t\t\t\t\tvar cache_type = storey != null && storey.Mutator != null ? storey.Mutator.Mutate (type) : type;\n\n\t\t\t\t\tam_cache = new Field (parent, new TypeExpression (cache_type, loc),\n\t\t\t\t\t\tModifiers.STATIC | Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED,\n\t\t\t\t\t\tnew MemberName (CompilerGeneratedContainer.MakeName (null, \"f\", \"am$cache\", id), loc), null);\n\t\t\t\t\tam_cache.Define ();\n\t\t\t\t\tparent.AddField (am_cache);\n\t\t\t\t} else {\n\t\t\t\t\t// TODO: Implement caching of generated generic static methods\n\t\t\t\t\t//\n\t\t\t\t\t// Idea:\n\t\t\t\t\t//\n\t\t\t\t\t// Some extra class is needed to capture variable generic type\n\t\t\t\t\t// arguments. Maybe we could re-use anonymous types, with a unique\n\t\t\t\t\t// anonymous method id, but they are quite heavy.\n\t\t\t\t\t//\n\t\t\t\t\t// Consider : \"() => typeof(T);\"\n\t\t\t\t\t//\n\t\t\t\t\t// We need something like\n\t\t\t\t\t// static class Wrap<Tn, Tm, DelegateType> {\n\t\t\t\t\t//\t\tpublic static DelegateType cache;\n\t\t\t\t\t// }\n\t\t\t\t\t//\n\t\t\t\t\t// We then specialize local variable to capture all generic parameters\n\t\t\t\t\t// and delegate type, e.g. \"Wrap<Ta, Tb, DelegateTypeInst> cache;\"\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tLabel l_initialized = ec.DefineLabel ();\n\n\t\t\tif (am_cache != null) {\n\t\t\t\tec.Emit (OpCodes.Ldsfld, am_cache.Spec);\n\t\t\t\tec.Emit (OpCodes.Brtrue_S, l_initialized);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Load method delegate implementation\n\t\t\t//\n\n\t\t\tif (is_static) {\n\t\t\t\tec.EmitNull ();\n\t\t\t} else if (storey != null) {\n\t\t\t\tExpression e = storey.GetStoreyInstanceExpression (ec).Resolve (new ResolveContext (ec.MemberContext));\n\t\t\t\tif (e != null) {\n\t\t\t\t\te.Emit (ec);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tec.EmitThis ();\n\n\t\t\t\t//\n\t\t\t\t// Special case for value type storey where this is not lifted but\n\t\t\t\t// droped off to parent class\n\t\t\t\t//\n\t\t\t\tif (ec.CurrentAnonymousMethod != null && ec.AsyncTaskStorey != null)\n\t\t\t\t\tec.Emit (OpCodes.Ldfld, ec.AsyncTaskStorey.HoistedThis.Field.Spec);\n\t\t\t}\n\n\t\t\tvar delegate_method = method.Spec;\n\t\t\tif (storey != null && storey.MemberName.IsGeneric) {\n\t\t\t\tTypeSpec t = storey.Instance.Type;\n\n\t\t\t\t//\n\t\t\t\t// Mutate anonymous method instance type if we are in nested\n\t\t\t\t// hoisted generic anonymous method storey\n\t\t\t\t//\n\t\t\t\tif (ec.IsAnonymousStoreyMutateRequired) {\n\t\t\t\t\tt = storey.Mutator.Mutate (t);\n\t\t\t\t}\n\n\t\t\t\tec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ()));\n\t\t\t} else {\n\t\t\t\tif (delegate_method.IsGeneric) {\n\t\t\t\t\tTypeParameterSpec[] tparams;\n\t\t\t\t\tvar sm = ec.CurrentAnonymousMethod == null ? null : ec.CurrentAnonymousMethod.Storey as StateMachine;\n\t\t\t\t\tif (sm != null && sm.OriginalTypeParameters != null) {\n\t\t\t\t\t\ttparams = sm.CurrentTypeParameters.Types;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttparams = method.TypeParameters;\n\t\t\t\t\t}\n\n\t\t\t\t\tdelegate_method = delegate_method.MakeGenericMethod (ec.MemberContext, tparams);\n\t\t\t\t}\n\n\t\t\t\tec.Emit (OpCodes.Ldftn, delegate_method);\n\t\t\t}\n\n\t\t\tvar constructor_method = Delegate.GetConstructor (type);\n\t\t\tec.Emit (OpCodes.Newobj, constructor_method);\n\n\t\t\tif (am_cache != null) {\n\t\t\t\tec.Emit (OpCodes.Stsfld, am_cache.Spec);\n\t\t\t\tec.MarkLabel (l_initialized);\n\t\t\t\tec.Emit (OpCodes.Ldsfld, am_cache.Spec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\t//\n\t\t// Look for the best storey for this anonymous method\n\t\t//\n\t\tAnonymousMethodStorey FindBestMethodStorey ()\n\t\t{\n\t\t\t//\n\t\t\t// Use the nearest parent block which has a storey\n\t\t\t//\n\t\t\tfor (Block b = Block.Parent; b != null; b = b.Parent) {\n\t\t\t\tAnonymousMethodStorey s = b.Explicit.AnonymousMethodStorey;\n\t\t\t\tif (s != null)\n\t\t\t\t\treturn s;\n\t\t\t}\n\t\t\t\t\t\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn type.GetSignatureForError ();\n\t\t}\n\t}\n\n\t//\n\t// Anonymous type container\n\t//\n\tpublic class AnonymousTypeClass : CompilerGeneratedContainer\n\t{\n\t\tpublic const string ClassNamePrefix = \"<>__AnonType\";\n\t\tpublic const string SignatureForError = \"anonymous type\";\n\t\t\n\t\treadonly IList<AnonymousTypeParameter> parameters;\n\n\t\tprivate AnonymousTypeClass (ModuleContainer parent, MemberName name, IList<AnonymousTypeParameter> parameters, Location loc)\n\t\t\t: base (parent, name, parent.Evaluator != null ? Modifiers.PUBLIC : Modifiers.INTERNAL)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t}\n\n\t\tpublic static AnonymousTypeClass Create (TypeContainer parent, IList<AnonymousTypeParameter> parameters, Location loc)\n\t\t{\n\t\t\tstring name = ClassNamePrefix + parent.Module.CounterAnonymousTypes++;\n\n\t\t\tParametersCompiled all_parameters;\n\t\t\tTypeParameters tparams = null;\n\t\t\tSimpleName[] t_args;\n\n\t\t\tif (parameters.Count == 0) {\n\t\t\t\tall_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t\tt_args = null;\n\t\t\t} else {\n\t\t\t\tt_args = new SimpleName[parameters.Count];\n\t\t\t\ttparams = new TypeParameters ();\n\t\t\t\tParameter[] ctor_params = new Parameter[parameters.Count];\n\t\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\t\tAnonymousTypeParameter p = parameters[i];\n\t\t\t\t\tfor (int ii = 0; ii < i; ++ii) {\n\t\t\t\t\t\tif (parameters[ii].Name == p.Name) {\n\t\t\t\t\t\t\tparent.Compiler.Report.Error (833, parameters[ii].Location,\n\t\t\t\t\t\t\t\t\"`{0}': An anonymous type cannot have multiple properties with the same name\",\n\t\t\t\t\t\t\t\t\tp.Name);\n\n\t\t\t\t\t\t\tp = new AnonymousTypeParameter (null, \"$\" + i.ToString (), p.Location);\n\t\t\t\t\t\t\tparameters[i] = p;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tt_args[i] = new SimpleName (\"<\" + p.Name + \">__T\", p.Location);\n\t\t\t\t\ttparams.Add (new TypeParameter (i, new MemberName (t_args[i].Name, p.Location), null, null, Variance.None));\n\t\t\t\t\tctor_params[i] = new Parameter (t_args[i], p.Name, Parameter.Modifier.NONE, null, p.Location);\n\t\t\t\t}\n\n\t\t\t\tall_parameters = new ParametersCompiled (ctor_params);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Create generic anonymous type host with generic arguments\n\t\t\t// named upon properties names\n\t\t\t//\n\t\t\tAnonymousTypeClass a_type = new AnonymousTypeClass (parent.Module, new MemberName (name, tparams, loc), parameters, loc);\n\n\t\t\tConstructor c = new Constructor (a_type, name, Modifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN,\n\t\t\t\tnull, all_parameters, loc);\n\t\t\tc.Block = new ToplevelBlock (parent.Module.Compiler, c.ParameterInfo, loc);\n\n\t\t\t// \n\t\t\t// Create fields and constructor body with field initialization\n\t\t\t//\n\t\t\tbool error = false;\n\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\tAnonymousTypeParameter p = parameters [i];\n\n\t\t\t\tField f = new Field (a_type, t_args [i], Modifiers.PRIVATE | Modifiers.READONLY | Modifiers.DEBUGGER_HIDDEN,\n\t\t\t\t\tnew MemberName (\"<\" + p.Name + \">\", p.Location), null);\n\n\t\t\t\tif (!a_type.AddField (f)) {\n\t\t\t\t\terror = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tc.Block.AddStatement (new StatementExpression (\n\t\t\t\t\tnew SimpleAssign (new MemberAccess (new This (p.Location), f.Name),\n\t\t\t\t\t\tc.Block.GetParameterReference (i, p.Location))));\n\n\t\t\t\tToplevelBlock get_block = new ToplevelBlock (parent.Module.Compiler, p.Location);\n\t\t\t\tget_block.AddStatement (new Return (\n\t\t\t\t\tnew MemberAccess (new This (p.Location), f.Name), p.Location));\n\n\t\t\t\tProperty prop = new Property (a_type, t_args [i], Modifiers.PUBLIC,\n\t\t\t\t\tnew MemberName (p.Name, p.Location), null);\n\t\t\t\tprop.Get = new Property.GetMethod (prop, 0, null, p.Location);\n\t\t\t\tprop.Get.Block = get_block;\n\t\t\t\ta_type.AddMember (prop);\n\t\t\t}\n\n\t\t\tif (error)\n\t\t\t\treturn null;\n\n\t\t\ta_type.AddConstructor (c);\n\t\t\treturn a_type;\n\t\t}\n\t\t\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tif (!base.DoDefineMembers ())\n\t\t\t\treturn false;\n\n\t\t\tLocation loc = Location;\n\n\t\t\tvar equals_parameters = ParametersCompiled.CreateFullyResolved (\n\t\t\t\tnew Parameter (new TypeExpression (Compiler.BuiltinTypes.Object, loc), \"obj\", 0, null, loc), Compiler.BuiltinTypes.Object);\n\n\t\t\tMethod equals = new Method (this, new TypeExpression (Compiler.BuiltinTypes.Bool, loc),\n\t\t\t\tModifiers.PUBLIC | Modifiers.OVERRIDE | Modifiers.DEBUGGER_HIDDEN, new MemberName (\"Equals\", loc),\n\t\t\t\tequals_parameters, null);\n\n\t\t\tequals_parameters[0].Resolve (equals, 0);\n\n\t\t\tMethod tostring = new Method (this, new TypeExpression (Compiler.BuiltinTypes.String, loc),\n\t\t\t\tModifiers.PUBLIC | Modifiers.OVERRIDE | Modifiers.DEBUGGER_HIDDEN, new MemberName (\"ToString\", loc),\n\t\t\t\tParametersCompiled.EmptyReadOnlyParameters, null);\n\n\t\t\tToplevelBlock equals_block = new ToplevelBlock (Compiler, equals.ParameterInfo, loc);\n\n\t\t\tTypeExpr current_type;\n\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\tvar targs = new TypeArguments ();\n\t\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\t\ttargs.Add (new TypeParameterExpr (CurrentTypeParameters[i], Location));\n\t\t\t\t}\n\n\t\t\t\tcurrent_type = new GenericTypeExpr (Definition, targs, loc);\n\t\t\t} else {\n\t\t\t\tcurrent_type = new TypeExpression (Definition, loc);\n\t\t\t}\n\n\t\t\tvar li_other = LocalVariable.CreateCompilerGenerated (CurrentType, equals_block, loc);\n\t\t\tequals_block.AddStatement (new BlockVariable (new TypeExpression (li_other.Type, loc), li_other));\n\t\t\tvar other_variable = new LocalVariableReference (li_other, loc);\n\n\t\t\tMemberAccess system_collections_generic = new MemberAccess (new MemberAccess (\n\t\t\t\tnew QualifiedAliasMember (\"global\", \"System\", loc), \"Collections\", loc), \"Generic\", loc);\n\n\t\t\tExpression rs_equals = null;\n\t\t\tExpression string_concat = new StringConstant (Compiler.BuiltinTypes, \"{\", loc);\n\t\t\tExpression rs_hashcode = new IntConstant (Compiler.BuiltinTypes, -2128831035, loc);\n\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\tvar p = parameters [i];\n\t\t\t\tvar f = (Field) Members [i * 2];\n\n\t\t\t\tMemberAccess equality_comparer = new MemberAccess (new MemberAccess (\n\t\t\t\t\tsystem_collections_generic, \"EqualityComparer\",\n\t\t\t\t\t\tnew TypeArguments (new SimpleName (CurrentTypeParameters [i].Name, loc)), loc),\n\t\t\t\t\t\t\"Default\", loc);\n\n\t\t\t\tArguments arguments_equal = new Arguments (2);\n\t\t\t\targuments_equal.Add (new Argument (new MemberAccess (new This (f.Location), f.Name)));\n\t\t\t\targuments_equal.Add (new Argument (new MemberAccess (other_variable, f.Name)));\n\n\t\t\t\tExpression field_equal = new Invocation (new MemberAccess (equality_comparer,\n\t\t\t\t\t\"Equals\", loc), arguments_equal);\n\n\t\t\t\tArguments arguments_hashcode = new Arguments (1);\n\t\t\t\targuments_hashcode.Add (new Argument (new MemberAccess (new This (f.Location), f.Name)));\n\t\t\t\tExpression field_hashcode = new Invocation (new MemberAccess (equality_comparer,\n\t\t\t\t\t\"GetHashCode\", loc), arguments_hashcode);\n\n\t\t\t\tIntConstant FNV_prime = new IntConstant (Compiler.BuiltinTypes, 16777619, loc);\t\t\t\t\n\t\t\t\trs_hashcode = new Binary (Binary.Operator.Multiply,\n\t\t\t\t\tnew Binary (Binary.Operator.ExclusiveOr, rs_hashcode, field_hashcode),\n\t\t\t\t\tFNV_prime);\n\n\t\t\t\tExpression field_to_string = new Conditional (new BooleanExpression (new Binary (Binary.Operator.Inequality,\n\t\t\t\t\tnew MemberAccess (new This (f.Location), f.Name), new NullLiteral (loc))),\n\t\t\t\t\tnew Invocation (new MemberAccess (\n\t\t\t\t\t\tnew MemberAccess (new This (f.Location), f.Name), \"ToString\"), null),\n\t\t\t\t\tnew StringConstant (Compiler.BuiltinTypes, string.Empty, loc), loc);\n\n\t\t\t\tif (rs_equals == null) {\n\t\t\t\t\trs_equals = field_equal;\n\t\t\t\t\tstring_concat = new Binary (Binary.Operator.Addition,\n\t\t\t\t\t\tstring_concat,\n\t\t\t\t\t\tnew Binary (Binary.Operator.Addition,\n\t\t\t\t\t\t\tnew StringConstant (Compiler.BuiltinTypes, \" \" + p.Name + \" = \", loc),\n\t\t\t\t\t\t\tfield_to_string));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Implementation of ToString () body using string concatenation\n\t\t\t\t//\t\t\t\t\n\t\t\t\tstring_concat = new Binary (Binary.Operator.Addition,\n\t\t\t\t\tnew Binary (Binary.Operator.Addition,\n\t\t\t\t\t\tstring_concat,\n\t\t\t\t\t\tnew StringConstant (Compiler.BuiltinTypes, \", \" + p.Name + \" = \", loc)),\n\t\t\t\t\tfield_to_string);\n\n\t\t\t\trs_equals = new Binary (Binary.Operator.LogicalAnd, rs_equals, field_equal);\n\t\t\t}\n\n\t\t\tstring_concat = new Binary (Binary.Operator.Addition,\n\t\t\t\tstring_concat,\n\t\t\t\tnew StringConstant (Compiler.BuiltinTypes, \" }\", loc));\n\n\t\t\t//\n\t\t\t// Equals (object obj) override\n\t\t\t//\t\t\n\t\t\tvar other_variable_assign = new TemporaryVariableReference (li_other, loc);\n\t\t\tequals_block.AddStatement (new StatementExpression (\n\t\t\t\tnew SimpleAssign (other_variable_assign,\n\t\t\t\t\tnew As (equals_block.GetParameterReference (0, loc),\n\t\t\t\t\t\tcurrent_type, loc), loc)));\n\n\t\t\tExpression equals_test = new Binary (Binary.Operator.Inequality, other_variable, new NullLiteral (loc));\n\t\t\tif (rs_equals != null)\n\t\t\t\tequals_test = new Binary (Binary.Operator.LogicalAnd, equals_test, rs_equals);\n\t\t\tequals_block.AddStatement (new Return (equals_test, loc));\n\n\t\t\tequals.Block = equals_block;\n\t\t\tequals.Define ();\n\t\t\tMembers.Add (equals);\n\n\t\t\t//\n\t\t\t// GetHashCode () override\n\t\t\t//\n\t\t\tMethod hashcode = new Method (this, new TypeExpression (Compiler.BuiltinTypes.Int, loc),\n\t\t\t\tModifiers.PUBLIC | Modifiers.OVERRIDE | Modifiers.DEBUGGER_HIDDEN,\n\t\t\t\tnew MemberName (\"GetHashCode\", loc),\n\t\t\t\tParametersCompiled.EmptyReadOnlyParameters, null);\n\n\t\t\t//\n\t\t\t// Modified FNV with good avalanche behavior and uniform\n\t\t\t// distribution with larger hash sizes.\n\t\t\t//\n\t\t\t// const int FNV_prime = 16777619;\n\t\t\t// int hash = (int) 2166136261;\n\t\t\t// foreach (int d in data)\n\t\t\t//     hash = (hash ^ d) * FNV_prime;\n\t\t\t// hash += hash << 13;\n\t\t\t// hash ^= hash >> 7;\n\t\t\t// hash += hash << 3;\n\t\t\t// hash ^= hash >> 17;\n\t\t\t// hash += hash << 5;\n\n\t\t\tToplevelBlock hashcode_top = new ToplevelBlock (Compiler, loc);\n\t\t\tBlock hashcode_block = new Block (hashcode_top, loc, loc);\n\t\t\thashcode_top.AddStatement (new Unchecked (hashcode_block, loc));\n\n\t\t\tvar li_hash = LocalVariable.CreateCompilerGenerated (Compiler.BuiltinTypes.Int, hashcode_top, loc);\n\t\t\thashcode_block.AddStatement (new BlockVariable (new TypeExpression (li_hash.Type, loc), li_hash));\n\t\t\tLocalVariableReference hash_variable_assign = new LocalVariableReference (li_hash, loc);\n\t\t\thashcode_block.AddStatement (new StatementExpression (\n\t\t\t\tnew SimpleAssign (hash_variable_assign, rs_hashcode)));\n\n\t\t\tvar hash_variable = new LocalVariableReference (li_hash, loc);\n\t\t\thashcode_block.AddStatement (new StatementExpression (\n\t\t\t\tnew CompoundAssign (Binary.Operator.Addition, hash_variable,\n\t\t\t\t\tnew Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 13, loc)))));\n\t\t\thashcode_block.AddStatement (new StatementExpression (\n\t\t\t\tnew CompoundAssign (Binary.Operator.ExclusiveOr, hash_variable,\n\t\t\t\t\tnew Binary (Binary.Operator.RightShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 7, loc)))));\n\t\t\thashcode_block.AddStatement (new StatementExpression (\n\t\t\t\tnew CompoundAssign (Binary.Operator.Addition, hash_variable,\n\t\t\t\t\tnew Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 3, loc)))));\n\t\t\thashcode_block.AddStatement (new StatementExpression (\n\t\t\t\tnew CompoundAssign (Binary.Operator.ExclusiveOr, hash_variable,\n\t\t\t\t\tnew Binary (Binary.Operator.RightShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 17, loc)))));\n\t\t\thashcode_block.AddStatement (new StatementExpression (\n\t\t\t\tnew CompoundAssign (Binary.Operator.Addition, hash_variable,\n\t\t\t\t\tnew Binary (Binary.Operator.LeftShift, hash_variable, new IntConstant (Compiler.BuiltinTypes, 5, loc)))));\n\n\t\t\thashcode_block.AddStatement (new Return (hash_variable, loc));\n\t\t\thashcode.Block = hashcode_top;\n\t\t\thashcode.Define ();\n\t\t\tMembers.Add (hashcode);\n\n\t\t\t//\n\t\t\t// ToString () override\n\t\t\t//\n\n\t\t\tToplevelBlock tostring_block = new ToplevelBlock (Compiler, loc);\n\t\t\ttostring_block.AddStatement (new Return (string_concat, loc));\n\t\t\ttostring.Block = tostring_block;\n\t\t\ttostring.Define ();\n\t\t\tMembers.Add (tostring);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn SignatureForError;\n\t\t}\n\n\t\tpublic override CompilationSourceFile GetCompilationSourceFile ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic IList<AnonymousTypeParameter> Parameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/argument.cs",
    "content": "﻿//\n// argument.cs: Argument expressions\n//\n// Author:\n//   Miguel de Icaza (miguel@ximain.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n// Copyright 2003-2011 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\t//\n\t// Argument expression used for invocation\n\t//\n\tpublic class Argument\n\t{\n\t\tpublic enum AType : byte\n\t\t{\n\t\t\tNone = 0,\n\t\t\tRef = 1,\t\t\t// ref modifier used\n\t\t\tOut = 2,\t\t\t// out modifier used\n\t\t\tDefault = 3,\t\t// argument created from default parameter value\n\t\t\tDynamicTypeName = 4,\t// System.Type argument for dynamic binding\n\t\t\tExtensionType = 5,\t// Instance expression inserted as the first argument\n\n\t\t\t// Conditional instance expression inserted as the first argument\n\t\t\tExtensionTypeConditionalAccess = 5 | ConditionalAccessFlag,\n\n\t\t\tConditionalAccessFlag = 1 << 7\n\t\t}\n\n\t\tpublic readonly AType ArgType;\n\t\tpublic Expression Expr;\n\n\t\tpublic Argument (Expression expr, AType type)\n\t\t{\n\t\t\tthis.Expr = expr;\n\t\t\tthis.ArgType = type;\n\t\t}\n\n\t\tpublic Argument (Expression expr)\n\t\t{\n\t\t\tthis.Expr = expr;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsByRef {\n\t\t\tget { return ArgType == AType.Ref || ArgType == AType.Out; }\n\t\t}\n\n\t\tpublic bool IsDefaultArgument {\n\t\t\tget { return ArgType == AType.Default; }\n\t\t}\n\n\t\tpublic bool IsExtensionType {\n\t\t\tget {\n\t\t\t\treturn (ArgType & AType.ExtensionType) == AType.ExtensionType;\n\t\t\t}\n\t\t}\n\n\t\tpublic Parameter.Modifier Modifier {\n\t\t\tget {\n\t\t\t\tswitch (ArgType) {\n\t\t\t\tcase AType.Out:\n\t\t\t\t\treturn Parameter.Modifier.OUT;\n\n\t\t\t\tcase AType.Ref:\n\t\t\t\t\treturn Parameter.Modifier.REF;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Parameter.Modifier.NONE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec Type {\n\t\t\tget { return Expr.Type; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic Argument Clone (Expression expr)\n\t\t{\n\t\t\tArgument a = (Argument) MemberwiseClone ();\n\t\t\ta.Expr = expr;\n\t\t\treturn a;\n\t\t}\n\n\t\tpublic Argument Clone (CloneContext clonectx)\n\t\t{\n\t\t\treturn Clone (Expr.Clone (clonectx));\n\t\t}\n\n\t\tpublic virtual Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (ArgType == AType.Default)\n\t\t\t\tec.Report.Error (854, Expr.Location, \"An expression tree cannot contain an invocation which uses optional parameter\");\n\n\t\t\treturn Expr.CreateExpressionTree (ec);\n\t\t}\n\n\n\t\tpublic virtual void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (!IsByRef) {\n\t\t\t\tif (ArgType == AType.ExtensionTypeConditionalAccess) {\n\t\t\t\t\tvar ie = new InstanceEmitter (Expr, false);\n\t\t\t\t\tie.Emit (ec, true);\n\t\t\t\t} else {\n\t\t\t\t\tExpr.Emit (ec);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tAddressOp mode = AddressOp.Store;\n\t\t\tif (ArgType == AType.Ref)\n\t\t\t\tmode |= AddressOp.Load;\n\n\t\t\tIMemoryLocation ml = (IMemoryLocation) Expr;\n\t\t\tml.AddressOf (ec, mode);\n\t\t}\n\n\t\tpublic Argument EmitToField (EmitContext ec, bool cloneResult)\n\t\t{\n\t\t\tvar res = Expr.EmitToField (ec);\n\t\t\tif (cloneResult && res != Expr)\n\t\t\t\treturn new Argument (res, ArgType);\n\n\t\t\tExpr = res;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (ArgType == AType.Out) {\n\t\t\t\tvar vr = Expr as VariableReference;\n\t\t\t\tif (vr != null) {\n\t\t\t\t\tif (vr.VariableInfo != null)\n\t\t\t\t\t\tfc.SetVariableAssigned (vr.VariableInfo);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar fe = Expr as FieldExpr;\n\t\t\t\tif (fe != null) {\n\t\t\t\t\tfe.SetFieldAssigned (fc);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tExpr.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\tif (Expr.eclass == ExprClass.MethodGroup)\n\t\t\t\treturn Expr.ExprClassName;\n\n\t\t\treturn Expr.Type.GetSignatureForError ();\n\t\t}\n\n\t\tpublic bool ResolveMethodGroup (ResolveContext ec)\n\t\t{\n\t\t\tSimpleName sn = Expr as SimpleName;\n\t\t\tif (sn != null)\n\t\t\t\tExpr = sn.GetMethodGroup ();\n\n\t\t\t// FIXME: csc doesn't report any error if you try to use `ref' or\n\t\t\t//        `out' in a delegate creation expression.\n\t\t\tExpr = Expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);\n\t\t\tif (Expr == null)\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void Resolve (ResolveContext ec)\n\t\t{\n\t\t\t// Verify that the argument is readable\n\t\t\tif (ArgType != AType.Out)\n\t\t\t\tExpr = Expr.Resolve (ec);\n\n\t\t\t// Verify that the argument is writeable\n\t\t\tif (Expr != null && IsByRef)\n\t\t\t\tExpr = Expr.ResolveLValue (ec, EmptyExpression.OutAccess);\n\n\t\t\tif (Expr == null)\n\t\t\t\tExpr = ErrorExpression.Instance;\n\t\t}\n\t}\n\n\tpublic class MovableArgument : Argument\n\t{\n\t\tLocalTemporary variable;\n\n\t\tpublic MovableArgument (Argument arg)\n\t\t\t: this (arg.Expr, arg.ArgType)\n\t\t{\n\t\t}\n\n\t\tprotected MovableArgument (Expression expr, AType modifier)\n\t\t\t: base (expr, modifier)\n\t\t{\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// TODO: Should guard against multiple emits\n\t\t\tbase.Emit (ec);\n\n\t\t\t// Release temporary variable when used\n\t\t\tif (variable != null)\n\t\t\t\tvariable.Release (ec);\n\t\t}\n\n\t\tpublic void EmitToVariable (EmitContext ec)\n\t\t{\n\t\t\tvar type = Expr.Type;\n\t\t\tif (IsByRef) {\n\t\t\t\tvar ml = (IMemoryLocation) Expr;\n\t\t\t\tml.AddressOf (ec, AddressOp.LoadStore);\n\t\t\t\ttype = ReferenceContainer.MakeType (ec.Module, type);\n\t\t\t} else {\n\t\t\t\tExpr.Emit (ec);\n\t\t\t}\n\n\t\t\tvariable = new LocalTemporary (type);\n\t\t\tvariable.Store (ec);\n\n\t\t\tExpr = variable;\n\t\t}\n\t}\n\n\tpublic class NamedArgument : MovableArgument\n\t{\n\t\tpublic readonly string Name;\n\t\treadonly Location loc;\n\n\t\tpublic NamedArgument (string name, Location loc, Expression expr)\n\t\t\t: this (name, loc, expr, AType.None)\n\t\t{\n\t\t}\n\n\t\tpublic NamedArgument (string name, Location loc, Expression expr, AType modifier)\n\t\t\t: base (expr, modifier)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (853, loc, \"An expression tree cannot contain named argument\");\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget { return loc; }\n\t\t}\n\t}\n\t\n\tpublic class Arguments\n\t{\n\t\tsealed class ArgumentsOrdered : Arguments\n\t\t{\n\t\t\treadonly List<MovableArgument> ordered;\n\n\t\t\tpublic ArgumentsOrdered (Arguments args)\n\t\t\t\t: base (args.Count)\n\t\t\t{\n\t\t\t\tAddRange (args);\n\t\t\t\tordered = new List<MovableArgument> ();\n\t\t\t}\n\n\t\t\tpublic void AddOrdered (MovableArgument arg)\n\t\t\t{\n\t\t\t\tordered.Add (arg);\n\t\t\t}\n\n\t\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc, List<MovableArgument> movable = null)\n\t\t\t{\n\t\t\t\tforeach (var arg in ordered) {\n\t\t\t\t\tif (arg.ArgType != Argument.AType.Out)\n\t\t\t\t\t\targ.FlowAnalysis (fc);\n\t\t\t\t}\n\n\t\t\t\tbase.FlowAnalysis (fc, ordered);\n\t\t\t}\n\n\t\t\tpublic override Arguments Emit (EmitContext ec, bool dup_args, bool prepareAwait)\n\t\t\t{\n\t\t\t\tforeach (var a in ordered) {\n\t\t\t\t\tif (prepareAwait)\n\t\t\t\t\t\ta.EmitToField (ec, false);\n\t\t\t\t\telse\n\t\t\t\t\t\ta.EmitToVariable (ec);\n\t\t\t\t}\n\n\t\t\t\treturn base.Emit (ec, dup_args, prepareAwait);\n\t\t\t}\n\t\t}\n\n\t\t// Try not to add any more instances to this class, it's allocated a lot\n\t\tList<Argument> args;\n\n\t\tpublic Arguments (int capacity)\n\t\t{\n\t\t\targs = new List<Argument> (capacity);\n\t\t}\n\n\t\tprivate Arguments (List<Argument> args)\n\t\t{\n\t\t\tthis.args = args;\n\t\t}\n\n\t\tpublic void Add (Argument arg)\n\t\t{\n\t\t\targs.Add (arg);\n\t\t}\n\n\t\tpublic void AddRange (Arguments args)\n\t\t{\n\t\t\tthis.args.AddRange (args.args);\n\t\t}\n\n\t\tpublic bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tforeach (var arg in args) {\n\t\t\t\tif (arg.Expr.ContainsEmitWithAwait ())\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic ArrayInitializer CreateDynamicBinderArguments (ResolveContext rc)\n\t\t{\n\t\t\tLocation loc = Location.Null;\n\t\t\tvar all = new ArrayInitializer (args.Count, loc);\n\n\t\t\tMemberAccess binder = DynamicExpressionStatement.GetBinderNamespace (loc);\n\n\t\t\tforeach (Argument a in args) {\n\t\t\t\tArguments dargs = new Arguments (2);\n\n\t\t\t\t// CSharpArgumentInfoFlags.None = 0\n\t\t\t\tconst string info_flags_enum = \"CSharpArgumentInfoFlags\";\n\t\t\t\tExpression info_flags = new IntLiteral (rc.BuiltinTypes, 0, loc);\n\n\t\t\t\tif (a.Expr is Constant) {\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"Constant\", loc));\n\t\t\t\t} else if (a.ArgType == Argument.AType.Ref) {\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"IsRef\", loc));\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"UseCompileTimeType\", loc));\n\t\t\t\t} else if (a.ArgType == Argument.AType.Out) {\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"IsOut\", loc));\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"UseCompileTimeType\", loc));\n\t\t\t\t} else if (a.ArgType == Argument.AType.DynamicTypeName) {\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"IsStaticType\", loc));\n\t\t\t\t}\n\n\t\t\t\tvar arg_type = a.Expr.Type;\n\n\t\t\t\tif (arg_type.BuiltinType != BuiltinTypeSpec.Type.Dynamic && arg_type != InternalType.NullLiteral) {\n\t\t\t\t\tMethodGroupExpr mg = a.Expr as MethodGroupExpr;\n\t\t\t\t\tif (mg != null) {\n\t\t\t\t\t\trc.Report.Error (1976, a.Expr.Location,\n\t\t\t\t\t\t\t\"The method group `{0}' cannot be used as an argument of dynamic operation. Consider using parentheses to invoke the method\",\n\t\t\t\t\t\t\tmg.Name);\n\t\t\t\t\t} else if (arg_type == InternalType.AnonymousMethod) {\n\t\t\t\t\t\trc.Report.Error (1977, a.Expr.Location,\n\t\t\t\t\t\t\t\"An anonymous method or lambda expression cannot be used as an argument of dynamic operation. Consider using a cast\");\n\t\t\t\t\t} else if (arg_type.Kind == MemberKind.Void || arg_type == InternalType.Arglist || arg_type.IsPointer) {\n\t\t\t\t\t\trc.Report.Error (1978, a.Expr.Location,\n\t\t\t\t\t\t\t\"An expression of type `{0}' cannot be used as an argument of dynamic operation\",\n\t\t\t\t\t\t\targ_type.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"UseCompileTimeType\", loc));\n\t\t\t\t}\n\n\t\t\t\tstring named_value;\n\t\t\t\tNamedArgument na = a as NamedArgument;\n\t\t\t\tif (na != null) {\n\t\t\t\t\tinfo_flags = new Binary (Binary.Operator.BitwiseOr, info_flags,\n\t\t\t\t\t\tnew MemberAccess (new MemberAccess (binder, info_flags_enum, loc), \"NamedArgument\", loc));\n\n\t\t\t\t\tnamed_value = na.Name;\n\t\t\t\t} else {\n\t\t\t\t\tnamed_value = null;\n\t\t\t\t}\n\n\t\t\t\tdargs.Add (new Argument (info_flags));\n\t\t\t\tdargs.Add (new Argument (new StringLiteral (rc.BuiltinTypes, named_value, loc)));\n\t\t\t\tall.Add (new Invocation (new MemberAccess (new MemberAccess (binder, \"CSharpArgumentInfo\", loc), \"Create\", loc), dargs));\n\t\t\t}\n\n\t\t\treturn all;\n\t\t}\n\n\t\tpublic static Arguments CreateForExpressionTree (ResolveContext ec, Arguments args, params Expression[] e)\n\t\t{\n\t\t\tArguments all = new Arguments ((args == null ? 0 : args.Count) + e.Length);\n\t\t\tfor (int i = 0; i < e.Length; ++i) {\n\t\t\t\tif (e [i] != null)\n\t\t\t\t\tall.Add (new Argument (e[i]));\n\t\t\t}\n\n\t\t\tif (args != null) {\n\t\t\t\tforeach (Argument a in args.args) {\n\t\t\t\t\tExpression tree_arg = a.CreateExpressionTree (ec);\n\t\t\t\t\tif (tree_arg != null)\n\t\t\t\t\t\tall.Add (new Argument (tree_arg));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn all;\n\t\t}\n\n\t\tpublic void CheckArrayAsAttribute (CompilerContext ctx)\n\t\t{\n\t\t\tforeach (Argument arg in args) {\n\t\t\t\t// Type is undefined (was error 246)\n\t\t\t\tif (arg.Type == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (arg.Type.IsArray)\n\t\t\t\t\tctx.Report.Warning (3016, 1, arg.Expr.Location, \"Arrays as attribute arguments are not CLS-compliant\");\n\t\t\t}\n\t\t}\n\n\t\tpublic Arguments Clone (CloneContext ctx)\n\t\t{\n\t\t\tArguments cloned = new Arguments (args.Count);\n\t\t\tforeach (Argument a in args)\n\t\t\t\tcloned.Add (a.Clone (ctx));\n\n\t\t\treturn cloned;\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget { return args.Count; }\n\t\t}\n\n\t\t//\n\t\t// Emits a list of resolved Arguments\n\t\t// \n\t\tpublic void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec, false, false);\n\t\t}\n\n\t\t//\n\t\t// if `dup_args' is true or any of arguments contains await.\n\t\t// A copy of all arguments will be returned to the caller\n\t\t//\n\t\tpublic virtual Arguments Emit (EmitContext ec, bool dup_args, bool prepareAwait)\n\t\t{\n\t\t\tList<Argument> dups;\n\n\t\t\tif ((dup_args && Count != 0) || prepareAwait)\n\t\t\t\tdups = new List<Argument> (Count);\n\t\t\telse\n\t\t\t\tdups = null;\n\n\t\t\tLocalTemporary lt;\n\t\t\tforeach (Argument a in args) {\n\t\t\t\tif (prepareAwait) {\n\t\t\t\t\tdups.Add (a.EmitToField (ec, true));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ta.Emit (ec);\n\n\t\t\t\tif (!dup_args) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (a.Expr.IsSideEffectFree) {\n\t\t\t\t\t//\n\t\t\t\t\t// No need to create a temporary variable for side effect free expressions. I assume\n\t\t\t\t\t// all side-effect free expressions are cheap, this has to be tweaked when we become\n\t\t\t\t\t// more aggressive on detection\n\t\t\t\t\t//\n\t\t\t\t\tdups.Add (a);\n\t\t\t\t} else {\n\t\t\t\t\tec.Emit (OpCodes.Dup);\n\n\t\t\t\t\t// TODO: Release local temporary on next Emit\n\t\t\t\t\t// Need to add a flag to argument to indicate this\n\t\t\t\t\tlt = new LocalTemporary (a.Type);\n\t\t\t\t\tlt.Store (ec);\n\n\t\t\t\t\tdups.Add (new Argument (lt, a.ArgType));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dups != null)\n\t\t\t\treturn new Arguments (dups);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual void FlowAnalysis (FlowAnalysisContext fc, List<MovableArgument> movable = null)\n\t\t{\n\t\t\tbool has_out = false;\n\t\t\tforeach (var arg in args) {\n\t\t\t\tif (arg.ArgType == Argument.AType.Out) {\n\t\t\t\t\thas_out = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (movable == null) {\n\t\t\t\t\targ.FlowAnalysis (fc);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar ma = arg as MovableArgument;\n\t\t\t\tif (ma != null && !movable.Contains (ma))\n\t\t\t\t\targ.FlowAnalysis (fc);\n\t\t\t}\n\n\t\t\tif (!has_out)\n\t\t\t\treturn;\n\n\t\t\tforeach (var arg in args) {\n\t\t\t\tif (arg.ArgType != Argument.AType.Out)\n\t\t\t\t\tcontinue;\n\n\t\t\t\targ.FlowAnalysis (fc);\n\t\t\t}\n\t\t}\n\n\t\tpublic List<Argument>.Enumerator GetEnumerator ()\n\t\t{\n\t\t\treturn args.GetEnumerator ();\n\t\t}\n\n\t\t//\n\t\t// At least one argument is of dynamic type\n\t\t//\n\t\tpublic bool HasDynamic {\n\t\t\tget {\n\t\t\t\tforeach (Argument a in args) {\n\t\t\t\t\tif (a.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && !a.IsByRef)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// At least one argument is named argument\n\t\t//\n\t\tpublic bool HasNamed {\n\t\t\tget {\n\t\t\t\tforeach (Argument a in args) {\n\t\t\t\t\tif (a is NamedArgument)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\n\t\tpublic void Insert (int index, Argument arg)\n\t\t{\n\t\t\targs.Insert (index, arg);\n\t\t}\n\n\t\tpublic static System.Linq.Expressions.Expression[] MakeExpression (Arguments args, BuilderContext ctx)\n\t\t{\n\t\t\tif (args == null || args.Count == 0)\n\t\t\t\treturn null;\n\n\t\t\tvar exprs = new System.Linq.Expressions.Expression [args.Count];\n\t\t\tfor (int i = 0; i < exprs.Length; ++i) {\n\t\t\t\tArgument a = args.args [i];\n\t\t\t\texprs[i] = a.Expr.MakeExpression (ctx);\n\t\t\t}\n\n\t\t\treturn exprs;\n\t\t}\n\n\t\t//\n\t\t// For named arguments when the order of execution is different\n\t\t// to order of invocation\n\t\t//\n\t\tpublic Arguments MarkOrderedArgument (NamedArgument a)\n\t\t{\n\t\t\t//\n\t\t\t// An expression has no effect on left-to-right execution\n\t\t\t//\n\t\t\tif (a.Expr.IsSideEffectFree)\n\t\t\t\treturn this;\n\n\t\t\tArgumentsOrdered ra = this as ArgumentsOrdered;\n\t\t\tif (ra == null) {\n\t\t\t\tra = new ArgumentsOrdered (this);\n\n\t\t\t\tfor (int i = 0; i < args.Count; ++i) {\n\t\t\t\t\tvar la = args [i];\n\t\t\t\t\tif (la == a)\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t//\n\t\t\t\t\t// When the argument is filled later by default expression\n\t\t\t\t\t//\n\t\t\t\t\tif (la == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar ma = la as MovableArgument;\n\t\t\t\t\tif (ma == null) {\n\t\t\t\t\t\tma = new MovableArgument (la);\n\t\t\t\t\t\tra.args[i] = ma;\n\t\t\t\t\t}\n\n\t\t\t\t\tra.AddOrdered (ma);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tra.AddOrdered (a);\n\t\t\treturn ra;\n\t\t}\n\n\t\t//\n\t\t// Returns dynamic when at least one argument is of dynamic type\n\t\t//\n\t\tpublic void Resolve (ResolveContext ec, out bool dynamic)\n\t\t{\n\t\t\tdynamic = false;\n\t\t\tforeach (Argument a in args) {\n\t\t\t\ta.Resolve (ec);\n\t\t\t\tif (a.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && !a.IsByRef)\n\t\t\t\t\tdynamic = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic void RemoveAt (int index)\n\t\t{\n\t\t\targs.RemoveAt (index);\n\t\t}\n\n\t\tpublic Argument this [int index] {\n\t\t\tget { return args [index]; }\n\t\t\tset { args [index] = value; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assembly.cs",
    "content": "//\n// assembly.cs: Assembly declaration and specifications\n//\n// Authors:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2004-2011 Novell, Inc.\n// Copyright 2011-2013 Xamarin Inc\n//\n\n\nusing System;\nusing System.IO;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Security;\nusing System.Security.Cryptography;\nusing System.Security.Permissions;\nusing Mono.Security.Cryptography;\nusing Mono.CompilerServices.SymbolWriter;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\nusing SecurityType = System.Collections.Generic.List<IKVM.Reflection.Emit.CustomAttributeBuilder>;\n#else\nusing SecurityType = System.Collections.Generic.Dictionary<System.Security.Permissions.SecurityAction, System.Security.PermissionSet>;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\tpublic interface IAssemblyDefinition\n\t{\n\t\tstring FullName { get; }\n\t\tbool IsCLSCompliant { get; }\n\t\tbool IsMissing { get; }\n\t\tstring Name { get; }\n\n\t\tbyte[] GetPublicKeyToken ();\n\t\tbool IsFriendAssemblyTo (IAssemblyDefinition assembly);\n\t}\n                \n\tpublic abstract class AssemblyDefinition : IAssemblyDefinition\n\t{\n\t\t// TODO: make it private and move all builder based methods here\n\t\tpublic AssemblyBuilder Builder;\n\t\tprotected AssemblyBuilderExtension builder_extra;\n\t\tMonoSymbolFile symbol_writer;\n\n\t\tbool is_cls_compliant;\n\t\tbool wrap_non_exception_throws;\n\t\tbool wrap_non_exception_throws_custom;\n\t\tbool has_user_debuggable;\n\n\t\tprotected ModuleContainer module;\n\t\treadonly string name;\n\t\tprotected readonly string file_name;\n\n\t\tbyte[] public_key, public_key_token;\n\t\tbool delay_sign;\n\n\t\t// Holds private/public key pair when private key\n\t\t// was available\n\t\tStrongNameKeyPair private_key;\t\n\n\t\tAttribute cls_attribute;\n\t\tMethod entry_point;\n\n\t\tprotected List<ImportedModuleDefinition> added_modules;\n\t\tSecurityType declarative_security;\n\t\tDictionary<ITypeDefinition, Attribute> emitted_forwarders;\n\t\tAssemblyAttributesPlaceholder module_target_attrs;\n\n\t\t// Win32 version info values\n\t\tstring vi_product, vi_product_version, vi_company, vi_copyright, vi_trademark;\n\n\t\tprotected AssemblyDefinition (ModuleContainer module, string name)\n\t\t{\n\t\t\tthis.module = module;\n\t\t\tthis.name = Path.GetFileNameWithoutExtension (name);\n\n\t\t\twrap_non_exception_throws = true;\n\n\t\t\tdelay_sign = Compiler.Settings.StrongNameDelaySign;\n\n\t\t\t//\n\t\t\t// Load strong name key early enough for assembly importer to be able to\n\t\t\t// use the keys for InternalsVisibleTo\n\t\t\t// This should go somewhere close to ReferencesLoading but don't have the place yet\n\t\t\t//\n\t\t\tif (Compiler.Settings.HasKeyFileOrContainer) {\n\t\t\t\tLoadPublicKey (Compiler.Settings.StrongNameKeyFile, Compiler.Settings.StrongNameKeyContainer);\n\t\t\t}\n\t\t}\n\n\t\tprotected AssemblyDefinition (ModuleContainer module, string name, string fileName)\n\t\t\t: this (module, name)\n\t\t{\n\t\t\tthis.file_name = fileName;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Attribute CLSCompliantAttribute {\n\t\t\tget {\n\t\t\t\treturn cls_attribute;\n\t\t\t}\n\t\t}\n\n\t\tpublic CompilerContext Compiler {\n\t\t\tget {\n\t\t\t\treturn module.Compiler;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Assembly entry point, aka Main method\n\t\t//\n\t\tpublic Method EntryPoint {\n\t\t\tget {\n\t\t\t\treturn entry_point;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tentry_point = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic string FullName {\n\t\t\tget {\n\t\t\t\treturn Builder.FullName;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasCLSCompliantAttribute {\n\t\t\tget {\n\t\t\t\treturn cls_attribute != null;\n\t\t\t}\n\t\t}\n\n\t\t// TODO: This should not exist here but will require more changes\n\t\tpublic MetadataImporter Importer {\n\t\t    get; set;\n\t\t}\n\n\t\tpublic bool IsCLSCompliant {\n\t\t\tget {\n\t\t\t\treturn is_cls_compliant;\n\t\t\t}\n\t\t}\n\n\t\tbool IAssemblyDefinition.IsMissing {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsSatelliteAssembly { get; private set; }\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool WrapNonExceptionThrows {\n\t\t\tget {\n\t\t\t\treturn wrap_non_exception_throws;\n\t\t\t}\n\t\t}\n\n\t\tprotected Report Report {\n\t\t\tget {\n\t\t\t\treturn Compiler.Report;\n\t\t\t}\n\t\t}\n\n\t\tpublic MonoSymbolFile SymbolWriter {\n\t\t\tget {\n\t\t\t\treturn symbol_writer;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void AddModule (ImportedModuleDefinition module)\n\t\t{\n\t\t\tif (added_modules == null) {\n\t\t\t\tadded_modules = new List<ImportedModuleDefinition> ();\n\t\t\t\tadded_modules.Add (module);\n\t\t\t}\n\t\t}\n\n\t\tpublic void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.IsValidSecurityAttribute ()) {\n\t\t\t\ta.ExtractSecurityPermissionSet (ctor, ref declarative_security);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.AssemblyCulture) {\n\t\t\t\tstring value = a.GetString ();\n\t\t\t\tif (value == null || value.Length == 0)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (Compiler.Settings.Target == Target.Exe) {\n\t\t\t\t\tReport.Error (7059, a.Location, \"Executables cannot be satellite assemblies. Remove the attribute or keep it empty\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (value == \"neutral\")\n\t\t\t\t\tvalue = \"\";\n\n\t\t\t\tif (Compiler.Settings.Target == Target.Module) {\n\t\t\t\t\tSetCustomAttribute (ctor, cdata);\n\t\t\t\t} else {\n\t\t\t\t\tbuilder_extra.SetCulture (value, a.Location);\n\t\t\t\t}\n\n\t\t\t\tIsSatelliteAssembly = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.AssemblyVersion) {\n\t\t\t\tstring value = a.GetString ();\n\t\t\t\tif (value == null || value.Length == 0)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar vinfo = IsValidAssemblyVersion (value, true);\n\t\t\t\tif (vinfo == null) {\n\t\t\t\t\tReport.Error (7034, a.Location, \"The specified version string `{0}' does not conform to the required format - major[.minor[.build[.revision]]]\",\n\t\t\t\t\t\tvalue);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (Compiler.Settings.Target == Target.Module) {\n\t\t\t\t\tSetCustomAttribute (ctor, cdata);\n\t\t\t\t} else {\n\t\t\t\t\tbuilder_extra.SetVersion (vinfo, a.Location);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.AssemblyAlgorithmId) {\n\t\t\t\tconst int pos = 2; // skip CA header\n\t\t\t\tuint alg = (uint) cdata [pos];\n\t\t\t\talg |= ((uint) cdata [pos + 1]) << 8;\n\t\t\t\talg |= ((uint) cdata [pos + 2]) << 16;\n\t\t\t\talg |= ((uint) cdata [pos + 3]) << 24;\n\n\t\t\t\tif (Compiler.Settings.Target == Target.Module) {\n\t\t\t\t\tSetCustomAttribute (ctor, cdata);\n\t\t\t\t} else {\n\t\t\t\t\tbuilder_extra.SetAlgorithmId (alg, a.Location);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.AssemblyFlags) {\n\t\t\t\tconst int pos = 2; // skip CA header\n\t\t\t\tuint flags = (uint) cdata[pos];\n\t\t\t\tflags |= ((uint) cdata [pos + 1]) << 8;\n\t\t\t\tflags |= ((uint) cdata [pos + 2]) << 16;\n\t\t\t\tflags |= ((uint) cdata [pos + 3]) << 24;\n\n\t\t\t\t// Ignore set PublicKey flag if assembly is not strongnamed\n\t\t\t\tif ((flags & (uint) AssemblyNameFlags.PublicKey) != 0 && public_key == null)\n\t\t\t\t\tflags &= ~(uint) AssemblyNameFlags.PublicKey;\n\n\t\t\t\tif (Compiler.Settings.Target == Target.Module) {\n\t\t\t\t\tSetCustomAttribute (ctor, cdata);\n\t\t\t\t} else {\n\t\t\t\t\tbuilder_extra.SetFlags (flags, a.Location);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.TypeForwarder) {\n\t\t\t\tTypeSpec t = a.GetArgumentType ();\n\t\t\t\tif (t == null || TypeManager.HasElementType (t)) {\n\t\t\t\t\tReport.Error (735, a.Location, \"Invalid type specified as an argument for TypeForwardedTo attribute\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (emitted_forwarders == null) {\n\t\t\t\t\temitted_forwarders = new Dictionary<ITypeDefinition, Attribute> ();\n\t\t\t\t} else if (emitted_forwarders.ContainsKey (t.MemberDefinition)) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (emitted_forwarders[t.MemberDefinition].Location, null);\n\t\t\t\t\tReport.Error (739, a.Location, \"A duplicate type forward of type `{0}'\",\n\t\t\t\t\t\tt.GetSignatureForError ());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\temitted_forwarders.Add (t.MemberDefinition, a);\n\n\t\t\t\tif (t.MemberDefinition.DeclaringAssembly == this) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (t);\n\t\t\t\t\tReport.Error (729, a.Location, \"Cannot forward type `{0}' because it is defined in this assembly\",\n\t\t\t\t\t\tt.GetSignatureForError ());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (t.IsNested) {\n\t\t\t\t\tReport.Error (730, a.Location, \"Cannot forward type `{0}' because it is a nested type\",\n\t\t\t\t\t\tt.GetSignatureForError ());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbuilder_extra.AddTypeForwarder (t.GetDefinition (), a.Location);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Extension) {\n\t\t\t\ta.Error_MisusedExtensionAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.InternalsVisibleTo) {\n\t\t\t\tstring assembly_name = a.GetString ();\n\t\t\t\tif (assembly_name == null) {\n\t\t\t\t\tReport.Error (7030, a.Location, \"Friend assembly reference cannot have `null' value\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (assembly_name.Length == 0)\n\t\t\t\t\treturn;\n#if STATIC\n\t\t\t\tParsedAssemblyName aname;\n\t\t\t\tParseAssemblyResult r = Fusion.ParseAssemblyName (assembly_name, out aname);\n\t\t\t\tif (r != ParseAssemblyResult.OK) {\n\t\t\t\t\tReport.Warning (1700, 3, a.Location, \"Friend assembly reference `{0}' is invalid and cannot be resolved\",\n\t\t\t\t\t\tassembly_name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (aname.Version != null || aname.Culture != null || aname.ProcessorArchitecture != ProcessorArchitecture.None) {\n\t\t\t\t\tReport.Error (1725, a.Location,\n\t\t\t\t\t\t\"Friend assembly reference `{0}' is invalid. InternalsVisibleTo declarations cannot have a version, culture or processor architecture specified\",\n\t\t\t\t\t\tassembly_name);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (public_key != null && !aname.HasPublicKey) {\n\t\t\t\t\tReport.Error (1726, a.Location,\n\t\t\t\t\t\t\"Friend assembly reference `{0}' is invalid. Strong named assemblies must specify a public key in their InternalsVisibleTo declarations\",\n\t\t\t\t\t\tassembly_name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n#endif\n\t\t\t} else if (a.Type == pa.RuntimeCompatibility) {\n\t\t\t\twrap_non_exception_throws_custom = true;\n\t\t\t} else if (a.Type == pa.AssemblyFileVersion) {\n\t\t\t\tvi_product_version = a.GetString ();\n\t\t\t\tif (string.IsNullOrEmpty (vi_product_version) || IsValidAssemblyVersion (vi_product_version, false) == null) {\n\t\t\t\t\tReport.Warning (7035, 1, a.Location, \"The specified version string `{0}' does not conform to the recommended format major.minor.build.revision\",\n\t\t\t\t\t\tvi_product_version, a.Name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// File version info decoding from blob is not supported\n\t\t\t\tvar cab = new CustomAttributeBuilder ((ConstructorInfo) ctor.GetMetaInfo (), new object[] { vi_product_version });\n\t\t\t\tBuilder.SetCustomAttribute (cab);\n\t\t\t\treturn;\n\t\t\t} else if (a.Type == pa.AssemblyProduct) {\n\t\t\t\tvi_product = a.GetString ();\n\t\t\t} else if (a.Type == pa.AssemblyCompany) {\n\t\t\t\tvi_company = a.GetString ();\n\t\t\t} else if (a.Type == pa.AssemblyDescription) {\n\t\t\t\t// TODO: Needs extra api\n\t\t\t} else if (a.Type == pa.AssemblyCopyright) {\n\t\t\t\tvi_copyright = a.GetString ();\n\t\t\t} else if (a.Type == pa.AssemblyTrademark) {\n\t\t\t\tvi_trademark = a.GetString ();\n\t\t\t} else if (a.Type == pa.Debuggable) {\n\t\t\t\thas_user_debuggable = true;\n\t\t\t}\n\n\t\t\tSetCustomAttribute (ctor, cdata);\n\t\t}\n\n\t\t//\n\t\t// When using assembly public key attributes InternalsVisibleTo key\n\t\t// was not checked, we have to do it later when we actually know what\n\t\t// our public key token is\n\t\t//\n\t\tvoid CheckReferencesPublicToken ()\n\t\t{\n\t\t\t// TODO: It should check only references assemblies but there is\n\t\t\t// no working SRE API\n\t\t\tforeach (var entry in Importer.Assemblies) {\n\t\t\t\tvar a = entry as ImportedAssemblyDefinition;\n\t\t\t\tif (a == null || a.IsMissing)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (public_key != null && !a.HasStrongName) {\n\t\t\t\t\tReport.Error (1577, \"Referenced assembly `{0}' does not have a strong name\",\n\t\t\t\t\t\ta.FullName);\n\t\t\t\t}\n\n\t\t\t\tvar ci = a.Assembly.GetName ().CultureInfo;\n\t\t\t\tif (!ci.Equals (CultureInfo.InvariantCulture)) {\n\t\t\t\t\tReport.Warning (8009, 1, \"Referenced assembly `{0}' has different culture setting of `{1}'\",\n\t\t\t\t\t\ta.Name, ci.Name);\n\t\t\t\t}\n\n\t\t\t\tif (!a.IsFriendAssemblyTo (this))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar attr = a.GetAssemblyVisibleToName (this);\n\t\t\t\tvar atoken = attr.GetPublicKeyToken ();\n\n\t\t\t\tif (ArrayComparer.IsEqual (GetPublicKeyToken (), atoken))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tReport.SymbolRelatedToPreviousError (a.Location);\n\t\t\t\tReport.Error (281,\n\t\t\t\t\t\"Friend access was granted to `{0}', but the output assembly is named `{1}'. Try adding a reference to `{0}' or change the output assembly name to match it\",\n\t\t\t\t\tattr.FullName, FullName);\n\t\t\t}\n\t\t}\n\n\t\tprotected AssemblyName CreateAssemblyName ()\n\t\t{\n\t\t\tvar an = new AssemblyName (name);\n\n\t\t\tif (public_key != null && Compiler.Settings.Target != Target.Module) {\n\t\t\t\tif (delay_sign) {\n\t\t\t\t\tan.SetPublicKey (public_key);\n\t\t\t\t} else {\n\t\t\t\t\tif (public_key.Length == 16) {\n\t\t\t\t\t\tReport.Error (1606, \"Could not sign the assembly. ECMA key can only be used to delay-sign assemblies\");\n\t\t\t\t\t} else if (private_key == null) {\n\t\t\t\t\t\tError_AssemblySigning (\"The specified key file does not have a private key\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tan.KeyPair = private_key;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn an;\n\t\t}\n\n\t\tpublic virtual ModuleBuilder CreateModuleBuilder ()\n\t\t{\n\t\t\tif (file_name == null)\n\t\t\t\tthrow new NotSupportedException (\"transient module in static assembly\");\n\n\t\t\tvar module_name = Path.GetFileName (file_name);\n\n\t\t\t// Always initialize module without symbolInfo. We could be framework dependent\n\t\t\t// but returned ISymbolWriter does not have all what we need therefore some\n\t\t\t// adaptor will be needed for now we alwayas emit MDB format when generating\n\t\t\t// debug info\n\t\t\treturn Builder.DefineDynamicModule (module_name, module_name, false);\n\t\t}\n\n\t\tpublic virtual void Emit ()\n\t\t{\n\t\t\tif (Compiler.Settings.Target == Target.Module) {\n\t\t\t\tmodule_target_attrs = new AssemblyAttributesPlaceholder (module, name);\n\t\t\t\tmodule_target_attrs.CreateContainer ();\n\t\t\t\tmodule_target_attrs.DefineContainer ();\n\t\t\t\tmodule_target_attrs.Define ();\n\t\t\t\tmodule.AddCompilerGeneratedClass (module_target_attrs);\n\t\t\t} else if (added_modules != null) {\n\t\t\t\tReadModulesAssemblyAttributes ();\n\t\t\t}\n\n\t\t\tif (Compiler.Settings.GenerateDebugInfo) {\n\t\t\t\tsymbol_writer = new MonoSymbolFile ();\n\t\t\t}\n\n\t\t\tmodule.EmitContainer ();\n\n\t\t\tif (module.HasExtensionMethod) {\n\t\t\t\tvar pa = module.PredefinedAttributes.Extension;\n\t\t\t\tif (pa.IsDefined) {\n\t\t\t\t\tSetCustomAttribute (pa.Constructor, AttributeEncoder.Empty);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!IsSatelliteAssembly) {\n\t\t\t\tif (!has_user_debuggable && Compiler.Settings.GenerateDebugInfo) {\n\t\t\t\t\tvar pa = module.PredefinedAttributes.Debuggable;\n\t\t\t\t\tif (pa.IsDefined) {\n\t\t\t\t\t\tvar modes = System.Diagnostics.DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints;\n\t\t\t\t\t\tif (!Compiler.Settings.Optimize)\n\t\t\t\t\t\t\tmodes |= System.Diagnostics.DebuggableAttribute.DebuggingModes.DisableOptimizations;\n\n\t\t\t\t\t\tpa.EmitAttribute (Builder, modes);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!wrap_non_exception_throws_custom) {\n\t\t\t\t\tPredefinedAttribute pa = module.PredefinedAttributes.RuntimeCompatibility;\n\t\t\t\t\tif (pa.IsDefined && pa.ResolveBuilder ()) {\n\t\t\t\t\t\tvar prop = module.PredefinedMembers.RuntimeCompatibilityWrapNonExceptionThrows.Get ();\n\t\t\t\t\t\tif (prop != null) {\n\t\t\t\t\t\t\tAttributeEncoder encoder = new AttributeEncoder ();\n\t\t\t\t\t\t\tencoder.EncodeNamedPropertyArgument (prop, new BoolLiteral (Compiler.BuiltinTypes, true, Location.Null));\n\t\t\t\t\t\t\tSetCustomAttribute (pa.Constructor, encoder.ToArray ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (declarative_security != null) {\n#if STATIC\n\t\t\t\t\tforeach (var entry in declarative_security) {\n\t\t\t\t\t\tBuilder.__AddDeclarativeSecurity (entry);\n\t\t\t\t\t}\n#else\n\t\t\t\t\tthrow new NotSupportedException (\"Assembly-level security\");\n#endif\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tCheckReferencesPublicToken ();\n\n\t\t\tSetEntryPoint ();\n\t\t}\n\n\t\tpublic byte[] GetPublicKeyToken ()\n\t\t{\n\t\t\tif (public_key == null || public_key_token != null)\n\t\t\t\treturn public_key_token;\n\n\t\t\tHashAlgorithm ha = SHA1.Create ();\n\t\t\tbyte[] hash = ha.ComputeHash (public_key);\n\t\t\t// we need the last 8 bytes in reverse order\n\t\t\tpublic_key_token = new byte[8];\n\t\t\tBuffer.BlockCopy (hash, hash.Length - 8, public_key_token, 0, 8);\n\t\t\tArray.Reverse (public_key_token, 0, 8);\n\t\t\treturn public_key_token;\n\t\t}\n\n\t\t//\n\t\t// Either keyFile or keyContainer has to be non-null\n\t\t//\n\t\tvoid LoadPublicKey (string keyFile, string keyContainer)\n\t\t{\n\t\t\tif (keyContainer != null) {\n\t\t\t\ttry {\n\t\t\t\t\tprivate_key = new StrongNameKeyPair (keyContainer);\n\t\t\t\t\tpublic_key = private_key.PublicKey;\n\t\t\t\t} catch {\n\t\t\t\t\tError_AssemblySigning (\"The specified key container `\" + keyContainer + \"' does not exist\");\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbool key_file_exists = File.Exists (keyFile);\n\n\t\t\t//\n\t\t\t// For attribute based KeyFile do additional lookup\n\t\t\t// in output assembly path\n\t\t\t//\n\t\t\tif (!key_file_exists && Compiler.Settings.StrongNameKeyFile == null) {\n\t\t\t\t//\n\t\t\t\t// The key file can be relative to output assembly\n\t\t\t\t//\n\t\t\t\tstring test_path = Path.Combine (Path.GetDirectoryName (file_name), keyFile);\n\t\t\t\tkey_file_exists = File.Exists (test_path);\n\t\t\t\tif (key_file_exists)\n\t\t\t\t\tkeyFile = test_path;\n\t\t\t}\n\n\t\t\tif (!key_file_exists) {\n\t\t\t\tError_AssemblySigning (\"The specified key file `\" + keyFile + \"' does not exist\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tusing (FileStream fs = new FileStream (keyFile, FileMode.Open, FileAccess.Read)) {\n\t\t\t\tbyte[] snkeypair = new byte[fs.Length];\n\t\t\t\tfs.Read (snkeypair, 0, snkeypair.Length);\n\n\t\t\t\t// check for ECMA key\n\t\t\t\tif (snkeypair.Length == 16) {\n\t\t\t\t\tpublic_key = snkeypair;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\t// take it, with or without, a private key\n\t\t\t\t\tRSA rsa = CryptoConvert.FromCapiKeyBlob (snkeypair);\n\t\t\t\t\t// and make sure we only feed the public part to Sys.Ref\n\t\t\t\t\tbyte[] publickey = CryptoConvert.ToCapiPublicKeyBlob (rsa);\n\n\t\t\t\t\t// AssemblyName.SetPublicKey requires an additional header\n\t\t\t\t\tbyte[] publicKeyHeader = new byte[8] { 0x00, 0x24, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00 };\n\n\t\t\t\t\t// Encode public key\n\t\t\t\t\tpublic_key = new byte[12 + publickey.Length];\n\t\t\t\t\tBuffer.BlockCopy (publicKeyHeader, 0, public_key, 0, publicKeyHeader.Length);\n\n\t\t\t\t\t// Length of Public Key (in bytes)\n\t\t\t\t\tint lastPart = public_key.Length - 12;\n\t\t\t\t\tpublic_key[8] = (byte) (lastPart & 0xFF);\n\t\t\t\t\tpublic_key[9] = (byte) ((lastPart >> 8) & 0xFF);\n\t\t\t\t\tpublic_key[10] = (byte) ((lastPart >> 16) & 0xFF);\n\t\t\t\t\tpublic_key[11] = (byte) ((lastPart >> 24) & 0xFF);\n\n\t\t\t\t\tBuffer.BlockCopy (publickey, 0, public_key, 12, publickey.Length);\n\t\t\t\t} catch {\n\t\t\t\t\tError_AssemblySigning (\"The specified key file `\" + keyFile + \"' has incorrect format\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (delay_sign)\n\t\t\t\t\treturn;\n\n\t\t\t\ttry {\n\t\t\t\t\t// TODO: Is there better way to test for a private key presence ?\n\t\t\t\t\tCryptoConvert.FromCapiPrivateKeyBlob (snkeypair);\n\t\t\t\t\tprivate_key = new StrongNameKeyPair (snkeypair);\n\t\t\t\t} catch { }\n\t\t\t}\n\t\t}\n\n\t\tvoid ReadModulesAssemblyAttributes ()\n\t\t{\n\t\t\tforeach (var m in added_modules) {\n\t\t\t\tvar cattrs = m.ReadAssemblyAttributes ();\n\t\t\t\tif (cattrs == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tmodule.OptAttributes.AddAttributes (cattrs);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Resolve ()\n\t\t{\n\t\t\tif (Compiler.Settings.Unsafe && module.PredefinedTypes.SecurityAction.Define ()) {\n\t\t\t\t//\n\t\t\t\t// Emits [assembly: SecurityPermissionAttribute (SecurityAction.RequestMinimum, SkipVerification = true)]\n\t\t\t\t// when -unsafe option was specified\n\t\t\t\t//\n\t\t\t\tLocation loc = Location.Null;\n\n\t\t\t\tMemberAccess system_security_permissions = new MemberAccess (new MemberAccess (\n\t\t\t\t\tnew QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, \"System\", loc), \"Security\", loc), \"Permissions\", loc);\n\n\t\t\t\tvar req_min = module.PredefinedMembers.SecurityActionRequestMinimum.Resolve (loc);\n\n\t\t\t\tArguments pos = new Arguments (1);\n\t\t\t\tpos.Add (new Argument (req_min.GetConstant (null)));\n\n\t\t\t\tArguments named = new Arguments (1);\n\t\t\t\tnamed.Add (new NamedArgument (\"SkipVerification\", loc, new BoolLiteral (Compiler.BuiltinTypes, true, loc)));\n\n\t\t\t\tAttribute g = new Attribute (\"assembly\",\n\t\t\t\t\tnew MemberAccess (system_security_permissions, \"SecurityPermissionAttribute\"),\n\t\t\t\t\tnew Arguments[] { pos, named }, loc, false);\n\t\t\t\tg.AttachTo (module, module);\n\n\t\t\t\t// Disable no-location warnings (e.g. obsolete) for compiler generated attribute\n\t\t\t\tCompiler.Report.DisableReporting ();\n\t\t\t\ttry {\n\t\t\t\t\tvar ctor = g.Resolve ();\n\t\t\t\t\tif (ctor != null) {\n\t\t\t\t\t\tg.ExtractSecurityPermissionSet (ctor, ref declarative_security);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tCompiler.Report.EnableReporting ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (module.OptAttributes == null)\n\t\t\t\treturn;\n\n\t\t\t// Ensure that we only have GlobalAttributes, since the Search isn't safe with other types.\n\t\t\tif (!module.OptAttributes.CheckTargets())\n\t\t\t\treturn;\n\n\t\t\tcls_attribute = module.ResolveAssemblyAttribute (module.PredefinedAttributes.CLSCompliant);\n\n\t\t\tif (cls_attribute != null) {\n\t\t\t\tis_cls_compliant = cls_attribute.GetClsCompliantAttributeValue ();\n\t\t\t}\n\n\t\t\tif (added_modules != null && Compiler.Settings.VerifyClsCompliance && is_cls_compliant) {\n\t\t\t\tforeach (var m in added_modules) {\n\t\t\t\t\tif (!m.IsCLSCompliant) {\n\t\t\t\t\t\tReport.Error (3013,\n\t\t\t\t\t\t\t\"Added modules must be marked with the CLSCompliant attribute to match the assembly\",\n\t\t\t\t\t\t\tm.Name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAttribute a = module.ResolveAssemblyAttribute (module.PredefinedAttributes.RuntimeCompatibility);\n\t\t\tif (a != null) {\n\t\t\t\tvar val = a.GetNamedValue (\"WrapNonExceptionThrows\") as BoolConstant;\n\t\t\t\tif (val != null)\n\t\t\t\t\twrap_non_exception_throws = val.Value;\n\t\t\t}\n\t\t}\n\n\t\tprotected void ResolveAssemblySecurityAttributes ()\n\t\t{\n\t\t\tstring key_file = null;\n\t\t\tstring key_container = null;\n\n\t\t\tif (module.OptAttributes != null) {\n\t\t\t\tforeach (Attribute a in module.OptAttributes.Attrs) {\n\t\t\t\t\t// cannot rely on any resolve-based members before you call Resolve\n\t\t\t\t\tif (a.ExplicitTarget != \"assembly\")\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// TODO: This code is buggy: comparing Attribute name without resolving is wrong.\n\t\t\t\t\t//       However, this is invoked by CodeGen.Init, when none of the namespaces\n\t\t\t\t\t//       are loaded yet.\n\t\t\t\t\t// TODO: Does not handle quoted attributes properly\n\t\t\t\t\tswitch (a.Name) {\n\t\t\t\t\tcase \"AssemblyKeyFile\":\n\t\t\t\t\tcase \"AssemblyKeyFileAttribute\":\n\t\t\t\t\tcase \"System.Reflection.AssemblyKeyFileAttribute\":\n\t\t\t\t\t\tif (Compiler.Settings.StrongNameKeyFile != null) {\n\t\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (a.Location, a.GetSignatureForError ());\n\t\t\t\t\t\t\tReport.Warning (1616, 1, \"Option `{0}' overrides attribute `{1}' given in a source file or added module\",\n\t\t\t\t\t\t\t\t\t\"keyfile\", \"System.Reflection.AssemblyKeyFileAttribute\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstring value = a.GetString ();\n\t\t\t\t\t\t\tif (!string.IsNullOrEmpty (value)) {\n\t\t\t\t\t\t\t\tError_ObsoleteSecurityAttribute (a, \"keyfile\");\n\t\t\t\t\t\t\t\tkey_file = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"AssemblyKeyName\":\n\t\t\t\t\tcase \"AssemblyKeyNameAttribute\":\n\t\t\t\t\tcase \"System.Reflection.AssemblyKeyNameAttribute\":\n\t\t\t\t\t\tif (Compiler.Settings.StrongNameKeyContainer != null) {\n\t\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (a.Location, a.GetSignatureForError ());\n\t\t\t\t\t\t\tReport.Warning (1616, 1, \"Option `{0}' overrides attribute `{1}' given in a source file or added module\",\n\t\t\t\t\t\t\t\t\t\"keycontainer\", \"System.Reflection.AssemblyKeyNameAttribute\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstring value = a.GetString ();\n\t\t\t\t\t\t\tif (!string.IsNullOrEmpty (value)) {\n\t\t\t\t\t\t\t\tError_ObsoleteSecurityAttribute (a, \"keycontainer\");\n\t\t\t\t\t\t\t\tkey_container = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"AssemblyDelaySign\":\n\t\t\t\t\tcase \"AssemblyDelaySignAttribute\":\n\t\t\t\t\tcase \"System.Reflection.AssemblyDelaySignAttribute\":\n\t\t\t\t\t\tbool b = a.GetBoolean ();\n\t\t\t\t\t\tif (b) {\n\t\t\t\t\t\t\tError_ObsoleteSecurityAttribute (a, \"delaysign\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdelay_sign = b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We came here only to report assembly attributes warnings\n\t\t\tif (public_key != null)\n\t\t\t\treturn;\n\n\t\t\t//\n\t\t\t// Load the strong key file found in attributes when no\n\t\t\t// command line key was given\n\t\t\t//\n\t\t\tif (key_file != null || key_container != null) {\n\t\t\t\tLoadPublicKey (key_file, key_container);\n\t\t\t} else if (delay_sign) {\n\t\t\t\tReport.Warning (1607, 1, \"Delay signing was requested but no key file was given\");\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmbedResources ()\n\t\t{\n\t\t\t//\n\t\t\t// Add Win32 resources\n\t\t\t//\n\t\t\tif (Compiler.Settings.Win32ResourceFile != null) {\n\t\t\t\tBuilder.DefineUnmanagedResource (Compiler.Settings.Win32ResourceFile);\n\t\t\t} else {\n\t\t\t\tBuilder.DefineVersionInfoResource (vi_product, vi_product_version, vi_company, vi_copyright, vi_trademark);\n\t\t\t}\n\n\t\t\tif (Compiler.Settings.Win32IconFile != null) {\n\t\t\t\tbuilder_extra.DefineWin32IconResource (Compiler.Settings.Win32IconFile);\n\t\t\t}\n\n\t\t\tif (Compiler.Settings.Resources != null) {\n\t\t\t\tif (Compiler.Settings.Target == Target.Module) {\n\t\t\t\t\tReport.Error (1507, \"Cannot link resource file when building a module\");\n\t\t\t\t} else {\n\t\t\t\t\tint counter = 0;\n\t\t\t\t\tforeach (var res in Compiler.Settings.Resources) {\n\t\t\t\t\t\tif (!File.Exists (res.FileName)) {\n\t\t\t\t\t\t\tReport.Error (1566, \"Error reading resource file `{0}'\", res.FileName);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (res.IsEmbeded) {\n\t\t\t\t\t\t\tStream stream;\n\t\t\t\t\t\t\tif (counter++ < 10) {\n\t\t\t\t\t\t\t\tstream = File.OpenRead (res.FileName);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// TODO: SRE API requires resource stream to be available during AssemblyBuilder::Save\n\t\t\t\t\t\t\t\t// we workaround it by reading everything into memory to compile projects with\n\t\t\t\t\t\t\t\t// many embedded resource (over 3500) references\n\t\t\t\t\t\t\t\tstream = new MemoryStream (File.ReadAllBytes (res.FileName));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmodule.Builder.DefineManifestResource (res.Name, stream, res.Attributes);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tBuilder.AddResourceFile (res.Name, Path.GetFileName (res.FileName), res.Attributes);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Save ()\n\t\t{\n\t\t\tPortableExecutableKinds pekind = PortableExecutableKinds.ILOnly;\n\t\t\tImageFileMachine machine;\n\n\t\t\tswitch (Compiler.Settings.Platform) {\n\t\t\tcase Platform.X86:\n\t\t\t\tpekind |= PortableExecutableKinds.Required32Bit;\n\t\t\t\tmachine = ImageFileMachine.I386;\n\t\t\t\tbreak;\n\t\t\tcase Platform.X64:\n\t\t\t\tpekind |= PortableExecutableKinds.PE32Plus;\n\t\t\t\tmachine = ImageFileMachine.AMD64;\n\t\t\t\tbreak;\n\t\t\tcase Platform.IA64:\n\t\t\t\tmachine = ImageFileMachine.IA64;\n\t\t\t\tbreak;\n\t\t\tcase Platform.AnyCPU32Preferred:\n#if STATIC\n\t\t\t\tpekind |= PortableExecutableKinds.Preferred32Bit;\n\t\t\t\tmachine = ImageFileMachine.I386;\n\t\t\t\tbreak;\n#else\n\t\t\t\tthrow new NotSupportedException ();\n#endif\n\t\t\tcase Platform.Arm:\n#if STATIC\n\t\t\t\tmachine = ImageFileMachine.ARM;\n\t\t\t\tbreak;\n#else\n\t\t\t\tthrow new NotSupportedException ();\n#endif\n\t\t\tcase Platform.AnyCPU:\n\t\t\tdefault:\n\t\t\t\tmachine = ImageFileMachine.I386;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tCompiler.TimeReporter.Start (TimeReporter.TimerType.OutputSave);\n\t\t\ttry {\n\t\t\t\tif (Compiler.Settings.Target == Target.Module) {\n\t\t\t\t\tSaveModule (pekind, machine);\n\t\t\t\t} else {\n\t\t\t\t\tBuilder.Save (module.Builder.ScopeName, pekind, machine);\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tReport.Error (16, \"Could not write to file `\" + name + \"', cause: \" + e.Message);\n\t\t\t}\n\t\t\tCompiler.TimeReporter.Stop (TimeReporter.TimerType.OutputSave);\n\n\t\t\t// Save debug symbols file\n\t\t\tif (symbol_writer != null && Compiler.Report.Errors == 0) {\n\t\t\t\t// TODO: it should run in parallel\n\t\t\t\tCompiler.TimeReporter.Start (TimeReporter.TimerType.DebugSave);\n\n\t\t\t\tvar filename = file_name + \".mdb\";\n\t\t\t\ttry {\n\t\t\t\t\t// We mmap the file, so unlink the previous version since it may be in use\n\t\t\t\t\tFile.Delete (filename);\n\t\t\t\t} catch {\n\t\t\t\t\t// We can safely ignore\n\t\t\t\t}\n\n\t\t\t\tmodule.WriteDebugSymbol (symbol_writer);\n\n\t\t\t\tusing (FileStream fs = new FileStream (filename, FileMode.Create, FileAccess.Write)) {\n\t\t\t\t\tsymbol_writer.CreateSymbolFile (module.Builder.ModuleVersionId, fs);\n\t\t\t\t}\n\n\t\t\t\tCompiler.TimeReporter.Stop (TimeReporter.TimerType.DebugSave);\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void SaveModule (PortableExecutableKinds pekind, ImageFileMachine machine)\n\t\t{\n\t\t\tReport.RuntimeMissingSupport (Location.Null, \"-target:module\");\n\t\t}\n\n\t\tvoid SetCustomAttribute (MethodSpec ctor, byte[] data)\n\t\t{\n\t\t\tif (module_target_attrs != null)\n\t\t\t\tmodule_target_attrs.AddAssemblyAttribute (ctor, data);\n\t\t\telse\n\t\t\t\tBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), data);\n\t\t}\n\n\t\tvoid SetEntryPoint ()\n\t\t{\n\t\t\tif (!Compiler.Settings.NeedsEntryPoint) {\n\t\t\t\tif (Compiler.Settings.MainClass != null)\n\t\t\t\t\tReport.Error (2017, \"Cannot specify -main if building a module or library\");\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tPEFileKinds file_kind;\n\n\t\t\tswitch (Compiler.Settings.Target) {\n\t\t\tcase Target.Library:\n\t\t\tcase Target.Module:\n\t\t\t\tfile_kind = PEFileKinds.Dll;\n\t\t\t\tbreak;\n\t\t\tcase Target.WinExe:\n\t\t\t\tfile_kind = PEFileKinds.WindowApplication;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfile_kind = PEFileKinds.ConsoleApplication;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (entry_point == null) {\n\t\t\t\tstring main_class = Compiler.Settings.MainClass;\n\t\t\t\tif (main_class != null) {\n\t\t\t\t\t// TODO: Handle dotted names\n\t\t\t\t\tvar texpr = module.GlobalRootNamespace.LookupType (module, main_class, 0, LookupMode.Probing, Location.Null);\n\t\t\t\t\tif (texpr == null) {\n\t\t\t\t\t\tReport.Error (1555, \"Could not find `{0}' specified for Main method\", main_class);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar mtype = texpr.MemberDefinition as ClassOrStruct;\n\t\t\t\t\tif (mtype == null) {\n\t\t\t\t\t\tReport.Error (1556, \"`{0}' specified for Main method must be a valid class or struct\", main_class);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tReport.Error (1558, mtype.Location, \"`{0}' does not have a suitable static Main method\", mtype.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tstring pname = file_name == null ? name : Path.GetFileName (file_name);\n\t\t\t\t\tReport.Error (5001, \"Program `{0}' does not contain a static `Main' method suitable for an entry point\",\n\t\t\t\t\t\tpname);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tBuilder.SetEntryPoint (entry_point.MethodBuilder, file_kind);\n\t\t}\n\n\t\tvoid Error_ObsoleteSecurityAttribute (Attribute a, string option)\n\t\t{\n\t\t\tReport.Warning (1699, 1, a.Location,\n\t\t\t\t\"Use compiler option `{0}' or appropriate project settings instead of `{1}' attribute\",\n\t\t\t\toption, a.Name);\n\t\t}\n\n\t\tvoid Error_AssemblySigning (string text)\n\t\t{\n\t\t\tReport.Error (1548, \"Error during assembly signing. \" + text);\n\t\t}\n\n\t\tpublic bool IsFriendAssemblyTo (IAssemblyDefinition assembly)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic Version IsValidAssemblyVersion (string version, bool allowGenerated)\n\t\t{\n\t\t\tstring[] parts = version.Split ('.');\n\t\t\tif (parts.Length < 1 || parts.Length > 4)\n\t\t\t\treturn null;\n\n\t\t\tvar values = new int[4];\n\t\t\tfor (int i = 0; i < parts.Length; ++i) {\n\t\t\t\tif (!int.TryParse (parts[i], out values[i])) {\n\t\t\t\t\tif (parts[i].Length == 1 && parts[i][0] == '*' && allowGenerated) {\n\t\t\t\t\t\tif (i == 2) {\n\t\t\t\t\t\t\t// Nothing can follow *\n\t\t\t\t\t\t\tif (parts.Length > 3)\n\t\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t\t// Generate Build value based on days since 1/1/2000\n\t\t\t\t\t\t\tTimeSpan days = DateTime.Today - new DateTime (2000, 1, 1);\n\t\t\t\t\t\t\tvalues[i] = System.Math.Max (days.Days, 0);\n\t\t\t\t\t\t\ti = 3;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (i == 3) {\n\t\t\t\t\t\t\t// Generate Revision value based on every other second today\n\t\t\t\t\t\t\tvar seconds = DateTime.Now - DateTime.Today;\n\t\t\t\t\t\t\tvalues[i] = (int) seconds.TotalSeconds / 2;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (values[i] > ushort.MaxValue)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn new Version (values[0], values[1], values[2], values[3]);\n\t\t}\n\t}\n\n\tpublic class AssemblyResource : IEquatable<AssemblyResource>\n\t{\n\t\tpublic AssemblyResource (string fileName, string name)\n\t\t\t: this (fileName, name, false)\n\t\t{\n\t\t}\n\n\t\tpublic AssemblyResource (string fileName, string name, bool isPrivate)\n\t\t{\n\t\t\tFileName = fileName;\n\t\t\tName = name;\n\t\t\tAttributes = isPrivate ? ResourceAttributes.Private : ResourceAttributes.Public;\n\t\t}\n\n\t\tpublic ResourceAttributes Attributes { get; private set; }\n\t\tpublic string Name { get; private set; }\n\t\tpublic string FileName { get; private set; }\n\t\tpublic bool IsEmbeded { get; set; }\n\n\t\t#region IEquatable<AssemblyResource> Members\n\n\t\tpublic bool Equals (AssemblyResource other)\n\t\t{\n\t\t\treturn Name == other.Name;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t//\n\t// A placeholder class for assembly attributes when emitting module\n\t//\n\tclass AssemblyAttributesPlaceholder : CompilerGeneratedContainer\n\t{\n\t\tstatic readonly string TypeNamePrefix = \"<$AssemblyAttributes${0}>\";\n\t\tpublic static readonly string AssemblyFieldName = \"attributes\";\n\n\t\tField assembly;\n\n\t\tpublic AssemblyAttributesPlaceholder (ModuleContainer parent, string outputName)\n\t\t\t: base (parent, new MemberName (GetGeneratedName (outputName)), Modifiers.STATIC | Modifiers.INTERNAL)\n\t\t{\n\t\t\tassembly = new Field (this, new TypeExpression (parent.Compiler.BuiltinTypes.Object, Location), Modifiers.PUBLIC | Modifiers.STATIC,\n\t\t\t\tnew MemberName (AssemblyFieldName), null);\n\n\t\t\tAddField (assembly);\n\t\t}\n\n\t\tpublic void AddAssemblyAttribute (MethodSpec ctor, byte[] data)\n\t\t{\n\t\t\tassembly.SetCustomAttribute (ctor, data);\n\t\t}\n\n\t\tpublic static string GetGeneratedName (string outputName)\n\t\t{\n\t\t\treturn string.Format (TypeNamePrefix, outputName);\n\t\t}\n\t}\n\n\t//\n\t// Extension to System.Reflection.Emit.AssemblyBuilder to have fully compatible\n\t// compiler. This is a default implementation for framework System.Reflection.Emit\n\t// which does not implement any of the methods\n\t//\n\tpublic class AssemblyBuilderExtension\n\t{\n\t\treadonly CompilerContext ctx;\n\n\t\tpublic AssemblyBuilderExtension (CompilerContext ctx)\n\t\t{\n\t\t\tthis.ctx = ctx;\n\t\t}\n\n\t\tpublic virtual System.Reflection.Module AddModule (string module)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (Location.Null, \"-addmodule\");\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual void AddPermissionRequests (PermissionSet[] permissions)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (Location.Null, \"assembly declarative security\");\n\t\t}\n\n\t\tpublic virtual void AddTypeForwarder (TypeSpec type, Location loc)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (loc, \"TypeForwardedToAttribute\");\n\t\t}\n\n\t\tpublic virtual void DefineWin32IconResource (string fileName)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (Location.Null, \"-win32icon\");\n\t\t}\n\n\t\tpublic virtual void SetAlgorithmId (uint value, Location loc)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (loc, \"AssemblyAlgorithmIdAttribute\");\n\t\t}\n\n\t\tpublic virtual void SetCulture (string culture, Location loc)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (loc, \"AssemblyCultureAttribute\");\n\t\t}\n\n\t\tpublic virtual void SetFlags (uint flags, Location loc)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (loc, \"AssemblyFlagsAttribute\");\n\t\t}\n\n\t\tpublic virtual void SetVersion (Version version, Location loc)\n\t\t{\n\t\t\tctx.Report.RuntimeMissingSupport (loc, \"AssemblyVersionAttribute\");\n\t\t}\n\t}\n\n\tabstract class AssemblyReferencesLoader<T> where T : class\n\t{\n\t\tprotected readonly CompilerContext compiler;\n\n\t\tprotected readonly List<string> paths;\n\n\t\tprotected AssemblyReferencesLoader (CompilerContext compiler)\n\t\t{\n\t\t\tthis.compiler = compiler;\n\n\t\t\tpaths = new List<string> ();\n\t\t\tpaths.Add (Directory.GetCurrentDirectory ());\n\t\t\tpaths.AddRange (compiler.Settings.ReferencesLookupPaths);\n\t\t}\n\n\t\tpublic abstract bool HasObjectType (T assembly);\n\t\tprotected abstract string[] GetDefaultReferences ();\n\t\tpublic abstract T LoadAssemblyFile (string fileName, bool isImplicitReference);\n\t\tpublic abstract void LoadReferences (ModuleContainer module);\n\n\t\tprotected void Error_FileNotFound (string fileName)\n\t\t{\n\t\t\tcompiler.Report.Error (6, \"Metadata file `{0}' could not be found\", fileName);\n\t\t}\n\n\t\tprotected void Error_FileCorrupted (string fileName)\n\t\t{\n\t\t\tcompiler.Report.Error (9, \"Metadata file `{0}' does not contain valid metadata\", fileName);\n\t\t}\n\n\t\tprotected void Error_AssemblyIsModule (string fileName)\n\t\t{\n\t\t\tcompiler.Report.Error (1509,\n\t\t\t\t\"Referenced assembly file `{0}' is a module. Consider using `-addmodule' option to add the module\",\n\t\t\t\tfileName);\n\t\t}\n\n\t\tprotected void Error_ModuleIsAssembly (string fileName)\n\t\t{\n\t\t\tcompiler.Report.Error (1542,\n\t\t\t\t\"Added module file `{0}' is an assembly. Consider using `-r' option to reference the file\",\n\t\t\t\tfileName);\n\t\t}\n\n\t\tprotected void LoadReferencesCore (ModuleContainer module, out T corlib_assembly, out List<Tuple<RootNamespace, T>> loaded)\n\t\t{\n\t\t\tcompiler.TimeReporter.Start (TimeReporter.TimerType.ReferencesLoading);\n\n\t\t\tloaded = new List<Tuple<RootNamespace, T>> ();\n\n\t\t\t//\n\t\t\t// Load mscorlib.dll as the first\n\t\t\t//\n\t\t\tif (module.Compiler.Settings.StdLib) {\n\t\t\t\tcorlib_assembly = LoadAssemblyFile (\"mscorlib.dll\", true);\n\t\t\t} else {\n\t\t\t\tcorlib_assembly = default (T);\n\t\t\t}\n\n\t\t\tT a;\n\t\t\tforeach (string r in module.Compiler.Settings.AssemblyReferences) {\n\t\t\t\ta = LoadAssemblyFile (r, false);\n\t\t\t\tif (a == null || EqualityComparer<T>.Default.Equals (a, corlib_assembly))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar key = Tuple.Create (module.GlobalRootNamespace, a);\n\t\t\t\tif (loaded.Contains (key))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tloaded.Add (key);\n\t\t\t}\n\n\t\t\tif (corlib_assembly == null) {\n\t\t\t\t//\n\t\t\t\t// Requires second pass because HasObjectType can trigger assembly load event\n\t\t\t\t//\n\t\t\t\tfor (int i = 0; i < loaded.Count; ++i) {\n\t\t\t\t\tvar assembly = loaded [i];\n\n\t\t\t\t\t//\n\t\t\t\t\t// corlib assembly is the first referenced assembly which contains System.Object\n\t\t\t\t\t//\n\t\t\t\t\tif (HasObjectType (assembly.Item2)) {\n\t\t\t\t\t\tcorlib_assembly = assembly.Item2;\n\t\t\t\t\t\tloaded.RemoveAt (i);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (var entry in module.Compiler.Settings.AssemblyReferencesAliases) {\n\t\t\t\ta = LoadAssemblyFile (entry.Item2, false);\n\t\t\t\tif (a == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar key = Tuple.Create (module.CreateRootNamespace (entry.Item1), a);\n\t\t\t\tif (loaded.Contains (key))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tloaded.Add (key);\n\t\t\t}\n\n\t\t\tif (compiler.Settings.LoadDefaultReferences) {\n\t\t\t\tforeach (string r in GetDefaultReferences ()) {\n\t\t\t\t\ta = LoadAssemblyFile (r, true);\n\t\t\t\t\tif (a == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar key = Tuple.Create (module.GlobalRootNamespace, a);\n\t\t\t\t\tif (loaded.Contains (key))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tloaded.Add (key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcompiler.TimeReporter.Stop (TimeReporter.TimerType.ReferencesLoading);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs",
    "content": "//\n// assign.cs: Assignments.\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Martin Baulig (martin@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\t\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\nusing System;\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t/// <summary>\n\t///   This interface is implemented by expressions that can be assigned to.\n\t/// </summary>\n\t/// <remarks>\n\t///   This interface is implemented by Expressions whose values can not\n\t///   store the result on the top of the stack.\n\t///\n\t///   Expressions implementing this (Properties, Indexers and Arrays) would\n\t///   perform an assignment of the Expression \"source\" into its final\n\t///   location.\n\t///\n\t///   No values on the top of the stack are expected to be left by\n\t///   invoking this method.\n\t/// </remarks>\n\tpublic interface IAssignMethod {\n\t\t//\n\t\t// This is an extra version of Emit. If leave_copy is `true'\n\t\t// A copy of the expression will be left on the stack at the\n\t\t// end of the code generated for EmitAssign\n\t\t//\n\t\tvoid Emit (EmitContext ec, bool leave_copy);\n\n\t\t//\n\t\t// This method does the assignment\n\t\t// `source' will be stored into the location specified by `this'\n\t\t// if `leave_copy' is true, a copy of `source' will be left on the stack\n\t\t// if `prepare_for_load' is true, when `source' is emitted, there will\n\t\t// be data on the stack that it can use to compuatate its value. This is\n\t\t// for expressions like a [f ()] ++, where you can't call `f ()' twice.\n\t\t//\n\t\tvoid EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound);\n\n\t\t/*\n\t\tFor simple assignments, this interface is very simple, EmitAssign is called with source\n\t\tas the source expression and leave_copy and prepare_for_load false.\n\n\t\tFor compound assignments it gets complicated.\n\n\t\tEmitAssign will be called as before, however, prepare_for_load will be\n\t\ttrue. The @source expression will contain an expression\n\t\twhich calls Emit. So, the calls look like:\n\n\t\tthis.EmitAssign (ec, source, false, true) ->\n\t\t\tsource.Emit (ec); ->\n\t\t\t\t[...] ->\n\t\t\t\t\tthis.Emit (ec, false); ->\n\t\t\t\t\tend this.Emit (ec, false); ->\n\t\t\t\tend [...]\n\t\t\tend source.Emit (ec);\n\t\tend this.EmitAssign (ec, source, false, true)\n\n\n\t\tWhen prepare_for_load is true, EmitAssign emits a `token' on the stack that\n\t\tEmit will use for its state.\n\n\t\tLet's take FieldExpr as an example. assume we are emitting f ().y += 1;\n\n\t\tHere is the call tree again. This time, each call is annotated with the IL\n\t\tit produces:\n\n\t\tthis.EmitAssign (ec, source, false, true)\n\t\t\tcall f\n\t\t\tdup\n\n\t\t\tBinary.Emit ()\n\t\t\t\tthis.Emit (ec, false);\n\t\t\t\tldfld y\n\t\t\t\tend this.Emit (ec, false);\n\n\t\t\t\tIntConstant.Emit ()\n\t\t\t\tldc.i4.1\n\t\t\t\tend IntConstant.Emit\n\n\t\t\t\tadd\n\t\t\tend Binary.Emit ()\n\n\t\t\tstfld\n\t\tend this.EmitAssign (ec, source, false, true)\n\n\t\tObserve two things:\n\t\t\t1) EmitAssign left a token on the stack. It was the result of f ().\n\t\t\t2) This token was used by Emit\n\n\t\tleave_copy (in both EmitAssign and Emit) tells the compiler to leave a copy\n\t\tof the expression at that point in evaluation. This is used for pre/post inc/dec\n\t\tand for a = x += y. Let's do the above example with leave_copy true in EmitAssign\n\n\t\tthis.EmitAssign (ec, source, true, true)\n\t\t\tcall f\n\t\t\tdup\n\n\t\t\tBinary.Emit ()\n\t\t\t\tthis.Emit (ec, false);\n\t\t\t\tldfld y\n\t\t\t\tend this.Emit (ec, false);\n\n\t\t\t\tIntConstant.Emit ()\n\t\t\t\tldc.i4.1\n\t\t\t\tend IntConstant.Emit\n\n\t\t\t\tadd\n\t\t\tend Binary.Emit ()\n\n\t\t\tdup\n\t\t\tstloc temp\n\t\t\tstfld\n\t\t\tldloc temp\n\t\tend this.EmitAssign (ec, source, true, true)\n\n\t\tAnd with it true in Emit\n\n\t\tthis.EmitAssign (ec, source, false, true)\n\t\t\tcall f\n\t\t\tdup\n\n\t\t\tBinary.Emit ()\n\t\t\t\tthis.Emit (ec, true);\n\t\t\t\tldfld y\n\t\t\t\tdup\n\t\t\t\tstloc temp\n\t\t\t\tend this.Emit (ec, true);\n\n\t\t\t\tIntConstant.Emit ()\n\t\t\t\tldc.i4.1\n\t\t\t\tend IntConstant.Emit\n\n\t\t\t\tadd\n\t\t\tend Binary.Emit ()\n\n\t\t\tstfld\n\t\t\tldloc temp\n\t\tend this.EmitAssign (ec, source, false, true)\n\n\t\tNote that these two examples are what happens for ++x and x++, respectively.\n\t\t*/\n\t}\n\n\t/// <summary>\n\t///   An Expression to hold a temporary value.\n\t/// </summary>\n\t/// <remarks>\n\t///   The LocalTemporary class is used to hold temporary values of a given\n\t///   type to \"simulate\" the expression semantics. The local variable is\n\t///   never captured.\n\t///\n\t///   The local temporary is used to alter the normal flow of code generation\n\t///   basically it creates a local variable, and its emit instruction generates\n\t///   code to access this value, return its address or save its value.\n\t///\n\t///   If `is_address' is true, then the value that we store is the address to the\n\t///   real value, and not the value itself.\n\t///\n\t///   This is needed for a value type, because otherwise you just end up making a\n\t///   copy of the value on the stack and modifying it. You really need a pointer\n\t///   to the origional value so that you can modify it in that location. This\n\t///   Does not happen with a class because a class is a pointer -- so you always\n\t///   get the indirection.\n\t///\n\t/// </remarks>\n\tpublic class LocalTemporary : Expression, IMemoryLocation, IAssignMethod {\n\t\tLocalBuilder builder;\n\n\t\tpublic LocalTemporary (TypeSpec t)\n\t\t{\n\t\t\ttype = t;\n\t\t\teclass = ExprClass.Value;\n\t\t}\n\n\t\tpublic LocalTemporary (LocalBuilder b, TypeSpec t)\n\t\t\t: this (t)\n\t\t{\n\t\t\tbuilder = b;\n\t\t}\n\n\t\tpublic void Release (EmitContext ec)\n\t\t{\n\t\t\tec.FreeTemporaryLocal (builder, type);\n\t\t\tbuilder = null;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (1);\n\t\t\targs.Add (new Argument (this));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Constant\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (builder == null)\n\t\t\t\tthrow new InternalErrorException (\"Emit without Store, or after Release\");\n\n\t\t\tec.Emit (OpCodes.Ldloc, builder);\n\t\t}\n\n\t\t#region IAssignMethod Members\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tEmit (ec);\n\n\t\t\tif (leave_copy)\n\t\t\t\tEmit (ec);\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tif (isCompound)\n\t\t\t\tthrow new NotImplementedException ();\n\n\t\t\tsource.Emit (ec);\n\n\t\t\tStore (ec);\n\n\t\t\tif (leave_copy)\n\t\t\t\tEmit (ec);\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic LocalBuilder Builder {\n\t\t\tget { return builder; }\n\t\t}\n\n\t\tpublic void Store (EmitContext ec)\n\t\t{\n\t\t\tif (builder == null)\n\t\t\t\tbuilder = ec.GetTemporaryLocal (type);\n\n\t\t\tec.Emit (OpCodes.Stloc, builder);\n\t\t}\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tif (builder == null)\n\t\t\t\tbuilder = ec.GetTemporaryLocal (type);\n\n\t\t\tif (builder.LocalType.IsByRef) {\n\t\t\t\t//\n\t\t\t\t// if is_address, than this is just the address anyways,\n\t\t\t\t// so we just return this.\n\t\t\t\t//\n\t\t\t\tec.Emit (OpCodes.Ldloc, builder);\n\t\t\t} else {\n\t\t\t\tec.Emit (OpCodes.Ldloca, builder);\n\t\t\t}\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   The Assign node takes care of assigning the value of source into\n\t///   the expression represented by target.\n\t/// </summary>\n\tpublic abstract class Assign : ExpressionStatement {\n\t\tprotected Expression target, source;\n\n\t\tprotected Assign (Expression target, Expression source, Location loc)\n\t\t{\n\t\t\tthis.target = target;\n\t\t\tthis.source = source;\n\t\t\tthis.loc = loc;\n\t\t}\n\t\t\n\t\tpublic Expression Target {\n\t\t\tget { return target; }\n\t\t}\n\n\t\tpublic Expression Source {\n\t\t\tget {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn target.StartLocation;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn target.ContainsEmitWithAwait () || source.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (832, loc, \"An expression tree cannot contain an assignment operator\");\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tbool ok = true;\n\t\t\tsource = source.Resolve (ec);\n\t\t\t\t\t\t\n\t\t\tif (source == null) {\n\t\t\t\tok = false;\n\t\t\t\tsource = ErrorExpression.Instance;\n\t\t\t}\n\n\t\t\ttarget = target.ResolveLValue (ec, source);\n\n\t\t\tif (target == null || !ok)\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec target_type = target.Type;\n\t\t\tTypeSpec source_type = source.Type;\n\n\t\t\teclass = ExprClass.Value;\n\t\t\ttype = target_type;\n\n\t\t\tif (!(target is IAssignMethod)) {\n\t\t\t\ttarget.Error_ValueAssignment (ec, source);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (target_type != source_type) {\n\t\t\t\tExpression resolved = ResolveConversions (ec);\n\n\t\t\t\tif (resolved != this)\n\t\t\t\t\treturn resolved;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\tpublic override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\tvar tassign = target as IDynamicAssign;\n\t\t\tif (tassign == null)\n\t\t\t\tthrow new InternalErrorException (target.GetType () + \" does not support dynamic assignment\");\n\n\t\t\tvar target_object = tassign.MakeAssignExpression (ctx, source);\n\n\t\t\t//\n\t\t\t// Some hacking is needed as DLR does not support void type and requires\n\t\t\t// always have object convertible return type to support caching and chaining\n\t\t\t//\n\t\t\t// We do this by introducing an explicit block which returns RHS value when\n\t\t\t// available or null\n\t\t\t//\n\t\t\tif (target_object.NodeType == System.Linq.Expressions.ExpressionType.Block)\n\t\t\t\treturn target_object;\n\n\t\t\tSystem.Linq.Expressions.UnaryExpression source_object;\n\t\t\tif (ctx.HasSet (BuilderContext.Options.CheckedScope)) {\n\t\t\t\tsource_object = System.Linq.Expressions.Expression.ConvertChecked (source.MakeExpression (ctx), target_object.Type);\n\t\t\t} else {\n\t\t\t\tsource_object = System.Linq.Expressions.Expression.Convert (source.MakeExpression (ctx), target_object.Type);\n\t\t\t}\n\n\t\t\treturn System.Linq.Expressions.Expression.Assign (target_object, source_object);\n\t\t}\n#endif\n\t\tprotected virtual Expression ResolveConversions (ResolveContext ec)\n\t\t{\n\t\t\tsource = Convert.ImplicitConversionRequired (ec, source, target.Type, source.Location);\n\t\t\tif (source == null)\n\t\t\t\treturn null;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tvoid Emit (EmitContext ec, bool is_statement)\n\t\t{\n\t\t\tIAssignMethod t = (IAssignMethod) target;\n\t\t\tt.EmitAssign (ec, source, !is_statement, this is CompoundAssign);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec, false);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec, true);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tsource.FlowAnalysis (fc);\n\n\t\t\tif (target is ArrayAccess || target is IndexerExpr || target is PropertyExpr)\n\t\t\t\ttarget.FlowAnalysis (fc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tAssign _target = (Assign) t;\n\n\t\t\t_target.target = target.Clone (clonectx);\n\t\t\t_target.source = source.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class SimpleAssign : Assign\n\t{\n\t\tpublic SimpleAssign (Expression target, Expression source)\n\t\t\t: this (target, source, target.Location)\n\t\t{\n\t\t}\n\n\t\tpublic SimpleAssign (Expression target, Expression source, Location loc)\n\t\t\t: base (target, source, loc)\n\t\t{\n\t\t}\n\n\t\tbool CheckEqualAssign (Expression t)\n\t\t{\n\t\t\tif (source is Assign) {\n\t\t\t\tAssign a = (Assign) source;\n\t\t\t\tif (t.Equals (a.Target))\n\t\t\t\t\treturn true;\n\t\t\t\treturn a is SimpleAssign && ((SimpleAssign) a).CheckEqualAssign (t);\n\t\t\t}\n\t\t\treturn t.Equals (source);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tExpression e = base.DoResolve (ec);\n\t\t\tif (e == null || e != this)\n\t\t\t\treturn e;\n\n\t\t\tif (CheckEqualAssign (target))\n\t\t\t\tec.Report.Warning (1717, 3, loc, \"Assignment made to same variable; did you mean to assign something else?\");\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tbase.FlowAnalysis (fc);\n\n\t\t\tvar vr = target as VariableReference;\n\t\t\tif (vr != null) {\n\t\t\t\tif (vr.VariableInfo != null)\n\t\t\t\t\tfc.SetVariableAssigned (vr.VariableInfo);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar fe = target as FieldExpr;\n\t\t\tif (fe != null) {\n\t\t\t\tfe.SetFieldAssigned (fc);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void MarkReachable (Reachability rc)\n\t\t{\n\t\t\tvar es = source as ExpressionStatement;\n\t\t\tif (es != null)\n\t\t\t\tes.MarkReachable (rc);\n\t\t}\n\t}\n\n\tpublic class RuntimeExplicitAssign : Assign\n\t{\n\t\tpublic RuntimeExplicitAssign (Expression target, Expression source)\n\t\t\t: base (target, source, target.Location)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression ResolveConversions (ResolveContext ec)\n\t\t{\n\t\t\tsource = EmptyCast.Create (source, target.Type);\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t//\n\t// Compiler generated assign\n\t//\n\tclass CompilerAssign : Assign\n\t{\n\t\tpublic CompilerAssign (Expression target, Expression source, Location loc)\n\t\t\t: base (target, source, loc)\n\t\t{\n\t\t\tif (target.Type != null) {\n\t\t\t\ttype = target.Type;\n\t\t\t\teclass = ExprClass.Value;\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tvar expr = base.DoResolve (ec);\n\t\t\tvar vr = target as VariableReference;\n\t\t\tif (vr != null && vr.VariableInfo != null)\n\t\t\t\tvr.VariableInfo.IsEverAssigned = false;\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic void UpdateSource (Expression source)\n\t\t{\n\t\t\tbase.source = source;\n\t\t}\n\t}\n\n\t//\n\t// Implements fields and events class initializers\n\t//\n\tpublic class FieldInitializer : Assign\n\t{\n\t\t//\n\t\t// Field initializers are tricky for partial classes. They have to\n\t\t// share same constructor (block) for expression trees resolve but\n\t\t// they have they own resolve scope\n\t\t//\n\t\tsealed class FieldInitializerContext : BlockContext\n\t\t{\n\t\t\treadonly ExplicitBlock ctor_block;\n\n\t\t\tpublic FieldInitializerContext (IMemberContext mc, BlockContext constructorContext)\n\t\t\t\t: base (mc, null, constructorContext.ReturnType)\n\t\t\t{\n\t\t\t\tflags |= Options.FieldInitializerScope | Options.ConstructorScope;\n\t\t\t\tthis.ctor_block = constructorContext.CurrentBlock.Explicit;\n\n\t\t\t\tif (ctor_block.IsCompilerGenerated)\n\t\t\t\t\tCurrentBlock = ctor_block;\n\t\t\t}\n\n\t\t\tpublic override ExplicitBlock ConstructorBlock {\n\t\t\t    get {\n\t\t\t        return ctor_block;\n\t\t\t    }\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Keep resolved value because field initializers have their own rules\n\t\t//\n\t\tExpressionStatement resolved;\n\t\tFieldBase mc;\n\n\t\tpublic FieldInitializer (FieldBase mc, Expression expression, Location loc)\n\t\t\t: base (new FieldExpr (mc.Spec, expression.Location), expression, loc)\n\t\t{\n\t\t\tthis.mc = mc;\n\t\t\tif (!mc.IsStatic)\n\t\t\t\t((FieldExpr)target).InstanceExpression = new CompilerGeneratedThis (mc.CurrentType, expression.Location);\n\t\t}\n\n\t\tpublic int AssignmentOffset { get; private set; }\n\n\t\tpublic FieldBase Field {\n\t\t\tget {\n\t\t\t\treturn mc;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\t// Field initializer can be resolved (fail) many times\n\t\t\tif (source == null)\n\t\t\t\treturn null;\n\n\t\t\tif (resolved == null) {\n\t\t\t\tvar bc = (BlockContext) rc;\n\t\t\t\tvar ctx = new FieldInitializerContext (mc, bc);\n\t\t\t\tresolved = base.DoResolve (ctx) as ExpressionStatement;\n\t\t\t\tAssignmentOffset = ctx.AssignmentInfoOffset - bc.AssignmentInfoOffset;\n\t\t\t}\n\n\t\t\treturn resolved;\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tif (resolved == null)\n\t\t\t\treturn;\n\n\t\t\t//\n\t\t\t// Emit sequence symbol info even if we are in compiler generated\n\t\t\t// block to allow debugging field initializers when constructor is\n\t\t\t// compiler generated\n\t\t\t//\n\t\t\tif (ec.HasSet (BuilderContext.Options.OmitDebugInfo) && ec.HasMethodSymbolBuilder) {\n\t\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, false)) {\n\t\t\t\t\tec.Mark (loc);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (resolved != this)\n\t\t\t\tresolved.EmitStatement (ec);\n\t\t\telse\n\t\t\t\tbase.EmitStatement (ec);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tsource.FlowAnalysis (fc);\n\t\t\t((FieldExpr) target).SetFieldAssigned (fc);\n\t\t}\n\t\t\n\t\tpublic bool IsDefaultInitializer {\n\t\t\tget {\n\t\t\t\tConstant c = source as Constant;\n\t\t\t\tif (c == null)\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\tFieldExpr fe = (FieldExpr)target;\n\t\t\t\treturn c.IsDefaultInitializer (fe.Type);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn source.IsSideEffectFree;\n\t\t\t}\n\t\t}\n\t}\n\n\tclass PrimaryConstructorAssign : SimpleAssign\n\t{\n\t\treadonly Field field;\n\t\treadonly Parameter parameter;\n\n\t\tpublic PrimaryConstructorAssign (Field field, Parameter parameter)\n\t\t\t: base (null, null, parameter.Location)\n\t\t{\n\t\t\tthis.field = field;\n\t\t\tthis.parameter = parameter;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\ttarget = new FieldExpr (field, loc);\n\t\t\tsource = rc.CurrentBlock.ParametersBlock.GetParameterInfo (parameter).CreateReferenceExpression (rc, loc);\n\t\t\treturn base.DoResolve (rc);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tbase.EmitStatement (ec);\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// This class is used for compound assignments.\n\t//\n\tpublic class CompoundAssign : Assign\n\t{\n\t\t// This is just a hack implemented for arrays only\n\t\tpublic sealed class TargetExpression : Expression\n\t\t{\n\t\t\treadonly Expression child;\n\n\t\t\tpublic TargetExpression (Expression child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t\tthis.loc = child.Location;\n\t\t\t}\n\n\t\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t\t{\n\t\t\t\treturn child.ContainsEmitWithAwait ();\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\ttype = child.Type;\n\t\t\t\teclass = ExprClass.Value;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tchild.Emit (ec);\n\t\t\t}\n\n\t\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t\t{\n\t\t\t\treturn child.EmitToField (ec);\n\t\t\t}\n\t\t}\n\n\t\t// Used for underlying binary operator\n\t\treadonly Binary.Operator op;\n\t\tExpression right;\n\t\tExpression left;\n\t\t\n\t\tpublic Binary.Operator Op {\n\t\t\tget {\n\t\t\t\treturn op;\n\t\t\t}\n\t\t}\n\n\t\tpublic CompoundAssign (Binary.Operator op, Expression target, Expression source)\n\t\t\t: base (target, source, target.Location)\n\t\t{\n\t\t\tright = source;\n\t\t\tthis.op = op;\n\t\t}\n\n\t\tpublic CompoundAssign (Binary.Operator op, Expression target, Expression source, Expression left)\n\t\t\t: this (op, target, source)\n\t\t{\n\t\t\tthis.left = left;\n\t\t}\n\n\t\tpublic Binary.Operator Operator {\n\t\t\tget {\n\t\t\t\treturn op;\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tright = right.Resolve (ec);\n\t\t\tif (right == null)\n\t\t\t\treturn null;\n\n\t\t\tMemberAccess ma = target as MemberAccess;\n\t\t\tusing (ec.Set (ResolveContext.Options.CompoundAssignmentScope)) {\n\t\t\t\ttarget = target.Resolve (ec);\n\t\t\t}\n\t\t\t\n\t\t\tif (target == null)\n\t\t\t\treturn null;\n\n\t\t\tif (target is MethodGroupExpr){\n\t\t\t\tec.Report.Error (1656, loc,\n\t\t\t\t\t\"Cannot assign to `{0}' because it is a `{1}'\",\n\t\t\t\t\t((MethodGroupExpr)target).Name, target.ExprClassName);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar event_expr = target as EventExpr;\n\t\t\tif (event_expr != null) {\n\t\t\t\tsource = Convert.ImplicitConversionRequired (ec, right, target.Type, loc);\n\t\t\t\tif (source == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tExpression rside;\n\t\t\t\tif (op == Binary.Operator.Addition)\n\t\t\t\t\trside = EmptyExpression.EventAddition;\n\t\t\t\telse if (op == Binary.Operator.Subtraction)\n\t\t\t\t\trside = EmptyExpression.EventSubtraction;\n\t\t\t\telse\n\t\t\t\t\trside = null;\n\n\t\t\t\ttarget = target.ResolveLValue (ec, rside);\n\t\t\t\tif (target == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\teclass = ExprClass.Value;\n\t\t\t\ttype = event_expr.Operator.ReturnType;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Only now we can decouple the original source/target\n\t\t\t// into a tree, to guarantee that we do not have side\n\t\t\t// effects.\n\t\t\t//\n\t\t\tif (left == null)\n\t\t\t\tleft = new TargetExpression (target);\n\n\t\t\tsource = new Binary (op, left, right, true);\n\n\t\t\tif (target is DynamicMemberAssignable) {\n\t\t\t\tArguments targs = ((DynamicMemberAssignable) target).Arguments;\n\t\t\t\tsource = source.Resolve (ec);\n\n\t\t\t\tArguments args = new Arguments (targs.Count + 1);\n\t\t\t\targs.AddRange (targs);\n\t\t\t\targs.Add (new Argument (source));\n\n\t\t\t\tvar binder_flags = CSharpBinderFlags.ValueFromCompoundAssignment;\n\n\t\t\t\t//\n\t\t\t\t// Compound assignment does target conversion using additional method\n\t\t\t\t// call, set checked context as the binary operation can overflow\n\t\t\t\t//\n\t\t\t\tif (ec.HasSet (ResolveContext.Options.CheckedScope))\n\t\t\t\t\tbinder_flags |= CSharpBinderFlags.CheckedContext;\n\n\t\t\t\tif (target is DynamicMemberBinder) {\n\t\t\t\t\tsource = new DynamicMemberBinder (ma.Name, binder_flags, args, loc).Resolve (ec);\n\n\t\t\t\t\t// Handles possible event addition/subtraction\n\t\t\t\t\tif (op == Binary.Operator.Addition || op == Binary.Operator.Subtraction) {\n\t\t\t\t\t\targs = new Arguments (targs.Count + 1);\n\t\t\t\t\t\targs.AddRange (targs);\n\t\t\t\t\t\targs.Add (new Argument (right));\n\t\t\t\t\t\tstring method_prefix = op == Binary.Operator.Addition ?\n\t\t\t\t\t\t\tEvent.AEventAccessor.AddPrefix : Event.AEventAccessor.RemovePrefix;\n\n\t\t\t\t\t\tvar invoke = DynamicInvocation.CreateSpecialNameInvoke (\n\t\t\t\t\t\t\tnew MemberAccess (right, method_prefix + ma.Name, loc), args, loc).Resolve (ec);\n\n\t\t\t\t\t\targs = new Arguments (targs.Count);\n\t\t\t\t\t\targs.AddRange (targs);\n\t\t\t\t\t\tsource = new DynamicEventCompoundAssign (ma.Name, args,\n\t\t\t\t\t\t\t(ExpressionStatement) source, (ExpressionStatement) invoke, loc).Resolve (ec);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsource = new DynamicIndexBinder (binder_flags, args, loc).Resolve (ec);\n\t\t\t\t}\n\n\t\t\t\treturn source;\n\t\t\t}\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\ttarget.FlowAnalysis (fc);\n\t\t\tsource.FlowAnalysis (fc);\n\t\t}\n\n\t\tprotected override Expression ResolveConversions (ResolveContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// LAMESPEC: Under dynamic context no target conversion is happening\n\t\t\t// This allows more natual dynamic behaviour but breaks compatibility\n\t\t\t// with static binding\n\t\t\t//\n\t\t\tif (target is RuntimeValueExpression)\n\t\t\t\treturn this;\n\n\t\t\tTypeSpec target_type = target.Type;\n\n\t\t\t//\n\t\t\t// 1. the return type is implicitly convertible to the type of target\n\t\t\t//\n\t\t\tif (Convert.ImplicitConversionExists (ec, source, target_type)) {\n\t\t\t\tsource = Convert.ImplicitConversion (ec, source, target_type, loc);\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Otherwise, if the selected operator is a predefined operator\n\t\t\t//\n\t\t\tBinary b = source as Binary;\n\t\t\tif (b == null) {\n\t\t\t\tif (source is ReducedExpression)\n\t\t\t\t\tb = ((ReducedExpression) source).OriginalExpression as Binary;\n\t\t\t\telse if (source is ReducedExpression.ReducedConstantExpression) {\n\t\t\t\t\tb = ((ReducedExpression.ReducedConstantExpression) source).OriginalExpression as Binary;\n\t\t\t\t} else if (source is Nullable.LiftedBinaryOperator) {\n\t\t\t\t\tvar po = ((Nullable.LiftedBinaryOperator) source);\n\t\t\t\t\tif (po.UserOperator == null)\n\t\t\t\t\t\tb = po.Binary;\n\t\t\t\t} else if (source is TypeCast) {\n\t\t\t\t\tb = ((TypeCast) source).Child as Binary;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (b != null) {\n\t\t\t\t//\n\t\t\t\t// 2a. the operator is a shift operator\n\t\t\t\t//\n\t\t\t\t// 2b. the return type is explicitly convertible to the type of x, and\n\t\t\t\t// y is implicitly convertible to the type of x\n\t\t\t\t//\n\t\t\t\tif ((b.Oper & Binary.Operator.ShiftMask) != 0 ||\n\t\t\t\t\tConvert.ImplicitConversionExists (ec, right, target_type)) {\n\t\t\t\t\tsource = Convert.ExplicitConversion (ec, source, target_type, loc);\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (source.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tArguments arg = new Arguments (1);\n\t\t\t\targ.Add (new Argument (source));\n\t\t\t\treturn new SimpleAssign (target, new DynamicConversion (target_type, CSharpBinderFlags.ConvertExplicit, arg, loc), loc).Resolve (ec);\n\t\t\t}\n\n\t\t\tright.Error_ValueCannotBeConverted (ec, target_type, false);\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tCompoundAssign ctarget = (CompoundAssign) t;\n\n\t\t\tctarget.right = ctarget.source = source.Clone (clonectx);\n\t\t\tctarget.target = target.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs",
    "content": "//\n// async.cs: Asynchronous functions\n//\n// Author:\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2011 Novell, Inc.\n// Copyright 2011-2012 Xamarin Inc.\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Collections;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\tpublic class Await : ExpressionStatement\n\t{\n\t\tExpression expr;\n\t\tAwaitStatement stmt;\n\t\t\n\t\tpublic Expression Expression {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Await (Expression expr, Location loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic AwaitStatement Statement {\n\t\t\tget {\n\t\t\t\treturn stmt;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tvar t = (Await) target;\n\n\t\t\tt.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotImplementedException (\"ET\");\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tstmt.Expr.FlowAnalysis (fc);\n\n\t\t\tstmt.RegisterResumePoint ();\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tif (rc.HasSet (ResolveContext.Options.LockScope)) {\n\t\t\t\trc.Report.Error (1996, loc,\n\t\t\t\t\t\"The `await' operator cannot be used in the body of a lock statement\");\n\t\t\t}\n\n\t\t\tif (rc.IsUnsafe) {\n\t\t\t\trc.Report.Error (4004, loc,\n\t\t\t\t\t\"The `await' operator cannot be used in an unsafe context\");\n\t\t\t}\n\n\t\t\tvar bc = (BlockContext) rc;\n\n\t\t\tstmt = new AwaitStatement (expr, loc);\n\t\t\tif (!stmt.Resolve (bc))\n\t\t\t\treturn null;\n\n\t\t\ttype = stmt.ResultType;\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tstmt.EmitPrologue (ec);\n\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tstmt.Emit (ec);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t{\n\t\t\tstmt.EmitPrologue (ec);\n\t\t\treturn stmt.GetResultExpression (ec);\n\t\t}\n\t\t\n\t\tpublic void EmitAssign (EmitContext ec, FieldExpr field)\n\t\t{\n\t\t\tstmt.EmitPrologue (ec);\n\t\t\tfield.InstanceExpression.Emit (ec);\n\t\t\tstmt.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tstmt.EmitStatement (ec);\n\t\t}\n\n\t\tpublic override void MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\tstmt.MarkReachable (rc);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class AwaitStatement : YieldStatement<AsyncInitializer>\n\t{\n\t\tpublic sealed class AwaitableMemberAccess : MemberAccess\n\t\t{\n\t\t\tpublic AwaitableMemberAccess (Expression expr)\n\t\t\t\t: base (expr, \"GetAwaiter\")\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic bool ProbingMode { get; set; }\n\n\t\t\tprotected override void Error_TypeDoesNotContainDefinition (ResolveContext rc, TypeSpec type, string name)\n\t\t\t{\n\t\t\t\tError_OperatorCannotBeApplied (rc, type);\n\t\t\t}\n\n\t\t\tprotected override void Error_OperatorCannotBeApplied (ResolveContext rc, TypeSpec type)\n\t\t\t{\n\t\t\t\tif (ProbingMode)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar invocation = LeftExpression as Invocation;\n\t\t\t\tif (invocation != null && invocation.MethodGroup != null && (invocation.MethodGroup.BestCandidate.Modifiers & Modifiers.ASYNC) != 0) {\n\t\t\t\t\trc.Report.Error (4008, loc, \"Cannot await void method `{0}'. Consider changing method return type to `Task'\",\n\t\t\t\t\t\tinvocation.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\trc.Report.Error (4001, loc, \"Cannot await `{0}' expression\", type.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsealed class GetResultInvocation : Invocation\n\t\t{\n\t\t\tpublic GetResultInvocation (MethodGroupExpr mge, Arguments arguments)\n\t\t\t\t: base (null, arguments)\n\t\t\t{\n\t\t\t\tmg = mge;\n\t\t\t\ttype = mg.BestCandidateReturnType;\n\t\t\t}\n\n\t\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tField awaiter;\n\t\tAwaiterDefinition awaiter_definition;\n\t\tTypeSpec type;\n\t\tTypeSpec result_type;\n\n\t\tpublic AwaitStatement (Expression expr, Location loc)\n\t\t\t: base (expr, loc)\n\t\t{\n\t\t\tunwind_protect = true;\n\t\t}\n\n\t\t#region Properties\n\n\t\tbool IsDynamic {\n\t\t\tget {\n\t\t\t\treturn awaiter_definition == null;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec ResultType {\n\t\t\tget {\n\t\t\t\treturn result_type;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tGetResultExpression (ec).Emit (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression GetResultExpression (EmitContext ec)\n\t\t{\n\t\t\tvar fe_awaiter = new FieldExpr (awaiter, loc);\n\t\t\tfe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);\n\n\t\t\t//\n\t\t\t// result = awaiter.GetResult ();\n\t\t\t//\n\t\t\tif (IsDynamic) {\n\t\t\t\tvar rc = new ResolveContext (ec.MemberContext);\n\t\t\t\treturn new Invocation (new MemberAccess (fe_awaiter, \"GetResult\"), new Arguments (0)).Resolve (rc);\n\t\t\t}\n\t\t\t\n\t\t\tvar mg_result = MethodGroupExpr.CreatePredefined (awaiter_definition.GetResult, fe_awaiter.Type, loc);\n\t\t\tmg_result.InstanceExpression = fe_awaiter;\n\n\t\t\treturn new GetResultInvocation (mg_result, new Arguments (0));\n\t\t}\n\n\t\tpublic void EmitPrologue (EmitContext ec)\n\t\t{\n\t\t\tawaiter = ((AsyncTaskStorey) machine_initializer.Storey).AddAwaiter (expr.Type);\n\n\t\t\tvar fe_awaiter = new FieldExpr (awaiter, loc);\n\t\t\tfe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);\n\n\t\t\tLabel skip_continuation = ec.DefineLabel ();\n\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\t//\n\t\t\t\t// awaiter = expr.GetAwaiter ();\n\t\t\t\t//\n\t\t\t\tfe_awaiter.EmitAssign (ec, expr, false, false);\n\n\t\t\t\tExpression completed_expr;\n\t\t\t\tif (IsDynamic) {\n\t\t\t\t\tvar rc = new ResolveContext (ec.MemberContext);\n\n\t\t\t\t\tArguments dargs = new Arguments (1);\n\t\t\t\t\tdargs.Add (new Argument (fe_awaiter));\n\t\t\t\t\tcompleted_expr = new DynamicMemberBinder (\"IsCompleted\", dargs, loc).Resolve (rc);\n\n\t\t\t\t\tdargs = new Arguments (1);\n\t\t\t\t\tdargs.Add (new Argument (completed_expr));\n\t\t\t\t\tcompleted_expr = new DynamicConversion (ec.Module.Compiler.BuiltinTypes.Bool, 0, dargs, loc).Resolve (rc);\n\t\t\t\t} else {\n\t\t\t\t\tvar pe = PropertyExpr.CreatePredefined (awaiter_definition.IsCompleted, loc);\n\t\t\t\t\tpe.InstanceExpression = fe_awaiter;\n\t\t\t\t\tcompleted_expr = pe;\n\t\t\t\t}\n\n\t\t\t\tcompleted_expr.EmitBranchable (ec, skip_continuation, true);\n\t\t\t}\n\n\t\t\tbase.DoEmit (ec);\n\n\t\t\t//\n\t\t\t// The stack has to be empty before calling await continuation. We handle this\n\t\t\t// by lifting values which would be left on stack into class fields. The process\n\t\t\t// is quite complicated and quite hard to test because any expression can possibly\n\t\t\t// leave a value on the stack.\n\t\t\t//\n\t\t\t// Following assert fails when some of expression called before is missing EmitToField\n\t\t\t// or parent expression fails to find await in children expressions\n\t\t\t//\n\t\t\tec.AssertEmptyStack ();\n\n\t\t\tvar storey = (AsyncTaskStorey) machine_initializer.Storey;\n\t\t\tif (IsDynamic) {\n\t\t\t\tstorey.EmitAwaitOnCompletedDynamic (ec, fe_awaiter);\n\t\t\t} else {\n\t\t\t\tstorey.EmitAwaitOnCompleted (ec, fe_awaiter);\n\t\t\t}\n\n\t\t\t// Return ok\n\t\t\tmachine_initializer.EmitLeave (ec, unwind_protect);\n\n\t\t\tec.MarkLabel (resume_point);\n\t\t\tec.MarkLabel (skip_continuation);\n\t\t}\n\n\t\tpublic void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tEmitPrologue (ec);\n\t\t\tDoEmit (ec);\n\n\t\t\tawaiter.IsAvailableForReuse = true;\n\n\t\t\tif (ResultType.Kind != MemberKind.Void)\n\t\t\t\tec.Emit (OpCodes.Pop);\n\t\t}\n\n\t\tvoid Error_WrongAwaiterPattern (ResolveContext rc, TypeSpec awaiter)\n\t\t{\n\t\t\trc.Report.Error (4011, loc, \"The awaiter type `{0}' must have suitable IsCompleted and GetResult members\",\n\t\t\t\tawaiter.GetSignatureForError ());\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tif (bc.CurrentBlock is Linq.QueryBlock) {\n\t\t\t\tbc.Report.Error (1995, loc,\n\t\t\t\t\t\"The `await' operator may only be used in a query expression within the first collection expression of the initial `from' clause or within the collection expression of a `join' clause\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!base.Resolve (bc))\n\t\t\t\treturn false;\n\n\t\t\ttype = expr.Type;\n\t\t\tArguments args = new Arguments (0);\n\n\t\t\t//\n\t\t\t// The await expression is of dynamic type\n\t\t\t//\n\t\t\tif (type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tresult_type = type;\n\t\t\t\texpr = new Invocation (new MemberAccess (expr, \"GetAwaiter\"), args).Resolve (bc);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Check whether the expression is awaitable\n\t\t\t//\n\t\t\tExpression ama = new AwaitableMemberAccess (expr).Resolve (bc);\n\t\t\tif (ama == null)\n\t\t\t\treturn false;\n\n\t\t\tvar errors_printer = new SessionReportPrinter ();\n\t\t\tvar old = bc.Report.SetPrinter (errors_printer);\n\t\t\tama = new Invocation (ama, args).Resolve (bc);\n\t\t\tbc.Report.SetPrinter (old);\n\n\t\t\tif (errors_printer.ErrorsCount > 0 || !MemberAccess.IsValidDotExpression (ama.Type)) {\n\t\t\t\tbc.Report.Error (1986, expr.Location,\n\t\t\t\t\t\"The `await' operand type `{0}' must have suitable GetAwaiter method\",\n\t\t\t\t\texpr.Type.GetSignatureForError ());\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar awaiter_type = ama.Type;\n\n\t\t\tawaiter_definition = bc.Module.GetAwaiter (awaiter_type);\n\n\t\t\tif (!awaiter_definition.IsValidPattern) {\n\t\t\t\tError_WrongAwaiterPattern (bc, awaiter_type);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!awaiter_definition.INotifyCompletion) {\n\t\t\t\tbc.Report.Error (4027, loc, \"The awaiter type `{0}' must implement interface `{1}'\",\n\t\t\t\t\tawaiter_type.GetSignatureForError (), bc.Module.PredefinedTypes.INotifyCompletion.GetSignatureForError ());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\texpr = ama;\n\t\t\tresult_type = awaiter_definition.GetResult.ReturnType;\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tclass AsyncInitializerStatement : StatementExpression\n\t{\n\t\tpublic AsyncInitializerStatement (AsyncInitializer expr)\n\t\t\t: base (expr)\n\t\t{\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tbase.DoFlowAnalysis (fc);\n\n\t\t\tvar init = (AsyncInitializer) Expr;\n\t\t\tvar res = !init.Block.HasReachableClosingBrace;\n\t\t\tvar storey = (AsyncTaskStorey) init.Storey;\n\n\t\t\tif (storey.ReturnType.IsGenericTask)\n\t\t\t\treturn res;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (!rc.IsUnreachable)\n\t\t\t\treachable = true;\n\n\t\t\tvar init = (AsyncInitializer) Expr;\n\t\t\trc = init.Block.MarkReachable (rc);\n\n\t\t\tvar storey = (AsyncTaskStorey) init.Storey;\n\n\t\t\t//\n\t\t\t// Explicit return is required for Task<T> state machine\n\t\t\t//\n\t\t\tif (storey.ReturnType != null && storey.ReturnType.IsGenericTask)\n\t\t\t\treturn rc;\n\n\t\t    return Reachability.CreateUnreachable ();\n\t\t}\n\t}\n\n\tpublic class AsyncInitializer : StateMachineInitializer\n\t{\n\t\tTypeInferenceContext return_inference;\n\n\t\tpublic AsyncInitializer (ParametersBlock block, TypeDefinition host, TypeSpec returnType)\n\t\t\t: base (block, host, returnType)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override string ContainerType {\n\t\t\tget {\n\t\t\t\treturn \"async state machine block\";\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec DelegateType {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic StackFieldExpr HoistedReturnState {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic override bool IsIterator {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeInferenceContext ReturnTypeInference {\n\t\t\tget {\n\t\t\t\treturn return_inference;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected override BlockContext CreateBlockContext (BlockContext bc)\n\t\t{\n\t\t\tvar ctx = base.CreateBlockContext (bc);\n\t\t\tvar am = bc.CurrentAnonymousMethod as AnonymousMethodBody;\n\t\t\tif (am != null)\n\t\t\t\treturn_inference = am.ReturnTypeInference;\n\n\t\t\tctx.Set (ResolveContext.Options.TryScope);\n\n\t\t\treturn ctx;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic void EmitCatchBlock (EmitContext ec)\n\t\t{\n\t\t\tvar catch_value = LocalVariable.CreateCompilerGenerated (ec.Module.Compiler.BuiltinTypes.Exception, block, Location);\n\n\t\t\tec.BeginCatchBlock (catch_value.Type);\n\t\t\tcatch_value.EmitAssign (ec);\n\n\t\t\tec.EmitThis ();\n\t\t\tec.EmitInt ((int) IteratorStorey.State.After);\n\t\t\tec.Emit (OpCodes.Stfld, storey.PC.Spec);\n\n\t\t\t((AsyncTaskStorey) Storey).EmitSetException (ec, new LocalVariableReference (catch_value, Location));\n\n\t\t\tec.Emit (OpCodes.Leave, move_next_ok);\n\t\t\tec.EndExceptionBlock ();\n\n\t\t}\n\n\t\tprotected override void EmitMoveNextEpilogue (EmitContext ec)\n\t\t{\n\t\t\tvar storey = (AsyncTaskStorey) Storey;\n\t\t\tstorey.EmitSetResult (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tvar storey = (AsyncTaskStorey) Storey;\n\t\t\tstorey.EmitInitializer (ec);\n\t\t\tec.Emit (OpCodes.Ret);\n\t\t}\n\n\t\tpublic override void MarkReachable (Reachability rc)\n\t\t{\n\t\t\t//\n\t\t\t// Reachability has been done in AsyncInitializerStatement\n\t\t\t//\n\t\t}\n\t}\n\n\tclass AsyncTaskStorey : StateMachine\n\t{\n\t\tint awaiters;\n\t\tField builder;\n\t\treadonly TypeSpec return_type;\n\t\tMethodSpec set_result;\n\t\tMethodSpec set_exception;\n\t\tMethodSpec builder_factory;\n\t\tMethodSpec builder_start;\n\t\tPropertySpec task;\n\t\tint locals_captured;\n\t\tDictionary<TypeSpec, List<Field>> stack_fields;\n\t\tDictionary<TypeSpec, List<Field>> awaiter_fields;\n\n\t\tpublic AsyncTaskStorey (ParametersBlock block, IMemberContext context, AsyncInitializer initializer, TypeSpec type)\n\t\t\t: base (block, initializer.Host, context.CurrentMemberDefinition as MemberBase, context.CurrentTypeParameters, \"async\", MemberKind.Struct)\n\t\t{\n\t\t\treturn_type = type;\n\t\t\tawaiter_fields = new Dictionary<TypeSpec, List<Field>> ();\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Expression HoistedReturnValue { get; set; }\n\n\t\tpublic TypeSpec ReturnType {\n\t\t\tget {\n\t\t\t\treturn return_type;\n\t\t\t}\n\t\t}\n\n\t\tpublic PropertySpec Task {\n\t\t\tget {\n\t\t\t\treturn task;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeAttributes TypeAttr {\n\t\t\tget {\n\t\t\t\treturn base.TypeAttr & ~TypeAttributes.SequentialLayout;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic Field AddAwaiter (TypeSpec type)\n\t\t{\n\t\t\tif (mutator != null)\n\t\t\t\ttype = mutator.Mutate (type);\n\n\t\t\tList<Field> existing_fields;\n\t\t\tif (awaiter_fields.TryGetValue (type, out existing_fields)) {\n\t\t\t\tforeach (var f in existing_fields) {\n\t\t\t\t\tif (f.IsAvailableForReuse) {\n\t\t\t\t\t\tf.IsAvailableForReuse = false;\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar field = AddCompilerGeneratedField (\"$awaiter\" + awaiters++.ToString (\"X\"), new TypeExpression (type, Location), true);\n\t\t\tfield.Define ();\n\n\t\t\tif (existing_fields == null) {\n\t\t\t\texisting_fields = new List<Field> ();\n\t\t\t\tawaiter_fields.Add (type, existing_fields);\n\t\t\t}\n\n\t\t\texisting_fields.Add (field);\n\t\t\treturn field;\n\t\t}\n\n\t\tpublic Field AddCapturedLocalVariable (TypeSpec type, bool requiresUninitialized = false)\n\t\t{\n\t\t\tif (mutator != null)\n\t\t\t\ttype = mutator.Mutate (type);\n\n\t\t\tList<Field> existing_fields = null;\n\t\t\tif (stack_fields == null) {\n\t\t\t\tstack_fields = new Dictionary<TypeSpec, List<Field>> ();\n\t\t\t} else if (stack_fields.TryGetValue (type, out existing_fields) && !requiresUninitialized) {\n\t\t\t\tforeach (var f in existing_fields) {\n\t\t\t\t\tif (f.IsAvailableForReuse) {\n\t\t\t\t\t\tf.IsAvailableForReuse = false;\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar field = AddCompilerGeneratedField (\"$stack\" + locals_captured++.ToString (\"X\"), new TypeExpression (type, Location), true);\n\t\t\tfield.Define ();\n\n\t\t\tif (existing_fields == null) {\n\t\t\t\texisting_fields = new List<Field> ();\n\t\t\t\tstack_fields.Add (type, existing_fields);\n\t\t\t}\n\n\t\t\texisting_fields.Add (field);\n\n\t\t\treturn field;\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tPredefinedType builder_type;\n\t\t\tPredefinedMember<MethodSpec> bf;\n\t\t\tPredefinedMember<MethodSpec> bs;\n\t\t\tPredefinedMember<MethodSpec> sr;\n\t\t\tPredefinedMember<MethodSpec> se;\n\t\t\tPredefinedMember<MethodSpec> sm;\n\t\t\tbool has_task_return_type = false;\n\t\t\tvar pred_members = Module.PredefinedMembers;\n\n\t\t\tif (return_type.Kind == MemberKind.Void) {\n\t\t\t\tbuilder_type = Module.PredefinedTypes.AsyncVoidMethodBuilder;\n\t\t\t\tbf = pred_members.AsyncVoidMethodBuilderCreate;\n\t\t\t\tbs = pred_members.AsyncVoidMethodBuilderStart;\n\t\t\t\tsr = pred_members.AsyncVoidMethodBuilderSetResult;\n\t\t\t\tse = pred_members.AsyncVoidMethodBuilderSetException;\n\t\t\t\tsm = pred_members.AsyncVoidMethodBuilderSetStateMachine;\n\t\t\t} else if (return_type == Module.PredefinedTypes.Task.TypeSpec) {\n\t\t\t\tbuilder_type = Module.PredefinedTypes.AsyncTaskMethodBuilder;\n\t\t\t\tbf = pred_members.AsyncTaskMethodBuilderCreate;\n\t\t\t\tbs = pred_members.AsyncTaskMethodBuilderStart;\n\t\t\t\tsr = pred_members.AsyncTaskMethodBuilderSetResult;\n\t\t\t\tse = pred_members.AsyncTaskMethodBuilderSetException;\n\t\t\t\tsm = pred_members.AsyncTaskMethodBuilderSetStateMachine;\n\t\t\t\ttask = pred_members.AsyncTaskMethodBuilderTask.Get ();\n\t\t\t} else {\n\t\t\t\tbuilder_type = Module.PredefinedTypes.AsyncTaskMethodBuilderGeneric;\n\t\t\t\tbf = pred_members.AsyncTaskMethodBuilderGenericCreate;\n\t\t\t\tbs = pred_members.AsyncTaskMethodBuilderGenericStart;\n\t\t\t\tsr = pred_members.AsyncTaskMethodBuilderGenericSetResult;\n\t\t\t\tse = pred_members.AsyncTaskMethodBuilderGenericSetException;\n\t\t\t\tsm = pred_members.AsyncTaskMethodBuilderGenericSetStateMachine;\n\t\t\t\ttask = pred_members.AsyncTaskMethodBuilderGenericTask.Get ();\n\t\t\t\thas_task_return_type = true;\n\t\t\t}\n\n\t\t\tset_result = sr.Get ();\n\t\t\tset_exception = se.Get ();\n\t\t\tbuilder_factory = bf.Get ();\n\t\t\tbuilder_start = bs.Get ();\n\n\t\t\tvar istate_machine = Module.PredefinedTypes.IAsyncStateMachine;\n\t\t\tvar set_statemachine = sm.Get ();\n\n\t\t\tif (!builder_type.Define () || !istate_machine.Define () || set_result == null || builder_factory == null ||\n\t\t\t\tset_exception == null || set_statemachine == null || builder_start == null ||\n\t\t\t\t!Module.PredefinedTypes.INotifyCompletion.Define ()) {\n\t\t\t\tReport.Error (1993, Location,\n\t\t\t\t\t\"Cannot find compiler required types for asynchronous functions support. Are you targeting the wrong framework version?\");\n\t\t\t\treturn base.DoDefineMembers ();\n\t\t\t}\n\n\t\t\tvar bt = builder_type.TypeSpec;\n\n\t\t\t//\n\t\t\t// Inflate generic Task types\n\t\t\t//\n\t\t\tif (has_task_return_type) {\n\t\t\t\tvar task_return_type = return_type.TypeArguments;\n\t\t\t\tif (mutator != null)\n\t\t\t\t\ttask_return_type = mutator.Mutate (task_return_type);\n\n\t\t\t\tbt = bt.MakeGenericType (Module, task_return_type);\n\t\t\t\tset_result = MemberCache.GetMember (bt, set_result);\n\t\t\t\tset_exception = MemberCache.GetMember (bt, set_exception);\n\t\t\t\tset_statemachine = MemberCache.GetMember (bt, set_statemachine);\n\n\t\t\t\tif (task != null)\n\t\t\t\t\ttask = MemberCache.GetMember (bt, task);\n\t\t\t}\n\n\t\t\tbuilder = AddCompilerGeneratedField (\"$builder\", new TypeExpression (bt, Location));\n\n\t\t\tvar set_state_machine = new Method (this, new TypeExpression (Compiler.BuiltinTypes.Void, Location),\n\t\t\t\tModifiers.COMPILER_GENERATED | Modifiers.DEBUGGER_HIDDEN | Modifiers.PUBLIC,\n\t\t\t\tnew MemberName (\"SetStateMachine\"),\n\t\t\t\tParametersCompiled.CreateFullyResolved (\n\t\t\t\t\tnew Parameter (new TypeExpression (istate_machine.TypeSpec, Location), \"stateMachine\", Parameter.Modifier.NONE, null, Location),\n\t\t\t\t\tistate_machine.TypeSpec),\n\t\t\t\tnull);\n\n\t\t\tToplevelBlock block = new ToplevelBlock (Compiler, set_state_machine.ParameterInfo, Location);\n\t\t\tblock.IsCompilerGenerated = true;\n\t\t\tset_state_machine.Block = block;\n\n\t\t\tMembers.Add (set_state_machine);\n\n\t\t\tif (!base.DoDefineMembers ())\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// Fabricates SetStateMachine method\n\t\t\t//\n\t\t\t// public void SetStateMachine (IAsyncStateMachine stateMachine)\n\t\t\t// {\n\t\t\t//    $builder.SetStateMachine (stateMachine);\n\t\t\t// }\n\t\t\t//\n\t\t\tvar mg = MethodGroupExpr.CreatePredefined (set_statemachine, bt, Location);\n\t\t\tmg.InstanceExpression = new FieldExpr (builder, Location);\n\n\t\t\tvar param_reference = block.GetParameterReference (0, Location);\n\t\t\tparam_reference.Type = istate_machine.TypeSpec;\n\t\t\tparam_reference.eclass = ExprClass.Variable;\n\n\t\t\tvar args = new Arguments (1);\n\t\t\targs.Add (new Argument (param_reference));\n\t\t\tset_state_machine.Block.AddStatement (new StatementExpression (new Invocation (mg, args)));\n\n\t\t\tif (has_task_return_type) {\n\t\t\t\tHoistedReturnValue = TemporaryVariableReference.Create (bt.TypeArguments [0], StateMachineMethod.Block, Location);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void EmitAwaitOnCompletedDynamic (EmitContext ec, FieldExpr awaiter)\n\t\t{\n\t\t\tvar critical = Module.PredefinedTypes.ICriticalNotifyCompletion;\n\t\t\tif (!critical.Define ()) {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\n\t\t\tvar temp_critical = new LocalTemporary (critical.TypeSpec);\n\t\t\tvar label_critical = ec.DefineLabel ();\n\t\t\tvar label_end = ec.DefineLabel ();\n\n\t\t\t//\n\t\t\t// Special path for dynamic awaiters\n\t\t\t//\n\t\t\t// var awaiter = this.$awaiter as ICriticalNotifyCompletion;\n\t\t\t// if (awaiter == null) {\n\t\t\t//    var completion = (INotifyCompletion) this.$awaiter;\n\t\t\t//    this.$builder.AwaitOnCompleted (ref completion, ref this);\n\t\t\t// } else {\n\t\t\t//    this.$builder.AwaitUnsafeOnCompleted (ref awaiter, ref this);\n\t\t\t// }\n\t\t\t//\n\t\t\tawaiter.Emit (ec);\n\t\t\tec.Emit (OpCodes.Isinst, critical.TypeSpec);\n\t\t\ttemp_critical.Store (ec);\n\t\t\ttemp_critical.Emit (ec);\n\t\t\tec.Emit (OpCodes.Brtrue_S, label_critical);\n\n\t\t\tvar temp = new LocalTemporary (Module.PredefinedTypes.INotifyCompletion.TypeSpec);\n\t\t\tawaiter.Emit (ec);\n\t\t\tec.Emit (OpCodes.Castclass, temp.Type);\n\t\t\ttemp.Store (ec);\n\t\t\tEmitOnCompleted (ec, temp, false);\n\t\t\ttemp.Release (ec);\n\t\t\tec.Emit (OpCodes.Br_S, label_end);\n\n\t\t\tec.MarkLabel (label_critical);\n\n\t\t\tEmitOnCompleted (ec, temp_critical, true);\n\n\t\t\tec.MarkLabel (label_end);\n\n\t\t\ttemp_critical.Release (ec);\n\t\t}\n\n\t\tpublic void EmitAwaitOnCompleted (EmitContext ec, FieldExpr awaiter)\n\t\t{\n\t\t\tbool unsafe_version = false;\n\t\t\tif (Module.PredefinedTypes.ICriticalNotifyCompletion.Define ()) {\n\t\t\t\tunsafe_version = awaiter.Type.ImplementsInterface (Module.PredefinedTypes.ICriticalNotifyCompletion.TypeSpec, false);\n\t\t\t}\n\n\t\t\tEmitOnCompleted (ec, awaiter, unsafe_version);\n\t\t}\n\n\t\tvoid EmitOnCompleted (EmitContext ec, Expression awaiter, bool unsafeVersion)\n\t\t{\n\t\t\tvar pm = Module.PredefinedMembers;\n\t\t\tPredefinedMember<MethodSpec> predefined;\n\t\t\tbool has_task_return_type = false;\n\t\t\tif (return_type.Kind == MemberKind.Void) {\n\t\t\t\tpredefined = unsafeVersion ? pm.AsyncVoidMethodBuilderOnCompletedUnsafe : pm.AsyncVoidMethodBuilderOnCompleted;\n\t\t\t} else if (return_type == Module.PredefinedTypes.Task.TypeSpec) {\n\t\t\t\tpredefined = unsafeVersion ? pm.AsyncTaskMethodBuilderOnCompletedUnsafe : pm.AsyncTaskMethodBuilderOnCompleted;\n\t\t\t} else {\n\t\t\t\tpredefined = unsafeVersion ? pm.AsyncTaskMethodBuilderGenericOnCompletedUnsafe : pm.AsyncTaskMethodBuilderGenericOnCompleted;\n\t\t\t\thas_task_return_type = true;\n\t\t\t}\n\n\t\t\tvar on_completed = predefined.Resolve (Location);\n\t\t\tif (on_completed == null)\n\t\t\t\treturn;\n\n\t\t\tif (has_task_return_type)\n\t\t\t\ton_completed = MemberCache.GetMember<MethodSpec> (set_result.DeclaringType, on_completed);\n\n\t\t\ton_completed = on_completed.MakeGenericMethod (this, awaiter.Type, ec.CurrentType);\n\n\t\t\tvar mg = MethodGroupExpr.CreatePredefined (on_completed, on_completed.DeclaringType, Location);\n\t\t\tmg.InstanceExpression = new FieldExpr (builder, Location) {\n\t\t\t\tInstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location)\n\t\t\t};\n\n\t\t\tvar args = new Arguments (2);\n\t\t\targs.Add (new Argument (awaiter, Argument.AType.Ref));\n\t\t\targs.Add (new Argument (new CompilerGeneratedThis (CurrentType, Location), Argument.AType.Ref));\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tmg.EmitCall (ec, args, true);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitInitializer (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Some predefined types are missing\n\t\t\t//\n\t\t\tif (builder == null)\n\t\t\t\treturn;\n\n\t\t\tvar instance = (TemporaryVariableReference) Instance;\n\t\t\tvar builder_field = builder.Spec;\n\t\t\tif (MemberName.Arity > 0) {\n\t\t\t\tbuilder_field = MemberCache.GetMember (instance.Type, builder_field);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Inflated factory method when task is of generic type\n\t\t\t//\n\t\t\tif (builder_factory.DeclaringType.IsGeneric) {\n\t\t\t\tvar task_return_type = return_type.TypeArguments;\n\t\t\t\tvar bt = builder_factory.DeclaringType.MakeGenericType (Module, task_return_type);\n\t\t\t\tbuilder_factory = MemberCache.GetMember (bt, builder_factory);\n\t\t\t\tbuilder_start = MemberCache.GetMember (bt, builder_start);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// stateMachine.$builder = AsyncTaskMethodBuilder<{task-type}>.Create();\n\t\t\t//\n\t\t\tinstance.AddressOf (ec, AddressOp.Store);\n\t\t\tec.Emit (OpCodes.Call, builder_factory);\n\t\t\tec.Emit (OpCodes.Stfld, builder_field);\n\n\t\t\t//\n\t\t\t// stateMachine.$builder.Start<{storey-type}>(ref stateMachine);\n\t\t\t//\n\t\t\tinstance.AddressOf (ec, AddressOp.Store);\n\t\t\tec.Emit (OpCodes.Ldflda, builder_field);\n\t\t\tif (Task != null)\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\tinstance.AddressOf (ec, AddressOp.Store);\n\t\t\tec.Emit (OpCodes.Call, builder_start.MakeGenericMethod (Module, instance.Type));\n\n\t\t\t//\n\t\t\t// Emits return stateMachine.$builder.Task;\n\t\t\t//\n\t\t\tif (Task != null) {\n\t\t\t\tvar task_get = Task.Get;\n\n\t\t\t\tif (MemberName.Arity > 0) {\n\t\t\t\t\ttask_get = MemberCache.GetMember (builder_field.MemberType, task_get);\n\t\t\t\t}\n\n\t\t\t\tvar pe_task = new PropertyExpr (Task, Location) {\n\t\t\t\t\tInstanceExpression = EmptyExpression.Null,\t// Comes from the dup above\n\t\t\t\t\tGetter = task_get\n\t\t\t\t};\n\n\t\t\t\tpe_task.Emit (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitSetException (EmitContext ec, LocalVariableReference exceptionVariable)\n\t\t{\n\t\t\t//\n\t\t\t// $builder.SetException (Exception)\n\t\t\t//\n\t\t\tvar mg = MethodGroupExpr.CreatePredefined (set_exception, set_exception.DeclaringType, Location);\n\t\t\tmg.InstanceExpression = new FieldExpr (builder, Location) {\n\t\t\t\tInstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location)\n\t\t\t};\n\n\t\t\tArguments args = new Arguments (1);\n\t\t\targs.Add (new Argument (exceptionVariable));\n\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tmg.EmitCall (ec, args, true);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitSetResult (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// $builder.SetResult ();\n\t\t\t// $builder.SetResult<return-type> (value);\n\t\t\t//\n\t\t\tvar mg = MethodGroupExpr.CreatePredefined (set_result, set_result.DeclaringType, Location);\n\t\t\tmg.InstanceExpression = new FieldExpr (builder, Location) {\n\t\t\t\tInstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location)\n\t\t\t};\n\n\t\t\tArguments args;\n\t\t\tif (HoistedReturnValue == null) {\n\t\t\t\targs = new Arguments (0);\n\t\t\t} else {\n\t\t\t\targs = new Arguments (1);\n\t\t\t\targs.Add (new Argument (HoistedReturnValue));\n\t\t\t}\n\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tmg.EmitCall (ec, args, true);\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tbase_type = Compiler.BuiltinTypes.ValueType;\n\t\t\tbase_class = null;\n\n\t\t\tvar istate_machine = Module.PredefinedTypes.IAsyncStateMachine;\n\t\t\tif (istate_machine.Define ()) {\n\t\t\t\treturn new[] { istate_machine.TypeSpec };\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class StackFieldExpr : FieldExpr, IExpressionCleanup\n\t{\n\t\tpublic StackFieldExpr (Field field)\n\t\t\t: base (field, Location.Null)\n\t\t{\n\t\t}\n\n\t\tpublic bool IsAvailableForReuse {\n\t\t\tget {\n\t\t\t\tvar field = (Field) spec.MemberDefinition;\n\t\t\t\treturn field.IsAvailableForReuse;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tvar field = (Field) spec.MemberDefinition;\n\t\t\t\tfield.IsAvailableForReuse = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tbase.AddressOf (ec, mode);\n\n\t\t\tif (mode == AddressOp.Load) {\n\t\t\t\tIsAvailableForReuse = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\n\t\t\tPrepareCleanup (ec);\n\t\t}\n\n\t\tpublic void EmitLoad (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\t\t}\n\n\t\tpublic void PrepareCleanup (EmitContext ec)\n\t\t{\n\t\t\tIsAvailableForReuse = true;\n\n\t\t\t//\n\t\t\t// Release any captured reference type stack variables\n\t\t\t// to imitate real stack behavour and help GC stuff early\n\t\t\t//\n\t\t\tif (TypeSpec.IsReferenceType (type)) {\n\t\t\t\tec.AddStatementEpilog (this);\n\t\t\t}\n\t\t}\n\n\t\tvoid IExpressionCleanup.EmitCleanup (EmitContext ec)\n\t\t{\n\t\t\tEmitAssign (ec, new NullConstant (type, loc), false, false);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs",
    "content": "//\n// attribute.cs: Attributes handling\n//\n// Author: Ravi Pratap (ravi@ximian.com)\n//         Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011-2013 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Runtime.CompilerServices;\nusing System.Security; \nusing System.Security.Permissions;\nusing System.Text;\nusing System.IO;\n\n#if STATIC\nusing SecurityType = System.Collections.Generic.List<IKVM.Reflection.Emit.CustomAttributeBuilder>;\nusing BadImageFormat = IKVM.Reflection.BadImageFormatException;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing SecurityType = System.Collections.Generic.Dictionary<System.Security.Permissions.SecurityAction, System.Security.PermissionSet>;\nusing BadImageFormat = System.BadImageFormatException;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t/// <summary>\n\t///   Base class for objects that can have Attributes applied to them.\n\t/// </summary>\n\tpublic abstract class Attributable {\n\t\t//\n\t\t// Holds all attributes attached to this element\n\t\t//\n \t\tprotected Attributes attributes;\n\n\t\tpublic void AddAttributes (Attributes attrs, IMemberContext context)\n\t\t{\n\t\t\tif (attrs == null)\n\t\t\t\treturn;\n\t\t\n\t\t\tif (attributes == null)\n\t\t\t\tattributes = attrs;\n\t\t\telse\n\t\t\t\tattributes.AddAttributes (attrs.Attrs);\n\t\t\tattrs.AttachTo (this, context);\n\t\t}\n\n\t\tpublic Attributes OptAttributes {\n\t\t\tget {\n\t\t\t\treturn attributes;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tattributes = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Use member-specific procedure to apply attribute @a in @cb to the entity being built in @builder\n\t\t/// </summary>\n\t\tpublic abstract void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa);\n\n\t\t/// <summary>\n\t\t/// Returns one AttributeTarget for this element.\n\t\t/// </summary>\n\t\tpublic abstract AttributeTargets AttributeTargets { get; }\n\n\t\tpublic abstract bool IsClsComplianceRequired ();\n\n\t\t/// <summary>\n\t\t/// Gets list of valid attribute targets for explicit target declaration.\n\t\t/// The first array item is default target. Don't break this rule.\n\t\t/// </summary>\n\t\tpublic abstract string[] ValidAttributeTargets { get; }\n\t};\n\n\tpublic class Attribute\n\t{\n\t\tpublic readonly string ExplicitTarget;\n\t\tpublic AttributeTargets Target;\n\t\treadonly ATypeNameExpression expression;\n\n\t\tArguments pos_args, named_args;\n\n\t\tbool resolve_error;\n\t\tbool arg_resolved;\n\t\treadonly bool nameEscaped;\n\t\treadonly Location loc;\n\t\tpublic TypeSpec Type;\t\n\n\t\t//\n\t\t// An attribute can be attached to multiple targets (e.g. multiple fields)\n\t\t//\n\t\tAttributable[] targets;\n\n\t\t//\n\t\t// A member context for the attribute, it's much easier to hold it here\n\t\t// than trying to pull it during resolve\n\t\t//\n\t\tIMemberContext context;\n\n\t\tpublic static readonly AttributeUsageAttribute DefaultUsageAttribute = new AttributeUsageAttribute (AttributeTargets.All);\n\t\tpublic static readonly object[] EmptyObject = new object [0];\n\n\t\tList<KeyValuePair<MemberExpr, NamedArgument>> named_values;\n\n\t\tpublic Attribute (string target, ATypeNameExpression expr, Arguments[] args, Location loc, bool nameEscaped)\n\t\t{\n\t\t\tthis.expression = expr;\n\t\t\tif (args != null) {\n\t\t\t\tpos_args = args[0];\n\t\t\t\tnamed_args = args[1];\n\t\t\t}\n\t\t\tthis.loc = loc;\n\t\t\tExplicitTarget = target;\n\t\t\tthis.nameEscaped = nameEscaped;\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic Arguments NamedArguments {\n\t\t\tget {\n\t\t\t\treturn named_args;\n\t\t\t}\n\t\t}\n\n\t\tpublic Arguments PositionalArguments {\n\t\t\tget {\n\t\t\t\treturn pos_args;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool ResolveError {\n\t\t\tget {\n\t\t\t\treturn resolve_error;\n\t\t\t}\n\t\t}\n\n\t\tpublic ATypeNameExpression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn expression;\n\t\t\t}\n\t\t}\n\n\t\tvoid AddModuleCharSet (ResolveContext rc)\n\t\t{\n\t\t\tconst string dll_import_char_set = \"CharSet\";\n\n\t\t\t//\n\t\t\t// Only when not customized by user\n\t\t\t//\n\t\t\tif (HasField (dll_import_char_set))\n\t\t\t\treturn;\n\n\t\t\tif (!rc.Module.PredefinedTypes.CharSet.Define ()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (NamedArguments == null)\n\t\t\t\tnamed_args = new Arguments (1);\n\n\t\t\tvar value = Constant.CreateConstantFromValue (rc.Module.PredefinedTypes.CharSet.TypeSpec, rc.Module.DefaultCharSet, Location);\n\t\t\tNamedArguments.Add (new NamedArgument (dll_import_char_set, loc, value));\n\t\t}\n\n\t\tpublic Attribute Clone ()\n\t\t{\n\t\t\tAttribute a = new Attribute (ExplicitTarget, expression, null, loc, nameEscaped);\n\t\t\ta.pos_args = pos_args;\n\t\t\ta.named_args = NamedArguments;\n\t\t\treturn a;\n\t\t}\n\n\t\t//\n\t\t// When the same attribute is attached to multiple fiels\n\t\t// we use @target field as a list of targets. The attribute\n\t\t// has to be resolved only once but emitted for each target.\n\t\t//\n\t\tpublic void AttachTo (Attributable target, IMemberContext context)\n\t\t{\n\t\t\tif (this.targets == null) {\n\t\t\t\tthis.targets = new Attributable[] { target };\n\t\t\t\tthis.context = context;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// When re-attaching global attributes\n\t\t\tif (context is NamespaceContainer) {\n\t\t\t\tthis.targets[0] = target;\n\t\t\t\tthis.context = context;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Resize target array\n\t\t\tAttributable[] new_array = new Attributable [this.targets.Length + 1];\n\t\t\ttargets.CopyTo (new_array, 0);\n\t\t\tnew_array [targets.Length] = target;\n\t\t\tthis.targets = new_array;\n\n\t\t\t// No need to update context, different targets cannot have\n\t\t\t// different contexts, it's enough to remove same attributes\n\t\t\t// from secondary members.\n\n\t\t\ttarget.OptAttributes = null;\n\t\t}\n\n\t\tpublic ResolveContext CreateResolveContext ()\n\t\t{\n\t\t\treturn new ResolveContext (context, ResolveContext.Options.ConstantScope);\n\t\t}\n\n\t\tstatic void Error_InvalidNamedArgument (ResolveContext rc, NamedArgument name)\n\t\t{\n\t\t\trc.Report.Error (617, name.Location, \"`{0}' is not a valid named attribute argument. Named attribute arguments \" +\n\t\t\t\t      \"must be fields which are not readonly, static, const or read-write properties which are \" +\n\t\t\t\t      \"public and not static\",\n\t\t\t      name.Name);\n\t\t}\n\n\t\tstatic void Error_InvalidNamedArgumentType (ResolveContext rc, NamedArgument name)\n\t\t{\n\t\t\trc.Report.Error (655, name.Location,\n\t\t\t\t\"`{0}' is not a valid named attribute argument because it is not a valid attribute parameter type\",\n\t\t\t\tname.Name);\n\t\t}\n\n\t\tpublic static void Error_AttributeArgumentIsDynamic (IMemberContext context, Location loc)\n\t\t{\n\t\t\tcontext.Module.Compiler.Report.Error (1982, loc, \"An attribute argument cannot be dynamic expression\");\n\t\t}\n\t\t\n\t\tpublic void Error_MissingGuidAttribute ()\n\t\t{\n\t\t\tReport.Error (596, Location, \"The Guid attribute must be specified with the ComImport attribute\");\n\t\t}\n\n\t\tpublic void Error_MisusedExtensionAttribute ()\n\t\t{\n\t\t\tReport.Error (1112, Location, \"Do not use `{0}' directly. Use parameter modifier `this' instead\", GetSignatureForError ());\n\t\t}\n\n\t\tpublic void Error_MisusedDynamicAttribute ()\n\t\t{\n\t\t\tReport.Error (1970, loc, \"Do not use `{0}' directly. Use `dynamic' keyword instead\", GetSignatureForError ());\n\t\t}\n\n\t\tvoid Error_AttributeEmitError (string inner)\n\t\t{\n\t\t\tReport.Error (647, Location, \"Error during emitting `{0}' attribute. The reason is `{1}'\",\n\t\t\t\t      Type.GetSignatureForError (), inner);\n\t\t}\n\n\t\tpublic void Error_InvalidArgumentValue (TypeSpec attributeType)\n\t\t{\n\t\t\tReport.Error (591, Location, \"Invalid value for argument to `{0}' attribute\", attributeType.GetSignatureForError ());\n\t\t}\n\n\t\tpublic void Error_InvalidSecurityParent ()\n\t\t{\n\t\t\tReport.Error (7070, Location,\n\t\t\t\t\"Security attribute `{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations\",\n\t\t\t\tType.GetSignatureForError ());\n\t\t}\n\n\t\tAttributable Owner {\n\t\t\tget {\n\t\t\t\treturn targets [0];\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Tries to resolve the type of the attribute. Flags an error if it can't, and complain is true.\n\t\t/// </summary>\n\t\tvoid ResolveAttributeType (bool comparisonOnly)\n\t\t{\n\t\t\tvar resolve_printer = new SessionReportPrinter ();\n\t\t\tSessionReportPrinter secondary_printer = null;\n\t\t\tReportPrinter prev_recorder = Report.SetPrinter (resolve_printer);\n\n\t\t\tbool t1_is_attr = false;\n\t\t\tbool t2_is_attr = false;\n\t\t\tTypeSpec t1, t2;\n\t\t\tATypeNameExpression expanded = null;\n\n\t\t\t// TODO: Additional warnings such as CS0436 are swallowed because we don't\n\t\t\t// print on success\n\n\t\t\ttry {\n\t\t\t\tt1 = expression.ResolveAsType (context);\n\t\t\t\tresolve_printer.EndSession ();\n\n\t\t\t\tif (t1 != null && resolve_printer.ErrorsCount == 0)\n\t\t\t\t\tt1_is_attr = t1.IsAttribute;\n\n\t\t\t\tif (nameEscaped) {\n\t\t\t\t\tt2 = null;\n\t\t\t\t} else {\n\t\t\t\t\texpanded = (ATypeNameExpression) expression.Clone (null);\n\t\t\t\t\texpanded.Name += \"Attribute\";\n\n\t\t\t\t\tsecondary_printer = new SessionReportPrinter ();\n\t\t\t\t\tReport.SetPrinter (secondary_printer);\n\t\t\t\t\tt2 = expanded.ResolveAsType (context);\n\t\t\t\t\tsecondary_printer.EndSession ();\n\t\t\t\t\tif (t2 != null && secondary_printer.ErrorsCount == 0)\n\t\t\t\t\t\tt2_is_attr = t2.IsAttribute;\n\n\t\t\t\t\tsecondary_printer.EndSession ();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tcontext.Module.Compiler.Report.SetPrinter (prev_recorder);\n\t\t\t}\n\n\t\t\tif (t1_is_attr && t2_is_attr && t1 != t2) {\n\t\t\t\tif (!comparisonOnly) {\n\t\t\t\t\tReport.Error (1614, Location, \"`{0}' is ambiguous between `{1}' and `{2}'. Use either `@{0}' or `{0}Attribute'\",\n\t\t\t\t\t\tGetSignatureForError (), expression.GetSignatureForError (), expanded.GetSignatureForError ());\n\t\t\t\t\tresolve_error = true;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (t1_is_attr) {\n\t\t\t\tType = t1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (t2_is_attr) {\n\t\t\t\tType = t2;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (comparisonOnly)\n\t\t\t\treturn;\n\n\t\t\tresolve_error = true;\n\n\t\t\tif (t1 != null) {\t\n\t\t\t\tif (resolve_printer.IsEmpty) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (t1);\n\t\t\t\t\tReport.Error (616, Location, \"`{0}': is not an attribute class\", t1.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tresolve_printer.Merge (prev_recorder);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (t2 != null) {\n\t\t\t\tif (secondary_printer.IsEmpty) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (t2);\n\t\t\t\t\tReport.Error (616, Location, \"`{0}': is not an attribute class\", t2.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tsecondary_printer.Merge (prev_recorder);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve_printer.Merge (prev_recorder);\n\t\t}\n\n\t\tpublic TypeSpec ResolveTypeForComparison ()\n\t\t{\n\t\t\tif (Type == null && !resolve_error)\n\t\t\t\tResolveAttributeType (true);\n\t\t\treturn Type;\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\tif (Type != null)\n\t\t\t\treturn Type.GetSignatureForError ();\n\n\t\t\treturn expression.GetSignatureForError ();\n\t\t}\n\n\t\tpublic bool HasSecurityAttribute {\n\t\t\tget {\n\t\t\t\tPredefinedAttribute pa = context.Module.PredefinedAttributes.Security;\n\t\t\t\treturn pa.IsDefined && TypeSpec.IsBaseClass (Type, pa.TypeSpec, false);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsValidSecurityAttribute ()\n\t\t{\n\t\t\treturn HasSecurityAttribute && IsSecurityActionValid ();\n\t\t}\n\n\t\tstatic bool IsValidMethodImplOption (int value)\n\t\t{\n\t\t\t//\n\t\t\t// Allow to use AggressiveInlining on any runtime/corlib\n\t\t\t//\n\t\t\tMethodImplOptions all = (MethodImplOptions) 256;\n\t\t\tforeach (MethodImplOptions v in System.Enum.GetValues (typeof (MethodImplOptions))) {\n\t\t\t\tall |= v;\n\t\t\t}\n\n\t\t\treturn ((MethodImplOptions) value | all) == all;\n\t\t}\n\n\t\tpublic static bool IsValidArgumentType (TypeSpec t)\n\t\t{\n\t\t\tif (t.IsArray) {\n\t\t\t\tvar ac = (ArrayContainer) t;\n\t\t\t\tif (ac.Rank > 1)\n\t\t\t\t\treturn false;\n\n\t\t\t\tt = ac.Element;\n\t\t\t}\n\n\t\t\tswitch (t.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\n\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\tcase BuiltinTypeSpec.Type.Type:\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn t.IsEnum;\n\t\t}\n\n\t\t// TODO: Don't use this ambiguous value\n\t\tpublic string Name {\n\t\t\tget { return expression.Name; }\n\t\t}\n\n\t\tpublic ATypeNameExpression TypeNameExpression {\n\t\t\tget {\n\t\t\t\treturn expression;\n\t\t\t}\n\t\t}\n\n\t\tpublic Report Report {\n\t\t\tget { return context.Module.Compiler.Report; }\n\t\t}\n\n\t\tpublic MethodSpec Resolve ()\n\t\t{\n\t\t\tif (resolve_error)\n\t\t\t\treturn null;\n\n\t\t\tresolve_error = true;\n\t\t\targ_resolved = true;\n\n\t\t\tif (Type == null) {\n\t\t\t\tResolveAttributeType (false);\n\t\t\t\tif (Type == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (Type.IsAbstract) {\n\t\t\t\tReport.Error (653, Location, \"Cannot apply attribute class `{0}' because it is abstract\", GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tObsoleteAttribute obsolete_attr = Type.GetAttributeObsolete ();\n\t\t\tif (obsolete_attr != null) {\n\t\t\t\tAttributeTester.Report_ObsoleteMessage (obsolete_attr, Type.GetSignatureForError (), Location, Report);\n\t\t\t}\n\n\t\t\tResolveContext rc = null;\n\n\t\t\tMethodSpec ctor;\n\t\t\t// Try if the attribute is simple and has been resolved before\n\t\t\tif (pos_args != null || !context.Module.AttributeConstructorCache.TryGetValue (Type, out ctor)) {\n\t\t\t\trc = CreateResolveContext ();\n\t\t\t\tctor = ResolveConstructor (rc);\n\t\t\t\tif (ctor == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (pos_args == null && ctor.Parameters.IsEmpty)\n\t\t\t\t\tcontext.Module.AttributeConstructorCache.Add (Type, ctor);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Add [module: DefaultCharSet] to all DllImport import attributes\n\t\t\t//\n\t\t\tvar module = context.Module;\n\t\t\tif ((Type == module.PredefinedAttributes.DllImport || Type == module.PredefinedAttributes.UnmanagedFunctionPointer) && module.HasDefaultCharSet) {\n\t\t\t\tif (rc == null)\n\t\t\t\t\trc = CreateResolveContext ();\n\n\t\t\t\tAddModuleCharSet (rc);\n\t\t\t}\n\n\t\t\tif (NamedArguments != null) {\n\t\t\t\tif (rc == null)\n\t\t\t\t\trc = CreateResolveContext ();\n\n\t\t\t\tif (!ResolveNamedArguments (rc))\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tresolve_error = false;\n\t\t\treturn ctor;\n\t\t}\n\n\t\tMethodSpec ResolveConstructor (ResolveContext ec)\n\t\t{\n\t\t\tif (pos_args != null) {\n\t\t\t\tbool dynamic;\n\t\t\t\tpos_args.Resolve (ec, out dynamic);\n\t\t\t\tif (dynamic) {\n\t\t\t\t\tError_AttributeArgumentIsDynamic (ec.MemberContext, loc);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn Expression.ConstructorLookup (ec, Type, ref pos_args, loc);\n\t\t}\n\n\t\tbool ResolveNamedArguments (ResolveContext ec)\n\t\t{\n\t\t\tint named_arg_count = NamedArguments.Count;\n\t\t\tvar seen_names = new List<string> (named_arg_count);\n\n\t\t\tnamed_values = new List<KeyValuePair<MemberExpr, NamedArgument>> (named_arg_count);\n\t\t\t\n\t\t\tforeach (NamedArgument a in NamedArguments) {\n\t\t\t\tstring name = a.Name;\n\t\t\t\tif (seen_names.Contains (name)) {\n\t\t\t\t\tec.Report.Error (643, a.Location, \"Duplicate named attribute `{0}' argument\", name);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\t\t\n\t\n\t\t\t\tseen_names.Add (name);\n\n\t\t\t\ta.Resolve (ec);\n\n\t\t\t\tExpression member = Expression.MemberLookup (ec, false, Type, name, 0, Expression.MemberLookupRestrictions.ExactArity, loc);\n\n\t\t\t\tif (member == null) {\n\t\t\t\t\tmember = Expression.MemberLookup (ec, true, Type, name, 0, Expression.MemberLookupRestrictions.ExactArity, loc);\n\n\t\t\t\t\tif (member != null) {\n\t\t\t\t\t\t// TODO: ec.Report.SymbolRelatedToPreviousError (member);\n\t\t\t\t\t\tExpression.ErrorIsInaccesible (ec, member.GetSignatureForError (), loc);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (member == null){\n\t\t\t\t\tExpression.Error_TypeDoesNotContainDefinition (ec, Location, Type, name);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!(member is PropertyExpr || member is FieldExpr)) {\n\t\t\t\t\tError_InvalidNamedArgument (ec, a);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tObsoleteAttribute obsolete_attr;\n\n\t\t\t\tif (member is PropertyExpr) {\n\t\t\t\t\tvar pi = ((PropertyExpr) member).PropertyInfo;\n\n\t\t\t\t\tif (!pi.HasSet || !pi.HasGet || pi.IsStatic || !pi.Get.IsPublic || !pi.Set.IsPublic) {\n\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (pi);\n\t\t\t\t\t\tError_InvalidNamedArgument (ec, a);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!IsValidArgumentType (member.Type)) {\n\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (pi);\n\t\t\t\t\t\tError_InvalidNamedArgumentType (ec, a);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tobsolete_attr = pi.GetAttributeObsolete ();\n\t\t\t\t\tpi.MemberDefinition.SetIsAssigned ();\n\t\t\t\t} else {\n\t\t\t\t\tvar fi = ((FieldExpr) member).Spec;\n\n\t\t\t\t\tif (fi.IsReadOnly || fi.IsStatic || !fi.IsPublic) {\n\t\t\t\t\t\tError_InvalidNamedArgument (ec, a);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!IsValidArgumentType (member.Type)) {\n\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (fi);\n\t\t\t\t\t\tError_InvalidNamedArgumentType (ec, a);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tobsolete_attr = fi.GetAttributeObsolete ();\n\t\t\t\t\tfi.MemberDefinition.SetIsAssigned ();\n\t\t\t\t}\n\n\t\t\t\tif (obsolete_attr != null && !context.IsObsolete)\n\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (obsolete_attr, member.GetSignatureForError (), member.Location, Report);\n\n\t\t\t\tif (a.Type != member.Type) {\n\t\t\t\t\ta.Expr = Convert.ImplicitConversionRequired (ec, a.Expr, member.Type, a.Expr.Location);\n\t\t\t\t}\n\n\t\t\t\tif (a.Expr != null)\n\t\t\t\t\tnamed_values.Add (new KeyValuePair<MemberExpr, NamedArgument> ((MemberExpr) member, a));\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Get a string containing a list of valid targets for the attribute 'attr'\n\t\t/// </summary>\n\t\tpublic string GetValidTargets ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tAttributeTargets targets = Type.GetAttributeUsage (context.Module.PredefinedAttributes.AttributeUsage).ValidOn;\n\n\t\t\tif ((targets & AttributeTargets.Assembly) != 0)\n\t\t\t\tsb.Append (\"assembly, \");\n\n\t\t\tif ((targets & AttributeTargets.Module) != 0)\n\t\t\t\tsb.Append (\"module, \");\n\n\t\t\tif ((targets & AttributeTargets.Class) != 0)\n\t\t\t\tsb.Append (\"class, \");\n\n\t\t\tif ((targets & AttributeTargets.Struct) != 0)\n\t\t\t\tsb.Append (\"struct, \");\n\n\t\t\tif ((targets & AttributeTargets.Enum) != 0)\n\t\t\t\tsb.Append (\"enum, \");\n\n\t\t\tif ((targets & AttributeTargets.Constructor) != 0)\n\t\t\t\tsb.Append (\"constructor, \");\n\n\t\t\tif ((targets & AttributeTargets.Method) != 0)\n\t\t\t\tsb.Append (\"method, \");\n\n\t\t\tif ((targets & AttributeTargets.Property) != 0)\n\t\t\t\tsb.Append (\"property, indexer, \");\n\n\t\t\tif ((targets & AttributeTargets.Field) != 0)\n\t\t\t\tsb.Append (\"field, \");\n\n\t\t\tif ((targets & AttributeTargets.Event) != 0)\n\t\t\t\tsb.Append (\"event, \");\n\n\t\t\tif ((targets & AttributeTargets.Interface) != 0)\n\t\t\t\tsb.Append (\"interface, \");\n\n\t\t\tif ((targets & AttributeTargets.Parameter) != 0)\n\t\t\t\tsb.Append (\"parameter, \");\n\n\t\t\tif ((targets & AttributeTargets.Delegate) != 0)\n\t\t\t\tsb.Append (\"delegate, \");\n\n\t\t\tif ((targets & AttributeTargets.ReturnValue) != 0)\n\t\t\t\tsb.Append (\"return, \");\n\n\t\t\tif ((targets & AttributeTargets.GenericParameter) != 0)\n\t\t\t\tsb.Append (\"type parameter, \");\n\n\t\t\treturn sb.Remove (sb.Length - 2, 2).ToString ();\n\t\t}\n\n\t\tpublic AttributeUsageAttribute GetAttributeUsageAttribute ()\n\t\t{\n\t\t\tif (!arg_resolved)\n\t\t\t\t// TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.\n\t\t\t\t// But because a lot of attribute class code must be rewritten will be better to wait...\n\t\t\t\tResolve ();\n\n\t\t\tif (resolve_error)\n\t\t\t\treturn DefaultUsageAttribute;\n\n\t\t\tAttributeUsageAttribute usage_attribute = new AttributeUsageAttribute ((AttributeTargets) ((Constant) pos_args[0].Expr).GetValue ());\n\n\t\t\tvar field = GetNamedValue (\"AllowMultiple\") as BoolConstant;\n\t\t\tif (field != null)\n\t\t\t\tusage_attribute.AllowMultiple = field.Value;\n\n\t\t\tfield = GetNamedValue (\"Inherited\") as BoolConstant;\n\t\t\tif (field != null)\n\t\t\t\tusage_attribute.Inherited = field.Value;\n\n\t\t\treturn usage_attribute;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns custom name of indexer\n\t\t/// </summary>\n\t\tpublic string GetIndexerAttributeValue ()\n\t\t{\n\t\t\tif (!arg_resolved)\n\t\t\t\t// TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.\n\t\t\t\t// But because a lot of attribute class code must be rewritten will be better to wait...\n\t\t\t\tResolve ();\n\n\t\t\tif (resolve_error || pos_args.Count != 1 || !(pos_args[0].Expr is Constant))\n\t\t\t\treturn null;\n\n\t\t\treturn ((Constant) pos_args[0].Expr).GetValue () as string;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns condition of ConditionalAttribute\n\t\t/// </summary>\n\t\tpublic string GetConditionalAttributeValue ()\n\t\t{\n\t\t\tif (!arg_resolved)\n\t\t\t\t// TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.\n\t\t\t\t// But because a lot of attribute class code must be rewritten will be better to wait...\n\t\t\t\tResolve ();\n\n\t\t\tif (resolve_error)\n\t\t\t\treturn null;\n\n\t\t\treturn ((Constant) pos_args[0].Expr).GetValue () as string;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates the instance of ObsoleteAttribute from this attribute instance\n\t\t/// </summary>\n\t\tpublic ObsoleteAttribute GetObsoleteAttribute ()\n\t\t{\n\t\t\tif (!arg_resolved) {\n\t\t\t\t// corlib only case when obsolete is used before is resolved\n\t\t\t\tvar c = Type.MemberDefinition as Class;\n\t\t\t\tif (c != null && !c.HasMembersDefined)\n\t\t\t\t\tc.Define ();\n\t\t\t\t\n\t\t\t\t// TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.\n\t\t\t\t// But because a lot of attribute class code must be rewritten will be better to wait...\n\t\t\t\tResolve ();\n\t\t\t}\n\n\t\t\tif (resolve_error)\n\t\t\t\treturn null;\n\n\t\t\tif (pos_args == null)\n\t\t\t\treturn new ObsoleteAttribute ();\n\n\t\t\tstring msg = ((Constant) pos_args[0].Expr).GetValue () as string;\n\t\t\tif (pos_args.Count == 1)\n\t\t\t\treturn new ObsoleteAttribute (msg);\n\n\t\t\treturn new ObsoleteAttribute (msg, ((BoolConstant) pos_args[1].Expr).Value);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns value of CLSCompliantAttribute contructor parameter but because the method can be called\n\t\t/// before ApplyAttribute. We need to resolve the arguments.\n\t\t/// This situation occurs when class deps is differs from Emit order.  \n\t\t/// </summary>\n\t\tpublic bool GetClsCompliantAttributeValue ()\n\t\t{\n\t\t\tif (!arg_resolved)\n\t\t\t\t// TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.\n\t\t\t\t// But because a lot of attribute class code must be rewritten will be better to wait...\n\t\t\t\tResolve ();\n\n\t\t\tif (resolve_error)\n\t\t\t\treturn false;\n\n\t\t\treturn ((BoolConstant) pos_args[0].Expr).Value;\n\t\t}\n\n\t\tpublic TypeSpec GetCoClassAttributeValue ()\n\t\t{\n\t\t\tif (!arg_resolved)\n\t\t\t\tResolve ();\n\n\t\t\tif (resolve_error)\n\t\t\t\treturn null;\n\n\t\t\treturn GetArgumentType ();\n\t\t}\n\n\t\tpublic bool CheckTarget ()\n\t\t{\n\t\t\tstring[] valid_targets = Owner.ValidAttributeTargets;\n\t\t\tif (ExplicitTarget == null || ExplicitTarget == valid_targets [0]) {\n\t\t\t\tTarget = Owner.AttributeTargets;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// TODO: we can skip the first item\n\t\t\tif (Array.Exists (valid_targets, i => i == ExplicitTarget)) {\n\t\t\t\tswitch (ExplicitTarget) {\n\t\t\t\tcase \"return\": Target = AttributeTargets.ReturnValue; return true;\n\t\t\t\tcase \"param\": Target = AttributeTargets.Parameter; return true;\n\t\t\t\tcase \"field\": Target = AttributeTargets.Field; return true;\n\t\t\t\tcase \"method\": Target = AttributeTargets.Method; return true;\n\t\t\t\tcase \"property\": Target = AttributeTargets.Property; return true;\n\t\t\t\tcase \"module\": Target = AttributeTargets.Module; return true;\n\t\t\t\t}\n\t\t\t\tthrow new InternalErrorException (\"Unknown explicit target: \" + ExplicitTarget);\n\t\t\t}\n\t\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tforeach (string s in valid_targets) {\n\t\t\t\tsb.Append (s);\n\t\t\t\tsb.Append (\", \");\n\t\t\t}\n\t\t\tsb.Remove (sb.Length - 2, 2);\n\t\t\tReport.Warning (657, 1, Location,\n\t\t\t\t\"`{0}' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are `{1}'. All attributes in this section will be ignored\",\n\t\t\t\tExplicitTarget, sb.ToString ());\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Tests permitted SecurityAction for assembly or other types\n\t\t/// </summary>\n\t\tbool IsSecurityActionValid ()\n\t\t{\n\t\t\tSecurityAction action = GetSecurityActionValue ();\n\t\t\tbool for_assembly = Target == AttributeTargets.Assembly || Target == AttributeTargets.Module;\n\t\t\tvar c = (Constant)pos_args [0].Expr;\n\n\t\t\tswitch (action) {\n#pragma warning disable 618\n\t\t\tcase SecurityAction.Demand:\n\t\t\tcase SecurityAction.Assert:\n\t\t\tcase SecurityAction.Deny:\n\t\t\tcase SecurityAction.PermitOnly:\n\t\t\tcase SecurityAction.LinkDemand:\n\t\t\tcase SecurityAction.InheritanceDemand:\n\t\t\t\tif (!for_assembly)\n\t\t\t\t\treturn true;\n\t\t\t\tbreak;\n\n\t\t\tcase SecurityAction.RequestMinimum:\n\t\t\tcase SecurityAction.RequestOptional:\n\t\t\tcase SecurityAction.RequestRefuse:\n\t\t\t\tif (for_assembly)\n\t\t\t\t\treturn true;\n\t\t\t\tbreak;\n#pragma warning restore 618\n\n\t\t\tdefault:\n\t\t\t\tReport.Error (7049, c.Location, \"Security attribute `{0}' has an invalid SecurityAction value `{1}'\",\n\t\t\t\t\tType.GetSignatureForError (), c.GetValueAsLiteral());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tswitch (Target) {\n\t\t\tcase AttributeTargets.Assembly:\n\t\t\t\tReport.Error (7050, c.Location, \"SecurityAction value `{0}' is invalid for security attributes applied to an assembly\",\n\t\t\t\t\tc.GetSignatureForError ());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tReport.Error (7051, c.Location, \"SecurityAction value `{0}' is invalid for security attributes applied to a type or a method\",\n\t\t\t\t\tc.GetSignatureForError ());\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tSystem.Security.Permissions.SecurityAction GetSecurityActionValue ()\n\t\t{\n\t\t\treturn (SecurityAction) ((Constant) pos_args[0].Expr).GetValue ();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates instance of SecurityAttribute class and add result of CreatePermission method to permission table.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic void ExtractSecurityPermissionSet (MethodSpec ctor, ref SecurityType permissions)\n\t\t{\n#if STATIC\n\t\t\tobject[] values = new object[pos_args.Count];\n\t\t\tfor (int i = 0; i < values.Length; ++i)\n\t\t\t\tvalues[i] = ((Constant) pos_args[i].Expr).GetValue ();\n\n\t\t\tPropertyInfo[] prop;\n\t\t\tobject[] prop_values;\n\t\t\tif (named_values == null) {\n\t\t\t\tprop = null;\n\t\t\t\tprop_values = null;\n\t\t\t} else {\n\t\t\t\tprop = new PropertyInfo[named_values.Count];\n\t\t\t\tprop_values = new object [named_values.Count];\n\t\t\t\tfor (int i = 0; i < prop.Length; ++i) {\n\t\t\t\t\tprop [i] = ((PropertyExpr) named_values [i].Key).PropertyInfo.MetaInfo;\n\t\t\t\t\tprop_values [i] = ((Constant) named_values [i].Value.Expr).GetValue ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (permissions == null)\n\t\t\t\tpermissions = new SecurityType ();\n\n\t\t\tvar cab = new CustomAttributeBuilder ((ConstructorInfo) ctor.GetMetaInfo (), values, prop, prop_values);\n\t\t\tpermissions.Add (cab);\n#else\n\t\t\tthrow new NotSupportedException ();\n#endif\n\t\t}\n\n\t\tpublic Constant GetNamedValue (string name)\n\t\t{\n\t\t\tif (named_values == null)\n\t\t\t\treturn null;\n\n\t\t\tfor (int i = 0; i < named_values.Count; ++i) {\n\t\t\t\tif (named_values [i].Value.Name == name)\n\t\t\t\t\treturn named_values [i].Value.Expr as Constant;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic CharSet GetCharSetValue ()\n\t\t{\n\t\t\treturn (CharSet) System.Enum.Parse (typeof (CharSet), ((Constant) pos_args[0].Expr).GetValue ().ToString ());\n\t\t}\n\n\t\tpublic bool HasField (string fieldName)\n\t\t{\n\t\t\tif (named_values == null)\n\t\t\t\treturn false;\n\n\t\t\tforeach (var na in named_values) {\n\t\t\t\tif (na.Value.Name == fieldName)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\t\t// Returns true for MethodImplAttribute with MethodImplOptions.InternalCall value\n\t\t// \n\t\tpublic bool IsInternalCall ()\n\t\t{\n\t\t\treturn (GetMethodImplOptions () & MethodImplOptions.InternalCall) != 0;\n\t\t}\n\n\t\tpublic MethodImplOptions GetMethodImplOptions ()\n\t\t{\n\t\t\tMethodImplOptions options = 0;\n\t\t\tif (pos_args.Count == 1) {\n\t\t\t\toptions = (MethodImplOptions) System.Enum.Parse (typeof (MethodImplOptions), ((Constant) pos_args[0].Expr).GetValue ().ToString ());\n\t\t\t} else if (HasField (\"Value\")) {\n\t\t\t\tvar named = GetNamedValue (\"Value\");\n\t\t\t\toptions = (MethodImplOptions) System.Enum.Parse (typeof (MethodImplOptions), named.GetValue ().ToString ());\n\t\t\t}\n\n\t\t\treturn options;\n\t\t}\n\n\t\t//\n\t\t// Returns true for StructLayoutAttribute with LayoutKind.Explicit value\n\t\t// \n\t\tpublic bool IsExplicitLayoutKind ()\n\t\t{\n\t\t\tif (pos_args == null || pos_args.Count != 1)\n\t\t\t\treturn false;\n\n\t\t\tvar value = (LayoutKind) System.Enum.Parse (typeof (LayoutKind), ((Constant) pos_args[0].Expr).GetValue ().ToString ());\n\t\t\treturn value == LayoutKind.Explicit;\n\t\t}\n\n\t\tpublic Expression GetParameterDefaultValue ()\n\t\t{\n\t\t\tif (pos_args == null)\n\t\t\t\treturn null;\n\n\t\t\treturn pos_args[0].Expr;\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tAttribute a = obj as Attribute;\n\t\t\tif (a == null)\n\t\t\t\treturn false;\n\n\t\t\treturn Type == a.Type && Target == a.Target;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn Type.GetHashCode () ^ Target.GetHashCode ();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Emit attribute for Attributable symbol\n\t\t/// </summary>\n\t\tpublic void Emit (Dictionary<Attribute, List<Attribute>> allEmitted)\n\t\t{\n\t\t\tvar ctor = Resolve ();\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tvar predefined = context.Module.PredefinedAttributes;\n\n\t\t\tAttributeUsageAttribute usage_attr = Type.GetAttributeUsage (predefined.AttributeUsage);\n\t\t\tif ((usage_attr.ValidOn & Target) == 0) {\n\t\t\t\tReport.Error (592, Location, \"The attribute `{0}' is not valid on this declaration type. \" +\n\t\t\t\t\t      \"It is valid on `{1}' declarations only\",\n\t\t\t\t\tGetSignatureForError (), GetValidTargets ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbyte[] cdata;\n\t\t\tif (pos_args == null && named_values == null) {\n\t\t\t\tcdata = AttributeEncoder.Empty;\n\t\t\t} else {\n\t\t\t\tAttributeEncoder encoder = new AttributeEncoder ();\n\n\t\t\t\tif (pos_args != null) {\n\t\t\t\t\tvar param_types = ctor.Parameters.Types;\n\t\t\t\t\tfor (int j = 0; j < pos_args.Count; ++j) {\n\t\t\t\t\t\tvar pt = param_types[j];\n\t\t\t\t\t\tvar arg_expr = pos_args[j].Expr;\n\t\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\t\tif ((Type == predefined.IndexerName || Type == predefined.Conditional) && arg_expr is Constant) {\n\t\t\t\t\t\t\t\tstring v = ((Constant) arg_expr).GetValue () as string;\n\t\t\t\t\t\t\t\tif (!Tokenizer.IsValidIdentifier (v) || (Type == predefined.IndexerName && Tokenizer.IsKeyword (v))) {\n\t\t\t\t\t\t\t\t\tcontext.Module.Compiler.Report.Error (633, arg_expr.Location,\n\t\t\t\t\t\t\t\t\t\t\"The argument to the `{0}' attribute must be a valid identifier\", GetSignatureForError ());\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (Type == predefined.Guid) {\n\t\t\t\t\t\t\t\tstring v = ((StringConstant) arg_expr).Value;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tnew Guid (v);\n\t\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t\tError_InvalidArgumentValue (Type);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (Type == predefined.AttributeUsage) {\n\t\t\t\t\t\t\t\tint v = ((IntConstant) ((EnumConstant) arg_expr).Child).Value;\n\t\t\t\t\t\t\t\tif (v == 0)\n\t\t\t\t\t\t\t\t\tError_InvalidArgumentValue (Type);\n\t\t\t\t\t\t\t} else if (Type == predefined.MarshalAs) {\n\t\t\t\t\t\t\t\tif (pos_args.Count == 1) {\n\t\t\t\t\t\t\t\t\tvar u_type = (UnmanagedType) System.Enum.Parse (typeof (UnmanagedType), ((Constant) pos_args[0].Expr).GetValue ().ToString ());\n\t\t\t\t\t\t\t\t\tif (u_type == UnmanagedType.ByValArray && !(Owner is FieldBase)) {\n\t\t\t\t\t\t\t\t\t\tReport.Error (7055, pos_args [0].Expr.Location, \"Unmanaged type `ByValArray' is only valid for fields\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (Type == predefined.DllImport) {\n\t\t\t\t\t\t\t\tif (pos_args.Count == 1 && pos_args[0].Expr is Constant) {\n\t\t\t\t\t\t\t\t\tvar value = ((Constant) pos_args[0].Expr).GetValue () as string;\n\t\t\t\t\t\t\t\t\tif (string.IsNullOrEmpty (value))\n\t\t\t\t\t\t\t\t\t\tError_InvalidArgumentValue (Type);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (Type == predefined.MethodImpl) {\n\t\t\t\t\t\t\t\tif (pos_args.Count == 1) {\n\t\t\t\t\t\t\t\t\tvar value = (int) ((Constant) arg_expr).GetValueAsLong ();\n\n\t\t\t\t\t\t\t\t\tif (!IsValidMethodImplOption (value)) {\n\t\t\t\t\t\t\t\t\t\tError_InvalidArgumentValue (Type);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\targ_expr.EncodeAttributeValue (context, encoder, pt, pt);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (named_values != null) {\n\t\t\t\t\tencoder.Encode ((ushort) named_values.Count);\n\t\t\t\t\tforeach (var na in named_values) {\n\t\t\t\t\t\tif (na.Key is FieldExpr)\n\t\t\t\t\t\t\tencoder.Encode ((byte) 0x53);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tencoder.Encode ((byte) 0x54);\n\n\t\t\t\t\t\tencoder.Encode (na.Key.Type);\n\t\t\t\t\t\tencoder.Encode (na.Value.Name);\n\t\t\t\t\t\tna.Value.Expr.EncodeAttributeValue (context, encoder, na.Key.Type, na.Key.Type);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tencoder.EncodeEmptyNamedArguments ();\n\t\t\t\t}\n\n\t\t\t\tcdata = encoder.ToArray ();\n\t\t\t}\n\n\t\t\tif (!ctor.DeclaringType.IsConditionallyExcluded (context)) {\n\t\t\t\ttry {\n\t\t\t\t\tforeach (Attributable target in targets)\n\t\t\t\t\t\ttarget.ApplyAttributeBuilder (this, ctor, cdata, predefined);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tif (e is BadImageFormat && Report.Errors > 0)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tError_AttributeEmitError (e.Message);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!usage_attr.AllowMultiple && allEmitted != null) {\n\t\t\t\tif (allEmitted.ContainsKey (this)) {\n\t\t\t\t\tvar a = allEmitted [this];\n\t\t\t\t\tif (a == null) {\n\t\t\t\t\t\ta = new List<Attribute> (2);\n\t\t\t\t\t\tallEmitted [this] = a;\n\t\t\t\t\t}\n\t\t\t\t\ta.Add (this);\n\t\t\t\t} else {\n\t\t\t\t\tallEmitted.Add (this, null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!context.Module.Compiler.Settings.VerifyClsCompliance)\n\t\t\t\treturn;\n\n\t\t\t// Here we are testing attribute arguments for array usage (error 3016)\n\t\t\tif (Owner.IsClsComplianceRequired ()) {\n\t\t\t\tif (pos_args != null)\n\t\t\t\t\tpos_args.CheckArrayAsAttribute (context.Module.Compiler);\n\t\t\t\n\t\t\t\tif (NamedArguments == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tNamedArguments.CheckArrayAsAttribute (context.Module.Compiler);\n\t\t\t}\n\t\t}\n\n\t\tprivate Expression GetValue () \n\t\t{\n\t\t\tif (pos_args == null || pos_args.Count < 1)\n\t\t\t\treturn null;\n\n\t\t\treturn pos_args[0].Expr;\n\t\t}\n\n\t\tpublic string GetString () \n\t\t{\n\t\t\tExpression e = GetValue ();\n\t\t\tif (e is StringConstant)\n\t\t\t\treturn ((StringConstant)e).Value;\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic bool GetBoolean () \n\t\t{\n\t\t\tExpression e = GetValue ();\n\t\t\tif (e is BoolConstant)\n\t\t\t\treturn ((BoolConstant)e).Value;\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic TypeSpec GetArgumentType ()\n\t\t{\n\t\t\tTypeOf e = GetValue () as TypeOf;\n\t\t\tif (e == null)\n\t\t\t\treturn null;\n\t\t\treturn e.TypeArgument;\n\t\t}\n\t}\n\t\n\tpublic class Attributes\n\t{\n\t\tpublic readonly List<Attribute> Attrs;\n#if FULL_AST\n\t\tpublic readonly List<List<Attribute>> Sections = new List<List<Attribute>> ();\n#endif\n\n\t\tpublic Attributes (Attribute a)\n\t\t{\n\t\t\tAttrs = new List<Attribute> ();\n\t\t\tAttrs.Add (a);\n\t\t\t\n#if FULL_AST\n\t\t\tSections.Add (Attrs);\n#endif\n\t\t}\n\n\t\tpublic Attributes (List<Attribute> attrs)\n\t\t{\n\t\t\tAttrs = attrs ?? new List<Attribute> ();\n#if FULL_AST\n\t\t\tSections.Add (attrs);\n#endif\n\t\t}\n\n\t\tpublic void AddAttribute (Attribute attr)\n\t\t{\n\t\t\tAttrs.Add (attr);\n\t\t}\n\n\t\tpublic void AddAttributes (List<Attribute> attrs)\n\t\t{\n#if FULL_AST\n\t\t\tSections.Add (attrs);\n#else\n\t\t\tAttrs.AddRange (attrs);\n#endif\n\t\t}\n\n\t\tpublic void AttachTo (Attributable attributable, IMemberContext context)\n\t\t{\n\t\t\tforeach (Attribute a in Attrs)\n\t\t\t\ta.AttachTo (attributable, context);\n\t\t}\n\n\t\tpublic Attributes Clone ()\n\t\t{\n\t\t\tvar al = new List<Attribute> (Attrs.Count);\n\t\t\tforeach (Attribute a in Attrs)\n\t\t\t\tal.Add (a.Clone ());\n\n\t\t\treturn new Attributes (al);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks whether attribute target is valid for the current element\n\t\t/// </summary>\n\t\tpublic bool CheckTargets ()\n\t\t{\n\t\t\tfor (int i = 0; i < Attrs.Count; ++i) {\n\t\t\t\tif (!Attrs [i].CheckTarget ())\n\t\t\t\t\tAttrs.RemoveAt (i--);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void ConvertGlobalAttributes (TypeContainer member, NamespaceContainer currentNamespace, bool isGlobal)\n\t\t{\n\t\t\tvar member_explicit_targets = member.ValidAttributeTargets;\n\t\t\tfor (int i = 0; i < Attrs.Count; ++i) {\n\t\t\t\tvar attr = Attrs[0];\n\t\t\t\tif (attr.ExplicitTarget == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tint ii;\n\t\t\t\tfor (ii = 0; ii < member_explicit_targets.Length; ++ii) {\n\t\t\t\t\tif (attr.ExplicitTarget == member_explicit_targets[ii]) {\n\t\t\t\t\t\tii = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (ii < 0 || !isGlobal)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tmember.Module.AddAttribute (attr, currentNamespace);\n\t\t\t\tAttrs.RemoveAt (i);\n\t\t\t\t--i;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasResolveError()\n\t\t{\n\t\t\tforeach (var a in Attrs) {\n\t\t\t\tif (a.ResolveError)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic Attribute Search (PredefinedAttribute t)\n\t\t{\n\t\t\treturn Search (null, t);\n\t\t}\n\n\t\tpublic Attribute Search (string explicitTarget, PredefinedAttribute t)\n\t\t{\n\t\t\tforeach (Attribute a in Attrs) {\n\t\t\t\tif (explicitTarget != null && a.ExplicitTarget != explicitTarget)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (a.ResolveTypeForComparison () == t)\n\t\t\t\t\treturn a;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns all attributes of type 't'. Use it when attribute is AllowMultiple = true\n\t\t/// </summary>\n\t\tpublic Attribute[] SearchMulti (PredefinedAttribute t)\n\t\t{\n\t\t\tList<Attribute> ar = null;\n\n\t\t\tforeach (Attribute a in Attrs) {\n\t\t\t\tif (a.ResolveTypeForComparison () == t) {\n\t\t\t\t\tif (ar == null)\n\t\t\t\t\t\tar = new List<Attribute> (Attrs.Count);\n\t\t\t\t\tar.Add (a);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ar == null ? null : ar.ToArray ();\n\t\t}\n\n\t\tpublic void Emit ()\n\t\t{\n\t\t\tCheckTargets ();\n\n\t\t\tDictionary<Attribute, List<Attribute>> ld = Attrs.Count > 1 ? new Dictionary<Attribute, List<Attribute>> () : null;\n\n\t\t\tforeach (Attribute a in Attrs)\n\t\t\t\ta.Emit (ld);\n\n\t\t\tif (ld == null || ld.Count == 0)\n\t\t\t\treturn;\n\n\t\t\tforeach (var d in ld) {\n\t\t\t\tif (d.Value == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tAttribute a = d.Key;\n\n\t\t\t\tforeach (Attribute collision in d.Value)\n\t\t\t\t\ta.Report.SymbolRelatedToPreviousError (collision.Location, \"\");\n\n\t\t\t\ta.Report.Error (579, a.Location, \"The attribute `{0}' cannot be applied multiple times\",\n\t\t\t\t\ta.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Contains (PredefinedAttribute t)\n\t\t{\n\t\t\treturn Search (t) != null;\n\t\t}\n\t}\n\n\tpublic sealed class AttributeEncoder\n\t{\n\t\t[Flags]\n\t\tpublic enum EncodedTypeProperties\n\t\t{\n\t\t\tNone = 0,\n\t\t\tDynamicType = 1,\n\t\t\tTypeParameter = 1 << 1\n\t\t}\n\n\t\tpublic static readonly byte[] Empty;\n\n\t\tbyte[] buffer;\n\t\tint pos;\n\t\tconst ushort Version = 1;\n\n\t\tstatic AttributeEncoder ()\n\t\t{\n\t\t\tEmpty = new byte[4];\n\t\t\tEmpty[0] = (byte) Version;\n\t\t}\n\n\t\tpublic AttributeEncoder ()\n\t\t{\n\t\t\tbuffer = new byte[32];\n\t\t\tEncode (Version);\n\t\t}\n\n\t\tpublic void Encode (bool value)\n\t\t{\n\t\t\tEncode (value ? (byte) 1 : (byte) 0);\n\t\t}\n\n\t\tpublic void Encode (byte value)\n\t\t{\n\t\t\tif (pos == buffer.Length)\n\t\t\t\tGrow (1);\n\n\t\t\tbuffer [pos++] = value;\n\t\t}\n\n\t\tpublic void Encode (sbyte value)\n\t\t{\n\t\t\tEncode ((byte) value);\n\t\t}\n\n\t\tpublic void Encode (short value)\n\t\t{\n\t\t\tif (pos + 2 > buffer.Length)\n\t\t\t\tGrow (2);\n\n\t\t\tbuffer[pos++] = (byte) value;\n\t\t\tbuffer[pos++] = (byte) (value >> 8);\n\t\t}\n\n\t\tpublic void Encode (ushort value)\n\t\t{\n\t\t\tEncode ((short) value);\n\t\t}\n\n\t\tpublic void Encode (int value)\n\t\t{\n\t\t\tif (pos + 4 > buffer.Length)\n\t\t\t\tGrow (4);\n\n\t\t\tbuffer[pos++] = (byte) value;\n\t\t\tbuffer[pos++] = (byte) (value >> 8);\n\t\t\tbuffer[pos++] = (byte) (value >> 16);\n\t\t\tbuffer[pos++] = (byte) (value >> 24);\n\t\t}\n\n\t\tpublic void Encode (uint value)\n\t\t{\n\t\t\tEncode ((int) value);\n\t\t}\n\n\t\tpublic void Encode (long value)\n\t\t{\n\t\t\tif (pos + 8 > buffer.Length)\n\t\t\t\tGrow (8);\n\n\t\t\tbuffer[pos++] = (byte) value;\n\t\t\tbuffer[pos++] = (byte) (value >> 8);\n\t\t\tbuffer[pos++] = (byte) (value >> 16);\n\t\t\tbuffer[pos++] = (byte) (value >> 24);\n\t\t\tbuffer[pos++] = (byte) (value >> 32);\n\t\t\tbuffer[pos++] = (byte) (value >> 40);\n\t\t\tbuffer[pos++] = (byte) (value >> 48);\n\t\t\tbuffer[pos++] = (byte) (value >> 56);\n\t\t}\n\n\t\tpublic void Encode (ulong value)\n\t\t{\n\t\t\tEncode ((long) value);\n\t\t}\n\n\t\tpublic void Encode (float value)\n\t\t{\n\t\t\tEncode (SingleConverter.SingleToInt32Bits (value));\n\t\t}\n\n\t\tpublic void Encode (double value)\n\t\t{\n\t\t\tEncode (BitConverter.DoubleToInt64Bits (value));\n\t\t}\n\n\t\tpublic void Encode (string value)\n\t\t{\n\t\t\tif (value == null) {\n\t\t\t\tEncode ((byte) 0xFF);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar buf = Encoding.UTF8.GetBytes(value);\n\t\t\tWriteCompressedValue (buf.Length);\n\n\t\t\tif (pos + buf.Length > buffer.Length)\n\t\t\t\tGrow (buf.Length);\n\n\t\t\tBuffer.BlockCopy (buf, 0, buffer, pos, buf.Length);\n\t\t\tpos += buf.Length;\n\t\t}\n\n\t\tpublic EncodedTypeProperties Encode (TypeSpec type)\n\t\t{\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\tEncode ((byte) 0x02);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tEncode ((byte) 0x03);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tEncode ((byte) 0x04);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tEncode ((byte) 0x05);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tEncode ((byte) 0x06);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tEncode ((byte) 0x07);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tEncode ((byte) 0x08);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tEncode ((byte) 0x09);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tEncode ((byte) 0x0A);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tEncode ((byte) 0x0B);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tEncode ((byte) 0x0C);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tEncode ((byte) 0x0D);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\t\tEncode ((byte) 0x0E);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Type:\n\t\t\t\tEncode ((byte) 0x50);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\t\tEncode ((byte) 0x51);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t\tEncode ((byte) 0x51);\n\t\t\t\treturn EncodedTypeProperties.DynamicType;\n\t\t\tdefault:\n\t\t\t\tif (type.IsArray) {\n\t\t\t\t\tEncode ((byte) 0x1D);\n\t\t\t\t\treturn Encode (TypeManager.GetElementType (type));\n\t\t\t\t}\n\n\t\t\t\tif (type.Kind == MemberKind.Enum) {\n\t\t\t\t\tEncode ((byte) 0x55);\n\t\t\t\t\tEncodeTypeName (type);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn EncodedTypeProperties.None;\n\t\t}\n\n\t\tpublic void EncodeTypeName (TypeSpec type)\n\t\t{\n\t\t\tvar old_type = type.GetMetaInfo ();\n\t\t\tEncode (type.MemberDefinition.IsImported ? old_type.AssemblyQualifiedName : old_type.FullName);\n\t\t}\n\n\t\tpublic void EncodeTypeName (TypeContainer type)\n\t\t{\n\t\t\tEncode (type.GetSignatureForMetadata ());\n\t\t}\n\n\n\t\t//\n\t\t// Encodes single property named argument per call\n\t\t//\n\t\tpublic void EncodeNamedPropertyArgument (PropertySpec property, Constant value)\n\t\t{\n\t\t\tEncode ((ushort) 1);\t// length\n\t\t\tEncode ((byte) 0x54); // property\n\t\t\tEncode (property.MemberType);\n\t\t\tEncode (property.Name);\n\t\t\tvalue.EncodeAttributeValue (null, this, property.MemberType, property.MemberType);\n\t\t}\n\n\t\t//\n\t\t// Encodes single field named argument per call\n\t\t//\n\t\tpublic void EncodeNamedFieldArgument (FieldSpec field, Constant value)\n\t\t{\n\t\t\tEncode ((ushort) 1);\t// length\n\t\t\tEncode ((byte) 0x53); // field\n\t\t\tEncode (field.MemberType);\n\t\t\tEncode (field.Name);\n\t\t\tvalue.EncodeAttributeValue (null, this, field.MemberType, field.MemberType);\n\t\t}\n\n\t\tpublic void EncodeNamedArguments<T> (T[] members, Constant[] values) where T : MemberSpec, IInterfaceMemberSpec\n\t\t{\n\t\t\tEncode ((ushort) members.Length);\n\n\t\t\tfor (int i = 0; i < members.Length; ++i)\n\t\t\t{\n\t\t\t\tvar member = members[i];\n\n\t\t\t\tif (member.Kind == MemberKind.Field)\n\t\t\t\t\tEncode ((byte) 0x53);\n\t\t\t\telse if (member.Kind == MemberKind.Property)\n\t\t\t\t\tEncode ((byte) 0x54);\n\t\t\t\telse\n\t\t\t\t\tthrow new NotImplementedException (member.Kind.ToString ());\n\n\t\t\t\tEncode (member.MemberType);\n\t\t\t\tEncode (member.Name);\n\t\t\t\tvalues [i].EncodeAttributeValue (null, this, member.MemberType, member.MemberType);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EncodeEmptyNamedArguments ()\n\t\t{\n\t\t\tEncode ((ushort) 0);\n\t\t}\n\n\t\tvoid Grow (int inc)\n\t\t{\n\t\t\tint size = System.Math.Max (pos * 4, pos + inc + 2);\n\t\t\tArray.Resize (ref buffer, size);\n\t\t}\n\n\t\tvoid WriteCompressedValue (int value)\n\t\t{\n\t\t\tif (value < 0x80) {\n\t\t\t\tEncode ((byte) value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (value < 0x4000) {\n\t\t\t\tEncode ((byte) (0x80 | (value >> 8)));\n\t\t\t\tEncode ((byte) value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEncode (value);\n\t\t}\n\n\t\tpublic byte[] ToArray ()\n\t\t{\n\t\t\tbyte[] buf = new byte[pos];\n\t\t\tArray.Copy (buffer, buf, pos);\n\t\t\treturn buf;\n\t\t}\n\t}\n\n\n\t/// <summary>\n\t/// Helper class for attribute verification routine.\n\t/// </summary>\n\tstatic class AttributeTester\n\t{\n\t\t/// <summary>\n\t\t/// Common method for Obsolete error/warning reporting.\n\t\t/// </summary>\n\t\tpublic static void Report_ObsoleteMessage (ObsoleteAttribute oa, string member, Location loc, Report Report)\n\t\t{\n\t\t\tif (oa.IsError) {\n\t\t\t\tReport.Error (619, loc, \"`{0}' is obsolete: `{1}'\", member, oa.Message);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (oa.Message == null || oa.Message.Length == 0) {\n\t\t\t\tReport.Warning (612, 1, loc, \"`{0}' is obsolete\", member);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tReport.Warning (618, 2, loc, \"`{0}' is obsolete: `{1}'\", member, oa.Message);\n\t\t}\n\t}\n\n\t//\n\t// Predefined attribute types\n\t//\n\tpublic class PredefinedAttributes\n\t{\n\t\t// Build-in attributes\n\t\tpublic readonly PredefinedAttribute ParamArray;\n\t\tpublic readonly PredefinedAttribute Out;\n\n\t\t// Optional attributes\n\t\tpublic readonly PredefinedAttribute Obsolete;\n\t\tpublic readonly PredefinedAttribute DllImport;\n\t\tpublic readonly PredefinedAttribute MethodImpl;\n\t\tpublic readonly PredefinedAttribute MarshalAs;\n\t\tpublic readonly PredefinedAttribute In;\n\t\tpublic readonly PredefinedAttribute IndexerName;\n\t\tpublic readonly PredefinedAttribute Conditional;\n\t\tpublic readonly PredefinedAttribute CLSCompliant;\n\t\tpublic readonly PredefinedAttribute Security;\n\t\tpublic readonly PredefinedAttribute Required;\n\t\tpublic readonly PredefinedAttribute Guid;\n\t\tpublic readonly PredefinedAttribute AssemblyCulture;\n\t\tpublic readonly PredefinedAttribute AssemblyVersion;\n\t\tpublic readonly PredefinedAttribute AssemblyAlgorithmId;\n\t\tpublic readonly PredefinedAttribute AssemblyFlags;\n\t\tpublic readonly PredefinedAttribute AssemblyFileVersion;\n\t\tpublic readonly PredefinedAttribute ComImport;\n\t\tpublic readonly PredefinedAttribute CoClass;\n\t\tpublic readonly PredefinedAttribute AttributeUsage;\n\t\tpublic readonly PredefinedAttribute DefaultParameterValue;\n\t\tpublic readonly PredefinedAttribute OptionalParameter;\n\t\tpublic readonly PredefinedAttribute UnverifiableCode;\n\t\tpublic readonly PredefinedAttribute DefaultCharset;\n\t\tpublic readonly PredefinedAttribute TypeForwarder;\n\t\tpublic readonly PredefinedAttribute FixedBuffer;\n\t\tpublic readonly PredefinedAttribute CompilerGenerated;\n\t\tpublic readonly PredefinedAttribute InternalsVisibleTo;\n\t\tpublic readonly PredefinedAttribute RuntimeCompatibility;\n\t\tpublic readonly PredefinedAttribute DebuggerHidden;\n\t\tpublic readonly PredefinedAttribute UnsafeValueType;\n\t\tpublic readonly PredefinedAttribute UnmanagedFunctionPointer;\n\t\tpublic readonly PredefinedDebuggerBrowsableAttribute DebuggerBrowsable;\n\t\tpublic readonly PredefinedAttribute DebuggerStepThrough;\n\t\tpublic readonly PredefinedDebuggableAttribute Debuggable;\n\n\t\t// New in .NET 3.5\n\t\tpublic readonly PredefinedAttribute Extension;\n\n\t\t// New in .NET 4.0\n\t\tpublic readonly PredefinedDynamicAttribute Dynamic;\n\n\t\t// New in .NET 4.5\n\t\tpublic readonly PredefinedStateMachineAttribute AsyncStateMachine;\n\n\t\t//\n\t\t// Optional types which are used as types and for member lookup\n\t\t//\n\t\tpublic readonly PredefinedAttribute DefaultMember;\n\t\tpublic readonly PredefinedDecimalAttribute DecimalConstant;\n\t\tpublic readonly PredefinedAttribute StructLayout;\n\t\tpublic readonly PredefinedAttribute FieldOffset;\n\t\tpublic readonly PredefinedAttribute AssemblyProduct;\n\t\tpublic readonly PredefinedAttribute AssemblyCompany;\n\t\tpublic readonly PredefinedAttribute AssemblyDescription;\n\t\tpublic readonly PredefinedAttribute AssemblyCopyright;\n\t\tpublic readonly PredefinedAttribute AssemblyTrademark;\n\t\tpublic readonly PredefinedAttribute CallerMemberNameAttribute;\n\t\tpublic readonly PredefinedAttribute CallerLineNumberAttribute;\n\t\tpublic readonly PredefinedAttribute CallerFilePathAttribute;\n\n\t\tpublic PredefinedAttributes (ModuleContainer module)\n\t\t{\n\t\t\tParamArray = new PredefinedAttribute (module, \"System\", \"ParamArrayAttribute\");\n\t\t\tOut = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"OutAttribute\");\n\t\t\tParamArray.Resolve ();\n\t\t\tOut.Resolve ();\n\n\t\t\tObsolete = new PredefinedAttribute (module, \"System\", \"ObsoleteAttribute\");\n\t\t\tDllImport = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"DllImportAttribute\");\n\t\t\tMethodImpl = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"MethodImplAttribute\");\n\t\t\tMarshalAs = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"MarshalAsAttribute\");\n\t\t\tIn = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"InAttribute\");\n\t\t\tIndexerName = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"IndexerNameAttribute\");\n\t\t\tConditional = new PredefinedAttribute (module, \"System.Diagnostics\", \"ConditionalAttribute\");\n\t\t\tCLSCompliant = new PredefinedAttribute (module, \"System\", \"CLSCompliantAttribute\");\n\t\t\tSecurity = new PredefinedAttribute (module, \"System.Security.Permissions\", \"SecurityAttribute\");\n\t\t\tRequired = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"RequiredAttributeAttribute\");\n\t\t\tGuid = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"GuidAttribute\");\n\t\t\tAssemblyCulture = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyCultureAttribute\");\n\t\t\tAssemblyVersion = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyVersionAttribute\");\n\t\t\tAssemblyAlgorithmId = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyAlgorithmIdAttribute\");\n\t\t\tAssemblyFlags = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyFlagsAttribute\");\n\t\t\tAssemblyFileVersion = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyFileVersionAttribute\");\n\t\t\tComImport = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"ComImportAttribute\");\n\t\t\tCoClass = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"CoClassAttribute\");\n\t\t\tAttributeUsage = new PredefinedAttribute (module, \"System\", \"AttributeUsageAttribute\");\n\t\t\tDefaultParameterValue = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"DefaultParameterValueAttribute\");\n\t\t\tOptionalParameter = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"OptionalAttribute\");\n\t\t\tUnverifiableCode = new PredefinedAttribute (module, \"System.Security\", \"UnverifiableCodeAttribute\");\n\n\t\t\tDefaultCharset = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"DefaultCharSetAttribute\");\n\t\t\tTypeForwarder = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"TypeForwardedToAttribute\");\n\t\t\tFixedBuffer = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"FixedBufferAttribute\");\n\t\t\tCompilerGenerated = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"CompilerGeneratedAttribute\");\n\t\t\tInternalsVisibleTo = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"InternalsVisibleToAttribute\");\n\t\t\tRuntimeCompatibility = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"RuntimeCompatibilityAttribute\");\n\t\t\tDebuggerHidden = new PredefinedAttribute (module, \"System.Diagnostics\", \"DebuggerHiddenAttribute\");\n\t\t\tUnsafeValueType = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"UnsafeValueTypeAttribute\");\n\t\t\tUnmanagedFunctionPointer = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"UnmanagedFunctionPointerAttribute\");\n\t\t\tDebuggerBrowsable = new PredefinedDebuggerBrowsableAttribute (module, \"System.Diagnostics\", \"DebuggerBrowsableAttribute\");\n\t\t\tDebuggerStepThrough = new PredefinedAttribute (module, \"System.Diagnostics\", \"DebuggerStepThroughAttribute\");\n\t\t\tDebuggable = new PredefinedDebuggableAttribute (module, \"System.Diagnostics\", \"DebuggableAttribute\");\n\n\t\t\tExtension = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"ExtensionAttribute\");\n\n\t\t\tDynamic = new PredefinedDynamicAttribute (module, \"System.Runtime.CompilerServices\", \"DynamicAttribute\");\n\n\t\t\tDefaultMember = new PredefinedAttribute (module, \"System.Reflection\", \"DefaultMemberAttribute\");\n\t\t\tDecimalConstant = new PredefinedDecimalAttribute (module, \"System.Runtime.CompilerServices\", \"DecimalConstantAttribute\");\n\t\t\tStructLayout = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"StructLayoutAttribute\");\n\t\t\tFieldOffset = new PredefinedAttribute (module, \"System.Runtime.InteropServices\", \"FieldOffsetAttribute\");\n\t\t\tAssemblyProduct = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyProductAttribute\");\n\t\t\tAssemblyCompany = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyCompanyAttribute\");\n\t\t\tAssemblyDescription = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyDescriptionAttribute\");\n\t\t\tAssemblyCopyright = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyCopyrightAttribute\");\n\t\t\tAssemblyTrademark = new PredefinedAttribute (module, \"System.Reflection\", \"AssemblyTrademarkAttribute\");\n\n\t\t\tAsyncStateMachine = new PredefinedStateMachineAttribute (module, \"System.Runtime.CompilerServices\", \"AsyncStateMachineAttribute\");\n\n\t\t\tCallerMemberNameAttribute = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"CallerMemberNameAttribute\");\n\t\t\tCallerLineNumberAttribute = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"CallerLineNumberAttribute\");\n\t\t\tCallerFilePathAttribute = new PredefinedAttribute (module, \"System.Runtime.CompilerServices\", \"CallerFilePathAttribute\");\n\n\t\t\t// TODO: Should define only attributes which are used for comparison\n\t\t\tconst System.Reflection.BindingFlags all_fields = System.Reflection.BindingFlags.Public |\n\t\t\t\tSystem.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.DeclaredOnly;\n\n\t\t\tforeach (var fi in GetType ().GetFields (all_fields)) {\n\t\t\t\t((PredefinedAttribute) fi.GetValue (this)).Define ();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class PredefinedAttribute : PredefinedType\n\t{\n\t\tprotected MethodSpec ctor;\n\n\t\tpublic PredefinedAttribute (ModuleContainer module, string ns, string name)\n\t\t\t: base (module, MemberKind.Class, ns, name)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic MethodSpec Constructor {\n\t\t\tget {\n\t\t\t\treturn ctor;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic static bool operator == (TypeSpec type, PredefinedAttribute pa)\n\t\t{\n\t\t\treturn type == pa.type && pa.type != null;\n\t\t}\n\n\t\tpublic static bool operator != (TypeSpec type, PredefinedAttribute pa)\n\t\t{\n\t\t\treturn type != pa.type;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn base.GetHashCode ();\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic void EmitAttribute (ConstructorBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tpublic void EmitAttribute (MethodBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tpublic void EmitAttribute (PropertyBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tpublic void EmitAttribute (FieldBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tpublic void EmitAttribute (TypeBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tpublic void EmitAttribute (AssemblyBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tpublic void EmitAttribute (ModuleBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tpublic void EmitAttribute (ParameterBuilder builder)\n\t\t{\n\t\t\tif (ResolveBuilder ())\n\t\t\t\tbuilder.SetCustomAttribute (GetCtorMetaInfo (), AttributeEncoder.Empty);\n\t\t}\n\n\t\tConstructorInfo GetCtorMetaInfo ()\n\t\t{\n\t\t\treturn (ConstructorInfo) ctor.GetMetaInfo ();\n\t\t}\n\n\t\tpublic bool ResolveBuilder ()\n\t\t{\n\t\t\tif (ctor != null)\n\t\t\t\treturn true;\n\n\t\t\t//\n\t\t\t// Handle all parameter-less attributes as optional\n\t\t\t//\n\t\t\tif (!Define ())\n\t\t\t\treturn false;\n\n\t\t\tctor = (MethodSpec) MemberCache.FindMember (type, MemberFilter.Constructor (ParametersCompiled.EmptyReadOnlyParameters), BindingRestriction.DeclaredOnly);\n\t\t\treturn ctor != null;\n\t\t}\n\t}\n\n\tpublic class PredefinedDebuggerBrowsableAttribute : PredefinedAttribute\n\t{\n\t\tpublic PredefinedDebuggerBrowsableAttribute (ModuleContainer module, string ns, string name)\n\t\t\t: base (module, ns, name)\n\t\t{\n\t\t}\n\n\t\tpublic void EmitAttribute (FieldBuilder builder, System.Diagnostics.DebuggerBrowsableState state)\n\t\t{\n\t\t\tvar ctor = module.PredefinedMembers.DebuggerBrowsableAttributeCtor.Get ();\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tAttributeEncoder encoder = new AttributeEncoder ();\n\t\t\tencoder.Encode ((int) state);\n\t\t\tencoder.EncodeEmptyNamedArguments ();\n\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\t\t}\n\t}\n\n\tpublic class PredefinedDebuggableAttribute : PredefinedAttribute\n\t{\n\t\tpublic PredefinedDebuggableAttribute (ModuleContainer module, string ns, string name)\n\t\t\t: base (module, ns, name)\n\t\t{\n\t\t}\n\n\t\tpublic void EmitAttribute (AssemblyBuilder builder, System.Diagnostics.DebuggableAttribute.DebuggingModes modes)\n\t\t{\n\t\t\tvar atype = module.PredefinedAttributes.Debuggable;\n\t\t\tif (!atype.Define ())\n\t\t\t\treturn;\n\n\t\t\tMethodSpec ctor = null;\n\t\t\tforeach (MethodSpec m in MemberCache.FindMembers (atype.TypeSpec, CSharp.Constructor.ConstructorName, true)) {\n\t\t\t\tif (m.Parameters.Count != 1)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (m.Parameters.Types[0].Kind == MemberKind.Enum) {\n\t\t\t\t\tctor = m;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tAttributeEncoder encoder = new AttributeEncoder ();\n\t\t\tencoder.Encode ((int) modes);\n\t\t\tencoder.EncodeEmptyNamedArguments ();\n\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\t\t}\n\t}\n\n\tpublic class PredefinedDecimalAttribute : PredefinedAttribute\n\t{\n\t\tpublic PredefinedDecimalAttribute (ModuleContainer module, string ns, string name)\n\t\t\t: base (module, ns, name)\n\t\t{\n\t\t}\n\n\t\tpublic void EmitAttribute (ParameterBuilder builder, decimal value, Location loc)\n\t\t{\n\t\t\tvar ctor = module.PredefinedMembers.DecimalConstantAttributeCtor.Resolve (loc);\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tint[] bits = decimal.GetBits (value);\n\t\t\tAttributeEncoder encoder = new AttributeEncoder ();\n\t\t\tencoder.Encode ((byte) (bits[3] >> 16));\n\t\t\tencoder.Encode ((byte) (bits[3] >> 31));\n\t\t\tencoder.Encode ((uint) bits[2]);\n\t\t\tencoder.Encode ((uint) bits[1]);\n\t\t\tencoder.Encode ((uint) bits[0]);\n\t\t\tencoder.EncodeEmptyNamedArguments ();\n\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\t\t}\n\n\t\tpublic void EmitAttribute (FieldBuilder builder, decimal value, Location loc)\n\t\t{\n\t\t\tvar ctor = module.PredefinedMembers.DecimalConstantAttributeCtor.Resolve (loc);\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tint[] bits = decimal.GetBits (value);\n\t\t\tAttributeEncoder encoder = new AttributeEncoder ();\n\t\t\tencoder.Encode ((byte) (bits[3] >> 16));\n\t\t\tencoder.Encode ((byte) (bits[3] >> 31));\n\t\t\tencoder.Encode ((uint) bits[2]);\n\t\t\tencoder.Encode ((uint) bits[1]);\n\t\t\tencoder.Encode ((uint) bits[0]);\n\t\t\tencoder.EncodeEmptyNamedArguments ();\n\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\t\t}\n\t}\n\n\tpublic class PredefinedStateMachineAttribute : PredefinedAttribute\n\t{\n\t\tpublic PredefinedStateMachineAttribute (ModuleContainer module, string ns, string name)\n\t\t\t: base (module, ns, name)\n\t\t{\n\t\t}\n\n\t\tpublic void EmitAttribute (MethodBuilder builder, StateMachine type)\n\t\t{\n\t\t\tvar predefined_ctor = module.PredefinedMembers.AsyncStateMachineAttributeCtor;\n\n\t\t\tvar ctor = predefined_ctor.Get ();\n\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tAttributeEncoder encoder = new AttributeEncoder ();\n\t\t\tencoder.EncodeTypeName (type);\n\t\t\tencoder.EncodeEmptyNamedArguments ();\n\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\t\t}\n\t}\n\n\tpublic class PredefinedDynamicAttribute : PredefinedAttribute\n\t{\n\t\tMethodSpec tctor;\n\n\t\tpublic PredefinedDynamicAttribute (ModuleContainer module, string ns, string name)\n\t\t\t: base (module, ns, name)\n\t\t{\n\t\t}\n\n\t\tpublic void EmitAttribute (FieldBuilder builder, TypeSpec type, Location loc)\n\t\t{\n\t\t\tif (ResolveTransformationCtor (loc)) {\n\t\t\t\tvar cab = new CustomAttributeBuilder ((ConstructorInfo) tctor.GetMetaInfo (), new object[] { GetTransformationFlags (type) });\n\t\t\t\tbuilder.SetCustomAttribute (cab);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitAttribute (ParameterBuilder builder, TypeSpec type, Location loc)\n\t\t{\n\t\t\tif (ResolveTransformationCtor (loc)) {\n\t\t\t\tvar cab = new CustomAttributeBuilder ((ConstructorInfo) tctor.GetMetaInfo (), new object[] { GetTransformationFlags (type) });\n\t\t\t\tbuilder.SetCustomAttribute (cab);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitAttribute (PropertyBuilder builder, TypeSpec type, Location loc)\n\t\t{\n\t\t\tif (ResolveTransformationCtor (loc)) {\n\t\t\t\tvar cab = new CustomAttributeBuilder ((ConstructorInfo) tctor.GetMetaInfo (), new object[] { GetTransformationFlags (type) });\n\t\t\t\tbuilder.SetCustomAttribute (cab);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitAttribute (TypeBuilder builder, TypeSpec type, Location loc)\n\t\t{\n\t\t\tif (ResolveTransformationCtor (loc)) {\n\t\t\t\tvar cab = new CustomAttributeBuilder ((ConstructorInfo) tctor.GetMetaInfo (), new object[] { GetTransformationFlags (type) });\n\t\t\t\tbuilder.SetCustomAttribute (cab);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// When any element of the type is a dynamic type\n\t\t//\n\t\t// This method builds a transformation array for dynamic types\n\t\t// used in places where DynamicAttribute cannot be applied to.\n\t\t// It uses bool flag when type is of dynamic type and each\n\t\t// section always starts with \"false\" for some reason.\n\t\t//\n\t\t// LAMESPEC: This should be part of C# specification\n\t\t// \n\t\t// Example: Func<dynamic, int, dynamic[]>\n\t\t// Transformation: { false, true, false, false, true }\n\t\t//\n\t\tstatic bool[] GetTransformationFlags (TypeSpec t)\n\t\t{\n\t\t\tbool[] element;\n\t\t\tvar ac = t as ArrayContainer;\n\t\t\tif (ac != null) {\n\t\t\t\telement = GetTransformationFlags (ac.Element);\n\t\t\t\tif (element == null)\n\t\t\t\t\treturn new bool[] { false, false };\n\n\t\t\t\tbool[] res = new bool[element.Length + 1];\n\t\t\t\tres[0] = false;\n\t\t\t\tArray.Copy (element, 0, res, 1, element.Length);\n\t\t\t\treturn res;\n\t\t\t}\n\n\t\t\tif (t == null)\n\t\t\t\treturn null;\n\n\t\t\tif (t.IsGeneric) {\n\t\t\t\tList<bool> transform = null;\n\t\t\t\tvar targs = t.TypeArguments;\n\t\t\t\tfor (int i = 0; i < targs.Length; ++i) {\n\t\t\t\t\telement = GetTransformationFlags (targs[i]);\n\t\t\t\t\tif (element != null) {\n\t\t\t\t\t\tif (transform == null) {\n\t\t\t\t\t\t\ttransform = new List<bool> ();\n\t\t\t\t\t\t\tfor (int ii = 0; ii <= i; ++ii)\n\t\t\t\t\t\t\t\ttransform.Add (false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttransform.AddRange (element);\n\t\t\t\t\t} else if (transform != null) {\n\t\t\t\t\t\ttransform.Add (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (transform != null)\n\t\t\t\t\treturn transform.ToArray ();\n\t\t\t}\n\n\t\t\tif (t.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\treturn new bool[] { true };\n\n\t\t\treturn null;\n\t\t}\n\n\t\tbool ResolveTransformationCtor (Location loc)\n\t\t{\n\t\t\tif (tctor != null)\n\t\t\t\treturn true;\n\n\t\t\ttctor = module.PredefinedMembers.DynamicAttributeCtor.Resolve (loc);\n\t\t\treturn tctor != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cfold.cs",
    "content": "//\n// cfold.cs: Constant Folding\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@seznam.cz)\n//\n// Copyright 2002, 2003 Ximian, Inc.\n// Copyright 2003-2011, Novell, Inc.\n// \nusing System;\n\nnamespace Mono.CSharp {\n\n\tpublic static class ConstantFold\n\t{\n\t\tpublic static TypeSpec[] CreateBinaryPromotionsTypes (BuiltinTypes types)\n\t\t{\n\t\t\treturn new TypeSpec[] { \n\t\t\t\ttypes.Decimal, types.Double, types.Float,\n\t\t\t\ttypes.ULong, types.Long, types.UInt\n\t\t\t};\n\t\t}\n\n\t\t//\n\t\t// Performs the numeric promotions on the left and right expresions\n\t\t// and deposits the results on `lc' and `rc'.\n\t\t//\n\t\t// On success, the types of `lc' and `rc' on output will always match,\n\t\t// and the pair will be one of:\n\t\t//\n\t\t// TODO: BinaryFold should be called as an optimization step only,\n\t\t// error checking here is weak\n\t\t//\t\t\n\t\tstatic bool DoBinaryNumericPromotions (ResolveContext rc, ref Constant left, ref Constant right)\n\t\t{\n\t\t\tTypeSpec ltype = left.Type;\n\t\t\tTypeSpec rtype = right.Type;\n\n\t\t\tforeach (TypeSpec t in rc.BuiltinTypes.BinaryPromotionsTypes) {\n\t\t\t\tif (t == ltype)\n\t\t\t\t\treturn t == rtype || ConvertPromotion (rc, ref right, ref left, t);\n\n\t\t\t\tif (t == rtype)\n\t\t\t\t\treturn t == ltype || ConvertPromotion (rc, ref left, ref right, t);\n\t\t\t}\n\n\t\t\tleft = left.ConvertImplicitly (rc.BuiltinTypes.Int);\n\t\t\tright = right.ConvertImplicitly (rc.BuiltinTypes.Int);\n\t\t\treturn left != null && right != null;\n\t\t}\n\n\t\tstatic bool ConvertPromotion (ResolveContext rc, ref Constant prim, ref Constant second, TypeSpec type)\n\t\t{\n\t\t\tConstant c = prim.ConvertImplicitly (type);\n\t\t\tif (c != null) {\n\t\t\t\tprim = c;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (type.BuiltinType == BuiltinTypeSpec.Type.UInt) {\n\t\t\t\ttype = rc.BuiltinTypes.Long;\n\t\t\t\tprim = prim.ConvertImplicitly (type);\n\t\t\t\tsecond = second.ConvertImplicitly (type);\n\t\t\t\treturn prim != null && second != null;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tinternal static void Error_CompileTimeOverflow (ResolveContext rc, Location loc)\n\t\t{\n\t\t\trc.Report.Error (220, loc, \"The operation overflows at compile time in checked mode\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///   Constant expression folder for binary operations.\n\t\t///\n\t\t///   Returns null if the expression can not be folded.\n\t\t/// </summary>\n\t\tstatic public Constant BinaryFold (ResolveContext ec, Binary.Operator oper,\n\t\t\t\t\t\t     Constant left, Constant right, Location loc)\n\t\t{\n\t\t\tConstant result = null;\n\n\t\t\tif (left is EmptyConstantCast)\n\t\t\t\treturn BinaryFold (ec, oper, ((EmptyConstantCast)left).child, right, loc);\n\n\t\t\tif (left is SideEffectConstant) {\n\t\t\t\tresult = BinaryFold (ec, oper, ((SideEffectConstant) left).value, right, loc);\n\t\t\t\tif (result == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn new SideEffectConstant (result, left, loc);\n\t\t\t}\n\n\t\t\tif (right is EmptyConstantCast)\n\t\t\t\treturn BinaryFold (ec, oper, left, ((EmptyConstantCast)right).child, loc);\n\n\t\t\tif (right is SideEffectConstant) {\n\t\t\t\tresult = BinaryFold (ec, oper, left, ((SideEffectConstant) right).value, loc);\n\t\t\t\tif (result == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn new SideEffectConstant (result, right, loc);\n\t\t\t}\n\n\t\t\tTypeSpec lt = left.Type;\n\t\t\tTypeSpec rt = right.Type;\n\t\t\tbool bool_res;\n\n\t\t\tif (lt.BuiltinType == BuiltinTypeSpec.Type.Bool && lt == rt) {\n\t\t\t\tbool lv = (bool) left.GetValue ();\n\t\t\t\tbool rv = (bool) right.GetValue ();\t\t\t\n\t\t\t\tswitch (oper) {\n\t\t\t\tcase Binary.Operator.BitwiseAnd:\n\t\t\t\tcase Binary.Operator.LogicalAnd:\n\t\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, lv && rv, left.Location);\n\t\t\t\tcase Binary.Operator.BitwiseOr:\n\t\t\t\tcase Binary.Operator.LogicalOr:\n\t\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, lv || rv, left.Location);\n\t\t\t\tcase Binary.Operator.ExclusiveOr:\n\t\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, lv ^ rv, left.Location);\n\t\t\t\tcase Binary.Operator.Equality:\n\t\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, lv == rv, left.Location);\n\t\t\t\tcase Binary.Operator.Inequality:\n\t\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, lv != rv, left.Location);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// During an enum evaluation, none of the rules are valid\n\t\t\t// Not sure whether it is bug in csc or in documentation\n\t\t\t//\n\t\t\tif (ec.HasSet (ResolveContext.Options.EnumScope)){\n\t\t\t\tif (left is EnumConstant)\n\t\t\t\t\tleft = ((EnumConstant) left).Child;\n\t\t\t\t\n\t\t\t\tif (right is EnumConstant)\n\t\t\t\t\tright = ((EnumConstant) right).Child;\n\t\t\t} else if (left is EnumConstant && rt == lt) {\n\t\t\t\tswitch (oper){\n\t\t\t\t\t///\n\t\t\t\t\t/// E operator |(E x, E y);\n\t\t\t\t\t/// E operator &(E x, E y);\n\t\t\t\t\t/// E operator ^(E x, E y);\n\t\t\t\t\t/// \n\t\t\t\t\tcase Binary.Operator.BitwiseOr:\n\t\t\t\t\tcase Binary.Operator.BitwiseAnd:\n\t\t\t\t\tcase Binary.Operator.ExclusiveOr:\n\t\t\t\t\t\tresult = BinaryFold (ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc);\n\t\t\t\t\t\tif (result != null)\n\t\t\t\t\t\t\tresult = result.Reduce (ec, lt);\n\t\t\t\t\t\treturn result;\n\n\t\t\t\t\t///\n\t\t\t\t\t/// U operator -(E x, E y);\n\t\t\t\t\t/// \n\t\t\t\t\tcase Binary.Operator.Subtraction:\n\t\t\t\t\t\tresult = BinaryFold (ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc);\n\t\t\t\t\t\tif (result != null)\n\t\t\t\t\t\t\tresult = result.Reduce (ec, EnumSpec.GetUnderlyingType (lt));\n\t\t\t\t\t\treturn result;\n\n\t\t\t\t\t///\n\t\t\t\t\t/// bool operator ==(E x, E y);\n\t\t\t\t\t/// bool operator !=(E x, E y);\n\t\t\t\t\t/// bool operator <(E x, E y);\n\t\t\t\t\t/// bool operator >(E x, E y);\n\t\t\t\t\t/// bool operator <=(E x, E y);\n\t\t\t\t\t/// bool operator >=(E x, E y);\n\t\t\t\t\t/// \n\t\t\t\t\tcase Binary.Operator.Equality:\t\t\t\t\n\t\t\t\t\tcase Binary.Operator.Inequality:\n\t\t\t\t\tcase Binary.Operator.LessThan:\t\t\t\t\n\t\t\t\t\tcase Binary.Operator.GreaterThan:\n\t\t\t\t\tcase Binary.Operator.LessThanOrEqual:\t\t\t\t\n\t\t\t\t\tcase Binary.Operator.GreaterThanOrEqual:\n\t\t\t\t\t\treturn BinaryFold(ec, oper, ((EnumConstant)left).Child, ((EnumConstant)right).Child, loc);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tswitch (oper){\n\t\t\tcase Binary.Operator.BitwiseOr:\n\t\t\t\t//\n\t\t\t\t// bool? operator |(bool? x, bool? y);\n\t\t\t\t//\n\t\t\t\tif ((lt.BuiltinType == BuiltinTypeSpec.Type.Bool && right is NullLiteral) ||\n\t\t\t\t\t(rt.BuiltinType == BuiltinTypeSpec.Type.Bool && left is NullLiteral)) {\n\t\t\t\t\tvar b = new Binary (oper, left, right).ResolveOperator (ec);\n\n\t\t\t\t\t// false | null => null\n\t\t\t\t\t// null | false => null\n\t\t\t\t\tif ((right is NullLiteral && left.IsDefaultValue) || (left is NullLiteral && right.IsDefaultValue))\n\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (ec, b);\n\n\t\t\t\t\t// true | null => true\n\t\t\t\t\t// null | true => true\n\t\t\t\t\treturn ReducedExpression.Create (new BoolConstant (ec.BuiltinTypes, true, loc), b);\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (left is IntConstant){\n\t\t\t\t\tint res = ((IntConstant) left).Value | ((IntConstant) right).Value;\n\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is UIntConstant){\n\t\t\t\t\tuint res = ((UIntConstant)left).Value | ((UIntConstant)right).Value;\n\n\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is LongConstant){\n\t\t\t\t\tlong res = ((LongConstant)left).Value | ((LongConstant)right).Value;\n\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is ULongConstant){\n\t\t\t\t\tulong res = ((ULongConstant)left).Value |\n\t\t\t\t\t\t((ULongConstant)right).Value;\n\n\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Binary.Operator.BitwiseAnd:\n\t\t\t\t//\n\t\t\t\t// bool? operator &(bool? x, bool? y);\n\t\t\t\t//\n\t\t\t\tif ((lt.BuiltinType == BuiltinTypeSpec.Type.Bool && right is NullLiteral) ||\n\t\t\t\t\t(rt.BuiltinType == BuiltinTypeSpec.Type.Bool && left is NullLiteral)) {\n\t\t\t\t\tvar b = new Binary (oper, left, right).ResolveOperator (ec);\n\n\t\t\t\t\t// false & null => false\n\t\t\t\t\t// null & false => false\n\t\t\t\t\tif ((right is NullLiteral && left.IsDefaultValue) || (left is NullLiteral && right.IsDefaultValue))\n\t\t\t\t\t\treturn ReducedExpression.Create (new BoolConstant (ec.BuiltinTypes, false, loc), b);\n\n\t\t\t\t\t// true & null => null\n\t\t\t\t\t// null & true => null\n\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (ec, b);\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t\t///\n\t\t\t\t/// int operator &(int x, int y);\n\t\t\t\t/// uint operator &(uint x, uint y);\n\t\t\t\t/// long operator &(long x, long y);\n\t\t\t\t/// ulong operator &(ulong x, ulong y);\n\t\t\t\t///\n\t\t\t\tif (left is IntConstant){\n\t\t\t\t\tint res = ((IntConstant) left).Value & ((IntConstant) right).Value;\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is UIntConstant){\n\t\t\t\t\tuint res = ((UIntConstant)left).Value & ((UIntConstant)right).Value;\n\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is LongConstant){\n\t\t\t\t\tlong res = ((LongConstant)left).Value & ((LongConstant)right).Value;\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is ULongConstant){\n\t\t\t\t\tulong res = ((ULongConstant)left).Value &\n\t\t\t\t\t\t((ULongConstant)right).Value;\n\n\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase Binary.Operator.ExclusiveOr:\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t\tif (left is IntConstant){\n\t\t\t\t\tint res = ((IntConstant) left).Value ^ ((IntConstant) right).Value;\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is UIntConstant){\n\t\t\t\t\tuint res = ((UIntConstant)left).Value ^ ((UIntConstant)right).Value;\n\n\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is LongConstant){\n\t\t\t\t\tlong res = ((LongConstant)left).Value ^ ((LongConstant)right).Value;\n\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tif (left is ULongConstant){\n\t\t\t\t\tulong res = ((ULongConstant)left).Value ^\n\t\t\t\t\t\t((ULongConstant)right).Value;\n\n\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase Binary.Operator.Addition:\n\t\t\t\t//\n\t\t\t\t// If both sides are strings, then concatenate\n\t\t\t\t//\n\t\t\t\t// string operator + (string x, string y)\n\t\t\t\t//\n\t\t\t\tif (lt.BuiltinType == BuiltinTypeSpec.Type.String || rt.BuiltinType == BuiltinTypeSpec.Type.String){\n\t\t\t\t\tif (lt == rt)\n\t\t\t\t\t\treturn new StringConstant (ec.BuiltinTypes, (string)left.GetValue () + (string)right.GetValue (),\n\t\t\t\t\t\t\tleft.Location);\n\n\t\t\t\t\tif (lt == InternalType.NullLiteral || left.IsNull)\n\t\t\t\t\t\treturn new StringConstant (ec.BuiltinTypes, \"\" + right.GetValue (), left.Location);\n\n\t\t\t\t\tif (rt == InternalType.NullLiteral || right.IsNull)\n\t\t\t\t\t\treturn new StringConstant (ec.BuiltinTypes, left.GetValue () + \"\", left.Location);\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// string operator + (string x, object y)\n\t\t\t\t//\n\t\t\t\tif (lt == InternalType.NullLiteral) {\n\t\t\t\t\tif (rt.BuiltinType == BuiltinTypeSpec.Type.Object)\n\t\t\t\t\t\treturn new StringConstant (ec.BuiltinTypes, \"\" + right.GetValue (), left.Location);\n\n\t\t\t\t\tif (lt == rt) {\n\t\t\t\t\t\tec.Report.Error (34, loc, \"Operator `{0}' is ambiguous on operands of type `{1}' and `{2}'\",\n\t\t\t\t\t\t\t\"+\", lt.GetSignatureForError (), rt.GetSignatureForError ());\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn right;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// string operator + (object x, string y)\n\t\t\t\t//\n\t\t\t\tif (rt == InternalType.NullLiteral) {\n\t\t\t\t\tif (lt.BuiltinType == BuiltinTypeSpec.Type.Object)\n\t\t\t\t\t\treturn new StringConstant (ec.BuiltinTypes, right.GetValue () + \"\", left.Location);\n\t\n\t\t\t\t\treturn left;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// handle \"E operator + (E x, U y)\"\n\t\t\t\t// handle \"E operator + (Y y, E x)\"\n\t\t\t\t//\n\t\t\t\tEnumConstant lc = left as EnumConstant;\n\t\t\t\tEnumConstant rc = right as EnumConstant;\n\t\t\t\tif (lc != null || rc != null){\n\t\t\t\t\tif (lc == null) {\n\t\t\t\t\t\tlc = rc;\n\t\t\t\t\t\tlt = lc.Type;\n\t\t\t\t\t\tright = left;\n\t\t\t\t\t}\n\n\t\t\t\t\t// U has to be implicitly convetible to E.base\n\t\t\t\t\tright = right.ConvertImplicitly (lc.Child.Type);\n\t\t\t\t\tif (right == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tresult = BinaryFold (ec, oper, lc.Child, right, loc);\n\t\t\t\t\tif (result == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tresult = result.Reduce (ec, lt);\n\t\t\t\t\tif (result == null || lt.IsEnum)\n\t\t\t\t\t\treturn result;\n\n\t\t\t\t\treturn new EnumConstant (result, lt);\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\ttry {\n\t\t\t\t\tif (left is DoubleConstant){\n\t\t\t\t\t\tdouble res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DoubleConstant) left).Value +\n\t\t\t\t\t\t\t\t       ((DoubleConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DoubleConstant) left).Value +\n\t\t\t\t\t\t\t\t\t ((DoubleConstant) right).Value);\n\n\t\t\t\t\t\treturn new DoubleConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t}\n\t\t\t\t\tif (left is FloatConstant){\n\t\t\t\t\t\tdouble a, b, res;\n\t\t\t\t\t\ta = ((FloatConstant) left).DoubleValue;\n\t\t\t\t\t\tb = ((FloatConstant) right).DoubleValue;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (a + b);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (a + b);\n\n\t\t\t\t\t\tresult = new FloatConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is ULongConstant){\n\t\t\t\t\t\tulong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((ULongConstant) left).Value +\n\t\t\t\t\t\t\t\t       ((ULongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((ULongConstant) left).Value +\n\t\t\t\t\t\t\t\t\t ((ULongConstant) right).Value);\n\n\t\t\t\t\t\tresult = new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is LongConstant){\n\t\t\t\t\t\tlong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((LongConstant) left).Value +\n\t\t\t\t\t\t\t\t       ((LongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((LongConstant) left).Value +\n\t\t\t\t\t\t\t\t\t ((LongConstant) right).Value);\n\n\t\t\t\t\t\tresult = new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is UIntConstant){\n\t\t\t\t\t\tuint res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((UIntConstant) left).Value +\n\t\t\t\t\t\t\t\t       ((UIntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((UIntConstant) left).Value +\n\t\t\t\t\t\t\t\t\t ((UIntConstant) right).Value);\n\n\t\t\t\t\t\tresult = new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is IntConstant){\n\t\t\t\t\t\tint res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((IntConstant) left).Value +\n\t\t\t\t\t\t\t\t       ((IntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((IntConstant) left).Value +\n\t\t\t\t\t\t\t\t\t ((IntConstant) right).Value);\n\n\t\t\t\t\t\tresult = new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is DecimalConstant) {\n\t\t\t\t\t\tdecimal res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DecimalConstant) left).Value +\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DecimalConstant) left).Value +\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\n\t\t\t\t\t\tresult = new DecimalConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t}\n\t\t\t\t} catch (OverflowException){\n\t\t\t\t\tError_CompileTimeOverflow (ec, loc);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\n\t\t\tcase Binary.Operator.Subtraction:\n\t\t\t\t//\n\t\t\t\t// handle \"E operator - (E x, U y)\"\n\t\t\t\t// handle \"E operator - (Y y, E x)\"\n\t\t\t\t//\n\t\t\t\tlc = left as EnumConstant;\n\t\t\t\trc = right as EnumConstant;\n\t\t\t\tif (lc != null || rc != null){\n\t\t\t\t\tif (lc == null) {\n\t\t\t\t\t\tlc = rc;\n\t\t\t\t\t\tlt = lc.Type;\n\t\t\t\t\t\tright = left;\n\t\t\t\t\t}\n\n\t\t\t\t\t// U has to be implicitly convetible to E.base\n\t\t\t\t\tright = right.ConvertImplicitly (lc.Child.Type);\n\t\t\t\t\tif (right == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tresult = BinaryFold (ec, oper, lc.Child, right, loc);\n\t\t\t\t\tif (result == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tresult = result.Reduce (ec, lt);\n\t\t\t\t\tif (result == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\treturn new EnumConstant (result, lt);\n\t\t\t\t}\n\n\t\t\t\tif (left is NullLiteral && right is NullLiteral) {\n\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\ttry {\n\t\t\t\t\tif (left is DoubleConstant){\n\t\t\t\t\t\tdouble res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DoubleConstant) left).Value -\n\t\t\t\t\t\t\t\t       ((DoubleConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DoubleConstant) left).Value -\n\t\t\t\t\t\t\t\t\t ((DoubleConstant) right).Value);\n\n\t\t\t\t\t\tresult = new DoubleConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is FloatConstant){\n\t\t\t\t\t\tdouble a, b, res;\n\t\t\t\t\t\ta = ((FloatConstant) left).DoubleValue;\n\t\t\t\t\t\tb = ((FloatConstant) right).DoubleValue;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (a - b);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (a - b);\n\n\t\t\t\t\t\tresult = new FloatConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is ULongConstant){\n\t\t\t\t\t\tulong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((ULongConstant) left).Value -\n\t\t\t\t\t\t\t\t       ((ULongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((ULongConstant) left).Value -\n\t\t\t\t\t\t\t\t\t ((ULongConstant) right).Value);\n\n\t\t\t\t\t\tresult = new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is LongConstant){\n\t\t\t\t\t\tlong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((LongConstant) left).Value -\n\t\t\t\t\t\t\t\t       ((LongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((LongConstant) left).Value -\n\t\t\t\t\t\t\t\t\t ((LongConstant) right).Value);\n\n\t\t\t\t\t\tresult = new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is UIntConstant){\n\t\t\t\t\t\tuint res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((UIntConstant) left).Value -\n\t\t\t\t\t\t\t\t       ((UIntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((UIntConstant) left).Value -\n\t\t\t\t\t\t\t\t\t ((UIntConstant) right).Value);\n\n\t\t\t\t\t\tresult = new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is IntConstant){\n\t\t\t\t\t\tint res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((IntConstant) left).Value -\n\t\t\t\t\t\t\t\t       ((IntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((IntConstant) left).Value -\n\t\t\t\t\t\t\t\t\t ((IntConstant) right).Value);\n\n\t\t\t\t\t\tresult = new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is DecimalConstant) {\n\t\t\t\t\t\tdecimal res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DecimalConstant) left).Value -\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DecimalConstant) left).Value -\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\n\t\t\t\t\t\treturn new DecimalConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception ( \"Unexepected subtraction input: \" + left);\n\t\t\t\t\t}\n\t\t\t\t} catch (OverflowException){\n\t\t\t\t\tError_CompileTimeOverflow (ec, loc);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t\t\n\t\t\tcase Binary.Operator.Multiply:\n\t\t\t\tif (left is NullLiteral && right is NullLiteral) {\n\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\ttry {\n\t\t\t\t\tif (left is DoubleConstant){\n\t\t\t\t\t\tdouble res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DoubleConstant) left).Value *\n\t\t\t\t\t\t\t\t((DoubleConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DoubleConstant) left).Value *\n\t\t\t\t\t\t\t\t((DoubleConstant) right).Value);\n\n\t\t\t\t\t\treturn new DoubleConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is FloatConstant){\n\t\t\t\t\t\tdouble a, b, res;\n\t\t\t\t\t\ta = ((FloatConstant) left).DoubleValue;\n\t\t\t\t\t\tb = ((FloatConstant) right).DoubleValue;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (a * b);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (a * b);\n\n\t\t\t\t\t\treturn new FloatConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is ULongConstant){\n\t\t\t\t\t\tulong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((ULongConstant) left).Value *\n\t\t\t\t\t\t\t\t((ULongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((ULongConstant) left).Value *\n\t\t\t\t\t\t\t\t((ULongConstant) right).Value);\n\n\t\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is LongConstant){\n\t\t\t\t\t\tlong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((LongConstant) left).Value *\n\t\t\t\t\t\t\t\t((LongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((LongConstant) left).Value *\n\t\t\t\t\t\t\t\t((LongConstant) right).Value);\n\n\t\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is UIntConstant){\n\t\t\t\t\t\tuint res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((UIntConstant) left).Value *\n\t\t\t\t\t\t\t\t((UIntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((UIntConstant) left).Value *\n\t\t\t\t\t\t\t\t((UIntConstant) right).Value);\n\n\t\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is IntConstant){\n\t\t\t\t\t\tint res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((IntConstant) left).Value *\n\t\t\t\t\t\t\t\t((IntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((IntConstant) left).Value *\n\t\t\t\t\t\t\t\t((IntConstant) right).Value);\n\n\t\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is DecimalConstant) {\n\t\t\t\t\t\tdecimal res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DecimalConstant) left).Value *\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DecimalConstant) left).Value *\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\n\t\t\t\t\t\treturn new DecimalConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception ( \"Unexepected multiply input: \" + left);\n\t\t\t\t\t}\n\t\t\t\t} catch (OverflowException){\n\t\t\t\t\tError_CompileTimeOverflow (ec, loc);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase Binary.Operator.Division:\n\t\t\t\tif (left is NullLiteral && right is NullLiteral) {\n\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\ttry {\n\t\t\t\t\tif (left is DoubleConstant){\n\t\t\t\t\t\tdouble res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DoubleConstant) left).Value /\n\t\t\t\t\t\t\t\t((DoubleConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DoubleConstant) left).Value /\n\t\t\t\t\t\t\t\t((DoubleConstant) right).Value);\n\n\t\t\t\t\t\treturn new DoubleConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is FloatConstant){\n\t\t\t\t\t\tdouble a, b, res;\n\t\t\t\t\t\ta = ((FloatConstant) left).DoubleValue;\n\t\t\t\t\t\tb = ((FloatConstant) right).DoubleValue;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (a / b);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (a / b);\n\n\t\t\t\t\t\treturn new FloatConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is ULongConstant){\n\t\t\t\t\t\tulong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((ULongConstant) left).Value /\n\t\t\t\t\t\t\t\t((ULongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((ULongConstant) left).Value /\n\t\t\t\t\t\t\t\t((ULongConstant) right).Value);\n\n\t\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is LongConstant){\n\t\t\t\t\t\tlong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((LongConstant) left).Value /\n\t\t\t\t\t\t\t\t((LongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((LongConstant) left).Value /\n\t\t\t\t\t\t\t\t((LongConstant) right).Value);\n\n\t\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is UIntConstant){\n\t\t\t\t\t\tuint res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((UIntConstant) left).Value /\n\t\t\t\t\t\t\t\t((UIntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((UIntConstant) left).Value /\n\t\t\t\t\t\t\t\t((UIntConstant) right).Value);\n\n\t\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is IntConstant){\n\t\t\t\t\t\tint res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((IntConstant) left).Value /\n\t\t\t\t\t\t\t\t((IntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((IntConstant) left).Value /\n\t\t\t\t\t\t\t\t((IntConstant) right).Value);\n\n\t\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is DecimalConstant) {\n\t\t\t\t\t\tdecimal res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DecimalConstant) left).Value /\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DecimalConstant) left).Value /\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\n\t\t\t\t\t\treturn new DecimalConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception ( \"Unexepected division input: \" + left);\n\t\t\t\t\t}\n\t\t\t\t} catch (OverflowException){\n\t\t\t\t\tError_CompileTimeOverflow (ec, loc);\n\n\t\t\t\t} catch (DivideByZeroException) {\n\t\t\t\t\tec.Report.Error (20, loc, \"Division by constant zero\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Binary.Operator.Modulus:\n\t\t\t\tif (left is NullLiteral && right is NullLiteral) {\n\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\ttry {\n\t\t\t\t\tif (left is DoubleConstant){\n\t\t\t\t\t\tdouble res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DoubleConstant) left).Value %\n\t\t\t\t\t\t\t\t       ((DoubleConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DoubleConstant) left).Value %\n\t\t\t\t\t\t\t\t\t ((DoubleConstant) right).Value);\n\n\t\t\t\t\t\treturn new DoubleConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is FloatConstant){\n\t\t\t\t\t\tdouble a, b, res;\n\t\t\t\t\t\ta = ((FloatConstant) left).DoubleValue;\n\t\t\t\t\t\tb = ((FloatConstant) right).DoubleValue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (a % b);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (a % b);\n\n\t\t\t\t\t\treturn new FloatConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is ULongConstant){\n\t\t\t\t\t\tulong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((ULongConstant) left).Value %\n\t\t\t\t\t\t\t\t       ((ULongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((ULongConstant) left).Value %\n\t\t\t\t\t\t\t\t\t ((ULongConstant) right).Value);\n\n\t\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is LongConstant){\n\t\t\t\t\t\tlong res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((LongConstant) left).Value %\n\t\t\t\t\t\t\t\t       ((LongConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((LongConstant) left).Value %\n\t\t\t\t\t\t\t\t\t ((LongConstant) right).Value);\n\n\t\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is UIntConstant){\n\t\t\t\t\t\tuint res;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((UIntConstant) left).Value %\n\t\t\t\t\t\t\t\t       ((UIntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((UIntConstant) left).Value %\n\t\t\t\t\t\t\t\t\t ((UIntConstant) right).Value);\n\n\t\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t} else if (left is IntConstant){\n\t\t\t\t\t\tint res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((IntConstant) left).Value %\n\t\t\t\t\t\t\t\t       ((IntConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((IntConstant) left).Value %\n\t\t\t\t\t\t\t\t\t ((IntConstant) right).Value);\n\n\t\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (left is DecimalConstant) {\n\t\t\t\t\t\tdecimal res;\n\n\t\t\t\t\t\tif (ec.ConstantCheckState)\n\t\t\t\t\t\t\tres = checked (((DecimalConstant) left).Value %\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tres = unchecked (((DecimalConstant) left).Value %\n\t\t\t\t\t\t\t\t((DecimalConstant) right).Value);\n\n\t\t\t\t\t\treturn new DecimalConstant (ec.BuiltinTypes, res, left.Location);\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow new Exception ( \"Unexepected modulus input: \" + left);\n\t\t\t\t} catch (DivideByZeroException){\n\t\t\t\t\tec.Report.Error (20, loc, \"Division by constant zero\");\n\t\t\t\t} catch (OverflowException){\n\t\t\t\t\tError_CompileTimeOverflow (ec, loc);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\t//\n\t\t\t\t// There is no overflow checking on left shift\n\t\t\t\t//\n\t\t\tcase Binary.Operator.LeftShift:\n\t\t\t\tif (left is NullLiteral && right is NullLiteral) {\n\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t}\n\n\t\t\t\tIntConstant ic = right.ConvertImplicitly (ec.BuiltinTypes.Int) as IntConstant;\n\t\t\t\tif (ic == null){\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tint lshift_val = ic.Value;\n\t\t\t\tswitch (left.Type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, ((ULongConstant) left).Value << lshift_val, left.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, ((LongConstant) left).Value << lshift_val, left.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, ((UIntConstant) left).Value << lshift_val, left.Location);\n\t\t\t\t}\n\n\t\t\t\t// null << value => null\n\t\t\t\tif (left is NullLiteral)\n\t\t\t\t\treturn (Constant) new Binary (oper, left, right).ResolveOperator (ec);\n\n\t\t\t\tleft = left.ConvertImplicitly (ec.BuiltinTypes.Int);\n\t\t\t\tif (left.Type.BuiltinType == BuiltinTypeSpec.Type.Int)\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ((IntConstant) left).Value << lshift_val, left.Location);\n\n\t\t\t\treturn null;\n\n\t\t\t\t//\n\t\t\t\t// There is no overflow checking on right shift\n\t\t\t\t//\n\t\t\tcase Binary.Operator.RightShift:\n\t\t\t\tif (left is NullLiteral && right is NullLiteral) {\n\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t}\n\n\t\t\t\tIntConstant sic = right.ConvertImplicitly (ec.BuiltinTypes.Int) as IntConstant;\n\t\t\t\tif (sic == null){\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tint rshift_val = sic.Value;\n\t\t\t\tswitch (left.Type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, ((ULongConstant) left).Value >> rshift_val, left.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, ((LongConstant) left).Value >> rshift_val, left.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, ((UIntConstant) left).Value >> rshift_val, left.Location);\n\t\t\t\t}\n\n\t\t\t\t// null >> value => null\n\t\t\t\tif (left is NullLiteral)\n\t\t\t\t\treturn (Constant) new Binary (oper, left, right).ResolveOperator (ec);\n\n\t\t\t\tleft = left.ConvertImplicitly (ec.BuiltinTypes.Int);\n\t\t\t\tif (left.Type.BuiltinType == BuiltinTypeSpec.Type.Int)\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ((IntConstant) left).Value >> rshift_val, left.Location);\n\n\t\t\t\treturn null;\n\n\t\t\tcase Binary.Operator.Equality:\n\t\t\t\tif (TypeSpec.IsReferenceType (lt) && TypeSpec.IsReferenceType (rt) ||\n\t\t\t\t\t(left is Nullable.LiftedNull && right.IsNull) ||\n\t\t\t\t\t(right is Nullable.LiftedNull && left.IsNull)) {\n\t\t\t\t\tif (left.IsNull || right.IsNull) {\n\t\t\t\t\t\treturn ReducedExpression.Create (\n\t\t\t\t\t\t\tnew BoolConstant (ec.BuiltinTypes, left.IsNull == right.IsNull, left.Location),\n\t\t\t\t\t\t\tnew Binary (oper, left, right));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (left is StringConstant && right is StringConstant)\n\t\t\t\t\t\treturn new BoolConstant (ec.BuiltinTypes,\n\t\t\t\t\t\t\t((StringConstant) left).Value == ((StringConstant) right).Value, left.Location);\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\tbool_res = false;\n\t\t\t\tif (left is DoubleConstant)\n\t\t\t\t\tbool_res = ((DoubleConstant) left).Value ==\n\t\t\t\t\t\t((DoubleConstant) right).Value;\n\t\t\t\telse if (left is FloatConstant)\n\t\t\t\t\tbool_res = ((FloatConstant) left).DoubleValue ==\n\t\t\t\t\t\t((FloatConstant) right).DoubleValue;\n\t\t\t\telse if (left is ULongConstant)\n\t\t\t\t\tbool_res = ((ULongConstant) left).Value ==\n\t\t\t\t\t\t((ULongConstant) right).Value;\n\t\t\t\telse if (left is LongConstant)\n\t\t\t\t\tbool_res = ((LongConstant) left).Value ==\n\t\t\t\t\t\t((LongConstant) right).Value;\n\t\t\t\telse if (left is UIntConstant)\n\t\t\t\t\tbool_res = ((UIntConstant) left).Value ==\n\t\t\t\t\t\t((UIntConstant) right).Value;\n\t\t\t\telse if (left is IntConstant)\n\t\t\t\t\tbool_res = ((IntConstant) left).Value ==\n\t\t\t\t\t\t((IntConstant) right).Value;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, bool_res, left.Location);\n\n\t\t\tcase Binary.Operator.Inequality:\n\t\t\t\tif (TypeSpec.IsReferenceType (lt) && TypeSpec.IsReferenceType (rt) ||\n\t\t\t\t\t(left is Nullable.LiftedNull && right.IsNull) ||\n\t\t\t\t\t(right is Nullable.LiftedNull && left.IsNull)) {\n\t\t\t\t\tif (left.IsNull || right.IsNull) {\n\t\t\t\t\t\treturn ReducedExpression.Create (\n\t\t\t\t\t\t\tnew BoolConstant (ec.BuiltinTypes, left.IsNull != right.IsNull, left.Location),\n\t\t\t\t\t\t\tnew Binary (oper, left, right));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (left is StringConstant && right is StringConstant)\n\t\t\t\t\t\treturn new BoolConstant (ec.BuiltinTypes,\n\t\t\t\t\t\t\t((StringConstant) left).Value != ((StringConstant) right).Value, left.Location);\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\tbool_res = false;\n\t\t\t\tif (left is DoubleConstant)\n\t\t\t\t\tbool_res = ((DoubleConstant) left).Value !=\n\t\t\t\t\t\t((DoubleConstant) right).Value;\n\t\t\t\telse if (left is FloatConstant)\n\t\t\t\t\tbool_res = ((FloatConstant) left).DoubleValue !=\n\t\t\t\t\t\t((FloatConstant) right).DoubleValue;\n\t\t\t\telse if (left is ULongConstant)\n\t\t\t\t\tbool_res = ((ULongConstant) left).Value !=\n\t\t\t\t\t\t((ULongConstant) right).Value;\n\t\t\t\telse if (left is LongConstant)\n\t\t\t\t\tbool_res = ((LongConstant) left).Value !=\n\t\t\t\t\t\t((LongConstant) right).Value;\n\t\t\t\telse if (left is UIntConstant)\n\t\t\t\t\tbool_res = ((UIntConstant) left).Value !=\n\t\t\t\t\t\t((UIntConstant) right).Value;\n\t\t\t\telse if (left is IntConstant)\n\t\t\t\t\tbool_res = ((IntConstant) left).Value !=\n\t\t\t\t\t\t((IntConstant) right).Value;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, bool_res, left.Location);\n\n\t\t\tcase Binary.Operator.LessThan:\n\t\t\t\tif (right is NullLiteral) {\n\t\t\t\t\tif (left is NullLiteral) {\n\t\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\tbool_res = false;\n\t\t\t\tif (left is DoubleConstant)\n\t\t\t\t\tbool_res = ((DoubleConstant) left).Value <\n\t\t\t\t\t\t((DoubleConstant) right).Value;\n\t\t\t\telse if (left is FloatConstant)\n\t\t\t\t\tbool_res = ((FloatConstant) left).DoubleValue <\n\t\t\t\t\t\t((FloatConstant) right).DoubleValue;\n\t\t\t\telse if (left is ULongConstant)\n\t\t\t\t\tbool_res = ((ULongConstant) left).Value <\n\t\t\t\t\t\t((ULongConstant) right).Value;\n\t\t\t\telse if (left is LongConstant)\n\t\t\t\t\tbool_res = ((LongConstant) left).Value <\n\t\t\t\t\t\t((LongConstant) right).Value;\n\t\t\t\telse if (left is UIntConstant)\n\t\t\t\t\tbool_res = ((UIntConstant) left).Value <\n\t\t\t\t\t\t((UIntConstant) right).Value;\n\t\t\t\telse if (left is IntConstant)\n\t\t\t\t\tbool_res = ((IntConstant) left).Value <\n\t\t\t\t\t\t((IntConstant) right).Value;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, bool_res, left.Location);\n\t\t\t\t\n\t\t\tcase Binary.Operator.GreaterThan:\n\t\t\t\tif (right is NullLiteral) {\n\t\t\t\t\tif (left is NullLiteral) {\n\t\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\tbool_res = false;\n\t\t\t\tif (left is DoubleConstant)\n\t\t\t\t\tbool_res = ((DoubleConstant) left).Value >\n\t\t\t\t\t\t((DoubleConstant) right).Value;\n\t\t\t\telse if (left is FloatConstant)\n\t\t\t\t\tbool_res = ((FloatConstant) left).DoubleValue >\n\t\t\t\t\t\t((FloatConstant) right).DoubleValue;\n\t\t\t\telse if (left is ULongConstant)\n\t\t\t\t\tbool_res = ((ULongConstant) left).Value >\n\t\t\t\t\t\t((ULongConstant) right).Value;\n\t\t\t\telse if (left is LongConstant)\n\t\t\t\t\tbool_res = ((LongConstant) left).Value >\n\t\t\t\t\t\t((LongConstant) right).Value;\n\t\t\t\telse if (left is UIntConstant)\n\t\t\t\t\tbool_res = ((UIntConstant) left).Value >\n\t\t\t\t\t\t((UIntConstant) right).Value;\n\t\t\t\telse if (left is IntConstant)\n\t\t\t\t\tbool_res = ((IntConstant) left).Value >\n\t\t\t\t\t\t((IntConstant) right).Value;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, bool_res, left.Location);\n\n\t\t\tcase Binary.Operator.GreaterThanOrEqual:\n\t\t\t\tif (right is NullLiteral) {\n\t\t\t\t\tif (left is NullLiteral) {\n\t\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\tbool_res = false;\n\t\t\t\tif (left is DoubleConstant)\n\t\t\t\t\tbool_res = ((DoubleConstant) left).Value >=\n\t\t\t\t\t\t((DoubleConstant) right).Value;\n\t\t\t\telse if (left is FloatConstant)\n\t\t\t\t\tbool_res = ((FloatConstant) left).DoubleValue >=\n\t\t\t\t\t\t((FloatConstant) right).DoubleValue;\n\t\t\t\telse if (left is ULongConstant)\n\t\t\t\t\tbool_res = ((ULongConstant) left).Value >=\n\t\t\t\t\t\t((ULongConstant) right).Value;\n\t\t\t\telse if (left is LongConstant)\n\t\t\t\t\tbool_res = ((LongConstant) left).Value >=\n\t\t\t\t\t\t((LongConstant) right).Value;\n\t\t\t\telse if (left is UIntConstant)\n\t\t\t\t\tbool_res = ((UIntConstant) left).Value >=\n\t\t\t\t\t\t((UIntConstant) right).Value;\n\t\t\t\telse if (left is IntConstant)\n\t\t\t\t\tbool_res = ((IntConstant) left).Value >=\n\t\t\t\t\t\t((IntConstant) right).Value;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, bool_res, left.Location);\n\n\t\t\tcase Binary.Operator.LessThanOrEqual:\n\t\t\t\tif (right is NullLiteral) {\n\t\t\t\t\tif (left is NullLiteral) {\n\t\t\t\t\t\tvar lifted_int = new Nullable.NullableType (ec.BuiltinTypes.Int, loc);\n\t\t\t\t\t\tlifted_int.ResolveAsType (ec);\n\t\t\t\t\t\treturn (Constant) new Binary (oper, lifted_int, right).ResolveOperator (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!DoBinaryNumericPromotions (ec, ref left, ref right))\n\t\t\t\t\treturn null;\n\n\t\t\t\tbool_res = false;\n\t\t\t\tif (left is DoubleConstant)\n\t\t\t\t\tbool_res = ((DoubleConstant) left).Value <=\n\t\t\t\t\t\t((DoubleConstant) right).Value;\n\t\t\t\telse if (left is FloatConstant)\n\t\t\t\t\tbool_res = ((FloatConstant) left).DoubleValue <=\n\t\t\t\t\t\t((FloatConstant) right).DoubleValue;\n\t\t\t\telse if (left is ULongConstant)\n\t\t\t\t\tbool_res = ((ULongConstant) left).Value <=\n\t\t\t\t\t\t((ULongConstant) right).Value;\n\t\t\t\telse if (left is LongConstant)\n\t\t\t\t\tbool_res = ((LongConstant) left).Value <=\n\t\t\t\t\t\t((LongConstant) right).Value;\n\t\t\t\telse if (left is UIntConstant)\n\t\t\t\t\tbool_res = ((UIntConstant) left).Value <=\n\t\t\t\t\t\t((UIntConstant) right).Value;\n\t\t\t\telse if (left is IntConstant)\n\t\t\t\t\tbool_res = ((IntConstant) left).Value <=\n\t\t\t\t\t\t((IntConstant) right).Value;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, bool_res, left.Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs",
    "content": "//\n// class.cs: Class and Struct handlers\n//\n// Authors: Miguel de Icaza (miguel@gnu.org)\n//          Martin Baulig (martin@ximian.com)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2011 Novell, Inc\n// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)\n//\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Security;\nusing System.Security.Permissions;\nusing System.Text;\nusing System.Diagnostics;\nusing Mono.CompilerServices.SymbolWriter;\n\n#if NET_2_1\nusing XmlElement = System.Object;\n#endif\n\n#if STATIC\nusing SecurityType = System.Collections.Generic.List<IKVM.Reflection.Emit.CustomAttributeBuilder>;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing SecurityType = System.Collections.Generic.Dictionary<System.Security.Permissions.SecurityAction, System.Security.PermissionSet>;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\t//\n\t// General types container, used as a base class for all constructs which can hold types\n\t//\n\tpublic abstract class TypeContainer : MemberCore\n\t{\n\t\tpublic readonly MemberKind Kind;\n\t\tpublic readonly string Basename;\n\n\t\tprotected List<TypeContainer> containers;\n\n\t\tTypeDefinition main_container;\n\n\t\tprotected Dictionary<string, MemberCore> defined_names;\n\n\t\tprotected bool is_defined;\n\n\t\tpublic int CounterAnonymousMethods { get; set; }\n\t\tpublic int CounterAnonymousContainers { get; set; }\n\t\tpublic int CounterSwitchTypes { get; set; }\n\n\t\tprotected TypeContainer (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind)\n\t\t\t: base (parent, name, attrs)\n\t\t{\n\t\t\tthis.Kind = kind;\n\t\t\tif (name != null)\n\t\t\t\tthis.Basename = name.Basename;\n\n\t\t\tdefined_names = new Dictionary<string, MemberCore> ();\n\t\t}\n\n\t\tpublic override TypeSpec CurrentType {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic Dictionary<string, MemberCore> DefinedNames {\n\t\t\tget {\n\t\t\t\treturn defined_names;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeDefinition PartialContainer {\n\t\t\tget {\n\t\t\t\treturn main_container;\n\t\t\t}\n\t\t\tprotected set {\n\t\t\t\tmain_container = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<TypeContainer> Containers {\n\t\t\tget {\n\t\t\t\treturn containers;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Any unattached attributes during parsing get added here. User\n\t\t// by FULL_AST mode\n\t\t//\n\t\tpublic Attributes UnattachedAttributes {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic void AddCompilerGeneratedClass (CompilerGeneratedContainer c)\n\t\t{\n\t\t\tAddTypeContainerMember (c);\n\t\t}\n\n\t\tpublic virtual void AddPartial (TypeDefinition next_part)\n\t\t{\n\t\t\tMemberCore mc;\n\t\t\t(PartialContainer ?? this).defined_names.TryGetValue (next_part.Basename, out mc);\n\n\t\t\tAddPartial (next_part, mc as TypeDefinition);\n\t\t}\n\n\t\tprotected void AddPartial (TypeDefinition next_part, TypeDefinition existing)\n\t\t{\n\t\t\tnext_part.ModFlags |= Modifiers.PARTIAL;\n\n\t\t\tif (existing == null) {\n\t\t\t\tAddTypeContainer (next_part);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ((existing.ModFlags & Modifiers.PARTIAL) == 0) {\n\t\t\t\tif (existing.Kind != next_part.Kind) {\n\t\t\t\t\tAddTypeContainer (next_part);\n\t\t\t\t} else {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (next_part);\n\t\t\t\t\tError_MissingPartialModifier (existing);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (existing.Kind != next_part.Kind) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (existing);\n\t\t\t\tReport.Error (261, next_part.Location,\n\t\t\t\t\t\"Partial declarations of `{0}' must be all classes, all structs or all interfaces\",\n\t\t\t\t\tnext_part.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif ((existing.ModFlags & Modifiers.AccessibilityMask) != (next_part.ModFlags & Modifiers.AccessibilityMask) &&\n\t\t\t\t((existing.ModFlags & Modifiers.DEFAULT_ACCESS_MODIFIER) == 0 &&\n\t\t\t\t (next_part.ModFlags & Modifiers.DEFAULT_ACCESS_MODIFIER) == 0)) {\n\t\t\t\t\t Report.SymbolRelatedToPreviousError (existing);\n\t\t\t\tReport.Error (262, next_part.Location,\n\t\t\t\t\t\"Partial declarations of `{0}' have conflicting accessibility modifiers\",\n\t\t\t\t\tnext_part.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tvar tc_names = existing.CurrentTypeParameters;\n\t\t\tif (tc_names != null) {\n\t\t\t\tfor (int i = 0; i < tc_names.Count; ++i) {\n\t\t\t\t\tvar tp = next_part.MemberName.TypeParameters[i];\n\t\t\t\t\tif (tc_names[i].MemberName.Name != tp.MemberName.Name) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (existing.Location, \"\");\n\t\t\t\t\t\tReport.Error (264, next_part.Location, \"Partial declarations of `{0}' must have the same type parameter names in the same order\",\n\t\t\t\t\t\t\tnext_part.GetSignatureForError ());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tc_names[i].Variance != tp.Variance) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (existing.Location, \"\");\n\t\t\t\t\t\tReport.Error (1067, next_part.Location, \"Partial declarations of `{0}' must have the same type parameter variance modifiers\",\n\t\t\t\t\t\t\tnext_part.GetSignatureForError ());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((next_part.ModFlags & Modifiers.DEFAULT_ACCESS_MODIFIER) != 0) {\n\t\t\t\texisting.ModFlags |= next_part.ModFlags & ~(Modifiers.DEFAULT_ACCESS_MODIFIER | Modifiers.AccessibilityMask);\n\t\t\t} else if ((existing.ModFlags & Modifiers.DEFAULT_ACCESS_MODIFIER) != 0) {\n\t\t\t\texisting.ModFlags &= ~(Modifiers.DEFAULT_ACCESS_MODIFIER | Modifiers.AccessibilityMask);\n\t\t\t\texisting.ModFlags |= next_part.ModFlags;\n\t\t\t} else {\n\t\t\t\texisting.ModFlags |= next_part.ModFlags;\n\t\t\t}\n\n\t\t\texisting.Definition.Modifiers = existing.ModFlags;\n\n\t\t\tif (next_part.attributes != null) {\n\t\t\t\tif (existing.attributes == null)\n\t\t\t\t\texisting.attributes = next_part.attributes;\n\t\t\t\telse\n\t\t\t\t\texisting.attributes.AddAttributes (next_part.attributes.Attrs);\n\t\t\t}\n\n\t\t\tnext_part.PartialContainer = existing;\n\n\t\t\texisting.AddPartialPart (next_part);\n\n\t\t\tAddTypeContainerMember (next_part);\n\t\t}\n\n\t\tpublic virtual void AddTypeContainer (TypeContainer tc)\n\t\t{\n\t\t\tAddTypeContainerMember (tc);\n\n\t\t\tvar tparams = tc.MemberName.TypeParameters;\n\t\t\tif (tparams != null && tc.PartialContainer != null) {\n\t\t\t\tvar td = (TypeDefinition) tc;\n\t\t\t\tfor (int i = 0; i < tparams.Count; ++i) {\n\t\t\t\t\tvar tp = tparams[i];\n\t\t\t\t\tif (tp.MemberName == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\ttd.AddNameToContainer (tp, tp.Name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void AddTypeContainerMember (TypeContainer tc)\n\t\t{\n\t\t\tcontainers.Add (tc);\n\t\t}\n\n\t\tpublic virtual void CloseContainer ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (TypeContainer tc in containers) {\n\t\t\t\t\ttc.CloseContainer ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void CreateMetadataName (StringBuilder sb)\n\t\t{\n\t\t\tif (Parent != null && Parent.MemberName != null)\n\t\t\t\tParent.CreateMetadataName (sb);\n\n\t\t\tMemberName.CreateMetadataName (sb);\n\t\t}\n\n\t\tpublic virtual bool CreateContainer ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (TypeContainer tc in containers) {\n\t\t\t\t\ttc.CreateContainer ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (TypeContainer tc in containers) {\n\t\t\t\t\ttc.Define ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Release cache used by parser only\n\t\t\tif (Module.Evaluator == null) {\n\t\t\t\tdefined_names = null;\n\t\t\t} else {\n\t\t\t\tdefined_names.Clear ();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic virtual void PrepareEmit ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (var t in containers) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tt.PrepareEmit ();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tif (MemberName == MemberName.Null)\n\t\t\t\t\t\t\tthrow;\n\n\t\t\t\t\t\tthrow new InternalErrorException (t, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool DefineContainer ()\n\t\t{\n\t\t\tif (is_defined)\n\t\t\t\treturn true;\n\n\t\t\tis_defined = true;\n\n\t\t\tDoDefineContainer ();\n\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (TypeContainer tc in containers) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttc.DefineContainer ();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tif (MemberName == MemberName.Null)\n\t\t\t\t\t\t\tthrow;\n\n\t\t\t\t\t\tthrow new InternalErrorException (tc, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic virtual void ExpandBaseInterfaces ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (TypeContainer tc in containers) {\n\t\t\t\t\ttc.ExpandBaseInterfaces ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void DefineNamespace ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (var tc in containers) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttc.DefineNamespace ();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new InternalErrorException (tc, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void DoDefineContainer ()\n\t\t{\n\t\t}\n\n\t\tpublic virtual void EmitContainer ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tfor (int i = 0; i < containers.Count; ++i)\n\t\t\t\t\tcontainers[i].EmitContainer ();\n\t\t\t}\n\t\t}\n\n\t\tprotected void Error_MissingPartialModifier (MemberCore type)\n\t\t{\n\t\t\tReport.Error (260, type.Location,\n\t\t\t\t\"Missing partial modifier on declaration of type `{0}'. Another partial declaration of this type exists\",\n\t\t\t\ttype.GetSignatureForError ());\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tif (Parent != null && Parent.MemberName != null)\n\t\t\t\treturn Parent.GetSignatureForDocumentation () + \".\" + MemberName.GetSignatureForDocumentation ();\n\n\t\t\treturn MemberName.GetSignatureForDocumentation ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tif (Parent != null && Parent.MemberName != null) \n\t\t\t\treturn Parent.GetSignatureForError () + \".\" + MemberName.GetSignatureForError ();\n\n\t\t\treturn MemberName.GetSignatureForError ();\n\t\t}\n\n\t\tpublic string GetSignatureForMetadata ()\n\t\t{\n\t\t\tif (Parent is TypeDefinition) {\n\t\t\t\treturn Parent.GetSignatureForMetadata () + \"+\" + TypeNameParser.Escape (MemberName.Basename);\n\t\t\t}\n\n\t\t\tvar sb = new StringBuilder ();\n\t\t\tCreateMetadataName (sb);\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic virtual void RemoveContainer (TypeContainer cont)\n\t\t{\n\t\t\tif (containers != null)\n\t\t\t\tcontainers.Remove (cont);\n\n\t\t\tvar tc = Parent == Module ? Module : this;\n\t\t\ttc.defined_names.Remove (cont.Basename);\n\t\t}\n\n\t\tpublic virtual void VerifyMembers ()\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (TypeContainer tc in containers)\n\t\t\t\t\ttc.VerifyMembers ();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (TypeContainer tc in containers) {\n\t\t\t\t\ttc.WriteDebugSymbol (file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic abstract class TypeDefinition : TypeContainer, ITypeDefinition\n\t{\n\t\t//\n\t\t// Different context is needed when resolving type container base\n\t\t// types. Type names come from the parent scope but type parameter\n\t\t// names from the container scope.\n\t\t//\n\t\tpublic struct BaseContext : IMemberContext\n\t\t{\n\t\t\tTypeContainer tc;\n\n\t\t\tpublic BaseContext (TypeContainer tc)\n\t\t\t{\n\t\t\t\tthis.tc = tc;\n\t\t\t}\n\n\t\t\t#region IMemberContext Members\n\n\t\t\tpublic CompilerContext Compiler {\n\t\t\t\tget { return tc.Compiler; }\n\t\t\t}\n\n\t\t\tpublic TypeSpec CurrentType {\n\t\t\t\tget { return tc.PartialContainer.CurrentType; }\n\t\t\t}\n\n\t\t\tpublic TypeParameters CurrentTypeParameters {\n\t\t\t\tget { return tc.PartialContainer.CurrentTypeParameters; }\n\t\t\t}\n\n\t\t\tpublic MemberCore CurrentMemberDefinition {\n\t\t\t\tget { return tc; }\n\t\t\t}\n\n\t\t\tpublic bool IsObsolete {\n\t\t\t\tget { return tc.IsObsolete; }\n\t\t\t}\n\n\t\t\tpublic bool IsUnsafe {\n\t\t\t\tget { return tc.IsUnsafe; }\n\t\t\t}\n\n\t\t\tpublic bool IsStatic {\n\t\t\t\tget { return tc.IsStatic; }\n\t\t\t}\n\n\t\t\tpublic ModuleContainer Module {\n\t\t\t\tget { return tc.Module; }\n\t\t\t}\n\n\t\t\tpublic string GetSignatureForError ()\n\t\t\t{\n\t\t\t\treturn tc.GetSignatureForError ();\n\t\t\t}\n\n\t\t\tpublic ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic FullNamedExpression LookupNamespaceAlias (string name)\n\t\t\t{\n\t\t\t\treturn tc.Parent.LookupNamespaceAlias (name);\n\t\t\t}\n\n\t\t\tpublic FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t\t{\n\t\t\t\tif (arity == 0) {\n\t\t\t\t\tvar tp = CurrentTypeParameters;\n\t\t\t\t\tif (tp != null) {\n\t\t\t\t\t\tTypeParameter t = tp.Find (name);\n\t\t\t\t\t\tif (t != null)\n\t\t\t\t\t\t\treturn new TypeParameterExpr (t, loc);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tc.Parent.LookupNamespaceOrType (name, arity, mode, loc);\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\t[Flags]\n\t\tenum CachedMethods\n\t\t{\n\t\t\tEquals\t\t\t\t= 1,\n\t\t\tGetHashCode\t\t\t= 1 << 1,\n\t\t\tHasStaticFieldInitializer\t= 1 << 2\n\t\t}\n\n\t\treadonly List<MemberCore> members;\n\n\t\t// Holds a list of fields that have initializers\n\t\tprotected List<FieldInitializer> initialized_fields;\n\n\t\t// Holds a list of static fields that have initializers\n\t\tprotected List<FieldInitializer> initialized_static_fields;\n\n\t\tDictionary<MethodSpec, Method> hoisted_base_call_proxies;\n\n\t\tDictionary<string, FullNamedExpression> Cache = new Dictionary<string, FullNamedExpression> ();\n\n\t\t//\n\t\t// Points to the first non-static field added to the container.\n\t\t//\n\t\t// This is an arbitrary choice.  We are interested in looking at _some_ non-static field,\n\t\t// and the first one's as good as any.\n\t\t//\n\t\tprotected FieldBase first_nonstatic_field;\n\n\t\t//\n\t\t// This one is computed after we can distinguish interfaces\n\t\t// from classes from the arraylist `type_bases' \n\t\t//\n\t\tprotected TypeSpec base_type;\n\t\tFullNamedExpression base_type_expr;\t// TODO: It's temporary variable\n\t\tprotected TypeSpec[] iface_exprs;\n\n\t\tprotected List<FullNamedExpression> type_bases;\n\n\t\t// Partial parts for classes only\n\t\tList<TypeDefinition> class_partial_parts;\n\n\t\tTypeDefinition InTransit;\n\n\t\tpublic TypeBuilder TypeBuilder;\n\t\tGenericTypeParameterBuilder[] all_tp_builders;\n\t\t//\n\t\t// All recursive type parameters put together sharing same\n\t\t// TypeParameter instances\n\t\t//\n\t\tTypeParameters all_type_parameters;\n\n\t\tpublic const string DefaultIndexerName = \"Item\";\n\n\t\tbool has_normal_indexers;\n\t\tstring indexer_name;\n\t\tprotected bool requires_delayed_unmanagedtype_check;\n\t\tbool error;\n\t\tbool members_defined;\n\t\tbool members_defined_ok;\n\t\tprotected bool has_static_constructor;\n\n\t\tprivate CachedMethods cached_method;\n\n\t\tprotected TypeSpec spec;\n\t\tTypeSpec current_type;\n\n\t\tpublic int DynamicSitesCounter;\n\t\tpublic int AnonymousMethodsCounter;\n\t\tpublic int MethodGroupsCounter;\n\n\t\tstatic readonly string[] attribute_targets = new [] { \"type\" };\n\t\tstatic readonly string[] attribute_targets_primary = new [] { \"type\", \"method\" };\n\n\t\t/// <remarks>\n\t\t///  The pending methods that need to be implemented\n\t\t//   (interfaces or abstract methods)\n\t\t/// </remarks>\n\t\tPendingImplementation pending;\n\n\t\tprotected TypeDefinition (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind)\n\t\t\t: base (parent, name, attrs, kind)\n\t\t{\n\t\t\tPartialContainer = this;\n\t\t\tmembers = new List<MemberCore> ();\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic List<FullNamedExpression> BaseTypeExpressions {\n\t\t\tget {\n\t\t\t\treturn type_bases;\n\t\t\t}\n\t\t}\n\n\t\tpublic override TypeSpec CurrentType {\n\t\t\tget {\n\t\t\t\tif (current_type == null) {\n\t\t\t\t\tif (IsGenericOrParentIsGeneric) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Switch to inflated version as it's used by all expressions\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar targs = CurrentTypeParameters == null ? TypeSpec.EmptyTypes : CurrentTypeParameters.Types;\n\t\t\t\t\t\tcurrent_type = spec.MakeGenericType (this, targs);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent_type = spec;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn current_type;\n\t\t\t}\n\t\t}\n\n\t\tpublic override TypeParameters CurrentTypeParameters {\n\t\t\tget {\n\t\t\t\treturn PartialContainer.MemberName.TypeParameters;\n\t\t\t}\n\t\t}\n\n\t\tint CurrentTypeParametersStartIndex {\n\t\t\tget {\n\t\t\t\tint total = all_tp_builders.Length;\n\t\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\t\treturn total - CurrentTypeParameters.Count;\n\t\t\t\t}\n\t\t\t\treturn total;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual AssemblyDefinition DeclaringAssembly {\n\t\t\tget {\n\t\t\t\treturn Module.DeclaringAssembly;\n\t\t\t}\n\t\t}\n\n\t\tIAssemblyDefinition ITypeDefinition.DeclaringAssembly {\n\t\t\tget {\n\t\t\t\treturn Module.DeclaringAssembly;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec Definition {\n\t\t\tget {\n\t\t\t\treturn spec;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasMembersDefined {\n\t\t\tget {\n\t\t\t\treturn members_defined;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic List<FullNamedExpression> TypeBaseExpressions {\n\t\t\tget {\n\t\t\t\treturn type_bases;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasInstanceConstructor {\n\t\t\tget {\n\t\t\t\treturn (caching_flags & Flags.HasInstanceConstructor) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tcaching_flags |= Flags.HasInstanceConstructor;\n\t\t\t}\n\t\t}\n\n\t\t// Indicated whether container has StructLayout attribute set Explicit\n\t\tpublic bool HasExplicitLayout {\n\t\t\tget { return (caching_flags & Flags.HasExplicitLayout) != 0; }\n\t\t\tset { caching_flags |= Flags.HasExplicitLayout; }\n\t\t}\n\n\t\tpublic bool HasOperators {\n\t\t\tget {\n\t\t\t\treturn (caching_flags & Flags.HasUserOperators) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tcaching_flags |= Flags.HasUserOperators;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasStructLayout {\n\t\t\tget { return (caching_flags & Flags.HasStructLayout) != 0; }\n\t\t\tset { caching_flags |= Flags.HasStructLayout; }\n\t\t}\n\n\t\tpublic TypeSpec[] Interfaces {\n\t\t\tget {\n\t\t\t\treturn iface_exprs;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsGenericOrParentIsGeneric {\n\t\t\tget {\n\t\t\t\treturn all_type_parameters != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsTopLevel {\n\t\t\tget {\n\t\t\t\treturn !(Parent is TypeDefinition);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsPartial {\n\t\t\tget {\n\t\t\t\treturn (ModFlags & Modifiers.PARTIAL) != 0;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsCyclicTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true for secondary partial containers\n\t\t//\n\t\tbool IsPartialPart {\n\t\t\tget {\n\t\t\t\treturn PartialContainer != this;\n\t\t\t}\n\t\t}\n\n\t\tpublic MemberCache MemberCache {\n\t\t\tget {\n\t\t\t\treturn spec.MemberCache;\n\t\t\t}\n\t\t}\n\n\t\tpublic List<MemberCore> Members {\n\t\t\tget {\n\t\t\t\treturn members;\n\t\t\t}\n\t\t}\n\n\t\tstring ITypeDefinition.Namespace {\n\t\t\tget {\n\t\t\t\tvar p = Parent;\n\t\t\t\twhile (p.Kind != MemberKind.Namespace)\n\t\t\t\t\tp = p.Parent;\n\n\t\t\t\treturn p.MemberName == null ? null : p.GetSignatureForError ();\n\t\t\t}\n\t\t}\n\n\t\tpublic ParametersCompiled PrimaryConstructorParameters { get; set; }\n\n\t\tpublic Arguments PrimaryConstructorBaseArguments { get; set; }\n\n\t\tpublic Location PrimaryConstructorBaseArgumentsStart { get; set; }\n\n\t\tpublic TypeParameters TypeParametersAll {\n\t\t\tget {\n\t\t\t\treturn all_type_parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn PrimaryConstructorParameters != null ? attribute_targets_primary : attribute_targets;\n\t\t\t}\n\t\t}\n\n#if FULL_AST\n\t\tpublic bool HasOptionalSemicolon {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\tLocation optionalSemicolon;\n\t\tpublic Location OptionalSemicolon {\n\t\t\tget {\n\t\t\t\treturn optionalSemicolon;\n\t\t\t}\n\t\t\tset {\n\t\t\t\toptionalSemicolon = value;\n\t\t\t\tHasOptionalSemicolon = true;\n\t\t\t}\n\t\t}\n#endif\n\n\t\t#endregion\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic void AddMember (MemberCore symbol)\n\t\t{\n\t\t\tif (symbol.MemberName.ExplicitInterface != null) {\n\t\t\t\tif (!(Kind == MemberKind.Class || Kind == MemberKind.Struct)) {\n\t\t\t\t\tReport.Error (541, symbol.Location,\n\t\t\t\t\t\t\"`{0}': explicit interface declaration can only be declared in a class or struct\",\n\t\t\t\t\t\tsymbol.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAddNameToContainer (symbol, symbol.MemberName.Name);\n\t\t\tmembers.Add (symbol);\n\t\t}\n\n\t\tpublic override void AddTypeContainer (TypeContainer tc)\n\t\t{\n\t\t\tAddNameToContainer (tc, tc.Basename);\n\n\t\t\tbase.AddTypeContainer (tc);\n\t\t}\n\n\t\tprotected override void AddTypeContainerMember (TypeContainer tc)\n\t\t{\n\t\t\tmembers.Add (tc);\n\n\t\t\tif (containers == null)\n\t\t\t\tcontainers = new List<TypeContainer> ();\n\n\t\t\tbase.AddTypeContainerMember (tc);\n\t\t}\n\n\t\t//\n\t\t// Adds the member to defined_names table. It tests for duplications and enclosing name conflicts\n\t\t//\n\t\tpublic virtual void AddNameToContainer (MemberCore symbol, string name)\n\t\t{\n\t\t\tif (((ModFlags | symbol.ModFlags) & Modifiers.COMPILER_GENERATED) != 0)\n\t\t\t\treturn;\n\n\t\t\tMemberCore mc;\n\t\t\tif (!PartialContainer.defined_names.TryGetValue (name, out mc)) {\n\t\t\t\tPartialContainer.defined_names.Add (name, symbol);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (symbol.EnableOverloadChecks (mc))\n\t\t\t\treturn;\n\n\t\t\tInterfaceMemberBase im = mc as InterfaceMemberBase;\n\t\t\tif (im != null && im.IsExplicitImpl)\n\t\t\t\treturn;\n\n\t\t\tReport.SymbolRelatedToPreviousError (mc);\n\t\t\tif ((mc.ModFlags & Modifiers.PARTIAL) != 0 && (symbol is ClassOrStruct || symbol is Interface)) {\n\t\t\t\tError_MissingPartialModifier (symbol);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (symbol is TypeParameter) {\n\t\t\t\tReport.Error (692, symbol.Location,\n\t\t\t\t\t\"Duplicate type parameter `{0}'\", symbol.GetSignatureForError ());\n\t\t\t} else {\n\t\t\t\tReport.Error (102, symbol.Location,\n\t\t\t\t\t\"The type `{0}' already contains a definition for `{1}'\",\n\t\t\t\t\tGetSignatureForError (), name);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tpublic void AddConstructor (Constructor c)\n\t\t{\n\t\t\tAddConstructor (c, false);\n\t\t}\n\n\t\tpublic void AddConstructor (Constructor c, bool isDefault)\n\t\t{\n\t\t\tbool is_static = (c.ModFlags & Modifiers.STATIC) != 0;\n\t\t\tif (!isDefault)\n\t\t\t\tAddNameToContainer (c, is_static ? Constructor.TypeConstructorName : Constructor.ConstructorName);\n\n\t\t\tif (is_static && c.ParameterInfo.IsEmpty) {\n\t\t\t\tPartialContainer.has_static_constructor = true;\n\t\t\t} else {\n\t\t\t\tPartialContainer.HasInstanceConstructor = true;\n\t\t\t}\n\n\t\t\tmembers.Add (c);\n\t\t}\n\n\t\tpublic bool AddField (FieldBase field)\n\t\t{\n\t\t\tAddMember (field);\n\n\t\t\tif ((field.ModFlags & Modifiers.STATIC) != 0)\n\t\t\t\treturn true;\n\n\t\t\tvar first_field = PartialContainer.first_nonstatic_field;\n\t\t\tif (first_field == null) {\n\t\t\t\tPartialContainer.first_nonstatic_field = field;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (Kind == MemberKind.Struct && first_field.Parent != field.Parent) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (first_field.Parent);\n\t\t\t\tReport.Warning (282, 3, field.Location,\n\t\t\t\t\t\"struct instance field `{0}' found in different declaration from instance field `{1}'\",\n\t\t\t\t\tfield.GetSignatureForError (), first_field.GetSignatureForError ());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Indexer has special handling in constrast to other AddXXX because the name can be driven by IndexerNameAttribute\n\t\t/// </summary>\n\t\tpublic void AddIndexer (Indexer i)\n\t\t{\n\t\t\tmembers.Add (i);\n\t\t}\n\n\t\tpublic void AddOperator (Operator op)\n\t\t{\n\t\t\tPartialContainer.HasOperators = true;\n\t\t\tAddMember (op);\n\t\t}\n\n\t\tpublic void AddPartialPart (TypeDefinition part)\n\t\t{\n\t\t\tif (Kind != MemberKind.Class)\n\t\t\t\treturn;\n\n\t\t\tif (class_partial_parts == null)\n\t\t\t\tclass_partial_parts = new List<TypeDefinition> ();\n\n\t\t\tclass_partial_parts.Add (part);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Target == AttributeTargets.Method) {\n\t\t\t\tforeach (var m in members) {\n\t\t\t\t\tvar c = m as Constructor;\n\t\t\t\t\tif (c == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (c.IsPrimaryConstructor) {\n\t\t\t\t\t\tc.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthrow new InternalErrorException ();\n\t\t\t}\n\n\t\t\tif (has_normal_indexers && a.Type == pa.DefaultMember) {\n\t\t\t\tReport.Error (646, a.Location, \"Cannot specify the `DefaultMember' attribute on type containing an indexer\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Required) {\n\t\t\t\tReport.Error (1608, a.Location, \"The RequiredAttribute attribute is not permitted on C# types\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tTypeBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t} \n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec BaseType {\n\t\t\tget {\n\t\t\t\treturn spec.BaseType;\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual TypeAttributes TypeAttr {\n\t\t\tget {\n\t\t\t\treturn ModifiersExtensions.TypeAttr (ModFlags, IsTopLevel);\n\t\t\t}\n\t\t}\n\n\t\tpublic int TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn MemberName.Arity;\n\t\t\t}\n\t\t}\n\n\t\tTypeParameterSpec[] ITypeDefinition.TypeParameters {\n\t\t\tget {\n\t\t\t\treturn PartialContainer.CurrentTypeParameters.Types;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetAttributeDefaultMember ()\n\t\t{\n\t\t\treturn indexer_name ?? DefaultIndexerName;\n\t\t}\n\n\t\tpublic bool IsComImport {\n\t\t\tget {\n\t\t\t\tif (OptAttributes == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn OptAttributes.Contains (Module.PredefinedAttributes.ComImport);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void RegisterFieldForInitialization (MemberCore field, FieldInitializer expression)\n\t\t{\n\t\t\tif (IsPartialPart)\n\t\t\t\tPartialContainer.RegisterFieldForInitialization (field, expression);\n\n\t\t\tif ((field.ModFlags & Modifiers.STATIC) != 0){\n\t\t\t\tif (initialized_static_fields == null) {\n\t\t\t\t\tHasStaticFieldInitializer = true;\n\t\t\t\t\tinitialized_static_fields = new List<FieldInitializer> (4);\n\t\t\t\t}\n\n\t\t\t\tinitialized_static_fields.Add (expression);\n\t\t\t} else {\n\t\t\t\tif (initialized_fields == null)\n\t\t\t\t\tinitialized_fields = new List<FieldInitializer> (4);\n\n\t\t\t\tinitialized_fields.Add (expression);\n\t\t\t}\n\t\t}\n\n\t\tpublic void ResolveFieldInitializers (BlockContext ec)\n\t\t{\n\t\t\tDebug.Assert (!IsPartialPart);\n\n\t\t\tif (ec.IsStatic) {\n\t\t\t\tif (initialized_static_fields == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tbool has_complex_initializer = !ec.Module.Compiler.Settings.Optimize;\n\t\t\t\tint i;\n\t\t\t\tExpressionStatement [] init = new ExpressionStatement [initialized_static_fields.Count];\n\t\t\t\tfor (i = 0; i < initialized_static_fields.Count; ++i) {\n\t\t\t\t\tFieldInitializer fi = initialized_static_fields [i];\n\t\t\t\t\tExpressionStatement s = fi.ResolveStatement (ec);\n\t\t\t\t\tif (s == null) {\n\t\t\t\t\t\ts = EmptyExpressionStatement.Instance;\n\t\t\t\t\t} else if (!fi.IsSideEffectFree) {\n\t\t\t\t\t\thas_complex_initializer = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tinit [i] = s;\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < initialized_static_fields.Count; ++i) {\n\t\t\t\t\tFieldInitializer fi = initialized_static_fields [i];\n\t\t\t\t\t//\n\t\t\t\t\t// Need special check to not optimize code like this\n\t\t\t\t\t// static int a = b = 5;\n\t\t\t\t\t// static int b = 0;\n\t\t\t\t\t//\n\t\t\t\t\tif (!has_complex_initializer && fi.IsDefaultInitializer)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tec.AssignmentInfoOffset += fi.AssignmentOffset;\n\t\t\t\t\tec.CurrentBlock.AddScopeStatement (new StatementExpression (init [i]));\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (initialized_fields == null)\n\t\t\t\treturn;\n\n\t\t\tfor (int i = 0; i < initialized_fields.Count; ++i) {\n\t\t\t\tFieldInitializer fi = initialized_fields [i];\n\n\t\t\t\t//\n\t\t\t\t// Clone before resolving otherwise when field initializer is needed\n\t\t\t\t// in more than 1 constructor any resolve after the initial one would\n\t\t\t\t// only took the resolved expression which is problem for expressions\n\t\t\t\t// that generate extra expressions or code during Resolve phase\n\t\t\t\t//\n\t\t\t\tvar cloned = fi.Clone (new CloneContext ());\n\n\t\t\t\tExpressionStatement s = fi.ResolveStatement (ec);\n\t\t\t\tif (s == null) {\n\t\t\t\t\tinitialized_fields [i] = new FieldInitializer (fi.Field, ErrorExpression.Instance, Location.Null);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Field is re-initialized to its default value => removed\n\t\t\t\t//\n\t\t\t\tif (fi.IsDefaultInitializer && ec.Module.Compiler.Settings.Optimize)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tec.AssignmentInfoOffset += fi.AssignmentOffset;\n\t\t\t\tec.CurrentBlock.AddScopeStatement (new StatementExpression (s));\n\t\t\t\tinitialized_fields [i] = (FieldInitializer) cloned;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string DocComment {\n\t\t\tget {\n\t\t\t\treturn comment;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tcomment += value;\n\t\t\t}\n\t\t}\n\n\t\tpublic PendingImplementation PendingImplementations {\n\t\t\tget { return pending; }\n\t\t}\n\n\t\tinternal override void GenerateDocComment (DocumentationBuilder builder)\n\t\t{\n\t\t\tif (IsPartialPart)\n\t\t\t\treturn;\n\n\t\t\tbase.GenerateDocComment (builder);\n\n\t\t\tforeach (var member in members)\n\t\t\t\tmember.GenerateDocComment (builder);\n\t\t}\n\n\t\tpublic TypeSpec GetAttributeCoClass ()\n\t\t{\n\t\t\tif (OptAttributes == null)\n\t\t\t\treturn null;\n\n\t\t\tAttribute a = OptAttributes.Search (Module.PredefinedAttributes.CoClass);\n\t\t\tif (a == null)\n\t\t\t\treturn null;\n\n\t\t\treturn a.GetCoClassAttributeValue ();\n\t\t}\n\n\t\tpublic AttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa)\n\t\t{\n\t\t\tAttribute a = null;\n\t\t\tif (OptAttributes != null) {\n\t\t\t\ta = OptAttributes.Search (pa);\n\t\t\t}\n\n\t\t\tif (a == null)\n\t\t\t\treturn null;\n\n\t\t\treturn a.GetAttributeUsageAttribute ();\n\t\t}\n\n\t\tpublic virtual CompilationSourceFile GetCompilationSourceFile ()\n\t\t{\n\t\t\tTypeContainer ns = Parent;\n\t\t\twhile (true) {\n\t\t\t\tvar sf = ns as CompilationSourceFile;\n\t\t\t\tif (sf != null)\n\t\t\t\t\treturn sf;\n\n\t\t\t\tns = ns.Parent;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void SetBaseTypes (List<FullNamedExpression> baseTypes)\n\t\t{\n\t\t\ttype_bases = baseTypes;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   This function computes the Base class and also the\n\t\t///   list of interfaces that the class or struct @c implements.\n\t\t///   \n\t\t///   The return value is an array (might be null) of\n\t\t///   interfaces implemented (as Types).\n\t\t///   \n\t\t///   The @base_class argument is set to the base object or null\n\t\t///   if this is `System.Object'. \n\t\t/// </summary>\n\t\tprotected virtual TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tbase_class = null;\n\t\t\tif (type_bases == null)\n\t\t\t\treturn null;\n\n\t\t\tint count = type_bases.Count;\n\t\t\tTypeSpec[] ifaces = null;\n\t\t\tvar base_context = new BaseContext (this);\n\t\t\tfor (int i = 0, j = 0; i < count; i++){\n\t\t\t\tFullNamedExpression fne = type_bases [i];\n\n\t\t\t\tvar fne_resolved = fne.ResolveAsType (base_context);\n\t\t\t\tif (fne_resolved == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (i == 0 && Kind == MemberKind.Class && !fne_resolved.IsInterface) {\n\t\t\t\t\tif (fne_resolved.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\t\tReport.Error (1965, Location, \"Class `{0}' cannot derive from the dynamic type\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbase_type = fne_resolved;\n\t\t\t\t\tbase_class = fne;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (ifaces == null)\n\t\t\t\t\tifaces = new TypeSpec [count - i];\n\n\t\t\t\tif (fne_resolved.IsInterface) {\n\t\t\t\t\tfor (int ii = 0; ii < j; ++ii) {\n\t\t\t\t\t\tif (fne_resolved == ifaces [ii]) {\n\t\t\t\t\t\t\tReport.Error (528, Location, \"`{0}' is already listed in interface list\",\n\t\t\t\t\t\t\t\tfne_resolved.GetSignatureForError ());\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Kind == MemberKind.Interface && !IsAccessibleAs (fne_resolved)) {\n\t\t\t\t\t\tReport.Error (61, fne.Location,\n\t\t\t\t\t\t\t\"Inconsistent accessibility: base interface `{0}' is less accessible than interface `{1}'\",\n\t\t\t\t\t\t\tfne_resolved.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (fne_resolved);\n\t\t\t\t\tif (Kind != MemberKind.Class) {\n\t\t\t\t\t\tReport.Error (527, fne.Location, \"Type `{0}' in interface list is not an interface\", fne_resolved.GetSignatureForError ());\n\t\t\t\t\t} else if (base_class != null)\n\t\t\t\t\t\tReport.Error (1721, fne.Location, \"`{0}': Classes cannot have multiple base classes (`{1}' and `{2}')\",\n\t\t\t\t\t\t\tGetSignatureForError (), base_class.GetSignatureForError (), fne_resolved.GetSignatureForError ());\n\t\t\t\t\telse {\n\t\t\t\t\t\tReport.Error (1722, fne.Location, \"`{0}': Base class `{1}' must be specified as first\",\n\t\t\t\t\t\t\tGetSignatureForError (), fne_resolved.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tifaces [j++] = fne_resolved;\n\t\t\t}\n\n\t\t\treturn ifaces;\n\t\t}\n\n\t\t//\n\t\t// Checks that some operators come in pairs:\n\t\t//  == and !=\n\t\t// > and <\n\t\t// >= and <=\n\t\t// true and false\n\t\t//\n\t\t// They are matched based on the return type and the argument types\n\t\t//\n\t\tvoid CheckPairedOperators ()\n\t\t{\n\t\t\tbool has_equality_or_inequality = false;\n\t\t\tList<Operator.OpType> found_matched = new List<Operator.OpType> ();\n\n\t\t\tfor (int i = 0; i < members.Count; ++i) {\n\t\t\t\tvar o_a = members[i] as Operator;\n\t\t\t\tif (o_a == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar o_type = o_a.OperatorType;\n\t\t\t\tif (o_type == Operator.OpType.Equality || o_type == Operator.OpType.Inequality)\n\t\t\t\t\thas_equality_or_inequality = true;\n\n\t\t\t\tif (found_matched.Contains (o_type))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar matching_type = o_a.GetMatchingOperator ();\n\t\t\t\tif (matching_type == Operator.OpType.TOP) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbool pair_found = false;\n\t\t\t\tfor (int ii = 0; ii < members.Count; ++ii) {\n\t\t\t\t\tvar o_b = members[ii] as Operator;\n\t\t\t\t\tif (o_b == null || o_b.OperatorType != matching_type)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!TypeSpecComparer.IsEqual (o_a.ReturnType, o_b.ReturnType))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!TypeSpecComparer.Equals (o_a.ParameterTypes, o_b.ParameterTypes))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tfound_matched.Add (matching_type);\n\t\t\t\t\tpair_found = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!pair_found) {\n\t\t\t\t\tReport.Error (216, o_a.Location,\n\t\t\t\t\t\t\"The operator `{0}' requires a matching operator `{1}' to also be defined\",\n\t\t\t\t\t\to_a.GetSignatureForError (), Operator.GetName (matching_type));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (has_equality_or_inequality) {\n\t\t\t\tif (!HasEquals)\n\t\t\t\t\tReport.Warning (660, 2, Location, \"`{0}' defines operator == or operator != but does not override Object.Equals(object o)\",\n\t\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\tif (!HasGetHashCode)\n\t\t\t\t\tReport.Warning (661, 2, Location, \"`{0}' defines operator == or operator != but does not override Object.GetHashCode()\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic override void CreateMetadataName (StringBuilder sb)\n\t\t{\n\t\t\tif (Parent.MemberName != null) {\n\t\t\t\tParent.CreateMetadataName (sb);\n\n\t\t\t\tif (sb.Length != 0) {\n\t\t\t\t\tsb.Append (\".\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsb.Append (MemberName.Basename);\n\t\t}\n\t\n\t\tbool CreateTypeBuilder ()\n\t\t{\n\t\t\t//\n\t\t\t// Sets .size to 1 for structs with no instance fields\n\t\t\t//\n\t\t\tint type_size = Kind == MemberKind.Struct && first_nonstatic_field == null && !(this is StateMachine) ? 1 : 0;\n\n\t\t\tvar parent_def = Parent as TypeDefinition;\n\t\t\tif (parent_def == null) {\n\t\t\t\tvar sb = new StringBuilder ();\n\t\t\t\tCreateMetadataName (sb);\n\t\t\t\tTypeBuilder = Module.CreateBuilder (sb.ToString (), TypeAttr, type_size);\n\t\t\t} else {\n\t\t\t\tTypeBuilder = parent_def.TypeBuilder.DefineNestedType (Basename, TypeAttr, null, type_size);\n\t\t\t}\n\n\t\t\tif (DeclaringAssembly.Importer != null)\n\t\t\t\tDeclaringAssembly.Importer.AddCompiledType (TypeBuilder, spec);\n\n\t\t\tspec.SetMetaInfo (TypeBuilder);\n\t\t\tspec.MemberCache = new MemberCache (this);\n\n\t\t\tTypeParameters parentAllTypeParameters = null;\n\t\t\tif (parent_def != null) {\n\t\t\t\tspec.DeclaringType = Parent.CurrentType;\n\t\t\t\tparent_def.MemberCache.AddMember (spec);\n\t\t\t\tparentAllTypeParameters = parent_def.all_type_parameters;\n\t\t\t}\n\n\t\t\tif (MemberName.TypeParameters != null || parentAllTypeParameters != null) {\n\t\t\t\tvar tparam_names = CreateTypeParameters (parentAllTypeParameters);\n\n\t\t\t\tall_tp_builders = TypeBuilder.DefineGenericParameters (tparam_names);\n\n\t\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\t\tCurrentTypeParameters.Create (spec, CurrentTypeParametersStartIndex, this);\n\t\t\t\t\tCurrentTypeParameters.Define (all_tp_builders);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tstring[] CreateTypeParameters (TypeParameters parentAllTypeParameters)\n\t\t{\n\t\t\tstring[] names;\n\t\t\tint parent_offset = 0;\n\t\t\tif (parentAllTypeParameters != null) {\n\t\t\t\tif (CurrentTypeParameters == null) {\n\t\t\t\t\tall_type_parameters = parentAllTypeParameters;\n\t\t\t\t\treturn parentAllTypeParameters.GetAllNames ();\n\t\t\t\t}\n\n\t\t\t\tnames = new string[parentAllTypeParameters.Count + CurrentTypeParameters.Count];\n\t\t\t\tall_type_parameters = new TypeParameters (names.Length);\n\t\t\t\tall_type_parameters.Add (parentAllTypeParameters);\n\n\t\t\t\tparent_offset = all_type_parameters.Count;\n\t\t\t\tfor (int i = 0; i < parent_offset; ++i)\n\t\t\t\t\tnames[i] = all_type_parameters[i].MemberName.Name;\n\n\t\t\t} else {\n\t\t\t\tnames = new string[CurrentTypeParameters.Count];\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\tif (all_type_parameters != null)\n\t\t\t\t\tall_type_parameters.Add (MemberName.TypeParameters[i]);\n\n\t\t\t\tvar name = CurrentTypeParameters[i].MemberName.Name;\n\t\t\t\tnames[parent_offset + i] = name;\n\t\t\t\tfor (int ii = 0; ii < parent_offset + i; ++ii) {\n\t\t\t\t\tif (names[ii] != name)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar tp = CurrentTypeParameters[i];\n\t\t\t\t\tvar conflict = all_type_parameters[ii];\n\n\t\t\t\t\ttp.WarningParentNameConflict (conflict);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (all_type_parameters == null)\n\t\t\t\tall_type_parameters = CurrentTypeParameters;\n\n\t\t\treturn names;\n\t\t}\n\n\n\t\tpublic SourceMethodBuilder CreateMethodSymbolEntry ()\n\t\t{\n\t\t\tif (Module.DeclaringAssembly.SymbolWriter == null || (ModFlags & Modifiers.DEBUGGER_HIDDEN) != 0)\n\t\t\t\treturn null;\n\n\t\t\tvar source_file = GetCompilationSourceFile ();\n\t\t\tif (source_file == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new SourceMethodBuilder (source_file.SymbolUnitEntry);\n\t\t}\n\n\t\t//\n\t\t// Creates a proxy base method call inside this container for hoisted base member calls\n\t\t//\n\t\tpublic MethodSpec CreateHoistedBaseCallProxy (ResolveContext rc, MethodSpec method)\n\t\t{\n\t\t\tMethod proxy_method;\n\n\t\t\t//\n\t\t\t// One proxy per base method is enough\n\t\t\t//\n\t\t\tif (hoisted_base_call_proxies == null) {\n\t\t\t\thoisted_base_call_proxies = new Dictionary<MethodSpec, Method> ();\n\t\t\t\tproxy_method = null;\n\t\t\t} else {\n\t\t\t\thoisted_base_call_proxies.TryGetValue (method, out proxy_method);\n\t\t\t}\n\n\t\t\tif (proxy_method == null) {\n\t\t\t\tstring name = CompilerGeneratedContainer.MakeName (method.Name, null, \"BaseCallProxy\", hoisted_base_call_proxies.Count);\n\n\t\t\t\tMemberName member_name;\n\t\t\t\tTypeArguments targs = null;\n\t\t\t\tTypeSpec return_type = method.ReturnType;\n\t\t\t\tvar local_param_types = method.Parameters.Types;\n\n\t\t\t\tif (method.IsGeneric) {\n\t\t\t\t\t//\n\t\t\t\t\t// Copy all base generic method type parameters info\n\t\t\t\t\t//\n\t\t\t\t\tvar hoisted_tparams = method.GenericDefinition.TypeParameters;\n\t\t\t\t\tvar tparams = new TypeParameters ();\n\n\t\t\t\t\ttargs = new TypeArguments ();\n\t\t\t\t\ttargs.Arguments = new TypeSpec[hoisted_tparams.Length];\n\t\t\t\t\tfor (int i = 0; i < hoisted_tparams.Length; ++i) {\n\t\t\t\t\t\tvar tp = hoisted_tparams[i];\n\t\t\t\t\t\tvar local_tp = new TypeParameter (tp, null, new MemberName (tp.Name, Location), null);\n\t\t\t\t\t\ttparams.Add (local_tp);\n\n\t\t\t\t\t\ttargs.Add (new SimpleName (tp.Name, Location));\n\t\t\t\t\t\ttargs.Arguments[i] = local_tp.Type;\n\t\t\t\t\t}\n\n\t\t\t\t\tmember_name = new MemberName (name, tparams, Location);\n\n\t\t\t\t\t//\n\t\t\t\t\t// Mutate any method type parameters from original\n\t\t\t\t\t// to newly created hoisted version\n\t\t\t\t\t//\n\t\t\t\t\tvar mutator = new TypeParameterMutator (hoisted_tparams, tparams);\n\t\t\t\t\treturn_type = mutator.Mutate (return_type);\n\t\t\t\t\tlocal_param_types = mutator.Mutate (local_param_types);\n\t\t\t\t} else {\n\t\t\t\t\tmember_name = new MemberName (name);\n\t\t\t\t}\n\n\t\t\t\tvar base_parameters = new Parameter[method.Parameters.Count];\n\t\t\t\tfor (int i = 0; i < base_parameters.Length; ++i) {\n\t\t\t\t\tvar base_param = method.Parameters.FixedParameters[i];\n\t\t\t\t\tbase_parameters[i] = new Parameter (new TypeExpression (local_param_types [i], Location),\n\t\t\t\t\t\tbase_param.Name, base_param.ModFlags, null, Location);\n\t\t\t\t\tbase_parameters[i].Resolve (this, i);\n\t\t\t\t}\n\n\t\t\t\tvar cloned_params = ParametersCompiled.CreateFullyResolved (base_parameters, method.Parameters.Types);\n\t\t\t\tif (method.Parameters.HasArglist) {\n\t\t\t\t\tcloned_params.FixedParameters[0] = new Parameter (null, \"__arglist\", Parameter.Modifier.NONE, null, Location);\n\t\t\t\t\tcloned_params.Types[0] = Module.PredefinedTypes.RuntimeArgumentHandle.Resolve ();\n\t\t\t\t}\n\n\t\t\t\t// Compiler generated proxy\n\t\t\t\tproxy_method = new Method (this, new TypeExpression (return_type, Location),\n\t\t\t\t\tModifiers.PRIVATE | Modifiers.COMPILER_GENERATED | Modifiers.DEBUGGER_HIDDEN,\n\t\t\t\t\tmember_name, cloned_params, null);\n\n\t\t\t\tvar block = new ToplevelBlock (Compiler, proxy_method.ParameterInfo, Location) {\n\t\t\t\t\tIsCompilerGenerated = true\n\t\t\t\t};\n\n\t\t\t\tvar mg = MethodGroupExpr.CreatePredefined (method, method.DeclaringType, Location);\n\t\t\t\tmg.InstanceExpression = new BaseThis (method.DeclaringType, Location);\n\t\t\t\tif (targs != null)\n\t\t\t\t\tmg.SetTypeArguments (rc, targs);\n\n\t\t\t\t// Get all the method parameters and pass them as arguments\n\t\t\t\tvar real_base_call = new Invocation (mg, block.GetAllParametersArguments ());\n\t\t\t\tStatement statement;\n\t\t\t\tif (method.ReturnType.Kind == MemberKind.Void)\n\t\t\t\t\tstatement = new StatementExpression (real_base_call);\n\t\t\t\telse\n\t\t\t\t\tstatement = new Return (real_base_call, Location);\n\n\t\t\t\tblock.AddStatement (statement);\n\t\t\t\tproxy_method.Block = block;\n\n\t\t\t\tmembers.Add (proxy_method);\n\t\t\t\tproxy_method.Define ();\n\t\t\t\tproxy_method.PrepareEmit ();\n\n\t\t\t\thoisted_base_call_proxies.Add (method, proxy_method);\n\t\t\t}\n\n\t\t\treturn proxy_method.Spec;\n\t\t}\n\n\t\tprotected bool DefineBaseTypes ()\n\t\t{\n\t\t\tif (IsPartialPart && Kind == MemberKind.Class)\n\t\t\t\treturn true;\n\n\t\t\treturn DoDefineBaseType ();\n\t\t}\n\n\t\tbool DoDefineBaseType ()\n\t\t{\n\t\t\tiface_exprs = ResolveBaseTypes (out base_type_expr);\n\t\t\tbool set_base_type;\n\n\t\t\tif (IsPartialPart) {\n\t\t\t\tset_base_type = false;\n\n\t\t\t\tif (base_type_expr != null) {\n\t\t\t\t\tif (PartialContainer.base_type_expr != null && PartialContainer.base_type != base_type) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_type_expr.Location, \"\");\n\t\t\t\t\t\tReport.Error (263, Location,\n\t\t\t\t\t\t\t\"Partial declarations of `{0}' must not specify different base classes\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPartialContainer.base_type_expr = base_type_expr;\n\t\t\t\t\t\tPartialContainer.base_type = base_type;\n\t\t\t\t\t\tset_base_type = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (iface_exprs != null) {\n\t\t\t\t\tif (PartialContainer.iface_exprs == null)\n\t\t\t\t\t\tPartialContainer.iface_exprs = iface_exprs;\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar ifaces = new List<TypeSpec> (PartialContainer.iface_exprs);\n\t\t\t\t\t\tforeach (var iface_partial in iface_exprs) {\n\t\t\t\t\t\t\tif (ifaces.Contains (iface_partial))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tifaces.Add (iface_partial);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tPartialContainer.iface_exprs = ifaces.ToArray ();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tPartialContainer.members.AddRange (members);\n\t\t\t\tif (containers != null) {\n\t\t\t\t\tif (PartialContainer.containers == null)\n\t\t\t\t\t\tPartialContainer.containers = new List<TypeContainer> ();\n\n\t\t\t\t\tPartialContainer.containers.AddRange (containers);\n\t\t\t\t}\n\n\t\t\t\tif (PrimaryConstructorParameters != null) {\n\t\t\t\t\tif (PartialContainer.PrimaryConstructorParameters != null) {\n\t\t\t\t\t\tReport.Error (8036, Location, \"Only one part of a partial type can declare primary constructor parameters\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPartialContainer.PrimaryConstructorParameters = PrimaryConstructorParameters;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmembers_defined = members_defined_ok = true;\n\t\t\t\tcaching_flags |= Flags.CloseTypeCreated;\n\t\t\t} else {\n\t\t\t\tset_base_type = true;\n\t\t\t}\n\n\t\t\tvar cycle = CheckRecursiveDefinition (this);\n\t\t\tif (cycle != null) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (cycle);\n\t\t\t\tif (this is Interface) {\n\t\t\t\t\tReport.Error (529, Location,\n\t\t\t\t\t\t\"Inherited interface `{0}' causes a cycle in the interface hierarchy of `{1}'\",\n\t\t\t\t\t    GetSignatureForError (), cycle.GetSignatureForError ());\n\n\t\t\t\t\tiface_exprs = null;\n\t\t\t\t\tPartialContainer.iface_exprs = null;\n\t\t\t\t} else {\n\t\t\t\t\tReport.Error (146, Location,\n\t\t\t\t\t\t\"Circular base class dependency involving `{0}' and `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), cycle.GetSignatureForError ());\n\n\t\t\t\t\tbase_type = null;\n\t\t\t\t\tPartialContainer.base_type = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (iface_exprs != null) {\n\t\t\t\tif (!PrimaryConstructorBaseArgumentsStart.IsNull) {\n\t\t\t\t\tReport.Error (8049, PrimaryConstructorBaseArgumentsStart, \"Implemented interfaces cannot have arguments\");\n\t\t\t\t}\n\n\t\t\t\tforeach (var iface_type in iface_exprs) {\n\t\t\t\t\t// Prevents a crash, the interface might not have been resolved: 442144\n\t\t\t\t\tif (iface_type == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tif (!spec.AddInterfaceDefined (iface_type))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tTypeBuilder.AddInterfaceImplementation (iface_type.GetMetaInfo ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Kind == MemberKind.Interface) {\n\t\t\t\tspec.BaseType = Compiler.BuiltinTypes.Object;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (set_base_type) {\n\t\t\t\tSetBaseType ();\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Base type of partial container has to be resolved before we\n\t\t\t// resolve any nested types of the container. We need to know\n\t\t\t// partial parts because the base type can be specified in file\n\t\t\t// defined after current container\n\t\t\t//\n\t\t\tif (class_partial_parts != null) {\n\t\t\t\tforeach (var pp in class_partial_parts) {\n\t\t\t\t\tif (pp.PrimaryConstructorBaseArguments != null)\n\t\t\t\t\t\tPrimaryConstructorBaseArguments = pp.PrimaryConstructorBaseArguments;\n\n\t\t\t\t\tpp.DoDefineBaseType ();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid SetBaseType ()\n\t\t{\n\t\t\tif (base_type == null) {\n\t\t\t\tTypeBuilder.SetParent (null);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (spec.BaseType == base_type)\n\t\t\t\treturn;\n\n\t\t\tspec.BaseType = base_type;\n\n\t\t\tif (IsPartialPart)\n\t\t\t\tspec.UpdateInflatedInstancesBaseType ();\n\n\t\t\t// Set base type after type creation\n\t\t\tTypeBuilder.SetParent (base_type.GetMetaInfo ());\n\t\t}\n\n\t\tpublic override void ExpandBaseInterfaces ()\n\t\t{\n\t\t\tif (!IsPartialPart)\n\t\t\t\tDoExpandBaseInterfaces ();\n\n\t\t\tbase.ExpandBaseInterfaces ();\n\t\t}\n\n\t\tpublic void DoExpandBaseInterfaces ()\n\t\t{\n\t\t\tif ((caching_flags & Flags.InterfacesExpanded) != 0)\n\t\t\t\treturn;\n\n\t\t\tcaching_flags |= Flags.InterfacesExpanded;\n\n\t\t\t//\n\t\t\t// Expand base interfaces. It cannot be done earlier because all partial\n\t\t\t// interface parts need to be defined before the type they are used from\n\t\t\t//\n\t\t\tif (iface_exprs != null) {\n\t\t\t\tforeach (var iface in iface_exprs) {\n\t\t\t\t\tif (iface == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar td = iface.MemberDefinition as TypeDefinition;\n\t\t\t\t\tif (td != null)\n\t\t\t\t\t\ttd.DoExpandBaseInterfaces ();\n\n\t\t\t\t\tif (iface.Interfaces == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tforeach (var biface in iface.Interfaces) {\n\t\t\t\t\t\tif (spec.AddInterfaceDefined (biface)) {\n\t\t\t\t\t\t\tTypeBuilder.AddInterfaceImplementation (biface.GetMetaInfo ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Include all base type interfaces too, see ImportTypeBase for details\n\t\t\t//\n\t\t\tif (base_type != null) {\n\t\t\t\tvar td = base_type.MemberDefinition as TypeDefinition;\n\t\t\t\tif (td != null)\n\t\t\t\t\ttd.DoExpandBaseInterfaces ();\n\n\t\t\t\t//\n\t\t\t\t// Simply use base interfaces only, they are all expanded which makes\n\t\t\t\t// it easy to handle generic type argument propagation with single\n\t\t\t\t// inflator only.\n\t\t\t\t//\n\t\t\t\t// interface IA<T> : IB<T>\n\t\t\t\t// interface IB<U> : IC<U>\n\t\t\t\t// interface IC<V>\n\t\t\t\t//\n\t\t\t\tif (base_type.Interfaces != null) {\n\t\t\t\t\tforeach (var iface in base_type.Interfaces) {\n\t\t\t\t\t\tspec.AddInterfaceDefined (iface);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void PrepareEmit ()\n\t\t{\n\t\t\tif ((caching_flags & Flags.CloseTypeCreated) != 0)\n\t\t\t\treturn;\n\n\t\t\tforeach (var member in members) {\n\t\t\t\tvar pbm = member as PropertyBasedMember;\n\t\t\t\tif (pbm != null)\n\t\t\t\t\tpbm.PrepareEmit ();\n\n\t\t\t\tvar pm = member as IParametersMember;\n\t\t\t\tif (pm != null) {\n\t\t\t\t\tvar mc = member as MethodOrOperator;\n\t\t\t\t\tif (mc != null) {\n\t\t\t\t\t\tmc.PrepareEmit ();\n\t\t\t\t\t}\n\n\t\t\t\t\tvar p = pm.Parameters;\n\t\t\t\t\tif (p.IsEmpty)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t((ParametersCompiled) p).ResolveDefaultValues (member);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar c = member as Const;\n\t\t\t\tif (c != null)\n\t\t\t\t\tc.DefineValue ();\n\t\t\t}\n\n\t\t\tbase.PrepareEmit ();\n\t\t}\n\n\t\t//\n\t\t// Defines the type in the appropriate ModuleBuilder or TypeBuilder.\n\t\t//\n\t\tpublic override bool CreateContainer ()\n\t\t{\n\t\t\tif (TypeBuilder != null)\n\t\t\t\treturn !error;\n\n\t\t\tif (error)\n\t\t\t\treturn false;\n\n\t\t\tif (IsPartialPart) {\n\t\t\t\tspec = PartialContainer.spec;\n\t\t\t\tTypeBuilder = PartialContainer.TypeBuilder;\n\t\t\t\tall_tp_builders = PartialContainer.all_tp_builders;\n\t\t\t\tall_type_parameters = PartialContainer.all_type_parameters;\n\t\t\t} else {\n\t\t\t\tif (!CreateTypeBuilder ()) {\n\t\t\t\t\terror = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.CreateContainer ();\n\t\t}\n\n\t\tprotected override void DoDefineContainer ()\n\t\t{\n\t\t\tDefineBaseTypes ();\n\n\t\t\tDoResolveTypeParameters ();\n\t\t}\n\n\t\t//\n\t\t// Replaces normal spec with predefined one when compiling corlib\n\t\t// and this type container defines predefined type\n\t\t//\n\t\tpublic void SetPredefinedSpec (BuiltinTypeSpec spec)\n\t\t{\n\t\t\t// When compiling build-in types we start with two\n\t\t\t// version of same type. One is of BuiltinTypeSpec and\n\t\t\t// second one is ordinary TypeSpec. The unification\n\t\t\t// happens at later stage when we know which type\n\t\t\t// really matches the builtin type signature. However\n\t\t\t// that means TypeSpec create during CreateType of this\n\t\t\t// type has to be replaced with builtin one\n\t\t\t// \n\t\t\tspec.SetMetaInfo (TypeBuilder);\n\t\t\tspec.MemberCache = this.spec.MemberCache;\n\t\t\tspec.DeclaringType = this.spec.DeclaringType;\n\n\t\t\tthis.spec = spec;\n\t\t\tcurrent_type = null;\n\t\t}\n\n\t\tpublic override void RemoveContainer (TypeContainer cont)\n\t\t{\n\t\t\tbase.RemoveContainer (cont);\n\t\t\tMembers.Remove (cont);\n\t\t\tCache.Remove (cont.Basename);\n\t\t}\n\n\t\tprotected virtual bool DoResolveTypeParameters ()\n\t\t{\n\t\t\tvar tparams = MemberName.TypeParameters;\n\t\t\tif (tparams == null)\n\t\t\t\treturn true;\n\n\t\t\tvar base_context = new BaseContext (this);\n\t\t\tfor (int i = 0; i < tparams.Count; ++i) {\n\t\t\t\tvar tp = tparams[i];\n\n\t\t\t\tif (!tp.ResolveConstraints (base_context)) {\n\t\t\t\t\terror = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (IsPartialPart) {\n\t\t\t\t\tvar pc_tp = PartialContainer.CurrentTypeParameters [i];\n\n\t\t\t\t\ttp.Create (spec, this);\n\t\t\t\t\ttp.Define (pc_tp);\n\n\t\t\t\t\tif (tp.OptAttributes != null) {\n\t\t\t\t\t\tif (pc_tp.OptAttributes == null)\n\t\t\t\t\t\t\tpc_tp.OptAttributes = tp.OptAttributes;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tpc_tp.OptAttributes.Attrs.AddRange (tp.OptAttributes.Attrs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (IsPartialPart) {\n\t\t\t\tPartialContainer.CurrentTypeParameters.UpdateConstraints (this);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tTypeSpec CheckRecursiveDefinition (TypeDefinition tc)\n\t\t{\n\t\t\tif (InTransit != null)\n\t\t\t\treturn spec;\n\n\t\t\tInTransit = tc;\n\n\t\t\tif (base_type != null) {\n\t\t\t\tvar ptc = base_type.MemberDefinition as TypeDefinition;\n\t\t\t\tif (ptc != null && ptc.CheckRecursiveDefinition (this) != null)\n\t\t\t\t\treturn base_type;\n\t\t\t}\n\n\t\t\tif (iface_exprs != null) {\n\t\t\t\tforeach (var iface in iface_exprs) {\n\t\t\t\t\t// the interface might not have been resolved, prevents a crash, see #442144\n\t\t\t\t\tif (iface == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar ptc = iface.MemberDefinition as Interface;\n\t\t\t\t\tif (ptc != null && ptc.CheckRecursiveDefinition (this) != null)\n\t\t\t\t\t\treturn iface;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!IsTopLevel && Parent.PartialContainer.CheckRecursiveDefinition (this) != null)\n\t\t\t\treturn spec;\n\n\t\t\tInTransit = null;\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Populates our TypeBuilder with fields and methods\n\t\t/// </summary>\n\t\tpublic sealed override bool Define ()\n\t\t{\n\t\t\tif (members_defined)\n\t\t\t\treturn members_defined_ok;\n\n\t\t\tmembers_defined_ok = DoDefineMembers ();\n\t\t\tmembers_defined = true;\n\n\t\t\tbase.Define ();\n\n\t\t\treturn members_defined_ok;\n\t\t}\n\n\t\tprotected virtual bool DoDefineMembers ()\n\t\t{\n\t\t\tDebug.Assert (!IsPartialPart);\n\n\t\t\tif (iface_exprs != null) {\n\t\t\t\tforeach (var iface_type in iface_exprs) {\n\t\t\t\t\tif (iface_type == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// Ensure the base is always setup\n\t\t\t\t\tvar compiled_iface = iface_type.MemberDefinition as Interface;\n\t\t\t\t\tif (compiled_iface != null)\n\t\t\t\t\t\tcompiled_iface.Define ();\n\n\t\t\t\t\tObsoleteAttribute oa = iface_type.GetAttributeObsolete ();\n\t\t\t\t\tif (oa != null && !IsObsolete)\n\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, iface_type.GetSignatureForError (), Location, Report);\n\n\t\t\t\t\tif (iface_type.Arity > 0) {\n\t\t\t\t\t\t// TODO: passing `this' is wrong, should be base type iface instead\n\t\t\t\t\t\tVarianceDecl.CheckTypeVariance (iface_type, Variance.Covariant, this);\n\n\t\t\t\t\t\tif (((InflatedTypeSpec) iface_type).HasDynamicArgument () && !IsCompilerGenerated) {\n\t\t\t\t\t\t\tReport.Error (1966, Location,\n\t\t\t\t\t\t\t\t\"`{0}': cannot implement a dynamic interface `{1}'\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), iface_type.GetSignatureForError ());\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (iface_type.IsGenericOrParentIsGeneric) {\n\t\t\t\t\t\tforeach (var prev_iface in iface_exprs) {\n\t\t\t\t\t\t\tif (prev_iface == iface_type || prev_iface == null)\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tif (!TypeSpecComparer.Unify.IsEqual (iface_type, prev_iface))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tReport.Error (695, Location,\n\t\t\t\t\t\t\t\t\"`{0}' cannot implement both `{1}' and `{2}' because they may unify for some type parameter substitutions\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), prev_iface.GetSignatureForError (), iface_type.GetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (Kind == MemberKind.Interface) {\n\t\t\t\t\tforeach (var iface in spec.Interfaces) {\n\t\t\t\t\t\tMemberCache.AddInterface (iface);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (base_type != null) {\n\t\t\t\t//\n\t\t\t\t// Run checks skipped during DefineType (e.g FullNamedExpression::ResolveAsType)\n\t\t\t\t//\n\t\t\t\tif (base_type_expr != null) {\n\t\t\t\t\tObsoleteAttribute obsolete_attr = base_type.GetAttributeObsolete ();\n\t\t\t\t\tif (obsolete_attr != null && !IsObsolete)\n\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (obsolete_attr, base_type.GetSignatureForError (), base_type_expr.Location, Report);\n\n\t\t\t\t\tif (IsGenericOrParentIsGeneric && base_type.IsAttribute) {\n\t\t\t\t\t\tReport.Error (698, base_type_expr.Location,\n\t\t\t\t\t\t\t\"A generic type cannot derive from `{0}' because it is an attribute class\",\n\t\t\t\t\t\t\tbase_type.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar baseContainer = base_type.MemberDefinition as ClassOrStruct;\n\t\t\t\tif (baseContainer != null) {\n\t\t\t\t\tbaseContainer.Define ();\n\n\t\t\t\t\t//\n\t\t\t\t\t// It can trigger define of this type (for generic types only)\n\t\t\t\t\t//\n\t\t\t\t\tif (HasMembersDefined)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Kind == MemberKind.Struct || Kind == MemberKind.Class) {\n\t\t\t\tpending = PendingImplementation.GetPendingImplementations (this);\n\t\t\t}\n\n\t\t\tvar count = members.Count;\t\t\n\t\t\tfor (int i = 0; i < count; ++i) {\n\t\t\t\tvar mc = members[i] as InterfaceMemberBase;\n\t\t\t\tif (mc == null || !mc.IsExplicitImpl)\n\t\t\t\t\tcontinue;\n\n\t\t\t\ttry {\n\t\t\t\t\tmc.Define ();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new InternalErrorException (mc, e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < count; ++i) {\n\t\t\t\tvar mc = members[i] as InterfaceMemberBase;\n\t\t\t\tif (mc != null && mc.IsExplicitImpl)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (members[i] is TypeContainer)\n\t\t\t\t\tcontinue;\n\n\t\t\t\ttry {\n\t\t\t\t\tmembers[i].Define ();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new InternalErrorException (members[i], e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (HasOperators) {\n\t\t\t\tCheckPairedOperators ();\n\t\t\t}\n\n\t\t\tif (requires_delayed_unmanagedtype_check) {\n\t\t\t\trequires_delayed_unmanagedtype_check = false;\n\t\t\t\tforeach (var member in members) {\n\t\t\t\t\tvar f = member as Field;\n\t\t\t\t\tif (f != null && f.MemberType != null && f.MemberType.IsPointer)\n\t\t\t\t\t\tTypeManager.VerifyUnmanaged (Module, f.MemberType, f.Location);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tComputeIndexerName();\n\n\t\t\tif (HasEquals && !HasGetHashCode) {\n\t\t\t\tReport.Warning (659, 3, Location,\n\t\t\t\t\t\"`{0}' overrides Object.Equals(object) but does not override Object.GetHashCode()\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif (Kind == MemberKind.Interface && iface_exprs != null) {\n\t\t\t\tMemberCache.RemoveHiddenMembers (spec);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid ComputeIndexerName ()\n\t\t{\n\t\t\tvar indexers = MemberCache.FindMembers (spec, MemberCache.IndexerNameAlias, true);\n\t\t\tif (indexers == null)\n\t\t\t\treturn;\n\n\t\t\tstring class_indexer_name = null;\n\n\t\t\t//\n\t\t\t// Check normal indexers for consistent name, explicit interface implementation\n\t\t\t// indexers are ignored\n\t\t\t//\n\t\t\tforeach (var indexer in indexers) {\n\t\t\t\t//\n\t\t\t\t// FindMembers can return unfiltered full hierarchy names\n\t\t\t\t//\n\t\t\t\tif (indexer.DeclaringType != spec)\n\t\t\t\t\tcontinue;\n\n\t\t\t\thas_normal_indexers = true;\n\n\t\t\t\tif (class_indexer_name == null) {\n\t\t\t\t\tindexer_name = class_indexer_name = indexer.Name;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (indexer.Name != class_indexer_name)\n\t\t\t\t\tReport.Error (668, ((Indexer)indexer.MemberDefinition).Location,\n\t\t\t\t\t\t\"Two indexers have different names; the IndexerName attribute must be used with the same name on every indexer within a type\");\n\t\t\t}\n\t\t}\n\n\t\tvoid EmitIndexerName ()\n\t\t{\n\t\t\tif (!has_normal_indexers)\n\t\t\t\treturn;\n\n\t\t\tvar ctor = Module.PredefinedMembers.DefaultMemberAttributeCtor.Get ();\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tvar encoder = new AttributeEncoder ();\n\t\t\tencoder.Encode (GetAttributeDefaultMember ());\n\t\t\tencoder.EncodeEmptyNamedArguments ();\n\n\t\t\tTypeBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\t\t}\n\n\t\tpublic override void VerifyMembers ()\n\t\t{\n\t\t\t//\n\t\t\t// Check for internal or private fields that were never assigned\n\t\t\t//\n\t\t\tif (!IsCompilerGenerated && Compiler.Settings.WarningLevel >= 3 && this == PartialContainer) {\n\t\t\t\tbool is_type_exposed = Kind == MemberKind.Struct || IsExposedFromAssembly ();\n\t\t\t\tforeach (var member in members) {\n\t\t\t\t\tif (member is Event) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// An event can be assigned from same class only, report\n\t\t\t\t\t\t// this warning for all accessibility modes\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (!member.IsUsed && !PartialContainer.HasStructLayout)\n\t\t\t\t\t\t\tReport.Warning (67, 3, member.Location, \"The event `{0}' is never used\", member.GetSignatureForError ());\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((member.ModFlags & Modifiers.AccessibilityMask) != Modifiers.PRIVATE) {\n\t\t\t\t\t\tif (is_type_exposed)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tmember.SetIsUsed ();\n\t\t\t\t\t}\n\n\t\t\t\t\tvar f = member as Field;\n\t\t\t\t\tif (f == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!member.IsUsed) {\n\t\t\t\t\t\tif (!PartialContainer.HasStructLayout) {\n\t\t\t\t\t\t\tif ((member.caching_flags & Flags.IsAssigned) == 0) {\n\t\t\t\t\t\t\t\tReport.Warning (169, 3, member.Location, \"The private field `{0}' is never used\", member.GetSignatureForError ());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tReport.Warning (414, 3, member.Location, \"The private field `{0}' is assigned but its value is never used\",\n\t\t\t\t\t\t\t\t\tmember.GetSignatureForError ());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((f.caching_flags & Flags.IsAssigned) != 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Only report 649 on level 4\n\t\t\t\t\t//\n\t\t\t\t\tif (Compiler.Settings.WarningLevel < 4)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Don't be pedantic when type requires specific layout\n\t\t\t\t\t//\n\t\t\t\t\tif (f.OptAttributes != null || PartialContainer.HasStructLayout)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tConstant c = New.Constantify (f.MemberType, f.Location);\n\t\t\t\t\tstring value;\n\t\t\t\t\tif (c != null) {\n\t\t\t\t\t\tvalue = c.GetValueAsLiteral ();\n\t\t\t\t\t} else if (TypeSpec.IsReferenceType (f.MemberType)) {\n\t\t\t\t\t\tvalue = \"null\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (value != null)\n\t\t\t\t\t\tvalue = \" `\" + value + \"'\";\n\n\t\t\t\t\tReport.Warning (649, 4, f.Location, \"Field `{0}' is never assigned to, and will always have its default value{1}\",\n\t\t\t\t\t\tf.GetSignatureForError (), value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.VerifyMembers ();\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tif (!IsCompilerGenerated) {\n\t\t\t\tif (!IsTopLevel) {\n\t\t\t\t\tMemberSpec candidate;\n\t\t\t\t\tbool overrides = false;\n\t\t\t\t\tvar conflict_symbol = MemberCache.FindBaseMember (this, out candidate, ref overrides);\n\t\t\t\t\tif (conflict_symbol == null && candidate == null) {\n\t\t\t\t\t\tif ((ModFlags & Modifiers.NEW) != 0)\n\t\t\t\t\t\t\tReport.Warning (109, 4, Location, \"The member `{0}' does not hide an inherited member. The new keyword is not required\",\n\t\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((ModFlags & Modifiers.NEW) == 0) {\n\t\t\t\t\t\t\tif (candidate == null)\n\t\t\t\t\t\t\t\tcandidate = conflict_symbol;\n\n\t\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (candidate);\n\t\t\t\t\t\t\tReport.Warning (108, 2, Location, \"`{0}' hides inherited member `{1}'. Use the new keyword if hiding was intended\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), candidate.GetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Run constraints check on all possible generic types\n\t\t\t\tif (base_type != null && base_type_expr != null) {\n\t\t\t\t\tConstraintChecker.Check (this, base_type, base_type_expr.Location);\n\t\t\t\t}\n\n\t\t\t\tif (iface_exprs != null) {\n\t\t\t\t\tforeach (var iface_type in iface_exprs) {\n\t\t\t\t\t\tif (iface_type == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tConstraintChecker.Check (this, iface_type, Location);\t// TODO: Location is wrong\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (all_tp_builders != null) {\n\t\t\t\tint current_starts_index = CurrentTypeParametersStartIndex;\n\t\t\t\tfor (int i = 0; i < all_tp_builders.Length; i++) {\n\t\t\t\t\tif (i < current_starts_index) {\n\t\t\t\t\t\tall_type_parameters[i].EmitConstraints (all_tp_builders [i]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar tp = CurrentTypeParameters [i - current_starts_index];\n\t\t\t\t\t\ttp.CheckGenericConstraints (!IsObsolete);\n\t\t\t\t\t\ttp.Emit ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((ModFlags & Modifiers.COMPILER_GENERATED) != 0 && !Parent.IsCompilerGenerated)\n\t\t\t\tModule.PredefinedAttributes.CompilerGenerated.EmitAttribute (TypeBuilder);\n\n#if STATIC\n\t\t\tif ((TypeBuilder.Attributes & TypeAttributes.StringFormatMask) == 0 && Module.HasDefaultCharSet)\n\t\t\t\tTypeBuilder.__SetAttributes (TypeBuilder.Attributes | Module.DefaultCharSetType);\n#endif\n\n\t\t\tbase.Emit ();\n\n\t\t\tfor (int i = 0; i < members.Count; i++) {\n\t\t\t\tvar m = members[i];\n\t\t\t\tif ((m.caching_flags & Flags.CloseTypeCreated) != 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tm.Emit ();\n\t\t\t}\n\n\t\t\tEmitIndexerName ();\n\t\t\tCheckAttributeClsCompliance ();\n\n\t\t\tif (pending != null)\n\t\t\t\tpending.VerifyPendingMethods ();\n\t\t}\n\n\n\t\tvoid CheckAttributeClsCompliance ()\n\t\t{\n\t\t\tif (!spec.IsAttribute || !IsExposedFromAssembly () || !Compiler.Settings.VerifyClsCompliance || !IsClsComplianceRequired ())\n\t\t\t\treturn;\n\n\t\t\tforeach (var m in members) {\n\t\t\t\tvar c = m as Constructor;\n\t\t\t\tif (c == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (c.HasCompliantArgs)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tReport.Warning (3015, 1, Location, \"`{0}' has no accessible constructors which use only CLS-compliant types\", GetSignatureForError ());\n\t\t}\n\n\t\tpublic sealed override void EmitContainer ()\n\t\t{\n\t\t\tif ((caching_flags & Flags.CloseTypeCreated) != 0)\n\t\t\t\treturn;\n\n\t\t\tEmit ();\n\t\t}\n\n\t\tpublic override void CloseContainer ()\n\t\t{\n\t\t\tif ((caching_flags & Flags.CloseTypeCreated) != 0)\n\t\t\t\treturn;\n\n\t\t\t// Close base type container first to avoid TypeLoadException\n\t\t\tif (spec.BaseType != null) {\n\t\t\t\tvar btype = spec.BaseType.MemberDefinition as TypeContainer;\n\t\t\t\tif (btype != null) {\n\t\t\t\t\tbtype.CloseContainer ();\n\n\t\t\t\t\tif ((caching_flags & Flags.CloseTypeCreated) != 0)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcaching_flags |= Flags.CloseTypeCreated;\n\t\t\t\tTypeBuilder.CreateType ();\n\t\t\t} catch (TypeLoadException) {\n\t\t\t\t//\n\t\t\t\t// This is fine, the code still created the type\n\t\t\t\t//\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (this, e);\n\t\t\t}\n\n\t\t\tbase.CloseContainer ();\n\t\t\t\n\t\t\tcontainers = null;\n\t\t\tinitialized_fields = null;\n\t\t\tinitialized_static_fields = null;\n\t\t\ttype_bases = null;\n\t\t\tOptAttributes = null;\n\t\t}\n\n\t\t//\n\t\t// Performs the validation on a Method's modifiers (properties have\n\t\t// the same properties).\n\t\t//\n\t\t// TODO: Why is it not done at parse stage, move to Modifiers::Check\n\t\t//\n\t\tpublic bool MethodModifiersValid (MemberCore mc)\n\t\t{\n\t\t\tconst Modifiers vao = (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE);\n\t\t\tconst Modifiers nv = (Modifiers.NEW | Modifiers.VIRTUAL);\n\t\t\tbool ok = true;\n\t\t\tvar flags = mc.ModFlags;\n\t\t\t\n\t\t\t//\n\t\t\t// At most one of static, virtual or override\n\t\t\t//\n\t\t\tif ((flags & Modifiers.STATIC) != 0){\n\t\t\t\tif ((flags & vao) != 0){\n\t\t\t\t\tReport.Error (112, mc.Location, \"A static member `{0}' cannot be marked as override, virtual or abstract\",\n\t\t\t\t\t\tmc.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((flags & Modifiers.OVERRIDE) != 0 && (flags & nv) != 0){\n\t\t\t\tReport.Error (113, mc.Location, \"A member `{0}' marked as override cannot be marked as new or virtual\",\n\t\t\t\t\tmc.GetSignatureForError ());\n\t\t\t\tok = false;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// If the declaration includes the abstract modifier, then the\n\t\t\t// declaration does not include static, virtual or extern\n\t\t\t//\n\t\t\tif ((flags & Modifiers.ABSTRACT) != 0){\n\t\t\t\tif ((flags & Modifiers.EXTERN) != 0){\n\t\t\t\t\tReport.Error (\n\t\t\t\t\t\t180, mc.Location, \"`{0}' cannot be both extern and abstract\", mc.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\n\t\t\t\tif ((flags & Modifiers.SEALED) != 0) {\n\t\t\t\t\tReport.Error (502, mc.Location, \"`{0}' cannot be both abstract and sealed\", mc.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\n\t\t\t\tif ((flags & Modifiers.VIRTUAL) != 0){\n\t\t\t\t\tReport.Error (503, mc.Location, \"The abstract method `{0}' cannot be marked virtual\", mc.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\n\t\t\t\tif ((ModFlags & Modifiers.ABSTRACT) == 0){\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (this);\n\t\t\t\t\tReport.Error (513, mc.Location, \"`{0}' is abstract but it is declared in the non-abstract class `{1}'\",\n\t\t\t\t\t\tmc.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((flags & Modifiers.PRIVATE) != 0){\n\t\t\t\tif ((flags & vao) != 0){\n\t\t\t\t\tReport.Error (621, mc.Location, \"`{0}': virtual or abstract members cannot be private\", mc.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((flags & Modifiers.SEALED) != 0){\n\t\t\t\tif ((flags & Modifiers.OVERRIDE) == 0){\n\t\t\t\t\tReport.Error (238, mc.Location, \"`{0}' cannot be sealed because it is not an override\", mc.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\t// Check all container names for user classes\n\t\t\tif (Kind != MemberKind.Delegate)\n\t\t\t\tMemberCache.VerifyClsCompliance (Definition, Report);\n\n\t\t\tif (BaseType != null && !BaseType.IsCLSCompliant ()) {\n\t\t\t\tReport.Warning (3009, 1, Location, \"`{0}': base type `{1}' is not CLS-compliant\",\n\t\t\t\t\tGetSignatureForError (), BaseType.GetSignatureForError ());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Performs checks for an explicit interface implementation.  First it\n\t\t///   checks whether the `interface_type' is a base inteface implementation.\n\t\t///   Then it checks whether `name' exists in the interface type.\n\t\t/// </summary>\n\t\tpublic bool VerifyImplements (InterfaceMemberBase mb)\n\t\t{\n\t\t\tvar ifaces = PartialContainer.Interfaces;\n\t\t\tif (ifaces != null) {\n\t\t\t\tforeach (TypeSpec t in ifaces){\n\t\t\t\t\tif (t == mb.InterfaceType)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tvar expanded_base = t.Interfaces;\n\t\t\t\t\tif (expanded_base == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tforeach (var bt in expanded_base) {\n\t\t\t\t\t\tif (bt == mb.InterfaceType)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tReport.SymbolRelatedToPreviousError (mb.InterfaceType);\n\t\t\tReport.Error (540, mb.Location, \"`{0}': containing type does not implement interface `{1}'\",\n\t\t\t\tmb.GetSignatureForError (), mb.InterfaceType.GetSignatureForError ());\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\t\t// Used for visiblity checks to tests whether this definition shares\n\t\t// base type baseType, it does member-definition search\n\t\t//\n\t\tpublic bool IsBaseTypeDefinition (TypeSpec baseType)\n\t\t{\n\t\t\t// RootContext check\n\t\t\tif (TypeBuilder == null)\n\t\t\t\treturn false;\n\n\t\t\tvar type = spec;\n\t\t\tdo {\n\t\t\t\tif (type.MemberDefinition == baseType.MemberDefinition)\n\t\t\t\t\treturn true;\n\n\t\t\t\ttype = type.BaseType;\n\t\t\t} while (type != null);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override bool IsClsComplianceRequired ()\n\t\t{\n\t\t\tif (IsPartialPart)\n\t\t\t\treturn PartialContainer.IsClsComplianceRequired ();\n\n\t\t\treturn base.IsClsComplianceRequired ();\n\t\t}\n\n\t\tbool ITypeDefinition.IsInternalAsPublic (IAssemblyDefinition assembly)\n\t\t{\n\t\t\treturn Module.DeclaringAssembly == assembly;\n\t\t}\n\n\t\tpublic virtual bool IsUnmanagedType ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void LoadMembers (TypeSpec declaringType, bool onlyTypes, ref MemberCache cache)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"Not supported for compiled definition \" + GetSignatureForError ());\n\t\t}\n\n\t\t//\n\t\t// Public function used to locate types.\n\t\t//\n\t\t// Returns: Type or null if they type can not be found.\n\t\t//\n\t\tpublic override FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\tFullNamedExpression e;\n\t\t\tif (arity == 0 && Cache.TryGetValue (name, out e) && mode != LookupMode.IgnoreAccessibility)\n\t\t\t\treturn e;\n\n\t\t\te = null;\n\n\t\t\tif (arity == 0) {\n\t\t\t\tvar tp = CurrentTypeParameters;\n\t\t\t\tif (tp != null) {\n\t\t\t\t\tTypeParameter tparam = tp.Find (name);\n\t\t\t\t\tif (tparam != null)\n\t\t\t\t\t\te = new TypeParameterExpr (tparam, Location.Null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (e == null) {\n\t\t\t\tTypeSpec t = LookupNestedTypeInHierarchy (name, arity);\n\n\t\t\t\tif (t != null && (t.IsAccessible (this) || mode == LookupMode.IgnoreAccessibility))\n\t\t\t\t\te = new TypeExpression (t, Location.Null);\n\t\t\t\telse {\n\t\t\t\t\tvar errors = Compiler.Report.Errors;\n\t\t\t\t\te = Parent.LookupNamespaceOrType (name, arity, mode, loc);\n\n\t\t\t\t\t// TODO: LookupNamespaceOrType does more than just lookup. The result\n\t\t\t\t\t// cannot be cached or the error reporting won't happen\n\t\t\t\t\tif (errors != Compiler.Report.Errors)\n\t\t\t\t\t\treturn e;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO MemberCache: How to cache arity stuff ?\n\t\t\tif (arity == 0 && mode == LookupMode.Normal)\n\t\t\t\tCache[name] = e;\n\n\t\t\treturn e;\n\t\t}\n\n\t\tTypeSpec LookupNestedTypeInHierarchy (string name, int arity)\n\t\t{\n\t\t\t// Has any nested type\n\t\t\t// Does not work, because base type can have\n\t\t\t//if (PartialContainer.Types == null)\n\t\t\t//\treturn null;\n\n\t\t\tvar container = PartialContainer.CurrentType;\n\t\t\treturn MemberCache.FindNestedType (container, name, arity);\n\t\t}\n\n\t\tpublic void Mark_HasEquals ()\n\t\t{\n\t\t\tcached_method |= CachedMethods.Equals;\n\t\t}\n\n\t\tpublic void Mark_HasGetHashCode ()\n\t\t{\n\t\t\tcached_method |= CachedMethods.GetHashCode;\n\t\t}\n\n\t\tpublic override void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tif (IsPartialPart)\n\t\t\t\treturn;\n\n\t\t\tforeach (var m in members) {\n\t\t\t\tm.WriteDebugSymbol (file);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Method container contains Equals method\n\t\t/// </summary>\n\t\tpublic bool HasEquals {\n\t\t\tget {\n\t\t\t\treturn (cached_method & CachedMethods.Equals) != 0;\n\t\t\t}\n\t\t}\n \n\t\t/// <summary>\n\t\t/// Method container contains GetHashCode method\n\t\t/// </summary>\n\t\tpublic bool HasGetHashCode {\n\t\t\tget {\n\t\t\t\treturn (cached_method & CachedMethods.GetHashCode) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasStaticFieldInitializer {\n\t\t\tget {\n\t\t\t\treturn (cached_method & CachedMethods.HasStaticFieldInitializer) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value)\n\t\t\t\t\tcached_method |= CachedMethods.HasStaticFieldInitializer;\n\t\t\t\telse\n\t\t\t\t\tcached_method &= ~CachedMethods.HasStaticFieldInitializer;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string DocCommentHeader {\n\t\t\tget { return \"T:\"; }\n\t\t}\n\t}\n\n\tpublic abstract class ClassOrStruct : TypeDefinition\n\t{\n\t\tpublic const TypeAttributes StaticClassAttribute = TypeAttributes.Abstract | TypeAttributes.Sealed;\n\n\t\tSecurityType declarative_security;\n\t\tprotected Constructor generated_primary_constructor;\n\n\t\tprotected ClassOrStruct (TypeContainer parent, MemberName name, Attributes attrs, MemberKind kind)\n\t\t\t: base (parent, name, attrs, kind)\n\t\t{\n\t\t}\n\n\t\tpublic ToplevelBlock PrimaryConstructorBlock { get; set; }\n\n\t\tprotected override TypeAttributes TypeAttr {\n\t\t\tget {\n\t\t\t\tTypeAttributes ta = base.TypeAttr;\n\t\t\t\tif (!has_static_constructor)\n\t\t\t\t\tta |= TypeAttributes.BeforeFieldInit;\n\n\t\t\t\tif (Kind == MemberKind.Class) {\n\t\t\t\t\tta |= TypeAttributes.AutoLayout | TypeAttributes.Class;\n\t\t\t\t\tif (IsStatic)\n\t\t\t\t\t\tta |= StaticClassAttribute;\n\t\t\t\t} else {\n\t\t\t\t\tta |= TypeAttributes.SequentialLayout;\n\t\t\t\t}\n\n\t\t\t\treturn ta;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void AddNameToContainer (MemberCore symbol, string name)\n\t\t{\n\t\t\tif (!(symbol is Constructor) && symbol.MemberName.Name == MemberName.Name) {\n\t\t\t\tif (symbol is TypeParameter) {\n\t\t\t\t\tReport.Error (694, symbol.Location,\n\t\t\t\t\t\t\"Type parameter `{0}' has same name as containing type, or method\",\n\t\t\t\t\t\tsymbol.GetSignatureForError ());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tInterfaceMemberBase imb = symbol as InterfaceMemberBase;\n\t\t\t\tif (imb == null || !imb.IsExplicitImpl) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (this);\n\t\t\t\t\tReport.Error (542, symbol.Location, \"`{0}': member names cannot be the same as their enclosing type\",\n\t\t\t\t\t\tsymbol.GetSignatureForError ());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.AddNameToContainer (symbol, name);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.IsValidSecurityAttribute ()) {\n\t\t\t\ta.ExtractSecurityPermissionSet (ctor, ref declarative_security);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.StructLayout) {\n\t\t\t\tPartialContainer.HasStructLayout = true;\n\t\t\t\tif (a.IsExplicitLayoutKind ())\n\t\t\t\t\tPartialContainer.HasExplicitLayout = true;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Dynamic) {\n\t\t\t\ta.Error_MisusedDynamicAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Defines the default constructors \n\t\t/// </summary>\n\t\tprotected virtual Constructor DefineDefaultConstructor (bool is_static)\n\t\t{\n\t\t\t// The default instance constructor is public\n\t\t\t// If the class is abstract, the default constructor is protected\n\t\t\t// The default static constructor is private\n\n\t\t\tModifiers mods;\n\t\t\tParametersCompiled parameters = null;\n\t\t\tif (is_static) {\n\t\t\t\tmods = Modifiers.STATIC | Modifiers.PRIVATE;\n\t\t\t\tparameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t} else {\n\t\t\t\tmods = ((ModFlags & Modifiers.ABSTRACT) != 0) ? Modifiers.PROTECTED : Modifiers.PUBLIC;\n\t\t\t\tparameters = PrimaryConstructorParameters ?? ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t}\n\n\t\t\tvar c = new Constructor (this, MemberName.Name, mods, null, parameters, Location);\n\t\t\tif (Kind == MemberKind.Class)\n\t\t\t\tc.Initializer = new GeneratedBaseInitializer (Location, PrimaryConstructorBaseArguments);\n\n\t\t\tif (PrimaryConstructorParameters != null && !is_static)\n\t\t\t\tc.IsPrimaryConstructor = true;\n\t\t\t\n\t\t\tAddConstructor (c, true);\n\t\t\tif (PrimaryConstructorBlock == null) {\n\t\t\t\tc.Block = new ToplevelBlock (Compiler, parameters, Location) {\n\t\t\t\t\tIsCompilerGenerated = true\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tc.Block = PrimaryConstructorBlock;\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tCheckProtectedModifier ();\n\n\t\t\tif (PrimaryConstructorParameters != null) {\n\t\t\t\tforeach (Parameter p in PrimaryConstructorParameters.FixedParameters) {\n\t\t\t\t\tif (p.Name == MemberName.Name) {\n\t\t\t\t\t\tReport.Error (8039, p.Location, \"Primary constructor of type `{0}' has parameter of same name as containing type\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\t\t\t\tvar tp = CurrentTypeParameters [i];\n\t\t\t\t\t\t\tif (p.Name == tp.Name) {\n\t\t\t\t\t\t\t\tReport.Error (8038, p.Location, \"Primary constructor of type `{0}' has parameter of same name as type parameter `{1}'\",\n\t\t\t\t\t\t\t\t\tGetSignatureForError (), p.GetSignatureForError ());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.DoDefineMembers ();\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tif (!has_static_constructor && HasStaticFieldInitializer) {\n\t\t\t\tvar c = DefineDefaultConstructor (true);\n\t\t\t\tc.Define ();\n\t\t\t}\n\n\t\t\tbase.Emit ();\n\n\t\t\tif (declarative_security != null) {\n\t\t\t\tforeach (var de in declarative_security) {\n#if STATIC\n\t\t\t\t\tTypeBuilder.__AddDeclarativeSecurity (de);\n#else\n\t\t\t\t\tTypeBuilder.AddDeclarativeSecurity (de.Key, de.Value);\n#endif\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\tpublic sealed class Class : ClassOrStruct\n\t{\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE |\n\t\t\tModifiers.ABSTRACT |\n\t\t\tModifiers.SEALED |\n\t\t\tModifiers.STATIC |\n\t\t\tModifiers.UNSAFE;\n\t\t\t\n\t\tpublic Class (TypeContainer parent, MemberName name, Modifiers mod, Attributes attrs)\n\t\t\t: base (parent, name, attrs, MemberKind.Class)\n\t\t{\n\t\t\tvar accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;\n\t\t\tthis.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);\n\t\t\tspec = new TypeSpec (Kind, null, this, null, ModFlags);\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void SetBaseTypes (List<FullNamedExpression> baseTypes)\n\t\t{\n\t\t\tvar pmn = MemberName;\n\t\t\tif (pmn.Name == \"Object\" && !pmn.IsGeneric && Parent.MemberName.Name == \"System\" && Parent.MemberName.Left == null)\n\t\t\t\tReport.Error (537, Location,\n\t\t\t\t\t\"The class System.Object cannot have a base class or implement an interface.\");\n\n\t\t\tbase.SetBaseTypes (baseTypes);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.AttributeUsage) {\n\t\t\t\tif (!BaseType.IsAttribute && spec.BuiltinType != BuiltinTypeSpec.Type.Attribute) {\n\t\t\t\t\tReport.Error (641, a.Location, \"Attribute `{0}' is only valid on classes derived from System.Attribute\", a.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Conditional && !BaseType.IsAttribute) {\n\t\t\t\tReport.Error (1689, a.Location, \"Attribute `System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.ComImport && !attributes.Contains (pa.Guid)) {\n\t\t\t\ta.Error_MissingGuidAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Extension) {\n\t\t\t\ta.Error_MisusedExtensionAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type.IsConditionallyExcluded (this))\n\t\t\t\treturn;\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Class;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tif ((ModFlags & Modifiers.ABSTRACT) == Modifiers.ABSTRACT && (ModFlags & (Modifiers.SEALED | Modifiers.STATIC)) != 0) {\n\t\t\t\tReport.Error (418, Location, \"`{0}': an abstract class cannot be sealed or static\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif ((ModFlags & (Modifiers.SEALED | Modifiers.STATIC)) == (Modifiers.SEALED | Modifiers.STATIC)) {\n\t\t\t\tReport.Error (441, Location, \"`{0}': a class cannot be both static and sealed\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif (IsStatic) {\n\t\t\t\tif (PrimaryConstructorParameters != null) {\n\t\t\t\t\tReport.Error (-800, Location, \"`{0}': Static classes cannot have primary constructor\", GetSignatureForError ());\n\t\t\t\t\tPrimaryConstructorParameters = null;\n\t\t\t\t}\n\n\t\t\t\tforeach (var m in Members) {\n\t\t\t\t\tif (m is Operator) {\n\t\t\t\t\t\tReport.Error (715, m.Location, \"`{0}': Static classes cannot contain user-defined operators\", m.GetSignatureForError ());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (m is Destructor) {\n\t\t\t\t\t\tReport.Error (711, m.Location, \"`{0}': Static classes cannot contain destructor\", GetSignatureForError ());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (m is Indexer) {\n\t\t\t\t\t\tReport.Error (720, m.Location, \"`{0}': cannot declare indexers in a static class\", m.GetSignatureForError ());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((m.ModFlags & Modifiers.STATIC) != 0 || m is TypeContainer)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (m is Constructor) {\n\t\t\t\t\t\tReport.Error (710, m.Location, \"`{0}': Static classes cannot have instance constructors\", GetSignatureForError ());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tReport.Error (708, m.Location, \"`{0}': cannot declare instance members in a static class\", m.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!PartialContainer.HasInstanceConstructor || PrimaryConstructorParameters != null)\n\t\t\t\t\tgenerated_primary_constructor = DefineDefaultConstructor (false);\n\t\t\t}\n\n\t\t\treturn base.DoDefineMembers ();\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tbase.Emit ();\n\n\t\t\tif ((ModFlags & Modifiers.METHOD_EXTENSION) != 0)\n\t\t\t\tModule.PredefinedAttributes.Extension.EmitAttribute (TypeBuilder);\n\n\t\t\tif (base_type != null && base_type.HasDynamicElement) {\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (TypeBuilder, base_type, Location);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void GetCompletionStartingWith (string prefix, List<string> results)\n\t\t{\n\t\t\tbase.GetCompletionStartingWith (prefix, results);\n\n\t\t\tvar bt = base_type;\n\t\t\twhile (bt != null) {\n\t\t\t\tresults.AddRange (MemberCache.GetCompletitionMembers (this, bt, prefix).Where (l => l.IsStatic).Select (l => l.Name));\n\t\t\t\tbt = bt.BaseType;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tvar ifaces = base.ResolveBaseTypes (out base_class);\n\n\t\t\tif (base_class == null) {\n\t\t\t\tif (spec.BuiltinType != BuiltinTypeSpec.Type.Object)\n\t\t\t\t\tbase_type = Compiler.BuiltinTypes.Object;\n\t\t\t} else {\n\t\t\t\tif (base_type.IsGenericParameter){\n\t\t\t\t\tReport.Error (689, base_class.Location, \"`{0}': Cannot derive from type parameter `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), base_type.GetSignatureForError ());\n\t\t\t\t} else if (base_type.IsStatic) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_type);\n\t\t\t\t\tReport.Error (709, Location, \"`{0}': Cannot derive from static class `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), base_type.GetSignatureForError ());\n\t\t\t\t} else if (base_type.IsSealed) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_type);\n\t\t\t\t\tReport.Error (509, Location, \"`{0}': cannot derive from sealed type `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), base_type.GetSignatureForError ());\n\t\t\t\t} else if (PartialContainer.IsStatic && base_type.BuiltinType != BuiltinTypeSpec.Type.Object) {\n\t\t\t\t\tReport.Error (713, Location, \"Static class `{0}' cannot derive from type `{1}'. Static classes must derive from object\",\n\t\t\t\t\t\tGetSignatureForError (), base_type.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tswitch (base_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Enum:\n\t\t\t\tcase BuiltinTypeSpec.Type.ValueType:\n\t\t\t\tcase BuiltinTypeSpec.Type.MulticastDelegate:\n\t\t\t\tcase BuiltinTypeSpec.Type.Delegate:\n\t\t\t\tcase BuiltinTypeSpec.Type.Array:\n\t\t\t\t\tif (!(spec is BuiltinTypeSpec)) {\n\t\t\t\t\t\tReport.Error (644, Location, \"`{0}' cannot derive from special class `{1}'\",\n\t\t\t\t\t\t\tGetSignatureForError (), base_type.GetSignatureForError ());\n\n\t\t\t\t\t\tbase_type = Compiler.BuiltinTypes.Object;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!IsAccessibleAs (base_type)) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_type);\n\t\t\t\t\tReport.Error (60, Location, \"Inconsistent accessibility: base class `{0}' is less accessible than class `{1}'\",\n\t\t\t\t\t\tbase_type.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (PartialContainer.IsStatic && ifaces != null) {\n\t\t\t\tforeach (var t in ifaces)\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (t);\n\t\t\t\tReport.Error (714, Location, \"Static class `{0}' cannot implement interfaces\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn ifaces;\n\t\t}\n\n\t\t/// Search for at least one defined condition in ConditionalAttribute of attribute class\n\t\t/// Valid only for attribute classes.\n\t\tpublic override string[] ConditionalConditions ()\n\t\t{\n\t\t\tif ((caching_flags & (Flags.Excluded_Undetected | Flags.Excluded)) == 0)\n\t\t\t\treturn null;\n\n\t\t\tcaching_flags &= ~Flags.Excluded_Undetected;\n\n\t\t\tif (OptAttributes == null)\n\t\t\t\treturn null;\n\n\t\t\tAttribute[] attrs = OptAttributes.SearchMulti (Module.PredefinedAttributes.Conditional);\n\t\t\tif (attrs == null)\n\t\t\t\treturn null;\n\n\t\t\tstring[] conditions = new string[attrs.Length];\n\t\t\tfor (int i = 0; i < conditions.Length; ++i)\n\t\t\t\tconditions[i] = attrs[i].GetConditionalAttributeValue ();\n\n\t\t\tcaching_flags |= Flags.Excluded;\n\t\t\treturn conditions;\n\t\t}\n\t}\n\n\tpublic sealed class Struct : ClassOrStruct\n\t{\n\t\tbool is_unmanaged, has_unmanaged_check_done;\n\t\tbool InTransit;\n\n\t\t// <summary>\n\t\t//   Modifiers allowed in a struct declaration\n\t\t// </summary>\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW       |\n\t\t\tModifiers.PUBLIC    |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL  |\n\t\t\tModifiers.UNSAFE    |\n\t\t\tModifiers.PRIVATE;\n\n\t\tpublic Struct (TypeContainer parent, MemberName name, Modifiers mod, Attributes attrs)\n\t\t\t: base (parent, name, attrs, MemberKind.Struct)\n\t\t{\n\t\t\tvar accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;\t\t\t\n\t\t\tthis.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report) | Modifiers.SEALED ;\n\t\t\tspec = new TypeSpec (Kind, null, this, null, ModFlags);\n\t\t}\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Struct;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\n\t\t\t//\n\t\t\t// When struct constains fixed fixed and struct layout has explicitly\n\t\t\t// set CharSet, its value has to be propagated to compiler generated\n\t\t\t// fixed types\n\t\t\t//\n\t\t\tif (a.Type == pa.StructLayout) {\n\t\t\t\tvar value = a.GetNamedValue (\"CharSet\");\n\t\t\t\tif (value == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tfor (int i = 0; i < Members.Count; ++i) {\n\t\t\t\t\tFixedField ff = Members [i] as FixedField;\n\t\t\t\t\tif (ff == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tff.CharSet = (CharSet) System.Enum.Parse (typeof (CharSet), value.GetValue ().ToString ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbool CheckStructCycles ()\n\t\t{\n\t\t\tif (InTransit)\n\t\t\t\treturn false;\n\n\t\t\tInTransit = true;\n\t\t\tforeach (var member in Members) {\n\t\t\t\tvar field = member as Field;\n\t\t\t\tif (field == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tTypeSpec ftype = field.Spec.MemberType;\n\t\t\t\tif (!ftype.IsStruct)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (ftype is BuiltinTypeSpec)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tforeach (var targ in ftype.TypeArguments) {\n\t\t\t\t\tif (!CheckFieldTypeCycle (targ)) {\n\t\t\t\t\t\tReport.Error (523, field.Location,\n\t\t\t\t\t\t\t\"Struct member `{0}' of type `{1}' causes a cycle in the struct layout\",\n\t\t\t\t\t\t\tfield.GetSignatureForError (), ftype.GetSignatureForError ());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Static fields of exactly same type are allowed\n\t\t\t\t//\n\t\t\t\tif (field.IsStatic && ftype == CurrentType)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!CheckFieldTypeCycle (ftype)) {\n\t\t\t\t\tReport.Error (523, field.Location,\n\t\t\t\t\t\t\"Struct member `{0}' of type `{1}' causes a cycle in the struct layout\",\n\t\t\t\t\t\tfield.GetSignatureForError (), ftype.GetSignatureForError ());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tInTransit = false;\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic bool CheckFieldTypeCycle (TypeSpec ts)\n\t\t{\n\t\t\tvar fts = ts.MemberDefinition as Struct;\n\t\t\tif (fts == null)\n\t\t\t\treturn true;\n\n\t\t\treturn fts.CheckStructCycles ();\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tif (PrimaryConstructorParameters != null)\n\t\t\t\tgenerated_primary_constructor = DefineDefaultConstructor (false);\n\n\t\t\treturn base.DoDefineMembers ();\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tCheckStructCycles ();\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tbool HasExplicitConstructor ()\n\t\t{\n\t\t\tforeach (var m in Members) {\n\t\t\t\tvar c = m as Constructor;\n\t\t\t\tif (c == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!c.ParameterInfo.IsEmpty)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override bool IsUnmanagedType ()\n\t\t{\n\t\t\tif (has_unmanaged_check_done)\n\t\t\t\treturn is_unmanaged;\n\n\t\t\tif (requires_delayed_unmanagedtype_check)\n\t\t\t\treturn true;\n\n\t\t\tvar parent_def = Parent.PartialContainer;\n\t\t\tif (parent_def != null && parent_def.IsGenericOrParentIsGeneric) {\n\t\t\t\thas_unmanaged_check_done = true;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (first_nonstatic_field != null) {\n\t\t\t\trequires_delayed_unmanagedtype_check = true;\n\n\t\t\t\tforeach (var member in Members) {\n\t\t\t\t\tvar f = member as Field;\n\t\t\t\t\tif (f == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (f.IsStatic)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// It can happen when recursive unmanaged types are defined\n\t\t\t\t\t// struct S { S* s; }\n\t\t\t\t\tTypeSpec mt = f.MemberType;\n\t\t\t\t\tif (mt == null) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (mt.IsUnmanaged)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\thas_unmanaged_check_done = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\thas_unmanaged_check_done = true;\n\t\t\t}\n\n\t\t\tis_unmanaged = true;\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tvar ifaces = base.ResolveBaseTypes (out base_class);\n\t\t\tbase_type = Compiler.BuiltinTypes.ValueType;\n\t\t\treturn ifaces;\n\t\t}\n\n\t\tpublic override void RegisterFieldForInitialization (MemberCore field, FieldInitializer expression)\n\t\t{\n\t\t\tif ((field.ModFlags & Modifiers.STATIC) == 0 && !HasExplicitConstructor ()) {\n\t\t\t\tReport.Error (8054, field.Location, \"`{0}': Structs without explicit constructors cannot contain members with initializers\",\n\t\t\t\t\tfield.GetSignatureForError ());\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.RegisterFieldForInitialization (field, expression);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Interfaces\n\t/// </summary>\n\tpublic sealed class Interface : TypeDefinition {\n\n\t\t/// <summary>\n\t\t///   Modifiers allowed in a class declaration\n\t\t/// </summary>\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW       |\n\t\t\tModifiers.PUBLIC    |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL  |\n\t\t \tModifiers.UNSAFE    |\n\t\t\tModifiers.PRIVATE;\n\n\t\tpublic Interface (TypeContainer parent, MemberName name, Modifiers mod, Attributes attrs)\n\t\t\t: base (parent, name, attrs, MemberKind.Interface)\n\t\t{\n\t\t\tvar accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;\n\n\t\t\tthis.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, name.Location, Report);\n\t\t\tspec = new TypeSpec (Kind, null, this, null, ModFlags);\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Interface;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeAttributes TypeAttr {\n\t\t\tget {\n\t\t\t\tconst TypeAttributes DefaultTypeAttributes =\n\t\t\t\t\tTypeAttributes.AutoLayout |\n\t\t\t\t\tTypeAttributes.Abstract |\n\t\t\t\t\tTypeAttributes.Interface;\n\n\t\t\t\treturn base.TypeAttr | DefaultTypeAttributes;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.ComImport && !attributes.Contains (pa.Guid)) {\n\t\t\t\ta.Error_MissingGuidAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\tif (iface_exprs != null) {\n\t\t\t\tforeach (var iface in iface_exprs) {\n\t\t\t\t\tif (iface.IsCLSCompliant ())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (iface);\n\t\t\t\t\tReport.Warning (3027, 1, Location, \"`{0}' is not CLS-compliant because base interface `{1}' is not CLS-compliant\",\n\t\t\t\t\t\tGetSignatureForError (), iface.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic abstract class InterfaceMemberBase : MemberBase\n\t{\n\t\t//\n\t\t// Common modifiers allowed in a class declaration\n\t\t//\n\t\tprotected const Modifiers AllowedModifiersClass =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE |\n\t\t\tModifiers.STATIC |\n\t\t\tModifiers.VIRTUAL |\n\t\t\tModifiers.SEALED |\n\t\t\tModifiers.OVERRIDE |\n\t\t\tModifiers.ABSTRACT |\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.EXTERN;\n\n\t\t//\n\t\t// Common modifiers allowed in a struct declaration\n\t\t//\n\t\tprotected const Modifiers AllowedModifiersStruct =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE |\n\t\t\tModifiers.STATIC |\n\t\t\tModifiers.OVERRIDE |\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.EXTERN;\n\n\t\t//\n\t\t// Common modifiers allowed in a interface declaration\n\t\t//\n\t\tprotected const Modifiers AllowedModifiersInterface =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.UNSAFE;\n\n\t\t//\n\t\t// Whether this is an interface member.\n\t\t//\n\t\tpublic bool IsInterface;\n\n\t\t//\n\t\t// If true, this is an explicit interface implementation\n\t\t//\n\t\tpublic readonly bool IsExplicitImpl;\n\n\t\tprotected bool is_external_implementation;\n\n\t\t//\n\t\t// The interface type we are explicitly implementing\n\t\t//\n\t\tpublic TypeSpec InterfaceType;\n\n\t\t//\n\t\t// The method we're overriding if this is an override method.\n\t\t//\n\t\tprotected MethodSpec base_method;\n\n\t\treadonly Modifiers explicit_mod_flags;\n\t\tpublic MethodAttributes flags;\n\n\t\tprotected InterfaceMemberBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod, allowed_mod, Modifiers.PRIVATE, name, attrs)\n\t\t{\n\t\t\tIsInterface = parent.Kind == MemberKind.Interface;\n\t\t\tIsExplicitImpl = (MemberName.ExplicitInterface != null);\n\t\t\texplicit_mod_flags = mod;\n\t\t}\n\n\t\tpublic abstract Variance ExpectedMemberTypeVariance { get; }\n\t\t\n\t\tprotected override bool CheckBase ()\n\t\t{\n\t\t\tif (!base.CheckBase ())\n\t\t\t\treturn false;\n\n\t\t\tif ((caching_flags & Flags.MethodOverloadsExist) != 0)\n\t\t\t\tCheckForDuplications ();\n\t\t\t\n\t\t\tif (IsExplicitImpl)\n\t\t\t\treturn true;\n\n\t\t\t// For System.Object only\n\t\t\tif (Parent.BaseType == null)\n\t\t\t\treturn true;\n\n\t\t\tMemberSpec candidate;\n\t\t\tbool overrides = false;\n\t\t\tvar base_member = FindBaseMember (out candidate, ref overrides);\n\n\t\t\tif ((ModFlags & Modifiers.OVERRIDE) != 0) {\n\t\t\t\tif (base_member == null) {\n\t\t\t\t\tif (candidate == null) {\n\t\t\t\t\t\tif (this is Method && ((Method)this).ParameterInfo.IsEmpty && MemberName.Name == Destructor.MetadataName && MemberName.Arity == 0) {\n\t\t\t\t\t\t\tReport.Error (249, Location, \"Do not override `{0}'. Use destructor syntax instead\",\n\t\t\t\t\t\t\t\t\"object.Finalize()\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tReport.Error (115, Location, \"`{0}' is marked as an override but no suitable {1} found to override\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), SimpleName.GetMemberType (this));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (candidate);\n\t\t\t\t\t\tif (this is Event)\n\t\t\t\t\t\t\tReport.Error (72, Location, \"`{0}': cannot override because `{1}' is not an event\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), TypeManager.GetFullNameSignature (candidate));\n\t\t\t\t\t\telse if (this is PropertyBase)\n\t\t\t\t\t\t\tReport.Error (544, Location, \"`{0}': cannot override because `{1}' is not a property\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), TypeManager.GetFullNameSignature (candidate));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tReport.Error (505, Location, \"`{0}': cannot override because `{1}' is not a method\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), TypeManager.GetFullNameSignature (candidate));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Handles ambiguous overrides\n\t\t\t\t//\n\t\t\t\tif (candidate != null) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (candidate);\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\n\t\t\t\t\t// Get member definition for error reporting\n\t\t\t\t\tvar m1 = MemberCache.GetMember (base_member.DeclaringType.GetDefinition (), base_member);\n\t\t\t\t\tvar m2 = MemberCache.GetMember (candidate.DeclaringType.GetDefinition (), candidate);\n\n\t\t\t\t\tReport.Error (462, Location,\n\t\t\t\t\t\t\"`{0}' cannot override inherited members `{1}' and `{2}' because they have the same signature when used in type `{3}'\",\n\t\t\t\t\t\tGetSignatureForError (), m1.GetSignatureForError (), m2.GetSignatureForError (), Parent.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (!CheckOverrideAgainstBase (base_member))\n\t\t\t\t\treturn false;\n\n\t\t\t\tObsoleteAttribute oa = base_member.GetAttributeObsolete ();\n\t\t\t\tif (oa != null) {\n\t\t\t\t\tif (OptAttributes == null || !OptAttributes.Contains (Module.PredefinedAttributes.Obsolete)) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\t\t\t\tReport.Warning (672, 1, Location, \"Member `{0}' overrides obsolete member `{1}'. Add the Obsolete attribute to `{0}'\",\n\t\t\t\t\t\t\tGetSignatureForError (), base_member.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (OptAttributes != null && OptAttributes.Contains (Module.PredefinedAttributes.Obsolete)) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\t\t\t\tReport.Warning (809, 1, Location, \"Obsolete member `{0}' overrides non-obsolete member `{1}'\",\n\t\t\t\t\t\t\tGetSignatureForError (), base_member.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbase_method = base_member as MethodSpec;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (base_member == null && candidate != null && (!(candidate is IParametersMember) || !(this is IParametersMember)))\n\t\t\t\tbase_member = candidate;\n\n\t\t\tif (base_member == null) {\n\t\t\t\tif ((ModFlags & Modifiers.NEW) != 0) {\n\t\t\t\t\tif (base_member == null) {\n\t\t\t\t\t\tReport.Warning (109, 4, Location, \"The member `{0}' does not hide an inherited member. The new keyword is not required\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((ModFlags & Modifiers.NEW) == 0) {\n\t\t\t\t\tModFlags |= Modifiers.NEW;\n\t\t\t\t\tif (!IsCompilerGenerated) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\t\t\t\tif (!IsInterface && (base_member.Modifiers & (Modifiers.ABSTRACT | Modifiers.VIRTUAL | Modifiers.OVERRIDE)) != 0) {\n\t\t\t\t\t\t\tReport.Warning (114, 2, Location, \"`{0}' hides inherited member `{1}'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), base_member.GetSignatureForError ());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tReport.Warning (108, 2, Location, \"`{0}' hides inherited member `{1}'. Use the new keyword if hiding was intended\",\n\t\t\t\t\t\t\t\tGetSignatureForError (), base_member.GetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!IsInterface && base_member.IsAbstract && !overrides && !IsStatic) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\t\t\tReport.Error (533, Location, \"`{0}' hides inherited abstract member `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), base_member.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected virtual bool CheckForDuplications ()\n\t\t{\n\t\t\treturn Parent.MemberCache.CheckExistingMembersOverloads (this, ParametersCompiled.EmptyReadOnlyParameters);\n\t\t}\n\n\t\t//\n\t\t// Performs various checks on the MethodInfo `mb' regarding the modifier flags\n\t\t// that have been defined.\n\t\t//\n\t\tprotected virtual bool CheckOverrideAgainstBase (MemberSpec base_member)\n\t\t{\n\t\t\tbool ok = true;\n\n\t\t\tif ((base_member.Modifiers & (Modifiers.ABSTRACT | Modifiers.VIRTUAL | Modifiers.OVERRIDE)) == 0) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\t\tReport.Error (506, Location,\n\t\t\t\t\t\"`{0}': cannot override inherited member `{1}' because it is not marked virtual, abstract or override\",\n\t\t\t\t\t GetSignatureForError (), TypeManager.CSharpSignature (base_member));\n\t\t\t\tok = false;\n\t\t\t}\n\n\t\t\t// Now we check that the overriden method is not final\t\n\t\t\tif ((base_member.Modifiers & Modifiers.SEALED) != 0) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\t\tReport.Error (239, Location, \"`{0}': cannot override inherited member `{1}' because it is sealed\",\n\t\t\t\t\t\t\t  GetSignatureForError (), TypeManager.CSharpSignature (base_member));\n\t\t\t\tok = false;\n\t\t\t}\n\n\t\t\tvar base_member_type = ((IInterfaceMemberSpec) base_member).MemberType;\n\t\t\tif (!TypeSpecComparer.Override.IsEqual (MemberType, base_member_type)) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\t\tif (this is PropertyBasedMember) {\n\t\t\t\t\tReport.Error (1715, Location, \"`{0}': type must be `{1}' to match overridden member `{2}'\",\n\t\t\t\t\t\tGetSignatureForError (), base_member_type.GetSignatureForError (), base_member.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tReport.Error (508, Location, \"`{0}': return type must be `{1}' to match overridden member `{2}'\",\n\t\t\t\t\t\tGetSignatureForError (), base_member_type.GetSignatureForError (), base_member.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t\tok = false;\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tprotected static bool CheckAccessModifiers (MemberCore this_member, MemberSpec base_member)\n\t\t{\n\t\t\tvar thisp = this_member.ModFlags & Modifiers.AccessibilityMask;\n\t\t\tvar base_classp = base_member.Modifiers & Modifiers.AccessibilityMask;\n\n\t\t\tif ((base_classp & (Modifiers.PROTECTED | Modifiers.INTERNAL)) == (Modifiers.PROTECTED | Modifiers.INTERNAL)) {\n\t\t\t\t//\n\t\t\t\t// It must be at least \"protected\"\n\t\t\t\t//\n\t\t\t\tif ((thisp & Modifiers.PROTECTED) == 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// when overriding protected internal, the method can be declared\n\t\t\t\t// protected internal only within the same assembly or assembly\n\t\t\t\t// which has InternalsVisibleTo\n\t\t\t\t//\n\t\t\t\tif ((thisp & Modifiers.INTERNAL) != 0) {\n\t\t\t\t\treturn base_member.DeclaringType.MemberDefinition.IsInternalAsPublic (this_member.Module.DeclaringAssembly);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// protected overriding protected internal inside same assembly\n\t\t\t\t// requires internal modifier as well\n\t\t\t\t//\n\t\t\t\tif (base_member.DeclaringType.MemberDefinition.IsInternalAsPublic (this_member.Module.DeclaringAssembly)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn thisp == base_classp;\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (IsInterface) {\n\t\t\t\tModFlags = Modifiers.PUBLIC | Modifiers.ABSTRACT |\n\t\t\t\t\tModifiers.VIRTUAL | (ModFlags & (Modifiers.UNSAFE | Modifiers.NEW));\n\n\t\t\t\tflags = MethodAttributes.Public |\n\t\t\t\t\tMethodAttributes.Abstract |\n\t\t\t\t\tMethodAttributes.HideBySig |\n\t\t\t\t\tMethodAttributes.NewSlot |\n\t\t\t\t\tMethodAttributes.Virtual;\n\t\t\t} else {\n\t\t\t\tParent.PartialContainer.MethodModifiersValid (this);\n\n\t\t\t\tflags = ModifiersExtensions.MethodAttr (ModFlags);\n\t\t\t}\n\n\t\t\tif (IsExplicitImpl) {\n\t\t\t\tInterfaceType = MemberName.ExplicitInterface.ResolveAsType (Parent);\n\t\t\t\tif (InterfaceType == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif ((ModFlags & Modifiers.PARTIAL) != 0) {\n\t\t\t\t\tReport.Error (754, Location, \"A partial method `{0}' cannot explicitly implement an interface\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (!InterfaceType.IsInterface) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (InterfaceType);\n\t\t\t\t\tReport.Error (538, Location, \"The type `{0}' in explicit interface declaration is not an interface\",\n\t\t\t\t\t\tInterfaceType.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tParent.PartialContainer.VerifyImplements (this);\n\t\t\t\t}\n\n\t\t\t\tModifiers allowed_explicit = Modifiers.AllowedExplicitImplFlags;\n\t\t\t\tif (this is Method)\n\t\t\t\t\tallowed_explicit |= Modifiers.ASYNC;\n\n\t\t\t\tModifiersExtensions.Check (allowed_explicit, explicit_mod_flags, 0, Location, Report);\n\t\t\t}\n\n\t\t\treturn base.Define ();\n\t\t}\n\n\t\tprotected bool DefineParameters (ParametersCompiled parameters)\n\t\t{\n\t\t\tif (!parameters.Resolve (this))\n\t\t\t\treturn false;\n\n\t\t\tbool error = false;\n\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\tParameter p = parameters [i];\n\n\t\t\t\tif (p.HasDefaultValue && (IsExplicitImpl || this is Operator || (this is Indexer && parameters.Count == 1)))\n\t\t\t\t\tp.Warning_UselessOptionalParameter (Report);\n\n\t\t\t\tif (p.CheckAccessibility (this))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tTypeSpec t = parameters.Types [i];\n\t\t\t\tReport.SymbolRelatedToPreviousError (t);\n\t\t\t\tif (this is Indexer)\n\t\t\t\t\tReport.Error (55, Location,\n\t\t\t\t\t\t      \"Inconsistent accessibility: parameter type `{0}' is less accessible than indexer `{1}'\",\n\t\t\t\t\t\t      t.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\telse if (this is Operator)\n\t\t\t\t\tReport.Error (57, Location,\n\t\t\t\t\t\t      \"Inconsistent accessibility: parameter type `{0}' is less accessible than operator `{1}'\",\n\t\t\t\t\t\t      t.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\telse\n\t\t\t\t\tReport.Error (51, Location,\n\t\t\t\t\t\t\"Inconsistent accessibility: parameter type `{0}' is less accessible than method `{1}'\",\n\t\t\t\t\t\tt.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\terror = true;\n\t\t\t}\n\t\t\treturn !error;\n\t\t}\n\n\t\tprotected override void DoMemberTypeDependentChecks ()\n\t\t{\n\t\t\tbase.DoMemberTypeDependentChecks ();\n\n\t\t\tVarianceDecl.CheckTypeVariance (MemberType, ExpectedMemberTypeVariance, this);\n\t\t}\n\n\t\tpublic override void Emit()\n\t\t{\n\t\t\t// for extern static method must be specified either DllImport attribute or MethodImplAttribute.\n\t\t\t// We are more strict than csc and report this as an error because SRE does not allow emit that\n\t\t\tif ((ModFlags & Modifiers.EXTERN) != 0 && !is_external_implementation && (OptAttributes == null || !OptAttributes.HasResolveError ())) {\n\t\t\t\tif (this is Constructor) {\n\t\t\t\t\tReport.Warning (824, 1, Location,\n\t\t\t\t\t\t\"Constructor `{0}' is marked `external' but has no external implementation specified\", GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tReport.Warning (626, 1, Location,\n\t\t\t\t\t\t\"`{0}' is marked as an external but has no DllImport attribute. Consider adding a DllImport attribute to specify the external implementation\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic override bool EnableOverloadChecks (MemberCore overload)\n\t\t{\n\t\t\t//\n\t\t\t// Two members can differ in their explicit interface\n\t\t\t// type parameter only\n\t\t\t//\n\t\t\tInterfaceMemberBase imb = overload as InterfaceMemberBase;\n\t\t\tif (imb != null && imb.IsExplicitImpl) {\n\t\t\t\tif (IsExplicitImpl) {\n\t\t\t\t\tcaching_flags |= Flags.MethodOverloadsExist;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn IsExplicitImpl;\n\t\t}\n\n\t\tprotected void Error_CannotChangeAccessModifiers (MemberCore member, MemberSpec base_member)\n\t\t{\n\t\t\tvar base_modifiers = base_member.Modifiers;\n\n\t\t\t// Remove internal modifier from types which are not internally accessible\n\t\t\tif ((base_modifiers & Modifiers.AccessibilityMask) == (Modifiers.PROTECTED | Modifiers.INTERNAL) &&\n\t\t\t\t!base_member.DeclaringType.MemberDefinition.IsInternalAsPublic (member.Module.DeclaringAssembly))\n\t\t\t\tbase_modifiers = Modifiers.PROTECTED;\n\n\t\t\tReport.SymbolRelatedToPreviousError (base_member);\n\t\t\tReport.Error (507, member.Location,\n\t\t\t\t\"`{0}': cannot change access modifiers when overriding `{1}' inherited member `{2}'\",\n\t\t\t\tmember.GetSignatureForError (),\n\t\t\t\tModifiersExtensions.AccessibilityName (base_modifiers),\n\t\t\t\tbase_member.GetSignatureForError ());\n\t\t}\n\n\t\tprotected void Error_StaticReturnType ()\n\t\t{\n\t\t\tReport.Error (722, Location,\n\t\t\t\t\"`{0}': static types cannot be used as return types\",\n\t\t\t\tMemberType.GetSignatureForError ());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets base method and its return type\n\t\t/// </summary>\n\t\tprotected virtual MemberSpec FindBaseMember (out MemberSpec bestCandidate, ref bool overrides)\n\t\t{\n\t\t\treturn MemberCache.FindBaseMember (this, out bestCandidate, ref overrides);\n\t\t}\n\n\t\t//\n\t\t// The \"short\" name of this property / indexer / event.  This is the\n\t\t// name without the explicit interface.\n\t\t//\n\t\tpublic string ShortName {\n\t\t\tget { return MemberName.Name; }\n\t\t}\n\t\t\n\t\t//\n\t\t// Returns full metadata method name\n\t\t//\n\t\tpublic string GetFullName (MemberName name)\n\t\t{\n\t\t\treturn GetFullName (name.Name);\n\t\t}\n\n\t\tpublic string GetFullName (string name)\n\t\t{\n\t\t\tif (!IsExplicitImpl)\n\t\t\t\treturn name;\n\n\t\t\t//\n\t\t\t// When dealing with explicit members a full interface type\n\t\t\t// name is added to member name to avoid possible name conflicts\n\t\t\t//\n\t\t\t// We use CSharpName which gets us full name with benefit of\n\t\t\t// replacing predefined names which saves some space and name\n\t\t\t// is still unique\n\t\t\t//\n\t\t\treturn InterfaceType.GetSignatureForError () + \".\" + name;\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tif (IsExplicitImpl)\n\t\t\t\treturn Parent.GetSignatureForDocumentation () + \".\" + InterfaceType.GetExplicitNameSignatureForDocumentation () + \"#\" + ShortName;\n\n\t\t\treturn Parent.GetSignatureForDocumentation () + \".\" + ShortName;\n\t\t}\n\n\t\tpublic override bool IsUsed \n\t\t{\n\t\t\tget { return IsExplicitImpl || base.IsUsed; }\n\t\t}\n\n\t\tpublic override void SetConstraints (List<Constraints> constraints_list)\n\t\t{\n\t\t\tif (((ModFlags & Modifiers.OVERRIDE) != 0 || IsExplicitImpl)) {\n\t\t\t\tReport.Error (460, Location,\n\t\t\t\t\t\"`{0}': Cannot specify constraints for overrides and explicit interface implementation methods\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\n\t\t\tbase.SetConstraints (constraints_list);\n\t\t}\n\t}\n\n\tpublic abstract class MemberBase : MemberCore\n\t{\n\t\tprotected FullNamedExpression type_expr;\n\t\tprotected TypeSpec member_type;\n\t\tpublic new TypeDefinition Parent;\n\n\t\tprotected MemberBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, Modifiers def_mod, MemberName name, Attributes attrs)\n\t\t\t: base (parent, name, attrs)\n\t\t{\n\t\t\tthis.Parent = parent;\n\t\t\tthis.type_expr = type;\n\n\t\t\tif (name != MemberName.Null)\n\t\t\t\tModFlags = ModifiersExtensions.Check (allowed_mod, mod, def_mod, Location, Report);\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic TypeSpec MemberType {\n\t\t\tget {\n\t\t\t\treturn member_type;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn type_expr;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t//\n\t\t// Main member define entry\n\t\t//\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tDoMemberTypeIndependentChecks ();\n\n\t\t\t//\n\t\t\t// Returns false only when type resolution failed\n\t\t\t//\n\t\t\tif (!ResolveMemberType ())\n\t\t\t\treturn false;\n\n\t\t\tDoMemberTypeDependentChecks ();\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Any type_name independent checks\n\t\t//\n\t\tprotected virtual void DoMemberTypeIndependentChecks ()\n\t\t{\n\t\t\tif ((Parent.ModFlags & Modifiers.SEALED) != 0 &&\n\t\t\t\t(ModFlags & (Modifiers.VIRTUAL | Modifiers.ABSTRACT)) != 0) {\n\t\t\t\tReport.Error (549, Location, \"New virtual member `{0}' is declared in a sealed class `{1}'\",\n\t\t\t\t\tGetSignatureForError (), Parent.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Any type_name dependent checks\n\t\t//\n\t\tprotected virtual void DoMemberTypeDependentChecks ()\n\t\t{\n\t\t\t// verify accessibility\n\t\t\tif (!IsAccessibleAs (MemberType)) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (MemberType);\n\t\t\t\tif (this is Property)\n\t\t\t\t\tReport.Error (53, Location,\n\t\t\t\t\t\t\"Inconsistent accessibility: property type `\" +\n\t\t\t\t\t\tMemberType.GetSignatureForError () + \"' is less \" +\n\t\t\t\t\t\t\"accessible than property `\" + GetSignatureForError () + \"'\");\n\t\t\t\telse if (this is Indexer)\n\t\t\t\t\tReport.Error (54, Location,\n\t\t\t\t\t\t\"Inconsistent accessibility: indexer return type `\" +\n\t\t\t\t\t\tMemberType.GetSignatureForError () + \"' is less \" +\n\t\t\t\t\t\t\"accessible than indexer `\" + GetSignatureForError () + \"'\");\n\t\t\t\telse if (this is MethodCore) {\n\t\t\t\t\tif (this is Operator)\n\t\t\t\t\t\tReport.Error (56, Location,\n\t\t\t\t\t\t\t\"Inconsistent accessibility: return type `\" +\n\t\t\t\t\t\t\tMemberType.GetSignatureForError () + \"' is less \" +\n\t\t\t\t\t\t\t\"accessible than operator `\" + GetSignatureForError () + \"'\");\n\t\t\t\t\telse\n\t\t\t\t\t\tReport.Error (50, Location,\n\t\t\t\t\t\t\t\"Inconsistent accessibility: return type `\" +\n\t\t\t\t\t\t\tMemberType.GetSignatureForError () + \"' is less \" +\n\t\t\t\t\t\t\t\"accessible than method `\" + GetSignatureForError () + \"'\");\n\t\t\t\t} else if (this is Event) {\n\t\t\t\t\tReport.Error (7025, Location,\n\t\t\t\t\t\t\"Inconsistent accessibility: event type `{0}' is less accessible than event `{1}'\",\n\t\t\t\t\t\tMemberType.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tReport.Error (52, Location,\n\t\t\t\t\t\t      \"Inconsistent accessibility: field type `\" +\n\t\t\t\t\t\t      MemberType.GetSignatureForError () + \"' is less \" +\n\t\t\t\t\t\t      \"accessible than field `\" + GetSignatureForError () + \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected void IsTypePermitted ()\n\t\t{\n\t\t\tif (MemberType.IsSpecialRuntimeType) {\n\t\t\t\tif (Parent is StateMachine) {\n\t\t\t\t\tReport.Error (4012, Location,\n\t\t\t\t\t\t\"Parameters or local variables of type `{0}' cannot be declared in async methods or iterators\",\n\t\t\t\t\t\tMemberType.GetSignatureForError ());\n\t\t\t\t} else if (Parent is HoistedStoreyClass) {\n\t\t\t\t\tReport.Error (4013, Location,\n\t\t\t\t\t\t\"Local variables of type `{0}' cannot be used inside anonymous methods, lambda expressions or query expressions\",\n\t\t\t\t\t\tMemberType.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tReport.Error (610, Location, \n\t\t\t\t\t\t\"Field or property cannot be of type `{0}'\", MemberType.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual bool CheckBase ()\n\t\t{\n\t\t\tCheckProtectedModifier ();\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\treturn Parent.GetSignatureForDocumentation () + \".\" + MemberName.Basename;\n\t\t}\n\n\t\tprotected virtual bool ResolveMemberType ()\n\t\t{\n\t\t\tif (member_type != null)\n\t\t\t\tthrow new InternalErrorException (\"Multi-resolve\");\n\n\t\t\tmember_type = type_expr.ResolveAsType (this);\n\t\t\treturn member_type != null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs",
    "content": "//\n// codegen.cs: The code generator\n//\n// Authors:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2004 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\nusing Mono.CompilerServices.SymbolWriter;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\t/// <summary>\n\t///   An Emit Context is created for each body of code (from methods,\n\t///   properties bodies, indexer bodies or constructor bodies)\n\t/// </summary>\n\tpublic class EmitContext : BuilderContext\n\t{\n\t\t// TODO: Has to be private\n\t\tpublic readonly ILGenerator ig;\n\n\t\t/// <summary>\n\t\t///   The value that is allowed to be returned or NULL if there is no\n\t\t///   return type.\n\t\t/// </summary>\n\t\treadonly TypeSpec return_type;\n\n\t\t/// <summary>\n\t\t///   Keeps track of the Type to LocalBuilder temporary storage created\n\t\t///   to store structures (used to compute the address of the structure\n\t\t///   value on structure method invocations)\n\t\t/// </summary>\n\t\tDictionary<TypeSpec, object> temporary_storage;\n\n\t\t/// <summary>\n\t\t///   The location where we store the return value.\n\t\t/// </summary>\n\t\tpublic LocalBuilder return_value;\n\n\n\t\t/// <summary>\n\t\t///   Current loop begin and end labels.\n\t\t/// </summary>\n\t\tpublic Label LoopBegin, LoopEnd;\n\n\t\t/// <summary>\n\t\t///   Default target in a switch statement.   Only valid if\n\t\t///   InSwitch is true\n\t\t/// </summary>\n\t\tpublic Label DefaultTarget;\n\n\t\t/// <summary>\n\t\t///   If this is non-null, points to the current switch statement\n\t\t/// </summary>\n\t\tpublic Switch Switch;\n\n\t\t/// <summary>\n\t\t///  Whether we are inside an anonymous method.\n\t\t/// </summary>\n\t\tpublic AnonymousExpression CurrentAnonymousMethod;\n\t\t\n\t\treadonly IMemberContext member_context;\n\n\t\treadonly SourceMethodBuilder methodSymbols;\n\n\t\tDynamicSiteClass dynamic_site_container;\n\n\t\tLabel? return_label;\n\n\t\tList<IExpressionCleanup> epilogue_expressions;\n\n\t\tpublic EmitContext (IMemberContext rc, ILGenerator ig, TypeSpec return_type, SourceMethodBuilder methodSymbols)\n\t\t{\n\t\t\tthis.member_context = rc;\n\t\t\tthis.ig = ig;\n\t\t\tthis.return_type = return_type;\n\n\t\t\tif (rc.Module.Compiler.Settings.Checked)\n\t\t\t\tflags |= Options.CheckedScope;\n\n\t\t\tif (methodSymbols != null) {\n\t\t\t\tthis.methodSymbols = methodSymbols;\n\t\t\t\tif (!rc.Module.Compiler.Settings.Optimize)\n\t\t\t\t\tflags |= Options.AccurateDebugInfo;\n\t\t\t} else {\n\t\t\t\tflags |= Options.OmitDebugInfo;\n\t\t\t}\n\n#if STATIC\n\t\t\tig.__CleverExceptionBlockAssistance ();\n#endif\n\t\t}\n\n\t\t#region Properties\n\n\t\tinternal AsyncTaskStorey AsyncTaskStorey {\n\t\t\tget {\n\t\t\t\treturn CurrentAnonymousMethod.Storey as AsyncTaskStorey;\n\t\t\t}\n\t\t}\n\n\t\tpublic BuiltinTypes BuiltinTypes {\n\t\t\tget {\n\t\t\t\treturn MemberContext.Module.Compiler.BuiltinTypes;\n\t\t\t}\n\t\t}\n\n\t\tpublic ConditionalAccessContext ConditionalAccess { get; set; }\n\n\t\tpublic TypeSpec CurrentType {\n\t\t\tget { return member_context.CurrentType; }\n\t\t}\n\n\t\tpublic TypeParameters CurrentTypeParameters {\n\t\t    get { return member_context.CurrentTypeParameters; }\n\t\t}\n\n\t\tpublic MemberCore CurrentTypeDefinition {\n\t\t\tget { return member_context.CurrentMemberDefinition; }\n\t\t}\n\n\t\tpublic bool EmitAccurateDebugInfo {\n\t\t\tget {\n\t\t\t\treturn (flags & Options.AccurateDebugInfo) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasMethodSymbolBuilder {\n\t\t\tget {\n\t\t\t\treturn methodSymbols != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasReturnLabel {\n\t\t\tget {\n\t\t\t\treturn return_label.HasValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStatic {\n\t\t\tget { return member_context.IsStatic; }\n\t\t}\n\n\t\tpublic bool IsStaticConstructor {\n\t\t\tget {\n\t\t\t\treturn member_context.IsStatic && (flags & Options.ConstructorScope) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAnonymousStoreyMutateRequired {\n\t\t\tget {\n\t\t\t\treturn CurrentAnonymousMethod != null &&\n\t\t\t\t\tCurrentAnonymousMethod.Storey != null &&\n\t\t\t\t\tCurrentAnonymousMethod.Storey.Mutator != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic IMemberContext MemberContext {\n\t\t\tget {\n\t\t\t\treturn member_context;\n\t\t\t}\n\t\t}\n\n\t\tpublic ModuleContainer Module {\n\t\t\tget {\n\t\t\t\treturn member_context.Module;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool NotifyEvaluatorOnStore {\n\t\t\tget {\n\t\t\t\treturn Module.Evaluator != null && Module.Evaluator.ModificationListener != null;\n\t\t\t}\n\t\t}\n\n\t\t// Has to be used for specific emitter errors only any\n\t\t// possible resolver errors have to be reported during Resolve\n\t\tpublic Report Report {\n\t\t\tget {\n\t\t\t\treturn member_context.Module.Compiler.Report;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec ReturnType {\n\t\t\tget {\n\t\t\t\treturn return_type;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// The label where we have to jump before leaving the context\n\t\t//\n\t\tpublic Label ReturnLabel {\n\t\t\tget {\n\t\t\t\treturn return_label.Value;\n\t\t\t}\n\t\t}\n\n\t\tpublic List<IExpressionCleanup> StatementEpilogue {\n\t\t\tget {\n\t\t\t\treturn epilogue_expressions;\n\t\t\t}\n\t\t}\n\n\t\tpublic LocalVariable AsyncThrowVariable { get; set; }\n\n\t\tpublic List<TryFinally> TryFinallyUnwind { get; set; }\n\n\t\t#endregion\n\n\t\tpublic void AddStatementEpilog (IExpressionCleanup cleanupExpression)\n\t\t{\n\t\t\tif (epilogue_expressions == null) {\n\t\t\t\tepilogue_expressions = new List<IExpressionCleanup> ();\n\t\t\t} else if (epilogue_expressions.Contains (cleanupExpression)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tepilogue_expressions.Add (cleanupExpression);\n\t\t}\n\n\t\tpublic void AssertEmptyStack ()\n\t\t{\n#if STATIC\n\t\t\tif (ig.__StackHeight != 0)\n\t\t\t\tthrow new InternalErrorException (\"Await yields with non-empty stack in `{0}\",\n\t\t\t\t\tmember_context.GetSignatureForError ());\n#endif\n\t\t}\n\n\t\t/// <summary>\n\t\t///   This is called immediately before emitting an IL opcode to tell the symbol\n\t\t///   writer to which source line this opcode belongs.\n\t\t/// </summary>\n\t\tpublic bool Mark (Location loc)\n\t\t{\n\t\t\tif ((flags & Options.OmitDebugInfo) != 0)\n\t\t\t\treturn false;\n\n\t\t\tif (loc.IsNull || methodSymbols == null)\n\t\t\t\treturn false;\n\n\t\t\tvar sf = loc.SourceFile;\n\t\t\tif (sf.IsHiddenLocation (loc))\n\t\t\t\treturn false;\n\n#if NET_4_0\n\t\t\tmethodSymbols.MarkSequencePoint (ig.ILOffset, sf.SourceFileEntry, loc.Row, loc.Column, false);\n#endif\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void MarkCallEntry (Location loc)\n\t\t{\n\t\t\tif (!EmitAccurateDebugInfo)\n\t\t\t\treturn;\n\n\t\t\t//\n\t\t\t// TODO: This should emit different kind of sequence point to make\n\t\t\t// step-over work for statement over multiple lines\n\t\t\t//\n\t\t\t// Debugging experience for Foo (A () + B ()) where A and B are\n\t\t\t// on separate lines is not great\n\t\t\t//\n\t\t\tMark (loc);\n\t\t}\n\n\t\tpublic void DefineLocalVariable (string name, LocalBuilder builder)\n\t\t{\n\t\t\tif ((flags & Options.OmitDebugInfo) != 0)\n\t\t\t\treturn;\n\n\t\t\tmethodSymbols.AddLocal (builder.LocalIndex, name);\n\t\t}\n\n\t\tpublic void BeginCatchBlock (TypeSpec type)\n\t\t{\n\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\ttype = CurrentAnonymousMethod.Storey.Mutator.Mutate (type);\n\n\t\t\tig.BeginCatchBlock (type.GetMetaInfo ());\n\t\t}\n\n\t\tpublic void BeginFilterHandler ()\n\t\t{\n\t\t\tig.BeginCatchBlock (null);\n\t\t}\n\n\t\tpublic void BeginExceptionBlock ()\n\t\t{\n\t\t\tig.BeginExceptionBlock ();\n\t\t}\n\n\t\tpublic void BeginExceptionFilterBlock ()\n\t\t{\n\t\t\tig.BeginExceptFilterBlock ();\n\t\t}\n\n\t\tpublic void BeginFinallyBlock ()\n\t\t{\n\t\t\tig.BeginFinallyBlock ();\n\t\t}\n\n\t\tpublic void BeginScope ()\n\t\t{\n\t\t\tif ((flags & Options.OmitDebugInfo) != 0)\n\t\t\t\treturn;\n\n#if NET_4_0\n\t\t\tmethodSymbols.StartBlock (CodeBlockEntry.Type.Lexical, ig.ILOffset);\n#endif\n\t\t}\n\n\t\tpublic void BeginCompilerScope ()\n\t\t{\n\t\t\tif ((flags & Options.OmitDebugInfo) != 0)\n\t\t\t\treturn;\n\n#if NET_4_0\n\t\t\tmethodSymbols.StartBlock (CodeBlockEntry.Type.CompilerGenerated, ig.ILOffset);\n#endif\n\t\t}\n\n\t\tpublic void EndExceptionBlock ()\n\t\t{\n\t\t\tig.EndExceptionBlock ();\n\t\t}\n\n\t\tpublic void EndScope ()\n\t\t{\n\t\t\tif ((flags & Options.OmitDebugInfo) != 0)\n\t\t\t\treturn;\n\n#if NET_4_0\n\t\t\tmethodSymbols.EndBlock (ig.ILOffset);\n#endif\n\t\t}\n\n\t\tpublic void CloseConditionalAccess (TypeSpec type)\n\t\t{\n\t\t\tif (type != null)\n\t\t\t\tEmit (OpCodes.Newobj, Nullable.NullableInfo.GetConstructor (type));\n\n\t\t\tMarkLabel (ConditionalAccess.EndLabel);\n\t\t\tConditionalAccess = null;\n\t\t}\n\n\t\t//\n\t\t// Creates a nested container in this context for all dynamic compiler generated stuff\n\t\t//\n\t\tinternal DynamicSiteClass CreateDynamicSite ()\n\t\t{\n\t\t\tif (dynamic_site_container == null) {\n\t\t\t\tvar mc = member_context.CurrentMemberDefinition as MemberBase;\n\t\t\t\tdynamic_site_container = new DynamicSiteClass (CurrentTypeDefinition.Parent.PartialContainer, mc, member_context.CurrentTypeParameters);\n\n\t\t\t\tCurrentTypeDefinition.Module.AddCompilerGeneratedClass (dynamic_site_container);\n\t\t\t\tdynamic_site_container.CreateContainer ();\n\t\t\t\tdynamic_site_container.DefineContainer ();\n\t\t\t\tdynamic_site_container.Define ();\n\n\t\t\t\tvar inflator = new TypeParameterInflator (Module, CurrentType, TypeParameterSpec.EmptyTypes, TypeSpec.EmptyTypes);\n\t\t\t\tvar inflated = dynamic_site_container.CurrentType.InflateMember (inflator);\n\t\t\t\tCurrentType.MemberCache.AddMember (inflated);\n\t\t\t}\n\n\t\t\treturn dynamic_site_container;\n\t\t}\n\n\t\tpublic Label CreateReturnLabel ()\n\t\t{\n\t\t\tif (!return_label.HasValue)\n\t\t\t\treturn_label = DefineLabel ();\n\n\t\t\treturn return_label.Value;\n\t\t}\n\n\t\tpublic LocalBuilder DeclareLocal (TypeSpec type, bool pinned)\n\t\t{\n\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\ttype = CurrentAnonymousMethod.Storey.Mutator.Mutate (type);\n\n\t\t\treturn ig.DeclareLocal (type.GetMetaInfo (), pinned);\n\t\t}\n\n\t\tpublic Label DefineLabel ()\n\t\t{\n\t\t\treturn ig.DefineLabel ();\n\t\t}\n\n\t\t//\n\t\t// Creates temporary field in current async storey\n\t\t//\n\t\tpublic StackFieldExpr GetTemporaryField (TypeSpec type, bool initializedFieldRequired = false)\n\t\t{\n\t\t\tvar f = AsyncTaskStorey.AddCapturedLocalVariable (type, initializedFieldRequired);\n\t\t\tvar fexpr = new StackFieldExpr (f);\n\t\t\tfexpr.InstanceExpression = new CompilerGeneratedThis (CurrentType, Location.Null);\n\t\t\treturn fexpr;\n\t\t}\n\n\t\tpublic void MarkLabel (Label label)\n\t\t{\n\t\t\tig.MarkLabel (label);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode)\n\t\t{\n\t\t\tig.Emit (opcode);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, LocalBuilder local)\n\t\t{\n\t\t\tig.Emit (opcode, local);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, string arg)\n\t\t{\n\t\t\tig.Emit (opcode, arg);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, double arg)\n\t\t{\n\t\t\tig.Emit (opcode, arg);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, float arg)\n\t\t{\n\t\t\tig.Emit (opcode, arg);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, Label label)\n\t\t{\n\t\t\tig.Emit (opcode, label);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, Label[] labels)\n\t\t{\n\t\t\tig.Emit (opcode, labels);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, TypeSpec type)\n\t\t{\n\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\ttype = CurrentAnonymousMethod.Storey.Mutator.Mutate (type);\n\n\t\t\tig.Emit (opcode, type.GetMetaInfo ());\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, FieldSpec field)\n\t\t{\n\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\tfield = field.Mutate (CurrentAnonymousMethod.Storey.Mutator);\n\n\t\t\tig.Emit (opcode, field.GetMetaInfo ());\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, MethodSpec method)\n\t\t{\n\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\tmethod = method.Mutate (CurrentAnonymousMethod.Storey.Mutator);\n\n\t\t\tif (method.IsConstructor)\n\t\t\t\tig.Emit (opcode, (ConstructorInfo) method.GetMetaInfo ());\n\t\t\telse\n\t\t\t\tig.Emit (opcode, (MethodInfo) method.GetMetaInfo ());\n\t\t}\n\n\t\t// TODO: REMOVE breaks mutator\n\t\tpublic void Emit (OpCode opcode, MethodInfo method)\n\t\t{\n\t\t\tig.Emit (opcode, method);\n\t\t}\n\n\t\tpublic void Emit (OpCode opcode, MethodSpec method, MetaType[] vargs)\n\t\t{\n\t\t\t// TODO MemberCache: This should mutate too\n\t\t\tig.EmitCall (opcode, (MethodInfo) method.GetMetaInfo (), vargs);\n\t\t}\n\n\t\tpublic void EmitArrayNew (ArrayContainer ac)\n\t\t{\n\t\t\tif (ac.Rank == 1) {\n\t\t\t\tvar type = IsAnonymousStoreyMutateRequired ?\n\t\t\t\t\tCurrentAnonymousMethod.Storey.Mutator.Mutate (ac.Element) :\n\t\t\t\t\tac.Element;\n\n\t\t\t\tig.Emit (OpCodes.Newarr, type.GetMetaInfo ());\n\t\t\t} else {\n\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\tac = (ArrayContainer) ac.Mutate (CurrentAnonymousMethod.Storey.Mutator);\n\n\t\t\t\tig.Emit (OpCodes.Newobj, ac.GetConstructor ());\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitArrayAddress (ArrayContainer ac)\n\t\t{\n\t\t\tif (ac.Rank > 1) {\n\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\tac = (ArrayContainer) ac.Mutate (CurrentAnonymousMethod.Storey.Mutator);\n\n\t\t\t\tig.Emit (OpCodes.Call, ac.GetAddressMethod ());\n\t\t\t} else {\n\t\t\t\tvar type = IsAnonymousStoreyMutateRequired ?\n\t\t\t\t\tCurrentAnonymousMethod.Storey.Mutator.Mutate (ac.Element) :\n\t\t\t\t\tac.Element;\n\n\t\t\t\tig.Emit (OpCodes.Ldelema, type.GetMetaInfo ());\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Emits the right opcode to load from an array\n\t\t//\n\t\tpublic void EmitArrayLoad (ArrayContainer ac)\n\t\t{\n\t\t\tif (ac.Rank > 1) {\n\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\tac = (ArrayContainer) ac.Mutate (CurrentAnonymousMethod.Storey.Mutator);\n\n\t\t\t\tig.Emit (OpCodes.Call, ac.GetGetMethod ());\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\tvar type = ac.Element;\n\t\t\tif (type.Kind == MemberKind.Enum)\n\t\t\t\ttype = EnumSpec.GetUnderlyingType (type);\n\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\t//\n\t\t\t\t// Workaround MSIL limitation. Load bool element as single bit,\n\t\t\t\t// bool array can actually store any byte value\n\t\t\t\t//\n\t\t\t\tig.Emit (OpCodes.Ldelem_U1);\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_0);\n\t\t\t\tig.Emit (OpCodes.Cgt_Un);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tig.Emit (OpCodes.Ldelem_U1);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tig.Emit (OpCodes.Ldelem_I1);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tig.Emit (OpCodes.Ldelem_I2);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tig.Emit (OpCodes.Ldelem_U2);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tig.Emit (OpCodes.Ldelem_I4);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tig.Emit (OpCodes.Ldelem_U4);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tig.Emit (OpCodes.Ldelem_I8);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tig.Emit (OpCodes.Ldelem_R4);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tig.Emit (OpCodes.Ldelem_R8);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.IntPtr:\n\t\t\t\tig.Emit (OpCodes.Ldelem_I);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tswitch (type.Kind) {\n\t\t\t\tcase MemberKind.Struct:\n\t\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\t\ttype = CurrentAnonymousMethod.Storey.Mutator.Mutate (type);\n\n\t\t\t\t\tig.Emit (OpCodes.Ldelema, type.GetMetaInfo ());\n\t\t\t\t\tig.Emit (OpCodes.Ldobj, type.GetMetaInfo ());\n\t\t\t\t\tbreak;\n\t\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\t\ttype = CurrentAnonymousMethod.Storey.Mutator.Mutate (type);\n\n\t\t\t\t\tig.Emit (OpCodes.Ldelem, type.GetMetaInfo ());\n\t\t\t\t\tbreak;\n\t\t\t\tcase MemberKind.PointerType:\n\t\t\t\t\tig.Emit (OpCodes.Ldelem_I);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tig.Emit (OpCodes.Ldelem_Ref);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Emits the right opcode to store to an array\n\t\t//\n\t\tpublic void EmitArrayStore (ArrayContainer ac)\n\t\t{\n\t\t\tif (ac.Rank > 1) {\n\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\tac = (ArrayContainer) ac.Mutate (CurrentAnonymousMethod.Storey.Mutator);\n\n\t\t\t\tig.Emit (OpCodes.Call, ac.GetSetMethod ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar type = ac.Element;\n\n\t\t\tif (type.Kind == MemberKind.Enum)\n\t\t\t\ttype = EnumSpec.GetUnderlyingType (type);\n\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\tEmit (OpCodes.Stelem_I1);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tEmit (OpCodes.Stelem_I2);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tEmit (OpCodes.Stelem_I4);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tEmit (OpCodes.Stelem_I8);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tEmit (OpCodes.Stelem_R4);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tEmit (OpCodes.Stelem_R8);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch (type.Kind) {\n\t\t\tcase MemberKind.Struct:\n\t\t\t\tEmit (OpCodes.Stobj, type);\n\t\t\t\tbreak;\n\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\tEmit (OpCodes.Stelem, type);\n\t\t\t\tbreak;\n\t\t\tcase MemberKind.PointerType:\n\t\t\t\tEmit (OpCodes.Stelem_I);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tEmit (OpCodes.Stelem_Ref);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitInt (int i)\n\t\t{\n\t\t\tEmitIntConstant (i);\n\t\t}\n\n\t\tvoid EmitIntConstant (int i)\n\t\t{\n\t\t\tswitch (i) {\n\t\t\tcase -1:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_M1);\n\t\t\t\tbreak;\n\n\t\t\tcase 0:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_0);\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_1);\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_2);\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_3);\n\t\t\t\tbreak;\n\n\t\t\tcase 4:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_4);\n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_5);\n\t\t\t\tbreak;\n\n\t\t\tcase 6:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_6);\n\t\t\t\tbreak;\n\n\t\t\tcase 7:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_7);\n\t\t\t\tbreak;\n\n\t\t\tcase 8:\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_8);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif (i >= -128 && i <= 127) {\n\t\t\t\t\tig.Emit (OpCodes.Ldc_I4_S, (sbyte) i);\n\t\t\t\t} else\n\t\t\t\t\tig.Emit (OpCodes.Ldc_I4, i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitLong (long l)\n\t\t{\n\t\t\tif (l >= int.MinValue && l <= int.MaxValue) {\n\t\t\t\tEmitIntConstant (unchecked ((int) l));\n\t\t\t\tig.Emit (OpCodes.Conv_I8);\n\t\t\t} else if (l >= 0 && l <= uint.MaxValue) {\n\t\t\t\tEmitIntConstant (unchecked ((int) l));\n\t\t\t\tig.Emit (OpCodes.Conv_U8);\n\t\t\t} else {\n\t\t\t\tig.Emit (OpCodes.Ldc_I8, l);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Load the object from the pointer.  \n\t\t//\n\t\tpublic void EmitLoadFromPtr (TypeSpec type)\n\t\t{\n\t\t\tif (type.Kind == MemberKind.Enum)\n\t\t\t\ttype = EnumSpec.GetUnderlyingType (type);\n\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tig.Emit (OpCodes.Ldind_I4);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tig.Emit (OpCodes.Ldind_U4);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tig.Emit (OpCodes.Ldind_I2);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tig.Emit (OpCodes.Ldind_U2);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tig.Emit (OpCodes.Ldind_U1);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tig.Emit (OpCodes.Ldind_I1);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\tig.Emit (OpCodes.Ldind_I1);\n\t\t\t\tig.Emit (OpCodes.Ldc_I4_0);\n\t\t\t\tig.Emit (OpCodes.Cgt_Un);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tig.Emit (OpCodes.Ldind_I8);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tig.Emit (OpCodes.Ldind_R4);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tig.Emit (OpCodes.Ldind_R8);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.IntPtr:\n\t\t\t\tig.Emit (OpCodes.Ldind_I);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tswitch (type.Kind) {\n\t\t\t\tcase MemberKind.Struct:\n\t\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\t\ttype = CurrentAnonymousMethod.Storey.Mutator.Mutate (type);\n\n\t\t\t\t\tig.Emit (OpCodes.Ldobj, type.GetMetaInfo ());\n\t\t\t\t\tbreak;\n\t\t\t\tcase MemberKind.PointerType:\n\t\t\t\t\tig.Emit (OpCodes.Ldind_I);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tig.Emit (OpCodes.Ldind_Ref);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitNull ()\n\t\t{\n\t\t\tig.Emit (OpCodes.Ldnull);\n\t\t}\n\n\t\tpublic void EmitArgumentAddress (int pos)\n\t\t{\n\t\t\tif (!IsStatic)\n\t\t\t\t++pos;\n\n\t\t\tif (pos > byte.MaxValue)\n\t\t\t\tig.Emit (OpCodes.Ldarga, pos);\n\t\t\telse\n\t\t\t\tig.Emit (OpCodes.Ldarga_S, (byte) pos);\n\t\t}\n\n\t\tpublic void EmitArgumentLoad (int pos)\n\t\t{\n\t\t\tif (!IsStatic)\n\t\t\t\t++pos;\n\n\t\t\tswitch (pos) {\n\t\t\tcase 0: ig.Emit (OpCodes.Ldarg_0); break;\n\t\t\tcase 1: ig.Emit (OpCodes.Ldarg_1); break;\n\t\t\tcase 2: ig.Emit (OpCodes.Ldarg_2); break;\n\t\t\tcase 3: ig.Emit (OpCodes.Ldarg_3); break;\n\t\t\tdefault:\n\t\t\t\tif (pos > byte.MaxValue)\n\t\t\t\t\tig.Emit (OpCodes.Ldarg, pos);\n\t\t\t\telse\n\t\t\t\t\tig.Emit (OpCodes.Ldarg_S, (byte) pos);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitArgumentStore (int pos)\n\t\t{\n\t\t\tif (!IsStatic)\n\t\t\t\t++pos;\n\n\t\t\tif (pos > byte.MaxValue)\n\t\t\t\tig.Emit (OpCodes.Starg, pos);\n\t\t\telse\n\t\t\t\tig.Emit (OpCodes.Starg_S, (byte) pos);\n\t\t}\n\n\t\t//\n\t\t// The stack contains the pointer and the value of type `type'\n\t\t//\n\t\tpublic void EmitStoreFromPtr (TypeSpec type)\n\t\t{\n\t\t\tif (type.IsEnum)\n\t\t\t\ttype = EnumSpec.GetUnderlyingType (type);\n\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tig.Emit (OpCodes.Stind_I4);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tig.Emit (OpCodes.Stind_I8);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tig.Emit (OpCodes.Stind_I2);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tig.Emit (OpCodes.Stind_R4);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tig.Emit (OpCodes.Stind_R8);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\tig.Emit (OpCodes.Stind_I1);\n\t\t\t\treturn;\n\t\t\tcase BuiltinTypeSpec.Type.IntPtr:\n\t\t\t\tig.Emit (OpCodes.Stind_I);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch (type.Kind) {\n\t\t\tcase MemberKind.Struct:\n\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\tif (IsAnonymousStoreyMutateRequired)\n\t\t\t\t\ttype = CurrentAnonymousMethod.Storey.Mutator.Mutate (type);\n\n\t\t\t\tig.Emit (OpCodes.Stobj, type.GetMetaInfo ());\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tig.Emit (OpCodes.Stind_Ref);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitThis ()\n\t\t{\n\t\t\tig.Emit (OpCodes.Ldarg_0);\n\t\t}\n\n\t\tpublic void EmitEpilogue ()\n\t\t{\n\t\t\tif (epilogue_expressions == null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var e in epilogue_expressions)\n\t\t\t\te.EmitCleanup (this);\n\n\t\t\tepilogue_expressions = null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Returns a temporary storage for a variable of type t as \n\t\t///   a local variable in the current body.\n\t\t/// </summary>\n\t\tpublic LocalBuilder GetTemporaryLocal (TypeSpec t)\n\t\t{\n\t\t\tif (temporary_storage != null) {\n\t\t\t\tobject o;\n\t\t\t\tif (temporary_storage.TryGetValue (t, out o)) {\n\t\t\t\t\tif (o is Stack<LocalBuilder>) {\n\t\t\t\t\t\tvar s = (Stack<LocalBuilder>) o;\n\t\t\t\t\t\to = s.Count == 0 ? null : s.Pop ();\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemporary_storage.Remove (t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (o != null)\n\t\t\t\t\treturn (LocalBuilder) o;\n\t\t\t}\n\t\t\treturn DeclareLocal (t, false);\n\t\t}\n\n\t\tpublic void FreeTemporaryLocal (LocalBuilder b, TypeSpec t)\n\t\t{\n\t\t\tif (temporary_storage == null) {\n\t\t\t\ttemporary_storage = new Dictionary<TypeSpec, object> (ReferenceEquality<TypeSpec>.Default);\n\t\t\t\ttemporary_storage.Add (t, b);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tobject o;\n\t\t\t\n\t\t\tif (!temporary_storage.TryGetValue (t, out o)) {\n\t\t\t\ttemporary_storage.Add (t, b);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar s = o as Stack<LocalBuilder>;\n\t\t\tif (s == null) {\n\t\t\t\ts = new Stack<LocalBuilder> ();\n\t\t\t\ts.Push ((LocalBuilder)o);\n\t\t\t\ttemporary_storage [t] = s;\n\t\t\t}\n\t\t\ts.Push (b);\n\t\t}\n\n\t\t/// <summary>\n\t\t///   ReturnValue creates on demand the LocalBuilder for the\n\t\t///   return value from the function.  By default this is not\n\t\t///   used.  This is only required when returns are found inside\n\t\t///   Try or Catch statements.\n\t\t///\n\t\t///   This method is typically invoked from the Emit phase, so\n\t\t///   we allow the creation of a return label if it was not\n\t\t///   requested during the resolution phase.   Could be cleaned\n\t\t///   up, but it would replicate a lot of logic in the Emit phase\n\t\t///   of the code that uses it.\n\t\t/// </summary>\n\t\tpublic LocalBuilder TemporaryReturn ()\n\t\t{\n\t\t\tif (return_value == null){\n\t\t\t\treturn_value = DeclareLocal (return_type, false);\n\t\t\t}\n\n\t\t\treturn return_value;\n\t\t}\n\t}\n\n\tpublic class ConditionalAccessContext\n\t{\n\t\tpublic ConditionalAccessContext (TypeSpec type, Label endLabel)\n\t\t{\n\t\t\tType = type;\n\t\t\tEndLabel = endLabel;\n\t\t}\n\n\t\tpublic bool Statement { get; set; }\n\t\tpublic Label EndLabel { get; private set; }\n\t\tpublic TypeSpec Type { get; private set; }\n\t}\n\n\tstruct CallEmitter\n\t{\n\t\tpublic Expression InstanceExpression;\n\n\t\t//\n\t\t// When call has to leave an extra copy of all arguments on the stack\n\t\t//\n\t\tpublic bool DuplicateArguments;\n\n\t\t//\n\t\t// Does not emit InstanceExpression load when InstanceExpressionOnStack\n\t\t// is set. Used by compound assignments.\n\t\t//\n\t\tpublic bool InstanceExpressionOnStack;\n\n\t\t//\n\t\t// Any of arguments contains await expression\n\t\t//\n\t\tpublic bool HasAwaitArguments;\n\n\t\tpublic bool ConditionalAccess;\n\n\t\t//\n\t\t// When dealing with await arguments the original arguments are converted\n\t\t// into a new set with hoisted stack results\n\t\t//\n\t\tpublic Arguments EmittedArguments;\n\n\t\tpublic void Emit (EmitContext ec, MethodSpec method, Arguments Arguments, Location loc)\n\t\t{\n\t\t\tEmitPredefined (ec, method, Arguments, false, loc);\n\t\t}\n\n\t\tpublic void EmitStatement (EmitContext ec, MethodSpec method, Arguments Arguments, Location loc)\n\t\t{\n\t\t\tEmitPredefined (ec, method, Arguments, true, loc);\n\t\t}\n\n\t\tpublic void EmitPredefined (EmitContext ec, MethodSpec method, Arguments Arguments, bool statement = false, Location? loc = null)\n\t\t{\n\t\t\tExpression instance_copy = null;\n\n\t\t\tif (!HasAwaitArguments && ec.HasSet (BuilderContext.Options.AsyncBody)) {\n\t\t\t\tHasAwaitArguments = Arguments != null && Arguments.ContainsEmitWithAwait ();\n\t\t\t\tif (HasAwaitArguments && InstanceExpressionOnStack) {\n\t\t\t\t\tthrow new NotSupportedException ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tOpCode call_op;\n\t\t\tLocalTemporary lt = null;\n\n\t\t\tif (method.IsStatic) {\n\t\t\t\tcall_op = OpCodes.Call;\n\t\t\t} else {\n\t\t\t\tcall_op = IsVirtualCallRequired (InstanceExpression, method) ? OpCodes.Callvirt : OpCodes.Call;\n\n\t\t\t\tif (HasAwaitArguments) {\n\t\t\t\t\tinstance_copy = InstanceExpression.EmitToField (ec);\n\t\t\t\t\tvar ie = new InstanceEmitter (instance_copy, IsAddressCall (instance_copy, call_op, method.DeclaringType));\n\n\t\t\t\t\tif (Arguments == null) {\n\t\t\t\t\t\tie.EmitLoad (ec);\n\t\t\t\t\t}\n\t\t\t\t} else if (!InstanceExpressionOnStack) {\n\t\t\t\t\tvar ie = new InstanceEmitter (InstanceExpression, IsAddressCall (InstanceExpression, call_op, method.DeclaringType));\n\t\t\t\t\tie.Emit (ec, ConditionalAccess);\n\n\t\t\t\t\tif (DuplicateArguments) {\n\t\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\t\tif (Arguments != null && Arguments.Count != 0) {\n\t\t\t\t\t\t\tlt = new LocalTemporary (ie.GetStackType (ec));\n\t\t\t\t\t\t\tlt.Store (ec);\n\t\t\t\t\t\t\tinstance_copy = lt;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Arguments != null && !InstanceExpressionOnStack) {\n\t\t\t\tEmittedArguments = Arguments.Emit (ec, DuplicateArguments, HasAwaitArguments);\n\t\t\t\tif (EmittedArguments != null) {\n\t\t\t\t\tif (instance_copy != null) {\n\t\t\t\t\t\tvar ie = new InstanceEmitter (instance_copy, IsAddressCall (instance_copy, call_op, method.DeclaringType));\n\t\t\t\t\t\tie.Emit (ec, ConditionalAccess);\n\n\t\t\t\t\t\tif (lt != null)\n\t\t\t\t\t\t\tlt.Release (ec);\n\t\t\t\t\t}\n\n\t\t\t\t\tEmittedArguments.Emit (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (call_op == OpCodes.Callvirt && (InstanceExpression.Type.IsGenericParameter || InstanceExpression.Type.IsStructOrEnum)) {\n\t\t\t\tec.Emit (OpCodes.Constrained, InstanceExpression.Type);\n\t\t\t}\n\n\t\t\tif (loc != null) {\n\t\t\t\t//\n\t\t\t\t// Emit explicit sequence point for expressions like Foo.Bar () to help debugger to\n\t\t\t\t// break at right place when LHS expression can be stepped-into\n\t\t\t\t//\n\t\t\t\tec.MarkCallEntry (loc.Value);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Set instance expression to actual result expression. When it contains await it can be\n\t\t\t// picked up by caller\n\t\t\t//\n\t\t\tInstanceExpression = instance_copy;\n\n\t\t\tif (method.Parameters.HasArglist) {\n\t\t\t\tvar varargs_types = GetVarargsTypes (method, Arguments);\n\t\t\t\tec.Emit (call_op, method, varargs_types);\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// If you have:\n\t\t\t\t// this.DoFoo ();\n\t\t\t\t// and DoFoo is not virtual, you can omit the callvirt,\n\t\t\t\t// because you don't need the null checking behavior.\n\t\t\t\t//\n\t\t\t\tec.Emit (call_op, method);\n\t\t\t}\n\n\t\t\t// \n\t\t\t// Pop the return value if there is one and stack should be empty\n\t\t\t//\n\t\t\tif (statement && method.ReturnType.Kind != MemberKind.Void)\n\t\t\t\tec.Emit (OpCodes.Pop);\n\t\t}\n\n\t\tstatic MetaType[] GetVarargsTypes (MethodSpec method, Arguments arguments)\n\t\t{\n\t\t\tAParametersCollection pd = method.Parameters;\n\n\t\t\tArgument a = arguments[pd.Count - 1];\n\t\t\tArglist list = (Arglist) a.Expr;\n\n\t\t\treturn list.ArgumentTypes;\n\t\t}\n\n\t\t//\n\t\t// Used to decide whether call or callvirt is needed\n\t\t//\n\t\tstatic bool IsVirtualCallRequired (Expression instance, MethodSpec method)\n\t\t{\n\t\t\t//\n\t\t\t// There are 2 scenarious where we emit callvirt\n\t\t\t//\n\t\t\t// Case 1: A method is virtual and it's not used to call base\n\t\t\t// Case 2: A method instance expression can be null. In this casen callvirt ensures\n\t\t\t// correct NRE exception when the method is called\n\t\t\t//\n\t\t\tvar decl_type = method.DeclaringType;\n\t\t\tif (decl_type.IsStruct || decl_type.IsEnum)\n\t\t\t\treturn false;\n\n\t\t\tif (instance is BaseThis)\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// It's non-virtual and will never be null and it can be determined\n\t\t\t// whether it's known value or reference type by verifier\n\t\t\t//\n\t\t\tif (!method.IsVirtual && Expression.IsNeverNull (instance) && !instance.Type.IsGenericParameter)\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic bool IsAddressCall (Expression instance, OpCode callOpcode, TypeSpec declaringType)\n\t\t{\n\t\t\tvar instance_type = instance.Type;\n\t\t\treturn (instance_type.IsStructOrEnum && (callOpcode == OpCodes.Callvirt || (callOpcode == OpCodes.Call && declaringType.IsStruct))) ||\n\t\t\t\tinstance_type.IsGenericParameter || declaringType.IsNullableType;\n\t\t}\n\t}\n\n\tpublic struct InstanceEmitter\n\t{\n\t\treadonly Expression instance;\n\t\treadonly bool addressRequired;\n\n\t\tpublic InstanceEmitter (Expression instance, bool addressLoad)\n\t\t{\n\t\t\tthis.instance = instance;\n\t\t\tthis.addressRequired = addressLoad;\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec, bool conditionalAccess)\n\t\t{\n\t\t\tLabel NullOperatorLabel;\n\t\t\tNullable.Unwrap unwrap;\n\n\t\t\tif (conditionalAccess && Expression.IsNeverNull (instance))\n\t\t\t\tconditionalAccess = false;\n\n\t\t\tif (conditionalAccess) {\n\t\t\t\tNullOperatorLabel = ec.DefineLabel ();\n\t\t\t\tunwrap = instance as Nullable.Unwrap;\n\t\t\t} else {\n\t\t\t\tNullOperatorLabel = new Label ();\n\t\t\t\tunwrap = null;\n\t\t\t}\n\n\t\t\tIMemoryLocation instance_address = null;\n\t\t\tbool conditional_access_dup = false;\n\n\t\t\tif (unwrap != null) {\n\t\t\t\tunwrap.Store (ec);\n\t\t\t\tunwrap.EmitCheck (ec);\n\t\t\t\tec.Emit (OpCodes.Brtrue_S, NullOperatorLabel);\n\t\t\t} else {\n\t\t\t\tif (conditionalAccess && addressRequired) {\n\t\t\t\t\t//\n\t\t\t\t\t// Don't allocate temp variable when instance load is cheap and load and load-address\n\t\t\t\t\t// operate on same memory\n\t\t\t\t\t//\n\t\t\t\t\tinstance_address = instance as VariableReference;\n\t\t\t\t\tif (instance_address == null)\n\t\t\t\t\t\tinstance_address = instance as LocalTemporary;\n\n\t\t\t\t\tif (instance_address == null) {\n\t\t\t\t\t\tEmitLoad (ec);\n\t\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\t\tec.EmitLoadFromPtr (instance.Type);\n\n\t\t\t\t\t\tconditional_access_dup = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinstance.Emit (ec);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (instance.Type.Kind == MemberKind.TypeParameter)\n\t\t\t\t\t\tec.Emit (OpCodes.Box, instance.Type);\n\t\t\t\t} else {\n\t\t\t\t\tEmitLoad (ec);\n\n\t\t\t\t\tif (conditionalAccess) {\n\t\t\t\t\t\tconditional_access_dup = !IsInexpensiveLoad ();\n\t\t\t\t\t\tif (conditional_access_dup)\n\t\t\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conditionalAccess) {\n\t\t\t\t\tec.Emit (OpCodes.Brtrue_S, NullOperatorLabel);\n\n\t\t\t\t\tif (conditional_access_dup)\n\t\t\t\t\t\tec.Emit (OpCodes.Pop);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (conditionalAccess) {\n\t\t\t\tif (!ec.ConditionalAccess.Statement) {\n\t\t\t\t\tif (ec.ConditionalAccess.Type.IsNullableType)\n\t\t\t\t\t\tNullable.LiftedNull.Create (ec.ConditionalAccess.Type, Location.Null).Emit (ec);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.EmitNull ();\n\t\t\t\t}\n\n\t\t\t\tec.Emit (OpCodes.Br, ec.ConditionalAccess.EndLabel);\n\t\t\t\tec.MarkLabel (NullOperatorLabel);\n\n\t\t\t\tif (instance_address != null) {\n\t\t\t\t\tinstance_address.AddressOf (ec, AddressOp.Load);\n\t\t\t\t} else if (unwrap != null) {\n\t\t\t\t\tunwrap.Emit (ec);\n\t\t\t\t\tvar tmp = ec.GetTemporaryLocal (unwrap.Type);\n\t\t\t\t\tec.Emit (OpCodes.Stloc, tmp);\n\t\t\t\t\tec.Emit (OpCodes.Ldloca, tmp);\n\t\t\t\t\tec.FreeTemporaryLocal (tmp, unwrap.Type);\n\t\t\t\t} else if (!conditional_access_dup) {\n\t\t\t\t\tinstance.Emit (ec);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitLoad (EmitContext ec)\n\t\t{\n\t\t\tvar instance_type = instance.Type;\n\n\t\t\t//\n\t\t\t// Push the instance expression\n\t\t\t//\n\t\t\tif (addressRequired) {\n\t\t\t\t//\n\t\t\t\t// If the expression implements IMemoryLocation, then\n\t\t\t\t// we can optimize and use AddressOf on the\n\t\t\t\t// return.\n\t\t\t\t//\n\t\t\t\t// If not we have to use some temporary storage for\n\t\t\t\t// it.\n\t\t\t\tvar iml = instance as IMemoryLocation;\n\t\t\t\tif (iml != null) {\n\t\t\t\t\timl.AddressOf (ec, AddressOp.Load);\n\t\t\t\t} else {\n\t\t\t\t\tLocalTemporary temp = new LocalTemporary (instance_type);\n\t\t\t\t\tinstance.Emit (ec);\n\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t\ttemp.AddressOf (ec, AddressOp.Load);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tinstance.Emit (ec);\n\n\t\t\t// Only to make verifier happy\n\t\t\tif (RequiresBoxing ())\n\t\t\t\tec.Emit (OpCodes.Box, instance_type);\n\t\t}\n\n\t\tpublic TypeSpec GetStackType (EmitContext ec)\n\t\t{\n\t\t\tvar instance_type = instance.Type;\n\n\t\t\tif (addressRequired)\n\t\t\t\treturn ReferenceContainer.MakeType (ec.Module, instance_type);\n\n\t\t\tif (instance_type.IsStructOrEnum)\n\t\t\t\treturn ec.Module.Compiler.BuiltinTypes.Object;\n\n\t\t\treturn instance_type;\n\t\t}\n\n\t\tbool RequiresBoxing ()\n\t\t{\n\t\t\tvar instance_type = instance.Type;\n\t\t\tif (instance_type.IsGenericParameter && !(instance is This) && TypeSpec.IsReferenceType (instance_type))\n\t\t\t\treturn true;\n\n\t\t\tif (instance_type.IsStructOrEnum)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tbool IsInexpensiveLoad ()\n\t\t{\n\t\t\tif (instance is Constant)\n\t\t\t\treturn instance.IsSideEffectFree;\n\n\t\t\tif (RequiresBoxing ())\n\t\t\t\treturn false;\n\n\t\t\tvar vr = instance as VariableReference;\n\t\t\tif (vr != null)\n\t\t\t\treturn !vr.IsRef;\n\n\t\t\tif (instance is LocalTemporary)\n\t\t\t\treturn true;\n\n\t\t\tvar fe = instance as FieldExpr;\n\t\t\tif (fe != null)\n\t\t\t\treturn fe.IsStatic || fe.InstanceExpression is This;\n\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs",
    "content": "//\n// complete.cs: Expression that are used for completion suggestions.\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2003-2009 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n// Completion* classes derive from ExpressionStatement as this allows\n// them to pass through the parser in many conditions that require\n// statements even when the expression is incomplete (for example\n// completing inside a lambda\n//\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Mono.CSharp {\n\n\t//\n\t// A common base class for Completing expressions, it\n\t// is just a very simple ExpressionStatement\n\t//\n\tpublic abstract class CompletingExpression : ExpressionStatement\n\t{\n\t\tpublic static void AppendResults (List<string> results, string prefix, IEnumerable<string> names)\n\t\t{\n\t\t\tforeach (string name in names) {\n\t\t\t\tif (name == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (prefix != null && !name.StartsWith (prefix))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (results.Contains (name))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (prefix != null)\n\t\t\t\t\tresults.Add (name.Substring (prefix.Length));\n\t\t\t\telse\n\t\t\t\t\tresults.Add (name);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\t// Do nothing\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// Do nothing\n\t\t}\n\t}\n\t\n\tpublic class CompletionSimpleName : CompletingExpression {\n\t\tpublic string Prefix;\n\t\t\n\t\tpublic CompletionSimpleName (string prefix, Location l)\n\t\t{\n\t\t\tthis.loc = l;\n\t\t\tthis.Prefix = prefix;\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tvar results = new List<string> ();\n\n\t\t\tec.CurrentMemberDefinition.GetCompletionStartingWith (Prefix, results);\n\n\t\t\tthrow new CompletionResult (Prefix, results.Distinct ().Select (l => l.Substring (Prefix.Length)).ToArray ());\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\t// Nothing\n\t\t}\n\t}\n\t\n\tpublic class CompletionMemberAccess : CompletingExpression {\n\t\tExpression expr;\n\t\tstring partial_name;\n\t\tTypeArguments targs;\n\t\t\n\t\tpublic CompletionMemberAccess (Expression e, string partial_name, Location l)\n\t\t{\n\t\t\tthis.expr = e;\n\t\t\tthis.loc = l;\n\t\t\tthis.partial_name = partial_name;\n\t\t}\n\n\t\tpublic CompletionMemberAccess (Expression e, string partial_name, TypeArguments targs, Location l)\n\t\t{\n\t\t\tthis.expr = e;\n\t\t\tthis.loc = l;\n\t\t\tthis.partial_name = partial_name;\n\t\t\tthis.targs = targs;\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tvar sn = expr as SimpleName;\n\t\t\tconst ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;\n\n\t\t\tif (sn != null) {\n\t\t\t\texpr = sn.LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess | MemberLookupRestrictions.ExactArity);\n\n\t\t\t\t//\n\t\t\t\t// Resolve expression which does have type set as we need expression type\n\t\t\t\t// with disable flow analysis as we don't know whether left side expression\n\t\t\t\t// is used as variable or type\n\t\t\t\t//\n\t\t\t\tif (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess) {\n\t\t\t\t\texpr = expr.Resolve (rc);\n\t\t\t\t} else if (expr is TypeParameterExpr) {\n\t\t\t\t\texpr.Error_UnexpectedKind (rc, flags, sn.Location);\n\t\t\t\t\texpr = null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\texpr = expr.Resolve (rc, flags);\n\t\t\t}\n\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec expr_type = expr.Type;\n\t\t\tif (expr_type.IsPointer || expr_type.Kind == MemberKind.Void || expr_type == InternalType.NullLiteral || expr_type == InternalType.AnonymousMethod) {\n\t\t\t\texpr.Error_OperatorCannotBeApplied (rc, loc, \".\", expr_type);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (targs != null) {\n\t\t\t\tif (!targs.Resolve (rc))\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar results = new List<string> ();\n\t\t\tvar nexpr = expr as NamespaceExpression;\n\t\t\tif (nexpr != null) {\n\t\t\t\tstring namespaced_partial;\n\n\t\t\t\tif (partial_name == null)\n\t\t\t\t\tnamespaced_partial = nexpr.Namespace.Name;\n\t\t\t\telse\n\t\t\t\t\tnamespaced_partial = nexpr.Namespace.Name + \".\" + partial_name;\n\n\t\t\t\trc.CurrentMemberDefinition.GetCompletionStartingWith (namespaced_partial, results);\n\t\t\t\tif (partial_name != null)\n\t\t\t\t\tresults = results.Select (l => l.Substring (partial_name.Length)).ToList ();\n\t\t\t} else {\n\t\t\t\tvar r = MemberCache.GetCompletitionMembers (rc, expr_type, partial_name).Select (l => l.Name);\n\t\t\t\tAppendResults (results, partial_name, r);\n\t\t\t}\n\n\t\t\tthrow new CompletionResult (partial_name == null ? \"\" : partial_name, results.Distinct ().ToArray ());\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tCompletionMemberAccess target = (CompletionMemberAccess) t;\n\n\t\t\tif (targs != null)\n\t\t\t\ttarget.targs = targs.Clone ();\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\t}\n\n\tpublic class CompletionElementInitializer : CompletingExpression {\n\t\tstring partial_name;\n\t\t\n\t\tpublic CompletionElementInitializer (string partial_name, Location l)\n\t\t{\n\t\t\tthis.partial_name = partial_name;\n\t\t\tthis.loc = l;\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tvar members = MemberCache.GetCompletitionMembers (ec, ec.CurrentInitializerVariable.Type, partial_name);\n\n// TODO: Does this mean exact match only ?\n//\t\t\tif (partial_name != null && results.Count > 0 && result [0] == \"\")\n//\t\t\t\tthrow new CompletionResult (\"\", new string [] { \"=\" });\n\n\t\t\tvar results = members.Where (l => (l.Kind & (MemberKind.Field | MemberKind.Property)) != 0).Select (l => l.Name).ToList ();\n\t\t\tif (partial_name != null) {\n\t\t\t\tvar temp = new List<string> ();\n\t\t\t\tAppendResults (temp, partial_name, results);\n\t\t\t\tresults = temp;\n\t\t\t}\n\n\t\t\tthrow new CompletionResult (partial_name == null ? \"\" : partial_name, results.Distinct ().ToArray ());\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\t// Nothing\n\t\t}\n\t}\n\n\tpublic class EmptyCompletion : CompletingExpression\n\t{\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tthrow new CompletionResult (\"\", new string [0]);\n\t\t}\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/const.cs",
    "content": "//\n// const.cs: Constant declarations.\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@seznam.cz)\n//\n// Copyright 2001-2003 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n//\n\n#if STATIC\nusing IKVM.Reflection;\n#else\nusing System.Reflection;\n#endif\n\nnamespace Mono.CSharp {\n\n\tpublic class Const : FieldBase\n\t{\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE;\n\n\t\tpublic Const (TypeDefinition parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod_flags, AllowedModifiers, name, attrs)\n\t\t{\n\t\t\tModFlags |= Modifiers.STATIC;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Defines the constant in the @parent\n\t\t/// </summary>\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (!member_type.IsConstantCompatible) {\n\t\t\t\tError_InvalidConstantType (member_type, Location, Report);\n\t\t\t}\n\n\t\t\tFieldAttributes field_attr = FieldAttributes.Static | ModifiersExtensions.FieldAttr (ModFlags);\n\t\t\t// Decimals cannot be emitted into the constant blob.  So, convert to 'readonly'.\n\t\t\tif (member_type.BuiltinType == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\tfield_attr |= FieldAttributes.InitOnly;\n\t\t\t} else {\n\t\t\t\tfield_attr |= FieldAttributes.Literal;\n\t\t\t}\n\n\t\t\tFieldBuilder = Parent.TypeBuilder.DefineField (Name, MemberType.GetMetaInfo (), field_attr);\n\t\t\tspec = new ConstSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags, initializer);\n\n\t\t\tParent.MemberCache.AddMember (spec);\n\n\t\t\tif ((field_attr & FieldAttributes.InitOnly) != 0)\n\t\t\t\tParent.PartialContainer.RegisterFieldForInitialization (this,\n\t\t\t\t\tnew FieldInitializer (this, initializer, Location));\n\n\t\t\tif (declarators != null) {\n\t\t\t\tvar t = new TypeExpression (MemberType, TypeExpression.Location);\n\t\t\t\tforeach (var d in declarators) {\n\t\t\t\t\tvar c = new Const (Parent, t, ModFlags & ~Modifiers.STATIC, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);\n\t\t\t\t\tc.initializer = d.Initializer;\n\t\t\t\t\t((ConstInitializer) c.initializer).Name = d.Name.Value;\n\t\t\t\t\tc.Define ();\n\t\t\t\t\tParent.PartialContainer.Members.Add (c);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void DefineValue ()\n\t\t{\n\t\t\tvar rc = new ResolveContext (this);\n\t\t\t((ConstSpec) spec).GetConstant (rc);\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Emits the field value by evaluating the expression\n\t\t/// </summary>\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tvar c = ((ConstSpec) spec).Value as Constant;\n\t\t\tif (c.Type.BuiltinType == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\tModule.PredefinedAttributes.DecimalConstant.EmitAttribute (FieldBuilder, (decimal) c.GetValue (), c.Location);\n\t\t\t} else {\n\t\t\t\tFieldBuilder.SetConstant (c.GetValue ());\n\t\t\t}\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic static void Error_InvalidConstantType (TypeSpec t, Location loc, Report Report)\n\t\t{\n\t\t\tif (t.IsGenericParameter) {\n\t\t\t\tReport.Error (1959, loc,\n\t\t\t\t\t\"Type parameter `{0}' cannot be declared const\", t.GetSignatureForError ());\n\t\t\t} else {\n\t\t\t\tReport.Error (283, loc,\n\t\t\t\t\t\"The type `{0}' cannot be declared const\", t.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ConstSpec : FieldSpec\n\t{\n\t\tExpression value;\n\n\t\tpublic ConstSpec (TypeSpec declaringType, IMemberDefinition definition, TypeSpec memberType, FieldInfo fi, Modifiers mod, Expression value)\n\t\t\t: base (declaringType, definition, memberType, fi, mod)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}\n\n\t\t//\n\t\t// This expresion is guarantee to be a constant at emit phase only\n\t\t//\n\t\tpublic Expression Value {\n\t\t\tget {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// For compiled constants we have to resolve the value as there could be constant dependecies. This\n\t\t// is needed for imported constants too to get the right context type\n\t\t//\n\t\tpublic Constant GetConstant (ResolveContext rc)\n\t\t{\n\t\t\tif (value.eclass != ExprClass.Value)\n\t\t\t\tvalue = value.Resolve (rc);\n\n\t\t\treturn (Constant) value;\n\t\t}\n\t}\n\n\tpublic class ConstInitializer : ShimExpression\n\t{\n\t\tbool in_transit;\n\t\treadonly FieldBase field;\n\n\t\tpublic ConstInitializer (FieldBase field, Expression value, Location loc)\n\t\t\t: base (value)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t\tthis.field = field;\n\t\t}\n\n\t\tpublic string Name { get; set; }\n\n\t\tprotected override Expression DoResolve (ResolveContext unused)\n\t\t{\n\t\t\tif (type != null)\n\t\t\t\treturn expr;\n\n\t\t\tvar opt = ResolveContext.Options.ConstantScope;\n\t\t\tif (field is EnumMember)\n\t\t\t\topt |= ResolveContext.Options.EnumScope;\n\n\t\t\t//\n\t\t\t// Use a context in which the constant was declared and\n\t\t\t// not the one in which is referenced\n\t\t\t//\n\t\t\tvar rc = new ResolveContext (field, opt);\n\t\t\texpr = DoResolveInitializer (rc);\n\t\t\ttype = expr.Type;\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tprotected virtual Expression DoResolveInitializer (ResolveContext rc)\n\t\t{\n\t\t\tif (in_transit) {\n\t\t\t\tfield.Compiler.Report.Error (110, expr.Location,\n\t\t\t\t\t\"The evaluation of the constant value for `{0}' involves a circular definition\",\n\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\texpr = null;\n\t\t\t} else {\n\t\t\t\tin_transit = true;\n\t\t\t\texpr = expr.Resolve (rc);\n\t\t\t}\n\n\t\t\tin_transit = false;\n\n\t\t\tif (expr != null) {\n\t\t\t\tConstant c = expr as Constant;\n\t\t\t\tif (c != null)\n\t\t\t\t\tc = field.ConvertInitializer (rc, c);\n\n\t\t\t\tif (c == null) {\n\t\t\t\t\tif (TypeSpec.IsReferenceType (field.MemberType))\n\t\t\t\t\t\tError_ConstantCanBeInitializedWithNullOnly (rc, field.MemberType, expr.Location, GetSignatureForError ());\n\t\t\t\t\telse if (!(expr is Constant))\n\t\t\t\t\t\tError_ExpressionMustBeConstant (rc, expr.Location, GetSignatureForError ());\n\t\t\t\t\telse\n\t\t\t\t\t\texpr.Error_ValueCannotBeConverted (rc, field.MemberType, false);\n\t\t\t\t}\n\n\t\t\t\texpr = c;\n\t\t\t}\n\n\t\t\tif (expr == null) {\n\t\t\t\texpr = New.Constantify (field.MemberType, Location);\n\t\t\t\tif (expr == null)\n\t\t\t\t\texpr = Constant.CreateConstantFromValue (field.MemberType, null, Location);\n\t\t\t\texpr = expr.Resolve (rc);\n\t\t\t}\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tif (Name == null)\n\t\t\t\treturn field.GetSignatureForError ();\n\n\t\t\treturn field.Parent.GetSignatureForError () + \".\" + Name;\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs",
    "content": "//\n// constant.cs: Constants.\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001-2003 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011-2013 Xamarin Inc\n//\n\nusing System;\nusing System.Globalization;\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t/// <summary>\n\t///   Base class for constants and literals.\n\t/// </summary>\n\tpublic abstract class Constant : Expression\n\t{\n\t\tstatic readonly NumberFormatInfo nfi = CultureInfo.InvariantCulture.NumberFormat;\n\n\t\tprotected Constant (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\toverride public string ToString ()\n\t\t{\n\t\t\treturn this.GetType ().Name + \" (\" + GetValueAsLiteral () + \")\";\n\t\t}\n\n\t\t/// <summary>\n\t\t///  This is used to obtain the actual value of the literal\n\t\t///  cast into an object.\n\t\t/// </summary>\n\t\tpublic abstract object GetValue ();\n\n\t\tpublic abstract long GetValueAsLong ();\n\n\t\tpublic abstract string GetValueAsLiteral ();\n\n#if !STATIC\n\t\t//\n\t\t// Returns an object value which is typed to contant type\n\t\t//\n\t\tpublic virtual object GetTypedValue ()\n\t\t{\n\t\t\treturn GetValue ();\n\t\t}\n#endif\n\n\t\tpublic override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)\n\t\t{\n\t\t\tif (!expl && IsLiteral && \n\t\t\t\tBuiltinTypeSpec.IsPrimitiveTypeOrDecimal (target) &&\n\t\t\t\tBuiltinTypeSpec.IsPrimitiveTypeOrDecimal (type)) {\n\t\t\t\tec.Report.Error (31, loc, \"Constant value `{0}' cannot be converted to a `{1}'\",\n\t\t\t\t\tGetValueAsLiteral (), target.GetSignatureForError ());\n\t\t\t} else {\n\t\t\t\tbase.Error_ValueCannotBeConverted (ec, target, expl);\n\t\t\t}\n\t\t}\n\n\t\tpublic Constant ImplicitConversionRequired (ResolveContext ec, TypeSpec type)\n\t\t{\n\t\t\tConstant c = ConvertImplicitly (type);\n\t\t\tif (c == null)\n\t\t\t\tError_ValueCannotBeConverted (ec, type, false);\n\n\t\t\treturn c;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic virtual Constant ConvertImplicitly (TypeSpec type)\n\t\t{\n\t\t\tif (this.type == type)\n\t\t\t\treturn this;\n\n\t\t\tif (!Convert.ImplicitNumericConversionExists (this.type, type))\n\t\t\t\treturn null;\n\n\t\t\tbool fail;\t\t\t\n\t\t\tobject constant_value = ChangeType (GetValue (), type, out fail);\n\t\t\tif (fail){\n\t\t\t\t//\n\t\t\t\t// We should always catch the error before this is ever\n\t\t\t\t// reached, by calling Convert.ImplicitStandardConversionExists\n\t\t\t\t//\n\t\t\t\tthrow new InternalErrorException (\"Missing constant conversion between `{0}' and `{1}'\",\n\t\t\t\t Type.GetSignatureForError (), type.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn CreateConstantFromValue (type, constant_value, loc);\n\t\t}\n\n\t\t//\n\t\t//  Returns a constant instance based on Type\n\t\t//\n\t\tpublic static Constant CreateConstantFromValue (TypeSpec t, object v, Location loc)\n\t\t{\n\t\t\tswitch (t.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (t, (int) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\t\treturn new StringConstant (t, (string) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\treturn new UIntConstant (t, (uint) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (t, (long) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn new ULongConstant (t, (ulong) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (t, (float) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (t, (double) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\treturn new ShortConstant (t, (short) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\treturn new UShortConstant (t, (ushort) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\treturn new SByteConstant (t, (sbyte) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\treturn new ByteConstant (t, (byte) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\treturn new CharConstant (t, (char) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\treturn new BoolConstant (t, (bool) v, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (t, (decimal) v, loc);\n\t\t\t}\n\n\t\t\tif (t.IsEnum) {\n\t\t\t\tvar real_type = EnumSpec.GetUnderlyingType (t);\n\t\t\t\treturn new EnumConstant (CreateConstantFromValue (real_type, v, loc), t);\n\t\t\t}\n\n\t\t\tif (v == null) {\n\t\t\t\tif (t.IsNullableType)\n\t\t\t\t\treturn Nullable.LiftedNull.Create (t, loc);\n\n\t\t\t\tif (TypeSpec.IsReferenceType (t))\n\t\t\t\t\treturn new NullConstant (t, loc);\n\t\t\t}\n\n#if STATIC\n\t\t\tthrow new InternalErrorException (\"Constant value `{0}' has unexpected underlying type `{1}'\", v, t.GetSignatureForError ());\n#else\n\t\t\treturn null;\n#endif\n\t\t}\n\n\t\t//\n\t\t// Returns a constant instance based on value and type. This is probing version of\n\t\t// CreateConstantFromValue\n\t\t//\n\t\tpublic static Constant ExtractConstantFromValue (TypeSpec t, object v, Location loc)\n\t\t{\n\t\t\tswitch (t.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (v is int)\n\t\t\t\t\treturn new IntConstant (t, (int) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\t\tif (v is string)\n\t\t\t\t\treturn new StringConstant (t, (string) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (v is uint)\n\t\t\t\t\treturn new UIntConstant (t, (uint) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tif (v is long)\n\t\t\t\t\treturn new LongConstant (t, (long) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tif (v is ulong)\n\t\t\t\t\treturn new ULongConstant (t, (ulong) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tif (v is float)\n\t\t\t\t\treturn new FloatConstant (t, (float) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tif (v is double)\n\t\t\t\t\treturn new DoubleConstant (t, (double) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (v is short)\n\t\t\t\t\treturn new ShortConstant (t, (short) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (v is ushort)\n\t\t\t\t\treturn new UShortConstant (t, (ushort) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (v is sbyte)\n\t\t\t\t\treturn new SByteConstant (t, (sbyte) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (v is byte)\n\t\t\t\t\treturn new ByteConstant (t, (byte) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (v is char)\n\t\t\t\t\treturn new CharConstant (t, (char) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\tif (v is bool)\n\t\t\t\t\treturn new BoolConstant (t, (bool) v, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\tif (v is decimal)\n\t\t\t\t\treturn new DecimalConstant (t, (decimal) v, loc);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (t.IsEnum) {\n\t\t\t\tvar real_type = EnumSpec.GetUnderlyingType (t);\n\t\t\t\treturn new EnumConstant (CreateConstantFromValue (real_type, v, loc), t);\n\t\t\t}\n\n\t\t\tif (v == null) {\n\t\t\t\tif (t.IsNullableType)\n\t\t\t\t\treturn Nullable.LiftedNull.Create (t, loc);\n\n\t\t\t\tif (TypeSpec.IsReferenceType (t))\n\t\t\t\t\treturn new NullConstant (t, loc);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (this));\n\t\t\targs.Add (new Argument (new TypeOf (type, loc)));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Constant\", args);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Maybe ConvertTo name is better. It tries to convert `this' constant to target_type.\n\t\t/// It throws OverflowException \n\t\t/// </summary>\n\t\t// DON'T CALL THIS METHOD DIRECTLY AS IT DOES NOT HANDLE ENUMS\n\t\tpublic abstract Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type);\n\n\t\t// This is a custom version of Convert.ChangeType() which works\n\t\t// with the TypeBuilder defined types when compiling corlib.\n\t\tstatic object ChangeType (object value, TypeSpec targetType, out bool error)\n\t\t{\n\t\t\tIConvertible convert_value = value as IConvertible;\n\n\t\t\tif (convert_value == null) {\n\t\t\t\terror = true;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// We cannot rely on build-in type conversions as they are\n\t\t\t// more limited than what C# supports.\n\t\t\t// See char -> float/decimal/double conversion\n\t\t\t//\n\t\t\terror = false;\n\t\t\ttry {\n\t\t\t\tswitch (targetType.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\t\treturn convert_value.ToBoolean (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn convert_value.ToByte (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn convert_value.ToChar (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn convert_value.ToInt16 (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn convert_value.ToInt32 (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn convert_value.ToInt64 (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn convert_value.ToSByte (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\tif (convert_value.GetType () == typeof (char))\n\t\t\t\t\t\treturn (decimal) convert_value.ToInt32 (nfi);\n\t\t\t\t\treturn convert_value.ToDecimal (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\tif (convert_value.GetType () == typeof (char))\n\t\t\t\t\t\treturn (double) convert_value.ToInt32 (nfi);\n\t\t\t\t\treturn convert_value.ToDouble (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\tif (convert_value.GetType () == typeof (char))\n\t\t\t\t\t\treturn (float) convert_value.ToInt32 (nfi);\n\t\t\t\t\treturn convert_value.ToSingle (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\t\t\treturn convert_value.ToString (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn convert_value.ToUInt16 (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn convert_value.ToUInt32 (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn convert_value.ToUInt64 (nfi);\n\t\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t}\n\n\t\t\terror = true;\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\t//\n\t\t// Attempts to do a compile-time folding of a constant cast and handles\n\t\t// error reporting for constant overlows only, on normal conversion\n\t\t// errors returns null\n\t\t// \n\t\tpublic Constant Reduce (ResolveContext ec, TypeSpec target_type)\n\t\t{\n\t\t\ttry {\n\t\t\t\treturn TryReduceConstant (ec, target_type);\n\t\t\t} catch (OverflowException) {\n\t\t\t\tif (ec.ConstantCheckState && Type.BuiltinType != BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\t\tec.Report.Error (221, loc,\n\t\t\t\t\t\t\"Constant value `{0}' cannot be converted to a `{1}' (use `unchecked' syntax to override)\",\n\t\t\t\t\t\tGetValueAsLiteral (), target_type.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tError_ValueCannotBeConverted (ec, target_type, false);\n\t\t\t\t}\n\n\t\t\t\treturn New.Constantify (target_type, loc);\n\t\t\t}\n\t\t}\n\n\t\tpublic Constant TryReduce (ResolveContext rc, TypeSpec targetType)\n\t\t{\n\t\t\ttry {\n\t\t\t\treturn TryReduceConstant (rc, targetType);\n\t\t\t} catch (OverflowException) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tConstant TryReduceConstant (ResolveContext ec, TypeSpec target_type)\n\t\t{\n\t\t\tif (Type == target_type) {\n\t\t\t\t//\n\t\t\t\t// Reducing literal value produces a new constant. Syntactically 10 is not same as (int)10 \n\t\t\t\t//\n\t\t\t\tif (IsLiteral)\n\t\t\t\t\treturn CreateConstantFromValue (target_type, GetValue (), loc);\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tConstant c;\n\t\t\tif (target_type.IsEnum) {\n\t\t\t\tc = TryReduceConstant (ec, EnumSpec.GetUnderlyingType (target_type));\n\t\t\t\tif (c == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new EnumConstant (c, target_type);\n\t\t\t}\n\n\t\t\treturn ConvertExplicitly (ec.ConstantCheckState, target_type);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Need to pass type as the constant can require a boxing\n\t\t/// and in such case no optimization is possible\n\t\t/// </summary>\n\t\tpublic bool IsDefaultInitializer (TypeSpec type)\n\t\t{\n\t\t\tif (type == Type)\n\t\t\t\treturn IsDefaultValue;\n\n\t\t\treturn this is NullLiteral;\n\t\t}\n\n\t\tpublic abstract bool IsDefaultValue {\n\t\t\tget;\n\t\t}\n\n\t\tpublic abstract bool IsNegative {\n\t\t\tget;\n\t\t}\n\n\t\t//\n\t\t// When constant is declared as literal\n\t\t//\n\t\tpublic virtual bool IsLiteral {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tpublic virtual bool IsOneInteger {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true iff 1) the stack type of this is one of Object, \n\t\t// int32, int64 and 2) this == 0 or this == null.\n\t\t//\n\t\tpublic virtual bool IsZeroInteger {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\n\t\tpublic sealed override Expression Clone (CloneContext clonectx)\n\t\t{\n\t\t\t// No cloning is not needed for constants\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"should not be reached\");\n\t\t}\n\n\t\tpublic override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn System.Linq.Expressions.Expression.Constant (GetTypedValue (), type.GetMetaInfo ());\n#endif\n\t\t}\n\n\t\tpublic new bool Resolve (ResolveContext rc)\n\t\t{\n\t\t\t// It exists only as hint not to call Resolve on constants\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t}\n\n\tpublic abstract class IntegralConstant : Constant\n\t{\n\t\tprotected IntegralConstant (TypeSpec type, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\teclass = ExprClass.Value;\n\t\t}\n\n\t\tpublic override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)\n\t\t{\n\t\t\ttry {\n\t\t\t\tConvertExplicitly (true, target);\n\t\t\t\tbase.Error_ValueCannotBeConverted (ec, target, expl);\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\tec.Report.Error (31, loc, \"Constant value `{0}' cannot be converted to a `{1}'\",\n\t\t\t\t\tGetValue ().ToString (), target.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn GetValue ().ToString ();\n\t\t}\n\t\t\n\t\tpublic abstract Constant Increment ();\n\t}\n\t\n\tpublic class BoolConstant : Constant {\n\t\tpublic readonly bool Value;\n\n\t\tpublic BoolConstant (BuiltinTypes types, bool val, Location loc)\n\t\t\t: this (types.Bool, val, loc)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic BoolConstant (TypeSpec type, bool val, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t\tthis.type = type;\n\n\t\t\tValue = val;\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn (object) Value;\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn Value ? \"true\" : \"false\";\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value ? 1 : 0;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (Value)\n\t\t\t\tec.EmitInt (1);\n\t\t\telse\n\t\t\t\tec.EmitInt (0);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn !Value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == false; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class ByteConstant : IntegralConstant\n\t{\n\t\tpublic readonly byte Value;\n\n\t\tpublic ByteConstant (BuiltinTypes types, byte v, Location loc)\n\t\t\t: this (types.Byte, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic ByteConstant (TypeSpec type, byte v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitInt (Value);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t\treturn new ByteConstant (type, checked ((byte)(Value + 1)), loc);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context){\n\t\t\t\t\tif (Value > SByte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class CharConstant : Constant {\n\t\tpublic readonly char Value;\n\n\t\tpublic CharConstant (BuiltinTypes types, char v, Location loc)\n\t\t\t: this (types.Char, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic CharConstant (TypeSpec type, char v, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode ((ushort) Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitInt (Value);\n\t\t}\n\n\t\tstatic string descape (char c)\n\t\t{\n\t\t\tswitch (c){\n\t\t\tcase '\\a':\n\t\t\t\treturn \"\\\\a\"; \n\t\t\tcase '\\b':\n\t\t\t\treturn \"\\\\b\"; \n\t\t\tcase '\\n':\n\t\t\t\treturn \"\\\\n\"; \n\t\t\tcase '\\t':\n\t\t\t\treturn \"\\\\t\"; \n\t\t\tcase '\\v':\n\t\t\t\treturn \"\\\\v\"; \n\t\t\tcase '\\r':\n\t\t\t\treturn \"\\\\r\"; \n\t\t\tcase '\\\\':\n\t\t\t\treturn \"\\\\\\\\\";\n\t\t\tcase '\\f':\n\t\t\t\treturn \"\\\\f\"; \n\t\t\tcase '\\0':\n\t\t\t\treturn \"\\\\0\"; \n\t\t\tcase '\"':\n\t\t\t\treturn \"\\\\\\\"\"; \n\t\t\tcase '\\'':\n\t\t\t\treturn \"\\\\\\'\"; \n\t\t\t}\n\t\t\treturn c.ToString ();\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn \"\\\"\" + descape (Value) + \"\\\"\";\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == '\\0'; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Byte.MinValue || Value > Byte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > SByte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > Int16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class SByteConstant : IntegralConstant\n\t{\n\t\tpublic readonly sbyte Value;\n\n\t\tpublic SByteConstant (BuiltinTypes types, sbyte v, Location loc)\n\t\t\t: this (types.SByte, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic SByteConstant (TypeSpec type, sbyte v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitInt (Value);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t    return new SByteConstant (type, checked((sbyte)(Value + 1)), loc);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Value < 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class ShortConstant : IntegralConstant {\n\t\tpublic readonly short Value;\n\n\t\tpublic ShortConstant (BuiltinTypes types, short v, Location loc)\n\t\t\t: this (types.Short, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic ShortConstant (TypeSpec type, short v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitInt (Value);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t\treturn new ShortConstant (type, checked((short)(Value + 1)), loc);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Value < 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Byte.MinValue || Value > Byte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < SByte.MinValue || Value > SByte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Char.MinValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class UShortConstant : IntegralConstant\n\t{\n\t\tpublic readonly ushort Value;\n\n\t\tpublic UShortConstant (BuiltinTypes types, ushort v, Location loc)\n\t\t\t: this (types.UShort, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic UShortConstant (TypeSpec type, ushort v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitInt (Value);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t\treturn new UShortConstant (type, checked((ushort)(Value + 1)), loc);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\t\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > Byte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > SByte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > Int16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > Char.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class IntConstant : IntegralConstant\n\t{\n\t\tpublic readonly int Value;\n\n\t\tpublic IntConstant (BuiltinTypes types, int v, Location loc)\n\t\t\t: this (types.Int, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic IntConstant (TypeSpec type, int v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitInt (Value);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t\treturn new IntConstant (type, checked(Value + 1), loc);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Value < 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Byte.MinValue || Value > Byte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < SByte.MinValue || Value > SByte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Int16.MinValue || Value > Int16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < UInt16.MinValue || Value > UInt16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < UInt32.MinValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Char.MinValue || Value > Char.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec type)\n\t\t{\n\t\t\tif (this.type == type)\n\t\t\t\treturn this;\n\n\t\t\tConstant c = TryImplicitIntConversion (type);\n\t\t\tif (c != null)\n\t\t\t\treturn c; //.Resolve (rc);\n\n\t\t\treturn base.ConvertImplicitly (type);\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Attempts to perform an implicit constant conversion of the IntConstant\n\t\t///   into a different data type using casts (See Implicit Constant\n\t\t///   Expression Conversions)\n\t\t/// </summary>\n\t\tConstant TryImplicitIntConversion (TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (Value >= SByte.MinValue && Value <= SByte.MaxValue)\n\t\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (Value >= Byte.MinValue && Value <= Byte.MaxValue)\n\t\t\t\t\treturn new ByteConstant (target_type, (byte) Value, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (Value >= Int16.MinValue && Value <= Int16.MaxValue)\n\t\t\t\t\treturn new ShortConstant (target_type, (short) Value, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (Value >= UInt16.MinValue && Value <= UInt16.MaxValue)\n\t\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (Value >= 0)\n\t\t\t\t\treturn new UIntConstant (target_type, (uint) Value, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t//\n\t\t\t\t// we can optimize this case: a positive int32\n\t\t\t\t// always fits on a uint64.  But we need an opcode\n\t\t\t\t// to do it.\n\t\t\t\t//\n\t\t\t\tif (Value >= 0)\n\t\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, loc);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, loc);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class UIntConstant : IntegralConstant {\n\t\tpublic readonly uint Value;\n\n\t\tpublic UIntConstant (BuiltinTypes types, uint v, Location loc)\n\t\t\t: this (types.UInt, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic UIntConstant (TypeSpec type, uint v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitInt (unchecked ((int) Value));\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t\treturn new UIntConstant (type, checked(Value + 1), loc);\n\t\t}\n\t\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < 0 || Value > byte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > SByte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > Int16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < UInt16.MinValue || Value > UInt16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value > Int32.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Char.MinValue || Value > Char.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class LongConstant : IntegralConstant {\n\t\tpublic readonly long Value;\n\n\t\tpublic LongConstant (BuiltinTypes types, long v, Location loc)\n\t\t\t: this (types.Long, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic LongConstant (TypeSpec type, long v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitLong (Value);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t\treturn new LongConstant (type, checked(Value + 1), loc);\n\t\t}\n\t\t\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Value < 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Byte.MinValue || Value > Byte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < SByte.MinValue || Value > SByte.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Int16.MinValue || Value > Int16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < UInt16.MinValue || Value > UInt16.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Int32.MinValue || Value > Int32.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < UInt32.MinValue || Value > UInt32.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tif (in_checked_context && Value < 0)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Char.MinValue || Value > Char.MaxValue)\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec type)\n\t\t{\n\t\t\tif (Value >= 0 && type.BuiltinType == BuiltinTypeSpec.Type.ULong) {\n\t\t\t\treturn new ULongConstant (type, (ulong) Value, loc);\n\t\t\t}\n\n\t\t\treturn base.ConvertImplicitly (type);\n\t\t}\n\t}\n\n\tpublic class ULongConstant : IntegralConstant {\n\t\tpublic readonly ulong Value;\n\n\t\tpublic ULongConstant (BuiltinTypes types, ulong v, Location loc)\n\t\t\t: this (types.ULong, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic ULongConstant (TypeSpec type, ulong v, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitLong (unchecked ((long) Value));\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn (long) Value;\n\t\t}\n\n\t\tpublic override Constant Increment ()\n\t\t{\n\t\t\treturn new ULongConstant (type, checked(Value + 1), loc);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget {\n\t\t\t\treturn Value == 1;\n\t\t\t}\n\t\t}\t\t\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Value == 0; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context && Value > Byte.MaxValue)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context && Value > ((ulong) SByte.MaxValue))\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context && Value > ((ulong) Int16.MaxValue))\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context && Value > UInt16.MaxValue)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (in_checked_context && Value > UInt32.MaxValue)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (in_checked_context && Value > UInt32.MaxValue)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tif (in_checked_context && Value > Int64.MaxValue)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context && Value > Char.MaxValue)\n\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class FloatConstant : Constant {\n\t\t//\n\t\t// Store constant value as double because float constant operations\n\t\t// need to work on double value to match JIT\n\t\t//\n\t\tpublic readonly double DoubleValue;\n\n\t\tpublic FloatConstant (BuiltinTypes types, double v, Location loc)\n\t\t\t: this (types.Float, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic FloatConstant (TypeSpec type, double v, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tDoubleValue = v;\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec type)\n\t\t{\n\t\t\tif (type.BuiltinType == BuiltinTypeSpec.Type.Double)\n\t\t\t\treturn new DoubleConstant (type, DoubleValue, loc);\n\n\t\t\treturn base.ConvertImplicitly (type);\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (OpCodes.Ldc_R4, Value);\n\t\t}\n\n\t\tpublic float Value {\n\t\t\tget {\n\t\t\t\treturn (float) DoubleValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn Value.ToString ();\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Value < 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < byte.MinValue || Value > byte.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < sbyte.MinValue || Value > sbyte.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < short.MinValue || Value > short.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ShortConstant (target_type, (short) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < ushort.MinValue || Value > ushort.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UShortConstant (target_type, (ushort) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < int.MinValue || Value > int.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new IntConstant (target_type, (int) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < uint.MinValue || Value > uint.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UIntConstant (target_type, (uint) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < long.MinValue || Value > long.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new LongConstant (target_type, (long) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < ulong.MinValue || Value > ulong.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ULongConstant (target_type, (ulong) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < (float) char.MinValue || Value > (float) char.MaxValue || float.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new CharConstant (target_type, (char) DoubleValue, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) DoubleValue, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class DoubleConstant : Constant\n\t{\n\t\tpublic readonly double Value;\n\n\t\tpublic DoubleConstant (BuiltinTypes types, double v, Location loc)\n\t\t\t: this (types.Double, v, loc)\n\t\t{\n\t\t}\n\n\t\tpublic DoubleConstant (TypeSpec type, double v, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tValue = v;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (OpCodes.Ldc_R8, Value);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn Value.ToString ();\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Value < 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < Byte.MinValue || Value > Byte.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < SByte.MinValue || Value > SByte.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < short.MinValue || Value > short.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < ushort.MinValue || Value > ushort.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < int.MinValue || Value > int.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new IntConstant (target_type, (int) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < uint.MinValue || Value > uint.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < long.MinValue || Value > long.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new LongConstant (target_type, (long) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < ulong.MinValue || Value > ulong.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tif (in_checked_context) {\n\t\t\t\t\tif (Value < (double) char.MinValue || Value > (double) char.MaxValue || double.IsNaN (Value))\n\t\t\t\t\t\tthrow new OverflowException ();\n\t\t\t\t}\n\t\t\t\treturn new CharConstant (target_type, (char) Value, Location);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (target_type, (decimal) Value, Location);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t}\n\n\tpublic class DecimalConstant : Constant {\n\t\tpublic readonly decimal Value;\n\n\t\tpublic DecimalConstant (BuiltinTypes types, decimal d, Location loc)\n\t\t\t: this (types.Decimal, d, loc)\n\t\t{\n\t\t}\n\n\t\tpublic DecimalConstant (TypeSpec type, decimal d, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tValue = d;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tMethodSpec m;\n\n\t\t\tint [] words = decimal.GetBits (Value);\n\t\t\tint power = (words [3] >> 16) & 0xff;\n\n\t\t\tif (power == 0) {\n\t\t\t\tif (Value <= int.MaxValue && Value >= int.MinValue) {\n\t\t\t\t\tm = ec.Module.PredefinedMembers.DecimalCtorInt.Resolve (loc);\n\t\t\t\t\tif (m == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tec.EmitInt ((int) Value);\n\t\t\t\t\tec.Emit (OpCodes.Newobj, m);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (Value <= long.MaxValue && Value >= long.MinValue) {\n\t\t\t\t\tm = ec.Module.PredefinedMembers.DecimalCtorLong.Resolve (loc);\n\t\t\t\t\tif (m == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tec.EmitLong ((long) Value);\n\t\t\t\t\tec.Emit (OpCodes.Newobj, m);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tec.EmitInt (words [0]);\n\t\t\tec.EmitInt (words [1]);\n\t\t\tec.EmitInt (words [2]);\n\n\t\t\t// sign\n\t\t\tec.EmitInt (words [3] >> 31);\n\n\t\t\t// power\n\t\t\tec.EmitInt (power);\n\n\t\t\tm = ec.Module.PredefinedMembers.DecimalCtor.Resolve (loc);\n\t\t\tif (m != null) {\n\t\t\t\tec.Emit (OpCodes.Newobj, m);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Value < 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\treturn new SByteConstant (target_type, (sbyte) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\treturn new ByteConstant (target_type, (byte) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\treturn new ShortConstant (target_type, (short) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\treturn new UShortConstant (target_type, (ushort) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (target_type, (int) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\treturn new UIntConstant (target_type, (uint) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (target_type, (long) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn new ULongConstant (target_type, (ulong) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\treturn new CharConstant (target_type, (char) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (target_type, (float) Value, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (target_type, (double) Value, loc);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn Value.ToString () + \"M\";\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\t}\n\n\tpublic class StringConstant : Constant {\n\t\tpublic StringConstant (BuiltinTypes types, string s, Location loc)\n\t\t\t: this (types.String, s, loc)\n\t\t{\n\t\t}\n\n\t\tpublic StringConstant (TypeSpec type, string s, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tValue = s;\n\t\t}\n\n\t\tprotected StringConstant (Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t}\n\n\t\tpublic string Value { get; protected set; }\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\t// FIXME: Escape the string.\n\t\t\treturn \"\\\"\" + Value + \"\\\"\";\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (Value == null) {\n\t\t\t\tec.EmitNull ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Use string.Empty for both literals and constants even if\n\t\t\t// it's not allowed at language level\n\t\t\t//\n\t\t\tif (Value.Length == 0 && ec.Module.Compiler.Settings.Optimize) {\n\t\t\t\tvar string_type = ec.BuiltinTypes.String;\n\t\t\t\tif (ec.CurrentType != string_type) {\n\t\t\t\t\tvar m = ec.Module.PredefinedMembers.StringEmpty.Get ();\n\t\t\t\t\tif (m != null) {\n\t\t\t\t\t\tec.Emit (OpCodes.Ldsfld, m);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Ldstr, Value);\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\t// cast to object\n\t\t\tif (type != targetType)\n\t\t\t\tenc.Encode (type);\n\n\t\t\tenc.Encode (Value);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Value == null;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNull {\n\t\t\tget {\n\t\t\t\treturn IsDefaultValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec type)\n\t\t{\n\t\t\tif (IsDefaultValue && type.BuiltinType == BuiltinTypeSpec.Type.Object)\n\t\t\t\treturn new NullConstant (type, loc);\n\n\t\t\treturn base.ConvertImplicitly (type);\n\t\t}\n\t}\n\n\tclass NameOf : StringConstant\n\t{\n\t\treadonly SimpleName name;\n\n\t\tpublic NameOf (SimpleName name)\n\t\t\t: base (name.Location)\n\t\t{\n\t\t\tthis.name = name;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tbool ResolveArgumentExpression (ResolveContext rc, Expression expr)\n\t\t{\n\t\t\tvar sn = expr as SimpleName;\n\t\t\tif (sn != null) {\n\t\t\t\tValue = sn.Name;\n\n\t\t\t\tif (rc.Module.Compiler.Settings.Version < LanguageVersion.V_6)\n\t\t\t\t\trc.Report.FeatureIsNotAvailable (rc.Module.Compiler, Location, \"nameof operator\");\n\n\t\t\t\tif (sn.HasTypeArguments) {\n\t\t\t\t\t// TODO: csc compatible but unhelpful error message\n\t\t\t\t\trc.Report.Error (1001, loc, \"Identifier expected\");\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tsn.LookupNameExpression (rc, MemberLookupRestrictions.IgnoreArity | MemberLookupRestrictions.IgnoreAmbiguity);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar ma = expr as MemberAccess;\n\t\t\tif (ma != null) {\n\t\t\t\tFullNamedExpression fne = ma.LeftExpression as ATypeNameExpression;\n\t\t\t\tif (fne == null) {\n\t\t\t\t\tvar qam = ma as QualifiedAliasMember;\n\t\t\t\t\tif (qam == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tfne = qam.CreateExpressionFromAlias (rc);\n\t\t\t\t\tif (fne == null)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tValue = ma.Name;\n\n\t\t\t\tif (rc.Module.Compiler.Settings.Version < LanguageVersion.V_6)\n\t\t\t\t\trc.Report.FeatureIsNotAvailable (rc.Module.Compiler, Location, \"nameof operator\");\n\n\t\t\t\tif (ma.HasTypeArguments) {\n\t\t\t\t\t// TODO: csc compatible but unhelpful error message\n\t\t\t\t\trc.Report.Error (1001, loc, \"Identifier expected\");\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tvar left = fne.ResolveAsTypeOrNamespace (rc, true);\n\t\t\t\tif (left == null)\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar ns = left as NamespaceExpression;\n\t\t\t\tif (ns != null) {\n\t\t\t\t\tFullNamedExpression retval = ns.LookupTypeOrNamespace (rc, ma.Name, 0, LookupMode.NameOf, loc);\n\t\t\t\t\tif (retval == null)\n\t\t\t\t\t\tns.Error_NamespaceDoesNotExist (rc, ma.Name, 0);\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (left.Type.IsGenericOrParentIsGeneric && left.Type.GetDefinition () != left.Type) {\n\t\t\t\t\trc.Report.Error (8071, loc, \"Type arguments are not allowed in the nameof operator\");\n\t\t\t\t}\n\n\t\t\t\tvar mexpr = MemberLookup (rc, false, left.Type, ma.Name, 0, MemberLookupRestrictions.IgnoreArity | MemberLookupRestrictions.IgnoreAmbiguity, loc);\n\t\t\t\tif (mexpr == null) {\n\t\t\t\t\tma.Error_IdentifierNotFound (rc, left.Type);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic Expression ResolveOverload (ResolveContext rc, Arguments args)\n\t\t{\n\t\t\tif (args == null || args.Count != 1) {\n\t\t\t\tname.Error_NameDoesNotExist (rc);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar arg = args [0];\n\t\t\tvar res = ResolveArgumentExpression (rc, arg.Expr);\n\t\t\tif (!res) {\n\t\t\t\tname.Error_NameDoesNotExist (rc);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\ttype = rc.BuiltinTypes.String;\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t//\n\t// Null constant can have its own type, think of `default (Foo)'\n\t//\n\tpublic class NullConstant : Constant\n\t{\n\t\tpublic NullConstant (TypeSpec type, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t\tthis.type = type;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (type == InternalType.NullLiteral || type.BuiltinType == BuiltinTypeSpec.Type.Object) {\n\t\t\t\t// Optimized version, also avoids referencing literal internal type\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (this));\n\t\t\t\treturn CreateExpressionFactoryCall (ec, \"Constant\", args);\n\t\t\t}\n\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tswitch (targetType.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\t\t// Type it as string cast\n\t\t\t\tenc.Encode (rc.Module.Compiler.BuiltinTypes.String);\n\t\t\t\tgoto case BuiltinTypeSpec.Type.String;\n\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\tcase BuiltinTypeSpec.Type.Type:\n\t\t\t\tenc.Encode (byte.MaxValue);\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\tvar ac = targetType as ArrayContainer;\n\t\t\t\tif (ac != null && ac.Rank == 1 && !ac.Element.IsArray) {\n\t\t\t\t\tenc.Encode (uint.MaxValue);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbase.EncodeAttributeValue (rc, enc, targetType, parameterType);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitNull ();\n\n\t\t\t// Only to make verifier happy\n\t\t\tif (type.IsGenericParameter)\n\t\t\t\tec.Emit (OpCodes.Unbox_Any, type);\n\t\t}\n\n\t\tpublic override string ExprClassName {\n\t\t\tget {\n\t\t\t\treturn GetSignatureForError ();\n\t\t\t}\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool inCheckedContext, TypeSpec targetType)\n\t\t{\n\t\t\tif (targetType.IsPointer) {\n\t\t\t\tif (IsLiteral || this is NullPointer)\n\t\t\t\t\treturn new NullPointer (targetType, loc);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Exlude internal compiler types\n\t\t\tif (targetType.Kind == MemberKind.InternalCompilerType && targetType.BuiltinType != BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\treturn null;\n\n\t\t\tif (!IsLiteral && !Convert.ImplicitStandardConversionExists (this, targetType))\n\t\t\t\treturn null;\n\n\t\t\tif (TypeSpec.IsReferenceType (targetType))\n\t\t\t\treturn new NullConstant (targetType, loc);\n\n\t\t\tif (targetType.IsNullableType)\n\t\t\t\treturn Nullable.LiftedNull.Create (targetType, loc);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec targetType)\n\t\t{\n\t\t\treturn ConvertExplicitly (false, targetType);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn \"null\";\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn GetSignatureForError ();\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override bool IsNull {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return true; }\n\t\t}\n\t}\n\n\n\t//\n\t// A null constant in a pointer context\n\t//\n\tclass NullPointer : NullConstant\n\t{\n\t\tpublic NullPointer (TypeSpec type, Location loc)\n\t\t\t: base (type, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tError_PointerInsideExpressionTree (ec);\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Emits null pointer\n\t\t\t//\n\t\t\tec.EmitInt (0);\n\t\t\tec.Emit (OpCodes.Conv_U);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   The value is constant, but when emitted has a side effect.  This is\n\t///   used by BitwiseAnd to ensure that the second expression is invoked\n\t///   regardless of the value of the left side.  \n\t/// </summary>\n\tpublic class SideEffectConstant : Constant\n\t{\n\t\tpublic readonly Constant value;\n\t\tExpression side_effect;\n\t\t\n\t\tpublic SideEffectConstant (Constant value, Expression side_effect, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.value = value;\n\t\t\ttype = value.Type;\n\t\t\teclass = ExprClass.Value;\n\n\t\t\twhile (side_effect is SideEffectConstant)\n\t\t\t\tside_effect = ((SideEffectConstant) side_effect).side_effect;\n\t\t\tthis.side_effect = side_effect;\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn side_effect.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn value.GetValue ();\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn value.GetValueAsLiteral ();\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn value.GetValueAsLong ();\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tside_effect.EmitSideEffect (ec);\n\t\t\tvalue.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tside_effect.EmitSideEffect (ec);\n\t\t\tvalue.EmitSideEffect (ec);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tside_effect.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget { return value.IsDefaultValue; }\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget { return value.IsNegative; }\n\t\t}\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return value.IsZeroInteger; }\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tConstant new_value = value.ConvertExplicitly (in_checked_context, target_type);\n\t\t\tif (new_value == null)\n\t\t\t\treturn null;\n\n\t\t\tvar c = new SideEffectConstant (new_value, side_effect, new_value.Location);\n\t\t\tc.type = target_type;\n\t\t\tc.eclass = eclass;\n\t\t\treturn c;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs",
    "content": "﻿//\n// context.cs: Various compiler contexts.\n//\n// Author:\n//   Marek Safar (marek.safar@gmail.com)\n//   Miguel de Icaza (miguel@ximian.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2004-2009 Novell, Inc.\n// Copyright 2011 Xamarin Inc.\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Security.Cryptography;\nusing System.Diagnostics;\n\nnamespace Mono.CSharp\n{\n\tpublic enum LookupMode\n\t{\n\t\tNormal = 0,\n\t\tProbing = 1,\n\t\tIgnoreAccessibility = 2,\n\t\tNameOf = 3\n\t}\n\n\t//\n\t// Implemented by elements which can act as independent contexts\n\t// during resolve phase. Used mostly for lookups.\n\t//\n\tpublic interface IMemberContext : IModuleContext\n\t{\n\t\t//\n\t\t// A scope type context, it can be inflated for generic types\n\t\t//\n\t\tTypeSpec CurrentType { get; }\n\n\t\t//\n\t\t// A scope type parameters either VAR or MVAR\n\t\t//\n\t\tTypeParameters CurrentTypeParameters { get; }\n\n\t\t//\n\t\t// A member definition of the context. For partial types definition use\n\t\t// CurrentTypeDefinition.PartialContainer otherwise the context is local\n\t\t//\n\t\t// TODO: Obsolete it in this context, dynamic context cannot guarantee sensible value\n\t\t//\n\t\tMemberCore CurrentMemberDefinition { get; }\n\n\t\tbool IsObsolete { get; }\n\t\tbool IsUnsafe { get; }\n\t\tbool IsStatic { get; }\n\n\t\tstring GetSignatureForError ();\n\n\t\tExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity);\n\t\tFullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc);\n\t\tFullNamedExpression LookupNamespaceAlias (string name);\n\t}\n\n\tpublic interface IModuleContext\n\t{\n\t\tModuleContainer Module { get; }\n\t}\n\n\t//\n\t// Block or statement resolving context\n\t//\n\tpublic class BlockContext : ResolveContext\n\t{\n\t\treadonly TypeSpec return_type;\n\n\t\t//\n\t\t// Tracks the last offset used by VariableInfo\n\t\t//\n\t\tpublic int AssignmentInfoOffset;\n\n\t\tpublic BlockContext (IMemberContext mc, ExplicitBlock block, TypeSpec returnType)\n\t\t\t: base (mc)\n\t\t{\n\t\t\tif (returnType == null)\n\t\t\t\tthrow new ArgumentNullException (\"returnType\");\n\n\t\t\tthis.return_type = returnType;\n\n\t\t\t// TODO: check for null value\n\t\t\tCurrentBlock = block;\n\t\t}\n\n\t\tpublic BlockContext (ResolveContext rc, ExplicitBlock block, TypeSpec returnType)\n\t\t\t: this (rc.MemberContext, block, returnType)\n\t\t{\n\t\t\tif (rc.IsUnsafe)\n\t\t\t\tflags |= ResolveContext.Options.UnsafeScope;\n\n\t\t\tif (rc.HasSet (ResolveContext.Options.CheckedScope))\n\t\t\t\tflags |= ResolveContext.Options.CheckedScope;\n\n\t\t\tif (!rc.ConstantCheckState)\n\t\t\t\tflags &= ~Options.ConstantCheckState;\n\n\t\t\tif (rc.IsInProbingMode)\n\t\t\t\tflags |= ResolveContext.Options.ProbingMode;\n\n\t\t\tif (rc.HasSet (ResolveContext.Options.FieldInitializerScope))\n\t\t\t\tflags |= ResolveContext.Options.FieldInitializerScope;\n\n\t\t\tif (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))\n\t\t\t\tflags |= ResolveContext.Options.ExpressionTreeConversion;\n\n\t\t\tif (rc.HasSet (ResolveContext.Options.BaseInitializer))\n\t\t\t\tflags |= ResolveContext.Options.BaseInitializer;\n\t\t}\n\n\t\tpublic ExceptionStatement CurrentTryBlock { get; set; }\n\n\t\tpublic LoopStatement EnclosingLoop { get; set; }\n\n\t\tpublic LoopStatement EnclosingLoopOrSwitch { get; set; }\n\n\t\tpublic Switch Switch { get; set; }\n\n\t\tpublic TypeSpec ReturnType {\n\t\t\tget { return return_type; }\n\t\t}\n\t}\n\n\t//\n\t// Expression resolving context\n\t//\n\tpublic class ResolveContext : IMemberContext\n\t{\n\t\t[Flags]\n\t\tpublic enum Options\n\t\t{\n\t\t\t/// <summary>\n\t\t\t///   This flag tracks the `checked' state of the compilation,\n\t\t\t///   it controls whether we should generate code that does overflow\n\t\t\t///   checking, or if we generate code that ignores overflows.\n\t\t\t///\n\t\t\t///   The default setting comes from the command line option to generate\n\t\t\t///   checked or unchecked code plus any source code changes using the\n\t\t\t///   checked/unchecked statements or expressions.   Contrast this with\n\t\t\t///   the ConstantCheckState flag.\n\t\t\t/// </summary>\n\t\t\tCheckedScope = 1 << 0,\n\n\t\t\t/// <summary>\n\t\t\t///   The constant check state is always set to `true' and cant be changed\n\t\t\t///   from the command line.  The source code can change this setting with\n\t\t\t///   the `checked' and `unchecked' statements and expressions. \n\t\t\t/// </summary>\n\t\t\tConstantCheckState = 1 << 1,\n\n\t\t\tAllCheckStateFlags = CheckedScope | ConstantCheckState,\n\n\t\t\t//\n\t\t\t// unsafe { ... } scope\n\t\t\t//\n\t\t\tUnsafeScope = 1 << 2,\n\t\t\tCatchScope = 1 << 3,\n\t\t\tFinallyScope = 1 << 4,\n\t\t\tFieldInitializerScope = 1 << 5,\n\t\t\tCompoundAssignmentScope = 1 << 6,\n\t\t\tFixedInitializerScope = 1 << 7,\n\t\t\tBaseInitializer = 1 << 8,\n\n\t\t\t//\n\t\t\t// Inside an enum definition, we do not resolve enumeration values\n\t\t\t// to their enumerations, but rather to the underlying type/value\n\t\t\t// This is so EnumVal + EnumValB can be evaluated.\n\t\t\t//\n\t\t\t// There is no \"E operator + (E x, E y)\", so during an enum evaluation\n\t\t\t// we relax the rules\n\t\t\t//\n\t\t\tEnumScope = 1 << 9,\n\n\t\t\tConstantScope = 1 << 10,\n\n\t\t\tConstructorScope = 1 << 11,\n\n\t\t\tUsingInitializerScope = 1 << 12,\n\n\t\t\tLockScope = 1 << 13,\n\n\t\t\tTryScope = 1 << 14,\n\n\t\t\tTryWithCatchScope = 1 << 15,\n\n\t\t\tConditionalAccessReceiver = 1 << 16,\n\n\t\t\t///\n\t\t\t/// Indicates the current context is in probing mode, no errors are reported. \n\t\t\t///\n\t\t\tProbingMode = 1 << 22,\n\n\t\t\t//\n\t\t\t// Return and ContextualReturn statements will set the ReturnType\n\t\t\t// value based on the expression types of each return statement\n\t\t\t// instead of the method return type which is initially null.\n\t\t\t//\n\t\t\tInferReturnType = 1 << 23,\n\n\t\t\tOmitDebuggingInfo = 1 << 24,\n\n\t\t\tExpressionTreeConversion = 1 << 25,\n\n\t\t\tInvokeSpecialName = 1 << 26\n\t\t}\n\n\t\t// utility helper for CheckExpr, UnCheckExpr, Checked and Unchecked statements\n\t\t// it's public so that we can use a struct at the callsite\n\t\tpublic struct FlagsHandle : IDisposable\n\t\t{\n\t\t\treadonly ResolveContext ec;\n\t\t\treadonly Options invmask, oldval;\n\n\t\t\tpublic FlagsHandle (ResolveContext ec, Options flagsToSet)\n\t\t\t\t: this (ec, flagsToSet, flagsToSet)\n\t\t\t{\n\t\t\t}\n\n\t\t\tinternal FlagsHandle (ResolveContext ec, Options mask, Options val)\n\t\t\t{\n\t\t\t\tthis.ec = ec;\n\t\t\t\tinvmask = ~mask;\n\t\t\t\toldval = ec.flags & mask;\n\t\t\t\tec.flags = (ec.flags & invmask) | (val & mask);\n\n//\t\t\t\tif ((mask & Options.ProbingMode) != 0)\n//\t\t\t\t\tec.Report.DisableReporting ();\n\t\t\t}\n\n\t\t\tpublic void Dispose ()\n\t\t\t{\n//\t\t\t\tif ((invmask & Options.ProbingMode) == 0)\n//\t\t\t\t\tec.Report.EnableReporting ();\n\n\t\t\t\tec.flags = (ec.flags & invmask) | oldval;\n\t\t\t}\n\t\t}\n\n\t\tprotected Options flags;\n\n\t\t//\n\t\t// Whether we are inside an anonymous method.\n\t\t//\n\t\tpublic AnonymousExpression CurrentAnonymousMethod;\n\n\t\t//\n\t\t// Holds a varible used during collection or object initialization.\n\t\t//\n\t\tpublic Expression CurrentInitializerVariable;\n\n\t\tpublic Block CurrentBlock;\n\n\t\tpublic readonly IMemberContext MemberContext;\n\n\t\tpublic ResolveContext (IMemberContext mc)\n\t\t{\n\t\t\tif (mc == null)\n\t\t\t\tthrow new ArgumentNullException ();\n\n\t\t\tMemberContext = mc;\n\n\t\t\t//\n\t\t\t// The default setting comes from the command line option\n\t\t\t//\n\t\t\tif (mc.Module.Compiler.Settings.Checked)\n\t\t\t\tflags |= Options.CheckedScope;\n\n\t\t\t//\n\t\t\t// The constant check state is always set to true\n\t\t\t//\n\t\t\tflags |= Options.ConstantCheckState;\n\t\t}\n\n\t\tpublic ResolveContext (IMemberContext mc, Options options)\n\t\t\t: this (mc)\n\t\t{\n\t\t\tflags |= options;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic BuiltinTypes BuiltinTypes {\n\t\t\tget {\n\t\t\t\treturn MemberContext.Module.Compiler.BuiltinTypes;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual ExplicitBlock ConstructorBlock {\n\t\t\tget {\n\t\t\t\treturn CurrentBlock.Explicit;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// The current iterator\n\t\t//\n\t\tpublic Iterator CurrentIterator {\n\t\t\tget { return CurrentAnonymousMethod as Iterator; }\n\t\t}\n\n\t\tpublic TypeSpec CurrentType {\n\t\t\tget { return MemberContext.CurrentType; }\n\t\t}\n\n\t\tpublic TypeParameters CurrentTypeParameters {\n\t\t\tget { return MemberContext.CurrentTypeParameters; }\n\t\t}\n\n\t\tpublic MemberCore CurrentMemberDefinition {\n\t\t\tget { return MemberContext.CurrentMemberDefinition; }\n\t\t}\n\n\t\tpublic bool ConstantCheckState {\n\t\t\tget { return (flags & Options.ConstantCheckState) != 0; }\n\t\t}\n\n\t\tpublic bool IsInProbingMode {\n\t\t\tget {\n\t\t\t\treturn (flags & Options.ProbingMode) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsObsolete {\n\t\t\tget {\n\t\t\t\t// Disables obsolete checks when probing is on\n\t\t\t\treturn MemberContext.IsObsolete;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn MemberContext.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsUnsafe {\n\t\t\tget {\n\t\t\t\treturn HasSet (Options.UnsafeScope) || MemberContext.IsUnsafe;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsRuntimeBinder {\n\t\t\tget {\n\t\t\t\treturn Module.Compiler.IsRuntimeBinder;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsVariableCapturingRequired {\n\t\t\tget {\n\t\t\t\treturn !IsInProbingMode;\n\t\t\t}\n\t\t}\n\n\t\tpublic ModuleContainer Module {\n\t\t\tget {\n\t\t\t\treturn MemberContext.Module;\n\t\t\t}\n\t\t}\n\n\t\tpublic Report Report {\n\t\t\tget {\n\t\t\t\treturn Module.Compiler.Report;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic bool MustCaptureVariable (INamedBlockVariable local)\n\t\t{\n\t\t\tif (CurrentAnonymousMethod == null)\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// Capture only if this or any of child blocks contain yield\n\t\t\t// or it's a parameter\n\t\t\t//\n\t\t\tif (CurrentAnonymousMethod.IsIterator)\n\t\t\t\treturn local.IsParameter || local.Block.Explicit.HasYield;\n\n\t\t\t//\n\t\t\t// Capture only if this or any of child blocks contain await\n\t\t\t// or it's a parameter or we need to access variable from \n\t\t\t// different parameter block\n\t\t\t//\n\t\t\tif (CurrentAnonymousMethod is AsyncInitializer)\n\t\t\t\treturn local.IsParameter || local.Block.Explicit.HasAwait || CurrentBlock.Explicit.HasAwait ||\n\t\t\t\t\tlocal.Block.ParametersBlock != CurrentBlock.ParametersBlock.Original;\n\n\t\t\treturn local.Block.ParametersBlock != CurrentBlock.ParametersBlock.Original;\n\t\t}\n\n\t\tpublic bool HasSet (Options options)\n\t\t{\n\t\t\treturn (this.flags & options) == options;\n\t\t}\n\n\t\tpublic bool HasAny (Options options)\n\t\t{\n\t\t\treturn (this.flags & options) != 0;\n\t\t}\n\n\n\t\t// Temporarily set all the given flags to the given value.  Should be used in an 'using' statement\n\t\tpublic FlagsHandle Set (Options options)\n\t\t{\n\t\t\treturn new FlagsHandle (this, options);\n\t\t}\n\n\t\tpublic FlagsHandle With (Options options, bool enable)\n\t\t{\n\t\t\treturn new FlagsHandle (this, options, enable ? options : 0);\n\t\t}\n\n\t\t#region IMemberContext Members\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\treturn MemberContext.GetSignatureForError ();\n\t\t}\n\n\t\tpublic ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)\n\t\t{\n\t\t\treturn MemberContext.LookupExtensionMethod (extensionType, name, arity);\n\t\t}\n\n\t\tpublic FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\treturn MemberContext.LookupNamespaceOrType (name, arity, mode, loc);\n\t\t}\n\n\t\tpublic FullNamedExpression LookupNamespaceAlias (string name)\n\t\t{\n\t\t\treturn MemberContext.LookupNamespaceAlias (name);\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tpublic class FlowAnalysisContext\n\t{\n\t\treadonly CompilerContext ctx;\n\t\tDefiniteAssignmentBitSet conditional_access;\n\n\t\tpublic FlowAnalysisContext (CompilerContext ctx, ParametersBlock parametersBlock, int definiteAssignmentLength)\n\t\t{\n\t\t\tthis.ctx = ctx;\n\t\t\tthis.ParametersBlock = parametersBlock;\n\n\t\t\tDefiniteAssignment = definiteAssignmentLength == 0 ?\n\t\t\t\tDefiniteAssignmentBitSet.Empty :\n\t\t\t\tnew DefiniteAssignmentBitSet (definiteAssignmentLength);\n\t\t}\n\n\t\tpublic DefiniteAssignmentBitSet DefiniteAssignment { get; set; }\n\n\t\tpublic DefiniteAssignmentBitSet DefiniteAssignmentOnTrue { get; set; }\n\n\t\tpublic DefiniteAssignmentBitSet DefiniteAssignmentOnFalse { get; set; }\n\n\t\tpublic List<LabeledStatement> LabelStack { get; set; }\n\n\t\tpublic ParametersBlock ParametersBlock { get; set; }\n\n\t\tpublic Report Report {\n\t\t\tget {\n\t\t\t\treturn ctx.Report;\n\t\t\t}\n\t\t}\n\n\t\tpublic DefiniteAssignmentBitSet SwitchInitialDefinitiveAssignment { get; set; }\n\n\t\tpublic TryFinally TryFinally { get; set; }\n\n\t\tpublic bool UnreachableReported { get; set; }\n\n\t\tpublic DefiniteAssignmentBitSet BranchDefiniteAssignment ()\n\t\t{\n\t\t\tvar dat = DefiniteAssignment;\n\t\t\tif (dat != DefiniteAssignmentBitSet.Empty)\n\t\t\t\tDefiniteAssignment = new DefiniteAssignmentBitSet (dat);\n\t\t\treturn dat;\n\t\t}\n\n\t\tpublic void BranchConditionalAccessDefiniteAssignment ()\n\t\t{\n\t\t\tif (conditional_access == null)\n\t\t\t\tconditional_access = BranchDefiniteAssignment ();\n\t\t}\n\n\t\tpublic void ConditionalAccessEnd ()\n\t\t{\n\t\t\tDebug.Assert (conditional_access != null);\n\t\t\tDefiniteAssignment = conditional_access;\n\t\t\tconditional_access = null;\n\t\t}\n\n\t\tpublic bool IsDefinitelyAssigned (VariableInfo variable)\n\t\t{\n\t\t\treturn variable.IsAssigned (DefiniteAssignment);\n\t\t}\n\n\t\tpublic bool IsStructFieldDefinitelyAssigned (VariableInfo variable, string name)\n\t\t{\n\t\t\treturn variable.IsStructFieldAssigned (DefiniteAssignment, name);\n\t\t}\n\n\t\tpublic void SetVariableAssigned (VariableInfo variable, bool generatedAssignment = false)\n\t\t{\n\t\t\tvariable.SetAssigned (DefiniteAssignment, generatedAssignment);\n\t\t}\n\n\t\tpublic void SetStructFieldAssigned (VariableInfo variable, string name)\n\t\t{\n\t\t\tvariable.SetStructFieldAssigned (DefiniteAssignment, name);\n\t\t}\n\t}\n\n\n\t//\n\t// This class is used during the Statement.Clone operation\n\t// to remap objects that have been cloned.\n\t//\n\t// Since blocks are cloned by Block.Clone, we need a way for\n\t// expressions that must reference the block to be cloned\n\t// pointing to the new cloned block.\n\t//\n\tpublic class CloneContext\n\t{\n\t\tDictionary<Block, Block> block_map = new Dictionary<Block, Block> ();\n\n\t\tpublic void AddBlockMap (Block from, Block to)\n\t\t{\n\t\t\tblock_map.Add (from, to);\n\t\t}\n\n\t\tpublic Block LookupBlock (Block from)\n\t\t{\n\t\t\tBlock result;\n\t\t\tif (!block_map.TryGetValue (from, out result)) {\n\t\t\t\tresult = (Block) from.Clone (this);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t///\n\t\t/// Remaps block to cloned copy if one exists.\n\t\t///\n\t\tpublic Block RemapBlockCopy (Block from)\n\t\t{\n\t\t\tBlock mapped_to;\n\t\t\tif (!block_map.TryGetValue (from, out mapped_to))\n\t\t\t\treturn from;\n\n\t\t\treturn mapped_to;\n\t\t}\n\t}\n\n\t//\n\t// Main compiler context\n\t//\n\tpublic class CompilerContext\n\t{\n\t\tstatic readonly TimeReporter DisabledTimeReporter = new TimeReporter (false);\n\n\t\treadonly Report report;\n\t\treadonly BuiltinTypes builtin_types;\n\t\treadonly CompilerSettings settings;\n\n\t\tDictionary<string, SourceFile> all_source_files;\n\n\t\tpublic CompilerContext (CompilerSettings settings, ReportPrinter reportPrinter)\n\t\t{\n\t\t\tthis.settings = settings;\n\t\t\tthis.report = new Report (this, reportPrinter);\n\t\t\tthis.builtin_types = new BuiltinTypes ();\n\t\t\tthis.TimeReporter = DisabledTimeReporter;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic BuiltinTypes BuiltinTypes {\n\t\t\tget {\n\t\t\t\treturn builtin_types;\n\t\t\t}\n\t\t}\n\n\t\t// Used for special handling of runtime dynamic context mostly\n\t\t// by error reporting but also by member accessibility checks\n\t\tpublic bool IsRuntimeBinder {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic Report Report {\n\t\t\tget {\n\t\t\t\treturn report;\n\t\t\t}\n\t\t}\n\n\t\tpublic CompilerSettings Settings {\n\t\t\tget {\n\t\t\t\treturn settings;\n\t\t\t}\n\t\t}\n\n\t\tpublic List<SourceFile> SourceFiles {\n\t\t\tget {\n\t\t\t\treturn settings.SourceFiles;\n\t\t\t}\n\t\t}\n\n\t\tinternal TimeReporter TimeReporter {\n\t\t\tget; set;\n\t\t}\n\n\t\t#endregion\n\n\t\t//\n\t\t// This is used when we encounter a #line preprocessing directive during parsing\n\t\t// to register additional source file names\n\t\t//\n\t\tpublic SourceFile LookupFile (CompilationSourceFile comp_unit, string name)\n\t\t{\n\t\t\tif (all_source_files == null) {\n\t\t\t\tall_source_files = new Dictionary<string, SourceFile> ();\n\t\t\t\tforeach (var source in SourceFiles)\n\t\t\t\t\tall_source_files[source.FullPathName] = source;\n\t\t\t}\n\n\t\t\tstring path;\n\t\t\tif (!Path.IsPathRooted (name)) {\n\t\t\t\tvar loc = comp_unit.SourceFile;\n\t\t\t\tstring root = Path.GetDirectoryName (loc.FullPathName);\n\t\t\t\tpath = Path.GetFullPath (Path.Combine (root, name));\n\t\t\t\tvar dir = Path.GetDirectoryName (loc.Name);\n\t\t\t\tif (!string.IsNullOrEmpty (dir))\n\t\t\t\t\tname = Path.Combine (dir, name);\n\t\t\t} else\n\t\t\t\tpath = name;\n\n\t\t\tSourceFile retval;\n\t\t\tif (all_source_files.TryGetValue (path, out retval))\n\t\t\t\treturn retval;\n\n\t\t\tretval = new SourceFile (name, path, all_source_files.Count + 1);\n\t\t\tLocation.AddFile (retval);\n\t\t\tall_source_files.Add (path, retval);\n\t\t\treturn retval;\n\t\t}\n\t}\n\n\t//\n\t// Generic code emitter context\n\t//\n\tpublic class BuilderContext\n\t{\n\t\t[Flags]\n\t\tpublic enum Options\n\t\t{\n\t\t\t/// <summary>\n\t\t\t///   This flag tracks the `checked' state of the compilation,\n\t\t\t///   it controls whether we should generate code that does overflow\n\t\t\t///   checking, or if we generate code that ignores overflows.\n\t\t\t///\n\t\t\t///   The default setting comes from the command line option to generate\n\t\t\t///   checked or unchecked code plus any source code changes using the\n\t\t\t///   checked/unchecked statements or expressions.   Contrast this with\n\t\t\t///   the ConstantCheckState flag.\n\t\t\t/// </summary>\n\t\t\tCheckedScope = 1 << 0,\n\n\t\t\tAccurateDebugInfo = 1 << 1,\n\n\t\t\tOmitDebugInfo = 1 << 2,\n\n\t\t\tConstructorScope = 1 << 3,\n\n\t\t\tAsyncBody = 1 << 4,\n\t\t}\n\n\t\t// utility helper for CheckExpr, UnCheckExpr, Checked and Unchecked statements\n\t\t// it's public so that we can use a struct at the callsite\n\t\tpublic struct FlagsHandle : IDisposable\n\t\t{\n\t\t\treadonly BuilderContext ec;\n\t\t\treadonly Options invmask, oldval;\n\n\t\t\tpublic FlagsHandle (BuilderContext ec, Options flagsToSet)\n\t\t\t\t: this (ec, flagsToSet, flagsToSet)\n\t\t\t{\n\t\t\t}\n\n\t\t\tinternal FlagsHandle (BuilderContext ec, Options mask, Options val)\n\t\t\t{\n\t\t\t\tthis.ec = ec;\n\t\t\t\tinvmask = ~mask;\n\t\t\t\toldval = ec.flags & mask;\n\t\t\t\tec.flags = (ec.flags & invmask) | (val & mask);\n\t\t\t}\n\n\t\t\tpublic void Dispose ()\n\t\t\t{\n\t\t\t\tec.flags = (ec.flags & invmask) | oldval;\n\t\t\t}\n\t\t}\n\n\t\tprotected Options flags;\n\n\t\tpublic bool HasSet (Options options)\n\t\t{\n\t\t\treturn (this.flags & options) == options;\n\t\t}\n\n\t\t// Temporarily set all the given flags to the given value.  Should be used in an 'using' statement\n\t\tpublic FlagsHandle With (Options options, bool enable)\n\t\t{\n\t\t\treturn new FlagsHandle (this, options, enable ? options : 0);\n\t\t}\n\t}\n\n\t//\n\t// Parser session objects. We could recreate all these objects for each parser\n\t// instance but the best parser performance the session object can be reused\n\t//\n\tpublic class ParserSession\n\t{\n\t\tMD5 md5;\n\n\t\tpublic readonly char[] StreamReaderBuffer = new char[SeekableStreamReader.DefaultReadAheadSize * 2];\n\t\tpublic readonly Dictionary<char[], string>[] Identifiers = new Dictionary<char[], string>[Tokenizer.MaxIdentifierLength + 1];\n\t\tpublic readonly List<Parameter> ParametersStack = new List<Parameter> (4);\n\t\tpublic readonly char[] IDBuilder = new char[Tokenizer.MaxIdentifierLength];\n\t\tpublic readonly char[] NumberBuilder = new char[Tokenizer.MaxNumberLength];\n\n\t\tpublic LocationsBag LocationsBag { get; set; }\n\t\tpublic bool UseJayGlobalArrays { get; set; }\n\t\tpublic LocatedToken[] LocatedTokens { get; set; }\n\n\t\tpublic MD5 GetChecksumAlgorithm ()\n\t\t{\n\t\t\treturn md5 ?? (md5 = MD5.Create ());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs",
    "content": "//\n// conversion.cs: various routines for implementing conversions.\n//\n// Authors:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Ravi Pratap (ravi@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011 Xamarin Inc (http://www.xamarin.com)\n//\n\nusing System;\nusing System.Collections.Generic;\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t//\n\t// A container class for all the conversion operations\n\t//\n\tstatic class Convert\n\t{\n\t\t[Flags]\n\t\tpublic enum UserConversionRestriction\n\t\t{\n\t\t\tNone = 0,\n\t\t\tImplicitOnly = 1,\n\t\t\tProbingOnly = 1 << 1,\n\t\t\tNullableSourceOnly = 1 << 2\n\n\t\t}\n\t\t//\n\t\t// From a one-dimensional array-type S[] to System.Collections.IList<T> and base\n\t\t// interfaces of this interface, provided there is an implicit reference conversion\n\t\t// from S to T.\n\t\t//\n\t\tstatic bool ArrayToIList (ArrayContainer array, TypeSpec list, bool isExplicit)\n\t\t{\n\t\t\tif (array.Rank != 1 || !list.IsArrayGenericInterface)\n\t\t\t\treturn false;\n\n\t\t\tvar arg_type = list.TypeArguments[0];\n\t\t\tif (array.Element == arg_type)\n\t\t\t\treturn true;\n\n\t\t\t//\n\t\t\t// Reject conversion from T[] to IList<U> even if T has U dependency\n\t\t\t//\n\t\t\tif (arg_type.IsGenericParameter)\n\t\t\t\treturn false;\n\n\t\t\tif (isExplicit)\n\t\t\t\treturn ExplicitReferenceConversionExists (array.Element, arg_type);\n\n\t\t\treturn ImplicitReferenceConversionExists (array.Element, arg_type);\n\t\t}\n\t\t\n\t\tstatic bool IList_To_Array(TypeSpec list, ArrayContainer array)\n\t\t{\n\t\t\tif (array.Rank != 1 || !list.IsArrayGenericInterface)\n\t\t\t\treturn false;\n\n\t\t\tvar arg_type = list.TypeArguments[0];\n\t\t\tif (array.Element == arg_type)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\treturn ImplicitReferenceConversionExists (array.Element, arg_type) || ExplicitReferenceConversionExists (array.Element, arg_type);\n\t\t}\n\n\t\tpublic static Expression ImplicitTypeParameterConversion (Expression expr, TypeParameterSpec expr_type, TypeSpec target_type)\n\t\t{\n\t\t\t//\n\t\t\t// From T to a type parameter U, provided T depends on U\n\t\t\t//\n\t\t\tif (target_type.IsGenericParameter) {\n\t\t\t\tif (expr_type.TypeArguments != null && expr_type.HasDependencyOn (target_type)) {\n\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\treturn EmptyExpression.Null;\n\n\t\t\t\t\tif (expr_type.IsReferenceType && !((TypeParameterSpec) target_type).IsReferenceType)\n\t\t\t\t\t\treturn new BoxedCast (expr, target_type);\n\n\t\t\t\t\treturn new ClassCast (expr, target_type);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// LAMESPEC: From T to dynamic type because it's like T to object\n\t\t\t//\n\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn EmptyExpression.Null;\n\n\t\t\t\tif (expr_type.IsReferenceType)\n\t\t\t\t\treturn new ClassCast (expr, target_type);\n\n\t\t\t\treturn new BoxedCast (expr, target_type);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// From T to its effective base class C\n\t\t\t// From T to any base class of C (it cannot contain dynamic or be of dynamic type)\n\t\t\t// From T to any interface implemented by C\n\t\t\t//\n\t\t\tvar base_type = expr_type.GetEffectiveBase ();\n\t\t\tif (base_type == target_type || TypeSpec.IsBaseClass (base_type, target_type, false) || base_type.ImplementsInterface (target_type, true)) {\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn EmptyExpression.Null;\n\n\t\t\t\tif (expr_type.IsReferenceType)\n\t\t\t\t\treturn new ClassCast (expr, target_type);\n\n\t\t\t\treturn new BoxedCast (expr, target_type);\n\t\t\t}\n\n\t\t\tif (target_type.IsInterface && expr_type.IsConvertibleToInterface (target_type)) {\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn EmptyExpression.Null;\n\n\t\t\t\tif (expr_type.IsReferenceType)\n\t\t\t\t\treturn new ClassCast (expr, target_type);\n\n\t\t\t\treturn new BoxedCast (expr, target_type);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic Expression ExplicitTypeParameterConversionFromT (Expression source, TypeSpec source_type, TypeSpec target_type)\n\t\t{\n\t\t\tvar target_tp = target_type as TypeParameterSpec;\n\t\t\tif (target_tp != null) {\n\t\t\t\t//\n\t\t\t\t// From a type parameter U to T, provided T depends on U\n\t\t\t\t//\n\t\t\t\tif (target_tp.TypeArguments != null && target_tp.HasDependencyOn (source_type)) {\n\t\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// From T to any interface-type I provided there is not already an implicit conversion from T to I\n\t\t\t//\n\t\t\tif (target_type.IsInterface)\n\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type, true);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic Expression ExplicitTypeParameterConversionToT (Expression source, TypeSpec source_type, TypeParameterSpec target_type)\n\t\t{\n\t\t\t//\n\t\t\t// From the effective base class C of T to T and from any base class of C to T\n\t\t\t//\n\t\t\tvar effective = target_type.GetEffectiveBase ();\n\t\t\tif (TypeSpecComparer.IsEqual (effective, source_type) || TypeSpec.IsBaseClass (effective, source_type, false))\n\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static Expression ImplicitReferenceConversion (Expression expr, TypeSpec target_type, bool explicit_cast)\n\t\t{\n\t\t\tTypeSpec expr_type = expr.Type;\n\n\t\t\tif (expr_type.Kind == MemberKind.TypeParameter)\n\t\t\t\treturn ImplicitTypeParameterConversion (expr, (TypeParameterSpec) expr.Type, target_type);\n\n\t\t\t//\n\t\t\t// from the null type to any reference-type.\n\t\t\t//\n\t\t\tNullLiteral nl = expr as NullLiteral;\n\t\t\tif (nl != null) {\n\t\t\t\treturn nl.ConvertImplicitly (target_type);\n\t\t\t}\n\n\t\t\tif (ImplicitReferenceConversionExists (expr_type, target_type)) {\n\t\t\t\t// \n\t\t\t\t// Avoid wrapping implicitly convertible reference type\n\t\t\t\t//\n\t\t\t\tif (!explicit_cast)\n\t\t\t\t\treturn expr;\n\n\t\t\t\treturn EmptyCast.Create (expr, target_type);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Implicit reference conversions\n\t\t//\n\t\tpublic static bool ImplicitReferenceConversionExists (TypeSpec expr_type, TypeSpec target_type)\n\t\t{\n\t\t\treturn ImplicitReferenceConversionExists (expr_type, target_type, true);\n\t\t}\n\n\t\tpublic static bool ImplicitReferenceConversionExists (TypeSpec expr_type, TypeSpec target_type, bool refOnlyTypeParameter)\n\t\t{\n\t\t\t// It's here only to speed things up\n\t\t\tif (target_type.IsStruct)\n\t\t\t\treturn false;\n\n\t\t\tswitch (expr_type.Kind) {\n\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\treturn ImplicitTypeParameterConversion (null, (TypeParameterSpec) expr_type, target_type) != null &&\n\t\t\t\t\t(!refOnlyTypeParameter || TypeSpec.IsReferenceType (expr_type));\n\n\t\t\tcase MemberKind.Class:\n\t\t\t\t//\n\t\t\t\t// From any class-type to dynamic (+object to speed up common path)\n\t\t\t\t//\n\t\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.Object || target_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (target_type.IsClass) {\n\t\t\t\t\t//\n\t\t\t\t\t// Identity conversion, including dynamic erasure\n\t\t\t\t\t//\n\t\t\t\t\tif (TypeSpecComparer.IsEqual (expr_type, target_type))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t//\n\t\t\t\t\t// From any class-type S to any class-type T, provided S is derived from T\n\t\t\t\t\t//\n\t\t\t\t\treturn TypeSpec.IsBaseClass (expr_type, target_type, true);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// From any class-type S to any interface-type T, provided S implements T\n\t\t\t\t//\n\t\t\t\tif (target_type.IsInterface)\n\t\t\t\t\treturn expr_type.ImplementsInterface (target_type, true);\n\n\t\t\t\treturn false;\n\n\t\t\tcase MemberKind.ArrayType:\n\t\t\t\t//\n\t\t\t\t// Identity array conversion\n\t\t\t\t//\n\t\t\t\tif (expr_type == target_type)\n\t\t\t\t\treturn true;\n\n\t\t\t\t//\n\t\t\t\t// From any array-type to System.Array\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Array:\n\t\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar expr_type_array = (ArrayContainer) expr_type;\n\t\t\t\tvar target_type_array = target_type as ArrayContainer;\n\n\t\t\t\t//\n\t\t\t\t// From an array-type S to an array-type of type T\n\t\t\t\t//\n\t\t\t\tif (target_type_array != null && expr_type_array.Rank == target_type_array.Rank) {\n\n\t\t\t\t\t//\n\t\t\t\t\t// Both SE and TE are reference-types. TE check is defered\n\t\t\t\t\t// to ImplicitReferenceConversionExists\n\t\t\t\t\t//\n\t\t\t\t\tTypeSpec expr_element_type = expr_type_array.Element;\n\t\t\t\t\tif (!TypeSpec.IsReferenceType (expr_element_type))\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t//\n\t\t\t\t\t// An implicit reference conversion exists from SE to TE\n\t\t\t\t\t//\n\t\t\t\t\treturn ImplicitReferenceConversionExists (expr_element_type, target_type_array.Element);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// From any array-type to the interfaces it implements\n\t\t\t\t//\n\t\t\t\tif (target_type.IsInterface) {\n\t\t\t\t\tif (expr_type.ImplementsInterface (target_type, false))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t// from an array-type of type T to IList<T>\n\t\t\t\t\tif (ArrayToIList (expr_type_array, target_type, false))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\tcase MemberKind.Delegate:\n\t\t\t\t//\n\t\t\t\t// From any delegate-type to System.Delegate (and its base types)\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Delegate:\n\t\t\t\tcase BuiltinTypeSpec.Type.MulticastDelegate:\n\t\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Identity conversion, including dynamic erasure\n\t\t\t\t//\n\t\t\t\tif (TypeSpecComparer.IsEqual (expr_type, target_type))\n\t\t\t\t\treturn true;\n\n\t\t\t\t//\n\t\t\t\t// From any delegate-type to the interfaces it implements\n\t\t\t\t// From any reference-type to an delegate type if is variance-convertible\n\t\t\t\t//\n\t\t\t\treturn expr_type.ImplementsInterface (target_type, false) || TypeSpecComparer.Variant.IsEqual (expr_type, target_type);\n\n\t\t\tcase MemberKind.Interface:\n\t\t\t\t//\n\t\t\t\t// Identity conversion, including dynamic erasure\n\t\t\t\t//\n\t\t\t\tif (TypeSpecComparer.IsEqual (expr_type, target_type))\n\t\t\t\t\treturn true;\n\n\t\t\t\t//\n\t\t\t\t// From any interface type S to interface-type T\n\t\t\t\t// From any reference-type to an interface if is variance-convertible\n\t\t\t\t//\n\t\t\t\tif (target_type.IsInterface)\n\t\t\t\t\treturn TypeSpecComparer.Variant.IsEqual (expr_type, target_type) || expr_type.ImplementsInterface (target_type, true);\n\n\t\t\t\treturn target_type.BuiltinType == BuiltinTypeSpec.Type.Object || target_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\n\t\t\tcase MemberKind.InternalCompilerType:\n\t\t\t\t//\n\t\t\t\t// from the null literal to any reference-type.\n\t\t\t\t//\n\t\t\t\tif (expr_type == InternalType.NullLiteral) {\n\t\t\t\t\t// Exlude internal compiler types\n\t\t\t\t\tif (target_type.Kind == MemberKind.InternalCompilerType)\n\t\t\t\t\t\treturn target_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\n\t\t\t\t\treturn TypeSpec.IsReferenceType (target_type) || target_type.Kind == MemberKind.PointerType;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Implicit dynamic conversion\n\t\t\t\t//\n\t\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tswitch (target_type.Kind) {\n\t\t\t\t\tcase MemberKind.ArrayType:\n\t\t\t\t\tcase MemberKind.Class:\n\t\t\t\t\tcase MemberKind.Delegate:\n\t\t\t\t\tcase MemberKind.Interface:\n\t\t\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// dynamic to __arglist\n\t\t\t\t\tif (target_type == InternalType.Arglist)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static Expression ImplicitBoxingConversion (Expression expr, TypeSpec expr_type, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t//\n\t\t\t// From any non-nullable-value-type to the type object and dynamic\n\t\t\t//\n\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t//\n\t\t\t// From any non-nullable-value-type to the type System.ValueType\n\t\t\t//\n\t\t\tcase BuiltinTypeSpec.Type.ValueType:\n\t\t\t\t//\n\t\t\t\t// No ned to check for nullable type as underlying type is always convertible\n\t\t\t\t//\n\t\t\t\tif (!TypeSpec.IsValueType (expr_type))\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn expr == null ? EmptyExpression.Null : new BoxedCast (expr, target_type);\n\n\t\t\tcase BuiltinTypeSpec.Type.Enum:\n\t\t\t\t//\n\t\t\t\t// From any enum-type to the type System.Enum.\n\t\t\t\t//\n\t\t\t\tif (expr_type.IsEnum)\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new BoxedCast (expr, target_type);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// From a nullable-type to a reference type, if a boxing conversion exists from\n\t\t\t// the underlying type to the reference type\n\t\t\t//\n\t\t\tif (expr_type.IsNullableType) {\n\t\t\t\tif (!TypeSpec.IsReferenceType (target_type))\n\t\t\t\t\treturn null;\n\n\t\t\t\tvar res = ImplicitBoxingConversion (expr, Nullable.NullableInfo.GetUnderlyingType (expr_type), target_type);\n\n\t\t\t\t// \"cast\" underlying type to target type to emit correct InvalidCastException when\n\t\t\t\t// underlying hierarchy changes without recompilation\n\t\t\t\tif (res != null && expr != null)\n\t\t\t\t\tres = new UnboxCast (res, target_type);\n\n\t\t\t\treturn res;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// A value type has a boxing conversion to an interface type I if it has a boxing conversion\n\t\t\t// to an interface or delegate type I0 and I0 is variance-convertible to I\n\t\t\t//\n\t\t\tif (target_type.IsInterface && TypeSpec.IsValueType (expr_type) && expr_type.ImplementsInterface (target_type, true)) {\n\t\t\t\treturn expr == null ? EmptyExpression.Null : new BoxedCast (expr, target_type);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static Expression ImplicitNulableConversion (ResolveContext ec, Expression expr, TypeSpec target_type)\n\t\t{\n\t\t\tTypeSpec expr_type = expr.Type;\n\n\t\t\t//\n\t\t\t// From null to any nullable type\n\t\t\t//\n\t\t\tif (expr_type == InternalType.NullLiteral)\n\t\t\t\treturn ec == null ? EmptyExpression.Null : Nullable.LiftedNull.Create (target_type, expr.Location);\n\n\t\t\t// S -> T?\n\t\t\tTypeSpec t_el = Nullable.NullableInfo.GetUnderlyingType (target_type);\n\n\t\t\t// S? -> T?\n\t\t\tif (expr_type.IsNullableType)\n\t\t\t\texpr_type = Nullable.NullableInfo.GetUnderlyingType (expr_type);\n\n\t\t\t//\n\t\t\t// Predefined implicit identity or implicit numeric conversion\n\t\t\t// has to exist between underlying type S and underlying type T\n\t\t\t//\n\n\t\t\t// conversion exists only mode\n\t\t\tif (ec == null) {\n\t\t\t\tif (TypeSpecComparer.IsEqual (expr_type, t_el))\n\t\t\t\t\treturn EmptyExpression.Null;\n\n\t\t\t\tif (expr is Constant)\n\t\t\t\t\treturn ((Constant) expr).ConvertImplicitly (t_el);\n\n\t\t\t\treturn ImplicitNumericConversion (null, expr_type, t_el);\n\t\t\t}\n\n\t\t\tExpression unwrap;\n\t\t\tif (expr_type != expr.Type)\n\t\t\t\tunwrap = Nullable.Unwrap.Create (expr);\n\t\t\telse\n\t\t\t\tunwrap = expr;\n\n\t\t\tExpression conv = unwrap;\n\t\t\tif (!TypeSpecComparer.IsEqual (expr_type, t_el)) {\n\t\t\t\tif (conv is Constant)\n\t\t\t\t\tconv = ((Constant)conv).ConvertImplicitly (t_el);\n\t\t\t\telse\n\t\t\t\t\tconv = ImplicitNumericConversion (conv, expr_type, t_el);\n\n\t\t\t\tif (conv == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tif (expr_type != expr.Type)\n\t\t\t\treturn new Nullable.LiftedConversion (conv, unwrap, target_type).Resolve (ec);\n\n\t\t\treturn Nullable.Wrap.Create (conv, target_type);\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Implicit Numeric Conversions.\n\t\t///\n\t\t///   expr is the expression to convert, returns a new expression of type\n\t\t///   target_type or null if an implicit conversion is not possible.\n\t\t/// </summary>\n\t\tpublic static Expression ImplicitNumericConversion (Expression expr, TypeSpec target_type)\n\t\t{\n\t\t\treturn ImplicitNumericConversion (expr, expr.Type, target_type);\n\t\t}\n\n\t\tpublic static bool ImplicitNumericConversionExists (TypeSpec expr_type, TypeSpec target_type)\n\t\t{\n\t\t\treturn ImplicitNumericConversion (null, expr_type, target_type) != null;\n\t\t}\n\n\t\tstatic Expression ImplicitNumericConversion (Expression expr, TypeSpec expr_type, TypeSpec target_type)\n\t\t{\n\t\t\tswitch (expr_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t//\n\t\t\t\t// From sbyte to short, int, long, float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t//\n\t\t\t\t// From byte to short, ushort, int, uint, long, ulong, float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : EmptyCast.Create (expr, target_type);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t//\n\t\t\t\t// From short to int, long, float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : EmptyCast.Create (expr, target_type);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t//\n\t\t\t\t// From ushort to int, uint, long, ulong, float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : EmptyCast.Create (expr, target_type);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t//\n\t\t\t\t// From int to long, float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t//\n\t\t\t\t// From uint to long, ulong, float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCastDuplex (expr, target_type, OpCodes.Conv_R_Un, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCastDuplex (expr, target_type, OpCodes.Conv_R_Un, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t//\n\t\t\t\t// From long to float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t//\n\t\t\t\t// From ulong to float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCastDuplex (expr, target_type, OpCodes.Conv_R_Un, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCastDuplex (expr, target_type, OpCodes.Conv_R_Un, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t//\n\t\t\t\t// From char to ushort, int, uint, long, ulong, float, double, decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : EmptyCast.Create (expr, target_type);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OperatorCast (expr, target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t//\n\t\t\t\t// float to double\n\t\t\t\t//\n\t\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.Double)\n\t\t\t\t\treturn expr == null ? EmptyExpression.Null : new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Full version of implicit conversion\n\t\t//\n\t\tpublic static bool ImplicitConversionExists (ResolveContext ec, Expression expr, TypeSpec target_type)\n\t\t{\n\t\t\tif (ImplicitStandardConversionExists (ec, expr, target_type))\n\t\t\t\treturn true;\n\n\t\t\tif (expr.Type == InternalType.AnonymousMethod) {\n\t\t\t\tif (!target_type.IsDelegate && !target_type.IsExpressionTreeType)\n\t\t\t\t\treturn false;\n\n\t\t\t\tAnonymousMethodExpression ame = (AnonymousMethodExpression) expr;\n\t\t\t\treturn ame.ImplicitStandardConversionExists (ec, target_type);\n\t\t\t}\n\t\t\t\n\t\t\t// Conversion from __arglist to System.ArgIterator\n\t\t\tif (expr.Type == InternalType.Arglist)\n\t\t\t\treturn target_type == ec.Module.PredefinedTypes.ArgIterator.TypeSpec;\n\n\t\t\treturn UserDefinedConversion (ec, expr, target_type,\n\t\t\t\tUserConversionRestriction.ImplicitOnly | UserConversionRestriction.ProbingOnly, Location.Null) != null;\n\t\t}\n\n\t\tpublic static bool ImplicitStandardConversionExists (ResolveContext rc, Expression expr, TypeSpec target_type)\n\t\t{\n\t\t\tif (expr.eclass == ExprClass.MethodGroup) {\n\t\t\t\tif (target_type.IsDelegate && rc.Module.Compiler.Settings.Version != LanguageVersion.ISO_1) {\n\t\t\t\t\tMethodGroupExpr mg = expr as MethodGroupExpr;\n\t\t\t\t\tif (mg != null)\n\t\t\t\t\t\treturn DelegateCreation.ImplicitStandardConversionExists (rc, mg, target_type);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn ImplicitStandardConversionExists (expr, target_type);\n\t\t}\n\n\t\t//\n\t\t// Implicit standard conversion (only core conversions are used here)\n\t\t//\n\t\tpublic static bool ImplicitStandardConversionExists (Expression expr, TypeSpec target_type)\n\t\t{\n\t\t\t//\n\t\t\t// Identity conversions\n\t\t\t// Implicit numeric conversions\n\t\t\t// Implicit nullable conversions\n\t\t\t// Implicit reference conversions\n\t\t\t// Boxing conversions\n\t\t\t// Implicit constant expression conversions\n\t\t\t// Implicit conversions involving type parameters\n\t\t\t//\n\n\t\t\tTypeSpec expr_type = expr.Type;\n\n\t\t\tif (expr_type == target_type)\n\t\t\t\treturn true;\n\n\t\t\tif (target_type.IsNullableType)\n\t\t\t\treturn ImplicitNulableConversion (null, expr, target_type) != null;\n\n\t\t\tif (ImplicitNumericConversion (null, expr_type, target_type) != null)\n\t\t\t\treturn true;\n\n\t\t\tif (ImplicitReferenceConversionExists (expr_type, target_type, false))\n\t\t\t\treturn true;\n\n\t\t\tif (ImplicitBoxingConversion (null, expr_type, target_type) != null)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t//\n\t\t\t// Implicit Constant Expression Conversions\n\t\t\t//\n\t\t\tif (expr is IntConstant){\n\t\t\t\tint value = ((IntConstant) expr).Value;\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\tif (value >= SByte.MinValue && value <= SByte.MaxValue)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\tif (value >= 0 && value <= Byte.MaxValue)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\tif (value >= Int16.MinValue && value <= Int16.MaxValue)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\tif (value >= UInt16.MinValue && value <= UInt16.MaxValue)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\tif (value >= 0)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\t //\n\t\t\t\t\t // we can optimize this case: a positive int32\n\t\t\t\t\t // always fits on a uint64.  But we need an opcode\n\t\t\t\t\t // to do it.\n\t\t\t\t\t //\n\t\t\t\t\tif (value >= 0)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr is LongConstant && target_type.BuiltinType == BuiltinTypeSpec.Type.ULong){\n\t\t\t\t//\n\t\t\t\t// Try the implicit constant expression conversion\n\t\t\t\t// from long to ulong, instead of a nice routine,\n\t\t\t\t// we just inline it\n\t\t\t\t//\n\t\t\t\tlong v = ((LongConstant) expr).Value;\n\t\t\t\tif (v >= 0)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (expr is IntegralConstant && target_type.IsEnum) {\n\t\t\t\tvar i = (IntegralConstant) expr;\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: csc allows any constant like 0 values to be converted, including const float f = 0.0\n\t\t\t\t//\n\t\t\t\t// An implicit enumeration conversion permits the decimal-integer-literal 0\n\t\t\t\t// to be converted to any enum-type and to any nullable-type whose underlying\n\t\t\t\t// type is an enum-type\n\t\t\t\t//\n\t\t\t\treturn i.IsZeroInteger;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Implicit dynamic conversion for remaining value types. It should probably\n\t\t\t// go somewhere else\n\t\t\t//\n\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tswitch (target_type.Kind) {\n\t\t\t\tcase MemberKind.Struct:\n\t\t\t\tcase MemberKind.Enum:\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// In an unsafe context implicit conversions is extended to include\n\t\t\t//\n\t\t\t// From any pointer-type to the type void*\n\t\t\t// From the null literal to any pointer-type.\n\t\t\t//\n\t\t\t// LAMESPEC: The specification claims this conversion is allowed in implicit conversion but\n\t\t\t// in reality implicit standard conversion uses it\n\t\t\t//\n\t\t\tif (target_type.IsPointer && expr.Type.IsPointer && ((PointerContainer) target_type).Element.Kind == MemberKind.Void)\n\t\t\t\treturn true;\n\n\t\t\t//\n\t\t\t// Struct identity conversion, including dynamic erasure\n\t\t\t//\n\t\t\tif (expr_type.IsStruct && TypeSpecComparer.IsEqual (expr_type, target_type))\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Finds \"most encompassed type\" according to the spec (13.4.2)\n\t\t///  amongst the methods in the MethodGroupExpr\n\t\t/// </summary>\n\t\tpublic static TypeSpec FindMostEncompassedType (IList<TypeSpec> types)\n\t\t{\n\t\t\tTypeSpec best = null;\n\t\t\tEmptyExpression expr;\n\n\t\t\tforeach (TypeSpec t in types) {\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbest = t;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\texpr = new EmptyExpression (t);\n\t\t\t\tif (ImplicitStandardConversionExists (expr, best))\n\t\t\t\t\tbest = t;\n\t\t\t}\n\n\t\t\texpr = new EmptyExpression (best);\n\t\t\tforeach (TypeSpec t in types) {\n\t\t\t\tif (best == t)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!ImplicitStandardConversionExists (expr, t)) {\n\t\t\t\t\tbest = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn best;\n\t\t}\n\n\t\t//\n\t\t// Finds the most encompassing type (type into which all other\n\t\t// types can convert to) amongst the types in the given set\n\t\t//\n\t\tstatic TypeSpec FindMostEncompassingType (IList<TypeSpec> types)\n\t\t{\n\t\t\tif (types.Count == 0)\n\t\t\t\treturn null;\n\n\t\t\tif (types.Count == 1)\n\t\t\t\treturn types [0];\n\n\t\t\tTypeSpec best = null;\n\t\t\tfor (int i = 0; i < types.Count; ++i) {\n\t\t\t\tint ii = 0;\n\t\t\t\tfor (; ii < types.Count; ++ii) {\n\t\t\t\t\tif (ii == i)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar expr = new EmptyExpression (types[ii]);\n\t\t\t\t\tif (!ImplicitStandardConversionExists (expr, types [i])) {\n\t\t\t\t\t\tii = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (ii == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbest = types[i];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Indicates multiple best types\n\t\t\t\treturn InternalType.FakeInternalType;\n\t\t\t}\n\n\t\t\treturn best;\n\t\t}\n\n\t\t//\n\t\t// Finds the most specific source Sx according to the rules of the spec (13.4.4)\n\t\t// by making use of FindMostEncomp* methods. Applies the correct rules separately\n\t\t// for explicit and implicit conversion operators.\n\t\t//\n\t\tstatic TypeSpec FindMostSpecificSource (ResolveContext rc, List<MethodSpec> list, TypeSpec sourceType, Expression source, bool apply_explicit_conv_rules)\n\t\t{\n\t\t\tTypeSpec[] src_types_set = null;\n\n\t\t\t//\n\t\t\t// Try exact match first, if any operator converts from S then Sx = S\n\t\t\t//\n\t\t\tfor (int i = 0; i < list.Count; ++i) {\n\t\t\t\tTypeSpec param_type = list [i].Parameters.Types [0];\n\n\t\t\t\tif (param_type == sourceType)\n\t\t\t\t\treturn param_type;\n\n\t\t\t\tif (src_types_set == null)\n\t\t\t\t\tsrc_types_set = new TypeSpec [list.Count];\n\n\t\t\t\tsrc_types_set [i] = param_type;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Explicit Conv rules\n\t\t\t//\n\t\t\tif (apply_explicit_conv_rules) {\n\t\t\t\tvar candidate_set = new List<TypeSpec> ();\n\n\t\t\t\tforeach (TypeSpec param_type in src_types_set){\n\t\t\t\t\tif (ImplicitStandardConversionExists (rc, source, param_type))\n\t\t\t\t\t\tcandidate_set.Add (param_type);\n\t\t\t\t}\n\n\t\t\t\tif (candidate_set.Count != 0) {\n\t\t\t\t\tif (source.eclass == ExprClass.MethodGroup)\n\t\t\t\t\t\treturn InternalType.FakeInternalType;\n\n\t\t\t\t\treturn FindMostEncompassedType (candidate_set);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Final case\n\t\t\t//\n\t\t\tif (apply_explicit_conv_rules)\n\t\t\t\treturn FindMostEncompassingType (src_types_set);\n\t\t\telse\n\t\t\t\treturn FindMostEncompassedType (src_types_set);\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Finds the most specific target Tx according to section 13.4.4\n\t\t/// </summary>\n\t\tstatic public TypeSpec FindMostSpecificTarget (IList<MethodSpec> list,\n\t\t\t\t\t\t\t   TypeSpec target, bool apply_explicit_conv_rules)\n\t\t{\n\t\t\tList<TypeSpec> tgt_types_set = null;\n\n\t\t\t//\n\t\t\t// If any operator converts to T then Tx = T\n\t\t\t//\n\t\t\tforeach (var mi in list){\n\t\t\t\tTypeSpec ret_type = mi.ReturnType;\n\t\t\t\tif (ret_type == target)\n\t\t\t\t\treturn ret_type;\n\n\t\t\t\tif (tgt_types_set == null) {\n\t\t\t\t\ttgt_types_set = new List<TypeSpec> (list.Count);\n\t\t\t\t} else if (tgt_types_set.Contains (ret_type)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttgt_types_set.Add (ret_type);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Explicit conv rules\n\t\t\t//\n\t\t\tif (apply_explicit_conv_rules) {\n\t\t\t\tvar candidate_set = new List<TypeSpec> ();\n\n\t\t\t\tforeach (TypeSpec ret_type in tgt_types_set) {\n\t\t\t\t\tvar expr = new EmptyExpression (ret_type);\n\n\t\t\t\t\tif (ImplicitStandardConversionExists (expr, target))\n\t\t\t\t\t\tcandidate_set.Add (ret_type);\n\t\t\t\t}\n\n\t\t\t\tif (candidate_set.Count != 0)\n\t\t\t\t\treturn FindMostEncompassingType (candidate_set);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Okay, final case !\n\t\t\t//\n\t\t\tif (apply_explicit_conv_rules)\n\t\t\t\treturn FindMostEncompassedType (tgt_types_set);\n\t\t\telse\n\t\t\t\treturn FindMostEncompassingType (tgt_types_set);\n\t\t}\n\n\t\t/// <summary>\n\t\t///  User-defined Implicit conversions\n\t\t/// </summary>\n\t\tstatic public Expression ImplicitUserConversion (ResolveContext ec, Expression source, TypeSpec target, Location loc)\n\t\t{\n\t\t\treturn UserDefinedConversion (ec, source, target, UserConversionRestriction.ImplicitOnly, loc);\n\t\t}\n\n\t\t/// <summary>\n\t\t///  User-defined Explicit conversions\n\t\t/// </summary>\n\t\tstatic Expression ExplicitUserConversion (ResolveContext ec, Expression source, TypeSpec target, Location loc)\n\t\t{\n\t\t\treturn UserDefinedConversion (ec, source, target, 0, loc);\n\t\t}\n\n\t\tstatic void FindApplicableUserDefinedConversionOperators (ResolveContext rc, IList<MemberSpec> operators, Expression source, TypeSpec target, UserConversionRestriction restr, ref List<MethodSpec> candidates)\n\t\t{\n\t\t\tif (source.Type.IsInterface) {\n\t\t\t\t// Neither A nor B are interface-types\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For a conversion operator to be applicable, it must be possible\n\t\t\t// to perform a standard conversion from the source type to\n\t\t\t// the operand type of the operator, and it must be possible\n\t\t\t// to perform a standard conversion from the result type of\n\t\t\t// the operator to the target type.\n\n\t\t\tExpression texpr = null;\n\n\t\t\tforeach (MethodSpec op in operators) {\n\t\t\t\t\n\t\t\t\t// Can be null because MemberCache.GetUserOperator does not resize the array\n\t\t\t\tif (op == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar t = op.Parameters.Types[0];\n\t\t\t\tif (source.Type != t && !ImplicitStandardConversionExists (rc, source, t)) {\n\t\t\t\t\tif ((restr & UserConversionRestriction.ImplicitOnly) != 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!ImplicitStandardConversionExists (new EmptyExpression (t), source.Type))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ((restr & UserConversionRestriction.NullableSourceOnly) != 0 && !t.IsNullableType)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tt = op.ReturnType;\n\n\t\t\t\tif (t.IsInterface)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (target != t) {\n\t\t\t\t\tif (t.IsNullableType)\n\t\t\t\t\t\tt = Nullable.NullableInfo.GetUnderlyingType (t);\n\n\t\t\t\t\tif (!ImplicitStandardConversionExists (new EmptyExpression (t), target)) {\n\t\t\t\t\t\tif ((restr & UserConversionRestriction.ImplicitOnly) != 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (texpr == null)\n\t\t\t\t\t\t\ttexpr = new EmptyExpression (target);\n\n\t\t\t\t\t\tif (!ImplicitStandardConversionExists (texpr, t))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (candidates == null)\n\t\t\t\t\tcandidates = new List<MethodSpec> ();\n\n\t\t\t\tcandidates.Add (op);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// User-defined conversions\n\t\t//\n\t\tpublic static Expression UserDefinedConversion (ResolveContext rc, Expression source, TypeSpec target, UserConversionRestriction restr, Location loc)\n\t\t{\n\t\t\tList<MethodSpec> candidates = null;\n\n\t\t\t//\n\t\t\t// If S or T are nullable types, source_type and target_type are their underlying types\n\t\t\t// otherwise source_type and target_type are equal to S and T respectively.\n\t\t\t//\n\t\t\tTypeSpec source_type = source.Type;\n\t\t\tTypeSpec target_type = target;\n\t\t\tExpression source_type_expr;\n\t\t\tbool nullable_source = false;\n\t\t\tvar implicitOnly = (restr & UserConversionRestriction.ImplicitOnly) != 0;\n\n\t\t\tif (source_type.IsNullableType) {\n\t\t\t\t// No unwrapping conversion S? -> T for non-reference types\n\t\t\t\tif (implicitOnly && !TypeSpec.IsReferenceType (target_type) && !target_type.IsNullableType) {\n\t\t\t\t\tsource_type_expr = source;\n\t\t\t\t} else {\n\t\t\t\t\tsource_type_expr = Nullable.Unwrap.CreateUnwrapped (source);\n\t\t\t\t\tsource_type = source_type_expr.Type;\n\t\t\t\t\tnullable_source = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsource_type_expr = source;\n\t\t\t}\n\n\t\t\tif (target_type.IsNullableType)\n\t\t\t\ttarget_type = Nullable.NullableInfo.GetUnderlyingType (target_type);\n\n\t\t\t// Only these containers can contain a user defined implicit or explicit operators\n\t\t\tconst MemberKind user_conversion_kinds = MemberKind.Class | MemberKind.Struct | MemberKind.TypeParameter;\n\n\t\t\tif ((source_type.Kind & user_conversion_kinds) != 0 && source_type.BuiltinType != BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\tbool declared_only = source_type.IsStruct;\n\n\t\t\t\tvar operators = MemberCache.GetUserOperator (source_type, Operator.OpType.Implicit, declared_only);\n\t\t\t\tif (operators != null) {\n\t\t\t\t\tFindApplicableUserDefinedConversionOperators (rc, operators, source_type_expr, target_type, restr, ref candidates);\n\t\t\t\t}\n\n\t\t\t\tif (!implicitOnly) {\n\t\t\t\t\toperators = MemberCache.GetUserOperator (source_type, Operator.OpType.Explicit, declared_only);\n\t\t\t\t\tif (operators != null) {\n\t\t\t\t\t\tFindApplicableUserDefinedConversionOperators (rc, operators, source_type_expr, target_type, restr, ref candidates);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((target.Kind & user_conversion_kinds) != 0 && target_type.BuiltinType != BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\tbool declared_only = target.IsStruct || implicitOnly;\n\n\t\t\t\tvar operators = MemberCache.GetUserOperator (target_type, Operator.OpType.Implicit, declared_only);\n\t\t\t\tif (operators != null) {\n\t\t\t\t\tFindApplicableUserDefinedConversionOperators (rc, operators, source_type_expr, target_type, restr, ref candidates);\n\t\t\t\t}\n\n\t\t\t\tif (!implicitOnly) {\n\t\t\t\t\toperators = MemberCache.GetUserOperator (target_type, Operator.OpType.Explicit, declared_only);\n\t\t\t\t\tif (operators != null) {\n\t\t\t\t\t\tFindApplicableUserDefinedConversionOperators (rc, operators, source_type_expr, target_type, restr, ref candidates);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (candidates == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Find the most specific conversion operator\n\t\t\t//\n\t\t\tMethodSpec most_specific_operator;\n\t\t\tTypeSpec s_x, t_x;\n\t\t\tif (candidates.Count == 1) {\n\t\t\t\tmost_specific_operator = candidates[0];\n\t\t\t\ts_x = most_specific_operator.Parameters.Types[0];\n\t\t\t\tt_x = most_specific_operator.ReturnType;\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// Pass original source type to find the best match against input type and\n\t\t\t\t// not the unwrapped expression\n\t\t\t\t//\n\t\t\t\ts_x = FindMostSpecificSource (rc, candidates, source.Type, source_type_expr, !implicitOnly);\n\t\t\t\tif (s_x == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tt_x = FindMostSpecificTarget (candidates, target, !implicitOnly);\n\t\t\t\tif (t_x == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tmost_specific_operator = null;\n\t\t\t\tfor (int i = 0; i < candidates.Count; ++i) {\n\t\t\t\t\tif (candidates[i].ReturnType == t_x && candidates[i].Parameters.Types[0] == s_x) {\n\t\t\t\t\t\tmost_specific_operator = candidates[i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (most_specific_operator == null) {\n\t\t\t\t\t//\n\t\t\t\t\t// Unless running in probing more\n\t\t\t\t\t//\n\t\t\t\t\tif ((restr & UserConversionRestriction.ProbingOnly) == 0) {\n\t\t\t\t\t\tMethodSpec ambig_arg = candidates [0];\n\t\t\t\t\t\tmost_specific_operator = candidates [1];\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tforeach (var candidate in candidates) {\n\t\t\t\t\t\t\tif (candidate.ReturnType == t_x)\n\t\t\t\t\t\t\t\tmost_specific_operator = candidate;\n\t\t\t\t\t\t\telse if (candidate.Parameters.Types[0] == s_x)\n\t\t\t\t\t\t\t\tambig_arg = candidate;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\trc.Report.Error (457, loc,\n\t\t\t\t\t\t\t\"Ambiguous user defined operators `{0}' and `{1}' when converting from `{2}' to `{3}'\",\n\t\t\t\t\t\t\tambig_arg.GetSignatureForError (), most_specific_operator.GetSignatureForError (),\n\t\t\t\t\t\t\tsource.Type.GetSignatureForError (), target.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ErrorExpression.Instance;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Convert input type when it's different to best operator argument\n\t\t\t//\n\t\t\tif (s_x != source_type) {\n\t\t\t\tvar c = source as Constant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\tsource = c.Reduce (rc, s_x);\n\t\t\t\t\tif (source == null)\n\t\t\t\t\t\tc = null;\n\t\t\t\t}\n\n\t\t\t\tif (c == null) {\n\t\t\t\t\tsource = implicitOnly ?\n\t\t\t\t\t\tImplicitConversionStandard (rc, source_type_expr, s_x, loc) :\n\t\t\t\t\t\tExplicitConversionStandard (rc, source_type_expr, s_x, loc);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsource = source_type_expr;\n\t\t\t}\n\n\t\t\tsource = new UserCast (most_specific_operator, source, loc).Resolve (rc);\n\n\t\t\t//\n\t\t\t// Convert result type when it's different to best operator return type\n\t\t\t//\n\t\t\tif (t_x != target_type) {\n\t\t\t\t//\n\t\t\t\t// User operator is of T?\n\t\t\t\t//\n\t\t\t\tif (t_x.IsNullableType && (target.IsNullableType || !implicitOnly)) {\n\t\t\t\t\t//\n\t\t\t\t\t// User operator return type does not match target type we need\n\t\t\t\t\t// yet another conversion. This should happen for promoted numeric\n\t\t\t\t\t// types only\n\t\t\t\t\t//\n\t\t\t\t\tif (t_x != target) {\n\t\t\t\t\t\tvar unwrap = Nullable.Unwrap.CreateUnwrapped (source);\n\n\t\t\t\t\t\tsource = implicitOnly ?\n\t\t\t\t\t\t\tImplicitConversionStandard (rc, unwrap, target_type, loc) :\n\t\t\t\t\t\t\tExplicitConversionStandard (rc, unwrap, target_type, loc);\n\n\t\t\t\t\t\tif (source == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tif (target.IsNullableType)\n\t\t\t\t\t\t\tsource = new Nullable.LiftedConversion (source, unwrap, target).Resolve (rc);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsource = implicitOnly ?\n\t\t\t\t\t\tImplicitConversionStandard (rc, source, target_type, loc) :\n\t\t\t\t\t\tExplicitConversionStandard (rc, source, target_type, loc);\n\n\t\t\t\t\tif (source == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t//\n\t\t\t// Source expression is of nullable type and underlying conversion returns\n\t\t\t// only non-nullable type we need to lift it manually\n\t\t\t//\n\t\t\tif (nullable_source && !s_x.IsNullableType)\n\t\t\t\treturn new Nullable.LiftedConversion (source, source_type_expr, target).Resolve (rc);\n\n\t\t\t//\n\t\t\t// Target is of nullable type but source type is not, wrap the result expression\n\t\t\t//\n\t\t\tif (target.IsNullableType && !t_x.IsNullableType)\n\t\t\t\tsource = Nullable.Wrap.Create (source, target);\n\n\t\t\treturn source;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Converts implicitly the resolved expression `expr' into the\n\t\t///   `target_type'.  It returns a new expression that can be used\n\t\t///   in a context that expects a `target_type'.\n\t\t/// </summary>\n\t\tstatic public Expression ImplicitConversion (ResolveContext ec, Expression expr,\n\t\t\t\t\t\t\t     TypeSpec target_type, Location loc)\n\t\t{\n\t\t\tExpression e;\n\n\t\t\tif (target_type == null)\n\t\t\t\tthrow new Exception (\"Target type is null\");\n\n\t\t\te = ImplicitConversionStandard (ec, expr, target_type, loc);\n\t\t\tif (e != null)\n\t\t\t\treturn e;\n\n\t\t\te = ImplicitUserConversion (ec, expr, target_type, loc);\n\t\t\tif (e != null)\n\t\t\t\treturn e;\n\n\t\t\treturn null;\n\t\t}\n\n\n\t\t/// <summary>\n\t\t///   Attempts to apply the `Standard Implicit\n\t\t///   Conversion' rules to the expression `expr' into\n\t\t///   the `target_type'.  It returns a new expression\n\t\t///   that can be used in a context that expects a\n\t\t///   `target_type'.\n\t\t///\n\t\t///   This is different from `ImplicitConversion' in that the\n\t\t///   user defined implicit conversions are excluded.\n\t\t/// </summary>\n\t\tstatic public Expression ImplicitConversionStandard (ResolveContext ec, Expression expr,\n\t\t\t\t\t\t\t\t     TypeSpec target_type, Location loc)\n\t\t{\n\t\t\treturn ImplicitConversionStandard (ec, expr, target_type, loc, false);\n\t\t}\n\n\t\tstatic Expression ImplicitConversionStandard (ResolveContext ec, Expression expr, TypeSpec target_type, Location loc, bool explicit_cast)\n\t\t{\n\t\t\tif (expr.eclass == ExprClass.MethodGroup){\n\t\t\t\tif (!target_type.IsDelegate){\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Only allow anonymous method conversions on post ISO_1\n\t\t\t\t//\n\t\t\t\tif (ec.Module.Compiler.Settings.Version != LanguageVersion.ISO_1){\n\t\t\t\t\tMethodGroupExpr mg = expr as MethodGroupExpr;\n\t\t\t\t\tif (mg != null)\n\t\t\t\t\t\treturn new ImplicitDelegateCreation (target_type, mg, loc).Resolve (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tTypeSpec expr_type = expr.Type;\n\t\t\tExpression e;\n\n\t\t\tif (expr_type == target_type) {\n\t\t\t\tif (expr_type != InternalType.NullLiteral && expr_type != InternalType.AnonymousMethod)\n\t\t\t\t\treturn expr;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tswitch (target_type.Kind) {\n\t\t\t\tcase MemberKind.ArrayType:\n\t\t\t\tcase MemberKind.Class:\n\t\t\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.Object)\n\t\t\t\t\t\treturn EmptyCast.Create (expr, target_type);\n\n\t\t\t\t\tgoto case MemberKind.Struct;\n\t\t\t\tcase MemberKind.Struct:\n\t\t\t\tcase MemberKind.Delegate:\n\t\t\t\tcase MemberKind.Enum:\n\t\t\t\tcase MemberKind.Interface:\n\t\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\t\targs.Add (new Argument (expr));\n\t\t\t\t\treturn new DynamicConversion (target_type, explicit_cast ? CSharpBinderFlags.ConvertExplicit : 0, args, loc).Resolve (ec);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (target_type.IsNullableType)\n\t\t\t\treturn ImplicitNulableConversion (ec, expr, target_type);\n\n\t\t\t//\n\t\t\t// Attempt to do the implicit constant expression conversions\n\t\t\t//\n\t\t\tConstant c = expr as Constant;\n\t\t\tif (c != null) {\n\t\t\t\ttry {\n\t\t\t\t\tc = c.ConvertImplicitly (target_type);\n\t\t\t\t} catch {\n\t\t\t\t\tthrow new InternalErrorException (\"Conversion error\", loc);\n\t\t\t\t}\n\t\t\t\tif (c != null)\n\t\t\t\t\treturn c;\n\t\t\t}\n\n\t\t\te = ImplicitNumericConversion (expr, expr_type, target_type);\n\t\t\tif (e != null)\n\t\t\t\treturn e;\n\n\t\t\te = ImplicitReferenceConversion (expr, target_type, explicit_cast);\n\t\t\tif (e != null)\n\t\t\t\treturn e;\n\n\t\t\te = ImplicitBoxingConversion (expr, expr_type, target_type);\n\t\t\tif (e != null)\n\t\t\t\treturn e;\n\n\t\t\tif (expr is IntegralConstant && target_type.IsEnum){\n\t\t\t\tvar i = (IntegralConstant) expr;\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: csc allows any constant like 0 values to be converted, including const float f = 0.0\n\t\t\t\t//\n\t\t\t\t// An implicit enumeration conversion permits the decimal-integer-literal 0\n\t\t\t\t// to be converted to any enum-type and to any nullable-type whose underlying\n\t\t\t\t// type is an enum-type\n\t\t\t\t//\n\t\t\t\tif (i.IsZeroInteger) {\n\t\t\t\t\t// Recreate 0 literal to remove any collected conversions\n\t\t\t\t\treturn new EnumConstant (new IntLiteral (ec.BuiltinTypes, 0, i.Location), target_type);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar target_pc = target_type as PointerContainer;\n\t\t\tif (target_pc != null) {\n\t\t\t\tif (expr_type.IsPointer) {\n\t\t\t\t\t//\n\t\t\t\t\t// Pointer types are same when they have same element types\n\t\t\t\t\t//\n\t\t\t\t\tif (expr_type == target_pc)\n\t\t\t\t\t\treturn expr;\n\n\t\t\t\t\tif (target_pc.Element.Kind == MemberKind.Void)\n\t\t\t\t\t\treturn EmptyCast.Create (expr, target_type);\n\n\t\t\t\t\t\t//return null;\n\t\t\t\t}\n\n\t\t\t\tif (expr_type == InternalType.NullLiteral)\n\t\t\t\t\treturn new NullPointer (target_type, loc);\n\t\t\t}\n\n\t\t\tif (expr_type == InternalType.AnonymousMethod){\n\t\t\t\tAnonymousMethodExpression ame = (AnonymousMethodExpression) expr;\n\t\t\t\tExpression am = ame.Compatible (ec, target_type);\n\t\t\t\tif (am != null)\n\t\t\t\t\treturn am.Resolve (ec);\n\n\t\t\t\t// Avoid CS1503 after CS1661\n\t\t\t\treturn ErrorExpression.Instance;\n\t\t\t}\n\n\t\t\tif (expr_type == InternalType.Arglist && target_type == ec.Module.PredefinedTypes.ArgIterator.TypeSpec)\n\t\t\t\treturn expr;\n\n\t\t\t//\n\t\t\t// dynamic erasure conversion on value types\n\t\t\t//\n\t\t\tif (expr_type.IsStruct && TypeSpecComparer.IsEqual (expr_type, target_type))\n\t\t\t\treturn expr_type == target_type ? expr : EmptyCast.Create (expr, target_type);\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Attempts to implicitly convert `source' into `target_type', using\n\t\t///   ImplicitConversion.  If there is no implicit conversion, then\n\t\t///   an error is signaled\n\t\t/// </summary>\n\t\tstatic public Expression ImplicitConversionRequired (ResolveContext ec, Expression source,\n\t\t\t\t\t\t\t\t     TypeSpec target_type, Location loc)\n\t\t{\n\t\t\tExpression e = ImplicitConversion (ec, source, target_type, loc);\n\t\t\tif (e != null)\n\t\t\t\treturn e;\n\n\t\t\tsource.Error_ValueCannotBeConverted (ec, target_type, false);\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Performs the explicit numeric conversions\n\t\t///\n\t\t/// There are a few conversions that are not part of the C# standard,\n\t\t/// they were interim hacks in the C# compiler that were supposed to\n\t\t/// become explicit operators in the UIntPtr class and IntPtr class,\n\t\t/// but for historical reasons it did not happen, so the C# compiler\n\t\t/// ended up with these special hacks.\n\t\t///\n\t\t/// See bug 59800 for details.\n\t\t///\n\t\t/// The conversion are:\n\t\t///   UIntPtr->SByte\n\t\t///   UIntPtr->Int16\n\t\t///   UIntPtr->Int32\n\t\t///   IntPtr->UInt64\n\t\t///   UInt64->IntPtr\n\t\t///   SByte->UIntPtr\n\t\t///   Int16->UIntPtr\n\t\t///\n\t\t/// </summary>\n\t\tpublic static Expression ExplicitNumericConversion (ResolveContext rc, Expression expr, TypeSpec target_type)\n\t\t{\n\t\t\t// Not all predefined explicit numeric conversion are\n\t\t\t// defined here, for some of them (mostly IntPtr/UIntPtr) we\n\t\t\t// defer to user-operator handling which is now perfect but\n\t\t\t// works for now\n\t\t\t//\n\t\t\t// LAMESPEC: Undocumented IntPtr/UIntPtr conversions\n\t\t\t// IntPtr -> uint uses int\n\t\t\t// UIntPtr -> long uses ulong\n\t\t\t//\n\n\t\t\tswitch (expr.Type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t//\n\t\t\t\t// From sbyte to byte, ushort, uint, ulong, char, uintptr\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I1_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I1_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I1_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I1_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I1_CH);\n\n\t\t\t\t// One of the built-in conversions that belonged in the class library\n\t\t\t\tcase BuiltinTypeSpec.Type.UIntPtr:\n\t\t\t\t\treturn new OperatorCast (new ConvCast (expr, rc.BuiltinTypes.ULong, ConvCast.Mode.I1_U8), target_type, target_type, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t//\n\t\t\t\t// From byte to sbyte and char\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U1_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U1_CH);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t//\n\t\t\t\t// From short to sbyte, byte, ushort, uint, ulong, char, uintptr\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I2_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I2_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I2_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I2_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I2_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I2_CH);\n\n\t\t\t\t// One of the built-in conversions that belonged in the class library\n\t\t\t\tcase BuiltinTypeSpec.Type.UIntPtr:\n\t\t\t\t\treturn new OperatorCast (new ConvCast (expr, rc.BuiltinTypes.ULong, ConvCast.Mode.I2_U8), target_type, target_type, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t//\n\t\t\t\t// From ushort to sbyte, byte, short, char\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U2_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U2_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U2_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U2_CH);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t//\n\t\t\t\t// From int to sbyte, byte, short, ushort, uint, ulong, char, uintptr\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I4_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I4_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I4_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I4_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I4_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I4_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I4_CH);\n\n\t\t\t\t// One of the built-in conversions that belonged in the class library\n\t\t\t\tcase BuiltinTypeSpec.Type.UIntPtr:\n\t\t\t\t\treturn new OperatorCast (new ConvCast (expr, rc.BuiltinTypes.ULong, ConvCast.Mode.I2_U8), target_type, target_type, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t//\n\t\t\t\t// From uint to sbyte, byte, short, ushort, int, char\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U4_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U4_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U4_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U4_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U4_I4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U4_CH);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t//\n\t\t\t\t// From long to sbyte, byte, short, ushort, int, uint, ulong, char\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_I4);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_CH);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t//\n\t\t\t\t// From ulong to sbyte, byte, short, ushort, int, uint, long, char\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_I4);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_CH);\n\n\t\t\t\t// One of the built-in conversions that belonged in the class library\n\t\t\t\tcase BuiltinTypeSpec.Type.IntPtr:\n\t\t\t\t\treturn new OperatorCast (EmptyCast.Create (expr, rc.BuiltinTypes.Long), target_type, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t//\n\t\t\t\t// From char to sbyte, byte, short\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.CH_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.CH_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.CH_I2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t//\n\t\t\t\t// From float to sbyte, byte, short,\n\t\t\t\t// ushort, int, uint, long, ulong, char\n\t\t\t\t// or decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_I4);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R4_CH);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn new OperatorCast (expr, target_type, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t//\n\t\t\t\t// From double to sbyte, byte, short,\n\t\t\t\t// ushort, int, uint, long, ulong,\n\t\t\t\t// char, float or decimal\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_I4);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_U8);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_CH);\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.R8_R4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn new OperatorCast (expr, target_type, true);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.UIntPtr:\n\t\t\t\t//\n\t\t\t\t// Various built-in conversions that belonged in the class library\n\t\t\t\t//\n\t\t\t\t// from uintptr to sbyte, short, int32\n\t\t\t\t//\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new ConvCast (new OperatorCast (expr, expr.Type, rc.BuiltinTypes.UInt, true), target_type, ConvCast.Mode.U4_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new ConvCast (new OperatorCast (expr, expr.Type, rc.BuiltinTypes.UInt, true), target_type, ConvCast.Mode.U4_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn EmptyCast.Create (new OperatorCast (expr, expr.Type, rc.BuiltinTypes.UInt, true), target_type);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new OperatorCast (expr, expr.Type, target_type, true);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn EmptyCast.Create (new OperatorCast (expr, expr.Type, rc.BuiltinTypes.ULong, true), target_type);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.IntPtr:\n\t\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.UInt)\n\t\t\t\t\treturn EmptyCast.Create (new OperatorCast (expr, expr.Type, rc.BuiltinTypes.Int, true), target_type);\n\t\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.ULong)\n\t\t\t\t\treturn EmptyCast.Create (new OperatorCast (expr, expr.Type, rc.BuiltinTypes.Long, true), target_type);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t// From decimal to sbyte, byte, short,\n\t\t\t\t// ushort, int, uint, long, ulong, char,\n\t\t\t\t// float, or double\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\treturn new OperatorCast (expr, expr.Type, target_type, true);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Returns whether an explicit reference conversion can be performed\n\t\t///  from source_type to target_type\n\t\t/// </summary>\n\t\tpublic static bool ExplicitReferenceConversionExists (TypeSpec source_type, TypeSpec target_type)\n\t\t{\n\t\t\tExpression e = ExplicitReferenceConversion (null, source_type, target_type);\n\t\t\tif (e == null)\n\t\t\t\treturn false;\n\n\t\t\tif (e == EmptyExpression.Null)\n\t\t\t\treturn true;\n\n\t\t\tthrow new InternalErrorException (\"Invalid probing conversion result\");\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Implements Explicit Reference conversions\n\t\t/// </summary>\n\t\tstatic Expression ExplicitReferenceConversion (Expression source, TypeSpec source_type, TypeSpec target_type)\n\t\t{\n\t\t\t//\n\t\t\t// From object to a generic parameter\n\t\t\t//\n\t\t\tif (source_type.BuiltinType == BuiltinTypeSpec.Type.Object && TypeManager.IsGenericParameter (target_type))\n\t\t\t\treturn source == null ? EmptyExpression.Null : new UnboxCast (source, target_type);\n\n\t\t\t//\n\t\t\t// Explicit type parameter conversion from T\n\t\t\t//\n\t\t\tif (source_type.Kind == MemberKind.TypeParameter)\n\t\t\t\treturn ExplicitTypeParameterConversionFromT (source, source_type, target_type);\n\n\t\t\tbool target_is_value_type = target_type.Kind == MemberKind.Struct || target_type.Kind == MemberKind.Enum;\n\n\t\t\t//\n\t\t\t// Unboxing conversion from System.ValueType to any non-nullable-value-type\n\t\t\t//\n\t\t\tif (source_type.BuiltinType == BuiltinTypeSpec.Type.ValueType && target_is_value_type)\n\t\t\t\treturn source == null ? EmptyExpression.Null : new UnboxCast (source, target_type);\n\n\t\t\t//\n\t\t\t// From object or dynamic to any reference type or value type (unboxing)\n\t\t\t//\n\t\t\tif (source_type.BuiltinType == BuiltinTypeSpec.Type.Object || source_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tif (target_type.IsPointer)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn\n\t\t\t\t\tsource == null ? EmptyExpression.Null :\n\t\t\t\t\ttarget_is_value_type ? new UnboxCast (source, target_type) :\n\t\t\t\t\tsource is Constant ? (Expression) new EmptyConstantCast ((Constant) source, target_type) :\n\t\t\t\t\tnew ClassCast (source, target_type);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// From any class S to any class-type T, provided S is a base class of T\n\t\t\t//\n\t\t\tif (source_type.Kind == MemberKind.Class && TypeSpec.IsBaseClass (target_type, source_type, true))\n\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\n\t\t\t//\n\t\t\t// From any interface-type S to to any class type T, provided T is not\n\t\t\t// sealed, or provided T implements S.\n\t\t\t//\n\t\t\t// This also covers Explicit conversions involving type parameters\n\t\t\t// section From any interface type to T\n\t\t\t//\n\t\t\tif (source_type.Kind == MemberKind.Interface) {\n\t\t\t\tif (!target_type.IsSealed || target_type.ImplementsInterface (source_type, true)) {\n\t\t\t\t\tif (source == null)\n\t\t\t\t\t\treturn EmptyExpression.Null;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Unboxing conversion from any interface-type to any non-nullable-value-type that\n\t\t\t\t\t// implements the interface-type\n\t\t\t\t\t//\n\t\t\t\t\treturn target_is_value_type ? new UnboxCast (source, target_type) : (Expression) new ClassCast (source, target_type);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// From System.Collections.Generic.IList<T> and its base interfaces to a one-dimensional\n\t\t\t\t// array type S[], provided there is an implicit or explicit reference conversion from S to T.\n\t\t\t\t//\n\t\t\t\tvar target_array = target_type as ArrayContainer;\n\t\t\t\tif (target_array != null && IList_To_Array (source_type, target_array))\n\t\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar source_array = source_type as ArrayContainer;\n\t\t\tif (source_array != null) {\n\t\t\t\tvar target_array = target_type as ArrayContainer;\n\t\t\t\tif (target_array != null) {\n\t\t\t\t\t//\n\t\t\t\t\t// From System.Array to any array-type\n\t\t\t\t\t//\n\t\t\t\t\tif (source_type.BuiltinType == BuiltinTypeSpec.Type.Array)\n\t\t\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\n\t\t\t\t\t//\n\t\t\t\t\t// From an array type S with an element type Se to an array type T with an\n\t\t\t\t\t// element type Te provided all the following are true:\n\t\t\t\t\t//     * S and T differe only in element type, in other words, S and T\n\t\t\t\t\t//       have the same number of dimensions.\n\t\t\t\t\t//     * Both Se and Te are reference types\n\t\t\t\t\t//     * An explicit reference conversions exist from Se to Te\n\t\t\t\t\t//\n\t\t\t\t\tif (source_array.Rank == target_array.Rank) {\n\n\t\t\t\t\t\tsource_type = source_array.Element;\n\t\t\t\t\t\tvar target_element = target_array.Element;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// LAMESPEC: Type parameters are special cased somehow but\n\t\t\t\t\t\t// only when both source and target elements are type parameters\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((source_type.Kind & target_element.Kind & MemberKind.TypeParameter) == MemberKind.TypeParameter) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Conversion is allowed unless source element type has struct constrain\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tif (TypeSpec.IsValueType (source_type))\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!TypeSpec.IsReferenceType (source_type))\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!TypeSpec.IsReferenceType (target_element))\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tif (ExplicitReferenceConversionExists (source_type, target_element))\n\t\t\t\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// From a single-dimensional array type S[] to System.Collections.Generic.IList<T> and its base interfaces, \n\t\t\t\t// provided that there is an explicit reference conversion from S to T\n\t\t\t\t//\n\t\t\t\tif (ArrayToIList (source_array, target_type, true))\n\t\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// From any class type S to any interface T, provides S is not sealed\n\t\t\t// and provided S does not implement T.\n\t\t\t//\n\t\t\tif (target_type.IsInterface && !source_type.IsSealed && !source_type.ImplementsInterface (target_type, true)) {\n\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// From System delegate to any delegate-type\n\t\t\t//\n\t\t\tif (source_type.BuiltinType == BuiltinTypeSpec.Type.Delegate && target_type.IsDelegate)\n\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\n\t\t\t//\n\t\t\t// From variant generic delegate to same variant generic delegate type\n\t\t\t//\n\t\t\tif (source_type.IsDelegate && target_type.IsDelegate && source_type.MemberDefinition == target_type.MemberDefinition) {\n\t\t\t\tvar tparams = source_type.MemberDefinition.TypeParameters;\n\t\t\t\tvar targs_src = source_type.TypeArguments;\n\t\t\t\tvar targs_dst = target_type.TypeArguments;\n\t\t\t\tint i;\n\t\t\t\tfor (i = 0; i < tparams.Length; ++i) {\n\t\t\t\t\t//\n\t\t\t\t\t// If TP is invariant, types have to be identical\n\t\t\t\t\t//\n\t\t\t\t\tif (TypeSpecComparer.IsEqual (targs_src[i], targs_dst[i]))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (tparams[i].Variance == Variance.Covariant) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t//If TP is covariant, an implicit or explicit identity or reference conversion is required\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (ImplicitReferenceConversionExists (targs_src[i], targs_dst[i]))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (ExplicitReferenceConversionExists (targs_src[i], targs_dst[i]))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t} else if (tparams[i].Variance == Variance.Contravariant) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t//If TP is contravariant, both are either identical or reference types\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (TypeSpec.IsReferenceType (targs_src[i]) && TypeSpec.IsReferenceType (targs_dst[i]))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (i == tparams.Length)\n\t\t\t\t\treturn source == null ? EmptyExpression.Null : new ClassCast (source, target_type);\n\t\t\t}\n\n\t\t\tvar tps = target_type as TypeParameterSpec;\n\t\t\tif (tps != null)\n\t\t\t\treturn ExplicitTypeParameterConversionToT (source, source_type, tps);\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Performs an explicit conversion of the expression `expr' whose\n\t\t///   type is expr.Type to `target_type'.\n\t\t/// </summary>\n\t\tstatic public Expression ExplicitConversionCore (ResolveContext ec, Expression expr,\n\t\t\t\t\t\t\t\t TypeSpec target_type, Location loc)\n\t\t{\n\t\t\tTypeSpec expr_type = expr.Type;\n\n\t\t\t// Explicit conversion includes implicit conversion and it used for enum underlying types too\n\t\t\tExpression ne = ImplicitConversionStandard (ec, expr, target_type, loc, true);\n\t\t\tif (ne != null)\n\t\t\t\treturn ne;\n\n\t\t\tif (expr_type.IsEnum) {\n\t\t\t\tTypeSpec real_target = target_type.IsEnum ? EnumSpec.GetUnderlyingType (target_type) : target_type;\n\t\t\t\tExpression underlying = EmptyCast.Create (expr, EnumSpec.GetUnderlyingType (expr_type));\n\t\t\t\tif (underlying.Type == real_target)\n\t\t\t\t\tne = underlying;\n\n\t\t\t\tif (ne == null)\n\t\t\t\t\tne = ImplicitNumericConversion (underlying, real_target);\n\n\t\t\t\tif (ne == null)\n\t\t\t\t\tne = ExplicitNumericConversion (ec, underlying, real_target);\n\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: IntPtr and UIntPtr conversion to any Enum is allowed\n\t\t\t\t//\n\t\t\t\tif (ne == null && (real_target.BuiltinType == BuiltinTypeSpec.Type.IntPtr || real_target.BuiltinType == BuiltinTypeSpec.Type.UIntPtr))\n\t\t\t\t\tne = ExplicitUserConversion (ec, underlying, real_target, loc);\n\n\t\t\t\treturn ne != null ? EmptyCast.Create (ne, target_type) : null;\n\t\t\t}\n\n\t\t\tif (target_type.IsEnum) {\n\t\t\t\t//\n\t\t\t\t// System.Enum can be unboxed to any enum-type\n\t\t\t\t//\n\t\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.Enum)\n\t\t\t\t\treturn new UnboxCast (expr, target_type);\n\n\t\t\t\tTypeSpec real_target = target_type.IsEnum ? EnumSpec.GetUnderlyingType (target_type) : target_type;\n\n\t\t\t\tif (expr_type == real_target)\n\t\t\t\t\treturn EmptyCast.Create (expr, target_type);\n\n\t\t\t\tConstant c = expr as Constant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\tc = c.TryReduce (ec, real_target);\n\t\t\t\t\tif (c != null)\n\t\t\t\t\t\treturn c;\n\t\t\t\t} else {\n\t\t\t\t\tne = ImplicitNumericConversion (expr, real_target);\n\t\t\t\t\tif (ne != null)\n\t\t\t\t\t\treturn EmptyCast.Create (ne, target_type);\n\n\t\t\t\t\tne = ExplicitNumericConversion (ec, expr, real_target);\n\t\t\t\t\tif (ne != null)\n\t\t\t\t\t\treturn EmptyCast.Create (ne, target_type);\n\n\t\t\t\t\t//\n\t\t\t\t\t// LAMESPEC: IntPtr and UIntPtr conversion to any Enum is allowed\n\t\t\t\t\t//\n\t\t\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.IntPtr || expr_type.BuiltinType == BuiltinTypeSpec.Type.UIntPtr) {\n\t\t\t\t\t\tne = ExplicitUserConversion (ec, expr, real_target, loc);\n\t\t\t\t\t\tif (ne != null)\n\t\t\t\t\t\t\treturn ExplicitConversionCore (ec, ne, target_type, loc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tne = ExplicitNumericConversion (ec, expr, target_type);\n\t\t\t\tif (ne != null)\n\t\t\t\t\treturn ne;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Skip the ExplicitReferenceConversion because we can not convert\n\t\t\t// from Null to a ValueType, and ExplicitReference wont check against\n\t\t\t// null literal explicitly\n\t\t\t//\n\t\t\tif (expr_type != InternalType.NullLiteral) {\n\t\t\t\tne = ExplicitReferenceConversion (expr, expr_type, target_type);\n\t\t\t\tif (ne != null)\n\t\t\t\t\treturn ne;\n\t\t\t}\n\n\t\t\tif (ec.IsUnsafe){\n\t\t\t\tne = ExplicitUnsafe (expr, target_type);\n\t\t\t\tif (ne != null)\n\t\t\t\t\treturn ne;\n\t\t\t}\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static Expression ExplicitUnsafe (Expression expr, TypeSpec target_type)\n\t\t{\n\t\t\tTypeSpec expr_type = expr.Type;\n\n\t\t\tif (target_type.IsPointer){\n\t\t\t\tif (expr_type.IsPointer)\n\t\t\t\t\treturn EmptyCast.Create (expr, target_type);\n\n\t\t\t\tswitch (expr_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_I);\n\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_U);\n\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I8_I);\n\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.U8_I);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr_type.IsPointer){\n\t\t\t\tswitch (target_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_I1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_U1);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_I2);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_U2);\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_I4);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_U4);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new ConvCast (expr, target_type, ConvCast.Mode.I_I8);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_U8);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Same as ExplicitConversion, only it doesn't include user defined conversions\n\t\t/// </summary>\n\t\tstatic public Expression ExplicitConversionStandard (ResolveContext ec, Expression expr,\n\t\t\t\t\t\t\t\t     TypeSpec target_type, Location l)\n\t\t{\n\t\t\tint errors = ec.Report.Errors;\n\t\t\tExpression ne = ImplicitConversionStandard (ec, expr, target_type, l);\n\t\t\tif (ec.Report.Errors > errors)\n\t\t\t\treturn null;\n\n\t\t\tif (ne != null)\n\t\t\t\treturn ne;\n\n\t\t\tne = ExplicitNumericConversion (ec, expr, target_type);\n\t\t\tif (ne != null)\n\t\t\t\treturn ne;\n\n\t\t\tne = ExplicitReferenceConversion (expr, expr.Type, target_type);\n\t\t\tif (ne != null)\n\t\t\t\treturn ne;\n\n\t\t\tif (ec.IsUnsafe && expr.Type.IsPointer && target_type.IsPointer && ((PointerContainer)expr.Type).Element.Kind == MemberKind.Void)\n\t\t\t\treturn EmptyCast.Create (expr, target_type);\n\n\t\t\texpr.Error_ValueCannotBeConverted (ec, target_type, true);\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Performs an explicit conversion of the expression `expr' whose\n\t\t///   type is expr.Type to `target_type'.\n\t\t/// </summary>\n\t\tstatic public Expression ExplicitConversion (ResolveContext ec, Expression expr,\n\t\t\tTypeSpec target_type, Location loc)\n\t\t{\n\t\t\tExpression e = ExplicitConversionCore (ec, expr, target_type, loc);\n\t\t\tif (e != null) {\n\t\t\t\t//\n\t\t\t\t// Don't eliminate explicit precission casts\n\t\t\t\t//\n\t\t\t\tif (e == expr) {\n\t\t\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.Float)\n\t\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_R4);\n\t\t\t\t\t\n\t\t\t\t\tif (target_type.BuiltinType == BuiltinTypeSpec.Type.Double)\n\t\t\t\t\t\treturn new OpcodeCast (expr, target_type, OpCodes.Conv_R8);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn e;\n\t\t\t}\n\n\t\t\tTypeSpec expr_type = expr.Type;\n\t\t\tif (target_type.IsNullableType) {\n\t\t\t\tTypeSpec target;\n\n\t\t\t\tif (expr_type.IsNullableType) {\n\t\t\t\t\ttarget = Nullable.NullableInfo.GetUnderlyingType (target_type);\n\t\t\t\t\tExpression unwrap = Nullable.Unwrap.Create (expr);\n\t\t\t\t\te = ExplicitConversion (ec, unwrap, target, expr.Location);\n\t\t\t\t\tif (e == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\treturn new Nullable.LiftedConversion (e, unwrap, target_type).Resolve (ec);\n\t\t\t\t}\n\t\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.Object) {\n\t\t\t\t\treturn new UnboxCast (expr, target_type);\n\t\t\t\t}\n\n\t\t\t\ttarget = TypeManager.GetTypeArguments (target_type) [0];\n\t\t\t\te = ExplicitConversionCore (ec, expr, target, loc);\n\t\t\t\tif (e != null)\n\t\t\t\t\treturn TypeSpec.IsReferenceType (expr.Type) ? new UnboxCast (expr, target_type) : Nullable.Wrap.Create (e, target_type);\n\t\t\t} else if (expr_type.IsNullableType) {\n\t\t\t\te = ImplicitBoxingConversion (expr, Nullable.NullableInfo.GetUnderlyingType (expr_type), target_type);\n\t\t\t\tif (e != null)\n\t\t\t\t\treturn e;\n\n\t\t\t\te = Nullable.Unwrap.Create (expr, false);\t\t\t\n\t\t\t\te = ExplicitConversionCore (ec, e, target_type, loc);\n\t\t\t\tif (e != null)\n\t\t\t\t\treturn EmptyCast.Create (e, target_type);\n\t\t\t}\n\t\t\t\n\t\t\te = ExplicitUserConversion (ec, expr, target_type, loc);\n\n\t\t\tif (e != null)\n\t\t\t\treturn e;\t\t\t\n\n\t\t\texpr.Error_ValueCannotBeConverted (ec, target_type, true);\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs",
    "content": "// created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de\n\n#line 2 \"cs-parser.jay\"\n//\n// cs-parser.jay: The Parser for the C# compiler\n//\n// Authors: Miguel de Icaza (miguel@gnome.org)\n//          Ravi Pratap     (ravi@ximian.com)\n//          Marek Safar\t    (marek.safar@gmail.com)\n//\n// Dual Licensed under the terms of the GNU GPL and the MIT X11 license\n//\n// (C) 2001 Ximian, Inc (http://www.ximian.com)\n// (C) 2004-2011 Novell, Inc\n// Copyright 2011-2012 Xamarin Inc.\n//\n\nusing System.Text;\nusing System.IO;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Mono.CSharp\n{\n\t/// <summary>\n\t///    The C# Parser\n\t/// </summary>\n\tpublic class CSharpParser\n\t{\n\t\t[Flags]\n\t\tenum ParameterModifierType\n\t\t{\n\t\t\tRef\t\t= 1 << 1,\n\t\t\tOut\t\t= 1 << 2,\n\t\t\tThis\t= 1 << 3,\n\t\t\tParams\t= 1 << 4,\n\t\t\tArglist\t= 1 << 5,\n\t\t\tDefaultValue = 1 << 6,\n\t\t\t\n\t\t\tAll = Ref | Out | This | Params | Arglist | DefaultValue,\n\t\t\tPrimaryConstructor = Ref | Out | Params | DefaultValue\n\t\t}\n\t\t\n\t\tstatic readonly object ModifierNone = 0;\n\t\n\t\tNamespaceContainer current_namespace;\n\t\tTypeContainer current_container;\n\t\tTypeDefinition current_type;\n\t\tPropertyBase current_property;\n\t\tEventProperty current_event;\n\t\tEventField current_event_field;\n\t\tFieldBase current_field;\n\t\n\t\t/// <summary>\n\t\t///   Current block is used to add statements as we find\n\t\t///   them.  \n\t\t/// </summary>\n\t\tBlock      current_block;\n\t\t\n\t\tBlockVariable current_variable;\n\n\t\tDelegate   current_delegate;\n\t\t\n\t\tAnonymousMethodExpression current_anonymous_method;\n\n\t\t/// <summary>\n\t\t///   This is used by the unary_expression code to resolve\n\t\t///   a name against a parameter.  \n\t\t/// </summary>\n\t\t\n\t\t// FIXME: This is very ugly and it's very hard to reset it correctly\n\t\t// on all places, especially when some parameters are autogenerated.\n\t\tParametersCompiled current_local_parameters;\n\n\t\tbool parsing_anonymous_method;\n\t\t\n\t\tbool async_block;\n\n\t\t///\n\t\t/// An out-of-band stack.\n\t\t///\n\t\tStack<object> oob_stack;\n\n\t\t///\n\t\t/// Controls the verbosity of the errors produced by the parser\n\t\t///\n\t\tint yacc_verbose_flag;\n\n\t\t/// \n\t\t/// Used by the interactive shell, flags whether EOF was reached\n\t\t/// and an error was produced\n\t\t///\n\t\tpublic bool UnexpectedEOF;\n\n\t\t///\n\t\t/// The current file.\n\t\t///\n\t\treadonly CompilationSourceFile file;\n\n\t\t///\n\t\t/// Temporary Xml documentation cache.\n\t\t/// For enum types, we need one more temporary store.\n\t\t///\n\t\tstring tmpComment;\n\t\tstring enumTypeComment;\n\t       \t\t\n\t\t/// Current attribute target\n\t\tstring current_attr_target;\n\t\t\n\t\tParameterModifierType valid_param_mod;\n\t\t\n\t\tbool default_parameter_used;\n\n\t\t/// When using the interactive parser, this holds the\n\t\t/// resulting expression\n\t\tpublic Class InteractiveResult;\n\n\t\t//\n\t\t// Keeps track of global data changes to undo on parser error\n\t\t//\n\t\tpublic Undo undo;\n\n\t\tbool? interactive_async;\n\t\t\n\t\tStack<Linq.QueryBlock> linq_clause_blocks;\n\n\t\tModuleContainer module;\n\t\t\n\t\treadonly CompilerContext compiler;\n\t\treadonly LanguageVersion lang_version;\n\t\treadonly bool doc_support;\n\t\treadonly CompilerSettings settings;\n\t\treadonly Report report;\n\t\t\n\t\t//\n\t\t// Instead of allocating carrier array everytime we\n\t\t// share the bucket for very common constructs which can never\n\t\t// be recursive\n\t\t//\n\t\tList<Parameter> parameters_bucket;\n\t\t\n\t\t//\n\t\t// Full AST support members\n\t\t//\n\t\tLocationsBag lbag;\n\t\tList<Tuple<Modifiers, Location>> mod_locations;\n\t\tLocation parameterModifierLocation, savedLocation, savedEventAssignLocation;\n\t\tLocation savedAttrParenOpenLocation, savedAttrParenCloseLocation, savedOperatorLocation;\n\t\tStack<List<Location>> locationListStack = new Stack<List<Location>> (); // used for type parameters\n\t\tStack<Location> opt_intoStack = new Stack<Location> ();\n\n\t\tbool HadAttributeParens;\n\t\tList<Location> attributeArgumentCommas = new List<Location> ();\n\t\tList<Location> parameterListCommas = new List<Location> ();\n\t\tStack<Location> location_stack;\n#line default\n\n  /** error output stream.\n      It should be changeable.\n    */\n  public System.IO.TextWriter ErrorOutput = System.Console.Out;\n\n  /** simplified error message.\n      @see <a href=\"#yyerror(java.lang.String, java.lang.String[])\">yyerror</a>\n    */\n  public void yyerror (string message) {\n    yyerror(message, null);\n  }\n#pragma warning disable 649\n  /* An EOF token */\n  public int eof_token;\n#pragma warning restore 649\n  /** (syntax) error message.\n      Can be overwritten to control message format.\n      @param message text to be displayed.\n      @param expected vector of acceptable tokens, if available.\n    */\n  public void yyerror (string message, string[] expected) {\n    if ((yacc_verbose_flag > 0) && (expected != null) && (expected.Length  > 0)) {\n      ErrorOutput.Write (message+\", expecting\");\n      for (int n = 0; n < expected.Length; ++ n)\n        ErrorOutput.Write (\" \"+expected[n]);\n        ErrorOutput.WriteLine ();\n    } else\n      ErrorOutput.WriteLine (message);\n  }\n\n  /** debugging support, requires the package jay.yydebug.\n      Set to null to suppress debugging messages.\n    */\n//t  internal yydebug.yyDebug debug;\n\n  protected const int yyFinal = 7;\n//t // Put this array into a separate class so it is only initialized if debugging is actually used\n//t // Use MarshalByRefObject to disable inlining\n//t class YYRules : MarshalByRefObject {\n//t  public static readonly string [] yyRule = {\n//t    \"$accept : compilation_unit\",\n//t    \"compilation_unit : outer_declaration opt_EOF\",\n//t    \"$$1 :\",\n//t    \"compilation_unit : interactive_parsing $$1 opt_EOF\",\n//t    \"compilation_unit : documentation_parsing\",\n//t    \"outer_declaration : opt_extern_alias_directives opt_using_directives\",\n//t    \"outer_declaration : opt_extern_alias_directives opt_using_directives namespace_or_type_declarations opt_attributes\",\n//t    \"outer_declaration : opt_extern_alias_directives opt_using_directives attribute_sections\",\n//t    \"outer_declaration : error\",\n//t    \"opt_EOF :\",\n//t    \"opt_EOF : EOF\",\n//t    \"extern_alias_directives : extern_alias_directive\",\n//t    \"extern_alias_directives : extern_alias_directives extern_alias_directive\",\n//t    \"extern_alias_directive : EXTERN_ALIAS IDENTIFIER IDENTIFIER SEMICOLON\",\n//t    \"extern_alias_directive : EXTERN_ALIAS error\",\n//t    \"using_directives : using_directive\",\n//t    \"using_directives : using_directives using_directive\",\n//t    \"using_directive : using_namespace\",\n//t    \"using_namespace : USING namespace_or_type_expr SEMICOLON\",\n//t    \"using_namespace : USING IDENTIFIER ASSIGN namespace_or_type_expr SEMICOLON\",\n//t    \"using_namespace : USING error\",\n//t    \"$$2 :\",\n//t    \"$$3 :\",\n//t    \"namespace_declaration : opt_attributes NAMESPACE namespace_name $$2 OPEN_BRACE $$3 opt_extern_alias_directives opt_using_directives opt_namespace_or_type_declarations CLOSE_BRACE opt_semicolon_error\",\n//t    \"namespace_declaration : opt_attributes NAMESPACE namespace_name\",\n//t    \"opt_semicolon_error :\",\n//t    \"opt_semicolon_error : SEMICOLON\",\n//t    \"opt_semicolon_error : error\",\n//t    \"namespace_name : IDENTIFIER\",\n//t    \"namespace_name : namespace_name DOT IDENTIFIER\",\n//t    \"namespace_name : error\",\n//t    \"opt_semicolon :\",\n//t    \"opt_semicolon : SEMICOLON\",\n//t    \"opt_comma :\",\n//t    \"opt_comma : COMMA\",\n//t    \"opt_using_directives :\",\n//t    \"opt_using_directives : using_directives\",\n//t    \"opt_extern_alias_directives :\",\n//t    \"opt_extern_alias_directives : extern_alias_directives\",\n//t    \"opt_namespace_or_type_declarations :\",\n//t    \"opt_namespace_or_type_declarations : namespace_or_type_declarations\",\n//t    \"namespace_or_type_declarations : namespace_or_type_declaration\",\n//t    \"namespace_or_type_declarations : namespace_or_type_declarations namespace_or_type_declaration\",\n//t    \"namespace_or_type_declaration : type_declaration\",\n//t    \"namespace_or_type_declaration : namespace_declaration\",\n//t    \"namespace_or_type_declaration : attribute_sections CLOSE_BRACE\",\n//t    \"type_declaration : class_declaration\",\n//t    \"type_declaration : struct_declaration\",\n//t    \"type_declaration : interface_declaration\",\n//t    \"type_declaration : enum_declaration\",\n//t    \"type_declaration : delegate_declaration\",\n//t    \"opt_attributes :\",\n//t    \"opt_attributes : attribute_sections\",\n//t    \"attribute_sections : attribute_section\",\n//t    \"attribute_sections : attribute_sections attribute_section\",\n//t    \"$$4 :\",\n//t    \"attribute_section : OPEN_BRACKET $$4 attribute_section_cont\",\n//t    \"$$5 :\",\n//t    \"attribute_section_cont : attribute_target COLON $$5 attribute_list opt_comma CLOSE_BRACKET\",\n//t    \"attribute_section_cont : attribute_list opt_comma CLOSE_BRACKET\",\n//t    \"attribute_section_cont : IDENTIFIER error\",\n//t    \"attribute_section_cont : error\",\n//t    \"attribute_target : IDENTIFIER\",\n//t    \"attribute_target : EVENT\",\n//t    \"attribute_target : RETURN\",\n//t    \"attribute_list : attribute\",\n//t    \"attribute_list : attribute_list COMMA attribute\",\n//t    \"$$6 :\",\n//t    \"attribute : attribute_name $$6 opt_attribute_arguments\",\n//t    \"attribute_name : namespace_or_type_expr\",\n//t    \"opt_attribute_arguments :\",\n//t    \"opt_attribute_arguments : OPEN_PARENS attribute_arguments CLOSE_PARENS\",\n//t    \"attribute_arguments :\",\n//t    \"attribute_arguments : positional_or_named_argument\",\n//t    \"attribute_arguments : named_attribute_argument\",\n//t    \"attribute_arguments : attribute_arguments COMMA positional_or_named_argument\",\n//t    \"attribute_arguments : attribute_arguments COMMA named_attribute_argument\",\n//t    \"positional_or_named_argument : expression\",\n//t    \"positional_or_named_argument : named_argument\",\n//t    \"positional_or_named_argument : error\",\n//t    \"$$7 :\",\n//t    \"named_attribute_argument : IDENTIFIER ASSIGN $$7 expression\",\n//t    \"named_argument : identifier_inside_body COLON opt_named_modifier expression_or_error\",\n//t    \"opt_named_modifier :\",\n//t    \"opt_named_modifier : REF\",\n//t    \"opt_named_modifier : OUT\",\n//t    \"opt_class_member_declarations :\",\n//t    \"opt_class_member_declarations : class_member_declarations\",\n//t    \"class_member_declarations : class_member_declaration\",\n//t    \"class_member_declarations : class_member_declarations class_member_declaration\",\n//t    \"class_member_declaration : constant_declaration\",\n//t    \"class_member_declaration : field_declaration\",\n//t    \"class_member_declaration : method_declaration\",\n//t    \"class_member_declaration : property_declaration\",\n//t    \"class_member_declaration : event_declaration\",\n//t    \"class_member_declaration : indexer_declaration\",\n//t    \"class_member_declaration : operator_declaration\",\n//t    \"class_member_declaration : constructor_declaration\",\n//t    \"class_member_declaration : primary_constructor_body\",\n//t    \"class_member_declaration : destructor_declaration\",\n//t    \"class_member_declaration : type_declaration\",\n//t    \"class_member_declaration : attributes_without_members\",\n//t    \"class_member_declaration : incomplete_member\",\n//t    \"class_member_declaration : error\",\n//t    \"$$8 :\",\n//t    \"primary_constructor_body : OPEN_BRACE $$8 opt_statement_list block_end\",\n//t    \"$$9 :\",\n//t    \"$$10 :\",\n//t    \"$$11 :\",\n//t    \"$$12 :\",\n//t    \"$$13 :\",\n//t    \"struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT $$9 type_declaration_name $$10 opt_primary_parameters opt_class_base opt_type_parameter_constraints_clauses $$11 OPEN_BRACE $$12 opt_class_member_declarations CLOSE_BRACE $$13 opt_semicolon\",\n//t    \"struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT error\",\n//t    \"$$14 :\",\n//t    \"constant_declaration : opt_attributes opt_modifiers CONST type IDENTIFIER $$14 constant_initializer opt_constant_declarators SEMICOLON\",\n//t    \"constant_declaration : opt_attributes opt_modifiers CONST type error\",\n//t    \"opt_constant_declarators :\",\n//t    \"opt_constant_declarators : constant_declarators\",\n//t    \"constant_declarators : constant_declarator\",\n//t    \"constant_declarators : constant_declarators constant_declarator\",\n//t    \"constant_declarator : COMMA IDENTIFIER constant_initializer\",\n//t    \"$$15 :\",\n//t    \"constant_initializer : ASSIGN $$15 constant_initializer_expr\",\n//t    \"constant_initializer : error\",\n//t    \"constant_initializer_expr : constant_expression\",\n//t    \"constant_initializer_expr : array_initializer\",\n//t    \"$$16 :\",\n//t    \"field_declaration : opt_attributes opt_modifiers member_type IDENTIFIER $$16 opt_field_initializer opt_field_declarators SEMICOLON\",\n//t    \"$$17 :\",\n//t    \"field_declaration : opt_attributes opt_modifiers FIXED simple_type IDENTIFIER $$17 fixed_field_size opt_fixed_field_declarators SEMICOLON\",\n//t    \"field_declaration : opt_attributes opt_modifiers FIXED simple_type error SEMICOLON\",\n//t    \"opt_field_initializer :\",\n//t    \"$$18 :\",\n//t    \"opt_field_initializer : ASSIGN $$18 variable_initializer\",\n//t    \"opt_field_declarators :\",\n//t    \"opt_field_declarators : field_declarators\",\n//t    \"field_declarators : field_declarator\",\n//t    \"field_declarators : field_declarators field_declarator\",\n//t    \"field_declarator : COMMA IDENTIFIER\",\n//t    \"$$19 :\",\n//t    \"field_declarator : COMMA IDENTIFIER ASSIGN $$19 variable_initializer\",\n//t    \"opt_fixed_field_declarators :\",\n//t    \"opt_fixed_field_declarators : fixed_field_declarators\",\n//t    \"fixed_field_declarators : fixed_field_declarator\",\n//t    \"fixed_field_declarators : fixed_field_declarators fixed_field_declarator\",\n//t    \"fixed_field_declarator : COMMA IDENTIFIER fixed_field_size\",\n//t    \"$$20 :\",\n//t    \"fixed_field_size : OPEN_BRACKET $$20 expression CLOSE_BRACKET\",\n//t    \"fixed_field_size : OPEN_BRACKET error\",\n//t    \"variable_initializer : expression\",\n//t    \"variable_initializer : array_initializer\",\n//t    \"variable_initializer : error\",\n//t    \"$$21 :\",\n//t    \"method_declaration : method_header $$21 method_body_expression_block\",\n//t    \"$$22 :\",\n//t    \"$$23 :\",\n//t    \"method_header : opt_attributes opt_modifiers member_type method_declaration_name OPEN_PARENS $$22 opt_formal_parameter_list CLOSE_PARENS $$23 opt_type_parameter_constraints_clauses\",\n//t    \"$$24 :\",\n//t    \"$$25 :\",\n//t    \"$$26 :\",\n//t    \"method_header : opt_attributes opt_modifiers PARTIAL VOID $$24 method_declaration_name OPEN_PARENS $$25 opt_formal_parameter_list CLOSE_PARENS $$26 opt_type_parameter_constraints_clauses\",\n//t    \"method_header : opt_attributes opt_modifiers member_type modifiers method_declaration_name OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS\",\n//t    \"method_header : opt_attributes opt_modifiers member_type method_declaration_name error\",\n//t    \"method_body_expression_block : method_body\",\n//t    \"method_body_expression_block : expression_block\",\n//t    \"method_body : block\",\n//t    \"method_body : SEMICOLON\",\n//t    \"$$27 :\",\n//t    \"expression_block : ARROW $$27 expression SEMICOLON\",\n//t    \"opt_formal_parameter_list :\",\n//t    \"opt_formal_parameter_list : formal_parameter_list\",\n//t    \"formal_parameter_list : fixed_parameters\",\n//t    \"formal_parameter_list : fixed_parameters COMMA parameter_array\",\n//t    \"formal_parameter_list : fixed_parameters COMMA arglist_modifier\",\n//t    \"formal_parameter_list : parameter_array COMMA error\",\n//t    \"formal_parameter_list : fixed_parameters COMMA parameter_array COMMA error\",\n//t    \"formal_parameter_list : arglist_modifier COMMA error\",\n//t    \"formal_parameter_list : fixed_parameters COMMA ARGLIST COMMA error\",\n//t    \"formal_parameter_list : parameter_array\",\n//t    \"formal_parameter_list : arglist_modifier\",\n//t    \"formal_parameter_list : error\",\n//t    \"fixed_parameters : fixed_parameter\",\n//t    \"fixed_parameters : fixed_parameters COMMA fixed_parameter\",\n//t    \"fixed_parameter : opt_attributes opt_parameter_modifier parameter_type identifier_inside_body\",\n//t    \"fixed_parameter : opt_attributes opt_parameter_modifier parameter_type identifier_inside_body OPEN_BRACKET CLOSE_BRACKET\",\n//t    \"fixed_parameter : attribute_sections error\",\n//t    \"fixed_parameter : opt_attributes opt_parameter_modifier parameter_type error\",\n//t    \"$$28 :\",\n//t    \"fixed_parameter : opt_attributes opt_parameter_modifier parameter_type identifier_inside_body ASSIGN $$28 constant_expression\",\n//t    \"opt_parameter_modifier :\",\n//t    \"opt_parameter_modifier : parameter_modifiers\",\n//t    \"parameter_modifiers : parameter_modifier\",\n//t    \"parameter_modifiers : parameter_modifiers parameter_modifier\",\n//t    \"parameter_modifier : REF\",\n//t    \"parameter_modifier : OUT\",\n//t    \"parameter_modifier : THIS\",\n//t    \"parameter_array : opt_attributes params_modifier type IDENTIFIER\",\n//t    \"parameter_array : opt_attributes params_modifier type IDENTIFIER ASSIGN constant_expression\",\n//t    \"parameter_array : opt_attributes params_modifier type error\",\n//t    \"params_modifier : PARAMS\",\n//t    \"params_modifier : PARAMS parameter_modifier\",\n//t    \"params_modifier : PARAMS params_modifier\",\n//t    \"arglist_modifier : ARGLIST\",\n//t    \"$$29 :\",\n//t    \"$$30 :\",\n//t    \"$$31 :\",\n//t    \"$$32 :\",\n//t    \"property_declaration : opt_attributes opt_modifiers member_type member_declaration_name $$29 OPEN_BRACE $$30 accessor_declarations $$31 CLOSE_BRACE $$32 opt_property_initializer\",\n//t    \"$$33 :\",\n//t    \"property_declaration : opt_attributes opt_modifiers member_type member_declaration_name $$33 expression_block\",\n//t    \"opt_property_initializer :\",\n//t    \"$$34 :\",\n//t    \"opt_property_initializer : ASSIGN $$34 property_initializer SEMICOLON\",\n//t    \"property_initializer : expression\",\n//t    \"property_initializer : array_initializer\",\n//t    \"$$35 :\",\n//t    \"$$36 :\",\n//t    \"indexer_declaration : opt_attributes opt_modifiers member_type indexer_declaration_name OPEN_BRACKET $$35 opt_formal_parameter_list CLOSE_BRACKET $$36 indexer_body\",\n//t    \"indexer_body : OPEN_BRACE accessor_declarations CLOSE_BRACE\",\n//t    \"indexer_body : expression_block\",\n//t    \"accessor_declarations : get_accessor_declaration\",\n//t    \"accessor_declarations : get_accessor_declaration accessor_declarations\",\n//t    \"accessor_declarations : set_accessor_declaration\",\n//t    \"accessor_declarations : set_accessor_declaration accessor_declarations\",\n//t    \"accessor_declarations : error\",\n//t    \"$$37 :\",\n//t    \"get_accessor_declaration : opt_attributes opt_modifiers GET $$37 accessor_body\",\n//t    \"$$38 :\",\n//t    \"set_accessor_declaration : opt_attributes opt_modifiers SET $$38 accessor_body\",\n//t    \"accessor_body : block\",\n//t    \"accessor_body : SEMICOLON\",\n//t    \"accessor_body : error\",\n//t    \"$$39 :\",\n//t    \"$$40 :\",\n//t    \"$$41 :\",\n//t    \"$$42 :\",\n//t    \"interface_declaration : opt_attributes opt_modifiers opt_partial INTERFACE $$39 type_declaration_name $$40 opt_class_base opt_type_parameter_constraints_clauses $$41 OPEN_BRACE opt_interface_member_declarations CLOSE_BRACE $$42 opt_semicolon\",\n//t    \"interface_declaration : opt_attributes opt_modifiers opt_partial INTERFACE error\",\n//t    \"opt_interface_member_declarations :\",\n//t    \"opt_interface_member_declarations : interface_member_declarations\",\n//t    \"interface_member_declarations : interface_member_declaration\",\n//t    \"interface_member_declarations : interface_member_declarations interface_member_declaration\",\n//t    \"interface_member_declaration : constant_declaration\",\n//t    \"interface_member_declaration : field_declaration\",\n//t    \"interface_member_declaration : method_declaration\",\n//t    \"interface_member_declaration : property_declaration\",\n//t    \"interface_member_declaration : event_declaration\",\n//t    \"interface_member_declaration : indexer_declaration\",\n//t    \"interface_member_declaration : operator_declaration\",\n//t    \"interface_member_declaration : constructor_declaration\",\n//t    \"interface_member_declaration : type_declaration\",\n//t    \"$$43 :\",\n//t    \"operator_declaration : opt_attributes opt_modifiers operator_declarator $$43 method_body_expression_block\",\n//t    \"operator_type : type_expression_or_array\",\n//t    \"operator_type : VOID\",\n//t    \"$$44 :\",\n//t    \"operator_declarator : operator_type OPERATOR overloadable_operator OPEN_PARENS $$44 opt_formal_parameter_list CLOSE_PARENS\",\n//t    \"operator_declarator : conversion_operator_declarator\",\n//t    \"overloadable_operator : BANG\",\n//t    \"overloadable_operator : TILDE\",\n//t    \"overloadable_operator : OP_INC\",\n//t    \"overloadable_operator : OP_DEC\",\n//t    \"overloadable_operator : TRUE\",\n//t    \"overloadable_operator : FALSE\",\n//t    \"overloadable_operator : PLUS\",\n//t    \"overloadable_operator : MINUS\",\n//t    \"overloadable_operator : STAR\",\n//t    \"overloadable_operator : DIV\",\n//t    \"overloadable_operator : PERCENT\",\n//t    \"overloadable_operator : BITWISE_AND\",\n//t    \"overloadable_operator : BITWISE_OR\",\n//t    \"overloadable_operator : CARRET\",\n//t    \"overloadable_operator : OP_SHIFT_LEFT\",\n//t    \"overloadable_operator : OP_SHIFT_RIGHT\",\n//t    \"overloadable_operator : OP_EQ\",\n//t    \"overloadable_operator : OP_NE\",\n//t    \"overloadable_operator : OP_GT\",\n//t    \"overloadable_operator : OP_LT\",\n//t    \"overloadable_operator : OP_GE\",\n//t    \"overloadable_operator : OP_LE\",\n//t    \"$$45 :\",\n//t    \"conversion_operator_declarator : IMPLICIT OPERATOR type OPEN_PARENS $$45 opt_formal_parameter_list CLOSE_PARENS\",\n//t    \"$$46 :\",\n//t    \"conversion_operator_declarator : EXPLICIT OPERATOR type OPEN_PARENS $$46 opt_formal_parameter_list CLOSE_PARENS\",\n//t    \"conversion_operator_declarator : IMPLICIT error\",\n//t    \"conversion_operator_declarator : EXPLICIT error\",\n//t    \"constructor_declaration : constructor_declarator constructor_body\",\n//t    \"$$47 :\",\n//t    \"$$48 :\",\n//t    \"constructor_declarator : opt_attributes opt_modifiers IDENTIFIER $$47 OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS $$48 opt_constructor_initializer\",\n//t    \"constructor_body : block_prepared\",\n//t    \"constructor_body : SEMICOLON\",\n//t    \"opt_constructor_initializer :\",\n//t    \"opt_constructor_initializer : constructor_initializer\",\n//t    \"$$49 :\",\n//t    \"constructor_initializer : COLON BASE OPEN_PARENS $$49 opt_argument_list CLOSE_PARENS\",\n//t    \"$$50 :\",\n//t    \"constructor_initializer : COLON THIS OPEN_PARENS $$50 opt_argument_list CLOSE_PARENS\",\n//t    \"constructor_initializer : COLON error\",\n//t    \"constructor_initializer : error\",\n//t    \"$$51 :\",\n//t    \"destructor_declaration : opt_attributes opt_modifiers TILDE $$51 IDENTIFIER OPEN_PARENS CLOSE_PARENS method_body\",\n//t    \"$$52 :\",\n//t    \"event_declaration : opt_attributes opt_modifiers EVENT type member_declaration_name $$52 opt_event_initializer opt_event_declarators SEMICOLON\",\n//t    \"$$53 :\",\n//t    \"$$54 :\",\n//t    \"event_declaration : opt_attributes opt_modifiers EVENT type member_declaration_name OPEN_BRACE $$53 event_accessor_declarations $$54 CLOSE_BRACE\",\n//t    \"event_declaration : opt_attributes opt_modifiers EVENT type error\",\n//t    \"opt_event_initializer :\",\n//t    \"$$55 :\",\n//t    \"opt_event_initializer : ASSIGN $$55 event_variable_initializer\",\n//t    \"opt_event_declarators :\",\n//t    \"opt_event_declarators : event_declarators\",\n//t    \"event_declarators : event_declarator\",\n//t    \"event_declarators : event_declarators event_declarator\",\n//t    \"event_declarator : COMMA IDENTIFIER\",\n//t    \"$$56 :\",\n//t    \"event_declarator : COMMA IDENTIFIER ASSIGN $$56 event_variable_initializer\",\n//t    \"$$57 :\",\n//t    \"event_variable_initializer : $$57 variable_initializer\",\n//t    \"event_accessor_declarations : add_accessor_declaration remove_accessor_declaration\",\n//t    \"event_accessor_declarations : remove_accessor_declaration add_accessor_declaration\",\n//t    \"event_accessor_declarations : add_accessor_declaration\",\n//t    \"event_accessor_declarations : remove_accessor_declaration\",\n//t    \"event_accessor_declarations : error\",\n//t    \"$$58 :\",\n//t    \"add_accessor_declaration : opt_attributes opt_modifiers ADD $$58 event_accessor_block\",\n//t    \"$$59 :\",\n//t    \"remove_accessor_declaration : opt_attributes opt_modifiers REMOVE $$59 event_accessor_block\",\n//t    \"event_accessor_block : opt_semicolon\",\n//t    \"event_accessor_block : block\",\n//t    \"attributes_without_members : attribute_sections CLOSE_BRACE\",\n//t    \"incomplete_member : opt_attributes opt_modifiers member_type CLOSE_BRACE\",\n//t    \"$$60 :\",\n//t    \"$$61 :\",\n//t    \"$$62 :\",\n//t    \"enum_declaration : opt_attributes opt_modifiers ENUM type_declaration_name opt_enum_base $$60 OPEN_BRACE $$61 opt_enum_member_declarations $$62 CLOSE_BRACE opt_semicolon\",\n//t    \"opt_enum_base :\",\n//t    \"opt_enum_base : COLON type\",\n//t    \"opt_enum_base : COLON error\",\n//t    \"opt_enum_member_declarations :\",\n//t    \"opt_enum_member_declarations : enum_member_declarations\",\n//t    \"opt_enum_member_declarations : enum_member_declarations COMMA\",\n//t    \"enum_member_declarations : enum_member_declaration\",\n//t    \"enum_member_declarations : enum_member_declarations COMMA enum_member_declaration\",\n//t    \"enum_member_declaration : opt_attributes IDENTIFIER\",\n//t    \"$$63 :\",\n//t    \"enum_member_declaration : opt_attributes IDENTIFIER $$63 ASSIGN constant_expression\",\n//t    \"enum_member_declaration : opt_attributes IDENTIFIER error\",\n//t    \"enum_member_declaration : attributes_without_members\",\n//t    \"$$64 :\",\n//t    \"$$65 :\",\n//t    \"$$66 :\",\n//t    \"delegate_declaration : opt_attributes opt_modifiers DELEGATE member_type type_declaration_name OPEN_PARENS $$64 opt_formal_parameter_list CLOSE_PARENS $$65 opt_type_parameter_constraints_clauses $$66 SEMICOLON\",\n//t    \"opt_nullable :\",\n//t    \"opt_nullable : INTERR_NULLABLE\",\n//t    \"namespace_or_type_expr : member_name\",\n//t    \"namespace_or_type_expr : qualified_alias_member IDENTIFIER opt_type_argument_list\",\n//t    \"namespace_or_type_expr : qualified_alias_member IDENTIFIER generic_dimension\",\n//t    \"member_name : simple_name_expr\",\n//t    \"member_name : namespace_or_type_expr DOT IDENTIFIER opt_type_argument_list\",\n//t    \"member_name : namespace_or_type_expr DOT IDENTIFIER generic_dimension\",\n//t    \"simple_name_expr : IDENTIFIER opt_type_argument_list\",\n//t    \"simple_name_expr : IDENTIFIER generic_dimension\",\n//t    \"opt_type_argument_list :\",\n//t    \"opt_type_argument_list : OP_GENERICS_LT type_arguments OP_GENERICS_GT\",\n//t    \"opt_type_argument_list : OP_GENERICS_LT error\",\n//t    \"type_arguments : type\",\n//t    \"type_arguments : type_arguments COMMA type\",\n//t    \"$$67 :\",\n//t    \"type_declaration_name : IDENTIFIER $$67 opt_type_parameter_list\",\n//t    \"member_declaration_name : method_declaration_name\",\n//t    \"method_declaration_name : type_declaration_name\",\n//t    \"method_declaration_name : explicit_interface IDENTIFIER opt_type_parameter_list\",\n//t    \"indexer_declaration_name : THIS\",\n//t    \"indexer_declaration_name : explicit_interface THIS\",\n//t    \"explicit_interface : IDENTIFIER opt_type_argument_list DOT\",\n//t    \"explicit_interface : qualified_alias_member IDENTIFIER opt_type_argument_list DOT\",\n//t    \"explicit_interface : explicit_interface IDENTIFIER opt_type_argument_list DOT\",\n//t    \"opt_type_parameter_list :\",\n//t    \"opt_type_parameter_list : OP_GENERICS_LT_DECL type_parameters OP_GENERICS_GT\",\n//t    \"type_parameters : type_parameter\",\n//t    \"type_parameters : type_parameters COMMA type_parameter\",\n//t    \"type_parameter : opt_attributes opt_type_parameter_variance IDENTIFIER\",\n//t    \"type_parameter : error\",\n//t    \"type_and_void : type_expression_or_array\",\n//t    \"type_and_void : VOID\",\n//t    \"member_type : type_and_void\",\n//t    \"type : type_expression_or_array\",\n//t    \"type : void_invalid\",\n//t    \"simple_type : type_expression\",\n//t    \"simple_type : void_invalid\",\n//t    \"parameter_type : type_expression_or_array\",\n//t    \"parameter_type : VOID\",\n//t    \"type_expression_or_array : type_expression\",\n//t    \"type_expression_or_array : type_expression rank_specifiers\",\n//t    \"type_expression : namespace_or_type_expr opt_nullable\",\n//t    \"type_expression : namespace_or_type_expr pointer_stars\",\n//t    \"type_expression : builtin_type_expression\",\n//t    \"void_invalid : VOID\",\n//t    \"builtin_type_expression : builtin_types opt_nullable\",\n//t    \"builtin_type_expression : builtin_types pointer_stars\",\n//t    \"builtin_type_expression : VOID pointer_stars\",\n//t    \"type_list : base_type_name\",\n//t    \"type_list : type_list COMMA base_type_name\",\n//t    \"base_type_name : type\",\n//t    \"builtin_types : OBJECT\",\n//t    \"builtin_types : STRING\",\n//t    \"builtin_types : BOOL\",\n//t    \"builtin_types : DECIMAL\",\n//t    \"builtin_types : FLOAT\",\n//t    \"builtin_types : DOUBLE\",\n//t    \"builtin_types : integral_type\",\n//t    \"integral_type : SBYTE\",\n//t    \"integral_type : BYTE\",\n//t    \"integral_type : SHORT\",\n//t    \"integral_type : USHORT\",\n//t    \"integral_type : INT\",\n//t    \"integral_type : UINT\",\n//t    \"integral_type : LONG\",\n//t    \"integral_type : ULONG\",\n//t    \"integral_type : CHAR\",\n//t    \"primary_expression : primary_expression_or_type\",\n//t    \"primary_expression : literal\",\n//t    \"primary_expression : array_creation_expression\",\n//t    \"primary_expression : parenthesized_expression\",\n//t    \"primary_expression : default_value_expression\",\n//t    \"primary_expression : invocation_expression\",\n//t    \"primary_expression : element_access\",\n//t    \"primary_expression : this_access\",\n//t    \"primary_expression : base_access\",\n//t    \"primary_expression : post_increment_expression\",\n//t    \"primary_expression : post_decrement_expression\",\n//t    \"primary_expression : object_or_delegate_creation_expression\",\n//t    \"primary_expression : anonymous_type_expression\",\n//t    \"primary_expression : typeof_expression\",\n//t    \"primary_expression : sizeof_expression\",\n//t    \"primary_expression : checked_expression\",\n//t    \"primary_expression : unchecked_expression\",\n//t    \"primary_expression : pointer_member_access\",\n//t    \"primary_expression : anonymous_method_expression\",\n//t    \"primary_expression : undocumented_expressions\",\n//t    \"primary_expression_or_type : simple_name_expr\",\n//t    \"primary_expression_or_type : IDENTIFIER GENERATE_COMPLETION\",\n//t    \"primary_expression_or_type : member_access\",\n//t    \"literal : boolean_literal\",\n//t    \"literal : LITERAL\",\n//t    \"literal : NULL\",\n//t    \"boolean_literal : TRUE\",\n//t    \"boolean_literal : FALSE\",\n//t    \"open_parens_any : OPEN_PARENS\",\n//t    \"open_parens_any : OPEN_PARENS_CAST\",\n//t    \"close_parens : CLOSE_PARENS\",\n//t    \"close_parens : COMPLETE_COMPLETION\",\n//t    \"parenthesized_expression : OPEN_PARENS expression CLOSE_PARENS\",\n//t    \"parenthesized_expression : OPEN_PARENS expression COMPLETE_COMPLETION\",\n//t    \"member_access : primary_expression DOT identifier_inside_body opt_type_argument_list\",\n//t    \"member_access : primary_expression DOT identifier_inside_body generic_dimension\",\n//t    \"member_access : primary_expression INTERR_OPERATOR DOT identifier_inside_body opt_type_argument_list\",\n//t    \"member_access : builtin_types DOT identifier_inside_body opt_type_argument_list\",\n//t    \"member_access : BASE DOT identifier_inside_body opt_type_argument_list\",\n//t    \"member_access : AWAIT DOT identifier_inside_body opt_type_argument_list\",\n//t    \"member_access : qualified_alias_member identifier_inside_body opt_type_argument_list\",\n//t    \"member_access : qualified_alias_member identifier_inside_body generic_dimension\",\n//t    \"member_access : primary_expression DOT GENERATE_COMPLETION\",\n//t    \"member_access : primary_expression DOT IDENTIFIER GENERATE_COMPLETION\",\n//t    \"member_access : builtin_types DOT GENERATE_COMPLETION\",\n//t    \"member_access : builtin_types DOT IDENTIFIER GENERATE_COMPLETION\",\n//t    \"invocation_expression : primary_expression open_parens_any opt_argument_list close_parens\",\n//t    \"invocation_expression : primary_expression open_parens_any argument_list error\",\n//t    \"invocation_expression : primary_expression open_parens_any error\",\n//t    \"opt_object_or_collection_initializer :\",\n//t    \"opt_object_or_collection_initializer : object_or_collection_initializer\",\n//t    \"object_or_collection_initializer : OPEN_BRACE opt_member_initializer_list close_brace_or_complete_completion\",\n//t    \"object_or_collection_initializer : OPEN_BRACE member_initializer_list COMMA CLOSE_BRACE\",\n//t    \"opt_member_initializer_list :\",\n//t    \"opt_member_initializer_list : member_initializer_list\",\n//t    \"member_initializer_list : member_initializer\",\n//t    \"member_initializer_list : member_initializer_list COMMA member_initializer\",\n//t    \"member_initializer_list : member_initializer_list error\",\n//t    \"member_initializer : IDENTIFIER ASSIGN initializer_value\",\n//t    \"member_initializer : AWAIT ASSIGN initializer_value\",\n//t    \"member_initializer : GENERATE_COMPLETION\",\n//t    \"member_initializer : non_assignment_expression opt_COMPLETE_COMPLETION\",\n//t    \"member_initializer : OPEN_BRACE expression_list CLOSE_BRACE\",\n//t    \"member_initializer : OPEN_BRACKET_EXPR expression_list CLOSE_BRACKET ASSIGN initializer_value\",\n//t    \"member_initializer : OPEN_BRACE CLOSE_BRACE\",\n//t    \"initializer_value : expression\",\n//t    \"initializer_value : object_or_collection_initializer\",\n//t    \"opt_argument_list :\",\n//t    \"opt_argument_list : argument_list\",\n//t    \"argument_list : argument_or_named_argument\",\n//t    \"argument_list : argument_list COMMA argument\",\n//t    \"argument_list : argument_list COMMA named_argument\",\n//t    \"argument_list : argument_list COMMA error\",\n//t    \"argument_list : COMMA error\",\n//t    \"argument : expression\",\n//t    \"argument : non_simple_argument\",\n//t    \"argument_or_named_argument : argument\",\n//t    \"argument_or_named_argument : named_argument\",\n//t    \"non_simple_argument : REF variable_reference\",\n//t    \"non_simple_argument : OUT variable_reference\",\n//t    \"non_simple_argument : ARGLIST OPEN_PARENS argument_list CLOSE_PARENS\",\n//t    \"non_simple_argument : ARGLIST OPEN_PARENS CLOSE_PARENS\",\n//t    \"variable_reference : expression\",\n//t    \"element_access : primary_expression OPEN_BRACKET_EXPR expression_list_arguments CLOSE_BRACKET\",\n//t    \"element_access : primary_expression INTERR_OPERATOR OPEN_BRACKET_EXPR expression_list_arguments CLOSE_BRACKET\",\n//t    \"element_access : primary_expression OPEN_BRACKET_EXPR expression_list_arguments error\",\n//t    \"element_access : primary_expression OPEN_BRACKET_EXPR error\",\n//t    \"expression_list : expression_or_error\",\n//t    \"expression_list : expression_list COMMA expression_or_error\",\n//t    \"expression_list_arguments : expression_list_argument\",\n//t    \"expression_list_arguments : expression_list_arguments COMMA expression_list_argument\",\n//t    \"expression_list_argument : expression\",\n//t    \"expression_list_argument : named_argument\",\n//t    \"this_access : THIS\",\n//t    \"base_access : BASE OPEN_BRACKET_EXPR expression_list_arguments CLOSE_BRACKET\",\n//t    \"base_access : BASE OPEN_BRACKET error\",\n//t    \"post_increment_expression : primary_expression OP_INC\",\n//t    \"post_decrement_expression : primary_expression OP_DEC\",\n//t    \"object_or_delegate_creation_expression : NEW new_expr_type open_parens_any opt_argument_list CLOSE_PARENS opt_object_or_collection_initializer\",\n//t    \"object_or_delegate_creation_expression : NEW new_expr_type object_or_collection_initializer\",\n//t    \"array_creation_expression : NEW new_expr_type OPEN_BRACKET_EXPR expression_list CLOSE_BRACKET opt_rank_specifier opt_array_initializer\",\n//t    \"array_creation_expression : NEW new_expr_type rank_specifiers opt_array_initializer\",\n//t    \"array_creation_expression : NEW rank_specifier array_initializer\",\n//t    \"array_creation_expression : NEW new_expr_type OPEN_BRACKET CLOSE_BRACKET OPEN_BRACKET_EXPR error CLOSE_BRACKET\",\n//t    \"array_creation_expression : NEW new_expr_type error\",\n//t    \"$$68 :\",\n//t    \"new_expr_type : $$68 simple_type\",\n//t    \"anonymous_type_expression : NEW OPEN_BRACE anonymous_type_parameters_opt_comma CLOSE_BRACE\",\n//t    \"anonymous_type_expression : NEW OPEN_BRACE GENERATE_COMPLETION\",\n//t    \"anonymous_type_parameters_opt_comma : anonymous_type_parameters_opt\",\n//t    \"anonymous_type_parameters_opt_comma : anonymous_type_parameters COMMA\",\n//t    \"anonymous_type_parameters_opt :\",\n//t    \"anonymous_type_parameters_opt : anonymous_type_parameters\",\n//t    \"anonymous_type_parameters : anonymous_type_parameter\",\n//t    \"anonymous_type_parameters : anonymous_type_parameters COMMA anonymous_type_parameter\",\n//t    \"anonymous_type_parameters : COMPLETE_COMPLETION\",\n//t    \"anonymous_type_parameters : anonymous_type_parameter COMPLETE_COMPLETION\",\n//t    \"anonymous_type_parameter : identifier_inside_body ASSIGN variable_initializer\",\n//t    \"anonymous_type_parameter : identifier_inside_body\",\n//t    \"anonymous_type_parameter : member_access\",\n//t    \"anonymous_type_parameter : error\",\n//t    \"opt_rank_specifier :\",\n//t    \"opt_rank_specifier : rank_specifiers\",\n//t    \"rank_specifiers : rank_specifier\",\n//t    \"rank_specifiers : rank_specifier rank_specifiers\",\n//t    \"rank_specifier : OPEN_BRACKET CLOSE_BRACKET\",\n//t    \"rank_specifier : OPEN_BRACKET dim_separators CLOSE_BRACKET\",\n//t    \"dim_separators : COMMA\",\n//t    \"dim_separators : dim_separators COMMA\",\n//t    \"opt_array_initializer :\",\n//t    \"opt_array_initializer : array_initializer\",\n//t    \"array_initializer : OPEN_BRACE CLOSE_BRACE\",\n//t    \"array_initializer : OPEN_BRACE variable_initializer_list opt_comma CLOSE_BRACE\",\n//t    \"variable_initializer_list : variable_initializer\",\n//t    \"variable_initializer_list : variable_initializer_list COMMA variable_initializer\",\n//t    \"typeof_expression : TYPEOF open_parens_any typeof_type_expression CLOSE_PARENS\",\n//t    \"typeof_type_expression : type_and_void\",\n//t    \"typeof_type_expression : error\",\n//t    \"generic_dimension : GENERIC_DIMENSION\",\n//t    \"qualified_alias_member : IDENTIFIER DOUBLE_COLON\",\n//t    \"sizeof_expression : SIZEOF open_parens_any type CLOSE_PARENS\",\n//t    \"sizeof_expression : SIZEOF open_parens_any type error\",\n//t    \"checked_expression : CHECKED open_parens_any expression CLOSE_PARENS\",\n//t    \"checked_expression : CHECKED error\",\n//t    \"unchecked_expression : UNCHECKED open_parens_any expression CLOSE_PARENS\",\n//t    \"unchecked_expression : UNCHECKED error\",\n//t    \"pointer_member_access : primary_expression OP_PTR IDENTIFIER opt_type_argument_list\",\n//t    \"$$69 :\",\n//t    \"anonymous_method_expression : DELEGATE opt_anonymous_method_signature $$69 block\",\n//t    \"$$70 :\",\n//t    \"anonymous_method_expression : ASYNC DELEGATE opt_anonymous_method_signature $$70 block\",\n//t    \"opt_anonymous_method_signature :\",\n//t    \"opt_anonymous_method_signature : anonymous_method_signature\",\n//t    \"$$71 :\",\n//t    \"anonymous_method_signature : OPEN_PARENS $$71 opt_formal_parameter_list CLOSE_PARENS\",\n//t    \"default_value_expression : DEFAULT open_parens_any type CLOSE_PARENS\",\n//t    \"unary_expression : primary_expression\",\n//t    \"unary_expression : BANG prefixed_unary_expression\",\n//t    \"unary_expression : TILDE prefixed_unary_expression\",\n//t    \"unary_expression : OPEN_PARENS_CAST type CLOSE_PARENS prefixed_unary_expression\",\n//t    \"unary_expression : AWAIT prefixed_unary_expression\",\n//t    \"unary_expression : BANG error\",\n//t    \"unary_expression : TILDE error\",\n//t    \"unary_expression : OPEN_PARENS_CAST type CLOSE_PARENS error\",\n//t    \"unary_expression : AWAIT error\",\n//t    \"prefixed_unary_expression : unary_expression\",\n//t    \"prefixed_unary_expression : PLUS prefixed_unary_expression\",\n//t    \"prefixed_unary_expression : MINUS prefixed_unary_expression\",\n//t    \"prefixed_unary_expression : OP_INC prefixed_unary_expression\",\n//t    \"prefixed_unary_expression : OP_DEC prefixed_unary_expression\",\n//t    \"prefixed_unary_expression : STAR prefixed_unary_expression\",\n//t    \"prefixed_unary_expression : BITWISE_AND prefixed_unary_expression\",\n//t    \"prefixed_unary_expression : PLUS error\",\n//t    \"prefixed_unary_expression : MINUS error\",\n//t    \"prefixed_unary_expression : OP_INC error\",\n//t    \"prefixed_unary_expression : OP_DEC error\",\n//t    \"prefixed_unary_expression : STAR error\",\n//t    \"prefixed_unary_expression : BITWISE_AND error\",\n//t    \"multiplicative_expression : prefixed_unary_expression\",\n//t    \"multiplicative_expression : multiplicative_expression STAR prefixed_unary_expression\",\n//t    \"multiplicative_expression : multiplicative_expression DIV prefixed_unary_expression\",\n//t    \"multiplicative_expression : multiplicative_expression PERCENT prefixed_unary_expression\",\n//t    \"multiplicative_expression : multiplicative_expression STAR error\",\n//t    \"multiplicative_expression : multiplicative_expression DIV error\",\n//t    \"multiplicative_expression : multiplicative_expression PERCENT error\",\n//t    \"additive_expression : multiplicative_expression\",\n//t    \"additive_expression : additive_expression PLUS multiplicative_expression\",\n//t    \"additive_expression : additive_expression MINUS multiplicative_expression\",\n//t    \"additive_expression : additive_expression PLUS error\",\n//t    \"additive_expression : additive_expression MINUS error\",\n//t    \"additive_expression : additive_expression AS type\",\n//t    \"additive_expression : additive_expression IS is_match_expr opt_identifier\",\n//t    \"additive_expression : additive_expression AS error\",\n//t    \"additive_expression : additive_expression IS error\",\n//t    \"additive_expression : AWAIT IS type\",\n//t    \"additive_expression : AWAIT AS type\",\n//t    \"is_match_expr : match_type\",\n//t    \"is_match_expr : match_type rank_specifiers\",\n//t    \"is_match_expr : literal\",\n//t    \"is_match_expr : PLUS prefixed_unary_expression\",\n//t    \"is_match_expr : MINUS prefixed_unary_expression\",\n//t    \"match_type : primary_expression_or_type opt_nullable\",\n//t    \"match_type : primary_expression_or_type pointer_stars\",\n//t    \"match_type : builtin_type_expression\",\n//t    \"match_type : void_invalid\",\n//t    \"shift_expression : additive_expression\",\n//t    \"shift_expression : shift_expression OP_SHIFT_LEFT additive_expression\",\n//t    \"shift_expression : shift_expression OP_SHIFT_RIGHT additive_expression\",\n//t    \"shift_expression : shift_expression OP_SHIFT_LEFT error\",\n//t    \"shift_expression : shift_expression OP_SHIFT_RIGHT error\",\n//t    \"relational_expression : shift_expression\",\n//t    \"relational_expression : relational_expression OP_LT shift_expression\",\n//t    \"relational_expression : relational_expression OP_GT shift_expression\",\n//t    \"relational_expression : relational_expression OP_LE shift_expression\",\n//t    \"relational_expression : relational_expression OP_GE shift_expression\",\n//t    \"relational_expression : relational_expression OP_LT error\",\n//t    \"relational_expression : relational_expression OP_GT error\",\n//t    \"relational_expression : relational_expression OP_LE error\",\n//t    \"relational_expression : relational_expression OP_GE error\",\n//t    \"equality_expression : relational_expression\",\n//t    \"equality_expression : equality_expression OP_EQ relational_expression\",\n//t    \"equality_expression : equality_expression OP_NE relational_expression\",\n//t    \"equality_expression : equality_expression OP_EQ error\",\n//t    \"equality_expression : equality_expression OP_NE error\",\n//t    \"and_expression : equality_expression\",\n//t    \"and_expression : and_expression BITWISE_AND equality_expression\",\n//t    \"and_expression : and_expression BITWISE_AND error\",\n//t    \"exclusive_or_expression : and_expression\",\n//t    \"exclusive_or_expression : exclusive_or_expression CARRET and_expression\",\n//t    \"exclusive_or_expression : exclusive_or_expression CARRET error\",\n//t    \"inclusive_or_expression : exclusive_or_expression\",\n//t    \"inclusive_or_expression : inclusive_or_expression BITWISE_OR exclusive_or_expression\",\n//t    \"inclusive_or_expression : inclusive_or_expression BITWISE_OR error\",\n//t    \"conditional_and_expression : inclusive_or_expression\",\n//t    \"conditional_and_expression : conditional_and_expression OP_AND inclusive_or_expression\",\n//t    \"conditional_and_expression : conditional_and_expression OP_AND error\",\n//t    \"conditional_or_expression : conditional_and_expression\",\n//t    \"conditional_or_expression : conditional_or_expression OP_OR conditional_and_expression\",\n//t    \"conditional_or_expression : conditional_or_expression OP_OR error\",\n//t    \"null_coalescing_expression : conditional_or_expression\",\n//t    \"null_coalescing_expression : conditional_or_expression OP_COALESCING null_coalescing_expression\",\n//t    \"conditional_expression : null_coalescing_expression\",\n//t    \"conditional_expression : null_coalescing_expression INTERR expression COLON expression\",\n//t    \"conditional_expression : null_coalescing_expression INTERR expression error\",\n//t    \"conditional_expression : null_coalescing_expression INTERR expression COLON error\",\n//t    \"conditional_expression : null_coalescing_expression INTERR expression COLON CLOSE_BRACE\",\n//t    \"assignment_expression : prefixed_unary_expression ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_MULT_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_DIV_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_MOD_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_ADD_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_SUB_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_SHIFT_LEFT_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_SHIFT_RIGHT_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_AND_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_OR_ASSIGN expression\",\n//t    \"assignment_expression : prefixed_unary_expression OP_XOR_ASSIGN expression\",\n//t    \"lambda_parameter_list : lambda_parameter\",\n//t    \"lambda_parameter_list : lambda_parameter_list COMMA lambda_parameter\",\n//t    \"lambda_parameter : parameter_modifier parameter_type identifier_inside_body\",\n//t    \"lambda_parameter : parameter_type identifier_inside_body\",\n//t    \"lambda_parameter : IDENTIFIER\",\n//t    \"lambda_parameter : AWAIT\",\n//t    \"opt_lambda_parameter_list :\",\n//t    \"opt_lambda_parameter_list : lambda_parameter_list\",\n//t    \"$$72 :\",\n//t    \"lambda_expression_body : $$72 expression\",\n//t    \"lambda_expression_body : block\",\n//t    \"lambda_expression_body : error\",\n//t    \"expression_or_error : expression\",\n//t    \"expression_or_error : error\",\n//t    \"$$73 :\",\n//t    \"lambda_expression : IDENTIFIER ARROW $$73 lambda_expression_body\",\n//t    \"$$74 :\",\n//t    \"lambda_expression : AWAIT ARROW $$74 lambda_expression_body\",\n//t    \"$$75 :\",\n//t    \"lambda_expression : ASYNC identifier_inside_body ARROW $$75 lambda_expression_body\",\n//t    \"$$76 :\",\n//t    \"$$77 :\",\n//t    \"lambda_expression : OPEN_PARENS_LAMBDA $$76 opt_lambda_parameter_list CLOSE_PARENS ARROW $$77 lambda_expression_body\",\n//t    \"$$78 :\",\n//t    \"$$79 :\",\n//t    \"lambda_expression : ASYNC OPEN_PARENS_LAMBDA $$78 opt_lambda_parameter_list CLOSE_PARENS ARROW $$79 lambda_expression_body\",\n//t    \"expression : assignment_expression\",\n//t    \"expression : non_assignment_expression\",\n//t    \"non_assignment_expression : conditional_expression\",\n//t    \"non_assignment_expression : lambda_expression\",\n//t    \"non_assignment_expression : query_expression\",\n//t    \"non_assignment_expression : ARGLIST\",\n//t    \"undocumented_expressions : REFVALUE OPEN_PARENS non_assignment_expression COMMA type CLOSE_PARENS\",\n//t    \"undocumented_expressions : REFTYPE open_parens_any expression CLOSE_PARENS\",\n//t    \"undocumented_expressions : MAKEREF open_parens_any expression CLOSE_PARENS\",\n//t    \"constant_expression : expression\",\n//t    \"boolean_expression : expression\",\n//t    \"opt_primary_parameters :\",\n//t    \"opt_primary_parameters : primary_parameters\",\n//t    \"primary_parameters : OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS\",\n//t    \"opt_primary_parameters_with_class_base :\",\n//t    \"opt_primary_parameters_with_class_base : class_base\",\n//t    \"opt_primary_parameters_with_class_base : primary_parameters\",\n//t    \"opt_primary_parameters_with_class_base : primary_parameters class_base\",\n//t    \"$$80 :\",\n//t    \"opt_primary_parameters_with_class_base : primary_parameters class_base OPEN_PARENS $$80 opt_argument_list CLOSE_PARENS\",\n//t    \"$$81 :\",\n//t    \"$$82 :\",\n//t    \"$$83 :\",\n//t    \"$$84 :\",\n//t    \"class_declaration : opt_attributes opt_modifiers opt_partial CLASS $$81 type_declaration_name $$82 opt_primary_parameters_with_class_base opt_type_parameter_constraints_clauses $$83 OPEN_BRACE opt_class_member_declarations CLOSE_BRACE $$84 opt_semicolon\",\n//t    \"opt_partial :\",\n//t    \"opt_partial : PARTIAL\",\n//t    \"opt_modifiers :\",\n//t    \"opt_modifiers : modifiers\",\n//t    \"modifiers : modifier\",\n//t    \"modifiers : modifiers modifier\",\n//t    \"modifier : NEW\",\n//t    \"modifier : PUBLIC\",\n//t    \"modifier : PROTECTED\",\n//t    \"modifier : INTERNAL\",\n//t    \"modifier : PRIVATE\",\n//t    \"modifier : ABSTRACT\",\n//t    \"modifier : SEALED\",\n//t    \"modifier : STATIC\",\n//t    \"modifier : READONLY\",\n//t    \"modifier : VIRTUAL\",\n//t    \"modifier : OVERRIDE\",\n//t    \"modifier : EXTERN\",\n//t    \"modifier : VOLATILE\",\n//t    \"modifier : UNSAFE\",\n//t    \"modifier : ASYNC\",\n//t    \"opt_class_base :\",\n//t    \"opt_class_base : class_base\",\n//t    \"class_base : COLON type_list\",\n//t    \"class_base : COLON type_list error\",\n//t    \"opt_type_parameter_constraints_clauses :\",\n//t    \"opt_type_parameter_constraints_clauses : type_parameter_constraints_clauses\",\n//t    \"type_parameter_constraints_clauses : type_parameter_constraints_clause\",\n//t    \"type_parameter_constraints_clauses : type_parameter_constraints_clauses type_parameter_constraints_clause\",\n//t    \"type_parameter_constraints_clause : WHERE IDENTIFIER COLON type_parameter_constraints\",\n//t    \"type_parameter_constraints_clause : WHERE IDENTIFIER error\",\n//t    \"type_parameter_constraints : type_parameter_constraint\",\n//t    \"type_parameter_constraints : type_parameter_constraints COMMA type_parameter_constraint\",\n//t    \"type_parameter_constraint : type\",\n//t    \"type_parameter_constraint : NEW OPEN_PARENS CLOSE_PARENS\",\n//t    \"type_parameter_constraint : CLASS\",\n//t    \"type_parameter_constraint : STRUCT\",\n//t    \"opt_type_parameter_variance :\",\n//t    \"opt_type_parameter_variance : type_parameter_variance\",\n//t    \"type_parameter_variance : OUT\",\n//t    \"type_parameter_variance : IN\",\n//t    \"$$85 :\",\n//t    \"block : OPEN_BRACE $$85 opt_statement_list block_end\",\n//t    \"block_end : CLOSE_BRACE\",\n//t    \"block_end : COMPLETE_COMPLETION\",\n//t    \"$$86 :\",\n//t    \"block_prepared : OPEN_BRACE $$86 opt_statement_list CLOSE_BRACE\",\n//t    \"block_prepared : CLOSE_BRACE\",\n//t    \"$$87 :\",\n//t    \"block_prepared_strict : OPEN_BRACE $$87 opt_statement_list CLOSE_BRACE\",\n//t    \"opt_statement_list :\",\n//t    \"opt_statement_list : statement_list\",\n//t    \"statement_list : statement\",\n//t    \"statement_list : statement_list statement\",\n//t    \"statement : block_variable_declaration\",\n//t    \"statement : valid_declaration_statement\",\n//t    \"statement : labeled_statement\",\n//t    \"statement : IDENTIFIER error\",\n//t    \"statement : error\",\n//t    \"interactive_statement_list : interactive_statement\",\n//t    \"interactive_statement_list : interactive_statement_list interactive_statement\",\n//t    \"interactive_statement : block_variable_declaration\",\n//t    \"interactive_statement : interactive_valid_declaration_statement\",\n//t    \"interactive_statement : labeled_statement\",\n//t    \"valid_declaration_statement : block\",\n//t    \"valid_declaration_statement : empty_statement\",\n//t    \"valid_declaration_statement : expression_statement\",\n//t    \"valid_declaration_statement : selection_statement\",\n//t    \"valid_declaration_statement : iteration_statement\",\n//t    \"valid_declaration_statement : jump_statement\",\n//t    \"valid_declaration_statement : try_statement\",\n//t    \"valid_declaration_statement : checked_statement\",\n//t    \"valid_declaration_statement : unchecked_statement\",\n//t    \"valid_declaration_statement : lock_statement\",\n//t    \"valid_declaration_statement : using_statement\",\n//t    \"valid_declaration_statement : unsafe_statement\",\n//t    \"valid_declaration_statement : fixed_statement\",\n//t    \"interactive_valid_declaration_statement : block\",\n//t    \"interactive_valid_declaration_statement : empty_statement\",\n//t    \"interactive_valid_declaration_statement : interactive_expression_statement\",\n//t    \"interactive_valid_declaration_statement : selection_statement\",\n//t    \"interactive_valid_declaration_statement : iteration_statement\",\n//t    \"interactive_valid_declaration_statement : jump_statement\",\n//t    \"interactive_valid_declaration_statement : try_statement\",\n//t    \"interactive_valid_declaration_statement : checked_statement\",\n//t    \"interactive_valid_declaration_statement : unchecked_statement\",\n//t    \"interactive_valid_declaration_statement : lock_statement\",\n//t    \"interactive_valid_declaration_statement : using_statement\",\n//t    \"interactive_valid_declaration_statement : unsafe_statement\",\n//t    \"interactive_valid_declaration_statement : fixed_statement\",\n//t    \"embedded_statement : valid_declaration_statement\",\n//t    \"embedded_statement : block_variable_declaration\",\n//t    \"embedded_statement : labeled_statement\",\n//t    \"embedded_statement : error\",\n//t    \"empty_statement : SEMICOLON\",\n//t    \"$$88 :\",\n//t    \"labeled_statement : identifier_inside_body COLON $$88 statement\",\n//t    \"variable_type : variable_type_simple\",\n//t    \"variable_type : variable_type_simple rank_specifiers\",\n//t    \"variable_type_simple : primary_expression_or_type opt_nullable\",\n//t    \"variable_type_simple : primary_expression_or_type pointer_stars\",\n//t    \"variable_type_simple : builtin_type_expression\",\n//t    \"variable_type_simple : void_invalid\",\n//t    \"pointer_stars : pointer_star\",\n//t    \"pointer_stars : pointer_star pointer_stars\",\n//t    \"pointer_star : STAR\",\n//t    \"identifier_inside_body : IDENTIFIER\",\n//t    \"identifier_inside_body : AWAIT\",\n//t    \"$$89 :\",\n//t    \"block_variable_declaration : variable_type identifier_inside_body $$89 opt_local_variable_initializer opt_variable_declarators semicolon_or_handle_error_close_brace\",\n//t    \"$$90 :\",\n//t    \"block_variable_declaration : CONST variable_type identifier_inside_body $$90 const_variable_initializer opt_const_declarators SEMICOLON\",\n//t    \"semicolon_or_handle_error_close_brace : SEMICOLON\",\n//t    \"semicolon_or_handle_error_close_brace : CLOSE_BRACE\",\n//t    \"opt_local_variable_initializer :\",\n//t    \"opt_local_variable_initializer : ASSIGN block_variable_initializer\",\n//t    \"opt_local_variable_initializer : error\",\n//t    \"opt_variable_declarators :\",\n//t    \"opt_variable_declarators : variable_declarators\",\n//t    \"opt_using_or_fixed_variable_declarators :\",\n//t    \"opt_using_or_fixed_variable_declarators : variable_declarators\",\n//t    \"variable_declarators : variable_declarator\",\n//t    \"variable_declarators : variable_declarators variable_declarator\",\n//t    \"variable_declarator : COMMA identifier_inside_body\",\n//t    \"variable_declarator : COMMA identifier_inside_body ASSIGN block_variable_initializer\",\n//t    \"const_variable_initializer :\",\n//t    \"const_variable_initializer : ASSIGN constant_initializer_expr\",\n//t    \"opt_const_declarators :\",\n//t    \"opt_const_declarators : const_declarators\",\n//t    \"const_declarators : const_declarator\",\n//t    \"const_declarators : const_declarators const_declarator\",\n//t    \"const_declarator : COMMA identifier_inside_body ASSIGN constant_initializer_expr\",\n//t    \"block_variable_initializer : variable_initializer\",\n//t    \"block_variable_initializer : STACKALLOC simple_type OPEN_BRACKET_EXPR expression CLOSE_BRACKET\",\n//t    \"block_variable_initializer : STACKALLOC simple_type\",\n//t    \"expression_statement : statement_expression SEMICOLON\",\n//t    \"expression_statement : statement_expression COMPLETE_COMPLETION\",\n//t    \"expression_statement : statement_expression CLOSE_BRACE\",\n//t    \"interactive_expression_statement : interactive_statement_expression SEMICOLON\",\n//t    \"interactive_expression_statement : interactive_statement_expression COMPLETE_COMPLETION\",\n//t    \"statement_expression : expression\",\n//t    \"interactive_statement_expression : expression\",\n//t    \"interactive_statement_expression : error\",\n//t    \"selection_statement : if_statement\",\n//t    \"selection_statement : switch_statement\",\n//t    \"if_statement : IF open_parens_any boolean_expression CLOSE_PARENS embedded_statement\",\n//t    \"if_statement : IF open_parens_any boolean_expression CLOSE_PARENS embedded_statement ELSE embedded_statement\",\n//t    \"if_statement : IF open_parens_any boolean_expression error\",\n//t    \"$$91 :\",\n//t    \"switch_statement : SWITCH open_parens_any expression CLOSE_PARENS OPEN_BRACE $$91 opt_switch_sections CLOSE_BRACE\",\n//t    \"switch_statement : SWITCH open_parens_any expression error\",\n//t    \"opt_switch_sections :\",\n//t    \"opt_switch_sections : switch_sections\",\n//t    \"switch_sections : switch_section\",\n//t    \"switch_sections : switch_sections switch_section\",\n//t    \"switch_sections : error\",\n//t    \"switch_section : switch_labels statement_list\",\n//t    \"switch_labels : switch_label\",\n//t    \"switch_labels : switch_labels switch_label\",\n//t    \"switch_label : CASE constant_expression COLON\",\n//t    \"switch_label : CASE constant_expression error\",\n//t    \"switch_label : DEFAULT_COLON\",\n//t    \"iteration_statement : while_statement\",\n//t    \"iteration_statement : do_statement\",\n//t    \"iteration_statement : for_statement\",\n//t    \"iteration_statement : foreach_statement\",\n//t    \"while_statement : WHILE open_parens_any boolean_expression CLOSE_PARENS embedded_statement\",\n//t    \"while_statement : WHILE open_parens_any boolean_expression error\",\n//t    \"do_statement : DO embedded_statement WHILE open_parens_any boolean_expression CLOSE_PARENS SEMICOLON\",\n//t    \"do_statement : DO embedded_statement error\",\n//t    \"do_statement : DO embedded_statement WHILE open_parens_any boolean_expression error\",\n//t    \"$$92 :\",\n//t    \"for_statement : FOR open_parens_any $$92 for_statement_cont\",\n//t    \"$$93 :\",\n//t    \"for_statement_cont : opt_for_initializer SEMICOLON $$93 for_statement_condition\",\n//t    \"for_statement_cont : opt_for_initializer CLOSE_PARENS\",\n//t    \"$$94 :\",\n//t    \"for_statement_condition : opt_for_condition SEMICOLON $$94 for_statement_end\",\n//t    \"for_statement_condition : boolean_expression CLOSE_PARENS\",\n//t    \"for_statement_end : opt_for_iterator CLOSE_PARENS embedded_statement\",\n//t    \"for_statement_end : error\",\n//t    \"opt_for_initializer :\",\n//t    \"opt_for_initializer : for_initializer\",\n//t    \"$$95 :\",\n//t    \"for_initializer : variable_type identifier_inside_body $$95 opt_local_variable_initializer opt_variable_declarators\",\n//t    \"for_initializer : statement_expression_list\",\n//t    \"opt_for_condition :\",\n//t    \"opt_for_condition : boolean_expression\",\n//t    \"opt_for_iterator :\",\n//t    \"opt_for_iterator : for_iterator\",\n//t    \"for_iterator : statement_expression_list\",\n//t    \"statement_expression_list : statement_expression\",\n//t    \"statement_expression_list : statement_expression_list COMMA statement_expression\",\n//t    \"foreach_statement : FOREACH open_parens_any type error\",\n//t    \"foreach_statement : FOREACH open_parens_any type identifier_inside_body error\",\n//t    \"$$96 :\",\n//t    \"foreach_statement : FOREACH open_parens_any type identifier_inside_body IN expression CLOSE_PARENS $$96 embedded_statement\",\n//t    \"foreach_statement : FOREACH open_parens_any type identifier_inside_body error\",\n//t    \"foreach_statement : FOREACH open_parens_any type error\",\n//t    \"jump_statement : break_statement\",\n//t    \"jump_statement : continue_statement\",\n//t    \"jump_statement : goto_statement\",\n//t    \"jump_statement : return_statement\",\n//t    \"jump_statement : throw_statement\",\n//t    \"jump_statement : yield_statement\",\n//t    \"break_statement : BREAK SEMICOLON\",\n//t    \"continue_statement : CONTINUE SEMICOLON\",\n//t    \"continue_statement : CONTINUE error\",\n//t    \"goto_statement : GOTO identifier_inside_body SEMICOLON\",\n//t    \"goto_statement : GOTO CASE constant_expression SEMICOLON\",\n//t    \"goto_statement : GOTO DEFAULT SEMICOLON\",\n//t    \"return_statement : RETURN opt_expression SEMICOLON\",\n//t    \"return_statement : RETURN expression error\",\n//t    \"return_statement : RETURN error\",\n//t    \"throw_statement : THROW opt_expression SEMICOLON\",\n//t    \"throw_statement : THROW expression error\",\n//t    \"throw_statement : THROW error\",\n//t    \"yield_statement : identifier_inside_body RETURN opt_expression SEMICOLON\",\n//t    \"yield_statement : identifier_inside_body RETURN expression error\",\n//t    \"yield_statement : identifier_inside_body BREAK SEMICOLON\",\n//t    \"opt_expression :\",\n//t    \"opt_expression : expression\",\n//t    \"try_statement : TRY block catch_clauses\",\n//t    \"try_statement : TRY block FINALLY block\",\n//t    \"try_statement : TRY block catch_clauses FINALLY block\",\n//t    \"try_statement : TRY block error\",\n//t    \"catch_clauses : catch_clause\",\n//t    \"catch_clauses : catch_clauses catch_clause\",\n//t    \"opt_identifier :\",\n//t    \"opt_identifier : identifier_inside_body\",\n//t    \"catch_clause : CATCH opt_catch_filter block\",\n//t    \"$$97 :\",\n//t    \"catch_clause : CATCH open_parens_any type opt_identifier CLOSE_PARENS $$97 opt_catch_filter block_prepared\",\n//t    \"catch_clause : CATCH open_parens_any error\",\n//t    \"catch_clause : CATCH open_parens_any type opt_identifier CLOSE_PARENS error\",\n//t    \"opt_catch_filter :\",\n//t    \"opt_catch_filter : IF open_parens_any expression CLOSE_PARENS\",\n//t    \"checked_statement : CHECKED block\",\n//t    \"unchecked_statement : UNCHECKED block\",\n//t    \"$$98 :\",\n//t    \"unsafe_statement : UNSAFE $$98 block\",\n//t    \"lock_statement : LOCK open_parens_any expression CLOSE_PARENS embedded_statement\",\n//t    \"lock_statement : LOCK open_parens_any expression error\",\n//t    \"$$99 :\",\n//t    \"$$100 :\",\n//t    \"fixed_statement : FIXED open_parens_any variable_type identifier_inside_body $$99 using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS $$100 embedded_statement\",\n//t    \"$$101 :\",\n//t    \"$$102 :\",\n//t    \"using_statement : USING open_parens_any variable_type identifier_inside_body $$101 using_initialization CLOSE_PARENS $$102 embedded_statement\",\n//t    \"using_statement : USING open_parens_any expression CLOSE_PARENS embedded_statement\",\n//t    \"using_statement : USING open_parens_any expression error\",\n//t    \"using_initialization : using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators\",\n//t    \"using_initialization : error\",\n//t    \"using_or_fixed_variable_initializer :\",\n//t    \"using_or_fixed_variable_initializer : ASSIGN variable_initializer\",\n//t    \"query_expression : first_from_clause query_body\",\n//t    \"query_expression : nested_from_clause query_body\",\n//t    \"query_expression : first_from_clause COMPLETE_COMPLETION\",\n//t    \"query_expression : nested_from_clause COMPLETE_COMPLETION\",\n//t    \"first_from_clause : FROM_FIRST identifier_inside_body IN expression\",\n//t    \"first_from_clause : FROM_FIRST type identifier_inside_body IN expression\",\n//t    \"nested_from_clause : FROM identifier_inside_body IN expression\",\n//t    \"nested_from_clause : FROM type identifier_inside_body IN expression\",\n//t    \"$$103 :\",\n//t    \"from_clause : FROM identifier_inside_body IN $$103 expression_or_error\",\n//t    \"$$104 :\",\n//t    \"from_clause : FROM type identifier_inside_body IN $$104 expression_or_error\",\n//t    \"query_body : query_body_clauses select_or_group_clause opt_query_continuation\",\n//t    \"query_body : select_or_group_clause opt_query_continuation\",\n//t    \"query_body : query_body_clauses COMPLETE_COMPLETION\",\n//t    \"query_body : query_body_clauses error\",\n//t    \"query_body : error\",\n//t    \"$$105 :\",\n//t    \"select_or_group_clause : SELECT $$105 expression_or_error\",\n//t    \"$$106 :\",\n//t    \"$$107 :\",\n//t    \"select_or_group_clause : GROUP $$106 expression_or_error $$107 by_expression\",\n//t    \"by_expression : BY expression_or_error\",\n//t    \"by_expression : error\",\n//t    \"query_body_clauses : query_body_clause\",\n//t    \"query_body_clauses : query_body_clauses query_body_clause\",\n//t    \"query_body_clause : from_clause\",\n//t    \"query_body_clause : let_clause\",\n//t    \"query_body_clause : where_clause\",\n//t    \"query_body_clause : join_clause\",\n//t    \"query_body_clause : orderby_clause\",\n//t    \"$$108 :\",\n//t    \"let_clause : LET identifier_inside_body ASSIGN $$108 expression_or_error\",\n//t    \"$$109 :\",\n//t    \"where_clause : WHERE $$109 expression_or_error\",\n//t    \"$$110 :\",\n//t    \"$$111 :\",\n//t    \"$$112 :\",\n//t    \"join_clause : JOIN identifier_inside_body IN $$110 expression_or_error ON $$111 expression_or_error EQUALS $$112 expression_or_error opt_join_into\",\n//t    \"$$113 :\",\n//t    \"$$114 :\",\n//t    \"$$115 :\",\n//t    \"join_clause : JOIN type identifier_inside_body IN $$113 expression_or_error ON $$114 expression_or_error EQUALS $$115 expression_or_error opt_join_into\",\n//t    \"opt_join_into :\",\n//t    \"opt_join_into : INTO identifier_inside_body\",\n//t    \"$$116 :\",\n//t    \"orderby_clause : ORDERBY $$116 orderings\",\n//t    \"orderings : order_by\",\n//t    \"$$117 :\",\n//t    \"orderings : order_by COMMA $$117 orderings_then_by\",\n//t    \"orderings_then_by : then_by\",\n//t    \"$$118 :\",\n//t    \"orderings_then_by : orderings_then_by COMMA $$118 then_by\",\n//t    \"order_by : expression\",\n//t    \"order_by : expression ASCENDING\",\n//t    \"order_by : expression DESCENDING\",\n//t    \"then_by : expression\",\n//t    \"then_by : expression ASCENDING\",\n//t    \"then_by : expression DESCENDING\",\n//t    \"opt_query_continuation :\",\n//t    \"$$119 :\",\n//t    \"opt_query_continuation : INTO identifier_inside_body $$119 query_body\",\n//t    \"interactive_parsing : EVAL_STATEMENT_PARSER EOF\",\n//t    \"interactive_parsing : EVAL_USING_DECLARATIONS_UNIT_PARSER using_directives opt_COMPLETE_COMPLETION\",\n//t    \"$$120 :\",\n//t    \"interactive_parsing : EVAL_STATEMENT_PARSER $$120 interactive_statement_list opt_COMPLETE_COMPLETION\",\n//t    \"interactive_parsing : EVAL_COMPILATION_UNIT_PARSER interactive_compilation_unit\",\n//t    \"interactive_compilation_unit : opt_extern_alias_directives opt_using_directives\",\n//t    \"interactive_compilation_unit : opt_extern_alias_directives opt_using_directives namespace_or_type_declarations\",\n//t    \"opt_COMPLETE_COMPLETION :\",\n//t    \"opt_COMPLETE_COMPLETION : COMPLETE_COMPLETION\",\n//t    \"close_brace_or_complete_completion : CLOSE_BRACE\",\n//t    \"close_brace_or_complete_completion : COMPLETE_COMPLETION\",\n//t    \"documentation_parsing : DOC_SEE doc_cref\",\n//t    \"doc_cref : doc_type_declaration_name opt_doc_method_sig\",\n//t    \"doc_cref : builtin_types opt_doc_method_sig\",\n//t    \"doc_cref : VOID opt_doc_method_sig\",\n//t    \"doc_cref : builtin_types DOT IDENTIFIER opt_doc_method_sig\",\n//t    \"doc_cref : doc_type_declaration_name DOT THIS\",\n//t    \"$$121 :\",\n//t    \"doc_cref : doc_type_declaration_name DOT THIS OPEN_BRACKET $$121 opt_doc_parameters CLOSE_BRACKET\",\n//t    \"doc_cref : EXPLICIT OPERATOR type opt_doc_method_sig\",\n//t    \"doc_cref : IMPLICIT OPERATOR type opt_doc_method_sig\",\n//t    \"doc_cref : OPERATOR overloadable_operator opt_doc_method_sig\",\n//t    \"doc_type_declaration_name : type_declaration_name\",\n//t    \"doc_type_declaration_name : doc_type_declaration_name DOT type_declaration_name\",\n//t    \"opt_doc_method_sig :\",\n//t    \"$$122 :\",\n//t    \"opt_doc_method_sig : OPEN_PARENS $$122 opt_doc_parameters CLOSE_PARENS\",\n//t    \"opt_doc_parameters :\",\n//t    \"opt_doc_parameters : doc_parameters\",\n//t    \"doc_parameters : doc_parameter\",\n//t    \"doc_parameters : doc_parameters COMMA doc_parameter\",\n//t    \"doc_parameter : opt_parameter_modifier parameter_type\",\n//t  };\n//t public static string getRule (int index) {\n//t    return yyRule [index];\n//t }\n//t}\n  protected static readonly string [] yyNames = {    \n    \"end-of-file\",null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,null,null,null,null,null,null,null,\n    null,null,null,null,null,null,null,\"EOF\",\"NONE\",\"ERROR\",\n    \"FIRST_KEYWORD\",\"ABSTRACT\",\"AS\",\"ADD\",\"BASE\",\"BOOL\",\"BREAK\",\"BYTE\",\n    \"CASE\",\"CATCH\",\"CHAR\",\"CHECKED\",\"CLASS\",\"CONST\",\"CONTINUE\",\"DECIMAL\",\n    \"DEFAULT\",\"DELEGATE\",\"DO\",\"DOUBLE\",\"ELSE\",\"ENUM\",\"EVENT\",\"EXPLICIT\",\n    \"EXTERN\",\"FALSE\",\"FINALLY\",\"FIXED\",\"FLOAT\",\"FOR\",\"FOREACH\",\"GOTO\",\n    \"IF\",\"IMPLICIT\",\"IN\",\"INT\",\"INTERFACE\",\"INTERNAL\",\"IS\",\"LOCK\",\"LONG\",\n    \"NAMESPACE\",\"NEW\",\"NULL\",\"OBJECT\",\"OPERATOR\",\"OUT\",\"OVERRIDE\",\n    \"PARAMS\",\"PRIVATE\",\"PROTECTED\",\"PUBLIC\",\"READONLY\",\"REF\",\"RETURN\",\n    \"REMOVE\",\"SBYTE\",\"SEALED\",\"SHORT\",\"SIZEOF\",\"STACKALLOC\",\"STATIC\",\n    \"STRING\",\"STRUCT\",\"SWITCH\",\"THIS\",\"THROW\",\"TRUE\",\"TRY\",\"TYPEOF\",\n    \"UINT\",\"ULONG\",\"UNCHECKED\",\"UNSAFE\",\"USHORT\",\"USING\",\"VIRTUAL\",\"VOID\",\n    \"VOLATILE\",\"WHERE\",\"WHILE\",\"ARGLIST\",\"PARTIAL\",\"ARROW\",\"FROM\",\n    \"FROM_FIRST\",\"JOIN\",\"ON\",\"EQUALS\",\"SELECT\",\"GROUP\",\"BY\",\"LET\",\n    \"ORDERBY\",\"ASCENDING\",\"DESCENDING\",\"INTO\",\"INTERR_NULLABLE\",\n    \"EXTERN_ALIAS\",\"REFVALUE\",\"REFTYPE\",\"MAKEREF\",\"ASYNC\",\"AWAIT\",\n    \"INTERR_OPERATOR\",\"GET\",\"SET\",\"LAST_KEYWORD\",\"OPEN_BRACE\",\n    \"CLOSE_BRACE\",\"OPEN_BRACKET\",\"CLOSE_BRACKET\",\"OPEN_PARENS\",\n    \"CLOSE_PARENS\",\"DOT\",\"COMMA\",\"COLON\",\"SEMICOLON\",\"TILDE\",\"PLUS\",\n    \"MINUS\",\"BANG\",\"ASSIGN\",\"OP_LT\",\"OP_GT\",\"BITWISE_AND\",\"BITWISE_OR\",\n    \"STAR\",\"PERCENT\",\"DIV\",\"CARRET\",\"INTERR\",\"DOUBLE_COLON\",\"OP_INC\",\n    \"OP_DEC\",\"OP_SHIFT_LEFT\",\"OP_SHIFT_RIGHT\",\"OP_LE\",\"OP_GE\",\"OP_EQ\",\n    \"OP_NE\",\"OP_AND\",\"OP_OR\",\"OP_MULT_ASSIGN\",\"OP_DIV_ASSIGN\",\n    \"OP_MOD_ASSIGN\",\"OP_ADD_ASSIGN\",\"OP_SUB_ASSIGN\",\n    \"OP_SHIFT_LEFT_ASSIGN\",\"OP_SHIFT_RIGHT_ASSIGN\",\"OP_AND_ASSIGN\",\n    \"OP_XOR_ASSIGN\",\"OP_OR_ASSIGN\",\"OP_PTR\",\"OP_COALESCING\",\n    \"OP_GENERICS_LT\",\"OP_GENERICS_LT_DECL\",\"OP_GENERICS_GT\",\"LITERAL\",\n    \"IDENTIFIER\",\"OPEN_PARENS_LAMBDA\",\"OPEN_PARENS_CAST\",\n    \"GENERIC_DIMENSION\",\"DEFAULT_COLON\",\"OPEN_BRACKET_EXPR\",\n    \"EVAL_STATEMENT_PARSER\",\"EVAL_COMPILATION_UNIT_PARSER\",\n    \"EVAL_USING_DECLARATIONS_UNIT_PARSER\",\"DOC_SEE\",\"GENERATE_COMPLETION\",\n    \"COMPLETE_COMPLETION\",\"UMINUS\",\n  };\n\n  /** index-checked interface to yyNames[].\n      @param token single character or %token value.\n      @return token name or [illegal] or [unknown].\n    */\n//t  public static string yyname (int token) {\n//t    if ((token < 0) || (token > yyNames.Length)) return \"[illegal]\";\n//t    string name;\n//t    if ((name = yyNames[token]) != null) return name;\n//t    return \"[unknown]\";\n//t  }\n\n#pragma warning disable 414\n  int yyExpectingState;\n#pragma warning restore 414\n  /** computes list of expected tokens on error by tracing the tables.\n      @param state for which to compute the list.\n      @return list of token names.\n    */\n  protected int [] yyExpectingTokens (int state){\n    int token, n, len = 0;\n    bool[] ok = new bool[yyNames.Length];\n    if ((n = yySindex[state]) != 0)\n      for (token = n < 0 ? -n : 0;\n           (token < yyNames.Length) && (n+token < yyTable.Length); ++ token)\n        if (yyCheck[n+token] == token && !ok[token] && yyNames[token] != null) {\n          ++ len;\n          ok[token] = true;\n        }\n    if ((n = yyRindex[state]) != 0)\n      for (token = n < 0 ? -n : 0;\n           (token < yyNames.Length) && (n+token < yyTable.Length); ++ token)\n        if (yyCheck[n+token] == token && !ok[token] && yyNames[token] != null) {\n          ++ len;\n          ok[token] = true;\n        }\n    int [] result = new int [len];\n    for (n = token = 0; n < len;  ++ token)\n      if (ok[token]) result[n++] = token;\n    return result;\n  }\n  protected string[] yyExpecting (int state) {\n    int [] tokens = yyExpectingTokens (state);\n    string [] result = new string[tokens.Length];\n    for (int n = 0; n < tokens.Length;  n++)\n      result[n++] = yyNames[tokens [n]];\n    return result;\n  }\n\n  /** the generated parser, with debugging messages.\n      Maintains a state and a value stack, currently with fixed maximum size.\n      @param yyLex scanner.\n      @param yydebug debug message writer implementing yyDebug, or null.\n      @return result of the last reduction, if any.\n      @throws yyException on irrecoverable parse error.\n    */\n  internal Object yyparse (yyParser.yyInput yyLex, Object yyd)\n\t\t\t\t {\n//t    this.debug = (yydebug.yyDebug)yyd;\n    return yyparse(yyLex);\n  }\n\n  /** initial size and increment of the state/value stack [default 256].\n      This is not final so that it can be overwritten outside of invocations\n      of yyparse().\n    */\n  protected int yyMax;\n\n  /** executed at the beginning of a reduce action.\n      Used as $$ = yyDefault($1), prior to the user-specified action, if any.\n      Can be overwritten to provide deep copy, etc.\n      @param first value for $1, or null.\n      @return first.\n    */\n  protected Object yyDefault (Object first) {\n    return first;\n  }\n\n\tstatic int[] global_yyStates;\n\tstatic object[] global_yyVals;\n#pragma warning disable 649\n\tprotected bool use_global_stacks;\n#pragma warning restore 649\n\tobject[] yyVals;\t\t\t\t\t// value stack\n\tobject yyVal;\t\t\t\t\t\t// value stack ptr\n\tint yyToken;\t\t\t\t\t\t// current input\n\tint yyTop;\n\n  /** the generated parser.\n      Maintains a state and a value stack, currently with fixed maximum size.\n      @param yyLex scanner.\n      @return result of the last reduction, if any.\n      @throws yyException on irrecoverable parse error.\n    */\n  internal Object yyparse (yyParser.yyInput yyLex)\n  {\n    if (yyMax <= 0) yyMax = 256;\t\t// initial size\n    int yyState = 0;                   // state stack ptr\n    int [] yyStates;               \t// state stack \n    yyVal = null;\n    yyToken = -1;\n    int yyErrorFlag = 0;\t\t\t\t// #tks to shift\n\tif (use_global_stacks && global_yyStates != null) {\n\t\tyyVals = global_yyVals;\n\t\tyyStates = global_yyStates;\n   } else {\n\t\tyyVals = new object [yyMax];\n\t\tyyStates = new int [yyMax];\n\t\tif (use_global_stacks) {\n\t\t\tglobal_yyVals = yyVals;\n\t\t\tglobal_yyStates = yyStates;\n\t\t}\n\t}\n\n    /*yyLoop:*/ for (yyTop = 0;; ++ yyTop) {\n      if (yyTop >= yyStates.Length) {\t\t\t// dynamically increase\n        global::System.Array.Resize (ref yyStates, yyStates.Length+yyMax);\n        global::System.Array.Resize (ref yyVals, yyVals.Length+yyMax);\n      }\n      yyStates[yyTop] = yyState;\n      yyVals[yyTop] = yyVal;\n//t      if (debug != null) debug.push(yyState, yyVal);\n\n      /*yyDiscarded:*/ while (true) {\t// discarding a token does not change stack\n        int yyN;\n        if ((yyN = yyDefRed[yyState]) == 0) {\t// else [default] reduce (yyN)\n          if (yyToken < 0) {\n            yyToken = yyLex.advance() ? yyLex.token() : 0;\n//t            if (debug != null)\n//t              debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());\n          }\n          if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)\n              && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {\n//t            if (debug != null)\n//t              debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);\n            yyState = yyTable[yyN];\t\t// shift to yyN\n            yyVal = yyLex.value();\n            yyToken = -1;\n            if (yyErrorFlag > 0) -- yyErrorFlag;\n            goto continue_yyLoop;\n          }\n          if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0\n              && yyN < yyTable.Length && yyCheck[yyN] == yyToken)\n            yyN = yyTable[yyN];\t\t\t// reduce (yyN)\n          else\n            switch (yyErrorFlag) {\n  \n            case 0:\n              yyExpectingState = yyState;\n              // yyerror(String.Format (\"syntax error, got token `{0}'\", yyname (yyToken)), yyExpecting(yyState));\n//t              if (debug != null) debug.error(\"syntax error\");\n              if (yyToken == 0 /*eof*/ || yyToken == eof_token) throw new yyParser.yyUnexpectedEof ();\n              goto case 1;\n            case 1: case 2:\n              yyErrorFlag = 3;\n              do {\n                if ((yyN = yySindex[yyStates[yyTop]]) != 0\n                    && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length\n                    && yyCheck[yyN] == Token.yyErrorCode) {\n//t                  if (debug != null)\n//t                    debug.shift(yyStates[yyTop], yyTable[yyN], 3);\n                  yyState = yyTable[yyN];\n                  yyVal = yyLex.value();\n                  goto continue_yyLoop;\n                }\n//t                if (debug != null) debug.pop(yyStates[yyTop]);\n              } while (-- yyTop >= 0);\n//t              if (debug != null) debug.reject();\n              throw new yyParser.yyException(\"irrecoverable syntax error\");\n  \n            case 3:\n              if (yyToken == 0) {\n//t                if (debug != null) debug.reject();\n                throw new yyParser.yyException(\"irrecoverable syntax error at end-of-file\");\n              }\n//t              if (debug != null)\n//t                debug.discard(yyState, yyToken, yyname(yyToken),\n//t  \t\t\t\t\t\t\tyyLex.value());\n              yyToken = -1;\n              goto continue_yyDiscarded;\t\t// leave stack alone\n            }\n        }\n        int yyV = yyTop + 1-yyLen[yyN];\n//t        if (debug != null)\n//t          debug.reduce(yyState, yyStates[yyV-1], yyN, YYRules.getRule (yyN), yyLen[yyN]);\n        yyVal = yyV > yyTop ? null : yyVals[yyV]; // yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);\n        switch (yyN) {\ncase 1:\n#line 389 \"cs-parser.jay\"\n  {\n\t\tLexer.check_incorrect_doc_comment ();\n\t  }\n  break;\ncase 2:\n#line 390 \"cs-parser.jay\"\n  { Lexer.CompleteOnEOF = false; }\n  break;\ncase 6:\n  case_6();\n  break;\ncase 7:\n#line 409 \"cs-parser.jay\"\n  {\n\t\tmodule.AddAttributes ((Attributes) yyVals[0+yyTop], current_namespace);\n\t  }\n  break;\ncase 8:\n  case_8();\n  break;\ncase 13:\n  case_13();\n  break;\ncase 14:\n#line 454 \"cs-parser.jay\"\n  {\n\t\tError_SyntaxError (yyToken);\n\t  }\n  break;\ncase 17:\n  case_17();\n  break;\ncase 18:\n  case_18();\n  break;\ncase 19:\n  case_19();\n  break;\ncase 20:\n  case_20();\n  break;\ncase 21:\n  case_21();\n  break;\ncase 22:\n  case_22();\n  break;\ncase 23:\n  case_23();\n  break;\ncase 24:\n  case_24();\n  break;\ncase 27:\n  case_27();\n  break;\ncase 28:\n  case_28();\n  break;\ncase 29:\n  case_29();\n  break;\ncase 30:\n  case_30();\n  break;\ncase 43:\n  case_43();\n  break;\ncase 44:\n#line 638 \"cs-parser.jay\"\n  {\n\t\tcurrent_namespace.DeclarationFound = true;\n\t  }\n  break;\ncase 45:\n  case_45();\n  break;\ncase 53:\n  case_53();\n  break;\ncase 54:\n  case_54();\n  break;\ncase 55:\n  case_55();\n  break;\ncase 56:\n  case_56();\n  break;\ncase 57:\n  case_57();\n  break;\ncase 58:\n  case_58();\n  break;\ncase 59:\n  case_59();\n  break;\ncase 60:\n  case_60();\n  break;\ncase 61:\n  case_61();\n  break;\ncase 62:\n  case_62();\n  break;\ncase 63:\n#line 763 \"cs-parser.jay\"\n  { yyVal = \"event\"; PushLocation (GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 64:\n#line 764 \"cs-parser.jay\"\n  { yyVal = \"return\"; PushLocation (GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 65:\n#line 771 \"cs-parser.jay\"\n  {\n\t\tyyVal = new List<Attribute> (4) { (Attribute) yyVals[0+yyTop] };\n\t  }\n  break;\ncase 66:\n  case_66();\n  break;\ncase 67:\n#line 788 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 68:\n  case_68();\n  break;\ncase 70:\n#line 816 \"cs-parser.jay\"\n  { yyVal = null; HadAttributeParens = false;  }\n  break;\ncase 71:\n  case_71();\n  break;\ncase 72:\n#line 828 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 73:\n  case_73();\n  break;\ncase 74:\n  case_74();\n  break;\ncase 75:\n  case_75();\n  break;\ncase 76:\n  case_76();\n  break;\ncase 77:\n#line 872 \"cs-parser.jay\"\n  {\n\t  \tyyVal = new Argument ((Expression) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 79:\n  case_79();\n  break;\ncase 80:\n#line 885 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 81:\n  case_81();\n  break;\ncase 82:\n  case_82();\n  break;\ncase 83:\n#line 911 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 84:\n#line 915 \"cs-parser.jay\"\n  { \n\t\tyyVal = Argument.AType.Ref;\n\t  }\n  break;\ncase 85:\n#line 919 \"cs-parser.jay\"\n  { \n\t\tyyVal = Argument.AType.Out;\n\t  }\n  break;\ncase 88:\n  case_88();\n  break;\ncase 89:\n  case_89();\n  break;\ncase 103:\n  case_103();\n  break;\ncase 104:\n  case_104();\n  break;\ncase 105:\n  case_105();\n  break;\ncase 106:\n#line 996 \"cs-parser.jay\"\n  {\n\t  }\n  break;\ncase 107:\n  case_107();\n  break;\ncase 108:\n  case_108();\n  break;\ncase 109:\n  case_109();\n  break;\ncase 110:\n  case_110();\n  break;\ncase 111:\n  case_111();\n  break;\ncase 112:\n#line 1046 \"cs-parser.jay\"\n  {\n\t\tError_SyntaxError (yyToken);\n\t  }\n  break;\ncase 113:\n  case_113();\n  break;\ncase 114:\n  case_114();\n  break;\ncase 115:\n  case_115();\n  break;\ncase 118:\n#line 1095 \"cs-parser.jay\"\n  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 119:\n#line 1099 \"cs-parser.jay\"\n  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 120:\n  case_120();\n  break;\ncase 121:\n#line 1115 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 122:\n  case_122();\n  break;\ncase 123:\n  case_123();\n  break;\ncase 126:\n  case_126();\n  break;\ncase 127:\n  case_127();\n  break;\ncase 128:\n  case_128();\n  break;\ncase 129:\n  case_129();\n  break;\ncase 130:\n#line 1194 \"cs-parser.jay\"\n  {\n\t\treport.Error (1641, GetLocation (yyVals[-1+yyTop]), \"A fixed size buffer field must have the array size specifier after the field name\");\n\t  }\n  break;\ncase 132:\n  case_132();\n  break;\ncase 133:\n  case_133();\n  break;\ncase 136:\n#line 1224 \"cs-parser.jay\"\n  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 137:\n#line 1228 \"cs-parser.jay\"\n  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 138:\n  case_138();\n  break;\ncase 139:\n#line 1241 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 140:\n  case_140();\n  break;\ncase 143:\n#line 1260 \"cs-parser.jay\"\n  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 144:\n#line 1264 \"cs-parser.jay\"\n  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 145:\n  case_145();\n  break;\ncase 146:\n#line 1280 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 147:\n  case_147();\n  break;\ncase 148:\n  case_148();\n  break;\ncase 151:\n  case_151();\n  break;\ncase 152:\n  case_152();\n  break;\ncase 153:\n  case_153();\n  break;\ncase 154:\n#line 1348 \"cs-parser.jay\"\n  {\n\t\tvalid_param_mod = ParameterModifierType.All;\n\t  }\n  break;\ncase 155:\n  case_155();\n  break;\ncase 156:\n  case_156();\n  break;\ncase 157:\n#line 1387 \"cs-parser.jay\"\n  {\n\t\tlexer.parsing_generic_declaration = true;\n\t  }\n  break;\ncase 158:\n  case_158();\n  break;\ncase 159:\n#line 1397 \"cs-parser.jay\"\n  {\n\t\tlexer.ConstraintsParsing = true;\n\t  }\n  break;\ncase 160:\n  case_160();\n  break;\ncase 161:\n  case_161();\n  break;\ncase 162:\n  case_162();\n  break;\ncase 166:\n#line 1475 \"cs-parser.jay\"\n  { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; }\n  break;\ncase 167:\n  case_167();\n  break;\ncase 168:\n  case_168();\n  break;\ncase 169:\n#line 1499 \"cs-parser.jay\"\n  { yyVal = ParametersCompiled.EmptyReadOnlyParameters; }\n  break;\ncase 171:\n  case_171();\n  break;\ncase 172:\n  case_172();\n  break;\ncase 173:\n  case_173();\n  break;\ncase 174:\n  case_174();\n  break;\ncase 175:\n  case_175();\n  break;\ncase 176:\n  case_176();\n  break;\ncase 177:\n  case_177();\n  break;\ncase 178:\n#line 1571 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } );\n\t  }\n  break;\ncase 179:\n#line 1575 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true);\n\t  }\n  break;\ncase 180:\n  case_180();\n  break;\ncase 181:\n  case_181();\n  break;\ncase 182:\n  case_182();\n  break;\ncase 183:\n  case_183();\n  break;\ncase 184:\n  case_184();\n  break;\ncase 185:\n  case_185();\n  break;\ncase 186:\n  case_186();\n  break;\ncase 187:\n#line 1656 \"cs-parser.jay\"\n  {\n\t  \t++lexer.parsing_block;\n\t  }\n  break;\ncase 188:\n  case_188();\n  break;\ncase 189:\n#line 1697 \"cs-parser.jay\"\n  { yyVal = Parameter.Modifier.NONE; }\n  break;\ncase 191:\n#line 1705 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 192:\n  case_192();\n  break;\ncase 193:\n  case_193();\n  break;\ncase 194:\n  case_194();\n  break;\ncase 195:\n  case_195();\n  break;\ncase 196:\n  case_196();\n  break;\ncase 197:\n  case_197();\n  break;\ncase 198:\n  case_198();\n  break;\ncase 199:\n  case_199();\n  break;\ncase 200:\n  case_200();\n  break;\ncase 201:\n#line 1799 \"cs-parser.jay\"\n  {\n\t\tError_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS);\n\t  }\n  break;\ncase 202:\n  case_202();\n  break;\ncase 203:\n  case_203();\n  break;\ncase 204:\n  case_204();\n  break;\ncase 205:\n  case_205();\n  break;\ncase 206:\n  case_206();\n  break;\ncase 207:\n#line 1849 \"cs-parser.jay\"\n  {\n\t\tcurrent_property = null;\n\t  }\n  break;\ncase 208:\n  case_208();\n  break;\ncase 209:\n  case_209();\n  break;\ncase 211:\n  case_211();\n  break;\ncase 212:\n  case_212();\n  break;\ncase 215:\n#line 1911 \"cs-parser.jay\"\n  {\n\t  \tvalid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue;\n\t  }\n  break;\ncase 216:\n  case_216();\n  break;\ncase 217:\n  case_217();\n  break;\ncase 218:\n#line 1957 \"cs-parser.jay\"\n  {\n\t\tlbag.AppendToMember (current_property, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 219:\n  case_219();\n  break;\ncase 224:\n  case_224();\n  break;\ncase 225:\n  case_225();\n  break;\ncase 226:\n  case_226();\n  break;\ncase 227:\n  case_227();\n  break;\ncase 228:\n  case_228();\n  break;\ncase 230:\n  case_230();\n  break;\ncase 231:\n  case_231();\n  break;\ncase 232:\n#line 2098 \"cs-parser.jay\"\n  {\n\t  }\n  break;\ncase 233:\n  case_233();\n  break;\ncase 234:\n  case_234();\n  break;\ncase 235:\n  case_235();\n  break;\ncase 236:\n  case_236();\n  break;\ncase 237:\n#line 2138 \"cs-parser.jay\"\n  {\n\t\tError_SyntaxError (yyToken);\t  \n\t  }\n  break;\ncase 240:\n  case_240();\n  break;\ncase 241:\n  case_241();\n  break;\ncase 242:\n#line 2163 \"cs-parser.jay\"\n  {\n\t\treport.Error (525, GetLocation (yyVals[0+yyTop]), \"Interfaces cannot contain fields or constants\");\n\t  }\n  break;\ncase 243:\n#line 2167 \"cs-parser.jay\"\n  {\n\t\treport.Error (525, GetLocation (yyVals[0+yyTop]), \"Interfaces cannot contain fields or constants\");\n\t  }\n  break;\ncase 248:\n#line 2175 \"cs-parser.jay\"\n  {\n\t  \treport.Error (567, GetLocation (yyVals[0+yyTop]), \"Interfaces cannot contain operators\");\n\t  }\n  break;\ncase 249:\n#line 2179 \"cs-parser.jay\"\n  {\n\t  \treport.Error (526, GetLocation (yyVals[0+yyTop]), \"Interfaces cannot contain contructors\");\n\t  }\n  break;\ncase 250:\n#line 2183 \"cs-parser.jay\"\n  {\n\t  \treport.Error (524, GetLocation (yyVals[0+yyTop]), \"Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations\");\n\t  }\n  break;\ncase 251:\n#line 2189 \"cs-parser.jay\"\n  {\n\t  }\n  break;\ncase 252:\n  case_252();\n  break;\ncase 254:\n  case_254();\n  break;\ncase 255:\n#line 2233 \"cs-parser.jay\"\n  {\n\t\tvalid_param_mod = ParameterModifierType.DefaultValue;\n\t  }\n  break;\ncase 256:\n  case_256();\n  break;\ncase 258:\n#line 2279 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.LogicalNot; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 259:\n#line 2280 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.OnesComplement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 260:\n#line 2281 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Increment; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 261:\n#line 2282 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Decrement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 262:\n#line 2283 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.True; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 263:\n#line 2284 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.False; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 264:\n#line 2286 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Addition; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 265:\n#line 2287 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Subtraction; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 266:\n#line 2289 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Multiply; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 267:\n#line 2290 \"cs-parser.jay\"\n  {  yyVal = Operator.OpType.Division; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 268:\n#line 2291 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Modulus; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 269:\n#line 2292 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.BitwiseAnd; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 270:\n#line 2293 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.BitwiseOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 271:\n#line 2294 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.ExclusiveOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 272:\n#line 2295 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.LeftShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 273:\n#line 2296 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.RightShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 274:\n#line 2297 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Equality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 275:\n#line 2298 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.Inequality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 276:\n#line 2299 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.GreaterThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 277:\n#line 2300 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.LessThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 278:\n#line 2301 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.GreaterThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 279:\n#line 2302 \"cs-parser.jay\"\n  { yyVal = Operator.OpType.LessThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); }\n  break;\ncase 280:\n#line 2309 \"cs-parser.jay\"\n  {\n\t\tvalid_param_mod = ParameterModifierType.DefaultValue;\n\t  }\n  break;\ncase 281:\n  case_281();\n  break;\ncase 282:\n#line 2332 \"cs-parser.jay\"\n  {\n\t\tvalid_param_mod = ParameterModifierType.DefaultValue;\n\t  }\n  break;\ncase 283:\n  case_283();\n  break;\ncase 284:\n  case_284();\n  break;\ncase 285:\n  case_285();\n  break;\ncase 286:\n  case_286();\n  break;\ncase 287:\n  case_287();\n  break;\ncase 288:\n  case_288();\n  break;\ncase 289:\n  case_289();\n  break;\ncase 291:\n#line 2442 \"cs-parser.jay\"\n  { current_block = null; yyVal = null; }\n  break;\ncase 294:\n#line 2454 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 295:\n  case_295();\n  break;\ncase 296:\n#line 2464 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 297:\n  case_297();\n  break;\ncase 298:\n  case_298();\n  break;\ncase 299:\n  case_299();\n  break;\ncase 300:\n  case_300();\n  break;\ncase 301:\n  case_301();\n  break;\ncase 302:\n  case_302();\n  break;\ncase 303:\n  case_303();\n  break;\ncase 304:\n  case_304();\n  break;\ncase 305:\n  case_305();\n  break;\ncase 306:\n  case_306();\n  break;\ncase 307:\n  case_307();\n  break;\ncase 309:\n#line 2591 \"cs-parser.jay\"\n  {\n\t  \t++lexer.parsing_block;\n\t  }\n  break;\ncase 310:\n  case_310();\n  break;\ncase 313:\n#line 2609 \"cs-parser.jay\"\n  {\n\t\tcurrent_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 314:\n#line 2613 \"cs-parser.jay\"\n  {\n\t\tcurrent_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 315:\n  case_315();\n  break;\ncase 316:\n#line 2626 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_block;\n\t  }\n  break;\ncase 317:\n  case_317();\n  break;\ncase 318:\n  case_318();\n  break;\ncase 319:\n#line 2651 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 322:\n  case_322();\n  break;\ncase 323:\n  case_323();\n  break;\ncase 324:\n  case_324();\n  break;\ncase 325:\n  case_325();\n  break;\ncase 326:\n  case_326();\n  break;\ncase 327:\n  case_327();\n  break;\ncase 328:\n  case_328();\n  break;\ncase 329:\n  case_329();\n  break;\ncase 331:\n  case_331();\n  break;\ncase 332:\n  case_332();\n  break;\ncase 333:\n  case_333();\n  break;\ncase 334:\n  case_334();\n  break;\ncase 335:\n  case_335();\n  break;\ncase 336:\n  case_336();\n  break;\ncase 338:\n  case_338();\n  break;\ncase 339:\n  case_339();\n  break;\ncase 342:\n#line 2839 \"cs-parser.jay\"\n  {\n\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 344:\n  case_344();\n  break;\ncase 345:\n  case_345();\n  break;\ncase 346:\n  case_346();\n  break;\ncase 347:\n  case_347();\n  break;\ncase 348:\n  case_348();\n  break;\ncase 350:\n#line 2913 \"cs-parser.jay\"\n  {\n\t\tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue;\n\t  }\n  break;\ncase 351:\n  case_351();\n  break;\ncase 352:\n#line 2932 \"cs-parser.jay\"\n  {\n\t\tlexer.ConstraintsParsing = false;\n\t  }\n  break;\ncase 353:\n  case_353();\n  break;\ncase 355:\n  case_355();\n  break;\ncase 357:\n  case_357();\n  break;\ncase 358:\n  case_358();\n  break;\ncase 360:\n  case_360();\n  break;\ncase 361:\n  case_361();\n  break;\ncase 362:\n  case_362();\n  break;\ncase 363:\n  case_363();\n  break;\ncase 365:\n  case_365();\n  break;\ncase 366:\n  case_366();\n  break;\ncase 367:\n  case_367();\n  break;\ncase 368:\n  case_368();\n  break;\ncase 369:\n#line 3062 \"cs-parser.jay\"\n  {\n\t\tlexer.parsing_generic_declaration = true;\n\t  }\n  break;\ncase 370:\n  case_370();\n  break;\ncase 371:\n  case_371();\n  break;\ncase 373:\n  case_373();\n  break;\ncase 374:\n  case_374();\n  break;\ncase 375:\n  case_375();\n  break;\ncase 376:\n  case_376();\n  break;\ncase 377:\n  case_377();\n  break;\ncase 378:\n  case_378();\n  break;\ncase 380:\n  case_380();\n  break;\ncase 381:\n  case_381();\n  break;\ncase 382:\n  case_382();\n  break;\ncase 383:\n  case_383();\n  break;\ncase 384:\n  case_384();\n  break;\ncase 386:\n#line 3187 \"cs-parser.jay\"\n  {\n\t\tyyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 387:\n#line 3194 \"cs-parser.jay\"\n  {\n\t\tlexer.parsing_generic_declaration = true;\n\t  }\n  break;\ncase 393:\n  case_393();\n  break;\ncase 395:\n#line 3224 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 396:\n  case_396();\n  break;\ncase 397:\n#line 3243 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 399:\n  case_399();\n  break;\ncase 400:\n  case_400();\n  break;\ncase 401:\n#line 3264 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 402:\n#line 3268 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 403:\n  case_403();\n  break;\ncase 404:\n  case_404();\n  break;\ncase 405:\n  case_405();\n  break;\ncase 406:\n#line 3302 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 407:\n#line 3303 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.String, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 408:\n#line 3304 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 409:\n#line 3305 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 410:\n#line 3306 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 411:\n#line 3307 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Double, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 413:\n#line 3312 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.SByte, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 414:\n#line 3313 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Byte, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 415:\n#line 3314 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Short, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 416:\n#line 3315 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.UShort, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 417:\n#line 3316 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Int, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 418:\n#line 3317 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.UInt, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 419:\n#line 3318 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Long, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 420:\n#line 3319 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.ULong, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 421:\n#line 3320 \"cs-parser.jay\"\n  { yyVal = new TypeExpression (compiler.BuiltinTypes.Char, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 443:\n  case_443();\n  break;\ncase 447:\n#line 3363 \"cs-parser.jay\"\n  { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 448:\n#line 3367 \"cs-parser.jay\"\n  { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 449:\n#line 3368 \"cs-parser.jay\"\n  { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 454:\n  case_454();\n  break;\ncase 455:\n#line 3401 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n  break;\ncase 456:\n  case_456();\n  break;\ncase 457:\n  case_457();\n  break;\ncase 458:\n  case_458();\n  break;\ncase 459:\n  case_459();\n  break;\ncase 460:\n  case_460();\n  break;\ncase 461:\n  case_461();\n  break;\ncase 462:\n  case_462();\n  break;\ncase 463:\n  case_463();\n  break;\ncase 464:\n#line 3465 \"cs-parser.jay\"\n  {\n\t\tyyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 465:\n  case_465();\n  break;\ncase 466:\n#line 3473 \"cs-parser.jay\"\n  {\n\t\tyyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location);\n\t  }\n  break;\ncase 467:\n  case_467();\n  break;\ncase 468:\n  case_468();\n  break;\ncase 469:\n  case_469();\n  break;\ncase 470:\n  case_470();\n  break;\ncase 471:\n#line 3503 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 473:\n  case_473();\n  break;\ncase 474:\n  case_474();\n  break;\ncase 475:\n#line 3525 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 476:\n#line 3529 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t}\n  break;\ncase 477:\n  case_477();\n  break;\ncase 478:\n  case_478();\n  break;\ncase 479:\n  case_479();\n  break;\ncase 480:\n  case_480();\n  break;\ncase 481:\n  case_481();\n  break;\ncase 482:\n#line 3568 \"cs-parser.jay\"\n  {\n\t\tyyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 483:\n  case_483();\n  break;\ncase 484:\n  case_484();\n  break;\ncase 485:\n  case_485();\n  break;\ncase 486:\n  case_486();\n  break;\ncase 489:\n#line 3608 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 491:\n  case_491();\n  break;\ncase 492:\n  case_492();\n  break;\ncase 493:\n  case_493();\n  break;\ncase 494:\n  case_494();\n  break;\ncase 495:\n  case_495();\n  break;\ncase 496:\n#line 3662 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Argument ((Expression) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 500:\n  case_500();\n  break;\ncase 501:\n  case_501();\n  break;\ncase 502:\n  case_502();\n  break;\ncase 503:\n  case_503();\n  break;\ncase 505:\n  case_505();\n  break;\ncase 506:\n  case_506();\n  break;\ncase 507:\n  case_507();\n  break;\ncase 508:\n  case_508();\n  break;\ncase 509:\n  case_509();\n  break;\ncase 510:\n  case_510();\n  break;\ncase 511:\n  case_511();\n  break;\ncase 512:\n  case_512();\n  break;\ncase 513:\n#line 3766 \"cs-parser.jay\"\n  {\n\t  \tyyVal = new Argument ((Expression) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 515:\n#line 3774 \"cs-parser.jay\"\n  {\n\t\tyyVal = new This (GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 516:\n  case_516();\n  break;\ncase 517:\n  case_517();\n  break;\ncase 518:\n#line 3794 \"cs-parser.jay\"\n  {\n\t\tyyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 519:\n#line 3801 \"cs-parser.jay\"\n  {\n\t\tyyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 520:\n  case_520();\n  break;\ncase 521:\n  case_521();\n  break;\ncase 522:\n  case_522();\n  break;\ncase 523:\n  case_523();\n  break;\ncase 524:\n  case_524();\n  break;\ncase 525:\n  case_525();\n  break;\ncase 526:\n  case_526();\n  break;\ncase 527:\n#line 3868 \"cs-parser.jay\"\n  {\n\t\t++lexer.parsing_type;\n\t  }\n  break;\ncase 528:\n  case_528();\n  break;\ncase 529:\n  case_529();\n  break;\ncase 530:\n#line 3890 \"cs-parser.jay\"\n  {\n\t\tyyVal = new EmptyCompletion ();\n\t  }\n  break;\ncase 533:\n#line 3899 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 535:\n  case_535();\n  break;\ncase 536:\n  case_536();\n  break;\ncase 537:\n#line 3921 \"cs-parser.jay\"\n  {\n\t\tyyVal = new EmptyCompletion ();\n\t  }\n  break;\ncase 538:\n#line 3925 \"cs-parser.jay\"\n  {\n\t  \tyyVal = yyVals[-1+yyTop];\n\t  }\n  break;\ncase 539:\n  case_539();\n  break;\ncase 540:\n  case_540();\n  break;\ncase 541:\n  case_541();\n  break;\ncase 542:\n  case_542();\n  break;\ncase 546:\n  case_546();\n  break;\ncase 547:\n  case_547();\n  break;\ncase 548:\n  case_548();\n  break;\ncase 549:\n#line 3985 \"cs-parser.jay\"\n  {\n\t\tyyVal = 2;\n\t  }\n  break;\ncase 550:\n#line 3989 \"cs-parser.jay\"\n  {\n\t\tyyVal = ((int) yyVals[-1+yyTop]) + 1;\n\t  }\n  break;\ncase 551:\n#line 3996 \"cs-parser.jay\"\n  {\n\t\tyyVal = null;\n\t  }\n  break;\ncase 552:\n#line 4000 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 553:\n  case_553();\n  break;\ncase 554:\n  case_554();\n  break;\ncase 555:\n  case_555();\n  break;\ncase 556:\n  case_556();\n  break;\ncase 557:\n  case_557();\n  break;\ncase 559:\n  case_559();\n  break;\ncase 560:\n  case_560();\n  break;\ncase 561:\n  case_561();\n  break;\ncase 562:\n  case_562();\n  break;\ncase 563:\n  case_563();\n  break;\ncase 564:\n  case_564();\n  break;\ncase 565:\n  case_565();\n  break;\ncase 566:\n  case_566();\n  break;\ncase 567:\n  case_567();\n  break;\ncase 568:\n  case_568();\n  break;\ncase 569:\n#line 4133 \"cs-parser.jay\"\n  {\n\t\tstart_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 570:\n  case_570();\n  break;\ncase 571:\n#line 4146 \"cs-parser.jay\"\n  {\n\t\tstart_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop]));\n\t  }\n  break;\ncase 572:\n  case_572();\n  break;\ncase 573:\n#line 4163 \"cs-parser.jay\"\n  {\n\t\tyyVal = ParametersCompiled.Undefined;\n\t  }\n  break;\ncase 575:\n#line 4171 \"cs-parser.jay\"\n  {\n\t  \tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n  break;\ncase 576:\n  case_576();\n  break;\ncase 577:\n  case_577();\n  break;\ncase 579:\n#line 4197 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 580:\n#line 4201 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 581:\n  case_581();\n  break;\ncase 582:\n  case_582();\n  break;\ncase 583:\n  case_583();\n  break;\ncase 584:\n  case_584();\n  break;\ncase 585:\n  case_585();\n  break;\ncase 586:\n  case_586();\n  break;\ncase 588:\n#line 4265 \"cs-parser.jay\"\n  { \n\t  \tyyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 589:\n#line 4269 \"cs-parser.jay\"\n  { \n\t\tyyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 590:\n#line 4273 \"cs-parser.jay\"\n  {\n\t\tyyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 591:\n#line 4277 \"cs-parser.jay\"\n  {\n\t\tyyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 592:\n#line 4281 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 593:\n#line 4285 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 594:\n  case_594();\n  break;\ncase 595:\n  case_595();\n  break;\ncase 596:\n  case_596();\n  break;\ncase 597:\n  case_597();\n  break;\ncase 598:\n  case_598();\n  break;\ncase 599:\n  case_599();\n  break;\ncase 601:\n  case_601();\n  break;\ncase 602:\n  case_602();\n  break;\ncase 603:\n  case_603();\n  break;\ncase 604:\n  case_604();\n  break;\ncase 605:\n  case_605();\n  break;\ncase 606:\n  case_606();\n  break;\ncase 608:\n  case_608();\n  break;\ncase 609:\n  case_609();\n  break;\ncase 610:\n  case_610();\n  break;\ncase 611:\n  case_611();\n  break;\ncase 612:\n#line 4393 \"cs-parser.jay\"\n  {\n\t\tyyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 613:\n  case_613();\n  break;\ncase 614:\n  case_614();\n  break;\ncase 615:\n  case_615();\n  break;\ncase 616:\n  case_616();\n  break;\ncase 617:\n  case_617();\n  break;\ncase 619:\n  case_619();\n  break;\ncase 621:\n#line 4445 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 622:\n#line 4449 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 623:\n  case_623();\n  break;\ncase 624:\n  case_624();\n  break;\ncase 628:\n  case_628();\n  break;\ncase 629:\n  case_629();\n  break;\ncase 630:\n  case_630();\n  break;\ncase 631:\n  case_631();\n  break;\ncase 633:\n  case_633();\n  break;\ncase 634:\n  case_634();\n  break;\ncase 635:\n  case_635();\n  break;\ncase 636:\n  case_636();\n  break;\ncase 637:\n  case_637();\n  break;\ncase 638:\n  case_638();\n  break;\ncase 639:\n  case_639();\n  break;\ncase 640:\n  case_640();\n  break;\ncase 642:\n  case_642();\n  break;\ncase 643:\n  case_643();\n  break;\ncase 644:\n  case_644();\n  break;\ncase 645:\n  case_645();\n  break;\ncase 647:\n  case_647();\n  break;\ncase 648:\n  case_648();\n  break;\ncase 650:\n  case_650();\n  break;\ncase 651:\n  case_651();\n  break;\ncase 653:\n  case_653();\n  break;\ncase 654:\n  case_654();\n  break;\ncase 656:\n  case_656();\n  break;\ncase 657:\n  case_657();\n  break;\ncase 659:\n  case_659();\n  break;\ncase 660:\n  case_660();\n  break;\ncase 662:\n  case_662();\n  break;\ncase 664:\n  case_664();\n  break;\ncase 665:\n  case_665();\n  break;\ncase 666:\n  case_666();\n  break;\ncase 667:\n  case_667();\n  break;\ncase 668:\n  case_668();\n  break;\ncase 669:\n  case_669();\n  break;\ncase 670:\n  case_670();\n  break;\ncase 671:\n  case_671();\n  break;\ncase 672:\n  case_672();\n  break;\ncase 673:\n  case_673();\n  break;\ncase 674:\n  case_674();\n  break;\ncase 675:\n  case_675();\n  break;\ncase 676:\n  case_676();\n  break;\ncase 677:\n  case_677();\n  break;\ncase 678:\n  case_678();\n  break;\ncase 679:\n  case_679();\n  break;\ncase 680:\n  case_680();\n  break;\ncase 681:\n  case_681();\n  break;\ncase 682:\n  case_682();\n  break;\ncase 683:\n  case_683();\n  break;\ncase 684:\n  case_684();\n  break;\ncase 685:\n#line 4821 \"cs-parser.jay\"\n  { yyVal = ParametersCompiled.EmptyReadOnlyParameters; }\n  break;\ncase 686:\n  case_686();\n  break;\ncase 687:\n#line 4832 \"cs-parser.jay\"\n  {\n\t\tstart_block (Location.Null);\n\t  }\n  break;\ncase 688:\n  case_688();\n  break;\ncase 690:\n  case_690();\n  break;\ncase 692:\n  case_692();\n  break;\ncase 693:\n  case_693();\n  break;\ncase 694:\n  case_694();\n  break;\ncase 695:\n  case_695();\n  break;\ncase 696:\n  case_696();\n  break;\ncase 697:\n  case_697();\n  break;\ncase 698:\n  case_698();\n  break;\ncase 699:\n#line 4899 \"cs-parser.jay\"\n  {\n\t  \tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n  break;\ncase 700:\n  case_700();\n  break;\ncase 701:\n  case_701();\n  break;\ncase 702:\n#line 4913 \"cs-parser.jay\"\n  {\n\t  \tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\t  \n\t  }\n  break;\ncase 703:\n  case_703();\n  break;\ncase 704:\n  case_704();\n  break;\ncase 710:\n#line 4938 \"cs-parser.jay\"\n  {\n\t\tyyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 711:\n  case_711();\n  break;\ncase 712:\n  case_712();\n  break;\ncase 713:\n  case_713();\n  break;\ncase 715:\n#line 4967 \"cs-parser.jay\"\n  {\n\t\tyyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 716:\n#line 4974 \"cs-parser.jay\"\n  {\n\t  \tyyVal = null;\n\t  }\n  break;\ncase 718:\n  case_718();\n  break;\ncase 719:\n#line 4995 \"cs-parser.jay\"\n  {\n\t  \tyyVal = null;\n\t  }\n  break;\ncase 720:\n#line 4999 \"cs-parser.jay\"\n  {\n\t\tyyVal = null;\n\t  }\n  break;\ncase 721:\n#line 5003 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 722:\n#line 5007 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[-1+yyTop];\n\t  }\n  break;\ncase 723:\n  case_723();\n  break;\ncase 724:\n  case_724();\n  break;\ncase 725:\n#line 5032 \"cs-parser.jay\"\n  {\n\t  }\n  break;\ncase 726:\n  case_726();\n  break;\ncase 727:\n  case_727();\n  break;\ncase 728:\n  case_728();\n  break;\ncase 729:\n  case_729();\n  break;\ncase 730:\n#line 5084 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 731:\n#line 5086 \"cs-parser.jay\"\n  { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); }\n  break;\ncase 732:\n  case_732();\n  break;\ncase 733:\n#line 5099 \"cs-parser.jay\"\n  {\n\t\tlexer.parsing_modifiers = false;\t\t\n\t  }\n  break;\ncase 735:\n  case_735();\n  break;\ncase 736:\n  case_736();\n  break;\ncase 737:\n  case_737();\n  break;\ncase 738:\n  case_738();\n  break;\ncase 739:\n  case_739();\n  break;\ncase 740:\n  case_740();\n  break;\ncase 741:\n  case_741();\n  break;\ncase 742:\n  case_742();\n  break;\ncase 743:\n  case_743();\n  break;\ncase 744:\n  case_744();\n  break;\ncase 745:\n  case_745();\n  break;\ncase 746:\n  case_746();\n  break;\ncase 747:\n  case_747();\n  break;\ncase 748:\n  case_748();\n  break;\ncase 749:\n  case_749();\n  break;\ncase 750:\n  case_750();\n  break;\ncase 753:\n  case_753();\n  break;\ncase 754:\n  case_754();\n  break;\ncase 756:\n#line 5229 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 757:\n  case_757();\n  break;\ncase 758:\n  case_758();\n  break;\ncase 759:\n  case_759();\n  break;\ncase 760:\n  case_760();\n  break;\ncase 761:\n  case_761();\n  break;\ncase 762:\n  case_762();\n  break;\ncase 763:\n  case_763();\n  break;\ncase 764:\n  case_764();\n  break;\ncase 765:\n#line 5322 \"cs-parser.jay\"\n  {\n\t\tyyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 766:\n#line 5326 \"cs-parser.jay\"\n  {\n\t\tyyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 767:\n#line 5333 \"cs-parser.jay\"\n  {\n\t\tyyVal = null;\n\t  }\n  break;\ncase 768:\n  case_768();\n  break;\ncase 769:\n  case_769();\n  break;\ncase 770:\n  case_770();\n  break;\ncase 771:\n  case_771();\n  break;\ncase 772:\n#line 5378 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 773:\n  case_773();\n  break;\ncase 774:\n  case_774();\n  break;\ncase 775:\n  case_775();\n  break;\ncase 776:\n  case_776();\n  break;\ncase 777:\n  case_777();\n  break;\ncase 778:\n  case_778();\n  break;\ncase 779:\n  case_779();\n  break;\ncase 784:\n#line 5440 \"cs-parser.jay\"\n  {\n\t\tcurrent_block.AddStatement ((Statement) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 785:\n#line 5444 \"cs-parser.jay\"\n  {\n\t\tcurrent_block.AddStatement ((Statement) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 787:\n  case_787();\n  break;\ncase 788:\n  case_788();\n  break;\ncase 791:\n#line 5478 \"cs-parser.jay\"\n  {\n\t\tcurrent_block.AddStatement ((Statement) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 792:\n#line 5482 \"cs-parser.jay\"\n  {\n\t\tcurrent_block.AddStatement ((Statement) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 821:\n  case_821();\n  break;\ncase 822:\n  case_822();\n  break;\ncase 823:\n  case_823();\n  break;\ncase 824:\n  case_824();\n  break;\ncase 825:\n  case_825();\n  break;\ncase 828:\n  case_828();\n  break;\ncase 829:\n  case_829();\n  break;\ncase 830:\n  case_830();\n  break;\ncase 834:\n  case_834();\n  break;\ncase 835:\n#line 5633 \"cs-parser.jay\"\n  {\n\t\tyyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 837:\n#line 5641 \"cs-parser.jay\"\n  {\n\t  \tyyVal = Error_AwaitAsIdentifier (yyVals[0+yyTop]);\n\t  }\n  break;\ncase 838:\n  case_838();\n  break;\ncase 839:\n  case_839();\n  break;\ncase 840:\n  case_840();\n  break;\ncase 841:\n  case_841();\n  break;\ncase 843:\n  case_843();\n  break;\ncase 845:\n  case_845();\n  break;\ncase 846:\n  case_846();\n  break;\ncase 850:\n  case_850();\n  break;\ncase 853:\n  case_853();\n  break;\ncase 854:\n  case_854();\n  break;\ncase 855:\n#line 5755 \"cs-parser.jay\"\n  {\n\t\treport.Error (145, lexer.Location, \"A const field requires a value to be provided\");\n\t  }\n  break;\ncase 856:\n  case_856();\n  break;\ncase 861:\n  case_861();\n  break;\ncase 863:\n  case_863();\n  break;\ncase 864:\n  case_864();\n  break;\ncase 865:\n  case_865();\n  break;\ncase 866:\n#line 5805 \"cs-parser.jay\"\n  { yyVal = yyVals[-1+yyTop]; }\n  break;\ncase 867:\n  case_867();\n  break;\ncase 868:\n#line 5815 \"cs-parser.jay\"\n  { yyVal = yyVals[-1+yyTop]; }\n  break;\ncase 869:\n#line 5816 \"cs-parser.jay\"\n  { yyVal = yyVals[-1+yyTop]; }\n  break;\ncase 870:\n  case_870();\n  break;\ncase 871:\n  case_871();\n  break;\ncase 872:\n  case_872();\n  break;\ncase 875:\n  case_875();\n  break;\ncase 876:\n  case_876();\n  break;\ncase 877:\n  case_877();\n  break;\ncase 878:\n#line 5888 \"cs-parser.jay\"\n  {\n\t\tstart_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 879:\n  case_879();\n  break;\ncase 880:\n  case_880();\n  break;\ncase 881:\n#line 5908 \"cs-parser.jay\"\n  {\n\t\treport.Warning (1522, 1, current_block.StartLocation, \"Empty switch block\"); \n\t  }\n  break;\ncase 885:\n#line 5918 \"cs-parser.jay\"\n  {\n\t\tError_SyntaxError (yyToken);\n\t  }\n  break;\ncase 887:\n  case_887();\n  break;\ncase 888:\n#line 5935 \"cs-parser.jay\"\n  {\n\t\tcurrent_block.AddStatement ((Statement) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 889:\n  case_889();\n  break;\ncase 890:\n  case_890();\n  break;\ncase 891:\n#line 5952 \"cs-parser.jay\"\n  {\n\t\tyyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop]));\n\t  }\n  break;\ncase 896:\n  case_896();\n  break;\ncase 897:\n  case_897();\n  break;\ncase 898:\n  case_898();\n  break;\ncase 899:\n  case_899();\n  break;\ncase 900:\n  case_900();\n  break;\ncase 901:\n  case_901();\n  break;\ncase 902:\n#line 6013 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 903:\n  case_903();\n  break;\ncase 904:\n#line 6028 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 905:\n  case_905();\n  break;\ncase 906:\n  case_906();\n  break;\ncase 907:\n#line 6049 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n  break;\ncase 908:\n  case_908();\n  break;\ncase 909:\n  case_909();\n  break;\ncase 910:\n  case_910();\n  break;\ncase 911:\n#line 6083 \"cs-parser.jay\"\n  { yyVal = new EmptyStatement (lexer.Location); }\n  break;\ncase 913:\n  case_913();\n  break;\ncase 914:\n  case_914();\n  break;\ncase 916:\n#line 6107 \"cs-parser.jay\"\n  { yyVal = null; }\n  break;\ncase 918:\n#line 6112 \"cs-parser.jay\"\n  { yyVal = new EmptyStatement (lexer.Location); }\n  break;\ncase 922:\n  case_922();\n  break;\ncase 923:\n  case_923();\n  break;\ncase 924:\n  case_924();\n  break;\ncase 925:\n  case_925();\n  break;\ncase 926:\n  case_926();\n  break;\ncase 927:\n  case_927();\n  break;\ncase 928:\n  case_928();\n  break;\ncase 935:\n  case_935();\n  break;\ncase 936:\n  case_936();\n  break;\ncase 937:\n  case_937();\n  break;\ncase 938:\n  case_938();\n  break;\ncase 939:\n  case_939();\n  break;\ncase 940:\n  case_940();\n  break;\ncase 941:\n  case_941();\n  break;\ncase 942:\n  case_942();\n  break;\ncase 943:\n  case_943();\n  break;\ncase 944:\n  case_944();\n  break;\ncase 945:\n  case_945();\n  break;\ncase 946:\n  case_946();\n  break;\ncase 947:\n  case_947();\n  break;\ncase 948:\n  case_948();\n  break;\ncase 949:\n  case_949();\n  break;\ncase 952:\n#line 6358 \"cs-parser.jay\"\n  {\n\t\tyyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false);\n\t  }\n  break;\ncase 953:\n  case_953();\n  break;\ncase 954:\n  case_954();\n  break;\ncase 955:\n  case_955();\n  break;\ncase 956:\n  case_956();\n  break;\ncase 957:\n  case_957();\n  break;\ncase 960:\n  case_960();\n  break;\ncase 961:\n  case_961();\n  break;\ncase 962:\n  case_962();\n  break;\ncase 963:\n  case_963();\n  break;\ncase 964:\n  case_964();\n  break;\ncase 966:\n  case_966();\n  break;\ncase 967:\n#line 6483 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 968:\n#line 6490 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n  break;\ncase 969:\n  case_969();\n  break;\ncase 970:\n#line 6500 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n  break;\ncase 971:\n  case_971();\n  break;\ncase 972:\n  case_972();\n  break;\ncase 973:\n  case_973();\n  break;\ncase 974:\n  case_974();\n  break;\ncase 975:\n  case_975();\n  break;\ncase 976:\n  case_976();\n  break;\ncase 977:\n  case_977();\n  break;\ncase 978:\n  case_978();\n  break;\ncase 979:\n  case_979();\n  break;\ncase 980:\n  case_980();\n  break;\ncase 982:\n  case_982();\n  break;\ncase 983:\n#line 6605 \"cs-parser.jay\"\n  {\n\t\tError_MissingInitializer (lexer.Location);\n\t  }\n  break;\ncase 984:\n  case_984();\n  break;\ncase 985:\n  case_985();\n  break;\ncase 986:\n  case_986();\n  break;\ncase 987:\n  case_987();\n  break;\ncase 988:\n  case_988();\n  break;\ncase 989:\n  case_989();\n  break;\ncase 990:\n  case_990();\n  break;\ncase 991:\n  case_991();\n  break;\ncase 992:\n  case_992();\n  break;\ncase 993:\n#line 6710 \"cs-parser.jay\"\n  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n  break;\ncase 994:\n  case_994();\n  break;\ncase 995:\n#line 6725 \"cs-parser.jay\"\n  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n  break;\ncase 996:\n  case_996();\n  break;\ncase 997:\n  case_997();\n  break;\ncase 998:\n  case_998();\n  break;\ncase 1000:\n  case_1000();\n  break;\ncase 1001:\n  case_1001();\n  break;\ncase 1002:\n#line 6789 \"cs-parser.jay\"\n  {\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n  break;\ncase 1003:\n  case_1003();\n  break;\ncase 1004:\n  case_1004();\n  break;\ncase 1005:\n  case_1005();\n  break;\ncase 1006:\n  case_1006();\n  break;\ncase 1007:\n#line 6828 \"cs-parser.jay\"\n  {\n\t  \tyyVal = new object[] { yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]) };\n\t  }\n  break;\ncase 1008:\n  case_1008();\n  break;\ncase 1010:\n  case_1010();\n  break;\ncase 1016:\n#line 6857 \"cs-parser.jay\"\n  {\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n  break;\ncase 1017:\n  case_1017();\n  break;\ncase 1018:\n#line 6876 \"cs-parser.jay\"\n  {\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n  break;\ncase 1019:\n  case_1019();\n  break;\ncase 1020:\n  case_1020();\n  break;\ncase 1021:\n  case_1021();\n  break;\ncase 1022:\n  case_1022();\n  break;\ncase 1023:\n  case_1023();\n  break;\ncase 1024:\n  case_1024();\n  break;\ncase 1025:\n  case_1025();\n  break;\ncase 1026:\n  case_1026();\n  break;\ncase 1027:\n  case_1027();\n  break;\ncase 1029:\n  case_1029();\n  break;\ncase 1030:\n  case_1030();\n  break;\ncase 1031:\n  case_1031();\n  break;\ncase 1033:\n  case_1033();\n  break;\ncase 1034:\n  case_1034();\n  break;\ncase 1036:\n  case_1036();\n  break;\ncase 1037:\n  case_1037();\n  break;\ncase 1038:\n#line 7077 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]);\t\n\t  }\n  break;\ncase 1039:\n  case_1039();\n  break;\ncase 1040:\n  case_1040();\n  break;\ncase 1041:\n#line 7094 \"cs-parser.jay\"\n  {\n\t\tyyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]);\t\n\t  }\n  break;\ncase 1042:\n  case_1042();\n  break;\ncase 1043:\n  case_1043();\n  break;\ncase 1045:\n  case_1045();\n  break;\ncase 1046:\n  case_1046();\n  break;\ncase 1049:\n  case_1049();\n  break;\ncase 1050:\n  case_1050();\n  break;\ncase 1058:\n#line 7219 \"cs-parser.jay\"\n  {\n\t\tmodule.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop];\n\t  }\n  break;\ncase 1059:\n#line 7226 \"cs-parser.jay\"\n  {\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop];\n\t  }\n  break;\ncase 1060:\n  case_1060();\n  break;\ncase 1061:\n  case_1061();\n  break;\ncase 1062:\n  case_1062();\n  break;\ncase 1063:\n#line 7249 \"cs-parser.jay\"\n  {\n\t\tyyVal = new MemberName ((MemberName) yyVals[-2+yyTop], MemberCache.IndexerNameAlias, Location.Null);\n\t  }\n  break;\ncase 1064:\n#line 7253 \"cs-parser.jay\"\n  {\n\t\tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n  break;\ncase 1065:\n  case_1065();\n  break;\ncase 1066:\n  case_1066();\n  break;\ncase 1067:\n  case_1067();\n  break;\ncase 1068:\n  case_1068();\n  break;\ncase 1070:\n#line 7289 \"cs-parser.jay\"\n  {\n\t\tyyVal = new MemberName (((MemberName) yyVals[-2+yyTop]), (MemberName) yyVals[0+yyTop]);\n\t  }\n  break;\ncase 1072:\n#line 7297 \"cs-parser.jay\"\n  {\n\t\tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n  break;\ncase 1073:\n#line 7301 \"cs-parser.jay\"\n  {\n\t\tyyVal = yyVals[-1+yyTop];\n\t  }\n  break;\ncase 1074:\n#line 7308 \"cs-parser.jay\"\n  {\n\t\tyyVal = new List<DocumentationParameter> (0);\n\t  }\n  break;\ncase 1076:\n  case_1076();\n  break;\ncase 1077:\n  case_1077();\n  break;\ncase 1078:\n  case_1078();\n  break;\n#line default\n        }\n        yyTop -= yyLen[yyN];\n        yyState = yyStates[yyTop];\n        int yyM = yyLhs[yyN];\n        if (yyState == 0 && yyM == 0) {\n//t          if (debug != null) debug.shift(0, yyFinal);\n          yyState = yyFinal;\n          if (yyToken < 0) {\n            yyToken = yyLex.advance() ? yyLex.token() : 0;\n//t            if (debug != null)\n//t               debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());\n          }\n          if (yyToken == 0) {\n//t            if (debug != null) debug.accept(yyVal);\n            return yyVal;\n          }\n          goto continue_yyLoop;\n        }\n        if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)\n            && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))\n          yyState = yyTable[yyN];\n        else\n          yyState = yyDgoto[yyM];\n//t        if (debug != null) debug.shift(yyStates[yyTop], yyState);\n\t goto continue_yyLoop;\n      continue_yyDiscarded: ;\t// implements the named-loop continue: 'continue yyDiscarded'\n      }\n    continue_yyLoop: ;\t\t// implements the named-loop continue: 'continue yyLoop'\n    }\n  }\n\n/*\n All more than 3 lines long rules are wrapped into a method\n*/\nvoid case_6()\n#line 397 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tAttributes attrs = (Attributes) yyVals[0+yyTop];\n\t\t\treport.Error (1730, attrs.Attrs [0].Location,\n\t\t\t\t\"Assembly and module attributes must precede all other elements except using clauses and extern alias declarations\");\n\n\t\t\tcurrent_namespace.UnattachedAttributes = attrs;\n\t\t}\n\t  }\n\nvoid case_8()\n#line 411 \"cs-parser.jay\"\n{\n\t\tif (yyToken == Token.EXTERN_ALIAS)\n\t\t\treport.Error (439, lexer.Location, \"An extern alias declaration must precede all other elements\");\n\t\telse\n\t\t\tError_SyntaxError (yyToken);\n\t  }\n\nvoid case_13()\n#line 431 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tstring s = lt.Value;\n\t\tif (s != \"alias\") {\n\t\t\tsyntax_error (lt.Location, \"`alias' expected\");\n\t\t} else {\n\t\t\tif (lang_version == LanguageVersion.ISO_1)\n\t\t\t\tFeatureIsNotAvailable (lt.Location, \"external alias\");\n\n\t\t\tlt = (LocatedToken) yyVals[-1+yyTop];\n\t\t\tif (lt.Value == QualifiedAliasMember.GlobalAlias) {\n\t\t\t\tRootNamespace.Error_GlobalNamespaceRedefined (report, lt.Location);\n\t\t\t}\n\t\t\t\n\t\t\tvar na = new UsingExternAlias (new SimpleMemberName (lt.Value, lt.Location), GetLocation (yyVals[-3+yyTop]));\n\t\t\tcurrent_namespace.AddUsing (na);\n\t\t\t\n\t\t\tlbag.AddLocation (na, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t  }\n\nvoid case_17()\n#line 464 \"cs-parser.jay\"\n{\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_18()\n#line 472 \"cs-parser.jay\"\n{\n\t\tvar un = new UsingNamespace ((ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tcurrent_namespace.AddUsing (un);\n\t\t\n\t\tlbag.AddLocation (un, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_19()\n#line 479 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tif (lang_version != LanguageVersion.ISO_1 && lt.Value == \"global\") {\n\t\t\treport.Warning (440, 2, lt.Location,\n\t\t\t \"An alias named `global' will not be used when resolving `global::'. The global namespace will be used instead\");\n\t\t}\n\n\t\tvar un = new UsingAliasNamespace (new SimpleMemberName (lt.Value, lt.Location), (ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tcurrent_namespace.AddUsing (un);\n\t\tlbag.AddLocation (un, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_20()\n#line 491 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = null;\n\t }\n\nvoid case_21()\n#line 504 \"cs-parser.jay\"\n{\n\t\tAttributes attrs = (Attributes) yyVals[-2+yyTop];\n\t\tvar name = (MemberName) yyVals[0+yyTop];\n\t\tif (attrs != null) {\n\t\t\tbool valid_global_attrs = true;\n\t\t\tif ((current_namespace.DeclarationFound || current_namespace != file)) {\n\t\t\t\tvalid_global_attrs = false;\n\t\t\t} else {\n\t\t\t\tforeach (var a in attrs.Attrs) {\n\t\t\t\t\tif (a.ExplicitTarget == \"assembly\" || a.ExplicitTarget == \"module\")\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\tvalid_global_attrs = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (!valid_global_attrs)\n\t\t\t\treport.Error (1671, name.Location, \"A namespace declaration cannot have modifiers or attributes\");\n\t\t}\n\t\n\t\tmodule.AddAttributes (attrs, current_namespace);\n\t\t\n\t\tvar ns = new NamespaceContainer (name, current_namespace);\n\t\tcurrent_namespace.AddTypeContainer (ns);\n\t\tcurrent_container = current_namespace = ns;\n\t  }\n\nvoid case_22()\n#line 532 \"cs-parser.jay\"\n{\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_23()\n#line 537 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\tlbag.AddLocation (current_container, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\telse\n\t\t\tlbag.AddLocation (current_container, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  \n\t\tcurrent_container = current_namespace = current_namespace.Parent;\n\t  }\n\nvoid case_24()\n#line 546 \"cs-parser.jay\"\n{\n\t\treport.Error (1514, lexer.Location, \"Unexpected symbol `{0}', expecting `.' or `{{'\", GetSymbolName (yyToken));\n\n\t\tvar name = (MemberName) yyVals[0+yyTop];\t\t\n\t\tvar ns = new NamespaceContainer (name, current_namespace);\n\t\tlbag.AddLocation (ns, GetLocation (yyVals[-1+yyTop]));\n\t\tcurrent_namespace.AddTypeContainer (ns);\n\t  }\n\nvoid case_27()\n#line 560 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t  \tyyVal = null;\n\t  }\n\nvoid case_28()\n#line 568 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tyyVal = new MemberName (lt.Value, lt.Location);\n\t  }\n\nvoid case_29()\n#line 573 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tyyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location);\t\t\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_30()\n#line 579 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new MemberName (\"<invalid>\", lexer.Location);\n\t  }\n\nvoid case_43()\n#line 617 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tTypeContainer ds = (TypeContainer)yyVals[0+yyTop];\n\n\t\t\tif ((ds.ModFlags & (Modifiers.PRIVATE | Modifiers.PROTECTED)) != 0){\n\t\t\t\treport.Error (1527, ds.Location, \n\t\t\t\t\"Namespace elements cannot be explicitly declared as private, protected or protected internal\");\n\t\t\t}\n\n\t\t\t/* Here is a trick, for explicit attributes we don't know where they belong to until*/\n\t\t\t/* we parse succeeding declaration hence we parse them as normal and re-attach them*/\n\t\t\t/* when we know whether they are global (assembly:, module:) or local (type:).*/\n\t\t\tif (ds.OptAttributes != null) {\n\t\t\t\tds.OptAttributes.ConvertGlobalAttributes (ds, current_namespace, !current_namespace.DeclarationFound && current_namespace == file);\n\t\t\t}\n\t\t}\n\t\tcurrent_namespace.DeclarationFound = true;\n\t  }\n\nvoid case_45()\n#line 639 \"cs-parser.jay\"\n{\n\t\tcurrent_namespace.UnattachedAttributes = (Attributes) yyVals[-1+yyTop];\n\t\treport.Error (1518, lexer.Location, \"Attributes must be attached to class, delegate, enum, interface or struct\");\n\t\tlexer.putback ('}');\n\t  }\n\nvoid case_53()\n#line 672 \"cs-parser.jay\"\n{\n\t\tvar sect = (List<Attribute>) yyVals[0+yyTop];\n\t\tyyVal = new Attributes (sect);\n\t  }\n\nvoid case_54()\n#line 677 \"cs-parser.jay\"\n{\n\t\tAttributes attrs = yyVals[-1+yyTop] as Attributes;\n\t\tvar sect = (List<Attribute>) yyVals[0+yyTop];\n\t\tif (attrs == null)\n\t\t\tattrs = new Attributes (sect);\n\t\telse if (sect != null)\n\t\t\tattrs.AddAttributes (sect);\n\t\tyyVal = attrs;\n\t  }\n\nvoid case_55()\n#line 690 \"cs-parser.jay\"\n{\n\t  \tPushLocation (GetLocation (yyVals[0+yyTop]));\n\t\tlexer.parsing_attribute_section = true;\n\t  }\n\nvoid case_56()\n#line 695 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_attribute_section = false;\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_57()\n#line 703 \"cs-parser.jay\"\n{\n\t\tcurrent_attr_target = (string) yyVals[-1+yyTop];\n\t\tif (current_attr_target == \"assembly\" || current_attr_target == \"module\") {\n\t\t\tLexer.check_incorrect_doc_comment ();\n\t\t}\n\t  }\n\nvoid case_58()\n#line 710 \"cs-parser.jay\"\n{\n\t\t/* when attribute target is invalid*/\n\t\tif (current_attr_target == string.Empty)\n\t\t\tyyVal = new List<Attribute> (0);\n\t\telse\n\t\t\tyyVal = yyVals[-2+yyTop];\n\t\tlbag.InsertLocation (yyVal, 0, GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.InsertLocation (yyVal, 0, PopLocation ());\n\t\tlbag.InsertLocation (yyVal, 0, PopLocation ());\n\t\tif (yyVals[-1+yyTop] != null) {\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t\t}\n\n\t\tcurrent_attr_target = null;\n\t\tlexer.parsing_attribute_section = false;\n \t  }\n\nvoid case_59()\n#line 729 \"cs-parser.jay\"\n{\n\t\tyyVal = yyVals[-2+yyTop];\n\t\tlbag.InsertLocation (yyVal, 0, PopLocation ());\n\t\tif (yyVals[-1+yyTop] != null) {\n\t\t\tlbag.AddLocation (yyVal, GetLocation(yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tlbag.AddLocation (yyVal, GetLocation(yyVals[0+yyTop]));\n\t\t}\n\t  }\n\nvoid case_60()\n#line 739 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tvar tne = new SimpleName (lt.Value, null, lt.Location);\n\n\t\tyyVal = new List<Attribute> () {\n\t\t\tnew Attribute (null, tne, null, GetLocation (yyVals[-1+yyTop]), false)\n\t\t};\n\t  }\n\nvoid case_61()\n#line 750 \"cs-parser.jay\"\n{\n \t\tCheckAttributeTarget (yyToken, GetTokenName (yyToken), GetLocation (yyVals[0+yyTop])); \n \t\tyyVal = null;\n\t  }\n\nvoid case_62()\n#line 758 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tyyVal = CheckAttributeTarget (yyToken, lt.Value, lt.Location);\n\t\tPushLocation (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_66()\n#line 773 \"cs-parser.jay\"\n{\n\t\tvar attrs = (List<Attribute>) yyVals[-2+yyTop];\n\t\tif (attrs != null) {\n\t\t\tattrs.Add ((Attribute) yyVals[0+yyTop]);\n\t  \t\tlbag.AddLocation (attrs, GetLocation (yyVals[-1+yyTop]));\n\t  \t}\n\n\t\tyyVal = attrs;\n\t  }\n\nvoid case_68()\n#line 790 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\t\n\t\tvar tne = (ATypeNameExpression) yyVals[-2+yyTop];\n\t\tif (tne.HasTypeArguments) {\n\t\t\treport.Error (404, tne.Location, \"Attributes cannot be generic\");\n\t\t}\n\t\tArguments [] arguments = (Arguments []) yyVals[0+yyTop];\n\n\t\tyyVal = new Attribute (current_attr_target, tne, (Arguments[]) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), lexer.IsEscapedIdentifier (tne));\n\t\tif (arguments != null) {\n\t\t\tattributeArgumentCommas.Insert (0, savedAttrParenOpenLocation);\n\t\t\tattributeArgumentCommas.Add (savedAttrParenCloseLocation);\n\t\t\tlbag.AddLocation (yyVal, attributeArgumentCommas);\n\t\t\tattributeArgumentCommas.Clear ();\n\t\t} else if (HadAttributeParens) {\n\t\t\tlbag.AddLocation (yyVal, savedAttrParenOpenLocation, savedAttrParenCloseLocation);\n\t\t}\n\t  }\n\nvoid case_71()\n#line 818 \"cs-parser.jay\"\n{\n\t\tsavedAttrParenOpenLocation = GetLocation (yyVals[-2+yyTop]);\n\t\tsavedAttrParenCloseLocation = GetLocation (yyVals[0+yyTop]);\n\t\tyyVal = yyVals[-1+yyTop];\n\t\tHadAttributeParens = true;\n\t  }\n\nvoid case_73()\n#line 830 \"cs-parser.jay\"\n{\n\t  \tArguments a = new Arguments (4);\n\t\ta.Add ((Argument) yyVals[0+yyTop]);\n\t\tyyVal = new Arguments [] { a, null };\n\t  }\n\nvoid case_74()\n#line 836 \"cs-parser.jay\"\n{\n\t  \tArguments a = new Arguments (4);\n\t\ta.Add ((Argument) yyVals[0+yyTop]);  \n\t\tyyVal = new Arguments [] { null, a };\n\t  }\n\nvoid case_75()\n#line 842 \"cs-parser.jay\"\n{\n\t\tArguments[] o = (Arguments[]) yyVals[-2+yyTop];\n\t\tif (o [1] != null) {\n\t\t\treport.Error (1016, ((Argument) yyVals[0+yyTop]).Expr.Location, \"Named attribute arguments must appear after the positional arguments\");\n\t\t\to [0] = new Arguments (4);\n\t\t}\n\t\t\n\t\tArguments args = ((Arguments) o [0]);\n\t\tif (args.Count > 0 && !(yyVals[0+yyTop] is NamedArgument) && args [args.Count - 1] is NamedArgument)\n\t\t\tError_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]);\n\t\t\n\t\targs.Add ((Argument) yyVals[0+yyTop]);\n\t\tattributeArgumentCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_76()\n#line 857 \"cs-parser.jay\"\n{\n\t\tArguments[] o = (Arguments[]) yyVals[-2+yyTop];\n\t\tif (o [1] == null) {\n\t\t\to [1] = new Arguments (4);\n\t\t}\n\n\t\t((Arguments) o [1]).Add ((Argument) yyVals[0+yyTop]);\n\t\tattributeArgumentCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_79()\n#line 875 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = null;\n\t  }\n\nvoid case_81()\n#line 887 \"cs-parser.jay\"\n{\n\t  \t--lexer.parsing_block;\n\t  \tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tyyVal = new NamedArgument (lt.Value, lt.Location, (Expression) yyVals[0+yyTop]);\t  \n\t\tlbag.AddLocation (yyVal, GetLocation(yyVals[-2+yyTop]));\n\t  }\n\nvoid case_82()\n#line 897 \"cs-parser.jay\"\n{\n\t\tif (lang_version <= LanguageVersion.V_3)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), \"named argument\");\n\t\t\t\n\t\t/* Avoid boxing in common case (no modifier)*/\n\t\tvar arg_mod = yyVals[-1+yyTop] == null ? Argument.AType.None : (Argument.AType) yyVals[-1+yyTop];\n\t\t\t\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tyyVal = new NamedArgument (lt.Value, lt.Location, (Expression) yyVals[0+yyTop], arg_mod);\n\t\tlbag.AddLocation (yyVal, GetLocation(yyVals[-2+yyTop]));\n\t  }\n\nvoid case_88()\n#line 929 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\nvoid case_89()\n#line 934 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\nvoid case_103()\n#line 955 \"cs-parser.jay\"\n{\n\t\treport.Error (1519, lexer.Location, \"Unexpected symbol `{0}' in class, struct, or interface member declaration\",\n\t\t\tGetSymbolName (yyToken));\n\t\tyyVal = null;\n\t\tlexer.parsing_generic_declaration = false;\n\t  }\n\nvoid case_104()\n#line 965 \"cs-parser.jay\"\n{\n\t\tcurrent_local_parameters = current_type.PrimaryConstructorParameters;\n\t\tif (current_local_parameters == null) {\n\t\t\treport.Error (9010, GetLocation (yyVals[0+yyTop]), \"Primary constructor body is not allowed\");\n\t\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t}\n\n\t\t++lexer.parsing_block;\n\t\tstart_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_105()\n#line 976 \"cs-parser.jay\"\n{\n\t\tcurrent_local_parameters = null;\n\t\tvar t = current_type as ClassOrStruct;\n\t\tif (t != null) {\n\t\t\tvar b = (ToplevelBlock) yyVals[0+yyTop];\n\t\t\tif (t.PrimaryConstructorBlock != null) {\n\t\t\t\treport.Error (8041, b.StartLocation, \"Primary constructor already has a body\");\n\t\t\t} else {\n\t\t\t\tt.PrimaryConstructorBlock = b;\n\t\t\t}\n\t\t}\n\t  }\n\nvoid case_107()\n#line 998 \"cs-parser.jay\"\n{ \n\t\tlexer.ConstraintsParsing = true;\n\t\tvalid_param_mod = ParameterModifierType.PrimaryConstructor;\n\t\tpush_current_container (new Struct (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]);\n\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_108()\n#line 1007 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif (yyVals[-2+yyTop] != null)\n\t\t\tcurrent_type.PrimaryConstructorParameters = (ParametersCompiled) yyVals[-2+yyTop];\n\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\tcurrent_container.SetConstraints ((List<Constraints>) yyVals[0+yyTop]);\n\n\t\tif (doc_support)\n\t\t\tcurrent_container.PartialContainer.DocComment = Lexer.consume_doc_comment ();\n\n\t\t\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\nvoid case_109()\n#line 1024 \"cs-parser.jay\"\n{\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_110()\n#line 1029 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_declaration;\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_111()\n#line 1035 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-1+yyTop] == null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t\t} else {\n\t\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\tyyVal = pop_current_class ();\n\t  }\n\nvoid case_113()\n#line 1053 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tvar mod = (Modifiers) yyVals[-3+yyTop];\n\t\tcurrent_field = new Const (current_type, (FullNamedExpression) yyVals[-1+yyTop], mod, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);\n\t\tcurrent_type.AddMember (current_field);\n\t\t\n\t\tif ((mod & Modifiers.STATIC) != 0) {\n\t\t\treport.Error (504, current_field.Location, \"The constant `{0}' cannot be marked static\", current_field.GetSignatureForError ());\n\t\t}\n\t\t\n\t\tyyVal = current_field;\n\t  }\n\nvoid case_114()\n#line 1066 \"cs-parser.jay\"\n{\n\t\tif (doc_support) {\n\t\t\tcurrent_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tcurrent_field.Initializer = (ConstInitializer) yyVals[-2+yyTop];\n\t\tlbag.AddMember (current_field, GetModifierLocations (), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\tcurrent_field = null;\n\t  }\n\nvoid case_115()\n#line 1079 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tcurrent_type.AddMember (new Const (current_type, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop], MemberName.Null, (Attributes) yyVals[-4+yyTop]));\n\t  }\n\nvoid case_120()\n#line 1104 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t  \tyyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_122()\n#line 1117 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\tyyVal = new ConstInitializer (current_field, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_123()\n#line 1123 \"cs-parser.jay\"\n{\n\t\treport.Error (145, lexer.Location, \"A const field requires a value to be provided\");\n\t\tyyVal = null;\n\t  }\n\nvoid case_126()\n#line 1138 \"cs-parser.jay\"\n{\n\t  \tlexer.parsing_generic_declaration = false;\n\n\t\tFullNamedExpression type = (FullNamedExpression) yyVals[-1+yyTop];\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (670, GetLocation (yyVals[-1+yyTop]), \"Fields cannot have void type\");\n\t\t\t\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tcurrent_field = new Field (current_type, type, (Modifiers) yyVals[-2+yyTop], new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-3+yyTop]);\n\t\tcurrent_type.AddField (current_field);\n\t\tyyVal = current_field;\n\t  }\n\nvoid case_127()\n#line 1153 \"cs-parser.jay\"\n{ \n\t\tif (doc_support) {\n\t\t\tcurrent_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\t\n\t\tlbag.AddMember (current_field, GetModifierLocations (), GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = current_field;\n\t\tcurrent_field = null;\n\t  }\n\nvoid case_128()\n#line 1166 \"cs-parser.jay\"\n{ \n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), \"fixed size buffers\");\n\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tcurrent_field = new FixedField (current_type, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop],\n\t\t\tnew MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);\n\t\t\t\n\t\tcurrent_type.AddField (current_field);\n\t  }\n\nvoid case_129()\n#line 1177 \"cs-parser.jay\"\n{\n\t\tif (doc_support) {\n\t\t\tcurrent_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t    }\n\n\t\tcurrent_field.Initializer = (ConstInitializer) yyVals[-2+yyTop];\t    \n\t\tlbag.AddMember (current_field, GetModifierLocations (), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = current_field;\n\t    current_field = null;\n\t  }\n\nvoid case_132()\n#line 1200 \"cs-parser.jay\"\n{\n\t  \t++lexer.parsing_block;\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  \tstart_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_133()\n#line 1206 \"cs-parser.jay\"\n{\n\t  \t--lexer.parsing_block;\n\t\tcurrent_field.Initializer = (Expression) yyVals[0+yyTop];\n\t\tlbag.AppendToMember (current_field, GetLocation (yyVals[-2+yyTop]));\n\t\tend_block (lexer.Location);\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_138()\n#line 1233 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t  \tyyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_140()\n#line 1243 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\t  \n\t  \tyyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop]);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_145()\n#line 1269 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\t  \n\t\tyyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_147()\n#line 1282 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\tyyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_148()\n#line 1288 \"cs-parser.jay\"\n{\n\t\treport.Error (443, lexer.Location, \"Value or constant expected\");\n\t\tyyVal = null;\n\t  }\n\nvoid case_151()\n#line 1298 \"cs-parser.jay\"\n{\n\t\t/* It has to be here for the parent to safely restore artificial block*/\n\t  \tError_SyntaxError (yyToken);\n\t  \tyyVal = null;\n\t  }\n\nvoid case_152()\n#line 1307 \"cs-parser.jay\"\n{\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\n\t\t/* Was added earlier in the case of body being eof for full ast*/\n\t  }\n\nvoid case_153()\n#line 1314 \"cs-parser.jay\"\n{\n\t\tMethod method = (Method) yyVals[-2+yyTop];\n\t\tmethod.Block = (ToplevelBlock) yyVals[0+yyTop];\n\t\tasync_block = false;\n\t\t\n\t\tif (method.Block == null) {\n\t\t\tlbag.AppendToMember (method, savedLocation); /* semicolon*/\n\t\t\tmethod.ParameterInfo.CheckParameters (method);\n\n\t\t\tif ((method.ModFlags & Modifiers.ASYNC) != 0) {\n\t\t\t\treport.Error (1994, method.Location, \"`{0}': The async modifier can only be used with methods that have a body\",\n\t\t\t\t\tmethod.GetSignatureForError ());\n\t\t\t}\n\t\t} else {\n\t\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\t\treport.Error (531, method.Location, \"`{0}': interface members cannot have a definition\",\n\t\t\t\t\tmethod.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tcurrent_local_parameters = null;\n\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_155()\n#line 1350 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\t\tMemberName name = (MemberName) yyVals[-4+yyTop];\n\t\tcurrent_local_parameters = (ParametersCompiled) yyVals[-1+yyTop];\n\n\t\tvar method = Method.Create (current_type, (FullNamedExpression) yyVals[-5+yyTop], (Modifiers) yyVals[-6+yyTop],\n\t\t\t\t     name, current_local_parameters, (Attributes) yyVals[-7+yyTop]);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tasync_block = (method.ModFlags & Modifiers.ASYNC) != 0;\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\tlbag.AddMember (method, GetModifierLocations (), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = method;\n\n\t\tlexer.ConstraintsParsing = true;\n\t  }\n\nvoid case_156()\n#line 1371 \"cs-parser.jay\"\n{\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tvar method = (Method) yyVals[-1+yyTop];\n\t\t\tmethod.SetConstraints ((List<Constraints>) yyVals[0+yyTop]);\n\t\t}\n\n\t\tyyVal = yyVals[-1+yyTop];\n\t  }\n\nvoid case_158()\n#line 1390 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_generic_declaration = false;\n\t  \tvalid_param_mod = ParameterModifierType.All;\n\t  }\n\nvoid case_160()\n#line 1399 \"cs-parser.jay\"\n{\n\t\tlexer.ConstraintsParsing = false;\n\t\tvalid_param_mod = 0;\n\n\t\tMemberName name = (MemberName) yyVals[-6+yyTop];\n\t\tcurrent_local_parameters = (ParametersCompiled) yyVals[-3+yyTop];\n\n\t\tvar modifiers = (Modifiers) yyVals[-10+yyTop];\n\t\tmodifiers |= Modifiers.PARTIAL;\n\n\t\tvar method = Method.Create (current_type, new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-8+yyTop])),\n\t\t\t\t     modifiers, name, current_local_parameters, (Attributes) yyVals[-11+yyTop]);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tasync_block = (method.ModFlags & Modifiers.ASYNC) != 0;\n\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\tmethod.SetConstraints ((List<Constraints>) yyVals[0+yyTop]);\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\tStoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[-9+yyTop]));\n\t\tlbag.AddMember (method, GetModifierLocations (), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t\tyyVal = method;\n\t  }\n\nvoid case_161()\n#line 1430 \"cs-parser.jay\"\n{\n\t\tMemberName name = (MemberName) yyVals[-3+yyTop];\n\t\treport.Error (1585, name.Location, \n\t\t\t\"Member modifier `{0}' must precede the member type and name\", ModifiersExtensions.Name ((Modifiers) yyVals[-4+yyTop]));\n\n\t\tvar method = Method.Create (current_type, (FullNamedExpression) yyVals[-5+yyTop],\n\t\t\t\t\t    0, name, (ParametersCompiled) yyVals[-1+yyTop], (Attributes) yyVals[-7+yyTop]);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tcurrent_local_parameters = (ParametersCompiled) yyVals[-1+yyTop];\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\tyyVal = method;\n\t  }\n\nvoid case_162()\n#line 1451 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tcurrent_local_parameters = ParametersCompiled.Undefined;\n\n\t\tMemberName name = (MemberName) yyVals[-1+yyTop];\n\t\tvar method = Method.Create (current_type, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-3+yyTop],\n\t\t\t\t\t\t\t\t\tname, current_local_parameters, (Attributes) yyVals[-4+yyTop]);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\tyyVal = method;\n\t  }\n\nvoid case_167()\n#line 1480 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.V_6) {\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), \"expression bodied members\");\n\t\t}\n\n\t\t++lexer.parsing_block;\n\t\tstart_block (GetLocation (yyVals[0+yyTop]));\n\t }\n\nvoid case_168()\n#line 1489 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_block = 0;\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));\n\t\tvar b = end_block (GetLocation (yyVals[0+yyTop]));\n\t\tb.IsCompilerGenerated = true;\n\t\tyyVal = b;\n\t }\n\nvoid case_171()\n#line 1505 \"cs-parser.jay\"\n{\n\t\tvar pars_list = (List<Parameter>) yyVals[0+yyTop];\n\t  \tyyVal = new ParametersCompiled (pars_list.ToArray ());\n\t  \tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_172()\n#line 1511 \"cs-parser.jay\"\n{\n\t\tvar pars_list = (List<Parameter>) yyVals[-2+yyTop];\n\t\tpars_list.Add ((Parameter) yyVals[0+yyTop]);\n\t\tparameterListCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\t\t\n\t\tyyVal = new ParametersCompiled (pars_list.ToArray ()); \n\t  \tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_173()\n#line 1520 \"cs-parser.jay\"\n{\n\t\tvar pars_list = (List<Parameter>) yyVals[-2+yyTop];\n\t\tpars_list.Add (new ArglistParameter (GetLocation (yyVals[0+yyTop])));\n\t\tparameterListCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\t\t\n\t\tyyVal = new ParametersCompiled (pars_list.ToArray (), true);\n\t  \tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_174()\n#line 1529 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-2+yyTop] != null)\n\t\t\treport.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, \"A params parameter must be the last parameter in a formal parameter list\");\n\n\t\tyyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[-2+yyTop] } );\t\t\t\n\t  \tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_175()\n#line 1537 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-2+yyTop] != null)\n\t\t\treport.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, \"A params parameter must be the last parameter in a formal parameter list\");\n\n\t\tvar pars_list = (List<Parameter>) yyVals[-4+yyTop];\n\t\tpars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop])));\n\t\tparameterListCommas.Add (GetLocation (yyVals[-3+yyTop]));\n\t\tparameterListCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\t\t\n\t\tyyVal = new ParametersCompiled (pars_list.ToArray (), true);\n\t  \tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_176()\n#line 1550 \"cs-parser.jay\"\n{\n\t\treport.Error (257, GetLocation (yyVals[-2+yyTop]), \"An __arglist parameter must be the last parameter in a formal parameter list\");\n\n\t\tyyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[-2+yyTop])) }, true);\n\t  \tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_177()\n#line 1557 \"cs-parser.jay\"\n{\n\t\treport.Error (257, GetLocation (yyVals[-2+yyTop]), \"An __arglist parameter must be the last parameter in a formal parameter list\");\n\n\t\tvar pars_list = (List<Parameter>) yyVals[-4+yyTop];\n\t\tpars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop])));\n\t\tparameterListCommas.Add (GetLocation (yyVals[-3+yyTop]));\n\t\tparameterListCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\n\t\tyyVal = new ParametersCompiled (pars_list.ToArray (), true);\n\t  \tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_180()\n#line 1577 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = ParametersCompiled.EmptyReadOnlyParameters;\n\t  }\n\nvoid case_181()\n#line 1585 \"cs-parser.jay\"\n{\n\t\tparameters_bucket.Clear ();\n\t\tParameter p = (Parameter) yyVals[0+yyTop];\n\t\tparameters_bucket.Add (p);\n\t\tparameterListCommas.Clear ();\n\t\tdefault_parameter_used = p.HasDefaultValue;\n\t\tyyVal = parameters_bucket;\n\t  }\n\nvoid case_182()\n#line 1594 \"cs-parser.jay\"\n{\n\t\tvar pars = (List<Parameter>) yyVals[-2+yyTop];\n\t\tParameter p = (Parameter) yyVals[0+yyTop];\n\t\tif (p != null) {\n\t\t\tif (p.HasExtensionMethodModifier)\n\t\t\t\treport.Error (1100, p.Location, \"The parameter modifier `this' can only be used on the first parameter\");\n\t\t\telse if (!p.HasDefaultValue && default_parameter_used)\n\t\t\t\treport.Error (1737, p.Location, \"Optional parameter cannot precede required parameters\");\n\n\t\t\tdefault_parameter_used |= p.HasDefaultValue;\n\t\t\tpars.Add (p);\n\t\t\t\n\t\t\tparameterListCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\t\t}\n\t\t\n\t\tyyVal = yyVals[-2+yyTop];\n\t  }\n\nvoid case_183()\n#line 1618 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tyyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, parameterModifierLocation);\n\t  }\n\nvoid case_184()\n#line 1627 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\treport.Error (1552, lt.Location, \"Array type specifier, [], must appear before parameter name\");\n\t\tyyVal = new Parameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Parameter.Modifier) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, parameterModifierLocation);\n\t  }\n\nvoid case_185()\n#line 1634 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t  \tLocation l = GetLocation (yyVals[0+yyTop]);\n\t\tyyVal = new Parameter (null, null, Parameter.Modifier.NONE, (Attributes) yyVals[-1+yyTop], l);\n\t  }\n\nvoid case_186()\n#line 1643 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t  \tLocation l = GetLocation (yyVals[0+yyTop]);\n\t\tyyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], null, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], l);\n\t\tlbag.AddLocation (yyVal, parameterModifierLocation);\n\t  }\n\nvoid case_188()\n#line 1658 \"cs-parser.jay\"\n{\n\t  \t--lexer.parsing_block;\n\t\tif (lang_version <= LanguageVersion.V_3) {\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), \"optional parameter\");\n\t\t}\n\t\t\n\t\tParameter.Modifier mod = (Parameter.Modifier) yyVals[-5+yyTop];\n\t\tif (mod != Parameter.Modifier.NONE) {\n\t\t\tswitch (mod) {\n\t\t\tcase Parameter.Modifier.REF:\n\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\treport.Error (1741, GetLocation (yyVals[-5+yyTop]), \"Cannot specify a default value for the `{0}' parameter\",\n\t\t\t\t\tParameter.GetModifierSignature (mod));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Parameter.Modifier.This:\n\t\t\t\treport.Error (1743, GetLocation (yyVals[-5+yyTop]), \"Cannot specify a default value for the `{0}' parameter\",\n\t\t\t\t\tParameter.GetModifierSignature (mod));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (mod.ToString ());\n\t\t\t}\n\t\t\t\t\n\t\t\tmod = Parameter.Modifier.NONE;\n\t\t}\n\t\t\n\t\tif ((valid_param_mod & ParameterModifierType.DefaultValue) == 0)\n\t\t\treport.Error (1065, GetLocation (yyVals[-2+yyTop]), \"Optional parameter is not valid in this context\");\n\t\t\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tyyVal = new Parameter ((FullNamedExpression) yyVals[-4+yyTop], lt.Value, mod, (Attributes) yyVals[-6+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, parameterModifierLocation, GetLocation (yyVals[-2+yyTop])); /* parameterModifierLocation should be ignored when mod == NONE*/\n\t\t\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\t((Parameter) yyVal).DefaultValue = new DefaultParameterValueExpression ((Expression) yyVals[0+yyTop]);\n\t  }\n\nvoid case_192()\n#line 1707 \"cs-parser.jay\"\n{\n\t\tParameter.Modifier p2 = (Parameter.Modifier)yyVals[0+yyTop];\n  \t\tParameter.Modifier mod = (Parameter.Modifier)yyVals[-1+yyTop] | p2;\n  \t\tif (((Parameter.Modifier)yyVals[-1+yyTop] & p2) == p2) {\n  \t\t\tError_DuplicateParameterModifier (lexer.Location, p2);\n  \t\t} else {\n\t  \t\tswitch (mod & ~Parameter.Modifier.This) {\n  \t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\treport.Error (1101, lexer.Location, \"The parameter modifiers `this' and `ref' cannot be used altogether\");\n  \t\t\t\t\tbreak;\n   \t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\treport.Error (1102, lexer.Location, \"The parameter modifiers `this' and `out' cannot be used altogether\");\n  \t\t\t\t\tbreak;\n  \t\t\t\tdefault:\n \t\t\t\t\treport.Error (1108, lexer.Location, \"A parameter cannot have specified more than one modifier\");\n \t\t\t\t\tbreak;\n \t\t\t}\n  \t\t}\n  \t\tyyVal = mod;\n\t  }\n\nvoid case_193()\n#line 1731 \"cs-parser.jay\"\n{\n\t  \tif ((valid_param_mod & ParameterModifierType.Ref) == 0)\n\t  \t\tError_ParameterModifierNotValid (\"ref\", GetLocation (yyVals[0+yyTop]));\n\t\tparameterModifierLocation = GetLocation (yyVals[0+yyTop]);\n\t  \tyyVal = Parameter.Modifier.REF;\n\t  }\n\nvoid case_194()\n#line 1738 \"cs-parser.jay\"\n{\n\t  \tif ((valid_param_mod & ParameterModifierType.Out) == 0)\n\t  \t\tError_ParameterModifierNotValid (\"out\", GetLocation (yyVals[0+yyTop]));\n\t\tparameterModifierLocation = GetLocation (yyVals[0+yyTop]);\n\t  \tyyVal = Parameter.Modifier.OUT;\n\t  }\n\nvoid case_195()\n#line 1745 \"cs-parser.jay\"\n{\n\t\tif ((valid_param_mod & ParameterModifierType.This) == 0)\n\t  \t\tError_ParameterModifierNotValid (\"this\", GetLocation (yyVals[0+yyTop]));\n\n\t  \tif (lang_version <= LanguageVersion.ISO_2)\n\t  \t\tFeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), \"extension methods\");\n\t\tparameterModifierLocation = GetLocation (yyVals[0+yyTop]);\n\t\tyyVal = Parameter.Modifier.This;\n\t  }\n\nvoid case_196()\n#line 1758 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tyyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Attributes) yyVals[-3+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, savedLocation);\n\t  }\n\nvoid case_197()\n#line 1764 \"cs-parser.jay\"\n{\n\t\treport.Error (1751, GetLocation (yyVals[-4+yyTop]), \"Cannot specify a default value for a parameter array\");\n\t\t\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tyyVal = new ParamsParameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Attributes) yyVals[-5+yyTop], lt.Location);\t\t\n\t\tlbag.AddLocation (yyVal, savedLocation);\n\t  }\n\nvoid case_198()\n#line 1772 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], null, (Attributes) yyVals[-3+yyTop], Location.Null);\n\t  }\n\nvoid case_199()\n#line 1781 \"cs-parser.jay\"\n{\n\t\tif ((valid_param_mod & ParameterModifierType.Params) == 0)\n\t\t\treport.Error (1670, (GetLocation (yyVals[0+yyTop])), \"The `params' modifier is not allowed in current context\");\n\t\tsavedLocation = GetLocation (yyVals[0+yyTop]);\n\t  }\n\nvoid case_200()\n#line 1787 \"cs-parser.jay\"\n{\n\t\tParameter.Modifier mod = (Parameter.Modifier)yyVals[0+yyTop];\n\t\tif ((mod & Parameter.Modifier.This) != 0) {\n\t\t\treport.Error (1104, GetLocation (yyVals[-1+yyTop]), \"The parameter modifiers `this' and `params' cannot be used altogether\");\n\t\t} else {\n\t\t\treport.Error (1611, GetLocation (yyVals[-1+yyTop]), \"The params parameter cannot be declared as ref or out\");\n\t\t}\t  \n\t\tsavedLocation = GetLocation (yyVals[-1+yyTop]);\n\t  }\n\nvoid case_202()\n#line 1804 \"cs-parser.jay\"\n{\n\t  \tif ((valid_param_mod & ParameterModifierType.Arglist) == 0)\n\t  \t\treport.Error (1669, GetLocation (yyVals[0+yyTop]), \"__arglist is not valid in this context\");\n\t  }\n\nvoid case_203()\n#line 1815 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_generic_declaration = false;\n\t\tif (doc_support)\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t  }\n\nvoid case_204()\n#line 1821 \"cs-parser.jay\"\n{\n\t\tvar type = (FullNamedExpression) yyVals[-3+yyTop];\n\t\tcurrent_property = new Property (current_type, type, (Modifiers) yyVals[-4+yyTop],\n\t\t\t(MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]);\n\t\t\t\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (547, GetLocation (yyVals[-3+yyTop]), \"`{0}': property or indexer cannot have void type\", current_property.GetSignatureForError ());\t\t\t\t\t\n\t\t\t\n\t\tcurrent_type.AddMember (current_property);\n\t\tlbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[0+yyTop]));\n\t\t\n\t\tlexer.PropertyParsing = true;\n\t  }\n\nvoid case_205()\n#line 1835 \"cs-parser.jay\"\n{\n\t\tlexer.PropertyParsing = false;\n\t\t\n\t\tif (doc_support)\n\t\t\tcurrent_property.DocComment = ConsumeStoredComment ();\t\t\t\t\n\t  }\n\nvoid case_206()\n#line 1842 \"cs-parser.jay\"\n{\n\t\tlbag.AppendToMember (current_property, GetLocation (yyVals[0+yyTop]));\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\nvoid case_208()\n#line 1854 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_generic_declaration = false;\n\t\tif (doc_support)\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  }\n\nvoid case_209()\n#line 1861 \"cs-parser.jay\"\n{\n\t\tvar type = (FullNamedExpression) yyVals[-3+yyTop];\n\t\tvar property = new Property (current_type, type, (Modifiers) yyVals[-4+yyTop],\n\t\t\t(MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]);\n\n\t\tproperty.Get = new Property.GetMethod (property, Modifiers.COMPILER_GENERATED, null, property.Location);\n\t\tproperty.Get.Block = (ToplevelBlock) yyVals[0+yyTop];\n\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (531, property.Get.Block.StartLocation,\n\t\t\t\t\"`{0}': interface members cannot have a definition\", property.GetSignatureForError ());\n\t\t}\n\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (547, GetLocation (yyVals[-3+yyTop]), \"`{0}': property or indexer cannot have void type\", property.GetSignatureForError ());\n\n\t\tcurrent_type.AddMember (property);\n\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_211()\n#line 1886 \"cs-parser.jay\"\n{\n\t\t++lexer.parsing_block;\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\tstart_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_212()\n#line 1892 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\t((Property)current_property).Initializer = (Expression) yyVals[-1+yyTop];\n\t\tlbag.AppendToMember (current_property, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\tend_block (GetLocation (yyVals[0+yyTop]));\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_216()\n#line 1913 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\t\tvar type = (FullNamedExpression) yyVals[-5+yyTop];\n\t\tIndexer indexer = new Indexer (current_type, type, (MemberName) yyVals[-4+yyTop], (Modifiers) yyVals[-6+yyTop], (ParametersCompiled) yyVals[-1+yyTop], (Attributes) yyVals[-7+yyTop]);\n\t\t\t\n\t\tcurrent_property = indexer;\n\n  \t\tcurrent_type.AddIndexer (indexer);\n\t\tlbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n  \t\t\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (620, GetLocation (yyVals[-5+yyTop]), \"`{0}': indexer return type cannot be `void'\", indexer.GetSignatureForError ());  \t\t\n\n\t\tif (indexer.ParameterInfo.IsEmpty) {\n\t\t\treport.Error (1551, GetLocation (yyVals[-3+yyTop]), \"Indexers must have at least one parameter\");\n\t\t}\n\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\n\t\tlexer.PropertyParsing = true;\n\t\tcurrent_local_parameters = (ParametersCompiled) yyVals[-1+yyTop];\n\t  }\n\nvoid case_217()\n#line 1939 \"cs-parser.jay\"\n{\n \t\tlexer.PropertyParsing = false;\n\t\tcurrent_local_parameters = null;\n\n\t\tif (current_property.AccessorFirst != null && current_property.AccessorFirst.Block == null)\n\t\t\t((Indexer) current_property).ParameterInfo.CheckParameters (current_property);\n\t  \n\t\tif (doc_support)\n\t\t\tcurrent_property.DocComment = ConsumeStoredComment ();\n\t\t\t\n\t\tcurrent_property = null;\t\t\n\t  }\n\nvoid case_219()\n#line 1959 \"cs-parser.jay\"\n{\n\t\tcurrent_property.Get = new Indexer.GetIndexerMethod (current_property, Modifiers.COMPILER_GENERATED, current_local_parameters, null, current_property.Location);\n\t\tcurrent_property.Get.Block = (ToplevelBlock) yyVals[0+yyTop];\n\t  }\n\nvoid case_224()\n#line 1971 \"cs-parser.jay\"\n{\n\t  \tif (yyToken == Token.CLOSE_BRACE) {\n\t  \t\treport.Error (548, lexer.Location, \"`{0}': property or indexer must have at least one accessor\", current_property.GetSignatureForError ());\n\t\t} else {\n\t\t\tif (yyToken == Token.SEMICOLON)\n\t\t\t\treport.Error (1597, lexer.Location, \"Semicolon after method or accessor block is not valid\");\n\t\t\telse\n\t\t\t\treport.Error (1014, GetLocation (yyVals[0+yyTop]), \"A get or set accessor expected\");\n\t\t}\n\t  }\n\nvoid case_225()\n#line 1985 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) {\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), \"access modifiers on properties\");\n\t\t}\n\t  \n\t\tif (current_property.Get != null) {\n\t\t\treport.Error (1007, GetLocation (yyVals[0+yyTop]), \"Property accessor already defined\");\n\t\t}\n\t\t\n\t\tif (current_property is Indexer) {\n\t\t\tcurrent_property.Get = new Indexer.GetIndexerMethod (current_property, (Modifiers) yyVals[-1+yyTop], ((Indexer)current_property).ParameterInfo.Clone (),\n\t\t\t\t(Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tcurrent_property.Get = new Property.GetMethod (current_property,\n\t\t\t\t(Modifiers) yyVals[-1+yyTop], (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop]));\n\t\t}\t\n\t  \n\t\tcurrent_local_parameters = current_property.Get.ParameterInfo;\t  \n\t\tlexer.PropertyParsing = false;\n\t  }\n\nvoid case_226()\n#line 2006 \"cs-parser.jay\"\n{\n\t  \tif (yyVals[0+yyTop] != null) {\n\t  \t\tcurrent_property.Get.Block = (ToplevelBlock) yyVals[0+yyTop];\t\t\t\n\t  \t\n\t\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\t\treport.Error (531, current_property.Get.Block.StartLocation,\n\t\t\t\t\t\"`{0}': interface members cannot have a definition\", current_property.Get.GetSignatureForError ());\n\t\t\t}\n\t\t\tlbag.AddMember (current_property.Get, GetModifierLocations ());\n\t\t} else {\n\t\t\tlbag.AddMember (current_property.Get, GetModifierLocations (), savedLocation);\n\t\t}\n\t  \n\t\tcurrent_local_parameters = null;\n\t\tlexer.PropertyParsing = true;\n\n\t\tif (doc_support)\n\t\t\tif (Lexer.doc_state == XmlCommentState.Error)\n\t\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t  }\n\nvoid case_227()\n#line 2030 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) {\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), \"access modifiers on properties\");\n\t\t}\n\t\t\n\t\tif (current_property.Set != null) {\n\t\t\treport.Error (1007, GetLocation (yyVals[0+yyTop]), \"Property accessor already defined\");\n\t\t}\n\t  \n\t\tif (current_property is Indexer) {\n\t\t\tcurrent_property.Set = new Indexer.SetIndexerMethod (current_property, (Modifiers) yyVals[-1+yyTop],\n\t\t\t\tParametersCompiled.MergeGenerated (compiler,\n\t\t\t\t((Indexer)current_property).ParameterInfo, true, new Parameter (\n\t\t\t\t\tcurrent_property.TypeExpression, \"value\", Parameter.Modifier.NONE, null, GetLocation (yyVals[0+yyTop])),\n\t\t\t\t\tnull),\n\t\t\t\t(Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tcurrent_property.Set = new Property.SetMethod (current_property, (Modifiers) yyVals[-1+yyTop], \n\t\t\t\tParametersCompiled.CreateImplicitParameter (current_property.TypeExpression, GetLocation (yyVals[0+yyTop])),\n\t\t\t\t(Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = current_property.Set.ParameterInfo;\t\n\t\tlexer.PropertyParsing = false;\n\t  }\n\nvoid case_228()\n#line 2056 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null) {\t\t\n\t\t\tcurrent_property.Set.Block = (ToplevelBlock) yyVals[0+yyTop];\n\t\t\n\t\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\t\treport.Error (531, current_property.Set.Block.StartLocation,\n\t\t\t\t\t\"`{0}': interface members cannot have a definition\", current_property.Set.GetSignatureForError ());\n\t\t\t}\n\t\t\tlbag.AddMember (current_property.Set, GetModifierLocations ());\n\t\t} else {\n\t\t\tlbag.AddMember (current_property.Set, GetModifierLocations (), savedLocation);\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t\tlexer.PropertyParsing = true;\n\n\t\tif (doc_support\n\t\t\t&& Lexer.doc_state == XmlCommentState.Error)\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t  }\n\nvoid case_230()\n#line 2081 \"cs-parser.jay\"\n{\n\t\tsavedLocation = GetLocation (yyVals[0+yyTop]);\n\t  \tyyVal = null;\n\t  }\n\nvoid case_231()\n#line 2086 \"cs-parser.jay\"\n{\n\t  \tError_SyntaxError (1043, yyToken, \"Invalid accessor body\");\n\t  \tyyVal = null;\n\t  }\n\nvoid case_233()\n#line 2100 \"cs-parser.jay\"\n{\n\t\tlexer.ConstraintsParsing = true;\n\t\tpush_current_container (new Interface (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]);\n\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop]));\t\t\n\t  }\n\nvoid case_234()\n#line 2107 \"cs-parser.jay\"\n{\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\tcurrent_container.SetConstraints ((List<Constraints>) yyVals[0+yyTop]);\n\n\t\tif (doc_support) {\n\t\t\tcurrent_container.PartialContainer.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\nvoid case_235()\n#line 2121 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_declaration;\t  \n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_236()\n#line 2127 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] == null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t\t} else {\n\t\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\tyyVal = pop_current_class ();\n\t  }\n\nvoid case_240()\n#line 2148 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\nvoid case_241()\n#line 2153 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\nvoid case_252()\n#line 2191 \"cs-parser.jay\"\n{\n\t\tOperatorDeclaration decl = (OperatorDeclaration) yyVals[-2+yyTop];\n\t\tif (decl != null) {\n\t\t\tOperator op = new Operator (\n\t\t\t\tcurrent_type, decl.optype, decl.ret_type, (Modifiers) yyVals[-3+yyTop], \n\t\t\t\tcurrent_local_parameters,\n\t\t\t\t(ToplevelBlock) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop], decl.location);\n\t\t\t\t\n\t\t\tif (op.Block == null)\n\t\t\t\top.ParameterInfo.CheckParameters (op);\n\n\t\t\tif (doc_support) {\n\t\t\t\top.DocComment = tmpComment;\n\t\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t\t}\n\n\t\t\t/* Note again, checking is done in semantic analysis*/\n\t\t\tcurrent_type.AddOperator (op);\n\n\t\t\tlbag.AddMember (op, GetModifierLocations (), lbag.GetLocations (decl));\n\t\t\tif (yyVals[0+yyTop] == null) { /* Semicolon*/\n\t\t\t\tlbag.AddLocation (op, savedLocation); \n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_254()\n#line 2223 \"cs-parser.jay\"\n{\n\t\treport.Error (590, GetLocation (yyVals[0+yyTop]), \"User-defined operators cannot return void\");\n\t\tyyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_256()\n#line 2235 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\n\t\tLocation loc = GetLocation (yyVals[-5+yyTop]);\n\t\tOperator.OpType op = (Operator.OpType) yyVals[-4+yyTop];\n\t\tcurrent_local_parameters = (ParametersCompiled)yyVals[-1+yyTop];\n\t\t\n\t\tint p_count = current_local_parameters.Count;\n\t\tif (p_count == 1) {\n\t\t\tif (op == Operator.OpType.Addition)\n\t\t\t\top = Operator.OpType.UnaryPlus;\n\t\t\telse if (op == Operator.OpType.Subtraction)\n\t\t\t\top = Operator.OpType.UnaryNegation;\n\t\t}\n\t\t\n\t\tif (IsUnaryOperator (op)) {\n\t\t\tif (p_count == 2) {\n\t\t\t\treport.Error (1020, loc, \"Overloadable binary operator expected\");\n\t\t\t} else if (p_count != 1) {\n\t\t\t\treport.Error (1535, loc, \"Overloaded unary operator `{0}' takes one parameter\",\n\t\t\t\t\tOperator.GetName (op));\n\t\t\t}\n\t\t} else {\n\t\t\tif (p_count == 1) {\n\t\t\t\treport.Error (1019, loc, \"Overloadable unary operator expected\");\n\t\t\t} else if (p_count != 2) {\n\t\t\t\treport.Error (1534, loc, \"Overloaded binary operator `{0}' takes two parameters\",\n\t\t\t\t\tOperator.GetName (op));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\n\t\tyyVal = new OperatorDeclaration (op, (FullNamedExpression) yyVals[-6+yyTop], loc);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), savedOperatorLocation, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_281()\n#line 2311 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\n\t\tLocation loc = GetLocation (yyVals[-5+yyTop]);\n\t\tcurrent_local_parameters = (ParametersCompiled)yyVals[-1+yyTop];  \n\n\t\tif (current_local_parameters.Count != 1) {\n\t\t\treport.Error (1535, loc, \"Overloaded unary operator `implicit' takes one parameter\");\n\t\t}\n\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\n\t\tyyVal = new OperatorDeclaration (Operator.OpType.Implicit, (FullNamedExpression) yyVals[-4+yyTop], loc);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_283()\n#line 2334 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\t\t\n\t\tLocation loc = GetLocation (yyVals[-5+yyTop]);\n\t\tcurrent_local_parameters = (ParametersCompiled)yyVals[-1+yyTop];  \n\n\t\tif (current_local_parameters.Count != 1) {\n\t\t\treport.Error (1535, loc, \"Overloaded unary operator `explicit' takes one parameter\");\n\t\t}\n\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\n\t\tyyVal = new OperatorDeclaration (Operator.OpType.Explicit, (FullNamedExpression) yyVals[-4+yyTop], loc);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_284()\n#line 2353 \"cs-parser.jay\"\n{\n\t  \tError_SyntaxError (yyToken);\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\tyyVal = new OperatorDeclaration (Operator.OpType.Implicit, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_285()\n#line 2359 \"cs-parser.jay\"\n{\n\t  \tError_SyntaxError (yyToken);\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  \tyyVal = new OperatorDeclaration (Operator.OpType.Explicit, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_286()\n#line 2369 \"cs-parser.jay\"\n{ \n\t\tConstructor c = (Constructor) yyVals[-1+yyTop];\n\t\tc.Block = (ToplevelBlock) yyVals[0+yyTop];\n\t\t\n\t\tif (doc_support)\n\t\t\tc.DocComment = ConsumeStoredComment ();\n\n\t\tcurrent_local_parameters = null;\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_287()\n#line 2386 \"cs-parser.jay\"\n{\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tvalid_param_mod = ParameterModifierType.All;\n\t  }\n\nvoid case_288()\n#line 2395 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\t\tcurrent_local_parameters = (ParametersCompiled) yyVals[-1+yyTop];\n\t\t\n\t\tvar lt = (LocatedToken) yyVals[-4+yyTop];\n\t\tvar mods = (Modifiers) yyVals[-5+yyTop];\n\t\tvar c = new Constructor (current_type, lt.Value, mods, (Attributes) yyVals[-6+yyTop], current_local_parameters, lt.Location);\n\n\t\tif (lt.Value != current_container.MemberName.Name) {\n\t\t\treport.Error (1520, c.Location, \"Class, struct, or interface method must have a return type\");\n\t\t} else if ((mods & Modifiers.STATIC) != 0) {\n\t\t\tif ((mods & Modifiers.AccessibilityMask) != 0){\n\t\t\t\treport.Error (515, c.Location,\n\t\t\t\t\t\"`{0}': static constructor cannot have an access modifier\",\n\t\t\t\t\tc.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tcurrent_type.AddConstructor (c);\n\t\tlbag.AddMember (c, GetModifierLocations (), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = c;\n\n\t\t/**/\n\t\t/* start block here, so possible anonymous methods inside*/\n\t\t/* constructor initializer can get correct parent block*/\n\t\t/**/\n\t  \tstart_block (lexer.Location);\n\t  }\n\nvoid case_289()\n#line 2424 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tvar c = (Constructor) yyVals[-1+yyTop];\n\t\t\tc.Initializer = (ConstructorInitializer) yyVals[0+yyTop];\n\t\t\t\n\t\t\tif (c.IsStatic) {\n\t\t\t\treport.Error (514, c.Location,\n\t\t\t\t\t\"`{0}': static constructor cannot have an explicit `this' or `base' constructor call\",\n\t\t\t\t\tc.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tyyVal = yyVals[-1+yyTop];\n\t  }\n\nvoid case_295()\n#line 2456 \"cs-parser.jay\"\n{\n\t  \t--lexer.parsing_block;\n\t\tyyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_297()\n#line 2466 \"cs-parser.jay\"\n{\n\t  \t--lexer.parsing_block;\n\t\tyyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_298()\n#line 2472 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\t  \n\t\tyyVal = new ConstructorThisInitializer (null, GetLocation (yyVals[0+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_299()\n#line 2478 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = null;\n\t  }\n\nvoid case_300()\n#line 2486 \"cs-parser.jay\"\n{\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  }\n\nvoid case_301()\n#line 2495 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tif (lt.Value != current_container.MemberName.Name){\n\t\t\treport.Error (574, lt.Location, \"Name of destructor must match name of class\");\n\t\t} else if (current_container.Kind != MemberKind.Class){\n\t\t\treport.Error (575, lt.Location, \"Only class types can contain destructor\");\n\t\t}\n\t\t\n\t\tDestructor d = new Destructor (current_type, (Modifiers) yyVals[-6+yyTop],\n\t\t\tParametersCompiled.EmptyReadOnlyParameters, (Attributes) yyVals[-7+yyTop], lt.Location);\n\t\td.Identifier = lt.Value;\n\t\tif (doc_support)\n\t\t\td.DocComment = ConsumeStoredComment ();\n\t\t  \n\t\td.Block = (ToplevelBlock) yyVals[0+yyTop];\n\t\tcurrent_type.AddMember (d);\n\t\tlbag.AddMember (d, GetModifierLocations (), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_302()\n#line 2521 \"cs-parser.jay\"\n{\n\t\tcurrent_event_field = new EventField (current_type, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop], (MemberName) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop]);\n\t\tcurrent_type.AddMember (current_event_field);\n\t\t\n\t\tif (current_event_field.MemberName.ExplicitInterface != null) {\n\t\t\treport.Error (71, current_event_field.Location, \"`{0}': An explicit interface implementation of an event must use property syntax\",\n\t\t\tcurrent_event_field.GetSignatureForError ());\n\t\t}\n\t\t\n\t\tyyVal = current_event_field;\n\t  }\n\nvoid case_303()\n#line 2535 \"cs-parser.jay\"\n{\n\t\tif (doc_support) {\n\t\t\tcurrent_event_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\tif (current_event_field.Initializer != null) {\n\t\t\tlbag.AddMember (current_event_field, GetModifierLocations (), GetLocation (yyVals[-6+yyTop]), savedEventAssignLocation, GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tlbag.AddMember (current_event_field, GetModifierLocations (), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\tcurrent_event_field = null;\n\t  }\n\nvoid case_304()\n#line 2551 \"cs-parser.jay\"\n{\n\t\tcurrent_event = new EventProperty (current_type, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-4+yyTop], (MemberName) yyVals[-1+yyTop], (Attributes) yyVals[-5+yyTop]);\n\t\tcurrent_type.AddMember (current_event);\n\t\tlbag.AddMember (current_event, GetModifierLocations (), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t\n\t\tlexer.EventParsing = true;\n\t  }\n\nvoid case_305()\n#line 2559 \"cs-parser.jay\"\n{\n\t\tif (current_container.Kind == MemberKind.Interface)\n\t\t\treport.Error (69, GetLocation (yyVals[-2+yyTop]), \"Event in interface cannot have add or remove accessors\");\n\t  \n\t\tlexer.EventParsing = false;\n\t  }\n\nvoid case_306()\n#line 2566 \"cs-parser.jay\"\n{\n\t\tif (doc_support) {\n\t\t\tcurrent_event.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tlbag.AppendToMember (current_event, GetLocation (yyVals[-1+yyTop]));\n\t  \tcurrent_event = null;\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_307()\n#line 2579 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tcurrent_type.AddMember (new EventField (current_type, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop], MemberName.Null, (Attributes) yyVals[-4+yyTop]));\n\t  }\n\nvoid case_310()\n#line 2593 \"cs-parser.jay\"\n{\n\t  \t--lexer.parsing_block;\n\t  \tsavedEventAssignLocation = GetLocation (yyVals[-2+yyTop]);\n\t\tcurrent_event_field.Initializer = (Expression) yyVals[0+yyTop];\n\t  }\n\nvoid case_315()\n#line 2618 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t  \tyyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_317()\n#line 2628 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\t  \n\t  \tyyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop]);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_318()\n#line 2637 \"cs-parser.jay\"\n{\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (68, lexer.Location, \"`{0}': event in interface cannot have an initializer\",\n\t\t\t\tcurrent_event_field.GetSignatureForError ());\n\t\t}\n\t\t\n\t  \tif ((current_event_field.ModFlags & Modifiers.ABSTRACT) != 0) {\n\t\t\treport.Error (74, lexer.Location, \"`{0}': abstract event cannot have an initializer\",\n\t\t\t\tcurrent_event_field.GetSignatureForError ());\n\t  \t}\t\t\n\t  }\n\nvoid case_322()\n#line 2658 \"cs-parser.jay\"\n{\n\t\treport.Error (65, lexer.Location, \"`{0}': event property must have both add and remove accessors\",\n\t\t\tcurrent_event.GetSignatureForError ());\n\t  }\n\nvoid case_323()\n#line 2663 \"cs-parser.jay\"\n{\n\t\treport.Error (65, lexer.Location, \"`{0}': event property must have both add and remove accessors\",\n\t\t\tcurrent_event.GetSignatureForError ());\n\t  }\n\nvoid case_324()\n#line 2668 \"cs-parser.jay\"\n{ \n\t\treport.Error (1055, GetLocation (yyVals[0+yyTop]), \"An add or remove accessor expected\");\n\t\tyyVal = null;\n\t  }\n\nvoid case_325()\n#line 2676 \"cs-parser.jay\"\n{\n\t  \tif (yyVals[-1+yyTop] != ModifierNone) {\n\t\t\treport.Error (1609, GetLocation (yyVals[-1+yyTop]), \"Modifiers cannot be placed on event accessor declarations\");\n\t  \t}\n\t  \t\n\t  \tcurrent_event.Add = new EventProperty.AddDelegateMethod (current_event, (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop]));\n\t\tcurrent_local_parameters = current_event.Add.ParameterInfo;\n\t\t\n\t\tlbag.AddMember (current_event.Add, GetModifierLocations ());\n\t\tlexer.EventParsing = false;\t\t\n\t  }\n\nvoid case_326()\n#line 2688 \"cs-parser.jay\"\n{\n\t\tlexer.EventParsing = true;\n\t  \n\t  \tcurrent_event.Add.Block = (ToplevelBlock) yyVals[0+yyTop];\n\t\t\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (531, current_event.Add.Block.StartLocation,\n\t\t\t\t\"`{0}': interface members cannot have a definition\", current_event.Add.GetSignatureForError ());\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_327()\n#line 2704 \"cs-parser.jay\"\n{\n\t  \tif (yyVals[-1+yyTop] != ModifierNone) {\n\t\t\treport.Error (1609, GetLocation (yyVals[-1+yyTop]), \"Modifiers cannot be placed on event accessor declarations\");\n\t  \t}\n\t  \t\n\t  \tcurrent_event.Remove = new EventProperty.RemoveDelegateMethod (current_event, (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop]));\n\t\tcurrent_local_parameters = current_event.Remove.ParameterInfo;\n\n\t\tlbag.AddMember (current_event.Remove, GetModifierLocations ());\n\t\tlexer.EventParsing = false;\t\t\n\t  }\n\nvoid case_328()\n#line 2716 \"cs-parser.jay\"\n{\n\t\tlexer.EventParsing = true;\n\t  \n\t  \tcurrent_event.Remove.Block = (ToplevelBlock) yyVals[0+yyTop];\n\t\t\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (531, current_event.Remove.Block.StartLocation,\n\t\t\t\t\"`{0}': interface members cannot have a definition\", current_event.Remove.GetSignatureForError ());\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_329()\n#line 2732 \"cs-parser.jay\"\n{\n\t\treport.Error (73, lexer.Location, \"An add or remove accessor must have a body\");\n\t\tyyVal = null;\n\t  }\n\nvoid case_331()\n#line 2741 \"cs-parser.jay\"\n{\n\t\tcurrent_type.UnattachedAttributes = (Attributes) yyVals[-1+yyTop];\n\t\treport.Error (1519, GetLocation (yyVals[-1+yyTop]), \"An attribute is missing member declaration\");\n\t\tlexer.putback ('}');\n\t  }\n\nvoid case_332()\n#line 2752 \"cs-parser.jay\"\n{\n\t\treport.Error (1519, lexer.Location, \"Unexpected symbol `}' in class, struct, or interface member declaration\");\n \n\t\tlexer.putback ('}');\n\n\t  \tlexer.parsing_generic_declaration = false;\n\t\tFullNamedExpression type = (FullNamedExpression) yyVals[-1+yyTop];\n\t\tcurrent_field = new Field (current_type, type, (Modifiers) yyVals[-2+yyTop], MemberName.Null, (Attributes) yyVals[-3+yyTop]);\n\t\tcurrent_type.AddField (current_field);\n\t\tlbag.AddMember (current_field, GetModifierLocations ());\n\t\tyyVal = current_field;\n\t  }\n\nvoid case_333()\n#line 2772 \"cs-parser.jay\"\n{\n\t\tif (doc_support)\n\t\t\tenumTypeComment = Lexer.consume_doc_comment ();\n\t  }\n\nvoid case_334()\n#line 2777 \"cs-parser.jay\"\n{\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\n\t\tMemberName name = (MemberName) yyVals[-3+yyTop];\n\t\tif (name.IsGeneric) {\n\t\t\treport.Error (1675, name.Location, \"Enums cannot have type parameters\");\n\t\t}\n\t\t\n\t\tpush_current_container (new Enum (current_container, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-5+yyTop], name, (Attributes) yyVals[-6+yyTop]), null);\n\t\tif (yyVals[-2+yyTop] != null) {\n\t\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-4+yyTop]), savedLocation, GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t  }\n\nvoid case_335()\n#line 2794 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_modifiers = true;\n\t  \n\t  \t/* here will be evaluated after CLOSE_BLACE is consumed.*/\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_336()\n#line 2802 \"cs-parser.jay\"\n{\n\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-1+yyTop]));\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\tif (doc_support)\n\t\t\tcurrent_container.DocComment = enumTypeComment;\n\t\t\t\n\t\t--lexer.parsing_declaration;\n\n/*\t\t\tif (doc_support)*/\n/*\t\t\t\tem.DocComment = ev.DocComment;*/\n\n\t\tyyVal = pop_current_class ();\n\t  }\n\nvoid case_338()\n#line 2822 \"cs-parser.jay\"\n{\n\t\tsavedLocation = GetLocation (yyVals[-1+yyTop]);\n\t\tyyVal = yyVals[0+yyTop];\n\t }\n\nvoid case_339()\n#line 2827 \"cs-parser.jay\"\n{\n\t \tError_TypeExpected (GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = null;\n\t }\n\nvoid case_344()\n#line 2845 \"cs-parser.jay\"\n{\n\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-1+yyTop]));\n\t  \tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_345()\n#line 2853 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t  \tvar em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-1+yyTop]);\n\t  \t((Enum) current_type).AddEnumMember (em);\n\n\t\tif (doc_support) {\n\t\t\tem.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\n\t\tyyVal = em;\n\t  }\n\nvoid case_346()\n#line 2866 \"cs-parser.jay\"\n{\n\t  \t++lexer.parsing_block;\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\t  }\n\nvoid case_347()\n#line 2874 \"cs-parser.jay\"\n{ \n\t\t--lexer.parsing_block;\n\t\t\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t  \tvar em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);\n\t  \tem.Initializer = new ConstInitializer (em, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  \t((Enum) current_type).AddEnumMember (em);\n\t\t\n\t\tif (doc_support)\n\t\t\tem.DocComment = ConsumeStoredComment ();\n\n\t\tyyVal = em;\n\t  }\n\nvoid case_348()\n#line 2888 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t  \tvar em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-2+yyTop]);\n\t  \t((Enum) current_type).AddEnumMember (em);\n\n\t\tif (doc_support) {\n\t\t\tem.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\n\t\tyyVal = em;\n\t  }\n\nvoid case_351()\n#line 2915 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\n\t\tParametersCompiled p = (ParametersCompiled) yyVals[-1+yyTop];\n\n\t\tDelegate del = new Delegate (current_container, (FullNamedExpression) yyVals[-5+yyTop], (Modifiers) yyVals[-7+yyTop], (MemberName) yyVals[-4+yyTop], p, (Attributes) yyVals[-8+yyTop]);\n\n\t\tp.CheckParameters (del);\n\n\t\tcurrent_container.AddTypeContainer (del);\n\n\t\tcurrent_delegate = del;\n\t\tlexer.ConstraintsParsing = true;\n\t  }\n\nvoid case_353()\n#line 2934 \"cs-parser.jay\"\n{\n\t\tif (doc_support) {\n\t\t\tcurrent_delegate.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t  \n\t\tif (yyVals[-2+yyTop] != null)\n\t\t\tcurrent_delegate.SetConstraints ((List<Constraints>) yyVals[-2+yyTop]);\n\t\tlbag.AddMember (current_delegate, GetModifierLocations (), GetLocation (yyVals[-10+yyTop]), GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[0+yyTop]));\n\n\t\tyyVal = current_delegate;\n\n\t\tcurrent_delegate = null;\n\t  }\n\nvoid case_355()\n#line 2953 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), \"nullable types\");\n\t  \n\t  \tyyVal = ComposedTypeSpecifier.CreateNullable (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_357()\n#line 2964 \"cs-parser.jay\"\n{\n\t\tvar lt1 = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar lt2 = (LocatedToken) yyVals[-1+yyTop];\n\t\t\n\t\tyyVal = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) yyVals[0+yyTop], lt1.Location);\n\t\tlbag.AddLocation (yyVal, savedLocation, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_358()\n#line 2972 \"cs-parser.jay\"\n{\n\t\tvar lt1 = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar lt2 = (LocatedToken) yyVals[-1+yyTop];\n\t\tvar qam = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) yyVals[0+yyTop], lt1.Location);\n\t\tlbag.AddLocation (qam.TypeArguments, Lexer.GenericDimensionLocations);\n\t\tyyVal = qam;\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_360()\n#line 2985 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_361()\n#line 2991 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tvar ma = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (int) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (ma.TypeArguments, Lexer.GenericDimensionLocations);\n\t\tyyVal = ma;\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_362()\n#line 3002 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location);\n\t  }\n\nvoid case_363()\n#line 3007 \"cs-parser.jay\"\n{  \n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tvar sn = new SimpleName (lt.Value, (int) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (sn.TypeArguments, Lexer.GenericDimensionLocations);\n\t\tyyVal = sn;\n\t  }\n\nvoid case_365()\n#line 3021 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), \"generics\");\n\t\tvar list = locationListStack.Pop ();\n\t\tlist.Add (GetLocation (yyVals[-2+yyTop]));\n\t\tlist.Add (GetLocation (yyVals[-1+yyTop]));\n\t\tlbag.AddLocation (yyVals[-1+yyTop], list);\n\t\n\t\tyyVal = yyVals[-1+yyTop];;\n\t  }\n\nvoid case_366()\n#line 3032 \"cs-parser.jay\"\n{\n\t\tError_TypeExpected (lexer.Location);\n\t\tyyVal = new TypeArguments ();\n\t  }\n\nvoid case_367()\n#line 3040 \"cs-parser.jay\"\n{\n\t\tTypeArguments type_args = new TypeArguments ();\n\t\ttype_args.Add ((FullNamedExpression) yyVals[0+yyTop]);\n\t\tyyVal = type_args;\n\t\tlocationListStack.Push (new List<Location> ());\n\t  }\n\nvoid case_368()\n#line 3047 \"cs-parser.jay\"\n{\n\t\tTypeArguments type_args = (TypeArguments) yyVals[-2+yyTop];\n\t\ttype_args.Add ((FullNamedExpression) yyVals[0+yyTop]);\n\t\tyyVal = type_args;\n\t\tlocationListStack.Peek ().Add (GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_370()\n#line 3064 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_generic_declaration = false;\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tyyVal = new MemberName (lt.Value, (TypeParameters)yyVals[0+yyTop], lt.Location);\n\t  }\n\nvoid case_371()\n#line 3073 \"cs-parser.jay\"\n{\n\t  \tMemberName mn = (MemberName)yyVals[0+yyTop];\n\t  \tif (mn.TypeParameters != null)\n\t  \t\tsyntax_error (mn.Location, string.Format (\"Member `{0}' cannot declare type arguments\",\n\t  \t\t\tmn.GetSignatureForError ()));\n\t  }\n\nvoid case_373()\n#line 3084 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_generic_declaration = false;\t  \n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberName (lt.Value, (TypeParameters) yyVals[0+yyTop], (ATypeNameExpression) yyVals[-2+yyTop], lt.Location);\n\t  }\n\nvoid case_374()\n#line 3093 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_generic_declaration = false;\t  \n\t\tyyVal = new MemberName (TypeDefinition.DefaultIndexerName, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_375()\n#line 3098 \"cs-parser.jay\"\n{\n\t\tlexer.parsing_generic_declaration = false;\n\t\tyyVal = new MemberName (TypeDefinition.DefaultIndexerName, null, (ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_376()\n#line 3106 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tyyVal = new SimpleName (lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_377()\n#line 3112 \"cs-parser.jay\"\n{\n\t\tvar lt1 = (LocatedToken) yyVals[-3+yyTop];\n\t\tvar lt2 = (LocatedToken) yyVals[-2+yyTop];\n\n\t\tyyVal = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) yyVals[-1+yyTop], lt1.Location);\n\t\tlbag.AddLocation (yyVal, savedLocation, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_378()\n#line 3120 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tyyVal = new MemberAccess ((ATypeNameExpression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_380()\n#line 3130 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), \"generics\");\n\t  \n\t\tyyVal = yyVals[-1+yyTop];\n\t\tvar list = locationListStack.Pop ();\n\t\tlist.Add (GetLocation (yyVals[-2+yyTop]));\n\t\tlist.Add (GetLocation (yyVals[-1+yyTop]));\n\t\tlbag.AddLocation (yyVals[-1+yyTop], list);\n\t  }\n\nvoid case_381()\n#line 3144 \"cs-parser.jay\"\n{\n\t\tvar tparams = new TypeParameters ();\n\t\ttparams.Add ((TypeParameter)yyVals[0+yyTop]);\n\t\tyyVal = tparams;\n\t\tlocationListStack.Push (new List<Location> ());\n\t  }\n\nvoid case_382()\n#line 3151 \"cs-parser.jay\"\n{\n\t\tvar tparams = (TypeParameters) yyVals[-2+yyTop];\n\t\ttparams.Add ((TypeParameter)yyVals[0+yyTop]);\n\t\tyyVal = tparams;\n\t\tlocationListStack.Peek ().Add (GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_383()\n#line 3161 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken)yyVals[0+yyTop];\n\t\tvar variance = (VarianceDecl) yyVals[-1+yyTop];\n\t\tyyVal = new TypeParameter (new MemberName (lt.Value, lt.Location), (Attributes)yyVals[-2+yyTop], variance);\n\t\tif (variance != null)\n\t\t\tlbag.AddLocation (yyVal, savedLocation);\n  \t  }\n\nvoid case_384()\n#line 3169 \"cs-parser.jay\"\n{\n  \t  \tif (GetTokenName (yyToken) == \"type\")\n\t\t\treport.Error (81, GetLocation (yyVals[0+yyTop]), \"Type parameter declaration must be an identifier not a type\");\n\t\telse\n\t\t\tError_SyntaxError (yyToken);\n\t\t\t\n  \t  \tyyVal = new TypeParameter (MemberName.Null, null, null);\n  \t  }\n\nvoid case_393()\n#line 3213 \"cs-parser.jay\"\n{\n\t\treport.Error (1536, GetLocation (yyVals[0+yyTop]), \"Invalid parameter type `void'\");\n\t\tyyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_396()\n#line 3229 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tyyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t\t} else {\n\t\t\tvar sn = yyVals[-1+yyTop] as SimpleName;\n\t\t\tif (sn != null && sn.Name == \"var\")\n\t\t\t\tyyVal = new VarExpr (sn.Location);\n\t\t\telse\n\t\t\t\tyyVal = yyVals[-1+yyTop];\n\t\t}\n\t  }\n\nvoid case_399()\n#line 3249 \"cs-parser.jay\"\n{\n\t\tExpression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report);\n\t\tyyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_400()\n#line 3257 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\tyyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t  }\n\nvoid case_403()\n#line 3273 \"cs-parser.jay\"\n{\n\t\tvar types = new List<FullNamedExpression> (2);\n\t\ttypes.Add ((FullNamedExpression) yyVals[0+yyTop]);\n\t\tyyVal = types;\n\t  }\n\nvoid case_404()\n#line 3279 \"cs-parser.jay\"\n{\n\t\tvar types = (List<FullNamedExpression>) yyVals[-2+yyTop];\n\t\ttypes.Add ((FullNamedExpression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (types, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = types;\n\t  }\n\nvoid case_405()\n#line 3289 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is ComposedCast) {\n\t\t\treport.Error (1521, GetLocation (yyVals[0+yyTop]), \"Invalid base type `{0}'\", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ());\n\t\t}\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_443()\n#line 3353 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t       yyVal = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location);\n\t  }\n\nvoid case_454()\n#line 3394 \"cs-parser.jay\"\n{\n\t\tyyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_456()\n#line 3406 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_457()\n#line 3412 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tvar ma = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (int) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (ma.TypeArguments, Lexer.GenericDimensionLocations);\n\t\tyyVal = ma;\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_458()\n#line 3420 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), \"null propagating operator\");\n\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new ConditionalMemberAccess ((Expression) yyVals[-4+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_459()\n#line 3429 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_460()\n#line 3435 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_461()\n#line 3441 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberAccess (new SimpleName (\"await\", ((LocatedToken) yyVals[-3+yyTop]).Location), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_462()\n#line 3447 \"cs-parser.jay\"\n{\n\t\tvar lt1 = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar lt2 = (LocatedToken) yyVals[-1+yyTop];\n\n\t\tyyVal = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) yyVals[0+yyTop], lt1.Location);\n\t\tlbag.AddLocation (yyVal, savedLocation, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_463()\n#line 3455 \"cs-parser.jay\"\n{\n\t\tvar lt1 = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar lt2 = (LocatedToken) yyVals[-1+yyTop];\n\t\tvar qam = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) yyVals[0+yyTop], lt1.Location);\n\t\tlbag.AddLocation (qam.TypeArguments, Lexer.GenericDimensionLocations);\n\t\tyyVal = qam;\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_465()\n#line 3466 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location);\n\t  }\n\nvoid case_467()\n#line 3474 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location);\n \t  }\n\nvoid case_468()\n#line 3482 \"cs-parser.jay\"\n{\n\t\tyyVal = new Invocation ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_469()\n#line 3487 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Invocation ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_470()\n#line 3494 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Invocation ((Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_473()\n#line 3509 \"cs-parser.jay\"\n{\n\t  \tif (yyVals[-1+yyTop] == null) {\n\t  \t\tyyVal = new CollectionOrObjectInitializers (GetLocation (yyVals[-2+yyTop]));\n\t  \t} else {\n\t  \t\tyyVal = new CollectionOrObjectInitializers ((List<Expression>) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  \t}\n \t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_474()\n#line 3518 \"cs-parser.jay\"\n{\n\t  \tyyVal = new CollectionOrObjectInitializers ((List<Expression>) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_477()\n#line 3534 \"cs-parser.jay\"\n{\n\t  \tvar a = new List<Expression> ();\n\t  \ta.Add ((Expression) yyVals[0+yyTop]);\n\t  \tyyVal = a;\n\t  }\n\nvoid case_478()\n#line 3540 \"cs-parser.jay\"\n{\n\t  \tvar a = (List<Expression>)yyVals[-2+yyTop];\n\t  \ta.Add ((Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (a, GetLocation (yyVals[-1+yyTop]));\n\t  \tyyVal = a;\n\t  }\n\nvoid case_479()\n#line 3546 \"cs-parser.jay\"\n{\n\t  \tError_SyntaxError (yyToken);\n\t\tyyVal = yyVals[-1+yyTop];\n\t  }\n\nvoid case_480()\n#line 3554 \"cs-parser.jay\"\n{\n\t  \tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t  \tyyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_481()\n#line 3560 \"cs-parser.jay\"\n{\n\t  \tvar lt = (LocatedToken) Error_AwaitAsIdentifier (yyVals[-2+yyTop]);\n\t  \tyyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_483()\n#line 3569 \"cs-parser.jay\"\n{\n\t\tCompletionSimpleName csn = yyVals[-1+yyTop] as CompletionSimpleName;\n\t\tif (csn == null)\n\t\t\tyyVal = new CollectionElementInitializer ((Expression)yyVals[-1+yyTop]);\n\t\telse\n\t\t\tyyVal = new CompletionElementInitializer (csn.Prefix, csn.Location);\n\t  }\n\nvoid case_484()\n#line 3577 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-1+yyTop] == null)\n\t\t\tyyVal = new CollectionElementInitializer (GetLocation (yyVals[-2+yyTop]));\n\t\telse {\n\t  \t\tyyVal = new CollectionElementInitializer ((List<Expression>)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t\t}\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_485()\n#line 3587 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-4+yyTop]), \"dictionary initializer\");\n\n\t\tyyVal = new DictionaryElementInitializer ((List<Expression>)yyVals[-3+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_486()\n#line 3595 \"cs-parser.jay\"\n{\n\t  \treport.Error (1920, GetLocation (yyVals[-1+yyTop]), \"An element initializer cannot be empty\");\n\t\tyyVal = new CollectionElementInitializer (GetLocation (yyVals[-1+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_491()\n#line 3614 \"cs-parser.jay\"\n{ \n\t\tArguments list = new Arguments (4);\n\t\tlist.Add ((Argument) yyVals[0+yyTop]);\n\t\tyyVal = list;\n\t  }\n\nvoid case_492()\n#line 3620 \"cs-parser.jay\"\n{\n\t\tArguments list = (Arguments) yyVals[-2+yyTop];\n\t\tif (list [list.Count - 1] is NamedArgument)\n\t\t\tError_NamedArgumentExpected ((NamedArgument) list [list.Count - 1]);\n\t\t\n\t\tlist.Add ((Argument) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (list, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = list;\n\t  }\n\nvoid case_493()\n#line 3630 \"cs-parser.jay\"\n{\n\t\tArguments list = (Arguments) yyVals[-2+yyTop];\n\t\tNamedArgument a = (NamedArgument) yyVals[0+yyTop];\n\t\tfor (int i = 0; i < list.Count; ++i) {\n\t\t\tNamedArgument na = list [i] as NamedArgument;\n\t\t\tif (na != null && na.Name == a.Name)\n\t\t\t\treport.Error (1740, na.Location, \"Named argument `{0}' specified multiple times\",\n\t\t\t\t\tna.Name);\n\t\t}\n\t\t\n\t\tlist.Add (a);\n\t\tlbag.AddLocation (list, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = list;\n\t  }\n\nvoid case_494()\n#line 3645 \"cs-parser.jay\"\n{\n\t  \tif (lexer.putback_char == -1)\n\t  \t\tlexer.putback (')'); /* TODO: Wrong but what can I do*/\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = yyVals[-2+yyTop];\n\t  }\n\nvoid case_495()\n#line 3652 \"cs-parser.jay\"\n{\n\t  \treport.Error (839, GetLocation (yyVals[-1+yyTop]), \"An argument is missing\");\n\t  \tyyVal = null;\n\t  }\n\nvoid case_500()\n#line 3673 \"cs-parser.jay\"\n{ \n\t\tyyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_501()\n#line 3678 \"cs-parser.jay\"\n{ \n\t\tyyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_502()\n#line 3683 \"cs-parser.jay\"\n{\n\t\tyyVal = new Argument (new Arglist ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_503()\n#line 3688 \"cs-parser.jay\"\n{\n\t\tyyVal = new Argument (new Arglist (GetLocation (yyVals[-2+yyTop])));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_505()\n#line 3700 \"cs-parser.jay\"\n{\n\t\tyyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_506()\n#line 3705 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), \"null propagating operator\");\n\n\t\tyyVal = new ElementAccess ((Expression) yyVals[-4+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])) {\n\t\t\tConditionalAccess = true\n\t\t};\n\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_507()\n#line 3716 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_508()\n#line 3721 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new ElementAccess ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_509()\n#line 3729 \"cs-parser.jay\"\n{\n\t\tvar list = new List<Expression> (4);\n\t\tlist.Add ((Expression) yyVals[0+yyTop]);\n\t\tyyVal = list;\n\t  }\n\nvoid case_510()\n#line 3735 \"cs-parser.jay\"\n{\n\t\tvar list = (List<Expression>) yyVals[-2+yyTop];\n\t\tlist.Add ((Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (list, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = list;\n\t  }\n\nvoid case_511()\n#line 3745 \"cs-parser.jay\"\n{\n\t\tArguments args = new Arguments (4);\n\t\targs.Add ((Argument) yyVals[0+yyTop]);\n\t\tyyVal = args;\n\t  }\n\nvoid case_512()\n#line 3751 \"cs-parser.jay\"\n{\n\t\tArguments args = (Arguments) yyVals[-2+yyTop];\n\t\tif (args [args.Count - 1] is NamedArgument && !(yyVals[0+yyTop] is NamedArgument))\n\t\t\tError_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]);\n\t  \n\t\targs.Add ((Argument) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (args, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = args;\t  \n\t  }\n\nvoid case_516()\n#line 3779 \"cs-parser.jay\"\n{\n\t  \tyyVal = new ElementAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_517()\n#line 3784 \"cs-parser.jay\"\n{\n\t  \tError_SyntaxError (yyToken);\n\t\tyyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_520()\n#line 3806 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-5+yyTop]), \"object initializers\");\n\t\t\t\t\n\t\t\tyyVal = new NewInitialize ((FullNamedExpression) yyVals[-4+yyTop], (Arguments) yyVals[-2+yyTop], (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop]));\n\t\t} else {\n\t\t\tyyVal = new New ((FullNamedExpression) yyVals[-4+yyTop], (Arguments) yyVals[-2+yyTop], GetLocation (yyVals[-5+yyTop]));\n\t\t}\n\t\t\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_521()\n#line 3819 \"cs-parser.jay\"\n{\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), \"collection initializers\");\n\t  \n\t\tyyVal = new NewInitialize ((FullNamedExpression) yyVals[-1+yyTop], null, (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_522()\n#line 3831 \"cs-parser.jay\"\n{\n\t\tyyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], (List<Expression>) yyVals[-3+yyTop],\n\t\t\t\tnew ComposedTypeSpecifier (((List<Expression>) yyVals[-3+yyTop]).Count, GetLocation (yyVals[-4+yyTop])) {\n\t  \t\t\t\tNext = (ComposedTypeSpecifier) yyVals[-1+yyTop]\n\t\t\t  \t}, (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_523()\n#line 3839 \"cs-parser.jay\"\n{\n\t  \tif (yyVals[0+yyTop] == null)\n\t  \t\treport.Error (1586, GetLocation (yyVals[-3+yyTop]), \"Array creation must have array size or array initializer\");\n\n\t\tyyVal = new ArrayCreation ((FullNamedExpression) yyVals[-2+yyTop], (ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t  }\n\nvoid case_524()\n#line 3846 \"cs-parser.jay\"\n{\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), \"implicitly typed arrays\");\n\t  \n\t\tyyVal = new ImplicitlyTypedArrayCreation ((ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_525()\n#line 3853 \"cs-parser.jay\"\n{\n\t\treport.Error (178, GetLocation (yyVals[-1+yyTop]), \"Invalid rank specifier, expecting `,' or `]'\");\n\t\tyyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], null, GetLocation (yyVals[-6+yyTop]));\n\t  }\n\nvoid case_526()\n#line 3858 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\t/* It can be any of new expression, create the most common one*/\n\t\tyyVal = new New ((FullNamedExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_528()\n#line 3870 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_type;\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_529()\n#line 3878 \"cs-parser.jay\"\n{\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t  \t\tFeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), \"anonymous types\");\n\n\t\tyyVal = new NewAnonymousType ((List<AnonymousTypeParameter>) yyVals[-1+yyTop], current_container, GetLocation (yyVals[-3+yyTop]));\n\t\t\n\t\t/* TODO: lbag comma location*/\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_535()\n#line 3905 \"cs-parser.jay\"\n{\n\t  \tvar a = new List<AnonymousTypeParameter> (4);\n\t  \ta.Add ((AnonymousTypeParameter) yyVals[0+yyTop]);\n\t  \tyyVal = a;\n\t  }\n\nvoid case_536()\n#line 3911 \"cs-parser.jay\"\n{\n\t  \tvar a = (List<AnonymousTypeParameter>) yyVals[-2+yyTop];\n\t  \ta.Add ((AnonymousTypeParameter) yyVals[0+yyTop]);\n\t  \tlbag.AddLocation (a, GetLocation (yyVals[-1+yyTop]));\n\n\t  \tyyVal = a;\n\t  }\n\nvoid case_539()\n#line 3930 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken)yyVals[-2+yyTop];\n\t  \tyyVal = new AnonymousTypeParameter ((Expression)yyVals[0+yyTop], lt.Value, lt.Location);\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_540()\n#line 3936 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken)yyVals[0+yyTop];\n\t  \tyyVal = new AnonymousTypeParameter (new SimpleName (lt.Value, lt.Location),\n\t  \t\tlt.Value, lt.Location);\n\t  }\n\nvoid case_541()\n#line 3942 \"cs-parser.jay\"\n{\n\t  \tMemberAccess ma = (MemberAccess) yyVals[0+yyTop];\n\t  \tyyVal = new AnonymousTypeParameter (ma, ma.Name, ma.Location);\n\t  }\n\nvoid case_542()\n#line 3947 \"cs-parser.jay\"\n{\n\t\treport.Error (746, lexer.Location,\n\t\t\t\"Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression\");\n\t\tyyVal = null;\n\t  }\n\nvoid case_546()\n#line 3962 \"cs-parser.jay\"\n{\n\t  \t((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop];\n\t  \tyyVal = yyVals[-1+yyTop];\n\t  }\n\nvoid case_547()\n#line 3970 \"cs-parser.jay\"\n{\n\t\tyyVal = ComposedTypeSpecifier.CreateArrayDimension (1, GetLocation (yyVals[-1+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_548()\n#line 3975 \"cs-parser.jay\"\n{\n\t\tyyVal = ComposedTypeSpecifier.CreateArrayDimension ((int)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_553()\n#line 4005 \"cs-parser.jay\"\n{\n\t\tvar ai = new ArrayInitializer (0, GetLocation (yyVals[-1+yyTop]));\n\t\tai.VariableDeclaration = current_variable;\n\t\tlbag.AddLocation (ai, GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = ai;\n\t  }\n\nvoid case_554()\n#line 4012 \"cs-parser.jay\"\n{\n\t\tvar ai = new ArrayInitializer ((List<Expression>) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tai.VariableDeclaration = current_variable;\n\t\tif (yyVals[-1+yyTop] != null) {\n\t\t\tlbag.AddLocation (ai, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tlbag.AddLocation (ai, GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\tyyVal = ai;\n\t  }\n\nvoid case_555()\n#line 4026 \"cs-parser.jay\"\n{\n\t\tvar list = new List<Expression> (4);\n\t\tlist.Add ((Expression) yyVals[0+yyTop]);\n\t\tyyVal = list;\n\t  }\n\nvoid case_556()\n#line 4032 \"cs-parser.jay\"\n{\n\t\tvar list = (List<Expression>) yyVals[-2+yyTop];\n\t\tlist.Add ((Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (list, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = list;\n\t  }\n\nvoid case_557()\n#line 4042 \"cs-parser.jay\"\n{\n\t\tyyVal = new TypeOf ((FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_559()\n#line 4051 \"cs-parser.jay\"\n{\n\t \tError_TypeExpected (lexer.Location);\n\t \tyyVal = null;\n\t }\n\nvoid case_560()\n#line 4059 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), \"generics\");\n\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_561()\n#line 4069 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tif (lang_version == LanguageVersion.ISO_1)\n\t\t\tFeatureIsNotAvailable (lt.Location, \"namespace alias qualifier\");\n\t\tsavedLocation = GetLocation (yyVals[0+yyTop]);\n\t\tyyVal = lt;\t\t\n\t  }\n\nvoid case_562()\n#line 4080 \"cs-parser.jay\"\n{ \n\t\tyyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_563()\n#line 4085 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_564()\n#line 4095 \"cs-parser.jay\"\n{\n\t\tyyVal = new CheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_565()\n#line 4100 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new CheckedExpr (null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_566()\n#line 4109 \"cs-parser.jay\"\n{\n\t\tyyVal = new UnCheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_567()\n#line 4114 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new UnCheckedExpr (null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_568()\n#line 4123 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberAccess (new Indirection ((Expression) yyVals[-3+yyTop], GetLocation (yyVals[-2+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location);\n\t  }\n\nvoid case_570()\n#line 4135 \"cs-parser.jay\"\n{\n\t\tyyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]);\n\t\tif ((ParametersCompiled) yyVals[-2+yyTop] != ParametersCompiled.Undefined) {\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), PopLocation (), PopLocation ());\n\t\t} else {\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]));\n\t\t}\n\t  }\n\nvoid case_572()\n#line 4148 \"cs-parser.jay\"\n{\n\t\tyyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]);\n\t\t\n\t\tif ((ParametersCompiled) yyVals[-2+yyTop] != ParametersCompiled.Undefined) {\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), PopLocation (), PopLocation ());\n\t\t} else {\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]));\n\t\t}\n\t  }\n\nvoid case_576()\n#line 4173 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\t  \tyyVal = yyVals[-1+yyTop];\n\t  \tPushLocation (GetLocation (yyVals[-1+yyTop]));\n\t  \tPushLocation (GetLocation (yyVals[-3+yyTop]));\n\t  }\n\nvoid case_577()\n#line 4183 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), \"default value expression\");\n\n\t\tyyVal = new DefaultValueExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_581()\n#line 4203 \"cs-parser.jay\"\n{\n\t\tyyVal = new Cast ((FullNamedExpression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_582()\n#line 4208 \"cs-parser.jay\"\n{\n\t\tif (!async_block) {\n\t\t\t if (current_anonymous_method is LambdaExpression) {\n\t\t\t\treport.Error (4034, GetLocation (yyVals[-1+yyTop]),\n\t\t\t\t\t\"The `await' operator can only be used when its containing lambda expression is marked with the `async' modifier\");\n\t\t\t} else if (current_anonymous_method != null) {\n\t\t\t\treport.Error (4035, GetLocation (yyVals[-1+yyTop]),\n\t\t\t\t\t\"The `await' operator can only be used when its containing anonymous method is marked with the `async' modifier\");\n\t\t\t} else if (interactive_async != null) {\n\t\t\t\tcurrent_block.Explicit.RegisterAsyncAwait ();\n\t\t\t\tinteractive_async = true;\n\t\t\t} else {\n\t\t\t\treport.Error (4033, GetLocation (yyVals[-1+yyTop]),\n\t\t\t\t\t\"The `await' operator can only be used when its containing method is marked with the `async' modifier\");\n\t\t\t}\n\t\t} else {\n\t\t\tcurrent_block.Explicit.RegisterAsyncAwait ();\n\t\t}\n\t\t\n\t\tyyVal = new Await ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_583()\n#line 4230 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Unary (Unary.Operator.LogicalNot, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_584()\n#line 4236 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Unary (Unary.Operator.OnesComplement, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_585()\n#line 4242 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Cast ((FullNamedExpression) yyVals[-2+yyTop], null, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_586()\n#line 4249 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Await (null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_594()\n#line 4287 \"cs-parser.jay\"\n{ \n\t\tError_SyntaxError (yyToken);\n\n\t  \tyyVal = new Unary (Unary.Operator.UnaryPlus, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_595()\n#line 4293 \"cs-parser.jay\"\n{ \n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Unary (Unary.Operator.UnaryNegation, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_596()\n#line 4299 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_597()\n#line 4305 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_598()\n#line 4311 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Indirection (null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_599()\n#line 4317 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Unary (Unary.Operator.AddressOf, null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_601()\n#line 4327 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_602()\n#line 4332 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_603()\n#line 4337 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_604()\n#line 4342 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_605()\n#line 4349 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_606()\n#line 4356 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_608()\n#line 4367 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_609()\n#line 4372 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_610()\n#line 4377 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_611()\n#line 4384 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_613()\n#line 4395 \"cs-parser.jay\"\n{\n\t\tvar is_expr = new Is ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tif (yyVals[0+yyTop] != null) {\n\t\t\tif (lang_version != LanguageVersion.Experimental)\n\t\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), \"type pattern matching\");\n\n\t\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\t\tis_expr.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t\tcurrent_block.AddLocalName (is_expr.Variable);\n\t\t}\n\n\t\tyyVal = is_expr;\n\t  }\n\nvoid case_614()\n#line 4409 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new As ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_615()\n#line 4415 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Is ((Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_616()\n#line 4421 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tyyVal = new Is (new SimpleName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_617()\n#line 4426 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tyyVal = new As (new SimpleName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_619()\n#line 4435 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-1+yyTop] is VarExpr)\n\t\t\tyyVals[-1+yyTop] = new SimpleName (\"var\", ((VarExpr) yyVals[-1+yyTop]).Location);\n\n\t\tyyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t  }\n\nvoid case_623()\n#line 4454 \"cs-parser.jay\"\n{\n\t\tExpression expr = (Expression) yyVals[-1+yyTop];\n\t\tif (yyVals[0+yyTop] == null) {\n\t\t\tSimpleName sn = expr as SimpleName;\n\t\t\tif (sn != null && sn.Name == \"var\")\n\t\t\t\tyyVal = new VarExpr (sn.Location);\n\t\t\telse\n\t\t\t\tyyVal = yyVals[-1+yyTop];\n\t\t} else if (expr is ATypeNameExpression) {\n\t\t\tyyVal = new ComposedCast ((ATypeNameExpression)expr, (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t\t} else {\n\t\t\tError_ExpectingTypeName (expr);\n\t\t\tyyVal = null;\n\t\t}\n\t  }\n\nvoid case_624()\n#line 4470 \"cs-parser.jay\"\n{\n\t\tATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression;\n\n\t\tif (expr != null) {\n\t\t\tyyVal = new ComposedCast (expr, (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t\t} else {\n\t\t\tError_ExpectingTypeName ((Expression)yyVals[-1+yyTop]);\n\t\t\tyyVal = expr;\n\t\t}\n\t  }\n\nvoid case_628()\n#line 4487 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_629()\n#line 4492 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_630()\n#line 4497 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_631()\n#line 4504 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_633()\n#line 4515 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.LessThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_634()\n#line 4520 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.GreaterThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_635()\n#line 4525 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.LessThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_636()\n#line 4530 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_637()\n#line 4535 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.LessThan, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_638()\n#line 4542 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.GreaterThan, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_639()\n#line 4549 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.LessThanOrEqual, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_640()\n#line 4556 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_642()\n#line 4567 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.Equality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_643()\n#line 4572 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.Inequality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_644()\n#line 4577 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.Equality, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_645()\n#line 4584 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.Inequality, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_647()\n#line 4595 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_648()\n#line 4600 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_650()\n#line 4611 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_651()\n#line 4616 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_653()\n#line 4627 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_654()\n#line 4632 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_656()\n#line 4643 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.LogicalAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_657()\n#line 4648 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.LogicalAnd, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_659()\n#line 4659 \"cs-parser.jay\"\n{\n\t\tyyVal = new Binary (Binary.Operator.LogicalOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_660()\n#line 4664 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Binary (Binary.Operator.LogicalOr, (Expression) yyVals[-2+yyTop], null);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_662()\n#line 4675 \"cs-parser.jay\"\n{\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), \"null coalescing operator\");\n\t\t\t\n\t\tyyVal = new Nullable.NullCoalescingOperator ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_664()\n#line 4687 \"cs-parser.jay\"\n{\n\t\tyyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-4+yyTop]), (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_665()\n#line 4692 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-3+yyTop]), (Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_666()\n#line 4698 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-4+yyTop]), (Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_667()\n#line 4705 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (Token.CLOSE_BRACE);\n\n\t\tyyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-4+yyTop]), (Expression) yyVals[-2+yyTop], null, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t\tlexer.putback ('}');\n\t  }\n\nvoid case_668()\n#line 4716 \"cs-parser.jay\"\n{\n\t\tyyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_669()\n#line 4721 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_670()\n#line 4726 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_671()\n#line 4731 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_672()\n#line 4736 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_673()\n#line 4741 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_674()\n#line 4746 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_675()\n#line 4751 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_676()\n#line 4756 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_677()\n#line 4761 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_678()\n#line 4766 \"cs-parser.jay\"\n{\n\t\tyyVal = new CompoundAssign (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_679()\n#line 4774 \"cs-parser.jay\"\n{\n\t\tvar pars = new List<Parameter> (4);\n\t\tpars.Add ((Parameter) yyVals[0+yyTop]);\n\t\tparameterListCommas.Clear ();\n\t\tyyVal = pars;\n\t  }\n\nvoid case_680()\n#line 4781 \"cs-parser.jay\"\n{\n\t\tvar pars = (List<Parameter>) yyVals[-2+yyTop];\n\t\tParameter p = (Parameter)yyVals[0+yyTop];\n\t\tif (pars[0].GetType () != p.GetType ()) {\n\t\t\treport.Error (748, p.Location, \"All lambda parameters must be typed either explicitly or implicitly\");\n\t\t}\n\t\t\n\t\tpars.Add (p);\n\t\tparameterListCommas.Add (GetLocation (yyVals[-1+yyTop]));\n\n\t\tyyVal = pars;\n\t  }\n\nvoid case_681()\n#line 4797 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\n\t\tyyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], null, lt.Location);\n\t  }\n\nvoid case_682()\n#line 4803 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\n\t\tyyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, Parameter.Modifier.NONE, null, lt.Location);\n\t  }\n\nvoid case_683()\n#line 4809 \"cs-parser.jay\"\n{\n\t  \tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tyyVal = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t  }\n\nvoid case_684()\n#line 4814 \"cs-parser.jay\"\n{\n\t  \tvar lt = (LocatedToken) Error_AwaitAsIdentifier (yyVals[0+yyTop]);\n\t\tyyVal = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t  }\n\nvoid case_686()\n#line 4822 \"cs-parser.jay\"\n{ \n\t\tvar pars_list = (List<Parameter>) yyVals[0+yyTop];\n\t\tyyVal = new ParametersCompiled (pars_list.ToArray ());\n\t\tlbag.AddLocation (yyVal, parameterListCommas);\n\t  }\n\nvoid case_688()\n#line 4834 \"cs-parser.jay\"\n{\n\t\tBlock b = end_block (Location.Null);\n\t\tb.IsCompilerGenerated = true;\n\t\tb.AddStatement (new ContextualReturn ((Expression) yyVals[0+yyTop]));\n\t\tyyVal = b;\n\t  }\n\nvoid case_690()\n#line 4842 \"cs-parser.jay\"\n{\n\t  \t/* Handles only cases like foo = x.FirstOrDefault (l => );*/\n\t  \t/* where we must restore current_variable*/\n\t\tBlock b = end_block (Location.Null);\n\t\tb.IsCompilerGenerated = true;\n\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = null;\n\t  }\n\nvoid case_692()\n#line 4856 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = null;\n\t  }\n\nvoid case_693()\n#line 4864 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\t\n\t\tParameter p = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t\tstart_anonymous (true, new ParametersCompiled (p), false, lt.Location);\n\t  }\n\nvoid case_694()\n#line 4870 \"cs-parser.jay\"\n{\n\t\tyyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_695()\n#line 4875 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) Error_AwaitAsIdentifier (yyVals[-1+yyTop]);\n\t\tParameter p = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t\tstart_anonymous (true, new ParametersCompiled (p), false, lt.Location);\n\t  }\n\nvoid case_696()\n#line 4881 \"cs-parser.jay\"\n{\n\t\tyyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_697()\n#line 4886 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tParameter p = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t\tstart_anonymous (true, new ParametersCompiled (p), true, lt.Location);\n\t  }\n\nvoid case_698()\n#line 4892 \"cs-parser.jay\"\n{\n\t\tyyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_700()\n#line 4901 \"cs-parser.jay\"\n{\n\t  \tvalid_param_mod = 0;\n\t\tstart_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], false, GetLocation (yyVals[-4+yyTop]));\n\t  }\n\nvoid case_701()\n#line 4906 \"cs-parser.jay\"\n{\n\t\tyyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_703()\n#line 4915 \"cs-parser.jay\"\n{\n\t  \tvalid_param_mod = 0;\n\t\tstart_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], true, GetLocation (yyVals[-5+yyTop]));\n\t  }\n\nvoid case_704()\n#line 4920 \"cs-parser.jay\"\n{\n\t\tyyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_711()\n#line 4943 \"cs-parser.jay\"\n{\n\t\tyyVal = new RefValueExpr ((Expression) yyVals[-3+yyTop], (FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-5+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_712()\n#line 4948 \"cs-parser.jay\"\n{\n\t\tyyVal = new RefTypeExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_713()\n#line 4953 \"cs-parser.jay\"\n{\n\t\tyyVal = new MakeRefExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\t  \n\t  }\n\nvoid case_718()\n#line 4980 \"cs-parser.jay\"\n{\n\t\tyyVal = yyVals[-1+yyTop];\n\n\t\t/* Cannot use opt_formal_parameter_list because it can be shared instance for empty parameters*/\n\t  \tlbag.AppendToMember (current_container, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), \"primary constructor\");\n\t  }\n\nvoid case_723()\n#line 5009 \"cs-parser.jay\"\n{\n\t\t++lexer.parsing_block;\n\t\tcurrent_type.PrimaryConstructorBaseArgumentsStart = GetLocation (yyVals[0+yyTop]);\n\t  }\n\nvoid case_724()\n#line 5014 \"cs-parser.jay\"\n{\n\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[0+yyTop]));\n\t\tcurrent_type.PrimaryConstructorBaseArguments = (Arguments) yyVals[-1+yyTop];\n\t\t--lexer.parsing_block;\n\n\t\tyyVal = yyVals[-5+yyTop];\n\t  }\n\nvoid case_726()\n#line 5034 \"cs-parser.jay\"\n{\n\t\tlexer.ConstraintsParsing = true;\n\n\t\tClass c = new Class (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]);\n\t\tif (((c.ModFlags & Modifiers.STATIC) != 0) && lang_version == LanguageVersion.ISO_1) {\n\t\t\tFeatureIsNotAvailable (c.Location, \"static classes\");\n\t\t}\n\t\t\t\n\t\tpush_current_container (c, yyVals[-3+yyTop]);\n\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop]));\n\t\tvalid_param_mod = ParameterModifierType.PrimaryConstructor;\n\t  }\n\nvoid case_727()\n#line 5048 \"cs-parser.jay\"\n{\n\t\tvalid_param_mod = 0;\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif (yyVals[-1+yyTop] != null)\n\t\t\tcurrent_type.PrimaryConstructorParameters = (ParametersCompiled) yyVals[-1+yyTop];\n\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\tcurrent_container.SetConstraints ((List<Constraints>) yyVals[0+yyTop]);\n\n\t\tif (doc_support) {\n\t\t\tcurrent_container.PartialContainer.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\nvoid case_728()\n#line 5066 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_declaration;\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\nvoid case_729()\n#line 5072 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] == null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t\t} else {\n\t\t\tlbag.AppendToMember (current_container, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\tyyVal = pop_current_class ();\n\t  }\n\nvoid case_732()\n#line 5091 \"cs-parser.jay\"\n{\n\t    mod_locations = null;\n\t\tyyVal = ModifierNone;\n\t\tlexer.parsing_modifiers = false;\n\t  }\n\nvoid case_735()\n#line 5105 \"cs-parser.jay\"\n{ \n\t\tvar m1 = (Modifiers) yyVals[-1+yyTop];\n\t\tvar m2 = (Modifiers) yyVals[0+yyTop];\n\n\t\tif ((m1 & m2) != 0) {\n\t\t\treport.Error (1004, lexer.Location - ModifiersExtensions.Name (m2).Length,\n\t\t\t\t\"Duplicate `{0}' modifier\", ModifiersExtensions.Name (m2));\n\t\t} else if ((m2 & Modifiers.AccessibilityMask) != 0 && (m1 & Modifiers.AccessibilityMask) != 0 &&\n\t\t\t((m2 | m1 & Modifiers.AccessibilityMask) != (Modifiers.PROTECTED | Modifiers.INTERNAL))) {\n\t\t\treport.Error (107, lexer.Location - ModifiersExtensions.Name (m2).Length,\n\t\t\t\t\"More than one protection modifier specified\");\n\t\t}\n\t\t\n\t\tyyVal = m1 | m2;\n\t  }\n\nvoid case_736()\n#line 5124 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.NEW;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t\t\n\t\tif (current_container.Kind == MemberKind.Namespace)\n\t\t\treport.Error (1530, GetLocation (yyVals[0+yyTop]), \"Keyword `new' is not allowed on namespace elements\");\n\t  }\n\nvoid case_737()\n#line 5132 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.PUBLIC;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_738()\n#line 5137 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.PROTECTED;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_739()\n#line 5142 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.INTERNAL;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_740()\n#line 5147 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.PRIVATE;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_741()\n#line 5152 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.ABSTRACT;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_742()\n#line 5157 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.SEALED;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_743()\n#line 5162 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.STATIC;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_744()\n#line 5167 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.READONLY;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_745()\n#line 5172 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.VIRTUAL;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_746()\n#line 5177 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.OVERRIDE;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_747()\n#line 5182 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.EXTERN;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_748()\n#line 5187 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.VOLATILE;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_749()\n#line 5192 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.UNSAFE;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t\tif (!settings.Unsafe)\n\t\t\tError_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_750()\n#line 5199 \"cs-parser.jay\"\n{\n\t\tyyVal = Modifiers.ASYNC;\n\t\tStoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_753()\n#line 5212 \"cs-parser.jay\"\n{\n\t\tcurrent_type.SetBaseTypes ((List<FullNamedExpression>) yyVals[0+yyTop]);\n\t\tlbag.AppendToMember (current_type, GetLocation (yyVals[-1+yyTop]));\n\t }\n\nvoid case_754()\n#line 5217 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tcurrent_type.SetBaseTypes ((List<FullNamedExpression>) yyVals[-1+yyTop]);\n\t  }\n\nvoid case_757()\n#line 5234 \"cs-parser.jay\"\n{\n\t\tvar constraints = new List<Constraints> (1);\n\t\tconstraints.Add ((Constraints) yyVals[0+yyTop]);\n\t\tyyVal = constraints;\n\t  }\n\nvoid case_758()\n#line 5240 \"cs-parser.jay\"\n{\n\t\tvar constraints = (List<Constraints>) yyVals[-1+yyTop];\n\t\tConstraints new_constraint = (Constraints)yyVals[0+yyTop];\n\n\t\tforeach (Constraints c in constraints) {\n\t\t\tif (new_constraint.TypeParameter.Value == c.TypeParameter.Value) {\n\t\t\t\treport.Error (409, new_constraint.Location,\n\t\t\t\t\t\"A constraint clause has already been specified for type parameter `{0}'\",\n\t\t\t\t\tnew_constraint.TypeParameter.Value);\n\t\t\t}\n\t\t}\n\n\t\tconstraints.Add (new_constraint);\n\t\tyyVal = constraints;\n\t  }\n\nvoid case_759()\n#line 5259 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tyyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), (List<FullNamedExpression>) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_760()\n#line 5265 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), null, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_761()\n#line 5275 \"cs-parser.jay\"\n{\n\t\tvar constraints = new List<FullNamedExpression> (1);\n\t\tconstraints.Add ((FullNamedExpression) yyVals[0+yyTop]);\n\t\tyyVal = constraints;\n\t  }\n\nvoid case_762()\n#line 5281 \"cs-parser.jay\"\n{\n\t\tvar constraints = (List<FullNamedExpression>) yyVals[-2+yyTop];\n\t\tvar prev = constraints [constraints.Count - 1] as SpecialContraintExpr;\n\t\tif (prev != null && (prev.Constraint & SpecialConstraint.Constructor) != 0) {\t\t\t\n\t\t\treport.Error (401, GetLocation (yyVals[-1+yyTop]), \"The `new()' constraint must be the last constraint specified\");\n\t\t}\n\t\t\n\t\tprev = yyVals[0+yyTop] as SpecialContraintExpr;\n\t\tif (prev != null) {\n\t\t\tif ((prev.Constraint & (SpecialConstraint.Class | SpecialConstraint.Struct)) != 0) {\n\t\t\t\treport.Error (449, prev.Location, \"The `class' or `struct' constraint must be the first constraint specified\");\t\t\t\n\t\t\t} else {\n\t\t\t \tprev = constraints [0] as SpecialContraintExpr;\n\t\t\t \tif (prev != null && (prev.Constraint & SpecialConstraint.Struct) != 0) {\t\t\t\n\t\t\t\t\treport.Error (451, GetLocation (yyVals[0+yyTop]), \"The `new()' constraint cannot be used with the `struct' constraint\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconstraints.Add ((FullNamedExpression) yyVals[0+yyTop]);\n\t\tlbag.AddLocation (constraints, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = constraints;\n\t  }\n\nvoid case_763()\n#line 5308 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is ComposedCast)\n\t\t\treport.Error (706, GetLocation (yyVals[0+yyTop]), \"Invalid constraint type `{0}'\", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ());\n\t  \n\t  \tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_764()\n#line 5315 \"cs-parser.jay\"\n{\n\t\tyyVal = new SpecialContraintExpr (SpecialConstraint.Constructor, GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_768()\n#line 5335 \"cs-parser.jay\"\n{\n\t\tif (lang_version <= LanguageVersion.V_3)\n\t\t\tFeatureIsNotAvailable (lexer.Location, \"generic type variance\");\n\t\t\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_769()\n#line 5345 \"cs-parser.jay\"\n{\n\t\tyyVal = new VarianceDecl (Variance.Covariant, GetLocation (yyVals[0+yyTop]));\n\t\tsavedLocation = GetLocation (yyVals[0+yyTop]);\n\t  }\n\nvoid case_770()\n#line 5350 \"cs-parser.jay\"\n{\n\t\tyyVal = new VarianceDecl (Variance.Contravariant, GetLocation (yyVals[0+yyTop]));\n\t\tsavedLocation = GetLocation (yyVals[0+yyTop]);\n\t  }\n\nvoid case_771()\n#line 5371 \"cs-parser.jay\"\n{\n\t\t++lexer.parsing_block;\n\t\tstart_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_773()\n#line 5383 \"cs-parser.jay\"\n{\n\t \t--lexer.parsing_block;\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_774()\n#line 5388 \"cs-parser.jay\"\n{\n\t \t--lexer.parsing_block;\n\t\tyyVal = end_block (lexer.Location);\n\t  }\n\nvoid case_775()\n#line 5397 \"cs-parser.jay\"\n{\n\t\t++lexer.parsing_block;\n\t\tcurrent_block.StartLocation = GetLocation (yyVals[0+yyTop]);\n\t  }\n\nvoid case_776()\n#line 5402 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_777()\n#line 5406 \"cs-parser.jay\"\n{\n\t\treport.Error (1525, GetLocation (yyVals[0+yyTop]), \"Unexpected symbol '}', expected '{'\");\n\t\tlexer.putback ('}');\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_778()\n#line 5415 \"cs-parser.jay\"\n{\n\t\t++lexer.parsing_block;\n\t\tcurrent_block.StartLocation = GetLocation (yyVals[0+yyTop]);\n\t  }\n\nvoid case_779()\n#line 5420 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_787()\n#line 5448 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tvar lt =(LocatedToken) yyVals[-1+yyTop];\n\t\tvar sn = new SimpleName (lt.Value, lt.Location);\n\t\tcurrent_block.AddStatement(new StatementErrorExpression (sn));\n\t\tyyVal = null;\n\t}\n\nvoid case_788()\n#line 5457 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = null;\n\t  }\n\nvoid case_821()\n#line 5521 \"cs-parser.jay\"\n{\n\t\t  report.Error (1023, GetLocation (yyVals[0+yyTop]), \"An embedded statement may not be a declaration or labeled statement\");\n\t\t  yyVal = null;\n\t  }\n\nvoid case_822()\n#line 5526 \"cs-parser.jay\"\n{\n\t\t  report.Error (1023, GetLocation (yyVals[0+yyTop]), \"An embedded statement may not be a declaration or labeled statement\");\n\t\t  yyVal = null;\n\t  }\n\nvoid case_823()\n#line 5531 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_824()\n#line 5539 \"cs-parser.jay\"\n{\n\t\t/* Uses lexer.Location because semicolon location is not kept in quick mode*/\n\t\tyyVal = new EmptyStatement (lexer.Location);\n\t  }\n\nvoid case_825()\n#line 5547 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tLabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location);\n\t\tlbag.AddLocation (labeled, GetLocation (yyVals[0+yyTop]));\n\t\tcurrent_block.AddLabel (labeled);\n\t\tcurrent_block.AddStatement (labeled);\n\t  }\n\nvoid case_828()\n#line 5560 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-1+yyTop] is VarExpr)\n\t\t\tyyVals[-1+yyTop] = new SimpleName (\"var\", ((VarExpr) yyVals[-1+yyTop]).Location);\n\t  \n\t\tyyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t  }\n\nvoid case_829()\n#line 5576 \"cs-parser.jay\"\n{ \n\t\t/* Ok, the above \"primary_expression\" is there to get rid of*/\n\t\t/* both reduce/reduce and shift/reduces in the grammar, it should*/\n\t\t/* really just be \"type_name\".  If you use type_name, a reduce/reduce*/\n\t\t/* creeps up.  If you use namespace_or_type_name (which is all we need*/\n\t\t/* really) two shift/reduces appear.*/\n\t\t/* */\n\n\t\t/* So the super-trick is that primary_expression*/\n\t\t/* can only be either a SimpleName or a MemberAccess. */\n\t\t/* The MemberAccess case arises when you have a fully qualified type-name like :*/\n\t\t/* Foo.Bar.Blah i;*/\n\t\t/* SimpleName is when you have*/\n\t\t/* Blah i;*/\n\t\t\n\t\tExpression expr = (Expression) yyVals[-1+yyTop];\n\t\tif (yyVals[0+yyTop] == null) {\n\t\t\tSimpleName sn = expr as SimpleName;\n\t\t\tif (sn != null && sn.Name == \"var\")\n\t\t\t\tyyVal = new VarExpr (sn.Location);\n\t\t\telse\n\t\t\t\tyyVal = yyVals[-1+yyTop];\n\t\t} else if (expr is ATypeNameExpression) {\n\t\t\tyyVal = new ComposedCast ((ATypeNameExpression)expr, (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t\t} else {\n\t\t\tError_ExpectingTypeName (expr);\n\t\t\tyyVal = null;\n\t\t}\n\t  }\n\nvoid case_830()\n#line 5606 \"cs-parser.jay\"\n{\n\t\tATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression;\n\n\t\tif (expr != null) {\n\t\t\tyyVal = new ComposedCast (expr, (ComposedTypeSpecifier) yyVals[0+yyTop]);\n\t\t} else {\n\t\t\tError_ExpectingTypeName ((Expression)yyVals[-1+yyTop]);\n\t\t\tyyVal = expr;\n\t\t}\n\t  }\n\nvoid case_834()\n#line 5623 \"cs-parser.jay\"\n{\n\t  \t((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop];\n\t  \tyyVal = yyVals[-1+yyTop];\n\t  }\n\nvoid case_838()\n#line 5646 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tvar li = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new BlockVariable ((FullNamedExpression) yyVals[-1+yyTop], li);\n\t  }\n\nvoid case_839()\n#line 5653 \"cs-parser.jay\"\n{\n\t\tyyVal = current_variable;\n\t\tcurrent_variable = null;\n\t\tif (yyVals[-2+yyTop] != null)\n\t\t\tlbag.AddLocation (yyVal, PopLocation (), GetLocation (yyVals[0+yyTop]));\n\t\telse\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_840()\n#line 5662 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new BlockConstant ((FullNamedExpression) yyVals[-1+yyTop], li);\n\t  }\n\nvoid case_841()\n#line 5669 \"cs-parser.jay\"\n{\n\t\tif (current_variable.Initializer != null) {\n\t\t\tlbag.AddLocation (current_variable, GetLocation (yyVals[-6+yyTop]), savedLocation, GetLocation (yyVals[0+yyTop]));\n\t\t} else {\n\t\t\tlbag.AddLocation (current_variable, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\t}\n\t\tyyVal = current_variable;;\n\t\tcurrent_variable = null;\n\t  }\n\nvoid case_843()\n#line 5682 \"cs-parser.jay\"\n{\n\t\t/* Redundant, but wont regress*/\n\t\treport.Error (1525, lexer.Location, \"Unexpected symbol }\");\n\t\tlexer.putback ('}');\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_845()\n#line 5693 \"cs-parser.jay\"\n{\n\t\tcurrent_variable.Initializer = (Expression) yyVals[0+yyTop];\n\t\tPushLocation (GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = current_variable;\n\t  }\n\nvoid case_846()\n#line 5699 \"cs-parser.jay\"\n{\n\t  \tif (yyToken == Token.OPEN_BRACKET_EXPR) {\n\t\t\treport.Error (650, lexer.Location,\n\t\t\t\t\"Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type\");\n\t\t} else {\n\t\t\tError_SyntaxError (yyToken);\n\t\t}\n\t  }\n\nvoid case_850()\n#line 5717 \"cs-parser.jay\"\n{\n\t\tforeach (var d in current_variable.Declarators) {\n\t\t\tif (d.Initializer == null)\n\t\t\t\tError_MissingInitializer (d.Variable.Location);\n\t\t}\n\t  }\n\nvoid case_853()\n#line 5732 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\t  \n\t\tvar li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location);\n\t\tvar d = new BlockVariableDeclarator (li, null);\n\t\tcurrent_variable.AddDeclarator (d);\n\t\tcurrent_block.AddLocalName (li);\n\t  \tlbag.AddLocation (d, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_854()\n#line 5741 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\t  \n\t\tvar li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location);\n\t\tvar d = new BlockVariableDeclarator (li, (Expression) yyVals[0+yyTop]);\n\t\tcurrent_variable.AddDeclarator (d);\n\t\tcurrent_block.AddLocalName (li);\n\t  \tlbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_856()\n#line 5757 \"cs-parser.jay\"\n{\n\t\tsavedLocation = GetLocation (yyVals[-1+yyTop]);\n\t\tcurrent_variable.Initializer = (Expression) yyVals[0+yyTop];\n\t  }\n\nvoid case_861()\n#line 5775 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\t  \n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location);\n\t\tvar d = new BlockVariableDeclarator (li, (Expression) yyVals[0+yyTop]);\n\t\tcurrent_variable.AddDeclarator (d);\n\t\tcurrent_block.AddLocalName (li);\n\t  \tlbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_863()\n#line 5788 \"cs-parser.jay\"\n{\n\t\tyyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_864()\n#line 5793 \"cs-parser.jay\"\n{\n\t\treport.Error (1575, GetLocation (yyVals[-1+yyTop]), \"A stackalloc expression requires [] after type\");\n\t\tyyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop]));\t\t\n\t  }\n\nvoid case_865()\n#line 5801 \"cs-parser.jay\"\n{\n\t\tyyVal = yyVals[-1+yyTop];\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_867()\n#line 5807 \"cs-parser.jay\"\n{\n\t\tyyVal = yyVals[-1+yyTop];\n\t\treport.Error (1002, GetLocation (yyVals[0+yyTop]), \"; expected\");\n\t\tlexer.putback ('}');\n\t  }\n\nvoid case_870()\n#line 5825 \"cs-parser.jay\"\n{\n\t\tExpressionStatement s = yyVals[0+yyTop] as ExpressionStatement;\n\t\tif (s == null) {\n\t\t\tvar expr = yyVals[0+yyTop] as Expression;\n\t\t\tyyVal = new StatementErrorExpression (expr);\n\t\t} else {\n\t\t\tyyVal = new StatementExpression (s);\n\t\t}\n\t  }\n\nvoid case_871()\n#line 5838 \"cs-parser.jay\"\n{\n\t\tExpression expr = (Expression) yyVals[0+yyTop];\n\t\tyyVal = new StatementExpression (new OptionalAssign (expr, lexer.Location));\n\t  }\n\nvoid case_872()\n#line 5843 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_875()\n#line 5857 \"cs-parser.jay\"\n{ \n\t\tif (yyVals[0+yyTop] is EmptyStatement)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t\t\n\t\tyyVal = new If ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_876()\n#line 5866 \"cs-parser.jay\"\n{\n\t\tyyVal = new If ((BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t\t\n\t\tif (yyVals[-2+yyTop] is EmptyStatement)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[-2+yyTop]));\n\t\tif (yyVals[0+yyTop] is EmptyStatement)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_877()\n#line 5876 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\t\n\t\tyyVal = new If ((BooleanExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_879()\n#line 5890 \"cs-parser.jay\"\n{\n\t\tyyVal = new Switch ((Expression) yyVals[-5+yyTop], (ExplicitBlock) current_block.Explicit, GetLocation (yyVals[-7+yyTop]));\t\n\t\tend_block (GetLocation (yyVals[0+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_880()\n#line 5896 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\tyyVal = new Switch ((Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));\t\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_887()\n#line 5927 \"cs-parser.jay\"\n{\n\t  \tvar label = (SwitchLabel) yyVals[0+yyTop];\n\t  \tlabel.SectionStart = true;\n\t\tcurrent_block.AddStatement (label);\n\t  }\n\nvoid case_889()\n#line 5940 \"cs-parser.jay\"\n{\n\t \tyyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t \tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t }\n\nvoid case_890()\n#line 5945 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_896()\n#line 5964 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  \n\t\tyyVal = new While ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_897()\n#line 5972 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\t\n\t\tyyVal = new While ((BooleanExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_898()\n#line 5982 \"cs-parser.jay\"\n{\n\t\tyyVal = new Do ((Statement) yyVals[-5+yyTop], (BooleanExpression) yyVals[-2+yyTop], GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_899()\n#line 5987 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new Do ((Statement) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), Location.Null);\n\t  }\n\nvoid case_900()\n#line 5992 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\tyyVal = new Do ((Statement) yyVals[-4+yyTop], (BooleanExpression) yyVals[-1+yyTop], GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_901()\n#line 6002 \"cs-parser.jay\"\n{\n\t\tstart_block (GetLocation (yyVals[0+yyTop]));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tFor f = new For (GetLocation (yyVals[-1+yyTop]));\n\t\tcurrent_block.AddStatement (f);\n\t\tlbag.AddStatement (f, current_block.StartLocation);\n\t\tyyVal = f;\n\t  }\n\nvoid case_903()\n#line 6019 \"cs-parser.jay\"\n{\n\t\tFor f =  (For) yyVals[-2+yyTop];\n\t\tf.Initializer = (Statement) yyVals[-1+yyTop];\n\t\tlbag.AddLocation (f, GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = f;\n\t  }\n\nvoid case_905()\n#line 6029 \"cs-parser.jay\"\n{\n\t\treport.Error (1525, GetLocation (yyVals[0+yyTop]), \"Unexpected symbol ')', expected ';'\");\n\t\tFor f =  (For) yyVals[-2+yyTop];\n\t\tf.Initializer = (Statement) yyVals[-1+yyTop];\n\t\tlbag.AddLocation (f, GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t}\n\nvoid case_906()\n#line 6040 \"cs-parser.jay\"\n{\n\t\tFor f =  (For) yyVals[-2+yyTop];\n\t\tf.Condition = (BooleanExpression) yyVals[-1+yyTop];\n\t\tlbag.AddLocation (f, GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = f;\n\t  }\n\nvoid case_908()\n#line 6051 \"cs-parser.jay\"\n{\n\t\treport.Error (1525, GetLocation (yyVals[0+yyTop]), \"Unexpected symbol ')', expected ';'\");\n\t\tFor f =  (For) yyVals[-2+yyTop];\n\t\tf.Condition = (BooleanExpression) yyVals[-1+yyTop];\n\t\tlbag.AddLocation (f, GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t}\n\nvoid case_909()\n#line 6063 \"cs-parser.jay\"\n{\n\t\tFor f =  (For) yyVals[-3+yyTop];\n\t\tf.Iterator = (Statement) yyVals[-2+yyTop];\n\t\t\n\t\tif (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  \n\t\tf.Statement = (Statement) yyVals[0+yyTop];\n\t\tlbag.AddLocation (f, GetLocation (yyVals[-1+yyTop]));\n\n\t\tyyVal = end_block (GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_910()\n#line 6076 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = end_block (current_block.StartLocation);\n\t  }\n\nvoid case_913()\n#line 6089 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tvar li = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new BlockVariable ((FullNamedExpression) yyVals[-1+yyTop], li);\n\t  }\n\nvoid case_914()\n#line 6096 \"cs-parser.jay\"\n{\n\t\tyyVal = current_variable;\n\t\tif (yyVals[-1+yyTop] != null)\n\t\t\tlbag.AddLocation (current_variable, PopLocation ());\n\n\t\tcurrent_variable = null;\n\t  }\n\nvoid case_922()\n#line 6123 \"cs-parser.jay\"\n{\n\t  \tvar sl = yyVals[-2+yyTop] as StatementList;\n\t  \tif (sl == null) {\n\t  \t\tsl = new StatementList ((Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop]);\n\t\t\tlbag.AddStatement (sl, GetLocation (yyVals[-1+yyTop]));\n\t  \t} else {\n\t  \t\tsl.Add ((Statement) yyVals[0+yyTop]);\n\t  \t\tlbag.AddLocation (sl, GetLocation (yyVals[-1+yyTop]));\n\t  \t\t\n\t  \t}\n\t  \t\t\n\t\tyyVal = sl;\n\t  }\n\nvoid case_923()\n#line 6140 \"cs-parser.jay\"\n{\n\t\treport.Error (230, GetLocation (yyVals[-3+yyTop]), \"Type and identifier are both required in a foreach statement\");\n\n\t\tstart_block (GetLocation (yyVals[-2+yyTop]));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\t\n\t\tForeach f = new Foreach ((Expression) yyVals[-1+yyTop], null, null, null, null, GetLocation (yyVals[-3+yyTop]));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation (yyVals[-2+yyTop]));\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_924()\n#line 6153 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\n\t\tstart_block (GetLocation (yyVals[-3+yyTop]));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\t\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.ForeachVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\t\n\t\tForeach f = new Foreach ((Expression) yyVals[-2+yyTop], li, null, null, null, GetLocation (yyVals[-4+yyTop]));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation (yyVals[-3+yyTop]));\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_925()\n#line 6170 \"cs-parser.jay\"\n{\n\t\tstart_block (GetLocation (yyVals[-5+yyTop]));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\t\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.ForeachVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tyyVal = li;\n\t  }\n\nvoid case_926()\n#line 6180 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t\t\n\t\tForeach f = new Foreach ((Expression) yyVals[-6+yyTop], (LocalVariable) yyVals[-1+yyTop], (Expression) yyVals[-3+yyTop], (Statement) yyVals[0+yyTop], current_block, GetLocation (yyVals[-8+yyTop]));\n\t\tlbag.AddStatement (f, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t\tend_block (GetLocation (yyVals[-2+yyTop]));\n\t\t\n\t\tyyVal = f;\n\t  }\n\nvoid case_927()\n#line 6191 \"cs-parser.jay\"\n{\n\t\tstart_block (GetLocation (yyVals[-3+yyTop]));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tvar lt = yyVals[-1+yyTop] as LocatedToken;\n\t\tvar li = lt != null ? new LocalVariable (current_block, lt.Value, LocalVariable.Flags.ForeachVariable | LocalVariable.Flags.Used, lt.Location) : null;\n\t\t\n\t\tForeach f = new Foreach ((Expression) yyVals[-2+yyTop], li, null, null, null, GetLocation (yyVals[-4+yyTop]));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation (yyVals[-3+yyTop]));\n\t\tyyVal = end_block (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_928()\n#line 6204 \"cs-parser.jay\"\n{\n\t\tForeach f = new Foreach ((Expression) yyVals[-1+yyTop], null, null, null, null, GetLocation (yyVals[-3+yyTop]));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation (yyVals[-2+yyTop]));\n\t\tyyVal = f;\n\t  }\n\nvoid case_935()\n#line 6224 \"cs-parser.jay\"\n{\n\t\tyyVal = new Break (GetLocation (yyVals[-1+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_936()\n#line 6232 \"cs-parser.jay\"\n{\n\t\tyyVal = new Continue (GetLocation (yyVals[-1+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_937()\n#line 6237 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new Continue (GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_938()\n#line 6245 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new Goto (lt.Value, GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_939()\n#line 6251 \"cs-parser.jay\"\n{\n\t\tyyVal = new GotoCase ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_940()\n#line 6256 \"cs-parser.jay\"\n{\n\t\tyyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_941()\n#line 6264 \"cs-parser.jay\"\n{\n\t\tyyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_942()\n#line 6269 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_943()\n#line 6274 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new Return (null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_944()\n#line 6282 \"cs-parser.jay\"\n{\n\t\tyyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_945()\n#line 6287 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_946()\n#line 6292 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new Throw (null, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_947()\n#line 6300 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tstring s = lt.Value;\n\t\tif (s != \"yield\"){\n\t\t\treport.Error (1003, lt.Location, \"; expected\");\n\t\t} else if (yyVals[-1+yyTop] == null) {\n\t\t\treport.Error (1627, GetLocation (yyVals[0+yyTop]), \"Expression expected after yield return\");\n\t\t} else if (lang_version == LanguageVersion.ISO_1){\n\t\t\tFeatureIsNotAvailable (lt.Location, \"iterators\");\n\t\t}\n\t\t\n\t\tcurrent_block.Explicit.RegisterIteratorYield ();\n\t\tyyVal = new Yield ((Expression) yyVals[-1+yyTop], lt.Location);\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_948()\n#line 6316 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tstring s = lt.Value;\n\t\tif (s != \"yield\"){\n\t\t\treport.Error (1003, lt.Location, \"; expected\");\n\t\t} else if (yyVals[-1+yyTop] == null) {\n\t\t\treport.Error (1627, GetLocation (yyVals[0+yyTop]), \"Expression expected after yield return\");\n\t\t} else if (lang_version == LanguageVersion.ISO_1){\n\t\t\tFeatureIsNotAvailable (lt.Location, \"iterators\");\n\t\t}\n\t\t\n\t\tcurrent_block.Explicit.RegisterIteratorYield ();\n\t\tyyVal = new Yield ((Expression) yyVals[-1+yyTop], lt.Location);\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_949()\n#line 6334 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tstring s = lt.Value;\n\t\tif (s != \"yield\"){\n\t\t\treport.Error (1003, lt.Location, \"; expected\");\n\t\t} else if (lang_version == LanguageVersion.ISO_1){\n\t\t\tFeatureIsNotAvailable (lt.Location, \"iterators\");\n\t\t}\n\t\t\n\t\tcurrent_block.ParametersBlock.TopBlock.IsIterator = true;\n\t\tyyVal = new YieldBreak (lt.Location);\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_953()\n#line 6360 \"cs-parser.jay\"\n{\n\t\tyyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (ExplicitBlock) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_954()\n#line 6365 \"cs-parser.jay\"\n{\n\t\tyyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List<Catch>) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop]), true), (ExplicitBlock) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_955()\n#line 6370 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (1524, yyToken);\n\t\tyyVal = new TryCatch ((Block) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop]), false);\n\t  }\n\nvoid case_956()\n#line 6378 \"cs-parser.jay\"\n{\n\t\tvar l = new List<Catch> (2);\n\n\t\tl.Add ((Catch) yyVals[0+yyTop]);\n\t\tyyVal = l;\n\t  }\n\nvoid case_957()\n#line 6385 \"cs-parser.jay\"\n{\n\t\tvar l = (List<Catch>) yyVals[-1+yyTop];\n\t\t\n\t\tCatch c = (Catch) yyVals[0+yyTop];\n\t\tvar prev_catch = l [l.Count - 1];\n\t\tif (prev_catch.IsGeneral && prev_catch.Filter == null) {\n\t\t\treport.Error (1017, c.loc, \"Try statement already has an empty catch block\");\n\t\t}\n\t\t\n\t\tl.Add (c);\n\t\tyyVal = l;\n\t  }\n\nvoid case_960()\n#line 6406 \"cs-parser.jay\"\n{\n\t  \tvar c = new Catch ((ExplicitBlock) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));\n\t  \tc.Filter = (CatchFilterExpression) yyVals[-1+yyTop];\n\t  \tyyVal = c;\n\t  }\n\nvoid case_961()\n#line 6412 \"cs-parser.jay\"\n{\n\t\tstart_block (GetLocation (yyVals[-3+yyTop]));\n\t\tvar c = new Catch ((ExplicitBlock) current_block, GetLocation (yyVals[-4+yyTop]));\n\t\tc.TypeExpression = (FullNamedExpression) yyVals[-2+yyTop];\n\n\t\tif (yyVals[-1+yyTop] != null) {\n\t\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\t\tc.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t\tcurrent_block.AddLocalName (c.Variable);\n\t\t}\n\n\t\tlbag.AddLocation (c, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t\tyyVal = c;\n\t  }\n\nvoid case_962()\n#line 6427 \"cs-parser.jay\"\n{\n\t  \t((Catch) yyVals[-2+yyTop]).Filter = (CatchFilterExpression) yyVals[-1+yyTop];\n\t\tyyVal = yyVals[-2+yyTop];\n\t  }\n\nvoid case_963()\n#line 6432 \"cs-parser.jay\"\n{\n\t  \tif (yyToken == Token.CLOSE_PARENS) {\n\t\t\treport.Error (1015, lexer.Location,\n\t\t\t\t\"A type that derives from `System.Exception', `object', or `string' expected\");\n\t\t} else {\n\t\t\tError_SyntaxError (yyToken);\n\t\t}\n\t\t\n\t\tyyVal = new Catch (null, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_964()\n#line 6443 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\t/* Required otherwise missing block could not be detected because*/\n\t\t/* start_block is run early*/\n\t\tvar c = new Catch (null, GetLocation (yyVals[-5+yyTop]));\n\t\tc.TypeExpression = (FullNamedExpression) yyVals[-3+yyTop];\n\t\t\n\t\tif (yyVals[-2+yyTop] != null) {\n\t\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\t\tc.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t}\n\n\t\tif (yyVals[-2+yyTop] != null) {\n\t\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\t\tc.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t}\n\n\t\tlbag.AddLocation (c, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\n\t\tyyVal = c;\n\t  }\n\nvoid case_966()\n#line 6470 \"cs-parser.jay\"\n{\n\t\tif (lang_version <= LanguageVersion.V_5)\n\t\t\tFeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), \"exception filter\");\n\n\t  \tyyVal = new CatchFilterExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]));\n\t  \tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_969()\n#line 6495 \"cs-parser.jay\"\n{\n\t\tif (!settings.Unsafe)\n\t\t\tError_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_971()\n#line 6505 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  \n\t\tyyVal = new Lock ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_972()\n#line 6513 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\n\t\tyyVal = new Lock ((Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_973()\n#line 6523 \"cs-parser.jay\"\n{\n\t    start_block (GetLocation (yyVals[-2+yyTop]));\n\t    \n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.FixedVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new Fixed.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li);\n\t  }\n\nvoid case_974()\n#line 6533 \"cs-parser.jay\"\n{\n\t\tyyVal = current_variable;\n\t\tcurrent_variable = null;\n\t  }\n\nvoid case_975()\n#line 6538 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  \n\t\tFixed f = new Fixed ((Fixed.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop]));\n\t\tcurrent_block.AddStatement (f);\n\t\tlbag.AddStatement (f, GetLocation (yyVals[-8+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t\tyyVal = end_block (GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_976()\n#line 6551 \"cs-parser.jay\"\n{\n\t    start_block (GetLocation (yyVals[-2+yyTop]));\n\t    \n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tvar lt = (LocatedToken) yyVals[0+yyTop];\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.UsingVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new Using.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li);\n\t  }\n\nvoid case_977()\n#line 6561 \"cs-parser.jay\"\n{\n\t\tyyVal = current_variable;\t  \n\t\tcurrent_variable = null;\n\t  }\n\nvoid case_978()\n#line 6566 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  \n\t\tUsing u = new Using ((Using.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-8+yyTop]));\n\t\tlbag.AddStatement (u, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-2+yyTop]));\n\t\tcurrent_block.AddStatement (u);\n\t\tyyVal = end_block (GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_979()\n#line 6576 \"cs-parser.jay\"\n{\n\t\tif (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation (yyVals[0+yyTop]));\n\t  \n\t\tyyVal = new Using ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));\n\t  }\n\nvoid case_980()\n#line 6584 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\t\n\t\tyyVal = new Using ((Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_982()\n#line 6595 \"cs-parser.jay\"\n{\n\t\t/* It has to be here for the parent to safely restore artificial block*/\n\t  \tError_SyntaxError (yyToken);\n\t  }\n\nvoid case_984()\n#line 6607 \"cs-parser.jay\"\n{\n\t\tcurrent_variable.Initializer = (Expression) yyVals[0+yyTop];\n\t\tlbag.AddLocation (current_variable, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = current_variable;\n\t  }\n\nvoid case_985()\n#line 6619 \"cs-parser.jay\"\n{\n\t\tlexer.query_parsing = false;\n\t\t\t\n\t\tLinq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause;\n\t\t\t\n\t\tfrom.Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop];\n\t\tyyVal = from;\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\nvoid case_986()\n#line 6631 \"cs-parser.jay\"\n{\n\t\tLinq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause;\n\t\t\t\n\t\tfrom.Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop];\n\t\tyyVal = from;\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\nvoid case_987()\n#line 6642 \"cs-parser.jay\"\n{\n\t        lexer.query_parsing = false;\n\t\tyyVal = yyVals[-1+yyTop];\n\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\nvoid case_988()\n#line 6649 \"cs-parser.jay\"\n{\n\t        yyVal = yyVals[-1+yyTop];\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\nvoid case_989()\n#line 6658 \"cs-parser.jay\"\n{\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (clause, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = new Linq.QueryExpression (clause);\n\t  }\n\nvoid case_990()\n#line 6668 \"cs-parser.jay\"\n{\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-4+yyTop])) {\n\t\t\t\tIdentifierType = (FullNamedExpression)yyVals[-3+yyTop]\n\t\t};\n\t\tlbag.AddLocation (clause, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = new Linq.QueryExpression (clause);\n\t  }\n\nvoid case_991()\n#line 6683 \"cs-parser.jay\"\n{\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-3+yyTop]));\n\t\tlbag.AddLocation (clause, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = new Linq.QueryExpression (clause);\n\t  }\n\nvoid case_992()\n#line 6693 \"cs-parser.jay\"\n{\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-4+yyTop])) {\n\t\t\t\tIdentifierType = (FullNamedExpression)yyVals[-3+yyTop]\n\t\t};\n\t\tlbag.AddLocation (clause, GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = new Linq.QueryExpression (clause);\n\t  }\n\nvoid case_994()\n#line 6712 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tyyVal = new Linq.SelectMany ((Linq.QueryBlock)current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_996()\n#line 6727 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\n\t\tyyVal = new Linq.SelectMany ((Linq.QueryBlock)current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])) {\n\t\t\tIdentifierType = (FullNamedExpression)yyVals[-4+yyTop]\n\t\t};\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t\t\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\t\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  }\n\nvoid case_997()\n#line 6746 \"cs-parser.jay\"\n{\n\t  \tLinq.AQueryClause head = (Linq.AQueryClause)yyVals[-1+yyTop];\n\t\t\n\t\tif (yyVals[0+yyTop] != null)\n\t\t\thead.Next = (Linq.AQueryClause)yyVals[0+yyTop];\n\t\t\t\t\n\t\tif (yyVals[-2+yyTop] != null) {\n\t\t\tLinq.AQueryClause clause = (Linq.AQueryClause)yyVals[-2+yyTop];\n\t\t\tclause.Tail.Next = head;\n\t\t\thead = clause;\n\t\t}\n\t\t\n\t\tyyVal = head;\n\t  }\n\nvoid case_998()\n#line 6761 \"cs-parser.jay\"\n{\n\t  \tLinq.AQueryClause head = (Linq.AQueryClause)yyVals[0+yyTop];\n\n\t\tif (yyVals[-1+yyTop] != null) {\n\t\t\tLinq.AQueryClause clause = (Linq.AQueryClause)yyVals[-1+yyTop];\n\t\t\tclause.Tail.Next = head;\n\t\t\thead = clause;\n\t\t}\n\t\t\n\t\tyyVal = head;\n\t  }\n\nvoid case_1000()\n#line 6774 \"cs-parser.jay\"\n{\n\t\treport.Error (742, GetLocation (yyVals[0+yyTop]), \"Unexpected symbol `{0}'. A query body must end with select or group clause\", GetSymbolName (yyToken));\n\t\tyyVal = yyVals[-1+yyTop];\n\t  }\n\nvoid case_1001()\n#line 6779 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = null;\n\t  }\n\nvoid case_1003()\n#line 6791 \"cs-parser.jay\"\n{\n\t\tyyVal = new Linq.Select ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));\n\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\nvoid case_1004()\n#line 6798 \"cs-parser.jay\"\n{\n\t  \tif (linq_clause_blocks == null)\n\t  \t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \tlinq_clause_blocks.Push ((Linq.QueryBlock)current_block);\n\t  }\n\nvoid case_1005()\n#line 6806 \"cs-parser.jay\"\n{\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\nvoid case_1006()\n#line 6813 \"cs-parser.jay\"\n{\n\t\tvar obj = (object[]) yyVals[0+yyTop];\n\n\t\tyyVal = new Linq.GroupBy ((Linq.QueryBlock)current_block, (Expression)yyVals[-2+yyTop], linq_clause_blocks.Pop (), (Expression)obj[0], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddLocation (yyVal, (Location) obj[1]);\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\nvoid case_1008()\n#line 6830 \"cs-parser.jay\"\n{\n\t\tError_SyntaxError (yyToken);\n\t\tyyVal = new object[2] { null, Location.Null };\n\t  }\n\nvoid case_1010()\n#line 6839 \"cs-parser.jay\"\n{\n\t\t((Linq.AQueryClause)yyVals[-1+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop];\n\t\tyyVal = yyVals[-1+yyTop];\n\t  }\n\nvoid case_1017()\n#line 6859 \"cs-parser.jay\"\n{\n\t\tvar lt = (LocatedToken) yyVals[-3+yyTop];\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t  \tyyVal = new Linq.Let ((Linq.QueryBlock) current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]));\n\t  \t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t\t\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t  }\n\nvoid case_1019()\n#line 6878 \"cs-parser.jay\"\n{\n\t\tyyVal = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));\n\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\nvoid case_1020()\n#line 6888 \"cs-parser.jay\"\n{\n\t\tif (linq_clause_blocks == null)\n\t\t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\nvoid case_1021()\n#line 6896 \"cs-parser.jay\"\n{\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\nvoid case_1022()\n#line 6904 \"cs-parser.jay\"\n{\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\nvoid case_1023()\n#line 6912 \"cs-parser.jay\"\n{\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t  \n\t\tvar outer_selector = linq_clause_blocks.Pop ();\n\t\tvar block = linq_clause_blocks.Pop ();\n\n\t\tvar lt = (LocatedToken) yyVals[-10+yyTop];\t\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tLinq.RangeVariable into;\n\t\t\n\t\tif (yyVals[0+yyTop] == null) {\n\t\t\tinto = sn;\n\t  \t\tyyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, GetLocation (yyVals[-11+yyTop]));\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]));\n\t\t} else {\n\t\t\t/**/\n\t\t\t/* Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions*/\n\t\t\t/**/\n\t\t\tvar parent = block.Parent;\n\t\t\twhile (parent is Linq.QueryBlock) {\n\t\t\t\tparent = parent.Parent;\n\t\t\t}\n\t\t\tcurrent_block.Parent = parent;\n\t\t\t\n\t\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\t\n\t\t\tlt = (LocatedToken) yyVals[0+yyTop];\n\t\t\tinto = new Linq.RangeVariable (lt.Value, lt.Location);\n\n\t\t\tyyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, into, GetLocation (yyVals[-11+yyTop]));\t\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-3+yyTop]), opt_intoStack.Pop ());\n\t\t}\n\n\t\tcurrent_block = block.Parent;\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (into);\n\t  }\n\nvoid case_1024()\n#line 6950 \"cs-parser.jay\"\n{\n\t\tif (linq_clause_blocks == null)\n\t\t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\nvoid case_1025()\n#line 6958 \"cs-parser.jay\"\n{\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\nvoid case_1026()\n#line 6966 \"cs-parser.jay\"\n{\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\nvoid case_1027()\n#line 6974 \"cs-parser.jay\"\n{\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop]));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t  \n\t\tvar outer_selector = linq_clause_blocks.Pop ();\n\t\tvar block = linq_clause_blocks.Pop ();\n\t\t\n\t\tvar lt = (LocatedToken) yyVals[-10+yyTop];\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tLinq.RangeVariable into;\n\t\t\n\t\tif (yyVals[0+yyTop] == null) {\n\t\t\tinto = sn;\t\t\n\t  \t\tyyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, GetLocation (yyVals[-12+yyTop])) {\n\t  \t\t\tIdentifierType = (FullNamedExpression)yyVals[-11+yyTop]\n\t  \t\t};\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-10+yyTop]), GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]));\n\t\t} else {\n\t\t\t/**/\n\t\t\t/* Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions*/\n\t\t\t/**/\n\t\t\tvar parent = block.Parent;\n\t\t\twhile (parent is Linq.QueryBlock) {\n\t\t\t\tparent = parent.Parent;\n\t\t\t}\n\t\t\tcurrent_block.Parent = parent;\n\t\t\n\t\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\t\n\t\t\tlt = (LocatedToken) yyVals[0+yyTop];\n\t\t\tinto = new Linq.RangeVariable (lt.Value, lt.Location); /* TODO:*/\n\t\t\t\n\t\t\tyyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, into, GetLocation (yyVals[-12+yyTop])) {\n\t  \t\t\tIdentifierType = (FullNamedExpression)yyVals[-11+yyTop]\n\t  \t\t};\t\t\t\n\t\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[-10+yyTop]), GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]), opt_intoStack.Pop ());\n\t\t}\n\t\t\n\t\tcurrent_block = block.Parent;\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (into);\t\t\n\t  }\n\nvoid case_1029()\n#line 7020 \"cs-parser.jay\"\n{\n\t\topt_intoStack.Push (GetLocation (yyVals[-1+yyTop]));\n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_1030()\n#line 7028 \"cs-parser.jay\"\n{\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlbag.AddLocation (current_block, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_1031()\n#line 7033 \"cs-parser.jay\"\n{\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\tyyVal = yyVals[0+yyTop];\n\t  }\n\nvoid case_1033()\n#line 7044 \"cs-parser.jay\"\n{\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\nvoid case_1034()\n#line 7051 \"cs-parser.jay\"\n{\n\t\t((Linq.AQueryClause)yyVals[-3+yyTop]).Next = (Linq.AQueryClause)yyVals[0+yyTop];\n\t\tyyVal = yyVals[-3+yyTop];\n\t  }\n\nvoid case_1036()\n#line 7060 \"cs-parser.jay\"\n{\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\tcurrent_block = new Linq.QueryBlock ((Linq.QueryBlock) current_block, lexer.Location);\t \n\t }\n\nvoid case_1037()\n#line 7067 \"cs-parser.jay\"\n{\n\t\t((Linq.AQueryClause)yyVals[-3+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop];\n\t\tyyVal = yyVals[-3+yyTop];\n\t }\n\nvoid case_1039()\n#line 7079 \"cs-parser.jay\"\n{\n\t\tyyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]);\t\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_1040()\n#line 7084 \"cs-parser.jay\"\n{\n\t\tyyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]);\t\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_1042()\n#line 7096 \"cs-parser.jay\"\n{\n\t\tyyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]);\t\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_1043()\n#line 7101 \"cs-parser.jay\"\n{\n\t\tyyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]);\t\n\t\tlbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop]));\n\t  }\n\nvoid case_1045()\n#line 7111 \"cs-parser.jay\"\n{\n\t\t/* query continuation block is not linked with query block but with block*/\n\t\t/* before. This means each query can use same range variable names for*/\n\t\t/* different identifiers.*/\n\n\t\tcurrent_block.SetEndLocation (GetLocation (yyVals[-1+yyTop]));\n\t\tcurrent_block = current_block.Parent;\n\t\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\t\n\t\tif (linq_clause_blocks == null)\n\t\t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\t\t\n\t  }\n\nvoid case_1046()\n#line 7127 \"cs-parser.jay\"\n{\n\t\tvar current_block = linq_clause_blocks.Pop ();\t  \n\t\tvar lt = (LocatedToken) yyVals[-2+yyTop];\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n  \t\tyyVal = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, null, rv, GetLocation (yyVals[-3+yyTop])) {\n  \t\t\tnext = (Linq.AQueryClause)yyVals[0+yyTop]\n  \t\t};\n\t  }\n\nvoid case_1049()\n#line 7154 \"cs-parser.jay\"\n{ \n\t\tcurrent_container = current_type = new Class (current_container, new MemberName (\"<InteractiveExpressionClass>\"), Modifiers.PUBLIC, null);\n\n\t\t/* (ref object retval)*/\n\t\tParameter [] mpar = new Parameter [1];\n\t\tmpar [0] = new Parameter (new TypeExpression (compiler.BuiltinTypes.Object, Location.Null), \"$retval\", Parameter.Modifier.REF, null, Location.Null);\n\n\t\tParametersCompiled pars = new ParametersCompiled (mpar);\n\t\tvar mods = Modifiers.PUBLIC | Modifiers.STATIC;\n\t\tif (settings.Unsafe)\n\t\t\tmods |= Modifiers.UNSAFE;\n\n\t\tcurrent_local_parameters = pars;\n\t\tvar method = new InteractiveMethod (\n\t\t\tcurrent_type,\n\t\t\tnew TypeExpression (compiler.BuiltinTypes.Void, Location.Null),\n\t\t\tmods,\n\t\t\tpars);\n\t\t\t\n\t\tcurrent_type.AddMember (method);\t\t\t\n\t\toob_stack.Push (method);\n\n\t\tinteractive_async = false;\n\n\t\t++lexer.parsing_block;\n\t\tstart_block (lexer.Location);\n\t  }\n\nvoid case_1050()\n#line 7182 \"cs-parser.jay\"\n{\n\t\t--lexer.parsing_block;\n\t\tvar method = (InteractiveMethod) oob_stack.Pop ();\n\t\tmethod.Block = (ToplevelBlock) end_block(lexer.Location);\n\n\t\tif (interactive_async == true) {\n\t\t\tmethod.ChangeToAsync ();\n\t\t}\n\n\t\tInteractiveResult = (Class) pop_current_class ();\n\t\tcurrent_local_parameters = null;\n\t  }\n\nvoid case_1060()\n#line 7228 \"cs-parser.jay\"\n{\n\t\tmodule.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-1+yyTop];\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop];\n\t\tyyVal = null;\n\t  }\n\nvoid case_1061()\n#line 7234 \"cs-parser.jay\"\n{\n\t\tmodule.DocumentationBuilder.ParsedBuiltinType = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop]));\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop];\n\t\tyyVal = null;\n\t  }\n\nvoid case_1062()\n#line 7240 \"cs-parser.jay\"\n{\n\t\tmodule.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-3+yyTop];\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop];\n\t\tvar lt = (LocatedToken) yyVals[-1+yyTop];\n\t\tyyVal = new MemberName (lt.Value);\n\t  }\n\nvoid case_1065()\n#line 7255 \"cs-parser.jay\"\n{\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[-1+yyTop];\n\t\tyyVal = new MemberName ((MemberName) yyVals[-6+yyTop], MemberCache.IndexerNameAlias, Location.Null);\n\t  }\n\nvoid case_1066()\n#line 7260 \"cs-parser.jay\"\n{\n\t\tvar p = (List<DocumentationParameter>)yyVals[0+yyTop] ?? new List<DocumentationParameter> (1);\n\t\tp.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop]));\n\t\tmodule.DocumentationBuilder.ParsedParameters = p;\n\t\tmodule.DocumentationBuilder.ParsedOperator = Operator.OpType.Explicit;\n\t\tyyVal = null;\n\t  }\n\nvoid case_1067()\n#line 7268 \"cs-parser.jay\"\n{\n\t\tvar p = (List<DocumentationParameter>)yyVals[0+yyTop] ?? new List<DocumentationParameter> (1);\n\t\tp.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop]));\n\t\tmodule.DocumentationBuilder.ParsedParameters = p;\n\t\tmodule.DocumentationBuilder.ParsedOperator = Operator.OpType.Implicit;\n\t\tyyVal = null;\n\t  }\n\nvoid case_1068()\n#line 7276 \"cs-parser.jay\"\n{\n\t\tvar p = (List<DocumentationParameter>)yyVals[0+yyTop];\n\t\tmodule.DocumentationBuilder.ParsedParameters = p;\n\t\tmodule.DocumentationBuilder.ParsedOperator = (Operator.OpType) yyVals[-1+yyTop];\n\t\tyyVal = null;\n\t  }\n\nvoid case_1076()\n#line 7314 \"cs-parser.jay\"\n{\n\t\tvar parameters = new List<DocumentationParameter> ();\n\t\tparameters.Add ((DocumentationParameter) yyVals[0+yyTop]);\n\t\tyyVal = parameters;\n\t  }\n\nvoid case_1077()\n#line 7320 \"cs-parser.jay\"\n{\n\t\tvar parameters = yyVals[-2+yyTop] as List<DocumentationParameter>;\n\t\tparameters.Add ((DocumentationParameter) yyVals[0+yyTop]);\n\t\tyyVal = parameters;\n\t  }\n\nvoid case_1078()\n#line 7329 \"cs-parser.jay\"\n{\n\t\tif (yyVals[-1+yyTop] != null)\n\t\t\tyyVal = new DocumentationParameter ((Parameter.Modifier) yyVals[-1+yyTop], (FullNamedExpression) yyVals[0+yyTop]);\n\t\telse\n\t\t\tyyVal = new DocumentationParameter ((FullNamedExpression) yyVals[0+yyTop]);\n\t  }\n\n#line default\n   static readonly short [] yyLhs  = {              -1,\n    0,    4,    0,    0,    1,    1,    1,    1,    2,    2,\n   11,   11,   12,   12,   13,   13,   14,   15,   15,   15,\n   19,   20,   17,   17,   22,   22,   22,   18,   18,   18,\n   23,   23,   24,   24,    7,    7,    6,    6,   21,   21,\n    8,    8,   25,   25,   25,   26,   26,   26,   26,   26,\n    9,    9,   10,   10,   34,   32,   37,   33,   33,   33,\n   33,   35,   35,   35,   36,   36,   41,   38,   39,   40,\n   40,   42,   42,   42,   42,   42,   43,   43,   43,   47,\n   44,   46,   49,   49,   49,   51,   51,   52,   52,   53,\n   53,   53,   53,   53,   53,   53,   53,   53,   53,   53,\n   53,   53,   53,   67,   62,   72,   74,   77,   78,   79,\n   28,   28,   82,   54,   54,   83,   83,   84,   84,   85,\n   87,   81,   81,   86,   86,   92,   55,   96,   55,   55,\n   91,   99,   91,   93,   93,  100,  100,  101,  102,  101,\n   97,   97,  103,  103,  104,  105,   95,   95,   98,   98,\n   98,  108,   56,  111,  112,  106,  113,  114,  115,  106,\n  106,  106,  107,  107,  117,  117,  120,  118,  110,  110,\n  121,  121,  121,  121,  121,  121,  121,  121,  121,  121,\n  122,  122,  125,  125,  125,  125,  128,  125,  126,  126,\n  129,  129,  130,  130,  130,  123,  123,  123,  131,  131,\n  131,  124,  133,  135,  136,  138,   57,  139,   57,  137,\n  141,  137,  140,  140,  143,  145,   59,  144,  144,  134,\n  134,  134,  134,  134,  149,  146,  150,  147,  148,  148,\n  148,  151,  152,  153,  155,   29,   29,  154,  154,  156,\n  156,  157,  157,  157,  157,  157,  157,  157,  157,  157,\n  159,   60,  160,  160,  163,  158,  158,  162,  162,  162,\n  162,  162,  162,  162,  162,  162,  162,  162,  162,  162,\n  162,  162,  162,  162,  162,  162,  162,  162,  162,  165,\n  164,  166,  164,  164,  164,   61,  169,  171,  167,  168,\n  168,  170,  170,  175,  173,  176,  173,  173,  173,  177,\n   63,  179,   58,  182,  183,   58,   58,  178,  185,  178,\n  180,  180,  186,  186,  187,  188,  187,  189,  184,  181,\n  181,  181,  181,  181,  193,  190,  194,  191,  192,  192,\n   64,   65,  196,  198,  199,   30,  195,  195,  195,  197,\n  197,  197,  200,  200,  201,  202,  201,  201,  201,  203,\n  204,  205,   31,  206,  206,   16,   16,   16,  207,  207,\n  207,  211,  211,  209,  209,  209,  212,  212,  214,   71,\n  132,  109,  109,  142,  142,  215,  215,  215,  213,  213,\n  216,  216,  217,  217,  219,  219,   90,   80,   80,   94,\n   94,  127,  127,  161,  161,  221,  221,  221,  220,  224,\n  224,  224,  226,  226,  227,  225,  225,  225,  225,  225,\n  225,  225,  228,  228,  228,  228,  228,  228,  228,  228,\n  228,  229,  229,  229,  229,  229,  229,  229,  229,  229,\n  229,  229,  229,  229,  229,  229,  229,  229,  229,  229,\n  229,  230,  230,  230,  231,  231,  231,  251,  251,  252,\n  252,  253,  253,  233,  233,  250,  250,  250,  250,  250,\n  250,  250,  250,  250,  250,  250,  250,  235,  235,  235,\n  255,  255,  256,  256,  257,  257,  259,  259,  259,  260,\n  260,  260,  260,  260,  260,  260,  261,  261,  174,  174,\n  254,  254,  254,  254,  254,  266,  266,  265,  265,  267,\n  267,  267,  267,  268,  236,  236,  236,  236,  264,  264,\n  269,  269,  270,  270,  237,  238,  238,  239,  240,  241,\n  241,  232,  232,  232,  232,  232,  275,  271,  242,  242,\n  276,  276,  277,  277,  278,  278,  278,  278,  279,  279,\n  279,  279,  272,  272,  222,  222,  274,  274,  280,  280,\n  273,  273,   89,   89,  281,  281,  243,  282,  282,  210,\n  208,  244,  244,  245,  245,  246,  246,  247,  284,  248,\n  285,  248,  283,  283,  287,  286,  234,  288,  288,  288,\n  288,  288,  288,  288,  288,  288,  289,  289,  289,  289,\n  289,  289,  289,  289,  289,  289,  289,  289,  289,  290,\n  290,  290,  290,  290,  290,  290,  291,  291,  291,  291,\n  291,  291,  291,  291,  291,  291,  291,  292,  292,  292,\n  292,  292,  294,  294,  294,  294,  295,  295,  295,  295,\n  295,  296,  296,  296,  296,  296,  296,  296,  296,  296,\n  297,  297,  297,  297,  297,  298,  298,  298,  299,  299,\n  299,  300,  300,  300,  301,  301,  301,  302,  302,  302,\n  303,  303,  304,  304,  304,  304,  304,  305,  305,  305,\n  305,  305,  305,  305,  305,  305,  305,  305,  306,  306,\n  307,  307,  307,  307,  308,  308,  310,  309,  309,  309,\n   50,   50,  312,  311,  313,  311,  314,  311,  315,  316,\n  311,  317,  318,  311,   45,   45,  262,  262,  262,  262,\n  249,  249,  249,   88,  320,   73,   73,  321,  322,  322,\n  322,  322,  324,  322,  325,  326,  327,  328,   27,   70,\n   70,   69,   69,  116,  116,  329,  329,  329,  329,  329,\n  329,  329,  329,  329,  329,  329,  329,  329,  329,  329,\n   75,   75,  323,  323,   76,   76,  330,  330,  331,  331,\n  332,  332,  333,  333,  333,  333,  218,  218,  334,  334,\n  335,  119,   68,   68,  336,  172,  172,  338,  337,   66,\n   66,  339,  339,  340,  340,  340,  340,  340,  344,  344,\n  345,  345,  345,  342,  342,  342,  342,  342,  342,  342,\n  342,  342,  342,  342,  342,  342,  346,  346,  346,  346,\n  346,  346,  346,  346,  346,  346,  346,  346,  346,  360,\n  360,  360,  360,  347,  361,  343,  362,  362,  363,  363,\n  363,  363,  223,  223,  364,   48,   48,  366,  341,  370,\n  341,  368,  368,  365,  365,  365,  367,  367,  374,  374,\n  373,  373,  375,  375,  369,  369,  371,  371,  376,  376,\n  377,  372,  372,  372,  348,  348,  348,  359,  359,  378,\n  379,  379,  349,  349,  380,  380,  380,  383,  381,  381,\n  382,  382,  384,  384,  384,  385,  386,  386,  387,  387,\n  387,  350,  350,  350,  350,  388,  388,  389,  389,  389,\n  393,  390,  396,  392,  392,  399,  395,  395,  398,  398,\n  394,  394,  402,  401,  401,  397,  397,  400,  400,  404,\n  403,  403,  391,  391,  405,  391,  391,  391,  351,  351,\n  351,  351,  351,  351,  406,  407,  407,  408,  408,  408,\n  409,  409,  409,  410,  410,  410,  411,  411,  411,  412,\n  412,  352,  352,  352,  352,  413,  413,  293,  293,  414,\n  416,  414,  414,  414,  415,  415,  353,  354,  417,  357,\n  355,  355,  419,  420,  358,  422,  423,  356,  356,  356,\n  421,  421,  418,  418,  319,  319,  319,  319,  424,  424,\n  426,  426,  428,  427,  429,  427,  425,  425,  425,  425,\n  425,  433,  431,  434,  436,  431,  435,  435,  430,  430,\n  437,  437,  437,  437,  437,  442,  438,  443,  439,  444,\n  445,  446,  440,  448,  449,  450,  440,  447,  447,  452,\n  441,  451,  455,  451,  454,  457,  454,  453,  453,  453,\n  456,  456,  456,  432,  458,  432,    3,    3,  459,    3,\n    3,  460,  460,  263,  263,  258,  258,    5,  461,  461,\n  461,  461,  461,  465,  461,  461,  461,  461,  462,  462,\n  463,  466,  463,  464,  464,  467,  467,  468,\n  };\n   static readonly short [] yyLen = {           2,\n    2,    0,    3,    1,    2,    4,    3,    1,    0,    1,\n    1,    2,    4,    2,    1,    2,    1,    3,    5,    2,\n    0,    0,   11,    3,    0,    1,    1,    1,    3,    1,\n    0,    1,    0,    1,    0,    1,    0,    1,    0,    1,\n    1,    2,    1,    1,    2,    1,    1,    1,    1,    1,\n    0,    1,    1,    2,    0,    3,    0,    6,    3,    2,\n    1,    1,    1,    1,    1,    3,    0,    3,    1,    0,\n    3,    0,    1,    1,    3,    3,    1,    1,    1,    0,\n    4,    4,    0,    1,    1,    0,    1,    1,    2,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    0,    4,    0,    0,    0,    0,    0,\n   17,    5,    0,    9,    5,    0,    1,    1,    2,    3,\n    0,    3,    1,    1,    1,    0,    8,    0,    9,    6,\n    0,    0,    3,    0,    1,    1,    2,    2,    0,    5,\n    0,    1,    1,    2,    3,    0,    4,    2,    1,    1,\n    1,    0,    3,    0,    0,   10,    0,    0,    0,   12,\n    8,    5,    1,    1,    1,    1,    0,    4,    0,    1,\n    1,    3,    3,    3,    5,    3,    5,    1,    1,    1,\n    1,    3,    4,    6,    2,    4,    0,    7,    0,    1,\n    1,    2,    1,    1,    1,    4,    6,    4,    1,    2,\n    2,    1,    0,    0,    0,    0,   12,    0,    6,    0,\n    0,    4,    1,    1,    0,    0,   10,    3,    1,    1,\n    2,    1,    2,    1,    0,    5,    0,    5,    1,    1,\n    1,    0,    0,    0,    0,   15,    5,    0,    1,    1,\n    2,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    0,    5,    1,    1,    0,    7,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    0,\n    7,    0,    7,    2,    2,    2,    0,    0,    9,    1,\n    1,    0,    1,    0,    6,    0,    6,    2,    1,    0,\n    8,    0,    9,    0,    0,   10,    5,    0,    0,    3,\n    0,    1,    1,    2,    2,    0,    5,    0,    2,    2,\n    2,    1,    1,    1,    0,    5,    0,    5,    1,    1,\n    2,    4,    0,    0,    0,   12,    0,    2,    2,    0,\n    1,    2,    1,    3,    2,    0,    5,    3,    1,    0,\n    0,    0,   13,    0,    1,    1,    3,    3,    1,    4,\n    4,    2,    2,    0,    3,    2,    1,    3,    0,    3,\n    1,    1,    3,    1,    2,    3,    4,    4,    0,    3,\n    1,    3,    3,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    2,    2,    2,    1,    1,    2,\n    2,    2,    1,    3,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    2,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    3,    3,    4,    4,    5,    4,    4,\n    4,    3,    3,    3,    4,    3,    4,    4,    4,    3,\n    0,    1,    3,    4,    0,    1,    1,    3,    2,    3,\n    3,    1,    2,    3,    5,    2,    1,    1,    0,    1,\n    1,    3,    3,    3,    2,    1,    1,    1,    1,    2,\n    2,    4,    3,    1,    4,    5,    4,    3,    1,    3,\n    1,    3,    1,    1,    1,    4,    3,    2,    2,    6,\n    3,    7,    4,    3,    7,    3,    0,    2,    4,    3,\n    1,    2,    0,    1,    1,    3,    1,    2,    3,    1,\n    1,    1,    0,    1,    1,    2,    2,    3,    1,    2,\n    0,    1,    2,    4,    1,    3,    4,    1,    1,    1,\n    2,    4,    4,    4,    2,    4,    2,    4,    0,    4,\n    0,    5,    0,    1,    0,    4,    4,    1,    2,    2,\n    4,    2,    2,    2,    4,    2,    1,    2,    2,    2,\n    2,    2,    2,    2,    2,    2,    2,    2,    2,    1,\n    3,    3,    3,    3,    3,    3,    1,    3,    3,    3,\n    3,    3,    4,    3,    3,    3,    3,    1,    2,    1,\n    2,    2,    2,    2,    1,    1,    1,    3,    3,    3,\n    3,    1,    3,    3,    3,    3,    3,    3,    3,    3,\n    1,    3,    3,    3,    3,    1,    3,    3,    1,    3,\n    3,    1,    3,    3,    1,    3,    3,    1,    3,    3,\n    1,    3,    1,    5,    4,    5,    5,    3,    3,    3,\n    3,    3,    3,    3,    3,    3,    3,    3,    1,    3,\n    3,    2,    1,    1,    0,    1,    0,    2,    1,    1,\n    1,    1,    0,    4,    0,    4,    0,    5,    0,    0,\n    7,    0,    0,    8,    1,    1,    1,    1,    1,    1,\n    6,    4,    4,    1,    1,    0,    1,    3,    0,    1,\n    1,    2,    0,    6,    0,    0,    0,    0,   15,    0,\n    1,    0,    1,    1,    2,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    0,    1,    2,    3,    0,    1,    1,    2,    4,    3,\n    1,    3,    1,    3,    1,    1,    0,    1,    1,    1,\n    0,    4,    1,    1,    0,    4,    1,    0,    4,    0,\n    1,    1,    2,    1,    1,    1,    2,    1,    1,    2,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n    1,    1,    1,    1,    0,    4,    1,    2,    2,    2,\n    1,    1,    1,    2,    1,    1,    1,    0,    6,    0,\n    7,    1,    1,    0,    2,    1,    0,    1,    0,    1,\n    1,    2,    2,    4,    0,    2,    0,    1,    1,    2,\n    4,    1,    5,    2,    2,    2,    2,    2,    2,    1,\n    1,    1,    1,    1,    5,    7,    4,    0,    8,    4,\n    0,    1,    1,    2,    1,    2,    1,    2,    3,    3,\n    1,    1,    1,    1,    1,    5,    4,    7,    3,    6,\n    0,    4,    0,    4,    2,    0,    4,    2,    3,    1,\n    0,    1,    0,    5,    1,    0,    1,    0,    1,    1,\n    1,    3,    4,    5,    0,    9,    5,    4,    1,    1,\n    1,    1,    1,    1,    2,    2,    2,    3,    4,    3,\n    3,    3,    2,    3,    3,    2,    4,    4,    3,    0,\n    1,    3,    4,    5,    3,    1,    2,    0,    1,    3,\n    0,    8,    3,    6,    0,    4,    2,    2,    0,    3,\n    5,    4,    0,    0,   10,    0,    0,    9,    5,    4,\n    2,    1,    0,    2,    2,    2,    2,    2,    4,    5,\n    4,    5,    0,    5,    0,    6,    3,    2,    2,    2,\n    1,    0,    3,    0,    0,    5,    2,    1,    1,    2,\n    1,    1,    1,    1,    1,    0,    5,    0,    3,    0,\n    0,    0,   12,    0,    0,    0,   13,    0,    2,    0,\n    3,    1,    0,    4,    1,    0,    4,    1,    2,    2,\n    1,    2,    2,    0,    0,    4,    2,    3,    0,    4,\n    2,    2,    3,    0,    1,    1,    1,    2,    2,    2,\n    2,    4,    3,    0,    7,    4,    4,    3,    1,    3,\n    0,    0,    4,    0,    1,    1,    3,    2,\n  };\n   static readonly short [] yyDefRed = {            0,\n    8,    0,    0,    0,    0,    0,    0,    0,    2,    4,\n    0,    0,   11,   14,    0, 1047,    0,    0, 1051,    0,\n    0,   15,   17,  408,  414,  421,  409,  411,    0,  410,\n    0,  417,  419,  406,    0,  413,  415,  407,  418,  420,\n  416,    0,  369, 1069,    0,  412, 1058,    0,   10,    1,\n    0,    0,    0,   12,    0,  872,    0,    0,    0,    0,\n    0,    0,    0,    0,  449,    0,    0,    0,    0,    0,\n    0,    0,  447,    0,    0,    0,  515,    0,  448,    0,\n    0,    0,  969,    0,    0,    0,  710,    0,    0,    0,\n    0,    0,    0,    0,  771,    0,  824,    0,    0,    0,\n    0,    0,    0,    0,    0,  446,    0,  699,    0,  871,\n    0,  807,    0,  442,  832,  831,    0,    0,    0,  423,\n  424,  425,  426,  427,  428,  429,  430,  431,  432,  433,\n  434,  435,  436,  437,  438,  439,  440,  441,  444,  445,\n  706,  587,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  707,  705,  708,  709,  791,  793,\n    0,  789,  792,  808,  810,  811,  812,  813,  814,  815,\n  816,  817,  818,  819,  809,    0,    0,    0,  873,  874,\n  892,  893,  894,  895,  929,  930,  931,  932,  933,  934,\n    0,    0,    0,   20,    0,    0,  356,    0,  359, 1055,\n   16, 1048,    0,    0,  263,  262,  259,  264,  265,  258,\n  277,  276,  269,  270,  266,  268,  267,  271,  260,  261,\n  272,  273,  279,  278,  274,  275,    0, 1072, 1061,    0,\n    0, 1060,    0, 1059,    3,   55,    0,    0,    0,   44,\n   41,   43,   46,   47,   48,   49,   50,   53,   13,    0,\n    0,    0,  935,  565,  450,  451,  967,    0,    0,    0,\n    0,    0,    0,    0,    0,  937,  936,    0,  575,  569,\n  574,  823,  870,  794,  821,  820,  822,  795,  796,  797,\n  798,  799,  800,  801,  802,  803,  804,  805,  806,    0,\n    0,    0,  901,    0,    0,    0,  837,  836,    0,    0,\n    0,    0,    0,    0,    0,    0,  943,    0,    0,    0,\n    0,  422,    0,    0,    0,  946,    0,    0,    0,    0,\n  567,  968,    0,    0,    0,  835,  402,    0,    0,    0,\n    0,    0,    0,  388,  389,    0,  398,    0,    0,    0,\n    0,    0,    0,    0,  702,    0,  586,    0,    0,  695,\n    0,    0,  582,    0,    0,  584,  580,  594,  588,  595,\n  589,  583,  579,  599,  593,  598,  592,  596,  590,  597,\n  591,  693,  561,    0,  560,  443,  362,  363,    0,    0,\n    0,    0,    0,  825,    0,  355,    0,  400,  401,    0,\n    0,  518,  519,    0,    0,    0,  829,  830,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0, 1050,  790,  838,  828,    0,  868,  869, 1001, 1018,\n    0,    0, 1002, 1004,    0, 1030,  987,  985, 1011,    0,\n    0, 1009, 1012, 1013, 1014, 1015,  988,  986,    0,    0,\n    0,    0,   18,    0,    0,    0, 1068,    0,    0,  370,\n    0,    0, 1070,    0,    0,   42,  741,  747,  739,    0,\n  736,  746,  740,  738,  737,  744,  742,  743,  749,  745,\n  748,  750,    0,    0,  734,   45,   54,  517,    0,  513,\n  514,    0,    0,  511,    0,  840,    0,    0,    0,  899,\n    0,  867,  865,  866,    0,    0,    0,  714,    0,  940,\n  938,  715,    0,    0,  542,    0,    0,  530,  537,    0,\n    0,    0,  531,    0,    0,  547,  549,    0,  526,    0,\n    0,    0,    0,    0,  521,    0,  524,  528,  391,  390,\n  942,  941,    0,    0,  945,  944,  955,    0,    0,    0,\n  956,  559,    0,  385,  558,    0,    0,  970,    0,    0,\n  834,    0,  396,  397,    0,    0,  395,    0,    0,    0,\n  600,    0,    0,  571,    0,  697,  617,  616,    0,    0,\n  788,    0,    0,    0,  782,  784,  785,  786,  454,  455,\n    0,  366,  367,    0,  194,  193,  195,    0,  684,    0,\n    0,    0,  392,    0,  679,    0,    0,  949,    0,    0,\n    0,  462,  463,    0,  466,    0,    0,    0,    0,  464,\n    0,    0,  508,    0,  470,    0,    0,    0,    0,  496,\n  499,    0,    0,  491,  498,  497,  668,  669,  670,  671,\n  672,  673,  674,  675,  676,  678,  677,  604,  601,  606,\n  603,  605,  602,  614,  612,  615,    0,    0,  626,  625,\n    0,    0,    0,    0,  610,    0,  611,    0,  630,    0,\n    0,  631,    0,  637,    0,  638,    0,  639,    0,  640,\n    0,  644,    0,  645,    0,  648,    0,  651,    0,  654,\n    0,  657,    0,  660,    0,  662,    0,    0,  546,    0,\n    0,    0,    0,    0,    0,    0,    0,    0, 1000,  999,\n    0, 1010,    0,  998,    0,    0,  357,  358, 1066, 1067,\n    0,    0,  191,    0,    0, 1076,  384,    0,    0,    0,\n  381, 1062, 1064,   61,   63,   64,    0,    0,   56,    0,\n    0,   65,   67,   30,   28,    0,    0,    0,  731,    0,\n  735,  460,    0,  516,    0,  564,    0,  577,  180,  202,\n    0,    0,    0,  170,    0,    0,    0,  181,  570,    0,\n  973,    0,  921,  902,    0,  912,    0,  923,    0,  939,\n  877,    0,  972,    0,    0,  529,    0,  538,  548,  550,\n    0,    0,    0,    0,  482,    0,    0,  477,    0,    0,\n  692,  691,  509,    0,  552,  523,    0,    0,  151,  553,\n  149,  150,  555,    0,  563,  562,  880,    0,    0,    0,\n    0,  953,    0,  957,  557,  566,  980,    0,  976,  897,\n    0,  991,    0,  989,    0,    0,  712,  713,    0,    0,\n    0,  690,  689,  696,    0,  461,  787,  773,  774,  772,\n  783,  694,    0,  365,  682,    0,    0,    0,  585,  581,\n  948,  947,  826,  467,  459,    0,    0,  465,  456,  457,\n  568,  507,  505,  504,  501,  500,    0,  495,  452,  453,\n  468,  469,    0,  621,  622,  623,  624,  959,  613,  619,\n  665,    0,  846,    0,    0, 1019,  993,    0, 1020,    0,\n 1003, 1005, 1016,    0, 1031,    0,  997, 1045,   19,  360,\n  361, 1078,  192, 1073,    0,  770,  769,    0,  768,    0,\n  380,    0,   60,   57,    0,    0,    0,    0,    0,    0,\n  387,    0,  725,    0,    0,   85,   84,    0,  512,    0,\n    0,    0,    0,    0,  185,  576,    0,    0,    0,    0,\n    0,  913,  905,  903,    0,  924,    0,    0,  971,  539,\n  536,    0,  486,    0,    0,    0, 1056, 1057,  473,  479,\n    0,  483,    0,    0,    0,    0,    0,    0,  878,    0,\n  963,    0,  960,  954,  979,    0,  896,  992,  990,    0,\n  572,    0,  698,  688,  368,  681,  680,  700,  458,  506,\n  503,    0,  494,  493,  492,  666,  667,  664,    0,  862,\n  845,    0,    0,    0,  851,    0,  995,    0, 1024,    0,\n    0, 1039, 1040, 1033,    0, 1077,  383,  382,    0,    0,\n   66,   59,    0,   68,   29,   22,    0,    0,  333,    0,\n  237,    0,  112,    0,   82,  856,  124,  125,    0,    0,\n    0,  859,  200,  201,    0,    0,    0,    0,  173,  182,\n  174,  176,  900,    0,    0,    0,    0,    0,  922,    0,\n    0,  487,  488,  481,  484,  480,    0,  474,  478,    0,\n  544,    0,  510,  520,  472,  556,  554,    0,    0,    0,\n  982,    0,    0,  711,  703,    0,  502,    0,    0,  843,\n  842,  839,  852,  994,    0,    0,    0, 1008,    0, 1006,\n 1017,    0, 1046, 1065,    0,   79,    0,    0,   73,   74,\n   77,   78,    0,  350,  339,  338,    0,  726,  233,  107,\n    0,  841,  860,  186,    0,  198,    0,    0,    0,  898,\n  984,    0,    0,    0,    0,  904,    0,  925,  876,    0,\n  525,  522,  885,    0,  891,    0,    0,  883,    0,  887,\n  966,    0,  981,  977,    0,  701,    0,    0,  996, 1021,\n    0, 1007,    0,    0, 1035,    0,   80,   71,    0,    0,\n    0,  334,    0,    0,    0,    0,    0,  187,    0,  177,\n  175,  974,  914,  908,  906,    0,  485,    0,  879,  884,\n    0,  888,  964,    0,    0,  704,    0,  854,    0, 1025,\n 1042, 1043, 1036,   58,    0,   75,   76,    0,    0,    0,\n    0,    0,    0,    0,  720,    0,  752,    0,  717,  861,\n  184,    0,  197,    0,    0,  926,  890,  889,    0,  978,\n  863,    0,    0,    0,   81,    0,    0,  351,    0,    0,\n  349,  335,    0,  343,    0,  405,    0,  403,    0,    0,\n  727,    0,  757,  234,    0,  188,  975,  910,  907,    0,\n    0,  919,  775,  777,  962, 1022,    0, 1037,    0,    0,\n    0,  331,    0,    0,  718,  754,    0,  723,    0,    0,\n  758,    0,  108,    0,    0,    0, 1026,   27,   26,   23,\n  352,  348,    0,    0,  344,  404,    0,  760,    0,    0,\n    0,    0,  909,    0,    0,    0,    0,    0,   32,  336,\n    0,  765,    0,  766,  763,    0,  761,  103,  104,    0,\n  100,    0,    0,   88,   90,   91,   92,   93,   94,   95,\n   96,   97,   98,   99,  101,  102,  152,    0,    0,  250,\n  242,  243,  244,  245,  246,  247,  248,  249,    0,    0,\n  240,  109,  776,    0, 1023,    0,  353,  347,  724,    0,\n    0,    0,    0,  728,   89,    0,  291,  286,  290,    0,\n  235,  241,    0, 1029, 1027,  764,  762,    0,    0,    0,\n    0,    0,    0,    0,    0,  300,    0,    0,  251,    0,\n    0,  257,    0,  167,  166,  153,  163,  164,  165,    0,\n    0,    0,  105,    0,    0,  285,    0,    0,  284,    0,\n  157,    0,    0,  374,  332,    0,  372,    0,    0,    0,\n    0,    0,    0,    0,    0,  729,    0,  236,  110,  115,\n  113,  307,    0,  371,    0,    0,    0,    0,  128,    0,\n    0,    0,    0,    0,    0,  162,  154,    0,    0,    0,\n  215,    0,  375,    0,  252,    0,    0,    0,    0,  304,\n    0,  282,  130,    0,  280,    0,    0,    0,  132,    0,\n  376,    0,    0,  204,  209,    0,    0,    0,  373,  255,\n  168,  111,  123,  121,    0,    0,  309,    0,    0,    0,\n    0,    0,  158,    0,  288,    0,    0,    0,    0,  136,\n    0,    0,    0,    0,  377,  378,    0,    0,    0,    0,\n    0,  118,  324,    0,  305,    0,    0,  318,    0,    0,\n    0,  313,    0,  148,    0,    0,    0,    0,  143,    0,\n    0,  301,    0,  133,    0,  127,  137,  155,  161,  224,\n    0,  205,    0,    0,  216,    0,  122,    0,  114,  119,\n    0,    0,    0,  320,    0,  321,  310,    0,    0,  303,\n  314,  283,    0,    0,  129,  144,  281,    0,  299,    0,\n  289,  293,  139,    0,    0,    0,  221,  223,    0,  256,\n  120,  325,  327,  306,    0,    0,  319,  316,  147,  145,\n  159,  298,    0,    0,    0,  156,  225,  227,  206,    0,\n  219,  217,    0,    0,  318,    0,  294,  296,  140,    0,\n    0,    0,    0,  329,  330,  326,  328,  317,  160,    0,\n    0,  231,  230,  229,  226,  228,  211,  207,  218,    0,\n    0,    0,  295,  297,  213,  214,    0,  212,\n  };\n  protected static readonly short [] yyDgoto  = {             7,\n    8,   50,    9,   51,   10,   11,   52,  237,  771,  772,\n   12,   13,   53,   22,   23,  331,  240,  756,  939, 1133,\n 1257, 1310, 1634,  936,  241,  242,  243,  244,  245,  246,\n  247,  248,  749,  474,  750,  751, 1040,  752,  753, 1044,\n  937, 1128, 1129, 1130,  273,  641, 1225,  111,  948,  813,\n 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351,\n 1352, 1353, 1354, 1355, 1356,  593, 1382,  860,  493,  760,\n 1437, 1054, 1238, 1195, 1236, 1271, 1322, 1393, 1478, 1266,\n 1505, 1479, 1530, 1531, 1532, 1056, 1528, 1057,  822,  940,\n 1490, 1464, 1518,  548, 1511, 1484, 1547, 1020, 1516, 1519,\n 1520, 1615, 1548, 1549, 1545, 1357, 1416, 1386, 1438,  773,\n 1492, 1594, 1461, 1551, 1626,  494, 1417, 1418,  274, 1447,\n  774,  775,  776,  777,  778,  731,  611, 1242,  732,  733,\n  954, 1440, 1469, 1562, 1523, 1596, 1648, 1632, 1470, 1657,\n 1652, 1441, 1496, 1622, 1599, 1563, 1564, 1645, 1630, 1631,\n 1052, 1194, 1302, 1369, 1421, 1370, 1371, 1409, 1444, 1410,\n  334,  227, 1527, 1412, 1512, 1509, 1358, 1388, 1433, 1591,\n 1553, 1285, 1592,  642, 1640, 1641, 1432, 1508, 1481, 1540,\n 1535, 1506, 1572, 1577, 1538, 1541, 1542, 1625, 1578, 1536,\n 1537, 1636, 1623, 1624, 1049, 1137, 1262, 1230, 1293, 1263,\n 1264, 1313, 1191, 1290, 1327,  388,  197,  113,  377,  378,\n  114,  604,  470,  230, 1456,  740,  741,  928,  941,  335,\n  336,  435,  327,  337,  311, 1267, 1268,   46,  118,  312,\n  120,  121,  122,  123,  124,  125,  126,  127,  128,  129,\n  130,  131,  132,  133,  134,  135,  136,  137,  138,  139,\n  140,  258,  891,  818, 1094, 1083,  806,  979,  807,  808,\n 1084,  141,  202,  814,  644,  645,  646,  885,  503,  504,\n  304, 1092,  816,  436,  306,  532,  533,  534,  535,  538,\n  824,  566,  270,  509,  849,  271,  508,  142,  143,  144,\n  145,  673,  899,  674,  146,  147,  148,  149,  150,  151,\n  152,  153,  154,  155,  156,  614,  615,  616,  854,  855,\n  157,  601,  589,  851,  379, 1106,  585, 1175,  158,  523,\n 1233, 1234, 1237, 1317, 1050, 1193, 1300, 1413,  495, 1272,\n 1273, 1336, 1337,  929,  354, 1305,    0,    0,  594,  595,\n  275,  276,  277,  161,  162,  163,  278,  279,  280,  281,\n  282,  283,  284,  285,  286,  287,  288,  289,  175,  290,\n  621,  176,  177,  328,  905,  708, 1023, 1112,  951,  767,\n 1060, 1021, 1024, 1153, 1025, 1061, 1062,  291,  178,  179,\n  180, 1166, 1098, 1167, 1168, 1169, 1170,  181,  182,  183,\n  184,  784,  516,  785, 1156, 1078, 1157, 1279, 1245, 1280,\n  786, 1077,  787, 1282, 1206,  185,  186,  187,  188,  189,\n  190,  313,  560,  561,  831, 1214,  324, 1076,  961, 1244,\n 1103,  996, 1215,  191,  448,  192,  449, 1026, 1115,  450,\n  451,  724,  715,  716, 1120, 1030,  452,  453,  454,  455,\n  456, 1031,  710, 1028, 1219, 1306, 1375, 1117, 1253, 1326,\n  915,  718,  916, 1184, 1122, 1185, 1254, 1035,   17,   19,\n   47,   48,  229,  734,  932,  468,  735,  736,\n  };\n  protected static readonly short [] yySindex = {          -68,\n    0, -187,  189,  161,  258,18441,    0,  251,    0,    0,\n  258,  161,    0,    0,  303,    0, 8261,  258,    0, -151,\n -258,    0,    0,    0,    0,    0,    0,    0,  249,    0,\n  448,    0,    0,    0, 5471,    0,    0,    0,    0,    0,\n    0,  297,    0,    0,  426,    0,    0,  720,    0,    0,\n  251,  495,  258,    0,  534,    0,  322,  590, -183,17987,\n  -27,  138,  512, 8419,    0,  138,  138,  138,  -90,  138,\n  138,  610,    0,10410,  138,  138,    0,10568,    0,  642,\n  138, -181,    0,  138,  645,  138,    0,18473,18473,  666,\n  138,  138,   97,10728,    0,17096,    0,11916,12048,12180,\n12312,12444,12576,12708,12840,    0,  232,    0, 9503,    0,\n  184,    0,   50,    0,    0,    0,  579,  500, -234,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  853,  917,  209,  755,  636,  338,  671,  697,\n  686,  694,  533,  713,    0,    0,    0,    0,    0,    0,\n 3940,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   50,  745,  197,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n  377,  418,  495,    0,  517, -240,    0,  704,    0,    0,\n    0,    0, 9503, 9503,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  297,    0,    0,  712,\n  751,    0, -200,    0,    0,    0,  495,19024,  841,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,  877,\n   50,17233,    0,    0,    0,    0,    0,17096, -205, -141,\n  901,  811,  488,  500,   50,    0,    0, 9503,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,  156,\n  275,17987,    0, 9503,17096,  816,    0,    0,  826,17096,\n17096, 6467,  537,  -93,  874, 9503,    0,10728,  232, 1010,\n  897,    0,  913, 9503,17096,    0, 1022,  918,  690,  951,\n    0,    0,17096,  642,16685,    0,    0,  645,17096,  577,\n  634,  989,   50,    0,    0,  745,    0, -234, 1013,   50,\n17096,17096,17096,  512,    0,  980,    0, 9503, 9503,    0,\n11784,   50,    0, 8577,  250,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0, 1069,    0,    0,    0,    0,18291,  577,\n  959,  958,17096,    0,  562,    0,  126,    0,    0,  316,\n  259,    0,    0,  923,10860, 8893,    0,    0,17096,17096,\n17096,17096,17096,17096,17096,17096,17096,17096,17096,12972,\n13104,13236, 2103,15577,13368,13500,13632,13764,13896,14028,\n14160,14292,14424,14556,14688,14820,14952,15084,15216,17644,\n17096,    0,    0,    0,    0,  745,    0,    0,    0,    0,\n18473,18473,    0,    0,   50,    0,    0,    0,    0,  552,\n  981,    0,    0,    0,    0,    0,    0,    0,  495,  841,\n  927,  943,    0,  562,  297,  297,    0,  486,  107,    0,\n  297,  998,    0, -193,19024,    0,    0,    0,    0, -145,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  255,19054,    0,    0,    0,    0,  962,    0,\n    0, 1003,  788,    0, 1001,    0, 1011,  164,  642,    0,\n  138,    0,    0,    0,   50,16685, -115,    0, 1021,    0,\n    0,    0,  112,  168,    0,  811,  488,    0,    0, 1008,\n    0, 1041,    0, 1037,  983,    0,    0,  805,    0, 9167,\n  806,11018,  874,16548,    0, 9328,    0,    0,    0,    0,\n    0,    0,  174,  192,    0,    0,    0, -224,  642, -147,\n    0,    0,  645,    0,    0, 1042, 1044,    0,  195,   50,\n    0,  205,    0,    0,17096, 1126,    0,17096, 1129, 1050,\n    0, 1053, 1055,    0,18291,    0,    0,    0,  188,  962,\n    0,  -92, -272, 8577,    0,    0,    0,    0,    0,    0,\n  188,    0,    0, -235,    0,    0,    0,  645,    0,  577,\n   50, 9661,    0, 1056,    0, 1060,15348,    0, 1181, 1061,\n 8577,    0,    0, 1014,    0,  962,   50,17233, 1015,    0,\n  562,  962,    0,  116,    0,17096,17096, 1067, 1186,    0,\n    0,  270,  146,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,17769,17769,    0,    0,\n -234,    0,   50,  745,    0,  917,    0,  917,    0,11652,\n  209,    0,  209,    0,  755,    0,  755,    0,  755,    0,\n  755,    0,  636,    0,  636,    0,  338,    0,  671,    0,\n  697,    0,  686,    0,  694,    0,  -57, -180,    0,11018,\n 1151,   50, 1152,   50,11018,11018, 1066,17096,    0,    0,\n  981,    0,   50,    0,  244,  562,    0,    0,    0,    0,\n 9661,  486,    0, 1076, 1075,    0,    0,  707,  495,   -8,\n    0,    0,    0,    0,    0,    0, -185, 1077,    0, 1079,\n 1081,    0,    0,    0,    0, 1083,10269, 1039,    0,  435,\n    0,    0,  687,    0,17233,    0, 1082,    0,    0,    0,\n  729,  141, 1086,    0, 1088, 1091, 1092,    0,    0,17096,\n    0,   50,    0,    0,  818,    0, 1094,    0,  256,    0,\n    0, 8419,    0, 8419, 9802,    0,15688,    0,    0,    0,\n 9962,10094,  422,11018,    0,    7,  149,    0, 1031, 1046,\n    0,    0,    0,  834,    0,    0, 1099, 1098,    0,    0,\n    0,    0,    0, 1100,    0,    0,    0, 1106,  138, 4352,\n  642,    0,  642,    0,    0,    0,    0, 8419,    0,    0,\n 8419,    0,17096,    0,17096, 9503,    0,    0,  642, 1103,\n  188,    0,    0,    0,17096,    0,    0,    0,    0,    0,\n    0,    0, 9503,    0,    0,   50,18291, 1135,    0,    0,\n    0,    0,    0,    0,    0,  962,  842,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,16411,    0,    0,    0,\n    0,    0, 9486,    0,    0,    0,    0,    0,    0,    0,\n    0,10252,    0, 9644, 1108,    0,    0, 1190,    0, 1191,\n    0,    0,    0,  932,    0, 1111,    0,    0,    0,    0,\n    0,    0,    0,    0,  486,    0,    0, 1068,    0,  107,\n    0,  486,    0,    0,  927, 1119, 1122, 1072, 1130, 1039,\n    0, 1121,    0, 1245, 1246,    0,    0,11018,    0,16822,\n 1128,  729, 9661, 9503,    0,    0,  371, 1249, 1250,  219,\n 1127,    0,    0,    0,17096,    0,17096, 1230,    0,    0,\n    0,16959,    0,  342,16959,  848,    0,    0,    0,    0,\n 9030,    0, 1256,  745,11018, 1145, 9802, 1146,    0,17096,\n    0,   50,    0,    0,    0,  -87,    0,    0,    0, 1141,\n    0, 1174,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  706,    0,    0,    0,    0,    0,    0, 9503,    0,\n    0,   50, -242, 1108,    0,11018,    0,11018,    0,  191,\n11018,    0,    0,    0,  503,    0,    0,    0, 1150,  927,\n    0,    0,11176,    0,    0,    0, 1155, 4512,    0, 1039,\n    0, 1039,    0, 1039,    0,    0,    0,    0,   50, 1156,\n 1128,    0,    0,    0, -109, -125, 1154, 1157,    0,    0,\n    0,    0,    0, 1159, 9802, 1108, -180,17096,    0, 1166,\n 8419,    0,    0,    0,    0,    0, 1158,    0,    0, 1170,\n    0,  874,    0,    0,    0,    0,    0, -201, 1169, 1171,\n    0, 1108, 1175,    0,    0,  188,    0, 1123, 1167,    0,\n    0,    0,    0,    0,11018, 1204,11018,    0,11018,    0,\n    0,17096,    0,    0, 1081,    0,  515,  739,    0,    0,\n    0,    0,  161,    0,    0,    0, 1185,    0,    0,    0,\n 1172,    0,    0,    0,  682,    0, 1176, 1300, 1303,    0,\n    0, 1108, 1193, 1108, 1195,    0, 1187,    0,    0,16959,\n    0,    0,    0,17096,    0, 1194, -209,    0, 8101,    0,\n    0, 1313,    0,    0,  188,    0,17096, 9644,    0,    0,\n 1223,    0,  964, 1197,    0, 1202,    0,    0,11176,  258,\n  164,    0,  852, 1199, 1205,16822, 1207,    0,17096,    0,\n    0,    0,    0,    0,    0, 8419,    0,   77,    0,    0,\n 8577,    0,    0, 1290, 8419,    0, 1213,    0,11018,    0,\n    0,    0,    0,    0,17096,    0,    0,  495, 1214,  495,\n  164, 9503, 1199, 1253,    0, 1253,    0, 1199,    0,    0,\n    0,17096,    0, 8419,11334,    0,    0,    0,  906,    0,\n    0, 1240,11018,17096,    0,  495, 1220,    0, 1180,  991,\n    0,    0, 1225,    0, 1222,    0,  165,    0, 1229, 1183,\n    0, 1253,    0,    0, 1253,    0,    0,    0,    0, 1231,\n 1094,    0,    0,    0,    0,    0, 1255,    0,   68, 1253,\n 1349,    0, 1238,  495,    0,    0, 9503,    0,  106, 1241,\n    0, 1242,    0, 8419, 8577,11018,    0,    0,    0,    0,\n    0,    0, 1226, 1235,    0,    0,16548,    0, 2289,   66,\n  495, 1247,    0, 1248, 1260,11018, 1251,17096,    0,    0,\n 1254,    0, 1257,    0,    0, 1243,    0,    0,    0,19054,\n    0, 1261,   66,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  714,19054,    0,\n    0,    0,    0,    0,    0,    0,    0,    0, 1262,  495,\n    0,    0,    0,   50,    0, 1260,    0,    0,    0, 1259,\n 2289, 8577,18159,    0,    0,  595,    0,    0,    0, 5312,\n    0,    0,   66,    0,    0,    0,    0, -272, 9503, 9503,\n  176, 9503,  477,  645, 1282,    0,  577, 1663,    0, 1317,\n    0,    0, 1235,    0,    0,    0,    0,    0,    0, 4029,\n 1235, 1264,    0, -123, -120,    0, 9503, -118,    0, 9503,\n    0, 1215, 1265,    0,    0,   12,    0,  143, 4675,    0,\n 1266, 1219,  153,  595, 5471,    0,17096,    0,    0,    0,\n    0,    0,   12,    0, 1271, 1221, 1269, 1267,    0, 1270,\n 1224, 1275,  164, 1272, 1274,    0,    0, 1280, 1281, 1310,\n    0,  962,    0,  965,    0, 1296, 1292, 1235,  -62,    0,\n 1288,    0,    0, 1301,    0, 1304, 1299, 1302,    0, 1306,\n    0,  164,  164,    0,    0,  164, 1305, 1309,    0,    0,\n    0,    0,    0,    0, 1314,  150,    0, 1316,  164, 1421,\n 1318,  164,    0,  501,    0, 9802, 1273, 1308, 1306,    0,\n 1321, 1322,  152, 1325,    0,    0,  164,16822, 1278, 1323,\n 1314,    0,    0,19054,    0,  495,  495,    0, 1279, 1324,\n 1316,    0, 1326,    0,17096, 1284, 1327, 1318,    0, 1332,\n  164,    0,  114,    0, 1328,    0,    0,    0,    0,    0,\n19054,    0,  152,  152,    0, 1333,    0,  -62,    0,    0,\n  409, 1338,19054,    0,19054,    0,    0, 9802, 1329,    0,\n    0,    0, 1337, 1301,    0,    0,    0, 1336,    0,  208,\n    0,    0,    0, 1253, 1017, 1343,    0,    0,  538,    0,\n    0,    0,    0,    0, 1398, 1451,    0,    0,    0,    0,\n    0,    0, 1344, 1345, 9802,    0,    0,    0,    0,  152,\n    0,    0,  580,  580,    0, 1253,    0,    0,    0, -143,\n -143, 1340, 1354,    0,    0,    0,    0,    0,    0,16548,\n16548,    0,    0,    0,    0,    0,    0,    0,    0, 1360,\n 1361,16822,    0,    0,    0,    0, 1358,    0,\n  };\n  protected static readonly short [] yyRindex = {         1936,\n    0,    0, 8735, 1936,    0,    0,    0, 1736,    0,    0,\n 3522, 1489,    0,    0,    0,    0,    0, 3522,    0,    0,\n   56,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0, 1737,    0,    0, 1737,    0,    0, 1737,    0,    0,\n 1736, 3602, 2027,    0,    0,    0,    0,    0,    0,    0,\n    0,    0, 1371,    0,    0,    0,    0,    0,    0,    0,\n    0,10427,    0, 1363,    0,    0,    0, 1363,    0,    0,\n    0,    0,    0,    0, 3192,    0,    0,    0,    0,    0,\n    0,    0,    0,  190,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0, 5375,    0,    0,    0,\n    0,    0,    0,    0,    0,    0, 5788, 5311, 5699,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0, 5893, 6070, 4119, 6623, 7048, 7255, 7393, 7531,\n 7669, 7807, 1311, 5470,    0,    0,    0,    0,    0,    0,\n   56,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  238,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0, 3649,    0,  688,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0, 1737,    0,    0,  307,\n    0,    0,    0,    0,    0,    0, 3712,  432, 3755,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0, 4351,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0, 1373,    0,    0,    0,    0,    0,    0, 4351, 1366,\n    0,    0,    0,    0,    0,    0, 1366,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0, 2148,    0,  403,\n 2851,    0,    0,    0,    0, 2982,    0, 2851,    0,    0,\n    0,    0,    0, 1371,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  198,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0, 1372, 3087,\n    0,    0, 1363,    0, 4351,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  278,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0, 2384,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n 1852,    0,    0,    0,    0,    0,    0,    0, 3798, 3861,\n    0,    0,    0, 1531, 1737, 1737,    0, 8910, -206,    0,\n 1737, 1744,    0,    0,   84,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  479,17919,    0,    0,    0,    0, 4351,    0,\n    0,    0,    0,    0,    0,    0,    0,18191,    0,    0,\n    0,    0,    0,    0,    0,  868,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  233, 1047,    0,    0,  230,\n 1928,    0,    0, 1378,  513,    0,    0,    0,    0,  215,\n    0,    0, 4831, 1376,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0, 1384,    0, 2553,\n    0,    0,  222,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0, 1372,    0,    0,    0,17370, 4351,\n    0, 7940,    0,  225,    0,    0,    0,    0,    0,    0,\n17370,    0,    0,    0,    0,    0,    0,   60,    0,  703,\n    0,    0,    0, 1381,    0,    0,    0,    0, 1366,    0,\n    0,    0,    0, 4191,    0, 4351,    0,    0, 4030,    0,\n 4351, 4991,    0,    0,    0,    0,    0, -202,    0,    0,\n    0,    0,  313,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n 5535, 5640, 6142, 5965,    0, 6247,    0, 6319,    0,    0,\n 6469,    0, 6554,    0, 6692,    0, 6761,    0, 6830,    0,\n 6899,    0, 7117,    0, 7186,    0, 7324,    0, 7462,    0,\n 7600,    0, 7738,    0, 7876,    0,    0,  749,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n 1852,    0,    0,    0,    0, 1531,    0,    0,    0,    0,\n    0,11035,    0,    0,  817,    0,    0, 1339,15851,    0,\n    0,    0,    0,    0,    0,    0,  781,  774,    0,    0,\n 1385,    0,    0,    0,    0, 1820,    0,    0,    0,    0,\n    0,    0,11492,    0,    0,    0,  845,    0,    0,    0,\n11193,18364,    0,    0,  881,  920,  937,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  870,    0,    0,    0,\n    0,    0,    0,    0,    0,    0, 1386,    0,    0,    0,\n    0,    0, 6961,    0,    0,    0,  261,    0,  117, 4511,\n    0,    0,    0,    0,    0,    0,    0, 1387,    0,    0,\n    0,    0,    0, 1388,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n17370,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0, 4351,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  674,    0,    0,    0,    0,    0,\n    0,    0,    0, -169,    0,  576,    0,    0,    0,    0,\n    0,    0,    0,    0,11193,    0,    0,    0,    0, -206,\n    0, 9345,    0,    0, 1391,    0,  873,    0,    0,    0,\n    0, 1395,    0, 1346, 1348,    0,    0,    0,    0,    0,\n 1382,11351,    0,    0,    0,    0,18396,    0,    0,    0,\n  939,    0,    0,    0,    0,    0,    0, 2721,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0, 4671,    0, 5151, 1399,    0,    0,    0,\n    0, 1396,    0,    0,    0,  939,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  771,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  940,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n 1394,    0,    0,    0,    0,    0,  957,  960,    0,    0,\n    0,    0,    0,    0,    0, 1401,  761, 1400,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0, 4831,    0,    0,    0,    0,    0, 1403,    0,    0,\n    0, 1401,    0,    0,    0,17370,    0,  752,  762,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0, 1385,    0,15689,    0,    0,    0,\n    0,    0,18521,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  793,    0,  798,    0,    0,    0,\n    0, 1402,    0,  895, 1404,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0, 1407,    0,    0,    0,\n    0,  202,    0,    0,17370,    0,    0,    0,    0,    0,\n    0,    0,  113,  678,    0,    0,    0,    0,    0,18592,\n18191,    0,  386,  511,  449,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n -208,    0,    0, 1020,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,18748,    0, -253,\n18191,    0,  522, 1410,    0, 1410,    0,  511,    0,    0,\n    0,    0,    0,    0, 1406,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,18791,    0,    0,    0,16125,\n    0,    0, 1411,    0,    0,    0,  364,    0,  532,    0,\n    0,  606,    0,    0, 1410,    0,    0,    0,    0,    0,\n 1409,    0,    0,    0,    0,    0,    0,    0, 3479, 1412,\n  493,    0,    0,  333,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0, 1414,    0,    0,    0,    0,    0,\n    0,    0,    0, 3363,    0,    0, 1376,    0,    0,15957,\n16209,    0,    0,    0,  767,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  617,    0,    0,    0,18091,\n    0,    0,16041,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0, 5152,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,16293,\n    0,    0,    0,    0,    0,  767,    0,    0,    0,    0,\n    0,  198,  479,    0,    0,    0,    0,    0,    0,  479,\n    0,    0,15957,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0, 4830,  507,    0,16335,    0,    0,    0,\n 4990,    0, 3363,    0,    0,    0,    0,    0,    0,    0,\n 3363,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  257,    0,  584,    0,  647,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  824,    0,  692,    0,    0,    0,    0,    0,\n    0,    0,18191,  947,    0,    0,    0,    0,    0,    0,\n    0, 1390,    0,  438,    0,    0,    0, 3363,    0,    0,\n  963,    0,    0,    0,    0,    0,    0,    0,    0, 1417,\n    0,18191,18191,    0,    0,18259,    0,    0,    0,    0,\n    0,    0,    0,    0, 1418,15719,    0, 1420,18191,17507,\n 1425,18191,    0,    0,    0,    0,    0,    0, 1426,    0,\n    0,    0,18984,    0,    0,    0,18191,    0,    0,    0,\n 1427,    0,    0,  424,    0,18914,18954,    0,    0,    0,\n 1428,    0,    0,    0,    0,    0,    0, 1430,    0,    0,\n18191,    0,  716,    0,  968,    0,    0,    0,    0,    0,\n 1029,    0,18834,18874,    0,    0,    0,    0,    0,    0,\n    0,    0, 1469,    0, 1525,    0,    0,    0,  978,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  611,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,18984,\n    0,    0,18634,18672,    0,  611,    0,    0,    0,    0,\n    0,15498,    0,    0,    0,    0,    0,    0,    0, 1376,\n 1376,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,\n  };\n  protected static readonly short [] yyGindex = {            0,\n    0, 1757,    0,    0,    0,   -1,  -16, -178,  -44,  -41,\n    0, 1797, 1806,  103,    0,    6,    0,    0,    0,    0,\n    0,    0,-1157, -774, -216, -708,    0,    0,    0,    0,\n    0, -221,    0,    0,    0,  776,    0,  883,    0,    0,\n    0,    0,  630,  632,  -17, -227,    0,  -47,    0, -112,\n  430,    0,  487, -587, -577, -576, -541, -537, -525, -516,\n -503,    0,    0,-1152,    0,-1187,    0,  434,-1258,    0,\n    3,    0,    0,    0,  596,-1183,    0,    0,    0,   -3,\n  267,    0,    0,    0,  306,-1151,    0, -281, -301, -354,\n    0,    0,    0, -985,  262,    0,    0, -529,    0,    0,\n  320,    0,    0,  299,    0,    0,  401,    0, -630, -856,\n    0,    0,    0,    0,    0, -404,  335,-1396,  -10,    0,\n    0,    0,  893,  898,  900, 1089, -572,    0,    0, -336,\n  902,  436,    0, -905,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  234,    0,    0,\n    0,    0,    0,    0,    0,    0,  496,    0,    0,    0,\n -315,  423,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  505,    0, -531,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  246,    0,    0,  331,    0,    0,  336,\n  340,  266,    0,    0,    0,    0,    0,    0,    0,    0,\n  598,    0,    0,    0,    0,  -86,    0,  135, -373, -304,\n 1277,    0,  421,    0, -349,    0,  966,    0, 1577,  148,\n -305, -274,  -81,  203, 1232,    0,  601,    0,  -21,  509,\n 1495,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0, -267,\n    0,   28,    0, -352,    0, -280,    0,    0,    0,  931,\n -927, -313, -132,  554,    0, 1026,    0, 1276, -343, 1160,\n    0,    0,  828, 1851,    0,    0,    0,    0, 1137,    0,\n    0,    0, 1593,    0,    0,    0,    0,    0, 1627,  986,\n  987,    0,  946,    0,  812,  984, 1514, 1515, 1513, 1516,\n 1517,    0, 1512,    0,    0,    0, 1084, 1364, -569,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0, -306,\n  748,    0, -444,    0,    0,    0,    0,    0, -475,    0,\n  681,    0,  573,    0,    0,    0,    0,    0,  787, -563,\n  -11, -334,   -7,    0, 1796,    0,   48,    0,   85,   91,\n  111,  128,  157,  173,  175,  181,  193,  194,    0, -662,\n    0,  -23,    0,    0,  882,    0,  804,    0,    0,    0,\n    0,  784, -959,  862, -931,    0,  905, -489,    0,    0,\n    0,    0,    0,    0,  800,    0,  802,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  724,    0,    0,    0,    0,    0,    0,    0,\n    0,  -31,    0, 1416,  763,    0,    0,  985,    0,    0,\n    0,    0,    0,    0, -176,    0,    0,    0,    0,    0,\n 1529, 1283,    0,    0,    0,    0, 1532,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  607,    0,    0,    0,\n    0,    0,    0,    0,    0,  731,    0,    0,    0,    0,\n    0,    0,   35, 1054,    0,    0,    0, 1062,\n  };\n  protected static readonly short [] yyTable = {           110,\n  550,  193,   18,  547,  564,  159,  112,  238,   44,  160,\n  239,  622,  817,  519,  459,  458,  823,  497,  761,  597,\n  476,  299,  572,  545,  501,  196,  783,  580,  432,  543,\n  861,  862,  397, 1108,  531,  389,  265,  398,  264,  866,\n  332,  339,  612,  643, 1240,  346,  318, 1086,  257,  988,\n  254,  634, 1274,  710, 1163, 1054,  310,  873, 1164,  886,\n  317,  577,  744,  613,  164,  385, 1164,  829,   14,  319,\n  933,  322,  254, 1495,  321,  903,   20, 1261,  355,  232,\n  623, 1383,  234,    6,  333,  340, 1038,   51,  745,  268,\n  727, 1303, 1113,  292,  293,  294,  858,  300,  301,   51,\n 1390,  165,  314,  315,  194,  381, 1311,  166,  320,  323,\n  754,  325, 1642,  329,  321,  340, 1152, 1324,  342,  343,\n  746,  558,  386,  201,  472,  762, 1110,  167,  434,  968,\n 1146,  969, 1450,  462, 1111, 1452,  463, 1458,  833,  863,\n  788, 1261, 1152,  110,  168,  396, 1144,  255,  238,  159,\n  112,  460,  326,  160,  198,  201, 1330,  859,  922,  728,\n  886,  709,  539,  857,  115,   51,  255,  501, 1101, 1038,\n  710,  200,  710,  169, 1038,  995, 1038,  295,  997, 1038,\n 1038,  864, 1038, 1038,   95,  296,   95,    1,  255,  170,\n  255,  171,  475, 1503, 1398,  460,  256,  172,  901,  465,\n  466,  904, 1621,  499,  502, 1038,  373,  115,  164,  173,\n  174,  115,   51, 1165,  886,  256,  856,  506,   43,  116,\n 1113, 1165,  198,  198,   95,  747,  809,  710,  266,  374,\n  255,   15, 1207, 1643,  500,  473,  375,  256,  497,  256,\n  505,  815,  476,  198,  573,  165,  571,  297,  612,  574,\n  372,  166,  875,  297,  530, 1446,  389,  879,  881,  597,\n 1038,  467,  116, 1448,  507,  970,  116,  195,  515,  613,\n  264,  167,  297,  755,  540, 1571,  541,  518,  255,  256,\n  264, 1003,  522,  524,  877,  576,  597,  323,  168,    2,\n  517,  396,  579, 1147, 1075, 1451,  613,  554, 1453,  373,\n 1459,  570, 1595,  298,  590,  567,  379,  569,  115,  298,\n  553,  522, 1054,  568, 1605,  393, 1606,  169,  902, 1504,\n 1502, 1338,  374, 1308,  582,  583,  880,  256,  298,  375,\n  542,  544, 1247,  170, 1229,  171,  376,  198,  198,  626,\n    6,  172,  596,  631,  587,  588,  598,  502,  502,  267,\n 1186,  620,  920,  173,  174,  732,    3,    4,    5,    6,\n  732, 1318,  737,  116,  732,  619,  930,  791, 1041, 1589,\n  603,  882, 1054,  344, 1265,  977, 1567,  500,  640,  732,\n 1065,  647,  648,  649,  650,  651,  652,  653,  654,  655,\n  656,  657,  264,  711,  713,  923,  955,  717, 1466,  900,\n  501,  892,  198,  373,  980, 1533,  732, 1560,  931,  665,\n 1616,  510,  297,  707,  238,  613, 1428,  460, 1159,  769,\n 1296,  921,  393,  793,  738,  732,  374,  739,  198,  825,\n  393, 1426,  393, 1339,  393,  236,  978,  712,  714,  115,\n  198,  564, 1639,  852, 1309,   16, 1118,  827,  198,  382,\n  837, 1041, 1248,  549,  198,  837, 1041, 1096, 1041,  297,\n  840, 1041, 1041, 1612, 1041, 1041,  725,  781,  298,  789,\n  413, 1613,  115,  960, 1073, 1079,  236, 1473,  393,  748,\n 1427, 1319,  198,  198,  792, 1054,  883, 1041,  297, 1590,\n  765, 1054,  782,  961,  116,  511,  502,  383,  779,  729,\n  730,  115, 1009,  837,  770,  742,  414,   49,  198,  255,\n  236,  966,  369,  198, 1467,  298,  345,  497,    2,  236,\n  893,  236,  839,  981,  812,  119,  640,  116,  821,  531,\n  612,  757, 1614,  236, 1012,  758, 1176,  501,  780, 1297,\n  794, 1119, 1041, 1246,  624, 1151,  826,  198,  832,  967,\n  497,  613, 1250,  203,  625,   95,  116,  842,  256,  384,\n  844,  669,  379,  865,  828,  837,  780,  838,  119,  961,\n  961, 1474,  119,  437,  372,  198,  198,  841,  853,  876,\n  502, 1277,  596,  475,  896,  830,  598,  415,  416,  897,\n  853, 1074,   20,  781,  386,  198,  759,  906,  540,  369,\n  827,  837,  911,  912,  540, 1216, 1488,  837,  198,  596,\n  500, 1341, 1360,  598,  837, 1063,  670,  462,  884,  884,\n  919,  297,  599,  373,  369,  898,  438,  780,  369,  476,\n  364,  126,  439,  126, 1341, 1521, 1522,  613,  126, 1524,\n  386, 1323,  889,  512,  475,  379,  374,  861, 1058,  379,\n  489,  513, 1543,  375,  781, 1550,  827, 1597, 1598,  540,\n  376, 1360,  837,  115,  908, 1014,  910,  809,  228,  119,\n 1566, 1602,  369,  439,  379,  918,  982,  629,  379,  600,\n  379,  379,  379,  379, 1341,  490,  732,  630,  379,  627,\n  476,  250,  812,  379, 1588,  251,  836,  812,  812,  890,\n  914,  342,  753,  732,  514, 1095,  943,  489,  732, 1091,\n 1085, 1067,  732,  550, 1633,  440,  985,  502,  116,  198,\n  441,   55,  442, 1603,  719,  443,  444,  732,  445,  446,\n  944,  753, 1429, 1361,  962,  753,  423,  424,  732,  628,\n  236,  115,  490, 1362, 1363,  252,  198,  500, 1235,  530,\n  730,   51,  204,  719,  732,  783,  440,  945,  439,  364,\n  942,  441,  522,  442,  372,  364,  443,  444,  115,  445,\n  446, 1155,  364,  732,  730,  264,  364,  821,  731, 1364,\n  379, 1430, 1361, 1365,  812, 1331,  812,  716, 1269,  364,\n  815,  605, 1362, 1363, 1454, 1366,  116,  228,  606,  231,\n  119,  730,  731,  975, 1367,  379,  447,  719, 1468,  379,\n  607,  364,  379,  373,  379, 1132,  716, 1368, 1006,  379,\n  993,  364,  994,  116,  716,  998,  992,  999, 1364,  731,\n 1486, 1032, 1365,  119,  597, 1055,  374, 1004, 1001,  502,\n  853,  440, 1000,  375, 1366,  502,  441,  457,  442,  751,\n  376,  443,  444, 1367,  445,  446,  990,  372, 1123, 1005,\n  721,  345,  119,  390,  236,  198, 1368,  345,   95,  640,\n  722,  255, 1093,  391,  346,  640,  597, 1415,  751,  373,\n 1414,  535, 1208,  269, 1018,  738,  821,  535,  739,  721,\n  440,  198,  392,  393, 1058,  441, 1187,  442,  461,  722,\n  443,  444,  374,  445,  446, 1620,  373,  536,  373,  375,\n  249,  537,  394, 1114, 1032, 1116,  376, 1243, 1121, 1032,\n  256, 1032,  671,  395, 1032, 1032,  371, 1032, 1032,  374,\n  812,  374,  518, 1034,  429,  386,  375, 1414,  375,  115,\n  748,  115, 1047,  376,  898,  557,  430,   95,  756, 1080,\n 1066,  371,  387,  755, 1082,  759, 1329, 1082,  558,  759,\n 1276, 1132,   95,  761,  198,  326,  253,  812,  373,  821,\n  597, 1415, 1099,  756, 1109,  559,  374,  302,  755,  303,\n  198,  720,  756,  375,  759,  115, 1554,  755,  115,  208,\n  386,  374,  946,  759,  116,  502,  116,  198,  375,  947,\n  926,  198, 1179, 1439, 1181, 1032, 1182,  462,  812,   95,\n  812, 1141,  927,  812,  203, 1439, 1034, 1145,  419,  420,\n  326, 1034, 1028, 1034,  119, 1131, 1034, 1034, 1408, 1034,\n 1034,  326,  421,  422,  605, 1420,  952,  341,  497,  476,\n  116,  606,  847,  116, 1136,  748, 1378,  597, 1607, 1256,\n  847, 1197, 1138,  607, 1139,  425, 1140,  821, 1443,  364,\n  522,  364, 1465, 1198,  364,  364,  302, 1411,  302,  198,\n 1443,  427,  364,  302, 1411,  683,  364,  683, 1107, 1465,\n  893, 1283, 1284,  292,  292, 1629,  426,  198,  198,  364,\n 1387,  228,  292,  233,  428,  853,  550,  812, 1497,  812,\n 1498,  812,  119,  431, 1183, 1028, 1252, 1034, 1650, 1651,\n 1028, 1188, 1028, 1189,  303, 1028, 1028,  844, 1028, 1028,\n  864,  364,  464,  844,  864,  844,  864,  469,  864,  119,\n  853, 1190,  498,  844,  853,  844,  853,  844,  853,  848,\n 1287,  502, 1082,  848,   69,   69,  518,  848,   69,  417,\n  418,  364,  364,  198,  364,  364,   62,  596,  764, 1217,\n  821,  598,  765,  183,  853,  183,  549,  183,  196,  471,\n  196, 1131,  196, 1228,  198,  799,  810,  344,  518,  800,\n  537,  518,  198,  238,  352, 1259,  460, 1075, 1260, 1075,\n  963,  369,  520, 1325,  964,  369, 1028,  364,  369,  596,\n  369,  812,  521,  598,  984,  369,  562, 1255,  985,  496,\n  236,  238, 1010, 1376,  460,   24,  765,   25, 1087,  855,\n   26,  855,  985, 1231,  518,   27, 1058, 1232,  115,   28,\n  685,  687,  689,  691,  399,  812, 1183,   45,   30,  369,\n  911,  546,  915,   70,  911,   32,  915,   70,  117, 1259,\n   33,  171, 1260,  171,   34,  400,  401,  402,  403,  404,\n  405,  406,  407,  408,  409,  551,   36,  847,   37,  502,\n  387,  847,   38, 1283, 1284, 1340, 1359,  555, 1260,  739,\n   39,   40,  575,  116,   41, 1032, 1033,  563,  812,  552,\n  178,  117,  178,  596,  556,  117,  199,  598, 1340,  640,\n  119, 1260,  119,  410,  411,  412,  578,  179,  812,  179,\n  518,  983,   72,  983,   72, 1335,  115, 1221, 1222,  338,\n  338,  131,  586,  131,  602, 1359, 1394,  202,  739,  202,\n  172,  617,  172,   24,  618,   25,  723,  308,   26,  308,\n  338,  632,  138,   27,  138,  380,  119,   28, 1340,  119,\n 1656, 1260,  315,  115,  315,  974,   30,  976,  115, 1292,\n  236,  726,  115,   32,  199,  199,  198,  743,   33,  380,\n  596,  116,   34,  766,  598, 1419,  374, 1335,  763,  374,\n  469, 1617, 1618,  768,   36,  199,   37,  965,  965,  795,\n   38,  115,  117,  732,  732, 1424, 1425,  790,   39,   40,\n  676,  678,   41,  681,  683,   85,  693,  695,  116,  796,\n  364,  797,  798,  116,  835,  836,  836,  116,  364,  843,\n  364,  836,  845, 1457,  846,  847, 1460,  848,  836, 1477,\n  867,  198,  868, 1419,  338,  338,  871,  872,  887,  364,\n  364,  888,  874,  878,  907,  909,  116,  913,  924,  925,\n  462,  115,  115,  198,  934,  935,  938,   43,  956,  364,\n  200, 1534,  957,  950,  739,  958,  959,  364,  965,  983,\n  364,  986,  893,  989,  987, 1002,  836, 1008, 1561,  199,\n  199,  739, 1022, 1027, 1029, 1034, 1037,  380,   38, 1042,\n 1045, 1573, 1575, 1043,  739,  739, 1048, 1046,  821,  338,\n 1051, 1053, 1059, 1419, 1071, 1072,  116,  116, 1075, 1081,\n  518, 1090,  540, 1104, 1097,  198, 1105,  198, 1561, 1561,\n 1124,  739,  739,  117,  198,  338, 1134, 1583, 1148,  115,\n  364, 1149, 1142,  198,  198, 1150,  198,  338, 1158, 1160,\n 1161, 1171, 1442, 1172,  199,  338, 1177, 1174, 1178,  549,\n 1180,  338, 1192, 1196, 1442, 1200,  117, 1199, 1201, 1442,\n  821,  198, 1209, 1205,  198, 1202,  661, 1204, 1213, 1220,\n  199, 1223, 1224, 1442, 1232, 1561, 1231, 1241,  739,  338,\n  338,  829,  199, 1251,  116,  117, 1258, 1286, 1289,  119,\n  199, 1270,  502,  502, 1295, 1442,  199,  821, 1291, 1294,\n 1298, 1299, 1307, 1304, 1312,  338, 1314, 1328, 1320, 1321,\n  338, 1329, 1635, 1635, 1372, 1374, 1373, 1381, 1431, 1644,\n 1644, 1445,  640,  640,  199,  199, 1379, 1377, 1380, 1384,\n 1391, 1396, 1449, 1462, 1655, 1471, 1463, 1472, 1480, 1474,\n 1482, 1485, 1453, 1483,  338,  117, 1487, 1491, 1494,  661,\n  199, 1493, 1414, 1489,  661,  199,  661,  661,  661,  661,\n  661,  661,  661,  661,  661,  661,  661, 1500, 1501, 1507,\n 1510, 1514,  338,  338, 1515, 1513, 1544,  119, 1525,  661,\n 1517,  661, 1526,  661, 1556,  661,  661,  661, 1529,  199,\n 1539, 1555, 1546, 1558, 1559, 1565, 1568, 1579, 1582, 1569,\n 1580,  661, 1584, 1585, 1587, 1600, 1604, 1609, 1611, 1593,\n 1608, 1619, 1603, 1602,  119, 1627, 1628,  199,  199,  119,\n  353, 1647, 1649,  119,  357,  359,  361,  363,  365,  367,\n  369,  371, 1653, 1654, 1658,    9, 1071,  199,  573,  950,\n  661,  533,  951, 1063,  685,   38,  534,  117,  489,   38,\n  199,  965,  119,  686,  532,   33,   33,  767,  857,  490,\n   38,   34,  337,  364,  232,   38,  106,   34,  958,   38,\n  858,  881,   38,  849,  850,  882,  916,  755,  918,  341,\n  917,  920,  780,  732,   38,   38,  364,  732,  755,   38,\n   38,  364,  364,  134,  116,   38,  311,   38,   38,   38,\n   38,  141,  135,  117,  312,   38,  142,  235,   54,   38,\n   21,   38,  119,  119,  364, 1125,  338, 1041, 1226,   24,\n 1227,   38, 1422,   38,   38,  117,   38,  364,  364, 1385,\n   38, 1423,  364, 1275, 1601,  364, 1570,  364, 1557,  364,\n  364,  364,  364,  338, 1475, 1610, 1586,  364, 1552, 1068,\n   38,  364,  117, 1064, 1069,  364, 1070,   38,   38,  953,\n 1455,  199, 1389,  364, 1646, 1392,  364, 1476,  364,  364,\n 1638, 1581, 1576,  364,  364, 1574,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  199, 1637,\n  119, 1315,  364,  364, 1499, 1038,  565, 1316,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  672,  364,\n  364, 1089,  886,  364,  364,  364,  364,  364, 1015, 1162,\n  364,  364,  305,  477,  949,  364,  364,  364,  364,  364,\n  364,  364,  364,  971,  353,   37,  584, 1100,  697,  701,\n  699,  706, 1239,  703,  364,  705,  478,  364,  850,  364,\n 1007,  364, 1301, 1397,  364, 1211,  433, 1203, 1154,  479,\n  364, 1218,  338, 1173,  481, 1143, 1210,  581, 1281,  482,\n 1212,  483,  484,  485,  486,  834, 1249,  353,  721,  487,\n 1102,  722, 1395,  488, 1288, 1039, 1036, 1434,  338,    0,\n    0,    0,    0,    0,    0,  489,    0,    0,  490,    0,\n  491,    0,    0,  917,    0,    0,    0,  199,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  117,  492,  117,   36,    0,    0,    0,\n    0, 1435,    0,  199,    0,    0,  659,  661,  663,    0,\n    0,  581,  581,  581,  581,  581,  581,  581,  581,  581,\n  581,  581,  581,  581,  581,  581,  581,    0,    0,    0,\n    0,  338,    0,    0,    0,    0,    0,    0,    0,  117,\n    0,    0,  117,    0,    0,    0,   24,  338,    0,    0,\n   24, 1436,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   24,    0,    0,  338,    0,   24,    0,  338,    0,\n   24,    0,    0,   24,    0,    0,  199, 1044,    0,    0,\n    0,    0,    0,    0,    0,   24,   24,    0,    0,    0,\n   24,   24,  199,    0,    0,    0,   24,    0,   24,   24,\n   24,   24,    0,    0,    0,    0,   24,    0,    0,  199,\n   24,    0,   24,  199,    0,    0,    0,  833,    0,    0,\n    0,    0,   24,    0,    0,   24,    0,   24,    0,    0,\n    0,   24,    0,    0,    0,    0,  581,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   24,    0,    0,  338,  338,    0,   21,   24,   24,\n 1044,    0,   37,    0,    0, 1044,   37, 1044, 1044, 1044,\n 1044, 1044, 1044, 1044, 1044, 1044, 1044,   37,    0,    0,\n    0,  199,   37,    0,    0,    0,   37,    0,    0,   37,\n 1044,    0, 1044,    0, 1044,    0, 1044, 1044, 1044,  199,\n  199,   37,   37,    0,    0,    0,   37,   37,    0,    0,\n    0,    0,   37,  870,   37,   37,   37,   37,    0,    0,\n  338,    0,   37,    0,    0,    0,   37,    0,   37,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   37,    0,\n   37,   37,    0,   37,    0,    0,    0,   37,    0,  338,\n    0, 1044,    0,   36,    0,    0,    0,   36,    0,    0,\n    0,  444,    0,  894,  895,  199,  541,   37,   36,  444,\n    0,  444,  541,   36,    0,   37,  353,   36,    0,    0,\n   36,    0,  117,    0,    0,    0,  199,    0,    0,    0,\n  444,  444,   36,   36,  199,    0,    0,   36,   36,    0,\n    0,    0,    0,   36,    0,   36,   36,   36,   36,    0,\n  444,    0,    0,   36,    0,    0,    0,   36,  444,   36,\n    0,  444,    0,    0,    0,    0,    0,  541,  664,   36,\n    0,    0,   36,    0,   36,    0,    0,   24,   36,   25,\n    0,    0,   26,    0,    0,    0,    0,   27,    0,    0,\n    0,   28,    0,  545,    0,    0,    0,    0,   36,    0,\n   30,    0,    0,    0,    0,   36,   36,   32,    0,    0,\n  117,    0,   33,  833,    0,    0,   34,    0,  833,  833,\n    0,    0,    0,    0,    0,    0,    0,    0,   36,    0,\n   37,    0,    0,    0,   38,    0,    0,  353,    0,    0,\n    0,  833,   39,   40,    0,    0,   41,  117,    0,   85,\n    0,    0,  117,    0,  833,  833,  117,    0,    0,  833,\n    0,    0,  833,    0,  833,    0,  833,  833,  833,  833,\n    0,    0,    0,  338,  833,    0,    0,    0,  833,    0,\n    0,    0,  833,    0,    0,  117,    0,    0,    0,    0,\n  833,    0,    0,  833,    0,  833,  833,    0,    0,    0,\n  833,  833,    0,  833,  833,  833,  833,  833,  833,  833,\n  833,  833,  833,  833,    0,    0,    0,    0,  199,  833,\n  833,    0,    0,    0,    0,  833,  833,  833,  833,  833,\n  833,  380,  833,  833,  833,    0,  833,  833,  338,    0,\n  833,  833,  833,  833,    0,  117,  117,  833,  833,    0,\n    0,    0,  833,  833,  833,  833,  833,  833,  833,  833,\n  338,    0,  952,   24,    0,   25,    0,    0,   26,    0,\n 1332,  833,    0,   27,  833,    0,  833,   28,  833,    0,\n    0,  833,    0,  199,    0,    0,   30,  833,    0,    0,\n    0,    0,    0,   32,    0,    0,    0,    0,   33,    0,\n 1333,    0,   34,    0,    0,  199,    0,    0,    0,    0,\n    0,    0,    0,    0,   36,    0,   37,  581,    0,    0,\n   38, 1334,  338,  117,  338,    0,    0,    0,   39,   40,\n    0,  338,   41,    0,    0,   85,    0,    0,    0,    0,\n  338,  338,    0,  338,    0,    0,    0,    0,    0,  545,\n    0,    0,    0,    0,  545,  545,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  199,  338,  199,\n    0,  338,    0,    0,    0,    0,  199,  545,    0,    0,\n    0,    0,    0,    0,    0,  199,  199,    0,  199,    0,\n  545,  545,    0,    0,    0,  545,    0,    0,  545,    0,\n  545,    0,  545,  545,  545,  545,    0,    0,    0,    0,\n  545,    0,    0,  199,  545,    0,  199,  380,  545,    0,\n    0,    0,    0,    0,    0,    0,  545,    0,    0,  545,\n  875,  545,  545,    0,    0,    0,  545,  545,    0,  545,\n  545,  545,  545,  545,  545,  545,  545,  545,  545,  545,\n    0,    0,    0,    0,    0,  545,  545,  545,    0,    0,\n    0,  545,  545,    0,  545,  545,  545,  545,  545,  545,\n  545,    0,  545,  545,    0,  545,  545,  545,  545,  545,\n  545,  545,  545,  545,  545,    0,  545,  545,  545,  545,\n  545,  545,  545,  545,  545,  545,  545,  545,  545,  545,\n  545,  545,  545,  545,  545,  545,  545,  545,    0,    0,\n  545,    0,  545,    0,  545,    0,    0,  545,  952,  952,\n    0,    0,    0,  545,    0,    0,  952,  952,  952,  952,\n  952,    0,  952,  952,    0,  952,  952,  952,  952,  952,\n  952,  952,  952,    0,    0,    0,    0,  952,    0,  952,\n  952,  952,  952,  952,  952,    0,    0,  952,    0,    0,\n  354,  952,  952,    0,  952,  952,  952,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  952,    0,  952,    0,\n  952,  952,    0,    0,  952,    0,  952,  952,  952,  952,\n  952,  952,  952,  952,  952,  952,  952,  952,    0,  952,\n    0,    0,  952,  952,    0,    0,  952,  952,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  952,  952,  952,  952,  952,    0,    0,    0,    0,\n  952,  952,    0,    0,  952,    0,    0,    0,    0,  952,\n  952,  952,  952,  952,    0,    0,    0,  952,    0,  952,\n    0,    0,    0,    0,    0,  952,  952,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n  952,  952,  952,  952,    0,  952,  875,  875,    0,    0,\n    0,  394,  952,    0,  875,  875,  875,  875,  875,    0,\n  875,  875,    0,  875,  875,  875,  875,  875,  875,  875,\n    0,    0,    0,    0,    0,  875,    0,  875,  875,  875,\n  875,  875,  875,    0,    0,  875,    0,    0,    0,  875,\n  875,    0,  875,  875,  875,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  875,    0,  875,    0,  875,  875,\n    0,    0,  875,    0,  875,  875,  875,  875,  875,  875,\n  875,  875,  875,  875,  875,  875,    0,  875,    0,    0,\n  875,  875,    0,    0,  875,  875,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,  875,\n  875,  875,  875,  875,    0,    0,  364,    0,  875,  875,\n    0,    0,  875,    0,    0,    0,    0,  875,  875,  875,\n  875,  875,    0,    0,    0,  875,  354,  875,    0,    0,\n    0,  354,  354,  875,  875,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  354,    0,    0,    0,  875,  875,\n  875,  875,    0,  875,    0,    0,    0,  354,  354,    0,\n  875,    0,  354,    0,    0,  354,    0,  354,    0,  354,\n  354,  354,  354,    0,    0,    0,    0,  354,    0,    0,\n    0,  354,    0,    0,    0,  354,    0,    0,    0,    0,\n    0,    0,    0,  354,    0,    0,  354,    0,  354,  354,\n    0,  399,    0,  354,  354,    0,  354,  354,  354,  354,\n  354,  354,  354,  354,  354,  354,  354,    0,    0,    0,\n    0,    0,  354,  354,    0,    0,    0,    0,  354,  354,\n  354,  354,  354,  354,    0,  354,  354,  354,    0,  354,\n  354,    0,    0,  354,  354,  354,  354,  394,    0,    0,\n  354,  354,  394,  394,    0,  354,  354,  354,  354,  354,\n  354,  354,  354,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  354,  394,    0,  354,    0,  354,\n    0,  354,    0,    0,  354,    0,    0,    0,  394,  394,\n  354,    0,    0,  394,    0,    0,  394,    0,  394,    0,\n  394,  394,  394,  394,    0,    0,    0,    0,  394,    0,\n    0,    0,  394,    0,    0,    0,  394,    0,    0,    0,\n    0,    0,    0,    0,  394,    0,    0,  394,    0,  394,\n  394,    0,    0,    0,  394,  394,    0,  394,  394,  394,\n  394,  394,  394,  394,  394,  394,  394,  394,    0,    0,\n    0,    0,  364,  394,  394,    0,    0,    0,  364,  394,\n  394,    0,  394,  394,  394,    0,  394,  394,  394,    0,\n  394,  394,   31,    0,  394,  394,  394,  394,    0,    0,\n    0,  394,  394,    0,    0,    0,  394,  394,  394,  394,\n  394,  394,  394,  394,  364,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  394,    0,    0,  394,    0,\n  394,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  394,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  364,    0,    0,    0,  364,\n  364,    0,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,    0,    0,    0,  399,    0,  364,\n    0,    0,    0,  399,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,    0,  364,  364,    0,    0,  364,\n  364,  364,  364,  364,    0,    0,  364,  364,   25,    0,\n    0,  364,  364,  364,  364,  364,  364,  364,  364,  399,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n  364,    0,    0,  364,    0,  364,    0,  364,    0,    0,\n  364,    0,    0,    0,    0,    0,  364,    0,    0,    0,\n    0,   35,    0,    0,    0,    0,    0,    0,    0,    0,\n  399,    0,    0,    0,  399,  399,    0,  399,  399,  399,\n  399,  399,  399,  399,  399,  399,  399,  399,    0,    0,\n    0,    0,    0,    0,  399,    0,    0,    0,    0,  399,\n  399,  399,  399,  399,  399,    0,  399,  399,  399,    0,\n  399,  399,    0,    0,  399,  399,  399,  399,    0,    0,\n    0,  399,  399,    0,    0,    0,  399,  399,  399,  399,\n  399,  399,  399,  399,    0,    0,    0,    0,    0,    0,\n    0,    5,    0,    0,    0,  399,    0,    0,  399,    0,\n  399,    0,  399,    0,    0,  399,    0,    0,   31,   31,\n    0,  399,    0,   31,    0,    0,    0,   31,    0,   31,\n    0,    0,   31,    0,   31,   31,    0,   31,    0,   31,\n    0,   31,    0,   31,   31,   31,   31,    0, 1052,   31,\n   31,    0,    0,    0,    0,   31,    0,   31,   31,   31,\n    0,    0,   31,   31,   31,    0,   31,    0,    0,   31,\n    0,   31,   31,   31,   31,    0,    0,    0,   31,   31,\n   31,    0,    0,   31,   31,   31,    0,    0,    0,    0,\n    0,    0,   31,   31,    0,   31,   31,    0,   31,   31,\n   31,    0,    0,    0,   31,    0,    0,    0,    0,    0,\n    0,   51,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   31,    0,    0,    0,    0,    0,\n   31,   31,   31,    0,    0,   25,    0,    0,    0,   25,\n   31,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   25,    0,    0,    0,    7,   25,    0,    0,    0,   25,\n    0,    0,   25,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   25,   25,    0,    0,   35,   25,\n   25,   31,   35,    0,    0,   25,    0,   25,   25,   25,\n   25,    0,    0,   35,    0,   25,    0, 1053,   35,   25,\n    0,   25,   35,    0,    0,   35,    0,    0,    0,    0,\n    0,   25,    0,    0,   25,    0,   25,   35,   35,    0,\n   25,    0,   35,   35,    0,    0,    0,    0,   35,    0,\n   35,   35,   35,   35,    0,    0,    0,    0,   35,    0,\n   25,    0,   35,    0,   35,    0,    0,   25,   25,    0,\n    0,    0,    0,    0,   35,    0,    0,   35,    5,   35,\n   52,    0,   51,   35,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   51,    0,    0,    0,    0,   51,    0,\n    0,    0,   51,   35,    0,   51,    0,    0,    0,    0,\n    0,   35,    0,    0,    0,    0,    0,   51,   51,    0,\n    0,    0,   51,   51,    0, 1052,    0,    0,   51,   51,\n   51,   51,   51,   51,    0,    0,    0,    0,   51,    0,\n   51,    0,   51,    0,   51,   51,    0,    0,    0,   51,\n    0,    0,   51,    0,   51,    0,    0,   51,    0,   51,\n    0,    0,    0,   51,   51,   51,    0,    0,    0,   51,\n   51,    0,    0,    0,    0,   51,    0,   51,   51,   51,\n   51,    0,    0,   51,    0,   51,    0,    0,   51,   51,\n    0,   51,   51,    0,    0,    0,    0,    0,    0,    0,\n    0,   51,    0,   51,   51,    0,   51,    0,   51,    0,\n   51,    0,   51,    0,    0,   51,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   51,   51,    0,\n   51,    7,   51,   51,    0,   52,    0,    0,   51,    0,\n   51,   51,   51,   51,    0,    0,   52,    0,   51,    0,\n    0,   52,   51,    0,   51,   52,    0,    0,   52,    0,\n    0,    0,    0,    0,   51,    0,    0,   51,    0,   51,\n   52,   52,    0,   51, 1053,   52,   52,    0,   51,    0,\n    0,   52,    0,   52,   52,   52,   52,    0,    0,   51,\n    0,   52,    0,   51,   51,   52,    0,   52,   51,    0,\n    0,   51,    0,    0,    0,    0,    0,   52,    0,    0,\n   52,    0,   52,   51,   51,    0,   52,    0,   51,   51,\n    0,    0,    0,    0,   51,    0,   51,   51,   51,   51,\n    0,    0,    0,    0,   51,    0,   52,   52,   51,    0,\n   51,   52,    0,    0,    0,    0,    0,    0,    0,    0,\n   51,    0,   52,   51,    0,   51,    0,   52,    0,   51,\n    0,   52,    0,    0,   52,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   52,   52,    0,   51,\n    0,   52,   52,    0,    0,    0,    0,   52,    0,   52,\n   52,   52,   52,    0,    0,    0,    0,   52,    0,    0,\n    0,   52,    0,   52,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   52,    0,   56,   52,    0,   52,    0,\n    0,    0,   52,   57,   24,   58,   25,    0,    0,   26,\n   59,    0,   60,   61,   27,   62,   63,   64,   28,    0,\n    0,    0,   52,    0,   65,    0,   66,   30,   67,   68,\n   69,   70,    0,    0,   32,    0,    0,    0,   71,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   74,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,   76,   77,   78,   79,   80,   81,   39,\n   40,   82,   83,   41,   84,    0,   85,    0,    0,   86,\n   87,    0,    0,   88,   89,  836,    0,    0,    0,  477,\n    0,  836,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,   93,   94,    0,    0,    0,    0,   95,    0,    0,\n    0,   96,  478,    0,    0,    0,   97,   98,   99,  100,\n  101,    0,    0,    0,  102,  479,  103,  836,    0,    0,\n  481,    0,  104,  105,    0,  482,    0,  483,  484,  485,\n  486,    0,    0,    0,    0,  487,    0,    0,    0,  488,\n    0,    0,    0, 1434,    0,    0,    0,  106,  107,  108,\n  109,  489,    0,    0,  490,    0,  491,    0,  836,  200,\n    0,    0,    0,  836,  627,  836,  836,  836,  836,  836,\n  836,  836,  836,  836,  836,  836,  836,    0,    0,    0,\n  492,    0,  836,  836,    0,    0,    0,    0,  836,  836,\n  836,  836,  836,  836,  836,  836,  836,    0,  836,  836,\n    0,  836,  836,  836,  836,  836,  836,  836,  836,  836,\n  836,    0,  836,  836,  836,  836,  836,  836,  836,  836,\n  836,  836,  836,  836,  836,  836,  836,  836,  836,  836,\n  836,  836,  836,  836,  836,    0,  836, 1436,  836,    0,\n  836,  836,  836,  836,    0,    0,    0,  627,    0,  836,\n    0,    0,  627,    0,  627,  627,  627,  627,  627,  627,\n  627,  627,  627,  627,  627,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  627,  836,  627,\n    0,  627,    0,  627,  627,  627,    0,    0,    0,    0,\n    0,  627,  627,  627,  627,    0,    0,    0,  627,  627,\n    0,    0,    0,  627,  627,  627,  627,  627,  627,  627,\n  627,    0,    0,    0,    0,    0,    0,    0,    0,  836,\n    0,    0,  627,    0,  836,    0,  836,  836,  836,  836,\n  836,  836,  836,  836,  836,  836,  836,  836,  627,    0,\n    0,    0,    0,  836,  836,    0,    0,    0,    0,  836,\n  836,  836,  836,  836,  836,  836,  836,  836,    0,  836,\n  836,    0,  836,  836,  836,  836,  836,  836,  836,  836,\n  836,  836,    0,  836,  836,  836,  836,  836,  836,  836,\n  836,  836,  836,  836,  836,  836,  836,  836,  836,  836,\n  836,  836,  836,  836,  836,  836,  364,  991,    0,  836,\n    0,  836,  364,    0,  836,    0,   24,    0,   25,    0,\n  836,   26,    0,    0,    0,    0,   27,    0,    0,    0,\n   28,    0,    0,    0,    0,    0,    0,    0,    0,   30,\n    0,    0,    0,    0,    0,    0,   32,    0,  364,    0,\n    0,   33,    0,    0,    0,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n    0,    0,    0,   38,    0,    0,    0,    0,    0,    0,\n    0,   39,   40,    0,    0,   41,    0,    0,   85,  364,\n    0,    0,    0,    0,  364,    0,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,    0,    0,\n    0,    0,    0,  364,  364,    0,    0,    0,    0,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,    0,  364,\n  364,    0,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,    0,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,    0,  547, 1135,    0,  364,\n  380,  364,  547,    0,  364,    0,   24,    0,   25,    0,\n  364,   26,    0,    0,    0,    0,   27,    0,    0,    0,\n   28,    0,    0,    0,    0,    0,    0,    0,    0,   30,\n    0,    0,    0,    0,    0,    0,   32,    0,  547,    0,\n    0,   33,    0,    0,    0,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n    0,    0,    0,   38,    0,    0,    0,    0,    0,    0,\n    0,   39,   40,    0,    0,   41,    0,    0,   85,  547,\n    0,    0,    0,    0,  547,    0,  547,  547,  547,  547,\n  547,  547,  547,  547,  547,  547,  547,    0,    0,    0,\n    0,    0,    0,  547,  547,    0,    0,    0,  547,  547,\n  547,  547,  547,  547,  547,  547,  547,  547,    0,  547,\n  547,    0,  547,  547,  547,  547,  547,  547,  547,  547,\n  547,  547,    0,  547,  547,  547,  547,  547,  547,  547,\n  547,  547,  547,  547,  547,  547,  547,  547,  547,  547,\n  547,  547,  547,  547,  547,    0,  543,    0,    0,  547,\n  380,  547,  543,    0,    0,  477,    0,    0,    0,    0,\n  547,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  478,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  543,    0,\n    0,  479,    0,    0,    0,    0,  481,    0,    0,    0,\n    0,  482,    0,  483,  484,  485,  486,    0,    0,    0,\n    0,  487,    0,    0,    0,  488,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  489,    0,  543,\n  490,    0,  491,    0,  543,    0,  543,  543,  543,  543,\n  543,  543,  543,  543,  543,  543,  543,    0,    0,    0,\n    0,    0,    0,  543,  543,    0,  492,    0,  543,  543,\n    0,  543,  543,  543,  543,  543,  543,  543,    0,  543,\n  543,    0,  543,  543,  543,  543,  543,  543,  543,  543,\n  543,  543,    0,  543,  543,  543,  543,  543,  543,  543,\n  543,  543,  543,  543,  543,  543,  543,  543,  543,  543,\n  543,  543,  543,  543,  543,    0,  551,    0,    0,  543,\n  386,  543,  551, 1453,  543,    0,    0,    0,    0,    0,\n  543,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  386,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  386,    0,  551,    0,\n    0,  386,    0,    0,  254,    0,  386,    0,  386,  386,\n  386,  386,    0,    0,    0,    0,  386,    0,    0,    0,\n  386,    0,    0,    0,  386,    0,    0,    0,    0,    0,\n    0,    0,  386,    0,    0,  386,    0,  386,    0,  551,\n    0,    0,    0,    0,  551,    0,  551,  551,  551,  551,\n  551,  551,  551,  551,  551,  551,  551,    0,    0,    0,\n    0,  386,    0,  551,  551,    0,    0,    0,  386,  551,\n    0,  551,  551,  551,  551,  551,  551,  551,    0,  551,\n  551,    0,  551,  551,  551,  551,  551,  551,  551,  551,\n  551,  551,    0,  551,  551,  551,  551,  551,  551,  551,\n  551,  551,  551,  551,  551,  551,  551,  551,  551,  551,\n  551,  551,  551,  551,  551,    0,  364,    0,  386,  551,\n  385,  551,  364,    0,  551,    0,    0,    0,    0,    0,\n  551,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  385,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  385,    0,  364,    0,\n    0,  385,    0,    0,  253,    0,  385,    0,  385,  385,\n  385,  385,    0,    0,    0,    0,  385,    0,    0,    0,\n  385,    0,    0,    0,  385,    0,    0,    0,    0,    0,\n    0,    0,  385,    0,    0,  385,    0,  385,    0,  364,\n    0,    0,    0,    0,  364,    0,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,    0,    0,    0,\n    0,  385,    0,  364,  364,    0,    0,    0,  385,  364,\n    0,  364,  364,  364,  364,  364,  364,  364,    0,  364,\n  364,    0,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,    0,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,    0,  471,    0,  385,  364,\n    0,  364,  471,    0,  364,    0,  732,    0,  732,    0,\n  364,  732,    0,  732,  732,    0,  732,    0,  732,    0,\n  732,    0,  732,  732,  732,    0,    0,    0,  732,  732,\n    0,    0,    0,    0,  732,    0,  732,  732,  471,    0,\n    0,  732,    0,    0,    0,  732,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  732,    0,  732,\n    0,    0,    0,  732,  732,    0,    0,    0,    0,    0,\n    0,  732,  732,    0,    0,  732,    0,    0,  732,  471,\n    0,    0,    0,  732,  471,    0,  471,  471,  471,  471,\n  471,  471,  471,  471,  471,  471,  471,    0,    0,    0,\n    0,    0,    0,  471,  471,    0,    0,    0,    0,  471,\n    0,  471,  471,  471,  471,  471,  471,  471,    0,  471,\n  471,    0,  471,  471,  471,  471,  471,  471,  471,  471,\n  471,  471,    0,  471,  471,  471,  471,  471,  471,  471,\n  471,  471,  471,  471,  471,  471,  471,  471,  471,  471,\n  471,  471,  471,  471,  471,    0,  578,    0,    0,  471,\n  732,  471,  578,    0,  471,    0,   24,    0,   25,    0,\n  471,   26,    0,    0, 1399,    0,   27,    0,  757,    0,\n   28,    0,  758, 1400, 1401,    0,    0,    0, 1402,   30,\n    0,    0,    0,    0, 1403,    0,   32,    0,  578,    0,\n    0,   33,    0,    0,    0,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n  364,    0,    0,   38,    0,    0,  364,    0,    0,    0,\n  836,   39,   40,    0,    0,   41,    0,    0, 1404,  578,\n    0,    0,    0, 1405,  578,    0,  578,  578,  578,  578,\n  578,  578,  578,  578,  578,  578,  578,    0,    0,    0,\n    0,    0,  364,  578,    0,    0,    0,    0,    0,  578,\n    0,  578,    0,  578,    0,  578,  578,  578,  836,  578,\n  578,    0,  578,  578,  578,  578,  578,  578,  578,  578,\n  578,  578,    0,    0,    0,  578,  578,  578,  578,  578,\n  578,  578,  578,  578,  578,  578,  578,  578,  578,  578,\n  578,  578,  578,    0,  578,  663,    0,    0,    0,  578,\n 1407,  364,    0,    0,    0,    0,    0,  364,  364,    0,\n  578,    0,    0,  364,  364,  364,  364,  364,  364,  364,\n  836,  364,    0,  364,  364,  205,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,    0,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  364,    0,\n  354,    0,    0,  364,    0,  364,  354,  206,  364,    0,\n    0,    0,    0,    0,  364,    0,    0,    0,  663,    0,\n    0,    0,    0,  663,    0,  663,  663,  663,  663,  663,\n  663,  663,  663,  663,  663,  663,    0,    0,    0,    0,\n    0,    0,  354,    0,    0,    0,    0,    0,  663,    0,\n  663,    0,  663,    0,  663,  663,  663,    0,  207,  208,\n  209,  210,    0,  211,  212,  213,  214,  215,  216,  217,\n  218,    0,    0,  219,  220,  221,  222,  223,  224,  225,\n  226,    0,    0,  354,    0,    0,    0,    0,  354,    0,\n  354,  354,  354,  354,  354,  354,  354,  354,  354,  354,\n  354,    0,    0,    0,    0,  620,    0,  354,  422,  663,\n    0,  620,    0,  354,  354,  354,  422,  354,  422,  354,\n  354,  354,    0,  354,  354,    0,    0,  354,  354,  354,\n  354,    0,    0,    0,  354,  354,    0,  422,  422,  354,\n  354,  354,  354,  354,  354,  354,  354,  620,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  422,  354,    0,\n    0,    0,    0,  354,  422,  422,    0,    0,  422,    0,\n  422,    0,    0,    0,  354,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  620,    0,\n    0,    0,    0,  620,    0,  620,  620,  620,  620,  620,\n  620,  620,  620,  620,  620,  620,  422,    0,    0,    0,\n    0,    0,  620,  423,    0,    0,    0,    0,  620,    0,\n  620,  423,  620,  423,  620,  620,  620,    0,  620,  620,\n    0,    0,  620,  620,  620,  620,    0,    0,    0,  620,\n  620,    0,  423,  423,  620,  620,  620,  620,  620,  620,\n  620,  620,    0,  354,    0,    0,    0,    0,    0,  354,\n    0,    0,  423,  620,    0,    0,    0,    0,  620,    0,\n  423,  354,  422,  423,    0,    0,    0,  422,  354,  620,\n  422,  422,  422,  422,    0,  422,    0,  422,  422,    0,\n  422,  422,  422,  422,  422,  354,  422,  422,  422,  422,\n    0,  422,  422,  422,  422,  422,  422,  422,  422,  422,\n  422,  422,  422,  422,  422,  422,  422,  422,  422,  422,\n  422,  422,  422,    0,    0,    0,    0,  354,    0,  422,\n    0,    0,  422,    0,    0,    0,  354,    0,  422,    0,\n    0,  354,    0,  354,  354,  354,  354,  354,  354,  354,\n  354,  354,  354,  354,    0,    0,    0,    0,  600,    0,\n  354,    0,    0,    0,  600,    0,  354,  354,  354,    0,\n  354,    0,  354,  354,  354,    0,  354,  354,    0,    0,\n  354,  354,  354,  354,    0,    0,    0,  354,  354,    0,\n    0,    0,  354,  354,  354,  354,  354,  354,  354,  354,\n  600,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  354,    0,    0,    0,    0,  354,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  354,    0,    0,\n  618,    0,    0,    0,    0,    0,  618,    0,    0,    0,\n    0,  600,    0,    0,    0,    0,  600,    0,  600,  600,\n  600,  600,  600,  600,  600,  600,  600,  600,  600,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  600,  618,  600,    0,  600,    0,  600,  600,  600,\n    0,  600,  600,    0,    0,  600,  600,  600,  600,  600,\n  600,  600,  600,  600,    0,    0,    0,  600,  600,  600,\n  600,  600,  600,  600,  600,    0,    0,    0,    0,    0,\n    0,    0,    0,  618,    0,    0,  600,    0,  618,    0,\n  618,  618,  618,  618,  618,  618,  618,  618,  618,  618,\n  618,    0,  600,    0,    0,  607,    0,  618,    0,    0,\n    0,  607,    0,  618,    0,  618,    0,  618,    0,  618,\n  618,  618,    0,  618,  618,    0,    0,  618,  618,  618,\n  618,    0,    0,    0,  618,  618,    0,    0,    0,  618,\n  618,  618,  618,  618,  618,  618,  618,  607,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  618,    0,\n    0,    0,    0,  618,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  618,    0,    0,  958,    0,    0,\n    0,    0,    0,  958,    0,    0,    0,    0,  607,    0,\n    0,    0,    0,  607,    0,  607,  607,  607,  607,  607,\n  607,  607,  607,  607,  607,  607,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  607,  958,\n  607,    0,  607,    0,  607,  607,  607,    0,  607,  607,\n    0,    0,  607,  607,  607,  607,    0,    0,    0,  607,\n  607,    0,    0,    0,  607,  607,  607,  607,  607,  607,\n  607,  607,    0,    0,    0,    0,    0,    0,    0,    0,\n  958,    0,    0,  607,    0,  958,    0,  958,  958,  958,\n  958,  958,  958,  958,  958,  958,  958,  958,    0,  607,\n    0,    0,  608,    0,    0,    0,    0,    0,  608,    0,\n  958,    0,  958,    0,  958,    0,  958,  958,  958,    0,\n  958,  958,    0,    0,  958,  958,  958,  958,    0,    0,\n    0,  958,  958,    0,    0,    0,  958,  958,  958,  958,\n  958,  958,  958,  958,  608,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  958,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  958,    0,    0,  609,    0,    0,    0,    0,    0,\n  609,    0,    0,    0,    0,  608,    0,    0,    0,    0,\n  608,    0,  608,  608,  608,  608,  608,  608,  608,  608,\n  608,  608,  608,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  608,  609,  608,    0,  608,\n    0,  608,  608,  608,    0,  608,  608,    0,    0,  608,\n  608,  608,  608,    0,    0,    0,  608,  608,    0,    0,\n    0,  608,  608,  608,  608,  608,  608,  608,  608,    0,\n    0,    0,    0,    0,    0,    0,    0,  609,    0,    0,\n  608,    0,  609,    0,  609,  609,  609,  609,  609,  609,\n  609,  609,  609,  609,  609,    0,  608,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  609,    0,  609,\n    0,  609,    0,  609,  609,  609,    0,  609,  609,    0,\n    0,  609,  609,  609,  609,    0,    0,    0,  609,  609,\n    0,    0,    0,  609,  609,  609,  609,  609,  609,  609,\n  609,    0,  525,    0,  628,    0,    0,    0,    0,    0,\n   57,   24,  609,   25,    0,    0,   26,  259,    0,    0,\n    0,   27,   62,   63,    0,   28,    0,    0,  609,    0,\n    0,   65,    0,    0,   30,    0,    0,    0,    0,    0,\n    0,   32,    0,    0,    0,    0,   33,    0,   72,   73,\n   34,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   36,    0,   37,   75,    0,    0,   38,    0,\n    0,   77,    0,   79,    0,   81,   39,   40,  260,    0,\n   41,    0,    0,    0,    0,    0,    0,  628,    0,  629,\n    0,    0,  628,    0,  628,  628,  628,  628,  628,  628,\n  628,  628,  628,  628,  628,   90,   91,   92,  261,  526,\n    0,    0,    0,    0,    0,    0,    0,  628,   96,  628,\n    0,  628,    0,  628,  628,  628,    0,    0,    0,    0,\n    0,  628,  628,  628,  628,    0,    0,    0,  628,  628,\n    0,    0,    0,  628,  628,  628,  628,  628,  628,  628,\n  628,    0,    0,    0,    0,    0,    0,    0,  632,    0,\n    0,    0,  628,    0,  106,  527,    0,    0,    0,    0,\n    0,    0,  629,    0,    0,  528,  529,  629,  628,  629,\n  629,  629,  629,  629,  629,  629,  629,  629,  629,  629,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  629,    0,  629,    0,  629,    0,  629,  629,\n  629,    0,    0,    0,    0,    0,  629,  629,  629,  629,\n    0,    0,    0,  629,  629,    0,    0,  633,  629,  629,\n  629,  629,  629,  629,  629,  629,    0,    0,    0,    0,\n    0,  632,    0,    0,    0,    0,  632,  629,  632,  632,\n  632,  632,  632,  632,  632,  632,  632,  632,  632,    0,\n    0,    0,    0,  629,    0,    0,    0,    0,    0,    0,\n    0,  632,    0,  632,    0,  632,    0,  632,  632,  632,\n    0,    0,    0,    0,    0,  632,  632,  632,  632,    0,\n    0,    0,  632,  632,    0,    0,  634,    0,    0,  632,\n  632,  632,  632,  632,  632,    0,    0,    0,    0,    0,\n  633,    0,    0,    0,    0,  633,  632,  633,  633,  633,\n  633,  633,  633,  633,  633,  633,  633,  633,    0,    0,\n    0,    0,  632,    0,    0,    0,    0,    0,    0,    0,\n  633,    0,  633,    0,  633,    0,  633,  633,  633,    0,\n    0,    0,    0,    0,  633,  633,  633,  633,    0,    0,\n    0,  633,  633,    0,    0,  635,    0,    0,  633,  633,\n  633,  633,  633,  633,    0,    0,    0,    0,    0,  634,\n    0,    0,    0,    0,  634,  633,  634,  634,  634,  634,\n  634,  634,  634,  634,  634,  634,  634,    0,    0,    0,\n    0,  633,    0,    0,    0,    0,    0,    0,    0,  634,\n    0,  634,    0,  634,    0,  634,  634,  634,    0,    0,\n    0,    0,    0,  634,  634,  634,  634,    0,    0,    0,\n  634,  634,    0,    0,  636,    0,    0,  634,  634,  634,\n  634,  634,  634,    0,    0,    0,    0,    0,  635,    0,\n    0,    0,    0,  635,  634,  635,  635,  635,  635,  635,\n  635,  635,  635,  635,  635,  635,    0,    0,    0,    0,\n  634,    0,    0,    0,    0,    0,    0,    0,  635,    0,\n  635,    0,  635,    0,  635,  635,  635,    0,    0,    0,\n    0,    0,  635,  635,  635,  635,  364,    0,    0,  635,\n  635,    0,  364,    0,    0,    0,  635,  635,  635,  635,\n  635,  635,    0,    0,    0,    0,    0,  636,    0,    0,\n    0,    0,  636,  635,  636,  636,  636,  636,  636,  636,\n  636,  636,  636,  636,  636,    0,    0,    0,  364,  635,\n    0,    0,    0,    0,    0,    0,    0,  636,    0,  636,\n    0,  636,    0,  636,  636,  636,    0,    0,    0,    0,\n    0,  636,  636,  636,  636,    0,    0,    0,  636,  636,\n    0,    0,    0,    0,    0,  636,  636,  636,  636,  636,\n  636,    0,    0,  641,    0,    0,    0,    0,    0,    0,\n    0,    0,  636,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  364,    0,    0,    0,  636,  364,\n    0,    0,  364,    0,  364,  364,    0,    0,    0,  364,\n  364,    0,    0,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,    0,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  642,  364,  364,    0,    0,    0,    0,    0,\n    0,  364,    0,    0,  364,    0,  641,    0,    0,    0,\n  364,  641,    0,  641,  641,  641,  641,  641,  641,  641,\n  641,  641,  641,  641,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  641,    0,  641,    0,\n  641,    0,  641,  641,  641,    0,    0,    0,    0,    0,\n    0,    0,  641,  641,    0,    0,    0,  641,  641,    0,\n    0,  643,    0,    0,    0,    0,  641,  641,  641,  641,\n    0,    0,    0,    0,    0,  642,    0,    0,    0,    0,\n  642,  641,  642,  642,  642,  642,  642,  642,  642,  642,\n  642,  642,  642,    0,    0,    0,    0,  641,    0,    0,\n    0,    0,    0,    0,    0,  642,    0,  642,    0,  642,\n    0,  642,  642,  642,    0,    0,    0,    0,    0,    0,\n    0,  642,  642,    0,    0,    0,  642,  642,    0,    0,\n  646,    0,    0,    0,    0,  642,  642,  642,  642,    0,\n    0,    0,    0,    0,  643,    0,    0,    0,    0,  643,\n  642,  643,  643,  643,  643,  643,  643,  643,  643,  643,\n  643,  643,    0,    0,    0,    0,  642,    0,    0,    0,\n    0,    0,    0,    0,  643,    0,  643,    0,  643,    0,\n  643,  643,  643,    0,    0,    0,    0,    0,    0,    0,\n  643,  643,    0,    0,    0,  643,  643,    0,    0,  647,\n    0,    0,    0,    0,  643,  643,  643,  643,    0,    0,\n    0,    0,    0,  646,    0,    0,    0,    0,  646,  643,\n  646,  646,  646,  646,  646,  646,  646,  646,  646,  646,\n  646,    0,    0,    0,    0,  643,    0,    0,    0,    0,\n    0,    0,    0,  646,    0,  646,    0,  646,    0,  646,\n  646,  646,    0,    0,    0,    0,    0,    0,    0,  646,\n  646,    0,    0,    0,  646,  646,    0,    0,  649,    0,\n    0,    0,    0,    0,    0,  646,  646,    0,    0,    0,\n    0,    0,  647,    0,    0,    0,    0,  647,  646,  647,\n  647,  647,  647,  647,  647,  647,  647,  647,  647,  647,\n    0,    0,    0,    0,  646,    0,    0,    0,    0,    0,\n    0,    0,  647,    0,  647,    0,  647,    0,  647,  647,\n  647,    0,    0,    0,    0,    0,    0,    0,  647,  647,\n    0,    0,    0,  647,  647,    0,    0,  650,    0,    0,\n    0,    0,    0,    0,  647,  647,    0,    0,    0,    0,\n    0,  649,    0,    0,    0,    0,  649,  647,  649,  649,\n  649,  649,  649,  649,  649,  649,  649,  649,  649,    0,\n    0,    0,    0,  647,    0,    0,    0,    0,    0,    0,\n    0,  649,    0,  649,    0,  649,    0,  649,  649,  649,\n    0,    0,    0,    0,    0,    0,    0,    0,  649,    0,\n    0,    0,  649,  649,    0,    0,  652,    0,    0,    0,\n    0,    0,    0,  649,  649,    0,    0,    0,    0,    0,\n  650,    0,    0,    0,    0,  650,  649,  650,  650,  650,\n  650,  650,  650,  650,  650,  650,  650,  650,    0,    0,\n    0,    0,  649,    0,    0,    0,    0,    0,    0,    0,\n  650,    0,  650,    0,  650,    0,  650,  650,  650,    0,\n    0,    0,    0,    0,    0,    0,    0,  650,    0,    0,\n    0,  650,  650,    0,    0,  653,    0,    0,    0,    0,\n    0,    0,  650,  650,    0,    0,    0,    0,    0,  652,\n    0,    0,    0,    0,  652,  650,  652,  652,  652,  652,\n  652,  652,  652,  652,  652,  652,  652,    0,    0,    0,\n    0,  650,    0,    0,    0,    0,    0,    0,    0,  652,\n    0,  652,    0,  652,    0,  652,  652,  652,    0,    0,\n    0,    0,    0,    0,    0,    0,  652,    0,    0,    0,\n    0,  652,    0,    0,  655,    0,    0,    0,    0,    0,\n    0,  652,  652,    0,    0,    0,    0,    0,  653,    0,\n    0,    0,    0,  653,  652,  653,  653,  653,  653,  653,\n  653,  653,  653,  653,  653,  653,    0,    0,    0,    0,\n  652,    0,    0,    0,    0,    0,    0,    0,  653,    0,\n  653,    0,  653,    0,  653,  653,  653,    0,    0,    0,\n    0,    0,    0,    0,    0,  653,    0,    0,    0,    0,\n  653,    0,    0,  656,    0,    0,    0,    0,    0,    0,\n  653,  653,    0,    0,    0,    0,    0,  655,    0,    0,\n    0,    0,  655,  653,  655,  655,  655,  655,  655,  655,\n  655,  655,  655,  655,  655,    0,    0,    0,    0,  653,\n    0,    0,    0,    0,    0,    0,    0,  655,    0,  655,\n    0,  655,    0,  655,  655,  655,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,  655,\n    0,    0,  658,    0,    0,    0,    0,    0,    0,  655,\n  655,    0,    0,    0,    0,    0,  656,    0,    0,    0,\n    0,  656,  655,  656,  656,  656,  656,  656,  656,  656,\n  656,  656,  656,  656,    0,    0,    0,    0,  655,    0,\n    0,    0,    0,    0,    0,    0,  656,    0,  656,    0,\n  656,    0,  656,  656,  656,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  656,    0,\n    0,  659,    0,    0,    0,    0,    0,    0,  656,  656,\n    0,    0,    0,    0,    0,  658,    0,    0,    0,    0,\n  658,  656,  658,  658,  658,  658,  658,  658,  658,  658,\n  658,  658,  658,    0,    0,    0,    0,  656,    0,    0,\n    0,    0,    0,    0,    0,  658,    0,  658,    0,  658,\n    0,  658,  658,  658,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  658,    0,    0,\n    0,  364,    0,    0,    0,  836,    0,    0,  658,    0,\n    0,    0,    0,    0,  659,    0,    0,    0,    0,  659,\n  658,  659,  659,  659,  659,  659,  659,  659,  659,  659,\n  659,  659,    0,    0,    0,    0,  658,  364,    0,    0,\n    0,    0,    0,    0,  659,    0,  659,    0,  659,    0,\n  659,  659,  659,  836,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,  659,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  659,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,  659,\n    0,    0,    0,    0,    0,    0,  364,    0,    0,    0,\n    0,    0,  364,  364,    0,  659,    0,    0,  364,  364,\n    0,  364,    0,  364,    0,  836,  364,    0,  364,  364,\n    0,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,    0,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,    0,    0,  591,    0,  364,    0,\n  364,    0,    0,  364,   57,   24,   58,   25, 1164,  364,\n   26,   59,    0,   60,   61,   27,   62,   63,   64,   28,\n    0,    0,    0,    0,    0,   65,    0,   66,   30,   67,\n   68,   69,   70,    0,    0,   32,    0,    0,    0,   71,\n   33,    0,   72,   73,   34,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   74,    0,   36,    0,   37,   75,\n    0,    0,   38,    0,   76,   77,   78,   79,   80,   81,\n   39,   40,   82,   83,   41,   84,    0,   85,    0,    0,\n   86,   87,    0,    0,   88,   89,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   90,\n   91,   92,   93,   94,    0,    0,    0,    0,   95,    0,\n    0,    0,   96,    0,    0,    0,    0,   97,   98,   99,\n  100,  101,    0,    0,    0,  102,    0,  103,    0,    0,\n    0,    0,    0,  104,  105,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   56,    0,  106,  592,\n  108,  109,    0, 1165,   57,   24,   58,   25,    0,    0,\n   26,   59,    0,   60,   61,   27,   62,   63,   64,   28,\n    0,    0,    0,    0,    0,   65,    0,   66,   30,   67,\n   68,   69,   70,    0,    0,   32,    0,    0,    0,   71,\n   33,    0,   72,   73,   34,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   74,    0,   36,    0,   37,   75,\n    0,    0,   38,    0,   76,   77,   78,   79,   80,   81,\n   39,   40,   82,   83,   41,   84,    0,   85,    0,    0,\n   86,   87,    0,    0,   88,   89,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   90,\n   91,   92,   93,   94,    0,    0,    0,    0,   95,    0,\n    0,    0,   96,    0,    0,    0,    0,   97,   98,   99,\n  100,  101,    0,    0,    0,  102,    0,  103,    0,    0,\n    0,    0,    0,  104,  105,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  272,    0,    0,    0,  106,  107,\n  108,  109,   57,   24,   58,   25,    0,    0,   26,   59,\n    0,   60,   61,   27,   62,   63,   64,   28,    0,    0,\n    0,    0,    0,   65,    0,   66,   30,   67,   68,   69,\n   70,    0,    0,   32,    0,    0,    0,   71,   33,    0,\n   72,   73,   34,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   74,    0,   36,    0,   37,   75,    0,    0,\n   38,    0,   76,   77,   78,   79,   80,   81,   39,   40,\n   82,   83,   41,   84,    0,   85,    0,    0,   86,   87,\n    0,    0,   88,   89,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   90,   91,   92,\n   93,   94,    0,    0,    0,    0,   95,    0,    0,    0,\n   96,    0,    0,    0,    0,   97,   98,   99,  100,  101,\n    0,    0,    0,  102,    0,  103,    0,    0,    0,    0,\n    0,  104,  105,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  591,    0,    0,    0,  106,  107,  108,  109,\n   57,   24,   58,   25,    0,    0,   26,   59,    0,   60,\n   61,   27,   62,   63,   64,   28,    0,    0,    0,    0,\n    0,   65,    0,   66,   30,   67,   68,   69,   70,    0,\n    0,   32,    0,    0,    0,   71,   33,    0,   72,   73,\n   34,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   74,    0,   36,    0,   37,   75,    0,    0,   38,    0,\n   76,   77,   78,   79,   80,   81,   39,   40,   82,   83,\n   41,   84,    0,   85,    0,    0,   86,   87,    0,    0,\n   88,   89,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   90,   91,   92,   93,   94,\n    0,    0,    0,    0,   95,    0,    0,    0,   96,    0,\n    0,    0,    0,   97,   98,   99,  100,  101,    0,    0,\n    0,  102,    0,  103,    0,    0,    0,    0,    0,  104,\n  105,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n 1049,    0,    0,    0,  106,  592,  108,  109, 1049, 1049,\n 1049, 1049,    0,    0, 1049, 1049,    0, 1049, 1049, 1049,\n 1049, 1049, 1049, 1049,    0,    0,    0,    0,    0, 1049,\n    0, 1049, 1049, 1049, 1049, 1049, 1049,    0,    0, 1049,\n    0,    0,    0, 1049, 1049,    0, 1049, 1049, 1049,    0,\n    0,    0,    0,    0,    0,    0,    0,    0, 1049,    0,\n 1049,    0, 1049, 1049,    0,    0, 1049,    0, 1049, 1049,\n 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049, 1049,\n    0, 1049,    0,    0, 1049, 1049,    0,    0, 1049, 1049,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0, 1049, 1049, 1049, 1049, 1049,    0,    0,\n    0,    0, 1049,    0,    0,    0, 1049,    0,    0,    0,\n    0, 1049, 1049, 1049, 1049, 1049,    0,    0,    0, 1049,\n    0, 1049,    0,    0,    0,    0,    0, 1049, 1049,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  635,    0,\n    0,    0, 1049, 1049, 1049, 1049,   57,   24,    0,   25,\n    0,    0,   26,  259,    0,    0,    0,   27,   62,   63,\n    0,   28,    0,    0,  189,    0,  189,   65,    0,  189,\n   30,    0,    0,    0,  189,    0,    0,   32,  189,    0,\n    0,    0,   33,    0,   72,   73,   34,  189,  636,    0,\n    0,    0,    0,    0,  189,  637,    0,    0,   36,  189,\n   37,   75,    0,  189,   38,    0,    0,   77,    0,   79,\n    0,   81,   39,   40,  260,  189,   41,  189,    0,    0,\n    0,  189,    0,  638,    0,    0,   88,   89,    0,  189,\n  189,    0,    0,  189,    0,    0,  189,    0,    0,    0,\n    0,   90,   91,   92,   93,   94,    0,    0,    0,    0,\n    0,    0,    0,    0,   96,    0,    0,  639,    0,    0,\n   98,   99,  100,  101,    0,    0,    0,  102,    0,  103,\n    0,    0, 1074,    0,    0,  104,  105,    0,    0,    0,\n    0,    0,    0,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,    0,   28,    0,\n  106,  107,  108,  109,   65,    0,    0,   30,    0,    0,\n    0,    0,    0,    0,   32,    0,    0,    0,  189,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,    0,   41,    0,    0,    0,    0,    0,    0,\n   87,    0,    0,   88,   89,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,   93,  801,    0,    0,    0,    0,  802, 1088,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,    0,    0,    0,\n    0,    0,  104,  105,    0,    0,    0,    0,    0,    0,\n   57,   24,    0,   25,    0,    0,   26,  259,    0,    0,\n    0,   27,   62,   63,    0,   28,    0,  106,  803,  108,\n  109,   65,    0,  804,   30,    0,    0,    0,  805,    0,\n    0,   32,    0,    0,    0,    0,   33,    0,   72,   73,\n   34,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   36,    0,   37,   75,    0,    0,   38,    0,\n    0,   77,    0,   79,    0,   81,   39,   40,  260,    0,\n   41,    0,    0,    0,    0,    0,    0,   87,    0,    0,\n   88,   89,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   90,   91,   92,   93,  801,\n    0,    0,    0,    0,  802,    0,    0,    0,   96,    0,\n    0,    0,    0,    0,   98,   99,  100,  101,    0,    0,\n    0,  102,    0,  103,    0,    0,    0,    0,    0,  104,\n  105,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  819,  106,  803,  108,  109,    0,    0,\n  804,   57,   24,    0,   25,  805,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,  189,\n    0,  189,   65,    0,  189,   30,    0,    0,    0,  189,\n    0,    0,   32,  189,    0,    0,    0,   33,    0,   72,\n   73,   34,  189,    0,    0,    0,    0,    0,    0,  189,\n    0,    0,    0,   36,  189,   37,   75,    0,  189,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n  189,   41,  189,    0,    0,    0,  189,    0,   87,    0,\n    0,   88,   89,    0,  189,  189,    0,    0,  189,    0,\n    0,  189,    0,    0,    0,    0,   90,   91,   92,   93,\n  308,    0,    0,    0,    0,  546,  820,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103, 1074,    0,    0,    0,    0,\n  104,  105,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0, 1013,    0,    0,    0,  106,  309,  108,  109,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,  189,   28,    0,    0,   24,    0,   25,\n   65,    0,   26,   30,    0,    0,    0,   27,    0,    0,\n   32,   28,    0,    0,    0,   33,    0,   72,   73,   34,\n   30,  636,    0,    0,    0,    0,    0,   32,  637,    0,\n    0,   36,   33,   37,   75,    0,   34,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,   36,   41,\n   37,    0,    0,    0,   38,    0,  638,    0,    0,   88,\n   89,    0,   39,   40,    0,    0,   41,    0,    0,   85,\n    0,    0,    0,    0,   90,   91,   92,   93,   94,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,    0,    0,    0,    0,    0,  104,  105,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,  819,\n    0,    0,    0,  106,  107,  108,  109,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,  380,   28,    0,    0,   24,    0,   25,   65,    0,\n   26,   30,    0,    0,    0,   27,    0,    0,   32,   28,\n    0,    0,    0,   33,    0,   72,   73,   34,   30,    0,\n    0,    0,    0,    0,    0,   32,    0,    0,    0,   36,\n   33,   37,   75, 1019,   34,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,   36,   41,   37,    0,\n    0,    0,   38,    0,   87,    0,    0,   88,   89,    0,\n   39,   40,    0,    0,   41,    0,    0,  608,    0,    0,\n    0,    0,   90,   91,   92,   93,  308,    0,    0,    0,\n    0,  546,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,    0,    0,    0,    0,    0,  104,  105,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  819,    0,    0,\n    0,  106,  309,  108,  109,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,  380,\n   28,    0,    0,    0,    0,    0,   65,    0,    0,   30,\n    0,    0,    0,    0,    0,    0,   32,    0,    0,    0,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,   87,    0,    0,   88,   89,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,   93,  308,    0,    0,    0,    0,  546,\n    0,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,    0,\n    0,    0,    0,    0,  104,  105,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  347,    0,  106,\n  309,  108,  109,  348,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,    0,    0,    0,   65,    0,    0,   30,\n    0,    0,    0,    0,    0,    0,   32,    0,    0,  349,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,    0,    0,  350,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,  261,  351,    0,    0,    0,    0,    0,\n    0,    0,    0,   96,    0,  352,    0,    0,    0,   98,\n   99,  100,  101,  972,    0,    0,  102,    0,  103,  811,\n    0,    0,    0,    0,  104,  105,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,    0,    0,    0,    0,   65,  106,\n  263,   30,  109,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,   87,    0,    0,   88,   89,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,   93,  308,    0,    0,    0,\n    0,    0,  973,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,    0,    0,    0,    0,    0,  104,  105,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0, 1016,    0,    0,\n    0,  106,  309,  108,  109,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,   24,    0,   25,   65,    0,   26,   30,\n    0,    0,    0,   27,    0,    0,   32,   28,    0,    0,\n    0,   33,    0,   72,   73,   34,   30,    0,    0,    0,\n    0,    0,    0,   32,    0,    0,    0,   36,   33,   37,\n   75,    0,   34,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,   36,   41,   37,    0,    0,    0,\n   38,    0,   87,    0,    0,   88,   89,    0,   39,   40,\n    0,    0,   41,    0,    0,  563,    0,    0,    0,    0,\n   90,   91,   92,   93,  308,    0,    0,    0,    0,    0,\n 1017,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,    0,\n    0,    0,    0,    0,  104,  105,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  307,    0,    0,    0,  106,\n  309,  108,  109,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,  380,   28,    0,\n    0,  527,    0,  527,   65,    0,  527,   30,    0,    0,\n    0,  527,    0,    0,   32,  527,    0,    0,    0,   33,\n    0,   72,   73,   34,  527,    0,    0,    0,    0,    0,\n    0,  527,    0,    0,    0,   36,  527,   37,   75,    0,\n  527,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,  527,   41,  527,    0,    0,    0,  527,    0,\n   87,    0,    0,   88,   89,    0,  527,  527,    0,    0,\n  527,    0,    0,  527,    0,    0,    0,    0,   90,   91,\n   92,   93,  308,    0,    0,    0,    0,    0,    0,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,    0,    0,    0,\n    0,    0,  104,  105,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  316,    0,    0,    0,  106,  309,  108,\n  109,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,  527,   28,    0,    0,    0,\n    0,    0,   65,    0,    0,   30,    0,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,   87,    0,\n    0,   88,   89,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,   93,\n  308,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,    0,    0,    0,    0,    0,\n  104,  105,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  347,    0,  106,  309,  108,  109,  348,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,    0,    0,   30,    0,    0,    0,    0,\n    0,    0,   32,    0,    0,  349,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,    0,    0,\n  350,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  351,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,  352,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,  633,    0,    0,    0,    0,\n  104,  105,    0,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,    0,   28,    0,\n    0,    0,    0,    0,   65,  106,  263,   30,  109,    0,\n    0,    0,    0,    0,   32,    0,    0,    0,    0,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,    0,   41,    0,    0,    0,    0,    0,    0,\n   87,    0,    0,   88,   89,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,   93,   94,    0,    0,    0,    0,    0,    0,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,    0,    0,    0,\n    0,    0,  104,  105,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  811,    0,    0,    0,  106,  107,  108,\n  109,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,  190,\n    0,  190,   65,    0,  190,   30,    0,    0,    0,  190,\n    0,    0,   32,  190,    0,    0,    0,   33,    0,   72,\n   73,   34,  190,    0,    0,    0,    0,    0,    0,  190,\n    0,    0,    0,   36,  190,   37,   75,    0,  190,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n  190,   41,  190,    0,    0,    0,  190,    0,   87,    0,\n    0,   88,   89,    0,  190,  190,    0,    0,  190,    0,\n    0,  190,    0,    0,    0,    0,   90,   91,   92,   93,\n  308,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,    0,    0,    0,    0,    0,\n  104,  105,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0, 1126,    0,    0,    0,  106,  309,  108,  109,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,  190,   28,    0,    0,  189,    0,  189,\n   65,    0,  189,   30,    0,    0,    0,  189,    0,    0,\n   32,  189,    0,    0,    0,   33,    0,   72,   73,   34,\n  189,    0,    0,    0,    0,    0,    0,  189,    0,    0,\n    0,   36,  189,   37,   75,    0,  189,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,  189,   41,\n  189,    0,    0,    0,  189,    0,   87,    0,    0,   88,\n   89,    0,  189,  189,    0,    0,  189,    0,    0,  189,\n    0,    0,    0,    0,   90,   91,   92,   93,   94,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,    0,    0,    0,    0,    0,  104,  105,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0, 1278,\n    0,    0,    0,  106, 1127,  108,  109,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,  189,   28,    0,    0,  199,    0,  199,   65,    0,\n  199,   30,    0,    0,    0,  199,    0,    0,   32,  199,\n    0,    0,    0,   33,    0,   72,   73,   34,  199,    0,\n    0,    0,    0,    0,    0,  199,    0,    0,    0,   36,\n  199,   37,   75,    0,  199,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,  199,   41,  199,    0,\n    0,    0,  199,    0,   87,    0,    0,   88,   89,    0,\n  199,  199,    0,    0,  199,    0,    0,  199,    0,    0,\n    0,    0,   90,   91,   92,   93,  308,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,    0,    0,    0,    0,    0,  104,  105,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   83,    0,    0,\n    0,  106,  309,  108,  109,   83,   83,    0,   83,    0,\n    0,   83,   83,    0,    0,    0,   83,   83,   83,  199,\n   83,    0,    0,    0,    0,    0,   83,    0,    0,   83,\n    0,    0,    0,    0,    0,    0,   83,    0,    0,    0,\n    0,   83,    0,   83,   83,   83,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   83,    0,   83,\n   83,    0,    0,   83,    0,    0,   83,    0,   83,    0,\n   83,   83,   83,   83,    0,   83,    0,    0,    0,    0,\n    0,    0,   83,    0,    0,   83,   83,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   83,   83,   83,   83,   83,    0,    0,    0,    0,    0,\n    0,    0,    0,   83,    0,    0,    0,    0,    0,   83,\n   83,   83,   83,    0,    0,    0,   83,    0,   83,    0,\n    0,    0,    0,    0,   83,   83,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  347,    0,   83,\n   83,   83,   83,  348,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,    0,    0,    0,   65,    0,    0,   30,\n    0,    0,    0,    0,    0,    0,   32,    0,    0,  349,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,  261,  351,    0,    0,    0,    0,    0,\n    0,    0,    0,   96,    0,  352,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,  347,\n    0,    0,    0,    0,  104,  105,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,    0,    0,    0,    0,   65,  106,\n  263,   30,  109,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,  261,  351,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,  352,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,  356,    0,    0,    0,    0,  104,  105,    0,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,    0,   28,    0,    0,    0,    0,    0,\n   65,  106,  263,   30,  109,    0,    0,    0,    0,    0,\n   32,    0,    0,    0,    0,   33,    0,   72,   73,   34,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   36,    0,   37,   75,    0,    0,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,    0,   41,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   90,   91,   92,  261,  351,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,  358,    0,    0,    0,    0,  104,  105,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,  106,  263,   30,  109,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  351,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,  360,    0,    0,    0,    0,\n  104,  105,    0,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,    0,   28,    0,\n    0,    0,    0,    0,   65,  106,  263,   30,  109,    0,\n    0,    0,    0,    0,   32,    0,    0,    0,    0,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,    0,   41,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,  261,  351,    0,    0,    0,    0,    0,    0,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,  362,    0,    0,\n    0,    0,  104,  105,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,    0,    0,    0,   65,  106,  263,   30,\n  109,    0,    0,    0,    0,    0,   32,    0,    0,    0,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,  261,  351,    0,    0,    0,    0,    0,\n    0,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,  364,\n    0,    0,    0,    0,  104,  105,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,    0,    0,    0,    0,   65,  106,\n  263,   30,  109,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,  261,  351,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,  366,    0,    0,    0,    0,  104,  105,    0,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,    0,   28,    0,    0,    0,    0,    0,\n   65,  106,  263,   30,  109,    0,    0,    0,    0,    0,\n   32,    0,    0,    0,    0,   33,    0,   72,   73,   34,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   36,    0,   37,   75,    0,    0,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,    0,   41,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   90,   91,   92,  261,  351,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,  368,    0,    0,    0,    0,  104,  105,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,  106,  263,   30,  109,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  351,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,  370,    0,    0,    0,    0,\n  104,  105,    0,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,    0,   28,    0,\n    0,    0,    0,    0,   65,  106,  263,   30,  109,    0,\n    0,    0,    0,    0,   32,    0,    0,    0,    0,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,    0,   41,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,  261,  351,    0,    0,    0,    0,    0,    0,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,  658,    0,    0,\n    0,    0,  104,  105,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,    0,    0,    0,   65,  106,  263,   30,\n  109,    0,    0,    0,    0,    0,   32,    0,    0,    0,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,  261,  351,    0,    0,    0,    0,    0,\n    0,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,  660,\n    0,    0,    0,    0,  104,  105,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,    0,    0,    0,    0,   65,  106,\n  263,   30,  109,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,  261,  351,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,  662,    0,    0,    0,    0,  104,  105,    0,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,    0,   28,    0,    0,    0,    0,    0,\n   65,  106,  263,   30,  109,    0,    0,    0,    0,    0,\n   32,    0,    0,    0,    0,   33,    0,   72,   73,   34,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   36,    0,   37,   75,    0,    0,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,    0,   41,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   90,   91,   92,  261,  351,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,  675,    0,    0,    0,    0,  104,  105,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,  106,  263,   30,  109,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  351,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,  677,    0,    0,    0,    0,\n  104,  105,    0,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,    0,   28,    0,\n    0,    0,    0,    0,   65,  106,  263,   30,  109,    0,\n    0,    0,    0,    0,   32,    0,    0,    0,    0,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,    0,   41,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,  261,  351,    0,    0,    0,    0,    0,    0,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,  679,    0,    0,\n    0,    0,  104,  105,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,    0,    0,    0,   65,  106,  263,   30,\n  109,    0,    0,    0,    0,    0,   32,    0,    0,    0,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,  261,  680,    0,    0,    0,    0,    0,\n    0,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,  682,\n    0,    0,    0,    0,  104,  105,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,    0,    0,    0,    0,   65,  106,\n  263,   30,  109,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,  261,  680,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,  684,    0,    0,    0,    0,  104,  105,    0,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,    0,   28,    0,    0,    0,    0,    0,\n   65,  106,  263,   30,  109,    0,    0,    0,    0,    0,\n   32,    0,    0,    0,    0,   33,    0,   72,   73,   34,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   36,    0,   37,   75,    0,    0,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,    0,   41,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   90,   91,   92,  261,  680,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,  686,    0,    0,    0,    0,  104,  105,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,  106,  263,   30,  109,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  680,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,  688,    0,    0,    0,    0,\n  104,  105,    0,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,    0,   28,    0,\n    0,    0,    0,    0,   65,  106,  263,   30,  109,    0,\n    0,    0,    0,    0,   32,    0,    0,    0,    0,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,    0,   41,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,  261,  680,    0,    0,    0,    0,    0,    0,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,  690,    0,    0,\n    0,    0,  104,  105,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,    0,    0,    0,   65,  106,  263,   30,\n  109,    0,    0,    0,    0,    0,   32,    0,    0,    0,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,  261,  680,    0,    0,    0,    0,    0,\n    0,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,  692,\n    0,    0,    0,    0,  104,  105,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,    0,    0,    0,    0,   65,  106,\n  263,   30,  109,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,  261,  680,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,  694,    0,    0,    0,    0,  104,  105,    0,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,    0,   28,    0,    0,    0,    0,    0,\n   65,  106,  263,   30,  109,    0,    0,    0,    0,    0,\n   32,    0,    0,    0,    0,   33,    0,   72,   73,   34,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   36,    0,   37,   75,    0,    0,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,    0,   41,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   90,   91,   92,  261,  680,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,  696,    0,    0,    0,    0,  104,  105,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,  106,  263,   30,  109,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  680,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,  698,    0,    0,    0,    0,\n  104,  105,    0,   57,   24,    0,   25,    0,    0,   26,\n  259,    0,    0,    0,   27,   62,   63,    0,   28,    0,\n    0,    0,    0,    0,   65,  106,  263,   30,  109,    0,\n    0,    0,    0,    0,   32,    0,    0,    0,    0,   33,\n    0,   72,   73,   34,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   36,    0,   37,   75,    0,\n    0,   38,    0,    0,   77,    0,   79,    0,   81,   39,\n   40,  260,    0,   41,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   90,   91,\n   92,  261,  680,    0,    0,    0,    0,    0,    0,    0,\n    0,   96,    0,    0,    0,    0,    0,   98,   99,  100,\n  101,    0,    0,    0,  102,    0,  103,  700,    0,    0,\n    0,    0,  104,  105,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,    0,    0,    0,    0,   65,  106,  263,   30,\n  109,    0,    0,    0,    0,    0,   32,    0,    0,    0,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,  261,  680,    0,    0,    0,    0,    0,\n    0,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,  702,\n    0,    0,    0,    0,  104,  105,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,    0,    0,    0,    0,   65,  106,\n  263,   30,  109,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,  261,  680,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,  704,    0,    0,    0,    0,  104,  105,    0,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,    0,   28,    0,    0,    0,    0,    0,\n   65,  106,  263,   30,  109,    0,    0,    0,    0,    0,\n   32,    0,    0,    0,    0,   33,    0,   72,   73,   34,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   36,    0,   37,   75,    0,    0,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,    0,   41,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   90,   91,   92,  261,  680,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,  869,    0,    0,    0,    0,  104,  105,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,  106,  263,   30,  109,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  351,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,    0,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,    0,    0,    0,    0,    0,\n  104,  105,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  210,    0,    0,    0,    0,  210,    0,\n    0,    0,  210,    0,  210,  106,  263,  210,  109,  210,\n  210,    0,  210,    0,  210,    0,  210,    0,  210,  210,\n  210,  210,    0,    0,  210,  210,    0,    0,    0,    0,\n  210,    0,  210,  210,  210,    0,    0,  210,    0,  210,\n    0,  210,    0,    0,  210,    0,  210,  210,  210,  210,\n    0,    0,    0,  210,  210,  210,    0,    0,  210,  210,\n  210,    0,    0,    0,    0,    0,    0,  210,  210,    0,\n  210,  210,  666,  210,  210,  210,    0,    0,    0,  210,\n   57,   24,    0,   25,    0,    0,   26,  259,    0,    0,\n    0,   27,   62,   63,    0,   28,    0,    0,    0,  210,\n    0,   65,    0,    0,   30,  210,  210,  210,    0,    0,\n    0,   32,    0,    0,    0,  210,   33,    0,   72,   73,\n   34,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   36,    0,   37,   75,    0,    0,   38,    0,\n    0,   77,    0,   79,    0,   81,   39,   40,  260,    0,\n   41,    0,    0,   85,    0,    0,  210,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,   90,   91,   92,  261,  262,\n    0,    0,    0,  525,    0,    0,    0,    0,   96,    0,\n  364,   57,   24,    0,   25,  667,  668,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,    0,    0,\n    0,    0,   65,    0,    0,   30,    0,    0,    0,   51,\n    0,   51,   32,    0,    0,    0,  364,   33,    0,   72,\n   73,   34,    0,    0,  106,  263,    0,    0,    0,    0,\n    0,    0,   51,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,   51,   81,   39,   40,  260,\n   51,   41,    0,    0,    0,   51,    0,   51,   51,   51,\n   51,    0,    0,   51,    0,   51,    0,    0,    0,   51,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,  261,\n  526,   51,  364,    0,   51,    0,   51,    0,    0,   96,\n  364,  364,  364,  364,  836,    0,    0,  364,  364,    0,\n    0,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n   51,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,  364,  364,  364,  364,  364,  364,  364,\n  364,  364,  364,    0,    0,  106,  527,    0,    0,  364,\n    0,   52,  364,   52,    0,   52,    0,   52,    0,    0,\n   52,    0,   52,   52,    0,   52,    0,   52,    0,   52,\n    0,   52,   52,   52,   52,    0,    0,   52,   52,    0,\n    0,    0,    0,   52,   52,   52,   52,   52,    0,    0,\n   52,    0,   52,    0,   52,    0,   52,   52,    0,   52,\n   52,   52,   52,    0,    0,   52,   52,   52,   52,    0,\n    0,   52,   52,   52,    0,    0,    0,    0,    0,    0,\n   52,   52,    0,   52,   52,    0,   52,   52,   52,    0,\n    0,    0,   52,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   52,    0,    0,   52,   52,   51,    0,    0,\n    0,   51,    0,   51,    0,    0,   51,    0,   51,   51,\n    0,   51,    0,   51,    0,   51,    0,   51,   51,   51,\n   51,    0,    0,   51,   51,    0,    0,    0,    0,   51,\n    0,   51,   51,   51,    0,    0,   51,    0,   51,    0,\n   51,    0,    0,   51,    0,   51,   51,   51,   51,   52,\n    0,    0,   51,   51,   51,    0,    0,   51,   51,   51,\n    0,    0,    0,    0,    0,    0,   51,   51,    0,   51,\n   51,    0,   51,   51,   51,    0,    0,    0,   51,    0,\n    0,   51,    0,    0,    0,   51,    0,   51,    0,    0,\n   51,    0,   51,   51,    0,   51,    0,   51,   51,   51,\n    0,   51,   51,   51,   51,   86,    0,   51,   51,    0,\n    0,    0,    0,   51,   51,   51,   51,   51,    0,    0,\n   51,    0,   51,    0,   51,    0,    0,   51,    0,   51,\n   51,   51,   51,    0,    0,    0,   51,   51,   51,    0,\n    0,   51,   51,   51,    0,    0,    0,    0,    0,    0,\n   51,   51,    0,   51,   51,   51,   51,   51,   51,    0,\n    0,    0,   51,    0,    0,   52,    0,    0,    0,   52,\n    0,   52,    0,    0,   52,    0,   52,   52,    0,   52,\n    0,   52,   51,   52,    0,   52,   52,   52,   52,   87,\n    0,   52,   52,    0,    0,    0,    0,   52,   51,   52,\n   52,   52,    0,    0,   52,    0,   52,    0,   52,    0,\n    0,   52,    0,   52,   52,   52,   52,    0,    0,    0,\n   52,   52,   52,    0,    0,   52,   52,   52,    0,    0,\n    0,    0,    0,    0,   52,   52,    0,   52,   52,   51,\n   52,   52,   52,    0,    0,    0,   52,    0,    0,   51,\n    0,    0,    0,   51,    0,   51,    0,    0,   51,    0,\n   51,   51,    0,   51,    0,   51,   52,   51,    0,   51,\n   51,   51,   51,    0,    0,   51,   51,    0,    0,    0,\n    0,   51,   52,   51,   51,   51,    0,    0,   51,    0,\n   51,    0,   51,    0,    0,   51,    0,   51,   51,   51,\n   51,    0,    0,    0,   51,   51,   51,    0,    0,   51,\n   51,   51,    0,    0,    0,    0,    0,    0,   51,   51,\n    0,   51,   51,   52,   51,   51,   51,    0,    0,    0,\n   51,    0,    0,   51,    0,    0,    0,   51,    0,   51,\n    0,    0,   51,    0,   51,   51,    0,   51,    0,   51,\n   51,   51,    0,   51,   51,   51,   51,  238,    0,   51,\n   51,    0,    0,    0,    0,   51,    0,   51,   51,   51,\n    0,    0,   51,    0,   51,  364,   51,    0,    0,   51,\n    0,   51,   51,   51,   51,    0,    0,    0,   51,   51,\n   51,    0,    0,   51,   51,   51,    0,    0,  364,    0,\n    0,    0,   51,   51,    0,   51,   51,   51,   51,   51,\n   51,  364,    0,    0,   51,    0,  364,    0,    0,  364,\n    0,  364,    0,  364,  364,  364,  364,    0,    0,    0,\n    0,  364,    0,    0,   51,  364,    0,    0,    0,  364,\n    0,  239,    0,    0,    0,    0,    0,  364,    0,    0,\n  364,    0,  364,    0,   57,   24,    0,   25,    0,    0,\n   26,  259,    0,    0,    0,   27,   62,   63,    0,   28,\n    0,  364,    0,    0,    0,   65,  364,    0,   30,    0,\n    0,    0,    0,  364,  364,   32,  287,    0,  364,    0,\n   33,   51,   72,   73,   34,    0,  636,    0,    0,    0,\n    0,  364,    0,  637,    0,    0,   36,    0,   37,   75,\n    0,    0,   38,    0,    0,   77,    0,   79,    0,   81,\n   39,   40,  260,    0,   41,    0,    0,    0,    0,    0,\n    0,  638,    0,  364,   88,   89,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   90,\n   91,   92,   93,   94,    0,    0,    0,    0,    0,    0,\n    0,    0,   96, 1011,    0,  639,    0,    0,   98,   99,\n  100,  101,    0,    0,    0,  102,    0,  103,    0,    0,\n    0,    0,    0,  104,  105,    0,    0,    0,    0,    0,\n    0,   57,   24,    0,   25,    0,    0,   26,  259,    0,\n    0,    0,   27,   62,   63,    0,   28,    0,  106,  107,\n  108,  109,   65,    0,    0,   30,    0,    0,    0,    0,\n    0,    0,   32,    0,    0,    0,    0,   33,    0,   72,\n   73,   34,    0,  636,    0,    0,    0,    0,    0,    0,\n  637,    0,    0,   36,    0,   37,   75,    0,    0,   38,\n    0,    0,   77,    0,   79,    0,   81,   39,   40,  260,\n    0,   41,    0,    0,    0,    0,    0,    0,  638,    0,\n    0,   88,   89,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,   90,   91,   92,   93,\n   94,    0,    0,    0,    0,    0,    0,    0,    0,   96,\n    0,    0,  639,    0,    0,   98,   99,  100,  101,    0,\n    0,    0,  102,    0,  103,    0,    0,    0,    0,    0,\n  104,  105,    0,    0,    0,    0,    0,    0,   57,   24,\n    0,   25,    0,    0,   26,  259,    0,    0,    0,   27,\n   62,   63,    0,   28,    0,  106,  107,  108,  109,   65,\n    0,    0,   30,    0,    0,    0,    0,    0,    0,   32,\n    0,    0,    0,    0,   33,    0,   72,   73,   34,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   36,    0,   37,   75,    0,    0,   38,    0,    0,   77,\n    0,   79,    0,   81,   39,   40,  260,    0,   41,    0,\n    0,   85,    0,    0,    0,   87,    0,    0,   88,   89,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,   90,   91,   92,   93,  308,    0,    0,\n    0,    0,    0,    0,    0,    0,   96,    0,    0,    0,\n    0,    0,   98,   99,  100,  101,    0,    0,    0,  102,\n    0,  103,    0,    0,    0,    0,    0,  104,  105,    0,\n    0,    0,    0,    0,    0,   57,   24,    0,   25,    0,\n    0,   26,  259,    0,    0,    0,   27,   62,   63,    0,\n   28,    0,  106,  309,  108,  109,   65,    0,    0,   30,\n    0,    0,    0,    0,    0,    0,   32,    0,    0,    0,\n    0,   33,    0,   72,   73,   34,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   36,    0,   37,\n   75,    0,    0,   38,    0,    0,   77,    0,   79,    0,\n   81,   39,   40,  260,    0,   41,    0,    0,    0,    0,\n    0,    0,   87,    0,    0,   88,   89,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n   90,   91,   92,   93,  308,    0,    0,    0,    0,  546,\n    0,    0,    0,   96,    0,    0,    0,    0,    0,   98,\n   99,  100,  101,    0,    0,    0,  102,    0,  103,    0,\n    0,    0,    0,    0,  104,  105,    0,    0,    0,    0,\n    0,    0,   57,   24,    0,   25,    0,    0,   26,  259,\n    0,    0,    0,   27,   62,   63,    0,   28,    0,  106,\n  309,  108,  109,   65,    0,    0,   30,    0,    0,    0,\n    0,    0,    0,   32,    0,    0,    0,    0,   33,    0,\n   72,   73,   34,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   36,    0,   37,   75,    0,    0,\n   38,    0,    0,   77,    0,   79,    0,   81,   39,   40,\n  260,    0,   41,    0,    0,    0,    0,    0,    0,   87,\n    0,    0,   88,   89,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   90,   91,   92,\n   93,  308,    0,    0,    0,    0,  540,    0,    0,    0,\n   96,    0,    0,    0,    0,    0,   98,   99,  100,  101,\n    0,    0,    0,  102,    0,  103,    0,    0,    0,    0,\n    0,  104,  105,    0,    0,    0,    0,    0,    0,   57,\n   24,    0,   25,    0,    0,   26,  259,    0,    0,    0,\n   27,   62,   63,    0,   28,    0,  106,  309,  108,  109,\n   65,    0,    0,   30,    0,    0,    0,    0,    0,    0,\n   32,    0,    0,    0,    0,   33,    0,   72,   73,   34,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   36,    0,   37,   75,    0,    0,   38,    0,    0,\n   77,    0,   79,    0,   81,   39,   40,  260,    0,   41,\n    0,    0,    0,    0,    0,    0,   87,    0,    0,   88,\n   89,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   90,   91,   92,   93,  308,    0,\n    0,    0,    0,    0,    0,    0,    0,   96,    0,    0,\n    0,    0,    0,   98,   99,  100,  101,    0,    0,    0,\n  102,    0,  103,    0,    0,    0,    0,    0,  104,  105,\n    0,    0,    0,    0,    0,    0,   57,   24,    0,   25,\n    0,    0,   26,  259,    0,    0,    0,   27,   62,   63,\n    0,   28,    0,  106,  309,  108,  109,   65,    0,    0,\n   30,    0,    0,    0,    0,    0,    0,   32,    0,    0,\n    0,    0,   33,    0,   72,   73,   34,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,   36,    0,\n   37,   75,    0,    0,   38,    0,    0,   77,    0,   79,\n    0,   81,   39,   40,  260,    0,   41,    0,    0,    0,\n    0,    0,    0,   87,    0,    0,   88,   89,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,   90,   91,   92,   93,   94,    0,    0,    0,    0,\n    0,    0,    0,    0,   96,    0,    0,    0,    0,    0,\n   98,   99,  100,  101,    0,    0,    0,  102,    0,  103,\n    0,    0,    0,    0,    0,  104,  105,    0,    0,    0,\n    0,    0,    0,  687,  687,    0,  687,    0,    0,  687,\n  687,    0,    0,    0,  687,  687,  687,    0,  687,    0,\n  106,  107,  108,  109,  687,    0,    0,  687,    0,    0,\n    0,    0,    0,    0,  687,    0,    0,    0,    0,  687,\n    0,  687,  687,  687,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  687,    0,  687,  687,    0,\n    0,  687,    0,    0,  687,    0,  687,    0,  687,  687,\n  687,  687,    0,  687,    0,    0,    0,    0,    0,    0,\n  687,    0,    0,  687,  687,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,  687,  687,\n  687,  687,  687,    0,    0,    0,    0,    0,    0,    0,\n    0,  687,    0,    0,    0,    0,    0,  687,  687,  687,\n  687,    0,    0,    0,  687,    0,  687,    0,    0,    0,\n    0,    0,  687,  687,    0,    0,    0,    0,    0,    0,\n  146,  146,    0,  146,    0,    0,  146,  146,    0,    0,\n    0,  146,  146,  146,    0,  146,    0,  687,  687,  687,\n  687,  146,    0,    0,  146,    0,    0,    0,    0,    0,\n    0,  146,    0,    0,    0,    0,  146,    0,  146,  146,\n  146,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,  146,    0,  146,  146,    0,    0,  146,    0,\n    0,  146,    0,  146,    0,  146,  146,  146,  146,    0,\n  146,    0,    0,    0,    0,    0,    0,  146,    0,    0,\n  146,  146,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  146,  146,  146,  146,  146,\n    0,    0,    0,    0,    0,    0,    0,    0,  146,    0,\n    0,    0,    0,    0,  146,  146,  146,  146,    0,    0,\n    0,  146,    0,  146,    0,    0,    0,    0,    0,  146,\n  146,    0,    0,    0,    0,    0,    0,   57,   24,    0,\n   25,    0,    0,   26,  259,    0,    0,    0,   27,   62,\n   63,    0,   28,    0,  146,  146,  146,  146,   65,    0,\n    0,   30,    0,    0,    0,    0,    0,    0,   32,    0,\n    0,    0,    0,   33,    0,   72,   73,   34,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   36,\n    0,   37,   75,    0,    0,   38,    0,    0,   77,    0,\n   79,    0,   81,   39,   40,  260,    0,   41,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,   90,   91,   92,  261,  680,    0,    0,    0,\n    0,    0,    0,    0,    0,   96,    0,    0,    0,    0,\n    0,   98,   99,  100,  101,    0,    0,    0,  102,    0,\n  103,    0,   57,   24,    0,   25,  104,  105,   26,  259,\n    0,    0,    0,   27,   62,   63,    0,   28,    0,    0,\n    0,    0,    0,   65,    0,    0,   30,    0,    0,    0,\n    0,  106,  263,   32,  109,    0,    0,    0,   33,    0,\n   72,   73,   34,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,   36,    0,   37,   75,    0,    0,\n   38,    0,    0,   77,    0,   79,    0,   81,   39,   40,\n  260,    0,   41,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,   90,   91,   92,\n  261,  351,    0,    0,    0,    0,    0,    0,    0,    0,\n   96,    0,    0,    0,    0,    0,   98,   99,  100,  101,\n    0,    0,    0,  102,    0,  103,    0,    0,    0,    0,\n    0,  104,  105,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,  733,    0,  733,    0,  733,  106,  263,  733,  109,\n  733,  733,    0,  733,    0,  733,    0,  733,    0,  733,\n  733,  733,    0,    0,    0,  733,  733,    0,    0,    0,\n    0,  733,    0,  733,  733,    0,    0,    0,  733,    0,\n    0,    0,  733,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,  733,  733,    0,  733,    0,    0,    0,\n  733,  733,    0,    0,    0,    0,    0,    0,  733,  733,\n   57,   24,  733,   25,    0,  733,   26,  259,    0,    0,\n  733,   27,   62,   63,    0,   28,    0,    0,    0,    0,\n    0,   65,    0,    0,   30,    0,    0,    0,    0,    0,\n    0,   32,    0,  733,  733,    0,   33,    0,   72,   73,\n   34,    0,    0,    0,    0,    0,  733,    0,    0,    0,\n    0,    0,   36,    0,   37,   75,    0,    0,   38,    0,\n    0,   77,    0,   79,    0,   81,   39,   40,  260,    0,\n   41,    0,    0,   85,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,  733,    0,    0,\n    0,    0,    0,    0,    0,   90,   91,   92,  261,  262,\n    0,    0,    0,    0,    0,  732,    0,  732,   96,    0,\n  732,    0,  732,  732,    0,  732,    0,  732,    0,  732,\n    0,  732,  732,  732,    0,    0,    0,  732,  732,    0,\n    0,    0,    0,  732,    0,  732,  732,    0,    0,    0,\n  732,    0,    0,    0,  732,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,  106,  263,  732,    0,  732,    0,\n    0,    0,  732,  732,    0,    0,    0,    0,    0,    0,\n  732,  732,    0,   24,  732,   25,    0,  732,   26,    0,\n    0, 1399,  732,   27,    0,  757,    0,   28,    0,  758,\n 1400, 1401,    0,    0,    0, 1402,   30,    0,    0,    0,\n    0, 1403,    0,   32,    0,   51,    0,   51,   33,    0,\n   51,    0,   34,    0,    0,   51,    0,    0,  732,   51,\n    0,    0,    0,    0,   36,    0,   37,    0,   51,    0,\n   38,    0,    0,    0,    0,   51,    0,    0,   39,   40,\n   51,    0,   41,    0,   51, 1404,   51,    0,   51,    0,\n 1405,    0,    0,   51,    0,    0,   51,    0,   51,  732,\n    0,    0,   51,    0,    0,   51,    0,    0,    0,    0,\n   51,   51,    0,   51,   51,   51,    0,   51,   51,    0,\n    0,    0,    0,   51,    0,    0, 1406,   51,    0,    0,\n    0,    0,    0,    0,    0,    0,   51,    0,    0,    0,\n    0,    0,    0,   51,    0,   24,    0,   25,   51,    0,\n   26,    0,   51,  169,   51,   27,   51,    0,    0,   28,\n    0,   51,    0,    0,   51,    0,   51, 1407,   30,    0,\n   51,    0,    0,   51,    0,   32,    0,    0,   51,   51,\n   33,    0,   51,    0,   34,   51,  605,    0,    0,    0,\n    0,    0,    0,  606,    0,    0,   36,    0,   37,   51,\n    0,    0,   38,    0,    0,  607,    0,    0,    0,    0,\n   39,   40,    0,    0,   41,    0,    0,  608,   52,  169,\n   52,    0,    0,   52,    0,    0,    0,    0,   52,    0,\n    0,    0,   52,    0,    0,    0,    0,    0,    0,    0,\n    0,   52,    0,  609,    0,    0,    0,    0,   52,    0,\n   51,    0,   51,   52,    0,   51,    0,   52,    0,   52,\n   51,   52,    0,    0,   51,    0,   52,   51,    0,   52,\n    0,   52,    0,   51,    0,   52,    0,    0,   52,    0,\n   51,    0,    0,   52,   52,   51,    0,   52,    0,   51,\n   52,   51,    0,   51,    0,   24,    0,   25,   51,  610,\n   26,   51,    0,   51,    0,   27,    0,   51,    0,   28,\n   51,    0,    0,   29,    0,   51,   51,    0,   30,   51,\n    0,    0,   51,   31,    0,   32,    0,   24,    0,   25,\n   33,    0,   26,    0,   34,   35,    0,   27,    0,    0,\n    0,   28,    0,    0,    0,    0,   36,    0,   37,    0,\n   30,    0,   38,    0,    0,    0,    0,   32,    0,    0,\n   39,   40,   33,    0,   41,    0,   34,   42,    0,    0,\n    0,   37,   52,    0,    0,    0,    0,    0,   36,    0,\n   37,    0,   37,    0,   38,    0,    0,   37,    0,    0,\n    0,   37,   39,   40,   37,    0,   41,    0,    0,   85,\n    0,    0,    0,    0,   51,    0,   37,   37,    0,    0,\n    0,   37,   37,    0,    0,    0,    0,   37,    0,   37,\n   37,   37,   37,    0,    0,  297,    0,   37,    0,    0,\n    0,   37,    0,   37,    0,    0,    0,    0,    0,    0,\n    0,    0,   35,   37,    0,   37,   37,    0,   37,   43,\n    0,    0,   37,   35,    0,    0,    0,    0,   35,    0,\n    0,    0,   35,    0,    0,   35,    0,    0,    0,    0,\n    0,    0,   37,    0,    0,    0,    0,   35,   35,   37,\n   37,  330,   35,   35,   31,    0,    0,    0,   35,    0,\n   35,   35,   35,   35,    0,    0,    0,    0,   35,    0,\n    0,    0,   35,    0,   35,    0,    0,   31,    0,    0,\n    0,    0,    0,    0,   35,    0,    0,   35,    0,   35,\n   31,    0,   31,   35,   31,   31,    0,    0,    0,    0,\n   31,    0,   31,   31,   31,   31,    0,    0,   31,    0,\n   31,    0,    0,   35,   31,   31,    0,    0,    0,    0,\n   35,   35,    0,    0,    0,    0,   31,    0,   31,   31,\n    0,   31,    0,   31,    0,    0,    0,    0,   31,    0,\n   31,   31,   31,   31,    0,    0,    0,    0,   31,    0,\n    0,    0,   31,    0,    0,   31,    0,    0,    0,    0,\n    0,    0,   31,   31,   31,    0,    0,   31,   51,   31,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,   51,\n    0,    0,    0,    0,   51,    0,    0,    0,   51,    0,\n    0,   51,    0,   31,    0,    0,    0,    0,    0,    0,\n   31,   31,    0,   51,   51,    0,    0,    0,   51,   51,\n    0,   51,    0,    0,   51,    0,   51,   51,   51,   51,\n    0,    0,   51,    0,   51,    0,    0,   51,   51,    0,\n   51,   51,    0,    0,   51,    0,    0,    0,    0,    0,\n   51,    0,    0,   51,    0,   51,   51,   51,    0,   51,\n    0,   51,   51,    0,   51,    0,    0,   51,    0,   51,\n   51,   51,   51,    0,    0,    0,    0,   51,    0,   51,\n    0,   51,    0,   51,    0,    0,   39,   51,    0,    0,\n    0,    0,    0,   51,    0,    0,   51,    0,   51,    0,\n   51,    0,   51,    0,   51,   51,    0,    0,    0,    0,\n   51,    0,   51,   51,   51,   51,    0,    0,    0,    0,\n   51,    0,   51,    0,   51,    0,    0,   51,    0,   40,\n    0,    0,    0,    0,    0,    0,   51,    0,    0,   51,\n   51,   51,    0,    0,   51,   51,    0,    0,    0,    0,\n   51,    0,   51,   51,   51,   51,    0,    0,    0,    0,\n   51,    0,    0,    0,   51,   51,    0,   51,   51,   51,\n    0,    0,  220,    0,    0,    0,   51,    0,    0,   51,\n   51,   51,    0,    0,   51,   51,   51,    0,    0,    0,\n   51,    0,   51,   51,   51,   51,    0,    0,   51,    0,\n   51,    0,    0,    0,   51,   51,    0,   51,   51,   51,\n    0,    0,  222,    0,   51,    0,   51,    0,    0,   51,\n   51,   51,    0,    0,    0,   51,    0,    0,    0,    0,\n   51,    0,   51,   51,   51,   51,    0,   51,    0,    0,\n   51,    0,    0,    0,   51,   51,    0,    0,    0,    0,\n   51,    0,  322,    0,  477,   51,   51,    0,    0,   51,\n   51,   51,   51,   51,   51,   51,    0,    0,    0,    0,\n   51,    0,    0,    0,   51,    0,    0,  478,    0,    0,\n    0,    0,    0,    0,  477,   51,   51,    0,    0,   51,\n  479,   51,  323,    0,  480,  481,    0,    0,    0,    0,\n  482,    0,  483,  484,  485,  486,    0,  478,    0,    0,\n  487,    0,    0,    0,  488,   51,    0,    0,   51,   51,\n  479,    0,    0,    0,    0,  481,  489,    0,    0,  490,\n  482,  491,  483,  484,  485,  486,    0,    0,    0,    0,\n  487,    0,    0,    0,  488,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  492,  489,    0,    0,  490,\n    0,  491,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n    0,    0,    0,    0,    0,  492,\n  };\n  protected static readonly short [] yyCheck = {            17,\n  306,   18,    4,  305,  320,   17,   17,   52,    6,   17,\n   52,  385,  544,  295,  193,  192,  546,  239,  494,  354,\n  237,   69,  329,  304,  252,   20,  516,  341,  161,  304,\n  594,  601,  119, 1019,  302,  117,   60,  119,   60,  612,\n   88,   89,  379,  396, 1196,   93,   78,  975,   59,  824,\n  256,  395, 1236,  256,  256,    0,   74,  621,  268,  268,\n   78,  336,  256,  379,   17,  113,  268,  292,  256,   80,\n  256,   82,  256, 1470,  256,  256,  335, 1230,   96,   45,\n  385, 1340,   48,    0,   88,   89,  256,  294,  282,   62,\n  464, 1275, 1024,   66,   67,   68,  369,   70,   71,  306,\n 1359,   17,   75,   76,  256,  109, 1290,   17,   81,   82,\n  256,   84,  256,   86,  256,  369, 1076, 1305,   91,   92,\n  314,  269,  357,   21,  325,  499,  369,   17,  176,  792,\n  256,  794,  256,  374,  377,  256,  377,  256,  286,  375,\n  256, 1294, 1102,  161,   17,  118,  256,  372,  193,  161,\n  161,  193,  387,  161,   20,   53, 1314,  430,  731,  464,\n  369,  436,  256,  256,   17,  419,  372,  395,  256,  339,\n  373,  430,  375,   17,  344,  838,  346,  268,  841,  349,\n  350,  417,  352,  353,  368,  276,  368,  256,  372,   17,\n  372,   17,  237,  256, 1382,  237,  421,   17,  256,  203,\n  204,  382, 1599,  251,  252,  375,  392,   60,  161,   17,\n   17,   64,  419,  423,  423,  421,  590,  265,  419,   17,\n 1152,  423,   88,   89,  368,  419,  540,  430,  256,  415,\n  372,  419, 1160,  377,  252,  233,  422,  421,  460,  421,\n  258,  543,  459,  109,  331,  161,  328,  363,  585,  331,\n  343,  161,  626,  363,  302, 1413,  338,  631,  632,  594,\n  430,  227,   60, 1421,  268,  795,   64,  419,  292,  585,\n  292,  161,  363,  419,  368, 1534,  370,  295,  372,  421,\n  302,  851,  300,  301,  628,  333,  621,  260,  161,  358,\n  294,  264,  340,  419,  382,  419,  612,  315,  419,  392,\n  419,  325, 1561,  419,  352,  323,    0,  325,  161,  419,\n  314,  329,  257,  324, 1573,  256, 1575,  161,  376,  382,\n 1478,  256,  415,  256,  342,  343,  631,  421,  419,  422,\n  424,  304,  256,  161, 1191,  161,  429,  203,  204,  387,\n  257,  161,  354,  391,  348,  349,  354,  395,  396,  377,\n 1125,  383,  726,  161,  161,  272,  425,  426,  427,  428,\n  277,  256,  256,  161,  281,  383,  375,  256,  256,  256,\n  374,  256,  256,  277, 1231,  369, 1528,  395,  396,  296,\n  953,  399,  400,  401,  402,  403,  404,  405,  406,  407,\n  408,  409,  414,  441,  442,  732,  256,  445,  256,  674,\n  628,  256,  268,  392,  256,  256,  323,  256,  417,  413,\n 1594,  256,  363,  431,  459,  731, 1402,  459, 1081,  256,\n  256,  726,  363,  256,  469,  342,  415,  469,  294,  256,\n  371,  256,  373,  368,  375,  370,  430,  441,  442,  292,\n  306,  757, 1626,  256,  377,  257,  256,  256,  314,  266,\n  256,  339,  376,  306,  320,  266,  344,  987,  346,  363,\n  256,  349,  350,  256,  352,  353,  461,  515,  419,  517,\n  262,  264,  325,  780,  256,  965,  370,  325,  419,  474,\n  305,  376,  348,  349,  373,  369,  371,  375,  363,  376,\n  375,  375,  516,  292,  292,  340,  544,  314,  509,  465,\n  466,  354,  876,  314,  341,  471,  298,  257,  374,  372,\n  370,  256,  256,  379,  372,  419,  420,  739,  358,  370,\n  375,  370,  570,  375,  542,   17,  544,  325,  546,  797,\n  867,  277,  325,  370,  887,  281, 1106,  765,  511,  375,\n  373,  351,  430, 1206,  419, 1075,  373,  413,  559,  294,\n  772,  867, 1215,  305,  429,  368,  354,  575,  421,  376,\n  578,  414,  256,  611,  373,  376,  369,  373,   60,  368,\n  369,  419,   64,  377,  343,  441,  442,  373,  589,  627,\n  628, 1244,  594,  369,  671,  558,  594,  379,  380,  671,\n  601,  373,  335,  369,  373,  461,  342,  710,  369,  343,\n  363,  369,  715,  716,  375, 1175, 1463,  375,  474,  621,\n  628, 1320, 1321,  621,  382,  952,  414,  374,  636,  637,\n  377,  363,  373,  392,  368,  673,  430,  430,  372,  369,\n  374,  375,  256,  377, 1343, 1492, 1493,  953,  382, 1496,\n  419, 1304,  373,  369,  430,  339,  415, 1211,  950,  343,\n  373,  377, 1509,  422,  430, 1512,  419, 1563, 1564,  430,\n  429, 1370,  430,  516,  712,  893,  714,  981,  372,  161,\n 1527,  263,  416,  256,  368,  723,  809,  419,  372,  430,\n  374,  375,  376,  377, 1393,  373,  263,  429,  382,  374,\n  430,  370,  710,  256, 1551,  374,  294,  715,  716,  430,\n  718,  369,  339,  272,  430,  986,  272,  430,  277,  984,\n  369,  341,  281, 1019, 1620,  339,  375,  765,  516,  585,\n  344,  419,  346,  315,  339,  349,  350,  296,  352,  353,\n  296,  368,  256, 1321,  782,  372,  399,  400,  315,  424,\n  370,  594,  430, 1321, 1321,  424,  612,  765, 1193,  797,\n  272,  419,  305,  368,  323, 1245,  339,  323,  256,  357,\n  758,  344,  780,  346,  343,  363,  349,  350,  621,  352,\n  353, 1078,  370,  342,  296,  797,  374,  795,  272, 1321,\n  343,  305, 1370, 1321,  802, 1317,  804,  339, 1233,  387,\n 1092,  306, 1370, 1370, 1425, 1321,  594,  372,  313,  374,\n  292,  323,  296,  382, 1321,  368,  430,  256, 1439,  372,\n  325,  374,  375,  392,  377, 1043,  368, 1321,  866,  382,\n  831,  419,  833,  621,  376,  843,  830,  845, 1370,  323,\n 1461,  256, 1370,  325, 1169,  948,  415,  855,  849,  887,\n  851,  339,  846,  422, 1370,  893,  344,  430,  346,  339,\n  429,  349,  350, 1370,  352,  353,  829,  343, 1035,  863,\n  339,  369,  354,  364,  370,  731, 1370,  375,  368,  887,\n  339,  372,  985,  374,  382,  893, 1211,  377,  368,  392,\n  343,  369, 1164,  372,  902,  930,  904,  375,  930,  368,\n  339,  757,  393,  394, 1196,  344,  382,  346,  382,  368,\n  349,  350,  415,  352,  353,  368,  392,  371,  392,  422,\n  377,  375,  413, 1026,  339, 1028,  429, 1199, 1031,  344,\n  421,  346,  414,  424,  349,  350,  343,  352,  353,  415,\n  948,  415,  950,  256,  402,  357,  422,  343,  422,  792,\n  935,  794,  940,  429,  992,  256,  414,  368,  343,  967,\n  954,  368,  374,  343,  972,  339,  377,  975,  269,  343,\n 1242, 1189,  368, 1439,  830,  387,  377,  985,  392,  987,\n 1305,  377,  990,  368, 1022,  286,  415,  368,  368,  370,\n  846,  430,  377,  422,  368,  838, 1516,  377,  841,  343,\n  357,  415,  306,  377,  792, 1043,  794,  863,  422,  313,\n  294,  867, 1115, 1408, 1117,  430, 1119,  374, 1026,  368,\n 1028, 1059,  306, 1031,  368, 1420,  339, 1065,  383,  384,\n  387,  344,  256,  346,  516, 1043,  349,  350, 1383,  352,\n  353,  387,  397,  398,  306, 1390,  308,  372, 1260, 1256,\n  838,  313,  369,  841, 1048, 1040, 1328, 1382, 1578, 1228,\n  377,  370, 1050,  325, 1052,  385, 1054, 1075, 1408,  357,\n 1078,  374, 1436,  382,  377,  363,  375, 1383,  377,  935,\n 1420,  386,  370,  382, 1390,  373,  374,  375,  373, 1453,\n  375,  368,  369,  368,  369, 1615,  390,  953,  954,  387,\n  377,  372,  377,  374,  401, 1106, 1402, 1115, 1472, 1117,\n 1474, 1119,  594,  391, 1122,  339, 1219,  430, 1640, 1641,\n  344,  373,  346,  375,  370,  349,  350,  369,  352,  353,\n  369,  419,  419,  375,  373,  377,  375,  416,  377,  621,\n  369, 1133,  256,  373,  373,  375,  375,  377,  377,  369,\n 1253, 1189, 1160,  373,  371,  372, 1164,  377,  375,  395,\n  396,  371,  372, 1019,  374,  375,  376, 1169,  371, 1177,\n 1178, 1169,  375,  371, 1175,  373, 1019,  375,  371,  419,\n  373, 1189,  375, 1190, 1040,  371,  371,  277, 1196,  375,\n  375, 1199, 1048, 1228,  374, 1230, 1228,  371, 1230,  373,\n  373,  368,  377, 1306,  377,  372,  430,  374,  375, 1211,\n  377, 1219,  377, 1211,  371,  382,  256, 1225,  375,  369,\n  370, 1256,  371, 1326, 1256,  265,  375,  267,  371,  375,\n  270,  377,  375,  372, 1242,  275, 1528,  376, 1081,  279,\n  419,  420,  421,  422,  382, 1253, 1254,    6,  288,  416,\n  373,  368,  373,  371,  377,  295,  377,  375,   17, 1294,\n  300,  371, 1294,  373,  304,  403,  404,  405,  406,  407,\n  408,  409,  410,  411,  412,  256,  316,  373,  318, 1317,\n  374,  377,  322,  368,  369, 1320, 1321,  256, 1320, 1321,\n  330,  331,  294, 1081,  334,  354,  355,  337, 1306,  377,\n  371,   60,  373, 1305,  377,   64,   20, 1305, 1343, 1317,\n  792, 1343,  794,  387,  388,  389,  294,  371, 1326,  373,\n 1328,  373,  373,  375,  375, 1319, 1169,  354,  355,   88,\n   89,  375,  343,  377,  256, 1370, 1374,  371, 1370,  373,\n  371,  373,  373,  265,  377,  267,  356,  375,  270,  377,\n  109,  419,  375,  275,  377,  419,  838,  279, 1393,  841,\n 1652, 1393,  375, 1206,  377,  802,  288,  804, 1211,  369,\n  370,  419, 1215,  295,   88,   89, 1232,  370,  300,  419,\n 1382, 1169,  304,  373, 1382, 1386,  415, 1381,  376,  415,\n  416,  365,  366,  373,  316,  109,  318,  368,  369,  382,\n  322, 1244,  161,  365,  366, 1399, 1400,  377,  330,  331,\n  415,  416,  334,  417,  418,  337,  423,  424, 1206,  369,\n  364,  375,  430, 1211,  373,  369,  373, 1215,  372,  294,\n  374,  375,  294, 1427,  375,  373, 1430,  373,  382, 1447,\n  375, 1297,  373, 1444,  203,  204,  256,  377,  372,  393,\n  394,  256,  429,  429,  294,  294, 1244,  382,  373,  375,\n  374, 1304, 1305, 1319,  376,  375,  374,  419,  373,  413,\n  430, 1506,  375,  382, 1506,  375,  375,  421,  375,  424,\n  424,  373,  375,  368,  375,  373,  430,  343, 1523,  203,\n  204, 1523,  375,  294,  294,  375,  419,  419,    0,  371,\n  419, 1536, 1537,  372, 1536, 1537,  376,  368, 1516,  268,\n  256,  256,  375, 1514,  256,  256, 1304, 1305,  382,  280,\n 1528,  256,  368,  373,  369, 1381,  343, 1383, 1563, 1564,\n  371, 1563, 1564,  292, 1390,  294,  372, 1545,  375, 1382,\n    0,  375,  377, 1399, 1400,  377, 1402,  306,  373,  382,\n  371,  373, 1408,  373,  268,  314,  424,  373,  382, 1402,\n  347,  320,  368,  382, 1420,  256,  325,  382,  256, 1425,\n 1578, 1427,  369,  377, 1430,  373,  256,  373,  256,  347,\n  294,  375,  371, 1439,  376, 1620,  372,  371, 1620,  348,\n  349,  292,  306,  371, 1382,  354,  373,  348,  369, 1081,\n  314,  339, 1640, 1641,  373, 1461,  320, 1615,  419,  375,\n  372,  419,  348,  373,  256,  374,  369,  382,  368,  368,\n  379,  377, 1623, 1624,  368,  356,  369,  375,  337, 1630,\n 1631,  305, 1640, 1641,  348,  349,  373,  377,  372,  369,\n  369,  373,  369,  419, 1652,  370,  372,  419,  368,  419,\n  372,  372,  419,  377,  413,  414,  372,  374,  368,  339,\n  374,  372,  343,  382,  344,  379,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,  372,  377,  382,\n  370,  373,  441,  442,  373,  372,  256, 1169,  374,  369,\n  375,  371,  374,  373,  377,  375,  376,  377,  375,  413,\n  375,  419,  375,  373,  373,  371,  419,  419,  373,  377,\n  377,  391,  419,  377,  373,  373,  369,  371,  373,  382,\n  382,  369,  315,  263, 1206,  372,  372,  441,  442, 1211,\n   94,  382,  369, 1215,   98,   99,  100,  101,  102,  103,\n  104,  105,  373,  373,  377,    0,    0,  461,  368,  377,\n  430,  369,  377,    0,  373,  257,  369,  516,  373,  261,\n  474,  368, 1244,  373,  369,  371,  369,  419,  377,  373,\n  272,  371,  368,  374,  419,  277,  419,  369,  373,  281,\n  377,  369,  284,  373,  373,  369,  377,  368,  373,  369,\n  377,  373,  369,  315,  296,  297,  256,  263,  377,  301,\n  302,  261,  262,  377,  377,  307,  377,  309,  310,  311,\n  312,  377,  377,  377,  377,  317,  377,   51,   12,  321,\n    5,  323, 1304, 1305,  284, 1040,  585,  935, 1189,    0,\n 1189,  333, 1393,  335,  336,  594,  338,  297,  298, 1343,\n  342, 1398,  302, 1238, 1568,  305, 1531,  307, 1519,  309,\n  310,  311,  312,  612, 1444, 1584, 1548,  317, 1514,  957,\n  362,  321,  621,  952,  957,  325,  957,  369,  370,  771,\n 1425,  585, 1358,  333, 1631, 1370,  336, 1445,  338,  339,\n 1625, 1541, 1537,  343,  344, 1536,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,  357,  612, 1624,\n 1382, 1294,  362,  363, 1474,  930,  320, 1297,  368,  369,\n  370,  371,  372,  373,  374,  375,  376,  377,  414,  379,\n  380,  981,  637,  383,  384,  385,  386,  387,  893, 1092,\n  390,  391,   72,  261,  765,  395,  396,  397,  398,  399,\n  400,  401,  402,  797,  308,    0,  344,  992,  425,  427,\n  426,  430, 1195,  428,  414,  429,  284,  417,  585,  419,\n  867,  421, 1272, 1381,  424, 1169,  161, 1154, 1077,  297,\n  430, 1178,  731, 1102,  302, 1061, 1167,  341, 1245,  307,\n 1169,  309,  310,  311,  312,  560, 1214,  351,  450,  317,\n  996,  450, 1376,  321, 1254,  932,  925,  325,  757,   -1,\n   -1,   -1,   -1,   -1,   -1,  333,   -1,   -1,  336,   -1,\n  338,   -1,   -1,  721,   -1,   -1,   -1,  731,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  792,  362,  794,    0,   -1,   -1,   -1,\n   -1,  369,   -1,  757,   -1,   -1,  410,  411,  412,   -1,\n   -1,  415,  416,  417,  418,  419,  420,  421,  422,  423,\n  424,  425,  426,  427,  428,  429,  430,   -1,   -1,   -1,\n   -1,  830,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  838,\n   -1,   -1,  841,   -1,   -1,   -1,  257,  846,   -1,   -1,\n  261,  419,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  272,   -1,   -1,  863,   -1,  277,   -1,  867,   -1,\n  281,   -1,   -1,  284,   -1,   -1,  830,  256,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,   -1,\n  301,  302,  846,   -1,   -1,   -1,  307,   -1,  309,  310,\n  311,  312,   -1,   -1,   -1,   -1,  317,   -1,   -1,  863,\n  321,   -1,  323,  867,   -1,   -1,   -1,    0,   -1,   -1,\n   -1,   -1,  333,   -1,   -1,  336,   -1,  338,   -1,   -1,\n   -1,  342,   -1,   -1,   -1,   -1,  540,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  362,   -1,   -1,  953,  954,   -1,  368,  369,  370,\n  339,   -1,  257,   -1,   -1,  344,  261,  346,  347,  348,\n  349,  350,  351,  352,  353,  354,  355,  272,   -1,   -1,\n   -1,  935,  277,   -1,   -1,   -1,  281,   -1,   -1,  284,\n  369,   -1,  371,   -1,  373,   -1,  375,  376,  377,  953,\n  954,  296,  297,   -1,   -1,   -1,  301,  302,   -1,   -1,\n   -1,   -1,  307,  617,  309,  310,  311,  312,   -1,   -1,\n 1019,   -1,  317,   -1,   -1,   -1,  321,   -1,  323,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  333,   -1,\n  335,  336,   -1,  338,   -1,   -1,   -1,  342,   -1, 1048,\n   -1,  430,   -1,  257,   -1,   -1,   -1,  261,   -1,   -1,\n   -1,  364,   -1,  667,  668, 1019,  369,  362,  272,  372,\n   -1,  374,  375,  277,   -1,  370,  680,  281,   -1,   -1,\n  284,   -1, 1081,   -1,   -1,   -1, 1040,   -1,   -1,   -1,\n  393,  394,  296,  297, 1048,   -1,   -1,  301,  302,   -1,\n   -1,   -1,   -1,  307,   -1,  309,  310,  311,  312,   -1,\n  413,   -1,   -1,  317,   -1,   -1,   -1,  321,  421,  323,\n   -1,  424,   -1,   -1,   -1,   -1,   -1,  430,  256,  333,\n   -1,   -1,  336,   -1,  338,   -1,   -1,  265,  342,  267,\n   -1,   -1,  270,   -1,   -1,   -1,   -1,  275,   -1,   -1,\n   -1,  279,   -1,    0,   -1,   -1,   -1,   -1,  362,   -1,\n  288,   -1,   -1,   -1,   -1,  369,  370,  295,   -1,   -1,\n 1169,   -1,  300,  256,   -1,   -1,  304,   -1,  261,  262,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,\n  318,   -1,   -1,   -1,  322,   -1,   -1,  801,   -1,   -1,\n   -1,  284,  330,  331,   -1,   -1,  334, 1206,   -1,  337,\n   -1,   -1, 1211,   -1,  297,  298, 1215,   -1,   -1,  302,\n   -1,   -1,  305,   -1,  307,   -1,  309,  310,  311,  312,\n   -1,   -1,   -1, 1232,  317,   -1,   -1,   -1,  321,   -1,\n   -1,   -1,  325,   -1,   -1, 1244,   -1,   -1,   -1,   -1,\n  333,   -1,   -1,  336,   -1,  338,  339,   -1,   -1,   -1,\n  343,  344,   -1,  346,  347,  348,  349,  350,  351,  352,\n  353,  354,  355,  356,   -1,   -1,   -1,   -1, 1232,  362,\n  363,   -1,   -1,   -1,   -1,  368,  369,  370,  371,  372,\n  373,  419,  375,  376,  377,   -1,  379,  380, 1297,   -1,\n  383,  384,  385,  386,   -1, 1304, 1305,  390,  391,   -1,\n   -1,   -1,  395,  396,  397,  398,  399,  400,  401,  402,\n 1319,   -1,    0,  265,   -1,  267,   -1,   -1,  270,   -1,\n  272,  414,   -1,  275,  417,   -1,  419,  279,  421,   -1,\n   -1,  424,   -1, 1297,   -1,   -1,  288,  430,   -1,   -1,\n   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,\n  302,   -1,  304,   -1,   -1, 1319,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  316,   -1,  318,  981,   -1,   -1,\n  322,  323, 1381, 1382, 1383,   -1,   -1,   -1,  330,  331,\n   -1, 1390,  334,   -1,   -1,  337,   -1,   -1,   -1,   -1,\n 1399, 1400,   -1, 1402,   -1,   -1,   -1,   -1,   -1,  256,\n   -1,   -1,   -1,   -1,  261,  262,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1, 1381, 1427, 1383,\n   -1, 1430,   -1,   -1,   -1,   -1, 1390,  284,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1, 1399, 1400,   -1, 1402,   -1,\n  297,  298,   -1,   -1,   -1,  302,   -1,   -1,  305,   -1,\n  307,   -1,  309,  310,  311,  312,   -1,   -1,   -1,   -1,\n  317,   -1,   -1, 1427,  321,   -1, 1430,  419,  325,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  333,   -1,   -1,  336,\n    0,  338,  339,   -1,   -1,   -1,  343,  344,   -1,  346,\n  347,  348,  349,  350,  351,  352,  353,  354,  355,  356,\n   -1,   -1,   -1,   -1,   -1,  362,  363,  364,   -1,   -1,\n   -1,  368,  369,   -1,  371,  372,  373,  374,  375,  376,\n  377,   -1,  379,  380,   -1,  382,  383,  384,  385,  386,\n  387,  388,  389,  390,  391,   -1,  393,  394,  395,  396,\n  397,  398,  399,  400,  401,  402,  403,  404,  405,  406,\n  407,  408,  409,  410,  411,  412,  413,  414,   -1,   -1,\n  417,   -1,  419,   -1,  421,   -1,   -1,  424,  256,  257,\n   -1,   -1,   -1,  430,   -1,   -1,  264,  265,  266,  267,\n  268,   -1,  270,  271,   -1,  273,  274,  275,  276,  277,\n  278,  279,  280,   -1,   -1,   -1,   -1,  285,   -1,  287,\n  288,  289,  290,  291,  292,   -1,   -1,  295,   -1,   -1,\n    0,  299,  300,   -1,  302,  303,  304,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  314,   -1,  316,   -1,\n  318,  319,   -1,   -1,  322,   -1,  324,  325,  326,  327,\n  328,  329,  330,  331,  332,  333,  334,  335,   -1,  337,\n   -1,   -1,  340,  341,   -1,   -1,  344,  345,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,\n  368,  369,   -1,   -1,  372,   -1,   -1,   -1,   -1,  377,\n  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,\n   -1,   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  418,  419,  420,  421,   -1,  423,  256,  257,   -1,   -1,\n   -1,    0,  430,   -1,  264,  265,  266,  267,  268,   -1,\n  270,  271,   -1,  273,  274,  275,  276,  277,  278,  279,\n   -1,   -1,   -1,   -1,   -1,  285,   -1,  287,  288,  289,\n  290,  291,  292,   -1,   -1,  295,   -1,   -1,   -1,  299,\n  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  314,   -1,  316,   -1,  318,  319,\n   -1,   -1,  322,   -1,  324,  325,  326,  327,  328,  329,\n  330,  331,  332,  333,  334,  335,   -1,  337,   -1,   -1,\n  340,  341,   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,\n  360,  361,  362,  363,   -1,   -1,    0,   -1,  368,  369,\n   -1,   -1,  372,   -1,   -1,   -1,   -1,  377,  378,  379,\n  380,  381,   -1,   -1,   -1,  385,  256,  387,   -1,   -1,\n   -1,  261,  262,  393,  394,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  284,   -1,   -1,   -1,  418,  419,\n  420,  421,   -1,  423,   -1,   -1,   -1,  297,  298,   -1,\n  430,   -1,  302,   -1,   -1,  305,   -1,  307,   -1,  309,\n  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,   -1,\n   -1,  321,   -1,   -1,   -1,  325,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  333,   -1,   -1,  336,   -1,  338,  339,\n   -1,    0,   -1,  343,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,   -1,  362,  363,   -1,   -1,   -1,   -1,  368,  369,\n  370,  371,  372,  373,   -1,  375,  376,  377,   -1,  379,\n  380,   -1,   -1,  383,  384,  385,  386,  256,   -1,   -1,\n  390,  391,  261,  262,   -1,  395,  396,  397,  398,  399,\n  400,  401,  402,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  414,  284,   -1,  417,   -1,  419,\n   -1,  421,   -1,   -1,  424,   -1,   -1,   -1,  297,  298,\n  430,   -1,   -1,  302,   -1,   -1,  305,   -1,  307,   -1,\n  309,  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,\n   -1,   -1,  321,   -1,   -1,   -1,  325,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  333,   -1,   -1,  336,   -1,  338,\n  339,   -1,   -1,   -1,  343,  344,   -1,  346,  347,  348,\n  349,  350,  351,  352,  353,  354,  355,  356,   -1,   -1,\n   -1,   -1,  256,  362,  363,   -1,   -1,   -1,  262,  368,\n  369,   -1,  371,  372,  373,   -1,  375,  376,  377,   -1,\n  379,  380,    0,   -1,  383,  384,  385,  386,   -1,   -1,\n   -1,  390,  391,   -1,   -1,   -1,  395,  396,  397,  398,\n  399,  400,  401,  402,  298,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  414,   -1,   -1,  417,   -1,\n  419,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  339,   -1,   -1,   -1,  343,\n  344,   -1,  346,  347,  348,  349,  350,  351,  352,  353,\n  354,  355,  356,  357,   -1,   -1,   -1,  256,   -1,  363,\n   -1,   -1,   -1,  262,  368,  369,  370,  371,  372,  373,\n  374,  375,  376,  377,   -1,  379,  380,   -1,   -1,  383,\n  384,  385,  386,  387,   -1,   -1,  390,  391,    0,   -1,\n   -1,  395,  396,  397,  398,  399,  400,  401,  402,  298,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  414,   -1,   -1,  417,   -1,  419,   -1,  421,   -1,   -1,\n  424,   -1,   -1,   -1,   -1,   -1,  430,   -1,   -1,   -1,\n   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  339,   -1,   -1,   -1,  343,  344,   -1,  346,  347,  348,\n  349,  350,  351,  352,  353,  354,  355,  356,   -1,   -1,\n   -1,   -1,   -1,   -1,  363,   -1,   -1,   -1,   -1,  368,\n  369,  370,  371,  372,  373,   -1,  375,  376,  377,   -1,\n  379,  380,   -1,   -1,  383,  384,  385,  386,   -1,   -1,\n   -1,  390,  391,   -1,   -1,   -1,  395,  396,  397,  398,\n  399,  400,  401,  402,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,    0,   -1,   -1,   -1,  414,   -1,   -1,  417,   -1,\n  419,   -1,  421,   -1,   -1,  424,   -1,   -1,  256,  257,\n   -1,  430,   -1,  261,   -1,   -1,   -1,  265,   -1,  267,\n   -1,   -1,  270,   -1,  272,  273,   -1,  275,   -1,  277,\n   -1,  279,   -1,  281,  282,  283,  284,   -1,    0,  287,\n  288,   -1,   -1,   -1,   -1,  293,   -1,  295,  296,  297,\n   -1,   -1,  300,  301,  302,   -1,  304,   -1,   -1,  307,\n   -1,  309,  310,  311,  312,   -1,   -1,   -1,  316,  317,\n  318,   -1,   -1,  321,  322,  323,   -1,   -1,   -1,   -1,\n   -1,   -1,  330,  331,   -1,  333,  334,   -1,  336,  337,\n  338,   -1,   -1,   -1,  342,   -1,   -1,   -1,   -1,   -1,\n   -1,    0,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  362,   -1,   -1,   -1,   -1,   -1,\n  368,  369,  370,   -1,   -1,  257,   -1,   -1,   -1,  261,\n  378,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  272,   -1,   -1,   -1,    0,  277,   -1,   -1,   -1,  281,\n   -1,   -1,  284,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  296,  297,   -1,   -1,  257,  301,\n  302,  419,  261,   -1,   -1,  307,   -1,  309,  310,  311,\n  312,   -1,   -1,  272,   -1,  317,   -1,    0,  277,  321,\n   -1,  323,  281,   -1,   -1,  284,   -1,   -1,   -1,   -1,\n   -1,  333,   -1,   -1,  336,   -1,  338,  296,  297,   -1,\n  342,   -1,  301,  302,   -1,   -1,   -1,   -1,  307,   -1,\n  309,  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,\n  362,   -1,  321,   -1,  323,   -1,   -1,  369,  370,   -1,\n   -1,   -1,   -1,   -1,  333,   -1,   -1,  336,  257,  338,\n    0,   -1,  261,  342,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  272,   -1,   -1,   -1,   -1,  277,   -1,\n   -1,   -1,  281,  362,   -1,  284,   -1,   -1,   -1,   -1,\n   -1,  370,   -1,   -1,   -1,   -1,   -1,  296,  297,   -1,\n   -1,   -1,  301,  302,   -1,  257,   -1,   -1,  307,  261,\n  309,  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,\n  272,   -1,  321,   -1,  323,  277,   -1,   -1,   -1,  281,\n   -1,   -1,  284,   -1,  333,   -1,   -1,  336,   -1,  338,\n   -1,   -1,   -1,  342,  296,  297,   -1,   -1,   -1,  301,\n  302,   -1,   -1,   -1,   -1,  307,   -1,  309,  310,  311,\n  312,   -1,   -1,  362,   -1,  317,   -1,   -1,  257,  321,\n   -1,  323,  261,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  333,   -1,  272,  336,   -1,  338,   -1,  277,   -1,\n  342,   -1,  281,   -1,   -1,  284,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  296,  297,   -1,\n  362,  257,  301,  302,   -1,  261,   -1,   -1,  307,   -1,\n  309,  310,  311,  312,   -1,   -1,  272,   -1,  317,   -1,\n   -1,  277,  321,   -1,  323,  281,   -1,   -1,  284,   -1,\n   -1,   -1,   -1,   -1,  333,   -1,   -1,  336,   -1,  338,\n  296,  297,   -1,  342,  257,  301,  302,   -1,  261,   -1,\n   -1,  307,   -1,  309,  310,  311,  312,   -1,   -1,  272,\n   -1,  317,   -1,  362,  277,  321,   -1,  323,  281,   -1,\n   -1,  284,   -1,   -1,   -1,   -1,   -1,  333,   -1,   -1,\n  336,   -1,  338,  296,  297,   -1,  342,   -1,  301,  302,\n   -1,   -1,   -1,   -1,  307,   -1,  309,  310,  311,  312,\n   -1,   -1,   -1,   -1,  317,   -1,  362,  257,  321,   -1,\n  323,  261,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  333,   -1,  272,  336,   -1,  338,   -1,  277,   -1,  342,\n   -1,  281,   -1,   -1,  284,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  296,  297,   -1,  362,\n   -1,  301,  302,   -1,   -1,   -1,   -1,  307,   -1,  309,\n  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,   -1,\n   -1,  321,   -1,  323,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  333,   -1,  256,  336,   -1,  338,   -1,\n   -1,   -1,  342,  264,  265,  266,  267,   -1,   -1,  270,\n  271,   -1,  273,  274,  275,  276,  277,  278,  279,   -1,\n   -1,   -1,  362,   -1,  285,   -1,  287,  288,  289,  290,\n  291,  292,   -1,   -1,  295,   -1,   -1,   -1,  299,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  314,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,  324,  325,  326,  327,  328,  329,  330,\n  331,  332,  333,  334,  335,   -1,  337,   -1,   -1,  340,\n  341,   -1,   -1,  344,  345,  256,   -1,   -1,   -1,  261,\n   -1,  262,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,  368,   -1,   -1,\n   -1,  372,  284,   -1,   -1,   -1,  377,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,  297,  387,  298,   -1,   -1,\n  302,   -1,  393,  394,   -1,  307,   -1,  309,  310,  311,\n  312,   -1,   -1,   -1,   -1,  317,   -1,   -1,   -1,  321,\n   -1,   -1,   -1,  325,   -1,   -1,   -1,  418,  419,  420,\n  421,  333,   -1,   -1,  336,   -1,  338,   -1,  339,  430,\n   -1,   -1,   -1,  344,  256,  346,  347,  348,  349,  350,\n  351,  352,  353,  354,  355,  356,  357,   -1,   -1,   -1,\n  362,   -1,  363,  364,   -1,   -1,   -1,   -1,  369,  370,\n  371,  372,  373,  374,  375,  376,  377,   -1,  379,  380,\n   -1,  382,  383,  384,  385,  386,  387,  388,  389,  390,\n  391,   -1,  393,  394,  395,  396,  397,  398,  399,  400,\n  401,  402,  403,  404,  405,  406,  407,  408,  409,  410,\n  411,  412,  413,  414,  415,   -1,  256,  419,  419,   -1,\n  421,  422,  262,  424,   -1,   -1,   -1,  339,   -1,  430,\n   -1,   -1,  344,   -1,  346,  347,  348,  349,  350,  351,\n  352,  353,  354,  355,  356,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,  298,  371,\n   -1,  373,   -1,  375,  376,  377,   -1,   -1,   -1,   -1,\n   -1,  383,  384,  385,  386,   -1,   -1,   -1,  390,  391,\n   -1,   -1,   -1,  395,  396,  397,  398,  399,  400,  401,\n  402,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  339,\n   -1,   -1,  414,   -1,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,  357,  430,   -1,\n   -1,   -1,   -1,  363,  364,   -1,   -1,   -1,   -1,  369,\n  370,  371,  372,  373,  374,  375,  376,  377,   -1,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,  413,  414,  415,  256,  256,   -1,  419,\n   -1,  421,  262,   -1,  424,   -1,  265,   -1,  267,   -1,\n  430,  270,   -1,   -1,   -1,   -1,  275,   -1,   -1,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  288,\n   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,  298,   -1,\n   -1,  300,   -1,   -1,   -1,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n   -1,   -1,   -1,  322,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  330,  331,   -1,   -1,  334,   -1,   -1,  337,  339,\n   -1,   -1,   -1,   -1,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,  357,   -1,   -1,\n   -1,   -1,   -1,  363,  364,   -1,   -1,   -1,   -1,  369,\n  370,  371,  372,  373,  374,  375,  376,  377,   -1,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,  413,  414,   -1,  256,  256,   -1,  419,\n  419,  421,  262,   -1,  424,   -1,  265,   -1,  267,   -1,\n  430,  270,   -1,   -1,   -1,   -1,  275,   -1,   -1,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  288,\n   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,  298,   -1,\n   -1,  300,   -1,   -1,   -1,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n   -1,   -1,   -1,  322,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  330,  331,   -1,   -1,  334,   -1,   -1,  337,  339,\n   -1,   -1,   -1,   -1,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,   -1,   -1,  363,  364,   -1,   -1,   -1,  368,  369,\n  370,  371,  372,  373,  374,  375,  376,  377,   -1,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,  413,  414,   -1,  256,   -1,   -1,  419,\n  419,  421,  262,   -1,   -1,  261,   -1,   -1,   -1,   -1,\n  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  284,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  298,   -1,\n   -1,  297,   -1,   -1,   -1,   -1,  302,   -1,   -1,   -1,\n   -1,  307,   -1,  309,  310,  311,  312,   -1,   -1,   -1,\n   -1,  317,   -1,   -1,   -1,  321,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  333,   -1,  339,\n  336,   -1,  338,   -1,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,   -1,   -1,  363,  364,   -1,  362,   -1,  368,  369,\n   -1,  371,  372,  373,  374,  375,  376,  377,   -1,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,  413,  414,   -1,  256,   -1,   -1,  419,\n  261,  421,  262,  419,  424,   -1,   -1,   -1,   -1,   -1,\n  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  284,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  297,   -1,  298,   -1,\n   -1,  302,   -1,   -1,  305,   -1,  307,   -1,  309,  310,\n  311,  312,   -1,   -1,   -1,   -1,  317,   -1,   -1,   -1,\n  321,   -1,   -1,   -1,  325,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  333,   -1,   -1,  336,   -1,  338,   -1,  339,\n   -1,   -1,   -1,   -1,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,  362,   -1,  363,  364,   -1,   -1,   -1,  369,  369,\n   -1,  371,  372,  373,  374,  375,  376,  377,   -1,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,  413,  414,   -1,  256,   -1,  419,  419,\n  261,  421,  262,   -1,  424,   -1,   -1,   -1,   -1,   -1,\n  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  284,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  297,   -1,  298,   -1,\n   -1,  302,   -1,   -1,  305,   -1,  307,   -1,  309,  310,\n  311,  312,   -1,   -1,   -1,   -1,  317,   -1,   -1,   -1,\n  321,   -1,   -1,   -1,  325,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  333,   -1,   -1,  336,   -1,  338,   -1,  339,\n   -1,   -1,   -1,   -1,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,  362,   -1,  363,  364,   -1,   -1,   -1,  369,  369,\n   -1,  371,  372,  373,  374,  375,  376,  377,   -1,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,  413,  414,   -1,  256,   -1,  419,  419,\n   -1,  421,  262,   -1,  424,   -1,  265,   -1,  267,   -1,\n  430,  270,   -1,  272,  273,   -1,  275,   -1,  277,   -1,\n  279,   -1,  281,  282,  283,   -1,   -1,   -1,  287,  288,\n   -1,   -1,   -1,   -1,  293,   -1,  295,  296,  298,   -1,\n   -1,  300,   -1,   -1,   -1,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n   -1,   -1,   -1,  322,  323,   -1,   -1,   -1,   -1,   -1,\n   -1,  330,  331,   -1,   -1,  334,   -1,   -1,  337,  339,\n   -1,   -1,   -1,  342,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,   -1,   -1,  363,  364,   -1,   -1,   -1,   -1,  369,\n   -1,  371,  372,  373,  374,  375,  376,  377,   -1,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,  413,  414,   -1,  256,   -1,   -1,  419,\n  419,  421,  262,   -1,  424,   -1,  265,   -1,  267,   -1,\n  430,  270,   -1,   -1,  273,   -1,  275,   -1,  277,   -1,\n  279,   -1,  281,  282,  283,   -1,   -1,   -1,  287,  288,\n   -1,   -1,   -1,   -1,  293,   -1,  295,   -1,  298,   -1,\n   -1,  300,   -1,   -1,   -1,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  256,   -1,   -1,  322,   -1,   -1,  262,   -1,   -1,   -1,\n  266,  330,  331,   -1,   -1,  334,   -1,   -1,  337,  339,\n   -1,   -1,   -1,  342,  344,   -1,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,   -1,  298,  363,   -1,   -1,   -1,   -1,   -1,  369,\n   -1,  371,   -1,  373,   -1,  375,  376,  377,  314,  379,\n  380,   -1,  382,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,   -1,   -1,  395,  396,  397,  398,  399,\n  400,  401,  402,  403,  404,  405,  406,  407,  408,  409,\n  410,  411,  412,   -1,  414,  256,   -1,   -1,   -1,  419,\n  419,  357,   -1,   -1,   -1,   -1,   -1,  363,  364,   -1,\n  430,   -1,   -1,  369,  370,  371,  372,  373,  374,  375,\n  376,  377,   -1,  379,  380,  285,  382,  383,  384,  385,\n  386,  387,  388,  389,  390,  391,   -1,  393,  394,  395,\n  396,  397,  398,  399,  400,  401,  402,  403,  404,  405,\n  406,  407,  408,  409,  410,  411,  412,  413,  414,   -1,\n  256,   -1,   -1,  419,   -1,  421,  262,  327,  424,   -1,\n   -1,   -1,   -1,   -1,  430,   -1,   -1,   -1,  339,   -1,\n   -1,   -1,   -1,  344,   -1,  346,  347,  348,  349,  350,\n  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,   -1,\n   -1,   -1,  298,   -1,   -1,   -1,   -1,   -1,  369,   -1,\n  371,   -1,  373,   -1,  375,  376,  377,   -1,  378,  379,\n  380,  381,   -1,  383,  384,  385,  386,  387,  388,  389,\n  390,   -1,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,   -1,   -1,  339,   -1,   -1,   -1,   -1,  344,   -1,\n  346,  347,  348,  349,  350,  351,  352,  353,  354,  355,\n  356,   -1,   -1,   -1,   -1,  256,   -1,  363,  364,  430,\n   -1,  262,   -1,  369,  370,  371,  372,  373,  374,  375,\n  376,  377,   -1,  379,  380,   -1,   -1,  383,  384,  385,\n  386,   -1,   -1,   -1,  390,  391,   -1,  393,  394,  395,\n  396,  397,  398,  399,  400,  401,  402,  298,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  413,  414,   -1,\n   -1,   -1,   -1,  419,  256,  421,   -1,   -1,  424,   -1,\n  262,   -1,   -1,   -1,  430,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  339,   -1,\n   -1,   -1,   -1,  344,   -1,  346,  347,  348,  349,  350,\n  351,  352,  353,  354,  355,  356,  298,   -1,   -1,   -1,\n   -1,   -1,  363,  364,   -1,   -1,   -1,   -1,  369,   -1,\n  371,  372,  373,  374,  375,  376,  377,   -1,  379,  380,\n   -1,   -1,  383,  384,  385,  386,   -1,   -1,   -1,  390,\n  391,   -1,  393,  394,  395,  396,  397,  398,  399,  400,\n  401,  402,   -1,  256,   -1,   -1,   -1,   -1,   -1,  262,\n   -1,   -1,  413,  414,   -1,   -1,   -1,   -1,  419,   -1,\n  421,  363,  364,  424,   -1,   -1,   -1,  369,  370,  430,\n  372,  373,  374,  375,   -1,  377,   -1,  379,  380,   -1,\n  382,  383,  384,  385,  386,  298,  388,  389,  390,  391,\n   -1,  393,  394,  395,  396,  397,  398,  399,  400,  401,\n  402,  403,  404,  405,  406,  407,  408,  409,  410,  411,\n  412,  413,  414,   -1,   -1,   -1,   -1,  419,   -1,  421,\n   -1,   -1,  424,   -1,   -1,   -1,  339,   -1,  430,   -1,\n   -1,  344,   -1,  346,  347,  348,  349,  350,  351,  352,\n  353,  354,  355,  356,   -1,   -1,   -1,   -1,  256,   -1,\n  363,   -1,   -1,   -1,  262,   -1,  369,  370,  371,   -1,\n  373,   -1,  375,  376,  377,   -1,  379,  380,   -1,   -1,\n  383,  384,  385,  386,   -1,   -1,   -1,  390,  391,   -1,\n   -1,   -1,  395,  396,  397,  398,  399,  400,  401,  402,\n  298,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  414,   -1,   -1,   -1,   -1,  419,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  430,   -1,   -1,\n  256,   -1,   -1,   -1,   -1,   -1,  262,   -1,   -1,   -1,\n   -1,  339,   -1,   -1,   -1,   -1,  344,   -1,  346,  347,\n  348,  349,  350,  351,  352,  353,  354,  355,  356,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  369,  298,  371,   -1,  373,   -1,  375,  376,  377,\n   -1,  379,  380,   -1,   -1,  383,  384,  385,  386,  387,\n  388,  389,  390,  391,   -1,   -1,   -1,  395,  396,  397,\n  398,  399,  400,  401,  402,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  339,   -1,   -1,  414,   -1,  344,   -1,\n  346,  347,  348,  349,  350,  351,  352,  353,  354,  355,\n  356,   -1,  430,   -1,   -1,  256,   -1,  363,   -1,   -1,\n   -1,  262,   -1,  369,   -1,  371,   -1,  373,   -1,  375,\n  376,  377,   -1,  379,  380,   -1,   -1,  383,  384,  385,\n  386,   -1,   -1,   -1,  390,  391,   -1,   -1,   -1,  395,\n  396,  397,  398,  399,  400,  401,  402,  298,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  414,   -1,\n   -1,   -1,   -1,  419,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  430,   -1,   -1,  256,   -1,   -1,\n   -1,   -1,   -1,  262,   -1,   -1,   -1,   -1,  339,   -1,\n   -1,   -1,   -1,  344,   -1,  346,  347,  348,  349,  350,\n  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,  298,\n  371,   -1,  373,   -1,  375,  376,  377,   -1,  379,  380,\n   -1,   -1,  383,  384,  385,  386,   -1,   -1,   -1,  390,\n  391,   -1,   -1,   -1,  395,  396,  397,  398,  399,  400,\n  401,  402,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  339,   -1,   -1,  414,   -1,  344,   -1,  346,  347,  348,\n  349,  350,  351,  352,  353,  354,  355,  356,   -1,  430,\n   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,  262,   -1,\n  369,   -1,  371,   -1,  373,   -1,  375,  376,  377,   -1,\n  379,  380,   -1,   -1,  383,  384,  385,  386,   -1,   -1,\n   -1,  390,  391,   -1,   -1,   -1,  395,  396,  397,  398,\n  399,  400,  401,  402,  298,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  414,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  430,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,\n  262,   -1,   -1,   -1,   -1,  339,   -1,   -1,   -1,   -1,\n  344,   -1,  346,  347,  348,  349,  350,  351,  352,  353,\n  354,  355,  356,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  369,  298,  371,   -1,  373,\n   -1,  375,  376,  377,   -1,  379,  380,   -1,   -1,  383,\n  384,  385,  386,   -1,   -1,   -1,  390,  391,   -1,   -1,\n   -1,  395,  396,  397,  398,  399,  400,  401,  402,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  339,   -1,   -1,\n  414,   -1,  344,   -1,  346,  347,  348,  349,  350,  351,\n  352,  353,  354,  355,  356,   -1,  430,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,   -1,  371,\n   -1,  373,   -1,  375,  376,  377,   -1,  379,  380,   -1,\n   -1,  383,  384,  385,  386,   -1,   -1,   -1,  390,  391,\n   -1,   -1,   -1,  395,  396,  397,  398,  399,  400,  401,\n  402,   -1,  256,   -1,  256,   -1,   -1,   -1,   -1,   -1,\n  264,  265,  414,  267,   -1,   -1,  270,  271,   -1,   -1,\n   -1,  275,  276,  277,   -1,  279,   -1,   -1,  430,   -1,\n   -1,  285,   -1,   -1,  288,   -1,   -1,   -1,   -1,   -1,\n   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,\n  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,\n   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,\n  334,   -1,   -1,   -1,   -1,   -1,   -1,  339,   -1,  256,\n   -1,   -1,  344,   -1,  346,  347,  348,  349,  350,  351,\n  352,  353,  354,  355,  356,  359,  360,  361,  362,  363,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,  372,  371,\n   -1,  373,   -1,  375,  376,  377,   -1,   -1,   -1,   -1,\n   -1,  383,  384,  385,  386,   -1,   -1,   -1,  390,  391,\n   -1,   -1,   -1,  395,  396,  397,  398,  399,  400,  401,\n  402,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,\n   -1,   -1,  414,   -1,  418,  419,   -1,   -1,   -1,   -1,\n   -1,   -1,  339,   -1,   -1,  429,  430,  344,  430,  346,\n  347,  348,  349,  350,  351,  352,  353,  354,  355,  356,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  369,   -1,  371,   -1,  373,   -1,  375,  376,\n  377,   -1,   -1,   -1,   -1,   -1,  383,  384,  385,  386,\n   -1,   -1,   -1,  390,  391,   -1,   -1,  256,  395,  396,\n  397,  398,  399,  400,  401,  402,   -1,   -1,   -1,   -1,\n   -1,  339,   -1,   -1,   -1,   -1,  344,  414,  346,  347,\n  348,  349,  350,  351,  352,  353,  354,  355,  356,   -1,\n   -1,   -1,   -1,  430,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  369,   -1,  371,   -1,  373,   -1,  375,  376,  377,\n   -1,   -1,   -1,   -1,   -1,  383,  384,  385,  386,   -1,\n   -1,   -1,  390,  391,   -1,   -1,  256,   -1,   -1,  397,\n  398,  399,  400,  401,  402,   -1,   -1,   -1,   -1,   -1,\n  339,   -1,   -1,   -1,   -1,  344,  414,  346,  347,  348,\n  349,  350,  351,  352,  353,  354,  355,  356,   -1,   -1,\n   -1,   -1,  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  369,   -1,  371,   -1,  373,   -1,  375,  376,  377,   -1,\n   -1,   -1,   -1,   -1,  383,  384,  385,  386,   -1,   -1,\n   -1,  390,  391,   -1,   -1,  256,   -1,   -1,  397,  398,\n  399,  400,  401,  402,   -1,   -1,   -1,   -1,   -1,  339,\n   -1,   -1,   -1,   -1,  344,  414,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,\n   -1,  371,   -1,  373,   -1,  375,  376,  377,   -1,   -1,\n   -1,   -1,   -1,  383,  384,  385,  386,   -1,   -1,   -1,\n  390,  391,   -1,   -1,  256,   -1,   -1,  397,  398,  399,\n  400,  401,  402,   -1,   -1,   -1,   -1,   -1,  339,   -1,\n   -1,   -1,   -1,  344,  414,  346,  347,  348,  349,  350,\n  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,   -1,\n  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,   -1,\n  371,   -1,  373,   -1,  375,  376,  377,   -1,   -1,   -1,\n   -1,   -1,  383,  384,  385,  386,  256,   -1,   -1,  390,\n  391,   -1,  262,   -1,   -1,   -1,  397,  398,  399,  400,\n  401,  402,   -1,   -1,   -1,   -1,   -1,  339,   -1,   -1,\n   -1,   -1,  344,  414,  346,  347,  348,  349,  350,  351,\n  352,  353,  354,  355,  356,   -1,   -1,   -1,  298,  430,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,   -1,  371,\n   -1,  373,   -1,  375,  376,  377,   -1,   -1,   -1,   -1,\n   -1,  383,  384,  385,  386,   -1,   -1,   -1,  390,  391,\n   -1,   -1,   -1,   -1,   -1,  397,  398,  399,  400,  401,\n  402,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  414,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  364,   -1,   -1,   -1,  430,  369,\n   -1,   -1,  372,   -1,  374,  375,   -1,   -1,   -1,  379,\n  380,   -1,   -1,  383,  384,  385,  386,  387,  388,  389,\n  390,  391,   -1,  393,  394,  395,  396,  397,  398,  399,\n  400,  401,  402,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  256,  413,  414,   -1,   -1,   -1,   -1,   -1,\n   -1,  421,   -1,   -1,  424,   -1,  339,   -1,   -1,   -1,\n  430,  344,   -1,  346,  347,  348,  349,  350,  351,  352,\n  353,  354,  355,  356,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  369,   -1,  371,   -1,\n  373,   -1,  375,  376,  377,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  385,  386,   -1,   -1,   -1,  390,  391,   -1,\n   -1,  256,   -1,   -1,   -1,   -1,  399,  400,  401,  402,\n   -1,   -1,   -1,   -1,   -1,  339,   -1,   -1,   -1,   -1,\n  344,  414,  346,  347,  348,  349,  350,  351,  352,  353,\n  354,  355,  356,   -1,   -1,   -1,   -1,  430,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  369,   -1,  371,   -1,  373,\n   -1,  375,  376,  377,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  385,  386,   -1,   -1,   -1,  390,  391,   -1,   -1,\n  256,   -1,   -1,   -1,   -1,  399,  400,  401,  402,   -1,\n   -1,   -1,   -1,   -1,  339,   -1,   -1,   -1,   -1,  344,\n  414,  346,  347,  348,  349,  350,  351,  352,  353,  354,\n  355,  356,   -1,   -1,   -1,   -1,  430,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  369,   -1,  371,   -1,  373,   -1,\n  375,  376,  377,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  385,  386,   -1,   -1,   -1,  390,  391,   -1,   -1,  256,\n   -1,   -1,   -1,   -1,  399,  400,  401,  402,   -1,   -1,\n   -1,   -1,   -1,  339,   -1,   -1,   -1,   -1,  344,  414,\n  346,  347,  348,  349,  350,  351,  352,  353,  354,  355,\n  356,   -1,   -1,   -1,   -1,  430,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  369,   -1,  371,   -1,  373,   -1,  375,\n  376,  377,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  385,\n  386,   -1,   -1,   -1,  390,  391,   -1,   -1,  256,   -1,\n   -1,   -1,   -1,   -1,   -1,  401,  402,   -1,   -1,   -1,\n   -1,   -1,  339,   -1,   -1,   -1,   -1,  344,  414,  346,\n  347,  348,  349,  350,  351,  352,  353,  354,  355,  356,\n   -1,   -1,   -1,   -1,  430,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  369,   -1,  371,   -1,  373,   -1,  375,  376,\n  377,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  385,  386,\n   -1,   -1,   -1,  390,  391,   -1,   -1,  256,   -1,   -1,\n   -1,   -1,   -1,   -1,  401,  402,   -1,   -1,   -1,   -1,\n   -1,  339,   -1,   -1,   -1,   -1,  344,  414,  346,  347,\n  348,  349,  350,  351,  352,  353,  354,  355,  356,   -1,\n   -1,   -1,   -1,  430,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  369,   -1,  371,   -1,  373,   -1,  375,  376,  377,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  386,   -1,\n   -1,   -1,  390,  391,   -1,   -1,  256,   -1,   -1,   -1,\n   -1,   -1,   -1,  401,  402,   -1,   -1,   -1,   -1,   -1,\n  339,   -1,   -1,   -1,   -1,  344,  414,  346,  347,  348,\n  349,  350,  351,  352,  353,  354,  355,  356,   -1,   -1,\n   -1,   -1,  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  369,   -1,  371,   -1,  373,   -1,  375,  376,  377,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  386,   -1,   -1,\n   -1,  390,  391,   -1,   -1,  256,   -1,   -1,   -1,   -1,\n   -1,   -1,  401,  402,   -1,   -1,   -1,   -1,   -1,  339,\n   -1,   -1,   -1,   -1,  344,  414,  346,  347,  348,  349,\n  350,  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,\n   -1,  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,\n   -1,  371,   -1,  373,   -1,  375,  376,  377,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  386,   -1,   -1,   -1,\n   -1,  391,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,\n   -1,  401,  402,   -1,   -1,   -1,   -1,   -1,  339,   -1,\n   -1,   -1,   -1,  344,  414,  346,  347,  348,  349,  350,\n  351,  352,  353,  354,  355,  356,   -1,   -1,   -1,   -1,\n  430,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,   -1,\n  371,   -1,  373,   -1,  375,  376,  377,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  386,   -1,   -1,   -1,   -1,\n  391,   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,\n  401,  402,   -1,   -1,   -1,   -1,   -1,  339,   -1,   -1,\n   -1,   -1,  344,  414,  346,  347,  348,  349,  350,  351,\n  352,  353,  354,  355,  356,   -1,   -1,   -1,   -1,  430,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  369,   -1,  371,\n   -1,  373,   -1,  375,  376,  377,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  391,\n   -1,   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,  401,\n  402,   -1,   -1,   -1,   -1,   -1,  339,   -1,   -1,   -1,\n   -1,  344,  414,  346,  347,  348,  349,  350,  351,  352,\n  353,  354,  355,  356,   -1,   -1,   -1,   -1,  430,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  369,   -1,  371,   -1,\n  373,   -1,  375,  376,  377,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  391,   -1,\n   -1,  256,   -1,   -1,   -1,   -1,   -1,   -1,  401,  402,\n   -1,   -1,   -1,   -1,   -1,  339,   -1,   -1,   -1,   -1,\n  344,  414,  346,  347,  348,  349,  350,  351,  352,  353,\n  354,  355,  356,   -1,   -1,   -1,   -1,  430,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  369,   -1,  371,   -1,  373,\n   -1,  375,  376,  377,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  391,   -1,   -1,\n   -1,  262,   -1,   -1,   -1,  266,   -1,   -1,  402,   -1,\n   -1,   -1,   -1,   -1,  339,   -1,   -1,   -1,   -1,  344,\n  414,  346,  347,  348,  349,  350,  351,  352,  353,  354,\n  355,  356,   -1,   -1,   -1,   -1,  430,  298,   -1,   -1,\n   -1,   -1,   -1,   -1,  369,   -1,  371,   -1,  373,   -1,\n  375,  376,  377,  314,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  391,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  402,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  414,\n   -1,   -1,   -1,   -1,   -1,   -1,  357,   -1,   -1,   -1,\n   -1,   -1,  363,  364,   -1,  430,   -1,   -1,  369,  370,\n   -1,  372,   -1,  374,   -1,  376,  377,   -1,  379,  380,\n   -1,  382,  383,  384,  385,  386,  387,  388,  389,  390,\n  391,   -1,  393,  394,  395,  396,  397,  398,  399,  400,\n  401,  402,  403,  404,  405,  406,  407,  408,  409,  410,\n  411,  412,  413,  414,   -1,   -1,  256,   -1,  419,   -1,\n  421,   -1,   -1,  424,  264,  265,  266,  267,  268,  430,\n  270,  271,   -1,  273,  274,  275,  276,  277,  278,  279,\n   -1,   -1,   -1,   -1,   -1,  285,   -1,  287,  288,  289,\n  290,  291,  292,   -1,   -1,  295,   -1,   -1,   -1,  299,\n  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  314,   -1,  316,   -1,  318,  319,\n   -1,   -1,  322,   -1,  324,  325,  326,  327,  328,  329,\n  330,  331,  332,  333,  334,  335,   -1,  337,   -1,   -1,\n  340,  341,   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,\n  360,  361,  362,  363,   -1,   -1,   -1,   -1,  368,   -1,\n   -1,   -1,  372,   -1,   -1,   -1,   -1,  377,  378,  379,\n  380,  381,   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,\n   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  418,  419,\n  420,  421,   -1,  423,  264,  265,  266,  267,   -1,   -1,\n  270,  271,   -1,  273,  274,  275,  276,  277,  278,  279,\n   -1,   -1,   -1,   -1,   -1,  285,   -1,  287,  288,  289,\n  290,  291,  292,   -1,   -1,  295,   -1,   -1,   -1,  299,\n  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  314,   -1,  316,   -1,  318,  319,\n   -1,   -1,  322,   -1,  324,  325,  326,  327,  328,  329,\n  330,  331,  332,  333,  334,  335,   -1,  337,   -1,   -1,\n  340,  341,   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,\n  360,  361,  362,  363,   -1,   -1,   -1,   -1,  368,   -1,\n   -1,   -1,  372,   -1,   -1,   -1,   -1,  377,  378,  379,\n  380,  381,   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,\n   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,  418,  419,\n  420,  421,  264,  265,  266,  267,   -1,   -1,  270,  271,\n   -1,  273,  274,  275,  276,  277,  278,  279,   -1,   -1,\n   -1,   -1,   -1,  285,   -1,  287,  288,  289,  290,  291,\n  292,   -1,   -1,  295,   -1,   -1,   -1,  299,  300,   -1,\n  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  314,   -1,  316,   -1,  318,  319,   -1,   -1,\n  322,   -1,  324,  325,  326,  327,  328,  329,  330,  331,\n  332,  333,  334,  335,   -1,  337,   -1,   -1,  340,  341,\n   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,\n  362,  363,   -1,   -1,   -1,   -1,  368,   -1,   -1,   -1,\n  372,   -1,   -1,   -1,   -1,  377,  378,  379,  380,  381,\n   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,\n   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  256,   -1,   -1,   -1,  418,  419,  420,  421,\n  264,  265,  266,  267,   -1,   -1,  270,  271,   -1,  273,\n  274,  275,  276,  277,  278,  279,   -1,   -1,   -1,   -1,\n   -1,  285,   -1,  287,  288,  289,  290,  291,  292,   -1,\n   -1,  295,   -1,   -1,   -1,  299,  300,   -1,  302,  303,\n  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  314,   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,\n  324,  325,  326,  327,  328,  329,  330,  331,  332,  333,\n  334,  335,   -1,  337,   -1,   -1,  340,  341,   -1,   -1,\n  344,  345,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,\n   -1,   -1,   -1,   -1,  368,   -1,   -1,   -1,  372,   -1,\n   -1,   -1,   -1,  377,  378,  379,  380,  381,   -1,   -1,\n   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,\n  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  256,   -1,   -1,   -1,  418,  419,  420,  421,  264,  265,\n  266,  267,   -1,   -1,  270,  271,   -1,  273,  274,  275,\n  276,  277,  278,  279,   -1,   -1,   -1,   -1,   -1,  285,\n   -1,  287,  288,  289,  290,  291,  292,   -1,   -1,  295,\n   -1,   -1,   -1,  299,  300,   -1,  302,  303,  304,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  314,   -1,\n  316,   -1,  318,  319,   -1,   -1,  322,   -1,  324,  325,\n  326,  327,  328,  329,  330,  331,  332,  333,  334,  335,\n   -1,  337,   -1,   -1,  340,  341,   -1,   -1,  344,  345,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,\n   -1,   -1,  368,   -1,   -1,   -1,  372,   -1,   -1,   -1,\n   -1,  377,  378,  379,  380,  381,   -1,   -1,   -1,  385,\n   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,  394,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,\n   -1,   -1,  418,  419,  420,  421,  264,  265,   -1,  267,\n   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,\n   -1,  279,   -1,   -1,  265,   -1,  267,  285,   -1,  270,\n  288,   -1,   -1,   -1,  275,   -1,   -1,  295,  279,   -1,\n   -1,   -1,  300,   -1,  302,  303,  304,  288,  306,   -1,\n   -1,   -1,   -1,   -1,  295,  313,   -1,   -1,  316,  300,\n  318,  319,   -1,  304,  322,   -1,   -1,  325,   -1,  327,\n   -1,  329,  330,  331,  332,  316,  334,  318,   -1,   -1,\n   -1,  322,   -1,  341,   -1,   -1,  344,  345,   -1,  330,\n  331,   -1,   -1,  334,   -1,   -1,  337,   -1,   -1,   -1,\n   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  372,   -1,   -1,  375,   -1,   -1,\n  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,\n   -1,   -1,  373,   -1,   -1,  393,  394,   -1,   -1,   -1,\n   -1,   -1,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n  418,  419,  420,  421,  285,   -1,   -1,  288,   -1,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,  419,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n  341,   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,  368,  369,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,\n   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,\n  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,\n   -1,  275,  276,  277,   -1,  279,   -1,  418,  419,  420,\n  421,  285,   -1,  424,  288,   -1,   -1,   -1,  429,   -1,\n   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,\n  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,\n   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,\n  334,   -1,   -1,   -1,   -1,   -1,   -1,  341,   -1,   -1,\n  344,  345,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,\n   -1,   -1,   -1,   -1,  368,   -1,   -1,   -1,  372,   -1,\n   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,\n   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,\n  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  256,  418,  419,  420,  421,   -1,   -1,\n  424,  264,  265,   -1,  267,  429,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,  265,\n   -1,  267,  285,   -1,  270,  288,   -1,   -1,   -1,  275,\n   -1,   -1,  295,  279,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,  288,   -1,   -1,   -1,   -1,   -1,   -1,  295,\n   -1,   -1,   -1,  316,  300,  318,  319,   -1,  304,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n  316,  334,  318,   -1,   -1,   -1,  322,   -1,  341,   -1,\n   -1,  344,  345,   -1,  330,  331,   -1,   -1,  334,   -1,\n   -1,  337,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,  368,  369,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,  371,   -1,   -1,   -1,   -1,\n  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  256,   -1,   -1,   -1,  418,  419,  420,  421,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,  419,  279,   -1,   -1,  265,   -1,  267,\n  285,   -1,  270,  288,   -1,   -1,   -1,  275,   -1,   -1,\n  295,  279,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n  288,  306,   -1,   -1,   -1,   -1,   -1,  295,  313,   -1,\n   -1,  316,  300,  318,  319,   -1,  304,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,  316,  334,\n  318,   -1,   -1,   -1,  322,   -1,  341,   -1,   -1,  344,\n  345,   -1,  330,  331,   -1,   -1,  334,   -1,   -1,  337,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,  394,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,\n   -1,   -1,   -1,  418,  419,  420,  421,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,  419,  279,   -1,   -1,  265,   -1,  267,  285,   -1,\n  270,  288,   -1,   -1,   -1,  275,   -1,   -1,  295,  279,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,  288,   -1,\n   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,  316,\n  300,  318,  319,  320,  304,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,  316,  334,  318,   -1,\n   -1,   -1,  322,   -1,  341,   -1,   -1,  344,  345,   -1,\n  330,  331,   -1,   -1,  334,   -1,   -1,  337,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,  368,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,   -1,   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,\n   -1,  418,  419,  420,  421,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,  419,\n  279,   -1,   -1,   -1,   -1,   -1,  285,   -1,   -1,  288,\n   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,  341,   -1,   -1,  344,  345,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,  368,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,   -1,\n   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  418,\n  419,  420,  421,  262,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,  285,   -1,   -1,  288,\n   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,  298,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  343,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,  374,   -1,   -1,   -1,  378,\n  379,  380,  381,  382,   -1,   -1,  385,   -1,  387,  256,\n   -1,   -1,   -1,   -1,  393,  394,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,  285,  418,\n  419,  288,  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,  341,   -1,   -1,  344,  345,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,  369,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,   -1,   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,\n   -1,  418,  419,  420,  421,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,  265,   -1,  267,  285,   -1,  270,  288,\n   -1,   -1,   -1,  275,   -1,   -1,  295,  279,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,  288,   -1,   -1,   -1,\n   -1,   -1,   -1,  295,   -1,   -1,   -1,  316,  300,  318,\n  319,   -1,  304,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,  316,  334,  318,   -1,   -1,   -1,\n  322,   -1,  341,   -1,   -1,  344,  345,   -1,  330,  331,\n   -1,   -1,  334,   -1,   -1,  337,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n  369,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,   -1,\n   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,   -1,  418,\n  419,  420,  421,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,  419,  279,   -1,\n   -1,  265,   -1,  267,  285,   -1,  270,  288,   -1,   -1,\n   -1,  275,   -1,   -1,  295,  279,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,  288,   -1,   -1,   -1,   -1,   -1,\n   -1,  295,   -1,   -1,   -1,  316,  300,  318,  319,   -1,\n  304,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,  316,  334,  318,   -1,   -1,   -1,  322,   -1,\n  341,   -1,   -1,  344,  345,   -1,  330,  331,   -1,   -1,\n  334,   -1,   -1,  337,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,\n   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  256,   -1,   -1,   -1,  418,  419,  420,\n  421,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,  419,  279,   -1,   -1,   -1,\n   -1,   -1,  285,   -1,   -1,  288,   -1,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,  341,   -1,\n   -1,  344,  345,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,\n  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  256,   -1,  418,  419,  420,  421,  262,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,   -1,   -1,  288,   -1,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,  298,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  343,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,  374,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,  256,   -1,   -1,   -1,   -1,\n  393,  394,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n   -1,   -1,   -1,   -1,  285,  418,  419,  288,  421,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n  341,   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,\n   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  256,   -1,   -1,   -1,  418,  419,  420,\n  421,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,  265,\n   -1,  267,  285,   -1,  270,  288,   -1,   -1,   -1,  275,\n   -1,   -1,  295,  279,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,  288,   -1,   -1,   -1,   -1,   -1,   -1,  295,\n   -1,   -1,   -1,  316,  300,  318,  319,   -1,  304,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n  316,  334,  318,   -1,   -1,   -1,  322,   -1,  341,   -1,\n   -1,  344,  345,   -1,  330,  331,   -1,   -1,  334,   -1,\n   -1,  337,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,\n  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  256,   -1,   -1,   -1,  418,  419,  420,  421,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,  419,  279,   -1,   -1,  265,   -1,  267,\n  285,   -1,  270,  288,   -1,   -1,   -1,  275,   -1,   -1,\n  295,  279,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n  288,   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,\n   -1,  316,  300,  318,  319,   -1,  304,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,  316,  334,\n  318,   -1,   -1,   -1,  322,   -1,  341,   -1,   -1,  344,\n  345,   -1,  330,  331,   -1,   -1,  334,   -1,   -1,  337,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,  394,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,\n   -1,   -1,   -1,  418,  419,  420,  421,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,  419,  279,   -1,   -1,  265,   -1,  267,  285,   -1,\n  270,  288,   -1,   -1,   -1,  275,   -1,   -1,  295,  279,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,  288,   -1,\n   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,  316,\n  300,  318,  319,   -1,  304,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,  316,  334,  318,   -1,\n   -1,   -1,  322,   -1,  341,   -1,   -1,  344,  345,   -1,\n  330,  331,   -1,   -1,  334,   -1,   -1,  337,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,   -1,   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,\n   -1,  418,  419,  420,  421,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,  419,\n  279,   -1,   -1,   -1,   -1,   -1,  285,   -1,   -1,  288,\n   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,  341,   -1,   -1,  344,  345,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,   -1,\n   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,  418,\n  419,  420,  421,  262,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,  285,   -1,   -1,  288,\n   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,  298,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,  374,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,  256,\n   -1,   -1,   -1,   -1,  393,  394,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,  285,  418,\n  419,  288,  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,  374,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,  256,   -1,   -1,   -1,   -1,  393,  394,   -1,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,\n  285,  418,  419,  288,  421,   -1,   -1,   -1,   -1,   -1,\n  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,  256,   -1,   -1,   -1,   -1,  393,  394,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,  418,  419,  288,  421,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,  256,   -1,   -1,   -1,   -1,\n  393,  394,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n   -1,   -1,   -1,   -1,  285,  418,  419,  288,  421,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,  256,   -1,   -1,\n   -1,   -1,  393,  394,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,  285,  418,  419,  288,\n  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,  256,\n   -1,   -1,   -1,   -1,  393,  394,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,  285,  418,\n  419,  288,  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,  256,   -1,   -1,   -1,   -1,  393,  394,   -1,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,\n  285,  418,  419,  288,  421,   -1,   -1,   -1,   -1,   -1,\n  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,  256,   -1,   -1,   -1,   -1,  393,  394,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,  418,  419,  288,  421,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,  256,   -1,   -1,   -1,   -1,\n  393,  394,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n   -1,   -1,   -1,   -1,  285,  418,  419,  288,  421,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,  256,   -1,   -1,\n   -1,   -1,  393,  394,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,  285,  418,  419,  288,\n  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,  256,\n   -1,   -1,   -1,   -1,  393,  394,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,  285,  418,\n  419,  288,  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,  256,   -1,   -1,   -1,   -1,  393,  394,   -1,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,\n  285,  418,  419,  288,  421,   -1,   -1,   -1,   -1,   -1,\n  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,  256,   -1,   -1,   -1,   -1,  393,  394,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,  418,  419,  288,  421,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,  256,   -1,   -1,   -1,   -1,\n  393,  394,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n   -1,   -1,   -1,   -1,  285,  418,  419,  288,  421,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,  256,   -1,   -1,\n   -1,   -1,  393,  394,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,  285,  418,  419,  288,\n  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,  256,\n   -1,   -1,   -1,   -1,  393,  394,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,  285,  418,\n  419,  288,  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,  256,   -1,   -1,   -1,   -1,  393,  394,   -1,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,\n  285,  418,  419,  288,  421,   -1,   -1,   -1,   -1,   -1,\n  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,  256,   -1,   -1,   -1,   -1,  393,  394,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,  418,  419,  288,  421,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,  256,   -1,   -1,   -1,   -1,\n  393,  394,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n   -1,   -1,   -1,   -1,  285,  418,  419,  288,  421,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,  256,   -1,   -1,\n   -1,   -1,  393,  394,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,  285,  418,  419,  288,\n  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,  256,\n   -1,   -1,   -1,   -1,  393,  394,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,  285,  418,\n  419,  288,  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,  256,   -1,   -1,   -1,   -1,  393,  394,   -1,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,\n  285,  418,  419,  288,  421,   -1,   -1,   -1,   -1,   -1,\n  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,  256,   -1,   -1,   -1,   -1,  393,  394,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,  418,  419,  288,  421,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,  256,   -1,   -1,   -1,   -1,\n  393,  394,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n   -1,   -1,   -1,   -1,  285,  418,  419,  288,  421,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,  256,   -1,   -1,\n   -1,   -1,  393,  394,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,   -1,   -1,   -1,   -1,  285,  418,  419,  288,\n  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,  256,\n   -1,   -1,   -1,   -1,  393,  394,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,  285,  418,\n  419,  288,  421,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,  256,   -1,   -1,   -1,   -1,  393,  394,   -1,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,   -1,  279,   -1,   -1,   -1,   -1,   -1,\n  285,  418,  419,  288,  421,   -1,   -1,   -1,   -1,   -1,\n  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,  256,   -1,   -1,   -1,   -1,  393,  394,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,  418,  419,  288,  421,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,\n  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,  261,   -1,\n   -1,   -1,  265,   -1,  267,  418,  419,  270,  421,  272,\n  273,   -1,  275,   -1,  277,   -1,  279,   -1,  281,  282,\n  283,  284,   -1,   -1,  287,  288,   -1,   -1,   -1,   -1,\n  293,   -1,  295,  296,  297,   -1,   -1,  300,   -1,  302,\n   -1,  304,   -1,   -1,  307,   -1,  309,  310,  311,  312,\n   -1,   -1,   -1,  316,  317,  318,   -1,   -1,  321,  322,\n  323,   -1,   -1,   -1,   -1,   -1,   -1,  330,  331,   -1,\n  333,  334,  256,  336,  337,  338,   -1,   -1,   -1,  342,\n  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,\n   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,  362,\n   -1,  285,   -1,   -1,  288,  368,  369,  370,   -1,   -1,\n   -1,  295,   -1,   -1,   -1,  378,  300,   -1,  302,  303,\n  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,\n   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,\n  334,   -1,   -1,  337,   -1,   -1,  419,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,\n   -1,   -1,   -1,  256,   -1,   -1,   -1,   -1,  372,   -1,\n  262,  264,  265,   -1,  267,  379,  380,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,   -1,\n   -1,   -1,  285,   -1,   -1,  288,   -1,   -1,   -1,  261,\n   -1,  263,  295,   -1,   -1,   -1,  298,  300,   -1,  302,\n  303,  304,   -1,   -1,  418,  419,   -1,   -1,   -1,   -1,\n   -1,   -1,  284,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,  297,  329,  330,  331,  332,\n  302,  334,   -1,   -1,   -1,  307,   -1,  309,  310,  311,\n  312,   -1,   -1,  315,   -1,  317,   -1,   -1,   -1,  321,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,  333,  364,   -1,  336,   -1,  338,   -1,   -1,  372,\n  372,  373,  374,  375,  376,   -1,   -1,  379,  380,   -1,\n   -1,  383,  384,  385,  386,  387,  388,  389,  390,  391,\n  362,  393,  394,  395,  396,  397,  398,  399,  400,  401,\n  402,  403,  404,  405,  406,  407,  408,  409,  410,  411,\n  412,  413,  414,   -1,   -1,  418,  419,   -1,   -1,  421,\n   -1,  261,  424,  263,   -1,  265,   -1,  267,   -1,   -1,\n  270,   -1,  272,  273,   -1,  275,   -1,  277,   -1,  279,\n   -1,  281,  282,  283,  284,   -1,   -1,  287,  288,   -1,\n   -1,   -1,   -1,  293,  294,  295,  296,  297,   -1,   -1,\n  300,   -1,  302,   -1,  304,   -1,  306,  307,   -1,  309,\n  310,  311,  312,   -1,   -1,  315,  316,  317,  318,   -1,\n   -1,  321,  322,  323,   -1,   -1,   -1,   -1,   -1,   -1,\n  330,  331,   -1,  333,  334,   -1,  336,  337,  338,   -1,\n   -1,   -1,  342,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  362,   -1,   -1,  365,  366,  261,   -1,   -1,\n   -1,  265,   -1,  267,   -1,   -1,  270,   -1,  272,  273,\n   -1,  275,   -1,  277,   -1,  279,   -1,  281,  282,  283,\n  284,   -1,   -1,  287,  288,   -1,   -1,   -1,   -1,  293,\n   -1,  295,  296,  297,   -1,   -1,  300,   -1,  302,   -1,\n  304,   -1,   -1,  307,   -1,  309,  310,  311,  312,  419,\n   -1,   -1,  316,  317,  318,   -1,   -1,  321,  322,  323,\n   -1,   -1,   -1,   -1,   -1,   -1,  330,  331,   -1,  333,\n  334,   -1,  336,  337,  338,   -1,   -1,   -1,  342,   -1,\n   -1,  261,   -1,   -1,   -1,  265,   -1,  267,   -1,   -1,\n  270,   -1,  272,  273,   -1,  275,   -1,  277,  362,  279,\n   -1,  281,  282,  283,  284,  369,   -1,  287,  288,   -1,\n   -1,   -1,   -1,  293,  378,  295,  296,  297,   -1,   -1,\n  300,   -1,  302,   -1,  304,   -1,   -1,  307,   -1,  309,\n  310,  311,  312,   -1,   -1,   -1,  316,  317,  318,   -1,\n   -1,  321,  322,  323,   -1,   -1,   -1,   -1,   -1,   -1,\n  330,  331,   -1,  333,  334,  419,  336,  337,  338,   -1,\n   -1,   -1,  342,   -1,   -1,  261,   -1,   -1,   -1,  265,\n   -1,  267,   -1,   -1,  270,   -1,  272,  273,   -1,  275,\n   -1,  277,  362,  279,   -1,  281,  282,  283,  284,  369,\n   -1,  287,  288,   -1,   -1,   -1,   -1,  293,  378,  295,\n  296,  297,   -1,   -1,  300,   -1,  302,   -1,  304,   -1,\n   -1,  307,   -1,  309,  310,  311,  312,   -1,   -1,   -1,\n  316,  317,  318,   -1,   -1,  321,  322,  323,   -1,   -1,\n   -1,   -1,   -1,   -1,  330,  331,   -1,  333,  334,  419,\n  336,  337,  338,   -1,   -1,   -1,  342,   -1,   -1,  261,\n   -1,   -1,   -1,  265,   -1,  267,   -1,   -1,  270,   -1,\n  272,  273,   -1,  275,   -1,  277,  362,  279,   -1,  281,\n  282,  283,  284,   -1,   -1,  287,  288,   -1,   -1,   -1,\n   -1,  293,  378,  295,  296,  297,   -1,   -1,  300,   -1,\n  302,   -1,  304,   -1,   -1,  307,   -1,  309,  310,  311,\n  312,   -1,   -1,   -1,  316,  317,  318,   -1,   -1,  321,\n  322,  323,   -1,   -1,   -1,   -1,   -1,   -1,  330,  331,\n   -1,  333,  334,  419,  336,  337,  338,   -1,   -1,   -1,\n  342,   -1,   -1,  261,   -1,   -1,   -1,  265,   -1,  267,\n   -1,   -1,  270,   -1,  272,  273,   -1,  275,   -1,  277,\n  362,  279,   -1,  281,  282,  283,  284,  369,   -1,  287,\n  288,   -1,   -1,   -1,   -1,  293,   -1,  295,  296,  297,\n   -1,   -1,  300,   -1,  302,  261,  304,   -1,   -1,  307,\n   -1,  309,  310,  311,  312,   -1,   -1,   -1,  316,  317,\n  318,   -1,   -1,  321,  322,  323,   -1,   -1,  284,   -1,\n   -1,   -1,  330,  331,   -1,  333,  334,  419,  336,  337,\n  338,  297,   -1,   -1,  342,   -1,  302,   -1,   -1,  305,\n   -1,  307,   -1,  309,  310,  311,  312,   -1,   -1,   -1,\n   -1,  317,   -1,   -1,  362,  321,   -1,   -1,   -1,  325,\n   -1,  369,   -1,   -1,   -1,   -1,   -1,  333,   -1,   -1,\n  336,   -1,  338,   -1,  264,  265,   -1,  267,   -1,   -1,\n  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,\n   -1,  357,   -1,   -1,   -1,  285,  362,   -1,  288,   -1,\n   -1,   -1,   -1,  369,  370,  295,  372,   -1,  374,   -1,\n  300,  419,  302,  303,  304,   -1,  306,   -1,   -1,   -1,\n   -1,  387,   -1,  313,   -1,   -1,  316,   -1,  318,  319,\n   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,\n  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,\n   -1,  341,   -1,  419,  344,  345,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,\n  360,  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  372,  373,   -1,  375,   -1,   -1,  378,  379,\n  380,  381,   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,\n   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,\n   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,\n   -1,   -1,  275,  276,  277,   -1,  279,   -1,  418,  419,\n  420,  421,  285,   -1,   -1,  288,   -1,   -1,   -1,   -1,\n   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,\n  303,  304,   -1,  306,   -1,   -1,   -1,   -1,   -1,   -1,\n  313,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,\n   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,\n   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,  341,   -1,\n   -1,  344,  345,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,\n  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,\n   -1,   -1,  375,   -1,   -1,  378,  379,  380,  381,   -1,\n   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,\n  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,  264,  265,\n   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,\n  276,  277,   -1,  279,   -1,  418,  419,  420,  421,  285,\n   -1,   -1,  288,   -1,   -1,   -1,   -1,   -1,   -1,  295,\n   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,\n   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,\n   -1,  337,   -1,   -1,   -1,  341,   -1,   -1,  344,  345,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,\n   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,\n   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,  394,   -1,\n   -1,   -1,   -1,   -1,   -1,  264,  265,   -1,  267,   -1,\n   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,   -1,\n  279,   -1,  418,  419,  420,  421,  285,   -1,   -1,  288,\n   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,\n   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,\n  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,   -1,\n  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,   -1,\n   -1,   -1,  341,   -1,   -1,  344,  345,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,  368,\n   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,\n  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,   -1,\n   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,\n   -1,   -1,  264,  265,   -1,  267,   -1,   -1,  270,  271,\n   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,  418,\n  419,  420,  421,  285,   -1,   -1,  288,   -1,   -1,   -1,\n   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,\n  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,\n  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,\n  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,  341,\n   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,\n  362,  363,   -1,   -1,   -1,   -1,  368,   -1,   -1,   -1,\n  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,\n   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,\n   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,  264,\n  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,   -1,\n  275,  276,  277,   -1,  279,   -1,  418,  419,  420,  421,\n  285,   -1,   -1,  288,   -1,   -1,   -1,   -1,   -1,   -1,\n  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,  304,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,   -1,\n  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,  334,\n   -1,   -1,   -1,   -1,   -1,   -1,  341,   -1,   -1,  344,\n  345,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,\n   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,   -1,\n  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,  394,\n   -1,   -1,   -1,   -1,   -1,   -1,  264,  265,   -1,  267,\n   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,  277,\n   -1,  279,   -1,  418,  419,  420,  421,  285,   -1,   -1,\n  288,   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,   -1,\n   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,   -1,\n  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,  327,\n   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,   -1,\n   -1,   -1,   -1,  341,   -1,   -1,  344,  345,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,   -1,\n  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,  387,\n   -1,   -1,   -1,   -1,   -1,  393,  394,   -1,   -1,   -1,\n   -1,   -1,   -1,  264,  265,   -1,  267,   -1,   -1,  270,\n  271,   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,\n  418,  419,  420,  421,  285,   -1,   -1,  288,   -1,   -1,\n   -1,   -1,   -1,   -1,  295,   -1,   -1,   -1,   -1,  300,\n   -1,  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,\n   -1,  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,\n  331,  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,\n  341,   -1,   -1,  344,  345,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,\n  361,  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,\n  381,   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,\n   -1,   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,\n  264,  265,   -1,  267,   -1,   -1,  270,  271,   -1,   -1,\n   -1,  275,  276,  277,   -1,  279,   -1,  418,  419,  420,\n  421,  285,   -1,   -1,  288,   -1,   -1,   -1,   -1,   -1,\n   -1,  295,   -1,   -1,   -1,   -1,  300,   -1,  302,  303,\n  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,\n   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,\n  334,   -1,   -1,   -1,   -1,   -1,   -1,  341,   -1,   -1,\n  344,  345,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  372,   -1,\n   -1,   -1,   -1,   -1,  378,  379,  380,  381,   -1,   -1,\n   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,   -1,  393,\n  394,   -1,   -1,   -1,   -1,   -1,   -1,  264,  265,   -1,\n  267,   -1,   -1,  270,  271,   -1,   -1,   -1,  275,  276,\n  277,   -1,  279,   -1,  418,  419,  420,  421,  285,   -1,\n   -1,  288,   -1,   -1,   -1,   -1,   -1,   -1,  295,   -1,\n   -1,   -1,   -1,  300,   -1,  302,  303,  304,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  316,\n   -1,  318,  319,   -1,   -1,  322,   -1,   -1,  325,   -1,\n  327,   -1,  329,  330,  331,  332,   -1,  334,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  359,  360,  361,  362,  363,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  372,   -1,   -1,   -1,   -1,\n   -1,  378,  379,  380,  381,   -1,   -1,   -1,  385,   -1,\n  387,   -1,  264,  265,   -1,  267,  393,  394,  270,  271,\n   -1,   -1,   -1,  275,  276,  277,   -1,  279,   -1,   -1,\n   -1,   -1,   -1,  285,   -1,   -1,  288,   -1,   -1,   -1,\n   -1,  418,  419,  295,  421,   -1,   -1,   -1,  300,   -1,\n  302,  303,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  316,   -1,  318,  319,   -1,   -1,\n  322,   -1,   -1,  325,   -1,  327,   -1,  329,  330,  331,\n  332,   -1,  334,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  359,  360,  361,\n  362,  363,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n  372,   -1,   -1,   -1,   -1,   -1,  378,  379,  380,  381,\n   -1,   -1,   -1,  385,   -1,  387,   -1,   -1,   -1,   -1,\n   -1,  393,  394,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  263,   -1,  265,   -1,  267,  418,  419,  270,  421,\n  272,  273,   -1,  275,   -1,  277,   -1,  279,   -1,  281,\n  282,  283,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,\n   -1,  293,   -1,  295,  296,   -1,   -1,   -1,  300,   -1,\n   -1,   -1,  304,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,  315,  316,   -1,  318,   -1,   -1,   -1,\n  322,  323,   -1,   -1,   -1,   -1,   -1,   -1,  330,  331,\n  264,  265,  334,  267,   -1,  337,  270,  271,   -1,   -1,\n  342,  275,  276,  277,   -1,  279,   -1,   -1,   -1,   -1,\n   -1,  285,   -1,   -1,  288,   -1,   -1,   -1,   -1,   -1,\n   -1,  295,   -1,  365,  366,   -1,  300,   -1,  302,  303,\n  304,   -1,   -1,   -1,   -1,   -1,  378,   -1,   -1,   -1,\n   -1,   -1,  316,   -1,  318,  319,   -1,   -1,  322,   -1,\n   -1,  325,   -1,  327,   -1,  329,  330,  331,  332,   -1,\n  334,   -1,   -1,  337,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,  419,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  359,  360,  361,  362,  363,\n   -1,   -1,   -1,   -1,   -1,  265,   -1,  267,  372,   -1,\n  270,   -1,  272,  273,   -1,  275,   -1,  277,   -1,  279,\n   -1,  281,  282,  283,   -1,   -1,   -1,  287,  288,   -1,\n   -1,   -1,   -1,  293,   -1,  295,  296,   -1,   -1,   -1,\n  300,   -1,   -1,   -1,  304,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,  418,  419,  316,   -1,  318,   -1,\n   -1,   -1,  322,  323,   -1,   -1,   -1,   -1,   -1,   -1,\n  330,  331,   -1,  265,  334,  267,   -1,  337,  270,   -1,\n   -1,  273,  342,  275,   -1,  277,   -1,  279,   -1,  281,\n  282,  283,   -1,   -1,   -1,  287,  288,   -1,   -1,   -1,\n   -1,  293,   -1,  295,   -1,  265,   -1,  267,  300,   -1,\n  270,   -1,  304,   -1,   -1,  275,   -1,   -1,  378,  279,\n   -1,   -1,   -1,   -1,  316,   -1,  318,   -1,  288,   -1,\n  322,   -1,   -1,   -1,   -1,  295,   -1,   -1,  330,  331,\n  300,   -1,  334,   -1,  304,  337,  306,   -1,  308,   -1,\n  342,   -1,   -1,  313,   -1,   -1,  316,   -1,  318,  419,\n   -1,   -1,  322,   -1,   -1,  325,   -1,   -1,   -1,   -1,\n  330,  331,   -1,  265,  334,  267,   -1,  337,  270,   -1,\n   -1,   -1,   -1,  275,   -1,   -1,  378,  279,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,  288,   -1,   -1,   -1,\n   -1,   -1,   -1,  295,   -1,  265,   -1,  267,  300,   -1,\n  270,   -1,  304,  373,  306,  275,  308,   -1,   -1,  279,\n   -1,  313,   -1,   -1,  316,   -1,  318,  419,  288,   -1,\n  322,   -1,   -1,  325,   -1,  295,   -1,   -1,  330,  331,\n  300,   -1,  334,   -1,  304,  337,  306,   -1,   -1,   -1,\n   -1,   -1,   -1,  313,   -1,   -1,  316,   -1,  318,  419,\n   -1,   -1,  322,   -1,   -1,  325,   -1,   -1,   -1,   -1,\n  330,  331,   -1,   -1,  334,   -1,   -1,  337,  265,  371,\n  267,   -1,   -1,  270,   -1,   -1,   -1,   -1,  275,   -1,\n   -1,   -1,  279,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,  288,   -1,  363,   -1,   -1,   -1,   -1,  295,   -1,\n  265,   -1,  267,  300,   -1,  270,   -1,  304,   -1,  306,\n  275,  308,   -1,   -1,  279,   -1,  313,  419,   -1,  316,\n   -1,  318,   -1,  288,   -1,  322,   -1,   -1,  325,   -1,\n  295,   -1,   -1,  330,  331,  300,   -1,  334,   -1,  304,\n  337,  306,   -1,  308,   -1,  265,   -1,  267,  313,  419,\n  270,  316,   -1,  318,   -1,  275,   -1,  322,   -1,  279,\n  325,   -1,   -1,  283,   -1,  330,  331,   -1,  288,  334,\n   -1,   -1,  337,  293,   -1,  295,   -1,  265,   -1,  267,\n  300,   -1,  270,   -1,  304,  305,   -1,  275,   -1,   -1,\n   -1,  279,   -1,   -1,   -1,   -1,  316,   -1,  318,   -1,\n  288,   -1,  322,   -1,   -1,   -1,   -1,  295,   -1,   -1,\n  330,  331,  300,   -1,  334,   -1,  304,  337,   -1,   -1,\n   -1,  261,  419,   -1,   -1,   -1,   -1,   -1,  316,   -1,\n  318,   -1,  272,   -1,  322,   -1,   -1,  277,   -1,   -1,\n   -1,  281,  330,  331,  284,   -1,  334,   -1,   -1,  337,\n   -1,   -1,   -1,   -1,  419,   -1,  296,  297,   -1,   -1,\n   -1,  301,  302,   -1,   -1,   -1,   -1,  307,   -1,  309,\n  310,  311,  312,   -1,   -1,  363,   -1,  317,   -1,   -1,\n   -1,  321,   -1,  323,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,  261,  333,   -1,  335,  336,   -1,  338,  419,\n   -1,   -1,  342,  272,   -1,   -1,   -1,   -1,  277,   -1,\n   -1,   -1,  281,   -1,   -1,  284,   -1,   -1,   -1,   -1,\n   -1,   -1,  362,   -1,   -1,   -1,   -1,  296,  297,  369,\n  370,  419,  301,  302,  261,   -1,   -1,   -1,  307,   -1,\n  309,  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,\n   -1,   -1,  321,   -1,  323,   -1,   -1,  284,   -1,   -1,\n   -1,   -1,   -1,   -1,  333,   -1,   -1,  336,   -1,  338,\n  297,   -1,  261,  342,  263,  302,   -1,   -1,   -1,   -1,\n  307,   -1,  309,  310,  311,  312,   -1,   -1,  315,   -1,\n  317,   -1,   -1,  362,  321,  284,   -1,   -1,   -1,   -1,\n  369,  370,   -1,   -1,   -1,   -1,  333,   -1,  297,  336,\n   -1,  338,   -1,  302,   -1,   -1,   -1,   -1,  307,   -1,\n  309,  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,\n   -1,   -1,  321,   -1,   -1,  362,   -1,   -1,   -1,   -1,\n   -1,   -1,  369,  370,  333,   -1,   -1,  336,  261,  338,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  272,\n   -1,   -1,   -1,   -1,  277,   -1,   -1,   -1,  281,   -1,\n   -1,  284,   -1,  362,   -1,   -1,   -1,   -1,   -1,   -1,\n  369,  370,   -1,  296,  297,   -1,   -1,   -1,  301,  302,\n   -1,  261,   -1,   -1,  307,   -1,  309,  310,  311,  312,\n   -1,   -1,  272,   -1,  317,   -1,   -1,  277,  321,   -1,\n  323,  281,   -1,   -1,  284,   -1,   -1,   -1,   -1,   -1,\n  333,   -1,   -1,  336,   -1,  338,  296,  297,   -1,  342,\n   -1,  301,  302,   -1,  261,   -1,   -1,  307,   -1,  309,\n  310,  311,  312,   -1,   -1,   -1,   -1,  317,   -1,  362,\n   -1,  321,   -1,  323,   -1,   -1,  369,  284,   -1,   -1,\n   -1,   -1,   -1,  333,   -1,   -1,  336,   -1,  338,   -1,\n  297,   -1,  342,   -1,  261,  302,   -1,   -1,   -1,   -1,\n  307,   -1,  309,  310,  311,  312,   -1,   -1,   -1,   -1,\n  317,   -1,  362,   -1,  321,   -1,   -1,  284,   -1,  369,\n   -1,   -1,   -1,   -1,   -1,   -1,  333,   -1,   -1,  336,\n  297,  338,   -1,   -1,  261,  302,   -1,   -1,   -1,   -1,\n  307,   -1,  309,  310,  311,  312,   -1,   -1,   -1,   -1,\n  317,   -1,   -1,   -1,  321,  362,   -1,  284,  365,  366,\n   -1,   -1,  369,   -1,   -1,   -1,  333,   -1,   -1,  336,\n  297,  338,   -1,   -1,  261,  302,  263,   -1,   -1,   -1,\n  307,   -1,  309,  310,  311,  312,   -1,   -1,  315,   -1,\n  317,   -1,   -1,   -1,  321,  362,   -1,  284,  365,  366,\n   -1,   -1,  369,   -1,  261,   -1,  333,   -1,   -1,  336,\n  297,  338,   -1,   -1,   -1,  302,   -1,   -1,   -1,   -1,\n  307,   -1,  309,  310,  311,  312,   -1,  284,   -1,   -1,\n  317,   -1,   -1,   -1,  321,  362,   -1,   -1,   -1,   -1,\n  297,   -1,  369,   -1,  261,  302,  333,   -1,   -1,  336,\n  307,  338,  309,  310,  311,  312,   -1,   -1,   -1,   -1,\n  317,   -1,   -1,   -1,  321,   -1,   -1,  284,   -1,   -1,\n   -1,   -1,   -1,   -1,  261,  362,  333,   -1,   -1,  336,\n  297,  338,  369,   -1,  301,  302,   -1,   -1,   -1,   -1,\n  307,   -1,  309,  310,  311,  312,   -1,  284,   -1,   -1,\n  317,   -1,   -1,   -1,  321,  362,   -1,   -1,  365,  366,\n  297,   -1,   -1,   -1,   -1,  302,  333,   -1,   -1,  336,\n  307,  338,  309,  310,  311,  312,   -1,   -1,   -1,   -1,\n  317,   -1,   -1,   -1,  321,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  362,  333,   -1,   -1,  336,\n   -1,  338,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n   -1,   -1,   -1,   -1,   -1,  362,\n  };\n\n#line 7338 \"cs-parser.jay\"\n\n// <summary>\n//  A class used to hold info about an operator declarator\n// </summary>\nclass OperatorDeclaration {\n\tpublic readonly Operator.OpType optype;\n\tpublic readonly FullNamedExpression ret_type;\n\tpublic readonly Location location;\n\n\tpublic OperatorDeclaration (Operator.OpType op, FullNamedExpression ret_type, Location location)\n\t{\n\t\toptype = op;\n\t\tthis.ret_type = ret_type;\n\t\tthis.location = location;\n\t}\n}\n\nvoid Error_ExpectingTypeName (Expression expr)\n{\n\tif (expr is Invocation){\n\t\treport.Error (1002, expr.Location, \"Expecting `;'\");\n\t} else {\n\t\texpr.Error_InvalidExpressionStatement (report);\n\t}\n}\n\nvoid Error_ParameterModifierNotValid (string modifier, Location loc)\n{\n\treport.Error (631, loc, \"The parameter modifier `{0}' is not valid in this context\",\n\t\t\t              modifier);\n}\n\nvoid Error_DuplicateParameterModifier (Location loc, Parameter.Modifier mod)\n{\n\treport.Error (1107, loc, \"Duplicate parameter modifier `{0}'\",\n  \t\tParameter.GetModifierSignature (mod));\n}\n\nvoid Error_TypeExpected (Location loc)\n{\n\treport.Error (1031, loc, \"Type expected\");\n}\n\nvoid Error_UnsafeCodeNotAllowed (Location loc)\n{\n\treport.Error (227, loc, \"Unsafe code requires the `unsafe' command line option to be specified\");\n}\n\nvoid Warning_EmptyStatement (Location loc)\n{\n\treport.Warning (642, 3, loc, \"Possible mistaken empty statement\");\n}\n\nvoid Error_NamedArgumentExpected (NamedArgument a)\n{\n\treport.Error (1738, a.Location, \"Named arguments must appear after the positional arguments\");\n}\n\nvoid Error_MissingInitializer (Location loc)\n{\n\treport.Error (210, loc, \"You must provide an initializer in a fixed or using statement declaration\");\n}\n\nobject Error_AwaitAsIdentifier (object token)\n{\n\tif (async_block) {\n\t\treport.Error (4003, GetLocation (token), \"`await' cannot be used as an identifier within an async method or lambda expression\");\n\t\treturn new LocatedToken (\"await\", GetLocation (token));\n\t}\n\n\treturn token;\n}\n\nvoid push_current_container (TypeDefinition tc, object partial_token)\n{\n\tif (module.Evaluator != null){\n\t\ttc.Definition.Modifiers = tc.ModFlags = (tc.ModFlags & ~Modifiers.AccessibilityMask) | Modifiers.PUBLIC;\n\t\tif (undo == null)\n\t\t\tundo = new Undo ();\n\n\t\tundo.AddTypeContainer (current_container, tc);\n\t}\n\t\n\tif (partial_token != null)\n\t\tcurrent_container.AddPartial (tc);\n\telse\n\t\tcurrent_container.AddTypeContainer (tc);\n\t\t\n\t++lexer.parsing_declaration;\n\tcurrent_container = tc;\n\tcurrent_type = tc;\n}\n\nTypeContainer pop_current_class ()\n{\n\tvar retval = current_container;\n\n\tcurrent_container = current_container.Parent;\n\tcurrent_type = current_type.Parent as TypeDefinition;\n\n\treturn retval;\n}\n\n[System.Diagnostics.Conditional (\"FULL_AST\")]\nvoid StoreModifierLocation (object token, Location loc)\n{\n\tif (lbag == null)\n\t\treturn;\n\n\tif (mod_locations == null)\n  \t\tmod_locations = new List<Tuple<Modifiers, Location>> ();\n\n\tmod_locations.Add (Tuple.Create ((Modifiers) token, loc));\n}\n\nList<Tuple<Modifiers, Location>> GetModifierLocations ()\n{\n\tvar result = mod_locations;\n\tmod_locations = null;\n\treturn result;\n}\n\n[System.Diagnostics.Conditional (\"FULL_AST\")]\nvoid PushLocation (Location loc)\n{\n\tif (location_stack == null)\n\t\tlocation_stack = new Stack<Location> ();\n\n\tlocation_stack.Push (loc);\n}\n\nLocation PopLocation ()\n{\n\tif (location_stack == null)\n\t\treturn Location.Null;\n\n\treturn location_stack.Pop ();\n}\n\nstring CheckAttributeTarget (int token, string a, Location l)\n{\n\tswitch (a) {\n\tcase \"assembly\" : case \"module\" : case \"field\" : case \"method\" : case \"param\" : case \"property\" : case \"type\" :\n\t\t\treturn a;\n\t}\n\n\tif (!Tokenizer.IsValidIdentifier (a)) {\n\t\tError_SyntaxError (token);\n\t} else {\n\t\treport.Warning (658, 1, l,\n\t\t\t \"`{0}' is invalid attribute target. All attributes in this attribute section will be ignored\", a);\n\t}\n\n\treturn string.Empty;\n}\n\nstatic bool IsUnaryOperator (Operator.OpType op)\n{\n\tswitch (op) {\n\t\t\n\tcase Operator.OpType.LogicalNot: \n\tcase Operator.OpType.OnesComplement: \n\tcase Operator.OpType.Increment:\n\tcase Operator.OpType.Decrement:\n\tcase Operator.OpType.True: \n\tcase Operator.OpType.False: \n\tcase Operator.OpType.UnaryPlus: \n\tcase Operator.OpType.UnaryNegation:\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nvoid syntax_error (Location l, string msg)\n{\n\treport.Error (1003, l, \"Syntax error, \" + msg);\n}\n\nTokenizer lexer;\n\npublic Tokenizer Lexer {\n\tget {\n\t\treturn lexer;\n\t}\n}\t\t   \n\npublic CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, ParserSession session)\n\t: this (reader, file, file.Compiler.Report, session)\n{\n}\n\npublic CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, Report report, ParserSession session)\n{\n\tthis.file = file;\n\tcurrent_container = current_namespace = file;\n\t\n\tthis.module = file.Module;\n\tthis.compiler = file.Compiler;\n\tthis.settings = compiler.Settings;\n\tthis.report = report;\n\t\n\tlang_version = settings.Version;\n\tyacc_verbose_flag = settings.VerboseParserFlag;\n\tdoc_support = settings.DocumentationFile != null;\n\tlexer = new Tokenizer (reader, file, session, report);\n\toob_stack = new Stack<object> ();\n\tlbag = session.LocationsBag;\n\tuse_global_stacks = session.UseJayGlobalArrays;\n\tparameters_bucket = session.ParametersStack;\n}\n\npublic void parse ()\n{\n\teof_token = Token.EOF;\n\t\n\ttry {\n\t\tif (yacc_verbose_flag > 1)\n\t\t\tyyparse (lexer, new yydebug.yyDebugSimple ());\n\t\telse\n\t\t\tyyparse (lexer);\n\t\t\t\n\t\tTokenizer tokenizer = lexer as Tokenizer;\n\t\ttokenizer.cleanup ();\t\t\n\t} catch (Exception e){\n\t  \tif (e is yyParser.yyUnexpectedEof) {\n\t\t\tError_SyntaxError (yyToken);\n\t\t\tUnexpectedEOF = true;\n\t\t\treturn;\n\t\t}\n\t\t\t\n\t\tif (e is yyParser.yyException) {\n\t\t\tif (report.Errors == 0)\n\t\t\t\treport.Error (-25, lexer.Location, \"Parsing error\");\n\t\t} else {\n\t\t\t// Used by compiler-tester to test internal errors\n\t\t\tif (yacc_verbose_flag > 0 || e is FatalException)\n\t\t\t\tthrow;\n\t\t\n\t\t\treport.Error (589, lexer.Location, \"Internal compiler error during parsing\" + e);\n\t\t}\n\t}\n}\n\nvoid CheckToken (int error, int yyToken, string msg, Location loc)\n{\n\tif (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD)\n\t\treport.Error (error, loc, \"{0}: `{1}' is a keyword\", msg, GetTokenName (yyToken));\n\telse\n\t\treport.Error (error, loc, msg);\n}\n\nstring ConsumeStoredComment ()\n{\n\tstring s = tmpComment;\n\ttmpComment = null;\n\tLexer.doc_state = XmlCommentState.Allowed;\n\treturn s;\n}\n\nvoid FeatureIsNotAvailable (Location loc, string feature)\n{\n\treport.FeatureIsNotAvailable (compiler, loc, feature);\n}\n\nLocation GetLocation (object obj)\n{\n\tvar lt = obj as LocatedToken;\n\tif (lt != null)\n\t\treturn lt.Location;\n\t\t\n\tvar mn = obj as MemberName;\n\tif (mn != null)\n\t\treturn mn.Location;\n\t\t\n\tvar expr = obj as Expression;\n\tif (expr != null)\n\t\treturn expr.Location;\n\n\treturn lexer.Location;\n}\n\nvoid start_block (Location loc)\n{\n\tif (current_block == null) {\n\t\tcurrent_block = new ToplevelBlock (compiler, current_local_parameters, loc);\n\t\tparsing_anonymous_method = false;\n\t} else if (parsing_anonymous_method) {\n\t\tcurrent_block = new ParametersBlock (current_block, current_local_parameters, loc);\n\t\tparsing_anonymous_method = false;\n\t} else {\n\t\tcurrent_block = new ExplicitBlock (current_block, loc, Location.Null);\n\t}\n}\n\nBlock\nend_block (Location loc)\n{\n\tBlock retval = current_block.Explicit;\n\tretval.SetEndLocation (loc);\n\tcurrent_block = retval.Parent;\n\treturn retval;\n}\n\nvoid start_anonymous (bool isLambda, ParametersCompiled parameters, bool isAsync, Location loc)\n{\n\toob_stack.Push (current_anonymous_method);\n\toob_stack.Push (current_local_parameters);\n\toob_stack.Push (current_variable);\n\toob_stack.Push (async_block);\n\n\tcurrent_local_parameters = parameters;\n\tif (isLambda) {\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (loc, \"lambda expressions\");\n\n\t\tcurrent_anonymous_method = new LambdaExpression (loc);\n\t} else {\n\t\tif (lang_version == LanguageVersion.ISO_1)\n\t\t\tFeatureIsNotAvailable (loc, \"anonymous methods\");\n\t\t\t\n\t\tcurrent_anonymous_method = new AnonymousMethodExpression (loc);\n\t}\n\tcurrent_anonymous_method.IsAsync = isAsync;\n\t\n\tasync_block = isAsync;\n\t// Force the next block to be created as a ToplevelBlock\n\tparsing_anonymous_method = true;\n}\n\n/*\n * Completes the anonymous method processing, if lambda_expr is null, this\n * means that we have a Statement instead of an Expression embedded \n */\nAnonymousMethodExpression end_anonymous (ParametersBlock anon_block)\n{\n\tAnonymousMethodExpression retval;\n\n\tif (async_block)\n\t\tanon_block.IsAsync = true;\n\n\tcurrent_anonymous_method.Block = anon_block;\n\tretval = current_anonymous_method;\n\n\tasync_block = (bool) oob_stack.Pop ();\n\tcurrent_variable = (BlockVariable) oob_stack.Pop ();\n\tcurrent_local_parameters = (ParametersCompiled) oob_stack.Pop ();\n\tcurrent_anonymous_method = (AnonymousMethodExpression) oob_stack.Pop ();\n\n\treturn retval;\n}\n\nvoid Error_SyntaxError (int token)\n{\n\tError_SyntaxError (0, token);\n}\n\nvoid Error_SyntaxError (int error_code, int token)\n{\n\tError_SyntaxError (error_code, token, \"Unexpected symbol\");\n}\n\nvoid Error_SyntaxError (int error_code, int token, string msg)\n{\n\tLexer.CompleteOnEOF = false;\n\n\t// An error message has been reported by tokenizer\n\tif (token == Token.ERROR)\n\t\treturn;\n\t\n\t// Avoid duplicit error message after unterminated string literals\n\tif (token == Token.LITERAL && lexer.Location.Column == 0)\n\t\treturn;\n\n\tstring symbol = GetSymbolName (token);\n\tstring expecting = GetExpecting ();\n\tvar loc = lexer.Location - symbol.Length;\n\t\n\tif (error_code == 0) {\n\t\tif (expecting == \"`identifier'\") {\n\t\t\tif (token > Token.FIRST_KEYWORD && token < Token.LAST_KEYWORD) {\n\t\t\t\treport.Error (1041, loc, \"Identifier expected, `{0}' is a keyword\", symbol);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\terror_code = 1001;\n\t\t\texpecting = \"identifier\";\n\t\t} else if (expecting == \"`)'\") {\n\t\t\terror_code = 1026;\n\t\t} else {\n\t\t\terror_code = 1525;\n\t\t}\n\t}\n\t\n\tif (string.IsNullOrEmpty (expecting))\n\t\treport.Error (error_code, loc, \"{1} `{0}'\", symbol, msg);\n\telse\n\t\treport.Error (error_code, loc, \"{2} `{0}', expecting {1}\", symbol, expecting, msg);\t  \n}\n\nstring GetExpecting ()\n{\n\tint [] tokens = yyExpectingTokens (yyExpectingState);\n\tvar names = new List<string> (tokens.Length);\n\tbool has_type = false;\n\tbool has_identifier = false;\n\tfor (int i = 0; i < tokens.Length; i++){\n\t\tint token = tokens [i];\n\t\thas_identifier |= token == Token.IDENTIFIER;\n\t\t\n\t\tstring name = GetTokenName (token);\n\t\tif (name == \"<internal>\")\n\t\t\tcontinue;\n\t\t\t\n\t\thas_type |= name == \"type\";\n\t\tif (names.Contains (name))\n\t\t\tcontinue;\n\t\t\n\t\tnames.Add (name);\n\t}\n\n\t//\n\t// Too many tokens to enumerate\n\t//\n\tif (names.Count > 8)\n\t\treturn null;\n\n\tif (has_type && has_identifier)\n\t\tnames.Remove (\"identifier\");\n\n\tif (names.Count == 1)\n\t\treturn \"`\" + GetTokenName (tokens [0]) + \"'\";\n\t\n\tStringBuilder sb = new StringBuilder ();\n\tnames.Sort ();\n\tint count = names.Count;\n\tfor (int i = 0; i < count; i++){\n\t\tbool last = i + 1 == count;\n\t\tif (last)\n\t\t\tsb.Append (\"or \");\n\t\tsb.Append ('`');\n\t\tsb.Append (names [i]);\n\t\tsb.Append (last ? \"'\" : count < 3 ? \"' \" : \"', \");\n\t}\n\treturn sb.ToString ();\n}\n\n\nstring GetSymbolName (int token)\n{\n\tswitch (token){\n\tcase Token.LITERAL:\n\t\treturn ((Constant)lexer.Value).GetValue ().ToString ();\n\tcase Token.IDENTIFIER:\n\t\treturn ((LocatedToken)lexer.Value).Value;\n\n\tcase Token.BOOL:\n\t\treturn \"bool\";\n\tcase Token.BYTE:\n\t\treturn \"byte\";\n\tcase Token.CHAR:\n\t\treturn \"char\";\n\tcase Token.VOID:\n\t\treturn \"void\";\n\tcase Token.DECIMAL:\n\t\treturn \"decimal\";\n\tcase Token.DOUBLE:\n\t\treturn \"double\";\n\tcase Token.FLOAT:\n\t\treturn \"float\";\n\tcase Token.INT:\n\t\treturn \"int\";\n\tcase Token.LONG:\n\t\treturn \"long\";\n\tcase Token.SBYTE:\n\t\treturn \"sbyte\";\n\tcase Token.SHORT:\n\t\treturn \"short\";\n\tcase Token.STRING:\n\t\treturn \"string\";\n\tcase Token.UINT:\n\t\treturn \"uint\";\n\tcase Token.ULONG:\n\t\treturn \"ulong\";\n\tcase Token.USHORT:\n\t\treturn \"ushort\";\n\tcase Token.OBJECT:\n\t\treturn \"object\";\n\t\t\n\tcase Token.PLUS:\n\t\treturn \"+\";\n\tcase Token.UMINUS:\n\tcase Token.MINUS:\n\t\treturn \"-\";\n\tcase Token.BANG:\n\t\treturn \"!\";\n\tcase Token.BITWISE_AND:\n\t\treturn \"&\";\n\tcase Token.BITWISE_OR:\n\t\treturn \"|\";\n\tcase Token.STAR:\n\t\treturn \"*\";\n\tcase Token.PERCENT:\n\t\treturn \"%\";\n\tcase Token.DIV:\n\t\treturn \"/\";\n\tcase Token.CARRET:\n\t\treturn \"^\";\n\tcase Token.OP_INC:\n\t\treturn \"++\";\n\tcase Token.OP_DEC:\n\t\treturn \"--\";\n\tcase Token.OP_SHIFT_LEFT:\n\t\treturn \"<<\";\n\tcase Token.OP_SHIFT_RIGHT:\n\t\treturn \">>\";\n\tcase Token.OP_LT:\n\t\treturn \"<\";\n\tcase Token.OP_GT:\n\t\treturn \">\";\n\tcase Token.OP_LE:\n\t\treturn \"<=\";\n\tcase Token.OP_GE:\n\t\treturn \">=\";\n\tcase Token.OP_EQ:\n\t\treturn \"==\";\n\tcase Token.OP_NE:\n\t\treturn \"!=\";\n\tcase Token.OP_AND:\n\t\treturn \"&&\";\n\tcase Token.OP_OR:\n\t\treturn \"||\";\n\tcase Token.OP_PTR:\n\t\treturn \"->\";\n\tcase Token.OP_COALESCING:\t\n\t\treturn \"??\";\n\tcase Token.OP_MULT_ASSIGN:\n\t\treturn \"*=\";\n\tcase Token.OP_DIV_ASSIGN:\n\t\treturn \"/=\";\n\tcase Token.OP_MOD_ASSIGN:\n\t\treturn \"%=\";\n\tcase Token.OP_ADD_ASSIGN:\n\t\treturn \"+=\";\n\tcase Token.OP_SUB_ASSIGN:\n\t\treturn \"-=\";\n\tcase Token.OP_SHIFT_LEFT_ASSIGN:\n\t\treturn \"<<=\";\n\tcase Token.OP_SHIFT_RIGHT_ASSIGN:\n\t\treturn \">>=\";\n\tcase Token.OP_AND_ASSIGN:\n\t\treturn \"&=\";\n\tcase Token.OP_XOR_ASSIGN:\n\t\treturn \"^=\";\n\tcase Token.OP_OR_ASSIGN:\n\t\treturn \"|=\";\n\t}\n\n\treturn GetTokenName (token);\n}\n\nstatic string GetTokenName (int token)\n{\n\tswitch (token){\n\tcase Token.ABSTRACT:\n\t\treturn \"abstract\";\n\tcase Token.AS:\n\t\treturn \"as\";\n\tcase Token.ADD:\n\t\treturn \"add\";\n\tcase Token.ASYNC:\n\t\treturn \"async\";\n\tcase Token.BASE:\n\t\treturn \"base\";\n\tcase Token.BREAK:\n\t\treturn \"break\";\n\tcase Token.CASE:\n\t\treturn \"case\";\n\tcase Token.CATCH:\n\t\treturn \"catch\";\n\tcase Token.CHECKED:\n\t\treturn \"checked\";\n\tcase Token.CLASS:\n\t\treturn \"class\";\n\tcase Token.CONST:\n\t\treturn \"const\";\n\tcase Token.CONTINUE:\n\t\treturn \"continue\";\n\tcase Token.DEFAULT:\n\t\treturn \"default\";\n\tcase Token.DELEGATE:\n\t\treturn \"delegate\";\n\tcase Token.DO:\n\t\treturn \"do\";\n\tcase Token.ELSE:\n\t\treturn \"else\";\n\tcase Token.ENUM:\n\t\treturn \"enum\";\n\tcase Token.EVENT:\n\t\treturn \"event\";\n\tcase Token.EXPLICIT:\n\t\treturn \"explicit\";\n\tcase Token.EXTERN:\n\tcase Token.EXTERN_ALIAS:\n\t\treturn \"extern\";\n\tcase Token.FALSE:\n\t\treturn \"false\";\n\tcase Token.FINALLY:\n\t\treturn \"finally\";\n\tcase Token.FIXED:\n\t\treturn \"fixed\";\n\tcase Token.FOR:\n\t\treturn \"for\";\n\tcase Token.FOREACH:\n\t\treturn \"foreach\";\n\tcase Token.GOTO:\n\t\treturn \"goto\";\n\tcase Token.IF:\n\t\treturn \"if\";\n\tcase Token.IMPLICIT:\n\t\treturn \"implicit\";\n\tcase Token.IN:\n\t\treturn \"in\";\n\tcase Token.INTERFACE:\n\t\treturn \"interface\";\n\tcase Token.INTERNAL:\n\t\treturn \"internal\";\n\tcase Token.IS:\n\t\treturn \"is\";\n\tcase Token.LOCK:\n\t\treturn \"lock\";\n\tcase Token.NAMESPACE:\n\t\treturn \"namespace\";\n\tcase Token.NEW:\n\t\treturn \"new\";\n\tcase Token.NULL:\n\t\treturn \"null\";\n\tcase Token.OPERATOR:\n\t\treturn \"operator\";\n\tcase Token.OUT:\n\t\treturn \"out\";\n\tcase Token.OVERRIDE:\n\t\treturn \"override\";\n\tcase Token.PARAMS:\n\t\treturn \"params\";\n\tcase Token.PRIVATE:\n\t\treturn \"private\";\n\tcase Token.PROTECTED:\n\t\treturn \"protected\";\n\tcase Token.PUBLIC:\n\t\treturn \"public\";\n\tcase Token.READONLY:\n\t\treturn \"readonly\";\n\tcase Token.REF:\n\t\treturn \"ref\";\n\tcase Token.RETURN:\n\t\treturn \"return\";\n\tcase Token.REMOVE:\n\t\treturn \"remove\";\n\tcase Token.SEALED:\n\t\treturn \"sealed\";\n\tcase Token.SIZEOF:\n\t\treturn \"sizeof\";\n\tcase Token.STACKALLOC:\n\t\treturn \"stackalloc\";\n\tcase Token.STATIC:\n\t\treturn \"static\";\n\tcase Token.STRUCT:\n\t\treturn \"struct\";\n\tcase Token.SWITCH:\n\t\treturn \"switch\";\n\tcase Token.THIS:\n\t\treturn \"this\";\n\tcase Token.THROW:\n\t\treturn \"throw\";\n\tcase Token.TRUE:\n\t\treturn \"true\";\n\tcase Token.TRY:\n\t\treturn \"try\";\n\tcase Token.TYPEOF:\n\t\treturn \"typeof\";\n\tcase Token.UNCHECKED:\n\t\treturn \"unchecked\";\n\tcase Token.UNSAFE:\n\t\treturn \"unsafe\";\n\tcase Token.USING:\n\t\treturn \"using\";\n\tcase Token.VIRTUAL:\n\t\treturn \"virtual\";\n\tcase Token.VOLATILE:\n\t\treturn \"volatile\";\n\tcase Token.WHERE:\n\t\treturn \"where\";\n\tcase Token.WHILE:\n\t\treturn \"while\";\n\tcase Token.ARGLIST:\n\t\treturn \"__arglist\";\n\tcase Token.REFVALUE:\n\t\treturn \"__refvalue\";\n\tcase Token.REFTYPE:\n\t\treturn \"__reftype\";\n\tcase Token.MAKEREF:\n\t\treturn \"__makeref\";\n\tcase Token.PARTIAL:\n\t\treturn \"partial\";\n\tcase Token.ARROW:\n\t\treturn \"=>\";\n\tcase Token.FROM:\n\tcase Token.FROM_FIRST:\n\t\treturn \"from\";\n\tcase Token.JOIN:\n\t\treturn \"join\";\n\tcase Token.ON:\n\t\treturn \"on\";\n\tcase Token.EQUALS:\n\t\treturn \"equals\";\n\tcase Token.SELECT:\n\t\treturn \"select\";\n\tcase Token.GROUP:\n\t\treturn \"group\";\n\tcase Token.BY:\n\t\treturn \"by\";\n\tcase Token.LET:\n\t\treturn \"let\";\n\tcase Token.ORDERBY:\n\t\treturn \"orderby\";\n\tcase Token.ASCENDING:\n\t\treturn \"ascending\";\n\tcase Token.DESCENDING:\n\t\treturn \"descending\";\n\tcase Token.INTO:\n\t\treturn \"into\";\n\tcase Token.GET:\n\t\treturn \"get\";\n\tcase Token.SET:\n\t\treturn \"set\";\n\tcase Token.OPEN_BRACE:\n\t\treturn \"{\";\n\tcase Token.CLOSE_BRACE:\n\t\treturn \"}\";\n\tcase Token.OPEN_BRACKET:\n\tcase Token.OPEN_BRACKET_EXPR:\n\t\treturn \"[\";\n\tcase Token.CLOSE_BRACKET:\n\t\treturn \"]\";\n\tcase Token.OPEN_PARENS_CAST:\n\tcase Token.OPEN_PARENS_LAMBDA:\n\tcase Token.OPEN_PARENS:\n\t\treturn \"(\";\n\tcase Token.CLOSE_PARENS:\n\t\treturn \")\";\n\tcase Token.DOT:\n\t\treturn \".\";\n\tcase Token.COMMA:\n\t\treturn \",\";\n\tcase Token.DEFAULT_COLON:\n\t\treturn \"default:\";\n\tcase Token.COLON:\n\t\treturn \":\";\n\tcase Token.SEMICOLON:\n\t\treturn \";\";\n\tcase Token.TILDE:\n\t\treturn \"~\";\n\t\t\n\tcase Token.PLUS:\n\tcase Token.UMINUS:\n\tcase Token.MINUS:\n\tcase Token.BANG:\n\tcase Token.OP_LT:\n\tcase Token.OP_GT:\n\tcase Token.BITWISE_AND:\n\tcase Token.BITWISE_OR:\n\tcase Token.STAR:\n\tcase Token.PERCENT:\n\tcase Token.DIV:\n\tcase Token.CARRET:\n\tcase Token.OP_INC:\n\tcase Token.OP_DEC:\n\tcase Token.OP_SHIFT_LEFT:\n\tcase Token.OP_SHIFT_RIGHT:\n\tcase Token.OP_LE:\n\tcase Token.OP_GE:\n\tcase Token.OP_EQ:\n\tcase Token.OP_NE:\n\tcase Token.OP_AND:\n\tcase Token.OP_OR:\n\tcase Token.OP_PTR:\n\tcase Token.OP_COALESCING:\t\n\tcase Token.OP_MULT_ASSIGN:\n\tcase Token.OP_DIV_ASSIGN:\n\tcase Token.OP_MOD_ASSIGN:\n\tcase Token.OP_ADD_ASSIGN:\n\tcase Token.OP_SUB_ASSIGN:\n\tcase Token.OP_SHIFT_LEFT_ASSIGN:\n\tcase Token.OP_SHIFT_RIGHT_ASSIGN:\n\tcase Token.OP_AND_ASSIGN:\n\tcase Token.OP_XOR_ASSIGN:\n\tcase Token.OP_OR_ASSIGN:\n\t\treturn \"<operator>\";\n\n\tcase Token.BOOL:\n\tcase Token.BYTE:\n\tcase Token.CHAR:\n\tcase Token.VOID:\n\tcase Token.DECIMAL:\n\tcase Token.DOUBLE:\n\tcase Token.FLOAT:\n\tcase Token.INT:\n\tcase Token.LONG:\n\tcase Token.SBYTE:\n\tcase Token.SHORT:\n\tcase Token.STRING:\n\tcase Token.UINT:\n\tcase Token.ULONG:\n\tcase Token.USHORT:\n\tcase Token.OBJECT:\n\t\treturn \"type\";\n\t\n\tcase Token.ASSIGN:\n\t\treturn \"=\";\n\tcase Token.OP_GENERICS_LT:\n\tcase Token.GENERIC_DIMENSION:\n\t\treturn \"<\";\n\tcase Token.OP_GENERICS_GT:\n\t\treturn \">\";\n\tcase Token.INTERR:\n\tcase Token.INTERR_NULLABLE:\n\t\treturn \"?\";\n\tcase Token.DOUBLE_COLON:\n\t\treturn \"::\";\n\tcase Token.LITERAL:\n\t\treturn \"value\";\n\tcase Token.IDENTIFIER:\n\tcase Token.AWAIT:\n\t\treturn \"identifier\";\n\n\tcase Token.EOF:\n\t\treturn \"end-of-file\";\n\n\t\t// All of these are internal.\n\tcase Token.NONE:\n\tcase Token.ERROR:\n\tcase Token.FIRST_KEYWORD:\n\tcase Token.EVAL_COMPILATION_UNIT_PARSER:\n\tcase Token.EVAL_USING_DECLARATIONS_UNIT_PARSER:\n\tcase Token.EVAL_STATEMENT_PARSER:\n\tcase Token.LAST_KEYWORD:\n\tcase Token.GENERATE_COMPLETION:\n\tcase Token.COMPLETE_COMPLETION:\n\t\treturn \"<internal>\";\n\n\t\t// A bit more robust.\n\tdefault:\n\t\treturn yyNames [token];\n        }\n}\n\n/* end end end */\n}\n#line default\nnamespace yydebug {\n        using System;\n\t internal interface yyDebug {\n\t\t void push (int state, Object value);\n\t\t void lex (int state, int token, string name, Object value);\n\t\t void shift (int from, int to, int errorFlag);\n\t\t void pop (int state);\n\t\t void discard (int state, int token, string name, Object value);\n\t\t void reduce (int from, int to, int rule, string text, int len);\n\t\t void shift (int from, int to);\n\t\t void accept (Object value);\n\t\t void error (string message);\n\t\t void reject ();\n\t }\n\t \n\t class yyDebugSimple : yyDebug {\n\t\t void println (string s){\n\t\t\t Console.Error.WriteLine (s);\n\t\t }\n\t\t \n\t\t public void push (int state, Object value) {\n\t\t\t println (\"push\\tstate \"+state+\"\\tvalue \"+value);\n\t\t }\n\t\t \n\t\t public void lex (int state, int token, string name, Object value) {\n\t\t\t println(\"lex\\tstate \"+state+\"\\treading \"+name+\"\\tvalue \"+value);\n\t\t }\n\t\t \n\t\t public void shift (int from, int to, int errorFlag) {\n\t\t\t switch (errorFlag) {\n\t\t\t default:\t\t\t\t// normally\n\t\t\t\t println(\"shift\\tfrom state \"+from+\" to \"+to);\n\t\t\t\t break;\n\t\t\t case 0: case 1: case 2:\t\t// in error recovery\n\t\t\t\t println(\"shift\\tfrom state \"+from+\" to \"+to\n\t\t\t\t\t     +\"\\t\"+errorFlag+\" left to recover\");\n\t\t\t\t break;\n\t\t\t case 3:\t\t\t\t// normally\n\t\t\t\t println(\"shift\\tfrom state \"+from+\" to \"+to+\"\\ton error\");\n\t\t\t\t break;\n\t\t\t }\n\t\t }\n\t\t \n\t\t public void pop (int state) {\n\t\t\t println(\"pop\\tstate \"+state+\"\\ton error\");\n\t\t }\n\t\t \n\t\t public void discard (int state, int token, string name, Object value) {\n\t\t\t println(\"discard\\tstate \"+state+\"\\ttoken \"+name+\"\\tvalue \"+value);\n\t\t }\n\t\t \n\t\t public void reduce (int from, int to, int rule, string text, int len) {\n\t\t\t println(\"reduce\\tstate \"+from+\"\\tuncover \"+to\n\t\t\t\t     +\"\\trule (\"+rule+\") \"+text);\n\t\t }\n\t\t \n\t\t public void shift (int from, int to) {\n\t\t\t println(\"goto\\tfrom state \"+from+\" to \"+to);\n\t\t }\n\t\t \n\t\t public void accept (Object value) {\n\t\t\t println(\"accept\\tvalue \"+value);\n\t\t }\n\t\t \n\t\t public void error (string message) {\n\t\t\t println(\"error\\t\"+message);\n\t\t }\n\t\t \n\t\t public void reject () {\n\t\t\t println(\"reject\");\n\t\t }\n\t\t \n\t }\n}\n// %token constants\n class Token {\n  public const int EOF = 257;\n  public const int NONE = 258;\n  public const int ERROR = 259;\n  public const int FIRST_KEYWORD = 260;\n  public const int ABSTRACT = 261;\n  public const int AS = 262;\n  public const int ADD = 263;\n  public const int BASE = 264;\n  public const int BOOL = 265;\n  public const int BREAK = 266;\n  public const int BYTE = 267;\n  public const int CASE = 268;\n  public const int CATCH = 269;\n  public const int CHAR = 270;\n  public const int CHECKED = 271;\n  public const int CLASS = 272;\n  public const int CONST = 273;\n  public const int CONTINUE = 274;\n  public const int DECIMAL = 275;\n  public const int DEFAULT = 276;\n  public const int DELEGATE = 277;\n  public const int DO = 278;\n  public const int DOUBLE = 279;\n  public const int ELSE = 280;\n  public const int ENUM = 281;\n  public const int EVENT = 282;\n  public const int EXPLICIT = 283;\n  public const int EXTERN = 284;\n  public const int FALSE = 285;\n  public const int FINALLY = 286;\n  public const int FIXED = 287;\n  public const int FLOAT = 288;\n  public const int FOR = 289;\n  public const int FOREACH = 290;\n  public const int GOTO = 291;\n  public const int IF = 292;\n  public const int IMPLICIT = 293;\n  public const int IN = 294;\n  public const int INT = 295;\n  public const int INTERFACE = 296;\n  public const int INTERNAL = 297;\n  public const int IS = 298;\n  public const int LOCK = 299;\n  public const int LONG = 300;\n  public const int NAMESPACE = 301;\n  public const int NEW = 302;\n  public const int NULL = 303;\n  public const int OBJECT = 304;\n  public const int OPERATOR = 305;\n  public const int OUT = 306;\n  public const int OVERRIDE = 307;\n  public const int PARAMS = 308;\n  public const int PRIVATE = 309;\n  public const int PROTECTED = 310;\n  public const int PUBLIC = 311;\n  public const int READONLY = 312;\n  public const int REF = 313;\n  public const int RETURN = 314;\n  public const int REMOVE = 315;\n  public const int SBYTE = 316;\n  public const int SEALED = 317;\n  public const int SHORT = 318;\n  public const int SIZEOF = 319;\n  public const int STACKALLOC = 320;\n  public const int STATIC = 321;\n  public const int STRING = 322;\n  public const int STRUCT = 323;\n  public const int SWITCH = 324;\n  public const int THIS = 325;\n  public const int THROW = 326;\n  public const int TRUE = 327;\n  public const int TRY = 328;\n  public const int TYPEOF = 329;\n  public const int UINT = 330;\n  public const int ULONG = 331;\n  public const int UNCHECKED = 332;\n  public const int UNSAFE = 333;\n  public const int USHORT = 334;\n  public const int USING = 335;\n  public const int VIRTUAL = 336;\n  public const int VOID = 337;\n  public const int VOLATILE = 338;\n  public const int WHERE = 339;\n  public const int WHILE = 340;\n  public const int ARGLIST = 341;\n  public const int PARTIAL = 342;\n  public const int ARROW = 343;\n  public const int FROM = 344;\n  public const int FROM_FIRST = 345;\n  public const int JOIN = 346;\n  public const int ON = 347;\n  public const int EQUALS = 348;\n  public const int SELECT = 349;\n  public const int GROUP = 350;\n  public const int BY = 351;\n  public const int LET = 352;\n  public const int ORDERBY = 353;\n  public const int ASCENDING = 354;\n  public const int DESCENDING = 355;\n  public const int INTO = 356;\n  public const int INTERR_NULLABLE = 357;\n  public const int EXTERN_ALIAS = 358;\n  public const int REFVALUE = 359;\n  public const int REFTYPE = 360;\n  public const int MAKEREF = 361;\n  public const int ASYNC = 362;\n  public const int AWAIT = 363;\n  public const int INTERR_OPERATOR = 364;\n  public const int GET = 365;\n  public const int SET = 366;\n  public const int LAST_KEYWORD = 367;\n  public const int OPEN_BRACE = 368;\n  public const int CLOSE_BRACE = 369;\n  public const int OPEN_BRACKET = 370;\n  public const int CLOSE_BRACKET = 371;\n  public const int OPEN_PARENS = 372;\n  public const int CLOSE_PARENS = 373;\n  public const int DOT = 374;\n  public const int COMMA = 375;\n  public const int COLON = 376;\n  public const int SEMICOLON = 377;\n  public const int TILDE = 378;\n  public const int PLUS = 379;\n  public const int MINUS = 380;\n  public const int BANG = 381;\n  public const int ASSIGN = 382;\n  public const int OP_LT = 383;\n  public const int OP_GT = 384;\n  public const int BITWISE_AND = 385;\n  public const int BITWISE_OR = 386;\n  public const int STAR = 387;\n  public const int PERCENT = 388;\n  public const int DIV = 389;\n  public const int CARRET = 390;\n  public const int INTERR = 391;\n  public const int DOUBLE_COLON = 392;\n  public const int OP_INC = 393;\n  public const int OP_DEC = 394;\n  public const int OP_SHIFT_LEFT = 395;\n  public const int OP_SHIFT_RIGHT = 396;\n  public const int OP_LE = 397;\n  public const int OP_GE = 398;\n  public const int OP_EQ = 399;\n  public const int OP_NE = 400;\n  public const int OP_AND = 401;\n  public const int OP_OR = 402;\n  public const int OP_MULT_ASSIGN = 403;\n  public const int OP_DIV_ASSIGN = 404;\n  public const int OP_MOD_ASSIGN = 405;\n  public const int OP_ADD_ASSIGN = 406;\n  public const int OP_SUB_ASSIGN = 407;\n  public const int OP_SHIFT_LEFT_ASSIGN = 408;\n  public const int OP_SHIFT_RIGHT_ASSIGN = 409;\n  public const int OP_AND_ASSIGN = 410;\n  public const int OP_XOR_ASSIGN = 411;\n  public const int OP_OR_ASSIGN = 412;\n  public const int OP_PTR = 413;\n  public const int OP_COALESCING = 414;\n  public const int OP_GENERICS_LT = 415;\n  public const int OP_GENERICS_LT_DECL = 416;\n  public const int OP_GENERICS_GT = 417;\n  public const int LITERAL = 418;\n  public const int IDENTIFIER = 419;\n  public const int OPEN_PARENS_LAMBDA = 420;\n  public const int OPEN_PARENS_CAST = 421;\n  public const int GENERIC_DIMENSION = 422;\n  public const int DEFAULT_COLON = 423;\n  public const int OPEN_BRACKET_EXPR = 424;\n  public const int EVAL_STATEMENT_PARSER = 425;\n  public const int EVAL_COMPILATION_UNIT_PARSER = 426;\n  public const int EVAL_USING_DECLARATIONS_UNIT_PARSER = 427;\n  public const int DOC_SEE = 428;\n  public const int GENERATE_COMPLETION = 429;\n  public const int COMPLETE_COMPLETION = 430;\n  public const int UMINUS = 431;\n  public const int yyErrorCode = 256;\n }\n namespace yyParser {\n  using System;\n  /** thrown for irrecoverable syntax errors and stack overflow.\n    */\n  internal class yyException : System.Exception {\n    public yyException (string message) : base (message) {\n    }\n  }\n  internal class yyUnexpectedEof : yyException {\n    public yyUnexpectedEof (string message) : base (message) {\n    }\n    public yyUnexpectedEof () : base (\"\") {\n    }\n  }\n\n  /** must be implemented by a scanner object to supply input to the parser.\n    */\n  internal interface yyInput {\n    /** move on to next token.\n        @return false if positioned beyond tokens.\n        @throws IOException on input error.\n      */\n    bool advance (); // throws java.io.IOException;\n    /** classifies current token.\n        Should not be called if advance() returned false.\n        @return current %token or single character.\n      */\n    int token ();\n    /** associated with current token.\n        Should not be called if advance() returned false.\n        @return value for token().\n      */\n    Object value ();\n  }\n }\n} // close outermost namespace, that MUST HAVE BEEN opened in the prolog\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay",
    "content": "%{\n//\n// cs-parser.jay: The Parser for the C# compiler\n//\n// Authors: Miguel de Icaza (miguel@gnome.org)\n//          Ravi Pratap     (ravi@ximian.com)\n//          Marek Safar\t    (marek.safar@gmail.com)\n//\n// Dual Licensed under the terms of the GNU GPL and the MIT X11 license\n//\n// (C) 2001 Ximian, Inc (http://www.ximian.com)\n// (C) 2004-2011 Novell, Inc\n// Copyright 2011-2012 Xamarin Inc.\n//\n\nusing System.Text;\nusing System.IO;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Mono.CSharp\n{\n\t/// <summary>\n\t///    The C# Parser\n\t/// </summary>\n\tpublic class CSharpParser\n\t{\n\t\t[Flags]\n\t\tenum ParameterModifierType\n\t\t{\n\t\t\tRef\t\t= 1 << 1,\n\t\t\tOut\t\t= 1 << 2,\n\t\t\tThis\t= 1 << 3,\n\t\t\tParams\t= 1 << 4,\n\t\t\tArglist\t= 1 << 5,\n\t\t\tDefaultValue = 1 << 6,\n\t\t\t\n\t\t\tAll = Ref | Out | This | Params | Arglist | DefaultValue,\n\t\t\tPrimaryConstructor = Ref | Out | Params | DefaultValue\n\t\t}\n\t\t\n\t\tstatic readonly object ModifierNone = 0;\n\t\n\t\tNamespaceContainer current_namespace;\n\t\tTypeContainer current_container;\n\t\tTypeDefinition current_type;\n\t\tPropertyBase current_property;\n\t\tEventProperty current_event;\n\t\tEventField current_event_field;\n\t\tFieldBase current_field;\n\t\n\t\t/// <summary>\n\t\t///   Current block is used to add statements as we find\n\t\t///   them.  \n\t\t/// </summary>\n\t\tBlock      current_block;\n\t\t\n\t\tBlockVariable current_variable;\n\n\t\tDelegate   current_delegate;\n\t\t\n\t\tAnonymousMethodExpression current_anonymous_method;\n\n\t\t/// <summary>\n\t\t///   This is used by the unary_expression code to resolve\n\t\t///   a name against a parameter.  \n\t\t/// </summary>\n\t\t\n\t\t// FIXME: This is very ugly and it's very hard to reset it correctly\n\t\t// on all places, especially when some parameters are autogenerated.\n\t\tParametersCompiled current_local_parameters;\n\n\t\tbool parsing_anonymous_method;\n\t\t\n\t\tbool async_block;\n\n\t\t///\n\t\t/// An out-of-band stack.\n\t\t///\n\t\tStack<object> oob_stack;\n\n\t\t///\n\t\t/// Controls the verbosity of the errors produced by the parser\n\t\t///\n\t\tint yacc_verbose_flag;\n\n\t\t/// \n\t\t/// Used by the interactive shell, flags whether EOF was reached\n\t\t/// and an error was produced\n\t\t///\n\t\tpublic bool UnexpectedEOF;\n\n\t\t///\n\t\t/// The current file.\n\t\t///\n\t\treadonly CompilationSourceFile file;\n\n\t\t///\n\t\t/// Temporary Xml documentation cache.\n\t\t/// For enum types, we need one more temporary store.\n\t\t///\n\t\tstring tmpComment;\n\t\tstring enumTypeComment;\n\t       \t\t\n\t\t/// Current attribute target\n\t\tstring current_attr_target;\n\t\t\n\t\tParameterModifierType valid_param_mod;\n\t\t\n\t\tbool default_parameter_used;\n\n\t\t/// When using the interactive parser, this holds the\n\t\t/// resulting expression\n\t\tpublic Class InteractiveResult;\n\n\t\t//\n\t\t// Keeps track of global data changes to undo on parser error\n\t\t//\n\t\tpublic Undo undo;\n\n\t\tbool? interactive_async;\n\t\t\n\t\tStack<Linq.QueryBlock> linq_clause_blocks;\n\n\t\tModuleContainer module;\n\t\t\n\t\treadonly CompilerContext compiler;\n\t\treadonly LanguageVersion lang_version;\n\t\treadonly bool doc_support;\n\t\treadonly CompilerSettings settings;\n\t\treadonly Report report;\n\t\t\n\t\t//\n\t\t// Instead of allocating carrier array everytime we\n\t\t// share the bucket for very common constructs which can never\n\t\t// be recursive\n\t\t//\n\t\tList<Parameter> parameters_bucket;\n\t\t\n\t\t//\n\t\t// Full AST support members\n\t\t//\n\t\tLocationsBag lbag;\n\t\tList<Tuple<Modifiers, Location>> mod_locations;\n\t\tLocation parameterModifierLocation, savedLocation, savedEventAssignLocation;\n\t\tLocation savedAttrParenOpenLocation, savedAttrParenCloseLocation, savedOperatorLocation;\n\t\tStack<List<Location>> locationListStack = new Stack<List<Location>> (); // used for type parameters\n\t\tStack<Location> opt_intoStack = new Stack<Location> ();\n\n\t\tbool HadAttributeParens;\n\t\tList<Location> attributeArgumentCommas = new List<Location> ();\n\t\tList<Location> parameterListCommas = new List<Location> ();\n\t\tStack<Location> location_stack;\n%}\n\n%token EOF\n%token NONE   /* This token is never returned by our lexer */\n%token ERROR\t\t// This is used not by the parser, but by the tokenizer.\n\t\t\t// do not remove.\n\n/*\n *These are the C# keywords\n */\n%token FIRST_KEYWORD\n%token ABSTRACT\t\n%token AS\n%token ADD\n%token BASE\t\n%token BOOL\t\n%token BREAK\t\n%token BYTE\t\n%token CASE\t\n%token CATCH\t\n%token CHAR\t\n%token CHECKED\t\n%token CLASS\t\n%token CONST\t\n%token CONTINUE\t\n%token DECIMAL\t\n%token DEFAULT\t\n%token DELEGATE\t\n%token DO\t\n%token DOUBLE\t\n%token ELSE\t\n%token ENUM\t\n%token EVENT\t\n%token EXPLICIT\t\n%token EXTERN\t\n%token FALSE\t\n%token FINALLY\t\n%token FIXED\t\n%token FLOAT\t\n%token FOR\t\n%token FOREACH\t\n%token GOTO\t\n%token IF\t\n%token IMPLICIT\t\n%token IN\t\n%token INT\t\n%token INTERFACE\n%token INTERNAL\t\n%token IS\t\n%token LOCK\t\n%token LONG\t\n%token NAMESPACE\n%token NEW\t\n%token NULL\t\n%token OBJECT\t\n%token OPERATOR\t\n%token OUT\t\n%token OVERRIDE\t\n%token PARAMS\t\n%token PRIVATE\t\n%token PROTECTED\n%token PUBLIC\t\n%token READONLY\t\n%token REF\t\n%token RETURN\t\n%token REMOVE\n%token SBYTE\t\n%token SEALED\t\n%token SHORT\t\n%token SIZEOF\t\n%token STACKALLOC\n%token STATIC\t\n%token STRING\t\n%token STRUCT\t\n%token SWITCH\t\n%token THIS\t\n%token THROW\t\n%token TRUE\t\n%token TRY\t\n%token TYPEOF\t\n%token UINT\t\n%token ULONG\t\n%token UNCHECKED\n%token UNSAFE\t\n%token USHORT\t\n%token USING\t\n%token VIRTUAL\t\n%token VOID\t\n%token VOLATILE\n%token WHERE\n%token WHILE\t\n%token ARGLIST\n%token PARTIAL\n%token ARROW\n%token FROM\n%token FROM_FIRST\n%token JOIN\n%token ON\n%token EQUALS\n%token SELECT\n%token GROUP\n%token BY\n%token LET\n%token ORDERBY\n%token ASCENDING\n%token DESCENDING\n%token INTO\n%token INTERR_NULLABLE\n%token EXTERN_ALIAS\n%token REFVALUE\n%token REFTYPE\n%token MAKEREF\n%token ASYNC\n%token AWAIT\n%token INTERR_OPERATOR\n\n/* C# keywords which are not really keywords */\n%token GET\n%token SET\n\n%left LAST_KEYWORD\n\n/* C# single character operators/punctuation. */\n%token OPEN_BRACE\n%token CLOSE_BRACE\n%token OPEN_BRACKET\n%token CLOSE_BRACKET\n%token OPEN_PARENS\n%token CLOSE_PARENS\n\n%token DOT\n%token COMMA\n%token COLON\n%token SEMICOLON\n%token TILDE\n\n%token PLUS\n%token MINUS\n%token BANG\n%token ASSIGN\n%token OP_LT\n%token OP_GT\n%token BITWISE_AND\n%token BITWISE_OR\n%token STAR\n%token PERCENT\n%token DIV\n%token CARRET\n%token INTERR\n\n/* C# multi-character operators. */\n%token DOUBLE_COLON\n%token OP_INC\n%token OP_DEC\n%token OP_SHIFT_LEFT\n%token OP_SHIFT_RIGHT\n%token OP_LE\n%token OP_GE\n%token OP_EQ\n%token OP_NE\n%token OP_AND\n%token OP_OR\n%token OP_MULT_ASSIGN\n%token OP_DIV_ASSIGN\n%token OP_MOD_ASSIGN\n%token OP_ADD_ASSIGN\n%token OP_SUB_ASSIGN\n%token OP_SHIFT_LEFT_ASSIGN\n%token OP_SHIFT_RIGHT_ASSIGN\n%token OP_AND_ASSIGN\n%token OP_XOR_ASSIGN\n%token OP_OR_ASSIGN\n%token OP_PTR\n%token OP_COALESCING\n\n/* Generics <,> tokens */\n%token OP_GENERICS_LT\n%token OP_GENERICS_LT_DECL\n%token OP_GENERICS_GT\n\n%token LITERAL\n\n%token IDENTIFIER\n%token OPEN_PARENS_LAMBDA\n%token OPEN_PARENS_CAST\n%token GENERIC_DIMENSION\n%token DEFAULT_COLON\n%token OPEN_BRACKET_EXPR\n\n// Make the parser go into eval mode parsing (statements and compilation units).\n%token EVAL_STATEMENT_PARSER\n%token EVAL_COMPILATION_UNIT_PARSER\n%token EVAL_USING_DECLARATIONS_UNIT_PARSER\n\n%token DOC_SEE\n\n// \n// This token is generated to trigger the completion engine at this point\n//\n%token GENERATE_COMPLETION\n\n//\n// This token is return repeatedly after the first GENERATE_COMPLETION\n// token is produced and before the final EOF\n//\n%token COMPLETE_COMPLETION\n\n/* Add precedence rules to solve dangling else s/r conflict */\n%nonassoc IF\n%nonassoc ELSE\n\n/* Define the operator tokens and their precedences */\n%right ASSIGN\n%right OP_COALESCING\n%right INTERR\n%left OP_OR\n%left OP_AND\n%left BITWISE_OR\n%left BITWISE_AND\n%left OP_SHIFT_LEFT OP_SHIFT_RIGHT\n%left PLUS MINUS\n%left STAR DIV PERCENT\n%right BANG CARRET UMINUS\n%nonassoc OP_INC OP_DEC\n%left OPEN_PARENS\n%left OPEN_BRACKET OPEN_BRACE\n%left DOT\n\n%start compilation_unit\n%%\n\ncompilation_unit\n\t: outer_declaration opt_EOF\n\t  {\n\t\tLexer.check_incorrect_doc_comment ();\n\t  }\n\t| interactive_parsing  { Lexer.CompleteOnEOF = false; } opt_EOF\n\t| documentation_parsing\n\t;\n\t\nouter_declaration\n\t: opt_extern_alias_directives opt_using_directives\n\t| opt_extern_alias_directives opt_using_directives namespace_or_type_declarations opt_attributes\n\t  {\n\t\tif ($4 != null) {\n\t\t\tAttributes attrs = (Attributes) $4;\n\t\t\treport.Error (1730, attrs.Attrs [0].Location,\n\t\t\t\t\"Assembly and module attributes must precede all other elements except using clauses and extern alias declarations\");\n\n\t\t\tcurrent_namespace.UnattachedAttributes = attrs;\n\t\t}\n\t  }\n\t| opt_extern_alias_directives opt_using_directives attribute_sections\n\t  {\n\t\tmodule.AddAttributes ((Attributes) $3, current_namespace);\n\t  }\n\t| error\n\t  {\n\t\tif (yyToken == Token.EXTERN_ALIAS)\n\t\t\treport.Error (439, lexer.Location, \"An extern alias declaration must precede all other elements\");\n\t\telse\n\t\t\tError_SyntaxError (yyToken);\n\t  }\n\t;\n\t\nopt_EOF\n\t: /* empty */\n\t| EOF\n\t;\n\nextern_alias_directives\n\t: extern_alias_directive\n\t| extern_alias_directives extern_alias_directive\n\t;\n\nextern_alias_directive\n\t: EXTERN_ALIAS IDENTIFIER IDENTIFIER SEMICOLON\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\tstring s = lt.Value;\n\t\tif (s != \"alias\") {\n\t\t\tsyntax_error (lt.Location, \"`alias' expected\");\n\t\t} else {\n\t\t\tif (lang_version == LanguageVersion.ISO_1)\n\t\t\t\tFeatureIsNotAvailable (lt.Location, \"external alias\");\n\n\t\t\tlt = (LocatedToken) $3;\n\t\t\tif (lt.Value == QualifiedAliasMember.GlobalAlias) {\n\t\t\t\tRootNamespace.Error_GlobalNamespaceRedefined (report, lt.Location);\n\t\t\t}\n\t\t\t\n\t\t\tvar na = new UsingExternAlias (new SimpleMemberName (lt.Value, lt.Location), GetLocation ($1));\n\t\t\tcurrent_namespace.AddUsing (na);\n\t\t\t\n\t\t\tlbag.AddLocation (na, GetLocation ($2), GetLocation ($4));\n\t\t}\n\t  }\n\t| EXTERN_ALIAS error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  }\n\t;\n \nusing_directives\n\t: using_directive \n\t| using_directives using_directive\n\t;\n\nusing_directive\n\t: using_namespace\n\t  {\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t;\n\nusing_namespace\n\t: USING namespace_or_type_expr SEMICOLON \n\t  {\n\t\tvar un = new UsingNamespace ((ATypeNameExpression) $2, GetLocation ($1));\n\t\tcurrent_namespace.AddUsing (un);\n\t\t\n\t\tlbag.AddLocation (un, GetLocation ($3));\n\t  }\n\t| USING IDENTIFIER ASSIGN namespace_or_type_expr SEMICOLON\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\tif (lang_version != LanguageVersion.ISO_1 && lt.Value == \"global\") {\n\t\t\treport.Warning (440, 2, lt.Location,\n\t\t\t \"An alias named `global' will not be used when resolving `global::'. The global namespace will be used instead\");\n\t\t}\n\n\t\tvar un = new UsingAliasNamespace (new SimpleMemberName (lt.Value, lt.Location), (ATypeNameExpression) $4, GetLocation ($1));\n\t\tcurrent_namespace.AddUsing (un);\n\t\tlbag.AddLocation (un, GetLocation ($3), GetLocation ($5));\n\t  }\n\t| USING error\n\t {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = null;\n\t }\n\t;\n\n//\n// Strictly speaking, namespaces don't have attributes but\n// we parse global attributes along with namespace declarations and then\n// detach them\n// \nnamespace_declaration\n\t: opt_attributes NAMESPACE namespace_name\n\t  {\n\t\tAttributes attrs = (Attributes) $1;\n\t\tvar name = (MemberName) $3;\n\t\tif (attrs != null) {\n\t\t\tbool valid_global_attrs = true;\n\t\t\tif ((current_namespace.DeclarationFound || current_namespace != file)) {\n\t\t\t\tvalid_global_attrs = false;\n\t\t\t} else {\n\t\t\t\tforeach (var a in attrs.Attrs) {\n\t\t\t\t\tif (a.ExplicitTarget == \"assembly\" || a.ExplicitTarget == \"module\")\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\tvalid_global_attrs = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (!valid_global_attrs)\n\t\t\t\treport.Error (1671, name.Location, \"A namespace declaration cannot have modifiers or attributes\");\n\t\t}\n\t\n\t\tmodule.AddAttributes (attrs, current_namespace);\n\t\t\n\t\tvar ns = new NamespaceContainer (name, current_namespace);\n\t\tcurrent_namespace.AddTypeContainer (ns);\n\t\tcurrent_container = current_namespace = ns;\n\t  }\n\t  OPEN_BRACE\n\t  {\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t  opt_extern_alias_directives opt_using_directives opt_namespace_or_type_declarations CLOSE_BRACE opt_semicolon_error\n\t  {\n\t\tif ($11 != null)\n\t\t\tlbag.AddLocation (current_container, GetLocation ($2), GetLocation ($5), GetLocation ($10), GetLocation ($11));\n\t\telse\n\t\t\tlbag.AddLocation (current_container, GetLocation ($2), GetLocation ($5), GetLocation ($10));\n\t  \n\t\tcurrent_container = current_namespace = current_namespace.Parent;\n\t  }\n\t| opt_attributes NAMESPACE namespace_name\n\t  {\n\t\treport.Error (1514, lexer.Location, \"Unexpected symbol `{0}', expecting `.' or `{{'\", GetSymbolName (yyToken));\n\n\t\tvar name = (MemberName) $3;\t\t\n\t\tvar ns = new NamespaceContainer (name, current_namespace);\n\t\tlbag.AddLocation (ns, GetLocation ($2));\n\t\tcurrent_namespace.AddTypeContainer (ns);\n\t  }\n\t;\n\nopt_semicolon_error\n\t: /* empty */\n\t| SEMICOLON\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  \t$$ = null;\n\t  }\n\t;\n\nnamespace_name\n\t: IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = new MemberName (lt.Value, lt.Location);\n\t  }\n\t| namespace_name DOT IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberName ((MemberName) $1, lt.Value, lt.Location);\t\t\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new MemberName (\"<invalid>\", lexer.Location);\n\t  }\n\t;\n\nopt_semicolon\n\t: /* empty */\n\t| SEMICOLON\n\t;\n\nopt_comma\n\t: /* empty */\n\t| COMMA\n\t;\n\nopt_using_directives\n\t: /* empty */\n\t| using_directives\n\t;\n\nopt_extern_alias_directives\n\t: /* empty */\n\t| extern_alias_directives\n\t;\n\nopt_namespace_or_type_declarations\n\t: /* empty */\n\t| namespace_or_type_declarations\n\t;\n\nnamespace_or_type_declarations\n\t: namespace_or_type_declaration\n\t| namespace_or_type_declarations namespace_or_type_declaration\n\t;\n\nnamespace_or_type_declaration\n\t: type_declaration\n\t  {\n\t\tif ($1 != null) {\n\t\t\tTypeContainer ds = (TypeContainer)$1;\n\n\t\t\tif ((ds.ModFlags & (Modifiers.PRIVATE | Modifiers.PROTECTED)) != 0){\n\t\t\t\treport.Error (1527, ds.Location, \n\t\t\t\t\"Namespace elements cannot be explicitly declared as private, protected or protected internal\");\n\t\t\t}\n\n\t\t\t// Here is a trick, for explicit attributes we don't know where they belong to until\n\t\t\t// we parse succeeding declaration hence we parse them as normal and re-attach them\n\t\t\t// when we know whether they are global (assembly:, module:) or local (type:).\n\t\t\tif (ds.OptAttributes != null) {\n\t\t\t\tds.OptAttributes.ConvertGlobalAttributes (ds, current_namespace, !current_namespace.DeclarationFound && current_namespace == file);\n\t\t\t}\n\t\t}\n\t\tcurrent_namespace.DeclarationFound = true;\n\t  }\n\t| namespace_declaration\n\t  {\n\t\tcurrent_namespace.DeclarationFound = true;\n\t  }\n\t| attribute_sections CLOSE_BRACE {\n\t\tcurrent_namespace.UnattachedAttributes = (Attributes) $1;\n\t\treport.Error (1518, lexer.Location, \"Attributes must be attached to class, delegate, enum, interface or struct\");\n\t\tlexer.putback ('}');\n\t  }\n\t;\n\ntype_declaration\n\t: class_declaration\t\t\n\t| struct_declaration\n\t| interface_declaration\n\t| enum_declaration\t\t\n\t| delegate_declaration\n//\n// Enable this when we have handled all errors, because this acts as a generic fallback\n//\n//\t| error {\n//\t\tConsole.WriteLine (\"Token=\" + yyToken);\n//\t\treport.Error (1518, GetLocation ($1), \"Expected class, struct, interface, enum or delegate\");\n//\t  }\n\t;\n\n//\n// Attributes\n//\n\nopt_attributes\n\t: /* empty */ \n\t| attribute_sections\n    ;\n \nattribute_sections\n\t: attribute_section\n\t  {\n\t\tvar sect = (List<Attribute>) $1;\n\t\t$$ = new Attributes (sect);\n\t  }\n\t| attribute_sections attribute_section\n\t  {\n\t\tAttributes attrs = $1 as Attributes;\n\t\tvar sect = (List<Attribute>) $2;\n\t\tif (attrs == null)\n\t\t\tattrs = new Attributes (sect);\n\t\telse if (sect != null)\n\t\t\tattrs.AddAttributes (sect);\n\t\t$$ = attrs;\n\t  }\n\t;\n\t\nattribute_section\n\t: OPEN_BRACKET\n\t  {\n\t  \tPushLocation (GetLocation ($1));\n\t\tlexer.parsing_attribute_section = true;\n\t  }\n\t  attribute_section_cont\n\t  {\n\t\tlexer.parsing_attribute_section = false;\n\t\t$$ = $3;\n\t  }\n\t;\t\n\t\nattribute_section_cont\n\t: attribute_target COLON\n\t  {\n\t\tcurrent_attr_target = (string) $1;\n\t\tif (current_attr_target == \"assembly\" || current_attr_target == \"module\") {\n\t\t\tLexer.check_incorrect_doc_comment ();\n\t\t}\n\t  }\n\t  attribute_list opt_comma CLOSE_BRACKET\n\t  {\n\t\t// when attribute target is invalid\n\t\tif (current_attr_target == string.Empty)\n\t\t\t$$ = new List<Attribute> (0);\n\t\telse\n\t\t\t$$ = $4;\n\t\tlbag.InsertLocation ($$, 0, GetLocation ($2));\n\t\tlbag.InsertLocation ($$, 0, PopLocation ());\n\t\tlbag.InsertLocation ($$, 0, PopLocation ());\n\t\tif ($5 != null) {\n\t\t\tlbag.AddLocation ($$, GetLocation ($5), GetLocation ($6));\n\t\t} else {\n\t\t\tlbag.AddLocation ($$, GetLocation ($6));\n\t\t}\n\n\t\tcurrent_attr_target = null;\n\t\tlexer.parsing_attribute_section = false;\n \t  }\n\t| attribute_list opt_comma CLOSE_BRACKET\n\t  {\n\t\t$$ = $1;\n\t\tlbag.InsertLocation ($$, 0, PopLocation ());\n\t\tif ($2 != null) {\n\t\t\tlbag.AddLocation ($$, GetLocation($2), GetLocation ($3));\n\t\t} else {\n\t\t\tlbag.AddLocation ($$, GetLocation($3));\n\t\t}\n\t  }\n\t| IDENTIFIER error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\tvar lt = (LocatedToken) $1;\n\t\tvar tne = new SimpleName (lt.Value, null, lt.Location);\n\n\t\t$$ = new List<Attribute> () {\n\t\t\tnew Attribute (null, tne, null, GetLocation ($1), false)\n\t\t};\n\t  }\n\t| error\n\t  {\n \t\tCheckAttributeTarget (yyToken, GetTokenName (yyToken), GetLocation ($1)); \n \t\t$$ = null;\n\t  }\n\t;\t\n\nattribute_target\n\t: IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = CheckAttributeTarget (yyToken, lt.Value, lt.Location);\n\t\tPushLocation (GetLocation ($1));\n\t  }\n\t| EVENT  { $$ = \"event\"; PushLocation (GetLocation ($1)); }\n\t| RETURN { $$ = \"return\"; PushLocation (GetLocation ($1)); }\n\t;\n\nattribute_list\n\t: attribute\n\t  {\n\t\t$$ = new List<Attribute> (4) { (Attribute) $1 };\n\t  }\n\t| attribute_list COMMA attribute\n\t  {\n\t\tvar attrs = (List<Attribute>) $1;\n\t\tif (attrs != null) {\n\t\t\tattrs.Add ((Attribute) $3);\n\t  \t\tlbag.AddLocation (attrs, GetLocation ($2));\n\t  \t}\n\n\t\t$$ = attrs;\n\t  }\n\t;\n\nattribute\n\t: attribute_name\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  opt_attribute_arguments\n\t  {\n\t\t--lexer.parsing_block;\n\t\t\n\t\tvar tne = (ATypeNameExpression) $1;\n\t\tif (tne.HasTypeArguments) {\n\t\t\treport.Error (404, tne.Location, \"Attributes cannot be generic\");\n\t\t}\n\t\tArguments [] arguments = (Arguments []) $3;\n\n\t\t$$ = new Attribute (current_attr_target, tne, (Arguments[]) $3, GetLocation ($1), lexer.IsEscapedIdentifier (tne));\n\t\tif (arguments != null) {\n\t\t\tattributeArgumentCommas.Insert (0, savedAttrParenOpenLocation);\n\t\t\tattributeArgumentCommas.Add (savedAttrParenCloseLocation);\n\t\t\tlbag.AddLocation ($$, attributeArgumentCommas);\n\t\t\tattributeArgumentCommas.Clear ();\n\t\t} else if (HadAttributeParens) {\n\t\t\tlbag.AddLocation ($$, savedAttrParenOpenLocation, savedAttrParenCloseLocation);\n\t\t}\n\t  }\n\t;\n\nattribute_name\n\t: namespace_or_type_expr\n\t;\n\nopt_attribute_arguments\n\t: /* empty */   { $$ = null; HadAttributeParens = false;  }\n\t| OPEN_PARENS attribute_arguments CLOSE_PARENS\n\t  {\n\t\tsavedAttrParenOpenLocation = GetLocation ($1);\n\t\tsavedAttrParenCloseLocation = GetLocation ($3);\n\t\t$$ = $2;\n\t\tHadAttributeParens = true;\n\t  }\n\t;\n\n\nattribute_arguments\n\t: /* empty */ \t\t{ $$ = null; } \n\t| positional_or_named_argument\n\t  {\n\t  \tArguments a = new Arguments (4);\n\t\ta.Add ((Argument) $1);\n\t\t$$ = new Arguments [] { a, null };\n\t  }\n\t| named_attribute_argument\n\t  {\n\t  \tArguments a = new Arguments (4);\n\t\ta.Add ((Argument) $1);  \n\t\t$$ = new Arguments [] { null, a };\n\t  }\n    | attribute_arguments COMMA positional_or_named_argument\n\t  {\n\t\tArguments[] o = (Arguments[]) $1;\n\t\tif (o [1] != null) {\n\t\t\treport.Error (1016, ((Argument) $3).Expr.Location, \"Named attribute arguments must appear after the positional arguments\");\n\t\t\to [0] = new Arguments (4);\n\t\t}\n\t\t\n\t\tArguments args = ((Arguments) o [0]);\n\t\tif (args.Count > 0 && !($3 is NamedArgument) && args [args.Count - 1] is NamedArgument)\n\t\t\tError_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]);\n\t\t\n\t\targs.Add ((Argument) $3);\n\t\tattributeArgumentCommas.Add (GetLocation ($2));\n\t  }\n    | attribute_arguments COMMA named_attribute_argument\n\t  {\n\t\tArguments[] o = (Arguments[]) $1;\n\t\tif (o [1] == null) {\n\t\t\to [1] = new Arguments (4);\n\t\t}\n\n\t\t((Arguments) o [1]).Add ((Argument) $3);\n\t\tattributeArgumentCommas.Add (GetLocation ($2));\n\t  }\n    ;\n\npositional_or_named_argument\n\t: expression\n\t  {\n\t  \t$$ = new Argument ((Expression) $1);\n\t  }\n\t| named_argument\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = null;\n\t  }\n\t;\n\nnamed_attribute_argument\n\t: IDENTIFIER ASSIGN\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  expression\n\t  {\n\t  \t--lexer.parsing_block;\n\t  \tvar lt = (LocatedToken) $1;\n\t\t$$ = new NamedArgument (lt.Value, lt.Location, (Expression) $4);\t  \n\t\tlbag.AddLocation ($$, GetLocation($2));\n\t  }\n\t;\n\t\nnamed_argument\n\t: identifier_inside_body COLON opt_named_modifier expression_or_error\n\t  {\n\t\tif (lang_version <= LanguageVersion.V_3)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"named argument\");\n\t\t\t\n\t\t// Avoid boxing in common case (no modifier)\n\t\tvar arg_mod = $3 == null ? Argument.AType.None : (Argument.AType) $3;\n\t\t\t\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = new NamedArgument (lt.Value, lt.Location, (Expression) $4, arg_mod);\n\t\tlbag.AddLocation ($$, GetLocation($2));\n\t  }\n\t;\n\t\nopt_named_modifier\n\t: /* empty */   { $$ = null; }\n\t| REF\n\t  { \n\t\t$$ = Argument.AType.Ref;\n\t  }\n\t| OUT\n\t  { \n\t\t$$ = Argument.AType.Out;\n\t  }\n\t;\n\t\t  \nopt_class_member_declarations\n\t: /* empty */\n\t| class_member_declarations\n\t;\n\nclass_member_declarations\n\t: class_member_declaration\n\t  {\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\t| class_member_declarations class_member_declaration\n\t  {\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\t;\n\t\nclass_member_declaration\n\t: constant_declaration\n\t| field_declaration\n\t| method_declaration\n\t| property_declaration\n\t| event_declaration\n\t| indexer_declaration\n\t| operator_declaration\n\t| constructor_declaration\n\t| primary_constructor_body\n\t| destructor_declaration\n\t| type_declaration\n\t| attributes_without_members\n\t| incomplete_member\n\t| error\n\t  {\n\t\treport.Error (1519, lexer.Location, \"Unexpected symbol `{0}' in class, struct, or interface member declaration\",\n\t\t\tGetSymbolName (yyToken));\n\t\t$$ = null;\n\t\tlexer.parsing_generic_declaration = false;\n\t  }\t\n\t;\n\nprimary_constructor_body\n\t: OPEN_BRACE\n\t  {\n\t\tcurrent_local_parameters = current_type.PrimaryConstructorParameters;\n\t\tif (current_local_parameters == null) {\n\t\t\treport.Error (9010, GetLocation ($1), \"Primary constructor body is not allowed\");\n\t\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t}\n\n\t\t++lexer.parsing_block;\n\t\tstart_block (GetLocation ($1));\n\t  }\n\t  opt_statement_list block_end\n\t  {\n\t\tcurrent_local_parameters = null;\n\t\tvar t = current_type as ClassOrStruct;\n\t\tif (t != null) {\n\t\t\tvar b = (ToplevelBlock) $4;\n\t\t\tif (t.PrimaryConstructorBlock != null) {\n\t\t\t\treport.Error (8041, b.StartLocation, \"Primary constructor already has a body\");\n\t\t\t} else {\n\t\t\t\tt.PrimaryConstructorBlock = b;\n\t\t\t}\n\t\t}\n\t  }\n\t;\n\nstruct_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  opt_partial\n\t  STRUCT\n\t  {\n\t  }\n\t  type_declaration_name\n\t  { \n\t\tlexer.ConstraintsParsing = true;\n\t\tvalid_param_mod = ParameterModifierType.PrimaryConstructor;\n\t\tpush_current_container (new Struct (current_container, (MemberName) $6, (Modifiers) $2, (Attributes) $1), $3);\n\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation ($4));\n\t  }\n\t  opt_primary_parameters\n\t  opt_class_base\n\t  opt_type_parameter_constraints_clauses\n\t  {\n\t\tvalid_param_mod = 0;\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif ($8 != null)\n\t\t\tcurrent_type.PrimaryConstructorParameters = (ParametersCompiled) $8;\n\n\t\tif ($10 != null)\n\t\t\tcurrent_container.SetConstraints ((List<Constraints>) $10);\n\n\t\tif (doc_support)\n\t\t\tcurrent_container.PartialContainer.DocComment = Lexer.consume_doc_comment ();\n\n\t\t\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\t  OPEN_BRACE\n\t  {\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t  opt_class_member_declarations CLOSE_BRACE\t\n\t  {\n\t\t--lexer.parsing_declaration;\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t  opt_semicolon\n\t  {\n\t\tif ($16 == null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation ($12), GetLocation ($15));\n\t\t} else {\n\t\t\tlbag.AppendToMember (current_container, GetLocation ($12), GetLocation ($15), GetLocation ($17));\n\t\t}\n\t\t$$ = pop_current_class ();\n\t  }\n\t| opt_attributes opt_modifiers opt_partial STRUCT error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  }\n\t;\n\t\nconstant_declaration\n\t: opt_attributes \n\t  opt_modifiers\n\t  CONST type IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $5;\n\t\tvar mod = (Modifiers) $2;\n\t\tcurrent_field = new Const (current_type, (FullNamedExpression) $4, mod, new MemberName (lt.Value, lt.Location), (Attributes) $1);\n\t\tcurrent_type.AddMember (current_field);\n\t\t\n\t\tif ((mod & Modifiers.STATIC) != 0) {\n\t\t\treport.Error (504, current_field.Location, \"The constant `{0}' cannot be marked static\", current_field.GetSignatureForError ());\n\t\t}\n\t\t\n\t\t$$ = current_field;\n\t  }\n\t  constant_initializer opt_constant_declarators SEMICOLON\n\t  {\n\t\tif (doc_support) {\n\t\t\tcurrent_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tcurrent_field.Initializer = (ConstInitializer) $7;\n\t\tlbag.AddMember (current_field, GetModifierLocations (), GetLocation ($3), GetLocation ($9));\n\t\tcurrent_field = null;\n\t  }\n\t| opt_attributes \n\t  opt_modifiers\n\t  CONST type error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\tcurrent_type.AddMember (new Const (current_type, (FullNamedExpression) $4, (Modifiers) $2, MemberName.Null, (Attributes) $1));\n\t  }\t\n\t;\n\t\nopt_constant_declarators\n\t: /* empty */\n\t| constant_declarators\n\t;\n\t\nconstant_declarators\n\t: constant_declarator\n\t  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) $1);\n\t  }\n\t| constant_declarators constant_declarator\n\t  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) $2);\n\t  }\n\t;\n\t\nconstant_declarator\n\t: COMMA IDENTIFIER constant_initializer\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t  \t$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) $3);\n\t  \tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t;\t\t\n\nconstant_initializer\n\t: ASSIGN\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  constant_initializer_expr\n\t  {\n\t\t--lexer.parsing_block;\n\t\t$$ = new ConstInitializer (current_field, (Expression) $3, GetLocation ($1));\n\t  \tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t| error\n\t  {\n\t\treport.Error (145, lexer.Location, \"A const field requires a value to be provided\");\n\t\t$$ = null;\n\t  }\t  \n\t;\n\t\nconstant_initializer_expr\n\t: constant_expression\n\t| array_initializer\n\t;\n\nfield_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  member_type IDENTIFIER\n\t  {\n\t  \tlexer.parsing_generic_declaration = false;\n\n\t\tFullNamedExpression type = (FullNamedExpression) $3;\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (670, GetLocation ($3), \"Fields cannot have void type\");\n\t\t\t\n\t\tvar lt = (LocatedToken) $4;\n\t\tcurrent_field = new Field (current_type, type, (Modifiers) $2, new MemberName (lt.Value, lt.Location), (Attributes) $1);\n\t\tcurrent_type.AddField (current_field);\n\t\t$$ = current_field;\n\t  }\n\t  opt_field_initializer\n\t  opt_field_declarators\n\t  SEMICOLON\n\t  { \n\t\tif (doc_support) {\n\t\t\tcurrent_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\t\n\t\tlbag.AddMember (current_field, GetModifierLocations (), GetLocation ($8));\n\t\t$$ = current_field;\n\t\tcurrent_field = null;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  FIXED simple_type IDENTIFIER\n\t  { \n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($3), \"fixed size buffers\");\n\n\t\tvar lt = (LocatedToken) $5;\n\t\tcurrent_field = new FixedField (current_type, (FullNamedExpression) $4, (Modifiers) $2,\n\t\t\tnew MemberName (lt.Value, lt.Location), (Attributes) $1);\n\t\t\t\n\t\tcurrent_type.AddField (current_field);\n\t  }\n\t  fixed_field_size opt_fixed_field_declarators SEMICOLON\n\t  {\n\t\tif (doc_support) {\n\t\t\tcurrent_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t    }\n\n\t\tcurrent_field.Initializer = (ConstInitializer) $7;\t    \n\t\tlbag.AddMember (current_field, GetModifierLocations (), GetLocation ($3), GetLocation ($9));\n\t\t$$ = current_field;\n\t    current_field = null;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  FIXED simple_type error\n\t  SEMICOLON\n\t  {\n\t\treport.Error (1641, GetLocation ($5), \"A fixed size buffer field must have the array size specifier after the field name\");\n\t  }\n\t;\n\t\nopt_field_initializer\n\t: /* empty */\n\t| ASSIGN\n\t  {\n\t  \t++lexer.parsing_block;\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  \tstart_block (GetLocation ($1));\n\t  }\n\t  variable_initializer\n\t  {\n\t  \t--lexer.parsing_block;\n\t\tcurrent_field.Initializer = (Expression) $3;\n\t\tlbag.AppendToMember (current_field, GetLocation ($1));\n\t\tend_block (lexer.Location);\n\t\tcurrent_local_parameters = null;\n\t  }\n\t;\n\t\nopt_field_declarators\n\t: /* empty */\n\t| field_declarators\n\t;\n\t\nfield_declarators\n\t: field_declarator\n\t  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) $1);\n\t  }\n\t| field_declarators field_declarator\n\t  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) $2);\n\t  }\n\t;\n\t\nfield_declarator\n\t: COMMA IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t  \t$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null);\n\t  \tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t| COMMA IDENTIFIER ASSIGN\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  variable_initializer\n\t  {\n\t\t--lexer.parsing_block;\n\t\tvar lt = (LocatedToken) $2;\t  \n\t  \t$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) $5);\n\t  \tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($3));\n\t  }\n\t;\t\n\nopt_fixed_field_declarators\n\t: /* empty */\n\t| fixed_field_declarators\n\t;\n\t\nfixed_field_declarators\n\t: fixed_field_declarator\n\t  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) $1);\n\t  }\n\t| fixed_field_declarators fixed_field_declarator\n\t  {\n\t\tcurrent_field.AddDeclarator ((FieldDeclarator) $2);\n\t  }\n\t;\n\t\nfixed_field_declarator\n\t: COMMA IDENTIFIER fixed_field_size\n\t  {\n\t\tvar lt = (LocatedToken) $2;\t  \n\t\t$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t;\n\nfixed_field_size\n\t: OPEN_BRACKET\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  expression CLOSE_BRACKET\n\t  {\n\t\t--lexer.parsing_block;\n\t\t$$ = new ConstInitializer (current_field, (Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t  }\n\t| OPEN_BRACKET error\n\t  {\n\t\treport.Error (443, lexer.Location, \"Value or constant expected\");\n\t\t$$ = null;\n\t  }\t  \n\t;\n\nvariable_initializer\n\t: expression\n\t| array_initializer\n\t| error\n\t  {\n\t\t// It has to be here for the parent to safely restore artificial block\n\t  \tError_SyntaxError (yyToken);\n\t  \t$$ = null;\n\t  }\n\t;\n\nmethod_declaration\n\t: method_header\n\t  {\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\n\t\t// Was added earlier in the case of body being eof for full ast\n\t  }\n\t  method_body_expression_block\n\t  {\n\t\tMethod method = (Method) $1;\n\t\tmethod.Block = (ToplevelBlock) $3;\n\t\tasync_block = false;\n\t\t\n\t\tif (method.Block == null) {\n\t\t\tlbag.AppendToMember (method, savedLocation); // semicolon\n\t\t\tmethod.ParameterInfo.CheckParameters (method);\n\n\t\t\tif ((method.ModFlags & Modifiers.ASYNC) != 0) {\n\t\t\t\treport.Error (1994, method.Location, \"`{0}': The async modifier can only be used with methods that have a body\",\n\t\t\t\t\tmethod.GetSignatureForError ());\n\t\t\t}\n\t\t} else {\n\t\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\t\treport.Error (531, method.Location, \"`{0}': interface members cannot have a definition\",\n\t\t\t\t\tmethod.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tcurrent_local_parameters = null;\n\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t;\n\nmethod_header\n\t: opt_attributes\n\t  opt_modifiers\n\t  member_type\n\t  method_declaration_name OPEN_PARENS\n\t  {\n\t\tvalid_param_mod = ParameterModifierType.All;\n\t  }\n\t  opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tvalid_param_mod = 0;\n\t\tMemberName name = (MemberName) $4;\n\t\tcurrent_local_parameters = (ParametersCompiled) $7;\n\n\t\tvar method = Method.Create (current_type, (FullNamedExpression) $3, (Modifiers) $2,\n\t\t\t\t     name, current_local_parameters, (Attributes) $1);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tasync_block = (method.ModFlags & Modifiers.ASYNC) != 0;\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\tlbag.AddMember (method, GetModifierLocations (), GetLocation ($5), GetLocation ($8));\n\t\t$$ = method;\n\n\t\tlexer.ConstraintsParsing = true;\n\t  }\n\t  opt_type_parameter_constraints_clauses\n\t  {\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif ($10 != null) {\n\t\t\tvar method = (Method) $9;\n\t\t\tmethod.SetConstraints ((List<Constraints>) $10);\n\t\t}\n\n\t\t$$ = $9;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  PARTIAL\n\t  VOID\n\t  {\n\t\tlexer.parsing_generic_declaration = true;\n\t  }\n\t  method_declaration_name\n\t  OPEN_PARENS\n\t  {\n\t\tlexer.parsing_generic_declaration = false;\n\t  \tvalid_param_mod = ParameterModifierType.All;\n\t  }\n\t  opt_formal_parameter_list CLOSE_PARENS \n\t  {\n\t\tlexer.ConstraintsParsing = true;\n\t  }\n\t  opt_type_parameter_constraints_clauses\n\t  {\n\t\tlexer.ConstraintsParsing = false;\n\t\tvalid_param_mod = 0;\n\n\t\tMemberName name = (MemberName) $6;\n\t\tcurrent_local_parameters = (ParametersCompiled) $9;\n\n\t\tvar modifiers = (Modifiers) $2;\n\t\tmodifiers |= Modifiers.PARTIAL;\n\n\t\tvar method = Method.Create (current_type, new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($4)),\n\t\t\t\t     modifiers, name, current_local_parameters, (Attributes) $1);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tasync_block = (method.ModFlags & Modifiers.ASYNC) != 0;\n\n\t\tif ($12 != null)\n\t\t\tmethod.SetConstraints ((List<Constraints>) $12);\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\tStoreModifierLocation (Modifiers.PARTIAL, GetLocation ($3));\n\t\tlbag.AddMember (method, GetModifierLocations (), GetLocation ($7), GetLocation ($10));\n\t\t$$ = method;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  member_type\n\t  modifiers method_declaration_name OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tMemberName name = (MemberName) $5;\n\t\treport.Error (1585, name.Location, \n\t\t\t\"Member modifier `{0}' must precede the member type and name\", ModifiersExtensions.Name ((Modifiers) $4));\n\n\t\tvar method = Method.Create (current_type, (FullNamedExpression) $3,\n\t\t\t\t\t    0, name, (ParametersCompiled) $7, (Attributes) $1);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tcurrent_local_parameters = (ParametersCompiled) $7;\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\t$$ = method;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  member_type\n\t  method_declaration_name error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\tcurrent_local_parameters = ParametersCompiled.Undefined;\n\n\t\tMemberName name = (MemberName) $4;\n\t\tvar method = Method.Create (current_type, (FullNamedExpression) $3, (Modifiers) $2,\n\t\t\t\t\t\t\t\t\tname, current_local_parameters, (Attributes) $1);\n\n\t\tcurrent_type.AddMember (method);\n\n\t\tif (doc_support)\n\t\t\tmethod.DocComment = Lexer.consume_doc_comment ();\n\n\t\t$$ = method;\n\t  }\n\t;\n\nmethod_body_expression_block\n\t: method_body\n\t| expression_block\n\t;\n\nmethod_body\n\t: block\n\t| SEMICOLON\t\t{ savedLocation = GetLocation ($1); $$ = null; }\n\t;\n\nexpression_block\n\t: ARROW\n\t {\n\t\tif (lang_version < LanguageVersion.V_6) {\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"expression bodied members\");\n\t\t}\n\n\t\t++lexer.parsing_block;\n\t\tstart_block (GetLocation ($1));\n\t }\n\t expression SEMICOLON\n\t {\n\t\tlexer.parsing_block = 0;\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) $3));\n\t\tvar b = end_block (GetLocation ($4));\n\t\tb.IsCompilerGenerated = true;\n\t\t$$ = b;\n\t }\n\t;\n\nopt_formal_parameter_list\n\t: /* empty */\t\t\t{ $$ = ParametersCompiled.EmptyReadOnlyParameters; }\n\t| formal_parameter_list\n\t;\n\t\nformal_parameter_list\n\t: fixed_parameters\n\t  {\n\t\tvar pars_list = (List<Parameter>) $1;\n\t  \t$$ = new ParametersCompiled (pars_list.ToArray ());\n\t  \tlbag.AddLocation ($$, parameterListCommas);\n\t  } \n\t| fixed_parameters COMMA parameter_array\n\t  {\n\t\tvar pars_list = (List<Parameter>) $1;\n\t\tpars_list.Add ((Parameter) $3);\n\t\tparameterListCommas.Add (GetLocation ($2));\n\t\t\n\t\t$$ = new ParametersCompiled (pars_list.ToArray ()); \n\t  \tlbag.AddLocation ($$, parameterListCommas);\n\t  }\n\t| fixed_parameters COMMA arglist_modifier\n\t  {\n\t\tvar pars_list = (List<Parameter>) $1;\n\t\tpars_list.Add (new ArglistParameter (GetLocation ($3)));\n\t\tparameterListCommas.Add (GetLocation ($2));\n\t\t\n\t\t$$ = new ParametersCompiled (pars_list.ToArray (), true);\n\t  \tlbag.AddLocation ($$, parameterListCommas);\n\t  }\n\t| parameter_array COMMA error\n\t  {\n\t\tif ($1 != null)\n\t\t\treport.Error (231, ((Parameter) $1).Location, \"A params parameter must be the last parameter in a formal parameter list\");\n\n\t\t$$ = new ParametersCompiled (new Parameter[] { (Parameter) $1 } );\t\t\t\n\t  \tlbag.AddLocation ($$, parameterListCommas);\n\t  }\n\t| fixed_parameters COMMA parameter_array COMMA error\n\t  {\n\t\tif ($3 != null)\n\t\t\treport.Error (231, ((Parameter) $3).Location, \"A params parameter must be the last parameter in a formal parameter list\");\n\n\t\tvar pars_list = (List<Parameter>) $1;\n\t\tpars_list.Add (new ArglistParameter (GetLocation ($3)));\n\t\tparameterListCommas.Add (GetLocation ($2));\n\t\tparameterListCommas.Add (GetLocation ($4));\n\t\t\n\t\t$$ = new ParametersCompiled (pars_list.ToArray (), true);\n\t  \tlbag.AddLocation ($$, parameterListCommas);\n\t  }\n\t| arglist_modifier COMMA error\n\t  {\n\t\treport.Error (257, GetLocation ($1), \"An __arglist parameter must be the last parameter in a formal parameter list\");\n\n\t\t$$ = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation ($1)) }, true);\n\t  \tlbag.AddLocation ($$, parameterListCommas);\n\t  }\n\t| fixed_parameters COMMA ARGLIST COMMA error \n\t  {\n\t\treport.Error (257, GetLocation ($3), \"An __arglist parameter must be the last parameter in a formal parameter list\");\n\n\t\tvar pars_list = (List<Parameter>) $1;\n\t\tpars_list.Add (new ArglistParameter (GetLocation ($3)));\n\t\tparameterListCommas.Add (GetLocation ($2));\n\t\tparameterListCommas.Add (GetLocation ($4));\n\n\t\t$$ = new ParametersCompiled (pars_list.ToArray (), true);\n\t  \tlbag.AddLocation ($$, parameterListCommas);\n\t  }\n\t| parameter_array \n\t  {\n\t\t$$ = new ParametersCompiled (new Parameter[] { (Parameter) $1 } );\n\t  }\n\t| arglist_modifier\n\t  {\n\t\t$$ = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation ($1)) }, true);\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = ParametersCompiled.EmptyReadOnlyParameters;\n\t  }\n\t;\n\nfixed_parameters\n\t: fixed_parameter\t\n\t  {\n\t\tparameters_bucket.Clear ();\n\t\tParameter p = (Parameter) $1;\n\t\tparameters_bucket.Add (p);\n\t\tparameterListCommas.Clear ();\n\t\tdefault_parameter_used = p.HasDefaultValue;\n\t\t$$ = parameters_bucket;\n\t  }\n\t| fixed_parameters COMMA fixed_parameter\n\t  {\n\t\tvar pars = (List<Parameter>) $1;\n\t\tParameter p = (Parameter) $3;\n\t\tif (p != null) {\n\t\t\tif (p.HasExtensionMethodModifier)\n\t\t\t\treport.Error (1100, p.Location, \"The parameter modifier `this' can only be used on the first parameter\");\n\t\t\telse if (!p.HasDefaultValue && default_parameter_used)\n\t\t\t\treport.Error (1737, p.Location, \"Optional parameter cannot precede required parameters\");\n\n\t\t\tdefault_parameter_used |= p.HasDefaultValue;\n\t\t\tpars.Add (p);\n\t\t\t\n\t\t\tparameterListCommas.Add (GetLocation ($2));\n\t\t}\n\t\t\n\t\t$$ = $1;\n\t  }\n\t;\n\nfixed_parameter\n\t: opt_attributes\n\t  opt_parameter_modifier\n\t  parameter_type\n\t  identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken) $4;\n\t\t$$ = new Parameter ((FullNamedExpression) $3, lt.Value, (Parameter.Modifier) $2, (Attributes) $1, lt.Location);\n\t\tlbag.AddLocation ($$, parameterModifierLocation);\n\t  }\n\t| opt_attributes\n\t  opt_parameter_modifier\n\t  parameter_type\n\t  identifier_inside_body OPEN_BRACKET CLOSE_BRACKET\n\t  {\n\t\tvar lt = (LocatedToken) $4;\n\t\treport.Error (1552, lt.Location, \"Array type specifier, [], must appear before parameter name\");\n\t\t$$ = new Parameter ((FullNamedExpression) $3, lt.Value, (Parameter.Modifier) $2, (Attributes) $1, lt.Location);\n\t\tlbag.AddLocation ($$, parameterModifierLocation);\n\t  }\n\t| attribute_sections error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  \tLocation l = GetLocation ($2);\n\t\t$$ = new Parameter (null, null, Parameter.Modifier.NONE, (Attributes) $1, l);\n\t  }\n\t| opt_attributes\n\t  opt_parameter_modifier\n\t  parameter_type\n\t  error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  \tLocation l = GetLocation ($4);\n\t\t$$ = new Parameter ((FullNamedExpression) $3, null, (Parameter.Modifier) $2, (Attributes) $1, l);\n\t\tlbag.AddLocation ($$, parameterModifierLocation);\n\t  }\n\t| opt_attributes\n\t  opt_parameter_modifier\n\t  parameter_type\n\t  identifier_inside_body\n\t  ASSIGN\n\t  {\n\t  \t++lexer.parsing_block;\n\t  }\n\t  constant_expression\n\t  {\n\t  \t--lexer.parsing_block;\n\t\tif (lang_version <= LanguageVersion.V_3) {\n\t\t\tFeatureIsNotAvailable (GetLocation ($5), \"optional parameter\");\n\t\t}\n\t\t\n\t\tParameter.Modifier mod = (Parameter.Modifier) $2;\n\t\tif (mod != Parameter.Modifier.NONE) {\n\t\t\tswitch (mod) {\n\t\t\tcase Parameter.Modifier.REF:\n\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\treport.Error (1741, GetLocation ($2), \"Cannot specify a default value for the `{0}' parameter\",\n\t\t\t\t\tParameter.GetModifierSignature (mod));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Parameter.Modifier.This:\n\t\t\t\treport.Error (1743, GetLocation ($2), \"Cannot specify a default value for the `{0}' parameter\",\n\t\t\t\t\tParameter.GetModifierSignature (mod));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (mod.ToString ());\n\t\t\t}\n\t\t\t\t\n\t\t\tmod = Parameter.Modifier.NONE;\n\t\t}\n\t\t\n\t\tif ((valid_param_mod & ParameterModifierType.DefaultValue) == 0)\n\t\t\treport.Error (1065, GetLocation ($5), \"Optional parameter is not valid in this context\");\n\t\t\n\t\tvar lt = (LocatedToken) $4;\n\t\t$$ = new Parameter ((FullNamedExpression) $3, lt.Value, mod, (Attributes) $1, lt.Location);\n\t\tlbag.AddLocation ($$, parameterModifierLocation, GetLocation ($5)); // parameterModifierLocation should be ignored when mod == NONE\n\t\t\n\t\tif ($7 != null)\n\t\t\t((Parameter) $$).DefaultValue = new DefaultParameterValueExpression ((Expression) $7);\n\t  }\n\t;\n\nopt_parameter_modifier\n\t: /* empty */\t\t{ $$ = Parameter.Modifier.NONE; }\n\t| parameter_modifiers\n\t;\n\nparameter_modifiers\n\t: parameter_modifier\n\t  {\n\t\t$$ = $1;\n\t  }\n\t| parameter_modifiers parameter_modifier\n\t  {\n\t\tParameter.Modifier p2 = (Parameter.Modifier)$2;\n  \t\tParameter.Modifier mod = (Parameter.Modifier)$1 | p2;\n  \t\tif (((Parameter.Modifier)$1 & p2) == p2) {\n  \t\t\tError_DuplicateParameterModifier (lexer.Location, p2);\n  \t\t} else {\n\t  \t\tswitch (mod & ~Parameter.Modifier.This) {\n  \t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\treport.Error (1101, lexer.Location, \"The parameter modifiers `this' and `ref' cannot be used altogether\");\n  \t\t\t\t\tbreak;\n   \t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\treport.Error (1102, lexer.Location, \"The parameter modifiers `this' and `out' cannot be used altogether\");\n  \t\t\t\t\tbreak;\n  \t\t\t\tdefault:\n \t\t\t\t\treport.Error (1108, lexer.Location, \"A parameter cannot have specified more than one modifier\");\n \t\t\t\t\tbreak;\n \t\t\t}\n  \t\t}\n  \t\t$$ = mod;\n\t  }\n\t;\n\nparameter_modifier\n\t: REF\n\t  {\n\t  \tif ((valid_param_mod & ParameterModifierType.Ref) == 0)\n\t  \t\tError_ParameterModifierNotValid (\"ref\", GetLocation ($1));\n\t\tparameterModifierLocation = GetLocation ($1);\n\t  \t$$ = Parameter.Modifier.REF;\n\t  }\n\t| OUT\n\t  {\n\t  \tif ((valid_param_mod & ParameterModifierType.Out) == 0)\n\t  \t\tError_ParameterModifierNotValid (\"out\", GetLocation ($1));\n\t\tparameterModifierLocation = GetLocation ($1);\n\t  \t$$ = Parameter.Modifier.OUT;\n\t  }\n\t| THIS\n\t  {\n\t\tif ((valid_param_mod & ParameterModifierType.This) == 0)\n\t  \t\tError_ParameterModifierNotValid (\"this\", GetLocation ($1));\n\n\t  \tif (lang_version <= LanguageVersion.ISO_2)\n\t  \t\tFeatureIsNotAvailable (GetLocation ($1), \"extension methods\");\n\t\tparameterModifierLocation = GetLocation ($1);\n\t\t$$ = Parameter.Modifier.This;\n\t  }\n\t;\n\nparameter_array\n\t: opt_attributes params_modifier type IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $4;\n\t\t$$ = new ParamsParameter ((FullNamedExpression) $3, lt.Value, (Attributes) $1, lt.Location);\n\t\tlbag.AddLocation ($$, savedLocation);\n\t  }\n\t| opt_attributes params_modifier type IDENTIFIER ASSIGN constant_expression\n\t  {\n\t\treport.Error (1751, GetLocation ($2), \"Cannot specify a default value for a parameter array\");\n\t\t\n\t\tvar lt = (LocatedToken) $4;\n\t\t$$ = new ParamsParameter ((FullNamedExpression) $3, lt.Value, (Attributes) $1, lt.Location);\t\t\n\t\tlbag.AddLocation ($$, savedLocation);\n\t  }\n\t| opt_attributes params_modifier type error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new ParamsParameter ((FullNamedExpression) $3, null, (Attributes) $1, Location.Null);\n\t  }\n\t;\n\t\nparams_modifier\n\t: PARAMS\n\t  {\n\t\tif ((valid_param_mod & ParameterModifierType.Params) == 0)\n\t\t\treport.Error (1670, (GetLocation ($1)), \"The `params' modifier is not allowed in current context\");\n\t\tsavedLocation = GetLocation ($1);\n\t  }\n\t| PARAMS parameter_modifier\n\t  {\n\t\tParameter.Modifier mod = (Parameter.Modifier)$2;\n\t\tif ((mod & Parameter.Modifier.This) != 0) {\n\t\t\treport.Error (1104, GetLocation ($1), \"The parameter modifiers `this' and `params' cannot be used altogether\");\n\t\t} else {\n\t\t\treport.Error (1611, GetLocation ($1), \"The params parameter cannot be declared as ref or out\");\n\t\t}\t  \n\t\tsavedLocation = GetLocation ($1);\n\t  }\n\t| PARAMS params_modifier\n\t  {\n\t\tError_DuplicateParameterModifier (GetLocation ($1), Parameter.Modifier.PARAMS);\n\t  }\n\t;\n\t\narglist_modifier\n\t: ARGLIST\n\t  {\n\t  \tif ((valid_param_mod & ParameterModifierType.Arglist) == 0)\n\t  \t\treport.Error (1669, GetLocation ($1), \"__arglist is not valid in this context\");\n\t  }\n\t;\n\nproperty_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  member_type\n\t  member_declaration_name\n\t  {\n\t\tlexer.parsing_generic_declaration = false;\n\t\tif (doc_support)\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t  }\n\t  OPEN_BRACE\n\t  {\n\t\tvar type = (FullNamedExpression) $3;\n\t\tcurrent_property = new Property (current_type, type, (Modifiers) $2,\n\t\t\t(MemberName) $4, (Attributes) $1);\n\t\t\t\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (547, GetLocation ($3), \"`{0}': property or indexer cannot have void type\", current_property.GetSignatureForError ());\t\t\t\t\t\n\t\t\t\n\t\tcurrent_type.AddMember (current_property);\n\t\tlbag.AddMember (current_property, GetModifierLocations (), GetLocation ($6));\n\t\t\n\t\tlexer.PropertyParsing = true;\n\t  }\n\t  accessor_declarations \n\t  {\n\t\tlexer.PropertyParsing = false;\n\t\t\n\t\tif (doc_support)\n\t\t\tcurrent_property.DocComment = ConsumeStoredComment ();\t\t\t\t\n\t  }\n\t  CLOSE_BRACE\n\t  {\n\t\tlbag.AppendToMember (current_property, GetLocation ($10));\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\t  opt_property_initializer\n\t  {\n\t\tcurrent_property = null;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  member_type\n\t  member_declaration_name\n\t  {\n\t\tlexer.parsing_generic_declaration = false;\n\t\tif (doc_support)\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  }\n\t  expression_block\n\t  {\n\t\tvar type = (FullNamedExpression) $3;\n\t\tvar property = new Property (current_type, type, (Modifiers) $2,\n\t\t\t(MemberName) $4, (Attributes) $1);\n\n\t\tproperty.Get = new Property.GetMethod (property, Modifiers.COMPILER_GENERATED, null, property.Location);\n\t\tproperty.Get.Block = (ToplevelBlock) $6;\n\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (531, property.Get.Block.StartLocation,\n\t\t\t\t\"`{0}': interface members cannot have a definition\", property.GetSignatureForError ());\n\t\t}\n\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (547, GetLocation ($3), \"`{0}': property or indexer cannot have void type\", property.GetSignatureForError ());\n\n\t\tcurrent_type.AddMember (property);\n\n\t\tcurrent_local_parameters = null;\n\t  }\n\t;\n\nopt_property_initializer\n\t: /* empty */\n\t| ASSIGN\n\t  {\n\t\t++lexer.parsing_block;\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\tstart_block (GetLocation ($1));\n\t  }\n\t  property_initializer SEMICOLON\n\t  {\n\t\t--lexer.parsing_block;\n\t\t((Property)current_property).Initializer = (Expression) $3;\n\t\tlbag.AppendToMember (current_property, GetLocation ($1), GetLocation ($4));\n\t\tend_block (GetLocation ($4));\n\t\tcurrent_local_parameters = null;\n\t  }\n\t;\n\nproperty_initializer\n\t: expression\n\t| array_initializer\n\t;\n\nindexer_declaration\n\t: opt_attributes opt_modifiers\n\t  member_type indexer_declaration_name OPEN_BRACKET\n\t  {\n\t  \tvalid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue;\n\t  }\n\t  opt_formal_parameter_list CLOSE_BRACKET \n\t  {\n\t\tvalid_param_mod = 0;\n\t\tvar type = (FullNamedExpression) $3;\n\t\tIndexer indexer = new Indexer (current_type, type, (MemberName) $4, (Modifiers) $2, (ParametersCompiled) $7, (Attributes) $1);\n\t\t\t\n\t\tcurrent_property = indexer;\n\n  \t\tcurrent_type.AddIndexer (indexer);\n\t\tlbag.AddMember (current_property, GetModifierLocations (), GetLocation ($5), GetLocation ($8));\n  \t\t\n\t\tif (type.Type != null && type.Type.Kind == MemberKind.Void)\n\t\t\treport.Error (620, GetLocation ($3), \"`{0}': indexer return type cannot be `void'\", indexer.GetSignatureForError ());  \t\t\n\n\t\tif (indexer.ParameterInfo.IsEmpty) {\n\t\t\treport.Error (1551, GetLocation ($5), \"Indexers must have at least one parameter\");\n\t\t}\n\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\n\t\tlexer.PropertyParsing = true;\n\t\tcurrent_local_parameters = (ParametersCompiled) $7;\n\t  }\n\t  indexer_body\n\t  {\n \t\tlexer.PropertyParsing = false;\n\t\tcurrent_local_parameters = null;\n\n\t\tif (current_property.AccessorFirst != null && current_property.AccessorFirst.Block == null)\n\t\t\t((Indexer) current_property).ParameterInfo.CheckParameters (current_property);\n\t  \n\t\tif (doc_support)\n\t\t\tcurrent_property.DocComment = ConsumeStoredComment ();\n\t\t\t\n\t\tcurrent_property = null;\t\t\n\t  }\n\t;\n\nindexer_body\n\t: OPEN_BRACE accessor_declarations CLOSE_BRACE\n\t  {\n\t\tlbag.AppendToMember (current_property, GetLocation ($1), GetLocation ($3));\n\t  }\n\t| expression_block\n\t  {\n\t\tcurrent_property.Get = new Indexer.GetIndexerMethod (current_property, Modifiers.COMPILER_GENERATED, current_local_parameters, null, current_property.Location);\n\t\tcurrent_property.Get.Block = (ToplevelBlock) $1;\n\t  }\n\t;\n\naccessor_declarations\n\t: get_accessor_declaration\n\t| get_accessor_declaration accessor_declarations\n\t| set_accessor_declaration\n\t| set_accessor_declaration accessor_declarations\n\t| error\n\t  {\n\t  \tif (yyToken == Token.CLOSE_BRACE) {\n\t  \t\treport.Error (548, lexer.Location, \"`{0}': property or indexer must have at least one accessor\", current_property.GetSignatureForError ());\n\t\t} else {\n\t\t\tif (yyToken == Token.SEMICOLON)\n\t\t\t\treport.Error (1597, lexer.Location, \"Semicolon after method or accessor block is not valid\");\n\t\t\telse\n\t\t\t\treport.Error (1014, GetLocation ($1), \"A get or set accessor expected\");\n\t\t}\n\t  }\n\t;\n\nget_accessor_declaration\n\t: opt_attributes opt_modifiers GET\n\t  {\n\t\tif ($2 != ModifierNone && lang_version == LanguageVersion.ISO_1) {\n\t\t\tFeatureIsNotAvailable (GetLocation ($2), \"access modifiers on properties\");\n\t\t}\n\t  \n\t\tif (current_property.Get != null) {\n\t\t\treport.Error (1007, GetLocation ($3), \"Property accessor already defined\");\n\t\t}\n\t\t\n\t\tif (current_property is Indexer) {\n\t\t\tcurrent_property.Get = new Indexer.GetIndexerMethod (current_property, (Modifiers) $2, ((Indexer)current_property).ParameterInfo.Clone (),\n\t\t\t\t(Attributes) $1, GetLocation ($3));\n\t\t} else {\n\t\t\tcurrent_property.Get = new Property.GetMethod (current_property,\n\t\t\t\t(Modifiers) $2, (Attributes) $1, GetLocation ($3));\n\t\t}\t\n\t  \n\t\tcurrent_local_parameters = current_property.Get.ParameterInfo;\t  \n\t\tlexer.PropertyParsing = false;\n\t  }\n\t  accessor_body\n\t  {\n\t  \tif ($5 != null) {\n\t  \t\tcurrent_property.Get.Block = (ToplevelBlock) $5;\t\t\t\n\t  \t\n\t\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\t\treport.Error (531, current_property.Get.Block.StartLocation,\n\t\t\t\t\t\"`{0}': interface members cannot have a definition\", current_property.Get.GetSignatureForError ());\n\t\t\t}\n\t\t\tlbag.AddMember (current_property.Get, GetModifierLocations ());\n\t\t} else {\n\t\t\tlbag.AddMember (current_property.Get, GetModifierLocations (), savedLocation);\n\t\t}\n\t  \n\t\tcurrent_local_parameters = null;\n\t\tlexer.PropertyParsing = true;\n\n\t\tif (doc_support)\n\t\t\tif (Lexer.doc_state == XmlCommentState.Error)\n\t\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t  }\n\t;\n\nset_accessor_declaration\n\t: opt_attributes opt_modifiers SET \n\t  {\n\t\tif ($2 != ModifierNone && lang_version == LanguageVersion.ISO_1) {\n\t\t\tFeatureIsNotAvailable (GetLocation ($2), \"access modifiers on properties\");\n\t\t}\n\t\t\n\t\tif (current_property.Set != null) {\n\t\t\treport.Error (1007, GetLocation ($3), \"Property accessor already defined\");\n\t\t}\n\t  \n\t\tif (current_property is Indexer) {\n\t\t\tcurrent_property.Set = new Indexer.SetIndexerMethod (current_property, (Modifiers) $2,\n\t\t\t\tParametersCompiled.MergeGenerated (compiler,\n\t\t\t\t((Indexer)current_property).ParameterInfo, true, new Parameter (\n\t\t\t\t\tcurrent_property.TypeExpression, \"value\", Parameter.Modifier.NONE, null, GetLocation ($3)),\n\t\t\t\t\tnull),\n\t\t\t\t(Attributes) $1, GetLocation ($3));\n\t\t} else {\n\t\t\tcurrent_property.Set = new Property.SetMethod (current_property, (Modifiers) $2, \n\t\t\t\tParametersCompiled.CreateImplicitParameter (current_property.TypeExpression, GetLocation ($3)),\n\t\t\t\t(Attributes) $1, GetLocation ($3));\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = current_property.Set.ParameterInfo;\t\n\t\tlexer.PropertyParsing = false;\n\t  }\n\t  accessor_body\n\t  {\n\t\tif ($5 != null) {\t\t\n\t\t\tcurrent_property.Set.Block = (ToplevelBlock) $5;\n\t\t\n\t\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\t\treport.Error (531, current_property.Set.Block.StartLocation,\n\t\t\t\t\t\"`{0}': interface members cannot have a definition\", current_property.Set.GetSignatureForError ());\n\t\t\t}\n\t\t\tlbag.AddMember (current_property.Set, GetModifierLocations ());\n\t\t} else {\n\t\t\tlbag.AddMember (current_property.Set, GetModifierLocations (), savedLocation);\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t\tlexer.PropertyParsing = true;\n\n\t\tif (doc_support\n\t\t\t&& Lexer.doc_state == XmlCommentState.Error)\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t  }\n\t;\n\naccessor_body\n\t: block \n\t| SEMICOLON\n\t  {\n\t\tsavedLocation = GetLocation ($1);\n\t  \t$$ = null;\n\t  }\n\t| error\n\t  {\n\t  \tError_SyntaxError (1043, yyToken, \"Invalid accessor body\");\n\t  \t$$ = null;\n\t  }\n\t;\n\ninterface_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  opt_partial\n\t  INTERFACE\n\t  {\n\t  }\n\t  type_declaration_name\n\t  {\n\t\tlexer.ConstraintsParsing = true;\n\t\tpush_current_container (new Interface (current_container, (MemberName) $6, (Modifiers) $2, (Attributes) $1), $3);\n\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation ($4));\t\t\n\t  }\n\t  opt_class_base\n\t  opt_type_parameter_constraints_clauses\n\t  {\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif ($9 != null)\n\t\t\tcurrent_container.SetConstraints ((List<Constraints>) $9);\n\n\t\tif (doc_support) {\n\t\t\tcurrent_container.PartialContainer.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\t  OPEN_BRACE opt_interface_member_declarations CLOSE_BRACE\n\t  {\n\t\t--lexer.parsing_declaration;\t  \n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t  opt_semicolon \n\t  {\n\t\tif ($15 == null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));\n\t\t} else {\n\t\t\tlbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));\n\t\t}\n\t\t$$ = pop_current_class ();\n\t  }\n\t| opt_attributes opt_modifiers opt_partial INTERFACE error\n\t  {\n\t\tError_SyntaxError (yyToken);\t  \n\t  }\n\t;\n\nopt_interface_member_declarations\n\t: /* empty */\n\t| interface_member_declarations\n\t;\n\ninterface_member_declarations\n\t: interface_member_declaration\n\t  {\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\t| interface_member_declarations interface_member_declaration\n\t  {\n\t\tlexer.parsing_modifiers = true;\n\t\tlexer.parsing_block = 0;\n\t  }\n\t;\n\ninterface_member_declaration\n\t: constant_declaration\n\t  {\n\t\treport.Error (525, GetLocation ($1), \"Interfaces cannot contain fields or constants\");\n\t  }\n\t| field_declaration\n\t  {\n\t\treport.Error (525, GetLocation ($1), \"Interfaces cannot contain fields or constants\");\n\t  }\n\t| method_declaration\n\t| property_declaration\n\t| event_declaration\n\t| indexer_declaration\n\t| operator_declaration\n\t  {\n\t  \treport.Error (567, GetLocation ($1), \"Interfaces cannot contain operators\");\n\t  }\n\t| constructor_declaration\n\t  {\n\t  \treport.Error (526, GetLocation ($1), \"Interfaces cannot contain contructors\");\n\t  }\n\t| type_declaration\n\t  {\n\t  \treport.Error (524, GetLocation ($1), \"Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations\");\n\t  }\n\t;\n\noperator_declaration\n\t: opt_attributes opt_modifiers operator_declarator \n\t  {\n\t  }\n\t  method_body_expression_block\n\t  {\n\t\tOperatorDeclaration decl = (OperatorDeclaration) $3;\n\t\tif (decl != null) {\n\t\t\tOperator op = new Operator (\n\t\t\t\tcurrent_type, decl.optype, decl.ret_type, (Modifiers) $2, \n\t\t\t\tcurrent_local_parameters,\n\t\t\t\t(ToplevelBlock) $5, (Attributes) $1, decl.location);\n\t\t\t\t\n\t\t\tif (op.Block == null)\n\t\t\t\top.ParameterInfo.CheckParameters (op);\n\n\t\t\tif (doc_support) {\n\t\t\t\top.DocComment = tmpComment;\n\t\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t\t}\n\n\t\t\t// Note again, checking is done in semantic analysis\n\t\t\tcurrent_type.AddOperator (op);\n\n\t\t\tlbag.AddMember (op, GetModifierLocations (), lbag.GetLocations (decl));\n\t\t\tif ($5 == null) { // Semicolon\n\t\t\t\tlbag.AddLocation (op, savedLocation); \n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\t;\n\noperator_type\n\t: type_expression_or_array\n\t| VOID\n\t  {\n\t\treport.Error (590, GetLocation ($1), \"User-defined operators cannot return void\");\n\t\t$$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));\n\t  }\n\t;\n\noperator_declarator\n\t: operator_type OPERATOR overloadable_operator OPEN_PARENS\n\t  {\n\t\tvalid_param_mod = ParameterModifierType.DefaultValue;\n\t  }\n\t  opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tvalid_param_mod = 0;\n\n\t\tLocation loc = GetLocation ($2);\n\t\tOperator.OpType op = (Operator.OpType) $3;\n\t\tcurrent_local_parameters = (ParametersCompiled)$6;\n\t\t\n\t\tint p_count = current_local_parameters.Count;\n\t\tif (p_count == 1) {\n\t\t\tif (op == Operator.OpType.Addition)\n\t\t\t\top = Operator.OpType.UnaryPlus;\n\t\t\telse if (op == Operator.OpType.Subtraction)\n\t\t\t\top = Operator.OpType.UnaryNegation;\n\t\t}\n\t\t\n\t\tif (IsUnaryOperator (op)) {\n\t\t\tif (p_count == 2) {\n\t\t\t\treport.Error (1020, loc, \"Overloadable binary operator expected\");\n\t\t\t} else if (p_count != 1) {\n\t\t\t\treport.Error (1535, loc, \"Overloaded unary operator `{0}' takes one parameter\",\n\t\t\t\t\tOperator.GetName (op));\n\t\t\t}\n\t\t} else {\n\t\t\tif (p_count == 1) {\n\t\t\t\treport.Error (1019, loc, \"Overloadable unary operator expected\");\n\t\t\t} else if (p_count != 2) {\n\t\t\t\treport.Error (1534, loc, \"Overloaded binary operator `{0}' takes two parameters\",\n\t\t\t\t\tOperator.GetName (op));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\n\t\t$$ = new OperatorDeclaration (op, (FullNamedExpression) $1, loc);\n\t\tlbag.AddLocation ($$, GetLocation ($2), savedOperatorLocation, GetLocation ($4), GetLocation ($7));\n\t  }\n\t| conversion_operator_declarator\n\t;\n\noverloadable_operator\n// Unary operators:\n\t: BANG   { $$ = Operator.OpType.LogicalNot; savedOperatorLocation = GetLocation ($1); }\n        | TILDE  { $$ = Operator.OpType.OnesComplement; savedOperatorLocation = GetLocation ($1); }  \n        | OP_INC { $$ = Operator.OpType.Increment; savedOperatorLocation = GetLocation ($1); }\n        | OP_DEC { $$ = Operator.OpType.Decrement; savedOperatorLocation = GetLocation ($1); }\n        | TRUE   { $$ = Operator.OpType.True; savedOperatorLocation = GetLocation ($1); }\n        | FALSE  { $$ = Operator.OpType.False; savedOperatorLocation = GetLocation ($1); }\n// Unary and binary:\n        | PLUS { $$ = Operator.OpType.Addition; savedOperatorLocation = GetLocation ($1); }\n        | MINUS { $$ = Operator.OpType.Subtraction; savedOperatorLocation = GetLocation ($1); }\n// Binary:\n        | STAR { $$ = Operator.OpType.Multiply; savedOperatorLocation = GetLocation ($1); }\n        | DIV {  $$ = Operator.OpType.Division; savedOperatorLocation = GetLocation ($1); }\n        | PERCENT { $$ = Operator.OpType.Modulus; savedOperatorLocation = GetLocation ($1); }\n        | BITWISE_AND { $$ = Operator.OpType.BitwiseAnd; savedOperatorLocation = GetLocation ($1); }\n        | BITWISE_OR { $$ = Operator.OpType.BitwiseOr; savedOperatorLocation = GetLocation ($1); }\n        | CARRET { $$ = Operator.OpType.ExclusiveOr; savedOperatorLocation = GetLocation ($1); }\n        | OP_SHIFT_LEFT { $$ = Operator.OpType.LeftShift; savedOperatorLocation = GetLocation ($1); }\n        | OP_SHIFT_RIGHT { $$ = Operator.OpType.RightShift; savedOperatorLocation = GetLocation ($1); }\n        | OP_EQ { $$ = Operator.OpType.Equality; savedOperatorLocation = GetLocation ($1); }\n        | OP_NE { $$ = Operator.OpType.Inequality; savedOperatorLocation = GetLocation ($1); }\n        | OP_GT { $$ = Operator.OpType.GreaterThan; savedOperatorLocation = GetLocation ($1); }\n        | OP_LT { $$ = Operator.OpType.LessThan; savedOperatorLocation = GetLocation ($1); }\n        | OP_GE { $$ = Operator.OpType.GreaterThanOrEqual; savedOperatorLocation = GetLocation ($1); }\n        | OP_LE { $$ = Operator.OpType.LessThanOrEqual; savedOperatorLocation = GetLocation ($1); }\n\t;\n\nconversion_operator_declarator\n\t: IMPLICIT OPERATOR type OPEN_PARENS\n\t  {\n\t\tvalid_param_mod = ParameterModifierType.DefaultValue;\n\t  }\n\t  opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tvalid_param_mod = 0;\n\n\t\tLocation loc = GetLocation ($2);\n\t\tcurrent_local_parameters = (ParametersCompiled)$6;  \n\n\t\tif (current_local_parameters.Count != 1) {\n\t\t\treport.Error (1535, loc, \"Overloaded unary operator `implicit' takes one parameter\");\n\t\t}\n\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\n\t\t$$ = new OperatorDeclaration (Operator.OpType.Implicit, (FullNamedExpression) $3, loc);\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($2), GetLocation ($4), GetLocation ($7));\n\t  }\n\t| EXPLICIT OPERATOR type OPEN_PARENS\n\t  {\n\t\tvalid_param_mod = ParameterModifierType.DefaultValue;\n\t  }\n\t  opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tvalid_param_mod = 0;\n\t\t\n\t\tLocation loc = GetLocation ($2);\n\t\tcurrent_local_parameters = (ParametersCompiled)$6;  \n\n\t\tif (current_local_parameters.Count != 1) {\n\t\t\treport.Error (1535, loc, \"Overloaded unary operator `explicit' takes one parameter\");\n\t\t}\n\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\n\t\t$$ = new OperatorDeclaration (Operator.OpType.Explicit, (FullNamedExpression) $3, loc);\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($2), GetLocation ($4), GetLocation ($7));\n\t  }\n\t| IMPLICIT error \n\t  {\n\t  \tError_SyntaxError (yyToken);\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t$$ = new OperatorDeclaration (Operator.OpType.Implicit, null, GetLocation ($1));\n\t  }\n\t| EXPLICIT error \n\t  {\n\t  \tError_SyntaxError (yyToken);\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  \t$$ = new OperatorDeclaration (Operator.OpType.Explicit, null, GetLocation ($1));\n\t  }\n\t;\n\nconstructor_declaration\n\t: constructor_declarator\n\t  constructor_body\n\t  { \n\t\tConstructor c = (Constructor) $1;\n\t\tc.Block = (ToplevelBlock) $2;\n\t\t\n\t\tif (doc_support)\n\t\t\tc.DocComment = ConsumeStoredComment ();\n\n\t\tcurrent_local_parameters = null;\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t;\n\nconstructor_declarator\n\t: opt_attributes\n\t  opt_modifiers\n\t  IDENTIFIER\n\t  {\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tvalid_param_mod = ParameterModifierType.All;\n\t  }\n\t  OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tvalid_param_mod = 0;\n\t\tcurrent_local_parameters = (ParametersCompiled) $6;\n\t\t\n\t\tvar lt = (LocatedToken) $3;\n\t\tvar mods = (Modifiers) $2;\n\t\tvar c = new Constructor (current_type, lt.Value, mods, (Attributes) $1, current_local_parameters, lt.Location);\n\n\t\tif (lt.Value != current_container.MemberName.Name) {\n\t\t\treport.Error (1520, c.Location, \"Class, struct, or interface method must have a return type\");\n\t\t} else if ((mods & Modifiers.STATIC) != 0) {\n\t\t\tif ((mods & Modifiers.AccessibilityMask) != 0){\n\t\t\t\treport.Error (515, c.Location,\n\t\t\t\t\t\"`{0}': static constructor cannot have an access modifier\",\n\t\t\t\t\tc.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tcurrent_type.AddConstructor (c);\n\t\tlbag.AddMember (c, GetModifierLocations (), GetLocation ($5), GetLocation ($7));\n\t\t$$ = c;\n\n\t\t//\n\t\t// start block here, so possible anonymous methods inside\n\t\t// constructor initializer can get correct parent block\n\t\t//\n\t  \tstart_block (lexer.Location);\n\t  }\n\t  opt_constructor_initializer\n\t  {\n\t\tif ($9 != null) {\n\t\t\tvar c = (Constructor) $8;\n\t\t\tc.Initializer = (ConstructorInitializer) $9;\n\t\t\t\n\t\t\tif (c.IsStatic) {\n\t\t\t\treport.Error (514, c.Location,\n\t\t\t\t\t\"`{0}': static constructor cannot have an explicit `this' or `base' constructor call\",\n\t\t\t\t\tc.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\t$$ = $8;\n\t  }\n\t;\n\nconstructor_body\n\t: block_prepared\n\t| SEMICOLON \t\t{ current_block = null; $$ = null; }\n\t;\n\nopt_constructor_initializer\n\t: /* Empty */\n\t| constructor_initializer\n\t;\n\nconstructor_initializer\n\t: COLON BASE OPEN_PARENS\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  opt_argument_list CLOSE_PARENS\n\t  {\n\t  \t--lexer.parsing_block;\n\t\t$$ = new ConstructorBaseInitializer ((Arguments) $5, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($3), GetLocation ($6));\n\t  }\n\t| COLON THIS OPEN_PARENS\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  opt_argument_list CLOSE_PARENS\n\t  {\n\t  \t--lexer.parsing_block;\n\t\t$$ = new ConstructorThisInitializer ((Arguments) $5, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($3), GetLocation ($6));\n\t  }\n\t| COLON error\n\t  {\n\t\tError_SyntaxError (yyToken);\t  \n\t\t$$ = new ConstructorThisInitializer (null, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = null;\n\t  }\n\t;\n\ndestructor_declaration\n\t: opt_attributes opt_modifiers TILDE \n\t  {\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t  }\n\t  IDENTIFIER OPEN_PARENS CLOSE_PARENS method_body\n\t  {\n\t\tvar lt = (LocatedToken) $5;\n\t\tif (lt.Value != current_container.MemberName.Name){\n\t\t\treport.Error (574, lt.Location, \"Name of destructor must match name of class\");\n\t\t} else if (current_container.Kind != MemberKind.Class){\n\t\t\treport.Error (575, lt.Location, \"Only class types can contain destructor\");\n\t\t}\n\t\t\n\t\tDestructor d = new Destructor (current_type, (Modifiers) $2,\n\t\t\tParametersCompiled.EmptyReadOnlyParameters, (Attributes) $1, lt.Location);\n\t\td.Identifier = lt.Value;\n\t\tif (doc_support)\n\t\t\td.DocComment = ConsumeStoredComment ();\n\t\t  \n\t\td.Block = (ToplevelBlock) $8;\n\t\tcurrent_type.AddMember (d);\n\t\tlbag.AddMember (d, GetModifierLocations (), GetLocation ($3), GetLocation ($6), GetLocation ($7));\n\n\t\tcurrent_local_parameters = null;\n\t  }\n\t;\n\nevent_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  EVENT type member_declaration_name\n\t  {\n\t\tcurrent_event_field = new EventField (current_type, (FullNamedExpression) $4, (Modifiers) $2, (MemberName) $5, (Attributes) $1);\n\t\tcurrent_type.AddMember (current_event_field);\n\t\t\n\t\tif (current_event_field.MemberName.ExplicitInterface != null) {\n\t\t\treport.Error (71, current_event_field.Location, \"`{0}': An explicit interface implementation of an event must use property syntax\",\n\t\t\tcurrent_event_field.GetSignatureForError ());\n\t\t}\n\t\t\n\t\t$$ = current_event_field;\n\t  }\n\t  opt_event_initializer\n\t  opt_event_declarators\n\t  SEMICOLON\n\t  {\n\t\tif (doc_support) {\n\t\t\tcurrent_event_field.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\tif (current_event_field.Initializer != null) {\n\t\t\tlbag.AddMember (current_event_field, GetModifierLocations (), GetLocation ($3), savedEventAssignLocation, GetLocation ($9));\n\t\t} else {\n\t\t\tlbag.AddMember (current_event_field, GetModifierLocations (), GetLocation ($3), GetLocation ($9));\n\t\t}\n\t\tcurrent_event_field = null;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  EVENT type member_declaration_name\n\t  OPEN_BRACE\n\t  {\n\t\tcurrent_event = new EventProperty (current_type, (FullNamedExpression) $4, (Modifiers) $2, (MemberName) $5, (Attributes) $1);\n\t\tcurrent_type.AddMember (current_event);\n\t\tlbag.AddMember (current_event, GetModifierLocations (), GetLocation ($3), GetLocation ($6));\n\t\t\n\t\tlexer.EventParsing = true;\n\t  }\n\t  event_accessor_declarations\n\t  {\n\t\tif (current_container.Kind == MemberKind.Interface)\n\t\t\treport.Error (69, GetLocation ($6), \"Event in interface cannot have add or remove accessors\");\n\t  \n\t\tlexer.EventParsing = false;\n\t  }\n\t  CLOSE_BRACE\n\t  {\n\t\tif (doc_support) {\n\t\t\tcurrent_event.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tlbag.AppendToMember (current_event, GetLocation ($9));\n\t  \tcurrent_event = null;\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\t| opt_attributes\n\t  opt_modifiers\n\t  EVENT type error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\tcurrent_type.AddMember (new EventField (current_type, (FullNamedExpression) $4, (Modifiers) $2, MemberName.Null, (Attributes) $1));\n\t  }\n\t;\n\t\nopt_event_initializer\n\t: /* empty */\n\t| ASSIGN\n\t  {\n\t  \t++lexer.parsing_block;\n\t  }\n\t  event_variable_initializer\n\t  {\n\t  \t--lexer.parsing_block;\n\t  \tsavedEventAssignLocation = GetLocation ($1);\n\t\tcurrent_event_field.Initializer = (Expression) $3;\n\t  }\n\t;\n\t\nopt_event_declarators\n\t: /* empty */\n\t| event_declarators\n\t;\n\t\nevent_declarators\n\t: event_declarator\n\t  {\n\t\tcurrent_event_field.AddDeclarator ((FieldDeclarator) $1);\n\t  }\n\t| event_declarators event_declarator\n\t  {\n\t\tcurrent_event_field.AddDeclarator ((FieldDeclarator) $2);\n\t  }\n\t;\n\t\nevent_declarator\n\t: COMMA IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t  \t$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null);\n\t  \tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t| COMMA IDENTIFIER ASSIGN\n\t  {\n\t\t++lexer.parsing_block;\n\t  }\n\t  event_variable_initializer\n\t  {\n\t\t--lexer.parsing_block;\n\t\tvar lt = (LocatedToken) $2;\t  \n\t  \t$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) $5);\n\t  \tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($3));\n\t  }\n\t;\n\t\nevent_variable_initializer\n\t: {\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (68, lexer.Location, \"`{0}': event in interface cannot have an initializer\",\n\t\t\t\tcurrent_event_field.GetSignatureForError ());\n\t\t}\n\t\t\n\t  \tif ((current_event_field.ModFlags & Modifiers.ABSTRACT) != 0) {\n\t\t\treport.Error (74, lexer.Location, \"`{0}': abstract event cannot have an initializer\",\n\t\t\t\tcurrent_event_field.GetSignatureForError ());\n\t  \t}\t\t\n\t  }\n\t  variable_initializer\n\t  {\n\t\t$$ = $2;\n\t  }\n\t;\n\t\nevent_accessor_declarations\n\t: add_accessor_declaration remove_accessor_declaration\n\t| remove_accessor_declaration add_accessor_declaration\n\t| add_accessor_declaration\n\t  {\n\t\treport.Error (65, lexer.Location, \"`{0}': event property must have both add and remove accessors\",\n\t\t\tcurrent_event.GetSignatureForError ());\n\t  } \n\t| remove_accessor_declaration\n\t  {\n\t\treport.Error (65, lexer.Location, \"`{0}': event property must have both add and remove accessors\",\n\t\t\tcurrent_event.GetSignatureForError ());\n\t  }\t\n\t| error\n\t  { \n\t\treport.Error (1055, GetLocation ($1), \"An add or remove accessor expected\");\n\t\t$$ = null;\n\t  }\n\t;\n\nadd_accessor_declaration\n\t: opt_attributes opt_modifiers ADD\n\t  {\n\t  \tif ($2 != ModifierNone) {\n\t\t\treport.Error (1609, GetLocation ($2), \"Modifiers cannot be placed on event accessor declarations\");\n\t  \t}\n\t  \t\n\t  \tcurrent_event.Add = new EventProperty.AddDelegateMethod (current_event, (Attributes) $1, GetLocation ($3));\n\t\tcurrent_local_parameters = current_event.Add.ParameterInfo;\n\t\t\n\t\tlbag.AddMember (current_event.Add, GetModifierLocations ());\n\t\tlexer.EventParsing = false;\t\t\n\t  }\n\t  event_accessor_block\n\t  {\n\t\tlexer.EventParsing = true;\n\t  \n\t  \tcurrent_event.Add.Block = (ToplevelBlock) $5;\n\t\t\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (531, current_event.Add.Block.StartLocation,\n\t\t\t\t\"`{0}': interface members cannot have a definition\", current_event.Add.GetSignatureForError ());\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\t;\n\t\nremove_accessor_declaration\n\t: opt_attributes opt_modifiers REMOVE\n\t  {\n\t  \tif ($2 != ModifierNone) {\n\t\t\treport.Error (1609, GetLocation ($2), \"Modifiers cannot be placed on event accessor declarations\");\n\t  \t}\n\t  \t\n\t  \tcurrent_event.Remove = new EventProperty.RemoveDelegateMethod (current_event, (Attributes) $1, GetLocation ($3));\n\t\tcurrent_local_parameters = current_event.Remove.ParameterInfo;\n\n\t\tlbag.AddMember (current_event.Remove, GetModifierLocations ());\n\t\tlexer.EventParsing = false;\t\t\n\t  }\n\t  event_accessor_block\n\t  {\n\t\tlexer.EventParsing = true;\n\t  \n\t  \tcurrent_event.Remove.Block = (ToplevelBlock) $5;\n\t\t\n\t\tif (current_container.Kind == MemberKind.Interface) {\n\t\t\treport.Error (531, current_event.Remove.Block.StartLocation,\n\t\t\t\t\"`{0}': interface members cannot have a definition\", current_event.Remove.GetSignatureForError ());\n\t\t}\n\t\t\n\t\tcurrent_local_parameters = null;\n\t  }\n\t;\n\nevent_accessor_block\n\t: opt_semicolon\n\t  {\n\t\treport.Error (73, lexer.Location, \"An add or remove accessor must have a body\");\n\t\t$$ = null;\n\t  }\n\t| block;\n\t;\n\nattributes_without_members\n\t: attribute_sections CLOSE_BRACE\n\t  {\n\t\tcurrent_type.UnattachedAttributes = (Attributes) $1;\n\t\treport.Error (1519, GetLocation ($1), \"An attribute is missing member declaration\");\n\t\tlexer.putback ('}');\n\t  }\n\t;\n\n// For full ast try to recover incomplete ambiguous member\n// declaration in form on class X { public int }\nincomplete_member\n\t: opt_attributes opt_modifiers member_type CLOSE_BRACE\n\t  {\n\t\treport.Error (1519, lexer.Location, \"Unexpected symbol `}' in class, struct, or interface member declaration\");\n \n\t\tlexer.putback ('}');\n\n\t  \tlexer.parsing_generic_declaration = false;\n\t\tFullNamedExpression type = (FullNamedExpression) $3;\n\t\tcurrent_field = new Field (current_type, type, (Modifiers) $2, MemberName.Null, (Attributes) $1);\n\t\tcurrent_type.AddField (current_field);\n\t\tlbag.AddMember (current_field, GetModifierLocations ());\n\t\t$$ = current_field;\n\t  }\n\t;\n\t  \nenum_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  ENUM\n\t  type_declaration_name\n\t  opt_enum_base\n\t  {\n\t\tif (doc_support)\n\t\t\tenumTypeComment = Lexer.consume_doc_comment ();\n\t  }\n\t  OPEN_BRACE\n\t  {\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\n\t\tMemberName name = (MemberName) $4;\n\t\tif (name.IsGeneric) {\n\t\t\treport.Error (1675, name.Location, \"Enums cannot have type parameters\");\n\t\t}\n\t\t\n\t\tpush_current_container (new Enum (current_container, (FullNamedExpression) $5, (Modifiers) $2, name, (Attributes) $1), null);\n\t\tif ($5 != null) {\n\t\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation ($3), savedLocation, GetLocation ($7));\n\t\t} else {\n\t\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation ($3), GetLocation ($7));\n\t\t}\n\t  }\n\t  opt_enum_member_declarations\n\t  {\n\t\tlexer.parsing_modifiers = true;\n\t  \n\t  \t// here will be evaluated after CLOSE_BLACE is consumed.\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t  CLOSE_BRACE opt_semicolon\n\t  {\n\t\tlbag.AppendToMember (current_container, GetLocation ($11));\n\t\tif ($12 != null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation ($12));\n\t\t}\n\t\tif (doc_support)\n\t\t\tcurrent_container.DocComment = enumTypeComment;\n\t\t\t\n\t\t--lexer.parsing_declaration;\n\n//\t\t\tif (doc_support)\n//\t\t\t\tem.DocComment = ev.DocComment;\n\n\t\t$$ = pop_current_class ();\n\t  }\n\t;\n\nopt_enum_base\n\t: /* empty */\n\t| COLON type\n\t {\n\t\tsavedLocation = GetLocation ($1);\n\t\t$$ = $2;\n\t }\n\t| COLON error\n\t {\n\t \tError_TypeExpected (GetLocation ($1));\n\t\t$$ = null;\n\t }\n\t;\n\nopt_enum_member_declarations\n\t: /* empty */\n\t| enum_member_declarations\n\t| enum_member_declarations COMMA\n\t  {\n\t\tlbag.AppendToMember (current_container, GetLocation ($2));\n\t  }\n\t;\n\nenum_member_declarations\n\t: enum_member_declaration\n\t| enum_member_declarations COMMA enum_member_declaration\n\t  {\n\t\tlbag.AppendToMember (current_container, GetLocation ($2));\n\t  \t$$ = $3;\n\t  }\n\t;\n\nenum_member_declaration\n\t: opt_attributes IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t  \tvar em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) $1);\n\t  \t((Enum) current_type).AddEnumMember (em);\n\n\t\tif (doc_support) {\n\t\t\tem.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\n\t\t$$ = em;\n\t  }\n\t| opt_attributes IDENTIFIER\n\t  {\n\t  \t++lexer.parsing_block;\n\t\tif (doc_support) {\n\t\t\ttmpComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.NotAllowed;\n\t\t}\n\t  }\n\t  ASSIGN constant_expression\n\t  { \n\t\t--lexer.parsing_block;\n\t\t\n\t\tvar lt = (LocatedToken) $2;\n\t  \tvar em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) $1);\n\t  \tem.Initializer = new ConstInitializer (em, (Expression) $5, GetLocation ($4));\n\t  \t((Enum) current_type).AddEnumMember (em);\n\t\t\n\t\tif (doc_support)\n\t\t\tem.DocComment = ConsumeStoredComment ();\n\n\t\t$$ = em;\n\t  }\n\t| opt_attributes IDENTIFIER error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\tvar lt = (LocatedToken) $2;\n\t  \tvar em = new EnumMember ((Enum) current_type, new MemberName (lt.Value, lt.Location), (Attributes) $1);\n\t  \t((Enum) current_type).AddEnumMember (em);\n\n\t\tif (doc_support) {\n\t\t\tem.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\n\t\t$$ = em;\n\t  }\n\t| attributes_without_members\n\t;\n\ndelegate_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  DELEGATE\n\t  member_type type_declaration_name\n\t  OPEN_PARENS\n\t  {\n\t\tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue;\n\t  }\n\t  opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tvalid_param_mod = 0;\n\n\t\tParametersCompiled p = (ParametersCompiled) $8;\n\n\t\tDelegate del = new Delegate (current_container, (FullNamedExpression) $4, (Modifiers) $2, (MemberName) $5, p, (Attributes) $1);\n\n\t\tp.CheckParameters (del);\n\n\t\tcurrent_container.AddTypeContainer (del);\n\n\t\tcurrent_delegate = del;\n\t\tlexer.ConstraintsParsing = true;\n\t  }\n\t  opt_type_parameter_constraints_clauses\n\t  {\n\t\tlexer.ConstraintsParsing = false;\n\t  }\n\t  SEMICOLON\n\t  {\n\t\tif (doc_support) {\n\t\t\tcurrent_delegate.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t  \n\t\tif ($11 != null)\n\t\t\tcurrent_delegate.SetConstraints ((List<Constraints>) $11);\n\t\tlbag.AddMember (current_delegate, GetModifierLocations (), GetLocation ($3), GetLocation ($6), GetLocation ($9), GetLocation ($13));\n\n\t\t$$ = current_delegate;\n\n\t\tcurrent_delegate = null;\n\t  }\n\t;\n\nopt_nullable\n\t: /* empty */\n\t| INTERR_NULLABLE\n\t  {\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"nullable types\");\n\t  \n\t  \t$$ = ComposedTypeSpecifier.CreateNullable (GetLocation ($1));\n\t  }\n\t;\n\nnamespace_or_type_expr\n\t: member_name\n\t| qualified_alias_member IDENTIFIER opt_type_argument_list\n\t  {\n\t\tvar lt1 = (LocatedToken) $1;\n\t\tvar lt2 = (LocatedToken) $2;\n\t\t\n\t\t$$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) $3, lt1.Location);\n\t\tlbag.AddLocation ($$, savedLocation, GetLocation ($2));\n\t  }\n\t| qualified_alias_member IDENTIFIER generic_dimension\n\t  {\n\t\tvar lt1 = (LocatedToken) $1;\n\t\tvar lt2 = (LocatedToken) $2;\n\t\tvar qam = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) $3, lt1.Location);\n\t\tlbag.AddLocation (qam.TypeArguments, Lexer.GenericDimensionLocations);\n\t\t$$ = qam;\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nmember_name\n\t: simple_name_expr\n\t| namespace_or_type_expr DOT IDENTIFIER opt_type_argument_list\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| namespace_or_type_expr DOT IDENTIFIER generic_dimension\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\tvar ma = new MemberAccess ((Expression) $1, lt.Value, (int) $4, lt.Location);\n\t\tlbag.AddLocation (ma.TypeArguments, Lexer.GenericDimensionLocations);\n\t\t$$ = ma;\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nsimple_name_expr\n\t: IDENTIFIER opt_type_argument_list\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = new SimpleName (lt.Value, (TypeArguments)$2, lt.Location);\n\t  }\n\t| IDENTIFIER generic_dimension\n\t  {  \n\t\tvar lt = (LocatedToken) $1;\n\t\tvar sn = new SimpleName (lt.Value, (int) $2, lt.Location);\n\t\tlbag.AddLocation (sn.TypeArguments, Lexer.GenericDimensionLocations);\n\t\t$$ = sn;\n\t  }\n\t;\n\n//\n// Generics arguments  (any type, without attributes)\n//\nopt_type_argument_list\n\t: /* empty */\n\t| OP_GENERICS_LT type_arguments OP_GENERICS_GT\n\t  {\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"generics\");\n\t\tvar list = locationListStack.Pop ();\n\t\tlist.Add (GetLocation ($1));\n\t\tlist.Add (GetLocation ($2));\n\t\tlbag.AddLocation ($2, list);\n\t\n\t\t$$ = $2;;\n\t  }\n\t| OP_GENERICS_LT error\n\t  {\n\t\tError_TypeExpected (lexer.Location);\n\t\t$$ = new TypeArguments ();\n\t  }\n\t;\n\ntype_arguments\n\t: type\n\t  {\n\t\tTypeArguments type_args = new TypeArguments ();\n\t\ttype_args.Add ((FullNamedExpression) $1);\n\t\t$$ = type_args;\n\t\tlocationListStack.Push (new List<Location> ());\n\t  }\n\t| type_arguments COMMA type\n\t  {\n\t\tTypeArguments type_args = (TypeArguments) $1;\n\t\ttype_args.Add ((FullNamedExpression) $3);\n\t\t$$ = type_args;\n\t\tlocationListStack.Peek ().Add (GetLocation ($2));\n\t  }\n\t;\n\n//\n// Generics parameters (identifiers only, with attributes), used in type or method declarations\n//\ntype_declaration_name\n\t: IDENTIFIER\n\t  {\n\t\tlexer.parsing_generic_declaration = true;\n\t  }\n\t  opt_type_parameter_list\n\t  {\n\t\tlexer.parsing_generic_declaration = false;\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = new MemberName (lt.Value, (TypeParameters)$3, lt.Location);\n\t  }\n\t;\n\nmember_declaration_name\n\t: method_declaration_name\n\t  {\n\t  \tMemberName mn = (MemberName)$1;\n\t  \tif (mn.TypeParameters != null)\n\t  \t\tsyntax_error (mn.Location, string.Format (\"Member `{0}' cannot declare type arguments\",\n\t  \t\t\tmn.GetSignatureForError ()));\n\t  }\n\t;\n\nmethod_declaration_name\n\t: type_declaration_name\n\t| explicit_interface IDENTIFIER opt_type_parameter_list\n\t  {\n\t\tlexer.parsing_generic_declaration = false;\t  \n\t\tvar lt = (LocatedToken) $2;\n\t\t$$ = new MemberName (lt.Value, (TypeParameters) $3, (ATypeNameExpression) $1, lt.Location);\n\t  }\n\t;\n\t\nindexer_declaration_name\n\t: THIS\n\t  {\n\t\tlexer.parsing_generic_declaration = false;\t  \n\t\t$$ = new MemberName (TypeDefinition.DefaultIndexerName, GetLocation ($1));\n\t  }\n\t| explicit_interface THIS\n\t  {\n\t\tlexer.parsing_generic_declaration = false;\n\t\t$$ = new MemberName (TypeDefinition.DefaultIndexerName, null, (ATypeNameExpression) $1, GetLocation ($2));\n\t  }\n\t;\n\nexplicit_interface\n\t: IDENTIFIER opt_type_argument_list DOT\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = new SimpleName (lt.Value, (TypeArguments) $2, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\n\t| qualified_alias_member IDENTIFIER opt_type_argument_list DOT\n\t  {\n\t\tvar lt1 = (LocatedToken) $1;\n\t\tvar lt2 = (LocatedToken) $2;\n\n\t\t$$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) $3, lt1.Location);\n\t\tlbag.AddLocation ($$, savedLocation, GetLocation ($4));\n\t  }\n\t| explicit_interface IDENTIFIER opt_type_argument_list DOT\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\t$$ = new MemberAccess ((ATypeNameExpression) $1, lt.Value, (TypeArguments) $3, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t  }\n\t;\n\t\nopt_type_parameter_list\n\t: /* empty */\n\t| OP_GENERICS_LT_DECL type_parameters OP_GENERICS_GT\n\t  {\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"generics\");\n\t  \n\t\t$$ = $2;\n\t\tvar list = locationListStack.Pop ();\n\t\tlist.Add (GetLocation ($1));\n\t\tlist.Add (GetLocation ($2));\n\t\tlbag.AddLocation ($2, list);\n\t  }\n\t;\n\ntype_parameters\n\t: type_parameter\n\t  {\n\t\tvar tparams = new TypeParameters ();\n\t\ttparams.Add ((TypeParameter)$1);\n\t\t$$ = tparams;\n\t\tlocationListStack.Push (new List<Location> ());\n\t  }\n\t| type_parameters COMMA type_parameter\n\t  {\n\t\tvar tparams = (TypeParameters) $1;\n\t\ttparams.Add ((TypeParameter)$3);\n\t\t$$ = tparams;\n\t\tlocationListStack.Peek ().Add (GetLocation ($2));\n\t  }\t  \n\t;\n\ntype_parameter\n\t: opt_attributes opt_type_parameter_variance IDENTIFIER\n\t  {\n\t\tvar lt = (LocatedToken)$3;\n\t\tvar variance = (VarianceDecl) $2;\n\t\t$$ = new TypeParameter (new MemberName (lt.Value, lt.Location), (Attributes)$1, variance);\n\t\tif (variance != null)\n\t\t\tlbag.AddLocation ($$, savedLocation);\n  \t  }\n  \t| error\n  \t  {\n  \t  \tif (GetTokenName (yyToken) == \"type\")\n\t\t\treport.Error (81, GetLocation ($1), \"Type parameter declaration must be an identifier not a type\");\n\t\telse\n\t\t\tError_SyntaxError (yyToken);\n\t\t\t\n  \t  \t$$ = new TypeParameter (MemberName.Null, null, null);\n  \t  }\n \t;\n\n//\n// All types where void is allowed\n//\ntype_and_void\n\t: type_expression_or_array\n\t| VOID\n\t  {\n\t\t$$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));\n\t  }\n\t;\n\t\nmember_type\n\t: type_and_void\n\t  {\n\t\tlexer.parsing_generic_declaration = true;\n\t  }\n\t;\n\t\n//\n// A type which does not allow `void' to be used\n//\ntype\n\t: type_expression_or_array\n\t| void_invalid\n\t;\n\t\nsimple_type\n\t: type_expression\n\t| void_invalid\n\t;\n\t\nparameter_type\n\t: type_expression_or_array\n\t| VOID\n\t  {\n\t\treport.Error (1536, GetLocation ($1), \"Invalid parameter type `void'\");\n\t\t$$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));\n\t  }\n\t;\n\ntype_expression_or_array\n\t: type_expression\n\t| type_expression rank_specifiers\n\t  {\n\t\t$$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);\n\t  }\n\t;\n\t\ntype_expression\n\t: namespace_or_type_expr opt_nullable\n\t  {\n\t\tif ($2 != null) {\n\t\t\t$$ = new ComposedCast ((ATypeNameExpression) $1, (ComposedTypeSpecifier) $2);\n\t\t} else {\n\t\t\tvar sn = $1 as SimpleName;\n\t\t\tif (sn != null && sn.Name == \"var\")\n\t\t\t\t$$ = new VarExpr (sn.Location);\n\t\t\telse\n\t\t\t\t$$ = $1;\n\t\t}\n\t  }\n\t| namespace_or_type_expr pointer_stars\n\t  {\n\t\t$$ = new ComposedCast ((ATypeNameExpression) $1, (ComposedTypeSpecifier) $2);\n\t  }\n\t| builtin_type_expression\n\t;\n\nvoid_invalid\n\t: VOID\n\t  {\n\t\tExpression.Error_VoidInvalidInTheContext (GetLocation ($1), report);\n\t\t$$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));\n\t  }\n\t;\n\nbuiltin_type_expression\n\t: builtin_types opt_nullable\n\t  {\n\t\tif ($2 != null)\n\t\t\t$$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);\n\t  }\n\t| builtin_types pointer_stars\n\t  {\n\t\t$$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);\n\t  }\n\t| VOID pointer_stars\n\t  {\n\t\t$$ = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1)), (ComposedTypeSpecifier) $2);\n\t  }\n\t;\n\ntype_list\n\t: base_type_name\n\t  {\n\t\tvar types = new List<FullNamedExpression> (2);\n\t\ttypes.Add ((FullNamedExpression) $1);\n\t\t$$ = types;\n\t  }\n\t| type_list COMMA base_type_name\n\t  {\n\t\tvar types = (List<FullNamedExpression>) $1;\n\t\ttypes.Add ((FullNamedExpression) $3);\n\t\tlbag.AddLocation (types, GetLocation ($2));\n\t\t$$ = types;\n\t  }\n\t;\n\nbase_type_name\n\t: type\n\t  {\n\t\tif ($1 is ComposedCast) {\n\t\t\treport.Error (1521, GetLocation ($1), \"Invalid base type `{0}'\", ((ComposedCast)$1).GetSignatureForError ());\n\t\t}\n\t\t$$ = $1;\n\t  }\n\t;\n\t\n/*\n * replaces all the productions for isolating the various\n * simple types, but we need this to reuse it easily in variable_type\n */\nbuiltin_types\n\t: OBJECT\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation ($1)); }\n\t| STRING\t{ $$ = new TypeExpression (compiler.BuiltinTypes.String, GetLocation ($1)); }\n\t| BOOL\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation ($1)); }\n\t| DECIMAL\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation ($1)); }\n\t| FLOAT\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation ($1)); }\n\t| DOUBLE\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Double, GetLocation ($1)); }\n\t| integral_type\n\t;\n\nintegral_type\n\t: SBYTE\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.SByte, GetLocation ($1)); }\n\t| BYTE\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Byte, GetLocation ($1)); }\n\t| SHORT\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Short, GetLocation ($1)); }\n\t| USHORT\t{ $$ = new TypeExpression (compiler.BuiltinTypes.UShort, GetLocation ($1)); }\n\t| INT\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Int, GetLocation ($1)); }\n\t| UINT\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.UInt, GetLocation ($1)); }\n\t| LONG\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Long, GetLocation ($1)); }\n\t| ULONG\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.ULong, GetLocation ($1)); }\n\t| CHAR\t\t{ $$ = new TypeExpression (compiler.BuiltinTypes.Char, GetLocation ($1)); }\n\t;\n\n//\n// Expressions, section 7.5\n//\n\n\nprimary_expression\n\t: primary_expression_or_type\n\t| literal\n\t| array_creation_expression\n\t| parenthesized_expression\n\t| default_value_expression\n\t| invocation_expression\n\t| element_access\n\t| this_access\n\t| base_access\n\t| post_increment_expression\n\t| post_decrement_expression\n\t| object_or_delegate_creation_expression\n\t| anonymous_type_expression\n\t| typeof_expression\n\t| sizeof_expression\n\t| checked_expression\n\t| unchecked_expression\n\t| pointer_member_access\n\t| anonymous_method_expression\n\t| undocumented_expressions\n\t;\n\nprimary_expression_or_type\n\t: simple_name_expr\n\t| IDENTIFIER GENERATE_COMPLETION {\n\t\tvar lt = (LocatedToken) $1;\n\t       $$ = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location);\n\t  }\n\t| member_access\n\t;\n\nliteral\n\t: boolean_literal\n\t| LITERAL\n\t| NULL\t\t\t{ $$ = new NullLiteral (GetLocation ($1)); }\n\t;\n\nboolean_literal\n\t: TRUE\t\t\t{ $$ = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation ($1)); }\n\t| FALSE\t\t\t{ $$ = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation ($1)); }\n\t;\n\n\n//\n// Here is the trick, tokenizer may think that parens is a special but\n// parser is interested in open parens only, so we merge them.\n// Consider: if (a)foo ();\n//\nopen_parens_any\n\t: OPEN_PARENS\n\t| OPEN_PARENS_CAST\n\t;\n\n// \n// Use this production to accept closing parenthesis or \n// performing completion\n//\nclose_parens\n\t: CLOSE_PARENS\n\t| COMPLETE_COMPLETION\n\t;\n\n\nparenthesized_expression\n\t: OPEN_PARENS expression CLOSE_PARENS\n\t  {\n\t\t$$ = new ParenthesizedExpression ((Expression) $2, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($3));\n\t  }\n\t| OPEN_PARENS expression COMPLETE_COMPLETION\n\t  {\n\t\t$$ = new ParenthesizedExpression ((Expression) $2, GetLocation ($1));\n\t  }\n\t;\n\nmember_access\n\t: primary_expression DOT identifier_inside_body opt_type_argument_list\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| primary_expression DOT identifier_inside_body generic_dimension\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\tvar ma = new MemberAccess ((Expression) $1, lt.Value, (int) $4, lt.Location);\n\t\tlbag.AddLocation (ma.TypeArguments, Lexer.GenericDimensionLocations);\n\t\t$$ = ma;\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| primary_expression INTERR_OPERATOR DOT identifier_inside_body opt_type_argument_list\n\t  {\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation ($2), \"null propagating operator\");\n\n\t\tvar lt = (LocatedToken) $4;\n\t\t$$ = new ConditionalMemberAccess ((Expression) $1, lt.Value, (TypeArguments) $5, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($3));\n\t  }\n\t| builtin_types DOT identifier_inside_body opt_type_argument_list\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| BASE DOT identifier_inside_body opt_type_argument_list\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberAccess (new BaseThis (GetLocation ($1)), lt.Value, (TypeArguments) $4, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| AWAIT DOT identifier_inside_body opt_type_argument_list\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberAccess (new SimpleName (\"await\", ((LocatedToken) $1).Location), lt.Value, (TypeArguments) $4, lt.Location);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| qualified_alias_member identifier_inside_body opt_type_argument_list\n\t  {\n\t\tvar lt1 = (LocatedToken) $1;\n\t\tvar lt2 = (LocatedToken) $2;\n\n\t\t$$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) $3, lt1.Location);\n\t\tlbag.AddLocation ($$, savedLocation, GetLocation ($2));\n\t  }\n\t| qualified_alias_member identifier_inside_body generic_dimension\n\t  {\n\t\tvar lt1 = (LocatedToken) $1;\n\t\tvar lt2 = (LocatedToken) $2;\n\t\tvar qam = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) $3, lt1.Location);\n\t\tlbag.AddLocation (qam.TypeArguments, Lexer.GenericDimensionLocations);\n\t\t$$ = qam;\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| primary_expression DOT GENERATE_COMPLETION {\n\t\t$$ = new CompletionMemberAccess ((Expression) $1, null,GetLocation ($3));\n\t  }\n\t| primary_expression DOT IDENTIFIER GENERATE_COMPLETION {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new CompletionMemberAccess ((Expression) $1, lt.Value, lt.Location);\n\t  }\n\t| builtin_types DOT GENERATE_COMPLETION\n\t  {\n\t\t$$ = new CompletionMemberAccess ((Expression) $1, null, lexer.Location);\n\t  }\n\t| builtin_types DOT IDENTIFIER GENERATE_COMPLETION {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new CompletionMemberAccess ((Expression) $1, lt.Value, lt.Location);\n \t  }\n\t;\n\ninvocation_expression\n\t: primary_expression open_parens_any opt_argument_list close_parens\n\t  {\n\t\t$$ = new Invocation ((Expression) $1, (Arguments) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| primary_expression open_parens_any argument_list error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Invocation ((Expression) $1, (Arguments) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| primary_expression open_parens_any error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Invocation ((Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nopt_object_or_collection_initializer\n\t: /* empty */\t\t{ $$ = null; }\n\t| object_or_collection_initializer\n\t;\n\nobject_or_collection_initializer\n\t: OPEN_BRACE opt_member_initializer_list close_brace_or_complete_completion\n\t  {\n\t  \tif ($2 == null) {\n\t  \t\t$$ = new CollectionOrObjectInitializers (GetLocation ($1));\n\t  \t} else {\n\t  \t\t$$ = new CollectionOrObjectInitializers ((List<Expression>) $2, GetLocation ($1));\n\t  \t}\n \t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\n\t| OPEN_BRACE member_initializer_list COMMA CLOSE_BRACE\n\t  {\n\t  \t$$ = new CollectionOrObjectInitializers ((List<Expression>) $2, GetLocation ($1));\n\t  \tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($4));\n\t  }\n\t;\n\nopt_member_initializer_list\n\t: /* empty */\t\t{ $$ = null; }\n\t| member_initializer_list\n\t{\n\t\t$$ = $1;\n\t}\n\t;\n\nmember_initializer_list\n\t: member_initializer\n\t  {\n\t  \tvar a = new List<Expression> ();\n\t  \ta.Add ((Expression) $1);\n\t  \t$$ = a;\n\t  }\n\t| member_initializer_list COMMA member_initializer\n\t  {\n\t  \tvar a = (List<Expression>)$1;\n\t  \ta.Add ((Expression) $3);\n\t\tlbag.AddLocation (a, GetLocation ($2));\n\t  \t$$ = a;\n\t  }\n\t| member_initializer_list error {\n\t  \tError_SyntaxError (yyToken);\n\t\t$$ = $1;\n\t  }\n\t;\n\nmember_initializer\n\t: IDENTIFIER ASSIGN initializer_value\n\t  {\n\t  \tvar lt = (LocatedToken) $1;\n\t  \t$$ = new ElementInitializer (lt.Value, (Expression)$3, lt.Location);\n\t  \tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| AWAIT ASSIGN initializer_value\n\t  {\n\t  \tvar lt = (LocatedToken) Error_AwaitAsIdentifier ($1);\n\t  \t$$ = new ElementInitializer (lt.Value, (Expression)$3, lt.Location);\n\t  \tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| GENERATE_COMPLETION \n\t  {\n\t\t$$ = new CompletionElementInitializer (null, GetLocation ($1));\n\t  }\n\t| non_assignment_expression opt_COMPLETE_COMPLETION  {\n\t\tCompletionSimpleName csn = $1 as CompletionSimpleName;\n\t\tif (csn == null)\n\t\t\t$$ = new CollectionElementInitializer ((Expression)$1);\n\t\telse\n\t\t\t$$ = new CompletionElementInitializer (csn.Prefix, csn.Location);\n\t  }\n\t| OPEN_BRACE expression_list CLOSE_BRACE\n\t  {\n\t\tif ($2 == null)\n\t\t\t$$ = new CollectionElementInitializer (GetLocation ($1));\n\t\telse {\n\t  \t\t$$ = new CollectionElementInitializer ((List<Expression>)$2, GetLocation ($1));\n\t\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t\t}\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\n\t| OPEN_BRACKET_EXPR expression_list CLOSE_BRACKET ASSIGN initializer_value\n\t  {\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"dictionary initializer\");\n\n\t\t$$ = new DictionaryElementInitializer ((List<Expression>)$2, (Expression) $5, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($4));\n\t  }\n\t| OPEN_BRACE CLOSE_BRACE\n\t  {\n\t  \treport.Error (1920, GetLocation ($1), \"An element initializer cannot be empty\");\n\t\t$$ = new CollectionElementInitializer (GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\ninitializer_value\n\t: expression\n\t| object_or_collection_initializer\n\t;\n\nopt_argument_list\n\t: /* empty */\t\t{ $$ = null; }\n\t| argument_list\n\t;\n\nargument_list\n\t: argument_or_named_argument\n\t  { \n\t\tArguments list = new Arguments (4);\n\t\tlist.Add ((Argument) $1);\n\t\t$$ = list;\n\t  }\n\t| argument_list COMMA argument\n\t  {\n\t\tArguments list = (Arguments) $1;\n\t\tif (list [list.Count - 1] is NamedArgument)\n\t\t\tError_NamedArgumentExpected ((NamedArgument) list [list.Count - 1]);\n\t\t\n\t\tlist.Add ((Argument) $3);\n\t\tlbag.AddLocation (list, GetLocation ($2));\n\t\t$$ = list;\n\t  }\n\t| argument_list COMMA named_argument\n\t  {\n\t\tArguments list = (Arguments) $1;\n\t\tNamedArgument a = (NamedArgument) $3;\n\t\tfor (int i = 0; i < list.Count; ++i) {\n\t\t\tNamedArgument na = list [i] as NamedArgument;\n\t\t\tif (na != null && na.Name == a.Name)\n\t\t\t\treport.Error (1740, na.Location, \"Named argument `{0}' specified multiple times\",\n\t\t\t\t\tna.Name);\n\t\t}\n\t\t\n\t\tlist.Add (a);\n\t\tlbag.AddLocation (list, GetLocation ($2));\n\t\t$$ = list;\n\t  }\n\t| argument_list COMMA error\n\t  {\n\t  \tif (lexer.putback_char == -1)\n\t  \t\tlexer.putback (')'); // TODO: Wrong but what can I do\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = $1;\n\t  }\n\t| COMMA error\n\t  {\n\t  \treport.Error (839, GetLocation ($1), \"An argument is missing\");\n\t  \t$$ = null;\n\t  }\n\t;\n\nargument\n\t: expression\n\t  {\n\t\t$$ = new Argument ((Expression) $1);\n\t  }\n\t| non_simple_argument\n\t;\n\nargument_or_named_argument\n\t: argument\n\t| named_argument\n\t;\n\nnon_simple_argument\n\t: REF variable_reference \n\t  { \n\t\t$$ = new Argument ((Expression) $2, Argument.AType.Ref);\n\t\tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t| OUT variable_reference \n\t  { \n\t\t$$ = new Argument ((Expression) $2, Argument.AType.Out);\n\t\tlbag.AddLocation ($$, GetLocation ($1));\n\t  }\n\t| ARGLIST OPEN_PARENS argument_list CLOSE_PARENS\n\t  {\n\t\t$$ = new Argument (new Arglist ((Arguments) $3, GetLocation ($1)));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| ARGLIST OPEN_PARENS CLOSE_PARENS\n\t  {\n\t\t$$ = new Argument (new Arglist (GetLocation ($1)));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($3));\n\t  }\t  \n\t;\n\nvariable_reference\n\t: expression\n\t;\n\nelement_access\n\t: primary_expression OPEN_BRACKET_EXPR expression_list_arguments CLOSE_BRACKET\t\n\t  {\n\t\t$$ = new ElementAccess ((Expression) $1, (Arguments) $3, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t  }\n\t| primary_expression INTERR_OPERATOR OPEN_BRACKET_EXPR expression_list_arguments CLOSE_BRACKET\t\n\t  {\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation ($2), \"null propagating operator\");\n\n\t\t$$ = new ElementAccess ((Expression) $1, (Arguments) $4, GetLocation ($3)) {\n\t\t\tConditionalAccess = true\n\t\t};\n\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($5));\n\t  }\n\t| primary_expression OPEN_BRACKET_EXPR expression_list_arguments error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new ElementAccess ((Expression) $1, (Arguments) $3, GetLocation ($2));\n\t  }\n\t| primary_expression OPEN_BRACKET_EXPR error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new ElementAccess ((Expression) $1, null, GetLocation ($2));\n\t  }\n\t;\n\nexpression_list\n\t: expression_or_error\n\t  {\n\t\tvar list = new List<Expression> (4);\n\t\tlist.Add ((Expression) $1);\n\t\t$$ = list;\n\t  }\n\t| expression_list COMMA expression_or_error\n\t  {\n\t\tvar list = (List<Expression>) $1;\n\t\tlist.Add ((Expression) $3);\n\t\tlbag.AddLocation (list, GetLocation ($2));\n\t\t$$ = list;\n\t  }\n\t;\n\t\nexpression_list_arguments\n\t: expression_list_argument\n\t  {\n\t\tArguments args = new Arguments (4);\n\t\targs.Add ((Argument) $1);\n\t\t$$ = args;\n\t  }\n\t| expression_list_arguments COMMA expression_list_argument\n\t  {\n\t\tArguments args = (Arguments) $1;\n\t\tif (args [args.Count - 1] is NamedArgument && !($3 is NamedArgument))\n\t\t\tError_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]);\n\t  \n\t\targs.Add ((Argument) $3);\n\t\tlbag.AddLocation (args, GetLocation ($2));\n\t\t$$ = args;\t  \n\t  }\n\t;\n\t\nexpression_list_argument\n\t: expression\n\t  {\n\t  \t$$ = new Argument ((Expression) $1);\n\t  }\n\t| named_argument\n\t;\n\nthis_access\n\t: THIS\n\t  {\n\t\t$$ = new This (GetLocation ($1));\n\t  }\n\t;\n\nbase_access\n\t: BASE OPEN_BRACKET_EXPR expression_list_arguments CLOSE_BRACKET\n\t  {\n\t  \t$$ = new ElementAccess (new BaseThis (GetLocation ($1)), (Arguments) $3, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t  }\n\t| BASE OPEN_BRACKET error\n\t  {\n\t  \tError_SyntaxError (yyToken);\n\t\t$$ = new ElementAccess (null, null, GetLocation ($2));\n\t  }\n\t;\n\npost_increment_expression\n\t: primary_expression OP_INC\n\t  {\n\t\t$$ = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) $1, GetLocation ($2));\n\t  }\n\t;\n\npost_decrement_expression\n\t: primary_expression OP_DEC\n\t  {\n\t\t$$ = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) $1, GetLocation ($2));\n\t  }\n\t;\n\t\nobject_or_delegate_creation_expression\n\t: NEW new_expr_type open_parens_any opt_argument_list CLOSE_PARENS opt_object_or_collection_initializer\n\t  {\n\t\tif ($6 != null) {\n\t\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"object initializers\");\n\t\t\t\t\n\t\t\t$$ = new NewInitialize ((FullNamedExpression) $2, (Arguments) $4, (CollectionOrObjectInitializers) $6, GetLocation ($1));\n\t\t} else {\n\t\t\t$$ = new New ((FullNamedExpression) $2, (Arguments) $4, GetLocation ($1));\n\t\t}\n\t\t\n\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($5));\n\t  }\n\t| NEW new_expr_type object_or_collection_initializer\n\t  {\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"collection initializers\");\n\t  \n\t\t$$ = new NewInitialize ((FullNamedExpression) $2, null, (CollectionOrObjectInitializers) $3, GetLocation ($1));\n\t  }\n\t;\n\narray_creation_expression\n\t: NEW new_expr_type OPEN_BRACKET_EXPR expression_list CLOSE_BRACKET\n\t  opt_rank_specifier\n\t  opt_array_initializer\n\t  {\n\t\t$$ = new ArrayCreation ((FullNamedExpression) $2, (List<Expression>) $4,\n\t\t\t\tnew ComposedTypeSpecifier (((List<Expression>) $4).Count, GetLocation ($3)) {\n\t  \t\t\t\tNext = (ComposedTypeSpecifier) $6\n\t\t\t  \t}, (ArrayInitializer) $7, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($5));\n\t  }\n\t| NEW new_expr_type rank_specifiers opt_array_initializer\n\t  {\n\t  \tif ($4 == null)\n\t  \t\treport.Error (1586, GetLocation ($1), \"Array creation must have array size or array initializer\");\n\n\t\t$$ = new ArrayCreation ((FullNamedExpression) $2, (ComposedTypeSpecifier) $3, (ArrayInitializer) $4, GetLocation ($1));\n\t  }\n\t| NEW rank_specifier array_initializer\n\t  {\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"implicitly typed arrays\");\n\t  \n\t\t$$ = new ImplicitlyTypedArrayCreation ((ComposedTypeSpecifier) $2, (ArrayInitializer) $3, GetLocation ($1));\n\t  }\n\t| NEW new_expr_type OPEN_BRACKET CLOSE_BRACKET OPEN_BRACKET_EXPR error CLOSE_BRACKET\n\t  {\n\t\treport.Error (178, GetLocation ($6), \"Invalid rank specifier, expecting `,' or `]'\");\n\t\t$$ = new ArrayCreation ((FullNamedExpression) $2, null, GetLocation ($1));\n\t  }\n\t| NEW new_expr_type error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t// It can be any of new expression, create the most common one\n\t\t$$ = new New ((FullNamedExpression) $2, null, GetLocation ($1));\n\t  }\n\t;\n\nnew_expr_type\n\t: {\n\t\t++lexer.parsing_type;\n\t  }\n\t  simple_type\n\t  {\n\t\t--lexer.parsing_type;\n\t\t$$ = $2;\n\t  }\n\t;\n\nanonymous_type_expression\n\t: NEW OPEN_BRACE anonymous_type_parameters_opt_comma CLOSE_BRACE\n\t  {\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t  \t\tFeatureIsNotAvailable (GetLocation ($1), \"anonymous types\");\n\n\t\t$$ = new NewAnonymousType ((List<AnonymousTypeParameter>) $3, current_container, GetLocation ($1));\n\t\t\n\t\t// TODO: lbag comma location\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| NEW OPEN_BRACE GENERATE_COMPLETION\n\t  {\n\t\t$$ = new EmptyCompletion ();\n\t  }\n\t;\n\nanonymous_type_parameters_opt_comma\n\t: anonymous_type_parameters_opt\n\t| anonymous_type_parameters COMMA\n\t;\n\nanonymous_type_parameters_opt\n\t: { $$ = null; }\n\t| anonymous_type_parameters\n\t;\n\nanonymous_type_parameters\n\t: anonymous_type_parameter\n\t  {\n\t  \tvar a = new List<AnonymousTypeParameter> (4);\n\t  \ta.Add ((AnonymousTypeParameter) $1);\n\t  \t$$ = a;\n\t  }\n\t| anonymous_type_parameters COMMA anonymous_type_parameter\n\t  {\n\t  \tvar a = (List<AnonymousTypeParameter>) $1;\n\t  \ta.Add ((AnonymousTypeParameter) $3);\n\t  \tlbag.AddLocation (a, GetLocation ($2));\n\n\t  \t$$ = a;\n\t  }\n\t| COMPLETE_COMPLETION\n\t  {\n\t\t$$ = new EmptyCompletion ();\n\t  }\n\t| anonymous_type_parameter COMPLETE_COMPLETION\n\t  {\n\t  \t$$ = $1;\n\t  }\n\t;\n\nanonymous_type_parameter\n\t: identifier_inside_body ASSIGN variable_initializer\n\t  {\n\t\tvar lt = (LocatedToken)$1;\n\t  \t$$ = new AnonymousTypeParameter ((Expression)$3, lt.Value, lt.Location);\n\t  \tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken)$1;\n\t  \t$$ = new AnonymousTypeParameter (new SimpleName (lt.Value, lt.Location),\n\t  \t\tlt.Value, lt.Location);\n\t  }\n\t| member_access\n\t  {\n\t  \tMemberAccess ma = (MemberAccess) $1;\n\t  \t$$ = new AnonymousTypeParameter (ma, ma.Name, ma.Location);\n\t  }\n\t| error\n\t  {\n\t\treport.Error (746, lexer.Location,\n\t\t\t\"Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression\");\n\t\t$$ = null;\n\t  }\n\t;\n\nopt_rank_specifier\n\t: /* empty */\n\t| rank_specifiers\n\t;\n\nrank_specifiers\n\t: rank_specifier\n\t| rank_specifier rank_specifiers\n\t  {\n\t  \t((ComposedTypeSpecifier) $1).Next = (ComposedTypeSpecifier) $2;\n\t  \t$$ = $1;\n\t  }\n\t;\n\nrank_specifier\n\t: OPEN_BRACKET CLOSE_BRACKET\n\t  {\n\t\t$$ = ComposedTypeSpecifier.CreateArrayDimension (1, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| OPEN_BRACKET dim_separators CLOSE_BRACKET\n\t  {\n\t\t$$ = ComposedTypeSpecifier.CreateArrayDimension ((int)$2, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\n\t;\n\ndim_separators\n\t: COMMA\n\t  {\n\t\t$$ = 2;\n\t  }\n\t| dim_separators COMMA\n\t  {\n\t\t$$ = ((int) $1) + 1;\n\t  }\n\t;\n\nopt_array_initializer\n\t: /* empty */\n\t  {\n\t\t$$ = null;\n\t  }\n\t| array_initializer\n\t  {\n\t\t$$ = $1;\n\t  }\n\t;\n\narray_initializer\n\t: OPEN_BRACE CLOSE_BRACE\n\t  {\n\t\tvar ai = new ArrayInitializer (0, GetLocation ($1));\n\t\tai.VariableDeclaration = current_variable;\n\t\tlbag.AddLocation (ai, GetLocation ($2));\n\t\t$$ = ai;\n\t  }\n\t| OPEN_BRACE variable_initializer_list opt_comma CLOSE_BRACE\n\t  {\n\t\tvar ai = new ArrayInitializer ((List<Expression>) $2, GetLocation ($1));\n\t\tai.VariableDeclaration = current_variable;\n\t\tif ($3 != null) {\n\t\t\tlbag.AddLocation (ai, GetLocation ($3), GetLocation ($4));\n\t\t} else {\n\t\t\tlbag.AddLocation (ai, GetLocation ($4));\n\t\t}\n\t\t$$ = ai;\n\t  }\n\t;\n\nvariable_initializer_list\n\t: variable_initializer\n\t  {\n\t\tvar list = new List<Expression> (4);\n\t\tlist.Add ((Expression) $1);\n\t\t$$ = list;\n\t  }\n\t| variable_initializer_list COMMA variable_initializer\n\t  {\n\t\tvar list = (List<Expression>) $1;\n\t\tlist.Add ((Expression) $3);\n\t\tlbag.AddLocation (list, GetLocation ($2));\n\t\t$$ = list;\n\t  }\n\t;\n\ntypeof_expression\n\t: TYPEOF open_parens_any typeof_type_expression CLOSE_PARENS\n\t  {\n\t\t$$ = new TypeOf ((FullNamedExpression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t;\n\t\ntypeof_type_expression\n\t: type_and_void\n\t| error\n\t {\n\t \tError_TypeExpected (lexer.Location);\n\t \t$$ = null;\n\t }\n\t;\n\ngeneric_dimension\n\t: GENERIC_DIMENSION\n\t  {\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"generics\");\n\n\t\t$$ = $1;\n\t  }\n\t;\n\t\nqualified_alias_member\n\t: IDENTIFIER DOUBLE_COLON\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\tif (lang_version == LanguageVersion.ISO_1)\n\t\t\tFeatureIsNotAvailable (lt.Location, \"namespace alias qualifier\");\n\t\tsavedLocation = GetLocation ($2);\n\t\t$$ = lt;\t\t\n\t  }\n\t;\n\nsizeof_expression\n\t: SIZEOF open_parens_any type CLOSE_PARENS\n\t  { \n\t\t$$ = new SizeOf ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| SIZEOF open_parens_any type error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new SizeOf ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nchecked_expression\n\t: CHECKED open_parens_any expression CLOSE_PARENS\n\t  {\n\t\t$$ = new CheckedExpr ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| CHECKED error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new CheckedExpr (null, GetLocation ($1));\n\t  }\n\t;\n\nunchecked_expression\n\t: UNCHECKED open_parens_any expression CLOSE_PARENS\n\t  {\n\t\t$$ = new UnCheckedExpr ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| UNCHECKED error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new UnCheckedExpr (null, GetLocation ($1));\n\t  }\n\t;\n\npointer_member_access\n\t: primary_expression OP_PTR IDENTIFIER opt_type_argument_list\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberAccess (new Indirection ((Expression) $1, GetLocation ($2)), lt.Value, (TypeArguments) $4, lt.Location);\n\t  }\n\t;\n\nanonymous_method_expression\n\t: DELEGATE opt_anonymous_method_signature\n\t  {\n\t\tstart_anonymous (false, (ParametersCompiled) $2, false, GetLocation ($1));\n\t  }\n\t  block\n\t  {\n\t\t$$ = end_anonymous ((ParametersBlock) $4);\n\t\tif ((ParametersCompiled) $2 != ParametersCompiled.Undefined) {\n\t\t\tlbag.AddLocation ($$, GetLocation ($1), PopLocation (), PopLocation ());\n\t\t} else {\n\t\t\tlbag.AddLocation ($$, GetLocation ($1));\n\t\t}\n\t  }\n\t| ASYNC DELEGATE opt_anonymous_method_signature\n\t  {\n\t\tstart_anonymous (false, (ParametersCompiled) $3, true, GetLocation ($1));\n\t  }\n\t  block\n\t  {\n\t\t$$ = end_anonymous ((ParametersBlock) $5);\n\t\t\n\t\tif ((ParametersCompiled) $3 != ParametersCompiled.Undefined) {\n\t\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($2), PopLocation (), PopLocation ());\n\t\t} else {\n\t\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($2));\n\t\t}\n\t  }\n\t;\n\nopt_anonymous_method_signature\n\t: \n\t  {\n\t\t$$ = ParametersCompiled.Undefined;\n\t  } \n\t| anonymous_method_signature\n\t;\n\nanonymous_method_signature\n\t: OPEN_PARENS\n\t  {\n\t  \tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n\t  opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\tvalid_param_mod = 0;\n\t  \t$$ = $3;\n\t  \tPushLocation (GetLocation ($3));\n\t  \tPushLocation (GetLocation ($1));\n\t  }\n\t;\n\ndefault_value_expression\n\t: DEFAULT open_parens_any type CLOSE_PARENS\n\t  {\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"default value expression\");\n\n\t\t$$ = new DefaultValueExpression ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t;\n\nunary_expression\n\t: primary_expression\n\t| BANG prefixed_unary_expression\n\t  {\n\t\t$$ = new Unary (Unary.Operator.LogicalNot, (Expression) $2, GetLocation ($1));\n\t  }\n\t| TILDE prefixed_unary_expression\n\t  {\n\t\t$$ = new Unary (Unary.Operator.OnesComplement, (Expression) $2, GetLocation ($1));\n\t  }\n\t| OPEN_PARENS_CAST type CLOSE_PARENS prefixed_unary_expression\n\t  {\n\t\t$$ = new Cast ((FullNamedExpression) $2, (Expression) $4, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\n\t| AWAIT prefixed_unary_expression\n\t  {\n\t\tif (!async_block) {\n\t\t\t if (current_anonymous_method is LambdaExpression) {\n\t\t\t\treport.Error (4034, GetLocation ($1),\n\t\t\t\t\t\"The `await' operator can only be used when its containing lambda expression is marked with the `async' modifier\");\n\t\t\t} else if (current_anonymous_method != null) {\n\t\t\t\treport.Error (4035, GetLocation ($1),\n\t\t\t\t\t\"The `await' operator can only be used when its containing anonymous method is marked with the `async' modifier\");\n\t\t\t} else if (interactive_async != null) {\n\t\t\t\tcurrent_block.Explicit.RegisterAsyncAwait ();\n\t\t\t\tinteractive_async = true;\n\t\t\t} else {\n\t\t\t\treport.Error (4033, GetLocation ($1),\n\t\t\t\t\t\"The `await' operator can only be used when its containing method is marked with the `async' modifier\");\n\t\t\t}\n\t\t} else {\n\t\t\tcurrent_block.Explicit.RegisterAsyncAwait ();\n\t\t}\n\t\t\n\t\t$$ = new Await ((Expression) $2, GetLocation ($1));\n\t  }\n\t| BANG error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Unary (Unary.Operator.LogicalNot, null, GetLocation ($1));\n\t  }\n\t| TILDE error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Unary (Unary.Operator.OnesComplement, null, GetLocation ($1));\n\t  }\n\t| OPEN_PARENS_CAST type CLOSE_PARENS error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Cast ((FullNamedExpression) $2, null, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\n\t| AWAIT error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Await (null, GetLocation ($1));\n\t  }\n\t;\n\n\t//\n\t// The idea to split this out is from Rhys' grammar\n\t// to solve the problem with casts.\n\t//\nprefixed_unary_expression\n\t: unary_expression\n\t| PLUS prefixed_unary_expression\n\t  { \n\t  \t$$ = new Unary (Unary.Operator.UnaryPlus, (Expression) $2, GetLocation ($1));\n\t  } \n\t| MINUS prefixed_unary_expression \n\t  { \n\t\t$$ = new Unary (Unary.Operator.UnaryNegation, (Expression) $2, GetLocation ($1));\n\t  }\n\t| OP_INC prefixed_unary_expression \n\t  {\n\t\t$$ = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) $2, GetLocation ($1));\n\t  }\n\t| OP_DEC prefixed_unary_expression \n\t  {\n\t\t$$ = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) $2, GetLocation ($1));\n\t  }\n\t| STAR prefixed_unary_expression\n\t  {\n\t\t$$ = new Indirection ((Expression) $2, GetLocation ($1));\n\t  }\n\t| BITWISE_AND prefixed_unary_expression\n\t  {\n\t\t$$ = new Unary (Unary.Operator.AddressOf, (Expression) $2, GetLocation ($1));\n\t  }\n\t| PLUS error\n\t  { \n\t\tError_SyntaxError (yyToken);\n\n\t  \t$$ = new Unary (Unary.Operator.UnaryPlus, null, GetLocation ($1));\n\t  } \n\t| MINUS error \n\t  { \n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Unary (Unary.Operator.UnaryNegation, null, GetLocation ($1));\n\t  }\n\t| OP_INC error \n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new UnaryMutator (UnaryMutator.Mode.PreIncrement, null, GetLocation ($1));\n\t  }\n\t| OP_DEC error \n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new UnaryMutator (UnaryMutator.Mode.PreDecrement, null, GetLocation ($1));\n\t  }\n\t| STAR error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Indirection (null, GetLocation ($1));\n\t  }\n\t| BITWISE_AND error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Unary (Unary.Operator.AddressOf, null, GetLocation ($1));\n\t  }\n\t;\n\nmultiplicative_expression\n\t: prefixed_unary_expression\n\t| multiplicative_expression STAR prefixed_unary_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.Multiply, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| multiplicative_expression DIV prefixed_unary_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.Division, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| multiplicative_expression PERCENT prefixed_unary_expression \n\t  {\n\t\t$$ = new Binary (Binary.Operator.Modulus, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| multiplicative_expression STAR error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.Multiply, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| multiplicative_expression DIV error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.Division, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| multiplicative_expression PERCENT error \n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.Modulus, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nadditive_expression\n\t: multiplicative_expression\n\t| additive_expression PLUS multiplicative_expression \n\t  {\n\t\t$$ = new Binary (Binary.Operator.Addition, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| additive_expression MINUS multiplicative_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.Subtraction, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| additive_expression PLUS error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.Addition, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| additive_expression MINUS error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.Subtraction, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| additive_expression AS type\n\t  {\n\t\t$$ = new As ((Expression) $1, (Expression) $3, GetLocation ($2));\n\t  }\n\t| additive_expression IS is_match_expr opt_identifier\n\t  {\n\t\tvar is_expr = new Is ((Expression) $1, (Expression) $3, GetLocation ($2));\n\t\tif ($4 != null) {\n\t\t\tif (lang_version != LanguageVersion.Experimental)\n\t\t\t\tFeatureIsNotAvailable (GetLocation ($4), \"type pattern matching\");\n\n\t\t\tvar lt = (LocatedToken) $4;\n\t\t\tis_expr.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t\tcurrent_block.AddLocalName (is_expr.Variable);\n\t\t}\n\n\t\t$$ = is_expr;\n\t  }\n\t| additive_expression AS error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new As ((Expression) $1, null, GetLocation ($2));\n\t  }\n\t| additive_expression IS error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Is ((Expression) $1, null, GetLocation ($2));\n\t  }\n\t| AWAIT IS type\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = new Is (new SimpleName (lt.Value, lt.Location), (Expression) $3, GetLocation ($2));\n\t  }\n\t| AWAIT AS type\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\t$$ = new As (new SimpleName (lt.Value, lt.Location), (Expression) $3, GetLocation ($2));\n\t  }\n\t;\n\nis_match_expr\n\t: match_type\n\t| match_type rank_specifiers\n\t  {\n\t\tif ($1 is VarExpr)\n\t\t\t$1 = new SimpleName (\"var\", ((VarExpr) $1).Location);\n\n\t\t$$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);\n\t  }\n\t| literal\n\t| PLUS prefixed_unary_expression\n\t  {\n\t\t$$ = new Unary (Unary.Operator.UnaryPlus, (Expression) $2, GetLocation ($1));\n\t  }\n\t| MINUS prefixed_unary_expression\n\t  {\n\t\t$$ = new Unary (Unary.Operator.UnaryNegation, (Expression) $2, GetLocation ($1));\n\t  }\n\t;\n\nmatch_type\n\t: primary_expression_or_type opt_nullable\n\t  {\n\t\tExpression expr = (Expression) $1;\n\t\tif ($2 == null) {\n\t\t\tSimpleName sn = expr as SimpleName;\n\t\t\tif (sn != null && sn.Name == \"var\")\n\t\t\t\t$$ = new VarExpr (sn.Location);\n\t\t\telse\n\t\t\t\t$$ = $1;\n\t\t} else if (expr is ATypeNameExpression) {\n\t\t\t$$ = new ComposedCast ((ATypeNameExpression)expr, (ComposedTypeSpecifier) $2);\n\t\t} else {\n\t\t\tError_ExpectingTypeName (expr);\n\t\t\t$$ = null;\n\t\t}\n\t  }\n\t| primary_expression_or_type pointer_stars\n\t  {\n\t\tATypeNameExpression expr = $1 as ATypeNameExpression;\n\n\t\tif (expr != null) {\n\t\t\t$$ = new ComposedCast (expr, (ComposedTypeSpecifier) $2);\n\t\t} else {\n\t\t\tError_ExpectingTypeName ((Expression)$1);\n\t\t\t$$ = expr;\n\t\t}\n\t  }\n\t| builtin_type_expression\n\t| void_invalid\n\t;\n\nshift_expression\n\t: additive_expression\n\t| shift_expression OP_SHIFT_LEFT additive_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.LeftShift, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| shift_expression OP_SHIFT_RIGHT additive_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.RightShift, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| shift_expression OP_SHIFT_LEFT error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.LeftShift, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| shift_expression OP_SHIFT_RIGHT error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.RightShift, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t; \n\nrelational_expression\n\t: shift_expression\n\t| relational_expression OP_LT shift_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.LessThan, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| relational_expression OP_GT shift_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.GreaterThan, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| relational_expression OP_LE shift_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.LessThanOrEqual, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| relational_expression OP_GE shift_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| relational_expression OP_LT error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.LessThan, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| relational_expression OP_GT error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.GreaterThan, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| relational_expression OP_LE error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.LessThanOrEqual, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| relational_expression OP_GE error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nequality_expression\n\t: relational_expression\n\t| equality_expression OP_EQ relational_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.Equality, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| equality_expression OP_NE relational_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.Inequality, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| equality_expression OP_EQ error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.Equality, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| equality_expression OP_NE error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.Inequality, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t; \n\nand_expression\n\t: equality_expression\n\t| and_expression BITWISE_AND equality_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.BitwiseAnd, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| and_expression BITWISE_AND error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.BitwiseAnd, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nexclusive_or_expression\n\t: and_expression\n\t| exclusive_or_expression CARRET and_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.ExclusiveOr, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| exclusive_or_expression CARRET error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.ExclusiveOr, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\ninclusive_or_expression\n\t: exclusive_or_expression\n\t| inclusive_or_expression BITWISE_OR exclusive_or_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.BitwiseOr, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| inclusive_or_expression BITWISE_OR error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.BitwiseOr, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nconditional_and_expression\n\t: inclusive_or_expression\n\t| conditional_and_expression OP_AND inclusive_or_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.LogicalAnd, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| conditional_and_expression OP_AND error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.LogicalAnd, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nconditional_or_expression\n\t: conditional_and_expression\n\t| conditional_or_expression OP_OR conditional_and_expression\n\t  {\n\t\t$$ = new Binary (Binary.Operator.LogicalOr, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| conditional_or_expression OP_OR error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Binary (Binary.Operator.LogicalOr, (Expression) $1, null);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\t\nnull_coalescing_expression\n\t: conditional_or_expression\n\t| conditional_or_expression OP_COALESCING null_coalescing_expression\n\t  {\n\t\tif (lang_version < LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (GetLocation ($2), \"null coalescing operator\");\n\t\t\t\n\t\t$$ = new Nullable.NullCoalescingOperator ((Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nconditional_expression\n\t: null_coalescing_expression\n\t| null_coalescing_expression INTERR expression COLON expression\n\t  {\n\t\t$$ = new Conditional (new BooleanExpression ((Expression) $1), (Expression) $3, (Expression) $5, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t  }\n\t| null_coalescing_expression INTERR expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Conditional (new BooleanExpression ((Expression) $1), (Expression) $3, null, GetLocation ($2));\n\t  }\n\t| null_coalescing_expression INTERR expression COLON error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Conditional (new BooleanExpression ((Expression) $1), (Expression) $3, null, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t  }\n\t| null_coalescing_expression INTERR expression COLON CLOSE_BRACE\n\t  {\n\t\tError_SyntaxError (Token.CLOSE_BRACE);\n\n\t\t$$ = new Conditional (new BooleanExpression ((Expression) $1), (Expression) $3, null, GetLocation ($2));\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t\tlexer.putback ('}');\n\t  }\n\t;\n\nassignment_expression\n\t: prefixed_unary_expression ASSIGN expression\n\t  {\n\t\t$$ = new SimpleAssign ((Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_MULT_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.Multiply, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_DIV_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.Division, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_MOD_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.Modulus, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_ADD_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.Addition, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_SUB_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.Subtraction, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_SHIFT_LEFT_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.LeftShift, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_SHIFT_RIGHT_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.RightShift, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_AND_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.BitwiseAnd, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_OR_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.BitwiseOr, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| prefixed_unary_expression OP_XOR_ASSIGN expression\n\t  {\n\t\t$$ = new CompoundAssign (Binary.Operator.ExclusiveOr, (Expression) $1, (Expression) $3);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nlambda_parameter_list\n\t: lambda_parameter\n\t  {\n\t\tvar pars = new List<Parameter> (4);\n\t\tpars.Add ((Parameter) $1);\n\t\tparameterListCommas.Clear ();\n\t\t$$ = pars;\n\t  }\n\t| lambda_parameter_list COMMA lambda_parameter\n\t  {\n\t\tvar pars = (List<Parameter>) $1;\n\t\tParameter p = (Parameter)$3;\n\t\tif (pars[0].GetType () != p.GetType ()) {\n\t\t\treport.Error (748, p.Location, \"All lambda parameters must be typed either explicitly or implicitly\");\n\t\t}\n\t\t\n\t\tpars.Add (p);\n\t\tparameterListCommas.Add (GetLocation ($2));\n\n\t\t$$ = pars;\n\t  }\n\t;\n\nlambda_parameter\n\t: parameter_modifier parameter_type identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\n\t\t$$ = new Parameter ((FullNamedExpression) $2, lt.Value, (Parameter.Modifier) $1, null, lt.Location);\n\t  }\n\t| parameter_type identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\n\t\t$$ = new Parameter ((FullNamedExpression) $1, lt.Value, Parameter.Modifier.NONE, null, lt.Location);\n\t  }\n\t| IDENTIFIER\n\t  {\n\t  \tvar lt = (LocatedToken) $1;\n\t\t$$ = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t  }\n\t| AWAIT\n\t  {\n\t  \tvar lt = (LocatedToken) Error_AwaitAsIdentifier ($1);\n\t\t$$ = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t  }\n\t;\n\nopt_lambda_parameter_list\n\t: /* empty */\t\t\t{ $$ = ParametersCompiled.EmptyReadOnlyParameters; }\n\t| lambda_parameter_list\t\t{ \n\t\tvar pars_list = (List<Parameter>) $1;\n\t\t$$ = new ParametersCompiled (pars_list.ToArray ());\n\t\tlbag.AddLocation ($$, parameterListCommas);\n\t  }\n\t;\n\nlambda_expression_body\n\t: {\n\t\tstart_block (Location.Null);\n\t  }\n\t  expression\t// All expressions must handle error or current block won't be restored and breaking ast completely\n\t  {\n\t\tBlock b = end_block (Location.Null);\n\t\tb.IsCompilerGenerated = true;\n\t\tb.AddStatement (new ContextualReturn ((Expression) $2));\n\t\t$$ = b;\n\t  } \n\t| block\n\t| error\n\t  {\n\t  \t// Handles only cases like foo = x.FirstOrDefault (l => );\n\t  \t// where we must restore current_variable\n\t\tBlock b = end_block (Location.Null);\n\t\tb.IsCompilerGenerated = true;\n\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = null;\n\t  }\n\t;\n\nexpression_or_error\n\t: expression\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = null;\n\t  }\n\t;\n\t\nlambda_expression\n\t: IDENTIFIER ARROW \n\t  {\n\t\tvar lt = (LocatedToken) $1;\t\n\t\tParameter p = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t\tstart_anonymous (true, new ParametersCompiled (p), false, lt.Location);\n\t  }\n\t  lambda_expression_body\n\t  {\n\t\t$$ = end_anonymous ((ParametersBlock) $4);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| AWAIT ARROW\n\t  {\n\t\tvar lt = (LocatedToken) Error_AwaitAsIdentifier ($1);\n\t\tParameter p = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t\tstart_anonymous (true, new ParametersCompiled (p), false, lt.Location);\n\t  }\n\t  lambda_expression_body\n\t  {\n\t\t$$ = end_anonymous ((ParametersBlock) $4);\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| ASYNC identifier_inside_body ARROW\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\tParameter p = new ImplicitLambdaParameter (lt.Value, lt.Location);\n\t\tstart_anonymous (true, new ParametersCompiled (p), true, lt.Location);\n\t  }\n\t  lambda_expression_body\n\t  {\n\t\t$$ = end_anonymous ((ParametersBlock) $5);\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($3));\n\t  }\n\t| OPEN_PARENS_LAMBDA\n\t  {\n\t  \tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n\t  opt_lambda_parameter_list CLOSE_PARENS ARROW \n\t  {\n\t  \tvalid_param_mod = 0;\n\t\tstart_anonymous (true, (ParametersCompiled) $3, false, GetLocation ($1));\n\t  }\n\t  lambda_expression_body\n\t  {\n\t\t$$ = end_anonymous ((ParametersBlock) $7);\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($4), GetLocation ($5));\n\t  }\n\t| ASYNC OPEN_PARENS_LAMBDA\n\t  {\n\t  \tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\t  \n\t  }\n\t  opt_lambda_parameter_list CLOSE_PARENS ARROW \n\t  {\n\t  \tvalid_param_mod = 0;\n\t\tstart_anonymous (true, (ParametersCompiled) $4, true, GetLocation ($1));\n\t  }\n\t  lambda_expression_body\n\t  {\n\t\t$$ = end_anonymous ((ParametersBlock) $8);\n\t\tlbag.AddLocation ($$, GetLocation ($1), GetLocation ($2), GetLocation ($5), GetLocation ($6));\n\t  }\n\t;\n\nexpression\n\t: assignment_expression \n\t| non_assignment_expression\n\t;\n\t\nnon_assignment_expression\n\t: conditional_expression\n\t| lambda_expression\n\t| query_expression\n\t| ARGLIST\n\t  {\n\t\t$$ = new ArglistAccess (GetLocation ($1));\n\t  }\n\t;\n\t\nundocumented_expressions\n\t: REFVALUE OPEN_PARENS non_assignment_expression COMMA type CLOSE_PARENS\n\t  {\n\t\t$$ = new RefValueExpr ((Expression) $3, (FullNamedExpression) $5, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4), GetLocation ($6));\n\t  }\n\t| REFTYPE open_parens_any expression CLOSE_PARENS\n\t  {\n\t\t$$ = new RefTypeExpr ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| MAKEREF open_parens_any expression CLOSE_PARENS\n\t  {\n\t\t$$ = new MakeRefExpr ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\t  \n\t  }\n\t;\n\nconstant_expression\n\t: expression\n\t;\n\nboolean_expression\n\t: expression\n\t  {\n\t\t$$ = new BooleanExpression ((Expression) $1);\n\t  }\n\t;\n\nopt_primary_parameters\n\t: /* empty */\n\t  {\n\t  \t$$ = null;\n\t  }\n\t| primary_parameters\n\t;\n\nprimary_parameters\n\t: OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS\n\t  {\n\t\t$$ = $2;\n\n\t\t// Cannot use opt_formal_parameter_list because it can be shared instance for empty parameters\n\t  \tlbag.AppendToMember (current_container, GetLocation ($1), GetLocation ($3));\n\n\t\tif (lang_version < LanguageVersion.V_6)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"primary constructor\");\n\t  }\n\t;\n\nopt_primary_parameters_with_class_base\n\t: /* empty */\n\t  {\n\t  \t$$ = null;\n\t  }\n\t| class_base\n\t  {\n\t\t$$ = null;\n\t  }\n\t| primary_parameters\n\t  {\n\t\t$$ = $1;\n\t  }\n\t| primary_parameters class_base\n\t  {\n\t\t$$ = $1;\n\t  }\n\t| primary_parameters class_base OPEN_PARENS\n\t  {\n\t\t++lexer.parsing_block;\n\t\tcurrent_type.PrimaryConstructorBaseArgumentsStart = GetLocation ($3);\n\t  }\n\t  opt_argument_list CLOSE_PARENS\n\t  {\n\t\tlbag.AppendToMember (current_container, GetLocation ($6));\n\t\tcurrent_type.PrimaryConstructorBaseArguments = (Arguments) $5;\n\t\t--lexer.parsing_block;\n\n\t\t$$ = $1;\n\t  }\n\t;\n\n//\n// 10 classes\n//\nclass_declaration\n\t: opt_attributes\n\t  opt_modifiers\n\t  opt_partial\n\t  CLASS\n\t  {\n\t  }\n\t  type_declaration_name\n\t  {\n\t\tlexer.ConstraintsParsing = true;\n\n\t\tClass c = new Class (current_container, (MemberName) $6, (Modifiers) $2, (Attributes) $1);\n\t\tif (((c.ModFlags & Modifiers.STATIC) != 0) && lang_version == LanguageVersion.ISO_1) {\n\t\t\tFeatureIsNotAvailable (c.Location, \"static classes\");\n\t\t}\n\t\t\t\n\t\tpush_current_container (c, $3);\n\t\tlbag.AddMember (current_container, GetModifierLocations (), GetLocation ($4));\n\t\tvalid_param_mod = ParameterModifierType.PrimaryConstructor;\n\t  }\n\t  opt_primary_parameters_with_class_base\n\t  opt_type_parameter_constraints_clauses\n\t  {\n\t\tvalid_param_mod = 0;\n\t\tlexer.ConstraintsParsing = false;\n\n\t\tif ($8 != null)\n\t\t\tcurrent_type.PrimaryConstructorParameters = (ParametersCompiled) $8;\n\n\t\tif ($9 != null)\n\t\t\tcurrent_container.SetConstraints ((List<Constraints>) $9);\n\n\t\tif (doc_support) {\n\t\t\tcurrent_container.PartialContainer.DocComment = Lexer.consume_doc_comment ();\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t\t}\n\t\t\n\t\tlexer.parsing_modifiers = true;\n\t  }\n\t  OPEN_BRACE opt_class_member_declarations CLOSE_BRACE\n\t  {\n\t\t--lexer.parsing_declaration;\n\t\tif (doc_support)\n\t\t\tLexer.doc_state = XmlCommentState.Allowed;\n\t  }\n\t  opt_semicolon \n\t  {\n\t\tif ($15 == null) {\n\t\t\tlbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));\n\t\t} else {\n\t\t\tlbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));\n\t\t}\n\t\t$$ = pop_current_class ();\n\t  }\n\t;\t\n\nopt_partial\n\t: /* empty */\n\t  { $$ = null; }\n\t| PARTIAL\n\t  { $$ = $1; StoreModifierLocation (Modifiers.PARTIAL, GetLocation ($1)); } // location\n\t;\n\nopt_modifiers\n\t: /* empty */\n\t  {\n\t    mod_locations = null;\n\t\t$$ = ModifierNone;\n\t\tlexer.parsing_modifiers = false;\n\t  }\n\t| modifiers\n\t  {\n\t\tlexer.parsing_modifiers = false;\t\t\n\t  }\n\t;\n\nmodifiers\n\t: modifier\n\t| modifiers modifier\n\t  { \n\t\tvar m1 = (Modifiers) $1;\n\t\tvar m2 = (Modifiers) $2;\n\n\t\tif ((m1 & m2) != 0) {\n\t\t\treport.Error (1004, lexer.Location - ModifiersExtensions.Name (m2).Length,\n\t\t\t\t\"Duplicate `{0}' modifier\", ModifiersExtensions.Name (m2));\n\t\t} else if ((m2 & Modifiers.AccessibilityMask) != 0 && (m1 & Modifiers.AccessibilityMask) != 0 &&\n\t\t\t((m2 | m1 & Modifiers.AccessibilityMask) != (Modifiers.PROTECTED | Modifiers.INTERNAL))) {\n\t\t\treport.Error (107, lexer.Location - ModifiersExtensions.Name (m2).Length,\n\t\t\t\t\"More than one protection modifier specified\");\n\t\t}\n\t\t\n\t\t$$ = m1 | m2;\n\t  }\n\t;\n\nmodifier\n\t: NEW\n\t  {\n\t\t$$ = Modifiers.NEW;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t\t\n\t\tif (current_container.Kind == MemberKind.Namespace)\n\t\t\treport.Error (1530, GetLocation ($1), \"Keyword `new' is not allowed on namespace elements\");\n\t  }\n\t| PUBLIC\n\t  {\n\t\t$$ = Modifiers.PUBLIC;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| PROTECTED\n\t  {\n\t\t$$ = Modifiers.PROTECTED;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| INTERNAL\n\t  {\n\t\t$$ = Modifiers.INTERNAL;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| PRIVATE\n\t  {\n\t\t$$ = Modifiers.PRIVATE;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| ABSTRACT\n\t  {\n\t\t$$ = Modifiers.ABSTRACT;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| SEALED\n\t  {\n\t\t$$ = Modifiers.SEALED;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| STATIC\n\t  {\n\t\t$$ = Modifiers.STATIC;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| READONLY\n\t  {\n\t\t$$ = Modifiers.READONLY;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| VIRTUAL\n\t  {\n\t\t$$ = Modifiers.VIRTUAL;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| OVERRIDE\n\t  {\n\t\t$$ = Modifiers.OVERRIDE;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| EXTERN\n\t  {\n\t\t$$ = Modifiers.EXTERN;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| VOLATILE\n\t  {\n\t\t$$ = Modifiers.VOLATILE;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t| UNSAFE\n\t  {\n\t\t$$ = Modifiers.UNSAFE;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t\tif (!settings.Unsafe)\n\t\t\tError_UnsafeCodeNotAllowed (GetLocation ($1));\n\t  }\n\t| ASYNC\n\t  {\n\t\t$$ = Modifiers.ASYNC;\n\t\tStoreModifierLocation ($$, GetLocation ($1));\n\t  }\n\t;\n\t\nopt_class_base\n\t: /* empty */\n\t| class_base\n\t;\n\nclass_base\n\t: COLON type_list\n\t {\n\t\tcurrent_type.SetBaseTypes ((List<FullNamedExpression>) $2);\n\t\tlbag.AppendToMember (current_type, GetLocation ($1));\n\t }\n\t| COLON type_list error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\tcurrent_type.SetBaseTypes ((List<FullNamedExpression>) $2);\n\t  }\n\t;\n\nopt_type_parameter_constraints_clauses\n\t: /* empty */\n\t| type_parameter_constraints_clauses \n\t  {\n\t\t$$ = $1;\n\t  }\n\t;\n\ntype_parameter_constraints_clauses\n\t: type_parameter_constraints_clause\n\t  {\n\t\tvar constraints = new List<Constraints> (1);\n\t\tconstraints.Add ((Constraints) $1);\n\t\t$$ = constraints;\n\t  }\n\t| type_parameter_constraints_clauses type_parameter_constraints_clause\n\t  {\n\t\tvar constraints = (List<Constraints>) $1;\n\t\tConstraints new_constraint = (Constraints)$2;\n\n\t\tforeach (Constraints c in constraints) {\n\t\t\tif (new_constraint.TypeParameter.Value == c.TypeParameter.Value) {\n\t\t\t\treport.Error (409, new_constraint.Location,\n\t\t\t\t\t\"A constraint clause has already been specified for type parameter `{0}'\",\n\t\t\t\t\tnew_constraint.TypeParameter.Value);\n\t\t\t}\n\t\t}\n\n\t\tconstraints.Add (new_constraint);\n\t\t$$ = constraints;\n\t  }\n\t; \n\ntype_parameter_constraints_clause\n\t: WHERE IDENTIFIER COLON type_parameter_constraints\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\t$$ = new Constraints (new SimpleMemberName (lt.Value, lt.Location), (List<FullNamedExpression>) $4, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\n\t| WHERE IDENTIFIER error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\tvar lt = (LocatedToken) $2;\n\t\t$$ = new Constraints (new SimpleMemberName (lt.Value, lt.Location), null, GetLocation ($1));\n\t  }\n\t; \n\ntype_parameter_constraints\n\t: type_parameter_constraint\n\t  {\n\t\tvar constraints = new List<FullNamedExpression> (1);\n\t\tconstraints.Add ((FullNamedExpression) $1);\n\t\t$$ = constraints;\n\t  }\n\t| type_parameter_constraints COMMA type_parameter_constraint\n\t  {\n\t\tvar constraints = (List<FullNamedExpression>) $1;\n\t\tvar prev = constraints [constraints.Count - 1] as SpecialContraintExpr;\n\t\tif (prev != null && (prev.Constraint & SpecialConstraint.Constructor) != 0) {\t\t\t\n\t\t\treport.Error (401, GetLocation ($2), \"The `new()' constraint must be the last constraint specified\");\n\t\t}\n\t\t\n\t\tprev = $3 as SpecialContraintExpr;\n\t\tif (prev != null) {\n\t\t\tif ((prev.Constraint & (SpecialConstraint.Class | SpecialConstraint.Struct)) != 0) {\n\t\t\t\treport.Error (449, prev.Location, \"The `class' or `struct' constraint must be the first constraint specified\");\t\t\t\n\t\t\t} else {\n\t\t\t \tprev = constraints [0] as SpecialContraintExpr;\n\t\t\t \tif (prev != null && (prev.Constraint & SpecialConstraint.Struct) != 0) {\t\t\t\n\t\t\t\t\treport.Error (451, GetLocation ($3), \"The `new()' constraint cannot be used with the `struct' constraint\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconstraints.Add ((FullNamedExpression) $3);\n\t\tlbag.AddLocation (constraints, GetLocation ($2));\n\t\t$$ = constraints;\n\t  }\n\t;\n\ntype_parameter_constraint\n\t: type\n\t  {\n\t\tif ($1 is ComposedCast)\n\t\t\treport.Error (706, GetLocation ($1), \"Invalid constraint type `{0}'\", ((ComposedCast)$1).GetSignatureForError ());\n\t  \n\t  \t$$ = $1;\n\t  }\n\t| NEW OPEN_PARENS CLOSE_PARENS\n\t  {\n\t\t$$ = new SpecialContraintExpr (SpecialConstraint.Constructor, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($3));\n\t  }\n\t| CLASS\n\t  {\n\t\t$$ = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation ($1));\n\t  }\n\t| STRUCT\n\t  {\n\t\t$$ = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation ($1));\n\t  }\n\t;\n\nopt_type_parameter_variance\n\t: /* empty */\n\t  {\n\t\t$$ = null;\n\t  }\n\t| type_parameter_variance\n\t  {\n\t\tif (lang_version <= LanguageVersion.V_3)\n\t\t\tFeatureIsNotAvailable (lexer.Location, \"generic type variance\");\n\t\t\n\t\t$$ = $1;\n\t  }\n\t;\n\ntype_parameter_variance\n\t: OUT\n\t  {\n\t\t$$ = new VarianceDecl (Variance.Covariant, GetLocation ($1));\n\t\tsavedLocation = GetLocation ($1);\n\t  }\n\t| IN\n\t  {\n\t\t$$ = new VarianceDecl (Variance.Contravariant, GetLocation ($1));\n\t\tsavedLocation = GetLocation ($1);\n\t  }\n\t;\n\n//\n// Statements (8.2)\n//\n\n//\n// A block is \"contained\" on the following places:\n//\tmethod_body\n//\tproperty_declaration as part of the accessor body (get/set)\n//      operator_declaration\n//\tconstructor_declaration\n//\tdestructor_declaration\n//\tevent_declaration as part of add_accessor_declaration or remove_accessor_declaration\n//      \nblock\n\t: OPEN_BRACE  \n\t  {\n\t\t++lexer.parsing_block;\n\t\tstart_block (GetLocation ($1));\n\t  } \n\t  opt_statement_list block_end\n\t  {\n\t\t$$ = $4;\n\t  }\n\t;\n\nblock_end \n\t: CLOSE_BRACE \n\t  {\n\t \t--lexer.parsing_block;\n\t\t$$ = end_block (GetLocation ($1));\n\t  }\n\t| COMPLETE_COMPLETION\n\t  {\n\t \t--lexer.parsing_block;\n\t\t$$ = end_block (lexer.Location);\n\t  }\n\t;\n\n\nblock_prepared\n\t: OPEN_BRACE\n\t  {\n\t\t++lexer.parsing_block;\n\t\tcurrent_block.StartLocation = GetLocation ($1);\n\t  }\n\t  opt_statement_list CLOSE_BRACE \n\t  {\n\t\t--lexer.parsing_block;\n\t\t$$ = end_block (GetLocation ($4));\n\t  } | CLOSE_BRACE\n\t  {\n\t\treport.Error (1525, GetLocation ($1), \"Unexpected symbol '}', expected '{'\");\n\t\tlexer.putback ('}');\n\t\t$$ = end_block (GetLocation ($1));\n\t  }\n\t;\n\nblock_prepared_strict\n\t: OPEN_BRACE\n\t  {\n\t\t++lexer.parsing_block;\n\t\tcurrent_block.StartLocation = GetLocation ($1);\n\t  }\n\t  opt_statement_list CLOSE_BRACE \n\t  {\n\t\t--lexer.parsing_block;\n\t\t$$ = end_block (GetLocation ($4));\n\t  }\n\t;\n\nopt_statement_list\n\t: /* empty */\n\t| statement_list \n\t;\n\nstatement_list\n\t: statement\n\t| statement_list statement\n\t;\n\nstatement\n\t: block_variable_declaration\n\t  {\n\t\tcurrent_block.AddStatement ((Statement) $1);\n\t  }\n\t| valid_declaration_statement\n\t  {\n\t\tcurrent_block.AddStatement ((Statement) $1);\n\t  }\n\t| labeled_statement\n// WORKAROUND:Remove that rule, if it is >really< fixed.\n\t| IDENTIFIER error\n\t{\n\t\tError_SyntaxError (yyToken);\n\t\tvar lt =(LocatedToken) $1;\n\t\tvar sn = new SimpleName (lt.Value, lt.Location);\n\t\tcurrent_block.AddStatement(new StatementErrorExpression (sn));\n\t\t$$ = null;\n\t}\n////////\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = null;\n\t  }\n\t;\n\n//\n// The interactive_statement and its derivatives are only \n// used to provide a special version of `expression_statement'\n// that has a side effect of assigning the expression to\n// $retval\n//\ninteractive_statement_list\n\t: interactive_statement\n\t| interactive_statement_list interactive_statement\n\t;\n\ninteractive_statement\n\t: block_variable_declaration\n\t  {\n\t\tcurrent_block.AddStatement ((Statement) $1);\n\t  }\n\t| interactive_valid_declaration_statement\n\t  {\n\t\tcurrent_block.AddStatement ((Statement) $1);\n\t  }\n\t| labeled_statement\n\t;\n\nvalid_declaration_statement\n\t: block\n\t| empty_statement\n\t| expression_statement\n\t| selection_statement\n\t| iteration_statement\n\t| jump_statement\t\t  \n\t| try_statement\n\t| checked_statement\n\t| unchecked_statement\n\t| lock_statement\n\t| using_statement\n\t| unsafe_statement\n\t| fixed_statement\n\t;\n\ninteractive_valid_declaration_statement\n\t: block\n\t| empty_statement\n        | interactive_expression_statement\n\t| selection_statement\n\t| iteration_statement\n\t| jump_statement\t\t  \n\t| try_statement\n\t| checked_statement\n\t| unchecked_statement\n\t| lock_statement\n\t| using_statement\n\t| unsafe_statement\n\t| fixed_statement\n\t;\n\nembedded_statement\n\t: valid_declaration_statement\n\t| block_variable_declaration\n\t  {\n\t\t  report.Error (1023, GetLocation ($1), \"An embedded statement may not be a declaration or labeled statement\");\n\t\t  $$ = null;\n\t  }\n\t| labeled_statement\n\t  {\n\t\t  report.Error (1023, GetLocation ($1), \"An embedded statement may not be a declaration or labeled statement\");\n\t\t  $$ = null;\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new EmptyStatement (GetLocation ($1));\n\t  }\n\t;\n\nempty_statement\n\t: SEMICOLON\n\t  {\n\t\t// Uses lexer.Location because semicolon location is not kept in quick mode\n\t\t$$ = new EmptyStatement (lexer.Location);\n\t  }\n\t;\n\nlabeled_statement\n\t: identifier_inside_body COLON \n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\tLabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location);\n\t\tlbag.AddLocation (labeled, GetLocation ($2));\n\t\tcurrent_block.AddLabel (labeled);\n\t\tcurrent_block.AddStatement (labeled);\n\t  }\n\t  statement\n\t;\n\nvariable_type\n\t: variable_type_simple\n\t| variable_type_simple rank_specifiers\n\t  {\n\t\tif ($1 is VarExpr)\n\t\t\t$1 = new SimpleName (\"var\", ((VarExpr) $1).Location);\n\t  \n\t\t$$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);\n\t  }\n\t;\n\n/* \n * The following is from Rhys' grammar:\n * > Types in local variable declarations must be recognized as \n * > expressions to prevent reduce/reduce errors in the grammar.\n * > The expressions are converted into types during semantic analysis.\n */\nvariable_type_simple\n\t: primary_expression_or_type opt_nullable\n\t  { \n\t\t// Ok, the above \"primary_expression\" is there to get rid of\n\t\t// both reduce/reduce and shift/reduces in the grammar, it should\n\t\t// really just be \"type_name\".  If you use type_name, a reduce/reduce\n\t\t// creeps up.  If you use namespace_or_type_name (which is all we need\n\t\t// really) two shift/reduces appear.\n\t\t// \n\n\t\t// So the super-trick is that primary_expression\n\t\t// can only be either a SimpleName or a MemberAccess. \n\t\t// The MemberAccess case arises when you have a fully qualified type-name like :\n\t\t// Foo.Bar.Blah i;\n\t\t// SimpleName is when you have\n\t\t// Blah i;\n\t\t\n\t\tExpression expr = (Expression) $1;\n\t\tif ($2 == null) {\n\t\t\tSimpleName sn = expr as SimpleName;\n\t\t\tif (sn != null && sn.Name == \"var\")\n\t\t\t\t$$ = new VarExpr (sn.Location);\n\t\t\telse\n\t\t\t\t$$ = $1;\n\t\t} else if (expr is ATypeNameExpression) {\n\t\t\t$$ = new ComposedCast ((ATypeNameExpression)expr, (ComposedTypeSpecifier) $2);\n\t\t} else {\n\t\t\tError_ExpectingTypeName (expr);\n\t\t\t$$ = null;\n\t\t}\n\t  }\n\t| primary_expression_or_type pointer_stars\n\t  {\n\t\tATypeNameExpression expr = $1 as ATypeNameExpression;\n\n\t\tif (expr != null) {\n\t\t\t$$ = new ComposedCast (expr, (ComposedTypeSpecifier) $2);\n\t\t} else {\n\t\t\tError_ExpectingTypeName ((Expression)$1);\n\t\t\t$$ = expr;\n\t\t}\n\t  }\n\t| builtin_type_expression\n\t| void_invalid\n\t;\n\t\npointer_stars\n\t: pointer_star\n\t| pointer_star pointer_stars\n\t  {\n\t  \t((ComposedTypeSpecifier) $1).Next = (ComposedTypeSpecifier) $2;\n\t  \t$$ = $1;\n\t  }\t  \n\t;\n\npointer_star\n\t: STAR\n\t  {\n\t\t$$ = ComposedTypeSpecifier.CreatePointer (GetLocation ($1));\n\t  }\n\t;\n\nidentifier_inside_body\n\t: IDENTIFIER\n\t| AWAIT\n\t  {\n\t  \t$$ = Error_AwaitAsIdentifier ($1);\n\t  }\n\t;\n\nblock_variable_declaration\n\t: variable_type identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\tvar li = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new BlockVariable ((FullNamedExpression) $1, li);\n\t  }\n\t  opt_local_variable_initializer opt_variable_declarators semicolon_or_handle_error_close_brace\n\t  {\n\t\t$$ = current_variable;\n\t\tcurrent_variable = null;\n\t\tif ($4 != null)\n\t\t\tlbag.AddLocation ($$, PopLocation (), GetLocation ($6));\n\t\telse\n\t\t\tlbag.AddLocation ($$, GetLocation ($6));\n\t  }\n\t| CONST variable_type identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new BlockConstant ((FullNamedExpression) $2, li);\n\t  }\n\t  const_variable_initializer opt_const_declarators SEMICOLON\n\t  {\n\t\tif (current_variable.Initializer != null) {\n\t\t\tlbag.AddLocation (current_variable, GetLocation ($1), savedLocation, GetLocation ($7));\n\t\t} else {\n\t\t\tlbag.AddLocation (current_variable, GetLocation ($1), GetLocation ($7));\n\t\t}\n\t\t$$ = current_variable;;\n\t\tcurrent_variable = null;\n\t  }\n\t;\n\nsemicolon_or_handle_error_close_brace \n\t: SEMICOLON\n\t| CLOSE_BRACE {\n\t\t// Redundant, but wont regress\n\t\treport.Error (1525, lexer.Location, \"Unexpected symbol }\");\n\t\tlexer.putback ('}');\n\t\t$$ = $1;\n\t  }\n\t;\n\nopt_local_variable_initializer\n\t: /* empty */\n\t| ASSIGN block_variable_initializer\n\t  {\n\t\tcurrent_variable.Initializer = (Expression) $2;\n\t\tPushLocation (GetLocation ($1));\n\t\t$$ = current_variable;\n\t  }\n\t| error\n\t  {\n\t  \tif (yyToken == Token.OPEN_BRACKET_EXPR) {\n\t\t\treport.Error (650, lexer.Location,\n\t\t\t\t\"Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type\");\n\t\t} else {\n\t\t\tError_SyntaxError (yyToken);\n\t\t}\n\t  }\n\t;\n\nopt_variable_declarators\n\t: /* empty */\n\t| variable_declarators\n\t;\n\t\nopt_using_or_fixed_variable_declarators\n\t: /* empty */\n\t| variable_declarators\n\t  {\n\t\tforeach (var d in current_variable.Declarators) {\n\t\t\tif (d.Initializer == null)\n\t\t\t\tError_MissingInitializer (d.Variable.Location);\n\t\t}\n\t  }\n\t;\t\n\t\nvariable_declarators\n\t: variable_declarator\n\t| variable_declarators variable_declarator\n\t;\n\t\nvariable_declarator\n\t: COMMA identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken) $2;\t  \n\t\tvar li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location);\n\t\tvar d = new BlockVariableDeclarator (li, null);\n\t\tcurrent_variable.AddDeclarator (d);\n\t\tcurrent_block.AddLocalName (li);\n\t  \tlbag.AddLocation (d, GetLocation ($1));\n\t  }\n\t| COMMA identifier_inside_body ASSIGN block_variable_initializer\n\t  {\n\t\tvar lt = (LocatedToken) $2;\t  \n\t\tvar li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location);\n\t\tvar d = new BlockVariableDeclarator (li, (Expression) $4);\n\t\tcurrent_variable.AddDeclarator (d);\n\t\tcurrent_block.AddLocalName (li);\n\t  \tlbag.AddLocation (d, GetLocation ($1), GetLocation ($3));\n\t  }\n\t;\n\t\nconst_variable_initializer\n\t: /* empty */\n\t  {\n\t\treport.Error (145, lexer.Location, \"A const field requires a value to be provided\");\n\t  }\n\t| ASSIGN constant_initializer_expr \n\t  {\n\t\tsavedLocation = GetLocation ($1);\n\t\tcurrent_variable.Initializer = (Expression) $2;\n\t  }\n\t;\n\t\nopt_const_declarators\n\t: /* empty */\n\t| const_declarators\n\t;\n\t\nconst_declarators\n\t: const_declarator\n\t| const_declarators const_declarator\n\t;\n\t\nconst_declarator\n\t: COMMA identifier_inside_body ASSIGN constant_initializer_expr\n\t  {\n\t\tvar lt = (LocatedToken) $2;\t  \n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location);\n\t\tvar d = new BlockVariableDeclarator (li, (Expression) $4);\n\t\tcurrent_variable.AddDeclarator (d);\n\t\tcurrent_block.AddLocalName (li);\n\t  \tlbag.AddLocation (d, GetLocation ($1), GetLocation ($3));\n\t  }\n\t;\n\t\nblock_variable_initializer\n\t: variable_initializer\n\t| STACKALLOC simple_type OPEN_BRACKET_EXPR expression CLOSE_BRACKET\n\t  {\n\t\t$$ = new StackAlloc ((Expression) $2, (Expression) $4, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($5));\n\t  }\n\t| STACKALLOC simple_type\n\t  {\n\t\treport.Error (1575, GetLocation ($1), \"A stackalloc expression requires [] after type\");\n\t\t$$ = new StackAlloc ((Expression) $2, null, GetLocation ($1));\t\t\n\t  }\n\t;\n\nexpression_statement\n\t: statement_expression SEMICOLON\n\t  {\n\t\t$$ = $1;\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t| statement_expression COMPLETE_COMPLETION { $$ = $1; }\n\t| statement_expression CLOSE_BRACE\n\t  {\n\t\t$$ = $1;\n\t\treport.Error (1002, GetLocation ($2), \"; expected\");\n\t\tlexer.putback ('}');\n\t  }\n\t;\n\ninteractive_expression_statement\n\t: interactive_statement_expression SEMICOLON { $$ = $1; }\n\t| interactive_statement_expression COMPLETE_COMPLETION { $$ = $1; }\n\t;\n\n\t//\n\t// We have to do the wrapping here and not in the case above,\n\t// because statement_expression is used for example in for_statement\n\t//\nstatement_expression\n\t: expression\n\t  {\n\t\tExpressionStatement s = $1 as ExpressionStatement;\n\t\tif (s == null) {\n\t\t\tvar expr = $1 as Expression;\n\t\t\t$$ = new StatementErrorExpression (expr);\n\t\t} else {\n\t\t\t$$ = new StatementExpression (s);\n\t\t}\n\t  }\n\t;\n\ninteractive_statement_expression\n\t: expression\n\t  {\n\t\tExpression expr = (Expression) $1;\n\t\t$$ = new StatementExpression (new OptionalAssign (expr, lexer.Location));\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new EmptyStatement (GetLocation ($1));\n\t  }\n\t;\n\t\nselection_statement\n\t: if_statement\n\t| switch_statement\n\t; \n\nif_statement\n\t: IF open_parens_any boolean_expression CLOSE_PARENS \n\t  embedded_statement\n\t  { \n\t\tif ($5 is EmptyStatement)\n\t\t\tWarning_EmptyStatement (GetLocation ($5));\n\t\t\n\t\t$$ = new If ((BooleanExpression) $3, (Statement) $5, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| IF open_parens_any boolean_expression CLOSE_PARENS\n\t  embedded_statement ELSE embedded_statement\n\t  {\n\t\t$$ = new If ((BooleanExpression) $3, (Statement) $5, (Statement) $7, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4), GetLocation ($6));\n\t\t\n\t\tif ($5 is EmptyStatement)\n\t\t\tWarning_EmptyStatement (GetLocation ($5));\n\t\tif ($7 is EmptyStatement)\n\t\t\tWarning_EmptyStatement (GetLocation ($7));\n\t  }\n\t| IF open_parens_any boolean_expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t\n\t\t$$ = new If ((BooleanExpression) $3, null, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t;\n\nswitch_statement\n\t: SWITCH open_parens_any expression CLOSE_PARENS OPEN_BRACE\n\t  {\n\t\tstart_block (GetLocation ($5));\n\t  }\n\t  opt_switch_sections CLOSE_BRACE\n\t  {\n\t\t$$ = new Switch ((Expression) $3, (ExplicitBlock) current_block.Explicit, GetLocation ($1));\t\n\t\tend_block (GetLocation ($8));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4), GetLocation ($5), GetLocation ($8));\n\t  }\n\t| SWITCH open_parens_any expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\t$$ = new Switch ((Expression) $3, null, GetLocation ($1));\t\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t;\n\nopt_switch_sections\n\t: /* empty */ \t\t\n      {\n\t\treport.Warning (1522, 1, current_block.StartLocation, \"Empty switch block\"); \n\t  }\n\t| switch_sections\n\t;\n\nswitch_sections\n\t: switch_section \n\t| switch_sections switch_section\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  } \n\t;\n\nswitch_section\n\t: switch_labels statement_list \n\t;\n\nswitch_labels\n\t: switch_label \n\t  {\n\t  \tvar label = (SwitchLabel) $1;\n\t  \tlabel.SectionStart = true;\n\t\tcurrent_block.AddStatement (label);\n\t  }\n\t| switch_labels switch_label \n\t  {\n\t\tcurrent_block.AddStatement ((Statement) $2);\n\t  }\n\t;\n\nswitch_label\n\t: CASE constant_expression COLON\n\t {\n\t \t$$ = new SwitchLabel ((Expression) $2, GetLocation ($1));\n\t \tlbag.AddLocation ($$, GetLocation ($3));\n\t }\n\t| CASE constant_expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new SwitchLabel ((Expression) $2, GetLocation ($1));\n\t  }\n\t| DEFAULT_COLON\n\t  {\n\t\t$$ = new SwitchLabel (null, GetLocation ($1));\n\t  }\n\t;\n\niteration_statement\n\t: while_statement\n\t| do_statement\n\t| for_statement\n\t| foreach_statement\n\t;\n\nwhile_statement\n\t: WHILE open_parens_any boolean_expression CLOSE_PARENS embedded_statement\n\t  {\n\t\tif ($5 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation ($5));\n\t  \n\t\t$$ = new While ((BooleanExpression) $3, (Statement) $5, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| WHILE open_parens_any boolean_expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t\n\t\t$$ = new While ((BooleanExpression) $3, null, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t;\n\ndo_statement\n\t: DO embedded_statement WHILE open_parens_any boolean_expression CLOSE_PARENS SEMICOLON\n\t  {\n\t\t$$ = new Do ((Statement) $2, (BooleanExpression) $5, GetLocation ($1), GetLocation ($3));\n\t\tlbag.AddStatement ($$, GetLocation ($3), GetLocation ($4), GetLocation ($6), GetLocation ($7));\n\t  }\n\t| DO embedded_statement error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new Do ((Statement) $2, null, GetLocation ($1), Location.Null);\n\t  }\n\t| DO embedded_statement WHILE open_parens_any boolean_expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t  \n\t\t$$ = new Do ((Statement) $2, (BooleanExpression) $5, GetLocation ($1), GetLocation ($3));\n\t\tlbag.AddStatement ($$, GetLocation ($3), GetLocation ($4));\n\t  }\n\t;\n\nfor_statement\n\t: FOR open_parens_any\n\t  {\n\t\tstart_block (GetLocation ($2));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tFor f = new For (GetLocation ($1));\n\t\tcurrent_block.AddStatement (f);\n\t\tlbag.AddStatement (f, current_block.StartLocation);\n\t\t$$ = f;\n\t  }\n\t  for_statement_cont\n\t  {\n\t\t$$ = $4;\n\t  }\n\t;\n\t\n// Has to use be extra rule to recover started block\nfor_statement_cont\n\t: opt_for_initializer SEMICOLON\n\t  {\n\t\tFor f =  (For) $0;\n\t\tf.Initializer = (Statement) $1;\n\t\tlbag.AddLocation (f, GetLocation ($2));\n\t\t$$ = f;\n\t  }\n\t  for_statement_condition\n\t  {\n\t\t$$ = $4;\n\t  }\n\t| opt_for_initializer CLOSE_PARENS {\n\t\treport.Error (1525, GetLocation ($2), \"Unexpected symbol ')', expected ';'\");\n\t\tFor f =  (For) $0;\n\t\tf.Initializer = (Statement) $1;\n\t\tlbag.AddLocation (f, GetLocation ($2));\n\t\t$$ = end_block (GetLocation ($2));\n\t}\n\t;\n\nfor_statement_condition\n\t: opt_for_condition SEMICOLON\n\t  {\n\t\tFor f =  (For) $0;\n\t\tf.Condition = (BooleanExpression) $1;\n\t\tlbag.AddLocation (f, GetLocation ($2));\n\t\t$$ = f;\n\t  }\n\t  for_statement_end\n\t  {\n\t\t$$ = $4;\n\t  }\n\n\t| boolean_expression CLOSE_PARENS {\n\t\treport.Error (1525, GetLocation ($2), \"Unexpected symbol ')', expected ';'\");\n\t\tFor f =  (For) $0;\n\t\tf.Condition = (BooleanExpression) $1;\n\t\tlbag.AddLocation (f, GetLocation ($2));\n\t\t$$ = end_block (GetLocation ($2));\n\t}\n\t;\n\nfor_statement_end\n\t: opt_for_iterator CLOSE_PARENS\n\t  embedded_statement\n\t  {\n\t\tFor f =  (For) $0;\n\t\tf.Iterator = (Statement) $1;\n\t\t\n\t\tif ($3 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation ($3));\n\t  \n\t\tf.Statement = (Statement) $3;\n\t\tlbag.AddLocation (f, GetLocation ($2));\n\n\t\t$$ = end_block (GetLocation ($2));\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = end_block (current_block.StartLocation);\n\t  }\n\t;\n\nopt_for_initializer\n\t: /* empty */\t\t{ $$ = new EmptyStatement (lexer.Location); }\n\t| for_initializer\t\n\t;\n\nfor_initializer\n\t: variable_type identifier_inside_body\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\tvar li = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new BlockVariable ((FullNamedExpression) $1, li);\n\t  }\n\t  opt_local_variable_initializer opt_variable_declarators\n\t  {\n\t\t$$ = current_variable;\n\t\tif ($4 != null)\n\t\t\tlbag.AddLocation (current_variable, PopLocation ());\n\n\t\tcurrent_variable = null;\n\t  }\n\t| statement_expression_list\n\t;\n\nopt_for_condition\n\t: /* empty */\t\t{ $$ = null; }\n\t| boolean_expression\n\t;\n\nopt_for_iterator\n\t: /* empty */\t\t{ $$ = new EmptyStatement (lexer.Location); }\n\t| for_iterator\n\t;\n\nfor_iterator\n\t: statement_expression_list\n\t;\n\nstatement_expression_list\n\t: statement_expression\n\t| statement_expression_list COMMA statement_expression\n\t  {\n\t  \tvar sl = $1 as StatementList;\n\t  \tif (sl == null) {\n\t  \t\tsl = new StatementList ((Statement) $1, (Statement) $3);\n\t\t\tlbag.AddStatement (sl, GetLocation ($2));\n\t  \t} else {\n\t  \t\tsl.Add ((Statement) $3);\n\t  \t\tlbag.AddLocation (sl, GetLocation ($2));\n\t  \t\t\n\t  \t}\n\t  \t\t\n\t\t$$ = sl;\n\t  }\n\t;\n\nforeach_statement\n\t: FOREACH open_parens_any type error\n\t  {\n\t\treport.Error (230, GetLocation ($1), \"Type and identifier are both required in a foreach statement\");\n\n\t\tstart_block (GetLocation ($2));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\t\n\t\tForeach f = new Foreach ((Expression) $3, null, null, null, null, GetLocation ($1));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation ($2));\n\t\t$$ = end_block (GetLocation ($4));\n\t  }\n\t| FOREACH open_parens_any type identifier_inside_body error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\n\t\tstart_block (GetLocation ($2));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\t\n\t\tvar lt = (LocatedToken) $4;\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.ForeachVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\t\n\t\tForeach f = new Foreach ((Expression) $3, li, null, null, null, GetLocation ($1));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation ($2));\n\t\t$$ = end_block (GetLocation ($5));\n\t  }\n\t| FOREACH open_parens_any type identifier_inside_body IN expression CLOSE_PARENS \n\t  {\n\t\tstart_block (GetLocation ($2));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\t\n\t\tvar lt = (LocatedToken) $4;\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.ForeachVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\t$$ = li;\n\t  } \n\t  embedded_statement\n\t  {\n\t\tif ($9 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation ($9));\n\t\t\n\t\tForeach f = new Foreach ((Expression) $3, (LocalVariable) $8, (Expression) $6, (Statement) $9, current_block, GetLocation ($1));\n\t\tlbag.AddStatement (f, GetLocation ($2), GetLocation ($5), GetLocation ($7));\n\t\tend_block (GetLocation ($7));\n\t\t\n\t\t$$ = f;\n\t  }\n\t| FOREACH open_parens_any type identifier_inside_body error\n\t  {\n\t\tstart_block (GetLocation ($2));\n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tvar lt = $4 as LocatedToken;\n\t\tvar li = lt != null ? new LocalVariable (current_block, lt.Value, LocalVariable.Flags.ForeachVariable | LocalVariable.Flags.Used, lt.Location) : null;\n\t\t\n\t\tForeach f = new Foreach ((Expression) $3, li, null, null, null, GetLocation ($1));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation ($2));\n\t\t$$ = end_block (GetLocation ($5));\n\t  }\n\t| FOREACH open_parens_any type error\n\t  {\n\t\tForeach f = new Foreach ((Expression) $3, null, null, null, null, GetLocation ($1));\n\t\tcurrent_block.AddStatement (f);\n\t\t\n\t\tlbag.AddStatement (f, GetLocation ($2));\n\t\t$$ = f;\n\t  }\n\t;\n\njump_statement\n\t: break_statement\n\t| continue_statement\n\t| goto_statement\n\t| return_statement\n\t| throw_statement\n\t| yield_statement\n\t;\n\nbreak_statement\n\t: BREAK SEMICOLON\n\t  {\n\t\t$$ = new Break (GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t;\n\ncontinue_statement\n\t: CONTINUE SEMICOLON\n\t  {\n\t\t$$ = new Continue (GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t| CONTINUE error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new Continue (GetLocation ($1));\n\t  }\n\t;\n\ngoto_statement\n\t: GOTO identifier_inside_body SEMICOLON \n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\t$$ = new Goto (lt.Value, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($3));\n\t  }\n\t| GOTO CASE constant_expression SEMICOLON\n\t  {\n\t\t$$ = new GotoCase ((Expression) $3, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| GOTO DEFAULT SEMICOLON \n\t  {\n\t\t$$ = new GotoDefault (GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($3));\n\t  }\n\t; \n\nreturn_statement\n\t: RETURN opt_expression SEMICOLON\n\t  {\n\t\t$$ = new Return ((Expression) $2, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($3));\n\t  }\n\t| RETURN expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new Return ((Expression) $2, GetLocation ($1));\n\t  }\n\t| RETURN error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new Return (null, GetLocation ($1));\n\t  }\n\t;\n\nthrow_statement\n\t: THROW opt_expression SEMICOLON\n\t  {\n\t\t$$ = new Throw ((Expression) $2, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($3));\n\t  }\n\t| THROW expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new Throw ((Expression) $2, GetLocation ($1));\n\t  }\n\t| THROW error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new Throw (null, GetLocation ($1));\n\t  }\n\t;\n\nyield_statement \n\t: identifier_inside_body RETURN opt_expression SEMICOLON\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\tstring s = lt.Value;\n\t\tif (s != \"yield\"){\n\t\t\treport.Error (1003, lt.Location, \"; expected\");\n\t\t} else if ($3 == null) {\n\t\t\treport.Error (1627, GetLocation ($4), \"Expression expected after yield return\");\n\t\t} else if (lang_version == LanguageVersion.ISO_1){\n\t\t\tFeatureIsNotAvailable (lt.Location, \"iterators\");\n\t\t}\n\t\t\n\t\tcurrent_block.Explicit.RegisterIteratorYield ();\n\t\t$$ = new Yield ((Expression) $3, lt.Location);\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| identifier_inside_body RETURN expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\tvar lt = (LocatedToken) $1;\n\t\tstring s = lt.Value;\n\t\tif (s != \"yield\"){\n\t\t\treport.Error (1003, lt.Location, \"; expected\");\n\t\t} else if ($3 == null) {\n\t\t\treport.Error (1627, GetLocation ($4), \"Expression expected after yield return\");\n\t\t} else if (lang_version == LanguageVersion.ISO_1){\n\t\t\tFeatureIsNotAvailable (lt.Location, \"iterators\");\n\t\t}\n\t\t\n\t\tcurrent_block.Explicit.RegisterIteratorYield ();\n\t\t$$ = new Yield ((Expression) $3, lt.Location);\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t| identifier_inside_body BREAK SEMICOLON\n\t  {\n\t\tvar lt = (LocatedToken) $1;\n\t\tstring s = lt.Value;\n\t\tif (s != \"yield\"){\n\t\t\treport.Error (1003, lt.Location, \"; expected\");\n\t\t} else if (lang_version == LanguageVersion.ISO_1){\n\t\t\tFeatureIsNotAvailable (lt.Location, \"iterators\");\n\t\t}\n\t\t\n\t\tcurrent_block.ParametersBlock.TopBlock.IsIterator = true;\n\t\t$$ = new YieldBreak (lt.Location);\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($3));\n\t  }\n\t;\n\nopt_expression\n\t: /* empty */\n\t| expression\n\t;\n\ntry_statement\n\t: TRY block catch_clauses\n\t  {\n\t\t$$ = new TryCatch ((Block) $2, (List<Catch>) $3, GetLocation ($1), false);\n\t  }\n\t| TRY block FINALLY block\n\t  {\n\t\t$$ = new TryFinally ((Statement) $2, (ExplicitBlock) $4, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($3));\n\t  }\n\t| TRY block catch_clauses FINALLY block\n\t  {\n\t\t$$ = new TryFinally (new TryCatch ((Block) $2, (List<Catch>) $3, GetLocation ($1), true), (ExplicitBlock) $5, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($4));\n\t  }\n\t| TRY block error\n\t  {\n\t\tError_SyntaxError (1524, yyToken);\n\t\t$$ = new TryCatch ((Block) $2, null, GetLocation ($1), false);\n\t  }\n\t;\n\ncatch_clauses\n\t: catch_clause \n\t  {\n\t\tvar l = new List<Catch> (2);\n\n\t\tl.Add ((Catch) $1);\n\t\t$$ = l;\n\t  }\n\t| catch_clauses catch_clause\n\t  {\n\t\tvar l = (List<Catch>) $1;\n\t\t\n\t\tCatch c = (Catch) $2;\n\t\tvar prev_catch = l [l.Count - 1];\n\t\tif (prev_catch.IsGeneral && prev_catch.Filter == null) {\n\t\t\treport.Error (1017, c.loc, \"Try statement already has an empty catch block\");\n\t\t}\n\t\t\n\t\tl.Add (c);\n\t\t$$ = l;\n\t  }\n\t;\n\nopt_identifier\n\t: /* empty */\n\t| identifier_inside_body\n\t;\n\ncatch_clause \n\t: CATCH opt_catch_filter block\n\t  {\n\t  \tvar c = new Catch ((ExplicitBlock) $3, GetLocation ($1));\n\t  \tc.Filter = (CatchFilterExpression) $2;\n\t  \t$$ = c;\n\t  }\n\t| CATCH open_parens_any type opt_identifier CLOSE_PARENS\n\t  {\n\t\tstart_block (GetLocation ($2));\n\t\tvar c = new Catch ((ExplicitBlock) current_block, GetLocation ($1));\n\t\tc.TypeExpression = (FullNamedExpression) $3;\n\n\t\tif ($4 != null) {\n\t\t\tvar lt = (LocatedToken) $4;\n\t\t\tc.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t\tcurrent_block.AddLocalName (c.Variable);\n\t\t}\n\n\t\tlbag.AddLocation (c, GetLocation ($2), GetLocation ($5));\n\t\t$$ = c;\n\t  }\n\t  opt_catch_filter block_prepared\n\t  {\n\t  \t((Catch) $6).Filter = (CatchFilterExpression) $7;\n\t\t$$ = $6;\n\t  }\n\t| CATCH open_parens_any error\n\t  {\n\t  \tif (yyToken == Token.CLOSE_PARENS) {\n\t\t\treport.Error (1015, lexer.Location,\n\t\t\t\t\"A type that derives from `System.Exception', `object', or `string' expected\");\n\t\t} else {\n\t\t\tError_SyntaxError (yyToken);\n\t\t}\n\t\t\n\t\t$$ = new Catch (null, GetLocation ($1));\n\t  }\n\t| CATCH open_parens_any type opt_identifier CLOSE_PARENS error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t// Required otherwise missing block could not be detected because\n\t\t// start_block is run early\n\t\tvar c = new Catch (null, GetLocation ($1));\n\t\tc.TypeExpression = (FullNamedExpression) $3;\n\t\t\n\t\tif ($4 != null) {\n\t\t\tvar lt = (LocatedToken) $4;\n\t\t\tc.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t}\n\n\t\tif ($4 != null) {\n\t\t\tvar lt = (LocatedToken) $4;\n\t\t\tc.Variable = new LocalVariable (current_block, lt.Value, lt.Location);\n\t\t}\n\n\t\tlbag.AddLocation (c, GetLocation ($2), GetLocation ($5));\n\n\t\t$$ = c;\n\t  }\n\t;\n\nopt_catch_filter\n\t: /* empty */\n\t| IF open_parens_any expression CLOSE_PARENS\n\t  {\n\t\tif (lang_version <= LanguageVersion.V_5)\n\t\t\tFeatureIsNotAvailable (GetLocation ($1), \"exception filter\");\n\n\t  \t$$ = new CatchFilterExpression ((Expression) $3, GetLocation ($1));\n\t  \tlbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t;\n\nchecked_statement\n\t: CHECKED block\n\t  {\n\t\t$$ = new Checked ((Block) $2, GetLocation ($1));\n\t  }\n\t;\n\nunchecked_statement\n\t: UNCHECKED block\n\t  {\n\t\t$$ = new Unchecked ((Block) $2, GetLocation ($1));\n\t  }\n\t;\n\nunsafe_statement\n\t: UNSAFE\n\t  {\n\t\tif (!settings.Unsafe)\n\t\t\tError_UnsafeCodeNotAllowed (GetLocation ($1));\n\t  } block {\n\t\t$$ = new Unsafe ((Block) $3, GetLocation ($1));\n\t  }\n\t;\n\nlock_statement\n\t: LOCK open_parens_any expression CLOSE_PARENS embedded_statement\n\t  {\n\t\tif ($5 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation ($5));\n\t  \n\t\t$$ = new Lock ((Expression) $3, (Statement) $5, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| LOCK open_parens_any expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\n\t\t$$ = new Lock ((Expression) $3, null, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t;\n\nfixed_statement\n\t: FIXED open_parens_any variable_type identifier_inside_body\n\t  {\n\t    start_block (GetLocation ($2));\n\t    \n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tvar lt = (LocatedToken) $4;\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.FixedVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new Fixed.VariableDeclaration ((FullNamedExpression) $3, li);\n\t  }\n\t  using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS\n\t  {\n\t\t$$ = current_variable;\n\t\tcurrent_variable = null;\n\t  }\n\t  embedded_statement\n\t  {\n\t\tif ($10 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation ($10));\n\t  \n\t\tFixed f = new Fixed ((Fixed.VariableDeclaration) $9, (Statement) $10, GetLocation ($1));\n\t\tcurrent_block.AddStatement (f);\n\t\tlbag.AddStatement (f, GetLocation ($2), GetLocation ($8));\n\t\t$$ = end_block (GetLocation ($8));\n\t  }\n\t;\n\nusing_statement\n\t: USING open_parens_any variable_type identifier_inside_body\n\t  {\n\t    start_block (GetLocation ($2));\n\t    \n\t\tcurrent_block.IsCompilerGenerated = true;\n\t\tvar lt = (LocatedToken) $4;\n\t\tvar li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.UsingVariable | LocalVariable.Flags.Used, lt.Location);\n\t\tcurrent_block.AddLocalName (li);\n\t\tcurrent_variable = new Using.VariableDeclaration ((FullNamedExpression) $3, li);\n\t  }\n\t  using_initialization CLOSE_PARENS\n\t  {\n\t\t$$ = current_variable;\t  \n\t\tcurrent_variable = null;\n\t  }\n\t  embedded_statement\n\t  {\n\t\tif ($9 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation ($9));\n\t  \n\t\tUsing u = new Using ((Using.VariableDeclaration) $8, (Statement) $9, GetLocation ($1));\n\t\tlbag.AddStatement (u, GetLocation ($2), GetLocation ($7));\n\t\tcurrent_block.AddStatement (u);\n\t\t$$ = end_block (GetLocation ($7));\n\t  }\n\t| USING open_parens_any expression CLOSE_PARENS embedded_statement\n\t  {\n\t\tif ($5 is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)\n\t\t\tWarning_EmptyStatement (GetLocation ($5));\n\t  \n\t\t$$ = new Using ((Expression) $3, (Statement) $5, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2), GetLocation ($4));\n\t  }\n\t| USING open_parens_any expression error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t\n\t\t$$ = new Using ((Expression) $3, null, GetLocation ($1));\n\t\tlbag.AddStatement ($$, GetLocation ($2));\n\t  }\n\t;\n\t\nusing_initialization\n\t: using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators\n\t| error\n\t  {\n\t\t// It has to be here for the parent to safely restore artificial block\n\t  \tError_SyntaxError (yyToken);\n\t  }\n\t;\n\t\nusing_or_fixed_variable_initializer\n\t: /* empty */\n\t  {\n\t\tError_MissingInitializer (lexer.Location);\n\t  }\n\t| ASSIGN variable_initializer\n\t  {\n\t\tcurrent_variable.Initializer = (Expression) $2;\n\t\tlbag.AddLocation (current_variable, GetLocation ($1));\n\t\t$$ = current_variable;\n\t  }\n\t;\n\n\n// LINQ\n\nquery_expression\n\t: first_from_clause query_body \n\t  {\n\t\tlexer.query_parsing = false;\n\t\t\t\n\t\tLinq.AQueryClause from = $1 as Linq.AQueryClause;\n\t\t\t\n\t\tfrom.Tail.Next = (Linq.AQueryClause)$2;\n\t\t$$ = from;\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\t| nested_from_clause query_body\n\t  {\n\t\tLinq.AQueryClause from = $1 as Linq.AQueryClause;\n\t\t\t\n\t\tfrom.Tail.Next = (Linq.AQueryClause)$2;\n\t\t$$ = from;\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\t\n\n\t// Bubble up COMPLETE_COMPLETION productions\n\t| first_from_clause COMPLETE_COMPLETION {\n\t        lexer.query_parsing = false;\n\t\t$$ = $1;\n\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\t| nested_from_clause COMPLETE_COMPLETION {\n\t        $$ = $1;\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\t;\n\t\nfirst_from_clause\n\t: FROM_FIRST identifier_inside_body IN expression\n\t  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) $2;\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1));\n\t\tlbag.AddLocation (clause, GetLocation ($3));\n\t\t$$ = new Linq.QueryExpression (clause);\n\t  }\n\t| FROM_FIRST type identifier_inside_body IN expression\n\t  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) $3;\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {\n\t\t\t\tIdentifierType = (FullNamedExpression)$2\n\t\t};\n\t\tlbag.AddLocation (clause, GetLocation ($4));\n\t\t$$ = new Linq.QueryExpression (clause);\n\t  }\n\t;\n\nnested_from_clause\n\t: FROM identifier_inside_body IN expression\n\t  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) $2;\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1));\n\t\tlbag.AddLocation (clause, GetLocation ($3));\n\t\t$$ = new Linq.QueryExpression (clause);\n\t  }\n\t| FROM type identifier_inside_body IN expression\n\t  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \n\t\tvar lt = (LocatedToken) $3;\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tvar clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {\n\t\t\t\tIdentifierType = (FullNamedExpression)$2\n\t\t};\n\t\tlbag.AddLocation (clause, GetLocation ($4));\n\t\t$$ = new Linq.QueryExpression (clause);\n\t  }\n\t;\n\t\nfrom_clause\n\t: FROM identifier_inside_body IN\n\t  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  expression_or_error\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\t$$ = new Linq.SelectMany ((Linq.QueryBlock)current_block, sn, (Expression)$5, GetLocation ($1));\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  }\t  \n\t| FROM type identifier_inside_body IN\n\t  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  expression_or_error\n\t  {\n\t\tvar lt = (LocatedToken) $3;\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\n\t\t$$ = new Linq.SelectMany ((Linq.QueryBlock)current_block, sn, (Expression)$6, GetLocation ($1)) {\n\t\t\tIdentifierType = (FullNamedExpression)$2\n\t\t};\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t\t\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\t\n\t\tlbag.AddLocation ($$, GetLocation ($4));\n\t  }\n\t;\t\n\nquery_body\n\t: query_body_clauses select_or_group_clause opt_query_continuation \n\t  {\n\t  \tLinq.AQueryClause head = (Linq.AQueryClause)$2;\n\t\t\n\t\tif ($3 != null)\n\t\t\thead.Next = (Linq.AQueryClause)$3;\n\t\t\t\t\n\t\tif ($1 != null) {\n\t\t\tLinq.AQueryClause clause = (Linq.AQueryClause)$1;\n\t\t\tclause.Tail.Next = head;\n\t\t\thead = clause;\n\t\t}\n\t\t\n\t\t$$ = head;\n\t  }\n\t| select_or_group_clause opt_query_continuation\n\t  {\n\t  \tLinq.AQueryClause head = (Linq.AQueryClause)$2;\n\n\t\tif ($1 != null) {\n\t\t\tLinq.AQueryClause clause = (Linq.AQueryClause)$1;\n\t\t\tclause.Tail.Next = head;\n\t\t\thead = clause;\n\t\t}\n\t\t\n\t\t$$ = head;\n\t  }\n\t| query_body_clauses COMPLETE_COMPLETION\n\t| query_body_clauses error\n\t  {\n\t\treport.Error (742, GetLocation ($2), \"Unexpected symbol `{0}'. A query body must end with select or group clause\", GetSymbolName (yyToken));\n\t\t$$ = $1;\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = null;\n\t  }\n\t;\n\t\nselect_or_group_clause\n\t: SELECT\n\t  {\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  expression_or_error\n\t  {\n\t\t$$ = new Linq.Select ((Linq.QueryBlock)current_block, (Expression)$3, GetLocation ($1));\n\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\t| GROUP\n\t  {\n\t  \tif (linq_clause_blocks == null)\n\t  \t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  \tlinq_clause_blocks.Push ((Linq.QueryBlock)current_block);\n\t  }\n\t  expression_or_error\n\t  {\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  by_expression\n\t  {\n\t\tvar obj = (object[]) $5;\n\n\t\t$$ = new Linq.GroupBy ((Linq.QueryBlock)current_block, (Expression)$3, linq_clause_blocks.Pop (), (Expression)obj[0], GetLocation ($1));\n\t\tlbag.AddLocation ($$, (Location) obj[1]);\n\t\t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\t;\n\nby_expression\n\t: BY expression_or_error\n\t  {\n\t  \t$$ = new object[] { $2, GetLocation ($1) };\n\t  }\n\t| error\n\t  {\n\t\tError_SyntaxError (yyToken);\n\t\t$$ = new object[2] { null, Location.Null };\n\t  }\n\t;\n\t\nquery_body_clauses\n\t: query_body_clause\n\t| query_body_clauses query_body_clause\n\t  {\n\t\t((Linq.AQueryClause)$1).Tail.Next = (Linq.AQueryClause)$2;\n\t\t$$ = $1;\n\t  }\n\t;\n\t\nquery_body_clause\n\t: from_clause\n\t| let_clause \n\t| where_clause\n\t| join_clause\n\t| orderby_clause\n\t;\n\t\nlet_clause\n\t: LET identifier_inside_body ASSIGN \n\t  {\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  expression_or_error\n\t  {\n\t\tvar lt = (LocatedToken) $2;\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t  \t$$ = new Linq.Let ((Linq.QueryBlock) current_block, sn, (Expression)$5, GetLocation ($1));\n\t\tlbag.AddLocation ($$, GetLocation ($3));\n\t  \t\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t\t\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t  }\n\t;\n\nwhere_clause\n\t: WHERE\n\t  {\n\t  \tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  expression_or_error\n\t  {\n\t\t$$ = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)$3, GetLocation ($1));\n\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  }\n\t;\n\t\njoin_clause\n\t: JOIN identifier_inside_body IN\n\t  {\n\t\tif (linq_clause_blocks == null)\n\t\t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\t  expression_or_error ON\n\t  {\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\t  expression_or_error EQUALS\n\t  {\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) $8));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  expression_or_error opt_join_into\n\t  {\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) $11));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t  \n\t\tvar outer_selector = linq_clause_blocks.Pop ();\n\t\tvar block = linq_clause_blocks.Pop ();\n\n\t\tvar lt = (LocatedToken) $2;\t\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tLinq.RangeVariable into;\n\t\t\n\t\tif ($12 == null) {\n\t\t\tinto = sn;\n\t  \t\t$$ = new Linq.Join (block, sn, (Expression)$5, outer_selector, (Linq.QueryBlock) current_block, GetLocation ($1));\n\t\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9));\n\t\t} else {\n\t\t\t//\n\t\t\t// Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions\n\t\t\t//\n\t\t\tvar parent = block.Parent;\n\t\t\twhile (parent is Linq.QueryBlock) {\n\t\t\t\tparent = parent.Parent;\n\t\t\t}\n\t\t\tcurrent_block.Parent = parent;\n\t\t\t\n\t\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\t\n\t\t\tlt = (LocatedToken) $12;\n\t\t\tinto = new Linq.RangeVariable (lt.Value, lt.Location);\n\n\t\t\t$$ = new Linq.GroupJoin (block, sn, (Expression)$5, outer_selector, (Linq.QueryBlock) current_block, into, GetLocation ($1));\t\n\t\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9), opt_intoStack.Pop ());\n\t\t}\n\n\t\tcurrent_block = block.Parent;\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (into);\n\t  }\n\t| JOIN type identifier_inside_body IN\n\t  {\n\t\tif (linq_clause_blocks == null)\n\t\t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\t  expression_or_error ON\n\t  {\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\n\t  }\n\t  expression_or_error EQUALS\n\t  {\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) $9));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  expression_or_error opt_join_into\n\t  {\n\t\tcurrent_block.AddStatement (new ContextualReturn ((Expression) $12));\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t  \n\t\tvar outer_selector = linq_clause_blocks.Pop ();\n\t\tvar block = linq_clause_blocks.Pop ();\n\t\t\n\t\tvar lt = (LocatedToken) $3;\n\t\tvar sn = new Linq.RangeVariable (lt.Value, lt.Location);\n\t\tLinq.RangeVariable into;\n\t\t\n\t\tif ($13 == null) {\n\t\t\tinto = sn;\t\t\n\t  \t\t$$ = new Linq.Join (block, sn, (Expression)$6, outer_selector, (Linq.QueryBlock) current_block, GetLocation ($1)) {\n\t  \t\t\tIdentifierType = (FullNamedExpression)$2\n\t  \t\t};\n\t\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9));\n\t\t} else {\n\t\t\t//\n\t\t\t// Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions\n\t\t\t//\n\t\t\tvar parent = block.Parent;\n\t\t\twhile (parent is Linq.QueryBlock) {\n\t\t\t\tparent = parent.Parent;\n\t\t\t}\n\t\t\tcurrent_block.Parent = parent;\n\t\t\n\t\t\t((Linq.QueryBlock)current_block).AddRangeVariable (sn);\n\t\t\n\t\t\tlt = (LocatedToken) $13;\n\t\t\tinto = new Linq.RangeVariable (lt.Value, lt.Location); // TODO:\n\t\t\t\n\t\t\t$$ = new Linq.GroupJoin (block, sn, (Expression)$6, outer_selector, (Linq.QueryBlock) current_block, into, GetLocation ($1)) {\n\t  \t\t\tIdentifierType = (FullNamedExpression)$2\n\t  \t\t};\t\t\t\n\t\t\tlbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9), opt_intoStack.Pop ());\n\t\t}\n\t\t\n\t\tcurrent_block = block.Parent;\n\t\t((Linq.QueryBlock)current_block).AddRangeVariable (into);\t\t\n\t  }\n\t;\n\t\nopt_join_into\n\t: /* empty */\n\t| INTO identifier_inside_body\n\t  {\n\t\topt_intoStack.Push (GetLocation ($1));\n\t\t$$ = $2;\n\t  }\n\t;\n\t\norderby_clause\n\t: ORDERBY\n\t  {\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\tlbag.AddLocation (current_block, GetLocation ($1));\n\t  }\n\t  orderings\n\t  {\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\t$$ = $3;\n\t  }\n\t;\n\t\norderings\n\t: order_by\n\t| order_by COMMA\n\t  {\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t  }\n\t  orderings_then_by\n\t  {\n\t\t((Linq.AQueryClause)$1).Next = (Linq.AQueryClause)$4;\n\t\t$$ = $1;\n\t  }\n\t;\n\t\norderings_then_by\n\t: then_by\n\t| orderings_then_by COMMA\n\t {\n\t\tcurrent_block.SetEndLocation (lexer.Location);\n\t\tcurrent_block = current_block.Parent;\n\t  \n\t\tcurrent_block = new Linq.QueryBlock ((Linq.QueryBlock) current_block, lexer.Location);\t \n\t }\n\t then_by\n\t {\n\t\t((Linq.AQueryClause)$1).Tail.Next = (Linq.AQueryClause)$4;\n\t\t$$ = $1;\n\t }\n\t;\t\n\t\norder_by\n\t: expression\n\t  {\n\t\t$$ = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)$1);\t\n\t  }\n\t| expression ASCENDING\n\t  {\n\t\t$$ = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)$1);\t\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| expression DESCENDING\n\t  {\n\t\t$$ = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)$1);\t\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t;\n\nthen_by\n\t: expression\n\t  {\n\t\t$$ = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)$1);\t\n\t  }\n\t| expression ASCENDING\n\t  {\n\t\t$$ = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)$1);\t\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\n\t| expression DESCENDING\n\t  {\n\t\t$$ = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)$1);\t\n\t\tlbag.AddLocation ($$, GetLocation ($2));\n\t  }\t\n\t;\n\n\nopt_query_continuation\n\t: /* empty */\n\t| INTO identifier_inside_body\n\t  {\n\t\t// query continuation block is not linked with query block but with block\n\t\t// before. This means each query can use same range variable names for\n\t\t// different identifiers.\n\n\t\tcurrent_block.SetEndLocation (GetLocation ($1));\n\t\tcurrent_block = current_block.Parent;\n\t\n\t\tcurrent_block = new Linq.QueryBlock (current_block, lexer.Location);\n\t\t\n\t\tif (linq_clause_blocks == null)\n\t\t\tlinq_clause_blocks = new Stack<Linq.QueryBlock> ();\n\t  \t\t\n\t\tlinq_clause_blocks.Push ((Linq.QueryBlock) current_block);\t\t\n\t  }\n\t  query_body\n\t  {\n\t\tvar current_block = linq_clause_blocks.Pop ();\t  \n\t\tvar lt = (LocatedToken) $2;\n\t\tvar rv = new Linq.RangeVariable (lt.Value, lt.Location);\n  \t\t$$ = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, null, rv, GetLocation ($1)) {\n  \t\t\tnext = (Linq.AQueryClause)$4\n  \t\t};\n\t  }\n\t;\n\t\n//\n// Support for using the compiler as an interactive parser\n//\n// The INTERACTIVE_PARSER token is first sent to parse our\n// productions;  If the result is a Statement, the parsing\n// is repeated, this time with INTERACTIVE_PARSE_WITH_BLOCK\n// to setup the blocks in advance.\n//\n// This setup is here so that in the future we can add \n// support for other constructs (type parsing, namespaces, etc)\n// that do not require a block to be setup in advance\n//\n\ninteractive_parsing\n\t: EVAL_STATEMENT_PARSER EOF \n\t| EVAL_USING_DECLARATIONS_UNIT_PARSER using_directives opt_COMPLETE_COMPLETION\n\t| EVAL_STATEMENT_PARSER\n\t { \n\t\tcurrent_container = current_type = new Class (current_container, new MemberName (\"<InteractiveExpressionClass>\"), Modifiers.PUBLIC, null);\n\n\t\t// (ref object retval)\n\t\tParameter [] mpar = new Parameter [1];\n\t\tmpar [0] = new Parameter (new TypeExpression (compiler.BuiltinTypes.Object, Location.Null), \"$retval\", Parameter.Modifier.REF, null, Location.Null);\n\n\t\tParametersCompiled pars = new ParametersCompiled (mpar);\n\t\tvar mods = Modifiers.PUBLIC | Modifiers.STATIC;\n\t\tif (settings.Unsafe)\n\t\t\tmods |= Modifiers.UNSAFE;\n\n\t\tcurrent_local_parameters = pars;\n\t\tvar method = new InteractiveMethod (\n\t\t\tcurrent_type,\n\t\t\tnew TypeExpression (compiler.BuiltinTypes.Void, Location.Null),\n\t\t\tmods,\n\t\t\tpars);\n\t\t\t\n\t\tcurrent_type.AddMember (method);\t\t\t\n\t\toob_stack.Push (method);\n\n\t\tinteractive_async = false;\n\n\t\t++lexer.parsing_block;\n\t\tstart_block (lexer.Location);\n\t  }\t\t\n\t  interactive_statement_list opt_COMPLETE_COMPLETION\n\t  {\n\t\t--lexer.parsing_block;\n\t\tvar method = (InteractiveMethod) oob_stack.Pop ();\n\t\tmethod.Block = (ToplevelBlock) end_block(lexer.Location);\n\n\t\tif (interactive_async == true) {\n\t\t\tmethod.ChangeToAsync ();\n\t\t}\n\n\t\tInteractiveResult = (Class) pop_current_class ();\n\t\tcurrent_local_parameters = null;\n\t  } \n\t| EVAL_COMPILATION_UNIT_PARSER interactive_compilation_unit\n\t;\n\ninteractive_compilation_unit\n\t: opt_extern_alias_directives opt_using_directives\n\t| opt_extern_alias_directives opt_using_directives namespace_or_type_declarations\n\t;\n\nopt_COMPLETE_COMPLETION\n\t: /* nothing */\n\t| COMPLETE_COMPLETION\n\t;\n\nclose_brace_or_complete_completion\n\t: CLOSE_BRACE\n\t| COMPLETE_COMPLETION\n\t;\n\t\n//\n// XML documentation code references micro parser\n//\ndocumentation_parsing\n\t: DOC_SEE doc_cref\n\t  {\n\t\tmodule.DocumentationBuilder.ParsedName = (MemberName) $2;\n\t  }\n\t;\n\ndoc_cref\n\t: doc_type_declaration_name opt_doc_method_sig\n\t  {\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)$2;\n\t  }\n\t| builtin_types opt_doc_method_sig\n\t  {\n\t\tmodule.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)$1;\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)$2;\n\t\t$$ = null;\n\t  }\n\t| VOID opt_doc_method_sig\n\t  {\n\t\tmodule.DocumentationBuilder.ParsedBuiltinType = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)$2;\n\t\t$$ = null;\n\t  }\n\t| builtin_types DOT IDENTIFIER opt_doc_method_sig\n\t  {\n\t\tmodule.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)$1;\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)$4;\n\t\tvar lt = (LocatedToken) $3;\n\t\t$$ = new MemberName (lt.Value);\n\t  }\n\t| doc_type_declaration_name DOT THIS\n\t  {\n\t\t$$ = new MemberName ((MemberName) $1, MemberCache.IndexerNameAlias, Location.Null);\n\t  }\n\t| doc_type_declaration_name DOT THIS OPEN_BRACKET\n\t  {\n\t\tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n\t  opt_doc_parameters CLOSE_BRACKET\n\t  {\n\t\tmodule.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)$6;\n\t\t$$ = new MemberName ((MemberName) $1, MemberCache.IndexerNameAlias, Location.Null);\n\t  }\n\t| EXPLICIT OPERATOR type opt_doc_method_sig\n\t  {\n\t\tvar p = (List<DocumentationParameter>)$4 ?? new List<DocumentationParameter> (1);\n\t\tp.Add (new DocumentationParameter ((FullNamedExpression) $3));\n\t\tmodule.DocumentationBuilder.ParsedParameters = p;\n\t\tmodule.DocumentationBuilder.ParsedOperator = Operator.OpType.Explicit;\n\t\t$$ = null;\n\t  }\n\t| IMPLICIT OPERATOR type opt_doc_method_sig\n\t  {\n\t\tvar p = (List<DocumentationParameter>)$4 ?? new List<DocumentationParameter> (1);\n\t\tp.Add (new DocumentationParameter ((FullNamedExpression) $3));\n\t\tmodule.DocumentationBuilder.ParsedParameters = p;\n\t\tmodule.DocumentationBuilder.ParsedOperator = Operator.OpType.Implicit;\n\t\t$$ = null;\n\t  }\t  \n\t| OPERATOR overloadable_operator opt_doc_method_sig\n\t  {\n\t\tvar p = (List<DocumentationParameter>)$3;\n\t\tmodule.DocumentationBuilder.ParsedParameters = p;\n\t\tmodule.DocumentationBuilder.ParsedOperator = (Operator.OpType) $2;\n\t\t$$ = null;\n\t  }\n\t;\n\t\ndoc_type_declaration_name\n\t: type_declaration_name\n\t| doc_type_declaration_name DOT type_declaration_name\n\t  {\n\t\t$$ = new MemberName (((MemberName) $1), (MemberName) $3);\n\t  }\n\t;\n\t\nopt_doc_method_sig\n\t: /* empty */\n\t| OPEN_PARENS\n\t  {\n\t\tvalid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;\n\t  }\n\t  opt_doc_parameters CLOSE_PARENS\n\t  {\n\t\t$$ = $3;\n\t  }\n\t;\n\t\nopt_doc_parameters\n\t: /* empty */\n\t  {\n\t\t$$ = new List<DocumentationParameter> (0);\n\t  }\n\t| doc_parameters\n\t;\n\t\ndoc_parameters\n\t: doc_parameter\n\t  {\n\t\tvar parameters = new List<DocumentationParameter> ();\n\t\tparameters.Add ((DocumentationParameter) $1);\n\t\t$$ = parameters;\n\t  }\n\t| doc_parameters COMMA doc_parameter\n\t  {\n\t\tvar parameters = $1 as List<DocumentationParameter>;\n\t\tparameters.Add ((DocumentationParameter) $3);\n\t\t$$ = parameters;\n\t  }\n\t;\n\t\ndoc_parameter\n\t: opt_parameter_modifier parameter_type\n\t  {\n\t\tif ($1 != null)\n\t\t\t$$ = new DocumentationParameter ((Parameter.Modifier) $1, (FullNamedExpression) $2);\n\t\telse\n\t\t\t$$ = new DocumentationParameter ((FullNamedExpression) $2);\n\t  }\n\t;\n\t\n%%\n\n// <summary>\n//  A class used to hold info about an operator declarator\n// </summary>\nclass OperatorDeclaration {\n\tpublic readonly Operator.OpType optype;\n\tpublic readonly FullNamedExpression ret_type;\n\tpublic readonly Location location;\n\n\tpublic OperatorDeclaration (Operator.OpType op, FullNamedExpression ret_type, Location location)\n\t{\n\t\toptype = op;\n\t\tthis.ret_type = ret_type;\n\t\tthis.location = location;\n\t}\n}\n\nvoid Error_ExpectingTypeName (Expression expr)\n{\n\tif (expr is Invocation){\n\t\treport.Error (1002, expr.Location, \"Expecting `;'\");\n\t} else {\n\t\texpr.Error_InvalidExpressionStatement (report);\n\t}\n}\n\nvoid Error_ParameterModifierNotValid (string modifier, Location loc)\n{\n\treport.Error (631, loc, \"The parameter modifier `{0}' is not valid in this context\",\n\t\t\t              modifier);\n}\n\nvoid Error_DuplicateParameterModifier (Location loc, Parameter.Modifier mod)\n{\n\treport.Error (1107, loc, \"Duplicate parameter modifier `{0}'\",\n  \t\tParameter.GetModifierSignature (mod));\n}\n\nvoid Error_TypeExpected (Location loc)\n{\n\treport.Error (1031, loc, \"Type expected\");\n}\n\nvoid Error_UnsafeCodeNotAllowed (Location loc)\n{\n\treport.Error (227, loc, \"Unsafe code requires the `unsafe' command line option to be specified\");\n}\n\nvoid Warning_EmptyStatement (Location loc)\n{\n\treport.Warning (642, 3, loc, \"Possible mistaken empty statement\");\n}\n\nvoid Error_NamedArgumentExpected (NamedArgument a)\n{\n\treport.Error (1738, a.Location, \"Named arguments must appear after the positional arguments\");\n}\n\nvoid Error_MissingInitializer (Location loc)\n{\n\treport.Error (210, loc, \"You must provide an initializer in a fixed or using statement declaration\");\n}\n\nobject Error_AwaitAsIdentifier (object token)\n{\n\tif (async_block) {\n\t\treport.Error (4003, GetLocation (token), \"`await' cannot be used as an identifier within an async method or lambda expression\");\n\t\treturn new LocatedToken (\"await\", GetLocation (token));\n\t}\n\n\treturn token;\n}\n\nvoid push_current_container (TypeDefinition tc, object partial_token)\n{\n\tif (module.Evaluator != null){\n\t\ttc.Definition.Modifiers = tc.ModFlags = (tc.ModFlags & ~Modifiers.AccessibilityMask) | Modifiers.PUBLIC;\n\t\tif (undo == null)\n\t\t\tundo = new Undo ();\n\n\t\tundo.AddTypeContainer (current_container, tc);\n\t}\n\t\n\tif (partial_token != null)\n\t\tcurrent_container.AddPartial (tc);\n\telse\n\t\tcurrent_container.AddTypeContainer (tc);\n\t\t\n\t++lexer.parsing_declaration;\n\tcurrent_container = tc;\n\tcurrent_type = tc;\n}\n\nTypeContainer pop_current_class ()\n{\n\tvar retval = current_container;\n\n\tcurrent_container = current_container.Parent;\n\tcurrent_type = current_type.Parent as TypeDefinition;\n\n\treturn retval;\n}\n\n[System.Diagnostics.Conditional (\"FULL_AST\")]\nvoid StoreModifierLocation (object token, Location loc)\n{\n\tif (lbag == null)\n\t\treturn;\n\n\tif (mod_locations == null)\n  \t\tmod_locations = new List<Tuple<Modifiers, Location>> ();\n\n\tmod_locations.Add (Tuple.Create ((Modifiers) token, loc));\n}\n\nList<Tuple<Modifiers, Location>> GetModifierLocations ()\n{\n\tvar result = mod_locations;\n\tmod_locations = null;\n\treturn result;\n}\n\n[System.Diagnostics.Conditional (\"FULL_AST\")]\nvoid PushLocation (Location loc)\n{\n\tif (location_stack == null)\n\t\tlocation_stack = new Stack<Location> ();\n\n\tlocation_stack.Push (loc);\n}\n\nLocation PopLocation ()\n{\n\tif (location_stack == null)\n\t\treturn Location.Null;\n\n\treturn location_stack.Pop ();\n}\n\nstring CheckAttributeTarget (int token, string a, Location l)\n{\n\tswitch (a) {\n\tcase \"assembly\" : case \"module\" : case \"field\" : case \"method\" : case \"param\" : case \"property\" : case \"type\" :\n\t\t\treturn a;\n\t}\n\n\tif (!Tokenizer.IsValidIdentifier (a)) {\n\t\tError_SyntaxError (token);\n\t} else {\n\t\treport.Warning (658, 1, l,\n\t\t\t \"`{0}' is invalid attribute target. All attributes in this attribute section will be ignored\", a);\n\t}\n\n\treturn string.Empty;\n}\n\nstatic bool IsUnaryOperator (Operator.OpType op)\n{\n\tswitch (op) {\n\t\t\n\tcase Operator.OpType.LogicalNot: \n\tcase Operator.OpType.OnesComplement: \n\tcase Operator.OpType.Increment:\n\tcase Operator.OpType.Decrement:\n\tcase Operator.OpType.True: \n\tcase Operator.OpType.False: \n\tcase Operator.OpType.UnaryPlus: \n\tcase Operator.OpType.UnaryNegation:\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nvoid syntax_error (Location l, string msg)\n{\n\treport.Error (1003, l, \"Syntax error, \" + msg);\n}\n\nTokenizer lexer;\n\npublic Tokenizer Lexer {\n\tget {\n\t\treturn lexer;\n\t}\n}\t\t   \n\npublic CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, ParserSession session)\n\t: this (reader, file, file.Compiler.Report, session)\n{\n}\n\npublic CSharpParser (SeekableStreamReader reader, CompilationSourceFile file, Report report, ParserSession session)\n{\n\tthis.file = file;\n\tcurrent_container = current_namespace = file;\n\t\n\tthis.module = file.Module;\n\tthis.compiler = file.Compiler;\n\tthis.settings = compiler.Settings;\n\tthis.report = report;\n\t\n\tlang_version = settings.Version;\n\tyacc_verbose_flag = settings.VerboseParserFlag;\n\tdoc_support = settings.DocumentationFile != null;\n\tlexer = new Tokenizer (reader, file, session, report);\n\toob_stack = new Stack<object> ();\n\tlbag = session.LocationsBag;\n\tuse_global_stacks = session.UseJayGlobalArrays;\n\tparameters_bucket = session.ParametersStack;\n}\n\npublic void parse ()\n{\n\teof_token = Token.EOF;\n\t\n\ttry {\n\t\tif (yacc_verbose_flag > 1)\n\t\t\tyyparse (lexer, new yydebug.yyDebugSimple ());\n\t\telse\n\t\t\tyyparse (lexer);\n\t\t\t\n\t\tTokenizer tokenizer = lexer as Tokenizer;\n\t\ttokenizer.cleanup ();\t\t\n\t} catch (Exception e){\n\t  \tif (e is yyParser.yyUnexpectedEof) {\n\t\t\tError_SyntaxError (yyToken);\n\t\t\tUnexpectedEOF = true;\n\t\t\treturn;\n\t\t}\n\t\t\t\n\t\tif (e is yyParser.yyException) {\n\t\t\tif (report.Errors == 0)\n\t\t\t\treport.Error (-25, lexer.Location, \"Parsing error\");\n\t\t} else {\n\t\t\t// Used by compiler-tester to test internal errors\n\t\t\tif (yacc_verbose_flag > 0 || e is FatalException)\n\t\t\t\tthrow;\n\t\t\n\t\t\treport.Error (589, lexer.Location, \"Internal compiler error during parsing\" + e);\n\t\t}\n\t}\n}\n\nvoid CheckToken (int error, int yyToken, string msg, Location loc)\n{\n\tif (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD)\n\t\treport.Error (error, loc, \"{0}: `{1}' is a keyword\", msg, GetTokenName (yyToken));\n\telse\n\t\treport.Error (error, loc, msg);\n}\n\nstring ConsumeStoredComment ()\n{\n\tstring s = tmpComment;\n\ttmpComment = null;\n\tLexer.doc_state = XmlCommentState.Allowed;\n\treturn s;\n}\n\nvoid FeatureIsNotAvailable (Location loc, string feature)\n{\n\treport.FeatureIsNotAvailable (compiler, loc, feature);\n}\n\nLocation GetLocation (object obj)\n{\n\tvar lt = obj as LocatedToken;\n\tif (lt != null)\n\t\treturn lt.Location;\n\t\t\n\tvar mn = obj as MemberName;\n\tif (mn != null)\n\t\treturn mn.Location;\n\t\t\n\tvar expr = obj as Expression;\n\tif (expr != null)\n\t\treturn expr.Location;\n\n\treturn lexer.Location;\n}\n\nvoid start_block (Location loc)\n{\n\tif (current_block == null) {\n\t\tcurrent_block = new ToplevelBlock (compiler, current_local_parameters, loc);\n\t\tparsing_anonymous_method = false;\n\t} else if (parsing_anonymous_method) {\n\t\tcurrent_block = new ParametersBlock (current_block, current_local_parameters, loc);\n\t\tparsing_anonymous_method = false;\n\t} else {\n\t\tcurrent_block = new ExplicitBlock (current_block, loc, Location.Null);\n\t}\n}\n\nBlock\nend_block (Location loc)\n{\n\tBlock retval = current_block.Explicit;\n\tretval.SetEndLocation (loc);\n\tcurrent_block = retval.Parent;\n\treturn retval;\n}\n\nvoid start_anonymous (bool isLambda, ParametersCompiled parameters, bool isAsync, Location loc)\n{\n\toob_stack.Push (current_anonymous_method);\n\toob_stack.Push (current_local_parameters);\n\toob_stack.Push (current_variable);\n\toob_stack.Push (async_block);\n\n\tcurrent_local_parameters = parameters;\n\tif (isLambda) {\n\t\tif (lang_version <= LanguageVersion.ISO_2)\n\t\t\tFeatureIsNotAvailable (loc, \"lambda expressions\");\n\n\t\tcurrent_anonymous_method = new LambdaExpression (loc);\n\t} else {\n\t\tif (lang_version == LanguageVersion.ISO_1)\n\t\t\tFeatureIsNotAvailable (loc, \"anonymous methods\");\n\t\t\t\n\t\tcurrent_anonymous_method = new AnonymousMethodExpression (loc);\n\t}\n\tcurrent_anonymous_method.IsAsync = isAsync;\n\t\n\tasync_block = isAsync;\n\t// Force the next block to be created as a ToplevelBlock\n\tparsing_anonymous_method = true;\n}\n\n/*\n * Completes the anonymous method processing, if lambda_expr is null, this\n * means that we have a Statement instead of an Expression embedded \n */\nAnonymousMethodExpression end_anonymous (ParametersBlock anon_block)\n{\n\tAnonymousMethodExpression retval;\n\n\tif (async_block)\n\t\tanon_block.IsAsync = true;\n\n\tcurrent_anonymous_method.Block = anon_block;\n\tretval = current_anonymous_method;\n\n\tasync_block = (bool) oob_stack.Pop ();\n\tcurrent_variable = (BlockVariable) oob_stack.Pop ();\n\tcurrent_local_parameters = (ParametersCompiled) oob_stack.Pop ();\n\tcurrent_anonymous_method = (AnonymousMethodExpression) oob_stack.Pop ();\n\n\treturn retval;\n}\n\nvoid Error_SyntaxError (int token)\n{\n\tError_SyntaxError (0, token);\n}\n\nvoid Error_SyntaxError (int error_code, int token)\n{\n\tError_SyntaxError (error_code, token, \"Unexpected symbol\");\n}\n\nvoid Error_SyntaxError (int error_code, int token, string msg)\n{\n\tLexer.CompleteOnEOF = false;\n\n\t// An error message has been reported by tokenizer\n\tif (token == Token.ERROR)\n\t\treturn;\n\t\n\t// Avoid duplicit error message after unterminated string literals\n\tif (token == Token.LITERAL && lexer.Location.Column == 0)\n\t\treturn;\n\n\tstring symbol = GetSymbolName (token);\n\tstring expecting = GetExpecting ();\n\tvar loc = lexer.Location - symbol.Length;\n\t\n\tif (error_code == 0) {\n\t\tif (expecting == \"`identifier'\") {\n\t\t\tif (token > Token.FIRST_KEYWORD && token < Token.LAST_KEYWORD) {\n\t\t\t\treport.Error (1041, loc, \"Identifier expected, `{0}' is a keyword\", symbol);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\terror_code = 1001;\n\t\t\texpecting = \"identifier\";\n\t\t} else if (expecting == \"`)'\") {\n\t\t\terror_code = 1026;\n\t\t} else {\n\t\t\terror_code = 1525;\n\t\t}\n\t}\n\t\n\tif (string.IsNullOrEmpty (expecting))\n\t\treport.Error (error_code, loc, \"{1} `{0}'\", symbol, msg);\n\telse\n\t\treport.Error (error_code, loc, \"{2} `{0}', expecting {1}\", symbol, expecting, msg);\t  \n}\n\nstring GetExpecting ()\n{\n\tint [] tokens = yyExpectingTokens (yyExpectingState);\n\tvar names = new List<string> (tokens.Length);\n\tbool has_type = false;\n\tbool has_identifier = false;\n\tfor (int i = 0; i < tokens.Length; i++){\n\t\tint token = tokens [i];\n\t\thas_identifier |= token == Token.IDENTIFIER;\n\t\t\n\t\tstring name = GetTokenName (token);\n\t\tif (name == \"<internal>\")\n\t\t\tcontinue;\n\t\t\t\n\t\thas_type |= name == \"type\";\n\t\tif (names.Contains (name))\n\t\t\tcontinue;\n\t\t\n\t\tnames.Add (name);\n\t}\n\n\t//\n\t// Too many tokens to enumerate\n\t//\n\tif (names.Count > 8)\n\t\treturn null;\n\n\tif (has_type && has_identifier)\n\t\tnames.Remove (\"identifier\");\n\n\tif (names.Count == 1)\n\t\treturn \"`\" + GetTokenName (tokens [0]) + \"'\";\n\t\n\tStringBuilder sb = new StringBuilder ();\n\tnames.Sort ();\n\tint count = names.Count;\n\tfor (int i = 0; i < count; i++){\n\t\tbool last = i + 1 == count;\n\t\tif (last)\n\t\t\tsb.Append (\"or \");\n\t\tsb.Append ('`');\n\t\tsb.Append (names [i]);\n\t\tsb.Append (last ? \"'\" : count < 3 ? \"' \" : \"', \");\n\t}\n\treturn sb.ToString ();\n}\n\n\nstring GetSymbolName (int token)\n{\n\tswitch (token){\n\tcase Token.LITERAL:\n\t\treturn ((Constant)lexer.Value).GetValue ().ToString ();\n\tcase Token.IDENTIFIER:\n\t\treturn ((LocatedToken)lexer.Value).Value;\n\n\tcase Token.BOOL:\n\t\treturn \"bool\";\n\tcase Token.BYTE:\n\t\treturn \"byte\";\n\tcase Token.CHAR:\n\t\treturn \"char\";\n\tcase Token.VOID:\n\t\treturn \"void\";\n\tcase Token.DECIMAL:\n\t\treturn \"decimal\";\n\tcase Token.DOUBLE:\n\t\treturn \"double\";\n\tcase Token.FLOAT:\n\t\treturn \"float\";\n\tcase Token.INT:\n\t\treturn \"int\";\n\tcase Token.LONG:\n\t\treturn \"long\";\n\tcase Token.SBYTE:\n\t\treturn \"sbyte\";\n\tcase Token.SHORT:\n\t\treturn \"short\";\n\tcase Token.STRING:\n\t\treturn \"string\";\n\tcase Token.UINT:\n\t\treturn \"uint\";\n\tcase Token.ULONG:\n\t\treturn \"ulong\";\n\tcase Token.USHORT:\n\t\treturn \"ushort\";\n\tcase Token.OBJECT:\n\t\treturn \"object\";\n\t\t\n\tcase Token.PLUS:\n\t\treturn \"+\";\n\tcase Token.UMINUS:\n\tcase Token.MINUS:\n\t\treturn \"-\";\n\tcase Token.BANG:\n\t\treturn \"!\";\n\tcase Token.BITWISE_AND:\n\t\treturn \"&\";\n\tcase Token.BITWISE_OR:\n\t\treturn \"|\";\n\tcase Token.STAR:\n\t\treturn \"*\";\n\tcase Token.PERCENT:\n\t\treturn \"%\";\n\tcase Token.DIV:\n\t\treturn \"/\";\n\tcase Token.CARRET:\n\t\treturn \"^\";\n\tcase Token.OP_INC:\n\t\treturn \"++\";\n\tcase Token.OP_DEC:\n\t\treturn \"--\";\n\tcase Token.OP_SHIFT_LEFT:\n\t\treturn \"<<\";\n\tcase Token.OP_SHIFT_RIGHT:\n\t\treturn \">>\";\n\tcase Token.OP_LT:\n\t\treturn \"<\";\n\tcase Token.OP_GT:\n\t\treturn \">\";\n\tcase Token.OP_LE:\n\t\treturn \"<=\";\n\tcase Token.OP_GE:\n\t\treturn \">=\";\n\tcase Token.OP_EQ:\n\t\treturn \"==\";\n\tcase Token.OP_NE:\n\t\treturn \"!=\";\n\tcase Token.OP_AND:\n\t\treturn \"&&\";\n\tcase Token.OP_OR:\n\t\treturn \"||\";\n\tcase Token.OP_PTR:\n\t\treturn \"->\";\n\tcase Token.OP_COALESCING:\t\n\t\treturn \"??\";\n\tcase Token.OP_MULT_ASSIGN:\n\t\treturn \"*=\";\n\tcase Token.OP_DIV_ASSIGN:\n\t\treturn \"/=\";\n\tcase Token.OP_MOD_ASSIGN:\n\t\treturn \"%=\";\n\tcase Token.OP_ADD_ASSIGN:\n\t\treturn \"+=\";\n\tcase Token.OP_SUB_ASSIGN:\n\t\treturn \"-=\";\n\tcase Token.OP_SHIFT_LEFT_ASSIGN:\n\t\treturn \"<<=\";\n\tcase Token.OP_SHIFT_RIGHT_ASSIGN:\n\t\treturn \">>=\";\n\tcase Token.OP_AND_ASSIGN:\n\t\treturn \"&=\";\n\tcase Token.OP_XOR_ASSIGN:\n\t\treturn \"^=\";\n\tcase Token.OP_OR_ASSIGN:\n\t\treturn \"|=\";\n\t}\n\n\treturn GetTokenName (token);\n}\n\nstatic string GetTokenName (int token)\n{\n\tswitch (token){\n\tcase Token.ABSTRACT:\n\t\treturn \"abstract\";\n\tcase Token.AS:\n\t\treturn \"as\";\n\tcase Token.ADD:\n\t\treturn \"add\";\n\tcase Token.ASYNC:\n\t\treturn \"async\";\n\tcase Token.BASE:\n\t\treturn \"base\";\n\tcase Token.BREAK:\n\t\treturn \"break\";\n\tcase Token.CASE:\n\t\treturn \"case\";\n\tcase Token.CATCH:\n\t\treturn \"catch\";\n\tcase Token.CHECKED:\n\t\treturn \"checked\";\n\tcase Token.CLASS:\n\t\treturn \"class\";\n\tcase Token.CONST:\n\t\treturn \"const\";\n\tcase Token.CONTINUE:\n\t\treturn \"continue\";\n\tcase Token.DEFAULT:\n\t\treturn \"default\";\n\tcase Token.DELEGATE:\n\t\treturn \"delegate\";\n\tcase Token.DO:\n\t\treturn \"do\";\n\tcase Token.ELSE:\n\t\treturn \"else\";\n\tcase Token.ENUM:\n\t\treturn \"enum\";\n\tcase Token.EVENT:\n\t\treturn \"event\";\n\tcase Token.EXPLICIT:\n\t\treturn \"explicit\";\n\tcase Token.EXTERN:\n\tcase Token.EXTERN_ALIAS:\n\t\treturn \"extern\";\n\tcase Token.FALSE:\n\t\treturn \"false\";\n\tcase Token.FINALLY:\n\t\treturn \"finally\";\n\tcase Token.FIXED:\n\t\treturn \"fixed\";\n\tcase Token.FOR:\n\t\treturn \"for\";\n\tcase Token.FOREACH:\n\t\treturn \"foreach\";\n\tcase Token.GOTO:\n\t\treturn \"goto\";\n\tcase Token.IF:\n\t\treturn \"if\";\n\tcase Token.IMPLICIT:\n\t\treturn \"implicit\";\n\tcase Token.IN:\n\t\treturn \"in\";\n\tcase Token.INTERFACE:\n\t\treturn \"interface\";\n\tcase Token.INTERNAL:\n\t\treturn \"internal\";\n\tcase Token.IS:\n\t\treturn \"is\";\n\tcase Token.LOCK:\n\t\treturn \"lock\";\n\tcase Token.NAMESPACE:\n\t\treturn \"namespace\";\n\tcase Token.NEW:\n\t\treturn \"new\";\n\tcase Token.NULL:\n\t\treturn \"null\";\n\tcase Token.OPERATOR:\n\t\treturn \"operator\";\n\tcase Token.OUT:\n\t\treturn \"out\";\n\tcase Token.OVERRIDE:\n\t\treturn \"override\";\n\tcase Token.PARAMS:\n\t\treturn \"params\";\n\tcase Token.PRIVATE:\n\t\treturn \"private\";\n\tcase Token.PROTECTED:\n\t\treturn \"protected\";\n\tcase Token.PUBLIC:\n\t\treturn \"public\";\n\tcase Token.READONLY:\n\t\treturn \"readonly\";\n\tcase Token.REF:\n\t\treturn \"ref\";\n\tcase Token.RETURN:\n\t\treturn \"return\";\n\tcase Token.REMOVE:\n\t\treturn \"remove\";\n\tcase Token.SEALED:\n\t\treturn \"sealed\";\n\tcase Token.SIZEOF:\n\t\treturn \"sizeof\";\n\tcase Token.STACKALLOC:\n\t\treturn \"stackalloc\";\n\tcase Token.STATIC:\n\t\treturn \"static\";\n\tcase Token.STRUCT:\n\t\treturn \"struct\";\n\tcase Token.SWITCH:\n\t\treturn \"switch\";\n\tcase Token.THIS:\n\t\treturn \"this\";\n\tcase Token.THROW:\n\t\treturn \"throw\";\n\tcase Token.TRUE:\n\t\treturn \"true\";\n\tcase Token.TRY:\n\t\treturn \"try\";\n\tcase Token.TYPEOF:\n\t\treturn \"typeof\";\n\tcase Token.UNCHECKED:\n\t\treturn \"unchecked\";\n\tcase Token.UNSAFE:\n\t\treturn \"unsafe\";\n\tcase Token.USING:\n\t\treturn \"using\";\n\tcase Token.VIRTUAL:\n\t\treturn \"virtual\";\n\tcase Token.VOLATILE:\n\t\treturn \"volatile\";\n\tcase Token.WHERE:\n\t\treturn \"where\";\n\tcase Token.WHILE:\n\t\treturn \"while\";\n\tcase Token.ARGLIST:\n\t\treturn \"__arglist\";\n\tcase Token.REFVALUE:\n\t\treturn \"__refvalue\";\n\tcase Token.REFTYPE:\n\t\treturn \"__reftype\";\n\tcase Token.MAKEREF:\n\t\treturn \"__makeref\";\n\tcase Token.PARTIAL:\n\t\treturn \"partial\";\n\tcase Token.ARROW:\n\t\treturn \"=>\";\n\tcase Token.FROM:\n\tcase Token.FROM_FIRST:\n\t\treturn \"from\";\n\tcase Token.JOIN:\n\t\treturn \"join\";\n\tcase Token.ON:\n\t\treturn \"on\";\n\tcase Token.EQUALS:\n\t\treturn \"equals\";\n\tcase Token.SELECT:\n\t\treturn \"select\";\n\tcase Token.GROUP:\n\t\treturn \"group\";\n\tcase Token.BY:\n\t\treturn \"by\";\n\tcase Token.LET:\n\t\treturn \"let\";\n\tcase Token.ORDERBY:\n\t\treturn \"orderby\";\n\tcase Token.ASCENDING:\n\t\treturn \"ascending\";\n\tcase Token.DESCENDING:\n\t\treturn \"descending\";\n\tcase Token.INTO:\n\t\treturn \"into\";\n\tcase Token.GET:\n\t\treturn \"get\";\n\tcase Token.SET:\n\t\treturn \"set\";\n\tcase Token.OPEN_BRACE:\n\t\treturn \"{\";\n\tcase Token.CLOSE_BRACE:\n\t\treturn \"}\";\n\tcase Token.OPEN_BRACKET:\n\tcase Token.OPEN_BRACKET_EXPR:\n\t\treturn \"[\";\n\tcase Token.CLOSE_BRACKET:\n\t\treturn \"]\";\n\tcase Token.OPEN_PARENS_CAST:\n\tcase Token.OPEN_PARENS_LAMBDA:\n\tcase Token.OPEN_PARENS:\n\t\treturn \"(\";\n\tcase Token.CLOSE_PARENS:\n\t\treturn \")\";\n\tcase Token.DOT:\n\t\treturn \".\";\n\tcase Token.COMMA:\n\t\treturn \",\";\n\tcase Token.DEFAULT_COLON:\n\t\treturn \"default:\";\n\tcase Token.COLON:\n\t\treturn \":\";\n\tcase Token.SEMICOLON:\n\t\treturn \";\";\n\tcase Token.TILDE:\n\t\treturn \"~\";\n\t\t\n\tcase Token.PLUS:\n\tcase Token.UMINUS:\n\tcase Token.MINUS:\n\tcase Token.BANG:\n\tcase Token.OP_LT:\n\tcase Token.OP_GT:\n\tcase Token.BITWISE_AND:\n\tcase Token.BITWISE_OR:\n\tcase Token.STAR:\n\tcase Token.PERCENT:\n\tcase Token.DIV:\n\tcase Token.CARRET:\n\tcase Token.OP_INC:\n\tcase Token.OP_DEC:\n\tcase Token.OP_SHIFT_LEFT:\n\tcase Token.OP_SHIFT_RIGHT:\n\tcase Token.OP_LE:\n\tcase Token.OP_GE:\n\tcase Token.OP_EQ:\n\tcase Token.OP_NE:\n\tcase Token.OP_AND:\n\tcase Token.OP_OR:\n\tcase Token.OP_PTR:\n\tcase Token.OP_COALESCING:\t\n\tcase Token.OP_MULT_ASSIGN:\n\tcase Token.OP_DIV_ASSIGN:\n\tcase Token.OP_MOD_ASSIGN:\n\tcase Token.OP_ADD_ASSIGN:\n\tcase Token.OP_SUB_ASSIGN:\n\tcase Token.OP_SHIFT_LEFT_ASSIGN:\n\tcase Token.OP_SHIFT_RIGHT_ASSIGN:\n\tcase Token.OP_AND_ASSIGN:\n\tcase Token.OP_XOR_ASSIGN:\n\tcase Token.OP_OR_ASSIGN:\n\t\treturn \"<operator>\";\n\n\tcase Token.BOOL:\n\tcase Token.BYTE:\n\tcase Token.CHAR:\n\tcase Token.VOID:\n\tcase Token.DECIMAL:\n\tcase Token.DOUBLE:\n\tcase Token.FLOAT:\n\tcase Token.INT:\n\tcase Token.LONG:\n\tcase Token.SBYTE:\n\tcase Token.SHORT:\n\tcase Token.STRING:\n\tcase Token.UINT:\n\tcase Token.ULONG:\n\tcase Token.USHORT:\n\tcase Token.OBJECT:\n\t\treturn \"type\";\n\t\n\tcase Token.ASSIGN:\n\t\treturn \"=\";\n\tcase Token.OP_GENERICS_LT:\n\tcase Token.GENERIC_DIMENSION:\n\t\treturn \"<\";\n\tcase Token.OP_GENERICS_GT:\n\t\treturn \">\";\n\tcase Token.INTERR:\n\tcase Token.INTERR_NULLABLE:\n\t\treturn \"?\";\n\tcase Token.DOUBLE_COLON:\n\t\treturn \"::\";\n\tcase Token.LITERAL:\n\t\treturn \"value\";\n\tcase Token.IDENTIFIER:\n\tcase Token.AWAIT:\n\t\treturn \"identifier\";\n\n\tcase Token.EOF:\n\t\treturn \"end-of-file\";\n\n\t\t// All of these are internal.\n\tcase Token.NONE:\n\tcase Token.ERROR:\n\tcase Token.FIRST_KEYWORD:\n\tcase Token.EVAL_COMPILATION_UNIT_PARSER:\n\tcase Token.EVAL_USING_DECLARATIONS_UNIT_PARSER:\n\tcase Token.EVAL_STATEMENT_PARSER:\n\tcase Token.LAST_KEYWORD:\n\tcase Token.GENERATE_COMPLETION:\n\tcase Token.COMPLETE_COMPLETION:\n\t\treturn \"<internal>\";\n\n\t\t// A bit more robust.\n\tdefault:\n\t\treturn yyNames [token];\n        }\n}\n\n/* end end end */\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs",
    "content": "//\n// cs-tokenizer.cs: The Tokenizer for the C# compiler\n//                  This also implements the preprocessor\n//\n// Author: Miguel de Icaza (miguel@gnu.org)\n//         Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)\n//\nusing System;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Diagnostics;\nusing System.Collections;\n\nnamespace Mono.CSharp\n{\n\t//\n\t// This class has to be used by parser only, it reuses token\n\t// details once a file is parsed\n\t//\n\tpublic class LocatedToken\n\t{\n\t\tpublic int row, column;\n\t\tpublic string value;\n\t\tpublic SourceFile file;\n\n\t\tpublic LocatedToken ()\n\t\t{\n\t\t}\n\n\t\tpublic LocatedToken (string value, Location loc)\n\t\t{\n\t\t\tthis.value = value;\n\t\t\tfile = loc.SourceFile;\n\t\t\trow = loc.Row;\n\t\t\tcolumn = loc.Column;\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn string.Format (\"Token '{0}' at {1},{2}\", Value, row, column);\n\t\t}\n\n\t\tpublic Location Location\n\t\t{\n\t\t\tget { return new Location (file, row, column); }\n\t\t}\n\n\t\tpublic string Value\n\t\t{\n\t\t\tget { return value; }\n\t\t}\n\t}\n\n\t/// <summary>\n\t///    Tokenizer for C# source code. \n\t/// </summary>\n\tpublic class Tokenizer : yyParser.yyInput\n\t{\n\t\tclass KeywordEntry<T>\n\t\t{\n\t\t\tpublic readonly T Token;\n\t\t\tpublic KeywordEntry<T> Next;\n\t\t\tpublic readonly char[] Value;\n\n\t\t\tpublic KeywordEntry (string value,T token)\n\t\t\t{\n\t\t\t\tthis.Value = value.ToCharArray ();\n\t\t\t\tthis.Token = token;\n\t\t\t}\n\t\t}\n\n\t\tsealed class IdentifiersComparer : IEqualityComparer<char[]>\n\t\t{\n\t\t\treadonly int length;\n\n\t\t\tpublic IdentifiersComparer (int length)\n\t\t\t{\n\t\t\t\tthis.length = length;\n\t\t\t}\n\n\t\t\tpublic bool Equals (char[] x, char[] y)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < length; ++i)\n\t\t\t\t\tif (x [i] != y [i])\n\t\t\t\t\t\treturn false;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic int GetHashCode (char[] obj)\n\t\t\t{\n\t\t\t\tint h = 0;\n\t\t\t\tfor (int i = 0; i < length; ++i)\n\t\t\t\t\th = (h << 5) - h + obj [i];\n\n\t\t\t\treturn h;\n\t\t\t}\n\t\t}\n\n\t\tpublic class LocatedTokenBuffer\n\t\t{\n\t\t\treadonly LocatedToken[] buffer;\n\t\t\tpublic int pos;\n\n\t\t\tpublic LocatedTokenBuffer ()\n\t\t\t{\n\t\t\t\tbuffer = new LocatedToken[0];\n\t\t\t}\n\n\t\t\tpublic LocatedTokenBuffer (LocatedToken[] buffer)\n\t\t\t{\n\t\t\t\tthis.buffer = buffer ?? new LocatedToken[0];\n\t\t\t}\n\n\t\t\tpublic LocatedToken Create (SourceFile file, int row, int column)\n\t\t\t{\n\t\t\t\treturn Create (null, file, row, column);\n\t\t\t}\n\n\t\t\tpublic LocatedToken Create (string value, SourceFile file, int row, int column)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// TODO: I am not very happy about the logic but it's the best\n\t\t\t\t// what I could come up with for now.\n\t\t\t\t// Ideally we should be using just tiny buffer (256 elements) which\n\t\t\t\t// is enough to hold all details for currect stack and recycle elements\n\t\t\t\t// poped from the stack but there is a trick needed to recycle\n\t\t\t\t// them properly.\n\t\t\t\t//\n\t\t\t\tLocatedToken entry;\n\t\t\t\tif (pos >= buffer.Length) {\n\t\t\t\t\tentry = new LocatedToken ();\n\t\t\t\t} else {\n\t\t\t\t\tentry = buffer[pos];\n\t\t\t\t\tif (entry == null) {\n\t\t\t\t\t\tentry = new LocatedToken ();\n\t\t\t\t\t\tbuffer[pos] = entry;\n\t\t\t\t\t}\n\n\t\t\t\t\t++pos;\n\t\t\t\t}\n\t\t\t\tentry.value = value;\n\t\t\t\tentry.file = file;\n\t\t\t\tentry.row = row;\n\t\t\t\tentry.column = column;\n\t\t\t\treturn entry;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Used for token not required by expression evaluator\n\t\t\t//\n\t\t\t[Conditional (\"FULL_AST\")]\n\t\t\tpublic void CreateOptional (SourceFile file, int row, int col, ref object token)\n\t\t\t{\n\t\t\t\ttoken = Create (file, row, col);\n\t\t\t}\n\t\t}\n\n\t\tpublic enum PreprocessorDirective\n\t\t{\n\t\t\tInvalid = 0,\n\n\t\t\tRegion = 1,\n\t\t\tEndregion = 2,\n\t\t\tIf = 3 | RequiresArgument,\n\t\t\tEndif = 4,\n\t\t\tElif = 5 | RequiresArgument,\n\t\t\tElse = 6,\n\t\t\tDefine = 7 | RequiresArgument,\n\t\t\tUndef = 8 | RequiresArgument,\n\t\t\tError = 9,\n\t\t\tWarning = 10,\n\t\t\tPragma = 11 | CustomArgumentsParsing,\n\t\t\tLine = 12 | CustomArgumentsParsing,\n\n\t\t\tCustomArgumentsParsing = 1 << 10,\n\t\t\tRequiresArgument = 1 << 11\n\t\t}\n\n\t\treadonly SeekableStreamReader reader;\n\t\treadonly CompilationSourceFile source_file;\n\t\tpublic CompilationSourceFile SourceFile { get { return source_file; } }\n\t\treadonly CompilerContext context;\n\t\treadonly Report Report;\n\n\n\t\tSourceFile current_source;\n\t\tLocation hidden_block_start;\n\t\tint ref_line = 1;\n\t\tint line = 1;\n\t\tint col = 0;\n\t\tint previous_col;\n\t\tint current_token;\n\t\treadonly int tab_size;\n\t\tbool handle_get_set = false;\n\t\tbool handle_remove_add = false;\n\t\tbool handle_where;\n\t\tbool lambda_arguments_parsing;\n\t\tList<Location> escaped_identifiers;\n\t\tint parsing_generic_less_than;\n\t\treadonly bool doc_processing;\n\t\treadonly LocatedTokenBuffer ltb;\n\t\t\n\t\t//\n\t\t// Used mainly for parser optimizations. Some expressions for instance\n\t\t// can appear only in block (including initializer, base initializer)\n\t\t// scope only\n\t\t//\n\t\tpublic int parsing_block;\n\t\tinternal bool query_parsing;\n\t\t\n\t\t// \n\t\t// When parsing type only, useful for ambiguous nullable types\n\t\t//\n\t\tpublic int parsing_type;\n\t\t\n\t\t//\n\t\t// Set when parsing generic declaration (type or method header)\n\t\t//\n\t\tpublic bool parsing_generic_declaration;\n\t\tpublic bool parsing_generic_declaration_doc;\n\t\t\n\t\t//\n\t\t// The value indicates that we have not reach any declaration or\n\t\t// namespace yet\n\t\t//\n\t\tpublic int parsing_declaration;\n\t\tpublic bool parsing_attribute_section;\n\n\t\tpublic bool parsing_modifiers;\n\n\t\t//\n\t\t// The special characters to inject on streams to run the unit parser\n\t\t// in the special expression mode. Using private characters from\n\t\t// Plane Sixteen (U+100000 to U+10FFFD)\n\t\t//\n\t\t// This character is only tested just before the tokenizer is about to report\n\t\t// an error;   So on the regular operation mode, this addition will have no\n\t\t// impact on the tokenizer's performance.\n\t\t//\n\t\t\n\t\tpublic const int EvalStatementParserCharacter = 0x100000;\n\t\tpublic const int EvalCompilationUnitParserCharacter = 0x100001;\n\t\tpublic const int EvalUsingDeclarationsParserCharacter = 0x100002;\n\t\tpublic const int DocumentationXref = 0x100003;\n\n\t\tconst int UnicodeLS = 0x2028;\n\t\tconst int UnicodePS = 0x2029;\n\t\t\n\t\t//\n\t\t// XML documentation buffer. The save point is used to divide\n\t\t// comments on types and comments on members.\n\t\t//\n\t\tStringBuilder xml_comment_buffer;\n\n\t\t//\n\t\t// See comment on XmlCommentState enumeration.\n\t\t//\n\t\tXmlCommentState xml_doc_state = XmlCommentState.Allowed;\n\n\t\t//\n\t\t// Whether tokens have been seen on this line\n\t\t//\n\t\tbool tokens_seen = false;\n\n\t\t//\n\t\t// Set to true once the GENERATE_COMPLETION token has bee\n\t\t// returned.   This helps produce one GENERATE_COMPLETION,\n\t\t// as many COMPLETE_COMPLETION as necessary to complete the\n\t\t// AST tree and one final EOF.\n\t\t//\n\t\tbool generated;\n\t\t\n\t\t//\n\t\t// Whether a token has been seen on the file\n\t\t// This is needed because `define' is not allowed to be used\n\t\t// after a token has been seen.\n\t\t//\n\t\tbool any_token_seen;\n\n\t\t//\n\t\t// Class variables\n\t\t// \n\t\tstatic readonly KeywordEntry<int>[][] keywords;\n\t\tstatic readonly KeywordEntry<PreprocessorDirective>[][] keywords_preprocessor;\n\t\tstatic readonly HashSet<string> keyword_strings;\n\t\tstatic readonly NumberStyles styles;\n\t\tstatic readonly NumberFormatInfo csharp_format_info;\n\n\t\t// Pragma arguments\n\t\tstatic readonly char[] pragma_warning = \"warning\".ToCharArray ();\n\t\tstatic readonly char[] pragma_warning_disable = \"disable\".ToCharArray ();\n\t\tstatic readonly char[] pragma_warning_restore = \"restore\".ToCharArray ();\n\t\tstatic readonly char[] pragma_checksum = \"checksum\".ToCharArray ();\n\t\tstatic readonly char[] line_hidden = \"hidden\".ToCharArray ();\n\t\tstatic readonly char[] line_default = \"default\".ToCharArray ();\n\n\t\tstatic readonly char[] simple_whitespaces = new char[] { ' ', '\\t' };\n\t\tbool startsLine = true;\n\t\tinternal SpecialsBag sbag;\n\n\t\tpublic bool PropertyParsing {\n\t\t\tget { return handle_get_set; }\n\t\t\tset { handle_get_set = value; }\n\t\t}\n\n\t\tpublic bool EventParsing {\n\t\t\tget { return handle_remove_add; }\n\t\t\tset { handle_remove_add = value; }\n\t\t}\n\n\t\tpublic bool ConstraintsParsing {\n\t\t\tget { return handle_where; }\n\t\t\tset { handle_where = value; }\n\t\t}\n\t\n\t\tpublic XmlCommentState doc_state {\n\t\t\tget { return xml_doc_state; }\n\t\t\tset {\n\t\t\t\tif (value == XmlCommentState.Allowed) {\n\t\t\t\t\tcheck_incorrect_doc_comment ();\n\t\t\t\t\treset_doc_comment ();\n\t\t\t\t}\n\t\t\t\txml_doc_state = value;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// This is used to trigger completion generation on the parser\n\t\tpublic bool CompleteOnEOF;\n\n\t\tvoid AddEscapedIdentifier (Location loc)\n\t\t{\n\t\t\tif (escaped_identifiers == null)\n\t\t\t\tescaped_identifiers = new List<Location> ();\n\n\t\t\tescaped_identifiers.Add (loc);\n\t\t}\n\n\t\tpublic bool IsEscapedIdentifier (ATypeNameExpression name)\n\t\t{\n\t\t\treturn escaped_identifiers != null && escaped_identifiers.Contains (name.Location);\n\t\t}\n\n\t\t//\n\t\t// Values for the associated token returned\n\t\t//\n\t\tinternal int putback_char; \t// Used by repl only\n\t\tobject val;\n\n\t\t//\n\t\t// Pre-processor\n\t\t//\n\t\tconst int TAKING        = 1;\n\t\tconst int ELSE_SEEN = 4;\n\t\tconst int PARENT_TAKING = 8;\n\t\tconst int REGION = 16;\t\t\n\n\t\t//\n\t\t// pre-processor if stack state:\n\t\t//\n\t\tStack<int> ifstack;\n\n\t\tpublic const int MaxIdentifierLength = 512;\n\t\tpublic const int MaxNumberLength = 512;\n\n\t\treadonly char[] id_builder;\n\t\treadonly Dictionary<char[], string>[] identifiers;\n\t\treadonly char[] number_builder;\n\t\tint number_pos;\n\n\t\tchar[] value_builder = new char[64];\n\n\t\tpublic int Line {\n\t\t\tget {\n\t\t\t\treturn ref_line;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tref_line = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Column {\n\t\t\tget {\n\t\t\t\treturn col;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tcol = value;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// This is used when the tokenizer needs to save\n\t\t// the current position as it needs to do some parsing\n\t\t// on its own to deamiguate a token in behalf of the\n\t\t// parser.\n\t\t//\n\t\tStack<Position> position_stack = new Stack<Position> (2);\n\n\t\tclass Position\n\t\t{\n\t\t\tpublic int position;\n\t\t\tpublic int line;\n\t\t\tpublic int ref_line;\n\t\t\tpublic int col;\n\t\t\tpublic Location hidden;\n\t\t\tpublic int putback_char;\n\t\t\tpublic int previous_col;\n\t\t\tpublic Stack<int> ifstack;\n\t\t\tpublic int parsing_generic_less_than;\n\t\t\tpublic int current_token;\n\t\t\tpublic object val;\n\n\t\t\tpublic Position (Tokenizer t)\n\t\t\t{\n\t\t\t\tposition = t.reader.Position;\n\t\t\t\tline = t.line;\n\t\t\t\tref_line = t.ref_line;\n\t\t\t\tcol = t.col;\n\t\t\t\thidden = t.hidden_block_start;\n\t\t\t\tputback_char = t.putback_char;\n\t\t\t\tprevious_col = t.previous_col;\n\t\t\t\tif (t.ifstack != null && t.ifstack.Count != 0) {\n\t\t\t\t\t// There is no simple way to clone Stack<T> all\n\t\t\t\t\t// methods reverse the order\n\t\t\t\t\tvar clone = t.ifstack.ToArray ();\n\t\t\t\t\tArray.Reverse (clone);\n\t\t\t\t\tifstack = new Stack<int> (clone);\n\t\t\t\t}\n\t\t\t\tparsing_generic_less_than = t.parsing_generic_less_than;\n\t\t\t\tcurrent_token = t.current_token;\n\t\t\t\tval = t.val;\n\t\t\t}\n\t\t}\n\n\t\tpublic Tokenizer (SeekableStreamReader input, CompilationSourceFile file, ParserSession session, Report report)\n\t\t{\n\t\t\tthis.source_file = file;\n\t\t\tthis.context = file.Compiler;\n\t\t\tthis.current_source = file.SourceFile;\n\t\t\tthis.identifiers = session.Identifiers;\n\t\t\tthis.id_builder = session.IDBuilder;\n\t\t\tthis.number_builder = session.NumberBuilder;\n\t\t\tthis.ltb = new LocatedTokenBuffer (session.LocatedTokens);\n\t\t\tthis.Report = report;\n\n\t\t\treader = input;\n\n\t\t\tputback_char = -1;\n\n\t\t\txml_comment_buffer = new StringBuilder ();\n\t\t\tdoc_processing = context.Settings.DocumentationFile != null;\n\n\t\t\ttab_size = context.Settings.TabSize;\n\t\t}\n\t\t\n\t\tpublic void PushPosition ()\n\t\t{\n\t\t\tposition_stack.Push (new Position (this));\n\t\t}\n\n\t\tpublic void PopPosition ()\n\t\t{\n\t\t\tPosition p = position_stack.Pop ();\n\n\t\t\treader.Position = p.position;\n\t\t\tref_line = p.ref_line;\n\t\t\tline = p.line;\n\t\t\tcol = p.col;\n\t\t\thidden_block_start = p.hidden;\n\t\t\tputback_char = p.putback_char;\n\t\t\tprevious_col = p.previous_col;\n\t\t\tifstack = p.ifstack;\n\t\t\tparsing_generic_less_than = p.parsing_generic_less_than;\n\t\t\tcurrent_token = p.current_token;\n\t\t\tval = p.val;\n\t\t}\n\n\t\t// Do not reset the position, ignore it.\n\t\tpublic void DiscardPosition ()\n\t\t{\n\t\t\tposition_stack.Pop ();\n\t}\n\t\t\n\t\tstatic void AddKeyword (string kw, int token)\n\t\t{\n\t\t\tkeyword_strings.Add (kw);\n\n\t\t\tAddKeyword (keywords, kw, token);\n}\n\n\t\tstatic void AddPreprocessorKeyword (string kw, PreprocessorDirective directive)\n\t\t{\n\t\t\tAddKeyword (keywords_preprocessor, kw, directive);\n\t\t}\n\n\t\tstatic void AddKeyword<T> (KeywordEntry<T>[][] keywords, string kw, T token)\n\t\t{\n\t\t\tint length = kw.Length;\n\t\t\tif (keywords[length] == null) {\n\t\t\t\tkeywords[length] = new KeywordEntry<T>['z' - '_' + 1];\n\t\t\t}\n\n\t\t\tint char_index = kw[0] - '_';\n\t\t\tvar kwe = keywords[length][char_index];\n\t\t\tif (kwe == null) {\n\t\t\t\tkeywords[length][char_index] = new KeywordEntry<T> (kw, token);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhile (kwe.Next != null) {\n\t\t\t\tkwe = kwe.Next;\n\t\t\t}\n\n\t\t\tkwe.Next = new KeywordEntry<T> (kw, token);\n\t\t}\n\n\t\t//\n\t\t// Class initializer\n\t\t// \n\t\tstatic Tokenizer ()\n\t\t{\n\t\t\tkeyword_strings = new HashSet<string> ();\n\n\t\t\t// 11 is the length of the longest keyword for now\n\t\t\tkeywords = new KeywordEntry<int>[11][];\n\n\t\t\tAddKeyword (\"__arglist\", Token.ARGLIST);\n\t\t\tAddKeyword (\"__makeref\", Token.MAKEREF);\n\t\t\tAddKeyword (\"__reftype\", Token.REFTYPE);\n\t\t\tAddKeyword (\"__refvalue\", Token.REFVALUE);\n\t\t\tAddKeyword (\"abstract\", Token.ABSTRACT);\n\t\t\tAddKeyword (\"as\", Token.AS);\n\t\t\tAddKeyword (\"add\", Token.ADD);\n\t\t\tAddKeyword (\"base\", Token.BASE);\n\t\t\tAddKeyword (\"bool\", Token.BOOL);\n\t\t\tAddKeyword (\"break\", Token.BREAK);\n\t\t\tAddKeyword (\"byte\", Token.BYTE);\n\t\t\tAddKeyword (\"case\", Token.CASE);\n\t\t\tAddKeyword (\"catch\", Token.CATCH);\n\t\t\tAddKeyword (\"char\", Token.CHAR);\n\t\t\tAddKeyword (\"checked\", Token.CHECKED);\n\t\t\tAddKeyword (\"class\", Token.CLASS);\n\t\t\tAddKeyword (\"const\", Token.CONST);\n\t\t\tAddKeyword (\"continue\", Token.CONTINUE);\n\t\t\tAddKeyword (\"decimal\", Token.DECIMAL);\n\t\t\tAddKeyword (\"default\", Token.DEFAULT);\n\t\t\tAddKeyword (\"delegate\", Token.DELEGATE);\n\t\t\tAddKeyword (\"do\", Token.DO);\n\t\t\tAddKeyword (\"double\", Token.DOUBLE);\n\t\t\tAddKeyword (\"else\", Token.ELSE);\n\t\t\tAddKeyword (\"enum\", Token.ENUM);\n\t\t\tAddKeyword (\"event\", Token.EVENT);\n\t\t\tAddKeyword (\"explicit\", Token.EXPLICIT);\n\t\t\tAddKeyword (\"extern\", Token.EXTERN);\n\t\t\tAddKeyword (\"false\", Token.FALSE);\n\t\t\tAddKeyword (\"finally\", Token.FINALLY);\n\t\t\tAddKeyword (\"fixed\", Token.FIXED);\n\t\t\tAddKeyword (\"float\", Token.FLOAT);\n\t\t\tAddKeyword (\"for\", Token.FOR);\n\t\t\tAddKeyword (\"foreach\", Token.FOREACH);\n\t\t\tAddKeyword (\"goto\", Token.GOTO);\n\t\t\tAddKeyword (\"get\", Token.GET);\n\t\t\tAddKeyword (\"if\", Token.IF);\n\t\t\tAddKeyword (\"implicit\", Token.IMPLICIT);\n\t\t\tAddKeyword (\"in\", Token.IN);\n\t\t\tAddKeyword (\"int\", Token.INT);\n\t\t\tAddKeyword (\"interface\", Token.INTERFACE);\n\t\t\tAddKeyword (\"internal\", Token.INTERNAL);\n\t\t\tAddKeyword (\"is\", Token.IS);\n\t\t\tAddKeyword (\"lock\", Token.LOCK);\n\t\t\tAddKeyword (\"long\", Token.LONG);\n\t\t\tAddKeyword (\"namespace\", Token.NAMESPACE);\n\t\t\tAddKeyword (\"new\", Token.NEW);\n\t\t\tAddKeyword (\"null\", Token.NULL);\n\t\t\tAddKeyword (\"object\", Token.OBJECT);\n\t\t\tAddKeyword (\"operator\", Token.OPERATOR);\n\t\t\tAddKeyword (\"out\", Token.OUT);\n\t\t\tAddKeyword (\"override\", Token.OVERRIDE);\n\t\t\tAddKeyword (\"params\", Token.PARAMS);\n\t\t\tAddKeyword (\"private\", Token.PRIVATE);\n\t\t\tAddKeyword (\"protected\", Token.PROTECTED);\n\t\t\tAddKeyword (\"public\", Token.PUBLIC);\n\t\t\tAddKeyword (\"readonly\", Token.READONLY);\n\t\t\tAddKeyword (\"ref\", Token.REF);\n\t\t\tAddKeyword (\"remove\", Token.REMOVE);\n\t\t\tAddKeyword (\"return\", Token.RETURN);\n\t\t\tAddKeyword (\"sbyte\", Token.SBYTE);\n\t\t\tAddKeyword (\"sealed\", Token.SEALED);\n\t\t\tAddKeyword (\"set\", Token.SET);\n\t\t\tAddKeyword (\"short\", Token.SHORT);\n\t\t\tAddKeyword (\"sizeof\", Token.SIZEOF);\n\t\t\tAddKeyword (\"stackalloc\", Token.STACKALLOC);\n\t\t\tAddKeyword (\"static\", Token.STATIC);\n\t\t\tAddKeyword (\"string\", Token.STRING);\n\t\t\tAddKeyword (\"struct\", Token.STRUCT);\n\t\t\tAddKeyword (\"switch\", Token.SWITCH);\n\t\t\tAddKeyword (\"this\", Token.THIS);\n\t\t\tAddKeyword (\"throw\", Token.THROW);\n\t\t\tAddKeyword (\"true\", Token.TRUE);\n\t\t\tAddKeyword (\"try\", Token.TRY);\n\t\t\tAddKeyword (\"typeof\", Token.TYPEOF);\n\t\t\tAddKeyword (\"uint\", Token.UINT);\n\t\t\tAddKeyword (\"ulong\", Token.ULONG);\n\t\t\tAddKeyword (\"unchecked\", Token.UNCHECKED);\n\t\t\tAddKeyword (\"unsafe\", Token.UNSAFE);\n\t\t\tAddKeyword (\"ushort\", Token.USHORT);\n\t\t\tAddKeyword (\"using\", Token.USING);\n\t\t\tAddKeyword (\"virtual\", Token.VIRTUAL);\n\t\t\tAddKeyword (\"void\", Token.VOID);\n\t\t\tAddKeyword (\"volatile\", Token.VOLATILE);\n\t\t\tAddKeyword (\"while\", Token.WHILE);\n\t\t\tAddKeyword (\"partial\", Token.PARTIAL);\n\t\t\tAddKeyword (\"where\", Token.WHERE);\n\n\t\t\t// LINQ keywords\n\t\t\tAddKeyword (\"from\", Token.FROM);\n\t\t\tAddKeyword (\"join\", Token.JOIN);\n\t\t\tAddKeyword (\"on\", Token.ON);\n\t\t\tAddKeyword (\"equals\", Token.EQUALS);\n\t\t\tAddKeyword (\"select\", Token.SELECT);\n\t\t\tAddKeyword (\"group\", Token.GROUP);\n\t\t\tAddKeyword (\"by\", Token.BY);\n\t\t\tAddKeyword (\"let\", Token.LET);\n\t\t\tAddKeyword (\"orderby\", Token.ORDERBY);\n\t\t\tAddKeyword (\"ascending\", Token.ASCENDING);\n\t\t\tAddKeyword (\"descending\", Token.DESCENDING);\n\t\t\tAddKeyword (\"into\", Token.INTO);\n\n\t\t\t// Contextual async keywords\n\t\t\tAddKeyword (\"async\", Token.ASYNC);\n\t\t\tAddKeyword (\"await\", Token.AWAIT);\n\n\t\t\tkeywords_preprocessor = new KeywordEntry<PreprocessorDirective>[10][];\n\n\t\t\tAddPreprocessorKeyword (\"region\", PreprocessorDirective.Region);\n\t\t\tAddPreprocessorKeyword (\"endregion\", PreprocessorDirective.Endregion);\n\t\t\tAddPreprocessorKeyword (\"if\", PreprocessorDirective.If);\n\t\t\tAddPreprocessorKeyword (\"endif\", PreprocessorDirective.Endif);\n\t\t\tAddPreprocessorKeyword (\"elif\", PreprocessorDirective.Elif);\n\t\t\tAddPreprocessorKeyword (\"else\", PreprocessorDirective.Else);\n\t\t\tAddPreprocessorKeyword (\"define\", PreprocessorDirective.Define);\n\t\t\tAddPreprocessorKeyword (\"undef\", PreprocessorDirective.Undef);\n\t\t\tAddPreprocessorKeyword (\"error\", PreprocessorDirective.Error);\n\t\t\tAddPreprocessorKeyword (\"warning\", PreprocessorDirective.Warning);\n\t\t\tAddPreprocessorKeyword (\"pragma\", PreprocessorDirective.Pragma);\n\t\t\tAddPreprocessorKeyword (\"line\", PreprocessorDirective.Line);\n\n\t\t\tcsharp_format_info = NumberFormatInfo.InvariantInfo;\n\t\t\tstyles = NumberStyles.Float;\n\t\t}\n\n\t\tint GetKeyword (char[] id, int id_len)\n\t\t{\n\t\t\t//\n\t\t\t// Keywords are stored in an array of arrays grouped by their\n\t\t\t// length and then by the first character\n\t\t\t//\n\t\t\tif (id_len >= keywords.Length || keywords [id_len] == null)\n\t\t\t\treturn -1;\n\n\t\t\tint first_index = id [0] - '_';\n\t\t\tif (first_index > 'z' - '_')\n\t\t\t\treturn -1;\n\n\t\t\tvar kwe = keywords [id_len] [first_index];\n\t\t\tif (kwe == null)\n\t\t\t\treturn -1;\n\n\t\t\tint res;\n\t\t\tdo {\n\t\t\t\tres = kwe.Token;\n\t\t\t\tfor (int i = 1; i < id_len; ++i) {\n\t\t\t\t\tif (id [i] != kwe.Value [i]) {\n\t\t\t\t\t\tres = 0;\n\t\t\t\t\t\tkwe = kwe.Next;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (res == 0 && kwe != null);\n\n\t\t\tif (res == 0)\n\t\t\t\treturn -1;\n\n\t\t\tint next_token;\n\t\t\tswitch (res) {\n\t\t\tcase Token.GET:\n\t\t\tcase Token.SET:\n\t\t\t\tif (!handle_get_set)\n\t\t\t\t\tres = -1;\n\t\t\t\tbreak;\n\t\t\tcase Token.REMOVE:\n\t\t\tcase Token.ADD:\n\t\t\t\tif (!handle_remove_add)\n\t\t\t\t\tres = -1;\n\t\t\t\tbreak;\n\t\t\tcase Token.EXTERN:\n\t\t\t\tif (parsing_declaration == 0)\n\t\t\t\t\tres = Token.EXTERN_ALIAS;\n\t\t\t\tbreak;\n\t\t\tcase Token.DEFAULT:\n\t\t\t\tif (peek_token () == Token.COLON) {\n\t\t\t\t\ttoken ();\n\t\t\t\t\tres = Token.DEFAULT_COLON;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase Token.WHERE:\n\t\t\t\tif (!(handle_where && current_token != Token.COLON) && !query_parsing)\n\t\t\t\t\tres = -1;\n\t\t\t\tbreak;\n\t\t\tcase Token.FROM:\n\t\t\t\t//\n\t\t\t\t// A query expression is any expression that starts with `from identifier'\n\t\t\t\t// followed by any token except ; , =\n\t\t\t\t// \n\t\t\t\tif (!query_parsing) {\n\t\t\t\t\tif (lambda_arguments_parsing || parsing_block == 0) {\n\t\t\t\t\t\tres = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tPushPosition ();\n\t\t\t\t\t// HACK: to disable generics micro-parser, because PushPosition does not\n\t\t\t\t\t// store identifiers array\n\t\t\t\t\tparsing_generic_less_than = 1;\n\t\t\t\t\tswitch (xtoken ()) {\n\t\t\t\t\tcase Token.IDENTIFIER:\n\t\t\t\t\tcase Token.INT:\n\t\t\t\t\tcase Token.BOOL:\n\t\t\t\t\tcase Token.BYTE:\n\t\t\t\t\tcase Token.CHAR:\n\t\t\t\t\tcase Token.DECIMAL:\n\t\t\t\t\tcase Token.DOUBLE:\n\t\t\t\t\tcase Token.FLOAT:\n\t\t\t\t\tcase Token.LONG:\n\t\t\t\t\tcase Token.OBJECT:\n\t\t\t\t\tcase Token.STRING:\n\t\t\t\t\tcase Token.UINT:\n\t\t\t\t\tcase Token.ULONG:\n\t\t\t\t\t\tnext_token = xtoken ();\n\t\t\t\t\t\tif (next_token == Token.SEMICOLON || next_token == Token.COMMA || next_token == Token.EQUALS || next_token == Token.ASSIGN)\n\t\t\t\t\t\t\tgoto default;\n\t\t\t\t\t\t\n\t\t\t\t\t\tres = Token.FROM_FIRST;\n\t\t\t\t\t\tquery_parsing = true;\n\t\t\t\t\t\tif (context.Settings.Version <= LanguageVersion.ISO_2)\n\t\t\t\t\t\t\tReport.FeatureIsNotAvailable (context, Location, \"query expressions\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Token.VOID:\n\t\t\t\t\t\tExpression.Error_VoidInvalidInTheContext (Location, Report);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t\t// HACK: A token is not a keyword so we need to restore identifiers buffer\n\t\t\t\t\t\t// which has been overwritten before we grabbed the identifier\n\t\t\t\t\t\tid_builder [0] = 'f'; id_builder [1] = 'r'; id_builder [2] = 'o'; id_builder [3] = 'm';\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\tPopPosition ();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase Token.JOIN:\n\t\t\tcase Token.ON:\n\t\t\tcase Token.EQUALS:\n\t\t\tcase Token.SELECT:\n\t\t\tcase Token.GROUP:\n\t\t\tcase Token.BY:\n\t\t\tcase Token.LET:\n\t\t\tcase Token.ORDERBY:\n\t\t\tcase Token.ASCENDING:\n\t\t\tcase Token.DESCENDING:\n\t\t\tcase Token.INTO:\n\t\t\t\tif (!query_parsing)\n\t\t\t\t\tres = -1;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Token.USING:\n\t\t\tcase Token.NAMESPACE:\n\t\t\t\t// TODO: some explanation needed\n\t\t\t\tcheck_incorrect_doc_comment ();\n\t\t\t\tparsing_modifiers = false;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Token.PARTIAL:\n\t\t\t\tif (parsing_block > 0) {\n\t\t\t\t\tres = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Save current position and parse next token.\n\t\t\t\tPushPosition ();\n\n\t\t\t\tnext_token = token ();\n\t\t\t\tbool ok = (next_token == Token.CLASS) ||\n\t\t\t\t\t(next_token == Token.STRUCT) ||\n\t\t\t\t\t(next_token == Token.INTERFACE) ||\n\t\t\t\t\t(next_token == Token.VOID);\n\n\t\t\t\tPopPosition ();\n\n\t\t\t\tif (ok) {\n\t\t\t\t\tif (next_token == Token.VOID) {\n\t\t\t\t\t\tif (context.Settings.Version <= LanguageVersion.ISO_2)\n\t\t\t\t\t\t\tReport.FeatureIsNotAvailable (context, Location, \"partial methods\");\n\t\t\t\t\t} else if (context.Settings.Version == LanguageVersion.ISO_1)\n\t\t\t\t\t\tReport.FeatureIsNotAvailable (context, Location, \"partial types\");\n\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\n\t\t\t\tif (next_token < Token.LAST_KEYWORD) {\n\t\t\t\t\tReport.Error (267, Location,\n\t\t\t\t\t\t\"The `partial' modifier can be used only immediately before `class', `struct', `interface', or `void' keyword\");\n\t\t\t\t\treturn token ();\n\t\t\t\t}\n\n\t\t\t\t// HACK: A token is not a keyword so we need to restore identifiers buffer\n\t\t\t\t// which has been overwritten before we grabbed the identifier\n\t\t\t\tid_builder[0] = 'p';\n\t\t\t\tid_builder[1] = 'a';\n\t\t\t\tid_builder[2] = 'r';\n\t\t\t\tid_builder[3] = 't';\n\t\t\t\tid_builder[4] = 'i';\n\t\t\t\tid_builder[5] = 'a';\n\t\t\t\tid_builder[6] = 'l';\n\t\t\t\tres = -1;\n\t\t\t\tbreak;\n\n\t\t\tcase Token.ASYNC:\n\t\t\t\tif (parsing_modifiers) {\n\t\t\t\t\t//\n\t\t\t\t\t// Skip attributes section or constructor called async\n\t\t\t\t\t//\n\t\t\t\t\tif (parsing_attribute_section || peek_token () == Token.OPEN_PARENS) {\n\t\t\t\t\t\tres = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// async is keyword\n\t\t\t\t\t}\n\t\t\t\t} else if (parsing_block > 0) {\n\t\t\t\t\tswitch (peek_token ()) {\n\t\t\t\t\tcase Token.DELEGATE:\n\t\t\t\t\tcase Token.OPEN_PARENS_LAMBDA:\n\t\t\t\t\t\t// async is keyword\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Token.IDENTIFIER:\n\t\t\t\t\t\tPushPosition ();\n\t\t\t\t\t\txtoken ();\n\t\t\t\t\t\tif (xtoken () != Token.ARROW) {\n\t\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t\t\tgoto default;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// peek_token could overwrite id_buffer\n\t\t\t\t\t\tid_builder [0] = 'a'; id_builder [1] = 's'; id_builder [2] = 'y'; id_builder [3] = 'n'; id_builder [4] = 'c';\n\t\t\t\t\t\tres = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tres = -1;\n\t\t\t\t}\n\n\t\t\t\tif (res == Token.ASYNC && context.Settings.Version <= LanguageVersion.V_4) {\n\t\t\t\t\tReport.FeatureIsNotAvailable (context, Location, \"asynchronous functions\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\n\t\t\tcase Token.AWAIT:\n\t\t\t\tif (parsing_block == 0)\n\t\t\t\t\tres = -1;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tstatic PreprocessorDirective GetPreprocessorDirective (char[] id, int id_len)\n\t\t{\n\t\t\t//\n\t\t\t// Keywords are stored in an array of arrays grouped by their\n\t\t\t// length and then by the first character\n\t\t\t//\n\t\t\tif (id_len >= keywords_preprocessor.Length || keywords_preprocessor[id_len] == null)\n\t\t\t\treturn PreprocessorDirective.Invalid;\n\n\t\t\tint first_index = id[0] - '_';\n\t\t\tif (first_index > 'z' - '_')\n\t\t\t\treturn PreprocessorDirective.Invalid;\n\n\t\t\tvar kwe = keywords_preprocessor[id_len][first_index];\n\t\t\tif (kwe == null)\n\t\t\t\treturn PreprocessorDirective.Invalid;\n\n\t\t\tPreprocessorDirective res = PreprocessorDirective.Invalid;\n\t\t\tdo {\n\t\t\t\tres = kwe.Token;\n\t\t\t\tfor (int i = 1; i < id_len; ++i) {\n\t\t\t\t\tif (id[i] != kwe.Value[i]) {\n\t\t\t\t\t\tres = 0;\n\t\t\t\t\t\tkwe = kwe.Next;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (res == PreprocessorDirective.Invalid && kwe != null);\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget {\n\t\t\t\treturn new Location (current_source, ref_line, col);\n\t\t\t}\n\t\t}\n\n\t\tstatic bool is_identifier_start_character (int c)\n\t\t{\n\t\t\treturn (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || Char.IsLetter ((char)c);\n\t\t}\n\n\t\tstatic bool is_identifier_part_character (char c)\n\t\t{\n\t\t\tif (c >= 'a' && c <= 'z')\n\t\t\t\treturn true;\n\n\t\t\tif (c >= 'A' && c <= 'Z')\n\t\t\t\treturn true;\n\n\t\t\tif (c == '_' || (c >= '0' && c <= '9'))\n\t\t\t\treturn true;\n\n\t\t\tif (c < 0x80)\n\t\t\t\treturn false;\n\n\t\t\treturn is_identifier_part_character_slow_part (c);\n\t\t}\n\n\t\tstatic bool is_identifier_part_character_slow_part (char c)\n\t\t{\n\t\t\tif (Char.IsLetter (c))\n\t\t\t\treturn true;\n\n\t\t\tswitch (Char.GetUnicodeCategory (c)) {\n\t\t\t\tcase UnicodeCategory.ConnectorPunctuation:\n\n\t\t\t\t// combining-character: A Unicode character of classes Mn or Mc\n\t\t\t\tcase UnicodeCategory.NonSpacingMark:\n\t\t\t\tcase UnicodeCategory.SpacingCombiningMark:\n\n\t\t\t\t// decimal-digit-character: A Unicode character of the class Nd \n\t\t\t\tcase UnicodeCategory.DecimalDigitNumber:\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool IsKeyword (string s)\n\t\t{\n\t\t\treturn keyword_strings.Contains (s);\n\t\t}\n\n\t\t//\n\t\t// Open parens micro parser. Detects both lambda and cast ambiguity.\n\t\t//\t\n\t\tint TokenizeOpenParens ()\n\t\t{\n\t\t\tint ptoken;\n\t\t\tcurrent_token = -1;\n\n\t\t\tint bracket_level = 0;\n\t\t\tbool is_type = false;\n\t\t\tbool can_be_type = false;\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\tptoken = current_token;\n\t\t\t\ttoken ();\n\n\t\t\t\tswitch (current_token) {\n\t\t\t\tcase Token.CLOSE_PARENS:\n\t\t\t\t\ttoken ();\n\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t// Expression inside parens is lambda, (int i) => \n\t\t\t\t\t//\n\t\t\t\t\tif (current_token == Token.ARROW)\n\t\t\t\t\t\treturn Token.OPEN_PARENS_LAMBDA;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Expression inside parens is single type, (int[])\n\t\t\t\t\t//\n\t\t\t\t\tif (is_type) {\n\t\t\t\t\t\tif (current_token == Token.SEMICOLON)\n\t\t\t\t\t\t\treturn Token.OPEN_PARENS;\n\n\t\t\t\t\t\treturn Token.OPEN_PARENS_CAST;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Expression is possible cast, look at next token, (T)null\n\t\t\t\t\t//\n\t\t\t\t\tif (can_be_type) {\n\t\t\t\t\t\tswitch (current_token) {\n\t\t\t\t\t\tcase Token.OPEN_PARENS:\n\t\t\t\t\t\tcase Token.BANG:\n\t\t\t\t\t\tcase Token.TILDE:\n\t\t\t\t\t\tcase Token.IDENTIFIER:\n\t\t\t\t\t\tcase Token.LITERAL:\n\t\t\t\t\t\tcase Token.BASE:\n\t\t\t\t\t\tcase Token.CHECKED:\n\t\t\t\t\t\tcase Token.DELEGATE:\n\t\t\t\t\t\tcase Token.FALSE:\n\t\t\t\t\t\tcase Token.FIXED:\n\t\t\t\t\t\tcase Token.NEW:\n\t\t\t\t\t\tcase Token.NULL:\n\t\t\t\t\t\tcase Token.SIZEOF:\n\t\t\t\t\t\tcase Token.THIS:\n\t\t\t\t\t\tcase Token.THROW:\n\t\t\t\t\t\tcase Token.TRUE:\n\t\t\t\t\t\tcase Token.TYPEOF:\n\t\t\t\t\t\tcase Token.UNCHECKED:\n\t\t\t\t\t\tcase Token.UNSAFE:\n\t\t\t\t\t\tcase Token.DEFAULT:\n\t\t\t\t\t\tcase Token.AWAIT:\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// These can be part of a member access\n\t\t\t\t\t\t//\n\t\t\t\t\t\tcase Token.INT:\n\t\t\t\t\t\tcase Token.UINT:\n\t\t\t\t\t\tcase Token.SHORT:\n\t\t\t\t\t\tcase Token.USHORT:\n\t\t\t\t\t\tcase Token.LONG:\n\t\t\t\t\t\tcase Token.ULONG:\n\t\t\t\t\t\tcase Token.DOUBLE:\n\t\t\t\t\t\tcase Token.FLOAT:\n\t\t\t\t\t\tcase Token.CHAR:\n\t\t\t\t\t\tcase Token.BYTE:\n\t\t\t\t\t\tcase Token.DECIMAL:\n\t\t\t\t\t\tcase Token.BOOL:\n\t\t\t\t\t\t\treturn Token.OPEN_PARENS_CAST;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.OPEN_PARENS;\n\t\t\t\t\t\n\t\t\t\tcase Token.DOT:\n\t\t\t\tcase Token.DOUBLE_COLON:\n\t\t\t\t\tif (ptoken != Token.IDENTIFIER && ptoken != Token.OP_GENERICS_GT)\n\t\t\t\t\t\tgoto default;\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase Token.IDENTIFIER:\n\t\t\t\tcase Token.AWAIT:\n\t\t\t\t\tswitch (ptoken) {\n\t\t\t\t\tcase Token.DOT:\n\t\t\t\t\t\tif (bracket_level == 0) {\n\t\t\t\t\t\t\tis_type = false;\n\t\t\t\t\t\t\tcan_be_type = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase Token.OP_GENERICS_LT:\n\t\t\t\t\tcase Token.COMMA:\n\t\t\t\t\tcase Token.DOUBLE_COLON:\n\t\t\t\t\tcase -1:\n\t\t\t\t\t\tif (bracket_level == 0)\n\t\t\t\t\t\t\tcan_be_type = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcan_be_type = is_type = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\tcase Token.OBJECT:\n\t\t\t\tcase Token.STRING:\n\t\t\t\tcase Token.BOOL:\n\t\t\t\tcase Token.DECIMAL:\n\t\t\t\tcase Token.FLOAT:\n\t\t\t\tcase Token.DOUBLE:\n\t\t\t\tcase Token.SBYTE:\n\t\t\t\tcase Token.BYTE:\n\t\t\t\tcase Token.SHORT:\n\t\t\t\tcase Token.USHORT:\n\t\t\t\tcase Token.INT:\n\t\t\t\tcase Token.UINT:\n\t\t\t\tcase Token.LONG:\n\t\t\t\tcase Token.ULONG:\n\t\t\t\tcase Token.CHAR:\n\t\t\t\tcase Token.VOID:\n\t\t\t\t\tif (bracket_level == 0)\n\t\t\t\t\t\tis_type = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase Token.COMMA:\n\t\t\t\t\tif (bracket_level == 0) {\n\t\t\t\t\t\tbracket_level = 100;\n\t\t\t\t\t\tcan_be_type = is_type = false;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase Token.OP_GENERICS_LT:\n\t\t\t\tcase Token.OPEN_BRACKET:\n\t\t\t\t\tif (bracket_level++ == 0)\n\t\t\t\t\t\tis_type = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase Token.OP_GENERICS_GT:\n\t\t\t\tcase Token.CLOSE_BRACKET:\n\t\t\t\t\t--bracket_level;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase Token.INTERR_NULLABLE:\n\t\t\t\tcase Token.STAR:\n\t\t\t\t\tif (bracket_level == 0)\n\t\t\t\t\t\tis_type = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase Token.REF:\n\t\t\t\tcase Token.OUT:\n\t\t\t\t\tcan_be_type = is_type = false;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Token.OPEN_PARENS;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool IsValidIdentifier (string s)\n\t\t{\n\t\t\tif (s == null || s.Length == 0)\n\t\t\t\treturn false;\n\n\t\t\tif (!is_identifier_start_character (s [0]))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tfor (int i = 1; i < s.Length; i ++)\n\t\t\t\tif (! is_identifier_part_character (s [i]))\n\t\t\t\t\treturn false;\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\n\t\tStack<List<Location>> genericDimensionLocations = new Stack<List<Location>> ();\n\n\t\tpublic List<Location> GenericDimensionLocations {\n\t\t\tget {\n\t\t\t\tif (genericDimensionLocations.Count == 0)\n\t\t\t\t\treturn null;\n\t\t\t\treturn genericDimensionLocations.Pop ();\n\t\t\t}\n\t\t}\n\n\t\tbool parse_less_than (ref int genericDimension)\n\t\t{\n\t\t\tgenericDimensionLocations.Push (new List<Location> ()); \n\t\t\tgenericDimensionLocations.Peek ().Add (Location);\n\t\t\tstart:\n\t\t\tint the_token = token ();\n\t\t\tif (the_token == Token.OPEN_BRACKET) {\n\t\t\t\twhile (true) {\n\t\t\t\t\tthe_token = token ();\n\t\t\t\t\tif (the_token == Token.EOF)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tif (the_token == Token.CLOSE_BRACKET)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthe_token = token ();\n\t\t\t} else if (the_token == Token.IN || the_token == Token.OUT) {\n\t\t\t\tthe_token = token ();\n\t\t\t}\n\t\t\tswitch (the_token) {\n\t\t\tcase Token.IDENTIFIER:\n\t\t\tcase Token.OBJECT:\n\t\t\tcase Token.STRING:\n\t\t\tcase Token.BOOL:\n\t\t\tcase Token.DECIMAL:\n\t\t\tcase Token.FLOAT:\n\t\t\tcase Token.DOUBLE:\n\t\t\tcase Token.SBYTE:\n\t\t\tcase Token.BYTE:\n\t\t\tcase Token.SHORT:\n\t\t\tcase Token.USHORT:\n\t\t\tcase Token.INT:\n\t\t\tcase Token.UINT:\n\t\t\tcase Token.LONG:\n\t\t\tcase Token.ULONG:\n\t\t\tcase Token.CHAR:\n\t\t\tcase Token.VOID:\n\t\t\t\tbreak;\n\t\t\tcase Token.OP_GENERICS_GT:\n\t\t\t\tgenericDimension = 1;\n\t\t\t\tgenericDimensionLocations.Peek ().Add (Location);\n\t\t\t\treturn true;\n\t\t\tcase Token.IN:\n\t\t\tcase Token.OUT:\n\t\t\t\tgenericDimensionLocations.Pop ();\n\t\t\t\treturn true;\n\t\t\tcase Token.COMMA:\n\t\t\t\tdo {\n\t\t\t\t\t++genericDimension;\n\t\t\t\t\tif (genericDimensionLocations.Count > 0)\n\t\t\t\t\t\tgenericDimensionLocations.Peek ().Add (Location);\n\t\t\t\t\tthe_token = token ();\n\t\t\t\t} while (the_token == Token.COMMA);\n\n\t\t\t\tif (the_token == Token.OP_GENERICS_GT) {\n\t\t\t\t\t++genericDimension;\n\t\t\t\t\tif (genericDimensionLocations.Count > 0)\n\t\t\t\t\t\tgenericDimensionLocations.Peek ().Add (Location);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tgenericDimensionLocations.Pop ();\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t\t\tgenericDimensionLocations.Pop ();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tagain:\n\t\t\tthe_token = token ();\n\t\t\tif (the_token == Token.OP_GENERICS_GT) {\n\t\t\t\tgenericDimensionLocations.Peek ().Add (Location);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if (the_token == Token.COMMA || the_token == Token.DOT || the_token == Token.DOUBLE_COLON)\n\t\t\t\tgoto start;\n\t\t\telse if (the_token == Token.INTERR_NULLABLE || the_token == Token.STAR)\n\t\t\t\tgoto again;\n\t\t\telse if (the_token == Token.OP_GENERICS_LT) {\n\t\t\t\tif (!parse_less_than (ref genericDimension)) {\n\t\t\t\t\tgenericDimensionLocations.Pop ();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tgoto again;\n\t\t\t} else if (the_token == Token.OPEN_BRACKET) {\n\t\t\t\trank_specifiers:\n\t\t\t\tthe_token = token ();\n\t\t\t\tif (the_token == Token.CLOSE_BRACKET)\n\t\t\t\t\tgoto again;\n\t\t\t\telse if (the_token == Token.COMMA)\n\t\t\t\t\tgoto rank_specifiers;\n\t\t\t\tgenericDimensionLocations.Pop ();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tgenericDimensionLocations.Pop ();\n\t\t\treturn false;\n\t\t}\n\n\n\t\tpublic int peek_token ()\n\t\t{\n\t\t\tint the_token;\n\n\t\t\tPushPosition ();\n\t\t\tsbag.Suppress = true;\n\t\t\tthe_token = token ();\n\t\t\tsbag.Suppress = false;\n\t\t\tPopPosition ();\n\t\t\t\n\t\t\treturn the_token;\n\t\t}\n\t\t\t\t\t\n\t\t//\n\t\t// Tonizes `?' using custom disambiguous rules to return one\n\t\t// of following tokens: INTERR_NULLABLE, OP_COALESCING, INTERR\n\t\t//\n\t\t// Tricky expression looks like:\n\t\t//\n\t\t// Foo ? a = x ? b : c;\n\t\t//\n\t\tint TokenizePossibleNullableType ()\n\t\t{\n\t\t\tif (parsing_block == 0 || parsing_type > 0)\n\t\t\t\treturn Token.INTERR_NULLABLE;\n\n\t\t\tint d = peek_char ();\n\t\t\tif (d == '?') {\n\t\t\t\tget_char ();\n\t\t\t\treturn Token.OP_COALESCING;\n\t\t\t}\n\n\t\t\tif (d == '.') {\n\t\t\t\treturn Token.INTERR_OPERATOR;\n\t\t\t}\n\n\t\t\tif (d != ' ') {\n\t\t\t\tif (d == ',' || d == ';' || d == '>')\n\t\t\t\t\treturn Token.INTERR_NULLABLE;\n\t\t\t\tif (d == '*' || (d >= '0' && d <= '9'))\n\t\t\t\t\treturn Token.INTERR;\n\t\t\t}\n\n\t\t\tPushPosition ();\n\t\t\tcurrent_token = Token.NONE;\n\t\t\tint next_token;\n\t\t\tint parens = 0;\n\t\t\tint generics = 0;\n\n\t\t\tvar nt = xtoken ();\n\t\t\tswitch (nt) {\n\t\t\tcase Token.DOT:\n\t\t\tcase Token.OPEN_BRACKET_EXPR:\n\t\t\t\tnext_token = Token.INTERR_OPERATOR;\n\t\t\t\tbreak;\n\t\t\tcase Token.LITERAL:\n\t\t\tcase Token.TRUE:\n\t\t\tcase Token.FALSE:\n\t\t\tcase Token.NULL:\n\t\t\tcase Token.THIS:\n\t\t\tcase Token.NEW:\n\t\t\t\tnext_token = Token.INTERR;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Token.SEMICOLON:\n\t\t\tcase Token.COMMA:\n\t\t\tcase Token.CLOSE_PARENS:\n\t\t\tcase Token.OPEN_BRACKET:\n\t\t\tcase Token.OP_GENERICS_GT:\n\t\t\tcase Token.INTERR:\n\t\t\tcase Token.OP_COALESCING:\n\t\t\tcase Token.COLON:\n\t\t\t\tnext_token = Token.INTERR_NULLABLE;\n\t\t\t\tbreak;\n\n\t\t\tcase Token.OPEN_PARENS:\n\t\t\tcase Token.OPEN_PARENS_CAST:\n\t\t\tcase Token.OPEN_PARENS_LAMBDA:\n\t\t\t\tnext_token = -1;\n\t\t\t\t++parens;\n\t\t\t\tbreak;\n\n\t\t\tcase Token.OP_GENERICS_LT:\n\t\t\tcase Token.OP_GENERICS_LT_DECL:\n\t\t\tcase Token.GENERIC_DIMENSION:\n\t\t\t\tnext_token = -1;\n\t\t\t\t++generics;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tnext_token = -1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (next_token == -1) {\n\t\t\t\tswitch (xtoken ()) {\n\t\t\t\tcase Token.COMMA:\n\t\t\t\tcase Token.SEMICOLON:\n\t\t\t\tcase Token.OPEN_BRACE:\n\t\t\t\tcase Token.IN:\n\t\t\t\t\tnext_token = Token.INTERR_NULLABLE;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase Token.COLON:\n\t\t\t\t\tnext_token = Token.INTERR;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Token.OPEN_PARENS:\n\t\t\t\tcase Token.OPEN_PARENS_CAST:\n\t\t\t\tcase Token.OPEN_PARENS_LAMBDA:\n\t\t\t\t\t++parens;\n\t\t\t\t\tgoto default;\n\n\t\t\t\tcase Token.CLOSE_PARENS:\n\t\t\t\t\t--parens;\n\t\t\t\t\tgoto default;\n\n\t\t\t\tcase Token.OP_GENERICS_LT:\n\t\t\t\tcase Token.OP_GENERICS_LT_DECL:\n\t\t\t\tcase Token.GENERIC_DIMENSION:\n\t\t\t\t\t++generics;\n\t\t\t\t\tgoto default;\n\n\t\t\t\tdefault:\n\t\t\t\t\tint ntoken;\n\t\t\t\t\tint interrs = 1;\n\t\t\t\t\tint colons = 0;\n\t\t\t\t\tint braces = 0;\n\t\t\t\t\tint brackets = 0;\n\t\t\t\t\t//\n\t\t\t\t\t// All shorcuts failed, do it hard way\n\t\t\t\t\t//\n\t\t\t\t\twhile ((ntoken = xtoken ()) != Token.EOF) {\n\t\t\t\t\t\tswitch (ntoken) {\n\t\t\t\t\t\tcase Token.OPEN_BRACE:\n\t\t\t\t\t\t\t++braces;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase Token.OPEN_PARENS:\n\t\t\t\t\t\tcase Token.OPEN_PARENS_CAST:\n\t\t\t\t\t\tcase Token.OPEN_PARENS_LAMBDA:\n\t\t\t\t\t\t\t++parens;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase Token.CLOSE_BRACE:\n\t\t\t\t\t\t\t--braces;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase Token.OP_GENERICS_LT:\n\t\t\t\t\t\tcase Token.OP_GENERICS_LT_DECL:\n\t\t\t\t\t\tcase Token.GENERIC_DIMENSION:\n\t\t\t\t\t\t\t++generics;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase Token.OPEN_BRACKET:\n\t\t\t\t\t\tcase Token.OPEN_BRACKET_EXPR:\n\t\t\t\t\t\t\t++brackets;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase Token.CLOSE_BRACKET:\n\t\t\t\t\t\t\t--brackets;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase Token.CLOSE_PARENS:\n\t\t\t\t\t\t\tif (parens > 0) {\n\t\t\t\t\t\t\t\t--parens;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t\t\treturn Token.INTERR_NULLABLE;\n\n\t\t\t\t\t\tcase Token.OP_GENERICS_GT:\n\t\t\t\t\t\t\tif (generics > 0) {\n\t\t\t\t\t\t\t\t--generics;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t\t\treturn Token.INTERR_NULLABLE;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (braces != 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (ntoken == Token.SEMICOLON)\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tif (parens != 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (ntoken == Token.COMMA) {\n\t\t\t\t\t\t\tif (generics != 0 || brackets != 0)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t\t\treturn Token.INTERR_NULLABLE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ntoken == Token.COLON) {\n\t\t\t\t\t\t\tif (++colons == interrs)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ntoken == Token.INTERR) {\n\t\t\t\t\t\t\t++interrs;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tnext_token = colons != interrs && braces == 0 ? Token.INTERR_NULLABLE : Token.INTERR;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tPopPosition ();\n\t\t\treturn next_token;\n\t\t}\n\n\t\tbool decimal_digits (int c)\n\t\t{\n\t\t\tint d;\n\t\t\tbool seen_digits = false;\n\t\t\t\n\t\t\tif (c != -1){\n\t\t\t\tif (number_pos == MaxNumberLength)\n\t\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\tnumber_builder [number_pos++] = (char) c;\n\t\t\t}\n\t\t\t\n\t\t\t//\n\t\t\t// We use peek_char2, because decimal_digits needs to do a \n\t\t\t// 2-character look-ahead (5.ToString for example).\n\t\t\t//\n\t\t\twhile ((d = peek_char2 ()) != -1){\n\t\t\t\tif (d >= '0' && d <= '9'){\n\t\t\t\t\tif (number_pos == MaxNumberLength)\n\t\t\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\t\tnumber_builder [number_pos++] = (char) d;\n\t\t\t\t\tget_char ();\n\t\t\t\t\tseen_digits = true;\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\treturn seen_digits;\n\t\t}\n\n\t\tstatic bool is_hex (int e)\n\t\t{\n\t\t\treturn (e >= '0' && e <= '9') || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');\n\t\t}\n\n\t\tstatic TypeCode real_type_suffix (int c)\n\t\t{\n\t\t\tswitch (c){\n\t\t\tcase 'F': case 'f':\n\t\t\t\treturn TypeCode.Single;\n\t\t\tcase 'D': case 'd':\n\t\t\t\treturn TypeCode.Double;\n\t\t\tcase 'M': case 'm':\n\t\t\t\treturn TypeCode.Decimal;\n\t\t\tdefault:\n\t\t\t\treturn TypeCode.Empty;\n\t\t\t}\n\t\t}\n\n\t\tILiteralConstant integer_type_suffix (ulong ul, int c, Location loc)\n\t\t{\n\t\t\tbool is_unsigned = false;\n\t\t\tbool is_long = false;\n\n\t\t\tif (c != -1){\n\t\t\t\tbool scanning = true;\n\t\t\t\tdo {\n\t\t\t\t\tswitch (c){\n\t\t\t\t\tcase 'U': case 'u':\n\t\t\t\t\t\tif (is_unsigned)\n\t\t\t\t\t\t\tscanning = false;\n\t\t\t\t\t\tis_unsigned = true;\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'l':\n\t\t\t\t\t\tif (!is_unsigned){\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// if we have not seen anything in between\n\t\t\t\t\t\t\t// report this error\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tReport.Warning (78, 4, Location, \"The `l' suffix is easily confused with the digit `1' (use `L' for clarity)\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgoto case 'L';\n\n\t\t\t\t\tcase 'L': \n\t\t\t\t\t\tif (is_long)\n\t\t\t\t\t\t\tscanning = false;\n\t\t\t\t\t\tis_long = true;\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tscanning = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tc = peek_char ();\n\t\t\t\t} while (scanning);\n\t\t\t}\n\n\t\t\tif (is_long && is_unsigned){\n\t\t\t\treturn new ULongLiteral (context.BuiltinTypes, ul, loc);\n\t\t\t}\n\t\t\t\n\t\t\tif (is_unsigned){\n\t\t\t\t// uint if possible, or ulong else.\n\n\t\t\t\tif ((ul & 0xffffffff00000000) == 0)\n\t\t\t\t\treturn new UIntLiteral (context.BuiltinTypes, (uint) ul, loc);\n\t\t\t\telse\n\t\t\t\t\treturn new ULongLiteral (context.BuiltinTypes, ul, loc);\n\t\t\t} else if (is_long){\n\t\t\t\t// long if possible, ulong otherwise\n\t\t\t\tif ((ul & 0x8000000000000000) != 0)\n\t\t\t\t\treturn new ULongLiteral (context.BuiltinTypes, ul, loc);\n\t\t\t\telse\n\t\t\t\t\treturn new LongLiteral (context.BuiltinTypes, (long) ul, loc);\n\t\t\t} else {\n\t\t\t\t// int, uint, long or ulong in that order\n\t\t\t\tif ((ul & 0xffffffff00000000) == 0){\n\t\t\t\t\tuint ui = (uint) ul;\n\t\t\t\t\t\n\t\t\t\t\tif ((ui & 0x80000000) != 0)\n\t\t\t\t\t\treturn new UIntLiteral (context.BuiltinTypes, ui, loc);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn new IntLiteral (context.BuiltinTypes, (int) ui, loc);\n\t\t\t\t} else {\n\t\t\t\t\tif ((ul & 0x8000000000000000) != 0)\n\t\t\t\t\t\treturn new ULongLiteral (context.BuiltinTypes, ul, loc);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn new LongLiteral (context.BuiltinTypes, (long) ul, loc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//\n\t\t// given `c' as the next char in the input decide whether\n\t\t// we need to convert to a special type, and then choose\n\t\t// the best representation for the integer\n\t\t//\n\t\tILiteralConstant adjust_int (int c, Location loc)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (number_pos > 9){\n\t\t\t\t\tulong ul = (uint) (number_builder [0] - '0');\n\n\t\t\t\t\tfor (int i = 1; i < number_pos; i++){\n\t\t\t\t\t\tul = checked ((ul * 10) + ((uint)(number_builder [i] - '0')));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn integer_type_suffix (ul, c, loc);\n\t\t\t\t} else {\n\t\t\t\t\tuint ui = (uint) (number_builder [0] - '0');\n\n\t\t\t\t\tfor (int i = 1; i < number_pos; i++){\n\t\t\t\t\t\tui = checked ((ui * 10) + ((uint)(number_builder [i] - '0')));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn integer_type_suffix (ui, c, loc);\n\t\t\t\t}\n\t\t\t} catch (OverflowException) {\n\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\treturn new IntLiteral (context.BuiltinTypes, 0, loc);\n\t\t\t}\n\t\t\tcatch (FormatException) {\n\t\t\t\tReport.Error (1013, Location, \"Invalid number\");\n\t\t\t\treturn new IntLiteral (context.BuiltinTypes, 0, loc);\n\t\t\t}\n\t\t}\n\t\t\n\t\tILiteralConstant adjust_real (TypeCode t, Location loc)\n\t\t{\n\t\t\tstring s = new string (number_builder, 0, number_pos);\n\t\t\tconst string error_details = \"Floating-point constant is outside the range of type `{0}'\";\n\n\t\t\tswitch (t){\n\t\t\tcase TypeCode.Decimal:\n\t\t\t\ttry {\n\t\t\t\t\treturn new DecimalLiteral (context.BuiltinTypes, decimal.Parse (s, styles, csharp_format_info), loc);\n\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\tReport.Error (594, Location, error_details, \"decimal\");\n\t\t\t\t\treturn new DecimalLiteral (context.BuiltinTypes, 0, loc);\n\t\t\t\t}\n\t\t\tcase TypeCode.Single:\n\t\t\t\ttry {\n\t\t\t\t\treturn new FloatLiteral (context.BuiltinTypes, float.Parse (s, styles, csharp_format_info), loc);\n\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\tReport.Error (594, Location, error_details, \"float\");\n\t\t\t\t\treturn new FloatLiteral (context.BuiltinTypes, 0, loc);\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\ttry {\n\t\t\t\t\treturn new DoubleLiteral (context.BuiltinTypes, double.Parse (s, styles, csharp_format_info), loc);\n\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\tReport.Error (594, loc, error_details, \"double\");\n\t\t\t\t\treturn new DoubleLiteral (context.BuiltinTypes, 0, loc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tILiteralConstant handle_hex (Location loc)\n\t\t{\n\t\t\tint d;\n\t\t\tulong ul;\n\t\t\t\n\t\t\tget_char ();\n\t\t\twhile ((d = peek_char ()) != -1){\n\t\t\t\tif (is_hex (d)){\n\t\t\t\t\tnumber_builder [number_pos++] = (char) d;\n\t\t\t\t\tget_char ();\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tstring s = new String (number_builder, 0, number_pos);\n\n\t\t\ttry {\n\t\t\t\tif (number_pos <= 8)\n\t\t\t\t\tul = System.UInt32.Parse (s, NumberStyles.HexNumber);\n\t\t\t\telse\n\t\t\t\t\tul = System.UInt64.Parse (s, NumberStyles.HexNumber);\n\n\t\t\t\treturn integer_type_suffix (ul, peek_char (), loc);\n\t\t\t} catch (OverflowException){\n\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\treturn new IntLiteral (context.BuiltinTypes, 0, loc);\n\t\t\t}\n\t\t\tcatch (FormatException) {\n\t\t\t\tReport.Error (1013, Location, \"Invalid number\");\n\t\t\t\treturn new IntLiteral (context.BuiltinTypes, 0, loc);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Invoked if we know we have .digits or digits\n\t\t//\n\t\tint is_number (int c, bool dotLead)\n\t\t{\n\t\t\tILiteralConstant res;\n\n#if FULL_AST\n\t\t\tint read_start = reader.Position - 1;\n\t\t\tif (dotLead) {\n\t\t\t\t//\n\t\t\t\t// Caller did peek_char\n\t\t\t\t//\n\t\t\t\t--read_start;\n\t\t\t}\n#endif\n\t\t\tnumber_pos = 0;\n\t\t\tvar loc = Location;\n\t\t\tbool hasLeadingDot = c == '.';\n\n\t\t\tif (!dotLead){\n\t\t\t\tif (c == '0'){\n\t\t\t\t\tint peek = peek_char ();\n\n\t\t\t\t\tif (peek == 'x' || peek == 'X') {\n\t\t\t\t\t\tval = res = handle_hex (loc);\n#if FULL_AST\n\t\t\t\t\t\tres.ParsedValue = reader.ReadChars (read_start, reader.Position - 1);\n#endif\n\n\t\t\t\t\t\treturn Token.LITERAL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdecimal_digits (c);\n\t\t\t\tc = peek_char ();\n\t\t\t}\n\n\t\t\t//\n\t\t\t// We need to handle the case of\n\t\t\t// \"1.1\" vs \"1.string\" (LITERAL_FLOAT vs NUMBER DOT IDENTIFIER)\n\t\t\t//\n\t\t\tbool is_real = false;\n\t\t\tif (c == '.'){\n\t\t\t\tif (!dotLead)\n\t\t\t\t\tget_char ();\n\n\t\t\t\tif (decimal_digits ('.')){\n\t\t\t\t\tis_real = true;\n\t\t\t\t\tc = peek_char ();\n\t\t\t\t} else {\n\t\t\t\t\tputback ('.');\n\t\t\t\t\tnumber_pos--;\n\t\t\t\t\tval = res = adjust_int (-1, loc);\n#if FULL_AST\n\t\t\t\t\tres.ParsedValue = reader.ReadChars (read_start, reader.Position - 1);\n#endif\n\t\t\t\t\treturn Token.LITERAL;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (c == 'e' || c == 'E'){\n\t\t\t\tis_real = true;\n\t\t\t\tget_char ();\n\t\t\t\tif (number_pos == MaxNumberLength)\n\t\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\tnumber_builder [number_pos++] = (char) c;\n\t\t\t\tc = get_char ();\n\t\t\t\t\n\t\t\t\tif (c == '+'){\n\t\t\t\t\tif (number_pos == MaxNumberLength)\n\t\t\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\t\tnumber_builder [number_pos++] = '+';\n\t\t\t\t\tc = -1;\n\t\t\t\t} else if (c == '-') {\n\t\t\t\t\tif (number_pos == MaxNumberLength)\n\t\t\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\t\tnumber_builder [number_pos++] = '-';\n\t\t\t\t\tc = -1;\n\t\t\t\t} else {\n\t\t\t\t\tif (number_pos == MaxNumberLength)\n\t\t\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\t\tnumber_builder [number_pos++] = '+';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tdecimal_digits (c);\n\t\t\t\tc = peek_char ();\n\t\t\t}\n\n\t\t\tvar type = real_type_suffix (c);\n\t\t\tif (type == TypeCode.Empty && !is_real) {\n\t\t\t\tres = adjust_int (c, loc);\n\t\t\t} else {\n\t\t\t\tis_real = true;\n\n\t\t\t\tif (type != TypeCode.Empty) {\n\t\t\t\t\tget_char ();\n\t\t\t\t}\n\n\t\t\t\tres = adjust_real (type, loc);\n\t\t\t}\n\n\t\t\tval = res;\n#if FULL_AST\n\t\t\tvar chars = reader.ReadChars (read_start, reader.Position - (type == TypeCode.Empty && c > 0 ? 1 : 0));\n\t\t\tif (chars[chars.Length - 1] == '\\r')\n\t\t\t\tArray.Resize (ref chars, chars.Length - 1);\n\t\t\tres.ParsedValue = chars;\n#endif\n\n\t\t\treturn Token.LITERAL;\n\t\t}\n\n\t\t//\n\t\t// Accepts exactly count (4 or 8) hex, no more no less\n\t\t//\n\t\tint getHex (int count, out int surrogate, out bool error)\n\t\t{\n\t\t\tint i;\n\t\t\tint total = 0;\n\t\t\tint c;\n\t\t\tint top = count != -1 ? count : 4;\n\t\t\t\n\t\t\tget_char ();\n\t\t\terror = false;\n\t\t\tsurrogate = 0;\n\t\t\tfor (i = 0; i < top; i++){\n\t\t\t\tc = get_char ();\n\n\t\t\t\tif (c >= '0' && c <= '9')\n\t\t\t\t\tc = (int) c - (int) '0';\n\t\t\t\telse if (c >= 'A' && c <= 'F')\n\t\t\t\t\tc = (int) c - (int) 'A' + 10;\n\t\t\t\telse if (c >= 'a' && c <= 'f')\n\t\t\t\t\tc = (int) c - (int) 'a' + 10;\n\t\t\t\telse {\n\t\t\t\t\terror = true;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttotal = (total * 16) + c;\n\t\t\t\tif (count == -1){\n\t\t\t\t\tint p = peek_char ();\n\t\t\t\t\tif (p == -1)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (!is_hex ((char)p))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (top == 8) {\n\t\t\t\tif (total > 0x0010FFFF) {\n\t\t\t\t\terror = true;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tif (total >= 0x00010000) {\n\t\t\t\t\tsurrogate = ((total - 0x00010000) % 0x0400 + 0xDC00);\t\t\t\t\t\n\t\t\t\t\ttotal = ((total - 0x00010000) / 0x0400 + 0xD800);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn total;\n\t\t}\n\n\t\tint escape (int c, out int surrogate)\n\t\t{\n\t\t\tbool error;\n\t\t\tint d;\n\t\t\tint v;\n\n\t\t\td = peek_char ();\n\t\t\tif (c != '\\\\') {\n\t\t\t\tsurrogate = 0;\n\t\t\t\treturn c;\n\t\t\t}\n\t\t\t\n\t\t\tswitch (d){\n\t\t\tcase 'a':\n\t\t\t\tv = '\\a'; break;\n\t\t\tcase 'b':\n\t\t\t\tv = '\\b'; break;\n\t\t\tcase 'n':\n\t\t\t\tv = '\\n'; break;\n\t\t\tcase 't':\n\t\t\t\tv = '\\t'; break;\n\t\t\tcase 'v':\n\t\t\t\tv = '\\v'; break;\n\t\t\tcase 'r':\n\t\t\t\tv = '\\r'; break;\n\t\t\tcase '\\\\':\n\t\t\t\tv = '\\\\'; break;\n\t\t\tcase 'f':\n\t\t\t\tv = '\\f'; break;\n\t\t\tcase '0':\n\t\t\t\tv = 0; break;\n\t\t\tcase '\"':\n\t\t\t\tv = '\"'; break;\n\t\t\tcase '\\'':\n\t\t\t\tv = '\\''; break;\n\t\t\tcase 'x':\n\t\t\t\tv = getHex (-1, out surrogate, out error);\n\t\t\t\tif (error)\n\t\t\t\t\tgoto default;\n\t\t\t\treturn v;\n\t\t\tcase 'u':\n\t\t\tcase 'U':\n\t\t\t\treturn EscapeUnicode (d, out surrogate);\n\t\t\tdefault:\n\t\t\t\tsurrogate = 0;\n\t\t\t\tReport.Error (1009, Location, \"Unrecognized escape sequence `\\\\{0}'\", ((char)d).ToString ());\n\t\t\t\treturn d;\n\t\t\t}\n\n\t\t\tget_char ();\n\t\t\tsurrogate = 0;\n\t\t\treturn v;\n\t\t}\n\n\t\tint EscapeUnicode (int ch, out int surrogate)\n\t\t{\n\t\t\tbool error;\n\t\t\tif (ch == 'U') {\n\t\t\t\tch = getHex (8, out surrogate, out error);\n\t\t\t} else {\n\t\t\t\tch = getHex (4, out surrogate, out error);\n\t\t\t}\n\n\t\t\tif (error)\n\t\t\t\tReport.Error (1009, Location, \"Unrecognized escape sequence\");\n\n\t\t\treturn ch;\n\t\t}\n\n\t\tint get_char ()\n\t\t{\n\t\t\tint x;\n\t\t\tif (putback_char != -1) {\n\t\t\t\tx = putback_char;\n\t\t\t\tputback_char = -1;\n\t\t\t} else {\n\t\t\t\tx = reader.Read ();\n\t\t\t}\n\t\t\t\n\t\t\tif (x <= 13) {\n\t\t\t\tif (x == '\\r') {\n\t\t\t\t\tif (peek_char () == '\\n') {\n\t\t\t\t\t\tputback_char = -1;\n\t\t\t\t\t\tadvance_line (SpecialsBag.NewLine.Windows);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tadvance_line (SpecialsBag.NewLine.Unix);\n\t\t\t\t\t}\n\n\t\t\t\t\tx = '\\n';\n\t\t\t\t} else if (x == '\\n') {\n\t\t\t\t\tadvance_line (SpecialsBag.NewLine.Unix);\n\t\t\t\t} else {\n\t\t\t\t\tcol++;\n\t\t\t\t}\n\t\t\t} else if (x >= UnicodeLS && x <= UnicodePS) {\n\t\t\t\tadvance_line (SpecialsBag.NewLine.Unix);\n\t\t\t} else {\n\t\t\t\tcol++;\n\t\t\t}\n\n\t\t\treturn x;\n\t\t}\n\n\t\tbool recordNewLine = true;\n\t\tvoid advance_line (SpecialsBag.NewLine newLine)\n\t\t{\n\t\t\tif (recordNewLine)\n\t\t\t\tsbag.AddNewLine (line, col, newLine);\n\t\t\tline++;\n\t\t\tref_line++;\n\t\t\tprevious_col = col;\n\t\t\tcol = 0;\n\t\t\tstartsLine = true;\n\t\t}\n\n\t\tint peek_char ()\n\t\t{\n\t\t\tif (putback_char == -1)\n\t\t\t\tputback_char = reader.Read ();\n\t\t\treturn putback_char;\n\t\t}\n\n\t\tint peek_char2 ()\n\t\t{\n\t\t\tif (putback_char != -1)\n\t\t\t\treturn putback_char;\n\t\t\treturn reader.Peek ();\n\t\t}\n\t\t\n\t\tpublic void putback (int c)\n\t\t{\n\t\t\tif (putback_char != -1) {\n\t\t\t\tthrow new InternalErrorException (string.Format (\"Secondary putback [{0}] putting back [{1}] is not allowed\", (char)putback_char, (char) c), Location);\n\t\t\t}\n\n\t\t\tif (c == '\\n' || col == 0 || (c >= UnicodeLS && c <= UnicodePS)) {\n\t\t\t\t// It won't happen though.\n\t\t\t\tline--;\n\t\t\t\tref_line--;\n\t\t\t\tcol = previous_col;\n\t\t\t}\n\t\t\telse\n\t\t\t\tcol--;\n\t\t\tputback_char = c;\n\t\t}\n\n\t\tpublic bool advance ()\n\t\t{\n\t\t\treturn peek_char () != -1 || CompleteOnEOF;\n\t\t}\n\n\t\tpublic Object Value {\n\t\t\tget {\n\t\t\t\treturn val;\n\t\t\t}\n\t\t}\n\n\t\tpublic Object value ()\n\t\t{\n\t\t\treturn val;\n\t\t}\n\n\t\tpublic int token ()\n\t\t{\n\t\t\tcurrent_token = xtoken ();\n\t\t\treturn current_token;\n\t\t}\n\n\t\tint TokenizePreprocessorIdentifier (out int c)\n\t\t{\n\t\t\tint startCol, endLine, endCol;\n\t\t\treturn TokenizePreprocessorIdentifier (out c, out startCol, out endLine, out endCol);\n\t\t}\n\n\t\tint TokenizePreprocessorIdentifier (out int c, out int startCol, out int endLine, out int endCol)\n\t\t{\n\t\t\t// skip over white space\n\t\t\tdo {\n\t\t\t\tendLine = line;\n\t\t\t\tendCol = col;\n\t\t\t\tc = get_char ();\n\t\t\t} while (c == ' ' || c == '\\t');\n\t\t\tstartCol = col;\n\t\t\tint pos = 0;\n\t\t\twhile (c != -1 && c >= 'a' && c <= 'z') {\n\t\t\t\tid_builder[pos++] = (char) c;\n\t\t\t\tendCol = col + 1;\n\t\t\t\tc = get_char ();\n\t\t\t\tif (c == '\\\\') {\n\t\t\t\t\tint peek = peek_char ();\n\t\t\t\t\tif (peek == 'U' || peek == 'u') {\n\t\t\t\t\t\tint surrogate;\n\t\t\t\t\t\tc = EscapeUnicode (c, out surrogate);\n\t\t\t\t\t\tif (surrogate != 0) {\n\t\t\t\t\t\t\tif (is_identifier_part_character ((char) c)) {\n\t\t\t\t\t\t\t\tid_builder[pos++] = (char) c;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tc = surrogate;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn pos;\n\t\t}\n\n\t\tPreprocessorDirective get_cmd_arg (out string arg)\n\t\t{\n\t\t\tint c;\n\t\t\tint startLine = line, startCol = col;\n\n\t\t\ttokens_seen = false;\n\t\t\targ = \"\";\n\t\t\t\n\t\t\tint startCol2, endLine, endCol;\n\t\t\tvar cmd = GetPreprocessorDirective (id_builder, TokenizePreprocessorIdentifier (out c, out startCol2, out endLine, out endCol));\n\t\t\t\n\t\t\tif ((cmd & PreprocessorDirective.CustomArgumentsParsing) != 0) {\n\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\tsbag.AddPreProcessorDirective (startLine, startCol, line, col, cmd, null);\n\t\t\t\treturn cmd;\n\t\t\t}\n\t\t\t\n\t\t\t// skip over white space\n\t\t\twhile (c == ' ' || c == '\\t') {\n\t\t\t\tc = get_char ();\n\t\t\t}\n\t\t\tint has_identifier_argument = (int)(cmd & PreprocessorDirective.RequiresArgument);\n\t\t\tint pos = 0;\n\t\t\twhile (c != -1 && c != '\\n' && c != UnicodeLS && c != UnicodePS) {\n\t\t\t\tif (c == '\\\\' && has_identifier_argument >= 0) {\n\t\t\t\t\tif (has_identifier_argument != 0) {\n\t\t\t\t\t\thas_identifier_argument = 1;\n\n\t\t\t\t\t\tint peek = peek_char ();\n\t\t\t\t\t\tif (peek == 'U' || peek == 'u') {\n\t\t\t\t\t\t\tint surrogate;\n\t\t\t\t\t\t\tc = EscapeUnicode (c, out surrogate);\n\t\t\t\t\t\t\tif (surrogate != 0) {\n\t\t\t\t\t\t\t\tif (is_identifier_part_character ((char)c)) {\n\t\t\t\t\t\t\t\t\tif (pos == value_builder.Length)\n\t\t\t\t\t\t\t\t\t\tArray.Resize (ref value_builder, pos * 2);\n\n\t\t\t\t\t\t\t\t\tvalue_builder [pos++] = (char)c;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tc = surrogate;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\thas_identifier_argument = -1;\n\t\t\t\t\t}\n\t\t\t\t} else if (c == '/' && peek_char () == '/') {\n\t\t\t\t\t//\n\t\t\t\t\t// Eat single-line comments\n\t\t\t\t\t//\n\t\t\t\t\tget_char ();\n\t\t\t\t\tReadToEndOfLine ();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tendLine = line;\n\t\t\t\tendCol = col + 1;\n\t\t\t\t\n\t\t\t\tif (pos == value_builder.Length)\n\t\t\t\t\tArray.Resize (ref value_builder, pos * 2);\n\n\t\t\t\tvalue_builder[pos++] = (char) c;\n\t\t\t\tc = get_char ();\n\t\t\t}\n\n\t\t\tif (pos != 0) {\n\t\t\t\tif (pos > MaxIdentifierLength)\n\t\t\t\t\targ = new string (value_builder, 0, pos);\n\t\t\t\telse\n\t\t\t\t\targ = InternIdentifier (value_builder, pos);\n\n\t\t\t\t// Eat any trailing whitespaces\n\t\t\t\targ = arg.Trim (simple_whitespaces);\n\t\t\t}\n\t\t\tif (position_stack.Count == 0)\n\t\t\t\tsbag.AddPreProcessorDirective (startLine, startCol, endLine, endCol, cmd, arg);\n\n\t\t\treturn cmd;\n\t\t}\n\n\t\t//\n\t\t// Handles the #line directive\n\t\t//\n\t\tbool PreProcessLine ()\n\t\t{\n\t\t\tLocation loc = Location;\n\t\t\t#if FULL_AST\n\t\t\tvar lineDirective = sbag.GetCurrentLineProcessorDirective();\n\t\t\t#endif\n\n\t\t\tint c;\n\n\t\t\tint length = TokenizePreprocessorIdentifier (out c);\n\t\t\tif (length == line_default.Length) {\n\t\t\t\tif (!IsTokenIdentifierEqual (line_default))\n\t\t\t\t\treturn false;\n\n\t\t\t\tcurrent_source = source_file.SourceFile;\n\t\t\t\tif (!hidden_block_start.IsNull) {\n\t\t\t\t\tcurrent_source.RegisterHiddenScope (hidden_block_start, loc);\n\t\t\t\t\thidden_block_start = Location.Null;\n\t\t\t\t}\n\n\t\t\t\t//ref_line = line;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (length == line_hidden.Length) {\n\t\t\t\tif (!IsTokenIdentifierEqual (line_hidden))\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (hidden_block_start.IsNull)\n\t\t\t\t\thidden_block_start = loc;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (length != 0 || c < '0' || c > '9') {\n\t\t\t\t//\n\t\t\t\t// Eat any remaining characters to continue parsing on next line\n\t\t\t\t//\n\t\t\t\tReadToEndOfLine ();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tint new_line = TokenizeNumber (c);\n\t\t\tif (new_line < 1) {\n\t\t\t\t//\n\t\t\t\t// Eat any remaining characters to continue parsing on next line\n\t\t\t\t//\n\t\t\t\tReadToEndOfLine ();\n\t\t\t\treturn new_line != 0;\n\t\t\t}\n\t\t\t#if FULL_AST\n\t\t\tlineDirective.LineNumber = new_line;\n\t\t\t#endif\n\n\t\t\tc = get_char ();\n\t\t\tif (c == ' ') {\n\t\t\t\t// skip over white space\n\t\t\t\tdo {\n\t\t\t\t\tc = get_char ();\n\t\t\t\t} while (c == ' ' || c == '\\t');\n\t\t\t} else if (c == '\"') {\n\t\t\t\tc = 0;\n\t\t\t}\n\n\t\t\tif (c != '\\n' && c != '/' && c != '\"' && c != UnicodeLS && c != UnicodePS) {\n\t\t\t\t//\n\t\t\t\t// Eat any remaining characters to continue parsing on next line\n\t\t\t\t//\n\t\t\t\tReadToEndOfLine ();\n\n\t\t\t\tReport.Error (1578, loc, \"Filename, single-line comment or end-of-line expected\");\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tstring new_file_name = null;\n\t\t\tif (c == '\"') {\n\t\t\t\tnew_file_name = TokenizeFileName (ref c);\n\t\t\t\t#if FULL_AST\n\t\t\t\tlineDirective.FileName = new_file_name;\n\t\t\t\t#endif\n\n\t\t\t\t// skip over white space\n\t\t\t\twhile (c == ' ' || c == '\\t') {\n\t\t\t\t\tc = get_char ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (c == '\\n' || c == UnicodeLS || c == UnicodePS) {\n\n\t\t\t} else if (c == '/') {\n\t\t\t\tReadSingleLineComment ();\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// Eat any remaining characters to continue parsing on next line\n\t\t\t\t//\n\t\t\t\tReadToEndOfLine ();\n\n\t\t\t\tError_EndLineExpected ();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (new_file_name != null) {\n\t\t\t\tcurrent_source = context.LookupFile (source_file, new_file_name);\n\t\t\t\tsource_file.AddIncludeFile (current_source);\n\t\t\t}\n\n\t\t\tif (!hidden_block_start.IsNull) {\n\t\t\t\tcurrent_source.RegisterHiddenScope (hidden_block_start, loc);\n\t\t\t\thidden_block_start = Location.Null;\n\t\t\t}\n\n\t\t\t//ref_line = new_line;\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Handles #define and #undef\n\t\t//\n\t\tvoid PreProcessDefinition (bool is_define, string ident, bool caller_is_taking)\n\t\t{\n\t\t\tif (ident.Length == 0 || ident == \"true\" || ident == \"false\"){\n\t\t\t\tReport.Error (1001, Location, \"Missing identifier to pre-processor directive\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (ident.IndexOfAny (simple_whitespaces) != -1){\n\t\t\t\tError_EndLineExpected ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!is_identifier_start_character (ident [0]))\n\t\t\t\tReport.Error (1001, Location, \"Identifier expected: {0}\", ident);\n\t\t\t\n\t\t\tforeach (char c in ident.Substring (1)){\n\t\t\t\tif (!is_identifier_part_character (c)){\n\t\t\t\t\tReport.Error (1001, Location, \"Identifier expected: {0}\",  ident);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!caller_is_taking)\n\t\t\t\treturn;\n\n\t\t\tif (is_define) {\n\t\t\t\t//\n\t\t\t\t// #define ident\n\t\t\t\t//\n\t\t\t\tif (context.Settings.IsConditionalSymbolDefined (ident))\n\t\t\t\t\treturn;\n\n\t\t\t\tsource_file.AddDefine (ident);\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// #undef ident\n\t\t\t\t//\n\t\t\t\tsource_file.AddUndefine (ident);\n\t\t\t}\n\t\t}\n\n\t\tbyte read_hex (out bool error)\n\t\t{\n\t\t\tint total;\n\t\t\tint c = get_char ();\n\n\t\t\tif ((c >= '0') && (c <= '9'))\n\t\t\t\ttotal = (int) c - (int) '0';\n\t\t\telse if ((c >= 'A') && (c <= 'F'))\n\t\t\t\ttotal = (int) c - (int) 'A' + 10;\n\t\t\telse if ((c >= 'a') && (c <= 'f'))\n\t\t\t\ttotal = (int) c - (int) 'a' + 10;\n\t\t\telse {\n\t\t\t\terror = true;\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\ttotal *= 16;\n\t\t\tc = get_char ();\n\n\t\t\tif ((c >= '0') && (c <= '9'))\n\t\t\t\ttotal += (int) c - (int) '0';\n\t\t\telse if ((c >= 'A') && (c <= 'F'))\n\t\t\t\ttotal += (int) c - (int) 'A' + 10;\n\t\t\telse if ((c >= 'a') && (c <= 'f'))\n\t\t\t\ttotal += (int) c - (int) 'a' + 10;\n\t\t\telse {\n\t\t\t\terror = true;\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\terror = false;\n\t\t\treturn (byte) total;\n\t\t}\n\n\t\t//\n\t\t// Parses #pragma checksum\n\t\t//\n\t\tbool ParsePragmaChecksum ()\n\t\t{\n\t\t\t//\n\t\t\t// The syntax is ` \"foo.txt\" \"{guid}\" \"hash\"'\n\t\t\t//\n\t\t\t// guid is predefined hash algorithm guid {406ea660-64cf-4c82-b6f0-42d48172a799} for md5\n\t\t\t//\n\t\t\tint c = get_char ();\n\n\t\t\tif (c != '\"')\n\t\t\t\treturn false;\n\n\t\t\tstring file_name = TokenizeFileName (ref c);\n\n\t\t\t// TODO: Any white-spaces count\n\t\t\tif (c != ' ')\n\t\t\t\treturn false;\n\n\t\t\tSourceFile file = context.LookupFile (source_file, file_name);\n\n\t\t\tif (get_char () != '\"' || get_char () != '{')\n\t\t\t\treturn false;\n\n\t\t\tbool error;\n\t\t\tbyte[] guid_bytes = new byte [16];\n\t\t\tint i = 0;\n\n\t\t\tfor (; i < 4; i++) {\n\t\t\t\tguid_bytes [i] = read_hex (out error);\n\t\t\t\tif (error)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (get_char () != '-')\n\t\t\t\treturn false;\n\n\t\t\tfor (; i < 10; i++) {\n\t\t\t\tguid_bytes [i] = read_hex (out error);\n\t\t\t\tif (error)\n\t\t\t\t\treturn false;\n\n\t\t\t\tguid_bytes [i++] = read_hex (out error);\n\t\t\t\tif (error)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (get_char () != '-')\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (; i < 16; i++) {\n\t\t\t\tguid_bytes [i] = read_hex (out error);\n\t\t\t\tif (error)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (get_char () != '}' || get_char () != '\"')\n\t\t\t\treturn false;\n\n\t\t\t// TODO: Any white-spaces count\n\t\t\tc = get_char ();\n\t\t\tif (c != ' ')\n\t\t\t\treturn false;\n\n\t\t\tif (get_char () != '\"')\n\t\t\t\treturn false;\n\n\t\t\t// Any length of checksum\n\t\t\tList<byte> checksum_bytes = new List<byte> (16);\n\n\t\t\tvar checksum_location = Location;\n\t\t\tc = peek_char ();\n\t\t\twhile (c != '\"' && c != -1) {\n\t\t\t\tchecksum_bytes.Add (read_hex (out error));\n\t\t\t\tif (error)\n\t\t\t\t\treturn false;\n\n\t\t\t\tc = peek_char ();\n\t\t\t}\n\n\t\t\tif (c == '/') {\n\t\t\t\tReadSingleLineComment ();\n\t\t\t} else if (get_char () != '\"') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (context.Settings.GenerateDebugInfo) {\n\t\t\t\tvar chsum = checksum_bytes.ToArray ();\n\n\t\t\t\tif (file.HasChecksum) {\n\t\t\t\t\tif (!ArrayComparer.IsEqual (file.Checksum, chsum)) {\n\t\t\t\t\t\t// TODO: Report.SymbolRelatedToPreviousError\n\t\t\t\t\t\tReport.Warning (1697, 1, checksum_location, \"Different checksum values specified for file `{0}'\", file.Name);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfile.SetChecksum (guid_bytes, chsum);\n\t\t\t\tcurrent_source.AutoGenerated = true;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool IsTokenIdentifierEqual (char[] identifier)\n\t\t{\n\t\t\tfor (int i = 0; i < identifier.Length; ++i) {\n\t\t\t\tif (identifier[i] != id_builder[i])\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tint TokenizeNumber (int value)\n\t\t{\n\t\t\tnumber_pos = 0;\n\n\t\t\tdecimal_digits (value);\n\t\t\tuint ui = (uint) (number_builder[0] - '0');\n\n\t\t\ttry {\n\t\t\t\tfor (int i = 1; i < number_pos; i++) {\n\t\t\t\t\tui = checked ((ui * 10) + ((uint) (number_builder[i] - '0')));\n\t\t\t\t}\n\n\t\t\t\treturn (int) ui;\n\t\t\t} catch (OverflowException) {\n\t\t\t\tError_NumericConstantTooLong ();\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tstring TokenizeFileName (ref int c)\n\t\t{\n\t\t\tvar string_builder = new StringBuilder ();\n\t\t\twhile (c != -1 && c != '\\n' && c != UnicodeLS && c != UnicodePS) {\n\t\t\t\tc = get_char ();\n\t\t\t\tif (c == '\"') {\n\t\t\t\t\tc = get_char ();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tstring_builder.Append ((char) c);\n\t\t\t}\n\n\t\t\tif (string_builder.Length == 0) {\n\t\t\t\tReport.Warning (1709, 1, Location, \"Filename specified for preprocessor directive is empty\");\n\t\t\t}\n\n\t\t\n\t\t\treturn string_builder.ToString ();\n\t\t}\n\n\t\tint TokenizePragmaNumber (ref int c)\n\t\t{\n\t\t\tnumber_pos = 0;\n\n\t\t\tint number;\n\n\t\t\tif (c >= '0' && c <= '9') {\n\t\t\t\tnumber = TokenizeNumber (c);\n\n\t\t\t\tc = get_char ();\n\n\t\t\t\t// skip over white space\n\t\t\t\twhile (c == ' ' || c == '\\t')\n\t\t\t\t\tc = get_char ();\n\n\t\t\t\tif (c == ',') {\n\t\t\t\t\tc = get_char ();\n\t\t\t\t}\n\n\t\t\t\t// skip over white space\n\t\t\t\twhile (c == ' ' || c == '\\t')\n\t\t\t\t\tc = get_char ();\n\t\t\t} else {\n\t\t\t\tnumber = -1;\n\t\t\t\tif (c == '/') {\n\t\t\t\t\tReadSingleLineComment ();\n\t\t\t\t} else {\n\t\t\t\t\tReport.Warning (1692, 1, Location, \"Invalid number\");\n\n\t\t\t\t\t// Read everything till the end of the line or file\n\t\t\t\t\tReadToEndOfLine ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn number;\n\t\t}\n\n\t\tvoid ReadToEndOfLine ()\n\t\t{\n\t\t\tint c;\n\t\t\tdo {\n\t\t\t\tc = get_char ();\n\t\t\t} while (c != -1 && c != '\\n' && c != UnicodeLS && c != UnicodePS);\n\t\t}\n\n\t\tvoid ReadSingleLineComment ()\n\t\t{\n\t\t\tif (peek_char () != '/')\n\t\t\t\tReport.Warning (1696, 1, Location, \"Single-line comment or end-of-line expected\");\n\t\t\tif (position_stack.Count == 0)\n\t\t\t\tsbag.StartComment (SpecialsBag.CommentType.Single, startsLine, line, col - 1);\n\t\t\t// Read everything till the end of the line or file\n\t\t\tint c;\n\t\t\tdo {\n\t\t\t\tc = get_char ();\n\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\tsbag.PushCommentChar (c);\n\t\t\t\tvar pc = peek_char ();\n\t\t\t\tif ((pc == '\\n' || pc == -1 || pc == UnicodeLS || pc == UnicodePS) && position_stack.Count == 0) \n\t\t\t\t\tsbag.EndComment (line, col + 1);\n\t\t\t} while (c != -1 && c != '\\n' && c != UnicodeLS && c != UnicodePS);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Handles #pragma directive\n\t\t/// </summary>\n\t\tvoid ParsePragmaDirective ()\n\t\t{\n\t\t\tint c;\n\t\t\tint startCol, endLine, endCol;\n\t\t\tint length = TokenizePreprocessorIdentifier (out c, out startCol, out endLine, out endCol);\n\t\t\t#if FULL_AST\n\t\t\tvar pragmaDirective = sbag.GetPragmaPreProcessorDirective();\n\t\t\tif (pragmaDirective != null)\n\t\t\t\tpragmaDirective.WarningColumn = startCol;\n\t\t\t#endif\n\t\t\tif (length == pragma_warning.Length && IsTokenIdentifierEqual (pragma_warning)) {\n\t\t\t\tlength = TokenizePreprocessorIdentifier (out c, out startCol, out endLine, out endCol);\n\t\t\t\t#if FULL_AST\n\t\t\t\tif (pragmaDirective != null)\n\t\t\t\t\tpragmaDirective.DisableRestoreColumn = startCol;\n\t\t\t\t#endif\n\n\t\t\t\t//\n\t\t\t\t// #pragma warning disable\n\t\t\t\t// #pragma warning restore\n\t\t\t\t//\n\t\t\t\tif (length == pragma_warning_disable.Length) {\n\t\t\t\t\tbool disable = IsTokenIdentifierEqual (pragma_warning_disable);\n\t\t\t\t\t#if FULL_AST\n\t\t\t\t\tif (pragmaDirective != null)\n\t\t\t\t\t\tpragmaDirective.Disalbe = disable;\n\t\t\t\t\t#endif\n\t\t\t\t\tif (disable || IsTokenIdentifierEqual (pragma_warning_restore)) {\n\t\t\t\t\t\t// skip over white space\n\t\t\t\t\t\twhile (c == ' ' || c == '\\t')\n\t\t\t\t\t\t\tc = get_char ();\n\n\t\t\t\t\t\tvar loc = Location;\n\n\t\t\t\t\t\tif (c == '\\n' || c == '/' || c == UnicodeLS || c == UnicodePS) {\n\t\t\t\t\t\t\tif (c == '/')\n\t\t\t\t\t\t\t\tReadSingleLineComment ();\n\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Disable/Restore all warnings\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tif (disable) {\n\t\t\t\t\t\t\t\tReport.RegisterWarningRegion (loc).WarningDisable (loc.Row);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tReport.RegisterWarningRegion (loc).WarningEnable (loc.Row);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Disable/Restore a warning or group of warnings\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tint code;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tvar startLoc = loc;\n\t\t\t\t\t\t\t\t#if FULL_AST\n\t\t\t\t\t\t\t\t// int read_start = reader.Position;\n\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\tcode = TokenizePragmaNumber (ref c);\n\t\t\t\t\t\t\t\tif (code > 0) {\n\t\t\t\t\t\t\t\t\t#if FULL_AST\n\t\t\t\t\t\t\t\t\tvar literal = new IntConstant(context.BuiltinTypes, code, startLoc);\n\t\t\t\t\t\t\t\t\tif (pragmaDirective != null)\n\t\t\t\t\t\t\t\t\t\tpragmaDirective.Codes.Add (literal);\n\t\t\t\t\t\t\t\t//\tliteral.ParsedValue = reader.ReadChars (read_start, reader.Position + 1);\n\t\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t\tif (disable) {\n\t\t\t\t\t\t\t\t\t\tReport.RegisterWarningRegion (loc).WarningDisable (loc, code, context.Report);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tReport.RegisterWarningRegion (loc).WarningEnable (loc, code, context);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} while (code >= 0 && c != '\\n' && c != -1 && c != UnicodeLS && c != UnicodePS);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tReport.Warning (1634, 1, Location, \"Expected disable or restore\");\n\n\t\t\t\t// Eat any remaining characters on the line\n\t\t\t\tReadToEndOfLine ();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\t//\n\t\t\t// #pragma checksum\n\t\t\t//\n\t\t\tif (length == pragma_checksum.Length && IsTokenIdentifierEqual (pragma_checksum)) {\n\t\t\t\tif (c != ' ' || !ParsePragmaChecksum ()) {\n\t\t\t\t\tReport.Warning (1695, 1, Location,\n\t\t\t\t\t\t\"Invalid #pragma checksum syntax. Expected \\\"filename\\\" \\\"{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}\\\" \\\"XXXX...\\\"\");\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tReport.Warning (1633, 1, Location, \"Unrecognized #pragma directive\");\n\t\t}\n\n\t\tbool eval_val (string s)\n\t\t{\n\t\t\tif (s == \"true\")\n\t\t\t\treturn true;\n\t\t\tif (s == \"false\")\n\t\t\t\treturn false;\n\n\t\t\treturn source_file.IsConditionalDefined (s);\n\t\t}\n\n\t\tbool pp_primary (ref string s)\n\t\t{\n\t\t\ts = s.Trim ();\n\t\t\tint len = s.Length;\n\n\t\t\tif (len > 0){\n\t\t\t\tchar c = s [0];\n\t\t\t\t\n\t\t\t\tif (c == '('){\n\t\t\t\t\ts = s.Substring (1);\n\t\t\t\t\tbool val = pp_expr (ref s, false);\n\t\t\t\t\tif (s.Length > 0 && s [0] == ')'){\n\t\t\t\t\t\ts = s.Substring (1);\n\t\t\t\t\t\treturn val;\n\t\t\t\t\t}\n\t\t\t\t\tError_InvalidDirective ();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (is_identifier_start_character (c)){\n\t\t\t\t\tint j = 1;\n\n\t\t\t\t\twhile (j < len){\n\t\t\t\t\t\tc = s [j];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_identifier_part_character (c)){\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbool v = eval_val (s.Substring (0, j));\n\t\t\t\t\t\ts = s.Substring (j);\n\t\t\t\t\t\treturn v;\n\t\t\t\t\t}\n\t\t\t\t\tbool vv = eval_val (s);\n\t\t\t\t\ts = \"\";\n\t\t\t\t\treturn vv;\n\t\t\t\t}\n\t\t\t}\n\t\t\tError_InvalidDirective ();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool pp_unary (ref string s)\n\t\t{\n\t\t\ts = s.Trim ();\n\t\t\tint len = s.Length;\n\n\t\t\tif (len > 0){\n\t\t\t\tif (s [0] == '!'){\n\t\t\t\t\tif (len > 1 && s [1] == '='){\n\t\t\t\t\t\tError_InvalidDirective ();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\ts = s.Substring (1);\n\t\t\t\t\treturn ! pp_primary (ref s);\n\t\t\t\t} else\n\t\t\t\t\treturn pp_primary (ref s);\n\t\t\t} else {\n\t\t\t\tError_InvalidDirective ();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool pp_eq (ref string s)\n\t\t{\n\t\t\tbool va = pp_unary (ref s);\n\n\t\t\ts = s.Trim ();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0){\n\t\t\t\tif (s [0] == '='){\n\t\t\t\t\tif (len > 2 && s [1] == '='){\n\t\t\t\t\t\ts = s.Substring (2);\n\t\t\t\t\t\treturn va == pp_unary (ref s);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tError_InvalidDirective ();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else if (s [0] == '!' && len > 1 && s [1] == '='){\n\t\t\t\t\ts = s.Substring (2);\n\n\t\t\t\t\treturn va != pp_unary (ref s);\n\n\t\t\t\t} \n\t\t\t}\n\n\t\t\treturn va;\n\t\t\t\t\n\t\t}\n\t\t\n\t\tbool pp_and (ref string s)\n\t\t{\n\t\t\tbool va = pp_eq (ref s);\n\n\t\t\ts = s.Trim ();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0){\n\t\t\t\tif (s [0] == '&'){\n\t\t\t\t\tif (len > 2 && s [1] == '&'){\n\t\t\t\t\t\ts = s.Substring (2);\n\t\t\t\t\t\treturn (va & pp_and (ref s));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tError_InvalidDirective ();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn va;\n\t\t}\n\t\t\n\t\t//\n\t\t// Evaluates an expression for `#if' or `#elif'\n\t\t//\n\t\tbool pp_expr (ref string s, bool isTerm)\n\t\t{\n\t\t\tbool va = pp_and (ref s);\n\t\t\ts = s.Trim ();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0){\n\t\t\t\tchar c = s [0];\n\t\t\t\t\n\t\t\t\tif (c == '|'){\n\t\t\t\t\tif (len > 2 && s [1] == '|'){\n\t\t\t\t\t\ts = s.Substring (2);\n\t\t\t\t\t\treturn va | pp_expr (ref s, isTerm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tError_InvalidDirective ();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isTerm) {\n\t\t\t\t\tError_EndLineExpected ();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn va;\n\t\t}\n\n\t\tbool eval (string s)\n\t\t{\n\t\t\tbool v = pp_expr (ref s, true);\n\t\t\ts = s.Trim ();\n\t\t\tif (s.Length != 0){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn v;\n\t\t}\n\n\t\tvoid Error_NumericConstantTooLong ()\n\t\t{\n\t\t\tReport.Error (1021, Location, \"Integral constant is too large\");\t\t\t\n\t\t}\n\t\t\n\t\tvoid Error_InvalidDirective ()\n\t\t{\n\t\t\tReport.Error (1517, Location, \"Invalid preprocessor directive\");\n\t\t}\n\n\t\tvoid Error_UnexpectedDirective (string extra)\n\t\t{\n\t\t\tReport.Error (\n\t\t\t\t1028, Location,\n\t\t\t\t\"Unexpected processor directive ({0})\", extra);\n\t\t}\n\n\t\tvoid Error_TokensSeen ()\n\t\t{\n\t\t\tReport.Error (1032, Location,\n\t\t\t\t\"Cannot define or undefine preprocessor symbols after first token in file\");\n\t\t}\n\n\t\tvoid Eror_WrongPreprocessorLocation ()\n\t\t{\n\t\t\tReport.Error (1040, Location,\n\t\t\t\t\"Preprocessor directives must appear as the first non-whitespace character on a line\");\n\t\t}\n\n\t\tvoid Error_EndLineExpected ()\n\t\t{\n\t\t\tReport.Error (1025, Location, \"Single-line comment or end-of-line expected\");\n\t\t}\n\n\t\t//\n\t\t// Raises a warning when tokenizer found documentation comment\n\t\t// on unexpected place\n\t\t//\n\t\tvoid WarningMisplacedComment (Location loc)\n\t\t{\n\t\t\tif (doc_state != XmlCommentState.Error) {\n\t\t\t\tdoc_state = XmlCommentState.Error;\n\t\t\t\tReport.Warning (1587, 2, loc, \"XML comment is not placed on a valid language element\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\n\t\t// if true, then the code continues processing the code\n\t\t// if false, the code stays in a loop until another directive is\n\t\t// reached.\n\t\t// When caller_is_taking is false we ignore all directives except the ones\n\t\t// which can help us to identify where the #if block ends\n\t\tbool ParsePreprocessingDirective (bool caller_is_taking)\n\t\t{\n\t\t\tstring arg;\n\t\t\tbool region_directive = false;\n\n\t\t\tvar directive = get_cmd_arg (out arg);\n\n\t\t\t//\n\t\t\t// The first group of pre-processing instructions is always processed\n\t\t\t//\n\t\t\tswitch (directive) {\n\t\t\tcase PreprocessorDirective.Region:\n\t\t\t\tregion_directive = true;\n\t\t\t\targ = \"true\";\n\t\t\t\tgoto case PreprocessorDirective.If;\n\n\t\t\tcase PreprocessorDirective.Endregion:\n\t\t\t\tif (ifstack == null || ifstack.Count == 0){\n\t\t\t\t\tError_UnexpectedDirective (\"no #region for this #endregion\");\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tint pop = ifstack.Pop ();\n\t\t\t\t\t\n\t\t\t\tif ((pop & REGION) == 0)\n\t\t\t\t\tReport.Error (1027, Location, \"Expected `#endif' directive\");\n\t\t\t\t\t\n\t\t\t\treturn caller_is_taking;\n\t\t\t\t\n\t\t\tcase PreprocessorDirective.If:\n\t\t\t\tif (ifstack == null)\n\t\t\t\t\tifstack = new Stack<int> (2);\n\n\t\t\t\tint flags = region_directive ? REGION : 0;\n\t\t\t\tif (ifstack.Count == 0){\n\t\t\t\t\tflags |= PARENT_TAKING;\n\t\t\t\t} else {\n\t\t\t\t\tint state = ifstack.Peek ();\n\t\t\t\t\tif ((state & TAKING) != 0) {\n\t\t\t\t\t\tflags |= PARENT_TAKING;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (eval (arg) && caller_is_taking) {\n\t\t\t\t\tifstack.Push (flags | TAKING);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tsbag.SkipIf ();\n\t\t\t\tifstack.Push (flags);\n\t\t\t\treturn false;\n\n\t\t\tcase PreprocessorDirective.Endif:\n\t\t\t\tif (ifstack == null || ifstack.Count == 0){\n\t\t\t\t\tError_UnexpectedDirective (\"no #if for this #endif\");\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tpop = ifstack.Pop ();\n\t\t\t\t\t\n\t\t\t\t\tif ((pop & REGION) != 0)\n\t\t\t\t\t\tReport.Error (1038, Location, \"#endregion directive expected\");\n\t\t\t\t\t\n\t\t\t\t\tif (arg.Length != 0) {\n\t\t\t\t\t\tError_EndLineExpected ();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (ifstack.Count == 0)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tint state = ifstack.Peek ();\n\t\t\t\t\treturn (state & TAKING) != 0;\n\t\t\t\t}\n\n\t\t\tcase PreprocessorDirective.Elif:\n\t\t\t\tif (ifstack == null || ifstack.Count == 0){\n\t\t\t\t\tError_UnexpectedDirective (\"no #if for this #elif\");\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tint state = ifstack.Pop ();\n\n\t\t\t\t\tif ((state & REGION) != 0) {\n\t\t\t\t\t\tReport.Error (1038, Location, \"#endregion directive expected\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((state & ELSE_SEEN) != 0){\n\t\t\t\t\t\tError_UnexpectedDirective (\"#elif not valid after #else\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((state & TAKING) != 0) {\n\t\t\t\t\t\tsbag.SkipIf ();\n\t\t\t\t\t\tifstack.Push (0);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (eval (arg) && ((state & PARENT_TAKING) != 0)){\n\t\t\t\t\t\tifstack.Push (state | TAKING);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tsbag.SkipIf ();\n\t\t\t\t\tifstack.Push (state);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\tcase PreprocessorDirective.Else:\n\t\t\t\tif (ifstack == null || ifstack.Count == 0){\n\t\t\t\t\tError_UnexpectedDirective (\"no #if for this #else\");\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tint state = ifstack.Peek ();\n\n\t\t\t\t\tif ((state & REGION) != 0) {\n\t\t\t\t\t\tReport.Error (1038, Location, \"#endregion directive expected\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((state & ELSE_SEEN) != 0){\n\t\t\t\t\t\tError_UnexpectedDirective (\"#else within #else\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tifstack.Pop ();\n\n\t\t\t\t\tif (arg.Length != 0) {\n\t\t\t\t\t\tError_EndLineExpected ();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tbool ret = false;\n\t\t\t\t\tif ((state & PARENT_TAKING) != 0) {\n\t\t\t\t\t\tret = (state & TAKING) == 0;\n\t\t\t\t\t\n\t\t\t\t\t\tif (ret)\n\t\t\t\t\t\t\tstate |= TAKING;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tstate &= ~TAKING;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tifstack.Push (state | ELSE_SEEN);\n\t\t\t\t\t\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\tcase PreprocessorDirective.Define:\n\t\t\t\tif (any_token_seen){\n\t\t\t\t\tif (caller_is_taking)\n\t\t\t\t\t\tError_TokensSeen ();\n\t\t\t\t\treturn caller_is_taking;\n\t\t\t\t}\n\t\t\t\tPreProcessDefinition (true, arg, caller_is_taking);\n\t\t\t\treturn caller_is_taking;\n\n\t\t\tcase PreprocessorDirective.Undef:\n\t\t\t\tif (any_token_seen){\n\t\t\t\t\tif (caller_is_taking)\n\t\t\t\t\t\tError_TokensSeen ();\n\t\t\t\t\treturn caller_is_taking;\n\t\t\t\t}\n\t\t\t\tPreProcessDefinition (false, arg, caller_is_taking);\n\t\t\t\treturn caller_is_taking;\n\n\t\t\tcase PreprocessorDirective.Invalid:\n\t\t\t\tReport.Error (1024, Location, \"Wrong preprocessor directive\");\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// These are only processed if we are in a `taking' block\n\t\t\t//\n\t\t\tif (!caller_is_taking)\n\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\tswitch (directive){\n\t\t\tcase PreprocessorDirective.Error:\n\t\t\t\tReport.Error (1029, Location, \"#error: '{0}'\", arg);\n\t\t\t\treturn true;\n\n\t\t\tcase PreprocessorDirective.Warning:\n\t\t\t\tReport.Warning (1030, 1, Location, \"#warning: `{0}'\", arg);\n\t\t\t\treturn true;\n\n\t\t\tcase PreprocessorDirective.Pragma:\n\t\t\t\tif (context.Settings.Version == LanguageVersion.ISO_1) {\n\t\t\t\t\tReport.FeatureIsNotAvailable (context, Location, \"#pragma\");\n\t\t\t\t}\n\n\t\t\t\tParsePragmaDirective ();\n\t\t\t\treturn true;\n\n\t\t\tcase PreprocessorDirective.Line:\n\t\t\t\tLocation loc = Location;\n\t\t\t\tif (!PreProcessLine ())\n\t\t\t\t\tReport.Error (1576, loc, \"The line number specified for #line directive is missing or invalid\");\n\n\t\t\t\treturn caller_is_taking;\n\t\t\t}\n\n\t\t\tthrow new NotImplementedException (directive.ToString ());\n\t\t}\n\n\t\tprivate int consume_string (bool quoted)\n\t\t{\n\t\t\tint c;\n\t\t\tint pos = 0;\n\t\t\tLocation start_location = Location;\n\t\t\tif (quoted) {\n\t\t\t\tstart_location = start_location - 1;\n\t\t\t\trecordNewLine = false;\n\t\t\t}\n\n#if FULL_AST\n\t\t\tint reader_pos = reader.Position;\n#endif\n\n\t\t\twhile (true){\n\t\t\t\t// Cannot use get_char because of \\r in quoted strings\n\t\t\t\tif (putback_char != -1) {\n\t\t\t\t\tc = putback_char;\n\t\t\t\t\tputback_char = -1;\n\t\t\t\t} else {\n\t\t\t\t\tc = reader.Read ();\n\t\t\t\t}\n\n\t\t\t\tif (c == '\"') {\n\t\t\t\t\t++col;\n\n\t\t\t\t\tif (quoted && peek_char () == '\"') {\n\t\t\t\t\t\tif (pos == value_builder.Length)\n\t\t\t\t\t\t\tArray.Resize (ref value_builder, pos * 2);\n\n\t\t\t\t\t\tvalue_builder[pos++] = (char) c;\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tstring s;\n\t\t\t\t\tif (pos == 0)\n\t\t\t\t\t\ts = string.Empty;\n\t\t\t\t\telse if (pos <= 4)\n\t\t\t\t\t\ts = InternIdentifier (value_builder, pos);\n\t\t\t\t\telse\n\t\t\t\t\t\ts = new string (value_builder, 0, pos);\n\n\t\t\t\t\tILiteralConstant res = new StringLiteral (context.BuiltinTypes, s, start_location);\n\t\t\t\t\tval = res;\n#if FULL_AST\n\t\t\t\t\tres.ParsedValue = quoted ?\n\t\t\t\t\t\treader.ReadChars (reader_pos - 2, reader.Position - 1) :\n\t\t\t\t\t\treader.ReadChars (reader_pos - 1, reader.Position);\n#endif\n\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\treturn Token.LITERAL;\n\t\t\t\t}\n\n\t\t\t\tif (c == '\\n' || c == UnicodeLS || c == UnicodePS) {\n\t\t\t\t\tif (!quoted) {\n\t\t\t\t\t\tReport.Error (1010, Location, \"Newline in constant\");\n\n\n\t\t\t\t\t\t// Don't add \\r to string literal\n\t\t\t\t\t\tif (pos > 1 && value_builder [pos - 1] == '\\r') {\n\t\t\t\t\t\t\tadvance_line (SpecialsBag.NewLine.Windows);\n\t\t\t\t\t\t\t--pos;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tadvance_line (SpecialsBag.NewLine.Unix);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tval = new StringLiteral (context.BuiltinTypes, new string (value_builder, 0, pos), start_location);\n\t\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\t\treturn Token.LITERAL;\n\t\t\t\t\t}\n\n\t\t\t\t\tadvance_line (SpecialsBag.NewLine.Unix);\n\t\t\t\t} else if (c == '\\\\' && !quoted) {\n\t\t\t\t\t++col;\n\t\t\t\t\tint surrogate;\n\t\t\t\t\tc = escape (c, out surrogate);\n\t\t\t\t\tif (c == -1) {\n\t\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\t\treturn Token.ERROR;\n\t\t\t\t\t}\n\t\t\t\t\tif (surrogate != 0) {\n\t\t\t\t\t\tif (pos == value_builder.Length)\n\t\t\t\t\t\t\tArray.Resize (ref value_builder, pos * 2);\n\n\t\t\t\t\t\tvalue_builder[pos++] = (char) c;\n\t\t\t\t\t\tc = surrogate;\n\t\t\t\t\t}\n\t\t\t\t} else if (c == -1) {\n\t\t\t\t\tReport.Error (1039, Location, \"Unterminated string literal\");\n\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\treturn Token.EOF;\n\t\t\t\t} else {\n\t\t\t\t\t++col;\n\t\t\t\t}\n\n\t\t\t\tif (pos == value_builder.Length)\n\t\t\t\t\tArray.Resize (ref value_builder, pos * 2);\n\n\t\t\t\tvalue_builder[pos++] = (char) c;\n\t\t\t}\n\t\t\trecordNewLine = true;\n\t\t}\n\n\t\tprivate int consume_identifier (int s)\n\t\t{\n\t\t\tint res = consume_identifier (s, false);\n\n\t\t\tif (doc_state == XmlCommentState.Allowed)\n\t\t\t\tdoc_state = XmlCommentState.NotAllowed;\n\t\t\tstartsLine = false;\n\t\t\treturn res;\n\t\t}\n\n\t\tint consume_identifier (int c, bool quoted) \n\t\t{\n\t\t\t//\n\t\t\t// This method is very performance sensitive. It accounts\n\t\t\t// for approximately 25% of all parser time\n\t\t\t//\n\n\t\t\tint pos = 0;\n\t\t\tint column = col;\n\t\t\tif (quoted)\n\t\t\t\t--column;\n\n\t\t\tif (c == '\\\\') {\n\t\t\t\tint surrogate;\n\t\t\t\tc = escape (c, out surrogate);\n\t\t\t\tif (surrogate != 0) {\n\t\t\t\t\tid_builder [pos++] = (char) c;\n\t\t\t\t\tc = surrogate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tid_builder [pos++] = (char) c;\n\n\t\t\ttry {\n\t\t\t\twhile (true) {\n\t\t\t\t\tc = reader.Read ();\n\n\t\t\t\t\tif ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || (c >= '0' && c <= '9')) {\n\t\t\t\t\t\tid_builder [pos++] = (char) c;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (c < 0x80) {\n\t\t\t\t\t\tif (c == '\\\\') {\n\t\t\t\t\t\t\tint surrogate;\n\t\t\t\t\t\t\tc = escape (c, out surrogate);\n\t\t\t\t\t\t\tif (is_identifier_part_character ((char) c))\n\t\t\t\t\t\t\t\tid_builder[pos++] = (char) c;\n\n\t\t\t\t\t\t\tif (surrogate != 0) {\n\t\t\t\t\t\t\t\tc = surrogate;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (is_identifier_part_character_slow_part ((char) c)) {\n\t\t\t\t\t\tid_builder [pos++] = (char) c;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tputback_char = c;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (IndexOutOfRangeException) {\n\t\t\t\tReport.Error (645, Location, \"Identifier too long (limit is 512 chars)\");\n\t\t\t\t--pos;\n\t\t\t\tcol += pos;\n\t\t\t}\n\n\t\t\tcol += pos - 1;\n\n\t\t\t//\n\t\t\t// Optimization: avoids doing the keyword lookup\n\t\t\t// on uppercase letters\n\t\t\t//\n\t\t\tif (id_builder [0] >= '_' && !quoted) {\n\t\t\t\tint keyword = GetKeyword (id_builder, pos);\n\t\t\t\tif (keyword != -1) {\n\t\t\t\t\tval = ltb.Create (keyword == Token.AWAIT ? \"await\" : null, current_source, ref_line, column);\n\t\t\t\t\treturn keyword;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstring s = InternIdentifier (id_builder, pos);\n#if FULL_AST\n\t\t\tif (quoted) {\n\t\t\t\tval = ltb.Create (\"@\" + s, current_source, ref_line, column - 1);\n\t\t\t} else {\n\t\t\t\tval = ltb.Create (s, current_source, ref_line, column);\n\t\t\t}\n#else\n\t\t\tval = ltb.Create (s, current_source, ref_line, column);\n#endif\n\t\t\tif (quoted && parsing_attribute_section)\n\t\t\t\tAddEscapedIdentifier (((LocatedToken) val).Location);\n\n\t\t\treturn Token.IDENTIFIER;\n\t\t}\n\n\t\tstring InternIdentifier (char[] charBuffer, int length)\n\t\t{\n\t\t\t//\n\t\t\t// Keep identifiers in an array of hashtables to avoid needless\n\t\t\t// allocations\n\t\t\t//\n\t\t\tvar identifiers_group = identifiers [length];\n\t\t\tstring s;\n\t\t\tif (identifiers_group != null) {\n\t\t\t\tif (identifiers_group.TryGetValue (charBuffer, out s)) {\n\t\t\t\t\treturn s;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// TODO: this should be number of files dependant\n\t\t\t\t// corlib compilation peaks at 1000 and System.Core at 150\n\t\t\t\tint capacity = length > 20 ? 10 : 100;\n\t\t\t\tidentifiers_group = new Dictionary<char[], string> (capacity, new IdentifiersComparer (length));\n\t\t\t\tidentifiers [length] = identifiers_group;\n\t\t\t}\n\n\t\t\tchar[] chars = new char[length];\n\t\t\tArray.Copy (charBuffer, chars, length);\n\n\t\t\ts = new string (charBuffer, 0, length);\n\t\t\tidentifiers_group.Add (chars, s);\n\n\t\t\treturn s;\n\t\t}\n\t\t\n\t\tpublic int xtoken ()\n\t\t{\n\t\t\tint d, c;\n\n\t\t\t// Whether we have seen comments on the current line\n\t\t\tbool comments_seen = false;\n\t\t\twhile ((c = get_char ()) != -1) {\n\t\t\t\tswitch (c) {\n\t\t\t\tcase '\\t':\n\t\t\t\t\tcol = ((col - 1 + tab_size) / tab_size) * tab_size;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ' ':\n\t\t\t\tcase '\\f':\n\t\t\t\tcase '\\v':\n\t\t\t\tcase 0xa0:\n\t\t\t\tcase 0:\n\t\t\t\tcase 0xFEFF:\t// Ignore BOM anywhere in the file\n\t\t\t\t\tcontinue;\n\n/*\t\t\t\tThis is required for compatibility with .NET\n\t\t\t\tcase 0xEF:\n\t\t\t\t\tif (peek_char () == 0xBB) {\n\t\t\t\t\t\tPushPosition ();\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\tif (get_char () == 0xBF)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n*/\n\t\t\t\tcase '\\\\':\n\t\t\t\t\ttokens_seen = true;\n\t\t\t\t\treturn consume_identifier (c);\n\n\t\t\t\tcase '{':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\treturn Token.OPEN_BRACE;\n\t\t\t\tcase '}':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\treturn Token.CLOSE_BRACE;\n\t\t\t\tcase '[':\n\t\t\t\t\t// To block doccomment inside attribute declaration.\n\t\t\t\t\tif (doc_state == XmlCommentState.Allowed)\n\t\t\t\t\t\tdoc_state = XmlCommentState.NotAllowed;\n\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\n\t\t\t\t\tif (parsing_block == 0 || lambda_arguments_parsing)\n\t\t\t\t\t\treturn Token.OPEN_BRACKET;\n\n\t\t\t\t\tint next = peek_char ();\n\t\t\t\t\tswitch (next) {\n\t\t\t\t\tcase ']':\n\t\t\t\t\tcase ',':\n\t\t\t\t\t\treturn Token.OPEN_BRACKET;\n\n\t\t\t\t\tcase ' ':\n\t\t\t\t\tcase '\\f':\n\t\t\t\t\tcase '\\v':\n\t\t\t\t\tcase '\\r':\n\t\t\t\t\tcase '\\n':\n\t\t\t\t\tcase UnicodeLS:\n\t\t\t\t\tcase UnicodePS:\n\t\t\t\t\tcase '/':\n\t\t\t\t\t\tnext = peek_token ();\n\t\t\t\t\t\tif (next == Token.COMMA || next == Token.CLOSE_BRACKET)\n\t\t\t\t\t\t\treturn Token.OPEN_BRACKET;\n\n\t\t\t\t\t\treturn Token.OPEN_BRACKET_EXPR;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Token.OPEN_BRACKET_EXPR;\n\t\t\t\t\t}\n\t\t\t\tcase ']':\n\t\t\t\t\tltb.CreateOptional (current_source, ref_line, col, ref val);\n\t\t\t\t\treturn Token.CLOSE_BRACKET;\n\t\t\t\tcase '(':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\t//\n\t\t\t\t\t// An expression versions of parens can appear in block context only\n\t\t\t\t\t//\n\t\t\t\t\tif (parsing_block != 0 && !lambda_arguments_parsing) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optmize most common case where we know that parens\n\t\t\t\t\t\t// is not special\n\t\t\t\t\t\t//\n\t\t\t\t\t\tswitch (current_token) {\n\t\t\t\t\t\tcase Token.IDENTIFIER:\n\t\t\t\t\t\tcase Token.IF:\n\t\t\t\t\t\tcase Token.FOR:\n\t\t\t\t\t\tcase Token.FOREACH:\n\t\t\t\t\t\tcase Token.TYPEOF:\n\t\t\t\t\t\tcase Token.WHILE:\n\t\t\t\t\t\tcase Token.SWITCH:\n\t\t\t\t\t\tcase Token.USING:\n\t\t\t\t\t\tcase Token.DEFAULT:\n\t\t\t\t\t\tcase Token.DELEGATE:\n\t\t\t\t\t\tcase Token.OP_GENERICS_GT:\n\t\t\t\t\t\t\treturn Token.OPEN_PARENS;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Optimize using peek\n\t\t\t\t\t\tint xx = peek_char ();\n\t\t\t\t\t\tswitch (xx) {\n\t\t\t\t\t\tcase '(':\n\t\t\t\t\t\tcase '\\'':\n\t\t\t\t\t\tcase '\"':\n\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\treturn Token.OPEN_PARENS;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlambda_arguments_parsing = true;\n\t\t\t\t\t\tPushPosition ();\n\t\t\t\t\t\td = TokenizeOpenParens ();\n\t\t\t\t\t\tPopPosition ();\n\t\t\t\t\t\tlambda_arguments_parsing = false;\n\t\t\t\t\t\treturn d;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Token.OPEN_PARENS;\n\t\t\t\tcase ')':\n\t\t\t\t\tltb.CreateOptional (current_source, ref_line, col, ref val);\n\t\t\t\t\treturn Token.CLOSE_PARENS;\n\t\t\t\tcase ',':\n\t\t\t\t\tltb.CreateOptional (current_source, ref_line, col, ref val);\n\t\t\t\t\treturn Token.COMMA;\n\t\t\t\tcase ';':\n\t\t\t\t\tltb.CreateOptional (current_source, ref_line, col, ref val);\n\t\t\t\t\treturn Token.SEMICOLON;\n\t\t\t\tcase '~':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\treturn Token.TILDE;\n\t\t\t\tcase '?':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\treturn TokenizePossibleNullableType ();\n\t\t\t\tcase '<':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\tif (parsing_generic_less_than++ > 0)\n\t\t\t\t\t\treturn Token.OP_GENERICS_LT;\n\n\t\t\t\t\treturn TokenizeLessThan ();\n\n\t\t\t\tcase '>':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\td = peek_char ();\n\n\t\t\t\t\tif (d == '=') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_GE;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (parsing_generic_less_than > 1 || (parsing_generic_less_than == 1 && d != '>')) {\n\t\t\t\t\t\tparsing_generic_less_than--;\n\t\t\t\t\t\treturn Token.OP_GENERICS_GT;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (d == '>') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\td = peek_char ();\n\n\t\t\t\t\t\tif (d == '=') {\n\t\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\t\treturn Token.OP_SHIFT_RIGHT_ASSIGN;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Token.OP_SHIFT_RIGHT;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Token.OP_GT;\n\n\t\t\t\tcase '+':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\td = peek_char ();\n\t\t\t\t\tif (d == '+') {\n\t\t\t\t\t\td = Token.OP_INC;\n\t\t\t\t\t} else if (d == '=') {\n\t\t\t\t\t\td = Token.OP_ADD_ASSIGN;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn Token.PLUS;\n\t\t\t\t\t}\n\t\t\t\t\tget_char ();\n\t\t\t\t\treturn d;\n\n\t\t\t\tcase '-':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\td = peek_char ();\n\t\t\t\t\tif (d == '-') {\n\t\t\t\t\t\td = Token.OP_DEC;\n\t\t\t\t\t} else if (d == '=')\n\t\t\t\t\t\td = Token.OP_SUB_ASSIGN;\n\t\t\t\t\telse if (d == '>')\n\t\t\t\t\t\td = Token.OP_PTR;\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn Token.MINUS;\n\t\t\t\t\t}\n\t\t\t\t\tget_char ();\n\t\t\t\t\treturn d;\n\n\t\t\t\tcase '!':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\tif (peek_char () == '='){\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_NE;\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.BANG;\n\n\t\t\t\tcase '=':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\td = peek_char ();\n\t\t\t\t\tif (d == '=') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_EQ;\n\t\t\t\t\t}\n\t\t\t\t\tif (d == '>') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.ARROW;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Token.ASSIGN;\n\n\t\t\t\tcase '&':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\td = peek_char ();\n\t\t\t\t\tif (d == '&') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_AND;\n\t\t\t\t\t}\n\t\t\t\t\tif (d == '=') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_AND_ASSIGN;\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.BITWISE_AND;\n\n\t\t\t\tcase '|':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\td = peek_char ();\n\t\t\t\t\tif (d == '|') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_OR;\n\t\t\t\t\t}\n\t\t\t\t\tif (d == '=') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_OR_ASSIGN;\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.BITWISE_OR;\n\n\t\t\t\tcase '*':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\tif (peek_char () == '='){\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_MULT_ASSIGN;\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.STAR;\n\n\t\t\t\tcase '/':\n\t\t\t\t\td = peek_char ();\n\t\t\t\t\tif (d == '='){\n\t\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_DIV_ASSIGN;\n\t\t\t\t\t}\n\t\t\t\t\t// Handle double-slash comments.\n\t\t\t\t\tif (d == '/') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\tif (doc_processing) {\n\t\t\t\t\t\t\tif (peek_char () == '/') {\n\t\t\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\t\t\t// Don't allow ////.\n\t\t\t\t\t\t\t\tif ((d = peek_char ()) != '/') {\n\t\t\t\t\t\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\t\t\t\t\t\tsbag.PushCommentChar (d);\n\t\t\t\t\t\t\t\t\tif (doc_state == XmlCommentState.Allowed)\n\t\t\t\t\t\t\t\t\t\thandle_one_line_xml_comment ();\n\t\t\t\t\t\t\t\t\telse if (doc_state == XmlCommentState.NotAllowed)\n\t\t\t\t\t\t\t\t\t\tWarningMisplacedComment (Location - 3);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (xml_comment_buffer.Length > 0)\n\t\t\t\t\t\t\t\t\tdoc_state = XmlCommentState.NotAllowed;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbool isDoc = peek_char () == '/';\n\t\t\t\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\t\t\t\tsbag.StartComment (isDoc ? SpecialsBag.CommentType.Documentation : SpecialsBag.CommentType.Single, startsLine, line, col - 1);\n\t\t\t\t\t\t\tif (isDoc)\n\t\t\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\td = peek_char ();\n\t\t\t\t\t\tint endLine = line, endCol = col;\n\t\t\t\t\t\twhile ((d = get_char ()) != -1 && (d != '\\n') && d != '\\r' && d != UnicodePS && d != UnicodeLS) {\n\t\t\t\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\t\t\t\tsbag.PushCommentChar (d);\n\t\t\t\t\t\t\tendLine = line;\n\t\t\t\t\t\t\tendCol = col;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\t\t\tsbag.EndComment (endLine, endCol + 1);\n\t\t\t\t\t\tany_token_seen |= tokens_seen;\n\t\t\t\t\t\ttokens_seen = false;\n\t\t\t\t\t\tcomments_seen = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if (d == '*'){\n\t\t\t\t\t\tif (position_stack.Count == 0) {\n\t\t\t\t\t\t\tsbag.StartComment (SpecialsBag.CommentType.Multi, startsLine, line, col);\n\t\t\t\t\t\t\trecordNewLine = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\tbool docAppend = false;\n\t\t\t\t\t\tif (doc_processing && peek_char () == '*') {\n\t\t\t\t\t\t\tint ch = get_char ();\n\t\t\t\t\t\t\t// But when it is /**/, just do nothing.\n\t\t\t\t\t\t\tif (peek_char () == '/') {\n\t\t\t\t\t\t\t\tch = get_char ();\n\t\t\t\t\t\t\t\tif (position_stack.Count == 0) {\n\t\t\t\t\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\t\t\t\t\tsbag.EndComment (line, col + 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\t\t\t\t\tsbag.PushCommentChar (ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (doc_state == XmlCommentState.Allowed)\n\t\t\t\t\t\t\t\tdocAppend = true;\n\t\t\t\t\t\t\telse if (doc_state == XmlCommentState.NotAllowed) {\n\t\t\t\t\t\t\t\tWarningMisplacedComment (Location - 2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tint current_comment_start = 0;\n\t\t\t\t\t\tif (docAppend) {\n\t\t\t\t\t\t\tcurrent_comment_start = xml_comment_buffer.Length;\n\t\t\t\t\t\t\txml_comment_buffer.Append (Environment.NewLine);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twhile ((d = get_char ()) != -1){\n\t\t\t\t\t\t\tif (d == '*' && peek_char () == '/'){\n\t\t\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\t\t\tif (position_stack.Count == 0) {\n\t\t\t\t\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\t\t\t\t\tsbag.EndComment (line, col + 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcomments_seen = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\t\t\t\t\tsbag.PushCommentChar (d);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (docAppend)\n\t\t\t\t\t\t\t\txml_comment_buffer.Append ((char) d);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (d == '\\n' || d == UnicodeLS || d == UnicodePS){\n\t\t\t\t\t\t\t\tany_token_seen |= tokens_seen;\n\t\t\t\t\t\t\t\ttokens_seen = false;\n\t\t\t\t\t\t\t\t// \n\t\t\t\t\t\t\t\t// Reset 'comments_seen' just to be consistent.\n\t\t\t\t\t\t\t\t// It doesn't matter either way, here.\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\tcomments_seen = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!comments_seen)\n\t\t\t\t\t\t\tReport.Error (1035, Location, \"End-of-file found, '*/' expected\");\n\n\t\t\t\t\t\tif (docAppend)\n\t\t\t\t\t\t\tupdate_formatted_doc_comment (current_comment_start);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\treturn Token.DIV;\n\n\t\t\t\tcase '%':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\tif (peek_char () == '='){\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_MOD_ASSIGN;\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.PERCENT;\n\n\t\t\t\tcase '^':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\tif (peek_char () == '='){\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.OP_XOR_ASSIGN;\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.CARRET;\n\n\t\t\t\tcase ':':\n\t\t\t\t\tval = ltb.Create (current_source, ref_line, col);\n\t\t\t\t\tif (peek_char () == ':') {\n\t\t\t\t\t\tget_char ();\n\t\t\t\t\t\treturn Token.DOUBLE_COLON;\n\t\t\t\t\t}\n\t\t\t\t\treturn Token.COLON;\n\n\t\t\t\tcase '0': case '1': case '2': case '3': case '4':\n\t\t\t\tcase '5': case '6': case '7': case '8': case '9':\n\t\t\t\t\ttokens_seen = true;\n\t\t\t\t\treturn is_number (c, false);\n\n\t\t\t\tcase '\\n': // white space\n\t\t\t\tcase UnicodeLS:\n\t\t\t\tcase UnicodePS:\n\t\t\t\t\tany_token_seen |= tokens_seen;\n\t\t\t\t\ttokens_seen = false;\n\t\t\t\t\tcomments_seen = false;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '.':\n\t\t\t\t\ttokens_seen = true;\n\t\t\t\t\td = peek_char ();\n\t\t\t\t\tif (d >= '0' && d <= '9')\n\t\t\t\t\t\treturn is_number (c, true);\n\n\t\t\t\t\tltb.CreateOptional (current_source, ref_line, col, ref val);\n\t\t\t\t\treturn Token.DOT;\n\t\t\t\t\n\t\t\t\tcase '#':\n\t\t\t\t\tif (tokens_seen || comments_seen) {\n\t\t\t\t\t\tEror_WrongPreprocessorLocation();\n\t\t\t\t\t\treturn Token.ERROR;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif (ParsePreprocessingDirective(true))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tsbag.StartComment(SpecialsBag.CommentType.InactiveCode, false, line, 1);\n\t\t\t\t\trecordNewLine = false;\n\t\t\t\t\tbool directive_expected = false;\n\t\t\t\t\twhile ((c = get_char ()) != -1) {\n\t\t\t\t\t\tif (col == 1) {\n\t\t\t\t\t\t\tdirective_expected = true;\n\t\t\t\t\t\t} else if (!directive_expected) {\n\t\t\t\t\t\t\t// TODO: Implement comment support for disabled code and uncomment this code\n//\t\t\t\t\t\t\tif (c == '#') {\n//\t\t\t\t\t\t\t\tEror_WrongPreprocessorLocation ();\n//\t\t\t\t\t\t\t\treturn Token.ERROR;\n//\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (c != '#')\n\t\t\t\t\t\t\t\tsbag.PushCommentChar (c);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (c == ' ' || c == '\\t' || c == '\\n' || c == '\\f' || c == '\\v' || c == UnicodeLS || c == UnicodePS) {\n\t\t\t\t\t\t\tsbag.PushCommentChar (c);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (c == '#') {\n\t\t\t\t\t\t\tvar oldNL = recordNewLine;\n\t\t\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\t\t\tvar continueNormalLexing = ParsePreprocessingDirective(false);\n\t\t\t\t\t\t\trecordNewLine = oldNL;\n\t\t\t\t\t\t\tif (continueNormalLexing)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tsbag.StartComment(SpecialsBag.CommentType.InactiveCode, false, line, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsbag.PushCommentChar (c);\n\t\t\t\t\t\tdirective_expected = false;\n\t\t\t\t\t}\n\t\t\t\t\trecordNewLine = true;\n\t\t\t\t\tsbag.EndComment (line, col);\n\t\t\t\t\tif (c != -1) {\n\t\t\t\t\t\ttokens_seen = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Token.EOF;\n\t\t\t\t\t\t\t\t\n\t\t\t\tcase '\"':\n\t\t\t\t\treturn consume_string (false);\n\n\t\t\t\tcase '\\'':\n\t\t\t\t\treturn TokenizeBackslash ();\n\t\t\t\t\n\t\t\t\tcase '@':\n\t\t\t\t\tc = get_char ();\n\t\t\t\t\tif (c == '\"') {\n\t\t\t\t\t\ttokens_seen = true;\n\t\t\t\t\t\treturn consume_string (true);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (is_identifier_start_character (c)){\n\t\t\t\t\t\treturn consume_identifier (c, true);\n\t\t\t\t\t}\n\n\t\t\t\t\tReport.Error (1646, Location, \"Keyword, identifier, or string expected after verbatim specifier: @\");\n\t\t\t\t\treturn Token.ERROR;\n\n\t\t\t\tcase EvalStatementParserCharacter:\n\t\t\t\t\treturn Token.EVAL_STATEMENT_PARSER;\n\t\t\t\tcase EvalCompilationUnitParserCharacter:\n\t\t\t\t\treturn Token.EVAL_COMPILATION_UNIT_PARSER;\n\t\t\t\tcase EvalUsingDeclarationsParserCharacter:\n\t\t\t\t\treturn Token.EVAL_USING_DECLARATIONS_UNIT_PARSER;\n\t\t\t\tcase DocumentationXref:\n\t\t\t\t\treturn Token.DOC_SEE;\n\t\t\t\t}\n\n\t\t\t\tif (is_identifier_start_character (c)) {\n\t\t\t\t\ttokens_seen = true;\n\t\t\t\t\treturn consume_identifier (c);\n\t\t\t\t}\n\n\t\t\t\tif (char.IsWhiteSpace ((char) c))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tReport.Error (1056, Location, \"Unexpected character `{0}'\", ((char) c).ToString ());\n\t\t\t}\n\n\t\t\tif (CompleteOnEOF){\n\t\t\t\tif (generated)\n\t\t\t\t\treturn Token.COMPLETE_COMPLETION;\n\t\t\t\t\n\t\t\t\tgenerated = true;\n\t\t\t\treturn Token.GENERATE_COMPLETION;\n\t\t\t}\n\t\t\t\n\n\t\t\treturn Token.EOF;\n\t\t}\n\n\t\tint TokenizeBackslash ()\n\t\t{\n#if FULL_AST\n\t\t\tint read_start = reader.Position;\n#endif\n\t\t\tLocation start_location = Location;\n\t\t\tint c = get_char ();\n\t\t\ttokens_seen = true;\n\t\t\tif (c == '\\'') {\n\t\t\t\tval = new CharLiteral (context.BuiltinTypes, (char) c, start_location);\n\t\t\t\tReport.Error (1011, start_location, \"Empty character literal\");\n\t\t\t\treturn Token.LITERAL;\n\t\t\t}\n\n\t\t\tif (c == '\\n' || c == UnicodeLS || c == UnicodePS) {\n\t\t\t\tReport.Error (1010, start_location, \"Newline in constant\");\n\t\t\t\treturn Token.ERROR;\n\t\t\t}\n\n\t\t\tint d;\n\t\t\tc = escape (c, out d);\n\t\t\tif (c == -1)\n\t\t\t\treturn Token.ERROR;\n\t\t\tif (d != 0)\n\t\t\t\tthrow new NotImplementedException ();\n\n\t\t\tILiteralConstant res = new CharLiteral (context.BuiltinTypes, (char) c, start_location);\n\t\t\tval = res;\n\t\t\tc = get_char ();\n\n\t\t\tif (c != '\\'') {\n\t\t\t\tReport.Error (1012, start_location, \"Too many characters in character literal\");\n\n\t\t\t\t// Try to recover, read until newline or next \"'\"\n\t\t\t\twhile ((c = get_char ()) != -1) {\n\t\t\t\t\tif (c == '\\n' || c == '\\'' || c == UnicodeLS || c == UnicodePS)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n#if FULL_AST\n\t\t\tres.ParsedValue = reader.ReadChars (read_start - 1, reader.Position);\n#endif\n\n\t\t\treturn Token.LITERAL;\n\t\t}\n\n\t\tint TokenizeLessThan ()\n\t\t{\n\t\t\tint d;\n\n\t\t\t// Save current position and parse next token.\n\t\t\tPushPosition ();\n\t\t\tint generic_dimension = 0;\n\t\t\tif (parse_less_than (ref generic_dimension)) {\n\t\t\t\tif (parsing_generic_declaration && (parsing_generic_declaration_doc || token () != Token.DOT)) {\n\t\t\t\t\td = Token.OP_GENERICS_LT_DECL;\n\t\t\t\t} else {\n\t\t\t\t\tif (generic_dimension > 0) {\n\t\t\t\t\t\tval = generic_dimension;\n\t\t\t\t\t\tDiscardPosition ();\n\t\t\t\t\t\treturn Token.GENERIC_DIMENSION;\n\t\t\t\t\t}\n\n\t\t\t\t\td = Token.OP_GENERICS_LT;\n\t\t\t\t}\n\t\t\t\tPopPosition ();\n\t\t\t\treturn d;\n\t\t\t}\n\n\t\t\tPopPosition ();\n\t\t\tparsing_generic_less_than = 0;\n\n\t\t\td = peek_char ();\n\t\t\tif (d == '<') {\n\t\t\t\tget_char ();\n\t\t\t\td = peek_char ();\n\n\t\t\t\tif (d == '=') {\n\t\t\t\t\tget_char ();\n\t\t\t\t\treturn Token.OP_SHIFT_LEFT_ASSIGN;\n\t\t\t\t}\n\t\t\t\treturn Token.OP_SHIFT_LEFT;\n\t\t\t}\n\n\t\t\tif (d == '=') {\n\t\t\t\tget_char ();\n\t\t\t\treturn Token.OP_LE;\n\t\t\t}\n\t\t\treturn Token.OP_LT;\n\t\t}\n\n\t\t//\n\t\t// Handles one line xml comment\n\t\t//\n\t\tprivate void handle_one_line_xml_comment ()\n\t\t{\n\t\t\tint c;\n\t\t\twhile ((c = peek_char ()) == ' ') {\n\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\tsbag.PushCommentChar (c);\n\t\t\t\tget_char (); // skip heading whitespaces.\n\t\t\t}\n\t\t\twhile ((c = peek_char ()) != -1 && c != '\\n' && c != '\\r') {\n\t\t\t\tif (position_stack.Count == 0)\n\t\t\t\t\tsbag.PushCommentChar (c);\n\t\t\t\txml_comment_buffer.Append ((char) get_char ());\n\t\t\t}\n\t\t\tif (c == '\\r' || c == '\\n')\n\t\t\t\txml_comment_buffer.Append (Environment.NewLine);\n\t\t}\n\n\t\t//\n\t\t// Remove heading \"*\" in Javadoc-like xml documentation.\n\t\t//\n\t\tprivate void update_formatted_doc_comment (int current_comment_start)\n\t\t{\n\t\t\tint length = xml_comment_buffer.Length - current_comment_start;\n\t\t\tstring [] lines = xml_comment_buffer.ToString (\n\t\t\t\tcurrent_comment_start,\n\t\t\t\tlength).Replace (\"\\r\", \"\").Split ('\\n');\n\t\t\t\n\t\t\t// The first line starts with /**, thus it is not target\n\t\t\t// for the format check.\n\t\t\tfor (int i = 1; i < lines.Length; i++) {\n\t\t\t\tstring s = lines [i];\n\t\t\t\tint idx = s.IndexOf ('*');\n\t\t\t\tstring head = null;\n\t\t\t\tif (idx < 0) {\n\t\t\t\t\tif (i < lines.Length - 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\thead = s;\n\t\t\t\t} else\n\t\t\t\t\thead = s.Substring (0, idx);\n\t\t\t\tforeach (char c in head)\n\t\t\t\t\tif (c != ' ')\n\t\t\t\t\t\treturn;\n\t\t\t\tlines [i] = s.Substring (idx + 1);\n\t\t\t}\n\t\t\txml_comment_buffer.Remove (current_comment_start, length);\n\t\t\txml_comment_buffer.Insert (current_comment_start, String.Join (Environment.NewLine, lines));\n\t\t}\n\n\t\t//\n\t\t// Checks if there was incorrect doc comments and raise\n\t\t// warnings.\n\t\t//\n\t\tpublic void check_incorrect_doc_comment ()\n\t\t{\n\t\t\tif (xml_comment_buffer.Length > 0)\n\t\t\t\tWarningMisplacedComment (Location);\n\t\t}\n\n\t\t//\n\t\t// Consumes the saved xml comment lines (if any)\n\t\t// as for current target member or type.\n\t\t//\n\t\tpublic string consume_doc_comment ()\n\t\t{\n\t\t\tif (xml_comment_buffer.Length > 0) {\n\t\t\t\tstring ret = xml_comment_buffer.ToString ();\n\t\t\t\treset_doc_comment ();\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tvoid reset_doc_comment ()\n\t\t{\n\t\t\txml_comment_buffer.Length = 0;\n\t\t}\n\n\t\tpublic void cleanup ()\n\t\t{\n\t\t\tif (ifstack != null && ifstack.Count >= 1) {\n\t\t\t\tint state = ifstack.Pop ();\n\t\t\t\tif ((state & REGION) != 0)\n\t\t\t\t\tReport.Error (1038, Location, \"#endregion directive expected\");\n\t\t\t\telse \n\t\t\t\t\tReport.Error (1027, Location, \"Expected `#endif' directive\");\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Indicates whether it accepts XML documentation or not.\n\t//\n\tpublic enum XmlCommentState {\n\t\t// comment is allowed in this state.\n\t\tAllowed,\n\t\t// comment is not allowed in this state.\n\t\tNotAllowed,\n\t\t// once comments appeared when it is NotAllowed, then the\n\t\t// state is changed to it, until the state is changed to\n\t\t// .Allowed.\n\t\tError\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/decl.cs",
    "content": "//\n// decl.cs: Declaration base class for structs, classes, enums and interfaces.\n//\n// Author: Miguel de Icaza (miguel@gnu.org)\n//         Marek Safar (marek.safar@seznam.cz)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing Mono.CompilerServices.SymbolWriter;\n\n#if NET_2_1\nusing XmlElement = System.Object;\n#else\nusing System.Xml;\n#endif\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t//\n\t// Better name would be DottenName\n\t//\n\t[DebuggerDisplay (\"{GetSignatureForError()}\")]\n\tpublic class MemberName\n\t{\n\t\tpublic static readonly MemberName Null = new MemberName (\"\");\n\n\t\tpublic readonly string Name;\n\t\tpublic TypeParameters TypeParameters;\n\t\tpublic readonly FullNamedExpression ExplicitInterface;\n\t\tpublic readonly Location Location;\n\n\t\tpublic readonly MemberName Left;\n\n\t\tpublic MemberName (string name)\n\t\t\t: this (name, Location.Null)\n\t\t{ }\n\n\t\tpublic MemberName (string name, Location loc)\n\t\t\t: this (null, name, loc)\n\t\t{ }\n\n\t\tpublic MemberName (string name, TypeParameters tparams, Location loc)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Location = loc;\n\n\t\t\tthis.TypeParameters = tparams;\n\t\t}\n\n\t\tpublic MemberName (string name, TypeParameters tparams, FullNamedExpression explicitInterface, Location loc)\n\t\t\t: this (name, tparams, loc)\n\t\t{\n\t\t\tthis.ExplicitInterface = explicitInterface;\n\t\t}\n\n\t\tpublic MemberName (MemberName left, string name, Location loc)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Location = loc;\n\t\t\tthis.Left = left;\n\t\t}\n\n\t\tpublic MemberName (MemberName left, string name, FullNamedExpression explicitInterface, Location loc)\n\t\t\t: this (left, name, loc)\n\t\t{\n\t\t\tthis.ExplicitInterface = explicitInterface;\n\t\t}\n\n\t\tpublic MemberName (MemberName left, MemberName right)\n\t\t{\n\t\t\tthis.Name = right.Name;\n\t\t\tthis.Location = right.Location;\n\t\t\tthis.TypeParameters = right.TypeParameters;\n\t\t\tthis.Left = left;\n\t\t}\n\n\t\tpublic int Arity {\n\t\t\tget {\n\t\t\t\treturn TypeParameters == null ? 0 : TypeParameters.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsGeneric {\n\t\t\tget {\n\t\t\t\treturn TypeParameters != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Basename {\n\t\t\tget {\n\t\t\t\tif (TypeParameters != null)\n\t\t\t\t\treturn MakeName (Name, TypeParameters);\n\t\t\t\treturn Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic void CreateMetadataName (StringBuilder sb)\n\t\t{\n\t\t\tif (Left != null)\n\t\t\t\tLeft.CreateMetadataName (sb);\n\n\t\t\tif (sb.Length != 0) {\n\t\t\t\tsb.Append (\".\");\n\t\t\t}\n\n\t\t\tsb.Append (Basename);\n\t\t}\n\n\t\tpublic string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tvar s = Basename;\n\n\t\t\tif (ExplicitInterface != null)\n\t\t\t\ts = ExplicitInterface.GetSignatureForError () + \".\" + s;\n\n\t\t\tif (Left == null)\n\t\t\t\treturn s;\n\n\t\t\treturn Left.GetSignatureForDocumentation () + \".\" + s;\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\tstring s = TypeParameters == null ? null : \"<\" + TypeParameters.GetSignatureForError () + \">\";\n\t\t\ts = Name + s;\n\n\t\t\tif (ExplicitInterface != null)\n\t\t\t\ts = ExplicitInterface.GetSignatureForError () + \".\" + s;\n\n\t\t\tif (Left == null)\n\t\t\t\treturn s;\n\n\t\t\treturn Left.GetSignatureForError () + \".\" + s;\n\t\t}\n\n\t\tpublic override bool Equals (object other)\n\t\t{\n\t\t\treturn Equals (other as MemberName);\n\t\t}\n\n\t\tpublic bool Equals (MemberName other)\n\t\t{\n\t\t\tif (this == other)\n\t\t\t\treturn true;\n\t\t\tif (other == null || Name != other.Name)\n\t\t\t\treturn false;\n\n\t\t\tif ((TypeParameters != null) &&\n\t\t\t    (other.TypeParameters == null || TypeParameters.Count != other.TypeParameters.Count))\n\t\t\t\treturn false;\n\n\t\t\tif ((TypeParameters == null) && (other.TypeParameters != null))\n\t\t\t\treturn false;\n\n\t\t\tif (Left == null)\n\t\t\t\treturn other.Left == null;\n\n\t\t\treturn Left.Equals (other.Left);\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\tint hash = Name.GetHashCode ();\n\t\t\tfor (MemberName n = Left; n != null; n = n.Left)\n\t\t\t\thash ^= n.Name.GetHashCode ();\n\n\t\t\tif (TypeParameters != null)\n\t\t\t\thash ^= TypeParameters.Count << 5;\n\n\t\t\treturn hash & 0x7FFFFFFF;\n\t\t}\n\n\t\tpublic static string MakeName (string name, TypeParameters args)\n\t\t{\n\t\t\tif (args == null)\n\t\t\t\treturn name;\n\n\t\t\treturn name + \"`\" + args.Count;\n\t\t}\n\n\t\tpublic static string MakeName (string name, int count)\n\t\t{\n\t\t\treturn name + \"`\" + count;\n\t\t}\n\t}\n\n\tpublic class SimpleMemberName\n\t{\n\t\tpublic string Value;\n\t\tpublic Location Location;\n\n\t\tpublic SimpleMemberName (string name, Location loc)\n\t\t{\n\t\t\tthis.Value = name;\n\t\t\tthis.Location = loc;\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Base representation for members.  This is used to keep track\n\t///   of Name, Location and Modifier flags, and handling Attributes.\n\t/// </summary>\n\t[System.Diagnostics.DebuggerDisplay (\"{GetSignatureForError()}\")]\n\tpublic abstract class MemberCore : Attributable, IMemberContext, IMemberDefinition\n\t{\n\t\tstring IMemberDefinition.Name {\n\t\t\tget {\n\t\t\t\treturn member_name.Name;\n\t\t\t}\n\t\t}\n\n                // Is not readonly because of IndexerName attribute\n\t\tprivate MemberName member_name;\n\t\tpublic MemberName MemberName {\n\t\t\tget { return member_name; }\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Modifier flags that the user specified in the source code\n\t\t/// </summary>\n\t\tprivate Modifiers mod_flags;\n\t\tpublic Modifiers ModFlags {\n\t\t\tset {\n\t\t\t\tmod_flags = value;\n\t\t\t\tif ((value & Modifiers.COMPILER_GENERATED) != 0)\n\t\t\t\t\tcaching_flags = Flags.IsUsed | Flags.IsAssigned;\n\t\t\t}\n\t\t\tget {\n\t\t\t\treturn mod_flags;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual ModuleContainer Module {\n\t\t\tget {\n\t\t\t\treturn Parent.Module;\n\t\t\t}\n\t\t}\n\n\t\tpublic /*readonly*/ TypeContainer Parent;\n\n\t\t/// <summary>\n\t\t///   Location where this declaration happens\n\t\t/// </summary>\n\t\tpublic Location Location {\n\t\t\tget { return member_name.Location; }\n\t\t}\n\n\t\t/// <summary>\n\t\t///   XML documentation comment\n\t\t/// </summary>\n\t\tprotected string comment;\n\n\t\t/// <summary>\n\t\t///   Represents header string for documentation comment \n\t\t///   for each member types.\n\t\t/// </summary>\n\t\tpublic abstract string DocCommentHeader { get; }\n\n\t\t[Flags]\n\t\tpublic enum Flags {\n\t\t\tObsolete_Undetected = 1,\t\t// Obsolete attribute has not been detected yet\n\t\t\tObsolete = 1 << 1,\t\t\t// Type has obsolete attribute\n\t\t\tClsCompliance_Undetected = 1 << 2,\t// CLS Compliance has not been detected yet\n\t\t\tClsCompliant = 1 << 3,\t\t\t// Type is CLS Compliant\n\t\t\tCloseTypeCreated = 1 << 4,\t\t// Tracks whether we have Closed the type\n\t\t\tHasCompliantAttribute_Undetected = 1 << 5,\t// Presence of CLSCompliantAttribute has not been detected\n\t\t\tHasClsCompliantAttribute = 1 << 6,\t\t\t// Type has CLSCompliantAttribute\n\t\t\tClsCompliantAttributeFalse = 1 << 7,\t\t\t// Member has CLSCompliant(false)\n\t\t\tExcluded_Undetected = 1 << 8,\t\t// Conditional attribute has not been detected yet\n\t\t\tExcluded = 1 << 9,\t\t\t\t\t// Method is conditional\n\t\t\tMethodOverloadsExist = 1 << 10,\t\t// Test for duplication must be performed\n\t\t\tIsUsed = 1 << 11,\n\t\t\tIsAssigned = 1 << 12,\t\t\t\t// Field is assigned\n\t\t\tHasExplicitLayout\t= 1 << 13,\n\t\t\tPartialDefinitionExists\t= 1 << 14,\t// Set when corresponding partial method definition exists\n\t\t\tHasStructLayout\t= 1 << 15,\t\t\t// Has StructLayoutAttribute\n\t\t\tHasInstanceConstructor = 1 << 16,\n\t\t\tHasUserOperators = 1 << 17,\n\t\t\tCanBeReused = 1 << 18,\n\t\t\tInterfacesExpanded = 1 << 19\n\t\t}\n\n\t\t/// <summary>\n\t\t///   MemberCore flags at first detected then cached\n\t\t/// </summary>\n\t\tinternal Flags caching_flags;\n\n\t\tprotected MemberCore (TypeContainer parent, MemberName name, Attributes attrs)\n\t\t{\n\t\t\tthis.Parent = parent;\n\t\t\tmember_name = name;\n\t\t\tcaching_flags = Flags.Obsolete_Undetected | Flags.ClsCompliance_Undetected | Flags.HasCompliantAttribute_Undetected | Flags.Excluded_Undetected;\n\t\t\tAddAttributes (attrs, this);\n\t\t}\n\n\t\tprotected virtual void SetMemberName (MemberName new_name)\n\t\t{\n\t\t\tmember_name = new_name;\n\t\t}\n\n\t\tpublic virtual void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tprotected bool CheckAbstractAndExtern (bool has_block)\n\t\t{\n\t\t\tif (Parent.PartialContainer.Kind == MemberKind.Interface)\n\t\t\t\treturn true;\n\n\t\t\tif (has_block) {\n\t\t\t\tif ((ModFlags & Modifiers.EXTERN) != 0) {\n\t\t\t\t\tReport.Error (179, Location, \"`{0}' cannot declare a body because it is marked extern\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ((ModFlags & Modifiers.ABSTRACT) != 0) {\n\t\t\t\t\tReport.Error (500, Location, \"`{0}' cannot declare a body because it is marked abstract\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN | Modifiers.PARTIAL)) == 0 && !(Parent is Delegate)) {\n\t\t\t\t\tif (Compiler.Settings.Version >= LanguageVersion.V_3) {\n\t\t\t\t\t\tProperty.PropertyMethod pm = this as Property.PropertyMethod;\n\t\t\t\t\t\tif (pm is Indexer.GetIndexerMethod || pm is Indexer.SetIndexerMethod)\n\t\t\t\t\t\t\tpm = null;\n\n\t\t\t\t\t\tif (pm != null && pm.Property.AccessorSecond == null) {\n\t\t\t\t\t\t\tReport.Error (840, Location,\n\t\t\t\t\t\t\t\t\"`{0}' must have a body because it is not marked abstract or extern. The property can be automatically implemented when you define both accessors\",\n\t\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tReport.Error (501, Location, \"`{0}' must have a body because it is not marked abstract, extern, or partial\",\n\t\t\t\t\t              GetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected void CheckProtectedModifier ()\n\t\t{\n\t\t\tif ((ModFlags & Modifiers.PROTECTED) == 0)\n\t\t\t\treturn;\n\n\t\t\tif (Parent.PartialContainer.Kind == MemberKind.Struct) {\n\t\t\t\tReport.Error (666, Location, \"`{0}': Structs cannot contain protected members\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ((Parent.ModFlags & Modifiers.STATIC) != 0) {\n\t\t\t\tReport.Error (1057, Location, \"`{0}': Static classes cannot contain protected members\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ((Parent.ModFlags & Modifiers.SEALED) != 0 && (ModFlags & Modifiers.OVERRIDE) == 0 &&\n\t\t\t\t!(this is Destructor)) {\n\t\t\t\tReport.Warning (628, 4, Location, \"`{0}': new protected member declared in sealed class\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tpublic abstract bool Define ();\n\n\t\tpublic virtual string DocComment {\n\t\t\tget {\n\t\t\t\treturn comment;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tcomment = value;\n\t\t\t}\n\t\t}\n\n\t\t// \n\t\t// Returns full member name for error message\n\t\t//\n\t\tpublic virtual string GetSignatureForError ()\n\t\t{\n\t\t\tvar parent = Parent.GetSignatureForError ();\n\t\t\tif (parent == null)\n\t\t\t\treturn member_name.GetSignatureForError ();\n\n\t\t\treturn parent + \".\" + member_name.GetSignatureForError ();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Base Emit method. This is also entry point for CLS-Compliant verification.\n\t\t/// </summary>\n\t\tpublic virtual void Emit ()\n\t\t{\n\t\t\tif (!Compiler.Settings.VerifyClsCompliance)\n\t\t\t\treturn;\n\n\t\t\tVerifyClsCompliance ();\n\t\t}\n\n\t\tpublic bool IsAvailableForReuse {\n\t\t\tget {\n\t\t\t\treturn (caching_flags & Flags.CanBeReused) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tcaching_flags = value ? (caching_flags | Flags.CanBeReused) : (caching_flags & ~Flags.CanBeReused);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCompilerGenerated {\n\t\t\tget\t{\n\t\t\t\tif ((mod_flags & Modifiers.COMPILER_GENERATED) != 0)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn Parent != null && Parent.IsCompilerGenerated;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsImported {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool IsUsed {\n\t\t\tget {\n\t\t\t\treturn (caching_flags & Flags.IsUsed) != 0;\n\t\t\t}\n\t\t}\n\n\t\tprotected Report Report {\n\t\t\tget {\n\t\t\t\treturn Compiler.Report;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetIsUsed ()\n\t\t{\n\t\t\tcaching_flags |= Flags.IsUsed;\n\t\t}\n\n\t\tpublic void SetIsAssigned ()\n\t\t{\n\t\t\tcaching_flags |= Flags.IsAssigned;\n\t\t}\n\n\t\tpublic virtual void SetConstraints (List<Constraints> constraints_list)\n\t\t{\n\t\t\tvar tparams = member_name.TypeParameters;\n\t\t\tif (tparams == null) {\n\t\t\t\tReport.Error (80, Location, \"Constraints are not allowed on non-generic declarations\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach (var c in constraints_list) {\n\t\t\t\tvar tp = tparams.Find (c.TypeParameter.Value);\n\t\t\t\tif (tp == null) {\n\t\t\t\t\tReport.Error (699, c.Location, \"`{0}': A constraint references nonexistent type parameter `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), c.TypeParameter.Value);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttp.Constraints = c;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns instance of ObsoleteAttribute for this MemberCore\n\t\t/// </summary>\n\t\tpublic virtual ObsoleteAttribute GetAttributeObsolete ()\n\t\t{\n\t\t\tif ((caching_flags & (Flags.Obsolete_Undetected | Flags.Obsolete)) == 0)\n\t\t\t\treturn null;\n\n\t\t\tcaching_flags &= ~Flags.Obsolete_Undetected;\n\n\t\t\tif (OptAttributes == null)\n\t\t\t\treturn null;\n\n\t\t\tAttribute obsolete_attr = OptAttributes.Search (Module.PredefinedAttributes.Obsolete);\n\t\t\tif (obsolete_attr == null)\n\t\t\t\treturn null;\n\n\t\t\tcaching_flags |= Flags.Obsolete;\n\n\t\t\tObsoleteAttribute obsolete = obsolete_attr.GetObsoleteAttribute ();\n\t\t\tif (obsolete == null)\n\t\t\t\treturn null;\n\n\t\t\treturn obsolete;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks for ObsoleteAttribute presence. It's used for testing of all non-types elements\n\t\t/// </summary>\n\t\tpublic virtual void CheckObsoleteness (Location loc)\n\t\t{\n\t\t\tObsoleteAttribute oa = GetAttributeObsolete ();\n\t\t\tif (oa != null)\n\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, Report);\n\t\t}\n\n\t\t//\n\t\t// Checks whether the type P is as accessible as this member\n\t\t//\n\t\tpublic bool IsAccessibleAs (TypeSpec p)\n\t\t{\n\t\t\t//\n\t\t\t// if M is private, its accessibility is the same as this declspace.\n\t\t\t// we already know that P is accessible to T before this method, so we\n\t\t\t// may return true.\n\t\t\t//\n\t\t\tif ((mod_flags & Modifiers.PRIVATE) != 0)\n\t\t\t\treturn true;\n\n\t\t\twhile (TypeManager.HasElementType (p))\n\t\t\t\tp = TypeManager.GetElementType (p);\n\n\t\t\tif (p.IsGenericParameter)\n\t\t\t\treturn true;\n\n\t\t\tfor (TypeSpec p_parent; p != null; p = p_parent) {\n\t\t\t\tp_parent = p.DeclaringType;\n\n\t\t\t\tif (p.IsGeneric) {\n\t\t\t\t\tforeach (TypeSpec t in p.TypeArguments) {\n\t\t\t\t\t\tif (!IsAccessibleAs (t))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar pAccess = p.Modifiers & Modifiers.AccessibilityMask;\n\t\t\t\tif (pAccess == Modifiers.PUBLIC)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tbool same_access_restrictions = false;\n\t\t\t\tfor (MemberCore mc = this; !same_access_restrictions && mc != null && mc.Parent != null; mc = mc.Parent) {\n\t\t\t\t\tvar al = mc.ModFlags & Modifiers.AccessibilityMask;\n\t\t\t\t\tswitch (pAccess) {\n\t\t\t\t\tcase Modifiers.INTERNAL:\n\t\t\t\t\t\tif (al == Modifiers.PRIVATE || al == Modifiers.INTERNAL)\n\t\t\t\t\t\t\tsame_access_restrictions = p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Modifiers.PROTECTED:\n\t\t\t\t\t\tif (al == Modifiers.PROTECTED) {\n\t\t\t\t\t\t\tsame_access_restrictions = mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (al == Modifiers.PRIVATE) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// When type is private and any of its parents derives from\n\t\t\t\t\t\t\t// protected type then the type is accessible\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\twhile (mc.Parent != null && mc.Parent.PartialContainer != null) {\n\t\t\t\t\t\t\t\tif (mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent))\n\t\t\t\t\t\t\t\t\tsame_access_restrictions = true;\n\t\t\t\t\t\t\t\tmc = mc.Parent; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Modifiers.PROTECTED | Modifiers.INTERNAL:\n\t\t\t\t\t\tif (al == Modifiers.INTERNAL)\n\t\t\t\t\t\t\tsame_access_restrictions = p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);\n\t\t\t\t\t\telse if (al == (Modifiers.PROTECTED | Modifiers.INTERNAL))\n\t\t\t\t\t\t\tsame_access_restrictions = mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent) && p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tgoto case Modifiers.PROTECTED;\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Modifiers.PRIVATE:\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Both are private and share same parent\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (al == Modifiers.PRIVATE) {\n\t\t\t\t\t\t\tvar decl = mc.Parent;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tsame_access_restrictions = decl.CurrentType.MemberDefinition == p_parent.MemberDefinition;\n\t\t\t\t\t\t\t} while (!same_access_restrictions && !decl.PartialContainer.IsTopLevel && (decl = decl.Parent) != null);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new InternalErrorException (al.ToString ());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!same_access_restrictions)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Analyze whether CLS-Compliant verification must be execute for this MemberCore.\n\t\t/// </summary>\n\t\tpublic override bool IsClsComplianceRequired ()\n\t\t{\n\t\t\tif ((caching_flags & Flags.ClsCompliance_Undetected) == 0)\n\t\t\t\treturn (caching_flags & Flags.ClsCompliant) != 0;\n\n\t\t\tcaching_flags &= ~Flags.ClsCompliance_Undetected;\n\n\t\t\tif (HasClsCompliantAttribute) {\n\t\t\t\tif ((caching_flags & Flags.ClsCompliantAttributeFalse) != 0)\n\t\t\t\t\treturn false;\n\n\t\t\t\tcaching_flags |= Flags.ClsCompliant;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (Parent.IsClsComplianceRequired ()) {\n\t\t\t\tcaching_flags |= Flags.ClsCompliant;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic virtual string[] ConditionalConditions ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true when MemberCore is exposed from assembly.\n\t\t/// </summary>\n\t\tpublic bool IsExposedFromAssembly ()\n\t\t{\n\t\t\tif ((ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)\n\t\t\t\treturn this is NamespaceContainer;\n\t\t\t\n\t\t\tvar parentContainer = Parent.PartialContainer;\n\t\t\twhile (parentContainer != null) {\n\t\t\t\tif ((parentContainer.ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)\n\t\t\t\t\treturn false;\n\n\t\t\t\tparentContainer = parentContainer.Parent.PartialContainer;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Does extension methods look up to find a method which matches name and extensionType.\n\t\t// Search starts from this namespace and continues hierarchically up to top level.\n\t\t//\n\t\tpublic ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)\n\t\t{\n\t\t\tvar m = Parent;\n\t\t\tdo {\n\t\t\t\tvar ns = m as NamespaceContainer;\n\t\t\t\tif (ns != null)\n\t\t\t\t\treturn ns.LookupExtensionMethod (this, extensionType, name, arity, 0);\n\n\t\t\t\tm = m.Parent;\n\t\t\t} while (m != null);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual FullNamedExpression LookupNamespaceAlias (string name)\n\t\t{\n\t\t\treturn Parent.LookupNamespaceAlias (name);\n\t\t}\n\n\t\tpublic virtual FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\treturn Parent.LookupNamespaceOrType (name, arity, mode, loc);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Goes through class hierarchy and gets value of first found CLSCompliantAttribute.\n\t\t/// If no is attribute exists then assembly CLSCompliantAttribute is returned.\n\t\t/// </summary>\n\t\tpublic bool? CLSAttributeValue {\n\t\t\tget {\n\t\t\t\tif ((caching_flags & Flags.HasCompliantAttribute_Undetected) == 0) {\n\t\t\t\t\tif ((caching_flags & Flags.HasClsCompliantAttribute) == 0)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\treturn (caching_flags & Flags.ClsCompliantAttributeFalse) == 0;\n\t\t\t\t}\n\n\t\t\t\tcaching_flags &= ~Flags.HasCompliantAttribute_Undetected;\n\n\t\t\t\tif (OptAttributes != null) {\n\t\t\t\t\tAttribute cls_attribute = OptAttributes.Search (Module.PredefinedAttributes.CLSCompliant);\n\t\t\t\t\tif (cls_attribute != null) {\n\t\t\t\t\t\tcaching_flags |= Flags.HasClsCompliantAttribute;\n\t\t\t\t\t\tif (cls_attribute.GetClsCompliantAttributeValue ())\n\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\tcaching_flags |= Flags.ClsCompliantAttributeFalse;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if MemberCore is explicitly marked with CLSCompliantAttribute\n\t\t/// </summary>\n\t\tprotected bool HasClsCompliantAttribute {\n\t\t\tget {\n\t\t\t\treturn CLSAttributeValue.HasValue;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true when a member supports multiple overloads (methods, indexers, etc)\n\t\t/// </summary>\n\t\tpublic virtual bool EnableOverloadChecks (MemberCore overload)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The main virtual method for CLS-Compliant verifications.\n\t\t/// The method returns true if member is CLS-Compliant and false if member is not\n\t\t/// CLS-Compliant which means that CLS-Compliant tests are not necessary. A descendants override it\n\t\t/// and add their extra verifications.\n\t\t/// </summary>\n\t\tprotected virtual bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (HasClsCompliantAttribute) {\n\t\t\t\tif (!Module.DeclaringAssembly.HasCLSCompliantAttribute) {\n\t\t\t\t\tAttribute a = OptAttributes.Search (Module.PredefinedAttributes.CLSCompliant);\n\t\t\t\t\tif ((caching_flags & Flags.ClsCompliantAttributeFalse) != 0) {\n\t\t\t\t\t\tReport.Warning (3021, 2, a.Location,\n\t\t\t\t\t\t\t\"`{0}' does not need a CLSCompliant attribute because the assembly is not marked as CLS-compliant\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tReport.Warning (3014, 1, a.Location,\n\t\t\t\t\t\t\t\"`{0}' cannot be marked as CLS-compliant because the assembly is not marked as CLS-compliant\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!IsExposedFromAssembly ()) {\n\t\t\t\t\tAttribute a = OptAttributes.Search (Module.PredefinedAttributes.CLSCompliant);\n\t\t\t\t\tReport.Warning (3019, 2, a.Location, \"CLS compliance checking will not be performed on `{0}' because it is not visible from outside this assembly\", GetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ((caching_flags & Flags.ClsCompliantAttributeFalse) != 0) {\n\t\t\t\t\tif (Parent is Interface && Parent.IsClsComplianceRequired ()) {\n\t\t\t\t\t\tReport.Warning (3010, 1, Location, \"`{0}': CLS-compliant interfaces must have only CLS-compliant members\", GetSignatureForError ());\n\t\t\t\t\t} else if (Parent.Kind == MemberKind.Class && (ModFlags & Modifiers.ABSTRACT) != 0 && Parent.IsClsComplianceRequired ()) {\n\t\t\t\t\t\tReport.Warning (3011, 1, Location, \"`{0}': only CLS-compliant members can be abstract\", GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (Parent.Kind != MemberKind.Namespace && Parent.Kind != 0 && !Parent.IsClsComplianceRequired ()) {\n\t\t\t\t\tAttribute a = OptAttributes.Search (Module.PredefinedAttributes.CLSCompliant);\n\t\t\t\t\tReport.Warning (3018, 1, a.Location, \"`{0}' cannot be marked as CLS-compliant because it is a member of non CLS-compliant type `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), Parent.GetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!IsExposedFromAssembly ())\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (!Parent.IsClsComplianceRequired ())\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (member_name.Name [0] == '_') {\n\t\t\t\tWarning_IdentifierNotCompliant ();\n\t\t\t}\n\n\t\t\tif (member_name.TypeParameters != null)\n\t\t\t\tmember_name.TypeParameters.VerifyClsCompliance ();\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected void Warning_IdentifierNotCompliant ()\n\t\t{\n\t\t\tReport.Warning (3008, 1, MemberName.Location, \"Identifier `{0}' is not CLS-compliant\", GetSignatureForError ());\n\t\t}\n\n\t\tpublic virtual string GetCallerMemberName ()\n\t\t{\n\t\t\treturn MemberName.Name;\n\t\t}\n\n\t\t//\n\t\t// Returns a string that represents the signature for this \n\t\t// member which should be used in XML documentation.\n\t\t//\n\t\tpublic abstract string GetSignatureForDocumentation ();\n\n\t\tpublic virtual void GetCompletionStartingWith (string prefix, List<string> results)\n\t\t{\n\t\t\tParent.GetCompletionStartingWith (prefix, results);\n\t\t}\n\n\t\t//\n\t\t// Generates xml doc comments (if any), and if required,\n\t\t// handle warning report.\n\t\t//\n\t\tinternal virtual void GenerateDocComment (DocumentationBuilder builder)\n\t\t{\n\t\t\tif (DocComment == null) {\n\t\t\t\tif (IsExposedFromAssembly ()) {\n\t\t\t\t\tConstructor c = this as Constructor;\n\t\t\t\t\tif (c == null || !c.IsDefault ())\n\t\t\t\t\t\tReport.Warning (1591, 4, Location,\n\t\t\t\t\t\t\t\"Missing XML comment for publicly visible type or member `{0}'\", GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tbuilder.GenerateDocumentationForMember (this);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (this, e);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t}\n\n\t\t#region IMemberContext Members\n\n\t\tpublic virtual CompilerContext Compiler {\n\t\t\tget {\n\t\t\t\treturn Module.Compiler;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual TypeSpec CurrentType {\n\t\t\tget { return Parent.CurrentType; }\n\t\t}\n\n\t\tpublic MemberCore CurrentMemberDefinition {\n\t\t\tget { return this; }\n\t\t}\n\n\t\tpublic virtual TypeParameters CurrentTypeParameters {\n\t\t\tget { return null; }\n\t\t}\n\n\t\tpublic bool IsObsolete {\n\t\t\tget {\n\t\t\t\tif (GetAttributeObsolete () != null)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn Parent != null && Parent.IsObsolete;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsUnsafe {\n\t\t\tget {\n\t\t\t\tif ((ModFlags & Modifiers.UNSAFE) != 0)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn Parent != null && Parent.IsUnsafe;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn (ModFlags & Modifiers.STATIC) != 0;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t//\n\t// Base member specification. A member specification contains\n\t// member details which can alter in the context (e.g. generic instances)\n\t//\n\tpublic abstract class MemberSpec\n\t{\n\t\t[Flags]\n\t\tpublic enum StateFlags\n\t\t{\n\t\t\tObsolete_Undetected = 1,\t// Obsolete attribute has not been detected yet\n\t\t\tObsolete = 1 << 1,\t\t\t// Member has obsolete attribute\n\t\t\tCLSCompliant_Undetected = 1 << 2,\t// CLSCompliant attribute has not been detected yet\n\t\t\tCLSCompliant = 1 << 3,\t\t// Member is CLS Compliant\n\t\t\tMissingDependency_Undetected = 1 << 4,\n\t\t\tMissingDependency = 1 << 5,\n\t\t\tHasDynamicElement = 1 << 6,\n\t\t\tConstraintsChecked = 1 << 7,\n\n\t\t\tIsAccessor = 1 << 9,\t\t// Method is an accessor\n\t\t\tIsGeneric = 1 << 10,\t\t// Member contains type arguments\n\n\t\t\tPendingMetaInflate = 1 << 12,\n\t\t\tPendingMakeMethod = 1 << 13,\n\t\t\tPendingMemberCacheMembers = 1 << 14,\n\t\t\tPendingBaseTypeInflate = 1 << 15,\n\t\t\tInterfacesExpanded = 1 << 16,\n\t\t\tIsNotCSharpCompatible = 1 << 17,\n\t\t\tSpecialRuntimeType = 1 << 18,\n\t\t\tInflatedExpressionType = 1 << 19,\n\t\t\tInflatedNullableType = 1 << 20,\n\t\t\tGenericIterateInterface = 1 << 21,\n\t\t\tGenericTask = 1 << 22,\n\t\t\tInterfacesImported = 1 << 23,\n\t\t}\n\n\t\t//\n\t\t// Some flags can be copied directly from other member\n\t\t//\n\t\tprotected const StateFlags SharedStateFlags =\n\t\t\tStateFlags.CLSCompliant | StateFlags.CLSCompliant_Undetected |\n\t\t\tStateFlags.Obsolete | StateFlags.Obsolete_Undetected |\n\t\t\tStateFlags.MissingDependency | StateFlags.MissingDependency_Undetected |\n\t\t\tStateFlags.HasDynamicElement;\n\n\t\tprotected Modifiers modifiers;\n\t\tpublic StateFlags state;\n\t\tprotected IMemberDefinition definition;\n\t\tpublic readonly MemberKind Kind;\n\t\tprotected TypeSpec declaringType;\n\n#if DEBUG\n\t\tstatic int counter;\n\t\tpublic int ID = counter++;\n#endif\n\n\t\tprotected MemberSpec (MemberKind kind, TypeSpec declaringType, IMemberDefinition definition, Modifiers modifiers)\n\t\t{\n\t\t\tthis.Kind = kind;\n\t\t\tthis.declaringType = declaringType;\n\t\t\tthis.definition = definition;\n\t\t\tthis.modifiers = modifiers;\n\n\t\t\tif (kind == MemberKind.MissingType)\n\t\t\t\tstate = StateFlags.MissingDependency;\n\t\t\telse\n\t\t\t\tstate = StateFlags.Obsolete_Undetected | StateFlags.CLSCompliant_Undetected | StateFlags.MissingDependency_Undetected;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic virtual int Arity {\n\t\t\tget {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec DeclaringType {\n\t\t\tget {\n\t\t\t\treturn declaringType;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tdeclaringType = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic IMemberDefinition MemberDefinition {\n\t\t\tget {\n\t\t\t\treturn definition;\n\t\t\t}\n\t\t}\n\n\t\tpublic Modifiers Modifiers {\n\t\t\tget {\n\t\t\t\treturn modifiers;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tmodifiers = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual string Name {\n\t\t\tget {\n\t\t\t\treturn definition.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAbstract {\n\t\t\tget { return (modifiers & Modifiers.ABSTRACT) != 0; }\n\t\t}\n\n\t\tpublic bool IsAccessor {\n\t\t\tget {\n\t\t\t\treturn (state & StateFlags.IsAccessor) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.IsAccessor : state & ~StateFlags.IsAccessor;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Return true when this member is a generic in C# terms\n\t\t// A nested non-generic type of generic type will return false\n\t\t//\n\t\tpublic bool IsGeneric {\n\t\t\tget {\n\t\t\t\treturn (state & StateFlags.IsGeneric) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.IsGeneric : state & ~StateFlags.IsGeneric;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true for imported members which are not compatible with C# language\n\t\t//\n\t\tpublic bool IsNotCSharpCompatible {\n\t\t\tget {\n\t\t\t\treturn (state & StateFlags.IsNotCSharpCompatible) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.IsNotCSharpCompatible : state & ~StateFlags.IsNotCSharpCompatible;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsPrivate {\n\t\t\tget { return (modifiers & Modifiers.PRIVATE) != 0; }\n\t\t}\n\n\t\tpublic bool IsPublic {\n\t\t\tget { return (modifiers & Modifiers.PUBLIC) != 0; }\n\t\t}\n\n\t\tpublic bool IsStatic {\n\t\t\tget { \n\t\t\t\treturn (modifiers & Modifiers.STATIC) != 0;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic virtual ObsoleteAttribute GetAttributeObsolete ()\n\t\t{\n\t\t\tif ((state & (StateFlags.Obsolete | StateFlags.Obsolete_Undetected)) == 0)\n\t\t\t\treturn null;\n\n\t\t\tstate &= ~StateFlags.Obsolete_Undetected;\n\n\t\t\tvar oa = definition.GetAttributeObsolete ();\n\t\t\tif (oa != null)\n\t\t\t\tstate |= StateFlags.Obsolete;\n\n\t\t\treturn oa;\n\t\t}\n\n\t\t//\n\t\t// Returns a list of missing dependencies of this member. The list\n\t\t// will contain types only but it can have numerous values for members\n\t\t// like methods where both return type and all parameters are checked\n\t\t//\n\t\tpublic List<MissingTypeSpecReference> GetMissingDependencies ()\n\t\t{\n\t\t\treturn GetMissingDependencies (this);\n\t\t}\n\n\t\tpublic List<MissingTypeSpecReference> GetMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\tif ((state & (StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected)) == 0)\n\t\t\t\treturn null;\n\n\t\t\tstate &= ~StateFlags.MissingDependency_Undetected;\n\n\t\t\tvar imported = definition as ImportedDefinition;\n\t\t\tList<MissingTypeSpecReference> missing;\n\t\t\tif (imported != null) {\n\t\t\t\tmissing = ResolveMissingDependencies (caller);\n\t\t\t} else if (this is ElementTypeSpec) {\n\t\t\t\tmissing = ((ElementTypeSpec) this).Element.GetMissingDependencies (caller);\n\t\t\t} else {\n\t\t\t\tmissing = null;\n\t\t\t}\n\n\t\t\tif (missing != null) {\n\t\t\t\tstate |= StateFlags.MissingDependency;\n\t\t\t}\n\n\t\t\treturn missing;\n\t\t}\n\n\t\tpublic abstract List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller);\n\n\t\tprotected virtual bool IsNotCLSCompliant (out bool attrValue)\n\t\t{\n\t\t\tvar cls = MemberDefinition.CLSAttributeValue;\n\t\t\tattrValue = cls ?? false;\n\t\t\treturn cls == false;\n\t\t}\n\n\t\tpublic virtual string GetSignatureForDocumentation ()\n\t\t{\n\t\t\treturn DeclaringType.GetSignatureForDocumentation () + \".\" + Name;\n\t\t}\n\n\t\tpublic virtual string GetSignatureForError ()\n\t\t{\n\t\t\tvar bf = MemberDefinition as Property.BackingField;\n\t\t\tstring name;\n\t\t\tif (bf == null) {\n\t\t\t\tname = Name;\n\t\t\t} else {\n\t\t\t\tname = bf.OriginalProperty.MemberName.Name;\n\t\t\t}\n\n\t\t\treturn DeclaringType.GetSignatureForError () + \".\" + name;\n\t\t}\n\n\t\tpublic virtual MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar inflated = (MemberSpec) MemberwiseClone ();\n\t\t\tinflated.declaringType = inflator.TypeInstance;\n\t\t\tif (DeclaringType.IsGenericOrParentIsGeneric)\n\t\t\t\tinflated.state |= StateFlags.PendingMetaInflate;\n#if DEBUG\n\t\t\tinflated.ID += 1000000;\n#endif\n\t\t\treturn inflated;\n\t\t}\n\n\t\t//\n\t\t// Is this member accessible from invocation context\n\t\t//\n\t\tpublic bool IsAccessible (IMemberContext ctx)\n\t\t{\n\t\t\tvar ma = Modifiers & Modifiers.AccessibilityMask;\n\t\t\tif (ma == Modifiers.PUBLIC)\n\t\t\t\treturn true;\n\n\t\t\tvar parentType = /* this as TypeSpec ?? */ DeclaringType;\n\t\t\tvar ctype = ctx.CurrentType;\n\n\t\t\tif (ma == Modifiers.PRIVATE) {\n\t\t\t\tif (ctype == null || parentType == null)\n\t\t\t\t\treturn false;\n\t\t\t\t//\n\t\t\t\t// It's only accessible to the current class or children\n\t\t\t\t//\n\t\t\t\tif (parentType.MemberDefinition == ctype.MemberDefinition)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn TypeManager.IsNestedChildOf (ctype, parentType.MemberDefinition);\n\t\t\t}\n\n\t\t\tif ((ma & Modifiers.INTERNAL) != 0) {\n\t\t\t\tbool b;\n\t\t\t\tvar assembly = ctype == null ? ctx.Module.DeclaringAssembly : ctype.MemberDefinition.DeclaringAssembly;\n\n\t\t\t\tif (parentType == null) {\n\t\t\t\t\tb = ((ITypeDefinition) MemberDefinition).IsInternalAsPublic (assembly);\n\t\t\t\t} else {\n\t\t\t\t\tb = DeclaringType.MemberDefinition.IsInternalAsPublic (assembly);\n\t\t\t\t}\n\n\t\t\t\tif (b || ma == Modifiers.INTERNAL)\n\t\t\t\t\treturn b;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Checks whether `ctype' is a subclass or nested child of `parentType'.\n\t\t\t//\n\t\t\twhile (ctype != null) {\n\t\t\t\tif (TypeManager.IsFamilyAccessible (ctype, parentType))\n\t\t\t\t\treturn true;\n\n\t\t\t\t// Handle nested types.\n\t\t\t\tctype = ctype.DeclaringType;\t// TODO: Untested ???\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\t\t// Returns member CLS compliance based on full member hierarchy\n\t\t//\n\t\tpublic bool IsCLSCompliant ()\n\t\t{\n\t\t\tif ((state & StateFlags.CLSCompliant_Undetected) != 0) {\n\t\t\t\tstate &= ~StateFlags.CLSCompliant_Undetected;\n\n\t\t\t\tbool compliant;\n\t\t\t\tif (IsNotCLSCompliant (out compliant))\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (!compliant) {\n\t\t\t\t\tif (DeclaringType != null) {\n\t\t\t\t\t\tcompliant = DeclaringType.IsCLSCompliant ();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcompliant = ((ITypeDefinition) MemberDefinition).DeclaringAssembly.IsCLSCompliant;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (compliant)\n\t\t\t\t\tstate |= StateFlags.CLSCompliant;\n\t\t\t}\n\n\t\t\treturn (state & StateFlags.CLSCompliant) != 0;\n\t\t}\n\n\t\tpublic bool IsConditionallyExcluded (IMemberContext ctx)\n\t\t{\n\t\t\tif ((Kind & (MemberKind.Class | MemberKind.Method)) == 0)\n\t\t\t\treturn false;\n\n\t\t\tvar conditions = MemberDefinition.ConditionalConditions ();\n\t\t\tif (conditions == null)\n\t\t\t\treturn false;\n\n\t\t\tvar m = ctx.CurrentMemberDefinition;\n\t\t\tCompilationSourceFile unit = null;\n\t\t\twhile (m != null && unit == null) {\n\t\t\t\tunit = m as CompilationSourceFile;\n\t\t\t\tm = m.Parent;\n\t\t\t}\n\n\t\t\tif (unit != null) {\n\t\t\t\tforeach (var condition in conditions) {\n\t\t\t\t\tif (unit.IsConditionalDefined (condition))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn GetSignatureForError ();\n\t\t}\n\t}\n\n\t//\n\t// Member details which are same between all member\n\t// specifications\n\t//\n\tpublic interface IMemberDefinition\n\t{\n\t\tbool? CLSAttributeValue { get; }\n\t\tstring Name { get; }\n\t\tbool IsImported { get; }\n\n\t\tstring[] ConditionalConditions ();\n\t\tObsoleteAttribute GetAttributeObsolete ();\n\t\tvoid SetIsAssigned ();\n\t\tvoid SetIsUsed ();\n\t}\n\n\tpublic interface IMethodDefinition : IMemberDefinition\n\t{\n\t\tMethodBase Metadata { get; }\n\t}\n\n\tpublic interface IParametersMember : IInterfaceMemberSpec\n\t{\n\t\tAParametersCollection Parameters { get; }\n\t}\n\n\tpublic interface IInterfaceMemberSpec\n\t{\n\t\tTypeSpec MemberType { get; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs",
    "content": "//\n// delegate.cs: Delegate Handler\n//\n// Authors:\n//     Ravi Pratap (ravi@ximian.com)\n//     Miguel de Icaza (miguel@ximian.com)\n//     Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2009 Novell, Inc (http://www.novell.com)\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t//\n\t// Delegate container implementation\n\t//\n\tpublic class Delegate : TypeDefinition, IParametersMember\n\t{\n \t\tpublic FullNamedExpression ReturnType;\n\t\treadonly ParametersCompiled parameters;\n\n\t\tConstructor Constructor;\n\t\tMethod InvokeBuilder;\n\t\tMethod BeginInvokeBuilder;\n\t\tMethod EndInvokeBuilder;\n\n\t\tstatic readonly string[] attribute_targets = new string [] { \"type\", \"return\" };\n\n\t\tpublic static readonly string InvokeMethodName = \"Invoke\";\n\t\t\n\t\tExpression instance_expr;\n\t\tReturnParameter return_attributes;\n\n\t\tconst Modifiers MethodModifiers = Modifiers.PUBLIC | Modifiers.VIRTUAL;\n\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.PRIVATE;\n\n \t\tpublic Delegate (TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, ParametersCompiled param_list,\n\t\t\t\t Attributes attrs)\n\t\t\t: base (parent, name, attrs, MemberKind.Delegate)\n\n\t\t{\n\t\t\tthis.ReturnType = type;\n\t\t\tModFlags        = ModifiersExtensions.Check (AllowedModifiers, mod_flags,\n\t\t\t\t\t\t\t   IsTopLevel ? Modifiers.INTERNAL :\n\t\t\t\t\t\t\t   Modifiers.PRIVATE, name.Location, Report);\n\t\t\tparameters      = param_list;\n\t\t\tspec = new TypeSpec (Kind, null, this, null, ModFlags | Modifiers.SEALED);\n\t\t}\n\n\t\t#region Properties\n\t\tpublic TypeSpec MemberType {\n\t\t\tget {\n\t\t\t\treturn ReturnType.Type;\n\t\t\t}\n\t\t}\n\n\t\tpublic AParametersCollection Parameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression TypExpression {\n\t\t\tget {\n\t\t\t\treturn ReturnType;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Target == AttributeTargets.ReturnValue) {\n\t\t\t\tif (return_attributes == null)\n\t\t\t\t\treturn_attributes = new ReturnParameter (this, InvokeBuilder.MethodBuilder, Location);\n\n\t\t\t\treturn_attributes.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Delegate;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tvar builtin_types = Compiler.BuiltinTypes;\n\n\t\t\tvar ctor_parameters = ParametersCompiled.CreateFullyResolved (\n\t\t\t\tnew [] {\n\t\t\t\t\tnew Parameter (new TypeExpression (builtin_types.Object, Location), \"object\", Parameter.Modifier.NONE, null, Location),\n\t\t\t\t\tnew Parameter (new TypeExpression (builtin_types.IntPtr, Location), \"method\", Parameter.Modifier.NONE, null, Location)\n\t\t\t\t},\n\t\t\t\tnew [] {\n\t\t\t\t\tbuiltin_types.Object,\n\t\t\t\t\tbuiltin_types.IntPtr\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tConstructor = new Constructor (this, Constructor.ConstructorName,\n\t\t\t\tModifiers.PUBLIC, null, ctor_parameters, Location);\n\t\t\tConstructor.Define ();\n\n\t\t\t//\n\t\t\t// Here the various methods like Invoke, BeginInvoke etc are defined\n\t\t\t//\n\t\t\t// First, call the `out of band' special method for\n\t\t\t// defining recursively any types we need:\n\t\t\t//\n\t\t\tvar p = parameters;\n\n\t\t\tif (!p.Resolve (this))\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// Invoke method\n\t\t\t//\n\n\t\t\t// Check accessibility\n\t\t\tforeach (var partype in p.Types) {\n\t\t\t\tif (!IsAccessibleAs (partype)) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (partype);\n\t\t\t\t\tReport.Error (59, Location,\n\t\t\t\t\t\t\"Inconsistent accessibility: parameter type `{0}' is less accessible than delegate `{1}'\",\n\t\t\t\t\t\tpartype.GetSignatureForError (), GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar ret_type = ReturnType.ResolveAsType (this);\n\t\t\tif (ret_type == null)\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// We don't have to check any others because they are all\n\t\t\t// guaranteed to be accessible - they are standard types.\n\t\t\t//\n\t\t\tif (!IsAccessibleAs (ret_type)) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (ret_type);\n\t\t\t\tReport.Error (58, Location,\n\t\t\t\t\t\t  \"Inconsistent accessibility: return type `\" +\n\t\t\t\t\t\t  ret_type.GetSignatureForError () + \"' is less \" +\n\t\t\t\t\t\t  \"accessible than delegate `\" + GetSignatureForError () + \"'\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tCheckProtectedModifier ();\n\n\t\t\tif (Compiler.Settings.StdLib && ret_type.IsSpecialRuntimeType) {\n\t\t\t\tMethod.Error1599 (Location, ret_type, Report);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tVarianceDecl.CheckTypeVariance (ret_type, Variance.Covariant, this);\n\n\t\t\tvar resolved_rt = new TypeExpression (ret_type, Location);\n\t\t\tInvokeBuilder = new Method (this, resolved_rt, MethodModifiers, new MemberName (InvokeMethodName), p, null);\n\t\t\tInvokeBuilder.Define ();\n\n\t\t\t//\n\t\t\t// Don't emit async method for compiler generated delegates (e.g. dynamic site containers)\n\t\t\t//\n\t\t\tif (!IsCompilerGenerated) {\n\t\t\t\tDefineAsyncMethods (resolved_rt);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid DefineAsyncMethods (TypeExpression returnType)\n\t\t{\n\t\t\tvar iasync_result = Module.PredefinedTypes.IAsyncResult;\n\t\t\tvar async_callback = Module.PredefinedTypes.AsyncCallback;\n\n\t\t\t//\n\t\t\t// It's ok when async types don't exist, the delegate will have Invoke method only\n\t\t\t//\n\t\t\tif (!iasync_result.Define () || !async_callback.Define ())\n\t\t\t\treturn;\n\n\t\t\t//\n\t\t\t// BeginInvoke\n\t\t\t//\n\t\t\tParametersCompiled async_parameters;\n\t\t\tif (Parameters.Count == 0) {\n\t\t\t\tasync_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t} else {\n\t\t\t\tvar compiled = new Parameter[Parameters.Count];\n\t\t\t\tfor (int i = 0; i < compiled.Length; ++i) {\n\t\t\t\t\tvar p = parameters[i];\n\t\t\t\t\tcompiled[i] = new Parameter (new TypeExpression (parameters.Types[i], Location),\n\t\t\t\t\t\tp.Name,\n\t\t\t\t\t\tp.ModFlags & Parameter.Modifier.RefOutMask,\n\t\t\t\t\t\tp.OptAttributes == null ? null : p.OptAttributes.Clone (), Location);\n\t\t\t\t}\n\n\t\t\t\tasync_parameters = new ParametersCompiled (compiled);\n\t\t\t}\n\n\t\t\tasync_parameters = ParametersCompiled.MergeGenerated (Compiler, async_parameters, false,\n\t\t\t\tnew Parameter[] {\n\t\t\t\t\tnew Parameter (new TypeExpression (async_callback.TypeSpec, Location), \"callback\", Parameter.Modifier.NONE, null, Location),\n\t\t\t\t\tnew Parameter (new TypeExpression (Compiler.BuiltinTypes.Object, Location), \"object\", Parameter.Modifier.NONE, null, Location)\n\t\t\t\t},\n\t\t\t\tnew [] {\n\t\t\t\t\tasync_callback.TypeSpec,\n\t\t\t\t\tCompiler.BuiltinTypes.Object\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tBeginInvokeBuilder = new Method (this,\n\t\t\t\tnew TypeExpression (iasync_result.TypeSpec, Location), MethodModifiers,\n\t\t\t\tnew MemberName (\"BeginInvoke\"), async_parameters, null);\n\t\t\tBeginInvokeBuilder.Define ();\n\n\t\t\t//\n\t\t\t// EndInvoke is a bit more interesting, all the parameters labeled as\n\t\t\t// out or ref have to be duplicated here.\n\t\t\t//\n\n\t\t\t//\n\t\t\t// Define parameters, and count out/ref parameters\n\t\t\t//\n\t\t\tParametersCompiled end_parameters;\n\t\t\tint out_params = 0;\n\n\t\t\tforeach (Parameter p in Parameters.FixedParameters) {\n\t\t\t\tif ((p.ModFlags & Parameter.Modifier.RefOutMask) != 0)\n\t\t\t\t\t++out_params;\n\t\t\t}\n\n\t\t\tif (out_params > 0) {\n\t\t\t\tParameter[] end_params = new Parameter[out_params];\n\n\t\t\t\tint param = 0;\n\t\t\t\tfor (int i = 0; i < Parameters.FixedParameters.Length; ++i) {\n\t\t\t\t\tParameter p = parameters [i];\n\t\t\t\t\tif ((p.ModFlags & Parameter.Modifier.RefOutMask) == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tend_params [param++] = new Parameter (new TypeExpression (p.Type, Location),\n\t\t\t\t\t\tp.Name,\n\t\t\t\t\t\tp.ModFlags & Parameter.Modifier.RefOutMask,\n\t\t\t\t\t\tp.OptAttributes == null ? null : p.OptAttributes.Clone (), Location);\n\t\t\t\t}\n\n\t\t\t\tend_parameters = new ParametersCompiled (end_params);\n\t\t\t} else {\n\t\t\t\tend_parameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t}\n\n\t\t\tend_parameters = ParametersCompiled.MergeGenerated (Compiler, end_parameters, false,\n\t\t\t\tnew Parameter (\n\t\t\t\t\tnew TypeExpression (iasync_result.TypeSpec, Location),\n\t\t\t\t\t\"result\", Parameter.Modifier.NONE, null, Location),\n\t\t\t\tiasync_result.TypeSpec);\n\n\t\t\t//\n\t\t\t// Create method, define parameters, register parameters with type system\n\t\t\t//\n\t\t\tEndInvokeBuilder = new Method (this, returnType, MethodModifiers, new MemberName (\"EndInvoke\"), end_parameters, null);\n\t\t\tEndInvokeBuilder.Define ();\n\t\t}\n\n\t\tpublic override void PrepareEmit ()\n\t\t{\n\t\t\tif (!Parameters.IsEmpty) {\n\t\t\t\tparameters.ResolveDefaultValues (this);\n\t\t\t}\n\n\t\t\tInvokeBuilder.PrepareEmit ();\n\t\t\tif (BeginInvokeBuilder != null) {\n\t\t\t\tBeginInvokeBuilder.PrepareEmit ();\n\t\t\t\tEndInvokeBuilder.PrepareEmit ();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tbase.Emit ();\n\n\t\t\tif (ReturnType.Type != null) {\n\t\t\t\tif (ReturnType.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\treturn_attributes = new ReturnParameter (this, InvokeBuilder.MethodBuilder, Location);\n\t\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (return_attributes.Builder);\n\t\t\t\t} else if (ReturnType.Type.HasDynamicElement) {\n\t\t\t\t\treturn_attributes = new ReturnParameter (this, InvokeBuilder.MethodBuilder, Location);\n\t\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (return_attributes.Builder, ReturnType.Type, Location);\n\t\t\t\t}\n\n\t\t\t\tConstraintChecker.Check (this, ReturnType.Type, ReturnType.Location);\n\t\t\t}\n\n\t\t\tConstructor.ParameterInfo.ApplyAttributes (this, Constructor.ConstructorBuilder);\n\t\t\tConstructor.ConstructorBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);\n\n\t\t\tparameters.CheckConstraints (this);\n\t\t\tparameters.ApplyAttributes (this, InvokeBuilder.MethodBuilder);\n\t\t\tInvokeBuilder.MethodBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);\n\n\t\t\tif (BeginInvokeBuilder != null) {\n\t\t\t\tBeginInvokeBuilder.ParameterInfo.ApplyAttributes (this, BeginInvokeBuilder.MethodBuilder);\n\t\t\t\tEndInvokeBuilder.ParameterInfo.ApplyAttributes (this, EndInvokeBuilder.MethodBuilder);\n\n\t\t\t\tBeginInvokeBuilder.MethodBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);\n\t\t\t\tEndInvokeBuilder.MethodBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tbase_type = Compiler.BuiltinTypes.MulticastDelegate;\n\t\t\tbase_class = null;\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override TypeAttributes TypeAttr {\n\t\t\tget {\n\t\t\t\treturn base.TypeAttr | TypeAttributes.Class | TypeAttributes.Sealed;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\n\t\t//TODO: duplicate\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tparameters.VerifyClsCompliance (this);\n\n\t\t\tif (!InvokeBuilder.MemberType.IsCLSCompliant ()) {\n\t\t\t\tReport.Warning (3002, 1, Location, \"Return type of `{0}' is not CLS-compliant\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\n\t\tpublic static MethodSpec GetConstructor (TypeSpec delType)\n\t\t{\n\t\t\tvar ctor = MemberCache.FindMember (delType, MemberFilter.Constructor (null), BindingRestriction.DeclaredOnly);\n\t\t\treturn (MethodSpec) ctor;\n\t\t}\n\n\t\t//\n\t\t// Returns the \"Invoke\" from a delegate type\n\t\t//\n\t\tpublic static MethodSpec GetInvokeMethod (TypeSpec delType)\n\t\t{\n\t\t\tvar invoke = MemberCache.FindMember (delType,\n\t\t\t\tMemberFilter.Method (InvokeMethodName, 0, null, null),\n\t\t\t\tBindingRestriction.DeclaredOnly);\n\n\t\t\treturn (MethodSpec) invoke;\n\t\t}\n\n\t\tpublic static AParametersCollection GetParameters (TypeSpec delType)\n\t\t{\n\t\t\tvar invoke_mb = GetInvokeMethod (delType);\n\t\t\treturn invoke_mb.Parameters;\n\t\t}\n\n\t\t//\n\t\t// 15.2 Delegate compatibility\n\t\t//\n\t\tpublic static bool IsTypeCovariant (ResolveContext rc, TypeSpec a, TypeSpec b)\n\t\t{\n\t\t\t//\n\t\t\t// For each value parameter (a parameter with no ref or out modifier), an \n\t\t\t// identity conversion or implicit reference conversion exists from the\n\t\t\t// parameter type in D to the corresponding parameter type in M\n\t\t\t//\n\t\t\tif (a == b)\n\t\t\t\treturn true;\n\n\t\t\tif (rc.Module.Compiler.Settings.Version == LanguageVersion.ISO_1)\n\t\t\t\treturn false;\n\n\t\t\tif (a.IsGenericParameter && b.IsGenericParameter)\n\t\t\t\treturn a == b;\n\n\t\t\treturn Convert.ImplicitReferenceConversionExists (a, b);\n\t\t}\n\n\t\tpublic static string FullDelegateDesc (MethodSpec invoke_method)\n\t\t{\n\t\t\treturn TypeManager.GetFullNameSignature (invoke_method).Replace (\".Invoke\", \"\");\n\t\t}\n\t\t\n\t\tpublic Expression InstanceExpression {\n\t\t\tget {\n\t\t\t\treturn instance_expr;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tinstance_expr = value;\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Base class for `NewDelegate' and `ImplicitDelegateCreation'\n\t//\n\tpublic abstract class DelegateCreation : Expression, OverloadResolver.IErrorHandler\n\t{\n\t\tbool conditional_access_receiver;\n\t\tprotected MethodSpec constructor_method;\n\t\tprotected MethodGroupExpr method_group;\n\n\t\tpublic bool AllowSpecialMethodsInvocation { get; set; }\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tvar instance = method_group.InstanceExpression;\n\t\t\treturn instance != null && instance.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic static Arguments CreateDelegateMethodArguments (ResolveContext rc, AParametersCollection pd, TypeSpec[] types, Location loc)\n\t\t{\n\t\t\tArguments delegate_arguments = new Arguments (pd.Count);\n\t\t\tfor (int i = 0; i < pd.Count; ++i) {\n\t\t\t\tArgument.AType atype_modifier;\n\t\t\t\tswitch (pd.FixedParameters [i].ModFlags & Parameter.Modifier.RefOutMask) {\n\t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\tatype_modifier = Argument.AType.Ref;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\tatype_modifier = Argument.AType.Out;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tatype_modifier = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tvar ptype = types[i];\n\t\t\t\tif (ptype.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\tptype = rc.BuiltinTypes.Object;\n\n\t\t\t\tdelegate_arguments.Add (new Argument (new TypeExpression (ptype, loc), atype_modifier));\n\t\t\t}\n\n\t\t\treturn delegate_arguments;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tMemberAccess ma = new MemberAccess (new MemberAccess (new QualifiedAliasMember (\"global\", \"System\", loc), \"Delegate\", loc), \"CreateDelegate\", loc);\n\n\t\t\tArguments args = new Arguments (3);\n\t\t\targs.Add (new Argument (new TypeOf (type, loc)));\n\n\t\t\tif (method_group.InstanceExpression == null)\n\t\t\t\targs.Add (new Argument (new NullLiteral (loc)));\n\t\t\telse\n\t\t\t\targs.Add (new Argument (method_group.InstanceExpression));\n\n\t\t\targs.Add (new Argument (method_group.CreateExpressionTree (ec)));\n\t\t\tExpression e = new Invocation (ma, args).Resolve (ec);\n\t\t\tif (e == null)\n\t\t\t\treturn null;\n\n\t\t\te = Convert.ExplicitConversion (ec, e, type, loc);\n\t\t\tif (e == null)\n\t\t\t\treturn null;\n\n\t\t\treturn e.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tconstructor_method = Delegate.GetConstructor (type);\n\n\t\t\tvar invoke_method = Delegate.GetInvokeMethod (type);\n\n\t\t\tif (!ec.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {\n\t\t\t\tif (method_group.HasConditionalAccess ()) {\n\t\t\t\t\tconditional_access_receiver = true;\n\t\t\t\t\tec.Set (ResolveContext.Options.ConditionalAccessReceiver);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tArguments arguments = CreateDelegateMethodArguments (ec, invoke_method.Parameters, invoke_method.Parameters.Types, loc);\n\t\t\tmethod_group = method_group.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.CovariantDelegate);\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tec.With (ResolveContext.Options.ConditionalAccessReceiver, false);\n\n\t\t\tif (method_group == null)\n\t\t\t\treturn null;\n\n\t\t\tvar delegate_method = method_group.BestCandidate;\n\t\t\t\n\t\t\tif (delegate_method.DeclaringType.IsNullableType) {\n\t\t\t\tec.Report.Error (1728, loc, \"Cannot create delegate from method `{0}' because it is a member of System.Nullable<T> type\",\n\t\t\t\t\tdelegate_method.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif (!AllowSpecialMethodsInvocation)\n\t\t\t\tInvocation.IsSpecialMethodInvocation (ec, delegate_method, loc);\n\n\t\t\tExtensionMethodGroupExpr emg = method_group as ExtensionMethodGroupExpr;\n\t\t\tif (emg != null) {\n\t\t\t\tmethod_group.InstanceExpression = emg.ExtensionExpression;\n\t\t\t\tTypeSpec e_type = emg.ExtensionExpression.Type;\n\t\t\t\tif (TypeSpec.IsValueType (e_type)) {\n\t\t\t\t\tec.Report.Error (1113, loc, \"Extension method `{0}' of value type `{1}' cannot be used to create delegates\",\n\t\t\t\t\t\tdelegate_method.GetSignatureForError (), e_type.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tTypeSpec rt = method_group.BestCandidateReturnType;\n\t\t\tif (rt.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\trt = ec.BuiltinTypes.Object;\n\n\t\t\tif (!Delegate.IsTypeCovariant (ec, rt, invoke_method.ReturnType)) {\n\t\t\t\tExpression ret_expr = new TypeExpression (delegate_method.ReturnType, loc);\n\t\t\t\tError_ConversionFailed (ec, delegate_method, ret_expr);\n\t\t\t}\n\n\t\t\tif (method_group.IsConditionallyExcluded) {\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (delegate_method);\n\t\t\t\tMethodOrOperator m = delegate_method.MemberDefinition as MethodOrOperator;\n\t\t\t\tif (m != null && m.IsPartialDefinition) {\n\t\t\t\t\tec.Report.Error (762, loc, \"Cannot create delegate from partial method declaration `{0}'\",\n\t\t\t\t\t\tdelegate_method.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tec.Report.Error (1618, loc, \"Cannot create delegate with `{0}' because it has a Conditional attribute\",\n\t\t\t\t\t\tTypeManager.CSharpSignature (delegate_method));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar expr = method_group.InstanceExpression;\n\t\t\tif (expr != null && (expr.Type.IsGenericParameter || !TypeSpec.IsReferenceType (expr.Type)))\n\t\t\t\tmethod_group.InstanceExpression = new BoxedCast (expr, ec.BuiltinTypes.Object);\n\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());\n\n\t\t\tif (method_group.InstanceExpression == null) {\n\t\t\t\tec.EmitNull ();\n\t\t\t} else {\n\t\t\t\tvar ie = new InstanceEmitter (method_group.InstanceExpression, false);\n\t\t\t\tie.Emit (ec, method_group.ConditionalAccess);\n\t\t\t}\n\n\t\t\tvar delegate_method = method_group.BestCandidate;\n\n\t\t\t// Any delegate must be sealed\n\t\t\tif (!delegate_method.DeclaringType.IsDelegate && delegate_method.IsVirtual && !method_group.IsBase) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\tec.Emit (OpCodes.Ldvirtftn, delegate_method);\n\t\t\t} else {\n\t\t\t\tec.Emit (OpCodes.Ldftn, delegate_method);\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Newobj, constructor_method);\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tec.CloseConditionalAccess (null);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tbase.FlowAnalysis (fc);\n\t\t\tmethod_group.FlowAnalysis (fc);\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tfc.ConditionalAccessEnd ();\n\t\t}\n\n\t\tvoid Error_ConversionFailed (ResolveContext ec, MethodSpec method, Expression return_type)\n\t\t{\n\t\t\tvar invoke_method = Delegate.GetInvokeMethod (type);\n\t\t\tstring member_name = method_group.InstanceExpression != null ?\n\t\t\t\tDelegate.FullDelegateDesc (method) :\n\t\t\t\tTypeManager.GetFullNameSignature (method);\n\n\t\t\tec.Report.SymbolRelatedToPreviousError (type);\n\t\t\tec.Report.SymbolRelatedToPreviousError (method);\n\t\t\tif (ec.Module.Compiler.Settings.Version == LanguageVersion.ISO_1) {\n\t\t\t\tec.Report.Error (410, loc, \"A method or delegate `{0} {1}' parameters and return type must be same as delegate `{2} {3}' parameters and return type\",\n\t\t\t\t\tmethod.ReturnType.GetSignatureForError (), member_name,\n\t\t\t\t\tinvoke_method.ReturnType.GetSignatureForError (), Delegate.FullDelegateDesc (invoke_method));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (return_type == null) {\n\t\t\t\tec.Report.Error (123, loc, \"A method or delegate `{0}' parameters do not match delegate `{1}' parameters\",\n\t\t\t\t\tmember_name, Delegate.FullDelegateDesc (invoke_method));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tec.Report.Error (407, loc, \"A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' return type\",\n\t\t\t\treturn_type.GetSignatureForError (), member_name,\n\t\t\t\tinvoke_method.ReturnType.GetSignatureForError (), Delegate.FullDelegateDesc (invoke_method));\n\t\t}\n\n\t\tpublic static bool ImplicitStandardConversionExists (ResolveContext ec, MethodGroupExpr mg, TypeSpec target_type)\n\t\t{\n//\t\t\tif (target_type == TypeManager.delegate_type || target_type == TypeManager.multicast_delegate_type)\n//\t\t\t\treturn false;\n\n\t\t\tvar invoke = Delegate.GetInvokeMethod (target_type);\n\n\t\t\tArguments arguments = CreateDelegateMethodArguments (ec, invoke.Parameters, invoke.Parameters.Types, mg.Location);\n\t\t\treturn mg.OverloadResolve (ec, ref arguments, null, OverloadResolver.Restrictions.CovariantDelegate | OverloadResolver.Restrictions.ProbingOnly) != null;\n\t\t}\n\n\t\t#region IErrorHandler Members\n\n\t\tbool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tbool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)\n\t\t{\n\t\t\tError_ConversionFailed (rc, best as MethodSpec, null);\n\t\t\treturn true;\n\t\t}\n\n\t\tbool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)\n\t\t{\n\t\t\tError_ConversionFailed (rc, best as MethodSpec, null);\n\t\t\treturn true;\n\t\t}\n\n\t\tbool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t//\n\t// Created from the conversion code\n\t//\n\tpublic class ImplicitDelegateCreation : DelegateCreation\n\t{\n\t\tField mg_cache;\n\n\t\tpublic ImplicitDelegateCreation (TypeSpec delegateType, MethodGroupExpr mg, Location loc)\n\t\t{\n\t\t\ttype = delegateType;\n\t\t\tthis.method_group = mg;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t//\n\t\t// Returns true when type is MVAR or has MVAR reference\n\t\t//\n\t\tpublic static bool ContainsMethodTypeParameter (TypeSpec type)\n\t\t{\n\t\t\tvar tps = type as TypeParameterSpec;\n\t\t\tif (tps != null)\n\t\t\t\treturn tps.IsMethodOwned;\n\n\t\t\tvar ec = type as ElementTypeSpec;\n\t\t\tif (ec != null)\n\t\t\t\treturn ContainsMethodTypeParameter (ec.Element);\n\n\t\t\tforeach (var t in type.TypeArguments) {\n\t\t\t\tif (ContainsMethodTypeParameter (t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (type.IsNested)\n\t\t\t\treturn ContainsMethodTypeParameter (type.DeclaringType);\n\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool HasMvar ()\n\t\t{\n\t\t\tif (ContainsMethodTypeParameter (type))\n\t\t\t\treturn false;\n\n\t\t\tvar best = method_group.BestCandidate;\n\t\t\tif (ContainsMethodTypeParameter (best.DeclaringType))\n\t\t\t\treturn false;\n\n\t\t\tif (best.TypeArguments != null) {\n\t\t\t\tforeach (var ta in best.TypeArguments) {\n\t\t\t\t\tif (ContainsMethodTypeParameter (ta))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tvar expr = base.DoResolve (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn ErrorExpression.Instance;\n\n\t\t\tif (ec.IsInProbingMode)\n\t\t\t\treturn expr;\n\n\t\t\t//\n\t\t\t// Cache any static delegate creation\n\t\t\t//\n\t\t\tif (method_group.InstanceExpression != null)\n\t\t\t\treturn expr;\n\n\t\t\t//\n\t\t\t// Cannot easily cache types with MVAR\n\t\t\t//\n\t\t\tif (!HasMvar ())\n\t\t\t\treturn expr;\n\n\t\t\t//\n\t\t\t// Create type level cache for a delegate instance\n\t\t\t//\n\t\t\tvar parent = ec.CurrentMemberDefinition.Parent.PartialContainer;\n\t\t\tint id = parent.MethodGroupsCounter++;\n\n\t\t\tmg_cache = new Field (parent, new TypeExpression (type, loc),\n\t\t\t\tModifiers.STATIC | Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED,\n\t\t\t\tnew MemberName (CompilerGeneratedContainer.MakeName (null, \"f\", \"mg$cache\", id), loc), null);\n\t\t\tmg_cache.Define ();\n\t\t\tparent.AddField (mg_cache);\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLabel l_initialized = ec.DefineLabel ();\n\n\t\t\tif (mg_cache != null) {\n\t\t\t\tec.Emit (OpCodes.Ldsfld, mg_cache.Spec);\n\t\t\t\tec.Emit (OpCodes.Brtrue_S, l_initialized);\n\t\t\t}\n\n\t\t\tbase.Emit (ec);\n\n\t\t\tif (mg_cache != null) {\n\t\t\t\tec.Emit (OpCodes.Stsfld, mg_cache.Spec);\n\t\t\t\tec.MarkLabel (l_initialized);\n\t\t\t\tec.Emit (OpCodes.Ldsfld, mg_cache.Spec);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//\n\t// A delegate-creation-expression, invoked from the `New' class \n\t//\n\tpublic class NewDelegate : DelegateCreation\n\t{\n\t\tpublic Arguments Arguments;\n\n\t\t//\n\t\t// This constructor is invoked from the `New' expression\n\t\t//\n\t\tpublic NewDelegate (TypeSpec type, Arguments Arguments, Location loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\tthis.Arguments = Arguments;\n\t\t\tthis.loc  = loc; \n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (Arguments == null || Arguments.Count != 1) {\n\t\t\t\tec.Report.Error (149, loc, \"Method name expected\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tArgument a = Arguments [0];\n\t\t\tif (!a.ResolveMethodGroup (ec))\n\t\t\t\treturn null;\n\n\t\t\tExpression e = a.Expr;\n\n\t\t\tAnonymousMethodExpression ame = e as AnonymousMethodExpression;\n\t\t\tif (ame != null && ec.Module.Compiler.Settings.Version != LanguageVersion.ISO_1) {\n\t\t\t\te = ame.Compatible (ec, type);\n\t\t\t\tif (e == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn e.Resolve (ec);\n\t\t\t}\n\n\t\t\tmethod_group = e as MethodGroupExpr;\n\t\t\tif (method_group == null) {\n\t\t\t\tif (e.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\te = Convert.ImplicitConversionRequired (ec, e, type, loc);\n\t\t\t\t} else if (!e.Type.IsDelegate) {\n\t\t\t\t\te.Error_UnexpectedKind (ec, ResolveFlags.MethodGroup | ResolveFlags.Type, loc);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// An argument is not a method but another delegate\n\t\t\t\t//\n\t\t\t\tmethod_group = new MethodGroupExpr (Delegate.GetInvokeMethod (e.Type), e.Type, loc);\n\t\t\t\tmethod_group.InstanceExpression = e;\n\t\t\t}\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\t}\n\n\t//\n\t// Invocation converted to delegate Invoke call\n\t//\n\tclass DelegateInvocation : ExpressionStatement\n\t{\n\t\treadonly Expression InstanceExpr;\n\t\treadonly bool conditionalAccessReceiver;\n\t\tArguments arguments;\n\t\tMethodSpec method;\n\t\t\n\t\tpublic DelegateInvocation (Expression instance_expr, Arguments args, bool conditionalAccessReceiver, Location loc)\n\t\t{\n\t\t\tthis.InstanceExpr = instance_expr;\n\t\t\tthis.arguments = args;\n\t\t\tthis.conditionalAccessReceiver = conditionalAccessReceiver;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn InstanceExpr.ContainsEmitWithAwait () || (arguments != null && arguments.ContainsEmitWithAwait ());\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = Arguments.CreateForExpressionTree (ec, this.arguments,\n\t\t\t\tInstanceExpr.CreateExpressionTree (ec));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Invoke\", args);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tInstanceExpr.FlowAnalysis (fc);\n\t\t\tif (arguments != null)\n\t\t\t\targuments.FlowAnalysis (fc);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\t\t\n\t\t\tTypeSpec del_type = InstanceExpr.Type;\n\t\t\tif (del_type == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Do only core overload resolution the rest of the checks has been\n\t\t\t// done on primary expression\n\t\t\t//\n\t\t\tmethod = Delegate.GetInvokeMethod (del_type);\n\t\t\tvar res = new OverloadResolver (new MemberSpec[] { method }, OverloadResolver.Restrictions.DelegateInvoke, loc);\n\t\t\tvar valid = res.ResolveMember<MethodSpec> (ec, ref arguments);\n\t\t\tif (valid == null && !res.BestCandidateIsDynamic)\n\t\t\t\treturn null;\n\n\t\t\ttype = method.ReturnType;\n\t\t\tif (conditionalAccessReceiver)\n\t\t\t\ttype = LiftMemberType (ec, type);\n\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (conditionalAccessReceiver) {\n\t\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Invocation on delegates call the virtual Invoke member\n\t\t\t// so we are always `instance' calls\n\t\t\t//\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = InstanceExpr;\n\t\t\tcall.Emit (ec, method, arguments, loc);\n\n\t\t\tif (conditionalAccessReceiver)\n\t\t\t\tec.CloseConditionalAccess (type.IsNullableType && type !=  method.ReturnType ? type : null);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tif (conditionalAccessReceiver) {\n\t\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ()) {\n\t\t\t\t\tStatement = true\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = InstanceExpr;\n\t\t\tcall.EmitStatement (ec, method, arguments, loc);\n\n\t\t\tif (conditionalAccessReceiver)\n\t\t\t\tec.CloseConditionalAccess (null);\n\t\t}\n\n\t\tpublic override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn Invocation.MakeExpression (ctx, InstanceExpr, method, arguments);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/doc.cs",
    "content": "//\n// doc.cs: Support for XML documentation comment.\n//\n// Authors:\n//\tAtsushi Enomoto <atsushi@ximian.com>\n//  Marek Safar (marek.safar@gmail.com>\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2004 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing System.Linq;\n\nnamespace Mono.CSharp\n{\n\t//\n\t// Implements XML documentation generation.\n\t//\n\tclass DocumentationBuilder\n\t{\n\t\t//\n\t\t// Used to create element which helps well-formedness checking.\n\t\t//\n\t\treadonly XmlDocument XmlDocumentation;\n\n\t\treadonly ModuleContainer module;\n\t\treadonly ModuleContainer doc_module;\n\n\t\t//\n\t\t// The output for XML documentation.\n\t\t//\n\t\tXmlWriter XmlCommentOutput;\n\n\t\tstatic readonly string line_head = Environment.NewLine + \"            \";\n\n\t\t//\n\t\t// Stores XmlDocuments that are included in XML documentation.\n\t\t// Keys are included filenames, values are XmlDocuments.\n\t\t//\n\t\tDictionary<string, XmlDocument> StoredDocuments = new Dictionary<string, XmlDocument> ();\n\n\t\tParserSession session;\n\n\t\tpublic DocumentationBuilder (ModuleContainer module)\n\t\t{\n\t\t\tdoc_module = new ModuleContainer (module.Compiler);\n\t\t\tdoc_module.DocumentationBuilder = this;\n\n\t\t\tthis.module = module;\n\t\t\tXmlDocumentation = new XmlDocument ();\n\t\t\tXmlDocumentation.PreserveWhitespace = false;\n\t\t}\n\n\t\tReport Report {\n\t\t\tget {\n\t\t\t\treturn module.Compiler.Report;\n\t\t\t}\n\t\t}\n\n\t\tpublic MemberName ParsedName {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic List<DocumentationParameter> ParsedParameters {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic TypeExpression ParsedBuiltinType {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic Operator.OpType? ParsedOperator {\n\t\t\tget; set;\n\t\t}\n\n\t\tXmlNode GetDocCommentNode (MemberCore mc, string name)\n\t\t{\n\t\t\t// FIXME: It could be even optimizable as not\n\t\t\t// to use XmlDocument. But anyways the nodes\n\t\t\t// are not kept in memory.\n\t\t\tXmlDocument doc = XmlDocumentation;\n\t\t\ttry {\n\t\t\t\tXmlElement el = doc.CreateElement (\"member\");\n\t\t\t\tel.SetAttribute (\"name\", name);\n\t\t\t\tstring normalized = mc.DocComment;\n\t\t\t\tel.InnerXml = normalized;\n\t\t\t\t// csc keeps lines as written in the sources\n\t\t\t\t// and inserts formatting indentation (which \n\t\t\t\t// is different from XmlTextWriter.Formatting\n\t\t\t\t// one), but when a start tag contains an \n\t\t\t\t// endline, it joins the next line. We don't\n\t\t\t\t// have to follow such a hacky behavior.\n\t\t\t\tstring [] split =\n\t\t\t\t\tnormalized.Split ('\\n');\n\t\t\t\tint j = 0;\n\t\t\t\tfor (int i = 0; i < split.Length; i++) {\n\t\t\t\t\tstring s = split [i].TrimEnd ();\n\t\t\t\t\tif (s.Length > 0)\n\t\t\t\t\t\tsplit [j++] = s;\n\t\t\t\t}\n\t\t\t\tel.InnerXml = line_head + String.Join (\n\t\t\t\t\tline_head, split, 0, j);\n\t\t\t\treturn el;\n\t\t\t} catch (Exception ex) {\n\t\t\t\tReport.Warning (1570, 1, mc.Location, \"XML documentation comment on `{0}' is not well-formed XML markup ({1})\",\n\t\t\t\t\tmc.GetSignatureForError (), ex.Message);\n\n\t\t\t\treturn doc.CreateComment (String.Format (\"FIXME: Invalid documentation markup was found for member {0}\", name));\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Generates xml doc comments (if any), and if required,\n\t\t// handle warning report.\n\t\t//\n\t\tinternal void GenerateDocumentationForMember (MemberCore mc)\n\t\t{\n\t\t\tstring name = mc.DocCommentHeader + mc.GetSignatureForDocumentation ();\n\n\t\t\tXmlNode n = GetDocCommentNode (mc, name);\n\n\t\t\tXmlElement el = n as XmlElement;\n\t\t\tif (el != null) {\n\t\t\t\tvar pm = mc as IParametersMember;\n\t\t\t\tif (pm != null) {\n\t\t\t\t\tCheckParametersComments (mc, pm, el);\n\t\t\t\t}\n\n\t\t\t\t// FIXME: it could be done with XmlReader\n\t\t\t\tXmlNodeList nl = n.SelectNodes (\".//include\");\n\t\t\t\tif (nl.Count > 0) {\n\t\t\t\t\t// It could result in current node removal, so prepare another list to iterate.\n\t\t\t\t\tvar al = new List<XmlNode> (nl.Count);\n\t\t\t\t\tforeach (XmlNode inc in nl)\n\t\t\t\t\t\tal.Add (inc);\n\t\t\t\t\tforeach (XmlElement inc in al)\n\t\t\t\t\t\tif (!HandleInclude (mc, inc))\n\t\t\t\t\t\t\tinc.ParentNode.RemoveChild (inc);\n\t\t\t\t}\n\n\t\t\t\t// FIXME: it could be done with XmlReader\n\n\t\t\t\tforeach (XmlElement see in n.SelectNodes (\".//see\"))\n\t\t\t\t\tHandleSee (mc, see);\n\t\t\t\tforeach (XmlElement seealso in n.SelectNodes (\".//seealso\"))\n\t\t\t\t\tHandleSeeAlso (mc, seealso);\n\t\t\t\tforeach (XmlElement see in n.SelectNodes (\".//exception\"))\n\t\t\t\t\tHandleException (mc, see);\n\t\t\t\tforeach (XmlElement node in n.SelectNodes (\".//typeparam\"))\n\t\t\t\t\tHandleTypeParam (mc, node);\n\t\t\t\tforeach (XmlElement node in n.SelectNodes (\".//typeparamref\"))\n\t\t\t\t\tHandleTypeParamRef (mc, node);\n\t\t\t}\n\n\t\t\tn.WriteTo (XmlCommentOutput);\n\t\t}\n\n\t\t//\n\t\t// Processes \"include\" element. Check included file and\n\t\t// embed the document content inside this documentation node.\n\t\t//\n\t\tbool HandleInclude (MemberCore mc, XmlElement el)\n\t\t{\n\t\t\tbool keep_include_node = false;\n\t\t\tstring file = el.GetAttribute (\"file\");\n\t\t\tstring path = el.GetAttribute (\"path\");\n\n\t\t\tif (file == \"\") {\n\t\t\t\tReport.Warning (1590, 1, mc.Location, \"Invalid XML `include' element. Missing `file' attribute\");\n\t\t\t\tel.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (\" Include tag is invalid \"), el);\n\t\t\t\tkeep_include_node = true;\n\t\t\t} else if (path.Length == 0) {\n\t\t\t\tReport.Warning (1590, 1, mc.Location, \"Invalid XML `include' element. Missing `path' attribute\");\n\t\t\t\tel.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (\" Include tag is invalid \"), el);\n\t\t\t\tkeep_include_node = true;\n\t\t\t} else {\n\t\t\t\tXmlDocument doc;\n\t\t\t\tException exception = null;\n\t\t\t\tvar full_path = Path.Combine (Path.GetDirectoryName (mc.Location.NameFullPath), file);\n\n\t\t\t\tif (!StoredDocuments.TryGetValue (full_path, out doc)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdoc = new XmlDocument ();\n\t\t\t\t\t\tdoc.Load (full_path);\n\t\t\t\t\t\tStoredDocuments.Add (full_path, doc);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\texception = e;\n\t\t\t\t\t\tel.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (String.Format (\" Badly formed XML in at comment file `{0}': cannot be included \", file)), el);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (doc != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tXmlNodeList nl = doc.SelectNodes (path);\n\t\t\t\t\t\tif (nl.Count == 0) {\n\t\t\t\t\t\t\tel.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (\" No matching elements were found for the include tag embedded here. \"), el);\n\t\t\t\t\t\n\t\t\t\t\t\t\tkeep_include_node = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach (XmlNode n in nl)\n\t\t\t\t\t\t\tel.ParentNode.InsertBefore (el.OwnerDocument.ImportNode (n, true), el);\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\texception = ex;\n\t\t\t\t\t\tel.ParentNode.InsertBefore (el.OwnerDocument.CreateComment (\" Failed to insert some or all of included XML \"), el);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (exception != null) {\n\t\t\t\t\tReport.Warning (1589, 1, mc.Location, \"Unable to include XML fragment `{0}' of file `{1}'. {2}\",\n\t\t\t\t\t\tpath, file, exception.Message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn keep_include_node;\n\t\t}\n\n\t\t//\n\t\t// Handles <see> elements.\n\t\t//\n\t\tvoid HandleSee (MemberCore mc, XmlElement see)\n\t\t{\n\t\t\tHandleXrefCommon (mc, see);\n\t\t}\n\n\t\t//\n\t\t// Handles <seealso> elements.\n\t\t//\n\t\tvoid HandleSeeAlso (MemberCore mc, XmlElement seealso)\n\t\t{\n\t\t\tHandleXrefCommon (mc, seealso);\n\t\t}\n\n\t\t//\n\t\t// Handles <exception> elements.\n\t\t//\n\t\tvoid HandleException (MemberCore mc, XmlElement seealso)\n\t\t{\n\t\t\tHandleXrefCommon (mc, seealso);\n\t\t}\n\n\t\t//\n\t\t// Handles <typeparam /> node\n\t\t//\n\t\tstatic void HandleTypeParam (MemberCore mc, XmlElement node)\n\t\t{\n\t\t\tif (!node.HasAttribute (\"name\"))\n\t\t\t\treturn;\n\n\t\t\tstring tp_name = node.GetAttribute (\"name\");\n\t\t\tif (mc.CurrentTypeParameters != null) {\n\t\t\t\tif (mc.CurrentTypeParameters.Find (tp_name) != null)\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// TODO: CS1710, CS1712\n\t\t\t\n\t\t\tmc.Compiler.Report.Warning (1711, 2, mc.Location,\n\t\t\t\t\"XML comment on `{0}' has a typeparam name `{1}' but there is no type parameter by that name\",\n\t\t\t\tmc.GetSignatureForError (), tp_name);\n\t\t}\n\n\t\t//\n\t\t// Handles <typeparamref /> node\n\t\t//\n\t\tstatic void HandleTypeParamRef (MemberCore mc, XmlElement node)\n\t\t{\n\t\t\tif (!node.HasAttribute (\"name\"))\n\t\t\t\treturn;\n\n\t\t\tstring tp_name = node.GetAttribute (\"name\");\n\t\t\tvar member = mc;\n\t\t\tdo {\n\t\t\t\tif (member.CurrentTypeParameters != null) {\n\t\t\t\t\tif (member.CurrentTypeParameters.Find (tp_name) != null)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tmember = member.Parent;\n\t\t\t} while (member != null);\n\n\t\t\tmc.Compiler.Report.Warning (1735, 2, mc.Location,\n\t\t\t\t\"XML comment on `{0}' has a typeparamref name `{1}' that could not be resolved\",\n\t\t\t\tmc.GetSignatureForError (), tp_name);\n\t\t}\n\n\t\tFullNamedExpression ResolveMemberName (IMemberContext context, MemberName mn)\n\t\t{\n\t\t\tif (mn.Left == null)\n\t\t\t\treturn context.LookupNamespaceOrType (mn.Name, mn.Arity, LookupMode.Probing, Location.Null);\n\n\t\t\tvar left = ResolveMemberName (context, mn.Left);\n\t\t\tvar ns = left as NamespaceExpression;\n\t\t\tif (ns != null)\n\t\t\t\treturn ns.LookupTypeOrNamespace (context, mn.Name, mn.Arity, LookupMode.Probing, Location.Null);\n\n\t\t\tTypeExpr texpr = left as TypeExpr;\n\t\t\tif (texpr != null) {\n\t\t\t\tvar found = MemberCache.FindNestedType (texpr.Type, mn.Name, mn.Arity);\n\t\t\t\tif (found != null)\n\t\t\t\t\treturn new TypeExpression (found, Location.Null);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn left;\n\t\t}\n\n\t\t//\n\t\t// Processes \"see\" or \"seealso\" elements from cref attribute.\n\t\t//\n\t\tvoid HandleXrefCommon (MemberCore mc, XmlElement xref)\n\t\t{\n\t\t\tstring cref = xref.GetAttribute (\"cref\");\n\t\t\t// when, XmlReader, \"if (cref == null)\"\n\t\t\tif (!xref.HasAttribute (\"cref\"))\n\t\t\t\treturn;\n\n\t\t\t// Nothing to be resolved the reference is marked explicitly\n\t\t\tif (cref.Length > 2 && cref [1] == ':')\n\t\t\t\treturn;\n\n\t\t\t// Additional symbols for < and > are allowed for easier XML typing\n\t\t\tcref = cref.Replace ('{', '<').Replace ('}', '>');\n\n\t\t\tvar encoding = module.Compiler.Settings.Encoding;\n\t\t\tvar s = new MemoryStream (encoding.GetBytes (cref));\n\n\t\t\tvar source_file = new CompilationSourceFile (doc_module, mc.Location.SourceFile);\n\t\t\tvar report = new Report (doc_module.Compiler, new NullReportPrinter ());\n\n\t\t\tif (session == null)\n\t\t\t\tsession = new ParserSession {\n\t\t\t\t\tUseJayGlobalArrays = true\n\t\t\t\t};\n\n\t\t\tSeekableStreamReader seekable = new SeekableStreamReader (s, encoding, session.StreamReaderBuffer);\n\n\t\t\tvar parser = new CSharpParser (seekable, source_file, report, session);\n\t\t\tParsedParameters = null;\n\t\t\tParsedName = null;\n\t\t\tParsedBuiltinType = null;\n\t\t\tParsedOperator = null;\n\t\t\tparser.Lexer.putback_char = Tokenizer.DocumentationXref;\n\t\t\tparser.Lexer.parsing_generic_declaration_doc = true;\n\t\t\tparser.parse ();\n\t\t\tif (report.Errors > 0) {\n\t\t\t\tReport.Warning (1584, 1, mc.Location, \"XML comment on `{0}' has syntactically incorrect cref attribute `{1}'\",\n\t\t\t\t\tmc.GetSignatureForError (), cref);\n\n\t\t\t\txref.SetAttribute (\"cref\", \"!:\" + cref);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tMemberSpec member;\n\t\t\tstring prefix = null;\n\t\t\tFullNamedExpression fne = null;\n\n\t\t\t//\n\t\t\t// Try built-in type first because we are using ParsedName as identifier of\n\t\t\t// member names on built-in types\n\t\t\t//\n\t\t\tif (ParsedBuiltinType != null && (ParsedParameters == null || ParsedName != null)) {\n\t\t\t\tmember = ParsedBuiltinType.Type;\n\t\t\t} else {\n\t\t\t\tmember = null;\n\t\t\t}\n\n\t\t\tif (ParsedName != null || ParsedOperator.HasValue) {\n\t\t\t\tTypeSpec type = null;\n\t\t\t\tstring member_name = null;\n\n\t\t\t\tif (member == null) {\n\t\t\t\t\tif (ParsedOperator.HasValue) {\n\t\t\t\t\t\ttype = mc.CurrentType;\n\t\t\t\t\t} else if (ParsedName.Left != null) {\n\t\t\t\t\t\tfne = ResolveMemberName (mc, ParsedName.Left);\n\t\t\t\t\t\tif (fne != null) {\n\t\t\t\t\t\t\tvar ns = fne as NamespaceExpression;\n\t\t\t\t\t\t\tif (ns != null) {\n\t\t\t\t\t\t\t\tfne = ns.LookupTypeOrNamespace (mc, ParsedName.Name, ParsedName.Arity, LookupMode.Probing, Location.Null);\n\t\t\t\t\t\t\t\tif (fne != null) {\n\t\t\t\t\t\t\t\t\tmember = fne.Type;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttype = fne.Type;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfne = ResolveMemberName (mc, ParsedName);\n\t\t\t\t\t\tif (fne == null) {\n\t\t\t\t\t\t\ttype = mc.CurrentType;\n\t\t\t\t\t\t} else if (ParsedParameters == null) {\n\t\t\t\t\t\t\tmember = fne.Type;\n\t\t\t\t\t\t} else if (fne.Type.MemberDefinition == mc.CurrentType.MemberDefinition) {\n\t\t\t\t\t\t\tmember_name = Constructor.ConstructorName;\n\t\t\t\t\t\t\ttype = fne.Type;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttype = (TypeSpec) member;\n\t\t\t\t\tmember = null;\n\t\t\t\t}\n\n\t\t\t\tif (ParsedParameters != null) {\n\t\t\t\t\tvar old_printer = mc.Module.Compiler.Report.SetPrinter (new NullReportPrinter ());\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar context = new DocumentationMemberContext (mc, ParsedName ?? MemberName.Null);\n\n\t\t\t\t\t\tforeach (var pp in ParsedParameters) {\n\t\t\t\t\t\t\tpp.Resolve (context);\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tmc.Module.Compiler.Report.SetPrinter (old_printer);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (type != null) {\n\t\t\t\t\tif (member_name == null)\n\t\t\t\t\t\tmember_name = ParsedOperator.HasValue ?\n\t\t\t\t\t\t\tOperator.GetMetadataName (ParsedOperator.Value) : ParsedName.Name;\n\n\t\t\t\t\tint parsed_param_count;\n\t\t\t\t\tif (ParsedOperator == Operator.OpType.Explicit || ParsedOperator == Operator.OpType.Implicit) {\n\t\t\t\t\t\tparsed_param_count = ParsedParameters.Count - 1;\n\t\t\t\t\t} else if (ParsedParameters != null) {\n\t\t\t\t\t\tparsed_param_count = ParsedParameters.Count;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparsed_param_count = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tint parameters_match = -1;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tvar members = MemberCache.FindMembers (type, member_name, true);\n\t\t\t\t\t\tif (members != null) {\n\t\t\t\t\t\t\tforeach (var m in members) {\n\t\t\t\t\t\t\t\tif (ParsedName != null && m.Arity != ParsedName.Arity)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (ParsedParameters != null) {\n\t\t\t\t\t\t\t\t\tIParametersMember pm = m as IParametersMember;\n\t\t\t\t\t\t\t\t\tif (pm == null)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tif (m.Kind == MemberKind.Operator && !ParsedOperator.HasValue)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tvar pm_params = pm.Parameters;\n\n\t\t\t\t\t\t\t\t\tint i;\n\t\t\t\t\t\t\t\t\tfor (i = 0; i < parsed_param_count; ++i) {\n\t\t\t\t\t\t\t\t\t\tvar pparam = ParsedParameters[i];\n\n\t\t\t\t\t\t\t\t\t\tif (i >= pm_params.Count || pparam == null || pparam.TypeSpec == null ||\n\t\t\t\t\t\t\t\t\t\t\t!TypeSpecComparer.Override.IsEqual (pparam.TypeSpec, pm_params.Types[i]) ||\n\t\t\t\t\t\t\t\t\t\t\t(pparam.Modifier & Parameter.Modifier.RefOutMask) != (pm_params.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask)) {\n\n\t\t\t\t\t\t\t\t\t\t\tif (i > parameters_match) {\n\t\t\t\t\t\t\t\t\t\t\t\tparameters_match = i;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\ti = -1;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (i < 0)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tif (ParsedOperator == Operator.OpType.Explicit || ParsedOperator == Operator.OpType.Implicit) {\n\t\t\t\t\t\t\t\t\t\tif (pm.MemberType != ParsedParameters[parsed_param_count].TypeSpec) {\n\t\t\t\t\t\t\t\t\t\t\tparameters_match = parsed_param_count + 1;\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif (parsed_param_count != pm_params.Count)\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (member != null) {\n\t\t\t\t\t\t\t\t\tReport.Warning (419, 3, mc.Location,\n\t\t\t\t\t\t\t\t\t\t\"Ambiguous reference in cref attribute `{0}'. Assuming `{1}' but other overloads including `{2}' have also matched\",\n\t\t\t\t\t\t\t\t\t\tcref, member.GetSignatureForError (), m.GetSignatureForError ());\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tmember = m;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Continue with parent type for nested types\n\t\t\t\t\t\tif (member == null) {\n\t\t\t\t\t\t\ttype = type.DeclaringType;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttype = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (type != null);\n\n\t\t\t\t\tif (member == null && parameters_match >= 0) {\n\t\t\t\t\t\tfor (int i = parameters_match; i < parsed_param_count; ++i) {\n\t\t\t\t\t\t\tReport.Warning (1580, 1, mc.Location, \"Invalid type for parameter `{0}' in XML comment cref attribute `{1}'\",\n\t\t\t\t\t\t\t\t\t(i + 1).ToString (), cref);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (parameters_match == parsed_param_count + 1) {\n\t\t\t\t\t\t\tReport.Warning (1581, 1, mc.Location, \"Invalid return type in XML comment cref attribute `{0}'\", cref);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (member == null) {\n\t\t\t\tReport.Warning (1574, 1, mc.Location, \"XML comment on `{0}' has cref attribute `{1}' that could not be resolved\",\n\t\t\t\t\tmc.GetSignatureForError (), cref);\n\t\t\t\tcref = \"!:\" + cref;\n\t\t\t} else if (member == InternalType.Namespace) {\n\t\t\t\tcref = \"N:\" + fne.GetSignatureForError ();\n\t\t\t} else {\n\t\t\t\tprefix = GetMemberDocHead (member);\n\t\t\t\tcref = prefix + member.GetSignatureForDocumentation ();\n\t\t\t}\n\n\t\t\txref.SetAttribute (\"cref\", cref);\n\t\t}\n\n\t\t//\n\t\t// Get a prefix from member type for XML documentation (used\n\t\t// to formalize cref target name).\n\t\t//\n\t\tstatic string GetMemberDocHead (MemberSpec type)\n\t\t{\n\t\t\tif (type is FieldSpec)\n\t\t\t\treturn \"F:\";\n\t\t\tif (type is MethodSpec)\n\t\t\t\treturn \"M:\";\n\t\t\tif (type is EventSpec)\n\t\t\t\treturn \"E:\";\n\t\t\tif (type is PropertySpec)\n\t\t\t\treturn \"P:\";\n\t\t\tif (type is TypeSpec)\n\t\t\t\treturn \"T:\";\n\n\t\t\tthrow new NotImplementedException (type.GetType ().ToString ());\n\t\t}\n\n\t\t//\n\t\t// Raised (and passed an XmlElement that contains the comment)\n\t\t// when GenerateDocComment is writing documentation expectedly.\n\t\t//\n\t\t// FIXME: with a few effort, it could be done with XmlReader,\n\t\t// that means removal of DOM use.\n\t\t//\n\t\tvoid CheckParametersComments (MemberCore member, IParametersMember paramMember, XmlElement el)\n\t\t{\n\t\t\tHashSet<string> found_tags = null;\n\t\t\tforeach (XmlElement pelem in el.SelectNodes (\"param\")) {\n\t\t\t\tstring xname = pelem.GetAttribute (\"name\");\n\t\t\t\tif (xname.Length == 0)\n\t\t\t\t\tcontinue; // really? but MS looks doing so\n\n\t\t\t\tif (found_tags == null) {\n\t\t\t\t\tfound_tags = new HashSet<string> ();\n\t\t\t\t}\n\n\t\t\t\tif (xname != \"\" && paramMember.Parameters.GetParameterIndexByName (xname) < 0) {\n\t\t\t\t\tReport.Warning (1572, 2, member.Location,\n\t\t\t\t\t\t\"XML comment on `{0}' has a param tag for `{1}', but there is no parameter by that name\",\n\t\t\t\t\t\tmember.GetSignatureForError (), xname);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (found_tags.Contains (xname)) {\n\t\t\t\t\tReport.Warning (1571, 2, member.Location,\n\t\t\t\t\t\t\"XML comment on `{0}' has a duplicate param tag for `{1}'\",\n\t\t\t\t\t\tmember.GetSignatureForError (), xname);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfound_tags.Add (xname);\n\t\t\t}\n\n\t\t\tif (found_tags != null) {\n\t\t\t\tforeach (Parameter p in paramMember.Parameters.FixedParameters) {\n\t\t\t\t\tif (!found_tags.Contains (p.Name) && !(p is ArglistParameter))\n\t\t\t\t\t\tReport.Warning (1573, 4, member.Location,\n\t\t\t\t\t\t\t\"Parameter `{0}' has no matching param tag in the XML comment for `{1}'\",\n\t\t\t\t\t\t\tp.Name, member.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Outputs XML documentation comment from tokenized comments.\n\t\t//\n\t\tpublic bool OutputDocComment (string asmfilename, string xmlFileName)\n\t\t{\n\t\t\tXmlTextWriter w = null;\n\t\t\ttry {\n\t\t\t\tw = new XmlTextWriter (xmlFileName, null);\n\t\t\t\tw.Indentation = 4;\n\t\t\t\tw.Formatting = Formatting.Indented;\n\t\t\t\tw.WriteStartDocument ();\n\t\t\t\tw.WriteStartElement (\"doc\");\n\t\t\t\tw.WriteStartElement (\"assembly\");\n\t\t\t\tw.WriteStartElement (\"name\");\n\t\t\t\tw.WriteString (Path.GetFileNameWithoutExtension (asmfilename));\n\t\t\t\tw.WriteEndElement (); // name\n\t\t\t\tw.WriteEndElement (); // assembly\n\t\t\t\tw.WriteStartElement (\"members\");\n\t\t\t\tXmlCommentOutput = w;\n\t\t\t\tmodule.GenerateDocComment (this);\n\t\t\t\tw.WriteFullEndElement (); // members\n\t\t\t\tw.WriteEndElement ();\n\t\t\t\tw.WriteWhitespace (Environment.NewLine);\n\t\t\t\tw.WriteEndDocument ();\n\t\t\t\treturn true;\n\t\t\t} catch (Exception ex) {\n\t\t\t\tReport.Error (1569, \"Error generating XML documentation file `{0}' (`{1}')\", xmlFileName, ex.Message);\n\t\t\t\treturn false;\n\t\t\t} finally {\n\t\t\t\tif (w != null)\n\t\t\t\t\tw.Close ();\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Type lookup of documentation references uses context of type where\n\t// the reference is used but type parameters from cref value\n\t//\n\tsealed class DocumentationMemberContext : IMemberContext\n\t{\n\t\treadonly MemberCore host;\n\t\tMemberName contextName;\n\n\t\tpublic DocumentationMemberContext (MemberCore host, MemberName contextName)\n\t\t{\n\t\t\tthis.host = host;\n\t\t\tthis.contextName = contextName;\n\t\t}\n\n\t\tpublic TypeSpec CurrentType {\n\t\t\tget {\n\t\t\t\treturn host.CurrentType;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameters CurrentTypeParameters {\n\t\t\tget {\n\t\t\t\treturn contextName.TypeParameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic MemberCore CurrentMemberDefinition {\n\t\t\tget {\n\t\t\t\treturn host.CurrentMemberDefinition;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsObsolete {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsUnsafe {\n\t\t\tget {\n\t\t\t\treturn host.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn host.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic ModuleContainer Module {\n\t\t\tget {\n\t\t\t\treturn host.Module;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\treturn host.GetSignatureForError ();\n\t\t}\n\n\t\tpublic ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\tif (arity == 0) {\n\t\t\t\tvar tp = CurrentTypeParameters;\n\t\t\t\tif (tp != null) {\n\t\t\t\t\tfor (int i = 0; i < tp.Count; ++i) {\n\t\t\t\t\t\tvar t = tp[i];\n\t\t\t\t\t\tif (t.Name == name) {\n\t\t\t\t\t\t\tt.Type.DeclaredPosition = i;\n\t\t\t\t\t\t\treturn new TypeParameterExpr (t, loc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn host.Parent.LookupNamespaceOrType (name, arity, mode, loc);\n\t\t}\n\n\t\tpublic FullNamedExpression LookupNamespaceAlias (string name)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\n\tclass DocumentationParameter\n\t{\n\t\tpublic readonly Parameter.Modifier Modifier;\n\t\tpublic FullNamedExpression Type;\n\t\tTypeSpec type;\n\n\t\tpublic DocumentationParameter (Parameter.Modifier modifier, FullNamedExpression type)\n\t\t\t: this (type)\n\t\t{\n\t\t\tthis.Modifier = modifier;\n\t\t}\n\n\t\tpublic DocumentationParameter (FullNamedExpression type)\n\t\t{\n\t\t\tthis.Type = type;\n\t\t}\n\n\t\tpublic TypeSpec TypeSpec {\n\t\t\tget {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Resolve (IMemberContext context)\n\t\t{\n\t\t\ttype = Type.ResolveAsType (context);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/driver.cs",
    "content": "//\n// driver.cs: The compiler command line driver.\n//\n// Authors:\n//   Miguel de Icaza (miguel@gnu.org)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004, 2005, 2006, 2007, 2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Globalization;\nusing System.Diagnostics;\nusing System.Threading;\n\nnamespace Mono.CSharp\n{\n\t/// <summary>\n\t///    The compiler driver.\n\t/// </summary>\n\tclass Driver\n\t{\n\t\treadonly CompilerContext ctx;\n\n\t\tpublic Driver (CompilerContext ctx)\n\t\t{\n\t\t\tthis.ctx = ctx;\n\t\t}\n\n\t\tReport Report {\n\t\t\tget {\n\t\t\t\treturn ctx.Report;\n\t\t\t}\n\t\t}\n\n\t\tvoid tokenize_file (SourceFile sourceFile, ModuleContainer module, ParserSession session)\n\t\t{\n\t\t\tStream input;\n\n\t\t\ttry {\n\t\t\t\tinput = File.OpenRead (sourceFile.Name);\n\t\t\t} catch {\n\t\t\t\tReport.Error (2001, \"Source file `\" + sourceFile.Name + \"' could not be found\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tusing (input){\n\t\t\t\tSeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding);\n\t\t\t\tvar file = new CompilationSourceFile (module, sourceFile);\n\n\t\t\t\tTokenizer lexer = new Tokenizer (reader, file, session, ctx.Report);\n\t\t\t\tint token, tokens = 0, errors = 0;\n\n\t\t\t\twhile ((token = lexer.token ()) != Token.EOF){\n\t\t\t\t\ttokens++;\n\t\t\t\t\tif (token == Token.ERROR)\n\t\t\t\t\t\terrors++;\n\t\t\t\t}\n\t\t\t\tConsole.WriteLine (\"Tokenized: \" + tokens + \" found \" + errors + \" errors\");\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}\n\n\t\tvoid Parse (ModuleContainer module)\n\t\t{\n\t\t\tbool tokenize_only = module.Compiler.Settings.TokenizeOnly;\n\t\t\tvar sources = module.Compiler.SourceFiles;\n\n\t\t\tLocation.Initialize (sources);\n\n\t\t\tvar session = new ParserSession {\n\t\t\t\tUseJayGlobalArrays = true,\n\t\t\t\tLocatedTokens = new LocatedToken[15000]\n\t\t\t};\n\n\t\t\tfor (int i = 0; i < sources.Count; ++i) {\n\t\t\t\tif (tokenize_only) {\n\t\t\t\t\ttokenize_file (sources[i], module, session);\n\t\t\t\t} else {\n\t\t\t\t\tParse (sources[i], module, session, Report);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n#if false\n\t\tvoid ParseParallel (ModuleContainer module)\n\t\t{\n\t\t\tvar sources = module.Compiler.SourceFiles;\n\n\t\t\tLocation.Initialize (sources);\n\n\t\t\tvar pcount = Environment.ProcessorCount;\n\t\t\tvar threads = new Thread[System.Math.Max (2, pcount - 1)];\n\n\t\t\tfor (int i = 0; i < threads.Length; ++i) {\n\t\t\t\tvar t = new Thread (l => {\n\t\t\t\t\tvar session = new ParserSession () {\n\t\t\t\t\t\t//UseJayGlobalArrays = true,\n\t\t\t\t\t};\n\n\t\t\t\t\tvar report = new Report (ctx, Report.Printer); // TODO: Implement flush at once printer\n\n\t\t\t\t\tfor (int ii = (int) l; ii < sources.Count; ii += threads.Length) {\n\t\t\t\t\t\tParse (sources[ii], module, session, report);\n\t\t\t\t\t}\n\n\t\t\t\t\t// TODO: Merge warning regions\n\t\t\t\t});\n\n\t\t\t\tt.Start (i);\n\t\t\t\tthreads[i] = t;\n\t\t\t}\n\n\t\t\tfor (int t = 0; t < threads.Length; ++t) {\n\t\t\t\tthreads[t].Join ();\n\t\t\t}\n\t\t}\n#endif\n\n\t\tpublic void Parse (SourceFile file, ModuleContainer module, ParserSession session, Report report)\n\t\t{\n\t\t\tStream input;\n\n\t\t\ttry {\n\t\t\t\tinput = File.OpenRead (file.Name);\n\t\t\t} catch {\n\t\t\t\treport.Error (2001, \"Source file `{0}' could not be found\", file.Name);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check 'MZ' header\n\t\t\tif (input.ReadByte () == 77 && input.ReadByte () == 90) {\n\n\t\t\t\treport.Error (2015, \"Source file `{0}' is a binary file and not a text file\", file.Name);\n\t\t\t\tinput.Close ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tinput.Position = 0;\n\t\t\tSeekableStreamReader reader = new SeekableStreamReader (input, ctx.Settings.Encoding, session.StreamReaderBuffer);\n\n\t\t\tParse (reader, file, module, session, report);\n\n\t\t\tif (ctx.Settings.GenerateDebugInfo && report.Errors == 0 && !file.HasChecksum) {\n\t\t\t\tinput.Position = 0;\n\t\t\t\tvar checksum = session.GetChecksumAlgorithm ();\n\t\t\t\tfile.SetChecksum (checksum.ComputeHash (input));\n\t\t\t}\n\n\t\t\treader.Dispose ();\n\t\t\tinput.Close ();\n\t\t}\n\n\t\tpublic static CSharpParser Parse (SeekableStreamReader reader, SourceFile sourceFile, ModuleContainer module, ParserSession session, Report report, int lineModifier = 0, int colModifier = 0)\n\t\t{\n\t\t\tvar file = new CompilationSourceFile (module, sourceFile);\n\t\t\tmodule.AddTypeContainer(file);\n\n\t\t\tCSharpParser parser = new CSharpParser (reader, file, report, session);\n\t\t\tparser.Lexer.Line += lineModifier;\n\t\t\tparser.Lexer.Column += colModifier;\n\t\t\tparser.Lexer.sbag = new SpecialsBag ();\n\t\t\tparser.parse ();\n\t\t\treturn parser;\n\t\t}\n\n\t\tpublic static int Main (string[] args)\n\t\t{\n\t\t\tLocation.InEmacs = Environment.GetEnvironmentVariable (\"EMACS\") == \"t\";\n\n\t\t\tCommandLineParser cmd = new CommandLineParser (Console.Out);\n\t\t\tvar settings = cmd.ParseArguments (args);\n\t\t\tif (settings == null)\n\t\t\t\treturn 1;\n\n\t\t\tif (cmd.HasBeenStopped)\n\t\t\t\treturn 0;\n\n\t\t\tDriver d = new Driver (new CompilerContext (settings, new ConsoleReportPrinter ()));\n\n\t\t\tif (d.Compile () && d.Report.Errors == 0) {\n\t\t\t\tif (d.Report.Warnings > 0) {\n\t\t\t\t\tConsole.WriteLine (\"Compilation succeeded - {0} warning(s)\", d.Report.Warnings);\n\t\t\t\t}\n\t\t\t\tEnvironment.Exit (0);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tConsole.WriteLine(\"Compilation failed: {0} error(s), {1} warnings\",\n\t\t\t\td.Report.Errors, d.Report.Warnings);\n\t\t\tEnvironment.Exit (1);\n\t\t\treturn 1;\n\t\t}\n\n\t\tpublic static string GetPackageFlags (string packages, Report report)\n\t\t{\n\t\t\tProcessStartInfo pi = new ProcessStartInfo ();\n\t\t\tpi.FileName = \"pkg-config\";\n\t\t\tpi.RedirectStandardOutput = true;\n\t\t\tpi.UseShellExecute = false;\n\t\t\tpi.Arguments = \"--libs \" + packages;\n\t\t\tProcess p = null;\n\t\t\ttry {\n\t\t\t\tp = Process.Start (pi);\n\t\t\t} catch (Exception e) {\n\t\t\t\tif (report == null)\n\t\t\t\t\tthrow;\n\n\t\t\t\treport.Error (-27, \"Couldn't run pkg-config: \" + e.Message);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tif (p.StandardOutput == null) {\n\t\t\t\tif (report == null)\n\t\t\t\t\tthrow new ApplicationException (\"Specified package did not return any information\");\n\n\t\t\t\treport.Warning (-27, 1, \"Specified package did not return any information\");\n\t\t\t\tp.Close ();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tstring pkgout = p.StandardOutput.ReadToEnd ();\n\t\t\tp.WaitForExit ();\n\t\t\tif (p.ExitCode != 0) {\n\t\t\t\tif (report == null)\n\t\t\t\t\tthrow new ApplicationException (pkgout);\n\n\t\t\t\treport.Error (-27, \"Error running pkg-config. Check the above output.\");\n\t\t\t\tp.Close ();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tp.Close ();\n\t\t\treturn pkgout;\n\t\t}\n\n\t\t//\n\t\t// Main compilation method\n\t\t//\n\t\tpublic bool Compile ()\n\t\t{\n\t\t\tvar settings = ctx.Settings;\n\n\t\t\t//\n\t\t\t// If we are an exe, require a source file for the entry point or\n\t\t\t// if there is nothing to put in the assembly, and we are not a library\n\t\t\t//\n\t\t\tif (settings.FirstSourceFile == null &&\n\t\t\t\t((settings.Target == Target.Exe || settings.Target == Target.WinExe || settings.Target == Target.Module) ||\n\t\t\t\tsettings.Resources == null)) {\n\t\t\t\tReport.Error (2008, \"No files to compile were specified\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (settings.Platform == Platform.AnyCPU32Preferred && (settings.Target == Target.Library || settings.Target == Target.Module)) {\n\t\t\t\tReport.Error (4023, \"Platform option `anycpu32bitpreferred' is valid only for executables\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tTimeReporter tr = new TimeReporter (settings.Timestamps);\n\t\t\tctx.TimeReporter = tr;\n\t\t\ttr.StartTotal ();\n\n\t\t\tvar module = new ModuleContainer (ctx);\n\t\t\tRootContext.ToplevelTypes = module;\n\n\t\t\ttr.Start (TimeReporter.TimerType.ParseTotal);\n\t\t\tParse (module);\n\t\t\ttr.Stop (TimeReporter.TimerType.ParseTotal);\n\n\t\t\tif (Report.Errors > 0)\n\t\t\t\treturn false;\n\n\t\t\tif (settings.TokenizeOnly || settings.ParseOnly) {\n\t\t\t\ttr.StopTotal ();\n\t\t\t\ttr.ShowStats ();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar output_file = settings.OutputFile;\n\t\t\tstring output_file_name;\n\t\t\tif (output_file == null) {\n\t\t\t\tvar source_file = settings.FirstSourceFile;\n\n\t\t\t\tif (source_file == null) {\n\t\t\t\t\tReport.Error (1562, \"If no source files are specified you must specify the output file with -out:\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\toutput_file_name = source_file.Name;\n\t\t\t\tint pos = output_file_name.LastIndexOf ('.');\n\n\t\t\t\tif (pos > 0)\n\t\t\t\t\toutput_file_name = output_file_name.Substring (0, pos);\n\t\t\t\t\n\t\t\t\toutput_file_name += settings.TargetExt;\n\t\t\t\toutput_file = output_file_name;\n\t\t\t} else {\n\t\t\t\toutput_file_name = Path.GetFileName (output_file);\n\n\t\t\t\tif (string.IsNullOrEmpty (Path.GetFileNameWithoutExtension (output_file_name)) ||\n\t\t\t\t\toutput_file_name.IndexOfAny (Path.GetInvalidFileNameChars ()) >= 0) {\n\t\t\t\t\tReport.Error (2021, \"Output file name is not valid\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n#if STATIC\n\t\t\tvar importer = new StaticImporter (module);\n\t\t\tvar references_loader = new StaticLoader (importer, ctx);\n\n\t\t\ttr.Start (TimeReporter.TimerType.AssemblyBuilderSetup);\n\t\t\tvar assembly = new AssemblyDefinitionStatic (module, references_loader, output_file_name, output_file);\n\t\t\tassembly.Create (references_loader.Domain);\n\t\t\ttr.Stop (TimeReporter.TimerType.AssemblyBuilderSetup);\n\n\t\t\t// Create compiler types first even before any referenced\n\t\t\t// assembly is loaded to allow forward referenced types from\n\t\t\t// loaded assembly into compiled builder to be resolved\n\t\t\t// correctly\n\t\t\ttr.Start (TimeReporter.TimerType.CreateTypeTotal);\n\t\t\tmodule.CreateContainer ();\n\t\t\timporter.AddCompiledAssembly (assembly);\n\t\t\treferences_loader.CompiledAssembly = assembly;\n\t\t\ttr.Stop (TimeReporter.TimerType.CreateTypeTotal);\n\n\t\t\treferences_loader.LoadReferences (module);\n\n\t\t\ttr.Start (TimeReporter.TimerType.PredefinedTypesInit);\n\t\t\tif (!ctx.BuiltinTypes.CheckDefinitions (module))\n\t\t\t\treturn false;\n\n\t\t\ttr.Stop (TimeReporter.TimerType.PredefinedTypesInit);\n\n\t\t\treferences_loader.LoadModules (assembly, module.GlobalRootNamespace);\n#else\n\t\t\tvar assembly = new AssemblyDefinitionDynamic (module, output_file_name, output_file);\n\t\t\tmodule.SetDeclaringAssembly (assembly);\n\n\t\t\tvar importer = new ReflectionImporter (module, ctx.BuiltinTypes);\n\t\t\tassembly.Importer = importer;\n\n\t\t\tvar loader = new DynamicLoader (importer, ctx);\n\t\t\tloader.LoadReferences (module);\n\n\t\t\tif (!ctx.BuiltinTypes.CheckDefinitions (module))\n\t\t\t\treturn false;\n\n\t\t\tif (!assembly.Create (AppDomain.CurrentDomain, AssemblyBuilderAccess.Save))\n\t\t\t\treturn false;\n\n\t\t\tmodule.CreateContainer ();\n\n\t\t\tloader.LoadModules (assembly, module.GlobalRootNamespace);\n#endif\n\t\t\tmodule.InitializePredefinedTypes ();\n\n\t\t\ttr.Start (TimeReporter.TimerType.ModuleDefinitionTotal);\n\t\t\tmodule.Define ();\n\t\t\ttr.Stop (TimeReporter.TimerType.ModuleDefinitionTotal);\n\n\t\t\tif (Report.Errors > 0)\n\t\t\t\treturn false;\n\n\t\t\tif (settings.DocumentationFile != null) {\n\t\t\t\tvar doc = new DocumentationBuilder (module);\n\t\t\t\tdoc.OutputDocComment (output_file, settings.DocumentationFile);\n\t\t\t}\n\n\t\t\tassembly.Resolve ();\n\t\t\t\n\t\t\tif (Report.Errors > 0)\n\t\t\t\treturn false;\n\n\n\t\t\ttr.Start (TimeReporter.TimerType.EmitTotal);\n\t\t\tassembly.Emit ();\n\t\t\ttr.Stop (TimeReporter.TimerType.EmitTotal);\n\n\t\t\tif (Report.Errors > 0){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ttr.Start (TimeReporter.TimerType.CloseTypes);\n\t\t\tmodule.CloseContainer ();\n\t\t\ttr.Stop (TimeReporter.TimerType.CloseTypes);\n\n\t\t\ttr.Start (TimeReporter.TimerType.Resouces);\n\t\t\tif (!settings.WriteMetadataOnly)\n\t\t\t\tassembly.EmbedResources ();\n\t\t\ttr.Stop (TimeReporter.TimerType.Resouces);\n\n\t\t\tif (Report.Errors > 0)\n\t\t\t\treturn false;\n\n\t\t\tassembly.Save ();\n\n#if STATIC\n\t\t\treferences_loader.Dispose ();\n#endif\n\t\t\ttr.StopTotal ();\n\t\t\ttr.ShowStats ();\n\n\t\t\treturn Report.Errors == 0;\n\t\t}\n\t}\n\n\tpublic class CompilerCompilationUnit {\n\t\tpublic ModuleContainer ModuleCompiled { get; set; }\n\t\tpublic LocationsBag LocationsBag { get; set; }\n\t\tpublic SpecialsBag SpecialsBag { get; set; }\n\t\tpublic IDictionary<string, bool> Conditionals { get; set; }\n\t\tpublic object LastYYValue { get; set; }\n\t}\n\n\t//\n\t// This is the only public entry point\n\t//\n\tpublic class CompilerCallableEntryPoint : MarshalByRefObject\n\t{\n\t\tpublic static bool InvokeCompiler (string [] args, TextWriter error)\n\t\t{\n\t\t\ttry {\n\t\t\t\tCommandLineParser cmd = new CommandLineParser (error);\n\t\t\t\tvar setting = cmd.ParseArguments (args);\n\t\t\t\tif (setting == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar d = new Driver (new CompilerContext (setting, new StreamReportPrinter (error)));\n\t\t\t\treturn d.Compile ();\n\t\t\t} finally {\n\t\t\t\tReset ();\n\t\t\t}\n\t\t}\n\n\t\tpublic static int[] AllWarningNumbers {\n\t\t\tget {\n\t\t\t\treturn Report.AllWarnings;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Reset ()\n\t\t{\n\t\t\tReset (true);\n\t\t}\n\n\t\tpublic static void PartialReset ()\n\t\t{\n\t\t\tReset (false);\n\t\t}\n\t\t\n\t\tpublic static void Reset (bool full_flag)\n\t\t{\n\t\t\tLocation.Reset ();\n\t\t\t\n\t\t\tif (!full_flag)\n\t\t\t\treturn;\n\n\t\t\tLinq.QueryBlock.TransparentParameter.Reset ();\n\t\t\tTypeInfo.Reset ();\n\t\t}\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/dynamic.cs",
    "content": "﻿//\n// dynamic.cs: support for dynamic expressions\n//\n// Authors: Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2009 Novell, Inc\n// Copyright 2011 Xamarin Inc.\n//\n\nusing System;\nusing System.Linq;\nusing SLE = System.Linq.Expressions;\n\n#if NET_4_0 || MOBILE_DYNAMIC\nusing System.Dynamic;\n#endif\n\nnamespace Mono.CSharp\n{\n\t//\n\t// A copy of Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpBinderFlags.cs\n\t// has to be kept in sync\n\t//\n\t[Flags]\n\tpublic enum CSharpBinderFlags\n\t{\n\t\tNone = 0,\n\t\tCheckedContext = 1,\n\t\tInvokeSimpleName = 1 << 1,\n\t\tInvokeSpecialName = 1 << 2,\n\t\tBinaryOperationLogical = 1 << 3,\n\t\tConvertExplicit = 1 << 4,\n\t\tConvertArrayIndex = 1 << 5,\n\t\tResultIndexed = 1 << 6,\n\t\tValueFromCompoundAssignment = 1 << 7,\n\t\tResultDiscarded = 1 << 8\n\t}\n\n\t//\n\t// Type expression with internal dynamic type symbol\n\t//\n\tclass DynamicTypeExpr : TypeExpr\n\t{\n\t\tpublic DynamicTypeExpr (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\teclass = ExprClass.Type;\n\t\t\ttype = ec.Module.Compiler.BuiltinTypes.Dynamic;\n\t\t\treturn type;\n\t\t}\n\t}\n\n\t#region Dynamic runtime binder expressions\n\n\t//\n\t// Expression created from runtime dynamic object value by dynamic binder\n\t//\n\tpublic class RuntimeValueExpression : Expression, IDynamicAssign, IMemoryLocation\n\t{\n#if !NET_4_0 && !MOBILE_DYNAMIC\n\t\tpublic class DynamicMetaObject\n\t\t{\n\t\t\tpublic TypeSpec RuntimeType;\n\t\t\tpublic TypeSpec LimitType;\n\t\t\tpublic SLE.Expression Expression;\n\t\t}\n#endif\n\n\t\treadonly DynamicMetaObject obj;\n\n\t\tpublic RuntimeValueExpression (DynamicMetaObject obj, TypeSpec type)\n\t\t{\n\t\t\tthis.obj = obj;\n\t\t\tthis.type = type;\n\t\t\tthis.eclass = ExprClass.Variable;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsSuggestionOnly { get; set; }\n\n\t\tpublic DynamicMetaObject MetaObject {\n\t\t\tget { return obj; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\t#region IAssignMethod Members\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)\n\t\t{\n\t\t\treturn obj.Expression;\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\t\t\tif (type.IsStruct && !obj.Expression.Type.IsValueType)\n\t\t\t\t\treturn SLE.Expression.Unbox (obj.Expression, type.GetMetaInfo ());\n\n\t\t\t\tif (obj.Expression.NodeType == SLE.ExpressionType.Parameter) {\n\t\t\t\t\tif (((SLE.ParameterExpression) obj.Expression).IsByRef)\n\t\t\t\t\t\treturn obj.Expression;\n\t\t\t\t}\n\t#endif\n\n\t\t\t\treturn SLE.Expression.Convert (obj.Expression, type.GetMetaInfo ());\n#endif\n\t\t}\n\t}\n\n\t//\n\t// Wraps runtime dynamic expression into expected type. Needed\n\t// to satify expected type check by dynamic binder and no conversion\n\t// is required (ResultDiscarded).\n\t//\n\tpublic class DynamicResultCast : ShimExpression\n\t{\n\t\tpublic DynamicResultCast (TypeSpec type, Expression expr)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.type = type;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn SLE.Expression.Block (expr.MakeExpression (ctx), SLE.Expression.Default (type.GetMetaInfo ()));\n#endif\n\t\t}\n#endif\n\t}\n\n\t#endregion\n\n\t//\n\t// Creates dynamic binder expression\n\t//\n\tinterface IDynamicBinder\n\t{\n\t\tExpression CreateCallSiteBinder (ResolveContext ec, Arguments args);\n\t}\n\n\t//\n\t// Extends standard assignment interface for expressions\n\t// supported by dynamic resolver\n\t//\n\tinterface IDynamicAssign : IAssignMethod\n\t{\n\t\tSLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source);\n\t}\n\n\t//\n\t// Base dynamic expression statement creator\n\t//\n\tclass DynamicExpressionStatement : ExpressionStatement\n\t{\n\t\t//\n\t\t// Binder flag dynamic constant, the value is combination of\n\t\t// flags known at resolve stage and flags known only at emit\n\t\t// stage\n\t\t//\n\t\tprotected class BinderFlags : EnumConstant\n\t\t{\n\t\t\treadonly DynamicExpressionStatement statement;\n\t\t\treadonly CSharpBinderFlags flags;\n\n\t\t\tpublic BinderFlags (CSharpBinderFlags flags, DynamicExpressionStatement statement)\n\t\t\t\t: base (statement.loc)\n\t\t\t{\n\t\t\t\tthis.flags = flags;\n\t\t\t\tthis.statement = statement;\n\t\t\t\teclass = 0;\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\tChild = new IntConstant (ec.BuiltinTypes, (int) (flags | statement.flags), statement.loc);\n\n\t\t\t\ttype = ec.Module.PredefinedTypes.BinderFlags.Resolve ();\n\t\t\t\teclass = Child.eclass;\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\treadonly Arguments arguments;\n\t\tprotected IDynamicBinder binder;\n\t\tprotected Expression binder_expr;\n\n\t\t// Used by BinderFlags\n\t\tprotected CSharpBinderFlags flags;\n\n\t\tTypeSpec binder_type;\n\t\tTypeParameters context_mvars;\n\n\t\tpublic DynamicExpressionStatement (IDynamicBinder binder, Arguments args, Location loc)\n\t\t{\n\t\t\tthis.binder = binder;\n\t\t\tthis.arguments = args;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic Arguments Arguments {\n\t\t\tget {\n\t\t\t\treturn arguments;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn arguments.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (1963, loc, \"An expression tree cannot contain a dynamic operation\");\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tif (DoResolveCore (rc))\n\t\t\t\tbinder_expr = binder.CreateCallSiteBinder (rc, arguments);\n\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected bool DoResolveCore (ResolveContext rc)\n\t\t{\n\t\t\tif (rc.CurrentTypeParameters != null && rc.CurrentTypeParameters[0].IsMethodTypeParameter)\n\t\t\t\tcontext_mvars = rc.CurrentTypeParameters;\n\n\t\t\tint errors = rc.Report.Errors;\n\t\t\tvar pt = rc.Module.PredefinedTypes;\n\n\t\t\tbinder_type = pt.Binder.Resolve ();\n\t\t\tpt.CallSite.Resolve ();\n\t\t\tpt.CallSiteGeneric.Resolve ();\n\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tif (type == null)\n\t\t\t\ttype = rc.BuiltinTypes.Dynamic;\n\n\t\t\tif (rc.Report.Errors == errors)\n\t\t\t\treturn true;\n\n\t\t\trc.Report.Error (1969, loc,\n\t\t\t\t\"Dynamic operation cannot be compiled without `Microsoft.CSharp.dll' assembly reference\");\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmitCall (ec, binder_expr, arguments,  false);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tEmitCall (ec, binder_expr, arguments, true);\n\t\t}\n\n\t\tprotected void EmitCall (EmitContext ec, Expression binder, Arguments arguments, bool isStatement)\n\t\t{\n\t\t\t//\n\t\t\t// This method generates all internal infrastructure for a dynamic call. The\n\t\t\t// reason why it's quite complicated is the mixture of dynamic and anonymous\n\t\t\t// methods. Dynamic itself requires a temporary class (ContainerX) and anonymous\n\t\t\t// methods can generate temporary storey as well (AnonStorey). Handling MVAR\n\t\t\t// type parameters rewrite is non-trivial in such case as there are various\n\t\t\t// combinations possible therefore the mutator is not straightforward. Secondly\n\t\t\t// we need to keep both MVAR(possibly VAR for anon storey) and type VAR to emit\n\t\t\t// correct Site field type and its access from EmitContext.\n\t\t\t//\n\n\t\t\tint dyn_args_count = arguments == null ? 0 : arguments.Count;\n\t\t\tint default_args = isStatement ? 1 : 2;\n\t\t\tvar module = ec.Module;\n\n\t\t\tbool has_ref_out_argument = false;\n\t\t\tvar targs = new TypeExpression[dyn_args_count + default_args];\n\t\t\ttargs[0] = new TypeExpression (module.PredefinedTypes.CallSite.TypeSpec, loc);\n\n\t\t\tTypeExpression[] targs_for_instance = null;\n\t\t\tTypeParameterMutator mutator;\n\n\t\t\tvar site_container = ec.CreateDynamicSite ();\n\n\t\t\tif (context_mvars != null) {\n\t\t\t\tTypeParameters tparam;\n\t\t\t\tTypeContainer sc = site_container;\n\t\t\t\tdo {\n\t\t\t\t\ttparam = sc.CurrentTypeParameters;\n\t\t\t\t\tsc = sc.Parent;\n\t\t\t\t} while (tparam == null);\n\n\t\t\t\tmutator = new TypeParameterMutator (context_mvars, tparam);\n\n\t\t\t\tif (!ec.IsAnonymousStoreyMutateRequired) {\n\t\t\t\t\ttargs_for_instance = new TypeExpression[targs.Length];\n\t\t\t\t\ttargs_for_instance[0] = targs[0];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmutator = null;\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < dyn_args_count; ++i) {\n\t\t\t\tArgument a = arguments[i];\n\t\t\t\tif (a.ArgType == Argument.AType.Out || a.ArgType == Argument.AType.Ref)\n\t\t\t\t\thas_ref_out_argument = true;\n\n\t\t\t\tvar t = a.Type;\n\n\t\t\t\t// Convert any internal type like dynamic or null to object\n\t\t\t\tif (t.Kind == MemberKind.InternalCompilerType)\n\t\t\t\t\tt = ec.BuiltinTypes.Object;\n\n\t\t\t\tif (targs_for_instance != null)\n\t\t\t\t\ttargs_for_instance[i + 1] = new TypeExpression (t, loc);\n\n\t\t\t\tif (mutator != null)\n\t\t\t\t\tt = t.Mutate (mutator);\n\n\t\t\t\ttargs[i + 1] = new TypeExpression (t, loc);\n\t\t\t}\n\n\t\t\tTypeExpr del_type = null;\n\t\t\tTypeExpr del_type_instance_access = null;\n\t\t\tif (!has_ref_out_argument) {\n\t\t\t\tstring d_name = isStatement ? \"Action\" : \"Func\";\n\n\t\t\t\tTypeSpec te = null;\n\t\t\t\tNamespace type_ns = module.GlobalRootNamespace.GetNamespace (\"System\", true);\n\t\t\t\tif (type_ns != null) {\n\t\t\t\t\tte = type_ns.LookupType (module, d_name, dyn_args_count + default_args, LookupMode.Normal, loc);\n\t\t\t\t}\n\n\t\t\t\tif (te != null) {\n\t\t\t\t\tif (!isStatement) {\n\t\t\t\t\t\tvar t = type;\n\t\t\t\t\t\tif (t.Kind == MemberKind.InternalCompilerType)\n\t\t\t\t\t\t\tt = ec.BuiltinTypes.Object;\n\n\t\t\t\t\t\tif (targs_for_instance != null)\n\t\t\t\t\t\t\ttargs_for_instance[targs_for_instance.Length - 1] = new TypeExpression (t, loc);\n\n\t\t\t\t\t\tif (mutator != null)\n\t\t\t\t\t\t\tt = t.Mutate (mutator);\n\n\t\t\t\t\t\ttargs[targs.Length - 1] = new TypeExpression (t, loc);\n\t\t\t\t\t}\n\n\t\t\t\t\tdel_type = new GenericTypeExpr (te, new TypeArguments (targs), loc);\n\t\t\t\t\tif (targs_for_instance != null)\n\t\t\t\t\t\tdel_type_instance_access = new GenericTypeExpr (te, new TypeArguments (targs_for_instance), loc);\n\t\t\t\t\telse\n\t\t\t\t\t\tdel_type_instance_access = del_type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Create custom delegate when no appropriate predefined delegate has been found\n\t\t\t//\n\t\t\tDelegate d;\n\t\t\tif (del_type == null) {\n\t\t\t\tTypeSpec rt = isStatement ? ec.BuiltinTypes.Void : type;\n\t\t\t\tParameter[] p = new Parameter[dyn_args_count + 1];\n\t\t\t\tp[0] = new Parameter (targs[0], \"p0\", Parameter.Modifier.NONE, null, loc);\n\n\t\t\t\tvar site = ec.CreateDynamicSite ();\n\t\t\t\tint index = site.Containers == null ? 0 : site.Containers.Count;\n\n\t\t\t\tif (mutator != null)\n\t\t\t\t\trt = mutator.Mutate (rt);\n\n\t\t\t\tfor (int i = 1; i < dyn_args_count + 1; ++i) {\n\t\t\t\t\tp[i] = new Parameter (targs[i], \"p\" + i.ToString (\"X\"), arguments[i - 1].Modifier, null, loc);\n\t\t\t\t}\n\n\t\t\t\td = new Delegate (site, new TypeExpression (rt, loc),\n\t\t\t\t\tModifiers.INTERNAL | Modifiers.COMPILER_GENERATED,\n\t\t\t\t\tnew MemberName (\"Container\" + index.ToString (\"X\")),\n\t\t\t\t\tnew ParametersCompiled (p), null);\n\n\t\t\t\td.CreateContainer ();\n\t\t\t\td.DefineContainer ();\n\t\t\t\td.Define ();\n\t\t\t\td.PrepareEmit ();\n\n\t\t\t\tsite.AddTypeContainer (d);\n\n\t\t\t\t//\n\t\t\t\t// Add new container to inflated site container when the\n\t\t\t\t// member cache already exists\n\t\t\t\t//\n\t\t\t\tif (site.CurrentType is InflatedTypeSpec && index > 0)\n\t\t\t\t\tsite.CurrentType.MemberCache.AddMember (d.CurrentType);\n\n\t\t\t\tdel_type = new TypeExpression (d.CurrentType, loc);\n\t\t\t\tif (targs_for_instance != null) {\n\t\t\t\t\tdel_type_instance_access = null;\n\t\t\t\t} else {\n\t\t\t\t\tdel_type_instance_access = del_type;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\td = null;\n\t\t\t}\n\n\t\t\tvar site_type_decl = new GenericTypeExpr (module.PredefinedTypes.CallSiteGeneric.TypeSpec, new TypeArguments (del_type), loc);\n\t\t\tvar field = site_container.CreateCallSiteField (site_type_decl, loc);\n\t\t\tif (field == null)\n\t\t\t\treturn;\n\n\t\t\tif (del_type_instance_access == null) {\n\t\t\t\tvar dt = d.CurrentType.DeclaringType.MakeGenericType (module, context_mvars.Types);\n\t\t\t\tdel_type_instance_access = new TypeExpression (MemberCache.GetMember (dt, d.CurrentType), loc);\n\t\t\t}\n\n\t\t\tvar instanceAccessExprType = new GenericTypeExpr (module.PredefinedTypes.CallSiteGeneric.TypeSpec,\n\t\t\t\tnew TypeArguments (del_type_instance_access), loc);\n\n\t\t\tif (instanceAccessExprType.ResolveAsType (ec.MemberContext) == null)\n\t\t\t\treturn;\n\n\t\t\tbool inflate_using_mvar = context_mvars != null && ec.IsAnonymousStoreyMutateRequired;\n\n\t\t\tTypeSpec gt;\n\t\t\tif (inflate_using_mvar || context_mvars == null) {\n\t\t\t\tgt = site_container.CurrentType;\n\t\t\t} else {\n\t\t\t\tgt = site_container.CurrentType.MakeGenericType (module, context_mvars.Types);\n\t\t\t}\n\n\t\t\t// When site container already exists the inflated version has to be\n\t\t\t// updated manually to contain newly created field\n\t\t\tif (gt is InflatedTypeSpec && site_container.AnonymousMethodsCounter > 1) {\n\t\t\t\tvar tparams = gt.MemberDefinition.TypeParametersCount > 0 ? gt.MemberDefinition.TypeParameters : TypeParameterSpec.EmptyTypes;\n\t\t\t\tvar inflator = new TypeParameterInflator (module, gt, tparams, gt.TypeArguments);\n\t\t\t\tgt.MemberCache.AddMember (field.InflateMember (inflator));\n\t\t\t}\n\n\t\t\tFieldExpr site_field_expr = new FieldExpr (MemberCache.GetMember (gt, field), loc);\n\n\t\t\tBlockContext bc = new BlockContext (ec.MemberContext, null, ec.BuiltinTypes.Void);\n\n\t\t\tArguments args = new Arguments (1);\n\t\t\targs.Add (new Argument (binder));\n\t\t\tStatementExpression s = new StatementExpression (new SimpleAssign (site_field_expr, new Invocation (new MemberAccess (instanceAccessExprType, \"Create\"), args)));\n\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tif (s.Resolve (bc)) {\n\t\t\t\t\tStatement init = new If (new Binary (Binary.Operator.Equality, site_field_expr, new NullLiteral (loc)), s, loc);\n\t\t\t\t\tinit.Emit (ec);\n\t\t\t\t}\n\n\t\t\t\targs = new Arguments (1 + dyn_args_count);\n\t\t\t\targs.Add (new Argument (site_field_expr));\n\t\t\t\tif (arguments != null) {\n\t\t\t\t\tint arg_pos = 1;\n\t\t\t\t\tforeach (Argument a in arguments) {\n\t\t\t\t\t\tif (a is NamedArgument) {\n\t\t\t\t\t\t\t// Name is not valid in this context\n\t\t\t\t\t\t\targs.Add (new Argument (a.Expr, a.ArgType));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\targs.Add (a);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (inflate_using_mvar && a.Type != targs[arg_pos].Type)\n\t\t\t\t\t\t\ta.Expr.Type = targs[arg_pos].Type;\n\n\t\t\t\t\t\t++arg_pos;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tExpression target = new DelegateInvocation (new MemberAccess (site_field_expr, \"Target\", loc).Resolve (bc), args, false, loc).Resolve (bc);\n\t\t\t\tif (target != null)\n\t\t\t\t\ttarget.Emit (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\targuments.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic static MemberAccess GetBinderNamespace (Location loc)\n\t\t{\n\t\t\treturn new MemberAccess (new MemberAccess (\n\t\t\t\tnew QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, \"Microsoft\", loc), \"CSharp\", loc), \"RuntimeBinder\", loc);\n\t\t}\n\n\t\tprotected MemberAccess GetBinder (string name, Location loc)\n\t\t{\n\t\t\treturn new MemberAccess (new TypeExpression (binder_type, loc), name, loc);\n\t\t}\n\t}\n\n\t//\n\t// Dynamic member access compound assignment for events\n\t//\n\tclass DynamicEventCompoundAssign : ExpressionStatement\n\t{\n\t\tclass IsEvent : DynamicExpressionStatement, IDynamicBinder\n\t\t{\n\t\t\tstring name;\n\n\t\t\tpublic IsEvent (string name, Arguments args, Location loc)\n\t\t\t\t: base (null, args, loc)\n\t\t\t{\n\t\t\t\tthis.name = name;\n\t\t\t\tbinder = this;\n\t\t\t}\n\n\t\t\tpublic Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)\n\t\t\t{\n\t\t\t\ttype = ec.BuiltinTypes.Bool;\n\n\t\t\t\tArguments binder_args = new Arguments (3);\n\n\t\t\t\tbinder_args.Add (new Argument (new BinderFlags (0, this)));\n\t\t\t\tbinder_args.Add (new Argument (new StringLiteral (ec.BuiltinTypes, name, loc)));\n\t\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\n\n\t\t\t\treturn new Invocation (GetBinder (\"IsEvent\", loc), binder_args);\n\t\t\t}\n\t\t}\n\n\t\tExpression condition;\n\t\tExpressionStatement invoke, assign;\n\n\t\tpublic DynamicEventCompoundAssign (string name, Arguments args, ExpressionStatement assignment, ExpressionStatement invoke, Location loc)\n\t\t{\n\t\t\tcondition = new IsEvent (name, args, loc);\n\t\t\tthis.invoke = invoke;\n\t\t\tthis.assign = assignment;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn condition.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\ttype = rc.BuiltinTypes.Dynamic;\n\t\t\teclass = ExprClass.Value;\n\t\t\tcondition = condition.Resolve (rc);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tvar rc = new ResolveContext (ec.MemberContext);\n\t\t\tvar expr = new Conditional (new BooleanExpression (condition), invoke, assign, loc).Resolve (rc);\n\t\t\texpr.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tvar stmt = new If (condition, new StatementExpression (invoke), new StatementExpression (assign), loc);\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tstmt.Emit (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tinvoke.FlowAnalysis (fc);\n\t\t}\n\t}\n\n\tclass DynamicConversion : DynamicExpressionStatement, IDynamicBinder\n\t{\n\t\tpublic DynamicConversion (TypeSpec targetType, CSharpBinderFlags flags, Arguments args, Location loc)\n\t\t\t: base (null, args, loc)\n\t\t{\n\t\t\ttype = targetType;\n\t\t\tbase.flags = flags;\n\t\t\tbase.binder = this;\n\t\t}\n\n\t\tpublic Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)\n\t\t{\n\t\t\tArguments binder_args = new Arguments (3);\n\n\t\t\tflags |= ec.HasSet (ResolveContext.Options.CheckedScope) ? CSharpBinderFlags.CheckedContext : 0;\n\n\t\t\tbinder_args.Add (new Argument (new BinderFlags (flags, this)));\n\t\t\tbinder_args.Add (new Argument (new TypeOf (type, loc)));\n\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\n\t\t\treturn new Invocation (GetBinder (\"Convert\", loc), binder_args);\n\t\t}\n\t}\n\n\tclass DynamicConstructorBinder : DynamicExpressionStatement, IDynamicBinder\n\t{\n\t\tpublic DynamicConstructorBinder (TypeSpec type, Arguments args, Location loc)\n\t\t\t: base (null, args, loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\tbase.binder = this;\n\t\t}\n\n\t\tpublic Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)\n\t\t{\n\t\t\tArguments binder_args = new Arguments (3);\n\n\t\t\tbinder_args.Add (new Argument (new BinderFlags (0, this)));\n\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\n\t\t\tbinder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));\n\n\t\t\treturn new Invocation (GetBinder (\"InvokeConstructor\", loc), binder_args);\n\t\t}\n\t}\n\n\tclass DynamicIndexBinder : DynamicMemberAssignable\n\t{\n\t\tbool can_be_mutator;\n\n\t\tpublic DynamicIndexBinder (Arguments args, Location loc)\n\t\t\t: base (args, loc)\n\t\t{\n\t\t}\n\n\t\tpublic DynamicIndexBinder (CSharpBinderFlags flags, Arguments args, Location loc)\n\t\t\t: this (args, loc)\n\t\t{\n\t\t\tbase.flags = flags;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tcan_be_mutator = true;\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\n\t\tprotected override Expression CreateCallSiteBinder (ResolveContext ec, Arguments args, bool isSet)\n\t\t{\n\t\t\tArguments binder_args = new Arguments (3);\n\n\t\t\tbinder_args.Add (new Argument (new BinderFlags (flags, this)));\n\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\n\t\t\tbinder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));\n\n\t\t\tisSet |= (flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0;\n\t\t\treturn new Invocation (GetBinder (isSet ? \"SetIndex\" : \"GetIndex\", loc), binder_args);\n\t\t}\n\n\t\tprotected override Arguments CreateSetterArguments (ResolveContext rc, Expression rhs)\n\t\t{\n\t\t\t//\n\t\t\t// Indexer has arguments which complicates things as the setter and getter\n\t\t\t// are called in two steps when unary mutator is used. We have to make a\n\t\t\t// copy of all variable arguments to not duplicate any side effect.\n\t\t\t//\n\t\t\t// ++d[++arg, Foo ()]\n\t\t\t//\n\n\t\t\tif (!can_be_mutator)\n\t\t\t\treturn base.CreateSetterArguments (rc, rhs);\n\n\t\t\tvar setter_args = new Arguments (Arguments.Count + 1);\n\t\t\tfor (int i = 0; i < Arguments.Count; ++i) {\n\t\t\t\tvar expr = Arguments[i].Expr;\n\n\t\t\t\tif (expr is Constant || expr is VariableReference || expr is This) {\n\t\t\t\t\tsetter_args.Add (Arguments [i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tLocalVariable temp = LocalVariable.CreateCompilerGenerated (expr.Type, rc.CurrentBlock, loc);\n\t\t\t\texpr = new SimpleAssign (temp.CreateReferenceExpression (rc, expr.Location), expr).Resolve (rc);\n\t\t\t\tArguments[i].Expr = temp.CreateReferenceExpression (rc, expr.Location).Resolve (rc);\n\t\t\t\tsetter_args.Add (Arguments [i].Clone (expr));\n\t\t\t}\n\n\t\t\tsetter_args.Add (new Argument (rhs));\n\t\t\treturn setter_args;\n\t\t}\n\t}\n\n\tclass DynamicInvocation : DynamicExpressionStatement, IDynamicBinder\n\t{\n\t\treadonly ATypeNameExpression member;\n\n\t\tpublic DynamicInvocation (ATypeNameExpression member, Arguments args, Location loc)\n\t\t\t: base (null, args, loc)\n\t\t{\n\t\t\tbase.binder = this;\n\t\t\tthis.member = member;\n\t\t}\n\n\t\tpublic static DynamicInvocation CreateSpecialNameInvoke (ATypeNameExpression member, Arguments args, Location loc)\n\t\t{\n\t\t\treturn new DynamicInvocation (member, args, loc) {\n\t\t\t\tflags = CSharpBinderFlags.InvokeSpecialName\n\t\t\t};\n\t\t}\n\n\t\tpublic Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)\n\t\t{\n\t\t\tArguments binder_args = new Arguments (member != null ? 5 : 3);\n\t\t\tbool is_member_access = member is MemberAccess;\n\n\t\t\tCSharpBinderFlags call_flags;\n\t\t\tif (!is_member_access && member is SimpleName) {\n\t\t\t\tcall_flags = CSharpBinderFlags.InvokeSimpleName;\n\t\t\t\tis_member_access = true;\n\t\t\t} else {\n\t\t\t\tcall_flags = 0;\n\t\t\t}\n\n\t\t\tbinder_args.Add (new Argument (new BinderFlags (call_flags, this)));\n\n\t\t\tif (is_member_access)\n\t\t\t\tbinder_args.Add (new Argument (new StringLiteral (ec.BuiltinTypes, member.Name, member.Location)));\n\n\t\t\tif (member != null && member.HasTypeArguments) {\n\t\t\t\tTypeArguments ta = member.TypeArguments;\n\t\t\t\tif (ta.Resolve (ec)) {\n\t\t\t\t\tvar targs = new ArrayInitializer (ta.Count, loc);\n\t\t\t\t\tforeach (TypeSpec t in ta.Arguments)\n\t\t\t\t\t\ttargs.Add (new TypeOf (t, loc));\n\n\t\t\t\t\tbinder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (targs, loc)));\n\t\t\t\t}\n\t\t\t} else if (is_member_access) {\n\t\t\t\tbinder_args.Add (new Argument (new NullLiteral (loc)));\n\t\t\t}\n\n\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\n\n\t\t\tExpression real_args;\n\t\t\tif (args == null) {\n\t\t\t\t// Cannot be null because .NET trips over\n\t\t\t\treal_args = new ArrayCreation (\n\t\t\t\t\tnew MemberAccess (GetBinderNamespace (loc), \"CSharpArgumentInfo\", loc),\n\t\t\t\t\tnew ArrayInitializer (0, loc), loc);\n\t\t\t} else {\n\t\t\t\treal_args = new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc);\n\t\t\t}\n\n\t\t\tbinder_args.Add (new Argument (real_args));\n\n\t\t\treturn new Invocation (GetBinder (is_member_access ? \"InvokeMember\" : \"Invoke\", loc), binder_args);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tflags |= CSharpBinderFlags.ResultDiscarded;\n\t\t\tbase.EmitStatement (ec);\n\t\t}\n\t}\n\n\tclass DynamicMemberBinder : DynamicMemberAssignable\n\t{\n\t\treadonly string name;\n\n\t\tpublic DynamicMemberBinder (string name, Arguments args, Location loc)\n\t\t\t: base (args, loc)\n\t\t{\n\t\t\tthis.name = name;\n\t\t}\n\n\t\tpublic DynamicMemberBinder (string name, CSharpBinderFlags flags, Arguments args, Location loc)\n\t\t\t: this (name, args, loc)\n\t\t{\n\t\t\tbase.flags = flags;\n\t\t}\n\n\t\tprotected override Expression CreateCallSiteBinder (ResolveContext ec, Arguments args, bool isSet)\n\t\t{\n\t\t\tArguments binder_args = new Arguments (4);\n\n\t\t\tbinder_args.Add (new Argument (new BinderFlags (flags, this)));\n\t\t\tbinder_args.Add (new Argument (new StringLiteral (ec.BuiltinTypes, name, loc)));\n\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\n\t\t\tbinder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));\n\n\t\t\tisSet |= (flags & CSharpBinderFlags.ValueFromCompoundAssignment) != 0;\n\t\t\treturn new Invocation (GetBinder (isSet ? \"SetMember\" : \"GetMember\", loc), binder_args);\n\t\t}\n\t}\n\n\t//\n\t// Any member binder which can be source and target of assignment\n\t//\n\tabstract class DynamicMemberAssignable : DynamicExpressionStatement, IDynamicBinder, IAssignMethod\n\t{\n\t\tExpression setter;\n\t\tArguments setter_args;\n\n\t\tprotected DynamicMemberAssignable (Arguments args, Location loc)\n\t\t\t: base (null, args, loc)\n\t\t{\n\t\t\tbase.binder = this;\n\t\t}\n\n\t\tpublic Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)\n\t\t{\n\t\t\t//\n\t\t\t// DoResolve always uses getter\n\t\t\t//\n\t\t\treturn CreateCallSiteBinder (ec, args, false);\n\t\t}\n\n\t\tprotected abstract Expression CreateCallSiteBinder (ResolveContext ec, Arguments args, bool isSet);\n\n\t\tprotected virtual Arguments CreateSetterArguments (ResolveContext rc, Expression rhs)\n\t\t{\n\t\t\tvar setter_args = new Arguments (Arguments.Count + 1);\n\t\t\tsetter_args.AddRange (Arguments);\n\t\t\tsetter_args.Add (new Argument (rhs));\n\t\t\treturn setter_args;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\tif (right_side == EmptyExpression.OutAccess) {\n\t\t\t\tright_side.DoResolveLValue (rc, this);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (DoResolveCore (rc)) {\n\t\t\t\tsetter_args = CreateSetterArguments (rc, right_side);\n\t\t\t\tsetter = CreateCallSiteBinder (rc, setter_args, true);\n\t\t\t}\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// It's null for ResolveLValue used without assignment\n\t\t\tif (binder_expr == null)\n\t\t\t\tEmitCall (ec, setter, Arguments, false);\n\t\t\telse\n\t\t\t\tbase.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\t// It's null for ResolveLValue used without assignment\n\t\t\tif (binder_expr == null)\n\t\t\t\tEmitCall (ec, setter, Arguments, true);\n\t\t\telse\n\t\t\t\tbase.EmitStatement (ec);\n\t\t}\n\n\t\t#region IAssignMethod Members\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tEmitCall (ec, setter, setter_args, !leave_copy);\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tclass DynamicUnaryConversion : DynamicExpressionStatement, IDynamicBinder\n\t{\n\t\treadonly string name;\n\n\t\tpublic DynamicUnaryConversion (string name, Arguments args, Location loc)\n\t\t\t: base (null, args, loc)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tbase.binder = this;\n\t\t}\n\n\t\tpublic static DynamicUnaryConversion CreateIsTrue (ResolveContext rc, Arguments args, Location loc)\n\t\t{\n\t\t\treturn new DynamicUnaryConversion (\"IsTrue\", args, loc) { type = rc.BuiltinTypes.Bool };\n\t\t}\n\n\t\tpublic static DynamicUnaryConversion CreateIsFalse (ResolveContext rc, Arguments args, Location loc)\n\t\t{\n\t\t\treturn new DynamicUnaryConversion (\"IsFalse\", args, loc) { type = rc.BuiltinTypes.Bool };\n\t\t}\n\n\t\tpublic Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)\n\t\t{\n\t\t\tArguments binder_args = new Arguments (4);\n\n\t\t\tMemberAccess sle = new MemberAccess (new MemberAccess (\n\t\t\t\tnew QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, \"System\", loc), \"Linq\", loc), \"Expressions\", loc);\n\n\t\t\tvar flags = ec.HasSet (ResolveContext.Options.CheckedScope) ? CSharpBinderFlags.CheckedContext : 0;\n\n\t\t\tbinder_args.Add (new Argument (new BinderFlags (flags, this)));\n\t\t\tbinder_args.Add (new Argument (new MemberAccess (new MemberAccess (sle, \"ExpressionType\", loc), name, loc)));\n\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\n\t\t\tbinder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));\n\n\t\t\treturn new Invocation (GetBinder (\"UnaryOperation\", loc), binder_args);\n\t\t}\n\t}\n\n\tsealed class DynamicSiteClass : HoistedStoreyClass\n\t{\n\t\tpublic DynamicSiteClass (TypeDefinition parent, MemberBase host, TypeParameters tparams)\n\t\t\t: base (parent, MakeMemberName (host, \"DynamicSite\", parent.DynamicSitesCounter, tparams, Location.Null), tparams, Modifiers.STATIC, MemberKind.Class)\n\t\t{\n\t\t\tparent.DynamicSitesCounter++;\n\t\t}\n\n\t\tpublic FieldSpec CreateCallSiteField (FullNamedExpression type, Location loc)\n\t\t{\n\t\t\tint index = AnonymousMethodsCounter++;\n\t\t\tField f = new HoistedField (this, type, Modifiers.PUBLIC | Modifiers.STATIC, \"Site\" + index.ToString (\"X\"), null, loc);\n\t\t\tf.Define ();\n\n\t\t\tAddField (f);\n\t\t\treturn f.Spec;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs",
    "content": "//\n// ecore.cs: Core of the Expression representation for the intermediate tree.\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011-2012 Xamarin Inc.\n//\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing SLE = System.Linq.Expressions;\nusing System.Linq;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t/// <remarks>\n\t///   The ExprClass class contains the is used to pass the \n\t///   classification of an expression (value, variable, namespace,\n\t///   type, method group, property access, event access, indexer access,\n\t///   nothing).\n\t/// </remarks>\n\tpublic enum ExprClass : byte {\n\t\tUnresolved\t= 0,\n\t\t\n\t\tValue,\n\t\tVariable,\n\t\tNamespace,\n\t\tType,\n\t\tTypeParameter,\n\t\tMethodGroup,\n\t\tPropertyAccess,\n\t\tEventAccess,\n\t\tIndexerAccess,\n\t\tNothing, \n\t}\n\n\t/// <remarks>\n\t///   This is used to tell Resolve in which types of expressions we're\n\t///   interested.\n\t/// </remarks>\n\t[Flags]\n\tpublic enum ResolveFlags {\n\t\t// Returns Value, Variable, PropertyAccess, EventAccess or IndexerAccess.\n\t\tVariableOrValue\t\t= 1,\n\n\t\t// Returns a type expression.\n\t\tType\t\t\t= 1 << 1,\n\n\t\t// Returns a method group.\n\t\tMethodGroup\t\t= 1 << 2,\n\n\t\tTypeParameter\t= 1 << 3,\n\n\t\t// Mask of all the expression class flags.\n\t\tMaskExprClass = VariableOrValue | Type | MethodGroup | TypeParameter,\n\t}\n\n\t//\n\t// This is just as a hint to AddressOf of what will be done with the\n\t// address.\n\t[Flags]\n\tpublic enum AddressOp {\n\t\tStore = 1,\n\t\tLoad  = 2,\n\t\tLoadStore = 3\n\t};\n\t\n\t/// <summary>\n\t///   This interface is implemented by variables\n\t/// </summary>\n\tpublic interface IMemoryLocation {\n\t\t/// <summary>\n\t\t///   The AddressOf method should generate code that loads\n\t\t///   the address of the object and leaves it on the stack.\n\t\t///\n\t\t///   The `mode' argument is used to notify the expression\n\t\t///   of whether this will be used to read from the address or\n\t\t///   write to the address.\n\t\t///\n\t\t///   This is just a hint that can be used to provide good error\n\t\t///   reporting, and should have no other side effects. \n\t\t/// </summary>\n\t\tvoid AddressOf (EmitContext ec, AddressOp mode);\n\t}\n\n\t//\n\t// An expressions resolved as a direct variable reference\n\t//\n\tpublic interface IVariableReference : IFixedExpression\n\t{\n\t\tbool IsHoisted { get; }\n\t\tstring Name { get; }\n\t\tVariableInfo VariableInfo { get; }\n\n\t\tvoid SetHasAddressTaken ();\n\t}\n\n\t//\n\t// Implemented by an expression which could be or is always\n\t// fixed\n\t//\n\tpublic interface IFixedExpression\n\t{\n\t\tbool IsFixed { get; }\n\t}\n\n\tpublic interface IExpressionCleanup\n\t{\n\t\tvoid EmitCleanup (EmitContext ec);\n\t}\n\n\t/// <remarks>\n\t///   Base class for expressions\n\t/// </remarks>\n\tpublic abstract class Expression {\n\t\tpublic ExprClass eclass;\n\t\tprotected TypeSpec type;\n\t\tprotected Location loc;\n\t\t\n\t\tpublic TypeSpec Type {\n\t\t\tget { return type; }\n\t\t\tset { type = value; }\n\t\t}\n\n\t\tpublic virtual bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget { return loc; }\n\t\t}\n\n\t\tpublic virtual bool IsNull {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Used to workaround parser limitation where we cannot get\n\t\t// start of statement expression location\n\t\t//\n\t\tpublic virtual Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual MethodGroupExpr CanReduceLambda (AnonymousMethodBody body)\n\t\t{\n\t\t\t//\n\t\t\t// Return method-group expression when the expression can be used as\n\t\t\t// lambda replacement. A good example is array sorting where instead of\n\t\t\t// code like\n\t\t\t//\n\t\t\t//  Array.Sort (s, (a, b) => String.Compare (a, b));\n\t\t\t//\n\t\t\t// we can use method group directly\n\t\t\t//\n\t\t\t//  Array.Sort (s, String.Compare);\n\t\t\t//\n\t\t\t// Correct overload will be used because we do the reduction after\n\t\t\t// best candidate was found.\n\t\t\t//\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Returns true when the expression during Emit phase breaks stack\n\t\t// by using await expression\n\t\t//\n\t\tpublic virtual bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Performs semantic analysis on the Expression\n\t\t/// </summary>\n\t\t///\n\t\t/// <remarks>\n\t\t///   The Resolve method is invoked to perform the semantic analysis\n\t\t///   on the node.\n\t\t///\n\t\t///   The return value is an expression (it can be the\n\t\t///   same expression in some cases) or a new\n\t\t///   expression that better represents this node.\n\t\t///   \n\t\t///   For example, optimizations of Unary (LiteralInt)\n\t\t///   would return a new LiteralInt with a negated\n\t\t///   value.\n\t\t///   \n\t\t///   If there is an error during semantic analysis,\n\t\t///   then an error should be reported (using Report)\n\t\t///   and a null value should be returned.\n\t\t///   \n\t\t///   There are two side effects expected from calling\n\t\t///   Resolve(): the the field variable \"eclass\" should\n\t\t///   be set to any value of the enumeration\n\t\t///   `ExprClass' and the type variable should be set\n\t\t///   to a valid type (this is the type of the\n\t\t///   expression).\n\t\t/// </remarks>\n\t\tprotected abstract Expression DoResolve (ResolveContext rc);\n\n\t\tpublic virtual Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// This is used if the expression should be resolved as a type or namespace name.\n\t\t// the default implementation fails.   \n\t\t//\n\t\tpublic virtual TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)\n\t\t{\n\t\t\tResolveContext ec = new ResolveContext (mc);\n\t\t\tExpression e = Resolve (ec);\n\t\t\tif (e != null)\n\t\t\t\te.Error_UnexpectedKind (ec, ResolveFlags.Type, loc);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static void ErrorIsInaccesible (IMemberContext rc, string member, Location loc)\n\t\t{\n\t\t\trc.Module.Compiler.Report.Error (122, loc, \"`{0}' is inaccessible due to its protection level\", member);\n\t\t}\n\n\t\tpublic void Error_ExpressionMustBeConstant (ResolveContext rc, Location loc, string e_name)\n\t\t{\n\t\t\trc.Report.Error (133, loc, \"The expression being assigned to `{0}' must be constant\", e_name);\n\t\t}\n\n\t\tpublic void Error_ConstantCanBeInitializedWithNullOnly (ResolveContext rc, TypeSpec type, Location loc, string name)\n\t\t{\n\t\t\trc.Report.Error (134, loc, \"A constant `{0}' of reference type `{1}' can only be initialized with null\",\n\t\t\t\tname, type.GetSignatureForError ());\n\t\t}\n\n\t\tprotected virtual void Error_InvalidExpressionStatement (Report report, Location loc)\n\t\t{\n\t\t\treport.Error (201, loc, \"Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement\");\n\t\t}\n\t\t\n\t\tpublic void Error_InvalidExpressionStatement (BlockContext bc)\n\t\t{\n\t\t\tError_InvalidExpressionStatement (bc.Report, loc);\n\t\t}\n\n\t\tpublic void Error_InvalidExpressionStatement (Report report)\n\t\t{\n\t\t\tError_InvalidExpressionStatement (report, loc);\n\t\t}\n\n\t\tpublic static void Error_VoidInvalidInTheContext (Location loc, Report Report)\n\t\t{\n\t\t\tReport.Error (1547, loc, \"Keyword `void' cannot be used in this context\");\n\t\t}\n\n\t\tpublic virtual void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)\n\t\t{\n\t\t\tError_ValueCannotBeConvertedCore (ec, loc, target, expl);\n\t\t}\n\n\t\tprotected void Error_ValueCannotBeConvertedCore (ResolveContext ec, Location loc, TypeSpec target, bool expl)\n\t\t{\n\t\t\t// The error was already reported as CS1660\n\t\t\tif (type == InternalType.AnonymousMethod)\n\t\t\t\treturn;\n\n\t\t\tif (type == InternalType.ErrorType || target == InternalType.ErrorType)\n\t\t\t\treturn;\n\n\t\t\tstring from_type = type.GetSignatureForError ();\n\t\t\tstring to_type = target.GetSignatureForError ();\n\t\t\tif (from_type == to_type) {\n\t\t\t\tfrom_type = type.GetSignatureForErrorIncludingAssemblyName ();\n\t\t\t\tto_type = target.GetSignatureForErrorIncludingAssemblyName ();\n\t\t\t}\n\n\t\t\tif (expl) {\n\t\t\t\tec.Report.Error (30, loc, \"Cannot convert type `{0}' to `{1}'\",\n\t\t\t\t\tfrom_type, to_type);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tec.Report.DisableReporting ();\n\t\t\tbool expl_exists = Convert.ExplicitConversion (ec, this, target, Location.Null) != null;\n\t\t\tec.Report.EnableReporting ();\n\n\t\t\tif (expl_exists) {\n\t\t\t\tec.Report.Error (266, loc,\n\t\t\t\t\t\"Cannot implicitly convert type `{0}' to `{1}'. An explicit conversion exists (are you missing a cast?)\",\n\t\t\t\t\tfrom_type, to_type);\n\t\t\t} else {\n\t\t\t\tec.Report.Error (29, loc, \"Cannot implicitly convert type `{0}' to `{1}'\",\n\t\t\t\t\tfrom_type, to_type);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Error_TypeArgumentsCannotBeUsed (IMemberContext context, MemberSpec member, Location loc)\n\t\t{\n\t\t\t// Better message for possible generic expressions\n\t\t\tif (member != null && (member.Kind & MemberKind.GenericMask) != 0) {\n\t\t\t\tvar report = context.Module.Compiler.Report;\n\t\t\t\treport.SymbolRelatedToPreviousError (member);\n\t\t\t\tif (member is TypeSpec)\n\t\t\t\t\tmember = ((TypeSpec) member).GetDefinition ();\n\t\t\t\telse\n\t\t\t\t\tmember = ((MethodSpec) member).GetGenericMethodDefinition ();\n\n\t\t\t\tstring name = member.Kind == MemberKind.Method ? \"method\" : \"type\";\n\t\t\t\tif (member.IsGeneric) {\n\t\t\t\t\treport.Error (305, loc, \"Using the generic {0} `{1}' requires `{2}' type argument(s)\",\n\t\t\t\t\t\tname, member.GetSignatureForError (), member.Arity.ToString ());\n\t\t\t\t} else {\n\t\t\t\t\treport.Error (308, loc, \"The non-generic {0} `{1}' cannot be used with the type arguments\",\n\t\t\t\t\t\tname, member.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tError_TypeArgumentsCannotBeUsed (context, ExprClassName, GetSignatureForError (), loc);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Error_TypeArgumentsCannotBeUsed (IMemberContext context, string exprType, string name, Location loc)\n\t\t{\n\t\t\tcontext.Module.Compiler.Report.Error (307, loc, \"The {0} `{1}' cannot be used with type arguments\",\n\t\t\t\texprType, name);\n\t\t}\n\n\t\tprotected virtual void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)\n\t\t{\n\t\t\tError_TypeDoesNotContainDefinition (ec, loc, type, name);\n\t\t}\n\n\t\tpublic static void Error_TypeDoesNotContainDefinition (ResolveContext ec, Location loc, TypeSpec type, string name)\n\t\t{\n\t\t\tec.Report.SymbolRelatedToPreviousError (type);\n\t\t\tec.Report.Error (117, loc, \"`{0}' does not contain a definition for `{1}'\",\n\t\t\t\ttype.GetSignatureForError (), name);\n\t\t}\n\n\t\tpublic virtual void Error_ValueAssignment (ResolveContext rc, Expression rhs)\n\t\t{\n\t\t\tif (rhs == EmptyExpression.LValueMemberAccess || rhs == EmptyExpression.LValueMemberOutAccess) {\n\t\t\t\t// Already reported as CS1612\n\t\t\t} else if (rhs == EmptyExpression.OutAccess) {\n\t\t\t\trc.Report.Error (1510, loc, \"A ref or out argument must be an assignable variable\");\n\t\t\t} else {\n\t\t\t\trc.Report.Error (131, loc, \"The left-hand side of an assignment must be a variable, a property or an indexer\");\n\t\t\t}\n\t\t}\n\n\t\tprotected void Error_VoidPointerOperation (ResolveContext rc)\n\t\t{\n\t\t\trc.Report.Error (242, loc, \"The operation in question is undefined on void pointers\");\n\t\t}\n\n\t\tpublic static void Warning_UnreachableExpression (ResolveContext rc, Location loc)\n\t\t{\n\t\t\trc.Report.Warning (429, 4, loc, \"Unreachable expression code detected\");\n\t\t}\n\n\t\tpublic ResolveFlags ExprClassToResolveFlags {\n\t\t\tget {\n\t\t\t\tswitch (eclass) {\n\t\t\t\tcase ExprClass.Type:\n\t\t\t\tcase ExprClass.Namespace:\n\t\t\t\t\treturn ResolveFlags.Type;\n\t\t\t\t\t\n\t\t\t\tcase ExprClass.MethodGroup:\n\t\t\t\t\treturn ResolveFlags.MethodGroup;\n\t\t\t\t\t\n\t\t\t\tcase ExprClass.TypeParameter:\n\t\t\t\t\treturn ResolveFlags.TypeParameter;\n\t\t\t\t\t\n\t\t\t\tcase ExprClass.Value:\n\t\t\t\tcase ExprClass.Variable:\n\t\t\t\tcase ExprClass.PropertyAccess:\n\t\t\t\tcase ExprClass.EventAccess:\n\t\t\t\tcase ExprClass.IndexerAccess:\n\t\t\t\t\treturn ResolveFlags.VariableOrValue;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InternalErrorException (loc.ToString () + \" \" +  GetType () + \" ExprClass is Invalid after resolve\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Implements identical simple name and type-name resolution\n\t\t//\n\t\tpublic Expression ProbeIdenticalTypeName (ResolveContext rc, Expression left, SimpleName name)\n\t\t{\n\t\t\tvar t = left.Type;\n\t\t\tif (t.Kind == MemberKind.InternalCompilerType || t is ElementTypeSpec || t.Arity > 0)\n\t\t\t\treturn left;\n\n\t\t\t// In a member access of the form E.I, if E is a single identifier, and if the meaning of E as a simple-name is\n\t\t\t// a constant, field, property, local variable, or parameter with the same type as the meaning of E as a type-name\n\n\t\t\tif (left is MemberExpr || left is VariableReference) {\n\t\t\t\tvar identical_type = rc.LookupNamespaceOrType (name.Name, 0, LookupMode.Probing, loc) as TypeExpr;\n\t\t\t\tif (identical_type != null && identical_type.Type == left.Type)\n\t\t\t\t\treturn identical_type;\n\t\t\t}\n\n\t\t\treturn left;\n\t\t}\n\n\t\tpublic virtual string GetSignatureForError ()\n\t\t{\n\t\t\treturn type.GetDefinition ().GetSignatureForError ();\n\t\t}\n\n\t\tpublic static bool IsNeverNull (Expression expr)\n\t\t{\n\t\t\tif (expr is This || expr is New || expr is ArrayCreation || expr is DelegateCreation || expr is ConditionalMemberAccess)\n\t\t\t\treturn true;\n\n\t\t\tvar c = expr as Constant;\n\t\t\tif (c != null)\n\t\t\t\treturn !c.IsNull;\n\n\t\t\tvar tc = expr as TypeCast;\n\t\t\tif (tc != null)\n\t\t\t\treturn IsNeverNull (tc.Child);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected static bool IsNullPropagatingValid (TypeSpec type)\n\t\t{\n\t\t\tswitch (type.Kind) {\n\t\t\tcase MemberKind.Struct:\n\t\t\t\treturn type.IsNullableType;\n\t\t\tcase MemberKind.Enum:\n\t\t\tcase MemberKind.Void:\n\t\t\tcase MemberKind.PointerType:\n\t\t\t\treturn false;\n\t\t\tcase MemberKind.InternalCompilerType:\n\t\t\t\treturn type.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\t\t\tdefault:\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool HasConditionalAccess ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected static TypeSpec LiftMemberType (ResolveContext rc, TypeSpec type)\n\t\t{\n\t\t\treturn TypeSpec.IsValueType (type) && !type.IsNullableType ?\n\t\t\t\tNullable.NullableInfo.MakeType (rc.Module, type) :\n\t\t\t\ttype;\n\t\t}\n\t       \n\t\t/// <summary>\n\t\t///   Resolves an expression and performs semantic analysis on it.\n\t\t/// </summary>\n\t\t///\n\t\t/// <remarks>\n\t\t///   Currently Resolve wraps DoResolve to perform sanity\n\t\t///   checking and assertion checking on what we expect from Resolve.\n\t\t/// </remarks>\n\t\tpublic Expression Resolve (ResolveContext ec, ResolveFlags flags)\n\t\t{\n\t\t\tif (eclass != ExprClass.Unresolved) {\n\t\t\t\tif ((flags & ExprClassToResolveFlags) == 0) {\n\t\t\t\t\tError_UnexpectedKind (ec, flags, loc);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\t\n\t\t\tExpression e;\n\t\t\ttry {\n\t\t\t\te = DoResolve (ec);\n\n\t\t\t\tif (e == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif ((flags & e.ExprClassToResolveFlags) == 0) {\n\t\t\t\t\te.Error_UnexpectedKind (ec, flags, loc);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (e.type == null)\n\t\t\t\t\tthrow new InternalErrorException (\"Expression `{0}' didn't set its type in DoResolve\", e.GetType ());\n\n\t\t\t\treturn e;\n\t\t\t} catch (Exception ex) {\n\t\t\t\tif (loc.IsNull || ec.Module.Compiler.Settings.BreakOnInternalError || ex is CompletionResult || ec.Report.IsDisabled || ex is FatalException ||\n\t\t\t\t\tec.Report.Printer is NullReportPrinter)\n\t\t\t\t\tthrow;\n\n\t\t\t\tec.Report.Error (584, loc, \"Internal compiler error: {0}\", ex.Message);\n\t\t\t\treturn ErrorExpression.Instance;\t// TODO: Add location\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Resolves an expression and performs semantic analysis on it.\n\t\t/// </summary>\n\t\tpublic Expression Resolve (ResolveContext rc)\n\t\t{\n\t\t\treturn Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Resolves an expression for LValue assignment\n\t\t/// </summary>\n\t\t///\n\t\t/// <remarks>\n\t\t///   Currently ResolveLValue wraps DoResolveLValue to perform sanity\n\t\t///   checking and assertion checking on what we expect from Resolve\n\t\t/// </remarks>\n\t\tpublic Expression ResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tint errors = ec.Report.Errors;\n\t\t\tbool out_access = right_side == EmptyExpression.OutAccess;\n\n\t\t\tExpression e = DoResolveLValue (ec, right_side);\n\n\t\t\tif (e != null && out_access && !(e is IMemoryLocation)) {\n\t\t\t\t// FIXME: There's no problem with correctness, the 'Expr = null' handles that.\n\t\t\t\t//        Enabling this 'throw' will \"only\" result in deleting useless code elsewhere,\n\n\t\t\t\t//throw new InternalErrorException (\"ResolveLValue didn't return an IMemoryLocation: \" +\n\t\t\t\t//\t\t\t\t  e.GetType () + \" \" + e.GetSignatureForError ());\n\t\t\t\te = null;\n\t\t\t}\n\n\t\t\tif (e == null) {\n\t\t\t\tif (errors == ec.Report.Errors) {\n\t\t\t\t\tError_ValueAssignment (ec, right_side);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (e.eclass == ExprClass.Unresolved)\n\t\t\t\tthrow new Exception (\"Expression \" + e + \" ExprClass is Invalid after resolve\");\n\n\t\t\tif ((e.type == null) && !(e is GenericTypeExpr))\n\t\t\t\tthrow new Exception (\"Expression \" + e + \" did not set its type after Resolve\");\n\n\t\t\treturn e;\n\t\t}\n\n\t\tpublic Constant ResolveLabelConstant (ResolveContext rc)\n\t\t{\n\t\t\tvar expr = Resolve (rc);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tConstant c = expr as Constant;\n\t\t\tif (c == null) {\n\t\t\t\tif (expr.type != InternalType.ErrorType)\n\t\t\t\t\trc.Report.Error (150, expr.StartLocation, \"A constant value is expected\");\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\n\t\tpublic virtual void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tif (Attribute.IsValidArgumentType (parameterType)) {\n\t\t\t\trc.Module.Compiler.Report.Error (182, loc,\n\t\t\t\t\t\"An attribute argument must be a constant expression, typeof expression or array creation expression\");\n\t\t\t} else {\n\t\t\t\trc.Module.Compiler.Report.Error (181, loc,\n\t\t\t\t\t\"Attribute constructor parameter has type `{0}', which is not a valid attribute parameter type\",\n\t\t\t\t\ttargetType.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Emits the code for the expression\n\t\t/// </summary>\n\t\t///\n\t\t/// <remarks>\n\t\t///   The Emit method is invoked to generate the code\n\t\t///   for the expression.  \n\t\t/// </remarks>\n\t\tpublic abstract void Emit (EmitContext ec);\n\n\n\t\t// Emit code to branch to @target if this expression is equivalent to @on_true.\n\t\t// The default implementation is to emit the value, and then emit a brtrue or brfalse.\n\t\t// Subclasses can provide more efficient implementations, but those MUST be equivalent,\n\t\t// including the use of conditional branches.  Note also that a branch MUST be emitted\n\t\tpublic virtual void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t\tEmit (ec);\n\t\t\tec.Emit (on_true ? OpCodes.Brtrue : OpCodes.Brfalse, target);\n\t\t}\n\n\t\t// Emit this expression for its side effects, not for its value.\n\t\t// The default implementation is to emit the value, and then throw it away.\n\t\t// Subclasses can provide more efficient implementations, but those MUST be equivalent\n\t\tpublic virtual void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec);\n\t\t\tec.Emit (OpCodes.Pop);\n\t\t}\n\n\t\t//\n\t\t// Emits the expression into temporary field variable. The method\n\t\t// should be used for await expressions only\n\t\t//\n\t\tpublic virtual Expression EmitToField (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// This is the await prepare Emit method. When emitting code like\n\t\t\t// a + b we emit code like\n\t\t\t//\n\t\t\t// a.Emit ()\n\t\t\t// b.Emit ()\n\t\t\t// Opcodes.Add\n\t\t\t//\n\t\t\t// For await a + await b we have to interfere the flow to keep the\n\t\t\t// stack clean because await yields from the expression. The emit\n\t\t\t// then changes to\n\t\t\t//\n\t\t\t// a = a.EmitToField ()\t// a is changed to temporary field access\n\t\t\t// b = b.EmitToField ()\n\t\t\t// a.Emit ()\n\t\t\t// b.Emit ()\n\t\t\t// Opcodes.Add\n\t\t\t//\n\t\t\t//\n\t\t\t// The idea is to emit expression and leave the stack empty with\n\t\t\t// result value still available.\n\t\t\t//\n\t\t\t// Expressions should override this default implementation when\n\t\t\t// optimized version can be provided (e.g. FieldExpr)\n\t\t\t//\n\t\t\t//\n\t\t\t// We can optimize for side-effect free expressions, they can be\n\t\t\t// emitted out of order\n\t\t\t//\n\t\t\tif (IsSideEffectFree)\n\t\t\t\treturn this;\n\n\t\t\tbool needs_temporary = ContainsEmitWithAwait ();\n\t\t\tif (!needs_temporary)\n\t\t\t\tec.EmitThis ();\n\n\t\t\t// Emit original code\n\t\t\tvar field = EmitToFieldSource (ec);\n\t\t\tif (field == null) {\n\t\t\t\t//\n\t\t\t\t// Store the result to temporary field when we\n\t\t\t\t// cannot load `this' directly\n\t\t\t\t//\n\t\t\t\tfield = ec.GetTemporaryField (type);\n\t\t\t\tif (needs_temporary) {\n\t\t\t\t\t//\n\t\t\t\t\t// Create temporary local (we cannot load `this' before Emit)\n\t\t\t\t\t//\n\t\t\t\t\tvar temp = ec.GetTemporaryLocal (type);\n\t\t\t\t\tec.Emit (OpCodes.Stloc, temp);\n\n\t\t\t\t\tec.EmitThis ();\n\t\t\t\t\tec.Emit (OpCodes.Ldloc, temp);\n\t\t\t\t\tfield.EmitAssignFromStack (ec);\n\n\t\t\t\t\tec.FreeTemporaryLocal (temp, type);\n\t\t\t\t} else {\n\t\t\t\t\tfield.EmitAssignFromStack (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn field;\n\t\t}\n\n\t\tprotected virtual FieldExpr EmitToFieldSource (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Default implementation calls Emit method\n\t\t\t//\n\t\t\tEmit (ec);\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected static void EmitExpressionsList (EmitContext ec, List<Expression> expressions)\n\t\t{\n\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody)) {\n\t\t\t\tbool contains_await = false;\n\n\t\t\t\tfor (int i = 1; i < expressions.Count; ++i) {\n\t\t\t\t\tif (expressions[i].ContainsEmitWithAwait ()) {\n\t\t\t\t\t\tcontains_await = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (contains_await) {\n\t\t\t\t\tfor (int i = 0; i < expressions.Count; ++i) {\n\t\t\t\t\t\texpressions[i] = expressions[i].EmitToField (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < expressions.Count; ++i) {\n\t\t\t\texpressions[i].Emit (ec);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Protected constructor.  Only derivate types should\n\t\t///   be able to be created\n\t\t/// </summary>\n\n\t\tprotected Expression ()\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Returns a fully formed expression after a MemberLookup\n\t\t/// </summary>\n\t\t/// \n\t\tstatic Expression ExprClassFromMemberInfo (MemberSpec spec, Location loc)\n\t\t{\n\t\t\tif (spec is EventSpec)\n\t\t\t\treturn new EventExpr ((EventSpec) spec, loc);\n\t\t\tif (spec is ConstSpec)\n\t\t\t\treturn new ConstantExpr ((ConstSpec) spec, loc);\n\t\t\tif (spec is FieldSpec)\n\t\t\t\treturn new FieldExpr ((FieldSpec) spec, loc);\n\t\t\tif (spec is PropertySpec)\n\t\t\t\treturn new PropertyExpr ((PropertySpec) spec, loc);\n\t\t\tif (spec is TypeSpec)\n\t\t\t\treturn new TypeExpression (((TypeSpec) spec), loc);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static MethodSpec ConstructorLookup (ResolveContext rc, TypeSpec type, ref Arguments args, Location loc)\n\t\t{\n\t\t\tvar ctors = MemberCache.FindMembers (type, Constructor.ConstructorName, true);\n\t\t\tif (ctors == null) {\n\t\t\t\tswitch (type.Kind) {\n\t\t\t\tcase MemberKind.Struct:\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\t\t// Report meaningful error for struct as they always have default ctor in C# context\n\t\t\t\t\tOverloadResolver.Error_ConstructorMismatch (rc, type, args == null ? 0 : args.Count, loc);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MemberKind.MissingType:\n\t\t\t\tcase MemberKind.InternalCompilerType:\n// LAMESPEC: dynamic is not really object\n//\t\t\t\t\tif (type.BuiltinType == BuiltinTypeSpec.Type.Object)\n//\t\t\t\t\t\tgoto default;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\t\trc.Report.Error (143, loc, \"The class `{0}' has no constructors defined\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar r = new OverloadResolver (ctors, OverloadResolver.Restrictions.NoBaseMembers, loc);\n\t\t\tif (!rc.HasSet (ResolveContext.Options.BaseInitializer)) {\n\t\t\t\tr.InstanceQualifier = new ConstructorInstanceQualifier (type);\n\t\t\t}\n\n\t\t\treturn r.ResolveMember<MethodSpec> (rc, ref args);\n\t\t}\n\n\t\t[Flags]\n\t\tpublic enum MemberLookupRestrictions\n\t\t{\n\t\t\tNone = 0,\n\t\t\tInvocableOnly = 1,\n\t\t\tExactArity = 1 << 2,\n\t\t\tReadAccess = 1 << 3,\n\t\t\tEmptyArguments = 1 << 4,\n\t\t\tIgnoreArity = 1 << 5,\n\t\t\tIgnoreAmbiguity = 1 << 6\n\t\t}\n\n\t\t//\n\t\t// Lookup type `queried_type' for code in class `container_type' with a qualifier of\n\t\t// `qualifier_type' or null to lookup members in the current class.\n\t\t//\n\t\tpublic static Expression MemberLookup (IMemberContext rc, bool errorMode, TypeSpec queried_type, string name, int arity, MemberLookupRestrictions restrictions, Location loc)\n\t\t{\n\t\t\tvar members = MemberCache.FindMembers (queried_type, name, false);\n\t\t\tif (members == null)\n\t\t\t\treturn null;\n\n\t\t\tMemberSpec non_method = null;\n\t\t\tMemberSpec ambig_non_method = null;\n\t\t\tdo {\n\t\t\t\tfor (int i = 0; i < members.Count; ++i) {\n\t\t\t\t\tvar member = members[i];\n\n\t\t\t\t\t// HACK: for events because +=/-= can appear at same class only, should use OverrideToBase there\n\t\t\t\t\tif ((member.Modifiers & Modifiers.OVERRIDE) != 0 && member.Kind != MemberKind.Event)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif ((member.Modifiers & Modifiers.BACKING_FIELD) != 0 || member.Kind == MemberKind.Operator)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif ((arity > 0 || (restrictions & MemberLookupRestrictions.ExactArity) != 0) && member.Arity != arity)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!errorMode) {\n\t\t\t\t\t\tif (!member.IsAccessible (rc))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// With runtime binder we can have a situation where queried type is inaccessible\n\t\t\t\t\t\t// because it came via dynamic object, the check about inconsisted accessibility\n\t\t\t\t\t\t// had no effect as the type was unknown during compilation\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// class A {\n\t\t\t\t\t\t//\t\tprivate class N { }\n\t\t\t\t\t\t//\n\t\t\t\t\t\t//\t\tpublic dynamic Foo ()\n\t\t\t\t\t\t//\t\t{\n\t\t\t\t\t\t//\t\t\treturn new N ();\n\t\t\t\t\t\t//\t\t}\n\t\t\t\t\t\t//\t}\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (rc.Module.Compiler.IsRuntimeBinder && !member.DeclaringType.IsAccessible (rc))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((restrictions & MemberLookupRestrictions.InvocableOnly) != 0) {\n\t\t\t\t\t\tif (member is MethodSpec) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Interface members that are hidden by class members are removed from the set. This\n\t\t\t\t\t\t\t// step only has an effect if T is a type parameter and T has both an effective base \n\t\t\t\t\t\t\t// class other than object and a non-empty effective interface set\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tvar tps = queried_type as TypeParameterSpec;\n\t\t\t\t\t\t\tif (tps != null && tps.HasTypeConstraint)\n\t\t\t\t\t\t\t\tmembers = RemoveHiddenTypeParameterMethods (members);\n\n\t\t\t\t\t\t\treturn new MethodGroupExpr (members, queried_type, loc);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!Invocation.IsMemberInvocable (member))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (non_method == null || member is MethodSpec || non_method.IsNotCSharpCompatible) {\n\t\t\t\t\t\tnon_method = member;\n\t\t\t\t\t} else if (!errorMode && !member.IsNotCSharpCompatible) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Interface members that are hidden by class members are removed from the set when T is a type parameter and\n\t\t\t\t\t\t// T has both an effective base class other than object and a non-empty effective interface set.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// The spec has more complex rules but we simply remove all members declared in an interface declaration.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar tps = queried_type as TypeParameterSpec;\n\t\t\t\t\t\tif (tps != null && tps.HasTypeConstraint) {\n\t\t\t\t\t\t\tif (non_method.DeclaringType.IsClass && member.DeclaringType.IsInterface)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (non_method.DeclaringType.IsInterface && member.DeclaringType.IsInterface) {\n\t\t\t\t\t\t\t\tnon_method = member;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tambig_non_method = member;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (non_method != null) {\n\t\t\t\t\tif (ambig_non_method != null && rc != null && (restrictions & MemberLookupRestrictions.IgnoreAmbiguity) == 0) {\n\t\t\t\t\t\tvar report = rc.Module.Compiler.Report;\n\t\t\t\t\t\treport.SymbolRelatedToPreviousError (non_method);\n\t\t\t\t\t\treport.SymbolRelatedToPreviousError (ambig_non_method);\n\t\t\t\t\t\treport.Error (229, loc, \"Ambiguity between `{0}' and `{1}'\",\n\t\t\t\t\t\t\tnon_method.GetSignatureForError (), ambig_non_method.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (non_method is MethodSpec)\n\t\t\t\t\t\treturn new MethodGroupExpr (members, queried_type, loc);\n\n\t\t\t\t\treturn ExprClassFromMemberInfo (non_method, loc);\n\t\t\t\t}\n\n\t\t\t\tif (members[0].DeclaringType.BaseType == null)\n\t\t\t\t\tmembers = null;\n\t\t\t\telse\n\t\t\t\t\tmembers = MemberCache.FindMembers (members[0].DeclaringType.BaseType, name, false);\n\n\t\t\t} while (members != null);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic IList<MemberSpec> RemoveHiddenTypeParameterMethods (IList<MemberSpec> members)\n\t\t{\n\t\t\tif (members.Count < 2)\n\t\t\t\treturn members;\n\n\t\t\t//\n\t\t\t// If M is a method, then all non-method members declared in an interface declaration\n\t\t\t// are removed from the set, and all methods with the same signature as M declared in\n\t\t\t// an interface declaration are removed from the set\n\t\t\t//\n\n\t\t\tbool copied = false;\n\t\t\tfor (int i = 0; i < members.Count; ++i) {\n\t\t\t\tvar method = members[i] as MethodSpec;\n\t\t\t\tif (method == null) {\n\t\t\t\t\tif (!copied) {\n\t\t\t\t\t\tcopied = true;\n\t\t\t\t\t\tmembers = new List<MemberSpec> (members);\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\tmembers.RemoveAt (i--);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!method.DeclaringType.IsInterface)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfor (int ii = 0; ii < members.Count; ++ii) {\n\t\t\t\t\tvar candidate = members[ii] as MethodSpec;\n\t\t\t\t\tif (candidate == null || !candidate.DeclaringType.IsClass)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (candidate.Parameters, method.Parameters))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!copied) {\n\t\t\t\t\t\tcopied = true;\n\t\t\t\t\t\tmembers = new List<MemberSpec> (members);\n\t\t\t\t\t}\n\n\t\t\t\t\tmembers.RemoveAt (i--);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn members;\n\t\t}\n\n\t\tprotected virtual void Error_NegativeArrayIndex (ResolveContext ec, Location loc)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic virtual void Error_OperatorCannotBeApplied (ResolveContext rc, Location loc, string oper, TypeSpec t)\n\t\t{\n\t\t\tif (t == InternalType.ErrorType)\n\t\t\t\treturn;\n\n\t\t\trc.Report.Error (23, loc, \"The `{0}' operator cannot be applied to operand of type `{1}'\",\n\t\t\t\toper, t.GetSignatureForError ());\n\t\t}\n\n\t\tprotected void Error_PointerInsideExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (1944, loc, \"An expression tree cannot contain an unsafe pointer operation\");\n\t\t}\n\n\t\tprotected void Error_NullShortCircuitInsideExpressionTree (ResolveContext rc)\n\t\t{\n\t\t\trc.Report.Error (8072, loc, \"An expression tree cannot contain a null propagating operator\");\n\t\t}\n\n\t\tpublic virtual void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t}\n\n\t\t//\n\t\t// Special version of flow analysis for expressions which can return different\n\t\t// on-true and on-false result. Used by &&, ||, ?: expressions\n\t\t//\n\t\tpublic virtual void FlowAnalysisConditional (FlowAnalysisContext fc)\n\t\t{\n\t\t\tFlowAnalysis (fc);\n\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Returns an expression that can be used to invoke operator true\n\t\t///   on the expression if it exists.\n\t\t/// </summary>\n\t\tprotected static Expression GetOperatorTrue (ResolveContext ec, Expression e, Location loc)\n\t\t{\n\t\t\treturn GetOperatorTrueOrFalse (ec, e, true, loc);\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Returns an expression that can be used to invoke operator false\n\t\t///   on the expression if it exists.\n\t\t/// </summary>\n\t\tprotected static Expression GetOperatorFalse (ResolveContext ec, Expression e, Location loc)\n\t\t{\n\t\t\treturn GetOperatorTrueOrFalse (ec, e, false, loc);\n\t\t}\n\n\t\tstatic Expression GetOperatorTrueOrFalse (ResolveContext ec, Expression e, bool is_true, Location loc)\n\t\t{\n\t\t\tvar op = is_true ? Operator.OpType.True : Operator.OpType.False;\n\t\t\tvar methods = MemberCache.GetUserOperator (e.type, op, false);\n\t\t\tif (methods == null)\n\t\t\t\treturn null;\n\n\t\t\tArguments arguments = new Arguments (1);\n\t\t\targuments.Add (new Argument (e));\n\n\t\t\tvar res = new OverloadResolver (methods, OverloadResolver.Restrictions.BaseMembersIncluded | OverloadResolver.Restrictions.NoBaseMembers, loc);\n\t\t\tvar oper = res.ResolveOperator (ec, ref arguments);\n\n\t\t\tif (oper == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new UserOperatorCall (oper, arguments, null, loc);\n\t\t}\n\t\t\n\t\tpublic virtual string ExprClassName\n\t\t{\n\t\t\tget {\n\t\t\t\tswitch (eclass){\n\t\t\t\tcase ExprClass.Unresolved:\n\t\t\t\t\treturn \"Unresolved\";\n\t\t\t\tcase ExprClass.Value:\n\t\t\t\t\treturn \"value\";\n\t\t\t\tcase ExprClass.Variable:\n\t\t\t\t\treturn \"variable\";\n\t\t\t\tcase ExprClass.Namespace:\n\t\t\t\t\treturn \"namespace\";\n\t\t\t\tcase ExprClass.Type:\n\t\t\t\t\treturn \"type\";\n\t\t\t\tcase ExprClass.MethodGroup:\n\t\t\t\t\treturn \"method group\";\n\t\t\t\tcase ExprClass.PropertyAccess:\n\t\t\t\t\treturn \"property access\";\n\t\t\t\tcase ExprClass.EventAccess:\n\t\t\t\t\treturn \"event access\";\n\t\t\t\tcase ExprClass.IndexerAccess:\n\t\t\t\t\treturn \"indexer access\";\n\t\t\t\tcase ExprClass.Nothing:\n\t\t\t\t\treturn \"null\";\n\t\t\t\tcase ExprClass.TypeParameter:\n\t\t\t\t\treturn \"type parameter\";\n\t\t\t\t}\n\t\t\t\tthrow new Exception (\"Should not happen\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///   Reports that we were expecting `expr' to be of class `expected'\n\t\t/// </summary>\n\t\tpublic static void Error_UnexpectedKind (IMemberContext ctx, Expression memberExpr, string expected, string was, Location loc)\n\t\t{\n\t\t\tvar name = memberExpr.GetSignatureForError ();\n\n\t\t\tctx.Module.Compiler.Report.Error (118, loc, \"`{0}' is a `{1}' but a `{2}' was expected\", name, was, expected);\n\t\t}\n\n\t\tpublic virtual void Error_UnexpectedKind (ResolveContext ec, ResolveFlags flags, Location loc)\n\t\t{\n\t\t\tstring [] valid = new string [4];\n\t\t\tint count = 0;\n\n\t\t\tif ((flags & ResolveFlags.VariableOrValue) != 0) {\n\t\t\t\tvalid [count++] = \"variable\";\n\t\t\t\tvalid [count++] = \"value\";\n\t\t\t}\n\n\t\t\tif ((flags & ResolveFlags.Type) != 0)\n\t\t\t\tvalid [count++] = \"type\";\n\n\t\t\tif ((flags & ResolveFlags.MethodGroup) != 0)\n\t\t\t\tvalid [count++] = \"method group\";\n\n\t\t\tif (count == 0)\n\t\t\t\tvalid [count++] = \"unknown\";\n\n\t\t\tStringBuilder sb = new StringBuilder (valid [0]);\n\t\t\tfor (int i = 1; i < count - 1; i++) {\n\t\t\t\tsb.Append (\"', `\");\n\t\t\t\tsb.Append (valid [i]);\n\t\t\t}\n\t\t\tif (count > 1) {\n\t\t\t\tsb.Append (\"' or `\");\n\t\t\t\tsb.Append (valid [count - 1]);\n\t\t\t}\n\n\t\t\tec.Report.Error (119, loc, \n\t\t\t\t\"Expression denotes a `{0}', where a `{1}' was expected\", ExprClassName, sb.ToString ());\n\t\t}\n\t\t\n\t\tpublic static void UnsafeError (ResolveContext ec, Location loc)\n\t\t{\n\t\t\tUnsafeError (ec.Report, loc);\n\t\t}\n\n\t\tpublic static void UnsafeError (Report Report, Location loc)\n\t\t{\n\t\t\tReport.Error (214, loc, \"Pointers and fixed size buffers may only be used in an unsafe context\");\n\t\t}\n\n\t\t//\n\t\t// Converts `source' to an int, uint, long or ulong.\n\t\t//\n\t\tprotected Expression ConvertExpressionToArrayIndex (ResolveContext ec, Expression source, bool pointerArray = false)\n\t\t{\n\t\t\tvar btypes = ec.BuiltinTypes;\n\n\t\t\tif (source.type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (source));\n\t\t\t\treturn new DynamicConversion (btypes.Int, CSharpBinderFlags.ConvertArrayIndex, args, loc).Resolve (ec);\n\t\t\t}\n\n\t\t\tExpression converted;\n\t\t\t\n\t\t\tusing (ec.Set (ResolveContext.Options.CheckedScope)) {\n\t\t\t\tconverted = Convert.ImplicitConversion (ec, source, btypes.Int, source.loc);\n\t\t\t\tif (converted == null)\n\t\t\t\t\tconverted = Convert.ImplicitConversion (ec, source, btypes.UInt, source.loc);\n\t\t\t\tif (converted == null)\n\t\t\t\t\tconverted = Convert.ImplicitConversion (ec, source, btypes.Long, source.loc);\n\t\t\t\tif (converted == null)\n\t\t\t\t\tconverted = Convert.ImplicitConversion (ec, source, btypes.ULong, source.loc);\n\n\t\t\t\tif (converted == null) {\n\t\t\t\t\tsource.Error_ValueCannotBeConverted (ec, btypes.Int, false);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (pointerArray)\n\t\t\t\treturn converted;\n\n\t\t\t//\n\t\t\t// Only positive constants are allowed at compile time\n\t\t\t//\n\t\t\tConstant c = converted as Constant;\n\t\t\tif (c != null && c.IsNegative)\n\t\t\t\tError_NegativeArrayIndex (ec, source.loc);\n\n\t\t\t// No conversion needed to array index\n\t\t\tif (converted.Type.BuiltinType == BuiltinTypeSpec.Type.Int)\n\t\t\t\treturn converted;\n\n\t\t\treturn new ArrayIndexCast (converted, btypes.Int).Resolve (ec);\n\t\t}\n\n\t\t//\n\t\t// Derived classes implement this method by cloning the fields that\n\t\t// could become altered during the Resolve stage\n\t\t//\n\t\t// Only expressions that are created for the parser need to implement\n\t\t// this.\n\t\t//\n\t\tprotected virtual void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tthrow new NotImplementedException (\n\t\t\t\tString.Format (\n\t\t\t\t\t\"CloneTo not implemented for expression {0}\", this.GetType ()));\n\t\t}\n\n\t\t//\n\t\t// Clones an expression created by the parser.\n\t\t//\n\t\t// We only support expressions created by the parser so far, not\n\t\t// expressions that have been resolved (many more classes would need\n\t\t// to implement CloneTo).\n\t\t//\n\t\t// This infrastructure is here merely for Lambda expressions which\n\t\t// compile the same code using different type values for the same\n\t\t// arguments to find the correct overload\n\t\t//\n\t\tpublic virtual Expression Clone (CloneContext clonectx)\n\t\t{\n\t\t\tExpression cloned = (Expression) MemberwiseClone ();\n\t\t\tCloneTo (clonectx, cloned);\n\n\t\t\treturn cloned;\n\t\t}\n\n\t\t//\n\t\t// Implementation of expression to expression tree conversion\n\t\t//\n\t\tpublic abstract Expression CreateExpressionTree (ResolveContext ec);\n\n\t\tprotected Expression CreateExpressionFactoryCall (ResolveContext ec, string name, Arguments args)\n\t\t{\n\t\t\treturn CreateExpressionFactoryCall (ec, name, null, args, loc);\n\t\t}\n\n\t\tprotected Expression CreateExpressionFactoryCall (ResolveContext ec, string name, TypeArguments typeArguments, Arguments args)\n\t\t{\n\t\t\treturn CreateExpressionFactoryCall (ec, name, typeArguments, args, loc);\n\t\t}\n\n\t\tpublic static Expression CreateExpressionFactoryCall (ResolveContext ec, string name, TypeArguments typeArguments, Arguments args, Location loc)\n\t\t{\n\t\t\treturn new Invocation (new MemberAccess (CreateExpressionTypeExpression (ec, loc), name, typeArguments, loc), args);\n\t\t}\n\n\t\tprotected static TypeExpr CreateExpressionTypeExpression (ResolveContext ec, Location loc)\n\t\t{\n\t\t\tvar t = ec.Module.PredefinedTypes.Expression.Resolve ();\n\t\t\tif (t == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new TypeExpression (t, loc);\n\t\t}\n\n\t\t//\n\t\t// Implemented by all expressions which support conversion from\n\t\t// compiler expression to invokable runtime expression. Used by\n\t\t// dynamic C# binder.\n\t\t//\n\t\tpublic virtual SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\tthrow new NotImplementedException (\"MakeExpression for \" + GetType ());\n\t\t}\n\t\t\t\n\t\tpublic virtual object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   This is just a base class for expressions that can\n\t///   appear on statements (invocations, object creation,\n\t///   assignments, post/pre increment and decrement).  The idea\n\t///   being that they would support an extra Emition interface that\n\t///   does not leave a result on the stack.\n\t/// </summary>\n\tpublic abstract class ExpressionStatement : Expression\n\t{\n\t\tpublic virtual void MarkReachable (Reachability rc)\n\t\t{\n\t\t}\n\n\t\tpublic ExpressionStatement ResolveStatement (BlockContext ec)\n\t\t{\n\t\t\tExpression e = Resolve (ec);\n\t\t\tif (e == null)\n\t\t\t\treturn null;\n\n\t\t\tExpressionStatement es = e as ExpressionStatement;\n\t\t\tif (es == null || e is AnonymousMethodBody)\n\t\t\t\tError_InvalidExpressionStatement (ec);\n\n\t\t\t//\n\t\t\t// This is quite expensive warning, try to limit the damage\n\t\t\t//\n\t\t\tif (MemberAccess.IsValidDotExpression (e.Type) && !(e is Assign || e is Await)) {\n\t\t\t\tWarningAsyncWithoutWait (ec, e);\n\t\t\t}\n\n\t\t\treturn es;\n\t\t}\n\n\t\tstatic void WarningAsyncWithoutWait (BlockContext bc, Expression e)\n\t\t{\n\t\t\tif (bc.CurrentAnonymousMethod is AsyncInitializer) {\n\t\t\t\tvar awaiter = new AwaitStatement.AwaitableMemberAccess (e) {\n\t\t\t\t\tProbingMode = true\n\t\t\t\t};\n\n\t\t\t\t//\n\t\t\t\t// Need to do full resolve because GetAwaiter can be extension method\n\t\t\t\t// available only in this context\n\t\t\t\t//\n\t\t\t\tvar mg = awaiter.Resolve (bc) as MethodGroupExpr;\n\t\t\t\tif (mg == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar arguments = new Arguments (0);\n\t\t\t\tmg = mg.OverloadResolve (bc, ref arguments, null, OverloadResolver.Restrictions.ProbingOnly);\n\t\t\t\tif (mg == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t//\n\t\t\t\t// Use same check rules as for real await\n\t\t\t\t//\n\t\t\t\tvar awaiter_definition = bc.Module.GetAwaiter (mg.BestCandidateReturnType);\n\t\t\t\tif (!awaiter_definition.IsValidPattern || !awaiter_definition.INotifyCompletion)\n\t\t\t\t\treturn;\n\n\t\t\t\tbc.Report.Warning (4014, 1, e.Location,\n\t\t\t\t\t\"The statement is not awaited and execution of current method continues before the call is completed. Consider using `await' operator\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar inv = e as Invocation;\n\t\t\tif (inv != null && inv.MethodGroup != null && inv.MethodGroup.BestCandidate.IsAsync) {\n\t\t\t\t// The warning won't be reported for imported methods to maintain warning compatiblity with csc \n\t\t\t\tbc.Report.Warning (4014, 1, e.Location,\n\t\t\t\t\t\"The statement is not awaited and execution of current method continues before the call is completed. Consider using `await' operator or calling `Wait' method\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Requests the expression to be emitted in a `statement'\n\t\t///   context.  This means that no new value is left on the\n\t\t///   stack after invoking this method (constrasted with\n\t\t///   Emit that will always leave a value on the stack).\n\t\t/// </summary>\n\t\tpublic abstract void EmitStatement (EmitContext ec);\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tEmitStatement (ec);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   This kind of cast is used to encapsulate the child\n\t///   whose type is child.Type into an expression that is\n\t///   reported to return \"return_type\".  This is used to encapsulate\n\t///   expressions which have compatible types, but need to be dealt\n\t///   at higher levels with.\n\t///\n\t///   For example, a \"byte\" expression could be encapsulated in one\n\t///   of these as an \"unsigned int\".  The type for the expression\n\t///   would be \"unsigned int\".\n\t///\n\t/// </summary>\n\tpublic abstract class TypeCast : Expression\n\t{\n\t\tprotected readonly Expression child;\n\n\t\tprotected TypeCast (Expression child, TypeSpec return_type)\n\t\t{\n\t\t\teclass = child.eclass;\n\t\t\tloc = child.Location;\n\t\t\ttype = return_type;\n\t\t\tthis.child = child;\n\t\t}\n\n\t\tpublic Expression Child {\n\t\t\tget {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn child.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (child.CreateExpressionTree (ec)));\n\t\t\targs.Add (new Argument (new TypeOf (type, loc)));\n\n\t\t\tif (type.IsPointer || child.Type.IsPointer)\n\t\t\t\tError_PointerInsideExpressionTree (ec);\n\n\t\t\treturn CreateExpressionFactoryCall (ec, ec.HasSet (ResolveContext.Options.CheckedScope) ? \"ConvertChecked\" : \"Convert\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t// This should never be invoked, we are born in fully\n\t\t\t// initialized state.\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tchild.Emit (ec);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tchild.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn ctx.HasSet (BuilderContext.Options.CheckedScope) ?\n\t\t\t\tSLE.Expression.ConvertChecked (child.MakeExpression (ctx), type.GetMetaInfo ()) :\n\t\t\t\tSLE.Expression.Convert (child.MakeExpression (ctx), type.GetMetaInfo ());\n#endif\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\t// Nothing to clone\n\t\t}\n\n\t\tpublic override bool IsNull {\n\t\t\tget { return child.IsNull; }\n\t\t}\n\t}\n\n\tpublic class EmptyCast : TypeCast {\n\t\tEmptyCast (Expression child, TypeSpec target_type)\n\t\t\t: base (child, target_type)\n\t\t{\n\t\t}\n\n\t\tpublic static Expression Create (Expression child, TypeSpec type)\n\t\t{\n\t\t\tConstant c = child as Constant;\n\t\t\tif (c != null) {\n\t\t\t\tvar enum_constant = c as EnumConstant;\n\t\t\t\tif (enum_constant != null)\n\t\t\t\t\tc = enum_constant.Child;\n\n\t\t\t\tif (!(c is ReducedExpression.ReducedConstantExpression)) {\n\t\t\t\t\tif (c.Type == type)\n\t\t\t\t\t\treturn c;\n\n\t\t\t\t\tvar res = c.ConvertImplicitly (type);\n\t\t\t\t\tif (res != null)\n\t\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tEmptyCast e = child as EmptyCast;\n\t\t\tif (e != null)\n\t\t\t\treturn new EmptyCast (e.child, type);\n\n\t\t\treturn new EmptyCast (child, type);\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label label, bool on_true)\n\t\t{\n\t\t\tchild.EmitBranchable (ec, label, on_true);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tchild.EmitSideEffect (ec);\n\t\t}\n\t}\n\n\t//\n\t// Used for predefined type user operator (no obsolete check, etc.)\n\t//\n\tpublic class OperatorCast : TypeCast\n\t{\n\t\treadonly MethodSpec conversion_operator;\n\n\t\tpublic OperatorCast (Expression expr, TypeSpec target_type)\n\t\t\t: this (expr, target_type, target_type, false)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic OperatorCast (Expression expr, TypeSpec target_type, bool find_explicit)\n\t\t\t: this (expr, target_type, target_type, find_explicit)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic OperatorCast (Expression expr, TypeSpec declaringType, TypeSpec returnType, bool isExplicit)\n\t\t\t: base (expr, returnType)\n\t\t{\n\t\t\tvar op = isExplicit ? Operator.OpType.Explicit : Operator.OpType.Implicit;\n\t\t\tvar mi = MemberCache.GetUserOperator (declaringType, op, true);\n\n\t\t\tif (mi != null) {\n\t\t\t\tforeach (MethodSpec oper in mi) {\n\t\t\t\t\tif (oper.ReturnType != returnType)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (oper.Parameters.Types[0] == expr.Type) {\n\t\t\t\t\t\tconversion_operator = oper;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new InternalErrorException (\"Missing predefined user operator between `{0}' and `{1}'\",\n\t\t\t\treturnType.GetSignatureForError (), expr.Type.GetSignatureForError ());\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tchild.Emit (ec);\n\t\t\tec.Emit (OpCodes.Call, conversion_operator);\n\t\t}\n\t}\n\t\n\t//\n\t// Constant specialization of EmptyCast.\n\t// We need to special case this since an empty cast of\n\t// a constant is still a constant. \n\t//\n\tpublic class EmptyConstantCast : Constant\n\t{\n\t\tpublic readonly Constant child;\n\n\t\tpublic EmptyConstantCast (Constant child, TypeSpec type)\n\t\t\t: base (child.Location)\n\t\t{\n\t\t\tif (child == null)\n\t\t\t\tthrow new ArgumentNullException (\"child\");\n\n\t\t\tthis.child = child;\n\t\t\tthis.eclass = child.eclass;\n\t\t\tthis.type = type;\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tif (child.Type == target_type)\n\t\t\t\treturn child;\n\n\t\t\t// FIXME: check that 'type' can be converted to 'target_type' first\n\t\t\treturn child.ConvertExplicitly (in_checked_context, target_type);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = Arguments.CreateForExpressionTree (ec, null,\n\t\t\t\tchild.CreateExpressionTree (ec),\n\t\t\t\tnew TypeOf (type, loc));\n\n\t\t\tif (type.IsPointer)\n\t\t\t\tError_PointerInsideExpressionTree (ec);\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Convert\", args);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget { return child.IsDefaultValue; }\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget { return child.IsNegative; }\n\t\t}\n\n\t\tpublic override bool IsNull {\n\t\t\tget { return child.IsNull; }\n\t\t}\n\t\t\n\t\tpublic override bool IsOneInteger {\n\t\t\tget { return child.IsOneInteger; }\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn child.IsSideEffectFree;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return child.IsZeroInteger; }\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tchild.Emit (ec);\t\t\t\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label label, bool on_true)\n\t\t{\n\t\t\tchild.EmitBranchable (ec, label, on_true);\n\n\t\t\t// Only to make verifier happy\n\t\t\tif (TypeManager.IsGenericParameter (type) && child.IsNull)\n\t\t\t\tec.Emit (OpCodes.Unbox_Any, type);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tchild.EmitSideEffect (ec);\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn child.GetValue ();\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn child.GetValueAsLiteral ();\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn child.GetValueAsLong ();\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec target_type)\n\t\t{\n\t\t\tif (type == target_type)\n\t\t\t\treturn this;\n\n\t\t\t// FIXME: Do we need to check user conversions?\n\t\t\tif (!Convert.ImplicitStandardConversionExists (this, target_type))\n\t\t\t\treturn null;\n\n\t\t\treturn child.ConvertImplicitly (target_type);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///  This class is used to wrap literals which belong inside Enums\n\t/// </summary>\n\tpublic class EnumConstant : Constant\n\t{\n\t\tpublic Constant Child;\n\n\t\tpublic EnumConstant (Constant child, TypeSpec enum_type)\n\t\t\t: base (child.Location)\n\t\t{\n\t\t\tthis.Child = child;\n\n\t\t\tthis.eclass = ExprClass.Value;\n\t\t\tthis.type = enum_type;\n\t\t}\n\n\t\tprotected EnumConstant (Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tChild.Emit (ec);\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\tChild.EncodeAttributeValue (rc, enc, Child.Type, parameterType);\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label label, bool on_true)\n\t\t{\n\t\t\tChild.EmitBranchable (ec, label, on_true);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tChild.EmitSideEffect (ec);\n\t\t}\n\n\t\tpublic override string GetSignatureForError()\n\t\t{\n\t\t\treturn Type.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override object GetValue ()\n\t\t{\n\t\t\treturn Child.GetValue ();\n\t\t}\n\n#if !STATIC\n\t\tpublic override object GetTypedValue ()\n\t\t{\n\t\t\t//\n\t\t\t// The method can be used in dynamic context only (on closed types)\n\t\t\t//\n\t\t\t// System.Enum.ToObject cannot be called on dynamic types\n\t\t\t// EnumBuilder has to be used, but we cannot use EnumBuilder\n\t\t\t// because it does not properly support generics\n\t\t\t//\n\t\t\treturn System.Enum.ToObject (type.GetMetaInfo (), Child.GetValue ());\n\t\t}\n#endif\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn Child.GetValueAsLiteral ();\n\t\t}\n\n\t\tpublic override long GetValueAsLong ()\n\t\t{\n\t\t\treturn Child.GetValueAsLong ();\n\t\t}\n\n\t\tpublic EnumConstant Increment()\n\t\t{\n\t\t\treturn new EnumConstant (((IntegralConstant) Child).Increment (), type);\n\t\t}\n\n\t\tpublic override bool IsDefaultValue {\n\t\t\tget {\n\t\t\t\treturn Child.IsDefaultValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn Child.IsSideEffectFree;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsZeroInteger {\n\t\t\tget { return Child.IsZeroInteger; }\n\t\t}\n\n\t\tpublic override bool IsNegative {\n\t\t\tget {\n\t\t\t\treturn Child.IsNegative;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t{\n\t\t\tif (Child.Type == target_type)\n\t\t\t\treturn Child;\n\n\t\t\treturn Child.ConvertExplicitly (in_checked_context, target_type);\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec type)\n\t\t{\n\t\t\tif (this.type == type) {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (!Convert.ImplicitStandardConversionExists (this, type)){\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn Child.ConvertImplicitly (type);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   This kind of cast is used to encapsulate Value Types in objects.\n\t///\n\t///   The effect of it is to box the value type emitted by the previous\n\t///   operation.\n\t/// </summary>\n\tpublic class BoxedCast : TypeCast {\n\n\t\tpublic BoxedCast (Expression expr, TypeSpec target_type)\n\t\t\t: base (expr, target_type)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t// This should never be invoked, we are born in fully\n\t\t\t// initialized state.\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\t// Only boxing to object type is supported\n\t\t\tif (targetType.BuiltinType != BuiltinTypeSpec.Type.Object) {\n\t\t\t\tbase.EncodeAttributeValue (rc, enc, targetType, parameterType);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tenc.Encode (child.Type);\n\t\t\tchild.EncodeAttributeValue (rc, enc, child.Type, parameterType);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\t\t\t\n\t\t\tec.Emit (OpCodes.Box, child.Type);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\t// boxing is side-effectful, since it involves runtime checks, except when boxing to Object or ValueType\n\t\t\t// so, we need to emit the box+pop instructions in most cases\n\t\t\tif (child.Type.IsStruct &&\n\t\t\t    (type.BuiltinType == BuiltinTypeSpec.Type.Object || type.BuiltinType == BuiltinTypeSpec.Type.ValueType))\n\t\t\t\tchild.EmitSideEffect (ec);\n\t\t\telse\n\t\t\t\tbase.EmitSideEffect (ec);\n\t\t}\n\t}\n\n\tpublic class UnboxCast : TypeCast {\n\t\tpublic UnboxCast (Expression expr, TypeSpec return_type)\n\t\t\t: base (expr, return_type)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t// This should never be invoked, we are born in fully\n\t\t\t// initialized state.\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\n\t\t\tec.Emit (OpCodes.Unbox_Any, type);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t///   This is used to perform explicit numeric conversions.\n\t///\n\t///   Explicit numeric conversions might trigger exceptions in a checked\n\t///   context, so they should generate the conv.ovf opcodes instead of\n\t///   conv opcodes.\n\t/// </summary>\n\tpublic class ConvCast : TypeCast {\n\t\tpublic enum Mode : byte {\n\t\t\tI1_U1, I1_U2, I1_U4, I1_U8, I1_CH,\n\t\t\tU1_I1, U1_CH,\n\t\t\tI2_I1, I2_U1, I2_U2, I2_U4, I2_U8, I2_CH,\n\t\t\tU2_I1, U2_U1, U2_I2, U2_CH,\n\t\t\tI4_I1, I4_U1, I4_I2, I4_U2, I4_U4, I4_U8, I4_CH,\n\t\t\tU4_I1, U4_U1, U4_I2, U4_U2, U4_I4, U4_CH,\n\t\t\tI8_I1, I8_U1, I8_I2, I8_U2, I8_I4, I8_U4, I8_U8, I8_CH, I8_I,\n\t\t\tU8_I1, U8_U1, U8_I2, U8_U2, U8_I4, U8_U4, U8_I8, U8_CH, U8_I,\n\t\t\tCH_I1, CH_U1, CH_I2,\n\t\t\tR4_I1, R4_U1, R4_I2, R4_U2, R4_I4, R4_U4, R4_I8, R4_U8, R4_CH,\n\t\t\tR8_I1, R8_U1, R8_I2, R8_U2, R8_I4, R8_U4, R8_I8, R8_U8, R8_CH, R8_R4,\n\t\t\tI_I8,\n\t\t}\n\n\t\tMode mode;\n\t\t\n\t\tpublic ConvCast (Expression child, TypeSpec return_type, Mode m)\n\t\t\t: base (child, return_type)\n\t\t{\n\t\t\tmode = m;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t// This should never be invoked, we are born in fully\n\t\t\t// initialized state.\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"ConvCast ({0}, {1})\", mode, child);\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\t\t\tEmit (ec, mode);\n\t\t}\n\n\t\tpublic static void Emit (EmitContext ec, Mode mode)\n\t\t{\n\t\t\tif (ec.HasSet (EmitContext.Options.CheckedScope)) {\n\t\t\t\tswitch (mode){\n\t\t\t\tcase Mode.I1_U1: ec.Emit (OpCodes.Conv_Ovf_U1); break;\n\t\t\t\tcase Mode.I1_U2: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.I1_U4: ec.Emit (OpCodes.Conv_Ovf_U4); break;\n\t\t\t\tcase Mode.I1_U8: ec.Emit (OpCodes.Conv_Ovf_U8); break;\n\t\t\t\tcase Mode.I1_CH: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\n\t\t\t\tcase Mode.U1_I1: ec.Emit (OpCodes.Conv_Ovf_I1_Un); break;\n\t\t\t\tcase Mode.U1_CH: /* nothing */ break;\n\n\t\t\t\tcase Mode.I2_I1: ec.Emit (OpCodes.Conv_Ovf_I1); break;\n\t\t\t\tcase Mode.I2_U1: ec.Emit (OpCodes.Conv_Ovf_U1); break;\n\t\t\t\tcase Mode.I2_U2: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.I2_U4: ec.Emit (OpCodes.Conv_Ovf_U4); break;\n\t\t\t\tcase Mode.I2_U8: ec.Emit (OpCodes.Conv_Ovf_U8); break;\n\t\t\t\tcase Mode.I2_CH: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\n\t\t\t\tcase Mode.U2_I1: ec.Emit (OpCodes.Conv_Ovf_I1_Un); break;\n\t\t\t\tcase Mode.U2_U1: ec.Emit (OpCodes.Conv_Ovf_U1_Un); break;\n\t\t\t\tcase Mode.U2_I2: ec.Emit (OpCodes.Conv_Ovf_I2_Un); break;\n\t\t\t\tcase Mode.U2_CH: /* nothing */ break;\n\n\t\t\t\tcase Mode.I4_I1: ec.Emit (OpCodes.Conv_Ovf_I1); break;\n\t\t\t\tcase Mode.I4_U1: ec.Emit (OpCodes.Conv_Ovf_U1); break;\n\t\t\t\tcase Mode.I4_I2: ec.Emit (OpCodes.Conv_Ovf_I2); break;\n\t\t\t\tcase Mode.I4_U4: ec.Emit (OpCodes.Conv_Ovf_U4); break;\n\t\t\t\tcase Mode.I4_U2: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.I4_U8: ec.Emit (OpCodes.Conv_Ovf_U8); break;\n\t\t\t\tcase Mode.I4_CH: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\n\t\t\t\tcase Mode.U4_I1: ec.Emit (OpCodes.Conv_Ovf_I1_Un); break;\n\t\t\t\tcase Mode.U4_U1: ec.Emit (OpCodes.Conv_Ovf_U1_Un); break;\n\t\t\t\tcase Mode.U4_I2: ec.Emit (OpCodes.Conv_Ovf_I2_Un); break;\n\t\t\t\tcase Mode.U4_U2: ec.Emit (OpCodes.Conv_Ovf_U2_Un); break;\n\t\t\t\tcase Mode.U4_I4: ec.Emit (OpCodes.Conv_Ovf_I4_Un); break;\n\t\t\t\tcase Mode.U4_CH: ec.Emit (OpCodes.Conv_Ovf_U2_Un); break;\n\n\t\t\t\tcase Mode.I8_I1: ec.Emit (OpCodes.Conv_Ovf_I1); break;\n\t\t\t\tcase Mode.I8_U1: ec.Emit (OpCodes.Conv_Ovf_U1); break;\n\t\t\t\tcase Mode.I8_I2: ec.Emit (OpCodes.Conv_Ovf_I2); break;\n\t\t\t\tcase Mode.I8_U2: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.I8_I4: ec.Emit (OpCodes.Conv_Ovf_I4); break;\n\t\t\t\tcase Mode.I8_U4: ec.Emit (OpCodes.Conv_Ovf_U4); break;\n\t\t\t\tcase Mode.I8_U8: ec.Emit (OpCodes.Conv_Ovf_U8); break;\n\t\t\t\tcase Mode.I8_CH: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.I8_I: ec.Emit (OpCodes.Conv_Ovf_U); break;\n\n\t\t\t\tcase Mode.U8_I1: ec.Emit (OpCodes.Conv_Ovf_I1_Un); break;\n\t\t\t\tcase Mode.U8_U1: ec.Emit (OpCodes.Conv_Ovf_U1_Un); break;\n\t\t\t\tcase Mode.U8_I2: ec.Emit (OpCodes.Conv_Ovf_I2_Un); break;\n\t\t\t\tcase Mode.U8_U2: ec.Emit (OpCodes.Conv_Ovf_U2_Un); break;\n\t\t\t\tcase Mode.U8_I4: ec.Emit (OpCodes.Conv_Ovf_I4_Un); break;\n\t\t\t\tcase Mode.U8_U4: ec.Emit (OpCodes.Conv_Ovf_U4_Un); break;\n\t\t\t\tcase Mode.U8_I8: ec.Emit (OpCodes.Conv_Ovf_I8_Un); break;\n\t\t\t\tcase Mode.U8_CH: ec.Emit (OpCodes.Conv_Ovf_U2_Un); break;\n\t\t\t\tcase Mode.U8_I: ec.Emit (OpCodes.Conv_Ovf_U_Un); break;\n\n\t\t\t\tcase Mode.CH_I1: ec.Emit (OpCodes.Conv_Ovf_I1_Un); break;\n\t\t\t\tcase Mode.CH_U1: ec.Emit (OpCodes.Conv_Ovf_U1_Un); break;\n\t\t\t\tcase Mode.CH_I2: ec.Emit (OpCodes.Conv_Ovf_I2_Un); break;\n\n\t\t\t\tcase Mode.R4_I1: ec.Emit (OpCodes.Conv_Ovf_I1); break;\n\t\t\t\tcase Mode.R4_U1: ec.Emit (OpCodes.Conv_Ovf_U1); break;\n\t\t\t\tcase Mode.R4_I2: ec.Emit (OpCodes.Conv_Ovf_I2); break;\n\t\t\t\tcase Mode.R4_U2: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.R4_I4: ec.Emit (OpCodes.Conv_Ovf_I4); break;\n\t\t\t\tcase Mode.R4_U4: ec.Emit (OpCodes.Conv_Ovf_U4); break;\n\t\t\t\tcase Mode.R4_I8: ec.Emit (OpCodes.Conv_Ovf_I8); break;\n\t\t\t\tcase Mode.R4_U8: ec.Emit (OpCodes.Conv_Ovf_U8); break;\n\t\t\t\tcase Mode.R4_CH: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\n\t\t\t\tcase Mode.R8_I1: ec.Emit (OpCodes.Conv_Ovf_I1); break;\n\t\t\t\tcase Mode.R8_U1: ec.Emit (OpCodes.Conv_Ovf_U1); break;\n\t\t\t\tcase Mode.R8_I2: ec.Emit (OpCodes.Conv_Ovf_I2); break;\n\t\t\t\tcase Mode.R8_U2: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.R8_I4: ec.Emit (OpCodes.Conv_Ovf_I4); break;\n\t\t\t\tcase Mode.R8_U4: ec.Emit (OpCodes.Conv_Ovf_U4); break;\n\t\t\t\tcase Mode.R8_I8: ec.Emit (OpCodes.Conv_Ovf_I8); break;\n\t\t\t\tcase Mode.R8_U8: ec.Emit (OpCodes.Conv_Ovf_U8); break;\n\t\t\t\tcase Mode.R8_CH: ec.Emit (OpCodes.Conv_Ovf_U2); break;\n\t\t\t\tcase Mode.R8_R4: ec.Emit (OpCodes.Conv_R4); break;\n\n\t\t\t\tcase Mode.I_I8: ec.Emit (OpCodes.Conv_Ovf_I8_Un); break;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (mode){\n\t\t\t\tcase Mode.I1_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.I1_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.I1_U4: ec.Emit (OpCodes.Conv_U4); break;\n\t\t\t\tcase Mode.I1_U8: ec.Emit (OpCodes.Conv_I8); break;\n\t\t\t\tcase Mode.I1_CH: ec.Emit (OpCodes.Conv_U2); break;\n\n\t\t\t\tcase Mode.U1_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.U1_CH: ec.Emit (OpCodes.Conv_U2); break;\n\n\t\t\t\tcase Mode.I2_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.I2_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.I2_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.I2_U4: ec.Emit (OpCodes.Conv_U4); break;\n\t\t\t\tcase Mode.I2_U8: ec.Emit (OpCodes.Conv_I8); break;\n\t\t\t\tcase Mode.I2_CH: ec.Emit (OpCodes.Conv_U2); break;\n\n\t\t\t\tcase Mode.U2_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.U2_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.U2_I2: ec.Emit (OpCodes.Conv_I2); break;\n\t\t\t\tcase Mode.U2_CH: /* nothing */ break;\n\n\t\t\t\tcase Mode.I4_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.I4_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.I4_I2: ec.Emit (OpCodes.Conv_I2); break;\n\t\t\t\tcase Mode.I4_U4: /* nothing */ break;\n\t\t\t\tcase Mode.I4_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.I4_U8: ec.Emit (OpCodes.Conv_I8); break;\n\t\t\t\tcase Mode.I4_CH: ec.Emit (OpCodes.Conv_U2); break;\n\n\t\t\t\tcase Mode.U4_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.U4_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.U4_I2: ec.Emit (OpCodes.Conv_I2); break;\n\t\t\t\tcase Mode.U4_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.U4_I4: /* nothing */ break;\n\t\t\t\tcase Mode.U4_CH: ec.Emit (OpCodes.Conv_U2); break;\n\n\t\t\t\tcase Mode.I8_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.I8_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.I8_I2: ec.Emit (OpCodes.Conv_I2); break;\n\t\t\t\tcase Mode.I8_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.I8_I4: ec.Emit (OpCodes.Conv_I4); break;\n\t\t\t\tcase Mode.I8_U4: ec.Emit (OpCodes.Conv_U4); break;\n\t\t\t\tcase Mode.I8_U8: /* nothing */ break;\n\t\t\t\tcase Mode.I8_CH: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.I8_I: ec.Emit (OpCodes.Conv_U); break;\n\n\t\t\t\tcase Mode.U8_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.U8_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.U8_I2: ec.Emit (OpCodes.Conv_I2); break;\n\t\t\t\tcase Mode.U8_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.U8_I4: ec.Emit (OpCodes.Conv_I4); break;\n\t\t\t\tcase Mode.U8_U4: ec.Emit (OpCodes.Conv_U4); break;\n\t\t\t\tcase Mode.U8_I8: /* nothing */ break;\n\t\t\t\tcase Mode.U8_CH: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.U8_I: ec.Emit (OpCodes.Conv_U); break;\n\n\t\t\t\tcase Mode.CH_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.CH_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.CH_I2: ec.Emit (OpCodes.Conv_I2); break;\n\n\t\t\t\tcase Mode.R4_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.R4_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.R4_I2: ec.Emit (OpCodes.Conv_I2); break;\n\t\t\t\tcase Mode.R4_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.R4_I4: ec.Emit (OpCodes.Conv_I4); break;\n\t\t\t\tcase Mode.R4_U4: ec.Emit (OpCodes.Conv_U4); break;\n\t\t\t\tcase Mode.R4_I8: ec.Emit (OpCodes.Conv_I8); break;\n\t\t\t\tcase Mode.R4_U8: ec.Emit (OpCodes.Conv_U8); break;\n\t\t\t\tcase Mode.R4_CH: ec.Emit (OpCodes.Conv_U2); break;\n\n\t\t\t\tcase Mode.R8_I1: ec.Emit (OpCodes.Conv_I1); break;\n\t\t\t\tcase Mode.R8_U1: ec.Emit (OpCodes.Conv_U1); break;\n\t\t\t\tcase Mode.R8_I2: ec.Emit (OpCodes.Conv_I2); break;\n\t\t\t\tcase Mode.R8_U2: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.R8_I4: ec.Emit (OpCodes.Conv_I4); break;\n\t\t\t\tcase Mode.R8_U4: ec.Emit (OpCodes.Conv_U4); break;\n\t\t\t\tcase Mode.R8_I8: ec.Emit (OpCodes.Conv_I8); break;\n\t\t\t\tcase Mode.R8_U8: ec.Emit (OpCodes.Conv_U8); break;\n\t\t\t\tcase Mode.R8_CH: ec.Emit (OpCodes.Conv_U2); break;\n\t\t\t\tcase Mode.R8_R4: ec.Emit (OpCodes.Conv_R4); break;\n\n\t\t\t\tcase Mode.I_I8: ec.Emit (OpCodes.Conv_U8); break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tclass OpcodeCast : TypeCast\n\t{\n\t\treadonly OpCode op;\n\t\t\n\t\tpublic OpcodeCast (Expression child, TypeSpec return_type, OpCode op)\n\t\t\t: base (child, return_type)\n\t\t{\n\t\t\tthis.op = op;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t// This should never be invoked, we are born in fully\n\t\t\t// initialized state.\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\t\t\tec.Emit (op);\n\t\t}\n\n\t\tpublic TypeSpec UnderlyingType {\n\t\t\tget { return child.Type; }\n\t\t}\n\t}\n\n\t//\n\t// Opcode casts expression with 2 opcodes but only\n\t// single expression tree node\n\t//\n\tclass OpcodeCastDuplex : OpcodeCast\n\t{\n\t\treadonly OpCode second;\n\n\t\tpublic OpcodeCastDuplex (Expression child, TypeSpec returnType, OpCode first, OpCode second)\n\t\t\t: base (child, returnType, first)\n\t\t{\n\t\t\tthis.second = second;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\t\t\tec.Emit (second);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   This kind of cast is used to encapsulate a child and cast it\n\t///   to the class requested\n\t/// </summary>\n\tpublic sealed class ClassCast : TypeCast {\n\t\treadonly bool forced;\n\t\t\n\t\tpublic ClassCast (Expression child, TypeSpec return_type)\n\t\t\t: base (child, return_type)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ClassCast (Expression child, TypeSpec return_type, bool forced)\n\t\t\t: base (child, return_type)\n\t\t{\n\t\t\tthis.forced = forced;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\n\t\t\tbool gen = TypeManager.IsGenericParameter (child.Type);\n\t\t\tif (gen)\n\t\t\t\tec.Emit (OpCodes.Box, child.Type);\n\t\t\t\n\t\t\tif (type.IsGenericParameter) {\n\t\t\t\tec.Emit (OpCodes.Unbox_Any, type);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (gen && !forced)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tec.Emit (OpCodes.Castclass, type);\n\t\t}\n\t}\n\n\t//\n\t// Created during resolving pahse when an expression is wrapped or constantified\n\t// and original expression can be used later (e.g. for expression trees)\n\t//\n\tpublic class ReducedExpression : Expression\n\t{\n\t\tpublic sealed class ReducedConstantExpression : EmptyConstantCast\n\t\t{\n\t\t\treadonly Expression orig_expr;\n\n\t\t\tpublic ReducedConstantExpression (Constant expr, Expression orig_expr)\n\t\t\t\t: base (expr, expr.Type)\n\t\t\t{\n\t\t\t\tthis.orig_expr = orig_expr;\n\t\t\t}\n\n\t\t\tpublic Expression OriginalExpression {\n\t\t\t\tget {\n\t\t\t\t\treturn orig_expr;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override Constant ConvertImplicitly (TypeSpec target_type)\n\t\t\t{\n\t\t\t\tConstant c = base.ConvertImplicitly (target_type);\n\t\t\t\tif (c != null)\n\t\t\t\t\tc = new ReducedConstantExpression (c, orig_expr);\n\n\t\t\t\treturn c;\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\treturn orig_expr.CreateExpressionTree (ec);\n\t\t\t}\n\n\t\t\tpublic override Constant ConvertExplicitly (bool in_checked_context, TypeSpec target_type)\n\t\t\t{\n\t\t\t\tConstant c = base.ConvertExplicitly (in_checked_context, target_type);\n\t\t\t\tif (c != null)\n\t\t\t\t\tc = new ReducedConstantExpression (c, orig_expr);\n\t\t\t\treturn c;\n\t\t\t}\n\n\t\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: Reduced conditional expression is allowed as an attribute argument\n\t\t\t\t//\n\t\t\t\tif (orig_expr is Conditional)\n\t\t\t\t\tchild.EncodeAttributeValue (rc, enc, targetType,parameterType);\n\t\t\t\telse\n\t\t\t\t\tbase.EncodeAttributeValue (rc, enc, targetType, parameterType);\n\t\t\t}\n\t\t}\n\n\t\tsealed class ReducedExpressionStatement : ExpressionStatement\n\t\t{\n\t\t\treadonly Expression orig_expr;\n\t\t\treadonly ExpressionStatement stm;\n\n\t\t\tpublic ReducedExpressionStatement (ExpressionStatement stm, Expression orig)\n\t\t\t{\n\t\t\t\tthis.orig_expr = orig;\n\t\t\t\tthis.stm = stm;\n\t\t\t\tthis.eclass = stm.eclass;\n\t\t\t\tthis.type = stm.Type;\n\n\t\t\t\tthis.loc = orig.Location;\n\t\t\t}\n\n\t\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t\t{\n\t\t\t\treturn stm.ContainsEmitWithAwait ();\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\treturn orig_expr.CreateExpressionTree (ec);\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tstm.Emit (ec);\n\t\t\t}\n\n\t\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t\t{\n\t\t\t\tstm.EmitStatement (ec);\n\t\t\t}\n\n\t\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\tstm.FlowAnalysis (fc);\n\t\t\t}\n\t\t}\n\n\t\treadonly Expression expr, orig_expr;\n\n\t\tprivate ReducedExpression (Expression expr, Expression orig_expr)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.eclass = expr.eclass;\n\t\t\tthis.type = expr.Type;\n\t\t\tthis.orig_expr = orig_expr;\n\t\t\tthis.loc = orig_expr.Location;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn expr.IsSideEffectFree;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression OriginalExpression {\n\t\t\tget {\n\t\t\t\treturn orig_expr;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\t//\n\t\t// Creates fully resolved expression switcher\n\t\t//\n\t\tpublic static Constant Create (Constant expr, Expression original_expr)\n\t\t{\n\t\t\tif (expr.eclass == ExprClass.Unresolved)\n\t\t\t\tthrow new ArgumentException (\"Unresolved expression\");\n\n\t\t\treturn new ReducedConstantExpression (expr, original_expr);\n\t\t}\n\n\t\tpublic static ExpressionStatement Create (ExpressionStatement s, Expression orig)\n\t\t{\n\t\t\treturn new ReducedExpressionStatement (s, orig);\n\t\t}\n\n\t\tpublic static Expression Create (Expression expr, Expression original_expr)\n\t\t{\n\t\t\treturn Create (expr, original_expr, true);\n\t\t}\n\n\t\t//\n\t\t// Creates unresolved reduce expression. The original expression has to be\n\t\t// already resolved. Created expression is constant based based on `expr'\n\t\t// value unless canBeConstant is used\n\t\t//\n\t\tpublic static Expression Create (Expression expr, Expression original_expr, bool canBeConstant)\n\t\t{\n\t\t\tif (canBeConstant) {\n\t\t\t\tConstant c = expr as Constant;\n\t\t\t\tif (c != null)\n\t\t\t\t\treturn Create (c, original_expr);\n\t\t\t}\n\n\t\t\tExpressionStatement s = expr as ExpressionStatement;\n\t\t\tif (s != null)\n\t\t\t\treturn Create (s, original_expr);\n\n\t\t\tif (expr.eclass == ExprClass.Unresolved)\n\t\t\t\tthrow new ArgumentException (\"Unresolved expression\");\n\n\t\t\treturn new ReducedExpression (expr, original_expr);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn orig_expr.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\texpr.Emit (ec);\n\t\t}\n\n\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t{\n \t\t\treturn expr.EmitToField(ec);\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t\texpr.EmitBranchable (ec, target, on_true);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn orig_expr.MakeExpression (ctx);\n\t\t}\n\t}\n\n\t//\n\t// Standard composite pattern\n\t//\n\tpublic abstract class CompositeExpression : Expression\n\t{\n\t\tprotected Expression expr;\n\n\t\tprotected CompositeExpression (Expression expr)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.loc = expr.Location;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext rc)\n\t\t{\n\t\t\treturn expr.CreateExpressionTree (rc);\n\t\t}\n\n\t\tpublic Expression Child {\n\t\t\tget { return expr; }\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\texpr = expr.Resolve (rc);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\ttype = expr.Type;\n\t\t\teclass = expr.eclass;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\texpr.Emit (ec);\n\t\t}\n\n\t\tpublic override bool IsNull {\n\t\t\tget { return expr.IsNull; }\n\t\t}\n\t}\n\n\t//\n\t// Base of expressions used only to narrow resolve flow\n\t//\n\tpublic abstract class ShimExpression : Expression\n\t{\n\t\tprotected Expression expr;\n\n\t\tprotected ShimExpression (Expression expr)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tif (expr == null)\n\t\t\t\treturn;\n\n\t\t\tShimExpression target = (ShimExpression) t;\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new InternalErrorException (\"Missing Resolve call\");\n\t\t}\n\t}\n\n\tpublic class UnreachableExpression : Expression\n\t{\n\t\tpublic UnreachableExpression (Expression expr)\n\t\t{\n\t\t\tthis.loc = expr.Location;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\t// TODO: is it ok\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tfc.Report.Warning (429, 4, loc, \"Unreachable expression code detected\");\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t}\n\t}\n\n\t//\n\t// Unresolved type name expressions\n\t//\n\tpublic abstract class ATypeNameExpression : FullNamedExpression\n\t{\n\t\tstring name;\n\t\tprotected TypeArguments targs;\n\n\t\tprotected ATypeNameExpression (string name, Location l)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tloc = l;\n\t\t}\n\n\t\tprotected ATypeNameExpression (string name, TypeArguments targs, Location l)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tthis.targs = targs;\n\t\t\tloc = l;\n\t\t}\n\n\t\tprotected ATypeNameExpression (string name, int arity, Location l)\n\t\t\t: this (name, new UnboundTypeArguments (arity), l)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tprotected int Arity {\n\t\t\tget {\n\t\t\t\treturn targs == null ? 0 : targs.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasTypeArguments {\n\t\t\tget {\n\t\t\t\treturn targs != null && !targs.IsEmpty;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tname = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeArguments TypeArguments {\n\t\t\tget {\n\t\t\t\treturn targs;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tATypeNameExpression atne = obj as ATypeNameExpression;\n\t\t\treturn atne != null && atne.Name == Name &&\n\t\t\t\t(targs == null || targs.Equals (atne.targs));\n\t\t}\n\n\t\tprotected void Error_OpenGenericTypeIsNotAllowed (IMemberContext mc)\n\t\t{\n\t\t\tmc.Module.Compiler.Report.Error (7003, Location, \"Unbound generic name is not valid in this context\");\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn Name.GetHashCode ();\n\t\t}\n\n\t\t// TODO: Move it to MemberCore\n\t\tpublic static string GetMemberType (MemberCore mc)\n\t\t{\n\t\t\tif (mc is Property)\n\t\t\t\treturn \"property\";\n\t\t\tif (mc is Indexer)\n\t\t\t\treturn \"indexer\";\n\t\t\tif (mc is FieldBase)\n\t\t\t\treturn \"field\";\n\t\t\tif (mc is MethodCore)\n\t\t\t\treturn \"method\";\n\t\t\tif (mc is EnumMember)\n\t\t\t\treturn \"enum\";\n\t\t\tif (mc is Event)\n\t\t\t\treturn \"event\";\n\n\t\t\treturn \"type\";\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tif (targs != null) {\n\t\t\t\treturn Name + \"<\" + targs.GetSignatureForError () + \">\";\n\t\t\t}\n\n\t\t\treturn Name;\n\t\t}\n\n\t\tpublic abstract Expression LookupNameExpression (ResolveContext rc, MemberLookupRestrictions restriction);\n\t}\n\t\n\t/// <summary>\n\t///   SimpleName expressions are formed of a single word and only happen at the beginning \n\t///   of a dotted-name.\n\t/// </summary>\n\tpublic class SimpleName : ATypeNameExpression\n\t{\n\t\tpublic SimpleName (string name, Location l)\n\t\t\t: base (name, l)\n\t\t{\n\t\t}\n\n\t\tpublic SimpleName (string name, TypeArguments args, Location l)\n\t\t\t: base (name, args, l)\n\t\t{\n\t\t}\n\n\t\tpublic SimpleName (string name, int arity, Location l)\n\t\t\t: base (name, arity, l)\n\t\t{\n\t\t}\n\n\t\tpublic SimpleName GetMethodGroup ()\n\t\t{\n\t\t\treturn new SimpleName (Name, targs, loc);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\treturn SimpleNameResolve (rc, null);\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\treturn SimpleNameResolve (ec, right_side);\n\t\t}\n\n\t\tpublic void Error_NameDoesNotExist (ResolveContext rc)\n\t\t{\n\t\t\trc.Report.Error (103, loc, \"The name `{0}' does not exist in the current context\", Name);\n\t\t}\n\n\t\tprotected virtual void Error_TypeOrNamespaceNotFound (IMemberContext ctx)\n\t\t{\n\t\t\tif (ctx.CurrentType != null) {\n\t\t\t\tvar member = MemberLookup (ctx, false, ctx.CurrentType, Name, 0, MemberLookupRestrictions.ExactArity, loc) as MemberExpr;\n\t\t\t\tif (member != null) {\n\t\t\t\t\tError_UnexpectedKind (ctx, member, \"type\", member.KindName, loc);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar report = ctx.Module.Compiler.Report;\n\n\t\t\tvar retval = ctx.LookupNamespaceOrType (Name, Arity, LookupMode.IgnoreAccessibility, loc);\n\t\t\tif (retval != null) {\n\t\t\t\treport.SymbolRelatedToPreviousError (retval.Type);\n\t\t\t\tErrorIsInaccesible (ctx, retval.GetSignatureForError (), loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tretval = ctx.LookupNamespaceOrType (Name, -System.Math.Max (1, Arity), LookupMode.Probing, loc);\n\t\t\tif (retval != null) {\n\t\t\t\tError_TypeArgumentsCannotBeUsed (ctx, retval.Type, loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar ns_candidates = ctx.Module.GlobalRootNamespace.FindTypeNamespaces (ctx, Name, Arity);\n\t\t\tif (ns_candidates != null) {\n\t\t\t\tif (ctx is UsingAliasNamespace.AliasContext) {\n\t\t\t\t\treport.Error (246, loc,\n\t\t\t\t\t\t\"The type or namespace name `{1}' could not be found. Consider using fully qualified name `{0}.{1}'\",\n\t\t\t\t\t\tns_candidates[0], Name);\n\t\t\t\t} else {\n\t\t\t\t\tstring usings = string.Join (\"' or `\", ns_candidates.ToArray ());\n\t\t\t\t\treport.Error (246, loc,\n\t\t\t\t\t\t\"The type or namespace name `{0}' could not be found. Are you missing `{1}' using directive?\",\n\t\t\t\t\t\tName, usings);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treport.Error (246, loc,\n\t\t\t\t\t\"The type or namespace name `{0}' could not be found. Are you missing an assembly reference?\",\n\t\t\t\t\tName);\n\t\t\t}\n\t\t}\n\n\t\tpublic override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\tFullNamedExpression fne = mc.LookupNamespaceOrType (Name, Arity, LookupMode.Normal, loc);\n\n\t\t\tif (fne != null) {\n\t\t\t\tif (fne.Type != null && Arity > 0) {\n\t\t\t\t\tif (HasTypeArguments) {\n\t\t\t\t\t\tGenericTypeExpr ct = new GenericTypeExpr (fne.Type, targs, loc);\n\t\t\t\t\t\tif (ct.ResolveAsType (mc) == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\treturn ct;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!allowUnboundTypeArguments)\n\t\t\t\t\t\tError_OpenGenericTypeIsNotAllowed (mc);\n\n\t\t\t\t\treturn new GenericOpenTypeExpr (fne.Type, loc);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// dynamic namespace is ignored when dynamic is allowed (does not apply to types)\n\t\t\t\t//\n\t\t\t\tif (!(fne is NamespaceExpression))\n\t\t\t\t\treturn fne;\n\t\t\t}\n\n\t\t\tif (Arity == 0 && Name == \"dynamic\" && mc.Module.Compiler.Settings.Version > LanguageVersion.V_3) {\n\t\t\t\tif (!mc.Module.PredefinedAttributes.Dynamic.IsDefined) {\n\t\t\t\t\tmc.Module.Compiler.Report.Error (1980, Location,\n\t\t\t\t\t\t\"Dynamic keyword requires `{0}' to be defined. Are you missing System.Core.dll assembly reference?\",\n\t\t\t\t\t\tmc.Module.PredefinedAttributes.Dynamic.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tfne = new DynamicTypeExpr (loc);\n\t\t\t\tfne.ResolveAsType (mc);\n\t\t\t}\n\n\t\t\tif (fne != null)\n\t\t\t\treturn fne;\n\n\t\t\tError_TypeOrNamespaceNotFound (mc);\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic bool IsPossibleTypeOrNamespace (IMemberContext mc)\n\t\t{\n\t\t\treturn mc.LookupNamespaceOrType (Name, Arity, LookupMode.Probing, loc) != null;\n\t\t}\n\n\t\tpublic override Expression LookupNameExpression (ResolveContext rc, MemberLookupRestrictions restrictions)\n\t\t{\n\t\t\tint lookup_arity = Arity;\n\t\t\tbool errorMode = false;\n\t\t\tExpression e;\n\t\t\tBlock current_block = rc.CurrentBlock;\n\t\t\tINamedBlockVariable variable = null;\n\t\t\tbool variable_found = false;\n\n\t\t\twhile (true) {\n\t\t\t\t//\n\t\t\t\t// Stage 1: binding to local variables or parameters\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: It should take invocableOnly into account but that would break csc compatibility\n\t\t\t\t//\n\t\t\t\tif (current_block != null && lookup_arity == 0) {\n\t\t\t\t\tif (current_block.ParametersBlock.TopBlock.GetLocalName (Name, current_block.Original, ref variable)) {\n\t\t\t\t\t\tif (!variable.IsDeclared) {\n\t\t\t\t\t\t\t// We found local name in accessible block but it's not\n\t\t\t\t\t\t\t// initialized yet, maybe the user wanted to bind to something else\n\t\t\t\t\t\t\terrorMode = true;\n\t\t\t\t\t\t\tvariable_found = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\te = variable.CreateReferenceExpression (rc, loc);\n\t\t\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\t\t\tif (Arity > 0)\n\t\t\t\t\t\t\t\t\tError_TypeArgumentsCannotBeUsed (rc, \"variable\", Name, loc);\n\n\t\t\t\t\t\t\t\treturn e;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Stage 2: Lookup members if we are inside a type up to top level type for nested types\n\t\t\t\t//\n\t\t\t\tTypeSpec member_type = rc.CurrentType;\n\t\t\t\tfor (; member_type != null; member_type = member_type.DeclaringType) {\n\t\t\t\t\te = MemberLookup (rc, errorMode, member_type, Name, lookup_arity, restrictions, loc);\n\t\t\t\t\tif (e == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar me = e as MemberExpr;\n\t\t\t\t\tif (me == null) {\n\t\t\t\t\t\t// The name matches a type, defer to ResolveAsTypeStep\n\t\t\t\t\t\tif (e is TypeExpr)\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (errorMode) {\n\t\t\t\t\t\tif (variable != null) {\n\t\t\t\t\t\t\tif (me is FieldExpr || me is ConstantExpr || me is EventExpr || me is PropertyExpr) {\n\t\t\t\t\t\t\t\trc.Report.Error (844, loc,\n\t\t\t\t\t\t\t\t\t\"A local variable `{0}' cannot be used before it is declared. Consider renaming the local variable when it hides the member `{1}'\",\n\t\t\t\t\t\t\t\t\tName, me.GetSignatureForError ());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (me is MethodGroupExpr || me is PropertyExpr || me is IndexerExpr) {\n\t\t\t\t\t\t\t// Leave it to overload resolution to report correct error\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// TODO: rc.Report.SymbolRelatedToPreviousError ()\n\t\t\t\t\t\t\tErrorIsInaccesible (rc, me.GetSignatureForError (), loc);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// LAMESPEC: again, ignores InvocableOnly\n\t\t\t\t\t\tif (variable != null) {\n\t\t\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (variable.Location, Name);\n\t\t\t\t\t\t\trc.Report.Error (135, loc, \"`{0}' conflicts with a declaration in a child block\", Name);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// MemberLookup does not check accessors availability, this is actually needed for properties only\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar pe = me as PropertyExpr;\n\t\t\t\t\t\tif (pe != null) {\n\n\t\t\t\t\t\t\t// Break as there is no other overload available anyway\n\t\t\t\t\t\t\tif ((restrictions & MemberLookupRestrictions.ReadAccess) != 0) {\n\t\t\t\t\t\t\t\tif (!pe.PropertyInfo.HasGet || !pe.PropertyInfo.Get.IsAccessible (rc))\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tpe.Getter = pe.PropertyInfo.Get;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (!pe.PropertyInfo.HasSet || !pe.PropertyInfo.Set.IsAccessible (rc))\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tpe.Setter = pe.PropertyInfo.Set;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// TODO: It's used by EventExpr -> FieldExpr transformation only\n\t\t\t\t\t// TODO: Should go to MemberAccess\n\t\t\t\t\tme = me.ResolveMemberAccess (rc, null, null);\n\n\t\t\t\t\tif (Arity > 0) {\n\t\t\t\t\t\ttargs.Resolve (rc);\n\t\t\t\t\t\tme.SetTypeArguments (rc, targs);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn me;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Stage 3: Lookup nested types, namespaces and type parameters in the context\n\t\t\t\t//\n\t\t\t\tif ((restrictions & MemberLookupRestrictions.InvocableOnly) == 0 && !variable_found) {\n\t\t\t\t\tif (IsPossibleTypeOrNamespace (rc)) {\n\t\t\t\t\t\tif (variable != null) {\n\t\t\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (variable.Location, Name);\n\t\t\t\t\t\t\trc.Report.Error (135, loc, \"`{0}' conflicts with a declaration in a child block\", Name);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn ResolveAsTypeOrNamespace (rc, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar mg = NamespaceContainer.LookupStaticUsings (rc, Name, Arity, loc);\n\t\t\t\tif (mg != null) {\n\t\t\t\t\tif (Arity > 0) {\n\t\t\t\t\t\ttargs.Resolve (rc);\n\t\t\t\t\t\tmg.SetTypeArguments (rc, targs);\n\t\t\t\t\t}\n\t\t\t\t\treturn mg;\n\t\t\t\t}\n\n\t\t\t\tif (Name == \"nameof\")\n\t\t\t\t\treturn new NameOf (this);\n\n\t\t\t\tif (errorMode) {\n\t\t\t\t\tif (variable_found) {\n\t\t\t\t\t\trc.Report.Error (841, loc, \"A local variable `{0}' cannot be used before it is declared\", Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Arity > 0) {\n\t\t\t\t\t\t\tvar tparams = rc.CurrentTypeParameters;\n\t\t\t\t\t\t\tif (tparams != null) {\n\t\t\t\t\t\t\t\tif (tparams.Find (Name) != null) {\n\t\t\t\t\t\t\t\t\tError_TypeArgumentsCannotBeUsed (rc, \"type parameter\", Name, loc);\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar ct = rc.CurrentType;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tif (ct.MemberDefinition.TypeParametersCount > 0) {\n\t\t\t\t\t\t\t\t\tforeach (var ctp in ct.MemberDefinition.TypeParameters) {\n\t\t\t\t\t\t\t\t\t\tif (ctp.Name == Name) {\n\t\t\t\t\t\t\t\t\t\t\tError_TypeArgumentsCannotBeUsed (rc, \"type parameter\", Name, loc);\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tct = ct.DeclaringType;\n\t\t\t\t\t\t\t} while (ct != null);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((restrictions & MemberLookupRestrictions.InvocableOnly) == 0) {\n\t\t\t\t\t\t\te = rc.LookupNamespaceOrType (Name, Arity, LookupMode.IgnoreAccessibility, loc);\n\t\t\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (e.Type);\n\t\t\t\t\t\t\t\tErrorIsInaccesible (rc, e.GetSignatureForError (), loc);\n\t\t\t\t\t\t\t\treturn e;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar me = MemberLookup (rc, false, rc.CurrentType, Name, Arity, restrictions & ~MemberLookupRestrictions.InvocableOnly, loc) as MemberExpr;\n\t\t\t\t\t\t\tif (me != null) {\n\t\t\t\t\t\t\t\tError_UnexpectedKind (rc, me, \"method group\", me.KindName, loc);\n\t\t\t\t\t\t\t\treturn ErrorExpression.Instance;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\te = rc.LookupNamespaceOrType (Name, -System.Math.Max (1, Arity), LookupMode.Probing, loc);\n\t\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\t\tif (e.Type.Arity != Arity && (restrictions & MemberLookupRestrictions.IgnoreArity) == 0) {\n\t\t\t\t\t\t\t\tError_TypeArgumentsCannotBeUsed (rc, e.Type, loc);\n\t\t\t\t\t\t\t\treturn e;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (e is TypeExpr) {\n\t\t\t\t\t\t\t\t// TypeExpression does not have correct location\n\t\t\t\t\t\t\t\tif (e is TypeExpression)\n\t\t\t\t\t\t\t\t\te = new TypeExpression (e.Type, loc);\n\n\t\t\t\t\t\t\t\treturn e;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tError_NameDoesNotExist (rc);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ErrorExpression.Instance;\n\t\t\t\t}\n\n\t\t\t\tif (rc.Module.Evaluator != null) {\n\t\t\t\t\tvar fi = rc.Module.Evaluator.LookupField (Name);\n\t\t\t\t\tif (fi != null)\n\t\t\t\t\t\treturn new FieldExpr (fi.Item1, loc);\n\t\t\t\t}\n\n\t\t\t\tlookup_arity = 0;\n\t\t\t\terrorMode = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tExpression SimpleNameResolve (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tExpression e = LookupNameExpression (ec, right_side == null ? MemberLookupRestrictions.ReadAccess : MemberLookupRestrictions.None);\n\n\t\t\tif (e == null)\n\t\t\t\treturn null;\n\n\t\t\tif (e is FullNamedExpression && e.eclass != ExprClass.Unresolved) {\n\t\t\t\tError_UnexpectedKind (ec, e, \"variable\", e.ExprClassName, loc);\n\t\t\t\treturn e;\n\t\t\t}\n\n\t\t\tif (right_side != null) {\n\t\t\t\te = e.ResolveLValue (ec, right_side);\n\t\t\t} else {\n\t\t\t\te = e.Resolve (ec);\n\t\t\t}\n\n\t\t\treturn e;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Represents a namespace or a type.  The name of the class was inspired by\n\t///   section 10.8.1 (Fully Qualified Names).\n\t/// </summary>\n\tpublic abstract class FullNamedExpression : Expression\n\t{\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\t// Do nothing, most unresolved type expressions cannot be\n\t\t\t// resolved to different type\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tpublic abstract FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments);\n\n\t\t//\n\t\t// This is used to resolve the expression as a type, a null\n\t\t// value will be returned if the expression is not a type\n\t\t// reference\n\t\t//\n\t\tpublic override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)\n\t\t{\n\t\t\tFullNamedExpression fne = ResolveAsTypeOrNamespace (mc, allowUnboundTypeArguments);\n\n\t\t\tif (fne == null)\n\t\t\t\treturn null;\n\n\t\t\tTypeExpr te = fne as TypeExpr;\n\t\t\tif (te == null) {\n\t\t\t\tError_UnexpectedKind (mc, fne, \"type\", fne.ExprClassName, loc);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tte.loc = loc;\n\n\t\t\ttype = te.Type;\n\n\t\t\tvar dep = type.GetMissingDependencies ();\n\t\t\tif (dep != null) {\n\t\t\t\tImportedTypeDefinition.Error_MissingDependency (mc, dep, loc);\n\t\t\t}\n\n\t\t\tif (type.Kind == MemberKind.Void) {\n\t\t\t\tmc.Module.Compiler.Report.Error (673, loc, \"System.Void cannot be used from C#. Consider using `void'\");\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Obsolete checks cannot be done when resolving base context as they\n\t\t\t// require type dependencies to be set but we are in process of resolving them\n\t\t\t//\n\t\t\tif (!(mc is TypeDefinition.BaseContext) && !(mc is UsingAliasNamespace.AliasContext)) {\n\t\t\t\tObsoleteAttribute obsolete_attr = type.GetAttributeObsolete ();\n\t\t\t\tif (obsolete_attr != null && !mc.IsObsolete) {\n\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (obsolete_attr, te.GetSignatureForError (), Location, mc.Module.Compiler.Report);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn type;\n\t\t}\n\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new InternalErrorException (\"FullNamedExpression `{0}' found in resolved tree\",\n\t\t\t\tGetSignatureForError ());\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t///   Expression that evaluates to a type\n\t/// </summary>\n\tpublic abstract class TypeExpr : FullNamedExpression\n\t{\n\t\tpublic sealed override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\tResolveAsType (mc);\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected sealed override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tResolveAsType (ec);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tTypeExpr tobj = obj as TypeExpr;\n\t\t\tif (tobj == null)\n\t\t\t\treturn false;\n\n\t\t\treturn Type == tobj.Type;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn Type.GetHashCode ();\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Fully resolved Expression that already evaluated to a type\n\t/// </summary>\n\tpublic class TypeExpression : TypeExpr\n\t{\n\t\tpublic TypeExpression (TypeSpec t, Location l)\n\t\t{\n\t\t\tType = t;\n\t\t\teclass = ExprClass.Type;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic sealed override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)\n\t\t{\n\t\t\treturn type;\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class NamespaceExpression : FullNamedExpression\n\t{\n\t\treadonly Namespace ns;\n\n\t\tpublic NamespaceExpression (Namespace ns, Location loc)\n\t\t{\n\t\t\tthis.ns = ns;\n\t\t\tthis.Type = InternalType.Namespace;\n\t\t\tthis.eclass = ExprClass.Namespace;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic Namespace Namespace {\n\t\t\tget {\n\t\t\t\treturn ns;\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic void Error_NamespaceDoesNotExist (IMemberContext ctx, string name, int arity)\n\t\t{\n\t\t\tvar retval = Namespace.LookupType (ctx, name, arity, LookupMode.IgnoreAccessibility, loc);\n\t\t\tif (retval != null) {\n//\t\t\t\tctx.Module.Compiler.Report.SymbolRelatedToPreviousError (retval.MemberDefinition);\n\t\t\t\tErrorIsInaccesible (ctx, retval.GetSignatureForError (), loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tretval = Namespace.LookupType (ctx, name, -System.Math.Max (1, arity), LookupMode.Probing, loc);\n\t\t\tif (retval != null) {\n\t\t\t\tError_TypeArgumentsCannotBeUsed (ctx, retval, loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tNamespace ns;\n\t\t\tif (arity > 0 && Namespace.TryGetNamespace (name, out ns)) {\n\t\t\t\tError_TypeArgumentsCannotBeUsed (ctx, ExprClassName, ns.GetSignatureForError (), loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstring assembly = null;\n\t\t\tstring possible_name = Namespace.GetSignatureForError () + \".\" + name;\n\n\t\t\t// Only assembly unique name should be added\n\t\t\tswitch (possible_name) {\n\t\t\tcase \"System.Drawing\":\n\t\t\tcase \"System.Web.Services\":\n\t\t\tcase \"System.Web\":\n\t\t\tcase \"System.Data\":\n\t\t\tcase \"System.Configuration\":\n\t\t\tcase \"System.Data.Services\":\n\t\t\tcase \"System.DirectoryServices\":\n\t\t\tcase \"System.Json\":\n\t\t\tcase \"System.Net.Http\":\n\t\t\tcase \"System.Numerics\":\n\t\t\tcase \"System.Runtime.Caching\":\n\t\t\tcase \"System.ServiceModel\":\n\t\t\tcase \"System.Transactions\":\n\t\t\tcase \"System.Web.Routing\":\n\t\t\tcase \"System.Xml.Linq\":\n\t\t\tcase \"System.Xml\":\n\t\t\t\tassembly = possible_name;\n\t\t\t\tbreak;\n\n\t\t\tcase \"System.Linq\":\n\t\t\tcase \"System.Linq.Expressions\":\n\t\t\t\tassembly = \"System.Core\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"System.Windows.Forms\":\n\t\t\tcase \"System.Windows.Forms.Layout\":\n\t\t\t\tassembly = \"System.Windows.Forms\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tassembly = assembly == null ? \"an\" : \"`\" + assembly + \"'\";\n\n\t\t\tif (Namespace is GlobalRootNamespace) {\n\t\t\t\tctx.Module.Compiler.Report.Error (400, loc,\n\t\t\t\t\t\"The type or namespace name `{0}' could not be found in the global namespace. Are you missing {1} assembly reference?\",\n\t\t\t\t\tname, assembly);\n\t\t\t} else {\n\t\t\t\tctx.Module.Compiler.Report.Error (234, loc,\n\t\t\t\t\t\"The type or namespace name `{0}' does not exist in the namespace `{1}'. Are you missing {2} assembly reference?\",\n\t\t\t\t\tname, GetSignatureForError (), assembly);\n\t\t\t}\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn ns.GetSignatureForError ();\n\t\t}\n\n\t\tpublic FullNamedExpression LookupTypeOrNamespace (IMemberContext ctx, string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\treturn ns.LookupTypeOrNamespace (ctx, name, arity, mode, loc);\n\t\t}\n    }\n\n\t/// <summary>\n\t///   This class denotes an expression which evaluates to a member\n\t///   of a struct or a class.\n\t/// </summary>\n\tpublic abstract class MemberExpr : Expression, OverloadResolver.IInstanceQualifier\n\t{\n\t\tprotected bool conditional_access_receiver;\n\n\t\t//\n\t\t// An instance expression associated with this member, if it's a\n\t\t// non-static member\n\t\t//\n\t\tpublic Expression InstanceExpression;\n\n\t\t/// <summary>\n\t\t///   The name of this member.\n\t\t/// </summary>\n\t\tpublic abstract string Name {\n\t\t\tget;\n\t\t}\n\n\t\t//\n\t\t// When base.member is used\n\t\t//\n\t\tpublic bool IsBase {\n\t\t\tget { return InstanceExpression is BaseThis; }\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Whether this is an instance member.\n\t\t/// </summary>\n\t\tpublic abstract bool IsInstance {\n\t\t\tget;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Whether this is a static member.\n\t\t/// </summary>\n\t\tpublic abstract bool IsStatic {\n\t\t\tget;\n\t\t}\n\n\t\tpublic abstract string KindName {\n\t\t\tget;\n\t\t}\n\n\t\tpublic bool ConditionalAccess { get; set; }\n\n\t\tprotected abstract TypeSpec DeclaringType {\n\t\t\tget;\n\t\t}\n\n\t\tTypeSpec OverloadResolver.IInstanceQualifier.InstanceType {\n\t\t\tget {\n\t\t\t\treturn InstanceExpression.Type;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Converts best base candidate for virtual method starting from QueriedBaseType\n\t\t//\n\t\tprotected MethodSpec CandidateToBaseOverride (ResolveContext rc, MethodSpec method)\n\t\t{\n\t\t\t//\n\t\t\t// Only when base.member is used and method is virtual\n\t\t\t//\n\t\t\tif (!IsBase)\n\t\t\t\treturn method;\n\n\t\t\t//\n\t\t\t// Overload resulution works on virtual or non-virtual members only (no overrides). That\n\t\t\t// means for base.member access we have to find the closest match after we found best candidate\n\t\t\t//\n\t\t\tif ((method.Modifiers & (Modifiers.ABSTRACT | Modifiers.VIRTUAL | Modifiers.OVERRIDE)) != 0) {\n\t\t\t\t//\n\t\t\t\t// The method could already be what we are looking for\n\t\t\t\t//\n\t\t\t\tTypeSpec[] targs = null;\n\t\t\t\tif (method.DeclaringType != InstanceExpression.Type) {\n\t\t\t\t\t//\n\t\t\t\t\t// Candidate can have inflated MVAR parameters and we need to find\n\t\t\t\t\t// base match for original definition not inflated parameter types\n\t\t\t\t\t//\n\t\t\t\t\tvar parameters = method.Parameters;\n\t\t\t\t\tif (method.Arity > 0) {\n\t\t\t\t\t\tparameters = ((IParametersMember) method.MemberDefinition).Parameters;\n\t\t\t\t\t\tvar inflated = method.DeclaringType as InflatedTypeSpec;\n\t\t\t\t\t\tif (inflated != null) {\n\t\t\t\t\t\t\tparameters = parameters.Inflate (inflated.CreateLocalInflator (rc));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar filter = new MemberFilter (method.Name, method.Arity, MemberKind.Method, parameters, null);\n\t\t\t\t\tvar base_override = MemberCache.FindMember (InstanceExpression.Type, filter, BindingRestriction.InstanceOnly | BindingRestriction.OverrideOnly) as MethodSpec;\n\t\t\t\t\tif (base_override != null && base_override.DeclaringType != method.DeclaringType) {\n\t\t\t\t\t\tif (base_override.IsGeneric)\n\t\t\t\t\t\t\ttargs = method.TypeArguments;\n\n\t\t\t\t\t\tmethod = base_override;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// When base access is used inside anonymous method/iterator/etc we need to\n\t\t\t\t// get back to the context of original type. We do it by emiting proxy\n\t\t\t\t// method in original class and rewriting base call to this compiler\n\t\t\t\t// generated method call which does the actual base invocation. This may\n\t\t\t\t// introduce redundant storey but with `this' only but it's tricky to avoid\n\t\t\t\t// at this stage as we don't know what expressions follow base\n\t\t\t\t//\n\t\t\t\tif (rc.CurrentAnonymousMethod != null) {\n\t\t\t\t\tif (targs == null && method.IsGeneric) {\n\t\t\t\t\t\ttargs = method.TypeArguments;\n\t\t\t\t\t\tmethod = method.GetGenericMethodDefinition ();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (method.Parameters.HasArglist)\n\t\t\t\t\t\tthrow new NotImplementedException (\"__arglist base call proxy\");\n\n\t\t\t\t\tmethod = rc.CurrentMemberDefinition.Parent.PartialContainer.CreateHoistedBaseCallProxy (rc, method);\n\n\t\t\t\t\t// Ideally this should apply to any proxy rewrite but in the case of unary mutators on\n\t\t\t\t\t// get/set member expressions second call would fail to proxy because left expression\n\t\t\t\t\t// would be of 'this' and not 'base' because we share InstanceExpression for get/set\n\t\t\t\t\t// FIXME: The async check is another hack but will probably fail with mutators\n\t\t\t\t\tif (rc.CurrentType.IsStruct || rc.CurrentAnonymousMethod.Storey is AsyncTaskStorey)\n\t\t\t\t\t\tInstanceExpression = new This (loc).Resolve (rc);\n\t\t\t\t}\n\n\t\t\t\tif (targs != null)\n\t\t\t\t\tmethod = method.MakeGenericMethod (rc, targs);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Only base will allow this invocation to happen.\n\t\t\t//\n\t\t\tif (method.IsAbstract) {\n\t\t\t\trc.Report.SymbolRelatedToPreviousError (method);\n\t\t\t\tError_CannotCallAbstractBase (rc, method.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn method;\n\t\t}\n\n\t\tprotected void CheckProtectedMemberAccess (ResolveContext rc, MemberSpec member)\n\t\t{\n\t\t\tif (InstanceExpression == null)\n\t\t\t\treturn;\n\n\t\t\tif ((member.Modifiers & Modifiers.PROTECTED) != 0 && !(InstanceExpression is This)) {\n\t\t\t\tif (!CheckProtectedMemberAccess (rc, member, InstanceExpression.Type)) {\n\t\t\t\t\tError_ProtectedMemberAccess (rc, member, InstanceExpression.Type, loc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbool OverloadResolver.IInstanceQualifier.CheckProtectedMemberAccess (ResolveContext rc, MemberSpec member)\n\t\t{\n\t\t\tif (InstanceExpression == null)\n\t\t\t\treturn true;\n\n\t\t\treturn InstanceExpression is This || CheckProtectedMemberAccess (rc, member, InstanceExpression.Type);\n\t\t}\n\n\t\tpublic static bool CheckProtectedMemberAccess<T> (ResolveContext rc, T member, TypeSpec qualifier) where T : MemberSpec\n\t\t{\n\t\t\tvar ct = rc.CurrentType;\n\t\t\tif (ct == qualifier)\n\t\t\t\treturn true;\n\n\t\t\tif ((member.Modifiers & Modifiers.INTERNAL) != 0 && member.DeclaringType.MemberDefinition.IsInternalAsPublic (ct.MemberDefinition.DeclaringAssembly))\n\t\t\t\treturn true;\n\n\t\t\tqualifier = qualifier.GetDefinition ();\n\t\t\tif (ct != qualifier && !IsSameOrBaseQualifier (ct, qualifier)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn InstanceExpression != null && InstanceExpression.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override bool HasConditionalAccess ()\n\t\t{\n\t\t\treturn ConditionalAccess || (InstanceExpression != null && InstanceExpression.HasConditionalAccess ());\n\t\t}\n\n\t\tstatic bool IsSameOrBaseQualifier (TypeSpec type, TypeSpec qtype)\n\t\t{\n\t\t\tdo {\n\t\t\t\ttype = type.GetDefinition ();\n\n\t\t\t\tif (type == qtype || TypeManager.IsFamilyAccessible (qtype, type))\n\t\t\t\t\treturn true;\n\n\t\t\t\ttype = type.DeclaringType;\n\t\t\t} while (type != null);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected void DoBestMemberChecks<T> (ResolveContext rc, T member) where T : MemberSpec, IInterfaceMemberSpec\n\t\t{\n\t\t\tif (InstanceExpression != null) {\n\t\t\t\tInstanceExpression = InstanceExpression.Resolve (rc);\n\t\t\t\tCheckProtectedMemberAccess (rc, member);\n\t\t\t}\n\n\t\t\tif (member.MemberType.IsPointer && !rc.IsUnsafe) {\n\t\t\t\tUnsafeError (rc, loc);\n\t\t\t}\n\n\t\t\tvar dep = member.GetMissingDependencies ();\n\t\t\tif (dep != null) {\n\t\t\t\tImportedTypeDefinition.Error_MissingDependency (rc, dep, loc);\n\t\t\t}\n\n\t\t\tif (!rc.IsObsolete) {\n\t\t\t\tObsoleteAttribute oa = member.GetAttributeObsolete ();\n\t\t\t\tif (oa != null)\n\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, member.GetSignatureForError (), loc, rc.Report);\n\t\t\t}\n\n\t\t\tif (!(member is FieldSpec))\n\t\t\t\tmember.MemberDefinition.SetIsUsed ();\n\t\t}\n\n\t\tprotected virtual void Error_CannotCallAbstractBase (ResolveContext rc, string name)\n\t\t{\n\t\t\trc.Report.Error (205, loc, \"Cannot call an abstract base member `{0}'\", name);\n\t\t}\n\n\t\tpublic static void Error_ProtectedMemberAccess (ResolveContext rc, MemberSpec member, TypeSpec qualifier, Location loc)\n\t\t{\n\t\t\trc.Report.SymbolRelatedToPreviousError (member);\n\t\t\trc.Report.Error (1540, loc,\n\t\t\t\t\"Cannot access protected member `{0}' via a qualifier of type `{1}'. The qualifier must be of type `{2}' or derived from it\",\n\t\t\t\tmember.GetSignatureForError (), qualifier.GetSignatureForError (), rc.CurrentType.GetSignatureForError ());\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (InstanceExpression != null) {\n\t\t\t\tInstanceExpression.FlowAnalysis (fc);\n\n\t\t\t\tif (ConditionalAccess) {\n\t\t\t\t\tfc.BranchConditionalAccessDefiniteAssignment ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected void ResolveConditionalAccessReceiver (ResolveContext rc)\n\t\t{\n\t\t\tif (!rc.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {\n\t\t\t\tif (HasConditionalAccess ()) {\n\t\t\t\t\tconditional_access_receiver = true;\n\t\t\t\t\trc.Set (ResolveContext.Options.ConditionalAccessReceiver);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool ResolveInstanceExpression (ResolveContext rc, Expression rhs)\n\t\t{\n\t\t\tif (!ResolveInstanceExpressionCore (rc, rhs))\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// Check intermediate value modification which won't have any effect\n\t\t\t//\n\t\t\tif (rhs != null && TypeSpec.IsValueType (InstanceExpression.Type)) {\n\t\t\t\tvar fexpr = InstanceExpression as FieldExpr;\n\t\t\t\tif (fexpr != null) {\n\t\t\t\t\tif (!fexpr.Spec.IsReadOnly || rc.HasAny (ResolveContext.Options.FieldInitializerScope | ResolveContext.Options.ConstructorScope))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tif (fexpr.IsStatic) {\n\t\t\t\t\t\trc.Report.Error (1650, loc, \"Fields of static readonly field `{0}' cannot be assigned to (except in a static constructor or a variable initializer)\",\n\t\t\t\t\t\t\tfexpr.GetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\trc.Report.Error (1648, loc, \"Members of readonly field `{0}' cannot be modified (except in a constructor or a variable initializer)\",\n\t\t\t\t\t\t\tfexpr.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (InstanceExpression is PropertyExpr || InstanceExpression is IndexerExpr || InstanceExpression is Invocation) {\n\t\t\t\t\tif (rc.CurrentInitializerVariable != null) {\n\t\t\t\t\t\trc.Report.Error (1918, loc, \"Members of value type `{0}' cannot be assigned using a property `{1}' object initializer\",\n\t\t\t\t\t\t\tInstanceExpression.Type.GetSignatureForError (), InstanceExpression.GetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\trc.Report.Error (1612, loc,\n\t\t\t\t\t\t\t\"Cannot modify a value type return value of `{0}'. Consider storing the value in a temporary variable\",\n\t\t\t\t\t\t\tInstanceExpression.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar lvr = InstanceExpression as LocalVariableReference;\n\t\t\t\tif (lvr != null) {\n\n\t\t\t\t\tif (!lvr.local_info.IsReadonly)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\trc.Report.Error (1654, loc, \"Cannot assign to members of `{0}' because it is a `{1}'\",\n\t\t\t\t\t\tInstanceExpression.GetSignatureForError (), lvr.local_info.GetReadOnlyContext ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool ResolveInstanceExpressionCore (ResolveContext rc, Expression rhs)\n\t\t{\n\t\t\tif (IsStatic) {\n\t\t\t\tif (InstanceExpression != null) {\n\t\t\t\t\tif (InstanceExpression is TypeExpr) {\n\t\t\t\t\t\tvar t = InstanceExpression.Type;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tObsoleteAttribute oa = t.GetAttributeObsolete ();\n\t\t\t\t\t\t\tif (oa != null && !rc.IsObsolete) {\n\t\t\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, t.GetSignatureForError (), loc, rc.Report);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tt = t.DeclaringType;\n\t\t\t\t\t\t} while (t != null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar runtime_expr = InstanceExpression as RuntimeValueExpression;\n\t\t\t\t\t\tif (runtime_expr == null || !runtime_expr.IsSuggestionOnly) {\n\t\t\t\t\t\t\trc.Report.Error (176, loc,\n\t\t\t\t\t\t\t\t\"Static member `{0}' cannot be accessed with an instance reference, qualify it with a type name instead\",\n\t\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tInstanceExpression = null;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (InstanceExpression == null || InstanceExpression is TypeExpr) {\n\t\t\t\tif (InstanceExpression != null || !This.IsThisAvailable (rc, true)) {\n\t\t\t\t\tif (rc.HasSet (ResolveContext.Options.FieldInitializerScope)) {\n\t\t\t\t\t\trc.Report.Error (236, loc,\n\t\t\t\t\t\t\t\"A field initializer cannot reference the nonstatic field, method, or property `{0}'\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar fe = this as FieldExpr;\n\t\t\t\t\t\tif (fe != null && fe.Spec.MemberDefinition is PrimaryConstructorField) {\n\t\t\t\t\t\t\tif (rc.HasSet (ResolveContext.Options.BaseInitializer)) {\n\t\t\t\t\t\t\t\trc.Report.Error (9005, loc, \"Constructor initializer cannot access primary constructor parameters\");\n\t\t\t\t\t\t\t} else  {\n\t\t\t\t\t\t\t\trc.Report.Error (9006, loc, \"An object reference is required to access primary constructor parameter `{0}'\",\n\t\t\t\t\t\t\t\t\tfe.Name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trc.Report.Error (120, loc,\n\t\t\t\t\t\t\t\t\"An object reference is required to access non-static member `{0}'\",\n\t\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tInstanceExpression = new CompilerGeneratedThis (rc.CurrentType, loc).Resolve (rc);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!TypeManager.IsFamilyAccessible (rc.CurrentType, DeclaringType)) {\n\t\t\t\t\trc.Report.Error (38, loc,\n\t\t\t\t\t\t\"Cannot access a nonstatic member of outer type `{0}' via nested type `{1}'\",\n\t\t\t\t\t\tDeclaringType.GetSignatureForError (), rc.CurrentType.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tInstanceExpression = new This (loc).Resolve (rc);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar me = InstanceExpression as MemberExpr;\n\t\t\tif (me != null) {\n\t\t\t\tme.ResolveInstanceExpressionCore (rc, rhs);\n\n\t\t\t\tvar fe = me as FieldExpr;\n\t\t\t\tif (fe != null && fe.IsMarshalByRefAccess (rc)) {\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (me.DeclaringType);\n\t\t\t\t\trc.Report.Warning (1690, 1, loc,\n\t\t\t\t\t\t\"Cannot call methods, properties, or indexers on `{0}' because it is a value type member of a marshal-by-reference class\",\n\t\t\t\t\t\tme.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Additional checks for l-value member access\n\t\t\t//\n\t\t\tif (rhs != null) {\n\t\t\t\tif (InstanceExpression is UnboxCast) {\n\t\t\t\t\trc.Report.Error (445, InstanceExpression.Location, \"Cannot modify the result of an unboxing conversion\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic virtual MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)\n\t\t{\n\t\t\tif (left != null && !ConditionalAccess && left.IsNull && TypeSpec.IsReferenceType (left.Type)) {\n\t\t\t\tec.Report.Warning (1720, 1, left.Location,\n\t\t\t\t\t\"Expression will always cause a `{0}'\", \"System.NullReferenceException\");\n\t\t\t}\n\n\t\t\tInstanceExpression = left;\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected void EmitInstance (EmitContext ec, bool prepare_for_load)\n\t\t{\n\t\t\tvar inst = new InstanceEmitter (InstanceExpression, TypeSpec.IsValueType (InstanceExpression.Type));\n\t\t\tinst.Emit (ec, ConditionalAccess);\n\n\t\t\tif (prepare_for_load)\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t}\n\n\t\tpublic abstract void SetTypeArguments (ResolveContext ec, TypeArguments ta);\n\t}\n\n\tpublic class ExtensionMethodCandidates\n\t{\n\t\treadonly NamespaceContainer container;\n\t\treadonly IList<MethodSpec> methods;\n\t\treadonly int index;\n\t\treadonly IMemberContext context;\n\n\t\tpublic ExtensionMethodCandidates (IMemberContext context, IList<MethodSpec> methods, NamespaceContainer nsContainer, int lookupIndex)\n\t\t{\n\t\t\tthis.context = context;\n\t\t\tthis.methods = methods;\n\t\t\tthis.container = nsContainer;\n\t\t\tthis.index = lookupIndex;\n\t\t}\n\n\t\tpublic NamespaceContainer Container {\n\t\t\tget {\n\t\t\t\treturn container;\n\t\t\t}\n\t\t}\n\n\t\tpublic IMemberContext Context {\n\t\t\tget {\n\t\t\t\treturn context;\n\t\t\t}\n\t\t}\n\n\t\tpublic int LookupIndex {\n\t\t\tget {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<MethodSpec> Methods {\n\t\t\tget {\n\t\t\t\treturn methods;\n\t\t\t}\n\t\t}\n\t}\n\n\t// \n\t// Represents a group of extension method candidates for whole namespace\n\t// \n\tclass ExtensionMethodGroupExpr : MethodGroupExpr, OverloadResolver.IErrorHandler\n\t{\n\t\tExtensionMethodCandidates candidates;\n\t\tpublic Expression ExtensionExpression;\n\n\t\tpublic ExtensionMethodGroupExpr (ExtensionMethodCandidates candidates, Expression extensionExpr, Location loc)\n\t\t\t: base (candidates.Methods.Cast<MemberSpec>().ToList (), extensionExpr.Type, loc)\n\t\t{\n\t\t\tthis.candidates = candidates;\n\t\t\tthis.ExtensionExpression = extensionExpr;\n\t\t}\n\n\t\tpublic override bool IsStatic {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (ConditionalAccess) {\n\t\t\t\tfc.BranchConditionalAccessDefiniteAssignment ();\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// For extension methodgroup we are not looking for base members but parent\n\t\t// namespace extension methods\n\t\t//\n\t\tpublic override IList<MemberSpec> GetBaseMembers (TypeSpec baseType)\n\t\t{\n\t\t\t// TODO: candidates are null only when doing error reporting, that's\n\t\t\t// incorrect. We have to discover same extension methods in error mode\n\t\t\tif (candidates == null)\n\t\t\t\treturn null;\n\n\t\t\tint arity = type_arguments == null ? 0 : type_arguments.Count;\n\n\t\t\tcandidates = candidates.Container.LookupExtensionMethod (candidates.Context, ExtensionExpression.Type, Name, arity, candidates.LookupIndex);\n\t\t\tif (candidates == null)\n\t\t\t\treturn null;\n\n\t\t\treturn candidates.Methods.Cast<MemberSpec> ().ToList ();\n\t\t}\n\n\t\tpublic override MethodGroupExpr LookupExtensionMethod (ResolveContext rc)\n\t\t{\n\t\t\t// We are already here\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override MethodGroupExpr OverloadResolve (ResolveContext ec, ref Arguments arguments, OverloadResolver.IErrorHandler ehandler, OverloadResolver.Restrictions restr)\n\t\t{\n\t\t\tif (arguments == null)\n\t\t\t\targuments = new Arguments (1);\n\n\t\t\tExtensionExpression = ExtensionExpression.Resolve (ec);\n\t\t\tif (ExtensionExpression == null)\n\t\t\t\treturn null;\n\n\t\t\tvar cand = candidates;\n\t\t\tvar atype = ConditionalAccess ? Argument.AType.ExtensionTypeConditionalAccess : Argument.AType.ExtensionType;\n\t\t\targuments.Insert (0, new Argument (ExtensionExpression, atype));\n\t\t\tvar res = base.OverloadResolve (ec, ref arguments, ehandler ?? this, restr);\n\t\t\t\n\t\t\t// Restore candidates in case we are running in probing mode \n\t\t\tcandidates = cand;\n\n\t\t\t// Store resolved argument and restore original arguments\n\t\t\tif (res == null) {\n\t\t\t\t// Clean-up modified arguments for error reporting\n\t\t\t\targuments.RemoveAt (0);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar me = ExtensionExpression as MemberExpr;\n\t\t\tif (me != null) {\n\t\t\t\tme.ResolveInstanceExpression (ec, null);\n\t\t\t\tvar fe = me as FieldExpr;\n\t\t\t\tif (fe != null)\n\t\t\t\t\tfe.Spec.MemberDefinition.SetIsUsed ();\n\t\t\t}\n\n\t\t\tInstanceExpression = null;\n\t\t\treturn this;\n\t\t}\n\n\t\t#region IErrorHandler Members\n\n\t\tbool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext rc, MemberSpec best, MemberSpec ambiguous)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tbool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)\n\t\t{\n\t\t\trc.Report.SymbolRelatedToPreviousError (best);\n\t\t\trc.Report.Error (1928, loc,\n\t\t\t\t\"Type `{0}' does not contain a member `{1}' and the best extension method overload `{2}' has some invalid arguments\",\n\t\t\t\tqueried_type.GetSignatureForError (), Name, best.GetSignatureForError ());\n\n\t\t\tif (index == 0) {\n\t\t\t\trc.Report.Error (1929, loc,\n\t\t\t\t\t\"Extension method instance type `{0}' cannot be converted to `{1}'\",\n\t\t\t\t\targ.Type.GetSignatureForError (), ((MethodSpec)best).Parameters.ExtensionMethodType.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tbool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t/// <summary>\n\t///   MethodGroupExpr represents a group of method candidates which\n\t///   can be resolved to the best method overload\n\t/// </summary>\n\tpublic class MethodGroupExpr : MemberExpr, OverloadResolver.IBaseMembersProvider\n\t{\n\t\tstatic readonly MemberSpec[] Excluded = new MemberSpec[0];\n\n\t\tprotected IList<MemberSpec> Methods;\n\t\tMethodSpec best_candidate;\n\t\tTypeSpec best_candidate_return;\n\t\tprotected TypeArguments type_arguments;\n\n \t\tSimpleName simple_name;\n\t\tprotected TypeSpec queried_type;\n\n\t\tpublic MethodGroupExpr (IList<MemberSpec> mi, TypeSpec type, Location loc)\n\t\t{\n\t\t\tMethods = mi;\n\t\t\tthis.loc = loc;\n\t\t\tthis.type = InternalType.MethodGroup;\n\n\t\t\teclass = ExprClass.MethodGroup;\n\t\t\tqueried_type = type;\n\t\t}\n\n\t\tpublic MethodGroupExpr (MethodSpec m, TypeSpec type, Location loc)\n\t\t\t: this (new MemberSpec[] { m }, type, loc)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic MethodSpec BestCandidate {\n\t\t\tget {\n\t\t\t\treturn best_candidate;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec BestCandidateReturnType {\n\t\t\tget {\n\t\t\t\treturn best_candidate_return;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<MemberSpec> Candidates {\n\t\t\tget {\n\t\t\t\treturn Methods;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeSpec DeclaringType {\n\t\t\tget {\n\t\t\t\treturn queried_type;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConditionallyExcluded {\n\t\t\tget {\n\t\t\t\treturn Methods == Excluded;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsInstance {\n\t\t\tget {\n\t\t\t\tif (best_candidate != null)\n\t\t\t\t\treturn !best_candidate.IsStatic;\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn InstanceExpression == null || InstanceExpression.IsSideEffectFree;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsStatic {\n\t\t\tget {\n\t\t\t\tif (best_candidate != null)\n\t\t\t\t\treturn best_candidate.IsStatic;\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string KindName {\n\t\t\tget { return \"method\"; }\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\tif (best_candidate != null)\n\t\t\t\t\treturn best_candidate.Name;\n\n\t\t\t\t// TODO: throw ?\n\t\t\t\treturn Methods.First ().Name;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t//\n\t\t// When best candidate is already know this factory can be used\n\t\t// to avoid expensive overload resolution to be called\n\t\t//\n\t\t// NOTE: InstanceExpression has to be set manually\n\t\t//\n\t\tpublic static MethodGroupExpr CreatePredefined (MethodSpec best, TypeSpec queriedType, Location loc)\n\t\t{\n\t\t\treturn new MethodGroupExpr (best, queriedType, loc) {\n\t\t\t\tbest_candidate = best,\n\t\t\t\tbest_candidate_return = best.ReturnType\n\t\t\t};\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tif (best_candidate != null)\n\t\t\t\treturn best_candidate.GetSignatureForError ();\n\n\t\t\treturn Methods.First ().GetSignatureForError ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (best_candidate == null) {\n\t\t\t\tec.Report.Error (1953, loc, \"An expression tree cannot contain an expression with method group\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (IsConditionallyExcluded)\n\t\t\t\tec.Report.Error (765, loc,\n\t\t\t\t\t\"Partial methods with only a defining declaration or removed conditional methods cannot be used in an expression tree\");\n\n\t\t\tif (ConditionalAccess)\n\t\t\t\tError_NullShortCircuitInsideExpressionTree (ec);\n\n\t\t\treturn new TypeOfMethod (best_candidate, loc);\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tthis.eclass = ExprClass.MethodGroup;\n\n\t\t\tif (InstanceExpression != null) {\n\t\t\t\tInstanceExpression = InstanceExpression.Resolve (ec);\n\t\t\t\tif (InstanceExpression == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic void EmitCall (EmitContext ec, Arguments arguments, bool statement)\n\t\t{\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = InstanceExpression;\n\t\t\tcall.ConditionalAccess = ConditionalAccess;\n\n\t\t\tif (statement)\n\t\t\t\tcall.EmitStatement (ec, best_candidate, arguments, loc);\n\t\t\telse\n\t\t\t\tcall.Emit (ec, best_candidate, arguments, loc);\n\t\t}\n\n\t\tpublic void EmitCall (EmitContext ec, Arguments arguments, TypeSpec conditionalAccessReceiver, bool statement)\n\t\t{\n\t\t\tec.ConditionalAccess = new ConditionalAccessContext (conditionalAccessReceiver, ec.DefineLabel ()) {\n\t\t\t\tStatement = statement\n\t\t\t};\n\n\t\t\tEmitCall (ec, arguments, statement);\n\n\t\t\tec.CloseConditionalAccess (!statement && best_candidate_return != conditionalAccessReceiver && conditionalAccessReceiver.IsNullableType ? conditionalAccessReceiver : null);\n\t\t}\n\n\t\tpublic override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)\n\t\t{\n\t\t\tec.Report.Error (428, loc, \"Cannot convert method group `{0}' to non-delegate type `{1}'. Consider using parentheses to invoke the method\",\n\t\t\t\tName, target.GetSignatureForError ());\n\t\t}\n\n\t\tpublic static bool IsExtensionMethodArgument (Expression expr)\n\t\t{\n\t\t\t//\n\t\t\t// LAMESPEC: No details about which expressions are not allowed\n\t\t\t//\n\t\t\treturn !(expr is TypeExpr) && !(expr is BaseThis);\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Find the Applicable Function Members (7.4.2.1)\n\t\t///\n\t\t///   me: Method Group expression with the members to select.\n\t\t///       it might contain constructors or methods (or anything\n\t\t///       that maps to a method).\n\t\t///\n\t\t///   Arguments: ArrayList containing resolved Argument objects.\n\t\t///\n\t\t///   loc: The location if we want an error to be reported, or a Null\n\t\t///        location for \"probing\" purposes.\n\t\t///\n\t\t///   Returns: The MethodBase (either a ConstructorInfo or a MethodInfo)\n\t\t///            that is the best match of me on Arguments.\n\t\t///\n\t\t/// </summary>\n\t\tpublic virtual MethodGroupExpr OverloadResolve (ResolveContext ec, ref Arguments args, OverloadResolver.IErrorHandler cerrors, OverloadResolver.Restrictions restr)\n\t\t{\n\t\t\t// TODO: causes issues with probing mode, remove explicit Kind check\n\t\t\tif (best_candidate != null && best_candidate.Kind == MemberKind.Destructor)\n\t\t\t\treturn this;\n\n\t\t\tvar r = new OverloadResolver (Methods, type_arguments, restr, loc);\n\t\t\tif ((restr & OverloadResolver.Restrictions.NoBaseMembers) == 0) {\n\t\t\t\tr.BaseMembersProvider = this;\n\t\t\t\tr.InstanceQualifier = this;\n\t\t\t}\n\n\t\t\tif (cerrors != null)\n\t\t\t\tr.CustomErrors = cerrors;\n\n\t\t\t// TODO: When in probing mode do IsApplicable only and when called again do VerifyArguments for full error reporting\n\t\t\tbest_candidate = r.ResolveMember<MethodSpec> (ec, ref args);\n\t\t\tif (best_candidate == null) {\n\t\t\t\tif (!r.BestCandidateIsDynamic)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (simple_name != null && ec.IsStatic)\n\t\t\t\t\tInstanceExpression = ProbeIdenticalTypeName (ec, InstanceExpression, simple_name);\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\t// Overload resolver had to create a new method group, all checks bellow have already been executed\n\t\t\tif (r.BestCandidateNewMethodGroup != null)\n\t\t\t\treturn r.BestCandidateNewMethodGroup;\n\n\t\t\tif (best_candidate.Kind == MemberKind.Method && (restr & OverloadResolver.Restrictions.ProbingOnly) == 0) {\n\t\t\t\tif (InstanceExpression != null) {\n\t\t\t\t\tif (best_candidate.IsExtensionMethod && args[0].Expr == InstanceExpression) {\n\t\t\t\t\t\tInstanceExpression = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (simple_name != null && best_candidate.IsStatic) {\n\t\t\t\t\t\t\tInstanceExpression = ProbeIdenticalTypeName (ec, InstanceExpression, simple_name);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tInstanceExpression.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup | ResolveFlags.Type);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tResolveInstanceExpression (ec, null);\n\t\t\t}\n\n\t\t\tvar base_override = CandidateToBaseOverride (ec, best_candidate);\n\t\t\tif (base_override == best_candidate) {\n\t\t\t\tbest_candidate_return = r.BestCandidateReturnType;\n\t\t\t} else {\n\t\t\t\tbest_candidate = base_override;\n\t\t\t\tbest_candidate_return = best_candidate.ReturnType;\n\t\t\t}\n\n\t\t\tif (best_candidate.IsGeneric && (restr & OverloadResolver.Restrictions.ProbingOnly) == 0 && TypeParameterSpec.HasAnyTypeParameterConstrained (best_candidate.GenericDefinition)) {\n\t\t\t\tConstraintChecker cc = new ConstraintChecker (ec);\n\t\t\t\tcc.CheckAll (best_candidate.GetGenericMethodDefinition (), best_candidate.TypeArguments, best_candidate.Constraints, loc);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Additional check for possible imported base override method which\n\t\t\t// could not be done during IsOverrideMethodBaseTypeAccessible\n\t\t\t//\n\t\t\tif (best_candidate.IsVirtual && (best_candidate.DeclaringType.Modifiers & Modifiers.PROTECTED) != 0 &&\n\t\t\t\tbest_candidate.MemberDefinition.IsImported && !best_candidate.DeclaringType.IsAccessible (ec)) {\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\t\tErrorIsInaccesible (ec, best_candidate.GetSignatureForError (), loc);\n\t\t\t}\n\n\t\t\t// Speed up the check by not doing it on disallowed targets\n\t\t\tif (best_candidate_return.Kind == MemberKind.Void && best_candidate.IsConditionallyExcluded (ec))\n\t\t\t\tMethods = Excluded;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)\n\t\t{\n\t\t\tvar fe = left as FieldExpr;\n\t\t\tif (fe != null) {\n\t\t\t\t//\n\t\t\t\t// Using method-group on struct fields makes the struct assigned. I am not sure\n\t\t\t\t// why but that's what .net does\n\t\t\t\t//\n\t\t\t\tfe.Spec.MemberDefinition.SetIsAssigned ();\n\t\t\t}\n\n\t\t\tsimple_name = original;\n\t\t\treturn base.ResolveMemberAccess (ec, left, original);\n\t\t}\n\n\t\tpublic override void SetTypeArguments (ResolveContext ec, TypeArguments ta)\n\t\t{\n\t\t\ttype_arguments = ta;\n\t\t}\n\n\t\t#region IBaseMembersProvider Members\n\n\t\tpublic virtual IList<MemberSpec> GetBaseMembers (TypeSpec baseType)\n\t\t{\n\t\t\treturn baseType == null ? null : MemberCache.FindMembers (baseType, Methods [0].Name, false);\n\t\t}\n\n\t\tpublic IParametersMember GetOverrideMemberParameters (MemberSpec member)\n\t\t{\n\t\t\tif (queried_type == member.DeclaringType)\n\t\t\t\treturn null;\n\n\t\t\treturn MemberCache.FindMember (queried_type, new MemberFilter ((MethodSpec) member),\n\t\t\t\tBindingRestriction.InstanceOnly | BindingRestriction.OverrideOnly) as IParametersMember;\n\t\t}\n\n\t\t//\n\t\t// Extension methods lookup after ordinary methods candidates failed to apply\n\t\t//\n\t\tpublic virtual MethodGroupExpr LookupExtensionMethod (ResolveContext rc)\n\t\t{\n\t\t\tif (InstanceExpression == null || InstanceExpression.eclass == ExprClass.Type)\n\t\t\t\treturn null;\n\n\t\t\tif (!IsExtensionMethodArgument (InstanceExpression))\n\t\t\t\treturn null;\n\n\t\t\tint arity = type_arguments == null ? 0 : type_arguments.Count;\n\t\t\tvar methods = rc.LookupExtensionMethod (InstanceExpression.Type, Methods[0].Name, arity);\n\t\t\tif (methods == null)\n\t\t\t\treturn null;\n\n\t\t\tvar emg = new ExtensionMethodGroupExpr (methods, InstanceExpression, loc);\n\t\t\temg.SetTypeArguments (rc, type_arguments);\n\t\t\treturn emg;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tstruct ConstructorInstanceQualifier : OverloadResolver.IInstanceQualifier\n\t{\n\t\tpublic ConstructorInstanceQualifier (TypeSpec type)\n\t\t\t: this ()\n\t\t{\n\t\t\tInstanceType = type;\n\t\t}\n\n\t\tpublic TypeSpec InstanceType { get; private set; }\n\n\t\tpublic bool CheckProtectedMemberAccess (ResolveContext rc, MemberSpec member)\n\t\t{\n\t\t\treturn MemberExpr.CheckProtectedMemberAccess (rc, member, InstanceType);\n\t\t}\n\t}\n\n\tpublic struct OverloadResolver\n\t{\n\t\t[Flags]\n\t\tpublic enum Restrictions\n\t\t{\n\t\t\tNone = 0,\n\t\t\tDelegateInvoke = 1,\n\t\t\tProbingOnly\t= 1 << 1,\n\t\t\tCovariantDelegate = 1 << 2,\n\t\t\tNoBaseMembers = 1 << 3,\n\t\t\tBaseMembersIncluded = 1 << 4,\n\t\t\tGetEnumeratorLookup = 1 << 5\n\t\t}\n\n\t\tpublic interface IBaseMembersProvider\n\t\t{\n\t\t\tIList<MemberSpec> GetBaseMembers (TypeSpec baseType);\n\t\t\tIParametersMember GetOverrideMemberParameters (MemberSpec member);\n\t\t\tMethodGroupExpr LookupExtensionMethod (ResolveContext rc);\n\t\t}\n\n\t\tpublic interface IErrorHandler\n\t\t{\n\t\t\tbool AmbiguousCandidates (ResolveContext rc, MemberSpec best, MemberSpec ambiguous);\n\t\t\tbool ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument a, int index);\n\t\t\tbool NoArgumentMatch (ResolveContext rc, MemberSpec best);\n\t\t\tbool TypeInferenceFailed (ResolveContext rc, MemberSpec best);\n\t\t}\n\n\t\tpublic interface IInstanceQualifier\n\t\t{\n\t\t\tTypeSpec InstanceType { get; }\n\t\t\tbool CheckProtectedMemberAccess (ResolveContext rc, MemberSpec member);\n\t\t}\n\n\t\tsealed class NoBaseMembers : IBaseMembersProvider\n\t\t{\n\t\t\tpublic static readonly IBaseMembersProvider Instance = new NoBaseMembers ();\n\n\t\t\tpublic IList<MemberSpec> GetBaseMembers (TypeSpec baseType)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic IParametersMember GetOverrideMemberParameters (MemberSpec member)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic MethodGroupExpr LookupExtensionMethod (ResolveContext rc)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tstruct AmbiguousCandidate\n\t\t{\n\t\t\tpublic readonly MemberSpec Member;\n\t\t\tpublic readonly bool Expanded;\n\t\t\tpublic readonly AParametersCollection Parameters;\n\n\t\t\tpublic AmbiguousCandidate (MemberSpec member, AParametersCollection parameters, bool expanded)\n\t\t\t{\n\t\t\t\tMember = member;\n\t\t\t\tParameters = parameters;\n\t\t\t\tExpanded = expanded;\n\t\t\t}\n\t\t}\n\n\t\tLocation loc;\n\t\tIList<MemberSpec> members;\n\t\tTypeArguments type_arguments;\n\t\tIBaseMembersProvider base_provider;\n\t\tIErrorHandler custom_errors;\n\t\tIInstanceQualifier instance_qualifier;\n\t\tRestrictions restrictions;\n\t\tMethodGroupExpr best_candidate_extension_group;\n\t\tTypeSpec best_candidate_return_type;\n\n\t\tSessionReportPrinter lambda_conv_msgs;\n\n\t\tpublic OverloadResolver (IList<MemberSpec> members, Restrictions restrictions, Location loc)\n\t\t\t: this (members, null, restrictions, loc)\n\t\t{\n\t\t}\n\n\t\tpublic OverloadResolver (IList<MemberSpec> members, TypeArguments targs, Restrictions restrictions, Location loc)\n\t\t\t: this ()\n\t\t{\n\t\t\tif (members == null || members.Count == 0)\n\t\t\t\tthrow new ArgumentException (\"empty members set\");\n\n\t\t\tthis.members = members;\n\t\t\tthis.loc = loc;\n\t\t\ttype_arguments = targs;\n\t\t\tthis.restrictions = restrictions;\n\t\t\tif (IsDelegateInvoke)\n\t\t\t\tthis.restrictions |= Restrictions.NoBaseMembers;\n\n\t\t\tbase_provider = NoBaseMembers.Instance;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic IBaseMembersProvider BaseMembersProvider {\n\t\t\tget {\n\t\t\t\treturn base_provider;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tbase_provider = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool BestCandidateIsDynamic { get; set; }\n\n\t\t//\n\t\t// Best candidate was found in newly created MethodGroupExpr, used by extension methods\n\t\t//\n\t\tpublic MethodGroupExpr BestCandidateNewMethodGroup {\n\t\t\tget {\n\t\t\t\treturn best_candidate_extension_group;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Return type can be different between best candidate and closest override\n\t\t//\n\t\tpublic TypeSpec BestCandidateReturnType {\n\t\t\tget {\n\t\t\t\treturn best_candidate_return_type;\n\t\t\t}\n\t\t}\n\n\t\tpublic IErrorHandler CustomErrors {\n\t\t\tget {\n\t\t\t\treturn custom_errors;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tcustom_errors = value;\n\t\t\t}\n\t\t}\n\n\t\tTypeSpec DelegateType {\n\t\t\tget {\n\t\t\t\tif ((restrictions & Restrictions.DelegateInvoke) == 0)\n\t\t\t\t\tthrow new InternalErrorException (\"Not running in delegate mode\", loc);\n\n\t\t\t\treturn members [0].DeclaringType;\n\t\t\t}\n\t\t}\n\n\t\tpublic IInstanceQualifier InstanceQualifier {\n\t\t\tget {\n\t\t\t\treturn instance_qualifier;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tinstance_qualifier = value;\n\t\t\t}\n\t\t}\n\n\t\tbool IsProbingOnly {\n\t\t\tget {\n\t\t\t\treturn (restrictions & Restrictions.ProbingOnly) != 0;\n\t\t\t}\n\t\t}\n\n\t\tbool IsDelegateInvoke {\n\t\t\tget {\n\t\t\t\treturn (restrictions & Restrictions.DelegateInvoke) != 0;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t//\n\t\t//  7.4.3.3  Better conversion from expression\n\t\t//  Returns :   1    if a->p is better,\n\t\t//              2    if a->q is better,\n\t\t//              0 if neither is better\n\t\t//\n\t\tstatic int BetterExpressionConversion (ResolveContext ec, Argument a, TypeSpec p, TypeSpec q)\n\t\t{\n\t\t\tTypeSpec argument_type = a.Type;\n\n\t\t\t//\n\t\t\t// If argument is an anonymous function\n\t\t\t//\n\t\t\tif (argument_type == InternalType.AnonymousMethod && ec.Module.Compiler.Settings.Version > LanguageVersion.ISO_2) {\n\t\t\t\t//\n\t\t\t\t// p and q are delegate types or expression tree types\n\t\t\t\t//\n\t\t\t\tif (p.IsExpressionTreeType || q.IsExpressionTreeType) {\n\t\t\t\t\tif (q.MemberDefinition != p.MemberDefinition) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Uwrap delegate from Expression<T>\n\t\t\t\t\t//\n\t\t\t\t\tq = TypeManager.GetTypeArguments (q)[0];\n\t\t\t\t\tp = TypeManager.GetTypeArguments (p)[0];\n\t\t\t\t}\n\n\t\t\t\tvar p_m = Delegate.GetInvokeMethod (p);\n\t\t\t\tvar q_m = Delegate.GetInvokeMethod (q);\n\n\t\t\t\t//\n\t\t\t\t// With identical parameter lists\n\t\t\t\t//\n\t\t\t\tif (!TypeSpecComparer.Equals (p_m.Parameters.Types, q_m.Parameters.Types))\n\t\t\t\t\treturn 0;\n\n\t\t\t\tp = p_m.ReturnType;\n\t\t\t\tvar orig_q = q;\n\t\t\t\tq = q_m.ReturnType;\n\n\t\t\t\t//\n\t\t\t\t// if p is void returning, and q has a return type Y, then C2 is the better conversion.\n\t\t\t\t//\n\t\t\t\tif (p.Kind == MemberKind.Void) {\n\t\t\t\t\treturn q.Kind != MemberKind.Void ? 2 : 0;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// if p has a return type Y, and q is void returning, then C1 is the better conversion.\n\t\t\t\t//\n\t\t\t\tif (q.Kind == MemberKind.Void) {\n\t\t\t\t\treturn p.Kind != MemberKind.Void ? 1: 0;\n\t\t\t\t}\n\n\t\t\t\tvar am = (AnonymousMethodExpression) a.Expr;\n\n\t\t\t\t//\n\t\t\t\t// When anonymous method is an asynchronous, and P has a return type Task<Y1>, and Q has a return type Task<Y2>\n\t\t\t\t// better conversion is performed between underlying types Y1 and Y2\n\t\t\t\t//\n\t\t\t\tif (p.IsGenericTask || q.IsGenericTask) {\n\t\t\t\t\tif (am.Block.IsAsync && p.IsGenericTask && q.IsGenericTask) {\n\t\t\t\t\t\tq = q.TypeArguments[0];\n\t\t\t\t\t\tp = p.TypeArguments[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (q != p) {\n\t\t\t\t\t//\n\t\t\t\t\t// An inferred return type X exists for E in the context of that parameter list, and \n\t\t\t\t\t// the conversion from X to Y1 is better than the conversion from X to Y2\n\t\t\t\t\t//\n\t\t\t\t\targument_type = am.InferReturnType (ec, null, orig_q);\n\t\t\t\t\tif (argument_type == null) {\n\t\t\t\t\t\t// TODO: Can this be hit?\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (argument_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\t\targument_type = ec.BuiltinTypes.Object;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (argument_type == p)\n\t\t\t\treturn 1;\n\n\t\t\tif (argument_type == q)\n\t\t\t\treturn 2;\n\n\t\t\t//\n\t\t\t// The parameters are identicial and return type is not void, use better type conversion\n\t\t\t// on return type to determine better one\n\t\t\t//\n\t\t\treturn BetterTypeConversion (ec, p, q);\n\t\t}\n\n\t\t//\n\t\t// 7.4.3.4  Better conversion from type\n\t\t//\n\t\tpublic static int BetterTypeConversion (ResolveContext ec, TypeSpec p, TypeSpec q)\n\t\t{\n\t\t\tif (p == null || q == null)\n\t\t\t\tthrow new InternalErrorException (\"BetterTypeConversion got a null conversion\");\n\n\t\t\tswitch (p.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (q.BuiltinType == BuiltinTypeSpec.Type.UInt || q.BuiltinType == BuiltinTypeSpec.Type.ULong)\n\t\t\t\t\treturn 1;\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tif (q.BuiltinType == BuiltinTypeSpec.Type.ULong)\n\t\t\t\t\treturn 1;\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tswitch (q.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tswitch (q.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t\t// Dynamic is never better\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\tswitch (q.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tif (p.BuiltinType == BuiltinTypeSpec.Type.UInt || p.BuiltinType == BuiltinTypeSpec.Type.ULong)\n\t\t\t\t\treturn 2;\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tif (p.BuiltinType == BuiltinTypeSpec.Type.ULong)\n\t\t\t\t\treturn 2;\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tswitch (p.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tswitch (p.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn 2;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t\t// Dynamic is never better\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// FIXME: handle lifted operators\n\n\t\t\t// TODO: this is expensive\n\t\t\tExpression p_tmp = new EmptyExpression (p);\n\t\t\tExpression q_tmp = new EmptyExpression (q);\n\n\t\t\tbool p_to_q = Convert.ImplicitConversionExists (ec, p_tmp, q);\n\t\t\tbool q_to_p = Convert.ImplicitConversionExists (ec, q_tmp, p);\n\n\t\t\tif (p_to_q && !q_to_p)\n\t\t\t\treturn 1;\n\n\t\t\tif (q_to_p && !p_to_q)\n\t\t\t\treturn 2;\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Determines \"Better function\" between candidate\n\t\t///   and the current best match\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///    Returns a boolean indicating :\n\t\t///     false if candidate ain't better\n\t\t///     true  if candidate is better than the current best match\n\t\t/// </remarks>\n\t\tstatic bool BetterFunction (ResolveContext ec, Arguments args, MemberSpec candidate, AParametersCollection cparam, bool candidate_params,\n\t\t\tMemberSpec best, AParametersCollection bparam, bool best_params)\n\t\t{\n\t\t\tAParametersCollection candidate_pd = ((IParametersMember) candidate).Parameters;\n\t\t\tAParametersCollection best_pd = ((IParametersMember) best).Parameters;\n\n\t\t\tbool better_at_least_one = false;\n\t\t\tbool are_equivalent = true;\n\t\t\tint args_count = args == null ? 0 : args.Count;\n\t\t\tint j = 0;\n\t\t\tArgument a = null;\n\t\t\tTypeSpec ct, bt;\n\t\t\tfor (int c_idx = 0, b_idx = 0; j < args_count; ++j, ++c_idx, ++b_idx) {\n\t\t\t\ta = args[j];\n\n\t\t\t\t// Default arguments are ignored for better decision\n\t\t\t\tif (a.IsDefaultArgument)\n\t\t\t\t\tbreak;\n\n\t\t\t\t//\n\t\t\t\t// When comparing named argument the parameter type index has to be looked up\n\t\t\t\t// in original parameter set (override version for virtual members)\n\t\t\t\t//\n\t\t\t\tNamedArgument na = a as NamedArgument;\n\t\t\t\tif (na != null) {\n\t\t\t\t\tint idx = cparam.GetParameterIndexByName (na.Name);\n\t\t\t\t\tct = candidate_pd.Types[idx];\n\t\t\t\t\tif (candidate_params && candidate_pd.FixedParameters[idx].ModFlags == Parameter.Modifier.PARAMS)\n\t\t\t\t\t\tct = TypeManager.GetElementType (ct);\n\n\t\t\t\t\tidx = bparam.GetParameterIndexByName (na.Name);\n\t\t\t\t\tbt = best_pd.Types[idx];\n\t\t\t\t\tif (best_params && best_pd.FixedParameters[idx].ModFlags == Parameter.Modifier.PARAMS)\n\t\t\t\t\t\tbt = TypeManager.GetElementType (bt);\n\t\t\t\t} else {\n\t\t\t\t\tct = candidate_pd.Types[c_idx];\n\t\t\t\t\tbt = best_pd.Types[b_idx];\n\n\t\t\t\t\tif (candidate_params && candidate_pd.FixedParameters[c_idx].ModFlags == Parameter.Modifier.PARAMS) {\n\t\t\t\t\t\tct = TypeManager.GetElementType (ct);\n\t\t\t\t\t\t--c_idx;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (best_params && best_pd.FixedParameters[b_idx].ModFlags == Parameter.Modifier.PARAMS) {\n\t\t\t\t\t\tbt = TypeManager.GetElementType (bt);\n\t\t\t\t\t\t--b_idx;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (TypeSpecComparer.IsEqual (ct, bt))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tare_equivalent = false;\n\t\t\t\tint result = BetterExpressionConversion (ec, a, ct, bt);\n\n\t\t\t\t// for each argument, the conversion to 'ct' should be no worse than \n\t\t\t\t// the conversion to 'bt'.\n\t\t\t\tif (result == 2)\n\t\t\t\t\treturn false;\n\n\t\t\t\t// for at least one argument, the conversion to 'ct' should be better than \n\t\t\t\t// the conversion to 'bt'.\n\t\t\t\tif (result != 0)\n\t\t\t\t\tbetter_at_least_one = true;\n\t\t\t}\n\n\t\t\tif (better_at_least_one)\n\t\t\t\treturn true;\n\n\t\t\t//\n\t\t\t// Tie-breaking rules are applied only for equivalent parameter types\n\t\t\t//\n\t\t\tif (!are_equivalent)\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// If candidate is applicable in its normal form and best has a params array and is applicable\n\t\t\t// only in its expanded form, then candidate is better\n\t\t\t//\n\t\t\tif (candidate_params != best_params)\n\t\t\t\treturn !candidate_params;\n\n\t\t\t//\n\t\t\t// We have not reached end of parameters list due to params or used default parameters\n\t\t\t//\n\t\t\twhile (j < candidate_pd.Count && j < best_pd.Count) {\n\t\t\t\tvar cand_param = candidate_pd.FixedParameters [j];\n\t\t\t\tvar best_param = best_pd.FixedParameters [j];\n\n\t\t\t\tif (candidate_pd.Count == best_pd.Count) {\n\t\t\t\t\t//\n\t\t\t\t\t// LAMESPEC:\n\t\t\t\t\t//\n\t\t\t\t\t// void Foo (int i = 0) is better than void Foo (params int[]) for Foo ()\n\t\t\t\t\t// void Foo (string[] s, string value = null) is better than Foo (string s, params string[]) for Foo (null) or Foo ()\n\t\t\t\t\t//\n\t\t\t\t\tif (cand_param.HasDefaultValue != best_param.HasDefaultValue)\n\t\t\t\t\t\treturn cand_param.HasDefaultValue;\n\n\t\t\t\t\tif (cand_param.HasDefaultValue) {\n\t\t\t\t\t\t++j;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// Neither is better when not all arguments are provided\n\t\t\t\t\t//\n\t\t\t\t\t// void Foo (string s, int i = 0) <-> Foo (string s, int i = 0, int i2 = 0)\n\t\t\t\t\t// void Foo (string s, int i = 0) <-> Foo (string s, byte i = 0)\n\t\t\t\t\t// void Foo (string s, params int[]) <-> Foo (string s, params byte[])\n\t\t\t\t\t//\n\t\t\t\t\tif (cand_param.HasDefaultValue && best_param.HasDefaultValue)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (candidate_pd.Count != best_pd.Count)\n\t\t\t\treturn candidate_pd.Count < best_pd.Count;\n\n\t\t\t//\n\t\t\t// One is a non-generic method and second is a generic method, then non-generic is better\n\t\t\t//\n\t\t\tif (best.IsGeneric != candidate.IsGeneric)\n\t\t\t\treturn best.IsGeneric;\n\n\t\t\t//\n\t\t\t// Both methods have the same number of parameters, and the parameters have equal types\n\t\t\t// Pick the \"more specific\" signature using rules over original (non-inflated) types\n\t\t\t//\n\t\t\tvar candidate_def_pd = ((IParametersMember) candidate.MemberDefinition).Parameters;\n\t\t\tvar best_def_pd = ((IParametersMember) best.MemberDefinition).Parameters;\n\n\t\t\tbool specific_at_least_once = false;\n\t\t\tfor (j = 0; j < args_count; ++j) {\n\t\t\t\tNamedArgument na = args_count == 0 ? null : args [j] as NamedArgument;\n\t\t\t\tif (na != null) {\n\t\t\t\t\tct = candidate_def_pd.Types[cparam.GetParameterIndexByName (na.Name)];\n\t\t\t\t\tbt = best_def_pd.Types[bparam.GetParameterIndexByName (na.Name)];\n\t\t\t\t} else {\n\t\t\t\t\tct = candidate_def_pd.Types[j];\n\t\t\t\t\tbt = best_def_pd.Types[j];\n\t\t\t\t}\n\n\t\t\t\tif (ct == bt)\n\t\t\t\t\tcontinue;\n\t\t\t\tTypeSpec specific = MoreSpecific (ct, bt);\n\t\t\t\tif (specific == bt)\n\t\t\t\t\treturn false;\n\t\t\t\tif (specific == ct)\n\t\t\t\t\tspecific_at_least_once = true;\n\t\t\t}\n\n\t\t\tif (specific_at_least_once)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic bool CheckInflatedArguments (MethodSpec ms)\n\t\t{\n\t\t\tif (!TypeParameterSpec.HasAnyTypeParameterTypeConstrained (ms.GenericDefinition))\n\t\t\t\treturn true;\n\n\t\t\t// Setup constraint checker for probing only\n\t\t\tConstraintChecker cc = new ConstraintChecker (null);\n\n\t\t\tvar mp = ms.Parameters.Types;\n\t\t\tfor (int i = 0; i < mp.Length; ++i) {\n\t\t\t\tvar type = mp[i] as InflatedTypeSpec;\n\t\t\t\tif (type == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar targs = type.TypeArguments;\n\t\t\t\tif (targs.Length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// TODO: Checking inflated MVAR arguments should be enough\n\t\t\t\tif (!cc.CheckAll (type.GetDefinition (), targs, type.Constraints, Location.Null))\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static void Error_ConstructorMismatch (ResolveContext rc, TypeSpec type, int argCount, Location loc)\n\t\t{\n\t\t\trc.Report.Error (1729, loc,\n\t\t\t\t\"The type `{0}' does not contain a constructor that takes `{1}' arguments\",\n\t\t\t\ttype.GetSignatureForError (), argCount.ToString ());\n\t\t}\n\n\t\t//\n\t\t// Determines if the candidate method is applicable to the given set of arguments\n\t\t// There could be two different set of parameters for same candidate where one\n\t\t// is the closest override for default values and named arguments checks and second\n\t\t// one being the virtual base for the parameter types and modifiers.\n\t\t//\n\t\t// A return value rates candidate method compatibility,\n\t\t// 0 = the best, int.MaxValue = the worst\n\t\t// -1 = fatal error\n\t\t//\n\t\tint IsApplicable (ResolveContext ec, ref Arguments arguments, int arg_count, ref MemberSpec candidate, IParametersMember pm, ref bool params_expanded_form, ref bool dynamicArgument, ref TypeSpec returnType, bool errorMode)\n\t\t{\n\t\t\t// Parameters of most-derived type used mainly for named and optional parameters\n\t\t\tvar pd = pm.Parameters;\n\n\t\t\t// Used for params modifier only, that's legacy of C# 1.0 which uses base type for\n\t\t\t// params modifier instead of most-derived type\n\t\t\tvar cpd = ((IParametersMember) candidate).Parameters;\n\t\t\tint param_count = pd.Count;\n\t\t\tint optional_count = 0;\n\t\t\tint score;\n\t\t\tArguments orig_args = arguments;\n\n\t\t\tif (arg_count != param_count) {\n\t\t\t\t//\n\t\t\t\t// No arguments expansion when doing exact match for delegates\n\t\t\t\t//\n\t\t\t\tif ((restrictions & Restrictions.CovariantDelegate) == 0) {\n\t\t\t\t\tfor (int i = 0; i < pd.Count; ++i) {\n\t\t\t\t\t\tif (pd.FixedParameters[i].HasDefaultValue) {\n\t\t\t\t\t\t\toptional_count = pd.Count - i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (optional_count != 0) {\n\t\t\t\t\t// Readjust expected number when params used\n\t\t\t\t\tif (cpd.HasParams) {\n\t\t\t\t\t\toptional_count--;\n\t\t\t\t\t\tif (arg_count < param_count)\n\t\t\t\t\t\t\tparam_count--;\n\t\t\t\t\t} else if (arg_count > param_count) {\n\t\t\t\t\t\tint args_gap = System.Math.Abs (arg_count - param_count);\n\t\t\t\t\t\treturn int.MaxValue - 10000 + args_gap;\n\t\t\t\t\t} else if (arg_count < param_count - optional_count) {\n\t\t\t\t\t\tint args_gap = System.Math.Abs (param_count - optional_count - arg_count);\n\t\t\t\t\t\treturn int.MaxValue - 10000 + args_gap;\n\t\t\t\t\t}\n\t\t\t\t} else if (arg_count != param_count) {\n\t\t\t\t\tint args_gap = System.Math.Abs (arg_count - param_count);\n\t\t\t\t\tif (!cpd.HasParams)\n\t\t\t\t\t\treturn int.MaxValue - 10000 + args_gap;\n\t\t\t\t\tif (arg_count < param_count - 1)\n\t\t\t\t\t\treturn int.MaxValue - 10000 + args_gap;\n\t\t\t\t}\n\n\t\t\t\t// Resize to fit optional arguments\n\t\t\t\tif (optional_count != 0) {\n\t\t\t\t\tif (arguments == null) {\n\t\t\t\t\t\targuments = new Arguments (optional_count);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Have to create a new container, so the next run can do same\n\t\t\t\t\t\tvar resized = new Arguments (param_count);\n\t\t\t\t\t\tresized.AddRange (arguments);\n\t\t\t\t\t\targuments = resized;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = arg_count; i < param_count; ++i)\n\t\t\t\t\t\targuments.Add (null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (arg_count > 0) {\n\t\t\t\t//\n\t\t\t\t// Shuffle named arguments to the right positions if there are any\n\t\t\t\t//\n\t\t\t\tif (arguments[arg_count - 1] is NamedArgument) {\n\t\t\t\t\targ_count = arguments.Count;\n\n\t\t\t\t\tfor (int i = 0; i < arg_count; ++i) {\n\t\t\t\t\t\tbool arg_moved = false;\n\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\tNamedArgument na = arguments[i] as NamedArgument;\n\t\t\t\t\t\t\tif (na == null)\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tint index = pd.GetParameterIndexByName (na.Name);\n\n\t\t\t\t\t\t\t// Named parameter not found\n\t\t\t\t\t\t\tif (index < 0)\n\t\t\t\t\t\t\t\treturn (i + 1) * 3;\n\n\t\t\t\t\t\t\t// already reordered\n\t\t\t\t\t\t\tif (index == i)\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tArgument temp;\n\t\t\t\t\t\t\tif (index >= param_count) {\n\t\t\t\t\t\t\t\t// When using parameters which should not be available to the user\n\t\t\t\t\t\t\t\tif ((cpd.FixedParameters[index].ModFlags & Parameter.Modifier.PARAMS) == 0)\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\targuments.Add (null);\n\t\t\t\t\t\t\t\t++arg_count;\n\t\t\t\t\t\t\t\ttemp = null;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (index == arg_count) \n\t\t\t\t\t\t\t\t\treturn (i + 1) * 3;\n\n\t\t\t\t\t\t\t\ttemp = arguments [index];\n\n\t\t\t\t\t\t\t\t// The slot has been taken by positional argument\n\t\t\t\t\t\t\t\tif (temp != null && !(temp is NamedArgument))\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!arg_moved) {\n\t\t\t\t\t\t\t\targuments = arguments.MarkOrderedArgument (na);\n\t\t\t\t\t\t\t\targ_moved = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (arguments == orig_args) {\n\t\t\t\t\t\t\t\targuments = new Arguments (orig_args.Count);\n\t\t\t\t\t\t\t\targuments.AddRange (orig_args);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\targuments[index] = arguments[i];\n\t\t\t\t\t\t\targuments[i] = temp;\n\n\t\t\t\t\t\t\tif (temp == null)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\targ_count = arguments.Count;\n\t\t\t\t}\n\t\t\t} else if (arguments != null) {\n\t\t\t\targ_count = arguments.Count;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Don't do any expensive checks when the candidate cannot succeed\n\t\t\t//\n\t\t\tif (arg_count != param_count && !cpd.HasParams)\n\t\t\t\treturn (param_count - arg_count) * 2 + 1;\n\n\t\t\tvar dep = candidate.GetMissingDependencies ();\n\t\t\tif (dep != null) {\n\t\t\t\tImportedTypeDefinition.Error_MissingDependency (ec, dep, loc);\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// 1. Handle generic method using type arguments when specified or type inference\n\t\t\t//\n\t\t\tTypeSpec[] ptypes;\n\t\t\tvar ms = candidate as MethodSpec;\n\t\t\tif (ms != null && ms.IsGeneric) {\n\t\t\t\tif (type_arguments != null) {\n\t\t\t\t\tvar g_args_count = ms.Arity;\n\t\t\t\t\tif (g_args_count != type_arguments.Count)\n\t\t\t\t\t\treturn int.MaxValue - 20000 + System.Math.Abs (type_arguments.Count - g_args_count);\n\n\t\t\t\t\tif (type_arguments.Arguments != null)\n\t\t\t\t\t\tms = ms.MakeGenericMethod (ec, type_arguments.Arguments);\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// Deploy custom error reporting for infered anonymous expression or lambda methods. When\n\t\t\t\t\t// probing lambda methods keep all errors reported in separate set and once we are done and no best\n\t\t\t\t\t// candidate was found use the set to report more details about what was wrong with lambda body.\n\t\t\t\t\t// The general idea is to distinguish between code errors and errors caused by\n\t\t\t\t\t// trial-and-error type inference\n\t\t\t\t\t//\n\t\t\t\t\tif (lambda_conv_msgs == null) {\n\t\t\t\t\t\tfor (int i = 0; i < arg_count; i++) {\n\t\t\t\t\t\t\tArgument a = arguments[i];\n\t\t\t\t\t\t\tif (a == null)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tvar am = a.Expr as AnonymousMethodExpression;\n\t\t\t\t\t\t\tif (am != null) {\n\t\t\t\t\t\t\t\tif (lambda_conv_msgs == null)\n\t\t\t\t\t\t\t\t\tlambda_conv_msgs = new SessionReportPrinter ();\n\n\t\t\t\t\t\t\t\tam.TypeInferenceReportPrinter = lambda_conv_msgs;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar ti = new TypeInference (arguments);\n\t\t\t\t\tTypeSpec[] i_args = ti.InferMethodArguments (ec, ms);\n\n\t\t\t\t\tif (i_args == null)\n\t\t\t\t\t\treturn ti.InferenceScore - 20000;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Clear any error messages when the result was success\n\t\t\t\t\t//\n\t\t\t\t\tif (lambda_conv_msgs != null)\n\t\t\t\t\t\tlambda_conv_msgs.ClearSession ();\n\n\t\t\t\t\tif (i_args.Length != 0) {\n\t\t\t\t\t\tif (!errorMode) {\n\t\t\t\t\t\t\tforeach (var ta in i_args) {\n\t\t\t\t\t\t\t\tif (!ta.IsAccessible (ec))\n\t\t\t\t\t\t\t\t\treturn ti.InferenceScore - 10000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tms = ms.MakeGenericMethod (ec, i_args);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Type arguments constraints have to match for the method to be applicable\n\t\t\t\t//\n\t\t\t\tif (!CheckInflatedArguments (ms)) {\n\t\t\t\t\tcandidate = ms;\n\t\t\t\t\treturn int.MaxValue - 25000;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// We have a generic return type and at same time the method is override which\n\t\t\t\t// means we have to also inflate override return type in case the candidate is\n\t\t\t\t// best candidate and override return type is different to base return type.\n\t\t\t\t// \n\t\t\t\t// virtual Foo<T, object> with override Foo<T, dynamic>\n\t\t\t\t//\n\t\t\t\tif (candidate != pm) {\n\t\t\t\t\tMethodSpec override_ms = (MethodSpec) pm;\n\t\t\t\t\tvar inflator = new TypeParameterInflator (ec, ms.DeclaringType, override_ms.GenericDefinition.TypeParameters, ms.TypeArguments);\n\t\t\t\t\treturnType = inflator.Inflate (returnType);\n\t\t\t\t} else {\n\t\t\t\t\treturnType = ms.ReturnType;\n\t\t\t\t}\n\n\t\t\t\tcandidate = ms;\n\t\t\t\tpd = ms.Parameters;\n\t\t\t\tptypes = pd.Types;\n\t\t\t} else {\n\t\t\t\tif (type_arguments != null)\n\t\t\t\t\treturn int.MaxValue - 15000;\n\n\t\t\t\tptypes = cpd.Types;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// 2. Each argument has to be implicitly convertible to method parameter\n\t\t\t//\n\t\t\tParameter.Modifier p_mod = 0;\n\t\t\tTypeSpec pt = null;\n\n\t\t\tfor (int i = 0; i < arg_count; i++) {\n\t\t\t\tArgument a = arguments[i];\n\t\t\t\tif (a == null) {\n\t\t\t\t\tvar fp = pd.FixedParameters[i];\n\t\t\t\t\tif (!fp.HasDefaultValue) {\n\t\t\t\t\t\targuments = orig_args;\n\t\t\t\t\t\treturn arg_count * 2 + 2;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Get the default value expression, we can use the same expression\n\t\t\t\t\t// if the type matches\n\t\t\t\t\t//\n\t\t\t\t\tExpression e = fp.DefaultValue;\n\t\t\t\t\tif (e != null) {\n\t\t\t\t\t\te = ResolveDefaultValueArgument (ec, ptypes[i], e, loc);\n\t\t\t\t\t\tif (e == null) {\n\t\t\t\t\t\t\t// Restore for possible error reporting\n\t\t\t\t\t\t\tfor (int ii = i; ii < arg_count; ++ii)\n\t\t\t\t\t\t\t\targuments.RemoveAt (i);\n\n\t\t\t\t\t\t\treturn (arg_count - i) * 2 + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((fp.ModFlags & Parameter.Modifier.CallerMask) != 0) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// LAMESPEC: Attributes can be mixed together with build-in priority\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((fp.ModFlags & Parameter.Modifier.CallerLineNumber) != 0) {\n\t\t\t\t\t\t\te = new IntLiteral (ec.BuiltinTypes, loc.Row, loc);\n\t\t\t\t\t\t} else if ((fp.ModFlags & Parameter.Modifier.CallerFilePath) != 0) {\n\t\t\t\t\t\t\te = new StringLiteral (ec.BuiltinTypes, loc.NameFullPath, loc);\n\t\t\t\t\t\t} else if (ec.MemberContext.CurrentMemberDefinition != null) {\n\t\t\t\t\t\t\te = new StringLiteral (ec.BuiltinTypes, ec.MemberContext.CurrentMemberDefinition.GetCallerMemberName (), loc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\targuments[i] = new Argument (e, Argument.AType.Default);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (p_mod != Parameter.Modifier.PARAMS) {\n\t\t\t\t\tp_mod = (pd.FixedParameters[i].ModFlags & ~Parameter.Modifier.PARAMS) | (cpd.FixedParameters[i].ModFlags & Parameter.Modifier.PARAMS);\n\t\t\t\t\tpt = ptypes [i];\n\t\t\t\t} else if (!params_expanded_form) {\n\t\t\t\t\tparams_expanded_form = true;\n\t\t\t\t\tpt = ((ElementTypeSpec) pt).Element;\n\t\t\t\t\ti -= 2;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tscore = 1;\n\t\t\t\tif (!params_expanded_form) {\n\t\t\t\t\tif (a.IsExtensionType) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Indentity, implicit reference or boxing conversion must exist for the extension parameter\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// LAMESPEC: or implicit type parameter conversion\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar at = a.Type;\n\t\t\t\t\t\tif (at == pt || TypeSpecComparer.IsEqual (at, pt) ||\n\t\t\t\t\t\t\tConvert.ImplicitReferenceConversionExists (at, pt, false) ||\n\t\t\t\t\t\t\tConvert.ImplicitBoxingConversion (null, at, pt) != null) {\n\t\t\t\t\t\t\tscore = 0;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscore = IsArgumentCompatible (ec, a, p_mod, pt);\n\n\t\t\t\t\t\tif (score < 0)\n\t\t\t\t\t\t\tdynamicArgument = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// It can be applicable in expanded form (when not doing exact match like for delegates)\n\t\t\t\t//\n\t\t\t\tif (score != 0 && (p_mod & Parameter.Modifier.PARAMS) != 0 && (restrictions & Restrictions.CovariantDelegate) == 0) {\n\t\t\t\t\tif (!params_expanded_form) {\n\t\t\t\t\t\tpt = ((ElementTypeSpec) pt).Element;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (score > 0)\n\t\t\t\t\t\tscore = IsArgumentCompatible (ec, a, Parameter.Modifier.NONE, pt);\n\n\t\t\t\t\tif (score < 0) {\n\t\t\t\t\t\tparams_expanded_form = true;\n\t\t\t\t\t\tdynamicArgument = true;\n\t\t\t\t\t} else if (score == 0 || arg_count > pd.Count) {\n\t\t\t\t\t\tparams_expanded_form = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (score > 0) {\n\t\t\t\t\tif (params_expanded_form)\n\t\t\t\t\t\t++score;\n\t\t\t\t\treturn (arg_count - i) * 2 + score;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Restore original arguments for dynamic binder to keep the intention of original source code\n\t\t\t//\n\t\t\tif (dynamicArgument)\n\t\t\t\targuments = orig_args;\n\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic static Expression ResolveDefaultValueArgument (ResolveContext ec, TypeSpec ptype, Expression e, Location loc)\n\t\t{\n\t\t\tif (e is Constant && e.Type == ptype)\n\t\t\t\treturn e;\n\n\t\t\t//\n\t\t\t// LAMESPEC: No idea what the exact rules are for System.Reflection.Missing.Value instead of null\n\t\t\t//\n\t\t\tif (e == EmptyExpression.MissingValue && ptype.BuiltinType == BuiltinTypeSpec.Type.Object || ptype.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\te = new MemberAccess (new MemberAccess (new MemberAccess (\n\t\t\t\t\tnew QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, \"System\", loc), \"Reflection\", loc), \"Missing\", loc), \"Value\", loc);\n\t\t\t} else if (e is Constant) {\n\t\t\t\t//\n\t\t\t\t// Handles int to int? conversions, DefaultParameterValue check\n\t\t\t\t//\n\t\t\t\te = Convert.ImplicitConversionStandard (ec, e, ptype, loc);\n\t\t\t\tif (e == null)\n\t\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\te = new DefaultValueExpression (new TypeExpression (ptype, loc), loc);\n\t\t\t}\n\n\t\t\treturn e.Resolve (ec);\n\t\t}\n\n\t\t//\n\t\t// Tests argument compatibility with the parameter\n\t\t// The possible return values are\n\t\t// 0 - success\n\t\t// 1 - modifier mismatch\n\t\t// 2 - type mismatch\n\t\t// -1 - dynamic binding required\n\t\t//\n\t\tint IsArgumentCompatible (ResolveContext ec, Argument argument, Parameter.Modifier param_mod, TypeSpec parameter)\n\t\t{\n\t\t\t//\n\t\t\t// Types have to be identical when ref or out modifer\n\t\t\t// is used and argument is not of dynamic type\n\t\t\t//\n\t\t\tif (((argument.Modifier | param_mod) & Parameter.Modifier.RefOutMask) != 0) {\n\t\t\t\tif (argument.Type != parameter) {\n\t\t\t\t\t//\n\t\t\t\t\t// Do full equality check after quick path\n\t\t\t\t\t//\n\t\t\t\t\tif (!TypeSpecComparer.IsEqual (argument.Type, parameter)) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Using dynamic for ref/out parameter can still succeed at runtime\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (argument.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (argument.Modifier & Parameter.Modifier.RefOutMask) == 0 && (restrictions & Restrictions.CovariantDelegate) == 0)\n\t\t\t\t\t\t\treturn -1;\n\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((argument.Modifier & Parameter.Modifier.RefOutMask) != (param_mod & Parameter.Modifier.RefOutMask)) {\n\t\t\t\t\t//\n\t\t\t\t\t// Using dynamic for ref/out parameter can still succeed at runtime\n\t\t\t\t\t//\n\t\t\t\t\tif (argument.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (argument.Modifier & Parameter.Modifier.RefOutMask) == 0 && (restrictions & Restrictions.CovariantDelegate) == 0)\n\t\t\t\t\t\treturn -1;\n\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tif (argument.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (restrictions & Restrictions.CovariantDelegate) == 0)\n\t\t\t\t\treturn -1;\n\n\t\t\t\t//\n\t\t\t\t// Use implicit conversion in all modes to return same candidates when the expression\n\t\t\t\t// is used as argument or delegate conversion\n\t\t\t\t//\n\t\t\t\tif (!Convert.ImplicitConversionExists (ec, argument.Expr, parameter)) {\n\t\t\t\t\treturn parameter.IsDelegate && argument.Expr is AnonymousMethodExpression ? 2 : 3;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\tstatic TypeSpec MoreSpecific (TypeSpec p, TypeSpec q)\n\t\t{\n\t\t\tif (TypeManager.IsGenericParameter (p) && !TypeManager.IsGenericParameter (q))\n\t\t\t\treturn q;\n\t\t\tif (!TypeManager.IsGenericParameter (p) && TypeManager.IsGenericParameter (q))\n\t\t\t\treturn p;\n\n\t\t\tvar ac_p = p as ArrayContainer;\n\t\t\tif (ac_p != null) {\n\t\t\t\tvar ac_q = q as ArrayContainer;\n\t\t\t\tif (ac_q == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tTypeSpec specific = MoreSpecific (ac_p.Element, ac_q.Element);\n\t\t\t\tif (specific == ac_p.Element)\n\t\t\t\t\treturn p;\n\t\t\t\tif (specific == ac_q.Element)\n\t\t\t\t\treturn q;\n\t\t\t} else if (p.IsGeneric && q.IsGeneric) {\n\t\t\t\tvar pargs = TypeManager.GetTypeArguments (p);\n\t\t\t\tvar qargs = TypeManager.GetTypeArguments (q);\n\n\t\t\t\tbool p_specific_at_least_once = false;\n\t\t\t\tbool q_specific_at_least_once = false;\n\n\t\t\t\tfor (int i = 0; i < pargs.Length; i++) {\n\t\t\t\t\tTypeSpec specific = MoreSpecific (pargs[i], qargs[i]);\n\t\t\t\t\tif (specific == pargs[i])\n\t\t\t\t\t\tp_specific_at_least_once = true;\n\t\t\t\t\tif (specific == qargs[i])\n\t\t\t\t\t\tq_specific_at_least_once = true;\n\t\t\t\t}\n\n\t\t\t\tif (p_specific_at_least_once && !q_specific_at_least_once)\n\t\t\t\t\treturn p;\n\t\t\t\tif (!p_specific_at_least_once && q_specific_at_least_once)\n\t\t\t\t\treturn q;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Find the best method from candidate list\n\t\t//\n\t\tpublic T ResolveMember<T> (ResolveContext rc, ref Arguments args) where T : MemberSpec, IParametersMember\n\t\t{\n\t\t\tList<AmbiguousCandidate> ambiguous_candidates = null;\n\n\t\t\tMemberSpec best_candidate;\n\t\t\tArguments best_candidate_args = null;\n\t\t\tbool best_candidate_params = false;\n\t\t\tbool best_candidate_dynamic = false;\n\t\t\tint best_candidate_rate;\n\t\t\tIParametersMember best_parameter_member = null;\n\n\t\t\tint args_count = args != null ? args.Count : 0;\n\n\t\t\tArguments candidate_args = args;\n\t\t\tbool error_mode = false;\n\t\t\tMemberSpec invocable_member = null;\n\n\t\t\twhile (true) {\n\t\t\t\tbest_candidate = null;\n\t\t\t\tbest_candidate_rate = int.MaxValue;\n\n\t\t\t\tvar type_members = members;\n\t\t\t\tdo {\n\t\t\t\t\tfor (int i = 0; i < type_members.Count; ++i) {\n\t\t\t\t\t\tvar member = type_members[i];\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Methods in a base class are not candidates if any method in a derived\n\t\t\t\t\t\t// class is applicable\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((member.Modifiers & Modifiers.OVERRIDE) != 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!error_mode) {\n\t\t\t\t\t\t\tif (!member.IsAccessible (rc))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (rc.IsRuntimeBinder && !member.DeclaringType.IsAccessible (rc))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif ((member.Modifiers & (Modifiers.PROTECTED | Modifiers.STATIC)) == Modifiers.PROTECTED &&\n\t\t\t\t\t\t\t\tinstance_qualifier != null && !instance_qualifier.CheckProtectedMemberAccess (rc, member)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tIParametersMember pm = member as IParametersMember;\n\t\t\t\t\t\tif (pm == null) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Will use it later to report ambiguity between best method and invocable member\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tif (Invocation.IsMemberInvocable (member))\n\t\t\t\t\t\t\t\tinvocable_member = member;\n\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Overload resolution is looking for base member but using parameter names\n\t\t\t\t\t\t// and default values from the closest member. That means to do expensive lookup\n\t\t\t\t\t\t// for the closest override for virtual or abstract members\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((member.Modifiers & (Modifiers.VIRTUAL | Modifiers.ABSTRACT)) != 0) {\n\t\t\t\t\t\t\tvar override_params = base_provider.GetOverrideMemberParameters (member);\n\t\t\t\t\t\t\tif (override_params != null)\n\t\t\t\t\t\t\t\tpm = override_params;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Check if the member candidate is applicable\n\t\t\t\t\t\t//\n\t\t\t\t\t\tbool params_expanded_form = false;\n\t\t\t\t\t\tbool dynamic_argument = false;\n\t\t\t\t\t\tTypeSpec rt = pm.MemberType;\n\t\t\t\t\t\tint candidate_rate = IsApplicable (rc, ref candidate_args, args_count, ref member, pm, ref params_expanded_form, ref dynamic_argument, ref rt, error_mode);\n\n\t\t\t\t\t\tif (lambda_conv_msgs != null)\n\t\t\t\t\t\t\tlambda_conv_msgs.EndSession ();\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// How does it score compare to others\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (candidate_rate < best_candidate_rate) {\n\n\t\t\t\t\t\t\t// Fatal error (missing dependency), cannot continue\n\t\t\t\t\t\t\tif (candidate_rate < 0)\n\t\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t\tif ((restrictions & Restrictions.GetEnumeratorLookup) != 0 && candidate_args.Count != 0) {\n\t\t\t\t\t\t\t\t// Only parameterless methods are considered\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbest_candidate_rate = candidate_rate;\n\t\t\t\t\t\t\t\tbest_candidate = member;\n\t\t\t\t\t\t\t\tbest_candidate_args = candidate_args;\n\t\t\t\t\t\t\t\tbest_candidate_params = params_expanded_form;\n\t\t\t\t\t\t\t\tbest_candidate_dynamic = dynamic_argument;\n\t\t\t\t\t\t\t\tbest_parameter_member = pm;\n\t\t\t\t\t\t\t\tbest_candidate_return_type = rt;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (candidate_rate == 0) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// The member look is done per type for most operations but sometimes\n\t\t\t\t\t\t\t// it's not possible like for binary operators overload because they\n\t\t\t\t\t\t\t// are unioned between 2 sides\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tif ((restrictions & Restrictions.BaseMembersIncluded) != 0) {\n\t\t\t\t\t\t\t\tif (TypeSpec.IsBaseClass (best_candidate.DeclaringType, member.DeclaringType, true))\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbool is_better;\n\t\t\t\t\t\t\tif (best_candidate.DeclaringType.IsInterface && member.DeclaringType.ImplementsInterface (best_candidate.DeclaringType, false)) {\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t// We pack all interface members into top level type which makes the overload resolution\n\t\t\t\t\t\t\t\t// more complicated for interfaces. We compensate it by removing methods with same\n\t\t\t\t\t\t\t\t// signature when building the cache hence this path should not really be hit often\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t// Example:\n\t\t\t\t\t\t\t\t// interface IA { void Foo (int arg); }\n\t\t\t\t\t\t\t\t// interface IB : IA { void Foo (params int[] args); }\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t// IB::Foo is the best overload when calling IB.Foo (1)\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\tis_better = true;\n\t\t\t\t\t\t\t\tif (ambiguous_candidates != null) {\n\t\t\t\t\t\t\t\t\tforeach (var amb_cand in ambiguous_candidates) {\n\t\t\t\t\t\t\t\t\t\tif (member.DeclaringType.ImplementsInterface (best_candidate.DeclaringType, false)) {\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tis_better = false;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (is_better)\n\t\t\t\t\t\t\t\t\t\tambiguous_candidates = null;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Is the new candidate better\n\t\t\t\t\t\t\t\tis_better = BetterFunction (rc, candidate_args, member, pm.Parameters, params_expanded_form, best_candidate, best_parameter_member.Parameters, best_candidate_params);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (is_better) {\n\t\t\t\t\t\t\t\tbest_candidate = member;\n\t\t\t\t\t\t\t\tbest_candidate_args = candidate_args;\n\t\t\t\t\t\t\t\tbest_candidate_params = params_expanded_form;\n\t\t\t\t\t\t\t\tbest_candidate_dynamic = dynamic_argument;\n\t\t\t\t\t\t\t\tbest_parameter_member = pm;\n\t\t\t\t\t\t\t\tbest_candidate_return_type = rt;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// It's not better but any other found later could be but we are not sure yet\n\t\t\t\t\t\t\t\tif (ambiguous_candidates == null)\n\t\t\t\t\t\t\t\t\tambiguous_candidates = new List<AmbiguousCandidate> ();\n\n\t\t\t\t\t\t\t\tambiguous_candidates.Add (new AmbiguousCandidate (member, pm.Parameters, params_expanded_form));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Restore expanded arguments\n\t\t\t\t\t\tcandidate_args = args;\n\t\t\t\t\t}\n\t\t\t\t} while (best_candidate_rate != 0 && (type_members = base_provider.GetBaseMembers (type_members[0].DeclaringType.BaseType)) != null);\n\n\t\t\t\t//\n\t\t\t\t// We've found exact match\n\t\t\t\t//\n\t\t\t\tif (best_candidate_rate == 0)\n\t\t\t\t\tbreak;\n\n\t\t\t\t//\n\t\t\t\t// Try extension methods lookup when no ordinary method match was found and provider enables it\n\t\t\t\t//\n\t\t\t\tif (!error_mode) {\n\t\t\t\t\tvar emg = base_provider.LookupExtensionMethod (rc);\n\t\t\t\t\tif (emg != null) {\n\t\t\t\t\t\temg = emg.OverloadResolve (rc, ref args, null, restrictions);\n\t\t\t\t\t\tif (emg != null) {\n\t\t\t\t\t\t\tbest_candidate_extension_group = emg;\n\t\t\t\t\t\t\treturn (T) (MemberSpec) emg.BestCandidate;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't run expensive error reporting mode for probing\n\t\t\t\tif (IsProbingOnly)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (error_mode)\n\t\t\t\t\tbreak;\n\n\t\t\t\tif (lambda_conv_msgs != null && !lambda_conv_msgs.IsEmpty)\n\t\t\t\t\tbreak;\n\n\t\t\t\tlambda_conv_msgs = null;\n\t\t\t\terror_mode = true;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// No best member match found, report an error\n\t\t\t//\n\t\t\tif (best_candidate_rate != 0 || error_mode) {\n\t\t\t\tReportOverloadError (rc, best_candidate, best_parameter_member, best_candidate_args, best_candidate_params);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (best_candidate_dynamic) {\n\t\t\t\tif (args[0].IsExtensionType) {\n\t\t\t\t\trc.Report.Error (1973, loc,\n\t\t\t\t\t\t\"Type `{0}' does not contain a member `{1}' and the best extension method overload `{2}' cannot be dynamically dispatched. Consider calling the method without the extension method syntax\",\n\t\t\t\t\t\targs [0].Type.GetSignatureForError (), best_candidate.Name, best_candidate.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Check type constraints only when explicit type arguments are used\n\t\t\t\t//\n\t\t\t\tif (best_candidate.IsGeneric && type_arguments != null) {\n\t\t\t\t\tMethodSpec bc = best_candidate as MethodSpec;\n\t\t\t\t\tif (bc != null && TypeParameterSpec.HasAnyTypeParameterConstrained (bc.GenericDefinition)) {\n\t\t\t\t\t\tConstraintChecker cc = new ConstraintChecker (rc);\n\t\t\t\t\t\tcc.CheckAll (bc.GetGenericMethodDefinition (), bc.TypeArguments, bc.Constraints, loc);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tBestCandidateIsDynamic = true;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// These flags indicates we are running delegate probing conversion. No need to\n\t\t\t// do more expensive checks\n\t\t\t// \n\t\t\tif ((restrictions & (Restrictions.ProbingOnly | Restrictions.CovariantDelegate)) == (Restrictions.CovariantDelegate | Restrictions.ProbingOnly))\n\t\t\t\treturn (T) best_candidate;\n\n\t\t\tif (ambiguous_candidates != null) {\n\t\t\t\t//\n\t\t\t\t// Now check that there are no ambiguities i.e the selected method\n\t\t\t\t// should be better than all the others\n\t\t\t\t//\n\t\t\t\tfor (int ix = 0; ix < ambiguous_candidates.Count; ix++) {\n\t\t\t\t\tvar candidate = ambiguous_candidates [ix];\n\n\t\t\t\t\tif (!BetterFunction (rc, best_candidate_args, best_candidate, best_parameter_member.Parameters, best_candidate_params, candidate.Member, candidate.Parameters, candidate.Expanded)) {\n\t\t\t\t\t\tvar ambiguous = candidate.Member;\n\t\t\t\t\t\tif (custom_errors == null || !custom_errors.AmbiguousCandidates (rc, best_candidate, ambiguous)) {\n\t\t\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (ambiguous);\n\t\t\t\t\t\t\trc.Report.Error (121, loc, \"The call is ambiguous between the following methods or properties: `{0}' and `{1}'\",\n\t\t\t\t\t\t\t\tbest_candidate.GetSignatureForError (), ambiguous.GetSignatureForError ());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (T) best_candidate;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (invocable_member != null && !IsProbingOnly) {\n\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\t\trc.Report.SymbolRelatedToPreviousError (invocable_member);\n\t\t\t\trc.Report.Warning (467, 2, loc, \"Ambiguity between method `{0}' and invocable non-method `{1}'. Using method group\",\n\t\t\t\t\tbest_candidate.GetSignatureForError (), invocable_member.GetSignatureForError ());\n\t\t\t}\n\n\t\t\t//\n\t\t\t// And now check if the arguments are all\n\t\t\t// compatible, perform conversions if\n\t\t\t// necessary etc. and return if everything is\n\t\t\t// all right\n\t\t\t//\n\t\t\tif (!VerifyArguments (rc, ref best_candidate_args, best_candidate, best_parameter_member, best_candidate_params))\n\t\t\t\treturn null;\n\n\t\t\tif (best_candidate == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Don't run possibly expensive checks in probing mode\n\t\t\t//\n\t\t\tif (!IsProbingOnly && !rc.IsInProbingMode) {\n\t\t\t\t//\n\t\t\t\t// Check ObsoleteAttribute on the best method\n\t\t\t\t//\n\t\t\t\tObsoleteAttribute oa = best_candidate.GetAttributeObsolete ();\n\t\t\t\tif (oa != null && !rc.IsObsolete)\n\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, best_candidate.GetSignatureForError (), loc, rc.Report);\n\n\t\t\t\tbest_candidate.MemberDefinition.SetIsUsed ();\n\t\t\t}\n\n\t\t\targs = best_candidate_args;\n\t\t\treturn (T) best_candidate;\n\t\t}\n\n\t\tpublic MethodSpec ResolveOperator (ResolveContext rc, ref Arguments args)\n\t\t{\n\t\t\treturn ResolveMember<MethodSpec> (rc, ref args);\n\t\t}\n\n\t\tvoid ReportArgumentMismatch (ResolveContext ec, int idx, MemberSpec method,\n\t\t\t\t\t\t\t\t\t\t\t\t\tArgument a, AParametersCollection expected_par, TypeSpec paramType)\n\t\t{\n\t\t\tif (custom_errors != null && custom_errors.ArgumentMismatch (ec, method, a, idx))\n\t\t\t\treturn;\n\n\t\t\tif (a.Type == InternalType.ErrorType)\n\t\t\t\treturn;\n\n\t\t\tif (a is CollectionElementInitializer.ElementInitializerArgument) {\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (method);\n\t\t\t\tif ((expected_par.FixedParameters[idx].ModFlags & Parameter.Modifier.RefOutMask) != 0) {\n\t\t\t\t\tec.Report.Error (1954, loc, \"The best overloaded collection initalizer method `{0}' cannot have `ref' or `out' modifier\",\n\t\t\t\t\t\tTypeManager.CSharpSignature (method));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tec.Report.Error (1950, loc, \"The best overloaded collection initalizer method `{0}' has some invalid arguments\",\n\t\t\t\t\t  TypeManager.CSharpSignature (method));\n\t\t\t} else if (IsDelegateInvoke) {\n\t\t\t\tec.Report.Error (1594, loc, \"Delegate `{0}' has some invalid arguments\",\n\t\t\t\t\tDelegateType.GetSignatureForError ());\n\t\t\t} else {\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (method);\n\t\t\t\tec.Report.Error (1502, loc, \"The best overloaded method match for `{0}' has some invalid arguments\",\n\t\t\t\t\tmethod.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tParameter.Modifier mod = idx >= expected_par.Count ? 0 : expected_par.FixedParameters[idx].ModFlags;\n\n\t\t\tstring index = (idx + 1).ToString ();\n\t\t\tif (((mod & Parameter.Modifier.RefOutMask) ^ (a.Modifier & Parameter.Modifier.RefOutMask)) != 0) {\n\t\t\t\tif ((mod & Parameter.Modifier.RefOutMask) == 0)\n\t\t\t\t\tec.Report.Error (1615, a.Expr.Location, \"Argument `#{0}' does not require `{1}' modifier. Consider removing `{1}' modifier\",\n\t\t\t\t\t\tindex, Parameter.GetModifierSignature (a.Modifier));\n\t\t\t\telse\n\t\t\t\t\tec.Report.Error (1620, a.Expr.Location, \"Argument `#{0}' is missing `{1}' modifier\",\n\t\t\t\t\t\tindex, Parameter.GetModifierSignature (mod));\n\t\t\t} else {\n\t\t\t\tstring p1 = a.GetSignatureForError ();\n\t\t\t\tstring p2 = paramType.GetSignatureForError ();\n\n\t\t\t\tif (p1 == p2) {\n\t\t\t\t\tp1 = a.Type.GetSignatureForErrorIncludingAssemblyName ();\n\t\t\t\t\tp2 = paramType.GetSignatureForErrorIncludingAssemblyName ();\n\t\t\t\t}\n\n\t\t\t\tif ((mod & Parameter.Modifier.RefOutMask) != 0) {\n\t\t\t\t\tp1 = Parameter.GetModifierSignature (a.Modifier) + \" \" + p1;\n\t\t\t\t\tp2 = Parameter.GetModifierSignature (a.Modifier) + \" \" + p2;\n\t\t\t\t}\n\n\t\t\t\tec.Report.Error (1503, a.Expr.Location,\n\t\t\t\t\t\"Argument `#{0}' cannot convert `{1}' expression to type `{2}'\", index, p1, p2);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// We have failed to find exact match so we return error info about the closest match\n\t\t//\n\t\tvoid ReportOverloadError (ResolveContext rc, MemberSpec best_candidate, IParametersMember pm, Arguments args, bool params_expanded)\n\t\t{\n\t\t\tint ta_count = type_arguments == null ? 0 : type_arguments.Count;\n\t\t\tint arg_count = args == null ? 0 : args.Count;\n\n\t\t\tif (ta_count != best_candidate.Arity && (ta_count > 0 || ((IParametersMember) best_candidate).Parameters.IsEmpty)) {\n\t\t\t\tvar mg = new MethodGroupExpr (new [] { best_candidate }, best_candidate.DeclaringType, loc);\n\t\t\t\tmg.Error_TypeArgumentsCannotBeUsed (rc, best_candidate, loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (lambda_conv_msgs != null && lambda_conv_msgs.Merge (rc.Report.Printer)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\tif ((best_candidate.Modifiers & (Modifiers.PROTECTED | Modifiers.STATIC)) == Modifiers.PROTECTED &&\n\t\t\t\tInstanceQualifier != null && !InstanceQualifier.CheckProtectedMemberAccess (rc, best_candidate)) {\n\t\t\t\tMemberExpr.Error_ProtectedMemberAccess (rc, best_candidate, InstanceQualifier.InstanceType, loc);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// For candidates which match on parameters count report more details about incorrect arguments\n\t\t\t//\n\t\t\tif (pm != null) {\n\t\t\t\tif (pm.Parameters.Count == arg_count || params_expanded || HasUnfilledParams (best_candidate, pm, args)) {\n\t\t\t\t\t// Reject any inaccessible member\n\t\t\t\t\tif (!best_candidate.IsAccessible (rc) || !best_candidate.DeclaringType.IsAccessible (rc)) {\n\t\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\t\t\t\tExpression.ErrorIsInaccesible (rc, best_candidate.GetSignatureForError (), loc);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar ms = best_candidate as MethodSpec;\n\t\t\t\t\tif (ms != null && ms.IsGeneric) {\n\t\t\t\t\t\tbool constr_ok = true;\n\t\t\t\t\t\tif (ms.TypeArguments != null)\n\t\t\t\t\t\t\tconstr_ok = new ConstraintChecker (rc.MemberContext).CheckAll (ms.GetGenericMethodDefinition (), ms.TypeArguments, ms.Constraints, loc);\n\n\t\t\t\t\t\tif (ta_count == 0 && ms.TypeArguments == null) {\n\t\t\t\t\t\t\tif (custom_errors != null && custom_errors.TypeInferenceFailed (rc, best_candidate))\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\tif (constr_ok) {\n\t\t\t\t\t\t\t\trc.Report.Error (411, loc,\n\t\t\t\t\t\t\t\t\t\"The type arguments for method `{0}' cannot be inferred from the usage. Try specifying the type arguments explicitly\",\n\t\t\t\t\t\t\t\t\tms.GetGenericMethodDefinition ().GetSignatureForError ());\n\t\t\t\t\t\t\t}\n\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\tVerifyArguments (rc, ref args, best_candidate, pm, params_expanded);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// We failed to find any method with correct argument count, report best candidate\n\t\t\t//\n\t\t\tif (custom_errors != null && custom_errors.NoArgumentMatch (rc, best_candidate))\n\t\t\t\treturn;\n\n\t\t\tif (best_candidate.Kind == MemberKind.Constructor) {\n\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\t\tError_ConstructorMismatch (rc, best_candidate.DeclaringType, arg_count, loc);\n\t\t\t} else if (IsDelegateInvoke) {\n\t\t\t\trc.Report.SymbolRelatedToPreviousError (DelegateType);\n\t\t\t\trc.Report.Error (1593, loc, \"Delegate `{0}' does not take `{1}' arguments\",\n\t\t\t\t\tDelegateType.GetSignatureForError (), arg_count.ToString ());\n\t\t\t} else {\n\t\t\t\tstring name = best_candidate.Kind == MemberKind.Indexer ? \"this\" : best_candidate.Name;\n\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\t\trc.Report.Error (1501, loc, \"No overload for method `{0}' takes `{1}' arguments\",\n\t\t\t\t\tname, arg_count.ToString ());\n\t\t\t}\n\t\t}\n\n\t\tstatic bool HasUnfilledParams (MemberSpec best_candidate, IParametersMember pm, Arguments args)\n\t\t{\n\t\t\tvar p = ((IParametersMember)best_candidate).Parameters;\n\t\t\tif (!p.HasParams)\n\t\t\t\treturn false;\n\n\t\t\tstring name = null;\n\t\t\tfor (int i = p.Count - 1; i != 0; --i) {\n\t\t\t\tvar fp = p.FixedParameters [i];\n\t\t\t\tif ((fp.ModFlags & Parameter.Modifier.PARAMS) == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tname = fp.Name;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (args == null)\n\t\t\t\treturn false;\n\n\t\t\tforeach (var arg in args) {\n\t\t\t\tvar na = arg as NamedArgument;\n\t\t\t\tif (na == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (na.Name == name) {\n\t\t\t\t\tname = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (name == null)\n\t\t\t\treturn false;\n\n\t\t\treturn args.Count + 1 == pm.Parameters.Count;\n\t\t}\n\n\t\tbool VerifyArguments (ResolveContext ec, ref Arguments args, MemberSpec member, IParametersMember pm, bool chose_params_expanded)\n\t\t{\n\t\t\tvar pd = pm.Parameters;\n\t\t\tvar cpd = ((IParametersMember) member).Parameters;\n\t\t\tvar ptypes = cpd.Types;\n\n\t\t\tParameter.Modifier p_mod = 0;\n\t\t\tTypeSpec pt = null;\n\t\t\tint a_idx = 0, a_pos = 0;\n\t\t\tArgument a = null;\n\t\t\tArrayInitializer params_initializers = null;\n\t\t\tbool has_unsafe_arg = pm.MemberType.IsPointer;\n\t\t\tint arg_count = args == null ? 0 : args.Count;\n\n\t\t\tfor (; a_idx < arg_count; a_idx++, ++a_pos) {\n\t\t\t\ta = args[a_idx];\n\t\t\t\tif (a == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (p_mod != Parameter.Modifier.PARAMS) {\n\t\t\t\t\tp_mod = cpd.FixedParameters [a_idx].ModFlags;\n\t\t\t\t\tpt = ptypes[a_idx];\n\t\t\t\t\thas_unsafe_arg |= pt.IsPointer;\n\n\t\t\t\t\tif (p_mod == Parameter.Modifier.PARAMS) {\n\t\t\t\t\t\tif (chose_params_expanded) {\n\t\t\t\t\t\t\tparams_initializers = new ArrayInitializer (arg_count - a_idx, a.Expr.Location);\n\t\t\t\t\t\t\tpt = TypeManager.GetElementType (pt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Types have to be identical when ref or out modifer is used \n\t\t\t\t//\n\t\t\t\tif (((a.Modifier | p_mod) & Parameter.Modifier.RefOutMask) != 0) {\n\t\t\t\t\tif ((a.Modifier & Parameter.Modifier.RefOutMask) != (p_mod & Parameter.Modifier.RefOutMask))\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tif (a.Expr.Type == pt || TypeSpecComparer.IsEqual (a.Expr.Type, pt))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tNamedArgument na = a as NamedArgument;\n\t\t\t\tif (na != null) {\n\t\t\t\t\tint name_index = pd.GetParameterIndexByName (na.Name);\n\t\t\t\t\tif (name_index < 0 || name_index >= pd.Count) {\n\t\t\t\t\t\tif (IsDelegateInvoke) {\n\t\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (DelegateType);\n\t\t\t\t\t\t\tec.Report.Error (1746, na.Location,\n\t\t\t\t\t\t\t\t\"The delegate `{0}' does not contain a parameter named `{1}'\",\n\t\t\t\t\t\t\t\tDelegateType.GetSignatureForError (), na.Name);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (member);\n\t\t\t\t\t\t\tec.Report.Error (1739, na.Location,\n\t\t\t\t\t\t\t\t\"The best overloaded method match for `{0}' does not contain a parameter named `{1}'\",\n\t\t\t\t\t\t\t\tTypeManager.CSharpSignature (member), na.Name);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (args[name_index] != a && args[name_index] != null) {\n\t\t\t\t\t\tif (IsDelegateInvoke)\n\t\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (DelegateType);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (member);\n\n\t\t\t\t\t\tec.Report.Error (1744, na.Location,\n\t\t\t\t\t\t\t\"Named argument `{0}' cannot be used for a parameter which has positional argument specified\",\n\t\t\t\t\t\t\tna.Name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (a.Expr.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif ((restrictions & Restrictions.CovariantDelegate) != 0 && !Delegate.IsTypeCovariant (ec, a.Expr.Type, pt)) {\n\t\t\t\t\tcustom_errors.NoArgumentMatch (ec, member);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tExpression conv;\n\t\t\t\tif (a.IsExtensionType) {\n\t\t\t\t\tif (a.Expr.Type == pt || TypeSpecComparer.IsEqual (a.Expr.Type, pt)) {\n\t\t\t\t\t\tconv = a.Expr;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconv = Convert.ImplicitReferenceConversion (a.Expr, pt, false);\n\t\t\t\t\t\tif (conv == null)\n\t\t\t\t\t\t\tconv = Convert.ImplicitBoxingConversion (a.Expr, a.Expr.Type, pt);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconv = Convert.ImplicitConversion (ec, a.Expr, pt, loc);\n\t\t\t\t}\n\n\t\t\t\tif (conv == null)\n\t\t\t\t\tbreak;\n\n\t\t\t\t//\n\t\t\t\t// Convert params arguments to an array initializer\n\t\t\t\t//\n\t\t\t\tif (params_initializers != null) {\n\t\t\t\t\t// we choose to use 'a.Expr' rather than 'conv' so that\n\t\t\t\t\t// we don't hide the kind of expression we have (esp. CompoundAssign.Helper)\n\t\t\t\t\tparams_initializers.Add (a.Expr);\n\t\t\t\t\targs.RemoveAt (a_idx--);\n\t\t\t\t\t--arg_count;\n\t\t\t\t\ta.Expr = conv;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Update the argument with the implicit conversion\n\t\t\t\ta.Expr = conv;\n\t\t\t}\n\n\t\t\tif (a_idx != arg_count) {\n\t\t\t\tReportArgumentMismatch (ec, a_pos, member, a, pd, pt);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Fill not provided arguments required by params modifier\n\t\t\t//\n\t\t\tif (params_initializers == null && arg_count + 1 == pd.Count) {\n\t\t\t\tif (args == null)\n\t\t\t\t\targs = new Arguments (1);\n\n\t\t\t\tpt = ptypes[pd.Count - 1];\n\t\t\t\tpt = TypeManager.GetElementType (pt);\n\t\t\t\thas_unsafe_arg |= pt.IsPointer;\n\t\t\t\tparams_initializers = new ArrayInitializer (0, loc);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Append an array argument with all params arguments\n\t\t\t//\n\t\t\tif (params_initializers != null) {\n\t\t\t\targs.Add (new Argument (\n\t\t\t\t\tnew ArrayCreation (new TypeExpression (pt, loc), params_initializers, loc).Resolve (ec)));\n\t\t\t\targ_count++;\n\t\t\t}\n\n\t\t\tif (has_unsafe_arg && !ec.IsUnsafe) {\n\t\t\t\tExpression.UnsafeError (ec, loc);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// We could infer inaccesible type arguments\n\t\t\t//\n\t\t\tif (type_arguments == null && member.IsGeneric) {\n\t\t\t\tvar ms = (MethodSpec) member;\n\t\t\t\tforeach (var ta in ms.TypeArguments) {\n\t\t\t\t\tif (!ta.IsAccessible (ec)) {\n\t\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (ta);\n\t\t\t\t\t\tExpression.ErrorIsInaccesible (ec, member.GetSignatureForError (), loc);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic class ConstantExpr : MemberExpr\n\t{\n\t\treadonly ConstSpec constant;\n\n\t\tpublic ConstantExpr (ConstSpec constant, Location loc)\n\t\t{\n\t\t\tthis.constant = constant;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget { throw new NotImplementedException (); }\n\t\t}\n\n\t\tpublic override string KindName {\n\t\t\tget { return \"constant\"; }\n\t\t}\n\n\t\tpublic override bool IsInstance {\n\t\t\tget { return !IsStatic; }\n\t\t}\n\n\t\tpublic override bool IsStatic {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tprotected override TypeSpec DeclaringType {\n\t\t\tget { return constant.DeclaringType; }\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tResolveInstanceExpression (rc, null);\n\t\t\tDoBestMemberChecks (rc, constant);\n\n\t\t\tvar c = constant.GetConstant (rc);\n\n\t\t\t// Creates reference expression to the constant value\n\t\t\treturn Constant.CreateConstantFromValue (constant.MemberType, c.GetValue (), loc);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn constant.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override void SetTypeArguments (ResolveContext ec, TypeArguments ta)\n\t\t{\n\t\t\tError_TypeArgumentsCannotBeUsed (ec, \"constant\", GetSignatureForError (), loc);\n\t\t}\n\t}\n\n\t//\n\t// Fully resolved expression that references a Field\n\t//\n\tpublic class FieldExpr : MemberExpr, IDynamicAssign, IMemoryLocation, IVariableReference\n\t{\n\t\tprotected FieldSpec spec;\n\t\tVariableInfo variable_info;\n\t\t\n\t\tLocalTemporary temp;\n\t\tbool prepared;\n\t\t\n\t\tprotected FieldExpr (Location l)\n\t\t{\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic FieldExpr (FieldSpec spec, Location loc)\n\t\t{\n\t\t\tthis.spec = spec;\n\t\t\tthis.loc = loc;\n\n\t\t\ttype = spec.MemberType;\n\t\t}\n\t\t\n\t\tpublic FieldExpr (FieldBase fi, Location l)\n\t\t\t: this (fi.Spec, l)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn spec.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsHoisted {\n\t\t\tget {\n\t\t\t\tIVariableReference hv = InstanceExpression as IVariableReference;\n\t\t\t\treturn hv != null && hv.IsHoisted;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsInstance {\n\t\t\tget {\n\t\t\t\treturn !spec.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn spec.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string KindName {\n\t\t\tget { return \"field\"; }\n\t\t}\n\n\t\tpublic FieldSpec Spec {\n\t\t\tget {\n\t\t\t\treturn spec;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeSpec DeclaringType {\n\t\t\tget {\n\t\t\t\treturn spec.DeclaringType;\n\t\t\t}\n\t\t}\n\n\t\tpublic VariableInfo VariableInfo {\n\t\t\tget {\n\t\t\t\treturn variable_info;\n\t\t\t}\n\t\t}\n\n#endregion\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn spec.GetSignatureForError ();\n\t\t}\n\n\t\tpublic bool IsMarshalByRefAccess (ResolveContext rc)\n\t\t{\n\t\t\t// Checks possible ldflda of field access expression\n\t\t\treturn !spec.IsStatic && TypeSpec.IsValueType (spec.MemberType) && !(InstanceExpression is This) &&\n\t\t\t\trc.Module.PredefinedTypes.MarshalByRefObject.Define () &&\n\t\t\t\tTypeSpec.IsBaseClass (spec.DeclaringType, rc.Module.PredefinedTypes.MarshalByRefObject.TypeSpec, false);\n\t\t}\n\n\t\tpublic void SetHasAddressTaken ()\n\t\t{\n\t\t\tIVariableReference vr = InstanceExpression as IVariableReference;\n\t\t\tif (vr != null) {\n\t\t\t\tvr.SetHasAddressTaken ();\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tvar t = (FieldExpr) target;\n\n\t\t\tif (InstanceExpression != null)\n\t\t\t\tt.InstanceExpression = InstanceExpression.Clone (clonectx);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (ConditionalAccess) {\n\t\t\t\tError_NullShortCircuitInsideExpressionTree (ec);\n\t\t\t}\n\n\t\t\treturn CreateExpressionTree (ec, true);\n\t\t}\n\n\t\tpublic Expression CreateExpressionTree (ResolveContext ec, bool convertInstance)\n\t\t{\n\t\t\tArguments args;\n\t\t\tExpression instance;\n\n\t\t\tif (InstanceExpression == null) {\n\t\t\t\tinstance = new NullLiteral (loc);\n\t\t\t} else if (convertInstance) {\n\t\t\t\tinstance = InstanceExpression.CreateExpressionTree (ec);\n\t\t\t} else {\n\t\t\t\targs = new Arguments (1);\n\t\t\t\targs.Add (new Argument (InstanceExpression));\n\t\t\t\tinstance = CreateExpressionFactoryCall (ec, \"Constant\", args);\n\t\t\t}\n\n\t\t\targs = Arguments.CreateForExpressionTree (ec, null,\n\t\t\t\tinstance,\n\t\t\t\tCreateTypeOfExpression ());\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Field\", args);\n\t\t}\n\n\t\tpublic Expression CreateTypeOfExpression ()\n\t\t{\n\t\t\treturn new TypeOfField (spec, loc);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tspec.MemberDefinition.SetIsUsed ();\n\n\t\t\treturn DoResolve (ec, null);\n\t\t}\n\n\t\tExpression DoResolve (ResolveContext ec, Expression rhs)\n\t\t{\n\t\t\tbool lvalue_instance = rhs != null && IsInstance && spec.DeclaringType.IsStruct;\n\n\t\t\tif (rhs != this) {\n\t\t\t\tResolveConditionalAccessReceiver (ec);\n\n\t\t\t\tif (ResolveInstanceExpression (ec, rhs)) {\n\t\t\t\t\t// Resolve the field's instance expression while flow analysis is turned\n\t\t\t\t\t// off: when accessing a field \"a.b\", we must check whether the field\n\t\t\t\t\t// \"a.b\" is initialized, not whether the whole struct \"a\" is initialized.\n\n\t\t\t\t\tif (lvalue_instance) {\n\t\t\t\t\t\tbool out_access = rhs == EmptyExpression.OutAccess || rhs == EmptyExpression.LValueMemberOutAccess;\n\n\t\t\t\t\t\tExpression right_side =\n\t\t\t\t\t\t\tout_access ? EmptyExpression.LValueMemberOutAccess : EmptyExpression.LValueMemberAccess;\n\n\t\t\t\t\t\tInstanceExpression = InstanceExpression.ResolveLValue (ec, right_side);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tInstanceExpression = InstanceExpression.Resolve (ec, ResolveFlags.VariableOrValue);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (InstanceExpression == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tDoBestMemberChecks (ec, spec);\n\n\t\t\t\tif (conditional_access_receiver)\n\t\t\t\t\tec.With (ResolveContext.Options.ConditionalAccessReceiver, false);\n\t\t\t}\n\n\t\t\tvar fb = spec as FixedFieldSpec;\n\t\t\tIVariableReference var = InstanceExpression as IVariableReference;\n\n\t\t\tif (fb != null) {\n\t\t\t\tIFixedExpression fe = InstanceExpression as IFixedExpression;\n\t\t\t\tif (!ec.HasSet (ResolveContext.Options.FixedInitializerScope) && (fe == null || !fe.IsFixed)) {\n\t\t\t\t\tec.Report.Error (1666, loc, \"You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement\");\n\t\t\t\t}\n\n\t\t\t\tif (InstanceExpression.eclass != ExprClass.Variable) {\n\t\t\t\t\tec.Report.SymbolRelatedToPreviousError (spec);\n\t\t\t\t\tec.Report.Error (1708, loc, \"`{0}': Fixed size buffers can only be accessed through locals or fields\",\n\t\t\t\t\t\tTypeManager.GetFullNameSignature (spec));\n\t\t\t\t} else if (var != null && var.IsHoisted) {\n\t\t\t\t\tAnonymousMethodExpression.Error_AddressOfCapturedVar (ec, var, loc);\n\t\t\t\t}\n\n\t\t\t\treturn new FixedBufferPtr (this, fb.ElementType, loc).Resolve (ec);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Set flow-analysis variable info for struct member access. It will be check later\n\t\t\t// for precise error reporting\n\t\t\t//\n\t\t\tif (var != null && var.VariableInfo != null && InstanceExpression.Type.IsStruct) {\n\t\t\t\tvariable_info = var.VariableInfo.GetStructFieldInfo (Name);\n\t\t\t}\n\n\t\t\tif (ConditionalAccess) {\n\t\t\t\tif (conditional_access_receiver)\n\t\t\t\t\ttype = LiftMemberType (ec, type);\n\n\t\t\t\tif (InstanceExpression.IsNull)\n\t\t\t\t\treturn Constant.CreateConstantFromValue (type, null, loc);\n\t\t\t}\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic void SetFieldAssigned (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (!IsInstance)\n\t\t\t\treturn;\n\n\t\t\tbool lvalue_instance = spec.DeclaringType.IsStruct;\n\t\t\tif (lvalue_instance) {\n\t\t\t\tvar var = InstanceExpression as IVariableReference;\n\t\t\t\tif (var != null && var.VariableInfo != null) {\n\t\t\t\t\tfc.SetStructFieldAssigned (var.VariableInfo, Name);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar fe = InstanceExpression as FieldExpr;\n\t\t\tif (fe != null) {\n\t\t\t\tExpression instance;\n\n\t\t\t\tdo {\n\t\t\t\t\tinstance = fe.InstanceExpression;\n\t\t\t\t\tvar fe_instance = instance as FieldExpr;\n\t\t\t\t\tif ((fe_instance != null && !fe_instance.IsStatic) || instance is LocalVariableReference) {\n\t\t\t\t\t\tif (TypeSpec.IsReferenceType (fe.Type) && instance.Type.IsStruct) {\n\t\t\t\t\t\t\tvar var = InstanceExpression as IVariableReference;\n\t\t\t\t\t\t\tif (var != null && var.VariableInfo == null) {\n\t\t\t\t\t\t\t\tvar var_inst = instance as IVariableReference;\n\t\t\t\t\t\t\t\tif (var_inst == null || (var_inst.VariableInfo != null && !fc.IsDefinitelyAssigned (var_inst.VariableInfo)))\n\t\t\t\t\t\t\t\t\tfc.Report.Warning (1060, 1, fe.loc, \"Use of possibly unassigned field `{0}'\", fe.Name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (fe_instance != null) {\n\t\t\t\t\t\t\tfe = fe_instance;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t} while (true);\n\n\t\t\t\tif (instance != null && TypeSpec.IsReferenceType (instance.Type))\n\t\t\t\t\tinstance.FlowAnalysis (fc);\n\t\t\t} else {\n\t\t\t\tif (TypeSpec.IsReferenceType (InstanceExpression.Type))\n\t\t\t\t\tInstanceExpression.FlowAnalysis (fc);\n\t\t\t}\n\t\t}\n\n\t\tExpression Error_AssignToReadonly (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\t// The return value is always null.  Returning a value simplifies calling code.\n\t\n\t\t\tif (right_side == EmptyExpression.OutAccess) {\n\t\t\t\tif (IsStatic) {\n\t\t\t\t\trc.Report.Error (199, loc, \"A static readonly field `{0}' cannot be passed ref or out (except in a static constructor)\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\trc.Report.Error (192, loc, \"A readonly field `{0}' cannot be passed ref or out (except in a constructor)\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (right_side == EmptyExpression.LValueMemberAccess) {\n\t\t\t\t// Already reported as CS1648/CS1650\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (right_side == EmptyExpression.LValueMemberOutAccess) {\n\t\t\t\tif (IsStatic) {\n\t\t\t\t\trc.Report.Error (1651, loc, \"Fields of static readonly field `{0}' cannot be passed ref or out (except in a static constructor)\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\trc.Report.Error (1649, loc, \"Members of readonly field `{0}' cannot be passed ref or out (except in a constructor)\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (IsStatic) {\n\t\t\t\trc.Report.Error (198, loc, \"A static readonly field `{0}' cannot be assigned to (except in a static constructor or a variable initializer)\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t} else {\n\t\t\t\trc.Report.Error (191, loc, \"A readonly field `{0}' cannot be assigned to (except in a constructor or a variable initializer)\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tif (ConditionalAccess)\n\t\t\t\tthrow new NotSupportedException (\"null propagating operator assignment\");\n\n\t\t\tif (spec is FixedFieldSpec) {\n\t\t\t\t// It could be much better error message but we want to be error compatible\n\t\t\t\tError_ValueAssignment (ec, right_side);\n\t\t\t}\n\n\t\t\tExpression e = DoResolve (ec, right_side);\n\n\t\t\tif (e == null)\n\t\t\t\treturn null;\n\n\t\t\tspec.MemberDefinition.SetIsAssigned ();\n\n\t\t\tif ((right_side == EmptyExpression.UnaryAddress || right_side == EmptyExpression.OutAccess) &&\n\t\t\t\t\t(spec.Modifiers & Modifiers.VOLATILE) != 0) {\n\t\t\t\tec.Report.Warning (420, 1, loc,\n\t\t\t\t\t\"`{0}': A volatile field references will not be treated as volatile\",\n\t\t\t\t\tspec.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif (spec.IsReadOnly) {\n\t\t\t\t// InitOnly fields can only be assigned in constructors or initializers\n\t\t\t\tif (!ec.HasAny (ResolveContext.Options.FieldInitializerScope | ResolveContext.Options.ConstructorScope))\n\t\t\t\t\treturn Error_AssignToReadonly (ec, right_side);\n\n\t\t\t\tif (ec.HasSet (ResolveContext.Options.ConstructorScope)) {\n\n\t\t\t\t\t// InitOnly fields cannot be assigned-to in a different constructor from their declaring type\n\t\t\t\t\tif (ec.CurrentMemberDefinition.Parent.PartialContainer.Definition != spec.DeclaringType.GetDefinition ())\n\t\t\t\t\t\treturn Error_AssignToReadonly (ec, right_side);\n\t\t\t\t\t// static InitOnly fields cannot be assigned-to in an instance constructor\n\t\t\t\t\tif (IsStatic && !ec.IsStatic)\n\t\t\t\t\t\treturn Error_AssignToReadonly (ec, right_side);\n\t\t\t\t\t// instance constructors can't modify InitOnly fields of other instances of the same type\n\t\t\t\t\tif (!IsStatic && !(InstanceExpression is This))\n\t\t\t\t\t\treturn Error_AssignToReadonly (ec, right_side);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (right_side == EmptyExpression.OutAccess && IsMarshalByRefAccess (ec)) {\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (spec.DeclaringType);\n\t\t\t\tec.Report.Warning (197, 1, loc,\n\t\t\t\t\t\t\"Passing `{0}' as ref or out or taking its address may cause a runtime exception because it is a field of a marshal-by-reference class\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tvar var = InstanceExpression as IVariableReference;\n\t\t\tif (var != null) {\n\t\t\t\tvar vi = var.VariableInfo;\n\t\t\t\tif (vi != null && !fc.IsStructFieldDefinitelyAssigned (vi, Name)) {\n\t\t\t\t\tfc.Report.Error (170, loc, \"Use of possibly unassigned field `{0}'\", Name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (TypeSpec.IsValueType (InstanceExpression.Type) && InstanceExpression is VariableReference)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.FlowAnalysis (fc);\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tfc.ConditionalAccessEnd ();\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn spec.GetHashCode ();\n\t\t}\n\t\t\n\t\tpublic bool IsFixed {\n\t\t\tget {\n\t\t\t\t//\n\t\t\t\t// A variable of the form V.I is fixed when V is a fixed variable of a struct type\n\t\t\t\t//\n\t\t\t\tIVariableReference variable = InstanceExpression as IVariableReference;\n\t\t\t\tif (variable != null)\n\t\t\t\t\treturn InstanceExpression.Type.IsStruct && variable.IsFixed;\n\n\t\t\t\tIFixedExpression fe = InstanceExpression as IFixedExpression;\n\t\t\t\treturn fe != null && fe.IsFixed;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tFieldExpr fe = obj as FieldExpr;\n\t\t\tif (fe == null)\n\t\t\t\treturn false;\n\n\t\t\tif (spec != fe.spec)\n\t\t\t\treturn false;\n\n\t\t\tif (InstanceExpression == null || fe.InstanceExpression == null)\n\t\t\t\treturn true;\n\n\t\t\treturn InstanceExpression.Equals (fe.InstanceExpression);\n\t\t}\n\t\t\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tbool is_volatile = (spec.Modifiers & Modifiers.VOLATILE) != 0;\n\n\t\t\tif (IsStatic){\n\t\t\t\tif (is_volatile)\n\t\t\t\t\tec.Emit (OpCodes.Volatile);\n\n\t\t\t\tec.Emit (OpCodes.Ldsfld, spec);\n\t\t\t} else {\n\t\t\t\tif (!prepared) {\n\t\t\t\t\tif (conditional_access_receiver)\n\t\t\t\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());\n\n\t\t\t\t\tEmitInstance (ec, false);\n\t\t\t\t}\n\n\t\t\t\t// Optimization for build-in types\n\t\t\t\tif (type.IsStruct && type == ec.CurrentType && InstanceExpression.Type == type) {\n\t\t\t\t\tec.EmitLoadFromPtr (type);\n\t\t\t\t} else {\n\t\t\t\t\tvar ff = spec as FixedFieldSpec;\n\t\t\t\t\tif (ff != null) {\n\t\t\t\t\t\tec.Emit (OpCodes.Ldflda, spec);\n\t\t\t\t\t\tec.Emit (OpCodes.Ldflda, ff.Element);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (is_volatile)\n\t\t\t\t\t\t\tec.Emit (OpCodes.Volatile);\n\n\t\t\t\t\t\tec.Emit (OpCodes.Ldfld, spec);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (conditional_access_receiver) {\n\t\t\t\t\tec.CloseConditionalAccess (type.IsNullableType && type != spec.MemberType ? type : null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\tif (!IsStatic) {\n\t\t\t\t\ttemp = new LocalTemporary (this.Type);\n\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tbool has_await_source = ec.HasSet (BuilderContext.Options.AsyncBody) && source.ContainsEmitWithAwait ();\n\t\t\tif (isCompound && !(source is DynamicExpressionStatement) && !has_await_source) {\n\t\t\t\tprepared = true;\n\t\t\t}\n\n\t\t\tif (IsInstance) {\n\t\t\t\tif (ConditionalAccess)\n\t\t\t\t\tthrow new NotImplementedException (\"null operator assignment\");\n\n\t\t\t\tif (has_await_source)\n\t\t\t\t\tsource = source.EmitToField (ec);\n\n\t\t\t\tEmitInstance (ec, prepared);\n\t\t\t}\n\n\t\t\tsource.Emit (ec);\n\n\t\t\tif (leave_copy || ec.NotifyEvaluatorOnStore) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\tif (!IsStatic) {\n\t\t\t\t\ttemp = new LocalTemporary (this.Type);\n\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((spec.Modifiers & Modifiers.VOLATILE) != 0)\n\t\t\t\tec.Emit (OpCodes.Volatile);\n\t\t\t\t\t\n\t\t\tspec.MemberDefinition.SetIsAssigned ();\n\n\t\t\tif (IsStatic)\n\t\t\t\tec.Emit (OpCodes.Stsfld, spec);\n\t\t\telse\n\t\t\t\tec.Emit (OpCodes.Stfld, spec);\n\n\t\t\tif (ec.NotifyEvaluatorOnStore) {\n\t\t\t\tif (!IsStatic)\n\t\t\t\t\tthrow new NotImplementedException (\"instance field write\");\n\n\t\t\t\tif (leave_copy)\n\t\t\t\t\tec.Emit (OpCodes.Dup);\n\n\t\t\t\tec.Module.Evaluator.EmitValueChangedCallback (ec, Name, type, loc);\n\t\t\t}\n\t\t\t\n\t\t\tif (temp != null) {\n\t\t\t\ttemp.Emit (ec);\n\t\t\t\ttemp.Release (ec);\n\t\t\t\ttemp = null;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Emits store to field with prepared values on stack\n\t\t//\n\t\tpublic void EmitAssignFromStack (EmitContext ec)\n\t\t{\n\t\t\tif (IsStatic) {\n\t\t\t\tec.Emit (OpCodes.Stsfld, spec);\n\t\t\t} else {\n\t\t\t\tec.Emit (OpCodes.Stfld, spec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec, false);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tbool is_volatile = (spec.Modifiers & Modifiers.VOLATILE) != 0;\n\n\t\t\tif (is_volatile) // || is_marshal_by_ref ())\n\t\t\t\tbase.EmitSideEffect (ec);\n\t\t}\n\n\t\tpublic virtual void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tif ((mode & AddressOp.Store) != 0)\n\t\t\t\tspec.MemberDefinition.SetIsAssigned ();\n\t\t\tif ((mode & AddressOp.Load) != 0)\n\t\t\t\tspec.MemberDefinition.SetIsUsed ();\n\n\t\t\t//\n\t\t\t// Handle initonly fields specially: make a copy and then\n\t\t\t// get the address of the copy.\n\t\t\t//\n\t\t\tbool need_copy;\n\t\t\tif (spec.IsReadOnly){\n\t\t\t\tneed_copy = true;\n\t\t\t\tif (ec.HasSet (EmitContext.Options.ConstructorScope) && spec.DeclaringType == ec.CurrentType) {\n\t\t\t\t\tif (IsStatic){\n\t\t\t\t\t\tif (ec.IsStatic)\n\t\t\t\t\t\t\tneed_copy = false;\n\t\t\t\t\t} else\n\t\t\t\t\t\tneed_copy = false;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tneed_copy = false;\n\t\t\t\n\t\t\tif (need_copy) {\n\t\t\t\tEmit (ec);\n\t\t\t\tvar temp = ec.GetTemporaryLocal (type);\n\t\t\t\tec.Emit (OpCodes.Stloc, temp);\n\t\t\t\tec.Emit (OpCodes.Ldloca, temp);\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\tif (IsStatic){\n\t\t\t\tec.Emit (OpCodes.Ldsflda, spec);\n\t\t\t} else {\n\t\t\t\tif (!prepared)\n\t\t\t\t\tEmitInstance (ec, false);\n\t\t\t\tec.Emit (OpCodes.Ldflda, spec);\n\t\t\t}\n\t\t}\n\n\t\tpublic SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)\n\t\t{\n\t\t\treturn MakeExpression (ctx);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn SLE.Expression.Field (\n\t\t\t\tIsStatic ? null : InstanceExpression.MakeExpression (ctx),\n\t\t\t\tspec.GetMetaInfo ());\n#endif\n\t\t}\n\n\t\tpublic override void SetTypeArguments (ResolveContext ec, TypeArguments ta)\n\t\t{\n\t\t\tError_TypeArgumentsCannotBeUsed (ec, \"field\", GetSignatureForError (), loc);\n\t\t}\n\t}\n\n\t\n\t//\n\t// Expression that evaluates to a Property.\n\t//\n\t// This is not an LValue because we need to re-write the expression. We\n\t// can not take data from the stack and store it.\n\t//\n\tsealed class PropertyExpr : PropertyOrIndexerExpr<PropertySpec>\n\t{\n\t\tArguments arguments;\n\n\t\tpublic PropertyExpr (PropertySpec spec, Location l)\n\t\t\t: base (l)\n\t\t{\n\t\t\tbest_candidate = spec;\n\t\t\ttype = spec.MemberType;\n\t\t}\n\n\t\t#region Properties\n\n\t\tprotected override Arguments Arguments {\n\t\t\tget {\n\t\t\t\treturn arguments;\n\t\t\t}\n\t\t\tset {\n\t\t\t\targuments = value;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeSpec DeclaringType {\n\t\t\tget {\n\t\t\t\treturn best_candidate.DeclaringType;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn best_candidate.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsInstance {\n\t\t\tget {\n\t\t\t\treturn !IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn best_candidate.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string KindName {\n\t\t\tget { return \"property\"; }\n\t\t}\n\n\t\tpublic PropertySpec PropertyInfo {\n\t\t\tget {\n\t\t\t\treturn best_candidate;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override MethodGroupExpr CanReduceLambda (AnonymousMethodBody body)\n\t\t{\n\t\t\tif (best_candidate == null || !(best_candidate.IsStatic || InstanceExpression is This))\n\t\t\t\treturn null;\n\n\t\t\tvar args_count = arguments == null ? 0 : arguments.Count;\n\t\t\tif (args_count != body.Parameters.Count && args_count == 0)\n\t\t\t\treturn null;\n\n\t\t\tvar mg = MethodGroupExpr.CreatePredefined (best_candidate.Get, DeclaringType, loc);\n\t\t\tmg.InstanceExpression = InstanceExpression;\n\n\t\t\treturn mg;\n\t\t}\n\n\t\tpublic static PropertyExpr CreatePredefined (PropertySpec spec, Location loc)\n\t\t{\n\t\t\treturn new PropertyExpr (spec, loc) {\n\t\t\t\tGetter = spec.Get,\n\t\t\t\tSetter = spec.Set\n\t\t\t};\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (ConditionalAccess) {\n\t\t\t\tError_NullShortCircuitInsideExpressionTree (ec);\n\t\t\t}\n\n\t\t\tArguments args;\n\t\t\tif (IsSingleDimensionalArrayLength ()) {\n\t\t\t\targs = new Arguments (1);\n\t\t\t\targs.Add (new Argument (InstanceExpression.CreateExpressionTree (ec)));\n\t\t\t\treturn CreateExpressionFactoryCall (ec, \"ArrayLength\", args);\n\t\t\t}\n\n\t\t\targs = new Arguments (2);\n\t\t\tif (InstanceExpression == null)\n\t\t\t\targs.Add (new Argument (new NullLiteral (loc)));\n\t\t\telse\n\t\t\t\targs.Add (new Argument (InstanceExpression.CreateExpressionTree (ec)));\n\t\t\targs.Add (new Argument (new TypeOfMethod (Getter, loc)));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Property\", args);\n\t\t}\n\n\t\tpublic Expression CreateSetterTypeOfExpression (ResolveContext rc)\n\t\t{\n\t\t\tDoResolveLValue (rc, null);\n\t\t\treturn new TypeOfMethod (Setter, loc);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn best_candidate.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn SLE.Expression.Property (InstanceExpression.MakeExpression (ctx), (MethodInfo) Setter.GetMetaInfo ());\n#endif\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn SLE.Expression.Property (InstanceExpression.MakeExpression (ctx), (MethodInfo) Getter.GetMetaInfo ());\n#endif\n\t\t}\n\n\t\tvoid Error_PropertyNotValid (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\tec.Report.Error (1546, loc, \"Property or event `{0}' is not supported by the C# language\",\n\t\t\t\tGetSignatureForError ());\n\t\t}\n\n\t\tbool IsSingleDimensionalArrayLength ()\n\t\t{\n\t\t\tif (best_candidate.DeclaringType.BuiltinType != BuiltinTypeSpec.Type.Array || !best_candidate.HasGet || Name != \"Length\")\n\t\t\t\treturn false;\n\n\t\t\tArrayContainer ac = InstanceExpression.Type as ArrayContainer;\n\t\t\treturn ac != null && ac.Rank == 1;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\t//\n\t\t\t// Special case: length of single dimension array property is turned into ldlen\n\t\t\t//\n\t\t\tif (IsSingleDimensionalArrayLength ()) {\n\t\t\t\tif (conditional_access_receiver) {\n\t\t\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());\n\t\t\t\t}\n\n\t\t\t\tEmitInstance (ec, false);\n\n\t\t\t\tec.Emit (OpCodes.Ldlen);\n\t\t\t\tec.Emit (OpCodes.Conv_I4);\n\n\t\t\t\tif (conditional_access_receiver) {\n\t\t\t\t\tec.CloseConditionalAccess (type);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.Emit (ec, leave_copy);\n\t\t}\n\n\t\tpublic override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tArguments args;\n\t\t\tLocalTemporary await_source_arg = null;\n\n\t\t\tif (isCompound && !(source is DynamicExpressionStatement)) {\n\t\t\t\temitting_compound_assignment = true;\n\t\t\t\tsource.Emit (ec);\n\n\t\t\t\tif (has_await_arguments) {\n\t\t\t\t\tawait_source_arg = new LocalTemporary (Type);\n\t\t\t\t\tawait_source_arg.Store (ec);\n\n\t\t\t\t\targs = new Arguments (1);\n\t\t\t\t\targs.Add (new Argument (await_source_arg));\n\n\t\t\t\t\tif (leave_copy) {\n\t\t\t\t\t\ttemp = await_source_arg;\n\t\t\t\t\t}\n\n\t\t\t\t\thas_await_arguments = false;\n\t\t\t\t} else {\n\t\t\t\t\targs = null;\n\n\t\t\t\t\tif (leave_copy) {\n\t\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\t\ttemp = new LocalTemporary (this.Type);\n\t\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\targs = arguments ?? new Arguments (1);\n\n\t\t\t\tif (leave_copy) {\n\t\t\t\t\tsource.Emit (ec);\n\t\t\t\t\ttemp = new LocalTemporary (this.Type);\n\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t\targs.Add (new Argument (temp));\n\t\t\t\t} else {\n\t\t\t\t\targs.Add (new Argument (source));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\temitting_compound_assignment = false;\n\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = InstanceExpression;\n\t\t\tif (args == null)\n\t\t\t\tcall.InstanceExpressionOnStack = true;\n\n\t\t\tif (ConditionalAccess) {\n\t\t\t\tcall.ConditionalAccess = true;\n\t\t\t}\n\n\t\t\tif (leave_copy)\n\t\t\t\tcall.Emit (ec, Setter, args, loc);\n\t\t\telse\n\t\t\t\tcall.EmitStatement (ec, Setter, args, loc);\n\n\t\t\tif (temp != null) {\n\t\t\t\ttemp.Emit (ec);\n\t\t\t\ttemp.Release (ec);\n\t\t\t}\n\n\t\t\tif (await_source_arg != null) {\n\t\t\t\tawait_source_arg.Release (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tbase.FlowAnalysis (fc);\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tfc.ConditionalAccessEnd ();\n\t\t}\n\n\t\tprotected override Expression OverloadResolve (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\teclass = ExprClass.PropertyAccess;\n\n\t\t\tif (best_candidate.IsNotCSharpCompatible) {\n\t\t\t\tError_PropertyNotValid (rc);\n\t\t\t}\n\n\t\t\tResolveInstanceExpression (rc, right_side);\n\n\t\t\tif ((best_candidate.Modifiers & (Modifiers.ABSTRACT | Modifiers.VIRTUAL)) != 0 && best_candidate.DeclaringType != InstanceExpression.Type) {\n\t\t\t\tvar filter = new MemberFilter (best_candidate.Name, 0, MemberKind.Property, null, null);\n\t\t\t\tvar p = MemberCache.FindMember (InstanceExpression.Type, filter, BindingRestriction.InstanceOnly | BindingRestriction.OverrideOnly) as PropertySpec;\n\t\t\t\tif (p != null) {\n\t\t\t\t\ttype = p.MemberType;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tDoBestMemberChecks (rc, best_candidate);\n\n\t\t\t// Handling of com-imported properties with any number of default property parameters\n\t\t\tif (best_candidate.HasGet && !best_candidate.Get.Parameters.IsEmpty) {\n\t\t\t\tvar p = best_candidate.Get.Parameters;\n\t\t\t\targuments = new Arguments (p.Count);\n\t\t\t\tfor (int i = 0; i < p.Count; ++i) {\n\t\t\t\t\targuments.Add (new Argument (OverloadResolver.ResolveDefaultValueArgument (rc, p.Types [i], p.FixedParameters [i].DefaultValue, loc)));\n\t\t\t\t}\n\t\t\t} else if (best_candidate.HasSet && best_candidate.Set.Parameters.Count > 1) {\n\t\t\t\tvar p = best_candidate.Set.Parameters;\n\t\t\t\targuments = new Arguments (p.Count - 1);\n\t\t\t\tfor (int i = 0; i < p.Count - 1; ++i) {\n\t\t\t\t\targuments.Add (new Argument (OverloadResolver.ResolveDefaultValueArgument (rc, p.Types [i], p.FixedParameters [i].DefaultValue, loc)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void SetTypeArguments (ResolveContext ec, TypeArguments ta)\n\t\t{\n\t\t\tError_TypeArgumentsCannotBeUsed (ec, \"property\", GetSignatureForError (), loc);\n\t\t}\n\t}\n\n\tabstract class PropertyOrIndexerExpr<T> : MemberExpr, IDynamicAssign where T : PropertySpec\n\t{\n\t\t// getter and setter can be different for base calls\n\t\tMethodSpec getter, setter;\n\t\tprotected T best_candidate;\n\n\t\tprotected LocalTemporary temp;\n\t\tprotected bool emitting_compound_assignment;\n\t\tprotected bool has_await_arguments;\n\n\t\tprotected PropertyOrIndexerExpr (Location l)\n\t\t{\n\t\t\tloc = l;\n\t\t}\n\n\t\t#region Properties\n\n\t\tprotected abstract Arguments Arguments { get; set; }\n\n\t\tpublic MethodSpec Getter {\n\t\t\tget {\n\t\t\t\treturn getter;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tgetter = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodSpec Setter {\n\t\t\tget {\n\t\t\t\treturn setter;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tsetter = value;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (eclass == ExprClass.Unresolved) {\n\t\t\t\tResolveConditionalAccessReceiver (ec);\n\n\t\t\t\tvar expr = OverloadResolve (ec, null);\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (expr != this)\n\t\t\t\t\treturn expr.Resolve (ec);\n\n\t\t\t\tif (conditional_access_receiver) {\n\t\t\t\t\ttype = LiftMemberType (ec, type);\n\t\t\t\t\tec.With (ResolveContext.Options.ConditionalAccessReceiver, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ResolveGetter (ec))\n\t\t\t\treturn null;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tif (ConditionalAccess)\n\t\t\t\tthrow new NotSupportedException (\"null propagating operator assignment\");\n\n\t\t\tif (right_side == EmptyExpression.OutAccess) {\n\t\t\t\t// TODO: best_candidate can be null at this point\n\t\t\t\tINamedBlockVariable variable = null;\n\t\t\t\tif (best_candidate != null && ec.CurrentBlock.ParametersBlock.TopBlock.GetLocalName (best_candidate.Name, ec.CurrentBlock, ref variable) && variable is Linq.RangeVariable) {\n\t\t\t\t\tec.Report.Error (1939, loc, \"A range variable `{0}' may not be passes as `ref' or `out' parameter\",\n\t\t\t\t\t\tbest_candidate.Name);\n\t\t\t\t} else {\n\t\t\t\t\tright_side.DoResolveLValue (ec, this);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (eclass == ExprClass.Unresolved) {\n\t\t\t\tvar expr = OverloadResolve (ec, right_side);\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (expr != this)\n\t\t\t\t\treturn expr.ResolveLValue (ec, right_side);\n\t\t\t} else {\n\t\t\t\tResolveInstanceExpression (ec, right_side);\n\t\t\t}\n\n\t\t\tif (!ResolveSetter (ec))\n\t\t\t\treturn null;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tvoid EmitConditionalAccess (EmitContext ec, ref CallEmitter call, MethodSpec method, Arguments arguments)\n\t\t{\n\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());\n\n\t\t\tcall.Emit (ec, method, arguments, loc);\n\n\t\t\tec.CloseConditionalAccess (method.ReturnType != type && type.IsNullableType ? type : null);\n\t\t}\n\n\t\t//\n\t\t// Implements the IAssignMethod interface for assignments\n\t\t//\n\t\tpublic virtual void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.ConditionalAccess = ConditionalAccess;\n\t\t\tcall.InstanceExpression = InstanceExpression;\n\t\t\tif (has_await_arguments)\n\t\t\t\tcall.HasAwaitArguments = true;\n\t\t\telse\n\t\t\t\tcall.DuplicateArguments = emitting_compound_assignment;\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tEmitConditionalAccess (ec, ref call, Getter, Arguments);\n\t\t\telse\n\t\t\t\tcall.Emit (ec, Getter, Arguments, loc);\n\n\t\t\tif (call.HasAwaitArguments) {\n\t\t\t\tInstanceExpression = call.InstanceExpression;\n\t\t\t\tArguments = call.EmittedArguments;\n\t\t\t\thas_await_arguments = true;\n\t\t\t}\n\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\ttemp = new LocalTemporary (Type);\n\t\t\t\ttemp.Store (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic abstract void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound);\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec, false);\n\t\t}\n\n\t\tprotected override FieldExpr EmitToFieldSource (EmitContext ec)\n\t\t{\n\t\t\thas_await_arguments = true;\n\t\t\tEmit (ec, false);\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic abstract SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source);\n\n\t\tprotected abstract Expression OverloadResolve (ResolveContext rc, Expression right_side);\n\n\t\tbool ResolveGetter (ResolveContext rc)\n\t\t{\n\t\t\tif (!best_candidate.HasGet) {\n\t\t\t\tif (InstanceExpression != EmptyExpression.Null) {\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate);\n\t\t\t\t\trc.Report.Error (154, loc, \"The property or indexer `{0}' cannot be used in this context because it lacks the `get' accessor\",\n\t\t\t\t\t\tbest_candidate.GetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (!best_candidate.Get.IsAccessible (rc) || !best_candidate.Get.DeclaringType.IsAccessible (rc)) {\n\t\t\t\tif (best_candidate.HasDifferentAccessibility) {\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate.Get);\n\t\t\t\t\trc.Report.Error (271, loc, \"The property or indexer `{0}' cannot be used in this context because the get accessor is inaccessible\",\n\t\t\t\t\t\tTypeManager.CSharpSignature (best_candidate));\n\t\t\t\t} else {\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate.Get);\n\t\t\t\t\tErrorIsInaccesible (rc, best_candidate.Get.GetSignatureForError (), loc);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (best_candidate.HasDifferentAccessibility) {\n\t\t\t\tCheckProtectedMemberAccess (rc, best_candidate.Get);\n\t\t\t}\n\n\t\t\tgetter = CandidateToBaseOverride (rc, best_candidate.Get);\n\t\t\treturn true;\n\t\t}\n\n\t\tbool ResolveSetter (ResolveContext rc)\n\t\t{\n\t\t\tif (!best_candidate.HasSet) {\n\t\t\t\trc.Report.Error (200, loc, \"Property or indexer `{0}' cannot be assigned to (it is read-only)\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!best_candidate.Set.IsAccessible (rc) || !best_candidate.Set.DeclaringType.IsAccessible (rc)) {\n\t\t\t\tif (best_candidate.HasDifferentAccessibility) {\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate.Set);\n\t\t\t\t\trc.Report.Error (272, loc, \"The property or indexer `{0}' cannot be used in this context because the set accessor is inaccessible\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (best_candidate.Set);\n\t\t\t\t\tErrorIsInaccesible (rc, best_candidate.GetSignatureForError (), loc);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (best_candidate.HasDifferentAccessibility)\n\t\t\t\tCheckProtectedMemberAccess (rc, best_candidate.Set);\n\n\t\t\tsetter = CandidateToBaseOverride (rc, best_candidate.Set);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Fully resolved expression that evaluates to an Event\n\t/// </summary>\n\tpublic class EventExpr : MemberExpr, IAssignMethod\n\t{\n\t\treadonly EventSpec spec;\n\t\tMethodSpec op;\n\n\t\tpublic EventExpr (EventSpec spec, Location loc)\n\t\t{\n\t\t\tthis.spec = spec;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tprotected override TypeSpec DeclaringType {\n\t\t\tget {\n\t\t\t\treturn spec.DeclaringType;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn spec.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsInstance {\n\t\t\tget {\n\t\t\t\treturn !spec.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn spec.IsStatic;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string KindName {\n\t\t\tget { return \"event\"; }\n\t\t}\n\n\t\tpublic MethodSpec Operator {\n\t\t\tget {\n\t\t\t\treturn op;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)\n\t\t{\n\t\t\t//\n\t\t\t// If the event is local to this class and we are not lhs of +=/-= we transform ourselves into a FieldExpr\n\t\t\t//\n\t\t\tif (!ec.HasSet (ResolveContext.Options.CompoundAssignmentScope)) {\n\t\t\t\tif (spec.BackingField != null &&\n\t\t\t\t\t(spec.DeclaringType == ec.CurrentType || TypeManager.IsNestedChildOf (ec.CurrentType, spec.DeclaringType.MemberDefinition))) {\n\n\t\t\t\t\tspec.MemberDefinition.SetIsUsed ();\n\n\t\t\t\t\tif (!ec.IsObsolete) {\n\t\t\t\t\t\tObsoleteAttribute oa = spec.GetAttributeObsolete ();\n\t\t\t\t\t\tif (oa != null)\n\t\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, spec.GetSignatureForError (), loc, ec.Report);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((spec.Modifiers & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)\n\t\t\t\t\t\tError_AssignmentEventOnly (ec);\n\n\t\t\t\t\tFieldExpr ml = new FieldExpr (spec.BackingField, loc);\n\n\t\t\t\t\tInstanceExpression = null;\n\n\t\t\t\t\treturn ml.ResolveMemberAccess (ec, left, original);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.ResolveMemberAccess (ec, left, original);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tif (right_side == EmptyExpression.EventAddition) {\n\t\t\t\top = spec.AccessorAdd;\n\t\t\t} else if (right_side == EmptyExpression.EventSubtraction) {\n\t\t\t\top = spec.AccessorRemove;\n\t\t\t}\n\n\t\t\tif (op == null) {\n\t\t\t\tError_AssignmentEventOnly (ec);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\top = CandidateToBaseOverride (ec, op);\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.EventAccess;\n\t\t\ttype = spec.MemberType;\n\n\t\t\tResolveInstanceExpression (ec, null);\n\n\t\t\tif (!ec.HasSet (ResolveContext.Options.CompoundAssignmentScope)) {\n\t\t\t\tError_AssignmentEventOnly (ec);\n\t\t\t}\n\n\t\t\tDoBestMemberChecks (ec, spec);\n\t\t\treturn this;\n\t\t}\t\t\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t\t//Error_CannotAssign ();\n\t\t}\n\n\t\t#region IAssignMethod Members\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tif (leave_copy || !isCompound)\n\t\t\t\tthrow new NotImplementedException (\"EventExpr::EmitAssign\");\n\n\t\t\tArguments args = new Arguments (1);\n\t\t\targs.Add (new Argument (source));\n\n\t\t\t// TODO: Wrong, needs receiver\n//\t\t\tif (NullShortCircuit) {\n//\t\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());\n//\t\t\t}\n\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = InstanceExpression;\n\t\t\tcall.ConditionalAccess = ConditionalAccess;\n\t\t\tcall.EmitStatement (ec, op, args, loc);\n\n//\t\t\tif (NullShortCircuit)\n//\t\t\t\tec.CloseConditionalAccess (null);\n\t\t}\n\n\t\t#endregion\n\n\t\tvoid Error_AssignmentEventOnly (ResolveContext ec)\n\t\t{\n\t\t\tif (spec.DeclaringType == ec.CurrentType || TypeManager.IsNestedChildOf (ec.CurrentType, spec.DeclaringType.MemberDefinition)) {\n\t\t\t\tec.Report.Error (79, loc,\n\t\t\t\t\t\"The event `{0}' can only appear on the left hand side of `+=' or `-=' operator\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t} else {\n\t\t\t\tec.Report.Error (70, loc,\n\t\t\t\t\t\"The event `{0}' can only appear on the left hand side of += or -= when used outside of the type `{1}'\",\n\t\t\t\t\tGetSignatureForError (), spec.DeclaringType.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tprotected override void Error_CannotCallAbstractBase (ResolveContext rc, string name)\n\t\t{\n\t\t\tname = name.Substring (0, name.LastIndexOf ('.'));\n\t\t\tbase.Error_CannotCallAbstractBase (rc, name);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn TypeManager.CSharpSignature (spec);\n\t\t}\n\n\t\tpublic override void SetTypeArguments (ResolveContext ec, TypeArguments ta)\n\t\t{\n\t\t\tError_TypeArgumentsCannotBeUsed (ec, \"event\", GetSignatureForError (), loc);\n\t\t}\n\t}\n\n\tpublic class TemporaryVariableReference : VariableReference\n\t{\n\t\tpublic class Declarator : Statement\n\t\t{\n\t\t\tTemporaryVariableReference variable;\n\n\t\t\tpublic Declarator (TemporaryVariableReference variable)\n\t\t\t{\n\t\t\t\tthis.variable = variable;\n\t\t\t\tloc = variable.loc;\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\tvariable.li.CreateBuilder (ec);\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\t// Don't create sequence point\n\t\t\t\tDoEmit (ec);\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t\t// Nothing\n\t\t\t}\n\t\t}\n\n\t\tLocalVariable li;\n\n\t\tpublic TemporaryVariableReference (LocalVariable li, Location loc)\n\t\t{\n\t\t\tthis.li = li;\n\t\t\tthis.type = li.Type;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool IsLockedByStatement {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tset {\n\t\t\t}\n\t\t}\n\n\t\tpublic LocalVariable LocalInfo {\n\t\t    get {\n\t\t        return li;\n\t\t    }\n\t\t}\n\n\t\tpublic static TemporaryVariableReference Create (TypeSpec type, Block block, Location loc)\n\t\t{\n\t\t\tvar li = LocalVariable.CreateCompilerGenerated (type, block, loc);\n\t\t\treturn new TemporaryVariableReference (li, loc);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Variable;\n\n\t\t\t//\n\t\t\t// Don't capture temporary variables except when using\n\t\t\t// state machine redirection and block yields\n\t\t\t//\n\t\t\tif (ec.CurrentAnonymousMethod is StateMachineInitializer &&\n\t\t\t\t(ec.CurrentBlock.Explicit.HasYield || ec.CurrentBlock.Explicit.HasAwait) &&\n\t\t\t\tec.IsVariableCapturingRequired) {\n\t\t\t\tAnonymousMethodStorey storey = li.Block.Explicit.CreateAnonymousMethodStorey (ec);\n\t\t\t\tstorey.CaptureLocalVariable (ec, li);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\treturn Resolve (ec);\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tli.CreateBuilder (ec);\n\n\t\t\tEmit (ec, false);\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source)\n\t\t{\n\t\t\tli.CreateBuilder (ec);\n\n\t\t\tEmitAssign (ec, source, false, false);\n\t\t}\n\n\t\tpublic override HoistedVariable GetHoistedVariable (AnonymousExpression ae)\n\t\t{\n\t\t\treturn li.HoistedVariant;\n\t\t}\n\n\t\tpublic override bool IsFixed {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool IsRef {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget { throw new NotImplementedException (); }\n\t\t}\n\n\t\tpublic override void SetHasAddressTaken ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tprotected override ILocalVariable Variable {\n\t\t\tget { return li; }\n\t\t}\n\n\t\tpublic override VariableInfo VariableInfo {\n\t\t\tget { return null; }\n\t\t}\n\t}\n\n\t/// \n\t/// Handles `var' contextual keyword; var becomes a keyword only\n\t/// if no type called var exists in a variable scope\n\t/// \n\tclass VarExpr : SimpleName\n\t{\n\t\tpublic VarExpr (Location loc)\n\t\t\t: base (\"var\", loc)\n\t\t{\n\t\t}\n\n\t\tpublic bool InferType (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tif (type != null)\n\t\t\t\tthrow new InternalErrorException (\"An implicitly typed local variable could not be redefined\");\n\t\t\t\n\t\t\ttype = right_side.Type;\n\t\t\tif (type == InternalType.NullLiteral || type.Kind == MemberKind.Void || type == InternalType.AnonymousMethod || type == InternalType.MethodGroup) {\n\t\t\t\tec.Report.Error (815, loc,\n\t\t\t\t\t\"An implicitly typed local variable declaration cannot be initialized with `{0}'\",\n\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void Error_TypeOrNamespaceNotFound (IMemberContext ec)\n\t\t{\n\t\t\tif (ec.Module.Compiler.Settings.Version < LanguageVersion.V_3)\n\t\t\t\tbase.Error_TypeOrNamespaceNotFound (ec);\n\t\t\telse\n\t\t\t\tec.Module.Compiler.Report.Error (825, loc, \"The contextual keyword `var' may only appear within a local variable declaration\");\n\t\t}\n\t}\n\t\n\tpublic class InvalidStatementExpression : Statement\n\t{\n\t\tpublic Expression Expression {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\tpublic InvalidStatementExpression (Expression expr)\n\t\t{\n\t\t\tthis.Expression = expr;\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// nothing\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\t// nothing\n\t\t}\n\t\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\t// nothing\n\t\t}\n\t\t\n\t\tpublic override Mono.CSharp.Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override object Accept (Mono.CSharp.StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis(FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n}\t\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/enum.cs",
    "content": "//\n// enum.cs: Enum handling.\n//\n// Author: Miguel de Icaza (miguel@gnu.org)\n//         Ravi Pratap     (ravi@ximian.com)\n//         Marek Safar     (marek.safar@seznam.cz)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2003 Novell, Inc (http://www.novell.com)\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\n#endif\n\nnamespace Mono.CSharp {\n\n\tpublic class EnumMember : Const\n\t{\n\t\tclass EnumTypeExpr : TypeExpr\n\t\t{\n\t\t\tpublic override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments)\n\t\t\t{\n\t\t\t\ttype = ec.CurrentType;\n\t\t\t\teclass = ExprClass.Type;\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\n\t\tpublic EnumMember (Enum parent, MemberName name, Attributes attrs)\n\t\t\t: base (parent, new EnumTypeExpr (), Modifiers.PUBLIC, name, attrs)\n\t\t{\n\t\t}\n\n\t\tstatic bool IsValidEnumType (TypeSpec t)\n\t\t{\n\t\t\tswitch (t.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn t.IsEnum;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Constant ConvertInitializer (ResolveContext rc, Constant expr)\n\t\t{\n\t\t\tif (expr is EnumConstant)\n\t\t\t\texpr = ((EnumConstant) expr).Child;\n\n\t\t\tvar en = (Enum)Parent;\n\t\t\tvar underlying = en.UnderlyingType;\n\t\t\tif (expr != null) {\n\t\t\t\texpr = expr.ImplicitConversionRequired (rc, underlying);\n\t\t\t\tif (expr != null && !IsValidEnumType (expr.Type)) {\n\t\t\t\t\ten.Error_UnderlyingType (Location);\n\t\t\t\t\texpr = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr == null)\n\t\t\t\texpr = New.Constantify (underlying, Location);\n\n\t\t\treturn new EnumConstant (expr, MemberType);\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!ResolveMemberType ())\n\t\t\t\treturn false;\n\n\t\t\tconst FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal;\n\t\t\tFieldBuilder = Parent.TypeBuilder.DefineField (Name, MemberType.GetMetaInfo (), attr);\n\t\t\tspec = new ConstSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags, initializer);\n\n\t\t\tParent.MemberCache.AddMember (spec);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t}\n\n\t/// <summary>\n\t///   Enumeration container\n\t/// </summary>\n\tpublic class Enum : TypeDefinition\n\t{\n\t\t//\n\t\t// Implicit enum member initializer, used when no constant value is provided\n\t\t//\n\t\tsealed class ImplicitInitializer : Expression\n\t\t{\n\t\t\treadonly EnumMember prev;\n\t\t\treadonly EnumMember current;\n\n\t\t\tpublic ImplicitInitializer (EnumMember current, EnumMember prev)\n\t\t\t{\n\t\t\t\tthis.current = current;\n\t\t\t\tthis.prev = prev;\n\t\t\t}\n\n\t\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException (\"Missing Resolve call\");\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t\t{\n\t\t\t\t// We are the first member\n\t\t\t\tif (prev == null) {\n\t\t\t\t\treturn New.Constantify (current.Parent.Definition, Location);\n\t\t\t\t}\n\n\t\t\t\tvar c = ((ConstSpec) prev.Spec).GetConstant (rc) as EnumConstant;\n\t\t\t\ttry {\n\t\t\t\t\treturn c.Increment ();\n\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\trc.Report.Error (543, current.Location,\n\t\t\t\t\t\t\"The enumerator value `{0}' is outside the range of enumerator underlying type `{1}'\",\n\t\t\t\t\t\tcurrent.GetSignatureForError (), ((Enum) current.Parent).UnderlyingType.GetSignatureForError ());\n\n\t\t\t\t\treturn New.Constantify (current.Parent.Definition, current.Location);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException (\"Missing Resolve call\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static readonly string UnderlyingValueField = \"value__\";\n\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE;\n\n\t\treadonly FullNamedExpression underlying_type_expr;\n\n\t\tpublic Enum (TypeContainer parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)\n\t\t\t: base (parent, name, attrs, MemberKind.Enum)\n\t\t{\n\t\t\tunderlying_type_expr = type;\n\t\t\tvar accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;\n\t\t\tModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);\n\t\t\tspec = new EnumSpec (null, this, null, null, ModFlags);\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Enum;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression BaseTypeExpression {\n\t\t\tget {\n\t\t\t\treturn underlying_type_expr;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeAttributes TypeAttr {\n\t\t\tget {\n\t\t\t\treturn base.TypeAttr | TypeAttributes.Class | TypeAttributes.Sealed;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec UnderlyingType {\n\t\t\tget {\n\t\t\t\treturn ((EnumSpec) spec).UnderlyingType;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic void AddEnumMember (EnumMember em)\n\t\t{\n\t\t\tif (em.Name == UnderlyingValueField) {\n\t\t\t\tReport.Error (76, em.Location, \"An item in an enumeration cannot have an identifier `{0}'\",\n\t\t\t\t\tUnderlyingValueField);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tAddMember (em);\n\t\t}\n\n\t\tpublic void Error_UnderlyingType (Location loc)\n\t\t{\n\t\t\tReport.Error (1008, loc,\n\t\t\t\t\"Type byte, sbyte, short, ushort, int, uint, long or ulong expected\");\n\t\t}\n\n\t\tprotected override void DoDefineContainer ()\n\t\t{\n\t\t\tTypeSpec ut;\n\t\t\tif (underlying_type_expr != null) {\n\t\t\t\tut = underlying_type_expr.ResolveAsType (this);\n\t\t\t\tif (!EnumSpec.IsValidUnderlyingType (ut)) {\n\t\t\t\t\tError_UnderlyingType (underlying_type_expr.Location);\n\t\t\t\t\tut = null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tut = null;\n\t\t\t}\n\n\t\t\tif (ut == null)\n\t\t\t\tut = Compiler.BuiltinTypes.Int;\n\n\t\t\t((EnumSpec) spec).UnderlyingType = ut;\n\n\t\t\tTypeBuilder.DefineField (UnderlyingValueField, UnderlyingType.GetMetaInfo (),\n\t\t\t\tFieldAttributes.Public | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName);\n\n\t\t\tDefineBaseTypes ();\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tfor (int i = 0; i < Members.Count; ++i) {\n\t\t\t\tEnumMember em = (EnumMember) Members[i];\n\t\t\t\tif (em.Initializer == null) {\n\t\t\t\t\tem.Initializer = new ImplicitInitializer (em, i == 0 ? null : (EnumMember) Members[i - 1]);\n\t\t\t\t}\n\n\t\t\t\tem.Define ();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool IsUnmanagedType ()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tbase_type = Compiler.BuiltinTypes.Enum;\n\t\t\tbase_class = null;\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\tswitch (UnderlyingType.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tReport.Warning (3009, 1, Location, \"`{0}': base type `{1}' is not CLS-compliant\",\n\t\t\t\t\tGetSignatureForError (), UnderlyingType.GetSignatureForError ());\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tclass EnumSpec : TypeSpec\n\t{\n\t\tTypeSpec underlying;\n\n\t\tpublic EnumSpec (TypeSpec declaringType, ITypeDefinition definition, TypeSpec underlyingType, MetaType info, Modifiers modifiers)\n\t\t\t: base (MemberKind.Enum, declaringType, definition, info, modifiers | Modifiers.SEALED)\n\t\t{\n\t\t\tthis.underlying = underlyingType;\n\t\t}\n\n\t\tpublic TypeSpec UnderlyingType {\n\t\t\tget {\n\t\t\t\treturn underlying;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (underlying != null)\n\t\t\t\t\tthrow new InternalErrorException (\"UnderlyingType reset\");\n\n\t\t\t\tunderlying = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic static TypeSpec GetUnderlyingType (TypeSpec t)\n\t\t{\n\t\t\treturn ((EnumSpec) t.GetDefinition ()).UnderlyingType;\n\t\t}\n\n\t\tpublic static bool IsValidUnderlyingType (TypeSpec type)\n\t\t{\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs",
    "content": "//\n// eval.cs: Evaluation and Hosting API for the C# compiler\n//\n// Authors:\n//   Miguel de Icaza (miguel@gnome.org)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2011 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.IO;\nusing System.Text;\nusing System.Linq;\n\nnamespace Mono.CSharp\n{\n\n\t/// <summary>\n\t/// Experimental!\n\t/// </summary>\n\tpublic delegate void ValueModificationHandler (string variableName, int row, int column, object value);\n\n\t/// <summary>\n\t///   Evaluator: provides an API to evaluate C# statements and\n\t///   expressions dynamically.\n\t/// </summary>\n\t/// <remarks>\n\t///   This class exposes static methods to evaluate expressions in the\n\t///   current program.\n\t///\n\t///   To initialize the evaluator with a number of compiler\n\t///   options call the Init(string[]args) method with a set of\n\t///   command line options that the compiler recognizes.\n\t///\n\t///   To interrupt execution of a statement, you can invoke the\n\t///   Evaluator.Interrupt method.\n\t/// </remarks>\n\tpublic class Evaluator {\n\n\t\tenum ParseMode {\n\t\t\t// Parse silently, do not output any error messages\n\t\t\tSilent,\n\n\t\t\t// Report errors during parse\n\t\t\tReportErrors,\n\n\t\t\t// Auto-complete, means that the tokenizer will start producing\n\t\t\t// GETCOMPLETIONS tokens when it reaches a certain point.\n\t\t\tGetCompletions\n\t\t}\n\n\t\tstatic object evaluator_lock = new object ();\n\t\tstatic volatile bool invoking;\n\t\t\n#if !STATIC\n\t\tstatic int count;\n#endif\n\t\tstatic Thread invoke_thread;\n\n\t\treadonly Dictionary<string, Tuple<FieldSpec, FieldInfo>> fields;\n\n\t\tType base_class;\n\t\tbool inited;\n\t\tint startup_files;\n\n\t\treadonly CompilerContext ctx;\n\t\treadonly ModuleContainer module;\n\t\treadonly ReflectionImporter importer;\n\t\treadonly CompilationSourceFile source_file;\n\n\t\tint? listener_id;\n\t\t\n\t\tpublic Evaluator (CompilerContext ctx)\n\t\t{\n\t\t\tthis.ctx = ctx;\n\n\t\t\tmodule = new ModuleContainer (ctx);\n\t\t\tmodule.Evaluator = this;\n\n\t\t\tsource_file = new CompilationSourceFile (module, null);\n\t\t\tmodule.AddTypeContainer (source_file);\n\n\t\t\tstartup_files = ctx.SourceFiles.Count;\n\n\t\t\t// FIXME: Importer needs this assembly for internalsvisibleto\n\t\t\tmodule.SetDeclaringAssembly (new AssemblyDefinitionDynamic (module, \"evaluator\"));\n\t\t\timporter = new ReflectionImporter (module, ctx.BuiltinTypes);\n\n\t\t\tInteractiveBaseClass = typeof (InteractiveBase);\n\t\t\tfields = new Dictionary<string, Tuple<FieldSpec, FieldInfo>> ();\n\t\t}\n\n\t\tvoid Init ()\n\t\t{\n\t\t\tvar loader = new DynamicLoader (importer, ctx);\n\n\t\t\tRootContext.ToplevelTypes = module;\n\n\t\t\t//var startup_files = new List<string> ();\n\t\t\t//foreach (CompilationUnit file in Location.SourceFiles)\n\t\t\t//    startup_files.Add (file.Path);\n\n\t\t\tloader.LoadReferences (module);\n\t\t\tctx.BuiltinTypes.CheckDefinitions (module);\n\t\t\tmodule.InitializePredefinedTypes ();\n\n\t\t\tinited = true;\n\t\t}\n\n\t\tvoid ParseStartupFiles ()\n\t\t{\n\t\t\tDriver d = new Driver (ctx);\n\n\t\t\tLocation.Initialize (ctx.SourceFiles);\n\n\t\t\tvar parser_session = new ParserSession ();\n\t\t\tfor (int i = 0; i < startup_files; ++i) {\n\t\t\t\tvar sf = ctx.SourceFiles [i];\n\t\t\t\td.Parse (sf, module, parser_session, ctx.Report);\n\t\t\t}\n\t\t}\n\n\t\tvoid Reset ()\n\t\t{\n\t\t\tLocation.Reset ();\n\t\t\tLocation.Initialize (ctx.SourceFiles);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// When set evaluator will automatically wait on Task of async methods. When not\n\t\t/// set it's called responsibility to handle Task execution\n\t\t/// </summary>\n\t\tpublic bool WaitOnTask { get; set; }\n\n\t\t/// <summary>\n\t\t///   If true, turns type expressions into valid expressions\n\t\t///   and calls the describe method on it\n\t\t/// </summary>\n\t\tpublic bool DescribeTypeExpressions;\n\n\t\t/// <summary>\n\t\t///   Whether the evaluator will use terse syntax, and the semicolons at the end are optional\n\t\t/// </summary>\n\t\tpublic bool Terse = true;\n\n\t\t/// <summary>\n\t\t///   The base class for the classes that host the user generated code\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///\n\t\t///   This is the base class that will host the code\n\t\t///   executed by the Evaluator.  By default\n\t\t///   this is the Mono.CSharp.InteractiveBase class\n\t\t///   which is useful for interactive use.\n\t\t///\n\t\t///   By changing this property you can control the\n\t\t///   base class and the static members that are\n\t\t///   available to your evaluated code.\n\t\t/// </remarks>\n\t\tpublic Type InteractiveBaseClass {\n\t\t\tget {\n\t\t\t\treturn base_class;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tbase_class = value;\n\n\t\t\t\tif (value != null && typeof (InteractiveBase).IsAssignableFrom (value))\n\t\t\t\t\tInteractiveBase.Evaluator = this;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Interrupts the evaluation of an expression executing in Evaluate.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///   Use this method to interrupt long-running invocations.\n\t\t/// </remarks>\n\t\tpublic void Interrupt ()\n\t\t{\n\t\t\tif (!inited || !invoking)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tif (invoke_thread != null)\n\t\t\t\tinvoke_thread.Abort ();\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Compiles the input string and returns a delegate that represents the compiled code.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///\n\t\t///   Compiles the input string as a C# expression or\n\t\t///   statement, unlike the Evaluate method, the\n\t\t///   resulting delegate can be invoked multiple times\n\t\t///   without incurring in the compilation overhead.\n\t\t///\n\t\t///   If the return value of this function is null,\n\t\t///   this indicates that the parsing was complete.\n\t\t///   If the return value is a string it indicates\n\t\t///   that the input string was partial and that the\n\t\t///   invoking code should provide more code before\n\t\t///   the code can be successfully compiled.\n\t\t///\n\t\t///   If you know that you will always get full expressions or\n\t\t///   statements and do not care about partial input, you can use\n\t\t///   the other Compile overload. \n\t\t///\n\t\t///   On success, in addition to returning null, the\n\t\t///   compiled parameter will be set to the delegate\n\t\t///   that can be invoked to execute the code.\n\t\t///\n\t\t/// </remarks>\n\t\tpublic string Compile (string input, out CompiledMethod compiled)\n\t\t{\n\t\t\tif (input == null || input.Length == 0){\n\t\t\t\tcompiled = null;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlock (evaluator_lock){\n\t\t\t\tif (!inited) {\n\t\t\t\t\tInit ();\n\t\t\t\t\tParseStartupFiles ();\n\t\t\t\t} else {\n\t\t\t\t\tctx.Report.Printer.Reset ();\n\t\t\t\t}\n\n\t\t\t\tbool partial_input;\n\t\t\t\tCSharpParser parser = ParseString (ParseMode.Silent, input, out partial_input);\n\n\t\t\t\t// Terse mode, try to provide the trailing semicolon automatically.\n\t\t\t\tif (parser == null && Terse && partial_input){\n\t\t\t\t\tbool ignore;\n\n\t\t\t\t\t// check if the source would compile with a block, if so, we should not\n\t\t\t\t\t// add the semicolon.\n\t\t\t\t\tvar needs_block = ParseString (ParseMode.Silent, input + \"{}\", out ignore) != null;\n\t\t\t\t\tif (!needs_block)\n\t\t\t\t\t\tparser = ParseString (ParseMode.Silent, input + \";\", out ignore);\n\t\t\t\t}\n\t\t\t\tif (parser == null){\n\t\t\t\t\tcompiled = null;\n\t\t\t\t\tif (partial_input)\n\t\t\t\t\t\treturn input;\n\t\t\t\t\t\n\t\t\t\t\tParseString (ParseMode.ReportErrors, input, out partial_input);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tClass parser_result = parser.InteractiveResult;\n\t\t\t\tcompiled = CompileBlock (parser_result, parser.undo, ctx.Report);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Compiles the input string and returns a delegate that represents the compiled code.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///\n\t\t///   Compiles the input string as a C# expression or\n\t\t///   statement, unlike the Evaluate method, the\n\t\t///   resulting delegate can be invoked multiple times\n\t\t///   without incurring in the compilation overhead.\n\t\t///\n\t\t///   This method can only deal with fully formed input\n\t\t///   strings and does not provide a completion mechanism.\n\t\t///   If you must deal with partial input (for example for\n\t\t///   interactive use) use the other overload. \n\t\t///\n\t\t///   On success, a delegate is returned that can be used\n\t\t///   to invoke the method.\n\t\t///\n\t\t/// </remarks>\n\t\tpublic CompiledMethod Compile (string input)\n\t\t{\n\t\t\tCompiledMethod compiled;\n\n\t\t\t// Ignore partial inputs\n\t\t\tif (Compile (input, out compiled) != null){\n\t\t\t\t// Error, the input was partial.\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Either null (on error) or the compiled method.\n\t\t\treturn compiled;\n\t\t}\n\n\t\tstatic MethodInfo listener_proxy_value;\n\t\tinternal void EmitValueChangedCallback (EmitContext ec, string name, TypeSpec type, Location loc)\n\t\t{\n\t\t\tif (listener_id == null)\n\t\t\t\tlistener_id = ListenerProxy.Register (ModificationListener);\n\n\t\t\tif (listener_proxy_value == null)\n\t\t\t\tlistener_proxy_value = typeof (ListenerProxy).GetMethod (\"ValueChanged\");\n\n#if STATIC\n\t\t\tthrow new NotSupportedException ();\n#else\n\t\t\t// object value, int row, int col, string name, int listenerId\n\t\t\tif (type.IsStructOrEnum)\n\t\t\t\tec.Emit (OpCodes.Box, type);\n\n\t\t\tec.EmitInt (loc.Row);\n\t\t\tec.EmitInt (loc.Column);\n\t\t\tec.Emit (OpCodes.Ldstr, name);\n\t\t\tec.EmitInt (listener_id.Value);\n\t\t\tec.Emit (OpCodes.Call, listener_proxy_value);\n#endif\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Evaluates and expression or statement and returns any result values.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///   Evaluates the input string as a C# expression or\n\t\t///   statement.  If the input string is an expression\n\t\t///   the result will be stored in the result variable\n\t\t///   and the result_set variable will be set to true.\n\t\t///\n\t\t///   It is necessary to use the result/result_set\n\t\t///   pair to identify when a result was set (for\n\t\t///   example, execution of user-provided input can be\n\t\t///   an expression, a statement or others, and\n\t\t///   result_set would only be set if the input was an\n\t\t///   expression.\n\t\t///\n\t\t///   If the return value of this function is null,\n\t\t///   this indicates that the parsing was complete.\n\t\t///   If the return value is a string, it indicates\n\t\t///   that the input is partial and that the user\n\t\t///   should provide an updated string.\n\t\t/// </remarks>\n\t\tpublic string Evaluate (string input, out object result, out bool result_set)\n\t\t{\n\t\t\tCompiledMethod compiled;\n\n\t\t\tresult_set = false;\n\t\t\tresult = null;\n\n\t\t\tinput = Compile (input, out compiled);\n\t\t\tif (input != null)\n\t\t\t\treturn input;\n\t\t\t\n\t\t\tif (compiled == null)\n\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t//\n\t\t\t// The code execution does not need to keep the compiler lock\n\t\t\t//\n\t\t\tobject retval = typeof (QuitValue);\n\n\t\t\ttry {\n\t\t\t\tinvoke_thread = System.Threading.Thread.CurrentThread;\n\t\t\t\tinvoking = true;\n\t\t\t\tcompiled (ref retval);\n\t\t\t} catch (ThreadAbortException e){\n\t\t\t\tThread.ResetAbort ();\n\t\t\t\tConsole.WriteLine (\"Interrupted!\\n{0}\", e);\n\t\t\t} finally {\n\t\t\t\tinvoking = false;\n\n\t\t\t\tif (listener_id != null) {\n\t\t\t\t\tListenerProxy.Unregister (listener_id.Value);\n\t\t\t\t\tlistener_id = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// We use a reference to a compiler type, in this case\n\t\t\t// Driver as a flag to indicate that this was a statement\n\t\t\t//\n\t\t\tif (!ReferenceEquals (retval, typeof (QuitValue))) {\n\t\t\t\tresult_set = true;\n\t\t\t\tresult = retval; \n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic string [] GetCompletions (string input, out string prefix)\n\t\t{\n\t\t\tprefix = \"\";\n\t\t\tif (input == null || input.Length == 0)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tlock (evaluator_lock){\n\t\t\t\tif (!inited)\n\t\t\t\t\tInit ();\n\t\t\t\t\n\t\t\t\tbool partial_input;\n\t\t\t\tCSharpParser parser = ParseString (ParseMode.GetCompletions, input, out partial_input);\n\t\t\t\tif (parser == null){\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tClass host = parser.InteractiveResult;\n\n\t\t\t\tvar base_class_imported = importer.ImportType (base_class);\n\t\t\t\tvar baseclass_list = new List<FullNamedExpression> (1) {\n\t\t\t\t\tnew TypeExpression (base_class_imported, host.Location)\n\t\t\t\t};\n\t\t\t\thost.SetBaseTypes (baseclass_list);\n\n#if NET_4_0\n\t\t\t\tvar access = AssemblyBuilderAccess.RunAndCollect;\n#else\n\t\t\t\tvar access = AssemblyBuilderAccess.Run;\n#endif\n\t\t\t\tvar a = new AssemblyDefinitionDynamic (module, \"completions\");\n\t\t\t\ta.Create (AppDomain.CurrentDomain, access);\n\t\t\t\tmodule.SetDeclaringAssembly (a);\n\n\t\t\t\t// Need to setup MemberCache\n\t\t\t\thost.CreateContainer ();\n\t\t\t\t// Need to setup base type\n\t\t\t\thost.DefineContainer ();\n\n\t\t\t\tvar method = host.Members[0] as Method;\n\t\t\t\tBlockContext bc = new BlockContext (method, method.Block, ctx.BuiltinTypes.Void);\n\n\t\t\t\ttry {\n\t\t\t\t\tmethod.Block.Resolve (bc, method);\n\t\t\t\t} catch (CompletionResult cr) {\n\t\t\t\t\tprefix = cr.BaseText;\n\t\t\t\t\treturn cr.Result;\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Executes the given expression or statement.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///    Executes the provided statement, returns true\n\t\t///    on success, false on parsing errors.  Exceptions\n\t\t///    might be thrown by the called code.\n\t\t/// </remarks>\n\t\tpublic bool Run (string statement)\n\t\t{\n\t\t\tobject result;\n\t\t\tbool result_set;\n\n\t\t\treturn Evaluate (statement, out result, out result_set) == null;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Evaluates and expression or statement and returns the result.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///   Evaluates the input string as a C# expression or\n\t\t///   statement and returns the value.   \n\t\t///\n\t\t///   This method will throw an exception if there is a syntax error,\n\t\t///   of if the provided input is not an expression but a statement.\n\t\t/// </remarks>\n\t\tpublic object Evaluate (string input)\n\t\t{\n\t\t\tobject result;\n\t\t\tbool result_set;\n\t\t\t\n\t\t\tstring r = Evaluate (input, out result, out result_set);\n\n\t\t\tif (r != null)\n\t\t\t\tthrow new ArgumentException (\"Syntax error on input: partial input\");\n\t\t\t\n\t\t\tif (result_set == false)\n\t\t\t\tthrow new ArgumentException (\"The expression failed to resolve\");\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Experimental!\n\t\t/// </summary>\n\t\tpublic ValueModificationHandler ModificationListener { get; set; }\n\n\t\tenum InputKind {\n\t\t\tEOF,\n\t\t\tStatementOrExpression,\n\t\t\tCompilationUnit,\n\t\t\tError\n\t\t}\n\n\t\t//\n\t\t// Deambiguates the input string to determine if we\n\t\t// want to process a statement or if we want to\n\t\t// process a compilation unit.\n\t\t//\n\t\t// This is done using a top-down predictive parser,\n\t\t// since the yacc/jay parser can not deambiguage this\n\t\t// without more than one lookahead token.   There are very\n\t\t// few ambiguities.\n\t\t//\n\t\tInputKind ToplevelOrStatement (SeekableStreamReader seekable)\n\t\t{\n\t\t\tTokenizer tokenizer = new Tokenizer (seekable, source_file, new ParserSession (), ctx.Report);\n\t\t\t\n\t\t\t// Prefer contextual block keywords over identifiers\n\t\t\ttokenizer.parsing_block++;\n\n\t\t\tint t = tokenizer.token ();\n\t\t\tswitch (t){\n\t\t\tcase Token.EOF:\n\t\t\t\treturn InputKind.EOF;\n\t\t\t\t\n\t\t\t// These are toplevels\n\t\t\tcase Token.EXTERN:\n\t\t\tcase Token.OPEN_BRACKET:\n\t\t\tcase Token.ABSTRACT:\n\t\t\tcase Token.CLASS:\n\t\t\tcase Token.ENUM:\n\t\t\tcase Token.INTERFACE:\n\t\t\tcase Token.INTERNAL:\n\t\t\tcase Token.NAMESPACE:\n\t\t\tcase Token.PRIVATE:\n\t\t\tcase Token.PROTECTED:\n\t\t\tcase Token.PUBLIC:\n\t\t\tcase Token.SEALED:\n\t\t\tcase Token.STATIC:\n\t\t\tcase Token.STRUCT:\n\t\t\t\treturn InputKind.CompilationUnit;\n\t\t\t\t\n\t\t\t// Definitely expression\n\t\t\tcase Token.FIXED:\n\t\t\tcase Token.BOOL:\n\t\t\tcase Token.BYTE:\n\t\t\tcase Token.CHAR:\n\t\t\tcase Token.DECIMAL:\n\t\t\tcase Token.DOUBLE:\n\t\t\tcase Token.FLOAT:\n\t\t\tcase Token.INT:\n\t\t\tcase Token.LONG:\n\t\t\tcase Token.NEW:\n\t\t\tcase Token.OBJECT:\n\t\t\tcase Token.SBYTE:\n\t\t\tcase Token.SHORT:\n\t\t\tcase Token.STRING:\n\t\t\tcase Token.UINT:\n\t\t\tcase Token.ULONG:\n\t\t\t\treturn InputKind.StatementOrExpression;\n\n\t\t\t// These need deambiguation help\n\t\t\tcase Token.USING:\n\t\t\t\tt = tokenizer.token ();\n\t\t\t\tif (t == Token.EOF)\n\t\t\t\t\treturn InputKind.EOF;\n\n\t\t\t\tif (t == Token.IDENTIFIER)\n\t\t\t\t\treturn InputKind.CompilationUnit;\n\t\t\t\treturn InputKind.StatementOrExpression;\n\n\n\t\t\t// Distinguish between:\n\t\t\t//    delegate opt_anonymous_method_signature block\n\t\t\t//    delegate type \n\t\t\tcase Token.DELEGATE:\n\t\t\t\tt = tokenizer.token ();\n\t\t\t\tif (t == Token.EOF)\n\t\t\t\t\treturn InputKind.EOF;\n\t\t\t\tif (t == Token.OPEN_PARENS || t == Token.OPEN_BRACE)\n\t\t\t\t\treturn InputKind.StatementOrExpression;\n\t\t\t\treturn InputKind.CompilationUnit;\n\n\t\t\t// Distinguih between:\n\t\t\t//    unsafe block\n\t\t\t//    unsafe as modifier of a type declaration\n\t\t\tcase Token.UNSAFE:\n\t\t\t\tt = tokenizer.token ();\n\t\t\t\tif (t == Token.EOF)\n\t\t\t\t\treturn InputKind.EOF;\n\t\t\t\tif (t == Token.OPEN_PARENS)\n\t\t\t\t\treturn InputKind.StatementOrExpression;\n\t\t\t\treturn InputKind.CompilationUnit;\n\t\t\t\t\n\t\t        // These are errors: we list explicitly what we had\n\t\t\t// from the grammar, ERROR and then everything else\n\n\t\t\tcase Token.READONLY:\n\t\t\tcase Token.OVERRIDE:\n\t\t\tcase Token.ERROR:\n\t\t\t\treturn InputKind.Error;\n\n\t\t\t// This catches everything else allowed by\n\t\t\t// expressions.  We could add one-by-one use cases\n\t\t\t// if needed.\n\t\t\tdefault:\n\t\t\t\treturn InputKind.StatementOrExpression;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\n\t\t// Parses the string @input and returns a CSharpParser if succeeful.\n\t\t//\n\t\t// if @silent is set to true then no errors are\n\t\t// reported to the user.  This is used to do various calls to the\n\t\t// parser and check if the expression is parsable.\n\t\t//\n\t\t// @partial_input: if @silent is true, then it returns whether the\n\t\t// parsed expression was partial, and more data is needed\n\t\t//\n\t\tCSharpParser ParseString (ParseMode mode, string input, out bool partial_input)\n\t\t{\n\t\t\tpartial_input = false;\n\t\t\tReset ();\n\n\t\t\tvar enc = ctx.Settings.Encoding;\n\t\t\tvar s = new MemoryStream (enc.GetBytes (input));\n\t\t\tSeekableStreamReader seekable = new SeekableStreamReader (s, enc);\n\n\t\t\tInputKind kind = ToplevelOrStatement (seekable);\n\t\t\tif (kind == InputKind.Error){\n\t\t\t\tif (mode == ParseMode.ReportErrors)\n\t\t\t\t\tctx.Report.Error (-25, \"Detection Parsing Error\");\n\t\t\t\tpartial_input = false;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (kind == InputKind.EOF){\n\t\t\t\tif (mode == ParseMode.ReportErrors)\n\t\t\t\t\tConsole.Error.WriteLine (\"Internal error: EOF condition should have been detected in a previous call with silent=true\");\n\t\t\t\tpartial_input = true;\n\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t}\n\t\t\tseekable.Position = 0;\n\n\t\t\tsource_file.DeclarationFound = false;\n\t\t\tCSharpParser parser = new CSharpParser (seekable, source_file, new ParserSession ());\n\n\t\t\tif (kind == InputKind.StatementOrExpression){\n\t\t\t\tparser.Lexer.putback_char = Tokenizer.EvalStatementParserCharacter;\n\t\t\t\tparser.Lexer.parsing_block++;\n\t\t\t\tctx.Settings.StatementMode = true;\n\t\t\t} else {\n\t\t\t\tparser.Lexer.putback_char = Tokenizer.EvalCompilationUnitParserCharacter;\n\t\t\t\tctx.Settings.StatementMode = false;\n\t\t\t}\n\n\t\t\tif (mode == ParseMode.GetCompletions)\n\t\t\t\tparser.Lexer.CompleteOnEOF = true;\n\n\t\t\tReportPrinter old_printer = null;\n\t\t\tif ((mode == ParseMode.Silent || mode == ParseMode.GetCompletions))\n\t\t\t\told_printer = ctx.Report.SetPrinter (new StreamReportPrinter (TextWriter.Null));\n\n\t\t\ttry {\n\t\t\t\tparser.parse ();\n\t\t\t} finally {\n\t\t\t\tif (ctx.Report.Errors != 0){\n\t\t\t\t\tif (mode != ParseMode.ReportErrors  && parser.UnexpectedEOF)\n\t\t\t\t\t\tpartial_input = true;\n\n\t\t\t\t\tif (parser.undo != null)\n\t\t\t\t\t\tparser.undo.ExecuteUndo ();\n\n\t\t\t\t\tparser = null;\n\t\t\t\t}\n\n\t\t\t\tif (old_printer != null)\n\t\t\t\t\tctx.Report.SetPrinter (old_printer);\n\t\t\t}\n\t\t\treturn parser;\n\t\t}\n\n\t\tCompiledMethod CompileBlock (Class host, Undo undo, Report Report)\n\t\t{\n#if STATIC\n\t\t\tthrow new NotSupportedException ();\n#else\n\t\t\tstring current_debug_name = \"eval-\" + count + \".dll\";\n\t\t\t++count;\n\n\t\t\tAssemblyDefinitionDynamic assembly;\n\t\t\tAssemblyBuilderAccess access;\n\n\t\t\tif (Environment.GetEnvironmentVariable (\"SAVE\") != null) {\n\t\t\t\taccess = AssemblyBuilderAccess.RunAndSave;\n\t\t\t\tassembly = new AssemblyDefinitionDynamic (module, current_debug_name, current_debug_name);\n\t\t\t\tassembly.Importer = importer;\n\t\t\t} else {\n#if NET_4_0\n\t\t\t\taccess = AssemblyBuilderAccess.RunAndCollect;\n#else\n\t\t\t\taccess = AssemblyBuilderAccess.Run;\n#endif\n\t\t\t\tassembly = new AssemblyDefinitionDynamic (module, current_debug_name);\n\t\t\t}\n\n\t\t\tassembly.Create (AppDomain.CurrentDomain, access);\n\n\t\t\tMethod expression_method;\n\t\t\tif (host != null) {\n\t\t\t\tvar base_class_imported = importer.ImportType (base_class);\n\t\t\t\tvar baseclass_list = new List<FullNamedExpression> (1) {\n\t\t\t\t\tnew TypeExpression (base_class_imported, host.Location)\n\t\t\t\t};\n\n\t\t\t\thost.SetBaseTypes (baseclass_list);\n\n\t\t\t\texpression_method = (Method) host.Members[0];\n\n\t\t\t\tif ((expression_method.ModFlags & Modifiers.ASYNC) != 0) {\n\t\t\t\t\t//\n\t\t\t\t\t// Host method is async. When WaitOnTask is set we wrap it with wait\n\t\t\t\t\t//\n\t\t\t\t\t// void AsyncWait (ref object $retval) {\n\t\t\t\t\t//\t$retval = Host();\n\t\t\t\t\t//\t((Task)$retval).Wait();  // When WaitOnTask is set\n\t\t\t\t\t// }\n\t\t\t\t\t//\n\t\t\t\t\tvar p = new ParametersCompiled (\n\t\t\t\t\t\tnew Parameter (new TypeExpression (module.Compiler.BuiltinTypes.Object, Location.Null), \"$retval\", Parameter.Modifier.REF, null, Location.Null)\n\t\t\t\t\t);\n\n\t\t\t\t\tvar method = new Method(host, new TypeExpression(module.Compiler.BuiltinTypes.Void, Location.Null),\n\t\t\t\t\t\tModifiers.PUBLIC | Modifiers.STATIC, new MemberName(\"AsyncWait\"), p, null);\n\n\t\t\t\t\tmethod.Block = new ToplevelBlock(method.Compiler, p, Location.Null);\n\t\t\t\t\tmethod.Block.AddStatement(new StatementExpression (new SimpleAssign(\n\t\t\t\t\t\tnew SimpleName(p [0].Name, Location.Null),\n\t\t\t\t\t\tnew Invocation(new SimpleName(expression_method.MemberName.Name, Location.Null), new Arguments(0)),\n\t\t\t\t\t\tLocation.Null), Location.Null));\n\n\t\t\t\t\tif (WaitOnTask) {\n\t\t\t\t\t\tvar task = new Cast (expression_method.TypeExpression, new SimpleName (p [0].Name, Location.Null), Location.Null);\n\n\t\t\t\t\t\tmethod.Block.AddStatement (new StatementExpression (new Invocation (\n\t\t\t\t\t\t\t\tnew MemberAccess (task, \"Wait\", Location.Null),\n\t\t\t\t\t\t\tnew Arguments (0)), Location.Null));\n\t\t\t\t\t}\n\n\t\t\t\t\thost.AddMember(method);\n\n\t\t\t\t\texpression_method = method;\n\t\t\t\t}\n\n\t\t\t\thost.CreateContainer();\n\t\t\t\thost.DefineContainer();\n\t\t\t\thost.Define();\n\n\t\t\t} else {\n\t\t\t\texpression_method = null;\n\t\t\t}\n\n\t\t\tmodule.CreateContainer ();\n\n\t\t\t// Disable module and source file re-definition checks\n\t\t\tmodule.EnableRedefinition ();\n\t\t\tsource_file.EnableRedefinition ();\n\n\t\t\tmodule.Define ();\n\n\t\t\tif (Report.Errors != 0){\n\t\t\t\tif (undo != null)\n\t\t\t\t\tundo.ExecuteUndo ();\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (host != null){\n\t\t\t\thost.PrepareEmit ();\n\t\t\t\thost.EmitContainer ();\n\t\t\t}\n\t\t\t\n\t\t\tmodule.EmitContainer ();\n\n\t\t\tif (Report.Errors != 0){\n\t\t\t\tif (undo != null)\n\t\t\t\t\tundo.ExecuteUndo ();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tmodule.CloseContainer ();\n\t\t\tif (host != null)\n\t\t\t\thost.CloseContainer ();\n\n\t\t\tif (access == AssemblyBuilderAccess.RunAndSave)\n\t\t\t\tassembly.Save ();\n\n\t\t\tif (host == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t//\n\t\t\t// Unlike Mono, .NET requires that the MethodInfo is fetched, it cant\n\t\t\t// work from MethodBuilders.   Retarded, I know.\n\t\t\t//\n\t\t\tvar tt = assembly.Builder.GetType (host.TypeBuilder.Name);\n\t\t\tvar mi = tt.GetMethod (expression_method.MemberName.Name);\n\n\t\t\t//\n\t\t\t// We need to then go from FieldBuilder to FieldInfo\n\t\t\t// or reflection gets confused (it basically gets confused, and variables override each\n\t\t\t// other).\n\t\t\t//\n\t\t\tforeach (var member in host.Members) {\n\t\t\t\tvar field = member as Field;\n\t\t\t\tif (field == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar fi = tt.GetField (field.Name);\n\n\t\t\t\tTuple<FieldSpec, FieldInfo> old;\n\n\t\t\t\t// If a previous value was set, nullify it, so that we do\n\t\t\t\t// not leak memory\n\t\t\t\tif (fields.TryGetValue (field.Name, out old)) {\n\t\t\t\t\tif (old.Item1.MemberType.IsStruct) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// TODO: Clear fields for structs\n\t\t\t\t\t\t//\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\told.Item2.SetValue (null, null);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfields[field.Name] = Tuple.Create (field.Spec, fi);\n\t\t\t}\n\t\t\t\n\t\t\treturn (CompiledMethod) System.Delegate.CreateDelegate (typeof (CompiledMethod), mi);\n#endif\n\t\t}\n\n\t\t/// <summary>\n\t\t///   A sentinel value used to indicate that no value was\n\t\t///   was set by the compiled function.   This is used to\n\t\t///   differentiate between a function not returning a\n\t\t///   value and null.\n\t\t/// </summary>\n\t\tinternal static class QuitValue { }\n\n\t\tinternal Tuple<FieldSpec, FieldInfo> LookupField (string name)\n\t\t{\n\t\t\tTuple<FieldSpec, FieldInfo> fi;\n\t\t\tfields.TryGetValue (name, out fi);\n\t\t\treturn fi;\n\t\t}\n\n\t\tstatic string Quote (string s)\n\t\t{\n\t\t\tif (s.IndexOf ('\"') != -1)\n\t\t\t\ts = s.Replace (\"\\\"\", \"\\\\\\\"\");\n\t\t\t\n\t\t\treturn \"\\\"\" + s + \"\\\"\";\n\t\t}\n\n\t\tpublic string GetUsing ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\t// TODO:\n\t\t\t//foreach (object x in ns.using_alias_list)\n\t\t\t//    sb.AppendFormat (\"using {0};\\n\", x);\n\n\t\t\tforeach (var ue in source_file.Usings) {\n\t\t\t\tsb.AppendFormat (\"using {0};\", ue.ToString ());\n\t\t\t\tsb.Append (Environment.NewLine);\n\t\t\t}\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tinternal List<string> GetUsingList ()\n\t\t{\n\t\t\tvar res = new List<string> ();\n\n\t\t\tforeach (var ue in source_file.Usings) {\n\t\t\t\tif (ue.Alias != null || ue.ResolvedExpression == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tres.Add (ue.NamespaceExpression.Name);\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\t\t\n\t\tinternal string [] GetVarNames ()\n\t\t{\n\t\t\tlock (evaluator_lock){\n\t\t\t\treturn new List<string> (fields.Keys).ToArray ();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string GetVars ()\n\t\t{\n\t\t\tlock (evaluator_lock){\n\t\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\t\t\n\t\t\t\tforeach (var de in fields){\n\t\t\t\t\tvar fi = LookupField (de.Key);\n\t\t\t\t\tobject value;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvalue = fi.Item2.GetValue (null);\n\t\t\t\t\t\tif (value is string)\n\t\t\t\t\t\t\tvalue = Quote ((string)value);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tvalue = \"<error reading value>\";\n\t\t\t\t\t}\n\n\t\t\t\t\tsb.AppendFormat (\"{0} {1} = {2}\", fi.Item1.MemberType.GetSignatureForError (), de.Key, value);\n\t\t\t\t\tsb.AppendLine ();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn sb.ToString ();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///    Loads the given assembly and exposes the API to the user.\n\t\t/// </summary>\n\t\tpublic void LoadAssembly (string file)\n\t\t{\n\t\t\tvar loader = new DynamicLoader (importer, ctx);\n\t\t\tvar assembly = loader.LoadAssemblyFile (file, false);\n\t\t\tif (assembly == null)\n\t\t\t\treturn;\n\n\t\t\tlock (evaluator_lock){\n\t\t\t\timporter.ImportAssembly (assembly, module.GlobalRootNamespace);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///    Exposes the API of the given assembly to the Evaluator\n\t\t/// </summary>\n\t\tpublic void ReferenceAssembly (Assembly a)\n\t\t{\n\t\t\tlock (evaluator_lock){\n\t\t\t\timporter.ImportAssembly (a, module.GlobalRootNamespace);\n\t\t\t}\n\t\t}\n\t}\n\n\t\n\t/// <summary>\n\t///   A delegate that can be used to invoke the\n\t///   compiled expression or statement.\n\t/// </summary>\n\t/// <remarks>\n\t///   Since the Compile methods will compile\n\t///   statements and expressions into the same\n\t///   delegate, you can tell if a value was returned\n\t///   by checking whether the returned value is of type\n\t///   NoValueSet.   \n\t/// </remarks>\n\t\n\tpublic delegate void CompiledMethod (ref object retvalue);\n\n\t/// <summary>\n\t///   The default base class for every interaction line\n\t/// </summary>\n\t/// <remarks>\n\t///   The expressions and statements behave as if they were\n\t///   a static method of this class.   The InteractiveBase class\n\t///   contains a number of useful methods, but can be overwritten\n\t///   by setting the InteractiveBaseType property in the Evaluator\n\t/// </remarks>\n\tpublic class InteractiveBase {\n\t\t/// <summary>\n\t\t///   Determines where the standard output of methods in this class will go. \n\t\t/// </summary>\n\t\tpublic static TextWriter Output = Console.Out;\n\n\t\t/// <summary>\n\t\t///   Determines where the standard error of methods in this class will go. \n\t\t/// </summary>\n\t\tpublic static TextWriter Error = Console.Error;\n\n\t\t/// <summary>\n\t\t///   The primary prompt used for interactive use.\n\t\t/// </summary>\n\t\tpublic static string Prompt             = \"csharp> \";\n\n\t\t/// <summary>\n\t\t///   The secondary prompt used for interactive use (used when\n\t\t///   an expression is incomplete).\n\t\t/// </summary>\n\t\tpublic static string ContinuationPrompt = \"      > \";\n\n\t\t/// <summary>\n\t\t///   Used to signal that the user has invoked the  `quit' statement.\n\t\t/// </summary>\n\t\tpublic static bool QuitRequested;\n\n\t\tpublic static Evaluator Evaluator;\n\t\t\n\t\t/// <summary>\n\t\t///   Shows all the variables defined so far.\n\t\t/// </summary>\n\t\tstatic public void ShowVars ()\n\t\t{\n\t\t\tOutput.Write (Evaluator.GetVars ());\n\t\t\tOutput.Flush ();\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Displays the using statements in effect at this point. \n\t\t/// </summary>\n\t\tstatic public void ShowUsing ()\n\t\t{\n\t\t\tOutput.Write (Evaluator.GetUsing ());\n\t\t\tOutput.Flush ();\n\t\t}\n\t\n\t\t/// <summary>\n\t\t///   Times the execution of the given delegate\n\t\t/// </summary>\n\t\tstatic public TimeSpan Time (Action a)\n\t\t{\n\t\t\tDateTime start = DateTime.Now;\n\t\t\ta ();\n\t\t\treturn DateTime.Now - start;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///   Loads the assemblies from a package\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///   Loads the assemblies from a package.   This is equivalent\n\t\t///   to passing the -pkg: command line flag to the C# compiler\n\t\t///   on the command line. \n\t\t/// </remarks>\n\t\tstatic public void LoadPackage (string pkg)\n\t\t{\n\t\t\tif (pkg == null){\n\t\t\t\tError.WriteLine (\"Invalid package specified\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstring pkgout = Driver.GetPackageFlags (pkg, null);\n\n\t\t\tstring [] xargs = pkgout.Trim (new Char [] {' ', '\\n', '\\r', '\\t'}).\n\t\t\t\tSplit (new Char [] { ' ', '\\t'});\n\n\t\t\tforeach (string s in xargs){\n\t\t\t\tif (s.StartsWith (\"-r:\") || s.StartsWith (\"/r:\") || s.StartsWith (\"/reference:\")){\n\t\t\t\t\tstring lib = s.Substring (s.IndexOf (':')+1);\n\n\t\t\t\t\tEvaluator.LoadAssembly (lib);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Loads the assembly\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///   Loads the specified assembly and makes its types\n\t\t///   available to the evaluator.  This is equivalent\n\t\t///   to passing the -pkg: command line flag to the C#\n\t\t///   compiler on the command line.\n\t\t/// </remarks>\n\t\tstatic public void LoadAssembly (string assembly)\n\t\t{\n\t\t\tEvaluator.LoadAssembly (assembly);\n\t\t}\n\n\t\tstatic public void print (object obj)\n\t\t{\n\t\t\tOutput.WriteLine (obj);\n\t\t}\n\n\t\tstatic public void print (string fmt, params object [] args)\n\t\t{\n\t\t\tOutput.WriteLine (fmt, args);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///   Returns a list of available static methods. \n\t\t/// </summary>\n\t\tstatic public string help {\n\t\t\tget {\n\t\t\t\treturn \"Static methods:\\n\" +\n\t\t\t\t\t\"  Describe (object);       - Describes the object's type\\n\" +\n\t\t\t\t\t\"  LoadPackage (package);   - Loads the given Package (like -pkg:FILE)\\n\" +\n\t\t\t\t\t\"  LoadAssembly (assembly); - Loads the given assembly (like -r:ASSEMBLY)\\n\" +\n\t\t\t\t\t\"  ShowVars ();             - Shows defined local variables.\\n\" +\n\t\t\t\t\t\"  ShowUsing ();            - Show active using declarations.\\n\" +\n\t\t\t\t\t\"  Prompt                   - The prompt used by the C# shell\\n\" +\n\t\t\t\t\t\"  ContinuationPrompt       - The prompt for partial input\\n\" +\n\t\t\t\t\t\"  Time (() => { });        - Times the specified code\\n\" +\n\t\t\t\t\t\"  print (obj);             - Shorthand for Console.WriteLine\\n\" +\n\t\t\t\t\t\"  quit;                    - You'll never believe it - this quits the repl!\\n\" +\n\t\t\t\t\t\"  help;                    - This help text\\n\";\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Indicates to the read-eval-print-loop that the interaction should be finished. \n\t\t/// </summary>\n\t\tstatic public object quit {\n\t\t\tget {\n\t\t\t\tQuitRequested = true;\n\n\t\t\t\t// To avoid print null at the exit\n\t\t\t\treturn typeof (Evaluator.QuitValue);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Same as quit - useful in script scenerios\n\t\t/// </summary>\n\t\tstatic public void Quit () {\n\t\t\tQuitRequested = true;\n\t\t}\n\n#if !NET_2_1\n\t\t/// <summary>\n\t\t///   Describes an object or a type.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///   This method will show a textual representation\n\t\t///   of the object's type.  If the object is a\n\t\t///   System.Type it renders the type directly,\n\t\t///   otherwise it renders the type returned by\n\t\t///   invoking GetType on the object.\n\t\t/// </remarks>\n\t\tstatic public string Describe (object x)\n\t\t{\n\t\t\tif (x == null)\n\t\t\t\treturn \"<null>\";\n\n\t\t\tvar type = x as Type ?? x.GetType ();\n\n\t\t\tStringWriter sw = new StringWriter ();\n\t\t\tnew Outline (type, sw, true, false, false).OutlineType ();\n\t\t\treturn sw.ToString ();\n\t\t}\n#endif\n\t}\n\n\tclass InteractiveMethod : Method\n\t{\n\t\tpublic InteractiveMethod(TypeDefinition parent, FullNamedExpression returnType, Modifiers mod, ParametersCompiled parameters)\n\t\t\t: base(parent, returnType, mod, new MemberName(\"Host\"), parameters, null)\n\t\t{\n\t\t}\n\n\t\tpublic void ChangeToAsync ()\n\t\t{\n\t\t\tModFlags |= Modifiers.ASYNC;\n\t\t\tModFlags &= ~Modifiers.UNSAFE;\n\t\t\ttype_expr = new TypeExpression(Module.PredefinedTypes.Task.TypeSpec, Location);\n\t\t\tparameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t}\n\n\t\tpublic override string GetSignatureForError()\n\t\t{\n\t\t\treturn \"InteractiveHost\";\n\t\t}\n\t}\n\n\tclass HoistedEvaluatorVariable : HoistedVariable\n\t{\n\t\tpublic HoistedEvaluatorVariable (Field field)\n\t\t\t: base (null, field)\n\t\t{\n\t\t}\n\n\t\tprotected override FieldExpr GetFieldExpression (EmitContext ec)\n\t\t{\n\t\t\treturn new FieldExpr (field, field.Location);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///    A class used to assign values if the source expression is not void\n\t///\n\t///    Used by the interactive shell to allow it to call this code to set\n\t///    the return value for an invocation.\n\t/// </summary>\n\tclass OptionalAssign : SimpleAssign {\n\t\tpublic OptionalAssign (Expression s, Location loc)\n\t\t\t: base (null, s, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn Location.Null;\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tExpression clone = source.Clone (new CloneContext ());\n\n\t\t\tclone = clone.Resolve (ec);\n\t\t\tif (clone == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// A useful feature for the REPL: if we can resolve the expression\n\t\t\t// as a type, Describe the type;\n\t\t\t//\n\t\t\tif (ec.Module.Evaluator.DescribeTypeExpressions && !(ec.CurrentAnonymousMethod is AsyncInitializer)) {\n\t\t\t\tvar old_printer = ec.Report.SetPrinter (new SessionReportPrinter ());\n\t\t\t\tExpression tclone;\n\t\t\t\ttry {\n\t\t\t\t\t// Note: clone context cannot be shared otherwise block mapping would leak\n\t\t\t\t\ttclone = source.Clone (new CloneContext ());\n\t\t\t\t\ttclone = tclone.Resolve (ec, ResolveFlags.Type);\n\t\t\t\t\tif (ec.Report.Errors > 0)\n\t\t\t\t\t\ttclone = null;\n\t\t\t\t} finally {\n\t\t\t\t\tec.Report.SetPrinter (old_printer);\n\t\t\t\t}\n\n\t\t\t\tif (tclone is TypeExpr) {\n\t\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\t\targs.Add (new Argument (new TypeOf ((TypeExpr) clone, Location)));\n\t\t\t\t\treturn new Invocation (new SimpleName (\"Describe\", Location), args).Resolve (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// This means its really a statement.\n\t\t\tif (clone.Type.Kind == MemberKind.Void || clone is DynamicInvocation || clone is Assign) {\n\t\t\t\treturn clone;\n\t\t\t}\n\n\t\t\tsource = clone;\n\n\t\t\tvar host = (Method) ec.MemberContext.CurrentMemberDefinition;\n\n\t\t\tif (host.ParameterInfo.IsEmpty) {\n\t\t\t\teclass = ExprClass.Value;\n\t\t\t\ttype = InternalType.FakeInternalType;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\ttarget = new SimpleName (host.ParameterInfo[0].Name, Location);\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement(EmitContext ec)\n\t\t{\n\t\t\tif (target == null) {\n\t\t\t\tsource.Emit (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.EmitStatement(ec);\n\t\t}\n\t}\n\n\tpublic class Undo\n\t{\n\t\tList<Action> undo_actions;\n\n\t\tpublic void AddTypeContainer (TypeContainer current_container, TypeDefinition tc)\n\t\t{\n\t\t\tif (current_container == tc){\n\t\t\t\tConsole.Error.WriteLine (\"Internal error: inserting container into itself\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (undo_actions == null)\n\t\t\t\tundo_actions = new List<Action> ();\n\n\t\t\tif (current_container.Containers != null)\n\t\t\t{\n\t\t\t\tvar existing = current_container.Containers.FirstOrDefault (l => l.Basename == tc.Basename);\n\t\t\t\tif (existing != null) {\n\t\t\t\t\tcurrent_container.RemoveContainer (existing);\n\t\t\t\t\tundo_actions.Add (() => current_container.AddTypeContainer (existing));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tundo_actions.Add (() => current_container.RemoveContainer (tc));\n\t\t}\n\n\t\tpublic void ExecuteUndo ()\n\t\t{\n\t\t\tif (undo_actions == null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var p in undo_actions){\n\t\t\t\tp ();\n\t\t\t}\n\n\t\t\tundo_actions = null;\n\t\t}\n\t}\n\n\tstatic class ListenerProxy\n\t{\n\t\tstatic readonly Dictionary<int, ValueModificationHandler> listeners = new Dictionary<int, ValueModificationHandler> ();\n\n\t\tstatic int counter;\n\n\t\tpublic static int Register (ValueModificationHandler listener)\n\t\t{\n\t\t\tlock (listeners) {\n\t\t\t\tvar id = counter++;\n\t\t\t\tlisteners.Add (id, listener);\n\t\t\t\treturn id;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Unregister (int listenerId)\n\t\t{\n\t\t\tlock (listeners) {\n\t\t\t\tlisteners.Remove (listenerId);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void ValueChanged (object value, int row, int col, string name, int listenerId)\n\t\t{\n\t\t\tValueModificationHandler action;\n\t\t\tlock (listeners) {\n\t\t\t\tif (!listeners.TryGetValue (listenerId, out action))\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taction (name, row, col, value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs",
    "content": "//\n// expression.cs: Expression representation for the IL tree.\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011 Xamarin Inc.\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing SLE = System.Linq.Expressions;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\t//\n\t// This is an user operator expression, automatically created during\n\t// resolve phase\n\t//\n\tpublic class UserOperatorCall : Expression {\n\t\tprotected readonly Arguments arguments;\n\t\tprotected readonly MethodSpec oper;\n\t\treadonly Func<ResolveContext, Expression, Expression> expr_tree;\n\n\t\tpublic UserOperatorCall (MethodSpec oper, Arguments args, Func<ResolveContext, Expression, Expression> expr_tree, Location loc)\n\t\t{\n\t\t\tthis.oper = oper;\n\t\t\tthis.arguments = args;\n\t\t\tthis.expr_tree = expr_tree;\n\n\t\t\ttype = oper.ReturnType;\n\t\t\teclass = ExprClass.Value;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn arguments.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (expr_tree != null)\n\t\t\t\treturn expr_tree (ec, new TypeOfMethod (oper, loc));\n\n\t\t\tArguments args = Arguments.CreateForExpressionTree (ec, arguments,\n\t\t\t\tnew NullLiteral (loc),\n\t\t\t\tnew TypeOfMethod (oper, loc));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Call\", args);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext context, Expression target)\n\t\t{\n\t\t\t// Nothing to clone\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// We are born fully resolved\n\t\t\t//\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.Emit (ec, oper, arguments, loc);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\targuments.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn SLE.Expression.Call ((MethodInfo) oper.GetMetaInfo (), Arguments.MakeExpression (arguments, ctx));\n#endif\n\t\t}\n\t}\n\n\tpublic class ParenthesizedExpression : ShimExpression\n\t{\n\t\tpublic ParenthesizedExpression (Expression expr, Location loc)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tvar res = expr.Resolve (ec);\n\t\t\tvar constant = res as Constant;\n\t\t\tif (constant != null && constant.IsLiteral)\n\t\t\t\treturn Constant.CreateConstantFromValue (res.Type, constant.GetValue (), expr.Location);\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\treturn expr.DoResolveLValue (ec, right_side);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\t\n\t//\n\t//   Unary implements unary expressions.\n\t//\n\tpublic class Unary : Expression\n\t{\n\t\tpublic enum Operator : byte {\n\t\t\tUnaryPlus, UnaryNegation, LogicalNot, OnesComplement,\n\t\t\tAddressOf,  TOP\n\t\t}\n\n\t\tpublic readonly Operator Oper;\n\t\tpublic Expression Expr;\n\t\tConvCast.Mode enum_conversion;\n\n\t\tpublic Unary (Operator op, Expression expr, Location loc)\n\t\t{\n\t\t\tOper = op;\n\t\t\tExpr = expr;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t// <summary>\n\t\t//   This routine will attempt to simplify the unary expression when the\n\t\t//   argument is a constant.\n\t\t// </summary>\n\t\tConstant TryReduceConstant (ResolveContext ec, Constant constant)\n\t\t{\n\t\t\tvar e = constant;\n\n\t\t\twhile (e is EmptyConstantCast)\n\t\t\t\te = ((EmptyConstantCast) e).child;\n\t\t\t\n\t\t\tif (e is SideEffectConstant) {\n\t\t\t\tConstant r = TryReduceConstant (ec, ((SideEffectConstant) e).value);\n\t\t\t\treturn r == null ? null : new SideEffectConstant (r, e, r.Location);\n\t\t\t}\n\n\t\t\tTypeSpec expr_type = e.Type;\n\t\t\t\n\t\t\tswitch (Oper){\n\t\t\tcase Operator.UnaryPlus:\n\t\t\t\t// Unary numeric promotions\n\t\t\t\tswitch (expr_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ((ByteConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ((SByteConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ((ShortConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ((UShortConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ((CharConstant) e).Value, e.Location);\n\t\t\t\t\n\t\t\t\t// Predefined operators\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn e;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn null;\n\t\t\t\t\n\t\t\tcase Operator.UnaryNegation:\n\t\t\t\t// Unary numeric promotions\n\t\t\t\tswitch (expr_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, -((ByteConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, -((SByteConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, -((ShortConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, -((UShortConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, -((CharConstant) e).Value, e.Location);\n\n\t\t\t\t// Predefined operators\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\tint ivalue = ((IntConstant) e).Value;\n\t\t\t\t\tif (ivalue == int.MinValue) {\n\t\t\t\t\t\tif (ec.ConstantCheckState) {\n\t\t\t\t\t\t\tConstantFold.Error_CompileTimeOverflow (ec, loc);\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn e;\n\t\t\t\t\t}\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, -ivalue, e.Location);\n\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\tlong lvalue = ((LongConstant) e).Value;\n\t\t\t\t\tif (lvalue == long.MinValue) {\n\t\t\t\t\t\tif (ec.ConstantCheckState) {\n\t\t\t\t\t\t\tConstantFold.Error_CompileTimeOverflow (ec, loc);\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn e;\n\t\t\t\t\t}\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, -lvalue, e.Location);\n\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\tUIntLiteral uil = constant as UIntLiteral;\n\t\t\t\t\tif (uil != null) {\n\t\t\t\t\t\tif (uil.Value == int.MaxValue + (uint) 1)\n\t\t\t\t\t\t\treturn new IntLiteral (ec.BuiltinTypes, int.MinValue, e.Location);\n\t\t\t\t\t\treturn new LongLiteral (ec.BuiltinTypes, -uil.Value, e.Location);\n\t\t\t\t\t}\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, -((UIntConstant) e).Value, e.Location);\n\n\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\tULongLiteral ull = constant as ULongLiteral;\n\t\t\t\t\tif (ull != null && ull.Value == 9223372036854775808)\n\t\t\t\t\t\treturn new LongLiteral (ec.BuiltinTypes, long.MinValue, e.Location);\n\t\t\t\t\treturn null;\n\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\tFloatLiteral fl = constant as FloatLiteral;\n\t\t\t\t\t// For better error reporting\n\t\t\t\t\tif (fl != null)\n\t\t\t\t\t\treturn new FloatLiteral (ec.BuiltinTypes, -fl.Value, e.Location);\n\n\t\t\t\t\treturn new FloatConstant (ec.BuiltinTypes, -((FloatConstant) e).Value, e.Location);\n\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\tDoubleLiteral dl = constant as DoubleLiteral;\n\t\t\t\t\t// For better error reporting\n\t\t\t\t\tif (dl != null)\n\t\t\t\t\t\treturn new DoubleLiteral (ec.BuiltinTypes, -dl.Value, e.Location);\n\n\t\t\t\t\treturn new DoubleConstant (ec.BuiltinTypes, -((DoubleConstant) e).Value, e.Location);\n\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\treturn new DecimalConstant (ec.BuiltinTypes, -((DecimalConstant) e).Value, e.Location);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t\t\n\t\t\tcase Operator.LogicalNot:\n\t\t\t\tif (expr_type.BuiltinType != BuiltinTypeSpec.Type.Bool)\n\t\t\t\t\treturn null;\n\t\t\t\t\n\t\t\t\tbool b = (bool)e.GetValue ();\n\t\t\t\treturn new BoolConstant (ec.BuiltinTypes, !b, e.Location);\n\t\t\t\t\n\t\t\tcase Operator.OnesComplement:\n\t\t\t\t// Unary numeric promotions\n\t\t\t\tswitch (expr_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ~((ByteConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ~((SByteConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ~((ShortConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ~((UShortConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ~((CharConstant) e).Value, e.Location);\n\t\t\t\t\n\t\t\t\t// Predefined operators\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\treturn new IntConstant (ec.BuiltinTypes, ~((IntConstant)e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\treturn new UIntConstant (ec.BuiltinTypes, ~((UIntConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\treturn new LongConstant (ec.BuiltinTypes, ~((LongConstant) e).Value, e.Location);\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\treturn new ULongConstant (ec.BuiltinTypes, ~((ULongConstant) e).Value, e.Location);\n\t\t\t\t}\n\t\t\t\tif (e is EnumConstant) {\n\t\t\t\t\tvar res = TryReduceConstant (ec, ((EnumConstant)e).Child);\n\t\t\t\t\tif (res != null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Numeric promotion upgraded types to int but for enum constant\n\t\t\t\t\t\t// original underlying constant type is needed\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (res.Type.BuiltinType == BuiltinTypeSpec.Type.Int) {\n\t\t\t\t\t\t\tint v = ((IntConstant) res).Value;\n\t\t\t\t\t\t\tswitch (((EnumConstant) e).Child.Type.BuiltinType) {\n\t\t\t\t\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\t\t\t\tres = new UShortConstant (ec.BuiltinTypes, (ushort) v, e.Location);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\t\t\t\tres = new ShortConstant (ec.BuiltinTypes, (short) v, e.Location);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\t\t\t\tres = new ByteConstant (ec.BuiltinTypes, (byte) v, e.Location);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\t\t\t\tres = new SByteConstant (ec.BuiltinTypes, (sbyte) v, e.Location);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tres = new EnumConstant (res, expr_type);\n\t\t\t\t\t}\n\t\t\t\t\treturn res;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthrow new Exception (\"Can not constant fold: \" + Oper.ToString());\n\t\t}\n\t\t\n\t\tprotected virtual Expression ResolveOperator (ResolveContext ec, Expression expr)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tTypeSpec expr_type = expr.Type;\n\t\t\tExpression best_expr;\n\n\t\t\tTypeSpec[] predefined = ec.BuiltinTypes.OperatorsUnary [(int) Oper];\n\n\t\t\t//\n\t\t\t// Primitive types first\n\t\t\t//\n\t\t\tif (BuiltinTypeSpec.IsPrimitiveType (expr_type)) {\n\t\t\t\tbest_expr = ResolvePrimitivePredefinedType (ec, expr, predefined);\n\t\t\t\tif (best_expr == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\ttype = best_expr.Type;\n\t\t\t\tExpr = best_expr;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// E operator ~(E x);\n\t\t\t//\n\t\t\tif (Oper == Operator.OnesComplement && expr_type.IsEnum)\n\t\t\t\treturn ResolveEnumOperator (ec, expr, predefined);\n\n\t\t\treturn ResolveUserType (ec, expr, predefined);\n\t\t}\n\n\t\tprotected virtual Expression ResolveEnumOperator (ResolveContext ec, Expression expr, TypeSpec[] predefined)\n\t\t{\n\t\t\tTypeSpec underlying_type = EnumSpec.GetUnderlyingType (expr.Type);\n\t\t\tExpression best_expr = ResolvePrimitivePredefinedType (ec, EmptyCast.Create (expr, underlying_type), predefined);\n\t\t\tif (best_expr == null)\n\t\t\t\treturn null;\n\n\t\t\tExpr = best_expr;\n\t\t\tenum_conversion = Binary.GetEnumResultCast (underlying_type);\n\t\t\ttype = expr.Type;\n\t\t\treturn EmptyCast.Create (this, type);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn Expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn CreateExpressionTree (ec, null);\n\t\t}\n\n\t\tExpression CreateExpressionTree (ResolveContext ec, Expression user_op)\n\t\t{\n\t\t\tstring method_name;\n\t\t\tswitch (Oper) {\n\t\t\tcase Operator.AddressOf:\n\t\t\t\tError_PointerInsideExpressionTree (ec);\n\t\t\t\treturn null;\n\t\t\tcase Operator.UnaryNegation:\n\t\t\t\tif (ec.HasSet (ResolveContext.Options.CheckedScope) && user_op == null && !IsFloat (type))\n\t\t\t\t\tmethod_name = \"NegateChecked\";\n\t\t\t\telse\n\t\t\t\t\tmethod_name = \"Negate\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.OnesComplement:\n\t\t\tcase Operator.LogicalNot:\n\t\t\t\tmethod_name = \"Not\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.UnaryPlus:\n\t\t\t\tmethod_name = \"UnaryPlus\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (\"Unknown unary operator \" + Oper.ToString ());\n\t\t\t}\n\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (Expr.CreateExpressionTree (ec)));\n\t\t\tif (user_op != null)\n\t\t\t\targs.Add (new Argument (user_op));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, method_name, args);\n\t\t}\n\n\t\tpublic static TypeSpec[][] CreatePredefinedOperatorsTable (BuiltinTypes types)\n\t\t{\n\t\t\tvar predefined_operators = new TypeSpec[(int) Operator.TOP][];\n\n\t\t\t//\n\t\t\t// 7.6.1 Unary plus operator\n\t\t\t//\n\t\t\tpredefined_operators [(int) Operator.UnaryPlus] = new TypeSpec [] {\n\t\t\t\ttypes.Int, types.UInt,\n\t\t\t\ttypes.Long, types.ULong,\n\t\t\t\ttypes.Float, types.Double,\n\t\t\t\ttypes.Decimal\n\t\t\t};\n\n\t\t\t//\n\t\t\t// 7.6.2 Unary minus operator\n\t\t\t//\n\t\t\tpredefined_operators [(int) Operator.UnaryNegation] = new TypeSpec [] {\n\t\t\t\ttypes.Int,  types.Long,\n\t\t\t\ttypes.Float, types.Double,\n\t\t\t\ttypes.Decimal\n\t\t\t};\n\n\t\t\t//\n\t\t\t// 7.6.3 Logical negation operator\n\t\t\t//\n\t\t\tpredefined_operators [(int) Operator.LogicalNot] = new TypeSpec [] {\n\t\t\t\ttypes.Bool\n\t\t\t};\n\n\t\t\t//\n\t\t\t// 7.6.4 Bitwise complement operator\n\t\t\t//\n\t\t\tpredefined_operators [(int) Operator.OnesComplement] = new TypeSpec [] {\n\t\t\t\ttypes.Int, types.UInt,\n\t\t\t\ttypes.Long, types.ULong\n\t\t\t};\n\n\t\t\treturn predefined_operators;\n\t\t}\n\n\t\t//\n\t\t// Unary numeric promotions\n\t\t//\n\t\tstatic Expression DoNumericPromotion (ResolveContext rc, Operator op, Expression expr)\n\t\t{\n\t\t\tTypeSpec expr_type = expr.Type;\n\t\t\tif (op == Operator.UnaryPlus || op == Operator.UnaryNegation || op == Operator.OnesComplement) {\n\t\t\t\tswitch (expr_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\treturn Convert.ImplicitNumericConversion (expr, rc.BuiltinTypes.Int);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (op == Operator.UnaryNegation && expr_type.BuiltinType == BuiltinTypeSpec.Type.UInt)\n\t\t\t\treturn Convert.ImplicitNumericConversion (expr, rc.BuiltinTypes.Long);\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (Oper == Operator.AddressOf) {\n\t\t\t\treturn ResolveAddressOf (ec);\n\t\t\t}\n\n\t\t\tExpr = Expr.Resolve (ec);\n\t\t\tif (Expr == null)\n\t\t\t\treturn null;\n\n\t\t\tif (Expr.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (Expr));\n\t\t\t\treturn new DynamicUnaryConversion (GetOperatorExpressionTypeName (), args, loc).Resolve (ec);\n\t\t\t}\n\n\t\t\tif (Expr.Type.IsNullableType)\n\t\t\t\treturn new Nullable.LiftedUnaryOperator (Oper, Expr, loc).Resolve (ec);\n\n\t\t\t//\n\t\t\t// Attempt to use a constant folding operation.\n\t\t\t//\n\t\t\tConstant cexpr = Expr as Constant;\n\t\t\tif (cexpr != null) {\n\t\t\t\tcexpr = TryReduceConstant (ec, cexpr);\n\t\t\t\tif (cexpr != null)\n\t\t\t\t\treturn cexpr;\n\t\t\t}\n\n\t\t\tExpression expr = ResolveOperator (ec, Expr);\n\t\t\tif (expr == null)\n\t\t\t\tError_OperatorCannotBeApplied (ec, loc, OperName (Oper), Expr.Type);\n\t\t\t\n\t\t\t//\n\t\t\t// Reduce unary operator on predefined types\n\t\t\t//\n\t\t\tif (expr == this && Oper == Operator.UnaryPlus)\n\t\t\t\treturn Expr;\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmitOperator (ec, type);\n\t\t}\n\n\t\tprotected void EmitOperator (EmitContext ec, TypeSpec type)\n\t\t{\n\t\t\tswitch (Oper) {\n\t\t\tcase Operator.UnaryPlus:\n\t\t\t\tExpr.Emit (ec);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.UnaryNegation:\n\t\t\t\tif (ec.HasSet (EmitContext.Options.CheckedScope) && !IsFloat (type)) {\n\t\t\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && Expr.ContainsEmitWithAwait ())\n\t\t\t\t\t\tExpr = Expr.EmitToField (ec);\n\n\t\t\t\t\tec.EmitInt (0);\n\t\t\t\t\tif (type.BuiltinType == BuiltinTypeSpec.Type.Long)\n\t\t\t\t\t\tec.Emit (OpCodes.Conv_U8);\n\t\t\t\t\tExpr.Emit (ec);\n\t\t\t\t\tec.Emit (OpCodes.Sub_Ovf);\n\t\t\t\t} else {\n\t\t\t\t\tExpr.Emit (ec);\n\t\t\t\t\tec.Emit (OpCodes.Neg);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.LogicalNot:\n\t\t\t\tExpr.Emit (ec);\n\t\t\t\tec.EmitInt (0);\n\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.OnesComplement:\n\t\t\t\tExpr.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Not);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.AddressOf:\n\t\t\t\t((IMemoryLocation)Expr).AddressOf (ec, AddressOp.LoadStore);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tthrow new Exception (\"This should not happen: Operator = \"\n\t\t\t\t\t\t     + Oper.ToString ());\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Same trick as in Binary expression\n\t\t\t//\n\t\t\tif (enum_conversion != 0) {\n\t\t\t\tusing (ec.With (BuilderContext.Options.CheckedScope, false)) {\n\t\t\t\t\tConvCast.Emit (ec, enum_conversion);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t\tif (Oper == Operator.LogicalNot)\n\t\t\t\tExpr.EmitBranchable (ec, target, !on_true);\n\t\t\telse\n\t\t\t\tbase.EmitBranchable (ec, target, on_true);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tExpr.EmitSideEffect (ec);\n\t\t}\n\n\t\tpublic static void Error_Ambiguous (ResolveContext rc, string oper, TypeSpec type, Location loc)\n\t\t{\n\t\t\trc.Report.Error (35, loc, \"Operator `{0}' is ambiguous on an operand of type `{1}'\",\n\t\t\t\toper, type.GetSignatureForError ());\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tFlowAnalysis (fc, false);\n\t\t}\n\n\t\tpublic override void FlowAnalysisConditional (FlowAnalysisContext fc)\n\t\t{\n\t\t\tFlowAnalysis (fc, true);\n\t\t}\n\n\t\tvoid FlowAnalysis (FlowAnalysisContext fc, bool conditional)\n\t\t{\n\t\t\tif (Oper == Operator.AddressOf) {\n\t\t\t\tvar vr = Expr as VariableReference;\n\t\t\t\tif (vr != null && vr.VariableInfo != null)\n\t\t\t\t\tfc.SetVariableAssigned (vr.VariableInfo);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (Oper == Operator.LogicalNot && conditional) {\n\t\t\t\tExpr.FlowAnalysisConditional (fc);\n\n\t\t\t\tvar temp = fc.DefiniteAssignmentOnTrue;\n\t\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse;\n\t\t\t\tfc.DefiniteAssignmentOnFalse = temp;\n\t\t\t} else {\n\t\t\t\tExpr.FlowAnalysis (fc);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Converts operator to System.Linq.Expressions.ExpressionType enum name\n\t\t//\n\t\tstring GetOperatorExpressionTypeName ()\n\t\t{\n\t\t\tswitch (Oper) {\n\t\t\tcase Operator.OnesComplement:\n\t\t\t\treturn \"OnesComplement\";\n\t\t\tcase Operator.LogicalNot:\n\t\t\t\treturn \"Not\";\n\t\t\tcase Operator.UnaryNegation:\n\t\t\t\treturn \"Negate\";\n\t\t\tcase Operator.UnaryPlus:\n\t\t\t\treturn \"UnaryPlus\";\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (\"Unknown express type operator \" + Oper.ToString ());\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsFloat (TypeSpec t)\n\t\t{\n\t\t\treturn t.BuiltinType == BuiltinTypeSpec.Type.Double || t.BuiltinType == BuiltinTypeSpec.Type.Float;\n\t\t}\n\n\t\t//\n\t\t// Returns a stringified representation of the Operator\n\t\t//\n\t\tpublic static string OperName (Operator oper)\n\t\t{\n\t\t\tswitch (oper) {\n\t\t\tcase Operator.UnaryPlus:\n\t\t\t\treturn \"+\";\n\t\t\tcase Operator.UnaryNegation:\n\t\t\t\treturn \"-\";\n\t\t\tcase Operator.LogicalNot:\n\t\t\t\treturn \"!\";\n\t\t\tcase Operator.OnesComplement:\n\t\t\t\treturn \"~\";\n\t\t\tcase Operator.AddressOf:\n\t\t\t\treturn \"&\";\n\t\t\t}\n\n\t\t\tthrow new NotImplementedException (oper.ToString ());\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\tvar expr = Expr.MakeExpression (ctx);\n\t\t\tbool is_checked = ctx.HasSet (BuilderContext.Options.CheckedScope);\n\n\t\t\tswitch (Oper) {\n\t\t\tcase Operator.UnaryNegation:\n\t\t\t\treturn is_checked ? SLE.Expression.NegateChecked (expr) : SLE.Expression.Negate (expr);\n\t\t\tcase Operator.LogicalNot:\n\t\t\t\treturn SLE.Expression.Not (expr);\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\t\tcase Operator.OnesComplement:\n\t\t\t\treturn SLE.Expression.OnesComplement (expr);\n#endif\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (Oper.ToString ());\n\t\t\t}\n\t\t}\n\n\t\tExpression ResolveAddressOf (ResolveContext ec)\n\t\t{\n\t\t\tif (!ec.IsUnsafe)\n\t\t\t\tUnsafeError (ec, loc);\n\n\t\t\tExpr = Expr.DoResolveLValue (ec, EmptyExpression.UnaryAddress);\n\t\t\tif (Expr == null || Expr.eclass != ExprClass.Variable) {\n\t\t\t\tec.Report.Error (211, loc, \"Cannot take the address of the given expression\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (!TypeManager.VerifyUnmanaged (ec.Module, Expr.Type, loc)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tIVariableReference vr = Expr as IVariableReference;\n\t\t\tbool is_fixed;\n\t\t\tif (vr != null) {\n\t\t\t\tis_fixed = vr.IsFixed;\n\t\t\t\tvr.SetHasAddressTaken ();\n\n\t\t\t\tif (vr.IsHoisted) {\n\t\t\t\t\tAnonymousMethodExpression.Error_AddressOfCapturedVar (ec, vr, loc);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tIFixedExpression fe = Expr as IFixedExpression;\n\t\t\t\tis_fixed = fe != null && fe.IsFixed;\n\t\t\t}\n\n\t\t\tif (!is_fixed && !ec.HasSet (ResolveContext.Options.FixedInitializerScope)) {\n\t\t\t\tec.Report.Error (212, loc, \"You can only take the address of unfixed expression inside of a fixed statement initializer\");\n\t\t\t}\n\n\t\t\ttype = PointerContainer.MakeType (ec.Module, Expr.Type);\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tExpression ResolvePrimitivePredefinedType (ResolveContext rc, Expression expr, TypeSpec[] predefined)\n\t\t{\n\t\t\texpr = DoNumericPromotion (rc, Oper, expr);\n\t\t\tTypeSpec expr_type = expr.Type;\n\t\t\tforeach (TypeSpec t in predefined) {\n\t\t\t\tif (t == expr_type)\n\t\t\t\t\treturn expr;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Perform user-operator overload resolution\n\t\t//\n\t\tprotected virtual Expression ResolveUserOperator (ResolveContext ec, Expression expr)\n\t\t{\n\t\t\tCSharp.Operator.OpType op_type;\n\t\t\tswitch (Oper) {\n\t\t\tcase Operator.LogicalNot:\n\t\t\t\top_type = CSharp.Operator.OpType.LogicalNot; break;\n\t\t\tcase Operator.OnesComplement:\n\t\t\t\top_type = CSharp.Operator.OpType.OnesComplement; break;\n\t\t\tcase Operator.UnaryNegation:\n\t\t\t\top_type = CSharp.Operator.OpType.UnaryNegation; break;\n\t\t\tcase Operator.UnaryPlus:\n\t\t\t\top_type = CSharp.Operator.OpType.UnaryPlus; break;\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (Oper.ToString ());\n\t\t\t}\n\n\t\t\tvar methods = MemberCache.GetUserOperator (expr.Type, op_type, false);\n\t\t\tif (methods == null)\n\t\t\t\treturn null;\n\n\t\t\tArguments args = new Arguments (1);\n\t\t\targs.Add (new Argument (expr));\n\n\t\t\tvar res = new OverloadResolver (methods, OverloadResolver.Restrictions.BaseMembersIncluded | OverloadResolver.Restrictions.NoBaseMembers, loc);\n\t\t\tvar oper = res.ResolveOperator (ec, ref args);\n\n\t\t\tif (oper == null)\n\t\t\t\treturn null;\n\n\t\t\tExpr = args [0].Expr;\n\t\t\treturn new UserOperatorCall (oper, args, CreateExpressionTree, expr.Location);\n\t\t}\n\n\t\t//\n\t\t// Unary user type overload resolution\n\t\t//\n\t\tExpression ResolveUserType (ResolveContext ec, Expression expr, TypeSpec[] predefined)\n\t\t{\n\t\t\tExpression best_expr = ResolveUserOperator (ec, expr);\n\t\t\tif (best_expr != null)\n\t\t\t\treturn best_expr;\n\n\t\t\tforeach (TypeSpec t in predefined) {\n\t\t\t\tExpression oper_expr = Convert.ImplicitUserConversion (ec, expr, t, expr.Location);\n\t\t\t\tif (oper_expr == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (oper_expr == ErrorExpression.Instance)\n\t\t\t\t\treturn oper_expr;\n\n\t\t\t\t//\n\t\t\t\t// decimal type is predefined but has user-operators\n\t\t\t\t//\n\t\t\t\tif (oper_expr.Type.BuiltinType == BuiltinTypeSpec.Type.Decimal)\n\t\t\t\t\toper_expr = ResolveUserType (ec, oper_expr, predefined);\n\t\t\t\telse\n\t\t\t\t\toper_expr = ResolvePrimitivePredefinedType (ec, oper_expr, predefined);\n\n\t\t\t\tif (oper_expr == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (best_expr == null) {\n\t\t\t\t\tbest_expr = oper_expr;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tint result = OverloadResolver.BetterTypeConversion (ec, best_expr.Type, t);\n\t\t\t\tif (result == 0) {\n\t\t\t\t\tif ((oper_expr is UserOperatorCall || oper_expr is UserCast) && (best_expr is UserOperatorCall || best_expr is UserCast)) {\n\t\t\t\t\t\tError_Ambiguous (ec, OperName (Oper), expr.Type, loc);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tError_OperatorCannotBeApplied (ec, loc, OperName (Oper), expr.Type);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (result == 2)\n\t\t\t\t\tbest_expr = oper_expr;\n\t\t\t}\n\t\t\t\n\t\t\tif (best_expr == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t//\n\t\t\t// HACK: Decimal user-operator is included in standard operators\n\t\t\t//\n\t\t\tif (best_expr.Type.BuiltinType == BuiltinTypeSpec.Type.Decimal)\n\t\t\t\treturn best_expr;\n\n\t\t\tExpr = best_expr;\n\t\t\ttype = best_expr.Type;\n\t\t\treturn this;\t\t\t\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tUnary target = (Unary) t;\n\n\t\t\ttarget.Expr = Expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t}\n\n\t//\n\t// Unary operators are turned into Indirection expressions\n\t// after semantic analysis (this is so we can take the address\n\t// of an indirection).\n\t//\n\tpublic class Indirection : Expression, IMemoryLocation, IAssignMethod, IFixedExpression {\n\t\tExpression expr;\n\t\tLocalTemporary temporary;\n\t\tbool prepared;\n\t\t\n\t\tpublic Indirection (Expression expr, Location l)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsFixed {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn expr.StartLocation;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tIndirection target = (Indirection) t;\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tError_PointerInsideExpressionTree (ec);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (!prepared)\n\t\t\t\texpr.Emit (ec);\n\t\t\t\n\t\t\tec.EmitLoadFromPtr (Type);\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tEmit (ec);\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\ttemporary = new LocalTemporary (expr.Type);\n\t\t\t\ttemporary.Store (ec);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tprepared = isCompound;\n\t\t\t\n\t\t\texpr.Emit (ec);\n\n\t\t\tif (isCompound)\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\n\t\t\tsource.Emit (ec);\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\ttemporary = new LocalTemporary (source.Type);\n\t\t\t\ttemporary.Store (ec);\n\t\t\t}\n\t\t\t\n\t\t\tec.EmitStoreFromPtr (type);\n\t\t\t\n\t\t\tif (temporary != null) {\n\t\t\t\ttemporary.Emit (ec);\n\t\t\t\ttemporary.Release (ec);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void AddressOf (EmitContext ec, AddressOp Mode)\n\t\t{\n\t\t\texpr.Emit (ec);\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\treturn DoResolve (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tif (!ec.IsUnsafe)\n\t\t\t\tUnsafeError (ec, loc);\n\n\t\t\tvar pc = expr.Type as PointerContainer;\n\n\t\t\tif (pc == null) {\n\t\t\t\tec.Report.Error (193, loc, \"The * or -> operator must be applied to a pointer\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\ttype = pc.Element;\n\n\t\t\tif (type.Kind == MemberKind.Void) {\n\t\t\t\tError_VoidPointerOperation (ec);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t///   Unary Mutator expressions (pre and post ++ and --)\n\t/// </summary>\n\t///\n\t/// <remarks>\n\t///   UnaryMutator implements ++ and -- expressions.   It derives from\n\t///   ExpressionStatement becuase the pre/post increment/decrement\n\t///   operators can be used in a statement context.\n\t///\n\t/// FIXME: Idea, we could split this up in two classes, one simpler\n\t/// for the common case, and one with the extra fields for more complex\n\t/// classes (indexers require temporary access;  overloaded require method)\n\t///\n\t/// </remarks>\n\tpublic class UnaryMutator : ExpressionStatement\n\t{\n\t\tclass DynamicPostMutator : Expression, IAssignMethod\n\t\t{\n\t\t\tLocalTemporary temp;\n\t\t\tExpression expr;\n\n\t\t\tpublic DynamicPostMutator (Expression expr)\n\t\t\t{\n\t\t\t\tthis.expr = expr;\n\t\t\t\tthis.type = expr.Type;\n\t\t\t\tthis.loc = expr.Location;\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException (\"ET\");\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t\t{\n\t\t\t\teclass = expr.eclass;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t\t{\n\t\t\t\texpr.DoResolveLValue (ec, right_side);\n\t\t\t\treturn DoResolve (ec);\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\ttemp.Emit (ec);\n\t\t\t}\n\n\t\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Emits target assignment using unmodified source value\n\t\t\t//\n\t\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Allocate temporary variable to keep original value before it's modified\n\t\t\t\t//\n\t\t\t\ttemp = new LocalTemporary (type);\n\t\t\t\texpr.Emit (ec);\n\t\t\t\ttemp.Store (ec);\n\n\t\t\t\t((IAssignMethod) expr).EmitAssign (ec, source, false, isCompound);\n\n\t\t\t\tif (leave_copy)\n\t\t\t\t\tEmit (ec);\n\n\t\t\t\ttemp.Release (ec);\n\t\t\t\ttemp = null;\n\t\t\t}\n\t\t}\n\n\t\t[Flags]\n\t\tpublic enum Mode : byte {\n\t\t\tIsIncrement    = 0,\n\t\t\tIsDecrement    = 1,\n\t\t\tIsPre          = 0,\n\t\t\tIsPost         = 2,\n\t\t\t\n\t\t\tPreIncrement   = 0,\n\t\t\tPreDecrement   = IsDecrement,\n\t\t\tPostIncrement  = IsPost,\n\t\t\tPostDecrement  = IsPost | IsDecrement\n\t\t}\n\n\t\tMode mode;\n\t\tbool is_expr, recurse;\n\n\t\tprotected Expression expr;\n\n\t\t// Holds the real operation\n\t\tExpression operation;\n\t\t\n\t\tpublic UnaryMutator (Mode m, Expression e, Location loc)\n\t\t{\n\t\t\tmode = m;\n\t\t\tthis.loc = loc;\n\t\t\texpr = e;\n\t\t}\n\n\t\tpublic Mode UnaryMutatorMode {\n\t\t\tget {\n\t\t\t\treturn mode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn (mode & Mode.IsPost) != 0 ? expr.Location : loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn new SimpleAssign (this, this).CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic static TypeSpec[] CreatePredefinedOperatorsTable (BuiltinTypes types)\n\t\t{\n\t\t\t//\n\t\t\t// Predefined ++ and -- operators exist for the following types: \n\t\t\t// sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal\n\t\t\t//\n\t\t\treturn new TypeSpec[] {\n\t\t\t\ttypes.Int,\n\t\t\t\ttypes.Long,\n\n\t\t\t\ttypes.SByte,\n\t\t\t\ttypes.Byte,\n\t\t\t\ttypes.Short,\n\t\t\t\ttypes.UInt,\n\t\t\t\ttypes.ULong,\n\t\t\t\ttypes.Char,\n\t\t\t\ttypes.Float,\n\t\t\t\ttypes.Double,\n\t\t\t\ttypes.Decimal\n\t\t\t};\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\t\n\t\t\tif (expr == null || expr.Type == InternalType.ErrorType)\n\t\t\t\treturn null;\n\n\t\t\tif (expr.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t//\n\t\t\t\t// Handle postfix unary operators using local\n\t\t\t\t// temporary variable\n\t\t\t\t//\n\t\t\t\tif ((mode & Mode.IsPost) != 0)\n\t\t\t\t\texpr = new DynamicPostMutator (expr);\n\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (expr));\n\t\t\t\treturn new SimpleAssign (expr, new DynamicUnaryConversion (GetOperatorExpressionTypeName (), args, loc)).Resolve (ec);\n\t\t\t}\n\n\t\t\tif (expr.Type.IsNullableType)\n\t\t\t\treturn new Nullable.LiftedUnaryMutator (mode, expr, loc).Resolve (ec);\n\n\t\t\treturn DoResolveOperation (ec);\n\t\t}\n\n\t\tprotected Expression DoResolveOperation (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t\ttype = expr.Type;\n\n\t\t\tif (expr is RuntimeValueExpression) {\n\t\t\t\toperation = expr;\n\t\t\t} else {\n\t\t\t\t// Use itself at the top of the stack\n\t\t\t\toperation = new EmptyExpression (type);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// The operand of the prefix/postfix increment decrement operators\n\t\t\t// should be an expression that is classified as a variable,\n\t\t\t// a property access or an indexer access\n\t\t\t//\n\t\t\t// TODO: Move to parser, expr is ATypeNameExpression\n\t\t\tif (expr.eclass == ExprClass.Variable || expr.eclass == ExprClass.IndexerAccess || expr.eclass == ExprClass.PropertyAccess) {\n\t\t\t\texpr = expr.ResolveLValue (ec, expr);\n\t\t\t} else {\n\t\t\t\tec.Report.Error (1059, loc, \"The operand of an increment or decrement operator must be a variable, property or indexer\");\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Step 1: Try to find a user operator, it has priority over predefined ones\n\t\t\t//\n\t\t\tvar user_op = IsDecrement ? Operator.OpType.Decrement : Operator.OpType.Increment;\n\t\t\tvar methods = MemberCache.GetUserOperator (type, user_op, false);\n\n\t\t\tif (methods != null) {\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (expr));\n\n\t\t\t\tvar res = new OverloadResolver (methods, OverloadResolver.Restrictions.BaseMembersIncluded | OverloadResolver.Restrictions.NoBaseMembers, loc);\n\t\t\t\tvar method = res.ResolveOperator (ec, ref args);\n\t\t\t\tif (method == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\targs[0].Expr = operation;\n\t\t\t\toperation = new UserOperatorCall (method, args, null, loc);\n\t\t\t\toperation = Convert.ImplicitConversionRequired (ec, operation, type, loc);\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Step 2: Try predefined types\n\t\t\t//\n\n\t\t\tExpression source = null;\n\t\t\tbool primitive_type;\n\n\t\t\t//\n\t\t\t// Predefined without user conversion first for speed-up\n\t\t\t//\n\t\t\t// Predefined ++ and -- operators exist for the following types: \n\t\t\t// sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal\n\t\t\t//\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\tsource = operation;\n\t\t\t\tprimitive_type = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprimitive_type = false;\n\n\t\t\t\t// ++/-- on pointer variables of all types except void*\n\t\t\t\tif (type.IsPointer) {\n\t\t\t\t\tif (((PointerContainer) type).Element.Kind == MemberKind.Void) {\n\t\t\t\t\t\tError_VoidPointerOperation (ec);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tsource = operation;\n\t\t\t\t} else {\n\t\t\t\t\tExpression best_source = null;\n\t\t\t\t\tforeach (var t in ec.BuiltinTypes.OperatorsUnaryMutator) {\n\t\t\t\t\t\tsource = Convert.ImplicitUserConversion (ec, operation, t, loc);\n\n\t\t\t\t\t\t// LAMESPEC: It should error on ambiguous operators but that would make us incompatible\n\t\t\t\t\t\tif (source == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (best_source == null) {\n\t\t\t\t\t\t\tbest_source = source;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar better = OverloadResolver.BetterTypeConversion (ec, best_source.Type, source.Type);\n\t\t\t\t\t\tif (better == 1)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (better == 2) {\n\t\t\t\t\t\t\tbest_source = source;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tUnary.Error_Ambiguous (ec, OperName (mode), type, loc);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tsource = best_source;\n\t\t\t\t}\n\n\t\t\t\t// ++/-- on enum types\n\t\t\t\tif (source == null && type.IsEnum)\n\t\t\t\t\tsource = operation;\n\n\t\t\t\tif (source == null) {\n\t\t\t\t\texpr.Error_OperatorCannotBeApplied (ec, loc, Operator.GetName (user_op), type);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar one = new IntConstant (ec.BuiltinTypes, 1, loc);\n\t\t\tvar op = IsDecrement ? Binary.Operator.Subtraction : Binary.Operator.Addition;\n\t\t\toperation = new Binary (op, source, one);\n\t\t\toperation = operation.Resolve (ec);\n\t\t\tif (operation == null)\n\t\t\t\tthrow new NotImplementedException (\"should not be reached\");\n\n\t\t\tif (operation.Type != type) {\n\t\t\t\tif (primitive_type)\n\t\t\t\t\toperation = Convert.ExplicitNumericConversion (ec, operation, type);\n\t\t\t\telse\n\t\t\t\t\toperation = Convert.ImplicitConversionRequired (ec, operation, type, loc);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tvoid EmitCode (EmitContext ec, bool is_expr)\n\t\t{\n\t\t\trecurse = true;\n\t\t\tthis.is_expr = is_expr;\n\t\t\t((IAssignMethod) expr).EmitAssign (ec, this, is_expr && (mode == Mode.PreIncrement || mode == Mode.PreDecrement), true);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// We use recurse to allow ourselfs to be the source\n\t\t\t// of an assignment. This little hack prevents us from\n\t\t\t// having to allocate another expression\n\t\t\t//\n\t\t\tif (recurse) {\n\t\t\t\t((IAssignMethod) expr).Emit (ec, is_expr && (mode == Mode.PostIncrement || mode == Mode.PostDecrement));\n\n\t\t\t\tEmitOperation (ec);\n\n\t\t\t\trecurse = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEmitCode (ec, true);\n\t\t}\n\n\t\tprotected virtual void EmitOperation (EmitContext ec)\n\t\t{\n\t\t\toperation.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tEmitCode (ec, false);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\t\t}\n\n\t\t//\n\t\t// Converts operator to System.Linq.Expressions.ExpressionType enum name\n\t\t//\n\t\tstring GetOperatorExpressionTypeName ()\n\t\t{\n\t\t\treturn IsDecrement ? \"Decrement\" : \"Increment\";\n\t\t}\n\n\t\tbool IsDecrement {\n\t\t\tget { return (mode & Mode.IsDecrement) != 0; }\n\t\t}\n\n\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\tvar target = ((RuntimeValueExpression) expr).MetaObject.Expression;\n\t\t\tvar source = SLE.Expression.Convert (operation.MakeExpression (ctx), target.Type);\n\t\t\treturn SLE.Expression.Assign (target, source);\n\t\t}\n#endif\n\n\t\tpublic static string OperName (Mode oper)\n\t\t{\n\t\t\treturn (oper & Mode.IsDecrement) != 0 ? \"--\" : \"++\";\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tUnaryMutator target = (UnaryMutator) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t}\n\n\t//\n\t// Base class for the `is' and `as' operators\n\t//\n\tpublic abstract class Probe : Expression\n\t{\n\t\tpublic Expression ProbeType;\n\t\tprotected Expression expr;\n\t\tprotected TypeSpec probe_type_expr;\n\t\t\n\t\tprotected Probe (Expression expr, Expression probe_type, Location l)\n\t\t{\n\t\t\tProbeType = probe_type;\n\t\t\tloc = l;\n\t\t\tthis.expr = expr;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tprotected Expression ResolveCommon (ResolveContext rc)\n\t\t{\n\t\t\texpr = expr.Resolve (rc);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tResolveProbeType (rc);\n\t\t\tif (probe_type_expr == null)\n\t\t\t\treturn this;\n\n\t\t\tif (probe_type_expr.IsStatic) {\n\t\t\t\trc.Report.Error (7023, loc, \"The second operand of `is' or `as' operator cannot be static type `{0}'\",\n\t\t\t\t\tprobe_type_expr.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tif (expr.Type.IsPointer || probe_type_expr.IsPointer) {\n\t\t\t\trc.Report.Error (244, loc, \"The `{0}' operator cannot be applied to an operand of pointer type\",\n\t\t\t\t\tOperatorName);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (expr.Type == InternalType.AnonymousMethod || expr.Type == InternalType.MethodGroup) {\n\t\t\t\trc.Report.Error (837, loc, \"The `{0}' operator cannot be applied to a lambda expression, anonymous method, or method group\",\n\t\t\t\t\tOperatorName);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected virtual void ResolveProbeType (ResolveContext rc)\n\t\t{\n\t\t\tprobe_type_expr = ProbeType.ResolveAsType (rc);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\texpr.EmitSideEffect (ec);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\t\t}\n\n\t\tprotected abstract string OperatorName { get; }\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tProbe target = (Probe) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t\ttarget.ProbeType = ProbeType.Clone (clonectx);\n\t\t}\n\n\t}\n\n\t/// <summary>\n\t///   Implementation of the `is' operator.\n\t/// </summary>\n\tpublic class Is : Probe\n\t{\n\t\tNullable.Unwrap expr_unwrap;\n\t\tMethodSpec number_mg;\n\t\tArguments number_args;\n\n\t\tpublic Is (Expression expr, Expression probe_type, Location l)\n\t\t\t: base (expr, probe_type, l)\n\t\t{\n\t\t}\n\n\t\tprotected override string OperatorName {\n\t\t\tget { return \"is\"; }\n\t\t}\n\n\t\tpublic LocalVariable Variable { get; set; }\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (Variable != null)\n\t\t\t\tthrow new NotSupportedException ();\n\n\t\t\tArguments args = Arguments.CreateForExpressionTree (ec, null,\n\t\t\t\texpr.CreateExpressionTree (ec),\n\t\t\t\tnew TypeOf (probe_type_expr, loc));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"TypeIs\", args);\n\t\t}\n\n\t\tExpression CreateConstantResult (ResolveContext rc, bool result)\n\t\t{\n\t\t\tif (result)\n\t\t\t\trc.Report.Warning (183, 1, loc, \"The given expression is always of the provided (`{0}') type\",\n\t\t\t\t\tprobe_type_expr.GetSignatureForError ());\n\t\t\telse\n\t\t\t\trc.Report.Warning (184, 1, loc, \"The given expression is never of the provided (`{0}') type\",\n\t\t\t\t\tprobe_type_expr.GetSignatureForError ());\n\n\t\t\tvar c = new BoolConstant (rc.BuiltinTypes, result, loc);\n\t\t\treturn expr.IsSideEffectFree ?\n\t\t\t\tReducedExpression.Create (c, this) :\n\t\t\t\tnew SideEffectConstant (c, this, loc);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (probe_type_expr == null) {\n\t\t\t\tEmitConstantMatch (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEmitLoad (ec);\n\n\t\t\tif (expr_unwrap == null) {\n\t\t\t\tec.EmitNull ();\n\t\t\t\tec.Emit (OpCodes.Cgt_Un);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t\tif (probe_type_expr == null) {\n\t\t\t\tEmitConstantMatch (ec);\n\t\t\t} else {\n\t\t\t\tEmitLoad (ec);\n\t\t\t}\n\n\t\t\tec.Emit (on_true ? OpCodes.Brtrue : OpCodes.Brfalse, target);\n\t\t}\n\n\t\tvoid EmitConstantMatch (EmitContext ec)\n\t\t{\n\t\t\tvar no_match = ec.DefineLabel ();\n\t\t\tvar end = ec.DefineLabel ();\n\n\t\t\tif (expr_unwrap != null) {\n\t\t\t\texpr_unwrap.EmitCheck (ec);\n\n\t\t\t\tif (ProbeType.IsNull) {\n\t\t\t\t\tec.EmitInt (0);\n\t\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tec.Emit (OpCodes.Brfalse_S, no_match);\n\t\t\t\texpr_unwrap.Emit (ec);\n\t\t\t\tProbeType.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\tec.Emit (OpCodes.Br_S, end);\n\t\t\t\tec.MarkLabel (no_match);\n\t\t\t\tec.EmitInt (0);\n\t\t\t\tec.MarkLabel (end);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (number_args != null && number_args.Count == 3) {\n\t\t\t\tvar ce = new CallEmitter ();\n\t\t\t\tce.Emit (ec, number_mg, number_args, loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tExpr.Emit (ec);\n\t\t\tec.Emit (OpCodes.Isinst, ProbeType.Type);\n\t\t\tec.Emit (OpCodes.Dup);\n\t\t\tec.Emit (OpCodes.Brfalse, no_match);\n\n\t\t\tif (number_mg != null) {\n\t\t\t\tvar ce = new CallEmitter ();\n\t\t\t\tce.Emit (ec, number_mg, number_args, loc);\n\t\t\t} else {\n\t\t\t\tProbeType.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t}\n\t\t\tec.Emit (OpCodes.Br_S, end);\n\t\t\tec.MarkLabel (no_match);\n\n\t\t\tec.Emit (OpCodes.Pop);\n\t\t\tec.EmitInt (0);\n\t\t\tec.MarkLabel (end);\n\t\t}\n\n\t\tvoid EmitLoad (EmitContext ec)\n\t\t{\n\t\t\tLabel no_value_label = new Label ();\n\n\t\t\tif (expr_unwrap != null) {\n\t\t\t\texpr_unwrap.EmitCheck (ec);\n\n\t\t\t\tif (Variable == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\tno_value_label = ec.DefineLabel ();\n\t\t\t\tec.Emit (OpCodes.Brfalse_S, no_value_label);\n\t\t\t\texpr_unwrap.Emit (ec);\n\t\t\t} else {\n\t\t\t\texpr.Emit (ec);\n\n\t\t\t\t// Only to make verifier happy\n\t\t\t\tif (probe_type_expr.IsGenericParameter && TypeSpec.IsValueType (expr.Type))\n\t\t\t\t\tec.Emit (OpCodes.Box, expr.Type);\n\n\t\t\t\tec.Emit (OpCodes.Isinst, probe_type_expr);\n\t\t\t}\n\n\t\t\tif (Variable != null) {\n\t\t\t\tbool value_on_stack;\n\t\t\t\tif (probe_type_expr.IsGenericParameter || probe_type_expr.IsNullableType) {\n\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\tec.Emit (OpCodes.Unbox_Any, probe_type_expr);\n\t\t\t\t\tvalue_on_stack = true;\n\t\t\t\t} else {\n\t\t\t\t\tvalue_on_stack = false;\n\t\t\t\t}\n\n\t\t\t\tVariable.CreateBuilder (ec);\n\t\t\t\tVariable.EmitAssign (ec);\n\n\t\t\t\tif (expr_unwrap != null) {\n\t\t\t\t\tec.MarkLabel (no_value_label);\n\t\t\t\t} else if (!value_on_stack) {\n\t\t\t\t\tVariable.Emit (ec);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tif (ResolveCommon (rc) == null)\n\t\t\t\treturn null;\n\n\t\t\ttype = rc.BuiltinTypes.Bool;\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tif (probe_type_expr == null)\n\t\t\t\treturn ResolveMatchingExpression (rc);\n\n\t\t\tvar res = ResolveResultExpression (rc);\n\t\t\tif (Variable != null) {\n\t\t\t\tif (res is Constant)\n\t\t\t\t\tthrow new NotImplementedException (\"constant in type pattern matching\");\n\n\t\t\t\tVariable.Type = probe_type_expr;\n\t\t\t\tvar bc = rc as BlockContext;\n\t\t\t\tif (bc != null)\n\t\t\t\t\tVariable.PrepareAssignmentAnalysis (bc);\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tbase.FlowAnalysis (fc);\n\n\t\t\tif (Variable != null)\n\t\t\t\tfc.SetVariableAssigned (Variable.VariableInfo, true);\n\t\t}\n\n\t\tprotected override void ResolveProbeType (ResolveContext rc)\n\t\t{\n\t\t\tif (!(ProbeType is TypeExpr) && rc.Module.Compiler.Settings.Version == LanguageVersion.Experimental) {\n\t\t\t\tProbeType = ProbeType.Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup | ResolveFlags.Type);\n\t\t\t\tif (ProbeType == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (ProbeType.eclass == ExprClass.Type) {\n\t\t\t\t\tprobe_type_expr = ProbeType.Type;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ResolveProbeType (rc);\n\t\t}\n\n\t\tExpression ResolveMatchingExpression (ResolveContext rc)\n\t\t{\n\t\t\tvar mc = ProbeType as Constant;\n\t\t\tif (mc != null) {\n\t\t\t\tif (!Convert.ImplicitConversionExists (rc, ProbeType, Expr.Type)) {\n\t\t\t\t\tProbeType.Error_ValueCannotBeConverted (rc, Expr.Type, false);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (mc.IsNull)\n\t\t\t\t\treturn new Binary (Binary.Operator.Equality, Expr, mc).Resolve (rc);\n\n\t\t\t\tvar c = Expr as Constant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\tc = ConstantFold.BinaryFold (rc, Binary.Operator.Equality, c, mc, loc);\n\t\t\t\t\tif (c != null)\n\t\t\t\t\t\treturn c;\n\t\t\t\t}\n\n\t\t\t\tif (Expr.Type.IsNullableType) {\n\t\t\t\t\texpr_unwrap = new Nullable.Unwrap (Expr);\n\t\t\t\t\texpr_unwrap.Resolve (rc);\n\t\t\t\t} else if (ProbeType.Type.IsEnum || (ProbeType.Type.BuiltinType >= BuiltinTypeSpec.Type.Byte && ProbeType.Type.BuiltinType <= BuiltinTypeSpec.Type.Decimal)) {\n\t\t\t\t\tvar helper = rc.Module.CreatePatterMatchingHelper ();\n\t\t\t\t\tnumber_mg = helper.NumberMatcher.Spec;\n\n\t\t\t\t\t//\n\t\t\t\t\t// There are actually 3 arguments but the first one is already on the stack\n\t\t\t\t\t//\n\t\t\t\t\tnumber_args = new Arguments (3);\n\t\t\t\t\tif (!ProbeType.Type.IsEnum)\n\t\t\t\t\t\tnumber_args.Add (new Argument (Expr));\n\n\t\t\t\t\tnumber_args.Add (new Argument (Convert.ImplicitConversion (rc, ProbeType, rc.BuiltinTypes.Object, loc)));\n\t\t\t\t\tnumber_args.Add (new Argument (new BoolLiteral (rc.BuiltinTypes, ProbeType.Type.IsEnum, loc)));\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tExpression ResolveResultExpression (ResolveContext ec)\n\t\t{\n\t\t\tTypeSpec d = expr.Type;\n\t\t\tbool d_is_nullable = false;\n\n\t\t\t//\n\t\t\t// If E is a method group or the null literal, or if the type of E is a reference\n\t\t\t// type or a nullable type and the value of E is null, the result is false\n\t\t\t//\n\t\t\tif (expr.IsNull || expr.eclass == ExprClass.MethodGroup)\n\t\t\t\treturn CreateConstantResult (ec, false);\n\n\t\t\tif (d.IsNullableType) {\n\t\t\t\tvar ut = Nullable.NullableInfo.GetUnderlyingType (d);\n\t\t\t\tif (!ut.IsGenericParameter) {\n\t\t\t\t\td = ut;\n\t\t\t\t\td_is_nullable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\tTypeSpec t = probe_type_expr;\n\t\t\tbool t_is_nullable = false;\n\t\t\tif (t.IsNullableType) {\n\t\t\t\tvar ut = Nullable.NullableInfo.GetUnderlyingType (t);\n\t\t\t\tif (!ut.IsGenericParameter) {\n\t\t\t\t\tt = ut;\n\t\t\t\t\tt_is_nullable = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (t.IsStruct) {\n\t\t\t\tif (d == t) {\n\t\t\t\t\t//\n\t\t\t\t\t// D and T are the same value types but D can be null\n\t\t\t\t\t//\n\t\t\t\t\tif (d_is_nullable && !t_is_nullable) {\n\t\t\t\t\t\texpr_unwrap = Nullable.Unwrap.Create (expr, true);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t// The result is true if D and T are the same value types\n\t\t\t\t\t//\n\t\t\t\t\treturn CreateConstantResult (ec, true);\n\t\t\t\t}\n\n\t\t\t\tvar tp = d as TypeParameterSpec;\n\t\t\t\tif (tp != null)\n\t\t\t\t\treturn ResolveGenericParameter (ec, t, tp);\n\n\t\t\t\t//\n\t\t\t\t// An unboxing conversion exists\n\t\t\t\t//\n\t\t\t\tif (Convert.ExplicitReferenceConversionExists (d, t))\n\t\t\t\t\treturn this;\n\n\t\t\t\t//\n\t\t\t\t// open generic type\n\t\t\t\t//\n\t\t\t\tif (d is InflatedTypeSpec && InflatedTypeSpec.ContainsTypeParameter (d))\n\t\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\tvar tps = t as TypeParameterSpec;\n\t\t\t\tif (tps != null)\n\t\t\t\t\treturn ResolveGenericParameter (ec, d, tps);\n\n\t\t\t\tif (t.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tec.Report.Warning (1981, 3, loc,\n\t\t\t\t\t\t\"Using `{0}' to test compatibility with `{1}' is identical to testing compatibility with `object'\",\n\t\t\t\t\t\tOperatorName, t.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (TypeManager.IsGenericParameter (d))\n\t\t\t\t\treturn ResolveGenericParameter (ec, t, (TypeParameterSpec) d);\n\n\t\t\t\tif (TypeSpec.IsValueType (d)) {\n\t\t\t\t\tif (Convert.ImplicitBoxingConversion (null, d, t) != null) {\n\t\t\t\t\t\tif (d_is_nullable && !t_is_nullable) {\n\t\t\t\t\t\t\texpr_unwrap = Nullable.Unwrap.Create (expr, false);\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn CreateConstantResult (ec, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (Convert.ImplicitReferenceConversionExists (d, t)) {\n\t\t\t\t\t\tvar c = expr as Constant;\n\t\t\t\t\t\tif (c != null)\n\t\t\t\t\t\t\treturn CreateConstantResult (ec, !c.IsNull);\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Do not optimize for imported type or dynamic type\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (d.MemberDefinition.IsImported && d.BuiltinType != BuiltinTypeSpec.Type.None &&\n\t\t\t\t\t\t\td.MemberDefinition.DeclaringAssembly != t.MemberDefinition.DeclaringAssembly) {\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (d.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Turn is check into simple null check for implicitly convertible reference types\n\t\t\t\t\t\t//\n\t\t\t\t\t\treturn ReducedExpression.Create (\n\t\t\t\t\t\t\tnew Binary (Binary.Operator.Inequality, expr, new NullLiteral (loc)).Resolve (ec),\n\t\t\t\t\t\t\tthis).Resolve (ec);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Convert.ExplicitReferenceConversionExists (d, t))\n\t\t\t\t\t\treturn this;\n\n\t\t\t\t\t//\n\t\t\t\t\t// open generic type\n\t\t\t\t\t//\n\t\t\t\t\tif ((d is InflatedTypeSpec || d.IsArray) && InflatedTypeSpec.ContainsTypeParameter (d))\n\t\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn CreateConstantResult (ec, false);\n\t\t}\n\n\t\tExpression ResolveGenericParameter (ResolveContext ec, TypeSpec d, TypeParameterSpec t)\n\t\t{\n\t\t\tif (t.IsReferenceType) {\n\t\t\t\tif (d.IsStruct)\n\t\t\t\t\treturn CreateConstantResult (ec, false);\n\t\t\t}\n\n\t\t\tif (expr.Type.IsGenericParameter) {\n\t\t\t\tif (expr.Type == d && TypeSpec.IsValueType (t) && TypeSpec.IsValueType (d))\n\t\t\t\t\treturn CreateConstantResult (ec, true);\n\n\t\t\t\texpr = new BoxedCast (expr, d);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implementation of the `as' operator.\n\t/// </summary>\n\tpublic class As : Probe {\n\n\t\tpublic As (Expression expr, Expression probe_type, Location l)\n\t\t\t: base (expr, probe_type, l)\n\t\t{\n\t\t}\n\n\t\tprotected override string OperatorName {\n\t\t\tget { return \"as\"; }\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = Arguments.CreateForExpressionTree (ec, null,\n\t\t\t\texpr.CreateExpressionTree (ec),\n\t\t\t\tnew TypeOf (probe_type_expr, loc));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"TypeAs\", args);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\texpr.Emit (ec);\n\n\t\t\tec.Emit (OpCodes.Isinst, type);\n\n\t\t\tif (TypeManager.IsGenericParameter (type) || type.IsNullableType)\n\t\t\t\tec.Emit (OpCodes.Unbox_Any, type);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (ResolveCommon (ec) == null)\n\t\t\t\treturn null;\n\n\t\t\ttype = probe_type_expr;\n\t\t\teclass = ExprClass.Value;\n\t\t\tTypeSpec etype = expr.Type;\n\n\t\t\tif (!TypeSpec.IsReferenceType (type) && !type.IsNullableType) {\n\t\t\t\tif (TypeManager.IsGenericParameter (type)) {\n\t\t\t\t\tec.Report.Error (413, loc,\n\t\t\t\t\t\t\"The `as' operator cannot be used with a non-reference type parameter `{0}'. Consider adding `class' or a reference type constraint\",\n\t\t\t\t\t\tprobe_type_expr.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tec.Report.Error (77, loc,\n\t\t\t\t\t\t\"The `as' operator cannot be used with a non-nullable value type `{0}'\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (expr.IsNull && type.IsNullableType) {\n\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (ec, this);\n\t\t\t}\n\n\t\t\t// If the compile-time type of E is dynamic, unlike the cast operator the as operator is not dynamically bound\n\t\t\tif (etype.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\t\n\t\t\tExpression e = Convert.ImplicitConversionStandard (ec, expr, type, loc);\n\t\t\tif (e != null) {\n\t\t\t\te = EmptyCast.Create (e, type);\n\t\t\t\treturn ReducedExpression.Create (e, this).Resolve (ec);\n\t\t\t}\n\n\t\t\tif (Convert.ExplicitReferenceConversionExists (etype, type)){\n\t\t\t\tif (TypeManager.IsGenericParameter (etype))\n\t\t\t\t\texpr = new BoxedCast (expr, etype);\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (InflatedTypeSpec.ContainsTypeParameter (etype) || InflatedTypeSpec.ContainsTypeParameter (type)) {\n\t\t\t\texpr = new BoxedCast (expr, etype);\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (etype != InternalType.ErrorType) {\n\t\t\t\tec.Report.Error (39, loc, \"Cannot convert type `{0}' to `{1}' via a built-in conversion\",\n\t\t\t\t\tetype.GetSignatureForError (), type.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\t\n\t//\n\t// This represents a typecast in the source language.\n\t//\n\tpublic class Cast : ShimExpression {\n\t\tExpression target_type;\n\n\t\tpublic Cast (Expression cast_type, Expression expr, Location loc)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.target_type = cast_type;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic Expression TargetType {\n\t\t\tget { return target_type; }\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\ttype = target_type.ResolveAsType (ec);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\tif (type.IsStatic) {\n\t\t\t\tec.Report.Error (716, loc, \"Cannot convert to static type `{0}'\", type.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (type.IsPointer && !ec.IsUnsafe) {\n\t\t\t\tUnsafeError (ec, loc);\n\t\t\t}\n\n\t\t\teclass = ExprClass.Value;\n\t\t\t\n\t\t\tConstant c = expr as Constant;\n\t\t\tif (c != null) {\n\t\t\t\tc = c.Reduce (ec, type);\n\t\t\t\tif (c != null)\n\t\t\t\t\treturn c;\n\t\t\t}\n\n\t\t\tvar res = Convert.ExplicitConversion (ec, expr, type, loc);\n\t\t\tif (res == expr)\n\t\t\t\treturn EmptyCast.Create (res, type);\n\n\t\t\treturn res;\n\t\t}\n\t\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tCast target = (Cast) t;\n\n\t\t\ttarget.target_type = target_type.Clone (clonectx);\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ImplicitCast : ShimExpression\n\t{\n\t\tbool arrayAccess;\n\n\t\tpublic ImplicitCast (Expression expr, TypeSpec target, bool arrayAccess)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.loc = expr.Location;\n\t\t\tthis.type = target;\n\t\t\tthis.arrayAccess = arrayAccess;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tif (arrayAccess)\n\t\t\t\texpr = ConvertExpressionToArrayIndex (ec, expr);\n\t\t\telse\n\t\t\t\texpr = Convert.ImplicitConversionRequired (ec, expr, type, loc);\n\n\t\t\treturn expr;\n\t\t}\n\t}\n\t\n\t//\n\t// C# 2.0 Default value expression\n\t//\n\tpublic class DefaultValueExpression : Expression\n\t{\n\t\tExpression expr;\n\n\t\tpublic DefaultValueExpression (Expression expr, Location loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn this.expr; \n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (this));\n\t\t\targs.Add (new Argument (new TypeOf (type, loc)));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Constant\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\ttype = expr.ResolveAsType (ec);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\tif (type.IsStatic) {\n\t\t\t\tec.Report.Error (-244, loc, \"The `default value' operator cannot be applied to an operand of a static type\");\n\t\t\t}\n\n\t\t\tif (type.IsPointer)\n\t\t\t\treturn new NullLiteral (Location).ConvertImplicitly (type);\n\n\t\t\tif (TypeSpec.IsReferenceType (type))\n\t\t\t\treturn new NullConstant (type, loc);\n\n\t\t\tConstant c = New.Constantify (type, expr.Location);\n\t\t\tif (c != null)\n\t\t\t\treturn c;\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLocalTemporary temp_storage = new LocalTemporary(type);\n\n\t\t\ttemp_storage.AddressOf(ec, AddressOp.LoadStore);\n\t\t\tec.Emit(OpCodes.Initobj, type);\n\t\t\ttemp_storage.Emit(ec);\n\t\t\ttemp_storage.Release (ec);\n\t\t}\n\n#if (NET_4_0 || MOBILE_DYNAMIC) && !STATIC\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn SLE.Expression.Default (type.GetMetaInfo ());\n\t\t}\n#endif\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tDefaultValueExpression target = (DefaultValueExpression) t;\n\t\t\t\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Binary operators\n\t/// </summary>\n\tpublic class Binary : Expression, IDynamicBinder\n\t{\n\t\tpublic class PredefinedOperator\n\t\t{\n\t\t\tprotected readonly TypeSpec left;\n\t\t\tprotected readonly TypeSpec right;\n\t\t\tprotected readonly TypeSpec left_unwrap;\n\t\t\tprotected readonly TypeSpec right_unwrap;\n\t\t\tpublic readonly Operator OperatorsMask;\n\t\t\tpublic TypeSpec ReturnType;\n\n\t\t\tpublic PredefinedOperator (TypeSpec ltype, TypeSpec rtype, Operator op_mask)\n\t\t\t\t: this (ltype, rtype, op_mask, ltype)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic PredefinedOperator (TypeSpec type, Operator op_mask, TypeSpec return_type)\n\t\t\t\t: this (type, type, op_mask, return_type)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic PredefinedOperator (TypeSpec type, Operator op_mask)\n\t\t\t\t: this (type, type, op_mask, type)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic PredefinedOperator (TypeSpec ltype, TypeSpec rtype, Operator op_mask, TypeSpec return_type)\n\t\t\t{\n\t\t\t\tif ((op_mask & Operator.ValuesOnlyMask) != 0)\n\t\t\t\t\tthrow new InternalErrorException (\"Only masked values can be used\");\n\n\t\t\t\tif ((op_mask & Operator.NullableMask) != 0) {\n\t\t\t\t\tleft_unwrap = Nullable.NullableInfo.GetUnderlyingType (ltype);\n\t\t\t\t\tright_unwrap = Nullable.NullableInfo.GetUnderlyingType (rtype);\n\t\t\t\t} else {\n\t\t\t\t\tleft_unwrap = ltype;\n\t\t\t\t\tright_unwrap = rtype;\n\t\t\t\t}\n\n\t\t\t\tthis.left = ltype;\n\t\t\t\tthis.right = rtype;\n\t\t\t\tthis.OperatorsMask = op_mask;\n\t\t\t\tthis.ReturnType = return_type;\n\t\t\t}\n\n\t\t\tpublic bool IsLifted {\n\t\t\t\tget {\n\t\t\t\t\treturn (OperatorsMask & Operator.NullableMask) != 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic virtual Expression ConvertResult (ResolveContext rc, Binary b)\n\t\t\t{\n\t\t\t\tConstant c;\n\n\t\t\t\tvar left_expr = b.left;\n\t\t\t\tvar right_expr = b.right;\n\n\t\t\t\tb.type = ReturnType;\n\n\t\t\t\tif (IsLifted) {\n\t\t\t\t\tif (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion)) {\n\t\t\t\t\t\tb.left = Convert.ImplicitConversion (rc, b.left, left, b.left.Location);\n\t\t\t\t\t\tb.right = Convert.ImplicitConversion (rc, b.right, right, b.right.Location);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (right_expr.IsNull) {\n\t\t\t\t\t\tif ((b.oper & Operator.EqualityMask) != 0) {\n\t\t\t\t\t\t\tif (!left_expr.Type.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (left_expr.Type))\n\t\t\t\t\t\t\t\treturn b.CreateLiftedValueTypeResult (rc, left_expr.Type);\n\t\t\t\t\t\t} else if ((b.oper & Operator.BitwiseMask) != 0) {\n\t\t\t\t\t\t\tif (left_unwrap.BuiltinType != BuiltinTypeSpec.Type.Bool)\n\t\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, b);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tb.left = Convert.ImplicitConversion (rc, b.left, left, b.left.Location);\n\t\t\t\t\t\t\tb.right = Convert.ImplicitConversion (rc, b.right, right, b.right.Location);\n\n\t\t\t\t\t\t\tif ((b.Oper & (Operator.ArithmeticMask | Operator.ShiftMask)) != 0)\n\t\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, b);\n\n\t\t\t\t\t\t\treturn b.CreateLiftedValueTypeResult (rc, left);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (left_expr.IsNull) {\n\t\t\t\t\t\tif ((b.oper & Operator.EqualityMask) != 0) {\n\t\t\t\t\t\t\tif (!right_expr.Type.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (right_expr.Type))\n\t\t\t\t\t\t\t\treturn b.CreateLiftedValueTypeResult (rc, right_expr.Type);\n\t\t\t\t\t\t} else if ((b.oper & Operator.BitwiseMask) != 0) {\n\t\t\t\t\t\t\tif (right_unwrap.BuiltinType != BuiltinTypeSpec.Type.Bool)\n\t\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, b);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tb.left = Convert.ImplicitConversion (rc, b.left, left, b.left.Location);\n\t\t\t\t\t\t\tb.right = Convert.ImplicitConversion (rc, b.right, right, b.right.Location);\n\n\t\t\t\t\t\t\tif ((b.Oper & (Operator.ArithmeticMask | Operator.ShiftMask)) != 0)\n\t\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, b);\n\n\t\t\t\t\t\t\treturn b.CreateLiftedValueTypeResult (rc, right);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// A user operators does not support multiple user conversions, but decimal type\n\t\t\t\t// is considered to be predefined type therefore we apply predefined operators rules\n\t\t\t\t// and then look for decimal user-operator implementation\n\t\t\t\t//\n\t\t\t\tif (left.BuiltinType == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\t\tb.left = Convert.ImplicitConversion (rc, b.left, left, b.left.Location);\n\t\t\t\t\tb.right = Convert.ImplicitConversion (rc, b.right, right, b.right.Location);\n\n\t\t\t\t\treturn b.ResolveUserOperator (rc, b.left, b.right);\n\t\t\t\t}\n\n\t\t\t\tc = right_expr as Constant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\tif (c.IsDefaultValue) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes\n\t\t\t\t\t\t// \n\t\t\t\t\t\t// (expr + 0) to expr\n\t\t\t\t\t\t// (expr - 0) to expr\n\t\t\t\t\t\t// (bool? | false) to bool?\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (b.oper == Operator.Addition || b.oper == Operator.Subtraction ||\n\t\t\t\t\t\t\t(b.oper == Operator.BitwiseOr && left_unwrap.BuiltinType == BuiltinTypeSpec.Type.Bool && c is BoolConstant)) {\n\t\t\t\t\t\t\tb.left = Convert.ImplicitConversion (rc, b.left, left, b.left.Location);\n\t\t\t\t\t\t\treturn ReducedExpression.Create (b.left, b).Resolve (rc);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes (value &/&& 0) to 0\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((b.oper == Operator.BitwiseAnd || b.oper == Operator.LogicalAnd) && !IsLifted) {\n\t\t\t\t\t\t\tConstant side_effect = new SideEffectConstant (c, b.left, c.Location);\n\t\t\t\t\t\t\treturn ReducedExpression.Create (side_effect, b);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes (bool? & true) to bool?\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (IsLifted && left_unwrap.BuiltinType == BuiltinTypeSpec.Type.Bool && b.oper == Operator.BitwiseAnd) {\n\t\t\t\t\t\t\treturn ReducedExpression.Create (b.left, b).Resolve (rc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((b.oper == Operator.Multiply || b.oper == Operator.Division) && c.IsOneInteger)\n\t\t\t\t\t\treturn ReducedExpression.Create (b.left, b).Resolve (rc);\n\n\t\t\t\t\tif ((b.oper & Operator.ShiftMask) != 0 && c is IntConstant) {\n\t\t\t\t\t\tb.right = new IntConstant (rc.BuiltinTypes, ((IntConstant) c).Value & GetShiftMask (left_unwrap), b.right.Location);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tc = b.left as Constant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\tif (c.IsDefaultValue) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes\n\t\t\t\t\t\t// \n\t\t\t\t\t\t// (0 + expr) to expr\n\t\t\t\t\t\t// (false | bool?) to bool?\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (b.oper == Operator.Addition ||\n\t\t\t\t\t\t\t(b.oper == Operator.BitwiseOr && right_unwrap.BuiltinType == BuiltinTypeSpec.Type.Bool && c is BoolConstant)) {\n\t\t\t\t\t\t\tb.right = Convert.ImplicitConversion (rc, b.right, right, b.right.Location);\n\t\t\t\t\t\t\treturn ReducedExpression.Create (b.right, b).Resolve (rc);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes (false && expr) to false\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (b.oper == Operator.LogicalAnd && c.Type.BuiltinType == BuiltinTypeSpec.Type.Bool) {\n\t\t\t\t\t\t\t// No rhs side-effects\n\t\t\t\t\t\t\tExpression.Warning_UnreachableExpression (rc, b.right.StartLocation);\n\t\t\t\t\t\t\treturn ReducedExpression.Create (c, b);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes (0 & value) to 0\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (b.oper == Operator.BitwiseAnd && !IsLifted) {\n\t\t\t\t\t\t\tConstant side_effect = new SideEffectConstant (c, b.right, c.Location);\n\t\t\t\t\t\t\treturn ReducedExpression.Create (side_effect, b);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes (true & bool?) to bool?\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (IsLifted && left_unwrap.BuiltinType == BuiltinTypeSpec.Type.Bool && b.oper == Operator.BitwiseAnd) {\n\t\t\t\t\t\t\treturn ReducedExpression.Create (b.right, b).Resolve (rc);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Optimizes (true || expr) to true\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (b.oper == Operator.LogicalOr && c.Type.BuiltinType == BuiltinTypeSpec.Type.Bool) {\n\t\t\t\t\t\t\t// No rhs side-effects\n\t\t\t\t\t\t\tExpression.Warning_UnreachableExpression (rc, b.right.StartLocation);\n\t\t\t\t\t\t\treturn ReducedExpression.Create (c, b);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (b.oper == Operator.Multiply && c.IsOneInteger)\n\t\t\t\t\t\treturn ReducedExpression.Create (b.right, b).Resolve (rc);\n\t\t\t\t}\n\n\t\t\t\tif (IsLifted) {\n\t\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (b);\n\n\t\t\t\t\tTypeSpec ltype, rtype;\n\t\t\t\t\tif (b.left.Type.IsNullableType) {\n\t\t\t\t\t\tlifted.UnwrapLeft = new Nullable.Unwrap (b.left);\n\t\t\t\t\t\tltype = left_unwrap;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tltype = left;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (b.right.Type.IsNullableType) {\n\t\t\t\t\t\tlifted.UnwrapRight = new Nullable.Unwrap (b.right);\n\t\t\t\t\t\trtype = right_unwrap;\n\t\t\t\t\t} else {\n\t\t\t\t\t\trtype = right;\n\t\t\t\t\t}\n\n\t\t\t\t\tlifted.Left = b.left.IsNull ?\n\t\t\t\t\t\tb.left :\n\t\t\t\t\t\tConvert.ImplicitConversion (rc, lifted.UnwrapLeft ?? b.left, ltype, b.left.Location);\n\n\t\t\t\t\tlifted.Right = b.right.IsNull ?\n\t\t\t\t\t\tb.right :\n\t\t\t\t\t\tConvert.ImplicitConversion (rc, lifted.UnwrapRight ?? b.right, rtype, b.right.Location);\n\n\t\t\t\t\treturn lifted.Resolve (rc);\n\t\t\t\t}\n\n\t\t\t\tb.left = Convert.ImplicitConversion (rc, b.left, left, b.left.Location);\n\t\t\t\tb.right = Convert.ImplicitConversion (rc, b.right, right, b.right.Location);\n\n\t\t\t\treturn b;\n\t\t\t}\n\n\t\t\tpublic bool IsPrimitiveApplicable (TypeSpec ltype, TypeSpec rtype)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// We are dealing with primitive types only\n\t\t\t\t//\n\t\t\t\treturn left == ltype && ltype == rtype;\n\t\t\t}\n\n\t\t\tpublic virtual bool IsApplicable (ResolveContext ec, Expression lexpr, Expression rexpr)\n\t\t\t{\n\t\t\t\t// Quick path\n\t\t\t\tif (left == lexpr.Type && right == rexpr.Type)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn Convert.ImplicitConversionExists (ec, lexpr, left) &&\n\t\t\t\t\tConvert.ImplicitConversionExists (ec, rexpr, right);\n\t\t\t}\n\n\t\t\tpublic PredefinedOperator ResolveBetterOperator (ResolveContext ec, PredefinedOperator best_operator)\n\t\t\t{\n\t\t\t\tif ((OperatorsMask & Operator.DecomposedMask) != 0)\n\t\t\t\t\treturn best_operator;\n\n\t\t\t\tif ((best_operator.OperatorsMask & Operator.DecomposedMask) != 0)\n\t\t\t\t\treturn this;\n\n\t\t\t\tint result = 0;\n\t\t\t\tif (left != null && best_operator.left != null) {\n\t\t\t\t\tresult = OverloadResolver.BetterTypeConversion (ec, best_operator.left_unwrap, left_unwrap);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// When second argument is same as the first one, the result is same\n\t\t\t\t//\n\t\t\t\tif (right != null && (left != right || best_operator.left != best_operator.right)) {\n\t\t\t\t\tresult |= OverloadResolver.BetterTypeConversion (ec, best_operator.right_unwrap, right_unwrap);\n\t\t\t\t}\n\n\t\t\t\tif (result == 0 || result > 2)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn result == 1 ? best_operator : this;\n\t\t\t}\n\t\t}\n\n\t\tsealed class PredefinedStringOperator : PredefinedOperator\n\t\t{\n\t\t\tpublic PredefinedStringOperator (TypeSpec type, Operator op_mask, TypeSpec retType)\n\t\t\t\t: base (type, type, op_mask, retType)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic PredefinedStringOperator (TypeSpec ltype, TypeSpec rtype, Operator op_mask, TypeSpec retType)\n\t\t\t\t: base (ltype, rtype, op_mask, retType)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override Expression ConvertResult (ResolveContext ec, Binary b)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Use original expression for nullable arguments\n\t\t\t\t//\n\t\t\t\tNullable.Unwrap unwrap = b.left as Nullable.Unwrap;\n\t\t\t\tif (unwrap != null)\n\t\t\t\t\tb.left = unwrap.Original;\n\n\t\t\t\tunwrap = b.right as Nullable.Unwrap;\n\t\t\t\tif (unwrap != null)\n\t\t\t\t\tb.right = unwrap.Original;\n\n\t\t\t\tb.left = Convert.ImplicitConversion (ec, b.left, left, b.left.Location);\n\t\t\t\tb.right = Convert.ImplicitConversion (ec, b.right, right, b.right.Location);\n\n\t\t\t\t//\n\t\t\t\t// Start a new concat expression using converted expression\n\t\t\t\t//\n\t\t\t\treturn StringConcat.Create (ec, b.left, b.right, b.loc);\n\t\t\t}\n\t\t}\n\n\t\tsealed class PredefinedEqualityOperator : PredefinedOperator\n\t\t{\n\t\t\tMethodSpec equal_method, inequal_method;\n\n\t\t\tpublic PredefinedEqualityOperator (TypeSpec arg, TypeSpec retType)\n\t\t\t\t: base (arg, arg, Operator.EqualityMask, retType)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override Expression ConvertResult (ResolveContext ec, Binary b)\n\t\t\t{\n\t\t\t\tb.type = ReturnType;\n\n\t\t\t\tb.left = Convert.ImplicitConversion (ec, b.left, left, b.left.Location);\n\t\t\t\tb.right = Convert.ImplicitConversion (ec, b.right, right, b.right.Location);\n\n\t\t\t\tArguments args = new Arguments (2);\n\t\t\t\targs.Add (new Argument (b.left));\n\t\t\t\targs.Add (new Argument (b.right));\n\n\t\t\t\tMethodSpec method;\n\t\t\t\tif (b.oper == Operator.Equality) {\n\t\t\t\t\tif (equal_method == null) {\n\t\t\t\t\t\tif (left.BuiltinType == BuiltinTypeSpec.Type.String)\n\t\t\t\t\t\t\tequal_method = ec.Module.PredefinedMembers.StringEqual.Resolve (b.loc);\n\t\t\t\t\t\telse if (left.BuiltinType == BuiltinTypeSpec.Type.Delegate)\n\t\t\t\t\t\t\tequal_method = ec.Module.PredefinedMembers.DelegateEqual.Resolve (b.loc);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new NotImplementedException (left.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tmethod = equal_method;\n\t\t\t\t} else {\n\t\t\t\t\tif (inequal_method == null) {\n\t\t\t\t\t\tif (left.BuiltinType == BuiltinTypeSpec.Type.String)\n\t\t\t\t\t\t\tinequal_method = ec.Module.PredefinedMembers.StringInequal.Resolve (b.loc);\n\t\t\t\t\t\telse if (left.BuiltinType == BuiltinTypeSpec.Type.Delegate)\n\t\t\t\t\t\t\tinequal_method = ec.Module.PredefinedMembers.DelegateInequal.Resolve (b.loc);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthrow new NotImplementedException (left.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tmethod = inequal_method;\n\t\t\t\t}\n\n\t\t\t\treturn new UserOperatorCall (method, args, b.CreateExpressionTree, b.loc);\n\t\t\t}\n\t\t}\n\n\t\tclass PredefinedPointerOperator : PredefinedOperator\n\t\t{\n\t\t\tpublic PredefinedPointerOperator (TypeSpec ltype, TypeSpec rtype, Operator op_mask)\n\t\t\t\t: base (ltype, rtype, op_mask)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic PredefinedPointerOperator (TypeSpec ltype, TypeSpec rtype, Operator op_mask, TypeSpec retType)\n\t\t\t\t: base (ltype, rtype, op_mask, retType)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic PredefinedPointerOperator (TypeSpec type, Operator op_mask, TypeSpec return_type)\n\t\t\t\t: base (type, op_mask, return_type)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override bool IsApplicable (ResolveContext ec, Expression lexpr, Expression rexpr)\n\t\t\t{\n\t\t\t\tif (left == null) {\n\t\t\t\t\tif (!lexpr.Type.IsPointer)\n\t\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif (!Convert.ImplicitConversionExists (ec, lexpr, left))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (right == null) {\n\t\t\t\t\tif (!rexpr.Type.IsPointer)\n\t\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif (!Convert.ImplicitConversionExists (ec, rexpr, right))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override Expression ConvertResult (ResolveContext ec, Binary b)\n\t\t\t{\n\t\t\t\tif (left != null) {\n\t\t\t\t\tb.left = EmptyCast.Create (b.left, left);\n\t\t\t\t} else if (right != null) {\n\t\t\t\t\tb.right = EmptyCast.Create (b.right, right);\n\t\t\t\t}\n\n\t\t\t\tTypeSpec r_type = ReturnType;\n\t\t\t\tExpression left_arg, right_arg;\n\t\t\t\tif (r_type == null) {\n\t\t\t\t\tif (left == null) {\n\t\t\t\t\t\tleft_arg = b.left;\n\t\t\t\t\t\tright_arg = b.right;\n\t\t\t\t\t\tr_type = b.left.Type;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tleft_arg = b.right;\n\t\t\t\t\t\tright_arg = b.left;\n\t\t\t\t\t\tr_type = b.right.Type;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tleft_arg = b.left;\n\t\t\t\t\tright_arg = b.right;\n\t\t\t\t}\n\n\t\t\t\treturn new PointerArithmetic (b.oper, left_arg, right_arg, r_type, b.loc).Resolve (ec);\n\t\t\t}\n\t\t}\n\n\t\t[Flags]\n\t\tpublic enum Operator {\n\t\t\tMultiply\t= 0 | ArithmeticMask,\n\t\t\tDivision\t= 1 | ArithmeticMask,\n\t\t\tModulus\t\t= 2 | ArithmeticMask,\n\t\t\tAddition\t= 3 | ArithmeticMask | AdditionMask,\n\t\t\tSubtraction = 4 | ArithmeticMask | SubtractionMask,\n\n\t\t\tLeftShift\t= 5 | ShiftMask,\n\t\t\tRightShift\t= 6 | ShiftMask,\n\n\t\t\tLessThan\t= 7 | ComparisonMask | RelationalMask,\n\t\t\tGreaterThan\t= 8 | ComparisonMask | RelationalMask,\n\t\t\tLessThanOrEqual\t\t= 9 | ComparisonMask | RelationalMask,\n\t\t\tGreaterThanOrEqual\t= 10 | ComparisonMask | RelationalMask,\n\t\t\tEquality\t= 11 | ComparisonMask | EqualityMask,\n\t\t\tInequality\t= 12 | ComparisonMask | EqualityMask,\n\n\t\t\tBitwiseAnd\t= 13 | BitwiseMask,\n\t\t\tExclusiveOr\t= 14 | BitwiseMask,\n\t\t\tBitwiseOr\t= 15 | BitwiseMask,\n\n\t\t\tLogicalAnd\t= 16 | LogicalMask,\n\t\t\tLogicalOr\t= 17 | LogicalMask,\n\n\t\t\t//\n\t\t\t// Operator masks\n\t\t\t//\n\t\t\tValuesOnlyMask\t= ArithmeticMask - 1,\n\t\t\tArithmeticMask\t= 1 << 5,\n\t\t\tShiftMask\t\t= 1 << 6,\n\t\t\tComparisonMask\t= 1 << 7,\n\t\t\tEqualityMask\t= 1 << 8,\n\t\t\tBitwiseMask\t\t= 1 << 9,\n\t\t\tLogicalMask\t\t= 1 << 10,\n\t\t\tAdditionMask\t= 1 << 11,\n\t\t\tSubtractionMask\t= 1 << 12,\n\t\t\tRelationalMask\t= 1 << 13,\n\n\t\t\tDecomposedMask\t= 1 << 19,\n\t\t\tNullableMask\t= 1 << 20,\n\t\t}\n\n\t\t[Flags]\n\t\tenum State : byte\n\t\t{\n\t\t\tNone = 0,\n\t\t\tCompound = 1 << 1,\n\t\t}\n\n\t\treadonly Operator oper;\n\t\tExpression left, right;\n\t\tState state;\n\t\tConvCast.Mode enum_conversion;\n\n\t\tpublic Binary (Operator oper, Expression left, Expression right, bool isCompound)\n\t\t\t: this (oper, left, right)\n\t\t{\n\t\t\tif (isCompound)\n\t\t\t\tstate |= State.Compound;\n\t\t}\n\n\t\tpublic Binary (Operator oper, Expression left, Expression right)\n\t\t{\n\t\t\tthis.oper = oper;\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\tthis.loc = left.Location;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsCompound {\n\t\t\tget {\n\t\t\t\treturn (state & State.Compound) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic Operator Oper {\n\t\t\tget {\n\t\t\t\treturn oper;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Left {\n\t\t\tget {\n\t\t\t\treturn this.left;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Right {\n\t\t\tget {\n\t\t\t\treturn this.right;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn left.StartLocation;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t///   Returns a stringified representation of the Operator\n\t\t/// </summary>\n\t\tstring OperName (Operator oper)\n\t\t{\n\t\t\tstring s;\n\t\t\tswitch (oper){\n\t\t\tcase Operator.Multiply:\n\t\t\t\ts = \"*\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Division:\n\t\t\t\ts = \"/\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Modulus:\n\t\t\t\ts = \"%\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Addition:\n\t\t\t\ts = \"+\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Subtraction:\n\t\t\t\ts = \"-\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.LeftShift:\n\t\t\t\ts = \"<<\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.RightShift:\n\t\t\t\ts = \">>\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.LessThan:\n\t\t\t\ts = \"<\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.GreaterThan:\n\t\t\t\ts = \">\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\t\ts = \"<=\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\ts = \">=\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Equality:\n\t\t\t\ts = \"==\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Inequality:\n\t\t\t\ts = \"!=\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.BitwiseAnd:\n\t\t\t\ts = \"&\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.BitwiseOr:\n\t\t\t\ts = \"|\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.ExclusiveOr:\n\t\t\t\ts = \"^\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.LogicalOr:\n\t\t\t\ts = \"||\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.LogicalAnd:\n\t\t\t\ts = \"&&\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ts = oper.ToString ();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (IsCompound)\n\t\t\t\treturn s + \"=\";\n\n\t\t\treturn s;\n\t\t}\n\n\t\tpublic static void Error_OperatorCannotBeApplied (ResolveContext ec, Expression left, Expression right, Operator oper, Location loc)\n\t\t{\n\t\t\tnew Binary (oper, left, right).Error_OperatorCannotBeApplied (ec, left, right);\n\t\t}\n\n\t\tpublic static void Error_OperatorCannotBeApplied (ResolveContext ec, Expression left, Expression right, string oper, Location loc)\n\t\t{\n\t\t\tif (left.Type == InternalType.ErrorType || right.Type == InternalType.ErrorType)\n\t\t\t\treturn;\n\n\t\t\tstring l, r;\n\t\t\tl = left.Type.GetSignatureForError ();\n\t\t\tr = right.Type.GetSignatureForError ();\n\n\t\t\tec.Report.Error (19, loc, \"Operator `{0}' cannot be applied to operands of type `{1}' and `{2}'\",\n\t\t\t\toper, l, r);\n\t\t}\n\t\t\n\t\tvoid Error_OperatorCannotBeApplied (ResolveContext ec, Expression left, Expression right)\n\t\t{\n\t\t\tError_OperatorCannotBeApplied (ec, left, right, OperName (oper), loc);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\t//\n\t\t\t// Optimized version when on-true/on-false data are not needed\n\t\t\t//\n\t\t\tif ((oper & Operator.LogicalMask) == 0) {\n\t\t\t\tleft.FlowAnalysis (fc);\n\t\t\t\tright.FlowAnalysis (fc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tleft.FlowAnalysisConditional (fc);\n\t\t\tvar left_fc_ontrue = fc.DefiniteAssignmentOnTrue;\n\t\t\tvar left_fc_onfalse = fc.DefiniteAssignmentOnFalse;\n\n\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (\n\t\t\t\toper == Operator.LogicalOr ? left_fc_onfalse : left_fc_ontrue);\n\t\t\tright.FlowAnalysisConditional (fc);\n\n\t\t\tif (oper == Operator.LogicalOr)\n\t\t\t\tfc.DefiniteAssignment = (left_fc_onfalse | (fc.DefiniteAssignmentOnFalse & fc.DefiniteAssignmentOnTrue)) & left_fc_ontrue;\n\t\t\telse\n\t\t\t\tfc.DefiniteAssignment = (left_fc_ontrue | (fc.DefiniteAssignmentOnFalse & fc.DefiniteAssignmentOnTrue)) & left_fc_onfalse;\n\t\t}\n\n\t\tpublic override void FlowAnalysisConditional (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif ((oper & Operator.LogicalMask) == 0) {\n\t\t\t\tbase.FlowAnalysisConditional (fc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tleft.FlowAnalysisConditional (fc);\n\t\t\tvar left_fc_ontrue = fc.DefiniteAssignmentOnTrue;\n\t\t\tvar left_fc_onfalse = fc.DefiniteAssignmentOnFalse;\n\n\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (\n\t\t\t\toper == Operator.LogicalOr ? left_fc_onfalse : left_fc_ontrue);\n\t\t\tright.FlowAnalysisConditional (fc);\n\n\t\t\tvar lc = left as Constant;\n\t\t\tif (oper == Operator.LogicalOr) {\n\t\t\t\tfc.DefiniteAssignmentOnFalse = left_fc_onfalse | fc.DefiniteAssignmentOnFalse;\n\t\t\t\tif (lc != null && lc.IsDefaultValue)\n\t\t\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse;\n\t\t\t\telse\n\t\t\t\t\tfc.DefiniteAssignmentOnTrue = new DefiniteAssignmentBitSet (left_fc_ontrue & (left_fc_onfalse | fc.DefiniteAssignmentOnTrue));\n\t\t\t} else {\n\t\t\t\tfc.DefiniteAssignmentOnTrue = left_fc_ontrue | fc.DefiniteAssignmentOnTrue;\n\t\t\t\tif (lc != null && !lc.IsDefaultValue)\n\t\t\t\t\tfc.DefiniteAssignmentOnFalse = fc.DefiniteAssignmentOnTrue;\n\t\t\t\telse\n\t\t\t\t\tfc.DefiniteAssignmentOnFalse = new DefiniteAssignmentBitSet ((left_fc_ontrue | fc.DefiniteAssignmentOnFalse) & left_fc_onfalse);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Converts operator to System.Linq.Expressions.ExpressionType enum name\n\t\t//\n\t\tstring GetOperatorExpressionTypeName ()\n\t\t{\n\t\t\tswitch (oper) {\n\t\t\tcase Operator.Addition:\n\t\t\t\treturn IsCompound ? \"AddAssign\" : \"Add\";\n\t\t\tcase Operator.BitwiseAnd:\n\t\t\t\treturn IsCompound ? \"AndAssign\" : \"And\";\n\t\t\tcase Operator.BitwiseOr:\n\t\t\t\treturn IsCompound ? \"OrAssign\" : \"Or\";\n\t\t\tcase Operator.Division:\n\t\t\t\treturn IsCompound ? \"DivideAssign\" : \"Divide\";\n\t\t\tcase Operator.ExclusiveOr:\n\t\t\t\treturn IsCompound ? \"ExclusiveOrAssign\" : \"ExclusiveOr\";\n\t\t\tcase Operator.Equality:\n\t\t\t\treturn \"Equal\";\n\t\t\tcase Operator.GreaterThan:\n\t\t\t\treturn \"GreaterThan\";\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\treturn \"GreaterThanOrEqual\";\n\t\t\tcase Operator.Inequality:\n\t\t\t\treturn \"NotEqual\";\n\t\t\tcase Operator.LeftShift:\n\t\t\t\treturn IsCompound ? \"LeftShiftAssign\" : \"LeftShift\";\n\t\t\tcase Operator.LessThan:\n\t\t\t\treturn \"LessThan\";\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\t\treturn \"LessThanOrEqual\";\n\t\t\tcase Operator.LogicalAnd:\n\t\t\t\treturn \"And\";\n\t\t\tcase Operator.LogicalOr:\n\t\t\t\treturn \"Or\";\n\t\t\tcase Operator.Modulus:\n\t\t\t\treturn IsCompound ? \"ModuloAssign\" : \"Modulo\";\n\t\t\tcase Operator.Multiply:\n\t\t\t\treturn IsCompound ? \"MultiplyAssign\" : \"Multiply\";\n\t\t\tcase Operator.RightShift:\n\t\t\t\treturn IsCompound ? \"RightShiftAssign\" : \"RightShift\";\n\t\t\tcase Operator.Subtraction:\n\t\t\t\treturn IsCompound ? \"SubtractAssign\" : \"Subtract\";\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (\"Unknown expression type operator \" + oper.ToString ());\n\t\t\t}\n\t\t}\n\n\t\tstatic CSharp.Operator.OpType ConvertBinaryToUserOperator (Operator op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\tcase Operator.Addition:\n\t\t\t\treturn CSharp.Operator.OpType.Addition;\n\t\t\tcase Operator.BitwiseAnd:\n\t\t\tcase Operator.LogicalAnd:\n\t\t\t\treturn CSharp.Operator.OpType.BitwiseAnd;\n\t\t\tcase Operator.BitwiseOr:\n\t\t\tcase Operator.LogicalOr:\n\t\t\t\treturn CSharp.Operator.OpType.BitwiseOr;\n\t\t\tcase Operator.Division:\n\t\t\t\treturn CSharp.Operator.OpType.Division;\n\t\t\tcase Operator.Equality:\n\t\t\t\treturn CSharp.Operator.OpType.Equality;\n\t\t\tcase Operator.ExclusiveOr:\n\t\t\t\treturn CSharp.Operator.OpType.ExclusiveOr;\n\t\t\tcase Operator.GreaterThan:\n\t\t\t\treturn CSharp.Operator.OpType.GreaterThan;\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\treturn CSharp.Operator.OpType.GreaterThanOrEqual;\n\t\t\tcase Operator.Inequality:\n\t\t\t\treturn CSharp.Operator.OpType.Inequality;\n\t\t\tcase Operator.LeftShift:\n\t\t\t\treturn CSharp.Operator.OpType.LeftShift;\n\t\t\tcase Operator.LessThan:\n\t\t\t\treturn CSharp.Operator.OpType.LessThan;\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\t\treturn CSharp.Operator.OpType.LessThanOrEqual;\n\t\t\tcase Operator.Modulus:\n\t\t\t\treturn CSharp.Operator.OpType.Modulus;\n\t\t\tcase Operator.Multiply:\n\t\t\t\treturn CSharp.Operator.OpType.Multiply;\n\t\t\tcase Operator.RightShift:\n\t\t\t\treturn CSharp.Operator.OpType.RightShift;\n\t\t\tcase Operator.Subtraction:\n\t\t\t\treturn CSharp.Operator.OpType.Subtraction;\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (op.ToString ());\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn left.ContainsEmitWithAwait () || right.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic static void EmitOperatorOpcode (EmitContext ec, Operator oper, TypeSpec l, Expression right)\n\t\t{\n\t\t\tOpCode opcode;\n\n\t\t\tswitch (oper){\n\t\t\tcase Operator.Multiply:\n\t\t\t\tif (ec.HasSet (EmitContext.Options.CheckedScope)) {\n\t\t\t\t\tif (l.BuiltinType == BuiltinTypeSpec.Type.Int || l.BuiltinType == BuiltinTypeSpec.Type.Long)\n\t\t\t\t\t\topcode = OpCodes.Mul_Ovf;\n\t\t\t\t\telse if (!IsFloat (l))\n\t\t\t\t\t\topcode = OpCodes.Mul_Ovf_Un;\n\t\t\t\t\telse\n\t\t\t\t\t\topcode = OpCodes.Mul;\n\t\t\t\t} else\n\t\t\t\t\topcode = OpCodes.Mul;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.Division:\n\t\t\t\tif (IsUnsigned (l))\n\t\t\t\t\topcode = OpCodes.Div_Un;\n\t\t\t\telse\n\t\t\t\t\topcode = OpCodes.Div;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.Modulus:\n\t\t\t\tif (IsUnsigned (l))\n\t\t\t\t\topcode = OpCodes.Rem_Un;\n\t\t\t\telse\n\t\t\t\t\topcode = OpCodes.Rem;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.Addition:\n\t\t\t\tif (ec.HasSet (EmitContext.Options.CheckedScope)) {\n\t\t\t\t\tif (l.BuiltinType == BuiltinTypeSpec.Type.Int || l.BuiltinType == BuiltinTypeSpec.Type.Long)\n\t\t\t\t\t\topcode = OpCodes.Add_Ovf;\n\t\t\t\t\telse if (!IsFloat (l))\n\t\t\t\t\t\topcode = OpCodes.Add_Ovf_Un;\n\t\t\t\t\telse\n\t\t\t\t\t\topcode = OpCodes.Add;\n\t\t\t\t} else\n\t\t\t\t\topcode = OpCodes.Add;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.Subtraction:\n\t\t\t\tif (ec.HasSet (EmitContext.Options.CheckedScope)) {\n\t\t\t\t\tif (l.BuiltinType == BuiltinTypeSpec.Type.Int || l.BuiltinType == BuiltinTypeSpec.Type.Long)\n\t\t\t\t\t\topcode = OpCodes.Sub_Ovf;\n\t\t\t\t\telse if (!IsFloat (l))\n\t\t\t\t\t\topcode = OpCodes.Sub_Ovf_Un;\n\t\t\t\t\telse\n\t\t\t\t\t\topcode = OpCodes.Sub;\n\t\t\t\t} else\n\t\t\t\t\topcode = OpCodes.Sub;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.RightShift:\n\t\t\t\tif (!(right is IntConstant)) {\n\t\t\t\t\tec.EmitInt (GetShiftMask (l));\n\t\t\t\t\tec.Emit (OpCodes.And);\n\t\t\t\t}\n\n\t\t\t\tif (IsUnsigned (l))\n\t\t\t\t\topcode = OpCodes.Shr_Un;\n\t\t\t\telse\n\t\t\t\t\topcode = OpCodes.Shr;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.LeftShift:\n\t\t\t\tif (!(right is IntConstant)) {\n\t\t\t\t\tec.EmitInt (GetShiftMask (l));\n\t\t\t\t\tec.Emit (OpCodes.And);\n\t\t\t\t}\n\n\t\t\t\topcode = OpCodes.Shl;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.Equality:\n\t\t\t\topcode = OpCodes.Ceq;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.Inequality:\n\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\tec.EmitInt (0);\n\t\t\t\t\n\t\t\t\topcode = OpCodes.Ceq;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.LessThan:\n\t\t\t\tif (IsUnsigned (l))\n\t\t\t\t\topcode = OpCodes.Clt_Un;\n\t\t\t\telse\n\t\t\t\t\topcode = OpCodes.Clt;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.GreaterThan:\n\t\t\t\tif (IsUnsigned (l))\n\t\t\t\t\topcode = OpCodes.Cgt_Un;\n\t\t\t\telse\n\t\t\t\t\topcode = OpCodes.Cgt;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\t\tif (IsUnsigned (l) || IsFloat (l))\n\t\t\t\t\tec.Emit (OpCodes.Cgt_Un);\n\t\t\t\telse\n\t\t\t\t\tec.Emit (OpCodes.Cgt);\n\t\t\t\tec.EmitInt (0);\n\t\t\t\t\n\t\t\t\topcode = OpCodes.Ceq;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\tif (IsUnsigned (l) || IsFloat (l))\n\t\t\t\t\tec.Emit (OpCodes.Clt_Un);\n\t\t\t\telse\n\t\t\t\t\tec.Emit (OpCodes.Clt);\n\t\t\t\t\n\t\t\t\tec.EmitInt (0);\n\t\t\t\t\n\t\t\t\topcode = OpCodes.Ceq;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.BitwiseOr:\n\t\t\t\topcode = OpCodes.Or;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.BitwiseAnd:\n\t\t\t\topcode = OpCodes.And;\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.ExclusiveOr:\n\t\t\t\topcode = OpCodes.Xor;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (oper.ToString ());\n\t\t\t}\n\n\t\t\tec.Emit (opcode);\n\t\t}\n\n\t\tstatic int GetShiftMask (TypeSpec type)\n\t\t{\n\t\t\treturn type.BuiltinType == BuiltinTypeSpec.Type.Int || type.BuiltinType == BuiltinTypeSpec.Type.UInt ? 0x1f : 0x3f;\n\t\t}\n\n\t\tstatic bool IsUnsigned (TypeSpec t)\n\t\t{\n\t\t\tswitch (t.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn t.IsPointer;\n\t\t}\n\n\t\tstatic bool IsFloat (TypeSpec t)\n\t\t{\n\t\t\treturn t.BuiltinType == BuiltinTypeSpec.Type.Float || t.BuiltinType == BuiltinTypeSpec.Type.Double;\n\t\t}\n\n\t\tpublic Expression ResolveOperator (ResolveContext rc)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tTypeSpec l = left.Type;\n\t\t\tTypeSpec r = right.Type;\n\t\t\tExpression expr;\n\t\t\tbool primitives_only = false;\n\n\t\t\t//\n\t\t\t// Handles predefined primitive types\n\t\t\t//\n\t\t\tif ((BuiltinTypeSpec.IsPrimitiveType (l) || (l.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (Nullable.NullableInfo.GetUnderlyingType (l)))) &&\n\t\t\t\t(BuiltinTypeSpec.IsPrimitiveType (r) || (r.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (Nullable.NullableInfo.GetUnderlyingType (r))))) {\n\t\t\t\tif ((oper & Operator.ShiftMask) == 0) {\n\t\t\t\t\tif (!DoBinaryOperatorPromotion (rc))\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tprimitives_only = BuiltinTypeSpec.IsPrimitiveType (l) && BuiltinTypeSpec.IsPrimitiveType (r);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Pointers\n\t\t\t\tif (l.IsPointer || r.IsPointer)\n\t\t\t\t\treturn ResolveOperatorPointer (rc, l, r);\n\n\t\t\t\t// User operators\n\t\t\t\texpr = ResolveUserOperator (rc, left, right);\n\t\t\t\tif (expr != null)\n\t\t\t\t\treturn expr;\n\n\n\t\t\t\tbool lenum = l.IsEnum;\n\t\t\t\tbool renum = r.IsEnum;\n\t\t\t\tif ((oper & (Operator.ComparisonMask | Operator.BitwiseMask)) != 0) {\n\t\t\t\t\t//\n\t\t\t\t\t// Enumerations\n\t\t\t\t\t//\n\t\t\t\t\tif (IsEnumOrNullableEnum (l) || IsEnumOrNullableEnum (r)) {\n\t\t\t\t\t\texpr = ResolveSingleEnumOperators (rc, lenum, renum, l, r);\n\n\t\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tif ((oper & Operator.BitwiseMask) != 0) {\n\t\t\t\t\t\t\texpr = EmptyCast.Create (expr, type);\n\t\t\t\t\t\t\tenum_conversion = GetEnumResultCast (type);\n\n\t\t\t\t\t\t\tif (oper == Operator.BitwiseAnd && left.Type.IsEnum && right.Type.IsEnum) {\n\t\t\t\t\t\t\t\texpr = OptimizeAndOperation (expr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tleft = ConvertEnumOperandToUnderlyingType (rc, left, r.IsNullableType);\n\t\t\t\t\t\tright = ConvertEnumOperandToUnderlyingType (rc, right, l.IsNullableType);\n\t\t\t\t\t\treturn expr;\n\t\t\t\t\t}\n\t\t\t\t} else if ((oper == Operator.Addition || oper == Operator.Subtraction)) {\n\t\t\t\t\tif (IsEnumOrNullableEnum (l) || IsEnumOrNullableEnum (r)) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Enumerations\n\t\t\t\t\t\t//\n\t\t\t\t\t\texpr = ResolveEnumOperators (rc, lenum, renum, l, r);\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// We cannot break here there is also Enum + String possible match\n\t\t\t\t\t\t// which is not ambiguous with predefined enum operators\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\t\tleft = ConvertEnumOperandToUnderlyingType (rc, left, false);\n\t\t\t\t\t\t\tright = ConvertEnumOperandToUnderlyingType (rc, right, false);\n\n\t\t\t\t\t\t\treturn expr;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (l.IsDelegate || r.IsDelegate) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Delegates\n\t\t\t\t\t\t//\n\t\t\t\t\t\texpr = ResolveOperatorDelegate (rc, l, r);\n\n\t\t\t\t\t\t// TODO: Can this be ambiguous\n\t\t\t\t\t\tif (expr != null)\n\t\t\t\t\t\t\treturn expr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//\n\t\t\t// Equality operators are more complicated\n\t\t\t//\n\t\t\tif ((oper & Operator.EqualityMask) != 0) {\n\t\t\t\treturn ResolveEquality (rc, l, r, primitives_only);\n\t\t\t}\n\n\t\t\texpr = ResolveOperatorPredefined (rc, rc.BuiltinTypes.OperatorsBinaryStandard, primitives_only);\n\t\t\tif (expr != null)\n\t\t\t\treturn expr;\n\n\t\t\tif (primitives_only)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Lifted operators have lower priority\n\t\t\t//\n\t\t\treturn ResolveOperatorPredefined (rc, rc.Module.OperatorsBinaryLifted, false);\n\t\t}\n\n\t\tstatic bool IsEnumOrNullableEnum (TypeSpec type)\n\t\t{\n\t\t\treturn type.IsEnum || (type.IsNullableType && Nullable.NullableInfo.GetUnderlyingType (type).IsEnum);\n\t\t}\n\n\n\t\t// at least one of 'left' or 'right' is an enumeration constant (EnumConstant or SideEffectConstant or ...)\n\t\t// if 'left' is not an enumeration constant, create one from the type of 'right'\n\t\tConstant EnumLiftUp (ResolveContext ec, Constant left, Constant right)\n\t\t{\n\t\t\tswitch (oper) {\n\t\t\tcase Operator.BitwiseOr:\n\t\t\tcase Operator.BitwiseAnd:\n\t\t\tcase Operator.ExclusiveOr:\n\t\t\tcase Operator.Equality:\n\t\t\tcase Operator.Inequality:\n\t\t\tcase Operator.LessThan:\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\tcase Operator.GreaterThan:\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\tif (left.Type.IsEnum)\n\t\t\t\t\treturn left;\n\t\t\t\t\n\t\t\t\tif (left.IsZeroInteger)\n\t\t\t\t\treturn left.Reduce (ec, right.Type);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase Operator.Addition:\n\t\t\tcase Operator.Subtraction:\n\t\t\t\treturn left;\n\t\t\t\t\n\t\t\tcase Operator.Multiply:\n\t\t\tcase Operator.Division:\n\t\t\tcase Operator.Modulus:\n\t\t\tcase Operator.LeftShift:\n\t\t\tcase Operator.RightShift:\n\t\t\t\tif (right.Type.IsEnum || left.Type.IsEnum)\n\t\t\t\t\tbreak;\n\t\t\t\treturn left;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// The `|' operator used on types which were extended is dangerous\n\t\t//\n\t\tvoid CheckBitwiseOrOnSignExtended (ResolveContext ec)\n\t\t{\n\t\t\tOpcodeCast lcast = left as OpcodeCast;\n\t\t\tif (lcast != null) {\n\t\t\t\tif (IsUnsigned (lcast.UnderlyingType))\n\t\t\t\t\tlcast = null;\n\t\t\t}\n\n\t\t\tOpcodeCast rcast = right as OpcodeCast;\n\t\t\tif (rcast != null) {\n\t\t\t\tif (IsUnsigned (rcast.UnderlyingType))\n\t\t\t\t\trcast = null;\n\t\t\t}\n\n\t\t\tif (lcast == null && rcast == null)\n\t\t\t\treturn;\n\n\t\t\t// FIXME: consider constants\n\n\t\t\tvar ltype = lcast != null ? lcast.UnderlyingType : rcast.UnderlyingType;\n\t\t\tec.Report.Warning (675, 3, loc,\n\t\t\t\t\"The operator `|' used on the sign-extended type `{0}'. Consider casting to a smaller unsigned type first\",\n\t\t\t\tltype.GetSignatureForError ());\n\t\t}\n\n\t\tpublic static PredefinedOperator[] CreatePointerOperatorsTable (BuiltinTypes types)\n\t\t{\n\t\t\treturn new PredefinedOperator[] {\n\t\t\t\t//\n\t\t\t\t// Pointer arithmetic:\n\t\t\t\t//\n\t\t\t\t// T* operator + (T* x, int y);\t\tT* operator - (T* x, int y);\n\t\t\t\t// T* operator + (T* x, uint y);\tT* operator - (T* x, uint y);\n\t\t\t\t// T* operator + (T* x, long y);\tT* operator - (T* x, long y);\n\t\t\t\t// T* operator + (T* x, ulong y);\tT* operator - (T* x, ulong y);\n\t\t\t\t//\n\t\t\t\tnew PredefinedPointerOperator (null, types.Int, Operator.AdditionMask | Operator.SubtractionMask),\n\t\t\t\tnew PredefinedPointerOperator (null, types.UInt, Operator.AdditionMask | Operator.SubtractionMask),\n\t\t\t\tnew PredefinedPointerOperator (null, types.Long, Operator.AdditionMask | Operator.SubtractionMask),\n\t\t\t\tnew PredefinedPointerOperator (null, types.ULong, Operator.AdditionMask | Operator.SubtractionMask),\n\n\t\t\t\t//\n\t\t\t\t// T* operator + (int y,   T* x);\n\t\t\t\t// T* operator + (uint y,  T *x);\n\t\t\t\t// T* operator + (long y,  T *x);\n\t\t\t\t// T* operator + (ulong y, T *x);\n\t\t\t\t//\n\t\t\t\tnew PredefinedPointerOperator (types.Int, null, Operator.AdditionMask, null),\n\t\t\t\tnew PredefinedPointerOperator (types.UInt, null, Operator.AdditionMask, null),\n\t\t\t\tnew PredefinedPointerOperator (types.Long, null, Operator.AdditionMask, null),\n\t\t\t\tnew PredefinedPointerOperator (types.ULong, null, Operator.AdditionMask, null),\n\n\t\t\t\t//\n\t\t\t\t// long operator - (T* x, T *y)\n\t\t\t\t//\n\t\t\t\tnew PredefinedPointerOperator (null, Operator.SubtractionMask, types.Long)\n\t\t\t};\n\t\t}\n\n\t\tpublic static PredefinedOperator[] CreateStandardOperatorsTable (BuiltinTypes types)\n\t\t{\n\t\t\tTypeSpec bool_type = types.Bool;\n\n\t\t\treturn new [] {\n\t\t\t\tnew PredefinedOperator (types.Int, Operator.ArithmeticMask | Operator.BitwiseMask | Operator.ShiftMask),\n\t\t\t\tnew PredefinedOperator (types.UInt, Operator.ArithmeticMask | Operator.BitwiseMask),\n\t\t\t\tnew PredefinedOperator (types.Long, Operator.ArithmeticMask | Operator.BitwiseMask),\n\t\t\t\tnew PredefinedOperator (types.ULong, Operator.ArithmeticMask | Operator.BitwiseMask),\n\t\t\t\tnew PredefinedOperator (types.Float, Operator.ArithmeticMask),\n\t\t\t\tnew PredefinedOperator (types.Double, Operator.ArithmeticMask),\n\t\t\t\tnew PredefinedOperator (types.Decimal, Operator.ArithmeticMask),\n\n\t\t\t\tnew PredefinedOperator (types.Int, Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.UInt, Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Long, Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.ULong, Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Float, Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Double, Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Decimal, Operator.ComparisonMask, bool_type),\n\n\t\t\t\tnew PredefinedStringOperator (types.String, Operator.AdditionMask, types.String),\n\t\t\t\t// Remaining string operators are in lifted tables\n\n\t\t\t\tnew PredefinedOperator (bool_type, Operator.BitwiseMask | Operator.LogicalMask | Operator.EqualityMask, bool_type),\n\n\t\t\t\tnew PredefinedOperator (types.UInt, types.Int, Operator.ShiftMask),\n\t\t\t\tnew PredefinedOperator (types.Long, types.Int, Operator.ShiftMask),\n\t\t\t\tnew PredefinedOperator (types.ULong, types.Int, Operator.ShiftMask)\n\t\t\t};\n\n\t\t}\n\t\tpublic static PredefinedOperator[] CreateStandardLiftedOperatorsTable (ModuleContainer module)\n\t\t{\n\t\t\tvar types = module.Compiler.BuiltinTypes;\n\n\t\t\t//\n\t\t\t// Not strictly lifted but need to be in second group otherwise expressions like\n\t\t\t// int + null would resolve to +(object, string) instead of +(int?, int?)\n\t\t\t//\n\t\t\tvar string_operators = new [] {\n\t\t\t\tnew PredefinedStringOperator (types.String, types.Object, Operator.AdditionMask, types.String),\n\t\t\t\tnew PredefinedStringOperator (types.Object, types.String, Operator.AdditionMask, types.String),\n\t\t\t};\n\n\t\t\tvar nullable = module.PredefinedTypes.Nullable.TypeSpec;\n\t\t\tif (nullable == null)\n\t\t\t\treturn string_operators;\n\n\t\t\tvar bool_type = types.Bool;\n\n\t\t\tvar nullable_bool = nullable.MakeGenericType (module, new[] { bool_type });\n\t\t\tvar nullable_int = nullable.MakeGenericType (module, new[] { types.Int });\n\t\t\tvar nullable_uint = nullable.MakeGenericType (module, new[] { types.UInt });\n\t\t\tvar nullable_long = nullable.MakeGenericType (module, new[] { types.Long });\n\t\t\tvar nullable_ulong = nullable.MakeGenericType (module, new[] { types.ULong });\n\t\t\tvar nullable_float = nullable.MakeGenericType (module, new[] { types.Float });\n\t\t\tvar nullable_double = nullable.MakeGenericType (module, new[] { types.Double });\n\t\t\tvar nullable_decimal = nullable.MakeGenericType (module, new[] { types.Decimal });\n\n\t\t\treturn new[] {\n\t\t\t\tnew PredefinedOperator (nullable_int, Operator.NullableMask | Operator.ArithmeticMask | Operator.BitwiseMask | Operator.ShiftMask),\n\t\t\t\tnew PredefinedOperator (nullable_uint, Operator.NullableMask | Operator.ArithmeticMask | Operator.BitwiseMask),\n\t\t\t\tnew PredefinedOperator (nullable_long, Operator.NullableMask | Operator.ArithmeticMask | Operator.BitwiseMask),\n\t\t\t\tnew PredefinedOperator (nullable_ulong, Operator.NullableMask | Operator.ArithmeticMask | Operator.BitwiseMask),\n\t\t\t\tnew PredefinedOperator (nullable_float, Operator.NullableMask | Operator.ArithmeticMask),\n\t\t\t\tnew PredefinedOperator (nullable_double, Operator.NullableMask | Operator.ArithmeticMask),\n\t\t\t\tnew PredefinedOperator (nullable_decimal, Operator.NullableMask | Operator.ArithmeticMask),\n\n\t\t\t\tnew PredefinedOperator (nullable_int, Operator.NullableMask | Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_uint, Operator.NullableMask | Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_long, Operator.NullableMask | Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_ulong, Operator.NullableMask | Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_float, Operator.NullableMask | Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_double, Operator.NullableMask | Operator.ComparisonMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_decimal, Operator.NullableMask | Operator.ComparisonMask, bool_type),\n\n\t\t\t\tnew PredefinedOperator (nullable_bool, Operator.NullableMask | Operator.BitwiseMask, nullable_bool),\n\n\t\t\t\tnew PredefinedOperator (nullable_uint, nullable_int, Operator.NullableMask | Operator.ShiftMask),\n\t\t\t\tnew PredefinedOperator (nullable_long, nullable_int, Operator.NullableMask | Operator.ShiftMask),\n\t\t\t\tnew PredefinedOperator (nullable_ulong, nullable_int, Operator.NullableMask | Operator.ShiftMask),\n\n\t\t\t\tstring_operators [0],\n\t\t\t\tstring_operators [1]\n\t\t\t};\n\t\t}\n\n\t\tpublic static PredefinedOperator[] CreateEqualityOperatorsTable (BuiltinTypes types)\n\t\t{\n\t\t\tTypeSpec bool_type = types.Bool;\n\n\t\t\treturn new[] {\n\t\t\t\tnew PredefinedEqualityOperator (types.String, bool_type),\n\t\t\t\tnew PredefinedEqualityOperator (types.Delegate, bool_type),\n\t\t\t\tnew PredefinedOperator (bool_type, Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Int, Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.UInt, Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Long, Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.ULong, Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Float, Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Double, Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (types.Decimal, Operator.EqualityMask, bool_type),\n\t\t\t};\n\t\t}\n\n\t\tpublic static PredefinedOperator[] CreateEqualityLiftedOperatorsTable (ModuleContainer module)\n\t\t{\n\t\t\tvar nullable = module.PredefinedTypes.Nullable.TypeSpec;\n\n\t\t\tif (nullable == null)\n\t\t\t\treturn new PredefinedOperator [0];\n\n\t\t\tvar types = module.Compiler.BuiltinTypes;\n\t\t\tvar bool_type = types.Bool;\n\t\t\tvar nullable_bool = nullable.MakeGenericType (module, new [] { bool_type });\n\t\t\tvar nullable_int = nullable.MakeGenericType (module, new[] { types.Int });\n\t\t\tvar nullable_uint = nullable.MakeGenericType (module, new[] { types.UInt });\n\t\t\tvar nullable_long = nullable.MakeGenericType (module, new[] { types.Long });\n\t\t\tvar nullable_ulong = nullable.MakeGenericType (module, new[] { types.ULong });\n\t\t\tvar nullable_float = nullable.MakeGenericType (module, new[] { types.Float });\n\t\t\tvar nullable_double = nullable.MakeGenericType (module, new[] { types.Double });\n\t\t\tvar nullable_decimal = nullable.MakeGenericType (module, new[] { types.Decimal });\n\n\t\t\treturn new [] {\n\t\t\t\tnew PredefinedOperator (nullable_bool, Operator.NullableMask | Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_int, Operator.NullableMask | Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_uint, Operator.NullableMask | Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_long, Operator.NullableMask | Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_ulong, Operator.NullableMask | Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_float, Operator.NullableMask | Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_double, Operator.NullableMask | Operator.EqualityMask, bool_type),\n\t\t\t\tnew PredefinedOperator (nullable_decimal, Operator.NullableMask | Operator.EqualityMask, bool_type)\n\t\t\t};\n\t\t}\n\n\t\t//\n\t\t// 7.2.6.2 Binary numeric promotions\n\t\t//\n\t\tbool DoBinaryOperatorPromotion (ResolveContext rc)\n\t\t{\n\t\t\tTypeSpec ltype = left.Type;\n\t\t\tif (ltype.IsNullableType) {\n\t\t\t\tltype = Nullable.NullableInfo.GetUnderlyingType (ltype);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// This is numeric promotion code only\n\t\t\t//\n\t\t\tif (ltype.BuiltinType == BuiltinTypeSpec.Type.Bool)\n\t\t\t\treturn true;\n\n\t\t\tTypeSpec rtype = right.Type;\n\t\t\tif (rtype.IsNullableType) {\n\t\t\t\trtype = Nullable.NullableInfo.GetUnderlyingType (rtype);\n\t\t\t}\n\n\t\t\tvar lb = ltype.BuiltinType;\n\t\t\tvar rb = rtype.BuiltinType;\n\t\t\tTypeSpec type;\n\t\t\tExpression expr;\n\n\t\t\tif (lb == BuiltinTypeSpec.Type.Decimal || rb == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\ttype = rc.BuiltinTypes.Decimal;\n\t\t\t} else if (lb == BuiltinTypeSpec.Type.Double || rb == BuiltinTypeSpec.Type.Double) {\n\t\t\t\ttype = rc.BuiltinTypes.Double;\n\t\t\t} else if (lb == BuiltinTypeSpec.Type.Float || rb == BuiltinTypeSpec.Type.Float) {\n\t\t\t\ttype = rc.BuiltinTypes.Float;\n\t\t\t} else if (lb == BuiltinTypeSpec.Type.ULong || rb == BuiltinTypeSpec.Type.ULong) {\n\t\t\t\ttype = rc.BuiltinTypes.ULong;\n\n\t\t\t\tif (IsSignedType (lb)) {\n\t\t\t\t\texpr = ConvertSignedConstant (left, type);\n\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tleft = expr;\n\t\t\t\t} else if (IsSignedType (rb)) {\n\t\t\t\t\texpr = ConvertSignedConstant (right, type);\n\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tright = expr;\n\t\t\t\t}\n\n\t\t\t} else if (lb == BuiltinTypeSpec.Type.Long || rb == BuiltinTypeSpec.Type.Long) {\n\t\t\t\ttype = rc.BuiltinTypes.Long;\n\t\t\t} else if (lb == BuiltinTypeSpec.Type.UInt || rb == BuiltinTypeSpec.Type.UInt) {\n\t\t\t\ttype = rc.BuiltinTypes.UInt;\n\n\t\t\t\tif (IsSignedType (lb)) {\n\t\t\t\t\texpr = ConvertSignedConstant (left, type);\n\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\ttype = rc.BuiltinTypes.Long;\n\t\t\t\t} else if (IsSignedType (rb)) {\n\t\t\t\t\texpr = ConvertSignedConstant (right, type);\n\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\ttype = rc.BuiltinTypes.Long;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttype = rc.BuiltinTypes.Int;\n\t\t\t}\n\n\t\t\tif (ltype != type) {\n\t\t\t\texpr = PromoteExpression (rc, left, type);\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tleft = expr;\n\t\t\t}\n\n\t\t\tif (rtype != type) {\n\t\t\t\texpr = PromoteExpression (rc, right, type);\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tright = expr;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic bool IsSignedType (BuiltinTypeSpec.Type type)\n\t\t{\n\t\t\tswitch (type) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tstatic Expression ConvertSignedConstant (Expression expr, TypeSpec type)\n\t\t{\n\t\t\tvar c = expr as Constant;\n\t\t\tif (c == null)\n\t\t\t\treturn null;\n\n\t\t\treturn c.ConvertImplicitly (type);\n\t\t}\n\n\t\tstatic Expression PromoteExpression (ResolveContext rc, Expression expr, TypeSpec type)\n\t\t{\n\t\t\tif (expr.Type.IsNullableType) {\n\t\t\t\treturn Convert.ImplicitConversionStandard (rc, expr,\n\t\t\t\t\trc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc, new[] { type }), expr.Location);\n\t\t\t}\n\n\t\t\tvar c = expr as Constant;\n\t\t\tif (c != null)\n\t\t\t\treturn c.ConvertImplicitly (type);\n\n\t\t\treturn Convert.ImplicitNumericConversion (expr, type);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (left == null)\n\t\t\t\treturn null;\n\n\t\t\tif ((oper == Operator.Subtraction) && (left is ParenthesizedExpression)) {\n\t\t\t\tleft = ((ParenthesizedExpression) left).Expr;\n\t\t\t\tleft = left.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.Type);\n\t\t\t\tif (left == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (left.eclass == ExprClass.Type) {\n\t\t\t\t\tec.Report.Error (75, loc, \"To cast a negative value, you must enclose the value in parentheses\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tleft = left.Resolve (ec);\n\n\t\t\tif (left == null)\n\t\t\t\treturn null;\n\n\t\t\tright = right.Resolve (ec);\n\t\t\tif (right == null)\n\t\t\t\treturn null;\n\n\t\t\tConstant lc = left as Constant;\n\t\t\tConstant rc = right as Constant;\n\n\t\t\t// The conversion rules are ignored in enum context but why\n\t\t\tif (!ec.HasSet (ResolveContext.Options.EnumScope) && lc != null && rc != null && (left.Type.IsEnum || right.Type.IsEnum)) {\n\t\t\t\tlc = EnumLiftUp (ec, lc, rc);\n\t\t\t\tif (lc != null)\n\t\t\t\t\trc = EnumLiftUp (ec, rc, lc);\n\t\t\t}\n\n\t\t\tif (rc != null && lc != null) {\n\t\t\t\tint prev_e = ec.Report.Errors;\n\t\t\t\tExpression e = ConstantFold.BinaryFold (ec, oper, lc, rc, loc);\n\t\t\t\tif (e != null || ec.Report.Errors != prev_e)\n\t\t\t\t\treturn e;\n\t\t\t}\n\n\t\t\t// Comparison warnings\n\t\t\tif ((oper & Operator.ComparisonMask) != 0) {\n\t\t\t\tif (left.Equals (right)) {\n\t\t\t\t\tec.Report.Warning (1718, 3, loc, \"A comparison made to same variable. Did you mean to compare something else?\");\n\t\t\t\t}\n\t\t\t\tCheckOutOfRangeComparison (ec, lc, right.Type);\n\t\t\t\tCheckOutOfRangeComparison (ec, rc, left.Type);\n\t\t\t}\n\n\t\t\tif (left.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic || right.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\treturn DoResolveDynamic (ec);\n\n\t\t\treturn DoResolveCore (ec, left, right);\n\t\t}\n\n\t\tExpression DoResolveDynamic (ResolveContext rc)\n\t\t{\n\t\t\tvar lt = left.Type;\n\t\t\tvar rt = right.Type;\n\t\t\tif (lt.Kind == MemberKind.Void || lt == InternalType.MethodGroup || lt == InternalType.AnonymousMethod ||\n\t\t\t\trt.Kind == MemberKind.Void || rt == InternalType.MethodGroup || rt == InternalType.AnonymousMethod) {\n\t\t\t\tError_OperatorCannotBeApplied (rc, left, right);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tArguments args;\n\n\t\t\t//\n\t\t\t// Special handling for logical boolean operators which require rhs not to be\n\t\t\t// evaluated based on lhs value\n\t\t\t//\n\t\t\tif ((oper & Operator.LogicalMask) != 0) {\n\t\t\t\tExpression cond_left, cond_right, expr;\n\n\t\t\t\targs = new Arguments (2);\n\n\t\t\t\tif (lt.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tLocalVariable temp = LocalVariable.CreateCompilerGenerated (lt, rc.CurrentBlock, loc);\n\n\t\t\t\t\tvar cond_args = new Arguments (1);\n\t\t\t\t\tcond_args.Add (new Argument (new SimpleAssign (temp.CreateReferenceExpression (rc, loc), left).Resolve (rc)));\n\n\t\t\t\t\t//\n\t\t\t\t\t// dynamic && bool => IsFalse (temp = left) ? temp : temp && right;\n\t\t\t\t\t// dynamic || bool => IsTrue (temp = left) ? temp : temp || right;\n\t\t\t\t\t//\n\t\t\t\t\tleft = temp.CreateReferenceExpression (rc, loc);\n\t\t\t\t\tif (oper == Operator.LogicalAnd) {\n\t\t\t\t\t\texpr = DynamicUnaryConversion.CreateIsFalse (rc, cond_args, loc);\n\t\t\t\t\t\tcond_left = left;\n\t\t\t\t\t} else {\n\t\t\t\t\t\texpr = DynamicUnaryConversion.CreateIsTrue (rc, cond_args, loc);\n\t\t\t\t\t\tcond_left = left;\n\t\t\t\t\t}\n\n\t\t\t\t\targs.Add (new Argument (left));\n\t\t\t\t\targs.Add (new Argument (right));\n\t\t\t\t\tcond_right = new DynamicExpressionStatement (this, args, loc);\n\t\t\t\t} else {\n\t\t\t\t\tLocalVariable temp = LocalVariable.CreateCompilerGenerated (rc.BuiltinTypes.Bool, rc.CurrentBlock, loc);\n\n\t\t\t\t\tif (!Convert.ImplicitConversionExists (rc, left, temp.Type) && (oper == Operator.LogicalAnd ? GetOperatorFalse (rc, left, loc) : GetOperatorTrue (rc, left, loc)) == null) {\n\t\t\t\t\t\trc.Report.Error (7083, left.Location,\n\t\t\t\t\t\t\t\"Expression must be implicitly convertible to Boolean or its type `{0}' must define operator `{1}'\",\n\t\t\t\t\t\t\tlt.GetSignatureForError (), oper == Operator.LogicalAnd ? \"false\" : \"true\");\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\targs.Add (new Argument (temp.CreateReferenceExpression (rc, loc).Resolve (rc)));\n\t\t\t\t\targs.Add (new Argument (right));\n\t\t\t\t\tright = new DynamicExpressionStatement (this, args, loc);\n\n\t\t\t\t\t//\n\t\t\t\t\t// bool && dynamic => (temp = left) ? temp && right : temp;\n\t\t\t\t\t// bool || dynamic => (temp = left) ? temp : temp || right;\n\t\t\t\t\t//\n\t\t\t\t\tif (oper == Operator.LogicalAnd) {\n\t\t\t\t\t\tcond_left = right;\n\t\t\t\t\t\tcond_right = temp.CreateReferenceExpression (rc, loc);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcond_left = temp.CreateReferenceExpression (rc, loc);\n\t\t\t\t\t\tcond_right = right;\n\t\t\t\t\t}\n\n\t\t\t\t\texpr = new BooleanExpression (new SimpleAssign (temp.CreateReferenceExpression (rc, loc), left));\n\t\t\t\t}\n\n\t\t\t\treturn new Conditional (expr, cond_left, cond_right, loc).Resolve (rc);\n\t\t\t}\n\n\t\t\targs = new Arguments (2);\n\t\t\targs.Add (new Argument (left));\n\t\t\targs.Add (new Argument (right));\n\t\t\treturn new DynamicExpressionStatement (this, args, loc).Resolve (rc);\n\t\t}\n\n\t\tExpression DoResolveCore (ResolveContext ec, Expression left_orig, Expression right_orig)\n\t\t{\n\t\t\tExpression expr = ResolveOperator (ec);\n\t\t\tif (expr == null)\n\t\t\t\tError_OperatorCannotBeApplied (ec, left_orig, right_orig);\n\n\t\t\tif (left == null || right == null)\n\t\t\t\tthrow new InternalErrorException (\"Invalid conversion\");\n\n\t\t\tif (oper == Operator.BitwiseOr)\n\t\t\t\tCheckBitwiseOrOnSignExtended (ec);\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn MakeExpression (ctx, left, right);\n\t\t}\n\n\t\tpublic SLE.Expression MakeExpression (BuilderContext ctx, Expression left, Expression right)\n\t\t{\n\t\t\tvar le = left.MakeExpression (ctx);\n\t\t\tvar re = right.MakeExpression (ctx);\n\t\t\tbool is_checked = ctx.HasSet (BuilderContext.Options.CheckedScope);\n\n\t\t\tswitch (oper) {\n\t\t\tcase Operator.Addition:\n\t\t\t\treturn is_checked ? SLE.Expression.AddChecked (le, re) : SLE.Expression.Add (le, re);\n\t\t\tcase Operator.BitwiseAnd:\n\t\t\t\treturn SLE.Expression.And (le, re);\n\t\t\tcase Operator.BitwiseOr:\n\t\t\t\treturn SLE.Expression.Or (le, re);\n\t\t\tcase Operator.Division:\n\t\t\t\treturn SLE.Expression.Divide (le, re);\n\t\t\tcase Operator.Equality:\n\t\t\t\treturn SLE.Expression.Equal (le, re);\n\t\t\tcase Operator.ExclusiveOr:\n\t\t\t\treturn SLE.Expression.ExclusiveOr (le, re);\n\t\t\tcase Operator.GreaterThan:\n\t\t\t\treturn SLE.Expression.GreaterThan (le, re);\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\treturn SLE.Expression.GreaterThanOrEqual (le, re);\n\t\t\tcase Operator.Inequality:\n\t\t\t\treturn SLE.Expression.NotEqual (le, re);\n\t\t\tcase Operator.LeftShift:\n\t\t\t\treturn SLE.Expression.LeftShift (le, re);\n\t\t\tcase Operator.LessThan:\n\t\t\t\treturn SLE.Expression.LessThan (le, re);\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\t\treturn SLE.Expression.LessThanOrEqual (le, re);\n\t\t\tcase Operator.LogicalAnd:\n\t\t\t\treturn SLE.Expression.AndAlso (le, re);\n\t\t\tcase Operator.LogicalOr:\n\t\t\t\treturn SLE.Expression.OrElse (le, re);\n\t\t\tcase Operator.Modulus:\n\t\t\t\treturn SLE.Expression.Modulo (le, re);\n\t\t\tcase Operator.Multiply:\n\t\t\t\treturn is_checked ? SLE.Expression.MultiplyChecked (le, re) : SLE.Expression.Multiply (le, re);\n\t\t\tcase Operator.RightShift:\n\t\t\t\treturn SLE.Expression.RightShift (le, re);\n\t\t\tcase Operator.Subtraction:\n\t\t\t\treturn is_checked ? SLE.Expression.SubtractChecked (le, re) : SLE.Expression.Subtract (le, re);\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (oper.ToString ());\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// D operator + (D x, D y)\n\t\t// D operator - (D x, D y)\n\t\t//\n\t\tExpression ResolveOperatorDelegate (ResolveContext ec, TypeSpec l, TypeSpec r)\n\t\t{\n\t\t\tif (l != r && !TypeSpecComparer.Variant.IsEqual (r, l)) {\n\t\t\t\tExpression tmp;\n\t\t\t\tif (right.eclass == ExprClass.MethodGroup || r == InternalType.AnonymousMethod || r == InternalType.NullLiteral) {\n\t\t\t\t\ttmp = Convert.ImplicitConversionRequired (ec, right, l, loc);\n\t\t\t\t\tif (tmp == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tright = tmp;\n\t\t\t\t\tr = right.Type;\n\t\t\t\t} else if (left.eclass == ExprClass.MethodGroup || (l == InternalType.AnonymousMethod || l == InternalType.NullLiteral)) {\n\t\t\t\t\ttmp = Convert.ImplicitConversionRequired (ec, left, r, loc);\n\t\t\t\t\tif (tmp == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tleft = tmp;\n\t\t\t\t\tl = left.Type;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tMethodSpec method = null;\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (left));\n\t\t\targs.Add (new Argument (right));\n\n\t\t\tif (oper == Operator.Addition) {\n\t\t\t\tmethod = ec.Module.PredefinedMembers.DelegateCombine.Resolve (loc);\n\t\t\t} else if (oper == Operator.Subtraction) {\n\t\t\t\tmethod = ec.Module.PredefinedMembers.DelegateRemove.Resolve (loc);\n\t\t\t}\n\n\t\t\tif (method == null)\n\t\t\t\treturn new EmptyExpression (ec.BuiltinTypes.Decimal);\n\n\t\t\tExpression expr = new UserOperatorCall (method, args, CreateExpressionTree, loc);\n\t\t\treturn new ClassCast (expr, l);\n\t\t}\n\n\t\t//\n\t\t// Resolves enumeration operators where only single predefined overload exists, handles lifted versions too\n\t\t//\n\t\tExpression ResolveSingleEnumOperators (ResolveContext rc, bool lenum, bool renum, TypeSpec ltype, TypeSpec rtype)\n\t\t{\n\t\t\t//\n\t\t\t// bool operator == (E x, E y);\n\t\t\t// bool operator != (E x, E y);\n\t\t\t// bool operator < (E x, E y);\n\t\t\t// bool operator > (E x, E y);\n\t\t\t// bool operator <= (E x, E y);\n\t\t\t// bool operator >= (E x, E y);\n\t\t\t//\n\t\t\t// E operator & (E x, E y);\n\t\t\t// E operator | (E x, E y);\n\t\t\t// E operator ^ (E x, E y);\n\t\t\t//\n\t\t\tExpression expr;\n\t\t\tif ((oper & Operator.ComparisonMask) != 0) {\n\t\t\t\ttype = rc.BuiltinTypes.Bool;\n\t\t\t} else {\n\t\t\t\tif (lenum)\n\t\t\t\t\ttype = ltype;\n\t\t\t\telse if (renum)\n\t\t\t\t\ttype = rtype;\n\t\t\t\telse if (ltype.IsNullableType && Nullable.NullableInfo.GetUnderlyingType (ltype).IsEnum)\n\t\t\t\t\ttype = ltype;\n\t\t\t\telse\n\t\t\t\t\ttype = rtype;\n\t\t\t}\n\n\t\t\tif (ltype == rtype) {\n\t\t\t\tif (lenum || renum)\n\t\t\t\t\treturn this;\n\n\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (this);\n\t\t\t\tlifted.Left = left;\n\t\t\t\tlifted.Right = right;\n\t\t\t\treturn lifted.Resolve (rc);\n\t\t\t}\n\n\t\t\tif (renum && !ltype.IsNullableType) {\n\t\t\t\texpr = Convert.ImplicitConversion (rc, left, rtype, loc);\n\t\t\t\tif (expr != null) {\n\t\t\t\t\tleft = expr;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t} else if (lenum && !rtype.IsNullableType) {\n\t\t\t\texpr = Convert.ImplicitConversion (rc, right, ltype, loc);\n\t\t\t\tif (expr != null) {\n\t\t\t\t\tright = expr;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Now try lifted version of predefined operator\n\t\t\t//\n\t\t\tvar nullable_type = rc.Module.PredefinedTypes.Nullable.TypeSpec;\n\t\t\tif (nullable_type != null) {\n\t\t\t\tif (renum && !ltype.IsNullableType) {\n\t\t\t\t\tvar lifted_type = nullable_type.MakeGenericType (rc.Module, new[] { rtype });\n\n\t\t\t\t\texpr = Convert.ImplicitConversion (rc, left, lifted_type, loc);\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tleft = expr;\n\t\t\t\t\t\tright = Convert.ImplicitConversion (rc, right, lifted_type, loc);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((oper & Operator.BitwiseMask) != 0)\n\t\t\t\t\t\ttype = lifted_type;\n\n\t\t\t\t\tif (left.IsNull) {\n\t\t\t\t\t\tif ((oper & Operator.BitwiseMask) != 0)\n\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, this);\n\n\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, rtype);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (this);\n\t\t\t\t\t\tlifted.Left = expr;\n\t\t\t\t\t\tlifted.Right = right;\n\t\t\t\t\t\treturn lifted.Resolve (rc);\n\t\t\t\t\t}\n\t\t\t\t} else if (lenum && !rtype.IsNullableType) {\n\t\t\t\t\tvar lifted_type = nullable_type.MakeGenericType (rc.Module, new[] { ltype });\n\n\t\t\t\t\texpr = Convert.ImplicitConversion (rc, right, lifted_type, loc);\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tright = expr;\n\t\t\t\t\t\tleft = Convert.ImplicitConversion (rc, left, lifted_type, loc);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((oper & Operator.BitwiseMask) != 0)\n\t\t\t\t\t\ttype = lifted_type;\n\n\t\t\t\t\tif (right.IsNull) {\n\t\t\t\t\t\tif ((oper & Operator.BitwiseMask) != 0)\n\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, this);\n\n\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, ltype);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (this);\n\t\t\t\t\t\tlifted.Left = left;\n\t\t\t\t\t\tlifted.Right = expr;\n\t\t\t\t\t\treturn lifted.Resolve (rc);\n\t\t\t\t\t}\n\t\t\t\t} else if (rtype.IsNullableType && Nullable.NullableInfo.GetUnderlyingType (rtype).IsEnum) {\n\t\t\t\t\tNullable.Unwrap unwrap = null;\n\t\t\t\t\tif (left.IsNull || right.IsNull) {\n\t\t\t\t\t\tif (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))\n\t\t\t\t\t\t\tleft = Convert.ImplicitConversion (rc, left, rtype, left.Location);\n\n\t\t\t\t\t\tif ((oper & Operator.RelationalMask) != 0)\n\t\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, rtype);\n\n\t\t\t\t\t\tif ((oper & Operator.BitwiseMask) != 0)\n\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, this);\n\n\t\t\t\t\t\tif (right.IsNull)\n\t\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, left.Type);\n\n\t\t\t\t\t\t// Equality operators are valid between E? and null\n\t\t\t\t\t\texpr = left;\n\t\t\t\t\t\tunwrap = new Nullable.Unwrap (right);\n\t\t\t\t\t} else {\n\t\t\t\t\t\texpr = Convert.ImplicitConversion (rc, left, Nullable.NullableInfo.GetUnderlyingType (rtype), loc);\n\t\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (this);\n\t\t\t\t\t\tlifted.Left = expr;\n\t\t\t\t\t\tlifted.Right = right;\n\t\t\t\t\t\tlifted.UnwrapRight = unwrap;\n\t\t\t\t\t\treturn lifted.Resolve (rc);\n\t\t\t\t\t}\n\t\t\t\t} else if (ltype.IsNullableType && Nullable.NullableInfo.GetUnderlyingType (ltype).IsEnum) {\n\t\t\t\t\tNullable.Unwrap unwrap = null;\n\t\t\t\t\tif (right.IsNull || left.IsNull) {\n\t\t\t\t\t\tif (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))\n\t\t\t\t\t\t\tright = Convert.ImplicitConversion (rc, right, ltype, right.Location);\n\n\t\t\t\t\t\tif ((oper & Operator.RelationalMask) != 0)\n\t\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, ltype);\n\n\t\t\t\t\t\tif ((oper & Operator.BitwiseMask) != 0)\n\t\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, this);\n\n\t\t\t\t\t\tif (left.IsNull)\n\t\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, right.Type);\n\n\t\t\t\t\t\t// Equality operators are valid between E? and null\n\t\t\t\t\t\texpr = right;\n\t\t\t\t\t\tunwrap = new Nullable.Unwrap (left);\n\t\t\t\t\t} else {\n\t\t\t\t\t\texpr = Convert.ImplicitConversion (rc, right, Nullable.NullableInfo.GetUnderlyingType (ltype), loc);\n\t\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (this);\n\t\t\t\t\t\tlifted.Left = left;\n\t\t\t\t\t\tlifted.UnwrapLeft = unwrap;\n\t\t\t\t\t\tlifted.Right = expr;\n\t\t\t\t\t\treturn lifted.Resolve (rc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic Expression ConvertEnumOperandToUnderlyingType (ResolveContext rc, Expression expr, bool liftType)\n\t\t{\n\t\t\tTypeSpec underlying_type;\n\t\t\tif (expr.Type.IsNullableType) {\n\t\t\t\tvar nt = Nullable.NullableInfo.GetUnderlyingType (expr.Type);\n\t\t\t\tif (nt.IsEnum)\n\t\t\t\t\tunderlying_type = EnumSpec.GetUnderlyingType (nt);\n\t\t\t\telse\n\t\t\t\t\tunderlying_type = nt;\n\t\t\t} else if (expr.Type.IsEnum) {\n\t\t\t\tunderlying_type = EnumSpec.GetUnderlyingType (expr.Type);\n\t\t\t} else {\n\t\t\t\tunderlying_type = expr.Type;\n\t\t\t}\n\n\t\t\tswitch (underlying_type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tunderlying_type = rc.BuiltinTypes.Int;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (expr.Type.IsNullableType || liftType)\n\t\t\t\tunderlying_type = rc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc.Module, new[] { underlying_type });\n\n\t\t\tif (expr.Type == underlying_type)\n\t\t\t\treturn expr;\n\n\t\t\treturn EmptyCast.Create (expr, underlying_type);\n\t\t}\n\n\t\tExpression ResolveEnumOperators (ResolveContext rc, bool lenum, bool renum, TypeSpec ltype, TypeSpec rtype)\n\t\t{\n\t\t\t//\n\t\t\t// U operator - (E e, E f)\n\t\t\t// E operator - (E e, U x)  // Internal decomposition operator\n\t\t\t// E operator - (U x, E e)\t// Internal decomposition operator\n\t\t\t//\n\t\t\t// E operator + (E e, U x)\n\t\t\t// E operator + (U x, E e)\n\t\t\t//\n\n\t\t\tTypeSpec enum_type;\n\n\t\t\tif (lenum)\n\t\t\t\tenum_type = ltype;\n\t\t\telse if (renum)\n\t\t\t\tenum_type = rtype;\n\t\t\telse if (ltype.IsNullableType && Nullable.NullableInfo.GetUnderlyingType (ltype).IsEnum)\n\t\t\t\tenum_type = ltype;\n\t\t\telse\n\t\t\t\tenum_type = rtype;\n\n\t\t\tExpression expr;\n\t\t\tif (!enum_type.IsNullableType) {\n\t\t\t\texpr = ResolveOperatorPredefined (rc, rc.Module.GetPredefinedEnumAritmeticOperators (enum_type, false), false);\n\t\t\t\tif (expr != null) {\n\t\t\t\t\tif (oper == Operator.Subtraction)\n\t\t\t\t\t\texpr = ConvertEnumSubtractionResult (rc, expr);\n\t\t\t\t\telse\n\t\t\t\t\t\texpr = ConvertEnumAdditionalResult (expr, enum_type);\n\n\t\t\t\t\tenum_conversion = GetEnumResultCast (expr.Type);\n\n\t\t\t\t\treturn expr;\n\t\t\t\t}\n\n\t\t\t\tenum_type = rc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc.Module, new[] { enum_type });\n\t\t\t}\n\n\t\t\texpr = ResolveOperatorPredefined (rc, rc.Module.GetPredefinedEnumAritmeticOperators (enum_type, true), false);\n\t\t\tif (expr != null) {\n\t\t\t\tif (oper == Operator.Subtraction)\n\t\t\t\t\texpr = ConvertEnumSubtractionResult (rc, expr);\n\t\t\t\telse\n\t\t\t\t\texpr = ConvertEnumAdditionalResult (expr, enum_type);\n\n\t\t\t\tenum_conversion = GetEnumResultCast (expr.Type);\n\t\t\t}\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tstatic Expression ConvertEnumAdditionalResult (Expression expr, TypeSpec enumType)\n\t\t{\n\t\t\treturn EmptyCast.Create (expr, enumType);\n\t\t}\n\n\t\tExpression ConvertEnumSubtractionResult (ResolveContext rc, Expression expr)\n\t\t{\n\t\t\t//\n\t\t\t// Enumeration subtraction has different result type based on\n\t\t\t// best overload\n\t\t\t//\n\t\t\tTypeSpec result_type;\n\t\t\tif (left.Type == right.Type) {\n\t\t\t\tvar c = right as EnumConstant;\n\t\t\t\tif (c != null && c.IsZeroInteger && !right.Type.IsEnum) {\n\t\t\t\t\t//\n\t\t\t\t\t// LAMESPEC: This is quite unexpected for expression E - 0 the return type is\n\t\t\t\t\t// E which is not what expressions E - 1 or 0 - E return\n\t\t\t\t\t//\n\t\t\t\t\tresult_type = left.Type;\n\t\t\t\t} else {\n\t\t\t\t\tresult_type = left.Type.IsNullableType ?\n\t\t\t\t\t\tNullable.NullableInfo.GetEnumUnderlyingType (rc.Module, left.Type) :\n\t\t\t\t\t\tEnumSpec.GetUnderlyingType (left.Type);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (IsEnumOrNullableEnum (left.Type)) {\n\t\t\t\t\tresult_type = left.Type;\n\t\t\t\t} else {\n\t\t\t\t\tresult_type = right.Type;\n\t\t\t\t}\n\n\t\t\t\tif (expr is Nullable.LiftedBinaryOperator && !result_type.IsNullableType)\n\t\t\t\t\tresult_type = rc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc.Module, new[] { result_type });\n\t\t\t}\n\n\t\t\treturn EmptyCast.Create (expr, result_type);\n\t\t}\n\n\t\tpublic static ConvCast.Mode GetEnumResultCast (TypeSpec type)\n\t\t{\n\t\t\tif (type.IsNullableType)\n\t\t\t\ttype = Nullable.NullableInfo.GetUnderlyingType (type);\n\n\t\t\tif (type.IsEnum)\n\t\t\t\ttype = EnumSpec.GetUnderlyingType (type);\n\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\treturn ConvCast.Mode.I4_I1;\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\treturn ConvCast.Mode.I4_U1;\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\treturn ConvCast.Mode.I4_I2;\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\treturn ConvCast.Mode.I4_U2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t//\n\t\t// Equality operators rules\n\t\t//\n\t\tExpression ResolveEquality (ResolveContext ec, TypeSpec l, TypeSpec r, bool primitives_only)\n\t\t{\n\t\t\tExpression result;\n\t\t\ttype = ec.BuiltinTypes.Bool;\n\t\t\tbool no_arg_conv = false;\n\n\t\t\tif (!primitives_only) {\n\n\t\t\t\t//\n\t\t\t\t// a, Both operands are reference-type values or the value null\n\t\t\t\t// b, One operand is a value of type T where T is a type-parameter and\n\t\t\t\t// the other operand is the value null. Furthermore T does not have the\n\t\t\t\t// value type constraint\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: Very confusing details in the specification, basically any\n\t\t\t\t// reference like type-parameter is allowed\n\t\t\t\t//\n\t\t\t\tvar tparam_l = l as TypeParameterSpec;\n\t\t\t\tvar tparam_r = r as TypeParameterSpec;\n\t\t\t\tif (tparam_l != null) {\n\t\t\t\t\tif (right is NullLiteral) {\n\t\t\t\t\t\tif (tparam_l.GetEffectiveBase ().BuiltinType == BuiltinTypeSpec.Type.ValueType)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tleft = new BoxedCast (left, ec.BuiltinTypes.Object);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!tparam_l.IsReferenceType)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tl = tparam_l.GetEffectiveBase ();\n\t\t\t\t\tleft = new BoxedCast (left, l);\n\t\t\t\t} else if (left is NullLiteral && tparam_r == null) {\n\t\t\t\t\tif (TypeSpec.IsReferenceType (r))\n\t\t\t\t\t\treturn this;\n\n\t\t\t\t\tif (r.Kind == MemberKind.InternalCompilerType)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (tparam_r != null) {\n\t\t\t\t\tif (left is NullLiteral) {\n\t\t\t\t\t\tif (tparam_r.GetEffectiveBase ().BuiltinType == BuiltinTypeSpec.Type.ValueType)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tright = new BoxedCast (right, ec.BuiltinTypes.Object);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!tparam_r.IsReferenceType)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tr = tparam_r.GetEffectiveBase ();\n\t\t\t\t\tright = new BoxedCast (right, r);\n\t\t\t\t} else if (right is NullLiteral) {\n\t\t\t\t\tif (TypeSpec.IsReferenceType (l))\n\t\t\t\t\t\treturn this;\n\n\t\t\t\t\tif (l.Kind == MemberKind.InternalCompilerType)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: method groups can be compared when they convert to other side delegate\n\t\t\t\t//\n\t\t\t\tif (l.IsDelegate) {\n\t\t\t\t\tif (right.eclass == ExprClass.MethodGroup) {\n\t\t\t\t\t\tresult = Convert.ImplicitConversion (ec, right, l, loc);\n\t\t\t\t\t\tif (result == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tright = result;\n\t\t\t\t\t\tr = l;\n\t\t\t\t\t} else if (r.IsDelegate && l != r) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t} else if (left.eclass == ExprClass.MethodGroup && r.IsDelegate) {\n\t\t\t\t\tresult = Convert.ImplicitConversionRequired (ec, left, r, loc);\n\t\t\t\t\tif (result == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tleft = result;\n\t\t\t\t\tl = r;\n\t\t\t\t} else {\n\t\t\t\t\tno_arg_conv = l == r && !l.IsStruct;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// bool operator != (string a, string b)\n\t\t\t// bool operator == (string a, string b)\n\t\t\t//\n\t\t\t// bool operator != (Delegate a, Delegate b)\n\t\t\t// bool operator == (Delegate a, Delegate b)\n\t\t\t//\n\t\t\t// bool operator != (bool a, bool b)\n\t\t\t// bool operator == (bool a, bool b)\n\t\t\t//\n\t\t\t// LAMESPEC: Reference equality comparison can apply to value/reference types when\n\t\t\t// they implement an implicit conversion to any of types above. This does\n\t\t\t// not apply when both operands are of same reference type\n\t\t\t//\n\t\t\tif (r.BuiltinType != BuiltinTypeSpec.Type.Object && l.BuiltinType != BuiltinTypeSpec.Type.Object) {\n\t\t\t\tresult = ResolveOperatorPredefined (ec, ec.BuiltinTypes.OperatorsBinaryEquality, no_arg_conv);\t\n\t\t\t\tif (result != null)\n\t\t\t\t\treturn result;\n\n\t\t\t\t//\n\t\t\t\t// Now try lifted version of predefined operators\n\t\t\t\t//\n\t\t\t\tif (no_arg_conv && !l.IsNullableType) {\n\t\t\t\t\t//\n\t\t\t\t\t// Optimizes cases which won't match\n\t\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\tresult = ResolveOperatorPredefined (ec, ec.Module.OperatorsBinaryEqualityLifted, no_arg_conv);\n\t\t\t\t\tif (result != null)\n\t\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// The == and != operators permit one operand to be a value of a nullable\n\t\t\t\t// type and the other to be the null literal, even if no predefined or user-defined\n\t\t\t\t// operator (in unlifted or lifted form) exists for the operation.\n\t\t\t\t//\n\t\t\t\tif ((l.IsNullableType && right.IsNull) || (r.IsNullableType && left.IsNull)) {\n\t\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (this);\n\t\t\t\t\tlifted.Left = left;\n\t\t\t\t\tlifted.Right = right;\n\t\t\t\t\treturn lifted.Resolve (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// bool operator != (object a, object b)\n\t\t\t// bool operator == (object a, object b)\n\t\t\t//\n\t\t\t// An explicit reference conversion exists from the\n\t\t\t// type of either operand to the type of the other operand.\n\t\t\t//\n\n\t\t\t// Optimize common path\n\t\t\tif (l == r) {\n\t\t\t\treturn l.Kind == MemberKind.InternalCompilerType || l.Kind == MemberKind.Struct ? null : this;\n\t\t\t}\n\n\t\t\tif (!Convert.ExplicitReferenceConversionExists (l, r) &&\n\t\t\t\t!Convert.ExplicitReferenceConversionExists (r, l))\n\t\t\t\treturn null;\n\n\t\t\t// Reject allowed explicit conversions like int->object\n\t\t\tif (!TypeSpec.IsReferenceType (l) || !TypeSpec.IsReferenceType (r))\n\t\t\t\treturn null;\n\n\t\t\tif (l.BuiltinType == BuiltinTypeSpec.Type.String || l.BuiltinType == BuiltinTypeSpec.Type.Delegate || l.IsDelegate || MemberCache.GetUserOperator (l, CSharp.Operator.OpType.Equality, false) != null)\n\t\t\t\tec.Report.Warning (253, 2, loc,\n\t\t\t\t\t\"Possible unintended reference comparison. Consider casting the right side expression to type `{0}' to get value comparison\",\n\t\t\t\t\tl.GetSignatureForError ());\n\n\t\t\tif (r.BuiltinType == BuiltinTypeSpec.Type.String || r.BuiltinType == BuiltinTypeSpec.Type.Delegate || r.IsDelegate || MemberCache.GetUserOperator (r, CSharp.Operator.OpType.Equality, false) != null)\n\t\t\t\tec.Report.Warning (252, 2, loc,\n\t\t\t\t\t\"Possible unintended reference comparison. Consider casting the left side expression to type `{0}' to get value comparison\",\n\t\t\t\t\tr.GetSignatureForError ());\n\n\t\t\treturn this;\n\t\t}\n\n\n\t\tExpression ResolveOperatorPointer (ResolveContext ec, TypeSpec l, TypeSpec r)\n\t\t{\n\t\t\t//\n\t\t\t// bool operator == (void* x, void* y);\n\t\t\t// bool operator != (void* x, void* y);\n\t\t\t// bool operator < (void* x, void* y);\n\t\t\t// bool operator > (void* x, void* y);\n\t\t\t// bool operator <= (void* x, void* y);\n\t\t\t// bool operator >= (void* x, void* y);\n\t\t\t//\n\t\t\tif ((oper & Operator.ComparisonMask) != 0) {\n\t\t\t\tExpression temp;\n\t\t\t\tif (!l.IsPointer) {\n\t\t\t\t\ttemp = Convert.ImplicitConversion (ec, left, r, left.Location);\n\t\t\t\t\tif (temp == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tleft = temp;\n\t\t\t\t}\n\n\t\t\t\tif (!r.IsPointer) {\n\t\t\t\t\ttemp = Convert.ImplicitConversion (ec, right, l, right.Location);\n\t\t\t\t\tif (temp == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tright = temp;\n\t\t\t\t}\n\n\t\t\t\ttype = ec.BuiltinTypes.Bool;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn ResolveOperatorPredefined (ec, ec.BuiltinTypes.OperatorsBinaryUnsafe, false);\n\t\t}\n\n\t\t//\n\t\t// Build-in operators method overloading\n\t\t//\n\t\tExpression ResolveOperatorPredefined (ResolveContext ec, PredefinedOperator [] operators, bool primitives_only)\n\t\t{\n\t\t\tPredefinedOperator best_operator = null;\n\t\t\tTypeSpec l = left.Type;\n\t\t\tTypeSpec r = right.Type;\n\t\t\tOperator oper_mask = oper & ~Operator.ValuesOnlyMask;\n\n\t\t\tforeach (PredefinedOperator po in operators) {\n\t\t\t\tif ((po.OperatorsMask & oper_mask) == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (primitives_only) {\n\t\t\t\t\tif (!po.IsPrimitiveApplicable (l, r))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tif (!po.IsApplicable (ec, left, right))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (best_operator == null) {\n\t\t\t\t\tbest_operator = po;\n\t\t\t\t\tif (primitives_only)\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbest_operator = po.ResolveBetterOperator (ec, best_operator);\n\n\t\t\t\tif (best_operator == null) {\n\t\t\t\t\tec.Report.Error (34, loc, \"Operator `{0}' is ambiguous on operands of type `{1}' and `{2}'\",\n\t\t\t\t\t\tOperName (oper), l.GetSignatureForError (), r.GetSignatureForError ());\n\n\t\t\t\t\tbest_operator = po;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (best_operator == null)\n\t\t\t\treturn null;\n\n\t\t\treturn best_operator.ConvertResult (ec, this);\n\t\t}\n\n\t\t//\n\t\t// Optimize & constant expressions with 0 value\n\t\t//\n\t\tExpression OptimizeAndOperation (Expression expr)\n\t\t{\n\t\t\tConstant rc = right as Constant;\n\t\t\tConstant lc = left as Constant;\n\t\t\tif ((lc != null && lc.IsDefaultValue) || (rc != null && rc.IsDefaultValue)) {\n\t\t\t\t//\n\t\t\t\t// The result is a constant with side-effect\n\t\t\t\t//\n\t\t\t\tConstant side_effect = rc == null ?\n\t\t\t\t\tnew SideEffectConstant (lc, right, loc) :\n\t\t\t\t\tnew SideEffectConstant (rc, left, loc);\n\n\t\t\t\treturn ReducedExpression.Create (side_effect, expr);\n\t\t\t}\n\n\t\t\treturn expr;\n\t\t}\n\n\t\t//\n\t\t// Value types can be compared with the null literal because of the lifting\n\t\t// language rules. However the result is always true or false.\n\t\t//\n\t\tpublic Expression CreateLiftedValueTypeResult (ResolveContext rc, TypeSpec valueType)\n\t\t{\n\t\t\tif (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion)) {\n\t\t\t\ttype = rc.BuiltinTypes.Bool;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\t// FIXME: Handle side effect constants\n\t\t\tConstant c = new BoolConstant (rc.BuiltinTypes, Oper == Operator.Inequality, loc);\n\n\t\t\tif ((Oper & Operator.EqualityMask) != 0) {\n\t\t\t\trc.Report.Warning (472, 2, loc, \"The result of comparing value type `{0}' with null is always `{1}'\",\n\t\t\t\t\tvalueType.GetSignatureForError (), c.GetValueAsLiteral ());\n\t\t\t} else {\n\t\t\t\trc.Report.Warning (464, 2, loc, \"The result of comparing type `{0}' with null is always `{1}'\",\n\t\t\t\t\tvalueType.GetSignatureForError (), c.GetValueAsLiteral ());\n\t\t\t}\n\n\t\t\treturn c;\n\t\t}\n\n\t\t//\n\t\t// Performs user-operator overloading\n\t\t//\n\t\tExpression ResolveUserOperator (ResolveContext rc, Expression left, Expression right)\n\t\t{\n\t\t\tExpression oper_expr;\n\n\t\t\tvar op = ConvertBinaryToUserOperator (oper);\n\t\t\tvar l = left.Type;\n\t\t\tif (l.IsNullableType)\n\t\t\t\tl = Nullable.NullableInfo.GetUnderlyingType (l);\n\t\t\tvar r = right.Type;\n\t\t\tif (r.IsNullableType)\n\t\t\t\tr = Nullable.NullableInfo.GetUnderlyingType (r);\n\n\t\t\tIList<MemberSpec> left_operators = MemberCache.GetUserOperator (l, op, false);\n\t\t\tIList<MemberSpec> right_operators = null;\n\n\t\t\tif (l != r) {\n\t\t\t\tright_operators = MemberCache.GetUserOperator (r, op, false);\n\t\t\t\tif (right_operators == null && left_operators == null)\n\t\t\t\t\treturn null;\n\t\t\t} else if (left_operators == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tArguments args = new Arguments (2);\n\t\t\tArgument larg = new Argument (left);\n\t\t\targs.Add (larg);\t\n\t\t\tArgument rarg = new Argument (right);\n\t\t\targs.Add (rarg);\n\n\t\t\t//\n\t\t\t// User-defined operator implementations always take precedence\n\t\t\t// over predefined operator implementations\n\t\t\t//\n\t\t\tif (left_operators != null && right_operators != null) {\n\t\t\t\tleft_operators = CombineUserOperators (left_operators, right_operators);\n\t\t\t} else if (right_operators != null) {\n\t\t\t\tleft_operators = right_operators;\n\t\t\t}\n\n\t\t\tconst OverloadResolver.Restrictions restr = OverloadResolver.Restrictions.ProbingOnly |\n\t\t\t\tOverloadResolver.Restrictions.NoBaseMembers | OverloadResolver.Restrictions.BaseMembersIncluded;\n\n\t\t\tvar res = new OverloadResolver (left_operators, restr, loc);\n\n\t\t\tvar oper_method = res.ResolveOperator (rc, ref args);\n\t\t\tif (oper_method == null) {\n\t\t\t\t//\n\t\t\t\t// Logical && and || cannot be lifted\n\t\t\t\t//\n\t\t\t\tif ((oper & Operator.LogicalMask) != 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\t//\n\t\t\t\t// Apply lifted user operators only for liftable types. Implicit conversion\n\t\t\t\t// to nullable types is not allowed\n\t\t\t\t//\n\t\t\t\tif (!IsLiftedOperatorApplicable ())\n\t\t\t\t\treturn null;\n\n\t\t\t\t// TODO: Cache the result in module container\n\t\t\t\tvar lifted_methods = CreateLiftedOperators (rc, left_operators);\n\t\t\t\tif (lifted_methods == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tres = new OverloadResolver (lifted_methods, restr | OverloadResolver.Restrictions.ProbingOnly, loc);\n\n\t\t\t\toper_method = res.ResolveOperator (rc, ref args);\n\t\t\t\tif (oper_method == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tMethodSpec best_original = null;\n\t\t\t\tforeach (MethodSpec ms in left_operators) {\n\t\t\t\t\tif (ms.MemberDefinition == oper_method.MemberDefinition) {\n\t\t\t\t\t\tbest_original = ms;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion)) {\n\t\t\t\t\t//\n\t\t\t\t\t// Expression trees use lifted notation in this case\n\t\t\t\t\t//\n\t\t\t\t\tthis.left = Convert.ImplicitConversion (rc, left, oper_method.Parameters.Types[0], left.Location);\n\t\t\t\t\tthis.right = Convert.ImplicitConversion (rc, right, oper_method.Parameters.Types[1], left.Location);\n\t\t\t\t}\n\n\t\t\t\tvar ptypes = best_original.Parameters.Types;\n\n\t\t\t\tif (left.IsNull || right.IsNull) {\n\t\t\t\t\t//\n\t\t\t\t\t// The lifted operator produces a null value if one or both operands are null\n\t\t\t\t\t//\n\t\t\t\t\tif ((oper & (Operator.ArithmeticMask | Operator.ShiftMask | Operator.BitwiseMask)) != 0) {\n\t\t\t\t\t\ttype = oper_method.ReturnType;\n\t\t\t\t\t\treturn Nullable.LiftedNull.CreateFromExpression (rc, this);\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// The lifted operator produces the value false if one or both operands are null for\n\t\t\t\t\t// relational operators.\n\t\t\t\t\t//\n\t\t\t\t\tif ((oper & Operator.RelationalMask) != 0) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// CSC BUG: This should be different warning, csc reports CS0458 with bool? which is wrong\n\t\t\t\t\t\t// because return type is actually bool\n\t\t\t\t\t\t//\n\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, left.IsNull ? ptypes [1] : ptypes [0]);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((oper & Operator.EqualityMask) != 0 && ((left.IsNull && !right.Type.IsNullableType) || !left.Type.IsNullableType)) {\n\t\t\t\t\t\treturn CreateLiftedValueTypeResult (rc, left.IsNull ? ptypes [1] : ptypes [0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttype = oper_method.ReturnType;\n\t\t\t\tvar lifted = new Nullable.LiftedBinaryOperator (this);\n\t\t\t\tlifted.UserOperator = best_original;\n\n\t\t\t\tif (left.Type.IsNullableType && !ptypes[0].IsNullableType) {\n\t\t\t\t\tlifted.UnwrapLeft = new Nullable.Unwrap (left);\n\t\t\t\t}\n\n\t\t\t\tif (right.Type.IsNullableType && !ptypes[1].IsNullableType) {\n\t\t\t\t\tlifted.UnwrapRight = new Nullable.Unwrap (right);\n\t\t\t\t}\n\n\t\t\t\tlifted.Left = Convert.ImplicitConversion (rc, lifted.UnwrapLeft ?? left, ptypes[0], left.Location);\n\t\t\t\tlifted.Right = Convert.ImplicitConversion (rc, lifted.UnwrapRight ?? right, ptypes[1], right.Location);\n\n\t\t\t\treturn lifted.Resolve (rc);\n\t\t\t}\n\t\t\t\n\t\t\tif ((oper & Operator.LogicalMask) != 0) {\n\t\t\t\t// TODO: CreateExpressionTree is allocated every time\t\t\n\t\t\t\toper_expr = new ConditionalLogicalOperator (oper_method, args, CreateExpressionTree,\n\t\t\t\t\toper == Operator.LogicalAnd, loc).Resolve (rc);\n\t\t\t} else {\n\t\t\t\toper_expr = new UserOperatorCall (oper_method, args, CreateExpressionTree, loc);\n\t\t\t}\n\n\t\t\tthis.left = larg.Expr;\n\t\t\tthis.right = rarg.Expr;\n\n\t\t\treturn oper_expr;\n\t\t}\n\n\t\tbool IsLiftedOperatorApplicable ()\n\t\t{\n\t\t\tif (left.Type.IsNullableType) {\n\t\t\t\tif ((oper & Operator.EqualityMask) != 0)\n\t\t\t\t\treturn !right.IsNull;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (right.Type.IsNullableType) {\n\t\t\t\tif ((oper & Operator.EqualityMask) != 0)\n\t\t\t\t\treturn !left.IsNull;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (TypeSpec.IsValueType (left.Type))\n\t\t\t\treturn right.IsNull;\n\n\t\t\tif (TypeSpec.IsValueType (right.Type))\n\t\t\t\treturn left.IsNull;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tList<MemberSpec> CreateLiftedOperators (ResolveContext rc, IList<MemberSpec> operators)\n\t\t{\n\t\t\tvar nullable_type = rc.Module.PredefinedTypes.Nullable.TypeSpec;\n\t\t\tif (nullable_type == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Lifted operators permit predefined and user-defined operators that operate\n\t\t\t// on non-nullable value types to also be used with nullable forms of those types.\n\t\t\t// Lifted operators are constructed from predefined and user-defined operators\n\t\t\t// that meet certain requirements\n\t\t\t//\n\t\t\tList<MemberSpec> lifted = null;\n\t\t\tforeach (MethodSpec oper in operators) {\n\t\t\t\tTypeSpec rt;\n\t\t\t\tif ((Oper & Operator.ComparisonMask) != 0) {\n\t\t\t\t\t//\n\t\t\t\t\t// Result type must be of type bool for lifted comparison operators\n\t\t\t\t\t//\n\t\t\t\t\trt = oper.ReturnType;\n\t\t\t\t\tif (rt.BuiltinType != BuiltinTypeSpec.Type.Bool)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tif (!TypeSpec.IsNonNullableValueType (oper.ReturnType))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\trt = null;\n\t\t\t\t}\n\n\t\t\t\tvar ptypes = oper.Parameters.Types;\n\t\t\t\tif (!TypeSpec.IsNonNullableValueType (ptypes [0]) || !TypeSpec.IsNonNullableValueType (ptypes [1]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: I am not sure why but for equality operators to be lifted\n\t\t\t\t// both types have to match\n\t\t\t\t//\n\t\t\t\tif ((Oper & Operator.EqualityMask) != 0 && ptypes [0] != ptypes [1])\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (lifted == null)\n\t\t\t\t\tlifted = new List<MemberSpec> ();\n\n\t\t\t\t//\n\t\t\t\t// The lifted form is constructed by adding a single ? modifier to each operand and\n\t\t\t\t// result type except for comparison operators where return type is bool\n\t\t\t\t//\n\t\t\t\tif (rt == null)\n\t\t\t\t\trt = nullable_type.MakeGenericType (rc.Module, new[] { oper.ReturnType });\n\n\t\t\t\tvar parameters = ParametersCompiled.CreateFullyResolved (\n\t\t\t\t\tnullable_type.MakeGenericType (rc.Module, new [] { ptypes[0] }),\n\t\t\t\t\tnullable_type.MakeGenericType (rc.Module, new [] { ptypes[1] }));\n\n\t\t\t\tvar lifted_op = new MethodSpec (oper.Kind, oper.DeclaringType, oper.MemberDefinition,\n\t\t\t\t\trt, parameters, oper.Modifiers);\n\n\t\t\t\tlifted.Add (lifted_op);\n\t\t\t}\n\n\t\t\treturn lifted;\n\t\t}\n\n\t\t//\n\t\t// Merge two sets of user operators into one, they are mostly distinguish\n\t\t// except when they share base type and it contains an operator\n\t\t//\n\t\tstatic IList<MemberSpec> CombineUserOperators (IList<MemberSpec> left, IList<MemberSpec> right)\n\t\t{\n\t\t\tvar combined = new List<MemberSpec> (left.Count + right.Count);\n\t\t\tcombined.AddRange (left);\n\t\t\tforeach (var r in right) {\n\t\t\t\tbool same = false;\n\t\t\t\tforeach (var l in left) {\n\t\t\t\t\tif (l.DeclaringType == r.DeclaringType) {\n\t\t\t\t\t\tsame = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!same)\n\t\t\t\t\tcombined.Add (r);\n\t\t\t}\n\n\t\t\treturn combined;\n\t\t}\n\n\t\tvoid CheckOutOfRangeComparison (ResolveContext ec, Constant c, TypeSpec type)\n\t\t{\n\t\t\tif (c is IntegralConstant || c is CharConstant) {\n\t\t\t\ttry {\n\t\t\t\t\tc.ConvertExplicitly (true, type);\n\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\tec.Report.Warning (652, 2, loc,\n\t\t\t\t\t\t\"A comparison between a constant and a variable is useless. The constant is out of the range of the variable type `{0}'\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <remarks>\n\t\t///   EmitBranchable is called from Statement.EmitBoolExpression in the\n\t\t///   context of a conditional bool expression.  This function will return\n\t\t///   false if it is was possible to use EmitBranchable, or true if it was.\n\t\t///\n\t\t///   The expression's code is generated, and we will generate a branch to `target'\n\t\t///   if the resulting expression value is equal to isTrue\n\t\t/// </remarks>\n\t\tpublic override void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && right.ContainsEmitWithAwait ()) {\n\t\t\t\tleft = left.EmitToField (ec);\n\n\t\t\t\tif ((oper & Operator.LogicalMask) == 0) {\n\t\t\t\t\tright = right.EmitToField (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// This is more complicated than it looks, but its just to avoid\n\t\t\t// duplicated tests: basically, we allow ==, !=, >, <, >= and <=\n\t\t\t// but on top of that we want for == and != to use a special path\n\t\t\t// if we are comparing against null\n\t\t\t//\n\t\t\tif ((oper & Operator.EqualityMask) != 0 && (left is Constant || right is Constant)) {\n\t\t\t\tbool my_on_true = oper == Operator.Inequality ? on_true : !on_true;\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// put the constant on the rhs, for simplicity\n\t\t\t\t//\n\t\t\t\tif (left is Constant) {\n\t\t\t\t\tExpression swap = right;\n\t\t\t\t\tright = left;\n\t\t\t\t\tleft = swap;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// brtrue/brfalse works with native int only\n\t\t\t\t//\n\t\t\t\tif (((Constant) right).IsZeroInteger && right.Type.BuiltinType != BuiltinTypeSpec.Type.Long && right.Type.BuiltinType != BuiltinTypeSpec.Type.ULong) {\n\t\t\t\t\tleft.EmitBranchable (ec, target, my_on_true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (right.Type.BuiltinType == BuiltinTypeSpec.Type.Bool) {\n\t\t\t\t\t// right is a boolean, and it's not 'false' => it is 'true'\n\t\t\t\t\tleft.EmitBranchable (ec, target, !my_on_true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t} else if (oper == Operator.LogicalAnd) {\n\n\t\t\t\tif (on_true) {\n\t\t\t\t\tLabel tests_end = ec.DefineLabel ();\n\t\t\t\t\t\n\t\t\t\t\tleft.EmitBranchable (ec, tests_end, false);\n\t\t\t\t\tright.EmitBranchable (ec, target, true);\n\t\t\t\t\tec.MarkLabel (tests_end);\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// This optimizes code like this \n\t\t\t\t\t// if (true && i > 4)\n\t\t\t\t\t//\n\t\t\t\t\tif (!(left is Constant))\n\t\t\t\t\t\tleft.EmitBranchable (ec, target, false);\n\n\t\t\t\t\tif (!(right is Constant)) \n\t\t\t\t\t\tright.EmitBranchable (ec, target, false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t} else if (oper == Operator.LogicalOr){\n\t\t\t\tif (on_true) {\n\t\t\t\t\tleft.EmitBranchable (ec, target, true);\n\t\t\t\t\tright.EmitBranchable (ec, target, true);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tLabel tests_end = ec.DefineLabel ();\n\t\t\t\t\tleft.EmitBranchable (ec, tests_end, true);\n\t\t\t\t\tright.EmitBranchable (ec, target, false);\n\t\t\t\t\tec.MarkLabel (tests_end);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn;\n\n\t\t\t} else if ((oper & Operator.ComparisonMask) == 0) {\n\t\t\t\tbase.EmitBranchable (ec, target, on_true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tleft.Emit (ec);\n\t\t\tright.Emit (ec);\n\n\t\t\tTypeSpec t = left.Type;\n\t\t\tbool is_float = IsFloat (t);\n\t\t\tbool is_unsigned = is_float || IsUnsigned (t);\n\t\t\t\n\t\t\tswitch (oper){\n\t\t\tcase Operator.Equality:\n\t\t\t\tif (on_true)\n\t\t\t\t\tec.Emit (OpCodes.Beq, target);\n\t\t\t\telse\n\t\t\t\t\tec.Emit (OpCodes.Bne_Un, target);\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.Inequality:\n\t\t\t\tif (on_true)\n\t\t\t\t\tec.Emit (OpCodes.Bne_Un, target);\n\t\t\t\telse\n\t\t\t\t\tec.Emit (OpCodes.Beq, target);\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.LessThan:\n\t\t\t\tif (on_true)\n\t\t\t\t\tif (is_unsigned && !is_float)\n\t\t\t\t\t\tec.Emit (OpCodes.Blt_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Blt, target);\n\t\t\t\telse\n\t\t\t\t\tif (is_unsigned)\n\t\t\t\t\t\tec.Emit (OpCodes.Bge_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Bge, target);\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.GreaterThan:\n\t\t\t\tif (on_true)\n\t\t\t\t\tif (is_unsigned && !is_float)\n\t\t\t\t\t\tec.Emit (OpCodes.Bgt_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Bgt, target);\n\t\t\t\telse\n\t\t\t\t\tif (is_unsigned)\n\t\t\t\t\t\tec.Emit (OpCodes.Ble_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Ble, target);\n\t\t\t\tbreak;\n\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\t\tif (on_true)\n\t\t\t\t\tif (is_unsigned && !is_float)\n\t\t\t\t\t\tec.Emit (OpCodes.Ble_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Ble, target);\n\t\t\t\telse\n\t\t\t\t\tif (is_unsigned)\n\t\t\t\t\t\tec.Emit (OpCodes.Bgt_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Bgt, target);\n\t\t\t\tbreak;\n\n\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\tif (on_true)\n\t\t\t\t\tif (is_unsigned && !is_float)\n\t\t\t\t\t\tec.Emit (OpCodes.Bge_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Bge, target);\n\t\t\t\telse\n\t\t\t\t\tif (is_unsigned)\n\t\t\t\t\t\tec.Emit (OpCodes.Blt_Un, target);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Blt, target);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (oper.ToString ());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && right.ContainsEmitWithAwait ()) {\n\t\t\t\tleft = left.EmitToField (ec);\n\n\t\t\t\tif ((oper & Operator.LogicalMask) == 0) {\n\t\t\t\t\tright = right.EmitToField (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Handle short-circuit operators differently\n\t\t\t// than the rest\n\t\t\t//\n\t\t\tif ((oper & Operator.LogicalMask) != 0) {\n\t\t\t\tLabel load_result = ec.DefineLabel ();\n\t\t\t\tLabel end = ec.DefineLabel ();\n\n\t\t\t\tbool is_or = oper == Operator.LogicalOr;\n\t\t\t\tleft.EmitBranchable (ec, load_result, is_or);\n\t\t\t\tright.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Br_S, end);\n\t\t\t\t\n\t\t\t\tec.MarkLabel (load_result);\n\t\t\t\tec.EmitInt (is_or ? 1 : 0);\n\t\t\t\tec.MarkLabel (end);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Optimize zero-based operations which cannot be optimized at expression level\n\t\t\t//\n\t\t\tif (oper == Operator.Subtraction) {\n\t\t\t\tvar lc = left as IntegralConstant;\n\t\t\t\tif (lc != null && lc.IsDefaultValue) {\n\t\t\t\t\tright.Emit (ec);\n\t\t\t\t\tec.Emit (OpCodes.Neg);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tEmitOperator (ec, left, right);\n\t\t}\n\n\t\tpublic void EmitOperator (EmitContext ec, Expression left, Expression right)\n\t\t{\n\t\t\tleft.Emit (ec);\n\t\t\tright.Emit (ec);\n\n\t\t\tEmitOperatorOpcode (ec, oper, left.Type, right);\n\n\t\t\t//\n\t\t\t// Emit result enumerable conversion this way because it's quite complicated get it\n\t\t\t// to resolved tree because expression tree cannot see it.\n\t\t\t//\n\t\t\tif (enum_conversion != 0)\n\t\t\t\tConvCast.Emit (ec, enum_conversion);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\tif ((oper & Operator.LogicalMask) != 0 ||\n\t\t\t\t(ec.HasSet (EmitContext.Options.CheckedScope) && (oper == Operator.Multiply || oper == Operator.Addition || oper == Operator.Subtraction))) {\n\t\t\t\tbase.EmitSideEffect (ec);\n\t\t\t} else {\n\t\t\t\tleft.EmitSideEffect (ec);\n\t\t\t\tright.EmitSideEffect (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t{\n\t\t\tif ((oper & Operator.LogicalMask) == 0) {\n\t\t\t\tvar await_expr = left as Await;\n\t\t\t\tif (await_expr != null && right.IsSideEffectFree) {\n\t\t\t\t\tawait_expr.Statement.EmitPrologue (ec);\n\t\t\t\t\tleft = await_expr.Statement.GetResultExpression (ec);\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t\tawait_expr = right as Await;\n\t\t\t\tif (await_expr != null && left.IsSideEffectFree) {\n\t\t\t\t\tawait_expr.Statement.EmitPrologue (ec);\n\t\t\t\t\tright = await_expr.Statement.GetResultExpression (ec);\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.EmitToField (ec);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tBinary target = (Binary) t;\n\n\t\t\ttarget.left = left.Clone (clonectx);\n\t\t\ttarget.right = right.Clone (clonectx);\n\t\t}\n\n\t\tpublic Expression CreateCallSiteBinder (ResolveContext ec, Arguments args)\n\t\t{\n\t\t\tArguments binder_args = new Arguments (4);\n\n\t\t\tMemberAccess sle = new MemberAccess (new MemberAccess (\n\t\t\t\tnew QualifiedAliasMember (QualifiedAliasMember.GlobalAlias, \"System\", loc), \"Linq\", loc), \"Expressions\", loc);\n\n\t\t\tCSharpBinderFlags flags = 0;\n\t\t\tif (ec.HasSet (ResolveContext.Options.CheckedScope))\n\t\t\t\tflags = CSharpBinderFlags.CheckedContext;\n\n\t\t\tif ((oper & Operator.LogicalMask) != 0)\n\t\t\t\tflags |= CSharpBinderFlags.BinaryOperationLogical;\n\n\t\t\tbinder_args.Add (new Argument (new EnumConstant (new IntLiteral (ec.BuiltinTypes, (int) flags, loc), ec.Module.PredefinedTypes.BinderFlags.Resolve ())));\n\t\t\tbinder_args.Add (new Argument (new MemberAccess (new MemberAccess (sle, \"ExpressionType\", loc), GetOperatorExpressionTypeName (), loc)));\n\t\t\tbinder_args.Add (new Argument (new TypeOf (ec.CurrentType, loc)));\t\t\t\t\t\t\t\t\t\n\t\t\tbinder_args.Add (new Argument (new ImplicitlyTypedArrayCreation (args.CreateDynamicBinderArguments (ec), loc)));\n\n\t\t\treturn new Invocation (new MemberAccess (new TypeExpression (ec.Module.PredefinedTypes.Binder.TypeSpec, loc), \"BinaryOperation\", loc), binder_args);\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn CreateExpressionTree (ec, null);\n\t\t}\n\n\t\tpublic Expression CreateExpressionTree (ResolveContext ec, Expression method)\t\t\n\t\t{\n\t\t\tstring method_name;\n\t\t\tbool lift_arg = false;\n\t\t\t\n\t\t\tswitch (oper) {\n\t\t\tcase Operator.Addition:\n\t\t\t\tif (method == null && ec.HasSet (ResolveContext.Options.CheckedScope) && !IsFloat (type))\n\t\t\t\t\tmethod_name = \"AddChecked\";\n\t\t\t\telse\n\t\t\t\t\tmethod_name = \"Add\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.BitwiseAnd:\n\t\t\t\tmethod_name = \"And\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.BitwiseOr:\n\t\t\t\tmethod_name = \"Or\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Division:\n\t\t\t\tmethod_name = \"Divide\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Equality:\n\t\t\t\tmethod_name = \"Equal\";\n\t\t\t\tlift_arg = true;\n\t\t\t\tbreak;\n\t\t\tcase Operator.ExclusiveOr:\n\t\t\t\tmethod_name = \"ExclusiveOr\";\n\t\t\t\tbreak;\t\t\t\t\n\t\t\tcase Operator.GreaterThan:\n\t\t\t\tmethod_name = \"GreaterThan\";\n\t\t\t\tlift_arg = true;\n\t\t\t\tbreak;\n\t\t\tcase Operator.GreaterThanOrEqual:\n\t\t\t\tmethod_name = \"GreaterThanOrEqual\";\n\t\t\t\tlift_arg = true;\n\t\t\t\tbreak;\n\t\t\tcase Operator.Inequality:\n\t\t\t\tmethod_name = \"NotEqual\";\n\t\t\t\tlift_arg = true;\n\t\t\t\tbreak;\n\t\t\tcase Operator.LeftShift:\n\t\t\t\tmethod_name = \"LeftShift\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.LessThan:\n\t\t\t\tmethod_name = \"LessThan\";\n\t\t\t\tlift_arg = true;\n\t\t\t\tbreak;\n\t\t\tcase Operator.LessThanOrEqual:\n\t\t\t\tmethod_name = \"LessThanOrEqual\";\n\t\t\t\tlift_arg = true;\n\t\t\t\tbreak;\n\t\t\tcase Operator.LogicalAnd:\n\t\t\t\tmethod_name = \"AndAlso\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.LogicalOr:\n\t\t\t\tmethod_name = \"OrElse\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Modulus:\n\t\t\t\tmethod_name = \"Modulo\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Multiply:\n\t\t\t\tif (method == null && ec.HasSet (ResolveContext.Options.CheckedScope) && !IsFloat (type))\n\t\t\t\t\tmethod_name = \"MultiplyChecked\";\n\t\t\t\telse\n\t\t\t\t\tmethod_name = \"Multiply\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.RightShift:\n\t\t\t\tmethod_name = \"RightShift\";\n\t\t\t\tbreak;\n\t\t\tcase Operator.Subtraction:\n\t\t\t\tif (method == null && ec.HasSet (ResolveContext.Options.CheckedScope) && !IsFloat (type))\n\t\t\t\t\tmethod_name = \"SubtractChecked\";\n\t\t\t\telse\n\t\t\t\t\tmethod_name = \"Subtract\";\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (\"Unknown expression tree binary operator \" + oper);\n\t\t\t}\n\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (left.CreateExpressionTree (ec)));\n\t\t\targs.Add (new Argument (right.CreateExpressionTree (ec)));\n\t\t\tif (method != null) {\n\t\t\t\tif (lift_arg)\n\t\t\t\t\targs.Add (new Argument (new BoolLiteral (ec.BuiltinTypes, false, loc)));\n\n\t\t\t\targs.Add (new Argument (method));\n\t\t\t}\n\t\t\t\n\t\t\treturn CreateExpressionFactoryCall (ec, method_name, args);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t}\n\t\n\t//\n\t// Represents the operation a + b [+ c [+ d [+ ...]]], where a is a string\n\t// b, c, d... may be strings or objects.\n\t//\n\tpublic class StringConcat : Expression\n\t{\n\t\tArguments arguments;\n\t\t\n\t\tStringConcat (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t\targuments = new Arguments (2);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn arguments.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic static StringConcat Create (ResolveContext rc, Expression left, Expression right, Location loc)\n\t\t{\n\t\t\tif (left.eclass == ExprClass.Unresolved || right.eclass == ExprClass.Unresolved)\n\t\t\t\tthrow new ArgumentException ();\n\n\t\t\tvar s = new StringConcat (loc);\n\t\t\ts.type = rc.BuiltinTypes.String;\n\t\t\ts.eclass = ExprClass.Value;\n\n\t\t\ts.Append (rc, left);\n\t\t\ts.Append (rc, right);\n\t\t\treturn s;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArgument arg = arguments [0];\n\t\t\treturn CreateExpressionAddCall (ec, arg, arg.CreateExpressionTree (ec), 1);\n\t\t}\n\n\t\t//\n\t\t// Creates nested calls tree from an array of arguments used for IL emit\n\t\t//\n\t\tExpression CreateExpressionAddCall (ResolveContext ec, Argument left, Expression left_etree, int pos)\n\t\t{\n\t\t\tArguments concat_args = new Arguments (2);\n\t\t\tArguments add_args = new Arguments (3);\n\n\t\t\tconcat_args.Add (left);\n\t\t\tadd_args.Add (new Argument (left_etree));\n\n\t\t\tconcat_args.Add (arguments [pos]);\n\t\t\tadd_args.Add (new Argument (arguments [pos].CreateExpressionTree (ec)));\n\n\t\t\tvar methods = GetConcatMethodCandidates ();\n\t\t\tif (methods == null)\n\t\t\t\treturn null;\n\n\t\t\tvar res = new OverloadResolver (methods, OverloadResolver.Restrictions.NoBaseMembers, loc);\n\t\t\tvar method = res.ResolveMember<MethodSpec> (ec, ref concat_args);\n\t\t\tif (method == null)\n\t\t\t\treturn null;\n\n\t\t\tadd_args.Add (new Argument (new TypeOfMethod (method, loc)));\n\n\t\t\tExpression expr = CreateExpressionFactoryCall (ec, \"Add\", add_args);\n\t\t\tif (++pos == arguments.Count)\n\t\t\t\treturn expr;\n\n\t\t\tleft = new Argument (new EmptyExpression (method.ReturnType));\n\t\t\treturn CreateExpressionAddCall (ec, left, expr, pos);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tvoid Append (ResolveContext rc, Expression operand)\n\t\t{\n\t\t\t//\n\t\t\t// Constant folding\n\t\t\t//\n\t\t\tStringConstant sc = operand as StringConstant;\n\t\t\tif (sc != null) {\n\t\t\t\tif (arguments.Count != 0) {\n\t\t\t\t\tArgument last_argument = arguments [arguments.Count - 1];\n\t\t\t\t\tStringConstant last_expr_constant = last_argument.Expr as StringConstant;\n\t\t\t\t\tif (last_expr_constant != null) {\n\t\t\t\t\t\tlast_argument.Expr = new StringConstant (rc.BuiltinTypes, last_expr_constant.Value + sc.Value, sc.Location);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// Multiple (3+) concatenation are resolved as multiple StringConcat instances\n\t\t\t\t//\n\t\t\t\tStringConcat concat_oper = operand as StringConcat;\n\t\t\t\tif (concat_oper != null) {\n\t\t\t\t\targuments.AddRange (concat_oper.arguments);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\targuments.Add (new Argument (operand));\n\t\t}\n\n\t\tIList<MemberSpec> GetConcatMethodCandidates ()\n\t\t{\n\t\t\treturn MemberCache.FindMembers (type, \"Concat\", true);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// Optimize by removing any extra null arguments, they are no-op\n\t\t\tfor (int i = 0; i < arguments.Count; ++i) {\n\t\t\t\tif (arguments[i].Expr is NullConstant)\n\t\t\t\t\targuments.RemoveAt (i--);\n\t\t\t}\n\n\t\t\tvar members = GetConcatMethodCandidates ();\n\t\t\tvar res = new OverloadResolver (members, OverloadResolver.Restrictions.NoBaseMembers, loc);\n\t\t\tvar method = res.ResolveMember<MethodSpec> (new ResolveContext (ec.MemberContext), ref arguments);\n\t\t\tif (method != null) {\n\t\t\t\tvar call = new CallEmitter ();\n\t\t\t\tcall.EmitPredefined (ec, method, arguments, false);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\targuments.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\tif (arguments.Count != 2)\n\t\t\t\tthrow new NotImplementedException (\"arguments.Count != 2\");\n\n\t\t\tvar concat = typeof (string).GetMethod (\"Concat\", new[] { typeof (object), typeof (object) });\n\t\t\treturn SLE.Expression.Add (arguments[0].Expr.MakeExpression (ctx), arguments[1].Expr.MakeExpression (ctx), concat);\n\t\t}\n\t}\n\n\t//\n\t// User-defined conditional logical operator\n\t//\n\tpublic class ConditionalLogicalOperator : UserOperatorCall\n\t{\n\t\treadonly bool is_and;\n\t\tExpression oper_expr;\n\n\t\tpublic ConditionalLogicalOperator (MethodSpec oper, Arguments arguments, Func<ResolveContext, Expression, Expression> expr_tree, bool is_and, Location loc)\n\t\t\t: base (oper, arguments, expr_tree, loc)\n\t\t{\n\t\t\tthis.is_and = is_and;\n\t\t\teclass = ExprClass.Unresolved;\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tAParametersCollection pd = oper.Parameters;\n\t\t\tif (!TypeSpecComparer.IsEqual (type, pd.Types[0]) || !TypeSpecComparer.IsEqual (type, pd.Types[1])) {\n\t\t\t\tec.Report.Error (217, loc,\n\t\t\t\t\t\"A user-defined operator `{0}' must have each parameter type and return type of the same type in order to be applicable as a short circuit operator\",\n\t\t\t\t\toper.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tExpression left_dup = new EmptyExpression (type);\n\t\t\tExpression op_true = GetOperatorTrue (ec, left_dup, loc);\n\t\t\tExpression op_false = GetOperatorFalse (ec, left_dup, loc);\n\t\t\tif (op_true == null || op_false == null) {\n\t\t\t\tec.Report.Error (218, loc,\n\t\t\t\t\t\"The type `{0}' must have operator `true' and operator `false' defined when `{1}' is used as a short circuit operator\",\n\t\t\t\t\ttype.GetSignatureForError (), oper.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\toper_expr = is_and ? op_false : op_true;\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLabel end_target = ec.DefineLabel ();\n\n\t\t\t//\n\t\t\t// Emit and duplicate left argument\n\t\t\t//\n\t\t\tbool right_contains_await = ec.HasSet (BuilderContext.Options.AsyncBody) && arguments[1].Expr.ContainsEmitWithAwait ();\n\t\t\tif (right_contains_await) {\n\t\t\t\targuments[0] = arguments[0].EmitToField (ec, false);\n\t\t\t\targuments[0].Expr.Emit (ec);\n\t\t\t} else {\n\t\t\t\targuments[0].Expr.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\targuments.RemoveAt (0);\n\t\t\t}\n\n\t\t\toper_expr.EmitBranchable (ec, end_target, true);\n\n\t\t\tbase.Emit (ec);\n\n\t\t\tif (right_contains_await) {\n\t\t\t\t//\n\t\t\t\t// Special handling when right expression contains await and left argument\n\t\t\t\t// could not be left on stack before logical branch\n\t\t\t\t//\n\t\t\t\tLabel skip_left_load = ec.DefineLabel ();\n\t\t\t\tec.Emit (OpCodes.Br_S, skip_left_load);\n\t\t\t\tec.MarkLabel (end_target);\n\t\t\t\targuments[0].Expr.Emit (ec);\n\t\t\t\tec.MarkLabel (skip_left_load);\n\t\t\t} else {\n\t\t\t\tec.MarkLabel (end_target);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class PointerArithmetic : Expression {\n\t\tExpression left, right;\n\t\treadonly Binary.Operator op;\n\n\t\t//\n\t\t// We assume that `l' is always a pointer\n\t\t//\n\t\tpublic PointerArithmetic (Binary.Operator op, Expression l, Expression r, TypeSpec t, Location loc)\n\t\t{\n\t\t\ttype = t;\n\t\t\tthis.loc = loc;\n\t\t\tleft = l;\n\t\t\tright = r;\n\t\t\tthis.op = op;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tError_PointerInsideExpressionTree (ec);\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Variable;\n\n\t\t\tvar pc = left.Type as PointerContainer;\n\t\t\tif (pc != null && pc.Element.Kind == MemberKind.Void) {\n\t\t\t\tError_VoidPointerOperation (ec);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tTypeSpec op_type = left.Type;\n\t\t\t\n\t\t\t// It must be either array or fixed buffer\n\t\t\tTypeSpec element;\n\t\t\tif (TypeManager.HasElementType (op_type)) {\n\t\t\t\telement = TypeManager.GetElementType (op_type);\n\t\t\t} else {\n\t\t\t\tFieldExpr fe = left as FieldExpr;\n\t\t\t\tif (fe != null)\n\t\t\t\t\telement = ((FixedFieldSpec) (fe.Spec)).ElementType;\n\t\t\t\telse\n\t\t\t\t\telement = op_type;\n\t\t\t}\n\n\t\t\tint size = BuiltinTypeSpec.GetSize(element);\n\t\t\tTypeSpec rtype = right.Type;\n\t\t\t\n\t\t\tif ((op & Binary.Operator.SubtractionMask) != 0 && rtype.IsPointer){\n\t\t\t\t//\n\t\t\t\t// handle (pointer - pointer)\n\t\t\t\t//\n\t\t\t\tleft.Emit (ec);\n\t\t\t\tright.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Sub);\n\n\t\t\t\tif (size != 1){\n\t\t\t\t\tif (size == 0)\n\t\t\t\t\t\tec.Emit (OpCodes.Sizeof, element);\n\t\t\t\t\telse \n\t\t\t\t\t\tec.EmitInt (size);\n\t\t\t\t\tec.Emit (OpCodes.Div);\n\t\t\t\t}\n\t\t\t\tec.Emit (OpCodes.Conv_I8);\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// handle + and - on (pointer op int)\n\t\t\t\t//\n\t\t\t\tConstant left_const = left as Constant;\n\t\t\t\tif (left_const != null) {\n\t\t\t\t\t//\n\t\t\t\t\t// Optimize ((T*)null) pointer operations\n\t\t\t\t\t//\n\t\t\t\t\tif (left_const.IsDefaultValue) {\n\t\t\t\t\t\tleft = EmptyExpression.Null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tleft_const = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tleft.Emit (ec);\n\n\t\t\t\tvar right_const = right as Constant;\n\t\t\t\tif (right_const != null) {\n\t\t\t\t\t//\n\t\t\t\t\t// Optimize 0-based arithmetic\n\t\t\t\t\t//\n\t\t\t\t\tif (right_const.IsDefaultValue)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tif (size != 0)\n\t\t\t\t\t\tright = new IntConstant (ec.BuiltinTypes, size, right.Location);\n\t\t\t\t\telse\n\t\t\t\t\t\tright = new SizeOf (new TypeExpression (element, right.Location), right.Location);\n\t\t\t\t\t\n\t\t\t\t\t// TODO: Should be the checks resolve context sensitive?\n\t\t\t\t\tResolveContext rc = new ResolveContext (ec.MemberContext, ResolveContext.Options.UnsafeScope);\n\t\t\t\t\tright = new Binary (Binary.Operator.Multiply, right, right_const).Resolve (rc);\n\t\t\t\t\tif (right == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tright.Emit (ec);\n\t\t\t\tswitch (rtype.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\tec.Emit (OpCodes.Conv_I);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\tec.Emit (OpCodes.Conv_U);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (right_const == null && size != 1){\n\t\t\t\t\tif (size == 0)\n\t\t\t\t\t\tec.Emit (OpCodes.Sizeof, element);\n\t\t\t\t\telse \n\t\t\t\t\t\tec.EmitInt (size);\n\t\t\t\t\tif (rtype.BuiltinType == BuiltinTypeSpec.Type.Long || rtype.BuiltinType == BuiltinTypeSpec.Type.ULong)\n\t\t\t\t\t\tec.Emit (OpCodes.Conv_I8);\n\n\t\t\t\t\tBinary.EmitOperatorOpcode (ec, Binary.Operator.Multiply, rtype, right);\n\t\t\t\t}\n\n\t\t\t\tif (left_const == null) {\n\t\t\t\t\tif (rtype.BuiltinType == BuiltinTypeSpec.Type.Long)\n\t\t\t\t\t\tec.Emit (OpCodes.Conv_I);\n\t\t\t\t\telse if (rtype.BuiltinType == BuiltinTypeSpec.Type.ULong)\n\t\t\t\t\t\tec.Emit (OpCodes.Conv_U);\n\n\t\t\t\t\tBinary.EmitOperatorOpcode (ec, op, op_type, right);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// A boolean-expression is an expression that yields a result\n\t// of type bool\n\t//\n\tpublic class BooleanExpression : ShimExpression\n\t{\n\t\tpublic BooleanExpression (Expression expr)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.loc = expr.Location;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\t// TODO: We should emit IsTrue (v4) instead of direct user operator\n\t\t\t// call but that would break csc compatibility\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t// A boolean-expression is required to be of a type\n\t\t\t// that can be implicitly converted to bool or of\n\t\t\t// a type that implements operator true\n\n\t\t\texpr = expr.Resolve (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tAssign ass = expr as Assign;\n\t\t\tif (ass != null && ass.Source is Constant) {\n\t\t\t\tec.Report.Warning (665, 3, loc,\n\t\t\t\t\t\"Assignment in conditional expression is always constant. Did you mean to use `==' instead ?\");\n\t\t\t}\n\n\t\t\tif (expr.Type.BuiltinType == BuiltinTypeSpec.Type.Bool)\n\t\t\t\treturn expr;\n\n\t\t\tif (expr.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (expr));\n\t\t\t\treturn DynamicUnaryConversion.CreateIsTrue (ec, args, loc).Resolve (ec);\n\t\t\t}\n\n\t\t\ttype = ec.BuiltinTypes.Bool;\n\t\t\tExpression converted = Convert.ImplicitConversion (ec, expr, type, loc);\n\t\t\tif (converted != null)\n\t\t\t\treturn converted;\n\n\t\t\t//\n\t\t\t// If no implicit conversion to bool exists, try using `operator true'\n\t\t\t//\n\t\t\tconverted = GetOperatorTrue (ec, expr, loc);\n\t\t\tif (converted == null) {\n\t\t\t\texpr.Error_ValueCannotBeConverted (ec, type, false);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn converted;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class BooleanExpressionFalse : Unary\n\t{\n\t\tpublic BooleanExpressionFalse (Expression expr)\n\t\t\t: base (Operator.LogicalNot, expr, expr.Location)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression ResolveOperator (ResolveContext ec, Expression expr)\n\t\t{\n\t\t\treturn GetOperatorFalse (ec, expr, loc) ?? base.ResolveOperator (ec, expr);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t///   Implements the ternary conditional operator (?:)\n\t/// </summary>\n\tpublic class Conditional : Expression {\n\t\tExpression expr, true_expr, false_expr;\n\n\t\tpublic Conditional (Expression expr, Expression true_expr, Expression false_expr, Location loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.true_expr = true_expr;\n\t\t\tthis.false_expr = false_expr;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression TrueExpr {\n\t\t\tget {\n\t\t\t\treturn true_expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression FalseExpr {\n\t\t\tget {\n\t\t\t\treturn false_expr;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn Expr.ContainsEmitWithAwait () || true_expr.ContainsEmitWithAwait () || false_expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (3);\n\t\t\targs.Add (new Argument (expr.CreateExpressionTree (ec)));\n\t\t\targs.Add (new Argument (true_expr.CreateExpressionTree (ec)));\n\t\t\targs.Add (new Argument (false_expr.CreateExpressionTree (ec)));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Condition\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\ttrue_expr = true_expr.Resolve (ec);\n\t\t\tfalse_expr = false_expr.Resolve (ec);\n\n\t\t\tif (true_expr == null || false_expr == null || expr == null)\n\t\t\t\treturn null;\n\n\t\t\teclass = ExprClass.Value;\n\t\t\tTypeSpec true_type = true_expr.Type;\n\t\t\tTypeSpec false_type = false_expr.Type;\n\t\t\ttype = true_type;\n\n\t\t\t//\n\t\t\t// First, if an implicit conversion exists from true_expr\n\t\t\t// to false_expr, then the result type is of type false_expr.Type\n\t\t\t//\n\t\t\tif (!TypeSpecComparer.IsEqual (true_type, false_type)) {\n\t\t\t\tExpression conv = Convert.ImplicitConversion (ec, true_expr, false_type, loc);\n\t\t\t\tif (conv != null && true_type.BuiltinType != BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\t//\n\t\t\t\t\t// Check if both can convert implicitly to each other's type\n\t\t\t\t\t//\n\t\t\t\t\ttype = false_type;\n\n\t\t\t\t\tif (false_type.BuiltinType != BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\t\tvar conv_false_expr = Convert.ImplicitConversion (ec, false_expr, true_type, loc);\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// LAMESPEC: There seems to be hardcoded promotition to int type when\n\t\t\t\t\t\t// both sides are numeric constants and one side is int constant and\n\t\t\t\t\t\t// other side is numeric constant convertible to int.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// var res = condition ? (short)1 : 1;\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Type of res is int even if according to the spec the conversion is\n\t\t\t\t\t\t// ambiguous because 1 literal can be converted to short.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (conv_false_expr != null) {\n\t\t\t\t\t\t\tif (conv_false_expr.Type.BuiltinType == BuiltinTypeSpec.Type.Int && conv is Constant) {\n\t\t\t\t\t\t\t\ttype = true_type;\n\t\t\t\t\t\t\t\tconv_false_expr = null;\n\t\t\t\t\t\t\t} else if (type.BuiltinType == BuiltinTypeSpec.Type.Int && conv_false_expr is Constant) {\n\t\t\t\t\t\t\t\tconv_false_expr = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (conv_false_expr != null) {\n\t\t\t\t\t\t\tec.Report.Error (172, true_expr.Location,\n\t\t\t\t\t\t\t\t\"Type of conditional expression cannot be determined as `{0}' and `{1}' convert implicitly to each other\",\n\t\t\t\t\t\t\t\t\ttrue_type.GetSignatureForError (), false_type.GetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttrue_expr = conv;\n\t\t\t\t\tif (true_expr.Type != type)\n\t\t\t\t\t\ttrue_expr = EmptyCast.Create (true_expr, type);\n\t\t\t\t} else if ((conv = Convert.ImplicitConversion (ec, false_expr, true_type, loc)) != null) {\n\t\t\t\t\tfalse_expr = conv;\n\t\t\t\t} else {\n\t\t\t\t\tec.Report.Error (173, true_expr.Location,\n\t\t\t\t\t\t\"Type of conditional expression cannot be determined because there is no implicit conversion between `{0}' and `{1}'\",\n\t\t\t\t\t\ttrue_type.GetSignatureForError (), false_type.GetSignatureForError ());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConstant c = expr as Constant;\n\t\t\tif (c != null) {\n\t\t\t\tbool is_false = c.IsDefaultValue;\n\n\t\t\t\t//\n\t\t\t\t// Don't issue the warning for constant expressions\n\t\t\t\t//\n\t\t\t\tif (!(is_false ? true_expr is Constant : false_expr is Constant)) {\n\t\t\t\t\t// CSC: Missing warning\n\t\t\t\t\tWarning_UnreachableExpression (ec, is_false ? true_expr.Location : false_expr.Location);\n\t\t\t\t}\n\n\t\t\t\treturn ReducedExpression.Create (\n\t\t\t\t\tis_false ? false_expr : true_expr, this,\n\t\t\t\t\tfalse_expr is Constant && true_expr is Constant).Resolve (ec);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLabel false_target = ec.DefineLabel ();\n\t\t\tLabel end_target = ec.DefineLabel ();\n\n\t\t\texpr.EmitBranchable (ec, false_target, false);\n\t\t\ttrue_expr.Emit (ec);\n\n\t\t\t//\n\t\t\t// Verifier doesn't support interface merging. When there are two types on\n\t\t\t// the stack without common type hint and the common type is an interface.\n\t\t\t// Use temporary local to give verifier hint on what type to unify the stack\n\t\t\t//\n\t\t\tif (type.IsInterface && true_expr is EmptyCast && false_expr is EmptyCast) {\n\t\t\t\tvar temp = ec.GetTemporaryLocal (type);\n\t\t\t\tec.Emit (OpCodes.Stloc, temp);\n\t\t\t\tec.Emit (OpCodes.Ldloc, temp);\n\t\t\t\tec.FreeTemporaryLocal (temp, type);\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Br, end_target);\n\t\t\tec.MarkLabel (false_target);\n\t\t\tfalse_expr.Emit (ec);\n\t\t\tec.MarkLabel (end_target);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysisConditional (fc);\n\t\t\tvar expr_true = fc.DefiniteAssignmentOnTrue;\n\t\t\tvar expr_false = fc.DefiniteAssignmentOnFalse;\n\n\t\t\tfc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_true);\n\t\t\ttrue_expr.FlowAnalysis (fc);\n\t\t\tvar true_fc = fc.DefiniteAssignment;\n\n\t\t\tfc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_false);\n\t\t\tfalse_expr.FlowAnalysis (fc);\n\n\t\t\tfc.DefiniteAssignment &= true_fc;\n\t\t}\n\n\t\tpublic override void FlowAnalysisConditional (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysisConditional (fc);\n\t\t\tvar expr_true = fc.DefiniteAssignmentOnTrue;\n\t\t\tvar expr_false = fc.DefiniteAssignmentOnFalse;\n\n\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_true);\n\t\t\ttrue_expr.FlowAnalysisConditional (fc);\n\t\t\tvar true_fc = fc.DefiniteAssignment;\n\t\t\tvar true_da_true = fc.DefiniteAssignmentOnTrue;\n\t\t\tvar true_da_false = fc.DefiniteAssignmentOnFalse;\n\n\t\t\tfc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_false);\n\t\t\tfalse_expr.FlowAnalysisConditional (fc);\n\n\t\t\tfc.DefiniteAssignment &= true_fc;\n\t\t\tfc.DefiniteAssignmentOnTrue = true_da_true & fc.DefiniteAssignmentOnTrue;\n\t\t\tfc.DefiniteAssignmentOnFalse = true_da_false & fc.DefiniteAssignmentOnFalse;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tConditional target = (Conditional) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t\ttarget.true_expr = true_expr.Clone (clonectx);\n\t\t\ttarget.false_expr = false_expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic abstract class VariableReference : Expression, IAssignMethod, IMemoryLocation, IVariableReference\n\t{\n\t\tLocalTemporary temp;\n\n\t\t#region Abstract\n\t\tpublic abstract HoistedVariable GetHoistedVariable (AnonymousExpression ae);\n\t\tpublic abstract void SetHasAddressTaken ();\n\n\t\tpublic abstract bool IsLockedByStatement { get; set; }\n\n\t\tpublic abstract bool IsFixed { get; }\n\t\tpublic abstract bool IsRef { get; }\n\t\tpublic abstract string Name { get; }\n\n\t\t//\n\t\t// Variable IL data, it has to be protected to encapsulate hoisted variables\n\t\t//\n\t\tprotected abstract ILocalVariable Variable { get; }\n\t\t\n\t\t//\n\t\t// Variable flow-analysis data\n\t\t//\n\t\tpublic abstract VariableInfo VariableInfo { get; }\n\t\t#endregion\n\n\t\tpublic virtual void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tHoistedVariable hv = GetHoistedVariable (ec);\n\t\t\tif (hv != null) {\n\t\t\t\thv.AddressOf (ec, mode);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tVariable.EmitAddressOf (ec);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tHoistedVariable hv = GetHoistedVariable (ec);\n\t\t\tif (hv != null)\n\t\t\t\treturn hv.CreateExpressionTree ();\n\n\t\t\tArguments arg = new Arguments (1);\n\t\t\targ.Add (new Argument (this));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Constant\", arg);\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\tif (IsLockedByStatement) {\n\t\t\t\trc.Report.Warning (728, 2, loc,\n\t\t\t\t\t\"Possibly incorrect assignment to `{0}' which is the argument to a using or lock statement\",\n\t\t\t\t\tName);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec, false);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\n\t\t//\n\t\t// This method is used by parameters that are references, that are\n\t\t// being passed as references:  we only want to pass the pointer (that\n\t\t// is already stored in the parameter, not the address of the pointer,\n\t\t// and not the value of the variable).\n\t\t//\n\t\tpublic void EmitLoad (EmitContext ec)\n\t\t{\n\t\t\tVariable.Emit (ec);\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tHoistedVariable hv = GetHoistedVariable (ec);\n\t\t\tif (hv != null) {\n\t\t\t\thv.Emit (ec, leave_copy);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEmitLoad (ec);\n\n\t\t\tif (IsRef) {\n\t\t\t\t//\n\t\t\t\t// If we are a reference, we loaded on the stack a pointer\n\t\t\t\t// Now lets load the real value\n\t\t\t\t//\n\t\t\t\tec.EmitLoadFromPtr (type);\n\t\t\t}\n\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\n\t\t\t\tif (IsRef) {\n\t\t\t\t\ttemp = new LocalTemporary (Type);\n\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy,\n\t\t\t\t\tbool prepare_for_load)\n\t\t{\n\t\t\tHoistedVariable hv = GetHoistedVariable (ec);\n\t\t\tif (hv != null) {\n\t\t\t\thv.EmitAssign (ec, source, leave_copy, prepare_for_load);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tNew n_source = source as New;\n\t\t\tif (n_source != null) {\n\t\t\t\tif (!n_source.Emit (ec, this)) {\n\t\t\t\t\tif (leave_copy) {\n\t\t\t\t\t\tEmitLoad (ec);\n\t\t\t\t\t\tif (IsRef)\n\t\t\t\t\t\t\tec.EmitLoadFromPtr (type);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (IsRef)\n\t\t\t\t\tEmitLoad (ec);\n\n\t\t\t\tsource.Emit (ec);\n\t\t\t}\n\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\tif (IsRef) {\n\t\t\t\t\ttemp = new LocalTemporary (Type);\n\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (IsRef)\n\t\t\t\tec.EmitStoreFromPtr (type);\n\t\t\telse\n\t\t\t\tVariable.EmitAssign (ec);\n\n\t\t\tif (temp != null) {\n\t\t\t\ttemp.Emit (ec);\n\t\t\t\ttemp.Release (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t{\n\t\t\tHoistedVariable hv = GetHoistedVariable (ec);\n\t\t\tif (hv != null) {\n\t\t\t\treturn hv.EmitToField (ec);\n\t\t\t}\n\n\t\t\treturn base.EmitToField (ec);\n\t\t}\n\n\t\tpublic HoistedVariable GetHoistedVariable (ResolveContext rc)\n\t\t{\n\t\t\treturn GetHoistedVariable (rc.CurrentAnonymousMethod);\n\t\t}\n\n\t\tpublic HoistedVariable GetHoistedVariable (EmitContext ec)\n\t\t{\n\t\t\treturn GetHoistedVariable (ec.CurrentAnonymousMethod);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn Name;\n\t\t}\n\n\t\tpublic bool IsHoisted {\n\t\t\tget { return GetHoistedVariable ((AnonymousExpression) null) != null; }\n\t\t}\n\t}\n\n\t//\n\t// Resolved reference to a local variable\n\t//\n\tpublic class LocalVariableReference : VariableReference\n\t{\n\t\tpublic LocalVariable local_info;\n\n\t\tpublic LocalVariableReference (LocalVariable li, Location l)\n\t\t{\n\t\t\tthis.local_info = li;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic override VariableInfo VariableInfo {\n\t\t\tget { return local_info.VariableInfo; }\n\t\t}\n\n\t\tpublic override HoistedVariable GetHoistedVariable (AnonymousExpression ae)\n\t\t{\n\t\t\treturn local_info.HoistedVariant;\n\t\t}\n\n\t\t#region Properties\n\n\t\t//\t\t\n\t\t// A local variable is always fixed\n\t\t//\n\t\tpublic override bool IsFixed {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsLockedByStatement {\n\t\t\tget {\n\t\t\t\treturn local_info.IsLocked;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tlocal_info.IsLocked = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsRef {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget { return local_info.Name; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tVariableInfo variable_info = VariableInfo;\n\t\t\tif (variable_info == null)\n\t\t\t\treturn;\n\n\t\t\tif (fc.IsDefinitelyAssigned (variable_info))\n\t\t\t\treturn;\n\n\t\t\tfc.Report.Error (165, loc, \"Use of unassigned local variable `{0}'\", Name);\n\t\t\tvariable_info.SetAssigned (fc.DefiniteAssignment, true);\n\t\t}\n\n\t\tpublic override void SetHasAddressTaken ()\n\t\t{\n\t\t\tlocal_info.SetHasAddressTaken ();\n\t\t}\n\n\t\tvoid DoResolveBase (ResolveContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// If we are referencing a variable from the external block\n\t\t\t// flag it for capturing\n\t\t\t//\n\t\t\tif (ec.MustCaptureVariable (local_info)) {\n\t\t\t\tif (local_info.AddressTaken) {\n\t\t\t\t\tAnonymousMethodExpression.Error_AddressOfCapturedVar (ec, this, loc);\n\t\t\t\t} else if (local_info.IsFixed) {\n\t\t\t\t\tec.Report.Error (1764, loc,\n\t\t\t\t\t\t\"Cannot use fixed local `{0}' inside an anonymous method, lambda expression or query expression\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (ec.IsVariableCapturingRequired) {\n\t\t\t\t\tAnonymousMethodStorey storey = local_info.Block.Explicit.CreateAnonymousMethodStorey (ec);\n\t\t\t\t\tstorey.CaptureLocalVariable (ec, local_info);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\ttype = local_info.Type;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tlocal_info.SetIsUsed ();\n\n\t\t\tDoResolveBase (ec);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression rhs)\n\t\t{\n\t\t\t//\n\t\t\t// Don't be too pedantic when variable is used as out param or for some broken code\n\t\t\t// which uses property/indexer access to run some initialization\n\t\t\t//\n\t\t\tif (rhs == EmptyExpression.OutAccess || rhs.eclass == ExprClass.PropertyAccess || rhs.eclass == ExprClass.IndexerAccess)\n\t\t\t\tlocal_info.SetIsUsed ();\n\n\t\t\tif (local_info.IsReadonly && !ec.HasAny (ResolveContext.Options.FieldInitializerScope | ResolveContext.Options.UsingInitializerScope)) {\n\t\t\t\tif (rhs == EmptyExpression.LValueMemberAccess) {\n\t\t\t\t\t// CS1654 already reported\n\t\t\t\t} else {\n\t\t\t\t\tint code;\n\t\t\t\t\tstring msg;\n\t\t\t\t\tif (rhs == EmptyExpression.OutAccess) {\n\t\t\t\t\t\tcode = 1657; msg = \"Cannot pass `{0}' as a ref or out argument because it is a `{1}'\";\n\t\t\t\t\t} else if (rhs == EmptyExpression.LValueMemberOutAccess) {\n\t\t\t\t\t\tcode = 1655; msg = \"Cannot pass members of `{0}' as ref or out arguments because it is a `{1}'\";\n\t\t\t\t\t} else if (rhs == EmptyExpression.UnaryAddress) {\n\t\t\t\t\t\tcode = 459; msg = \"Cannot take the address of {1} `{0}'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcode = 1656; msg = \"Cannot assign to `{0}' because it is a `{1}'\";\n\t\t\t\t\t}\n\t\t\t\t\tec.Report.Error (code, loc, msg, Name, local_info.GetReadOnlyContext ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (eclass == ExprClass.Unresolved)\n\t\t\t\tDoResolveBase (ec);\n\n\t\t\treturn base.DoResolveLValue (ec, rhs);\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn local_info.GetHashCode ();\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tLocalVariableReference lvr = obj as LocalVariableReference;\n\t\t\tif (lvr == null)\n\t\t\t\treturn false;\n\n\t\t\treturn local_info == lvr.local_info;\n\t\t}\n\n\t\tprotected override ILocalVariable Variable {\n\t\t\tget { return local_info; }\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"{0} ({1}:{2})\", GetType (), Name, loc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\t// Nothing\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   This represents a reference to a parameter in the intermediate\n\t///   representation.\n\t/// </summary>\n\tpublic class ParameterReference : VariableReference\n\t{\n\t\tprotected ParametersBlock.ParameterInfo pi;\n\n\t\tpublic ParameterReference (ParametersBlock.ParameterInfo pi, Location loc)\n\t\t{\n\t\t\tthis.pi = pi;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override bool IsLockedByStatement {\n\t\t\tget {\n\t\t\t\treturn pi.IsLocked;\n\t\t\t}\n\t\t\tset\t{\n\t\t\t\tpi.IsLocked = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsRef {\n\t\t\tget { return (pi.Parameter.ModFlags & Parameter.Modifier.RefOutMask) != 0; }\n\t\t}\n\n\t\tbool HasOutModifier {\n\t\t\tget { return (pi.Parameter.ModFlags & Parameter.Modifier.OUT) != 0; }\n\t\t}\n\n\t\tpublic override HoistedVariable GetHoistedVariable (AnonymousExpression ae)\n\t\t{\n\t\t\treturn pi.Parameter.HoistedVariant;\n\t\t}\n\n\t\t//\n\t\t// A ref or out parameter is classified as a moveable variable, even \n\t\t// if the argument given for the parameter is a fixed variable\n\t\t//\t\t\n\t\tpublic override bool IsFixed {\n\t\t\tget { return !IsRef; }\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget { return Parameter.Name; }\n\t\t}\n\n\t\tpublic Parameter Parameter {\n\t\t\tget { return pi.Parameter; }\n\t\t}\n\n\t\tpublic override VariableInfo VariableInfo {\n\t\t\tget { return pi.VariableInfo; }\n\t\t}\n\n\t\tprotected override ILocalVariable Variable {\n\t\t\tget { return Parameter; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\t//\n\t\t\t// ParameterReferences might already be a reference\n\t\t\t//\n\t\t\tif (IsRef) {\n\t\t\t\tEmitLoad (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.AddressOf (ec, mode);\n\t\t}\n\n\t\tpublic override void SetHasAddressTaken ()\n\t\t{\n\t\t\tParameter.HasAddressTaken = true;\n\t\t}\n\n\t\tbool DoResolveBase (ResolveContext ec)\n\t\t{\n\t\t\tif (eclass != ExprClass.Unresolved)\n\t\t\t\treturn true;\n\n\t\t\ttype = pi.ParameterType;\n\t\t\teclass = ExprClass.Variable;\n\n\t\t\t//\n\t\t\t// If we are referencing a parameter from the external block\n\t\t\t// flag it for capturing\n\t\t\t//\n\t\t\tif (ec.MustCaptureVariable (pi)) {\n\t\t\t\tif (Parameter.HasAddressTaken)\n\t\t\t\t\tAnonymousMethodExpression.Error_AddressOfCapturedVar (ec, this, loc);\n\n\t\t\t\tif (IsRef) {\n\t\t\t\t\tec.Report.Error (1628, loc,\n\t\t\t\t\t\t\"Parameter `{0}' cannot be used inside `{1}' when using `ref' or `out' modifier\",\n\t\t\t\t\t\tName, ec.CurrentAnonymousMethod.ContainerType);\n\t\t\t\t}\n\n\t\t\t\tif (ec.IsVariableCapturingRequired && !pi.Block.ParametersBlock.IsExpressionTree) {\n\t\t\t\t\tAnonymousMethodStorey storey = pi.Block.Explicit.CreateAnonymousMethodStorey (ec);\n\t\t\t\t\tstorey.CaptureParameter (ec, pi, this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn Name.GetHashCode ();\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tParameterReference pr = obj as ParameterReference;\n\t\t\tif (pr == null)\n\t\t\t\treturn false;\n\n\t\t\treturn Name == pr.Name;\n\t\t}\n\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\t// Nothing to clone\n\t\t\treturn;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tHoistedVariable hv = GetHoistedVariable (ec);\n\t\t\tif (hv != null)\n\t\t\t\treturn hv.CreateExpressionTree ();\n\n\t\t\treturn Parameter.ExpressionTreeVariableReference ();\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (!DoResolveBase (ec))\n\t\t\t\treturn null;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tif (!DoResolveBase (ec))\n\t\t\t\treturn null;\n\n\t\t\tif (Parameter.HoistedVariant != null)\n\t\t\t\tParameter.HoistedVariant.IsAssigned = true;\n\n\t\t\treturn base.DoResolveLValue (ec, right_side);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tVariableInfo variable_info = VariableInfo;\n\t\t\tif (variable_info == null)\n\t\t\t\treturn;\n\n\t\t\tif (fc.IsDefinitelyAssigned (variable_info))\n\t\t\t\treturn;\n\n\t\t\tfc.Report.Error (269, loc, \"Use of unassigned out parameter `{0}'\", Name);\n\t\t\tfc.SetVariableAssigned (variable_info);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Invocation of methods or delegates.\n\t/// </summary>\n\tpublic class Invocation : ExpressionStatement\n\t{\n\t\tpublic class Predefined : Invocation\n\t\t{\n\t\t\tpublic Predefined (MethodGroupExpr expr, Arguments arguments)\n\t\t\t\t: base (expr, arguments)\n\t\t\t{\n\t\t\t\tthis.mg = expr;\n\t\t\t}\n\n\t\t\tprotected override MethodGroupExpr DoResolveOverload (ResolveContext rc)\n\t\t\t{\n\t\t\t\tif (!rc.IsObsolete) {\n\t\t\t\t\tvar member = mg.BestCandidate;\n\t\t\t\t\tObsoleteAttribute oa = member.GetAttributeObsolete ();\n\t\t\t\t\tif (oa != null)\n\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, member.GetSignatureForError (), loc, rc.Report);\n\t\t\t\t}\n\n\t\t\t\treturn mg;\n\t\t\t}\n\t\t}\n\n\t\tprotected Arguments arguments;\n\t\tprotected Expression expr;\n\t\tprotected MethodGroupExpr mg;\n\t\tbool conditional_access_receiver;\n\t\t\n\t\tpublic Invocation (Expression expr, Arguments arguments)\n\t\t{\n\t\t\tthis.expr = expr;\t\t\n\t\t\tthis.arguments = arguments;\n\t\t\tif (expr != null) {\n\t\t\t\tloc = expr.Location;\n\t\t\t}\n\t\t}\n\n\t\t#region Properties\n\t\tpublic Arguments Arguments {\n\t\t\tget {\n\t\t\t\treturn arguments;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Expression Exp {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodGroupExpr MethodGroup {\n\t\t\tget {\n\t\t\t\treturn mg;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn expr.StartLocation;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override MethodGroupExpr CanReduceLambda (AnonymousMethodBody body)\n\t\t{\n\t\t\tif (MethodGroup == null)\n\t\t\t\treturn null;\n\n\t\t\tvar candidate = MethodGroup.BestCandidate;\n\t\t\tif (candidate == null || !(candidate.IsStatic || Exp is This))\n\t\t\t\treturn null;\n\n\t\t\tvar args_count = arguments == null ? 0 : arguments.Count;\n\t\t\tif (args_count != body.Parameters.Count)\n\t\t\t\treturn null;\n\n\t\t\tvar lambda_parameters = body.Block.Parameters.FixedParameters;\n\t\t\tfor (int i = 0; i < args_count; ++i) {\n\t\t\t\tvar pr = arguments[i].Expr as ParameterReference;\n\t\t\t\tif (pr == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (lambda_parameters[i] != pr.Parameter)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif ((lambda_parameters[i].ModFlags & Parameter.Modifier.RefOutMask) != (pr.Parameter.ModFlags & Parameter.Modifier.RefOutMask))\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar emg = MethodGroup as ExtensionMethodGroupExpr;\n\t\t\tif (emg != null) {\n\t\t\t\tvar mg = MethodGroupExpr.CreatePredefined (candidate, candidate.DeclaringType, MethodGroup.Location);\n\t\t\t\tif (candidate.IsGeneric) {\n\t\t\t\t\tvar targs = new TypeExpression [candidate.Arity];\n\t\t\t\t\tfor (int i = 0; i < targs.Length; ++i) {\n\t\t\t\t\t\ttargs[i] = new TypeExpression (candidate.TypeArguments[i], MethodGroup.Location);\n\t\t\t\t\t}\n\n\t\t\t\t\tmg.SetTypeArguments (null, new TypeArguments (targs));\n\t\t\t\t}\n\n\t\t\t\treturn mg;\n\t\t\t}\n\n\t\t\treturn MethodGroup;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tInvocation target = (Invocation) t;\n\n\t\t\tif (arguments != null)\n\t\t\t\ttarget.arguments = arguments.Clone (clonectx);\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tif (arguments != null && arguments.ContainsEmitWithAwait ())\n\t\t\t\treturn true;\n\n\t\t\treturn mg.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tExpression instance = mg.IsInstance ?\n\t\t\t\tmg.InstanceExpression.CreateExpressionTree (ec) :\n\t\t\t\tnew NullLiteral (loc);\n\n\t\t\tvar args = Arguments.CreateForExpressionTree (ec, arguments,\n\t\t\t\tinstance,\n\t\t\t\tmg.CreateExpressionTree (ec));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Call\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tif (!rc.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {\n\t\t\t\tif (expr.HasConditionalAccess ()) {\n\t\t\t\t\tconditional_access_receiver = true;\n\t\t\t\t\tusing (rc.Set (ResolveContext.Options.ConditionalAccessReceiver)) {\n\t\t\t\t\t\treturn DoResolveInvocation (rc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn DoResolveInvocation (rc);\n\t\t}\n\n\t\tExpression DoResolveInvocation (ResolveContext ec)\n\t\t{\n\t\t\tExpression member_expr;\n\t\t\tvar atn = expr as ATypeNameExpression;\n\t\t\tif (atn != null) {\n\t\t\t\tmember_expr = atn.LookupNameExpression (ec, MemberLookupRestrictions.InvocableOnly | MemberLookupRestrictions.ReadAccess);\n\t\t\t\tif (member_expr != null) {\n\t\t\t\t\tvar name_of = member_expr as NameOf;\n\t\t\t\t\tif (name_of != null) {\n\t\t\t\t\t\treturn name_of.ResolveOverload (ec, arguments);\n\t\t\t\t\t}\n\n\t\t\t\t\tmember_expr = member_expr.Resolve (ec);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmember_expr = expr.Resolve (ec);\n\t\t\t}\n\n\t\t\tif (member_expr == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Next, evaluate all the expressions in the argument list\n\t\t\t//\n\t\t\tbool dynamic_arg = false;\n\t\t\tif (arguments != null)\n\t\t\t\targuments.Resolve (ec, out dynamic_arg);\n\n\t\t\tTypeSpec expr_type = member_expr.Type;\n\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\treturn DoResolveDynamic (ec, member_expr);\n\n\t\t\tmg = member_expr as MethodGroupExpr;\n\t\t\tExpression invoke = null;\n\n\t\t\tif (mg == null) {\n\t\t\t\tif (expr_type != null && expr_type.IsDelegate) {\n\t\t\t\t\tinvoke = new DelegateInvocation (member_expr, arguments, conditional_access_receiver, loc);\n\t\t\t\t\tinvoke = invoke.Resolve (ec);\n\t\t\t\t\tif (invoke == null || !dynamic_arg)\n\t\t\t\t\t\treturn invoke;\n\t\t\t\t} else {\n\t\t\t\t\tif (member_expr is RuntimeValueExpression) {\n\t\t\t\t\t\tec.Report.Error (Report.RuntimeErrorId, loc, \"Cannot invoke a non-delegate type `{0}'\",\n\t\t\t\t\t\t\tmember_expr.Type.GetSignatureForError ());\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tMemberExpr me = member_expr as MemberExpr;\n\t\t\t\t\tif (me == null) {\n\t\t\t\t\t\tmember_expr.Error_UnexpectedKind (ec, ResolveFlags.MethodGroup, loc);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tec.Report.Error (1955, loc, \"The member `{0}' cannot be used as method or delegate\",\n\t\t\t\t\t\t\tmember_expr.GetSignatureForError ());\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (invoke == null) {\n\t\t\t\tmg = DoResolveOverload (ec);\n\t\t\t\tif (mg == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (dynamic_arg)\n\t\t\t\treturn DoResolveDynamic (ec, member_expr);\n\n\t\t\tvar method = mg.BestCandidate;\n\t\t\ttype = mg.BestCandidateReturnType;\n\t\t\tif (conditional_access_receiver)\n\t\t\t\ttype = LiftMemberType (ec, type);\n\n\t\t\tif (arguments == null && method.DeclaringType.BuiltinType == BuiltinTypeSpec.Type.Object && method.Name == Destructor.MetadataName) {\n\t\t\t\tif (mg.IsBase)\n\t\t\t\t\tec.Report.Error (250, loc, \"Do not directly call your base class Finalize method. It is called automatically from your destructor\");\n\t\t\t\telse\n\t\t\t\t\tec.Report.Error (245, loc, \"Destructors and object.Finalize cannot be called directly. Consider calling IDisposable.Dispose if available\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tIsSpecialMethodInvocation (ec, method, loc);\n\t\t\t\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected virtual Expression DoResolveDynamic (ResolveContext ec, Expression memberExpr)\n\t\t{\n\t\t\tArguments args;\n\t\t\tDynamicMemberBinder dmb = memberExpr as DynamicMemberBinder;\n\t\t\tif (dmb != null) {\n\t\t\t\targs = dmb.Arguments;\n\t\t\t\tif (arguments != null)\n\t\t\t\t\targs.AddRange (arguments);\n\t\t\t} else if (mg == null) {\n\t\t\t\tif (arguments == null)\n\t\t\t\t\targs = new Arguments (1);\n\t\t\t\telse\n\t\t\t\t\targs = arguments;\n\n\t\t\t\targs.Insert (0, new Argument (memberExpr));\n\t\t\t\tthis.expr = null;\n\t\t\t} else {\n\t\t\t\tif (mg.IsBase) {\n\t\t\t\t\tec.Report.Error (1971, loc,\n\t\t\t\t\t\t\"The base call to method `{0}' cannot be dynamically dispatched. Consider casting the dynamic arguments or eliminating the base access\",\n\t\t\t\t\t\tmg.Name);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (arguments == null)\n\t\t\t\t\targs = new Arguments (1);\n\t\t\t\telse\n\t\t\t\t\targs = arguments;\n\n\t\t\t\tMemberAccess ma = expr as MemberAccess;\n\t\t\t\tif (ma != null) {\n\t\t\t\t\tvar inst = mg.InstanceExpression;\n\t\t\t\t\tvar left_type = inst as TypeExpr;\n\t\t\t\t\tif (left_type != null) {\n\t\t\t\t\t\targs.Insert (0, new Argument (new TypeOf (left_type.Type, loc).Resolve (ec), Argument.AType.DynamicTypeName));\n\t\t\t\t\t} else if (inst != null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Any value type has to be pass as by-ref to get back the same\n\t\t\t\t\t\t// instance on which the member was called\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar mod = inst is IMemoryLocation && TypeSpec.IsValueType (inst.Type) ?\n\t\t\t\t\t\t\tArgument.AType.Ref : Argument.AType.None;\n\t\t\t\t\t\targs.Insert (0, new Argument (inst.Resolve (ec), mod));\n\t\t\t\t\t}\n\t\t\t\t} else {\t// is SimpleName\n\t\t\t\t\tif (ec.IsStatic) {\n\t\t\t\t\t\targs.Insert (0, new Argument (new TypeOf (ec.CurrentType, loc).Resolve (ec), Argument.AType.DynamicTypeName));\n\t\t\t\t\t} else {\n\t\t\t\t\t\targs.Insert (0, new Argument (new This (loc).Resolve (ec)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new DynamicInvocation (expr as ATypeNameExpression, args, loc).Resolve (ec);\n\t\t}\n\n\t\tprotected virtual MethodGroupExpr DoResolveOverload (ResolveContext ec)\n\t\t{\n\t\t\treturn mg.OverloadResolve (ec, ref arguments, null, OverloadResolver.Restrictions.None);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (mg.IsConditionallyExcluded)\n\t\t\t\treturn;\n\n  \t\t\tmg.FlowAnalysis (fc);\n\n\t\t\tif (arguments != null)\n\t\t\t\targuments.FlowAnalysis (fc);\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tfc.ConditionalAccessEnd ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn mg.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override bool HasConditionalAccess ()\n\t\t{\n\t\t\treturn expr.HasConditionalAccess ();\n\t\t}\n\n\t\t//\n\t\t// If a member is a method or event, or if it is a constant, field or property of either a delegate type\n\t\t// or the type dynamic, then the member is invocable\n\t\t//\n\t\tpublic static bool IsMemberInvocable (MemberSpec member)\n\t\t{\n\t\t\tswitch (member.Kind) {\n\t\t\tcase MemberKind.Event:\n\t\t\t\treturn true;\n\t\t\tcase MemberKind.Field:\n\t\t\tcase MemberKind.Property:\n\t\t\t\tvar m = member as IInterfaceMemberSpec;\n\t\t\t\treturn m.MemberType.IsDelegate || m.MemberType.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool IsSpecialMethodInvocation (ResolveContext ec, MethodSpec method, Location loc)\n\t\t{\n\t\t\tif (!method.IsReservedMethod)\n\t\t\t\treturn false;\n\n\t\t\tif (ec.HasSet (ResolveContext.Options.InvokeSpecialName) || ec.CurrentMemberDefinition.IsCompilerGenerated)\n\t\t\t\treturn false;\n\n\t\t\tec.Report.SymbolRelatedToPreviousError (method);\n\t\t\tec.Report.Error (571, loc, \"`{0}': cannot explicitly call operator or accessor\",\n\t\t\t\tmethod.GetSignatureForError ());\n\t\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (mg.IsConditionallyExcluded)\n\t\t\t\treturn;\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tmg.EmitCall (ec, arguments, type, false);\n\t\t\telse\n\t\t\t\tmg.EmitCall (ec, arguments, false);\n\t\t}\n\t\t\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tif (mg.IsConditionallyExcluded)\n\t\t\t\treturn;\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tmg.EmitCall (ec, arguments, type, true);\n\t\t\telse\n\t\t\t\tmg.EmitCall (ec, arguments, true);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn MakeExpression (ctx, mg.InstanceExpression, mg.BestCandidate, arguments);\n\t\t}\n\n\t\tpublic static SLE.Expression MakeExpression (BuilderContext ctx, Expression instance, MethodSpec mi, Arguments args)\n\t\t{\n#if STATIC\n\t\t\tthrow new NotSupportedException ();\n#else\n\t\t\tvar instance_expr = instance == null ? null : instance.MakeExpression (ctx);\n\t\t\treturn SLE.Expression.Call (instance_expr, (MethodInfo) mi.GetMetaInfo (), Arguments.MakeExpression (args, ctx));\n#endif\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// Implements simple new expression \n\t//\n\tpublic class New : ExpressionStatement, IMemoryLocation\n\t{\n\t\tprotected Arguments arguments;\n\n\t\t//\n\t\t// During bootstrap, it contains the RequestedType,\n\t\t// but if `type' is not null, it *might* contain a NewDelegate\n\t\t// (because of field multi-initialization)\n\t\t//\n\t\tprotected Expression RequestedType;\n\n\t\tprotected MethodSpec method;\n\n\t\tpublic New (Expression requested_type, Arguments arguments, Location l)\n\t\t{\n\t\t\tRequestedType = requested_type;\n\t\t\tthis.arguments = arguments;\n\t\t\tloc = l;\n\t\t}\n\n\t\t#region Properties\n\t\tpublic Arguments Arguments {\n\t\t\tget {\n\t\t\t\treturn arguments;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression TypeRequested {\n\t\t\tget {\n\t\t\t\treturn RequestedType;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true for resolved `new S()'\n\t\t//\n\t\tpublic bool IsDefaultStruct {\n\t\t\tget {\n\t\t\t\treturn arguments == null && type.IsStruct && GetType () == typeof (New);\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn RequestedType;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Converts complex core type syntax like 'new int ()' to simple constant\n\t\t/// </summary>\n\t\tpublic static Constant Constantify (TypeSpec t, Location loc)\n\t\t{\n\t\t\tswitch (t.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\treturn new IntConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\treturn new UIntConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\treturn new LongConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\treturn new ULongConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\treturn new FloatConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\treturn new DoubleConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\treturn new ShortConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\treturn new UShortConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\treturn new SByteConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\treturn new ByteConstant (t, 0, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\treturn new CharConstant (t, '\\0', loc);\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\treturn new BoolConstant (t, false, loc);\n\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\treturn new DecimalConstant (t, 0, loc);\n\t\t\t}\n\n\t\t\tif (t.IsEnum)\n\t\t\t\treturn new EnumConstant (Constantify (EnumSpec.GetUnderlyingType (t), loc), t);\n\n\t\t\tif (t.IsNullableType)\n\t\t\t\treturn Nullable.LiftedNull.Create (t, loc);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn arguments != null && arguments.ContainsEmitWithAwait ();\n\t\t}\n\n\t\t//\n\t\t// Checks whether the type is an interface that has the\n\t\t// [ComImport, CoClass] attributes and must be treated\n\t\t// specially\n\t\t//\n\t\tpublic Expression CheckComImport (ResolveContext ec)\n\t\t{\n\t\t\tif (!type.IsInterface)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Turn the call into:\n\t\t\t// (the-interface-stated) (new class-referenced-in-coclassattribute ())\n\t\t\t//\n\t\t\tvar real_class = type.MemberDefinition.GetAttributeCoClass ();\n\t\t\tif (real_class == null)\n\t\t\t\treturn null;\n\n\t\t\tNew proxy = new New (new TypeExpression (real_class, loc), arguments, loc);\n\t\t\tCast cast = new Cast (new TypeExpression (type, loc), proxy, loc);\n\t\t\treturn cast.Resolve (ec);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args;\n\t\t\tif (method == null) {\n\t\t\t\targs = new Arguments (1);\n\t\t\t\targs.Add (new Argument (new TypeOf (type, loc)));\n\t\t\t} else {\n\t\t\t\targs = Arguments.CreateForExpressionTree (ec,\n\t\t\t\t\targuments, new TypeOfMethod (method, loc));\n\t\t\t}\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"New\", args);\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\ttype = RequestedType.ResolveAsType (ec);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tif (type.IsPointer) {\n\t\t\t\tec.Report.Error (1919, loc, \"Unsafe type `{0}' cannot be used in an object creation expression\",\n\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (arguments == null) {\n\t\t\t\tConstant c = Constantify (type, RequestedType.Location);\n\t\t\t\tif (c != null)\n\t\t\t\t\treturn ReducedExpression.Create (c, this);\n\t\t\t}\n\n\t\t\tif (type.IsDelegate) {\n\t\t\t\treturn (new NewDelegate (type, arguments, loc)).Resolve (ec);\n\t\t\t}\n\n\t\t\tvar tparam = type as TypeParameterSpec;\n\t\t\tif (tparam != null) {\n\t\t\t\t//\n\t\t\t\t// Check whether the type of type parameter can be constructed. BaseType can be a struct for method overrides\n\t\t\t\t// where type parameter constraint is inflated to struct\n\t\t\t\t//\n\t\t\t\tif ((tparam.SpecialConstraint & (SpecialConstraint.Struct | SpecialConstraint.Constructor)) == 0 && !TypeSpec.IsValueType (tparam)) {\n\t\t\t\t\tec.Report.Error (304, loc,\n\t\t\t\t\t\t\"Cannot create an instance of the variable type `{0}' because it does not have the new() constraint\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif ((arguments != null) && (arguments.Count != 0)) {\n\t\t\t\t\tec.Report.Error (417, loc,\n\t\t\t\t\t\t\"`{0}': cannot provide arguments when creating an instance of a variable type\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (type.IsStatic) {\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\tec.Report.Error (712, loc, \"Cannot create an instance of the static class `{0}'\", type.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (type.IsInterface || type.IsAbstract){\n\t\t\t\tif (!TypeManager.IsGenericType (type)) {\n\t\t\t\t\tRequestedType = CheckComImport (ec);\n\t\t\t\t\tif (RequestedType != null)\n\t\t\t\t\t\treturn RequestedType;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\tec.Report.Error (144, loc, \"Cannot create an instance of the abstract class or interface `{0}'\", type.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Any struct always defines parameterless constructor\n\t\t\t//\n\t\t\tif (type.IsStruct && arguments == null)\n\t\t\t\treturn this;\n\n\t\t\tbool dynamic;\n\t\t\tif (arguments != null) {\n\t\t\t\targuments.Resolve (ec, out dynamic);\n\t\t\t} else {\n\t\t\t\tdynamic = false;\n\t\t\t}\n\n\t\t\tmethod = ConstructorLookup (ec, type, ref arguments, loc);\n\n\t\t\tif (dynamic) {\n\t\t\t\targuments.Insert (0, new Argument (new TypeOf (type, loc).Resolve (ec), Argument.AType.DynamicTypeName));\n\t\t\t\treturn new DynamicConstructorBinder (type, arguments, loc).Resolve (ec);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tbool DoEmitTypeParameter (EmitContext ec)\n\t\t{\n\t\t\tvar m = ec.Module.PredefinedMembers.ActivatorCreateInstance.Resolve (loc);\n\t\t\tif (m == null)\n\t\t\t\treturn true;\n\n\t\t\tvar ctor_factory = m.MakeGenericMethod (ec.MemberContext, type);\n\t\t\tvar tparam = (TypeParameterSpec) type;\n\n\t\t\tif (tparam.IsReferenceType) {\n\t\t\t\tec.Emit (OpCodes.Call, ctor_factory);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Allow DoEmit() to be called multiple times.\n\t\t\t// We need to create a new LocalTemporary each time since\n\t\t\t// you can't share LocalBuilders among ILGeneators.\n\t\t\tLocalTemporary temp = new LocalTemporary (type);\n\n\t\t\tLabel label_activator = ec.DefineLabel ();\n\t\t\tLabel label_end = ec.DefineLabel ();\n\n\t\t\ttemp.AddressOf (ec, AddressOp.Store);\n\t\t\tec.Emit (OpCodes.Initobj, type);\n\n\t\t\ttemp.Emit (ec);\n\t\t\tec.Emit (OpCodes.Box, type);\n\t\t\tec.Emit (OpCodes.Brfalse, label_activator);\n\n\t\t\ttemp.AddressOf (ec, AddressOp.Store);\n\t\t\tec.Emit (OpCodes.Initobj, type);\n\t\t\ttemp.Emit (ec);\n\t\t\ttemp.Release (ec);\n\t\t\tec.Emit (OpCodes.Br_S, label_end);\n\n\t\t\tec.MarkLabel (label_activator);\n\n\t\t\tec.Emit (OpCodes.Call, ctor_factory);\n\t\t\tec.MarkLabel (label_end);\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// This Emit can be invoked in two contexts:\n\t\t//    * As a mechanism that will leave a value on the stack (new object)\n\t\t//    * As one that wont (init struct)\n\t\t//\n\t\t// If we are dealing with a ValueType, we have a few\n\t\t// situations to deal with:\n\t\t//\n\t\t//    * The target is a ValueType, and we have been provided\n\t\t//      the instance (this is easy, we are being assigned).\n\t\t//\n\t\t//    * The target of New is being passed as an argument,\n\t\t//      to a boxing operation or a function that takes a\n\t\t//      ValueType.\n\t\t//\n\t\t//      In this case, we need to create a temporary variable\n\t\t//      that is the argument of New.\n\t\t//\n\t\t// Returns whether a value is left on the stack\n\t\t//\n\t\t// *** Implementation note ***\n\t\t//\n\t\t// To benefit from this optimization, each assignable expression\n\t\t// has to manually cast to New and call this Emit.\n\t\t//\n\t\t// TODO: It's worth to implement it for arrays and fields\n\t\t//\n\t\tpublic virtual bool Emit (EmitContext ec, IMemoryLocation target)\n\t\t{\n\t\t\tbool is_value_type = TypeSpec.IsValueType (type);\n\t\t\tVariableReference vr = target as VariableReference;\n\n\t\t\tif (target != null && is_value_type && (vr != null || method == null)) {\n\t\t\t\ttarget.AddressOf (ec, AddressOp.Store);\n\t\t\t} else if (vr != null && vr.IsRef) {\n\t\t\t\tvr.EmitLoad (ec);\n\t\t\t}\n\n\t\t\tif (arguments != null) {\n\t\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && (arguments.Count > (this is NewInitialize ? 0 : 1)) && arguments.ContainsEmitWithAwait ())\n\t\t\t\t\targuments = arguments.Emit (ec, false, true);\n\n\t\t\t\targuments.Emit (ec);\n\t\t\t}\n\n\t\t\tif (is_value_type) {\n\t\t\t\tif (method == null) {\n\t\t\t\t\tec.Emit (OpCodes.Initobj, type);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (vr != null) {\n\t\t\t\t\tec.MarkCallEntry (loc);\n\t\t\t\t\tec.Emit (OpCodes.Call, method);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (type is TypeParameterSpec)\n\t\t\t\treturn DoEmitTypeParameter (ec);\n\n\t\t\tec.MarkCallEntry (loc);\n\t\t\tec.Emit (OpCodes.Newobj, method);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLocalTemporary v = null;\n\t\t\tif (method == null && TypeSpec.IsValueType (type)) {\n\t\t\t\t// TODO: Use temporary variable from pool\n\t\t\t\tv = new LocalTemporary (type);\n\t\t\t}\n\n\t\t\tif (!Emit (ec, v))\n\t\t\t\tv.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tLocalTemporary v = null;\n\t\t\tif (method == null && TypeSpec.IsValueType (type)) {\n\t\t\t\t// TODO: Use temporary variable from pool\n\t\t\t\tv = new LocalTemporary (type);\n\t\t\t}\n\n\t\t\tif (Emit (ec, v))\n\t\t\t\tec.Emit (OpCodes.Pop);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (arguments != null)\n\t\t\t\targuments.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tEmitAddressOf (ec, mode);\n\t\t}\n\n\t\tprotected virtual IMemoryLocation EmitAddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tLocalTemporary value_target = new LocalTemporary (type);\n\n\t\t\tif (type is TypeParameterSpec) {\n\t\t\t\tDoEmitTypeParameter (ec);\n\t\t\t\tvalue_target.Store (ec);\n\t\t\t\tvalue_target.AddressOf (ec, mode);\n\t\t\t\treturn value_target;\n\t\t\t}\n\n\t\t\tvalue_target.AddressOf (ec, AddressOp.Store);\n\n\t\t\tif (method == null) {\n\t\t\t\tec.Emit (OpCodes.Initobj, type);\n\t\t\t} else {\n\t\t\t\tif (arguments != null)\n\t\t\t\t\targuments.Emit (ec);\n\n\t\t\t\tec.Emit (OpCodes.Call, method);\n\t\t\t}\n\t\t\t\n\t\t\tvalue_target.AddressOf (ec, mode);\n\t\t\treturn value_target;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tNew target = (New) t;\n\n\t\t\ttarget.RequestedType = RequestedType.Clone (clonectx);\n\t\t\tif (arguments != null){\n\t\t\t\ttarget.arguments = arguments.Clone (clonectx);\n\t\t\t}\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn SLE.Expression.New ((ConstructorInfo) method.GetMetaInfo (), Arguments.MakeExpression (arguments, ctx));\n#endif\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// Array initializer expression, the expression is allowed in\n\t// variable or field initialization only which makes it tricky as\n\t// the type has to be infered based on the context either from field\n\t// type or variable type (think of multiple declarators)\n\t//\n\tpublic class ArrayInitializer : Expression\n\t{\n\t\tList<Expression> elements;\n\t\tBlockVariable variable;\n\n\t\tpublic ArrayInitializer (List<Expression> init, Location loc)\n\t\t{\n\t\t\telements = init;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic ArrayInitializer (int count, Location loc)\n\t\t\t: this (new List<Expression> (count), loc)\n\t\t{\n\t\t}\n\n\t\tpublic ArrayInitializer (Location loc)\n\t\t\t: this (4, loc)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic int Count {\n\t\t\tget { return elements.Count; }\n\t\t}\n\n\t\tpublic List<Expression> Elements {\n\t\t\tget {\n\t\t\t\treturn elements;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression this [int index] {\n\t\t\tget {\n\t\t\t\treturn elements [index];\n\t\t\t}\n\t\t}\n\n\t\tpublic BlockVariable VariableDeclaration {\n\t\t\tget {\n\t\t\t\treturn variable;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tvariable = value;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic void Add (Expression expr)\n\t\t{\n\t\t\telements.Add (expr);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tvar target = (ArrayInitializer) t;\n\n\t\t\ttarget.elements = new List<Expression> (elements.Count);\n\t\t\tforeach (var element in elements)\n\t\t\t\ttarget.elements.Add (element.Clone (clonectx));\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tvar current_field = rc.CurrentMemberDefinition as FieldBase;\n\t\t\tTypeExpression type;\n\t\t\tif (current_field != null && rc.CurrentAnonymousMethod == null) {\n\t\t\t\ttype = new TypeExpression (current_field.MemberType, current_field.Location);\n\t\t\t} else if (variable != null) {\n\t\t\t\tif (variable.TypeExpression is VarExpr) {\n\t\t\t\t\trc.Report.Error (820, loc, \"An implicitly typed local variable declarator cannot use an array initializer\");\n\t\t\t\t\treturn EmptyExpression.Null;\n\t\t\t\t}\n\n\t\t\t\ttype = new TypeExpression (variable.Variable.Type, variable.Variable.Location);\n\t\t\t} else {\n\t\t\t\tthrow new NotImplementedException (\"Unexpected array initializer context\");\n\t\t\t}\n\n\t\t\treturn new ArrayCreation (type, this).Resolve (rc);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new InternalErrorException (\"Missing Resolve call\");\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tthrow new InternalErrorException (\"Missing Resolve call\");\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   14.5.10.2: Represents an array creation expression.\n\t/// </summary>\n\t///\n\t/// <remarks>\n\t///   There are two possible scenarios here: one is an array creation\n\t///   expression that specifies the dimensions and optionally the\n\t///   initialization data and the other which does not need dimensions\n\t///   specified but where initialization data is mandatory.\n\t/// </remarks>\n\tpublic class ArrayCreation : Expression\n\t{\n\t\tFullNamedExpression requested_base_type;\n\t\tArrayInitializer initializers;\n\n\t\t//\n\t\t// The list of Argument types.\n\t\t// This is used to construct the `newarray' or constructor signature\n\t\t//\n\t\tprotected List<Expression> arguments;\n\t\t\n\t\tprotected TypeSpec array_element_type;\n\t\tint num_arguments;\n\t\tprotected int dimensions;\n\t\tprotected readonly ComposedTypeSpecifier rank;\n\t\tExpression first_emit;\n\t\tLocalTemporary first_emit_temp;\n\n\t\tprotected List<Expression> array_data;\n\n\t\tDictionary<int, int> bounds;\n\n#if STATIC\n\t\t// The number of constants in array initializers\n\t\tint const_initializers_count;\n\t\tbool only_constant_initializers;\n#endif\n\t\tpublic ArrayCreation (FullNamedExpression requested_base_type, List<Expression> exprs, ComposedTypeSpecifier rank, ArrayInitializer initializers, Location l)\n\t\t\t: this (requested_base_type, rank, initializers, l)\n\t\t{\n\t\t\targuments = exprs;\n\t\t\tnum_arguments = arguments.Count;\n\t\t}\n\n\t\t//\n\t\t// For expressions like int[] foo = new int[] { 1, 2, 3 };\n\t\t//\n\t\tpublic ArrayCreation (FullNamedExpression requested_base_type, ComposedTypeSpecifier rank, ArrayInitializer initializers, Location loc)\n\t\t{\n\t\t\tthis.requested_base_type = requested_base_type;\n\t\t\tthis.rank = rank;\n\t\t\tthis.initializers = initializers;\n\t\t\tthis.loc = loc;\n\n\t\t\tif (rank != null)\n\t\t\t\tnum_arguments = rank.Dimension;\n\t\t}\n\n\t\t//\n\t\t// For compiler generated single dimensional arrays only\n\t\t//\n\t\tpublic ArrayCreation (FullNamedExpression requested_base_type, ArrayInitializer initializers, Location loc)\n\t\t\t: this (requested_base_type, ComposedTypeSpecifier.SingleDimension, initializers, loc)\n\t\t{\n\t\t}\n\n\t\t//\n\t\t// For expressions like int[] foo = { 1, 2, 3 };\n\t\t//\n\t\tpublic ArrayCreation (FullNamedExpression requested_base_type, ArrayInitializer initializers)\n\t\t\t: this (requested_base_type, null, initializers, initializers.Location)\n\t\t{\n\t\t}\n\n\t\tpublic ComposedTypeSpecifier Rank {\n\t\t\tget {\n\t\t\t\treturn this.rank;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic FullNamedExpression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn this.requested_base_type;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ArrayInitializer Initializers {\n\t\t\tget {\n\t\t\t\treturn this.initializers;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic List<Expression> Arguments {\n\t\t\tget { return this.arguments; }\n\t\t}\n\t\t\n\t\tbool CheckIndices (ResolveContext ec, ArrayInitializer probe, int idx, bool specified_dims, int child_bounds)\n\t\t{\n\t\t\tif (initializers != null && bounds == null) {\n\t\t\t\t//\n\t\t\t\t// We use this to store all the data values in the order in which we\n\t\t\t\t// will need to store them in the byte blob later\n\t\t\t\t//\n\t\t\t\tarray_data = new List<Expression> (probe.Count);\n\t\t\t\tbounds = new Dictionary<int, int> ();\n\t\t\t}\n\n\t\t\tif (specified_dims) { \n\t\t\t\tExpression a = arguments [idx];\n\t\t\t\ta = a.Resolve (ec);\n\t\t\t\tif (a == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\ta = ConvertExpressionToArrayIndex (ec, a);\n\t\t\t\tif (a == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\targuments[idx] = a;\n\n\t\t\t\tif (initializers != null) {\n\t\t\t\t\tConstant c = a as Constant;\n\t\t\t\t\tif (c == null && a is ArrayIndexCast)\n\t\t\t\t\t\tc = ((ArrayIndexCast) a).Child as Constant;\n\n\t\t\t\t\tif (c == null) {\n\t\t\t\t\t\tec.Report.Error (150, a.Location, \"A constant value is expected\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tint value;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvalue = System.Convert.ToInt32 (c.GetValue ());\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tec.Report.Error (150, a.Location, \"A constant value is expected\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// TODO: probe.Count does not fit ulong in\n\t\t\t\t\tif (value != probe.Count) {\n\t\t\t\t\t\tec.Report.Error (847, loc, \"An array initializer of length `{0}' was expected\", value.ToString ());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbounds[idx] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (initializers == null)\n\t\t\t\treturn true;\n\n\t\t\tfor (int i = 0; i < probe.Count; ++i) {\n\t\t\t\tvar o = probe [i];\n\t\t\t\tif (o is ArrayInitializer) {\n\t\t\t\t\tvar sub_probe = o as ArrayInitializer;\n\t\t\t\t\tif (idx + 1 >= dimensions){\n\t\t\t\t\t\tec.Report.Error (623, loc, \"Array initializers can only be used in a variable or field initializer. Try using a new expression instead\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// When we don't have explicitly specified dimensions, record whatever dimension we first encounter at each level\n\t\t\t\t\tif (!bounds.ContainsKey(idx + 1))\n\t\t\t\t\t\tbounds[idx + 1] = sub_probe.Count;\n\n\t\t\t\t\tif (bounds[idx + 1] != sub_probe.Count) {\n\t\t\t\t\t\tec.Report.Error(847, sub_probe.Location, \"An array initializer of length `{0}' was expected\", bounds[idx + 1].ToString());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbool ret = CheckIndices (ec, sub_probe, idx + 1, specified_dims, child_bounds - 1);\n\t\t\t\t\tif (!ret)\n\t\t\t\t\t\treturn false;\n\t\t\t\t} else if (child_bounds > 1) {\n\t\t\t\t\tec.Report.Error (846, o.Location, \"A nested array initializer was expected\");\n\t\t\t\t} else {\n\t\t\t\t\tExpression element = ResolveArrayElement (ec, o);\n\t\t\t\t\tif (element == null)\n\t\t\t\t\t\tcontinue;\n#if STATIC\n\t\t\t\t\t// Initializers with the default values can be ignored\n\t\t\t\t\tConstant c = element as Constant;\n\t\t\t\t\tif (c != null) {\n\t\t\t\t\t\tif (!c.IsDefaultInitializer (array_element_type)) {\n\t\t\t\t\t\t\t++const_initializers_count;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonly_constant_initializers = false;\n\t\t\t\t\t}\n#endif\t\t\t\t\t\n\t\t\t\t\tarray_data.Add (element);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tforeach (var arg in arguments) {\n\t\t\t\tif (arg.ContainsEmitWithAwait ())\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn InitializersContainAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args;\n\n\t\t\tif (array_data == null) {\n\t\t\t\targs = new Arguments (arguments.Count + 1);\n\t\t\t\targs.Add (new Argument (new TypeOf (array_element_type, loc)));\n\t\t\t\tforeach (Expression a in arguments)\n\t\t\t\t\targs.Add (new Argument (a.CreateExpressionTree (ec)));\n\n\t\t\t\treturn CreateExpressionFactoryCall (ec, \"NewArrayBounds\", args);\n\t\t\t}\n\n\t\t\tif (dimensions > 1) {\n\t\t\t\tec.Report.Error (838, loc, \"An expression tree cannot contain a multidimensional array initializer\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\targs = new Arguments (array_data == null ? 1 : array_data.Count + 1);\n\t\t\targs.Add (new Argument (new TypeOf (array_element_type, loc)));\n\t\t\tif (array_data != null) {\n\t\t\t\tfor (int i = 0; i < array_data.Count; ++i) {\n\t\t\t\t\tExpression e = array_data [i];\n\t\t\t\t\targs.Add (new Argument (e.CreateExpressionTree (ec)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"NewArrayInit\", args);\n\t\t}\t\t\n\t\t\n\t\tvoid UpdateIndices (ResolveContext rc)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tfor (var probe = initializers; probe != null;) {\n\t\t\t\tExpression e = new IntConstant (rc.BuiltinTypes, probe.Count, Location.Null);\n\t\t\t\targuments.Add (e);\n\t\t\t\tbounds[i++] = probe.Count;\n\n\t\t\t\tif (probe.Count > 0 && probe [0] is ArrayInitializer) {\n\t\t\t\t\tprobe = (ArrayInitializer) probe[0];\n\t\t\t\t} else if (dimensions > i) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override void Error_NegativeArrayIndex (ResolveContext ec, Location loc)\n\t\t{\n\t\t\tec.Report.Error (248, loc, \"Cannot create an array with a negative size\");\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tforeach (var arg in arguments)\n\t\t\t\targ.FlowAnalysis (fc);\n\n\t\t\tif (array_data != null) {\n\t\t\t\tforeach (var ad in array_data)\n\t\t\t\t\tad.FlowAnalysis (fc);\n\t\t\t}\n\t\t}\n\n\t\tbool InitializersContainAwait ()\n\t\t{\n\t\t\tif (array_data == null)\n\t\t\t\treturn false;\n\n\t\t\tforeach (var expr in array_data) {\n\t\t\t\tif (expr.ContainsEmitWithAwait ())\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected virtual Expression ResolveArrayElement (ResolveContext ec, Expression element)\n\t\t{\n\t\t\telement = element.Resolve (ec);\n\t\t\tif (element == null)\n\t\t\t\treturn null;\n\n\t\t\tif (element is CompoundAssign.TargetExpression) {\n\t\t\t\tif (first_emit != null)\n\t\t\t\t\tthrow new InternalErrorException (\"Can only handle one mutator at a time\");\n\t\t\t\tfirst_emit = element;\n\t\t\t\telement = first_emit_temp = new LocalTemporary (element.Type);\n\t\t\t}\n\n\t\t\treturn Convert.ImplicitConversionRequired (\n\t\t\t\tec, element, array_element_type, loc);\n\t\t}\n\n\t\tprotected bool ResolveInitializers (ResolveContext ec)\n\t\t{\n#if STATIC\n\t\t\tonly_constant_initializers = true;\n#endif\n\n\t\t\tif (arguments != null) {\n\t\t\t\tbool res = true;\n\t\t\t\tfor (int i = 0; i < arguments.Count; ++i) {\n\t\t\t\t\tres &= CheckIndices (ec, initializers, i, true, dimensions);\n\t\t\t\t\tif (initializers != null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\treturn res;\n\t\t\t}\n\n\t\t\targuments = new List<Expression> ();\n\n\t\t\tif (!CheckIndices (ec, initializers, 0, false, dimensions))\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\tUpdateIndices (ec);\n\t\t\t\t\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Resolved the type of the array\n\t\t//\n\t\tbool ResolveArrayType (ResolveContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Lookup the type\n\t\t\t//\n\t\t\tFullNamedExpression array_type_expr;\n\t\t\tif (num_arguments > 0) {\n\t\t\t\tarray_type_expr = new ComposedCast (requested_base_type, rank);\n\t\t\t} else {\n\t\t\t\tarray_type_expr = requested_base_type;\n\t\t\t}\n\n\t\t\ttype = array_type_expr.ResolveAsType (ec);\n\t\t\tif (array_type_expr == null)\n\t\t\t\treturn false;\n\n\t\t\tvar ac = type as ArrayContainer;\n\t\t\tif (ac == null) {\n\t\t\t\tec.Report.Error (622, loc, \"Can only use array initializer expressions to assign to array types. Try using a new expression instead\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tarray_element_type = ac.Element;\n\t\t\tdimensions = ac.Rank;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (type != null)\n\t\t\t\treturn this;\n\n\t\t\tif (!ResolveArrayType (ec))\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// validate the initializers and fill in any missing bits\n\t\t\t//\n\t\t\tif (!ResolveInitializers (ec))\n\t\t\t\treturn null;\n\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tbyte [] MakeByteBlob ()\n\t\t{\n\t\t\tint factor;\n\t\t\tbyte [] data;\n\t\t\tbyte [] element;\n\t\t\tint count = array_data.Count;\n\n\t\t\tTypeSpec element_type = array_element_type;\n\t\t\tif (element_type.IsEnum)\n\t\t\t\telement_type = EnumSpec.GetUnderlyingType (element_type);\n\n\t\t\tfactor = BuiltinTypeSpec.GetSize (element_type);\n\t\t\tif (factor == 0)\n\t\t\t\tthrow new Exception (\"unrecognized type in MakeByteBlob: \" + element_type);\n\n\t\t\tdata = new byte [(count * factor + 3) & ~3];\n\t\t\tint idx = 0;\n\n\t\t\tfor (int i = 0; i < count; ++i) {\n\t\t\t\tvar c = array_data[i] as Constant;\n\t\t\t\tif (c == null) {\n\t\t\t\t\tidx += factor;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tobject v = c.GetValue ();\n\n\t\t\t\tswitch (element_type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\t\tlong lval = (long) v;\n\n\t\t\t\t\tfor (int j = 0; j < factor; ++j) {\n\t\t\t\t\t\tdata[idx + j] = (byte) (lval & 0xFF);\n\t\t\t\t\t\tlval = (lval >> 8);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\t\tulong ulval = (ulong) v;\n\n\t\t\t\t\tfor (int j = 0; j < factor; ++j) {\n\t\t\t\t\t\tdata[idx + j] = (byte) (ulval & 0xFF);\n\t\t\t\t\t\tulval = (ulval >> 8);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\t\tvar fval = SingleConverter.SingleToInt32Bits((float) v);\n\n\t\t\t\t\tdata[idx] = (byte) (fval & 0xff);\n\t\t\t\t\tdata[idx + 1] = (byte) ((fval >> 8) & 0xff);\n\t\t\t\t\tdata[idx + 2] = (byte) ((fval >> 16) & 0xff);\n\t\t\t\t\tdata[idx + 3] = (byte) (fval >> 24);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\t\telement = BitConverter.GetBytes ((double) v);\n\n\t\t\t\t\tfor (int j = 0; j < factor; ++j)\n\t\t\t\t\t\tdata[idx + j] = element[j];\n\n\t\t\t\t\t// FIXME: Handle the ARM float format.\n\t\t\t\t\tif (!BitConverter.IsLittleEndian)\n\t\t\t\t\t\tSystem.Array.Reverse (data, idx, 8);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\t\tint chval = (int) ((char) v);\n\n\t\t\t\t\tdata[idx] = (byte) (chval & 0xff);\n\t\t\t\t\tdata[idx + 1] = (byte) (chval >> 8);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\t\tint sval = (int) ((short) v);\n\n\t\t\t\t\tdata[idx] = (byte) (sval & 0xff);\n\t\t\t\t\tdata[idx + 1] = (byte) (sval >> 8);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\t\tint usval = (int) ((ushort) v);\n\n\t\t\t\t\tdata[idx] = (byte) (usval & 0xff);\n\t\t\t\t\tdata[idx + 1] = (byte) (usval >> 8);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\t\tint val = (int) v;\n\n\t\t\t\t\tdata[idx] = (byte) (val & 0xff);\n\t\t\t\t\tdata[idx + 1] = (byte) ((val >> 8) & 0xff);\n\t\t\t\t\tdata[idx + 2] = (byte) ((val >> 16) & 0xff);\n\t\t\t\t\tdata[idx + 3] = (byte) (val >> 24);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\t\tuint uval = (uint) v;\n\n\t\t\t\t\tdata[idx] = (byte) (uval & 0xff);\n\t\t\t\t\tdata[idx + 1] = (byte) ((uval >> 8) & 0xff);\n\t\t\t\t\tdata[idx + 2] = (byte) ((uval >> 16) & 0xff);\n\t\t\t\t\tdata[idx + 3] = (byte) (uval >> 24);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\t\tdata[idx] = (byte) (sbyte) v;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\t\tdata[idx] = (byte) v;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\t\tdata[idx] = (byte) ((bool) v ? 1 : 0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\t\tint[] bits = Decimal.GetBits ((decimal) v);\n\t\t\t\t\tint p = idx;\n\n\t\t\t\t\t// FIXME: For some reason, this doesn't work on the MS runtime.\n\t\t\t\t\tint[] nbits = new int[4];\n\t\t\t\t\tnbits[0] = bits[3];\n\t\t\t\t\tnbits[1] = bits[2];\n\t\t\t\t\tnbits[2] = bits[0];\n\t\t\t\t\tnbits[3] = bits[1];\n\n\t\t\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\t\t\tdata[p++] = (byte) (nbits[j] & 0xff);\n\t\t\t\t\t\tdata[p++] = (byte) ((nbits[j] >> 8) & 0xff);\n\t\t\t\t\t\tdata[p++] = (byte) ((nbits[j] >> 16) & 0xff);\n\t\t\t\t\t\tdata[p++] = (byte) (nbits[j] >> 24);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception (\"Unrecognized type in MakeByteBlob: \" + element_type);\n\t\t\t\t}\n\n\t\t\t\tidx += factor;\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\tvar initializers = new SLE.Expression [array_data.Count];\n\t\t\tfor (var i = 0; i < initializers.Length; i++) {\n\t\t\t\tif (array_data [i] == null)\n\t\t\t\t\tinitializers [i] = SLE.Expression.Default (array_element_type.GetMetaInfo ());\n\t\t\t\telse\n\t\t\t\t\tinitializers [i] = array_data [i].MakeExpression (ctx);\n\t\t\t}\n\n\t\t\treturn SLE.Expression.NewArrayInit (array_element_type.GetMetaInfo (), initializers);\n#endif\n\t\t}\n#endif\n#if STATIC\n\t\t//\n\t\t// Emits the initializers for the array\n\t\t//\n\t\tvoid EmitStaticInitializers (EmitContext ec, FieldExpr stackArray)\n\t\t{\n\t\t\tvar m = ec.Module.PredefinedMembers.RuntimeHelpersInitializeArray.Resolve (loc);\n\t\t\tif (m == null)\n\t\t\t\treturn;\n\n\t\t\t//\n\t\t\t// First, the static data\n\t\t\t//\n\t\t\tbyte [] data = MakeByteBlob ();\n\t\t\tvar fb = ec.CurrentTypeDefinition.Module.MakeStaticData (data, loc);\n\n\t\t\tif (stackArray == null) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t} else {\n\t\t\t\tstackArray.Emit (ec);\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Ldtoken, fb);\n\t\t\tec.Emit (OpCodes.Call, m);\n\t\t}\n#endif\n\n\t\t//\n\t\t// Emits pieces of the array that can not be computed at compile\n\t\t// time (variables and string locations).\n\t\t//\n\t\t// This always expect the top value on the stack to be the array\n\t\t//\n\t\tvoid EmitDynamicInitializers (EmitContext ec, bool emitConstants, StackFieldExpr stackArray)\n\t\t{\n\t\t\tint dims = bounds.Count;\n\t\t\tvar current_pos = new int [dims];\n\n\t\t\tfor (int i = 0; i < array_data.Count; i++){\n\n\t\t\t\tExpression e = array_data [i];\n\t\t\t\tvar c = e as Constant;\n\n\t\t\t\t// Constant can be initialized via StaticInitializer\n\t\t\t\tif (c == null || (c != null && emitConstants && !c.IsDefaultInitializer (array_element_type))) {\n\n\t\t\t\t\tvar etype = e.Type;\n\n\t\t\t\t\tif (stackArray != null) {\n\t\t\t\t\t\tif (e.ContainsEmitWithAwait ()) {\n\t\t\t\t\t\t\te = e.EmitToField (ec);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstackArray.EmitLoad (ec);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int idx = 0; idx < dims; idx++) \n\t\t\t\t\t\tec.EmitInt (current_pos [idx]);\n\n\t\t\t\t\t//\n\t\t\t\t\t// If we are dealing with a struct, get the\n\t\t\t\t\t// address of it, so we can store it.\n\t\t\t\t\t//\n\t\t\t\t\tif (dims == 1 && etype.IsStruct && !BuiltinTypeSpec.IsPrimitiveType (etype))\n\t\t\t\t\t\tec.Emit (OpCodes.Ldelema, etype);\n\n\t\t\t\t\te.Emit (ec);\n\n\t\t\t\t\tec.EmitArrayStore ((ArrayContainer) type);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// Advance counter\n\t\t\t\t//\n\t\t\t\tfor (int j = dims - 1; j >= 0; j--){\n\t\t\t\t\tcurrent_pos [j]++;\n\t\t\t\t\tif (current_pos [j] < bounds [j])\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcurrent_pos [j] = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (stackArray != null)\n\t\t\t\tstackArray.PrepareCleanup (ec);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tvar await_field = EmitToFieldSource (ec);\n\t\t\tif (await_field != null)\n\t\t\t\tawait_field.Emit (ec);\n\t\t}\n\n\t\tprotected sealed override FieldExpr EmitToFieldSource (EmitContext ec)\n\t\t{\n\t\t\tif (first_emit != null) {\n\t\t\t\tfirst_emit.Emit (ec);\n\t\t\t\tfirst_emit_temp.Store (ec);\n\t\t\t}\n\n\t\t\tStackFieldExpr await_stack_field;\n\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && InitializersContainAwait ()) {\n\t\t\t\tawait_stack_field = ec.GetTemporaryField (type);\n\t\t\t\tec.EmitThis ();\n\t\t\t} else {\n\t\t\t\tawait_stack_field = null;\n\t\t\t}\n\n\t\t\tEmitExpressionsList (ec, arguments);\n\n\t\t\tec.EmitArrayNew ((ArrayContainer) type);\n\t\t\t\n\t\t\tif (initializers == null)\n\t\t\t\treturn await_stack_field;\n\n\t\t\tif (await_stack_field != null)\n\t\t\t\tawait_stack_field.EmitAssignFromStack (ec);\n\n#if STATIC\n\t\t\t//\n\t\t\t// Emit static initializer for arrays which contain more than 2 items and\n\t\t\t// the static initializer will initialize at least 25% of array values or there\n\t\t\t// is more than 10 items to be initialized\n\t\t\t//\n\t\t\t// NOTE: const_initializers_count does not contain default constant values.\n\t\t\t//\n\t\t\tif (const_initializers_count > 2 && (array_data.Count > 10 || const_initializers_count * 4 > (array_data.Count)) &&\n\t\t\t\t(BuiltinTypeSpec.IsPrimitiveType (array_element_type) || array_element_type.IsEnum)) {\n\t\t\t\tEmitStaticInitializers (ec, await_stack_field);\n\n\t\t\t\tif (!only_constant_initializers)\n\t\t\t\t\tEmitDynamicInitializers (ec, false, await_stack_field);\n\t\t\t} else\n#endif\n\t\t\t{\n\t\t\t\tEmitDynamicInitializers (ec, true, await_stack_field);\n\t\t\t}\n\n\t\t\tif (first_emit_temp != null)\n\t\t\t\tfirst_emit_temp.Release (ec);\n\n\t\t\treturn await_stack_field;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\t// no multi dimensional or jagged arrays\n\t\t\tif (arguments.Count != 1 || array_element_type.IsArray) {\n\t\t\t\tbase.EncodeAttributeValue (rc, enc, targetType, parameterType);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// No array covariance, except for array -> object\n\t\t\tif (type != targetType) {\n\t\t\t\tif (targetType.BuiltinType != BuiltinTypeSpec.Type.Object) {\n\t\t\t\t\tbase.EncodeAttributeValue (rc, enc, targetType, parameterType);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (enc.Encode (type) == AttributeEncoder.EncodedTypeProperties.DynamicType) {\n\t\t\t\t\tAttribute.Error_AttributeArgumentIsDynamic (rc, loc);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Single dimensional array of 0 size\n\t\t\tif (array_data == null) {\n\t\t\t\tIntConstant ic = arguments[0] as IntConstant;\n\t\t\t\tif (ic == null || !ic.IsDefaultValue) {\n\t\t\t\t\tbase.EncodeAttributeValue (rc, enc, targetType, parameterType);\n\t\t\t\t} else {\n\t\t\t\t\tenc.Encode (0);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tenc.Encode (array_data.Count);\n\t\t\tforeach (var element in array_data) {\n\t\t\t\telement.EncodeAttributeValue (rc, enc, array_element_type, parameterType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tArrayCreation target = (ArrayCreation) t;\n\n\t\t\tif (requested_base_type != null)\n\t\t\t\ttarget.requested_base_type = (FullNamedExpression)requested_base_type.Clone (clonectx);\n\n\t\t\tif (arguments != null){\n\t\t\t\ttarget.arguments = new List<Expression> (arguments.Count);\n\t\t\t\tforeach (Expression e in arguments)\n\t\t\t\t\ttarget.arguments.Add (e.Clone (clonectx));\n\t\t\t}\n\n\t\t\tif (initializers != null)\n\t\t\t\ttarget.initializers = (ArrayInitializer) initializers.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\t\n\t//\n\t// Represents an implicitly typed array epxression\n\t//\n\tclass ImplicitlyTypedArrayCreation : ArrayCreation\n\t{\n\t\tTypeInferenceContext best_type_inference;\n\n\t\tpublic ImplicitlyTypedArrayCreation (ComposedTypeSpecifier rank, ArrayInitializer initializers, Location loc)\n\t\t\t: base (null, rank, initializers, loc)\n\t\t{\t\t\t\n\t\t}\n\n\t\tpublic ImplicitlyTypedArrayCreation (ArrayInitializer initializers, Location loc)\n\t\t\t: base (null, initializers, loc)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (type != null)\n\t\t\t\treturn this;\n\n\t\t\tdimensions = rank.Dimension;\n\n\t\t\tbest_type_inference = new TypeInferenceContext ();\n\n\t\t\tif (!ResolveInitializers (ec))\n\t\t\t\treturn null;\n\n\t\t\tbest_type_inference.FixAllTypes (ec);\n\t\t\tarray_element_type = best_type_inference.InferredTypeArguments[0];\n\t\t\tbest_type_inference = null;\n\n\t\t\tif (array_element_type == null ||\n\t\t\t\tarray_element_type == InternalType.NullLiteral || array_element_type == InternalType.MethodGroup || array_element_type == InternalType.AnonymousMethod ||\n\t\t\t\targuments.Count != rank.Dimension) {\n\t\t\t\tec.Report.Error (826, loc,\n\t\t\t\t\t\"The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// At this point we found common base type for all initializer elements\n\t\t\t// but we have to be sure that all static initializer elements are of\n\t\t\t// same type\n\t\t\t//\n\t\t\tUnifyInitializerElement (ec);\n\n\t\t\ttype = ArrayContainer.MakeType (ec.Module, array_element_type, dimensions);\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\t//\n\t\t// Converts static initializer only\n\t\t//\n\t\tvoid UnifyInitializerElement (ResolveContext ec)\n\t\t{\n\t\t\tfor (int i = 0; i < array_data.Count; ++i) {\n\t\t\t\tExpression e = array_data[i];\n\t\t\t\tif (e != null)\n\t\t\t\t\tarray_data [i] = Convert.ImplicitConversion (ec, e, array_element_type, Location.Null);\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression ResolveArrayElement (ResolveContext ec, Expression element)\n\t\t{\n\t\t\telement = element.Resolve (ec);\n\t\t\tif (element != null)\n\t\t\t\tbest_type_inference.AddCommonTypeBound (element.Type);\n\n\t\t\treturn element;\n\t\t}\n\t}\t\n\t\n\tsealed class CompilerGeneratedThis : This\n\t{\n\t\tpublic CompilerGeneratedThis (TypeSpec type, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\teclass = ExprClass.Variable;\n\n\t\t\tvar block = rc.CurrentBlock;\n\t\t\tif (block != null) {\n\t\t\t\tvar top = block.ParametersBlock.TopBlock;\n\t\t\t\tif (top.ThisVariable != null)\n\t\t\t\t\tvariable_info = top.ThisVariable.VariableInfo;\n\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\treturn DoResolve (rc);\n\t\t}\n\n\t\tpublic override HoistedVariable GetHoistedVariable (AnonymousExpression ae)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t///   Represents the `this' construct\n\t/// </summary>\n\n\tpublic class This : VariableReference\n\t{\n\t\tsealed class ThisVariable : ILocalVariable\n\t\t{\n\t\t\tpublic static readonly ILocalVariable Instance = new ThisVariable ();\n\n\t\t\tpublic void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tec.EmitThis ();\n\t\t\t}\n\n\t\t\tpublic void EmitAssign (EmitContext ec)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException ();\n\t\t\t}\n\n\t\t\tpublic void EmitAddressOf (EmitContext ec)\n\t\t\t{\n\t\t\t\tec.EmitThis ();\n\t\t\t}\n\t\t}\n\n\t\tprotected VariableInfo variable_info;\n\n\t\tpublic This (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override string Name {\n\t\t\tget { return \"this\"; }\n\t\t}\n\n\t\tpublic override bool IsLockedByStatement {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tset {\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsRef {\n\t\t\tget { return type.IsStruct; }\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tprotected override ILocalVariable Variable {\n\t\t\tget { return ThisVariable.Instance; }\n\t\t}\n\n\t\tpublic override VariableInfo VariableInfo {\n\t\t\tget { return variable_info; }\n\t\t}\n\n\t\tpublic override bool IsFixed {\n\t\t\tget { return false; }\n\t\t}\n\n\t\t#endregion\n\n\t\tvoid CheckStructThisDefiniteAssignment (FlowAnalysisContext fc)\n\t\t{\n\t\t\t//\n\t\t\t// It's null for all cases when we don't need to check `this'\n\t\t\t// definitive assignment\n\t\t\t//\n\t\t\tif (variable_info == null)\n\t\t\t\treturn;\n\n\t\t\tif (fc.IsDefinitelyAssigned (variable_info))\n\t\t\t\treturn;\n\n\t\t\tfc.Report.Error (188, loc, \"The `this' object cannot be used before all of its fields are assigned to\");\n\t\t}\n\n\t\tprotected virtual void Error_ThisNotAvailable (ResolveContext ec)\n\t\t{\n\t\t\tif (ec.IsStatic && !ec.HasSet (ResolveContext.Options.ConstantScope)) {\n\t\t\t\tec.Report.Error (26, loc, \"Keyword `this' is not valid in a static property, static method, or static field initializer\");\n\t\t\t} else if (ec.CurrentAnonymousMethod != null) {\n\t\t\t\tec.Report.Error (1673, loc,\n\t\t\t\t\t\"Anonymous methods inside structs cannot access instance members of `this'. \" +\n\t\t\t\t\t\"Consider copying `this' to a local variable outside the anonymous method and using the local instead\");\n\t\t\t} else {\n\t\t\t\tec.Report.Error (27, loc, \"Keyword `this' is not available in the current context\");\n\t\t\t}\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tCheckStructThisDefiniteAssignment (fc);\n\t\t}\n\n\t\tpublic override HoistedVariable GetHoistedVariable (AnonymousExpression ae)\n\t\t{\n\t\t\tif (ae == null)\n\t\t\t\treturn null;\n\n\t\t\tAnonymousMethodStorey storey = ae.Storey;\n\t\t\treturn storey != null ? storey.HoistedThis : null;\n\t\t}\n\n\t\tpublic static bool IsThisAvailable (ResolveContext ec, bool ignoreAnonymous)\n\t\t{\n\t\t\tif (ec.IsStatic || ec.HasAny (ResolveContext.Options.FieldInitializerScope | ResolveContext.Options.BaseInitializer | ResolveContext.Options.ConstantScope))\n\t\t\t\treturn false;\n\n\t\t\tif (ignoreAnonymous || ec.CurrentAnonymousMethod == null)\n\t\t\t\treturn true;\n\n\t\t\tif (ec.CurrentType.IsStruct && !(ec.CurrentAnonymousMethod is StateMachineInitializer))\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic virtual void ResolveBase (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Variable;\n\t\t\ttype = ec.CurrentType;\n\n\t\t\tif (!IsThisAvailable (ec, false)) {\n\t\t\t\tError_ThisNotAvailable (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar block = ec.CurrentBlock;\n\t\t\tif (block != null) {\n\t\t\t\tvar top = block.ParametersBlock.TopBlock;\n\t\t\t\tif (top.ThisVariable != null)\n\t\t\t\t\tvariable_info = top.ThisVariable.VariableInfo;\n\n\t\t\t\tAnonymousExpression am = ec.CurrentAnonymousMethod;\n\t\t\t\tif (am != null && ec.IsVariableCapturingRequired && !block.Explicit.HasCapturedThis) {\n\t\t\t\t\t//\n\t\t\t\t\t// Hoisted this is almost like hoisted variable but not exactly. When\n\t\t\t\t\t// there is no variable hoisted we can simply emit an instance method\n\t\t\t\t\t// without lifting this into a storey. Unfotunatelly this complicates\n\t\t\t\t\t// things in other cases because we don't know where this will be hoisted\n\t\t\t\t\t// until top-level block is fully resolved\n\t\t\t\t\t//\n\t\t\t\t\ttop.AddThisReferenceFromChildrenBlock (block.Explicit);\n\t\t\t\t\tam.SetHasThisAccess ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tResolveBase (ec);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tif (eclass == ExprClass.Unresolved)\n\t\t\t\tResolveBase (ec);\n\n\t\t\tif (type.IsClass){\n\t\t\t\tif (right_side == EmptyExpression.UnaryAddress)\n\t\t\t\t\tec.Report.Error (459, loc, \"Cannot take the address of `this' because it is read-only\");\n\t\t\t\telse if (right_side == EmptyExpression.OutAccess)\n\t\t\t\t\tec.Report.Error (1605, loc, \"Cannot pass `this' as a ref or out argument because it is read-only\");\n\t\t\t\telse\n\t\t\t\t\tec.Report.Error (1604, loc, \"Cannot assign to `this' because it is read-only\");\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tThis t = obj as This;\n\t\t\tif (t == null)\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\t// Nothing\n\t\t}\n\n\t\tpublic override void SetHasAddressTaken ()\n\t\t{\n\t\t\t// Nothing\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Represents the `__arglist' construct\n\t/// </summary>\n\tpublic class ArglistAccess : Expression\n\t{\n\t\tpublic ArglistAccess (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\t// nothing.\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Variable;\n\t\t\ttype = ec.Module.PredefinedTypes.RuntimeArgumentHandle.Resolve ();\n\n\t\t\tif (ec.HasSet (ResolveContext.Options.FieldInitializerScope) || !ec.CurrentBlock.ParametersBlock.Parameters.HasArglist) {\n\t\t\t\tec.Report.Error (190, loc,\n\t\t\t\t\t\"The __arglist construct is valid only within a variable argument method\");\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (OpCodes.Arglist);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Represents the `__arglist (....)' construct\n\t/// </summary>\n\tpublic class Arglist : Expression\n\t{\n\t\tArguments arguments;\n\n\t\tpublic Arglist (Location loc)\n\t\t\t: this (null, loc)\n\t\t{\n\t\t}\n\n\t\tpublic Arglist (Arguments args, Location l)\n\t\t{\n\t\t\targuments = args;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Arguments Arguments {\n\t\t\tget {\n\t\t\t\treturn arguments;\n\t\t\t}\n\t\t}\n\n\t\tpublic MetaType[] ArgumentTypes {\n\t\t    get {\n\t\t\t\tif (arguments == null)\n\t\t\t\t\treturn MetaType.EmptyTypes;\n\n\t\t\t\tvar retval = new MetaType[arguments.Count];\n\t\t\t\tfor (int i = 0; i < retval.Length; i++)\n\t\t\t\t\tretval[i] = arguments[i].Expr.Type.GetMetaInfo ();\n\n\t\t        return retval;\n\t\t    }\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (1952, loc, \"An expression tree cannot contain a method with variable arguments\");\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Variable;\n\t\t\ttype = InternalType.Arglist;\n\t\t\tif (arguments != null) {\n\t\t\t\tbool dynamic;\t// Can be ignored as there is always only 1 overload\n\t\t\t\targuments.Resolve (ec, out dynamic);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (arguments != null)\n\t\t\t\targuments.Emit (ec);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tArglist target = (Arglist) t;\n\n\t\t\tif (arguments != null)\n\t\t\t\ttarget.arguments = arguments.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class RefValueExpr : ShimExpression, IAssignMethod\n\t{\n\t\tFullNamedExpression texpr;\n\t\t\n\t\tpublic FullNamedExpression FullNamedExpression {\n\t\t\tget { return texpr;}\n\t\t}\n\t\t\n\t\tpublic RefValueExpr (Expression expr, FullNamedExpression texpr, Location loc)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.texpr = texpr;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic FullNamedExpression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn texpr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\texpr = expr.Resolve (rc);\n\t\t\ttype = texpr.ResolveAsType (rc);\n\t\t\tif (expr == null || type == null)\n\t\t\t\treturn null;\n\n\t\t\texpr = Convert.ImplicitConversionRequired (rc, expr, rc.Module.PredefinedTypes.TypedReference.Resolve (), loc);\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\treturn DoResolve (rc);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\texpr.Emit (ec);\n\t\t\tec.Emit (OpCodes.Refanyval, type);\n\t\t\tec.EmitLoadFromPtr (type);\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\texpr.Emit (ec);\n\t\t\tec.Emit (OpCodes.Refanyval, type);\n\t\t\tsource.Emit (ec);\n\n\t\t\tLocalTemporary temporary = null;\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\ttemporary = new LocalTemporary (source.Type);\n\t\t\t\ttemporary.Store (ec);\n\t\t\t}\n\n\t\t\tec.EmitStoreFromPtr (type);\n\n\t\t\tif (temporary != null) {\n\t\t\t\ttemporary.Emit (ec);\n\t\t\t\ttemporary.Release (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class RefTypeExpr : ShimExpression\n\t{\n\t\tpublic RefTypeExpr (Expression expr, Location loc)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\texpr = expr.Resolve (rc);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\texpr = Convert.ImplicitConversionRequired (rc, expr, rc.Module.PredefinedTypes.TypedReference.Resolve (), loc);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\ttype = rc.BuiltinTypes.Type;\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\texpr.Emit (ec);\n\t\t\tec.Emit (OpCodes.Refanytype);\n\t\t\tvar m = ec.Module.PredefinedMembers.TypeGetTypeFromHandle.Resolve (loc);\n\t\t\tif (m != null)\n\t\t\t\tec.Emit (OpCodes.Call, m);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class MakeRefExpr : ShimExpression\n\t{\n\t\tpublic MakeRefExpr (Expression expr, Location loc)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\texpr = expr.ResolveLValue (rc, EmptyExpression.LValueMemberAccess);\n\t\t\ttype = rc.Module.PredefinedTypes.TypedReference.Resolve ();\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t((IMemoryLocation) expr).AddressOf (ec, AddressOp.Load);\n\t\t\tec.Emit (OpCodes.Mkrefany, expr.Type);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements the typeof operator\n\t/// </summary>\n\tpublic class TypeOf : Expression {\n\t\tFullNamedExpression QueriedType;\n\t\tTypeSpec typearg;\n\n\t\tpublic TypeOf (FullNamedExpression queried_type, Location l)\n\t\t{\n\t\t\tQueriedType = queried_type;\n\t\t\tloc = l;\n\t\t}\n\n\t\t//\n\t\t// Use this constructor for any compiler generated typeof expression\n\t\t//\n\t\tpublic TypeOf (TypeSpec type, Location loc)\n\t\t{\n\t\t\tthis.typearg = type;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec TypeArgument {\n\t\t\tget {\n\t\t\t\treturn typearg;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn QueriedType;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tTypeOf target = (TypeOf) t;\n\t\t\tif (QueriedType != null)\n\t\t\t\ttarget.QueriedType = (FullNamedExpression) QueriedType.Clone (clonectx);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (this));\n\t\t\targs.Add (new Argument (new TypeOf (new TypeExpression (type, loc), loc)));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Constant\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (eclass != ExprClass.Unresolved)\n\t\t\t\treturn this;\n\n\t\t\tif (typearg == null) {\n\t\t\t\t//\n\t\t\t\t// Pointer types are allowed without explicit unsafe, they are just tokens\n\t\t\t\t//\n\t\t\t\tusing (ec.Set (ResolveContext.Options.UnsafeScope)) {\n\t\t\t\t\ttypearg = QueriedType.ResolveAsType (ec, true);\n\t\t\t\t}\n\n\t\t\t\tif (typearg == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (typearg.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tec.Report.Error (1962, QueriedType.Location,\n\t\t\t\t\t\t\"The typeof operator cannot be used on the dynamic type\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttype = ec.BuiltinTypes.Type;\n\n\t\t\t// Even though what is returned is a type object, it's treated as a value by the compiler.\n\t\t\t// In particular, 'typeof (Foo).X' is something totally different from 'Foo.X'.\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tstatic bool ContainsDynamicType (TypeSpec type)\n\t\t{\n\t\t\tif (type.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\treturn true;\n\n\t\t\tvar element_container = type as ElementTypeSpec;\n\t\t\tif (element_container != null)\n\t\t\t\treturn ContainsDynamicType (element_container.Element);\n\n\t\t\tforeach (var t in type.TypeArguments) {\n\t\t\t\tif (ContainsDynamicType (t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType, TypeSpec parameterType)\n\t\t{\n\t\t\t// Target type is not System.Type therefore must be object\n\t\t\t// and we need to use different encoding sequence\n\t\t\tif (targetType != type)\n\t\t\t\tenc.Encode (type);\n\n\t\t\tif (typearg is InflatedTypeSpec) {\n\t\t\t\tvar gt = typearg;\n\t\t\t\tdo {\n\t\t\t\t\tif (InflatedTypeSpec.ContainsTypeParameter (gt)) {\n\t\t\t\t\t\trc.Module.Compiler.Report.Error (416, loc, \"`{0}': an attribute argument cannot use type parameters\",\n\t\t\t\t\t\t\ttypearg.GetSignatureForError ());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tgt = gt.DeclaringType;\n\t\t\t\t} while (gt != null);\n\t\t\t}\n\n\t\t\tif (ContainsDynamicType (typearg)) {\n\t\t\t\tAttribute.Error_AttributeArgumentIsDynamic (rc, loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tenc.EncodeTypeName (typearg);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (OpCodes.Ldtoken, typearg);\n\t\t\tvar m = ec.Module.PredefinedMembers.TypeGetTypeFromHandle.Resolve (loc);\n\t\t\tif (m != null)\n\t\t\t\tec.Emit (OpCodes.Call, m);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tsealed class TypeOfMethod : TypeOfMember<MethodSpec>\n\t{\n\t\tpublic TypeOfMethod (MethodSpec method, Location loc)\n\t\t\t: base (method, loc)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (member.IsConstructor) {\n\t\t\t\ttype = ec.Module.PredefinedTypes.ConstructorInfo.Resolve ();\n\t\t\t} else {\n\t\t\t\ttype = ec.Module.PredefinedTypes.MethodInfo.Resolve ();\n\t\t\t}\n\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (OpCodes.Ldtoken, member);\n\n\t\t\tbase.Emit (ec);\n\t\t\tec.Emit (OpCodes.Castclass, type);\n\t\t}\n\n\t\tprotected override PredefinedMember<MethodSpec> GetTypeFromHandle (EmitContext ec)\n\t\t{\n\t\t\treturn ec.Module.PredefinedMembers.MethodInfoGetMethodFromHandle;\n\t\t}\n\n\t\tprotected override PredefinedMember<MethodSpec> GetTypeFromHandleGeneric (EmitContext ec)\n\t\t{\n\t\t\treturn ec.Module.PredefinedMembers.MethodInfoGetMethodFromHandle2;\n\t\t}\n\t}\n\n\tabstract class TypeOfMember<T> : Expression where T : MemberSpec\n\t{\n\t\tprotected readonly T member;\n\n\t\tprotected TypeOfMember (T member, Location loc)\n\t\t{\n\t\t\tthis.member = member;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (this));\n\t\t\targs.Add (new Argument (new TypeOf (type, loc)));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Constant\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbool is_generic = member.DeclaringType.IsGenericOrParentIsGeneric;\n\t\t\tPredefinedMember<MethodSpec> p;\n\t\t\tif (is_generic) {\n\t\t\t\tp = GetTypeFromHandleGeneric (ec);\n\t\t\t\tec.Emit (OpCodes.Ldtoken, member.DeclaringType);\n\t\t\t} else {\n\t\t\t\tp = GetTypeFromHandle (ec);\n\t\t\t}\n\n\t\t\tvar mi = p.Resolve (loc);\n\t\t\tif (mi != null)\n\t\t\t\tec.Emit (OpCodes.Call, mi);\n\t\t}\n\n\t\tprotected abstract PredefinedMember<MethodSpec> GetTypeFromHandle (EmitContext ec);\n\t\tprotected abstract PredefinedMember<MethodSpec> GetTypeFromHandleGeneric (EmitContext ec);\n\t}\n\n\tsealed class TypeOfField : TypeOfMember<FieldSpec>\n\t{\n\t\tpublic TypeOfField (FieldSpec field, Location loc)\n\t\t\t: base (field, loc)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\ttype = ec.Module.PredefinedTypes.FieldInfo.Resolve ();\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (OpCodes.Ldtoken, member);\n\t\t\tbase.Emit (ec);\n\t\t}\n\n\t\tprotected override PredefinedMember<MethodSpec> GetTypeFromHandle (EmitContext ec)\n\t\t{\n\t\t\treturn ec.Module.PredefinedMembers.FieldInfoGetFieldFromHandle;\n\t\t}\n\n\t\tprotected override PredefinedMember<MethodSpec> GetTypeFromHandleGeneric (EmitContext ec)\n\t\t{\n\t\t\treturn ec.Module.PredefinedMembers.FieldInfoGetFieldFromHandle2;\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements the sizeof expression\n\t/// </summary>\n\tpublic class SizeOf : Expression {\n\t\treadonly Expression texpr;\n\t\tTypeSpec type_queried;\n\t\t\n\t\tpublic SizeOf (Expression queried_type, Location l)\n\t\t{\n\t\t\tthis.texpr = queried_type;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic override bool IsSideEffectFree {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn texpr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tError_PointerInsideExpressionTree (ec);\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\ttype_queried = texpr.ResolveAsType (ec);\n\t\t\tif (type_queried == null)\n\t\t\t\treturn null;\n\n\t\t\tif (type_queried.IsEnum)\n\t\t\t\ttype_queried = EnumSpec.GetUnderlyingType (type_queried);\n\n\t\t\tint size_of = BuiltinTypeSpec.GetSize (type_queried);\n\t\t\tif (size_of > 0) {\n\t\t\t\treturn new IntConstant (ec.BuiltinTypes, size_of, loc);\n\t\t\t}\n\n\t\t\tif (!TypeManager.VerifyUnmanaged (ec.Module, type_queried, loc)){\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (!ec.IsUnsafe) {\n\t\t\t\tec.Report.Error (233, loc,\n\t\t\t\t\t\"`{0}' does not have a predefined size, therefore sizeof can only be used in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf)\",\n\t\t\t\t\ttype_queried.GetSignatureForError ());\n\t\t\t}\n\t\t\t\n\t\t\ttype = ec.BuiltinTypes.Int;\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (OpCodes.Sizeof, type_queried);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements the qualified-alias-member (::) expression.\n\t/// </summary>\n\tpublic class QualifiedAliasMember : MemberAccess\n\t{\n\t\tpublic readonly string alias;\n\t\tpublic static readonly string GlobalAlias = \"global\";\n\n\t\tpublic QualifiedAliasMember (string alias, string identifier, Location l)\n\t\t\t: base (null, identifier, l)\n\t\t{\n\t\t\tthis.alias = alias;\n\t\t}\n\n\t\tpublic QualifiedAliasMember (string alias, string identifier, TypeArguments targs, Location l)\n\t\t\t: base (null, identifier, targs, l)\n\t\t{\n\t\t\tthis.alias = alias;\n\t\t}\n\n\t\tpublic QualifiedAliasMember (string alias, string identifier, int arity, Location l)\n\t\t\t: base (null, identifier, arity, l)\n\t\t{\n\t\t\tthis.alias = alias;\n\t\t}\n\n\t\tpublic string Alias {\n\t\t\tget {\n\t\t\t\treturn alias;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression CreateExpressionFromAlias (IMemberContext mc)\n\t\t{\n\t\t\tif (alias == GlobalAlias)\n\t\t\t\treturn new NamespaceExpression (mc.Module.GlobalRootNamespace, loc);\n\n\t\t\tint errors = mc.Module.Compiler.Report.Errors;\n\t\t\tvar expr = mc.LookupNamespaceAlias (alias);\n\t\t\tif (expr == null) {\n\t\t\t\tif (errors == mc.Module.Compiler.Report.Errors)\n\t\t\t\t\tmc.Module.Compiler.Report.Error (432, loc, \"Alias `{0}' not found\", alias);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tpublic override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\texpr = CreateExpressionFromAlias (mc);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\treturn base.ResolveAsTypeOrNamespace (mc, allowUnboundTypeArguments);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\treturn ResolveAsTypeOrNamespace (rc, false);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tstring name = Name;\n\t\t\tif (targs != null) {\n\t\t\t\tname = Name + \"<\" + targs.GetSignatureForError () + \">\";\n\t\t\t}\n\n\t\t\treturn alias + \"::\" + name;\n\t\t}\n\n\t\tpublic override bool HasConditionalAccess ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression LookupNameExpression (ResolveContext rc, MemberLookupRestrictions restrictions)\n\t\t{\n\t\t\tif ((restrictions & MemberLookupRestrictions.InvocableOnly) != 0) {\n\t\t\t\trc.Module.Compiler.Report.Error (687, loc,\n\t\t\t\t\t\"The namespace alias qualifier `::' cannot be used to invoke a method. Consider using `.' instead\",\n\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn DoResolve (rc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\t// Nothing \n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements the member access expression\n\t/// </summary>\n\tpublic class MemberAccess : ATypeNameExpression\n\t{\n\t\tprotected Expression expr;\n\t\t\n\t\tpublic MemberAccess (Expression expr, string id)\n\t\t\t: base (id, expr.Location)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t}\n\n\t\tpublic MemberAccess (Expression expr, string identifier, Location loc)\n\t\t\t: base (identifier, loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t}\n\n\t\tpublic MemberAccess (Expression expr, string identifier, TypeArguments args, Location loc)\n\t\t\t: base (identifier, args, loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t}\n\n\t\tpublic MemberAccess (Expression expr, string identifier, int arity, Location loc)\n\t\t\t: base (identifier, arity, loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t}\n\n\t\tpublic Expression LeftExpression {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn expr == null ? loc : expr.StartLocation;\n\t\t\t}\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tvar e = LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess);\n\t\t\tif (e != null)\n\t\t\t\te = e.Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.Type | ResolveFlags.MethodGroup);\n\n\t\t\treturn e;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression rhs)\n\t\t{\n\t\t\tvar e = LookupNameExpression (rc, MemberLookupRestrictions.None);\n\n\t\t\tif (e is TypeExpr) {\n\t\t\t\te.Error_UnexpectedKind (rc, ResolveFlags.VariableOrValue, loc);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (e != null)\n\t\t\t\te = e.ResolveLValue (rc, rhs);\n\n\t\t\treturn e;\n\t\t}\n\n\t\tprotected virtual void Error_OperatorCannotBeApplied (ResolveContext rc, TypeSpec type)\n\t\t{\n\t\t\tif (type == InternalType.NullLiteral && rc.IsRuntimeBinder)\n\t\t\t\trc.Report.Error (Report.RuntimeErrorId, loc, \"Cannot perform member binding on `null' value\");\n\t\t\telse\n\t\t\t\texpr.Error_OperatorCannotBeApplied (rc, loc, \".\", type);\n\t\t}\n\n\t\tpublic override bool HasConditionalAccess ()\n\t\t{\n\t\t\treturn LeftExpression.HasConditionalAccess ();\n\t\t}\n\n\t\tpublic static bool IsValidDotExpression (TypeSpec type)\n\t\t{\n\t\t\tconst MemberKind dot_kinds = MemberKind.Class | MemberKind.Struct | MemberKind.Delegate | MemberKind.Enum |\n\t\t\t\tMemberKind.Interface | MemberKind.TypeParameter | MemberKind.ArrayType;\n\n\t\t\treturn (type.Kind & dot_kinds) != 0 || type.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\t\t}\n\n\t\tpublic override Expression LookupNameExpression (ResolveContext rc, MemberLookupRestrictions restrictions)\n\t\t{\n\t\t\tvar sn = expr as SimpleName;\n\t\t\tconst ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;\n\n\t\t\tif (sn != null) {\n\t\t\t\texpr = sn.LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess | MemberLookupRestrictions.ExactArity);\n\n\t\t\t\t//\n\t\t\t\t// Resolve expression which does have type set as we need expression type\n\t\t\t\t// with disable flow analysis as we don't know whether left side expression\n\t\t\t\t// is used as variable or type\n\t\t\t\t//\n\t\t\t\tif (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess || expr is EventExpr) {\n\t\t\t\t\texpr = expr.Resolve (rc);\n\t\t\t\t} else if (expr is TypeParameterExpr) {\n\t\t\t\t\texpr.Error_UnexpectedKind (rc, flags, sn.Location);\n\t\t\t\t\texpr = null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tusing (rc.Set (ResolveContext.Options.ConditionalAccessReceiver)) {\n\t\t\t\t\texpr = expr.Resolve (rc, flags);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tvar ns = expr as NamespaceExpression;\n\t\t\tif (ns != null) {\n\t\t\t\tvar retval = ns.LookupTypeOrNamespace (rc, Name, Arity, LookupMode.Normal, loc);\n\n\t\t\t\tif (retval == null) {\n\t\t\t\t\tns.Error_NamespaceDoesNotExist (rc, Name, Arity);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (HasTypeArguments)\n\t\t\t\t\treturn new GenericTypeExpr (retval.Type, targs, loc);\n\n\t\t\t\treturn retval;\n\t\t\t}\n\n\t\t\tMemberExpr me;\n\t\t\tTypeSpec expr_type = expr.Type;\n\t\t\tif (expr_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tme = expr as MemberExpr;\n\t\t\t\tif (me != null)\n\t\t\t\t\tme.ResolveInstanceExpression (rc, null);\n\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (expr));\n\t\t\t\treturn new DynamicMemberBinder (Name, args, loc);\n\t\t\t}\n\n\t\t\tvar cma = this as ConditionalMemberAccess;\n\t\t\tif (cma != null) {\n\t\t\t\tif (!IsNullPropagatingValid (expr.Type)) {\n\t\t\t\t\texpr.Error_OperatorCannotBeApplied (rc, loc, \"?\", expr.Type);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (expr_type.IsNullableType) {\n\t\t\t\t\texpr = Nullable.Unwrap.Create (expr, true).Resolve (rc);\n\t\t\t\t\texpr_type = expr.Type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!IsValidDotExpression (expr_type)) {\n\t\t\t\tError_OperatorCannotBeApplied (rc, expr_type);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar lookup_arity = Arity;\n\t\t\tbool errorMode = false;\n\t\t\tExpression member_lookup;\n\t\t\twhile (true) {\n\t\t\t\tmember_lookup = MemberLookup (rc, errorMode, expr_type, Name, lookup_arity, restrictions, loc);\n\t\t\t\tif (member_lookup == null) {\n\t\t\t\t\t//\n\t\t\t\t\t// Try to look for extension method when member lookup failed\n\t\t\t\t\t//\n\t\t\t\t\tif (MethodGroupExpr.IsExtensionMethodArgument (expr)) {\n\t\t\t\t\t\tvar methods = rc.LookupExtensionMethod (expr_type, Name, lookup_arity);\n\t\t\t\t\t\tif (methods != null) {\n\t\t\t\t\t\t\tvar emg = new ExtensionMethodGroupExpr (methods, expr, loc);\n\t\t\t\t\t\t\tif (HasTypeArguments) {\n\t\t\t\t\t\t\t\tif (!targs.Resolve (rc))\n\t\t\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t\t\temg.SetTypeArguments (rc, targs);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (cma != null)\n\t\t\t\t\t\t\t\temg.ConditionalAccess = true;\n\n\t\t\t\t\t\t\t// TODO: it should really skip the checks bellow\n\t\t\t\t\t\t\treturn emg.Resolve (rc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (errorMode) {\n\t\t\t\t\tif (member_lookup == null) {\n\t\t\t\t\t\tvar dep = expr_type.GetMissingDependencies ();\n\t\t\t\t\t\tif (dep != null) {\n\t\t\t\t\t\t\tImportedTypeDefinition.Error_MissingDependency (rc, dep, loc);\n\t\t\t\t\t\t} else if (expr is TypeExpr) {\n\t\t\t\t\t\t\tbase.Error_TypeDoesNotContainDefinition (rc, expr_type, Name);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tError_TypeDoesNotContainDefinition (rc, expr_type, Name);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (member_lookup is MethodGroupExpr || member_lookup is PropertyExpr) {\n\t\t\t\t\t\t// Leave it to overload resolution to report correct error\n\t\t\t\t\t} else if (!(member_lookup is TypeExpr)) {\n\t\t\t\t\t\t// TODO: rc.SymbolRelatedToPreviousError\n\t\t\t\t\t\tErrorIsInaccesible (rc, member_lookup.GetSignatureForError (), loc);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (member_lookup != null)\n\t\t\t\t\tbreak;\n\n\t\t\t\tlookup_arity = 0;\n\t\t\t\trestrictions &= ~MemberLookupRestrictions.InvocableOnly;\n\t\t\t\terrorMode = true;\n\t\t\t}\n\n\t\t\tTypeExpr texpr = member_lookup as TypeExpr;\n\t\t\tif (texpr != null) {\n\t\t\t\tif (!(expr is TypeExpr) && (sn == null || expr.ProbeIdenticalTypeName (rc, expr, sn) == expr)) {\n\t\t\t\t\trc.Report.Error (572, loc, \"`{0}': cannot reference a type through an expression. Consider using `{1}' instead\",\n\t\t\t\t\t\tName, texpr.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (!texpr.Type.IsAccessible (rc)) {\n\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (member_lookup.Type);\n\t\t\t\t\tErrorIsInaccesible (rc, member_lookup.Type.GetSignatureForError (), loc);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (HasTypeArguments) {\n\t\t\t\t\treturn new GenericTypeExpr (member_lookup.Type, targs, loc);\n\t\t\t\t}\n\n\t\t\t\treturn member_lookup;\n\t\t\t}\n\n\t\t\tme = member_lookup as MemberExpr;\n\n\t\t\tif (sn != null && me.IsStatic && (expr = me.ProbeIdenticalTypeName (rc, expr, sn)) != expr) {\n\t\t\t\tsn = null;\n\t\t\t}\n\n\t\t\tif (cma != null) {\n\t\t\t\tme.ConditionalAccess = true;\n\t\t\t}\n\n\t\t\tme = me.ResolveMemberAccess (rc, expr, sn);\n\n\t\t\tif (Arity > 0) {\n\t\t\t\tif (!targs.Resolve (rc))\n\t\t\t\t\treturn null;\n\n\t\t\t\tme.SetTypeArguments (rc, targs);\n\t\t\t}\n\n\t\t\treturn me;\n\t\t}\n\n\t\tpublic override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext rc, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\tFullNamedExpression fexpr = expr as FullNamedExpression;\n\t\t\tif (fexpr == null) {\n\t\t\t\texpr.ResolveAsType (rc);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tFullNamedExpression expr_resolved = fexpr.ResolveAsTypeOrNamespace (rc, allowUnboundTypeArguments);\n\n\t\t\tif (expr_resolved == null)\n\t\t\t\treturn null;\n\n\t\t\tvar ns = expr_resolved as NamespaceExpression;\n\t\t\tif (ns != null) {\n\t\t\t\tFullNamedExpression retval = ns.LookupTypeOrNamespace (rc, Name, Arity, LookupMode.Normal, loc);\n\n\t\t\t\tif (retval == null) {\n\t\t\t\t\tns.Error_NamespaceDoesNotExist (rc, Name, Arity);\n\t\t\t\t} else if (Arity > 0) {\n\t\t\t\t\tif (HasTypeArguments) {\n\t\t\t\t\t\tretval = new GenericTypeExpr (retval.Type, targs, loc);\n\t\t\t\t\t\tif (retval.ResolveAsType (rc) == null)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!allowUnboundTypeArguments)\n\t\t\t\t\t\t\tError_OpenGenericTypeIsNotAllowed (rc);\n\n\t\t\t\t\t\tretval = new GenericOpenTypeExpr (retval.Type, loc);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn retval;\n\t\t\t}\n\n\t\t\tvar tnew_expr = expr_resolved.ResolveAsType (rc);\n\t\t\tif (tnew_expr == null)\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec expr_type = tnew_expr;\n\t\t\tif (TypeManager.IsGenericParameter (expr_type)) {\n\t\t\t\trc.Module.Compiler.Report.Error (704, loc, \"A nested type cannot be specified through a type parameter `{0}'\",\n\t\t\t\t\ttnew_expr.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar qam = this as QualifiedAliasMember;\n\t\t\tif (qam != null) {\n\t\t\t\trc.Module.Compiler.Report.Error (431, loc,\n\t\t\t\t\t\"Alias `{0}' cannot be used with `::' since it denotes a type. Consider replacing `::' with `.'\",\n\t\t\t\t\tqam.Alias);\n\n\t\t\t}\n\n\t\t\tTypeSpec nested = null;\n\t\t\twhile (expr_type != null) {\n\t\t\t\tnested = MemberCache.FindNestedType (expr_type, Name, Arity);\n\t\t\t\tif (nested == null) {\n\t\t\t\t\tif (expr_type == tnew_expr) {\n\t\t\t\t\t\tError_IdentifierNotFound (rc, expr_type);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\texpr_type = tnew_expr;\n\t\t\t\t\tnested = MemberCache.FindNestedType (expr_type, Name, Arity);\n\t\t\t\t\tErrorIsInaccesible (rc, nested.GetSignatureForError (), loc);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (nested.IsAccessible (rc))\n\t\t\t\t\tbreak;\n\n\t\t\t\t//\n\t\t\t\t// Keep looking after inaccessible candidate but only if\n\t\t\t\t// we are not in same context as the definition itself\n \t\t\t\t//\n\t\t\t\tif (expr_type.MemberDefinition == rc.CurrentMemberDefinition)\n\t\t\t\t\tbreak;\n\n\t\t\t\texpr_type = expr_type.BaseType;\n\t\t\t}\n\t\t\t\n\t\t\tTypeExpr texpr;\n\t\t\tif (Arity > 0) {\n\t\t\t\tif (HasTypeArguments) {\n\t\t\t\t\ttexpr = new GenericTypeExpr (nested, targs, loc);\n\t\t\t\t} else {\n\t\t\t\t\tif (!allowUnboundTypeArguments || expr_resolved is GenericTypeExpr) // && HasTypeArguments\n\t\t\t\t\t\tError_OpenGenericTypeIsNotAllowed (rc);\n\n\t\t\t\t\ttexpr = new GenericOpenTypeExpr (nested, loc);\n\t\t\t\t}\n\t\t\t} else if (expr_resolved is GenericOpenTypeExpr) {\n\t\t\t\ttexpr = new GenericOpenTypeExpr (nested, loc);\n\t\t\t} else {\n\t\t\t\ttexpr = new TypeExpression (nested, loc);\n\t\t\t}\n\n\t\t\tif (texpr.ResolveAsType (rc) == null)\n\t\t\t\treturn null;\n\n\t\t\treturn texpr;\n\t\t}\n\n\t\tpublic void Error_IdentifierNotFound (IMemberContext rc, TypeSpec expr_type)\n\t\t{\n\t\t\tvar nested = MemberCache.FindNestedType (expr_type, Name, -System.Math.Max (1, Arity));\n\n\t\t\tif (nested != null) {\n\t\t\t\tError_TypeArgumentsCannotBeUsed (rc, nested, expr.Location);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar any_other_member = MemberLookup (rc, false, expr_type, Name, 0, MemberLookupRestrictions.None, loc);\n\t\t\tif (any_other_member != null) {\n\t\t\t\tError_UnexpectedKind (rc, any_other_member, \"type\", any_other_member.ExprClassName, loc);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trc.Module.Compiler.Report.Error (426, loc, \"The nested type `{0}' does not exist in the type `{1}'\",\n\t\t\t\tName, expr_type.GetSignatureForError ());\n\t\t}\n\n\t\tprotected override void Error_InvalidExpressionStatement (Report report, Location loc)\n\t\t{\n\t\t\tbase.Error_InvalidExpressionStatement (report, LeftExpression.Location);\n\t\t}\n\n\t\tprotected override void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)\n\t\t{\n\t\t\tif (ec.Module.Compiler.Settings.Version > LanguageVersion.ISO_2 && !ec.IsRuntimeBinder && MethodGroupExpr.IsExtensionMethodArgument (expr)) {\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (type);\n\n\t\t\t\tvar cand = ec.Module.GlobalRootNamespace.FindExtensionMethodNamespaces (ec, name, Arity);\n\t\t\t\tstring missing;\n\t\t\t\t// a using directive or an assembly reference\n\t\t\t\tif (cand != null) {\n\t\t\t\t\tmissing = \"`\" + string.Join (\"' or `\", cand.ToArray ()) + \"' using directive\";\n\t\t\t\t} else {\n\t\t\t\t\tmissing = \"an assembly reference\";\n\t\t\t\t}\n\n\t\t\t\tec.Report.Error (1061, loc,\n\t\t\t\t\t\"Type `{0}' does not contain a definition for `{1}' and no extension method `{1}' of type `{0}' could be found. Are you missing {2}?\",\n\t\t\t\t\ttype.GetSignatureForError (), name, missing);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.Error_TypeDoesNotContainDefinition (ec, type, name);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn expr.GetSignatureForError () + \".\" + base.GetSignatureForError ();\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tMemberAccess target = (MemberAccess) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ConditionalMemberAccess : MemberAccess\n\t{\n\t\tpublic ConditionalMemberAccess (Expression expr, string identifier, TypeArguments args, Location loc)\n\t\t\t: base (expr, identifier, args, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool HasConditionalAccess ()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements checked expressions\n\t/// </summary>\n\tpublic class CheckedExpr : Expression {\n\n\t\tpublic Expression Expr;\n\t\t\n\t\tpublic CheckedExpr (Expression e, Location l)\n\t\t{\n\t\t\tExpr = e;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn Expr.ContainsEmitWithAwait ();\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tusing (ec.With (ResolveContext.Options.AllCheckStateFlags, true))\n\t\t\t\treturn Expr.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tusing (ec.With (ResolveContext.Options.AllCheckStateFlags, true))\n\t\t\t\tExpr = Expr.Resolve (ec);\n\t\t\t\n\t\t\tif (Expr == null)\n\t\t\t\treturn null;\n\n\t\t\tif (Expr is Constant || Expr is MethodGroupExpr || Expr is AnonymousMethodExpression || Expr is DefaultValueExpression)\n\t\t\t\treturn Expr;\n\t\t\t\n\t\t\teclass = Expr.eclass;\n\t\t\ttype = Expr.Type;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tusing (ec.With (EmitContext.Options.CheckedScope, true))\n\t\t\t\tExpr.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t\tusing (ec.With (EmitContext.Options.CheckedScope, true))\n\t\t\t\tExpr.EmitBranchable (ec, target, on_true);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tExpr.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\tusing (ctx.With (BuilderContext.Options.CheckedScope, true)) {\n\t\t\t\treturn Expr.MakeExpression (ctx);\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tCheckedExpr target = (CheckedExpr) t;\n\n\t\t\ttarget.Expr = Expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements the unchecked expression\n\t/// </summary>\n\tpublic class UnCheckedExpr : Expression {\n\n\t\tpublic Expression Expr;\n\n\t\tpublic UnCheckedExpr (Expression e, Location l)\n\t\t{\n\t\t\tExpr = e;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn Expr.ContainsEmitWithAwait ();\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tusing (ec.With (ResolveContext.Options.AllCheckStateFlags, false))\n\t\t\t\treturn Expr.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tusing (ec.With (ResolveContext.Options.AllCheckStateFlags, false))\n\t\t\t\tExpr = Expr.Resolve (ec);\n\n\t\t\tif (Expr == null)\n\t\t\t\treturn null;\n\n\t\t\tif (Expr is Constant || Expr is MethodGroupExpr || Expr is AnonymousMethodExpression || Expr is DefaultValueExpression)\n\t\t\t\treturn Expr;\n\t\t\t\n\t\t\teclass = Expr.eclass;\n\t\t\ttype = Expr.Type;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tusing (ec.With (EmitContext.Options.CheckedScope, false))\n\t\t\t\tExpr.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitBranchable (EmitContext ec, Label target, bool on_true)\n\t\t{\n\t\t\tusing (ec.With (EmitContext.Options.CheckedScope, false))\n\t\t\t\tExpr.EmitBranchable (ec, target, on_true);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tExpr.FlowAnalysis (fc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tUnCheckedExpr target = (UnCheckedExpr) t;\n\n\t\t\ttarget.Expr = Expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   An Element Access expression.\n\t///\n\t///   During semantic analysis these are transformed into \n\t///   IndexerAccess, ArrayAccess or a PointerArithmetic.\n\t/// </summary>\n\tpublic class ElementAccess : Expression\n\t{\n\t\tpublic Arguments Arguments;\n\t\tpublic Expression Expr;\n\n\t\tpublic ElementAccess (Expression e, Arguments args, Location loc)\n\t\t{\n\t\t\tExpr = e;\n\t\t\tthis.loc = loc;\n\t\t\tthis.Arguments = args;\n\t\t}\n\n\t\tpublic bool ConditionalAccess { get; set; }\n\n\t\tpublic override Location StartLocation {\n\t\t\tget {\n\t\t\t\treturn Expr.StartLocation;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn Expr.ContainsEmitWithAwait () || Arguments.ContainsEmitWithAwait ();\n\t\t}\n\n\t\t//\n\t\t// We perform some simple tests, and then to \"split\" the emit and store\n\t\t// code we create an instance of a different class, and return that.\n\t\t//\n\t\tExpression CreateAccessExpression (ResolveContext ec, bool conditionalAccessReceiver)\n\t\t{\n\t\t\tExpr = Expr.Resolve (ec);\n\t\t\tif (Expr == null)\n\t\t\t\treturn null;\n\n\t\t\ttype = Expr.Type;\n\n\t\t\tif (ConditionalAccess && !IsNullPropagatingValid (type)) {\n\t\t\t\tError_OperatorCannotBeApplied (ec, loc, \"?\", type);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (type.IsArray)\n\t\t\t\treturn new ArrayAccess (this, loc) {\n\t\t\t\t\tConditionalAccess = ConditionalAccess,\n\t\t\t\t\tConditionalAccessReceiver = conditionalAccessReceiver\n\t\t\t\t};\n\n\t\t\tif (type.IsPointer)\n\t\t\t\treturn MakePointerAccess (ec, type);\n\n\t\t\tFieldExpr fe = Expr as FieldExpr;\n\t\t\tif (fe != null) {\n\t\t\t\tvar ff = fe.Spec as FixedFieldSpec;\n\t\t\t\tif (ff != null) {\n\t\t\t\t\treturn MakePointerAccess (ec, ff.ElementType);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar indexers = MemberCache.FindMembers (type, MemberCache.IndexerNameAlias, false);\n\t\t\tif (indexers != null || type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tvar indexer = new IndexerExpr (indexers, type, this) {\n\t\t\t\t\tConditionalAccess = ConditionalAccess\n\t\t\t\t};\n\n\t\t\t\tif (conditionalAccessReceiver)\n\t\t\t\t\tindexer.SetConditionalAccessReceiver ();\n\n\t\t\t\treturn indexer;\n\t\t\t}\n\n\t\t\tError_CannotApplyIndexing (ec, type, loc);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = Arguments.CreateForExpressionTree (ec, Arguments,\n\t\t\t\tExpr.CreateExpressionTree (ec));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"ArrayIndex\", args);\n\t\t}\n\n\t\tpublic static void Error_CannotApplyIndexing (ResolveContext rc, TypeSpec type, Location loc)\n\t\t{\n\t\t\tif (type != InternalType.ErrorType) {\n\t\t\t\trc.Report.Error (21, loc, \"Cannot apply indexing with [] to an expression of type `{0}'\",\n\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool HasConditionalAccess ()\n\t\t{\n\t\t\treturn ConditionalAccess || Expr.HasConditionalAccess ();\n\t\t}\n\n\t\tExpression MakePointerAccess (ResolveContext rc, TypeSpec type)\n\t\t{\n\t\t\tif (Arguments.Count != 1){\n\t\t\t\trc.Report.Error (196, loc, \"A pointer must be indexed by only one value\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar arg = Arguments[0];\n\t\t\tif (arg is NamedArgument)\n\t\t\t\tError_NamedArgument ((NamedArgument) arg, rc.Report);\n\n\t\t\tvar index = arg.Expr.Resolve (rc);\n\t\t\tif (index == null)\n\t\t\t\treturn null;\n\n\t\t\tindex = ConvertExpressionToArrayIndex (rc, index, true);\n\n\t\t\tExpression p = new PointerArithmetic (Binary.Operator.Addition, Expr, index, type, loc);\n\t\t\treturn new Indirection (p, loc);\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tExpression expr;\n\t\t\tif (!rc.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {\n\t\t\t\tif (HasConditionalAccess ()) {\n\t\t\t\t\tusing (rc.Set (ResolveContext.Options.ConditionalAccessReceiver)) {\n\t\t\t\t\t\texpr = CreateAccessExpression (rc, true);\n\t\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\treturn expr.Resolve (rc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texpr = CreateAccessExpression (rc, false);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\treturn expr.Resolve (rc);\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression rhs)\n\t\t{\n\t\t\tvar res = CreateAccessExpression (ec, false);\n\t\t\tif (res == null)\n\t\t\t\treturn null;\n\n\t\t\treturn res.ResolveLValue (ec, rhs);\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tthrow new Exception (\"Should never be reached\");\n\t\t}\n\n\t\tpublic static void Error_NamedArgument (NamedArgument na, Report Report)\n\t\t{\n\t\t\tReport.Error (1742, na.Location, \"An element access expression cannot use named argument\");\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tExpr.FlowAnalysis (fc);\n\n\t\t\tif (ConditionalAccess)\n\t\t\t\tfc.BranchConditionalAccessDefiniteAssignment ();\n\n\t\t\tArguments.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn Expr.GetSignatureForError ();\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tElementAccess target = (ElementAccess) t;\n\n\t\t\ttarget.Expr = Expr.Clone (clonectx);\n\t\t\tif (Arguments != null)\n\t\t\t\ttarget.Arguments = Arguments.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements array access \n\t/// </summary>\n\tpublic class ArrayAccess : Expression, IDynamicAssign, IMemoryLocation {\n\t\t//\n\t\t// Points to our \"data\" repository\n\t\t//\n\t\tElementAccess ea;\n\n\t\tLocalTemporary temp;\n\t\tbool prepared;\n\t\tbool? has_await_args;\n\t\t\n\t\tpublic ArrayAccess (ElementAccess ea_data, Location l)\n\t\t{\n\t\t\tea = ea_data;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic bool ConditionalAccess { get; set; }\n\n\t\tpublic bool ConditionalAccessReceiver { get; set; }\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tvar ac = (ArrayContainer) ea.Expr.Type;\n\n\t\t\tif (!has_await_args.HasValue && ec.HasSet (BuilderContext.Options.AsyncBody) && ea.Arguments.ContainsEmitWithAwait ()) {\n\t\t\t\tLoadInstanceAndArguments (ec, false, true);\n\t\t\t}\n\n\t\t\tLoadInstanceAndArguments (ec, false, false);\n\n\t\t\tif (ac.Element.IsGenericParameter && mode == AddressOp.Load)\n\t\t\t\tec.Emit (OpCodes.Readonly);\n\n\t\t\tec.EmitArrayAddress (ac);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (ConditionalAccess)\n\t\t\t\tError_NullShortCircuitInsideExpressionTree (ec);\n\n\t\t\treturn ea.CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn ea.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\tif (ConditionalAccess)\n\t\t\t\tthrow new NotSupportedException (\"null propagating operator assignment\");\n\n\t\t\treturn DoResolve (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t// dynamic is used per argument in ConvertExpressionToArrayIndex case\n\t\t\tbool dynamic;\n\t\t\tea.Arguments.Resolve (ec, out dynamic);\n\n\t\t\tvar ac = ea.Expr.Type as ArrayContainer;\n\t\t\tint rank = ea.Arguments.Count;\n\t\t\tif (ac.Rank != rank) {\n\t\t\t\tec.Report.Error (22, ea.Location, \"Wrong number of indexes `{0}' inside [], expected `{1}'\",\n\t\t\t\t\t  rank.ToString (), ac.Rank.ToString ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\ttype = ac.Element;\n\t\t\tif (type.IsPointer && !ec.IsUnsafe) {\n\t\t\t\tUnsafeError (ec, ea.Location);\n\t\t\t}\n\n\t\t\tif (ConditionalAccessReceiver)\n\t\t\t\ttype = LiftMemberType (ec, type);\n\n\t\t\tforeach (Argument a in ea.Arguments) {\n\t\t\t\tvar na = a as NamedArgument;\n\t\t\t\tif (na != null)\n\t\t\t\t\tElementAccess.Error_NamedArgument (na, ec.Report);\n\n\t\t\t\ta.Expr = ConvertExpressionToArrayIndex (ec, a.Expr);\n\t\t\t}\n\t\t\t\n\t\t\teclass = ExprClass.Variable;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected override void Error_NegativeArrayIndex (ResolveContext ec, Location loc)\n\t\t{\n\t\t\tec.Report.Warning (251, 2, loc, \"Indexing an array with a negative index (array indices always start at zero)\");\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tea.FlowAnalysis (fc);\n\t\t}\n\n\t\t//\n\t\t// Load the array arguments into the stack.\n\t\t//\n\t\tvoid LoadInstanceAndArguments (EmitContext ec, bool duplicateArguments, bool prepareAwait)\n\t\t{\n\t\t\tif (prepareAwait) {\n\t\t\t\tea.Expr = ea.Expr.EmitToField (ec);\n\t\t\t} else {\n\t\t\t\tvar ie = new InstanceEmitter (ea.Expr, false);\n\t\t\t\tie.Emit (ec, ConditionalAccess);\n\n\t\t\t\tif (duplicateArguments) {\n\t\t\t\t\tec.Emit (OpCodes.Dup);\n\n\t\t\t\t\tvar copy = new LocalTemporary (ea.Expr.Type);\n\t\t\t\t\tcopy.Store (ec);\n\t\t\t\t\tea.Expr = copy;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar dup_args = ea.Arguments.Emit (ec, duplicateArguments, prepareAwait);\n\t\t\tif (dup_args != null)\n\t\t\t\tea.Arguments = dup_args;\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec, bool leave_copy)\n\t\t{\n\t\t\tif (prepared) {\n\t\t\t\tec.EmitLoadFromPtr (type);\n\t\t\t} else {\n\t\t\t\tif (!has_await_args.HasValue && ec.HasSet (BuilderContext.Options.AsyncBody) && ea.Arguments.ContainsEmitWithAwait ()) {\n\t\t\t\t\tLoadInstanceAndArguments (ec, false, true);\n\t\t\t\t}\n\n\t\t\t\tif (ConditionalAccessReceiver)\n\t\t\t\t\tec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());\n\n\t\t\t\tvar ac = (ArrayContainer) ea.Expr.Type;\n\t\t\t\tLoadInstanceAndArguments (ec, false, false);\n\t\t\t\tec.EmitArrayLoad (ac);\n\n\t\t\t\tif (ConditionalAccessReceiver)\n\t\t\t\t\tec.CloseConditionalAccess (type.IsNullableType && type != ac.Element ? type : null);\n\t\t\t}\t\n\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\ttemp = new LocalTemporary (this.type);\n\t\t\t\ttemp.Store (ec);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec, false);\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tvar ac = (ArrayContainer) ea.Expr.Type;\n\t\t\tTypeSpec t = source.Type;\n\n\t\t\thas_await_args = ec.HasSet (BuilderContext.Options.AsyncBody) && (ea.Arguments.ContainsEmitWithAwait () || source.ContainsEmitWithAwait ());\n\n\t\t\t//\n\t\t\t// When we are dealing with a struct, get the address of it to avoid value copy\n\t\t\t// Same cannot be done for reference type because array covariance and the\n\t\t\t// check in ldelema requires to specify the type of array element stored at the index\n\t\t\t//\n\t\t\tif (t.IsStruct && ((isCompound && !(source is DynamicExpressionStatement)) || !BuiltinTypeSpec.IsPrimitiveType (t))) {\n\t\t\t\tLoadInstanceAndArguments (ec, false, has_await_args.Value);\n\n\t\t\t\tif (has_await_args.Value) {\n\t\t\t\t\tif (source.ContainsEmitWithAwait ()) {\n\t\t\t\t\t\tsource = source.EmitToField (ec);\n\t\t\t\t\t\tisCompound = false;\n\t\t\t\t\t\tprepared = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tLoadInstanceAndArguments (ec, isCompound, false);\n\t\t\t\t} else {\n\t\t\t\t\tprepared = true;\n\t\t\t\t}\n\n\t\t\t\tec.EmitArrayAddress (ac);\n\n\t\t\t\tif (isCompound) {\n\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\tprepared = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLoadInstanceAndArguments (ec, isCompound, has_await_args.Value);\n\n\t\t\t\tif (has_await_args.Value) {\n\t\t\t\t\tif (source.ContainsEmitWithAwait ())\n\t\t\t\t\t\tsource = source.EmitToField (ec);\n\n\t\t\t\t\tLoadInstanceAndArguments (ec, false, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsource.Emit (ec);\n\n\t\t\tif (isCompound) {\n\t\t\t\tvar lt = ea.Expr as LocalTemporary;\n\t\t\t\tif (lt != null)\n\t\t\t\t\tlt.Release (ec);\n\t\t\t}\n\n\t\t\tif (leave_copy) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\ttemp = new LocalTemporary (this.type);\n\t\t\t\ttemp.Store (ec);\n\t\t\t}\n\n\t\t\tif (prepared) {\n\t\t\t\tec.EmitStoreFromPtr (t);\n\t\t\t} else {\n\t\t\t\tec.EmitArrayStore (ac);\n\t\t\t}\n\t\t\t\n\t\t\tif (temp != null) {\n\t\t\t\ttemp.Emit (ec);\n\t\t\t\ttemp.Release (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Have to be specialized for arrays to get access to\n\t\t\t// underlying element. Instead of another result copy we\n\t\t\t// need direct access to element \n\t\t\t//\n\t\t\t// Consider:\n\t\t\t//\n\t\t\t// CallRef (ref a[await Task.Factory.StartNew (() => 1)]);\n\t\t\t//\n\t\t\tea.Expr = ea.Expr.EmitToField (ec);\n\t\t\tea.Arguments = ea.Arguments.Emit (ec, false, true);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)\n\t\t{\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\t\treturn SLE.Expression.ArrayAccess (ea.Expr.MakeExpression (ctx), MakeExpressionArguments (ctx));\n#else\n\t\t\tthrow new NotImplementedException ();\n#endif\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn SLE.Expression.ArrayIndex (ea.Expr.MakeExpression (ctx), MakeExpressionArguments (ctx));\n\t\t}\n\n\t\tSLE.Expression[] MakeExpressionArguments (BuilderContext ctx)\n\t\t{\n\t\t\tusing (ctx.With (BuilderContext.Options.CheckedScope, true)) {\n\t\t\t\treturn Arguments.MakeExpression (ea.Arguments, ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Indexer access expression\n\t//\n\tclass IndexerExpr : PropertyOrIndexerExpr<IndexerSpec>, OverloadResolver.IBaseMembersProvider\n\t{\n\t\tIList<MemberSpec> indexers;\n\t\tArguments arguments;\n\t\tTypeSpec queried_type;\n\t\t\n\t\tpublic IndexerExpr (IList<MemberSpec> indexers, TypeSpec queriedType, ElementAccess ea)\n\t\t\t: this (indexers, queriedType, ea.Expr, ea.Arguments, ea.Location)\n\t\t{\n\t\t}\n\n\t\tpublic IndexerExpr (IList<MemberSpec> indexers, TypeSpec queriedType, Expression instance, Arguments args, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.indexers = indexers;\n\t\t\tthis.queried_type = queriedType;\n\t\t\tthis.InstanceExpression = instance;\n\t\t\tthis.arguments = args;\n\t\t}\n\n\t\t#region Properties\n\n\t\tprotected override Arguments Arguments {\n\t\t\tget {\n\t\t\t\treturn arguments;\n\t\t\t}\n\t\t\tset {\n\t\t\t\targuments = value;\n\t\t\t}\n\t\t}\n\n\t\tprotected override TypeSpec DeclaringType {\n\t\t\tget {\n\t\t\t\treturn best_candidate.DeclaringType;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsInstance {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string KindName {\n\t\t\tget { return \"indexer\"; }\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn \"this\";\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn base.ContainsEmitWithAwait () || arguments.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (ConditionalAccess) {\n\t\t\t\tError_NullShortCircuitInsideExpressionTree (ec);\n\t\t\t}\n\n\t\t\tArguments args = Arguments.CreateForExpressionTree (ec, arguments,\n\t\t\t\tInstanceExpression.CreateExpressionTree (ec),\n\t\t\t\tnew TypeOfMethod (Getter, loc));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Call\", args);\n\t\t}\n\t\n\t\tpublic override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound)\n\t\t{\n\t\t\tLocalTemporary await_source_arg = null;\n\n\t\t\tif (isCompound) {\n\t\t\t\temitting_compound_assignment = true;\n\t\t\t\tif (source is DynamicExpressionStatement) {\n\t\t\t\t\tEmit (ec, false);\n\t\t\t\t} else {\n\t\t\t\t\tsource.Emit (ec);\n\t\t\t\t}\n\t\t\t\temitting_compound_assignment = false;\n\n\t\t\t\tif (has_await_arguments) {\n\t\t\t\t\tawait_source_arg = new LocalTemporary (Type);\n\t\t\t\t\tawait_source_arg.Store (ec);\n\n\t\t\t\t\targuments.Add (new Argument (await_source_arg));\n\n\t\t\t\t\tif (leave_copy) {\n\t\t\t\t\t\ttemp = await_source_arg;\n\t\t\t\t\t}\n\n\t\t\t\t\thas_await_arguments = false;\n\t\t\t\t} else {\n\t\t\t\t\targuments = null;\n\n\t\t\t\t\tif (leave_copy) {\n\t\t\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\t\t\ttemp = new LocalTemporary (Type);\n\t\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (leave_copy) {\n\t\t\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && (arguments.ContainsEmitWithAwait () || source.ContainsEmitWithAwait ())) {\n\t\t\t\t\t\tsource = source.EmitToField (ec);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp = new LocalTemporary (Type);\n\t\t\t\t\t\tsource.Emit (ec);\n\t\t\t\t\t\ttemp.Store (ec);\n\t\t\t\t\t\tsource = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\targuments.Add (new Argument (source));\n\t\t\t}\n\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = InstanceExpression;\n\t\t\tif (arguments == null)\n\t\t\t\tcall.InstanceExpressionOnStack = true;\n\n\t\t\tcall.Emit (ec, Setter, arguments, loc);\n\n\t\t\tif (temp != null) {\n\t\t\t\ttemp.Emit (ec);\n\t\t\t\ttemp.Release (ec);\n\t\t\t} else if (leave_copy) {\n\t\t\t\tsource.Emit (ec);\n\t\t\t}\n\n\t\t\tif (await_source_arg != null) {\n\t\t\t\tawait_source_arg.Release (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tbase.FlowAnalysis (fc);\n\t\t\targuments.FlowAnalysis (fc);\n\n\t\t\tif (conditional_access_receiver)\n\t\t\t\tfc.ConditionalAccessEnd ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn best_candidate.GetSignatureForError ();\n\t\t}\n\t\t\n\t\tpublic override SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)\n\t\t{\n#if STATIC\n\t\t\tthrow new NotSupportedException ();\n#else\n\t\t\tvar value = new[] { source.MakeExpression (ctx) };\n\t\t\tvar args = Arguments.MakeExpression (arguments, ctx).Concat (value);\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\t\treturn SLE.Expression.Block (\n\t\t\t\t\tSLE.Expression.Call (InstanceExpression.MakeExpression (ctx), (MethodInfo) Setter.GetMetaInfo (), args),\n\t\t\t\t\tvalue [0]);\n#else\n\t\t\treturn args.First ();\n#endif\n#endif\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\tvar args = Arguments.MakeExpression (arguments, ctx);\n\t\t\treturn SLE.Expression.Call (InstanceExpression.MakeExpression (ctx), (MethodInfo) Getter.GetMetaInfo (), args);\n#endif\n\t\t}\n\n\t\tprotected override Expression OverloadResolve (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\tif (best_candidate != null)\n\t\t\t\treturn this;\n\n\t\t\teclass = ExprClass.IndexerAccess;\n\n\t\t\tbool dynamic;\n\t\t\targuments.Resolve (rc, out dynamic);\n\n\t\t\tif (indexers == null && InstanceExpression.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tdynamic = true;\n\t\t\t} else {\n\t\t\t\tvar res = new OverloadResolver (indexers, OverloadResolver.Restrictions.None, loc);\n\t\t\t\tres.BaseMembersProvider = this;\n\t\t\t\tres.InstanceQualifier = this;\n\n\t\t\t\t// TODO: Do I need 2 argument sets?\n\t\t\t\tbest_candidate = res.ResolveMember<IndexerSpec> (rc, ref arguments);\n\t\t\t\tif (best_candidate != null)\n\t\t\t\t\ttype = res.BestCandidateReturnType;\n\t\t\t\telse if (!res.BestCandidateIsDynamic)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// It has dynamic arguments\n\t\t\t//\n\t\t\tif (dynamic) {\n\t\t\t\tArguments args = new Arguments (arguments.Count + 1);\n\t\t\t\tif (IsBase) {\n\t\t\t\t\trc.Report.Error (1972, loc,\n\t\t\t\t\t\t\"The indexer base access cannot be dynamically dispatched. Consider casting the dynamic arguments or eliminating the base access\");\n\t\t\t\t} else {\n\t\t\t\t\targs.Add (new Argument (InstanceExpression));\n\t\t\t\t}\n\t\t\t\targs.AddRange (arguments);\n\n\t\t\t\tbest_candidate = null;\n\t\t\t\treturn new DynamicIndexBinder (args, loc);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Try to avoid resolving left expression again\n\t\t\t//\n\t\t\tif (right_side != null)\n\t\t\t\tResolveInstanceExpression (rc, right_side);\n\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tIndexerExpr target = (IndexerExpr) t;\n\n\t\t\tif (arguments != null)\n\t\t\t\ttarget.arguments = arguments.Clone (clonectx);\n\t\t}\n\n\t\tpublic void SetConditionalAccessReceiver ()\n\t\t{\n\t\t\tconditional_access_receiver = true;\n\t\t}\n\n\t\tpublic override void SetTypeArguments (ResolveContext ec, TypeArguments ta)\n\t\t{\n\t\t\tError_TypeArgumentsCannotBeUsed (ec, \"indexer\", GetSignatureForError (), loc);\n\t\t}\n\n\t\t#region IBaseMembersProvider Members\n\n\t\tIList<MemberSpec> OverloadResolver.IBaseMembersProvider.GetBaseMembers (TypeSpec baseType)\n\t\t{\n\t\t\treturn baseType == null ? null : MemberCache.FindMembers (baseType, MemberCache.IndexerNameAlias, false);\n\t\t}\n\n\t\tIParametersMember OverloadResolver.IBaseMembersProvider.GetOverrideMemberParameters (MemberSpec member)\n\t\t{\n\t\t\tif (queried_type == member.DeclaringType)\n\t\t\t\treturn null;\n\n\t\t\tvar filter = new MemberFilter (MemberCache.IndexerNameAlias, 0, MemberKind.Indexer, ((IndexerSpec) member).Parameters, null);\n\t\t\treturn MemberCache.FindMember (queried_type, filter, BindingRestriction.InstanceOnly | BindingRestriction.OverrideOnly) as IParametersMember;\n\t\t}\n\n\t\tMethodGroupExpr OverloadResolver.IBaseMembersProvider.LookupExtensionMethod (ResolveContext rc)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t//\n\t// A base access expression\n\t//\n\tpublic class BaseThis : This\n\t{\n\t\tpublic BaseThis (Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t}\n\n\t\tpublic BaseThis (TypeSpec type, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\teclass = ExprClass.Variable;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn \"base\";\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (831, loc, \"An expression tree may not contain a base access\");\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\n\t\t\tif (type == ec.Module.Compiler.BuiltinTypes.ValueType) {\n\t\t\t\tvar context_type = ec.CurrentType;\n\t\t\t\tec.Emit (OpCodes.Ldobj, context_type);\n\t\t\t\tec.Emit (OpCodes.Box, context_type);\n\t\t\t}\n\t\t}\n\n\t\tprotected override void Error_ThisNotAvailable (ResolveContext ec)\n\t\t{\n\t\t\tif (ec.IsStatic) {\n\t\t\t\tec.Report.Error (1511, loc, \"Keyword `base' is not available in a static method\");\n\t\t\t} else {\n\t\t\t\tec.Report.Error (1512, loc, \"Keyword `base' is not available in the current context\");\n\t\t\t}\n\t\t}\n\n\t\tpublic override void ResolveBase (ResolveContext ec)\n\t\t{\n\t\t\tbase.ResolveBase (ec);\n\t\t\ttype = ec.CurrentType.BaseType;\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   This class exists solely to pass the Type around and to be a dummy\n\t///   that can be passed to the conversion functions (this is used by\n\t///   foreach implementation to typecast the object return value from\n\t///   get_Current into the proper type.  All code has been generated and\n\t///   we only care about the side effect conversions to be performed\n\t///\n\t///   This is also now used as a placeholder where a no-action expression\n\t///   is needed (the `New' class).\n\t/// </summary>\n\tpublic class EmptyExpression : Expression\n\t{\n\t\tsealed class OutAccessExpression : EmptyExpression\n\t\t{\n\t\t\tpublic OutAccessExpression (TypeSpec t)\n\t\t\t\t: base (t)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t\t{\n\t\t\t\trc.Report.Error (206, right_side.Location,\n\t\t\t\t\t\"A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter\");\n\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic static readonly EmptyExpression LValueMemberAccess = new EmptyExpression (InternalType.FakeInternalType);\n\t\tpublic static readonly EmptyExpression LValueMemberOutAccess = new EmptyExpression (InternalType.FakeInternalType);\n\t\tpublic static readonly EmptyExpression UnaryAddress = new EmptyExpression (InternalType.FakeInternalType);\n\t\tpublic static readonly EmptyExpression EventAddition = new EmptyExpression (InternalType.FakeInternalType);\n\t\tpublic static readonly EmptyExpression EventSubtraction = new EmptyExpression (InternalType.FakeInternalType);\n\t\tpublic static readonly EmptyExpression MissingValue = new EmptyExpression (InternalType.FakeInternalType);\n\t\tpublic static readonly Expression Null = new EmptyExpression (InternalType.FakeInternalType);\n\t\tpublic static readonly EmptyExpression OutAccess = new OutAccessExpression (InternalType.FakeInternalType);\n\n\t\tpublic EmptyExpression (TypeSpec t)\n\t\t{\n\t\t\ttype = t;\n\t\t\teclass = ExprClass.Value;\n\t\t\tloc = Location.Null;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// nothing, as we only exist to not do anything.\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\t\n\tsealed class EmptyAwaitExpression : EmptyExpression\n\t{\n\t\tpublic EmptyAwaitExpression (TypeSpec type)\n\t\t\t: base (type)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\t//\n\t// Empty statement expression\n\t//\n\tpublic sealed class EmptyExpressionStatement : ExpressionStatement\n\t{\n\t\tpublic static readonly EmptyExpressionStatement Instance = new EmptyExpressionStatement ();\n\n\t\tprivate EmptyExpressionStatement ()\n\t\t{\n\t\t\tloc = Location.Null;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\t// Do nothing\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t\ttype = ec.BuiltinTypes.Object;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// Do nothing\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ErrorExpression : EmptyExpression\n\t{\n\t\tpublic static readonly ErrorExpression Instance = new ErrorExpression ();\n\t\tpublic readonly int ErrorCode;\n\t\tpublic readonly string Error;\n\t\t\n\t\tprivate ErrorExpression ()\n\t\t\t: base (InternalType.ErrorType)\n\t\t{\n\t\t}\n\t\t\n\t\tErrorExpression (int errorCode, Location location, string error)\n\t\t\t: base (InternalType.ErrorType)\n\t\t{\n\t\t\tthis.ErrorCode = errorCode;\n\t\t\tbase.loc = location;\n\t\t\tthis.Error = error;\n\t\t}\n\t\t\n\t\tpublic static ErrorExpression Create (int errorCode, Location location, string error)\n\t\t{\n\t\t\treturn new ErrorExpression (errorCode, location, error);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Error_ValueAssignment (ResolveContext rc, Expression rhs)\n\t\t{\n\t\t}\n\n\t\tpublic override void Error_UnexpectedKind (ResolveContext ec, ResolveFlags flags, Location loc)\n\t\t{\n\t\t}\n\n\t\tpublic override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)\n\t\t{\n\t\t}\n\n\t\tpublic override void Error_OperatorCannotBeApplied (ResolveContext rc, Location loc, string oper, TypeSpec t)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class UserCast : Expression {\n\t\tMethodSpec method;\n\t\tExpression source;\n\t\t\n\t\tpublic UserCast (MethodSpec method, Expression source, Location l)\n\t\t{\n\t\t\tif (source == null)\n\t\t\t\tthrow new ArgumentNullException (\"source\");\n\n\t\t\tthis.method = method;\n\t\t\tthis.source = source;\n\t\t\ttype = method.ReturnType;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Expression Source {\n\t\t\tget {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn source.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (3);\n\t\t\targs.Add (new Argument (source.CreateExpressionTree (ec)));\n\t\t\targs.Add (new Argument (new TypeOf (type, loc)));\n\t\t\targs.Add (new Argument (new TypeOfMethod (method, loc)));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Convert\", args);\n\t\t}\n\t\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tObsoleteAttribute oa = method.GetAttributeObsolete ();\n\t\t\tif (oa != null)\n\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, ec.Report);\n\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tsource.Emit (ec);\n\t\t\tec.MarkCallEntry (loc);\n\t\t\tec.Emit (OpCodes.Call, method);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tsource.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn TypeManager.CSharpSignature (method);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n#if STATIC\n\t\t\treturn base.MakeExpression (ctx);\n#else\n\t\t\treturn SLE.Expression.Convert (source.MakeExpression (ctx), type.GetMetaInfo (), (MethodInfo) method.GetMetaInfo ());\n#endif\n\t\t}\n\t}\n\n\t//\n\t// Holds additional type specifiers like ?, *, []\n\t//\n\tpublic class ComposedTypeSpecifier\n\t{\n\t\tpublic static readonly ComposedTypeSpecifier SingleDimension = new ComposedTypeSpecifier (1, Location.Null);\n\n\t\tpublic readonly int Dimension;\n\t\tpublic readonly Location Location;\n\n\t\tpublic ComposedTypeSpecifier (int specifier, Location loc)\n\t\t{\n\t\t\tthis.Dimension = specifier;\n\t\t\tthis.Location = loc;\n\t\t}\n\n\t\t#region Properties\n\t\tpublic bool IsNullable {\n\t\t\tget {\n\t\t\t\treturn Dimension == -1;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsPointer {\n\t\t\tget {\n\t\t\t\treturn Dimension == -2;\n\t\t\t}\n\t\t}\n\n\t\tpublic ComposedTypeSpecifier Next { get; set; }\n\n\t\t#endregion\n\n\t\tpublic static ComposedTypeSpecifier CreateArrayDimension (int dimension, Location loc)\n\t\t{\n\t\t\treturn new ComposedTypeSpecifier (dimension, loc);\n\t\t}\n\n\t\tpublic static ComposedTypeSpecifier CreateNullable (Location loc)\n\t\t{\n\t\t\treturn new ComposedTypeSpecifier (-1, loc);\n\t\t}\n\n\t\tpublic static ComposedTypeSpecifier CreatePointer (Location loc)\n\t\t{\n\t\t\treturn new ComposedTypeSpecifier (-2, loc);\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\tstring s =\n\t\t\t\tIsPointer ? \"*\" :\n\t\t\t\tIsNullable ? \"?\" :\n\t\t\t\tArrayContainer.GetPostfixSignature (Dimension);\n\n\t\t\treturn Next != null ? s + Next.GetSignatureForError () : s;\n\t\t}\n\t}\n\n\t// <summary>\n\t//   This class is used to \"construct\" the type during a typecast\n\t//   operation.  Since the Type.GetType class in .NET can parse\n\t//   the type specification, we just use this to construct the type\n\t//   one bit at a time.\n\t// </summary>\n\tpublic class ComposedCast : TypeExpr {\n\t\tFullNamedExpression left;\n\t\tComposedTypeSpecifier spec;\n\n\t\tpublic FullNamedExpression Left {\n\t\t\tget { return this.left; }\n\t\t}\n\n\t\tpublic ComposedTypeSpecifier Spec {\n\t\t\tget {\n\t\t\t\treturn this.spec;\n\t\t\t}\n\t\t}\n\n\t\tpublic ComposedCast (FullNamedExpression left, ComposedTypeSpecifier spec)\n\t\t{\n\t\t\tif (spec == null)\n\t\t\t\tthrow new ArgumentNullException (\"spec\");\n\n\t\t\tthis.left = left;\n\t\t\tthis.spec = spec;\n\t\t\tthis.loc = left.Location;\n\t\t}\n\n\t\tpublic override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\ttype = left.ResolveAsType (ec);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\teclass = ExprClass.Type;\n\n\t\t\tvar single_spec = spec;\n\n\t\t\tif (single_spec.IsNullable) {\n\t\t\t\ttype = new Nullable.NullableType (type, loc).ResolveAsType (ec);\n\t\t\t\tif (type == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tsingle_spec = single_spec.Next;\n\t\t\t} else if (single_spec.IsPointer) {\n\t\t\t\tif (!TypeManager.VerifyUnmanaged (ec.Module, type, loc))\n\t\t\t\t\treturn null;\n\n\t\t\t\tif (!ec.IsUnsafe) {\n\t\t\t\t\tUnsafeError (ec.Module.Compiler.Report, loc);\n\t\t\t\t}\n\n\t\t\t\tdo {\n\t\t\t\t\ttype = PointerContainer.MakeType (ec.Module, type);\n\t\t\t\t\tsingle_spec = single_spec.Next;\n\t\t\t\t} while (single_spec != null && single_spec.IsPointer);\n\t\t\t}\n\n\t\t\tif (single_spec != null && single_spec.Dimension > 0) {\n\t\t\t\tif (type.IsSpecialRuntimeType) {\n\t\t\t\t\tec.Module.Compiler.Report.Error (611, loc, \"Array elements cannot be of type `{0}'\", type.GetSignatureForError ());\n\t\t\t\t} else if (type.IsStatic) {\n\t\t\t\t\tec.Module.Compiler.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\t\tec.Module.Compiler.Report.Error (719, loc, \"Array elements cannot be of static type `{0}'\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tMakeArray (ec.Module, single_spec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn type;\n\t\t}\n\n\t\tvoid MakeArray (ModuleContainer module, ComposedTypeSpecifier spec)\n\t\t{\n\t\t\tif (spec.Next != null)\n\t\t\t\tMakeArray (module, spec.Next);\n\n\t\t\ttype = ArrayContainer.MakeType (module, type, spec.Dimension);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn left.GetSignatureForError () + spec.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tclass FixedBufferPtr : Expression\n\t{\n\t\treadonly Expression array;\n\n\t\tpublic FixedBufferPtr (Expression array, TypeSpec array_type, Location l)\n\t\t{\n\t\t\tthis.type = array_type;\n\t\t\tthis.array = array;\n\t\t\tthis.loc = l;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tError_PointerInsideExpressionTree (ec);\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override void Emit(EmitContext ec)\n\t\t{\n\t\t\tarray.Emit (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\ttype = PointerContainer.MakeType (ec.Module, type);\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\t}\n\n\n\t//\n\t// This class is used to represent the address of an array, used\n\t// only by the Fixed statement, this generates \"&a [0]\" construct\n\t// for fixed (char *pa = a)\n\t//\n\tclass ArrayPtr : FixedBufferPtr\n\t{\n\t\tpublic ArrayPtr (Expression array, TypeSpec array_type, Location l):\n\t\t\tbase (array, array_type, l)\n\t\t{\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tbase.Emit (ec);\n\t\t\t\n\t\t\tec.EmitInt (0);\n\t\t\tec.Emit (OpCodes.Ldelema, ((PointerContainer) type).Element);\n\t\t}\n\t}\n\n\t//\n\t// Encapsulates a conversion rules required for array indexes\n\t//\n\tpublic class ArrayIndexCast : TypeCast\n\t{\n\t\tpublic ArrayIndexCast (Expression expr, TypeSpec returnType)\n\t\t\t: base (expr, returnType)\n\t\t{\n\t\t\tif (expr.Type == returnType) // int -> int\n\t\t\t\tthrow new ArgumentException (\"unnecessary array index conversion\");\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tusing (ec.Set (ResolveContext.Options.CheckedScope)) {\n\t\t\t\treturn base.CreateExpressionTree (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tchild.Emit (ec);\n\n\t\t\tswitch (child.Type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tec.Emit (OpCodes.Conv_U);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tec.Emit (OpCodes.Conv_Ovf_I);\n\t\t\t\tbreak;\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tec.Emit (OpCodes.Conv_Ovf_I_Un);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (\"Cannot emit cast to unknown array element type\", type);\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Implements the `stackalloc' keyword\n\t//\n\tpublic class StackAlloc : Expression {\n\t\tTypeSpec otype;\n\t\tExpression t;\n\t\tExpression count;\n\n\t\tpublic StackAlloc (Expression type, Expression count, Location l)\n\t\t{\n\t\t\tt = type;\n\t\t\tthis.count = count;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Expression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn this.t;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression CountExpression {\n\t\t\tget {\n\t\t\t\treturn this.count;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tcount = count.Resolve (ec);\n\t\t\tif (count == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif (count.Type.BuiltinType != BuiltinTypeSpec.Type.UInt){\n\t\t\t\tcount = Convert.ImplicitConversionRequired (ec, count, ec.BuiltinTypes.Int, loc);\n\t\t\t\tif (count == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tConstant c = count as Constant;\n\t\t\tif (c != null && c.IsNegative) {\n\t\t\t\tec.Report.Error (247, loc, \"Cannot use a negative size with stackalloc\");\n\t\t\t}\n\n\t\t\tif (ec.HasAny (ResolveContext.Options.CatchScope | ResolveContext.Options.FinallyScope)) {\n\t\t\t\tec.Report.Error (255, loc, \"Cannot use stackalloc in finally or catch\");\n\t\t\t}\n\n\t\t\totype = t.ResolveAsType (ec);\n\t\t\tif (otype == null)\n\t\t\t\treturn null;\n\n\t\t\tif (!TypeManager.VerifyUnmanaged (ec.Module, otype, loc))\n\t\t\t\treturn null;\n\n\t\t\ttype = PointerContainer.MakeType (ec.Module, otype);\n\t\t\teclass = ExprClass.Value;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tint size = BuiltinTypeSpec.GetSize (otype);\n\n\t\t\tcount.Emit (ec);\n\n\t\t\tif (size == 0)\n\t\t\t\tec.Emit (OpCodes.Sizeof, otype);\n\t\t\telse\n\t\t\t\tec.EmitInt (size);\n\n\t\t\tec.Emit (OpCodes.Mul_Ovf_Un);\n\t\t\tec.Emit (OpCodes.Localloc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tStackAlloc target = (StackAlloc) t;\n\t\t\ttarget.count = count.Clone (clonectx);\n\t\t\ttarget.t = t.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// An object initializer expression\n\t//\n\tpublic class ElementInitializer : Assign\n\t{\n\t\tpublic readonly string Name;\n\n\t\tpublic ElementInitializer (string name, Expression initializer, Location loc)\n\t\t\t: base (null, initializer, loc)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t}\n\n\t\tpublic bool IsDictionaryInitializer {\n\t\t\tget {\n\t\t\t\treturn Name == null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tElementInitializer target = (ElementInitializer) t;\n\t\t\ttarget.source = source.Clone (clonectx);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\tFieldExpr fe = target as FieldExpr;\n\t\t\tif (fe != null)\n\t\t\t\targs.Add (new Argument (fe.CreateTypeOfExpression ()));\n\t\t\telse\n\t\t\t\targs.Add (new Argument (((PropertyExpr) target).CreateSetterTypeOfExpression (ec)));\n\n\t\t\tstring mname;\n\t\t\tExpression arg_expr;\n\t\t\tvar cinit = source as CollectionOrObjectInitializers;\n\t\t\tif (cinit == null) {\n\t\t\t\tmname = \"Bind\";\n\t\t\t\targ_expr = source.CreateExpressionTree (ec);\n\t\t\t} else {\n\t\t\t\tmname = cinit.IsEmpty || cinit.Initializers[0] is ElementInitializer ? \"MemberBind\" : \"ListBind\";\n\t\t\t\targ_expr = cinit.CreateExpressionTree (ec, !cinit.IsEmpty);\n\t\t\t}\n\n\t\t\targs.Add (new Argument (arg_expr));\n\t\t\treturn CreateExpressionFactoryCall (ec, mname, args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (source == null)\n\t\t\t\treturn EmptyExpressionStatement.Instance;\n\n\t\t\tif (!ResolveElement (ec))\n\t\t\t\treturn null;\n\n\t\t\tif (source is CollectionOrObjectInitializers) {\n\t\t\t\tExpression previous = ec.CurrentInitializerVariable;\n\t\t\t\tec.CurrentInitializerVariable = target;\n\t\t\t\tsource = source.Resolve (ec);\n\t\t\t\tec.CurrentInitializerVariable = previous;\n\t\t\t\tif (source == null)\n\t\t\t\t\treturn null;\n\t\t\t\t\t\n\t\t\t\teclass = source.eclass;\n\t\t\t\ttype = source.Type;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\t\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tif (source is CollectionOrObjectInitializers)\n\t\t\t\tsource.Emit (ec);\n\t\t\telse\n\t\t\t\tbase.EmitStatement (ec);\n\t\t}\n\n\t\tprotected virtual bool ResolveElement (ResolveContext rc)\n\t\t{\n\t\t\tvar t = rc.CurrentInitializerVariable.Type;\n\t\t\tif (t.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\targs.Add (new Argument (rc.CurrentInitializerVariable));\n\t\t\t\ttarget = new DynamicMemberBinder (Name, args, loc);\n\t\t\t} else {\n\n\t\t\t\tvar member = MemberLookup (rc, false, t, Name, 0, MemberLookupRestrictions.ExactArity, loc);\n\t\t\t\tif (member == null) {\n\t\t\t\t\tmember = Expression.MemberLookup (rc, true, t, Name, 0, MemberLookupRestrictions.ExactArity, loc);\n\n\t\t\t\t\tif (member != null) {\n\t\t\t\t\t\t// TODO: ec.Report.SymbolRelatedToPreviousError (member);\n\t\t\t\t\t\tErrorIsInaccesible (rc, member.GetSignatureForError (), loc);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (member == null) {\n\t\t\t\t\tError_TypeDoesNotContainDefinition (rc, loc, t, Name);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar me = member as MemberExpr;\n\t\t\t\tif (me is EventExpr) {\n\t\t\t\t\tme = me.ResolveMemberAccess (rc, null, null);\n\t\t\t\t} else if (!(member is PropertyExpr || member is FieldExpr)) {\n\t\t\t\t\trc.Report.Error (1913, loc,\n\t\t\t\t\t\t\"Member `{0}' cannot be initialized. An object initializer may only be used for fields, or properties\",\n\t\t\t\t\t\tmember.GetSignatureForError ());\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (me.IsStatic) {\n\t\t\t\t\trc.Report.Error (1914, loc,\n\t\t\t\t\t\t\"Static field or property `{0}' cannot be assigned in an object initializer\",\n\t\t\t\t\t\tme.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\ttarget = me;\n\t\t\t\tme.InstanceExpression = rc.CurrentInitializerVariable;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\t//\n\t// A collection initializer expression\n\t//\n\tclass CollectionElementInitializer : Invocation\n\t{\n\t\tpublic readonly bool IsSingle;\n\n\n\t\tpublic class ElementInitializerArgument : Argument\n\t\t{\n\t\t\tpublic ElementInitializerArgument (Expression e)\n\t\t\t\t: base (e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\tsealed class AddMemberAccess : MemberAccess\n\t\t{\n\t\t\tpublic AddMemberAccess (Expression expr, Location loc)\n\t\t\t\t: base (expr, \"Add\", loc)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)\n\t\t\t{\n\t\t\t\tif (TypeManager.HasElementType (type))\n\t\t\t\t\treturn;\n\n\t\t\t\tbase.Error_TypeDoesNotContainDefinition (ec, type, name);\n\t\t\t}\n\t\t}\n\n\t\tpublic CollectionElementInitializer (Expression argument)\n\t\t\t: base (null, new Arguments (1))\n\t\t{\n\t\t\tIsSingle = true;\n\t\t\tbase.arguments.Add (new ElementInitializerArgument (argument));\n\t\t\tthis.loc = argument.Location;\n\t\t}\n\n\t\tpublic CollectionElementInitializer (List<Expression> arguments, Location loc)\n\t\t\t: base (null, new Arguments (arguments.Count))\n\t\t{\n\t\t\tIsSingle = false;\n\t\t\tforeach (Expression e in arguments)\n\t\t\t\tbase.arguments.Add (new ElementInitializerArgument (e));\n\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic CollectionElementInitializer (Location loc)\n\t\t\t: base (null, null)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (mg.CreateExpressionTree (ec)));\n\n\t\t\tvar expr_initializers = new ArrayInitializer (arguments.Count, loc);\n\t\t\tforeach (Argument a in arguments)\n\t\t\t\texpr_initializers.Add (a.CreateExpressionTree (ec));\n\n\t\t\targs.Add (new Argument (new ArrayCreation (\n\t\t\t\tCreateExpressionTypeExpression (ec, loc), expr_initializers, loc)));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"ElementInit\", args);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tCollectionElementInitializer target = (CollectionElementInitializer) t;\n\t\t\tif (arguments != null)\n\t\t\t\ttarget.arguments = arguments.Clone (clonectx);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tbase.expr = new AddMemberAccess (ec.CurrentInitializerVariable, loc);\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\t}\n\n\tclass DictionaryElementInitializer : ElementInitializer\n\t{\n\t\treadonly Arguments args;\n\n\t\tpublic DictionaryElementInitializer (List<Expression> arguments, Expression initializer, Location loc)\n\t\t\t: base (null, initializer, loc)\n\t\t{\n\t\t\tthis.args = new Arguments (arguments.Count);\n\t\t\tforeach (var arg in arguments)\n\t\t\t\tthis.args.Add (new Argument (arg));\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (8074, loc, \"Expression tree cannot contain a dictionary initializer\");\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override bool ResolveElement (ResolveContext rc)\n\t\t{\n\t\t\tvar init = rc.CurrentInitializerVariable;\n\t\t\tvar type = init.Type;\n\n\t\t\tvar indexers = MemberCache.FindMembers (type, MemberCache.IndexerNameAlias, false);\n\t\t\tif (indexers == null && type.BuiltinType != BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tElementAccess.Error_CannotApplyIndexing (rc, type, loc);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ttarget = new IndexerExpr (indexers, type, init, args, loc).Resolve (rc);\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\t//\n\t// A block of object or collection initializers\n\t//\n\tpublic class CollectionOrObjectInitializers : ExpressionStatement\n\t{\n\t\tIList<Expression> initializers;\n\t\tbool is_collection_initialization;\n\n\t\tpublic CollectionOrObjectInitializers (Location loc)\n\t\t\t: this (new Expression[0], loc)\n\t\t{\n\t\t}\n\n\t\tpublic CollectionOrObjectInitializers (IList<Expression> initializers, Location loc)\n\t\t{\n\t\t\tthis.initializers = initializers;\n\t\t\tthis.loc = loc;\n\t\t}\n\t\t\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn initializers.Count == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCollectionInitializer {\n\t\t\tget {\n\t\t\t\treturn is_collection_initialization;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<Expression> Initializers {\n\t\t\tget {\n\t\t\t\treturn initializers;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tCollectionOrObjectInitializers t = (CollectionOrObjectInitializers) target;\n\n\t\t\tt.initializers = new List<Expression> (initializers.Count);\n\t\t\tforeach (var e in initializers)\n\t\t\t\tt.initializers.Add (e.Clone (clonectx));\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tforeach (var e in initializers) {\n\t\t\t\tif (e.ContainsEmitWithAwait ())\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn CreateExpressionTree (ec, false);\n\t\t}\n\n\t\tpublic Expression CreateExpressionTree (ResolveContext ec, bool inferType)\n\t\t{\n\t\t\tvar expr_initializers = new ArrayInitializer (initializers.Count, loc);\n\t\t\tforeach (Expression e in initializers) {\n\t\t\t\tExpression expr = e.CreateExpressionTree (ec);\n\t\t\t\tif (expr != null)\n\t\t\t\t\texpr_initializers.Add (expr);\n\t\t\t}\n\n\t\t\tif (inferType)\n\t\t\t\treturn new ImplicitlyTypedArrayCreation (expr_initializers, loc);\n\n\t\t\treturn new ArrayCreation (new TypeExpression (ec.Module.PredefinedTypes.MemberBinding.Resolve (), loc), expr_initializers, loc); \n\t\t}\n\t\t\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tList<string> element_names = null;\n\t\t\tfor (int i = 0; i < initializers.Count; ++i) {\n\t\t\t\tExpression initializer = initializers [i];\n\t\t\t\tElementInitializer element_initializer = initializer as ElementInitializer;\n\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tif (element_initializer != null) {\n\t\t\t\t\t\telement_names = new List<string> (initializers.Count);\n\t\t\t\t\t\tif (!element_initializer.IsDictionaryInitializer)\n\t\t\t\t\t\t\telement_names.Add (element_initializer.Name);\n\t\t\t\t\t} else if (initializer is CompletingExpression) {\n\t\t\t\t\t\tinitializer.Resolve (ec);\n\t\t\t\t\t\tthrow new InternalErrorException (\"This line should never be reached\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar t = ec.CurrentInitializerVariable.Type;\n\t\t\t\t\t\t// LAMESPEC: The collection must implement IEnumerable only, no dynamic support\n\t\t\t\t\t\tif (!t.ImplementsInterface (ec.BuiltinTypes.IEnumerable, false) && t.BuiltinType != BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\t\t\tec.Report.Error (1922, loc, \"A field or property `{0}' cannot be initialized with a collection \" +\n\t\t\t\t\t\t\t\t\"object initializer because type `{1}' does not implement `{2}' interface\",\n\t\t\t\t\t\t\t\tec.CurrentInitializerVariable.GetSignatureForError (),\n\t\t\t\t\t\t\t\tec.CurrentInitializerVariable.Type.GetSignatureForError (),\n\t\t\t\t\t\t\t\tec.BuiltinTypes.IEnumerable.GetSignatureForError ());\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tis_collection_initialization = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (is_collection_initialization != (element_initializer == null)) {\n\t\t\t\t\t\tec.Report.Error (747, initializer.Location, \"Inconsistent `{0}' member declaration\",\n\t\t\t\t\t\t\tis_collection_initialization ? \"collection initializer\" : \"object initializer\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!is_collection_initialization && !element_initializer.IsDictionaryInitializer) {\n\t\t\t\t\t\tif (element_names.Contains (element_initializer.Name)) {\n\t\t\t\t\t\t\tec.Report.Error (1912, element_initializer.Location,\n\t\t\t\t\t\t\t\t\"An object initializer includes more than one member `{0}' initialization\",\n\t\t\t\t\t\t\t\telement_initializer.Name);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telement_names.Add (element_initializer.Name);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tExpression e = initializer.Resolve (ec);\n\t\t\t\tif (e == EmptyExpressionStatement.Instance)\n\t\t\t\t\tinitializers.RemoveAt (i--);\n\t\t\t\telse\n\t\t\t\t\tinitializers [i] = e;\n\t\t\t}\n\n\t\t\ttype = ec.CurrentInitializerVariable.Type;\n\t\t\tif (is_collection_initialization) {\n\t\t\t\tif (TypeManager.HasElementType (type)) {\n\t\t\t\t\tec.Report.Error (1925, loc, \"Cannot initialize object of type `{0}' with a collection initializer\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\teclass = ExprClass.Variable;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmitStatement (ec);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tforeach (ExpressionStatement e in initializers) {\n\t\t\t\t// TODO: need location region\n\t\t\t\tec.Mark (e.Location);\n\t\t\t\te.EmitStatement (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tforeach (var initializer in initializers) {\n\t\t\t\tif (initializer != null)\n\t\t\t\t\tinitializer.FlowAnalysis (fc);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//\n\t// New expression with element/object initializers\n\t//\n\tpublic class NewInitialize : New\n\t{\n\t\t//\n\t\t// This class serves as a proxy for variable initializer target instances.\n\t\t// A real variable is assigned later when we resolve left side of an\n\t\t// assignment\n\t\t//\n\t\tsealed class InitializerTargetExpression : Expression, IMemoryLocation\n\t\t{\n\t\t\tNewInitialize new_instance;\n\n\t\t\tpublic InitializerTargetExpression (NewInitialize newInstance)\n\t\t\t{\n\t\t\t\tthis.type = newInstance.type;\n\t\t\t\tthis.loc = newInstance.loc;\n\t\t\t\tthis.eclass = newInstance.eclass;\n\t\t\t\tthis.new_instance = newInstance;\n\t\t\t}\n\n\t\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\t// Should not be reached\n\t\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tExpression e = (Expression) new_instance.instance;\n\t\t\t\te.Emit (ec);\n\t\t\t}\n\n\t\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t\t{\n\t\t\t\treturn (Expression) new_instance.instance;\n\t\t\t}\n\n\t\t\t#region IMemoryLocation Members\n\n\t\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t\t{\n\t\t\t\tnew_instance.instance.AddressOf (ec, mode);\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\tCollectionOrObjectInitializers initializers;\n\t\tIMemoryLocation instance;\n\t\tDynamicExpressionStatement dynamic;\n\n\t\tpublic NewInitialize (FullNamedExpression requested_type, Arguments arguments, CollectionOrObjectInitializers initializers, Location l)\n\t\t\t: base (requested_type, arguments, l)\n\t\t{\n\t\t\tthis.initializers = initializers;\n\t\t}\n\n\t\tpublic CollectionOrObjectInitializers Initializers {\n\t\t\tget {\n\t\t\t\treturn initializers;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tbase.CloneTo (clonectx, t);\n\n\t\t\tNewInitialize target = (NewInitialize) t;\n\t\t\ttarget.initializers = (CollectionOrObjectInitializers) initializers.Clone (clonectx);\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn base.ContainsEmitWithAwait () || initializers.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tArguments args = new Arguments (2);\n\t\t\targs.Add (new Argument (base.CreateExpressionTree (ec)));\n\t\t\tif (!initializers.IsEmpty)\n\t\t\t\targs.Add (new Argument (initializers.CreateExpressionTree (ec, initializers.IsCollectionInitializer)));\n\n\t\t\treturn CreateExpressionFactoryCall (ec,\n\t\t\t\tinitializers.IsCollectionInitializer ? \"ListInit\" : \"MemberInit\",\n\t\t\t\targs);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tExpression e = base.DoResolve (ec);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\tif (type.IsDelegate) {\n\t\t\t\tec.Report.Error (1958, Initializers.Location,\n\t\t\t\t\t\"Object and collection initializers cannot be used to instantiate a delegate\");\n\t\t\t}\n\n\t\t\tExpression previous = ec.CurrentInitializerVariable;\n\t\t\tec.CurrentInitializerVariable = new InitializerTargetExpression (this);\n\t\t\tinitializers.Resolve (ec);\n\t\t\tec.CurrentInitializerVariable = previous;\n\n\t\t\tdynamic = e as DynamicExpressionStatement;\n\t\t\tif (dynamic != null)\n\t\t\t\treturn this;\n\n\t\t\treturn e;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (method == null && TypeSpec.IsValueType (type) && initializers.Initializers.Count > 1 && ec.HasSet (BuilderContext.Options.AsyncBody) && initializers.ContainsEmitWithAwait ()) {\n\t\t\t\tvar fe = ec.GetTemporaryField (type);\n\n\t\t\t\tif (!Emit (ec, fe))\n\t\t\t\t\tfe.Emit (ec);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.Emit (ec);\n\t\t}\n\n\t\tpublic override bool Emit (EmitContext ec, IMemoryLocation target)\n\t\t{\n\t\t\tbool left_on_stack;\n\t\t\tif (dynamic != null) {\n\t\t\t\tdynamic.Emit (ec);\n\t\t\t\tleft_on_stack = true;\n\t\t\t} else {\n\t\t\t\tleft_on_stack = base.Emit (ec, target);\n\t\t\t}\n\n\t\t\tif (initializers.IsEmpty)\n\t\t\t\treturn left_on_stack;\n\n\t\t\tLocalTemporary temp = null;\n\n\t\t\tinstance = target as LocalTemporary;\n\t\t\tif (instance == null)\n\t\t\t\tinstance = target as StackFieldExpr;\n\n\t\t\tif (instance == null) {\n\t\t\t\tif (!left_on_stack) {\n\t\t\t\t\tVariableReference vr = target as VariableReference;\n\n\t\t\t\t\t// FIXME: This still does not work correctly for pre-set variables\n\t\t\t\t\tif (vr != null && vr.IsRef)\n\t\t\t\t\t\ttarget.AddressOf (ec, AddressOp.Load);\n\n\t\t\t\t\t((Expression) target).Emit (ec);\n\t\t\t\t\tleft_on_stack = true;\n\t\t\t\t}\n\n\t\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && initializers.ContainsEmitWithAwait ()) {\n\t\t\t\t\tinstance = new EmptyAwaitExpression (Type).EmitToField (ec) as IMemoryLocation;\n\t\t\t\t} else {\n\t\t\t\t\ttemp = new LocalTemporary (type);\n\t\t\t\t\tinstance = temp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (left_on_stack && temp != null)\n\t\t\t\ttemp.Store (ec);\n\n\t\t\tinitializers.Emit (ec);\n\n\t\t\tif (left_on_stack) {\n\t\t\t\tif (temp != null) {\n\t\t\t\t\ttemp.Emit (ec);\n\t\t\t\t\ttemp.Release (ec);\n\t\t\t\t} else {\n\t\t\t\t\t((Expression) instance).Emit (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn left_on_stack;\n\t\t}\n\n\t\tprotected override IMemoryLocation EmitAddressOf (EmitContext ec, AddressOp Mode)\n\t\t{\n\t\t\tinstance = base.EmitAddressOf (ec, Mode);\n\n\t\t\tif (!initializers.IsEmpty)\n\t\t\t\tinitializers.Emit (ec);\n\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tbase.FlowAnalysis (fc);\n\t\t\tinitializers.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class NewAnonymousType : New\n\t{\n\t\tstatic readonly AnonymousTypeParameter[] EmptyParameters = new AnonymousTypeParameter[0];\n\n\t\tList<AnonymousTypeParameter> parameters;\n\t\treadonly TypeContainer parent;\n\t\tAnonymousTypeClass anonymous_type;\n\n\t\tpublic NewAnonymousType (List<AnonymousTypeParameter> parameters, TypeContainer parent, Location loc)\n\t\t\t : base (null, null, loc)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t\tthis.parent = parent;\n\t\t}\n\n\t\tpublic List<AnonymousTypeParameter> Parameters {\n\t\t\tget {\n\t\t\t\treturn this.parameters;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tif (parameters == null)\n\t\t\t\treturn;\n\n\t\t\tNewAnonymousType t = (NewAnonymousType) target;\n\t\t\tt.parameters = new List<AnonymousTypeParameter> (parameters.Count);\n\t\t\tforeach (AnonymousTypeParameter atp in parameters)\n\t\t\t\tt.parameters.Add ((AnonymousTypeParameter) atp.Clone (clonectx));\n\t\t}\n\n\t\tAnonymousTypeClass CreateAnonymousType (ResolveContext ec, IList<AnonymousTypeParameter> parameters)\n\t\t{\n\t\t\tAnonymousTypeClass type = parent.Module.GetAnonymousType (parameters);\n\t\t\tif (type != null)\n\t\t\t\treturn type;\n\n\t\t\ttype = AnonymousTypeClass.Create (parent, parameters, loc);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\tint errors = ec.Report.Errors;\n\t\t\ttype.CreateContainer ();\n\t\t\ttype.DefineContainer ();\n\t\t\ttype.Define ();\n\t\t\tif ((ec.Report.Errors - errors) == 0) {\n\t\t\t\tparent.Module.AddAnonymousType (type);\n\t\t\t\ttype.PrepareEmit ();\n\t\t\t}\n\n\t\t\treturn type;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (parameters == null)\n\t\t\t\treturn base.CreateExpressionTree (ec);\n\n\t\t\tvar init = new ArrayInitializer (parameters.Count, loc);\n\t\t\tforeach (var m in anonymous_type.Members) {\n\t\t\t\tvar p = m as Property;\n\t\t\t\tif (p != null)\n\t\t\t\t\tinit.Add (new TypeOfMethod (MemberCache.GetMember (type, p.Get.Spec), loc));\n\t\t\t}\n\n\t\t\tvar ctor_args = new ArrayInitializer (arguments.Count, loc);\n\t\t\tforeach (Argument a in arguments)\n\t\t\t\tctor_args.Add (a.CreateExpressionTree (ec));\n\n\t\t\tArguments args = new Arguments (3);\n\t\t\targs.Add (new Argument (new TypeOfMethod (method, loc)));\n\t\t\targs.Add (new Argument (new ArrayCreation (CreateExpressionTypeExpression (ec, loc), ctor_args, loc)));\n\t\t\targs.Add (new Argument (new ImplicitlyTypedArrayCreation (init, loc)));\n\n\t\t\treturn CreateExpressionFactoryCall (ec, \"New\", args);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tif (ec.HasSet (ResolveContext.Options.ConstantScope)) {\n\t\t\t\tec.Report.Error (836, loc, \"Anonymous types cannot be used in this expression\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (parameters == null) {\n\t\t\t\tanonymous_type = CreateAnonymousType (ec, EmptyParameters);\n\t\t\t\tRequestedType = new TypeExpression (anonymous_type.Definition, loc);\n\t\t\t\treturn base.DoResolve (ec);\n\t\t\t}\n\n\t\t\tbool error = false;\n\t\t\targuments = new Arguments (parameters.Count);\n\t\t\tvar t_args = new TypeSpec [parameters.Count];\n\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\tExpression e = parameters [i].Resolve (ec);\n\t\t\t\tif (e == null) {\n\t\t\t\t\terror = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\targuments.Add (new Argument (e));\n\t\t\t\tt_args [i] = e.Type;\n\t\t\t}\n\n\t\t\tif (error)\n\t\t\t\treturn null;\n\n\t\t\tanonymous_type = CreateAnonymousType (ec, parameters);\n\t\t\tif (anonymous_type == null)\n\t\t\t\treturn null;\n\n\t\t\ttype = anonymous_type.Definition.MakeGenericType (ec.Module, t_args);\n\t\t\tmethod = (MethodSpec) MemberCache.FindMember (type, MemberFilter.Constructor (null), BindingRestriction.DeclaredOnly);\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class AnonymousTypeParameter : ShimExpression\n\t{\n\t\tpublic readonly string Name;\n\n\t\tpublic AnonymousTypeParameter (Expression initializer, string name, Location loc)\n\t\t\t: base (initializer)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.loc = loc;\n\t\t}\n\t\t\n\t\tpublic AnonymousTypeParameter (Parameter parameter)\n\t\t\t: base (new SimpleName (parameter.Name, parameter.Location))\n\t\t{\n\t\t\tthis.Name = parameter.Name;\n\t\t\tthis.loc = parameter.Location;\n\t\t}\t\t\n\n\t\tpublic override bool Equals (object o)\n\t\t{\n\t\t\tAnonymousTypeParameter other = o as AnonymousTypeParameter;\n\t\t\treturn other != null && Name == other.Name;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn Name.GetHashCode ();\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tExpression e = expr.Resolve (ec);\n\t\t\tif (e == null)\n\t\t\t\treturn null;\n\n\t\t\tif (e.eclass == ExprClass.MethodGroup) {\n\t\t\t\tError_InvalidInitializer (ec, e.ExprClassName);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\ttype = e.Type;\n\t\t\tif (type.Kind == MemberKind.Void || type == InternalType.NullLiteral || type == InternalType.AnonymousMethod || type.IsPointer) {\n\t\t\t\tError_InvalidInitializer (ec, type.GetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn e;\n\t\t}\n\n\t\tprotected virtual void Error_InvalidInitializer (ResolveContext ec, string initializer)\n\t\t{\n\t\t\tec.Report.Error (828, loc, \"An anonymous type property `{0}' cannot be initialized with `{1}'\",\n\t\t\t\tName, initializer);\n\t\t}\n\t}\n\n\tpublic class CatchFilterExpression : BooleanExpression\n\t{\n\t\tpublic CatchFilterExpression (Expression expr, Location loc)\n\t\t\t: base (expr)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/field.cs",
    "content": "//\n// field.cs: All field handlers\n//\n// Authors: Miguel de Icaza (miguel@gnu.org)\n//          Martin Baulig (martin@ximian.com)\n//          Marek Safar (marek.safar@seznam.cz)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\tpublic class FieldDeclarator\n\t{\n\t\tpublic FieldDeclarator (SimpleMemberName name, Expression initializer)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Initializer = initializer;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic SimpleMemberName Name { get; private set; }\n\t\tpublic Expression Initializer { get; private set; }\n\n\t\t#endregion\n\n\t\tpublic virtual FullNamedExpression GetFieldTypeExpression (FieldBase field)\n\t\t{\n\t\t\treturn new TypeExpression (field.MemberType, Name.Location); \n\t\t}\n\t}\n\n\t//\n\t// Abstract class for all fields\n\t//\n\tabstract public class FieldBase : MemberBase\n\t{\n\t\tprotected FieldBuilder FieldBuilder;\n\t\tprotected FieldSpec spec;\n\t\tpublic Status status;\n\t\tprotected Expression initializer;\n\t\tprotected List<FieldDeclarator> declarators;\n\n\t\t[Flags]\n\t\tpublic enum Status : byte {\n\t\t\tHAS_OFFSET = 4\t\t// Used by FieldMember.\n\t\t}\n\n\t\tstatic readonly string[] attribute_targets = new string [] { \"field\" };\n\n\t\tprotected FieldBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod, allowed_mod | Modifiers.ABSTRACT, Modifiers.PRIVATE, name, attrs)\n\t\t{\n\t\t\tif ((mod & Modifiers.ABSTRACT) != 0)\n\t\t\t\tReport.Error (681, Location, \"The modifier 'abstract' is not valid on fields. Try using a property instead\");\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Field;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Initializer {\n\t\t\tget {\n\t\t\t\treturn initializer;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.initializer = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn MemberName.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic FieldSpec Spec {\n\t\t\tget {\n\t\t\t\treturn spec;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets  {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic List<FieldDeclarator> Declarators {\n\t\t\tget {\n\t\t\t\treturn this.declarators;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic void AddDeclarator (FieldDeclarator declarator)\n\t\t{\n\t\t\tif (declarators == null)\n\t\t\t\tdeclarators = new List<FieldDeclarator> (2);\n\n\t\t\tdeclarators.Add (declarator);\n\n\t\t\tParent.AddNameToContainer (this, declarator.Name.Value);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.FieldOffset) {\n\t\t\t\tstatus |= Status.HAS_OFFSET;\n\n\t\t\t\tif (!Parent.PartialContainer.HasExplicitLayout) {\n\t\t\t\t\tReport.Error (636, Location, \"The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit)\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ((ModFlags & Modifiers.STATIC) != 0 || this is Const) {\n\t\t\t\t\tReport.Error (637, Location, \"The FieldOffset attribute is not allowed on static or const fields\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (a.Type == pa.FixedBuffer) {\n\t\t\t\tReport.Error (1716, Location, \"Do not use 'System.Runtime.CompilerServices.FixedBuffer' attribute. Use the 'fixed' field modifier instead\");\n\t\t\t\treturn;\n\t\t\t}\n\n#if false\n\t\t\tif (a.Type == pa.MarshalAs) {\n\t\t\t\tUnmanagedMarshal marshal = a.GetMarshal (this);\n\t\t\t\tif (marshal != null) {\n\t\t\t\t\tFieldBuilder.SetMarshal (marshal);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n#endif\n\t\t\tif ((a.HasSecurityAttribute)) {\n\t\t\t\ta.Error_InvalidSecurityParent ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Dynamic) {\n\t\t\t\ta.Error_MisusedDynamicAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tFieldBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tpublic void SetCustomAttribute (MethodSpec ctor, byte[] data)\n\t\t{\n\t\t\tFieldBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), data);\n\t\t}\n\n \t\tprotected override bool CheckBase ()\n\t\t{\n \t\t\tif (!base.CheckBase ())\n \t\t\t\treturn false;\n\n\t\t\tMemberSpec candidate;\n\t\t\tbool overrides = false;\n\t\t\tvar conflict_symbol = MemberCache.FindBaseMember (this, out candidate, ref overrides);\n\t\t\tif (conflict_symbol == null)\n\t\t\t\tconflict_symbol = candidate;\n\n \t\t\tif (conflict_symbol == null) {\n \t\t\t\tif ((ModFlags & Modifiers.NEW) != 0) {\n \t\t\t\t\tReport.Warning (109, 4, Location, \"The member `{0}' does not hide an inherited member. The new keyword is not required\",\n\t\t\t\t\t\tGetSignatureForError ());\n \t\t\t\t}\n \t\t\t} else {\n\t\t\t\tif ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE | Modifiers.BACKING_FIELD)) == 0) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (conflict_symbol);\n\t\t\t\t\tReport.Warning (108, 2, Location, \"`{0}' hides inherited member `{1}'. Use the new keyword if hiding was intended\",\n\t\t\t\t\t\tGetSignatureForError (), conflict_symbol.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (conflict_symbol.IsAbstract) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (conflict_symbol);\n\t\t\t\t\tReport.Error (533, Location, \"`{0}' hides inherited abstract member `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), conflict_symbol.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n \n \t\t\treturn true;\n \t\t}\n\n\t\tpublic virtual Constant ConvertInitializer (ResolveContext rc, Constant expr)\n\t\t{\n\t\t\treturn expr.ConvertImplicitly (MemberType);\n\t\t}\n\n\t\tprotected override void DoMemberTypeDependentChecks ()\n\t\t{\n\t\t\tbase.DoMemberTypeDependentChecks ();\n\n\t\t\tif (MemberType.IsGenericParameter)\n\t\t\t\treturn;\n\n\t\t\tif (MemberType.IsStatic)\n\t\t\t\tError_VariableOfStaticClass (Location, GetSignatureForError (), MemberType, Report);\n\n\t\t\tif (!IsCompilerGenerated)\n\t\t\t\tCheckBase ();\n\n\t\t\tIsTypePermitted ();\n\t\t}\n\n\t\t//\n\t\t//   Represents header string for documentation comment.\n\t\t//\n\t\tpublic override string DocCommentHeader {\n\t\t\tget { return \"F:\"; }\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tif (member_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (FieldBuilder);\n\t\t\t} else if (!Parent.IsCompilerGenerated && member_type.HasDynamicElement) {\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (FieldBuilder, member_type, Location);\n\t\t\t}\n\n\t\t\tif ((ModFlags & Modifiers.COMPILER_GENERATED) != 0 && !Parent.IsCompilerGenerated)\n\t\t\t\tModule.PredefinedAttributes.CompilerGenerated.EmitAttribute (FieldBuilder);\n\t\t\tif ((ModFlags & Modifiers.DEBUGGER_HIDDEN) != 0)\n\t\t\t\tModule.PredefinedAttributes.DebuggerBrowsable.EmitAttribute (FieldBuilder, System.Diagnostics.DebuggerBrowsableState.Never);\n\n\t\t\tif (OptAttributes != null) {\n\t\t\t\tOptAttributes.Emit ();\n\t\t\t}\n\n\t\t\tif (((status & Status.HAS_OFFSET) == 0) && (ModFlags & (Modifiers.STATIC | Modifiers.BACKING_FIELD)) == 0 && Parent.PartialContainer.HasExplicitLayout) {\n\t\t\t\tReport.Error (625, Location, \"`{0}': Instance field types marked with StructLayout(LayoutKind.Explicit) must have a FieldOffset attribute\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\tConstraintChecker.Check (this, member_type, type_expr.Location);\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic static void Error_VariableOfStaticClass (Location loc, string variable_name, TypeSpec static_class, Report Report)\n\t\t{\n\t\t\tReport.SymbolRelatedToPreviousError (static_class);\n\t\t\tReport.Error (723, loc, \"`{0}': cannot declare variables of static types\",\n\t\t\t\tvariable_name);\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\tif (!MemberType.IsCLSCompliant () || this is FixedField) {\n\t\t\t\tReport.Warning (3003, 1, Location, \"Type of `{0}' is not CLS-compliant\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//\n\t// Field specification\n\t//\n\tpublic class FieldSpec : MemberSpec, IInterfaceMemberSpec\n\t{\n\t\tFieldInfo metaInfo;\n\t\tTypeSpec memberType;\n\n\t\tpublic FieldSpec (TypeSpec declaringType, IMemberDefinition definition, TypeSpec memberType, FieldInfo info, Modifiers modifiers)\n\t\t\t: base (MemberKind.Field, declaringType, definition, modifiers)\n\t\t{\n\t\t\tthis.metaInfo = info;\n\t\t\tthis.memberType = memberType;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn (Modifiers & Modifiers.READONLY) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec MemberType {\n\t\t\tget {\n\t\t\t\treturn memberType;\n\t\t\t}\n\t\t}\n\n#endregion\n\n\t\tpublic FieldInfo GetMetaInfo ()\n\t\t{\n\t\t\tif ((state & StateFlags.PendingMetaInflate) != 0) {\n\t\t\t\tvar decl_meta = DeclaringType.GetMetaInfo ();\n\t\t\t\tif (DeclaringType.IsTypeBuilder) {\n\t\t\t\t\tmetaInfo = TypeBuilder.GetField (decl_meta, metaInfo);\n\t\t\t\t} else {\n\t\t\t\t\tvar orig_token = metaInfo.MetadataToken;\n\t\t\t\t\tmetaInfo = decl_meta.GetField (Name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);\n\t\t\t\t\tif (metaInfo.MetadataToken != orig_token)\n\t\t\t\t\t\tthrow new NotImplementedException (\"Resolved to wrong meta token\");\n\n\t\t\t\t\t// What a stupid API, does not work because field handle is imported\n\t\t\t\t\t// metaInfo = FieldInfo.GetFieldFromHandle (metaInfo.FieldHandle, DeclaringType.MetaInfo.TypeHandle);\n\t\t\t\t}\n\n\t\t\t\tstate &= ~StateFlags.PendingMetaInflate;\n\t\t\t}\n\n\t\t\treturn metaInfo;\n\t\t}\n\n\t\tpublic override MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar fs = (FieldSpec) base.InflateMember (inflator);\n\t\t\tfs.memberType = inflator.Inflate (memberType);\n\t\t\treturn fs;\n\t\t}\n\n\t\tpublic FieldSpec Mutate (TypeParameterMutator mutator)\n\t\t{\n\t\t\tvar decl = DeclaringType;\n\t\t\tif (DeclaringType.IsGenericOrParentIsGeneric)\n\t\t\t\tdecl = mutator.Mutate (decl);\n\n\t\t\tif (decl == DeclaringType)\n\t\t\t\treturn this;\n\n\t\t\tvar fs = (FieldSpec) MemberwiseClone ();\n\t\t\tfs.declaringType = decl;\n\t\t\tfs.state |= StateFlags.PendingMetaInflate;\n\n\t\t\t// Gets back FieldInfo in case of metaInfo was inflated\n\t\t\tfs.metaInfo = MemberCache.GetMember (TypeParameterMutator.GetMemberDeclaringType (DeclaringType), this).metaInfo;\n\t\t\treturn fs;\n\t\t}\n\n\t\tpublic override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\treturn memberType.ResolveMissingDependencies (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Fixed buffer implementation\n\t/// </summary>\n\tpublic class FixedField : FieldBase\n\t{\n\t\tpublic const string FixedElementName = \"FixedElementField\";\n\t\tstatic int GlobalCounter;\n\n\t\tTypeBuilder fixed_buffer_type;\n\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE |\n\t\t\tModifiers.UNSAFE;\n\n\t\tpublic FixedField (TypeDefinition parent, FullNamedExpression type, Modifiers mod, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod, AllowedModifiers, name, attrs)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\t//\n\t\t// Explicit struct layout set by parent\n\t\t//\n\t\tpublic CharSet? CharSet {\n\t\t\tget; set;\n\t\t}\t\t\n\n\t\t#endregion\n\n\t\tpublic override Constant ConvertInitializer (ResolveContext rc, Constant expr)\n\t\t{\n\t\t\treturn expr.ImplicitConversionRequired (rc, rc.BuiltinTypes.Int);\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (!BuiltinTypeSpec.IsPrimitiveType (MemberType)) {\n\t\t\t\tReport.Error (1663, Location,\n\t\t\t\t\t\"`{0}': Fixed size buffers type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t} else if (declarators != null) {\n\t\t\t\tforeach (var d in declarators) {\n\t\t\t\t\tvar f = new FixedField (Parent, d.GetFieldTypeExpression (this), ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);\n\t\t\t\t\tf.initializer = d.Initializer;\n\t\t\t\t\t((ConstInitializer) f.initializer).Name = d.Name.Value;\n\t\t\t\t\tf.Define ();\n\t\t\t\t\tParent.PartialContainer.Members.Add (f);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Create nested fixed buffer container\n\t\t\tstring name = String.Format (\"<{0}>__FixedBuffer{1}\", Name, GlobalCounter++);\n\t\t\tfixed_buffer_type = Parent.TypeBuilder.DefineNestedType (name,\n\t\t\t\tTypeAttributes.NestedPublic | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit,\n\t\t\t\tCompiler.BuiltinTypes.ValueType.GetMetaInfo ());\n\n\t\t\tvar ffield = fixed_buffer_type.DefineField (FixedElementName, MemberType.GetMetaInfo (), FieldAttributes.Public);\n\t\t\t\n\t\t\tFieldBuilder = Parent.TypeBuilder.DefineField (Name, fixed_buffer_type, ModifiersExtensions.FieldAttr (ModFlags));\n\n\t\t\tvar element_spec = new FieldSpec (null, this, MemberType, ffield, ModFlags);\n\t\t\tspec = new FixedFieldSpec (Module, Parent.Definition, this, FieldBuilder, element_spec, ModFlags);\n\n\t\t\tParent.MemberCache.AddMember (spec);\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoMemberTypeIndependentChecks ()\n\t\t{\n\t\t\tbase.DoMemberTypeIndependentChecks ();\n\n\t\t\tif (!IsUnsafe)\n\t\t\t\tExpression.UnsafeError (Report, Location);\n\n\t\t\tif (Parent.PartialContainer.Kind != MemberKind.Struct) {\n\t\t\t\tReport.Error (1642, Location, \"`{0}': Fixed size buffer fields may only be members of structs\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void Emit()\n\t\t{\n\t\t\tResolveContext rc = new ResolveContext (this);\n\t\t\tIntConstant buffer_size_const = initializer.Resolve (rc) as IntConstant;\n\t\t\tif (buffer_size_const == null)\n\t\t\t\treturn;\n\n\t\t\tint buffer_size = buffer_size_const.Value;\n\n\t\t\tif (buffer_size <= 0) {\n\t\t\t\tReport.Error (1665, Location, \"`{0}': Fixed size buffers must have a length greater than zero\", GetSignatureForError ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEmitFieldSize (buffer_size);\n\n#if STATIC\n\t\t\tif (Module.HasDefaultCharSet)\n\t\t\t\tfixed_buffer_type.__SetAttributes (fixed_buffer_type.Attributes | Module.DefaultCharSetType);\n#endif\n\n\t\t\tModule.PredefinedAttributes.UnsafeValueType.EmitAttribute (fixed_buffer_type);\n\t\t\tModule.PredefinedAttributes.CompilerGenerated.EmitAttribute (fixed_buffer_type);\n\t\t\tfixed_buffer_type.CreateType ();\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tvoid EmitFieldSize (int buffer_size)\n\t\t{\n\t\t\tint type_size = BuiltinTypeSpec.GetSize (MemberType);\n\n\t\t\tif (buffer_size > int.MaxValue / type_size) {\n\t\t\t\tReport.Error (1664, Location, \"Fixed size buffer `{0}' of length `{1}' and type `{2}' exceeded 2^31 limit\",\n\t\t\t\t\tGetSignatureForError (), buffer_size.ToString (), MemberType.GetSignatureForError ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tAttributeEncoder encoder;\n\n\t\t\tvar ctor = Module.PredefinedMembers.StructLayoutAttributeCtor.Resolve (Location);\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tvar field_size = Module.PredefinedMembers.StructLayoutSize.Resolve (Location);\n\t\t\tvar field_charset = Module.PredefinedMembers.StructLayoutCharSet.Resolve (Location);\n\t\t\tif (field_size == null || field_charset == null)\n\t\t\t\treturn;\n\n\t\t\tvar char_set = CharSet ?? Module.DefaultCharSet ?? 0;\n\n\t\t\tencoder = new AttributeEncoder ();\n\t\t\tencoder.Encode ((short)LayoutKind.Sequential);\n\t\t\tencoder.EncodeNamedArguments (\n\t\t\t\tnew [] { field_size, field_charset },\n\t\t\t\tnew Constant [] { \n\t\t\t\t\tnew IntConstant (Compiler.BuiltinTypes, buffer_size * type_size, Location),\n\t\t\t\t\tnew IntConstant (Compiler.BuiltinTypes, (int) char_set, Location)\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tfixed_buffer_type.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\n\t\t\t//\n\t\t\t// Don't emit FixedBufferAttribute attribute for private types\n\t\t\t//\n\t\t\tif ((ModFlags & Modifiers.PRIVATE) != 0)\n\t\t\t\treturn;\n\n\t\t\tctor = Module.PredefinedMembers.FixedBufferAttributeCtor.Resolve (Location);\n\t\t\tif (ctor == null)\n\t\t\t\treturn;\n\n\t\t\tencoder = new AttributeEncoder ();\n\t\t\tencoder.EncodeTypeName (MemberType);\n\t\t\tencoder.Encode (buffer_size);\n\t\t\tencoder.EncodeEmptyNamedArguments ();\n\n\t\t\tFieldBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), encoder.ToArray ());\n\t\t}\n\t}\n\n\tclass FixedFieldSpec : FieldSpec\n\t{\n\t\treadonly FieldSpec element;\n\n\t\tpublic FixedFieldSpec (ModuleContainer module, TypeSpec declaringType, IMemberDefinition definition, FieldInfo info, FieldSpec element, Modifiers modifiers)\n\t\t\t: base (declaringType, definition, PointerContainer.MakeType (module, element.MemberType), info, modifiers)\n\t\t{\n\t\t\tthis.element = element;\n\n\t\t\t// It's never CLS-Compliant\n\t\t\tstate &= ~StateFlags.CLSCompliant_Undetected;\n\t\t}\n\n\t\tpublic FieldSpec Element {\n\t\t\tget {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic TypeSpec ElementType {\n\t\t\tget {\n\t\t\t\treturn element.MemberType;\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// The Field class is used to represents class/struct fields during parsing.\n\t//\n\tpublic class Field : FieldBase {\n\t\t// <summary>\n\t\t//   Modifiers allowed in a class declaration\n\t\t// </summary>\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE |\n\t\t\tModifiers.STATIC |\n\t\t\tModifiers.VOLATILE |\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.READONLY;\n\n\t\tpublic Field (TypeDefinition parent, FullNamedExpression type, Modifiers mod, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod, AllowedModifiers, name, attrs)\n\t\t{\n\t\t}\n\n\t\tbool CanBeVolatile ()\n\t\t{\n\t\t\tswitch (MemberType.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\tcase BuiltinTypeSpec.Type.UIntPtr:\n\t\t\tcase BuiltinTypeSpec.Type.IntPtr:\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (TypeSpec.IsReferenceType (MemberType))\n\t\t\t\treturn true;\n\n\t\t\tif (MemberType.IsEnum)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\t\t\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tMetaType[] required_modifier = null;\n\t\t\tif ((ModFlags & Modifiers.VOLATILE) != 0) {\n\t\t\t\tvar mod = Module.PredefinedTypes.IsVolatile.Resolve ();\n\t\t\t\tif (mod != null)\n\t\t\t\t\trequired_modifier = new MetaType[] { mod.GetMetaInfo () };\n\t\t\t}\n\n\t\t\tFieldBuilder = Parent.TypeBuilder.DefineField (\n\t\t\t\tName, member_type.GetMetaInfo (), required_modifier, null, ModifiersExtensions.FieldAttr (ModFlags));\n\n\t\t\tspec = new FieldSpec (Parent.Definition, this, MemberType, FieldBuilder, ModFlags);\n\n\t\t\t//\n\t\t\t// Don't cache inaccessible fields except for struct where we\n\t\t\t// need them for definitive assignment checks\n\t\t\t//\n\t\t\tif ((ModFlags & Modifiers.BACKING_FIELD) == 0 || Parent.Kind == MemberKind.Struct) {\n\t\t\t\tParent.MemberCache.AddMember (spec);\n\t\t\t}\n\n\t\t\tif (initializer != null) {\n\t\t\t\tParent.RegisterFieldForInitialization (this, new FieldInitializer (this, initializer, TypeExpression.Location));\n\t\t\t}\n\n\t\t\tif (declarators != null) {\n\t\t\t\tforeach (var d in declarators) {\n\t\t\t\t\tvar f = new Field (Parent, d.GetFieldTypeExpression (this), ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);\n\t\t\t\t\tif (d.Initializer != null)\n\t\t\t\t\t\tf.initializer = d.Initializer;\n\n\t\t\t\t\tf.Define ();\n\t\t\t\t\tParent.PartialContainer.Members.Add (f);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoMemberTypeDependentChecks ()\n\t\t{\n\t\t\tif ((ModFlags & Modifiers.BACKING_FIELD) != 0)\n\t\t\t\treturn;\n\n\t\t\tbase.DoMemberTypeDependentChecks ();\n\n\t\t\tif ((ModFlags & Modifiers.VOLATILE) != 0) {\n\t\t\t\tif (!CanBeVolatile ()) {\n\t\t\t\t\tReport.Error (677, Location, \"`{0}': A volatile field cannot be of the type `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), MemberType.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif ((ModFlags & Modifiers.READONLY) != 0) {\n\t\t\t\t\tReport.Error (678, Location, \"`{0}': A field cannot be both volatile and readonly\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\tif ((ModFlags & Modifiers.VOLATILE) != 0) {\n\t\t\t\tReport.Warning (3026, 1, Location, \"CLS-compliant field `{0}' cannot be volatile\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tclass PrimaryConstructorField : Field\n\t{\n\t\t//\n\t\t// Proxy resolved parameter type expression to avoid type double resolve\n\t\t// and problems with correct resolve context on partial classes\n\t\t//\n\t\tsealed class TypeExpressionFromParameter : TypeExpr\n\t\t{\n\t\t\tParameter parameter;\n\n\t\t\tpublic TypeExpressionFromParameter (Parameter parameter)\n\t\t\t{\n\t\t\t\tthis.parameter = parameter;\n\t\t\t\teclass = ExprClass.Type;\n\t\t\t\tloc = parameter.Location;\n\t\t\t}\n\n\t\t\tpublic override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments)\n\t\t\t{\n\t\t\t\treturn parameter.Type;\n\t\t\t}\n\t\t}\n\n\t\tpublic PrimaryConstructorField (TypeDefinition parent, Parameter parameter)\n\t\t\t: base (parent, new TypeExpressionFromParameter (parameter), Modifiers.PRIVATE, new MemberName (parameter.Name, parameter.Location), null)\n\t\t{\n\t\t\tcaching_flags |= Flags.IsUsed | Flags.IsAssigned;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn MemberName.Name;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs",
    "content": "//\n// flowanalyis.cs: The control flow analysis code\n//\n// Authors:\n//   Martin Baulig (martin@ximian.com)\n//   Raja R Harinath (rharinath@novell.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011 Xamarin, Inc.\n//\n\nusing System;\nusing System.Text;\nusing System.Collections.Generic;\n\nnamespace Mono.CSharp\n{\n\t// <summary>\n\t//   This is used by the flow analysis code to keep track of the type of local variables.\n\t//\n\t//   The flow code uses a BitVector to keep track of whether a variable has been assigned\n\t//   or not.  This is easy for fundamental types (int, char etc.) or reference types since\n\t//   you can only assign the whole variable as such.\n\t//\n\t//   For structs, we also need to keep track of all its fields.  To do this, we allocate one\n\t//   bit for the struct itself (it's used if you assign/access the whole struct) followed by\n\t//   one bit for each of its fields.\n\t//\n\t//   This class computes this `layout' for each type.\n\t// </summary>\n\tpublic class TypeInfo\n\t{\n\t\t// <summary>\n\t\t//   Total number of bits a variable of this type consumes in the flow vector.\n\t\t// </summary>\n\t\tpublic readonly int TotalLength;\n\n\t\t// <summary>\n\t\t//   Number of bits the simple fields of a variable of this type consume\n\t\t//   in the flow vector.\n\t\t// </summary>\n\t\tpublic readonly int Length;\n\n\t\t// <summary>\n\t\t//   This is only used by sub-structs.\n\t\t// </summary>\n\t\tpublic readonly int Offset;\n\n\t\t// <summary>\n\t\t//   If this is a struct.\n\t\t// </summary>\n\t\tpublic readonly bool IsStruct;\n\n\t\t// <summary>\n\t\t//   If this is a struct, all fields which are structs theirselves.\n\t\t// </summary>\n\t\tpublic TypeInfo[] SubStructInfo;\n\n\t\treadonly StructInfo struct_info;\n\t\tprivate static Dictionary<TypeSpec, TypeInfo> type_hash;\n\n\t\tstatic readonly TypeInfo simple_type = new TypeInfo (1);\n\t\t\n\t\tstatic TypeInfo ()\n\t\t{\n\t\t\tReset ();\n\t\t}\n\t\t\n\t\tpublic static void Reset ()\n\t\t{\n\t\t\ttype_hash = new Dictionary<TypeSpec, TypeInfo> ();\n\t\t\tStructInfo.field_type_hash = new Dictionary<TypeSpec, StructInfo> ();\n\t\t}\n\n\t\tTypeInfo (int totalLength)\n\t\t{\n\t\t\tthis.TotalLength = totalLength;\n\t\t}\n\t\t\n\t\tTypeInfo (StructInfo struct_info, int offset)\n\t\t{\n\t\t\tthis.struct_info = struct_info;\n\t\t\tthis.Offset = offset;\n\t\t\tthis.Length = struct_info.Length;\n\t\t\tthis.TotalLength = struct_info.TotalLength;\n\t\t\tthis.SubStructInfo = struct_info.StructFields;\n\t\t\tthis.IsStruct = true;\n\t\t}\n\t\t\n\t\tpublic int GetFieldIndex (string name)\n\t\t{\n\t\t\tif (struct_info == null)\n\t\t\t\treturn 0;\n\n\t\t\treturn struct_info [name];\n\t\t}\n\n\t\tpublic TypeInfo GetStructField (string name)\n\t\t{\n\t\t\tif (struct_info == null)\n\t\t\t\treturn null;\n\n\t\t\treturn struct_info.GetStructField (name);\n\t\t}\n\n\t\tpublic static TypeInfo GetTypeInfo (TypeSpec type)\n\t\t{\n\t\t\tif (!type.IsStruct)\n\t\t\t\treturn simple_type;\n\n\t\t\tTypeInfo info;\n\t\t\tif (type_hash.TryGetValue (type, out info))\n\t\t\t\treturn info;\n\n\t\t\tvar struct_info = StructInfo.GetStructInfo (type);\n\t\t\tif (struct_info != null) {\n\t\t\t\tinfo = new TypeInfo (struct_info, 0);\n\t\t\t} else {\n\t\t\t\tinfo = simple_type;\n\t\t\t}\n\n\t\t\ttype_hash.Add (type, info);\n\t\t\treturn info;\n\t\t}\n\n\t\t// <summary>\n\t\t//   A struct's constructor must always assign all fields.\n\t\t//   This method checks whether it actually does so.\n\t\t// </summary>\n\t\tpublic bool IsFullyInitialized (FlowAnalysisContext fc, VariableInfo vi, Location loc)\n\t\t{\n\t\t\tif (struct_info == null)\n\t\t\t\treturn true;\n\n\t\t\tbool ok = true;\n\t\t\tfor (int i = 0; i < struct_info.Count; i++) {\n\t\t\t\tvar field = struct_info.Fields[i];\n\n\t\t\t\tif (!fc.IsStructFieldDefinitelyAssigned (vi, field.Name)) {\n\t\t\t\t\tvar bf = field.MemberDefinition as Property.BackingField;\n\t\t\t\t\tif (bf != null) {\n\t\t\t\t\t\tif (bf.Initializer != null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tfc.Report.Error (843, loc,\n\t\t\t\t\t\t\t\"An automatically implemented property `{0}' must be fully assigned before control leaves the constructor. Consider calling the default struct contructor from a constructor initializer\",\n\t\t\t\t\t\t\tfield.GetSignatureForError ());\n\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tfc.Report.Error (171, loc,\n\t\t\t\t\t\t\"Field `{0}' must be fully assigned before control leaves the constructor\",\n\t\t\t\t\t\tfield.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"TypeInfo ({0}:{1}:{2})\",\n\t\t\t\t\t      Offset, Length, TotalLength);\n\t\t}\n\n\t\tclass StructInfo\n\t\t{\n\t\t\treadonly List<FieldSpec> fields;\n\t\t\tpublic readonly TypeInfo[] StructFields;\n\t\t\tpublic readonly int Length;\n\t\t\tpublic readonly int TotalLength;\n\n\t\t\tpublic static Dictionary<TypeSpec, StructInfo> field_type_hash;\n\t\t\tprivate Dictionary<string, TypeInfo> struct_field_hash;\n\t\t\tprivate Dictionary<string, int> field_hash;\n\n\t\t\tbool InTransit;\n\n\t\t\t//\n\t\t\t// We only need one instance per type\n\t\t\t//\n\t\t\tStructInfo (TypeSpec type)\n\t\t\t{\n\t\t\t\tfield_type_hash.Add (type, this);\n\n\t\t\t\tfields = MemberCache.GetAllFieldsForDefiniteAssignment (type);\n\n\t\t\t\tstruct_field_hash = new Dictionary<string, TypeInfo> ();\n\t\t\t\tfield_hash = new Dictionary<string, int> (fields.Count);\n\n\t\t\t\tStructFields = new TypeInfo[fields.Count];\n\t\t\t\tStructInfo[] sinfo = new StructInfo[fields.Count];\n\n\t\t\t\tInTransit = true;\n\n\t\t\t\tfor (int i = 0; i < fields.Count; i++) {\n\t\t\t\t\tvar field = fields [i];\n\n\t\t\t\t\tif (field.MemberType.IsStruct)\n\t\t\t\t\t\tsinfo [i] = GetStructInfo (field.MemberType);\n\n\t\t\t\t\tif (sinfo [i] == null)\n\t\t\t\t\t\tfield_hash.Add (field.Name, ++Length);\n\t\t\t\t\telse if (sinfo [i].InTransit) {\n\t\t\t\t\t\tsinfo [i] = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tInTransit = false;\n\n\t\t\t\tTotalLength = Length + 1;\n\t\t\t\tfor (int i = 0; i < fields.Count; i++) {\n\t\t\t\t\tvar field = fields [i];\n\n\t\t\t\t\tif (sinfo [i] == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tfield_hash.Add (field.Name, TotalLength);\n\n\t\t\t\t\tStructFields [i] = new TypeInfo (sinfo [i], TotalLength);\n\t\t\t\t\tstruct_field_hash.Add (field.Name, StructFields [i]);\n\t\t\t\t\tTotalLength += sinfo [i].TotalLength;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic int Count {\n\t\t\t\tget {\n\t\t\t\t\treturn fields.Count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic List<FieldSpec> Fields {\n\t\t\t\tget {\n\t\t\t\t\treturn fields;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic int this [string name] {\n\t\t\t\tget {\n\t\t\t\t\tint val;\n\t\t\t\t\tif (!field_hash.TryGetValue (name, out val))\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\treturn val;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic TypeInfo GetStructField (string name)\n\t\t\t{\n\t\t\t\tTypeInfo ti;\n\t\t\t\tif (struct_field_hash.TryGetValue (name, out ti))\n\t\t\t\t\treturn ti;\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic static StructInfo GetStructInfo (TypeSpec type)\n\t\t\t{\n\t\t\t\tif (type.BuiltinType > 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tStructInfo info;\n\t\t\t\tif (field_type_hash.TryGetValue (type, out info))\n\t\t\t\t\treturn info;\n\n\t\t\t\treturn new StructInfo (type);\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// This is used by definite assignment analysis code to store information about a local variable\n\t// or parameter.  Depending on the variable's type, we need to allocate one or more elements\n\t// in the BitVector - if it's a fundamental or reference type, we just need to know whether\n\t// it has been assigned or not, but for structs, we need this information for each of its fields.\n\t//\n\tpublic class VariableInfo\n\t{\n\t\treadonly string Name;\n\n\t\treadonly TypeInfo TypeInfo;\n\n\t\t// <summary>\n\t\t//   The bit offset of this variable in the flow vector.\n\t\t// </summary>\n\t\treadonly int Offset;\n\n\t\t// <summary>\n\t\t//   The number of bits this variable needs in the flow vector.\n\t\t//   The first bit always specifies whether the variable as such has been assigned while\n\t\t//   the remaining bits contain this information for each of a struct's fields.\n\t\t// </summary>\n\t\treadonly int Length;\n\n\t\t// <summary>\n\t\t//   If this is a parameter of local variable.\n\t\t// </summary>\n\t\tpublic bool IsParameter;\n\n\t\tVariableInfo[] sub_info;\n\n\t\tVariableInfo (string name, TypeSpec type, int offset)\n\t\t{\n\t\t\tthis.Name = name;\n\t\t\tthis.Offset = offset;\n\t\t\tthis.TypeInfo = TypeInfo.GetTypeInfo (type);\n\n\t\t\tLength = TypeInfo.TotalLength;\n\n\t\t\tInitialize ();\n\t\t}\n\n\t\tVariableInfo (VariableInfo parent, TypeInfo type)\n\t\t{\n\t\t\tthis.Name = parent.Name;\n\t\t\tthis.TypeInfo = type;\n\t\t\tthis.Offset = parent.Offset + type.Offset;\n\t\t\tthis.Length = type.TotalLength;\n\n\t\t\tthis.IsParameter = parent.IsParameter;\n\n\t\t\tInitialize ();\n\t\t}\n\n\t\tvoid Initialize ()\n\t\t{\n\t\t\tTypeInfo[] sub_fields = TypeInfo.SubStructInfo;\n\t\t\tif (sub_fields != null) {\n\t\t\t\tsub_info = new VariableInfo [sub_fields.Length];\n\t\t\t\tfor (int i = 0; i < sub_fields.Length; i++) {\n\t\t\t\t\tif (sub_fields [i] != null)\n\t\t\t\t\t\tsub_info [i] = new VariableInfo (this, sub_fields [i]);\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tsub_info = new VariableInfo [0];\n\t\t}\n\n\t\tpublic static VariableInfo Create (BlockContext bc, LocalVariable variable)\n\t\t{\n\t\t\tvar info = new VariableInfo (variable.Name, variable.Type, bc.AssignmentInfoOffset);\n\t\t\tbc.AssignmentInfoOffset += info.Length;\n\t\t\treturn info;\n\t\t}\n\n\t\tpublic static VariableInfo Create (BlockContext bc, Parameter parameter)\n\t\t{\n\t\t\tvar info = new VariableInfo (parameter.Name, parameter.Type, bc.AssignmentInfoOffset) {\n\t\t\t\tIsParameter = true\n\t\t\t};\n\n\t\t\tbc.AssignmentInfoOffset += info.Length;\n\t\t\treturn info;\n\t\t}\n\n\t\tpublic bool IsAssigned (DefiniteAssignmentBitSet vector)\n\t\t{\n\t\t\tif (vector == null)\n\t\t\t\treturn true;\n\n\t\t\tif (vector [Offset])\n\t\t\t\treturn true;\n\n\t\t\t// Unless this is a struct\n\t\t\tif (!TypeInfo.IsStruct)\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// Following case cannot be handled fully by SetStructFieldAssigned\n\t\t\t// because we may encounter following case\n\t\t\t// \n\t\t\t// struct A { B b }\n\t\t\t// struct B { int value; }\n\t\t\t//\n\t\t\t// setting a.b.value is propagated only to B's vector and not upwards to possible parents\n\t\t\t//\n\t\t\t//\n\t\t\t// Each field must be assigned\n\t\t\t//\n\t\t\tfor (int i = Offset + 1; i <= TypeInfo.Length + Offset; i++) {\n\t\t\t\tif (!vector[i])\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Ok, now check all fields which are structs.\n\t\t\tfor (int i = 0; i < sub_info.Length; i++) {\n\t\t\t\tVariableInfo sinfo = sub_info[i];\n\t\t\t\tif (sinfo == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!sinfo.IsAssigned (vector))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tvector.Set (Offset);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic bool IsEverAssigned { get; set; }\n\n\t\tpublic bool IsFullyInitialized (FlowAnalysisContext fc, Location loc)\n\t\t{\n\t\t\treturn TypeInfo.IsFullyInitialized (fc, this, loc);\n\t\t}\n\n\t\tpublic bool IsStructFieldAssigned (DefiniteAssignmentBitSet vector, string field_name)\n\t\t{\n\t\t\tint field_idx = TypeInfo.GetFieldIndex (field_name);\n\n\t\t\tif (field_idx == 0)\n\t\t\t\treturn true;\n\n\t\t\treturn vector [Offset + field_idx];\n\t\t}\n\n\t\tpublic void SetAssigned (DefiniteAssignmentBitSet vector, bool generatedAssignment)\n\t\t{\n\t\t\tif (Length == 1)\n\t\t\t\tvector.Set (Offset);\n\t\t\telse\n\t\t\t\tvector.Set (Offset, Length);\n\n\t\t\tif (!generatedAssignment)\n\t\t\t\tIsEverAssigned = true;\n\t\t}\n\n\t\tpublic void SetStructFieldAssigned (DefiniteAssignmentBitSet vector, string field_name)\n\t\t{\n\t\t\tif (vector [Offset])\n\t\t\t\treturn;\n\n\t\t\tint field_idx = TypeInfo.GetFieldIndex (field_name);\n\n\t\t\tif (field_idx == 0)\n\t\t\t\treturn;\n\n\t\t\tvar complex_field = TypeInfo.GetStructField (field_name);\n\t\t\tif (complex_field != null) {\n\t\t\t\tvector.Set (Offset + complex_field.Offset, complex_field.TotalLength);\n\t\t\t} else {\n\t\t\t\tvector.Set (Offset + field_idx);\n\t\t\t}\n\n\t\t\tIsEverAssigned = true;\n\n\t\t\t//\n\t\t\t// Each field must be assigned before setting master bit\n\t\t\t//\n\t\t\tfor (int i = Offset + 1; i < TypeInfo.TotalLength + Offset; i++) {\n\t\t\t\tif (!vector[i])\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Set master struct flag to assigned when all tested struct\n\t\t\t// fields have been assigned\n\t\t\t//\n\t\t\tvector.Set (Offset);\n\t\t}\n\n\t\tpublic VariableInfo GetStructFieldInfo (string fieldName)\n\t\t{\n\t\t\tTypeInfo type = TypeInfo.GetStructField (fieldName);\n\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new VariableInfo (this, type);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"Name={0} Offset={1} Length={2} {3})\", Name, Offset, Length, TypeInfo);\n\t\t}\n\t}\n\n\tpublic struct Reachability\n\t{\n\t\treadonly bool unreachable;\n\n\t\tReachability (bool unreachable)\n\t\t{\n\t\t\tthis.unreachable = unreachable;\n\t\t}\n\n\t\tpublic bool IsUnreachable {\n\t\t\tget {\n\t\t\t\treturn unreachable;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Reachability CreateUnreachable ()\n\t\t{\n\t\t\treturn new Reachability (true);\n\t\t}\n\n\t\tpublic static Reachability operator & (Reachability a, Reachability b)\n\t\t{\n\t\t    return new Reachability (a.unreachable && b.unreachable);\n\t\t}\n\n\t\tpublic static Reachability operator | (Reachability a, Reachability b)\n\t\t{\n\t\t\treturn new Reachability (a.unreachable | b.unreachable);\n\t\t}\n\t}\n\n\t//\n\t// Special version of bit array. Many operations can be simplified because\n\t// we are always dealing with arrays of same sizes\n\t//\n\tpublic class DefiniteAssignmentBitSet\n\t{\n\t\tconst uint copy_on_write_flag = 1u << 31;\n\n\t\tuint bits;\n\n\t\t// Used when bits overflows\n\t\tint[] large_bits;\n\n\t\tpublic static readonly DefiniteAssignmentBitSet Empty = new DefiniteAssignmentBitSet (0);\n\n\t\tpublic DefiniteAssignmentBitSet (int length)\n\t\t{\n\t\t\tif (length > 31)\n\t\t\t\tlarge_bits = new int[(length + 31) / 32];\n\t\t}\n\n\t\tpublic DefiniteAssignmentBitSet (DefiniteAssignmentBitSet source)\n\t\t{\n\t\t\tif (source.large_bits != null) {\n\t\t\t\tlarge_bits = source.large_bits;\n\t\t\t\tbits = source.bits | copy_on_write_flag;\n\t\t\t} else {\n\t\t\t\tbits = source.bits & ~copy_on_write_flag;\n\t\t\t}\n\t\t}\n\n\t\tpublic static DefiniteAssignmentBitSet operator & (DefiniteAssignmentBitSet a, DefiniteAssignmentBitSet b)\n\t\t{\n\t\t\tif (AreEqual (a, b))\n\t\t\t\treturn a;\n\n\t\t\tDefiniteAssignmentBitSet res;\n\t\t\tif (a.large_bits == null) {\n\t\t\t\tres = new DefiniteAssignmentBitSet (a);\n\t\t\t\tres.bits &= (b.bits & ~copy_on_write_flag);\n\t\t\t\treturn res;\n\t\t\t}\n\n\t\t\tres = new DefiniteAssignmentBitSet (a);\n\t\t\tres.Clone ();\n\t\t\tvar dest = res.large_bits;\n\t\t\tvar src = b.large_bits;\n\t\t\tfor (int i = 0; i < dest.Length; ++i) {\n\t\t\t\tdest[i] &= src[i];\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic static DefiniteAssignmentBitSet operator | (DefiniteAssignmentBitSet a, DefiniteAssignmentBitSet b)\n\t\t{\n\t\t\tif (AreEqual (a, b))\n\t\t\t\treturn a;\n\n\t\t\tDefiniteAssignmentBitSet res;\n\t\t\tif (a.large_bits == null) {\n\t\t\t\tres = new DefiniteAssignmentBitSet (a);\n\t\t\t\tres.bits |= b.bits;\n\t\t\t\tres.bits &= ~copy_on_write_flag;\n\t\t\t\treturn res;\n\t\t\t}\n\n\t\t\tres = new DefiniteAssignmentBitSet (a);\n\t\t\tres.Clone ();\n\t\t\tvar dest = res.large_bits;\n\t\t\tvar src = b.large_bits;\n\n\t\t\tfor (int i = 0; i < dest.Length; ++i) {\n\t\t\t\tdest[i] |= src[i];\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic static DefiniteAssignmentBitSet And (List<DefiniteAssignmentBitSet> das)\n\t\t{\n\t\t\tif (das.Count == 0)\n\t\t\t\tthrow new ArgumentException (\"Empty das\");\n\n\t\t\tDefiniteAssignmentBitSet res = das[0];\n\t\t\tfor (int i = 1; i < das.Count; ++i) {\n\t\t\t\tres &= das[i];\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tbool CopyOnWrite {\n\t\t\tget {\n\t\t\t\treturn (bits & copy_on_write_flag) != 0;\n\t\t\t}\n\t\t}\n\n\t\tint Length {\n\t\t\tget {\n\t\t\t\treturn large_bits == null ? 31 : large_bits.Length * 32;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Set (int index)\n\t\t{\n\t\t\tif (CopyOnWrite && !this[index])\n\t\t\t\tClone ();\n\n\t\t\tSetBit (index);\n\t\t}\n\n\t\tpublic void Set (int index, int length)\n\t\t{\n\t\t\tfor (int i = 0; i < length; ++i) {\n\t\t\t\tif (CopyOnWrite && !this[index + i])\n\t\t\t\t\tClone ();\n\n\t\t\t\tSetBit (index + i);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool this[int index] {\n\t\t\tget {\n\t\t\t\treturn GetBit (index);\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\tvar length = Length;\n\t\t\tStringBuilder sb = new StringBuilder (length);\n\t\t\tfor (int i = 0; i < length; ++i) {\n\t\t\t\tsb.Append (this[i] ? '1' : '0');\n\t\t\t}\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tvoid Clone ()\n\t\t{\n\t\t\tlarge_bits = (int[]) large_bits.Clone ();\n\t\t}\n\n\t\tbool GetBit (int index)\n\t\t{\n\t\t\treturn large_bits == null ?\n\t\t\t\t(bits & (1 << index)) != 0 :\n\t\t\t\t(large_bits[index >> 5] & (1 << (index & 31))) != 0;\n\t\t}\n\n\t\tvoid SetBit (int index)\n\t\t{\n\t\t\tif (large_bits == null)\n\t\t\t\tbits = (uint) ((int) bits | (1 << index));\n\t\t\telse\n\t\t\t\tlarge_bits[index >> 5] |= (1 << (index & 31));\n\t\t}\n\n\t\tstatic bool AreEqual (DefiniteAssignmentBitSet a, DefiniteAssignmentBitSet b)\n\t\t{\n\t\t\tif (a.large_bits == null)\n\t\t\t\treturn (a.bits & ~copy_on_write_flag) == (b.bits & ~copy_on_write_flag);\n\n\t\t\tfor (int i = 0; i < a.large_bits.Length; ++i) {\n\t\t\t\tif (a.large_bits[i] != b.large_bits[i])\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs",
    "content": "//\n// generic.cs: Generics support\n//\n// Authors: Martin Baulig (martin@ximian.com)\n//          Miguel de Icaza (miguel@ximian.com)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\tpublic class VarianceDecl\n\t{\n\t\tpublic VarianceDecl (Variance variance, Location loc)\n\t\t{\n\t\t\tthis.Variance = variance;\n\t\t\tthis.Location = loc;\n\t\t}\n\n\t\tpublic Variance Variance { get; private set; }\n\t\tpublic Location Location { get; private set; }\n\n\t\tpublic static Variance CheckTypeVariance (TypeSpec t, Variance expected, IMemberContext member)\n\t\t{\n\t\t\tvar tp = t as TypeParameterSpec;\n\t\t\tif (tp != null) {\n\t\t\t\tvar v = tp.Variance;\n\t\t\t\tif (expected == Variance.None && v != expected ||\n\t\t\t\t\texpected == Variance.Covariant && v == Variance.Contravariant ||\n\t\t\t\t\texpected == Variance.Contravariant && v == Variance.Covariant) {\n\t\t\t\t\t((TypeParameter) tp.MemberDefinition).ErrorInvalidVariance (member, expected);\n\t\t\t\t}\n\n\t\t\t\treturn expected;\n\t\t\t}\n\n\t\t\tif (t.TypeArguments.Length > 0) {\n\t\t\t\tvar targs_definition = t.MemberDefinition.TypeParameters;\n\t\t\t\tTypeSpec[] targs = TypeManager.GetTypeArguments (t);\n\t\t\t\tfor (int i = 0; i < targs.Length; ++i) {\n\t\t\t\t\tvar v = targs_definition[i].Variance;\n\t\t\t\t\tCheckTypeVariance (targs[i], (Variance) ((int) v * (int) expected), member);\n\t\t\t\t}\n\n\t\t\t\treturn expected;\n\t\t\t}\n\n\t\t\tvar ac = t as ArrayContainer;\n\t\t\tif (ac != null)\n\t\t\t\treturn CheckTypeVariance (ac.Element, expected, member);\n\n\t\t\treturn Variance.None;\n\t\t}\n\t}\n\n\tpublic enum Variance\n\t{\n\t\t//\n\t\t// Don't add or modify internal values, they are used as -/+ calculation signs\n\t\t//\n\t\tNone\t\t\t= 0,\n\t\tCovariant\t\t= 1,\n\t\tContravariant\t= -1\n\t}\n\n\t[Flags]\n\tpublic enum SpecialConstraint\n\t{\n\t\tNone\t\t= 0,\n\t\tConstructor = 1 << 2,\n\t\tClass\t\t= 1 << 3,\n\t\tStruct\t\t= 1 << 4\n\t}\n\n\tpublic class SpecialContraintExpr : FullNamedExpression\n\t{\n\t\tpublic SpecialContraintExpr (SpecialConstraint constraint, Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t\tthis.Constraint = constraint;\n\t\t}\n\n\t\tpublic SpecialConstraint Constraint { get; private set; }\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\n\t//\n\t// A set of parsed constraints for a type parameter\n\t//\n\tpublic class Constraints\n\t{\n\t\treadonly SimpleMemberName tparam;\n\t\treadonly List<FullNamedExpression> constraints;\n\t\treadonly Location loc;\n\t\tbool resolved;\n\t\tbool resolving;\n\t\t\n\t\tpublic IEnumerable<FullNamedExpression> ConstraintExpressions {\n\t\t\tget {\n\t\t\t\treturn constraints;\n\t\t\t}\n\t\t}\n\n\t\tpublic Constraints (SimpleMemberName tparam, List<FullNamedExpression> constraints, Location loc)\n\t\t{\n\t\t\tthis.tparam = tparam;\n\t\t\tthis.constraints = constraints;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic List<FullNamedExpression> TypeExpressions {\n\t\t\tget {\n\t\t\t\treturn constraints;\n\t\t\t}\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic SimpleMemberName TypeParameter {\n\t\t\tget {\n\t\t\t\treturn tparam;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic static bool CheckConflictingInheritedConstraint (TypeParameterSpec spec, TypeSpec bb, IMemberContext context, Location loc)\n\t\t{\n\t\t\tif (spec.HasSpecialClass && bb.IsStruct) {\n\t\t\t\tcontext.Module.Compiler.Report.Error (455, loc,\n\t\t\t\t\t\"Type parameter `{0}' inherits conflicting constraints `{1}' and `{2}'\",\n\t\t\t\t\tspec.Name, \"class\", bb.GetSignatureForError ());\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn CheckConflictingInheritedConstraint (spec, spec.BaseType, bb, context, loc);\n\t\t}\n\n\t\tstatic bool CheckConflictingInheritedConstraint (TypeParameterSpec spec, TypeSpec ba, TypeSpec bb, IMemberContext context, Location loc)\n\t\t{\n\t\t\tif (ba == bb)\n\t\t\t\treturn true;\n\n\t\t\tif (TypeSpec.IsBaseClass (ba, bb, false) || TypeSpec.IsBaseClass (bb, ba, false))\n\t\t\t\treturn true;\n\n\t\t\tError_ConflictingConstraints (context, spec, ba, bb, loc);\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static void Error_ConflictingConstraints (IMemberContext context, TypeParameterSpec tp, TypeSpec ba, TypeSpec bb, Location loc)\n\t\t{\n\t\t\tcontext.Module.Compiler.Report.Error (455, loc,\n\t\t\t\t\"Type parameter `{0}' inherits conflicting constraints `{1}' and `{2}'\",\n\t\t\t\ttp.Name, ba.GetSignatureForError (), bb.GetSignatureForError ());\n\t\t}\n\n\t\tpublic void CheckGenericConstraints (IMemberContext context, bool obsoleteCheck)\n\t\t{\n\t\t\tforeach (var c in constraints) {\n\t\t\t\tif (c == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar t = c.Type;\n\t\t\t\tif (t == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (obsoleteCheck) {\n\t\t\t\t\tObsoleteAttribute obsolete_attr = t.GetAttributeObsolete ();\n\t\t\t\t\tif (obsolete_attr != null)\n\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (obsolete_attr, t.GetSignatureForError (), c.Location, context.Module.Compiler.Report);\n\t\t\t\t}\n\n\t\t\t\tConstraintChecker.Check (context, t, c.Location);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Resolve the constraints types with only possible early checks, return\n\t\t// value `false' is reserved for recursive failure\n\t\t//\n\t\tpublic bool Resolve (IMemberContext context, TypeParameter tp)\n\t\t{\n\t\t\tif (resolved)\n\t\t\t\treturn true;\n\n\t\t\tif (resolving)\n\t\t\t\treturn false;\n\n\t\t\tresolving = true;\n\t\t\tvar spec = tp.Type;\n\t\t\tList<TypeParameterSpec> tparam_types = null;\n\t\t\tbool iface_found = false;\n\n\t\t\tspec.BaseType = context.Module.Compiler.BuiltinTypes.Object;\n\n\t\t\tfor (int i = 0; i < constraints.Count; ++i) {\n\t\t\t\tvar constraint = constraints[i];\n\n\t\t\t\tif (constraint is SpecialContraintExpr) {\n\t\t\t\t\tspec.SpecialConstraint |= ((SpecialContraintExpr) constraint).Constraint;\n\t\t\t\t\tif (spec.HasSpecialStruct)\n\t\t\t\t\t\tspec.BaseType = context.Module.Compiler.BuiltinTypes.ValueType;\n\n\t\t\t\t\t// Set to null as it does not have a type\n\t\t\t\t\tconstraints[i] = null;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar type = constraint.ResolveAsType (context);\n\t\t\t\tif (type == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (type.Arity > 0 && ((InflatedTypeSpec) type).HasDynamicArgument ()) {\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (1968, constraint.Location,\n\t\t\t\t\t\t\"A constraint cannot be the dynamic type `{0}'\", type.GetSignatureForError ());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!context.CurrentMemberDefinition.IsAccessibleAs (type)) {\n\t\t\t\t\tcontext.Module.Compiler.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (703, loc,\n\t\t\t\t\t\t\"Inconsistent accessibility: constraint type `{0}' is less accessible than `{1}'\",\n\t\t\t\t\t\ttype.GetSignatureForError (), context.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (type.IsInterface) {\n\t\t\t\t\tif (!spec.AddInterface (type)) {\n\t\t\t\t\t\tcontext.Module.Compiler.Report.Error (405, constraint.Location,\n\t\t\t\t\t\t\t\"Duplicate constraint `{0}' for type parameter `{1}'\", type.GetSignatureForError (), tparam.Value);\n\t\t\t\t\t}\n\n\t\t\t\t\tiface_found = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tvar constraint_tp = type as TypeParameterSpec;\n\t\t\t\tif (constraint_tp != null) {\n\t\t\t\t\tif (tparam_types == null) {\n\t\t\t\t\t\ttparam_types = new List<TypeParameterSpec> (2);\n\t\t\t\t\t} else if (tparam_types.Contains (constraint_tp)) {\n\t\t\t\t\t\tcontext.Module.Compiler.Report.Error (405, constraint.Location,\n\t\t\t\t\t\t\t\"Duplicate constraint `{0}' for type parameter `{1}'\", type.GetSignatureForError (), tparam.Value);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Checks whether each generic method parameter constraint type\n\t\t\t\t\t// is valid with respect to T\n\t\t\t\t\t//\n\t\t\t\t\tif (tp.IsMethodTypeParameter) {\n\t\t\t\t\t\tVarianceDecl.CheckTypeVariance (type, Variance.Contravariant, context);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar tp_def = constraint_tp.MemberDefinition as TypeParameter;\n\t\t\t\t\tif (tp_def != null && !tp_def.ResolveConstraints (context)) {\n\t\t\t\t\t\tcontext.Module.Compiler.Report.Error (454, constraint.Location,\n\t\t\t\t\t\t\t\"Circular constraint dependency involving `{0}' and `{1}'\",\n\t\t\t\t\t\t\tconstraint_tp.GetSignatureForError (), tp.GetSignatureForError ());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Checks whether there are no conflicts between type parameter constraints\n\t\t\t\t\t//\n\t\t\t\t\t// class Foo<T, U>\n\t\t\t\t\t//      where T : A\n\t\t\t\t\t//      where U : B, T\n\t\t\t\t\t//\n\t\t\t\t\t// A and B are not convertible and only 1 class constraint is allowed\n\t\t\t\t\t//\n\t\t\t\t\tif (constraint_tp.HasTypeConstraint) {\n\t\t\t\t\t\tif (spec.HasTypeConstraint || spec.HasSpecialStruct) {\n\t\t\t\t\t\t\tif (!CheckConflictingInheritedConstraint (spec, constraint_tp.BaseType, context, constraint.Location))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (int ii = 0; ii < tparam_types.Count; ++ii) {\n\t\t\t\t\t\t\t\tif (!tparam_types[ii].HasTypeConstraint)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (!CheckConflictingInheritedConstraint (spec, tparam_types[ii].BaseType, constraint_tp.BaseType, context, constraint.Location))\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (constraint_tp.TypeArguments != null) {\n\t\t\t\t\t\tvar eb = constraint_tp.GetEffectiveBase ();\n\t\t\t\t\t\tif (eb != null && !CheckConflictingInheritedConstraint (spec, eb, spec.BaseType, context, constraint.Location))\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (constraint_tp.HasSpecialStruct) {\n\t\t\t\t\t\tcontext.Module.Compiler.Report.Error (456, constraint.Location,\n\t\t\t\t\t\t\t\"Type parameter `{0}' has the `struct' constraint, so it cannot be used as a constraint for `{1}'\",\n\t\t\t\t\t\t\tconstraint_tp.GetSignatureForError (), tp.GetSignatureForError ());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\ttparam_types.Add (constraint_tp);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (iface_found || spec.HasTypeConstraint) {\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (406, constraint.Location,\n\t\t\t\t\t\t\"The class type constraint `{0}' must be listed before any other constraints. Consider moving type constraint to the beginning of the constraint list\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (spec.HasSpecialStruct || spec.HasSpecialClass) {\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (450, constraint.Location,\n\t\t\t\t\t\t\"`{0}': cannot specify both a constraint class and the `class' or `struct' constraint\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tswitch (type.BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Array:\n\t\t\t\tcase BuiltinTypeSpec.Type.Delegate:\n\t\t\t\tcase BuiltinTypeSpec.Type.MulticastDelegate:\n\t\t\t\tcase BuiltinTypeSpec.Type.Enum:\n\t\t\t\tcase BuiltinTypeSpec.Type.ValueType:\n\t\t\t\tcase BuiltinTypeSpec.Type.Object:\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (702, constraint.Location,\n\t\t\t\t\t\t\"A constraint cannot be special class `{0}'\", type.GetSignatureForError ());\n\t\t\t\t\tcontinue;\n\t\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (1967, constraint.Location,\n\t\t\t\t\t\t\"A constraint cannot be the dynamic type\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (type.IsSealed || !type.IsClass) {\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (701, loc,\n\t\t\t\t\t\t\"`{0}' is not a valid constraint. A constraint must be an interface, a non-sealed class or a type parameter\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (type.IsStatic) {\n\t\t\t\t\tcontext.Module.Compiler.Report.Error (717, constraint.Location,\n\t\t\t\t\t\t\"`{0}' is not a valid constraint. Static classes cannot be used as constraints\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tspec.BaseType = type;\n\t\t\t}\n\n\t\t\tif (tparam_types != null)\n\t\t\t\tspec.TypeArguments = tparam_types.ToArray ();\n\n\t\t\tresolving = false;\n\t\t\tresolved = true;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void VerifyClsCompliance (Report report)\n\t\t{\n\t\t\tforeach (var c in constraints)\n\t\t\t{\n\t\t\t\tif (c == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!c.Type.IsCLSCompliant ()) {\n\t\t\t\t\treport.SymbolRelatedToPreviousError (c.Type);\n\t\t\t\t\treport.Warning (3024, 1, loc, \"Constraint type `{0}' is not CLS-compliant\",\n\t\t\t\t\t\tc.Type.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// A type parameter for a generic type or generic method definition\n\t//\n\tpublic class TypeParameter : MemberCore, ITypeDefinition\n\t{\n\t\tstatic readonly string[] attribute_target = { \"type parameter\" };\n\t\t\n\t\tConstraints constraints;\n\t\tGenericTypeParameterBuilder builder;\n\t\treadonly TypeParameterSpec spec;\n\n\t\tpublic TypeParameter (int index, MemberName name, Constraints constraints, Attributes attrs, Variance Variance)\n\t\t\t: base (null, name, attrs)\n\t\t{\n\t\t\tthis.constraints = constraints;\n\t\t\tthis.spec = new TypeParameterSpec (null, index, this, SpecialConstraint.None, Variance, null);\n\t\t}\n\n\t\t//\n\t\t// Used by parser\n\t\t//\n\t\tpublic TypeParameter (MemberName name, Attributes attrs, VarianceDecl variance)\n\t\t\t: base (null, name, attrs)\n\t\t{\n\t\t\tvar var = variance == null ? Variance.None : variance.Variance;\n\t\t\tthis.spec = new TypeParameterSpec (null, -1, this, SpecialConstraint.None, var, null);\n\t\t\tthis.VarianceDecl = variance;\n\t\t}\n\t\t\n\t\tpublic TypeParameter (TypeParameterSpec spec, TypeSpec parentSpec, MemberName name, Attributes attrs)\n\t\t\t: base (null, name, attrs)\n\t\t{\n\t\t\tthis.spec = new TypeParameterSpec (parentSpec, spec.DeclaredPosition, spec.MemberDefinition, spec.SpecialConstraint, spec.Variance, null) {\n\t\t\t\tBaseType = spec.BaseType,\n\t\t\t\tInterfacesDefined = spec.InterfacesDefined,\n\t\t\t\tTypeArguments = spec.TypeArguments\n\t\t\t};\n\t\t}\n\t\t\n\t\t#region Properties\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.GenericParameter;\n\t\t\t}\n\t\t}\n\n\t\tpublic Constraints Constraints {\n\t\t\tget {\n\t\t\t\treturn constraints;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tconstraints = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic IAssemblyDefinition DeclaringAssembly {\n\t\t\tget\t{\n\t\t\t\treturn Module.DeclaringAssembly;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string DocCommentHeader {\n\t\t\tget {\n\t\t\t\tthrow new InvalidOperationException (\n\t\t\t\t\t\"Unexpected attempt to get doc comment from \" + this.GetType ());\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsComImport {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsPartial {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsMethodTypeParameter {\n\t\t\tget {\n\t\t\t\treturn spec.IsMethodOwned;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsCyclicTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn MemberName.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec Type {\n\t\t\tget {\n\t\t\t\treturn spec;\n\t\t\t}\n\t\t}\n\n\t\tpublic int TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec[] TypeParameters {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_target;\n\t\t\t}\n\t\t}\n\n\t\tpublic Variance Variance {\n\t\t\tget {\n\t\t\t\treturn spec.Variance;\n\t\t\t}\n\t\t}\n\n\t\tpublic VarianceDecl VarianceDecl { get; private set; }\n\n\t\t#endregion\n\n\t\t//\n\t\t// This is called for each part of a partial generic type definition.\n\t\t//\n\t\t// If partial type parameters constraints are not null and we don't\n\t\t// already have constraints they become our constraints. If we already\n\t\t// have constraints, we must check that they're same.\n\t\t//\n\t\tpublic bool AddPartialConstraints (TypeDefinition part, TypeParameter tp)\n\t\t{\n\t\t\tif (builder == null)\n\t\t\t\tthrow new InvalidOperationException ();\n\n\t\t\tvar new_constraints = tp.constraints;\n\t\t\tif (new_constraints == null)\n\t\t\t\treturn true;\n\n\t\t\t// TODO: could create spec only\n\t\t\t//tp.Define (null, -1, part.Definition);\n\t\t\ttp.spec.DeclaringType = part.Definition;\n\t\t\tif (!tp.ResolveConstraints (part))\n\t\t\t\treturn false;\n\n\t\t\tif (constraints != null)\n\t\t\t\treturn spec.HasSameConstraintsDefinition (tp.Type);\n\n\t\t\t// Copy constraint from resolved part to partial container\n\t\t\tspec.SpecialConstraint = tp.spec.SpecialConstraint;\n\t\t\tspec.InterfacesDefined = tp.spec.InterfacesDefined;\n\t\t\tspec.TypeArguments = tp.spec.TypeArguments;\n\t\t\tspec.BaseType = tp.spec.BaseType;\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tpublic void CheckGenericConstraints (bool obsoleteCheck)\n\t\t{\n\t\t\tif (constraints != null)\n\t\t\t\tconstraints.CheckGenericConstraints (this, obsoleteCheck);\n\t\t}\n\n\t\tpublic TypeParameter CreateHoistedCopy (TypeSpec declaringSpec)\n\t\t{\n\t\t\treturn new TypeParameter (spec, declaringSpec, MemberName, null);\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// This is the first method which is called during the resolving\n\t\t// process; we're called immediately after creating the type parameters\n\t\t// with SRE (by calling `DefineGenericParameters()' on the TypeBuilder /\n\t\t// MethodBuilder).\n\t\t//\n\t\tpublic void Create (TypeSpec declaringType, TypeContainer parent)\n\t\t{\n\t\t\tif (builder != null)\n\t\t\t\tthrow new InternalErrorException ();\n\n\t\t\t// Needed to get compiler reference\n\t\t\tthis.Parent = parent;\n\t\t\tspec.DeclaringType = declaringType;\n\t\t}\n\n\t\tpublic void Define (GenericTypeParameterBuilder type)\n\t\t{\n\t\t\tthis.builder = type;\n\t\t\tspec.SetMetaInfo (type);\n\t\t}\n\n\t\tpublic void Define (TypeParameter tp)\n\t\t{\n\t\t\tbuilder = tp.builder;\n\t\t}\n\n\t\tpublic void EmitConstraints (GenericTypeParameterBuilder builder)\n\t\t{\n\t\t\tvar attr = GenericParameterAttributes.None;\n\t\t\tif (spec.Variance == Variance.Contravariant)\n\t\t\t\tattr |= GenericParameterAttributes.Contravariant;\n\t\t\telse if (spec.Variance == Variance.Covariant)\n\t\t\t\tattr |= GenericParameterAttributes.Covariant;\n\n\t\t\tif (spec.HasSpecialClass)\n\t\t\t\tattr |= GenericParameterAttributes.ReferenceTypeConstraint;\n\t\t\telse if (spec.HasSpecialStruct)\n\t\t\t\tattr |= GenericParameterAttributes.NotNullableValueTypeConstraint | GenericParameterAttributes.DefaultConstructorConstraint;\n\n\t\t\tif (spec.HasSpecialConstructor)\n\t\t\t\tattr |= GenericParameterAttributes.DefaultConstructorConstraint;\n\n\t\t\tif (spec.BaseType.BuiltinType != BuiltinTypeSpec.Type.Object)\n\t\t\t\tbuilder.SetBaseTypeConstraint (spec.BaseType.GetMetaInfo ());\n\n\t\t\tif (spec.InterfacesDefined != null)\n\t\t\t\tbuilder.SetInterfaceConstraints (spec.InterfacesDefined.Select (l => l.GetMetaInfo ()).ToArray ());\n\n\t\t\tif (spec.TypeArguments != null) {\n\t\t\t\tvar meta_constraints = new List<MetaType> (spec.TypeArguments.Length);\n\t\t\t\tforeach (var c in spec.TypeArguments) {\n\t\t\t\t\t//\n\t\t\t\t\t// Inflated type parameters can collide with special constraint types, don't\n\t\t\t\t\t// emit any such type parameter.\n\t\t\t\t\t//\n\t\t\t\t\tif (c.BuiltinType == BuiltinTypeSpec.Type.Object || c.BuiltinType == BuiltinTypeSpec.Type.ValueType)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tmeta_constraints.Add (c.GetMetaInfo ());\n\t\t\t\t}\n\n\t\t\t\tbuilder.SetInterfaceConstraints (meta_constraints.ToArray ());\n\t\t\t}\n\n\t\t\tbuilder.SetGenericParameterAttributes (attr);\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tEmitConstraints (builder);\n\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic void ErrorInvalidVariance (IMemberContext mc, Variance expected)\n\t\t{\n\t\t\tReport.SymbolRelatedToPreviousError (mc.CurrentMemberDefinition);\n\t\t\tstring input_variance = Variance == Variance.Contravariant ? \"contravariant\" : \"covariant\";\n\t\t\tstring gtype_variance;\n\t\t\tswitch (expected) {\n\t\t\tcase Variance.Contravariant: gtype_variance = \"contravariantly\"; break;\n\t\t\tcase Variance.Covariant: gtype_variance = \"covariantly\"; break;\n\t\t\tdefault: gtype_variance = \"invariantly\"; break;\n\t\t\t}\n\n\t\t\tDelegate d = mc as Delegate;\n\t\t\tstring parameters = d != null ? d.Parameters.GetSignatureForError () : \"\";\n\n\t\t\tReport.Error (1961, Location,\n\t\t\t\t\"The {2} type parameter `{0}' must be {3} valid on `{1}{4}'\",\n\t\t\t\t\tGetSignatureForError (), mc.GetSignatureForError (), input_variance, gtype_variance, parameters);\n\t\t}\n\n\t\tpublic TypeSpec GetAttributeCoClass ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic string GetAttributeDefaultMember ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic AttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn MemberName.Name;\n\t\t}\n\n\t\tbool ITypeDefinition.IsInternalAsPublic (IAssemblyDefinition assembly)\n\t\t{\n\t\t\treturn spec.MemberDefinition.DeclaringAssembly == assembly;\n\t\t}\n\n\t\tpublic void LoadMembers (TypeSpec declaringType, bool onlyTypes, ref MemberCache cache)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"Not supported for compiled definition\");\n\t\t}\n\n\t\t//\n\t\t// Resolves all type parameter constraints\n\t\t//\n\t\tpublic bool ResolveConstraints (IMemberContext context)\n\t\t{\n\t\t\tif (constraints != null)\n\t\t\t\treturn constraints.Resolve (context, this);\n\n\t\t\tif (spec.BaseType == null)\n\t\t\t\tspec.BaseType = context.Module.Compiler.BuiltinTypes.Object;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool IsClsComplianceRequired ()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic new void VerifyClsCompliance ()\n\t\t{\n\t\t\tif (constraints != null)\n\t\t\t\tconstraints.VerifyClsCompliance (Report);\n\t\t}\n\n\t\tpublic void WarningParentNameConflict (TypeParameter conflict)\n\t\t{\n\t\t\tconflict.Report.SymbolRelatedToPreviousError (conflict.Location, null);\n\t\t\tconflict.Report.Warning (693, 3, Location,\n\t\t\t\t\"Type parameter `{0}' has the same name as the type parameter from outer type `{1}'\",\n\t\t\t\tGetSignatureForError (), conflict.CurrentType.GetSignatureForError ());\n\t\t}\n\t}\n\n\t[System.Diagnostics.DebuggerDisplay (\"{DisplayDebugInfo()}\")]\n\tpublic class TypeParameterSpec : TypeSpec\n\t{\n\t\tpublic static readonly new TypeParameterSpec[] EmptyTypes = new TypeParameterSpec[0];\n\n\t\tVariance variance;\n\t\tSpecialConstraint spec;\n\t\tint tp_pos;\n\t\tTypeSpec[] targs;\n\t\tTypeSpec[] ifaces_defined;\n\t\tTypeSpec effective_base;\n\n\t\t//\n\t\t// Creates type owned type parameter\n\t\t//\n\t\tpublic TypeParameterSpec (TypeSpec declaringType, int index, ITypeDefinition definition, SpecialConstraint spec, Variance variance, MetaType info)\n\t\t\t: base (MemberKind.TypeParameter, declaringType, definition, info, Modifiers.PUBLIC)\n\t\t{\n\t\t\tthis.variance = variance;\n\t\t\tthis.spec = spec;\n\t\t\tstate &= ~StateFlags.Obsolete_Undetected;\n\t\t\ttp_pos = index;\n\t\t}\n\n\t\t//\n\t\t// Creates method owned type parameter\n\t\t//\n\t\tpublic TypeParameterSpec (int index, ITypeDefinition definition, SpecialConstraint spec, Variance variance, MetaType info)\n\t\t\t: this (null, index, definition, spec, variance, info)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic int DeclaredPosition {\n\t\t\tget {\n\t\t\t\treturn tp_pos;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttp_pos = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasSpecialConstructor {\n\t\t\tget {\n\t\t\t\treturn (spec & SpecialConstraint.Constructor) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasSpecialClass {\n\t\t\tget {\n\t\t\t\treturn (spec & SpecialConstraint.Class) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasSpecialStruct {\n\t\t\tget {\n\t\t\t\treturn (spec & SpecialConstraint.Struct) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasAnyTypeConstraint {\n\t\t\tget {\n\t\t\t\treturn (spec & (SpecialConstraint.Class | SpecialConstraint.Struct)) != 0 || ifaces != null || targs != null || HasTypeConstraint;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasTypeConstraint {\n\t\t\tget {\n\t\t\t\tvar bt = BaseType.BuiltinType;\n\t\t\t\treturn bt != BuiltinTypeSpec.Type.Object && bt != BuiltinTypeSpec.Type.ValueType;\n\t\t\t}\n\t\t}\n\n\t\tpublic override IList<TypeSpec> Interfaces {\n\t\t\tget {\n\t\t\t\tif ((state & StateFlags.InterfacesExpanded) == 0) {\n\t\t\t\t\tif (ifaces != null) {\n\t\t\t\t\t\tif (ifaces_defined == null)\n\t\t\t\t\t\t\tifaces_defined = ifaces.ToArray ();\n\n\t\t\t\t\t\tfor (int i = 0; i < ifaces_defined.Length; ++i ) {\n\t\t\t\t\t\t\tvar iface_type = ifaces_defined[i];\n\t\t\t\t\t\t\tvar td = iface_type.MemberDefinition as TypeDefinition;\n\t\t\t\t\t\t\tif (td != null)\n\t\t\t\t\t\t\t\ttd.DoExpandBaseInterfaces ();\n\n\t\t\t\t\t\t\tif (iface_type.Interfaces != null) {\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < iface_type.Interfaces.Count; ++ii) {\n\t\t\t\t\t\t\t\t\tvar ii_iface_type = iface_type.Interfaces [ii];\n\t\t\t\t\t\t\t\t\tAddInterface (ii_iface_type);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (ifaces_defined == null) {\n\t\t\t\t\t\tifaces_defined = ifaces == null ? TypeSpec.EmptyTypes : ifaces.ToArray ();\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Include all base type interfaces too, see ImportTypeBase for details\n\t\t\t\t\t//\n\t\t\t\t\tif (BaseType != null) {\n\t\t\t\t\t\tvar td = BaseType.MemberDefinition as TypeDefinition;\n\t\t\t\t\t\tif (td != null)\n\t\t\t\t\t\t\ttd.DoExpandBaseInterfaces ();\n\n\t\t\t\t\t\tif (BaseType.Interfaces != null) {\n\t\t\t\t\t\t\tforeach (var iface in BaseType.Interfaces) {\n\t\t\t\t\t\t\t\tAddInterface (iface);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstate |= StateFlags.InterfacesExpanded;\n\t\t\t\t}\n\n\t\t\t\treturn ifaces;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Unexpanded interfaces list\n\t\t//\n\t\tpublic TypeSpec[] InterfacesDefined {\n\t\t\tget {\n\t\t\t\tif (ifaces_defined == null) {\n\t\t\t\t\tifaces_defined = ifaces == null ? TypeSpec.EmptyTypes : ifaces.ToArray ();\n\t\t\t\t}\n\n\t\t\t\treturn ifaces_defined.Length == 0 ? null : ifaces_defined;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tifaces_defined = value;\n\t\t\t\tif (value != null && value.Length != 0)\n\t\t\t\t\tifaces = new List<TypeSpec> (value);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConstrained {\n\t\t\tget {\n\t\t\t\treturn spec != SpecialConstraint.None || ifaces != null || targs != null || HasTypeConstraint;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns whether the type parameter is known to be a reference type\n\t\t//\n\t\tpublic new bool IsReferenceType {\n\t\t\tget {\n\t\t\t\tif ((spec & (SpecialConstraint.Class | SpecialConstraint.Struct)) != 0)\n\t\t\t\t\treturn (spec & SpecialConstraint.Class) != 0;\n\n\t\t\t\t//\n\t\t\t\t// Full check is needed (see IsValueType for details)\n\t\t\t\t//\n\t\t\t\tif (HasTypeConstraint && TypeSpec.IsReferenceType (BaseType))\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (targs != null) {\n\t\t\t\t\tforeach (var ta in targs) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Secondary special constraints are ignored (I am not sure why)\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar tp = ta as TypeParameterSpec;\n\t\t\t\t\t\tif (tp != null && (tp.spec & (SpecialConstraint.Class | SpecialConstraint.Struct)) != 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (TypeSpec.IsReferenceType (ta))\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns whether the type parameter is known to be a value type\n\t\t//\n\t\tpublic new bool IsValueType {\n\t\t\tget {\n\t\t\t\t//\n\t\t\t\t// Even if structs/enums cannot be used directly as constraints\n\t\t\t\t// they can apear as constraint type when inheriting base constraint\n\t\t\t\t// which has dependant type parameter constraint which has been\n\t\t\t\t// inflated using value type\n\t\t\t\t//\n\t\t\t\t// class A : B<int> { override void Foo<U> () {} }\n\t\t\t\t// class B<T> { virtual void Foo<U> () where U : T {} }\n\t\t\t\t//\n\t\t\t\tif (HasSpecialStruct)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (targs != null) {\n\t\t\t\t\tforeach (var ta in targs) {\n\t\t\t\t\t\tif (TypeSpec.IsValueType (ta))\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn definition.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsMethodOwned {\n\t\t\tget {\n\t\t\t\treturn DeclaringType == null;\n\t\t\t}\n\t\t}\n\n\t\tpublic SpecialConstraint SpecialConstraint {\n\t\t\tget {\n\t\t\t\treturn spec;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tspec = value;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Types used to inflate the generic type\n\t\t//\n\t\tpublic new TypeSpec[] TypeArguments {\n\t\t\tget {\n\t\t\t\treturn targs;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttargs = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Variance Variance {\n\t\t\tget {\n\t\t\t\treturn variance;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic string DisplayDebugInfo ()\n\t\t{\n\t\t\tvar s = GetSignatureForError ();\n\t\t\treturn IsMethodOwned ? s + \"!!\" : s + \"!\";\n\t\t}\n\n\t\t//\n\t\t// Finds effective base class. The effective base class is always a class-type\n\t\t//\n\t\tpublic TypeSpec GetEffectiveBase ()\n\t\t{\n\t\t\tif (HasSpecialStruct)\n\t\t\t\treturn BaseType;\n\n\t\t\t//\n\t\t\t// If T has a class-type constraint C but no type-parameter constraints, its effective base class is C\n\t\t\t//\n\t\t\tif (BaseType != null && targs == null) {\n\t\t\t\t//\n\t\t\t\t// If T has a constraint V that is a value-type, use instead the most specific base type of V that is a class-type.\n\t\t\t\t// \n\t\t\t\t// LAMESPEC: Is System.ValueType always the most specific base type in this case?\n\t\t\t\t//\n\t\t\t\t// Note: This can never happen in an explicitly given constraint, but may occur when the constraints of a generic method\n\t\t\t\t// are implicitly inherited by an overriding method declaration or an explicit implementation of an interface method.\n\t\t\t\t//\n\t\t\t\treturn BaseType.IsStruct ? BaseType.BaseType : BaseType;\n\t\t\t}\n\n\t\t\tif (effective_base != null)\n\t\t\t\treturn effective_base;\n\n\t\t\tvar types = new TypeSpec [HasTypeConstraint ? targs.Length + 1 : targs.Length];\n\n\t\t\tfor (int i = 0; i < targs.Length; ++i) {\n\t\t\t\tvar t = targs [i];\n\n\t\t\t\t// Same issue as above, inherited constraints can be of struct type\n\t\t\t\tif (t.IsStruct) {\n\t\t\t\t\ttypes [i] = t.BaseType;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar tps = t as TypeParameterSpec;\n\t\t\t\ttypes [i] = tps != null ? tps.GetEffectiveBase () : t;\n\t\t\t}\n\n\t\t\tif (HasTypeConstraint)\n\t\t\t\ttypes [types.Length - 1] = BaseType;\n\n\t\t\treturn effective_base = Convert.FindMostEncompassedType (types);\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tvar prefix = IsMethodOwned ? \"``\" : \"`\";\n\t\t\treturn prefix + DeclaredPosition;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn Name;\n\t\t}\n\n\t\t//\n\t\t// Constraints have to match by definition but not position, used by\n\t\t// partial classes or methods\n\t\t//\n\t\tpublic bool HasSameConstraintsDefinition (TypeParameterSpec other)\n\t\t{\n\t\t\tif (spec != other.spec)\n\t\t\t\treturn false;\n\n\t\t\tif (BaseType != other.BaseType)\n\t\t\t\treturn false;\n\n\t\t\tif (!TypeSpecComparer.Override.IsSame (InterfacesDefined, other.InterfacesDefined))\n\t\t\t\treturn false;\n\n\t\t\tif (!TypeSpecComparer.Override.IsSame (targs, other.targs))\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Constraints have to match by using same set of types, used by\n\t\t// implicit interface implementation\n\t\t//\n\t\tpublic bool HasSameConstraintsImplementation (TypeParameterSpec other)\n\t\t{\n\t\t\tif (spec != other.spec)\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// It can be same base type or inflated type parameter\n\t\t\t//\n\t\t\t// interface I<T> { void Foo<U> where U : T; }\n\t\t\t// class A : I<int> { void Foo<X> where X : int {} }\n\t\t\t//\n\t\t\tbool found;\n\t\t\tif (!TypeSpecComparer.Override.IsEqual (BaseType, other.BaseType)) {\n\t\t\t\tif (other.targs == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfound = false;\n\t\t\t\tforeach (var otarg in other.targs) {\n\t\t\t\t\tif (TypeSpecComparer.Override.IsEqual (BaseType, otarg)) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!found)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Check interfaces implementation -> definition\n\t\t\tif (InterfacesDefined != null) {\n\t\t\t\t//\n\t\t\t\t// Iterate over inflated interfaces\n\t\t\t\t//\n\t\t\t\tforeach (var iface in Interfaces) {\n\t\t\t\t\tfound = false;\n\t\t\t\t\tif (other.InterfacesDefined != null) {\n\t\t\t\t\t\tforeach (var oiface in other.Interfaces) {\n\t\t\t\t\t\t\tif (TypeSpecComparer.Override.IsEqual (iface, oiface)) {\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (found)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (other.targs != null) {\n\t\t\t\t\t\tforeach (var otarg in other.targs) {\n\t\t\t\t\t\t\tif (TypeSpecComparer.Override.IsEqual (iface, otarg)) {\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!found)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check interfaces implementation <- definition\n\t\t\tif (other.InterfacesDefined != null) {\n\t\t\t\tif (InterfacesDefined == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\t//\n\t\t\t\t// Iterate over inflated interfaces\n\t\t\t\t//\n\t\t\t\tforeach (var oiface in other.Interfaces) {\n\t\t\t\t\tfound = false;\n\t\t\t\t\tforeach (var iface in Interfaces) {\n\t\t\t\t\t\tif (TypeSpecComparer.Override.IsEqual (iface, oiface)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!found)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check type parameters implementation -> definition\n\t\t\tif (targs != null) {\n\t\t\t\tif (other.targs == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tforeach (var targ in targs) {\n\t\t\t\t\tfound = false;\n\t\t\t\t\tforeach (var otarg in other.targs) {\n\t\t\t\t\t\tif (TypeSpecComparer.Override.IsEqual (targ, otarg)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!found)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check type parameters implementation <- definition\n\t\t\tif (other.targs != null) {\n\t\t\t\tforeach (var otarg in other.targs) {\n\t\t\t\t\t// Ignore inflated type arguments, were checked above\n\t\t\t\t\tif (!otarg.IsGenericParameter)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (targs == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tfound = false;\n\t\t\t\t\tforeach (var targ in targs) {\n\t\t\t\t\t\tif (TypeSpecComparer.Override.IsEqual (targ, otarg)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!found)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static TypeParameterSpec[] InflateConstraints (TypeParameterInflator inflator, TypeParameterSpec[] tparams)\n\t\t{\n\t\t\treturn InflateConstraints (tparams, l => l, inflator);\n\t\t}\n\n\t\tpublic static TypeParameterSpec[] InflateConstraints<T> (TypeParameterSpec[] tparams, Func<T, TypeParameterInflator> inflatorFactory, T arg)\n\t\t{\n\t\t\tTypeParameterSpec[] constraints = null;\n\t\t\tTypeParameterInflator? inflator = null;\n\n\t\t\tfor (int i = 0; i < tparams.Length; ++i) {\n\t\t\t\tvar tp = tparams[i];\n\t\t\t\tif (tp.HasTypeConstraint || tp.InterfacesDefined != null || tp.TypeArguments != null) {\n\t\t\t\t\tif (constraints == null) {\n\t\t\t\t\t\tconstraints = new TypeParameterSpec[tparams.Length];\n\t\t\t\t\t\tArray.Copy (tparams, constraints, constraints.Length);\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Using a factory to avoid possibly expensive inflator build up\n\t\t\t\t\t//\n\t\t\t\t\tif (inflator == null)\n\t\t\t\t\t\tinflator = inflatorFactory (arg);\n\n\t\t\t\t\tconstraints[i] = (TypeParameterSpec) constraints[i].InflateMember (inflator.Value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (constraints == null)\n\t\t\t\tconstraints = tparams;\n\n\t\t\treturn constraints;\n\t\t}\n\n\t\tpublic void InflateConstraints (TypeParameterInflator inflator, TypeParameterSpec tps)\n\t\t{\n\t\t\ttps.BaseType = inflator.Inflate (BaseType);\n\n\t\t\tvar defined = InterfacesDefined;\n\t\t\tif (defined != null) {\n\t\t\t\ttps.ifaces_defined = new TypeSpec[defined.Length];\n\t\t\t\tfor (int i = 0; i < defined.Length; ++i)\n\t\t\t\t\ttps.ifaces_defined [i] = inflator.Inflate (defined[i]);\n\t\t\t} else if (ifaces_defined == TypeSpec.EmptyTypes) {\n\t\t\t\ttps.ifaces_defined = TypeSpec.EmptyTypes;\n\t\t\t}\n\n\t\t\tvar ifaces = Interfaces;\n\t\t\tif (ifaces != null) {\n\t\t\t\ttps.ifaces = new List<TypeSpec> (ifaces.Count);\n\t\t\t\tfor (int i = 0; i < ifaces.Count; ++i)\n\t\t\t\t\ttps.ifaces.Add (inflator.Inflate (ifaces[i]));\n\t\t\t\ttps.state |= StateFlags.InterfacesExpanded;\n\t\t\t}\n\n\t\t\tif (targs != null) {\n\t\t\t\ttps.targs = new TypeSpec[targs.Length];\n\t\t\t\tfor (int i = 0; i < targs.Length; ++i)\n\t\t\t\t\ttps.targs[i] = inflator.Inflate (targs[i]);\n\t\t\t}\n\t\t}\n\n\t\tpublic override MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar tps = (TypeParameterSpec) MemberwiseClone ();\n#if DEBUG\n\t\t\ttps.ID += 1000000;\n#endif\n\n\t\t\tInflateConstraints (inflator, tps);\n\t\t\treturn tps;\n\t\t}\n\n\t\t//\n\t\t// Populates type parameter members using type parameter constraints\n\t\t// The trick here is to be called late enough but not too late to\n\t\t// populate member cache with all members from other types\n\t\t//\n\t\tprotected override void InitializeMemberCache (bool onlyTypes)\n\t\t{\n\t\t\tcache = new MemberCache ();\n\n\t\t\t//\n\t\t\t// For a type parameter the membercache is the union of the sets of members of the types\n\t\t\t// specified as a primary constraint or secondary constraint\n\t\t\t//\n\t\t\tif (BaseType.BuiltinType != BuiltinTypeSpec.Type.Object && BaseType.BuiltinType != BuiltinTypeSpec.Type.ValueType)\n\t\t\t\tcache.AddBaseType (BaseType);\n\n\t\t\tif (InterfacesDefined != null) {\n\t\t\t\tforeach (var iface_type in InterfacesDefined) {\n\t\t\t\t\tcache.AddInterface (iface_type);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (targs != null) {\n\t\t\t\tforeach (var ta in targs) {\n\t\t\t\t\tvar tps = ta as TypeParameterSpec;\n\t\t\t\t\tIList<TypeSpec> ifaces;\n\t\t\t\t\tif (tps != null) {\n\t\t\t\t\t\tvar b_type = tps.GetEffectiveBase ();\n\t\t\t\t\t\tif (b_type != null && b_type.BuiltinType != BuiltinTypeSpec.Type.Object && b_type.BuiltinType != BuiltinTypeSpec.Type.ValueType)\n\t\t\t\t\t\t\tcache.AddBaseType (b_type);\n\n\t\t\t\t\t\tifaces = tps.InterfacesDefined;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tifaces = ta.Interfaces;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ifaces != null) {\n\t\t\t\t\t\tforeach (var iface_type in ifaces) {\n\t\t\t\t\t\t\tcache.AddInterface (iface_type);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConvertibleToInterface (TypeSpec iface)\n\t\t{\n\t\t\tif (Interfaces != null) {\n\t\t\t\tforeach (var t in Interfaces) {\n\t\t\t\t\tif (t == iface)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (TypeArguments != null) {\n\t\t\t\tforeach (var t in TypeArguments) {\n\t\t\t\t\tvar tps = t as TypeParameterSpec;\n\t\t\t\t\tif (tps != null) {\n\t\t\t\t\t\tif (tps.IsConvertibleToInterface (iface))\n\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (t.ImplementsInterface (iface, false))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool HasAnyTypeParameterTypeConstrained (IGenericMethodDefinition md)\n\t\t{\n\t\t\tvar tps = md.TypeParameters;\n\t\t\tfor (int i = 0; i < md.TypeParametersCount; ++i) {\n\t\t\t\tif (tps[i].HasAnyTypeConstraint) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool HasAnyTypeParameterConstrained (IGenericMethodDefinition md)\n\t\t{\n\t\t\tvar tps = md.TypeParameters;\n\t\t\tfor (int i = 0; i < md.TypeParametersCount; ++i) {\n\t\t\t\tif (tps[i].IsConstrained) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic bool HasDependencyOn (TypeSpec type)\n\t\t{\n\t\t\tif (TypeArguments != null) {\n\t\t\t\tforeach (var targ in TypeArguments) {\n\t\t\t\t\tif (TypeSpecComparer.Override.IsEqual (targ, type))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tvar tps = targ as TypeParameterSpec;\n\t\t\t\t\tif (tps != null && tps.HasDependencyOn (type))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override TypeSpec Mutate (TypeParameterMutator mutator)\n\t\t{\n\t\t\treturn mutator.Mutate (this);\n\t\t}\n\t}\n\n\tpublic struct TypeParameterInflator\n\t{\n\t\treadonly TypeSpec type;\n\t\treadonly TypeParameterSpec[] tparams;\n\t\treadonly TypeSpec[] targs;\n\t\treadonly IModuleContext context;\n\n\t\tpublic TypeParameterInflator (TypeParameterInflator nested, TypeSpec type)\n\t\t\t: this (nested.context, type, nested.tparams, nested.targs)\n\t\t{\n\t\t}\n\n\t\tpublic TypeParameterInflator (IModuleContext context, TypeSpec type, TypeParameterSpec[] tparams, TypeSpec[] targs)\n\t\t{\n\t\t\tif (tparams.Length != targs.Length)\n\t\t\t\tthrow new ArgumentException (\"Invalid arguments\");\n\n\t\t\tthis.context = context;\n\t\t\tthis.tparams = tparams;\n\t\t\tthis.targs = targs;\n\t\t\tthis.type = type;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic IModuleContext Context {\n\t\t\tget {\n\t\t\t\treturn context;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec TypeInstance {\n\t\t\tget {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Type parameters to inflate\n\t\t//\n\t\tpublic TypeParameterSpec[] TypeParameters {\n\t\t\tget {\n\t\t\t\treturn tparams;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic TypeSpec Inflate (TypeSpec type)\n\t\t{\n\t\t\tvar tp = type as TypeParameterSpec;\n\t\t\tif (tp != null)\n\t\t\t\treturn Inflate (tp);\n\n\t\t\tvar ec = type as ElementTypeSpec;\n\t\t\tif (ec != null) {\n\t\t\t\tvar et = Inflate (ec.Element);\n\t\t\t\tif (et != ec.Element) {\n\t\t\t\t\tvar ac = ec as ArrayContainer;\n\t\t\t\t\tif (ac != null)\n\t\t\t\t\t\treturn ArrayContainer.MakeType (context.Module, et, ac.Rank);\n\n\t\t\t\t\tif (ec is PointerContainer)\n\t\t\t\t\t\treturn PointerContainer.MakeType (context.Module, et);\n\n\t\t\t\t\tthrow new NotImplementedException ();\n\t\t\t\t}\n\n\t\t\t\treturn ec;\n\t\t\t}\n\n\t\t\tif (type.Kind == MemberKind.MissingType)\n\t\t\t\treturn type;\n\n\t\t\t//\n\t\t\t// When inflating a nested type, inflate its parent first\n\t\t\t// in case it's using same type parameters (was inflated within the type)\n\t\t\t//\n\t\t\tTypeSpec[] targs;\n\t\t\tint i = 0;\n\t\t\tif (type.IsNested) {\n\t\t\t\tvar parent = Inflate (type.DeclaringType);\n\n\t\t\t\t//\n\t\t\t\t// Keep the inflated type arguments\n\t\t\t\t// \n\t\t\t\ttargs = type.TypeArguments;\n\n\t\t\t\t//\n\t\t\t\t// When inflating imported nested type used inside same declaring type, we get TypeSpec\n\t\t\t\t// because the import cache helps us to catch it. However, that means we have to look at\n\t\t\t\t// type definition to get type argument (they are in fact type parameter in this case)\n\t\t\t\t//\n\t\t\t\tif (targs.Length == 0 && type.Arity > 0)\n\t\t\t\t\ttargs = type.MemberDefinition.TypeParameters;\n\n\t\t\t\t//\n\t\t\t\t// Parent was inflated, find the same type on inflated type\n\t\t\t\t// to use same cache for nested types on same generic parent\n\t\t\t\t//\n\t\t\t\ttype = MemberCache.FindNestedType (parent, type.Name, type.Arity);\n\n\t\t\t\t//\n\t\t\t\t// Handle the tricky case where parent shares local type arguments\n\t\t\t\t// which means inflating inflated type\n\t\t\t\t//\n\t\t\t\t// class Test<T> {\n\t\t\t\t//\t\tpublic static Nested<T> Foo () { return null; }\n\t\t\t\t//\n\t\t\t\t//\t\tpublic class Nested<U> {}\n\t\t\t\t//\t}\n\t\t\t\t//\n\t\t\t\t//  return type of Test<string>.Foo() has to be Test<string>.Nested<string> \n\t\t\t\t//\n\t\t\t\tif (targs.Length > 0) {\n\t\t\t\t\tvar inflated_targs = new TypeSpec[targs.Length];\n\t\t\t\t\tfor (; i < targs.Length; ++i)\n\t\t\t\t\t\tinflated_targs[i] = Inflate (targs[i]);\n\n\t\t\t\t\ttype = type.MakeGenericType (context, inflated_targs);\n\t\t\t\t}\n\n\t\t\t\treturn type;\n\t\t\t}\n\n\t\t\t// Nothing to do for non-generic type\n\t\t\tif (type.Arity == 0)\n\t\t\t\treturn type;\n\n\t\t\ttargs = new TypeSpec[type.Arity];\n\n\t\t\t//\n\t\t\t// Inflating using outside type arguments, var v = new Foo<int> (), class Foo<T> {}\n\t\t\t//\n\t\t\tif (type is InflatedTypeSpec) {\n\t\t\t\tfor (; i < targs.Length; ++i)\n\t\t\t\t\ttargs[i] = Inflate (type.TypeArguments[i]);\n\n\t\t\t\ttype = type.GetDefinition ();\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// Inflating parent using inside type arguments, class Foo<T> { ITest<T> foo; }\n\t\t\t\t//\n\t\t\t\tvar args = type.MemberDefinition.TypeParameters;\n\t\t\t\tforeach (var ds_tp in args)\n\t\t\t\t\ttargs[i++] = Inflate (ds_tp);\n\t\t\t}\n\n\t\t\treturn type.MakeGenericType (context, targs);\n\t\t}\n\n\t\tpublic TypeSpec Inflate (TypeParameterSpec tp)\n\t\t{\n\t\t\tfor (int i = 0; i < tparams.Length; ++i)\n\t\t\t\tif (tparams [i] == tp)\n\t\t\t\t\treturn targs[i];\n\n\t\t\t// This can happen when inflating nested types\n\t\t\t// without type arguments specified\n\t\t\treturn tp;\n\t\t}\n\t}\n\n\t//\n\t// Before emitting any code we have to change all MVAR references to VAR\n\t// when the method is of generic type and has hoisted variables\n\t//\n\tpublic class TypeParameterMutator\n\t{\n\t\treadonly TypeParameters mvar;\n\t\treadonly TypeParameters var;\n\t\treadonly TypeParameterSpec[] src;\n\t\tDictionary<TypeSpec, TypeSpec> mutated_typespec;\n\n\t\tpublic TypeParameterMutator (TypeParameters mvar, TypeParameters var)\n\t\t{\n\t\t\tif (mvar.Count != var.Count)\n\t\t\t\tthrow new ArgumentException ();\n\n\t\t\tthis.mvar = mvar;\n\t\t\tthis.var = var;\n\t\t}\n\n\t\tpublic TypeParameterMutator (TypeParameterSpec[] srcVar, TypeParameters destVar)\n\t\t{\n\t\t\tif (srcVar.Length != destVar.Count)\n\t\t\t\tthrow new ArgumentException ();\n\n\t\t\tthis.src = srcVar;\n\t\t\tthis.var = destVar;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic TypeParameters MethodTypeParameters {\n\t\t\tget {\n\t\t\t\treturn mvar;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic static TypeSpec GetMemberDeclaringType (TypeSpec type)\n\t\t{\n\t\t\tif (type is InflatedTypeSpec) {\n\t\t\t\tif (type.DeclaringType == null)\n\t\t\t\t\treturn type.GetDefinition ();\n\n\t\t\t\tvar parent = GetMemberDeclaringType (type.DeclaringType);\n\t\t\t\ttype = MemberCache.GetMember<TypeSpec> (parent, type);\n\t\t\t}\n\n\t\t\treturn type;\n\t\t}\n\n\t\tpublic TypeSpec Mutate (TypeSpec ts)\n\t\t{\n\t\t\tTypeSpec value;\n\t\t\tif (mutated_typespec != null && mutated_typespec.TryGetValue (ts, out value))\n\t\t\t\treturn value;\n\n\t\t\tvalue = ts.Mutate (this);\n\t\t\tif (mutated_typespec == null)\n\t\t\t\tmutated_typespec = new Dictionary<TypeSpec, TypeSpec> ();\n\n\t\t\tmutated_typespec.Add (ts, value);\n\t\t\treturn value;\n\t\t}\n\n\t\tpublic TypeParameterSpec Mutate (TypeParameterSpec tp)\n\t\t{\n\t\t\tif (mvar != null) {\n\t\t\t\tfor (int i = 0; i < mvar.Count; ++i) {\n\t\t\t\t\tif (mvar[i].Type == tp)\n\t\t\t\t\t\treturn var[i].Type;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < src.Length; ++i) {\n\t\t\t\t\tif (src[i] == tp)\n\t\t\t\t\t\treturn var[i].Type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn tp;\n\t\t}\n\n\t\tpublic TypeSpec[] Mutate (TypeSpec[] targs)\n\t\t{\n\t\t\tTypeSpec[] mutated = new TypeSpec[targs.Length];\n\t\t\tbool changed = false;\n\t\t\tfor (int i = 0; i < targs.Length; ++i) {\n\t\t\t\tmutated[i] = Mutate (targs[i]);\n\t\t\t\tchanged |= targs[i] != mutated[i];\n\t\t\t}\n\n\t\t\treturn changed ? mutated : targs;\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   A TypeExpr which already resolved to a type parameter.\n\t/// </summary>\n\tpublic class TypeParameterExpr : TypeExpression\n\t{\n\t\tpublic TypeParameterExpr (TypeParameter type_parameter, Location loc)\n\t\t\t: base (type_parameter.Type, loc)\n\t\t{\n\t\t\tthis.eclass = ExprClass.TypeParameter;\n\t\t}\n\t}\n\n\tpublic class InflatedTypeSpec : TypeSpec\n\t{\n\t\tTypeSpec[] targs;\n\t\tTypeParameterSpec[] constraints;\n\t\treadonly TypeSpec open_type;\n\t\treadonly IModuleContext context;\n\n\t\tpublic InflatedTypeSpec (IModuleContext context, TypeSpec openType, TypeSpec declaringType, TypeSpec[] targs)\n\t\t\t: base (openType.Kind, declaringType, openType.MemberDefinition, null, openType.Modifiers)\n\t\t{\n\t\t\tif (targs == null)\n\t\t\t\tthrow new ArgumentNullException (\"targs\");\n\n\t\t\tthis.state &= ~SharedStateFlags;\n\t\t\tthis.state |= (openType.state & SharedStateFlags);\n\n\t\t\tthis.context = context;\n\t\t\tthis.open_type = openType;\n\t\t\tthis.targs = targs;\n\n\t\t\tforeach (var arg in targs) {\n\t\t\t\tif (arg.HasDynamicElement || arg.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tstate |= StateFlags.HasDynamicElement;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (open_type.Kind == MemberKind.MissingType)\n\t\t\t\tMemberCache = MemberCache.Empty;\n\n\t\t\tif ((open_type.Modifiers & Modifiers.COMPILER_GENERATED) != 0)\n\t\t\t\tstate |= StateFlags.ConstraintsChecked;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override TypeSpec BaseType {\n\t\t\tget {\n\t\t\t\tif (cache == null || (state & StateFlags.PendingBaseTypeInflate) != 0)\n\t\t\t\t\tInitializeMemberCache (true);\n\n\t\t\t\treturn base.BaseType;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Inflated type parameters with constraints array, mapping with type arguments is based on index\n\t\t//\n\t\tpublic TypeParameterSpec[] Constraints {\n\t\t\tget {\n\t\t\t\tif (constraints == null) {\n\t\t\t\t\tconstraints = TypeParameterSpec.InflateConstraints (MemberDefinition.TypeParameters, l => l.CreateLocalInflator (context), this);\n\t\t\t\t}\n\n\t\t\t\treturn constraints;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Used to cache expensive constraints validation on constructed types\n\t\t//\n\t\tpublic bool HasConstraintsChecked {\n\t\t\tget {\n\t\t\t\treturn (state & StateFlags.ConstraintsChecked) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.ConstraintsChecked : state & ~StateFlags.ConstraintsChecked;\n\t\t\t}\n\t\t}\n\n\t\tpublic override IList<TypeSpec> Interfaces {\n\t\t\tget {\n\t\t\t\tif (cache == null)\n\t\t\t\t\tInitializeMemberCache (true);\n\n\t\t\t\treturn base.Interfaces;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsExpressionTreeType {\n\t\t\tget {\n\t\t\t\treturn (open_type.state & StateFlags.InflatedExpressionType) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsArrayGenericInterface {\n\t\t\tget {\n\t\t\t\treturn (open_type.state & StateFlags.GenericIterateInterface) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsGenericTask {\n\t\t\tget {\n\t\t\t\treturn (open_type.state & StateFlags.GenericTask) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsNullableType {\n\t\t\tget {\n\t\t\t\treturn (open_type.state & StateFlags.InflatedNullableType) != 0;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Types used to inflate the generic  type\n\t\t//\n\t\tpublic override TypeSpec[] TypeArguments {\n\t\t\tget {\n\t\t\t\treturn targs;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override bool AddInterface (TypeSpec iface)\n\t\t{\n\t\t\tvar inflator = CreateLocalInflator (context);\n\t\t\tiface = inflator.Inflate (iface);\n\t\t\tif (iface == null)\n\t\t\t\treturn false;\n\n\t\t\treturn base.AddInterface (iface);\n\t\t}\n\n\t\tpublic static bool ContainsTypeParameter (TypeSpec type)\n\t\t{\n\t\t\tif (type.Kind == MemberKind.TypeParameter)\n\t\t\t\treturn true;\n\n\t\t\tvar element_container = type as ElementTypeSpec;\n\t\t\tif (element_container != null)\n\t\t\t\treturn ContainsTypeParameter (element_container.Element);\n\n\t\t\tforeach (var t in type.TypeArguments) {\n\t\t\t\tif (ContainsTypeParameter (t)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic TypeParameterInflator CreateLocalInflator (IModuleContext context)\n\t\t{\n\t\t\tTypeParameterSpec[] tparams_full;\n\t\t\tTypeSpec[] targs_full = targs;\n\t\t\tif (IsNested) {\n\t\t\t\t//\n\t\t\t\t// Special case is needed when we are inflating an open type (nested type definition)\n\t\t\t\t// on inflated parent. Consider following case\n\t\t\t\t//\n\t\t\t\t// Foo<T>.Bar<U> => Foo<string>.Bar<U>\n\t\t\t\t//\n\t\t\t\t// Any later inflation of Foo<string>.Bar<U> has to also inflate T if used inside Bar<U>\n\t\t\t\t//\n\t\t\t\tList<TypeSpec> merged_targs = null;\n\t\t\t\tList<TypeParameterSpec> merged_tparams = null;\n\n\t\t\t\tvar type = DeclaringType;\n\n\t\t\t\tdo {\n\t\t\t\t\tif (type.TypeArguments.Length > 0) {\n\t\t\t\t\t\tif (merged_targs == null) {\n\t\t\t\t\t\t\tmerged_targs = new List<TypeSpec> ();\n\t\t\t\t\t\t\tmerged_tparams = new List<TypeParameterSpec> ();\n\t\t\t\t\t\t\tif (targs.Length > 0) {\n\t\t\t\t\t\t\t\tmerged_targs.AddRange (targs);\n\t\t\t\t\t\t\t\tmerged_tparams.AddRange (open_type.MemberDefinition.TypeParameters);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmerged_tparams.AddRange (type.MemberDefinition.TypeParameters);\n\t\t\t\t\t\tmerged_targs.AddRange (type.TypeArguments);\n\t\t\t\t\t}\n\t\t\t\t\ttype = type.DeclaringType;\n\t\t\t\t} while (type != null);\n\n\t\t\t\tif (merged_targs != null) {\n\t\t\t\t\t// Type arguments are not in the right order but it should not matter in this case\n\t\t\t\t\ttargs_full = merged_targs.ToArray ();\n\t\t\t\t\ttparams_full = merged_tparams.ToArray ();\n\t\t\t\t} else if (targs.Length == 0) {\n\t\t\t\t\ttparams_full = TypeParameterSpec.EmptyTypes;\n\t\t\t\t} else {\n\t\t\t\t\ttparams_full = open_type.MemberDefinition.TypeParameters;\n\t\t\t\t}\n\t\t\t} else if (targs.Length == 0) {\n\t\t\t\ttparams_full = TypeParameterSpec.EmptyTypes;\n\t\t\t} else {\n\t\t\t\ttparams_full = open_type.MemberDefinition.TypeParameters;\n\t\t\t}\n\n\t\t\treturn new TypeParameterInflator (context, this, tparams_full, targs_full);\n\t\t}\n\n\t\tMetaType CreateMetaInfo ()\n\t\t{\n\t\t\t//\n\t\t\t// Converts nested type arguments into right order\n\t\t\t// Foo<string, bool>.Bar<int> => string, bool, int\n\t\t\t//\n\t\t\tvar all = new List<MetaType> ();\n\t\t\tTypeSpec type = this;\n\t\t\tTypeSpec definition = type;\n\t\t\tdo {\n\t\t\t\tif (type.GetDefinition().IsGeneric) {\n\t\t\t\t\tall.InsertRange (0,\n\t\t\t\t\t\ttype.TypeArguments != TypeSpec.EmptyTypes ?\n\t\t\t\t\t\ttype.TypeArguments.Select (l => l.GetMetaInfo ()) :\n\t\t\t\t\t\ttype.MemberDefinition.TypeParameters.Select (l => l.GetMetaInfo ()));\n\t\t\t\t}\n\n\t\t\t\tdefinition = definition.GetDefinition ();\n\t\t\t\ttype = type.DeclaringType;\n\t\t\t} while (type != null);\n\n\t\t\treturn definition.GetMetaInfo ().MakeGenericType (all.ToArray ());\n\t\t}\n\n\t\tpublic override ObsoleteAttribute GetAttributeObsolete ()\n\t\t{\n\t\t\treturn open_type.GetAttributeObsolete ();\n\t\t}\n\n\t\tprotected override bool IsNotCLSCompliant (out bool attrValue)\n\t\t{\n\t\t\tif (base.IsNotCLSCompliant (out attrValue))\n\t\t\t\treturn true;\n\n\t\t\tforeach (var ta in TypeArguments) {\n\t\t\t\tif (ta.MemberDefinition.CLSAttributeValue == false)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override TypeSpec GetDefinition ()\n\t\t{\n\t\t\treturn open_type;\n\t\t}\n\n\t\tpublic override MetaType GetMetaInfo ()\n\t\t{\n\t\t\tif (info == null)\n\t\t\t\tinfo = CreateMetaInfo ();\n\n\t\t\treturn info;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tif (IsNullableType)\n\t\t\t\treturn targs[0].GetSignatureForError () + \"?\";\n\n\t\t\treturn base.GetSignatureForError ();\n\t\t}\n\n\t\tprotected override string GetTypeNameSignature ()\n\t\t{\n\t\t\tif (targs.Length == 0 || MemberDefinition is AnonymousTypeClass)\n\t\t\t\treturn null;\n\n\t\t\treturn \"<\" + TypeManager.CSharpName (targs) + \">\";\n\t\t}\n\n\t\tpublic bool HasDynamicArgument ()\n\t\t{\n\t\t\tfor (int i = 0; i < targs.Length; ++i) {\n\t\t\t\tvar item = targs[i];\n\n\t\t\t\tif (item.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (item is InflatedTypeSpec) {\n\t\t\t\t\tif (((InflatedTypeSpec) item).HasDynamicArgument ())\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (item.IsArray) {\n\t\t\t\t\twhile (item.IsArray) {\n\t\t\t\t\t\titem = ((ArrayContainer) item).Element;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (item.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected override void InitializeMemberCache (bool onlyTypes)\n\t\t{\n\t\t\tif (cache == null) {\n\t\t\t\tvar open_cache = onlyTypes ? open_type.MemberCacheTypes : open_type.MemberCache;\n\n\t\t\t\t// Surprisingly, calling MemberCache on open type could meantime create cache on this type\n\t\t\t\t// for imported type parameter constraints referencing nested type of this declaration\n\t\t\t\tif (cache == null)\n\t\t\t\t\tcache = new MemberCache (open_cache);\n\t\t\t}\n\n\t\t\tvar inflator = CreateLocalInflator (context);\n\n\t\t\t//\n\t\t\t// Two stage inflate due to possible nested types recursive\n\t\t\t// references\n\t\t\t//\n\t\t\t// class A<T> {\n\t\t\t//    B b;\n\t\t\t//    class B {\n\t\t\t//      T Value;\n\t\t\t//    }\n\t\t\t// }\n\t\t\t//\n\t\t\t// When resolving type of `b' members of `B' cannot be \n\t\t\t// inflated because are not yet available in membercache\n\t\t\t//\n\t\t\tif ((state & StateFlags.PendingMemberCacheMembers) == 0) {\n\t\t\t\topen_type.MemberCacheTypes.InflateTypes (cache, inflator);\n\n\t\t\t\t//\n\t\t\t\t// Inflate any implemented interfaces\n\t\t\t\t//\n\t\t\t\tif (open_type.Interfaces != null) {\n\t\t\t\t\tifaces = new List<TypeSpec> (open_type.Interfaces.Count);\n\t\t\t\t\tforeach (var iface in open_type.Interfaces) {\n\t\t\t\t\t\tvar iface_inflated = inflator.Inflate (iface);\n\t\t\t\t\t\tif (iface_inflated == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tbase.AddInterface (iface_inflated);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Handles the tricky case of recursive nested base generic type\n\t\t\t\t//\n\t\t\t\t// class A<T> : Base<A<T>.Nested> {\n\t\t\t\t//    class Nested {}\n\t\t\t\t// }\n\t\t\t\t//\n\t\t\t\t// When inflating A<T>. base type is not yet known, secondary\n\t\t\t\t// inflation is required (not common case) once base scope\n\t\t\t\t// is known\n\t\t\t\t//\n\t\t\t\tif (open_type.BaseType == null) {\n\t\t\t\t\tif (IsClass)\n\t\t\t\t\t\tstate |= StateFlags.PendingBaseTypeInflate;\n\t\t\t\t} else {\n\t\t\t\t\tBaseType = inflator.Inflate (open_type.BaseType);\n\t\t\t\t}\n\t\t\t} else if ((state & StateFlags.PendingBaseTypeInflate) != 0) {\n\t\t\t\t//\n\t\t\t\t// It can happen when resolving base type without being defined\n\t\t\t\t// which is not allowed to happen and will always lead to an error\n\t\t\t\t//\n\t\t\t\t// class B { class N {} }\n\t\t\t\t// class A<T> : A<B.N> {}\n\t\t\t\t//\n\t\t\t\tif (open_type.BaseType == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tBaseType = inflator.Inflate (open_type.BaseType);\n\t\t\t\tstate &= ~StateFlags.PendingBaseTypeInflate;\n\t\t\t}\n\n\t\t\tif (onlyTypes) {\n\t\t\t\tstate |= StateFlags.PendingMemberCacheMembers;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar tc = open_type.MemberDefinition as TypeDefinition;\n\t\t\tif (tc != null && !tc.HasMembersDefined) {\n\t\t\t\t//\n\t\t\t\t// Inflating MemberCache with undefined members\n\t\t\t\t//\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ((state & StateFlags.PendingBaseTypeInflate) != 0) {\n\t\t\t\tBaseType = inflator.Inflate (open_type.BaseType);\n\t\t\t\tstate &= ~StateFlags.PendingBaseTypeInflate;\n\t\t\t}\n\n\t\t\tstate &= ~StateFlags.PendingMemberCacheMembers;\n\t\t\topen_type.MemberCache.InflateMembers (cache, open_type, inflator);\n\t\t}\n\n\t\tpublic override TypeSpec Mutate (TypeParameterMutator mutator)\n\t\t{\n\t\t\tvar targs = TypeArguments;\n\t\t\tif (targs != null)\n\t\t\t\ttargs = mutator.Mutate (targs);\n\n\t\t\tvar decl = DeclaringType;\n\t\t\tif (IsNested && DeclaringType.IsGenericOrParentIsGeneric)\n\t\t\t\tdecl = mutator.Mutate (decl);\n\n\t\t\tif (targs == TypeArguments && decl == DeclaringType)\n\t\t\t\treturn this;\n\n\t\t\tvar mutated = (InflatedTypeSpec) MemberwiseClone ();\n\t\t\tif (decl != DeclaringType) {\n\t\t\t\t// Gets back MethodInfo in case of metaInfo was inflated\n\t\t\t\t//mutated.info = MemberCache.GetMember<TypeSpec> (DeclaringType.GetDefinition (), this).info;\n\n\t\t\t\tmutated.declaringType = decl;\n\t\t\t\tmutated.state |= StateFlags.PendingMetaInflate;\n\t\t\t}\n\n\t\t\tif (targs != null) {\n\t\t\t\tmutated.targs = targs;\n\t\t\t\tmutated.info = null;\n\t\t\t}\n\n\t\t\treturn mutated;\n\t\t}\n\t}\n\n\n\t//\n\t// Tracks the type arguments when instantiating a generic type. It's used\n\t// by both type arguments and type parameters\n\t//\n\tpublic class TypeArguments\n\t{\n\t\tList<FullNamedExpression> args;\n\t\tTypeSpec[] atypes;\n\n\t\tpublic List<FullNamedExpression> Args {\n\t\t\tget { return this.args; }\n\t\t}\n\n\t\tpublic TypeArguments (params FullNamedExpression[] types)\n\t\t{\n\t\t\tthis.args = new List<FullNamedExpression> (types);\n\t\t}\n\n\t\tpublic void Add (FullNamedExpression type)\n\t\t{\n\t\t\targs.Add (type);\n\t\t}\n\n\t\t/// <summary>\n\t\t///   We may only be used after Resolve() is called and return the fully\n\t\t///   resolved types.\n\t\t/// </summary>\n\t\t// TODO: Not needed, just return type from resolve\n\t\tpublic TypeSpec[] Arguments {\n\t\t\tget {\n\t\t\t\treturn atypes;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tatypes = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn args.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic List<FullNamedExpression> TypeExpressions {\n\t\t\tget {\n\t\t\t\treturn this.args;\n \t\t\t}\n\t\t}\n\n\t\tpublic string GetSignatureForError()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tfor (int i = 0; i < Count; ++i) {\n\t\t\t\tvar expr = args[i];\n\t\t\t\tif (expr != null)\n\t\t\t\t\tsb.Append (expr.GetSignatureForError ());\n\n\t\t\t\tif (i + 1 < Count)\n\t\t\t\t\tsb.Append (',');\n\t\t\t}\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Resolve the type arguments.\n\t\t/// </summary>\n\t\tpublic virtual bool Resolve (IMemberContext ec)\n\t\t{\n\t\t\tif (atypes != null)\n\t\t\t    return true;\n\n\t\t\tint count = args.Count;\n\t\t\tbool ok = true;\n\n\t\t\tatypes = new TypeSpec [count];\n\n\t\t\tvar errors = ec.Module.Compiler.Report.Errors;\n\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\tvar te = args[i].ResolveAsType (ec);\n\t\t\t\tif (te == null) {\n\t\t\t\t\tok = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tatypes[i] = te;\n\n\t\t\t\tif (te.IsStatic) {\n\t\t\t\t\tec.Module.Compiler.Report.Error (718, args[i].Location, \"`{0}': static classes cannot be used as generic arguments\",\n\t\t\t\t\t\tte.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\n\t\t\t\tif (te.IsPointer || te.IsSpecialRuntimeType) {\n\t\t\t\t\tec.Module.Compiler.Report.Error (306, args[i].Location,\n\t\t\t\t\t\t\"The type `{0}' may not be used as a type argument\",\n\t\t\t\t\t\tte.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ok || errors != ec.Module.Compiler.Report.Errors)\n\t\t\t\tatypes = null;\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tpublic TypeArguments Clone ()\n\t\t{\n\t\t\tTypeArguments copy = new TypeArguments ();\n\t\t\tforeach (var ta in args)\n\t\t\t\tcopy.args.Add (ta);\n\n\t\t\treturn copy;\n\t\t}\n\t}\n\n\tpublic class UnboundTypeArguments : TypeArguments\n\t{\n\t\tpublic UnboundTypeArguments (int arity)\n\t\t\t: base (new FullNamedExpression[arity])\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Resolve (IMemberContext ec)\n\t\t{\n\t\t\t// Nothing to be resolved\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic class TypeParameters\n\t{\n\t\tList<TypeParameter> names;\n\t\tTypeParameterSpec[] types;\n\n\t\tpublic TypeParameters ()\n\t\t{\n\t\t\tnames = new List<TypeParameter> ();\n\t\t}\n\n\t\tpublic TypeParameters (int count)\n\t\t{\n\t\t\tnames = new List<TypeParameter> (count);\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn names.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec[] Types {\n\t\t\tget {\n\t\t\t\treturn types;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void Add (TypeParameter tparam)\n\t\t{\n\t\t\tnames.Add (tparam);\n\t\t}\n\n\t\tpublic void Add (TypeParameters tparams)\n\t\t{\n\t\t\tnames.AddRange (tparams.names);\n\t\t}\n\n\t\tpublic void Create (TypeSpec declaringType, int parentOffset, TypeContainer parent)\n\t\t{\n\t\t\ttypes = new TypeParameterSpec[Count];\n\t\t\tfor (int i = 0; i < types.Length; ++i) {\n\t\t\t\tvar tp = names[i];\n\n\t\t\t\ttp.Create (declaringType, parent);\n\t\t\t\ttypes[i] = tp.Type;\n\t\t\t\ttypes[i].DeclaredPosition = i + parentOffset;\n\n\t\t\t\tif (tp.Variance != Variance.None && !(declaringType != null && (declaringType.Kind == MemberKind.Interface || declaringType.Kind == MemberKind.Delegate))) {\n\t\t\t\t\tparent.Compiler.Report.Error (1960, tp.Location, \"Variant type parameters can only be used with interfaces and delegates\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Define (GenericTypeParameterBuilder[] builders)\n\t\t{\n\t\t\tfor (int i = 0; i < types.Length; ++i) {\n\t\t\t\tvar tp = names[i];\n\t\t\t\ttp.Define (builders [types [i].DeclaredPosition]);\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameter this[int index] {\n\t\t\tget {\n\t\t\t\treturn names [index];\n\t\t\t}\n\t\t\tset {\n\t\t\t\tnames[index] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameter Find (string name)\n\t\t{\n\t\t\tforeach (var tp in names) {\n\t\t\t\tif (tp.Name == name)\n\t\t\t\t\treturn tp;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic string[] GetAllNames ()\n\t\t{\n\t\t\treturn names.Select (l => l.Name).ToArray ();\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tfor (int i = 0; i < Count; ++i) {\n\t\t\t\tif (i > 0)\n\t\t\t\t\tsb.Append (',');\n\n\t\t\t\tvar name = names[i];\n\t\t\t\tif (name != null)\n\t\t\t\t\tsb.Append (name.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\n\t\tpublic void CheckPartialConstraints (Method part)\n\t\t{\n\t\t\tvar partTypeParameters = part.CurrentTypeParameters;\n\n\t\t\tfor (int i = 0; i < Count; i++) {\n\t\t\t\tvar tp_a = names[i];\n\t\t\t\tvar tp_b = partTypeParameters [i];\n\t\t\t\tif (tp_a.Constraints == null) {\n\t\t\t\t\tif (tp_b.Constraints == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t} else if (tp_b.Constraints != null && tp_a.Type.HasSameConstraintsDefinition (tp_b.Type)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tpart.Compiler.Report.SymbolRelatedToPreviousError (this[i].CurrentMemberDefinition.Location, \"\");\n\t\t\t\tpart.Compiler.Report.Error (761, part.Location,\n\t\t\t\t\t\"Partial method declarations of `{0}' have inconsistent constraints for type parameter `{1}'\",\n\t\t\t\t\tpart.GetSignatureForError (), partTypeParameters[i].GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic void UpdateConstraints (TypeDefinition part)\n\t\t{\n\t\t\tvar partTypeParameters = part.MemberName.TypeParameters;\n\n\t\t\tfor (int i = 0; i < Count; i++) {\n\t\t\t\tvar tp = names [i];\n\t\t\t\tif (tp.AddPartialConstraints (part, partTypeParameters [i]))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tpart.Compiler.Report.SymbolRelatedToPreviousError (this[i].CurrentMemberDefinition);\n\t\t\t\tpart.Compiler.Report.Error (265, part.Location,\n\t\t\t\t\t\"Partial declarations of `{0}' have inconsistent constraints for type parameter `{1}'\",\n\t\t\t\t\tpart.GetSignatureForError (), tp.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic void VerifyClsCompliance ()\n\t\t{\n\t\t\tforeach (var tp in names) {\n\t\t\t\ttp.VerifyClsCompliance ();\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// A type expression of generic type with type arguments\n\t//\n\tclass GenericTypeExpr : TypeExpr\n\t{\n\t\tTypeArguments args;\n\t\tTypeSpec open_type;\n\n\t\t/// <summary>\n\t\t///   Instantiate the generic type `t' with the type arguments `args'.\n\t\t///   Use this constructor if you already know the fully resolved\n\t\t///   generic type.\n\t\t/// </summary>\t\t\n\t\tpublic GenericTypeExpr (TypeSpec open_type, TypeArguments args, Location l)\n\t\t{\n\t\t\tthis.open_type = open_type;\n\t\t\tloc = l;\n\t\t\tthis.args = args;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn type.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)\n\t\t{\n\t\t\tif (eclass != ExprClass.Unresolved)\n\t\t\t\treturn type;\n\n\t\t\tif (!args.Resolve (mc))\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec[] atypes = args.Arguments;\n\t\t\tif (atypes == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Now bind the parameters\n\t\t\t//\n\t\t\tvar inflated = open_type.MakeGenericType (mc, atypes);\n\t\t\ttype = inflated;\n\t\t\teclass = ExprClass.Type;\n\n\t\t\t//\n\t\t\t// The constraints can be checked only when full type hierarchy is known\n\t\t\t//\n\t\t\tif (!inflated.HasConstraintsChecked && mc.Module.HasTypesFullyDefined) {\n\t\t\t\tvar constraints = inflated.Constraints;\n\t\t\t\tif (constraints != null) {\n\t\t\t\t\tvar cc = new ConstraintChecker (mc);\n\t\t\t\t\tif (cc.CheckAll (open_type, atypes, constraints, loc)) {\n\t\t\t\t\t\tinflated.HasConstraintsChecked = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn type;\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tGenericTypeExpr cobj = obj as GenericTypeExpr;\n\t\t\tif (cobj == null)\n\t\t\t\treturn false;\n\n\t\t\tif ((type == null) || (cobj.type == null))\n\t\t\t\treturn false;\n\n\t\t\treturn type == cobj.type;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn base.GetHashCode ();\n\t\t}\n\t}\n\n\t//\n\t// Generic type with unbound type arguments, used for typeof (G<,,>)\n\t//\n\tclass GenericOpenTypeExpr : TypeExpression\n\t{\n\t\tpublic GenericOpenTypeExpr (TypeSpec type, /*UnboundTypeArguments args,*/ Location loc)\n\t\t\t: base (type.GetDefinition (), loc)\n\t\t{\n\t\t}\n\t}\n\n\tstruct ConstraintChecker\n\t{\n\t\tIMemberContext mc;\n\t\tbool recursive_checks;\n\n\t\tpublic ConstraintChecker (IMemberContext ctx)\n\t\t{\n\t\t\tthis.mc = ctx;\n\t\t\trecursive_checks = false;\n\t\t}\n\n\t\t//\n\t\t// Checks the constraints of open generic type against type\n\t\t// arguments. This version is used for types which could not be\n\t\t// checked immediatelly during construction because the type\n\t\t// hierarchy was not yet fully setup (before Emit phase)\n\t\t//\n\t\tpublic static bool Check (IMemberContext mc, TypeSpec type, Location loc)\n\t\t{\n\t\t\t//\n\t\t\t// Check declaring type first if there is any\n\t\t\t//\n\t\t\tif (type.DeclaringType != null && !Check (mc, type.DeclaringType, loc))\n\t\t\t\treturn false;\n\n\t\t\twhile (type is ElementTypeSpec)\n\t\t\t\ttype = ((ElementTypeSpec) type).Element;\n\n\t\t\tif (type.Arity == 0)\n\t\t\t\treturn true;\n\n\t\t\tvar gtype = type as InflatedTypeSpec;\n\t\t\tif (gtype == null)\n\t\t\t\treturn true;\n\n\t\t\tvar constraints = gtype.Constraints;\n\t\t\tif (constraints == null)\n\t\t\t\treturn true;\n\n\t\t\tif (gtype.HasConstraintsChecked)\n\t\t\t\treturn true;\n\n\t\t\tvar cc = new ConstraintChecker (mc);\n\t\t\tcc.recursive_checks = true;\n\n\t\t\tif (cc.CheckAll (gtype.GetDefinition (), type.TypeArguments, constraints, loc)) {\n\t\t\t\tgtype.HasConstraintsChecked = true;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\t\t// Checks all type arguments againts type parameters constraints\n\t\t// NOTE: It can run in probing mode when `this.mc' is null\n\t\t//\n\t\tpublic bool CheckAll (MemberSpec context, TypeSpec[] targs, TypeParameterSpec[] tparams, Location loc)\n\t\t{\n\t\t\tfor (int i = 0; i < tparams.Length; i++) {\n\t\t\t\tvar targ = targs[i];\n\t\t\t\tif (!CheckConstraint (context, targ, tparams [i], loc))\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (!recursive_checks)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!Check (mc, targ, loc))\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool CheckConstraint (MemberSpec context, TypeSpec atype, TypeParameterSpec tparam, Location loc)\n\t\t{\n\t\t\t//\n\t\t\t// First, check the `class' and `struct' constraints.\n\t\t\t//\n\t\t\tif (tparam.HasSpecialClass && !TypeSpec.IsReferenceType (atype)) {\n\t\t\t\tif (mc != null) {\n\t\t\t\t\tmc.Module.Compiler.Report.Error (452, loc,\n\t\t\t\t\t\t\"The type `{0}' must be a reference type in order to use it as type parameter `{1}' in the generic type or method `{2}'\",\n\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (tparam.HasSpecialStruct && (!TypeSpec.IsValueType (atype) || atype.IsNullableType)) {\n\t\t\t\tif (mc != null) {\n\t\t\t\t\tmc.Module.Compiler.Report.Error (453, loc,\n\t\t\t\t\t\t\"The type `{0}' must be a non-nullable value type in order to use it as type parameter `{1}' in the generic type or method `{2}'\",\n\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool ok = true;\n\n\t\t\t//\n\t\t\t// Check the class constraint\n\t\t\t//\n\t\t\tif (tparam.HasTypeConstraint) {\n\t\t\t\tif (!CheckConversion (mc, context, atype, tparam, tparam.BaseType, loc)) {\n\t\t\t\t\tif (mc == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Check the interfaces constraints\n\t\t\t//\n\t\t\tif (tparam.InterfacesDefined != null) {\n\t\t\t\tforeach (TypeSpec iface in tparam.InterfacesDefined) {\n\t\t\t\t\tif (!CheckConversion (mc, context, atype, tparam, iface, loc)) {\n\t\t\t\t\t\tif (mc == null)\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Check the type parameter constraint\n\t\t\t//\n\t\t\tif (tparam.TypeArguments != null) {\n\t\t\t\tforeach (var ta in tparam.TypeArguments) {\n\t\t\t\t\tif (!CheckConversion (mc, context, atype, tparam, ta, loc)) {\n\t\t\t\t\t\tif (mc == null)\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Finally, check the constructor constraint.\n\t\t\t//\n\t\t\tif (!tparam.HasSpecialConstructor)\n\t\t\t\treturn ok;\n\n\t\t\tif (!HasDefaultConstructor (atype)) {\n\t\t\t\tif (mc != null) {\n\t\t\t\t\tmc.Module.Compiler.Report.SymbolRelatedToPreviousError (atype);\n\t\t\t\t\tmc.Module.Compiler.Report.Error (310, loc,\n\t\t\t\t\t\t\"The type `{0}' must have a public parameterless constructor in order to use it as parameter `{1}' in the generic type or method `{2}'\",\n\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tstatic bool HasDynamicTypeArgument (TypeSpec[] targs)\n\t\t{\n\t\t\tfor (int i = 0; i < targs.Length; ++i) {\n\t\t\t\tvar targ = targs [i];\n\t\t\t\tif (targ.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (HasDynamicTypeArgument (targ.TypeArguments))\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tbool CheckConversion (IMemberContext mc, MemberSpec context, TypeSpec atype, TypeParameterSpec tparam, TypeSpec ttype, Location loc)\n\t\t{\n\t\t\tif (atype == ttype)\n\t\t\t\treturn true;\n\n\t\t\tif (atype.IsGenericParameter) {\n\t\t\t\tvar tps = (TypeParameterSpec) atype;\n\t\t\t\tif (tps.HasDependencyOn (ttype))\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (Convert.ImplicitTypeParameterConversion (null, tps, ttype) != null)\n\t\t\t\t\treturn true;\n\n\t\t\t} else if (TypeSpec.IsValueType (atype)) {\n\t\t\t\tif (atype.IsNullableType) {\n\t\t\t\t\t//\n\t\t\t\t\t// LAMESPEC: Only identity or base type ValueType or Object satisfy nullable type\n\t\t\t\t\t//\n\t\t\t\t\tif (TypeSpec.IsBaseClass (atype, ttype, false))\n\t\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tif (Convert.ImplicitBoxingConversion (null, atype, ttype) != null)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (Convert.ImplicitReferenceConversionExists (atype, ttype) || Convert.ImplicitBoxingConversion (null, atype, ttype) != null)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (mc != null) {\n\t\t\t\tmc.Module.Compiler.Report.SymbolRelatedToPreviousError (tparam);\n\t\t\t\tif (atype.IsGenericParameter) {\n\t\t\t\t\tmc.Module.Compiler.Report.Error (314, loc,\n\t\t\t\t\t\t\"The type `{0}' cannot be used as type parameter `{1}' in the generic type or method `{2}'. There is no boxing or type parameter conversion from `{0}' to `{3}'\",\n\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError (), ttype.GetSignatureForError ());\n\t\t\t\t} else if (TypeSpec.IsValueType (atype)) {\n\t\t\t\t\tif (atype.IsNullableType) {\n\t\t\t\t\t\tif (ttype.IsInterface) {\n\t\t\t\t\t\t\tmc.Module.Compiler.Report.Error (313, loc,\n\t\t\t\t\t\t\t\t\"The type `{0}' cannot be used as type parameter `{1}' in the generic type or method `{2}'. The nullable type `{0}' never satisfies interface constraint `{3}'\",\n\t\t\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError (), ttype.GetSignatureForError ());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmc.Module.Compiler.Report.Error (312, loc,\n\t\t\t\t\t\t\t\t\"The type `{0}' cannot be used as type parameter `{1}' in the generic type or method `{2}'. The nullable type `{0}' does not satisfy constraint `{3}'\",\n\t\t\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError (), ttype.GetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmc.Module.Compiler.Report.Error (315, loc,\n\t\t\t\t\t\t\t\"The type `{0}' cannot be used as type parameter `{1}' in the generic type or method `{2}'. There is no boxing conversion from `{0}' to `{3}'\",\n\t\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError (), ttype.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmc.Module.Compiler.Report.Error (311, loc,\n\t\t\t\t\t\t\"The type `{0}' cannot be used as type parameter `{1}' in the generic type or method `{2}'. There is no implicit reference conversion from `{0}' to `{3}'\",\n\t\t\t\t\t\tatype.GetSignatureForError (), tparam.GetSignatureForError (), context.GetSignatureForError (), ttype.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic bool HasDefaultConstructor (TypeSpec atype)\n\t\t{\n\t\t\tvar tp = atype as TypeParameterSpec;\n\t\t\tif (tp != null) {\n\t\t\t\treturn tp.HasSpecialConstructor || tp.HasSpecialStruct;\n\t\t\t}\n\n\t\t\tif (atype.IsStruct || atype.IsEnum)\n\t\t\t\treturn true;\n\n\t\t\tif (atype.IsAbstract)\n\t\t\t\treturn false;\n\n\t\t\tvar tdef = atype.GetDefinition ();\n\n\t\t\tvar found = MemberCache.FindMember (tdef,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.EmptyReadOnlyParameters),\n\t\t\t\tBindingRestriction.DeclaredOnly | BindingRestriction.InstanceOnly);\n\n\t\t\treturn found != null && (found.Modifiers & Modifiers.PUBLIC) != 0;\n\t\t}\n\t}\n\n\t//\n\t// Implements C# type inference\n\t//\n\tclass TypeInference\n\t{\n\t\t//\n\t\t// Tracks successful rate of type inference\n\t\t//\n\t\tint score = int.MaxValue;\n\t\treadonly Arguments arguments;\n\t\treadonly int arg_count;\n\n\t\tpublic TypeInference (Arguments arguments)\n\t\t{\n\t\t\tthis.arguments = arguments;\n\t\t\tif (arguments != null)\n\t\t\t\targ_count = arguments.Count;\n\t\t}\n\n\t\tpublic int InferenceScore {\n\t\t\tget {\n\t\t\t\treturn score;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec[] InferMethodArguments (ResolveContext ec, MethodSpec method)\n\t\t{\n\t\t\tvar method_generic_args = method.GenericDefinition.TypeParameters;\n\t\t\tTypeInferenceContext context = new TypeInferenceContext (method_generic_args);\n\t\t\tif (!context.UnfixedVariableExists)\n\t\t\t\treturn TypeSpec.EmptyTypes;\n\n\t\t\tAParametersCollection pd = method.Parameters;\n\t\t\tif (!InferInPhases (ec, context, pd))\n\t\t\t\treturn null;\n\n\t\t\treturn context.InferredTypeArguments;\n\t\t}\n\n\t\t//\n\t\t// Implements method type arguments inference\n\t\t//\n\t\tbool InferInPhases (ResolveContext ec, TypeInferenceContext tic, AParametersCollection methodParameters)\n\t\t{\n\t\t\tint params_arguments_start;\n\t\t\tif (methodParameters.HasParams) {\n\t\t\t\tparams_arguments_start = methodParameters.Count - 1;\n\t\t\t} else {\n\t\t\t\tparams_arguments_start = arg_count;\n\t\t\t}\n\n\t\t\tTypeSpec [] ptypes = methodParameters.Types;\n\t\t\t\n\t\t\t//\n\t\t\t// The first inference phase\n\t\t\t//\n\t\t\tTypeSpec method_parameter = null;\n\t\t\tfor (int i = 0; i < arg_count; i++) {\n\t\t\t\tArgument a = arguments [i];\n\t\t\t\tif (a == null)\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tif (i < params_arguments_start) {\n\t\t\t\t\tmethod_parameter = methodParameters.Types [i];\n\t\t\t\t} else if (i == params_arguments_start) {\n\t\t\t\t\tif (arg_count == params_arguments_start + 1 && TypeManager.HasElementType (a.Type))\n\t\t\t\t\t\tmethod_parameter = methodParameters.Types [params_arguments_start];\n\t\t\t\t\telse\n\t\t\t\t\t\tmethod_parameter = TypeManager.GetElementType (methodParameters.Types [params_arguments_start]);\n\n\t\t\t\t\tptypes = (TypeSpec[]) ptypes.Clone ();\n\t\t\t\t\tptypes [i] = method_parameter;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// When a lambda expression, an anonymous method\n\t\t\t\t// is used an explicit argument type inference takes a place\n\t\t\t\t//\n\t\t\t\tAnonymousMethodExpression am = a.Expr as AnonymousMethodExpression;\n\t\t\t\tif (am != null) {\n\t\t\t\t\tif (am.ExplicitTypeInference (tic, method_parameter))\n\t\t\t\t\t\t--score; \n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (a.IsByRef) {\n\t\t\t\t\tscore -= tic.ExactInference (a.Type, method_parameter);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (a.Expr.Type == InternalType.NullLiteral)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (TypeSpec.IsValueType (method_parameter)) {\n\t\t\t\t\tscore -= tic.LowerBoundInference (a.Type, method_parameter);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Otherwise an output type inference is made\n\t\t\t\t//\n\t\t\t\tscore -= tic.OutputTypeInference (ec, a.Expr, method_parameter);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Part of the second phase but because it happens only once\n\t\t\t// we don't need to call it in cycle\n\t\t\t//\n\t\t\tbool fixed_any = false;\n\t\t\tif (!tic.FixIndependentTypeArguments (ec, ptypes, ref fixed_any))\n\t\t\t\treturn false;\n\n\t\t\treturn DoSecondPhase (ec, tic, ptypes, !fixed_any);\n\t\t}\n\n\t\tbool DoSecondPhase (ResolveContext ec, TypeInferenceContext tic, TypeSpec[] methodParameters, bool fixDependent)\n\t\t{\n\t\t\tbool fixed_any = false;\n\t\t\tif (fixDependent && !tic.FixDependentTypes (ec, ref fixed_any))\n\t\t\t\treturn false;\n\n\t\t\t// If no further unfixed type variables exist, type inference succeeds\n\t\t\tif (!tic.UnfixedVariableExists)\n\t\t\t\treturn true;\n\n\t\t\tif (!fixed_any && fixDependent)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\t// For all arguments where the corresponding argument output types\n\t\t\t// contain unfixed type variables but the input types do not,\n\t\t\t// an output type inference is made\n\t\t\tfor (int i = 0; i < arg_count; i++) {\n\t\t\t\t\n\t\t\t\t// Align params arguments\n\t\t\t\tTypeSpec t_i = methodParameters [i >= methodParameters.Length ? methodParameters.Length - 1: i];\n\t\t\t\t\n\t\t\t\tif (!t_i.IsDelegate) {\n\t\t\t\t\tif (!t_i.IsExpressionTreeType)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tt_i = TypeManager.GetTypeArguments (t_i) [0];\n\t\t\t\t}\n\n\t\t\t\tvar mi = Delegate.GetInvokeMethod (t_i);\n\t\t\t\tTypeSpec rtype = mi.ReturnType;\n\n\t\t\t\tif (tic.IsReturnTypeNonDependent (mi, rtype)) {\n\t\t\t\t\t// It can be null for default arguments\n\t\t\t\t\tif (arguments[i] == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tscore -= tic.OutputTypeInference (ec, arguments[i].Expr, t_i);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\treturn DoSecondPhase (ec, tic, methodParameters, true);\n\t\t}\n\t}\n\n\tpublic class TypeInferenceContext\n\t{\n\t\tprotected enum BoundKind\n\t\t{\n\t\t\tExact\t= 0,\n\t\t\tLower\t= 1,\n\t\t\tUpper\t= 2\n\t\t}\n\n\t\tstruct BoundInfo : IEquatable<BoundInfo>\n\t\t{\n\t\t\tpublic readonly TypeSpec Type;\n\t\t\tpublic readonly BoundKind Kind;\n\n\t\t\tpublic BoundInfo (TypeSpec type, BoundKind kind)\n\t\t\t{\n\t\t\t\tthis.Type = type;\n\t\t\t\tthis.Kind = kind;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode ()\n\t\t\t{\n\t\t\t\treturn Type.GetHashCode ();\n\t\t\t}\n\n\t\t\tpublic Expression GetTypeExpression ()\n\t\t\t{\n\t\t\t\treturn new TypeExpression (Type, Location.Null);\n\t\t\t}\n\n\t\t\t#region IEquatable<BoundInfo> Members\n\n\t\t\tpublic bool Equals (BoundInfo other)\n\t\t\t{\n\t\t\t\treturn Type == other.Type && Kind == other.Kind;\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\treadonly TypeSpec[] tp_args;\n\t\treadonly TypeSpec[] fixed_types;\n\t\treadonly List<BoundInfo>[] bounds;\n\n\t\t// TODO MemberCache: Could it be TypeParameterSpec[] ??\n\t\tpublic TypeInferenceContext (TypeSpec[] typeArguments)\n\t\t{\n\t\t\tif (typeArguments.Length == 0)\n\t\t\t\tthrow new ArgumentException (\"Empty generic arguments\");\n\n\t\t\tfixed_types = new TypeSpec [typeArguments.Length];\n\t\t\tfor (int i = 0; i < typeArguments.Length; ++i) {\n\t\t\t\tif (typeArguments [i].IsGenericParameter) {\n\t\t\t\t\tif (bounds == null) {\n\t\t\t\t\t\tbounds = new List<BoundInfo> [typeArguments.Length];\n\t\t\t\t\t\ttp_args = new TypeSpec [typeArguments.Length];\n\t\t\t\t\t}\n\t\t\t\t\ttp_args [i] = typeArguments [i];\n\t\t\t\t} else {\n\t\t\t\t\tfixed_types [i] = typeArguments [i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// \n\t\t// Used together with AddCommonTypeBound fo implement\n\t\t// 7.4.2.13 Finding the best common type of a set of expressions\n\t\t//\n\t\tpublic TypeInferenceContext ()\n\t\t{\n\t\t\tfixed_types = new TypeSpec [1];\n\t\t\ttp_args = new TypeSpec [1];\n\t\t\ttp_args[0] = InternalType.Arglist; // it can be any internal type\n\t\t\tbounds = new List<BoundInfo> [1];\n\t\t}\n\n\t\tpublic TypeSpec[] InferredTypeArguments {\n\t\t\tget {\n\t\t\t\treturn fixed_types;\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddCommonTypeBound (TypeSpec type)\n\t\t{\n\t\t\tAddToBounds (new BoundInfo (type, BoundKind.Lower), 0, false);\n\t\t}\n\n\t\tpublic void AddCommonTypeBoundAsync (TypeSpec type)\n\t\t{\n\t\t\tAddToBounds (new BoundInfo (type, BoundKind.Lower), 0, true);\n\t\t}\n\n\t\tvoid AddToBounds (BoundInfo bound, int index, bool voidAllowed)\n\t\t{\n\t\t\t//\n\t\t\t// Some types cannot be used as type arguments\n\t\t\t//\n\t\t\tif ((bound.Type.Kind == MemberKind.Void && !voidAllowed) || bound.Type.IsPointer || bound.Type.IsSpecialRuntimeType ||\n\t\t\t\tbound.Type == InternalType.MethodGroup || bound.Type == InternalType.AnonymousMethod)\n\t\t\t\treturn;\n\n\t\t\tvar a = bounds [index];\n\t\t\tif (a == null) {\n\t\t\t\ta = new List<BoundInfo> (2);\n\t\t\t\ta.Add (bound);\n\t\t\t\tbounds [index] = a;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Contains (bound))\n\t\t\t\treturn;\n\n\t\t\ta.Add (bound);\n\t\t}\n\t\t\n\t\tbool AllTypesAreFixed (TypeSpec[] types)\n\t\t{\n\t\t\tforeach (TypeSpec t in types) {\n\t\t\t\tif (t.IsGenericParameter) {\n\t\t\t\t\tif (!IsFixed (t))\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (TypeManager.IsGenericType (t))\n\t\t\t\t\treturn AllTypesAreFixed (TypeManager.GetTypeArguments (t));\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\t\t\n\n\t\t//\n\t\t// 26.3.3.8 Exact Inference\n\t\t//\n\t\tpublic int ExactInference (TypeSpec u, TypeSpec v)\n\t\t{\n\t\t\t// If V is an array type\n\t\t\tif (v.IsArray) {\n\t\t\t\tif (!u.IsArray)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tvar ac_u = (ArrayContainer) u;\n\t\t\t\tvar ac_v = (ArrayContainer) v;\n\t\t\t\tif (ac_u.Rank != ac_v.Rank)\n\t\t\t\t\treturn 0;\n\n\t\t\t\treturn ExactInference (ac_u.Element, ac_v.Element);\n\t\t\t}\n\n\t\t\t// If V is constructed type and U is constructed type\n\t\t\tif (TypeManager.IsGenericType (v)) {\n\t\t\t\tif (!TypeManager.IsGenericType (u) || v.MemberDefinition != u.MemberDefinition)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tTypeSpec [] ga_u = TypeManager.GetTypeArguments (u);\n\t\t\t\tTypeSpec [] ga_v = TypeManager.GetTypeArguments (v);\n\t\t\t\tif (ga_u.Length != ga_v.Length)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tint score = 0;\n\t\t\t\tfor (int i = 0; i < ga_u.Length; ++i)\n\t\t\t\t\tscore += ExactInference (ga_u [i], ga_v [i]);\n\n\t\t\t\treturn System.Math.Min (1, score);\n\t\t\t}\n\n\t\t\t// If V is one of the unfixed type arguments\n\t\t\tint pos = IsUnfixed (v);\n\t\t\tif (pos == -1)\n\t\t\t\treturn 0;\n\n\t\t\tAddToBounds (new BoundInfo (u, BoundKind.Exact), pos, false);\n\t\t\treturn 1;\n\t\t}\n\n\t\tpublic bool FixAllTypes (ResolveContext ec)\n\t\t{\n\t\t\tfor (int i = 0; i < tp_args.Length; ++i) {\n\t\t\t\tif (!FixType (ec, i))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// All unfixed type variables Xi are fixed for which all of the following hold:\n\t\t// a, There is at least one type variable Xj that depends on Xi\n\t\t// b, Xi has a non-empty set of bounds\n\t\t// \n\t\tpublic bool FixDependentTypes (ResolveContext ec, ref bool fixed_any)\n\t\t{\n\t\t\tfor (int i = 0; i < tp_args.Length; ++i) {\n\t\t\t\tif (fixed_types[i] != null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (bounds[i] == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!FixType (ec, i))\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\tfixed_any = true;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// All unfixed type variables Xi which depend on no Xj are fixed\n\t\t//\n\t\tpublic bool FixIndependentTypeArguments (ResolveContext ec, TypeSpec[] methodParameters, ref bool fixed_any)\n\t\t{\n\t\t\tvar types_to_fix = new List<TypeSpec> (tp_args);\n\t\t\tfor (int i = 0; i < methodParameters.Length; ++i) {\n\t\t\t\tTypeSpec t = methodParameters[i];\n\n\t\t\t\tif (!t.IsDelegate) {\n\t\t\t\t\tif (!t.IsExpressionTreeType)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tt =  TypeManager.GetTypeArguments (t) [0];\n\t\t\t\t}\n\n\t\t\t\tif (t.IsGenericParameter)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar invoke = Delegate.GetInvokeMethod (t);\n\t\t\t\tTypeSpec rtype = invoke.ReturnType;\n\t\t\t\twhile (rtype.IsArray)\n\t\t\t\t\trtype = ((ArrayContainer) rtype).Element;\n\n\t\t\t\tif (!rtype.IsGenericParameter && !TypeManager.IsGenericType (rtype))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Remove dependent types, they cannot be fixed yet\n\t\t\t\tRemoveDependentTypes (types_to_fix, rtype);\n\t\t\t}\n\n\t\t\tforeach (TypeSpec t in types_to_fix) {\n\t\t\t\tif (t == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tint idx = IsUnfixed (t);\n\t\t\t\tif (idx >= 0 && !FixType (ec, idx)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfixed_any = types_to_fix.Count > 0;\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// 26.3.3.10 Fixing\n\t\t//\n\t\tpublic bool FixType (ResolveContext ec, int i)\n\t\t{\n\t\t\t// It's already fixed\n\t\t\tif (fixed_types[i] != null)\n\t\t\t\tthrow new InternalErrorException (\"Type argument has been already fixed\");\n\n\t\t\tvar candidates = bounds [i];\n\t\t\tif (candidates == null)\n\t\t\t\treturn false;\n\n\t\t\tif (candidates.Count == 1) {\n\t\t\t\tTypeSpec t = candidates[0].Type;\n\t\t\t\tif (t == InternalType.NullLiteral)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfixed_types [i] = t;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// The set of candidate types Uj starts out as the set of\n\t\t\t// all types in the set of bounds for Xi\n\t\t\t//\n\t\t\tvar applicable = new bool [candidates.Count];\n\t\t\tfor (int ci = 0; ci < applicable.Length; ++ci)\n\t\t\t\tapplicable [ci] = true;\n\n\t\t\tfor (int ci = 0; ci < applicable.Length; ++ci) {\n\t\t\t\tvar bound = candidates [ci];\n\t\t\t\tint cii = 0;\n\n\t\t\t\tswitch (bound.Kind) {\n\t\t\t\tcase BoundKind.Exact:\n\t\t\t\t\tfor (; cii != applicable.Length; ++cii) {\n\t\t\t\t\t\tif (ci == cii)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!applicable[cii])\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// For each exact bound U of Xi all types Uj which are not identical\n\t\t\t\t\t\t// to U are removed from the candidate set\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (candidates [cii].Type != bound.Type)\n\t\t\t\t\t\t\tapplicable[cii] = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase BoundKind.Lower:\n\t\t\t\t\tfor (; cii != applicable.Length; ++cii) {\n\t\t\t\t\t\tif (ci == cii)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!applicable[cii])\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// For each lower bound U of Xi all types Uj to which there is not an implicit conversion\n\t\t\t\t\t\t// from U are removed from the candidate set\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (!Convert.ImplicitConversionExists (ec, bound.GetTypeExpression (), candidates [cii].Type)) {\n\t\t\t\t\t\t\tapplicable[cii] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase BoundKind.Upper:\n\t\t\t\t\tfor (; cii != applicable.Length; ++cii) {\n\t\t\t\t\t\tif (ci == cii)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!applicable[cii])\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// For each upper bound U of Xi all types Uj from which there is not an implicit conversion\n\t\t\t\t\t\t// to U are removed from the candidate set\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (!Convert.ImplicitConversionExists (ec, candidates[cii].GetTypeExpression (), bound.Type))\n\t\t\t\t\t\t\tapplicable[cii] = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tTypeSpec best_candidate = null;\n\t\t\tfor (int ci = 0; ci < applicable.Length; ++ci) {\n\t\t\t\tif (!applicable[ci])\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar bound = candidates [ci];\n\t\t\t\tif (bound.Type == best_candidate)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tint cii = 0;\n\t\t\t\tfor (; cii < applicable.Length; ++cii) {\n\t\t\t\t\tif (ci == cii)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!applicable[cii])\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!Convert.ImplicitConversionExists (ec, candidates[cii].GetTypeExpression (), bound.Type))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (cii != applicable.Length)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//\n\t\t\t\t// We already have the best candidate, break if it's different (non-unique)\n\t\t\t\t//\n\t\t\t\t// Dynamic is never ambiguous as we prefer dynamic over other best candidate types\n\t\t\t\t//\n\t\t\t\tif (best_candidate != null) {\n\n\t\t\t\t\tif (best_candidate.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (bound.Type.BuiltinType != BuiltinTypeSpec.Type.Dynamic && best_candidate != bound.Type)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tbest_candidate = bound.Type;\n\t\t\t}\n\n\t\t\tif (best_candidate == null)\n\t\t\t\treturn false;\n\n\t\t\tfixed_types[i] = best_candidate;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic bool HasBounds (int pos)\n\t\t{\n\t\t\treturn bounds[pos] != null;\n\t\t}\n\t\t\n\t\t//\n\t\t// Uses inferred or partially infered types to inflate delegate type argument. Returns\n\t\t// null when type parameter has not been fixed\n\t\t//\n\t\tpublic TypeSpec InflateGenericArgument (IModuleContext context, TypeSpec parameter)\n\t\t{\n\t\t\tvar tp = parameter as TypeParameterSpec;\n\t\t\tif (tp != null) {\n\t\t\t\t//\n\t\t\t\t// Type inference works on generic arguments (MVAR) only\n\t\t\t\t//\n\t\t\t\tif (!tp.IsMethodOwned)\n\t\t\t\t\treturn parameter;\n\n\t\t\t\t//\n\t\t\t\t// Ensure the type parameter belongs to same container\n\t\t\t\t//\n\t\t\t\tif (tp.DeclaredPosition < tp_args.Length && tp_args[tp.DeclaredPosition] == parameter)\n\t\t\t\t\treturn fixed_types[tp.DeclaredPosition] ?? parameter;\n\n\t\t\t\treturn parameter;\n\t\t\t}\n\n\t\t\tvar gt = parameter as InflatedTypeSpec;\n\t\t\tif (gt != null) {\n\t\t\t\tvar inflated_targs = new TypeSpec [gt.TypeArguments.Length];\n\t\t\t\tfor (int ii = 0; ii < inflated_targs.Length; ++ii) {\n\t\t\t\t\tvar inflated = InflateGenericArgument (context, gt.TypeArguments [ii]);\n\t\t\t\t\tif (inflated == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tinflated_targs[ii] = inflated;\n\t\t\t\t}\n\n\t\t\t\treturn gt.GetDefinition ().MakeGenericType (context, inflated_targs);\n\t\t\t}\n\n\t\t\tvar ac = parameter as ArrayContainer;\n\t\t\tif (ac != null) {\n\t\t\t\tvar inflated = InflateGenericArgument (context, ac.Element);\n\t\t\t\tif (inflated != ac.Element)\n\t\t\t\t\treturn ArrayContainer.MakeType (context.Module, inflated);\n\t\t\t}\n\n\t\t\treturn parameter;\n\t\t}\n\t\t\n\t\t//\n\t\t// Tests whether all delegate input arguments are fixed and generic output type\n\t\t// requires output type inference \n\t\t//\n\t\tpublic bool IsReturnTypeNonDependent (MethodSpec invoke, TypeSpec returnType)\n\t\t{\n\t\t\tAParametersCollection d_parameters = invoke.Parameters;\n\n\t\t\tif (d_parameters.IsEmpty)\n\t\t\t\treturn true;\n\n\t\t\twhile (returnType.IsArray)\n\t\t\t\treturnType = ((ArrayContainer) returnType).Element;\n\n\t\t\tif (returnType.IsGenericParameter) {\n\t\t\t\tif (IsFixed (returnType))\n\t\t\t\t    return false;\n\t\t\t} else if (TypeManager.IsGenericType (returnType)) {\n\t\t\t\tTypeSpec[] g_args = TypeManager.GetTypeArguments (returnType);\n\t\t\t\t\n\t\t\t\t// At least one unfixed return type has to exist \n\t\t\t\tif (AllTypesAreFixed (g_args))\n\t\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// All generic input arguments have to be fixed\n\t\t\treturn AllTypesAreFixed (d_parameters.Types);\n\t\t}\n\n\t\tbool IsFixed (TypeSpec type)\n\t\t{\n\t\t\treturn IsUnfixed (type) == -1;\n\t\t}\t\t\n\n\t\tint IsUnfixed (TypeSpec type)\n\t\t{\n\t\t\tif (!type.IsGenericParameter)\n\t\t\t\treturn -1;\n\n\t\t\tfor (int i = 0; i < tp_args.Length; ++i) {\n\t\t\t\tif (tp_args[i] == type) {\n\t\t\t\t\tif (fixed_types[i] != null)\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\t//\n\t\t// 26.3.3.9 Lower-bound Inference\n\t\t//\n\t\tpublic int LowerBoundInference (TypeSpec u, TypeSpec v)\n\t\t{\n\t\t\treturn LowerBoundInference (u, v, false);\n\t\t}\n\n\t\t//\n\t\t// Lower-bound (false) or Upper-bound (true) inference based on inversed argument\n\t\t//\n\t\tint LowerBoundInference (TypeSpec u, TypeSpec v, bool inversed)\n\t\t{\n\t\t\t// If V is one of the unfixed type arguments\n\t\t\tint pos = IsUnfixed (v);\n\t\t\tif (pos != -1) {\n\t\t\t\tAddToBounds (new BoundInfo (u, inversed ? BoundKind.Upper : BoundKind.Lower), pos, false);\n\t\t\t\treturn 1;\n\t\t\t}\t\t\t\n\n\t\t\t// If U is an array type\n\t\t\tvar u_ac = u as ArrayContainer;\n\t\t\tif (u_ac != null) {\n\t\t\t\tvar v_ac = v as ArrayContainer;\n\t\t\t\tif (v_ac != null) {\n\t\t\t\t\tif (u_ac.Rank != v_ac.Rank)\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\tif (TypeSpec.IsValueType (u_ac.Element))\n\t\t\t\t\t\treturn ExactInference (u_ac.Element, v_ac.Element);\n\n\t\t\t\t\treturn LowerBoundInference (u_ac.Element, v_ac.Element, inversed);\n\t\t\t\t}\n\n\t\t\t\tif (u_ac.Rank != 1 || !v.IsArrayGenericInterface)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tvar v_i = TypeManager.GetTypeArguments (v) [0];\n\t\t\t\tif (TypeSpec.IsValueType (u_ac.Element))\n\t\t\t\t\treturn ExactInference (u_ac.Element, v_i);\n\n\t\t\t\treturn LowerBoundInference (u_ac.Element, v_i);\n\t\t\t}\n\t\t\t\n\t\t\tif (v.IsGenericOrParentIsGeneric) {\n\t\t\t\t//\n\t\t\t\t// if V is a constructed type C<V1..Vk> and there is a unique type C<U1..Uk>\n\t\t\t\t// such that U is identical to, inherits from (directly or indirectly),\n\t\t\t\t// or implements (directly or indirectly) C<U1..Uk>\n\t\t\t\t//\n\t\t\t\tvar u_candidates = new List<TypeSpec> ();\n\t\t\t\tvar open_v = v.MemberDefinition;\n\n\t\t\t\tfor (TypeSpec t = u; t != null; t = t.BaseType) {\n\t\t\t\t\tif (open_v == t.MemberDefinition)\n\t\t\t\t\t\tu_candidates.Add (t);\n\n\t\t\t\t\t//\n\t\t\t\t\t// Using this trick for dynamic type inference, the spec says the type arguments are \"unknown\" but\n\t\t\t\t\t// that would complicate the process a lot, instead I treat them as dynamic\n\t\t\t\t\t//\n\t\t\t\t\tif (t.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\t\tu_candidates.Add (t);\n\t\t\t\t}\n\n\t\t\t\tif (u.Interfaces != null) {\n\t\t\t\t\tforeach (var iface in u.Interfaces) {\n\t\t\t\t\t\tif (open_v == iface.MemberDefinition)\n\t\t\t\t\t\t\tu_candidates.Add (iface);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tTypeSpec[] unique_candidate_targs = null;\n\t\t\t\tvar ga_v = TypeSpec.GetAllTypeArguments (v);\n\t\t\t\tforeach (TypeSpec u_candidate in u_candidates) {\n\t\t\t\t\t//\n\t\t\t\t\t// The unique set of types U1..Uk means that if we have an interface I<T>,\n\t\t\t\t\t// class U : I<int>, I<long> then no type inference is made when inferring\n\t\t\t\t\t// type I<T> by applying type U because T could be int or long\n\t\t\t\t\t//\n\t\t\t\t\tif (unique_candidate_targs != null) {\n\t\t\t\t\t\tTypeSpec[] second_unique_candidate_targs = TypeSpec.GetAllTypeArguments (u_candidate);\n\t\t\t\t\t\tif (TypeSpecComparer.Equals (unique_candidate_targs, second_unique_candidate_targs)) {\n\t\t\t\t\t\t\tunique_candidate_targs = second_unique_candidate_targs;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Break when candidate arguments are ambiguous\n\t\t\t\t\t\t//\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// A candidate is dynamic type expression, to simplify things use dynamic\n\t\t\t\t\t// for all type parameter of this type. For methods like this one\n\t\t\t\t\t// \n\t\t\t\t\t// void M<T, U> (IList<T>, IList<U[]>)\n\t\t\t\t\t//\n\t\t\t\t\t// dynamic becomes both T and U when the arguments are of dynamic type\n\t\t\t\t\t//\n\t\t\t\t\tif (u_candidate.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\t\tunique_candidate_targs = new TypeSpec[ga_v.Length];\n\t\t\t\t\t\tfor (int i = 0; i < unique_candidate_targs.Length; ++i)\n\t\t\t\t\t\t\tunique_candidate_targs[i] = u_candidate;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunique_candidate_targs = TypeSpec.GetAllTypeArguments (u_candidate);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (unique_candidate_targs != null) {\n\t\t\t\t\tint score = 0;\n\t\t\t\t\tint tp_index = -1;\n\t\t\t\t\tTypeParameterSpec[] tps = null;\n\n\t\t\t\t\tfor (int i = 0; i < unique_candidate_targs.Length; ++i) {\n\t\t\t\t\t\tif (tp_index < 0) {\n\t\t\t\t\t\t\twhile (v.Arity == 0)\n\t\t\t\t\t\t\t\tv = v.DeclaringType;\n\n\t\t\t\t\t\t\ttps = v.MemberDefinition.TypeParameters;\n\t\t\t\t\t\t\ttp_index = tps.Length - 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tVariance variance = tps [tp_index--].Variance;\n\n\t\t\t\t\t\tTypeSpec u_i = unique_candidate_targs [i];\n\t\t\t\t\t\tif (variance == Variance.None || TypeSpec.IsValueType (u_i)) {\n\t\t\t\t\t\t\tif (ExactInference (u_i, ga_v [i]) == 0)\n\t\t\t\t\t\t\t\t++score;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbool upper_bound = (variance == Variance.Contravariant && !inversed) ||\n\t\t\t\t\t\t\t\t(variance == Variance.Covariant && inversed);\n\n\t\t\t\t\t\t\tif (LowerBoundInference (u_i, ga_v [i], upper_bound) == 0)\n\t\t\t\t\t\t\t\t++score;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn score;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t//\n\t\t// 26.3.3.6 Output Type Inference\n\t\t//\n\t\tpublic int OutputTypeInference (ResolveContext ec, Expression e, TypeSpec t)\n\t\t{\n\t\t\t// If e is a lambda or anonymous method with inferred return type\n\t\t\tAnonymousMethodExpression ame = e as AnonymousMethodExpression;\n\t\t\tif (ame != null) {\n\t\t\t\tTypeSpec rt = ame.InferReturnType (ec, this, t);\n\t\t\t\tvar invoke = Delegate.GetInvokeMethod (t);\n\n\t\t\t\tif (rt == null) {\n\t\t\t\t\tAParametersCollection pd = invoke.Parameters;\n\t\t\t\t\treturn ame.Parameters.Count == pd.Count ? 1 : 0;\n\t\t\t\t}\n\n\t\t\t\tTypeSpec rtype = invoke.ReturnType;\n\t\t\t\treturn LowerBoundInference (rt, rtype) + 1;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// if E is a method group and T is a delegate type or expression tree type\n\t\t\t// return type Tb with parameter types T1..Tk and return type Tb, and overload\n\t\t\t// resolution of E with the types T1..Tk yields a single method with return type U,\n\t\t\t// then a lower-bound inference is made from U for Tb.\n\t\t\t//\n\t\t\tif (e is MethodGroupExpr) {\n\t\t\t\tif (!t.IsDelegate) {\n\t\t\t\t\tif (!t.IsExpressionTreeType)\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\tt = TypeManager.GetTypeArguments (t)[0];\n\t\t\t\t}\n\n\t\t\t\tvar invoke = Delegate.GetInvokeMethod (t);\n\t\t\t\tTypeSpec rtype = invoke.ReturnType;\n\n\t\t\t\tif (!IsReturnTypeNonDependent (invoke, rtype))\n\t\t\t\t\treturn 0;\n\n\t\t\t\t// LAMESPEC: Standard does not specify that all methodgroup arguments\n\t\t\t\t// has to be fixed but it does not specify how to do recursive type inference\n\t\t\t\t// either. We choose the simple option and infer return type only\n\t\t\t\t// if all delegate generic arguments are fixed.\n\t\t\t\tTypeSpec[] param_types = new TypeSpec [invoke.Parameters.Count];\n\t\t\t\tfor (int i = 0; i < param_types.Length; ++i) {\n\t\t\t\t\tvar inflated = InflateGenericArgument (ec, invoke.Parameters.Types[i]);\n\t\t\t\t\tif (inflated == null)\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\tparam_types[i] = inflated;\n\t\t\t\t}\n\n\t\t\t\tMethodGroupExpr mg = (MethodGroupExpr) e;\n\t\t\t\tArguments args = DelegateCreation.CreateDelegateMethodArguments (ec, invoke.Parameters, param_types, e.Location);\n\t\t\t\tmg = mg.OverloadResolve (ec, ref args, null, OverloadResolver.Restrictions.CovariantDelegate | OverloadResolver.Restrictions.ProbingOnly);\n\t\t\t\tif (mg == null)\n\t\t\t\t\treturn 0;\n\n\t\t\t\treturn LowerBoundInference (mg.BestCandidateReturnType, rtype) + 1;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// if e is an expression with type U, then\n\t\t\t// a lower-bound inference is made from U for T\n\t\t\t//\n\t\t\treturn LowerBoundInference (e.Type, t) * 2;\n\t\t}\n\n\t\tvoid RemoveDependentTypes (List<TypeSpec> types, TypeSpec returnType)\n\t\t{\n\t\t\tint idx = IsUnfixed (returnType);\n\t\t\tif (idx >= 0) {\n\t\t\t\ttypes [idx] = null;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (TypeManager.IsGenericType (returnType)) {\n\t\t\t\tforeach (TypeSpec t in TypeManager.GetTypeArguments (returnType)) {\n\t\t\t\t\tRemoveDependentTypes (types, t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool UnfixedVariableExists {\n\t\t\tget {\n\t\t\t\tforeach (TypeSpec ut in fixed_types) {\n\t\t\t\t\tif (ut == null)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/import.cs",
    "content": "//\n// import.cs: System.Reflection conversions\n//\n// Authors: Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2009-2011 Novell, Inc\n// Copyright 2011-2012 Xamarin, Inc (http://www.xamarin.com)\n//\n\nusing System;\nusing System.Runtime.CompilerServices;\nusing System.Linq;\nusing System.Collections.Generic;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\tpublic abstract class MetadataImporter\n\t{\n\t\t//\n\t\t// Dynamic types reader with additional logic to reconstruct a dynamic\n\t\t// type using DynamicAttribute values\n\t\t//\n\t\tprotected struct DynamicTypeReader\n\t\t{\n\t\t\tstatic readonly bool[] single_attribute = { true };\n\n\t\t\tpublic int Position;\n\t\t\tbool[] flags;\n\n\t\t\t// There is no common type for CustomAttributeData and we cannot\n\t\t\t// use ICustomAttributeProvider\n\t\t\tobject provider;\n\n\t\t\t//\n\t\t\t// A member provider which can be used to get CustomAttributeData\n\t\t\t//\n\t\t\tpublic DynamicTypeReader (object provider)\n\t\t\t{\n\t\t\t\tPosition = 0;\n\t\t\t\tflags = null;\n\t\t\t\tthis.provider = provider;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Returns true when object at local position has dynamic attribute flag\n\t\t\t//\n\t\t\tpublic bool IsDynamicObject ()\n\t\t\t{\n\t\t\t\tif (provider != null)\n\t\t\t\t\tReadAttribute ();\n\n\t\t\t\treturn flags != null && Position < flags.Length && flags[Position];\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Returns true when DynamicAttribute exists\n\t\t\t//\n\t\t\tpublic bool HasDynamicAttribute ()\n\t\t\t{\n\t\t\t\tif (provider != null)\n\t\t\t\t\tReadAttribute ();\n\n\t\t\t\treturn flags != null;\n\t\t\t}\n\n\t\t\tIList<CustomAttributeData> GetCustomAttributes ()\n\t\t\t{\n\t\t\t\tvar mi = provider as MemberInfo;\n\t\t\t\tif (mi != null)\n\t\t\t\t\treturn CustomAttributeData.GetCustomAttributes (mi);\n\n\t\t\t\tvar pi = provider as ParameterInfo;\n\t\t\t\tif (pi != null)\n\t\t\t\t\treturn CustomAttributeData.GetCustomAttributes (pi);\n\n\t\t\t\tprovider = null;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvoid ReadAttribute ()\n\t\t\t{\n\t\t\t\tvar cad = GetCustomAttributes ();\n\t\t\t\tif (cad == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (cad.Count > 0) {\n\t\t\t\t\tforeach (var ca in cad) {\n\t\t\t\t\t\tvar dt = ca.Constructor.DeclaringType;\n\t\t\t\t\t\tif (dt.Name != \"DynamicAttribute\" || dt.Namespace != CompilerServicesNamespace)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (ca.ConstructorArguments.Count == 0) {\n\t\t\t\t\t\t\tflags = single_attribute;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar arg_type = ca.ConstructorArguments[0].ArgumentType;\n\n\t\t\t\t\t\tif (arg_type.IsArray && MetaType.GetTypeCode (arg_type.GetElementType ()) == TypeCode.Boolean) {\n\t\t\t\t\t\t\tvar carg = (IList<CustomAttributeTypedArgument>) ca.ConstructorArguments[0].Value;\n\t\t\t\t\t\t\tflags = new bool[carg.Count];\n\t\t\t\t\t\t\tfor (int i = 0; i < flags.Length; ++i) {\n\t\t\t\t\t\t\t\tif (MetaType.GetTypeCode (carg[i].ArgumentType) == TypeCode.Boolean)\n\t\t\t\t\t\t\t\t\tflags[i] = (bool) carg[i].Value;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprovider = null;\n\t\t\t}\n\t\t}\n\n\t\tprotected readonly Dictionary<MetaType, TypeSpec> import_cache;\n\t\tprotected readonly Dictionary<MetaType, TypeSpec> compiled_types;\n\t\tprotected readonly Dictionary<Assembly, IAssemblyDefinition> assembly_2_definition;\n\t\tprotected readonly ModuleContainer module;\n\n\t\tpublic static readonly string CompilerServicesNamespace = \"System.Runtime.CompilerServices\";\n\n\t\tprotected MetadataImporter (ModuleContainer module)\n\t\t{\n\t\t\tthis.module = module;\n\n\t\t\timport_cache = new Dictionary<MetaType, TypeSpec> (1024, ReferenceEquality<MetaType>.Default);\n\t\t\tcompiled_types = new Dictionary<MetaType, TypeSpec> (40, ReferenceEquality<MetaType>.Default);\n\t\t\tassembly_2_definition = new Dictionary<Assembly, IAssemblyDefinition> (ReferenceEquality<Assembly>.Default);\n\t\t\tIgnorePrivateMembers = true;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic ICollection<IAssemblyDefinition> Assemblies {\n\t\t\tget {\n\t\t\t\treturn assembly_2_definition.Values;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IgnorePrivateMembers { get; set; }\n\n\t\t#endregion\n\n\t\tpublic abstract void AddCompiledType (TypeBuilder builder, TypeSpec spec);\n\t\tprotected abstract MemberKind DetermineKindFromBaseType (MetaType baseType);\n\t\tprotected abstract bool HasVolatileModifier (MetaType[] modifiers);\n\n\t\tpublic FieldSpec CreateField (FieldInfo fi, TypeSpec declaringType)\n\t\t{\n\t\t\tModifiers mod;\n\t\t\tvar fa = fi.Attributes;\n\t\t\tswitch (fa & FieldAttributes.FieldAccessMask) {\n\t\t\t\tcase FieldAttributes.Public:\n\t\t\t\t\tmod = Modifiers.PUBLIC;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FieldAttributes.Assembly:\n\t\t\t\t\tmod = Modifiers.INTERNAL;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FieldAttributes.Family:\n\t\t\t\t\tmod = Modifiers.PROTECTED;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FieldAttributes.FamORAssem:\n\t\t\t\t\tmod = Modifiers.PROTECTED | Modifiers.INTERNAL;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Ignore private fields (even for error reporting) to not require extra dependencies\n\t\t\t\t\tif ((IgnorePrivateMembers && !declaringType.IsStruct) ||\n\t\t\t\t\t\tHasAttribute (CustomAttributeData.GetCustomAttributes (fi), \"CompilerGeneratedAttribute\", CompilerServicesNamespace))\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tmod = Modifiers.PRIVATE;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tTypeSpec field_type;\n\n\t\t\ttry {\n\t\t\t\tfield_type = ImportType (fi.FieldType, new DynamicTypeReader (fi));\n\n\t\t\t\t//\n\t\t\t\t// Private field has private type which is not fixed buffer\n\t\t\t\t//\n\t\t\t\tif (field_type == null)\n\t\t\t\t\treturn null;\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: I should construct fake TypeSpec based on TypeRef signature\n\t\t\t\t// but there is no way to do it with System.Reflection\n\t\t\t\tthrow new InternalErrorException (e, \"Cannot import field `{0}.{1}' referenced in assembly `{2}'\",\n\t\t\t\t\tdeclaringType.GetSignatureForError (), fi.Name, declaringType.MemberDefinition.DeclaringAssembly);\n\t\t\t}\n\n\t\t\tvar definition = new ImportedMemberDefinition (fi, field_type, this);\n\n\t\t\tif ((fa & FieldAttributes.Literal) != 0) {\n\t\t\t\tConstant c = field_type.Kind == MemberKind.MissingType ?\n\t\t\t\t\tnew NullConstant (InternalType.ErrorType, Location.Null) :\n\t\t\t\t\tConstant.CreateConstantFromValue (field_type, fi.GetRawConstantValue (), Location.Null);\n\t\t\t\treturn new ConstSpec (declaringType, definition, field_type, fi, mod, c);\n\t\t\t}\n\n\t\t\tif ((fa & FieldAttributes.InitOnly) != 0) {\n\t\t\t\tif (field_type.BuiltinType == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\t\tvar dc = ReadDecimalConstant (CustomAttributeData.GetCustomAttributes (fi));\n\t\t\t\t\tif (dc != null)\n\t\t\t\t\t\treturn new ConstSpec (declaringType, definition, field_type, fi, mod, dc);\n\t\t\t\t}\n\n\t\t\t\tmod |= Modifiers.READONLY;\n\t\t\t} else {\n\t\t\t\tvar req_mod = fi.GetRequiredCustomModifiers ();\n\t\t\t\tif (req_mod.Length > 0 && HasVolatileModifier (req_mod))\n\t\t\t\t\tmod |= Modifiers.VOLATILE;\n\t\t\t}\n\n\t\t\tif ((fa & FieldAttributes.Static) != 0) {\n\t\t\t\tmod |= Modifiers.STATIC;\n\t\t\t} else {\n\t\t\t\t// Fixed buffers cannot be static\n\t\t\t\tif (declaringType.IsStruct && field_type.IsStruct && field_type.IsNested &&\n\t\t\t\t\tHasAttribute (CustomAttributeData.GetCustomAttributes (fi), \"FixedBufferAttribute\", CompilerServicesNamespace)) {\n\n\t\t\t\t\t// TODO: Sanity check on field_type (only few types are allowed)\n\t\t\t\t\tvar element_field = CreateField (fi.FieldType.GetField (FixedField.FixedElementName), declaringType);\n\t\t\t\t\treturn new FixedFieldSpec (module, declaringType, definition, fi, element_field, mod);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new FieldSpec (declaringType, definition, field_type, fi, mod);\n\t\t}\n\n\t\tpublic EventSpec CreateEvent (EventInfo ei, TypeSpec declaringType, MethodSpec add, MethodSpec remove)\n\t\t{\n\t\t\tadd.IsAccessor = true;\n\t\t\tremove.IsAccessor = true;\n\n\t\t\tif (add.Modifiers != remove.Modifiers)\n\t\t\t\tthrow new NotImplementedException (\"Different accessor modifiers \" + ei.Name);\n\n\t\t\tvar event_type = ImportType (ei.EventHandlerType, new DynamicTypeReader (ei));\n\t\t\tvar definition = new ImportedMemberDefinition (ei, event_type,  this);\n\t\t\treturn new EventSpec (declaringType, definition, event_type, add.Modifiers, add, remove);\n\t\t}\n\n\t\tTypeParameterSpec[] CreateGenericParameters (MetaType type, TypeSpec declaringType)\n\t\t{\n\t\t\tvar tparams = type.GetGenericArguments ();\n\n\t\t\tint parent_owned_count;\n\t\t\tif (type.IsNested) {\n\t\t\t\tparent_owned_count = type.DeclaringType.GetGenericArguments ().Length;\n\n\t\t\t\t//\n\t\t\t\t// System.Reflection duplicates parent type parameters for each\n\t\t\t\t// nested type with slightly modified properties (eg. different owner)\n\t\t\t\t// This just makes things more complicated (think of cloned constraints)\n\t\t\t\t// therefore we remap any nested type owned by parent using `type_cache'\n\t\t\t\t// to the single TypeParameterSpec\n\t\t\t\t//\n\t\t\t\tif (declaringType != null && parent_owned_count > 0) {\n\t\t\t\t\tint read_count = 0;\n\t\t\t\t\twhile (read_count != parent_owned_count) {\n\t\t\t\t\t\tvar tparams_count = declaringType.Arity;\n\t\t\t\t\t\tif (tparams_count != 0) {\n\t\t\t\t\t\t\tvar parent_tp = declaringType.MemberDefinition.TypeParameters;\n\t\t\t\t\t\t\tread_count += tparams_count;\n\t\t\t\t\t\t\tfor (int i = 0; i < tparams_count; i++) {\n\t\t\t\t\t\t\t\timport_cache.Add (tparams[parent_owned_count - read_count + i], parent_tp[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdeclaringType = declaringType.DeclaringType;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t} else {\n\t\t\t\tparent_owned_count = 0;\n\t\t\t}\n\n\t\t\tif (tparams.Length - parent_owned_count == 0)\n\t\t\t\treturn null;\n\n\t\t\treturn CreateGenericParameters (parent_owned_count, tparams);\n\t\t}\n\n\t\tTypeParameterSpec[] CreateGenericParameters (int first, MetaType[] tparams)\n\t\t{\n\t\t\tvar tspec = new TypeParameterSpec[tparams.Length - first];\n\t\t\tfor (int pos = first; pos < tparams.Length; ++pos) {\n\t\t\t\tvar type = tparams[pos];\n\t\t\t\tint index = pos - first;\n\n\t\t\t\ttspec[index] = (TypeParameterSpec) CreateType (type, new DynamicTypeReader (), false);\n\t\t\t}\n\n\t\t\treturn tspec;\n\t\t}\n\n\t\tTypeSpec[] CreateGenericArguments (int first, MetaType[] tparams, DynamicTypeReader dtype)\n\t\t{\n\t\t\t++dtype.Position;\n\n\t\t\tvar tspec = new TypeSpec [tparams.Length - first];\n\t\t\tfor (int pos = first; pos < tparams.Length; ++pos) {\n\t\t\t\tvar type = tparams[pos];\n\t\t\t\tint index = pos - first;\n\n\t\t\t\tTypeSpec spec;\n\t\t\t\tif (type.HasElementType) {\n\t\t\t\t\tvar element = type.GetElementType ();\n\t\t\t\t\t++dtype.Position;\n\t\t\t\t\tspec = ImportType (element, dtype);\n\n\t\t\t\t\tif (!type.IsArray) {\n\t\t\t\t\t\tthrow new NotImplementedException (\"Unknown element type \" + type.ToString ());\n\t\t\t\t\t}\n\n\t\t\t\t\tspec = ArrayContainer.MakeType (module, spec, type.GetArrayRank ());\n\t\t\t\t} else {\n\t\t\t\t\tspec = CreateType (type, dtype, true);\n\n\t\t\t\t\t//\n\t\t\t\t\t// We treat nested generic types as inflated internally where\n\t\t\t\t\t// reflection uses type definition\n\t\t\t\t\t//\n\t\t\t\t\t// class A<T> {\n\t\t\t\t\t//    IFoo<A<T>> foo;\t// A<T> is definition in this case\n\t\t\t\t\t// }\n\t\t\t\t\t//\n\t\t\t\t\tif (!IsMissingType (type) && type.IsGenericTypeDefinition) {\n\t\t\t\t\t\tvar start_pos = spec.DeclaringType == null ? 0 : spec.DeclaringType.MemberDefinition.TypeParametersCount;\n\t\t\t\t\t\tvar targs = CreateGenericArguments (start_pos, type.GetGenericArguments (), dtype);\n\t\t\t\t\t\tspec = spec.MakeGenericType (module, targs);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (spec == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\t++dtype.Position;\n\t\t\t\ttspec[index] = spec;\n\t\t\t}\n\n\t\t\treturn tspec;\n\t\t}\n\n\t\tpublic MethodSpec CreateMethod (MethodBase mb, TypeSpec declaringType)\n\t\t{\n\t\t\tModifiers mod = ReadMethodModifiers (mb, declaringType);\n\t\t\tTypeParameterSpec[] tparams;\n\n\t\t\tvar parameters = CreateParameters (declaringType, mb.GetParameters (), mb);\n\n\t\t\tif (mb.IsGenericMethod) {\n\t\t\t\tif (!mb.IsGenericMethodDefinition)\n\t\t\t\t\tthrow new NotSupportedException (\"assert\");\n\n\t\t\t\ttparams = CreateGenericParameters (0, mb.GetGenericArguments ());\n\t\t\t} else {\n\t\t\t\ttparams = null;\n\t\t\t}\n\n\t\t\tMemberKind kind;\n\t\t\tTypeSpec returnType;\n\t\t\tif (mb.MemberType == MemberTypes.Constructor) {\n\t\t\t\tkind = MemberKind.Constructor;\n\t\t\t\treturnType = module.Compiler.BuiltinTypes.Void;\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// Detect operators and destructors\n\t\t\t\t//\n\t\t\t\tstring name = mb.Name;\n\t\t\t\tkind = MemberKind.Method;\n\t\t\t\tif (tparams == null && !mb.DeclaringType.IsInterface && name.Length > 6) {\n\t\t\t\t\tif ((mod & (Modifiers.STATIC | Modifiers.PUBLIC)) == (Modifiers.STATIC | Modifiers.PUBLIC)) {\n\t\t\t\t\t\tif (name[2] == '_' && name[1] == 'p' && name[0] == 'o' && (mb.Attributes & MethodAttributes.SpecialName) != 0) {\n\t\t\t\t\t\t\tvar op_type = Operator.GetType (name);\n\t\t\t\t\t\t\tif (op_type.HasValue && parameters.Count > 0 && parameters.Count < 3) {\n\t\t\t\t\t\t\t\tkind = MemberKind.Operator;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (parameters.IsEmpty && name == Destructor.MetadataName) {\n\t\t\t\t\t\tkind = MemberKind.Destructor;\n\t\t\t\t\t\tif (declaringType.BuiltinType == BuiltinTypeSpec.Type.Object) {\n\t\t\t\t\t\t\tmod &= ~Modifiers.OVERRIDE;\n\t\t\t\t\t\t\tmod |= Modifiers.VIRTUAL;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar mi = (MethodInfo) mb;\n\t\t\t\treturnType = ImportType (mi.ReturnType, new DynamicTypeReader (mi.ReturnParameter));\n\n\t\t\t\t// Cannot set to OVERRIDE without full hierarchy checks\n\t\t\t\t// this flag indicates that the method could be override\n\t\t\t\t// but further validation is needed\n\t\t\t\tif ((mod & Modifiers.OVERRIDE) != 0) {\n\t\t\t\t\tbool is_real_override = false;\n\t\t\t\t\tif (kind == MemberKind.Method && declaringType.BaseType != null) {\n\t\t\t\t\t\tvar btype = declaringType.BaseType;\n\t\t\t\t\t\tif (IsOverrideMethodBaseTypeAccessible (btype)) {\n\t\t\t\t\t\t\tvar filter = MemberFilter.Method (name, tparams != null ? tparams.Length : 0, parameters, null);\n\t\t\t\t\t\t\tvar candidate = MemberCache.FindMember (btype, filter, BindingRestriction.None);\n\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// For imported class method do additional validation to be sure that metadata\n\t\t\t\t\t\t\t// override flag was correct\n\t\t\t\t\t\t\t// \n\t\t\t\t\t\t\t// Difference between protected internal and protected is ok\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tconst Modifiers conflict_mask = Modifiers.AccessibilityMask & ~Modifiers.INTERNAL;\n\t\t\t\t\t\t\tif (candidate != null && (candidate.Modifiers & conflict_mask) == (mod & conflict_mask) && !candidate.IsStatic) {\n\t\t\t\t\t\t\t\tis_real_override = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!is_real_override) {\n\t\t\t\t\t\tmod &= ~Modifiers.OVERRIDE;\n\t\t\t\t\t\tif ((mod & Modifiers.SEALED) != 0)\n\t\t\t\t\t\t\tmod &= ~Modifiers.SEALED;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmod |= Modifiers.VIRTUAL;\n\t\t\t\t\t}\n\t\t\t\t} else if (parameters.HasExtensionMethodType) {\n\t\t\t\t\tmod |= Modifiers.METHOD_EXTENSION;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIMethodDefinition definition;\n\t\t\tif (tparams != null) {\n\t\t\t\tvar gmd = new ImportedGenericMethodDefinition ((MethodInfo) mb, returnType, parameters, tparams, this);\n\t\t\t\tforeach (var tp in gmd.TypeParameters) {\n\t\t\t\t\tImportTypeParameterTypeConstraints (tp, tp.GetMetaInfo ());\n\t\t\t\t}\n\n\t\t\t\tdefinition = gmd;\n\t\t\t} else {\n\t\t\t\tdefinition = new ImportedMethodDefinition (mb, returnType, parameters, this);\n\t\t\t}\n\n\t\t\tMethodSpec ms = new MethodSpec (kind, declaringType, definition, returnType, parameters, mod);\n\t\t\tif (tparams != null)\n\t\t\t\tms.IsGeneric = true;\n\n\t\t\treturn ms;\n\t\t}\n\n\t\tbool IsOverrideMethodBaseTypeAccessible (TypeSpec baseType)\n\t\t{\n\t\t\tswitch (baseType.Modifiers & Modifiers.AccessibilityMask) {\n\t\t\tcase Modifiers.PUBLIC:\n\t\t\t\treturn true;\n\t\t\tcase Modifiers.INTERNAL:\n\t\t\t\t//\n\t\t\t\t// Check whether imported method in base type is accessible from compiled\n\t\t\t\t// context\n\t\t\t\t//\n\t\t\t\treturn baseType.MemberDefinition.IsInternalAsPublic (module.DeclaringAssembly);\n\t\t\tcase Modifiers.PRIVATE:\n\t\t\t\treturn false;\n\t\t\tdefault:\n\t\t\t\t// protected\n\t\t\t\t// protected internal\n\t\t\t\t// \n\t\t\t\t// Method accessibility checks will be done later based on context\n\t\t\t\t// where the method is called (CS0122 error will be reported for inaccessible)\n\t\t\t\t//\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Imports System.Reflection parameters\n\t\t//\n\t\tAParametersCollection CreateParameters (TypeSpec parent, ParameterInfo[] pi, MethodBase method)\n\t\t{\n\t\t\tint varargs = method != null && (method.CallingConvention & CallingConventions.VarArgs) != 0 ? 1 : 0;\n\n\t\t\tif (pi.Length == 0 && varargs == 0)\n\t\t\t\treturn ParametersCompiled.EmptyReadOnlyParameters;\n\n\t\t\tTypeSpec[] types = new TypeSpec[pi.Length + varargs];\n\t\t\tIParameterData[] par = new IParameterData[pi.Length + varargs];\n\t\t\tbool is_params = false;\n\t\t\tfor (int i = 0; i < pi.Length; i++) {\n\t\t\t\tParameterInfo p = pi[i];\n\t\t\t\tParameter.Modifier mod = 0;\n\t\t\t\tExpression default_value = null;\n\t\t\t\tif (p.ParameterType.IsByRef) {\n\t\t\t\t\tif ((p.Attributes & (ParameterAttributes.Out | ParameterAttributes.In)) == ParameterAttributes.Out)\n\t\t\t\t\t\tmod = Parameter.Modifier.OUT;\n\t\t\t\t\telse\n\t\t\t\t\t\tmod = Parameter.Modifier.REF;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Strip reference wrapping\n\t\t\t\t\t//\n\t\t\t\t\tvar el = p.ParameterType.GetElementType ();\n\t\t\t\t\ttypes[i] = ImportType (el, new DynamicTypeReader (p));\t// TODO: 1-based positio to be csc compatible\n\t\t\t\t} else if (i == 0 && method.IsStatic && (parent.Modifiers & Modifiers.METHOD_EXTENSION) != 0 &&\n\t\t\t\t\tHasAttribute (CustomAttributeData.GetCustomAttributes (method), \"ExtensionAttribute\", CompilerServicesNamespace)) {\n\t\t\t\t\tmod = Parameter.Modifier.This;\n\t\t\t\t\ttypes[i] = ImportType (p.ParameterType, new DynamicTypeReader (p));\n\t\t\t\t} else {\n\t\t\t\t\ttypes[i] = ImportType (p.ParameterType, new DynamicTypeReader (p));\n\n\t\t\t\t\tif (i >= pi.Length - 2 && types[i] is ArrayContainer) {\n\t\t\t\t\t\tif (HasAttribute (CustomAttributeData.GetCustomAttributes (p), \"ParamArrayAttribute\", \"System\")) {\n\t\t\t\t\t\t\tmod = Parameter.Modifier.PARAMS;\n\t\t\t\t\t\t\tis_params = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!is_params && p.IsOptional) {\n\t\t\t\t\t\tobject value = p.RawDefaultValue;\n\t\t\t\t\t\tvar ptype = types[i];\n\t\t\t\t\t\tif ((p.Attributes & ParameterAttributes.HasDefault) != 0 && ptype.Kind != MemberKind.TypeParameter && (value != null || TypeSpec.IsReferenceType (ptype))) {\n\t\t\t\t\t\t\tif (value == null) {\n\t\t\t\t\t\t\t\tdefault_value = Constant.CreateConstantFromValue (ptype, null, Location.Null);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdefault_value = ImportParameterConstant (value);\n\n\t\t\t\t\t\t\t\tif (ptype.IsEnum) {\n\t\t\t\t\t\t\t\t\tdefault_value = new EnumConstant ((Constant) default_value, ptype);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar attrs = CustomAttributeData.GetCustomAttributes (p);\n\t\t\t\t\t\t\tfor (int ii = 0; ii < attrs.Count; ++ii) {\n\t\t\t\t\t\t\t\tvar attr = attrs[ii];\n\t\t\t\t\t\t\t\tvar dt = attr.Constructor.DeclaringType;\n\t\t\t\t\t\t\t\tif (dt.Namespace != CompilerServicesNamespace)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (dt.Name == \"CallerLineNumberAttribute\" && (ptype.BuiltinType == BuiltinTypeSpec.Type.Int || Convert.ImplicitNumericConversionExists (module.Compiler.BuiltinTypes.Int, ptype)))\n\t\t\t\t\t\t\t\t\tmod |= Parameter.Modifier.CallerLineNumber;\n\t\t\t\t\t\t\t\telse if (dt.Name == \"CallerFilePathAttribute\" && Convert.ImplicitReferenceConversionExists (module.Compiler.BuiltinTypes.String, ptype))\n\t\t\t\t\t\t\t\t\tmod |= Parameter.Modifier.CallerFilePath;\n\t\t\t\t\t\t\t\telse if (dt.Name == \"CallerMemberNameAttribute\" && Convert.ImplicitReferenceConversionExists (module.Compiler.BuiltinTypes.String, ptype))\n\t\t\t\t\t\t\t\t\tmod |= Parameter.Modifier.CallerMemberName;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (value == Missing.Value) {\n\t\t\t\t\t\t\tdefault_value = EmptyExpression.MissingValue;\n\t\t\t\t\t\t} else if (value == null) {\n\t\t\t\t\t\t\tdefault_value = new DefaultValueExpression (new TypeExpression (ptype, Location.Null), Location.Null);\n\t\t\t\t\t\t} else if (ptype.BuiltinType == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\t\t\t\tdefault_value = ImportParameterConstant (value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpar[i] = new ParameterData (p.Name, mod, default_value);\n\t\t\t}\n\n\t\t\tif (varargs != 0) {\n\t\t\t\tpar[par.Length - 1] = new ArglistParameter (Location.Null);\n\t\t\t\ttypes[types.Length - 1] = InternalType.Arglist;\n\t\t\t}\n\n\t\t\treturn method != null ?\n\t\t\t\tnew ParametersImported (par, types, varargs != 0, is_params) :\n\t\t\t\tnew ParametersImported (par, types, is_params);\n\t\t}\n\n\t\t//\n\t\t// Returns null when the property is not valid C# property\n\t\t//\n\t\tpublic PropertySpec CreateProperty (PropertyInfo pi, TypeSpec declaringType, MethodSpec get, MethodSpec set)\n\t\t{\n\t\t\tModifiers mod = 0;\n\t\t\tAParametersCollection param = null;\n\t\t\tTypeSpec type = null;\n\t\t\tif (get != null) {\n\t\t\t\tmod = get.Modifiers;\n\t\t\t\tparam = get.Parameters;\n\t\t\t\ttype = get.ReturnType;\n\t\t\t}\n\n\t\t\tbool is_valid_property = true;\n\t\t\tif (set != null) {\n\t\t\t\tif (set.ReturnType.Kind != MemberKind.Void)\n\t\t\t\t\tis_valid_property = false;\n\n\t\t\t\tvar set_param_count = set.Parameters.Count - 1;\n\n\t\t\t\tif (set_param_count < 0) {\n\t\t\t\t\tset_param_count = 0;\n\t\t\t\t\tis_valid_property = false;\n\t\t\t\t}\n\n\t\t\t\tvar set_type = set.Parameters.Types[set_param_count];\n\n\t\t\t\tif (mod == 0) {\n\t\t\t\t\tAParametersCollection set_based_param;\n\n\t\t\t\t\tif (set_param_count == 0) {\n\t\t\t\t\t\tset_based_param = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Create indexer parameters based on setter method parameters (the last parameter has to be removed)\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar data = new IParameterData[set_param_count];\n\t\t\t\t\t\tvar types = new TypeSpec[set_param_count];\n\t\t\t\t\t\tArray.Copy (set.Parameters.FixedParameters, data, set_param_count);\n\t\t\t\t\t\tArray.Copy (set.Parameters.Types, types, set_param_count);\n\t\t\t\t\t\tset_based_param = new ParametersImported (data, types, set.Parameters.HasParams);\n\t\t\t\t\t}\n\n\t\t\t\t\tmod = set.Modifiers;\n\t\t\t\t\tparam = set_based_param;\n\t\t\t\t\ttype = set_type;\n\t\t\t\t} else {\n\t\t\t\t\tif (set_param_count != get.Parameters.Count)\n\t\t\t\t\t\tis_valid_property = false;\n\n\t\t\t\t\tif (get.ReturnType != set_type)\n\t\t\t\t\t\tis_valid_property = false;\n\n\t\t\t\t\t// Possible custom accessor modifiers\n\t\t\t\t\tif ((mod & Modifiers.AccessibilityMask) != (set.Modifiers & Modifiers.AccessibilityMask)) {\n\t\t\t\t\t\tvar get_acc = mod & Modifiers.AccessibilityMask;\n\t\t\t\t\t\tif (get_acc != Modifiers.PUBLIC) {\n\t\t\t\t\t\t\tvar set_acc = set.Modifiers & Modifiers.AccessibilityMask;\n\t\t\t\t\t\t\t// If the accessor modifiers are not same, do extra restriction checks\n\t\t\t\t\t\t\tif (get_acc != set_acc) {\n\t\t\t\t\t\t\t\tvar get_restr = ModifiersExtensions.IsRestrictedModifier (get_acc, set_acc);\n\t\t\t\t\t\t\t\tvar set_restr = ModifiersExtensions.IsRestrictedModifier (set_acc, get_acc);\n\t\t\t\t\t\t\t\tif (get_restr && set_restr) {\n\t\t\t\t\t\t\t\t\tis_valid_property = false; // Neither is more restrictive\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (get_restr) {\n\t\t\t\t\t\t\t\t\tmod &= ~Modifiers.AccessibilityMask;\n\t\t\t\t\t\t\t\t\tmod |= set_acc;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPropertySpec spec = null;\n\t\t\tif (!param.IsEmpty) {\n\t\t\t\tif (is_valid_property) {\n\t\t\t\t\tvar index_name = declaringType.MemberDefinition.GetAttributeDefaultMember ();\n\t\t\t\t\tif (index_name == null) {\n\t\t\t\t\t\tis_valid_property = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (get != null) {\n\t\t\t\t\t\t\tif (get.IsStatic)\n\t\t\t\t\t\t\t\tis_valid_property = false;\n\t\t\t\t\t\t\tif (get.Name.IndexOf (index_name, StringComparison.Ordinal) != 4)\n\t\t\t\t\t\t\t\tis_valid_property = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (set != null) {\n\t\t\t\t\t\t\tif (set.IsStatic)\n\t\t\t\t\t\t\t\tis_valid_property = false;\n\t\t\t\t\t\t\tif (set.Name.IndexOf (index_name, StringComparison.Ordinal) != 4)\n\t\t\t\t\t\t\t\tis_valid_property = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (is_valid_property) {\n\t\t\t\t\t\tspec = new IndexerSpec (declaringType, new ImportedParameterMemberDefinition (pi, type, param, this), type, param, pi, mod);\n\t\t\t\t\t} else if (declaringType.MemberDefinition.IsComImport && param.FixedParameters[0].HasDefaultValue) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Enables support for properties with parameters (must have default value) of COM-imported types\n\t\t\t\t\t\t//\n\t\t\t\t\t\tis_valid_property = true;\n\n\t\t\t\t\t\tfor (int i = 0; i < param.FixedParameters.Length; ++i) {\n\t\t\t\t\t\t\tif (!param.FixedParameters[i].HasDefaultValue) {\n\t\t\t\t\t\t\t\tis_valid_property = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (spec == null)\n\t\t\t\tspec = new PropertySpec (MemberKind.Property, declaringType, new ImportedMemberDefinition (pi, type, this), type, pi, mod);\n\n\t\t\tif (!is_valid_property) {\n\t\t\t\tspec.IsNotCSharpCompatible = true;\n\t\t\t\treturn spec;\n\t\t\t}\n\n\t\t\tif (set != null)\n\t\t\t\tspec.Set = set;\n\t\t\tif (get != null)\n\t\t\t\tspec.Get = get;\n\n\t\t\treturn spec;\n\t\t}\n\n\t\tpublic TypeSpec CreateType (MetaType type)\n\t\t{\n\t\t\treturn CreateType (type, new DynamicTypeReader (), true);\n\t\t}\n\n\t\tpublic TypeSpec CreateNestedType (MetaType type, TypeSpec declaringType)\n\t\t{\n\t\t\treturn CreateType (type, declaringType, new DynamicTypeReader (type), false);\n\t\t}\n\n\t\tTypeSpec CreateType (MetaType type, DynamicTypeReader dtype, bool canImportBaseType)\n\t\t{\n\t\t\tTypeSpec declaring_type;\n\t\t\tif (type.IsNested && !type.IsGenericParameter)\n\t\t\t\tdeclaring_type = CreateType (type.DeclaringType, new DynamicTypeReader (type.DeclaringType), true);\n\t\t\telse\n\t\t\t\tdeclaring_type = null;\n\n\t\t\treturn CreateType (type, declaring_type, dtype, canImportBaseType);\n\t\t}\n\n\t\tprotected TypeSpec CreateType (MetaType type, TypeSpec declaringType, DynamicTypeReader dtype, bool canImportBaseType)\n\t\t{\n\t\t\tTypeSpec spec;\n\t\t\tif (import_cache.TryGetValue (type, out spec)) {\n\t\t\t\tif (spec.BuiltinType == BuiltinTypeSpec.Type.Object) {\n\t\t\t\t\tif (dtype.IsDynamicObject ())\n\t\t\t\t\t\treturn module.Compiler.BuiltinTypes.Dynamic;\n\n\t\t\t\t\treturn spec;\n\t\t\t\t}\n\n\t\t\t\tif (!spec.IsGeneric || type.IsGenericTypeDefinition)\n\t\t\t\t\treturn spec;\n\n\t\t\t\tif (!dtype.HasDynamicAttribute ())\n\t\t\t\t\treturn spec;\n\n\t\t\t\t// We've found same object in the cache but this one has a dynamic custom attribute\n\t\t\t\t// and it's most likely dynamic version of same type IFoo<object> agains IFoo<dynamic>\n\t\t\t\t// Do type resolve process again in that case\n\n\t\t\t\t// TODO: Handle cases where they still unify\n\t\t\t}\n\n\t\t\tif (IsMissingType (type)) {\n\t\t\t\tspec = new TypeSpec (MemberKind.MissingType, declaringType, new ImportedTypeDefinition (type, this), type, Modifiers.PUBLIC);\n\t\t\t\tspec.MemberCache = MemberCache.Empty;\n\t\t\t\timport_cache.Add (type, spec);\n\t\t\t\treturn spec;\n\t\t\t}\n\n\t\t\tif (type.IsGenericType && !type.IsGenericTypeDefinition) {\n\t\t\t\tvar type_def = type.GetGenericTypeDefinition ();\n\n\t\t\t\t// Generic type definition can also be forwarded\n\t\t\t\tif (compiled_types.TryGetValue (type_def, out spec))\n\t\t\t\t\treturn spec;\n\n\t\t\t\tvar targs = CreateGenericArguments (0, type.GetGenericArguments (), dtype);\n\t\t\t\tif (targs == null)\n\t\t\t\t\treturn null;\n\t\t\t\tif (declaringType == null) {\n\t\t\t\t\t// Simple case, no nesting\n\t\t\t\t\tspec = CreateType (type_def, null, new DynamicTypeReader (), canImportBaseType);\n\t\t\t\t\tspec = spec.MakeGenericType (module, targs);\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// Nested type case, converting .NET types like\n\t\t\t\t\t// A`1.B`1.C`1<int, long, string> to typespec like\n\t\t\t\t\t// A<int>.B<long>.C<string>\n\t\t\t\t\t//\n\t\t\t\t\tvar nested_hierarchy = new List<TypeSpec> ();\n\t\t\t\t\twhile (declaringType.IsNested) {\n\t\t\t\t\t\tnested_hierarchy.Add (declaringType);\n\t\t\t\t\t\tdeclaringType = declaringType.DeclaringType;\n\t\t\t\t\t}\n\n\t\t\t\t\tint targs_pos = 0;\n\t\t\t\t\tif (declaringType.Arity > 0) {\n\t\t\t\t\t\tspec = declaringType.MakeGenericType (module, targs.Skip (targs_pos).Take (declaringType.Arity).ToArray ());\n\t\t\t\t\t\ttargs_pos = spec.Arity;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tspec = declaringType;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = nested_hierarchy.Count; i != 0; --i) {\n\t\t\t\t\t\tvar t = nested_hierarchy [i - 1];\n\t\t\t\t\t\tif (t.Kind == MemberKind.MissingType)\n\t\t\t\t\t\t\tspec = t;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tspec = MemberCache.FindNestedType (spec, t.Name, t.Arity);\n\n\t\t\t\t\t\tif (t.Arity > 0) {\n\t\t\t\t\t\t\tspec = spec.MakeGenericType (module, targs.Skip (targs_pos).Take (spec.Arity).ToArray ());\n\t\t\t\t\t\t\ttargs_pos += t.Arity;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (spec.Kind == MemberKind.MissingType) {\n\t\t\t\t\t\tspec = new TypeSpec (MemberKind.MissingType, spec, new ImportedTypeDefinition (type_def, this), type_def, Modifiers.PUBLIC);\n\t\t\t\t\t\tspec.MemberCache = MemberCache.Empty;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((type_def.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate && IgnorePrivateMembers)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tstring name = type.Name;\n\t\t\t\t\t\tint index = name.IndexOf ('`');\n\t\t\t\t\t\tif (index > 0)\n\t\t\t\t\t\t\tname = name.Substring (0, index);\n\n\t\t\t\t\t\tspec = MemberCache.FindNestedType (spec, name, targs.Length - targs_pos);\n\n\t\t\t\t\t\tif (spec.Arity > 0) {\n\t\t\t\t\t\t\tspec = spec.MakeGenericType (module, targs.Skip (targs_pos).ToArray ());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't add generic type with dynamic arguments, they can interfere with same type\n\t\t\t\t// using object type arguments\n\t\t\t\tif (!spec.HasDynamicElement) {\n\n\t\t\t\t\t// Add to reading cache to speed up reading\n\t\t\t\t\tif (!import_cache.ContainsKey (type))\n\t\t\t\t\t\timport_cache.Add (type, spec);\n\t\t\t\t}\n\n\t\t\t\treturn spec;\n\t\t\t}\n\n\t\t\tModifiers mod;\n\t\t\tMemberKind kind;\n\n\t\t\tvar ma = type.Attributes;\n\t\t\tswitch (ma & TypeAttributes.VisibilityMask) {\n\t\t\tcase TypeAttributes.Public:\n\t\t\tcase TypeAttributes.NestedPublic:\n\t\t\t\tmod = Modifiers.PUBLIC;\n\t\t\t\tbreak;\n\t\t\tcase TypeAttributes.NestedPrivate:\n\t\t\t\tmod = Modifiers.PRIVATE;\n\t\t\t\tbreak;\n\t\t\tcase TypeAttributes.NestedFamily:\n\t\t\t\tmod = Modifiers.PROTECTED;\n\t\t\t\tbreak;\n\t\t\tcase TypeAttributes.NestedFamORAssem:\n\t\t\t\tmod = Modifiers.PROTECTED | Modifiers.INTERNAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmod = Modifiers.INTERNAL;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ((ma & TypeAttributes.Interface) != 0) {\n\t\t\t\tkind = MemberKind.Interface;\n\t\t\t} else if (type.IsGenericParameter) {\n\t\t\t\tkind = MemberKind.TypeParameter;\n\t\t\t} else {\n\t\t\t\tvar base_type = type.BaseType;\n\t\t\t\tif (base_type == null || (ma & TypeAttributes.Abstract) != 0) {\n\t\t\t\t\tkind = MemberKind.Class;\n\t\t\t\t} else {\n\t\t\t\t\tkind = DetermineKindFromBaseType (base_type);\n\t\t\t\t\tif (kind == MemberKind.Struct || kind == MemberKind.Delegate) {\n\t\t\t\t\t\tmod |= Modifiers.SEALED;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (kind == MemberKind.Class) {\n\t\t\t\t\tif ((ma & TypeAttributes.Sealed) != 0) {\n\t\t\t\t\t\tif ((ma & TypeAttributes.Abstract) != 0)\n\t\t\t\t\t\t\tmod |= Modifiers.STATIC;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmod |= Modifiers.SEALED;\n\t\t\t\t\t} else if ((ma & TypeAttributes.Abstract) != 0) {\n\t\t\t\t\t\tmod |= Modifiers.ABSTRACT;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar definition = new ImportedTypeDefinition (type, this);\n\t\t\tTypeSpec pt;\n\n\t\t\tif (kind == MemberKind.Enum) {\n\t\t\t\tconst BindingFlags underlying_member = BindingFlags.DeclaredOnly |\n\t\t\t\t\tBindingFlags.Instance |\n\t\t\t\t\tBindingFlags.Public | BindingFlags.NonPublic;\n\n\t\t\t\tvar type_members = type.GetFields (underlying_member);\n\t\t\t\tforeach (var type_member in type_members) {\n\t\t\t\t\tspec = new EnumSpec (declaringType, definition, CreateType (type_member.FieldType), type, mod);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (spec == null)\n\t\t\t\t\tkind = MemberKind.Class;\n\n\t\t\t} else if (kind == MemberKind.TypeParameter) {\n\t\t\t\tspec = CreateTypeParameter (type, declaringType);\n\t\t\t} else if (type.IsGenericTypeDefinition) {\n\t\t\t\tdefinition.TypeParameters = CreateGenericParameters (type, declaringType);\n\t\t\t} else if (compiled_types.TryGetValue (type, out pt)) {\n\t\t\t\t//\n\t\t\t\t// Same type was found in inside compiled types. It's\n\t\t\t\t// either build-in type or forward referenced typed\n\t\t\t\t// which point into just compiled assembly.\n\t\t\t\t//\n\t\t\t\tspec = pt;\n\t\t\t\tBuiltinTypeSpec bts = pt as BuiltinTypeSpec;\n\t\t\t\tif (bts != null)\n\t\t\t\t\tbts.SetDefinition (definition, type, mod);\n\t\t\t}\n\n\t\t\tif (spec == null)\n\t\t\t\tspec = new TypeSpec (kind, declaringType, definition, type, mod);\n\n\t\t\timport_cache.Add (type, spec);\n\n\t\t\tif (kind == MemberKind.TypeParameter) {\n\t\t\t\tif (canImportBaseType)\n\t\t\t\t\tImportTypeParameterTypeConstraints ((TypeParameterSpec) spec, type);\n\n\t\t\t\treturn spec;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Two stage setup as the base type can be inflated declaring type or\n\t\t\t// another nested type inside same declaring type which has not been\n\t\t\t// loaded, therefore we can import a base type of nested types once\n\t\t\t// the types have been imported\n\t\t\t//\n\t\t\tif (canImportBaseType)\n\t\t\t\tImportTypeBase (spec, type);\n\n\t\t\treturn spec;\n\t\t}\n\n\t\tpublic IAssemblyDefinition GetAssemblyDefinition (Assembly assembly)\n\t\t{\n\t\t\tIAssemblyDefinition found;\n\t\t\tif (!assembly_2_definition.TryGetValue (assembly, out found)) {\n\n\t\t\t\t// This can happen in dynamic context only\n\t\t\t\tvar def = new ImportedAssemblyDefinition (assembly);\n\t\t\t\tassembly_2_definition.Add (assembly, def);\n\t\t\t\tdef.ReadAttributes ();\n\t\t\t\tfound = def;\n\t\t\t}\n\n\t\t\treturn found;\n\t\t}\n\n\t\tpublic void ImportTypeBase (MetaType type)\n\t\t{\n\t\t\tTypeSpec spec = import_cache[type];\n\t\t\tif (spec != null)\n\t\t\t\tImportTypeBase (spec, type);\n\t\t}\n\n\t\tTypeParameterSpec CreateTypeParameter (MetaType type, TypeSpec declaringType)\n\t\t{\n\t\t\tVariance variance;\n\t\t\tswitch (type.GenericParameterAttributes & GenericParameterAttributes.VarianceMask) {\n\t\t\tcase GenericParameterAttributes.Covariant:\n\t\t\t\tvariance = Variance.Covariant;\n\t\t\t\tbreak;\n\t\t\tcase GenericParameterAttributes.Contravariant:\n\t\t\t\tvariance = Variance.Contravariant;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tvariance = Variance.None;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tSpecialConstraint special = SpecialConstraint.None;\n\t\t\tvar import_special = type.GenericParameterAttributes & GenericParameterAttributes.SpecialConstraintMask;\n\n\t\t\tif ((import_special & GenericParameterAttributes.NotNullableValueTypeConstraint) != 0) {\n\t\t\t\tspecial |= SpecialConstraint.Struct;\n\t\t\t} else if ((import_special & GenericParameterAttributes.DefaultConstructorConstraint) != 0) {\n\t\t\t\tspecial = SpecialConstraint.Constructor;\n\t\t\t}\n\n\t\t\tif ((import_special & GenericParameterAttributes.ReferenceTypeConstraint) != 0) {\n\t\t\t\tspecial |= SpecialConstraint.Class;\n\t\t\t}\n\n\t\t\tTypeParameterSpec spec;\n\t\t\tvar def = new ImportedTypeParameterDefinition (type, this);\n\t\t\tif (type.DeclaringMethod != null) {\n\t\t\t\tspec = new TypeParameterSpec (type.GenericParameterPosition, def, special, variance, type);\n\t\t\t} else {\n\t\t\t\tspec = new TypeParameterSpec (declaringType, type.GenericParameterPosition, def, special, variance, type);\n\t\t\t}\n\n\t\t\treturn spec;\n\t\t}\n\n\t\t//\n\t\t// Test for a custom attribute type match. Custom attributes are not really predefined globaly \n\t\t// they can be assembly specific therefore we do check based on names only\n\t\t//\n\t\tpublic static bool HasAttribute (IList<CustomAttributeData> attributesData, string attrName, string attrNamespace)\n\t\t{\n\t\t\tif (attributesData.Count == 0)\n\t\t\t\treturn false;\n\n\t\t\tforeach (var attr in attributesData) {\n\t\t\t\tvar dt = attr.Constructor.DeclaringType;\n\t\t\t\tif (dt.Name == attrName && dt.Namespace == attrNamespace)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tvoid ImportTypeBase (TypeSpec spec, MetaType type)\n\t\t{\n\t\t\tif (spec.Kind == MemberKind.Interface)\n\t\t\t\tspec.BaseType = module.Compiler.BuiltinTypes.Object;\n\t\t\telse if (type.BaseType != null) {\n\t\t\t\tTypeSpec base_type;\n\t\t\t\tif (!IsMissingType (type.BaseType) && type.BaseType.IsGenericType)\n\t\t\t\t\tbase_type = CreateType (type.BaseType, new DynamicTypeReader (type), true);\n\t\t\t\telse\n\t\t\t\t\tbase_type = CreateType (type.BaseType);\n\n\t\t\t\tspec.BaseType = base_type;\n\t\t\t}\n\n\t\t\tif (spec.MemberDefinition.TypeParametersCount > 0) {\n\t\t\t\tforeach (var tp in spec.MemberDefinition.TypeParameters) {\n\t\t\t\t\tImportTypeParameterTypeConstraints (tp, tp.GetMetaInfo ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected void ImportTypes (MetaType[] types, Namespace targetNamespace, bool importExtensionTypes)\n\t\t{\n\t\t\tNamespace ns = targetNamespace;\n\t\t\tstring prev_namespace = null;\n\t\t\tforeach (var t in types) {\n\t\t\t\tif (t == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Be careful not to trigger full parent type loading\n\t\t\t\tif (t.MemberType == MemberTypes.NestedType)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (t.Name[0] == '<')\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar it = CreateType (t, null, new DynamicTypeReader (t), true);\n\t\t\t\tif (it == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (prev_namespace != t.Namespace) {\n\t\t\t\t\tns = t.Namespace == null ? targetNamespace : targetNamespace.GetNamespace (t.Namespace, true);\n\t\t\t\t\tprev_namespace = t.Namespace;\n\t\t\t\t}\n\n\t\t\t\t// Cannot rely on assembly level Extension attribute or static modifier because they\n\t\t\t\t// are not followed by other compilers (e.g. F#).\n\t\t\t\tif (it.IsClass && it.Arity == 0 && importExtensionTypes &&\n\t\t\t\t\tHasAttribute (CustomAttributeData.GetCustomAttributes (t), \"ExtensionAttribute\", CompilerServicesNamespace)) {\n\t\t\t\t\tit.SetExtensionMethodContainer ();\n\t\t\t\t}\n\n\t\t\t\tns.AddType (module, it);\n\t\t\t}\n\t\t}\n\n\t\tvoid ImportTypeParameterTypeConstraints (TypeParameterSpec spec, MetaType type)\n\t\t{\n\t\t\tvar constraints = type.GetGenericParameterConstraints ();\n\t\t\tList<TypeSpec> tparams = null;\n\t\t\tforeach (var ct in constraints) {\n\t\t\t\tif (ct.IsGenericParameter) {\n\t\t\t\t\tif (tparams == null)\n\t\t\t\t\t\ttparams = new List<TypeSpec> ();\n\n\t\t\t\t\ttparams.Add (CreateType (ct));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar constraint_type = CreateType (ct);\n\t\t\t\tif (constraint_type.IsClass) {\n\t\t\t\t\tspec.BaseType = constraint_type;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tspec.AddInterface (constraint_type);\n\t\t\t}\n\n\t\t\tif (spec.BaseType == null)\n\t\t\t\tspec.BaseType = module.Compiler.BuiltinTypes.Object;\n\n\t\t\tif (tparams != null)\n\t\t\t\tspec.TypeArguments = tparams.ToArray ();\n\t\t}\n\n\t\tConstant ImportParameterConstant (object value)\n\t\t{\n\t\t\t//\n\t\t\t// Get type of underlying value as int constant can be used for object\n\t\t\t// parameter type. This is not allowed in C# but other languages can do that\n\t\t\t//\n\t\t\tvar types = module.Compiler.BuiltinTypes;\n\t\t\tswitch (System.Type.GetTypeCode (value.GetType ())) {\n\t\t\tcase TypeCode.Boolean:\n\t\t\t\treturn new BoolConstant (types, (bool) value, Location.Null);\n\t\t\tcase TypeCode.Byte:\n\t\t\t\treturn new ByteConstant (types, (byte) value, Location.Null);\n\t\t\tcase TypeCode.Char:\n\t\t\t\treturn new CharConstant (types, (char) value, Location.Null);\n\t\t\tcase TypeCode.Decimal:\n\t\t\t\treturn new DecimalConstant (types, (decimal) value, Location.Null);\n\t\t\tcase TypeCode.Double:\n\t\t\t\treturn new DoubleConstant (types, (double) value, Location.Null);\n\t\t\tcase TypeCode.Int16:\n\t\t\t\treturn new ShortConstant (types, (short) value, Location.Null);\n\t\t\tcase TypeCode.Int32:\n\t\t\t\treturn new IntConstant (types, (int) value, Location.Null);\n\t\t\tcase TypeCode.Int64:\n\t\t\t\treturn new LongConstant (types, (long) value, Location.Null);\n\t\t\tcase TypeCode.SByte:\n\t\t\t\treturn new SByteConstant (types, (sbyte) value, Location.Null);\n\t\t\tcase TypeCode.Single:\n\t\t\t\treturn new FloatConstant (types, (float) value, Location.Null);\n\t\t\tcase TypeCode.String:\n\t\t\t\treturn new StringConstant (types, (string) value, Location.Null);\n\t\t\tcase TypeCode.UInt16:\n\t\t\t\treturn new UShortConstant (types, (ushort) value, Location.Null);\n\t\t\tcase TypeCode.UInt32:\n\t\t\t\treturn new UIntConstant (types, (uint) value, Location.Null);\n\t\t\tcase TypeCode.UInt64:\n\t\t\t\treturn new ULongConstant (types, (ulong) value, Location.Null);\n\t\t\t}\n\n\t\t\tthrow new NotImplementedException (value.GetType ().ToString ());\n\t\t}\n\n\t\tpublic TypeSpec ImportType (MetaType type)\n\t\t{\n\t\t\treturn ImportType (type, new DynamicTypeReader (type));\n\t\t}\n\n\t\tTypeSpec ImportType (MetaType type, DynamicTypeReader dtype)\n\t\t{\n\t\t\tif (type.HasElementType) {\n\t\t\t\tvar element = type.GetElementType ();\n\t\t\t\t++dtype.Position;\n\t\t\t\tvar spec = ImportType (element, dtype);\n\n\t\t\t\tif (type.IsArray)\n\t\t\t\t\treturn ArrayContainer.MakeType (module, spec, type.GetArrayRank ());\n\t\t\t\tif (type.IsByRef)\n\t\t\t\t\treturn ReferenceContainer.MakeType (module, spec);\n\t\t\t\tif (type.IsPointer)\n\t\t\t\t\treturn PointerContainer.MakeType (module, spec);\n\n\t\t\t\tthrow new NotImplementedException (\"Unknown element type \" + type.ToString ());\n\t\t\t}\n\n\t\t\tTypeSpec compiled_type;\n\t\t\tif (compiled_types.TryGetValue (type, out compiled_type)) {\n\t\t\t\tif (compiled_type.BuiltinType == BuiltinTypeSpec.Type.Object && dtype.IsDynamicObject ())\n\t\t\t\t\treturn module.Compiler.BuiltinTypes.Dynamic;\n\n\t\t\t\treturn compiled_type;\n\t\t\t}\n\n\t\t\treturn CreateType (type, dtype, true);\n\t\t}\n\n\t\tstatic bool IsMissingType (MetaType type)\n\t\t{\n#if STATIC\n\t\t\treturn type.__IsMissing;\n#else\n\t\t\treturn false;\n#endif\n\t\t}\n\n\t\t//\n\t\t// Decimal constants cannot be encoded in the constant blob, and thus are marked\n\t\t// as IsInitOnly ('readonly' in C# parlance).  We get its value from the \n\t\t// DecimalConstantAttribute metadata.\n\t\t//\n\t\tConstant ReadDecimalConstant (IList<CustomAttributeData> attrs)\n\t\t{\n\t\t\tif (attrs.Count == 0)\n\t\t\t\treturn null;\n\n\t\t\tforeach (var ca in attrs) {\n\t\t\t\tvar dt = ca.Constructor.DeclaringType;\n\t\t\t\tif (dt.Name != \"DecimalConstantAttribute\" || dt.Namespace != CompilerServicesNamespace)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar value = new decimal (\n\t\t\t\t\t(int) (uint) ca.ConstructorArguments[4].Value,\n\t\t\t\t\t(int) (uint) ca.ConstructorArguments[3].Value,\n\t\t\t\t\t(int) (uint) ca.ConstructorArguments[2].Value,\n\t\t\t\t\t(byte) ca.ConstructorArguments[1].Value != 0,\n\t\t\t\t\t(byte) ca.ConstructorArguments[0].Value);\n\n\t\t\t\treturn new DecimalConstant (module.Compiler.BuiltinTypes, value, Location.Null);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic Modifiers ReadMethodModifiers (MethodBase mb, TypeSpec declaringType)\n\t\t{\n\t\t\tModifiers mod;\n\t\t\tvar ma = mb.Attributes;\n\t\t\tswitch (ma & MethodAttributes.MemberAccessMask) {\n\t\t\tcase MethodAttributes.Public:\n\t\t\t\tmod = Modifiers.PUBLIC;\n\t\t\t\tbreak;\n\t\t\tcase MethodAttributes.Assembly:\n\t\t\t\tmod = Modifiers.INTERNAL;\n\t\t\t\tbreak;\n\t\t\tcase MethodAttributes.Family:\n\t\t\t\tmod = Modifiers.PROTECTED;\n\t\t\t\tbreak;\n\t\t\tcase MethodAttributes.FamORAssem:\n\t\t\t\tmod = Modifiers.PROTECTED | Modifiers.INTERNAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmod = Modifiers.PRIVATE;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ((ma & MethodAttributes.Static) != 0) {\n\t\t\t\tmod |= Modifiers.STATIC;\n\t\t\t\treturn mod;\n\t\t\t}\n\t\t\tif ((ma & MethodAttributes.Abstract) != 0 && declaringType.IsClass) {\n\t\t\t\tmod |= Modifiers.ABSTRACT;\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\t// It can be sealed and override\n\t\t\tif ((ma & MethodAttributes.Final) != 0)\n\t\t\t\tmod |= Modifiers.SEALED;\n\n\t\t\tif ((ma & MethodAttributes.Virtual) != 0) {\n\t\t\t\t// Not every member can be detected based on MethodAttribute, we\n\t\t\t\t// set virtual or non-virtual only when we are certain. Further checks\n\t\t\t\t// to really find out what `virtual' means for this member are done\n\t\t\t\t// later\n\t\t\t\tif ((ma & MethodAttributes.NewSlot) != 0) {\n\t\t\t\t\tif ((mod & Modifiers.SEALED) != 0) {\n\t\t\t\t\t\tmod &= ~Modifiers.SEALED;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmod |= Modifiers.VIRTUAL;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmod |= Modifiers.OVERRIDE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mod;\n\t\t}\n\t}\n\n\tabstract class ImportedDefinition : IMemberDefinition\n\t{\n\t\tprotected class AttributesBag\n\t\t{\n\t\t\tpublic static readonly AttributesBag Default = new AttributesBag ();\n\n\t\t\tpublic AttributeUsageAttribute AttributeUsage;\n\t\t\tpublic ObsoleteAttribute Obsolete;\n\t\t\tpublic string[] Conditionals;\n\t\t\tpublic string DefaultIndexerName;\n\t\t\tpublic bool? CLSAttributeValue;\n\t\t\tpublic TypeSpec CoClass;\n\n\t\t\tstatic bool HasMissingType (ConstructorInfo ctor)\n\t\t\t{\n#if STATIC\n\t\t\t\t//\n\t\t\t\t// Mimic odd csc behaviour where missing type on predefined\n\t\t\t\t// attributes means the attribute is silently ignored. This can\n\t\t\t\t// happen with PCL facades\n\t\t\t\t//\n\t\t\t\tforeach (var p in ctor.GetParameters ()) {\n\t\t\t\t\tif (p.ParameterType.__ContainsMissingType)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n#endif\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tpublic static AttributesBag Read (MemberInfo mi, MetadataImporter importer)\n\t\t\t{\n\t\t\t\tAttributesBag bag = null;\n\t\t\t\tList<string> conditionals = null;\n\n\t\t\t\t// It should not throw any loading exception\n\t\t\t\tIList<CustomAttributeData> attrs = CustomAttributeData.GetCustomAttributes (mi);\n\n\t\t\t\tforeach (var a in attrs) {\n\t\t\t\t\tvar dt = a.Constructor.DeclaringType;\n\t\t\t\t\tstring name = dt.Name;\n\t\t\t\t\tif (name == \"ObsoleteAttribute\") {\n\t\t\t\t\t\tif (dt.Namespace != \"System\")\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (bag == null)\n\t\t\t\t\t\t\tbag = new AttributesBag ();\n\n\t\t\t\t\t\tvar args = a.ConstructorArguments;\n\n\t\t\t\t\t\tif (args.Count == 1) {\n\t\t\t\t\t\t\tbag.Obsolete = new ObsoleteAttribute ((string) args[0].Value);\n\t\t\t\t\t\t} else if (args.Count == 2) {\n\t\t\t\t\t\t\tbag.Obsolete = new ObsoleteAttribute ((string) args[0].Value, (bool) args[1].Value);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbag.Obsolete = new ObsoleteAttribute ();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (name == \"ConditionalAttribute\") {\n\t\t\t\t\t\tif (dt.Namespace != \"System.Diagnostics\")\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (bag == null)\n\t\t\t\t\t\t\tbag = new AttributesBag ();\n\n\t\t\t\t\t\tif (conditionals == null)\n\t\t\t\t\t\t\tconditionals = new List<string> (2);\n\n\t\t\t\t\t\tconditionals.Add ((string) a.ConstructorArguments[0].Value);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (name == \"CLSCompliantAttribute\") {\n\t\t\t\t\t\tif (dt.Namespace != \"System\")\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (bag == null)\n\t\t\t\t\t\t\tbag = new AttributesBag ();\n\n\t\t\t\t\t\tbag.CLSAttributeValue = (bool) a.ConstructorArguments[0].Value;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Type only attributes\n\t\t\t\t\tif (mi.MemberType == MemberTypes.TypeInfo || mi.MemberType == MemberTypes.NestedType) {\n\t\t\t\t\t\tif (name == \"DefaultMemberAttribute\") {\n\t\t\t\t\t\t\tif (dt.Namespace != \"System.Reflection\")\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (bag == null)\n\t\t\t\t\t\t\t\tbag = new AttributesBag ();\n\n\t\t\t\t\t\t\tbag.DefaultIndexerName = (string) a.ConstructorArguments[0].Value;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (name == \"AttributeUsageAttribute\") {\n\t\t\t\t\t\t\tif (dt.Namespace != \"System\")\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (HasMissingType (a.Constructor))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (bag == null)\n\t\t\t\t\t\t\t\tbag = new AttributesBag ();\n\n\t\t\t\t\t\t\tbag.AttributeUsage = new AttributeUsageAttribute ((AttributeTargets) a.ConstructorArguments[0].Value);\n\t\t\t\t\t\t\tforeach (var named in a.NamedArguments) {\n\t\t\t\t\t\t\t\tif (named.MemberInfo.Name == \"AllowMultiple\")\n\t\t\t\t\t\t\t\t\tbag.AttributeUsage.AllowMultiple = (bool) named.TypedValue.Value;\n\t\t\t\t\t\t\t\telse if (named.MemberInfo.Name == \"Inherited\")\n\t\t\t\t\t\t\t\t\tbag.AttributeUsage.Inherited = (bool) named.TypedValue.Value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Interface only attribute\n\t\t\t\t\t\tif (name == \"CoClassAttribute\") {\n\t\t\t\t\t\t\tif (dt.Namespace != \"System.Runtime.InteropServices\")\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (HasMissingType (a.Constructor))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (bag == null)\n\t\t\t\t\t\t\t\tbag = new AttributesBag ();\n\n\t\t\t\t\t\t\tbag.CoClass = importer.ImportType ((MetaType) a.ConstructorArguments[0].Value);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (bag == null)\n\t\t\t\t\treturn Default;\n\n\t\t\t\tif (conditionals != null)\n\t\t\t\t\tbag.Conditionals = conditionals.ToArray ();\n\t\t\t\t\n\t\t\t\treturn bag;\n\t\t\t}\n\t\t}\n\n\t\tprotected readonly MemberInfo provider;\n\t\tprotected AttributesBag cattrs;\n\t\tprotected readonly MetadataImporter importer;\n\n\t\tprotected ImportedDefinition (MemberInfo provider, MetadataImporter importer)\n\t\t{\n\t\t\tthis.provider = provider;\n\t\t\tthis.importer = importer;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsImported {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string Name {\n\t\t\tget {\n\t\t\t\treturn provider.Name;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic string[] ConditionalConditions ()\n\t\t{\n\t\t\tif (cattrs == null)\n\t\t\t\tReadAttributes ();\n\n\t\t\treturn cattrs.Conditionals;\n\t\t}\n\n\t\tpublic ObsoleteAttribute GetAttributeObsolete ()\n\t\t{\n\t\t\tif (cattrs == null)\n\t\t\t\tReadAttributes ();\n\n\t\t\treturn cattrs.Obsolete;\n\t\t}\n\n\t\tpublic bool? CLSAttributeValue {\n\t\t\tget {\n\t\t\t\tif (cattrs == null)\n\t\t\t\t\tReadAttributes ();\n\n\t\t\t\treturn cattrs.CLSAttributeValue;\n\t\t\t}\n\t\t}\n\n\t\tprotected void ReadAttributes ()\n\t\t{\n\t\t\tcattrs = AttributesBag.Read (provider, importer);\n\t\t}\n\n\t\tpublic void SetIsAssigned ()\n\t\t{\n\t\t\t// Unused for imported members\n\t\t}\n\n\t\tpublic void SetIsUsed ()\n\t\t{\n\t\t\t// Unused for imported members\n\t\t}\n\t}\n\n\tpublic class ImportedModuleDefinition\n\t{\n\t\treadonly Module module;\n\t\tbool cls_compliant;\n\t\t\n\t\tpublic ImportedModuleDefinition (Module module)\n\t\t{\n\t\t\tthis.module = module;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsCLSCompliant {\n\t\t\tget {\n\t\t\t\treturn cls_compliant;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn module.Name;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void ReadAttributes ()\n\t\t{\n\t\t\tIList<CustomAttributeData> attrs = CustomAttributeData.GetCustomAttributes (module);\n\n\t\t\tforeach (var a in attrs) {\n\t\t\t\tvar dt = a.Constructor.DeclaringType;\n\t\t\t\tif (dt.Name == \"CLSCompliantAttribute\") {\n\t\t\t\t\tif (dt.Namespace != \"System\")\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcls_compliant = (bool) a.ConstructorArguments[0].Value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Reads assembly attributes which where attached to a special type because\n\t\t// module does have assembly manifest\n\t\t//\n\t\tpublic List<Attribute> ReadAssemblyAttributes ()\n\t\t{\n\t\t\tvar t = module.GetType (AssemblyAttributesPlaceholder.GetGeneratedName (Name));\n\t\t\tif (t == null)\n\t\t\t\treturn null;\n\n\t\t\tvar field = t.GetField (AssemblyAttributesPlaceholder.AssemblyFieldName, BindingFlags.NonPublic | BindingFlags.Static);\n\t\t\tif (field == null)\n\t\t\t\treturn null;\n\n\t\t\t// TODO: implement, the idea is to fabricate specil Attribute class and\n\t\t\t// add it to OptAttributes before resolving the source code attributes\n\t\t\t// Need to build module location as well for correct error reporting\n\n\t\t\t//var assembly_attributes = CustomAttributeData.GetCustomAttributes (field);\n\t\t\t//var attrs = new List<Attribute> (assembly_attributes.Count);\n\t\t\t//foreach (var a in assembly_attributes)\n\t\t\t//{\n\t\t\t//    var type = metaImporter.ImportType (a.Constructor.DeclaringType);\n\t\t\t//    var ctor = metaImporter.CreateMethod (a.Constructor, type);\n\n\t\t\t//    foreach (var carg in a.ConstructorArguments) {\n\t\t\t//        carg.Value\n\t\t\t//    }\n\n\t\t\t//    attrs.Add (new Attribute (\"assembly\", ctor, null, Location.Null, true));\n\t\t\t//}\n\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class ImportedAssemblyDefinition : IAssemblyDefinition\n\t{\n\t\treadonly Assembly assembly;\n\t\treadonly AssemblyName aname;\n\t\tbool cls_compliant;\n\n\t\tList<AssemblyName> internals_visible_to;\n\t\tDictionary<IAssemblyDefinition, AssemblyName> internals_visible_to_cache;\n\n\t\tpublic ImportedAssemblyDefinition (Assembly assembly)\n\t\t{\n\t\t\tthis.assembly = assembly;\n\t\t\tthis.aname = assembly.GetName ();\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Assembly Assembly {\n\t\t\tget {\n\t\t\t\treturn assembly;\n\t\t\t}\n\t\t}\n\n\t\tpublic string FullName {\n\t\t\tget {\n\t\t\t\treturn aname.FullName;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasStrongName {\n\t\t\tget {\n\t\t\t\treturn aname.GetPublicKey ().Length != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsMissing {\n\t\t\tget {\n#if STATIC\n\t\t\t\treturn assembly.__IsMissing;\n#else\n\t\t\t\treturn false;\n#endif\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCLSCompliant {\n\t\t\tget {\n\t\t\t\treturn cls_compliant;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Location {\n\t\t\tget {\n\t\t\t\treturn assembly.Location;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn aname.Name;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic byte[] GetPublicKeyToken ()\n\t\t{\n\t\t\treturn aname.GetPublicKeyToken ();\n\t\t}\n\n\t\tpublic AssemblyName GetAssemblyVisibleToName (IAssemblyDefinition assembly)\n\t\t{\n\t\t\treturn internals_visible_to_cache [assembly];\n\t\t}\n\n\t\tpublic bool IsFriendAssemblyTo (IAssemblyDefinition assembly)\n\t\t{\n\t\t\tif (internals_visible_to == null)\n\t\t\t\treturn false;\n\n\t\t\tAssemblyName is_visible = null;\n\t\t\tif (internals_visible_to_cache == null) {\n\t\t\t\tinternals_visible_to_cache = new Dictionary<IAssemblyDefinition, AssemblyName> ();\n\t\t\t} else {\n\t\t\t\tif (internals_visible_to_cache.TryGetValue (assembly, out is_visible))\n\t\t\t\t\treturn is_visible != null;\n\t\t\t}\n\n\t\t\tvar token = assembly.GetPublicKeyToken ();\n\t\t\tif (token != null && token.Length == 0)\n\t\t\t\ttoken = null;\n\n\t\t\tforeach (var internals in internals_visible_to) {\n\t\t\t\tif (internals.Name != assembly.Name)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (token == null && assembly is AssemblyDefinition) {\n\t\t\t\t\tis_visible = internals;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!ArrayComparer.IsEqual (token, internals.GetPublicKeyToken ()))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tis_visible = internals;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tinternals_visible_to_cache.Add (assembly, is_visible);\n\t\t\treturn is_visible != null;\n\t\t}\n\n\t\tpublic void ReadAttributes ()\n\t\t{\n#if STATIC\n\t\t\tif (assembly.__IsMissing)\n\t\t\t\treturn;\n#endif\n\n\t\t\tIList<CustomAttributeData> attrs = CustomAttributeData.GetCustomAttributes (assembly);\n\n\t\t\tforeach (var a in attrs) {\n\t\t\t\tvar dt = a.Constructor.DeclaringType;\n\t\t\t\tvar name = dt.Name;\n\t\t\t\tif (name == \"CLSCompliantAttribute\") {\n\t\t\t\t\tif (dt.Namespace == \"System\") {\n\t\t\t\t\t\tcls_compliant = (bool) a.ConstructorArguments[0].Value;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (name == \"InternalsVisibleToAttribute\") {\n\t\t\t\t\tif (dt.Namespace != MetadataImporter.CompilerServicesNamespace)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tstring s = a.ConstructorArguments[0].Value as string;\n\t\t\t\t\tif (s == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar an = new AssemblyName (s);\n\t\t\t\t\tif (internals_visible_to == null)\n\t\t\t\t\t\tinternals_visible_to = new List<AssemblyName> ();\n\n\t\t\t\t\tinternals_visible_to.Add (an);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn FullName;\n\t\t}\n\t}\n\n\tclass ImportedMemberDefinition : ImportedDefinition\n\t{\n\t\treadonly TypeSpec type;\n\n\t\tpublic ImportedMemberDefinition (MemberInfo member, TypeSpec type, MetadataImporter importer)\n\t\t\t: base (member, importer)\n\t\t{\n\t\t\tthis.type = type;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic TypeSpec MemberType {\n\t\t\tget {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tclass ImportedParameterMemberDefinition : ImportedMemberDefinition, IParametersMember\n\t{\n\t\treadonly AParametersCollection parameters;\n\n\t\tprotected ImportedParameterMemberDefinition (MethodBase provider, TypeSpec type, AParametersCollection parameters, MetadataImporter importer)\n\t\t\t: base (provider, type, importer)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t}\n\n\t\tpublic ImportedParameterMemberDefinition (PropertyInfo provider, TypeSpec type, AParametersCollection parameters, MetadataImporter importer)\n\t\t\t: base (provider, type, importer)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic AParametersCollection Parameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tclass ImportedMethodDefinition : ImportedParameterMemberDefinition, IMethodDefinition\n\t{\n\t\tpublic ImportedMethodDefinition (MethodBase provider, TypeSpec type, AParametersCollection parameters, MetadataImporter importer)\n\t\t\t: base (provider, type, parameters, importer)\n\t\t{\n\t\t}\n\n\t\tMethodBase IMethodDefinition.Metadata {\n\t\t\tget {\n\t\t\t\treturn (MethodBase) provider;\n\t\t\t}\n\t\t}\n\t}\n\n\tclass ImportedGenericMethodDefinition : ImportedMethodDefinition, IGenericMethodDefinition\n\t{\n\t\treadonly TypeParameterSpec[] tparams;\n\n\t\tpublic ImportedGenericMethodDefinition (MethodInfo provider, TypeSpec type, AParametersCollection parameters, TypeParameterSpec[] tparams, MetadataImporter importer)\n\t\t\t: base (provider, type, parameters, importer)\n\t\t{\n\t\t\tthis.tparams = tparams;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic TypeParameterSpec[] TypeParameters {\n\t\t\tget {\n\t\t\t\treturn tparams;\n\t\t\t}\n\t\t}\n\n\t\tpublic int TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn tparams.Length;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tclass ImportedTypeDefinition : ImportedDefinition, ITypeDefinition\n\t{\n\t\tTypeParameterSpec[] tparams;\n\t\tstring name;\n\n\t\tpublic ImportedTypeDefinition (MetaType type, MetadataImporter importer)\n\t\t\t: base (type, importer)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic IAssemblyDefinition DeclaringAssembly {\n\t\t\tget {\n\t\t\t\treturn importer.GetAssemblyDefinition (provider.Module.Assembly);\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsComImport {\n\t\t\tget {\n\t\t\t\treturn ((MetaType) provider).IsImport;\n\t\t\t}\n\t\t}\n\n\n\t\tbool ITypeDefinition.IsPartial {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsTypeForwarder {\n\t\t\tget {\n#if STATIC\n\t\t\t\treturn ((MetaType) provider).__IsTypeForwarder;\n#else\n\t\t\t\treturn false;\n#endif\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsCyclicTypeForwarder {\n\t\t\tget {\n#if STATIC\n\t\t\t\treturn ((MetaType) provider).__IsCyclicTypeForwarder;\n#else\n\t\t\t\treturn false;\n#endif\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\tif (name == null) {\n\t\t\t\t\tname = base.Name;\n\t\t\t\t\tif (tparams != null) {\n\t\t\t\t\t\tint arity_start = name.IndexOf ('`');\n\t\t\t\t\t\tif (arity_start > 0)\n\t\t\t\t\t\t\tname = name.Substring (0, arity_start);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\treturn ((MetaType) provider).Namespace;\n\t\t\t}\n\t\t}\n\n\t\tpublic int TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn tparams == null ? 0 : tparams.Length;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec[] TypeParameters {\n\t\t\tget {\n\t\t\t\treturn tparams;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttparams = value;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void DefineInterfaces (TypeSpec spec)\n\t\t{\n\t\t\tvar type = (MetaType) provider;\n\t\t\tMetaType[] ifaces;\n#if STATIC\n\t\t\tifaces = type.__GetDeclaredInterfaces ();\n\t\t\tif (ifaces.Length != 0) {\n\t\t\t\tforeach (var iface in ifaces) {\n\t\t\t\t\tvar it = importer.CreateType (iface);\n\t\t\t\t\tif (it == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tspec.AddInterfaceDefined (it);\n\n\t\t\t\t\t// Unfortunately not all languages expand inherited interfaces\n\t\t\t\t\tvar bifaces = it.Interfaces;\n\t\t\t\t\tif (bifaces != null) {\n\t\t\t\t\t\tforeach (var biface in bifaces) {\n\t\t\t\t\t\t\tspec.AddInterfaceDefined (biface);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//\n\t\t\t// It's impossible to get declared interfaces only using System.Reflection\n\t\t\t// hence we need to mimic the behavior with ikvm-reflection too to keep\n\t\t\t// our type look-up logic same\n\t\t\t//\n\t\t\tif (spec.BaseType != null) {\n\t\t\t\tvar bifaces = spec.BaseType.Interfaces;\n\t\t\t\tif (bifaces != null) {\n\t\t\t\t\t//\n\t\t\t\t\t// Before adding base class interfaces close defined interfaces\n\t\t\t\t\t// on type parameter\n\t\t\t\t\t//\n\t\t\t\t\tvar tp = spec as TypeParameterSpec;\n\t\t\t\t\tif (tp != null && tp.InterfacesDefined == null) {\n\t\t\t\t\t\ttp.InterfacesDefined = TypeSpec.EmptyTypes;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (var iface in bifaces)\n\t\t\t\t\t\tspec.AddInterfaceDefined (iface);\n\t\t\t\t}\n\t\t\t}\n#else\n\t\t\tifaces = type.GetInterfaces ();\n\n\t\t\tif (ifaces.Length > 0) {\n\t\t\t\tforeach (var iface in ifaces) {\n\t\t\t\t\tspec.AddInterface (importer.CreateType (iface));\n\t\t\t\t}\n\t\t\t}\n#endif\n\n\t\t}\n\n\t\tpublic static void Error_MissingDependency (IMemberContext ctx, List<MissingTypeSpecReference> missing, Location loc)\n\t\t{\n\t\t\t// \n\t\t\t// Report details about missing type and most likely cause of the problem.\n\t\t\t// csc reports 1683, 1684 as warnings but we report them only when used\n\t\t\t// or referenced from the user core in which case compilation error has to\n\t\t\t// be reported because compiler cannot continue anyway\n\t\t\t//\n\n\t\t\tvar report = ctx.Module.Compiler.Report;\n\n\t\t\tfor (int i = 0; i < missing.Count; ++i) {\n\t\t\t\tvar t = missing [i].Type;\n\n\t\t\t\t//\n\t\t\t\t// Report missing types only once\n\t\t\t\t//\n\t\t\t\tif (report.Printer.MissingTypeReported (t.MemberDefinition))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tstring name = t.GetSignatureForError ();\n\n\t\t\t\tvar caller = missing[i].Caller;\n\t\t\t\tif (caller.Kind != MemberKind.MissingType)\n\t\t\t\t\treport.SymbolRelatedToPreviousError (caller);\n\n\t\t\t\tvar definition = t.MemberDefinition;\n\t\t\t\tif (definition.DeclaringAssembly == ctx.Module.DeclaringAssembly) {\n\t\t\t\t\treport.Error (1683, loc,\n\t\t\t\t\t\t\"Reference to type `{0}' claims it is defined in this assembly, but it is not defined in source or any added modules\",\n\t\t\t\t\t\tname);\n\t\t\t\t} else if (definition.DeclaringAssembly.IsMissing) {\n\t\t\t\t\tif (definition.IsTypeForwarder) {\n\t\t\t\t\t\treport.Error (1070, loc,\n\t\t\t\t\t\t\t\"The type `{0}' has been forwarded to an assembly that is not referenced. Consider adding a reference to assembly `{1}'\",\n\t\t\t\t\t\t\tname, definition.DeclaringAssembly.FullName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treport.Error (12, loc,\n\t\t\t\t\t\t\t\"The type `{0}' is defined in an assembly that is not referenced. Consider adding a reference to assembly `{1}'\",\n\t\t\t\t\t\t\tname, definition.DeclaringAssembly.FullName);\n\t\t\t\t\t}\n\t\t\t\t} else if (definition.IsTypeForwarder) {\n\t\t\t\t\treport.Error (731, loc, \"The type forwarder for type `{0}' in assembly `{1}' has circular dependency\",\n\t\t\t\t\t\tname, definition.DeclaringAssembly.FullName);\n\t\t\t\t} else {\n\t\t\t\t\treport.Error (1684, loc,\n\t\t\t\t\t\t\"Reference to type `{0}' claims it is defined assembly `{1}', but it could not be found\",\n\t\t\t\t\t\tname, t.MemberDefinition.DeclaringAssembly.FullName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec GetAttributeCoClass ()\n\t\t{\n\t\t\tif (cattrs == null)\n\t\t\t\tReadAttributes ();\n\n\t\t\treturn cattrs.CoClass;\n\t\t}\n\n\t\tpublic string GetAttributeDefaultMember ()\n\t\t{\n\t\t\tif (cattrs == null)\n\t\t\t\tReadAttributes ();\n\n\t\t\treturn cattrs.DefaultIndexerName;\n\t\t}\n\n\t\tpublic AttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa)\n\t\t{\n\t\t\tif (cattrs == null)\n\t\t\t\tReadAttributes ();\n\n\t\t\treturn cattrs.AttributeUsage;\n\t\t}\n\n\t\tbool ITypeDefinition.IsInternalAsPublic (IAssemblyDefinition assembly)\n\t\t{\n\t\t\tvar a = importer.GetAssemblyDefinition (provider.Module.Assembly);\n\t\t\treturn a == assembly || a.IsFriendAssemblyTo (assembly);\n\t\t}\n\n\t\tpublic void LoadMembers (TypeSpec declaringType, bool onlyTypes, ref MemberCache cache)\n\t\t{\n\t\t\t//\n\t\t\t// Not interested in members of nested private types unless the importer needs them\n\t\t\t//\n\t\t\tif (declaringType.IsPrivate && importer.IgnorePrivateMembers) {\n\t\t\t\tcache = MemberCache.Empty;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar loading_type = (MetaType) provider;\n\t\t\tconst BindingFlags all_members = BindingFlags.DeclaredOnly |\n\t\t\t\tBindingFlags.Static | BindingFlags.Instance |\n\t\t\t\tBindingFlags.Public | BindingFlags.NonPublic;\n\n\t\t\tconst MethodAttributes explicit_impl = MethodAttributes.NewSlot |\n\t\t\t\t\tMethodAttributes.Virtual | MethodAttributes.HideBySig |\n\t\t\t\t\tMethodAttributes.Final;\n\n\t\t\tDictionary<MethodBase, MethodSpec> possible_accessors = null;\n\t\t\tList<EventSpec> imported_events = null;\n\t\t\tEventSpec event_spec;\n\t\t\tMemberSpec imported;\n\t\t\tMethodInfo m;\n\t\t\tMemberInfo[] all;\n\t\t\ttry {\n\t\t\t\tall = loading_type.GetMembers (all_members);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (e, \"Could not import type `{0}' from `{1}'\",\n\t\t\t\t\tdeclaringType.GetSignatureForError (), declaringType.MemberDefinition.DeclaringAssembly.FullName);\n\t\t\t}\n\n\t\t\tif (cache == null) {\n\t\t\t\tcache = new MemberCache (all.Length);\n\n\t\t\t\t//\n\t\t\t\t// Do the types first as they can be referenced by the members before\n\t\t\t\t// they are found or inflated\n\t\t\t\t//\n\t\t\t\tforeach (var member in all) {\n\t\t\t\t\tif (member.MemberType != MemberTypes.NestedType)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar t = (MetaType) member;\n\n\t\t\t\t\t// Ignore compiler generated types, mostly lambda containers\n\t\t\t\t\tif ((t.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate && importer.IgnorePrivateMembers)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\timported = importer.CreateNestedType (t, declaringType);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new InternalErrorException (e, \"Could not import nested type `{0}' from `{1}'\",\n\t\t\t\t\t\t\tt.FullName, declaringType.MemberDefinition.DeclaringAssembly.FullName);\n\t\t\t\t\t}\n\n\t\t\t\t\tcache.AddMemberImported (imported);\n\t\t\t\t}\n\n\t\t\t\tforeach (var member in all) {\n\t\t\t\t\tif (member.MemberType != MemberTypes.NestedType)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar t = (MetaType) member;\n\n\t\t\t\t\tif ((t.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate && importer.IgnorePrivateMembers)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\timporter.ImportTypeBase (t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Load base interfaces first to minic behaviour of compiled members\n\t\t\t//\n\t\t\tif (declaringType.IsInterface && declaringType.Interfaces != null) {\n\t\t\t\tforeach (var iface in declaringType.Interfaces) {\n\t\t\t\t\tcache.AddInterface (iface);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!onlyTypes) {\n\t\t\t\t//\n\t\t\t\t// The logic here requires methods to be returned first which seems to work for both Mono and .NET\n\t\t\t\t//\n\t\t\t\tforeach (var member in all) {\n\t\t\t\t\tswitch (member.MemberType) {\n\t\t\t\t\tcase MemberTypes.Constructor:\n\t\t\t\t\t\tif (declaringType.IsInterface)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tgoto case MemberTypes.Method;\n\t\t\t\t\tcase MemberTypes.Method:\n\t\t\t\t\t\tMethodBase mb = (MethodBase) member;\n\t\t\t\t\t\tvar attrs = mb.Attributes;\n\n\t\t\t\t\t\tif ((attrs & MethodAttributes.MemberAccessMask) == MethodAttributes.Private) {\n\t\t\t\t\t\t\tif (importer.IgnorePrivateMembers)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t// Ignore explicitly implemented members\n\t\t\t\t\t\t\tif ((attrs & explicit_impl) == explicit_impl)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t// Ignore compiler generated methods\n\t\t\t\t\t\t\tif (MetadataImporter.HasAttribute (CustomAttributeData.GetCustomAttributes (mb), \"CompilerGeneratedAttribute\", MetadataImporter.CompilerServicesNamespace))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timported = importer.CreateMethod (mb, declaringType);\n\t\t\t\t\t\tif (imported.Kind == MemberKind.Method && !imported.IsGeneric) {\n\t\t\t\t\t\t\tif (possible_accessors == null)\n\t\t\t\t\t\t\t\tpossible_accessors = new Dictionary<MethodBase, MethodSpec> (ReferenceEquality<MethodBase>.Default);\n\n\t\t\t\t\t\t\t// There are no metadata rules for accessors, we have to consider any method as possible candidate\n\t\t\t\t\t\t\tpossible_accessors.Add (mb, (MethodSpec) imported);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MemberTypes.Property:\n\t\t\t\t\t\tif (possible_accessors == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar p = (PropertyInfo) member;\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Links possible accessors with property\n\t\t\t\t\t\t//\n\t\t\t\t\t\tMethodSpec get, set;\n\t\t\t\t\t\tm = p.GetGetMethod (true);\n\t\t\t\t\t\tif (m == null || !possible_accessors.TryGetValue (m, out get))\n\t\t\t\t\t\t\tget = null;\n\n\t\t\t\t\t\tm = p.GetSetMethod (true);\n\t\t\t\t\t\tif (m == null || !possible_accessors.TryGetValue (m, out set))\n\t\t\t\t\t\t\tset = null;\n\n\t\t\t\t\t\t// No accessors registered (e.g. explicit implementation)\n\t\t\t\t\t\tif (get == null && set == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\timported = importer.CreateProperty (p, declaringType, get, set);\n\t\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\t\tthrow new InternalErrorException (ex, \"Could not import property `{0}' inside `{1}'\",\n\t\t\t\t\t\t\t\tp.Name, declaringType.GetSignatureForError ());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (imported == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MemberTypes.Event:\n\t\t\t\t\t\tif (possible_accessors == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar e = (EventInfo) member;\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Links accessors with event\n\t\t\t\t\t\t//\n\t\t\t\t\t\tMethodSpec add, remove;\n\t\t\t\t\t\tm = e.GetAddMethod (true);\n\t\t\t\t\t\tif (m == null || !possible_accessors.TryGetValue (m, out add))\n\t\t\t\t\t\t\tadd = null;\n\n\t\t\t\t\t\tm = e.GetRemoveMethod (true);\n\t\t\t\t\t\tif (m == null || !possible_accessors.TryGetValue (m, out remove))\n\t\t\t\t\t\t\tremove = null;\n\n\t\t\t\t\t\t// Both accessors are required\n\t\t\t\t\t\tif (add == null || remove == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tevent_spec = importer.CreateEvent (e, declaringType, add, remove);\n\t\t\t\t\t\tif (!importer.IgnorePrivateMembers) {\n\t\t\t\t\t\t\tif (imported_events == null)\n\t\t\t\t\t\t\t\timported_events = new List<EventSpec> ();\n\n\t\t\t\t\t\t\timported_events.Add (event_spec);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timported = event_spec;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MemberTypes.Field:\n\t\t\t\t\t\tvar fi = (FieldInfo) member;\n\n\t\t\t\t\t\timported = importer.CreateField (fi, declaringType);\n\t\t\t\t\t\tif (imported == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// For dynamic binder event has to be fully restored to allow operations\n\t\t\t\t\t\t// within the type container to work correctly\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (imported_events != null) {\n\t\t\t\t\t\t\t// The backing event field should be private but it may not\n\t\t\t\t\t\t\tint i;\n\t\t\t\t\t\t\tfor (i = 0; i < imported_events.Count; ++i) {\n\t\t\t\t\t\t\t\tvar ev = imported_events[i];\n\t\t\t\t\t\t\t\tif (ev.Name == fi.Name) {\n\t\t\t\t\t\t\t\t\tev.BackingField = (FieldSpec) imported;\n\t\t\t\t\t\t\t\t\timported_events.RemoveAt (i);\n\t\t\t\t\t\t\t\t\ti = -1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i < 0)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MemberTypes.NestedType:\n\t\t\t\t\t\t// Already in the cache from the first pass\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new NotImplementedException (member.ToString ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (imported.IsStatic && declaringType.IsInterface)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tcache.AddMemberImported (imported);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tclass ImportedTypeParameterDefinition : ImportedDefinition, ITypeDefinition\n\t{\n\t\tpublic ImportedTypeParameterDefinition (MetaType type, MetadataImporter importer)\n\t\t\t: base (type, importer)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic IAssemblyDefinition DeclaringAssembly {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsComImport {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsPartial {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsCyclicTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic int TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec[] TypeParameters {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic TypeSpec GetAttributeCoClass ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic string GetAttributeDefaultMember ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic AttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tbool ITypeDefinition.IsInternalAsPublic (IAssemblyDefinition assembly)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic void LoadMembers (TypeSpec declaringType, bool onlyTypes, ref MemberCache cache)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs",
    "content": "//\n// iterators.cs: Support for implementing iterators\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n// Copyright 2003 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011 Xamarin Inc.\n//\n\nusing System;\nusing System.Collections.Generic;\nusing Mono.CompilerServices.SymbolWriter;\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\tpublic abstract class YieldStatement<T> : ResumableStatement where T : StateMachineInitializer\n\t{\n\t\tprotected Expression expr;\n\t\tprotected bool unwind_protect;\n\t\tprotected T machine_initializer;\n\t\tint resume_pc;\n\t\tExceptionStatement inside_try_block;\n\n\t\tprotected YieldStatement (Expression expr, Location l)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget { return this.expr; }\n\t\t}\n\t\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tvar target = (YieldStatement<T>) t;\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tmachine_initializer.InjectYield (ec, expr, resume_pc, unwind_protect, resume_point);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\n\t\t\tRegisterResumePoint ();\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\texpr = expr.Resolve (bc);\n\t\t\tif (expr == null)\n\t\t\t\treturn false;\n\n\t\t\tmachine_initializer = bc.CurrentAnonymousMethod as T;\n\t\t\tinside_try_block = bc.CurrentTryBlock;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void RegisterResumePoint ()\n\t\t{\n\t\t\tif (resume_pc != 0)\n\t\t\t\treturn;\n\n\t\t\tif (inside_try_block == null) {\n\t\t\t\tresume_pc = machine_initializer.AddResumePoint (this);\n\t\t\t} else {\n\t\t\t\tresume_pc = inside_try_block.AddResumePoint (this, resume_pc, machine_initializer);\n\t\t\t\tunwind_protect = true;\n\t\t\t\tinside_try_block = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class Yield : YieldStatement<Iterator>\n\t{\n\t\tpublic Yield (Expression expr, Location loc)\n\t\t\t: base (expr, loc)\n\t\t{\n\t\t}\n\n\t\tpublic static bool CheckContext (BlockContext bc, Location loc)\n\t\t{\n\t\t\tif (!bc.CurrentAnonymousMethod.IsIterator) {\n\t\t\t\tbc.Report.Error (1621, loc,\n\t\t\t\t\t\"The yield statement cannot be used inside anonymous method blocks\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (bc.HasSet (ResolveContext.Options.FinallyScope)) {\n\t\t\t\tbc.Report.Error (1625, loc, \"Cannot yield in the body of a finally clause\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tif (!CheckContext (bc, loc))\n\t\t\t\treturn false;\n\n\t\t\tif (bc.HasAny (ResolveContext.Options.TryWithCatchScope)) {\n\t\t\t\tbc.Report.Error (1626, loc, \"Cannot yield a value in the body of a try block with a catch clause\");\n\t\t\t}\n\n\t\t\tif (bc.HasSet (ResolveContext.Options.CatchScope)) {\n\t\t\t\tbc.Report.Error (1631, loc, \"Cannot yield a value in the body of a catch clause\");\n\t\t\t}\n\n\t\t\tif (!base.Resolve (bc))\n\t\t\t\treturn false;\n\n\t\t\tvar otype = bc.CurrentIterator.OriginalIteratorType;\n\t\t\tif (expr.Type != otype) {\n\t\t\t\texpr = Convert.ImplicitConversionRequired (bc, expr, otype, loc);\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class YieldBreak : ExitStatement\n\t{\n\t\tIterator iterator;\n\n\t\tpublic YieldBreak (Location l)\n\t\t{\n\t\t\tloc = l;\n\t\t}\n\n\t\tprotected override bool IsLocalExit {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tprotected override bool DoResolve (BlockContext bc)\n\t\t{\n\t\t\titerator = bc.CurrentIterator;\n\t\t\treturn Yield.CheckContext (bc, loc);\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\titerator.EmitYieldBreak (ec, unwind_protect);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic abstract class StateMachine : AnonymousMethodStorey\n\t{\n\t\tpublic enum State\n\t\t{\n\t\t\tRunning = -3, // Used only in CurrentPC, never stored into $PC\n\t\t\tUninitialized = -2,\n\t\t\tAfter = -1,\n\t\t\tStart = 0\n\t\t}\n\n\t\tField pc_field;\n\t\tStateMachineMethod method;\n\t\tint local_name_idx;\n\n\t\tprotected StateMachine (ParametersBlock block, TypeDefinition parent, MemberBase host, TypeParameters tparams, string name, MemberKind kind)\n\t\t\t: base (block, parent, host, tparams, name, kind)\n\t\t{\n\t\t\tOriginalTypeParameters = tparams;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic TypeParameters OriginalTypeParameters { get; private set; }\n\n\t\tpublic StateMachineMethod StateMachineMethod {\n\t\t\tget {\n\t\t\t\treturn method;\n\t\t\t}\n\t\t}\n\n\t\tpublic Field PC {\n\t\t\tget {\n\t\t\t\treturn pc_field;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void AddEntryMethod (StateMachineMethod method)\n\t\t{\n\t\t\tif (this.method != null)\n\t\t\t\tthrow new InternalErrorException ();\n\n\t\t\tthis.method = method;\n\t\t\tMembers.Add (method);\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tpc_field = AddCompilerGeneratedField (\"$PC\", new TypeExpression (Compiler.BuiltinTypes.Int, Location));\n\n\t\t\treturn base.DoDefineMembers ();\n\t\t}\n\n\t\tprotected override string GetVariableMangledName (LocalVariable local_info)\n\t\t{\n\t\t\tif (local_info.IsCompilerGenerated)\n\t\t\t\treturn base.GetVariableMangledName (local_info);\n\n\t\t\treturn \"<\" + local_info.Name + \">__\" + local_name_idx++.ToString (\"X\");\n\t\t}\n\t}\n\n\tclass IteratorStorey : StateMachine\n\t{\n\t\tclass GetEnumeratorMethod : StateMachineMethod\n\t\t{\n\t\t\tsealed class GetEnumeratorStatement : Statement\n\t\t\t{\n\t\t\t\treadonly IteratorStorey host;\n\t\t\t\treadonly StateMachineMethod host_method;\n\n\t\t\t\tExpression new_storey;\n\n\t\t\t\tpublic GetEnumeratorStatement (IteratorStorey host, StateMachineMethod host_method)\n\t\t\t\t{\n\t\t\t\t\tthis.host = host;\n\t\t\t\t\tthis.host_method = host_method;\n\t\t\t\t\tloc = host_method.Location;\n\t\t\t\t}\n\n\t\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t\t{\n\t\t\t\t\tthrow new NotSupportedException ();\n\t\t\t\t}\n\n\t\t\t\tpublic override bool Resolve (BlockContext ec)\n\t\t\t\t{\n\t\t\t\t\tTypeExpression storey_type_expr = new TypeExpression (host.Definition, loc);\n\t\t\t\t\tList<Expression> init = null;\n\t\t\t\t\tif (host.hoisted_this != null) {\n\t\t\t\t\t\tinit = new List<Expression> (host.hoisted_params == null ? 1 : host.HoistedParameters.Count + 1);\n\t\t\t\t\t\tHoistedThis ht = host.hoisted_this;\n\t\t\t\t\t\tFieldExpr from = new FieldExpr (ht.Field, loc);\n\t\t\t\t\t\tfrom.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);\n\t\t\t\t\t\tinit.Add (new ElementInitializer (ht.Field.Name, from, loc));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (host.hoisted_params != null) {\n\t\t\t\t\t\tif (init == null)\n\t\t\t\t\t\t\tinit = new List<Expression> (host.HoistedParameters.Count);\n\n\t\t\t\t\t\tfor (int i = 0; i < host.hoisted_params.Count; ++i) {\n\t\t\t\t\t\t\tHoistedParameter hp = host.hoisted_params [i];\n\t\t\t\t\t\t\tHoistedParameter hp_cp = host.hoisted_params_copy [i] ?? hp;\n\n\t\t\t\t\t\t\tFieldExpr from = new FieldExpr (hp_cp.Field, loc);\n\t\t\t\t\t\t\tfrom.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);\n\n\t\t\t\t\t\t\tinit.Add (new ElementInitializer (hp.Field.Name, from, loc));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (init != null) {\n\t\t\t\t\t\tnew_storey = new NewInitialize (storey_type_expr, null,\n\t\t\t\t\t\t\tnew CollectionOrObjectInitializers (init, loc), loc);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnew_storey = new New (storey_type_expr, null, loc);\n\t\t\t\t\t}\n\n\t\t\t\t\tnew_storey = new_storey.Resolve (ec);\n\t\t\t\t\tif (new_storey != null)\n\t\t\t\t\t\tnew_storey = Convert.ImplicitConversionRequired (ec, new_storey, host_method.MemberType, loc);\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t\t{\n\t\t\t\t\tLabel label_init = ec.DefineLabel ();\n\n\t\t\t\t\tec.EmitThis ();\n\t\t\t\t\tec.Emit (OpCodes.Ldflda, host.PC.Spec);\n\t\t\t\t\tec.EmitInt ((int) State.Start);\n\t\t\t\t\tec.EmitInt ((int) State.Uninitialized);\n\n\t\t\t\t\tvar m = ec.Module.PredefinedMembers.InterlockedCompareExchange.Resolve (loc);\n\t\t\t\t\tif (m != null)\n\t\t\t\t\t\tec.Emit (OpCodes.Call, m);\n\n\t\t\t\t\tec.EmitInt ((int) State.Uninitialized);\n\t\t\t\t\tec.Emit (OpCodes.Bne_Un_S, label_init);\n\n\t\t\t\t\tec.EmitThis ();\n\t\t\t\t\tec.Emit (OpCodes.Ret);\n\n\t\t\t\t\tec.MarkLabel (label_init);\n\n\t\t\t\t\tnew_storey.Emit (ec);\n\t\t\t\t\tec.Emit (OpCodes.Ret);\n\t\t\t\t}\n\n\t\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t\t{\n\t\t\t\t\tthrow new NotImplementedException ();\n\t\t\t\t}\n\n\t\t\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t\t\t{\n\t\t\t\t\tbase.MarkReachable (rc);\n\t\t\t\t\treturn Reachability.CreateUnreachable ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tGetEnumeratorMethod (IteratorStorey host, FullNamedExpression returnType, MemberName name)\n\t\t\t\t: base (host, null, returnType, Modifiers.DEBUGGER_HIDDEN, name, ToplevelBlock.Flags.CompilerGenerated | ToplevelBlock.Flags.NoFlowAnalysis)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic static GetEnumeratorMethod Create (IteratorStorey host, FullNamedExpression returnType, MemberName name)\n\t\t\t{\n\t\t\t\treturn Create (host, returnType, name, null);\n\t\t\t}\n\n\t\t\tpublic static GetEnumeratorMethod Create (IteratorStorey host, FullNamedExpression returnType, MemberName name, Statement statement)\n\t\t\t{\n\t\t\t\tvar m = new GetEnumeratorMethod (host, returnType, name);\n\t\t\t\tvar stmt = statement ?? new GetEnumeratorStatement (host, m);\n\t\t\t\tm.block.AddStatement (stmt);\n\t\t\t\treturn m;\n\t\t\t}\n\t\t}\n\n\t\tclass DisposeMethod : StateMachineMethod\n\t\t{\n\t\t\tsealed class DisposeMethodStatement : Statement\n\t\t\t{\n\t\t\t\tIterator iterator;\n\n\t\t\t\tpublic DisposeMethodStatement (Iterator iterator)\n\t\t\t\t{\n\t\t\t\t\tthis.iterator = iterator;\n\t\t\t\t\tthis.loc = iterator.Location;\n\t\t\t\t}\n\n\t\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t\t{\n\t\t\t\t\tthrow new NotSupportedException ();\n\t\t\t\t}\n\n\t\t\t\tpublic override bool Resolve (BlockContext ec)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t\t{\n\t\t\t\t\tec.CurrentAnonymousMethod = iterator;\n\t\t\t\t\titerator.EmitDispose (ec);\n\t\t\t\t}\n\n\t\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t\t{\n\t\t\t\t\tthrow new NotImplementedException ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic DisposeMethod (IteratorStorey host)\n\t\t\t\t: base (host, null, new TypeExpression (host.Compiler.BuiltinTypes.Void, host.Location), Modifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN,\n\t\t\t\t\tnew MemberName (\"Dispose\", host.Location), ToplevelBlock.Flags.CompilerGenerated | ToplevelBlock.Flags.NoFlowAnalysis)\n\t\t\t{\n\t\t\t\thost.Members.Add (this);\n\n\t\t\t\tBlock.AddStatement (new DisposeMethodStatement (host.Iterator));\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Uses Method as method info\n\t\t//\n\t\tclass DynamicMethodGroupExpr : MethodGroupExpr\n\t\t{\n\t\t\treadonly Method method;\n\n\t\t\tpublic DynamicMethodGroupExpr (Method method, Location loc)\n\t\t\t\t: base ((IList<MemberSpec>) null, null, loc)\n\t\t\t{\n\t\t\t\tthis.method = method;\n\t\t\t\teclass = ExprClass.Unresolved;\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\tMethods = new List<MemberSpec> (1) { method.Spec };\n\t\t\t\ttype = method.Parent.Definition;\n\t\t\t\tInstanceExpression = new CompilerGeneratedThis (type, Location);\n\t\t\t\treturn base.DoResolve (ec);\n\t\t\t}\n\t\t}\n\n\t\tclass DynamicFieldExpr : FieldExpr\n\t\t{\n\t\t\treadonly Field field;\n\n\t\t\tpublic DynamicFieldExpr (Field field, Location loc)\n\t\t\t\t: base (loc)\n\t\t\t{\n\t\t\t\tthis.field = field;\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\tspec = field.Spec;\n\t\t\t\ttype = spec.MemberType;\n\t\t\t\tInstanceExpression = new CompilerGeneratedThis (type, Location);\n\t\t\t\treturn base.DoResolve (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic readonly Iterator Iterator;\n\n\t\tList<HoistedParameter> hoisted_params_copy;\n\n\t\tTypeExpr iterator_type_expr;\n\t\tField current_field;\n\t\tField disposing_field;\n\n\t\tTypeSpec generic_enumerator_type;\n\t\tTypeSpec generic_enumerable_type;\n\n\t\tpublic IteratorStorey (Iterator iterator)\n\t\t\t: base (iterator.Container.ParametersBlock, iterator.Host,\n\t\t\t  iterator.OriginalMethod as MemberBase, iterator.OriginalMethod.CurrentTypeParameters, \"Iterator\", MemberKind.Class)\n\t\t{\n\t\t\tthis.Iterator = iterator;\n\t\t}\n\n\t\tpublic Field CurrentField {\n\t\t\tget {\n\t\t\t\treturn current_field;\n\t\t\t}\n\t\t}\n\n\t\tpublic Field DisposingField {\n\t\t\tget {\n\t\t\t\treturn disposing_field;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<HoistedParameter> HoistedParameters {\n\t\t\tget { return hoisted_params; }\n\t\t}\n\n\t\tprotected override Constructor DefineDefaultConstructor (bool is_static)\n\t\t{\n\t\t\tvar ctor = base.DefineDefaultConstructor (is_static);\n\t\t\tctor.ModFlags |= Modifiers.DEBUGGER_HIDDEN;\n\t\t\treturn ctor;\n\t\t}\n\n\t\tprotected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)\n\t\t{\n\t\t\tvar mtype = Iterator.OriginalIteratorType;\n\t\t\tif (Mutator != null)\n\t\t\t\tmtype = Mutator.Mutate (mtype);\n\n\t\t\titerator_type_expr = new TypeExpression (mtype, Location);\n\n\t\t\tvar ifaces = new List<TypeSpec> (5);\n\t\t\tif (Iterator.IsEnumerable) {\n\t\t\t\tifaces.Add (Compiler.BuiltinTypes.IEnumerable);\n\n\t\t\t\tif (Module.PredefinedTypes.IEnumerableGeneric.Define ()) {\n\t\t\t\t\tgeneric_enumerable_type = Module.PredefinedTypes.IEnumerableGeneric.TypeSpec.MakeGenericType (Module, new[] { mtype });\n\t\t\t\t\tifaces.Add (generic_enumerable_type);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tifaces.Add (Compiler.BuiltinTypes.IEnumerator);\n\t\t\tifaces.Add (Compiler.BuiltinTypes.IDisposable);\n\n\t\t\tvar ienumerator_generic = Module.PredefinedTypes.IEnumeratorGeneric;\n\t\t\tif (ienumerator_generic.Define ()) {\n\t\t\t\tgeneric_enumerator_type = ienumerator_generic.TypeSpec.MakeGenericType (Module, new [] { mtype });\n\t\t\t\tifaces.Add (generic_enumerator_type);\n\t\t\t}\n\n\t\t\tbase_class = null;\n\n\t\t\tbase_type = Compiler.BuiltinTypes.Object;\n\t\t\treturn ifaces.ToArray ();\n\t\t}\n\n\t\tprotected override bool DoDefineMembers ()\n\t\t{\n\t\t\tcurrent_field = AddCompilerGeneratedField (\"$current\", iterator_type_expr);\n\t\t\tdisposing_field = AddCompilerGeneratedField (\"$disposing\", new TypeExpression (Compiler.BuiltinTypes.Bool, Location));\n\n\t\t\tif (Iterator.IsEnumerable && hoisted_params != null) {\n\t\t\t\t//\n\t\t\t\t// Iterators are independent, each GetEnumerator call has to\n\t\t\t\t// create same enumerator therefore we have to keep original values\n\t\t\t\t// around for re-initialization\n\t\t\t\t//\n\t\t\t\thoisted_params_copy = new List<HoistedParameter> (hoisted_params.Count);\n\t\t\t\tforeach (HoistedParameter hp in hoisted_params) {\n\n\t\t\t\t\t//\n\t\t\t\t\t// Don't create field copy for unmodified captured parameters\n \t\t\t\t\t//\n\t\t\t\t\tHoistedParameter hp_copy;\n\t\t\t\t\tif (hp.IsAssigned) {\n\t\t\t\t\t\thp_copy = new HoistedParameter (hp, \"<$>\" + hp.Field.Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\thp_copy = null;\n\t\t\t\t\t}\n\n\t\t\t\t\thoisted_params_copy.Add (hp_copy);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (generic_enumerator_type != null)\n\t\t\t\tDefine_Current (true);\n\n\t\t\tDefine_Current (false);\n\t\t\tnew DisposeMethod (this);\n\t\t\tDefine_Reset ();\n\n\t\t\tif (Iterator.IsEnumerable) {\n\t\t\t\tFullNamedExpression explicit_iface = new TypeExpression (Compiler.BuiltinTypes.IEnumerable, Location);\n\t\t\t\tvar name = new MemberName (\"GetEnumerator\", null, explicit_iface, Location.Null);\n\n\t\t\t\tif (generic_enumerator_type != null) {\n\t\t\t\t\texplicit_iface = new TypeExpression (generic_enumerable_type, Location);\n\t\t\t\t\tvar gname = new MemberName (\"GetEnumerator\", null, explicit_iface, Location.Null);\n\t\t\t\t\tMethod gget_enumerator = GetEnumeratorMethod.Create (this, new TypeExpression (generic_enumerator_type, Location), gname);\n\n\t\t\t\t\t//\n\t\t\t\t\t// Just call generic GetEnumerator implementation\n\t\t\t\t\t//\n\t\t\t\t\tvar stmt = new Return (new Invocation (new DynamicMethodGroupExpr (gget_enumerator, Location), null), Location);\n\t\t\t\t\tMethod get_enumerator = GetEnumeratorMethod.Create (this, new TypeExpression (Compiler.BuiltinTypes.IEnumerator, Location), name, stmt);\n\n\t\t\t\t\tMembers.Add (get_enumerator);\n\t\t\t\t\tMembers.Add (gget_enumerator);\n\t\t\t\t} else {\n\t\t\t\t\tMembers.Add (GetEnumeratorMethod.Create (this, new TypeExpression (Compiler.BuiltinTypes.IEnumerator, Location), name));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.DoDefineMembers ();\n\t\t}\n\n\t\tvoid Define_Current (bool is_generic)\n\t\t{\n\t\t\tTypeExpr type;\n\t\t\tFullNamedExpression explicit_iface;\n\n\t\t\tif (is_generic) {\n\t\t\t\texplicit_iface = new TypeExpression (generic_enumerator_type, Location);\n\t\t\t\ttype = iterator_type_expr;\n\t\t\t} else {\n\t\t\t\texplicit_iface = new TypeExpression (Module.Compiler.BuiltinTypes.IEnumerator, Location);\n\t\t\t\ttype = new TypeExpression (Compiler.BuiltinTypes.Object, Location);\n\t\t\t}\n\n\t\t\tvar name = new MemberName (\"Current\", null, explicit_iface, Location);\n\n\t\t\tToplevelBlock get_block = new ToplevelBlock (Compiler, ParametersCompiled.EmptyReadOnlyParameters, Location,\n\t\t\t\tBlock.Flags.CompilerGenerated | Block.Flags.NoFlowAnalysis);\n\t\t\tget_block.AddStatement (new Return (new DynamicFieldExpr (CurrentField, Location), Location));\n\t\t\t\t\n\t\t\tProperty current = new Property (this, type, Modifiers.DEBUGGER_HIDDEN | Modifiers.COMPILER_GENERATED, name, null);\n\t\t\tcurrent.Get = new Property.GetMethod (current, Modifiers.COMPILER_GENERATED, null, Location);\n\t\t\tcurrent.Get.Block = get_block;\n\n\t\t\tMembers.Add (current);\n\t\t}\n\n\t\tvoid Define_Reset ()\n\t\t{\n\t\t\tMethod reset = new Method (\n\t\t\t\tthis, new TypeExpression (Compiler.BuiltinTypes.Void, Location),\n\t\t\t\tModifiers.PUBLIC | Modifiers.DEBUGGER_HIDDEN | Modifiers.COMPILER_GENERATED,\n\t\t\t\tnew MemberName (\"Reset\", Location),\n\t\t\t\tParametersCompiled.EmptyReadOnlyParameters, null);\n\t\t\tMembers.Add (reset);\n\n\t\t\treset.Block = new ToplevelBlock (Compiler, reset.ParameterInfo, Location,\n\t\t\t\tBlock.Flags.CompilerGenerated | Block.Flags.NoFlowAnalysis);\n\n\t\t\tTypeSpec ex_type = Module.PredefinedTypes.NotSupportedException.Resolve ();\n\t\t\tif (ex_type == null)\n\t\t\t\treturn;\n\n\t\t\treset.Block.AddStatement (new Throw (new New (new TypeExpression (ex_type, Location), null, Location), Location));\n\t\t}\n\n\t\tprotected override void EmitHoistedParameters (EmitContext ec, List<HoistedParameter> hoisted)\n\t\t{\n\t\t\tbase.EmitHoistedParameters (ec, hoisted);\n\t\t\tif (hoisted_params_copy != null)\n\t\t\t\tbase.EmitHoistedParameters (ec, hoisted_params_copy);\n\t\t}\n\t}\n\n\tpublic class StateMachineMethod : Method\n\t{\n\t\treadonly StateMachineInitializer expr;\n\n\t\tpublic StateMachineMethod (StateMachine host, StateMachineInitializer expr, FullNamedExpression returnType,\n\t\t\tModifiers mod, MemberName name, ToplevelBlock.Flags blockFlags)\n\t\t\t: base (host, returnType, mod | Modifiers.COMPILER_GENERATED,\n\t\t\t  name, ParametersCompiled.EmptyReadOnlyParameters, null)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tBlock = new ToplevelBlock (host.Compiler, ParametersCompiled.EmptyReadOnlyParameters, Location.Null, blockFlags);\n\t\t}\n\n\t\tpublic override EmitContext CreateEmitContext (ILGenerator ig, SourceMethodBuilder sourceMethod)\n\t\t{\n\t\t\tEmitContext ec = new EmitContext (this, ig, MemberType, sourceMethod);\n\t\t\tec.CurrentAnonymousMethod = expr;\n\n\t\t\tif (expr is AsyncInitializer)\n\t\t\t\tec.With (BuilderContext.Options.AsyncBody, true);\n\n\t\t\treturn ec;\n\t\t}\n\t}\n\n\tpublic abstract class StateMachineInitializer : AnonymousExpression\n\t{\n\t\tsealed class MoveNextBodyStatement : Statement\n\t\t{\n\t\t\treadonly StateMachineInitializer state_machine;\n\n\t\t\tpublic MoveNextBodyStatement (StateMachineInitializer stateMachine)\n\t\t\t{\n\t\t\t\tthis.state_machine = stateMachine;\n\t\t\t\tthis.loc = stateMachine.Location;\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\n\t\t\tpublic override bool Resolve (BlockContext ec)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\tstate_machine.EmitMoveNext (ec);\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\t// Don't create sequence point\n\t\t\t\tDoEmit (ec);\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\treturn state_machine.ReturnType.Kind != MemberKind.Void;\n\t\t\t}\n\n\t\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t\t{\n\t\t\t\tbase.MarkReachable (rc);\n\n\t\t\t\tif (state_machine.ReturnType.Kind != MemberKind.Void)\n\t\t\t\t\trc = Reachability.CreateUnreachable ();\n\n\t\t\t\treturn rc;\n\t\t\t}\n\t\t}\n\n\t\tpublic readonly TypeDefinition Host;\n\t\tprotected StateMachine storey;\n\n\t\t//\n\t\t// The state as we generate the machine\n\t\t//\n\t\tprotected Label move_next_ok;\n\t\tprotected Label move_next_error;\n\t\tLocalBuilder skip_finally;\n\t\tprotected LocalBuilder current_pc;\n\t\tprotected List<ResumableStatement> resume_points;\n\n\t\tprotected StateMachineInitializer (ParametersBlock block, TypeDefinition host, TypeSpec returnType)\n\t\t\t: base (block, returnType, block.StartLocation)\n\t\t{\n\t\t\tthis.Host = host;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Label BodyEnd { get; set; }\n\n\t\tpublic LocalBuilder CurrentPC\n\t\t{\n\t\t\tget {\n\t\t\t\treturn current_pc;\n\t\t\t}\n\t\t}\n\n\t\tpublic LocalBuilder SkipFinally {\n\t\t\tget {\n\t\t\t\treturn skip_finally;\n\t\t\t}\n\t\t}\n\n\t\tpublic override AnonymousMethodStorey Storey {\n\t\t\tget {\n\t\t\t\treturn storey;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic int AddResumePoint (ResumableStatement stmt)\n\t\t{\n\t\t\tif (resume_points == null)\n\t\t\t\tresume_points = new List<ResumableStatement> ();\n\n\t\t\tresume_points.Add (stmt);\n\t\t\treturn resume_points.Count;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tprotected virtual BlockContext CreateBlockContext (BlockContext bc)\n\t\t{\n\t\t\tvar ctx = new BlockContext (bc, block, bc.ReturnType);\n\t\t\tctx.CurrentAnonymousMethod = this;\n\n\t\t\tctx.AssignmentInfoOffset = bc.AssignmentInfoOffset;\n\t\t\tctx.EnclosingLoop = bc.EnclosingLoop;\n\t\t\tctx.EnclosingLoopOrSwitch = bc.EnclosingLoopOrSwitch;\n\t\t\tctx.Switch = bc.Switch;\n\n\t\t\treturn ctx;\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tvar bc = (BlockContext) rc;\n\t\t\tvar ctx = CreateBlockContext (bc);\n\n\t\t\tBlock.Resolve (ctx);\n\n\t\t\tif (!rc.IsInProbingMode) {\n\t\t\t\tvar move_next = new StateMachineMethod (storey, this, new TypeExpression (ReturnType, loc), Modifiers.PUBLIC, new MemberName (\"MoveNext\", loc), 0);\n\t\t\t\tmove_next.Block.AddStatement (new MoveNextBodyStatement (this));\n\t\t\t\tstorey.AddEntryMethod (move_next);\n\t\t\t}\n\n\t\t\tbc.AssignmentInfoOffset = ctx.AssignmentInfoOffset;\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Load state machine instance\n\t\t\t//\n\t\t\tstorey.Instance.Emit (ec);\n\t\t}\n\n\t\tvoid EmitMoveNext_NoResumePoints (EmitContext ec)\n\t\t{\n\t\t\tec.EmitThis ();\n\t\t\tec.Emit (OpCodes.Ldfld, storey.PC.Spec);\n\n\t\t\tec.EmitThis ();\n\t\t\tec.EmitInt ((int) IteratorStorey.State.After);\n\t\t\tec.Emit (OpCodes.Stfld, storey.PC.Spec);\n\n\t\t\t// We only care if the PC is zero (start executing) or non-zero (don't do anything)\n\t\t\tec.Emit (OpCodes.Brtrue, move_next_error);\n\n\t\t\tBodyEnd = ec.DefineLabel ();\n\n\t\t\tvar async_init = this as AsyncInitializer;\n\t\t\tif (async_init != null)\n\t\t\t\tec.BeginExceptionBlock ();\n\n\t\t\tblock.EmitEmbedded (ec);\n\n\t\t\tif (async_init != null)\n\t\t\t\tasync_init.EmitCatchBlock (ec);\n\n\t\t\tec.MarkLabel (BodyEnd);\n\n\t\t\tEmitMoveNextEpilogue (ec);\n\n\t\t\tec.MarkLabel (move_next_error);\n\n\t\t\tif (ReturnType.Kind != MemberKind.Void) {\n\t\t\t\tec.EmitInt (0);\n\t\t\t\tec.Emit (OpCodes.Ret);\n\t\t\t}\n\n\t\t\tec.MarkLabel (move_next_ok);\n\t\t}\n\n\t\tvoid EmitMoveNext (EmitContext ec)\n\t\t{\n\t\t\tmove_next_ok = ec.DefineLabel ();\n\t\t\tmove_next_error = ec.DefineLabel ();\n\n\t\t\tif (resume_points == null) {\n\t\t\t\tEmitMoveNext_NoResumePoints (ec);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tcurrent_pc = ec.GetTemporaryLocal (ec.BuiltinTypes.UInt);\n\t\t\tec.EmitThis ();\n\t\t\tec.Emit (OpCodes.Ldfld, storey.PC.Spec);\n\t\t\tec.Emit (OpCodes.Stloc, current_pc);\n\n\t\t\t// We're actually in state 'running', but this is as good a PC value as any if there's an abnormal exit\n\t\t\tec.EmitThis ();\n\t\t\tec.EmitInt ((int) IteratorStorey.State.After);\n\t\t\tec.Emit (OpCodes.Stfld, storey.PC.Spec);\n\n\t\t\tLabel[] labels = new Label[1 + resume_points.Count];\n\t\t\tlabels[0] = ec.DefineLabel ();\n\n\t\t\tbool need_skip_finally = false;\n\t\t\tfor (int i = 0; i < resume_points.Count; ++i) {\n\t\t\t\tResumableStatement s = resume_points[i];\n\t\t\t\tneed_skip_finally |= s is ExceptionStatement;\n\t\t\t\tlabels[i + 1] = s.PrepareForEmit (ec);\n\t\t\t}\n\n\t\t\tif (need_skip_finally) {\n\t\t\t\tskip_finally = ec.GetTemporaryLocal (ec.BuiltinTypes.Bool);\n\t\t\t\tec.EmitInt (0);\n\t\t\t\tec.Emit (OpCodes.Stloc, skip_finally);\n\t\t\t}\n\n\t\t\tvar async_init = this as AsyncInitializer;\n\t\t\tif (async_init != null)\n\t\t\t\tec.BeginExceptionBlock ();\n\n\t\t\tec.Emit (OpCodes.Ldloc, current_pc);\n\t\t\tec.Emit (OpCodes.Switch, labels);\n\n\t\t\tec.Emit (async_init != null ? OpCodes.Leave : OpCodes.Br, move_next_error);\n\n\t\t\tec.MarkLabel (labels[0]);\n\n\t\t\tBodyEnd = ec.DefineLabel ();\n\n\t\t\tblock.EmitEmbedded (ec);\n\n\t\t\tec.MarkLabel (BodyEnd);\n\n\t\t\tif (async_init != null) {\n\t\t\t\tasync_init.EmitCatchBlock (ec);\n\t\t\t}\n\n\t\t\tec.Mark (Block.Original.EndLocation);\n\t\t\tec.EmitThis ();\n\t\t\tec.EmitInt ((int) IteratorStorey.State.After);\n\t\t\tec.Emit (OpCodes.Stfld, storey.PC.Spec);\n\n\t\t\tEmitMoveNextEpilogue (ec);\n\n\t\t\tec.MarkLabel (move_next_error);\n\t\t\t\n\t\t\tif (ReturnType.Kind != MemberKind.Void) {\n\t\t\t\tec.EmitInt (0);\n\t\t\t\tec.Emit (OpCodes.Ret);\n\t\t\t}\n\n\t\t\tec.MarkLabel (move_next_ok);\n\n\t\t\tif (ReturnType.Kind != MemberKind.Void) {\n\t\t\t\tec.EmitInt (1);\n\t\t\t\tec.Emit (OpCodes.Ret);\n\t\t\t}\n\t\t}\n\n\t\tprotected virtual void EmitMoveNextEpilogue (EmitContext ec)\n\t\t{\n\t\t}\n\n\t\tpublic void EmitLeave (EmitContext ec, bool unwind_protect)\n\t\t{\n\t\t\t// Return ok\n\t\t\tec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, move_next_ok);\n\t\t}\n\n\t\t//\n\t\t// Called back from YieldStatement\n\t\t//\n\t\tpublic virtual void InjectYield (EmitContext ec, Expression expr, int resume_pc, bool unwind_protect, Label resume_point)\n\t\t{\n\t\t\t//\n\t\t\t// Guard against being disposed meantime\n\t\t\t//\n\t\t\tLabel disposed = ec.DefineLabel ();\n\t\t\tvar iterator = storey as IteratorStorey;\n\t\t\tif (iterator != null) {\n\t\t\t\tec.EmitThis ();\n\t\t\t\tec.Emit (OpCodes.Ldfld, iterator.DisposingField.Spec);\n\t\t\t\tec.Emit (OpCodes.Brtrue_S, disposed);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// store resume program-counter\n\t\t\t//\n\t\t\tec.EmitThis ();\n\t\t\tec.EmitInt (resume_pc);\n\t\t\tec.Emit (OpCodes.Stfld, storey.PC.Spec);\n\n\t\t\tif (iterator != null) {\n\t\t\t\tec.MarkLabel (disposed);\n\t\t\t}\n\n\t\t\t// mark finally blocks as disabled\n\t\t\tif (unwind_protect && skip_finally != null) {\n\t\t\t\tec.EmitInt (1);\n\t\t\t\tec.Emit (OpCodes.Stloc, skip_finally);\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetStateMachine (StateMachine stateMachine)\n\t\t{\n\t\t\tthis.storey = stateMachine;\n\t\t}\n\t}\n\n\t//\n\t// Iterators are implemented as state machine blocks\n\t//\n\tpublic class Iterator : StateMachineInitializer\n\t{\n\t\tsealed class TryFinallyBlockProxyStatement : Statement\n\t\t{\n\t\t\tTryFinallyBlock block;\n\t\t\tIterator iterator;\n\n\t\t\tpublic TryFinallyBlockProxyStatement (Iterator iterator, TryFinallyBlock block)\n\t\t\t{\n\t\t\t\tthis.iterator = iterator;\n\t\t\t\tthis.block = block;\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Restore redirection for any captured variables\n\t\t\t\t//\n\t\t\t\tec.CurrentAnonymousMethod = iterator;\n\n\t\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, !ec.HasMethodSymbolBuilder)) {\n\t\t\t\t\tblock.EmitFinallyBody (ec);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic readonly IMethodData OriginalMethod;\n\t\tpublic readonly bool IsEnumerable;\n\t\tpublic readonly TypeSpec OriginalIteratorType;\n\t\tint finally_hosts_counter;\n\n\t\tpublic Iterator (ParametersBlock block, IMethodData method, TypeDefinition host, TypeSpec iterator_type, bool is_enumerable)\n\t\t\t: base (block, host, host.Compiler.BuiltinTypes.Bool)\n\t\t{\n\t\t\tthis.OriginalMethod = method;\n\t\t\tthis.OriginalIteratorType = iterator_type;\n\t\t\tthis.IsEnumerable = is_enumerable;\n\t\t\tthis.type = method.ReturnType;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic ToplevelBlock Container {\n\t\t\tget { return OriginalMethod.Block; }\n\t\t}\n\n\t\tpublic override string ContainerType {\n\t\t\tget { return \"iterator\"; }\n\t\t}\n\n\t\tpublic override bool IsIterator {\n\t\t\tget { return true; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic Method CreateFinallyHost (TryFinallyBlock block)\n\t\t{\n\t\t\tvar method = new Method (storey, new TypeExpression (storey.Compiler.BuiltinTypes.Void, loc),\n\t\t\t\tModifiers.COMPILER_GENERATED, new MemberName (CompilerGeneratedContainer.MakeName (null, null, \"Finally\", finally_hosts_counter++), loc),\n\t\t\t\tParametersCompiled.EmptyReadOnlyParameters, null);\n\n\t\t\tmethod.Block = new ToplevelBlock (method.Compiler, method.ParameterInfo, loc,\n\t\t\t\tToplevelBlock.Flags.CompilerGenerated | ToplevelBlock.Flags.NoFlowAnalysis);\n\t\t\tmethod.Block.AddStatement (new TryFinallyBlockProxyStatement (this, block));\n\n\t\t\t// Cannot it add to storey because it'd be emitted before nested\n\t\t\t// anonoymous methods which could capture shared variable\n\n\t\t\treturn method;\n\t\t}\n\n\t\tpublic void EmitYieldBreak (EmitContext ec, bool unwind_protect)\n\t\t{\n\t\t\tec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, move_next_error);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn OriginalMethod.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Load Iterator storey instance\n\t\t\t//\n\t\t\tstorey.Instance.Emit (ec);\n\n\t\t\t//\n\t\t\t// Initialize iterator PC when it's unitialized\n\t\t\t//\n\t\t\tif (IsEnumerable) {\n\t\t\t\tec.Emit (OpCodes.Dup);\n\t\t\t\tec.EmitInt ((int)IteratorStorey.State.Uninitialized);\n\n\t\t\t\tvar field = storey.PC.Spec;\n\t\t\t\tif (storey.MemberName.IsGeneric) {\n\t\t\t\t\tfield = MemberCache.GetMember (Storey.Instance.Type, field);\n\t\t\t\t}\n\n\t\t\t\tec.Emit (OpCodes.Stfld, field);\n\t\t\t}\n\t\t}\n\n\t\tpublic void EmitDispose (EmitContext ec)\n\t\t{\n\t\t\tif (resume_points == null)\n\t\t\t\treturn;\n\n\t\t\tLabel end = ec.DefineLabel ();\n\n\t\t\tLabel[] labels = null;\n\t\t\tfor (int i = 0; i < resume_points.Count; ++i) {\n\t\t\t\tResumableStatement s = resume_points[i];\n\t\t\t\tLabel ret = s.PrepareForDispose (ec, end);\n\t\t\t\tif (ret.Equals (end) && labels == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (labels == null) {\n\t\t\t\t\tlabels = new Label[resume_points.Count + 1];\n\t\t\t\t\tfor (int j = 0; j <= i; ++j)\n\t\t\t\t\t\tlabels[j] = end;\n\t\t\t\t}\n\n\t\t\t\tlabels[i + 1] = ret;\n\t\t\t}\n\n\t\t\tif (labels != null) {\n\t\t\t\tcurrent_pc = ec.GetTemporaryLocal (ec.BuiltinTypes.UInt);\n\t\t\t\tec.EmitThis ();\n\t\t\t\tec.Emit (OpCodes.Ldfld, storey.PC.Spec);\n\t\t\t\tec.Emit (OpCodes.Stloc, current_pc);\n\t\t\t}\n\n\t\t\tec.EmitThis ();\n\t\t\tec.EmitInt (1);\n\t\t\tec.Emit (OpCodes.Stfld, ((IteratorStorey) storey).DisposingField.Spec);\n\n\t\t\tec.EmitThis ();\n\t\t\tec.EmitInt ((int) IteratorStorey.State.After);\n\t\t\tec.Emit (OpCodes.Stfld, storey.PC.Spec);\n\n\t\t\tif (labels != null) {\n\t\t\t\t//SymbolWriter.StartIteratorDispatcher (ec.ig);\n\t\t\t\tec.Emit (OpCodes.Ldloc, current_pc);\n\t\t\t\tec.Emit (OpCodes.Switch, labels);\n\t\t\t\t//SymbolWriter.EndIteratorDispatcher (ec.ig);\n\n\t\t\t\tforeach (ResumableStatement s in resume_points)\n\t\t\t\t\ts.EmitForDispose (ec, current_pc, end, true);\n\t\t\t}\n\n\t\t\tec.MarkLabel (end);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic override void InjectYield (EmitContext ec, Expression expr, int resume_pc, bool unwind_protect, Label resume_point)\n\t\t{\n\t\t\t// Store the new value into current\n\t\t\tvar fe = new FieldExpr (((IteratorStorey) storey).CurrentField, loc);\n\t\t\tfe.InstanceExpression = new CompilerGeneratedThis (storey.CurrentType, loc);\n\t\t\tfe.EmitAssign (ec, expr, false, false);\n\n\t\t\tbase.InjectYield (ec, expr, resume_pc, unwind_protect, resume_point);\n\n\t\t\tEmitLeave (ec, unwind_protect);\n\n\t\t\tec.MarkLabel (resume_point);\n\t\t}\n\n\t\tpublic static void CreateIterator (IMethodData method, TypeDefinition parent, Modifiers modifiers)\n\t\t{\n\t\t\tbool is_enumerable;\n\t\t\tTypeSpec iterator_type;\n\n\t\t\tTypeSpec ret = method.ReturnType;\n\t\t\tif (ret == null)\n\t\t\t\treturn;\n\n\t\t\tif (!CheckType (ret, parent, out iterator_type, out is_enumerable)) {\n\t\t\t\tparent.Compiler.Report.Error (1624, method.Location,\n\t\t\t\t\t      \"The body of `{0}' cannot be an iterator block \" +\n\t\t\t\t\t      \"because `{1}' is not an iterator interface type\",\n\t\t\t\t\t      method.GetSignatureForError (),\n\t\t\t\t\t      ret.GetSignatureForError ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tParametersCompiled parameters = method.ParameterInfo;\n\t\t\tfor (int i = 0; i < parameters.Count; i++) {\n\t\t\t\tParameter p = parameters [i];\n\t\t\t\tParameter.Modifier mod = p.ModFlags;\n\t\t\t\tif ((mod & Parameter.Modifier.RefOutMask) != 0) {\n\t\t\t\t\tparent.Compiler.Report.Error (1623, p.Location,\n\t\t\t\t\t\t\"Iterators cannot have ref or out parameters\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (p is ArglistParameter) {\n\t\t\t\t\tparent.Compiler.Report.Error (1636, method.Location,\n\t\t\t\t\t\t\"__arglist is not allowed in parameter list of iterators\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (parameters.Types [i].IsPointer) {\n\t\t\t\t\tparent.Compiler.Report.Error (1637, p.Location,\n\t\t\t\t\t\t\"Iterators cannot have unsafe parameters or yield types\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((modifiers & Modifiers.UNSAFE) != 0) {\n\t\t\t\tparent.Compiler.Report.Error (1629, method.Location, \"Unsafe code may not appear in iterators\");\n\t\t\t}\n\n\t\t\tmethod.Block = method.Block.ConvertToIterator (method, parent, iterator_type, is_enumerable);\n\t\t}\n\n\t\tstatic bool CheckType (TypeSpec ret, TypeContainer parent, out TypeSpec original_iterator_type, out bool is_enumerable)\n\t\t{\n\t\t\toriginal_iterator_type = null;\n\t\t\tis_enumerable = false;\n\n\t\t\tif (ret.BuiltinType == BuiltinTypeSpec.Type.IEnumerable) {\n\t\t\t\toriginal_iterator_type = parent.Compiler.BuiltinTypes.Object;\n\t\t\t\tis_enumerable = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (ret.BuiltinType == BuiltinTypeSpec.Type.IEnumerator) {\n\t\t\t\toriginal_iterator_type = parent.Compiler.BuiltinTypes.Object;\n\t\t\t\tis_enumerable = false;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tInflatedTypeSpec inflated = ret as InflatedTypeSpec;\n\t\t\tif (inflated == null)\n\t\t\t\treturn false;\n\n\t\t\tvar member_definition = inflated.MemberDefinition;\n\t\t\tPredefinedType ptype = parent.Module.PredefinedTypes.IEnumerableGeneric;\n\n\t\t\tif (ptype.Define () && ptype.TypeSpec.MemberDefinition == member_definition) {\n\t\t\t\toriginal_iterator_type = inflated.TypeArguments[0];\n\t\t\t\tis_enumerable = true;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tptype = parent.Module.PredefinedTypes.IEnumeratorGeneric;\n\t\t\tif (ptype.Define () && ptype.TypeSpec.MemberDefinition == member_definition) {\n\t\t\t\toriginal_iterator_type = inflated.TypeArguments[0];\n\t\t\t\tis_enumerable = false;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/lambda.cs",
    "content": "//\n// lambda.cs: support for lambda expressions\n//\n// Authors: Miguel de Icaza (miguel@gnu.org)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2007-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\tpublic class LambdaExpression : AnonymousMethodExpression\n\t{\n\t\t//\n\t\t// The parameters can either be:\n\t\t//    A list of Parameters (explicitly typed parameters)\n\t\t//    An ImplicitLambdaParameter\n\t\t//\n\t\tpublic LambdaExpression (Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression CreateExpressionTree (ResolveContext ec, TypeSpec delegate_type)\n\t\t{\n\t\t\tif (ec.IsInProbingMode)\n\t\t\t\treturn this;\n\n\t\t\tBlockContext bc = new BlockContext (ec.MemberContext, ec.ConstructorBlock, ec.BuiltinTypes.Void) {\n\t\t\t\tCurrentAnonymousMethod = ec.CurrentAnonymousMethod\n\t\t\t};\n\n\t\t\tExpression args = Parameters.CreateExpressionTree (bc, loc);\n\t\t\tExpression expr = Block.CreateExpressionTree (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tArguments arguments = new Arguments (2);\n\t\t\targuments.Add (new Argument (expr));\n\t\t\targuments.Add (new Argument (args));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Lambda\",\n\t\t\t\tnew TypeArguments (new TypeExpression (delegate_type, loc)),\n\t\t\t\targuments);\n\t\t}\n\n\t\tpublic override bool HasExplicitParameters {\n\t\t\tget {\n\t\t\t\treturn Parameters.Count > 0 && !(Parameters.FixedParameters [0] is ImplicitLambdaParameter);\n\t\t\t}\n\t\t}\n\n\t\tprotected override ParametersCompiled ResolveParameters (ResolveContext ec, TypeInferenceContext tic, TypeSpec delegateType)\n\t\t{\n\t\t\tif (!delegateType.IsDelegate)\n\t\t\t\treturn null;\n\n\t\t\tAParametersCollection d_params = Delegate.GetParameters (delegateType);\n\n\t\t\tif (HasExplicitParameters) {\n\t\t\t\tif (!VerifyExplicitParameters (ec, tic, delegateType, d_params))\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn Parameters;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// If L has an implicitly typed parameter list we make implicit parameters explicit\n\t\t\t// Set each parameter of L is given the type of the corresponding parameter in D\n\t\t\t//\n\t\t\tif (!VerifyParameterCompatibility (ec, tic, delegateType, d_params, ec.IsInProbingMode))\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec [] ptypes = new TypeSpec [Parameters.Count];\n\t\t\tfor (int i = 0; i < d_params.Count; i++) {\n\t\t\t\t// D has no ref or out parameters\n\t\t\t\tif ((d_params.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) != 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tTypeSpec d_param = d_params.Types [i];\n\n\t\t\t\t//\n\t\t\t\t// When type inference context exists try to apply inferred type arguments\n\t\t\t\t//\n\t\t\t\tif (tic != null) {\n\t\t\t\t\td_param = tic.InflateGenericArgument (ec, d_param);\n\t\t\t\t}\n\n\t\t\t\tptypes [i] = d_param;\n\t\t\t\tImplicitLambdaParameter ilp = (ImplicitLambdaParameter) Parameters.FixedParameters [i];\n\t\t\t\tilp.SetParameterType (d_param);\n\t\t\t\tilp.Resolve (null, i);\n\t\t\t}\n\n\t\t\tParameters.Types = ptypes;\n\t\t\treturn Parameters;\n\t\t}\n\n\t\tprotected override AnonymousMethodBody CompatibleMethodFactory (TypeSpec returnType, TypeSpec delegateType, ParametersCompiled p, ParametersBlock b)\n\t\t{\n\t\t\treturn new LambdaMethod (p, b, returnType, delegateType, loc);\n\t\t}\n\n\t\tprotected override bool DoResolveParameters (ResolveContext rc)\n\t\t{\n\t\t\t//\n\t\t\t// Only explicit parameters can be resolved at this point\n\t\t\t//\n\t\t\tif (HasExplicitParameters) {\n\t\t\t\treturn Parameters.Resolve (rc);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn \"lambda expression\";\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tclass LambdaMethod : AnonymousMethodBody\n\t{\n\t\tpublic LambdaMethod (ParametersCompiled parameters,\n\t\t\t\t\tParametersBlock block, TypeSpec return_type, TypeSpec delegate_type,\n\t\t\t\t\tLocation loc)\n\t\t\t: base (parameters, block, return_type, delegate_type, loc)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override string ContainerType {\n\t\t\tget {\n\t\t\t\treturn \"lambda expression\";\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\t// TODO: nothing ??\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tBlockContext bc = new BlockContext (ec.MemberContext, Block, ReturnType);\n\t\t\tExpression args = parameters.CreateExpressionTree (bc, loc);\n\t\t\tExpression expr = Block.CreateExpressionTree (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tArguments arguments = new Arguments (2);\n\t\t\targuments.Add (new Argument (expr));\n\t\t\targuments.Add (new Argument (args));\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Lambda\",\n\t\t\t\tnew TypeArguments (new TypeExpression (type, loc)),\n\t\t\t\targuments);\n\t\t}\n\t}\n\n\t//\n\t// This is a return statement that is prepended lambda expression bodies that happen\n\t// to be expressions.  Depending on the return type of the delegate this will behave\n\t// as either { expr (); return (); } or { return expr (); }\n\t//\n\tpublic class ContextualReturn : Return\n\t{\n\t\tExpressionStatement statement;\n\n\t\tpublic ContextualReturn (Expression expr)\n\t\t\t: base (expr, expr.StartLocation)\n\t\t{\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn Expr.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.EmitStatement (ec);\n\t\t\t\tif (unwind_protect)\n\t\t\t\t\tec.Emit (OpCodes.Leave, ec.CreateReturnLabel ());\n\t\t\t\telse {\n\t\t\t\t\tec.Emit (OpCodes.Ret);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.DoEmit (ec);\n\t\t}\n\n\t\tprotected override bool DoResolve (BlockContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// When delegate returns void, only expression statements can be used\n\t\t\t//\n\t\t\tif (ec.ReturnType.Kind == MemberKind.Void) {\n\t\t\t\tExpr = Expr.Resolve (ec);\n\t\t\t\tif (Expr == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tstatement = Expr as ExpressionStatement;\n\t\t\t\tif (statement == null)\n\t\t\t\t\tExpr.Error_InvalidExpressionStatement (ec);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn base.DoResolve (ec);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/linq.cs",
    "content": "//\n// linq.cs: support for query expressions\n//\n// Authors: Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2007-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace Mono.CSharp.Linq\n{\n\tpublic class QueryExpression : AQueryClause\n\t{\n\t\tpublic QueryExpression (AQueryClause start)\n\t\t\t: base (null, null, start.Location)\n\t\t{\n\t\t\tthis.next = start;\n\t\t}\n\n\t\tpublic override Expression BuildQueryClause (ResolveContext ec, Expression lSide, Parameter parentParameter)\n\t\t{\n\t\t\treturn next.BuildQueryClause (ec, lSide, parentParameter);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tint counter = QueryBlock.TransparentParameter.Counter;\n\n\t\t\tExpression e = BuildQueryClause (ec, null, null);\n\t\t\tif (e != null)\n\t\t\t\te = e.Resolve (ec);\n\n\t\t\t//\n\t\t\t// Reset counter in probing mode to ensure that all transparent\n\t\t\t// identifier anonymous types are created only once\n\t\t\t//\n\t\t\tif (ec.IsInProbingMode)\n\t\t\t\tQueryBlock.TransparentParameter.Counter = counter;\n\n\t\t\treturn e;\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { throw new NotSupportedException (); }\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic abstract class AQueryClause : ShimExpression\n\t{\n\t\tprotected class QueryExpressionAccess : MemberAccess\n\t\t{\n\t\t\tpublic QueryExpressionAccess (Expression expr, string methodName, Location loc)\n\t\t\t\t: base (expr, methodName, loc)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic QueryExpressionAccess (Expression expr, string methodName, TypeArguments typeArguments, Location loc)\n\t\t\t\t: base (expr, methodName, typeArguments, loc)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)\n\t\t\t{\n\t\t\t\tec.Report.Error (1935, loc, \"An implementation of `{0}' query expression pattern could not be found. \" +\n\t\t\t\t\t\"Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?\",\n\t\t\t\t\tname);\n\t\t\t}\n\t\t}\n\n\t\tprotected class QueryExpressionInvocation : Invocation, OverloadResolver.IErrorHandler\n\t\t{\n\t\t\tpublic QueryExpressionInvocation (QueryExpressionAccess expr, Arguments arguments)\n\t\t\t\t: base (expr, arguments)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override MethodGroupExpr DoResolveOverload (ResolveContext ec)\n\t\t\t{\n\t\t\t\tMethodGroupExpr rmg = mg.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.None);\n\t\t\t\treturn rmg;\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolveDynamic (ResolveContext ec, Expression memberExpr)\n\t\t\t{\n\t\t\t\tec.Report.Error (1979, loc,\n\t\t\t\t\t\"Query expressions with a source or join sequence of type `dynamic' are not allowed\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t#region IErrorHandler Members\n\n\t\t\tbool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous)\n\t\t\t{\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (best);\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (ambiguous);\n\t\t\t\tec.Report.Error (1940, loc, \"Ambiguous implementation of the query pattern `{0}' for source type `{1}'\",\n\t\t\t\t\tbest.Name, mg.InstanceExpression.GetSignatureForError ());\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tbool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)\n\t\t\t{\n\t\t\t\tvar ms = (MethodSpec) best;\n\t\t\t\tTypeSpec source_type = ms.Parameters.ExtensionMethodType;\n\t\t\t\tif (source_type != null) {\n\t\t\t\t\tArgument a = arguments[0];\n\n\t\t\t\t\tif (TypeManager.IsGenericType (source_type) && InflatedTypeSpec.ContainsTypeParameter (source_type)) {\n\t\t\t\t\t\tTypeInferenceContext tic = new TypeInferenceContext (source_type.TypeArguments);\n\t\t\t\t\t\ttic.OutputTypeInference (rc, a.Expr, source_type);\n\t\t\t\t\t\tif (tic.FixAllTypes (rc)) {\n\t\t\t\t\t\t\tsource_type = source_type.GetDefinition ().MakeGenericType (rc, tic.InferredTypeArguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!Convert.ImplicitConversionExists (rc, a.Expr, source_type)) {\n\t\t\t\t\t\trc.Report.Error (1936, loc, \"An implementation of `{0}' query expression pattern for source type `{1}' could not be found\",\n\t\t\t\t\t\t\tbest.Name, a.Type.GetSignatureForError ());\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (best.Name == \"SelectMany\") {\n\t\t\t\t\trc.Report.Error (1943, loc,\n\t\t\t\t\t\t\"An expression type is incorrect in a subsequent `from' clause in a query expression with source type `{0}'\",\n\t\t\t\t\t\targuments[0].GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\trc.Report.Error (1942, loc,\n\t\t\t\t\t\t\"An expression type in `{0}' clause is incorrect. Type inference failed in the call to `{1}'\",\n\t\t\t\t\t\tbest.Name.ToLowerInvariant (), best.Name);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\tpublic AQueryClause next;\n\t\tpublic QueryBlock block;\n\n\t\tprotected AQueryClause (QueryBlock block, Expression expr, Location loc)\n\t\t\t : base (expr)\n\t\t{\n\t\t\tthis.block = block;\n\t\t\tthis.loc = loc;\n\t\t}\n\t\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tbase.CloneTo (clonectx, target);\n\n\t\t\tAQueryClause t = (AQueryClause) target;\n\n\t\t\tif (block != null)\n\t\t\t\tt.block = (QueryBlock) clonectx.LookupBlock (block);\n\n\t\t\tif (next != null)\n\t\t\t\tt.next = (AQueryClause) next.Clone (clonectx);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\treturn expr.Resolve (ec);\n\t\t}\n\n\t\tpublic virtual Expression BuildQueryClause (ResolveContext ec, Expression lSide, Parameter parameter)\n\t\t{\n\t\t\tArguments args = null;\n\t\t\tCreateArguments (ec, parameter, ref args);\n\t\t\tlSide = CreateQueryExpression (lSide, args);\n\t\t\tif (next != null) {\n\t\t\t\tparameter = CreateChildrenParameters (parameter);\n\n\t\t\t\tSelect s = next as Select;\n\t\t\t\tif (s == null || s.IsRequired (parameter))\n\t\t\t\t\treturn next.BuildQueryClause (ec, lSide, parameter);\n\t\t\t\t\t\n\t\t\t\t// Skip transparent select clause if any clause follows\n\t\t\t\tif (next.next != null)\n\t\t\t\t\treturn next.next.BuildQueryClause (ec, lSide, parameter);\n\t\t\t}\n\n\t\t\treturn lSide;\n\t\t}\n\n\t\tprotected virtual Parameter CreateChildrenParameters (Parameter parameter)\n\t\t{\n\t\t\t// Have to clone the parameter for any children use, it carries block sensitive data\n\t\t\treturn parameter.Clone ();\n\t\t}\n\n\t\tprotected virtual void CreateArguments (ResolveContext ec, Parameter parameter, ref Arguments args)\n\t\t{\n\t\t\targs = new Arguments (2);\n\n\t\t\tLambdaExpression selector = new LambdaExpression (loc);\n\n\t\t\tblock.SetParameter (parameter);\n\t\t\tselector.Block = block;\n\t\t\tselector.Block.AddStatement (new ContextualReturn (expr));\n\n\t\t\targs.Add (new Argument (selector));\n\t\t}\n\n\t\tprotected Invocation CreateQueryExpression (Expression lSide, Arguments arguments)\n\t\t{\n\t\t\treturn new QueryExpressionInvocation (\n\t\t\t\tnew QueryExpressionAccess (lSide, MethodName, loc), arguments);\n\t\t}\n\n\t\tprotected abstract string MethodName { get; }\n\n\t\tpublic AQueryClause Next {\n\t\t\tset {\n\t\t\t\tnext = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic AQueryClause Tail {\n\t\t\tget {\n\t\t\t\treturn next == null ? this : next.Tail;\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// A query clause with an identifier (range variable)\n\t//\n\tpublic abstract class ARangeVariableQueryClause : AQueryClause\n\t{\n\t\tsealed class RangeAnonymousTypeParameter : AnonymousTypeParameter\n\t\t{\n\t\t\tpublic RangeAnonymousTypeParameter (Expression initializer, RangeVariable parameter)\n\t\t\t\t: base (initializer, parameter.Name, parameter.Location)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override void Error_InvalidInitializer (ResolveContext ec, string initializer)\n\t\t\t{\n\t\t\t\tec.Report.Error (1932, loc, \"A range variable `{0}' cannot be initialized with `{1}'\",\n\t\t\t\t\tName, initializer);\n\t\t\t}\n\t\t}\n\n\t\tclass RangeParameterReference : ParameterReference\n\t\t{\n\t\t\tParameter parameter;\n\n\t\t\tpublic RangeParameterReference (Parameter p)\n\t\t\t\t: base (null, p.Location)\n\t\t\t{\n\t\t\t\tthis.parameter = p;\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\tpi = ec.CurrentBlock.ParametersBlock.GetParameterInfo (parameter);\n\t\t\t\treturn base.DoResolve (ec);\n\t\t\t}\n\t\t}\n\n\t\tprotected RangeVariable identifier;\n\t\t\n\t\tpublic RangeVariable  IntoVariable {\n\t\t\tget {\n\t\t\t\treturn identifier;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected ARangeVariableQueryClause (QueryBlock block, RangeVariable identifier, Expression expr, Location loc)\n\t\t\t: base (block, expr, loc)\n\t\t{\n\t\t\tthis.identifier = identifier;\n\t\t}\n\n\t\tpublic RangeVariable Identifier {\n\t\t\tget {\n\t\t\t\treturn identifier;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression IdentifierType { get; set; }\n\n\t\tprotected Invocation CreateCastExpression (Expression lSide)\n\t\t{\n\t\t\treturn new QueryExpressionInvocation (\n\t\t\t\tnew QueryExpressionAccess (lSide, \"Cast\", new TypeArguments (IdentifierType), loc), null);\n\t\t}\n\n\t\tprotected override Parameter CreateChildrenParameters (Parameter parameter)\n\t\t{\n\t\t\treturn new QueryBlock.TransparentParameter (parameter.Clone (), GetIntoVariable ());\n\t\t}\n\n\t\tprotected static Expression CreateRangeVariableType (ResolveContext rc, Parameter parameter, RangeVariable name, Expression init)\n\t\t{\n\t\t\tvar args = new List<AnonymousTypeParameter> (2);\n\n\t\t\t//\n\t\t\t// The first argument is the reference to the parameter\n\t\t\t//\n\t\t\targs.Add (new AnonymousTypeParameter (new RangeParameterReference (parameter), parameter.Name, parameter.Location));\n\n\t\t\t//\n\t\t\t// The second argument is the linq expression\n\t\t\t//\n\t\t\targs.Add (new RangeAnonymousTypeParameter (init, name));\n\n\t\t\t//\n\t\t\t// Create unique anonymous type\n\t\t\t//\n\t\t\treturn new NewAnonymousType (args, rc.MemberContext.CurrentMemberDefinition.Parent, name.Location);\n\t\t}\n\n\t\tprotected virtual RangeVariable GetIntoVariable ()\n\t\t{\n\t\t\treturn identifier;\n\t\t}\n\t}\n\n\tpublic sealed class RangeVariable : INamedBlockVariable\n\t{\n\t\tBlock block;\n\n\t\tpublic RangeVariable (string name, Location loc)\n\t\t{\n\t\t\tName = name;\n\t\t\tLocation = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Block Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tblock = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsDeclared {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsParameter {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic Location Location { get; private set; }\n\n\t\tpublic string Name { get; private set; }\n\n\t\t#endregion\n\n\t\tpublic Expression CreateReferenceExpression (ResolveContext rc, Location loc)\n\t\t{\n\t\t\t// \n\t\t\t// We know the variable name is somewhere in the scope. This generates\n\t\t\t// an access expression from current block\n\t\t\t//\n\t\t\tvar pb = rc.CurrentBlock.ParametersBlock;\n\t\t\twhile (true) {\n\t\t\t\tif (pb is QueryBlock) {\n\t\t\t\t\tfor (int i = pb.Parameters.Count - 1; i >= 0; --i) {\n\t\t\t\t\t\tvar p = pb.Parameters[i];\n\t\t\t\t\t\tif (p.Name == Name)\n\t\t\t\t\t\t\treturn pb.GetParameterReference (i, loc);\n\n\t\t\t\t\t\tExpression expr = null;\n\t\t\t\t\t\tvar tp = p as QueryBlock.TransparentParameter;\n\t\t\t\t\t\twhile (tp != null) {\n\t\t\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\t\t\texpr = pb.GetParameterReference (i, loc);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\texpr = new TransparentMemberAccess (expr, tp.Name);\n\n\t\t\t\t\t\t\tif (tp.Identifier == Name)\n\t\t\t\t\t\t\t\treturn new TransparentMemberAccess (expr, Name);\n\n\t\t\t\t\t\t\tif (tp.Parent.Name == Name)\n\t\t\t\t\t\t\t\treturn new TransparentMemberAccess (expr, Name);\n\n\t\t\t\t\t\t\ttp = tp.Parent as QueryBlock.TransparentParameter;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (pb == block)\n\t\t\t\t\treturn null;\n\n\t\t\t\tpb = pb.Parent.ParametersBlock;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class QueryStartClause : ARangeVariableQueryClause\n\t{\n\t\tpublic QueryStartClause (QueryBlock block, Expression expr, RangeVariable identifier, Location loc)\n\t\t\t: base (block, identifier, expr, loc)\n\t\t{\n\t\t\tblock.AddRangeVariable (identifier);\n\t\t}\n\n\t\tpublic override Expression BuildQueryClause (ResolveContext ec, Expression lSide, Parameter parameter)\n\t\t{\n\t\t\tif (IdentifierType != null)\n\t\t\t\texpr = CreateCastExpression (expr);\n\n\t\t\tif (parameter == null)\n\t\t\t\tlSide = expr;\n\n\t\t\treturn next.BuildQueryClause (ec, lSide, new ImplicitLambdaParameter (identifier.Name, identifier.Location));\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tExpression e = BuildQueryClause (ec, null, null);\n\t\t\treturn e.Resolve (ec);\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { throw new NotSupportedException (); }\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\n\tpublic class GroupBy : AQueryClause\n\t{\n\t\tExpression element_selector;\n\t\tQueryBlock element_block;\n\n\t\tpublic Expression ElementSelector {\n\t\t\tget { return this.element_selector; }\n\t\t}\n\n\t\tpublic GroupBy (QueryBlock block, Expression elementSelector, QueryBlock elementBlock, Expression keySelector, Location loc)\n\t\t\t: base (block, keySelector, loc)\n\t\t{\n\t\t\t//\n\t\t\t// Optimizes clauses like `group A by A'\n\t\t\t//\n\t\t\tif (!elementSelector.Equals (keySelector)) {\n\t\t\t\tthis.element_selector = elementSelector;\n\t\t\t\tthis.element_block = elementBlock;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression SelectorExpression {\n\t\t\tget {\n \t\t\t\treturn element_selector;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CreateArguments (ResolveContext ec, Parameter parameter, ref Arguments args)\n\t\t{\n\t\t\tbase.CreateArguments (ec, parameter, ref args);\n\n\t\t\tif (element_selector != null) {\n\t\t\t\tLambdaExpression lambda = new LambdaExpression (element_selector.Location);\n\n\t\t\t\telement_block.SetParameter (parameter.Clone ());\n\t\t\t\tlambda.Block = element_block;\n\t\t\t\tlambda.Block.AddStatement (new ContextualReturn (element_selector));\n\t\t\t\targs.Add (new Argument (lambda));\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tGroupBy t = (GroupBy) target;\n\t\t\tif (element_selector != null) {\n\t\t\t\tt.element_selector = element_selector.Clone (clonectx);\n\t\t\t\tt.element_block = (QueryBlock) element_block.Clone (clonectx);\n\t\t\t}\n\n\t\t\tbase.CloneTo (clonectx, t);\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"GroupBy\"; }\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Join : SelectMany\n\t{\n\t\tQueryBlock inner_selector, outer_selector;\n\n\t\tpublic RangeVariable JoinVariable {\n\t\t\tget { return this.GetIntoVariable (); }\n\t\t}\n\t\t\n\t\tpublic Join (QueryBlock block, RangeVariable lt, Expression inner, QueryBlock outerSelector, QueryBlock innerSelector, Location loc)\n\t\t\t: base (block, lt, inner, loc)\n\t\t{\n\t\t\tthis.outer_selector = outerSelector;\n\t\t\tthis.inner_selector = innerSelector;\n\t\t}\n\n\t\tpublic QueryBlock InnerSelector {\n\t\t\tget {\n\t\t\t\treturn inner_selector;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic QueryBlock OuterSelector {\n\t\t\tget {\n\t\t\t\treturn outer_selector;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CreateArguments (ResolveContext ec, Parameter parameter, ref Arguments args)\n\t\t{\n\t\t\targs = new Arguments (4);\n\n\t\t\tif (IdentifierType != null)\n\t\t\t\texpr = CreateCastExpression (expr);\n\n\t\t\targs.Add (new Argument (expr));\n\n\t\t\touter_selector.SetParameter (parameter.Clone ());\n\t\t\tvar lambda = new LambdaExpression (outer_selector.StartLocation);\n\t\t\tlambda.Block = outer_selector;\n\t\t\targs.Add (new Argument (lambda));\n\n\t\t\tinner_selector.SetParameter (new ImplicitLambdaParameter (identifier.Name, identifier.Location));\n\t\t\tlambda = new LambdaExpression (inner_selector.StartLocation);\n\t\t\tlambda.Block = inner_selector;\n\t\t\targs.Add (new Argument (lambda));\n\n\t\t\tbase.CreateArguments (ec, parameter, ref args);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression target)\n\t\t{\n\t\t\tJoin t = (Join) target;\n\t\t\tt.inner_selector = (QueryBlock) inner_selector.Clone (clonectx);\n\t\t\tt.outer_selector = (QueryBlock) outer_selector.Clone (clonectx);\n\t\t\tbase.CloneTo (clonectx, t);\n\t\t}\t\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"Join\"; }\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class GroupJoin : Join\n\t{\n\t\treadonly RangeVariable into;\n\n\t\tpublic GroupJoin (QueryBlock block, RangeVariable lt, Expression inner,\n\t\t\tQueryBlock outerSelector, QueryBlock innerSelector, RangeVariable into, Location loc)\n\t\t\t: base (block, lt, inner, outerSelector, innerSelector, loc)\n\t\t{\n\t\t\tthis.into = into;\n\t\t}\n\n\t\tprotected override RangeVariable GetIntoVariable ()\n\t\t{\n\t\t\treturn into;\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"GroupJoin\"; }\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Let : ARangeVariableQueryClause\n\t{\n\t\tpublic Let (QueryBlock block, RangeVariable identifier, Expression expr, Location loc)\n\t\t\t: base (block, identifier, expr, loc)\n\t\t{\n\t\t}\n\n\t\tprotected override void CreateArguments (ResolveContext ec, Parameter parameter, ref Arguments args)\n\t\t{\n\t\t\texpr = CreateRangeVariableType (ec, parameter, identifier, expr);\n\t\t\tbase.CreateArguments (ec, parameter, ref args);\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"Select\"; }\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Select : AQueryClause\n\t{\n\t\tpublic Select (QueryBlock block, Expression expr, Location loc)\n\t\t\t: base (block, expr, loc)\n\t\t{\n\t\t}\n\t\t\n\t\t//\n\t\t// For queries like `from a orderby a select a'\n\t\t// the projection is transparent and select clause can be safely removed \n\t\t//\n\t\tpublic bool IsRequired (Parameter parameter)\n\t\t{\n\t\t\tSimpleName sn = expr as SimpleName;\n\t\t\tif (sn == null)\n\t\t\t\treturn true;\n\n\t\t\treturn sn.Name != parameter.Name;\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"Select\"; }\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t}\n\n\tpublic class SelectMany : ARangeVariableQueryClause\n\t{\n\t\tpublic SelectMany (QueryBlock block, RangeVariable identifier, Expression expr, Location loc)\n\t\t\t: base (block, identifier, expr, loc)\n\t\t{\n\t\t}\n\n\t\tprotected override void CreateArguments (ResolveContext ec, Parameter parameter, ref Arguments args)\n\t\t{\n\t\t\tif (args == null) {\n\t\t\t\tif (IdentifierType != null)\n\t\t\t\t\texpr = CreateCastExpression (expr);\n\n\t\t\t\tbase.CreateArguments (ec, parameter.Clone (), ref args);\n\t\t\t}\n\n\t\t\tExpression result_selector_expr;\n\t\t\tQueryBlock result_block;\n\n\t\t\tvar target = GetIntoVariable ();\n\t\t\tvar target_param = new ImplicitLambdaParameter (target.Name, target.Location);\n\n\t\t\t//\n\t\t\t// When select follows use it as a result selector\n\t\t\t//\n\t\t\tif (next is Select) {\n\t\t\t\tresult_selector_expr = next.Expr;\n\n\t\t\t\tresult_block = next.block;\n\t\t\t\tresult_block.SetParameters (parameter, target_param);\n\n\t\t\t\tnext = next.next;\n\t\t\t} else {\n\t\t\t\tresult_selector_expr = CreateRangeVariableType (ec, parameter, target, new SimpleName (target.Name, target.Location));\n\n\t\t\t\tresult_block = new QueryBlock (block.Parent, block.StartLocation);\n\t\t\t\tresult_block.SetParameters (parameter, target_param);\n\t\t\t}\n\n\t\t\tLambdaExpression result_selector = new LambdaExpression (Location);\n\t\t\tresult_selector.Block = result_block;\n\t\t\tresult_selector.Block.AddStatement (new ContextualReturn (result_selector_expr));\n\n\t\t\targs.Add (new Argument (result_selector));\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"SelectMany\"; }\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Where : AQueryClause\n\t{\n\t\tpublic Where (QueryBlock block, Expression expr, Location loc)\n\t\t\t: base (block, expr, loc)\n\t\t{\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"Where\"; }\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class OrderByAscending : AQueryClause\n\t{\n\t\tpublic OrderByAscending (QueryBlock block, Expression expr)\n\t\t\t: base (block, expr, expr.Location)\n\t\t{\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"OrderBy\"; }\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class OrderByDescending : AQueryClause\n\t{\n\t\tpublic OrderByDescending (QueryBlock block, Expression expr)\n\t\t\t: base (block, expr, expr.Location)\n\t\t{\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"OrderByDescending\"; }\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ThenByAscending : OrderByAscending\n\t{\n\t\tpublic ThenByAscending (QueryBlock block, Expression expr)\n\t\t\t: base (block, expr)\n\t\t{\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"ThenBy\"; }\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ThenByDescending : OrderByDescending\n\t{\n\t\tpublic ThenByDescending (QueryBlock block, Expression expr)\n\t\t\t: base (block, expr)\n\t\t{\n\t\t}\n\n\t\tprotected override string MethodName {\n\t\t\tget { return \"ThenByDescending\"; }\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// Implicit query block\n\t//\n\tpublic class QueryBlock : ParametersBlock\n\t{\n\t\t//\n\t\t// Transparent parameters are used to package up the intermediate results\n\t\t// and pass them onto next clause\n\t\t//\n\t\tpublic sealed class TransparentParameter : ImplicitLambdaParameter\n\t\t{\n\t\t\tpublic static int Counter;\n\t\t\tconst string ParameterNamePrefix = \"<>__TranspIdent\";\n\n\t\t\tpublic readonly Parameter Parent;\n\t\t\tpublic readonly string Identifier;\n\n\t\t\tpublic TransparentParameter (Parameter parent, RangeVariable identifier)\n\t\t\t\t: base (ParameterNamePrefix + Counter++, identifier.Location)\n\t\t\t{\n\t\t\t\tParent = parent;\n\t\t\t\tIdentifier = identifier.Name;\n\t\t\t}\n\n\t\t\tpublic static void Reset ()\n\t\t\t{\n\t\t\t\tCounter = 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic QueryBlock (Block parent, Location start)\n\t\t\t: base (parent, ParametersCompiled.EmptyReadOnlyParameters, start, Flags.CompilerGenerated)\n\t\t{\n\t\t}\n\n\t\tpublic void AddRangeVariable (RangeVariable variable)\n\t\t{\n\t\t\tvariable.Block = this;\n\t\t\tTopBlock.AddLocalName (variable.Name, variable, true);\n\t\t}\n\n\t\tpublic override void Error_AlreadyDeclared (string name, INamedBlockVariable variable, string reason)\n\t\t{\n\t\t\tTopBlock.Report.Error (1931, variable.Location,\n\t\t\t\t\"A range variable `{0}' conflicts with a previous declaration of `{0}'\",\n\t\t\t\tname);\n\t\t}\n\n\t\tpublic override void Error_AlreadyDeclared (string name, INamedBlockVariable variable)\n\t\t{\n\t\t\tTopBlock.Report.Error (1930, variable.Location,\n\t\t\t\t\"A range variable `{0}' has already been declared in this scope\",\n\t\t\t\tname);\t\t\n\t\t}\n\n\t\tpublic override void Error_AlreadyDeclaredTypeParameter (string name, Location loc)\n\t\t{\n\t\t\tTopBlock.Report.Error (1948, loc,\n\t\t\t\t\"A range variable `{0}' conflicts with a method type parameter\",\n\t\t\t\tname);\n\t\t}\n\n\t\tpublic void SetParameter (Parameter parameter)\n\t\t{\n\t\t\tbase.parameters = new ParametersCompiled (parameter);\n\t\t\tbase.parameter_info = new ParameterInfo[] {\n\t\t\t\tnew ParameterInfo (this, 0)\n\t\t\t};\n\t\t}\n\n\t\tpublic void SetParameters (Parameter first, Parameter second)\n\t\t{\n\t\t\tbase.parameters = new ParametersCompiled (first, second);\n\t\t\tbase.parameter_info = new ParameterInfo[] {\n\t\t\t\tnew ParameterInfo (this, 0),\n\t\t\t\tnew ParameterInfo (this, 1)\n\t\t\t};\n\t\t}\n\t}\n\n\tsealed class TransparentMemberAccess : MemberAccess\n\t{\n\t\tpublic TransparentMemberAccess (Expression expr, string name)\n\t\t\t: base (expr, name)\n\t\t{\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext rc, Expression right_side)\n\t\t{\n\t\t\trc.Report.Error (1947, loc,\n\t\t\t\t\"A range variable `{0}' cannot be assigned to. Consider using `let' clause to store the value\",\n\t\t\t\tName);\n\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/literal.cs",
    "content": "//\n// literal.cs: Literal representation for the IL tree.\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@seznam.cz)\n//\n// Copyright 2001 Ximian, Inc.\n// Copyright 2011 Xamarin Inc\n//\n//\n// Notice that during parsing we create objects of type Literal, but the\n// types are not loaded (thats why the Resolve method has to assign the\n// type at that point).\n//\n// Literals differ from the constants in that we know we encountered them\n// as a literal in the source code (and some extra rules apply there) and\n// they have to be resolved (since during parsing we have not loaded the\n// types yet) while constants are created only after types have been loaded\n// and are fully resolved when born.\n//\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\tpublic interface ILiteralConstant\n\t{\n#if FULL_AST\n\t\tchar[] ParsedValue { get; set; }\n#endif\n\t}\n\n\t//\n\t// The null literal\n\t//\n\t// Note: C# specification null-literal is NullLiteral of NullType type\n\t//\n\tpublic class NullLiteral : NullConstant\n\t{\n\t\t//\n\t\t// Default type of null is an object\n\t\t//\n\t\tpublic NullLiteral (Location loc)\n\t\t\t: base (InternalType.NullLiteral, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec t, bool expl)\n\t\t{\n\t\t\tif (t.IsGenericParameter) {\n\t\t\t\tec.Report.Error(403, loc,\n\t\t\t\t\t\"Cannot convert null to the type parameter `{0}' because it could be a value \" +\n\t\t\t\t\t\"type. Consider using `default ({0})' instead\", t.Name);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (TypeSpec.IsValueType (t)) {\n\t\t\t\tec.Report.Error(37, loc, \"Cannot convert null to `{0}' because it is a value type\",\n\t\t\t\t\tt.GetSignatureForError ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.Error_ValueCannotBeConverted (ec, t, expl);\n\t\t}\n\n\t\tpublic override string GetValueAsLiteral ()\n\t\t{\n\t\t\treturn \"null\";\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn System.Linq.Expressions.Expression.Constant (null);\n\t\t}\n\t}\n\n\tpublic class BoolLiteral : BoolConstant, ILiteralConstant\n\t{\n\t\tpublic BoolLiteral (BuiltinTypes types, bool val, Location loc)\n\t\t\t: base (types, val, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class CharLiteral : CharConstant, ILiteralConstant\n\t{\n\t\tpublic CharLiteral (BuiltinTypes types, char c, Location loc)\n\t\t\t: base (types, c, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class IntLiteral : IntConstant, ILiteralConstant\n\t{\n\t\tpublic IntLiteral (BuiltinTypes types, int l, Location loc)\n\t\t\t: base (types, l, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override Constant ConvertImplicitly (TypeSpec type)\n\t\t{\n\t\t\t//\n\t\t\t// The 0 literal can be converted to an enum value\n\t\t\t//\n\t\t\tif (Value == 0 && type.IsEnum) {\n\t\t\t\tConstant c = ConvertImplicitly (EnumSpec.GetUnderlyingType (type));\n\t\t\t\tif (c == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new EnumConstant (c, type);\n\t\t\t}\n\n\t\t\treturn base.ConvertImplicitly (type);\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class UIntLiteral : UIntConstant, ILiteralConstant\n\t{\n\t\tpublic UIntLiteral (BuiltinTypes types, uint l, Location loc)\n\t\t\t: base (types, l, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class LongLiteral : LongConstant, ILiteralConstant\n\t{\n\t\tpublic LongLiteral (BuiltinTypes types, long l, Location loc)\n\t\t\t: base (types, l, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ULongLiteral : ULongConstant, ILiteralConstant\n\t{\n\t\tpublic ULongLiteral (BuiltinTypes types, ulong l, Location loc)\n\t\t\t: base (types, l, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class FloatLiteral : FloatConstant, ILiteralConstant\n\t{\n\t\tpublic FloatLiteral (BuiltinTypes types, float f, Location loc)\n\t\t\t: base (types, f, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class DoubleLiteral : DoubleConstant, ILiteralConstant\n\t{\n\t\tpublic DoubleLiteral (BuiltinTypes types, double d, Location loc)\n\t\t\t: base (types, d, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)\n\t\t{\n\t\t\tif (target.BuiltinType == BuiltinTypeSpec.Type.Float) {\n\t\t\t\tError_664 (ec, loc, \"float\", \"f\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (target.BuiltinType == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\tError_664 (ec, loc, \"decimal\", \"m\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.Error_ValueCannotBeConverted (ec, target, expl);\n\t\t}\n\n\t\tstatic void Error_664 (ResolveContext ec, Location loc, string type, string suffix)\n\t\t{\n\t\t\tec.Report.Error (664, loc,\n\t\t\t\t\"Literal of type double cannot be implicitly converted to type `{0}'. Add suffix `{1}' to create a literal of this type\",\n\t\t\t\ttype, suffix);\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class DecimalLiteral : DecimalConstant, ILiteralConstant\n\t{\n\t\tpublic DecimalLiteral (BuiltinTypes types, decimal d, Location loc)\n\t\t\t: base (types, d, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class StringLiteral : StringConstant, ILiteralConstant\n\t{\n\t\tpublic StringLiteral (BuiltinTypes types, string s, Location loc)\n\t\t\t: base (types, s, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsLiteral {\n\t\t\tget { return true; }\n\t\t}\n\n#if FULL_AST\n\t\tpublic char[] ParsedValue { get; set; }\n#endif\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/location.cs",
    "content": "//\n// location.cs: Keeps track of the location of source code entity\n//\n// Author:\n//   Miguel de Icaza\n//   Atsushi Enomoto  <atsushi@ximian.com>\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001 Ximian, Inc.\n// Copyright 2005 Novell, Inc.\n//\n\nusing System;\nusing System.Collections.Generic;\nusing Mono.CompilerServices.SymbolWriter;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace Mono.CSharp\n{\n\t//\n\t//  This is one single source file.\n\t//\n\tpublic class SourceFile : IEquatable<SourceFile>\n\t{\n\t\t//\n\t\t// Used by #line directive to track hidden sequence point\n\t\t// regions\n\t\t//\n\t\tstruct LocationRegion : IComparable<LocationRegion>\n\t\t{\n\t\t\tpublic readonly Location Start;\n\t\t\tpublic readonly Location End;\n\n\t\t\tpublic LocationRegion (Location start, Location end)\n\t\t\t{\n\t\t\t\tthis.Start = start;\n\t\t\t\tthis.End = end;\n\t\t\t}\n\n\t\t\tpublic int CompareTo (LocationRegion other)\n\t\t\t{\n\t\t\t\tif (Start.Row == other.Start.Row)\n\t\t\t\t\treturn Start.Column.CompareTo (other.Start.Column);\n\n\t\t\t\treturn Start.Row.CompareTo (other.Start.Row);\n\t\t\t}\n\n\t\t\tpublic override string ToString ()\n\t\t\t{\n\t\t\t\treturn Start.ToString () + \" - \" + End.ToString ();\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly byte[] MD5Algorith = { 96, 166, 110, 64, 207, 100, 130, 76, 182, 240, 66, 212, 129, 114, 167, 153 };\n\n\t\tpublic readonly string Name;\n\t\tpublic readonly string FullPathName;\n\t\tpublic readonly int Index;\n\t\tpublic bool AutoGenerated;\n\n\t\tSourceFileEntry file;\n\t\tbyte[] algGuid, checksum;\n\t\tList<LocationRegion> hidden_lines;\n\n\t\tpublic SourceFile (string name, string path, int index)\n\t\t{\n\t\t\tthis.Index = index;\n\t\t\tthis.Name = name;\n\t\t\tthis.FullPathName = path;\n\t\t}\n\n\t\tpublic byte[] Checksum {\n\t\t\tget {\n\t\t\t\treturn checksum;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasChecksum {\n\t\t\tget {\n\t\t\t\treturn checksum != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic SourceFileEntry SourceFileEntry {\n\t\t\tget {\n\t\t\t\treturn file;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetChecksum (byte[] checksum)\n\t\t{\n\t\t\tSetChecksum (MD5Algorith, checksum);\n\t\t}\n\n\t\tpublic void SetChecksum (byte[] algorithmGuid, byte[] checksum)\n\t\t{\n\t\t\tthis.algGuid = algorithmGuid;\n\t\t\tthis.checksum = checksum;\n\t\t}\n\n\t\tpublic SourceFileEntry CreateSymbolInfo (MonoSymbolFile symwriter)\n\t\t{\n\t\t\tif (hidden_lines != null)\n\t\t\t\thidden_lines.Sort ();\n\n\t\t\tfile = new SourceFileEntry (symwriter, FullPathName, algGuid, checksum);\n\t\t\tif (AutoGenerated)\n\t\t\t\tfile.SetAutoGenerated ();\n\n\t\t\treturn file;\n\t\t}\n\n\t\tpublic bool Equals (SourceFile other)\n\t\t{\n\t\t\treturn FullPathName == other.FullPathName;\n\t\t}\n\n\t\tpublic bool IsHiddenLocation (Location loc)\n\t\t{\n\t\t\tif (hidden_lines == null)\n\t\t\t\treturn false;\n\n\t\t\tint index = hidden_lines.BinarySearch (new LocationRegion (loc, loc));\n\t\t\tindex = ~index;\n\t\t\tif (index > 0) {\n\t\t\t\tvar found = hidden_lines[index - 1];\n\t\t\t\tif (loc.Row < found.End.Row)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void RegisterHiddenScope (Location start, Location end)\n\t\t{\n\t\t\tif (hidden_lines == null)\n\t\t\t\thidden_lines = new List<LocationRegion> ();\n\n\t\t\thidden_lines.Add (new LocationRegion (start, end));\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"SourceFile ({0}:{1}:{2})\", Name, FullPathName, Index);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Keeps track of the location in the program\n\t/// </summary>\n\t///\n\t/// <remarks>\n\t///   This uses a compact representation and a couple of auxiliary\n\t///   structures to keep track of tokens to (file,line and column) \n\t///   mappings. The usage of the bits is:\n\t///   \n\t///     - 16 bits for \"checkpoint\" which is a mixed concept of\n\t///       file and \"line segment\"\n\t///     - 8 bits for line delta (offset) from the line segment\n\t///     - 8 bits for column number.\n\t///\n\t///   http://lists.ximian.com/pipermail/mono-devel-list/2004-December/009508.html\n\t/// </remarks>\n\tpublic struct Location : IEquatable<Location>\n\t{\n\t\tstruct Checkpoint {\n\t\t\tpublic readonly int LineOffset;\n\t\t\tpublic readonly int File;\n\n\t\t\tpublic Checkpoint (int file, int line)\n\t\t\t{\n\t\t\t\tFile = file;\n\t\t\t\tLineOffset = line - (int) (line % (1 << line_delta_bits));\n\t\t\t}\n\t\t}\n\n#if FULL_AST\n\t\treadonly long token;\n\n\t\tconst int column_bits = 24;\n\t\tconst int line_delta_bits = 24;\n#else\n\t\treadonly int token;\n\n\t\tconst int column_bits = 8;\n\t\tconst int line_delta_bits = 8;\n#endif\n\t\tconst int checkpoint_bits = 16;\n\n\t\tconst int column_mask = (1 << column_bits) - 1;\n\t\tconst int max_column = column_mask;\n\n\t\tstatic List<SourceFile> source_list;\n\t\tstatic Checkpoint [] checkpoints;\n\t\tstatic int checkpoint_index;\n\t\t\n\t\tpublic readonly static Location Null = new Location ();\n\t\tpublic static bool InEmacs;\n\t\t\n\t\tstatic Location ()\n\t\t{\n\t\t\tReset ();\n\t\t}\n\n\t\tpublic static void Reset ()\n\t\t{\n\t\t\tsource_list = new List<SourceFile> ();\n\t\t\tcheckpoint_index = 0;\n\t\t}\n\n\t\tpublic static void AddFile (SourceFile file)\n\t\t{\n\t\t\tsource_list.Add (file);\n\t\t}\n\n\t\t// <summary>\n\t\t//   After adding all source files we want to compile with AddFile(), this method\n\t\t//   must be called to `reserve' an appropriate number of bits in the token for the\n\t\t//   source file.  We reserve some extra space for files we encounter via #line\n\t\t//   directives while parsing.\n\t\t// </summary>\n\t\tstatic public void Initialize (List<SourceFile> files)\n\t\t{\n#if NET_4_0 || MOBILE_DYNAMIC\n\t\t\tsource_list.AddRange (files);\n#else\n\t\t\tsource_list.AddRange (files.ToArray ());\n#endif\n\n\t\t\tcheckpoints = new Checkpoint [System.Math.Max (1, source_list.Count * 2)];\n\t\t\tif (checkpoints.Length > 0)\n\t\t\t\tcheckpoints [0] = new Checkpoint (0, 0);\n\t\t}\n\n\t\tpublic Location (SourceFile file, int row, int column)\n\t\t{\n\t\t\tif (row <= 0)\n\t\t\t\ttoken = 0;\n\t\t\telse {\n\t\t\t\tif (column > max_column)\n\t\t\t\t\tcolumn = max_column;\n\n\t\t\t\tlong target = -1;\n\t\t\t\tlong delta = 0;\n\n\t\t\t\t// TODO: For eval only, need better handling of empty\n\t\t\t\tint file_index = file == null ? 0 : file.Index;\n\n\t\t\t\t// FIXME: This value is certainly wrong but what was the intension\n\t\t\t\tint max = checkpoint_index < 10 ?\n\t\t\t\t\tcheckpoint_index : 10;\n\t\t\t\tfor (int i = 0; i < max; i++) {\n\t\t\t\t\tint offset = checkpoints [checkpoint_index - i].LineOffset;\n\t\t\t\t\tdelta = row - offset;\n\t\t\t\t\tif (delta >= 0 &&\n\t\t\t\t\t\tdelta < (1 << line_delta_bits) &&\n\t\t\t\t\t\tcheckpoints[checkpoint_index - i].File == file_index) {\n\t\t\t\t\t\ttarget = checkpoint_index - i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (target == -1) {\n\t\t\t\t\tAddCheckpoint (file_index, row);\n\t\t\t\t\ttarget = checkpoint_index;\n\t\t\t\t\tdelta = row % (1 << line_delta_bits);\n\t\t\t\t}\n\n\t\t\t\tlong l = column +\n\t\t\t\t\t(delta << column_bits) +\n\t\t\t\t\t(target << (line_delta_bits + column_bits));\n#if FULL_AST\n\t\t\t\ttoken = l;\n#else\n\t\t\t\ttoken = l > 0xFFFFFFFF ? 0 : (int) l;\n#endif\n\t\t\t}\n\t\t}\n\n\t\tpublic static Location operator - (Location loc, int columns)\n\t\t{\n\t\t\treturn new Location (loc.SourceFile, loc.Row, loc.Column - columns);\n\t\t}\n\n\t\tstatic void AddCheckpoint (int file, int row)\n\t\t{\n\t\t\tif (checkpoints.Length == ++checkpoint_index) {\n\t\t\t\tArray.Resize (ref checkpoints, checkpoint_index * 2);\n\t\t\t}\n\t\t\tcheckpoints [checkpoint_index] = new Checkpoint (file, row);\n\t\t}\n\n\t\tstring FormatLocation (string fileName)\n\t\t{\n\t\t\tif (column_bits == 0 || InEmacs)\n\t\t\t\treturn fileName + \"(\" + Row.ToString () + \"):\";\n\n\t\t\treturn fileName + \"(\" + Row.ToString () + \",\" + Column.ToString () +\n\t\t\t\t(Column == max_column ? \"+):\" : \"):\");\n\t\t}\n\t\t\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn FormatLocation (Name);\n\t\t}\n\n\t\tpublic string ToStringFullName ()\n\t\t{\n\t\t\treturn FormatLocation (NameFullPath);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///   Whether the Location is Null\n\t\t/// </summary>\n\t\tpublic bool IsNull {\n\t\t\tget { return token == 0; }\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\tint index = File;\n\n\t\t\t\tif (token == 0 || index <= 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tSourceFile file = source_list [index - 1];\n\t\t\t\treturn file.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic string NameFullPath {\n\t\t\tget {\n\t\t\t\tint index = File;\n\t\t\t\tif (token == 0 || index <= 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn source_list[index - 1].FullPathName;\n\t\t\t}\n\t\t}\n\n\t\tint CheckpointIndex {\n\t\t\tget {\n\t\t\t\tconst int checkpoint_mask = (1 << checkpoint_bits) - 1;\n\t\t\t\treturn ((int) (token >> (line_delta_bits + column_bits))) & checkpoint_mask;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Row {\n\t\t\tget {\n\t\t\t\tif (token == 0)\n\t\t\t\t\treturn 1;\n\n\t\t\t\tint offset = checkpoints[CheckpointIndex].LineOffset;\n\n\t\t\t\tconst int line_delta_mask = (1 << column_bits) - 1;\n\t\t\t\treturn offset + (((int)(token >> column_bits)) & line_delta_mask);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Column {\n\t\t\tget {\n\t\t\t\tif (token == 0)\n\t\t\t\t\treturn 1;\n\t\t\t\treturn (int) (token & column_mask);\n\t\t\t}\n\t\t}\n\n\t\tpublic int File {\n\t\t\tget {\n\t\t\t\tif (token == 0)\n\t\t\t\t\treturn 0;\nif (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format (\"Should not happen. Token is {0:X04}, checkpoints are {1}, index is {2}\", token, checkpoints.Length, CheckpointIndex));\n\t\t\t\treturn checkpoints [CheckpointIndex].File;\n\t\t\t}\n\t\t}\n\n\t\t// The ISymbolDocumentWriter interface is used by the symbol writer to\n\t\t// describe a single source file - for each source file there's exactly\n\t\t// one corresponding ISymbolDocumentWriter instance.\n\t\t//\n\t\t// This class has an internal hash table mapping source document names\n\t\t// to such ISymbolDocumentWriter instances - so there's exactly one\n\t\t// instance per document.\n\t\t//\n\t\t// This property returns the ISymbolDocumentWriter instance which belongs\n\t\t// to the location's source file.\n\t\t//\n\t\t// If we don't have a symbol writer, this property is always null.\n\t\tpublic SourceFile SourceFile {\n\t\t\tget {\n\t\t\t\tint index = File;\n\t\t\t\tif (index == 0)\n\t\t\t\t\treturn null;\n\t\t\t\treturn source_list [index - 1];\n\t\t\t}\n\t\t}\n\n\t\t#region IEquatable<Location> Members\n\n\t\tpublic bool Equals (Location other)\n\t\t{\n\t\t\treturn this.token == other.token;\n\t\t}\n\n\t\t#endregion\n\t}\n\t\n\tpublic class SpecialsBag\n\t{\n\t\tpublic enum CommentType\n\t\t{\n\t\t\tSingle,\n\t\t\tMulti,\n\t\t\tDocumentation,\n\t\t\tInactiveCode\n\t\t}\n\n\t\tpublic bool Suppress {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic class SpecialVisitor\n\t\t{\n\t\t\tpublic virtual void Visit (Comment comment)\n\t\t\t{\n\t\t\t}\n\t\t\tpublic virtual void Visit (NewLineToken newLineToken)\n\t\t\t{\n\t\t\t}\n\t\t\tpublic virtual void Visit (PreProcessorDirective preProcessorDirective)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\tpublic abstract class SpecialBase\n\t\t{\n\t\t\tpublic abstract void Accept (SpecialVisitor visitor);\n\t\t}\n\t\t\n\t\tpublic class Comment : SpecialBase\n\t\t{\n\t\t\tpublic readonly CommentType CommentType;\n\t\t\tpublic readonly bool StartsLine;\n\t\t\tpublic readonly int Line;\n\t\t\tpublic readonly int Col;\n\t\t\tpublic readonly int EndLine;\n\t\t\tpublic readonly int EndCol;\n\t\t\tpublic readonly string Content;\n\t\t\t\n\t\t\tpublic Comment (CommentType commentType, bool startsLine, int line, int col, int endLine, int endCol, string content)\n\t\t\t{\n\t\t\t\tthis.CommentType = commentType;\n\t\t\t\tthis.StartsLine = startsLine;\n\t\t\t\tthis.Line = line;\n\t\t\t\tthis.Col = col;\n\t\t\t\tthis.EndLine = endLine;\n\t\t\t\tthis.EndCol = endCol;\n\t\t\t\tthis.Content = content;\n\t\t\t}\n\n\t\t\tpublic override string ToString ()\n\t\t\t{\n\t\t\t\treturn string.Format (\"[Comment: CommentType={0}, Line={1}, Col={2}, EndLine={3}, EndCol={4}, Content={5}]\", CommentType, Line, Col, EndLine, EndCol, Content);\n\t\t\t}\n\n\t\t\tpublic override void Accept (SpecialVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.Visit (this);\n\t\t\t}\n\t\t}\n\n\t\tpublic class NewLineToken : SpecialBase\n\t\t{\n\t\t\tpublic readonly int Line;\n\t\t\tpublic readonly int Col;\n\t\t\tpublic readonly NewLine NewLine;\n\n\t\t\tpublic NewLineToken (int line, int col, NewLine newLine)\n\t\t\t{\n\t\t\t\tthis.Line = line;\n\t\t\t\tthis.Col = col;\n\t\t\t\tthis.NewLine = newLine;\n\t\t\t}\n\n\t\t\tpublic override void Accept (SpecialVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.Visit (this);\n\t\t\t}\n\t\t}\n\n\t\tpublic class PragmaPreProcessorDirective : PreProcessorDirective\n\t\t{\n\t\t\tpublic bool Disalbe { get; set; }\n\n\t\t\tpublic int WarningColumn {\n\t\t\t\tget;\n\t\t\t\tset;\n\t\t\t}\n\n\t\t\tpublic int DisableRestoreColumn {\n\t\t\t\tget;\n\t\t\t\tset;\n\t\t\t}\n\n\t\t\tpublic List<Constant> Codes = new List<Constant> ();\n\n\t\t\tpublic PragmaPreProcessorDirective (int line, int col, int endLine, int endCol, Tokenizer.PreprocessorDirective cmd, string arg) : base (line, col, endLine, endCol, cmd, arg)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\tpublic class LineProcessorDirective : PreProcessorDirective\n\t\t{\n\t\t\tpublic int LineNumber { get; set; }\n\t\t\tpublic string FileName { get; set; }\n\n\t\t\tpublic LineProcessorDirective (int line, int col, int endLine, int endCol, Tokenizer.PreprocessorDirective cmd, string arg) : base (line, col, endLine, endCol, cmd, arg)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\tpublic class PreProcessorDirective : SpecialBase\n\t\t{\n\t\t\tpublic readonly int Line;\n\t\t\tpublic readonly int Col;\n\t\t\tpublic readonly int EndLine;\n\t\t\tpublic readonly int EndCol;\n\n\t\t\tpublic readonly Tokenizer.PreprocessorDirective Cmd;\n\t\t\tpublic readonly string Arg;\n\t\t\t\n\t\t\tpublic bool Take = true;\n\t\t\t\n\t\t\tpublic PreProcessorDirective (int line, int col, int endLine, int endCol, Tokenizer.PreprocessorDirective cmd, string arg)\n\t\t\t{\n\t\t\t\tthis.Line = line;\n\t\t\t\tthis.Col = col;\n\t\t\t\tthis.EndLine = endLine;\n\t\t\t\tthis.EndCol = endCol;\n\t\t\t\tthis.Cmd = cmd;\n\t\t\t\tthis.Arg = arg;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void Accept (SpecialVisitor visitor)\n\t\t\t{\n\t\t\t\tvisitor.Visit (this);\n\t\t\t}\n\n\t\t\tpublic override string ToString ()\n\t\t\t{\n\t\t\t\treturn string.Format (\"[PreProcessorDirective: Line={0}, Col={1}, EndLine={2}, EndCol={3}, Cmd={4}, Arg={5}]\", Line, Col, EndLine, EndCol, Cmd, Arg);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic readonly List<SpecialBase> Specials = new List<SpecialBase> ();\n\t\t\n\t\tCommentType curComment;\n\t\tbool startsLine;\n\t\tint startLine, startCol;\n\t\tSystem.Text.StringBuilder contentBuilder = new System.Text.StringBuilder ();\n\t\t\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void StartComment (CommentType type, bool startsLine, int startLine, int startCol)\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn;\n\t\t\tinComment = true;\n\t\t\tcurComment = type;\n\t\t\tthis.startsLine = startsLine;\n\t\t\tthis.startLine = startLine;\n\t\t\tthis.startCol = startCol;\n\t\t\tcontentBuilder.Length = 0;\n\t\t}\n\t\t\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void PushCommentChar (int ch)\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn;\n\t\t\tif (ch < 0)\n\t\t\t\treturn;\n\t\t\tcontentBuilder.Append ((char)ch);\n\t\t}\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void PushCommentString (string str)\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn;\n\t\t\tcontentBuilder.Append (str);\n\t\t}\n\t\t\n\t\tbool inComment;\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void EndComment (int endLine, int endColumn)\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn;\n\t\t\tif (!inComment)\n\t\t\t\treturn;\n\t\t\tinComment = false;\n\t\t\t// Ignore empty comments\n\t\t\tif (startLine == endLine && startCol == endColumn)\n\t\t\t\treturn;\n\t\t\tSpecials.Add (new Comment (curComment, startsLine, startLine, startCol, endLine, endColumn, contentBuilder.ToString ()));\n\t\t}\n\t\t\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AddPreProcessorDirective (int startLine, int startCol, int endLine, int endColumn, Tokenizer.PreprocessorDirective cmd, string arg)\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn;\n\t\t\tif (inComment)\n\t\t\t\tEndComment (startLine, startCol);\n\t\t\tswitch (cmd) {\n\t\t\tcase Tokenizer.PreprocessorDirective.Pragma:\n\t\t\t\tSpecials.Add (new PragmaPreProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg));\n\t\t\t\tbreak;\n\t\t\tcase Tokenizer.PreprocessorDirective.Line:\n\t\t\t\tSpecials.Add (new LineProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSpecials.Add (new PreProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t#if FULL_AST\n\t\tpublic PragmaPreProcessorDirective SetPragmaDisable(bool disable)\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn null;\n\t\t\tvar pragmaDirective = Specials [Specials.Count - 1] as PragmaPreProcessorDirective;\n\t\t\tif (pragmaDirective == null)\n\t\t\t\treturn null;\n\t\t\tpragmaDirective.Disalbe = disable;\n\t\t\treturn pragmaDirective;\n\t\t}\n\t\t#endif\n\n\t\tpublic PragmaPreProcessorDirective GetPragmaPreProcessorDirective()\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn null;\n\t\t\treturn Specials [Specials.Count - 1] as PragmaPreProcessorDirective;\n\t\t}\n\n\n\t\tpublic LineProcessorDirective GetCurrentLineProcessorDirective()\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn null;\n\t\t\treturn Specials [Specials.Count - 1] as LineProcessorDirective;\n\t\t}\n\n\t\tpublic enum NewLine { Unix, Windows }\n\n\t\tint lastNewLine = -1;\n\t\tint lastNewCol = -1;\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AddNewLine (int line, int col, NewLine newLine)\n\t\t{\n\t\t\tif (Suppress)\n\t\t\t\treturn;\n\t\t\tif (line == lastNewLine && col == lastNewCol)\n\t\t\t\treturn;\n\t\t\tlastNewLine = line;\n\t\t\tlastNewCol = col;\n\t\t\tSpecials.Add (new NewLineToken (line, col, newLine));\n\t\t}\n\n\t\tpublic void SkipIf ()\n\t\t{\n\t\t\tif (Specials.Count > 0) {\n\t\t\t\tvar directive = Specials[Specials.Count - 1] as PreProcessorDirective;\n\t\t\t\tif (directive != null)\n\t\t\t\t\tdirective.Take = false;\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// A bag of additional locations to support full ast tree\n\t//\n\tpublic class LocationsBag\n\t{\n\t\tpublic class MemberLocations\n\t\t{\n\t\t\tpublic IList<Tuple<Modifiers, Location>> Modifiers { get; internal set; }\n\t\t\tList<Location> locations;\n\t\t\t\n\t\t\tpublic MemberLocations (IList<Tuple<Modifiers, Location>> mods, IEnumerable<Location> locs)\n\t\t\t{\n\t\t\t\tModifiers = mods;\n\t\t\t\tlocations = locs != null ?  new List<Location> (locs) : null;\n/*\n\t\t\tpublic readonly IList<Tuple<Modifiers, Location>> Modifiers;\n\t\t\tList<Location> locations;\n\n\t\t\tpublic MemberLocations (IList<Tuple<Modifiers, Location>> mods)\n\t\t\t{\n\t\t\t\tModifiers = mods;\n\t\t\t}\n\n\t\t\tpublic MemberLocations (IList<Tuple<Modifiers, Location>> mods, Location loc)\n\t\t\t\t: this (mods)\n\t\t\t{\n\t\t\t\tAddLocations (loc);\n\t\t\t}\n\n\t\t\tpublic MemberLocations (IList<Tuple<Modifiers, Location>> mods, Location[] locs)\n\t\t\t\t: this (mods)\n\t\t\t{\n\t\t\t\tAddLocations (locs);\n\t\t\t}\n\n\t\t\tpublic MemberLocations (IList<Tuple<Modifiers, Location>> mods, List<Location> locs)\n\t\t\t\t: this (mods)\n\t\t\t{\n\t\t\t\tlocations = locs;*/\n\t\t\t}\n\n\t\t\t#region Properties\n\n\t\t\tpublic Location this [int index] {\n\t\t\t\tget {\n\t\t\t\t\treturn locations [index];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Count {\n\t\t\t\tget {\n\t\t\t\t\treturn locations != null ? locations.Count : 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\tpublic void AddLocations (Location loc)\n\t\t\t{\n\t\t\t\tif (locations == null) {\n\t\t\t\t\tlocations = new List<Location> ();\n\t\t\t\t}\n\n\t\t\t\tlocations.Add (loc);\n\t\t\t}\n\n\t\t\tpublic void AddLocations (params Location[] additional)\n\n\t\t\t{\n\n\t\t\t\tAddLocations ((IEnumerable<Location>)additional);\n\n\t\t\t}\n\t\t\tpublic void AddLocations (IEnumerable<Location> additional)\n\t\t\t{\n\t\t\t\tif (additional == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (locations == null) {\n\t\t\t\t\tlocations = new List<Location> (additional);\n\t\t\t\t} else {\n\t\t\t\t\tlocations.AddRange (additional);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic MemberCore LastMember {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\tDictionary<object, List<Location>> simple_locs = new Dictionary<object, List<Location>> (ReferenceEquality<object>.Default);\n\t\tDictionary<MemberCore, MemberLocations> member_locs = new Dictionary<MemberCore, MemberLocations> (ReferenceEquality<MemberCore>.Default);\n\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AddLocation (object element, params Location[] locations)\n\t\t{\n\t\t\tAddLocation (element, (IEnumerable<Location>)locations);\n\t\t}\n\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AddLocation (object element, IEnumerable<Location> locations)\n\t\t{\n\t\t\tif (element == null || locations == null)\n\t\t\t\treturn;\n\t\t\tList<Location> found;\n\t\t\tif (!simple_locs.TryGetValue (element, out found)) {\n\t\t\t\tsimple_locs.Add (element, new List<Location> (locations));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfound.AddRange(locations);\n\t\t}\n\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void InsertLocation (object element, int index, Location location)\n\t\t{\n\t\t\tList<Location> found;\n\t\t\tif (!simple_locs.TryGetValue (element, out found)) {\n\t\t\t\tfound = new List<Location> ();\n\t\t\t\tsimple_locs.Add (element, found);\n\t\t\t}\n\n\t\t\tfound.Insert (index, location);\n\t\t}\n\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AddStatement (object element, params Location[] locations)\n\t\t{\n\t\t\tif (element == null)\n\t\t\t\treturn;\n\t\t\tif (locations.Length == 0)\n\t\t\t\tthrow new ArgumentException (\"Statement is missing semicolon location\");\n\t\t\tsimple_locs.Add (element, new List<Location>(locations));\n\t\t}\n\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AddMember (MemberCore member, IList<Tuple<Modifiers, Location>> modLocations, params Location[] locations)\n\t\t{\n\t\t\tLastMember = member;\n\t\t\tif (member == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tMemberLocations existing;\n\t\t\tif (member_locs.TryGetValue (member, out existing)) {\n\t\t\t\texisting.Modifiers = modLocations;\n\t\t\t\texisting.AddLocations (locations);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmember_locs.Add (member, new MemberLocations (modLocations, locations));\n\t\t}\n\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AddMember (MemberCore member, IList<Tuple<Modifiers, Location>> modLocations, IEnumerable<Location> locations)\n\t\t{\n\t\t\tLastMember = member;\n\t\t\tif (member == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tMemberLocations existing;\n\t\t\tif (member_locs.TryGetValue (member, out existing)) {\n\t\t\t\texisting.Modifiers = modLocations;\n\t\t\t\texisting.AddLocations (locations);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmember_locs.Add (member, new MemberLocations (modLocations, locations));\n\t\t}\n\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AppendToMember (MemberCore existing, params Location[] locations)\n\t\t{\n\t\t\tAppendToMember (existing, (IEnumerable<Location>)locations);\n\n\t\t}\n\t\t\n\t\t[Conditional (\"FULL_AST\")]\n\t\tpublic void AppendToMember (MemberCore existing, IEnumerable<Location> locations)\n\t\t{\n\t\t\tif (existing == null)\n\t\t\t\treturn;\n\t\t\tMemberLocations member;\n\t\t\tif (member_locs.TryGetValue (existing, out member)) {\n\t\t\t\tmember.AddLocations (locations);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmember_locs.Add (existing, new MemberLocations (null, locations));\n\t\t}\n\n\t\tpublic List<Location> GetLocations (object element)\n\t\t{\n\t\t\tif (element == null)\n\t\t\t\treturn null;\n\t\t\tList<Location> found;\n\t\t\tsimple_locs.TryGetValue (element, out found);\n\t\t\treturn found;\n\t\t}\n\n\t\tpublic MemberLocations GetMemberLocation (MemberCore element)\n\t\t{\n\t\t\tMemberLocations found;\n\t\t\tmember_locs.TryGetValue (element, out found);\n\t\t\treturn found;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/membercache.cs",
    "content": "//\n// membercache.cs: A container for all member lookups\n//\n// Author: Miguel de Icaza (miguel@gnu.org)\n//         Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2010 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n//\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace Mono.CSharp {\n\n\t[Flags]\n\tpublic enum MemberKind\n\t{\n\t\tConstructor = 1,\n\t\tEvent = 1 << 1,\n\t\tField = 1 << 2,\n\t\tMethod = 1 << 3,\n\t\tProperty = 1 << 4,\n\t\tIndexer = 1 << 5,\n\t\tOperator = 1 << 6,\n\t\tDestructor\t= 1 << 7,\n\n\t\tClass\t\t= 1 << 11,\n\t\tStruct\t\t= 1 << 12,\n\t\tDelegate\t= 1 << 13,\n\t\tEnum\t\t= 1 << 14,\n\t\tInterface\t= 1 << 15,\n\t\tTypeParameter = 1 << 16,\n\n\t\tArrayType = 1 << 19,\n\t\tPointerType = 1 << 20,\n\t\tInternalCompilerType = 1 << 21,\n\t\tMissingType = 1 << 22,\n\t\tVoid = 1 << 23,\n\t\tNamespace = 1 << 24,\n\n\t\tNestedMask = Class | Struct | Delegate | Enum | Interface,\n\t\tGenericMask = Method | Class | Struct | Delegate | Interface,\n\t\tMaskType = Constructor | Event | Field | Method | Property | Indexer | Operator | Destructor | NestedMask\n\t}\n\n\t[Flags]\n\tpublic enum BindingRestriction\n\t{\n\t\tNone = 0,\n\n\t\t// Inspect only queried type members\n\t\tDeclaredOnly = 1 << 1,\n\n\t\t// Exclude static\n\t\tInstanceOnly = 1 << 2,\n\n\t\tNoAccessors = 1 << 3,\n\n\t\t// Member has to be override\n\t\tOverrideOnly = 1 << 4\n\t}\n\n\tpublic struct MemberFilter : IEquatable<MemberSpec>\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly MemberKind Kind;\n\t\tpublic readonly AParametersCollection Parameters;\n\t\tpublic readonly TypeSpec MemberType;\n\t\tpublic readonly int Arity; // -1 to ignore the check\n\n\t\tpublic MemberFilter (MethodSpec m)\n\t\t{\n\t\t\tName = m.Name;\n\t\t\tKind = MemberKind.Method;\n\t\t\tParameters = m.Parameters;\n\t\t\tMemberType = m.ReturnType;\n\t\t\tArity = m.Arity;\n\t\t}\n\n\t\tpublic MemberFilter (string name, int arity, MemberKind kind, AParametersCollection param, TypeSpec type)\n\t\t{\n\t\t\tName = name;\n\t\t\tKind = kind;\n\t\t\tParameters = param;\n\t\t\tMemberType = type;\n\t\t\tthis.Arity = arity;\n\t\t}\n\n\t\tpublic static MemberFilter Constructor (AParametersCollection param)\n\t\t{\n\t\t\treturn new MemberFilter (Mono.CSharp.Constructor.ConstructorName, 0, MemberKind.Constructor, param, null);\n\t\t}\n\n\t\tpublic static MemberFilter Property (string name, TypeSpec type)\n\t\t{\n\t\t\treturn new MemberFilter (name, 0, MemberKind.Property, null, type);\n\t\t}\n\n\t\tpublic static MemberFilter Field (string name, TypeSpec type)\n\t\t{\n\t\t\treturn new MemberFilter (name, 0, MemberKind.Field, null, type);\n\t\t}\n\n\t\tpublic static MemberFilter Method (string name, int arity, AParametersCollection param, TypeSpec type)\n\t\t{\n\t\t\treturn new MemberFilter (name, arity, MemberKind.Method, param, type);\n\t\t}\n\n\t\t#region IEquatable<MemberSpec> Members\n\n\t\tpublic bool Equals (MemberSpec other)\n\t\t{\n\t\t\t// Is the member of the correct type ?\n\t\t\t// TODO: Isn't this redundant ?\n\t\t\tif ((other.Kind & Kind & MemberKind.MaskType) == 0)\n\t\t\t\treturn false;\n\n\t\t\t// Check arity when not disabled\n\t\t\tif (Arity >= 0 && Arity != other.Arity)\n\t\t\t\treturn false;\n\n\t\t\tif (Parameters != null) {\n\t\t\t\tif (other is IParametersMember) {\n\t\t\t\t\tvar other_param = ((IParametersMember) other).Parameters;\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (Parameters, other_param))\n\t\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (MemberType != null) {\n\t\t\t\tif (other is IInterfaceMemberSpec) {\n\t\t\t\t\tvar other_type = ((IInterfaceMemberSpec) other).MemberType;\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (other_type, MemberType))\n\t\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t//\n\t// The MemberCache is the main members container used by compiler. It contains\n\t// all members imported or defined during compilation using on demand filling\n\t// process. Inflated containers are also using MemberCache to make inflated\n\t// members look like normal definition.\n\t//\n\t// All of the methods are performance and memory sensitive as the MemberCache\n\t// is the underlying engine of all member based operations.\n\t//\n\tpublic class MemberCache\n\t{\n\t\t[Flags]\n\t\tenum StateFlags\n\t\t{\n\t\t\tHasConversionOperator = 1 << 1,\n\t\t\tHasUserOperator = 1 << 2\n\t\t}\n\n\t\treadonly Dictionary<string, IList<MemberSpec>> member_hash;\n\t\tDictionary<string, MemberSpec[]> locase_members;\n\t\tIList<MethodSpec> missing_abstract;\n\t\tStateFlags state;\t// TODO: Move to TypeSpec or ITypeDefinition\n\n\t\tpublic static readonly string IndexerNameAlias = \"<this>\";\n\n\t\tpublic static readonly MemberCache Empty = new MemberCache (0);\n\n\t\tpublic MemberCache ()\n\t\t\t: this (16)\n\t\t{\n\t\t}\n\n\t\tpublic MemberCache (int capacity)\n\t\t{\n\t\t\tmember_hash = new Dictionary<string, IList<MemberSpec>> (capacity);\n\t\t}\n\n\t\tpublic MemberCache (MemberCache cache)\n\t\t\t: this (cache.member_hash.Count)\n\t\t{\n\t\t\tthis.state = cache.state;\n\t\t}\n\n\t\t//\n\t\t// Creates a new MemberCache for the given `container'.\n\t\t//\n\t\tpublic MemberCache (TypeContainer container)\n\t\t\t: this ()\t\t\t\t// TODO: Optimize the size\n\t\t{\n\t\t}\n\n\t\t//\n\t\t// For cases where we need to union cache members\n\t\t//\n\t\tpublic void AddBaseType (TypeSpec baseType)\n\t\t{\n\t\t\tvar cache = baseType.MemberCache;\n\n\t\t\tIList<MemberSpec> list;\n\t\t\tforeach (var entry in cache.member_hash) {\n\t\t\t\tif (!member_hash.TryGetValue (entry.Key, out list)) {\n\t\t\t\t\tif (entry.Value.Count == 1) {\n\t\t\t\t\t\tlist = entry.Value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist = new List<MemberSpec> (entry.Value);\n\t\t\t\t\t}\n\n\t\t\t\t\tmember_hash.Add (entry.Key, list);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach (var ce in entry.Value) {\n\t\t\t\t\tif (list.Contains (ce))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (list is MemberSpec[]) {\n\t\t\t\t\t\tlist = new List<MemberSpec> { list [0] };\n\t\t\t\t\t\tmember_hash[entry.Key] = list;\n\t\t\t\t\t}\n\n\t\t\t\t\tlist.Add (ce);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Member-cache does not contain base members but it does\n\t\t// contain all base interface members, so the Lookup code\n\t\t// can use simple inheritance rules.\n\t\t//\n\t\t// Does not work recursively because of generic interfaces\n\t\t//\n\t\tpublic void AddInterface (TypeSpec iface)\n\t\t{\n\t\t\tvar cache = iface.MemberCache;\n\n\t\t\tIList<MemberSpec> list;\n\t\t\tforeach (var entry in cache.member_hash) {\n\t\t\t\tif (!member_hash.TryGetValue (entry.Key, out list)) {\n\t\t\t\t\tif (entry.Value.Count == 1) {\n\t\t\t\t\t\tlist = entry.Value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist = new List<MemberSpec> (entry.Value);\n\t\t\t\t\t}\n\n\t\t\t\t\tmember_hash.Add (entry.Key, list);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach (var ce in entry.Value) {\n\t\t\t\t\t//\n\t\t\t\t\t// When two or more different base interfaces implemenent common\n\t\t\t\t\t// interface\n\t\t\t\t\t//\n\t\t\t\t\t// I : IA, IFoo\n\t\t\t\t\t// IA : IFoo\n\t\t\t\t\t//\n\t\t\t\t\tif (list.Contains (ce))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (AddInterfaceMember (ce, ref list))\n\t\t\t\t\t\tmember_hash[entry.Key] = list;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddMember (InterfaceMemberBase imb, string exlicitName, MemberSpec ms)\n\t\t{\n\t\t\t// Explicit names cannot be looked-up but can be used for\n\t\t\t// collision checking (no name mangling needed)\n\t\t\tif (imb.IsExplicitImpl)\n\t\t\t\tAddMember (exlicitName, ms, false);\n\t\t\telse\n\t\t\t\tAddMember (ms);\n\t\t}\n\n\t\t//\n\t\t// Add non-explicit member to member cache\n\t\t//\n\t\tpublic void AddMember (MemberSpec ms)\n\t\t{\n\t\t\tAddMember (GetLookupName (ms), ms, false);\n\t\t}\n\n\t\tvoid AddMember (string name, MemberSpec member, bool removeHiddenMembers)\n\t\t{\n\t\t\tif (member.Kind == MemberKind.Operator) {\n\t\t\t\tvar dt = member.DeclaringType;\n\n\n\t\t\t\t//\n\t\t\t\t// Some core types have user operators but they cannot be used like normal\n\t\t\t\t// user operators as they are predefined and therefore having different\n\t\t\t\t// rules (e.g. binary operators) by not setting the flag we hide them for\n\t\t\t\t// user conversions\n\t\t\t\t//\n\t\t\t\tif (!BuiltinTypeSpec.IsPrimitiveType (dt) || dt.BuiltinType == BuiltinTypeSpec.Type.Char) {\n\t\t\t\t\tswitch (dt.BuiltinType) {\n\t\t\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\t\t\tcase BuiltinTypeSpec.Type.Delegate:\n\t\t\t\t\tcase BuiltinTypeSpec.Type.MulticastDelegate:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (name == Operator.GetMetadataName (Operator.OpType.Implicit) || name == Operator.GetMetadataName (Operator.OpType.Explicit)) {\n\t\t\t\t\t\t\tstate |= StateFlags.HasConversionOperator;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstate |= StateFlags.HasUserOperator;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIList<MemberSpec> list;\n\t\t\tif (!member_hash.TryGetValue (name, out list)) {\n\t\t\t\tmember_hash.Add (name, new MemberSpec[] { member });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (removeHiddenMembers && member.DeclaringType.IsInterface) {\n\t\t\t\tif (AddInterfaceMember (member, ref list))\n\t\t\t\t\tmember_hash[name] = list;\n\t\t\t} else {\n\t\t\t\tif (list.Count == 1) {\n\t\t\t\t\tlist = new List<MemberSpec> { list[0] };\n\t\t\t\t\tmember_hash[name] = list;\n\t\t\t\t}\n\n\t\t\t\tlist.Add (member);\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddMemberImported (MemberSpec ms)\n\t\t{\n\t\t\tAddMember (GetLookupName (ms), ms, true);\n\t\t}\n\n\t\t//\n\t\t// Ignores any base interface member which can be hidden\n\t\t// by this interface\n\t\t//\n\t\tstatic bool AddInterfaceMember (MemberSpec member, ref IList<MemberSpec> existing)\n\t\t{\n\t\t\tvar member_param = member is IParametersMember ? ((IParametersMember) member).Parameters : ParametersCompiled.EmptyReadOnlyParameters;\n\n\t\t\t//\n\t\t\t// interface IA : IB { int Prop { set; } }\n\t\t\t// interface IB { bool Prop { get; } }\n\t\t\t//\n\t\t\t// IB.Prop is never accessible from IA interface\n\t\t\t//\n\t\t\tfor (int i = 0; i < existing.Count; ++i) {\n\t\t\t\tvar entry = existing[i];\n\n\t\t\t\tif (entry.Arity != member.Arity)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (entry is IParametersMember) {\n\t\t\t\t\tvar entry_param = ((IParametersMember) entry).Parameters;\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (entry_param, member_param))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (member.DeclaringType.ImplementsInterface (entry.DeclaringType, false)) {\n\t\t\t\t\tif (existing.Count == 1) {\n\t\t\t\t\t\texisting = new MemberSpec[] { member };\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\texisting.RemoveAt (i--);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ((entry.DeclaringType == member.DeclaringType && entry.IsAccessor == member.IsAccessor) ||\n\t\t\t\t\tentry.DeclaringType.ImplementsInterface (member.DeclaringType, false))\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (existing.Count == 1) {\n\t\t\t\texisting = new List<MemberSpec> { existing[0], member };\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\texisting.Add (member);\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static MemberSpec FindMember (TypeSpec container, MemberFilter filter, BindingRestriction restrictions)\n\t\t{\n\t\t\tdo {\n\t\t\t\tIList<MemberSpec> applicable;\n\t\t\t\tif (container.MemberCache.member_hash.TryGetValue (filter.Name, out applicable)) {\n\t\t\t\t\t// Start from the end because interface members are in reverse order\n\t\t\t\t\tfor (int i = applicable.Count - 1; i >= 0; i--) {\n\t\t\t\t\t\tvar entry = applicable [i];\n\n\t\t\t\t\t\tif ((restrictions & BindingRestriction.InstanceOnly) != 0 && entry.IsStatic)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif ((restrictions & BindingRestriction.NoAccessors) != 0 && entry.IsAccessor)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif ((restrictions & BindingRestriction.OverrideOnly) != 0 && (entry.Modifiers & Modifiers.OVERRIDE) == 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!filter.Equals (entry))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif ((restrictions & BindingRestriction.DeclaredOnly) != 0 && container.IsInterface && entry.DeclaringType != container)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\treturn entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((restrictions & BindingRestriction.DeclaredOnly) != 0)\n\t\t\t\t\tbreak;\n\n\t\t\t\tcontainer = container.BaseType;\n\t\t\t} while (container != null);\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// A special method to work with member lookup only. It returns a list of all members named @name\n\t\t// starting from @container. It's very performance sensitive\n\t\t//\n\t\t// declaredOnlyClass cannot be used interfaces. Manual filtering is required because names are\n\t\t// compacted\n\t\t//\n\t\tpublic static IList<MemberSpec> FindMembers (TypeSpec container, string name, bool declaredOnlyClass)\n\t\t{\n\t\t\tIList<MemberSpec> applicable;\n\n\t\t\tdo {\n\t\t\t\tif (container.MemberCache.member_hash.TryGetValue (name, out applicable) || declaredOnlyClass)\n\t\t\t\t\treturn applicable;\n\n\t\t\t\tcontainer = container.BaseType;\n\t\t\t} while (container != null);\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Finds the nested type in container\n\t\t//\n\t\tpublic static TypeSpec FindNestedType (TypeSpec container, string name, int arity)\n\t\t{\n\t\t\tIList<MemberSpec> applicable;\n\t\t\tTypeSpec best_match = null;\n\t\t\tdo {\n#if !FULL_AOT_RUNTIME\n\t\t\t\t// TODO: Don't know how to handle this yet\n\t\t\t\t// When resolving base type of nested type, parent type must have\n\t\t\t\t// base type resolved to scan full hierarchy correctly\n\t\t\t\t// Similarly MemberCacheTypes will inflate BaseType and Interfaces\n\t\t\t\t// based on type definition\n\t\t\t\tvar tc = container.MemberDefinition as TypeContainer;\n\t\t\t\tif (tc != null)\n\t\t\t\t\ttc.DefineContainer ();\n#endif\n\n\t\t\t\tif (container.MemberCacheTypes.member_hash.TryGetValue (name, out applicable)) {\n\t\t\t\t\tfor (int i = applicable.Count - 1; i >= 0; i--) {\n\t\t\t\t\t\tvar entry = applicable[i];\n\t\t\t\t\t\tif ((entry.Kind & MemberKind.NestedMask) == 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar ts = (TypeSpec) entry;\n\t\t\t\t\t\tif (arity == ts.Arity)\n\t\t\t\t\t\t\treturn ts;\n\n\t\t\t\t\t\tif (arity < 0) {\n\t\t\t\t\t\t\tif (best_match == null) {\n\t\t\t\t\t\t\t\tbest_match = ts;\n\t\t\t\t\t\t\t} else if (System.Math.Abs (ts.Arity + arity) < System.Math.Abs (ts.Arity + arity)) {\n\t\t\t\t\t\t\t\tbest_match = ts;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontainer = container.BaseType;\n\t\t\t} while (container != null);\n\n\t\t\treturn best_match;\n\t\t}\n\n\t\t//\n\t\t// Looks for extension methods with defined name and extension type\n\t\t//\n\t\tpublic List<MethodSpec> FindExtensionMethods (IMemberContext invocationContext, string name, int arity)\n\t\t{\n\t\t\tIList<MemberSpec> entries;\n\t\t\tif (!member_hash.TryGetValue (name, out entries))\n\t\t\t\treturn null;\n\n\t\t\tList<MethodSpec> candidates = null;\n\t\t\tforeach (var entry in entries) {\n\t\t\t\tif (entry.Kind != MemberKind.Method || (arity > 0 && entry.Arity != arity))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar ms = (MethodSpec) entry;\n\t\t\t\tif (!ms.IsExtensionMethod)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!ms.IsAccessible (invocationContext))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//\n\t\t\t\t// Extension methods cannot be nested hence checking parent is enough\n\t\t\t\t//\n\t\t\t\tif ((ms.DeclaringType.Modifiers & Modifiers.INTERNAL) != 0 && !ms.DeclaringType.MemberDefinition.IsInternalAsPublic (invocationContext.Module.DeclaringAssembly))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (candidates == null)\n\t\t\t\t\tcandidates = new List<MethodSpec> ();\n\t\t\t\tcandidates.Add (ms);\n\t\t\t}\n\n\t\t\treturn candidates;\n\t\t}\n\n\t\t//\n\t\t// Returns base members of @member member if no exact match is found @bestCandidate returns\n\t\t// the best match\n\t\t//\n\t\tpublic static MemberSpec FindBaseMember (MemberCore member, out MemberSpec bestCandidate, ref bool overrides)\n\t\t{\n\t\t\tbestCandidate = null;\n\t\t\tvar container = member.Parent.PartialContainer.Definition;\n\t\t\tif (!container.IsInterface) {\n\t\t\t\tcontainer = container.BaseType;\n\n\t\t\t\t// It can happen for a user definition of System.Object\n\t\t\t\tif (container == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tstring name = GetLookupName (member);\n\t\t\tvar member_param = member is IParametersMember ? ((IParametersMember) member).Parameters : null;\n\n\t\t\tvar mkind = GetMemberCoreKind (member);\n\t\t\tbool member_with_accessors = mkind == MemberKind.Indexer || mkind == MemberKind.Property;\n\n\t\t\tIList<MemberSpec> applicable;\n\t\t\tMemberSpec ambig_candidate = null;\n\n\t\t\tdo {\n\t\t\t\tif (container.MemberCache.member_hash.TryGetValue (name, out applicable)) {\n\t\t\t\t\tfor (int i = 0; i < applicable.Count; ++i) {\n\t\t\t\t\t\tvar entry = applicable [i];\n\n\t\t\t\t\t\tif ((entry.Modifiers & Modifiers.PUBLIC) == 0 && !entry.IsAccessible (member))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Isn't the member of same kind ?\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((entry.Kind & ~MemberKind.Destructor & mkind & MemberKind.MaskType) == 0) {\n\t\t\t\t\t\t\t// Destructors are ignored as they cannot be overridden by user\n\t\t\t\t\t\t\tif ((entry.Kind & MemberKind.Destructor) != 0)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t// A method with different arity does not hide base member\n\t\t\t\t\t\t\tif (mkind != MemberKind.Method && member.MemberName.Arity != entry.Arity)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tbestCandidate = entry;\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Same kind of different arity is valid\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (member.MemberName.Arity != entry.Arity) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((entry.Kind & mkind & (MemberKind.Method | MemberKind.Indexer)) != 0) {\n\t\t\t\t\t\t\tif (entry.IsAccessor != member is AbstractPropertyEventMethod)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tvar pm = entry as IParametersMember;\n\t\t\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (pm.Parameters, member_param))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Skip override for member with accessors. It may not fully implement the base member\n\t\t\t\t\t\t// but keep flag we found an implementation in case the base member is abstract\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (member_with_accessors && ((entry.Modifiers & (Modifiers.OVERRIDE | Modifiers.SEALED)) == Modifiers.OVERRIDE)) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Set candidate to override implementation to flag we found an implementation\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\toverrides = true;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// For members with parameters we can encounter an ambiguous candidates (they match exactly)\n\t\t\t\t\t\t// because generic type parameters could be inflated into same types\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (ambig_candidate == null && (entry.Kind & mkind & (MemberKind.Method | MemberKind.Indexer)) != 0) {\n\t\t\t\t\t\t\tbestCandidate = null;\n\t\t\t\t\t\t\tambig_candidate = entry;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbestCandidate = ambig_candidate;\n\t\t\t\t\t\treturn entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (container.IsInterface || ambig_candidate != null)\n\t\t\t\t\tbreak;\n\n\t\t\t\tcontainer = container.BaseType;\n\t\t\t} while (container != null);\n\n\t\t\treturn ambig_candidate;\n\t\t}\n\n\t\t//\n\t\t// Returns inflated version of MemberSpec, it works similarly to\n\t\t// SRE TypeBuilder.GetMethod\n\t\t//\n\t\tpublic static T GetMember<T> (TypeSpec container, T spec) where T : MemberSpec\n\t\t{\n\t\t\tIList<MemberSpec> applicable;\n\t\t\tif (container.MemberCache.member_hash.TryGetValue (GetLookupName (spec), out applicable)) {\n\t\t\t\tfor (int i = applicable.Count - 1; i >= 0; i--) {\n\t\t\t\t\tvar entry = applicable[i];\n\t\t\t\t\tif (entry.MemberDefinition == spec.MemberDefinition)\n\t\t\t\t\t\treturn (T) entry;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new InternalErrorException (\"Missing member `{0}' on inflated type `{1}'\",\n\t\t\t\tspec.GetSignatureForError (), container.GetSignatureForError ());\n\t\t}\n\n\t\tstatic MemberKind GetMemberCoreKind (MemberCore member)\n\t\t{\n\t\t\tif (member is FieldBase)\n\t\t\t\treturn MemberKind.Field;\n\t\t\tif (member is Indexer)\n\t\t\t\treturn MemberKind.Indexer;\n\t\t\tif (member is Class)\n\t\t\t\treturn MemberKind.Class;\n\t\t\tif (member is Struct)\n\t\t\t\treturn MemberKind.Struct;\n\t\t\tif (member is Destructor)\n\t\t\t\treturn MemberKind.Destructor;\n\t\t\tif (member is Method)\n\t\t\t\treturn MemberKind.Method;\n\t\t\tif (member is Property)\n\t\t\t\treturn MemberKind.Property;\n\t\t\tif (member is EventField)\n\t\t\t\treturn MemberKind.Event;\n\t\t\tif (member is Interface)\n\t\t\t\treturn MemberKind.Interface;\n\t\t\tif (member is EventProperty)\n\t\t\t\treturn MemberKind.Event;\n\t\t\tif (member is Delegate)\n\t\t\t\treturn MemberKind.Delegate;\n\t\t\tif (member is Enum)\n\t\t\t\treturn MemberKind.Enum;\n\n\t\t\tthrow new NotImplementedException (member.GetType ().ToString ());\n\t\t}\n\n\t\tpublic static List<FieldSpec> GetAllFieldsForDefiniteAssignment (TypeSpec container)\n\t\t{\n\t\t\tList<FieldSpec> fields = null;\n\t\t\tforeach (var entry in container.MemberCache.member_hash) {\n\t\t\t\tforeach (var name_entry in entry.Value) {\n\t\t\t\t\tif (name_entry.Kind != MemberKind.Field)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif ((name_entry.Modifiers & Modifiers.STATIC) != 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Fixed size buffers are not subject to definite assignment checking\n\t\t\t\t\t//\n\t\t\t\t\tif (name_entry is FixedFieldSpec || name_entry is ConstSpec)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar fs = (FieldSpec) name_entry;\n\n\t\t\t\t\t//\n\t\t\t\t\t// LAMESPEC: Very bizzare hack, definitive assignment is not done\n\t\t\t\t\t// for imported non-public reference fields except array. No idea what the\n\t\t\t\t\t// actual csc rule is\n\t\t\t\t\t//\n\t\t\t\t\tif (!fs.IsPublic && container.MemberDefinition.IsImported && (!fs.MemberType.IsArray && TypeSpec.IsReferenceType (fs.MemberType)))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t//if ((fs.Modifiers & (Modifiers.BACKING_FIELD) != 0)\n\t\t\t\t\t//\tcontinue;\n\n\t\t\t\t\tif (fields == null)\n\t\t\t\t\t\tfields = new List<FieldSpec> ();\n\n\t\t\t\t\tfields.Add (fs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn fields ?? new List<FieldSpec> (0);\n\t\t}\n\n\t\tpublic static IList<MemberSpec> GetCompletitionMembers (IMemberContext ctx, TypeSpec container, string name)\n\t\t{\n\t\t\tvar matches = new List<MemberSpec> ();\n\t\t\tforeach (var entry in container.MemberCache.member_hash) {\n\t\t\t\tforeach (var name_entry in entry.Value) {\n\t\t\t\t\tif (name_entry.IsAccessor)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif ((name_entry.Kind & (MemberKind.Constructor | MemberKind.Destructor | MemberKind.Operator)) != 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!name_entry.IsAccessible (ctx))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (name == null || name_entry.Name.StartsWith (name)) {\n\t\t\t\t\t\tmatches.Add (name_entry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn matches;\n\t\t}\n\n\t\t//\n\t\t// Returns members of @iface only, base members are ignored\n\t\t//\n\t\tpublic static List<MethodSpec> GetInterfaceMethods (TypeSpec iface)\n\t\t{\n\t\t\t//\n\t\t\t// MemberCache flatten interfaces, therefore in cases like this one\n\t\t\t// \n\t\t\t// interface IA : IB {}\n\t\t\t// interface IB { void Foo () }\n\t\t\t//\n\t\t\t// we would return Foo inside IA which is not expected in this case\n\t\t\t//\n\t\t\tvar methods = new List<MethodSpec> ();\n\t\t\tforeach (var entry in iface.MemberCache.member_hash.Values) {\n\t\t\t\tforeach (var name_entry in entry) {\n\t\t\t\t\tif (iface == name_entry.DeclaringType) {\n\t\t\t\t\t\tif (name_entry.Kind == MemberKind.Method) {\n\t\t\t\t\t\t\tmethods.Add ((MethodSpec) name_entry);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn methods;\n\t\t}\n\n\t\t//\n\t\t// Returns all not implememted abstract members inside abstract type\n\t\t// NOTE: Returned list is shared and must not be modified\n\t\t//\n\t\tpublic static IList<MethodSpec> GetNotImplementedAbstractMethods (TypeSpec type)\n\t\t{\n\t\t\tif (type.MemberCache.missing_abstract != null)\n\t\t\t\treturn type.MemberCache.missing_abstract;\n\t\t\t\t\n\t\t\tvar abstract_methods = new List<MethodSpec> ();\n\t\t\tList<TypeSpec> hierarchy = null;\n\n\t\t\t//\n\t\t\t// Stage 1: top-to-bottom scan for abstract members\n\t\t\t//\n\t\t\tvar abstract_type = type;\n\t\t\twhile (true) {\n\t\t\t\tforeach (var entry in abstract_type.MemberCache.member_hash) {\n\t\t\t\t\tforeach (var name_entry in entry.Value) {\n\t\t\t\t\t\tif ((name_entry.Modifiers & Modifiers.ABSTRACT) == 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar ms = name_entry as MethodSpec;\n\t\t\t\t\t\tif (ms == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tabstract_methods.Add (ms);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar base_type = abstract_type.BaseType;\n\t\t\t\tif (!base_type.IsAbstract)\n\t\t\t\t\tbreak;\n\n\t\t\t\tif (hierarchy == null)\n\t\t\t\t\thierarchy = new List<TypeSpec> ();\n\n\t\t\t\thierarchy.Add (abstract_type);\n\t\t\t\tabstract_type = base_type;\n\t\t\t}\n\n\t\t\tint not_implemented_count = abstract_methods.Count;\n\t\t\tif (not_implemented_count == 0 || hierarchy == null) {\n\t\t\t\ttype.MemberCache.missing_abstract = abstract_methods;\n\t\t\t\treturn type.MemberCache.missing_abstract;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Stage 2: Remove already implemented methods\n\t\t\t//\n\t\t\tforeach (var type_up in hierarchy) {\n\t\t\t\tvar members = type_up.MemberCache.member_hash;\n\t\t\t\tif (members.Count == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfor (int i = 0; i < abstract_methods.Count; ++i) {\n\t\t\t\t\tvar candidate = abstract_methods [i];\n\t\t\t\t\tif (candidate == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tIList<MemberSpec> applicable;\n\t\t\t\t\tif (!members.TryGetValue (candidate.Name, out applicable))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar filter = new MemberFilter (candidate);\n\t\t\t\t\tforeach (var item in applicable) {\n\t\t\t\t\t\tif ((item.Modifiers & (Modifiers.OVERRIDE | Modifiers.VIRTUAL)) == 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Abstract override does not override anything\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((item.Modifiers & Modifiers.ABSTRACT) != 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (filter.Equals (item)) {\n\t\t\t\t\t\t\t--not_implemented_count;\n\t\t\t\t\t\t\tabstract_methods [i] = null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (not_implemented_count == abstract_methods.Count) {\n\t\t\t\ttype.MemberCache.missing_abstract = abstract_methods;\n\t\t\t\treturn type.MemberCache.missing_abstract;\n\t\t\t}\n\n\t\t\tvar not_implemented = new MethodSpec[not_implemented_count];\n\t\t\tint counter = 0;\n\t\t\tforeach (var m in abstract_methods) {\n\t\t\t\tif (m == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tnot_implemented[counter++] = m;\n\t\t\t}\n\n\t\t\ttype.MemberCache.missing_abstract = not_implemented;\n\t\t\treturn type.MemberCache.missing_abstract;\n\t\t}\n\n\t\tstatic string GetLookupName (MemberSpec ms)\n\t\t{\n\t\t\tif (ms.Kind == MemberKind.Indexer)\n\t\t\t\treturn IndexerNameAlias;\n\n\t\t\tif (ms.Kind == MemberKind.Constructor) {\n\t\t\t\tif (ms.IsStatic)\n\t\t\t\t\treturn Constructor.TypeConstructorName;\n\n\t\t\t\treturn Constructor.ConstructorName;\n\t\t\t}\n\n\t\t\treturn ms.Name;\n\t\t}\n\n\t\tstatic string GetLookupName (MemberCore mc)\n\t\t{\n\t\t\tif (mc is Indexer)\n\t\t\t\treturn IndexerNameAlias;\n\n\t\t\tif (mc is Constructor)\n\t\t\t\treturn mc.IsStatic ? Constructor.TypeConstructorName : Constructor.ConstructorName;\n\n\t\t\treturn mc.MemberName.Name;\n\t\t}\n\n\t\t//\n\t\t// Returns all operators declared on container and its base types (until declaredOnly is used)\n\t\t//\n\t\tpublic static IList<MemberSpec> GetUserOperator (TypeSpec container, Operator.OpType op, bool declaredOnly)\n\t\t{\n\t\t\tIList<MemberSpec> found = null;\n\t\t\tbool shared_list = true;\n\t\t\tIList<MemberSpec> applicable;\n\t\t\tdo {\n\t\t\t\tvar mc = container.MemberCache;\n\n\t\t\t\tif (((op == Operator.OpType.Implicit || op == Operator.OpType.Explicit) && (mc.state & StateFlags.HasConversionOperator) != 0) ||\n\t\t\t\t\t (mc.state & StateFlags.HasUserOperator) != 0) {\n\n\t\t\t\t\tif (mc.member_hash.TryGetValue (Operator.GetMetadataName (op), out applicable)) {\n\t\t\t\t\t\tint i;\n\t\t\t\t\t\tfor (i = 0; i < applicable.Count; ++i) {\n\t\t\t\t\t\t\tif (applicable[i].Kind != MemberKind.Operator) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Handles very rare case where a method with same name as operator (op_xxxx) exists\n\t\t\t\t\t\t// and we have to resize the applicable list\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (i != applicable.Count) {\n\t\t\t\t\t\t\tfor (i = 0; i < applicable.Count; ++i) {\n\t\t\t\t\t\t\t\tif (applicable[i].Kind != MemberKind.Operator) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (found == null) {\n\t\t\t\t\t\t\t\t\tfound = new List<MemberSpec> ();\n\t\t\t\t\t\t\t\t\tfound.Add (applicable[i]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tList<MemberSpec> prev;\n\t\t\t\t\t\t\t\t\tif (shared_list) {\n\t\t\t\t\t\t\t\t\t\tshared_list = false;\n\t\t\t\t\t\t\t\t\t\tprev = new List<MemberSpec> (found.Count + 1);\n\t\t\t\t\t\t\t\t\t\tprev.AddRange (found);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tprev = (List<MemberSpec>) found;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tprev.Add (applicable[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (found == null) {\n\t\t\t\t\t\t\t\tfound = applicable;\n\t\t\t\t\t\t\t\tshared_list = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tList<MemberSpec> merged;\n\t\t\t\t\t\t\t\tif (shared_list) {\n\t\t\t\t\t\t\t\t\tshared_list = false;\n\t\t\t\t\t\t\t\t\tmerged = new List<MemberSpec> (found.Count + applicable.Count);\n\t\t\t\t\t\t\t\t\tmerged.AddRange (found);\n\t\t\t\t\t\t\t\t\tfound = merged;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tmerged = (List<MemberSpec>) found;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tmerged.AddRange (applicable);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// BaseType call can be expensive\n\t\t\t\tif (declaredOnly)\n\t\t\t\t\tbreak;\n\n\t\t\t\tcontainer = container.BaseType;\n\t\t\t} while (container != null);\n\n\t\t\treturn found;\n\t\t}\n\n\t\t//\n\t\t// Inflates all member cache nested types\n\t\t//\n\t\tpublic void InflateTypes (MemberCache inflated_cache, TypeParameterInflator inflator)\n\t\t{\n\t\t\tforeach (var item in member_hash) {\n\t\t\t\tIList<MemberSpec> inflated_members = null;\n\t\t\t\tfor (int i = 0; i < item.Value.Count; ++i ) {\n\t\t\t\t\tvar member = item.Value[i];\n\n\t\t\t\t\t// FIXME: When inflating members refering nested types before they are inflated\n\t\t\t\t\tif (member == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif ((member.Kind & MemberKind.NestedMask) != 0 &&\n\t\t\t\t\t\t(member.Modifiers & Modifiers.COMPILER_GENERATED) == 0) {\n\t\t\t\t\t\tif (inflated_members == null) {\n\t\t\t\t\t\t\tinflated_members = new MemberSpec[item.Value.Count];\n\t\t\t\t\t\t\tinflated_cache.member_hash.Add (item.Key, inflated_members);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tinflated_members [i] = member.InflateMember (inflator);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Inflates all open type members, requires InflateTypes to be called before\n\t\t//\n\t\tpublic void InflateMembers (MemberCache cacheToInflate, TypeSpec inflatedType, TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar inflated_member_hash = cacheToInflate.member_hash;\n\t\t\tDictionary<MemberSpec, MethodSpec> accessor_relation = null;\n\t\t\tList<MemberSpec> accessor_members = null;\n\n\t\t\t// Copy member specific flags when all members were added\n\t\t\tcacheToInflate.state = state;\n\n\t\t\tforeach (var item in member_hash) {\n\t\t\t\tvar members = item.Value;\n\t\t\t\tIList<MemberSpec> inflated_members = null;\n\t\t\t\tfor (int i = 0; i < members.Count; ++i ) {\n\t\t\t\t\tvar member = members[i];\n\n\t\t\t\t\t//\n\t\t\t\t\t// All nested types have been inflated earlier except for\n\t\t\t\t\t// compiler types which are created later and could miss InflateTypes\n\t\t\t\t\t//\n\t\t\t\t\tif ((member.Kind & MemberKind.NestedMask) != 0 &&\n\t\t\t\t\t\t(member.Modifiers & Modifiers.COMPILER_GENERATED) == 0) {\n\t\t\t\t\t\tif (inflated_members == null)\n\t\t\t\t\t\t\tinflated_members = inflated_member_hash[item.Key];\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Clone the container first\n\t\t\t\t\t//\n\t\t\t\t\tif (inflated_members == null) {\n\t\t\t\t\t\tinflated_members = new MemberSpec [item.Value.Count];\n\t\t\t\t\t\tinflated_member_hash.Add (item.Key, inflated_members);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar local_inflator = inflator;\n\n\t\t\t\t\tif (member.DeclaringType != inflatedType) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Don't inflate top-level non-generic interface members\n\t\t\t\t\t\t// merged into generic interface\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (!member.DeclaringType.IsGeneric && !member.DeclaringType.IsNested) {\n\t\t\t\t\t\t\tinflated_members [i] = member;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Needed when inflating flatten interfaces. It inflates\n\t\t\t\t\t\t// container type only, type parameters are already done\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Handles cases like:\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// interface I<T> {}\n\t\t\t\t\t\t// interface I<U, V> : I<U> {}\n\t\t\t\t\t\t// \n\t\t\t\t\t\t// class C: I<int, bool> {}\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar inflated_parent = inflator.Inflate (member.DeclaringType);\n\t\t\t\t\t\tif (inflated_parent != inflator.TypeInstance)\n\t\t\t\t\t\t\tlocal_inflator = new TypeParameterInflator (inflator, inflated_parent);\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Inflate every member, its parent is now different\n\t\t\t\t\t//\n\t\t\t\t\tvar inflated = member.InflateMember (local_inflator);\n\t\t\t\t\tinflated_members [i] = inflated;\n\n\t\t\t\t\tif (member is PropertySpec || member is EventSpec) {\n\t\t\t\t\t\tif (accessor_members == null)\n\t\t\t\t\t\t\taccessor_members = new List<MemberSpec> ();\n\n\t\t\t\t\t\taccessor_members.Add (inflated);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (member.IsAccessor) {\n\t\t\t\t\t\tif (accessor_relation == null)\n\t\t\t\t\t\t\taccessor_relation = new Dictionary<MemberSpec, MethodSpec> ();\n\t\t\t\t\t\taccessor_relation.Add (member, (MethodSpec) inflated);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (accessor_members != null) {\n\t\t\t\tforeach (var member in accessor_members) {\n\t\t\t\t\tvar prop = member as PropertySpec;\n\t\t\t\t\tif (prop != null) {\n\t\t\t\t\t\tif (prop.Get != null)\n\t\t\t\t\t\t\tprop.Get = accessor_relation[prop.Get];\n\t\t\t\t\t\tif (prop.Set != null)\n\t\t\t\t\t\t\tprop.Set = accessor_relation[prop.Set];\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar ev = (EventSpec) member;\n\t\t\t\t\tev.AccessorAdd = accessor_relation[ev.AccessorAdd];\n\t\t\t\t\tev.AccessorRemove = accessor_relation[ev.AccessorRemove];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Removes hidden base members of an interface. For compiled interfaces we cannot\n\t\t// do name filtering during Add (as we do for import) because we need all base\n\t\t// names to be valid during type definition.\n\t\t// Add replaces hidden base member with current one which means any name collision\n\t\t// (CS0108) of non-first name would be unnoticed because the name was replaced\n\t\t// with the one from compiled type\n\t\t//\n\t\tpublic void RemoveHiddenMembers (TypeSpec container)\n\t\t{\n\t\t\tforeach (var entry in member_hash) {\n\t\t\t\tvar values = entry.Value;\n\n\t\t\t\tint container_members_start_at = 0;\n\t\t\t\twhile (values[container_members_start_at].DeclaringType != container && ++container_members_start_at < entry.Value.Count);\n\n\t\t\t\tif (container_members_start_at == 0 || container_members_start_at == values.Count)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfor (int i = 0; i < container_members_start_at; ++i) {\n\t\t\t\t\tvar member = values[i];\n\n\t\t\t\t\tif (!container.ImplementsInterface (member.DeclaringType, false))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar member_param = member is IParametersMember ? ((IParametersMember) member).Parameters : ParametersCompiled.EmptyReadOnlyParameters;\n\n\t\t\t\t\tfor (int ii = container_members_start_at; ii < values.Count; ++ii) {\n\t\t\t\t\t\tvar container_entry = values[ii];\n\n\t\t\t\t\t\tif (container_entry.Arity != member.Arity)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (container_entry is IParametersMember) {\n\t\t\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (((IParametersMember) container_entry).Parameters, member_param))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvalues.RemoveAt (i);\n\t\t\t\t\t\t--container_members_start_at;\n\t\t\t\t\t\t--ii;\n\t\t\t\t\t\t--i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Checks all appropriate container members for CLS compliance\n\t\t//\n\t\tpublic void VerifyClsCompliance (TypeSpec container, Report report)\n\t\t{\n\t\t\tif (locase_members != null)\n\t\t\t\treturn;\n\n\t\t\tif (container.BaseType == null) {\n\t\t\t\tlocase_members = new Dictionary<string, MemberSpec[]> (member_hash.Count); // StringComparer.OrdinalIgnoreCase);\n\t\t\t} else {\n\t\t\t\tvar btype = container.BaseType.GetDefinition ();\n\t\t\t\tbtype.MemberCache.VerifyClsCompliance (btype, report);\n\t\t\t\tlocase_members = new Dictionary<string, MemberSpec[]> (btype.MemberCache.locase_members); //, StringComparer.OrdinalIgnoreCase);\n\t\t\t}\n\n\t\t\tvar is_imported_type = container.MemberDefinition.IsImported;\n\t\t\tforeach (var entry in container.MemberCache.member_hash) {\n\t\t\t\tfor (int i = 0; i < entry.Value.Count; ++i ) {\n\t\t\t\t\tvar name_entry = entry.Value[i];\n\t\t\t\t\tif ((name_entry.Modifiers & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif ((name_entry.Modifiers & (Modifiers.OVERRIDE | Modifiers.COMPILER_GENERATED)) != 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif ((name_entry.Kind & MemberKind.MaskType) == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (name_entry.MemberDefinition.CLSAttributeValue == false)\n\t\t\t\t\t    continue;\n\n\t\t\t\t\tIParametersMember p_a = null;\n\t\t\t\t\tif (!is_imported_type) {\n\t\t\t\t\t\tp_a = name_entry as IParametersMember;\n\t\t\t\t\t\tif (p_a != null && !name_entry.IsAccessor) {\n\t\t\t\t\t\t\tvar p_a_pd = p_a.Parameters;\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Check differing overloads in @container\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tfor (int ii = i + 1; ii < entry.Value.Count; ++ii) {\n\t\t\t\t\t\t\t\tvar checked_entry = entry.Value[ii];\n\t\t\t\t\t\t\t\tIParametersMember p_b = checked_entry as IParametersMember;\n\t\t\t\t\t\t\t\tif (p_b == null)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (p_a_pd.Count != p_b.Parameters.Count)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (checked_entry.IsAccessor)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tvar res = ParametersCompiled.IsSameClsSignature (p_a.Parameters, p_b.Parameters);\n\t\t\t\t\t\t\t\tif (res != 0) {\n\t\t\t\t\t\t\t\t\tReportOverloadedMethodClsDifference (name_entry, checked_entry, res, report);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (i > 0 || name_entry.Kind == MemberKind.Constructor || name_entry.Kind == MemberKind.Indexer)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar name_entry_locase = name_entry.Name.ToLowerInvariant ();\n\n\t\t\t\t\tMemberSpec[] found;\n\t\t\t\t\tif (!locase_members.TryGetValue (name_entry_locase, out found)) {\n\t\t\t\t\t\tfound = new MemberSpec[] { name_entry };\n\t\t\t\t\t\tlocase_members.Add (name_entry_locase, found);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbool same_names_only = true;\n\t\t\t\t\t\tforeach (var f in found) {\n\t\t\t\t\t\t\tif (f.Name == name_entry.Name) {\n\t\t\t\t\t\t\t\tif (p_a != null) {\n\t\t\t\t\t\t\t\t\tIParametersMember p_b = f as IParametersMember;\n\t\t\t\t\t\t\t\t\tif (p_b == null)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tif (p_a.Parameters.Count != p_b.Parameters.Count)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tif (f.IsAccessor)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tvar res = ParametersCompiled.IsSameClsSignature (p_a.Parameters, p_b.Parameters);\n\t\t\t\t\t\t\t\t\tif (res != 0) {\n\t\t\t\t\t\t\t\t\t\tReportOverloadedMethodClsDifference (f, name_entry, res, report);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsame_names_only = false;\n\t\t\t\t\t\t\tif (!is_imported_type) {\n\t\t\t\t\t\t\t\tvar last = GetLaterDefinedMember (f, name_entry);\n\t\t\t\t\t\t\t\tif (last == f.MemberDefinition) {\n\t\t\t\t\t\t\t\t\treport.SymbolRelatedToPreviousError (name_entry);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treport.SymbolRelatedToPreviousError (f);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treport.Warning (3005, 1, last.Location,\n\t\t\t\t\t\t\t\t\t\"Identifier `{0}' differing only in case is not CLS-compliant\", last.GetSignatureForError ());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!same_names_only) {\n\t\t\t\t\t\t\tArray.Resize (ref found, found.Length + 1);\n\t\t\t\t\t\t\tfound[found.Length - 1] = name_entry;\n\t\t\t\t\t\t\tlocase_members[name_entry_locase] = found;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Local report helper to issue correctly ordered members stored in hashtable\n\t\t//\n\t\tstatic MemberCore GetLaterDefinedMember (MemberSpec a, MemberSpec b)\n\t\t{\n\t\t\tvar mc_a = a.MemberDefinition as MemberCore;\n\t\t\tvar mc_b = b.MemberDefinition as MemberCore;\n\t\t\tif (mc_a == null)\n\t\t\t\treturn mc_b;\n\n\t\t\tif (mc_b == null)\n\t\t\t\treturn mc_a;\n\n\t\t\tif (a.DeclaringType.MemberDefinition != b.DeclaringType.MemberDefinition)\n\t\t\t\treturn mc_b;\n\n\t\t\tif (mc_a.Location.File != mc_a.Location.File)\n\t\t\t\treturn mc_b;\n\n\t\t\treturn mc_b.Location.Row > mc_a.Location.Row ? mc_b : mc_a;\n\t\t}\n\n\t\tstatic void ReportOverloadedMethodClsDifference (MemberSpec a, MemberSpec b, int res, Report report)\n\t\t{\n\t\t\tvar last = GetLaterDefinedMember (a, b);\n\t\t\tif (last == a.MemberDefinition) {\n\t\t\t\treport.SymbolRelatedToPreviousError (b);\n\t\t\t} else {\n\t\t\t\treport.SymbolRelatedToPreviousError (a);\n\t\t\t}\n\n\t\t\tif ((res & 1) != 0) {\n\t\t\t\treport.Warning (3006, 1, last.Location,\n\t\t\t\t\t\t\"Overloaded method `{0}' differing only in ref or out, or in array rank, is not CLS-compliant\",\n\t\t\t\t\t\tlast.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif ((res & 2) != 0) {\n\t\t\t\treport.Warning (3007, 1, last.Location,\n\t\t\t\t\t\"Overloaded method `{0}' differing only by unnamed array types is not CLS-compliant\",\n\t\t\t\t\tlast.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic bool CheckExistingMembersOverloads (MemberCore member, AParametersCollection parameters)\n\t\t{\n\t\t\tvar name = GetLookupName (member);\n\t\t\tvar imb = member as InterfaceMemberBase;\n\t\t\tif (imb != null && imb.IsExplicitImpl) {\n\t\t\t\tname = imb.GetFullName (name);\n\t\t\t}\n\n\t\t\treturn CheckExistingMembersOverloads (member, name, parameters);\n\t\t}\n\n\t\tpublic bool CheckExistingMembersOverloads (MemberCore member, string name, AParametersCollection parameters)\n\t\t{\n\t\t\tIList<MemberSpec> entries;\n\t\t\tif (!member_hash.TryGetValue (name, out entries))\n\t\t\t\treturn false;\n\n\t\t\tvar Report = member.Compiler.Report;\n\n\t\t\tint method_param_count = parameters.Count;\n\t\t\tfor (int i = entries.Count - 1; i >= 0; --i) {\n\t\t\t\tvar ce = entries[i];\n\t\t\t\tvar pm = ce as IParametersMember;\n\t\t\t\tvar pd = pm == null ? ParametersCompiled.EmptyReadOnlyParameters : pm.Parameters;\n\t\t\t\tif (pd.Count != method_param_count)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (ce.Arity != member.MemberName.Arity)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Ignore merged interface members\n\t\t\t\tif (member.Parent.PartialContainer != ce.DeclaringType.MemberDefinition)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar p_types = pd.Types;\n\t\t\t\tif (method_param_count > 0) {\n\t\t\t\t\tint ii = method_param_count - 1;\n\t\t\t\t\tTypeSpec type_a, type_b;\n\t\t\t\t\tdo {\n\t\t\t\t\t\ttype_a = parameters.Types [ii];\n\t\t\t\t\t\ttype_b = p_types [ii];\n\n\t\t\t\t\t\tvar a_byref = (pd.FixedParameters[ii].ModFlags & Parameter.Modifier.RefOutMask) != 0;\n\t\t\t\t\t\tvar b_byref = (parameters.FixedParameters[ii].ModFlags & Parameter.Modifier.RefOutMask) != 0;\n\n\t\t\t\t\t\tif (a_byref != b_byref)\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t} while (TypeSpecComparer.Override.IsEqual (type_a, type_b) && ii-- != 0);\n\n\t\t\t\t\tif (ii >= 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Operators can differ in return type only\n\t\t\t\t\t//\n\t\t\t\t\tif (member is Operator && ce.Kind == MemberKind.Operator && ((MethodSpec) ce).ReturnType != ((Operator) member).ReturnType)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Report difference in parameter modifiers only\n\t\t\t\t\t//\n\t\t\t\t\tif (pd != null && member is MethodCore) {\n\t\t\t\t\t\tii = method_param_count;\n\t\t\t\t\t\twhile (ii-- != 0 &&\n\t\t\t\t\t\t\t(parameters.FixedParameters[ii].ModFlags & Parameter.Modifier.ModifierMask) ==\n\t\t\t\t\t\t\t(pd.FixedParameters[ii].ModFlags & Parameter.Modifier.ModifierMask) &&\n\t\t\t\t\t\t\tparameters.ExtensionMethodType == pd.ExtensionMethodType) ;\n\n\t\t\t\t\t\tif (ii >= 0) {\n\t\t\t\t\t\t\tvar mc = ce as MethodSpec;\n\t\t\t\t\t\t\tmember.Compiler.Report.SymbolRelatedToPreviousError (ce);\n\t\t\t\t\t\t\tif ((member.ModFlags & Modifiers.PARTIAL) != 0 && (mc.Modifiers & Modifiers.PARTIAL) != 0) {\n\t\t\t\t\t\t\t\tif (parameters.HasParams || pd.HasParams) {\n\t\t\t\t\t\t\t\t\tReport.Error (758, member.Location,\n\t\t\t\t\t\t\t\t\t\t\"A partial method declaration and partial method implementation cannot differ on use of `params' modifier\");\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tReport.Error (755, member.Location,\n\t\t\t\t\t\t\t\t\t\t\"A partial method declaration and partial method implementation must be both an extension method or neither\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (member is Constructor) {\n\t\t\t\t\t\t\t\tReport.Error (851, member.Location,\n\t\t\t\t\t\t\t\t\t\"Overloaded contructor `{0}' cannot differ on use of parameter modifiers only\",\n\t\t\t\t\t\t\t\t\tmember.GetSignatureForError ());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tReport.Error (663, member.Location,\n\t\t\t\t\t\t\t\t\t\"Overloaded method `{0}' cannot differ on use of parameter modifiers only\",\n\t\t\t\t\t\t\t\t\tmember.GetSignatureForError ());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((ce.Kind & MemberKind.Method) != 0) {\n\t\t\t\t\tMethod method_a = member as Method;\n\t\t\t\t\tMethod method_b = ce.MemberDefinition as Method;\n\t\t\t\t\tif (method_a != null && method_b != null && (method_a.ModFlags & method_b.ModFlags & Modifiers.PARTIAL) != 0) {\n\t\t\t\t\t\tconst Modifiers partial_modifiers = Modifiers.STATIC | Modifiers.UNSAFE;\n\t\t\t\t\t\tif (method_a.IsPartialDefinition == method_b.IsPartialImplementation) {\n\t\t\t\t\t\t\tif ((method_a.ModFlags & partial_modifiers) == (method_b.ModFlags & partial_modifiers) ||\n\t\t\t\t\t\t\t\tmethod_a.Parent.IsUnsafe && method_b.Parent.IsUnsafe) {\n\t\t\t\t\t\t\t\tif (method_a.IsPartialImplementation) {\n\t\t\t\t\t\t\t\t\tmethod_a.SetPartialDefinition (method_b);\n\t\t\t\t\t\t\t\t\tif (entries.Count == 1)\n\t\t\t\t\t\t\t\t\t\tmember_hash.Remove (name);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tentries.RemoveAt (i);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tmethod_b.SetPartialDefinition (method_a);\n\t\t\t\t\t\t\t\t\tmethod_a.caching_flags |= MemberCore.Flags.PartialDefinitionExists;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (method_a.IsStatic != method_b.IsStatic) {\n\t\t\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (ce);\n\t\t\t\t\t\t\t\tReport.Error (763, member.Location,\n\t\t\t\t\t\t\t\t\t\"A partial method declaration and partial method implementation must be both `static' or neither\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ((method_a.ModFlags & Modifiers.UNSAFE) != (method_b.ModFlags & Modifiers.UNSAFE)) {\n\t\t\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (ce);\n\t\t\t\t\t\t\t\tReport.Error (764, member.Location,\n\t\t\t\t\t\t\t\t\t\"A partial method declaration and partial method implementation must be both `unsafe' or neither\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (ce);\n\t\t\t\t\t\tif (method_a.IsPartialDefinition) {\n\t\t\t\t\t\t\tReport.Error (756, member.Location, \"A partial method `{0}' declaration is already defined\",\n\t\t\t\t\t\t\t\tmember.GetSignatureForError ());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tReport.Error (757, member.Location, \"A partial method `{0}' implementation is already defined\",\n\t\t\t\t\t\t\tmember.GetSignatureForError ());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (ce);\n\n\t\t\t\t\tbool is_reserved_a = member is AbstractPropertyEventMethod || member is Operator;\n\t\t\t\t\tbool is_reserved_b = ((MethodSpec) ce).IsReservedMethod;\n\n\t\t\t\t\tif (is_reserved_a || is_reserved_b) {\n\t\t\t\t\t\tReport.Error (82, member.Location, \"A member `{0}' is already reserved\",\n\t\t\t\t\t\t\tis_reserved_a ?\n\t\t\t\t\t\t\tce.GetSignatureForError () :\n\t\t\t\t\t\t\tmember.GetSignatureForError ());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (ce);\n\t\t\t\t}\n\n\t\t\t\tif (member is Operator && ce.Kind == MemberKind.Operator) {\n\t\t\t\t\tReport.Error (557, member.Location, \"Duplicate user-defined conversion in type `{0}'\",\n\t\t\t\t\t\tmember.Parent.GetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tReport.Error (111, member.Location,\n\t\t\t\t\t\"A member `{0}' is already defined. Rename this member or use different parameter types\",\n\t\t\t\t\tmember.GetSignatureForError ());\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs",
    "content": "//\n// method.cs: Method based declarations\n//\n// Authors: Miguel de Icaza (miguel@gnu.org)\n//          Martin Baulig (martin@ximian.com)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc.\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Security;\nusing System.Security.Permissions;\nusing System.Text;\nusing System.Linq;\nusing Mono.CompilerServices.SymbolWriter;\nusing System.Runtime.CompilerServices;\n\n#if NET_2_1\nusing XmlElement = System.Object;\n#else\nusing System.Xml;\n#endif\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing SecurityType = System.Collections.Generic.List<IKVM.Reflection.Emit.CustomAttributeBuilder>;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing MetaType = System.Type;\nusing SecurityType = System.Collections.Generic.Dictionary<System.Security.Permissions.SecurityAction, System.Security.PermissionSet>;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\tpublic abstract class MethodCore : InterfaceMemberBase, IParametersMember\n\t{\n\t\tprotected ParametersCompiled parameters;\n\t\tprotected ToplevelBlock block;\n\t\tprotected MethodSpec spec;\n\n\t\tprotected MethodCore (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod,\n\t\t\tMemberName name, Attributes attrs, ParametersCompiled parameters)\n\t\t\t: base (parent, type, mod, allowed_mod, name, attrs)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t}\n\n\t\tpublic override Variance ExpectedMemberTypeVariance {\n\t\t\tget {\n\t\t\t\treturn Variance.Covariant;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t//  Returns the System.Type array for the parameters of this method\n\t\t//\n\t\tpublic TypeSpec [] ParameterTypes {\n\t\t\tget {\n\t\t\t\treturn parameters.Types;\n\t\t\t}\n\t\t}\n\n\t\tpublic ParametersCompiled ParameterInfo {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\tAParametersCollection IParametersMember.Parameters {\n\t\t\tget { return parameters; }\n\t\t}\n\t\t\n\t\tpublic ToplevelBlock Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\n\t\t\tset {\n\t\t\t\tblock = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic CallingConventions CallingConventions {\n\t\t\tget {\n\t\t\t\tCallingConventions cc = parameters.CallingConvention;\n\t\t\t\tif (!IsInterface)\n\t\t\t\t\tif ((ModFlags & Modifiers.STATIC) == 0)\n\t\t\t\t\t\tcc |= CallingConventions.HasThis;\n\n\t\t\t\t// FIXME: How is `ExplicitThis' used in C#?\n\t\t\t\n\t\t\t\treturn cc;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool CheckOverrideAgainstBase (MemberSpec base_member)\n\t\t{\n\t\t\tbool res = base.CheckOverrideAgainstBase (base_member);\n\n\t\t\t//\n\t\t\t// Check that the permissions are not being changed\n\t\t\t//\n\t\t\tif (!CheckAccessModifiers (this, base_member)) {\n\t\t\t\tError_CannotChangeAccessModifiers (this, base_member);\n\t\t\t\tres = false;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tprotected override bool CheckBase ()\n\t\t{\n\t\t\t// Check whether arguments were correct.\n\t\t\tif (!DefineParameters (parameters))\n\t\t\t\treturn false;\n\n\t\t\treturn base.CheckBase ();\n\t\t}\n\n\t\t//\n\t\t//   Represents header string for documentation comment.\n\t\t//\n\t\tpublic override string DocCommentHeader \n\t\t{\n\t\t\tget { return \"M:\"; }\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tif ((ModFlags & Modifiers.COMPILER_GENERATED) == 0) {\n\t\t\t\tparameters.CheckConstraints (this);\n\t\t\t}\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic override bool EnableOverloadChecks (MemberCore overload)\n\t\t{\n\t\t\tif (overload is MethodCore) {\n\t\t\t\tcaching_flags |= Flags.MethodOverloadsExist;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (overload is AbstractPropertyEventMethod)\n\t\t\t\treturn true;\n\n\t\t\treturn base.EnableOverloadChecks (overload);\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tstring s = base.GetSignatureForDocumentation ();\n\t\t\tif (MemberName.Arity > 0)\n\t\t\t\ts += \"``\" + MemberName.Arity.ToString ();\n\n\t\t\treturn s + parameters.GetSignatureForDocumentation ();\n\t\t}\n\n\t\tpublic MethodSpec Spec {\n\t\t\tget { return spec; }\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\tif (parameters.HasArglist) {\n\t\t\t\tReport.Warning (3000, 1, Location, \"Methods with variable arguments are not CLS-compliant\");\n\t\t\t}\n\n\t\t\tif (member_type != null && !member_type.IsCLSCompliant ()) {\n\t\t\t\tReport.Warning (3002, 1, Location, \"Return type of `{0}' is not CLS-compliant\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\n\t\t\tparameters.VerifyClsCompliance (this);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic interface IGenericMethodDefinition : IMethodDefinition\n\t{\n\t\tTypeParameterSpec[] TypeParameters { get; }\n\t\tint TypeParametersCount { get; }\n\n//\t\tMethodInfo MakeGenericMethod (TypeSpec[] targs);\n\t}\n\n\tpublic sealed class MethodSpec : MemberSpec, IParametersMember\n\t{\n\t\tMethodBase inflatedMetaInfo;\n\t\tAParametersCollection parameters;\n\t\tTypeSpec returnType;\n\n\t\tTypeSpec[] targs;\n\t\tTypeParameterSpec[] constraints;\n\n\t\tpublic static readonly MethodSpec Excluded = new MethodSpec (MemberKind.Method, InternalType.FakeInternalType, null, null, ParametersCompiled.EmptyReadOnlyParameters, 0);\n\n\t\tpublic MethodSpec (MemberKind kind, TypeSpec declaringType, IMethodDefinition details, TypeSpec returnType,\n\t\t\tAParametersCollection parameters, Modifiers modifiers)\n\t\t\t: base (kind, declaringType, details, modifiers)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t\tthis.returnType = returnType;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override int Arity {\n\t\t\tget {\n\t\t\t\treturn IsGeneric ? GenericDefinition.TypeParametersCount : 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec[] Constraints {\n\t\t\tget {\n\t\t\t\tif (constraints == null && IsGeneric)\n\t\t\t\t\tconstraints = GenericDefinition.TypeParameters;\n\n\t\t\t\treturn constraints;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConstructor {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.Constructor;\n\t\t\t}\n\t\t}\n\n\t\tpublic new IMethodDefinition MemberDefinition {\n\t\t\tget {\n\t\t\t\treturn (IMethodDefinition) definition;\n\t\t\t}\n\t\t}\n\n\t\tpublic IGenericMethodDefinition GenericDefinition {\n\t\t\tget {\n\t\t\t\treturn (IGenericMethodDefinition) definition;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAsync {\n\t\t\tget {\n\t\t\t\treturn (Modifiers & Modifiers.ASYNC) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsExtensionMethod {\n\t\t\tget {\n\t\t\t\treturn IsStatic && parameters.HasExtensionMethodType;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsSealed {\n\t\t\tget {\n\t\t\t\treturn (Modifiers & Modifiers.SEALED) != 0;\n\t\t\t}\n\t\t}\n\n\t\t// When is virtual or abstract\n\t\tpublic bool IsVirtual {\n\t\t\tget {\n\t\t\t\treturn (Modifiers & (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE)) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsReservedMethod {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.Operator || IsAccessor;\n\t\t\t}\n\t\t}\n\n\t\tTypeSpec IInterfaceMemberSpec.MemberType {\n\t\t\tget {\n\t\t\t\treturn returnType;\n\t\t\t}\n\t\t}\n\n\t\tpublic AParametersCollection Parameters {\n\t\t\tget { \n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec ReturnType {\n\t\t\tget {\n\t\t\t\treturn returnType;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec[] TypeArguments {\n\t\t\tget {\n\t\t\t\treturn targs;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic MethodSpec GetGenericMethodDefinition ()\n\t\t{\n\t\t\tif (!IsGeneric && !DeclaringType.IsGeneric)\n\t\t\t\treturn this;\n\n\t\t\treturn MemberCache.GetMember (declaringType, this);\n\t\t}\n\n\t\tpublic MethodBase GetMetaInfo ()\n\t\t{\n\t\t\t//\n\t\t\t// inflatedMetaInfo is extra field needed for cases where we\n\t\t\t// inflate method but another nested type can later inflate\n\t\t\t// again (the cache would be build with inflated metaInfo) and\n\t\t\t// TypeBuilder can work with method definitions only\n\t\t\t//\n\t\t\tif (inflatedMetaInfo == null) {\n\t\t\t\tif ((state & StateFlags.PendingMetaInflate) != 0) {\n\t\t\t\t\tvar dt_meta = DeclaringType.GetMetaInfo ();\n\n\t\t\t\t\tif (DeclaringType.IsTypeBuilder) {\n\t\t\t\t\t\tif (IsConstructor)\n\t\t\t\t\t\t\tinflatedMetaInfo = TypeBuilder.GetConstructor (dt_meta, (ConstructorInfo) MemberDefinition.Metadata);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinflatedMetaInfo = TypeBuilder.GetMethod (dt_meta, (MethodInfo) MemberDefinition.Metadata);\n\t\t\t\t\t} else {\n#if STATIC\n\t\t\t\t\t\t// it should not be reached\n\t\t\t\t\t\tthrow new NotImplementedException ();\n#else\n\t\t\t\t\t\tinflatedMetaInfo = MethodInfo.GetMethodFromHandle (MemberDefinition.Metadata.MethodHandle, dt_meta.TypeHandle);\n#endif\n\t\t\t\t\t}\n\n\t\t\t\t\tstate &= ~StateFlags.PendingMetaInflate;\n\t\t\t\t} else {\n\t\t\t\t\tinflatedMetaInfo = MemberDefinition.Metadata;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((state & StateFlags.PendingMakeMethod) != 0) {\n\t\t\t\tvar sre_targs = new MetaType[targs.Length];\n\t\t\t\tfor (int i = 0; i < sre_targs.Length; ++i)\n\t\t\t\t\tsre_targs[i] = targs[i].GetMetaInfo ();\n\n\t\t\t\tinflatedMetaInfo = ((MethodInfo) inflatedMetaInfo).MakeGenericMethod (sre_targs);\n\t\t\t\tstate &= ~StateFlags.PendingMakeMethod;\n\t\t\t}\n\n\t\t\treturn inflatedMetaInfo;\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tstring name;\n\t\t\tswitch (Kind) {\n\t\t\tcase MemberKind.Constructor:\n\t\t\t\tname = \"#ctor\";\n\t\t\t\tbreak;\n\t\t\tcase MemberKind.Method:\n\t\t\t\tif (Arity > 0)\n\t\t\t\t\tname = Name + \"``\" + Arity.ToString ();\n\t\t\t\telse\n\t\t\t\t\tname = Name;\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tname = Name;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tname = DeclaringType.GetSignatureForDocumentation () + \".\" + name + parameters.GetSignatureForDocumentation ();\n\t\t\tif (Kind == MemberKind.Operator) {\n\t\t\t\tvar op = Operator.GetType (Name).Value;\n\t\t\t\tif (op == Operator.OpType.Explicit || op == Operator.OpType.Implicit) {\n\t\t\t\t\tname += \"~\" + ReturnType.GetSignatureForDocumentation ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn name;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tstring name;\n\t\t\tif (IsConstructor) {\n\t\t\t\tname = DeclaringType.GetSignatureForError () + \".\" + DeclaringType.Name;\n\t\t\t} else if (Kind == MemberKind.Operator) {\n\t\t\t\tvar op = Operator.GetType (Name).Value;\n\t\t\t\tif (op == Operator.OpType.Implicit || op == Operator.OpType.Explicit) {\n\t\t\t\t\tname = DeclaringType.GetSignatureForError () + \".\" + Operator.GetName (op) + \" operator \" + returnType.GetSignatureForError ();\n\t\t\t\t} else {\n\t\t\t\t\tname = DeclaringType.GetSignatureForError () + \".operator \" + Operator.GetName (op);\n\t\t\t\t}\n\t\t\t} else if (IsAccessor) {\n\t\t\t\tint split = Name.IndexOf ('_');\n\t\t\t\tname = Name.Substring (split + 1);\n\t\t\t\tvar postfix = Name.Substring (0, split);\n\t\t\t\tif (split == 3) {\n\t\t\t\t\tvar pc = parameters.Count;\n\t\t\t\t\tif (pc > 0 && postfix == \"get\") {\n\t\t\t\t\t\tname = \"this\" + parameters.GetSignatureForError (\"[\", \"]\", pc);\n\t\t\t\t\t} else if (pc > 1 && postfix == \"set\") {\n\t\t\t\t\t\tname = \"this\" + parameters.GetSignatureForError (\"[\", \"]\", pc - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn DeclaringType.GetSignatureForError () + \".\" + name + \".\" + postfix;\n\t\t\t} else {\n\t\t\t\tname = base.GetSignatureForError ();\n\t\t\t\tif (targs != null)\n\t\t\t\t\tname += \"<\" + TypeManager.CSharpName (targs) + \">\";\n\t\t\t\telse if (IsGeneric)\n\t\t\t\t\tname += \"<\" + TypeManager.CSharpName (GenericDefinition.TypeParameters) + \">\";\n\t\t\t}\n\n\t\t\treturn name + parameters.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar ms = (MethodSpec) base.InflateMember (inflator);\n\t\t\tms.inflatedMetaInfo = null;\n\t\t\tms.returnType = inflator.Inflate (returnType);\n\t\t\tms.parameters = parameters.Inflate (inflator);\n\t\t\tif (IsGeneric)\n\t\t\t\tms.constraints = TypeParameterSpec.InflateConstraints (inflator, Constraints);\n\n\t\t\treturn ms;\n\t\t}\n\n\t\tpublic MethodSpec MakeGenericMethod (IMemberContext context, params TypeSpec[] targs)\n\t\t{\n\t\t\tif (targs == null)\n\t\t\t\tthrow new ArgumentNullException ();\n// TODO MemberCache\n//\t\t\tif (generic_intances != null && generic_intances.TryGetValue (targs, out ginstance))\n//\t\t\t\treturn ginstance;\n\n\t\t\t//if (generic_intances == null)\n\t\t\t//    generic_intances = new Dictionary<TypeSpec[], Method> (TypeSpecArrayComparer.Default);\n\n\t\t\tvar inflator = new TypeParameterInflator (context, DeclaringType, GenericDefinition.TypeParameters, targs);\n\n\t\t\tvar inflated = (MethodSpec) MemberwiseClone ();\n\t\t\tinflated.declaringType = inflator.TypeInstance;\n\t\t\tinflated.returnType = inflator.Inflate (returnType);\n\t\t\tinflated.parameters = parameters.Inflate (inflator);\n\t\t\tinflated.targs = targs;\n\t\t\tinflated.constraints = TypeParameterSpec.InflateConstraints (inflator, constraints ?? GenericDefinition.TypeParameters);\n\t\t\tinflated.state |= StateFlags.PendingMakeMethod;\n\n\t\t\t//\t\t\tif (inflated.parent == null)\n\t\t\t//\t\t\t\tinflated.parent = parent;\n\n\t\t\t//generic_intances.Add (targs, inflated);\n\t\t\treturn inflated;\n\t\t}\n\n\t\tpublic MethodSpec Mutate (TypeParameterMutator mutator)\n\t\t{\n\t\t\tvar targs = TypeArguments;\n\t\t\tif (targs != null)\n\t\t\t\ttargs = mutator.Mutate (targs);\n\n\t\t\tvar decl = DeclaringType;\n\t\t\tif (DeclaringType.IsGenericOrParentIsGeneric) {\n\t\t\t\tdecl = mutator.Mutate (decl);\n\t\t\t}\n\n\t\t\tif (targs == TypeArguments && decl == DeclaringType)\n\t\t\t\treturn this;\n\n\t\t\tvar ms = (MethodSpec) MemberwiseClone ();\n\t\t\tif (decl != DeclaringType) {\n\t\t\t\tms.inflatedMetaInfo = null;\n\t\t\t\tms.declaringType = decl;\n\t\t\t\tms.state |= StateFlags.PendingMetaInflate;\n\t\t\t}\n\n\t\t\tif (targs != null) {\n\t\t\t\tms.targs = targs;\n\t\t\t\tms.state |= StateFlags.PendingMakeMethod;\n\t\t\t}\n\n\t\t\treturn ms;\n\t\t}\n\n\t\tpublic override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\tvar missing = returnType.ResolveMissingDependencies (this);\n\t\t\tforeach (var pt in parameters.Types) {\n\t\t\t\tvar m = pt.GetMissingDependencies (this);\n\t\t\t\tif (m == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (missing == null)\n\t\t\t\t\tmissing = new List<MissingTypeSpecReference> ();\n\n\t\t\t\tmissing.AddRange (m);\n\t\t\t}\n\n\t\t\tif (Arity > 0) {\n\t\t\t\tforeach (var tp in GenericDefinition.TypeParameters) {\n\t\t\t\t\tvar m = tp.GetMissingDependencies (this);\n\n\t\t\t\t\tif (m == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (missing == null)\n\t\t\t\t\t\tmissing = new List<MissingTypeSpecReference> ();\n\n\t\t\t\t\tmissing.AddRange (m);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn missing;\t\t\t\n\t\t}\n\t}\n\n\tpublic abstract class MethodOrOperator : MethodCore, IMethodData, IMethodDefinition\n\t{\n\t\tReturnParameter return_attributes;\n\t\tSecurityType declarative_security;\n\t\tprotected MethodData MethodData;\n\n\t\tstatic readonly string[] attribute_targets = new string [] { \"method\", \"return\" };\n\n\t\tprotected MethodOrOperator (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name,\n\t\t\t\tAttributes attrs, ParametersCompiled parameters)\n\t\t\t: base (parent, type, mod, allowed_mod, name, attrs, parameters)\n\t\t{\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Target == AttributeTargets.ReturnValue) {\n\t\t\t\tif (return_attributes == null)\n\t\t\t\t\treturn_attributes = new ReturnParameter (this, MethodBuilder, Location);\n\n\t\t\t\treturn_attributes.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.MethodImpl) {\n\t\t\t\tif ((ModFlags & Modifiers.ASYNC) != 0 && (a.GetMethodImplOptions () & MethodImplOptions.Synchronized) != 0) {\n\t\t\t\t\tReport.Error (4015, a.Location, \"`{0}': Async methods cannot use `MethodImplOptions.Synchronized'\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tis_external_implementation = a.IsInternalCall ();\n\t\t\t} else if (a.Type == pa.DllImport) {\n\t\t\t\tconst Modifiers extern_static = Modifiers.EXTERN | Modifiers.STATIC;\n\t\t\t\tif ((ModFlags & extern_static) != extern_static) {\n\t\t\t\t\tReport.Error (601, a.Location, \"The DllImport attribute must be specified on a method marked `static' and `extern'\");\n\t\t\t\t}\n\n\t\t\t\tif (MemberName.IsGeneric || Parent.IsGenericOrParentIsGeneric) {\n\t\t\t\t\tReport.Error (7042, a.Location, \n\t\t\t\t\t\t\"The DllImport attribute cannot be applied to a method that is generic or contained in a generic type\");\n\t\t\t\t}\n\n\t\t\t\tis_external_implementation = true;\n\t\t\t}\n\n\t\t\tif (a.IsValidSecurityAttribute ()) {\n\t\t\t\ta.ExtractSecurityPermissionSet (ctor, ref declarative_security);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (MethodBuilder != null)\n\t\t\t\tMethodBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Method; \n\t\t\t}\n\t\t}\n\n\t\tMethodBase IMethodDefinition.Metadata {\n\t\t\tget {\n\t\t\t\treturn MethodData.MethodBuilder;\n\t\t\t}\n\t\t}\n\n\t\t// TODO: Remove and use MethodData abstraction\n\t\tpublic MethodBuilder MethodBuilder {\n\t\t\tget {\n\t\t\t\treturn MethodData.MethodBuilder;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool CheckForDuplications ()\n\t\t{\n\t\t\treturn Parent.MemberCache.CheckExistingMembersOverloads (this, parameters);\n\t\t}\n\n\t\tpublic virtual EmitContext CreateEmitContext (ILGenerator ig, SourceMethodBuilder sourceMethod)\n\t\t{\n\t\t\treturn new EmitContext (this, ig, MemberType, sourceMethod);\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (!CheckBase ())\n\t\t\t\treturn false;\n\n\t\t\tMemberKind kind;\n\t\t\tif (this is Operator)\n\t\t\t\tkind = MemberKind.Operator;\n\t\t\telse if (this is Destructor)\n\t\t\t\tkind = MemberKind.Destructor;\n\t\t\telse\n\t\t\t\tkind = MemberKind.Method;\n\n\t\t\tstring explicit_name;\n\n\t\t\tif (IsPartialDefinition) {\n\t\t\t\tcaching_flags &= ~Flags.Excluded_Undetected;\n\t\t\t\tcaching_flags |= Flags.Excluded;\n\n\t\t\t\t// Add to member cache only when a partial method implementation has not been found yet\n\t\t\t\tif ((caching_flags & Flags.PartialDefinitionExists) != 0)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (IsExplicitImpl)\n\t\t\t\t\treturn true;\n\n\t\t\t\texplicit_name = null;\n\t\t\t} else {\n\t\t\t\tMethodData = new MethodData (this, ModFlags, flags, this, base_method);\n\n\t\t\t\tif (!MethodData.Define (Parent.PartialContainer, GetFullName (MemberName)))\n\t\t\t\t\treturn false;\n\n\t\t\t\texplicit_name = MethodData.MetadataName;\n\t\t\t}\n\n\t\t\tspec = new MethodSpec (kind, Parent.Definition, this, ReturnType, parameters, ModFlags);\n\t\t\tif (MemberName.Arity > 0)\n\t\t\t\tspec.IsGeneric = true;\n\n\t\t\tParent.MemberCache.AddMember (this, explicit_name, spec);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoMemberTypeIndependentChecks ()\n\t\t{\n\t\t\tbase.DoMemberTypeIndependentChecks ();\n\n\t\t\tCheckAbstractAndExtern (block != null);\n\n\t\t\tif ((ModFlags & Modifiers.PARTIAL) != 0) {\n\t\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\t\tIParameterData p = parameters.FixedParameters [i];\n\t\t\t\t\tif ((p.ModFlags & Parameter.Modifier.OUT) != 0) {\n\t\t\t\t\t\tReport.Error (752, Location, \"`{0}': A partial method parameters cannot use `out' modifier\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (p.HasDefaultValue && IsPartialImplementation)\n\t\t\t\t\t\t((Parameter) p).Warning_UselessOptionalParameter (Report);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override void DoMemberTypeDependentChecks ()\n\t\t{\n\t\t\tbase.DoMemberTypeDependentChecks ();\n\n\t\t\tif (MemberType.IsStatic) {\n\t\t\t\tError_StaticReturnType ();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tif ((ModFlags & Modifiers.COMPILER_GENERATED) != 0 && !Parent.IsCompilerGenerated)\n\t\t\t\tModule.PredefinedAttributes.CompilerGenerated.EmitAttribute (MethodBuilder);\n\t\t\tif ((ModFlags & Modifiers.DEBUGGER_HIDDEN) != 0)\n\t\t\t\tModule.PredefinedAttributes.DebuggerHidden.EmitAttribute (MethodBuilder);\n\t\t\tif ((ModFlags & Modifiers.DEBUGGER_STEP_THROUGH) != 0)\n\t\t\t\tModule.PredefinedAttributes.DebuggerStepThrough.EmitAttribute (MethodBuilder);\n\n\t\t\tif (ReturnType.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\treturn_attributes = new ReturnParameter (this, MethodBuilder, Location);\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (return_attributes.Builder);\n\t\t\t} else if (ReturnType.HasDynamicElement) {\n\t\t\t\treturn_attributes = new ReturnParameter (this, MethodBuilder, Location);\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (return_attributes.Builder, ReturnType, Location);\n\t\t\t}\n\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tif (declarative_security != null) {\n\t\t\t\tforeach (var de in declarative_security) {\n#if STATIC\n\t\t\t\t\tMethodBuilder.__AddDeclarativeSecurity (de);\n#else\n\t\t\t\t\tMethodBuilder.AddDeclarativeSecurity (de.Key, de.Value);\n#endif\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (type_expr != null)\n\t\t\t\tConstraintChecker.Check (this, member_type, type_expr.Location);\n\n\t\t\tbase.Emit ();\n\n\t\t\tif (MethodData != null)\n\t\t\t\tMethodData.Emit (Parent);\n\n\t\t\tif (block != null && block.StateMachine is AsyncTaskStorey) {\n\t\t\t\tvar psm = Module.PredefinedAttributes.AsyncStateMachine;\n\t\t\t\tpsm.EmitAttribute (MethodBuilder, block.StateMachine);\n\t\t\t}\n\n\t\t\tif ((ModFlags & Modifiers.PARTIAL) == 0)\n\t\t\t\tBlock = null;\n\t\t}\n\n\t\tprotected void Error_ConditionalAttributeIsNotValid ()\n\t\t{\n\t\t\tReport.Error (577, Location,\n\t\t\t\t\"Conditional not valid on `{0}' because it is a constructor, destructor, operator or explicit interface implementation\",\n\t\t\t\tGetSignatureForError ());\n\t\t}\n\n\t\tpublic bool IsPartialDefinition {\n\t\t\tget {\n\t\t\t\treturn (ModFlags & Modifiers.PARTIAL) != 0 && Block == null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsPartialImplementation {\n\t\t\tget {\n\t\t\t\treturn (ModFlags & Modifiers.PARTIAL) != 0 && Block != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\n\t\t#region IMethodData Members\n\n\t\tbool IMethodData.IsAccessor {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec ReturnType {\n\t\t\tget {\n\t\t\t\treturn MemberType;\n\t\t\t}\n\t\t}\n\n\t\tpublic MemberName MethodName {\n\t\t\tget {\n\t\t\t\treturn MemberName;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if method has conditional attribute and the conditions is not defined (method is excluded).\n\t\t/// </summary>\n\t\tpublic override string[] ConditionalConditions ()\n\t\t{\n\t\t\tif ((caching_flags & (Flags.Excluded_Undetected | Flags.Excluded)) == 0)\n\t\t\t\treturn null;\n\n\t\t\tif ((ModFlags & Modifiers.PARTIAL) != 0 && (caching_flags & Flags.Excluded) != 0)\n\t\t\t\treturn new string [0];\n\n\t\t\tcaching_flags &= ~Flags.Excluded_Undetected;\n\t\t\tstring[] conditions;\n\n\t\t\tif (base_method == null) {\n\t\t\t\tif (OptAttributes == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tAttribute[] attrs = OptAttributes.SearchMulti (Module.PredefinedAttributes.Conditional);\n\t\t\t\tif (attrs == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tconditions = new string[attrs.Length];\n\t\t\t\tfor (int i = 0; i < conditions.Length; ++i)\n\t\t\t\t\tconditions[i] = attrs[i].GetConditionalAttributeValue ();\n\t\t\t} else {\n\t\t\t\tconditions = base_method.MemberDefinition.ConditionalConditions();\n\t\t\t}\n\n\t\t\tif (conditions != null)\n\t\t\t\tcaching_flags |= Flags.Excluded;\n\n\t\t\treturn conditions;\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic virtual void PrepareEmit ()\n\t\t{\n\t\t\tvar mb = MethodData.DefineMethodBuilder (Parent);\n\n\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\tstring[] gnames = new string[CurrentTypeParameters.Count];\n\t\t\t\tfor (int i = 0; i < gnames.Length; ++i) {\n\t\t\t\t\tgnames[i] = CurrentTypeParameters[i].Name;\n\t\t\t\t}\n\n\t\t\t\tvar gen_params = MethodBuilder.DefineGenericParameters (gnames);\n\n\t\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\t\tvar tp = CurrentTypeParameters[i];\n\n\t\t\t\t\ttp.Define (gen_params[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Generic method has been already defined to resolve method parameters\n\t\t\t// correctly when they use type parameters\n\t\t\t//\n\t\t\tmb.SetParameters (parameters.GetMetaInfo ());\n\t\t\tmb.SetReturnType (ReturnType.GetMetaInfo ());\n\t\t}\n\n\t\tpublic override void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tif (MethodData != null && !IsPartialDefinition)\n\t\t\t\tMethodData.WriteDebugSymbol (file);\n\t\t}\n\t}\n\n\tpublic class Method : MethodOrOperator, IGenericMethodDefinition\n\t{\n\t\tMethod partialMethodImplementation;\n\n\t\tpublic Method (TypeDefinition parent, FullNamedExpression return_type, Modifiers mod, MemberName name, ParametersCompiled parameters, Attributes attrs)\n\t\t\t: base (parent, return_type, mod,\n\t\t\t\tparent.PartialContainer.Kind == MemberKind.Interface ? AllowedModifiersInterface :\n\t\t\t\tparent.PartialContainer.Kind == MemberKind.Struct ? AllowedModifiersStruct | Modifiers.ASYNC :\n\t\t\t\tAllowedModifiersClass | Modifiers.ASYNC,\n\t\t\t\tname, attrs, parameters)\n\t\t{\n\t\t}\n\n\t\tprotected Method (TypeDefinition parent, FullNamedExpression return_type, Modifiers mod, Modifiers amod,\n\t\t\t\t\tMemberName name, ParametersCompiled parameters, Attributes attrs)\n\t\t\t: base (parent, return_type, mod, amod, name, attrs, parameters)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override TypeParameters CurrentTypeParameters {\n\t\t\tget {\n\t\t\t\treturn MemberName.TypeParameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec[] TypeParameters {\n\t\t\tget {\n\t\t\t\treturn CurrentTypeParameters.Types;\n\t\t\t}\n\t\t}\n\n\t\tpublic int TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn CurrentTypeParameters == null ? 0 : CurrentTypeParameters.Count;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic static Method Create (TypeDefinition parent, FullNamedExpression returnType, Modifiers mod,\n\t\t\t\t   MemberName name, ParametersCompiled parameters, Attributes attrs)\n\t\t{\n\t\t\tvar m = new Method (parent, returnType, mod, name, parameters, attrs);\n\n\t\t\tif ((mod & Modifiers.PARTIAL) != 0) {\n\t\t\t\tconst Modifiers invalid_partial_mod = Modifiers.AccessibilityMask | Modifiers.ABSTRACT | Modifiers.EXTERN |\n\t\t\t\t\tModifiers.NEW | Modifiers.OVERRIDE | Modifiers.SEALED | Modifiers.VIRTUAL;\n\n\t\t\t\tif ((mod & invalid_partial_mod) != 0) {\n\t\t\t\t\tm.Report.Error (750, m.Location,\n\t\t\t\t\t\t\"A partial method cannot define access modifier or any of abstract, extern, new, override, sealed, or virtual modifiers\");\n\t\t\t\t\tmod &= ~invalid_partial_mod;\n\t\t\t\t}\n\n\t\t\t\tif ((parent.ModFlags & Modifiers.PARTIAL) == 0) {\n\t\t\t\t\tm.Report.Error (751, m.Location, \n\t\t\t\t\t\t\"A partial method must be declared within a partial class or partial struct\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((mod & Modifiers.STATIC) == 0 && parameters.HasExtensionMethodType) {\n\t\t\t\tm.Report.Error (1105, m.Location, \"`{0}': Extension methods must be declared static\",\n\t\t\t\t\tm.GetSignatureForError ());\n\t\t\t}\n\n\n\t\t\treturn m;\n\t\t}\n\n\t\tpublic override string GetSignatureForError()\n\t\t{\n\t\t\treturn base.GetSignatureForError () + parameters.GetSignatureForError ();\n\t\t}\n\n\t\tvoid Error_DuplicateEntryPoint (Method b)\n\t\t{\n\t\t\tReport.Error (17, b.Location,\n\t\t\t\t\"Program `{0}' has more than one entry point defined: `{1}'\",\n\t\t\t\tb.Module.Builder.ScopeName, b.GetSignatureForError ());\n\t\t}\n\n\t\tbool IsEntryPoint ()\n\t\t{\n\t\t\tif (ReturnType.Kind != MemberKind.Void && ReturnType.BuiltinType != BuiltinTypeSpec.Type.Int)\n\t\t\t\treturn false;\n\n\t\t\tif (parameters.IsEmpty)\n\t\t\t\treturn true;\n\n\t\t\tif (parameters.Count > 1)\n\t\t\t\treturn false;\n\n\t\t\tvar ac = parameters.Types [0] as ArrayContainer;\n\t\t\treturn ac != null && ac.Rank == 1 && ac.Element.BuiltinType == BuiltinTypeSpec.Type.String &&\n\t\t\t\t\t(parameters[0].ModFlags & Parameter.Modifier.RefOutMask) == 0;\n\t\t}\n\n\t\tpublic override FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\tif (arity == 0) {\n\t\t\t\tvar tp = CurrentTypeParameters;\n\t\t\t\tif (tp != null) {\n\t\t\t\t\tTypeParameter t = tp.Find (name);\n\t\t\t\t\tif (t != null)\n\t\t\t\t\t\treturn new TypeParameterExpr (t, loc);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.LookupNamespaceOrType (name, arity, mode, loc);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.Conditional) {\n\t\t\t\tif (IsExplicitImpl) {\n\t\t\t\t\tError_ConditionalAttributeIsNotValid ();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ((ModFlags & Modifiers.OVERRIDE) != 0) {\n\t\t\t\t\tReport.Error (243, Location, \"Conditional not valid on `{0}' because it is an override method\", GetSignatureForError ());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (ReturnType.Kind != MemberKind.Void) {\n\t\t\t\t\tReport.Error (578, Location, \"Conditional not valid on `{0}' because its return type is not void\", GetSignatureForError ());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (IsInterface) {\n\t\t\t\t\tReport.Error (582, Location, \"Conditional not valid on interface members\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (MethodData.implementing != null) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (MethodData.implementing.DeclaringType);\n\t\t\t\t\tReport.Error (629, Location, \"Conditional member `{0}' cannot implement interface member `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), TypeManager.CSharpSignature (MethodData.implementing));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\t\tif ((parameters.FixedParameters [i].ModFlags & Parameter.Modifier.OUT) != 0) {\n\t\t\t\t\t\tReport.Error (685, Location, \"Conditional method `{0}' cannot have an out parameter\", GetSignatureForError ());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Extension) {\n\t\t\t\ta.Error_MisusedExtensionAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tvoid CreateTypeParameters ()\n\t\t{\n\t\t\tvar tparams = MemberName.TypeParameters;\n\t\t\tvar parent_tparams = Parent.TypeParametersAll;\n\n\t\t\tfor (int i = 0; i < MemberName.Arity; i++) {\n\t\t\t\tstring type_argument_name = tparams[i].MemberName.Name;\n\n\t\t\t\tif (block == null) {\n\t\t\t\t\tint idx = parameters.GetParameterIndexByName (type_argument_name);\n\t\t\t\t\tif (idx >= 0) {\n\t\t\t\t\t\tvar b = block;\n\t\t\t\t\t\tif (b == null)\n\t\t\t\t\t\t\tb = new ToplevelBlock (Compiler, Location);\n\n\t\t\t\t\t\tb.Error_AlreadyDeclaredTypeParameter (type_argument_name, parameters[i].Location);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tINamedBlockVariable variable = null;\n\t\t\t\t\tblock.GetLocalName (type_argument_name, block, ref variable);\n\t\t\t\t\tif (variable != null)\n\t\t\t\t\t\tvariable.Block.Error_AlreadyDeclaredTypeParameter (type_argument_name, variable.Location);\n\t\t\t\t}\n\n\t\t\t\tif (parent_tparams != null) {\n\t\t\t\t\tvar tp = parent_tparams.Find (type_argument_name);\n\t\t\t\t\tif (tp != null) {\n\t\t\t\t\t\ttparams[i].WarningParentNameConflict (tp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttparams.Create (null, 0, Parent);\n\t\t}\n\n\t\tprotected virtual void DefineTypeParameters ()\n\t\t{\n\t\t\tvar tparams = CurrentTypeParameters;\n\n\t\t\tTypeParameterSpec[] base_tparams = null;\n\t\t\tTypeParameterSpec[] base_decl_tparams = TypeParameterSpec.EmptyTypes;\n\t\t\tTypeSpec[] base_targs = TypeSpec.EmptyTypes;\n\t\t\tif (((ModFlags & Modifiers.OVERRIDE) != 0 || IsExplicitImpl)) {\n\t\t\t\tMethodSpec base_override = base_method ?? MethodData.implementing;\n\n\t\t\t\tif (base_override != null) {\n\t\t\t\t\tbase_tparams = base_override.GenericDefinition.TypeParameters;\n\n\t\t\t\t\tif (base_override.DeclaringType.IsGeneric) {\n\t\t\t\t\t\tbase_decl_tparams = base_override.DeclaringType.MemberDefinition.TypeParameters;\n\n\t\t\t\t\t\tif (base_method != null) {\n\t\t\t\t\t\t\tvar base_type_parent = CurrentType;\n\t\t\t\t\t\t\twhile (base_type_parent.BaseType != base_override.DeclaringType) {\n\t\t\t\t\t\t\t\tbase_type_parent = base_type_parent.BaseType;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbase_targs = base_type_parent.BaseType.TypeArguments;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tforeach (var iface in Parent.CurrentType.Interfaces) {\n\t\t\t\t\t\t\t\tif (iface == base_override.DeclaringType) {\n\t\t\t\t\t\t\t\t\tbase_targs = iface.TypeArguments;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (base_override.IsGeneric) {\n\t\t\t\t\t\tObsoleteAttribute oa;\n\t\t\t\t\t\tforeach (var base_tp in base_tparams) {\n\t\t\t\t\t\t\toa = base_tp.BaseType.GetAttributeObsolete ();\n\t\t\t\t\t\t\tif (oa != null) {\n\t\t\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, base_tp.BaseType.GetSignatureForError (), Location, Report);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (base_tp.InterfacesDefined != null) {\n\t\t\t\t\t\t\t\tforeach (var iface in base_tp.InterfacesDefined) {\n\t\t\t\t\t\t\t\t\toa = iface.GetAttributeObsolete ();\n\t\t\t\t\t\t\t\t\tif (oa != null) {\n\t\t\t\t\t\t\t\t\t\tAttributeTester.Report_ObsoleteMessage (oa, iface.GetSignatureForError (), Location, Report);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (base_decl_tparams.Length != 0) {\n\t\t\t\t\t\t\tbase_decl_tparams = base_decl_tparams.Concat (base_tparams).ToArray ();\n\t\t\t\t\t\t\tbase_targs = base_targs.Concat (tparams.Types).ToArray ();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbase_decl_tparams = base_tparams;\n\t\t\t\t\t\t\tbase_targs = tparams.Types;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < tparams.Count; ++i) {\n\t\t\t\tvar tp = tparams [i];\n\n\t\t\t\tif (base_tparams == null) {\n\t\t\t\t\ttp.ResolveConstraints (this);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Copy base constraints for override/explicit methods\n\t\t\t\t//\n\t\t\t\tvar base_tparam = base_tparams [i];\n\t\t\t\tvar local_tparam = tp.Type;\n\t\t\t\tlocal_tparam.SpecialConstraint = base_tparam.SpecialConstraint;\n\n\t\t\t\tvar inflator = new TypeParameterInflator (this, CurrentType, base_decl_tparams, base_targs);\n\t\t\t\tbase_tparam.InflateConstraints (inflator, local_tparam);\n\n\t\t\t\t//\n\t\t\t\t// Check all type argument constraints for possible collision or unification\n\t\t\t\t// introduced by inflating inherited constraints in this context\n\t\t\t\t//\n\t\t\t\t// Conflict example:\n\t\t\t\t//\n\t\t\t\t// class A<T> { virtual void Foo<U> () where U : class, T {} }\n\t\t\t\t// class B : A<int> { override void Foo<U> {} }\n\t\t\t\t//\n\t\t\t\tvar local_tparam_targs = local_tparam.TypeArguments;\n\t\t\t\tif (local_tparam_targs != null) {\n\t\t\t\t\tfor (int ii = 0; ii < local_tparam_targs.Length; ++ii) {\n\t\t\t\t\t\tvar ta = local_tparam_targs [ii];\n\t\t\t\t\t\tif (!ta.IsClass && !ta.IsStruct)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tTypeSpec[] unique_tparams = null;\n\t\t\t\t\t\tfor (int iii = ii + 1; iii < local_tparam_targs.Length; ++iii) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Remove any identical or unified constraint types\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tvar tparam_checked = local_tparam_targs [iii];\n\t\t\t\t\t\t\tif (TypeSpecComparer.IsEqual (ta, tparam_checked) || TypeSpec.IsBaseClass (ta, tparam_checked, false)) {\n\t\t\t\t\t\t\t\tunique_tparams = new TypeSpec[local_tparam_targs.Length - 1];\n\t\t\t\t\t\t\t\tArray.Copy (local_tparam_targs, 0, unique_tparams, 0, iii);\n\t\t\t\t\t\t\t\tArray.Copy (local_tparam_targs, iii + 1, unique_tparams, iii, local_tparam_targs.Length - iii - 1);\n\t\t\t\t\t\t\t} else if (!TypeSpec.IsBaseClass (tparam_checked, ta, false)) {\n\t\t\t\t\t\t\t\tConstraints.Error_ConflictingConstraints (this, local_tparam, ta, tparam_checked, Location);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (unique_tparams != null) {\n\t\t\t\t\t\t\tlocal_tparam_targs = unique_tparams;\n\t\t\t\t\t\t\tlocal_tparam.TypeArguments = local_tparam_targs;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tConstraints.CheckConflictingInheritedConstraint (local_tparam, ta, this, Location);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (base_tparams == null && MethodData != null && MethodData.implementing != null) {\n\t\t\t\tCheckImplementingMethodConstraints (Parent, spec, MethodData.implementing);\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool CheckImplementingMethodConstraints (TypeContainer container, MethodSpec method, MethodSpec baseMethod)\n\t\t{\n\t\t\tvar tparams = method.Constraints;\n\t\t\tvar base_tparams = baseMethod.Constraints;\n\t\t\tfor (int i = 0; i < tparams.Length; ++i) {\n\t\t\t\tif (!tparams[i].HasSameConstraintsImplementation (base_tparams[i])) {\n\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (method);\n\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (baseMethod);\n\n\t\t\t\t\t// Using container location because the interface can be implemented\n\t\t\t\t\t// by base class\n\t\t\t\t\tvar tp = (tparams [i].MemberDefinition as MemberCore) ?? container;\n\t\t\t\t\tcontainer.Compiler.Report.Error (425, tp.Location,\n\t\t\t\t\t\t\"The constraints for type parameter `{0}' of method `{1}' must match the constraints for type parameter `{2}' of interface method `{3}'. Consider using an explicit interface implementation instead\",\n\t\t\t\t\t\ttparams[i].GetSignatureForError (), method.GetSignatureForError (),\n\t\t\t\t\t\tbase_tparams[i].GetSignatureForError (), baseMethod.GetSignatureForError ());\n \n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Creates the type\n\t\t//\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (member_type.Kind == MemberKind.Void && parameters.IsEmpty && MemberName.Arity == 0 && MemberName.Name == Destructor.MetadataName) {\n\t\t\t\tReport.Warning (465, 1, Location,\n\t\t\t\t\t\"Introducing `Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor?\");\n\t\t\t}\n\n\t\t\tif (Compiler.Settings.StdLib && ReturnType.IsSpecialRuntimeType) {\n\t\t\t\tError1599 (Location, ReturnType, Report);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (CurrentTypeParameters == null) {\n\t\t\t\tif (base_method != null && !IsExplicitImpl) {\n\t\t\t\t\tif (parameters.Count == 1 && ParameterTypes[0].BuiltinType == BuiltinTypeSpec.Type.Object && MemberName.Name == \"Equals\")\n\t\t\t\t\t\tParent.PartialContainer.Mark_HasEquals ();\n\t\t\t\t\telse if (parameters.IsEmpty && MemberName.Name == \"GetHashCode\")\n\t\t\t\t\t\tParent.PartialContainer.Mark_HasGetHashCode ();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tDefineTypeParameters ();\n\t\t\t}\n\n\t\t\tif (block != null) {\n\t\t\t\tif (block.IsIterator) {\n\t\t\t\t\t//\n\t\t\t\t\t// Current method is turned into automatically generated\n\t\t\t\t\t// wrapper which creates an instance of iterator\n\t\t\t\t\t//\n\t\t\t\t\tIterator.CreateIterator (this, Parent.PartialContainer, ModFlags);\n\t\t\t\t\tModFlags |= Modifiers.DEBUGGER_HIDDEN;\n\t\t\t\t}\n\n\t\t\t\tif ((ModFlags & Modifiers.ASYNC) != 0) {\n\t\t\t\t\tif (ReturnType.Kind != MemberKind.Void &&\n\t\t\t\t\t\tReturnType != Module.PredefinedTypes.Task.TypeSpec &&\n\t\t\t\t\t\t!ReturnType.IsGenericTask) {\n\t\t\t\t\t\tReport.Error (1983, Location, \"The return type of an async method must be void, Task, or Task<T>\");\n\t\t\t\t\t}\n\n\t\t\t\t\tblock = (ToplevelBlock) block.ConvertToAsyncTask (this, Parent.PartialContainer, parameters, ReturnType, null, Location);\n\t\t\t\t\tModFlags |= Modifiers.DEBUGGER_STEP_THROUGH;\n\t\t\t\t}\n\n\t\t\t\tif (Compiler.Settings.WriteMetadataOnly)\n\t\t\t\t\tblock = null;\n\t\t\t}\n\n\t\t\tif ((ModFlags & Modifiers.STATIC) == 0)\n\t\t\t\treturn true;\n\n\t\t\tif (parameters.HasExtensionMethodType) {\n\t\t\t\tif (Parent.PartialContainer.IsStatic && !Parent.IsGenericOrParentIsGeneric) {\n\t\t\t\t\tif (!Parent.IsTopLevel)\n\t\t\t\t\t\tReport.Error (1109, Location, \"`{0}': Extension methods cannot be defined in a nested class\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\t\tPredefinedAttribute pa = Module.PredefinedAttributes.Extension;\n\t\t\t\t\tif (!pa.IsDefined) {\n\t\t\t\t\t\tReport.Error (1110, Location,\n\t\t\t\t\t\t\t\"`{0}': Extension methods require `System.Runtime.CompilerServices.ExtensionAttribute' type to be available. Are you missing an assembly reference?\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tModFlags |= Modifiers.METHOD_EXTENSION;\n\t\t\t\t\tParent.PartialContainer.ModFlags |= Modifiers.METHOD_EXTENSION;\n\t\t\t\t\tSpec.DeclaringType.SetExtensionMethodContainer ();\n\t\t\t\t\tParent.Module.HasExtensionMethod = true;\n\t\t\t\t} else {\n\t\t\t\t\tReport.Error (1106, Location, \"`{0}': Extension methods must be defined in a non-generic static class\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// This is used to track the Entry Point,\n\t\t\t//\n\t\t\tvar settings = Compiler.Settings;\n\t\t\tif (settings.NeedsEntryPoint && MemberName.Name == \"Main\" && !IsPartialDefinition && (settings.MainClass == null || settings.MainClass == Parent.TypeBuilder.FullName)) {\n\t\t\t\tif (IsEntryPoint ()) {\n\t\t\t\t\tif (Parent.DeclaringAssembly.EntryPoint == null) {\n\t\t\t\t\t\tif (Parent.IsGenericOrParentIsGeneric || MemberName.IsGeneric) {\n\t\t\t\t\t\t\tReport.Warning (402, 4, Location, \"`{0}': an entry point cannot be generic or in a generic type\",\n\t\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t\t} else if ((ModFlags & Modifiers.ASYNC) != 0) {\n\t\t\t\t\t\t\tReport.Error (4009, Location, \"`{0}': an entry point cannot be async method\",\n\t\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSetIsUsed ();\n\t\t\t\t\t\t\tParent.DeclaringAssembly.EntryPoint = this;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tError_DuplicateEntryPoint (Parent.DeclaringAssembly.EntryPoint);\n\t\t\t\t\t\tError_DuplicateEntryPoint (this);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tReport.Warning (28, 4, Location, \"`{0}' has the wrong signature to be an entry point\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void PrepareEmit ()\n\t\t{\n\t\t\tif (IsPartialDefinition) {\n\t\t\t\t//\n\t\t\t\t// Use partial method implementation builder for partial method declaration attributes\n\t\t\t\t//\n\t\t\t\tif (partialMethodImplementation != null) {\n\t\t\t\t\tMethodData = partialMethodImplementation.MethodData;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.PrepareEmit ();\n\t\t}\n\n\t\t//\n\t\t// Emits the code\n\t\t// \n\t\tpublic override void Emit ()\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (IsPartialDefinition) {\n\t\t\t\t\tif (partialMethodImplementation != null && CurrentTypeParameters != null) {\n\t\t\t\t\t\tCurrentTypeParameters.CheckPartialConstraints (partialMethodImplementation);\n\n\t\t\t\t\t\tvar otp = partialMethodImplementation.CurrentTypeParameters;\n\t\t\t\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\t\t\t\tvar tp = CurrentTypeParameters [i];\n\t\t\t\t\t\t\ttp.Define (otp[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ((ModFlags & Modifiers.PARTIAL) != 0 && (caching_flags & Flags.PartialDefinitionExists) == 0) {\n\t\t\t\t\tReport.Error (759, Location, \"A partial method `{0}' implementation is missing a partial method declaration\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\t\t\tvar tp = CurrentTypeParameters [i];\n\n\t\t\t\t\t\ttp.CheckGenericConstraints (false);\n\t\t\t\t\t\ttp.Emit ();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((ModFlags & Modifiers.METHOD_EXTENSION) != 0)\n\t\t\t\t\tModule.PredefinedAttributes.Extension.EmitAttribute (MethodBuilder);\n\n\t\t\t\tbase.Emit ();\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (this, e);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool EnableOverloadChecks (MemberCore overload)\n\t\t{\n\t\t\tif (overload is Indexer)\n\t\t\t\treturn false;\n\n\t\t\treturn base.EnableOverloadChecks (overload);\n\t\t}\n\n\t\tpublic static void Error1599 (Location loc, TypeSpec t, Report Report)\n\t\t{\n\t\t\tReport.Error (1599, loc, \"Method or delegate cannot return type `{0}'\", t.GetSignatureForError ());\n\t\t}\n\n\t\tprotected override bool ResolveMemberType ()\n\t\t{\n\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\tCreateTypeParameters ();\n\t\t\t}\n\n\t\t\treturn base.ResolveMemberType ();\n\t\t}\n\n\t\tpublic void SetPartialDefinition (Method methodDefinition)\n\t\t{\n\t\t\tcaching_flags |= Flags.PartialDefinitionExists;\n\t\t\tmethodDefinition.partialMethodImplementation = this;\n\n\t\t\t// Ensure we are always using method declaration parameters\n\t\t\tfor (int i = 0; i < methodDefinition.parameters.Count; ++i ) {\n\t\t\t\tvar md_p = methodDefinition.parameters [i];\n\t\t\t\tvar p = parameters [i];\n\t\t\t\tp.Name = md_p.Name;\n\t\t\t\tp.DefaultValue = md_p.DefaultValue;\n\t\t\t\tif (md_p.OptAttributes != null) {\n\t\t\t\t\tif (p.OptAttributes == null) {\n\t\t\t\t\t\tp.OptAttributes = md_p.OptAttributes;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp.OptAttributes.Attrs.AddRange (md_p.OptAttributes.Attrs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (methodDefinition.attributes != null) {\n\t\t\t\tif (attributes == null) {\n\t\t\t\t\tattributes = methodDefinition.attributes;\n\t\t\t\t} else {\n\t\t\t\t\tattributes.Attrs.AddRange (methodDefinition.attributes.Attrs);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (CurrentTypeParameters != null) {\n\t\t\t\tfor (int i = 0; i < CurrentTypeParameters.Count; ++i) {\n\t\t\t\t\tvar tp_other = methodDefinition.CurrentTypeParameters [i];\n\t\t\t\t\tif (tp_other.OptAttributes == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar tp = CurrentTypeParameters [i];\n\t\t\t\t\tif (tp.OptAttributes == null) {\n\t\t\t\t\t\ttp.OptAttributes = tp_other.OptAttributes;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttp.OptAttributes.Attrs.AddRange (tp.OptAttributes.Attrs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic abstract class ConstructorInitializer : ExpressionStatement\n\t{\n\t\tArguments argument_list;\n\t\tMethodSpec base_ctor;\n\n\t\tprotected ConstructorInitializer (Arguments argument_list, Location loc)\n\t\t{\n\t\t\tthis.argument_list = argument_list;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic Arguments Arguments {\n\t\t\tget {\n\t\t\t\treturn argument_list;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"ET\");\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\n\t\t\t// FIXME: Hack\n\t\t\tvar caller_builder = (Constructor) ec.MemberContext;\n\n\t\t\t//\n\t\t\t// Spec mandates that constructor initializer will not have `this' access\n\t\t\t//\n\t\t\tusing (ec.Set (ResolveContext.Options.BaseInitializer)) {\n\t\t\t\tif (argument_list != null) {\n\t\t\t\t\tbool dynamic;\n\t\t\t\t\targument_list.Resolve (ec, out dynamic);\n\n\t\t\t\t\tif (dynamic) {\n\t\t\t\t\t\tec.Report.Error (1975, loc,\n\t\t\t\t\t\t\t\"The constructor call cannot be dynamically dispatched within constructor initializer\");\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttype = ec.CurrentType;\n\t\t\t\tif (this is ConstructorBaseInitializer) {\n\t\t\t\t\tif (ec.CurrentType.BaseType == null)\n\t\t\t\t\t\treturn this;\n\n\t\t\t\t\ttype = ec.CurrentType.BaseType;\n\t\t\t\t\tif (ec.CurrentType.IsStruct) {\n\t\t\t\t\t\tec.Report.Error (522, loc,\n\t\t\t\t\t\t\t\"`{0}': Struct constructors cannot call base constructors\", caller_builder.GetSignatureForError ());\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// It is legal to have \"this\" initializers that take no arguments\n\t\t\t\t\t// in structs\n\t\t\t\t\t//\n\t\t\t\t\t// struct D { public D (int a) : this () {}\n\t\t\t\t\t//\n\t\t\t\t\tif (ec.CurrentType.IsStruct && argument_list == null)\n\t\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t\tbase_ctor = ConstructorLookup (ec, type, ref argument_list, loc);\n\t\t\t}\n\t\n\t\t\tif (base_ctor != null && base_ctor.MemberDefinition == caller_builder.Spec.MemberDefinition) {\n\t\t\t\tec.Report.Error (516, loc, \"Constructor `{0}' cannot call itself\",\n\t\t\t\t\tcaller_builder.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// It can be null for struct initializers or System.Object\n\t\t\t//\n\t\t\tif (base_ctor == null) {\n\t\t\t\tif (type == ec.BuiltinTypes.Object)\n\t\t\t\t\treturn;\n\n\t\t\t\tec.Emit (OpCodes.Ldarg_0);\n\t\t\t\tec.Emit (OpCodes.Initobj, type);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = new CompilerGeneratedThis (type, loc); \n\t\t\tcall.EmitPredefined (ec, base_ctor, argument_list, false);\n\t\t}\n\n\t\tpublic override void EmitStatement (EmitContext ec)\n\t\t{\n\t\t\tEmit (ec);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (argument_list != null)\n\t\t\t\targument_list.FlowAnalysis (fc);\n\t\t}\n\t}\n\n\tpublic class ConstructorBaseInitializer : ConstructorInitializer {\n\t\tpublic ConstructorBaseInitializer (Arguments argument_list, Location l) :\n\t\t\tbase (argument_list, l)\n\t\t{\n\t\t}\n\t}\n\n\tclass GeneratedBaseInitializer: ConstructorBaseInitializer {\n\t\tpublic GeneratedBaseInitializer (Location loc, Arguments arguments)\n\t\t\t: base (arguments, loc)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class ConstructorThisInitializer : ConstructorInitializer {\n\t\tpublic ConstructorThisInitializer (Arguments argument_list, Location l) :\n\t\t\tbase (argument_list, l)\n\t\t{\n\t\t}\n\t}\n\t\n\tpublic class Constructor : MethodCore, IMethodData, IMethodDefinition\n\t{\n\t\tpublic ConstructorBuilder ConstructorBuilder;\n\t\tpublic ConstructorInitializer Initializer;\n\t\tSecurityType declarative_security;\n\t\tbool has_compliant_args;\n\t\tSourceMethodBuilder debug_builder;\n\n\t\t// <summary>\n\t\t//   Modifiers allowed for a constructor.\n\t\t// </summary>\n\t\tpublic const Modifiers AllowedModifiers =\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.STATIC |\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.EXTERN |\t\t\n\t\t\tModifiers.PRIVATE;\n\n\t\tstatic readonly string[] attribute_targets = new string [] { \"method\" };\n\n\t\tpublic static readonly string ConstructorName = \".ctor\";\n\t\tpublic static readonly string TypeConstructorName = \".cctor\";\n\n\t\tpublic Constructor (TypeDefinition parent, string name, Modifiers mod, Attributes attrs, ParametersCompiled args, Location loc)\n\t\t\t: base (parent, null, mod, AllowedModifiers, new MemberName (name, loc), attrs, args)\n\t\t{\n\t\t}\n\n\t\tpublic bool HasCompliantArgs {\n\t\t\tget {\n\t\t\t\treturn has_compliant_args;\n\t\t\t}\n\t\t}\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Constructor;\n\t\t\t}\n\t\t}\n\n\t\tbool IMethodData.IsAccessor {\n\t\t    get {\n\t\t        return false;\n\t\t    }\n\t\t}\n\n\t\tpublic bool IsPrimaryConstructor { get; set; }\n\t\t\n\t\tMethodBase IMethodDefinition.Metadata {\n\t\t\tget {\n\t\t\t\treturn ConstructorBuilder;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true if this is a default constructor\n\t\t//\n\t\tpublic bool IsDefault ()\n\t\t{\n\t\t\tif ((ModFlags & Modifiers.STATIC) != 0)\n\t\t\t\treturn parameters.IsEmpty;\n\n\t\t\treturn parameters.IsEmpty &&\n\t\t\t\t\t(Initializer is ConstructorBaseInitializer) &&\n\t\t\t\t\t(Initializer.Arguments == null);\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.IsValidSecurityAttribute ()) {\n\t\t\t\ta.ExtractSecurityPermissionSet (ctor, ref declarative_security);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.MethodImpl) {\n\t\t\t\tis_external_implementation = a.IsInternalCall ();\n\t\t\t}\n\n\t\t\tConstructorBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tprotected override bool CheckBase ()\n\t\t{\n\t\t\tif ((ModFlags & Modifiers.STATIC) != 0) {\n\t\t\t\tif (!parameters.IsEmpty) {\n\t\t\t\t\tReport.Error (132, Location, \"`{0}': The static constructor must be parameterless\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif ((caching_flags & Flags.MethodOverloadsExist) != 0)\n\t\t\t\t\tParent.MemberCache.CheckExistingMembersOverloads (this, parameters);\n\n\t\t\t\t// the rest can be ignored\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Check whether arguments were correct.\n\t\t\tif (!DefineParameters (parameters))\n\t\t\t\treturn false;\n\n\t\t\tif ((caching_flags & Flags.MethodOverloadsExist) != 0)\n\t\t\t\tParent.MemberCache.CheckExistingMembersOverloads (this, parameters);\n\n\t\t\tif (Parent.PartialContainer.Kind == MemberKind.Struct && parameters.IsEmpty) {\n\t\t\t\tReport.Error (568, Location, \n\t\t\t\t\t\"Structs cannot contain explicit parameterless constructors\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tCheckProtectedModifier ();\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t//\n\t\t// Creates the ConstructorBuilder\n\t\t//\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (ConstructorBuilder != null)\n\t\t\t\treturn true;\n\n\t\t\tif (!CheckAbstractAndExtern (block != null))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\t// Check if arguments were correct.\n\t\t\tif (!CheckBase ())\n\t\t\t\treturn false;\n\n\t\t\tif (Parent.PrimaryConstructorParameters != null && !IsPrimaryConstructor && !IsStatic) {\n\t\t\t\tif (Parent.Kind == MemberKind.Struct && Initializer is ConstructorThisInitializer && Initializer.Arguments == null) {\n\t\t\t\t\tReport.Error (8043, Location, \"`{0}': Structs with primary constructor cannot specify default constructor initializer\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t} else if (Initializer == null || Initializer is ConstructorBaseInitializer) {\n\t\t\t\t\tReport.Error (8037, Location, \"`{0}': Instance constructor of type with primary constructor must specify `this' constructor initializer\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar ca = ModifiersExtensions.MethodAttr (ModFlags) | MethodAttributes.RTSpecialName | MethodAttributes.SpecialName;\n\n\t\t\tConstructorBuilder = Parent.TypeBuilder.DefineConstructor (\n\t\t\t\tca, CallingConventions,\n\t\t\t\tparameters.GetMetaInfo ());\n\n\t\t\tspec = new MethodSpec (MemberKind.Constructor, Parent.Definition, this, Compiler.BuiltinTypes.Void, parameters, ModFlags);\n\t\t\t\n\t\t\tParent.MemberCache.AddMember (spec);\n\t\t\t\n\t\t\tif (block != null) {\n\t\t\t\t// It's here only to report an error\n\t\t\t\tif (block.IsIterator) {\n\t\t\t\t\tmember_type = Compiler.BuiltinTypes.Void;\n\t\t\t\t\tIterator.CreateIterator (this, Parent.PartialContainer, ModFlags);\n\t\t\t\t}\n\n\t\t\t\tif (Compiler.Settings.WriteMetadataOnly)\n\t\t\t\t\tblock = null;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Emits the code\n\t\t//\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tif (Parent.PartialContainer.IsComImport) {\n\t\t\t\tif (!IsDefault ()) {\n\t\t\t\t\tReport.Error (669, Location, \"`{0}': A class with the ComImport attribute cannot have a user-defined constructor\",\n\t\t\t\t\t\tParent.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\t// Set as internal implementation and reset block data\n\t\t\t\t// to ensure no IL is generated\n\t\t\t\tConstructorBuilder.SetImplementationFlags (MethodImplAttributes.InternalCall);\n\t\t\t\tblock = null;\n\t\t\t}\n\n\t\t\tif ((ModFlags & Modifiers.DEBUGGER_HIDDEN) != 0)\n\t\t\t\tModule.PredefinedAttributes.DebuggerHidden.EmitAttribute (ConstructorBuilder);\n\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tbase.Emit ();\n\t\t\tparameters.ApplyAttributes (this, ConstructorBuilder);\n\n\n\t\t\tBlockContext bc = new BlockContext (this, block, Compiler.BuiltinTypes.Void);\n\t\t\tbc.Set (ResolveContext.Options.ConstructorScope);\n\n\t\t\tif (block != null) {\n\t\t\t\tif (!IsStatic && Initializer == null && Parent.PartialContainer.Kind == MemberKind.Struct) {\n\t\t\t\t\t//\n\t\t\t\t\t// If this is a non-static `struct' constructor and doesn't have any\n\t\t\t\t\t// initializer, it must initialize all of the struct's fields.\n\t\t\t\t\t//\n\t\t\t\t\tblock.AddThisVariable (bc);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// If we use a \"this (...)\" constructor initializer, then\n\t\t\t\t// do not emit field initializers, they are initialized in the other constructor\n\t\t\t\t//\n\t\t\t\tif (!(Initializer is ConstructorThisInitializer))\n\t\t\t\t\tParent.PartialContainer.ResolveFieldInitializers (bc);\n\n\t\t\t\tif (!IsStatic) {\n\t\t\t\t\tif (Initializer == null && Parent.PartialContainer.Kind == MemberKind.Class) {\n\t\t\t\t\t\tInitializer = new GeneratedBaseInitializer (Location, null);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Initializer != null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// mdb format does not support reqions. Try to workaround this by emitting the\n\t\t\t\t\t\t// sequence point at initializer. Any breakpoint at constructor header should\n\t\t\t\t\t\t// be adjusted to this sequence point as it's the next one which follows.\n\t\t\t\t\t\t//\n\t\t\t\t\t\tblock.AddScopeStatement (new StatementExpression (Initializer));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (block.Resolve (bc, this)) {\n\t\t\t\t\tdebug_builder = Parent.CreateMethodSymbolEntry ();\n\t\t\t\t\tEmitContext ec = new EmitContext (this, ConstructorBuilder.GetILGenerator (), bc.ReturnType, debug_builder);\n\t\t\t\t\tec.With (EmitContext.Options.ConstructorScope, true);\n\n\t\t\t\t\tblock.Emit (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (declarative_security != null) {\n\t\t\t\tforeach (var de in declarative_security) {\n#if STATIC\n\t\t\t\t\tConstructorBuilder.__AddDeclarativeSecurity (de);\n#else\n\t\t\t\t\tConstructorBuilder.AddDeclarativeSecurity (de.Key, de.Value);\n#endif\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblock = null;\n\t\t}\n\n\t\tprotected override MemberSpec FindBaseMember (out MemberSpec bestCandidate, ref bool overrides)\n\t\t{\n\t\t\t// Is never override\n\t\t\tbestCandidate = null;\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override string GetCallerMemberName ()\n\t\t{\n\t\t\treturn IsStatic ? TypeConstructorName : ConstructorName;\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\treturn Parent.GetSignatureForDocumentation () + \".#ctor\" + parameters.GetSignatureForDocumentation ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError()\n\t\t{\n\t\t\treturn base.GetSignatureForError () + parameters.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance () || !IsExposedFromAssembly ()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!parameters.IsEmpty && Parent.Definition.IsAttribute) {\n\t\t\t\tforeach (TypeSpec param in parameters.Types) {\n\t\t\t\t\tif (param.IsArray) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thas_compliant_args = true;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tif (debug_builder == null)\n\t\t\t\treturn;\n\n\t\t\tvar token = ConstructorBuilder.GetToken ();\n\t\t\tint t = token.Token;\n#if STATIC\n\t\t\tif (ModuleBuilder.IsPseudoToken (t))\n\t\t\t\tt = Module.Builder.ResolvePseudoToken (t);\n#endif\n\n\t\t\tdebug_builder.DefineMethod (file, t);\n\t\t}\n\n\t\t#region IMethodData Members\n\n\t\tpublic MemberName MethodName {\n\t\t\tget {\n\t\t\t\treturn MemberName;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec ReturnType {\n\t\t\tget {\n\t\t\t\treturn MemberType;\n\t\t\t}\n\t\t}\n\n\t\tEmitContext IMethodData.CreateEmitContext (ILGenerator ig, SourceMethodBuilder sourceMethod)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t/// <summary>\n\t/// Interface for MethodData class. Holds links to parent members to avoid member duplication.\n\t/// </summary>\n\tpublic interface IMethodData : IMemberContext\n\t{\n\t\tCallingConventions CallingConventions { get; }\n\t\tLocation Location { get; }\n\t\tMemberName MethodName { get; }\n\t\tTypeSpec ReturnType { get; }\n\t\tParametersCompiled ParameterInfo { get; }\n\t\tMethodSpec Spec { get; }\n\t\tbool IsAccessor { get; }\n\n\t\tAttributes OptAttributes { get; }\n\t\tToplevelBlock Block { get; set; }\n\n\t\tEmitContext CreateEmitContext (ILGenerator ig, SourceMethodBuilder sourceMethod);\n\t}\n\n\t//\n\t// Encapsulates most of the Method's state\n\t//\n\tpublic class MethodData\n\t{\n\t\tpublic readonly IMethodData method;\n\n\t\t//\n\t\t// Are we implementing an interface ?\n\t\t//\n\t\tpublic MethodSpec implementing;\n\n\t\t//\n\t\t// Protected data.\n\t\t//\n\t\tprotected InterfaceMemberBase member;\n\t\tprotected Modifiers modifiers;\n\t\tprotected MethodAttributes flags;\n\t\tprotected TypeSpec declaring_type;\n\t\tprotected MethodSpec parent_method;\n\t\tSourceMethodBuilder debug_builder;\n\t\tstring full_name;\n\n\t\tMethodBuilder builder;\n\t\tpublic MethodBuilder MethodBuilder {\n\t\t\tget {\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec DeclaringType {\n\t\t\tget {\n\t\t\t\treturn declaring_type;\n\t\t\t}\n\t\t}\n\n\t\tpublic string MetadataName {\n\t\t\tget {\n\t\t\t\treturn full_name;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodData (InterfaceMemberBase member,\n\t\t\t\t   Modifiers modifiers, MethodAttributes flags, IMethodData method)\n\t\t{\n\t\t\tthis.member = member;\n\t\t\tthis.modifiers = modifiers;\n\t\t\tthis.flags = flags;\n\n\t\t\tthis.method = method;\n\t\t}\n\n\t\tpublic MethodData (InterfaceMemberBase member,\n\t\t\t\t   Modifiers modifiers, MethodAttributes flags, \n\t\t\t\t   IMethodData method,\n\t\t\t\t   MethodSpec parent_method)\n\t\t\t: this (member, modifiers, flags, method)\n\t\t{\n\t\t\tthis.parent_method = parent_method;\n\t\t}\n\n\t\tpublic bool Define (TypeDefinition container, string method_full_name)\n\t\t{\n\t\t\tPendingImplementation pending = container.PendingImplementations;\n\t\t\tMethodSpec ambig_iface_method;\n\t\t\tbool optional = false;\n\n\t\t\tif (pending != null) {\n\t\t\t\timplementing = pending.IsInterfaceMethod (method.MethodName, member.InterfaceType, this, out ambig_iface_method, ref optional);\n\n\t\t\t\tif (member.InterfaceType != null) {\n\t\t\t\t\tif (implementing == null) {\n\t\t\t\t\t\tif (member is PropertyBase) {\n\t\t\t\t\t\t\tcontainer.Compiler.Report.Error (550, method.Location,\n\t\t\t\t\t\t\t\t\"`{0}' is an accessor not found in interface member `{1}{2}'\",\n\t\t\t\t\t\t\t\t\t  method.GetSignatureForError (), member.InterfaceType.GetSignatureForError (),\n\t\t\t\t\t\t\t\t\t  member.GetSignatureForError ().Substring (member.GetSignatureForError ().LastIndexOf ('.')));\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontainer.Compiler.Report.Error (539, method.Location,\n\t\t\t\t\t\t\t\t\t  \"`{0}.{1}' in explicit interface declaration is not a member of interface\",\n\t\t\t\t\t\t\t\t\t  member.InterfaceType.GetSignatureForError (), member.ShortName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (implementing.IsAccessor && !method.IsAccessor) {\n\t\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (implementing);\n\t\t\t\t\t\tcontainer.Compiler.Report.Error (683, method.Location,\n\t\t\t\t\t\t\t\"`{0}' explicit method implementation cannot implement `{1}' because it is an accessor\",\n\t\t\t\t\t\t\tmember.GetSignatureForError (), implementing.GetSignatureForError ());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (implementing != null && !optional) {\n\t\t\t\t\t\tif (!method.IsAccessor) {\n\t\t\t\t\t\t\tif (implementing.IsAccessor) {\n\t\t\t\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (implementing);\n\t\t\t\t\t\t\t\tcontainer.Compiler.Report.Error (470, method.Location,\n\t\t\t\t\t\t\t\t\t\"Method `{0}' cannot implement interface accessor `{1}'\",\n\t\t\t\t\t\t\t\t\tmethod.GetSignatureForError (), TypeManager.CSharpSignature (implementing));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (implementing.DeclaringType.IsInterface) {\n\t\t\t\t\t\t\tif (!implementing.IsAccessor) {\n\t\t\t\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (implementing);\n\t\t\t\t\t\t\t\tcontainer.Compiler.Report.Error (686, method.Location,\n\t\t\t\t\t\t\t\t\t\"Accessor `{0}' cannot implement interface member `{1}' for type `{2}'. Use an explicit interface implementation\",\n\t\t\t\t\t\t\t\t\tmethod.GetSignatureForError (), TypeManager.CSharpSignature (implementing), container.GetSignatureForError ());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tPropertyBase.PropertyMethod pm = method as PropertyBase.PropertyMethod;\n\t\t\t\t\t\t\t\tif (pm != null && pm.HasCustomAccessModifier && (pm.ModFlags & Modifiers.PUBLIC) == 0) {\n\t\t\t\t\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (implementing);\n\t\t\t\t\t\t\t\t\tcontainer.Compiler.Report.Error (277, method.Location,\n\t\t\t\t\t\t\t\t\t\t\"Accessor `{0}' must be declared public to implement interface member `{1}'\",\n\t\t\t\t\t\t\t\t\t\tmethod.GetSignatureForError (), implementing.GetSignatureForError ());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tambig_iface_method = null;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// For implicit implementations, make sure we are public, for\n\t\t\t// explicit implementations, make sure we are private.\n\t\t\t//\n\t\t\tif (implementing != null){\n\t\t\t\tif (member.IsExplicitImpl) {\n\t\t\t\t\tif (method.ParameterInfo.HasParams && !implementing.Parameters.HasParams) {\n\t\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (implementing);\n\t\t\t\t\t\tcontainer.Compiler.Report.Error (466, method.Location,\n\t\t\t\t\t\t\t\"`{0}': the explicit interface implementation cannot introduce the params modifier\",\n\t\t\t\t\t\t\tmethod.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ambig_iface_method != null) {\n\t\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (ambig_iface_method);\n\t\t\t\t\t\tcontainer.Compiler.Report.SymbolRelatedToPreviousError (implementing);\n\t\t\t\t\t\tcontainer.Compiler.Report.Warning (473, 2, method.Location,\n\t\t\t\t\t\t\t\"Explicit interface implementation `{0}' matches more than one interface member. Consider using a non-explicit implementation instead\",\n\t\t\t\t\t\t\tmethod.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// Setting implementin to null inside this block will trigger a more\n\t\t\t\t\t// verbose error reporting for missing interface implementations\n\t\t\t\t\t//\n\t\t\t\t\tif (implementing.DeclaringType.IsInterface) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// If this is an interface method implementation,\n\t\t\t\t\t\t// check for public accessibility\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public) {\n\t\t\t\t\t\t\timplementing = null;\n\t\t\t\t\t\t} else if (optional && (container.Interfaces == null || !container.Definition.Interfaces.Contains (implementing.DeclaringType))) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// We are not implementing interface when base class already implemented it\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\timplementing = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ((flags & MethodAttributes.MemberAccessMask) == MethodAttributes.Private) {\n\t\t\t\t\t\t// We may never be private.\n\t\t\t\t\t\timplementing = null;\n\n\t\t\t\t\t} else if ((modifiers & Modifiers.OVERRIDE) == 0) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// We may be protected if we're overriding something.\n\t\t\t\t\t\t//\n\t\t\t\t\t\timplementing = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// Static is not allowed\n\t\t\t\t//\n\t\t\t\tif ((modifiers & Modifiers.STATIC) != 0){\n\t\t\t\t\timplementing = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//\n\t\t\t// If implementing is still valid, set flags\n\t\t\t//\n\t\t\tif (implementing != null){\n\t\t\t\t//\n\t\t\t\t// When implementing interface methods, set NewSlot\n\t\t\t\t// unless, we are overwriting a method.\n\t\t\t\t//\n\t\t\t\tif ((modifiers & Modifiers.OVERRIDE) == 0 && implementing.DeclaringType.IsInterface) {\n\t\t\t\t\tflags |= MethodAttributes.NewSlot;\n\t\t\t\t}\n\n\t\t\t\tflags |= MethodAttributes.Virtual | MethodAttributes.HideBySig;\n\n\t\t\t\t// Set Final unless we're virtual, abstract or already overriding a method.\n\t\t\t\tif ((modifiers & (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE)) == 0)\n\t\t\t\t\tflags |= MethodAttributes.Final;\n\n\t\t\t\t//\n\t\t\t\t// clear the pending implementation flag (requires explicit methods to be defined first)\n\t\t\t\t//\n\t\t\t\tpending.ImplementMethod (method.MethodName,\n\t\t\t\t\tmember.InterfaceType, this, member.IsExplicitImpl, out ambig_iface_method, ref optional);\n\n\t\t\t\t//\n\t\t\t\t// Update indexer accessor name to match implementing abstract accessor\n\t\t\t\t//\n\t\t\t\tif (!implementing.DeclaringType.IsInterface && !member.IsExplicitImpl && implementing.IsAccessor)\n\t\t\t\t\tmethod_full_name = implementing.MemberDefinition.Name;\n\t\t\t}\n\n\t\t\tfull_name = method_full_name;\n\t\t\tdeclaring_type = container.Definition;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid DefineOverride (TypeDefinition container)\n\t\t{\n\t\t\tif (implementing == null)\n\t\t\t\treturn;\n\n\t\t\tif (!member.IsExplicitImpl)\n\t\t\t\treturn;\n\n\t\t\tcontainer.TypeBuilder.DefineMethodOverride (builder, (MethodInfo) implementing.GetMetaInfo ());\n\t\t}\n\n\t\t//\n\t\t// Creates partial MethodBuilder for the method when has generic parameters used\n\t\t// as arguments or return type\n\t\t//\n\t\tpublic MethodBuilder DefineMethodBuilder (TypeDefinition container)\n\t\t{\n\t\t\tif (builder != null)\n\t\t\t\tthrow new InternalErrorException ();\n\n\t\t\tbuilder = container.TypeBuilder.DefineMethod (full_name, flags, method.CallingConventions);\n\t\t\treturn builder;\n\t\t}\n\n\t\t//\n\t\t// Creates full MethodBuilder for the method \n\t\t//\n\t\tpublic MethodBuilder DefineMethodBuilder (TypeDefinition container, ParametersCompiled param)\n\t\t{\n\t\t\tDefineMethodBuilder (container);\n\t\t\tbuilder.SetReturnType (method.ReturnType.GetMetaInfo ());\n\t\t\tbuilder.SetParameters (param.GetMetaInfo ());\n\t\t\treturn builder;\n\t\t}\n\n\t\t//\n\t\t// Emits the code\n\t\t// \n\t\tpublic void Emit (TypeDefinition parent)\n\t\t{\n\t\t\tDefineOverride (parent);\n\n\t\t\tmethod.ParameterInfo.ApplyAttributes (method, MethodBuilder);\n\n\t\t\tToplevelBlock block = method.Block;\n\t\t\tif (block != null) {\n\t\t\t\tBlockContext bc = new BlockContext (method, block, method.ReturnType);\n\t\t\t\tif (block.Resolve (bc, method)) {\n\t\t\t\t\tdebug_builder = member.Parent.CreateMethodSymbolEntry ();\n\t\t\t\t\tEmitContext ec = method.CreateEmitContext (MethodBuilder.GetILGenerator (), debug_builder);\n\n\t\t\t\t\tblock.Emit (ec);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tif (debug_builder == null)\n\t\t\t\treturn;\n\n\t\t\tvar token = builder.GetToken ();\n\t\t\tint t = token.Token;\n#if STATIC\n\t\t\tif (ModuleBuilder.IsPseudoToken (t))\n\t\t\t\tt = member.Module.Builder.ResolvePseudoToken (t);\n#endif\n\n\t\t\tdebug_builder.DefineMethod (file, t);\n\t\t}\n\t}\n\n\tpublic class Destructor : MethodOrOperator\n\t{\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.EXTERN;\n\n\t\tstatic readonly string[] attribute_targets = new string [] { \"method\" };\n\n\t\tpublic static readonly string MetadataName = \"Finalize\";\n\n\t\tpublic string Identifier {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic Destructor (TypeDefinition parent, Modifiers mod, ParametersCompiled parameters, Attributes attrs, Location l)\n\t\t\t: base (parent, null, mod, AllowedModifiers, new MemberName (MetadataName, l), attrs, parameters)\n\t\t{\n\t\t\tModFlags &= ~Modifiers.PRIVATE;\n\t\t\tModFlags |= Modifiers.PROTECTED | Modifiers.OVERRIDE;\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.Conditional) {\n\t\t\t\tError_ConditionalAttributeIsNotValid ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\t\t\n\t\tprotected override bool CheckBase ()\n\t\t{\n\t\t\tif ((caching_flags & Flags.MethodOverloadsExist) != 0)\n\t\t\t\tCheckForDuplications ();\n\n\t\t\t// Don't check base, destructors have special syntax\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tbase.Define ();\n\n\t\t\tif (Compiler.Settings.WriteMetadataOnly)\n\t\t\t\tblock = null;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void Emit()\n\t\t{\n\t\t\tvar base_type = Parent.PartialContainer.BaseType;\n\t\t\tif (base_type != null && Block != null) {\n\t\t\t\tvar base_dtor = MemberCache.FindMember (base_type,\n\t\t\t\t\tnew MemberFilter (MetadataName, 0, MemberKind.Destructor, null, null), BindingRestriction.InstanceOnly) as MethodSpec;\n\n\t\t\t\tif (base_dtor == null)\n\t\t\t\t\tthrow new NotImplementedException ();\n\n\t\t\t\tMethodGroupExpr method_expr = MethodGroupExpr.CreatePredefined (base_dtor, base_type, Location);\n\t\t\t\tmethod_expr.InstanceExpression = new BaseThis (base_type, Location);\n\n\t\t\t\tvar try_block = new ExplicitBlock (block, block.StartLocation, block.EndLocation) {\n\t\t\t\t\tIsCompilerGenerated = true\n\t\t\t\t};\n\t\t\t\tvar finaly_block = new ExplicitBlock (block, Location, Location) {\n\t\t\t\t\tIsCompilerGenerated = true\n\t\t\t\t};\n\n\t\t\t\t//\n\t\t\t\t// 0-size arguments to avoid CS0250 error\n\t\t\t\t// TODO: Should use AddScopeStatement or something else which emits correct\n\t\t\t\t// debugger scope\n\t\t\t\t//\n\t\t\t\tfinaly_block.AddStatement (new StatementExpression (new Invocation (method_expr, new Arguments (0)), Location.Null));\n\n\t\t\t\tvar tf = new TryFinally (try_block, finaly_block, Location);\n\t\t\t\tblock.WrapIntoDestructor (tf, try_block);\n\t\t\t}\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn Parent.GetSignatureForError () + \".~\" + Parent.MemberName.Name + \"()\";\n\t\t}\n\n\t\tprotected override bool ResolveMemberType ()\n\t\t{\n\t\t\tmember_type = Compiler.BuiltinTypes.Void;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Ooouh Martin, templates are missing here.\n\t// When it will be possible move here a lot of child code and template method type.\n\tpublic abstract class AbstractPropertyEventMethod : MemberCore, IMethodData, IMethodDefinition {\n\t\tprotected MethodData method_data;\n\t\tprotected ToplevelBlock block;\n\t\tprotected SecurityType declarative_security;\n\n\t\tprotected readonly string prefix;\n\n\t\tReturnParameter return_attributes;\n\n\t\tprotected AbstractPropertyEventMethod (InterfaceMemberBase member, string prefix, Attributes attrs, Location loc)\n\t\t\t: base (member.Parent, SetupName (prefix, member, loc), attrs)\n\t\t{\n\t\t\tthis.prefix = prefix;\n\t\t}\n\n\t\tstatic MemberName SetupName (string prefix, InterfaceMemberBase member, Location loc)\n\t\t{\n\t\t\treturn new MemberName (member.MemberName.Left, prefix + member.ShortName, member.MemberName.ExplicitInterface, loc);\n\t\t}\n\n\t\tpublic void UpdateName (InterfaceMemberBase member)\n\t\t{\n\t\t\tSetMemberName (SetupName (prefix, member, Location));\n\t\t}\n\n\t\t#region IMethodData Members\n\n\t\tpublic ToplevelBlock Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\n\t\t\tset {\n\t\t\t\tblock = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic CallingConventions CallingConventions {\n\t\t\tget {\n\t\t\t\treturn CallingConventions.Standard;\n\t\t\t}\n\t\t}\n\n\t\tpublic EmitContext CreateEmitContext (ILGenerator ig, SourceMethodBuilder sourceMethod)\n\t\t{\n\t\t\treturn new EmitContext (this, ig, ReturnType, sourceMethod);\n\t\t}\n\n\t\tpublic bool IsAccessor {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic MemberName MethodName {\n\t\t\tget {\n\t\t\t\treturn MemberName;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec[] ParameterTypes { \n\t\t\tget {\n\t\t\t\treturn ParameterInfo.Types;\n\t\t\t}\n\t\t}\n\n\t\tMethodBase IMethodDefinition.Metadata {\n\t\t\tget {\n\t\t\t\treturn method_data.MethodBuilder;\n\t\t\t}\n\t\t}\n\n\t\tpublic abstract ParametersCompiled ParameterInfo { get ; }\n\t\tpublic abstract TypeSpec ReturnType { get; }\n\n\t\t#endregion\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.CLSCompliant || a.Type == pa.Obsolete || a.Type == pa.Conditional) {\n\t\t\t\tReport.Error (1667, a.Location,\n\t\t\t\t\t\"Attribute `{0}' is not valid on property or event accessors. It is valid on `{1}' declarations only\",\n\t\t\t\t\ta.Type.GetSignatureForError (), a.GetValidTargets ());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.IsValidSecurityAttribute ()) {\n\t\t\t\ta.ExtractSecurityPermissionSet (ctor, ref declarative_security);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Target == AttributeTargets.Method) {\n\t\t\t\tmethod_data.MethodBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Target == AttributeTargets.ReturnValue) {\n\t\t\t\tif (return_attributes == null)\n\t\t\t\t\treturn_attributes = new ReturnParameter (this, method_data.MethodBuilder, Location);\n\n\t\t\t\treturn_attributes.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tApplyToExtraTarget (a, ctor, cdata, pa);\n\t\t}\n\n\t\tprotected virtual void ApplyToExtraTarget (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tthrow new NotSupportedException (\"You forgot to define special attribute target handling\");\n\t\t}\n\n\t\t// It is not supported for the accessors\n\t\tpublic sealed override bool Define()\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic virtual void Emit (TypeDefinition parent)\n\t\t{\n\t\t\tmethod_data.Emit (parent);\n\n\t\t\tif ((ModFlags & Modifiers.COMPILER_GENERATED) != 0 && !Parent.IsCompilerGenerated)\n\t\t\t\tModule.PredefinedAttributes.CompilerGenerated.EmitAttribute (method_data.MethodBuilder);\n\t\t\tif (((ModFlags & Modifiers.DEBUGGER_HIDDEN) != 0))\n\t\t\t\tModule.PredefinedAttributes.DebuggerHidden.EmitAttribute (method_data.MethodBuilder);\n\n\t\t\tif (ReturnType.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\treturn_attributes = new ReturnParameter (this, method_data.MethodBuilder, Location);\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (return_attributes.Builder);\n\t\t\t} else if (ReturnType.HasDynamicElement) {\n\t\t\t\treturn_attributes = new ReturnParameter (this, method_data.MethodBuilder, Location);\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (return_attributes.Builder, ReturnType, Location);\n\t\t\t}\n\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tif (declarative_security != null) {\n\t\t\t\tforeach (var de in declarative_security) {\n#if STATIC\n\t\t\t\t\tmethod_data.MethodBuilder.__AddDeclarativeSecurity (de);\n#else\n\t\t\t\t\tmethod_data.MethodBuilder.AddDeclarativeSecurity (de.Key, de.Value);\n#endif\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblock = null;\n\t\t}\n\n\t\tpublic override bool EnableOverloadChecks (MemberCore overload)\n\t\t{\n\t\t\tif (overload is MethodCore) {\n\t\t\t\tcaching_flags |= Flags.MethodOverloadsExist;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// This can only happen with indexers and it will\n\t\t\t// be catched as indexer difference\n\t\t\tif (overload is AbstractPropertyEventMethod)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override string GetCallerMemberName ()\n\t\t{\n\t\t\treturn base.GetCallerMemberName ().Substring (prefix.Length);\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\t// should not be called\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override bool IsClsComplianceRequired()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void PrepareEmit ()\n\t\t{\n\t\t\tmethod_data.DefineMethodBuilder (Parent.PartialContainer, ParameterInfo);\n\t\t}\n\n\t\tpublic override void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tif (method_data != null)\n\t\t\t\tmethod_data.WriteDebugSymbol (file);\n\t\t}\n\n\t\tpublic MethodSpec Spec { get; protected set; }\n\n\t\t//\n\t\t//   Represents header string for documentation comment.\n\t\t//\n\t\tpublic override string DocCommentHeader {\n\t\t\tget { throw new InvalidOperationException (\"Unexpected attempt to get doc comment from \" + this.GetType () + \".\"); }\n\t\t}\n\t}\n\n\tpublic class Operator : MethodOrOperator {\n\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.EXTERN |\n\t\t\tModifiers.STATIC;\n\n\t\tpublic enum OpType : byte {\n\n\t\t\t// Unary operators\n\t\t\tLogicalNot,\n\t\t\tOnesComplement,\n\t\t\tIncrement,\n\t\t\tDecrement,\n\t\t\tTrue,\n\t\t\tFalse,\n\n\t\t\t// Unary and Binary operators\n\t\t\tAddition,\n\t\t\tSubtraction,\n\n\t\t\tUnaryPlus,\n\t\t\tUnaryNegation,\n\t\t\t\n\t\t\t// Binary operators\n\t\t\tMultiply,\n\t\t\tDivision,\n\t\t\tModulus,\n\t\t\tBitwiseAnd,\n\t\t\tBitwiseOr,\n\t\t\tExclusiveOr,\n\t\t\tLeftShift,\n\t\t\tRightShift,\n\t\t\tEquality,\n\t\t\tInequality,\n\t\t\tGreaterThan,\n\t\t\tLessThan,\n\t\t\tGreaterThanOrEqual,\n\t\t\tLessThanOrEqual,\n\n\t\t\t// Implicit and Explicit\n\t\t\tImplicit,\n\t\t\tExplicit,\n\n\t\t\t// Just because of enum\n\t\t\tTOP\n\t\t};\n\n\t\tpublic readonly OpType OperatorType;\n\n\t\tstatic readonly string [] [] names;\n\n\t\tstatic Operator ()\n\t\t{\n\t\t\tnames = new string[(int)OpType.TOP][];\n\t\t\tnames [(int) OpType.LogicalNot] = new string [] { \"!\", \"op_LogicalNot\" };\n\t\t\tnames [(int) OpType.OnesComplement] = new string [] { \"~\", \"op_OnesComplement\" };\n\t\t\tnames [(int) OpType.Increment] = new string [] { \"++\", \"op_Increment\" };\n\t\t\tnames [(int) OpType.Decrement] = new string [] { \"--\", \"op_Decrement\" };\n\t\t\tnames [(int) OpType.True] = new string [] { \"true\", \"op_True\" };\n\t\t\tnames [(int) OpType.False] = new string [] { \"false\", \"op_False\" };\n\t\t\tnames [(int) OpType.Addition] = new string [] { \"+\", \"op_Addition\" };\n\t\t\tnames [(int) OpType.Subtraction] = new string [] { \"-\", \"op_Subtraction\" };\n\t\t\tnames [(int) OpType.UnaryPlus] = new string [] { \"+\", \"op_UnaryPlus\" };\n\t\t\tnames [(int) OpType.UnaryNegation] = new string [] { \"-\", \"op_UnaryNegation\" };\n\t\t\tnames [(int) OpType.Multiply] = new string [] { \"*\", \"op_Multiply\" };\n\t\t\tnames [(int) OpType.Division] = new string [] { \"/\", \"op_Division\" };\n\t\t\tnames [(int) OpType.Modulus] = new string [] { \"%\", \"op_Modulus\" };\n\t\t\tnames [(int) OpType.BitwiseAnd] = new string [] { \"&\", \"op_BitwiseAnd\" };\n\t\t\tnames [(int) OpType.BitwiseOr] = new string [] { \"|\", \"op_BitwiseOr\" };\n\t\t\tnames [(int) OpType.ExclusiveOr] = new string [] { \"^\", \"op_ExclusiveOr\" };\n\t\t\tnames [(int) OpType.LeftShift] = new string [] { \"<<\", \"op_LeftShift\" };\n\t\t\tnames [(int) OpType.RightShift] = new string [] { \">>\", \"op_RightShift\" };\n\t\t\tnames [(int) OpType.Equality] = new string [] { \"==\", \"op_Equality\" };\n\t\t\tnames [(int) OpType.Inequality] = new string [] { \"!=\", \"op_Inequality\" };\n\t\t\tnames [(int) OpType.GreaterThan] = new string [] { \">\", \"op_GreaterThan\" };\n\t\t\tnames [(int) OpType.LessThan] = new string [] { \"<\", \"op_LessThan\" };\n\t\t\tnames [(int) OpType.GreaterThanOrEqual] = new string [] { \">=\", \"op_GreaterThanOrEqual\" };\n\t\t\tnames [(int) OpType.LessThanOrEqual] = new string [] { \"<=\", \"op_LessThanOrEqual\" };\n\t\t\tnames [(int) OpType.Implicit] = new string [] { \"implicit\", \"op_Implicit\" };\n\t\t\tnames [(int) OpType.Explicit] = new string [] { \"explicit\", \"op_Explicit\" };\n\t\t}\n\n\t\tpublic Operator (TypeDefinition parent, OpType type, FullNamedExpression ret_type, Modifiers mod_flags, ParametersCompiled parameters,\n\t\t\t\t ToplevelBlock block, Attributes attrs, Location loc)\n\t\t\t: base (parent, ret_type, mod_flags, AllowedModifiers, new MemberName (GetMetadataName (type), loc), attrs, parameters)\n\t\t{\n\t\t\tOperatorType = type;\n\t\t\tBlock = block;\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.Conditional) {\n\t\t\t\tError_ConditionalAttributeIsNotValid ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\t\t\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tconst Modifiers RequiredModifiers = Modifiers.PUBLIC | Modifiers.STATIC;\n\t\t\tif ((ModFlags & RequiredModifiers) != RequiredModifiers){\n\t\t\t\tReport.Error (558, Location, \"User-defined operator `{0}' must be declared static and public\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (block != null) {\n\t\t\t\tif (block.IsIterator) {\n\t\t\t\t\t//\n\t\t\t\t\t// Current method is turned into automatically generated\n\t\t\t\t\t// wrapper which creates an instance of iterator\n\t\t\t\t\t//\n\t\t\t\t\tIterator.CreateIterator (this, Parent.PartialContainer, ModFlags);\n\t\t\t\t\tModFlags |= Modifiers.DEBUGGER_HIDDEN;\n\t\t\t\t}\n\n\t\t\t\tif (Compiler.Settings.WriteMetadataOnly)\n\t\t\t\t\tblock = null;\n\t\t\t}\n\n\t\t\t// imlicit and explicit operator of same types are not allowed\n\t\t\tif (OperatorType == OpType.Explicit)\n\t\t\t\tParent.MemberCache.CheckExistingMembersOverloads (this, GetMetadataName (OpType.Implicit), parameters);\n\t\t\telse if (OperatorType == OpType.Implicit)\n\t\t\t\tParent.MemberCache.CheckExistingMembersOverloads (this, GetMetadataName (OpType.Explicit), parameters);\n\n\t\t\tTypeSpec declaring_type = Parent.CurrentType;\n\t\t\tTypeSpec return_type = MemberType;\n\t\t\tTypeSpec first_arg_type = ParameterTypes [0];\n\t\t\t\n\t\t\tTypeSpec first_arg_type_unwrap = first_arg_type;\n\t\t\tif (first_arg_type.IsNullableType)\n\t\t\t\tfirst_arg_type_unwrap = Nullable.NullableInfo.GetUnderlyingType (first_arg_type);\n\t\t\t\n\t\t\tTypeSpec return_type_unwrap = return_type;\n\t\t\tif (return_type.IsNullableType)\n\t\t\t\treturn_type_unwrap = Nullable.NullableInfo.GetUnderlyingType (return_type);\n\n\t\t\t//\n\t\t\t// Rules for conversion operators\n\t\t\t//\n\t\t\tif (OperatorType == OpType.Implicit || OperatorType == OpType.Explicit) {\n\t\t\t\tif (first_arg_type_unwrap == return_type_unwrap && first_arg_type_unwrap == declaring_type) {\n\t\t\t\t\tReport.Error (555, Location,\n\t\t\t\t\t\t\"User-defined operator cannot take an object of the enclosing type and convert to an object of the enclosing type\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tTypeSpec conv_type;\n\t\t\t\tif (declaring_type == return_type || declaring_type == return_type_unwrap) {\n\t\t\t\t\tconv_type = first_arg_type;\n\t\t\t\t} else if (declaring_type == first_arg_type || declaring_type == first_arg_type_unwrap) {\n\t\t\t\t\tconv_type = return_type;\n\t\t\t\t} else {\n\t\t\t\t\tReport.Error (556, Location,\n\t\t\t\t\t\t\"User-defined conversion must convert to or from the enclosing type\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (conv_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tReport.Error (1964, Location,\n\t\t\t\t\t\t\"User-defined conversion `{0}' cannot convert to or from the dynamic type\",\n\t\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (conv_type.IsInterface) {\n\t\t\t\t\tReport.Error (552, Location, \"User-defined conversion `{0}' cannot convert to or from an interface type\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (conv_type.IsClass) {\n\t\t\t\t\tif (TypeSpec.IsBaseClass (declaring_type, conv_type, true)) {\n\t\t\t\t\t\tReport.Error (553, Location, \"User-defined conversion `{0}' cannot convert to or from a base class\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (TypeSpec.IsBaseClass (conv_type, declaring_type, false)) {\n\t\t\t\t\t\tReport.Error (554, Location, \"User-defined conversion `{0}' cannot convert to or from a derived class\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (OperatorType == OpType.LeftShift || OperatorType == OpType.RightShift) {\n\t\t\t\tif (first_arg_type != declaring_type || parameters.Types[1].BuiltinType != BuiltinTypeSpec.Type.Int) {\n\t\t\t\t\tReport.Error (564, Location, \"Overloaded shift operator must have the type of the first operand be the containing type, and the type of the second operand must be int\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (parameters.Count == 1) {\n\t\t\t\t// Checks for Unary operators\n\n\t\t\t\tif (OperatorType == OpType.Increment || OperatorType == OpType.Decrement) {\n\t\t\t\t\tif (return_type != declaring_type && !TypeSpec.IsBaseClass (return_type, declaring_type, false)) {\n\t\t\t\t\t\tReport.Error (448, Location,\n\t\t\t\t\t\t\t\"The return type for ++ or -- operator must be the containing type or derived from the containing type\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (first_arg_type != declaring_type) {\n\t\t\t\t\t\tReport.Error (\n\t\t\t\t\t\t\t559, Location, \"The parameter type for ++ or -- operator must be the containing type\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (first_arg_type_unwrap != declaring_type) {\n\t\t\t\t\tReport.Error (562, Location,\n\t\t\t\t\t\t\"The parameter type of a unary operator must be the containing type\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (OperatorType == OpType.True || OperatorType == OpType.False) {\n\t\t\t\t\tif (return_type.BuiltinType != BuiltinTypeSpec.Type.Bool) {\n\t\t\t\t\t\tReport.Error (\n\t\t\t\t\t\t\t215, Location,\n\t\t\t\t\t\t\t\"The return type of operator True or False \" +\n\t\t\t\t\t\t\t\"must be bool\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (first_arg_type_unwrap != declaring_type) {\n\t\t\t\t// Checks for Binary operators\n\n\t\t\t\tvar second_arg_type = ParameterTypes[1];\n\t\t\t\tif (second_arg_type.IsNullableType)\n\t\t\t\t\tsecond_arg_type = Nullable.NullableInfo.GetUnderlyingType (second_arg_type);\n\n\t\t\t\tif (second_arg_type != declaring_type) {\n\t\t\t\t\tReport.Error (563, Location,\n\t\t\t\t\t\t\"One of the parameters of a binary operator must be the containing type\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override bool ResolveMemberType ()\n\t\t{\n\t\t\tif (!base.ResolveMemberType ())\n\t\t\t\treturn false;\n\n\t\t\tflags |= MethodAttributes.SpecialName | MethodAttributes.HideBySig;\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override MemberSpec FindBaseMember (out MemberSpec bestCandidate, ref bool overrides)\n\t\t{\n\t\t\t// Operator cannot be override\n\t\t\tbestCandidate = null;\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static string GetName (OpType ot)\n\t\t{\n\t\t\treturn names [(int) ot] [0];\n\t\t}\n\n\t\tpublic static string GetName (string metadata_name)\n\t\t{\n\t\t\tfor (int i = 0; i < names.Length; ++i) {\n\t\t\t\tif (names [i] [1] == metadata_name)\n\t\t\t\t\treturn names [i] [0];\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static string GetMetadataName (OpType ot)\n\t\t{\n\t\t\treturn names [(int) ot] [1];\n\t\t}\n\n\t\tpublic static string GetMetadataName (string name)\n\t\t{\n\t\t\tfor (int i = 0; i < names.Length; ++i) {\n\t\t\t\tif (names [i] [0] == name)\n\t\t\t\t\treturn names [i] [1];\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static OpType? GetType (string metadata_name)\n\t\t{\n\t\t\tfor (int i = 0; i < names.Length; ++i) {\n\t\t\t\tif (names[i][1] == metadata_name)\n\t\t\t\t\treturn (OpType) i;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic OpType GetMatchingOperator ()\n\t\t{\n\t\t\tswitch (OperatorType) {\n\t\t\tcase OpType.Equality:\n\t\t\t\treturn OpType.Inequality;\n\t\t\tcase OpType.Inequality:\n\t\t\t\treturn OpType.Equality;\n\t\t\tcase OpType.True:\n\t\t\t\treturn OpType.False;\n\t\t\tcase OpType.False:\n\t\t\t\treturn OpType.True;\n\t\t\tcase OpType.GreaterThan:\n\t\t\t\treturn OpType.LessThan;\n\t\t\tcase OpType.LessThan:\n\t\t\t\treturn OpType.GreaterThan;\n\t\t\tcase OpType.GreaterThanOrEqual:\n\t\t\t\treturn OpType.LessThanOrEqual;\n\t\t\tcase OpType.LessThanOrEqual:\n\t\t\t\treturn OpType.GreaterThanOrEqual;\n\t\t\tdefault:\n\t\t\t\treturn OpType.TOP;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tstring s = base.GetSignatureForDocumentation ();\n\t\t\tif (OperatorType == OpType.Implicit || OperatorType == OpType.Explicit) {\n\t\t\t\ts = s + \"~\" + ReturnType.GetSignatureForDocumentation ();\n\t\t\t}\n\n\t\t\treturn s;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tif (OperatorType == OpType.Implicit || OperatorType == OpType.Explicit) {\n\t\t\t\tsb.AppendFormat (\"{0}.{1} operator {2}\",\n\t\t\t\t\tParent.GetSignatureForError (), GetName (OperatorType),\n\t\t\t\t\tmember_type == null ? type_expr.GetSignatureForError () : member_type.GetSignatureForError ());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsb.AppendFormat (\"{0}.operator {1}\", Parent.GetSignatureForError (), GetName (OperatorType));\n\t\t\t}\n\n\t\t\tsb.Append (parameters.GetSignatureForError ());\n\t\t\treturn sb.ToString ();\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/modifiers.cs",
    "content": "//\n// modifiers.cs: Modifiers handling\n//\n// Authors: Miguel de Icaza (miguel@gnu.org)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2010 Novell, Inc\n//\n\nusing System;\n\n#if STATIC\nusing IKVM.Reflection;\n#else\nusing System.Reflection;\n#endif\n\nnamespace Mono.CSharp\n{\n\t[Flags]\n\tpublic enum Modifiers\n\t{\n\t\tPROTECTED = 0x0001,\n\t\tPUBLIC    = 0x0002,\n\t\tPRIVATE   = 0x0004,\n\t\tINTERNAL  = 0x0008,\n\t\tNEW       = 0x0010,\n\t\tABSTRACT  = 0x0020,\n\t\tSEALED    = 0x0040,\n\t\tSTATIC    = 0x0080,\n\t\tREADONLY  = 0x0100,\n\t\tVIRTUAL   = 0x0200,\n\t\tOVERRIDE  = 0x0400,\n\t\tEXTERN    = 0x0800,\n\t\tVOLATILE  = 0x1000,\n\t\tUNSAFE    = 0x2000,\n\t\tASYNC     = 0x4000,\n\t\tTOP       = 0x8000,\n\n\t\t//\n\t\t// Compiler specific flags\n\t\t//\n\t\tPROPERTY_CUSTOM \t\t= 0x10000,\n\n\t\tPARTIAL\t\t\t\t\t= 0x20000,\n\t\tDEFAULT_ACCESS_MODIFIER\t= 0x40000,\n\t\tMETHOD_EXTENSION\t\t= 0x80000,\n\t\tCOMPILER_GENERATED\t\t= 0x100000,\n\t\tBACKING_FIELD\t\t\t= 0x200000,\n\t\tDEBUGGER_HIDDEN\t\t\t= 0x400000,\n\t\tDEBUGGER_STEP_THROUGH\t= 0x800000,\n\n\t\tAccessibilityMask = PUBLIC | PROTECTED | INTERNAL | PRIVATE,\n\t\tAllowedExplicitImplFlags = UNSAFE | EXTERN,\n\t}\n\n\tstatic class ModifiersExtensions\n\t{\n\t\tpublic static string AccessibilityName (Modifiers mod)\n\t\t{\n\t\t\tswitch (mod & Modifiers.AccessibilityMask) {\n\t\t\tcase Modifiers.PUBLIC:\n\t\t\t\treturn \"public\";\n\t\t\tcase Modifiers.PROTECTED:\n\t\t\t\treturn \"protected\";\n\t\t\tcase Modifiers.PROTECTED | Modifiers.INTERNAL:\n\t\t\t\treturn \"protected internal\";\n\t\t\tcase Modifiers.INTERNAL:\n\t\t\t\treturn \"internal\";\n\t\t\tcase Modifiers.PRIVATE:\n\t\t\t\treturn \"private\";\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (mod.ToString ());\n\t\t\t}\n\t\t}\n\n\t\tstatic public string Name (Modifiers i)\n\t\t{\n\t\t\tstring s = \"\";\n\t\t\t\n\t\t\tswitch (i) {\n\t\t\tcase Modifiers.NEW:\n\t\t\t\ts = \"new\"; break;\n\t\t\tcase Modifiers.PUBLIC:\n\t\t\t\ts = \"public\"; break;\n\t\t\tcase Modifiers.PROTECTED:\n\t\t\t\ts = \"protected\"; break;\n\t\t\tcase Modifiers.INTERNAL:\n\t\t\t\ts = \"internal\"; break;\n\t\t\tcase Modifiers.PRIVATE:\n\t\t\t\ts = \"private\"; break;\n\t\t\tcase Modifiers.ABSTRACT:\n\t\t\t\ts = \"abstract\"; break;\n\t\t\tcase Modifiers.SEALED:\n\t\t\t\ts = \"sealed\"; break;\n\t\t\tcase Modifiers.STATIC:\n\t\t\t\ts = \"static\"; break;\n\t\t\tcase Modifiers.READONLY:\n\t\t\t\ts = \"readonly\"; break;\n\t\t\tcase Modifiers.VIRTUAL:\n\t\t\t\ts = \"virtual\"; break;\n\t\t\tcase Modifiers.OVERRIDE:\n\t\t\t\ts = \"override\"; break;\n\t\t\tcase Modifiers.EXTERN:\n\t\t\t\ts = \"extern\"; break;\n\t\t\tcase Modifiers.VOLATILE:\n\t\t\t\ts = \"volatile\"; break;\n\t\t\tcase Modifiers.UNSAFE:\n\t\t\t\ts = \"unsafe\"; break;\n\t\t\tcase Modifiers.ASYNC:\n\t\t\t\ts = \"async\"; break;\n\t\t\t}\n\n\t\t\treturn s;\n\t\t}\n\n\t\t//\n\t\t// Used by custom property accessors to check whether @modA is more restrictive than @modB\n\t\t//\n\t\tpublic static bool IsRestrictedModifier (Modifiers modA, Modifiers modB)\n\t\t{\n\t\t\tModifiers flags = 0;\n\n\t\t\tif ((modB & Modifiers.PUBLIC) != 0) {\n\t\t\t\tflags = Modifiers.PROTECTED | Modifiers.INTERNAL | Modifiers.PRIVATE;\n\t\t\t} else if ((modB & Modifiers.PROTECTED) != 0) {\n\t\t\t\tif ((modB & Modifiers.INTERNAL) != 0)\n\t\t\t\t\tflags = Modifiers.PROTECTED | Modifiers.INTERNAL;\n\n\t\t\t\tflags |= Modifiers.PRIVATE;\n\t\t\t} else if ((modB & Modifiers.INTERNAL) != 0)\n\t\t\t\tflags = Modifiers.PRIVATE;\n\n\t\t\treturn modB != modA && (modA & (~flags)) == 0;\n\t\t}\n\n\t\tpublic static TypeAttributes TypeAttr (Modifiers mod_flags, bool is_toplevel)\n\t\t{\n\t\t\tTypeAttributes t = 0;\n\n\t\t\tif (is_toplevel){\n\t\t\t\tif ((mod_flags & Modifiers.PUBLIC) != 0)\n\t\t\t\t\tt = TypeAttributes.Public;\n\t\t\t\telse if ((mod_flags & Modifiers.PRIVATE) != 0)\n\t\t\t\t\tt = TypeAttributes.NotPublic;\n\t\t\t} else {\n\t\t\t\tif ((mod_flags & Modifiers.PUBLIC) != 0)\n\t\t\t\t\tt = TypeAttributes.NestedPublic;\n\t\t\t\telse if ((mod_flags & Modifiers.PRIVATE) != 0)\n\t\t\t\t\tt = TypeAttributes.NestedPrivate;\n\t\t\t\telse if ((mod_flags & (Modifiers.PROTECTED | Modifiers.INTERNAL)) == (Modifiers.PROTECTED | Modifiers.INTERNAL))\n\t\t\t\t\tt = TypeAttributes.NestedFamORAssem;\n\t\t\t\telse if ((mod_flags & Modifiers.PROTECTED) != 0)\n\t\t\t\t\tt = TypeAttributes.NestedFamily;\n\t\t\t\telse if ((mod_flags & Modifiers.INTERNAL) != 0)\n\t\t\t\t\tt = TypeAttributes.NestedAssembly;\n\t\t\t}\n\n\t\t\tif ((mod_flags & Modifiers.SEALED) != 0)\n\t\t\t\tt |= TypeAttributes.Sealed;\n\t\t\tif ((mod_flags & Modifiers.ABSTRACT) != 0)\n\t\t\t\tt |= TypeAttributes.Abstract;\n\n\t\t\treturn t;\n\t\t}\n\n\t\tpublic static FieldAttributes FieldAttr (Modifiers mod_flags)\n\t\t{\n\t\t\tFieldAttributes fa = 0;\n\n\t\t\tif ((mod_flags & Modifiers.PUBLIC) != 0)\n\t\t\t\tfa |= FieldAttributes.Public;\n\t\t\tif ((mod_flags & Modifiers.PRIVATE) != 0)\n\t\t\t\tfa |= FieldAttributes.Private;\n\t\t\tif ((mod_flags & Modifiers.PROTECTED) != 0) {\n\t\t\t\tif ((mod_flags & Modifiers.INTERNAL) != 0)\n\t\t\t\t\tfa |= FieldAttributes.FamORAssem;\n\t\t\t\telse \n\t\t\t\t\tfa |= FieldAttributes.Family;\n\t\t\t} else {\n\t\t\t\tif ((mod_flags & Modifiers.INTERNAL) != 0)\n\t\t\t\t\tfa |= FieldAttributes.Assembly;\n\t\t\t}\n\n\t\t\tif ((mod_flags & Modifiers.STATIC) != 0)\n\t\t\t\tfa |= FieldAttributes.Static;\n\t\t\tif ((mod_flags & Modifiers.READONLY) != 0)\n\t\t\t\tfa |= FieldAttributes.InitOnly;\n\n\t\t\treturn fa;\n\t\t}\n\n\t\tpublic static MethodAttributes MethodAttr (Modifiers mod_flags)\n\t\t{\n\t\t\tMethodAttributes ma = MethodAttributes.HideBySig;\n\n\t\t\tswitch (mod_flags & Modifiers.AccessibilityMask) {\n\t\t\tcase Modifiers.PUBLIC:\n\t\t\t\tma |= MethodAttributes.Public;\n\t\t\t\tbreak;\n\t\t\tcase Modifiers.PRIVATE:\n\t\t\t\tma |= MethodAttributes.Private;\n\t\t\t\tbreak;\n\t\t\tcase Modifiers.PROTECTED | Modifiers.INTERNAL:\n\t\t\t\tma |= MethodAttributes.FamORAssem;\n\t\t\t\tbreak;\n\t\t\tcase Modifiers.PROTECTED:\n\t\t\t\tma |= MethodAttributes.Family;\n\t\t\t\tbreak;\n\t\t\tcase Modifiers.INTERNAL:\n\t\t\t\tma |= MethodAttributes.Assembly;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new NotImplementedException (mod_flags.ToString ());\n\t\t\t}\n\n\t\t\tif ((mod_flags & Modifiers.STATIC) != 0)\n\t\t\t\tma |= MethodAttributes.Static;\n\t\t\tif ((mod_flags & Modifiers.ABSTRACT) != 0) {\n\t\t\t\tma |= MethodAttributes.Abstract | MethodAttributes.Virtual;\n\t\t\t}\n\t\t\tif ((mod_flags & Modifiers.SEALED) != 0)\n\t\t\t\tma |= MethodAttributes.Final;\n\n\t\t\tif ((mod_flags & Modifiers.VIRTUAL) != 0)\n\t\t\t\tma |= MethodAttributes.Virtual;\n\n\t\t\tif ((mod_flags & Modifiers.OVERRIDE) != 0) {\n\t\t\t\tma |= MethodAttributes.Virtual;\n\t\t\t} else {\n\t\t\t\tif ((ma & MethodAttributes.Virtual) != 0)\n\t\t\t\t\tma |= MethodAttributes.NewSlot;\n\t\t\t}\n\t\t\t\n\t\t\treturn ma;\n\t\t}\n\n\t\t// <summary>\n\t\t//   Checks the object @mod modifiers to be in @allowed.\n\t\t//   Returns the new mask.  Side effect: reports any\n\t\t//   incorrect attributes. \n\t\t// </summary>\n\t\tpublic static Modifiers Check (Modifiers allowed, Modifiers mod, Modifiers def_access, Location l, Report Report)\n\t\t{\n\t\t\tint invalid_flags = (~(int) allowed) & ((int) mod & ((int) Modifiers.TOP - 1));\n\t\t\tint i;\n\n\t\t\tif (invalid_flags == 0){\n\t\t\t\t//\n\t\t\t\t// If no accessibility bits provided\n\t\t\t\t// then provide the defaults.\n\t\t\t\t//\n\t\t\t\tif ((mod & Modifiers.AccessibilityMask) == 0) {\n\t\t\t\t\tmod |= def_access;\n\t\t\t\t\tif (def_access != 0)\n\t\t\t\t\t\tmod |= Modifiers.DEFAULT_ACCESS_MODIFIER;\n\t\t\t\t\treturn mod;\n\t\t\t\t}\n\n\t\t\t\treturn mod;\n\t\t\t}\n\n\t\t\tfor (i = 1; i < (int) Modifiers.TOP; i <<= 1) {\n\t\t\t\tif ((i & invalid_flags) == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tError_InvalidModifier ((Modifiers)i, l, Report);\n\t\t\t}\n\n\t\t\treturn allowed & mod;\n\t\t}\n\n\t\tstatic void Error_InvalidModifier (Modifiers mod, Location l, Report Report)\n\t\t{\n\t\t\tReport.Error (106, l, \"The modifier `{0}' is not valid for this item\",\n\t\t\t\tName (mod));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/module.cs",
    "content": "//\n// module.cs: keeps a tree representation of the generated code\n//\n// Authors: Miguel de Icaza (miguel@gnu.org)\n//          Marek Safar  (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing Mono.CompilerServices.SymbolWriter;\nusing System.Linq;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\t//\n\t// Module (top-level type) container\n\t//\n\tpublic sealed class ModuleContainer : TypeContainer\n\t{\n#if STATIC\n\t\t//\n\t\t// Compiler generated container for static data\n\t\t//\n\t\tsealed class StaticDataContainer : CompilerGeneratedContainer\n\t\t{\n\t\t\treadonly Dictionary<int, Struct> size_types;\n\t\t\tint fields;\n\n\t\t\tpublic StaticDataContainer (ModuleContainer module)\n\t\t\t\t: base (module, new MemberName (\"<PrivateImplementationDetails>\" + module.builder.ModuleVersionId.ToString (\"B\"), Location.Null),\n\t\t\t\t\tModifiers.STATIC | Modifiers.INTERNAL)\n\t\t\t{\n\t\t\t\tsize_types = new Dictionary<int, Struct> ();\n\t\t\t}\n\n\t\t\tpublic override void CloseContainer ()\n\t\t\t{\n\t\t\t\tbase.CloseContainer ();\n\n\t\t\t\tforeach (var entry in size_types) {\n\t\t\t\t\tentry.Value.CloseContainer ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic FieldSpec DefineInitializedData (byte[] data, Location loc)\n\t\t\t{\n\t\t\t\tStruct size_type;\n\t\t\t\tif (!size_types.TryGetValue (data.Length, out size_type)) {\n\t\t\t\t\t//\n\t\t\t\t\t// Build common type for this data length. We cannot use\n\t\t\t\t\t// DefineInitializedData because it creates public type,\n\t\t\t\t\t// and its name is not unique among modules\n\t\t\t\t\t//\n\t\t\t\t\tsize_type = new Struct (this, new MemberName (\"$ArrayType=\" + data.Length, loc), Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED, null);\n\t\t\t\t\tsize_type.CreateContainer ();\n\t\t\t\t\tsize_type.DefineContainer ();\n\n\t\t\t\t\tsize_types.Add (data.Length, size_type);\n\n\t\t\t\t\t// It has to work even if StructLayoutAttribute does not exist\n\t\t\t\t\tsize_type.TypeBuilder.__SetLayout (1, data.Length);\n\t\t\t\t}\n\n\t\t\t\tvar name = \"$field-\" + fields.ToString (\"X\");\n\t\t\t\t++fields;\n\t\t\t\tconst Modifiers fmod = Modifiers.STATIC | Modifiers.INTERNAL;\n\t\t\t\tvar fbuilder = TypeBuilder.DefineField (name, size_type.CurrentType.GetMetaInfo (), ModifiersExtensions.FieldAttr (fmod) | FieldAttributes.HasFieldRVA);\n\t\t\t\tfbuilder.__SetDataAndRVA (data);\n\n\t\t\t\treturn new FieldSpec (CurrentType, null, size_type.CurrentType, fbuilder, fmod);\n\t\t\t}\n\t\t}\n\n\t\tStaticDataContainer static_data;\n\n\t\t//\n\t\t// Makes const data field inside internal type container\n\t\t//\n\t\tpublic FieldSpec MakeStaticData (byte[] data, Location loc)\n\t\t{\n\t\t\tif (static_data == null) {\n\t\t\t\tstatic_data = new StaticDataContainer (this);\n\t\t\t\tstatic_data.CreateContainer ();\n\t\t\t\tstatic_data.DefineContainer ();\n\n\t\t\t\tAddCompilerGeneratedClass (static_data);\n\t\t\t}\n\n\t\t\treturn static_data.DefineInitializedData (data, loc);\n\t\t}\n#endif\n\n\t\tpublic sealed class PatternMatchingHelper : CompilerGeneratedContainer\n\t\t{\n\t\t\tpublic PatternMatchingHelper (ModuleContainer module)\n\t\t\t\t: base (module, new MemberName (\"<PatternMatchingHelper>\", Location.Null),\n\t\t\t\t\tModifiers.STATIC | Modifiers.INTERNAL | Modifiers.DEBUGGER_HIDDEN)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic Method NumberMatcher { get; private set; }\n\n\t\t\tprotected override bool DoDefineMembers ()\n\t\t\t{\n\t\t\t\tif (!base.DoDefineMembers ())\n\t\t\t\t\treturn false;\n\n\t\t\t\tNumberMatcher = GenerateNumberMatcher ();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tMethod GenerateNumberMatcher ()\n\t\t\t{\n\t\t\t\tvar loc = Location;\n\t\t\t\tvar parameters = ParametersCompiled.CreateFullyResolved (\n\t\t\t\t\tnew [] {\n\t\t\t\t\t\tnew Parameter (new TypeExpression (Compiler.BuiltinTypes.Object, loc), \"obj\", 0, null, loc),\n\t\t\t\t\t\tnew Parameter (new TypeExpression (Compiler.BuiltinTypes.Object, loc), \"value\", 0, null, loc),\n\t\t\t\t\t\tnew Parameter (new TypeExpression (Compiler.BuiltinTypes.Bool, loc), \"enumType\", 0, null, loc),\n\t\t\t\t\t},\n\t\t\t\t\tnew [] {\n\t\t\t\t\t\tCompiler.BuiltinTypes.Object,\n\t\t\t\t\t\tCompiler.BuiltinTypes.Object,\n\t\t\t\t\t\tCompiler.BuiltinTypes.Bool\n\t\t\t\t\t});\n\n\t\t\t\tvar m = new Method (this, new TypeExpression (Compiler.BuiltinTypes.Bool, loc),\n\t\t\t\t\tModifiers.PUBLIC | Modifiers.STATIC | Modifiers.DEBUGGER_HIDDEN, new MemberName (\"NumberMatcher\", loc),\n\t\t\t\t\tparameters, null);\n\n\t\t\t\tparameters [0].Resolve (m, 0);\n\t\t\t\tparameters [1].Resolve (m, 1);\n\t\t\t\tparameters [2].Resolve (m, 2);\n\n\t\t\t\tToplevelBlock top_block = new ToplevelBlock (Compiler, parameters, loc);\n\t\t\t\tm.Block = top_block;\n\n\t\t\t\t//\n\t\t\t\t// if (enumType)\n\t\t\t\t//\t\treturn Equals (obj, value);\n\t\t\t\t//\n\t\t\t\tvar equals_args = new Arguments (2);\n\t\t\t\tequals_args.Add (new Argument (top_block.GetParameterReference (0, loc)));\n\t\t\t\tequals_args.Add (new Argument (top_block.GetParameterReference (1, loc)));\n\n\t\t\t\tvar if_type = new If (\n\t\t\t\t\t              top_block.GetParameterReference (2, loc),\n\t\t\t\t\t              new Return (new Invocation (new SimpleName (\"Equals\", loc), equals_args), loc),\n\t\t\t\t\t              loc);\n\n\t\t\t\ttop_block.AddStatement (if_type);\n\n\t\t\t\t//\n\t\t\t\t// if (obj is Enum || obj == null)\n\t\t\t\t//\t\treturn false;\n\t\t\t\t//\n\n\t\t\t\tvar if_enum = new If (\n\t\t\t\t\t              new Binary (Binary.Operator.LogicalOr,\n\t\t\t\t\t\t              new Is (top_block.GetParameterReference (0, loc), new TypeExpression (Compiler.BuiltinTypes.Enum, loc), loc),\n\t\t\t\t\t\t              new Binary (Binary.Operator.Equality, top_block.GetParameterReference (0, loc), new NullLiteral (loc))),\n\t\t\t\t\t              new Return (new BoolLiteral (Compiler.BuiltinTypes, false, loc), loc),\n\t\t\t\t\t              loc);\n\n\t\t\t\ttop_block.AddStatement (if_enum);\n\n\n\t\t\t\tvar system_convert = new MemberAccess (new QualifiedAliasMember (\"global\", \"System\", loc), \"Convert\", loc);\n\n\t\t\t\t//\n\t\t\t\t// var converted = System.Convert.ChangeType (obj, System.Convert.GetTypeCode (value));\n\t\t\t\t//\n\t\t\t\tvar lv_converted = LocalVariable.CreateCompilerGenerated (Compiler.BuiltinTypes.Object, top_block, loc);\n\n\t\t\t\tvar arguments_gettypecode = new Arguments (1);\n\t\t\t\targuments_gettypecode.Add (new Argument (top_block.GetParameterReference (1, loc)));\n\n\t\t\t\tvar gettypecode = new Invocation (new MemberAccess (system_convert, \"GetTypeCode\", loc), arguments_gettypecode);\n\n\t\t\t\tvar arguments_changetype = new Arguments (1);\n\t\t\t\targuments_changetype.Add (new Argument (top_block.GetParameterReference (0, loc)));\n\t\t\t\targuments_changetype.Add (new Argument (gettypecode));\n\n\t\t\t\tvar changetype = new Invocation (new MemberAccess (system_convert, \"ChangeType\", loc), arguments_changetype);\n\n\t\t\t\ttop_block.AddStatement (new StatementExpression (new SimpleAssign (new LocalVariableReference (lv_converted, loc), changetype, loc)));\n\n\n\t\t\t\t//\n\t\t\t\t// return converted.Equals (value)\n\t\t\t\t//\n\t\t\t\tvar equals_arguments = new Arguments (1);\n\t\t\t\tequals_arguments.Add (new Argument (top_block.GetParameterReference (1, loc)));\n\t\t\t\tvar equals_invocation = new Invocation (new MemberAccess (new LocalVariableReference (lv_converted, loc), \"Equals\"), equals_arguments);\n\t\t\t\ttop_block.AddStatement (new Return (equals_invocation, loc));\n\n\t\t\t\tm.Define ();\n\t\t\t\tm.PrepareEmit ();\n\t\t\t\tAddMember (m);\n\n\t\t\t\treturn m;\n\t\t\t}\n\t\t}\n\n\t\tPatternMatchingHelper pmh;\n\n\t\tpublic PatternMatchingHelper CreatePatterMatchingHelper ()\n\t\t{\n\t\t\tif (pmh == null) {\n\t\t\t\tpmh = new PatternMatchingHelper (this);\n\n\t\t\t\tpmh.CreateContainer ();\n\t\t\t\tpmh.DefineContainer ();\n\t\t\t\tpmh.Define ();\n\t\t\t\tAddCompilerGeneratedClass (pmh);\n\t\t\t}\n\n\t\t\treturn pmh;\n\t\t}\n\n\t\tpublic CharSet? DefaultCharSet;\n\t\tpublic TypeAttributes DefaultCharSetType = TypeAttributes.AnsiClass;\n\n\t\treadonly Dictionary<int, List<AnonymousTypeClass>> anonymous_types;\n\t\treadonly Dictionary<ArrayContainer.TypeRankPair, ArrayContainer> array_types;\n\t\treadonly Dictionary<TypeSpec, PointerContainer> pointer_types;\n\t\treadonly Dictionary<TypeSpec, ReferenceContainer> reference_types;\n\t\treadonly Dictionary<TypeSpec, MethodSpec> attrs_cache;\n\t\treadonly Dictionary<TypeSpec, AwaiterDefinition> awaiters;\n\n\t\tAssemblyDefinition assembly;\n\t\treadonly CompilerContext context;\n\t\treadonly RootNamespace global_ns;\n\t\treadonly Dictionary<string, RootNamespace> alias_ns;\n\n\t\tModuleBuilder builder;\n\n\t\tbool has_extenstion_method;\n\n\t\tPredefinedAttributes predefined_attributes;\n\t\tPredefinedTypes predefined_types;\n\t\tPredefinedMembers predefined_members;\n\n\t\tpublic Binary.PredefinedOperator[] OperatorsBinaryEqualityLifted;\n\t\tpublic Binary.PredefinedOperator[] OperatorsBinaryLifted;\n\n\t\tstatic readonly string[] attribute_targets = new string[] { \"assembly\", \"module\" };\n\n\t\tpublic ModuleContainer (CompilerContext context)\n\t\t\t: base (null, MemberName.Null, null, 0)\n\t\t{\n\t\t\tthis.context = context;\n\n\t\t\tcaching_flags &= ~(Flags.Obsolete_Undetected | Flags.Excluded_Undetected);\n\n\t\t\tcontainers = new List<TypeContainer> ();\n\t\t\tanonymous_types = new Dictionary<int, List<AnonymousTypeClass>> ();\n\t\t\tglobal_ns = new GlobalRootNamespace ();\n\t\t\talias_ns = new Dictionary<string, RootNamespace> ();\n\t\t\tarray_types = new Dictionary<ArrayContainer.TypeRankPair, ArrayContainer> ();\n\t\t\tpointer_types = new Dictionary<TypeSpec, PointerContainer> ();\n\t\t\treference_types = new Dictionary<TypeSpec, ReferenceContainer> ();\n\t\t\tattrs_cache = new Dictionary<TypeSpec, MethodSpec> ();\n\t\t\tawaiters = new Dictionary<TypeSpec, AwaiterDefinition> ();\n\t\t}\n\n\t\t#region Properties\n\n\t\tinternal Dictionary<ArrayContainer.TypeRankPair, ArrayContainer> ArrayTypesCache {\n\t\t\tget {\n\t\t\t\treturn array_types;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Cache for parameter-less attributes\n\t\t//\n\t\tinternal Dictionary<TypeSpec, MethodSpec> AttributeConstructorCache {\n\t\t\tget {\n\t\t\t\treturn attrs_cache;\n\t\t\t}\n\t\t}\n\n \t\tpublic override AttributeTargets AttributeTargets {\n \t\t\tget {\n \t\t\t\treturn AttributeTargets.Assembly;\n \t\t\t}\n\t\t}\n\n\t\tpublic ModuleBuilder Builder {\n\t\t\tget {\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\n\t\tpublic override CompilerContext Compiler {\n\t\t\tget {\n\t\t\t\treturn context;\n\t\t\t}\n\t\t}\n\n\t\tpublic int CounterAnonymousTypes { get; set; }\n\n\t\tpublic AssemblyDefinition DeclaringAssembly {\n\t\t\tget {\n\t\t\t\treturn assembly;\n\t\t\t}\n\t\t}\n\n\t\tinternal DocumentationBuilder DocumentationBuilder {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic override string DocCommentHeader {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic Evaluator Evaluator {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic bool HasDefaultCharSet {\n\t\t\tget {\n\t\t\t\treturn DefaultCharSet.HasValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasExtensionMethod {\n\t\t\tget {\n\t\t\t\treturn has_extenstion_method;\n\t\t\t}\n\t\t\tset {\n\t\t\t\thas_extenstion_method = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasTypesFullyDefined {\n\t\t\tget; set;\n\t\t}\n\n\t\t//\n\t\t// Returns module global:: namespace\n\t\t//\n\t\tpublic RootNamespace GlobalRootNamespace {\n\t\t    get {\n\t\t        return global_ns;\n\t\t    }\n\t\t}\n\n\t\tpublic override ModuleContainer Module {\n\t\t\tget {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tinternal Dictionary<TypeSpec, PointerContainer> PointerTypesCache {\n\t\t\tget {\n\t\t\t\treturn pointer_types;\n\t\t\t}\n\t\t}\n\n\t\tinternal PredefinedAttributes PredefinedAttributes {\n\t\t\tget {\n\t\t\t\treturn predefined_attributes;\n\t\t\t}\n\t\t}\n\n\t\tinternal PredefinedMembers PredefinedMembers {\n\t\t\tget {\n\t\t\t\treturn predefined_members;\n\t\t\t}\n\t\t}\n\n\t\tinternal PredefinedTypes PredefinedTypes {\n\t\t\tget {\n\t\t\t\treturn predefined_types;\n\t\t\t}\n\t\t}\n\n\t\tinternal Dictionary<TypeSpec, ReferenceContainer> ReferenceTypesCache {\n\t\t\tget {\n\t\t\t\treturn reference_types;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic void AddAnonymousType (AnonymousTypeClass type)\n\t\t{\n\t\t\tList<AnonymousTypeClass> existing;\n\t\t\tif (!anonymous_types.TryGetValue (type.Parameters.Count, out existing))\n\t\t\tif (existing == null) {\n\t\t\t\texisting = new List<AnonymousTypeClass> ();\n\t\t\t\tanonymous_types.Add (type.Parameters.Count, existing);\n\t\t\t}\n\n\t\t\texisting.Add (type);\n\t\t}\n\n\t\tpublic void AddAttribute (Attribute attr, IMemberContext context)\n\t\t{\n\t\t\tattr.AttachTo (this, context);\n\n\t\t\tif (attributes == null) {\n\t\t\t\tattributes = new Attributes (attr);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes.AddAttribute (attr);\n\t\t}\n\n\t\tpublic override void AddTypeContainer (TypeContainer tc)\n\t\t{\n\t\t\tAddTypeContainerMember (tc);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Target == AttributeTargets.Assembly) {\n\t\t\t\tassembly.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.DefaultCharset) {\n\t\t\t\tswitch (a.GetCharSetValue ()) {\n\t\t\t\tcase CharSet.Ansi:\n\t\t\t\tcase CharSet.None:\n\t\t\t\t\tbreak;\n\t\t\t\tcase CharSet.Auto:\n\t\t\t\t\tDefaultCharSet = CharSet.Auto;\n\t\t\t\t\tDefaultCharSetType = TypeAttributes.AutoClass;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CharSet.Unicode:\n\t\t\t\t\tDefaultCharSet = CharSet.Unicode;\n\t\t\t\t\tDefaultCharSetType = TypeAttributes.UnicodeClass;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tReport.Error (1724, a.Location, \"Value specified for the argument to `{0}' is not valid\",\n\t\t\t\t\t\ta.GetSignatureForError ());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (a.Type == pa.CLSCompliant) {\n\t\t\t\tAttribute cls = DeclaringAssembly.CLSCompliantAttribute;\n\t\t\t\tif (cls == null) {\n\t\t\t\t\tReport.Warning (3012, 1, a.Location,\n\t\t\t\t\t\t\"You must specify the CLSCompliant attribute on the assembly, not the module, to enable CLS compliance checking\");\n\t\t\t\t} else if (DeclaringAssembly.IsCLSCompliant != a.GetBoolean ()) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (cls.Location, cls.GetSignatureForError ());\n\t\t\t\t\tReport.Warning (3017, 1, a.Location,\n\t\t\t\t\t\t\"You cannot specify the CLSCompliant attribute on a module that differs from the CLSCompliant attribute on the assembly\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tpublic override void CloseContainer ()\n\t\t{\n\t\t\tif (anonymous_types != null) {\n\t\t\t\tforeach (var atypes in anonymous_types)\n\t\t\t\t\tforeach (var at in atypes.Value)\n\t\t\t\t\t\tat.CloseContainer ();\n\t\t\t}\n\n\t\t\tbase.CloseContainer ();\n\t\t}\n\n\t\tpublic TypeBuilder CreateBuilder (string name, TypeAttributes attr, int typeSize)\n\t\t{\n\t\t\treturn builder.DefineType (name, attr, null, typeSize);\n\t\t}\n\n\t\t//\n\t\t// Creates alias global namespace\n\t\t//\n\t\tpublic RootNamespace CreateRootNamespace (string alias)\n\t\t{\n\t\t\tif (alias == global_ns.Alias) {\n\t\t\t\tRootNamespace.Error_GlobalNamespaceRedefined (Report, Location.Null);\n\t\t\t\treturn global_ns;\n\t\t\t}\n\n\t\t\tRootNamespace rn;\n\t\t\tif (!alias_ns.TryGetValue (alias, out rn)) {\n\t\t\t\trn = new RootNamespace (alias);\n\t\t\t\talias_ns.Add (alias, rn);\n\t\t\t}\n\n\t\t\treturn rn;\n\t\t}\n\n\t\tpublic void Create (AssemblyDefinition assembly, ModuleBuilder moduleBuilder)\n\t\t{\n\t\t\tthis.assembly = assembly;\n\t\t\tbuilder = moduleBuilder;\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tDefineContainer ();\n\n\t\t\tExpandBaseInterfaces ();\n\n\t\t\tbase.Define ();\n\n\t\t\tHasTypesFullyDefined = true;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool DefineContainer ()\n\t\t{\n\t\t\tDefineNamespace ();\n\n\t\t\treturn base.DefineContainer ();\n\t\t}\n\n\t\tpublic void EnableRedefinition ()\n\t\t{\n\t\t\tis_defined = false;\n\t\t}\n\n\t\tpublic override void EmitContainer ()\n\t\t{\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tif (Compiler.Settings.Unsafe && !assembly.IsSatelliteAssembly) {\n\t\t\t\tvar pa = PredefinedAttributes.UnverifiableCode;\n\t\t\t\tif (pa.IsDefined)\n\t\t\t\t\tpa.EmitAttribute (builder);\n\t\t\t}\n\n\t\t\tforeach (var tc in containers) {\n\t\t\t\ttc.PrepareEmit ();\n\t\t\t}\n\n\t\t\tbase.EmitContainer ();\n\n\t\t\tif (Compiler.Report.Errors == 0 && !Compiler.Settings.WriteMetadataOnly)\n\t\t\t\tVerifyMembers ();\n\n\t\t\tif (anonymous_types != null) {\n\t\t\t\tforeach (var atypes in anonymous_types)\n\t\t\t\t\tforeach (var at in atypes.Value)\n\t\t\t\t\t\tat.EmitContainer ();\n\t\t\t}\n\t\t}\n\n\t\tinternal override void GenerateDocComment (DocumentationBuilder builder)\n\t\t{\n\t\t\tforeach (var tc in containers)\n\t\t\t\ttc.GenerateDocComment (builder);\n\t\t}\n\n\t\tpublic AnonymousTypeClass GetAnonymousType (IList<AnonymousTypeParameter> parameters)\n\t\t{\n\t\t\tList<AnonymousTypeClass> candidates;\n\t\t\tif (!anonymous_types.TryGetValue (parameters.Count, out candidates))\n\t\t\t\treturn null;\n\n\t\t\tint i;\n\t\t\tforeach (AnonymousTypeClass at in candidates) {\n\t\t\t\tfor (i = 0; i < parameters.Count; ++i) {\n\t\t\t\t\tif (!parameters [i].Equals (at.Parameters [i]))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (i == parameters.Count)\n\t\t\t\t\treturn at;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t//\n\t\t// Return container with awaiter definition. It never returns null\n\t\t// but all container member can be null for easier error reporting\n\t\t//\n\t\tpublic AwaiterDefinition GetAwaiter (TypeSpec type)\n\t\t{\n\t\t\tAwaiterDefinition awaiter;\n\t\t\tif (awaiters.TryGetValue (type, out awaiter))\n\t\t\t\treturn awaiter;\n\n\t\t\tawaiter = new AwaiterDefinition ();\n\n\t\t\t//\n\t\t\t// Predefined: bool IsCompleted { get; } \n\t\t\t//\n\t\t\tawaiter.IsCompleted = MemberCache.FindMember (type, MemberFilter.Property (\"IsCompleted\", Compiler.BuiltinTypes.Bool),\n\t\t\t\tBindingRestriction.InstanceOnly) as PropertySpec;\n\n\t\t\t//\n\t\t\t// Predefined: GetResult ()\n\t\t\t//\n\t\t\t// The method return type is also result type of await expression\n\t\t\t//\n\t\t\tawaiter.GetResult = MemberCache.FindMember (type, MemberFilter.Method (\"GetResult\", 0,\n\t\t\t\tParametersCompiled.EmptyReadOnlyParameters, null),\n\t\t\t\tBindingRestriction.InstanceOnly) as MethodSpec;\n\n\t\t\t//\n\t\t\t// Predefined: INotifyCompletion.OnCompleted (System.Action)\n\t\t\t//\n\t\t\tvar nc = PredefinedTypes.INotifyCompletion;\n\t\t\tawaiter.INotifyCompletion = !nc.Define () || type.ImplementsInterface (nc.TypeSpec, false);\n\n\t\t\tawaiters.Add (type, awaiter);\n\t\t\treturn awaiter;\n\t\t}\n\n\t\tpublic override void GetCompletionStartingWith (string prefix, List<string> results)\n\t\t{\n\t\t\tvar names = Evaluator.GetVarNames ();\n\t\t\tresults.AddRange (names.Where (l => l.StartsWith (prefix)));\n\t\t}\n\n\t\tpublic RootNamespace GetRootNamespace (string name)\n\t\t{\n\t\t\tRootNamespace rn;\n\t\t\talias_ns.TryGetValue (name, out rn);\n\t\t\treturn rn;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn \"<module>\";\n\t\t}\n\n\t\tpublic Binary.PredefinedOperator[] GetPredefinedEnumAritmeticOperators (TypeSpec enumType, bool nullable)\n\t\t{\n\t\t\tTypeSpec underlying;\n\t\t\tBinary.Operator mask = 0;\n\n\t\t\tif (nullable) {\n\t\t\t\tunderlying = Nullable.NullableInfo.GetEnumUnderlyingType (this, enumType);\n\t\t\t\tmask = Binary.Operator.NullableMask;\n\t\t\t} else {\n\t\t\t\tunderlying = EnumSpec.GetUnderlyingType (enumType);\n\t\t\t}\n\n\t\t\tvar operators = new[] {\n\t\t\t\tnew Binary.PredefinedOperator (enumType, underlying,\n\t\t\t\t\tmask | Binary.Operator.AdditionMask | Binary.Operator.SubtractionMask | Binary.Operator.DecomposedMask, enumType),\n\t\t\t\tnew Binary.PredefinedOperator (underlying, enumType,\n\t\t\t\t\tmask | Binary.Operator.AdditionMask | Binary.Operator.SubtractionMask | Binary.Operator.DecomposedMask, enumType),\n\t\t\t\tnew Binary.PredefinedOperator (enumType, mask | Binary.Operator.SubtractionMask, underlying)\n\t\t\t};\n\n\t\t\treturn operators;\n\t\t}\n\n\t\tpublic void InitializePredefinedTypes ()\n\t\t{\n\t\t\tpredefined_attributes = new PredefinedAttributes (this);\n\t\t\tpredefined_types = new PredefinedTypes (this);\n\t\t\tpredefined_members = new PredefinedMembers (this);\n\n\t\t\tOperatorsBinaryEqualityLifted = Binary.CreateEqualityLiftedOperatorsTable (this);\n\t\t\tOperatorsBinaryLifted = Binary.CreateStandardLiftedOperatorsTable (this);\n\t\t}\n\n\t\tpublic override bool IsClsComplianceRequired ()\n\t\t{\n\t\t\treturn DeclaringAssembly.IsCLSCompliant;\n\t\t}\n\n\t\tpublic Attribute ResolveAssemblyAttribute (PredefinedAttribute a_type)\n\t\t{\n\t\t\tAttribute a = OptAttributes.Search (\"assembly\", a_type);\n\t\t\tif (a != null) {\n\t\t\t\ta.Resolve ();\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\n\t\tpublic void SetDeclaringAssembly (AssemblyDefinition assembly)\n\t\t{\n\t\t\t// TODO: This setter is quite ugly but I have not found a way around it yet\n\t\t\tthis.assembly = assembly;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs",
    "content": "//\n// namespace.cs: Tracks namespaces\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@seznam.cz)\n//\n// Copyright 2001 Ximian, Inc.\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Mono.CompilerServices.SymbolWriter;\n\nnamespace Mono.CSharp {\n\n\tpublic class RootNamespace : Namespace {\n\n\t\treadonly string alias_name;\n\t\treadonly Dictionary<string, Namespace> all_namespaces;\n\n\t\tpublic RootNamespace (string alias_name)\n\t\t\t: base ()\n\t\t{\n\t\t\tthis.alias_name = alias_name;\n\t\t\tRegisterNamespace (this);\n\n\t\t\tall_namespaces = new Dictionary<string, Namespace> ();\n\t\t\tall_namespaces.Add (\"\", this);\n\t\t}\n\n\t\tpublic string Alias {\n\t\t\tget {\n\t\t\t\treturn alias_name;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Error_GlobalNamespaceRedefined (Report report, Location loc)\n\t\t{\n\t\t\treport.Error (1681, loc, \"The global extern alias cannot be redefined\");\n\t\t}\n\n\t\t//\n\t\t// For better error reporting where we try to guess missing using directive\n\t\t//\n\t\tpublic List<string> FindTypeNamespaces (IMemberContext ctx, string name, int arity)\n\t\t{\n\t\t\tList<string> res = null;\n\n\t\t\tforeach (var ns in all_namespaces) {\n\t\t\t\tvar type = ns.Value.LookupType (ctx, name, arity, LookupMode.Normal, Location.Null);\n\t\t\t\tif (type != null) {\n\t\t\t\t\tif (res == null)\n\t\t\t\t\t\tres = new List<string> ();\n\n\t\t\t\t\tres.Add (ns.Key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\t//\n\t\t// For better error reporting where compiler tries to guess missing using directive\n\t\t//\n\t\tpublic List<string> FindExtensionMethodNamespaces (IMemberContext ctx, string name, int arity)\n\t\t{\n\t\t\tList<string> res = null;\n\n\t\t\tforeach (var ns in all_namespaces) {\n\t\t\t\tvar methods = ns.Value.LookupExtensionMethod (ctx, name, arity);\n\t\t\t\tif (methods != null) {\n\t\t\t\t\tif (res == null)\n\t\t\t\t\t\tres = new List<string> ();\n\n\t\t\t\t\tres.Add (ns.Key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic void RegisterNamespace (Namespace child)\n\t\t{\n\t\t\tif (child != this)\n\t\t\t\tall_namespaces.Add (child.Name, child);\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn alias_name + \"::\";\n\t\t}\n\t}\n\n\tpublic sealed class GlobalRootNamespace : RootNamespace\n\t{\n\t\tpublic GlobalRootNamespace ()\n\t\t\t: base (\"global\")\n\t\t{\n\t\t}\n\t}\n\n\t//\n\t// Namespace cache for imported and compiled namespaces\n\t//\n\tpublic class Namespace\n\t{\n\t\treadonly Namespace parent;\n\t\tstring fullname;\n\t\tprotected Dictionary<string, Namespace> namespaces;\n\t\tprotected Dictionary<string, IList<TypeSpec>> types;\n\t\tList<TypeSpec> extension_method_types;\n\t\tDictionary<string, TypeSpec> cached_types;\n\t\tbool cls_checked;\n\n\t\t/// <summary>\n\t\t///   Constructor Takes the current namespace and the\n\t\t///   name.  This is bootstrapped with parent == null\n\t\t///   and name = \"\"\n\t\t/// </summary>\n\t\tpublic Namespace (Namespace parent, string name)\n\t\t\t: this ()\n\t\t{\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException (\"name\");\n\n\t\t\tthis.parent = parent;\n\n\t\t\tstring pname = parent != null ? parent.fullname : null;\n\t\t\t\t\n\t\t\tif (pname == null)\n\t\t\t\tfullname = name;\n\t\t\telse\n\t\t\t\tfullname = pname + \".\" + name;\n\n\t\t\twhile (parent.parent != null)\n\t\t\t\tparent = parent.parent;\n\n\t\t\tvar root = parent as RootNamespace;\n\t\t\tif (root == null)\n\t\t\t\tthrow new InternalErrorException (\"Root namespaces must be created using RootNamespace\");\n\n\t\t\troot.RegisterNamespace (this);\n\t\t}\n\n\t\tprotected Namespace ()\n\t\t{\n\t\t\tnamespaces = new Dictionary<string, Namespace> ();\n\t\t\tcached_types = new Dictionary<string, TypeSpec> ();\n\t\t}\n\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t///   The qualified name of the current namespace\n\t\t/// </summary>\n\t\tpublic string Name {\n\t\t\tget { return fullname; }\n\t\t}\n\n\t\t/// <summary>\n\t\t///   The parent of this namespace, used by the parser to \"Pop\"\n\t\t///   the current namespace declaration\n\t\t/// </summary>\n\t\tpublic Namespace Parent {\n\t\t\tget { return parent; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic Namespace AddNamespace (MemberName name)\n\t\t{\n\t\t\tvar ns_parent = name.Left == null ? this : AddNamespace (name.Left);\n\t\t\treturn ns_parent.TryAddNamespace (name.Basename);\n\t\t}\n\n\t\tNamespace TryAddNamespace (string name)\n\t\t{\n\t\t\tNamespace ns;\n\n\t\t\tif (!namespaces.TryGetValue (name, out ns)) {\n\t\t\t\tns = new Namespace (this, name);\n\t\t\t\tnamespaces.Add (name, ns);\n\t\t\t}\n\n\t\t\treturn ns;\n\t\t}\n\n\t\tpublic bool TryGetNamespace (string name, out Namespace ns)\n\t\t{\n\t\t\treturn namespaces.TryGetValue (name, out ns);\n\t\t}\n\n\t\t// TODO: Replace with CreateNamespace where MemberName is created for the method call\n\t\tpublic Namespace GetNamespace (string name, bool create)\n\t\t{\n\t\t\tint pos = name.IndexOf ('.');\n\n\t\t\tNamespace ns;\n\t\t\tstring first;\n\t\t\tif (pos >= 0)\n\t\t\t\tfirst = name.Substring (0, pos);\n\t\t\telse\n\t\t\t\tfirst = name;\n\n\t\t\tif (!namespaces.TryGetValue (first, out ns)) {\n\t\t\t\tif (!create)\n\t\t\t\t\treturn null;\n\n\t\t\t\tns = new Namespace (this, first);\n\t\t\t\tnamespaces.Add (first, ns);\n\t\t\t}\n\n\t\t\tif (pos >= 0)\n\t\t\t\tns = ns.GetNamespace (name.Substring (pos + 1), create);\n\n\t\t\treturn ns;\n\t\t}\n\n\t\tpublic IList<TypeSpec> GetAllTypes (string name)\n\t\t{\n\t\t\tIList<TypeSpec> found;\n\t\t\tif (types == null || !types.TryGetValue (name, out found))\n\t\t\t\treturn null;\n\n\t\t\treturn found;\n\t\t}\n\n\t\tpublic virtual string GetSignatureForError ()\n\t\t{\n\t\t\treturn fullname;\n\t\t}\n\n\t\tpublic TypeSpec LookupType (IMemberContext ctx, string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\tif (types == null)\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec best = null;\n\t\t\tif (arity == 0 && cached_types.TryGetValue (name, out best)) {\n\t\t\t\tif (best != null || mode != LookupMode.IgnoreAccessibility)\n\t\t\t\t\treturn best;\n\t\t\t}\n\n\t\t\tIList<TypeSpec> found;\n\t\t\tif (!types.TryGetValue (name, out found))\n\t\t\t\treturn null;\n\n\t\t\tforeach (var ts in found) {\n\t\t\t\tif (ts.Arity == arity || mode == LookupMode.NameOf) {\n\t\t\t\t\tif (best == null) {\n\t\t\t\t\t\tif ((ts.Modifiers & Modifiers.INTERNAL) != 0 && !ts.MemberDefinition.IsInternalAsPublic (ctx.Module.DeclaringAssembly) && mode != LookupMode.IgnoreAccessibility)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tbest = ts;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (best.MemberDefinition.IsImported && ts.MemberDefinition.IsImported) {\n\t\t\t\t\t\tif (ts.Kind == MemberKind.MissingType)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (best.Kind == MemberKind.MissingType) {\n\t\t\t\t\t\t\tbest = ts;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (mode == LookupMode.Normal) {\n\t\t\t\t\t\t\tctx.Module.Compiler.Report.SymbolRelatedToPreviousError (best);\n\t\t\t\t\t\t\tctx.Module.Compiler.Report.SymbolRelatedToPreviousError (ts);\n\t\t\t\t\t\t\tctx.Module.Compiler.Report.Error (433, loc, \"The imported type `{0}' is defined multiple times\", ts.GetSignatureForError ());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (best.MemberDefinition.IsImported)\n\t\t\t\t\t\tbest = ts;\n\n\t\t\t\t\tif ((best.Modifiers & Modifiers.INTERNAL) != 0 && !best.MemberDefinition.IsInternalAsPublic (ctx.Module.DeclaringAssembly))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (mode != LookupMode.Normal)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (ts.MemberDefinition.IsImported) {\n\t\t\t\t\t\tctx.Module.Compiler.Report.SymbolRelatedToPreviousError (best);\n\t\t\t\t\t\tctx.Module.Compiler.Report.SymbolRelatedToPreviousError (ts);\n\t\t\t\t\t}\n\n\t\t\t\t\tctx.Module.Compiler.Report.Warning (436, 2, loc,\n\t\t\t\t\t\t\"The type `{0}' conflicts with the imported type of same name'. Ignoring the imported type definition\",\n\t\t\t\t\t\tbest.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Lookup for the best candidate with the closest arity match\n\t\t\t\t//\n\t\t\t\tif (arity < 0) {\n\t\t\t\t\tif (best == null) {\n\t\t\t\t\t\tbest = ts;\n\t\t\t\t\t} else if (System.Math.Abs (ts.Arity + arity) < System.Math.Abs (best.Arity + arity)) {\n\t\t\t\t\t\tbest = ts;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO MemberCache: Cache more\n\t\t\tif (arity == 0 && mode == LookupMode.Normal)\n\t\t\t\tcached_types.Add (name, best);\n\n\t\t\tif (best != null) {\n\t\t\t\tvar dep = best.GetMissingDependencies ();\n\t\t\t\tif (dep != null)\n\t\t\t\t\tImportedTypeDefinition.Error_MissingDependency (ctx, dep, loc);\n\t\t\t}\n\n\t\t\treturn best;\n\t\t}\n\n\t\tpublic FullNamedExpression LookupTypeOrNamespace (IMemberContext ctx, string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\tvar texpr = LookupType (ctx, name, arity, mode, loc);\n\n\t\t\tNamespace ns;\n\t\t\tif (arity == 0 && namespaces.TryGetValue (name, out ns)) {\n\t\t\t\tif (texpr == null)\n\t\t\t\t\treturn new NamespaceExpression (ns, loc);\n\n\t\t\t\tif (mode != LookupMode.Probing) {\n\t\t\t\t\t//ctx.Module.Compiler.Report.SymbolRelatedToPreviousError (texpr.Type);\n\t\t\t\t\t// ctx.Module.Compiler.Report.SymbolRelatedToPreviousError (ns.loc, \"\");\n\t\t\t\t\tctx.Module.Compiler.Report.Warning (437, 2, loc,\n\t\t\t\t\t\t\"The type `{0}' conflicts with the imported namespace `{1}'. Using the definition found in the source file\",\n\t\t\t\t\t\ttexpr.GetSignatureForError (), ns.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (texpr.MemberDefinition.IsImported)\n\t\t\t\t\treturn new NamespaceExpression (ns, loc);\n\t\t\t}\n\n\t\t\tif (texpr == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new TypeExpression (texpr, loc);\n\t\t}\n\n\t\t//\n\t\t// Completes types with the given `prefix'\n\t\t//\n\t\tpublic IEnumerable<string> CompletionGetTypesStartingWith (string prefix)\n\t\t{\n\t\t\tif (types == null)\n\t\t\t\treturn Enumerable.Empty<string> ();\n\n\t\t\tvar res = from item in types\n\t\t\t\t\t  where item.Key.StartsWith (prefix) && item.Value.Any (l => (l.Modifiers & Modifiers.PUBLIC) != 0)\n\t\t\t\t\t  select item.Key;\n\n\t\t\tif (namespaces != null)\n\t\t\t\tres = res.Concat (from item in namespaces where item.Key.StartsWith (prefix) select item.Key);\n\n\t\t\treturn res;\n\t\t}\n\n\t\t// \n\t\t// Looks for extension method in this namespace\n\t\t//\n\t\tpublic List<MethodSpec> LookupExtensionMethod (IMemberContext invocationContext, string name, int arity)\n\t\t{\n\t\t\tif (extension_method_types == null)\n\t\t\t\treturn null;\n\n\t\t\tList<MethodSpec> found = null;\n\t\t\tfor (int i = 0; i < extension_method_types.Count; ++i) {\n\t\t\t\tvar ts = extension_method_types[i];\n\n\t\t\t\t//\n\t\t\t\t// When the list was built we didn't know what members the type\n\t\t\t\t// contains\n\t\t\t\t//\n\t\t\t\tif ((ts.Modifiers & Modifiers.METHOD_EXTENSION) == 0) {\n\t\t\t\t\tif (extension_method_types.Count == 1) {\n\t\t\t\t\t\textension_method_types = null;\n\t\t\t\t\t\treturn found;\n\t\t\t\t\t}\n\n\t\t\t\t\textension_method_types.RemoveAt (i--);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar res = ts.MemberCache.FindExtensionMethods (invocationContext, name, arity);\n\t\t\t\tif (res == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (found == null) {\n\t\t\t\t\tfound = res;\n\t\t\t\t} else {\n\t\t\t\t\tfound.AddRange (res);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn found;\n\t\t}\n\n\t\tpublic void AddType (ModuleContainer module, TypeSpec ts)\n\t\t{\n\t\t\tif (types == null) {\n\t\t\t\ttypes = new Dictionary<string, IList<TypeSpec>> (64);\n\t\t\t}\n\n\t\t\tif (ts.IsClass && ts.Arity == 0) {\n\t\t\t\tvar extension_method_allowed = ts.MemberDefinition.IsImported ? (ts.Modifiers & Modifiers.METHOD_EXTENSION) != 0 : (ts.IsStatic || ts.MemberDefinition.IsPartial);\n\t\t\t\tif (extension_method_allowed) {\n\t\t\t\t\tif (extension_method_types == null)\n\t\t\t\t\t\textension_method_types = new List<TypeSpec> ();\n\n\t\t\t\t\textension_method_types.Add (ts);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar name = ts.Name;\n\t\t\tIList<TypeSpec> existing;\n\t\t\tif (types.TryGetValue (name, out existing)) {\n\t\t\t\tTypeSpec better_type;\n\t\t\t\tTypeSpec found;\n\t\t\t\tif (existing.Count == 1) {\n\t\t\t\t\tfound = existing[0];\n\t\t\t\t\tif (ts.Arity == found.Arity) {\n\t\t\t\t\t\tbetter_type = IsImportedTypeOverride (module, ts, found);\n\t\t\t\t\t\tif (better_type == found)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tif (better_type != null) {\n\t\t\t\t\t\t\texisting [0] = better_type;\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\texisting = new List<TypeSpec> ();\n\t\t\t\t\texisting.Add (found);\n\t\t\t\t\ttypes[name] = existing;\n\t\t\t\t} else {\n\t\t\t\t\tfor (int i = 0; i < existing.Count; ++i) {\n\t\t\t\t\t\tfound = existing[i];\n\t\t\t\t\t\tif (ts.Arity != found.Arity)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tbetter_type = IsImportedTypeOverride (module, ts, found);\n\t\t\t\t\t\tif (better_type == found)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tif (better_type != null) {\n\t\t\t\t\t\t\texisting.RemoveAt (i);\n\t\t\t\t\t\t\t--i;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\texisting.Add (ts);\n\t\t\t} else {\n\t\t\t\ttypes.Add (name, new TypeSpec[] { ts });\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// We import any types but in the situation there are same types\n\t\t// but one has better visibility (either public or internal with friend)\n\t\t// the less visible type is removed from the namespace cache\n\t\t//\n\t\tpublic static TypeSpec IsImportedTypeOverride (ModuleContainer module, TypeSpec ts, TypeSpec found)\n\t\t{\n\t\t\tvar ts_accessible = (ts.Modifiers & Modifiers.PUBLIC) != 0 || ts.MemberDefinition.IsInternalAsPublic (module.DeclaringAssembly);\n\t\t\tvar found_accessible = (found.Modifiers & Modifiers.PUBLIC) != 0 || found.MemberDefinition.IsInternalAsPublic (module.DeclaringAssembly);\n\n\t\t\tif (ts_accessible && !found_accessible)\n\t\t\t\treturn ts;\n\n\t\t\t// found is better always better for accessible or inaccessible ts\n\t\t\tif (!ts_accessible)\n\t\t\t\treturn found;\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic void RemoveContainer (TypeContainer tc)\n\t\t{\n\t\t\ttypes.Remove (tc.Basename);\n\t\t\tcached_types.Remove (tc.Basename);\n\t\t}\n\n\t\tpublic void SetBuiltinType (BuiltinTypeSpec pts)\n\t\t{\n\t\t\tvar found = types[pts.Name];\n\t\t\tcached_types.Remove (pts.Name);\n\t\t\tif (found.Count == 1) {\n\t\t\t\ttypes[pts.Name][0] = pts;\n\t\t\t} else {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic void VerifyClsCompliance ()\n\t\t{\n\t\t\tif (types == null || cls_checked)\n\t\t\t\treturn;\n\n\t\t\tcls_checked = true;\n\n\t\t\t// TODO: This is quite ugly way to check for CLS compliance at namespace level\n\n\t\t\tvar locase_types = new Dictionary<string, List<TypeSpec>> (StringComparer.OrdinalIgnoreCase);\n\t\t\tforeach (var tgroup in types.Values) {\n\t\t\t\tforeach (var tm in tgroup) {\n\t\t\t\t\tif ((tm.Modifiers & Modifiers.PUBLIC) == 0 || !tm.IsCLSCompliant ())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tList<TypeSpec> found;\n\t\t\t\t\tif (!locase_types.TryGetValue (tm.Name, out found)) {\n\t\t\t\t\t\tfound = new List<TypeSpec> ();\n\t\t\t\t\t\tlocase_types.Add (tm.Name, found);\n\t\t\t\t\t}\n\n\t\t\t\t\tfound.Add (tm);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (var locase in locase_types.Values) {\n\t\t\t\tif (locase.Count < 2)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tbool all_same = true;\n\t\t\t\tforeach (var notcompliant in locase) {\n\t\t\t\t\tall_same = notcompliant.Name == locase[0].Name;\n\t\t\t\t\tif (!all_same)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (all_same)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tTypeContainer compiled = null;\n\t\t\t\tforeach (var notcompliant in locase) {\n\t\t\t\t\tif (!notcompliant.MemberDefinition.IsImported) {\n\t\t\t\t\t\tif (compiled != null)\n\t\t\t\t\t\t\tcompiled.Compiler.Report.SymbolRelatedToPreviousError (compiled);\n\n\t\t\t\t\t\tcompiled = notcompliant.MemberDefinition as TypeContainer;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcompiled.Compiler.Report.SymbolRelatedToPreviousError (notcompliant);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcompiled.Compiler.Report.Warning (3005, 1, compiled.Location,\n\t\t\t\t\t\"Identifier `{0}' differing only in case is not CLS-compliant\", compiled.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class CompilationSourceFile : NamespaceContainer\n\t{\n\t\treadonly SourceFile file;\n\t\tCompileUnitEntry comp_unit;\n\t\tDictionary<string, SourceFile> include_files;\n\t\tDictionary<string, bool> conditionals;\n\n\t\tpublic CompilationSourceFile (ModuleContainer parent, SourceFile sourceFile)\n\t\t\t: this (parent)\n\t\t{\n\t\t\tthis.file = sourceFile;\n\t\t}\n\n\t\tpublic CompilationSourceFile (ModuleContainer parent)\n\t\t\t: base (parent)\n\t\t{\n\t\t}\n\n\t\tpublic CompileUnitEntry SymbolUnitEntry {\n\t\t\tget {\n\t\t\t\treturn comp_unit;\n\t\t\t}\n\t\t}\n\n\t\tpublic IDictionary<string, bool> Conditionals {\n\t\t\tget {\n\t\t\t\treturn conditionals ?? new Dictionary<string, bool> ();\n\t\t\t}\n\t\t}\n\n\t\tpublic string FileName {\n\t\t\tget {\n\t\t\t\treturn file.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic SourceFile SourceFile {\n\t\t\tget {\n\t\t\t\treturn file;\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddIncludeFile (SourceFile file)\n\t\t{\n\t\t\tif (file == this.file)\n\t\t\t\treturn;\n\n\t\t\tif (include_files == null)\n\t\t\t\tinclude_files = new Dictionary<string, SourceFile> ();\n\n\t\t\tif (!include_files.ContainsKey (file.FullPathName))\n\t\t\t\tinclude_files.Add (file.FullPathName, file);\n\t\t}\n\n\t\tpublic void AddDefine (string value)\n\t\t{\n\t\t\tif (conditionals == null)\n\t\t\t\tconditionals = new Dictionary<string, bool> (2);\n\n\t\t\tconditionals[value] = true;\n\t\t}\n\n\t\tpublic void AddUndefine (string value)\n\t\t{\n\t\t\tif (conditionals == null)\n\t\t\t\tconditionals = new Dictionary<string, bool> (2);\n\n\t\t\tconditionals[value] = false;\n\t\t}\n\n\t\tpublic override void PrepareEmit ()\n\t\t{\n\t\t\tvar sw = Module.DeclaringAssembly.SymbolWriter;\n\t\t\tif (sw != null) {\n\t\t\t\tCreateUnitSymbolInfo (sw);\n\t\t\t}\n\n\t\t\tbase.PrepareEmit ();\n\t\t}\n\n\t\t//\n\t\t// Creates symbol file index in debug symbol file\n\t\t//\n\t\tvoid CreateUnitSymbolInfo (MonoSymbolFile symwriter)\n\t\t{\n\t\t\tvar si = file.CreateSymbolInfo (symwriter);\n\t\t\tcomp_unit = new CompileUnitEntry (symwriter, si);\n\n\t\t\tif (include_files != null) {\n\t\t\t\tforeach (SourceFile include in include_files.Values) {\n\t\t\t\t\tsi = include.CreateSymbolInfo (symwriter);\n\t\t\t\t\tcomp_unit.AddFile (si);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConditionalDefined (string value)\n\t\t{\n\t\t\tif (conditionals != null) {\n\t\t\t\tbool res;\n\t\t\t\tif (conditionals.TryGetValue (value, out res))\n\t\t\t\t\treturn res;\n\n\t\t\t\t// When conditional was undefined\n\t\t\t\tif (conditionals.ContainsKey (value))\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn Compiler.Settings.IsConditionalSymbolDefined (value);\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\t}\n\n\n\t//\n\t// Namespace block as created by the parser\n\t//\n\tpublic class NamespaceContainer : TypeContainer, IMemberContext\n\t{\n\t\tstatic readonly Namespace[] empty_namespaces = new Namespace[0];\n\n\t\treadonly Namespace ns;\n\n\t\tpublic new readonly NamespaceContainer Parent;\n\n\t\tList<UsingNamespace> clauses;\n\n\t\t// Used by parsed to check for parser errors\n\t\tpublic bool DeclarationFound;\n\n\t\tNamespace[] namespace_using_table;\n\t\tTypeSpec[] types_using_table;\n\t\tDictionary<string, UsingAliasNamespace> aliases;\n\t\tpublic readonly MemberName RealMemberName;\n\n\t\tpublic NamespaceContainer (MemberName name, NamespaceContainer parent)\n\t\t\t: base (parent, name, null, MemberKind.Namespace)\n\t\t{\n\t\t\tthis.RealMemberName = name;\n\t\t\tthis.Parent = parent;\n\t\t\tthis.ns = parent.NS.AddNamespace (name);\n\n\t\t\tcontainers = new List<TypeContainer> ();\n\t\t}\n\n\t\tprotected NamespaceContainer (ModuleContainer parent)\n\t\t\t: base (parent, null, null, MemberKind.Namespace)\n\t\t{\n\t\t\tns = parent.GlobalRootNamespace;\n\t\t\tcontainers = new List<TypeContainer> (2);\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic override string DocCommentHeader {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic Namespace NS {\n\t\t\tget {\n\t\t\t\treturn ns;\n\t\t\t}\n\t\t}\n\n\t\tpublic List<UsingNamespace> Usings {\n\t\t\tget {\n\t\t\t\treturn clauses;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void AddUsing (UsingNamespace un)\n\t\t{\n\t\t\tif (DeclarationFound){\n\t\t\t\tCompiler.Report.Error (1529, un.Location, \"A using clause must precede all other namespace elements except extern alias declarations\");\n\t\t\t}\n\n\t\t\tif (clauses == null)\n\t\t\t\tclauses = new List<UsingNamespace> ();\n\n\t\t\tclauses.Add (un);\n\t\t}\n\n\t\tpublic void AddUsing (UsingAliasNamespace un)\n\t\t{\n\t\t\tif (DeclarationFound){\n\t\t\t\tCompiler.Report.Error (1529, un.Location, \"A using clause must precede all other namespace elements except extern alias declarations\");\n\t\t\t}\n\n\t\t\tAddAlias (un);\n\t\t}\n\n\t\tvoid AddAlias (UsingAliasNamespace un)\n\t\t{\n\t\t\tif (clauses == null) {\n\t\t\t\tclauses = new List<UsingNamespace> ();\n\t\t\t} else {\n\t\t\t\tforeach (var entry in clauses) {\n\t\t\t\t\tvar a = entry as UsingAliasNamespace;\n\t\t\t\t\tif (a != null && a.Alias.Value == un.Alias.Value) {\n\t\t\t\t\t\tCompiler.Report.SymbolRelatedToPreviousError (a.Location, \"\");\n\t\t\t\t\t\tCompiler.Report.Error (1537, un.Location,\n\t\t\t\t\t\t\t\"The using alias `{0}' appeared previously in this namespace\", un.Alias.Value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclauses.Add (un);\n\t\t}\n\n\t\tpublic override void AddPartial (TypeDefinition next_part)\n\t\t{\n\t\t\tvar existing = ns.LookupType (this, next_part.MemberName.Name, next_part.MemberName.Arity, LookupMode.Probing, Location.Null);\n\t\t\tvar td = existing != null ? existing.MemberDefinition as TypeDefinition : null;\n\t\t\tAddPartial (next_part, td);\n\t\t}\n\n\t\tpublic override void AddTypeContainer (TypeContainer tc)\n\t\t{\n\t\t\tstring name = tc.Basename;\n\n\t\t\tvar mn = tc.MemberName;\n\t\t\twhile (mn.Left != null) {\n\t\t\t\tmn = mn.Left;\n\t\t\t\tname = mn.Name;\n\t\t\t}\n\n\t\t\tvar names_container = Parent == null ? Module : (TypeContainer) this;\n\n\t\t\tMemberCore mc;\n\t\t\tif (names_container.DefinedNames.TryGetValue (name, out mc)) {\n\t\t\t\tif (tc is NamespaceContainer && mc is NamespaceContainer) {\n\t\t\t\t\tAddTypeContainerMember (tc);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tReport.SymbolRelatedToPreviousError (mc);\n\t\t\t\tif ((mc.ModFlags & Modifiers.PARTIAL) != 0 && (tc is ClassOrStruct || tc is Interface)) {\n\t\t\t\t\tError_MissingPartialModifier (tc);\n\t\t\t\t} else {\n\t\t\t\t\tReport.Error (101, tc.Location, \"The namespace `{0}' already contains a definition for `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), mn.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnames_container.DefinedNames.Add (name, tc);\n\n\t\t\t\tvar tdef = tc.PartialContainer;\n\t\t\t\tif (tdef != null) {\n\t\t\t\t\t//\n\t\t\t\t\t// Same name conflict in different namespace containers\n\t\t\t\t\t//\n\t\t\t\t\tvar conflict = ns.GetAllTypes (name);\n\t\t\t\t\tif (conflict != null) {\n\t\t\t\t\t\tforeach (var e in conflict) {\n\t\t\t\t\t\t\tif (e.Arity == mn.Arity) {\n\t\t\t\t\t\t\t\tmc = (MemberCore) e.MemberDefinition;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (mc != null) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (mc);\n\t\t\t\t\t\tReport.Error (101, tc.Location, \"The namespace `{0}' already contains a definition for `{1}'\",\n\t\t\t\t\t\t\tGetSignatureForError (), mn.GetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tns.AddType (Module, tdef.Definition);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.AddTypeContainer (tc);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic override void EmitContainer ()\n\t\t{\n\t\t\tVerifyClsCompliance ();\n\n\t\t\tbase.EmitContainer ();\n\t\t}\n\n\t\tpublic ExtensionMethodCandidates LookupExtensionMethod (IMemberContext invocationContext, TypeSpec extensionType, string name, int arity, int position)\n\t\t{\n\t\t\t//\n\t\t\t// Here we try to resume the search for extension method at the point\n\t\t\t// where the last bunch of candidates was found. It's more tricky than\n\t\t\t// it seems as we have to check both namespace containers and namespace\n\t\t\t// in correct order.\n\t\t\t//\n\t\t\t// Consider:\n\t\t\t// \n\t\t\t// namespace A {\n\t\t\t//\tusing N1;\n\t\t\t//  namespace B.C.D {\n\t\t\t//\t\t<our first search found candidates in A.B.C.D\n\t\t\t//  }\n\t\t\t// }\n\t\t\t//\n\t\t\t// In the example above namespace A.B.C.D, A.B.C and A.B have to be\n\t\t\t// checked before we hit A.N1 using\n\t\t\t//\n\t\t\tExtensionMethodCandidates candidates;\n\t\t\tvar container = this;\n\t\t\tdo {\n\t\t\t\tcandidates = container.LookupExtensionMethodCandidates (invocationContext, name, arity, ref position);\n\t\t\t\tif (candidates != null || container.MemberName == null)\n\t\t\t\t\treturn candidates;\n\n\t\t\t\tvar container_ns = container.ns.Parent;\n\t\t\t\tvar mn = container.MemberName.Left;\n\t\t\t\tint already_checked = position - 2;\n\t\t\t\twhile (already_checked-- > 0) {\n\t\t\t\t\tmn = mn.Left;\n\t\t\t\t\tcontainer_ns = container_ns.Parent;\n\t\t\t\t}\n\n\t\t\t\twhile (mn != null) {\n\t\t\t\t\t++position;\n\n\t\t\t\t\tvar methods = container_ns.LookupExtensionMethod (invocationContext, name, arity);\n\t\t\t\t\tif (methods != null) {\n\t\t\t\t\t\treturn new ExtensionMethodCandidates (invocationContext, methods, container, position);\n\t\t\t\t\t}\n\n\t\t\t\t\tmn = mn.Left;\n\t\t\t\t\tcontainer_ns = container_ns.Parent;\n\t\t\t\t}\n\n\t\t\t\tposition = 0;\n\t\t\t\tcontainer = container.Parent;\n\t\t\t} while (container != null);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tExtensionMethodCandidates LookupExtensionMethodCandidates (IMemberContext invocationContext, string name, int arity, ref int position)\n\t\t{\n\t\t\tList<MethodSpec> candidates = null;\n\n\t\t\tif (position == 0) {\n\t\t\t\t++position;\n\n\t\t\t\tcandidates = ns.LookupExtensionMethod (invocationContext, name, arity);\n\t\t\t\tif (candidates != null) {\n\t\t\t\t\treturn new ExtensionMethodCandidates (invocationContext, candidates, this, position);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (position == 1) {\n\t\t\t\t++position;\n\n\t\t\t\tforeach (Namespace n in namespace_using_table) {\n\t\t\t\t\tvar a = n.LookupExtensionMethod (invocationContext, name, arity);\n\t\t\t\t\tif (a == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (candidates == null)\n\t\t\t\t\t\tcandidates = a;\n\t\t\t\t\telse\n\t\t\t\t\t\tcandidates.AddRange (a);\n\t\t\t\t}\n\n\t\t\t\tif (candidates != null)\n\t\t\t\t\treturn new ExtensionMethodCandidates (invocationContext, candidates, this, position);\n\t\t\t}\n\n\t\t\t// LAMESPEC: TODO no spec about priority over normal extension methods yet\n\t\t\tif (types_using_table != null) {\n\t\t\t\tforeach (var t in types_using_table) {\n\n\t\t\t\t\tvar res = t.MemberCache.FindExtensionMethods (invocationContext, name, arity);\n\t\t\t\t\tif (res == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (candidates == null)\n\t\t\t\t\t\tcandidates = res;\n\t\t\t\t\telse\n\t\t\t\t\t\tcandidates.AddRange (res);\n\t\t\t\t}\n\n\t\t\t\tif (candidates != null)\n\t\t\t\t\treturn new ExtensionMethodCandidates (invocationContext, candidates, this, position);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\t//\n\t\t\t// Only simple names (no dots) will be looked up with this function\n\t\t\t//\n\t\t\tFullNamedExpression resolved;\n\t\t\tfor (NamespaceContainer container = this; container != null; container = container.Parent) {\n\t\t\t\tresolved = container.Lookup (name, arity, mode, loc);\n\t\t\t\tif (resolved != null || container.MemberName == null)\n\t\t\t\t\treturn resolved;\n\n\t\t\t\tvar container_ns = container.ns.Parent;\n\t\t\t\tvar mn = container.MemberName.Left;\n\t\t\t\twhile (mn != null) {\n\t\t\t\t\tresolved = container_ns.LookupTypeOrNamespace (this, name, arity, mode, loc);\n\t\t\t\t\tif (resolved != null)\n\t\t\t\t\t\treturn resolved;\n\n\t\t\t\t\tmn = mn.Left;\n\t\t\t\t\tcontainer_ns = container_ns.Parent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override void GetCompletionStartingWith (string prefix, List<string> results)\n\t\t{\n\t\t\tif (Usings == null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var un in Usings) {\n\t\t\t\tif (un.Alias != null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar name = un.NamespaceExpression.Name;\n\t\t\t\tif (name.StartsWith (prefix))\n\t\t\t\t\tresults.Add (name);\n\t\t\t}\n\n\n\t\t\tIEnumerable<string> all = Enumerable.Empty<string> ();\n\n\t\t\tforeach (Namespace using_ns in namespace_using_table) {\n\t\t\t\tif (prefix.StartsWith (using_ns.Name)) {\n\t\t\t\t\tint ld = prefix.LastIndexOf ('.');\n\t\t\t\t\tif (ld != -1) {\n\t\t\t\t\t\tstring rest = prefix.Substring (ld + 1);\n\n\t\t\t\t\t\tall = all.Concat (using_ns.CompletionGetTypesStartingWith (rest));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tall = all.Concat (using_ns.CompletionGetTypesStartingWith (prefix));\n\t\t\t}\n\n\t\t\tresults.AddRange (all);\n\n\t\t\tbase.GetCompletionStartingWith (prefix, results);\n\t\t}\n\n\t\t\n\t\t//\n\t\t// Looks-up a alias named @name in this and surrounding namespace declarations\n\t\t//\n\t\tpublic FullNamedExpression LookupExternAlias (string name)\n\t\t{\n\t\t\tif (aliases == null)\n\t\t\t\treturn null;\n\n\t\t\tUsingAliasNamespace uan;\n\t\t\tif (aliases.TryGetValue (name, out uan) && uan is UsingExternAlias)\n\t\t\t\treturn uan.ResolvedExpression;\n\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//\n\t\t// Looks-up a alias named @name in this and surrounding namespace declarations\n\t\t//\n\t\tpublic override FullNamedExpression LookupNamespaceAlias (string name)\n\t\t{\n\t\t\tfor (NamespaceContainer n = this; n != null; n = n.Parent) {\n\t\t\t\tif (n.aliases == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tUsingAliasNamespace uan;\n\t\t\t\tif (n.aliases.TryGetValue (name, out uan))\n\t\t\t\t\treturn uan.ResolvedExpression;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tFullNamedExpression Lookup (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\t//\n\t\t\t// Check whether it's in the namespace.\n\t\t\t//\n\t\t\tFullNamedExpression fne = ns.LookupTypeOrNamespace (this, name, arity, mode, loc);\n\n\t\t\t//\n\t\t\t// Check aliases. \n\t\t\t//\n\t\t\tif (aliases != null && arity == 0) {\n\t\t\t\tUsingAliasNamespace uan;\n\t\t\t\tif (aliases.TryGetValue (name, out uan)) {\n\t\t\t\t\tif (fne != null && mode != LookupMode.Probing) {\n\t\t\t\t\t\t// TODO: Namespace has broken location\n\t\t\t\t\t\t//Report.SymbolRelatedToPreviousError (fne.Location, null);\n\t\t\t\t\t\tCompiler.Report.SymbolRelatedToPreviousError (uan.Location, null);\n\t\t\t\t\t\tCompiler.Report.Error (576, loc,\n\t\t\t\t\t\t\t\"Namespace `{0}' contains a definition with same name as alias `{1}'\",\n\t\t\t\t\t\t\tGetSignatureForError (), name);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn uan.ResolvedExpression;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fne != null)\n\t\t\t\treturn fne;\n\n\t\t\t//\n\t\t\t// Lookup can be called before the namespace is defined from different namespace using alias clause\n\t\t\t//\n\t\t\tif (namespace_using_table == null) {\n\t\t\t\tDoDefineNamespace ();\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Check using entries.\n\t\t\t//\n\t\t\tFullNamedExpression match = null;\n\t\t\tforeach (Namespace using_ns in namespace_using_table) {\n\t\t\t\t//\n\t\t\t\t// A using directive imports only types contained in the namespace, it\n\t\t\t\t// does not import any nested namespaces\n\t\t\t\t//\n\t\t\t\tvar t = using_ns.LookupType (this, name, arity, mode, loc);\n\t\t\t\tif (t == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfne = new TypeExpression (t, loc);\n\t\t\t\tif (match == null) {\n\t\t\t\t\tmatch = fne;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Prefer types over namespaces\n\t\t\t\tvar texpr_fne = fne as TypeExpr;\n\t\t\t\tvar texpr_match = match as TypeExpr;\n\t\t\t\tif (texpr_fne != null && texpr_match == null) {\n\t\t\t\t\tmatch = fne;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (texpr_fne == null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// It can be top level accessibility only\n\t\t\t\tvar better = Namespace.IsImportedTypeOverride (Module, texpr_match.Type, texpr_fne.Type);\n\t\t\t\tif (better == null) {\n\t\t\t\t\tif (mode == LookupMode.Normal) {\n\t\t\t\t\t\tCompiler.Report.SymbolRelatedToPreviousError (texpr_match.Type);\n\t\t\t\t\t\tCompiler.Report.SymbolRelatedToPreviousError (texpr_fne.Type);\n\t\t\t\t\t\tCompiler.Report.Error (104, loc, \"`{0}' is an ambiguous reference between `{1}' and `{2}'\",\n\t\t\t\t\t\t\tname, texpr_match.GetSignatureForError (), texpr_fne.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\n\t\t\t\tif (better == texpr_fne.Type)\n\t\t\t\t\tmatch = texpr_fne;\n\t\t\t}\n\n\t\t\treturn match;\n\t\t}\n\n\t\tpublic static MethodGroupExpr LookupStaticUsings (IMemberContext mc, string name, int arity, Location loc)\n\t\t{\n\t\t\tfor (var m = mc.CurrentMemberDefinition; m != null; m = m.Parent) {\n\n\t\t\t\tvar nc = m as NamespaceContainer;\n\t\t\t\tif (nc == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tList<MemberSpec> candidates = null;\n\t\t\t\tif (nc.types_using_table != null) {\n\t\t\t\t\tforeach (var using_type in nc.types_using_table) {\n\t\t\t\t\t\tvar members = MemberCache.FindMembers (using_type, name, true);\n\t\t\t\t\t\tif (members != null) {\n\t\t\t\t\t\t\tforeach (var member in members) {\n\t\t\t\t\t\t\t\tif ((member.Modifiers & Modifiers.METHOD_EXTENSION) != 0)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (arity > 0 && member.Arity != arity)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (candidates == null)\n\t\t\t\t\t\t\t\t\tcandidates = new List<MemberSpec> ();\n\n\t\t\t\t\t\t\t\tcandidates.Add (member);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (candidates != null)\n\t\t\t\t\treturn new MethodGroupExpr (candidates, null, loc);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override void DefineNamespace ()\n\t\t{\n\t\t\tif (namespace_using_table == null)\n\t\t\t\tDoDefineNamespace ();\n\n\t\t\tbase.DefineNamespace ();\n\t\t}\n\n\t\tvoid DoDefineNamespace ()\n\t\t{\n\t\t\tnamespace_using_table = empty_namespaces;\n\n\t\t\tif (clauses != null) {\n\t\t\t\tList<Namespace> namespaces = null;\n\t\t\t\tList<TypeSpec> types = null;\n\n\t\t\t\tbool post_process_using_aliases = false;\n\n\t\t\t\tfor (int i = 0; i < clauses.Count; ++i) {\n\t\t\t\t\tvar entry = clauses[i];\n\n\t\t\t\t\tif (entry.Alias != null) {\n\t\t\t\t\t\tif (aliases == null)\n\t\t\t\t\t\t\taliases = new Dictionary<string, UsingAliasNamespace> ();\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Aliases are not available when resolving using section\n\t\t\t\t\t\t// except extern aliases\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (entry is UsingExternAlias) {\n\t\t\t\t\t\t\tentry.Define (this);\n\t\t\t\t\t\t\tif (entry.ResolvedExpression != null)\n\t\t\t\t\t\t\t\taliases.Add (entry.Alias.Value, (UsingExternAlias) entry);\n\n\t\t\t\t\t\t\tclauses.RemoveAt (i--);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpost_process_using_aliases = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tentry.Define (this);\n\n\t\t\t\t\t//\n\t\t\t\t\t// It's needed for repl only, when using clause cannot be resolved don't hold it in\n\t\t\t\t\t// global list which is resolved for each evaluation\n\t\t\t\t\t//\n\t\t\t\t\tif (entry.ResolvedExpression == null) {\n\t\t\t\t\t\tclauses.RemoveAt (i--);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar using_ns = entry.ResolvedExpression as NamespaceExpression;\n\t\t\t\t\tif (using_ns == null) {\n\n\t\t\t\t\t\tvar type = ((TypeExpr)entry.ResolvedExpression).Type;\n\n\t\t\t\t\t\tif (types == null)\n\t\t\t\t\t\t\ttypes = new List<TypeSpec> ();\n\n\t\t\t\t\t\tif (types.Contains (type)) {\n\t\t\t\t\t\t\tWarning_DuplicateEntry (entry);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttypes.Add (type);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (namespaces == null)\n\t\t\t\t\t\t\tnamespaces = new List<Namespace> ();\n\n\t\t\t\t\t\tif (namespaces.Contains (using_ns.Namespace)) {\n\t\t\t\t\t\t\t// Ensure we don't report the warning multiple times in repl\n\t\t\t\t\t\t\tclauses.RemoveAt (i--);\n\n\t\t\t\t\t\t\tWarning_DuplicateEntry (entry);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnamespaces.Add (using_ns.Namespace);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnamespace_using_table = namespaces == null ? new Namespace [0] : namespaces.ToArray ();\n\t\t\t\tif (types != null)\n\t\t\t\t\ttypes_using_table = types.ToArray ();\n\n\t\t\t\tif (post_process_using_aliases) {\n\t\t\t\t\tfor (int i = 0; i < clauses.Count; ++i) {\n\t\t\t\t\t\tvar entry = clauses[i];\n\t\t\t\t\t\tif (entry.Alias != null) {\n\t\t\t\t\t\t\tentry.Define (this);\n\t\t\t\t\t\t\tif (entry.ResolvedExpression != null) {\n\t\t\t\t\t\t\t\taliases.Add (entry.Alias.Value, (UsingAliasNamespace) entry);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tclauses.RemoveAt (i--);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void EnableRedefinition ()\n\t\t{\n\t\t\tis_defined = false;\n\t\t\tnamespace_using_table = null;\n\t\t}\n\n\t\tinternal override void GenerateDocComment (DocumentationBuilder builder)\n\t\t{\n\t\t\tif (containers != null) {\n\t\t\t\tforeach (var tc in containers)\n\t\t\t\t\ttc.GenerateDocComment (builder);\n\t\t\t}\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn MemberName == null ? \"global::\" : base.GetSignatureForError ();\n\t\t}\n\n\t\tpublic override void RemoveContainer (TypeContainer cont)\n\t\t{\n\t\t\tbase.RemoveContainer (cont);\n\t\t\tNS.RemoveContainer (cont);\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (Module.IsClsComplianceRequired ()) {\n\t\t\t\tif (MemberName != null && MemberName.Name[0] == '_') {\n\t\t\t\t\tWarning_IdentifierNotCompliant ();\n\t\t\t\t}\n\n\t\t\t\tns.VerifyClsCompliance ();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tvoid Warning_DuplicateEntry (UsingNamespace entry)\n\t\t{\n\t\t\tCompiler.Report.Warning (105, 3, entry.Location,\n\t\t\t\t\"The using directive for `{0}' appeared previously in this namespace\",\n\t\t\t\tentry.ResolvedExpression.GetSignatureForError ());\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class UsingNamespace\n\t{\n\t\treadonly ATypeNameExpression expr;\n\t\treadonly Location loc;\n\t\tprotected FullNamedExpression resolved;\n\n\t\tpublic UsingNamespace (ATypeNameExpression expr, Location loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic virtual SimpleMemberName Alias {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic ATypeNameExpression NamespaceExpression\t{\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression ResolvedExpression {\n\t\t\tget {\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\treturn expr.GetSignatureForError ();\n\t\t}\n\n\t\tpublic virtual void Define (NamespaceContainer ctx)\n\t\t{\n\t\t\tresolved = expr.ResolveAsTypeOrNamespace (ctx, false);\n\t\t\tvar ns = resolved as NamespaceExpression;\n\t\t\tif (ns != null)\n\t\t\t\treturn;\n\n\t\t\tif (resolved != null) {\n\t\t\t\tvar compiler = ctx.Module.Compiler;\n\t\t\t\tvar type = resolved.Type;\n\t\t\t\tif (compiler.Settings.Version >= LanguageVersion.V_6) {\n\t\t\t\t\tif (!type.IsClass || !type.IsStatic) {\n\t\t\t\t\t\tcompiler.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\t\t\tcompiler.Report.Error (7007, Location,\n\t\t\t\t\t\t\t\"`{0}' is not a static class. A using namespace directive can only be applied to static classes or namespace\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcompiler.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\tcompiler.Report.Error (138, Location,\n\t\t\t\t\t\"`{0}' is a type not a namespace. A using namespace directive can only be applied to namespaces\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn resolved.ToString();\n\t\t}\n\t}\n\n\tpublic class UsingExternAlias : UsingAliasNamespace\n\t{\n\t\tpublic UsingExternAlias (SimpleMemberName alias, Location loc)\n\t\t\t: base (alias, null, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override void Define (NamespaceContainer ctx)\n\t\t{\n\t\t\tvar ns = ctx.Module.GetRootNamespace (Alias.Value);\n\t\t\tif (ns == null) {\n\t\t\t\tctx.Module.Compiler.Report.Error (430, Location,\n\t\t\t\t\t\"The extern alias `{0}' was not specified in -reference option\",\n\t\t\t\t\tAlias.Value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolved = new NamespaceExpression (ns, Location);\n\t\t}\n\t\t\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class UsingAliasNamespace : UsingNamespace\n\t{\n\t\treadonly SimpleMemberName alias;\n\n\t\tpublic struct AliasContext : IMemberContext\n\t\t{\n\t\t\treadonly NamespaceContainer ns;\n\n\t\t\tpublic AliasContext (NamespaceContainer ns)\n\t\t\t{\n\t\t\t\tthis.ns = ns;\n\t\t\t}\n\n\t\t\tpublic TypeSpec CurrentType {\n\t\t\t\tget {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic TypeParameters CurrentTypeParameters {\n\t\t\t\tget {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic MemberCore CurrentMemberDefinition {\n\t\t\t\tget {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsObsolete {\n\t\t\t\tget {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsUnsafe {\n\t\t\t\tget {\n\t\t\t\t\tthrow new NotImplementedException ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsStatic {\n\t\t\t\tget {\n\t\t\t\t\tthrow new NotImplementedException ();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic ModuleContainer Module {\n\t\t\t\tget {\n\t\t\t\t\treturn ns.Module;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic string GetSignatureForError ()\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\n\t\t\tpublic ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t\t{\n\t\t\t\tvar fne = ns.NS.LookupTypeOrNamespace (ns, name, arity, mode, loc);\n\t\t\t\tif (fne != null)\n\t\t\t\t\treturn fne;\n\n\t\t\t\t//\n\t\t\t\t// Only extern aliases are allowed in this context\n\t\t\t\t//\n\t\t\t\tfne = ns.LookupExternAlias (name);\n\t\t\t\tif (fne != null || ns.MemberName == null)\n\t\t\t\t\treturn fne;\n\n\t\t\t\tvar container_ns = ns.NS.Parent;\n\t\t\t\tvar mn = ns.MemberName.Left;\n\t\t\t\twhile (mn != null) {\n\t\t\t\t\tfne = container_ns.LookupTypeOrNamespace (this, name, arity, mode, loc);\n\t\t\t\t\tif (fne != null)\n\t\t\t\t\t\treturn fne;\n\n\t\t\t\t\tmn = mn.Left;\n\t\t\t\t\tcontainer_ns = container_ns.Parent;\n\t\t\t\t}\n\n\t\t\t\tif (ns.Parent != null)\n\t\t\t\t\treturn ns.Parent.LookupNamespaceOrType (name, arity, mode, loc);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic FullNamedExpression LookupNamespaceAlias (string name)\n\t\t\t{\n\t\t\t\treturn ns.LookupNamespaceAlias (name);\n\t\t\t}\n\t\t}\n\n\t\tpublic UsingAliasNamespace (SimpleMemberName alias, ATypeNameExpression expr, Location loc)\n\t\t\t: base (expr, loc)\n\t\t{\n\t\t\tthis.alias = alias;\n\t\t}\n\n\t\tpublic override SimpleMemberName Alias {\n\t\t\tget {\n\t\t\t\treturn alias;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Define (NamespaceContainer ctx)\n\t\t{\n\t\t\t//\n\t\t\t// The namespace-or-type-name of a using-alias-directive is resolved as if\n\t\t\t// the immediately containing compilation unit or namespace body had no\n\t\t\t// using-directives. A using-alias-directive may however be affected\n\t\t\t// by extern-alias-directives in the immediately containing compilation\n\t\t\t// unit or namespace body\n\t\t\t//\n\t\t\t// We achieve that by introducing alias-context which redirect any local\n\t\t\t// namespace or type resolve calls to parent namespace\n\t\t\t//\n\t\t\tresolved = NamespaceExpression.ResolveAsTypeOrNamespace (new AliasContext (ctx), false);\n\t\t}\n\t\t\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs",
    "content": "//\n// nullable.cs: Nullable types support\n//\n// Authors: Martin Baulig (martin@ximian.com)\n//          Miguel de Icaza (miguel@ximian.com)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing SLE = System.Linq.Expressions;\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\t\nnamespace Mono.CSharp.Nullable\n{\n\tpublic class NullableType : TypeExpr\n\t{\n\t\treadonly TypeSpec underlying;\n\n\t\tpublic NullableType (TypeSpec type, Location loc)\n\t\t{\n\t\t\tthis.underlying = type;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments = false)\n\t\t{\n\t\t\teclass = ExprClass.Type;\n\n\t\t\tvar otype = ec.Module.PredefinedTypes.Nullable.Resolve ();\n\t\t\tif (otype == null)\n\t\t\t\treturn null;\n\n\t\t\tTypeArguments args = new TypeArguments (new TypeExpression (underlying, loc));\n\t\t\tGenericTypeExpr ctype = new GenericTypeExpr (otype, args, loc);\n\t\t\t\n\t\t\ttype = ctype.ResolveAsType (ec);\n\t\t\treturn type;\n\t\t}\n\t}\n\n\tstatic class NullableInfo\n\t{\n\t\tpublic static MethodSpec GetConstructor (TypeSpec nullableType)\n\t\t{\n\t\t\treturn (MethodSpec) MemberCache.FindMember (nullableType,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (GetUnderlyingType (nullableType))), BindingRestriction.DeclaredOnly);\n\t\t}\n\n\t\tpublic static MethodSpec GetHasValue (TypeSpec nullableType)\n\t\t{\n\t\t\treturn (MethodSpec) MemberCache.FindMember (nullableType,\n\t\t\t\tMemberFilter.Method (\"get_HasValue\", 0, ParametersCompiled.EmptyReadOnlyParameters, null), BindingRestriction.None);\n\t\t}\n\n\t\tpublic static MethodSpec GetGetValueOrDefault (TypeSpec nullableType)\n\t\t{\n\t\t\treturn (MethodSpec) MemberCache.FindMember (nullableType,\n\t\t\t\tMemberFilter.Method (\"GetValueOrDefault\", 0, ParametersCompiled.EmptyReadOnlyParameters, null), BindingRestriction.None);\n\t\t}\n\n\t\t//\n\t\t// Don't use unless really required for correctness, see Unwrap::Emit\n\t\t//\n\t\tpublic static MethodSpec GetValue (TypeSpec nullableType)\n\t\t{\n\t\t\treturn (MethodSpec) MemberCache.FindMember (nullableType,\n\t\t\t\tMemberFilter.Method (\"get_Value\", 0, ParametersCompiled.EmptyReadOnlyParameters, null), BindingRestriction.None);\n\t\t}\n\n\t\tpublic static TypeSpec GetUnderlyingType (TypeSpec nullableType)\n\t\t{\n\t\t\treturn ((InflatedTypeSpec) nullableType).TypeArguments[0];\n\t\t}\n\n\t\tpublic static TypeSpec GetEnumUnderlyingType (ModuleContainer module, TypeSpec nullableEnum)\n\t\t{\n\t\t\treturn MakeType (module, EnumSpec.GetUnderlyingType (GetUnderlyingType (nullableEnum)));\n\t\t}\n\n\t\tpublic static TypeSpec MakeType (ModuleContainer module, TypeSpec underlyingType)\n\t\t{\n\t\t\treturn module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (module,\n\t\t\t\tnew[] { underlyingType });\n\n\t\t}\n\t}\n\n\tpublic class Unwrap : Expression, IMemoryLocation\n\t{\n\t\tExpression expr;\n\n\t\tLocalTemporary temp;\n\t\tExpression temp_field;\n\t\treadonly bool useDefaultValue;\n\n\t\tpublic Unwrap (Expression expr, bool useDefaultValue = true)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.loc = expr.Location;\n\t\t\tthis.useDefaultValue = useDefaultValue;\n\n\t\t\ttype = NullableInfo.GetUnderlyingType (expr.Type);\n\t\t\teclass = expr.eclass;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn expr.ContainsEmitWithAwait ();\n\t\t}\n\n\t\t// TODO: REMOVE\n\t\tpublic static Expression Create (Expression expr)\n\t\t{\n\t\t\t//\n\t\t\t// Avoid unwraping and wraping of same type\n\t\t\t//\n\t\t\tWrap wrap = expr as Wrap;\n\t\t\tif (wrap != null)\n\t\t\t\treturn wrap.Child;\n\n\t\t\treturn Create (expr, false);\n\t\t}\n\n\t\tpublic static Expression CreateUnwrapped (Expression expr)\n\t\t{\n\t\t\t//\n\t\t\t// Avoid unwraping and wraping of same type\n\t\t\t//\n\t\t\tWrap wrap = expr as Wrap;\n\t\t\tif (wrap != null)\n\t\t\t\treturn wrap.Child;\n\n\t\t\treturn Create (expr, true);\n\t\t}\n\n\t\tpublic static Unwrap Create (Expression expr, bool useDefaultValue)\n\t\t{\n\t\t\treturn new Unwrap (expr, useDefaultValue);\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn expr.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override Expression DoResolveLValue (ResolveContext ec, Expression right_side)\n\t\t{\n\t\t\texpr = expr.DoResolveLValue (ec, right_side);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tStore (ec);\n\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = this;\n\n\t\t\t//\n\t\t\t// Using GetGetValueOrDefault is prefered because JIT can possibly\n\t\t\t// inline it whereas Value property contains a throw which is very\n\t\t\t// unlikely to be inlined\n\t\t\t//\n\t\t\tif (useDefaultValue)\n\t\t\t\tcall.EmitPredefined (ec, NullableInfo.GetGetValueOrDefault (expr.Type), null);\n\t\t\telse\n\t\t\t\tcall.EmitPredefined (ec, NullableInfo.GetValue (expr.Type), null);\n\t\t}\n\n\t\tpublic void EmitCheck (EmitContext ec)\n\t\t{\n\t\t\tStore (ec);\n\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = this;\n\n\t\t\tcall.EmitPredefined (ec, NullableInfo.GetHasValue (expr.Type), null);\n\t\t}\n\n\t\tpublic override void EmitSideEffect (EmitContext ec)\n\t\t{\n\t\t\texpr.EmitSideEffect (ec);\n\t\t}\n\n\t\tpublic override Expression EmitToField (EmitContext ec)\n\t\t{\n\t\t\tif (temp_field == null)\n\t\t\t\ttemp_field = this.expr.EmitToField (ec);\n\t\t\t\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tUnwrap uw = obj as Unwrap;\n\t\t\treturn uw != null && expr.Equals (uw.expr);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic Expression Original {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn expr.GetHashCode ();\n\t\t}\n\n\t\tpublic override bool IsNull {\n\t\t\tget {\n\t\t\t\treturn expr.IsNull;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Store (EmitContext ec)\n\t\t{\n\t\t\tif (temp != null || temp_field != null)\n\t\t\t\treturn;\n\n\t\t\tif (expr is VariableReference)\n\t\t\t\treturn;\n\n\t\t\texpr.Emit (ec);\n\t\t\tLocalVariable.Store (ec);\n\t\t}\n\n\t\tpublic void Load (EmitContext ec)\n\t\t{\n\t\t\tif (temp_field != null)\n\t\t\t\ttemp_field.Emit (ec);\n\t\t\telse if (expr is VariableReference)\n\t\t\t\texpr.Emit (ec);\n\t\t\telse\n\t\t\t\tLocalVariable.Emit (ec);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn expr.MakeExpression (ctx);\n\t\t}\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tIMemoryLocation ml;\n\n\t\t\tif (temp_field != null) {\n\t\t\t\tml = temp_field as IMemoryLocation;\n\t\t\t\tif (ml == null) {\n\t\t\t\t\tvar lt = new LocalTemporary (temp_field.Type);\n\t\t\t\t\ttemp_field.Emit (ec);\n\t\t\t\t\tlt.Store (ec);\n\t\t\t\t\tml = lt;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tml = expr as VariableReference;\n\t\t\t}\n\n\t\t\tif (ml != null)\n\t\t\t\tml.AddressOf (ec, mode);\n\t\t\telse\n\t\t\t\tLocalVariable.AddressOf (ec, mode);\n\t\t}\n\n\t\t//\n\t\t// Keeps result of non-variable expression\n\t\t//\n\t\tLocalTemporary LocalVariable {\n\t\t\tget {\n\t\t\t\tif (temp == null && temp_field == null)\n\t\t\t\t\ttemp = new LocalTemporary (expr.Type);\n\t\t\t\treturn temp;\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Calls get_Value method on nullable expression\n\t//\n\tpublic class UnwrapCall : CompositeExpression\n\t{\n\t\tpublic UnwrapCall (Expression expr)\n\t\t\t: base (expr)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tbase.DoResolve (rc);\n\n\t\t\tif (type != null)\n\t\t\t\ttype = NullableInfo.GetUnderlyingType (type);\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = Child;\n\t\t\tcall.EmitPredefined (ec, NullableInfo.GetValue (Child.Type), null);\n\t\t}\n\t}\n\n\tpublic class Wrap : TypeCast\n\t{\n\t\tprivate Wrap (Expression expr, TypeSpec type)\n\t\t\t: base (expr, type)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tTypeCast child_cast = child as TypeCast;\n\t\t\tif (child_cast != null) {\n\t\t\t\tchild.Type = type;\n\t\t\t\treturn child_cast.CreateExpressionTree (ec);\n\t\t\t}\n\n\t\t\tvar user_cast = child as UserCast;\n\t\t\tif (user_cast != null) {\n\t\t\t\tchild.Type = type;\n\t\t\t\treturn user_cast.CreateExpressionTree (ec);\n\t\t\t}\n\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic static Expression Create (Expression expr, TypeSpec type)\n\t\t{\n\t\t\t//\n\t\t\t// Avoid unwraping and wraping of the same type\n\t\t\t//\n\t\t\tUnwrap unwrap = expr as Unwrap;\n\t\t\tif (unwrap != null && expr.Type == NullableInfo.GetUnderlyingType (type))\n\t\t\t\treturn unwrap.Original;\n\t\t\n\t\t\treturn new Wrap (expr, type);\n\t\t}\n\t\t\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tchild.Emit (ec);\n\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\t\t}\n\t}\n\n\t//\n\t// Represents null literal lifted to nullable type\n\t//\n\tpublic class LiftedNull : NullConstant, IMemoryLocation\n\t{\n\t\tprivate LiftedNull (TypeSpec nullable_type, Location loc)\n\t\t\t: base (nullable_type, loc)\n\t\t{\n\t\t\teclass = ExprClass.Value;\n\t\t}\n\n\t\tpublic static Constant Create (TypeSpec nullable, Location loc)\n\t\t{\n\t\t\treturn new LiftedNull (nullable, loc);\n\t\t}\n\n\t\tpublic static Constant CreateFromExpression (ResolveContext rc, Expression e)\n\t\t{\n\t\t\tif (!rc.HasSet (ResolveContext.Options.ExpressionTreeConversion)) {\n\t\t\t\trc.Report.Warning (458, 2, e.Location, \"The result of the expression is always `null' of type `{0}'\",\n\t\t\t\t\te.Type.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn ReducedExpression.Create (Create (e.Type, e.Location), e);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// TODO: generate less temporary variables\n\t\t\tLocalTemporary value_target = new LocalTemporary (type);\n\n\t\t\tvalue_target.AddressOf (ec, AddressOp.Store);\n\t\t\tec.Emit (OpCodes.Initobj, type);\n\t\t\tvalue_target.Emit (ec);\n\t\t\tvalue_target.Release (ec);\n\t\t}\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp Mode)\n\t\t{\n\t\t\tLocalTemporary value_target = new LocalTemporary (type);\n\t\t\t\t\n\t\t\tvalue_target.AddressOf (ec, AddressOp.Store);\n\t\t\tec.Emit (OpCodes.Initobj, type);\n\t\t\tvalue_target.AddressOf (ec, Mode);\n\t\t}\n\t}\n\n\t//\n\t// Generic lifting expression, supports all S/S? -> T/T? cases\n\t//\n\tpublic class LiftedConversion : Expression, IMemoryLocation\n\t{\n\t\tExpression expr, null_value;\n\t\tUnwrap unwrap;\n\n\t\tpublic LiftedConversion (Expression expr, Unwrap unwrap, TypeSpec type)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.unwrap = unwrap;\n\t\t\tthis.loc = expr.Location;\n\t\t\tthis.type = type;\n\t\t}\n\n\t\tpublic LiftedConversion (Expression expr, Expression unwrap, TypeSpec type)\n\t\t\t: this (expr, unwrap as Unwrap, type)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsNull {\n\t\t\tget {\n\t\t\t\treturn expr.IsNull;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn unwrap.ContainsEmitWithAwait ();\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\treturn expr.CreateExpressionTree (ec);\n\t\t}\t\t\t\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// It's null when lifting non-nullable type\n\t\t\t//\n\t\t\tif (unwrap == null) {\n\t\t\t\t// S -> T? is wrap only\n\t\t\t\tif (type.IsNullableType)\n\t\t\t\t\treturn Wrap.Create (expr, type);\n\n\t\t\t\t// S -> T can be simplified\n\t\t\t\treturn expr;\n\t\t\t}\n\n\t\t\t// Wrap target for T?\n\t\t\tif (type.IsNullableType) {\n\t\t\t\tif (!expr.Type.IsNullableType) {\n\t\t\t\t\texpr = Wrap.Create (expr, type);\n\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tnull_value = LiftedNull.Create (type, loc);\n\t\t\t} else if (TypeSpec.IsValueType (type)) {\n\t\t\t\tnull_value = LiftedNull.Create (type, loc);\n\t\t\t} else {\n\t\t\t\tnull_value = new NullConstant (type, loc);\n\t\t\t}\n\n\t\t\teclass = ExprClass.Value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLabel is_null_label = ec.DefineLabel ();\n\t\t\tLabel end_label = ec.DefineLabel ();\n\n\t\t\tunwrap.EmitCheck (ec);\n\t\t\tec.Emit (OpCodes.Brfalse, is_null_label);\n\n\t\t\texpr.Emit (ec);\n\n\t\t\tec.Emit (OpCodes.Br, end_label);\n\t\t\tec.MarkLabel (is_null_label);\n\n\t\t\tnull_value.Emit (ec);\n\n\t\t\tec.MarkLabel (end_label);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tunwrap.AddressOf (ec, mode);\n\t\t}\n\t}\n\n\tpublic class LiftedUnaryOperator : Unary, IMemoryLocation\n\t{\n\t\tUnwrap unwrap;\n\t\tExpression user_operator;\n\n\t\tpublic LiftedUnaryOperator (Unary.Operator op, Expression expr, Location loc)\n\t\t\t: base (op, expr, loc)\n\t\t{\n\t\t}\n\n\t\tpublic void AddressOf (EmitContext ec, AddressOp mode)\n\t\t{\n\t\t\tunwrap.AddressOf (ec, mode);\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (user_operator != null)\n\t\t\t\treturn user_operator.CreateExpressionTree (ec);\n\n\t\t\tif (Oper == Operator.UnaryPlus)\n\t\t\t\treturn Expr.CreateExpressionTree (ec);\n\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tunwrap = Unwrap.Create (Expr, false);\n\t\t\tif (unwrap == null)\n\t\t\t\treturn null;\n\n\t\t\tExpression res = base.ResolveOperator (ec, unwrap);\n\t\t\tif (res == null) {\n\t\t\t\tError_OperatorCannotBeApplied (ec, loc, OperName (Oper), Expr.Type);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (res != this) {\n\t\t\t\tif (user_operator == null)\n\t\t\t\t\treturn res;\n\t\t\t} else {\n\t\t\t\tres = Expr = LiftExpression (ec, Expr);\n\t\t\t}\n\n\t\t\tif (res == null)\n\t\t\t\treturn null;\n\n\t\t\teclass = ExprClass.Value;\n\t\t\ttype = res.Type;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLabel is_null_label = ec.DefineLabel ();\n\t\t\tLabel end_label = ec.DefineLabel ();\n\n\t\t\tunwrap.EmitCheck (ec);\n\t\t\tec.Emit (OpCodes.Brfalse, is_null_label);\n\n\t\t\tif (user_operator != null) {\n\t\t\t\tuser_operator.Emit (ec);\n\t\t\t} else {\n\t\t\t\tEmitOperator (ec, NullableInfo.GetUnderlyingType (type));\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\tec.MarkLabel (is_null_label);\n\t\t\tLiftedNull.Create (type, loc).Emit (ec);\n\n\t\t\tec.MarkLabel (end_label);\n\t\t}\n\n\t\tstatic Expression LiftExpression (ResolveContext ec, Expression expr)\n\t\t{\n\t\t\tvar lifted_type = new NullableType (expr.Type, expr.Location);\n\t\t\tif (lifted_type.ResolveAsType (ec) == null)\n\t\t\t\treturn null;\n\n\t\t\texpr.Type = lifted_type.Type;\n\t\t\treturn expr;\n\t\t}\n\n\t\tprotected override Expression ResolveEnumOperator (ResolveContext ec, Expression expr, TypeSpec[] predefined)\n\t\t{\n\t\t\texpr = base.ResolveEnumOperator (ec, expr, predefined);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\tExpr = LiftExpression (ec, Expr);\n\t\t\treturn LiftExpression (ec, expr);\n\t\t}\n\n\t\tprotected override Expression ResolveUserOperator (ResolveContext ec, Expression expr)\n\t\t{\n\t\t\texpr = base.ResolveUserOperator (ec, expr);\n\t\t\tif (expr == null)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// When a user operator is of non-nullable type\n\t\t\t//\n\t\t\tif (Expr is Unwrap) {\n\t\t\t\tuser_operator = LiftExpression (ec, expr);\n\t\t\t\treturn user_operator;\n\t\t\t}\n\n\t\t\treturn expr;\n\t\t}\n\t}\n\n\t//\n\t// Lifted version of binary operators\n\t//\n\tclass LiftedBinaryOperator : Expression\n\t{\n\t\tpublic LiftedBinaryOperator (Binary b)\n\t\t{\n\t\t\tthis.Binary = b;\n\t\t\tthis.loc = b.Location;\n\t\t}\n\n\t\tpublic Binary Binary { get; private set; }\n\n\t\tpublic Expression Left { get; set; }\n\n\t\tpublic Expression Right { get; set; }\n\n\t\tpublic Unwrap UnwrapLeft { get; set; }\n\n\t\tpublic Unwrap UnwrapRight { get; set; }\n\n\t\tpublic MethodSpec UserOperator { get; set; }\n\n\t\tbool IsBitwiseBoolean {\n\t\t\tget {\n\t\t\t\treturn (Binary.Oper == Binary.Operator.BitwiseAnd || Binary.Oper == Binary.Operator.BitwiseOr) &&\n\t\t\t\t((UnwrapLeft != null && UnwrapLeft.Type.BuiltinType == BuiltinTypeSpec.Type.Bool) ||\n\t\t\t\t (UnwrapRight != null && UnwrapRight.Type.BuiltinType == BuiltinTypeSpec.Type.Bool));\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\treturn Left.ContainsEmitWithAwait () || Right.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext rc)\n\t\t{\n\t\t\tif (UserOperator != null) {\n\t\t\t\tArguments args = new Arguments (2);\n\t\t\t\targs.Add (new Argument (Binary.Left));\n\t\t\t\targs.Add (new Argument (Binary.Right));\n\n\t\t\t\tvar method = new UserOperatorCall (UserOperator, args, Binary.CreateExpressionTree, loc);\n\t\t\t\treturn method.CreateExpressionTree (rc);\n\t\t\t}\n\n\t\t\treturn Binary.CreateExpressionTree (rc);\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t{\n\t\t\tif (rc.IsRuntimeBinder) {\n\t\t\t\tif (UnwrapLeft == null && !Left.Type.IsNullableType)\n\t\t\t\t\tLeft = LiftOperand (rc, Left);\n\n\t\t\t\tif (UnwrapRight == null && !Right.Type.IsNullableType)\n\t\t\t\t\tRight = LiftOperand (rc, Right);\n\t\t\t} else {\n\t\t\t\tif (UnwrapLeft == null && Left != null && Left.Type.IsNullableType) {\n\t\t\t\t\tLeft = Unwrap.CreateUnwrapped (Left);\n\t\t\t\t\tUnwrapLeft = Left as Unwrap;\n\t\t\t\t}\n\n\t\t\t\tif (UnwrapRight == null && Right != null && Right.Type.IsNullableType) {\n\t\t\t\t\tRight = Unwrap.CreateUnwrapped (Right);\n\t\t\t\t\tUnwrapRight = Right as Unwrap;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttype = Binary.Type;\n\t\t\teclass = Binary.eclass;\t\n\n\t\t\treturn this;\n\t\t}\n\n\t\tExpression LiftOperand (ResolveContext rc, Expression expr)\n\t\t{\n\t\t\tTypeSpec type;\n\t\t\tif (expr.IsNull) {\n\t\t\t\ttype = Left.IsNull ? Right.Type : Left.Type;\n\t\t\t} else {\n\t\t\t\ttype = expr.Type;\n\t\t\t}\n\n\t\t\tif (!type.IsNullableType)\n\t\t\t\ttype = NullableInfo.MakeType (rc.Module, type);\n\n\t\t\treturn Wrap.Create (expr, type);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (IsBitwiseBoolean && UserOperator == null) {\n\t\t\t\tEmitBitwiseBoolean (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ((Binary.Oper & Binary.Operator.EqualityMask) != 0) {\n\t\t\t\tEmitEquality (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tLabel is_null_label = ec.DefineLabel ();\n\t\t\tLabel end_label = ec.DefineLabel ();\n\n\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && Right.ContainsEmitWithAwait ()) {\n\t\t\t\tLeft = Left.EmitToField (ec);\n\t\t\t\tRight = Right.EmitToField (ec);\n\t\t\t}\n\n\t\t\tif (UnwrapLeft != null) {\n\t\t\t\tUnwrapLeft.EmitCheck (ec);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Don't emit HasValue check when left and right expressions are same\n\t\t\t//\n\t\t\tif (UnwrapRight != null && !Binary.Left.Equals (Binary.Right)) {\n\t\t\t\tUnwrapRight.EmitCheck (ec);\n\t\t\t\tif (UnwrapLeft != null) {\n\t\t\t\t\tec.Emit (OpCodes.And);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Brfalse, is_null_label);\n\n\t\t\tif (UserOperator != null) {\n\t\t\t\tvar args = new Arguments (2);\n\t\t\t\targs.Add (new Argument (Left));\n\t\t\t\targs.Add (new Argument (Right));\n\n\t\t\t\tvar call = new CallEmitter ();\n\t\t\t\tcall.EmitPredefined (ec, UserOperator, args);\n\t\t\t} else {\n\t\t\t\tBinary.EmitOperator (ec, Left, Right);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Wrap the result when the operator return type is nullable type\n\t\t\t//\n\t\t\tif (type.IsNullableType)\n\t\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\n\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\t\t\tec.MarkLabel (is_null_label);\n\n\t\t\tif ((Binary.Oper & Binary.Operator.ComparisonMask) != 0) {\n\t\t\t\tec.EmitInt (0);\n\t\t\t} else {\n\t\t\t\tLiftedNull.Create (type, loc).Emit (ec);\n\t\t\t}\n\n\t\t\tec.MarkLabel (end_label);\n\t\t}\n\n\t\tvoid EmitBitwiseBoolean (EmitContext ec)\n\t\t{\n\t\t\tLabel load_left = ec.DefineLabel ();\n\t\t\tLabel load_right = ec.DefineLabel ();\n\t\t\tLabel end_label = ec.DefineLabel ();\n\t\t\tLabel is_null_label = ec.DefineLabel ();\n\n\t\t\tbool or = Binary.Oper == Binary.Operator.BitwiseOr;\n\n\t\t\t//\n\t\t\t// Both operands are bool? types\n\t\t\t//\n\t\t\tif (UnwrapLeft != null && UnwrapRight != null) {\n\t\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && Binary.Right.ContainsEmitWithAwait ()) {\n\t\t\t\t\tLeft = Left.EmitToField (ec);\n\t\t\t\t\tRight = Right.EmitToField (ec);\n\t\t\t\t} else {\n\t\t\t\t\tUnwrapLeft.Store (ec);\n\t\t\t\t\tUnwrapRight.Store (ec);\n\t\t\t\t}\n\n\t\t\t\tLeft.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Brtrue_S, load_right);\n\n\t\t\t\tRight.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Brtrue_S, load_left);\n\n\t\t\t\tUnwrapLeft.EmitCheck (ec);\n\t\t\t\tec.Emit (OpCodes.Brfalse_S, load_right);\n\n\t\t\t\t// load left\n\t\t\t\tec.MarkLabel (load_left);\n\t\t\t\tif (or)\n\t\t\t\t\tUnwrapRight.Load (ec);\n\t\t\t\telse\n\t\t\t\t\tUnwrapLeft.Load (ec);\n\n\t\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\t\t// load right\n\t\t\t\tec.MarkLabel (load_right);\n\t\t\t\tif (or)\n\t\t\t\t\tUnwrapLeft.Load (ec);\n\t\t\t\telse\n\t\t\t\t\tUnwrapRight.Load (ec);\n\n\t\t\t\tec.MarkLabel (end_label);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Faster version when one operand is bool\n\t\t\t//\n\t\t\tif (UnwrapLeft == null) {\n\t\t\t\t//\n\t\t\t\t// (bool, bool?)\n\t\t\t\t//\n\t\t\t\t// Optimizes remaining (false & bool?), (true | bool?) which are not easy to handle\n\t\t\t\t// in binary expression reduction\n\t\t\t\t//\n\t\t\t\tvar c = Left as BoolConstant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\t// Keep evaluation order\n\t\t\t\t\tUnwrapRight.Store (ec);\n\n\t\t\t\t\tec.EmitInt (or ? 1 : 0);\n\t\t\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\t\t\t\t} else if (Left.IsNull) {\n\t\t\t\t\tUnwrapRight.Emit (ec);\n\t\t\t\t\tec.Emit (or ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, is_null_label);\n\n\t\t\t\t\tUnwrapRight.Load (ec);\n\t\t\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\t\t\tec.MarkLabel (is_null_label);\n\t\t\t\t\tLiftedNull.Create (type, loc).Emit (ec);\n\t\t\t\t} else {\n\t\t\t\t\tLeft.Emit (ec);\n\t\t\t\t\tec.Emit (or ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, load_right);\n\n\t\t\t\t\tec.EmitInt (or ? 1 : 0);\n\t\t\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\n\t\t\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\t\t\tec.MarkLabel (load_right);\n\t\t\t\t\tUnwrapRight.Original.Emit (ec);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// (bool?, bool)\n\t\t\t\t//\n\t\t\t\t// Keep left-right evaluation order\n\t\t\t\tUnwrapLeft.Store (ec);\n\n\t\t\t\t//\n\t\t\t\t// Optimizes remaining (bool? & false), (bool? | true) which are not easy to handle\n\t\t\t\t// in binary expression reduction\n\t\t\t\t//\n\t\t\t\tvar c = Right as BoolConstant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\tec.EmitInt (or ? 1 : 0);\n\t\t\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\t\t\t\t} else if (Right.IsNull) {\n\t\t\t\t\tUnwrapLeft.Emit (ec);\n\t\t\t\t\tec.Emit (or ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, is_null_label);\n\n\t\t\t\t\tUnwrapLeft.Load (ec);\n\t\t\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\t\t\tec.MarkLabel (is_null_label);\n\t\t\t\t\tLiftedNull.Create (type, loc).Emit (ec);\n\t\t\t\t} else {\n\t\t\t\t\tRight.Emit (ec);\n\t\t\t\t\tec.Emit (or ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, load_right);\n\n\t\t\t\t\tec.EmitInt (or ? 1 : 0);\n\t\t\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\n\t\t\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\t\t\tec.MarkLabel (load_right);\n\n\t\t\t\t\tUnwrapLeft.Load (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tec.MarkLabel (end_label);\n \t\t}\n\n\t\t//\n\t\t// Emits optimized equality or inequality operator when possible\n\t\t//\n\t\tvoid EmitEquality (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Either left or right is null\n\t\t\t// \n\t\t\tif (UnwrapLeft != null && Binary.Right.IsNull) { // TODO: Optimize for EmitBranchable\n\t\t\t\t//\n\t\t\t\t// left.HasValue == false \n\t\t\t\t//\n\t\t\t\tUnwrapLeft.EmitCheck (ec);\n\t\t\t\tif (Binary.Oper == Binary.Operator.Equality) {\n\t\t\t\t\tec.EmitInt (0);\n\t\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (UnwrapRight != null && Binary.Left.IsNull) {\n\t\t\t\t//\n\t\t\t\t// right.HasValue == false \n\t\t\t\t//\n\t\t\t\tUnwrapRight.EmitCheck (ec);\n\t\t\t\tif (Binary.Oper == Binary.Operator.Equality) {\n\t\t\t\t\tec.EmitInt (0);\n\t\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tLabel dissimilar_label = ec.DefineLabel ();\n\t\t\tLabel end_label = ec.DefineLabel ();\n\n\t\t\tif (UserOperator != null) {\n\t\t\t\tvar left = Left;\n\n\t\t\t\tif (UnwrapLeft != null) {\n\t\t\t\t\tUnwrapLeft.EmitCheck (ec);\n\t\t\t\t} else {\n\t\t\t\t\t// Keep evaluation order same\n\t\t\t\t\tif (!(Left is VariableReference)) {\n\t\t\t\t\t\tLeft.Emit (ec);\n\t\t\t\t\t\tvar lt = new LocalTemporary (Left.Type);\n\t\t\t\t\t\tlt.Store (ec);\n\t\t\t\t\t\tleft = lt;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (UnwrapRight != null) {\n\t\t\t\t\tUnwrapRight.EmitCheck (ec);\n\n\t\t\t\t\tif (UnwrapLeft != null) {\n\t\t\t\t\t\tec.Emit (OpCodes.Bne_Un, dissimilar_label);\n\n\t\t\t\t\t\tLabel compare_label = ec.DefineLabel ();\n\t\t\t\t\t\tUnwrapLeft.EmitCheck (ec);\n\t\t\t\t\t\tec.Emit (OpCodes.Brtrue, compare_label);\n\n\t\t\t\t\t\tif (Binary.Oper == Binary.Operator.Equality)\n\t\t\t\t\t\t\tec.EmitInt (1);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tec.EmitInt (0);\n\n\t\t\t\t\t\tec.Emit (OpCodes.Br, end_label);\n\n\t\t\t\t\t\tec.MarkLabel (compare_label);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tec.Emit (OpCodes.Brfalse, dissimilar_label);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tec.Emit (OpCodes.Brfalse, dissimilar_label);\n\t\t\t\t}\n\n\t\t\t\tvar args = new Arguments (2);\n\t\t\t\targs.Add (new Argument (left));\n\t\t\t\targs.Add (new Argument (Right));\n\n\t\t\t\tvar call = new CallEmitter ();\n\t\t\t\tcall.EmitPredefined (ec, UserOperator, args);\n\t\t\t} else {\n\t\t\t\tif (ec.HasSet (BuilderContext.Options.AsyncBody) && Binary.Right.ContainsEmitWithAwait ()) {\n\t\t\t\t\tLeft = Left.EmitToField (ec);\n\t\t\t\t\tRight = Right.EmitToField (ec);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Emit underlying value comparison first.\n\t\t\t\t//\n\t\t\t\t// For this code: int? a = 1; bool b = a == 1;\n\t\t\t\t//\n\t\t\t\t// We emit something similar to this. Expressions with side effects have local\n\t\t\t\t// variable created by Unwrap expression\n\t\t\t\t//\n\t\t\t\t//\tleft.GetValueOrDefault ()\n\t\t\t\t//\tright\n\t\t\t\t//\tbne.un.s   dissimilar_label\n\t\t\t\t//  left.HasValue\n\t\t\t\t//\tbr.s       end_label\n\t\t\t\t// dissimilar_label:\n\t\t\t\t//\tldc.i4.0\n\t\t\t\t// end_label:\n\t\t\t\t//\n\n\t\t\t\tLeft.Emit (ec);\n\t\t\t\tRight.Emit (ec);\n\n\t\t\t\tec.Emit (OpCodes.Bne_Un_S, dissimilar_label);\n\n\t\t\t\t//\n\t\t\t\t// Check both left and right expressions for Unwrap call in which\n\t\t\t\t// case we need to run get_HasValue() check because the type is\n\t\t\t\t// nullable and could have null value\n\t\t\t\t//\n\t\t\t\tif (UnwrapLeft != null)\n\t\t\t\t\tUnwrapLeft.EmitCheck (ec);\n\n\t\t\t\tif (UnwrapRight != null)\n\t\t\t\t\tUnwrapRight.EmitCheck (ec);\n\n\t\t\t\tif (UnwrapLeft != null && UnwrapRight != null) {\n\t\t\t\t\tif (Binary.Oper == Binary.Operator.Inequality)\n\t\t\t\t\t\tec.Emit (OpCodes.Xor);\n\t\t\t\t\telse\n\t\t\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\t} else {\n\t\t\t\t\tif (Binary.Oper == Binary.Operator.Inequality) {\n\t\t\t\t\t\tec.EmitInt (0);\n\t\t\t\t\t\tec.Emit (OpCodes.Ceq);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\tec.MarkLabel (dissimilar_label);\n\t\t\tif (Binary.Oper == Binary.Operator.Inequality)\n\t\t\t\tec.EmitInt (1);\n\t\t\telse\n\t\t\t\tec.EmitInt (0);\n\n\t\t\tec.MarkLabel (end_label);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tBinary.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override SLE.Expression MakeExpression (BuilderContext ctx)\n\t\t{\n\t\t\treturn Binary.MakeExpression (ctx, Left, Right);\n\t\t}\n\t}\n\n\tpublic class NullCoalescingOperator : Expression\n\t{\n\t\tExpression left, right;\n\t\tUnwrap unwrap;\n\n\t\tpublic NullCoalescingOperator (Expression left, Expression right)\n\t\t{\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\tthis.loc = left.Location;\n\t\t}\n\n\t\tpublic Expression LeftExpression {\n\t\t\tget {\n \t\t\t\treturn left;\n \t\t\t}\n\t\t}\n\n\t\tpublic Expression RightExpression {\n\t\t\tget {\n \t\t\t\treturn right;\n \t\t\t}\n\t\t}\n\t\t\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (left is NullLiteral)\n\t\t\t\tec.Report.Error (845, loc, \"An expression tree cannot contain a coalescing operator with null left side\");\n\n\t\t\tUserCast uc = left as UserCast;\n\t\t\tExpression conversion = null;\n\t\t\tif (uc != null) {\n\t\t\t\tleft = uc.Source;\n\n\t\t\t\tArguments c_args = new Arguments (2);\n\t\t\t\tc_args.Add (new Argument (uc.CreateExpressionTree (ec)));\n\t\t\t\tc_args.Add (new Argument (left.CreateExpressionTree (ec)));\n\t\t\t\tconversion = CreateExpressionFactoryCall (ec, \"Lambda\", c_args);\n\t\t\t}\n\n\t\t\tArguments args = new Arguments (3);\n\t\t\targs.Add (new Argument (left.CreateExpressionTree (ec)));\n\t\t\targs.Add (new Argument (right.CreateExpressionTree (ec)));\n\t\t\tif (conversion != null)\n\t\t\t\targs.Add (new Argument (conversion));\n\t\t\t\n\t\t\treturn CreateExpressionFactoryCall (ec, \"Coalesce\", args);\n\t\t}\n\n\t\tExpression ConvertExpression (ResolveContext ec)\n\t\t{\n\t\t\t// TODO: ImplicitConversionExists should take care of this\n\t\t\tif (left.eclass == ExprClass.MethodGroup)\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec ltype = left.Type;\n\n\t\t\t//\n\t\t\t// If left is a nullable type and an implicit conversion exists from right to underlying type of left,\n\t\t\t// the result is underlying type of left\n\t\t\t//\n\t\t\tif (ltype.IsNullableType) {\n\t\t\t\tunwrap = Unwrap.Create (left, false);\n\t\t\t\tif (unwrap == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\t//\n\t\t\t\t// Reduce (left ?? null) to left\n\t\t\t\t//\n\t\t\t\tif (right.IsNull)\n\t\t\t\t\treturn ReducedExpression.Create (left, this);\n\n\t\t\t\tExpression conv;\n\t\t\t\tif (right.Type.IsNullableType) {\n\t\t\t\t\tconv = right.Type == ltype ? right : Convert.ImplicitNulableConversion (ec, right, ltype);\n\t\t\t\t\tif (conv != null) {\n\t\t\t\t\t\tright = conv;\n\t\t\t\t\t\ttype = ltype;\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconv = Convert.ImplicitConversion (ec, right, unwrap.Type, loc);\n\t\t\t\t\tif (conv != null) {\n\t\t\t\t\t\tleft = unwrap;\n\t\t\t\t\t\tltype = left.Type;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// If right is a dynamic expression, the result type is dynamic\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (right.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\t\t\ttype = right.Type;\n\n\t\t\t\t\t\t\t// Need to box underlying value type\n\t\t\t\t\t\t\tleft = Convert.ImplicitBoxingConversion (left, ltype, type);\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tright = conv;\n\t\t\t\t\t\ttype = ltype;\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (TypeSpec.IsReferenceType (ltype)) {\n\t\t\t\tif (Convert.ImplicitConversionExists (ec, right, ltype)) {\n\t\t\t\t\t//\n\t\t\t\t\t// If right is a dynamic expression, the result type is dynamic\n\t\t\t\t\t//\n\t\t\t\t\tif (right.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\t\ttype = right.Type;\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Reduce (\"foo\" ?? expr) to expression\n\t\t\t\t\t//\n\t\t\t\t\tConstant lc = left as Constant;\n\t\t\t\t\tif (lc != null && !lc.IsDefaultValue)\n\t\t\t\t\t\treturn ReducedExpression.Create (lc, this, false);\n\n\t\t\t\t\t//\n\t\t\t\t\t// Reduce (left ?? null) to left OR (null-constant ?? right) to right\n\t\t\t\t\t//\n\t\t\t\t\tif (right.IsNull || lc != null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Special case null ?? null\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (right.IsNull && ltype == right.Type)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\treturn ReducedExpression.Create (lc != null ? right : left, this, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tright = Convert.ImplicitConversion (ec, right, ltype, loc);\n\t\t\t\t\ttype = ltype;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tTypeSpec rtype = right.Type;\n\t\t\tif (!Convert.ImplicitConversionExists (ec, unwrap ?? left, rtype) || right.eclass == ExprClass.MethodGroup)\n\t\t\t\treturn null;\n\n\t\t\t//\n\t\t\t// Reduce (null ?? right) to right\n\t\t\t//\n\t\t\tif (left.IsNull)\n\t\t\t\treturn ReducedExpression.Create (right, this, false).Resolve (ec);\n\n\t\t\tleft = Convert.ImplicitConversion (ec, unwrap ?? left, rtype, loc);\n\n\t\t\tif (TypeSpec.IsValueType (left.Type) && !left.Type.IsNullableType) {\n\t\t\t\tWarning_UnreachableExpression (ec, right.Location);\n\t\t\t\treturn ReducedExpression.Create (left, this, false).Resolve (ec);\n\t\t\t}\n\n\t\t\ttype = rtype;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t{\n\t\t\tif (unwrap != null)\n\t\t\t\treturn unwrap.ContainsEmitWithAwait () || right.ContainsEmitWithAwait ();\n\n\t\t\treturn left.ContainsEmitWithAwait () || right.ContainsEmitWithAwait ();\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tleft = left.Resolve (ec);\n\t\t\tright = right.Resolve (ec);\n\n\t\t\tif (left == null || right == null)\n\t\t\t\treturn null;\n\n\t\t\teclass = ExprClass.Value;\n\n\t\t\tExpression e = ConvertExpression (ec);\n\t\t\tif (e == null) {\n\t\t\t\tBinary.Error_OperatorCannotBeApplied (ec, left, right, \"??\", loc);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn e;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tLabel end_label = ec.DefineLabel ();\n\n\t\t\tif (unwrap != null) {\n\t\t\t\tLabel is_null_label = ec.DefineLabel ();\n\n\t\t\t\tunwrap.EmitCheck (ec);\n\t\t\t\tec.Emit (OpCodes.Brfalse, is_null_label);\n\n\t\t\t\t//\n\t\t\t\t// When both expressions are nullable the unwrap\n\t\t\t\t// is needed only for null check not for value uwrap\n\t\t\t\t//\n\t\t\t\tif (type.IsNullableType && TypeSpecComparer.IsEqual (NullableInfo.GetUnderlyingType (type), unwrap.Type))\n\t\t\t\t\tunwrap.Load (ec);\n\t\t\t\telse\n\t\t\t\t\tleft.Emit (ec);\n\n\t\t\t\tec.Emit (OpCodes.Br, end_label);\n\n\t\t\t\tec.MarkLabel (is_null_label);\n\t\t\t\tright.Emit (ec);\n\n\t\t\t\tec.MarkLabel (end_label);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tleft.Emit (ec);\n\t\t\tec.Emit (OpCodes.Dup);\n\n\t\t\t// Only to make verifier happy\n\t\t\tif (left.Type.IsGenericParameter)\n\t\t\t\tec.Emit (OpCodes.Box, left.Type);\n\n\t\t\tec.Emit (OpCodes.Brtrue, end_label);\n\n\t\t\tec.Emit (OpCodes.Pop);\n\t\t\tright.Emit (ec);\n\n\t\t\tec.MarkLabel (end_label);\n\t\t}\n\n\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tleft.FlowAnalysis (fc);\n\t\t\tvar left_da = fc.BranchDefiniteAssignment ();\n\t\t\tright.FlowAnalysis (fc);\n\t\t\tfc.DefiniteAssignment = left_da;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Expression t)\n\t\t{\n\t\t\tNullCoalescingOperator target = (NullCoalescingOperator) t;\n\n\t\t\ttarget.left = left.Clone (clonectx);\n\t\t\ttarget.right = right.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tclass LiftedUnaryMutator : UnaryMutator\n\t{\n\t\tpublic LiftedUnaryMutator (Mode mode, Expression expr, Location loc)\n\t\t\t: base (mode, expr, loc)\n\t\t{\n\t\t}\n\n\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t{\n\t\t\tvar orig_expr = expr;\n\n\t\t\texpr = Unwrap.Create (expr);\n\n\t\t\tvar res = base.DoResolveOperation (ec);\n\n\t\t\texpr = orig_expr;\n\t\t\ttype = expr.Type;\n\n\t\t\treturn res;\n\t\t}\n\n\t\tprotected override void EmitOperation (EmitContext ec)\n\t\t{\n\t\t\tLabel is_null_label = ec.DefineLabel ();\n\t\t\tLabel end_label = ec.DefineLabel ();\n\n\t\t\tLocalTemporary lt = new LocalTemporary (type);\n\n\t\t\t// Value is on the stack\n\t\t\tlt.Store (ec);\n\n\t\t\tvar call = new CallEmitter ();\n\t\t\tcall.InstanceExpression = lt;\n\t\t\tcall.EmitPredefined (ec, NullableInfo.GetHasValue (expr.Type), null);\n\n\t\t\tec.Emit (OpCodes.Brfalse, is_null_label);\n\n\t\t\tcall = new CallEmitter ();\n\t\t\tcall.InstanceExpression = lt;\n\t\t\tcall.EmitPredefined (ec, NullableInfo.GetGetValueOrDefault (expr.Type), null);\n\n\t\t\tlt.Release (ec);\n\n\t\t\tbase.EmitOperation (ec);\n\n\t\t\tec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type));\n\t\t\tec.Emit (OpCodes.Br_S, end_label);\n\n\t\t\tec.MarkLabel (is_null_label);\n\t\t\tLiftedNull.Create (type, loc).Emit (ec);\n\n\t\t\tec.MarkLabel (end_label);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/outline.cs",
    "content": "//\n// outline -- support for rendering in monop\n// Some code stolen from updater.cs in monodoc.\n//\n// Authors:\n//\tBen Maurer (bmaurer@users.sourceforge.net)\n//\n// (C) 2004 Ben Maurer\n//\n\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing System.Reflection;\nusing System.Collections;\nusing System.CodeDom.Compiler;\nusing System.IO;\nusing System.Text;\n\nnamespace Mono.CSharp {\npublic class Outline {\n\n\tbool declared_only;\n\tbool show_private;\n\tbool filter_obsolete;\n\t\n\tIndentedTextWriter o;\n\tType t;\n\t\n\tpublic Outline (Type t, TextWriter output, bool declared_only, bool show_private, bool filter_obsolete)\n\t{\n\t\tthis.t = t;\n\t\tthis.o = new IndentedTextWriter (output, \"\\t\");\n\t\tthis.declared_only = declared_only;\n\t\tthis.show_private = show_private;\n\t\tthis.filter_obsolete = filter_obsolete;\n\t}\n\n\tpublic void OutlineType ()\n        {\n\t\tbool first;\n\t\t\n\t\tOutlineAttributes ();\n\t\to.Write (GetTypeVisibility (t));\n\t\t\n\t\tif (t.IsClass && !t.IsSubclassOf (typeof (System.MulticastDelegate))) {\n\t\t\tif (t.IsSealed)\n\t\t\t\to.Write (t.IsAbstract ? \" static\" : \" sealed\");\n\t\t\telse if (t.IsAbstract)\n\t\t\t\to.Write (\" abstract\");\n\t\t}\n\t\t\n\t\to.Write (\" \");\n\t\to.Write (GetTypeKind (t));\n\t\to.Write (\" \");\n\t\t\n\t\tType [] interfaces = (Type []) Comparer.Sort (TypeGetInterfaces (t, declared_only));\n\t\tType parent = t.BaseType;\n\n\t\tif (t.IsSubclassOf (typeof (System.MulticastDelegate))) {\n\t\t\tMethodInfo method;\n\n\t\t\tmethod = t.GetMethod (\"Invoke\");\n\n\t\t\to.Write (FormatType (method.ReturnType));\n\t\t\to.Write (\" \");\n\t\t\to.Write (GetTypeName (t));\n\t\t\to.Write (\" (\");\n\t\t\tOutlineParams (method.GetParameters ());\n\t\t\to.Write (\")\");\n\n#if NET_2_0\n\t\t\tWriteGenericConstraints (t.GetGenericArguments ());\n#endif\t\t\t\n\t\n\t\t\to.WriteLine (\";\"); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\to.Write (GetTypeName (t));\n\t\tif (((parent != null && parent != typeof (object) && parent != typeof (ValueType)) || interfaces.Length != 0) && ! t.IsEnum) {\n\t\t\tfirst = true;\n\t\t\to.Write (\" : \");\n\t\t\t\n\t\t\tif (parent != null && parent != typeof (object) && parent != typeof (ValueType)) {\n\t\t\t\to.Write (FormatType (parent));\n\t\t\t\tfirst = false;\n\t\t\t}\n\t\t\t\n\t\t\tforeach (Type intf in interfaces) {\n\t\t\t\tif (!first) o.Write (\", \");\n\t\t\t\tfirst = false;\n\t\t\t\t\n\t\t\t\to.Write (FormatType (intf));\n\t\t\t}\n\t\t}\n\n\t\tif (t.IsEnum) {\n\t\t\tType underlyingType = System.Enum.GetUnderlyingType (t);\n\t\t\tif (underlyingType != typeof (int))\n\t\t\t\to.Write (\" : {0}\", FormatType (underlyingType));\n\t\t}\n#if NET_2_0\n\t\tWriteGenericConstraints (t.GetGenericArguments ());\n#endif\t\t\n\t\to.WriteLine (\" {\");\n\t\to.Indent++;\n\n\t\tif (t.IsEnum) {\n\t\t\tbool is_first = true;\n\t\t\tforeach (FieldInfo fi in t.GetFields (BindingFlags.Public | BindingFlags.Static)) {\n\t\t\t\t\n\t\t\t\tif (! is_first)\n\t\t\t\t\to.WriteLine (\",\");\n\t\t\t\tis_first = false;\n\t\t\t\to.Write (fi.Name);\n\t\t\t}\n\t\t\to.WriteLine ();\n\t\t\to.Indent--; o.WriteLine (\"}\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfirst = true;\n\t\t\n\t\tforeach (ConstructorInfo ci in t.GetConstructors (DefaultFlags)) {\n\t\t\tif (! ShowMember (ci))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif (first)\n\t\t\t\to.WriteLine ();\n\t\t\tfirst = false;\n\t\t\t\n\t\t\tOutlineMemberAttribute (ci);\n\t\t\tOutlineConstructor (ci);\n\t\t\t\n\t\t\to.WriteLine ();\n\t\t}\n\t\t\n\n\t\tfirst = true;\n\t\t\n\t\tforeach (MethodInfo m in Comparer.Sort (t.GetMethods (DefaultFlags))) {\n\t\t\t\n\t\t\tif (! ShowMember (m))\n\t\t\t\tcontinue;\t\t\n\t\t\t\n\t\t\tif ((m.Attributes & MethodAttributes.SpecialName) != 0)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif (first)\n\t\t\t\to.WriteLine ();\n\t\t\tfirst = false;\n\n\t\t\tOutlineMemberAttribute (m);\n\t\t\tOutlineMethod (m);\n\t\t\t\n\t\t\to.WriteLine ();\n\t\t}\n\t\t\n\t\tfirst = true;\n\t\t\n\t\tforeach (MethodInfo m in t.GetMethods (DefaultFlags)) {\n\t\t\t\n\t\t\tif (! ShowMember (m))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif ((m.Attributes & MethodAttributes.SpecialName) == 0)\n\t\t\t\tcontinue;\n\t\t\tif (!(m.Name.StartsWith (\"op_\")))\n\t\t\t\tcontinue;\n\n\t\t\tif (first)\n\t\t\t\to.WriteLine ();\n\t\t\tfirst = false;\n\t\t\t\n\t\t\tOutlineMemberAttribute (m);\n\t\t\tOutlineOperator (m);\n\t\t\t\n\t\t\to.WriteLine ();\n\t\t}\n\n\t\tfirst = true;\n\t\t\n\t\tforeach (PropertyInfo pi in Comparer.Sort (t.GetProperties (DefaultFlags))) {\n\t\t\t\n\t\t\tif (! ((pi.CanRead  && ShowMember (pi.GetGetMethod (true))) ||\n\t\t\t       (pi.CanWrite && ShowMember (pi.GetSetMethod (true)))))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif (first)\n\t\t\t\to.WriteLine ();\n\t\t\tfirst = false;\n\t\t\t\n\t\t\tOutlineMemberAttribute (pi);\n\t\t\tOutlineProperty (pi);\n\t\t\t\n\t\t\to.WriteLine ();\n\t\t}\n\t\t\n\t\tfirst = true;\n\n\t\tforeach (FieldInfo fi in t.GetFields (DefaultFlags)) {\n\t\t\t\n\t\t\tif (! ShowMember (fi))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif (first)\n\t\t\t\to.WriteLine ();\n\t\t\tfirst = false;\n\t\t\t\n\t\t\tOutlineMemberAttribute (fi);\n\t\t\tOutlineField (fi);\n\t\t\t\n\t\t\to.WriteLine ();\n\t\t}\n\n\t\tfirst = true;\n\t\t\n\t\tforeach (EventInfo ei in Comparer.Sort (t.GetEvents (DefaultFlags))) {\n\t\t\t\n\t\t\tif (! ShowMember (ei.GetAddMethod (true)))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif (first)\n\t\t\t\to.WriteLine ();\n\t\t\tfirst = false;\n\t\t\t\n\t\t\tOutlineMemberAttribute (ei);\n\t\t\tOutlineEvent (ei);\n\t\t\t\n\t\t\to.WriteLine ();\n\t\t}\n\n\t\tfirst = true;\n\n\t\tforeach (Type ntype in Comparer.Sort (t.GetNestedTypes (DefaultFlags))) {\n\t\t\t\n\t\t\tif (! ShowMember (ntype))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif (first)\n\t\t\t\to.WriteLine ();\n\t\t\tfirst = false;\n\t\t\t\n\t\t\tnew Outline (ntype, o, declared_only, show_private, filter_obsolete).OutlineType ();\n\t\t}\n\t\t\n\t\to.Indent--; o.WriteLine (\"}\");\n\t}\n\t\n\tBindingFlags DefaultFlags {\n\t\tget {\n\t\t\tBindingFlags f = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;\n\t\t\t\n\t\t\tif (declared_only)\n\t\t\t\tf |= BindingFlags.DeclaredOnly;\n\t\t\t\n\t\t\treturn f;\n\t\t}\n\t}\n\n\t// FIXME: add other interesting attributes?\n\tvoid OutlineAttributes ()\n\t{\n\t\tif (t.IsSerializable)\n\t\t\to.WriteLine (\"[Serializable]\");\n\n\t\tif (t.IsDefined (typeof (System.FlagsAttribute), true))\n\t\t\to.WriteLine (\"[Flags]\");\n\n\t\tif (t.IsDefined (typeof (System.ObsoleteAttribute), true))\n\t\t\to.WriteLine (\"[Obsolete]\");\n\t}\n\n\tvoid OutlineMemberAttribute (MemberInfo mi)\n\t{\n\t\tif (!mi.IsDefined (typeof (System.ObsoleteAttribute), false))\n\t\t\treturn;\n\t\tvar oa = mi.GetCustomAttributes (typeof (System.ObsoleteAttribute), false) [0] as ObsoleteAttribute;\n\t\tvar msg = oa.Message;\n\t\to.WriteLine (\"[Obsolete{0}]\", msg == null || msg == \"\" ? \"\" : string.Format (\"(\\\"{0}\\\")\", msg));\n\t}\n\t\n\tvoid OutlineEvent (EventInfo ei)\n\t{\n\t\tMethodBase accessor = ei.GetAddMethod (true);\n\t\t\n\t\to.Write (GetMethodVisibility (accessor));\n\t\to.Write (\"event \");\n\t\to.Write (FormatType (ei.EventHandlerType));\n\t\to.Write (\" \");\n\t\to.Write (ei.Name);\n\t\to.Write (\";\");\n\t}\n\t\n\tvoid OutlineConstructor (ConstructorInfo ci)\n\t{\n\t\to.Write (GetMethodVisibility (ci));\n\t\to.Write (RemoveGenericArity (t.Name));\n\t\to.Write (\" (\");\n\t\tOutlineParams (ci.GetParameters ());\n\t\to.Write (\");\");\n\t}\n\t\n\t\n\tvoid OutlineProperty (PropertyInfo pi)\n\t{\n\t\tParameterInfo [] idxp = pi.GetIndexParameters ();\n\t\tMethodBase g = pi.GetGetMethod (true);\n\t\tMethodBase s = pi.GetSetMethod (true);\n\t\tMethodBase accessor = g != null ? g : s;\n\t\t\n\t\tif (pi.CanRead && pi.CanWrite) {\n\n\t\t\t\n\t\t\t// Get the more accessible accessor\n\t\t\tif ((g.Attributes & MethodAttributes.MemberAccessMask) !=\n\t\t\t    (s.Attributes & MethodAttributes.MemberAccessMask)) {\n\t\t\t\t\n\t\t\t\tif (g.IsPublic) accessor = g;\n\t\t\t\telse if (s.IsPublic) accessor = s;\n\t\t\t\telse if (g.IsFamilyOrAssembly) accessor = g;\n\t\t\t\telse if (s.IsFamilyOrAssembly) accessor = s;\n\t\t\t\telse if (g.IsAssembly || g.IsFamily) accessor = g;\n\t\t\t\telse if (s.IsAssembly || s.IsFamily) accessor = s;\n\t\t\t}\n\t\t}\n\t\t\n\t\to.Write (GetMethodVisibility (accessor));\n\t\to.Write (GetMethodModifiers  (accessor));\n\t\to.Write (FormatType (pi.PropertyType));\n\t\to.Write (\" \");\n\t\t\n\t\tif (idxp.Length == 0)\n\t\t\to.Write (pi.Name);\n\t\telse {\n\t\t\to.Write (\"this [\");\n\t\t\tOutlineParams (idxp);\n\t\t\to.Write (\"]\");\n\t\t}\n\t\t\n\t\to.WriteLine (\" {\");\n\t\to.Indent ++;\n\t\t\n\t\tif (g != null && ShowMember (g)) {\n\t\t\tif ((g.Attributes & MethodAttributes.MemberAccessMask) !=\n\t\t\t    (accessor.Attributes & MethodAttributes.MemberAccessMask))\n\t\t\t\to.Write (GetMethodVisibility (g));\n\t\t\to.WriteLine (\"get;\");\n\t\t}\n\t\t\n\t\tif (s != null && ShowMember (s)) {\n\t\t\tif ((s.Attributes & MethodAttributes.MemberAccessMask) !=\n\t\t\t    (accessor.Attributes & MethodAttributes.MemberAccessMask))\n\t\t\t\to.Write (GetMethodVisibility (s));\n\t\t\to.WriteLine (\"set;\");\n\t\t}\n\t\t\n\t\to.Indent --;\n\t\to.Write (\"}\");\n\t}\n\t\n\tvoid OutlineMethod (MethodInfo mi)\n\t{\n\t\tif (MethodIsExplicitIfaceImpl (mi)) {\n\t\t\to.Write (FormatType (mi.ReturnType));\n\t\t\to.Write (\" \");\n\t\t\t// MSFT has no way to get the method that we are overriding\n\t\t\t// from the interface. this would allow us to pretty print\n\t\t\t// the type name (and be more correct if there compiler\n\t\t\t// were to do some strange naming thing).\n\t\t} else {\n\t\t\to.Write (GetMethodVisibility (mi));\n\t\t\to.Write (GetMethodModifiers  (mi));\n\t\t\to.Write (FormatType (mi.ReturnType));\n\t\t\to.Write (\" \");\n\t\t}\n\n\t\to.Write (mi.Name);\n#if NET_2_0\n\t\to.Write (FormatGenericParams (mi.GetGenericArguments ()));\n#endif\n\t\to.Write (\" (\");\n\t\tOutlineParams (mi.GetParameters ());\n\t\to.Write (\")\");\n#if NET_2_0\n\t\tWriteGenericConstraints (mi.GetGenericArguments ());\n#endif\n\t\to.Write (\";\");\n\t}\n\t\n\tvoid OutlineOperator (MethodInfo mi)\n\t{\n\t\to.Write (GetMethodVisibility (mi));\n\t\to.Write (GetMethodModifiers  (mi));\n\t\tif (mi.Name == \"op_Explicit\" || mi.Name == \"op_Implicit\") {\n\t\t\to.Write (mi.Name.Substring (3).ToLower ());\n\t\t\to.Write (\" operator \");\n\t\t\to.Write (FormatType (mi.ReturnType));\n\t\t} else {\n\t\t\to.Write (FormatType (mi.ReturnType));\n\t\t\to.Write (\" operator \");\n\t\t\to.Write (OperatorFromName (mi.Name));\n\t\t}\n\t\to.Write (\" (\");\n\t\tOutlineParams (mi.GetParameters ());\n\t\to.Write (\");\");\n\t}\n\t\n\tvoid OutlineParams (ParameterInfo [] pi)\n\t{\n\t\tint i = 0;\n\t\tforeach (ParameterInfo p in pi) {\n\t\t\tif (p.ParameterType.IsByRef) {\n\t\t\t\to.Write (p.IsOut ? \"out \" : \"ref \");\n\t\t\t\to.Write (FormatType (p.ParameterType.GetElementType ()));\n\t\t\t} else if (p.IsDefined (typeof (ParamArrayAttribute), false)) {\n\t\t\t\to.Write (\"params \");\n\t\t\t\to.Write (FormatType (p.ParameterType));\n\t\t\t} else {\n\t\t\t\to.Write (FormatType (p.ParameterType));\n\t\t\t}\n\t\t\t\n\t\t\to.Write (\" \");\n\t\t\to.Write (p.Name);\n\t\t\tif (i + 1 < pi.Length)\n\t\t\t\to.Write (\", \");\n\t\t\ti++;\n\t\t}\n\t}\n\n\tvoid OutlineField (FieldInfo fi)\n\t{\n\t\tif (fi.IsPublic)   o.Write (\"public \");\n\t\tif (fi.IsFamily)   o.Write (\"protected \");\n\t\tif (fi.IsPrivate)  o.Write (\"private \");\n\t\tif (fi.IsAssembly) o.Write (\"internal \");\n\t\tif (fi.IsLiteral)  o.Write (\"const \");\n\t\telse if (fi.IsStatic) o.Write (\"static \");\n\t\tif (fi.IsInitOnly) o.Write (\"readonly \");\n\n\t\to.Write (FormatType (fi.FieldType));\n\t\to.Write (\" \");\n\t\to.Write (fi.Name);\n\t\tif (fi.IsLiteral) { \n\t\t\tobject v = fi.GetValue (this);\n\n\t\t\t// TODO: Escape values here\n\t\t\to.Write (\" = \");\n\t\t\tif (v is char)\n\t\t\t\to.Write (\"'{0}'\", v);\n\t\t\telse if (v is string)\n\t\t\t\to.Write (\"\\\"{0}\\\"\", v);\n\t\t\telse\n\t\t\t\to.Write (fi.GetValue (this));\n\t\t}\n\t\to.Write (\";\");\n\t}\n\n\tstatic string GetMethodVisibility (MethodBase m)\n\t{\n\t\t// itnerfaces have no modifiers here\n\t\tif (m.DeclaringType.IsInterface)\n\t\t\treturn \"\";\n\t\t\n\t\tif (m.IsPublic)   return \"public \";\n\t\tif (m.IsFamily)   return \"protected \";\n\t\tif (m.IsPrivate)  return \"private \";\n\t\tif (m.IsAssembly) return \"internal \";\n\t\t\t\n\t\treturn null;\n\t}\n\t\n\tstatic string GetMethodModifiers (MethodBase method)\n\t{\n\t\tif (method.IsStatic)\n\t\t\treturn \"static \";\n\n\t\tif (method.IsFinal) {\n\t\t\t// This will happen if you have\n\t\t\t// class X : IA {\n\t\t\t//   public void A () {}\n\t\t\t//   static void Main () {}\n\t\t\t// }\n\t\t\t// interface IA {\n\t\t\t//   void A ();\n\t\t\t// }\n\t\t\t//\n\t\t\t// A needs to be virtual (the CLR requires\n\t\t\t// methods implementing an iface be virtual),\n\t\t\t// but can not be inherited. It also can not\n\t\t\t// be inherited. In C# this is represented\n\t\t\t// with no special modifiers\n\n\t\t\tif (method.IsVirtual)\n\t\t\t\treturn null;\n\t\t\treturn \"sealed \";\n\t\t}\n\t\t\n\t\t// all interface methods are \"virtual\" but we don't say that in c#\n\t\tif (method.IsVirtual && !method.DeclaringType.IsInterface) {\n\t\t\tif (method.IsAbstract)\n\t\t\t\treturn \"abstract \";\n\n\t\t\treturn ((method.Attributes & MethodAttributes.NewSlot) != 0) ?\n\t\t\t\t\"virtual \" :\n\t\t\t\t\"override \";\t\n\t\t}\n\t\t\t\t\n\t\treturn null;\n\t}\n\n\tstatic string GetTypeKind (Type t)\n\t{\n\t\tif (t.IsEnum)\n\t\t\treturn \"enum\";\n\t\tif (t.IsClass) {\n\t\t\tif (t.IsSubclassOf (typeof (System.MulticastDelegate)))\n\t\t\t\treturn \"delegate\";\n\t\t\telse\n\t\t\t\treturn \"class\";\n\t\t}\n\t\tif (t.IsInterface)\n\t\t\treturn \"interface\";\n\t\tif (t.IsValueType)\n\t\t\treturn \"struct\";\n\t\treturn \"class\";\n\t}\n\t\n\tstatic string GetTypeVisibility (Type t)\n\t{\n                switch (t.Attributes & TypeAttributes.VisibilityMask){\n                case TypeAttributes.Public:\n                case TypeAttributes.NestedPublic:\n                        return \"public\";\n\n                case TypeAttributes.NestedFamily:\n                case TypeAttributes.NestedFamANDAssem:\n                case TypeAttributes.NestedFamORAssem:\n                        return \"protected\";\n\n                default:\n                        return \"internal\";\n                }\n\t}\n\n#if NET_2_0\n\tstring FormatGenericParams (Type [] args)\n\t{\n\t\tStringBuilder sb = new StringBuilder ();\n\t\tif (args.Length == 0)\n\t\t\treturn \"\";\n\t\t\n\t\tsb.Append (\"<\");\n\t\tfor (int i = 0; i < args.Length; i++) {\n\t\t\tif (i > 0)\n\t\t\t\tsb.Append (\",\");\n\t\t\tsb.Append (FormatType (args [i]));\n\t\t}\n\t\tsb.Append (\">\");\n\t\treturn sb.ToString ();\n\t}\n#endif\n\n\t// TODO: fine tune this so that our output is less verbose. We need to figure\n\t// out a way to do this while not making things confusing.\n\tstring FormatType (Type t)\n\t{\n\t\tif (t == null)\n\t\t\treturn \"\";\n\n\t\tstring type = GetFullName (t);\n\t\tif (type == null)\n\t\t\treturn t.ToString ();\n\t\t\n\t\tif (!type.StartsWith (\"System.\")) {\n\t\t\tif (t.Namespace == this.t.Namespace)\n\t\t\t\treturn t.Name;\n\t\t\treturn type;\n\t\t}\n\t\t\n\t\tif (t.HasElementType) {\n\t\t\tType et = t.GetElementType ();\n\t\t\tif (t.IsArray)\n\t\t\t\treturn FormatType (et) + \" []\";\n\t\t\tif (t.IsPointer)\n\t\t\t\treturn FormatType (et) + \" *\";\n\t\t\tif (t.IsByRef)\n\t\t\t\treturn \"ref \" + FormatType (et);\n\t\t}\n\t\n\t\tswitch (type) {\n\t\tcase \"System.Byte\": return \"byte\";\n\t\tcase \"System.SByte\": return \"sbyte\";\n\t\tcase \"System.Int16\": return \"short\";\n\t\tcase \"System.Int32\": return \"int\";\n\t\tcase \"System.Int64\": return \"long\";\n\t\t\t\n\t\tcase \"System.UInt16\": return \"ushort\";\n\t\tcase \"System.UInt32\": return \"uint\";\n\t\tcase \"System.UInt64\": return \"ulong\";\n\t\t\t\n\t\tcase \"System.Single\":  return \"float\";\n\t\tcase \"System.Double\":  return \"double\";\n\t\tcase \"System.Decimal\": return \"decimal\";\n\t\tcase \"System.Boolean\": return \"bool\";\n\t\tcase \"System.Char\":    return \"char\";\n\t\tcase \"System.String\":  return \"string\";\n\t\t\t\n\t\tcase \"System.Object\":  return \"object\";\n\t\tcase \"System.Void\":  return \"void\";\n\t\t}\n\t\n\t\tif (type.LastIndexOf(\".\") == 6)\n\t\t\treturn type.Substring(7);\n\n\t\t//\n\t\t// If the namespace of the type is the namespace of what\n\t\t// we are printing (or is a member of one if its children\n\t\t// don't print it. This basically means that in C# we would\n\t\t// automatically get the namespace imported by virtue of the\n\t\t// namespace {} block.\n\t\t//\t\n\t\tif (this.t.Namespace.StartsWith (t.Namespace + \".\") || t.Namespace == this.t.Namespace)\n\t\t\treturn type.Substring (t.Namespace.Length + 1);\n\t\n\t\treturn type;\n\t}\n\n\tpublic static string RemoveGenericArity (string name)\n\t{\n\t\tint start = 0;\n\t\tStringBuilder sb = new StringBuilder ();\n\t\twhile (start < name.Length) {\n\t\t\tint pos = name.IndexOf ('`', start);\n\t\t\tif (pos < 0) {\n\t\t\t\tsb.Append (name.Substring (start));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.Append (name.Substring (start, pos-start));\n\n\t\t\tpos++;\n\n\t\t\twhile ((pos < name.Length) && Char.IsNumber (name [pos]))\n\t\t\t\tpos++;\n\n\t\t\tstart = pos;\n\t\t}\n\n\t\treturn sb.ToString ();\n\t}\n\n\tstring GetTypeName (Type t)\n\t{\n\t\tStringBuilder sb = new StringBuilder ();\n\t\tGetTypeName (sb, t);\n\t\treturn sb.ToString ();\n\t}\n\n\tvoid GetTypeName (StringBuilder sb, Type t)\n\t{\n\t\tsb.Append (RemoveGenericArity (t.Name));\n#if NET_2_0\n\t\tsb.Append (FormatGenericParams (t.GetGenericArguments ()));\n#endif\n\t}\n\n\tstring GetFullName (Type t)\n\t{\n\t\tStringBuilder sb = new StringBuilder ();\n\t\tGetFullName_recursed (sb, t, false);\n\t\treturn sb.ToString ();\n\t}\n\n\tvoid GetFullName_recursed (StringBuilder sb, Type t, bool recursed)\n\t{\n#if NET_2_0\n\t\tif (t.IsGenericParameter) {\n\t\t\tsb.Append (t.Name);\n\t\t\treturn;\n\t\t}\n#endif\n\n\t\tif (t.DeclaringType != null) {\n\t\t\tGetFullName_recursed (sb, t.DeclaringType, true);\n\t\t\tsb.Append (\".\");\n\t\t}\n\n\t\tif (!recursed) {\n\t\t\tstring ns = t.Namespace;\n\t\t\tif ((ns != null) && (ns != \"\")) {\n\t\t\t\tsb.Append (ns);\n\t\t\t\tsb.Append (\".\");\n\t\t\t}\n\t\t}\n\n\t\tGetTypeName (sb, t);\n\t}\n\n#if NET_2_0\n\tvoid WriteGenericConstraints (Type [] args)\n\t{\n\n\t\tforeach (Type t in args) {\n\t\t\tbool first = true;\n\t\t\tType[] ifaces = TypeGetInterfaces (t, true);\n\t\t\t\n\t\t\tGenericParameterAttributes attrs = t.GenericParameterAttributes & GenericParameterAttributes.SpecialConstraintMask;\n\t\t\tGenericParameterAttributes [] interesting = {\n\t\t\t\tGenericParameterAttributes.ReferenceTypeConstraint,\n\t\t\t\tGenericParameterAttributes.NotNullableValueTypeConstraint,\n\t\t\t\tGenericParameterAttributes.DefaultConstructorConstraint\n\t\t\t};\n\t\t\t\n\t\t\tif (t.BaseType != typeof (object) || ifaces.Length != 0 || attrs != 0) {\n\t\t\t\to.Write (\" where \");\n\t\t\t\to.Write (FormatType (t));\n\t\t\t\to.Write (\" : \");\n\t\t\t}\n\n\t\t\tif (t.BaseType != typeof (object)) {\n\t\t\t\to.Write (FormatType (t.BaseType));\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\tforeach (Type iface in ifaces) {\n\t\t\t\tif (!first)\n\t\t\t\t\to.Write (\", \");\n\t\t\t\tfirst = false;\n\t\t\t\t\n\t\t\t\to.Write (FormatType (iface));\n\t\t\t}\n\n\t\t\tforeach (GenericParameterAttributes a in interesting) {\n\t\t\t\tif ((attrs & a) == 0)\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tif (!first)\n\t\t\t\t\to.Write (\", \");\n\t\t\t\tfirst = false;\n\t\t\t\t\n\t\t\t\tswitch (a) {\n\t\t\t\tcase GenericParameterAttributes.ReferenceTypeConstraint:\n\t\t\t\t\to.Write (\"class\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GenericParameterAttributes.NotNullableValueTypeConstraint:\n\t\t\t\t\to.Write (\"struct\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GenericParameterAttributes.DefaultConstructorConstraint:\n\t\t\t\t\to.Write (\"new ()\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n#endif\n \n\tstring OperatorFromName (string name)\n\t{\n\t\tswitch (name) {\n\t\tcase \"op_UnaryPlus\": return \"+\";\n\t\tcase \"op_UnaryNegation\": return \"-\";\n\t\tcase \"op_LogicalNot\": return \"!\";\n\t\tcase \"op_OnesComplement\": return \"~\";\n\t\tcase \"op_Increment\": return \"++\";\n\t\tcase \"op_Decrement\": return \"--\";\n\t\tcase \"op_True\": return \"true\";\n\t\tcase \"op_False\": return \"false\";\n\t\tcase \"op_Addition\": return \"+\";\n\t\tcase \"op_Subtraction\": return \"-\";\n\t\tcase \"op_Multiply\": return \"*\";\n\t\tcase \"op_Division\": return \"/\";\n\t\tcase \"op_Modulus\": return \"%\";\n\t\tcase \"op_BitwiseAnd\": return \"&\";\n\t\tcase \"op_BitwiseOr\": return \"|\";\n\t\tcase \"op_ExclusiveOr\": return \"^\";\n\t\tcase \"op_LeftShift\": return \"<<\";\n\t\tcase \"op_RightShift\": return \">>\";\n\t\tcase \"op_Equality\": return \"==\";\n\t\tcase \"op_Inequality\": return \"!=\";\n\t\tcase \"op_GreaterThan\": return \">\";\n\t\tcase \"op_LessThan\": return \"<\";\n\t\tcase \"op_GreaterThanOrEqual\": return \">=\";\n\t\tcase \"op_LessThanOrEqual\": return \"<=\";\n\t\tdefault: return name;\n\t\t}\n\t}\n\n\tbool MethodIsExplicitIfaceImpl (MethodBase mb)\n\t{\n\t\tif (!(mb.IsFinal && mb.IsVirtual && mb.IsPrivate))\n\t\t\treturn false;\n\t\t\n\t\t// UGH msft has no way to get the info about what method is\n\t\t// getting overriden. Another reason to use cecil :-)\n\t\t//\n\t\t//MethodInfo mi = mb as MethodInfo;\n\t\t//if (mi == null)\n\t\t//\treturn false;\n\t\t//\n\t\t//Console.WriteLine (mi.GetBaseDefinition ().DeclaringType);\n\t\t//return mi.GetBaseDefinition ().DeclaringType.IsInterface;\n\t\t\n\t\t// So, we guess that virtual final private methods only come\n\t\t// from ifaces :-)\n\t\treturn true;\n\t}\n\t\n\tbool ShowMember (MemberInfo mi)\n\t{\n\t\tif (mi.MemberType == MemberTypes.Constructor && ((MethodBase) mi).IsStatic)\n\t\t\treturn false;\n\t\t\n\t\tif (show_private)\n\t\t\treturn true;\n\n\t\tif (filter_obsolete && mi.IsDefined (typeof (ObsoleteAttribute), false))\n\t\t\treturn false;\n\t\t\n\t\tswitch (mi.MemberType) {\n\t\tcase MemberTypes.Constructor:\n\t\tcase MemberTypes.Method:\n\t\t\tMethodBase mb = mi as MethodBase;\n\t\t\n\t\t\tif (mb.IsFamily || mb.IsPublic || mb.IsFamilyOrAssembly)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\tif (MethodIsExplicitIfaceImpl (mb))\n\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tcase MemberTypes.Field:\n\t\t\tFieldInfo fi = mi as FieldInfo;\n\t\t\n\t\t\tif (fi.IsFamily || fi.IsPublic || fi.IsFamilyOrAssembly)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tcase MemberTypes.NestedType:\n\t\tcase MemberTypes.TypeInfo:\n\t\t\tType t = mi as Type;\n\t\t\n\t\t\tswitch (t.Attributes & TypeAttributes.VisibilityMask){\n\t\t\tcase TypeAttributes.Public:\n\t\t\tcase TypeAttributes.NestedPublic:\n\t\t\tcase TypeAttributes.NestedFamily:\n\t\t\tcase TypeAttributes.NestedFamORAssem:\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// What am I !!!\n\t\treturn true;\n\t}\n\n\tstatic Type [] TypeGetInterfaces (Type t, bool declonly)\n\t{\n\t\tif (t.IsGenericParameter)\n\t\t\treturn new Type [0];\n\n\t\tType [] ifaces = t.GetInterfaces ();\n\t\tif (! declonly)\n\t\t\treturn ifaces;\n\n\t\t// Handle Object. Also, optimize for no interfaces\n\t\tif (t.BaseType == null || ifaces.Length == 0)\n\t\t\treturn ifaces;\n\n\t\tArrayList ar = new ArrayList ();\n\n\t\tforeach (Type i in ifaces)\n\t\t\tif (! i.IsAssignableFrom (t.BaseType))\n\t\t\t\tar.Add (i);\n\n\t\treturn (Type []) ar.ToArray (typeof (Type));\n\t}\n}\n\npublic class Comparer : IComparer  {\n\tdelegate int ComparerFunc (object a, object b);\n\t\n\tComparerFunc cmp;\n\t\n\tComparer (ComparerFunc f)\n\t{\n\t\tthis.cmp = f;\n\t}\n\t\n\tpublic int Compare (object a, object b)\n\t{\n\t\treturn cmp (a, b);\n\t}\n\n\tstatic int CompareType (object a, object b)\n\t{\n\t\tType type1 = (Type) a;\n\t\tType type2 = (Type) b;\n\n\t\tif (type1.IsSubclassOf (typeof (System.MulticastDelegate)) != type2.IsSubclassOf (typeof (System.MulticastDelegate)))\n\t\t\t\treturn (type1.IsSubclassOf (typeof (System.MulticastDelegate)))? -1:1;\n\t\treturn string.Compare (type1.Name, type2.Name);\n\t\t\t\n\t}\n\n//\tstatic Comparer TypeComparer = new Comparer (new ComparerFunc (CompareType));\n\n//\tstatic Type [] Sort (Type [] types)\n//\t{\n//\t\tArray.Sort (types, TypeComparer);\n//\t\treturn types;\n//\t}\n\t\n\tstatic int CompareMemberInfo (object a, object b)\n\t{\n\t\treturn string.Compare (((MemberInfo) a).Name, ((MemberInfo) b).Name);\n\t}\n\t\n\tstatic Comparer MemberInfoComparer = new Comparer (new ComparerFunc (CompareMemberInfo));\n\t\n\tpublic static MemberInfo [] Sort (MemberInfo [] inf)\n\t{\n\t\tArray.Sort (inf, MemberInfoComparer);\n\t\treturn inf;\n\t}\n\t\n\tstatic int CompareMethodBase (object a, object b)\n\t{\n\t\tMethodBase aa = (MethodBase) a, bb = (MethodBase) b;\n\t\t\n\t\tif (aa.IsStatic == bb.IsStatic) {\n\t\t\tint c = CompareMemberInfo (a, b);\n\t\t\tif (c != 0)\n\t\t\t\treturn c;\n\t\t\tParameterInfo [] ap, bp;\n\n\t\t\t//\n\t\t\t// Sort overloads by the names of their types\n\t\t\t// put methods with fewer params first.\n\t\t\t//\n\t\t\t\n\t\t\tap = aa.GetParameters ();\n\t\t\tbp = bb.GetParameters ();\n\t\t\tint n = System.Math.Min (ap.Length, bp.Length);\n\n\t\t\tfor (int i = 0; i < n; i ++)\n\t\t\t\tif ((c = CompareType (ap [i].ParameterType, bp [i].ParameterType)) != 0)\n\t\t\t\t\treturn c;\n\n\t\t\treturn ap.Length.CompareTo (bp.Length);\n\t\t}\n\t\tif (aa.IsStatic)\n\t\t\treturn -1;\n\t\t\n\t\treturn 1;\n\t}\n\t\n\tstatic Comparer MethodBaseComparer = new Comparer (new ComparerFunc (CompareMethodBase));\n\t\n\tpublic static MethodBase [] Sort (MethodBase [] inf)\n\t{\n\t\tArray.Sort (inf, MethodBaseComparer);\n\t\treturn inf;\n\t}\n\t\n\tstatic int ComparePropertyInfo (object a, object b)\n\t{\n\t\tPropertyInfo aa = (PropertyInfo) a, bb = (PropertyInfo) b;\n\t\t\n\t\tbool astatic = (aa.CanRead ? aa.GetGetMethod (true) : aa.GetSetMethod (true)).IsStatic;\n\t\tbool bstatic = (bb.CanRead ? bb.GetGetMethod (true) : bb.GetSetMethod (true)).IsStatic;\n\t\t\n\t\tif (astatic == bstatic)\n\t\t\treturn CompareMemberInfo (a, b);\n\t\t\n\t\tif (astatic)\n\t\t\treturn -1;\n\t\t\n\t\treturn 1;\n\t}\n\t\n\tstatic Comparer PropertyInfoComparer = new Comparer (new ComparerFunc (ComparePropertyInfo));\n\t\n\tpublic static PropertyInfo [] Sort (PropertyInfo [] inf)\n\t{\n\t\tArray.Sort (inf, PropertyInfoComparer);\n\t\treturn inf;\n\t}\n\t\n\tstatic int CompareEventInfo (object a, object b)\n\t{\n\t\tEventInfo aa = (EventInfo) a, bb = (EventInfo) b;\n\t\t\n\t\tbool astatic = aa.GetAddMethod (true).IsStatic;\n\t\tbool bstatic = bb.GetAddMethod (true).IsStatic;\n\t\t\n\t\tif (astatic == bstatic)\n\t\t\treturn CompareMemberInfo (a, b);\n\t\t\n\t\tif (astatic)\n\t\t\treturn -1;\n\t\t\n\t\treturn 1;\n\t}\n\t\n\tstatic Comparer EventInfoComparer = new Comparer (new ComparerFunc (CompareEventInfo));\n\t\n\tpublic static EventInfo [] Sort (EventInfo [] inf)\n\t{\n\t\tArray.Sort (inf, EventInfoComparer);\n\t\treturn inf;\n\t}\n}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs",
    "content": "//\n// parameter.cs: Parameter definition.\n//\n// Author: Miguel de Icaza (miguel@gnu.org)\n//         Marek Safar (marek.safar@seznam.cz)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2008 Novell, Inc. \n// Copyright 2011 Xamarin Inc\n//\n//\nusing System;\nusing System.Text;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\t/// <summary>\n\t///   Abstract Base class for parameters of a method.\n\t/// </summary>\n\tpublic abstract class ParameterBase : Attributable\n\t{\n\t\tprotected ParameterBuilder builder;\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n#if false\n\t\t\tif (a.Type == pa.MarshalAs) {\n\t\t\t\tUnmanagedMarshal marshal = a.GetMarshal (this);\n\t\t\t\tif (marshal != null) {\n\t\t\t\t\tbuilder.SetMarshal (marshal);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n#endif\n\t\t\tif (a.HasSecurityAttribute) {\n\t\t\t\ta.Error_InvalidSecurityParent ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Dynamic) {\n\t\t\t\ta.Error_MisusedDynamicAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tpublic ParameterBuilder Builder {\n\t\t\tget {\n\t\t\t\treturn builder;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool IsClsComplianceRequired()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Class for applying custom attributes on the return type\n\t/// </summary>\n\tpublic class ReturnParameter : ParameterBase\n\t{\n\t\tMemberCore method;\n\n\t\t// TODO: merge method and mb\n\t\tpublic ReturnParameter (MemberCore method, MethodBuilder mb, Location location)\n\t\t{\n\t\t\tthis.method = method;\n\t\t\ttry {\n\t\t\t\tbuilder = mb.DefineParameter (0, ParameterAttributes.None, \"\");\t\t\t\n\t\t\t}\n\t\t\tcatch (ArgumentOutOfRangeException) {\n\t\t\t\tmethod.Compiler.Report.RuntimeMissingSupport (location, \"custom attributes on the return type\");\n\t\t\t}\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.CLSCompliant) {\n\t\t\t\tmethod.Compiler.Report.Warning (3023, 1, a.Location,\n\t\t\t\t\t\"CLSCompliant attribute has no meaning when applied to return types. Try putting it on the method instead\");\n\t\t\t}\n\n\t\t\t// This occurs after Warning -28\n\t\t\tif (builder == null)\n\t\t\t\treturn;\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.ReturnValue;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Is never called\n\t\t/// </summary>\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class ImplicitLambdaParameter : Parameter\n\t{\n\t\tpublic ImplicitLambdaParameter (string name, Location loc)\n\t\t\t: base (null, name, Modifier.NONE, null, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override TypeSpec Resolve (IMemberContext ec, int index)\n\t\t{\n\t\t\tif (parameter_type == null)\n\t\t\t\tthrow new InternalErrorException (\"A type of implicit lambda parameter `{0}' is not set\",\n\t\t\t\t\tName);\n\n\t\t\tbase.idx = index;\n\t\t\treturn parameter_type;\n\t\t}\n\n\t\tpublic void SetParameterType (TypeSpec type)\n\t\t{\n\t\t\tparameter_type = type;\n\t\t}\n\t}\n\n\tpublic class ParamsParameter : Parameter {\n\t\tpublic ParamsParameter (FullNamedExpression type, string name, Attributes attrs, Location loc):\n\t\t\tbase (type, name, Parameter.Modifier.PARAMS, attrs, loc)\n\t\t{\n\t\t}\n\n\t\tpublic override TypeSpec Resolve (IMemberContext ec, int index)\n\t\t{\n\t\t\tif (base.Resolve (ec, index) == null)\n\t\t\t\treturn null;\n\n\t\t\tvar ac = parameter_type as ArrayContainer;\n\t\t\tif (ac == null || ac.Rank != 1) {\n\t\t\t\tec.Module.Compiler.Report.Error (225, Location, \"The params parameter must be a single dimensional array\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn parameter_type;\n\t\t}\n\n\t\tpublic override void ApplyAttributes (MethodBuilder mb, ConstructorBuilder cb, int index, PredefinedAttributes pa)\n\t\t{\n\t\t\tbase.ApplyAttributes (mb, cb, index, pa);\n\t\t\tpa.ParamArray.EmitAttribute (builder);\n\t\t}\n\t}\n\n\tpublic class ArglistParameter : Parameter {\n\t\t// Doesn't have proper type because it's never chosen for better conversion\n\t\tpublic ArglistParameter (Location loc) :\n\t\t\tbase (null, String.Empty, Parameter.Modifier.NONE, null, loc)\n\t\t{\n\t\t\tparameter_type = InternalType.Arglist;\n\t\t}\n\n\t\tpublic override void  ApplyAttributes (MethodBuilder mb, ConstructorBuilder cb, int index, PredefinedAttributes pa)\n\t\t{\n\t\t\t// Nothing to do\n\t\t}\n\n\t\tpublic override bool CheckAccessibility (InterfaceMemberBase member)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override TypeSpec Resolve (IMemberContext ec, int index)\n\t\t{\n\t\t\treturn parameter_type;\n\t\t}\n\t}\n\n\tpublic interface IParameterData\n\t{\n\t\tExpression DefaultValue { get; }\n\t\tbool HasExtensionMethodModifier { get; }\n\t\tbool HasDefaultValue { get; }\n\t\tParameter.Modifier ModFlags { get; }\n\t\tstring Name { get; }\n\t}\n\n\t//\n\t// Parameter information created by parser\n\t//\n\tpublic class Parameter : ParameterBase, IParameterData, ILocalVariable // TODO: INamedBlockVariable\n\t{\n\t\t[Flags]\n\t\tpublic enum Modifier : byte {\n\t\t\tNONE    = 0,\n\t\t\tPARAMS  = 1 << 0,\n\t\t\tREF = 1 << 1,\n\t\t\tOUT = 1 << 2,\n\t\t\tThis = 1 << 3,\n\t\t\tCallerMemberName = 1 << 4,\n\t\t\tCallerLineNumber = 1 << 5,\n\t\t\tCallerFilePath = 1 << 6,\n\n\t\t\tRefOutMask = REF | OUT,\n\t\t\tModifierMask = PARAMS | REF | OUT | This,\n\t\t\tCallerMask = CallerMemberName | CallerLineNumber | CallerFilePath\n\t\t}\n\n\t\tstatic readonly string[] attribute_targets = new [] { \"param\" };\n\n\t\tFullNamedExpression texpr;\n\t\tModifier modFlags;\n\t\tstring name;\n\t\tExpression default_expr;\n\t\tprotected TypeSpec parameter_type;\n\t\treadonly Location loc;\n\t\tprotected int idx;\n\t\tpublic bool HasAddressTaken;\n\n\t\tTemporaryVariableReference expr_tree_variable;\n\n\t\tHoistedParameter hoisted_variant;\n\n\t\tpublic Parameter (FullNamedExpression type, string name, Modifier mod, Attributes attrs, Location loc)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tmodFlags = mod;\n\t\t\tthis.loc = loc;\n\t\t\ttexpr = type;\n\n\t\t\t// Only assign, attributes will be attached during resolve\n\t\t\tbase.attributes = attrs;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Expression DefaultExpression {\n\t\t\tget {\n\t\t\t\treturn default_expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic DefaultParameterValueExpression DefaultValue {\n\t\t\tget {\n\t\t\t\treturn default_expr as DefaultParameterValueExpression;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tdefault_expr = value;\n\t\t\t}\n\t\t}\n\n\t\tExpression IParameterData.DefaultValue {\n\t\t\tget {\n\t\t\t\tvar expr = default_expr as DefaultParameterValueExpression;\n\t\t\t\treturn expr == null ? default_expr : expr.Child;\n\t\t\t}\n\t\t}\n\n\t\tbool HasOptionalExpression {\n\t\t\tget {\n\t\t\t\treturn default_expr is DefaultParameterValueExpression;\n\t\t\t}\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic Modifier ParameterModifier {\n\t\t\tget {\n\t\t\t\treturn modFlags;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec Type {\n\t\t\tget {\n\t\t\t\treturn parameter_type;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tparameter_type = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression TypeExpression  {\n\t\t\tget {\n\t\t\t\treturn texpr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.In && ModFlags == Modifier.OUT) {\n\t\t\t\ta.Report.Error (36, a.Location, \"An out parameter cannot have the `In' attribute\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.ParamArray) {\n\t\t\t\ta.Report.Error (674, a.Location, \"Do not use `System.ParamArrayAttribute'. Use the `params' keyword instead\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Out && (ModFlags & Modifier.REF) != 0 &&\n\t\t\t    !OptAttributes.Contains (pa.In)) {\n\t\t\t\ta.Report.Error (662, a.Location,\n\t\t\t\t\t\"Cannot specify only `Out' attribute on a ref parameter. Use both `In' and `Out' attributes or neither\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.CLSCompliant) {\n\t\t\t\ta.Report.Warning (3022, 1, a.Location, \"CLSCompliant attribute has no meaning when applied to parameters. Try putting it on the method instead\");\n\t\t\t} else if (a.Type == pa.DefaultParameterValue || a.Type == pa.OptionalParameter) {\n\t\t\t\tif (HasOptionalExpression) {\n\t\t\t\t\ta.Report.Error (1745, a.Location,\n\t\t\t\t\t\t\"Cannot specify `{0}' attribute on optional parameter `{1}'\",\n\t\t\t\t\t\ta.Type.GetSignatureForError ().Replace (\"Attribute\", \"\"), Name);\n\t\t\t\t}\n\n\t\t\t\tif (a.Type == pa.DefaultParameterValue)\n\t\t\t\t\treturn;\n\t\t\t} else if (a.Type == pa.CallerMemberNameAttribute) {\n\t\t\t\tif ((modFlags & Modifier.CallerMemberName) == 0) {\n\t\t\t\t\ta.Report.Error (4022, a.Location,\n\t\t\t\t\t\t\"The CallerMemberName attribute can only be applied to parameters with default value\");\n\t\t\t\t}\n\t\t\t} else if (a.Type == pa.CallerLineNumberAttribute) {\n\t\t\t\tif ((modFlags & Modifier.CallerLineNumber) == 0) {\n\t\t\t\t\ta.Report.Error (4020, a.Location,\n\t\t\t\t\t\t\"The CallerLineNumber attribute can only be applied to parameters with default value\");\n\t\t\t\t}\n\t\t\t} else if (a.Type == pa.CallerFilePathAttribute) {\n\t\t\t\tif ((modFlags & Modifier.CallerFilePath) == 0) {\n\t\t\t\t\ta.Report.Error (4021, a.Location,\n\t\t\t\t\t\t\"The CallerFilePath attribute can only be applied to parameters with default value\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\t\t\n\t\tpublic virtual bool CheckAccessibility (InterfaceMemberBase member)\n\t\t{\n\t\t\tif (parameter_type == null)\n\t\t\t\treturn true;\n\n\t\t\treturn member.IsAccessibleAs (parameter_type);\n\t\t}\n\n\t\tbool IsValidCallerContext (MemberCore memberContext)\n\t\t{\n\t\t\tvar m = memberContext as Method;\n\t\t\tif (m != null)\n\t\t\t\treturn !m.IsPartialImplementation;\n\n\t\t\treturn true;\n\t\t}\n\n\t\t// <summary>\n\t\t//   Resolve is used in method definitions\n\t\t// </summary>\n\t\tpublic virtual TypeSpec Resolve (IMemberContext rc, int index)\n\t\t{\n\t\t\tif (parameter_type != null)\n\t\t\t\treturn parameter_type;\n\n\t\t\tif (attributes != null)\n\t\t\t\tattributes.AttachTo (this, rc);\n\n\t\t\tparameter_type = texpr.ResolveAsType (rc);\n\t\t\tif (parameter_type == null)\n\t\t\t\treturn null;\n\n\t\t\tthis.idx = index;\n\n\t\t\tif ((modFlags & Parameter.Modifier.RefOutMask) != 0 && parameter_type.IsSpecialRuntimeType) {\n\t\t\t\trc.Module.Compiler.Report.Error (1601, Location, \"Method or delegate parameter cannot be of type `{0}'\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tVarianceDecl.CheckTypeVariance (parameter_type,\n\t\t\t\t(modFlags & Parameter.Modifier.RefOutMask) != 0 ? Variance.None : Variance.Contravariant,\n\t\t\t\trc);\n\n\t\t\tif (parameter_type.IsStatic) {\n\t\t\t\trc.Module.Compiler.Report.Error (721, Location, \"`{0}': static types cannot be used as parameters\",\n\t\t\t\t\ttexpr.GetSignatureForError ());\n\t\t\t\treturn parameter_type;\n\t\t\t}\n\n\t\t\tif ((modFlags & Modifier.This) != 0 && (parameter_type.IsPointer || parameter_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic)) {\n\t\t\t\trc.Module.Compiler.Report.Error (1103, Location, \"The extension method cannot be of type `{0}'\",\n\t\t\t\t\tparameter_type.GetSignatureForError ());\n\t\t\t}\n\n\t\t\treturn parameter_type;\n\t\t}\n\n\t\tvoid ResolveCallerAttributes (ResolveContext rc)\n\t\t{\n\t\t\tvar pa = rc.Module.PredefinedAttributes;\n\t\t\tTypeSpec caller_type;\n\t\t\tAttribute callerMemberName = null, callerFilePath = null;\n\n\t\t\tforeach (var attr in attributes.Attrs) {\n\t\t\t\tvar atype = attr.ResolveTypeForComparison ();\n\t\t\t\tif (atype == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (atype == pa.CallerMemberNameAttribute) {\n\t\t\t\t\tcaller_type = rc.BuiltinTypes.String;\n\t\t\t\t\tif (caller_type != parameter_type && !Convert.ImplicitReferenceConversionExists (caller_type, parameter_type)) {\n\t\t\t\t\t\trc.Report.Error (4019, attr.Location,\n\t\t\t\t\t\t\t\"The CallerMemberName attribute cannot be applied because there is no standard conversion from `{0}' to `{1}'\",\n\t\t\t\t\t\t\tcaller_type.GetSignatureForError (), parameter_type.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!IsValidCallerContext (rc.CurrentMemberDefinition)) {\n\t\t\t\t\t\trc.Report.Warning (4026, 1, attr.Location,\n\t\t\t\t\t\t\t\"The CallerMemberName applied to parameter `{0}' will have no effect because it applies to a member that is used in context that do not allow optional arguments\",\n\t\t\t\t\t\t\tname);\n\t\t\t\t\t}\n\n\t\t\t\t\tmodFlags |= Modifier.CallerMemberName;\n\t\t\t\t\tcallerMemberName = attr;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (atype == pa.CallerLineNumberAttribute) {\n\t\t\t\t\tcaller_type = rc.BuiltinTypes.Int;\n\t\t\t\t\tif (caller_type != parameter_type && !Convert.ImplicitStandardConversionExists (new IntConstant (caller_type, int.MaxValue, Location.Null), parameter_type)) {\n\t\t\t\t\t\trc.Report.Error (4017, attr.Location,\n\t\t\t\t\t\t\t\"The CallerLineNumberAttribute attribute cannot be applied because there is no standard conversion from `{0}' to `{1}'\",\n\t\t\t\t\t\t\tcaller_type.GetSignatureForError (), parameter_type.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!IsValidCallerContext (rc.CurrentMemberDefinition)) {\n\t\t\t\t\t\trc.Report.Warning (4024, 1, attr.Location,\n\t\t\t\t\t\t\t\"The CallerLineNumberAttribute applied to parameter `{0}' will have no effect because it applies to a member that is used in context that do not allow optional arguments\",\n\t\t\t\t\t\t\tname);\n\t\t\t\t\t}\n\n\t\t\t\t\tmodFlags |= Modifier.CallerLineNumber;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (atype == pa.CallerFilePathAttribute) {\n\t\t\t\t\tcaller_type = rc.BuiltinTypes.String;\n\t\t\t\t\tif (caller_type != parameter_type && !Convert.ImplicitReferenceConversionExists (caller_type, parameter_type)) {\n\t\t\t\t\t\trc.Report.Error (4018, attr.Location,\n\t\t\t\t\t\t\t\"The CallerFilePath attribute cannot be applied because there is no standard conversion from `{0}' to `{1}'\",\n\t\t\t\t\t\t\tcaller_type.GetSignatureForError (), parameter_type.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!IsValidCallerContext (rc.CurrentMemberDefinition)) {\n\t\t\t\t\t\trc.Report.Warning (4025, 1, attr.Location,\n\t\t\t\t\t\t\t\"The CallerFilePath applied to parameter `{0}' will have no effect because it applies to a member that is used in context that do not allow optional arguments\",\n\t\t\t\t\t\t\tname);\n\t\t\t\t\t}\n\n\t\t\t\t\tmodFlags |= Modifier.CallerFilePath;\n\t\t\t\t\tcallerFilePath = attr;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((modFlags & Modifier.CallerLineNumber) != 0) {\n\t\t\t\tif (callerMemberName != null) {\n\t\t\t\t\trc.Report.Warning (7081, 1, callerMemberName.Location,\n\t\t\t\t\t\t\"The CallerMemberNameAttribute applied to parameter `{0}' will have no effect. It is overridden by the CallerLineNumberAttribute\",\n\t\t\t\t\t\tName);\n\t\t\t\t}\n\n\t\t\t\tif (callerFilePath != null) {\n\t\t\t\t\trc.Report.Warning (7082, 1, callerFilePath.Location,\n\t\t\t\t\t\t\"The CallerFilePathAttribute applied to parameter `{0}' will have no effect. It is overridden by the CallerLineNumberAttribute\",\n\t\t\t\t\t\tname);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((modFlags & Modifier.CallerMemberName) != 0) {\n\t\t\t\tif (callerFilePath != null) {\n\t\t\t\t\trc.Report.Warning (7080, 1, callerFilePath.Location,\n\t\t\t\t\t\t\"The CallerMemberNameAttribute applied to parameter `{0}' will have no effect. It is overridden by the CallerFilePathAttribute\",\n\t\t\t\t\t\tname);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tpublic void ResolveDefaultValue (ResolveContext rc)\n\t\t{\n\t\t\t//\n\t\t\t// Default value was specified using an expression\n\t\t\t//\n\t\t\tif (default_expr != null) {\n\t\t\t\t((DefaultParameterValueExpression)default_expr).Resolve (rc, this);\n\t\t\t\tif (attributes != null)\n\t\t\t\t\tResolveCallerAttributes (rc);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (attributes == null)\n\t\t\t\treturn;\n\n\t\t\tvar pa = rc.Module.PredefinedAttributes;\n\t\t\tvar def_attr = attributes.Search (pa.DefaultParameterValue);\n\t\t\tif (def_attr != null) {\n\t\t\t\tif (def_attr.Resolve () == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar default_expr_attr = def_attr.GetParameterDefaultValue ();\n\t\t\t\tif (default_expr_attr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar dpa_rc = def_attr.CreateResolveContext ();\n\t\t\t\tdefault_expr = default_expr_attr.Resolve (dpa_rc);\n\n\t\t\t\tif (default_expr is BoxedCast)\n\t\t\t\t\tdefault_expr = ((BoxedCast) default_expr).Child;\n\n\t\t\t\tConstant c = default_expr as Constant;\n\t\t\t\tif (c == null) {\n\t\t\t\t\tif (parameter_type.BuiltinType == BuiltinTypeSpec.Type.Object) {\n\t\t\t\t\t\trc.Report.Error (1910, default_expr.Location,\n\t\t\t\t\t\t\t\"Argument of type `{0}' is not applicable for the DefaultParameterValue attribute\",\n\t\t\t\t\t\t\tdefault_expr.Type.GetSignatureForError ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\trc.Report.Error (1909, default_expr.Location,\n\t\t\t\t\t\t\t\"The DefaultParameterValue attribute is not applicable on parameters of type `{0}'\",\n\t\t\t\t\t\t\tdefault_expr.Type.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault_expr = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (TypeSpecComparer.IsEqual (default_expr.Type, parameter_type) ||\n\t\t\t\t\t(default_expr is NullConstant && TypeSpec.IsReferenceType (parameter_type) && !parameter_type.IsGenericParameter) ||\n\t\t\t\t\tparameter_type.BuiltinType == BuiltinTypeSpec.Type.Object) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// LAMESPEC: Some really weird csc behaviour which we have to mimic\n\t\t\t\t// User operators returning same type as parameter type are considered\n\t\t\t\t// valid for this attribute only\n\t\t\t\t//\n\t\t\t\t// struct S { public static implicit operator S (int i) {} }\n\t\t\t\t//\n\t\t\t\t// void M ([DefaultParameterValue (3)]S s)\n\t\t\t\t//\n\t\t\t\tvar expr = Convert.ImplicitUserConversion (dpa_rc, default_expr, parameter_type, loc);\n\t\t\t\tif (expr != null && TypeSpecComparer.IsEqual (expr.Type, parameter_type)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\trc.Report.Error (1908, default_expr.Location, \"The type of the default value should match the type of the parameter\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar opt_attr = attributes.Search (pa.OptionalParameter);\n\t\t\tif (opt_attr != null) {\n\t\t\t\tdefault_expr = EmptyExpression.MissingValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasDefaultValue {\n\t\t\tget { return default_expr != null; }\n\t\t}\n\n\t\tpublic bool HasExtensionMethodModifier {\n\t\t\tget { return (modFlags & Modifier.This) != 0; }\n\t\t}\n\n\t\t//\n\t\t// Hoisted parameter variant\n\t\t//\n\t\tpublic HoistedParameter HoistedVariant {\n\t\t\tget {\n\t\t\t\treturn hoisted_variant;\n\t\t\t}\n\t\t\tset {\n\t\t\t\thoisted_variant = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Modifier ModFlags {\n\t\t\tget { return modFlags & ~Modifier.This; }\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t\tset { name = value; }\n\t\t}\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Parameter;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Error_DuplicateName (Report r)\n\t\t{\n\t\t\tr.Error (100, Location, \"The parameter name `{0}' is a duplicate\", Name);\n\t\t}\n\n\t\tpublic virtual string GetSignatureForError ()\n\t\t{\n\t\t\tstring type_name;\n\t\t\tif (parameter_type != null)\n\t\t\t\ttype_name = parameter_type.GetSignatureForError ();\n\t\t\telse\n\t\t\t\ttype_name = texpr.GetSignatureForError ();\n\n\t\t\tstring mod = GetModifierSignature (modFlags);\n\t\t\tif (mod.Length > 0)\n\t\t\t\treturn String.Concat (mod, \" \", type_name);\n\n\t\t\treturn type_name;\n\t\t}\n\n\t\tpublic static string GetModifierSignature (Modifier mod)\n\t\t{\n\t\t\tswitch (mod) {\n\t\t\tcase Modifier.OUT:\n\t\t\t\treturn \"out\";\n\t\t\tcase Modifier.PARAMS:\n\t\t\t\treturn \"params\";\n\t\t\tcase Modifier.REF:\n\t\t\t\treturn \"ref\";\n\t\t\tcase Modifier.This:\n\t\t\t\treturn \"this\";\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\n\t\tpublic void IsClsCompliant (IMemberContext ctx)\n\t\t{\n\t\t\tif (parameter_type.IsCLSCompliant ())\n\t\t\t\treturn;\n\n\t\t\tctx.Module.Compiler.Report.Warning (3001, 1, Location,\n\t\t\t\t\"Argument type `{0}' is not CLS-compliant\", parameter_type.GetSignatureForError ());\n\t\t}\n\n\t\tpublic virtual void ApplyAttributes (MethodBuilder mb, ConstructorBuilder cb, int index, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (builder != null)\n\t\t\t\tthrow new InternalErrorException (\"builder already exists\");\n\n\t\t\tvar pattrs = ParametersCompiled.GetParameterAttribute (modFlags);\n\t\t\tif (HasOptionalExpression)\n\t\t\t\tpattrs |= ParameterAttributes.Optional;\n\n\t\t\tif (mb == null)\n\t\t\t\tbuilder = cb.DefineParameter (index, pattrs, Name);\n\t\t\telse\n\t\t\t\tbuilder = mb.DefineParameter (index, pattrs, Name);\n\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tif (HasDefaultValue && default_expr.Type != null) {\n\t\t\t\t//\n\t\t\t\t// Emit constant values for true constants only, the other\n\t\t\t\t// constant-like expressions will rely on default value expression\n\t\t\t\t//\n\t\t\t\tvar def_value = DefaultValue;\n\t\t\t\tConstant c = def_value != null ? def_value.Child as Constant : default_expr as Constant;\n\t\t\t\tif (c != null) {\n\t\t\t\t\tif (c.Type.BuiltinType == BuiltinTypeSpec.Type.Decimal) {\n\t\t\t\t\t\tpa.DecimalConstant.EmitAttribute (builder, (decimal) c.GetValue (), c.Location);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuilder.SetConstant (c.GetValue ());\n\t\t\t\t\t}\n\t\t\t\t} else if (default_expr.Type.IsStruct || default_expr.Type.IsGenericParameter) {\n\t\t\t\t\t//\n\t\t\t\t\t// Handles special case where default expression is used with value-type or type parameter\n\t\t\t\t\t//\n\t\t\t\t\t// void Foo (S s = default (S)) {}\n\t\t\t\t\t//\n\t\t\t\t\tbuilder.SetConstant (null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parameter_type != null) {\n\t\t\t\tif (parameter_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tpa.Dynamic.EmitAttribute (builder);\n\t\t\t\t} else if (parameter_type.HasDynamicElement) {\n\t\t\t\t\tpa.Dynamic.EmitAttribute (builder, parameter_type, Location);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic Parameter Clone ()\n\t\t{\n\t\t\tParameter p = (Parameter) MemberwiseClone ();\n\t\t\tif (attributes != null)\n\t\t\t\tp.attributes = attributes.Clone ();\n\n\t\t\treturn p;\n\t\t}\n\n\t\tpublic ExpressionStatement CreateExpressionTreeVariable (BlockContext ec)\n\t\t{\n\t\t\tif ((modFlags & Modifier.RefOutMask) != 0)\n\t\t\t\tec.Report.Error (1951, Location, \"An expression tree parameter cannot use `ref' or `out' modifier\");\n\n\t\t\texpr_tree_variable = TemporaryVariableReference.Create (ResolveParameterExpressionType (ec, Location).Type, ec.CurrentBlock.ParametersBlock, Location);\n\t\t\texpr_tree_variable = (TemporaryVariableReference) expr_tree_variable.Resolve (ec);\n\n\t\t\tArguments arguments = new Arguments (2);\n\t\t\targuments.Add (new Argument (new TypeOf (parameter_type, Location)));\n\t\t\targuments.Add (new Argument (new StringConstant (ec.BuiltinTypes, Name, Location)));\n\t\t\treturn new SimpleAssign (ExpressionTreeVariableReference (),\n\t\t\t\tExpression.CreateExpressionFactoryCall (ec, \"Parameter\", null, arguments, Location));\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.EmitArgumentLoad (idx);\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec)\n\t\t{\n\t\t\tec.EmitArgumentStore (idx);\n\t\t}\n\n\t\tpublic void EmitAddressOf (EmitContext ec)\n\t\t{\n\t\t\tif ((ModFlags & Modifier.RefOutMask) != 0) {\n\t\t\t\tec.EmitArgumentLoad (idx);\n\t\t\t} else {\n\t\t\t\tec.EmitArgumentAddress (idx);\n\t\t\t}\n\t\t}\n\n\t\tpublic TemporaryVariableReference ExpressionTreeVariableReference ()\n\t\t{\n\t\t\treturn expr_tree_variable;\n\t\t}\n\n\t\t//\n\t\t// System.Linq.Expressions.ParameterExpression type\n\t\t//\n\t\tpublic static TypeExpr ResolveParameterExpressionType (IMemberContext ec, Location location)\n\t\t{\n\t\t\tTypeSpec p_type = ec.Module.PredefinedTypes.ParameterExpression.Resolve ();\n\t\t\treturn new TypeExpression (p_type, location);\n\t\t}\n\n\t\tpublic void SetIndex (int index)\n\t\t{\n\t\t\tidx = index;\n\t\t}\n\n\t\tpublic void Warning_UselessOptionalParameter (Report Report)\n\t\t{\n\t\t\tReport.Warning (1066, 1, Location,\n\t\t\t\t\"The default value specified for optional parameter `{0}' will never be used\",\n\t\t\t\tName);\n\t\t}\n\t}\n\n\t//\n\t// Imported or resolved parameter information\n\t//\n\tpublic class ParameterData : IParameterData\n\t{\n\t\treadonly string name;\n\t\treadonly Parameter.Modifier modifiers;\n\t\treadonly Expression default_value;\n\n\t\tpublic ParameterData (string name, Parameter.Modifier modifiers)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tthis.modifiers = modifiers;\n\t\t}\n\n\t\tpublic ParameterData (string name, Parameter.Modifier modifiers, Expression defaultValue)\n\t\t\t: this (name, modifiers)\n\t\t{\n\t\t\tthis.default_value = defaultValue;\n\t\t}\n\n\t\t#region IParameterData Members\n\n\t\tpublic Expression DefaultValue {\n\t\t\tget { return default_value; }\n\t\t}\n\n\t\tpublic bool HasExtensionMethodModifier {\n\t\t\tget { return (modifiers & Parameter.Modifier.This) != 0; }\n\t\t}\n\n\t\tpublic bool HasDefaultValue {\n\t\t\tget { return default_value != null; }\n\t\t}\n\n\t\tpublic Parameter.Modifier ModFlags {\n\t\t\tget { return modifiers; }\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tpublic abstract class AParametersCollection\n\t{\n\t\tprotected bool has_arglist;\n\t\tprotected bool has_params;\n\n\t\t// Null object pattern\n\t\tprotected IParameterData [] parameters;\n\t\tprotected TypeSpec [] types;\n\n\t\tpublic CallingConventions CallingConvention {\n\t\t\tget {\n\t\t\t\treturn has_arglist ?\n\t\t\t\t\tCallingConventions.VarArgs :\n\t\t\t\t\tCallingConventions.Standard;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget { return parameters.Length; }\n\t\t}\n\n\t\tpublic TypeSpec ExtensionMethodType {\n\t\t\tget {\n\t\t\t\tif (Count == 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn FixedParameters [0].HasExtensionMethodModifier ?\n\t\t\t\t\ttypes [0] : null;\n\t\t\t}\n\t\t}\n\n\t\tpublic IParameterData [] FixedParameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic static ParameterAttributes GetParameterAttribute (Parameter.Modifier modFlags)\n\t\t{\n\t\t\treturn (modFlags & Parameter.Modifier.OUT) != 0 ?\n\t\t\t\tParameterAttributes.Out : ParameterAttributes.None;\n\t\t}\n\n\t\t// Very expensive operation\n\t\tpublic MetaType[] GetMetaInfo ()\n\t\t{\n\t\t\tMetaType[] types;\n\t\t\tif (has_arglist) {\n\t\t\t\tif (Count == 1)\n\t\t\t\t\treturn MetaType.EmptyTypes;\n\n\t\t\t\ttypes = new MetaType[Count - 1];\n\t\t\t} else {\n\t\t\t\tif (Count == 0)\n\t\t\t\t\treturn MetaType.EmptyTypes;\n\n\t\t\t\ttypes = new MetaType[Count];\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < types.Length; ++i) {\n\t\t\t\ttypes[i] = Types[i].GetMetaInfo ();\n\n\t\t\t\tif ((FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// TODO MemberCache: Should go to MetaInfo getter\n\t\t\t\ttypes [i] = types [i].MakeByRefType ();\n\t\t\t}\n\n\t\t\treturn types;\n\t\t}\n\n\t\t//\n\t\t// Returns the parameter information based on the name\n\t\t//\n\t\tpublic int GetParameterIndexByName (string name)\n\t\t{\n\t\t\tfor (int idx = 0; idx < Count; ++idx) {\n\t\t\t\tif (parameters [idx].Name == name)\n\t\t\t\t\treturn idx;\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tif (IsEmpty)\n\t\t\t\treturn string.Empty;\n\n\t\t\tStringBuilder sb = new StringBuilder (\"(\");\n\t\t\tfor (int i = 0; i < Count; ++i) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\tsb.Append (\",\");\n\n\t\t\t\tsb.Append (types [i].GetSignatureForDocumentation ());\n\n\t\t\t\tif ((parameters[i].ModFlags & Parameter.Modifier.RefOutMask) != 0)\n\t\t\t\t\tsb.Append (\"@\");\n\t\t\t}\n\t\t\tsb.Append (\")\");\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\treturn GetSignatureForError (\"(\", \")\", Count);\n\t\t}\n\n\t\tpublic string GetSignatureForError (string start, string end, int count)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder (start);\n\t\t\tfor (int i = 0; i < count; ++i) {\n\t\t\t\tif (i != 0)\n\t\t\t\t\tsb.Append (\", \");\n\t\t\t\tsb.Append (ParameterDesc (i));\n\t\t\t}\n\t\t\tsb.Append (end);\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic bool HasArglist {\n\t\t\tget { return has_arglist; }\n\t\t}\n\n\t\tpublic bool HasExtensionMethodType {\n\t\t\tget {\n\t\t\t\tif (Count == 0)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn FixedParameters [0].HasExtensionMethodModifier;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasParams {\n\t\t\tget { return has_params; }\n\t\t}\n\n\t\tpublic bool IsEmpty {\n\t\t\tget { return parameters.Length == 0; }\n\t\t}\n\n\t\tpublic AParametersCollection Inflate (TypeParameterInflator inflator)\n\t\t{\n\t\t\tTypeSpec[] inflated_types = null;\n\t\t\tbool default_value = false;\n\n\t\t\tfor (int i = 0; i < Count; ++i) {\n\t\t\t\tvar inflated_param = inflator.Inflate (types[i]);\n\t\t\t\tif (inflated_types == null) {\n\t\t\t\t\tif (inflated_param == types[i])\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tdefault_value |= FixedParameters[i].HasDefaultValue;\n\t\t\t\t\tinflated_types = new TypeSpec[types.Length];\n\t\t\t\t\tArray.Copy (types, inflated_types, types.Length);\n\t\t\t\t} else {\n\t\t\t\t\tif (inflated_param == types[i])\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tdefault_value |= FixedParameters[i].HasDefaultValue;\n\t\t\t\t}\n\n\t\t\t\tinflated_types[i] = inflated_param;\n\t\t\t}\n\n\t\t\tif (inflated_types == null)\n\t\t\t\treturn this;\n\n\t\t\tvar clone = (AParametersCollection) MemberwiseClone ();\n\t\t\tclone.types = inflated_types;\n\n\t\t\t//\n\t\t\t// Default expression is original expression from the parameter\n\t\t\t// declaration context which can be of nested enum in generic class type.\n\t\t\t// In such case we end up with expression type of G<T>.E and e.g. parameter\n\t\t\t// type of G<int>.E and conversion would fail without inflate in this\n\t\t\t// context.\n\t\t\t//\n\t\t\tif (default_value) {\n\t\t\t\tclone.parameters = new IParameterData[Count];\n\t\t\t\tfor (int i = 0; i < Count; ++i) {\n\t\t\t\t\tvar fp = FixedParameters[i];\n\t\t\t\t\tclone.FixedParameters[i] = fp;\n\n\t\t\t\t\tif (!fp.HasDefaultValue)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar expr = fp.DefaultValue;\n\n\t\t\t\t\tif (inflated_types[i] == expr.Type)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar c = expr as Constant;\n\t\t\t\t\tif (c != null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// It may fail we are inflating before type validation is done\n\t\t\t\t\t\t//\n\t\t\t\t\t\tc = Constant.ExtractConstantFromValue (inflated_types[i], c.GetValue (), expr.Location);\n\t\t\t\t\t\tif (c == null)\n\t\t\t\t\t\t\texpr = new DefaultValueExpression (new TypeExpression (inflated_types[i], expr.Location), expr.Location);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\texpr = c;\n\t\t\t\t\t} else if (expr is DefaultValueExpression)\n\t\t\t\t\t\texpr = new DefaultValueExpression (new TypeExpression (inflated_types[i], expr.Location), expr.Location);\n\n\t\t\t\t\tclone.FixedParameters[i] = new ParameterData (fp.Name, fp.ModFlags, expr);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn clone;\n\t\t}\n\n\t\tpublic string ParameterDesc (int pos)\n\t\t{\n\t\t\tif (types == null || types [pos] == null)\n\t\t\t\treturn ((Parameter)FixedParameters [pos]).GetSignatureForError ();\n\n\t\t\tstring type = types [pos].GetSignatureForError ();\n\t\t\tif (FixedParameters [pos].HasExtensionMethodModifier)\n\t\t\t\treturn \"this \" + type;\n\n\t\t\tvar mod = FixedParameters[pos].ModFlags & Parameter.Modifier.ModifierMask;\n\t\t\tif (mod == 0)\n\t\t\t\treturn type;\n\n\t\t\treturn Parameter.GetModifierSignature (mod) + \" \" + type;\n\t\t}\n\n\t\tpublic TypeSpec[] Types {\n\t\t\tget { return types; }\n\t\t\tset { types = value; }\n\t\t}\n\t}\n\n\t//\n\t// A collection of imported or resolved parameters\n\t//\n\tpublic class ParametersImported : AParametersCollection\n\t{\n\t\tpublic ParametersImported (IParameterData [] parameters, TypeSpec [] types, bool hasArglist, bool hasParams)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t\tthis.types = types;\n\t\t\tthis.has_arglist = hasArglist;\n\t\t\tthis.has_params = hasParams;\n\t\t}\n\n\t\tpublic ParametersImported (IParameterData[] param, TypeSpec[] types, bool hasParams)\n\t\t{\n\t\t\tthis.parameters = param;\n\t\t\tthis.types = types;\n\t\t\tthis.has_params = hasParams;\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Represents the methods parameters\n\t/// </summary>\n\tpublic class ParametersCompiled : AParametersCollection\n\t{\n\t\tpublic static readonly ParametersCompiled EmptyReadOnlyParameters = new ParametersCompiled ();\n\t\t\n\t\t// Used by C# 2.0 delegates\n\t\tpublic static readonly ParametersCompiled Undefined = new ParametersCompiled ();\n\n\t\tprivate ParametersCompiled ()\n\t\t{\n\t\t\tparameters = new Parameter [0];\n\t\t\ttypes = TypeSpec.EmptyTypes;\n\t\t}\n\n\t\tprivate ParametersCompiled (IParameterData[] parameters, TypeSpec[] types)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t    this.types = types;\n\t\t}\n\t\t\n\t\tpublic ParametersCompiled (params Parameter[] parameters)\n\t\t{\n\t\t\tif (parameters == null || parameters.Length == 0)\n\t\t\t\tthrow new ArgumentException (\"Use EmptyReadOnlyParameters\");\n\n\t\t\tthis.parameters = parameters;\n\t\t\tint count = parameters.Length;\n\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\thas_params |= (parameters [i].ModFlags & Parameter.Modifier.PARAMS) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic ParametersCompiled (Parameter [] parameters, bool has_arglist) :\n\t\t\tthis (parameters)\n\t\t{\n\t\t\tthis.has_arglist = has_arglist;\n\t\t}\n\t\t\n\t\tpublic static ParametersCompiled CreateFullyResolved (Parameter p, TypeSpec type)\n\t\t{\n\t\t\treturn new ParametersCompiled (new Parameter [] { p }, new TypeSpec [] { type });\n\t\t}\n\t\t\n\t\tpublic static ParametersCompiled CreateFullyResolved (Parameter[] parameters, TypeSpec[] types)\n\t\t{\n\t\t\treturn new ParametersCompiled (parameters, types);\n\t\t}\n\n\t\tpublic static ParametersCompiled Prefix (ParametersCompiled parameters, Parameter p, TypeSpec type)\n\t\t{\n\t\t\tvar ptypes = new TypeSpec [parameters.Count + 1];\n\t\t\tptypes [0] = type;\n\t\t\tArray.Copy (parameters.Types, 0, ptypes, 1, parameters.Count);\n\n\t\t\tvar param = new Parameter [ptypes.Length];\n\t\t\tparam [0] = p;\n\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\tvar pi = parameters [i];\n\t\t\t\tparam [i + 1] = pi;\n\t\t\t\tpi.SetIndex (i + 1);\n\t\t\t}\n\n\t\t\treturn ParametersCompiled.CreateFullyResolved (param, ptypes);\n\t\t}\n\n\t\t//\n\t\t// TODO: This does not fit here, it should go to different version of AParametersCollection\n\t\t// as the underlying type is not Parameter and some methods will fail to cast\n\t\t//\n\t\tpublic static AParametersCollection CreateFullyResolved (params TypeSpec[] types)\n\t\t{\n\t\t\tvar pd = new ParameterData [types.Length];\n\t\t\tfor (int i = 0; i < pd.Length; ++i)\n\t\t\t\tpd[i] = new ParameterData (null, Parameter.Modifier.NONE, null);\n\n\t\t\treturn new ParametersCompiled (pd, types);\n\t\t}\n\n\t\tpublic static ParametersCompiled CreateImplicitParameter (FullNamedExpression texpr, Location loc)\n\t\t{\n\t\t\treturn new ParametersCompiled (\n\t\t\t\tnew[] { new Parameter (texpr, \"value\", Parameter.Modifier.NONE, null, loc) },\n\t\t\t\tnull);\n\t\t}\n\n\t\tpublic void CheckConstraints (IMemberContext mc)\n\t\t{\n\t\t\tforeach (Parameter p in parameters) {\n\t\t\t\t//\n\t\t\t\t// It's null for compiler generated types or special types like __arglist\n\t\t\t\t//\n\t\t\t\tif (p.TypeExpression != null)\n\t\t\t\t\tConstraintChecker.Check (mc, p.Type, p.TypeExpression.Location);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns non-zero value for equal CLS parameter signatures\n\t\t//\n\t\tpublic static int IsSameClsSignature (AParametersCollection a, AParametersCollection b)\n\t\t{\n\t\t\tint res = 0;\n\n\t\t\tfor (int i = 0; i < a.Count; ++i) {\n\t\t\t\tvar a_type = a.Types[i];\n\t\t\t\tvar b_type = b.Types[i];\n\t\t\t\tif (TypeSpecComparer.Override.IsEqual (a_type, b_type)) {\n\t\t\t\t\tif ((a.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) != (b.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask))\n\t\t\t\t\t\tres |= 1;\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar ac_a = a_type as ArrayContainer;\n\t\t\t\tif (ac_a == null)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tvar ac_b = b_type as ArrayContainer;\n\t\t\t\tif (ac_b == null)\n\t\t\t\t\treturn 0;\n\n\t\t\t\tif (ac_a.Element is ArrayContainer || ac_b.Element is ArrayContainer) {\n\t\t\t\t\tres |= 2;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (ac_a.Rank != ac_b.Rank && TypeSpecComparer.Override.IsEqual (ac_a.Element, ac_b.Element)) {\n\t\t\t\t\tres |= 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic static ParametersCompiled MergeGenerated (CompilerContext ctx, ParametersCompiled userParams, bool checkConflicts, Parameter compilerParams, TypeSpec compilerTypes)\n\t\t{\n\t\t\treturn MergeGenerated (ctx, userParams, checkConflicts,\n\t\t\t\tnew Parameter [] { compilerParams },\n\t\t\t\tnew TypeSpec [] { compilerTypes });\n\t\t}\n\n\t\t//\n\t\t// Use this method when you merge compiler generated parameters with user parameters\n\t\t//\n\t\tpublic static ParametersCompiled MergeGenerated (CompilerContext ctx, ParametersCompiled userParams, bool checkConflicts, Parameter[] compilerParams, TypeSpec[] compilerTypes)\n\t\t{\n\t\t\tParameter[] all_params = new Parameter [userParams.Count + compilerParams.Length];\n\t\t\tuserParams.FixedParameters.CopyTo(all_params, 0);\n\n\t\t\tTypeSpec [] all_types;\n\t\t\tif (userParams.types != null) {\n\t\t\t\tall_types = new TypeSpec [all_params.Length];\n\t\t\t\tuserParams.Types.CopyTo (all_types, 0);\n\t\t\t} else {\n\t\t\t\tall_types = null;\n\t\t\t}\n\n\t\t\tint last_filled = userParams.Count;\n\t\t\tint index = 0;\n\t\t\tforeach (Parameter p in compilerParams) {\n\t\t\t\tfor (int i = 0; i < last_filled; ++i) {\n\t\t\t\t\twhile (p.Name == all_params [i].Name) {\n\t\t\t\t\t\tif (checkConflicts && i < userParams.Count) {\n\t\t\t\t\t\t\tctx.Report.Error (316, userParams[i].Location,\n\t\t\t\t\t\t\t\t\"The parameter name `{0}' conflicts with a compiler generated name\", p.Name);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp.Name = '_' + p.Name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tall_params [last_filled] = p;\n\t\t\t\tif (all_types != null)\n\t\t\t\t\tall_types [last_filled] = compilerTypes [index++];\n\t\t\t\t++last_filled;\n\t\t\t}\n\t\t\t\n\t\t\tParametersCompiled parameters = new ParametersCompiled (all_params, all_types);\n\t\t\tparameters.has_params = userParams.has_params;\n\t\t\treturn parameters;\n\t\t}\n\n\t\t//\n\t\t// Parameters checks for members which don't have a block\n\t\t//\n\t\tpublic void CheckParameters (MemberCore member)\n\t\t{\n\t\t\tfor (int i = 0; i < parameters.Length; ++i) {\n\t\t\t\tvar name = parameters[i].Name;\n\t\t\t\tfor (int ii = i + 1; ii < parameters.Length; ++ii) {\n\t\t\t\t\tif (parameters[ii].Name == name)\n\t\t\t\t\t\tthis[ii].Error_DuplicateName (member.Compiler.Report);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Resolve (IMemberContext ec)\n\t\t{\n\t\t\tif (types != null)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\ttypes = new TypeSpec [Count];\n\t\t\t\n\t\t\tbool ok = true;\n\t\t\tParameter p;\n\t\t\tfor (int i = 0; i < FixedParameters.Length; ++i) {\n\t\t\t\tp = this [i];\n\t\t\t\tTypeSpec t = p.Resolve (ec, i);\n\t\t\t\tif (t == null) {\n\t\t\t\t\tok = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttypes [i] = t;\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tpublic void ResolveDefaultValues (MemberCore m)\n\t\t{\n\t\t\tResolveContext rc = null;\n\t\t\tfor (int i = 0; i < parameters.Length; ++i) {\n\t\t\t\tParameter p = (Parameter) parameters [i];\n\n\t\t\t\t//\n\t\t\t\t// Try not to enter default values resolution if there are is not any default value possible\n\t\t\t\t//\n\t\t\t\tif (p.HasDefaultValue || p.OptAttributes != null) {\n\t\t\t\t\tif (rc == null)\n\t\t\t\t\t\trc = new ResolveContext (m);\n\n\t\t\t\t\tp.ResolveDefaultValue (rc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Define each type attribute (in/out/ref) and\n\t\t// the argument names.\n\t\tpublic void ApplyAttributes (IMemberContext mc, MethodBase builder)\n\t\t{\n\t\t\tif (Count == 0)\n\t\t\t\treturn;\n\n\t\t\tMethodBuilder mb = builder as MethodBuilder;\n\t\t\tConstructorBuilder cb = builder as ConstructorBuilder;\n\t\t\tvar pa = mc.Module.PredefinedAttributes;\n\n\t\t\tfor (int i = 0; i < Count; i++) {\n\t\t\t\tthis [i].ApplyAttributes (mb, cb, i + 1, pa);\n\t\t\t}\n\t\t}\n\n\t\tpublic void VerifyClsCompliance (IMemberContext ctx)\n\t\t{\n\t\t\tforeach (Parameter p in FixedParameters)\n\t\t\t\tp.IsClsCompliant (ctx);\n\t\t}\n\n\t\tpublic Parameter this [int pos] {\n\t\t\tget { return (Parameter) parameters [pos]; }\n\t\t}\n\n\t\tpublic Expression CreateExpressionTree (BlockContext ec, Location loc)\n\t\t{\n\t\t\tvar initializers = new ArrayInitializer (Count, loc);\n\t\t\tforeach (Parameter p in FixedParameters) {\n\t\t\t\t//\n\t\t\t\t// Each parameter expression is stored to local variable\n\t\t\t\t// to save some memory when referenced later.\n\t\t\t\t//\n\t\t\t\tStatementExpression se = new StatementExpression (p.CreateExpressionTreeVariable (ec), Location.Null);\n\t\t\t\tif (se.Resolve (ec)) {\n\t\t\t\t\tec.CurrentBlock.AddScopeStatement (new TemporaryVariableReference.Declarator (p.ExpressionTreeVariableReference ()));\n\t\t\t\t\tec.CurrentBlock.AddScopeStatement (se);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tinitializers.Add (p.ExpressionTreeVariableReference ());\n\t\t\t}\n\n\t\t\treturn new ArrayCreation (\n\t\t\t\tParameter.ResolveParameterExpressionType (ec, loc),\n\t\t\t\tinitializers, loc);\n\t\t}\n\n\t\tpublic ParametersCompiled Clone ()\n\t\t{\n\t\t\tParametersCompiled p = (ParametersCompiled) MemberwiseClone ();\n\n\t\t\tp.parameters = new IParameterData [parameters.Length];\n\t\t\tfor (int i = 0; i < Count; ++i)\n\t\t\t\tp.parameters [i] = this [i].Clone ();\n\n\t\t\treturn p;\n\t\t}\n\t}\n\n\t//\n\t// Default parameter value expression. We need this wrapper to handle\n\t// default parameter values of folded constants (e.g. indexer parameters).\n\t// The expression is resolved only once but applied to two methods which\n\t// both share reference to this expression and we ensure that resolving\n\t// this expression always returns same instance\n\t//\n\tpublic class DefaultParameterValueExpression : CompositeExpression\n\t{\n\t\tpublic DefaultParameterValueExpression (Expression expr)\n\t\t\t: base (expr)\n\t\t{\n\t\t}\n\n\t\tpublic void Resolve (ResolveContext rc, Parameter p)\n\t\t{\n\t\t\tvar expr = Resolve (rc);\n\t\t\tif (expr == null) {\n\t\t\t\tthis.expr = ErrorExpression.Instance;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\texpr = Child;\n\n\t\t\tif (!(expr is Constant || expr is DefaultValueExpression || (expr is New && ((New) expr).IsDefaultStruct))) {\n\t\t\t\tif (!(expr is ErrorExpression)) {\n\t\t\t\t\trc.Report.Error (1736, Location,\n\t\t\t\t\t\t\"The expression being assigned to optional parameter `{0}' must be a constant or default value\",\n\t\t\t\t\t\tp.Name);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar parameter_type = p.Type;\n\t\t\tif (type == parameter_type)\n\t\t\t\treturn;\n\n\t\t\tvar res = Convert.ImplicitConversionStandard (rc, expr, parameter_type, Location);\n\t\t\tif (res != null) {\n\t\t\t\tif (parameter_type.IsNullableType && res is Nullable.Wrap) {\n\t\t\t\t\tNullable.Wrap wrap = (Nullable.Wrap) res;\n\t\t\t\t\tres = wrap.Child;\n\t\t\t\t\tif (!(res is Constant)) {\n\t\t\t\t\t\trc.Report.Error (1770, Location,\n\t\t\t\t\t\t\t\"The expression being assigned to nullable optional parameter `{0}' must be default value\",\n\t\t\t\t\t\t\tp.Name);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!expr.IsNull && TypeSpec.IsReferenceType (parameter_type) && parameter_type.BuiltinType != BuiltinTypeSpec.Type.String) {\n\t\t\t\t\trc.Report.Error (1763, Location,\n\t\t\t\t\t\t\"Optional parameter `{0}' of type `{1}' can only be initialized with `null'\",\n\t\t\t\t\t\tp.Name, parameter_type.GetSignatureForError ());\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.expr = res;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trc.Report.Error (1750, Location,\n\t\t\t\t\"Optional parameter expression of type `{0}' cannot be converted to parameter type `{1}'\",\n\t\t\t\ttype.GetSignatureForError (), parameter_type.GetSignatureForError ());\n\n\t\t\tthis.expr = ErrorExpression.Instance;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/pending.cs",
    "content": "//\n// pending.cs: Pending method implementation\n//\n// Authors:\n//   Miguel de Icaza (miguel@gnu.org)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2008 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\n\tstruct TypeAndMethods {\n\t\tpublic TypeSpec          type;\n\t\tpublic IList<MethodSpec> methods;\n\n\t\t// \n\t\t// Whether it is optional, this is used to allow the explicit/implicit\n\t\t// implementation when a base class already implements an interface. \n\t\t//\n\t\t// For example:\n\t\t//\n\t\t// class X : IA { }  class Y : X, IA { IA.Explicit (); }\n\t\t//\n\t\tpublic bool          optional;\n\t\t\t\t\n\t\t//\n\t\t// This flag on the method says `We found a match, but\n\t\t// because it was private, we could not use the match\n\t\t//\n\t\tpublic MethodData [] found;\n\n\t\t// If a method is defined here, then we always need to\n\t\t// create a proxy for it.  This is used when implementing\n\t\t// an interface's indexer with a different IndexerName.\n\t\tpublic MethodSpec [] need_proxy;\n\t}\n\n\tstruct ProxyMethodContext : IMemberContext\n\t{\n\t\treadonly TypeContainer container;\n\n\t\tpublic ProxyMethodContext (TypeContainer container)\n\t\t{\n\t\t\tthis.container = container;\n\t\t}\n\n\t\tpublic TypeSpec CurrentType {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameters CurrentTypeParameters {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic MemberCore CurrentMemberDefinition {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsObsolete {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsUnsafe {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic ModuleContainer Module {\n\t\t\tget {\n\t\t\t\treturn container.Module;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic FullNamedExpression LookupNamespaceAlias (string name)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\n\tpublic class PendingImplementation\n\t{\n\t\t/// <summary>\n\t\t///   The container for this PendingImplementation\n\t\t/// </summary>\n\t\treadonly TypeDefinition container;\n\t\t\n\t\t/// <summary>\n\t\t///   This is the array of TypeAndMethods that describes the pending implementations\n\t\t///   (both interfaces and abstract methods in base class)\n\t\t/// </summary>\n\t\tTypeAndMethods [] pending_implementations;\n\n\t\tPendingImplementation (TypeDefinition container, MissingInterfacesInfo[] missing_ifaces, MethodSpec[] abstract_methods, int total)\n\t\t{\n\t\t\tvar type_builder = container.Definition;\n\t\t\t\n\t\t\tthis.container = container;\n\t\t\tpending_implementations = new TypeAndMethods [total];\n\n\t\t\tint i = 0;\n\t\t\tif (abstract_methods != null) {\n\t\t\t\tint count = abstract_methods.Length;\n\t\t\t\tpending_implementations [i].methods = new MethodSpec [count];\n\t\t\t\tpending_implementations [i].need_proxy = new MethodSpec [count];\n\n\t\t\t\tpending_implementations [i].methods = abstract_methods;\n\t\t\t\tpending_implementations [i].found = new MethodData [count];\n\t\t\t\tpending_implementations [i].type = type_builder;\n\t\t\t\t++i;\n\t\t\t}\n\n\t\t\tforeach (MissingInterfacesInfo missing in missing_ifaces) {\n\t\t\t\tvar iface = missing.Type;\n\t\t\t\tvar mi = MemberCache.GetInterfaceMethods (iface);\n\n\t\t\t\tint count = mi.Count;\n\t\t\t\tpending_implementations [i].type = iface;\n\t\t\t\tpending_implementations [i].optional = missing.Optional;\n\t\t\t\tpending_implementations [i].methods = mi;\n\t\t\t\tpending_implementations [i].found = new MethodData [count];\n\t\t\t\tpending_implementations [i].need_proxy = new MethodSpec [count];\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tReport Report {\n\t\t\tget {\n\t\t\t\treturn container.Module.Compiler.Report;\n\t\t\t}\n\t\t}\n\n\t\tstruct MissingInterfacesInfo {\n\t\t\tpublic TypeSpec Type;\n\t\t\tpublic bool Optional;\n\n\t\t\tpublic MissingInterfacesInfo (TypeSpec t)\n\t\t\t{\n\t\t\t\tType = t;\n\t\t\t\tOptional = false;\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly MissingInterfacesInfo [] EmptyMissingInterfacesInfo = new MissingInterfacesInfo [0];\n\t\t\n\t\tstatic MissingInterfacesInfo [] GetMissingInterfaces (TypeDefinition container)\n\t\t{\n\t\t\t//\n\t\t\t// Interfaces will return all interfaces that the container\n\t\t\t// implements including any inherited interfaces\n\t\t\t//\n\t\t\tvar impl = container.Definition.Interfaces;\n\n\t\t\tif (impl == null || impl.Count == 0)\n\t\t\t\treturn EmptyMissingInterfacesInfo;\n\n\t\t\tvar ret = new MissingInterfacesInfo[impl.Count];\n\n\t\t\tfor (int i = 0; i < ret.Length; i++)\n\t\t\t\tret [i] = new MissingInterfacesInfo (impl [i]);\n\n\t\t\t// we really should not get here because Object doesnt implement any\n\t\t\t// interfaces. But it could implement something internal, so we have\n\t\t\t// to handle that case.\n\t\t\tif (container.BaseType == null)\n\t\t\t\treturn ret;\n\t\t\t\n\t\t\tvar base_impls = container.BaseType.Interfaces;\n\t\t\tif (base_impls != null) {\n\t\t\t\tforeach (TypeSpec t in base_impls) {\n\t\t\t\t\tfor (int i = 0; i < ret.Length; i++) {\n\t\t\t\t\t\tif (t == ret[i].Type) {\n\t\t\t\t\t\t\tret[i].Optional = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\t\t\n\t\t//\n\t\t// Factory method: if there are pending implementation methods, we return a PendingImplementation\n\t\t// object, otherwise we return null.\n\t\t//\n\t\t// Register method implementations are either abstract methods\n\t\t// flagged as such on the base class or interface methods\n\t\t//\n\t\tstatic public PendingImplementation GetPendingImplementations (TypeDefinition container)\n\t\t{\n\t\t\tTypeSpec b = container.BaseType;\n\n\t\t\tvar missing_interfaces = GetMissingInterfaces (container);\n\n\t\t\t//\n\t\t\t// If we are implementing an abstract class, and we are not\n\t\t\t// ourselves abstract, and there are abstract methods (C# allows\n\t\t\t// abstract classes that have no abstract methods), then allocate\n\t\t\t// one slot.\n\t\t\t//\n\t\t\t// We also pre-compute the methods.\n\t\t\t//\n\t\t\tbool implementing_abstract = ((b != null) && b.IsAbstract && (container.ModFlags & Modifiers.ABSTRACT) == 0);\n\t\t\tMethodSpec[] abstract_methods = null;\n\n\t\t\tif (implementing_abstract){\n\t\t\t\tvar am = MemberCache.GetNotImplementedAbstractMethods (b);\n\n\t\t\t\tif (am == null) {\n\t\t\t\t\timplementing_abstract = false;\n\t\t\t\t} else {\n\t\t\t\t\tabstract_methods = new MethodSpec[am.Count];\n\t\t\t\t\tam.CopyTo (abstract_methods, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint total = missing_interfaces.Length +  (implementing_abstract ? 1 : 0);\n\t\t\tif (total == 0)\n\t\t\t\treturn null;\n\n\t\t\tvar pending = new PendingImplementation (container, missing_interfaces, abstract_methods, total);\n\n\t\t\t//\n\t\t\t// check for inherited conflicting methods\n\t\t\t//\n\t\t\tforeach (var p in pending.pending_implementations) {\n\t\t\t\t//\n\t\t\t\t// It can happen for generic interfaces only\n\t\t\t\t//\n\t\t\t\tif (!p.type.IsGeneric)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//\n\t\t\t\t// CLR does not distinguishes between ref and out\n\t\t\t\t//\n\t\t\t\tfor (int i = 0; i < p.methods.Count; ++i) {\n\t\t\t\t\tMethodSpec compared_method = p.methods[i];\n\t\t\t\t\tif (compared_method.Parameters.IsEmpty)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tfor (int ii = i + 1; ii < p.methods.Count; ++ii) {\n\t\t\t\t\t\tMethodSpec tested_method = p.methods[ii];\n\t\t\t\t\t\tif (compared_method.Name != tested_method.Name)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (p.type != tested_method.DeclaringType)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!TypeSpecComparer.Override.IsSame (compared_method.Parameters.Types, tested_method.Parameters.Types))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tbool exact_match = true;\n\t\t\t\t\t\tbool ref_only_difference = false;\n\t\t\t\t\t\tvar cp = compared_method.Parameters.FixedParameters;\n\t\t\t\t\t\tvar tp = tested_method.Parameters.FixedParameters;\n\n\t\t\t\t\t\tfor (int pi = 0; pi < cp.Length; ++pi) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// First check exact modifiers match\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tif ((cp[pi].ModFlags & Parameter.Modifier.RefOutMask) == (tp[pi].ModFlags & Parameter.Modifier.RefOutMask))\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (((cp[pi].ModFlags | tp[pi].ModFlags) & Parameter.Modifier.RefOutMask) == Parameter.Modifier.RefOutMask) {\n\t\t\t\t\t\t\t\tref_only_difference = true;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\texact_match = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!exact_match || !ref_only_difference)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tpending.Report.SymbolRelatedToPreviousError (compared_method);\n\t\t\t\t\t\tpending.Report.SymbolRelatedToPreviousError (tested_method);\n\t\t\t\t\t\tpending.Report.Error (767, container.Location,\n\t\t\t\t\t\t\t\"Cannot implement interface `{0}' with the specified type parameters because it causes method `{1}' to differ on parameter modifiers only\",\n\t\t\t\t\t\t\tp.type.GetDefinition().GetSignatureForError (), compared_method.GetSignatureForError ());\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn pending;\n\t\t}\n\n\t\tpublic enum Operation {\n\t\t\t//\n\t\t\t// If you change this, review the whole InterfaceMethod routine as there\n\t\t\t// are a couple of assumptions on these three states\n\t\t\t//\n\t\t\tLookup, ClearOne, ClearAll\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Whether the specified method is an interface method implementation\n\t\t/// </summary>\n\t\tpublic MethodSpec IsInterfaceMethod (MemberName name, TypeSpec ifaceType, MethodData method, out MethodSpec ambiguousCandidate, ref bool optional)\n\t\t{\n\t\t\treturn InterfaceMethod (name, ifaceType, method, Operation.Lookup, out ambiguousCandidate, ref optional);\n\t\t}\n\n\t\tpublic void ImplementMethod (MemberName name, TypeSpec ifaceType, MethodData method, bool clear_one, out MethodSpec ambiguousCandidate, ref bool optional)\n\t\t{\n\t\t\tInterfaceMethod (name, ifaceType, method, clear_one ? Operation.ClearOne : Operation.ClearAll, out ambiguousCandidate, ref optional);\n\t\t}\n\n\t\t/// <remarks>\n\t\t///   If a method in Type `t' (or null to look in all interfaces\n\t\t///   and the base abstract class) with name `Name', return type `ret_type' and\n\t\t///   arguments `args' implements an interface, this method will\n\t\t///   return the MethodInfo that this method implements.\n\t\t///\n\t\t///   If `name' is null, we operate solely on the method's signature.  This is for\n\t\t///   instance used when implementing indexers.\n\t\t///\n\t\t///   The `Operation op' controls whether to lookup, clear the pending bit, or clear\n\t\t///   all the methods with the given signature.\n\t\t///\n\t\t///   The `MethodInfo need_proxy' is used when we're implementing an interface's\n\t\t///   indexer in a class.  If the new indexer's IndexerName does not match the one\n\t\t///   that was used in the interface, then we always need to create a proxy for it.\n\t\t///\n\t\t/// </remarks>\n\t\tpublic MethodSpec InterfaceMethod (MemberName name, TypeSpec iType, MethodData method, Operation op, out MethodSpec ambiguousCandidate, ref bool optional)\n\t\t{\n\t\t\tambiguousCandidate = null;\n\n\t\t\tif (pending_implementations == null)\n\t\t\t\treturn null;\n\n\t\t\tTypeSpec ret_type = method.method.ReturnType;\n\t\t\tParametersCompiled args = method.method.ParameterInfo;\n\t\t\tbool is_indexer = method.method is Indexer.SetIndexerMethod || method.method is Indexer.GetIndexerMethod;\n\t\t\tMethodSpec m;\n\n\t\t\tforeach (TypeAndMethods tm in pending_implementations){\n\t\t\t\tif (!(iType == null || tm.type == iType))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tint method_count = tm.methods.Count;\n\t\t\t\tfor (int i = 0; i < method_count; i++){\n\t\t\t\t\tm = tm.methods [i];\n\n\t\t\t\t\tif (m == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (is_indexer) {\n\t\t\t\t\t\tif (!m.IsAccessor || m.Parameters.IsEmpty)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (name.Name != m.Name)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (m.Arity != name.Arity)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (m.Parameters, args))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (m.ReturnType, ret_type)) {\n\t\t\t\t\t\ttm.found[i] = method;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// `need_proxy' is not null when we're implementing an\n\t\t\t\t\t// interface indexer and this is Clear(One/All) operation.\n\t\t\t\t\t//\n\t\t\t\t\t// If `name' is null, then we do a match solely based on the\n\t\t\t\t\t// signature and not on the name (this is done in the Lookup\n\t\t\t\t\t// for an interface indexer).\n\t\t\t\t\t//\n\t\t\t\t\tif (op != Operation.Lookup) {\n\t\t\t\t\t\tif (m.IsAccessor != method.method.IsAccessor)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// If `t != null', then this is an explicitly interface\n\t\t\t\t\t\t// implementation and we can always clear the method.\n\t\t\t\t\t\t// `need_proxy' is not null if we're implementing an\n\t\t\t\t\t\t// interface indexer.  In this case, we need to create\n\t\t\t\t\t\t// a proxy if the implementation's IndexerName doesn't\n\t\t\t\t\t\t// match the IndexerName in the interface.\n\t\t\t\t\t\tif (m.DeclaringType.IsInterface && iType == null && name.Name != m.Name) {\t// TODO: This is very expensive comparison\n\t\t\t\t\t\t\ttm.need_proxy[i] = method.method.Spec;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttm.methods[i] = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttm.found [i] = method;\n\t\t\t\t\t\toptional = tm.optional;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (op == Operation.Lookup && name.ExplicitInterface != null && ambiguousCandidate == null) {\n\t\t\t\t\t\tambiguousCandidate = m;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//\n\t\t\t\t\t// Lookups and ClearOne return\n\t\t\t\t\t//\n\t\t\t\t\tif (op != Operation.ClearAll)\n\t\t\t\t\t\treturn m;\n\t\t\t\t}\n\n\t\t\t\t// If a specific type was requested, we can stop now.\n\t\t\t\tif (tm.type == iType)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tm = ambiguousCandidate;\n\t\t\tambiguousCandidate = null;\n\t\t\treturn m;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   C# allows this kind of scenarios:\n\t\t///   interface I { void M (); }\n\t\t///   class X { public void M (); }\n\t\t///   class Y : X, I { }\n\t\t///\n\t\t///   For that case, we create an explicit implementation function\n\t\t///   I.M in Y.\n\t\t/// </summary>\n\t\tvoid DefineProxy (TypeSpec iface, MethodSpec base_method, MethodSpec iface_method)\n\t\t{\n\t\t\t// TODO: Handle nested iface names\n\t\t\tstring proxy_name;\n\t\t\tvar ns = iface.MemberDefinition.Namespace;\n\t\t\tif (string.IsNullOrEmpty (ns))\n\t\t\t\tproxy_name = iface.MemberDefinition.Name + \".\" + iface_method.Name;\n\t\t\telse\n\t\t\t\tproxy_name = ns + \".\" + iface.MemberDefinition.Name + \".\" + iface_method.Name;\n\n\t\t\tvar param = iface_method.Parameters;\n\n\t\t\tMethodBuilder proxy = container.TypeBuilder.DefineMethod (\n\t\t\t\tproxy_name,\n\t\t\t\tMethodAttributes.Private |\n\t\t\t\tMethodAttributes.HideBySig |\n\t\t\t\tMethodAttributes.NewSlot |\n\t\t\t\tMethodAttributes.CheckAccessOnOverride |\n\t\t\t\tMethodAttributes.Virtual | MethodAttributes.Final,\n\t\t\t\tCallingConventions.Standard | CallingConventions.HasThis,\n\t\t\t\tbase_method.ReturnType.GetMetaInfo (), param.GetMetaInfo ());\n\n\t\t\tif (iface_method.IsGeneric) {\n\t\t\t\tvar gnames = iface_method.GenericDefinition.TypeParameters.Select (l => l.Name).ToArray ();\n\t\t\t\tproxy.DefineGenericParameters (gnames);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < param.Count; i++) {\n\t\t\t\tstring name = param.FixedParameters [i].Name;\n\t\t\t\tParameterAttributes attr = ParametersCompiled.GetParameterAttribute (param.FixedParameters [i].ModFlags);\n\t\t\t\tproxy.DefineParameter (i + 1, attr, name);\n\t\t\t}\n\n\t\t\tint top = param.Count;\n\t\t\tvar ec = new EmitContext (new ProxyMethodContext (container), proxy.GetILGenerator (), null, null);\n\t\t\tec.EmitThis ();\n\t\t\t// TODO: GetAllParametersArguments\n\t\t\tfor (int i = 0; i < top; i++)\n\t\t\t\tec.EmitArgumentLoad (i);\n\n\t\t\tec.Emit (OpCodes.Call, base_method);\n\t\t\tec.Emit (OpCodes.Ret);\n\n\t\t\tcontainer.TypeBuilder.DefineMethodOverride (proxy, (MethodInfo) iface_method.GetMetaInfo ());\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///   This function tells whether one of our base classes implements\n\t\t///   the given method (which turns out, it is valid to have an interface\n\t\t///   implementation in a base\n\t\t/// </summary>\n\t\tbool BaseImplements (TypeSpec iface_type, MethodSpec mi, out MethodSpec base_method)\n\t\t{\n\t\t\tbase_method = null;\n\t\t\tvar base_type = container.BaseType;\n\n\t\t\t//\n\t\t\t// Setup filter with no return type to give better error message\n\t\t\t// about mismatch at return type when the check bellow rejects them\n\t\t\t//\n\t\t\tvar parameters = mi.Parameters;\n\t\t\tMethodSpec close_match = null;\n\n\t\t\twhile (true) {\n\t\t\t\tvar candidates = MemberCache.FindMembers (base_type, mi.Name, false);\n\t\t\t\tif (candidates == null) {\n\t\t\t\t\tbase_method = close_match;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tMethodSpec similar_candidate = null;\n\t\t\t\tforeach (var candidate in candidates) {\n\t\t\t\t\tif (candidate.Kind != MemberKind.Method)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (candidate.Arity != mi.Arity)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar candidate_param = ((MethodSpec) candidate).Parameters;\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (parameters.Types, candidate_param.Types))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tbool modifiers_match = true;\n\t\t\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// First check exact ref/out match\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((parameters.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) == (candidate_param.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tmodifiers_match = false;\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Different in ref/out only\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif ((parameters.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) != (candidate_param.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask)) {\n\t\t\t\t\t\t\tif (similar_candidate == null) {\n\t\t\t\t\t\t\t\tif (!candidate.IsPublic)\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (mi.ReturnType, ((MethodSpec) candidate).ReturnType))\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t// It's used for ref/out ambiguity overload check\n\t\t\t\t\t\t\t\tsimilar_candidate = (MethodSpec) candidate;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsimilar_candidate = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!modifiers_match)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t//\n\t\t\t\t\t// From this point the candidate is used for detailed error reporting\n\t\t\t\t\t// because it's very close match to what we are looking for\n\t\t\t\t\t//\n\t\t\t\t\tvar m = (MethodSpec) candidate;\n\n\t\t\t\t\tif (!m.IsPublic) {\n\t\t\t\t\t\tif (close_match == null)\n\t\t\t\t\t\t\tclose_match = m;\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!TypeSpecComparer.Override.IsEqual (mi.ReturnType, m.ReturnType)) {\n\t\t\t\t\t\tif (close_match == null)\n\t\t\t\t\t\t\tclose_match = m;\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tbase_method = m;\n\n\t\t\t\t\tif (mi.IsGeneric && !Method.CheckImplementingMethodConstraints (container, m, mi)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (base_method != null) {\n\t\t\t\t\tif (similar_candidate != null) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (similar_candidate);\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (mi);\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (container);\n\t\t\t\t\t\tReport.Warning (1956, 1, ((MemberCore) base_method.MemberDefinition).Location,\n\t\t\t\t\t\t\t\"The interface method `{0}' implementation is ambiguous between following methods: `{1}' and `{2}' in type `{3}'\",\n\t\t\t\t\t\t\tmi.GetSignatureForError (), base_method.GetSignatureForError (), similar_candidate.GetSignatureForError (), container.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbase_type = candidates[0].DeclaringType.BaseType;\n\t\t\t\tif (base_type == null) {\n\t\t\t\t\tbase_method = close_match;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!base_method.IsVirtual) {\n#if STATIC\n\t\t\t\tvar base_builder = base_method.GetMetaInfo () as MethodBuilder;\n\t\t\t\tif (base_builder != null) {\n\t\t\t\t\t//\n\t\t\t\t\t// We can avoid creating a proxy if base_method can be marked 'final virtual'. This can\n\t\t\t\t\t// be done for all methods from compiled assembly\n\t\t\t\t\t//\n\t\t\t\t\tbase_builder.__SetAttributes (base_builder.Attributes | MethodAttributes.Virtual | MethodAttributes.Final | MethodAttributes.NewSlot);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n#endif\n\t\t\t\tDefineProxy (iface_type, base_method, mi);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Verifies that any pending abstract methods or interface methods\n\t\t///   were implemented.\n\t\t/// </summary>\n\t\tpublic bool VerifyPendingMethods ()\n\t\t{\n\t\t\tint top = pending_implementations.Length;\n\t\t\tbool errors = false;\n\t\t\tint i;\n\t\t\t\n\t\t\tfor (i = 0; i < top; i++){\n\t\t\t\tTypeSpec type = pending_implementations [i].type;\n\n\t\t\t\tbool base_implements_type = type.IsInterface &&\n\t\t\t\t\tcontainer.BaseType != null &&\n\t\t\t\t\tcontainer.BaseType.ImplementsInterface (type, false);\n\n\t\t\t\tfor (int j = 0; j < pending_implementations [i].methods.Count; ++j) {\n\t\t\t\t\tvar mi = pending_implementations[i].methods[j];\n\t\t\t\t\tif (mi == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (type.IsInterface){\n\t\t\t\t\t\tvar need_proxy =\n\t\t\t\t\t\t\tpending_implementations [i].need_proxy [j];\n\n\t\t\t\t\t\tif (need_proxy != null) {\n\t\t\t\t\t\t\tDefineProxy (type, need_proxy, mi);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (pending_implementations [i].optional)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tMethodSpec candidate;\n\t\t\t\t\t\tif (base_implements_type || BaseImplements (type, mi, out candidate))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (candidate == null) {\n\t\t\t\t\t\t\tMethodData md = pending_implementations [i].found [j];\n\t\t\t\t\t\t\tif (md != null)\n\t\t\t\t\t\t\t\tcandidate = md.method.Spec;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (mi);\n\t\t\t\t\t\tif (candidate != null) {\n\t\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (candidate);\n\t\t\t\t\t\t\tif (candidate.IsStatic) {\n\t\t\t\t\t\t\t\tReport.Error (736, container.Location,\n\t\t\t\t\t\t\t\t\t\"`{0}' does not implement interface member `{1}' and the best implementing candidate `{2}' is static\",\n\t\t\t\t\t\t\t\t\tcontainer.GetSignatureForError (), mi.GetSignatureForError (), candidate.GetSignatureForError ());\n\t\t\t\t\t\t\t} else if ((candidate.Modifiers & Modifiers.PUBLIC) == 0) {\n\t\t\t\t\t\t\t\tReport.Error (737, container.Location,\n\t\t\t\t\t\t\t\t\t\"`{0}' does not implement interface member `{1}' and the best implementing candidate `{2}' is not public\",\n\t\t\t\t\t\t\t\t\tcontainer.GetSignatureForError (), mi.GetSignatureForError (), candidate.GetSignatureForError ());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tReport.Error (738, container.Location,\n\t\t\t\t\t\t\t\t\t\"`{0}' does not implement interface member `{1}' and the best implementing candidate `{2}' return type `{3}' does not match interface member return type `{4}'\",\n\t\t\t\t\t\t\t\t\tcontainer.GetSignatureForError (), mi.GetSignatureForError (), candidate.GetSignatureForError (),\n\t\t\t\t\t\t\t\t\tcandidate.ReturnType.GetSignatureForError (), mi.ReturnType.GetSignatureForError ());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tReport.Error (535, container.Location, \"`{0}' does not implement interface member `{1}'\",\n\t\t\t\t\t\t\t\tcontainer.GetSignatureForError (), mi.GetSignatureForError ());\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (mi);\n\t\t\t\t\t\tReport.Error (534, container.Location, \"`{0}' does not implement inherited abstract member `{1}'\",\n\t\t\t\t\t\t\tcontainer.GetSignatureForError (), mi.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t\terrors = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn errors;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs",
    "content": "//\n// property.cs: Property based handlers\n//\n// Authors: Miguel de Icaza (miguel@gnu.org)\n//          Martin Baulig (martin@ximian.com)\n//          Marek Safar (marek.safar@seznam.cz)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Mono.CompilerServices.SymbolWriter;\n\n#if NET_2_1\nusing XmlElement = System.Object;\n#endif\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp\n{\n\t// It is used as a base class for all property based members\n\t// This includes properties, indexers, and events\n\tpublic abstract class PropertyBasedMember : InterfaceMemberBase\n\t{\n\t\tprotected PropertyBasedMember (TypeDefinition parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod, allowed_mod, name, attrs)\n\t\t{\n\t\t}\n\n\t\tprotected void CheckReservedNameConflict (string prefix, MethodSpec accessor)\n\t\t{\n\t\t\tstring name;\n\t\t\tAParametersCollection parameters;\n\t\t\tif (accessor != null) {\n\t\t\t\tname = accessor.Name;\n\t\t\t\tparameters = accessor.Parameters;\n\t\t\t} else {\n\t\t\t\tname = prefix + ShortName;\n\t\t\t\tif (IsExplicitImpl)\n\t\t\t\t\tname = MemberName.Left + \".\" + name;\n\n\t\t\t\tif (this is Indexer) {\n\t\t\t\t\tparameters = ((Indexer) this).ParameterInfo;\n\t\t\t\t\tif (prefix[0] == 's') {\n\t\t\t\t\t\tvar data = new IParameterData[parameters.Count + 1];\n\t\t\t\t\t\tArray.Copy (parameters.FixedParameters, data, data.Length - 1);\n\t\t\t\t\t\tdata[data.Length - 1] = new ParameterData (\"value\", Parameter.Modifier.NONE);\n\t\t\t\t\t\tvar types = new TypeSpec[data.Length];\n\t\t\t\t\t\tArray.Copy (parameters.Types, types, data.Length - 1);\n\t\t\t\t\t\ttypes[data.Length - 1] = member_type;\n\n\t\t\t\t\t\tparameters = new ParametersImported (data, types, false);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (prefix[0] == 's')\n\t\t\t\t\t\tparameters = ParametersCompiled.CreateFullyResolved (new[] { member_type });\n\t\t\t\t\telse\n\t\t\t\t\t\tparameters = ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar conflict = MemberCache.FindMember (Parent.Definition,\n\t\t\t\tnew MemberFilter (name, 0, MemberKind.Method, parameters, null),\n\t\t\t\tBindingRestriction.DeclaredOnly | BindingRestriction.NoAccessors);\n\n\t\t\tif (conflict != null) {\n\t\t\t\tReport.SymbolRelatedToPreviousError (conflict);\n\t\t\t\tReport.Error (82, Location, \"A member `{0}' is already reserved\", conflict.GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tpublic abstract void PrepareEmit ();\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\tif (!MemberType.IsCLSCompliant ()) {\n\t\t\t\tReport.Warning (3003, 1, Location, \"Type of `{0}' is not CLS-compliant\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t}\n\n\tpublic class PropertySpec : MemberSpec, IInterfaceMemberSpec\n\t{\n\t\tPropertyInfo info;\n\t\tTypeSpec memberType;\n\t\tMethodSpec set, get;\n\n\t\tpublic PropertySpec (MemberKind kind, TypeSpec declaringType, IMemberDefinition definition, TypeSpec memberType, PropertyInfo info, Modifiers modifiers)\n\t\t\t: base (kind, declaringType, definition, modifiers)\n\t\t{\n\t\t\tthis.info = info;\n\t\t\tthis.memberType = memberType;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic MethodSpec Get {\n\t\t\tget {\n\t\t\t\treturn get;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tget = value;\n\t\t\t\tget.IsAccessor = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodSpec Set { \n\t\t\tget {\n\t\t\t\treturn set;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tset = value;\n\t\t\t\tset.IsAccessor = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasDifferentAccessibility {\n\t\t\tget {\n\t\t\t\treturn HasGet && HasSet && \n\t\t\t\t\t(Get.Modifiers & Modifiers.AccessibilityMask) != (Set.Modifiers & Modifiers.AccessibilityMask);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasGet {\n\t\t\tget {\n\t\t\t\treturn Get != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasSet {\n\t\t\tget {\n\t\t\t\treturn Set != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic PropertyInfo MetaInfo {\n\t\t\tget {\n\t\t\t\tif ((state & StateFlags.PendingMetaInflate) != 0)\n\t\t\t\t\tthrow new NotSupportedException ();\n\n\t\t\t\treturn info;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec MemberType {\n\t\t\tget {\n\t\t\t\treturn memberType;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar ps = (PropertySpec) base.InflateMember (inflator);\n\t\t\tps.memberType = inflator.Inflate (memberType);\n\t\t\treturn ps;\n\t\t}\n\n\t\tpublic override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\treturn memberType.ResolveMissingDependencies (this);\n\t\t}\n\t}\n\n\t//\n\t// Properties and Indexers both generate PropertyBuilders, we use this to share \n\t// their common bits.\n\t//\n\tabstract public class PropertyBase : PropertyBasedMember {\n\n\t\tpublic class GetMethod : PropertyMethod\n\t\t{\n\t\t\tstatic readonly string[] attribute_targets = new string [] { \"method\", \"return\" };\n\n\t\t\tinternal const string Prefix = \"get_\";\n\n\t\t\tpublic GetMethod (PropertyBase method, Modifiers modifiers, Attributes attrs, Location loc)\n\t\t\t\t: base (method, Prefix, modifiers, attrs, loc)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void Define (TypeContainer parent)\n\t\t\t{\n\t\t\t\tbase.Define (parent);\n\n\t\t\t\tSpec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, ParameterInfo, ModFlags);\n\n\t\t\t\tmethod_data = new MethodData (method, ModFlags, flags, this);\n\n\t\t\t\tmethod_data.Define (parent.PartialContainer, method.GetFullName (MemberName));\n\t\t\t}\n\n\t\t\tpublic override TypeSpec ReturnType {\n\t\t\t\tget {\n\t\t\t\t\treturn method.MemberType;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override ParametersCompiled ParameterInfo {\n\t\t\t\tget {\n\t\t\t\t\treturn ParametersCompiled.EmptyReadOnlyParameters;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override string[] ValidAttributeTargets {\n\t\t\t\tget {\n\t\t\t\t\treturn attribute_targets;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic class SetMethod : PropertyMethod {\n\n\t\t\tstatic readonly string[] attribute_targets = new string[] { \"method\", \"param\", \"return\" };\n\n\t\t\tinternal const string Prefix = \"set_\";\n\n\t\t\tprotected ParametersCompiled parameters;\n\n\t\t\tpublic SetMethod (PropertyBase method, Modifiers modifiers, ParametersCompiled parameters, Attributes attrs, Location loc)\n\t\t\t\t: base (method, Prefix, modifiers, attrs, loc)\n\t\t\t{\n\t\t\t\tthis.parameters = parameters;\n\t\t\t}\n\n\t\t\tprotected override void ApplyToExtraTarget (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t\t{\n\t\t\t\tif (a.Target == AttributeTargets.Parameter) {\n\t\t\t\t\tparameters[0].ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbase.ApplyToExtraTarget (a, ctor, cdata, pa);\n\t\t\t}\n\n\t\t\tpublic override ParametersCompiled ParameterInfo {\n\t\t\t    get {\n\t\t\t        return parameters;\n\t\t\t    }\n\t\t\t}\n\n\t\t\tpublic override void Define (TypeContainer parent)\n\t\t\t{\n\t\t\t\tparameters.Resolve (this);\n\t\t\t\t\n\t\t\t\tbase.Define (parent);\n\n\t\t\t\tSpec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, ParameterInfo, ModFlags);\n\n\t\t\t\tmethod_data = new MethodData (method, ModFlags, flags, this);\n\n\t\t\t\tmethod_data.Define (parent.PartialContainer, method.GetFullName (MemberName));\n\t\t\t}\n\n\t\t\tpublic override TypeSpec ReturnType {\n\t\t\t\tget {\n\t\t\t\t\treturn Parent.Compiler.BuiltinTypes.Void;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override string[] ValidAttributeTargets {\n\t\t\t\tget {\n\t\t\t\t\treturn attribute_targets;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly string[] attribute_targets = new string[] { \"property\" };\n\n\t\tpublic abstract class PropertyMethod : AbstractPropertyEventMethod\n\t\t{\n\t\t\tconst Modifiers AllowedModifiers =\n\t\t\t\tModifiers.PUBLIC |\n\t\t\t\tModifiers.PROTECTED |\n\t\t\t\tModifiers.INTERNAL |\n\t\t\t\tModifiers.PRIVATE;\n\t\t\n\t\t\tprotected readonly PropertyBase method;\n\t\t\tprotected MethodAttributes flags;\n\n\t\t\tpublic PropertyMethod (PropertyBase method, string prefix, Modifiers modifiers, Attributes attrs, Location loc)\n\t\t\t\t: base (method, prefix, attrs, loc)\n\t\t\t{\n\t\t\t\tthis.method = method;\n\t\t\t\tthis.ModFlags = ModifiersExtensions.Check (AllowedModifiers, modifiers, 0, loc, Report);\n\t\t\t\tthis.ModFlags |= (method.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE));\n\t\t\t}\n\n\t\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t\t{\n\t\t\t\tif (a.Type == pa.MethodImpl) {\n\t\t\t\t\tmethod.is_external_implementation = a.IsInternalCall ();\n\t\t\t\t}\n\n\t\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t}\n\n\t\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\t\tget {\n\t\t\t\t\treturn AttributeTargets.Method;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override bool IsClsComplianceRequired ()\n\t\t\t{\n\t\t\t\treturn method.IsClsComplianceRequired ();\n\t\t\t}\n\n\t\t\tpublic virtual void Define (TypeContainer parent)\n\t\t\t{\n\t\t\t\tvar container = parent.PartialContainer;\n\n\t\t\t\t//\n\t\t\t\t// Check for custom access modifier\n\t\t\t\t//\n\t\t\t\tif ((ModFlags & Modifiers.AccessibilityMask) == 0) {\n\t\t\t\t\tModFlags |= method.ModFlags;\n\t\t\t\t\tflags = method.flags;\n\t\t\t\t} else {\n\t\t\t\t\tif (container.Kind == MemberKind.Interface)\n\t\t\t\t\t\tReport.Error (275, Location, \"`{0}': accessibility modifiers may not be used on accessors in an interface\",\n\t\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\telse if ((method.ModFlags & Modifiers.ABSTRACT) != 0 && (ModFlags & Modifiers.PRIVATE) != 0) {\n\t\t\t\t\t\tReport.Error (442, Location, \"`{0}': abstract properties cannot have private accessors\", GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\tCheckModifiers (ModFlags);\n\t\t\t\t\tModFlags |= (method.ModFlags & (~Modifiers.AccessibilityMask));\n\t\t\t\t\tModFlags |= Modifiers.PROPERTY_CUSTOM;\n\t\t\t\t\tflags = ModifiersExtensions.MethodAttr (ModFlags);\n\t\t\t\t\tflags |= (method.flags & (~MethodAttributes.MemberAccessMask));\n\t\t\t\t}\n\n\t\t\t\tCheckAbstractAndExtern (block != null);\n\t\t\t\tCheckProtectedModifier ();\n\n\t\t\t\tif (block != null) {\n\t\t\t\t\tif (block.IsIterator)\n\t\t\t\t\t\tIterator.CreateIterator (this, Parent.PartialContainer, ModFlags);\n\n\t\t\t\t\tif (Compiler.Settings.WriteMetadataOnly)\n\t\t\t\t\t\tblock = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool HasCustomAccessModifier {\n\t\t\t\tget {\n\t\t\t\t\treturn (ModFlags & Modifiers.PROPERTY_CUSTOM) != 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic PropertyBase Property {\n\t\t\t\tget {\n\t\t\t\t\treturn method;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override ObsoleteAttribute GetAttributeObsolete ()\n\t\t\t{\n\t\t\t\treturn method.GetAttributeObsolete ();\n\t\t\t}\n\n\t\t\tpublic override string GetSignatureForError()\n\t\t\t{\n\t\t\t\treturn method.GetSignatureForError () + \".\" + prefix.Substring (0, 3);\n\t\t\t}\n\n\t\t\tvoid CheckModifiers (Modifiers modflags)\n\t\t\t{\n\t\t\t\tif (!ModifiersExtensions.IsRestrictedModifier (modflags & Modifiers.AccessibilityMask, method.ModFlags & Modifiers.AccessibilityMask)) {\n\t\t\t\t\tReport.Error (273, Location,\n\t\t\t\t\t\t\"The accessibility modifier of the `{0}' accessor must be more restrictive than the modifier of the property or indexer `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), method.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tPropertyMethod get, set, first;\n\t\tPropertyBuilder PropertyBuilder;\n\n\t\tprotected PropertyBase (TypeDefinition parent, FullNamedExpression type, Modifiers mod_flags, Modifiers allowed_mod, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod_flags, allowed_mod, name, attrs)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Property;\n\t\t\t}\n\t\t}\n\n\t\tpublic PropertyMethod AccessorFirst {\n\t\t\tget {\n\t\t\t\treturn first;\n\t\t\t}\n\t\t}\n\n\t\tpublic PropertyMethod AccessorSecond {\n\t\t\tget {\n\t\t\t\treturn first == get ? set : get;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Variance ExpectedMemberTypeVariance {\n\t\t\tget {\n\t\t\t\treturn (get != null && set != null) ?\n\t\t\t\t\tVariance.None : set == null ?\n\t\t\t\t\tVariance.Covariant :\n\t\t\t\t\tVariance.Contravariant;\n\t\t\t}\n\t\t}\n\n\t\tpublic PropertyMethod Get {\n\t\t\tget {\n\t\t\t\treturn get;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tget = value;\n\t\t\t\tif (first == null)\n\t\t\t\t\tfirst = value;\n\n\t\t\t\tParent.AddNameToContainer (get, get.MemberName.Basename);\n\t\t\t}\n\t\t}\n\n\t\tpublic PropertyMethod Set {\n\t\t\tget {\n\t\t\t\treturn set;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tset = value;\n\t\t\t\tif (first == null)\n\t\t\t\t\tfirst = value;\n\n\t\t\t\tParent.AddNameToContainer (set, set.MemberName.Basename);\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.HasSecurityAttribute) {\n\t\t\t\ta.Error_InvalidSecurityParent ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Type == pa.Dynamic) {\n\t\t\t\ta.Error_MisusedDynamicAttribute ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tPropertyBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tvoid CheckMissingAccessor (MemberKind kind, ParametersCompiled parameters, bool get)\n\t\t{\n\t\t\tif (IsExplicitImpl) {\n\t\t\t\tMemberFilter filter;\n\t\t\t\tif (kind == MemberKind.Indexer)\n\t\t\t\t\tfilter = new MemberFilter (MemberCache.IndexerNameAlias, 0, kind, parameters, null);\n\t\t\t\telse\n\t\t\t\t\tfilter = new MemberFilter (MemberName.Name, 0, kind, null, null);\n\n\t\t\t\tvar implementing = MemberCache.FindMember (InterfaceType, filter, BindingRestriction.DeclaredOnly) as PropertySpec;\n\n\t\t\t\tif (implementing == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar accessor = get ? implementing.Get : implementing.Set;\n\t\t\t\tif (accessor != null) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (accessor);\n\t\t\t\t\tReport.Error (551, Location, \"Explicit interface implementation `{0}' is missing accessor `{1}'\",\n\t\t\t\t\t\tGetSignatureForError (), accessor.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool CheckOverrideAgainstBase (MemberSpec base_member)\n\t\t{\n\t\t\tvar ok = base.CheckOverrideAgainstBase (base_member);\n\n\t\t\t//\n\t\t\t// Check base property accessors conflict\n\t\t\t//\n\t\t\tvar base_prop = (PropertySpec) base_member;\n\t\t\tif (Get == null) {\n\t\t\t\tif ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasGet && !base_prop.Get.IsAccessible (this)) {\n\t\t\t\t\t// TODO: Should be different error code but csc uses for some reason same\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_prop);\n\t\t\t\t\tReport.Error (545, Location,\n\t\t\t\t\t\t\"`{0}': cannot override because `{1}' does not have accessible get accessor\",\n\t\t\t\t\t\tGetSignatureForError (), base_prop.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!base_prop.HasGet) {\n\t\t\t\t\tif (ok) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_prop);\n\t\t\t\t\t\tReport.Error (545, Get.Location,\n\t\t\t\t\t\t\t\"`{0}': cannot override because `{1}' does not have an overridable get accessor\",\n\t\t\t\t\t\t\tGet.GetSignatureForError (), base_prop.GetSignatureForError ());\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (Get.HasCustomAccessModifier || base_prop.HasDifferentAccessibility) {\n\t\t\t\t\tif (!CheckAccessModifiers (Get, base_prop.Get)) {\n\t\t\t\t\t\tError_CannotChangeAccessModifiers (Get, base_prop.Get);\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Set == null) {\n\t\t\t\tif ((ModFlags & Modifiers.SEALED) != 0 && base_prop.HasSet && !base_prop.Set.IsAccessible (this)) {\n\t\t\t\t\t// TODO: Should be different error code but csc uses for some reason same\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_prop);\n\t\t\t\t\tReport.Error (546, Location,\n\t\t\t\t\t\t\"`{0}': cannot override because `{1}' does not have accessible set accessor\",\n\t\t\t\t\t\tGetSignatureForError (), base_prop.GetSignatureForError ());\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!base_prop.HasSet) {\n\t\t\t\t\tif (ok) {\n\t\t\t\t\t\tReport.SymbolRelatedToPreviousError (base_prop);\n\t\t\t\t\t\tReport.Error (546, Set.Location,\n\t\t\t\t\t\t\t\"`{0}': cannot override because `{1}' does not have an overridable set accessor\",\n\t\t\t\t\t\t\tSet.GetSignatureForError (), base_prop.GetSignatureForError ());\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (Set.HasCustomAccessModifier || base_prop.HasDifferentAccessibility) {\n\t\t\t\t\tif (!CheckAccessModifiers (Set, base_prop.Set)) {\n\t\t\t\t\t\tError_CannotChangeAccessModifiers (Set, base_prop.Set);\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((Set == null || !Set.HasCustomAccessModifier) && (Get == null || !Get.HasCustomAccessModifier)) {\n\t\t\t\tif (!CheckAccessModifiers (this, base_prop)) {\n\t\t\t\t\tError_CannotChangeAccessModifiers (this, base_prop);\n\t\t\t\t\tok = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tprotected override void DoMemberTypeDependentChecks ()\n\t\t{\n\t\t\tbase.DoMemberTypeDependentChecks ();\n\n\t\t\tIsTypePermitted ();\n\n\t\t\tif (MemberType.IsStatic)\n\t\t\t\tError_StaticReturnType ();\n\t\t}\n\n\t\tprotected override void DoMemberTypeIndependentChecks ()\n\t\t{\n\t\t\tbase.DoMemberTypeIndependentChecks ();\n\n\t\t\t//\n\t\t\t// Accessors modifiers check\n\t\t\t//\n\t\t\tif (AccessorSecond != null) {\n\t\t\t\tif ((Get.ModFlags & Modifiers.AccessibilityMask) != 0 && (Set.ModFlags & Modifiers.AccessibilityMask) != 0) {\n\t\t\t\t\tReport.Error (274, Location, \"`{0}': Cannot specify accessibility modifiers for both accessors of the property or indexer\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\t\t\t} else if ((ModFlags & Modifiers.OVERRIDE) == 0 && \n\t\t\t\t(Get == null && (Set.ModFlags & Modifiers.AccessibilityMask) != 0) ||\n\t\t\t\t(Set == null && (Get.ModFlags & Modifiers.AccessibilityMask) != 0)) {\n\t\t\t\tReport.Error (276, Location, \n\t\t\t\t\t      \"`{0}': accessibility modifiers on accessors may only be used if the property or indexer has both a get and a set accessor\",\n\t\t\t\t\t      GetSignatureForError ());\n\t\t\t}\n\t\t}\n\n\t\tprotected bool DefineAccessors ()\n\t\t{\n\t\t\tfirst.Define (Parent);\n\t\t\tif (AccessorSecond != null)\n\t\t\t\tAccessorSecond.Define (Parent);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected void DefineBuilders (MemberKind kind, ParametersCompiled parameters)\n\t\t{\n\t\t\tPropertyBuilder = Parent.TypeBuilder.DefineProperty (\n\t\t\t\tGetFullName (MemberName), PropertyAttributes.None,\n#if !BOOTSTRAP_BASIC\t// Requires trunk version mscorlib\n\t\t\t\tIsStatic ? 0 : CallingConventions.HasThis,\n#endif\n\t\t\t\tMemberType.GetMetaInfo (), null, null,\n\t\t\t\tparameters.GetMetaInfo (), null, null);\n\n\t\t\tPropertySpec spec;\n\t\t\tif (kind == MemberKind.Indexer)\n\t\t\t\tspec = new IndexerSpec (Parent.Definition, this, MemberType, parameters, PropertyBuilder, ModFlags);\n\t\t\telse\n\t\t\t\tspec = new PropertySpec (kind, Parent.Definition, this, MemberType, PropertyBuilder, ModFlags);\n\n\t\t\tif (Get != null) {\n\t\t\t\tspec.Get = Get.Spec;\n\t\t\t\tParent.MemberCache.AddMember (this, Get.Spec.Name, Get.Spec);\n\t\t\t} else {\n\t\t\t\tCheckMissingAccessor (kind, parameters, true);\n\t\t\t}\n\n\t\t\tif (Set != null) {\n\t\t\t\tspec.Set = Set.Spec;\n\t\t\t\tParent.MemberCache.AddMember (this, Set.Spec.Name, Set.Spec);\n\t\t\t} else {\n\t\t\t\tCheckMissingAccessor (kind, parameters, false);\n\t\t\t}\n\n\t\t\tParent.MemberCache.AddMember (this, PropertyBuilder.Name, spec);\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tCheckReservedNameConflict (GetMethod.Prefix, get == null ? null : get.Spec);\n\t\t\tCheckReservedNameConflict (SetMethod.Prefix, set == null ? null : set.Spec);\n\n\t\t\tif (OptAttributes != null)\n\t\t\t\tOptAttributes.Emit ();\n\n\t\t\tif (member_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (PropertyBuilder);\n\t\t\t} else if (member_type.HasDynamicElement) {\n\t\t\t\tModule.PredefinedAttributes.Dynamic.EmitAttribute (PropertyBuilder, member_type, Location);\n\t\t\t}\n\n\t\t\tConstraintChecker.Check (this, member_type, type_expr.Location);\n\n\t\t\tfirst.Emit (Parent);\n\t\t\tif (AccessorSecond != null)\n\t\t\t\tAccessorSecond.Emit (Parent);\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic override bool IsUsed {\n\t\t\tget {\n\t\t\t\tif (IsExplicitImpl)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn Get.IsUsed | Set.IsUsed;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void PrepareEmit ()\n\t\t{\n\t\t\tAccessorFirst.PrepareEmit ();\n\t\t\tif (AccessorSecond != null)\n\t\t\t\tAccessorSecond.PrepareEmit ();\n\n\t\t\tif (get != null) {\n\t\t\t\tvar method = Get.Spec.GetMetaInfo () as MethodBuilder;\n\t\t\t\tif (method != null)\n\t\t\t\t\tPropertyBuilder.SetGetMethod (method);\n\t\t\t}\n\n\t\t\tif (set != null) {\n\t\t\t\tvar method = Set.Spec.GetMetaInfo () as MethodBuilder;\n\t\t\t\tif (method != null)\n\t\t\t\t\tPropertyBuilder.SetSetMethod (method);\n\t\t\t}\n\t\t}\n\n\t\tprotected override void SetMemberName (MemberName new_name)\n\t\t{\n\t\t\tbase.SetMemberName (new_name);\n\n\t\t\tif (Get != null)\n\t\t\t\tGet.UpdateName (this);\n\n\t\t\tif (Set != null)\n\t\t\t\tSet.UpdateName (this);\n\t\t}\n\n\t\tpublic override void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tif (get != null)\n\t\t\t\tget.WriteDebugSymbol (file);\n\n\t\t\tif (set != null)\n\t\t\t\tset.WriteDebugSymbol (file);\n\t\t}\n\n\t\t//\n\t\t//   Represents header string for documentation comment.\n\t\t//\n\t\tpublic override string DocCommentHeader {\n\t\t\tget { return \"P:\"; }\n\t\t}\n\t}\n\t\t\t\n\tpublic class Property : PropertyBase\n\t{\n\t\tpublic sealed class BackingField : Field\n\t\t{\n\t\t\treadonly Property property;\n\t\t\tconst Modifiers DefaultModifiers = Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | Modifiers.DEBUGGER_HIDDEN;\n\n\t\t\tpublic BackingField (Property p, bool readOnly)\n\t\t\t\t: base (p.Parent, p.type_expr, DefaultModifiers | (p.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),\n\t\t\t\tnew MemberName (\"<\" + p.GetFullName (p.MemberName) + \">k__BackingField\", p.Location), null)\n\t\t\t{\n\t\t\t\tthis.property = p;\n\t\t\t\tif (readOnly)\n\t\t\t\t\tModFlags |= Modifiers.READONLY;\n\t\t\t}\n\n\t\t\tpublic Property OriginalProperty {\n\t\t\t\tget {\n\t\t\t\t\treturn property;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override string GetSignatureForError ()\n\t\t\t{\n\t\t\t\treturn property.GetSignatureForError ();\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly string[] attribute_target_auto = new string[] { \"property\", \"field\" };\n\n\t\tField backing_field;\n\n\t\tpublic Property (TypeDefinition parent, FullNamedExpression type, Modifiers mod,\n\t\t\t\t MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod,\n\t\t\t\tparent.PartialContainer.Kind == MemberKind.Interface ? AllowedModifiersInterface :\n\t\t\t\tparent.PartialContainer.Kind == MemberKind.Struct ? AllowedModifiersStruct :\n\t\t\t\tAllowedModifiersClass,\n\t\t\t\tname, attrs)\n\t\t{\n\t\t}\n\n\t\tpublic Expression Initializer { get; set; }\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Target == AttributeTargets.Field) {\n\t\t\t\tbacking_field.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tvoid CreateAutomaticProperty ()\n\t\t{\n\t\t\t// Create backing field\n\t\t\tbacking_field = new BackingField (this, Initializer != null && Set == null);\n\t\t\tif (!backing_field.Define ())\n\t\t\t\treturn;\n\n\t\t\tif (Initializer != null) {\n\t\t\t\tbacking_field.Initializer = Initializer;\n\t\t\t\tParent.RegisterFieldForInitialization (backing_field, new FieldInitializer (backing_field, Initializer, Location));\n\t\t\t\tbacking_field.ModFlags |= Modifiers.READONLY;\n\t\t\t}\n\n\t\t\tParent.PartialContainer.Members.Add (backing_field);\n\n\t\t\tFieldExpr fe = new FieldExpr (backing_field, Location);\n\t\t\tif ((backing_field.ModFlags & Modifiers.STATIC) == 0)\n\t\t\t\tfe.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location);\n\n\t\t\t//\n\t\t\t// Create get block but we careful with location to\n\t\t\t// emit only single sequence point per accessor. This allow\n\t\t\t// to set a breakpoint on it even with no user code\n\t\t\t//\n\t\t\tGet.Block = new ToplevelBlock (Compiler, ParametersCompiled.EmptyReadOnlyParameters, Location.Null);\n\t\t\tReturn r = new Return (fe, Get.Location);\n\t\t\tGet.Block.AddStatement (r);\n\t\t\tGet.ModFlags |= Modifiers.COMPILER_GENERATED;\n\n\t\t\t// Create set block\n\t\t\tif (Set != null) {\n\t\t\t\tSet.Block = new ToplevelBlock (Compiler, Set.ParameterInfo, Location.Null);\n\t\t\t\tAssign a = new SimpleAssign (fe, new SimpleName (\"value\", Location.Null), Location.Null);\n\t\t\t\tSet.Block.AddStatement (new StatementExpression (a, Set.Location));\n\t\t\t\tSet.ModFlags |= Modifiers.COMPILER_GENERATED;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tflags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;\n\n\t\t\tbool auto = AccessorFirst.Block == null && (AccessorSecond == null || AccessorSecond.Block == null) &&\n\t\t\t\t(ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0;\n\n\t\t\tif (Initializer != null) {\n\t\t\t\tif (!auto)\n\t\t\t\t\tReport.Error (8050, Location, \"`{0}': Only auto-implemented properties can have initializers\",\n\t\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\tif (IsInterface)\n\t\t\t\t\tReport.Error (8053, Location, \"`{0}': Properties inside interfaces cannot have initializers\",\n\t\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\tif (Compiler.Settings.Version < LanguageVersion.V_6)\n\t\t\t\t\tReport.FeatureIsNotAvailable (Compiler, Location, \"auto-implemented property initializer\");\n\t\t\t}\n\n\t\t\tif (auto) {\n\t\t\t\tif (Get == null) {\n\t\t\t\t\tReport.Error (8052, Location, \"Auto-implemented property `{0}' must have get accessor\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (Initializer == null && AccessorSecond == null) {\n\t\t\t\t\tReport.Error (8051, Location, \"Auto-implemented property `{0}' must have set accessor or initializer\",\n\t\t\t\t\t\tGetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\tif (Compiler.Settings.Version < LanguageVersion.V_3 && Initializer == null)\n\t\t\t\t\tReport.FeatureIsNotAvailable (Compiler, Location, \"auto-implemented properties\");\n\n\t\t\t\tCreateAutomaticProperty ();\n\t\t\t}\n\n\t\t\tif (!DefineAccessors ())\n\t\t\t\treturn false;\n\n\t\t\tif (AccessorSecond == null) {\n\t\t\t\tPropertyMethod pm;\n\t\t\t\tif (AccessorFirst is GetMethod)\n\t\t\t\t\tpm = new SetMethod (this, 0, ParametersCompiled.EmptyReadOnlyParameters, null, Location);\n\t\t\t\telse\n\t\t\t\t\tpm = new GetMethod (this, 0, null, Location);\n\n\t\t\t\tParent.AddNameToContainer (pm, pm.MemberName.Basename);\n\t\t\t}\n\n\t\t\tif (!CheckBase ())\n\t\t\t\treturn false;\n\n\t\t\tDefineBuilders (MemberKind.Property, ParametersCompiled.EmptyReadOnlyParameters);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tif ((AccessorFirst.ModFlags & (Modifiers.STATIC | Modifiers.COMPILER_GENERATED)) == Modifiers.COMPILER_GENERATED && Parent.PartialContainer.HasExplicitLayout) {\n\t\t\t\tReport.Error (842, Location,\n\t\t\t\t\t\"Automatically implemented property `{0}' cannot be used inside a type with an explicit StructLayout attribute\",\n\t\t\t\t\tGetSignatureForError ());\n\t\t\t}\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn Get != null && ((Get.ModFlags & Modifiers.COMPILER_GENERATED) != 0) ?\n\t\t\t\t\tattribute_target_auto : base.ValidAttributeTargets;\n\t\t\t}\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// For case when event is declared like property (with add and remove accessors).\n\t/// </summary>\n\tpublic class EventProperty: Event {\n\t\tpublic abstract class AEventPropertyAccessor : AEventAccessor\n\t\t{\n\t\t\tprotected AEventPropertyAccessor (EventProperty method, string prefix, Attributes attrs, Location loc)\n\t\t\t\t: base (method, prefix, attrs, loc)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void Define (TypeContainer ds)\n\t\t\t{\n\t\t\t\tCheckAbstractAndExtern (block != null);\n\t\t\t\tbase.Define (ds);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string GetSignatureForError ()\n\t\t\t{\n\t\t\t\treturn method.GetSignatureForError () + \".\" + prefix.Substring (0, prefix.Length - 1);\n\t\t\t}\n\t\t}\n\n\t\tpublic sealed class AddDelegateMethod: AEventPropertyAccessor\n\t\t{\n\t\t\tpublic AddDelegateMethod (EventProperty method, Attributes attrs, Location loc)\n\t\t\t\t: base (method, AddPrefix, attrs, loc)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\tpublic sealed class RemoveDelegateMethod: AEventPropertyAccessor\n\t\t{\n\t\t\tpublic RemoveDelegateMethod (EventProperty method, Attributes attrs, Location loc)\n\t\t\t\t: base (method, RemovePrefix, attrs, loc)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly string[] attribute_targets = new string [] { \"event\" };\n\n\t\tpublic EventProperty (TypeDefinition parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod_flags, name, attrs)\n\t\t{\n\t\t}\n\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\t\t\n\t\tpublic override bool Define()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tSetIsUsed ();\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn attribute_targets;\n\t\t\t}\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Event is declared like field.\n\t/// </summary>\n\tpublic class EventField : Event\n\t{\n\t\tabstract class EventFieldAccessor : AEventAccessor\n\t\t{\n\t\t\tprotected EventFieldAccessor (EventField method, string prefix)\n\t\t\t\t: base (method, prefix, null, method.Location)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected abstract MethodSpec GetOperation (Location loc);\n\n\t\t\tpublic override void Emit (TypeDefinition parent)\n\t\t\t{\n\t\t\t\tif ((method.ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0 && !Compiler.Settings.WriteMetadataOnly) {\n\t\t\t\t\tblock = new ToplevelBlock (Compiler, ParameterInfo, Location) {\n\t\t\t\t\t\tIsCompilerGenerated = true\n\t\t\t\t\t};\n\t\t\t\t\tFabricateBodyStatement ();\n\t\t\t\t}\n\n\t\t\t\tbase.Emit (parent);\n\t\t\t}\n\n\t\t\tvoid FabricateBodyStatement ()\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Delegate obj1 = backing_field\n\t\t\t\t// do {\n\t\t\t\t//   Delegate obj2 = obj1;\n\t\t\t\t//   obj1 = Interlocked.CompareExchange (ref backing_field, Delegate.Combine|Remove(obj2, value), obj1);\n\t\t\t\t// } while ((object)obj1 != (object)obj2)\n\t\t\t\t//\n\n\t\t\t\tvar field_info = ((EventField) method).backing_field;\n\t\t\t\tFieldExpr f_expr = new FieldExpr (field_info, Location);\n\t\t\t\tif (!IsStatic)\n\t\t\t\t\tf_expr.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location);\n\n\t\t\t\tvar obj1 = LocalVariable.CreateCompilerGenerated (field_info.MemberType, block, Location);\n\t\t\t\tvar obj2 = LocalVariable.CreateCompilerGenerated (field_info.MemberType, block, Location);\n\n\t\t\t\tblock.AddStatement (new StatementExpression (new SimpleAssign (new LocalVariableReference (obj1, Location), f_expr)));\n\n\t\t\t\tvar cond = new BooleanExpression (new Binary (Binary.Operator.Inequality,\n\t\t\t\t\tnew Cast (new TypeExpression (Module.Compiler.BuiltinTypes.Object, Location), new LocalVariableReference (obj1, Location), Location),\n\t\t\t\t\tnew Cast (new TypeExpression (Module.Compiler.BuiltinTypes.Object, Location), new LocalVariableReference (obj2, Location), Location)));\n\n\t\t\t\tvar body = new ExplicitBlock (block, Location, Location);\n\t\t\t\tblock.AddStatement (new Do (body, cond, Location, Location));\n\n\t\t\t\tbody.AddStatement (new StatementExpression (\n\t\t\t\t\tnew SimpleAssign (new LocalVariableReference (obj2, Location), new LocalVariableReference (obj1, Location))));\n\n\t\t\t\tvar args_oper = new Arguments (2);\n\t\t\t\targs_oper.Add (new Argument (new LocalVariableReference (obj2, Location)));\n\t\t\t\targs_oper.Add (new Argument (block.GetParameterReference (0, Location)));\n\n\t\t\t\tvar op_method = GetOperation (Location);\n\n\t\t\t\tvar args = new Arguments (3);\n\t\t\t\targs.Add (new Argument (f_expr, Argument.AType.Ref));\n\t\t\t\targs.Add (new Argument (new Cast (\n\t\t\t\t\tnew TypeExpression (field_info.MemberType, Location),\n\t\t\t\t\tnew Invocation (MethodGroupExpr.CreatePredefined (op_method, op_method.DeclaringType, Location), args_oper),\n\t\t\t\t\tLocation)));\n\t\t\t\targs.Add (new Argument (new LocalVariableReference (obj1, Location)));\n\n\t\t\t\tvar cas = Module.PredefinedMembers.InterlockedCompareExchange_T.Get ();\n\t\t\t\tif (cas == null) {\n\t\t\t\t\tif (Module.PredefinedMembers.MonitorEnter_v4.Get () != null || Module.PredefinedMembers.MonitorEnter.Get () != null) {\n\t\t\t\t\t\t// Workaround for cripled (e.g. microframework) mscorlib without CompareExchange\n\t\t\t\t\t\tbody.AddStatement (new Lock (\n\t\t\t\t\t\t\tblock.GetParameterReference (0, Location),\n\t\t\t\t\t\t\tnew StatementExpression (new SimpleAssign (\n\t\t\t\t\t\t\t\tf_expr, args [1].Expr, Location), Location), Location));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tModule.PredefinedMembers.InterlockedCompareExchange_T.Resolve (Location);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbody.AddStatement (new StatementExpression (new SimpleAssign (\n\t\t\t\t\t\tnew LocalVariableReference (obj1, Location),\n\t\t\t\t\t\tnew Invocation (MethodGroupExpr.CreatePredefined (cas, cas.DeclaringType, Location), args))));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsealed class AddDelegateMethod: EventFieldAccessor\n\t\t{\n\t\t\tpublic AddDelegateMethod (EventField method):\n\t\t\t\tbase (method, AddPrefix)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override MethodSpec GetOperation (Location loc)\n\t\t\t{\n\t\t\t\treturn Module.PredefinedMembers.DelegateCombine.Resolve (loc);\n\t\t\t}\n\t\t}\n\n\t\tsealed class RemoveDelegateMethod: EventFieldAccessor\n\t\t{\n\t\t\tpublic RemoveDelegateMethod (EventField method):\n\t\t\t\tbase (method, RemovePrefix)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override MethodSpec GetOperation (Location loc)\n\t\t\t{\n\t\t\t\treturn Module.PredefinedMembers.DelegateRemove.Resolve (loc);\n\t\t\t}\n\t\t}\n\n\n\t\tstatic readonly string[] attribute_targets = new string [] { \"event\", \"field\", \"method\" };\n\t\tstatic readonly string[] attribute_targets_interface = new string[] { \"event\", \"method\" };\n\n\t\tExpression initializer;\n\t\tField backing_field;\n\t\tList<FieldDeclarator> declarators;\n\n\t\tpublic EventField (TypeDefinition parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod_flags, name, attrs)\n\t\t{\n\t\t\tAdd = new AddDelegateMethod (this);\n\t\t\tRemove = new RemoveDelegateMethod (this);\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic List<FieldDeclarator> Declarators {\n\t\t\tget {\n\t\t\t\treturn this.declarators;\n\t\t\t}\n\t\t}\n\n\t\tbool HasBackingField {\n\t\t\tget {\n\t\t\t\treturn !IsInterface && (ModFlags & Modifiers.ABSTRACT) == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Initializer {\n\t\t\tget {\n\t\t\t\treturn initializer;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tinitializer = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string[] ValidAttributeTargets {\n\t\t\tget {\n\t\t\t\treturn HasBackingField ? attribute_targets : attribute_targets_interface;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic void AddDeclarator (FieldDeclarator declarator)\n\t\t{\n\t\t\tif (declarators == null)\n\t\t\t\tdeclarators = new List<FieldDeclarator> (2);\n\n\t\t\tdeclarators.Add (declarator);\n\n\t\t\tParent.AddNameToContainer (this, declarator.Name.Value);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Target == AttributeTargets.Field) {\n\t\t\t\tbacking_field.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (a.Target == AttributeTargets.Method) {\n\t\t\t\tint errors = Report.Errors;\n\t\t\t\tAdd.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\tif (errors == Report.Errors)\n\t\t\t\t\tRemove.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tpublic override bool Define()\n\t\t{\n\t\t\tvar mod_flags_src = ModFlags;\n\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (declarators != null) {\n\t\t\t\tif ((mod_flags_src & Modifiers.DEFAULT_ACCESS_MODIFIER) != 0)\n\t\t\t\t\tmod_flags_src &= ~(Modifiers.AccessibilityMask | Modifiers.DEFAULT_ACCESS_MODIFIER);\n\n\t\t\t\tvar t = new TypeExpression (MemberType, TypeExpression.Location);\n\t\t\t\tforeach (var d in declarators) {\n\t\t\t\t\tvar ef = new EventField (Parent, t, mod_flags_src, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);\n\n\t\t\t\t\tif (d.Initializer != null)\n\t\t\t\t\t\tef.initializer = d.Initializer;\n\n\t\t\t\t\tef.Define ();\n\t\t\t\t\tParent.PartialContainer.Members.Add (ef);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!HasBackingField) {\n\t\t\t\tSetIsUsed ();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tbacking_field = new Field (Parent,\n\t\t\t\tnew TypeExpression (MemberType, Location),\n\t\t\t\tModifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),\n\t\t\t\tMemberName, null);\n\n\t\t\tParent.PartialContainer.Members.Add (backing_field);\n\t\t\tbacking_field.Initializer = Initializer;\n\t\t\tbacking_field.ModFlags &= ~Modifiers.COMPILER_GENERATED;\n\n\t\t\t// Call define because we passed fields definition\n\t\t\tbacking_field.Define ();\n\n\t\t\t// Set backing field for event fields\n\t\t\tspec.BackingField = backing_field.Spec;\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic abstract class Event : PropertyBasedMember\n\t{\n\t\tpublic abstract class AEventAccessor : AbstractPropertyEventMethod\n\t\t{\n\t\t\tprotected readonly Event method;\n\t\t\treadonly ParametersCompiled parameters;\n\n\t\t\tstatic readonly string[] attribute_targets = new string [] { \"method\", \"param\", \"return\" };\n\n\t\t\tpublic const string AddPrefix = \"add_\";\n\t\t\tpublic const string RemovePrefix = \"remove_\";\n\n\t\t\tprotected AEventAccessor (Event method, string prefix, Attributes attrs, Location loc)\n\t\t\t\t: base (method, prefix, attrs, loc)\n\t\t\t{\n\t\t\t\tthis.method = method;\n\t\t\t\tthis.ModFlags = method.ModFlags;\n\t\t\t\tthis.parameters = ParametersCompiled.CreateImplicitParameter (method.TypeExpression, loc);\n\t\t\t}\n\n\t\t\tpublic bool IsInterfaceImplementation {\n\t\t\t\tget { return method_data.implementing != null; }\n\t\t\t}\n\n\t\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t\t{\n\t\t\t\tif (a.Type == pa.MethodImpl) {\n\t\t\t\t\tmethod.is_external_implementation = a.IsInternalCall ();\n\t\t\t\t}\n\n\t\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t}\n\n\t\t\tprotected override void ApplyToExtraTarget (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t\t{\n\t\t\t\tif (a.Target == AttributeTargets.Parameter) {\n\t\t\t\t\tparameters[0].ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbase.ApplyToExtraTarget (a, ctor, cdata, pa);\n\t\t\t}\n\n\t\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\t\tget {\n\t\t\t\t\treturn AttributeTargets.Method;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override bool IsClsComplianceRequired ()\n\t\t\t{\n\t\t\t\treturn method.IsClsComplianceRequired ();\n\t\t\t}\n\n\t\t\tpublic virtual void Define (TypeContainer parent)\n\t\t\t{\n\t\t\t\t// Fill in already resolved event type to speed things up and\n\t\t\t\t// avoid confusing duplicate errors\n\t\t\t\t((Parameter) parameters.FixedParameters[0]).Type = method.member_type;\n\t\t\t\tparameters.Types = new TypeSpec[] { method.member_type };\n\n\t\t\t\tmethod_data = new MethodData (method, method.ModFlags,\n\t\t\t\t\tmethod.flags | MethodAttributes.HideBySig | MethodAttributes.SpecialName, this);\n\n\t\t\t\tif (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName)))\n\t\t\t\t\treturn;\n\n\t\t\t\tif (Compiler.Settings.WriteMetadataOnly)\n\t\t\t\t\tblock = null;\n\n\t\t\t\tSpec = new MethodSpec (MemberKind.Method, parent.PartialContainer.Definition, this, ReturnType, ParameterInfo, method.ModFlags);\n\t\t\t\tSpec.IsAccessor = true;\n\t\t\t}\n\n\t\t\tpublic override TypeSpec ReturnType {\n\t\t\t\tget {\n\t\t\t\t\treturn Parent.Compiler.BuiltinTypes.Void;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override ObsoleteAttribute GetAttributeObsolete ()\n\t\t\t{\n\t\t\t\treturn method.GetAttributeObsolete ();\n\t\t\t}\n\n\t\t\tpublic MethodData MethodData {\n\t\t\t\tget {\n\t\t\t\t\treturn method_data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override string[] ValidAttributeTargets {\n\t\t\t\tget {\n\t\t\t\t\treturn attribute_targets;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override ParametersCompiled ParameterInfo {\n\t\t\t\tget {\n\t\t\t\t\treturn parameters;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tAEventAccessor add, remove;\n\t\tEventBuilder EventBuilder;\n\t\tprotected EventSpec spec;\n\n\t\tprotected Event (TypeDefinition parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)\n\t\t\t: base (parent, type, mod_flags,\n\t\t\t\tparent.PartialContainer.Kind == MemberKind.Interface ? AllowedModifiersInterface :\n\t\t\t\tparent.PartialContainer.Kind == MemberKind.Struct ? AllowedModifiersStruct :\n\t\t\t\tAllowedModifiersClass,\n\t\t\t\tname, attrs)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override AttributeTargets AttributeTargets {\n\t\t\tget {\n\t\t\t\treturn AttributeTargets.Event;\n\t\t\t}\n\t\t}\n\n\t\tpublic AEventAccessor Add {\n\t\t\tget {\n\t\t\t\treturn this.add;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tadd = value;\n\t\t\t\tParent.AddNameToContainer (value, value.MemberName.Basename);\n\t\t\t}\n\t\t}\n\n\t\tpublic override Variance ExpectedMemberTypeVariance {\n\t\t\tget {\n\t\t\t\treturn Variance.Contravariant;\n\t\t\t}\n\t\t}\n\n\t\tpublic AEventAccessor Remove {\n\t\t\tget {\n\t\t\t\treturn this.remove;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tremove = value;\n\t\t\t\tParent.AddNameToContainer (value, value.MemberName.Basename);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif ((a.HasSecurityAttribute)) {\n\t\t\t\ta.Error_InvalidSecurityParent ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEventBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);\n\t\t}\n\n\t\tprotected override bool CheckOverrideAgainstBase (MemberSpec base_member)\n\t\t{\n\t\t\tvar ok = base.CheckOverrideAgainstBase (base_member);\n\n\t\t\tif (!CheckAccessModifiers (this, base_member)) {\n\t\t\t\tError_CannotChangeAccessModifiers (this, base_member);\n\t\t\t\tok = false;\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (!MemberType.IsDelegate) {\n\t\t\t\tReport.Error (66, Location, \"`{0}': event must be of a delegate type\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif (!CheckBase ())\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// Now define the accessors\n\t\t\t//\n\t\t\tadd.Define (Parent);\n\t\t\tremove.Define (Parent);\n\n\t\t\tEventBuilder = Parent.TypeBuilder.DefineEvent (GetFullName (MemberName), EventAttributes.None, MemberType.GetMetaInfo ());\n\n\t\t\tspec = new EventSpec (Parent.Definition, this, MemberType, ModFlags, Add.Spec, remove.Spec);\n\n\t\t\tParent.MemberCache.AddMember (this, GetFullName (MemberName), spec);\n\t\t\tParent.MemberCache.AddMember (this, Add.Spec.Name, Add.Spec);\n\t\t\tParent.MemberCache.AddMember (this, Remove.Spec.Name, remove.Spec);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tCheckReservedNameConflict (null, add.Spec);\n\t\t\tCheckReservedNameConflict (null, remove.Spec);\n\n\t\t\tif (OptAttributes != null) {\n\t\t\t\tOptAttributes.Emit ();\n\t\t\t}\n\n\t\t\tConstraintChecker.Check (this, member_type, type_expr.Location);\n\n\t\t\tAdd.Emit (Parent);\n\t\t\tRemove.Emit (Parent);\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic override void PrepareEmit ()\n\t\t{\n\t\t\tadd.PrepareEmit ();\n\t\t\tremove.PrepareEmit ();\n\n\t\t\tEventBuilder.SetAddOnMethod (add.MethodData.MethodBuilder);\n\t\t\tEventBuilder.SetRemoveOnMethod (remove.MethodData.MethodBuilder);\n\t\t}\n\n\t\tpublic override void WriteDebugSymbol (MonoSymbolFile file)\n\t\t{\n\t\t\tadd.WriteDebugSymbol (file);\n\t\t\tremove.WriteDebugSymbol (file);\n\t\t}\n\n\t\t//\n\t\t//   Represents header string for documentation comment.\n\t\t//\n\t\tpublic override string DocCommentHeader {\n\t\t\tget { return \"E:\"; }\n\t\t}\n\t}\n\n\tpublic class EventSpec : MemberSpec, IInterfaceMemberSpec\n\t{\n\t\tMethodSpec add, remove;\n\t\tFieldSpec backing_field;\n\n\t\tpublic EventSpec (TypeSpec declaringType, IMemberDefinition definition, TypeSpec eventType, Modifiers modifiers, MethodSpec add, MethodSpec remove)\n\t\t\t: base (MemberKind.Event, declaringType, definition, modifiers)\n\t\t{\n\t\t\tthis.AccessorAdd = add;\n\t\t\tthis.AccessorRemove = remove;\n\t\t\tthis.MemberType = eventType;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic MethodSpec AccessorAdd { \n\t\t\tget {\n\t\t\t\treturn add;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tadd = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodSpec AccessorRemove {\n\t\t\tget {\n\t\t\t\treturn remove;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tremove = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic FieldSpec BackingField {\n\t\t\tget {\n\t\t\t\treturn backing_field;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tbacking_field = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec MemberType { get; private set; }\n\n\t\t#endregion\n\n\t\tpublic override MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar es = (EventSpec) base.InflateMember (inflator);\n\t\t\tes.MemberType = inflator.Inflate (MemberType);\n\n\t\t\tif (backing_field != null)\n\t\t\t\tes.backing_field = (FieldSpec) backing_field.InflateMember (inflator);\n\n\t\t\treturn es;\n\t\t}\n\n\t\tpublic override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\treturn MemberType.ResolveMissingDependencies (this);\n\t\t}\n\t}\n \n\tpublic class Indexer : PropertyBase, IParametersMember\n\t{\n\t\tpublic class GetIndexerMethod : GetMethod, IParametersMember\n\t\t{\n\t\t\tParametersCompiled parameters;\n\n\t\t\tpublic GetIndexerMethod (PropertyBase property, Modifiers modifiers, ParametersCompiled parameters, Attributes attrs, Location loc)\n\t\t\t\t: base (property, modifiers, attrs, loc)\n\t\t\t{\n\t\t\t\tthis.parameters = parameters;\n\t\t\t}\n\n\t\t\tpublic override void Define (TypeContainer parent)\n\t\t\t{\n\t\t\t\t// Disable reporting, parameters are resolved twice\n\t\t\t\tReport.DisableReporting ();\n\t\t\t\ttry {\n\t\t\t\t\tparameters.Resolve (this);\n\t\t\t\t} finally {\n\t\t\t\t\tReport.EnableReporting ();\n\t\t\t\t}\n\n\t\t\t\tbase.Define (parent);\n\t\t\t}\n\n\t\t\tpublic override ParametersCompiled ParameterInfo {\n\t\t\t\tget {\n\t\t\t\t\treturn parameters;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#region IParametersMember Members\n\n\t\t\tAParametersCollection IParametersMember.Parameters {\n\t\t\t\tget {\n\t\t\t\t\treturn parameters;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tTypeSpec IInterfaceMemberSpec.MemberType {\n\t\t\t\tget {\n\t\t\t\t\treturn ReturnType;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\tpublic class SetIndexerMethod : SetMethod, IParametersMember\n\t\t{\n\t\t\tpublic SetIndexerMethod (PropertyBase property, Modifiers modifiers, ParametersCompiled parameters, Attributes attrs, Location loc)\n\t\t\t\t: base (property, modifiers, parameters, attrs, loc)\n\t\t\t{\n\t\t\t}\n\n\t\t\t#region IParametersMember Members\n\n\t\t\tAParametersCollection IParametersMember.Parameters {\n\t\t\t\tget {\n\t\t\t\t\treturn parameters;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tTypeSpec IInterfaceMemberSpec.MemberType {\n\t\t\t\tget {\n\t\t\t\t\treturn ReturnType;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\tconst Modifiers AllowedModifiers =\n\t\t\tModifiers.NEW |\n\t\t\tModifiers.PUBLIC |\n\t\t\tModifiers.PROTECTED |\n\t\t\tModifiers.INTERNAL |\n\t\t\tModifiers.PRIVATE |\n\t\t\tModifiers.VIRTUAL |\n\t\t\tModifiers.SEALED |\n\t\t\tModifiers.OVERRIDE |\n\t\t\tModifiers.UNSAFE |\n\t\t\tModifiers.EXTERN |\n\t\t\tModifiers.ABSTRACT;\n\n\t\tconst Modifiers AllowedInterfaceModifiers =\n\t\t\tModifiers.NEW;\n\n\t\treadonly ParametersCompiled parameters;\n\n\t\tpublic Indexer (TypeDefinition parent, FullNamedExpression type, MemberName name, Modifiers mod, ParametersCompiled parameters, Attributes attrs)\n\t\t\t: base (parent, type, mod,\n\t\t\t\tparent.PartialContainer.Kind == MemberKind.Interface ? AllowedInterfaceModifiers : AllowedModifiers,\n\t\t\t\tname, attrs)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t}\n\n\t\t#region Properties\n\n\t\tAParametersCollection IParametersMember.Parameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic ParametersCompiled ParameterInfo {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t\n\t\tpublic override void Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\tvisitor.Visit (this);\n\t\t}\n\n\t\tpublic override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)\n\t\t{\n\t\t\tif (a.Type == pa.IndexerName) {\n\t\t\t\t// Attribute was copied to container\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbase.ApplyAttributeBuilder (a, ctor, cdata, pa);\n\t\t}\n\n\t\tprotected override bool CheckForDuplications ()\n\t\t{\n\t\t\treturn Parent.MemberCache.CheckExistingMembersOverloads (this, parameters);\n\t\t}\n\t\t\n\t\tpublic override bool Define ()\n\t\t{\n\t\t\tif (!base.Define ())\n\t\t\t\treturn false;\n\n\t\t\tif (!DefineParameters (parameters))\n\t\t\t\treturn false;\n\n\t\t\tif (OptAttributes != null) {\n\t\t\t\tAttribute indexer_attr = OptAttributes.Search (Module.PredefinedAttributes.IndexerName);\n\t\t\t\tif (indexer_attr != null) {\n\t\t\t\t\tvar compiling = indexer_attr.Type.MemberDefinition as TypeContainer;\n\t\t\t\t\tif (compiling != null)\n\t\t\t\t\t\tcompiling.Define ();\n\n\t\t\t\t\tif (IsExplicitImpl) {\n\t\t\t\t\t\tReport.Error (415, indexer_attr.Location,\n\t\t\t\t\t\t\t\"The `{0}' attribute is valid only on an indexer that is not an explicit interface member declaration\",\n\t\t\t\t\t\t\tindexer_attr.Type.GetSignatureForError ());\n\t\t\t\t\t} else if ((ModFlags & Modifiers.OVERRIDE) != 0) {\n\t\t\t\t\t\tReport.Error (609, indexer_attr.Location,\n\t\t\t\t\t\t\t\"Cannot set the `IndexerName' attribute on an indexer marked override\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstring name = indexer_attr.GetIndexerAttributeValue ();\n\n\t\t\t\t\t\tif (!string.IsNullOrEmpty (name)) {\n\t\t\t\t\t\t\tSetMemberName (new MemberName (MemberName.Left, name, Location));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (InterfaceType != null) {\n\t\t\t\tstring base_IndexerName = InterfaceType.MemberDefinition.GetAttributeDefaultMember ();\n\t\t\t\tif (base_IndexerName != ShortName) {\n\t\t\t\t\tSetMemberName (new MemberName (MemberName.Left, base_IndexerName, new TypeExpression (InterfaceType, Location), Location));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tParent.AddNameToContainer (this, MemberName.Basename);\n\n\t\t\tflags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;\n\t\t\t\n\t\t\tif (!DefineAccessors ())\n\t\t\t\treturn false;\n\n\t\t\tif (!CheckBase ())\n\t\t\t\treturn false;\n\n\t\t\tDefineBuilders (MemberKind.Indexer, parameters);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool EnableOverloadChecks (MemberCore overload)\n\t\t{\n\t\t\tif (overload is Indexer) {\n\t\t\t\tcaching_flags |= Flags.MethodOverloadsExist;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn base.EnableOverloadChecks (overload);\n\t\t}\n\n\t\tpublic override void Emit ()\n\t\t{\n\t\t\tparameters.CheckConstraints (this);\n\n\t\t\tbase.Emit ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder (Parent.GetSignatureForError ());\n\t\t\tif (MemberName.ExplicitInterface != null) {\n\t\t\t\tsb.Append (\".\");\n\t\t\t\tsb.Append (MemberName.ExplicitInterface.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tsb.Append (\".this\");\n\t\t\tsb.Append (parameters.GetSignatureForError (\"[\", \"]\", parameters.Count));\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\treturn base.GetSignatureForDocumentation () + parameters.GetSignatureForDocumentation ();\n\t\t}\n\n\t\tprotected override bool VerifyClsCompliance ()\n\t\t{\n\t\t\tif (!base.VerifyClsCompliance ())\n\t\t\t\treturn false;\n\n\t\t\tparameters.VerifyClsCompliance (this);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic class IndexerSpec : PropertySpec, IParametersMember\n\t{\n\t\tAParametersCollection parameters;\n\n\t\tpublic IndexerSpec (TypeSpec declaringType, IMemberDefinition definition, TypeSpec memberType, AParametersCollection parameters, PropertyInfo info, Modifiers modifiers)\n\t\t\t: base (MemberKind.Indexer, declaringType, definition, memberType, info, modifiers)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t}\n\n\t\t#region Properties\n\t\tpublic AParametersCollection Parameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\treturn base.GetSignatureForDocumentation () + parameters.GetSignatureForDocumentation ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn DeclaringType.GetSignatureForError () + \".this\" + parameters.GetSignatureForError (\"[\", \"]\", parameters.Count);\n\t\t}\n\n\t\tpublic override MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar spec = (IndexerSpec) base.InflateMember (inflator);\n\t\t\tspec.parameters = parameters.Inflate (inflator);\n\t\t\treturn spec;\n\t\t}\n\n\t\tpublic override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\tvar missing = base.ResolveMissingDependencies (caller);\n\n\t\t\tforeach (var pt in parameters.Types) {\n\t\t\t\tvar m = pt.GetMissingDependencies (caller);\n\t\t\t\tif (m == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (missing == null)\n\t\t\t\t\tmissing = new List<MissingTypeSpecReference> ();\n\n\t\t\t\tmissing.AddRange (m);\n\t\t\t}\n\n\t\t\treturn missing;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/reflection.cs",
    "content": "﻿//\n// reflection.cs: System.Reflection and System.Reflection.Emit specific implementations\n//\n// Author: Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2009-2010 Novell, Inc. \n//\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing System.Reflection.Emit;\nusing System.Security;\n\nnamespace Mono.CSharp\n{\n#if STATIC\n\tpublic class ReflectionImporter\n\t{\n\t\tpublic ReflectionImporter (ModuleContainer module, BuiltinTypes builtin)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic void ImportAssembly (Assembly assembly, RootNamespace targetNamespace)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic ImportedModuleDefinition ImportModule (Module module, RootNamespace targetNamespace)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tpublic TypeSpec ImportType (Type type)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\t}\n#else\n\tpublic sealed class ReflectionImporter : MetadataImporter\n\t{\n\t\tpublic ReflectionImporter (ModuleContainer module, BuiltinTypes builtin)\n\t\t\t: base (module)\n\t\t{\n\t\t\tInitialize (builtin);\n\t\t}\n\n\t\tpublic override void AddCompiledType (TypeBuilder builder, TypeSpec spec)\n\t\t{\n\t\t}\n\n\t\tprotected override MemberKind DetermineKindFromBaseType (Type baseType)\n\t\t{\n\t\t\tif (baseType == typeof (ValueType))\n\t\t\t\treturn MemberKind.Struct;\n\n\t\t\tif (baseType == typeof (System.Enum))\n\t\t\t\treturn MemberKind.Enum;\n\n\t\t\tif (baseType == typeof (MulticastDelegate))\n\t\t\t\treturn MemberKind.Delegate;\n\n\t\t\treturn MemberKind.Class;\n\t\t}\n\n\t\tprotected override bool HasVolatileModifier (Type[] modifiers)\n\t\t{\n\t\t\tforeach (var t in modifiers) {\n\t\t\t\tif (t == typeof (IsVolatile))\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void ImportAssembly (Assembly assembly, RootNamespace targetNamespace)\n\t\t{\n\t\t\t// It can be used more than once when importing same assembly\n\t\t\t// into 2 or more global aliases\n\t\tGetAssemblyDefinition (assembly);\n\n\t\t\t//\n\t\t\t// This part tries to simulate loading of top-level\n\t\t\t// types only, any missing dependencies are ignores here.\n\t\t\t// Full error report is reported later when the type is\n\t\t\t// actually used\n\t\t\t//\n\t\t\tType[] all_types;\n\t\t\ttry {\n\t\t\t\tall_types = assembly.GetTypes ();\n\t\t\t} catch (ReflectionTypeLoadException e) {\n\t\t\t\tall_types = e.Types;\n\t\t\t}\n\n\t\t\tImportTypes (all_types, targetNamespace, true);\n\t\t}\n\n\t\tpublic ImportedModuleDefinition ImportModule (Module module, RootNamespace targetNamespace)\n\t\t{\n\t\t\tvar module_definition = new ImportedModuleDefinition (module);\n\t\t\tmodule_definition.ReadAttributes ();\n\n\t\t\tType[] all_types;\n\t\t\ttry {\n\t\t\t\tall_types = module.GetTypes ();\n\t\t\t} catch (ReflectionTypeLoadException e) {\n\t\t\t\tall_types = e.Types;\n\t\t\t}\n\n\t\t\tImportTypes (all_types, targetNamespace, false);\n\n\t\t\treturn module_definition;\n\t\t}\n\n\t\tvoid Initialize (BuiltinTypes builtin)\n\t\t{\n\t\t\t//\n\t\t\t// Setup mapping for build-in types to avoid duplication of their definition\n\t\t\t//\n\t\t\tcompiled_types.Add (typeof (object), builtin.Object);\n\t\t\tcompiled_types.Add (typeof (System.ValueType), builtin.ValueType);\n\t\t\tcompiled_types.Add (typeof (System.Attribute), builtin.Attribute);\n\n\t\t\tcompiled_types.Add (typeof (int), builtin.Int);\n\t\t\tcompiled_types.Add (typeof (long), builtin.Long);\n\t\t\tcompiled_types.Add (typeof (uint), builtin.UInt);\n\t\t\tcompiled_types.Add (typeof (ulong), builtin.ULong);\n\t\t\tcompiled_types.Add (typeof (byte), builtin.Byte);\n\t\t\tcompiled_types.Add (typeof (sbyte), builtin.SByte);\n\t\t\tcompiled_types.Add (typeof (short), builtin.Short);\n\t\t\tcompiled_types.Add (typeof (ushort), builtin.UShort);\n\n\t\t\tcompiled_types.Add (typeof (System.Collections.IEnumerator), builtin.IEnumerator);\n\t\t\tcompiled_types.Add (typeof (System.Collections.IEnumerable), builtin.IEnumerable);\n\t\t\tcompiled_types.Add (typeof (System.IDisposable), builtin.IDisposable);\n\n\t\t\tcompiled_types.Add (typeof (char), builtin.Char);\n\t\t\tcompiled_types.Add (typeof (string), builtin.String);\n\t\t\tcompiled_types.Add (typeof (float), builtin.Float);\n\t\t\tcompiled_types.Add (typeof (double), builtin.Double);\n\t\t\tcompiled_types.Add (typeof (decimal), builtin.Decimal);\n\t\t\tcompiled_types.Add (typeof (bool), builtin.Bool);\n\t\t\tcompiled_types.Add (typeof (System.IntPtr), builtin.IntPtr);\n\t\t\tcompiled_types.Add (typeof (System.UIntPtr), builtin.UIntPtr);\n\n\t\t\tcompiled_types.Add (typeof (System.MulticastDelegate), builtin.MulticastDelegate);\n\t\t\tcompiled_types.Add (typeof (System.Delegate), builtin.Delegate);\n\t\t\tcompiled_types.Add (typeof (System.Enum), builtin.Enum);\n\t\t\tcompiled_types.Add (typeof (System.Array), builtin.Array);\n\t\t\tcompiled_types.Add (typeof (void), builtin.Void);\n\t\t\tcompiled_types.Add (typeof (System.Type), builtin.Type);\n\t\t\tcompiled_types.Add (typeof (System.Exception), builtin.Exception);\n\t\t\tcompiled_types.Add (typeof (System.RuntimeFieldHandle), builtin.RuntimeFieldHandle);\n\t\t\tcompiled_types.Add (typeof (System.RuntimeTypeHandle), builtin.RuntimeTypeHandle);\n\t\t}\n\t}\n\n\t[System.Runtime.InteropServices.StructLayout (System.Runtime.InteropServices.LayoutKind.Explicit)]\n\tstruct SingleConverter\n\t{\n\t\t[System.Runtime.InteropServices.FieldOffset (0)]\n\t\tint i;\n\n#pragma warning disable 414\n\t\t[System.Runtime.InteropServices.FieldOffset (0)]\n\t\tfloat f;\n#pragma warning restore 414\n\n\t\tpublic static int SingleToInt32Bits (float v)\n\t\t{\n\t\t\tSingleConverter c = new SingleConverter ();\n\t\t\tc.f = v;\n\t\t\treturn c.i;\n\t\t}\n\t}\n\n#endif\n\n\tpublic class AssemblyDefinitionDynamic : AssemblyDefinition\n\t{\n\t\t//\n\t\t// In-memory only assembly container\n\t\t//\n\t\tpublic AssemblyDefinitionDynamic (ModuleContainer module, string name)\n\t\t\t: base (module, name)\n\t\t{\n\t\t}\n\n\t\t//\n\t\t// Assembly container with file output\n\t\t//\n\t\tpublic AssemblyDefinitionDynamic (ModuleContainer module, string name, string fileName)\n\t\t\t: base (module, name, fileName)\n\t\t{\n\t\t}\n\n\t\tpublic Module IncludeModule (string moduleFile)\n\t\t{\n\t\t\treturn builder_extra.AddModule (moduleFile);\n\t\t}\n\n#if !STATIC\n\t\tpublic override ModuleBuilder CreateModuleBuilder ()\n\t\t{\n\t\t\tif (file_name == null)\n\t\t\t\treturn Builder.DefineDynamicModule (Name, false);\n\n\t\t\treturn base.CreateModuleBuilder ();\n\t\t}\n#endif\n\t\t//\n\t\t// Initializes the code generator\n\t\t//\n\t\tpublic bool Create (AppDomain domain, AssemblyBuilderAccess access)\n\t\t{\n#if STATIC || FULL_AOT_RUNTIME\n\t\t\tthrow new NotSupportedException ();\n#else\n\t\t\tResolveAssemblySecurityAttributes ();\n\t\t\tvar an = CreateAssemblyName ();\n\n\t\t\tBuilder = file_name == null ?\n\t\t\t\tdomain.DefineDynamicAssembly (an, access) :\n\t\t\t\tdomain.DefineDynamicAssembly (an, access, Dirname (file_name));\n\n\t\t\tmodule.Create (this, CreateModuleBuilder ());\n\t\t\tbuilder_extra = new AssemblyBuilderMonoSpecific (Builder, Compiler);\n\t\t\treturn true;\n#endif\n\t\t}\n\n\t\tstatic string Dirname (string name)\n\t\t{\n\t\t\tint pos = name.LastIndexOf ('/');\n\n\t\t\tif (pos != -1)\n\t\t\t\treturn name.Substring (0, pos);\n\n\t\t\tpos = name.LastIndexOf ('\\\\');\n\t\t\tif (pos != -1)\n\t\t\t\treturn name.Substring (0, pos);\n\n\t\t\treturn \".\";\n\t\t}\n\n#if !STATIC\n\t\tprotected override void SaveModule (PortableExecutableKinds pekind, ImageFileMachine machine)\n\t\t{\n\t\t\ttry {\n\t\t\t\tvar module_only = typeof (AssemblyBuilder).GetProperty (\"IsModuleOnly\", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);\n\t\t\t\tvar set_module_only = module_only.GetSetMethod (true);\n\n\t\t\t\tset_module_only.Invoke (Builder, new object[] { true });\n\t\t\t} catch {\n\t\t\t\tbase.SaveModule (pekind, machine);\n\t\t\t}\n\n\t\t\tBuilder.Save (file_name, pekind, machine);\n\t\t}\n#endif\n\t}\n\n\t//\n\t// Extension to System.Reflection.Emit.AssemblyBuilder to have fully compatible\n\t// compiler\n\t//\n\tclass AssemblyBuilderMonoSpecific : AssemblyBuilderExtension\n\t{\n\t\tstatic MethodInfo adder_method;\n\t\tstatic MethodInfo add_permission;\n\t\tstatic MethodInfo add_type_forwarder;\n\t\tstatic MethodInfo win32_icon_define;\n\t\tstatic FieldInfo assembly_version;\n\t\tstatic FieldInfo assembly_algorithm;\n\t\tstatic FieldInfo assembly_culture;\n\t\tstatic FieldInfo assembly_flags;\n\n\t\tAssemblyBuilder builder;\n\n\t\tpublic AssemblyBuilderMonoSpecific (AssemblyBuilder ab, CompilerContext ctx)\n\t\t\t: base (ctx)\n\t\t{\n\t\t\tthis.builder = ab;\n\t\t}\n\n\t\tpublic override Module AddModule (string module)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (adder_method == null)\n\t\t\t\t\tadder_method = typeof (AssemblyBuilder).GetMethod (\"AddModule\", BindingFlags.Instance | BindingFlags.NonPublic);\n\n\t\t\t\treturn (Module) adder_method.Invoke (builder, new object[] { module });\n\t\t\t} catch {\n\t\t\t\treturn base.AddModule (module);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void AddPermissionRequests (PermissionSet[] permissions)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (add_permission == null)\n\t\t\t\t\tadd_permission = typeof (AssemblyBuilder).GetMethod (\"AddPermissionRequests\", BindingFlags.Instance | BindingFlags.NonPublic);\n\n\t\t\t\tadd_permission.Invoke (builder, permissions);\n\t\t\t} catch {\n\t\t\t\tbase.AddPermissionRequests (permissions);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void AddTypeForwarder (TypeSpec type, Location loc)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (add_type_forwarder == null) {\n\t\t\t\t\tadd_type_forwarder = typeof (AssemblyBuilder).GetMethod (\"AddTypeForwarder\", BindingFlags.NonPublic | BindingFlags.Instance);\n\t\t\t\t}\n\n\t\t\t\tadd_type_forwarder.Invoke (builder, new object[] { type.GetMetaInfo () });\n\t\t\t} catch {\n\t\t\t\tbase.AddTypeForwarder (type, loc);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void DefineWin32IconResource (string fileName)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (win32_icon_define == null)\n\t\t\t\t\twin32_icon_define = typeof (AssemblyBuilder).GetMethod (\"DefineIconResource\", BindingFlags.Instance | BindingFlags.NonPublic);\n\n\t\t\t\twin32_icon_define.Invoke (builder, new object[] { fileName });\n\t\t\t} catch {\n\t\t\t\tbase.DefineWin32IconResource (fileName);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void SetAlgorithmId (uint value, Location loc)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (assembly_algorithm == null)\n\t\t\t\t\tassembly_algorithm = typeof (AssemblyBuilder).GetField (\"algid\", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField);\n\n\t\t\t\tassembly_algorithm.SetValue (builder, value);\n\t\t\t} catch {\n\t\t\t\tbase.SetAlgorithmId (value, loc);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void SetCulture (string culture, Location loc)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (assembly_culture == null)\n\t\t\t\t\tassembly_culture = typeof (AssemblyBuilder).GetField (\"culture\", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField);\n\n\t\t\t\tassembly_culture.SetValue (builder, culture);\n\t\t\t} catch {\n\t\t\t\tbase.SetCulture (culture, loc);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void SetFlags (uint flags, Location loc)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (assembly_flags == null)\n\t\t\t\t\tassembly_flags = typeof (AssemblyBuilder).GetField (\"flags\", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField);\n\n\t\t\t\tassembly_flags.SetValue (builder, flags);\n\t\t\t} catch {\n\t\t\t\tbase.SetFlags (flags, loc);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void SetVersion (Version version, Location loc)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (assembly_version == null)\n\t\t\t\t\tassembly_version = typeof (AssemblyBuilder).GetField (\"version\", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetField);\n\n\t\t\t\tassembly_version.SetValue (builder, version.ToString (4));\n\t\t\t} catch {\n\t\t\t\tbase.SetVersion (version, loc);\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Reflection based references loader\n\t//\n\tclass DynamicLoader : AssemblyReferencesLoader<Assembly>\n\t{\n\t\treadonly ReflectionImporter importer;\n\n\t\tpublic DynamicLoader (ReflectionImporter importer, CompilerContext compiler)\n\t\t\t: base (compiler)\n\t\t{\n\t\t\tpaths.Add (GetSystemDir ());\n\n\t\t\tthis.importer = importer;\n\t\t}\n\n\t\tpublic ReflectionImporter Importer {\n\t\t\tget {\n\t\t\t\treturn importer;\n\t\t\t}\n\t\t}\n\n\t\tprotected override string[] GetDefaultReferences ()\n\t\t{\n\t\t\t//\n\t\t\t// For now the \"default config\" is harcoded into the compiler\n\t\t\t// we can move this outside later\n\t\t\t//\n\t\t\tvar default_references = new List<string> (8);\n\n\t\t\tdefault_references.Add (\"System\");\n\t\t\tdefault_references.Add (\"System.Xml\");\n#if NET_2_1\n\t\t\tdefault_references.Add (\"System.Net\");\n\t\t\tdefault_references.Add (\"System.Windows\");\n\t\t\tdefault_references.Add (\"System.Windows.Browser\");\n#endif\n\n\t\t\tif (compiler.Settings.Version > LanguageVersion.ISO_2)\n\t\t\t\tdefault_references.Add (\"System.Core\");\n\t\t\tif (compiler.Settings.Version > LanguageVersion.V_3)\n\t\t\t\tdefault_references.Add (\"Microsoft.CSharp\");\n\n\t\t\treturn default_references.ToArray ();\n\t\t}\n\n\t\t//\n\t\t// Returns the directory where the system assemblies are installed\n\t\t//\n\t\tstatic string GetSystemDir ()\n\t\t{\n\t\t\treturn Path.GetDirectoryName (typeof (object).Assembly.Location);\n\t\t}\n\n\t\tpublic override bool HasObjectType (Assembly assembly)\n\t\t{\n\t\t\treturn assembly.GetType (compiler.BuiltinTypes.Object.FullName) != null;\n\t\t}\n\n\t\tpublic override Assembly LoadAssemblyFile (string assembly, bool isImplicitReference)\n\t\t{\n\t\t\tAssembly a = null;\n\n\t\t\ttry {\n\t\t\t\ttry {\n\t\t\t\t\tchar[] path_chars = { '/', '\\\\' };\n\n\t\t\t\t\tif (assembly.IndexOfAny (path_chars) != -1) {\n\t\t\t\t\t\ta = Assembly.LoadFrom (assembly);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstring ass = assembly;\n\t\t\t\t\t\tif (ass.EndsWith (\".dll\") || ass.EndsWith (\".exe\"))\n\t\t\t\t\t\t\tass = assembly.Substring (0, assembly.Length - 4);\n\t\t\t\t\t\ta = Assembly.Load (ass);\n\t\t\t\t\t}\n\t\t\t\t} catch (FileNotFoundException) {\n\t\t\t\t\tbool err = !isImplicitReference;\n\t\t\t\t\tforeach (string dir in paths) {\n\t\t\t\t\t\tstring full_path = Path.Combine (dir, assembly);\n\t\t\t\t\t\tif (!assembly.EndsWith (\".dll\") && !assembly.EndsWith (\".exe\"))\n\t\t\t\t\t\t\tfull_path += \".dll\";\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ta = Assembly.LoadFrom (full_path);\n\t\t\t\t\t\t\terr = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} catch (FileNotFoundException) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tError_FileNotFound (assembly);\n\t\t\t\t\t\treturn a;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (BadImageFormatException) {\n\t\t\t\tError_FileCorrupted (assembly);\n\t\t\t}\n\n\t\t\treturn a;\n\t\t}\n\n\t\tModule LoadModuleFile (AssemblyDefinitionDynamic assembly, string module)\n\t\t{\n\t\t\tstring total_log = \"\";\n\n\t\t\ttry {\n\t\t\t\ttry {\n\t\t\t\t\treturn assembly.IncludeModule (module);\n\t\t\t\t} catch (FileNotFoundException) {\n\t\t\t\t\tbool err = true;\n\t\t\t\t\tforeach (string dir in paths) {\n\t\t\t\t\t\tstring full_path = Path.Combine (dir, module);\n\t\t\t\t\t\tif (!module.EndsWith (\".netmodule\"))\n\t\t\t\t\t\t\tfull_path += \".netmodule\";\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn assembly.IncludeModule (full_path);\n\t\t\t\t\t\t} catch (FileNotFoundException ff) {\n\t\t\t\t\t\t\ttotal_log += ff.FusionLog;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tError_FileNotFound (module);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (BadImageFormatException) {\n\t\t\t\tError_FileCorrupted (module);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic void LoadModules (AssemblyDefinitionDynamic assembly, RootNamespace targetNamespace)\n\t\t{\n\t\t\tforeach (var moduleName in compiler.Settings.Modules) {\n\t\t\t\tvar m = LoadModuleFile (assembly, moduleName);\n\t\t\t\tif (m == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar md = importer.ImportModule (m, targetNamespace);\n\t\t\t\tassembly.AddModule (md);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void LoadReferences (ModuleContainer module)\n\t\t{\n\t\t\tAssembly corlib;\n\t\t\tList<Tuple<RootNamespace, Assembly>> loaded;\n\t\t\tbase.LoadReferencesCore (module, out corlib, out loaded);\n\n\t\t\tif (corlib == null)\n\t\t\t\treturn;\n\n\t\t\timporter.ImportAssembly (corlib, module.GlobalRootNamespace);\n\t\t\tforeach (var entry in loaded) {\n\t\t\t\timporter.ImportAssembly (entry.Item2, entry.Item1);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs",
    "content": "//\n// report.cs: report errors and warnings.\n//\n// Author: Miguel de Icaza (miguel@ximian.com)\n//         Marek Safar (marek.safar@gmail.com)         \n//\n// Copyright 2001 Ximian, Inc. (http://www.ximian.com)\n// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)\n//\n\nusing System;\nusing System.IO;\nusing System.Text;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nnamespace Mono.CSharp {\n\n\t//\n\t// Errors and warnings manager\n\t//\n\tpublic class Report\n\t{\n\t\tpublic const int RuntimeErrorId = 10000;\n\n\t\tDictionary<int, WarningRegions> warning_regions_table;\n\n\t\tReportPrinter printer;\n\n\t\tint reporting_disabled;\n\n\t\treadonly CompilerSettings settings;\n\t\t\n\t\t/// <summary>\n\t\t/// List of symbols related to reported error/warning. You have to fill it before error/warning is reported.\n\t\t/// </summary>\n\t\tList<string> extra_information = new List<string> ();\n\n\t\t// \n\t\t// IF YOU ADD A NEW WARNING YOU HAVE TO ADD ITS ID HERE\n\t\t//\n\t\tpublic static readonly int[] AllWarnings = new int[] {\n\t\t\t28, 67, 78,\n\t\t\t105, 108, 109, 114, 162, 164, 168, 169, 183, 184, 197,\n\t\t\t219, 251, 252, 253, 278, 282,\n\t\t\t402, 414, 419, 420, 429, 436, 437, 440, 458, 464, 465, 467, 469, 472, 473,\n\t\t\t612, 618, 626, 628, 642, 649, 652, 657, 658, 659, 660, 661, 665, 672, 675, 693,\n\t\t\t728,\n\t\t\t809, 824,\n\t\t\t1030, 1058, 1060, 1066,\n\t\t\t1522, 1570, 1571, 1572, 1573, 1574, 1580, 1581, 1584, 1587, 1589, 1590, 1591, 1592,\n\t\t\t1607, 1616, 1633, 1634, 1635, 1685, 1690, 1691, 1692, 1695, 1696, 1697, 1699,\n\t\t\t1700, 1701, 1702, 1709, 1711, 1717, 1718, 1720, 1735,\n\t\t\t1901, 1956, 1981, 1998,\n\t\t\t2002, 2023, 2029,\n\t\t\t3000, 3001, 3002, 3003, 3005, 3006, 3007, 3008, 3009,\n\t\t\t3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019,\n\t\t\t3021, 3022, 3023, 3024, 3026, 3027,\n\t\t\t4014, 4024, 4025, 4026,\n\t\t\t7035, 7080, 7081, 7082, 7095,\n\t\t\t8009,\n\t\t};\n\n\t\tstatic HashSet<int> AllWarningsHashSet;\n\n\t\tpublic Report (CompilerContext context, ReportPrinter printer)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException (\"settings\");\n\t\t\tif (printer == null)\n\t\t\t\tthrow new ArgumentNullException (\"printer\");\n\n\t\t\tthis.settings = context.Settings;\n\t\t\tthis.printer = printer;\n\t\t}\n\n\t\tpublic void DisableReporting ()\n\t\t{\n\t\t\t++reporting_disabled;\n\t\t}\n\n\t\tpublic void EnableReporting ()\n\t\t{\n\t\t\t--reporting_disabled;\n\t\t}\n\n\t\tpublic void FeatureIsNotAvailable (CompilerContext compiler, Location loc, string feature)\n\t\t{\n\t\t\tstring version;\n\t\t\tswitch (compiler.Settings.Version) {\n\t\t\tcase LanguageVersion.ISO_1:\n\t\t\t\tversion = \"1.0\";\n\t\t\t\tbreak;\n\t\t\tcase LanguageVersion.ISO_2:\n\t\t\t\tversion = \"2.0\";\n\t\t\t\tbreak;\n\t\t\tcase LanguageVersion.V_3:\n\t\t\t\tversion = \"3.0\";\n\t\t\t\tbreak;\n\t\t\tcase LanguageVersion.V_4:\n\t\t\t\tversion = \"4.0\";\n\t\t\t\tbreak;\n\t\t\tcase LanguageVersion.V_5:\n\t\t\t\tversion = \"5.0\";\n\t\t\t\tbreak;\n\t\t\tcase LanguageVersion.V_6:\n\t\t\t\tversion = \"6.0\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new InternalErrorException (\"Invalid feature version\", compiler.Settings.Version);\n\t\t\t}\n\n\t\t\tError (1644, loc,\n\t\t\t\t\"Feature `{0}' cannot be used because it is not part of the C# {1} language specification\",\n\t\t\t\t      feature, version);\n\t\t}\n\n\t\tpublic void FeatureIsNotSupported (Location loc, string feature)\n\t\t{\n\t\t\tError (1644, loc,\n\t\t\t\t\"Feature `{0}' is not supported in Mono mcs1 compiler. Consider using the `gmcs' compiler instead\",\n\t\t\t\tfeature);\n\t\t}\n\t\t        \n\t\tpublic void RuntimeMissingSupport (Location loc, string feature) \n\t\t{\n\t\t\tError (-88, loc, \"Your .NET Runtime does not support `{0}'. Please use the latest Mono runtime instead.\", feature);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// In most error cases is very useful to have information about symbol that caused the error.\n\t\t/// Call this method before you call Report.Error when it makes sense.\n\t\t/// </summary>\n\t\tpublic void SymbolRelatedToPreviousError (Location loc, string symbol)\n\t\t{\n\t\t\tSymbolRelatedToPreviousError (loc.ToString ());\n\t\t}\n\n\t\tpublic void SymbolRelatedToPreviousError (MemberSpec ms)\n\t\t{\n\t\t\tif (reporting_disabled > 0 || !printer.HasRelatedSymbolSupport)\n\t\t\t\treturn;\n\n\t\t\tvar mc = ms.MemberDefinition as MemberCore;\n\t\t\twhile (ms is ElementTypeSpec) {\n\t\t\t\tms = ((ElementTypeSpec) ms).Element;\n\t\t\t\tmc = ms.MemberDefinition as MemberCore;\n\t\t\t}\n\n\t\t\tif (mc != null) {\n\t\t\t\tSymbolRelatedToPreviousError (mc);\n\t\t\t} else {\n\t\t\t\tif (ms.DeclaringType != null)\n\t\t\t\t\tms = ms.DeclaringType;\n\n\t\t\t\tvar imported_type = ms.MemberDefinition as ImportedTypeDefinition;\n\t\t\t\tif (imported_type != null) {\n\t\t\t\t\tvar iad = imported_type.DeclaringAssembly as ImportedAssemblyDefinition;\n\t\t\t\t\tSymbolRelatedToPreviousError (iad.Location);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void SymbolRelatedToPreviousError (MemberCore mc)\n\t\t{\n\t\t\tSymbolRelatedToPreviousError (mc.Location, mc.GetSignatureForError ());\n\t\t}\n\n\t\tpublic void SymbolRelatedToPreviousError (string loc)\n\t\t{\n\t\t\tstring msg = String.Format (\"{0} (Location of the symbol related to previous \", loc);\n\t\t\tif (extra_information.Contains (msg))\n\t\t\t\treturn;\n\n\t\t\textra_information.Add (msg);\n\t\t}\n\n\t\tpublic bool CheckWarningCode (int code, Location loc)\n\t\t{\n\t\t\tif (AllWarningsHashSet == null)\n\t\t\t\tAllWarningsHashSet = new HashSet<int> (AllWarnings);\n\n\t\t\tif (AllWarningsHashSet.Contains (code))\n\t\t\t\treturn true;\n\n\t\t\tWarning (1691, 1, loc, \"`{0}' is not a valid warning number\", code);\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void ExtraInformation (Location loc, string msg)\n\t\t{\n\t\t\textra_information.Add (String.Format (\"{0} {1}\", loc, msg));\n\t\t}\n\n\t\tpublic WarningRegions RegisterWarningRegion (Location location)\n\t\t{\n\t\t\tWarningRegions regions;\n\t\t\tif (warning_regions_table == null) {\n\t\t\t\tregions = null;\n\t\t\t\twarning_regions_table = new Dictionary<int, WarningRegions> ();\n\t\t\t} else {\n\t\t\t\twarning_regions_table.TryGetValue (location.File, out regions);\n\t\t\t}\n\n\t\t\tif (regions == null) {\n\t\t\t\tregions = new WarningRegions ();\n\t\t\t\twarning_regions_table.Add (location.File, regions);\n\t\t\t}\n\n\t\t\treturn regions;\n\t\t}\n\n\t\tpublic void Warning (int code, int level, Location loc, string message)\n\t\t{\n\t\t\tif (reporting_disabled > 0)\n\t\t\t\treturn;\n\n\t\t\tif (!settings.IsWarningEnabled (code, level))\n\t\t\t\treturn;\n\n\t\t\tif (warning_regions_table != null && !loc.IsNull) {\n\t\t\t\tWarningRegions regions;\n\t\t\t\tif (warning_regions_table.TryGetValue (loc.File, out regions) && !regions.IsWarningEnabled (code, loc.Row))\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tAbstractMessage msg;\n\t\t\tif (settings.IsWarningAsError (code)) {\n\t\t\t\tmessage = \"Warning as Error: \" + message;\n\t\t\t\tmsg = new ErrorMessage (code, loc, message, extra_information);\n\t\t\t} else {\n\t\t\t\tmsg = new WarningMessage (code, loc, message, extra_information);\n\t\t\t}\n\n\t\t\textra_information.Clear ();\n\t\t\tprinter.Print (msg, settings.ShowFullPaths);\n\t\t}\n\n\t\tpublic void Warning (int code, int level, Location loc, string format, string arg)\n\t\t{\n\t\t\tWarning (code, level, loc, String.Format (format, arg));\n\t\t}\n\n\t\tpublic void Warning (int code, int level, Location loc, string format, string arg1, string arg2)\n\t\t{\n\t\t\tWarning (code, level, loc, String.Format (format, arg1, arg2));\n\t\t}\n\n\t\tpublic void Warning (int code, int level, Location loc, string format, params object[] args)\n\t\t{\n\t\t\tWarning (code, level, loc, String.Format (format, args));\n\t\t}\n\n\t\tpublic void Warning (int code, int level, string message)\n\t\t{\n\t\t\tWarning (code, level, Location.Null, message);\n\t\t}\n\n\t\tpublic void Warning (int code, int level, string format, string arg)\n\t\t{\n\t\t\tWarning (code, level, Location.Null, format, arg);\n\t\t}\n\n\t\tpublic void Warning (int code, int level, string format, string arg1, string arg2)\n\t\t{\n\t\t\tWarning (code, level, Location.Null, format, arg1, arg2);\n\t\t}\n\n\t\tpublic void Warning (int code, int level, string format, params string[] args)\n\t\t{\n\t\t\tWarning (code, level, Location.Null, String.Format (format, args));\n\t\t}\n\n\t\t//\n\t\t// Warnings encountered so far\n\t\t//\n\t\tpublic int Warnings {\n\t\t\tget { return printer.WarningsCount; }\n\t\t}\n\n\t\tpublic void Error (int code, Location loc, string error)\n\t\t{\n\t\t\tif (reporting_disabled > 0)\n\t\t\t\treturn;\n\n\t\t\tErrorMessage msg = new ErrorMessage (code, loc, error, extra_information);\n\t\t\textra_information.Clear ();\n\n\t\t\tprinter.Print (msg, settings.ShowFullPaths);\n\n\t\t\tif (settings.Stacktrace)\n\t\t\t\tConsole.WriteLine (FriendlyStackTrace (new StackTrace (true)));\n\n\t\t\tif (printer.ErrorsCount == settings.FatalCounter)\n\t\t\t\tthrow new FatalException (msg.Text);\n\t\t}\n\n\t\tpublic void Error (int code, Location loc, string format, string arg)\n\t\t{\n\t\t\tError (code, loc, String.Format (format, arg));\n\t\t}\n\n\t\tpublic void Error (int code, Location loc, string format, string arg1, string arg2)\n\t\t{\n\t\t\tError (code, loc, String.Format (format, arg1, arg2));\n\t\t}\n\n\t\tpublic void Error (int code, Location loc, string format, params string[] args)\n\t\t{\n\t\t\tError (code, loc, String.Format (format, args));\n\t\t}\n\n\t\tpublic void Error (int code, string error)\n\t\t{\n\t\t\tError (code, Location.Null, error);\n\t\t}\n\n\t\tpublic void Error (int code, string format, string arg)\n\t\t{\n\t\t\tError (code, Location.Null, format, arg);\n\t\t}\n\n\t\tpublic void Error (int code, string format, string arg1, string arg2)\n\t\t{\n\t\t\tError (code, Location.Null, format, arg1, arg2);\n\t\t}\n\n\t\tpublic void Error (int code, string format, params string[] args)\n\t\t{\n\t\t\tError (code, Location.Null, String.Format (format, args));\n\t\t}\n\n\t\t//\n\t\t// Errors encountered so far\n\t\t//\n\t\tpublic int Errors {\n\t\t\tget { return printer.ErrorsCount; }\n\t\t}\n\n\t\tpublic bool IsDisabled {\n\t\t\tget {\n\t\t\t\treturn reporting_disabled > 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic ReportPrinter Printer {\n\t\t\tget { return printer; }\n\t\t}\n\n\t\tpublic ReportPrinter SetPrinter (ReportPrinter printer)\n\t\t{\n\t\t\tReportPrinter old = this.printer;\n\t\t\tthis.printer = printer;\n\t\t\treturn old;\n\t\t}\n\n\t\t[Conditional (\"MCS_DEBUG\")]\n\t\tstatic public void Debug (string message, params object[] args)\n\t\t{\n\t\t\tDebug (4, message, args);\n\t\t}\n\t\t\t\n\t\t[Conditional (\"MCS_DEBUG\")]\n\t\tstatic public void Debug (int category, string message, params object[] args)\n\t\t{\n//\t\t\tif ((category & DebugFlags) == 0)\n//\t\t\t\treturn;\n\n\t\t\tStringBuilder sb = new StringBuilder (message);\n\n\t\t\tif ((args != null) && (args.Length > 0)) {\n\t\t\t\tsb.Append (\": \");\n\n\t\t\t\tbool first = true;\n\t\t\t\tforeach (object arg in args) {\n\t\t\t\t\tif (first)\n\t\t\t\t\t\tfirst = false;\n\t\t\t\t\telse\n\t\t\t\t\t\tsb.Append (\", \");\n\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\tsb.Append (\"null\");\n//\t\t\t\t\telse if (arg is ICollection)\n//\t\t\t\t\t\tsb.Append (PrintCollection ((ICollection) arg));\n\t\t\t\t\telse\n\t\t\t\t\t\tsb.Append (arg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConsole.WriteLine (sb.ToString ());\n\t\t}\n/*\n\t\tstatic public string PrintCollection (ICollection collection)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\n\t\t\tsb.Append (collection.GetType ());\n\t\t\tsb.Append (\"(\");\n\n\t\t\tbool first = true;\n\t\t\tforeach (object o in collection) {\n\t\t\t\tif (first)\n\t\t\t\t\tfirst = false;\n\t\t\t\telse\n\t\t\t\t\tsb.Append (\", \");\n\t\t\t\tsb.Append (o);\n\t\t\t}\n\n\t\t\tsb.Append (\")\");\n\t\t\treturn sb.ToString ();\n\t\t}\n*/\n\t\tstatic string FriendlyStackTrace (StackTrace t)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\n\t\t\tbool foundUserCode = false;\n\n\t\t\tfor (int i = 0; i < t.FrameCount; i++) {\n\t\t\t\tStackFrame f = t.GetFrame (i);\n\t\t\t\tvar mb = f.GetMethod ();\n\n\t\t\t\tif (!foundUserCode && mb.ReflectedType == typeof (Report))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfoundUserCode = true;\n\n\t\t\t\tsb.Append (\"\\tin \");\n\n\t\t\t\tif (f.GetFileLineNumber () > 0)\n\t\t\t\t\tsb.AppendFormat (\"(at {0}:{1}) \", f.GetFileName (), f.GetFileLineNumber ());\n\n\t\t\t\tsb.AppendFormat (\"{0}.{1} (\", mb.ReflectedType.Name, mb.Name);\n\n\t\t\t\tbool first = true;\n\t\t\t\tforeach (var pi in mb.GetParameters ()) {\n\t\t\t\t\tif (!first)\n\t\t\t\t\t\tsb.Append (\", \");\n\t\t\t\t\tfirst = false;\n\n\t\t\t\t\tsb.Append (pi.ParameterType.FullName);\n\t\t\t\t}\n\t\t\t\tsb.Append (\")\\n\");\n\t\t\t}\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\t}\n\n\tpublic abstract class AbstractMessage\n\t{\n\t\treadonly string[] extra_info;\n\t\tprotected readonly int code;\n\t\tprotected readonly Location location;\n\t\treadonly string message;\n\n\t\tprotected AbstractMessage (int code, Location loc, string msg, List<string> extraInfo)\n\t\t{\n\t\t\tthis.code = code;\n\t\t\tif (code < 0)\n\t\t\t\tthis.code = 8000 - code;\n\n\t\t\tthis.location = loc;\n\t\t\tthis.message = msg;\n\t\t\tif (extraInfo.Count != 0) {\n\t\t\t\tthis.extra_info = extraInfo.ToArray ();\n\t\t\t}\n\t\t}\n\n\t\tprotected AbstractMessage (AbstractMessage aMsg)\n\t\t{\n\t\t\tthis.code = aMsg.code;\n\t\t\tthis.location = aMsg.location;\n\t\t\tthis.message = aMsg.message;\n\t\t\tthis.extra_info = aMsg.extra_info;\n\t\t}\n\n\t\tpublic int Code {\n\t\t\tget { return code; }\n\t\t}\n\n\t\tpublic override bool Equals (object obj)\n\t\t{\n\t\t\tAbstractMessage msg = obj as AbstractMessage;\n\t\t\tif (msg == null)\n\t\t\t\treturn false;\n\n\t\t\treturn code == msg.code && location.Equals (msg.location) && message == msg.message;\n\t\t}\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn code.GetHashCode ();\n\t\t}\n\n\t\tpublic abstract bool IsWarning { get; }\n\n\t\tpublic Location Location {\n\t\t\tget { return location; }\n\t\t}\n\n\t\tpublic abstract string MessageType { get; }\n\n\t\tpublic string[] RelatedSymbols {\n\t\t\tget { return extra_info; }\n\t\t}\n\n\t\tpublic string Text {\n\t\t\tget { return message; }\n\t\t}\n\t}\n\n\tsealed class WarningMessage : AbstractMessage\n\t{\n\t\tpublic WarningMessage (int code, Location loc, string message, List<string> extra_info)\n\t\t\t: base (code, loc, message, extra_info)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsWarning {\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override string MessageType {\n\t\t\tget {\n\t\t\t\treturn \"warning\";\n\t\t\t}\n\t\t}\n\t}\n\n\tsealed class ErrorMessage : AbstractMessage\n\t{\n\t\tpublic ErrorMessage (int code, Location loc, string message, List<string> extraInfo)\n\t\t\t: base (code, loc, message, extraInfo)\n\t\t{\n\t\t}\n\n\t\tpublic ErrorMessage (AbstractMessage aMsg)\n\t\t\t: base (aMsg)\n\t\t{\n\t\t}\n\n\t\tpublic override bool IsWarning {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override string MessageType {\n\t\t\tget {\n\t\t\t\treturn \"error\";\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Generic base for any message writer\n\t//\n\tpublic abstract class ReportPrinter\n\t{\n\t\tprotected HashSet<ITypeDefinition> reported_missing_definitions;\n\n\t\t#region Properties\n\n\t\tpublic int ErrorsCount { get; protected set; }\n\t\t\n\t\tpublic int WarningsCount { get; private set; }\n\t\n\t\t//\n\t\t// When (symbols related to previous ...) can be used\n\t\t//\n\t\tpublic virtual bool HasRelatedSymbolSupport {\n\t\t\tget { return true; }\n\t\t}\n\n\t\t#endregion\n\n\n\t\tprotected virtual string FormatText (string txt)\n\t\t{\n\t\t\treturn txt;\n\t\t}\n\n\t\tpublic virtual void Print (AbstractMessage msg, bool showFullPath)\n\t\t{\n\t\t\tif (msg.IsWarning) {\n\t\t\t\t++WarningsCount;\n\t\t\t} else {\n\t\t\t\t++ErrorsCount;\n\t\t\t}\n\t\t}\n\n\t\tprotected void Print (AbstractMessage msg, TextWriter output, bool showFullPath)\n\t\t{\n\t\t\tStringBuilder txt = new StringBuilder ();\n\t\t\tif (!msg.Location.IsNull) {\n\t\t\t\tif (showFullPath)\n\t\t\t\t\ttxt.Append (msg.Location.ToStringFullName ());\n\t\t\t\telse\n\t\t\t\t\ttxt.Append (msg.Location.ToString ());\n\n\t\t\t\ttxt.Append (\" \");\n\t\t\t}\n\n\t\t\ttxt.AppendFormat (\"{0} CS{1:0000}: {2}\", msg.MessageType, msg.Code, msg.Text);\n\n\t\t\tif (!msg.IsWarning)\n\t\t\t\toutput.WriteLine (FormatText (txt.ToString ()));\n\t\t\telse\n\t\t\t\toutput.WriteLine (txt.ToString ());\n\n\t\t\tif (msg.RelatedSymbols != null) {\n\t\t\t\tforeach (string s in msg.RelatedSymbols)\n\t\t\t\t\toutput.WriteLine (s + msg.MessageType + \")\");\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Tracks reported missing types. It needs to be session specific \n\t\t// because we can run in probing mode\n\t\t//\n\t\tpublic bool MissingTypeReported (ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (reported_missing_definitions == null)\n\t\t\t\treported_missing_definitions = new HashSet<ITypeDefinition> ();\n\n\t\t\tif (reported_missing_definitions.Contains (typeDefinition))\n\t\t\t\treturn true;\n\n\t\t\treported_missing_definitions.Add (typeDefinition);\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void Reset ()\n\t\t{\n\t\t\t// HACK: Temporary hack for broken repl flow\n\t\t\tErrorsCount = WarningsCount = 0;\n\t\t}\n\t}\n\n\tsealed class NullReportPrinter : ReportPrinter\n\t{\n\t}\n\n\t//\n\t// Default message recorder, it uses two types of message groups.\n\t// Common messages: messages reported in all sessions.\n\t// Merged messages: union of all messages in all sessions. \n\t//\n\t// Used by the Lambda expressions to compile the code with various\n\t// parameter values, or by attribute resolver\n\t//\n\tclass SessionReportPrinter : ReportPrinter\n\t{\n\t\tList<AbstractMessage> session_messages;\n\t\t//\n\t\t// A collection of exactly same messages reported in all sessions\n\t\t//\n\t\tList<AbstractMessage> common_messages;\n\n\t\t//\n\t\t// A collection of unique messages reported in all sessions\n\t\t//\n\t\tList<AbstractMessage> merged_messages;\n\n\t\tbool showFullPaths;\n\n\t\tpublic void ClearSession ()\n\t\t{\n\t\t\tsession_messages = null;\n\t\t}\n\n\t\tpublic override void Print (AbstractMessage msg, bool showFullPath)\n\t\t{\n\t\t\t//\n\t\t\t// This line is useful when debugging recorded messages\n\t\t\t//\n\t\t\t// Console.WriteLine (\"RECORDING: {0}\", msg.Text);\n\n\t\t\tif (session_messages == null)\n\t\t\t\tsession_messages = new List<AbstractMessage> ();\n\n\t\t\tsession_messages.Add (msg);\n\n\t\t\tthis.showFullPaths = showFullPath;\n\t\t\tbase.Print (msg, showFullPath);\n\t\t}\n\n\t\tpublic void EndSession ()\n\t\t{\n\t\t\tif (session_messages == null)\n\t\t\t\treturn;\n\n\t\t\t//\n\t\t\t// Handles the first session\n\t\t\t//\n\t\t\tif (common_messages == null) {\n\t\t\t\tcommon_messages = new List<AbstractMessage> (session_messages);\n\t\t\t\tmerged_messages = session_messages;\n\t\t\t\tsession_messages = null;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Store common messages if any\n\t\t\t//\n\t\t\tfor (int i = 0; i < common_messages.Count; ++i) {\n\t\t\t\tAbstractMessage cmsg = common_messages[i];\n\t\t\t\tbool common_msg_found = false;\n\t\t\t\tforeach (AbstractMessage msg in session_messages) {\n\t\t\t\t\tif (cmsg.Equals (msg)) {\n\t\t\t\t\t\tcommon_msg_found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!common_msg_found)\n\t\t\t\t\tcommon_messages.RemoveAt (i);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Merge session and previous messages\n\t\t\t//\n\t\t\tfor (int i = 0; i < session_messages.Count; ++i) {\n\t\t\t\tAbstractMessage msg = session_messages[i];\n\t\t\t\tbool msg_found = false;\n\t\t\t\tfor (int ii = 0; ii < merged_messages.Count; ++ii) {\n\t\t\t\t\tif (msg.Equals (merged_messages[ii])) {\n\t\t\t\t\t\tmsg_found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!msg_found)\n\t\t\t\t\tmerged_messages.Add (msg);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn merged_messages == null && common_messages == null;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Prints collected messages, common messages have a priority\n\t\t//\n\t\tpublic bool Merge (ReportPrinter dest)\n\t\t{\n\t\t\tvar messages_to_print = merged_messages;\n\t\t\tif (common_messages != null && common_messages.Count > 0) {\n\t\t\t\tmessages_to_print = common_messages;\n\t\t\t}\n\n\t\t\tif (messages_to_print == null)\n\t\t\t\treturn false;\n\n\t\t\tbool error_msg = false;\n\t\t\tforeach (AbstractMessage msg in messages_to_print) {\n\t\t\t\tdest.Print (msg, showFullPaths);\n\t\t\t\terror_msg |= !msg.IsWarning;\n\t\t\t}\n\n\t\t\tif (reported_missing_definitions != null) {\n\t\t\t\tforeach (var missing in reported_missing_definitions)\n\t\t\t\t\tdest.MissingTypeReported (missing);\n\t\t\t}\n\n\t\t\treturn error_msg;\n\t\t}\n\t}\n\n\tpublic class StreamReportPrinter : ReportPrinter\n\t{\n\t\treadonly TextWriter writer;\n\n\t\tpublic StreamReportPrinter (TextWriter writer)\n\t\t{\n\t\t\tthis.writer = writer;\n\t\t}\n\n\t\tpublic override void Print (AbstractMessage msg, bool showFullPath)\n\t\t{\n\t\t\tPrint (msg, writer, showFullPath);\n\t\t\tbase.Print (msg, showFullPath);\n\t\t}\n\t}\n\n\tpublic class ConsoleReportPrinter : StreamReportPrinter\n\t{\n\t\tstatic readonly string prefix, postfix;\n\n\t\tstatic ConsoleReportPrinter ()\n\t\t{\n\t\t\tstring term = Environment.GetEnvironmentVariable (\"TERM\");\n\t\t\tbool xterm_colors = false;\n\t\t\t\n\t\t\tswitch (term){\n\t\t\tcase \"xterm\":\n\t\t\tcase \"rxvt\":\n\t\t\tcase \"rxvt-unicode\": \n\t\t\t\tif (Environment.GetEnvironmentVariable (\"COLORTERM\") != null){\n\t\t\t\t\txterm_colors = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"xterm-color\":\n\t\t\tcase \"xterm-256color\":\n\t\t\t\txterm_colors = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!xterm_colors)\n\t\t\t\treturn;\n\n\t\t\tif (!(UnixUtils.isatty (1) && UnixUtils.isatty (2)))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tstring config = Environment.GetEnvironmentVariable (\"MCS_COLORS\");\n\t\t\tif (config == null){\n\t\t\t\tconfig = \"errors=red\";\n\t\t\t\t//config = \"brightwhite,red\";\n\t\t\t}\n\n\t\t\tif (config == \"disable\")\n\t\t\t\treturn;\n\n\t\t\tif (!config.StartsWith (\"errors=\"))\n\t\t\t\treturn;\n\n\t\t\tconfig = config.Substring (7);\n\t\t\t\n\t\t\tint p = config.IndexOf (\",\");\n\t\t\tif (p == -1)\n\t\t\t\tprefix = GetForeground (config);\n\t\t\telse\n\t\t\t\tprefix = GetBackground (config.Substring (p+1)) + GetForeground (config.Substring (0, p));\n\t\t\tpostfix = \"\\x001b[0m\";\n\t\t}\n\n\t\tpublic ConsoleReportPrinter ()\n\t\t\t: base (Console.Error)\n\t\t{\n\t\t}\n\n\t\tpublic ConsoleReportPrinter (TextWriter writer)\n\t\t\t: base (writer)\n\t\t{\n\t\t}\n\n\t\tstatic int NameToCode (string s)\n\t\t{\n\t\t\tswitch (s) {\n\t\t\tcase \"black\":\n\t\t\t\treturn 0;\n\t\t\tcase \"red\":\n\t\t\t\treturn 1;\n\t\t\tcase \"green\":\n\t\t\t\treturn 2;\n\t\t\tcase \"yellow\":\n\t\t\t\treturn 3;\n\t\t\tcase \"blue\":\n\t\t\t\treturn 4;\n\t\t\tcase \"magenta\":\n\t\t\t\treturn 5;\n\t\t\tcase \"cyan\":\n\t\t\t\treturn 6;\n\t\t\tcase \"grey\":\n\t\t\tcase \"white\":\n\t\t\t\treturn 7;\n\t\t\t}\n\t\t\treturn 7;\n\t\t}\n\n\t\t//\n\t\t// maps a color name to its xterm color code\n\t\t//\n\t\tstatic string GetForeground (string s)\n\t\t{\n\t\t\tstring highcode;\n\n\t\t\tif (s.StartsWith (\"bright\")) {\n\t\t\t\thighcode = \"1;\";\n\t\t\t\ts = s.Substring (6);\n\t\t\t} else\n\t\t\t\thighcode = \"\";\n\n\t\t\treturn \"\\x001b[\" + highcode + (30 + NameToCode (s)).ToString () + \"m\";\n\t\t}\n\n\t\tstatic string GetBackground (string s)\n\t\t{\n\t\t\treturn \"\\x001b[\" + (40 + NameToCode (s)).ToString () + \"m\";\n\t\t}\n\n\t\tprotected override string FormatText (string txt)\n\t\t{\n\t\t\tif (prefix != null)\n\t\t\t\treturn prefix + txt + postfix;\n\n\t\t\treturn txt;\n\t\t}\n\t}\n\n\tclass TimeReporter\n\t{\n\t\tpublic enum TimerType\n\t\t{\n\t\t\tParseTotal,\n\t\t\tAssemblyBuilderSetup,\n\t\t\tCreateTypeTotal,\n\t\t\tReferencesLoading,\n\t\t\tReferencesImporting,\n\t\t\tPredefinedTypesInit,\n\t\t\tModuleDefinitionTotal,\n\t\t\tEmitTotal,\n\t\t\tCloseTypes,\n\t\t\tResouces,\n\t\t\tOutputSave,\n\t\t\tDebugSave,\n\t\t}\n\n\t\treadonly Stopwatch[] timers;\n\t\tStopwatch total;\n\n\t\tpublic TimeReporter (bool enabled)\n\t\t{\n\t\t\tif (!enabled)\n\t\t\t\treturn;\n\n\t\t\ttimers = new Stopwatch[System.Enum.GetValues(typeof (TimerType)).Length];\n\t\t}\n\n\t\tpublic void Start (TimerType type)\n\t\t{\n\t\t\tif (timers != null) {\n\t\t\t\tvar sw = new Stopwatch ();\n\t\t\t\ttimers[(int) type] = sw;\n\t\t\t\tsw.Start ();\n\t\t\t}\n\t\t}\n\n\t\tpublic void StartTotal ()\n\t\t{\n\t\t\ttotal = new Stopwatch ();\n\t\t\ttotal.Start ();\n\t\t}\n\n\t\tpublic void Stop (TimerType type)\n\t\t{\n\t\t\tif (timers != null) {\n\t\t\t\ttimers[(int) type].Stop ();\n\t\t\t}\n\t\t}\n\n\t\tpublic void StopTotal ()\n\t\t{\n\t\t\ttotal.Stop ();\n\t\t}\n\n\t\tpublic void ShowStats ()\n\t\t{\n\t\t\tif (timers == null)\n\t\t\t\treturn;\n\n\t\t\tDictionary<TimerType, string> timer_names = new Dictionary<TimerType,string> {\n\t\t\t\t{ TimerType.ParseTotal, \"Parsing source files\" },\n\t\t\t\t{ TimerType.AssemblyBuilderSetup, \"Assembly builder setup\" },\n\t\t\t\t{ TimerType.CreateTypeTotal, \"Compiled types created\" },\n\t\t\t\t{ TimerType.ReferencesLoading, \"Referenced assemblies loading\" },\n\t\t\t\t{ TimerType.ReferencesImporting, \"Referenced assemblies importing\" },\n\t\t\t\t{ TimerType.PredefinedTypesInit, \"Predefined types initialization\" },\n\t\t\t\t{ TimerType.ModuleDefinitionTotal, \"Module definition\" },\n\t\t\t\t{ TimerType.EmitTotal, \"Resolving and emitting members blocks\" },\n\t\t\t\t{ TimerType.CloseTypes, \"Module types closed\" },\n\t\t\t\t{ TimerType.Resouces, \"Embedding resources\" },\n\t\t\t\t{ TimerType.OutputSave, \"Writing output file\" },\n\t\t\t\t{ TimerType.DebugSave, \"Writing debug symbols file\" },\n\t\t\t};\n\n\t\t\tint counter = 0;\n\t\t\tdouble percentage = (double) total.ElapsedMilliseconds / 100;\n\t\t\tlong subtotal = total.ElapsedMilliseconds;\n\t\t\tforeach (var timer in timers) {\n\t\t\t\tstring msg = timer_names[(TimerType) counter++];\n\t\t\t\tvar ms = timer == null ? 0 : timer.ElapsedMilliseconds;\n\t\t\t\tConsole.WriteLine (\"{0,4:0.0}% {1,5}ms {2}\", ms / percentage, ms, msg);\n\t\t\t\tsubtotal -= ms;\n\t\t\t}\n\n\t\t\tConsole.WriteLine (\"{0,4:0.0}% {1,5}ms Other tasks\", subtotal / percentage, subtotal);\n\t\t\tConsole.WriteLine ();\n\t\t\tConsole.WriteLine (\"Total elapsed time: {0}\", total.Elapsed);\n\t\t}\n\t}\n\n\tpublic class InternalErrorException : Exception {\n\t\tpublic InternalErrorException (MemberCore mc, Exception e)\n\t\t\t: base (mc.Location + \" \" + mc.GetSignatureForError (), e)\n\t\t{\n\t\t}\n\n\t\tpublic InternalErrorException ()\n\t\t\t: base (\"Internal error\")\n\t\t{\n\t\t}\n\n\t\tpublic InternalErrorException (string message)\n\t\t\t: base (message)\n\t\t{\n\t\t}\n\n\t\tpublic InternalErrorException (string message, params object[] args)\n\t\t\t: base (String.Format (message, args))\n\t\t{\n\t\t}\n\n\t\tpublic InternalErrorException (Exception exception, string message, params object[] args)\n\t\t\t: base (String.Format (message, args), exception)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic InternalErrorException (Exception e, Location loc)\n\t\t\t: base (loc.ToString (), e)\n\t\t{\n\t\t}\n\t}\n\n\tclass FatalException : Exception\n\t{\n\t\tpublic FatalException (string message)\n\t\t\t: base (message)\n\t\t{\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Handles #pragma warning\n\t/// </summary>\n\tpublic class WarningRegions {\n\n\t\tabstract class PragmaCmd\n\t\t{\n\t\t\tpublic int Line;\n\n\t\t\tprotected PragmaCmd (int line)\n\t\t\t{\n\t\t\t\tLine = line;\n\t\t\t}\n\n\t\t\tpublic abstract bool IsEnabled (int code, bool previous);\n\t\t}\n\t\t\n\t\tclass Disable : PragmaCmd\n\t\t{\n\t\t\tint code;\n\t\t\tpublic Disable (int line, int code)\n\t\t\t\t: base (line)\n\t\t\t{\n\t\t\t\tthis.code = code;\n\t\t\t}\n\n\t\t\tpublic override bool IsEnabled (int code, bool previous)\n\t\t\t{\n\t\t\t\treturn this.code != code && previous;\n\t\t\t}\n\t\t}\n\n\t\tclass DisableAll : PragmaCmd\n\t\t{\n\t\t\tpublic DisableAll (int line)\n\t\t\t\t: base (line) {}\n\n\t\t\tpublic override bool IsEnabled(int code, bool previous)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tclass Enable : PragmaCmd\n\t\t{\n\t\t\tint code;\n\t\t\tpublic Enable (int line, int code)\n\t\t\t\t: base (line)\n\t\t\t{\n\t\t\t\tthis.code = code;\n\t\t\t}\n\n\t\t\tpublic override bool IsEnabled(int code, bool previous)\n\t\t\t{\n\t\t\t\treturn this.code == code || previous;\n\t\t\t}\n\t\t}\n\n\t\tclass EnableAll : PragmaCmd\n\t\t{\n\t\t\tpublic EnableAll (int line)\n\t\t\t\t: base (line) {}\n\n\t\t\tpublic override bool IsEnabled(int code, bool previous)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\n\t\tList<PragmaCmd> regions = new List<PragmaCmd> ();\n\n\t\tpublic void WarningDisable (int line)\n\t\t{\n\t\t\tregions.Add (new DisableAll (line));\n\t\t}\n\n\t\tpublic void WarningDisable (Location location, int code, Report Report)\n\t\t{\n\t\t\tif (Report.CheckWarningCode (code, location))\n\t\t\t\tregions.Add (new Disable (location.Row, code));\n\t\t}\n\n\t\tpublic void WarningEnable (int line)\n\t\t{\n\t\t\tregions.Add (new EnableAll (line));\n\t\t}\n\n\t\tpublic void WarningEnable (Location location, int code, CompilerContext context)\n\t\t{\n\t\t\tif (!context.Report.CheckWarningCode (code, location))\n\t\t\t\treturn;\n\n\t\t\tif (context.Settings.IsWarningDisabledGlobally (code))\n\t\t\t\tcontext.Report.Warning (1635, 1, location, \"Cannot restore warning `CS{0:0000}' because it was disabled globally\", code);\n\n\t\t\tregions.Add (new Enable (location.Row, code));\n\t\t}\n\n\t\tpublic bool IsWarningEnabled (int code, int src_line)\n\t\t{\n\t\t\tbool result = true;\n\t\t\tforeach (PragmaCmd pragma in regions) {\n\t\t\t\tif (src_line < pragma.Line)\n\t\t\t\t\tbreak;\n\n\t\t\t\tresult = pragma.IsEnabled (code, result);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/settings.cs",
    "content": "//\n// settings.cs: All compiler settings\n//\n// Author: Miguel de Icaza (miguel@ximian.com)\n//            Ravi Pratap  (ravi@ximian.com)\n//            Marek Safar  (marek.safar@gmail.com)\n//\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2008 Novell, Inc\n// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)\n//\n\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Globalization;\nusing System;\n\nnamespace Mono.CSharp {\n\n\tpublic enum LanguageVersion\n\t{\n\t\tISO_1 = 1,\n\t\tISO_2 = 2,\n\t\tV_3 = 3,\n\t\tV_4 = 4,\n\t\tV_5 = 5,\n\t\tV_6 = 6,\n\t\tExperimental = 100,\n\n\t\tDefault = LanguageVersion.V_6,\n\t}\n\n\tpublic enum RuntimeVersion\n\t{\n\t\tv1,\n\t\tv2,\n\t\tv4\n\t}\n\n\tpublic enum Target\n\t{\n\t\tLibrary, Exe, Module, WinExe\n\t}\n\n\tpublic enum Platform\n\t{\n\t\tAnyCPU,\n\t\tAnyCPU32Preferred,\n\t\tArm,\n\t\tX86,\n\t\tX64,\n\t\tIA64\n\t}\n\n\tpublic class CompilerSettings\n\t{\n\t\tpublic Target Target;\n\t\tpublic Platform Platform;\n\t\tpublic string TargetExt;\n\t\tpublic bool VerifyClsCompliance;\n\t\tpublic bool Optimize;\n\t\tpublic LanguageVersion Version;\n\t\tpublic bool EnhancedWarnings;\n\t\tpublic bool LoadDefaultReferences;\n\t\tpublic string SdkVersion;\n\n\t\tpublic string StrongNameKeyFile;\n\t\tpublic string StrongNameKeyContainer;\n\t\tpublic bool StrongNameDelaySign;\n\n\t\tpublic int TabSize;\n\n\t\tpublic bool WarningsAreErrors;\n\t\tpublic int WarningLevel;\n\n\t\t//\n\t\t// Assemblies references to be loaded\n\t\t//\n\t\tpublic List<string> AssemblyReferences;\n\n\t\t// \n\t\t// External aliases for assemblies\n\t\t//\n\t\tpublic List<Tuple<string, string>> AssemblyReferencesAliases;\n\n\t\t//\n\t\t// Modules to be embedded\n\t\t//\n\t\tpublic List<string> Modules;\n\n\t\t//\n\t\t// Lookup paths for referenced assemblies\n\t\t//\n\t\tpublic List<string> ReferencesLookupPaths;\n\n\t\t//\n\t\t// Encoding.\n\t\t//\n\t\tpublic Encoding Encoding;\n\n\t\t//\n\t\t// If set, enable XML documentation generation\n\t\t//\n\t\tpublic string DocumentationFile;\n\n\t\tpublic string MainClass;\n\n\t\t//\n\t\t// Output file\n\t\t//\n\t\tpublic string OutputFile;\n\n\t\t// \n\t\t// The default compiler checked state\n\t\t//\n\t\tpublic bool Checked;\n\n\t\t//\n\t\t// If true, the compiler is operating in statement mode,\n\t\t// this currently turns local variable declaration into\n\t\t// static variables of a class\n\t\t//\n\t\tpublic bool StatementMode;\t// TODO: SUPER UGLY\n\t\t\n\t\t//\n\t\t// Whether to allow Unsafe code\n\t\t//\n\t\tpublic bool Unsafe;\n\n\t\tpublic string Win32ResourceFile;\n\t\tpublic string Win32IconFile;\n\n\t\t//\n\t\t// A list of resource files for embedding\n\t\t//\n\t\tpublic List<AssemblyResource> Resources;\n\n\t\tpublic bool GenerateDebugInfo;\n\n\t\t#region Compiler debug flags only\n\t\tpublic bool ParseOnly, TokenizeOnly, Timestamps;\n\t\tpublic int DebugFlags;\n\t\tpublic int VerboseParserFlag;\n\t\tpublic int FatalCounter;\n\t\tpublic bool Stacktrace;\n\t\tpublic bool BreakOnInternalError;\n\t\t#endregion\n\n\t\tpublic bool ShowFullPaths;\n\n\t\t//\n\t\t// Whether we are being linked against the standard libraries.\n\t\t// This is only used to tell whether `System.Object' should\n\t\t// have a base class or not.\n\t\t//\n\t\tpublic bool StdLib;\n\n\t\tpublic RuntimeVersion StdLibRuntimeVersion;\n\n\t\tpublic string RuntimeMetadataVersion;\n\n\t\tpublic bool WriteMetadataOnly;\n\n\t\treadonly List<string> conditional_symbols;\n\n\t\treadonly List<SourceFile> source_files;\n\n\t\tList<int> warnings_as_error;\n\t\tList<int> warnings_only;\n\t\tHashSet<int> warning_ignore_table;\n\n\t\tpublic CompilerSettings ()\n\t\t{\n\t\t\tStdLib = true;\n\t\t\tTarget = Target.Exe;\n\t\t\tTargetExt = \".exe\";\n\t\t\tPlatform = Platform.AnyCPU;\n\t\t\tVersion = LanguageVersion.Default;\n\t\t\tVerifyClsCompliance = true;\n\t\t\tEncoding = Encoding.UTF8;\n\t\t\tLoadDefaultReferences = true;\n\t\t\tStdLibRuntimeVersion = RuntimeVersion.v4;\n\t\t\tWarningLevel = 4;\n\n\t\t\t// Default to 1 or mdb files would be platform speficic\n\t\t\tTabSize = 1;\n\n\t\t\tAssemblyReferences = new List<string> ();\n\t\t\tAssemblyReferencesAliases = new List<Tuple<string, string>> ();\n\t\t\tModules = new List<string> ();\n\t\t\tReferencesLookupPaths = new List<string> ();\n\n\t\t\tconditional_symbols = new List<string> ();\n\t\t\t//\n\t\t\t// Add default mcs define\n\t\t\t//\n\t\t\tconditional_symbols.Add (\"__MonoCS__\");\n\n\t\t\tsource_files = new List<SourceFile> ();\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic SourceFile FirstSourceFile {\n\t\t\tget {\n\t\t\t\treturn source_files.Count > 0 ? source_files [0] : null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasKeyFileOrContainer {\n\t\t\tget {\n\t\t\t\treturn StrongNameKeyFile != null || StrongNameKeyContainer != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool NeedsEntryPoint {\n\t\t\tget {\n\t\t\t\treturn Target == Target.Exe || Target == Target.WinExe;\n\t\t\t}\n\t\t}\n\n\t\tpublic List<SourceFile> SourceFiles {\n\t\t\tget {\n\t\t\t\treturn source_files;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void AddConditionalSymbol (string symbol)\n\t\t{\n\t\t\tif (!conditional_symbols.Contains (symbol))\n\t\t\t\tconditional_symbols.Add (symbol);\n\t\t}\n\n\t\tpublic void AddWarningAsError (int id)\n\t\t{\n\t\t\tif (warnings_as_error == null)\n\t\t\t\twarnings_as_error = new List<int> ();\n\n\t\t\twarnings_as_error.Add (id);\n\t\t}\n\n\t\tpublic void AddWarningOnly (int id)\n\t\t{\n\t\t\tif (warnings_only == null)\n\t\t\t\twarnings_only = new List<int> ();\n\n\t\t\twarnings_only.Add (id);\n\t\t}\n\n\t\tpublic bool IsConditionalSymbolDefined (string symbol)\n\t\t{\n\t\t\treturn conditional_symbols.Contains (symbol);\n\t\t}\n\n\t\tpublic bool IsWarningAsError (int code)\n\t\t{\n\t\t\tbool is_error = WarningsAreErrors;\n\n\t\t\t// Check specific list\n\t\t\tif (warnings_as_error != null)\n\t\t\t\tis_error |= warnings_as_error.Contains (code);\n\n\t\t\t// Ignore excluded warnings\n\t\t\tif (warnings_only != null && warnings_only.Contains (code))\n\t\t\t\tis_error = false;\n\n\t\t\treturn is_error;\n\t\t}\n\n\t\tpublic bool IsWarningEnabled (int code, int level)\n\t\t{\n\t\t\tif (WarningLevel < level)\n\t\t\t\treturn false;\n\n\t\t\treturn !IsWarningDisabledGlobally (code);\n\t\t}\n\n\t\tpublic bool IsWarningDisabledGlobally (int code)\n\t\t{\n\t\t\treturn warning_ignore_table != null && warning_ignore_table.Contains (code);\n\t\t}\n\n\t\tpublic void SetIgnoreWarning (int code)\n\t\t{\n\t\t\tif (warning_ignore_table == null)\n\t\t\t\twarning_ignore_table = new HashSet<int> ();\n\n\t\t\twarning_ignore_table.Add (code);\n\t\t}\n\t}\n\n\tpublic class CommandLineParser\n\t{\n\t\tenum ParseResult\n\t\t{\n\t\t\tSuccess,\n\t\t\tError,\n\t\t\tStop,\n\t\t\tUnknownOption\n\t\t}\n\n\t\tstatic readonly char[] argument_value_separator = { ';', ',' };\n\t\tstatic readonly char[] numeric_value_separator = { ';', ',', ' ' };\n\n\t\treadonly TextWriter output;\n\t\treadonly Report report;\n\t\tbool stop_argument;\n\n\t\tDictionary<string, int> source_file_index;\n\n\t\tpublic event Func<string[], int, int> UnknownOptionHandler;\n\n\t\tCompilerSettings parser_settings;\n\n\t\tpublic CommandLineParser (TextWriter errorOutput)\n\t\t\t: this (errorOutput, Console.Out)\n\t\t{\n\t\t}\n\n\t\tpublic CommandLineParser (TextWriter errorOutput, TextWriter messagesOutput)\n\t\t{\n\t\t\tvar rp = new StreamReportPrinter (errorOutput);\n\n\t\t\tparser_settings = new CompilerSettings ();\n\t\t\treport = new Report (new CompilerContext (parser_settings, rp), rp);\n\t\t\tthis.output = messagesOutput;\n\t\t}\n\n\t\tpublic bool HasBeenStopped {\n\t\t\tget {\n\t\t\t\treturn stop_argument;\n\t\t\t}\n\t\t}\n\n\t\tvoid About ()\n\t\t{\n\t\t\toutput.WriteLine (\n\t\t\t\t\"The Mono C# compiler is Copyright 2001-2011, Novell, Inc.\\n\\n\" +\n\t\t\t\t\"The compiler source code is released under the terms of the \\n\" +\n\t\t\t\t\"MIT X11 or GNU GPL licenses\\n\\n\" +\n\n\t\t\t\t\"For more information on Mono, visit the project Web site\\n\" +\n\t\t\t\t\"   http://www.mono-project.com\\n\\n\" +\n\n\t\t\t\t\"The compiler was written by Miguel de Icaza, Ravi Pratap, Martin Baulig, Marek Safar, Raja R Harinath, Atushi Enomoto\");\n\t\t}\n\n\t\tpublic CompilerSettings ParseArguments (string[] args)\n\t\t{\n\t\t\tCompilerSettings settings = new CompilerSettings ();\n\t\t\tif (!ParseArguments (settings, args))\n\t\t\t\treturn null;\n\n\t\t\treturn settings;\n\t\t}\n\n\t\tpublic bool ParseArguments (CompilerSettings settings, string[] args)\n\t\t{\n\t\t\tif (settings == null)\n\t\t\t\tthrow new ArgumentNullException (\"settings\");\n\n\t\t\tList<string> response_file_list = null;\n\t\t\tbool parsing_options = true;\n\t\t\tstop_argument = false;\n\t\t\tsource_file_index = new Dictionary<string, int> ();\n\n\t\t\tfor (int i = 0; i < args.Length; i++) {\n\t\t\t\tstring arg = args[i];\n\t\t\t\tif (arg.Length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (arg[0] == '@') {\n\t\t\t\t\tstring[] extra_args;\n\t\t\t\t\tstring response_file = arg.Substring (1);\n\n\t\t\t\t\tif (response_file_list == null)\n\t\t\t\t\t\tresponse_file_list = new List<string> ();\n\n\t\t\t\t\tif (response_file_list.Contains (response_file)) {\n\t\t\t\t\t\treport.Error (1515, \"Response file `{0}' specified multiple times\", response_file);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse_file_list.Add (response_file);\n\n\t\t\t\t\textra_args = LoadArgs (response_file);\n\t\t\t\t\tif (extra_args == null) {\n\t\t\t\t\t\treport.Error (2011, \"Unable to open response file: \" + response_file);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\targs = AddArgs (args, extra_args);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (parsing_options) {\n\t\t\t\t\tif (arg == \"--\") {\n\t\t\t\t\t\tparsing_options = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tbool dash_opt = arg[0] == '-';\n\t\t\t\t\tbool slash_opt = arg[0] == '/';\n\t\t\t\t\tif (dash_opt) {\n\t\t\t\t\t\tswitch (ParseOptionUnix (arg, ref args, ref i, settings)) {\n\t\t\t\t\t\tcase ParseResult.Error:\n\t\t\t\t\t\tcase ParseResult.Success:\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase ParseResult.Stop:\n\t\t\t\t\t\t\tstop_argument = true;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\tcase ParseResult.UnknownOption:\n\t\t\t\t\t\t\tif (UnknownOptionHandler != null) {\n\t\t\t\t\t\t\t\tvar ret = UnknownOptionHandler (args, i);\n\t\t\t\t\t\t\t\tif (ret != -1) {\n\t\t\t\t\t\t\t\t\ti = ret;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dash_opt || slash_opt) {\n\t\t\t\t\t\t// Try a -CSCOPTION\n\t\t\t\t\t\tstring csc_opt = dash_opt ? \"/\" + arg.Substring (1) : arg;\n\t\t\t\t\t\tswitch (ParseOption (csc_opt, ref args, settings)) {\n\t\t\t\t\t\tcase ParseResult.Error:\n\t\t\t\t\t\tcase ParseResult.Success:\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tcase ParseResult.UnknownOption:\n\t\t\t\t\t\t\t// Need to skip `/home/test.cs' however /test.cs is considered as error\n\t\t\t\t\t\t\tif ((slash_opt && arg.Length > 3 && arg.IndexOf ('/', 2) > 0))\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tif (UnknownOptionHandler != null) {\n\t\t\t\t\t\t\t\tvar ret = UnknownOptionHandler (args, i);\n\t\t\t\t\t\t\t\tif (ret != -1) {\n\t\t\t\t\t\t\t\t\ti = ret;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tError_WrongOption (arg);\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tcase ParseResult.Stop:\n\t\t\t\t\t\t\tstop_argument = true;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tProcessSourceFiles (arg, false, settings.SourceFiles);\n\t\t\t}\n\n\t\t\treturn report.Errors == 0;\n\t\t}\n\n\t\tvoid ProcessSourceFiles (string spec, bool recurse, List<SourceFile> sourceFiles)\n\t\t{\n\t\t\tstring path, pattern;\n\n\t\t\tSplitPathAndPattern (spec, out path, out pattern);\n\t\t\tif (pattern.IndexOf ('*') == -1) {\n\t\t\t\tAddSourceFile (spec, sourceFiles);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstring[] files;\n\t\t\ttry {\n\t\t\t\tfiles = Directory.GetFiles (path, pattern);\n\t\t\t} catch (System.IO.DirectoryNotFoundException) {\n\t\t\t\treport.Error (2001, \"Source file `\" + spec + \"' could not be found\");\n\t\t\t\treturn;\n\t\t\t} catch (System.IO.IOException) {\n\t\t\t\treport.Error (2001, \"Source file `\" + spec + \"' could not be found\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tforeach (string f in files) {\n\t\t\t\tAddSourceFile (f, sourceFiles);\n\t\t\t}\n\n\t\t\tif (!recurse)\n\t\t\t\treturn;\n\n\t\t\tstring[] dirs = null;\n\n\t\t\ttry {\n\t\t\t\tdirs = Directory.GetDirectories (path);\n\t\t\t} catch {\n\t\t\t}\n\n\t\t\tforeach (string d in dirs) {\n\n\t\t\t\t// Don't include path in this string, as each\n\t\t\t\t// directory entry already does\n\t\t\t\tProcessSourceFiles (d + \"/\" + pattern, true, sourceFiles);\n\t\t\t}\n\t\t}\n\n\t\tstatic string[] AddArgs (string[] args, string[] extra_args)\n\t\t{\n\t\t\tstring[] new_args;\n\t\t\tnew_args = new string[extra_args.Length + args.Length];\n\n\t\t\t// if args contains '--' we have to take that into account\n\t\t\t// split args into first half and second half based on '--'\n\t\t\t// and add the extra_args before --\n\t\t\tint split_position = Array.IndexOf (args, \"--\");\n\t\t\tif (split_position != -1) {\n\t\t\t\tArray.Copy (args, new_args, split_position);\n\t\t\t\textra_args.CopyTo (new_args, split_position);\n\t\t\t\tArray.Copy (args, split_position, new_args, split_position + extra_args.Length, args.Length - split_position);\n\t\t\t} else {\n\t\t\t\targs.CopyTo (new_args, 0);\n\t\t\t\textra_args.CopyTo (new_args, args.Length);\n\t\t\t}\n\n\t\t\treturn new_args;\n\t\t}\n\n\t\tvoid AddAssemblyReference (string alias, string assembly, CompilerSettings settings)\n\t\t{\n\t\t\tif (assembly.Length == 0) {\n\t\t\t\treport.Error (1680, \"Invalid reference alias `{0}='. Missing filename\", alias);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!IsExternAliasValid (alias)) {\n\t\t\t\treport.Error (1679, \"Invalid extern alias for -reference. Alias `{0}' is not a valid identifier\", alias);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsettings.AssemblyReferencesAliases.Add (Tuple.Create (alias, assembly));\n\t\t}\n\n\t\tvoid AddResource (AssemblyResource res, CompilerSettings settings)\n\t\t{\n\t\t\tif (settings.Resources == null) {\n\t\t\t\tsettings.Resources = new List<AssemblyResource> ();\n\t\t\t\tsettings.Resources.Add (res);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (settings.Resources.Contains (res)) {\n\t\t\t\treport.Error (1508, \"The resource identifier `{0}' has already been used in this assembly\", res.Name);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsettings.Resources.Add (res);\n\t\t}\n\n\t\tvoid AddSourceFile (string fileName, List<SourceFile> sourceFiles)\n\t\t{\n\t\t\tstring path = Path.GetFullPath (fileName);\n\n\t\t\tint index;\n\t\t\tif (source_file_index.TryGetValue (path, out index)) {\n\t\t\t\tstring other_name = sourceFiles[index - 1].Name;\n\t\t\t\tif (fileName.Equals (other_name))\n\t\t\t\t\treport.Warning (2002, 1, \"Source file `{0}' specified multiple times\", other_name);\n\t\t\t\telse\n\t\t\t\t\treport.Warning (2002, 1, \"Source filenames `{0}' and `{1}' both refer to the same file: {2}\", fileName, other_name, path);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar unit = new SourceFile (fileName, path, sourceFiles.Count + 1);\n\t\t\tsourceFiles.Add (unit);\n\t\t\tsource_file_index.Add (path, unit.Index);\n\t\t}\n\n\t\tpublic bool ProcessWarningsList (string text, Action<int> action)\n\t\t{\n\t\t\tbool valid = true;\n\t\t\tforeach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) {\n\t\t\t\tint id;\n\t\t\t\tif (!int.TryParse (wid, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) {\n\t\t\t\t\treport.Error (1904, \"`{0}' is not a valid warning number\", wid);\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (report.CheckWarningCode (id, Location.Null))\n\t\t\t\t\taction (id);\n\t\t\t}\n\n\t\t\treturn valid;\n\t\t}\n\n\t\tvoid Error_RequiresArgument (string option)\n\t\t{\n\t\t\treport.Error (2006, \"Missing argument for `{0}' option\", option);\n\t\t}\n\n\t\tvoid Error_RequiresFileName (string option)\n\t\t{\n\t\t\treport.Error (2005, \"Missing file specification for `{0}' option\", option);\n\t\t}\n\n\t\tvoid Error_WrongOption (string option)\n\t\t{\n\t\t\treport.Error (2007, \"Unrecognized command-line option: `{0}'\", option);\n\t\t}\n\n\t\tstatic bool IsExternAliasValid (string identifier)\n\t\t{\n\t\t\treturn Tokenizer.IsValidIdentifier (identifier);\n\t\t}\n\n\t\tstatic string[] LoadArgs (string file)\n\t\t{\n\t\t\tStreamReader f;\n\t\t\tvar args = new List<string> ();\n\t\t\tstring line;\n\t\t\ttry {\n\t\t\t\tf = new StreamReader (file);\n\t\t\t} catch {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tStringBuilder sb = new StringBuilder ();\n\n\t\t\twhile ((line = f.ReadLine ()) != null) {\n\t\t\t\tint t = line.Length;\n\n\t\t\t\tfor (int i = 0; i < t; i++) {\n\t\t\t\t\tchar c = line[i];\n\n\t\t\t\t\tif (c == '\"' || c == '\\'') {\n\t\t\t\t\t\tchar end = c;\n\n\t\t\t\t\t\tfor (i++; i < t; i++) {\n\t\t\t\t\t\t\tc = line[i];\n\n\t\t\t\t\t\t\tif (c == end)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tsb.Append (c);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (c == ' ') {\n\t\t\t\t\t\tif (sb.Length > 0) {\n\t\t\t\t\t\t\targs.Add (sb.ToString ());\n\t\t\t\t\t\t\tsb.Length = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tsb.Append (c);\n\t\t\t\t}\n\t\t\t\tif (sb.Length > 0) {\n\t\t\t\t\targs.Add (sb.ToString ());\n\t\t\t\t\tsb.Length = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn args.ToArray ();\n\t\t}\n\n\t\tvoid OtherFlags ()\n\t\t{\n\t\t\toutput.WriteLine (\n\t\t\t\t\"Other flags in the compiler\\n\" +\n\t\t\t\t\"   --fatal[=COUNT]    Makes error after COUNT fatal\\n\" +\n\t\t\t\t\"   --lint             Enhanced warnings\\n\" +\n\t\t\t\t\"   --metadata-only    Produced assembly will contain metadata only\\n\" +\n\t\t\t\t\"   --parse            Only parses the source file\\n\" +\n\t\t\t\t\"   --runtime:VERSION  Sets mscorlib.dll metadata version: v1, v2, v4\\n\" +\n\t\t\t\t\"   --stacktrace       Shows stack trace at error location\\n\" +\n\t\t\t\t\"   --timestamp        Displays time stamps of various compiler events\\n\" +\n\t\t\t\t\"   -v                 Verbose parsing (for debugging the parser)\\n\" +\n\t\t\t\t\"   --mcs-debug X      Sets MCS debugging level to X\\n\" +\n\t\t\t\t\"   --break-on-ice     Breaks compilation on internal compiler error\");\n\t\t}\n\n\t\t//\n\t\t// This parses the -arg and /arg options to the compiler, even if the strings\n\t\t// in the following text use \"/arg\" on the strings.\n\t\t//\n\t\tParseResult ParseOption (string option, ref string[] args, CompilerSettings settings)\n\t\t{\n\t\t\tint idx = option.IndexOf (':');\n\t\t\tstring arg, value;\n\n\t\t\tif (idx == -1) {\n\t\t\t\targ = option;\n\t\t\t\tvalue = \"\";\n\t\t\t} else {\n\t\t\t\targ = option.Substring (0, idx);\n\n\t\t\t\tvalue = option.Substring (idx + 1);\n\t\t\t}\n\n\t\t\tswitch (arg.ToLowerInvariant ()) {\n\t\t\tcase \"/nologo\":\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/t\":\n\t\t\tcase \"/target\":\n\t\t\t\tswitch (value) {\n\t\t\t\tcase \"exe\":\n\t\t\t\t\tsettings.Target = Target.Exe;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"winexe\":\n\t\t\t\t\tsettings.Target = Target.WinExe;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"library\":\n\t\t\t\t\tsettings.Target = Target.Library;\n\t\t\t\t\tsettings.TargetExt = \".dll\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"module\":\n\t\t\t\t\tsettings.Target = Target.Module;\n\t\t\t\t\tsettings.TargetExt = \".netmodule\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\treport.Error (2019, \"Invalid target type for -target. Valid options are `exe', `winexe', `library' or `module'\");\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/out\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tsettings.OutputFile = value;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/o\":\n\t\t\tcase \"/o+\":\n\t\t\tcase \"/optimize\":\n\t\t\tcase \"/optimize+\":\n\t\t\t\tsettings.Optimize = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/o-\":\n\t\t\tcase \"/optimize-\":\n\t\t\t\tsettings.Optimize = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\t// TODO: Not supported by csc 3.5+\n\t\t\tcase \"/incremental\":\n\t\t\tcase \"/incremental+\":\n\t\t\tcase \"/incremental-\":\n\t\t\t\t// nothing.\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/d\":\n\t\t\tcase \"/define\": {\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (string d in value.Split (argument_value_separator)) {\n\t\t\t\t\t\tstring conditional = d.Trim ();\n\t\t\t\t\t\tif (!Tokenizer.IsValidIdentifier (conditional)) {\n\t\t\t\t\t\t\treport.Warning (2029, 1, \"Invalid conditional define symbol `{0}'\", conditional);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsettings.AddConditionalSymbol (conditional);\n\t\t\t\t\t}\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\n\t\t\tcase \"/bugreport\":\n\t\t\t\t//\n\t\t\t\t// We should collect data, runtime, etc and store in the file specified\n\t\t\t\t//\n\t\t\t\toutput.WriteLine (\"To file bug reports, please visit: http://www.mono-project.com/Bugs\");\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/pkg\": {\n\t\t\t\t\tstring packages;\n\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\t\t\t\t\tpackages = String.Join (\" \", value.Split (new Char[] { ';', ',', '\\n', '\\r' }));\n\t\t\t\t\tstring pkgout = Driver.GetPackageFlags (packages, report);\n\n\t\t\t\t\tif (pkgout == null)\n\t\t\t\t\t\treturn ParseResult.Error;\n\n\t\t\t\t\tstring[] xargs = pkgout.Trim (new Char[] { ' ', '\\n', '\\r', '\\t' }).Split (new Char[] { ' ', '\\t' });\n\t\t\t\t\targs = AddArgs (args, xargs);\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\n\t\t\tcase \"/linkres\":\n\t\t\tcase \"/linkresource\":\n\t\t\tcase \"/res\":\n\t\t\tcase \"/resource\":\n\t\t\t\tAssemblyResource res = null;\n\t\t\t\tstring[] s = value.Split (argument_value_separator, StringSplitOptions.RemoveEmptyEntries);\n\t\t\t\tswitch (s.Length) {\n\t\t\t\tcase 1:\n\t\t\t\t\tif (s[0].Length == 0)\n\t\t\t\t\t\tgoto default;\n\t\t\t\t\tres = new AssemblyResource (s[0], Path.GetFileName (s[0]));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tres = new AssemblyResource (s[0], s[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tif (s[2] != \"public\" && s[2] != \"private\") {\n\t\t\t\t\t\treport.Error (1906, \"Invalid resource visibility option `{0}'. Use either `public' or `private' instead\", s[2]);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\t\t\t\t\tres = new AssemblyResource (s[0], s[1], s[2] == \"private\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treport.Error (-2005, \"Wrong number of arguments for option `{0}'\", option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tif (res != null) {\n\t\t\t\t\tres.IsEmbeded = arg[1] == 'r' || arg[1] == 'R';\n\t\t\t\t\tAddResource (res, settings);\n\t\t\t\t}\n\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/recurse\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tProcessSourceFiles (value, true, settings.SourceFiles);\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/r\":\n\t\t\tcase \"/reference\": {\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\n\t\t\t\t\tstring[] refs = value.Split (argument_value_separator);\n\t\t\t\t\tforeach (string r in refs) {\n\t\t\t\t\t\tif (r.Length == 0)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tstring val = r;\n\t\t\t\t\t\tint index = val.IndexOf ('=');\n\t\t\t\t\t\tif (index > -1) {\n\t\t\t\t\t\t\tstring alias = r.Substring (0, index);\n\t\t\t\t\t\t\tstring assembly = r.Substring (index + 1);\n\t\t\t\t\t\t\tAddAssemblyReference (alias, assembly, settings);\n\t\t\t\t\t\t\tif (refs.Length != 1) {\n\t\t\t\t\t\t\t\treport.Error (2034, \"Cannot specify multiple aliases using single /reference option\");\n\t\t\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsettings.AssemblyReferences.Add (val);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\t\t\tcase \"/addmodule\": {\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\n\t\t\t\t\tstring[] refs = value.Split (argument_value_separator);\n\t\t\t\t\tforeach (string r in refs) {\n\t\t\t\t\t\tsettings.Modules.Add (r);\n\t\t\t\t\t}\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\t\t\tcase \"/win32res\": {\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (settings.Win32IconFile != null)\n\t\t\t\t\t\treport.Error (1565, \"Cannot specify the `win32res' and the `win32ico' compiler option at the same time\");\n\n\t\t\t\t\tsettings.Win32ResourceFile = value;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\t\t\tcase \"/win32icon\": {\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (settings.Win32ResourceFile != null)\n\t\t\t\t\t\treport.Error (1565, \"Cannot specify the `win32res' and the `win32ico' compiler option at the same time\");\n\n\t\t\t\t\tsettings.Win32IconFile = value;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\t\t\tcase \"/doc\": {\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\n\t\t\t\t\tsettings.DocumentationFile = value;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\t\t\tcase \"/lib\": {\n\t\t\t\t\tstring[] libdirs;\n\n\t\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t\t}\n\n\t\t\t\t\tlibdirs = value.Split (argument_value_separator);\n\t\t\t\t\tforeach (string dir in libdirs)\n\t\t\t\t\t\tsettings.ReferencesLookupPaths.Add (dir);\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\n\t\t\tcase \"/debug-\":\n\t\t\t\tsettings.GenerateDebugInfo = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/debug\":\n\t\t\t\tif (value.Equals (\"full\", StringComparison.OrdinalIgnoreCase) || value.Equals (\"pdbonly\", StringComparison.OrdinalIgnoreCase) || idx < 0) {\n\t\t\t\t\tsettings.GenerateDebugInfo = true;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\n\t\t\t\tif (value.Length > 0) {\n\t\t\t\t\treport.Error (1902, \"Invalid debug option `{0}'. Valid options are `full' or `pdbonly'\", value);\n\t\t\t\t} else {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t}\n\n\t\t\t\treturn ParseResult.Error;\n\n\t\t\tcase \"/debug+\":\n\t\t\t\tsettings.GenerateDebugInfo = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/checked\":\n\t\t\tcase \"/checked+\":\n\t\t\t\tsettings.Checked = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/checked-\":\n\t\t\t\tsettings.Checked = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/clscheck\":\n\t\t\tcase \"/clscheck+\":\n\t\t\t\tsettings.VerifyClsCompliance = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/clscheck-\":\n\t\t\t\tsettings.VerifyClsCompliance = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/unsafe\":\n\t\t\tcase \"/unsafe+\":\n\t\t\t\tsettings.Unsafe = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/unsafe-\":\n\t\t\t\tsettings.Unsafe = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/warnaserror\":\n\t\t\tcase \"/warnaserror+\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tsettings.WarningsAreErrors = true;\n\t\t\t\t\tparser_settings.WarningsAreErrors = true;\n\t\t\t\t} else {\n\t\t\t\t\tif (!ProcessWarningsList (value, settings.AddWarningAsError))\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/warnaserror-\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tsettings.WarningsAreErrors = false;\n\t\t\t\t} else {\n\t\t\t\t\tif (!ProcessWarningsList (value, settings.AddWarningOnly))\n\t\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/warn\":\n\t\t\tcase \"/w\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tSetWarningLevel (value, settings);\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/nowarn\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tif (!ProcessWarningsList (value, settings.SetIgnoreWarning))\n\t\t\t\t\treturn ParseResult.Error;\n\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/noconfig\":\n\t\t\t\tsettings.LoadDefaultReferences = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/platform\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tswitch (value.ToLowerInvariant ()) {\n\t\t\t\tcase \"arm\":\n\t\t\t\t\tsettings.Platform = Platform.Arm;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"anycpu\":\n\t\t\t\t\tsettings.Platform = Platform.AnyCPU;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"x86\":\n\t\t\t\t\tsettings.Platform = Platform.X86;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"x64\":\n\t\t\t\t\tsettings.Platform = Platform.X64;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"itanium\":\n\t\t\t\t\tsettings.Platform = Platform.IA64;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"anycpu32bitpreferred\":\n\t\t\t\t\tsettings.Platform = Platform.AnyCPU32Preferred;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treport.Error (1672, \"Invalid -platform option `{0}'. Valid options are `anycpu', `anycpu32bitpreferred', `arm', `x86', `x64' or `itanium'\",\n\t\t\t\t\t\tvalue);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/sdk\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tsettings.SdkVersion = value;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\t// We just ignore this.\n\t\t\tcase \"/errorreport\":\n\t\t\tcase \"/filealign\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/helpinternal\":\n\t\t\t\tOtherFlags ();\n\t\t\t\treturn ParseResult.Stop;\n\n\t\t\tcase \"/help\":\n\t\t\tcase \"/?\":\n\t\t\t\tUsage ();\n\t\t\t\treturn ParseResult.Stop;\n\n\t\t\tcase \"/main\":\n\t\t\tcase \"/m\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tsettings.MainClass = value;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/nostdlib\":\n\t\t\tcase \"/nostdlib+\":\n\t\t\t\tsettings.StdLib = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/nostdlib-\":\n\t\t\t\tsettings.StdLib = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/fullpaths\":\n\t\t\t\tsettings.ShowFullPaths = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/keyfile\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresFileName (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tsettings.StrongNameKeyFile = value;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/keycontainer\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tsettings.StrongNameKeyContainer = value;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/delaysign+\":\n\t\t\tcase \"/delaysign\":\n\t\t\t\tsettings.StrongNameDelaySign = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/delaysign-\":\n\t\t\t\tsettings.StrongNameDelaySign = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"/langversion\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tswitch (value.ToLowerInvariant ()) {\n\t\t\t\tcase \"iso-1\":\n\t\t\t\tcase \"1\":\n\t\t\t\t\tsettings.Version = LanguageVersion.ISO_1;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"default\":\n\t\t\t\t\tsettings.Version = LanguageVersion.Default;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"2\":\n\t\t\t\tcase \"iso-2\":\n\t\t\t\t\tsettings.Version = LanguageVersion.ISO_2;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"3\":\n\t\t\t\t\tsettings.Version = LanguageVersion.V_3;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"4\":\n\t\t\t\t\tsettings.Version = LanguageVersion.V_4;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"5\":\n\t\t\t\t\tsettings.Version = LanguageVersion.V_5;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"6\":\n\t\t\t\t\tsettings.Version = LanguageVersion.V_6;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"experimental\":\n\t\t\t\t\tsettings.Version = LanguageVersion.Experimental;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\tcase \"future\":\n\t\t\t\t\treport.Warning (8000, 1, \"Language version `future' is no longer supported\");\n\t\t\t\t\tgoto case \"6\";\n\t\t\t\t}\n\n\t\t\t\treport.Error (1617, \"Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6\", value);\n\t\t\t\treturn ParseResult.Error;\n\n\t\t\tcase \"/codepage\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tswitch (value) {\n\t\t\t\tcase \"utf8\":\n\t\t\t\t\tsettings.Encoding = Encoding.UTF8;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"reset\":\n\t\t\t\t\tsettings.Encoding = Encoding.Default;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsettings.Encoding = Encoding.GetEncoding (int.Parse (value));\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treport.Error (2016, \"Code page `{0}' is invalid or not installed\", value);\n\t\t\t\t\t}\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"runtimemetadataversion\":\n\t\t\t\tif (value.Length == 0) {\n\t\t\t\t\tError_RequiresArgument (option);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tsettings.RuntimeMetadataVersion = value;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tdefault:\n\t\t\t\treturn ParseResult.UnknownOption;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Currently handles the Unix-like command line options, but will be\n\t\t// deprecated in favor of the CSCParseOption, which will also handle the\n\t\t// options that start with a dash in the future.\n\t\t//\n\t\tParseResult ParseOptionUnix (string arg, ref string[] args, ref int i, CompilerSettings settings)\n\t\t{\n\t\t\tswitch (arg){\n\t\t\tcase \"-v\":\n\t\t\t\tsettings.VerboseParserFlag++;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--version\":\n\t\t\t\tVersion ();\n\t\t\t\treturn ParseResult.Stop;\n\t\t\t\t\n\t\t\tcase \"--parse\":\n\t\t\t\tsettings.ParseOnly = true;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--main\": case \"-m\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -main:CLASS instead of --main CLASS or -m CLASS\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tsettings.MainClass = args[++i];\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--unsafe\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -unsafe instead of --unsafe\");\n\t\t\t\tsettings.Unsafe = true;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"/?\": case \"/h\": case \"/help\":\n\t\t\tcase \"--help\":\n\t\t\t\tUsage ();\n\t\t\t\treturn ParseResult.Stop;\n\n\t\t\tcase \"--define\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -d:SYMBOL instead of --define SYMBOL\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tsettings.AddConditionalSymbol (args [++i]);\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--tokenize\":\n\t\t\t\tsettings.TokenizeOnly = true;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"-o\": \n\t\t\tcase \"--output\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -out:FILE instead of --output FILE or -o FILE\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tsettings.OutputFile = args[++i];\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--checked\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -checked instead of --checked\");\n\t\t\t\tsettings.Checked = true;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--stacktrace\":\n\t\t\t\tsettings.Stacktrace = true;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--linkresource\":\n\t\t\tcase \"--linkres\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -linkres:VALUE instead of --linkres VALUE\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tAddResource (new AssemblyResource (args[++i], args[i]), settings);\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--resource\":\n\t\t\tcase \"--res\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -res:VALUE instead of --res VALUE\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tAddResource (new AssemblyResource (args[++i], args[i], true), settings);\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--target\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -target:KIND instead of --target KIND\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tstring type = args [++i];\n\t\t\t\tswitch (type){\n\t\t\t\tcase \"library\":\n\t\t\t\t\tsettings.Target = Target.Library;\n\t\t\t\t\tsettings.TargetExt = \".dll\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"exe\":\n\t\t\t\t\tsettings.Target = Target.Exe;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"winexe\":\n\t\t\t\t\tsettings.Target = Target.WinExe;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"module\":\n\t\t\t\t\tsettings.Target = Target.Module;\n\t\t\t\t\tsettings.TargetExt = \".dll\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treport.Error (2019, \"Invalid target type for -target. Valid options are `exe', `winexe', `library' or `module'\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"-r\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -r:LIBRARY instead of -r library\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tstring val = args [++i];\n\t\t\t\tint idx = val.IndexOf ('=');\n\t\t\t\tif (idx > -1) {\n\t\t\t\t\tstring alias = val.Substring (0, idx);\n\t\t\t\t\tstring assembly = val.Substring (idx + 1);\n\t\t\t\t\tAddAssemblyReference (alias, assembly, settings);\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\n\t\t\t\tsettings.AssemblyReferences.Add (val);\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"-L\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -lib:ARG instead of --L arg\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tsettings.ReferencesLookupPaths.Add (args [++i]);\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--lint\":\n\t\t\t\tsettings.EnhancedWarnings = true;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--nostdlib\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -nostdlib instead of --nostdlib\");\n\t\t\t\tsettings.StdLib = false;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--nowarn\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -nowarn instead of --nowarn\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tint warn = 0;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\twarn = int.Parse (args [++i]);\n\t\t\t\t} catch {\n\t\t\t\t\tUsage ();\n\t\t\t\t\tEnvironment.Exit (1);\n\t\t\t\t}\n\t\t\t\tsettings.SetIgnoreWarning (warn);\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--wlevel\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -warn:LEVEL instead of --wlevel LEVEL\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\tSetWarningLevel (args [++i], settings);\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--mcs-debug\":\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tsettings.DebugFlags = int.Parse (args [++i]);\n\t\t\t\t} catch {\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--about\":\n\t\t\t\tAbout ();\n\t\t\t\treturn ParseResult.Stop;\n\t\t\t\t\n\t\t\tcase \"--recurse\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -recurse:PATTERN option instead --recurse PATTERN\");\n\t\t\t\tif ((i + 1) >= args.Length){\n\t\t\t\t\tError_RequiresArgument (arg);\n\t\t\t\t\treturn ParseResult.Error;\n\t\t\t\t}\n\t\t\t\tProcessSourceFiles (args [++i], true, settings.SourceFiles);\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--timestamp\":\n\t\t\t\tsettings.Timestamps = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--debug\": case \"-g\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -debug option instead of -g or --debug\");\n\t\t\t\tsettings.GenerateDebugInfo = true;\n\t\t\t\treturn ParseResult.Success;\n\t\t\t\t\n\t\t\tcase \"--noconfig\":\n\t\t\t\treport.Warning (-29, 1, \"Compatibility: Use -noconfig option instead of --noconfig\");\n\t\t\t\tsettings.LoadDefaultReferences = false;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--metadata-only\":\n\t\t\t\tsettings.WriteMetadataOnly = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tcase \"--break-on-ice\":\n\t\t\t\tsettings.BreakOnInternalError = true;\n\t\t\t\treturn ParseResult.Success;\n\n\t\t\tdefault:\n\t\t\t\tif (arg.StartsWith (\"--fatal\", StringComparison.Ordinal)){\n\t\t\t\t\tint fatal = 1;\n\t\t\t\t\tif (arg.StartsWith (\"--fatal=\", StringComparison.Ordinal))\n\t\t\t\t\t\tint.TryParse (arg.Substring (8), out fatal);\n\n\t\t\t\t\tsettings.FatalCounter = fatal;\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\t\t\t\tif (arg.StartsWith (\"--runtime:\", StringComparison.Ordinal)) {\n\t\t\t\t\tstring version = arg.Substring (10);\n\n\t\t\t\t\tswitch (version) {\n\t\t\t\t\tcase \"v1\":\n\t\t\t\t\tcase \"V1\":\n\t\t\t\t\t\tsettings.StdLibRuntimeVersion = RuntimeVersion.v1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"v2\":\n\t\t\t\t\tcase \"V2\":\n\t\t\t\t\t\tsettings.StdLibRuntimeVersion = RuntimeVersion.v2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"v4\":\n\t\t\t\t\tcase \"V4\":\n\t\t\t\t\t\tsettings.StdLibRuntimeVersion = RuntimeVersion.v4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\treturn ParseResult.Success;\n\t\t\t\t}\n\n\t\t\t\treturn ParseResult.UnknownOption;\n\t\t\t}\n\t\t}\n\n\t\tvoid SetWarningLevel (string s, CompilerSettings settings)\n\t\t{\n\t\t\tint level = -1;\n\n\t\t\ttry {\n\t\t\t\tlevel = int.Parse (s);\n\t\t\t} catch {\n\t\t\t}\n\t\t\tif (level < 0 || level > 4) {\n\t\t\t\treport.Error (1900, \"Warning level must be in the range 0-4\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettings.WarningLevel = level;\n\t\t}\n\n\t\t//\n\t\t// Given a path specification, splits the path from the file/pattern\n\t\t//\n\t\tstatic void SplitPathAndPattern (string spec, out string path, out string pattern)\n\t\t{\n\t\t\tint p = spec.LastIndexOf ('/');\n\t\t\tif (p != -1) {\n\t\t\t\t//\n\t\t\t\t// Windows does not like /file.cs, switch that to:\n\t\t\t\t// \"\\\", \"file.cs\"\n\t\t\t\t//\n\t\t\t\tif (p == 0) {\n\t\t\t\t\tpath = \"\\\\\";\n\t\t\t\t\tpattern = spec.Substring (1);\n\t\t\t\t} else {\n\t\t\t\t\tpath = spec.Substring (0, p);\n\t\t\t\t\tpattern = spec.Substring (p + 1);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tp = spec.LastIndexOf ('\\\\');\n\t\t\tif (p != -1) {\n\t\t\t\tpath = spec.Substring (0, p);\n\t\t\t\tpattern = spec.Substring (p + 1);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tpath = \".\";\n\t\t\tpattern = spec;\n\t\t}\n\n\t\tvoid Usage ()\n\t\t{\n\t\t\toutput.WriteLine (\n\t\t\t\t\"Mono C# compiler, Copyright 2001-2011 Novell, Inc., Copyright 2011-2012 Xamarin, Inc\\n\" +\n\t\t\t\t\"mcs [options] source-files\\n\" +\n\t\t\t\t\"   --about              About the Mono C# compiler\\n\" +\n\t\t\t\t\"   -addmodule:M1[,Mn]   Adds the module to the generated assembly\\n\" +\n\t\t\t\t\"   -checked[+|-]        Sets default aritmetic overflow context\\n\" +\n\t\t\t\t\"   -clscheck[+|-]       Disables CLS Compliance verifications\\n\" +\n\t\t\t\t\"   -codepage:ID         Sets code page to the one in ID (number, utf8, reset)\\n\" +\n\t\t\t\t\"   -define:S1[;S2]      Defines one or more conditional symbols (short: -d)\\n\" +\n\t\t\t\t\"   -debug[+|-], -g      Generate debugging information\\n\" +\n\t\t\t\t\"   -delaysign[+|-]      Only insert the public key into the assembly (no signing)\\n\" +\n\t\t\t\t\"   -doc:FILE            Process documentation comments to XML file\\n\" +\n\t\t\t\t\"   -fullpaths           Any issued error or warning uses absolute file path\\n\" +\n\t\t\t\t\"   -help                Lists all compiler options (short: -?)\\n\" +\n\t\t\t\t\"   -keycontainer:NAME   The key pair container used to sign the output assembly\\n\" +\n\t\t\t\t\"   -keyfile:FILE        The key file used to strongname the ouput assembly\\n\" +\n\t\t\t\t\"   -langversion:TEXT    Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Future\\n\" +\n\t\t\t\t\"   -lib:PATH1[,PATHn]   Specifies the location of referenced assemblies\\n\" +\n\t\t\t\t\"   -main:CLASS          Specifies the class with the Main method (short: -m)\\n\" +\n\t\t\t\t\"   -noconfig            Disables implicitly referenced assemblies\\n\" +\n\t\t\t\t\"   -nostdlib[+|-]       Does not reference mscorlib.dll library\\n\" +\n\t\t\t\t\"   -nowarn:W1[,Wn]      Suppress one or more compiler warnings\\n\" +\n\t\t\t\t\"   -optimize[+|-]       Enables advanced compiler optimizations (short: -o)\\n\" +\n\t\t\t\t\"   -out:FILE            Specifies output assembly name\\n\" +\n\t\t\t\t\"   -pkg:P1[,Pn]         References packages P1..Pn\\n\" +\n\t\t\t\t\"   -platform:ARCH       Specifies the target platform of the output assembly\\n\" +\n\t\t\t\t\"                        ARCH can be one of: anycpu, anycpu32bitpreferred, arm,\\n\" +\n\t\t\t\t\"                        x86, x64 or itanium. The default is anycpu.\\n\" +\n\t\t\t\t\"   -recurse:SPEC        Recursively compiles files according to SPEC pattern\\n\" +\n\t\t\t\t\"   -reference:A1[,An]   Imports metadata from the specified assembly (short: -r)\\n\" +\n\t\t\t\t\"   -reference:ALIAS=A   Imports metadata using specified extern alias (short: -r)\\n\" +\n\t\t\t\t\"   -sdk:VERSION         Specifies SDK version of referenced assemblies\\n\" +\n\t\t\t\t\"                        VERSION can be one of: 2, 4, 4.5 (default) or a custom value\\n\" +\n\t\t\t\t\"   -target:KIND         Specifies the format of the output assembly (short: -t)\\n\" +\n\t\t\t\t\"                        KIND can be one of: exe, winexe, library, module\\n\" +\n\t\t\t\t\"   -unsafe[+|-]         Allows to compile code which uses unsafe keyword\\n\" +\n\t\t\t\t\"   -warnaserror[+|-]    Treats all warnings as errors\\n\" +\n\t\t\t\t\"   -warnaserror[+|-]:W1[,Wn] Treats one or more compiler warnings as errors\\n\" +\n\t\t\t\t\"   -warn:0-4            Sets warning level, the default is 4 (short -w:)\\n\" +\n\t\t\t\t\"   -helpinternal        Shows internal and advanced compiler options\\n\" +\n\t\t\t\t\"\\n\" +\n\t\t\t\t\"Resources:\\n\" +\n\t\t\t\t\"   -linkresource:FILE[,ID] Links FILE as a resource (short: -linkres)\\n\" +\n\t\t\t\t\"   -resource:FILE[,ID]     Embed FILE as a resource (short: -res)\\n\" +\n\t\t\t\t\"   -win32res:FILE          Specifies Win32 resource file (.res)\\n\" +\n\t\t\t\t\"   -win32icon:FILE         Use this icon for the output\\n\" +\n\t\t\t\t\t\t\t\t\"   @file                   Read response file for more options\\n\\n\" +\n\t\t\t\t\"Options can be of the form -option or /option\");\n\t\t}\n\n\t\tvoid Version ()\n\t\t{\n\t\t\tstring version = System.Reflection.MethodBase.GetCurrentMethod ().DeclaringType.Assembly.GetName ().Version.ToString ();\n\t\t\toutput.WriteLine (\"Mono C# compiler version {0}\", version);\n\t\t}\n\t}\n\n\tpublic class RootContext\n\t{\n\t\t//\n\t\t// Contains the parsed tree\n\t\t//\n\t\tstatic ModuleContainer root;\n\n\t\tstatic public ModuleContainer ToplevelTypes {\n\t\t\tget { return root; }\n\t\t\tset { root = value; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs",
    "content": "//\n// statement.cs: Statement representation for the IL tree.\n//\n// Authors:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Martin Baulig (martin@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001, 2002, 2003 Ximian, Inc.\n// Copyright 2003, 2004 Novell, Inc.\n// Copyright 2011 Xamarin Inc.\n//\n\nusing System;\nusing System.Collections.Generic;\n\n#if STATIC\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection.Emit;\n#endif\n\nnamespace Mono.CSharp {\n\t\n\tpublic abstract class Statement {\n\t\tpublic Location loc;\n\t\tprotected bool reachable;\n\n\t\tpublic bool IsUnreachable {\n\t\t\tget {\n\t\t\t\treturn !reachable;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t///   Resolves the statement, true means that all sub-statements\n\t\t///   did resolve ok.\n\t\t///  </summary>\n\t\tpublic virtual bool Resolve (BlockContext bc)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t///   Return value indicates whether all code paths emitted return.\n\t\t/// </summary>\n\t\tprotected abstract void DoEmit (EmitContext ec);\n\n\t\tpublic virtual void Emit (EmitContext ec)\n\t\t{\n\t\t\tec.Mark (loc);\n\t\t\tDoEmit (ec);\n\n\t\t\tif (ec.StatementEpilogue != null) {\n\t\t\t\tec.EmitEpilogue ();\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// This routine must be overrided in derived classes and make copies\n\t\t// of all the data that might be modified if resolved\n\t\t// \n\t\tprotected abstract void CloneTo (CloneContext clonectx, Statement target);\n\n\t\tpublic Statement Clone (CloneContext clonectx)\n\t\t{\n\t\t\tStatement s = (Statement) this.MemberwiseClone ();\n\t\t\tCloneTo (clonectx, s);\n\t\t\treturn s;\n\t\t}\n\n\t\tpublic virtual Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tec.Report.Error (834, loc, \"A lambda expression with statement body cannot be converted to an expresion tree\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\t//\n\t\t// Return value indicates whether statement has unreachable end\n\t\t//\n\t\tprotected abstract bool DoFlowAnalysis (FlowAnalysisContext fc);\n\n\t\tpublic bool FlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (reachable) {\n\t\t\t\tfc.UnreachableReported = false;\n\t\t\t\tvar res = DoFlowAnalysis (fc);\n\t\t\t\treturn res;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Special handling cases\n\t\t\t//\n\t\t\tif (this is Block) {\n\t\t\t\treturn DoFlowAnalysis (fc);\n\t\t\t}\n\n\t\t\tif (this is EmptyStatement || loc.IsNull)\n\t\t\t\treturn true;\n\n\t\t\tif (fc.UnreachableReported)\n\t\t\t\treturn true;\n\n\t\t\tfc.Report.Warning (162, 2, loc, \"Unreachable code detected\");\n\t\t\tfc.UnreachableReported = true;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic virtual Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (!rc.IsUnreachable)\n\t\t\t\treachable = true;\n\n\t\t\treturn rc;\n\t\t}\n\n\t\tprotected void CheckExitBoundaries (BlockContext bc, Block scope)\n\t\t{\n\t\t\tif (bc.CurrentBlock.ParametersBlock.Original != scope.ParametersBlock.Original) {\n\t\t\t\tbc.Report.Error (1632, loc, \"Control cannot leave the body of an anonymous method\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (var b = bc.CurrentBlock; b != null && b != scope; b = b.Parent) {\n\t\t\t\tif (b.IsFinallyBlock) {\n\t\t\t\t\tError_FinallyClauseExit (bc);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected void Error_FinallyClauseExit (BlockContext bc)\n\t\t{\n\t\t\tbc.Report.Error (157, loc, \"Control cannot leave the body of a finally clause\");\n\t\t}\n\t}\n\n\tpublic sealed class EmptyStatement : Statement\n\t{\n\t\tpublic EmptyStatement (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\t// nothing needed.\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class If : Statement {\n\t\tExpression expr;\n\t\tpublic Statement TrueStatement;\n\t\tpublic Statement FalseStatement;\n\n\t\tbool true_returns, false_returns;\n\n\t\tpublic If (Expression bool_expr, Statement true_statement, Location l)\n\t\t\t: this (bool_expr, true_statement, null, l)\n\t\t{\n\t\t}\n\n\t\tpublic If (Expression bool_expr,\n\t\t\t   Statement true_statement,\n\t\t\t   Statement false_statement,\n\t\t\t   Location l)\n\t\t{\n\t\t\tthis.expr = bool_expr;\n\t\t\tTrueStatement = true_statement;\n\t\t\tFalseStatement = false_statement;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn this.expr;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\n\t\t\tvar ok = TrueStatement.Resolve (ec);\n\n\t\t\tif (FalseStatement != null) {\n\t\t\t\tok &= FalseStatement.Resolve (ec);\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tLabel false_target = ec.DefineLabel ();\n\t\t\tLabel end;\n\n\t\t\t//\n\t\t\t// If we're a boolean constant, Resolve() already\n\t\t\t// eliminated dead code for us.\n\t\t\t//\n\t\t\tConstant c = expr as Constant;\n\t\t\tif (c != null){\n\t\t\t\tc.EmitSideEffect (ec);\n\n\t\t\t\tif (!c.IsDefaultValue)\n\t\t\t\t\tTrueStatement.Emit (ec);\n\t\t\t\telse if (FalseStatement != null)\n\t\t\t\t\tFalseStatement.Emit (ec);\n\n\t\t\t\treturn;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\texpr.EmitBranchable (ec, false_target, false);\n\t\t\t\n\t\t\tTrueStatement.Emit (ec);\n\n\t\t\tif (FalseStatement != null){\n\t\t\t\tbool branch_emitted = false;\n\t\t\t\t\n\t\t\t\tend = ec.DefineLabel ();\n\t\t\t\tif (!true_returns){\n\t\t\t\t\tec.Emit (OpCodes.Br, end);\n\t\t\t\t\tbranch_emitted = true;\n\t\t\t\t}\n\n\t\t\t\tec.MarkLabel (false_target);\n\t\t\t\tFalseStatement.Emit (ec);\n\n\t\t\t\tif (branch_emitted)\n\t\t\t\t\tec.MarkLabel (end);\n\t\t\t} else {\n\t\t\t\tec.MarkLabel (false_target);\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysisConditional (fc);\n\n\t\t\tvar da_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);\n\n\t\t\tfc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;\n\n\t\t\tvar res = TrueStatement.FlowAnalysis (fc);\n\n\t\t\tif (FalseStatement == null) {\n\t\t\t\tvar c = expr as Constant;\n\t\t\t\tif (c != null && !c.IsDefaultValue)\n\t\t\t\t\treturn true_returns;\n\n\t\t\t\tif (true_returns)\n\t\t\t\t\tfc.DefiniteAssignment = da_false;\n\t\t\t\telse\n\t\t\t\t\tfc.DefiniteAssignment &= da_false;\n \n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (true_returns) {\n\t\t\t\tfc.DefiniteAssignment = da_false;\n\t\t\t\treturn FalseStatement.FlowAnalysis (fc);\n\t\t\t}\n\n\t\t\tvar da_true = fc.DefiniteAssignment;\n\n\t\t\tfc.DefiniteAssignment = da_false;\n\t\t\tres &= FalseStatement.FlowAnalysis (fc);\n\n\t\t\tif (!TrueStatement.IsUnreachable) {\n\t\t\t\tif (false_returns || FalseStatement.IsUnreachable)\n\t\t\t\t\tfc.DefiniteAssignment = da_true;\n\t\t\t\telse\n\t\t\t\t\tfc.DefiniteAssignment &= da_true;\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (rc.IsUnreachable)\n\t\t\t\treturn rc;\n\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tvar c = expr as Constant;\n\t\t\tif (c != null) {\n\t\t\t\tbool take = !c.IsDefaultValue;\n\t\t\t\tif (take) {\n\t\t\t\t\trc = TrueStatement.MarkReachable (rc);\n\t\t\t\t} else {\n\t\t\t\t\tif (FalseStatement != null)\n\t\t\t\t\t\trc = FalseStatement.MarkReachable (rc);\n\t\t\t\t}\n\n\t\t\t\treturn rc;\n\t\t\t}\n\n\t\t\tvar true_rc = TrueStatement.MarkReachable (rc);\n\t\t\ttrue_returns = true_rc.IsUnreachable;\n\t\n\t\t\tif (FalseStatement == null)\n\t\t\t\treturn rc;\n\n\t\t\tvar false_rc = FalseStatement.MarkReachable (rc);\n\t\t\tfalse_returns = false_rc.IsUnreachable;\n\n\t\t\treturn true_rc & false_rc;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tIf target = (If) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t\ttarget.TrueStatement = TrueStatement.Clone (clonectx);\n\t\t\tif (FalseStatement != null)\n\t\t\t\ttarget.FalseStatement = FalseStatement.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Do : LoopStatement\n\t{\n\t\tpublic Expression expr;\n\t\tbool iterator_reachable, end_reachable;\n\n\t\tpublic Do (Statement statement, BooleanExpression bool_expr, Location doLocation, Location whileLocation)\n\t\t\t: base (statement)\n\t\t{\n\t\t\texpr = bool_expr;\n\t\t\tloc = doLocation;\n\t\t\tWhileLocation = whileLocation;\n\t\t}\n\n\t\tpublic Location WhileLocation {\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tvar ok = base.Resolve (bc);\n\n\t\t\texpr = expr.Resolve (bc);\n\n\t\t\treturn ok;\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tLabel loop = ec.DefineLabel ();\n\t\t\tLabel old_begin = ec.LoopBegin;\n\t\t\tLabel old_end = ec.LoopEnd;\n\t\t\t\n\t\t\tec.LoopBegin = ec.DefineLabel ();\n\t\t\tec.LoopEnd = ec.DefineLabel ();\n\t\t\t\t\n\t\t\tec.MarkLabel (loop);\n\t\t\tStatement.Emit (ec);\n\t\t\tec.MarkLabel (ec.LoopBegin);\n\n\t\t\t// Mark start of while condition\n\t\t\tec.Mark (WhileLocation);\n\n\t\t\t//\n\t\t\t// Dead code elimination\n\t\t\t//\n\t\t\tif (expr is Constant) {\n\t\t\t\tbool res = !((Constant) expr).IsDefaultValue;\n\n\t\t\t\texpr.EmitSideEffect (ec);\n\t\t\t\tif (res)\n\t\t\t\t\tec.Emit (OpCodes.Br, loop);\n\t\t\t} else {\n\t\t\t\texpr.EmitBranchable (ec, loop, true);\n\t\t\t}\n\t\t\t\n\t\t\tec.MarkLabel (ec.LoopEnd);\n\n\t\t\tec.LoopBegin = old_begin;\n\t\t\tec.LoopEnd = old_end;\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tvar res = Statement.FlowAnalysis (fc);\n\n\t\t\texpr.FlowAnalysisConditional (fc);\n\n\t\t\tfc.DefiniteAssignment = fc.DefiniteAssignmentOnFalse;\n\n\t\t\tif (res && !iterator_reachable)\n\t\t\t\treturn !end_reachable;\n\n\t\t\tif (!end_reachable) {\n\t\t\t\tvar c = expr as Constant;\n\t\t\t\tif (c != null && !c.IsDefaultValue)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\t\n\t\t\tvar body_rc = Statement.MarkReachable (rc);\n\n\t\t\tif (body_rc.IsUnreachable && !iterator_reachable) {\n\t\t\t\texpr = new UnreachableExpression (expr);\n\t\t\t\treturn end_reachable ? rc : Reachability.CreateUnreachable ();\n\t\t\t}\n\n\t\t\tif (!end_reachable) {\n\t\t\t\tvar c = expr as Constant;\n\t\t\t\tif (c != null && !c.IsDefaultValue)\n\t\t\t\t\treturn Reachability.CreateUnreachable ();\n\t\t\t}\n\n\t\t\treturn rc;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tDo target = (Do) t;\n\n\t\t\ttarget.Statement = Statement.Clone (clonectx);\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tpublic override void SetEndReachable ()\n\t\t{\n\t\t\tend_reachable = true;\n\t\t}\n\n\t\tpublic override void SetIteratorReachable ()\n\t\t{\n\t\t\titerator_reachable = true;\n\t\t}\n\t}\n\n\tpublic class While : LoopStatement\n\t{\n\t\tpublic Expression expr;\n\t\tbool empty, infinite, end_reachable;\n\t\tList<DefiniteAssignmentBitSet> end_reachable_das;\n\n\t\tpublic While (BooleanExpression bool_expr, Statement statement, Location l)\n\t\t\t: base (statement)\n\t\t{\n\t\t\tthis.expr = bool_expr;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tbool ok = true;\n\n\t\t\texpr = expr.Resolve (bc);\n\t\t\tif (expr == null)\n\t\t\t\tok = false;\n\n\t\t\tvar c = expr as Constant;\n\t\t\tif (c != null) {\n\t\t\t\tempty = c.IsDefaultValue;\n\t\t\t\tinfinite = !empty;\n\t\t\t}\n\n\t\t\tok &= base.Resolve (bc);\n\t\t\treturn ok;\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (empty) {\n\t\t\t\texpr.EmitSideEffect (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tLabel old_begin = ec.LoopBegin;\n\t\t\tLabel old_end = ec.LoopEnd;\n\t\t\t\n\t\t\tec.LoopBegin = ec.DefineLabel ();\n\t\t\tec.LoopEnd = ec.DefineLabel ();\n\n\t\t\t//\n\t\t\t// Inform whether we are infinite or not\n\t\t\t//\n\t\t\tif (expr is Constant) {\n\t\t\t\t// expr is 'true', since the 'empty' case above handles the 'false' case\n\t\t\t\tec.MarkLabel (ec.LoopBegin);\n\n\t\t\t\tif (ec.EmitAccurateDebugInfo)\n\t\t\t\t\tec.Emit (OpCodes.Nop);\n\n\t\t\t\texpr.EmitSideEffect (ec);\n\t\t\t\tStatement.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Br, ec.LoopBegin);\n\t\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// Inform that we are infinite (ie, `we return'), only\n\t\t\t\t// if we do not `break' inside the code.\n\t\t\t\t//\n\t\t\t\tec.MarkLabel (ec.LoopEnd);\n\t\t\t} else {\n\t\t\t\tLabel while_loop = ec.DefineLabel ();\n\n\t\t\t\tec.Emit (OpCodes.Br, ec.LoopBegin);\n\t\t\t\tec.MarkLabel (while_loop);\n\n\t\t\t\tStatement.Emit (ec);\n\t\t\t\n\t\t\t\tec.MarkLabel (ec.LoopBegin);\n\n\t\t\t\tec.Mark (loc);\n\t\t\t\texpr.EmitBranchable (ec, while_loop, true);\n\t\t\t\t\n\t\t\t\tec.MarkLabel (ec.LoopEnd);\n\t\t\t}\t\n\n\t\t\tec.LoopBegin = old_begin;\n\t\t\tec.LoopEnd = old_end;\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysisConditional (fc);\n\n\t\t\tfc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;\n\t\t\tvar da_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);\n\n\t\t\tStatement.FlowAnalysis (fc);\n\n\t\t\t//\n\t\t\t// Special case infinite while with breaks\n\t\t\t//\n\t\t\tif (end_reachable_das != null) {\n\t\t\t\tda_false = DefiniteAssignmentBitSet.And (end_reachable_das);\n\t\t\t\tend_reachable_das = null;\n\t\t\t}\n\n\t\t\tfc.DefiniteAssignment = da_false;\n\n\t\t\tif (infinite && !end_reachable)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (rc.IsUnreachable)\n\t\t\t\treturn rc;\n\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\t//\n\t\t\t// Special case unreachable while body\n\t\t\t//\n\t\t\tif (empty) {\n\t\t\t\tStatement.MarkReachable (Reachability.CreateUnreachable ());\n\t\t\t\treturn rc;\n\t\t\t}\n\n\t\t\tStatement.MarkReachable (rc);\n\n\t\t\t//\n\t\t\t// When infinite while end is unreachable via break anything what follows is unreachable too\n\t\t\t//\n\t\t\tif (infinite && !end_reachable)\n\t\t\t\treturn Reachability.CreateUnreachable ();\n\n\t\t\treturn rc;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tWhile target = (While) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t\ttarget.Statement = Statement.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tpublic override void AddEndDefiniteAssignment (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (!infinite)\n\t\t\t\treturn;\n\n\t\t\tif (end_reachable_das == null)\n\t\t\t\tend_reachable_das = new List<DefiniteAssignmentBitSet> ();\n\n\t\t\tend_reachable_das.Add (fc.DefiniteAssignment);\n\t\t}\n\n\t\tpublic override void SetEndReachable ()\n\t\t{\n\t\t\tend_reachable = true;\n\t\t}\n\t}\n\n\tpublic class For : LoopStatement\n\t{\n\t\tbool infinite, empty, iterator_reachable, end_reachable;\n\t\tList<DefiniteAssignmentBitSet> end_reachable_das;\n\t\t\n\t\tpublic For (Location l)\n\t\t\t: base (null)\n\t\t{\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Statement Initializer {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic Expression Condition {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic Statement Iterator {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tInitializer.Resolve (bc);\n\n\t\t\tif (Condition != null) {\n\t\t\t\tCondition = Condition.Resolve (bc);\n\t\t\t\tvar condition_constant = Condition as Constant;\n\t\t\t\tif (condition_constant != null) {\n\t\t\t\t\tif (condition_constant.IsDefaultValue) {\n\t\t\t\t\t\tempty = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinfinite = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinfinite = true;\n\t\t\t}\n\n\t\t\treturn base.Resolve (bc) && Iterator.Resolve (bc);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tInitializer.FlowAnalysis (fc);\n\n\t\t\tDefiniteAssignmentBitSet da_false;\n\t\t\tif (Condition != null) {\n\t\t\t\tCondition.FlowAnalysisConditional (fc);\n\t\t\t\tfc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;\n\t\t\t\tda_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);\n\t\t\t} else {\n\t\t\t\tda_false = fc.BranchDefiniteAssignment ();\n\t\t\t}\n\n\t\t\tStatement.FlowAnalysis (fc);\n\n\t\t\tIterator.FlowAnalysis (fc);\n\n\t\t\t//\n\t\t\t// Special case infinite for with breaks\n\t\t\t//\n\t\t\tif (end_reachable_das != null) {\n\t\t\t\tda_false = DefiniteAssignmentBitSet.And (end_reachable_das);\n\t\t\t\tend_reachable_das = null;\n\t\t\t}\n\n\t\t\tfc.DefiniteAssignment = da_false;\n\n\t\t\tif (infinite && !end_reachable)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tInitializer.MarkReachable (rc);\n\n\t\t\tvar body_rc = Statement.MarkReachable (rc);\n\t\t\tif (!body_rc.IsUnreachable || iterator_reachable) {\n\t\t\t\tIterator.MarkReachable (rc);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// When infinite for end is unreachable via break anything what follows is unreachable too\n\t\t\t//\n\t\t\tif (infinite && !end_reachable) {\n\t\t\t\treturn Reachability.CreateUnreachable ();\n\t\t\t}\n\n\t\t\treturn rc;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (Initializer != null)\n\t\t\t\tInitializer.Emit (ec);\n\n\t\t\tif (empty) {\n\t\t\t\tCondition.EmitSideEffect (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tLabel old_begin = ec.LoopBegin;\n\t\t\tLabel old_end = ec.LoopEnd;\n\t\t\tLabel loop = ec.DefineLabel ();\n\t\t\tLabel test = ec.DefineLabel ();\n\n\t\t\tec.LoopBegin = ec.DefineLabel ();\n\t\t\tec.LoopEnd = ec.DefineLabel ();\n\n\t\t\tec.Emit (OpCodes.Br, test);\n\t\t\tec.MarkLabel (loop);\n\t\t\tStatement.Emit (ec);\n\n\t\t\tec.MarkLabel (ec.LoopBegin);\n\t\t\tIterator.Emit (ec);\n\n\t\t\tec.MarkLabel (test);\n\t\t\t//\n\t\t\t// If test is null, there is no test, and we are just\n\t\t\t// an infinite loop\n\t\t\t//\n\t\t\tif (Condition != null) {\n\t\t\t\tec.Mark (Condition.Location);\n\n\t\t\t\t//\n\t\t\t\t// The Resolve code already catches the case for\n\t\t\t\t// Test == Constant (false) so we know that\n\t\t\t\t// this is true\n\t\t\t\t//\n\t\t\t\tif (Condition is Constant) {\n\t\t\t\t\tCondition.EmitSideEffect (ec);\n\t\t\t\t\tec.Emit (OpCodes.Br, loop);\n\t\t\t\t} else {\n\t\t\t\t\tCondition.EmitBranchable (ec, loop, true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else\n\t\t\t\tec.Emit (OpCodes.Br, loop);\n\t\t\tec.MarkLabel (ec.LoopEnd);\n\n\t\t\tec.LoopBegin = old_begin;\n\t\t\tec.LoopEnd = old_end;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tFor target = (For) t;\n\n\t\t\tif (Initializer != null)\n\t\t\t\ttarget.Initializer = Initializer.Clone (clonectx);\n\t\t\tif (Condition != null)\n\t\t\t\ttarget.Condition = Condition.Clone (clonectx);\n\t\t\tif (Iterator != null)\n\t\t\t\ttarget.Iterator = Iterator.Clone (clonectx);\n\t\t\ttarget.Statement = Statement.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tpublic override void AddEndDefiniteAssignment (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (!infinite)\n\t\t\t\treturn;\n\n\t\t\tif (end_reachable_das == null)\n\t\t\t\tend_reachable_das = new List<DefiniteAssignmentBitSet> ();\n\n\t\t\tend_reachable_das.Add (fc.DefiniteAssignment);\n\t\t}\n\n\t\tpublic override void SetEndReachable ()\n\t\t{\n\t\t\tend_reachable = true;\n\t\t}\n\n\t\tpublic override void SetIteratorReachable ()\n\t\t{\n\t\t\titerator_reachable = true;\n\t\t}\n\t}\n\n\tpublic abstract class LoopStatement : Statement\n\t{\n\t\tprotected LoopStatement (Statement statement)\n\t\t{\n\t\t\tStatement = statement;\n\t\t}\n\n\t\tpublic Statement Statement { get; set; }\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tvar prev_loop = bc.EnclosingLoop;\n\t\t\tvar prev_los = bc.EnclosingLoopOrSwitch;\n\t\t\tbc.EnclosingLoopOrSwitch = bc.EnclosingLoop = this;\n\t\t\tvar ok = Statement.Resolve (bc);\n\t\t\tbc.EnclosingLoopOrSwitch = prev_los;\n\t\t\tbc.EnclosingLoop = prev_loop;\n\n\t\t\treturn ok;\n\t\t}\n\n\t\t//\n\t\t// Needed by possibly infinite loops statements (for, while) and switch statment\n\t\t//\n\t\tpublic virtual void AddEndDefiniteAssignment (FlowAnalysisContext fc)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void SetEndReachable ()\n\t\t{\n\t\t}\n\n\t\tpublic virtual void SetIteratorReachable ()\n\t\t{\n\t\t}\n\t}\n\t\n\tpublic class StatementExpression : Statement\n\t{\n\t\tExpressionStatement expr;\n\t\t\n\t\tpublic StatementExpression (ExpressionStatement expr)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tloc = expr.StartLocation;\n\t\t}\n\n\t\tpublic StatementExpression (ExpressionStatement expr, Location loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic ExpressionStatement Expr {\n\t\t\tget {\n \t\t\t\treturn this.expr;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tStatementExpression target = (StatementExpression) t;\n\t\t\ttarget.expr = (ExpressionStatement) expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\texpr.EmitStatement (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\texpr.MarkReachable (rc);\n\t\t\treturn rc;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\texpr = expr.ResolveStatement (ec);\n\t\t\treturn expr != null;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class StatementErrorExpression : Statement\n\t{\n\t\tExpression expr;\n\n\t\tpublic StatementErrorExpression (Expression expr)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tthis.loc = expr.StartLocation;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\texpr.Error_InvalidExpressionStatement (bc);\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tthrow new NotSupportedException ();\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\tvar t = (StatementErrorExpression) target;\n\n\t\t\tt.expr = expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// Simple version of statement list not requiring a block\n\t//\n\tpublic class StatementList : Statement\n\t{\n\t\tList<Statement> statements;\n\n\t\tpublic StatementList (Statement first, Statement second)\n\t\t{\n\t\t\tstatements = new List<Statement> { first, second };\n\t\t}\n\n\t\t#region Properties\n\t\tpublic IList<Statement> Statements {\n\t\t\tget {\n\t\t\t\treturn statements;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic void Add (Statement statement)\n\t\t{\n\t\t\tstatements.Add (statement);\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tforeach (var s in statements)\n\t\t\t\ts.Resolve (ec);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tforeach (var s in statements)\n\t\t\t\ts.Emit (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tforeach (var s in statements)\n\t\t\t\ts.FlowAnalysis (fc);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tReachability res = rc;\n\t\t\tforeach (var s in statements)\n\t\t\t\tres = s.MarkReachable (rc);\n\n\t\t\treturn res;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\tStatementList t = (StatementList) target;\n\n\t\t\tt.statements = new List<Statement> (statements.Count);\n\t\t\tforeach (Statement s in statements)\n\t\t\t\tt.statements.Add (s.Clone (clonectx));\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// For statements which require special handling when inside try or catch block\n\t//\n\tpublic abstract class ExitStatement : Statement\n\t{\n\t\tprotected bool unwind_protect;\n\n\t\tprotected abstract bool DoResolve (BlockContext bc);\n\t\tprotected abstract bool IsLocalExit { get; }\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tvar res = DoResolve (bc);\n\n\t\t\tif (!IsLocalExit) {\n\t\t\t\t//\n\t\t\t\t// We are inside finally scope but is it the scope we are exiting\n\t\t\t\t//\n\t\t\t\tif (bc.HasSet (ResolveContext.Options.FinallyScope)) {\n\n\t\t\t\t\tfor (var b = bc.CurrentBlock; b != null; b = b.Parent) {\n\t\t\t\t\t\tif (b.IsFinallyBlock) {\n\t\t\t\t\t\t\tError_FinallyClauseExit (bc);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (b is ParametersBlock)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunwind_protect = bc.HasAny (ResolveContext.Options.TryScope | ResolveContext.Options.CatchScope);\n\t\t\treturn res;\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (IsLocalExit)\n\t\t\t\treturn true;\n\n\t\t\tif (fc.TryFinally != null) {\n\t\t\t    fc.TryFinally.RegisterForControlExitCheck (new DefiniteAssignmentBitSet (fc.DefiniteAssignment));\n\t\t\t} else {\n\t\t\t    fc.ParametersBlock.CheckControlExit (fc);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implements the return statement\n\t/// </summary>\n\tpublic class Return : ExitStatement\n\t{\n\t\tExpression expr;\n\n\t\tpublic Return (Expression expr, Location l)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tloc = l;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t\tprotected set {\n\t\t\t\texpr = value;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool IsLocalExit {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected override bool DoResolve (BlockContext ec)\n\t\t{\n\t\t\tvar block_return_type = ec.ReturnType;\n\n\t\t\tif (expr == null) {\n\t\t\t\tif (block_return_type.Kind == MemberKind.Void)\n\t\t\t\t\treturn true;\n\n\t\t\t\t//\n\t\t\t\t// Return must not be followed by an expression when\n\t\t\t\t// the method return type is Task\n\t\t\t\t//\n\t\t\t\tif (ec.CurrentAnonymousMethod is AsyncInitializer) {\n\t\t\t\t\tvar storey = (AsyncTaskStorey) ec.CurrentAnonymousMethod.Storey;\n\t\t\t\t\tif (storey.ReturnType == ec.Module.PredefinedTypes.Task.TypeSpec) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Extra trick not to emit ret/leave inside awaiter body\n\t\t\t\t\t\t//\n\t\t\t\t\t\texpr = EmptyExpression.Null;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (storey.ReturnType.IsGenericTask)\n\t\t\t\t\t\tblock_return_type = storey.ReturnType.TypeArguments[0];\n\t\t\t\t}\n\n\t\t\t\tif (ec.CurrentIterator != null) {\n\t\t\t\t\tError_ReturnFromIterator (ec);\n\t\t\t\t} else if (block_return_type != InternalType.ErrorType) {\n\t\t\t\t\tec.Report.Error (126, loc,\n\t\t\t\t\t\t\"An object of a type convertible to `{0}' is required for the return statement\",\n\t\t\t\t\t\tblock_return_type.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\texpr = expr.Resolve (ec);\n\n\t\t\tAnonymousExpression am = ec.CurrentAnonymousMethod;\n\t\t\tif (am == null) {\n\t\t\t\tif (block_return_type.Kind == MemberKind.Void) {\n\t\t\t\t\tec.Report.Error (127, loc,\n\t\t\t\t\t\t\"`{0}': A return keyword must not be followed by any expression when method returns void\",\n\t\t\t\t\t\tec.GetSignatureForError ());\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (am.IsIterator) {\n\t\t\t\t\tError_ReturnFromIterator (ec);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar async_block = am as AsyncInitializer;\n\t\t\t\tif (async_block != null) {\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tvar storey = (AsyncTaskStorey) am.Storey;\n\t\t\t\t\t\tvar async_type = storey.ReturnType;\n\n\t\t\t\t\t\tif (async_type == null && async_block.ReturnTypeInference != null) {\n\t\t\t\t\t\t\tif (expr.Type.Kind == MemberKind.Void && !(this is ContextualReturn))\n\t\t\t\t\t\t\t\tec.Report.Error (4029, loc, \"Cannot return an expression of type `void'\");\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tasync_block.ReturnTypeInference.AddCommonTypeBoundAsync (expr.Type);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (async_type.Kind == MemberKind.Void) {\n\t\t\t\t\t\t\tec.Report.Error (8030, loc,\n\t\t\t\t\t\t\t\t\"Anonymous function or lambda expression converted to a void returning delegate cannot return a value\");\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!async_type.IsGenericTask) {\n\t\t\t\t\t\t\tif (this is ContextualReturn)\n\t\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\t\tif (async_block.DelegateType != null) {\n\t\t\t\t\t\t\t\tec.Report.Error (8031, loc,\n\t\t\t\t\t\t\t\t\t\"Async lambda expression or anonymous method converted to a `Task' cannot return a value. Consider returning `Task<T>'\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tec.Report.Error (1997, loc,\n\t\t\t\t\t\t\t\t\t\"`{0}': A return keyword must not be followed by an expression when async method returns `Task'. Consider using `Task<T>' return type\",\n\t\t\t\t\t\t\t\t\tec.GetSignatureForError ());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// The return type is actually Task<T> type argument\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (expr.Type == async_type) {\n\t\t\t\t\t\t\tec.Report.Error (4016, loc,\n\t\t\t\t\t\t\t\t\"`{0}': The return expression type of async method must be `{1}' rather than `Task<{1}>'\",\n\t\t\t\t\t\t\t\tec.GetSignatureForError (), async_type.TypeArguments[0].GetSignatureForError ());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tblock_return_type = async_type.TypeArguments[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (block_return_type.Kind == MemberKind.Void) {\n\t\t\t\t\t\tec.Report.Error (8030, loc,\n\t\t\t\t\t\t\t\"Anonymous function or lambda expression converted to a void returning delegate cannot return a value\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar l = am as AnonymousMethodBody;\n\t\t\t\t\tif (l != null && expr != null) {\n\t\t\t\t\t\tif (l.ReturnTypeInference != null) {\n\t\t\t\t\t\t\tl.ReturnTypeInference.AddCommonTypeBound (expr.Type);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Try to optimize simple lambda. Only when optimizations are enabled not to cause\n\t\t\t\t\t\t// unexpected debugging experience\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (this is ContextualReturn && !ec.IsInProbingMode && ec.Module.Compiler.Settings.Optimize) {\n\t\t\t\t\t\t\tl.DirectMethodGroupConversion = expr.CanReduceLambda (l);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr == null)\n\t\t\t\treturn false;\n\n\t\t\tif (expr.Type != block_return_type && expr.Type != InternalType.ErrorType) {\n\t\t\t\texpr = Convert.ImplicitConversionRequired (ec, expr, block_return_type, loc);\n\n\t\t\t\tif (expr == null) {\n\t\t\t\t\tif (am != null && block_return_type == ec.ReturnType) {\n\t\t\t\t\t\tec.Report.Error (1662, loc,\n\t\t\t\t\t\t\t\"Cannot convert `{0}' to delegate type `{1}' because some of the return types in the block are not implicitly convertible to the delegate return type\",\n\t\t\t\t\t\t\tam.ContainerType, am.GetSignatureForError ());\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\t\t\t\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (expr != null) {\n\n\t\t\t\tvar async_body = ec.CurrentAnonymousMethod as AsyncInitializer;\n\t\t\t\tif (async_body != null) {\n\t\t\t\t\tvar storey = (AsyncTaskStorey)async_body.Storey;\n\t\t\t\t\tLabel exit_label = async_body.BodyEnd;\n\n\t\t\t\t\t//\n\t\t\t\t\t// It's null for await without async\n\t\t\t\t\t//\n\t\t\t\t\tif (storey.HoistedReturnValue != null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Special case hoisted return value (happens in try/finally scenario)\n\t\t\t\t\t\t//\n\t\t\t\t\t\tif (ec.TryFinallyUnwind != null) {\n\t\t\t\t\t\t\tif (storey.HoistedReturnValue is VariableReference) {\n\t\t\t\t\t\t\t\tstorey.HoistedReturnValue = ec.GetTemporaryField (storey.HoistedReturnValue.Type);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\texit_label = TryFinally.EmitRedirectedReturn (ec, async_body);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar async_return = (IAssignMethod)storey.HoistedReturnValue;\n\t\t\t\t\t\tasync_return.EmitAssign (ec, expr, false, false);\n\t\t\t\t\t\tec.EmitEpilogue ();\n\t\t\t\t\t} else {\n\t\t\t\t\t\texpr.Emit (ec);\n\n\t\t\t\t\t\tif (ec.TryFinallyUnwind != null)\n\t\t\t\t\t\t\texit_label = TryFinally.EmitRedirectedReturn (ec, async_body);\n\t\t\t\t\t}\n\n\t\t\t\t\tec.Emit (OpCodes.Leave, exit_label);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\texpr.Emit (ec);\n\t\t\t\tec.EmitEpilogue ();\n\n\t\t\t\tif (unwind_protect || ec.EmitAccurateDebugInfo)\n\t\t\t\t\tec.Emit (OpCodes.Stloc, ec.TemporaryReturn ());\n\t\t\t}\n\n\t\t\tif (unwind_protect) {\n\t\t\t\tec.Emit (OpCodes.Leave, ec.CreateReturnLabel ());\n\t\t\t} else if (ec.EmitAccurateDebugInfo) {\n\t\t\t\tec.Emit (OpCodes.Br, ec.CreateReturnLabel ());\n\t\t\t} else {\n\t\t\t\tec.Emit (OpCodes.Ret);\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (expr != null)\n\t\t\t\texpr.FlowAnalysis (fc);\n\n\t\t\tbase.DoFlowAnalysis (fc);\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid Error_ReturnFromIterator (ResolveContext rc)\n\t\t{\n\t\t\trc.Report.Error (1622, loc,\n\t\t\t\t\"Cannot return a value from iterators. Use the yield return statement to return a value, or yield break to end the iteration\");\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tReturn target = (Return) t;\n\t\t\t// It's null for simple return;\n\t\t\tif (expr != null)\n\t\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Goto : ExitStatement\n\t{\n\t\tstring target;\n\t\tLabeledStatement label;\n\t\tTryFinally try_finally;\n\n\t\tpublic Goto (string label, Location l)\n\t\t{\n\t\t\tloc = l;\n\t\t\ttarget = label;\n\t\t}\n\n\t\tpublic string Target {\n\t\t\tget { return target; }\n\t\t}\n\n\t\tprotected override bool IsLocalExit {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoResolve (BlockContext bc)\n\t\t{\n\t\t\tlabel = bc.CurrentBlock.LookupLabel (target);\n\t\t\tif (label == null) {\n\t\t\t\tError_UnknownLabel (bc, target, loc);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ttry_finally = bc.CurrentTryBlock as TryFinally;\n\n\t\t\tCheckExitBoundaries (bc, label.Block);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static void Error_UnknownLabel (BlockContext bc, string label, Location loc)\n\t\t{\n\t\t\tbc.Report.Error (159, loc, \"The label `{0}:' could not be found within the scope of the goto statement\",\n\t\t\t\tlabel);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (fc.LabelStack == null) {\n\t\t\t\tfc.LabelStack = new List<LabeledStatement> ();\n\t\t\t} else if (fc.LabelStack.Contains (label)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tfc.LabelStack.Add (label);\n\t\t\tlabel.Block.ScanGotoJump (label, fc);\n\t\t\tfc.LabelStack.Remove (label);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (rc.IsUnreachable)\n\t\t\t\treturn rc;\n\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tif (try_finally != null) {\n\t\t\t\tif (try_finally.FinallyBlock.HasReachableClosingBrace) {\n\t\t\t\t\tlabel.AddGotoReference (rc, false);\n\t\t\t\t} else {\n\t\t\t\t\tlabel.AddGotoReference (rc, true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlabel.AddGotoReference (rc, false);\n\t\t\t}\n\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\t// Nothing to clone\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (label == null)\n\t\t\t\tthrow new InternalErrorException (\"goto emitted before target resolved\");\n\n\t\t\tLabel l = label.LabelTarget (ec);\n\n\t\t\tif (ec.TryFinallyUnwind != null && IsLeavingFinally (label.Block)) {\n\t\t\t\tvar async_body = (AsyncInitializer) ec.CurrentAnonymousMethod;\n\t\t\t\tl = TryFinally.EmitRedirectedJump (ec, async_body, l, label.Block);\n\t\t\t}\n\n\t\t\tec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l);\n\t\t}\n\n\t\tbool IsLeavingFinally (Block labelBlock)\n\t\t{\n\t\t\tvar b = try_finally.Statement as Block;\n\t\t\twhile (b != null) {\n\t\t\t\tif (b == labelBlock)\n\t\t\t\t\treturn true;\n\n\t\t\t\tb = b.Parent;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class LabeledStatement : Statement {\n\t\tstring name;\n\t\tbool defined;\n\t\tbool referenced;\n\t\tbool finalTarget;\n\t\tLabel label;\n\t\tBlock block;\n\t\t\n\t\tpublic LabeledStatement (string name, Block block, Location l)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tthis.block = block;\n\t\t\tthis.loc = l;\n\t\t}\n\n\t\tpublic Label LabelTarget (EmitContext ec)\n\t\t{\n\t\t\tif (defined)\n\t\t\t\treturn label;\n\n\t\t\tlabel = ec.DefineLabel ();\n\t\t\tdefined = true;\n\t\t\treturn label;\n\t\t}\n\n\t\tpublic Block Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget { return name; }\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\tvar t = (LabeledStatement) target;\n\n\t\t\tt.block = clonectx.RemapBlockCopy (block);\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tLabelTarget (ec);\n\t\t\tec.MarkLabel (label);\n\n\t\t\tif (finalTarget)\n\t\t\t\tec.Emit (OpCodes.Br_S, label);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (!referenced) {\n\t\t\t\tfc.Report.Warning (164, 2, loc, \"This label has not been referenced\");\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tif (referenced)\n\t\t\t\trc = new Reachability ();\n\n\t\t\treturn rc;\n\t\t}\n\n\t\tpublic void AddGotoReference (Reachability rc, bool finalTarget)\n\t\t{\n\t\t\tif (referenced)\n\t\t\t\treturn;\n\n\t\t\treferenced = true;\n\t\t\tMarkReachable (rc);\n\n\t\t\t//\n\t\t\t// Label is final target when goto jumps out of try block with\n\t\t\t// finally clause. In that case we need leave with target but in C#\n\t\t\t// terms the label is unreachable. Using finalTarget we emit\n\t\t\t// explicit label not just marker\n\t\t\t//\n\t\t\tif (finalTarget) {\n\t\t\t\tthis.finalTarget = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tblock.ScanGotoJump (this);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\t\n\n\t/// <summary>\n\t///   `goto default' statement\n\t/// </summary>\n\tpublic class GotoDefault : SwitchGoto\n\t{\t\t\n\t\tpublic GotoDefault (Location l)\n\t\t\t: base (l)\n\t\t{\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tif (bc.Switch == null) {\n\t\t\t\tError_GotoCaseRequiresSwitchBlock (bc);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbc.Switch.RegisterGotoCase (null, null);\n\t\t\tbase.Resolve (bc);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, ec.Switch.DefaultLabel.GetILLabel (ec));\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (!rc.IsUnreachable) {\n\t\t\t\tvar label = switch_statement.DefaultLabel;\n\t\t\t\tif (label.IsUnreachable) {\n\t\t\t\t\tlabel.MarkReachable (rc);\n\t\t\t\t\tswitch_statement.Block.ScanGotoJump (label);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.MarkReachable (rc);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   `goto case' statement\n\t/// </summary>\n\tpublic class GotoCase : SwitchGoto\n\t{\n\t\tExpression expr;\n\t\t\n\t\tpublic GotoCase (Expression e, Location l)\n\t\t\t: base (l)\n\t\t{\n\t\t\texpr = e;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n \t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic SwitchLabel Label { get; set; }\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tif (ec.Switch == null) {\n\t\t\t\tError_GotoCaseRequiresSwitchBlock (ec);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tConstant c = expr.ResolveLabelConstant (ec);\n\t\t\tif (c == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tConstant res;\n\t\t\tif (ec.Switch.IsNullable && c is NullLiteral) {\n\t\t\t\tres = c;\n\t\t\t} else {\n\t\t\t\tTypeSpec type = ec.Switch.SwitchType;\n\t\t\t\tres = c.Reduce (ec, type);\n\t\t\t\tif (res == null) {\n\t\t\t\t\tc.Error_ValueCannotBeConverted (ec, type, true);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!Convert.ImplicitStandardConversionExists (c, type))\n\t\t\t\t\tec.Report.Warning (469, 2, loc,\n\t\t\t\t\t\t\"The `goto case' value is not implicitly convertible to type `{0}'\",\n\t\t\t\t\t\ttype.GetSignatureForError ());\n\n\t\t\t}\n\n\t\t\tec.Switch.RegisterGotoCase (this, res);\n\t\t\tbase.Resolve (ec);\n\t\t\texpr = res;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, Label.GetILLabel (ec));\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tGotoCase target = (GotoCase) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (!rc.IsUnreachable) {\n\t\t\t\tvar label = switch_statement.FindLabel ((Constant) expr);\n\t\t\t\tif (label.IsUnreachable) {\n\t\t\t\t\tlabel.MarkReachable (rc);\n\t\t\t\t\tswitch_statement.Block.ScanGotoJump (label);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.MarkReachable (rc);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic abstract class SwitchGoto : Statement\n\t{\n\t\tprotected bool unwind_protect;\n\t\tprotected Switch switch_statement;\n\n\t\tprotected SwitchGoto (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\t// Nothing to clone\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tCheckExitBoundaries (bc, bc.Switch.Block);\n\n\t\t\tunwind_protect = bc.HasAny (ResolveContext.Options.TryScope | ResolveContext.Options.CatchScope);\n\t\t\tswitch_statement = bc.Switch;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\n\t\tprotected void Error_GotoCaseRequiresSwitchBlock (BlockContext bc)\n\t\t{\n\t\t\tbc.Report.Error (153, loc, \"A goto case is only valid inside a switch statement\");\n\t\t}\n\t}\n\t\n\tpublic class Throw : Statement {\n\t\tExpression expr;\n\t\t\n\t\tpublic Throw (Expression expr, Location l)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n \t\t\t\treturn this.expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tif (expr == null) {\n\t\t\t\tif (!ec.HasSet (ResolveContext.Options.CatchScope)) {\n\t\t\t\t\tec.Report.Error (156, loc, \"A throw statement with no arguments is not allowed outside of a catch clause\");\n\t\t\t\t} else if (ec.HasSet (ResolveContext.Options.FinallyScope)) {\n\t\t\t\t\tfor (var b = ec.CurrentBlock; b != null && !b.IsCatchBlock; b = b.Parent) {\n\t\t\t\t\t\tif (b.IsFinallyBlock) {\n\t\t\t\t\t\t\tec.Report.Error (724, loc,\n\t\t\t\t\t\t\t\t\"A throw statement with no arguments is not allowed inside of a finally clause nested inside of the innermost catch clause\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\texpr = expr.Resolve (ec, ResolveFlags.Type | ResolveFlags.VariableOrValue);\n\n\t\t\tif (expr == null)\n\t\t\t\treturn false;\n\n\t\t\tvar et = ec.BuiltinTypes.Exception;\n\t\t\tif (Convert.ImplicitConversionExists (ec, expr, et))\n\t\t\t\texpr = Convert.ImplicitConversion (ec, expr, et, loc);\n\t\t\telse\n\t\t\t\tec.Report.Error (155, expr.Location, \"The type caught or thrown must be derived from System.Exception\");\n\n\t\t\treturn true;\n\t\t}\n\t\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (expr == null) {\n\t\t\t\tvar atv = ec.AsyncThrowVariable;\n\t\t\t\tif (atv != null) {\n\t\t\t\t\tif (atv.HoistedVariant != null) {\n\t\t\t\t\t\tatv.HoistedVariant.Emit (ec);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tatv.Emit (ec);\n\t\t\t\t\t}\n\n\t\t\t\t\tec.Emit (OpCodes.Throw);\n\t\t\t\t} else {\n\t\t\t\t\tec.Emit (OpCodes.Rethrow);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\texpr.Emit (ec);\n\n\t\t\t\tec.Emit (OpCodes.Throw);\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (expr != null)\n\t\t\t\texpr.FlowAnalysis (fc);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tThrow target = (Throw) t;\n\n\t\t\tif (expr != null)\n\t\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Break : LocalExitStatement\n\t{\t\t\n\t\tpublic Break (Location l)\n\t\t\t: base (l)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tvar l = ec.LoopEnd;\n\n\t\t\tif (ec.TryFinallyUnwind != null) {\n\t\t\t\tvar async_body = (AsyncInitializer) ec.CurrentAnonymousMethod;\n\t\t\t\tl = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block);\n\t\t\t}\n\n\t\t\tec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tenclosing_loop.AddEndDefiniteAssignment (fc);\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override bool DoResolve (BlockContext bc)\n\t\t{\n\t\t\tenclosing_loop = bc.EnclosingLoopOrSwitch;\n\t\t\treturn base.DoResolve (bc);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tif (!rc.IsUnreachable)\n\t\t\t\tenclosing_loop.SetEndReachable ();\n\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\t}\n\n\tpublic class Continue : LocalExitStatement\n\t{\t\t\n\t\tpublic Continue (Location l)\n\t\t\t: base (l)\n\t\t{\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tvar l = ec.LoopBegin;\n\n\t\t\tif (ec.TryFinallyUnwind != null) {\n\t\t\t\tvar async_body = (AsyncInitializer) ec.CurrentAnonymousMethod;\n\t\t\t\tl = TryFinally.EmitRedirectedJump (ec, async_body, l, enclosing_loop.Statement as Block);\n\t\t\t}\n\n\t\t\tec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, l);\n\t\t}\n\n\t\tprotected override bool DoResolve (BlockContext bc)\n\t\t{\n\t\t\tenclosing_loop = bc.EnclosingLoop;\n\t\t\treturn base.DoResolve (bc);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tif (!rc.IsUnreachable)\n\t\t\t\tenclosing_loop.SetIteratorReachable ();\n\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\t}\n\n\tpublic abstract class LocalExitStatement : ExitStatement\n\t{\n\t\tprotected LoopStatement enclosing_loop;\n\n\t\tprotected LocalExitStatement (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tprotected override bool IsLocalExit {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\t// nothing needed.\n\t\t}\n\n\t\tprotected override bool DoResolve (BlockContext bc)\n\t\t{\n\t\t\tif (enclosing_loop == null) {\n\t\t\t\tbc.Report.Error (139, loc, \"No enclosing loop out of which to break or continue\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar block = enclosing_loop.Statement as Block;\n\n\t\t\t// Don't need to do extra checks for simple statements loops\n\t\t\tif (block != null) {\n\t\t\t\tCheckExitBoundaries (bc, block);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic interface ILocalVariable\n\t{\n\t\tvoid Emit (EmitContext ec);\n\t\tvoid EmitAssign (EmitContext ec);\n\t\tvoid EmitAddressOf (EmitContext ec);\n\t}\n\n\tpublic interface INamedBlockVariable\n\t{\n\t\tBlock Block { get; }\n\t\tExpression CreateReferenceExpression (ResolveContext rc, Location loc);\n\t\tbool IsDeclared { get; }\n\t\tbool IsParameter { get; }\n\t\tLocation Location { get; }\n\t}\n\n\tpublic class BlockVariableDeclarator\n\t{\n\t\tLocalVariable li;\n\t\tExpression initializer;\n\n\t\tpublic BlockVariableDeclarator (LocalVariable li, Expression initializer)\n\t\t{\n\t\t\tif (li.Type != null)\n\t\t\t\tthrow new ArgumentException (\"Expected null variable type\");\n\n\t\t\tthis.li = li;\n\t\t\tthis.initializer = initializer;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic LocalVariable Variable {\n\t\t\tget {\n\t\t\t\treturn li;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Initializer {\n\t\t\tget {\n\t\t\t\treturn initializer;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tinitializer = value;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic virtual BlockVariableDeclarator Clone (CloneContext cloneCtx)\n\t\t{\n\t\t\tvar t = (BlockVariableDeclarator) MemberwiseClone ();\n\t\t\tif (initializer != null)\n\t\t\t\tt.initializer = initializer.Clone (cloneCtx);\n\n\t\t\treturn t;\n\t\t}\n\t}\n\n\tpublic class BlockVariable : Statement\n\t{\n\t\tExpression initializer;\n\t\tprotected FullNamedExpression type_expr;\n\t\tprotected LocalVariable li;\n\t\tprotected List<BlockVariableDeclarator> declarators;\n\t\tTypeSpec type;\n\n\t\tpublic BlockVariable (FullNamedExpression type, LocalVariable li)\n\t\t{\n\t\t\tthis.type_expr = type;\n\t\t\tthis.li = li;\n\t\t\tthis.loc = type_expr.Location;\n\t\t}\n\n\t\tprotected BlockVariable (LocalVariable li)\n\t\t{\n\t\t\tthis.li = li;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic List<BlockVariableDeclarator> Declarators {\n\t\t\tget {\n\t\t\t\treturn declarators;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Initializer {\n\t\t\tget {\n\t\t\t\treturn initializer;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tinitializer = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn type_expr;\n\t\t\t}\n\t\t}\n\n\t\tpublic LocalVariable Variable {\n\t\t\tget {\n\t\t\t\treturn li;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void AddDeclarator (BlockVariableDeclarator decl)\n\t\t{\n\t\t\tif (declarators == null)\n\t\t\t\tdeclarators = new List<BlockVariableDeclarator> ();\n\n\t\t\tdeclarators.Add (decl);\n\t\t}\n\n\t\tstatic void CreateEvaluatorVariable (BlockContext bc, LocalVariable li)\n\t\t{\n\t\t\tif (bc.Report.Errors != 0)\n\t\t\t\treturn;\n\n\t\t\tvar container = bc.CurrentMemberDefinition.Parent.PartialContainer;\n\n\t\t\tField f = new Field (container, new TypeExpression (li.Type, li.Location), Modifiers.PUBLIC | Modifiers.STATIC,\n\t\t\t\tnew MemberName (li.Name, li.Location), null);\n\n\t\t\tcontainer.AddField (f);\n\t\t\tf.Define ();\n\n\t\t\tli.HoistedVariant = new HoistedEvaluatorVariable (f);\n\t\t\tli.SetIsUsed ();\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\treturn Resolve (bc, true);\n\t\t}\n\n\t\tpublic bool Resolve (BlockContext bc, bool resolveDeclaratorInitializers)\n\t\t{\n\t\t\tif (type == null && !li.IsCompilerGenerated) {\n\t\t\t\tvar vexpr = type_expr as VarExpr;\n\n\t\t\t\t//\n\t\t\t\t// C# 3.0 introduced contextual keywords (var) which behaves like a type if type with\n\t\t\t\t// same name exists or as a keyword when no type was found\n\t\t\t\t//\n\t\t\t\tif (vexpr != null && !vexpr.IsPossibleTypeOrNamespace (bc)) {\n\t\t\t\t\tif (bc.Module.Compiler.Settings.Version < LanguageVersion.V_3)\n\t\t\t\t\t\tbc.Report.FeatureIsNotAvailable (bc.Module.Compiler, loc, \"implicitly typed local variable\");\n\n\t\t\t\t\tif (li.IsFixed) {\n\t\t\t\t\t\tbc.Report.Error (821, loc, \"A fixed statement cannot use an implicitly typed local variable\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (li.IsConstant) {\n\t\t\t\t\t\tbc.Report.Error (822, loc, \"An implicitly typed local variable cannot be a constant\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Initializer == null) {\n\t\t\t\t\t\tbc.Report.Error (818, loc, \"An implicitly typed local variable declarator must include an initializer\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (declarators != null) {\n\t\t\t\t\t\tbc.Report.Error (819, loc, \"An implicitly typed local variable declaration cannot include multiple declarators\");\n\t\t\t\t\t\tdeclarators = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tInitializer = Initializer.Resolve (bc);\n\t\t\t\t\tif (Initializer != null) {\n\t\t\t\t\t\t((VarExpr) type_expr).InferType (bc, Initializer);\n\t\t\t\t\t\ttype = type_expr.Type;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Set error type to indicate the var was placed correctly but could\n\t\t\t\t\t\t// not be infered\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// var a = missing ();\n\t\t\t\t\t\t//\n\t\t\t\t\t\ttype = InternalType.ErrorType;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (type == null) {\n\t\t\t\t\ttype = type_expr.ResolveAsType (bc);\n\t\t\t\t\tif (type == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tif (li.IsConstant && !type.IsConstantCompatible) {\n\t\t\t\t\t\tConst.Error_InvalidConstantType (type, loc, bc.Report);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (type.IsStatic)\n\t\t\t\t\tFieldBase.Error_VariableOfStaticClass (loc, li.Name, type, bc.Report);\n\n\t\t\t\tli.Type = type;\n\t\t\t}\n\n\t\t\tbool eval_global = bc.Module.Compiler.Settings.StatementMode && bc.CurrentBlock is ToplevelBlock;\n\t\t\tif (eval_global) {\n\t\t\t\tCreateEvaluatorVariable (bc, li);\n\t\t\t} else if (type != InternalType.ErrorType) {\n\t\t\t\tli.PrepareAssignmentAnalysis (bc);\n\t\t\t}\n\n\t\t\tif (initializer != null) {\n\t\t\t\tinitializer = ResolveInitializer (bc, li, initializer);\n\t\t\t\t// li.Variable.DefinitelyAssigned \n\t\t\t}\n\n\t\t\tif (declarators != null) {\n\t\t\t\tforeach (var d in declarators) {\n\t\t\t\t\td.Variable.Type = li.Type;\n\t\t\t\t\tif (eval_global) {\n\t\t\t\t\t\tCreateEvaluatorVariable (bc, d.Variable);\n\t\t\t\t\t} else if (type != InternalType.ErrorType) {\n\t\t\t\t\t\td.Variable.PrepareAssignmentAnalysis (bc);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (d.Initializer != null && resolveDeclaratorInitializers) {\n\t\t\t\t\t\td.Initializer = ResolveInitializer (bc, d.Variable, d.Initializer);\n\t\t\t\t\t\t// d.Variable.DefinitelyAssigned \n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected virtual Expression ResolveInitializer (BlockContext bc, LocalVariable li, Expression initializer)\n\t\t{\n\t\t\tvar a = new SimpleAssign (li.CreateReferenceExpression (bc, li.Location), initializer, li.Location);\n\t\t\treturn a.ResolveStatement (bc);\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tli.CreateBuilder (ec);\n\n\t\t\tif (Initializer != null && !IsUnreachable)\n\t\t\t\t((ExpressionStatement) Initializer).EmitStatement (ec);\n\n\t\t\tif (declarators != null) {\n\t\t\t\tforeach (var d in declarators) {\n\t\t\t\t\td.Variable.CreateBuilder (ec);\n\t\t\t\t\tif (d.Initializer != null && !IsUnreachable) {\n\t\t\t\t\t\tec.Mark (d.Variable.Location);\n\t\t\t\t\t\t((ExpressionStatement) d.Initializer).EmitStatement (ec);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (Initializer != null)\n\t\t\t\tInitializer.FlowAnalysis (fc);\n\n\t\t\tif (declarators != null) {\n\t\t\t\tforeach (var d in declarators) {\n\t\t\t\t\tif (d.Initializer != null)\n\t\t\t\t\t\td.Initializer.FlowAnalysis (fc);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tvar init = initializer as ExpressionStatement;\n\t\t\tif (init != null)\n\t\t\t\tinit.MarkReachable (rc);\n\n\t\t\treturn base.MarkReachable (rc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\tBlockVariable t = (BlockVariable) target;\n\n\t\t\tif (type_expr != null)\n\t\t\t\tt.type_expr = (FullNamedExpression) type_expr.Clone (clonectx);\n\n\t\t\tif (initializer != null)\n\t\t\t\tt.initializer = initializer.Clone (clonectx);\n\n\t\t\tif (declarators != null) {\n\t\t\t\tt.declarators = null;\n\t\t\t\tforeach (var d in declarators)\n\t\t\t\t\tt.AddDeclarator (d.Clone (clonectx));\n\t\t\t}\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class BlockConstant : BlockVariable\n\t{\n\t\tpublic BlockConstant (FullNamedExpression type, LocalVariable li)\n\t\t\t: base (type, li)\n\t\t{\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t// Nothing to emit, not even sequence point\n\t\t}\n\n\t\tprotected override Expression ResolveInitializer (BlockContext bc, LocalVariable li, Expression initializer)\n\t\t{\n\t\t\tinitializer = initializer.Resolve (bc);\n\t\t\tif (initializer == null)\n\t\t\t\treturn null;\n\n\t\t\tvar c = initializer as Constant;\n\t\t\tif (c == null) {\n\t\t\t\tinitializer.Error_ExpressionMustBeConstant (bc, initializer.Location, li.Name);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tc = c.ConvertImplicitly (li.Type);\n\t\t\tif (c == null) {\n\t\t\t\tif (TypeSpec.IsReferenceType (li.Type))\n\t\t\t\t\tinitializer.Error_ConstantCanBeInitializedWithNullOnly (bc, li.Type, initializer.Location, li.Name);\n\t\t\t\telse\n\t\t\t\t\tinitializer.Error_ValueCannotBeConverted (bc, li.Type, false);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tli.ConstantValue = c;\n\t\t\treturn initializer;\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t//\n\t// The information about a user-perceived local variable\n\t//\n\tpublic sealed class LocalVariable : INamedBlockVariable, ILocalVariable\n\t{\n\t\t[Flags]\n\t\tpublic enum Flags\n\t\t{\n\t\t\tUsed = 1,\n\t\t\tIsThis = 1 << 1,\n\t\t\tAddressTaken = 1 << 2,\n\t\t\tCompilerGenerated = 1 << 3,\n\t\t\tConstant = 1 << 4,\n\t\t\tForeachVariable = 1 << 5,\n\t\t\tFixedVariable = 1 << 6,\n\t\t\tUsingVariable = 1 << 7,\n\t\t\tIsLocked = 1 << 8,\n\n\t\t\tReadonlyMask = ForeachVariable | FixedVariable | UsingVariable\n\t\t}\n\n\t\tTypeSpec type;\n\t\treadonly string name;\n\t\treadonly Location loc;\n\t\treadonly Block block;\n\t\tFlags flags;\n\t\tConstant const_value;\n\n\t\tpublic VariableInfo VariableInfo;\n\t\tHoistedVariable hoisted_variant;\n\n\t\tLocalBuilder builder;\n\n\t\tpublic LocalVariable (Block block, string name, Location loc)\n\t\t{\n\t\t\tthis.block = block;\n\t\t\tthis.name = name;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic LocalVariable (Block block, string name, Flags flags, Location loc)\n\t\t\t: this (block, name, loc)\n\t\t{\n\t\t\tthis.flags = flags;\n\t\t}\n\n\t\t//\n\t\t// Used by variable declarators\n\t\t//\n\t\tpublic LocalVariable (LocalVariable li, string name, Location loc)\n\t\t\t: this (li.block, name, li.flags, loc)\n\t\t{\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool AddressTaken {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.AddressTaken) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic Block Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\t\t}\n\n\t\tpublic Constant ConstantValue {\n\t\t\tget {\n\t\t\t\treturn const_value;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tconst_value = value;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Hoisted local variable variant\n\t\t//\n\t\tpublic HoistedVariable HoistedVariant {\n\t\t\tget {\n\t\t\t\treturn hoisted_variant;\n\t\t\t}\n\t\t\tset {\n\t\t\t\thoisted_variant = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsDeclared {\n\t\t\tget {\n\t\t\t\treturn type != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCompilerGenerated {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.CompilerGenerated) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConstant {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.Constant) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsLocked {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.IsLocked) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tflags = value ? flags | Flags.IsLocked : flags & ~Flags.IsLocked;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsThis {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.IsThis) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsFixed {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.FixedVariable) != 0;\n\t\t\t}\n\t\t}\n\n\t\tbool INamedBlockVariable.IsParameter {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsReadonly {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.ReadonlyMask) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec Type {\n\t\t    get {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t    set {\n\t\t\t\ttype = value;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void CreateBuilder (EmitContext ec)\n\t\t{\n\t\t\tif ((flags & Flags.Used) == 0) {\n\t\t\t\tif (VariableInfo == null) {\n\t\t\t\t\t// Missing flow analysis or wrong variable flags\n\t\t\t\t\tthrow new InternalErrorException (\"VariableInfo is null and the variable `{0}' is not used\", name);\n\t\t\t\t}\n\n\t\t\t\tif (VariableInfo.IsEverAssigned)\n\t\t\t\t\tec.Report.Warning (219, 3, Location, \"The variable `{0}' is assigned but its value is never used\", Name);\n\t\t\t\telse\n\t\t\t\t\tec.Report.Warning (168, 3, Location, \"The variable `{0}' is declared but never used\", Name);\n\t\t\t}\n\n\t\t\tif (HoistedVariant != null)\n\t\t\t\treturn;\n\n\t\t\tif (builder != null) {\n\t\t\t\tif ((flags & Flags.CompilerGenerated) != 0)\n\t\t\t\t\treturn;\n\n\t\t\t\t// To avoid Used warning duplicates\n\t\t\t\tthrow new InternalErrorException (\"Already created variable `{0}'\", name);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// All fixed variabled are pinned, a slot has to be alocated\n\t\t\t//\n\t\t\tbuilder = ec.DeclareLocal (Type, IsFixed);\n\t\t\tif (!ec.HasSet (BuilderContext.Options.OmitDebugInfo) && (flags & Flags.CompilerGenerated) == 0)\n\t\t\t\tec.DefineLocalVariable (name, builder);\n\t\t}\n\n\t\tpublic static LocalVariable CreateCompilerGenerated (TypeSpec type, Block block, Location loc)\n\t\t{\n\t\t\tLocalVariable li = new LocalVariable (block, GetCompilerGeneratedName (block), Flags.CompilerGenerated | Flags.Used, loc);\n\t\t\tli.Type = type;\n\t\t\treturn li;\n\t\t}\n\n\t\tpublic Expression CreateReferenceExpression (ResolveContext rc, Location loc)\n\t\t{\n\t\t\tif (IsConstant && const_value != null)\n\t\t\t\treturn Constant.CreateConstantFromValue (Type, const_value.GetValue (), loc);\n\n\t\t\treturn new LocalVariableReference (this, loc);\n\t\t}\n\n\t\tpublic void Emit (EmitContext ec)\n\t\t{\n\t\t\t// TODO: Need something better for temporary variables\n\t\t\tif ((flags & Flags.CompilerGenerated) != 0)\n\t\t\t\tCreateBuilder (ec);\n\n\t\t\tec.Emit (OpCodes.Ldloc, builder);\n\t\t}\n\n\t\tpublic void EmitAssign (EmitContext ec)\n\t\t{\n\t\t\t// TODO: Need something better for temporary variables\n\t\t\tif ((flags & Flags.CompilerGenerated) != 0)\n\t\t\t\tCreateBuilder (ec);\n\n\t\t\tec.Emit (OpCodes.Stloc, builder);\n\t\t}\n\n\t\tpublic void EmitAddressOf (EmitContext ec)\n\t\t{\n\t\t\t// TODO: Need something better for temporary variables\n\t\t\tif ((flags & Flags.CompilerGenerated) != 0)\n\t\t\t\tCreateBuilder (ec);\n\n\t\t\tec.Emit (OpCodes.Ldloca, builder);\n\t\t}\n\n\t\tpublic static string GetCompilerGeneratedName (Block block)\n\t\t{\n\t\t\t// HACK: Debugger depends on the name semantics\n\t\t\treturn \"$locvar\" + block.ParametersBlock.TemporaryLocalsCount++.ToString (\"X\");\n\t\t}\n\n\t\tpublic string GetReadOnlyContext ()\n\t\t{\n\t\t\tswitch (flags & Flags.ReadonlyMask) {\n\t\t\tcase Flags.FixedVariable:\n\t\t\t\treturn \"fixed variable\";\n\t\t\tcase Flags.ForeachVariable:\n\t\t\t\treturn \"foreach iteration variable\";\n\t\t\tcase Flags.UsingVariable:\n\t\t\t\treturn \"using variable\";\n\t\t\t}\n\n\t\t\tthrow new InternalErrorException (\"Variable is not readonly\");\n\t\t}\n\n\t\tpublic bool IsThisAssigned (FlowAnalysisContext fc, Block block)\n\t\t{\n\t\t\tif (VariableInfo == null)\n\t\t\t\tthrow new Exception ();\n\n\t\t\tif (IsAssigned (fc))\n\t\t\t\treturn true;\n\n\t\t\treturn VariableInfo.IsFullyInitialized (fc, block.StartLocation);\n\t\t}\n\n\t\tpublic bool IsAssigned (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn fc.IsDefinitelyAssigned (VariableInfo);\n\t\t}\n\n\t\tpublic void PrepareAssignmentAnalysis (BlockContext bc)\n\t\t{\n\t\t\t//\n\t\t\t// No need to run assignment analysis for these guys\n\t\t\t//\n\t\t\tif ((flags & (Flags.Constant | Flags.ReadonlyMask | Flags.CompilerGenerated)) != 0)\n\t\t\t\treturn;\n\n\t\t\tVariableInfo = VariableInfo.Create (bc, this);\n\t\t}\n\n\t\t//\n\t\t// Mark the variables as referenced in the user code\n\t\t//\n\t\tpublic void SetIsUsed ()\n\t\t{\n\t\t\tflags |= Flags.Used;\n\t\t}\n\n\t\tpublic void SetHasAddressTaken ()\n\t\t{\n\t\t\tflags |= (Flags.AddressTaken | Flags.Used);\n\t\t}\n\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn string.Format (\"LocalInfo ({0},{1},{2},{3})\", name, type, VariableInfo, Location);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Block represents a C# block.\n\t/// </summary>\n\t///\n\t/// <remarks>\n\t///   This class is used in a number of places: either to represent\n\t///   explicit blocks that the programmer places or implicit blocks.\n\t///\n\t///   Implicit blocks are used as labels or to introduce variable\n\t///   declarations.\n\t///\n\t///   Top-level blocks derive from Block, and they are called ToplevelBlock\n\t///   they contain extra information that is not necessary on normal blocks.\n\t/// </remarks>\n\tpublic class Block : Statement {\n\t\t[Flags]\n\t\tpublic enum Flags\n\t\t{\n\t\t\tUnchecked = 1,\n\t\t\tReachableEnd = 8,\n\t\t\tUnsafe = 16,\n\t\t\tHasCapturedVariable = 64,\n\t\t\tHasCapturedThis = 1 << 7,\n\t\t\tIsExpressionTree = 1 << 8,\n\t\t\tCompilerGenerated = 1 << 9,\n\t\t\tHasAsyncModifier = 1 << 10,\n\t\t\tResolved = 1 << 11,\n\t\t\tYieldBlock = 1 << 12,\n\t\t\tAwaitBlock = 1 << 13,\n\t\t\tFinallyBlock = 1 << 14,\n\t\t\tCatchBlock = 1 << 15,\n\t\t\tIterator = 1 << 20,\n\t\t\tNoFlowAnalysis = 1 << 21,\n\t\t\tInitializationEmitted = 1 << 22\n\t\t}\n\n\t\tpublic Block Parent;\n\t\tpublic Location StartLocation;\n\t\tpublic Location EndLocation;\n\n\t\tpublic ExplicitBlock Explicit;\n\t\tpublic ParametersBlock ParametersBlock;\n\n\t\tprotected Flags flags;\n\n\t\t//\n\t\t// The statements in this block\n\t\t//\n\t\tprotected List<Statement> statements;\n\n\t\tprotected List<Statement> scope_initializers;\n\n\t\tint? resolving_init_idx;\n\n\t\tBlock original;\n\n#if DEBUG\n\t\tstatic int id;\n\t\tpublic int ID = id++;\n\n\t\tstatic int clone_id_counter;\n\t\tint clone_id;\n#endif\n\n//\t\tint assignable_slots;\n\n\t\tpublic Block (Block parent, Location start, Location end)\n\t\t\t: this (parent, 0, start, end)\n\t\t{\n\t\t}\n\n\t\tpublic Block (Block parent, Flags flags, Location start, Location end)\n\t\t{\n\t\t\tif (parent != null) {\n\t\t\t\t// the appropriate constructors will fixup these fields\n\t\t\t\tParametersBlock = parent.ParametersBlock;\n\t\t\t\tExplicit = parent.Explicit;\n\t\t\t}\n\t\t\t\n\t\t\tthis.Parent = parent;\n\t\t\tthis.flags = flags;\n\t\t\tthis.StartLocation = start;\n\t\t\tthis.EndLocation = end;\n\t\t\tthis.loc = start;\n\t\t\tstatements = new List<Statement> (4);\n\n\t\t\tthis.original = this;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Block Original {\n\t\t\tget {\n\t\t\t\treturn original;\n\t\t\t}\n\t\t\tprotected set {\n\t\t\t\toriginal = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCompilerGenerated {\n\t\t\tget { return (flags & Flags.CompilerGenerated) != 0; }\n\t\t\tset { flags = value ? flags | Flags.CompilerGenerated : flags & ~Flags.CompilerGenerated; }\n\t\t}\n\n\n\t\tpublic bool IsCatchBlock {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.CatchBlock) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsFinallyBlock {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.FinallyBlock) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Unchecked {\n\t\t\tget { return (flags & Flags.Unchecked) != 0; }\n\t\t\tset { flags = value ? flags | Flags.Unchecked : flags & ~Flags.Unchecked; }\n\t\t}\n\n\t\tpublic bool Unsafe {\n\t\t\tget { return (flags & Flags.Unsafe) != 0; }\n\t\t\tset { flags |= Flags.Unsafe; }\n\t\t}\n\n\t\tpublic List<Statement> Statements {\n\t\t\tget { return statements; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic void SetEndLocation (Location loc)\n\t\t{\n\t\t\tEndLocation = loc;\n\t\t}\n\n\t\tpublic void AddLabel (LabeledStatement target)\n\t\t{\n\t\t\tParametersBlock.TopBlock.AddLabel (target.Name, target);\n\t\t}\n\n\t\tpublic void AddLocalName (LocalVariable li)\n\t\t{\n\t\t\tAddLocalName (li.Name, li);\n\t\t}\n\n\t\tpublic void AddLocalName (string name, INamedBlockVariable li)\n\t\t{\n\t\t\tParametersBlock.TopBlock.AddLocalName (name, li, false);\n\t\t}\n\n\t\tpublic virtual void Error_AlreadyDeclared (string name, INamedBlockVariable variable, string reason)\n\t\t{\n\t\t\tif (reason == null) {\n\t\t\t\tError_AlreadyDeclared (name, variable);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tParametersBlock.TopBlock.Report.Error (136, variable.Location,\n\t\t\t\t\"A local variable named `{0}' cannot be declared in this scope because it would give a different meaning \" +\n\t\t\t\t\"to `{0}', which is already used in a `{1}' scope to denote something else\",\n\t\t\t\tname, reason);\n\t\t}\n\n\t\tpublic virtual void Error_AlreadyDeclared (string name, INamedBlockVariable variable)\n\t\t{\n\t\t\tvar pi = variable as ParametersBlock.ParameterInfo;\n\t\t\tif (pi != null) {\n\t\t\t\tpi.Parameter.Error_DuplicateName (ParametersBlock.TopBlock.Report);\n\t\t\t} else {\n\t\t\t\tParametersBlock.TopBlock.Report.Error (128, variable.Location,\n\t\t\t\t\t\"A local variable named `{0}' is already defined in this scope\", name);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t\tpublic virtual void Error_AlreadyDeclaredTypeParameter (string name, Location loc)\n\t\t{\n\t\t\tParametersBlock.TopBlock.Report.Error (412, loc,\n\t\t\t\t\"The type parameter name `{0}' is the same as local variable or parameter name\",\n\t\t\t\tname);\n\t\t}\n\n\t\t//\n\t\t// It should be used by expressions which require to\n\t\t// register a statement during resolve process.\n\t\t//\n\t\tpublic void AddScopeStatement (Statement s)\n\t\t{\n\t\t\tif (scope_initializers == null)\n\t\t\t\tscope_initializers = new List<Statement> ();\n\n\t\t\t//\n\t\t\t// Simple recursive helper, when resolve scope initializer another\n\t\t\t// new scope initializer can be added, this ensures it's initialized\n\t\t\t// before existing one. For now this can happen with expression trees\n\t\t\t// in base ctor initializer only\n\t\t\t//\n\t\t\tif (resolving_init_idx.HasValue) {\n\t\t\t\tscope_initializers.Insert (resolving_init_idx.Value, s);\n\t\t\t\t++resolving_init_idx;\n\t\t\t} else {\n\t\t\t\tscope_initializers.Add (s);\n\t\t\t}\n\t\t}\n\n\t\tpublic void InsertStatement (int index, Statement s)\n\t\t{\n\t\t\tstatements.Insert (index, s);\n\t\t}\n\t\t\n\t\tpublic void AddStatement (Statement s)\n\t\t{\n\t\t\tstatements.Add (s);\n\t\t}\n\n\t\tpublic LabeledStatement LookupLabel (string name)\n\t\t{\n\t\t\treturn ParametersBlock.GetLabel (name, this);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (rc.IsUnreachable)\n\t\t\t\treturn rc;\n\n\t\t\tMarkReachableScope (rc);\n\n\t\t\tforeach (var s in statements) {\n\t\t\t\trc = s.MarkReachable (rc);\n\t\t\t\tif (rc.IsUnreachable) {\n\t\t\t\t\tif ((flags & Flags.ReachableEnd) != 0)\n\t\t\t\t\t\treturn new Reachability ();\n\n\t\t\t\t\treturn rc;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflags |= Flags.ReachableEnd;\n\n\t\t\treturn rc;\n\t\t}\n\n\t\tpublic void MarkReachableScope (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tif (scope_initializers != null) {\n\t\t\t\tforeach (var si in scope_initializers)\n\t\t\t\t\tsi.MarkReachable (rc);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tif ((flags & Flags.Resolved) != 0)\n\t\t\t\treturn true;\n\n\t\t\tBlock prev_block = bc.CurrentBlock;\n\t\t\tbc.CurrentBlock = this;\n\n\t\t\t//\n\t\t\t// Compiler generated scope statements\n\t\t\t//\n\t\t\tif (scope_initializers != null) {\n\t\t\t\tfor (resolving_init_idx = 0; resolving_init_idx < scope_initializers.Count; ++resolving_init_idx) {\n\t\t\t\t\tscope_initializers[resolving_init_idx.Value].Resolve (bc);\n\t\t\t\t}\n\n\t\t\t\tresolving_init_idx = null;\n\t\t\t}\n\n\t\t\tbool ok = true;\n\t\t\tint statement_count = statements.Count;\n\t\t\tfor (int ix = 0; ix < statement_count; ix++){\n\t\t\t\tStatement s = statements [ix];\n\n\t\t\t\tif (!s.Resolve (bc)) {\n\t\t\t\t\tok = false;\n\t\t\t\t\tif (!bc.IsInProbingMode)\n\t\t\t\t\t\tstatements [ix] = new EmptyStatement (s.loc);\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbc.CurrentBlock = prev_block;\n\n\t\t\tflags |= Flags.Resolved;\n\t\t\treturn ok;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tfor (int ix = 0; ix < statements.Count; ix++){\n\t\t\t\tstatements [ix].Emit (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (scope_initializers != null)\n\t\t\t\tEmitScopeInitializers (ec);\n\n\t\t\tDoEmit (ec);\n\t\t}\n\n\t\tprotected void EmitScopeInitializers (EmitContext ec)\n\t\t{\n\t\t\tforeach (Statement s in scope_initializers)\n\t\t\t\ts.Emit (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (scope_initializers != null) {\n\t\t\t\tforeach (var si in scope_initializers)\n\t\t\t\t\tsi.FlowAnalysis (fc);\n\t\t\t}\n\n\t\t\treturn DoFlowAnalysis (fc, 0);\t\n\t\t}\n\n\t\tbool DoFlowAnalysis (FlowAnalysisContext fc, int startIndex)\n\t\t{\n\t\t\tbool end_unreachable = !reachable;\n\t\t\tfor (; startIndex < statements.Count; ++startIndex) {\n\t\t\t\tvar s = statements[startIndex];\n\n\t\t\t\tend_unreachable = s.FlowAnalysis (fc);\n\t\t\t\tif (s.IsUnreachable) {\n\t\t\t\t\tstatements [startIndex] = RewriteUnreachableStatement (s);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Statement end reachability is needed mostly due to goto support. Consider\n\t\t\t\t//\n\t\t\t\t// if (cond) {\n\t\t\t\t//    goto X;\n\t\t\t\t// } else {\n\t\t\t\t//    goto Y;\n\t\t\t\t// }\n\t\t\t\t// X:\n\t\t\t\t//\n\t\t\t\t// X label is reachable only via goto not as another statement after if. We need\n\t\t\t\t// this for flow-analysis only to carry variable info correctly.\n\t\t\t\t//\n\t\t\t\tif (end_unreachable) {\n\t\t\t\t\tfor (++startIndex; startIndex < statements.Count; ++startIndex) {\n\t\t\t\t\t\ts = statements[startIndex];\n\t\t\t\t\t\tif (s is SwitchLabel) {\n\t\t\t\t\t\t\ts.FlowAnalysis (fc);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (s.IsUnreachable) {\n\t\t\t\t\t\t\ts.FlowAnalysis (fc);\n\t\t\t\t\t\t\tstatements [startIndex] = RewriteUnreachableStatement (s);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// The condition should be true unless there is forward jumping goto\n\t\t\t// \n\t\t\t// if (this is ExplicitBlock && end_unreachable != Explicit.HasReachableClosingBrace)\n\t\t\t//\tDebug.Fail ();\n\n\t\t\treturn !Explicit.HasReachableClosingBrace;\n\t\t}\n\n\t\tstatic Statement RewriteUnreachableStatement (Statement s)\n\t\t{\n\t\t\t// LAMESPEC: It's not clear whether declararion statement should be part of reachability\n\t\t\t// analysis. Even csc report unreachable warning for it but it's actually used hence\n\t\t\t// we try to emulate this behaviour\n\t\t\t//\n\t\t\t// Consider:\n\t\t\t// \tgoto L;\n\t\t\t//\tint v;\n\t\t\t// L:\n\t\t\t//\tv = 1;\n\n\t\t\tif (s is BlockVariable)\n\t\t\t\treturn s;\n\n\t\t\treturn new EmptyStatement (s.loc);\n\t\t}\n\n\t\tpublic void ScanGotoJump (Statement label)\n\t\t{\n\t\t\tint i;\n\t\t\tfor (i = 0; i < statements.Count; ++i) {\n\t\t\t\tif (statements[i] == label)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar rc = new Reachability ();\n\t\t\tfor (++i; i < statements.Count; ++i) {\n\t\t\t\tvar s = statements[i];\n\t\t\t\trc = s.MarkReachable (rc);\n\t\t\t\tif (rc.IsUnreachable)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tflags |= Flags.ReachableEnd;\n\t\t}\n\n\t\tpublic void ScanGotoJump (Statement label, FlowAnalysisContext fc)\n\t\t{\n\t\t\tint i;\n\t\t\tfor (i = 0; i < statements.Count; ++i) {\n\t\t\t\tif (statements[i] == label)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tDoFlowAnalysis (fc, ++i);\n\t\t}\n\n#if DEBUG\n\t\tpublic override string ToString ()\n\t\t{\n\t\t\treturn String.Format (\"{0}: ID={1} Clone={2} Location={3}\", GetType (), ID, clone_id != 0, StartLocation);\n\t\t}\n#endif\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tBlock target = (Block) t;\n#if DEBUG\n\t\t\ttarget.clone_id = ++clone_id_counter;\n#endif\n\n\t\t\tclonectx.AddBlockMap (this, target);\n\t\t\tif (original != this)\n\t\t\t\tclonectx.AddBlockMap (original, target);\n\n\t\t\ttarget.ParametersBlock = (ParametersBlock) (ParametersBlock == this ? target : clonectx.RemapBlockCopy (ParametersBlock));\n\t\t\ttarget.Explicit = (ExplicitBlock) (Explicit == this ? target : clonectx.LookupBlock (Explicit));\n\n\t\t\tif (Parent != null)\n\t\t\t\ttarget.Parent = clonectx.RemapBlockCopy (Parent);\n\n\t\t\ttarget.statements = new List<Statement> (statements.Count);\n\t\t\tforeach (Statement s in statements)\n\t\t\t\ttarget.statements.Add (s.Clone (clonectx));\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class ExplicitBlock : Block\n\t{\n\t\tprotected AnonymousMethodStorey am_storey;\n\n\t\tpublic ExplicitBlock (Block parent, Location start, Location end)\n\t\t\t: this (parent, (Flags) 0, start, end)\n\t\t{\n\t\t}\n\n\t\tpublic ExplicitBlock (Block parent, Flags flags, Location start, Location end)\n\t\t\t: base (parent, flags, start, end)\n\t\t{\n\t\t\tthis.Explicit = this;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic AnonymousMethodStorey AnonymousMethodStorey {\n\t\t\tget {\n\t\t\t\treturn am_storey;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasAwait {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.AwaitBlock) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasCapturedThis {\n\t\t\tset {\n\t\t\t\tflags = value ? flags | Flags.HasCapturedThis : flags & ~Flags.HasCapturedThis;\n\t\t\t}\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.HasCapturedThis) != 0;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Used to indicate that the block has reference to parent\n\t\t// block and cannot be made static when defining anonymous method\n\t\t//\n\t\tpublic bool HasCapturedVariable {\n\t\t\tset {\n\t\t\t\tflags = value ? flags | Flags.HasCapturedVariable : flags & ~Flags.HasCapturedVariable;\n\t\t\t}\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.HasCapturedVariable) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasReachableClosingBrace {\n\t\t    get {\n\t\t        return (flags & Flags.ReachableEnd) != 0;\n\t\t    }\n\t\t\tset {\n\t\t\t\tflags = value ? flags | Flags.ReachableEnd : flags & ~Flags.ReachableEnd;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasYield {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.YieldBlock) != 0;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t//\n\t\t// Creates anonymous method storey in current block\n\t\t//\n\t\tpublic AnonymousMethodStorey CreateAnonymousMethodStorey (ResolveContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Return same story for iterator and async blocks unless we are\n\t\t\t// in nested anonymous method\n\t\t\t//\n\t\t\tif (ec.CurrentAnonymousMethod is StateMachineInitializer && ParametersBlock.Original == ec.CurrentAnonymousMethod.Block.Original)\n\t\t\t\treturn ec.CurrentAnonymousMethod.Storey;\n\n\t\t\tif (am_storey == null) {\n\t\t\t\tMemberBase mc = ec.MemberContext as MemberBase;\n\n\t\t\t\t//\n\t\t\t\t// Creates anonymous method storey for this block\n\t\t\t\t//\n\t\t\t\tam_storey = new AnonymousMethodStorey (this, ec.CurrentMemberDefinition.Parent.PartialContainer, mc, ec.CurrentTypeParameters, \"AnonStorey\", MemberKind.Class);\n\t\t\t}\n\n\t\t\treturn am_storey;\n\t\t}\n\n\t\tpublic void EmitScopeInitialization (EmitContext ec)\n\t\t{\n\t\t\tif ((flags & Flags.InitializationEmitted) != 0)\n\t\t\t\treturn;\n\n\t\t\tif (am_storey != null) {\n\t\t\t\tDefineStoreyContainer (ec, am_storey);\n\t\t\t\tam_storey.EmitStoreyInstantiation (ec, this);\n\t\t\t}\n\n\t\t\tif (scope_initializers != null)\n\t\t\t\tEmitScopeInitializers (ec);\n\n\t\t\tflags |= Flags.InitializationEmitted;\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tEmitScopeInitialization (ec);\n\n\t\t\tif (ec.EmitAccurateDebugInfo && !IsCompilerGenerated && ec.Mark (StartLocation)) {\n\t\t\t\tec.Emit (OpCodes.Nop);\n\t\t\t}\n\n\t\t\tif (Parent != null)\n\t\t\t\tec.BeginScope ();\n\n\t\t\tDoEmit (ec);\n\n\t\t\tif (Parent != null)\n\t\t\t\tec.EndScope ();\n\n\t\t\tif (ec.EmitAccurateDebugInfo && HasReachableClosingBrace && !(this is ParametersBlock) &&\n\t\t\t\t!IsCompilerGenerated && ec.Mark (EndLocation)) {\n\t\t\t\tec.Emit (OpCodes.Nop);\n\t\t\t}\n\t\t}\n\n\t\tprotected void DefineStoreyContainer (EmitContext ec, AnonymousMethodStorey storey)\n\t\t{\n\t\t\tif (ec.CurrentAnonymousMethod != null && ec.CurrentAnonymousMethod.Storey != null) {\n\t\t\t\tstorey.SetNestedStoryParent (ec.CurrentAnonymousMethod.Storey);\n\t\t\t\tstorey.Mutator = ec.CurrentAnonymousMethod.Storey.Mutator;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Creates anonymous method storey\n\t\t\t//\n\t\t\tstorey.CreateContainer ();\n\t\t\tstorey.DefineContainer ();\n\n\t\t\tif (Original.Explicit.HasCapturedThis && Original.ParametersBlock.TopBlock.ThisReferencesFromChildrenBlock != null) {\n\n\t\t\t\t//\n\t\t\t\t// Only first storey in path will hold this reference. All children blocks will\n\t\t\t\t// reference it indirectly using $ref field\n\t\t\t\t//\n\t\t\t\tfor (Block b = Original.Explicit; b != null; b = b.Parent) {\n\t\t\t\t\tif (b.Parent != null) {\n\t\t\t\t\t\tvar s = b.Parent.Explicit.AnonymousMethodStorey;\n\t\t\t\t\t\tif (s != null) {\n\t\t\t\t\t\t\tstorey.HoistedThis = s.HoistedThis;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (b.Explicit == b.Explicit.ParametersBlock && b.Explicit.ParametersBlock.StateMachine != null) {\n\t\t\t\t\t\tif (storey.HoistedThis == null)\n\t\t\t\t\t\t\tstorey.HoistedThis = b.Explicit.ParametersBlock.StateMachine.HoistedThis;\n\n\t\t\t\t\t\tif (storey.HoistedThis != null)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// We are the first storey on path and 'this' has to be hoisted\n\t\t\t\t//\n\t\t\t\tif (storey.HoistedThis == null) {\n\t\t\t\t\tforeach (ExplicitBlock ref_block in Original.ParametersBlock.TopBlock.ThisReferencesFromChildrenBlock) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// ThisReferencesFromChildrenBlock holds all reference even if they\n\t\t\t\t\t\t// are not on this path. It saves some memory otherwise it'd have to\n\t\t\t\t\t\t// be in every explicit block. We run this check to see if the reference\n\t\t\t\t\t\t// is valid for this storey\n\t\t\t\t\t\t//\n\t\t\t\t\t\tBlock block_on_path = ref_block;\n\t\t\t\t\t\tfor (; block_on_path != null && block_on_path != Original; block_on_path = block_on_path.Parent);\n\n\t\t\t\t\t\tif (block_on_path == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (storey.HoistedThis == null) {\n\t\t\t\t\t\t\tstorey.AddCapturedThisField (ec, null);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (ExplicitBlock b = ref_block; b.AnonymousMethodStorey != storey; b = b.Parent.Explicit) {\n\t\t\t\t\t\t\tParametersBlock pb;\n\t\t\t\t\t\t\tAnonymousMethodStorey b_storey = b.AnonymousMethodStorey;\n\n\t\t\t\t\t\t\tif (b_storey != null) {\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t// Don't add storey cross reference for `this' when the storey ends up not\n\t\t\t\t\t\t\t\t// beeing attached to any parent\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\tif (b.ParametersBlock.StateMachine == null) {\n\t\t\t\t\t\t\t\t\tAnonymousMethodStorey s = null;\n\t\t\t\t\t\t\t\t\tfor (Block ab = b.AnonymousMethodStorey.OriginalSourceBlock.Parent; ab != null; ab = ab.Parent) {\n\t\t\t\t\t\t\t\t\t\ts = ab.Explicit.AnonymousMethodStorey;\n\t\t\t\t\t\t\t\t\t\tif (s != null)\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Needs to be in sync with AnonymousMethodBody::DoCreateMethodHost\n\t\t\t\t\t\t\t\t\tif (s == null) {\n\t\t\t\t\t\t\t\t\t\tvar parent = storey == null || storey.Kind == MemberKind.Struct ? null : storey;\n\t\t\t\t\t\t\t\t\t\tb.AnonymousMethodStorey.AddCapturedThisField (ec, parent);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t// Stop propagation inside same top block\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\tif (b.ParametersBlock == ParametersBlock.Original) {\n\t\t\t\t\t\t\t\t\tb_storey.AddParentStoreyReference (ec, storey);\n//\t\t\t\t\t\t\t\t\tb_storey.HoistedThis = storey.HoistedThis;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tb = pb = b.ParametersBlock;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpb = b as ParametersBlock;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (pb != null && pb.StateMachine != null) {\n\t\t\t\t\t\t\t\tif (pb.StateMachine == storey)\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t// If we are state machine with no parent. We can hook into parent without additional\n \t\t\t\t\t\t\t\t// reference and capture this directly\n\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\tExplicitBlock parent_storey_block = pb;\n\t\t\t\t\t\t\t\twhile (parent_storey_block.Parent != null) {\n\t\t\t\t\t\t\t\t\tparent_storey_block = parent_storey_block.Parent.Explicit;\n\t\t\t\t\t\t\t\t\tif (parent_storey_block.AnonymousMethodStorey != null) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (parent_storey_block.AnonymousMethodStorey == null) {\n\t\t\t\t\t\t\t\t\tpb.StateMachine.AddCapturedThisField (ec, null);\n\t\t\t\t\t\t\t\t\tb.HasCapturedThis = true;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tpb.StateMachine.AddParentStoreyReference (ec, storey);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Add parent storey reference only when this is not captured directly\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tif (b_storey != null) {\n\t\t\t\t\t\t\t\tb_storey.AddParentStoreyReference (ec, storey);\n\t\t\t\t\t\t\t\tb_storey.HoistedThis = storey.HoistedThis;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar ref_blocks = storey.ReferencesFromChildrenBlock;\n\t\t\tif (ref_blocks != null) {\n\t\t\t\tforeach (ExplicitBlock ref_block in ref_blocks) {\n\t\t\t\t\tfor (ExplicitBlock b = ref_block; b.AnonymousMethodStorey != storey; b = b.Parent.Explicit) {\n\t\t\t\t\t\tif (b.AnonymousMethodStorey != null) {\n\t\t\t\t\t\t\tb.AnonymousMethodStorey.AddParentStoreyReference (ec, storey);\n\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Stop propagation inside same top block\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tif (b.ParametersBlock == ParametersBlock.Original)\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tb = b.ParametersBlock;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar pb = b as ParametersBlock;\n\t\t\t\t\t\tif (pb != null && pb.StateMachine != null) {\n\t\t\t\t\t\t\tif (pb.StateMachine == storey)\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tpb.StateMachine.AddParentStoreyReference (ec, storey);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tb.HasCapturedVariable = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstorey.Define ();\n\t\t\tstorey.PrepareEmit ();\n\t\t\tstorey.Parent.PartialContainer.AddCompilerGeneratedClass (storey);\n\t\t}\n\n\t\tpublic void RegisterAsyncAwait ()\n\t\t{\n\t\t\tvar block = this;\n\t\t\twhile ((block.flags & Flags.AwaitBlock) == 0) {\n\t\t\t\tblock.flags |= Flags.AwaitBlock;\n\n\t\t\t\tif (block is ParametersBlock)\n\t\t\t\t\treturn;\n\n\t\t\t\tblock = block.Parent.Explicit;\n\t\t\t}\n\t\t}\n\n\t\tpublic void RegisterIteratorYield ()\n\t\t{\n\t\t\tParametersBlock.TopBlock.IsIterator = true;\n\n\t\t\tvar block = this;\n\t\t\twhile ((block.flags & Flags.YieldBlock) == 0) {\n\t\t\t\tblock.flags |= Flags.YieldBlock;\n\n\t\t\t\tif (block.Parent == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tblock = block.Parent.Explicit;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetCatchBlock ()\n\t\t{\n\t\t\tflags |= Flags.CatchBlock;\n\t\t}\n\n\t\tpublic void SetFinallyBlock ()\n\t\t{\n\t\t\tflags |= Flags.FinallyBlock;\n\t\t}\n\n\t\tpublic void WrapIntoDestructor (TryFinally tf, ExplicitBlock tryBlock)\n\t\t{\n\t\t\ttryBlock.statements = statements;\n\t\t\tstatements = new List<Statement> (1);\n\t\t\tstatements.Add (tf);\n\t\t}\n\t}\n\n\t//\n\t// ParametersBlock was introduced to support anonymous methods\n\t// and lambda expressions\n\t// \n\tpublic class ParametersBlock : ExplicitBlock\n\t{\n\t\tpublic class ParameterInfo : INamedBlockVariable\n\t\t{\n\t\t\treadonly ParametersBlock block;\n\t\t\treadonly int index;\n\t\t\tpublic VariableInfo VariableInfo;\n\t\t\tbool is_locked;\n\n\t\t\tpublic ParameterInfo (ParametersBlock block, int index)\n\t\t\t{\n\t\t\t\tthis.block = block;\n\t\t\t\tthis.index = index;\n\t\t\t}\n\n\t\t\t#region Properties\n\n\t\t\tpublic ParametersBlock Block {\n\t\t\t\tget {\n\t\t\t\t\treturn block;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tBlock INamedBlockVariable.Block {\n\t\t\t\tget {\n\t\t\t\t\treturn block;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsDeclared {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsParameter {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool IsLocked {\n\t\t\t\tget {\n\t\t\t\t\treturn is_locked;\n\t\t\t\t}\n\t\t\t\tset {\n\t\t\t\t\tis_locked = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Location Location {\n\t\t\t\tget {\n\t\t\t\t\treturn Parameter.Location;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Parameter Parameter {\n\t\t\t\tget {\n\t\t\t\t\treturn block.Parameters [index];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic TypeSpec ParameterType {\n\t\t\t\tget {\n\t\t\t\t\treturn Parameter.Type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\tpublic Expression CreateReferenceExpression (ResolveContext rc, Location loc)\n\t\t\t{\n\t\t\t\treturn new ParameterReference (this, loc);\n\t\t\t}\n\t\t}\n\n\t\t// \n\t\t// Block is converted into an expression\n\t\t//\n\t\tsealed class BlockScopeExpression : Expression\n\t\t{\n\t\t\tExpression child;\n\t\t\treadonly ParametersBlock block;\n\n\t\t\tpublic BlockScopeExpression (Expression child, ParametersBlock block)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t\tthis.block = block;\n\t\t\t}\n\n\t\t\tpublic override bool ContainsEmitWithAwait ()\n\t\t\t{\n\t\t\t\treturn child.ContainsEmitWithAwait ();\n\t\t\t}\n\n\t\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext ec)\n\t\t\t{\n\t\t\t\tif (child == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tchild = child.Resolve (ec);\n\t\t\t\tif (child == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\teclass = child.eclass;\n\t\t\t\ttype = child.Type;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tblock.EmitScopeInitializers (ec);\n\t\t\t\tchild.Emit (ec);\n\t\t\t}\n\t\t}\n\n\t\tprotected ParametersCompiled parameters;\n\t\tprotected ParameterInfo[] parameter_info;\n\t\tprotected bool resolved;\n\t\tprotected ToplevelBlock top_block;\n\t\tprotected StateMachine state_machine;\n\t\tprotected Dictionary<string, object> labels;\n\n\t\tpublic ParametersBlock (Block parent, ParametersCompiled parameters, Location start, Flags flags = 0)\n\t\t\t: base (parent, 0, start, start)\n\t\t{\n\t\t\tif (parameters == null)\n\t\t\t\tthrow new ArgumentNullException (\"parameters\");\n\n\t\t\tthis.parameters = parameters;\n\t\t\tParametersBlock = this;\n\n\t\t\tthis.flags |= flags | (parent.ParametersBlock.flags & (Flags.YieldBlock | Flags.AwaitBlock));\n\n\t\t\tthis.top_block = parent.ParametersBlock.top_block;\n\t\t\tProcessParameters ();\n\t\t}\n\n\t\tprotected ParametersBlock (ParametersCompiled parameters, Location start)\n\t\t\t: base (null, 0, start, start)\n\t\t{\n\t\t\tif (parameters == null)\n\t\t\t\tthrow new ArgumentNullException (\"parameters\");\n\n\t\t\tthis.parameters = parameters;\n\t\t\tParametersBlock = this;\n\t\t}\n\n\t\t//\n\t\t// It's supposed to be used by method body implementation of anonymous methods\n\t\t//\n\t\tprotected ParametersBlock (ParametersBlock source, ParametersCompiled parameters)\n\t\t\t: base (null, 0, source.StartLocation, source.EndLocation)\n\t\t{\n\t\t\tthis.parameters = parameters;\n\t\t\tthis.statements = source.statements;\n\t\t\tthis.scope_initializers = source.scope_initializers;\n\n\t\t\tthis.resolved = true;\n\t\t\tthis.reachable = source.reachable;\n\t\t\tthis.am_storey = source.am_storey;\n\t\t\tthis.state_machine = source.state_machine;\n\t\t\tthis.flags = source.flags & Flags.ReachableEnd;\n\n\t\t\tParametersBlock = this;\n\n\t\t\t//\n\t\t\t// Overwrite original for comparison purposes when linking cross references\n\t\t\t// between anonymous methods\n\t\t\t//\n\t\t\tOriginal = source.Original;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic bool IsAsync {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.HasAsyncModifier) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tflags = value ? flags | Flags.HasAsyncModifier : flags & ~Flags.HasAsyncModifier;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Block has been converted to expression tree\n\t\t//\n\t\tpublic bool IsExpressionTree {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.IsExpressionTree) != 0;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// The parameters for the block.\n\t\t//\n\t\tpublic ParametersCompiled Parameters {\n\t\t\tget {\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic StateMachine StateMachine {\n\t\t\tget {\n\t\t\t\treturn state_machine;\n\t\t\t}\n\t\t}\n\n\t\tpublic ToplevelBlock TopBlock {\n\t\t\tget {\n\t\t\t\treturn top_block;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttop_block = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Resolved {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.Resolved) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic int TemporaryLocalsCount { get; set; }\n\n\t\t#endregion\n\n\t\t//\n\t\t// Checks whether all `out' parameters have been assigned.\n\t\t//\n\t\tpublic void CheckControlExit (FlowAnalysisContext fc)\n\t\t{\n\t\t\tCheckControlExit (fc, fc.DefiniteAssignment);\n\t\t}\n\n\t\tpublic virtual void CheckControlExit (FlowAnalysisContext fc, DefiniteAssignmentBitSet dat)\n\t\t{\n\t\t\tif (parameter_info == null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var p in parameter_info) {\n\t\t\t\tif (p.VariableInfo == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (p.VariableInfo.IsAssigned (dat))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfc.Report.Error (177, p.Location,\n\t\t\t\t\t\"The out parameter `{0}' must be assigned to before control leaves the current method\",\n\t\t\t\t\tp.Parameter.Name);\n\t\t\t}\t\t\t\t\t\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tbase.CloneTo (clonectx, t);\n\n\t\t\tvar target = (ParametersBlock) t;\n\n\t\t\t//\n\t\t\t// Clone label statements as well as they contain block reference\n\t\t\t//\n\t\t\tvar pb = this;\n\t\t\twhile (true) {\n\t\t\t\tif (pb.labels != null) {\n\t\t\t\t\ttarget.labels = new Dictionary<string, object> ();\n\n\t\t\t\t\tforeach (var entry in pb.labels) {\n\t\t\t\t\t\tvar list = entry.Value as List<LabeledStatement>;\n\n\t\t\t\t\t\tif (list != null) {\n\t\t\t\t\t\t\tvar list_clone = new List<LabeledStatement> ();\n\t\t\t\t\t\t\tforeach (var lentry in list) {\n\t\t\t\t\t\t\t\tlist_clone.Add (RemapLabeledStatement (lentry, lentry.Block, clonectx.RemapBlockCopy (lentry.Block)));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttarget.labels.Add (entry.Key, list_clone);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar labeled = (LabeledStatement) entry.Value;\n\t\t\t\t\t\t\ttarget.labels.Add (entry.Key, RemapLabeledStatement (labeled, labeled.Block, clonectx.RemapBlockCopy (labeled.Block)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (pb.Parent == null)\n\t\t\t\t\tbreak;\n\n\t\t\t\tpb = pb.Parent.ParametersBlock;\n\t\t\t}\n\t\t}\n\n\t\tpublic override Expression CreateExpressionTree (ResolveContext ec)\n\t\t{\n\t\t\tif (statements.Count == 1) {\n\t\t\t\tExpression expr = statements[0].CreateExpressionTree (ec);\n\t\t\t\tif (scope_initializers != null)\n\t\t\t\t\texpr = new BlockScopeExpression (expr, this);\n\n\t\t\t\treturn expr;\n\t\t\t}\n\n\t\t\treturn base.CreateExpressionTree (ec);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (state_machine != null && state_machine.OriginalSourceBlock != this) {\n\t\t\t\tDefineStoreyContainer (ec, state_machine);\n\t\t\t\tstate_machine.EmitStoreyInstantiation (ec, this);\n\t\t\t}\n\n\t\t\tbase.Emit (ec);\n\t\t}\n\n\t\tpublic void EmitEmbedded (EmitContext ec)\n\t\t{\n\t\t\tif (state_machine != null && state_machine.OriginalSourceBlock != this) {\n\t\t\t\tDefineStoreyContainer (ec, state_machine);\n\t\t\t\tstate_machine.EmitStoreyInstantiation (ec, this);\n\t\t\t}\n\n\t\t\tbase.Emit (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tvar res = base.DoFlowAnalysis (fc);\n\n\t\t\tif (HasReachableClosingBrace)\n\t\t\t\tCheckControlExit (fc);\n\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic LabeledStatement GetLabel (string name, Block block)\n\t\t{\n\t\t\t//\n\t\t\t// Cloned parameters blocks can have their own cloned version of top-level labels\n\t\t\t//\n\t\t\tif (labels == null) {\n\t\t\t\tif (Parent != null)\n\t\t\t\t\treturn Parent.ParametersBlock.GetLabel (name, block);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tobject value;\n\t\t\tif (!labels.TryGetValue (name, out value)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar label = value as LabeledStatement;\n\t\t\tBlock b = block;\n\t\t\tif (label != null) {\n\t\t\t\tif (IsLabelVisible (label, b))\n\t\t\t\t\treturn label;\n\n\t\t\t} else {\n\t\t\t\tList<LabeledStatement> list = (List<LabeledStatement>) value;\n\t\t\t\tfor (int i = 0; i < list.Count; ++i) {\n\t\t\t\t\tlabel = list[i];\n\t\t\t\t\tif (IsLabelVisible (label, b))\n\t\t\t\t\t\treturn label;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic bool IsLabelVisible (LabeledStatement label, Block b)\n\t\t{\n\t\t\tdo {\n\t\t\t\tif (label.Block == b)\n\t\t\t\t\treturn true;\n\t\t\t\tb = b.Parent;\n\t\t\t} while (b != null);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic ParameterInfo GetParameterInfo (Parameter p)\n\t\t{\n\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\tif (parameters[i] == p)\n\t\t\t\t\treturn parameter_info[i];\n\t\t\t}\n\n\t\t\tthrow new ArgumentException (\"Invalid parameter\");\n\t\t}\n\n\t\tpublic ParameterReference GetParameterReference (int index, Location loc)\n\t\t{\n\t\t\treturn new ParameterReference (parameter_info[index], loc);\n\t\t}\n\n\t\tpublic Statement PerformClone ()\n\t\t{\n\t\t\tCloneContext clonectx = new CloneContext ();\n\t\t\treturn Clone (clonectx);\n\t\t}\n\n\t\tprotected void ProcessParameters ()\n\t\t{\n\t\t\tif (parameters.Count == 0)\n\t\t\t\treturn;\n\n\t\t\tparameter_info = new ParameterInfo[parameters.Count];\n\t\t\tfor (int i = 0; i < parameter_info.Length; ++i) {\n\t\t\t\tvar p = parameters.FixedParameters[i];\n\t\t\t\tif (p == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// TODO: Should use Parameter only and more block there\n\t\t\t\tparameter_info[i] = new ParameterInfo (this, i);\n\t\t\t\tif (p.Name != null)\n\t\t\t\t\tAddLocalName (p.Name, parameter_info[i]);\n\t\t\t}\n\t\t}\n\n\t\tstatic LabeledStatement RemapLabeledStatement (LabeledStatement stmt, Block src, Block dst)\n\t\t{\n\t\t\tvar src_stmts = src.Statements;\n\t\t\tfor (int i = 0; i < src_stmts.Count; ++i) {\n\t\t\t\tif (src_stmts[i] == stmt)\n\t\t\t\t\treturn (LabeledStatement) dst.Statements[i];\n\t\t\t}\n\n\t\t\tthrow new InternalErrorException (\"Should never be reached\");\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\t// TODO: if ((flags & Flags.Resolved) != 0)\n\n\t\t\tif (resolved)\n\t\t\t\treturn true;\n\n\t\t\tresolved = true;\n\n\t\t\tif (bc.HasSet (ResolveContext.Options.ExpressionTreeConversion))\n\t\t\t\tflags |= Flags.IsExpressionTree;\n\n\t\t\ttry {\n\t\t\t\tPrepareAssignmentAnalysis (bc);\n\n\t\t\t\tif (!base.Resolve (bc))\n\t\t\t\t\treturn false;\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tif (e is CompletionResult || bc.Report.IsDisabled || e is FatalException || bc.Report.Printer is NullReportPrinter || bc.Module.Compiler.Settings.BreakOnInternalError)\n\t\t\t\t\tthrow;\n\n\t\t\t\tif (bc.CurrentBlock != null) {\n\t\t\t\t\tbc.Report.Error (584, bc.CurrentBlock.StartLocation, \"Internal compiler error: {0}\", e.Message);\n\t\t\t\t} else {\n\t\t\t\t\tbc.Report.Error (587, \"Internal compiler error: {0}\", e.Message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// If an asynchronous body of F is either an expression classified as nothing, or a \n\t\t\t// statement block where no return statements have expressions, the inferred return type is Task\n\t\t\t//\n\t\t\tif (IsAsync) {\n\t\t\t\tvar am = bc.CurrentAnonymousMethod as AnonymousMethodBody;\n\t\t\t\tif (am != null && am.ReturnTypeInference != null && !am.ReturnTypeInference.HasBounds (0)) {\n\t\t\t\t\tam.ReturnTypeInference = null;\n\t\t\t\t\tam.ReturnType = bc.Module.PredefinedTypes.Task.TypeSpec;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid PrepareAssignmentAnalysis (BlockContext bc)\n\t\t{\n\t\t\tfor (int i = 0; i < parameters.Count; ++i) {\n\t\t\t\tvar par = parameters.FixedParameters[i];\n\n\t\t\t\tif ((par.ModFlags & Parameter.Modifier.OUT) == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tparameter_info [i].VariableInfo = VariableInfo.Create (bc, (Parameter) par);\n\t\t\t}\n\t\t}\n\n\t\tpublic ToplevelBlock ConvertToIterator (IMethodData method, TypeDefinition host, TypeSpec iterator_type, bool is_enumerable)\n\t\t{\n\t\t\tvar iterator = new Iterator (this, method, host, iterator_type, is_enumerable);\n\t\t\tvar stateMachine = new IteratorStorey (iterator);\n\n\t\t\tstate_machine = stateMachine;\n\t\t\titerator.SetStateMachine (stateMachine);\n\n\t\t\tvar tlb = new ToplevelBlock (host.Compiler, Parameters, Location.Null, Flags.CompilerGenerated);\n\t\t\ttlb.Original = this;\n\t\t\ttlb.state_machine = stateMachine;\n\t\t\ttlb.AddStatement (new Return (iterator, iterator.Location));\n\t\t\treturn tlb;\n\t\t}\n\n\t\tpublic ParametersBlock ConvertToAsyncTask (IMemberContext context, TypeDefinition host, ParametersCompiled parameters, TypeSpec returnType, TypeSpec delegateType, Location loc)\n\t\t{\n\t\t\tfor (int i = 0; i < parameters.Count; i++) {\n\t\t\t\tParameter p = parameters[i];\n\t\t\t\tParameter.Modifier mod = p.ModFlags;\n\t\t\t\tif ((mod & Parameter.Modifier.RefOutMask) != 0) {\n\t\t\t\t\thost.Compiler.Report.Error (1988, p.Location,\n\t\t\t\t\t\t\"Async methods cannot have ref or out parameters\");\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t\tif (p is ArglistParameter) {\n\t\t\t\t\thost.Compiler.Report.Error (4006, p.Location,\n\t\t\t\t\t\t\"__arglist is not allowed in parameter list of async methods\");\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t\tif (parameters.Types[i].IsPointer) {\n\t\t\t\t\thost.Compiler.Report.Error (4005, p.Location,\n\t\t\t\t\t\t\"Async methods cannot have unsafe parameters\");\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!HasAwait) {\n\t\t\t\thost.Compiler.Report.Warning (1998, 1, loc,\n\t\t\t\t\t\"Async block lacks `await' operator and will run synchronously\");\n\t\t\t}\n\n\t\t\tvar block_type = host.Module.Compiler.BuiltinTypes.Void;\n\t\t\tvar initializer = new AsyncInitializer (this, host, block_type);\n\t\t\tinitializer.Type = block_type;\n\t\t\tinitializer.DelegateType = delegateType;\n\n\t\t\tvar stateMachine = new AsyncTaskStorey (this, context, initializer, returnType);\n\n\t\t\tstate_machine = stateMachine;\n\t\t\tinitializer.SetStateMachine (stateMachine);\n\n\t\t\tconst Flags flags = Flags.CompilerGenerated;\n\n\t\t\tvar b = this is ToplevelBlock ?\n\t\t\t\tnew ToplevelBlock (host.Compiler, Parameters, Location.Null, flags) :\n\t\t\t\tnew ParametersBlock (Parent, parameters, Location.Null, flags | Flags.HasAsyncModifier);\n\n\t\t\tb.Original = this;\n\t\t\tb.state_machine = stateMachine;\n\t\t\tb.AddStatement (new AsyncInitializerStatement (initializer));\n\t\t\treturn b;\n\t\t}\n\t}\n\n\t//\n\t//\n\t//\n\tpublic class ToplevelBlock : ParametersBlock\n\t{\n\t\tLocalVariable this_variable;\n\t\tCompilerContext compiler;\n\t\tDictionary<string, object> names;\n\n\t\tList<ExplicitBlock> this_references;\n\n\t\tpublic ToplevelBlock (CompilerContext ctx, Location loc)\n\t\t\t: this (ctx, ParametersCompiled.EmptyReadOnlyParameters, loc)\n\t\t{\n\t\t}\n\n\t\tpublic ToplevelBlock (CompilerContext ctx, ParametersCompiled parameters, Location start, Flags flags = 0)\n\t\t\t: base (parameters, start)\n\t\t{\n\t\t\tthis.compiler = ctx;\n\t\t\tthis.flags = flags;\n\t\t\ttop_block = this;\n\n\t\t\tProcessParameters ();\n\t\t}\n\n\t\t//\n\t\t// Recreates a top level block from parameters block. Used for\n\t\t// compiler generated methods where the original block comes from\n\t\t// explicit child block. This works for already resolved blocks\n\t\t// only to ensure we resolve them in the correct flow order\n\t\t//\n\t\tpublic ToplevelBlock (ParametersBlock source, ParametersCompiled parameters)\n\t\t\t: base (source, parameters)\n\t\t{\n\t\t\tthis.compiler = source.TopBlock.compiler;\n\t\t\ttop_block = this;\n\t\t}\n\n\t\tpublic bool IsIterator {\n\t\t\tget {\n\t\t\t\treturn (flags & Flags.Iterator) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tflags = value ? flags | Flags.Iterator : flags & ~Flags.Iterator;\n\t\t\t}\n\t\t}\n\n\t\tpublic Report Report {\n\t\t\tget {\n\t\t\t\treturn compiler.Report;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Used by anonymous blocks to track references of `this' variable\n\t\t//\n\t\tpublic List<ExplicitBlock> ThisReferencesFromChildrenBlock {\n\t\t\tget {\n\t\t\t\treturn this_references;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns the \"this\" instance variable of this block.\n\t\t// See AddThisVariable() for more information.\n\t\t//\n\t\tpublic LocalVariable ThisVariable {\n\t\t\tget {\n\t\t\t\treturn this_variable;\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddLocalName (string name, INamedBlockVariable li, bool ignoreChildrenBlocks)\n\t\t{\n\t\t\tif (names == null)\n\t\t\t\tnames = new Dictionary<string, object> ();\n\n\t\t\tobject value;\n\t\t\tif (!names.TryGetValue (name, out value)) {\n\t\t\t\tnames.Add (name, li);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tINamedBlockVariable existing = value as INamedBlockVariable;\n\t\t\tList<INamedBlockVariable> existing_list;\n\t\t\tif (existing != null) {\n\t\t\t\texisting_list = new List<INamedBlockVariable> ();\n\t\t\t\texisting_list.Add (existing);\n\t\t\t\tnames[name] = existing_list;\n\t\t\t} else {\n\t\t\t\texisting_list = (List<INamedBlockVariable>) value;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// A collision checking between local names\n\t\t\t//\n\t\t\tvar variable_block = li.Block.Explicit;\n\t\t\tfor (int i = 0; i < existing_list.Count; ++i) {\n\t\t\t\texisting = existing_list[i];\n\t\t\t\tBlock b = existing.Block.Explicit;\n\n\t\t\t\t// Collision at same level\n\t\t\t\tif (variable_block == b) {\n\t\t\t\t\tli.Block.Error_AlreadyDeclared (name, li);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Collision with parent\n\t\t\t\tBlock parent = variable_block;\n\t\t\t\twhile ((parent = parent.Parent) != null) {\n\t\t\t\t\tif (parent == b) {\n\t\t\t\t\t\tli.Block.Error_AlreadyDeclared (name, li, \"parent or current\");\n\t\t\t\t\t\ti = existing_list.Count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!ignoreChildrenBlocks && variable_block.Parent != b.Parent) {\n\t\t\t\t\t// Collision with children\n\t\t\t\t\twhile ((b = b.Parent) != null) {\n\t\t\t\t\t\tif (variable_block == b) {\n\t\t\t\t\t\t\tli.Block.Error_AlreadyDeclared (name, li, \"child\");\n\t\t\t\t\t\t\ti = existing_list.Count;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texisting_list.Add (li);\n\t\t}\n\n\t\tpublic void AddLabel (string name, LabeledStatement label)\n\t\t{\n\t\t\tif (labels == null)\n\t\t\t\tlabels = new Dictionary<string, object> ();\n\n\t\t\tobject value;\n\t\t\tif (!labels.TryGetValue (name, out value)) {\n\t\t\t\tlabels.Add (name, label);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tLabeledStatement existing = value as LabeledStatement;\n\t\t\tList<LabeledStatement> existing_list;\n\t\t\tif (existing != null) {\n\t\t\t\texisting_list = new List<LabeledStatement> ();\n\t\t\t\texisting_list.Add (existing);\n\t\t\t\tlabels[name] = existing_list;\n\t\t\t} else {\n\t\t\t\texisting_list = (List<LabeledStatement>) value;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// A collision checking between labels\n\t\t\t//\n\t\t\tfor (int i = 0; i < existing_list.Count; ++i) {\n\t\t\t\texisting = existing_list[i];\n\t\t\t\tBlock b = existing.Block;\n\n\t\t\t\t// Collision at same level\n\t\t\t\tif (label.Block == b) {\n\t\t\t\t\tReport.SymbolRelatedToPreviousError (existing.loc, name);\n\t\t\t\t\tReport.Error (140, label.loc, \"The label `{0}' is a duplicate\", name);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Collision with parent\n\t\t\t\tb = label.Block;\n\t\t\t\twhile ((b = b.Parent) != null) {\n\t\t\t\t\tif (existing.Block == b) {\n\t\t\t\t\t\tReport.Error (158, label.loc,\n\t\t\t\t\t\t\t\"The label `{0}' shadows another label by the same name in a contained scope\", name);\n\t\t\t\t\t\ti = existing_list.Count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Collision with with children\n\t\t\t\tb = existing.Block;\n\t\t\t\twhile ((b = b.Parent) != null) {\n\t\t\t\t\tif (label.Block == b) {\n\t\t\t\t\t\tReport.Error (158, label.loc,\n\t\t\t\t\t\t\t\"The label `{0}' shadows another label by the same name in a contained scope\", name);\n\t\t\t\t\t\ti = existing_list.Count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texisting_list.Add (label);\n\t\t}\n\n\t\tpublic void AddThisReferenceFromChildrenBlock (ExplicitBlock block)\n\t\t{\n\t\t\tif (this_references == null)\n\t\t\t\tthis_references = new List<ExplicitBlock> ();\n\n\t\t\tif (!this_references.Contains (block))\n\t\t\t\tthis_references.Add (block);\n\t\t}\n\n\t\tpublic void RemoveThisReferenceFromChildrenBlock (ExplicitBlock block)\n\t\t{\n\t\t\tthis_references.Remove (block);\n\t\t}\n\n\t\t//\n\t\t// Creates an arguments set from all parameters, useful for method proxy calls\n\t\t//\n\t\tpublic Arguments GetAllParametersArguments ()\n\t\t{\n\t\t\tint count = parameters.Count;\n\t\t\tArguments args = new Arguments (count);\n\t\t\tfor (int i = 0; i < count; ++i) {\n\t\t\t\tvar pi = parameter_info[i];\n\t\t\t\tvar arg_expr = GetParameterReference (i, pi.Location);\n\n\t\t\t\tArgument.AType atype_modifier;\n\t\t\t\tswitch (pi.Parameter.ParameterModifier & Parameter.Modifier.RefOutMask) {\n\t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\tatype_modifier = Argument.AType.Ref;\n\t\t\t\t\tbreak;\n\t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\tatype_modifier = Argument.AType.Out;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tatype_modifier = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\targs.Add (new Argument (arg_expr, atype_modifier));\n\t\t\t}\n\n\t\t\treturn args;\n\t\t}\n\n\t\t//\n\t\t// Lookup inside a block, the returned value can represent 3 states\n\t\t//\n\t\t// true+variable: A local name was found and it's valid\n\t\t// false+variable: A local name was found in a child block only\n\t\t// false+null: No local name was found\n\t\t//\n\t\tpublic bool GetLocalName (string name, Block block, ref INamedBlockVariable variable)\n\t\t{\n\t\t\tif (names == null)\n\t\t\t\treturn false;\n\n\t\t\tobject value;\n\t\t\tif (!names.TryGetValue (name, out value))\n\t\t\t\treturn false;\n\n\t\t\tvariable = value as INamedBlockVariable;\n\t\t\tBlock b = block;\n\t\t\tif (variable != null) {\n\t\t\t\tdo {\n\t\t\t\t\tif (variable.Block == b.Original)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tb = b.Parent;\n\t\t\t\t} while (b != null);\n\n\t\t\t\tb = variable.Block;\n\t\t\t\tdo {\n\t\t\t\t\tif (block == b)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tb = b.Parent;\n\t\t\t\t} while (b != null);\n\t\t\t} else {\n\t\t\t\tList<INamedBlockVariable> list = (List<INamedBlockVariable>) value;\n\t\t\t\tfor (int i = 0; i < list.Count; ++i) {\n\t\t\t\t\tvariable = list[i];\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (variable.Block == b.Original)\n\t\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t\tb = b.Parent;\n\t\t\t\t\t} while (b != null);\n\n\t\t\t\t\tb = variable.Block;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (block == b)\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tb = b.Parent;\n\t\t\t\t\t} while (b != null);\n\n\t\t\t\t\tb = block;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvariable = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void IncludeBlock (ParametersBlock pb, ToplevelBlock block)\n\t\t{\n\t\t\tif (block.names != null) {\n\t\t\t\tforeach (var n in block.names) {\n\t\t\t\t\tvar variable = n.Value as INamedBlockVariable;\n\t\t\t\t\tif (variable != null) {\n\t\t\t\t\t\tif (variable.Block.ParametersBlock == pb)\n\t\t\t\t\t\t\tAddLocalName (n.Key, variable, false);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (var v in (List<INamedBlockVariable>) n.Value)\n\t\t\t\t\t\tif (v.Block.ParametersBlock == pb)\n\t\t\t\t\t\t\tAddLocalName (n.Key, v, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// <summary>\n\t\t//   This is used by non-static `struct' constructors which do not have an\n\t\t//   initializer - in this case, the constructor must initialize all of the\n\t\t//   struct's fields.  To do this, we add a \"this\" variable and use the flow\n\t\t//   analysis code to ensure that it's been fully initialized before control\n\t\t//   leaves the constructor.\n\t\t// </summary>\n\t\tpublic void AddThisVariable (BlockContext bc)\n\t\t{\n\t\t\tif (this_variable != null)\n\t\t\t\tthrow new InternalErrorException (StartLocation.ToString ());\n\n\t\t\tthis_variable = new LocalVariable (this, \"this\", LocalVariable.Flags.IsThis | LocalVariable.Flags.Used, StartLocation);\n\t\t\tthis_variable.Type = bc.CurrentType;\n\t\t\tthis_variable.PrepareAssignmentAnalysis (bc);\n\t\t}\n\n\t\tpublic override void CheckControlExit (FlowAnalysisContext fc, DefiniteAssignmentBitSet dat)\n\t\t{\n\t\t\t//\n\t\t\t// If we're a non-static struct constructor which doesn't have an\n\t\t\t// initializer, then we must initialize all of the struct's fields.\n\t\t\t//\n\t\t\tif (this_variable != null)\n\t\t\t\tthis_variable.IsThisAssigned (fc, this);\n\n\t\t\tbase.CheckControlExit (fc, dat);\n\t\t}\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\tif (Report.Errors > 0)\n\t\t\t\treturn;\n\n\t\t\ttry {\n\t\t\tif (IsCompilerGenerated) {\n\t\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\t\tbase.Emit (ec);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbase.Emit (ec);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// If `HasReturnLabel' is set, then we already emitted a\n\t\t\t// jump to the end of the method, so we must emit a `ret'\n\t\t\t// there.\n\t\t\t//\n\t\t\t// Unfortunately, System.Reflection.Emit automatically emits\n\t\t\t// a leave to the end of a finally block.  This is a problem\n\t\t\t// if no code is following the try/finally block since we may\n\t\t\t// jump to a point after the end of the method.\n\t\t\t// As a workaround, we're always creating a return label in\n\t\t\t// this case.\n\t\t\t//\n\t\t\tif (ec.HasReturnLabel || HasReachableClosingBrace) {\n\t\t\t\tif (ec.HasReturnLabel)\n\t\t\t\t\tec.MarkLabel (ec.ReturnLabel);\n\n\t\t\t\tif (ec.EmitAccurateDebugInfo && !IsCompilerGenerated)\n\t\t\t\t\tec.Mark (EndLocation);\n\n\t\t\t\tif (ec.ReturnType.Kind != MemberKind.Void)\n\t\t\t\t\tec.Emit (OpCodes.Ldloc, ec.TemporaryReturn ());\n\n\t\t\t\tec.Emit (OpCodes.Ret);\n\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (e, StartLocation);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Resolve (BlockContext bc, IMethodData md)\n\t\t{\n\t\t\tif (resolved)\n\t\t\t\treturn true;\n\n\t\t\tvar errors = bc.Report.Errors;\n\n\t\t\tbase.Resolve (bc);\n\n\t\t\tif (bc.Report.Errors > errors)\n\t\t\t\treturn false;\n\n\t\t\tMarkReachable (new Reachability ());\n\n\t\t\tif (HasReachableClosingBrace && bc.ReturnType.Kind != MemberKind.Void) {\n\t\t\t\t// TODO: var md = bc.CurrentMemberDefinition;\n\t\t\t\tbc.Report.Error (161, md.Location, \"`{0}': not all code paths return a value\", md.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif ((flags & Flags.NoFlowAnalysis) != 0)\n\t\t\t\treturn true;\n\n\t\t\tvar fc = new FlowAnalysisContext (bc.Module.Compiler, this, bc.AssignmentInfoOffset);\n\t\t\ttry {\n\t\t\t\tFlowAnalysis (fc);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (e, StartLocation);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tpublic class SwitchLabel : Statement\n\t{\n\t\tConstant converted;\n\t\tExpression label;\n\n\t\tLabel? il_label;\n\n\t\t//\n\t\t// if expr == null, then it is the default case.\n\t\t//\n\t\tpublic SwitchLabel (Expression expr, Location l)\n\t\t{\n\t\t\tlabel = expr;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic bool IsDefault {\n\t\t\tget {\n\t\t\t\treturn label == null;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Label {\n\t\t\tget {\n\t\t\t\treturn label;\n\t\t\t}\n\t\t}\n\n\t\tpublic Location Location {\n\t\t\tget {\n\t\t\t\treturn loc;\n\t\t\t}\n\t\t}\n\n\t\tpublic Constant Converted {\n\t\t\tget {\n\t\t\t\treturn converted;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tconverted = value; \n\t\t\t}\n\t\t}\n\n\t\tpublic bool SectionStart { get; set; }\n\n\t\tpublic Label GetILLabel (EmitContext ec)\n\t\t{\n\t\t\tif (il_label == null){\n\t\t\t\til_label = ec.DefineLabel ();\n\t\t\t}\n\n\t\t\treturn il_label.Value;\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tec.MarkLabel (GetILLabel (ec));\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (!SectionStart)\n\t\t\t\treturn false;\n\n\t\t\tfc.DefiniteAssignment = new DefiniteAssignmentBitSet (fc.SwitchInitialDefinitiveAssignment);\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tif (ResolveAndReduce (bc))\n\t\t\t\tbc.Switch.RegisterLabel (bc, this);\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Resolves the expression, reduces it to a literal if possible\n\t\t// and then converts it to the requested type.\n\t\t//\n\t\tbool ResolveAndReduce (BlockContext rc)\n\t\t{\n\t\t\tif (IsDefault)\n\t\t\t\treturn true;\n\n\t\t\tvar c = label.ResolveLabelConstant (rc);\n\t\t\tif (c == null)\n\t\t\t\treturn false;\n\n\t\t\tif (rc.Switch.IsNullable && c is NullLiteral) {\n\t\t\t\tconverted = c;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconverted = c.ImplicitConversionRequired (rc, rc.Switch.SwitchType);\n\t\t\treturn converted != null;\n\t\t}\n\n\t\tpublic void Error_AlreadyOccurs (ResolveContext ec, SwitchLabel collision_with)\n\t\t{\n\t\t\tec.Report.SymbolRelatedToPreviousError (collision_with.loc, null);\n\t\t\tec.Report.Error (152, loc, \"The label `{0}' already occurs in this switch statement\", GetSignatureForError ());\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t{\n\t\t\tvar t = (SwitchLabel) target;\n\t\t\tif (label != null)\n\t\t\t\tt.label = label.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\tstring label;\n\t\t\tif (converted == null)\n\t\t\t\tlabel = \"default\";\n\t\t\telse\n\t\t\t\tlabel = converted.GetValueAsLiteral ();\n\n\t\t\treturn string.Format (\"case {0}:\", label);\n\t\t}\n\t}\n\n\tpublic class Switch : LoopStatement\n\t{\n\t\t// structure used to hold blocks of keys while calculating table switch\n\t\tsealed class LabelsRange : IComparable<LabelsRange>\n\t\t{\n\t\t\tpublic readonly long min;\n\t\t\tpublic long max;\n\t\t\tpublic readonly List<long> label_values;\n\n\t\t\tpublic LabelsRange (long value)\n\t\t\t{\n\t\t\t\tmin = max = value;\n\t\t\t\tlabel_values = new List<long> ();\n\t\t\t\tlabel_values.Add (value);\n\t\t\t}\n\n\t\t\tpublic LabelsRange (long min, long max, ICollection<long> values)\n\t\t\t{\n\t\t\t\tthis.min = min;\n\t\t\t\tthis.max = max;\n\t\t\t\tthis.label_values = new List<long> (values);\n\t\t\t}\n\n\t\t\tpublic long Range {\n\t\t\t\tget {\n\t\t\t\t\treturn max - min + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool AddValue (long value)\n\t\t\t{\n\t\t\t\tvar gap = value - min + 1;\n\t\t\t\t// Ensure the range has > 50% occupancy\n\t\t\t\tif (gap > 2 * (label_values.Count + 1) || gap <= 0)\n\t\t\t\t\treturn false;\n\n\t\t\t\tmax = value;\n\t\t\t\tlabel_values.Add (value);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic int CompareTo (LabelsRange other)\n\t\t\t{\n\t\t\t\tint nLength = label_values.Count;\n\t\t\t\tint nLengthOther = other.label_values.Count;\n\t\t\t\tif (nLengthOther == nLength)\n\t\t\t\t\treturn (int) (other.min - min);\n\n\t\t\t\treturn nLength - nLengthOther;\n\t\t\t}\n\t\t}\n\n\t\tsealed class DispatchStatement : Statement\n\t\t{\n\t\t\treadonly Switch body;\n\n\t\t\tpublic DispatchStatement (Switch body)\n\t\t\t{\n\t\t\t\tthis.body = body;\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\tbody.EmitDispatch (ec);\n\t\t\t}\n\t\t}\n\n\t\tclass MissingBreak : Statement\n\t\t{\n\t\t\treadonly SwitchLabel label;\n\n\t\t\tpublic MissingBreak (SwitchLabel sl)\n\t\t\t{\n\t\t\t\tthis.label = sl;\n\t\t\t\tthis.loc = sl.loc;\n\t\t\t}\n\n\t\t\tpublic bool FallOut { get; set; }\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\tif (FallOut) {\n\t\t\t\t\tfc.Report.Error (8070, loc, \"Control cannot fall out of switch statement through final case label `{0}'\",\n\t\t\t\t\t\tlabel.GetSignatureForError ());\n\t\t\t\t} else {\n\t\t\t\t\tfc.Report.Error (163, loc, \"Control cannot fall through from one case label `{0}' to another\",\n\t\t\t\t\t\tlabel.GetSignatureForError ());\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Expr;\n\n\t\t//\n\t\t// Mapping of all labels to their SwitchLabels\n\t\t//\n\t\tDictionary<long, SwitchLabel> labels;\n\t\tDictionary<string, SwitchLabel> string_labels;\n\t\tList<SwitchLabel> case_labels;\n\n\t\tList<Tuple<GotoCase, Constant>> goto_cases;\n\t\tList<DefiniteAssignmentBitSet> end_reachable_das;\n\n\t\t/// <summary>\n\t\t///   The governing switch type\n\t\t/// </summary>\n\t\tpublic TypeSpec SwitchType;\n\n\t\tExpression new_expr;\n\n\t\tSwitchLabel case_null;\n\t\tSwitchLabel case_default;\n\n\t\tLabel defaultLabel, nullLabel;\n\t\tVariableReference value;\n\t\tExpressionStatement string_dictionary;\n\t\tFieldExpr switch_cache_field;\n\t\tExplicitBlock block;\n\t\tbool end_reachable;\n\n\t\t//\n\t\t// Nullable Types support\n\t\t//\n\t\tNullable.Unwrap unwrap;\n\n\t\tpublic Switch (Expression e, ExplicitBlock block, Location l)\n\t\t\t: base (block)\n\t\t{\n\t\t\tExpr = e;\n\t\t\tthis.block = block;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic SwitchLabel ActiveLabel { get; set; }\n\n\t\tpublic ExplicitBlock Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\t\t}\n\n\t\tpublic SwitchLabel DefaultLabel {\n\t\t\tget {\n\t\t\t\treturn case_default;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsNullable {\n\t\t\tget {\n\t\t\t\treturn unwrap != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic List<SwitchLabel> RegisteredLabels {\n\t\t\tget {\n\t\t\t\treturn case_labels;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Determines the governing type for a switch.  The returned\n\t\t// expression might be the expression from the switch, or an\n\t\t// expression that includes any potential conversions to\n\t\t//\n\t\tstatic Expression SwitchGoverningType (ResolveContext rc, Expression expr, bool unwrapExpr)\n\t\t{\n\t\t\tswitch (expr.Type.BuiltinType) {\n\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\tcase BuiltinTypeSpec.Type.String:\n\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\treturn expr;\n\t\t\t}\n\n\t\t\tif (expr.Type.IsEnum)\n\t\t\t\treturn expr;\n\n\t\t\t//\n\t\t\t// Try to find a *user* defined implicit conversion.\n\t\t\t//\n\t\t\t// If there is no implicit conversion, or if there are multiple\n\t\t\t// conversions, we have to report an error\n\t\t\t//\n\t\t\tExpression converted = null;\n\t\t\tforeach (TypeSpec tt in rc.Module.PredefinedTypes.SwitchUserTypes) {\n\n\t\t\t\tif (!unwrapExpr && tt.IsNullableType && expr.Type.IsNullableType)\n\t\t\t\t\tbreak;\n\n\t\t\t\tvar restr = Convert.UserConversionRestriction.ImplicitOnly |\n\t\t\t\t\tConvert.UserConversionRestriction.ProbingOnly;\n\n\t\t\t\tif (unwrapExpr)\n\t\t\t\t\trestr |= Convert.UserConversionRestriction.NullableSourceOnly;\n\n\t\t\t\tvar e = Convert.UserDefinedConversion (rc, expr, tt, restr, Location.Null);\n\t\t\t\tif (e == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t//\n\t\t\t\t// Ignore over-worked ImplicitUserConversions that do\n\t\t\t\t// an implicit conversion in addition to the user conversion.\n\t\t\t\t// \n\t\t\t\tvar uc = e as UserCast;\n\t\t\t\tif (uc == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (converted != null){\n//\t\t\t\t\trc.Report.ExtraInformation (loc, \"(Ambiguous implicit user defined conversion in previous \");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconverted = e;\n\t\t\t}\n\t\t\treturn converted;\n\t\t}\n\n\t\tpublic static TypeSpec[] CreateSwitchUserTypes (ModuleContainer module, TypeSpec nullable)\n\t\t{\n\t\t\tvar types = module.Compiler.BuiltinTypes;\n\n\t\t\t// LAMESPEC: For some reason it does not contain bool which looks like csc bug\n\t\t\tTypeSpec[] stypes = new[] {\n\t\t\t\ttypes.SByte,\n\t\t\t\ttypes.Byte,\n\t\t\t\ttypes.Short,\n\t\t\t\ttypes.UShort,\n\t\t\t\ttypes.Int,\n\t\t\t\ttypes.UInt,\n\t\t\t\ttypes.Long,\n\t\t\t\ttypes.ULong,\n\t\t\t\ttypes.Char,\n\t\t\t\ttypes.String\n\t\t\t};\n\n\t\t\tif (nullable != null) {\n\n\t\t\t\tArray.Resize (ref stypes, stypes.Length + 9);\n\n\t\t\t\tfor (int i = 0; i < 9; ++i) {\n\t\t\t\t\tstypes [10 + i] = nullable.MakeGenericType (module, new [] { stypes [i] });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn stypes;\n\t\t}\n\n\t\tpublic void RegisterLabel (BlockContext rc, SwitchLabel sl)\n\t\t{\n\t\t\tcase_labels.Add (sl);\n\n\t\t\tif (sl.IsDefault) {\n\t\t\t\tif (case_default != null) {\n\t\t\t\t\tsl.Error_AlreadyOccurs (rc, case_default);\n\t\t\t\t} else {\n\t\t\t\t\tcase_default = sl;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tif (string_labels != null) {\n\t\t\t\t\tstring string_value = sl.Converted.GetValue () as string;\n\t\t\t\t\tif (string_value == null)\n\t\t\t\t\t\tcase_null = sl;\n\t\t\t\t\telse\n\t\t\t\t\t\tstring_labels.Add (string_value, sl);\n\t\t\t\t} else {\n\t\t\t\t\tif (sl.Converted is NullLiteral) {\n\t\t\t\t\t\tcase_null = sl;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlabels.Add (sl.Converted.GetValueAsLong (), sl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (ArgumentException) {\n\t\t\t\tif (string_labels != null)\n\t\t\t\t\tsl.Error_AlreadyOccurs (rc, string_labels[(string) sl.Converted.GetValue ()]);\n\t\t\t\telse\n\t\t\t\t\tsl.Error_AlreadyOccurs (rc, labels[sl.Converted.GetValueAsLong ()]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//\n\t\t// This method emits code for a lookup-based switch statement (non-string)\n\t\t// Basically it groups the cases into blocks that are at least half full,\n\t\t// and then spits out individual lookup opcodes for each block.\n\t\t// It emits the longest blocks first, and short blocks are just\n\t\t// handled with direct compares.\n\t\t//\n\t\tvoid EmitTableSwitch (EmitContext ec, Expression val)\n\t\t{\n\t\t\tif (labels != null && labels.Count > 0) {\n\t\t\t\tList<LabelsRange> ranges;\n\t\t\t\tif (string_labels != null) {\n\t\t\t\t\t// We have done all hard work for string already\n\t\t\t\t\t// setup single range only\n\t\t\t\t\tranges = new List<LabelsRange> (1);\n\t\t\t\t\tranges.Add (new LabelsRange (0, labels.Count - 1, labels.Keys));\n\t\t\t\t} else {\n\t\t\t\t\tvar element_keys = new long[labels.Count];\n\t\t\t\t\tlabels.Keys.CopyTo (element_keys, 0);\n\t\t\t\t\tArray.Sort (element_keys);\n\n\t\t\t\t\t//\n\t\t\t\t\t// Build possible ranges of switch labes to reduce number\n\t\t\t\t\t// of comparisons\n\t\t\t\t\t//\n\t\t\t\t\tranges = new List<LabelsRange> (element_keys.Length);\n\t\t\t\t\tvar range = new LabelsRange (element_keys[0]);\n\t\t\t\t\tranges.Add (range);\n\t\t\t\t\tfor (int i = 1; i < element_keys.Length; ++i) {\n\t\t\t\t\t\tvar l = element_keys[i];\n\t\t\t\t\t\tif (range.AddValue (l))\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\trange = new LabelsRange (l);\n\t\t\t\t\t\tranges.Add (range);\n\t\t\t\t\t}\n\n\t\t\t\t\t// sort the blocks so we can tackle the largest ones first\n\t\t\t\t\tranges.Sort ();\n\t\t\t\t}\n\n\t\t\t\tLabel lbl_default = defaultLabel;\n\t\t\t\tTypeSpec compare_type = SwitchType.IsEnum ? EnumSpec.GetUnderlyingType (SwitchType) : SwitchType;\n\n\t\t\t\tfor (int range_index = ranges.Count - 1; range_index >= 0; --range_index) {\n\t\t\t\t\tLabelsRange kb = ranges[range_index];\n\t\t\t\t\tlbl_default = (range_index == 0) ? defaultLabel : ec.DefineLabel ();\n\n\t\t\t\t\t// Optimize small ranges using simple equality check\n\t\t\t\t\tif (kb.Range <= 2) {\n\t\t\t\t\t\tforeach (var key in kb.label_values) {\n\t\t\t\t\t\t\tSwitchLabel sl = labels[key];\n\t\t\t\t\t\t\tif (sl == case_default || sl == case_null)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (sl.Converted.IsZeroInteger) {\n\t\t\t\t\t\t\t\tval.EmitBranchable (ec, sl.GetILLabel (ec), false);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tval.Emit (ec);\n\t\t\t\t\t\t\t\tsl.Converted.Emit (ec);\n\t\t\t\t\t\t\t\tec.Emit (OpCodes.Beq, sl.GetILLabel (ec));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// TODO: if all the keys in the block are the same and there are\n\t\t\t\t\t\t//       no gaps/defaults then just use a range-check.\n\t\t\t\t\t\tif (compare_type.BuiltinType == BuiltinTypeSpec.Type.Long || compare_type.BuiltinType == BuiltinTypeSpec.Type.ULong) {\n\t\t\t\t\t\t\t// TODO: optimize constant/I4 cases\n\n\t\t\t\t\t\t\t// check block range (could be > 2^31)\n\t\t\t\t\t\t\tval.Emit (ec);\n\t\t\t\t\t\t\tec.EmitLong (kb.min);\n\t\t\t\t\t\t\tec.Emit (OpCodes.Blt, lbl_default);\n\n\t\t\t\t\t\t\tval.Emit (ec);\n\t\t\t\t\t\t\tec.EmitLong (kb.max);\n\t\t\t\t\t\t\tec.Emit (OpCodes.Bgt, lbl_default);\n\n\t\t\t\t\t\t\t// normalize range\n\t\t\t\t\t\t\tval.Emit (ec);\n\t\t\t\t\t\t\tif (kb.min != 0) {\n\t\t\t\t\t\t\t\tec.EmitLong (kb.min);\n\t\t\t\t\t\t\t\tec.Emit (OpCodes.Sub);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tec.Emit (OpCodes.Conv_I4);\t// assumes < 2^31 labels!\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// normalize range\n\t\t\t\t\t\t\tval.Emit (ec);\n\t\t\t\t\t\t\tint first = (int) kb.min;\n\t\t\t\t\t\t\tif (first > 0) {\n\t\t\t\t\t\t\t\tec.EmitInt (first);\n\t\t\t\t\t\t\t\tec.Emit (OpCodes.Sub);\n\t\t\t\t\t\t\t} else if (first < 0) {\n\t\t\t\t\t\t\t\tec.EmitInt (-first);\n\t\t\t\t\t\t\t\tec.Emit (OpCodes.Add);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// first, build the list of labels for the switch\n\t\t\t\t\t\tint iKey = 0;\n\t\t\t\t\t\tlong cJumps = kb.Range;\n\t\t\t\t\t\tLabel[] switch_labels = new Label[cJumps];\n\t\t\t\t\t\tfor (int iJump = 0; iJump < cJumps; iJump++) {\n\t\t\t\t\t\t\tvar key = kb.label_values[iKey];\n\t\t\t\t\t\t\tif (key == kb.min + iJump) {\n\t\t\t\t\t\t\t\tswitch_labels[iJump] = labels[key].GetILLabel (ec);\n\t\t\t\t\t\t\t\tiKey++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tswitch_labels[iJump] = lbl_default;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// emit the switch opcode\n\t\t\t\t\t\tec.Emit (OpCodes.Switch, switch_labels);\n\t\t\t\t\t}\n\n\t\t\t\t\t// mark the default for this block\n\t\t\t\t\tif (range_index != 0)\n\t\t\t\t\t\tec.MarkLabel (lbl_default);\n\t\t\t\t}\n\n\t\t\t\t// the last default just goes to the end\n\t\t\t\tif (ranges.Count > 0)\n\t\t\t\t\tec.Emit (OpCodes.Br, lbl_default);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic SwitchLabel FindLabel (Constant value)\n\t\t{\n\t\t\tSwitchLabel sl = null;\n\n\t\t\tif (string_labels != null) {\n\t\t\t\tstring s = value.GetValue () as string;\n\t\t\t\tif (s == null) {\n\t\t\t\t\tif (case_null != null)\n\t\t\t\t\t\tsl = case_null;\n\t\t\t\t\telse if (case_default != null)\n\t\t\t\t\t\tsl = case_default;\n\t\t\t\t} else {\n\t\t\t\t\tstring_labels.TryGetValue (s, out sl);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (value is NullLiteral) {\n\t\t\t\t\tsl = case_null;\n\t\t\t\t} else {\n\t\t\t\t\tlabels.TryGetValue (value.GetValueAsLong (), out sl);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn sl;\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tExpr.FlowAnalysis (fc);\n\n\t\t\tvar prev_switch = fc.SwitchInitialDefinitiveAssignment;\n\t\t\tvar InitialDefinitiveAssignment = fc.DefiniteAssignment;\n\t\t\tfc.SwitchInitialDefinitiveAssignment = InitialDefinitiveAssignment;\n\n\t\t\tblock.FlowAnalysis (fc);\n\n\t\t\tfc.SwitchInitialDefinitiveAssignment = prev_switch;\n\n\t\t\tif (end_reachable_das != null) {\n\t\t\t\tvar sections_das = DefiniteAssignmentBitSet.And (end_reachable_das);\n\t\t\t\tInitialDefinitiveAssignment |= sections_das;\n\t\t\t\tend_reachable_das = null;\n\t\t\t}\n\n\t\t\tfc.DefiniteAssignment = InitialDefinitiveAssignment;\n\n\t\t\treturn case_default != null && !end_reachable;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tExpr = Expr.Resolve (ec);\n\t\t\tif (Expr == null)\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// LAMESPEC: User conversion from non-nullable governing type has a priority\n\t\t\t//\n\t\t\tnew_expr = SwitchGoverningType (ec, Expr, false);\n\n\t\t\tif (new_expr == null) {\n\t\t\t\tif (Expr.Type.IsNullableType) {\n\t\t\t\t\tunwrap = Nullable.Unwrap.Create (Expr, false);\n\t\t\t\t\tif (unwrap == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Unwrap + user conversion using non-nullable type is not allowed but user operator\n\t\t\t\t\t// involving nullable Expr and nullable governing type is\n\t\t\t\t\t//\n\t\t\t\t\tnew_expr = SwitchGoverningType (ec, unwrap, true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (new_expr == null) {\n\t\t\t\tif (Expr.Type != InternalType.ErrorType) {\n\t\t\t\t\tec.Report.Error (151, loc,\n\t\t\t\t\t\t\"A switch expression of type `{0}' cannot be converted to an integral type, bool, char, string, enum or nullable type\",\n\t\t\t\t\t\tExpr.Type.GetSignatureForError ());\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tSwitchType = new_expr.Type;\n\t\t\tif (SwitchType.IsNullableType) {\n\t\t\t\tnew_expr = unwrap = Nullable.Unwrap.Create (new_expr, true);\n\t\t\t\tSwitchType = Nullable.NullableInfo.GetUnderlyingType (SwitchType);\n\t\t\t}\n\n\t\t\tif (SwitchType.BuiltinType == BuiltinTypeSpec.Type.Bool && ec.Module.Compiler.Settings.Version == LanguageVersion.ISO_1) {\n\t\t\t\tec.Report.FeatureIsNotAvailable (ec.Module.Compiler, loc, \"switch expression of boolean type\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (block.Statements.Count == 0)\n\t\t\t\treturn true;\n\n\t\t\tif (SwitchType.BuiltinType == BuiltinTypeSpec.Type.String) {\n\t\t\t\tstring_labels = new Dictionary<string, SwitchLabel> ();\n\t\t\t} else {\n\t\t\t\tlabels = new Dictionary<long, SwitchLabel> ();\n\t\t\t}\n\n\t\t\tcase_labels = new List<SwitchLabel> ();\n\n\t\t\tvar constant = new_expr as Constant;\n\n\t\t\t//\n\t\t\t// Don't need extra variable for constant switch or switch with\n\t\t\t// only default case\n\t\t\t//\n\t\t\tif (constant == null) {\n\t\t\t\t//\n\t\t\t\t// Store switch expression for comparison purposes\n\t\t\t\t//\n\t\t\t\tvalue = new_expr as VariableReference;\n\t\t\t\tif (value == null && !HasOnlyDefaultSection ()) {\n\t\t\t\t\tvar current_block = ec.CurrentBlock;\n\t\t\t\t\tec.CurrentBlock = Block;\n\t\t\t\t\t// Create temporary variable inside switch scope\n\t\t\t\t\tvalue = TemporaryVariableReference.Create (SwitchType, ec.CurrentBlock, loc);\n\t\t\t\t\tvalue.Resolve (ec);\n\t\t\t\t\tec.CurrentBlock = current_block;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSwitch old_switch = ec.Switch;\n\t\t\tec.Switch = this;\n\t\t\tvar parent_los = ec.EnclosingLoopOrSwitch;\n\t\t\tec.EnclosingLoopOrSwitch = this;\n\n\t\t\tvar ok = Statement.Resolve (ec);\n\n\t\t\tec.EnclosingLoopOrSwitch = parent_los;\n\t\t\tec.Switch = old_switch;\n\n\t\t\t//\n\t\t\t// Check if all goto cases are valid. Needs to be done after switch\n\t\t\t// is resolved because goto can jump forward in the scope.\n\t\t\t//\n\t\t\tif (goto_cases != null) {\n\t\t\t\tforeach (var gc in goto_cases) {\n\t\t\t\t\tif (gc.Item1 == null) {\n\t\t\t\t\t\tif (DefaultLabel == null) {\n\t\t\t\t\t\t\tGoto.Error_UnknownLabel (ec, \"default\", loc);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar sl = FindLabel (gc.Item2);\n\t\t\t\t\tif (sl == null) {\n\t\t\t\t\t\tGoto.Error_UnknownLabel (ec, \"case \" + gc.Item2.GetValueAsLiteral (), loc);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgc.Item1.Label = sl;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ok)\n\t\t\t\treturn false;\n\n\t\t\tif (constant == null && SwitchType.BuiltinType == BuiltinTypeSpec.Type.String && string_labels.Count > 6) {\n\t\t\t\tResolveStringSwitchMap (ec);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Anonymous storey initialization has to happen before\n\t\t\t// any generated switch dispatch\n\t\t\t//\n\t\t\tblock.InsertStatement (0, new DispatchStatement (this));\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool HasOnlyDefaultSection ()\n\t\t{\n\t\t\tfor (int i = 0; i < block.Statements.Count; ++i) {\n\t\t\t\tvar s = block.Statements[i] as SwitchLabel;\n\n\t\t\t\tif (s == null || s.IsDefault)\n\t\t\t\t\tcontinue;\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (rc.IsUnreachable)\n\t\t\t\treturn rc;\n\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tblock.MarkReachableScope (rc);\n\n\t\t\tif (block.Statements.Count == 0)\n\t\t\t\treturn rc;\n\n\t\t\tSwitchLabel constant_label = null;\n\t\t\tvar constant = new_expr as Constant;\n\n\t\t\tif (constant != null) {\n\t\t\t\tconstant_label = FindLabel (constant) ?? case_default;\n\t\t\t\tif (constant_label == null) {\n\t\t\t\t\tblock.Statements.RemoveAt (0);\n\t\t\t\t\treturn rc;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar section_rc = new Reachability ();\n\t\t\tSwitchLabel prev_label = null;\n\n\t\t\tfor (int i = 0; i < block.Statements.Count; ++i) {\n\t\t\t\tvar s = block.Statements[i];\n\t\t\t\tvar sl = s as SwitchLabel;\n\n\t\t\t\tif (sl != null && sl.SectionStart) {\n\t\t\t\t\t//\n\t\t\t\t\t// Section is marked already via goto case\n\t\t\t\t\t//\n\t\t\t\t\tif (!sl.IsUnreachable) {\n\t\t\t\t\t\tsection_rc = new Reachability ();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (constant_label != null && constant_label != sl)\n\t\t\t\t\t\tsection_rc = Reachability.CreateUnreachable ();\n\t\t\t\t\telse if (section_rc.IsUnreachable) {\n\t\t\t\t\t\tsection_rc = new Reachability ();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (prev_label != null) {\n\t\t\t\t\t\t\tsl.SectionStart = false;\n\t\t\t\t\t\t\ts = new MissingBreak (prev_label);\n\t\t\t\t\t\t\ts.MarkReachable (rc);\n\t\t\t\t\t\t\tblock.Statements.Insert (i - 1, s);\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tprev_label = sl;\n\t\t\t\t}\n\n\t\t\t\tsection_rc = s.MarkReachable (section_rc);\n\t\t\t}\n\n\t\t\tif (!section_rc.IsUnreachable && prev_label != null) {\n\t\t\t\tprev_label.SectionStart = false;\n\t\t\t\tvar s = new MissingBreak (prev_label) {\n\t\t\t\t\tFallOut = true\n\t\t\t\t};\n\n\t\t\t\ts.MarkReachable (rc);\n\t\t\t\tblock.Statements.Add (s);\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Reachability can affect parent only when all possible paths are handled but\n\t\t\t// we still need to run reachability check on switch body to check for fall-through\n\t\t\t//\n\t\t\tif (case_default == null && constant_label == null)\n\t\t\t\treturn rc;\n\n\t\t\t//\n\t\t\t// We have at least one local exit from the switch\n\t\t\t//\n\t\t\tif (end_reachable)\n\t\t\t\treturn rc;\n\n\t\t\treturn Reachability.CreateUnreachable ();\n\t\t}\n\n\t\tpublic void RegisterGotoCase (GotoCase gotoCase, Constant value)\n\t\t{\n\t\t\tif (goto_cases == null)\n\t\t\t\tgoto_cases = new List<Tuple<GotoCase, Constant>> ();\n\n\t\t\tgoto_cases.Add (Tuple.Create (gotoCase, value));\n\t\t}\n\n\t\t//\n\t\t// Converts string switch into string hashtable\n\t\t//\n\t\tvoid ResolveStringSwitchMap (ResolveContext ec)\n\t\t{\n\t\t\tFullNamedExpression string_dictionary_type;\n\t\t\tif (ec.Module.PredefinedTypes.Dictionary.Define ()) {\n\t\t\t\tstring_dictionary_type = new TypeExpression (\n\t\t\t\t\tec.Module.PredefinedTypes.Dictionary.TypeSpec.MakeGenericType (ec,\n\t\t\t\t\t\tnew [] { ec.BuiltinTypes.String, ec.BuiltinTypes.Int }),\n\t\t\t\t\tloc);\n\t\t\t} else if (ec.Module.PredefinedTypes.Hashtable.Define ()) {\n\t\t\t\tstring_dictionary_type = new TypeExpression (ec.Module.PredefinedTypes.Hashtable.TypeSpec, loc);\n\t\t\t} else {\n\t\t\t\tec.Module.PredefinedTypes.Dictionary.Resolve ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar ctype = ec.CurrentMemberDefinition.Parent.PartialContainer;\n\t\t\tField field = new Field (ctype, string_dictionary_type,\n\t\t\t\tModifiers.STATIC | Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED,\n\t\t\t\tnew MemberName (CompilerGeneratedContainer.MakeName (null, \"f\", \"switch$map\", ec.Module.CounterSwitchTypes++), loc), null);\n\t\t\tif (!field.Define ())\n\t\t\t\treturn;\n\t\t\tctype.AddField (field);\n\n\t\t\tvar init = new List<Expression> ();\n\t\t\tint counter = -1;\n\t\t\tlabels = new Dictionary<long, SwitchLabel> (string_labels.Count);\n\t\t\tstring value = null;\n\n\t\t\tforeach (SwitchLabel sl in case_labels) {\n\n\t\t\t\tif (sl.SectionStart)\n\t\t\t\t\tlabels.Add (++counter, sl);\n\n\t\t\t\tif (sl == case_default || sl == case_null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvalue = (string) sl.Converted.GetValue ();\n\t\t\t\tvar init_args = new List<Expression> (2);\n\t\t\t\tinit_args.Add (new StringLiteral (ec.BuiltinTypes, value, sl.Location));\n\n\t\t\t\tsl.Converted = new IntConstant (ec.BuiltinTypes, counter, loc);\n\t\t\t\tinit_args.Add (sl.Converted);\n\n\t\t\t\tinit.Add (new CollectionElementInitializer (init_args, loc));\n\t\t\t}\n\t\n\t\t\tArguments args = new Arguments (1);\n\t\t\targs.Add (new Argument (new IntConstant (ec.BuiltinTypes, init.Count, loc)));\n\t\t\tExpression initializer = new NewInitialize (string_dictionary_type, args,\n\t\t\t\tnew CollectionOrObjectInitializers (init, loc), loc);\n\n\t\t\tswitch_cache_field = new FieldExpr (field, loc);\n\t\t\tstring_dictionary = new SimpleAssign (switch_cache_field, initializer.Resolve (ec));\n\t\t}\n\n\t\tvoid DoEmitStringSwitch (EmitContext ec)\n\t\t{\n\t\t\tLabel l_initialized = ec.DefineLabel ();\n\n\t\t\t//\n\t\t\t// Skip initialization when value is null\n\t\t\t//\n\t\t\tvalue.EmitBranchable (ec, nullLabel, false);\n\n\t\t\t//\n\t\t\t// Check if string dictionary is initialized and initialize\n\t\t\t//\n\t\t\tswitch_cache_field.EmitBranchable (ec, l_initialized, true);\n\t\t\tusing (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {\n\t\t\t\tstring_dictionary.EmitStatement (ec);\n\t\t\t}\n\t\t\tec.MarkLabel (l_initialized);\n\n\t\t\tLocalTemporary string_switch_variable = new LocalTemporary (ec.BuiltinTypes.Int);\n\n\t\t\tResolveContext rc = new ResolveContext (ec.MemberContext);\n\n\t\t\tif (switch_cache_field.Type.IsGeneric) {\n\t\t\t\tArguments get_value_args = new Arguments (2);\n\t\t\t\tget_value_args.Add (new Argument (value));\n\t\t\t\tget_value_args.Add (new Argument (string_switch_variable, Argument.AType.Out));\n\t\t\t\tExpression get_item = new Invocation (new MemberAccess (switch_cache_field, \"TryGetValue\", loc), get_value_args).Resolve (rc);\n\t\t\t\tif (get_item == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t//\n\t\t\t\t// A value was not found, go to default case\n\t\t\t\t//\n\t\t\t\tget_item.EmitBranchable (ec, defaultLabel, false);\n\t\t\t} else {\n\t\t\t\tArguments get_value_args = new Arguments (1);\n\t\t\t\tget_value_args.Add (new Argument (value));\n\n\t\t\t\tExpression get_item = new ElementAccess (switch_cache_field, get_value_args, loc).Resolve (rc);\n\t\t\t\tif (get_item == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tLocalTemporary get_item_object = new LocalTemporary (ec.BuiltinTypes.Object);\n\t\t\t\tget_item_object.EmitAssign (ec, get_item, true, false);\n\t\t\t\tec.Emit (OpCodes.Brfalse, defaultLabel);\n\n\t\t\t\tExpressionStatement get_item_int = (ExpressionStatement) new SimpleAssign (string_switch_variable,\n\t\t\t\t\tnew Cast (new TypeExpression (ec.BuiltinTypes.Int, loc), get_item_object, loc)).Resolve (rc);\n\n\t\t\t\tget_item_int.EmitStatement (ec);\n\t\t\t\tget_item_object.Release (ec);\n\t\t\t}\n\n\t\t\tEmitTableSwitch (ec, string_switch_variable);\n\t\t\tstring_switch_variable.Release (ec);\n\t\t}\n\n\t\t//\n\t\t// Emits switch using simple if/else comparison for small label count (4 + optional default)\n\t\t//\n\t\tvoid EmitShortSwitch (EmitContext ec)\n\t\t{\n\t\t\tMethodSpec equal_method = null;\n\t\t\tif (SwitchType.BuiltinType == BuiltinTypeSpec.Type.String) {\n\t\t\t\tequal_method = ec.Module.PredefinedMembers.StringEqual.Resolve (loc);\n\t\t\t}\n\n\t\t\tif (equal_method != null) {\n\t\t\t\tvalue.EmitBranchable (ec, nullLabel, false);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < case_labels.Count; ++i) {\n\t\t\t\tvar label = case_labels [i];\n\t\t\t\tif (label == case_default || label == case_null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar constant = label.Converted;\n\n\t\t\t\tif (equal_method != null) {\n\t\t\t\t\tvalue.Emit (ec);\n\t\t\t\t\tconstant.Emit (ec);\n\n\t\t\t\t\tvar call = new CallEmitter ();\n\t\t\t\t\tcall.EmitPredefined (ec, equal_method, new Arguments (0));\n\t\t\t\t\tec.Emit (OpCodes.Brtrue, label.GetILLabel (ec));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (constant.IsZeroInteger && constant.Type.BuiltinType != BuiltinTypeSpec.Type.Long && constant.Type.BuiltinType != BuiltinTypeSpec.Type.ULong) {\n\t\t\t\t\tvalue.EmitBranchable (ec, label.GetILLabel (ec), false);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvalue.Emit (ec);\n\t\t\t\tconstant.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Beq, label.GetILLabel (ec));\n\t\t\t}\n\n\t\t\tec.Emit (OpCodes.Br, defaultLabel);\n\t\t}\n\n\t\tvoid EmitDispatch (EmitContext ec)\n\t\t{\n\t\t\tif (value == null) {\n\t\t\t\t//\n\t\t\t\t// Constant switch, we've already done the work if there is only 1 label\n\t\t\t\t// referenced\n\t\t\t\t//\n\t\t\t\tint reachable = 0;\n\t\t\t\tforeach (var sl in case_labels) {\n\t\t\t\t\tif (sl.IsUnreachable)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (reachable++ > 0) {\n\t\t\t\t\t\tvar constant = (Constant) new_expr;\n\t\t\t\t\t\tvar constant_label = FindLabel (constant) ?? case_default;\n\n\t\t\t\t\t\tec.Emit (OpCodes.Br, constant_label.GetILLabel (ec));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (string_dictionary != null) {\n\t\t\t\tDoEmitStringSwitch (ec);\n\t\t\t} else if (case_labels.Count < 4 || string_labels != null) {\n\t\t\t\tEmitShortSwitch (ec);\n\t\t\t} else {\n\t\t\t\tEmitTableSwitch (ec, value);\n\t\t\t}\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Setup the codegen context\n\t\t\t//\n\t\t\tLabel old_end = ec.LoopEnd;\n\t\t\tSwitch old_switch = ec.Switch;\n\n\t\t\tec.LoopEnd = ec.DefineLabel ();\n\t\t\tec.Switch = this;\n\n\t\t\tdefaultLabel = case_default == null ? ec.LoopEnd : case_default.GetILLabel (ec);\n\t\t\tnullLabel = case_null == null ? defaultLabel : case_null.GetILLabel (ec);\n\n\t\t\tif (value != null) {\n\t\t\t\tec.Mark (loc);\n\t\t\t\tif (IsNullable) {\n\t\t\t\t\tunwrap.EmitCheck (ec);\n\t\t\t\t\tec.Emit (OpCodes.Brfalse, nullLabel);\n\t\t\t\t\tvalue.EmitAssign (ec, new_expr, false, false);\n\t\t\t\t} else if (new_expr != value) {\n\t\t\t\t\tvalue.EmitAssign (ec, new_expr, false, false);\n\t\t\t\t}\n\n\n\t\t\t\t//\n\t\t\t\t// Next statement is compiler generated we don't need extra\n\t\t\t\t// nop when we can use the statement for sequence point\n\t\t\t\t//\n\t\t\t\tec.Mark (block.StartLocation);\n\t\t\t\tblock.IsCompilerGenerated = true;\n\t\t\t} else {\n\t\t\t\tnew_expr.EmitSideEffect (ec);\n\t\t\t}\n\n\t\t\tblock.Emit (ec);\n\n\t\t\t// Restore context state. \n\t\t\tec.MarkLabel (ec.LoopEnd);\n\n\t\t\t//\n\t\t\t// Restore the previous context\n\t\t\t//\n\t\t\tec.LoopEnd = old_end;\n\t\t\tec.Switch = old_switch;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tSwitch target = (Switch) t;\n\n\t\t\ttarget.Expr = Expr.Clone (clonectx);\n\t\t\ttarget.Statement = target.block = (ExplicitBlock) block.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t\tpublic override void AddEndDefiniteAssignment (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (case_default == null && !(new_expr is Constant))\n\t\t\t\treturn;\n\n\t\t\tif (end_reachable_das == null)\n\t\t\t\tend_reachable_das = new List<DefiniteAssignmentBitSet> ();\n\n\t\t\tend_reachable_das.Add (fc.DefiniteAssignment);\n\t\t}\n\n\t\tpublic override void SetEndReachable ()\n\t\t{\n\t\t\tend_reachable = true;\n\t\t}\n\t}\n\n\t// A place where execution can restart in a state machine\n\tpublic abstract class ResumableStatement : Statement\n\t{\n\t\tbool prepared;\n\t\tprotected Label resume_point;\n\n\t\tpublic Label PrepareForEmit (EmitContext ec)\n\t\t{\n\t\t\tif (!prepared) {\n\t\t\t\tprepared = true;\n\t\t\t\tresume_point = ec.DefineLabel ();\n\t\t\t}\n\t\t\treturn resume_point;\n\t\t}\n\n\t\tpublic virtual Label PrepareForDispose (EmitContext ec, Label end)\n\t\t{\n\t\t\treturn end;\n\t\t}\n\n\t\tpublic virtual void EmitForDispose (EmitContext ec, LocalBuilder pc, Label end, bool have_dispatcher)\n\t\t{\n\t\t}\n\t}\n\n\tpublic abstract class TryFinallyBlock : ExceptionStatement\n\t{\n\t\tprotected Statement stmt;\n\t\tLabel dispose_try_block;\n\t\tbool prepared_for_dispose, emitted_dispose;\n\t\tMethod finally_host;\n\n\t\tprotected TryFinallyBlock (Statement stmt, Location loc)\n\t\t\t: base (loc)\n\t\t{\n\t\t\tthis.stmt = stmt;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Statement Statement {\n\t\t\tget {\n\t\t\t\treturn stmt;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected abstract void EmitTryBody (EmitContext ec);\n\t\tpublic abstract void EmitFinallyBody (EmitContext ec);\n\n\t\tpublic override Label PrepareForDispose (EmitContext ec, Label end)\n\t\t{\n\t\t\tif (!prepared_for_dispose) {\n\t\t\t\tprepared_for_dispose = true;\n\t\t\t\tdispose_try_block = ec.DefineLabel ();\n\t\t\t}\n\t\t\treturn dispose_try_block;\n\t\t}\n\n\t\tprotected sealed override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tEmitTryBodyPrepare (ec);\n\t\t\tEmitTryBody (ec);\n\n\t\t\tbool beginFinally = EmitBeginFinallyBlock (ec);\n\n\t\t\tLabel start_finally = ec.DefineLabel ();\n\t\t\tif (resume_points != null && beginFinally) {\n\t\t\t\tvar state_machine = (StateMachineInitializer) ec.CurrentAnonymousMethod;\n\n\t\t\t\tec.Emit (OpCodes.Ldloc, state_machine.SkipFinally);\n\t\t\t\tec.Emit (OpCodes.Brfalse_S, start_finally);\n\t\t\t\tec.Emit (OpCodes.Endfinally);\n\t\t\t}\n\n\t\t\tec.MarkLabel (start_finally);\n\n\t\t\tif (finally_host != null) {\n\t\t\t\tfinally_host.Define ();\n\t\t\t\tfinally_host.PrepareEmit ();\n\t\t\t\tfinally_host.Emit ();\n\n\t\t\t\t// Now it's safe to add, to close it properly and emit sequence points\n\t\t\t\tfinally_host.Parent.AddMember (finally_host);\n\n\t\t\t\tvar ce = new CallEmitter ();\n\t\t\t\tce.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);\n\t\t\t\tce.EmitPredefined (ec, finally_host.Spec, new Arguments (0), true);\n\t\t\t} else {\n\t\t\t\tEmitFinallyBody (ec);\n\t\t\t}\n\n\t\t\tif (beginFinally)\n\t\t\t\tec.EndExceptionBlock ();\n\t\t}\n\n\t\tpublic override void EmitForDispose (EmitContext ec, LocalBuilder pc, Label end, bool have_dispatcher)\n\t\t{\n\t\t\tif (emitted_dispose)\n\t\t\t\treturn;\n\n\t\t\temitted_dispose = true;\n\n\t\t\tLabel end_of_try = ec.DefineLabel ();\n\n\t\t\t// Ensure that the only way we can get into this code is through a dispatcher\n\t\t\tif (have_dispatcher)\n\t\t\t\tec.Emit (OpCodes.Br, end);\n\n\t\t\tec.BeginExceptionBlock ();\n\n\t\t\tec.MarkLabel (dispose_try_block);\n\n\t\t\tLabel[] labels = null;\n\t\t\tfor (int i = 0; i < resume_points.Count; ++i) {\n\t\t\t\tResumableStatement s = resume_points[i];\n\t\t\t\tLabel ret = s.PrepareForDispose (ec, end_of_try);\n\t\t\t\tif (ret.Equals (end_of_try) && labels == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (labels == null) {\n\t\t\t\t\tlabels = new Label[resume_points.Count];\n\t\t\t\t\tfor (int j = 0; j < i; ++j)\n\t\t\t\t\t\tlabels[j] = end_of_try;\n\t\t\t\t}\n\t\t\t\tlabels[i] = ret;\n\t\t\t}\n\n\t\t\tif (labels != null) {\n\t\t\t\tint j;\n\t\t\t\tfor (j = 1; j < labels.Length; ++j)\n\t\t\t\t\tif (!labels[0].Equals (labels[j]))\n\t\t\t\t\t\tbreak;\n\t\t\t\tbool emit_dispatcher = j < labels.Length;\n\n\t\t\t\tif (emit_dispatcher) {\n\t\t\t\t\tec.Emit (OpCodes.Ldloc, pc);\n\t\t\t\t\tec.EmitInt (first_resume_pc);\n\t\t\t\t\tec.Emit (OpCodes.Sub);\n\t\t\t\t\tec.Emit (OpCodes.Switch, labels);\n\t\t\t\t}\n\n\t\t\t\tforeach (ResumableStatement s in resume_points)\n\t\t\t\t\ts.EmitForDispose (ec, pc, end_of_try, emit_dispatcher);\n\t\t\t}\n\n\t\t\tec.MarkLabel (end_of_try);\n\n\t\t\tec.BeginFinallyBlock ();\n\n\t\t\tif (finally_host != null) {\n\t\t\t\tvar ce = new CallEmitter ();\n\t\t\t\tce.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);\n\t\t\t\tce.EmitPredefined (ec, finally_host.Spec, new Arguments (0), true);\n\t\t\t} else {\n\t\t\t\tEmitFinallyBody (ec);\n\t\t\t}\n\n\t\t\tec.EndExceptionBlock ();\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tvar res = stmt.FlowAnalysis (fc);\n\t\t\tparent = null;\n\t\t\treturn res;\n\t\t}\n\n\t\tprotected virtual bool EmitBeginFinallyBlock (EmitContext ec)\n\t\t{\n\t\t\tec.BeginFinallyBlock ();\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Statement.MarkReachable (rc);\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tbool ok;\n\n\t\t\tparent = bc.CurrentTryBlock;\n\t\t\tbc.CurrentTryBlock = this;\n\n\t\t\tusing (bc.Set (ResolveContext.Options.TryScope)) {\n\t\t\t\tok = stmt.Resolve (bc);\n\t\t\t}\n\n\t\t\tbc.CurrentTryBlock = parent;\n\n\t\t\t//\n\t\t\t// Finally block inside iterator is called from MoveNext and\n\t\t\t// Dispose methods that means we need to lift the block into\n\t\t\t// newly created host method to emit the body only once. The\n\t\t\t// original block then simply calls the newly generated method.\n\t\t\t//\n\t\t\tif (bc.CurrentIterator != null && !bc.IsInProbingMode) {\n\t\t\t\tvar b = stmt as Block;\n\t\t\t\tif (b != null && b.Explicit.HasYield) {\n\t\t\t\t\tfinally_host = bc.CurrentIterator.CreateFinallyHost (this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.Resolve (bc) && ok;\n\t\t}\n\t}\n\n\t//\n\t// Base class for blocks using exception handling\n\t//\n\tpublic abstract class ExceptionStatement : ResumableStatement\n\t{\n\t\tprotected List<ResumableStatement> resume_points;\n\t\tprotected int first_resume_pc;\n\t\tprotected ExceptionStatement parent;\n\n\t\tprotected ExceptionStatement (Location loc)\n\t\t{\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tprotected virtual void EmitTryBodyPrepare (EmitContext ec)\n\t\t{\n\t\t\tStateMachineInitializer state_machine = null;\n\t\t\tif (resume_points != null) {\n\t\t\t\tstate_machine = (StateMachineInitializer) ec.CurrentAnonymousMethod;\n\n\t\t\t\tec.EmitInt ((int) IteratorStorey.State.Running);\n\t\t\t\tec.Emit (OpCodes.Stloc, state_machine.CurrentPC);\n\t\t\t}\n\n\t\t\tec.BeginExceptionBlock ();\n\n\t\t\tif (resume_points != null) {\n\t\t\t\tec.MarkLabel (resume_point);\n\n\t\t\t\t// For normal control flow, we want to fall-through the Switch\n\t\t\t\t// So, we use CurrentPC rather than the $PC field, and initialize it to an outside value above\n\t\t\t\tec.Emit (OpCodes.Ldloc, state_machine.CurrentPC);\n\t\t\t\tec.EmitInt (first_resume_pc);\n\t\t\t\tec.Emit (OpCodes.Sub);\n\n\t\t\t\tLabel[] labels = new Label[resume_points.Count];\n\t\t\t\tfor (int i = 0; i < resume_points.Count; ++i)\n\t\t\t\t\tlabels[i] = resume_points[i].PrepareForEmit (ec);\n\t\t\t\tec.Emit (OpCodes.Switch, labels);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual int AddResumePoint (ResumableStatement stmt, int pc, StateMachineInitializer stateMachine)\n\t\t{\n\t\t\tif (parent != null) {\n\t\t\t\t// TODO: MOVE to virtual TryCatch\n\t\t\t\tvar tc = this as TryCatch;\n\t\t\t\tvar s = tc != null && tc.IsTryCatchFinally ? stmt : this;\n\n\t\t\t\tpc = parent.AddResumePoint (s, pc, stateMachine);\n\t\t\t} else {\n\t\t\t\tpc = stateMachine.AddResumePoint (this);\n\t\t\t}\n\n\t\t\tif (resume_points == null) {\n\t\t\t\tresume_points = new List<ResumableStatement> ();\n\t\t\t\tfirst_resume_pc = pc;\n\t\t\t}\n\n\t\t\tif (pc != first_resume_pc + resume_points.Count)\n\t\t\t\tthrow new InternalErrorException (\"missed an intervening AddResumePoint?\");\n\n\t\t\tresume_points.Add (stmt);\n\t\t\treturn pc;\n\t\t}\n\t}\n\n\tpublic class Lock : TryFinallyBlock\n\t{\n\t\tExpression expr;\n\t\tTemporaryVariableReference expr_copy;\n\t\tTemporaryVariableReference lock_taken;\n\t\t\t\n\t\tpublic Lock (Expression expr, Statement stmt, Location loc)\n\t\t\t: base (stmt, loc)\n\t\t{\n\t\t\tthis.expr = expr;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n \t\t\t\treturn this.expr;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\t\t\treturn base.DoFlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn false;\n\n\t\t\tif (!TypeSpec.IsReferenceType (expr.Type)) {\n\t\t\t\tec.Report.Error (185, loc,\n\t\t\t\t\t\"`{0}' is not a reference type as required by the lock statement\",\n\t\t\t\t\texpr.Type.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif (expr.Type.IsGenericParameter) {\n\t\t\t\texpr = Convert.ImplicitTypeParameterConversion (expr, (TypeParameterSpec)expr.Type, ec.BuiltinTypes.Object);\n\t\t\t}\n\n\t\t\tVariableReference lv = expr as VariableReference;\n\t\t\tbool locked;\n\t\t\tif (lv != null) {\n\t\t\t\tlocked = lv.IsLockedByStatement;\n\t\t\t\tlv.IsLockedByStatement = true;\n\t\t\t} else {\n\t\t\t\tlv = null;\n\t\t\t\tlocked = false;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Have to keep original lock value around to unlock same location\n\t\t\t// in the case of original value has changed or is null\n\t\t\t//\n\t\t\texpr_copy = TemporaryVariableReference.Create (ec.BuiltinTypes.Object, ec.CurrentBlock, loc);\n\t\t\texpr_copy.Resolve (ec);\n\n\t\t\t//\n\t\t\t// Ensure Monitor methods are available\n\t\t\t//\n\t\t\tif (ResolvePredefinedMethods (ec) > 1) {\n\t\t\t\tlock_taken = TemporaryVariableReference.Create (ec.BuiltinTypes.Bool, ec.CurrentBlock, loc);\n\t\t\t\tlock_taken.Resolve (ec);\n\t\t\t}\n\n\t\t\tusing (ec.Set (ResolveContext.Options.LockScope)) {\n\t\t\t\tbase.Resolve (ec);\n\t\t\t}\n\n\t\t\tif (lv != null) {\n\t\t\t\tlv.IsLockedByStatement = locked;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tprotected override void EmitTryBodyPrepare (EmitContext ec)\n\t\t{\n\t\t\texpr_copy.EmitAssign (ec, expr);\n\n\t\t\tif (lock_taken != null) {\n\t\t\t\t//\n\t\t\t\t// Initialize ref variable\n\t\t\t\t//\n\t\t\t\tlock_taken.EmitAssign (ec, new BoolLiteral (ec.BuiltinTypes, false, loc));\n\t\t\t} else {\n\t\t\t\t//\n\t\t\t\t// Monitor.Enter (expr_copy)\n\t\t\t\t//\n\t\t\t\texpr_copy.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Call, ec.Module.PredefinedMembers.MonitorEnter.Get ());\n\t\t\t}\n\n\t\t\tbase.EmitTryBodyPrepare (ec);\n\t\t}\n\n\t\tprotected override void EmitTryBody (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Monitor.Enter (expr_copy, ref lock_taken)\n\t\t\t//\n\t\t\tif (lock_taken != null) {\n\t\t\t\texpr_copy.Emit (ec);\n\t\t\t\tlock_taken.LocalInfo.CreateBuilder (ec);\n\t\t\t\tlock_taken.AddressOf (ec, AddressOp.Load);\n\t\t\t\tec.Emit (OpCodes.Call, ec.Module.PredefinedMembers.MonitorEnter_v4.Get ());\n\t\t\t}\n\n\t\t\tStatement.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitFinallyBody (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// if (lock_taken) Monitor.Exit (expr_copy)\n\t\t\t//\n\t\t\tLabel skip = ec.DefineLabel ();\n\n\t\t\tif (lock_taken != null) {\n\t\t\t\tlock_taken.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Brfalse_S, skip);\n\t\t\t}\n\n\t\t\texpr_copy.Emit (ec);\n\t\t\tvar m = ec.Module.PredefinedMembers.MonitorExit.Resolve (loc);\n\t\t\tif (m != null)\n\t\t\t\tec.Emit (OpCodes.Call, m);\n\n\t\t\tec.MarkLabel (skip);\n\t\t}\n\n\t\tint ResolvePredefinedMethods (ResolveContext rc)\n\t\t{\n\t\t\t// Try 4.0 Monitor.Enter (object, ref bool) overload first\n\t\t\tvar m = rc.Module.PredefinedMembers.MonitorEnter_v4.Get ();\n\t\t\tif (m != null)\n\t\t\t\treturn 4;\n\n\t\t\tm = rc.Module.PredefinedMembers.MonitorEnter.Get ();\n\t\t\tif (m != null)\n\t\t\t\treturn 1;\n\n\t\t\trc.Module.PredefinedMembers.MonitorEnter_v4.Resolve (loc);\n\t\t\treturn 0;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tLock target = (Lock) t;\n\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t\ttarget.stmt = Statement.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\n\t}\n\n\tpublic class Unchecked : Statement {\n\t\tpublic Block Block;\n\t\t\n\t\tpublic Unchecked (Block b, Location loc)\n\t\t{\n\t\t\tBlock = b;\n\t\t\tb.Unchecked = true;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tusing (ec.With (ResolveContext.Options.AllCheckStateFlags, false))\n\t\t\t\treturn Block.Resolve (ec);\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tusing (ec.With (EmitContext.Options.CheckedScope, false))\n\t\t\t\tBlock.Emit (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn Block.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Block.MarkReachable (rc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tUnchecked target = (Unchecked) t;\n\n\t\t\ttarget.Block = clonectx.LookupBlock (Block);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Checked : Statement {\n\t\tpublic Block Block;\n\t\t\n\t\tpublic Checked (Block b, Location loc)\n\t\t{\n\t\t\tBlock = b;\n\t\t\tb.Unchecked = false;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tusing (ec.With (ResolveContext.Options.AllCheckStateFlags, true))\n\t\t\t\treturn Block.Resolve (ec);\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tusing (ec.With (EmitContext.Options.CheckedScope, true))\n\t\t\t\tBlock.Emit (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn Block.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Block.MarkReachable (rc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tChecked target = (Checked) t;\n\n\t\t\ttarget.Block = clonectx.LookupBlock (Block);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Unsafe : Statement {\n\t\tpublic Block Block;\n\n\t\tpublic Unsafe (Block b, Location loc)\n\t\t{\n\t\t\tBlock = b;\n\t\t\tBlock.Unsafe = true;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tif (ec.CurrentIterator != null)\n\t\t\t\tec.Report.Error (1629, loc, \"Unsafe code may not appear in iterators\");\n\n\t\t\tusing (ec.Set (ResolveContext.Options.UnsafeScope))\n\t\t\t\treturn Block.Resolve (ec);\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tBlock.Emit (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\treturn Block.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\t\t\treturn Block.MarkReachable (rc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tUnsafe target = (Unsafe) t;\n\n\t\t\ttarget.Block = clonectx.LookupBlock (Block);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t// \n\t// Fixed statement\n\t//\n\tpublic class Fixed : Statement\n\t{\n\t\tabstract class Emitter : ShimExpression\n\t\t{\n\t\t\tprotected LocalVariable vi;\n\n\t\t\tprotected Emitter (Expression expr, LocalVariable li)\n\t\t\t\t: base (expr)\n\t\t\t{\n\t\t\t\tvi = li;\n\t\t\t}\n\n\t\t\tpublic abstract void EmitExit (EmitContext ec);\n\n\t\t\tpublic override void FlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\texpr.FlowAnalysis (fc);\n\t\t\t}\n\t\t}\n\n\t\tclass ExpressionEmitter : Emitter {\n\t\t\tpublic ExpressionEmitter (Expression converted, LocalVariable li) :\n\t\t\t\tbase (converted, li)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec) {\n\t\t\t\t//\n\t\t\t\t// Store pointer in pinned location\n\t\t\t\t//\n\t\t\t\texpr.Emit (ec);\n\t\t\t\tvi.EmitAssign (ec);\n\t\t\t}\n\n\t\t\tpublic override void EmitExit (EmitContext ec)\n\t\t\t{\n\t\t\t\tec.EmitInt (0);\n\t\t\t\tec.Emit (OpCodes.Conv_U);\n\t\t\t\tvi.EmitAssign (ec);\n\t\t\t}\n\t\t}\n\n\t\tclass StringEmitter : Emitter\n\t\t{\n\t\t\tLocalVariable pinned_string;\n\n\t\t\tpublic StringEmitter (Expression expr, LocalVariable li)\n\t\t\t\t: base (expr, li)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override Expression DoResolve (ResolveContext rc)\n\t\t\t{\n\t\t\t\tpinned_string = new LocalVariable (vi.Block, \"$pinned\",\n\t\t\t\t\tLocalVariable.Flags.FixedVariable | LocalVariable.Flags.CompilerGenerated | LocalVariable.Flags.Used,\n\t\t\t\t\tvi.Location);\n\t\t\t\tpinned_string.Type = rc.BuiltinTypes.String;\n\n\t\t\t\teclass = ExprClass.Variable;\n\t\t\t\ttype = rc.BuiltinTypes.Int;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tpinned_string.CreateBuilder (ec);\n\n\t\t\t\texpr.Emit (ec);\n\t\t\t\tpinned_string.EmitAssign (ec);\n\n\t\t\t\t// TODO: Should use Binary::Add\n\t\t\t\tpinned_string.Emit (ec);\n\t\t\t\tec.Emit (OpCodes.Conv_I);\n\n\t\t\t\tvar m = ec.Module.PredefinedMembers.RuntimeHelpersOffsetToStringData.Resolve (loc);\n\t\t\t\tif (m == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tPropertyExpr pe = new PropertyExpr (m, pinned_string.Location);\n\t\t\t\t//pe.InstanceExpression = pinned_string;\n\t\t\t\tpe.Resolve (new ResolveContext (ec.MemberContext)).Emit (ec);\n\n\t\t\t\tec.Emit (OpCodes.Add);\n\t\t\t\tvi.EmitAssign (ec);\n\t\t\t}\n\n\t\t\tpublic override void EmitExit (EmitContext ec)\n\t\t\t{\n\t\t\t\tec.EmitNull ();\n\t\t\t\tpinned_string.EmitAssign (ec);\n\t\t\t}\n\t\t}\n\n\t\tpublic class VariableDeclaration : BlockVariable\n\t\t{\n\t\t\tpublic VariableDeclaration (FullNamedExpression type, LocalVariable li)\n\t\t\t\t: base (type, li)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override Expression ResolveInitializer (BlockContext bc, LocalVariable li, Expression initializer)\n\t\t\t{\n\t\t\t\tif (!Variable.Type.IsPointer && li == Variable) {\n\t\t\t\t\tbc.Report.Error (209, TypeExpression.Location,\n\t\t\t\t\t\t\"The type of locals declared in a fixed statement must be a pointer type\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// The rules for the possible declarators are pretty wise,\n\t\t\t\t// but the production on the grammar is more concise.\n\t\t\t\t//\n\t\t\t\t// So we have to enforce these rules here.\n\t\t\t\t//\n\t\t\t\t// We do not resolve before doing the case 1 test,\n\t\t\t\t// because the grammar is explicit in that the token &\n\t\t\t\t// is present, so we need to test for this particular case.\n\t\t\t\t//\n\n\t\t\t\tif (initializer is Cast) {\n\t\t\t\t\tbc.Report.Error (254, initializer.Location, \"The right hand side of a fixed statement assignment may not be a cast expression\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tinitializer = initializer.Resolve (bc);\n\n\t\t\t\tif (initializer == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\t//\n\t\t\t\t// Case 1: Array\n\t\t\t\t//\n\t\t\t\tif (initializer.Type.IsArray) {\n\t\t\t\t\tTypeSpec array_type = TypeManager.GetElementType (initializer.Type);\n\n\t\t\t\t\t//\n\t\t\t\t\t// Provided that array_type is unmanaged,\n\t\t\t\t\t//\n\t\t\t\t\tif (!TypeManager.VerifyUnmanaged (bc.Module, array_type, loc))\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t//\n\t\t\t\t\t// and T* is implicitly convertible to the\n\t\t\t\t\t// pointer type given in the fixed statement.\n\t\t\t\t\t//\n\t\t\t\t\tArrayPtr array_ptr = new ArrayPtr (initializer, array_type, loc);\n\n\t\t\t\t\tExpression converted = Convert.ImplicitConversionRequired (bc, array_ptr.Resolve (bc), li.Type, loc);\n\t\t\t\t\tif (converted == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t//\n\t\t\t\t\t// fixed (T* e_ptr = (e == null || e.Length == 0) ? null : converted [0])\n\t\t\t\t\t//\n\t\t\t\t\tconverted = new Conditional (new BooleanExpression (new Binary (Binary.Operator.LogicalOr,\n\t\t\t\t\t\tnew Binary (Binary.Operator.Equality, initializer, new NullLiteral (loc)),\n\t\t\t\t\t\tnew Binary (Binary.Operator.Equality, new MemberAccess (initializer, \"Length\"), new IntConstant (bc.BuiltinTypes, 0, loc)))),\n\t\t\t\t\t\t\tnew NullLiteral (loc),\n\t\t\t\t\t\t\tconverted, loc);\n\n\t\t\t\t\tconverted = converted.Resolve (bc);\n\n\t\t\t\t\treturn new ExpressionEmitter (converted, li);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Case 2: string\n\t\t\t\t//\n\t\t\t\tif (initializer.Type.BuiltinType == BuiltinTypeSpec.Type.String) {\n\t\t\t\t\treturn new StringEmitter (initializer, li).Resolve (bc);\n\t\t\t\t}\n\n\t\t\t\t// Case 3: fixed buffer\n\t\t\t\tif (initializer is FixedBufferPtr) {\n\t\t\t\t\treturn new ExpressionEmitter (initializer, li);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Case 4: & object.\n\t\t\t\t//\n\t\t\t\tbool already_fixed = true;\n\t\t\t\tUnary u = initializer as Unary;\n\t\t\t\tif (u != null && u.Oper == Unary.Operator.AddressOf) {\n\t\t\t\t\tIVariableReference vr = u.Expr as IVariableReference;\n\t\t\t\t\tif (vr == null || !vr.IsFixed) {\n\t\t\t\t\t\talready_fixed = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (already_fixed) {\n\t\t\t\t\tbc.Report.Error (213, loc, \"You cannot use the fixed statement to take the address of an already fixed expression\");\n\t\t\t\t}\n\n\t\t\t\tinitializer = Convert.ImplicitConversionRequired (bc, initializer, li.Type, loc);\n\t\t\t\treturn new ExpressionEmitter (initializer, li);\n\t\t\t}\n\t\t}\n\n\n\t\tVariableDeclaration decl;\n\t\tStatement statement;\n\t\tbool has_ret;\n\n\t\tpublic Fixed (VariableDeclaration decl, Statement stmt, Location l)\n\t\t{\n\t\t\tthis.decl = decl;\n\t\t\tstatement = stmt;\n\t\t\tloc = l;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Statement Statement {\n\t\t\tget {\n\t\t\t\treturn statement;\n\t\t\t}\n\t\t}\n\n\t\tpublic BlockVariable Variables {\n\t\t\tget {\n\t\t\t\treturn decl;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tusing (bc.Set (ResolveContext.Options.FixedInitializerScope)) {\n\t\t\t\tif (!decl.Resolve (bc))\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn statement.Resolve (bc);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tdecl.FlowAnalysis (fc);\n\t\t\treturn statement.FlowAnalysis (fc);\n\t\t}\n\t\t\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tdecl.Variable.CreateBuilder (ec);\n\t\t\tdecl.Initializer.Emit (ec);\n\t\t\tif (decl.Declarators != null) {\n\t\t\t\tforeach (var d in decl.Declarators) {\n\t\t\t\t\td.Variable.CreateBuilder (ec);\n\t\t\t\t\td.Initializer.Emit (ec);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatement.Emit (ec);\n\n\t\t\tif (has_ret)\n\t\t\t\treturn;\n\n\t\t\t//\n\t\t\t// Clear the pinned variable\n\t\t\t//\n\t\t\t((Emitter) decl.Initializer).EmitExit (ec);\n\t\t\tif (decl.Declarators != null) {\n\t\t\t\tforeach (var d in decl.Declarators) {\n\t\t\t\t\t((Emitter)d.Initializer).EmitExit (ec);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tdecl.MarkReachable (rc);\n\n\t\t\trc = statement.MarkReachable (rc);\n\n\t\t\t// TODO: What if there is local exit?\n\t\t\thas_ret = rc.IsUnreachable;\n\t\t\treturn rc;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tFixed target = (Fixed) t;\n\n\t\t\ttarget.decl = (VariableDeclaration) decl.Clone (clonectx);\n\t\t\ttarget.statement = statement.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Catch : Statement\n\t{\n\t\tclass FilterStatement : Statement\n\t\t{\n\t\t\treadonly Catch ctch;\n\n\t\t\tpublic FilterStatement (Catch ctch)\n\t\t\t{\n\t\t\t\tthis.ctch = ctch;\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\tif (ctch.li != null) {\n\t\t\t\t\tif (ctch.hoisted_temp != null)\n\t\t\t\t\t\tctch.hoisted_temp.Emit (ec);\n\t\t\t\t\telse\n\t\t\t\t\t\tctch.li.Emit (ec);\n\n\t\t\t\t\tif (!ctch.IsGeneral && ctch.type.Kind == MemberKind.TypeParameter)\n\t\t\t\t\t\tec.Emit (OpCodes.Box, ctch.type);\n\t\t\t\t}\n\n\t\t\t\tvar expr_start = ec.DefineLabel ();\n\t\t\t\tvar end = ec.DefineLabel ();\n\n\t\t\t\tec.Emit (OpCodes.Brtrue_S, expr_start);\n\t\t\t\tec.EmitInt (0);\n\t\t\t\tec.Emit (OpCodes.Br, end);\n\t\t\t\tec.MarkLabel (expr_start);\n\n\t\t\t\tctch.Filter.Emit (ec);\n\n\t\t\t\tec.MarkLabel (end);\n\t\t\t\tec.Emit (OpCodes.Endfilter);\n\t\t\t\tec.BeginFilterHandler ();\n\t\t\t\tec.Emit (OpCodes.Pop);\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\tctch.Filter.FlowAnalysis (fc);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override bool Resolve (BlockContext bc)\n\t\t\t{\n\t\t\t\tctch.Filter = ctch.Filter.Resolve (bc);\n\n\t\t\t\tif (ctch.Filter != null) {\n\t\t\t\t\tif (ctch.Filter.ContainsEmitWithAwait ()) {\n\t\t\t\t\t\tbc.Report.Error (7094, ctch.Filter.Location, \"The `await' operator cannot be used in the filter expression of a catch clause\");\n\t\t\t\t\t}\n\n\t\t\t\t\tvar c = ctch.Filter as Constant;\n\t\t\t\t\tif (c != null && !c.IsDefaultValue) {\n\t\t\t\t\t\tbc.Report.Warning (7095, 1, ctch.Filter.Location, \"Exception filter expression is a constant\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tExplicitBlock block;\n\t\tLocalVariable li;\n\t\tFullNamedExpression type_expr;\n\t\tCompilerAssign assign;\n\t\tTypeSpec type;\n\t\tLocalTemporary hoisted_temp;\n\n\t\tpublic Catch (ExplicitBlock block, Location loc)\n\t\t{\n\t\t\tthis.block = block;\n\t\t\tthis.loc = loc;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic ExplicitBlock Block {\n\t\t\tget {\n\t\t\t\treturn block;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec CatchType {\n\t\t\tget {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\n\t\tpublic Expression Filter {\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic bool IsGeneral {\n\t\t\tget {\n\t\t\t\treturn type_expr == null;\n\t\t\t}\n\t\t}\n\n\t\tpublic FullNamedExpression TypeExpression {\n\t\t\tget {\n\t\t\t\treturn type_expr;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttype_expr = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic LocalVariable Variable {\n\t\t\tget {\n\t\t\t\treturn li;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tli = value;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (Filter != null) {\n\t\t\t\tec.BeginExceptionFilterBlock ();\n\t\t\t\tec.Emit (OpCodes.Isinst, IsGeneral ? ec.BuiltinTypes.Object : CatchType);\n\n\t\t\t\tif (li != null)\n\t\t\t\t\tEmitCatchVariableStore (ec);\n\n\t\t\t\tif (Block.HasAwait) {\n\t\t\t\t\tBlock.EmitScopeInitialization (ec);\n\t\t\t\t} else {\n\t\t\t\t\tBlock.Emit (ec);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (IsGeneral)\n\t\t\t\tec.BeginCatchBlock (ec.BuiltinTypes.Object);\n\t\t\telse\n\t\t\t\tec.BeginCatchBlock (CatchType);\n\n\t\t\tif (li != null) {\n\t\t\t\tEmitCatchVariableStore (ec);\n\t\t\t} else {\n\t\t\t\tec.Emit (OpCodes.Pop);\n\t\t\t}\n\n\t\t\tif (!Block.HasAwait)\n\t\t\t\tBlock.Emit (ec);\n\t\t}\n\n\t\tvoid EmitCatchVariableStore (EmitContext ec)\n\t\t{\n\t\t\tli.CreateBuilder (ec);\n\n\t\t\t//\n\t\t\t// Special case hoisted catch variable, we have to use a temporary variable\n\t\t\t// to pass via anonymous storey initialization with the value still on top\n\t\t\t// of the stack\n\t\t\t//\n\t\t\tif (li.HoistedVariant != null) {\n\t\t\t\thoisted_temp = new LocalTemporary (li.Type);\n\t\t\t\thoisted_temp.Store (ec);\n\n\t\t\t\t// switch to assignment from temporary variable and not from top of the stack\n\t\t\t\tassign.UpdateSource (hoisted_temp);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tusing (bc.Set (ResolveContext.Options.CatchScope)) {\n\t\t\t\tif (type_expr == null) {\n\t\t\t\t\tif (CreateExceptionVariable (bc.Module.Compiler.BuiltinTypes.Object)) {\n\t\t\t\t\t\tExpression source = new EmptyExpression (li.Type);\n\t\t\t\t\t\tassign = new CompilerAssign (new LocalVariableReference (li, Location.Null), source, Location.Null);\n\t\t\t\t\t\tBlock.AddScopeStatement (new StatementExpression (assign, Location.Null));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttype = type_expr.ResolveAsType (bc);\n\t\t\t\t\tif (type == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tif (li == null)\n\t\t\t\t\t\tCreateExceptionVariable (type);\n\n\t\t\t\t\tif (type.BuiltinType != BuiltinTypeSpec.Type.Exception && !TypeSpec.IsBaseClass (type, bc.BuiltinTypes.Exception, false)) {\n\t\t\t\t\t\tbc.Report.Error (155, loc, \"The type caught or thrown must be derived from System.Exception\");\n\t\t\t\t\t} else if (li != null) {\n\t\t\t\t\t\tli.Type = type;\n\t\t\t\t\t\tli.PrepareAssignmentAnalysis (bc);\n\n\t\t\t\t\t\t// source variable is at the top of the stack\n\t\t\t\t\t\tExpression source = new EmptyExpression (li.Type);\n\t\t\t\t\t\tif (li.Type.IsGenericParameter)\n\t\t\t\t\t\t\tsource = new UnboxCast (source, li.Type);\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Uses Location.Null to hide from symbol file\n\t\t\t\t\t\t//\n\t\t\t\t\t\tassign = new CompilerAssign (new LocalVariableReference (li, Location.Null), source, Location.Null);\n\t\t\t\t\t\tBlock.AddScopeStatement (new StatementExpression (assign, Location.Null));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (Filter != null) {\n\t\t\t\t\tBlock.AddScopeStatement (new FilterStatement (this));\n\t\t\t\t}\n\n\t\t\t\tBlock.SetCatchBlock ();\n\t\t\t\treturn Block.Resolve (bc);\n\t\t\t}\n\t\t}\n\n\t\tbool CreateExceptionVariable (TypeSpec type)\n\t\t{\n\t\t\tif (!Block.HasAwait)\n\t\t\t\treturn false;\n\n\t\t\t// TODO: Scan the block for rethrow expression\n\t\t\t//if (!Block.HasRethrow)\n\t\t\t//\treturn;\n\n\t\t\tli = LocalVariable.CreateCompilerGenerated (type, block, Location.Null);\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tif (li != null && !li.IsCompilerGenerated) {\n\t\t\t\tfc.SetVariableAssigned (li.VariableInfo, true);\n\t\t\t}\n\n\t\t\treturn block.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tvar c = Filter as Constant;\n\t\t\tif (c != null && c.IsDefaultValue)\n\t\t\t\treturn Reachability.CreateUnreachable ();\n\n\t\t\treturn block.MarkReachable (rc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tCatch target = (Catch) t;\n\n\t\t\tif (type_expr != null)\n\t\t\t\ttarget.type_expr = (FullNamedExpression) type_expr.Clone (clonectx);\n\n\t\t\tif (Filter != null)\n\t\t\t\ttarget.Filter = Filter.Clone (clonectx);\n\n\t\t\ttarget.block = (ExplicitBlock) clonectx.LookupBlock (block);\n\t\t}\n\t}\n\n\tpublic class TryFinally : TryFinallyBlock\n\t{\n\t\tExplicitBlock fini;\n\t\tList<DefiniteAssignmentBitSet> try_exit_dat;\n\t\tList<Label> redirected_jumps;\n\t\tLabel? start_fin_label;\n\n\t\tpublic Statement Stmt {\n\t\t\tget { return this.stmt; }\n\t\t}\n\n\t\tpublic ExplicitBlock Fini {\n\t\t\tget { return this.fini; }\n\t\t}\n\n\t\tpublic TryFinally (Statement stmt, ExplicitBlock fini, Location loc)\n\t\t\t : base (stmt, loc)\n\t\t{\n\t\t\tthis.fini = fini;\n\t\t}\n\n\t\tpublic ExplicitBlock FinallyBlock {\n\t\t\tget {\n \t\t\t\treturn fini;\n\t\t\t}\n\t\t}\n\n\t\tpublic void RegisterForControlExitCheck (DefiniteAssignmentBitSet vector)\n\t\t{\n\t\t\tif (try_exit_dat == null)\n\t\t\t\ttry_exit_dat = new List<DefiniteAssignmentBitSet> ();\n\n\t\t\ttry_exit_dat.Add (vector);\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tbool ok = base.Resolve (bc);\n\n\t\t\tfini.SetFinallyBlock ();\n\t\t\tusing (bc.Set (ResolveContext.Options.FinallyScope)) {\n\t\t\t\tok &= fini.Resolve (bc);\n\t\t\t}\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tprotected override void EmitTryBody (EmitContext ec)\n\t\t{\n\t\t\tif (fini.HasAwait) {\n\t\t\t\tif (ec.TryFinallyUnwind == null)\n\t\t\t\t\tec.TryFinallyUnwind = new List<TryFinally> ();\n\n\t\t\t\tec.TryFinallyUnwind.Add (this);\n\t\t\t\tstmt.Emit (ec);\n\t\t\t\tec.TryFinallyUnwind.Remove (this);\n\n\t\t\t\tif (start_fin_label != null)\n\t\t\t\t\tec.MarkLabel (start_fin_label.Value);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstmt.Emit (ec);\n\t\t}\n\n\t\tprotected override bool EmitBeginFinallyBlock (EmitContext ec)\n\t\t{\n\t\t\tif (fini.HasAwait)\n\t\t\t\treturn false;\n\n\t\t\treturn base.EmitBeginFinallyBlock (ec);\n\t\t}\n\n\t\tpublic override void EmitFinallyBody (EmitContext ec)\n\t\t{\n\t\t\tif (!fini.HasAwait) {\n\t\t\t\tfini.Emit (ec);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Emits catch block like\n\t\t\t//\n\t\t\t// catch (object temp) {\n\t\t\t//\tthis.exception_field = temp;\n\t\t\t// }\n\t\t\t//\n\t\t\tvar type = ec.BuiltinTypes.Object;\n\t\t\tec.BeginCatchBlock (type);\n\n\t\t\tvar temp = ec.GetTemporaryLocal (type);\n\t\t\tec.Emit (OpCodes.Stloc, temp);\n\n\t\t\tvar exception_field = ec.GetTemporaryField (type);\n\t\t\tec.EmitThis ();\n\t\t\tec.Emit (OpCodes.Ldloc, temp);\n\t\t\texception_field.EmitAssignFromStack (ec);\n\n\t\t\tec.EndExceptionBlock ();\n\n\t\t\tec.FreeTemporaryLocal (temp, type);\n\n\t\t\tfini.Emit (ec);\n\n\t\t\t//\n\t\t\t// Emits exception rethrow\n\t\t\t//\n\t\t\t// if (this.exception_field != null)\n\t\t\t//\tthrow this.exception_field;\n\t\t\t//\n\t\t\texception_field.Emit (ec);\n\t\t\tvar skip_throw = ec.DefineLabel ();\n\t\t\tec.Emit (OpCodes.Brfalse_S, skip_throw);\n\t\t\texception_field.Emit (ec);\n\t\t\tec.Emit (OpCodes.Throw);\n\t\t\tec.MarkLabel (skip_throw);\n\n\t\t\texception_field.IsAvailableForReuse = true;\n\n\t\t\tEmitUnwindFinallyTable (ec);\n\t\t}\n\n\t\tbool IsParentBlock (Block block)\n\t\t{\n\t\t\tfor (Block b = fini; b != null; b = b.Parent) {\n\t\t\t\tif (b == block)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static Label EmitRedirectedJump (EmitContext ec, AsyncInitializer initializer, Label label, Block labelBlock)\n\t\t{\n\t\t\tint idx;\n\t\t\tif (labelBlock != null) {\n\t\t\t\tfor (idx = ec.TryFinallyUnwind.Count; idx != 0; --idx) {\n\t\t\t\t\tvar fin = ec.TryFinallyUnwind [idx - 1];\n\t\t\t\t\tif (!fin.IsParentBlock (labelBlock))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tidx = 0;\n\t\t\t}\n\n\t\t\tbool set_return_state = true;\n\n\t\t\tfor (; idx < ec.TryFinallyUnwind.Count; ++idx) {\n\t\t\t\tvar fin = ec.TryFinallyUnwind [idx];\n\t\t\t\tif (labelBlock != null && !fin.IsParentBlock (labelBlock))\n\t\t\t\t\tbreak;\n\n\t\t\t\tfin.EmitRedirectedExit (ec, label, initializer, set_return_state);\n\t\t\t\tset_return_state = false;\n\n\t\t\t\tif (fin.start_fin_label == null) {\n\t\t\t\t\tfin.start_fin_label = ec.DefineLabel ();\n\t\t\t\t}\n\n\t\t\t\tlabel = fin.start_fin_label.Value;\n\t\t\t}\n\n\t\t\treturn label;\n\t\t}\n\n\t\tpublic static Label EmitRedirectedReturn (EmitContext ec, AsyncInitializer initializer)\n\t\t{\n\t\t\treturn EmitRedirectedJump (ec, initializer, initializer.BodyEnd, null);\n\t\t}\n\n\t\tvoid EmitRedirectedExit (EmitContext ec, Label label, AsyncInitializer initializer, bool setReturnState)\n\t\t{\n\t\t\tif (redirected_jumps == null) {\n\t\t\t\tredirected_jumps = new List<Label> ();\n\n\t\t\t\t// Add fallthrough label\n\t\t\t\tredirected_jumps.Add (ec.DefineLabel ());\n\n\t\t\t\tif (setReturnState)\n\t\t\t\t\tinitializer.HoistedReturnState = ec.GetTemporaryField (ec.Module.Compiler.BuiltinTypes.Int, true);\n\t\t\t}\n\n\t\t\tint index = redirected_jumps.IndexOf (label);\n\t\t\tif (index < 0) {\n\t\t\t\tredirected_jumps.Add (label);\n\t\t\t\tindex = redirected_jumps.Count - 1;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Indicates we have captured exit jump\n\t\t\t//\n\t\t\tif (setReturnState) {\n\t\t\t\tvar value = new IntConstant (initializer.HoistedReturnState.Type, index, Location.Null);\n\t\t\t\tinitializer.HoistedReturnState.EmitAssign (ec, value, false, false);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Emits state table of jumps outside of try block and reload of return\n\t\t// value when try block returns value\n\t\t//\n\t\tvoid EmitUnwindFinallyTable (EmitContext ec)\n\t\t{\n\t\t\tif (redirected_jumps == null)\n\t\t\t\treturn;\n\n\t\t\tvar initializer = (AsyncInitializer)ec.CurrentAnonymousMethod;\n\t\t\tinitializer.HoistedReturnState.EmitLoad (ec);\n\t\t\tec.Emit (OpCodes.Switch, redirected_jumps.ToArray ());\n\n\t\t\t// Mark fallthrough label\n\t\t\tec.MarkLabel (redirected_jumps [0]);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tvar da = fc.BranchDefiniteAssignment ();\n\n\t\t\tvar tf = fc.TryFinally;\n\t\t\tfc.TryFinally = this;\n\n\t\t\tvar res_stmt = Statement.FlowAnalysis (fc);\n\n\t\t\tfc.TryFinally = tf;\n\n\t\t\tvar try_da = fc.DefiniteAssignment;\n\t\t\tfc.DefiniteAssignment = da;\n\n\t\t\tvar res_fin = fini.FlowAnalysis (fc);\n\n\t\t\tif (try_exit_dat != null) {\n\t\t\t\t//\n\t\t\t\t// try block has global exit but we need to run definite assignment check\n\t\t\t\t// for parameter block out parameter after finally block because it's always\n\t\t\t\t// executed before exit\n\t\t\t\t//\n\t\t\t\tforeach (var try_da_part in try_exit_dat)\n\t\t\t\t\tfc.ParametersBlock.CheckControlExit (fc, fc.DefiniteAssignment | try_da_part);\n\n\t\t\t\ttry_exit_dat = null;\n\t\t\t}\n\n\t\t\tfc.DefiniteAssignment |= try_da;\n\t\t\treturn res_stmt | res_fin;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\t//\n\t\t\t// Mark finally block first for any exit statement in try block\n\t\t\t// to know whether the code which follows finally is reachable\n\t\t\t//\n\t\t\treturn fini.MarkReachable (rc) | base.MarkReachable (rc);\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tTryFinally target = (TryFinally) t;\n\n\t\t\ttarget.stmt = stmt.Clone (clonectx);\n\t\t\tif (fini != null)\n\t\t\t\ttarget.fini = (ExplicitBlock) clonectx.LookupBlock (fini);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class TryCatch : ExceptionStatement\n\t{\n\t\tpublic Block Block;\n\t\tList<Catch> clauses;\n\t\treadonly bool inside_try_finally;\n\t\tList<Catch> catch_sm;\n\n\t\tpublic TryCatch (Block block, List<Catch> catch_clauses, Location l, bool inside_try_finally)\n\t\t\t: base (l)\n\t\t{\n\t\t\tthis.Block = block;\n\t\t\tthis.clauses = catch_clauses;\n\t\t\tthis.inside_try_finally = inside_try_finally;\n\t\t}\n\n\t\tpublic List<Catch> Clauses {\n\t\t\tget {\n\t\t\t\treturn clauses;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsTryCatchFinally {\n\t\t\tget {\n\t\t\t\treturn inside_try_finally;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext bc)\n\t\t{\n\t\t\tbool ok;\n\n\t\t\tusing (bc.Set (ResolveContext.Options.TryScope)) {\n\t\t\t\tparent = bc.CurrentTryBlock;\n\n\t\t\t\tif (IsTryCatchFinally) {\n\t\t\t\t\tok = Block.Resolve (bc);\n\t\t\t\t} else {\n\t\t\t\t\tusing (bc.Set (ResolveContext.Options.TryWithCatchScope)) {\n\t\t\t\t\t\tbc.CurrentTryBlock = this;\n\t\t\t\t\t\tok = Block.Resolve (bc);\n\t\t\t\t\t\tbc.CurrentTryBlock = parent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < clauses.Count; ++i) {\n\t\t\t\tvar c = clauses[i];\n\n\t\t\t\tok &= c.Resolve (bc);\n\n\t\t\t\tif (c.Block.HasAwait) {\n\t\t\t\t\tif (catch_sm == null)\n\t\t\t\t\t\tcatch_sm = new List<Catch> ();\n\n\t\t\t\t\tcatch_sm.Add (c);\n\t\t\t\t}\n\n\t\t\t\tif (c.Filter != null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tTypeSpec resolved_type = c.CatchType;\n\t\t\t\tif (resolved_type == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfor (int ii = 0; ii < clauses.Count; ++ii) {\n\t\t\t\t\tif (ii == i)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (clauses[ii].Filter != null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (clauses[ii].IsGeneral) {\n\t\t\t\t\t\tif (resolved_type.BuiltinType != BuiltinTypeSpec.Type.Exception)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!bc.Module.DeclaringAssembly.WrapNonExceptionThrows)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (!bc.Module.PredefinedAttributes.RuntimeCompatibility.IsDefined)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tbc.Report.Warning (1058, 1, c.loc,\n\t\t\t\t\t\t\t\"A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a `System.Runtime.CompilerServices.RuntimeWrappedException'\");\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ii >= i)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar ct = clauses[ii].CatchType;\n\t\t\t\t\tif (ct == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (resolved_type == ct || TypeSpec.IsBaseClass (resolved_type, ct, true)) {\n\t\t\t\t\t\tbc.Report.Error (160, c.loc,\n\t\t\t\t\t\t\t\"A previous catch clause already catches all exceptions of this or a super type `{0}'\",\n\t\t\t\t\t\t\tct.GetSignatureForError ());\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn base.Resolve (bc) && ok;\n\t\t}\n\n\t\tprotected sealed override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tif (!inside_try_finally)\n\t\t\t\tEmitTryBodyPrepare (ec);\n\n\t\t\tBlock.Emit (ec);\n\n\t\t\tLocalBuilder state_variable = null;\n\t\t\tforeach (Catch c in clauses) {\n\t\t\t\tc.Emit (ec);\n\n\t\t\t\tif (catch_sm != null) {\n\t\t\t\t\tif (state_variable == null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Cannot reuse temp variable because non-catch path assumes the value is 0\n\t\t\t\t\t\t// which may not be true for reused local variable\n\t\t\t\t\t\t//\n\t\t\t\t\t\tstate_variable = ec.DeclareLocal (ec.Module.Compiler.BuiltinTypes.Int, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar index = catch_sm.IndexOf (c);\n\t\t\t\t\tif (index < 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tec.EmitInt (index + 1);\n\t\t\t\t\tec.Emit (OpCodes.Stloc, state_variable);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!inside_try_finally)\n\t\t\t\tec.EndExceptionBlock ();\n\n\t\t\tif (state_variable != null) {\n\t\t\t\tec.Emit (OpCodes.Ldloc, state_variable);\n\n\t\t\t\tvar labels = new Label [catch_sm.Count + 1];\n\t\t\t\tfor (int i = 0; i < labels.Length; ++i) {\n\t\t\t\t\tlabels [i] = ec.DefineLabel ();\n\t\t\t\t}\n\n\t\t\t\tvar end = ec.DefineLabel ();\n\t\t\t\tec.Emit (OpCodes.Switch, labels);\n\n\t\t\t\t// 0 value is default label\n\t\t\t\tec.MarkLabel (labels [0]);\n\t\t\t\tec.Emit (OpCodes.Br, end);\n\n\t\t\t\tvar atv = ec.AsyncThrowVariable;\n\t\t\t\tCatch c = null;\n\t\t\t\tfor (int i = 0; i < catch_sm.Count; ++i) {\n\t\t\t\t\tif (c != null && c.Block.HasReachableClosingBrace)\n\t\t\t\t\t\tec.Emit (OpCodes.Br, end);\n\n\t\t\t\t\tec.MarkLabel (labels [i + 1]);\n\t\t\t\t\tc = catch_sm [i];\n\t\t\t\t\tec.AsyncThrowVariable = c.Variable;\n\t\t\t\t\tc.Block.Emit (ec);\n\t\t\t\t}\n\t\t\t\tec.AsyncThrowVariable = atv;\n\n\t\t\t\tec.MarkLabel (end);\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tvar start_fc = fc.BranchDefiniteAssignment ();\n\t\t\tvar res = Block.FlowAnalysis (fc);\n\n\t\t\tDefiniteAssignmentBitSet try_fc = res ? null : fc.DefiniteAssignment;\n\n\t\t\tforeach (var c in clauses) {\n\t\t\t\tfc.DefiniteAssignment = new DefiniteAssignmentBitSet (start_fc);\n\t\t\t\tif (!c.FlowAnalysis (fc)) {\n\t\t\t\t\tif (try_fc == null)\n\t\t\t\t\t\ttry_fc = fc.DefiniteAssignment;\n\t\t\t\t\telse\n\t\t\t\t\t\ttry_fc &= fc.DefiniteAssignment;\n\n\t\t\t\t\tres = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfc.DefiniteAssignment = try_fc ?? start_fc;\n\t\t\tparent = null;\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tif (rc.IsUnreachable)\n\t\t\t\treturn rc;\n\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tvar tc_rc = Block.MarkReachable (rc);\n\n\t\t\tforeach (var c in clauses)\n\t\t\t\ttc_rc &= c.MarkReachable (rc);\n\n\t\t\treturn tc_rc;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tTryCatch target = (TryCatch) t;\n\n\t\t\ttarget.Block = clonectx.LookupBlock (Block);\n\t\t\tif (clauses != null){\n\t\t\t\ttarget.clauses = new List<Catch> ();\n\t\t\t\tforeach (Catch c in clauses)\n\t\t\t\t\ttarget.clauses.Add ((Catch) c.Clone (clonectx));\n\t\t\t}\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\tpublic class Using : TryFinallyBlock\n\t{\n\t\tpublic class VariableDeclaration : BlockVariable\n\t\t{\n\t\t\tStatement dispose_call;\n\n\t\t\tpublic VariableDeclaration (FullNamedExpression type, LocalVariable li)\n\t\t\t\t: base (type, li)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic VariableDeclaration (LocalVariable li, Location loc)\n\t\t\t\t: base (li)\n\t\t\t{\n\t\t\t\treachable = true;\n\t\t\t\tthis.loc = loc;\n\t\t\t}\n\n\t\t\tpublic VariableDeclaration (Expression expr)\n\t\t\t\t: base (null)\n\t\t\t{\n\t\t\t\tloc = expr.Location;\n\t\t\t\tInitializer = expr;\n\t\t\t}\n\n\t\t\t#region Properties\n\n\t\t\tpublic bool IsNested { get; private set; }\n\n\t\t\t#endregion\n\n\t\t\tpublic void EmitDispose (EmitContext ec)\n\t\t\t{\n\t\t\t\tdispose_call.Emit (ec);\n\t\t\t}\n\n\t\t\tpublic override bool Resolve (BlockContext bc)\n\t\t\t{\n\t\t\t\tif (IsNested)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn base.Resolve (bc, false);\n\t\t\t}\n\n\t\t\tpublic Expression ResolveExpression (BlockContext bc)\n\t\t\t{\n\t\t\t\tvar e = Initializer.Resolve (bc);\n\t\t\t\tif (e == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tli = LocalVariable.CreateCompilerGenerated (e.Type, bc.CurrentBlock, loc);\n\t\t\t\tInitializer = ResolveInitializer (bc, Variable, e);\n\t\t\t\treturn e;\n\t\t\t}\n\n\t\t\tprotected override Expression ResolveInitializer (BlockContext bc, LocalVariable li, Expression initializer)\n\t\t\t{\n\t\t\t\tif (li.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {\n\t\t\t\t\tinitializer = initializer.Resolve (bc);\n\t\t\t\t\tif (initializer == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t// Once there is dynamic used defer conversion to runtime even if we know it will never succeed\n\t\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\t\targs.Add (new Argument (initializer));\n\t\t\t\t\tinitializer = new DynamicConversion (bc.BuiltinTypes.IDisposable, 0, args, initializer.Location).Resolve (bc);\n\t\t\t\t\tif (initializer == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tvar var = LocalVariable.CreateCompilerGenerated (initializer.Type, bc.CurrentBlock, loc);\n\t\t\t\t\tdispose_call = CreateDisposeCall (bc, var);\n\t\t\t\t\tdispose_call.Resolve (bc);\n\n\t\t\t\t\treturn base.ResolveInitializer (bc, li, new SimpleAssign (var.CreateReferenceExpression (bc, loc), initializer, loc));\n\t\t\t\t}\n\n\t\t\t\tif (li == Variable) {\n\t\t\t\t\tCheckIDiposableConversion (bc, li, initializer);\n\t\t\t\t\tdispose_call = CreateDisposeCall (bc, li);\n\t\t\t\t\tdispose_call.Resolve (bc);\n\t\t\t\t}\n\n\t\t\t\treturn base.ResolveInitializer (bc, li, initializer);\n\t\t\t}\n\n\t\t\tprotected virtual void CheckIDiposableConversion (BlockContext bc, LocalVariable li, Expression initializer)\n\t\t\t{\n\t\t\t\tvar type = li.Type;\n\n\t\t\t\tif (type.BuiltinType != BuiltinTypeSpec.Type.IDisposable && !CanConvertToIDisposable (bc, type)) {\n\t\t\t\t\tif (type.IsNullableType) {\n\t\t\t\t\t\t// it's handled in CreateDisposeCall\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (type != InternalType.ErrorType) {\n\t\t\t\t\t\tbc.Report.SymbolRelatedToPreviousError (type);\n\t\t\t\t\t\tvar loc = type_expr == null ? initializer.Location : type_expr.Location;\n\t\t\t\t\t\tbc.Report.Error (1674, loc, \"`{0}': type used in a using statement must be implicitly convertible to `System.IDisposable'\",\n\t\t\t\t\t\t\ttype.GetSignatureForError ());\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic bool CanConvertToIDisposable (BlockContext bc, TypeSpec type)\n\t\t\t{\n\t\t\t\tvar target = bc.BuiltinTypes.IDisposable;\n\t\t\t\tvar tp = type as TypeParameterSpec;\n\t\t\t\tif (tp != null)\n\t\t\t\t\treturn Convert.ImplicitTypeParameterConversion (null, tp, target) != null;\n\n\t\t\t\treturn type.ImplementsInterface (target, false);\n\t\t\t}\n\n\t\t\tprotected virtual Statement CreateDisposeCall (BlockContext bc, LocalVariable lv)\n\t\t\t{\n\t\t\t\tvar lvr = lv.CreateReferenceExpression (bc, lv.Location);\n\t\t\t\tvar type = lv.Type;\n\t\t\t\tvar loc = lv.Location;\n\n\t\t\t\tvar idt = bc.BuiltinTypes.IDisposable;\n\t\t\t\tvar m = bc.Module.PredefinedMembers.IDisposableDispose.Resolve (loc);\n\n\t\t\t\tvar dispose_mg = MethodGroupExpr.CreatePredefined (m, idt, loc);\n\t\t\t\tdispose_mg.InstanceExpression = type.IsNullableType ?\n\t\t\t\t\tnew Cast (new TypeExpression (idt, loc), lvr, loc).Resolve (bc) :\n\t\t\t\t\tlvr;\n\n\t\t\t\t//\n\t\t\t\t// Hide it from symbol file via null location\n\t\t\t\t//\n\t\t\t\tStatement dispose = new StatementExpression (new Invocation (dispose_mg, null), Location.Null);\n\n\t\t\t\t// Add conditional call when disposing possible null variable\n\t\t\t\tif (!TypeSpec.IsValueType (type) || type.IsNullableType)\n\t\t\t\t\tdispose = new If (new Binary (Binary.Operator.Inequality, lvr, new NullLiteral (loc)), dispose, dispose.loc);\n\n\t\t\t\treturn dispose;\n\t\t\t}\n\n\t\t\tpublic void ResolveDeclaratorInitializer (BlockContext bc)\n\t\t\t{\n\t\t\t\tInitializer = base.ResolveInitializer (bc, Variable, Initializer);\n\t\t\t}\n\n\t\t\tpublic Statement RewriteUsingDeclarators (BlockContext bc, Statement stmt)\n\t\t\t{\n\t\t\t\tfor (int i = declarators.Count - 1; i >= 0; --i) {\n\t\t\t\t\tvar d = declarators [i];\n\t\t\t\t\tvar vd = new VariableDeclaration (d.Variable, d.Variable.Location);\n\t\t\t\t\tvd.Initializer = d.Initializer;\n\t\t\t\t\tvd.IsNested = true;\n\t\t\t\t\tvd.dispose_call = CreateDisposeCall (bc, d.Variable);\n\t\t\t\t\tvd.dispose_call.Resolve (bc);\n\n\t\t\t\t\tstmt = new Using (vd, stmt, d.Variable.Location);\n\t\t\t\t}\n\n\t\t\t\tdeclarators = null;\n\t\t\t\treturn stmt;\n\t\t\t}\t\n\n\t\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t\t{\n\t\t\t\treturn visitor.Visit (this);\n\t\t\t}\t\n\t\t}\n\n\t\tVariableDeclaration decl;\n\n\t\tpublic Using (VariableDeclaration decl, Statement stmt, Location loc)\n\t\t\t: base (stmt, loc)\n\t\t{\n\t\t\tthis.decl = decl;\n\t\t}\n\n\t\tpublic Using (Expression expr, Statement stmt, Location loc)\n\t\t\t: base (stmt, loc)\n\t\t{\n\t\t\tthis.decl = new VariableDeclaration (expr);\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic Expression Expr {\n\t\t\tget {\n\t\t\t\treturn decl.Variable == null ? decl.Initializer : null;\n\t\t\t}\n\t\t}\n\n\t\tpublic BlockVariable Variables {\n\t\t\tget {\n\t\t\t\treturn decl;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override void Emit (EmitContext ec)\n\t\t{\n\t\t\t//\n\t\t\t// Don't emit sequence point it will be set on variable declaration\n\t\t\t//\n\t\t\tDoEmit (ec);\n\t\t}\n\n\t\tprotected override void EmitTryBodyPrepare (EmitContext ec)\n\t\t{\n\t\t\tdecl.Emit (ec);\n\t\t\tbase.EmitTryBodyPrepare (ec);\n\t\t}\n\n\t\tprotected override void EmitTryBody (EmitContext ec)\n\t\t{\n\t\t\tstmt.Emit (ec);\n\t\t}\n\n\t\tpublic override void EmitFinallyBody (EmitContext ec)\n\t\t{\n\t\t\tdecl.EmitDispose (ec);\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\tdecl.FlowAnalysis (fc);\n\t\t\treturn stmt.FlowAnalysis (fc);\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tdecl.MarkReachable (rc);\n\t\t\treturn base.MarkReachable (rc);\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\tVariableReference vr;\n\t\t\tbool vr_locked = false;\n\n\t\t\tusing (ec.Set (ResolveContext.Options.UsingInitializerScope)) {\n\t\t\t\tif (decl.Variable == null) {\n\t\t\t\t\tvr = decl.ResolveExpression (ec) as VariableReference;\n\t\t\t\t\tif (vr != null) {\n\t\t\t\t\t\tvr_locked = vr.IsLockedByStatement;\n\t\t\t\t\t\tvr.IsLockedByStatement = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (decl.IsNested) {\n\t\t\t\t\t\tdecl.ResolveDeclaratorInitializer (ec);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!decl.Resolve (ec))\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tif (decl.Declarators != null) {\n\t\t\t\t\t\t\tstmt = decl.RewriteUsingDeclarators (ec, stmt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvr = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar ok = base.Resolve (ec);\n\n\t\t\tif (vr != null)\n\t\t\t\tvr.IsLockedByStatement = vr_locked;\n\n\t\t\treturn ok;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tUsing target = (Using) t;\n\n\t\t\ttarget.decl = (VariableDeclaration) decl.Clone (clonectx);\n\t\t\ttarget.stmt = stmt.Clone (clonectx);\n\t\t}\n\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   Implementation of the foreach C# statement\n\t/// </summary>\n\tpublic class Foreach : LoopStatement\n\t{\n\t\tabstract class IteratorStatement : Statement\n\t\t{\n\t\t\tprotected readonly Foreach for_each;\n\n\t\t\tprotected IteratorStatement (Foreach @foreach)\n\t\t\t{\n\t\t\t\tthis.for_each = @foreach;\n\t\t\t\tthis.loc = @foreach.expr.Location;\n\t\t\t}\n\n\t\t\tprotected override void CloneTo (CloneContext clonectx, Statement target)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\n\t\t\tpublic override void Emit (EmitContext ec)\n\t\t\t{\n\t\t\t\tif (ec.EmitAccurateDebugInfo) {\n\t\t\t\t\tec.Emit (OpCodes.Nop);\n\t\t\t\t}\n\n\t\t\t\tbase.Emit (ec);\n\t\t\t}\n\n\t\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tsealed class ArrayForeach : IteratorStatement\n\t\t{\n\t\t\tTemporaryVariableReference[] lengths;\n\t\t\tExpression [] length_exprs;\n\t\t\tStatementExpression[] counter;\n\t\t\tTemporaryVariableReference[] variables;\n\n\t\t\tTemporaryVariableReference copy;\n\n\t\t\tpublic ArrayForeach (Foreach @foreach, int rank)\n\t\t\t\t: base (@foreach)\n\t\t\t{\n\t\t\t\tcounter = new StatementExpression[rank];\n\t\t\t\tvariables = new TemporaryVariableReference[rank];\n\t\t\t\tlength_exprs = new Expression [rank];\n\n\t\t\t\t//\n\t\t\t\t// Only use temporary length variables when dealing with\n\t\t\t\t// multi-dimensional arrays\n\t\t\t\t//\n\t\t\t\tif (rank > 1)\n\t\t\t\t\tlengths = new TemporaryVariableReference [rank];\n\t\t\t}\n\n\t\t\tpublic override bool Resolve (BlockContext ec)\n\t\t\t{\n\t\t\t\tBlock variables_block = for_each.variable.Block;\n\t\t\t\tcopy = TemporaryVariableReference.Create (for_each.expr.Type, variables_block, loc);\n\t\t\t\tcopy.Resolve (ec);\n\n\t\t\t\tint rank = length_exprs.Length;\n\t\t\t\tArguments list = new Arguments (rank);\n\t\t\t\tfor (int i = 0; i < rank; i++) {\n\t\t\t\t\tvar v = TemporaryVariableReference.Create (ec.BuiltinTypes.Int, variables_block, loc);\n\t\t\t\t\tvariables[i] = v;\n\t\t\t\t\tcounter[i] = new StatementExpression (new UnaryMutator (UnaryMutator.Mode.PostIncrement, v, Location.Null));\n\t\t\t\t\tcounter[i].Resolve (ec);\n\n\t\t\t\t\tif (rank == 1) {\n\t\t\t\t\t\tlength_exprs [i] = new MemberAccess (copy, \"Length\").Resolve (ec);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlengths[i] = TemporaryVariableReference.Create (ec.BuiltinTypes.Int, variables_block, loc);\n\t\t\t\t\t\tlengths[i].Resolve (ec);\n\n\t\t\t\t\t\tArguments args = new Arguments (1);\n\t\t\t\t\t\targs.Add (new Argument (new IntConstant (ec.BuiltinTypes, i, loc)));\n\t\t\t\t\t\tlength_exprs [i] = new Invocation (new MemberAccess (copy, \"GetLength\"), args).Resolve (ec);\n\t\t\t\t\t}\n\n\t\t\t\t\tlist.Add (new Argument (v));\n\t\t\t\t}\n\n\t\t\t\tvar access = new ElementAccess (copy, list, loc).Resolve (ec);\n\t\t\t\tif (access == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tTypeSpec var_type;\n\t\t\t\tif (for_each.type is VarExpr) {\n\t\t\t\t\t// Infer implicitly typed local variable from foreach array type\n\t\t\t\t\tvar_type = access.Type;\n\t\t\t\t} else {\n\t\t\t\t\tvar_type = for_each.type.ResolveAsType (ec);\n\n\t\t\t\t\tif (var_type == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\taccess = Convert.ExplicitConversion (ec, access, var_type, loc);\n\t\t\t\t\tif (access == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tfor_each.variable.Type = var_type;\n\n\t\t\t\tvar variable_ref = new LocalVariableReference (for_each.variable, loc).Resolve (ec);\n\t\t\t\tif (variable_ref == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfor_each.body.AddScopeStatement (new StatementExpression (new CompilerAssign (variable_ref, access, Location.Null), for_each.type.Location));\n\n\t\t\t\treturn for_each.body.Resolve (ec);\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\tcopy.EmitAssign (ec, for_each.expr);\n\n\t\t\t\tint rank = length_exprs.Length;\n\t\t\t\tLabel[] test = new Label [rank];\n\t\t\t\tLabel[] loop = new Label [rank];\n\n\t\t\t\tfor (int i = 0; i < rank; i++) {\n\t\t\t\t\ttest [i] = ec.DefineLabel ();\n\t\t\t\t\tloop [i] = ec.DefineLabel ();\n\n\t\t\t\t\tif (lengths != null)\n\t\t\t\t\t\tlengths [i].EmitAssign (ec, length_exprs [i]);\n\t\t\t\t}\n\n\t\t\t\tIntConstant zero = new IntConstant (ec.BuiltinTypes, 0, loc);\n\t\t\t\tfor (int i = 0; i < rank; i++) {\n\t\t\t\t\tvariables [i].EmitAssign (ec, zero);\n\n\t\t\t\t\tec.Emit (OpCodes.Br, test [i]);\n\t\t\t\t\tec.MarkLabel (loop [i]);\n\t\t\t\t}\n\n\t\t\t\tfor_each.body.Emit (ec);\n\n\t\t\t\tec.MarkLabel (ec.LoopBegin);\n\t\t\t\tec.Mark (for_each.expr.Location);\n\n\t\t\t\tfor (int i = rank - 1; i >= 0; i--){\n\t\t\t\t\tcounter [i].Emit (ec);\n\n\t\t\t\t\tec.MarkLabel (test [i]);\n\t\t\t\t\tvariables [i].Emit (ec);\n\n\t\t\t\t\tif (lengths != null)\n\t\t\t\t\t\tlengths [i].Emit (ec);\n\t\t\t\t\telse\n\t\t\t\t\t\tlength_exprs [i].Emit (ec);\n\n\t\t\t\t\tec.Emit (OpCodes.Blt, loop [i]);\n\t\t\t\t}\n\n\t\t\t\tec.MarkLabel (ec.LoopEnd);\n\t\t\t}\n\t\t}\n\n\t\tsealed class CollectionForeach : IteratorStatement, OverloadResolver.IErrorHandler\n\t\t{\n\t\t\tclass RuntimeDispose : Using.VariableDeclaration\n\t\t\t{\n\t\t\t\tpublic RuntimeDispose (LocalVariable lv, Location loc)\n\t\t\t\t\t: base (lv, loc)\n\t\t\t\t{\n\t\t\t\t\treachable = true;\n\t\t\t\t}\n\n\t\t\t\tprotected override void CheckIDiposableConversion (BlockContext bc, LocalVariable li, Expression initializer)\n\t\t\t\t{\n\t\t\t\t\t// Defered to runtime check\n\t\t\t\t}\n\n\t\t\t\tprotected override Statement CreateDisposeCall (BlockContext bc, LocalVariable lv)\n\t\t\t\t{\n\t\t\t\t\tvar idt = bc.BuiltinTypes.IDisposable;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Fabricates code like\n\t\t\t\t\t//\n\t\t\t\t\t// if ((temp = vr as IDisposable) != null) temp.Dispose ();\n\t\t\t\t\t//\n\n\t\t\t\t\tvar dispose_variable = LocalVariable.CreateCompilerGenerated (idt, bc.CurrentBlock, loc);\n\n\t\t\t\t\tvar idisaposable_test = new Binary (Binary.Operator.Inequality, new CompilerAssign (\n\t\t\t\t\t\tdispose_variable.CreateReferenceExpression (bc, loc),\n\t\t\t\t\t\tnew As (lv.CreateReferenceExpression (bc, loc), new TypeExpression (dispose_variable.Type, loc), loc),\n\t\t\t\t\t\tloc), new NullLiteral (loc));\n\n\t\t\t\t\tvar m = bc.Module.PredefinedMembers.IDisposableDispose.Resolve (loc);\n\n\t\t\t\t\tvar dispose_mg = MethodGroupExpr.CreatePredefined (m, idt, loc);\n\t\t\t\t\tdispose_mg.InstanceExpression = dispose_variable.CreateReferenceExpression (bc, loc);\n\n\t\t\t\t\tStatement dispose = new StatementExpression (new Invocation (dispose_mg, null));\n\t\t\t\t\treturn new If (idisaposable_test, dispose, loc);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tLocalVariable variable;\n\t\t\tExpression expr;\n\t\t\tStatement statement;\n\t\t\tExpressionStatement init;\n\t\t\tTemporaryVariableReference enumerator_variable;\n\t\t\tbool ambiguous_getenumerator_name;\n\n\t\t\tpublic CollectionForeach (Foreach @foreach, LocalVariable var, Expression expr)\n\t\t\t\t: base (@foreach)\n\t\t\t{\n\t\t\t\tthis.variable = var;\n\t\t\t\tthis.expr = expr;\n\t\t\t}\n\n\t\t\tvoid Error_WrongEnumerator (ResolveContext rc, MethodSpec enumerator)\n\t\t\t{\n\t\t\t\trc.Report.SymbolRelatedToPreviousError (enumerator);\n\t\t\t\trc.Report.Error (202, loc,\n\t\t\t\t\t\"foreach statement requires that the return type `{0}' of `{1}' must have a suitable public MoveNext method and public Current property\",\n\t\t\t\t\t\tenumerator.ReturnType.GetSignatureForError (), enumerator.GetSignatureForError ());\n\t\t\t}\n\n\t\t\tMethodGroupExpr ResolveGetEnumerator (ResolveContext rc)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Option 1: Try to match by name GetEnumerator first\n\t\t\t\t//\n\t\t\t\tvar mexpr = Expression.MemberLookup (rc, false, expr.Type,\n\t\t\t\t\t\"GetEnumerator\", 0, Expression.MemberLookupRestrictions.ExactArity, loc);\t\t// TODO: What if CS0229 ?\n\n\t\t\t\tvar mg = mexpr as MethodGroupExpr;\n\t\t\t\tif (mg != null) {\n\t\t\t\t\tmg.InstanceExpression = expr;\n\t\t\t\t\tArguments args = new Arguments (0);\n\t\t\t\t\tmg = mg.OverloadResolve (rc, ref args, this, OverloadResolver.Restrictions.ProbingOnly | OverloadResolver.Restrictions.GetEnumeratorLookup);\n\n\t\t\t\t\t// For ambiguous GetEnumerator name warning CS0278 was reported, but Option 2 could still apply\n\t\t\t\t\tif (ambiguous_getenumerator_name)\n\t\t\t\t\t\tmg = null;\n\n\t\t\t\t\tif (mg != null && !mg.BestCandidate.IsStatic && mg.BestCandidate.IsPublic) {\n\t\t\t\t\t\treturn mg;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Option 2: Try to match using IEnumerable interfaces with preference of generic version\n\t\t\t\t//\n\t\t\t\tvar t = expr.Type;\n\t\t\t\tPredefinedMember<MethodSpec> iface_candidate = null;\n\t\t\t\tvar ptypes = rc.Module.PredefinedTypes;\n\t\t\t\tvar gen_ienumerable = ptypes.IEnumerableGeneric;\n\t\t\t\tif (!gen_ienumerable.Define ())\n\t\t\t\t\tgen_ienumerable = null;\n\n\t\t\t\tvar ifaces = t.Interfaces;\n\t\t\t\tif (ifaces != null) {\n\t\t\t\t\tforeach (var iface in ifaces) {\n\t\t\t\t\t\tif (gen_ienumerable != null && iface.MemberDefinition == gen_ienumerable.TypeSpec.MemberDefinition) {\n\t\t\t\t\t\t\tif (iface_candidate != null && iface_candidate != rc.Module.PredefinedMembers.IEnumerableGetEnumerator) {\n\t\t\t\t\t\t\t\trc.Report.SymbolRelatedToPreviousError (expr.Type);\n\t\t\t\t\t\t\t\trc.Report.Error (1640, loc,\n\t\t\t\t\t\t\t\t\t\"foreach statement cannot operate on variables of type `{0}' because it contains multiple implementation of `{1}'. Try casting to a specific implementation\",\n\t\t\t\t\t\t\t\t\texpr.Type.GetSignatureForError (), gen_ienumerable.TypeSpec.GetSignatureForError ());\n\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// TODO: Cache this somehow\n\t\t\t\t\t\t\tiface_candidate = new PredefinedMember<MethodSpec> (rc.Module, iface,\n\t\t\t\t\t\t\t\tMemberFilter.Method (\"GetEnumerator\", 0, ParametersCompiled.EmptyReadOnlyParameters, null));\n\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (iface.BuiltinType == BuiltinTypeSpec.Type.IEnumerable && iface_candidate == null) {\n\t\t\t\t\t\t\tiface_candidate = rc.Module.PredefinedMembers.IEnumerableGetEnumerator;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (iface_candidate == null) {\n\t\t\t\t\tif (expr.Type != InternalType.ErrorType) {\n\t\t\t\t\t\trc.Report.Error (1579, loc,\n\t\t\t\t\t\t\t\"foreach statement cannot operate on variables of type `{0}' because it does not contain a definition for `{1}' or is inaccessible\",\n\t\t\t\t\t\t\texpr.Type.GetSignatureForError (), \"GetEnumerator\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tvar method = iface_candidate.Resolve (loc);\n\t\t\t\tif (method == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tmg = MethodGroupExpr.CreatePredefined (method, expr.Type, loc);\n\t\t\t\tmg.InstanceExpression = expr;\n\t\t\t\treturn mg;\n\t\t\t}\n\n\t\t\tMethodGroupExpr ResolveMoveNext (ResolveContext rc, MethodSpec enumerator)\n\t\t\t{\n\t\t\t\tvar ms = MemberCache.FindMember (enumerator.ReturnType,\n\t\t\t\t\tMemberFilter.Method (\"MoveNext\", 0, ParametersCompiled.EmptyReadOnlyParameters, rc.BuiltinTypes.Bool),\n\t\t\t\t\tBindingRestriction.InstanceOnly) as MethodSpec;\n\n\t\t\t\tif (ms == null || !ms.IsPublic) {\n\t\t\t\t\tError_WrongEnumerator (rc, enumerator);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn MethodGroupExpr.CreatePredefined (ms, enumerator.ReturnType, expr.Location);\n\t\t\t}\n\n\t\t\tPropertySpec ResolveCurrent (ResolveContext rc, MethodSpec enumerator)\n\t\t\t{\n\t\t\t\tvar ps = MemberCache.FindMember (enumerator.ReturnType,\n\t\t\t\t\tMemberFilter.Property (\"Current\", null),\n\t\t\t\t\tBindingRestriction.InstanceOnly) as PropertySpec;\n\n\t\t\t\tif (ps == null || !ps.IsPublic) {\n\t\t\t\t\tError_WrongEnumerator (rc, enumerator);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn ps;\n\t\t\t}\n\n\t\t\tpublic override bool Resolve (BlockContext ec)\n\t\t\t{\n\t\t\t\tbool is_dynamic = expr.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\n\t\t\t\tif (is_dynamic) {\n\t\t\t\t\texpr = Convert.ImplicitConversionRequired (ec, expr, ec.BuiltinTypes.IEnumerable, loc);\n\t\t\t\t} else if (expr.Type.IsNullableType) {\n\t\t\t\t\texpr = new Nullable.UnwrapCall (expr).Resolve (ec);\n\t\t\t\t}\n\n\t\t\t\tvar get_enumerator_mg = ResolveGetEnumerator (ec);\n\t\t\t\tif (get_enumerator_mg == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar get_enumerator = get_enumerator_mg.BestCandidate;\n\t\t\t\tenumerator_variable = TemporaryVariableReference.Create (get_enumerator.ReturnType, variable.Block, loc);\n\t\t\t\tenumerator_variable.Resolve (ec);\n\n\t\t\t\t// Prepare bool MoveNext ()\n\t\t\t\tvar move_next_mg = ResolveMoveNext (ec, get_enumerator);\n\t\t\t\tif (move_next_mg == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tmove_next_mg.InstanceExpression = enumerator_variable;\n\n\t\t\t\t// Prepare ~T~ Current { get; }\n\t\t\t\tvar current_prop = ResolveCurrent (ec, get_enumerator);\n\t\t\t\tif (current_prop == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar current_pe = new PropertyExpr (current_prop, loc) { InstanceExpression = enumerator_variable }.Resolve (ec);\n\t\t\t\tif (current_pe == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tVarExpr ve = for_each.type as VarExpr;\n\n\t\t\t\tif (ve != null) {\n\t\t\t\t\tif (is_dynamic) {\n\t\t\t\t\t\t// Source type is dynamic, set element type to dynamic too\n\t\t\t\t\t\tvariable.Type = ec.BuiltinTypes.Dynamic;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Infer implicitly typed local variable from foreach enumerable type\n\t\t\t\t\t\tvariable.Type = current_pe.Type;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (is_dynamic) {\n\t\t\t\t\t\t// Explicit cast of dynamic collection elements has to be done at runtime\n\t\t\t\t\t\tcurrent_pe = EmptyCast.Create (current_pe, ec.BuiltinTypes.Dynamic);\n\t\t\t\t\t}\n\n\t\t\t\t\tvariable.Type = for_each.type.ResolveAsType (ec);\n\n\t\t\t\t\tif (variable.Type == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tcurrent_pe = Convert.ExplicitConversion (ec, current_pe, variable.Type, loc);\n\t\t\t\t\tif (current_pe == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar variable_ref = new LocalVariableReference (variable, loc).Resolve (ec);\n\t\t\t\tif (variable_ref == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfor_each.body.AddScopeStatement (new StatementExpression (new CompilerAssign (variable_ref, current_pe, Location.Null), for_each.type.Location));\n\n\t\t\t\tvar init = new Invocation.Predefined (get_enumerator_mg, null);\n\n\t\t\t\tstatement = new While (new BooleanExpression (new Invocation (move_next_mg, null)),\n\t\t\t\t\t for_each.body, Location.Null);\n\n\t\t\t\tvar enum_type = enumerator_variable.Type;\n\n\t\t\t\t//\n\t\t\t\t// Add Dispose method call when enumerator can be IDisposable\n\t\t\t\t//\n\t\t\t\tif (!enum_type.ImplementsInterface (ec.BuiltinTypes.IDisposable, false)) {\n\t\t\t\t\tif (!enum_type.IsSealed && !TypeSpec.IsValueType (enum_type)) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Runtime Dispose check\n\t\t\t\t\t\t//\n\t\t\t\t\t\tvar vd = new RuntimeDispose (enumerator_variable.LocalInfo, Location.Null);\n\t\t\t\t\t\tvd.Initializer = init;\n\t\t\t\t\t\tstatement = new Using (vd, statement, Location.Null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// No Dispose call needed\n\t\t\t\t\t\t//\n\t\t\t\t\t\tthis.init = new SimpleAssign (enumerator_variable, init, Location.Null);\n\t\t\t\t\t\tthis.init.Resolve (ec);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//\n\t\t\t\t\t// Static Dispose check\n\t\t\t\t\t//\n\t\t\t\t\tvar vd = new Using.VariableDeclaration (enumerator_variable.LocalInfo, Location.Null);\n\t\t\t\t\tvd.Initializer = init;\n\t\t\t\t\tstatement = new Using (vd, statement, Location.Null);\n\t\t\t\t}\n\n\t\t\t\treturn statement.Resolve (ec);\n\t\t\t}\n\n\t\t\tprotected override void DoEmit (EmitContext ec)\n\t\t\t{\n\t\t\t\tenumerator_variable.LocalInfo.CreateBuilder (ec);\n\n\t\t\t\tif (init != null)\n\t\t\t\t\tinit.EmitStatement (ec);\n\n\t\t\t\tstatement.Emit (ec);\n\t\t\t}\n\n\t\t\t#region IErrorHandler Members\n\n\t\t\tbool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous)\n\t\t\t{\n\t\t\t\tec.Report.SymbolRelatedToPreviousError (best);\n\t\t\t\tec.Report.Warning (278, 2, expr.Location,\n\t\t\t\t\t\"`{0}' contains ambiguous implementation of `{1}' pattern. Method `{2}' is ambiguous with method `{3}'\",\n\t\t\t\t\texpr.Type.GetSignatureForError (), \"enumerable\",\n\t\t\t\t\tbest.GetSignatureForError (), ambiguous.GetSignatureForError ());\n\n\t\t\t\tambiguous_getenumerator_name = true;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tbool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\tExpression type;\n\t\tLocalVariable variable;\n\t\tExpression expr;\n\t\tBlock body;\n\n\t\tpublic Foreach (Expression type, LocalVariable var, Expression expr, Statement stmt, Block body, Location l)\n\t\t\t: base (stmt)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\tthis.variable = var;\n\t\t\tthis.expr = expr;\n\t\t\tthis.body = body;\n\t\t\tloc = l;\n\t\t}\n\n\t\tpublic Expression Expr {\n\t\t\tget { return expr; }\n\t\t}\n\n\t\tpublic Expression TypeExpression {\n\t\t\tget { return type; }\n\t\t}\n\n\t\tpublic LocalVariable Variable {\n\t\t\tget { return variable; }\n\t\t}\n\n\t\tpublic override Reachability MarkReachable (Reachability rc)\n\t\t{\n\t\t\tbase.MarkReachable (rc);\n\n\t\t\tbody.MarkReachable (rc);\n\n\t\t\treturn rc;\n\t\t}\n\n\t\tpublic override bool Resolve (BlockContext ec)\n\t\t{\n\t\t\texpr = expr.Resolve (ec);\n\t\t\tif (expr == null)\n\t\t\t\treturn false;\n\n\t\t\tif (expr.IsNull) {\n\t\t\t\tec.Report.Error (186, loc, \"Use of null is not valid in this context\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbody.AddStatement (Statement);\n\n\t\t\tif (expr.Type.BuiltinType == BuiltinTypeSpec.Type.String) {\n\t\t\t\tStatement = new ArrayForeach (this, 1);\n\t\t\t} else if (expr.Type is ArrayContainer) {\n\t\t\t\tStatement = new ArrayForeach (this, ((ArrayContainer) expr.Type).Rank);\n\t\t\t} else {\n\t\t\t\tif (expr.eclass == ExprClass.MethodGroup || expr is AnonymousMethodExpression) {\n\t\t\t\t\tec.Report.Error (446, expr.Location, \"Foreach statement cannot operate on a `{0}'\",\n\t\t\t\t\t\texpr.ExprClassName);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tStatement = new CollectionForeach (this, variable, expr);\n\t\t\t}\n\n\t\t\treturn base.Resolve (ec);\n\t\t}\n\n\t\tprotected override void DoEmit (EmitContext ec)\n\t\t{\n\t\t\tLabel old_begin = ec.LoopBegin, old_end = ec.LoopEnd;\n\t\t\tec.LoopBegin = ec.DefineLabel ();\n\t\t\tec.LoopEnd = ec.DefineLabel ();\n\n\t\t\tif (!(Statement is Block))\n\t\t\t\tec.BeginCompilerScope ();\n\n\t\t\tvariable.CreateBuilder (ec);\n\n\t\t\tStatement.Emit (ec);\n\n\t\t\tif (!(Statement is Block))\n\t\t\t\tec.EndScope ();\n\n\t\t\tec.LoopBegin = old_begin;\n\t\t\tec.LoopEnd = old_end;\n\t\t}\n\n\t\tprotected override bool DoFlowAnalysis (FlowAnalysisContext fc)\n\t\t{\n\t\t\texpr.FlowAnalysis (fc);\n\n\t\t\tvar da = fc.BranchDefiniteAssignment ();\n\t\t\tbody.FlowAnalysis (fc);\n\t\t\tfc.DefiniteAssignment = da;\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected override void CloneTo (CloneContext clonectx, Statement t)\n\t\t{\n\t\t\tForeach target = (Foreach) t;\n\n\t\t\ttarget.type = type.Clone (clonectx);\n\t\t\ttarget.expr = expr.Clone (clonectx);\n\t\t\ttarget.body = (Block) body.Clone (clonectx);\n\t\t\ttarget.Statement = Statement.Clone (clonectx);\n\t\t}\n\t\t\n\t\tpublic override object Accept (StructuralVisitor visitor)\n\t\t{\n\t\t\treturn visitor.Visit (this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs",
    "content": "//\n// support.cs: Support routines to work around the fact that System.Reflection.Emit\n// can not introspect types that are being constructed\n//\n// Author:\n//   Miguel de Icaza (miguel@ximian.com)\n//   Marek Safar (marek.safar@gmail.com)\n//\n// Copyright 2001 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2009 Novell, Inc\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Linq;\nusing System.IO;\nusing System.Text;\nusing System.Collections.Generic;\n\nnamespace Mono.CSharp {\n\n\tsealed class ReferenceEquality<T> : IEqualityComparer<T> where T : class\n\t{\n\t\tpublic static readonly IEqualityComparer<T> Default = new ReferenceEquality<T> ();\n\n\t\tprivate ReferenceEquality ()\n\t\t{\n\t\t}\n\n\t\tpublic bool Equals (T x, T y)\n\t\t{\n\t\t\treturn ReferenceEquals (x, y);\n\t\t}\n\n\t\tpublic int GetHashCode (T obj)\n\t\t{\n\t\t\treturn System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode (obj);\n\t\t}\n\t}\n#if !NET_4_0 && !MOBILE_DYNAMIC\n\tpublic class Tuple<T1, T2> : IEquatable<Tuple<T1, T2>>\n\t{\n\t\tpublic Tuple (T1 item1, T2 item2)\n\t\t{\n\t\t\tItem1 = item1;\n\t\t\tItem2 = item2;\n\t\t}\n\n\t\tpublic T1 Item1 { get; private set; }\n\t\tpublic T2 Item2 { get; private set; }\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn ((object)Item1 ?? 0) .GetHashCode () ^ ((object)Item2 ?? 0).GetHashCode ();\n\t\t}\n\n\t\t#region IEquatable<Tuple<T1,T2>> Members\n\n\t\tpublic bool Equals (Tuple<T1, T2> other)\n\t\t{\n\t\t\treturn EqualityComparer<T1>.Default.Equals (Item1, other.Item1) &&\n\t\t\t\tEqualityComparer<T2>.Default.Equals (Item2, other.Item2);\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tpublic class Tuple<T1, T2, T3> : IEquatable<Tuple<T1, T2, T3>>\n\t{\n\t\tpublic Tuple (T1 item1, T2 item2, T3 item3)\n\t\t{\n\t\t\tItem1 = item1;\n\t\t\tItem2 = item2;\n\t\t\tItem3 = item3;\n\t\t}\n\n\t\tpublic T1 Item1 { get; private set; }\n\t\tpublic T2 Item2 { get; private set; }\n\t\tpublic T3 Item3 { get; private set; }\n\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn Item1.GetHashCode () ^ Item2.GetHashCode () ^ Item3.GetHashCode ();\n\t\t}\n\n\t\t#region IEquatable<Tuple<T1,T2>> Members\n\n\t\tpublic bool Equals (Tuple<T1, T2, T3> other)\n\t\t{\n\t\t\treturn EqualityComparer<T1>.Default.Equals (Item1, other.Item1) &&\n\t\t\t\tEqualityComparer<T2>.Default.Equals (Item2, other.Item2) &&\n\t\t\t\tEqualityComparer<T3>.Default.Equals (Item3, other.Item3);\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tstatic class Tuple\n\t{\n\t\tpublic static Tuple<T1, T2> Create<T1, T2> (T1 item1, T2 item2)\n\t\t{\n\t\t\treturn new Tuple<T1, T2> (item1, item2);\n\t\t}\n\n\t\tpublic static Tuple<T1, T2, T3> Create<T1, T2, T3> (T1 item1, T2 item2, T3 item3)\n\t\t{\n\t\t\treturn new Tuple<T1, T2, T3> (item1, item2, item3);\n\t\t}\n\t}\n#endif\n\n\tstatic class ArrayComparer\n\t{\n\t\tpublic static bool IsEqual<T> (T[] array1, T[] array2)\n\t\t{\n\t\t\tif (array1 == null || array2 == null)\n\t\t\t\treturn array1 == array2;\n\n\t\t\tvar eq = EqualityComparer<T>.Default;\n\n\t\t\tfor (int i = 0; i < array1.Length; ++i) {\n\t\t\t\tif (!eq.Equals (array1[i], array2[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n#if !FULL_AST\n\t/// <summary>\n\t///   This is an arbitrarily seekable StreamReader wrapper.\n\t///\n\t///   It uses a self-tuning buffer to cache the seekable data,\n\t///   but if the seek is too far, it may read the underly\n\t///   stream all over from the beginning.\n\t/// </summary>\n\tpublic class SeekableStreamReader : IDisposable\n\t{\n\t\tpublic const int DefaultReadAheadSize =\n\t\t\t4096 / 2;\n\n\t\tStreamReader reader;\n\t\tStream stream;\n\n\t\tchar[] buffer;\n\t\tint read_ahead_length;\t// the length of read buffer\n\t\tint buffer_start;       // in chars\n\t\tint char_count;         // count of filled characters in buffer[]\n\t\tint pos;                // index into buffer[]\n\n\t\tpublic SeekableStreamReader (Stream stream, Encoding encoding, char[] sharedBuffer = null)\n\t\t{\n\t\t\tthis.stream = stream;\n\t\t\tthis.buffer = sharedBuffer;\n\n\t\t\tInitializeStream (DefaultReadAheadSize);\n\t\t\treader = new StreamReader (stream, encoding, true);\n\t\t}\n\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t// Needed to release stream reader buffers\n\t\t\treader.Dispose ();\n\t\t}\n\n\t\tvoid InitializeStream (int read_length_inc)\n\t\t{\n\t\t\tread_ahead_length += read_length_inc;\n\n\t\t\tint required_buffer_size = read_ahead_length * 2;\n\n\t\t\tif (buffer == null || buffer.Length < required_buffer_size)\n\t\t\t\tbuffer = new char [required_buffer_size];\n\n\t\t\tstream.Position = 0;\n\t\t\tbuffer_start = char_count = pos = 0;\n\t\t}\n\n\t\t/// <remarks>\n\t\t///   This value corresponds to the current position in a stream of characters.\n\t\t///   The StreamReader hides its manipulation of the underlying byte stream and all\n\t\t///   character set/decoding issues.  Thus, we cannot use this position to guess at\n\t\t///   the corresponding position in the underlying byte stream even though there is\n\t\t///   a correlation between them.\n\t\t/// </remarks>\n\t\tpublic int Position {\n\t\t\tget {\n\t\t\t\treturn buffer_start + pos;\n\t\t\t}\n\n\t\t\tset {\n\t\t\t\t//\n\t\t\t\t// If the lookahead was too small, re-read from the beginning. Increase the buffer size while we're at it\n\t\t\t\t// This should never happen until we are parsing some weird source code\n\t\t\t\t//\n\t\t\t\tif (value < buffer_start) {\n\t\t\t\t\tInitializeStream (read_ahead_length);\n\n\t\t\t\t\t//\n\t\t\t\t\t// Discard buffer data after underlying stream changed position\n\t\t\t\t\t// Cannot use handy reader.DiscardBufferedData () because it for\n\t\t\t\t\t// some strange reason resets encoding as well\n\t\t\t\t\t//\n\t\t\t\t\treader = new StreamReader (stream, reader.CurrentEncoding, true);\n\t\t\t\t}\n\n\t\t\t\twhile (value > buffer_start + char_count) {\n\t\t\t\t\tpos = char_count;\n\t\t\t\t\tif (!ReadBuffer ())\n\t\t\t\t\t\tthrow new InternalErrorException (\"Seek beyond end of file: \" + (buffer_start + char_count - value));\n\t\t\t\t}\n\n\t\t\t\tpos = value - buffer_start;\n\t\t\t}\n\t\t}\n\n\t\tbool ReadBuffer ()\n\t\t{\n\t\t\tint slack = buffer.Length - char_count;\n\n\t\t\t//\n\t\t\t// read_ahead_length is only half of the buffer to deal with\n\t\t\t// reads ahead and moves back without re-reading whole buffer\n\t\t\t//\n\t\t\tif (slack <= read_ahead_length) {\n\t\t\t\t//\n\t\t\t\t// shift the buffer to make room for read_ahead_length number of characters\n\t\t\t\t//\n\t\t\t\tint shift = read_ahead_length - slack;\n\t\t\t\tArray.Copy (buffer, shift, buffer, 0, char_count - shift);\n\n\t\t\t\t// Update all counters\n\t\t\t\tpos -= shift;\n\t\t\t\tchar_count -= shift;\n\t\t\t\tbuffer_start += shift;\n\t\t\t\tslack += shift;\n\t\t\t}\n\n\t\t\tchar_count += reader.Read (buffer, char_count, slack);\n\n\t\t\treturn pos < char_count;\n\t\t}\n\t\t\n\t\tpublic char GetChar (int position)\n\t\t{\n\t\t\tif (buffer_start <= position && position < buffer.Length)\n\t\t\t\treturn buffer[position];\n\t\t\treturn '\\0';\n\t\t}\n\t\t\n\t\tpublic char[] ReadChars (int fromPosition, int toPosition)\n\t\t{\n\t\t\tchar[] chars = new char[toPosition - fromPosition];\n\t\t\tif (buffer_start <= fromPosition && toPosition <= buffer_start + buffer.Length) {\n\t\t\t\tArray.Copy (buffer, fromPosition - buffer_start, chars, 0, chars.Length);\n\t\t\t} else {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\n\t\t\treturn chars;\n\t\t}\n\n\t\tpublic int Peek ()\n\t\t{\n\t\t\tif ((pos >= char_count) && !ReadBuffer ())\n\t\t\t\treturn -1;\n\n\t\t\treturn buffer [pos];\n\t\t}\n\n\t\tpublic int Read ()\n\t\t{\n\t\t\tif ((pos >= char_count) && !ReadBuffer ())\n\t\t\t\treturn -1;\n\n\t\t\treturn buffer [pos++];\n\t\t}\n\t}\n#endif\n\n\tpublic class UnixUtils {\n\t\t[System.Runtime.InteropServices.DllImport (\"libc\", EntryPoint=\"isatty\")]\n\t\textern static int _isatty (int fd);\n\t\t\t\n\t\tpublic static bool isatty (int fd)\n\t\t{\n\t\t\ttry {\n\t\t\t\treturn _isatty (fd) == 1;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t/// <summary>\n\t///   An exception used to terminate the compiler resolution phase and provide completions\n\t/// </summary>\n\t/// <remarks>\n\t///   This is thrown when we want to return the completions or\n\t///   terminate the completion process by AST nodes used in\n\t///   the completion process.\n\t/// </remarks>\n\tpublic class CompletionResult : Exception {\n\t\tstring [] result;\n\t\tstring base_text;\n\t\t\n\t\tpublic CompletionResult (string base_text, string [] res)\n\t\t{\n\t\t\tif (base_text == null)\n\t\t\t\tthrow new ArgumentNullException (\"base_text\");\n\t\t\tthis.base_text = base_text;\n\n\t\t\tresult = res;\n\t\t\tArray.Sort (result);\n\t\t}\n\n\t\tpublic string [] Result {\n\t\t\tget {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tpublic string BaseText {\n\t\t\tget {\n\t\t\t\treturn base_text;\n\t\t\t}\n\t\t}\n\t}\n\n\tstruct TypeNameParser\n\t{\n\t\tinternal static string Escape(string name)\n\t\t{\n\t\t\tif (name == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tStringBuilder sb = null;\n\t\t\tfor (int pos = 0; pos < name.Length; pos++) {\n\t\t\t\tchar c = name[pos];\n\t\t\t\tswitch (c) {\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\tcase '+':\n\t\t\t\t\tcase ',':\n\t\t\t\t\tcase '[':\n\t\t\t\t\tcase ']':\n\t\t\t\t\tcase '*':\n\t\t\t\t\tcase '&':\n\t\t\t\t\t\tif (sb == null) {\n\t\t\t\t\t\t\tsb = new StringBuilder(name, 0, pos, name.Length + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsb.Append(\"\\\\\").Append(c);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (sb != null) {\n\t\t\t\t\t\t\tsb.Append(c);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sb != null ? sb.ToString() : name;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/symbolwriter.cs",
    "content": "//\n// symbolwriter.cs: The debug symbol writer\n//\n// Authors: Martin Baulig (martin@ximian.com)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2004-2010 Novell, Inc\n//\n\nusing System;\n\n#if STATIC\nusing IKVM.Reflection;\nusing IKVM.Reflection.Emit;\n#else\nusing System.Reflection;\nusing System.Reflection.Emit;\n#endif\n\nusing Mono.CompilerServices.SymbolWriter;\n\nnamespace Mono.CSharp\n{\n\tstatic class SymbolWriter\n\t{\n#if !NET_4_0 && !STATIC\n\t\tdelegate int GetILOffsetFunc (ILGenerator ig);\n\t\tstatic GetILOffsetFunc get_il_offset_func;\n\n\t\tdelegate Guid GetGuidFunc (ModuleBuilder mb);\n\t\tstatic GetGuidFunc get_guid_func;\n\n\t\tstatic void Initialize ()\n\t\t{\n\t\t\tvar mi = typeof (ILGenerator).GetMethod (\n\t\t\t\t\"Mono_GetCurrentOffset\",\n\t\t\t\tBindingFlags.Static | BindingFlags.NonPublic);\n\t\t\tif (mi == null)\n\t\t\t\tthrow new MissingMethodException (\"Mono_GetCurrentOffset\");\n\n\t\t\tget_il_offset_func = (GetILOffsetFunc) System.Delegate.CreateDelegate (\n\t\t\t\ttypeof (GetILOffsetFunc), mi);\n\n\t\t\tmi = typeof (ModuleBuilder).GetMethod (\n\t\t\t\t\"Mono_GetGuid\",\n\t\t\t\tBindingFlags.Static | BindingFlags.NonPublic);\n\t\t\tif (mi == null)\n\t\t\t\tthrow new MissingMethodException (\"Mono_GetGuid\");\n\n\t\t\tget_guid_func = (GetGuidFunc) System.Delegate.CreateDelegate (\n\t\t\t\ttypeof (GetGuidFunc), mi);\n\t\t}\n#endif\n\n\t\tstatic int GetILOffset (ILGenerator ig)\n\t\t{\n#if NET_4_0 || STATIC\n\t\t\treturn ig.ILOffset;\n#else\n\t\t\tif (get_il_offset_func == null)\n\t\t\t\tInitialize ();\n\n\t\t\treturn get_il_offset_func (ig);\n#endif\n\t\t}\n\n\t\tpublic static Guid GetGuid (ModuleBuilder module)\n\t\t{\n#if NET_4_0 || STATIC\n\t\t\treturn module.ModuleVersionId;\n#else\n\t\t\tif (get_guid_func == null)\n\t\t\t\tInitialize ();\n\n\t\t\treturn get_guid_func (module);\n#endif\n\t\t}\n\n\t\tpublic static bool HasSymbolWriter {\n\t\t\tget { return symwriter != null; }\n\t\t}\n\n\t\tpublic static MonoSymbolWriter symwriter;\n\n\t\tpublic static void DefineLocalVariable (string name, LocalBuilder builder)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tsymwriter.DefineLocalVariable (builder.LocalIndex, name);\n\t\t\t}\n\t\t}\n\n\t\tpublic static SourceMethodBuilder OpenMethod (ICompileUnit file, IMethodDef method)\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\treturn symwriter.OpenMethod (file, -1 /* Not used */, method);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\n\t\tpublic static void CloseMethod ()\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\tsymwriter.CloseMethod ();\n\t\t}\n\n\t\tpublic static int OpenScope (ILGenerator ig)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ig);\n\t\t\t\treturn symwriter.OpenScope (offset);\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void CloseScope (ILGenerator ig)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ig);\n\t\t\t\tsymwriter.CloseScope (offset);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void DefineAnonymousScope (int id)\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\tsymwriter.DefineAnonymousScope (id);\n\t\t}\n\n\t\tpublic static void DefineScopeVariable (int scope, LocalBuilder builder)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tsymwriter.DefineScopeVariable (scope, builder.LocalIndex);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void DefineScopeVariable (int scope)\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\tsymwriter.DefineScopeVariable (scope, -1);\n\t\t}\n\n\t\tpublic static void DefineCapturedLocal (int scope_id, string name,\n\t\t\t\t\t\t\tstring captured_name)\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\tsymwriter.DefineCapturedLocal (scope_id, name, captured_name);\n\t\t}\n\n\t\tpublic static void DefineCapturedParameter (int scope_id, string name,\n\t\t\t\t\t\t\t    string captured_name)\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\tsymwriter.DefineCapturedParameter (scope_id, name, captured_name);\n\t\t}\n\n\t\tpublic static void DefineCapturedThis (int scope_id, string captured_name)\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\tsymwriter.DefineCapturedThis (scope_id, captured_name);\n\t\t}\n\n\t\tpublic static void DefineCapturedScope (int scope_id, int id, string captured_name)\n\t\t{\n\t\t\tif (symwriter != null)\n\t\t\t\tsymwriter.DefineCapturedScope (scope_id, id, captured_name);\n\t\t}\n\n\t\tpublic static void OpenCompilerGeneratedBlock (EmitContext ec)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ec.ig);\n\t\t\t\tsymwriter.OpenCompilerGeneratedBlock (offset);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void CloseCompilerGeneratedBlock (EmitContext ec)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ec.ig);\n\t\t\t\tsymwriter.CloseCompilerGeneratedBlock (offset);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void StartIteratorBody (EmitContext ec)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ec.ig);\n\t\t\t\tsymwriter.StartIteratorBody (offset);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void EndIteratorBody (EmitContext ec)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ec.ig);\n\t\t\t\tsymwriter.EndIteratorBody (offset);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void StartIteratorDispatcher (EmitContext ec)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ec.ig);\n\t\t\t\tsymwriter.StartIteratorDispatcher (offset);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void EndIteratorDispatcher (EmitContext ec)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tint offset = GetILOffset (ec.ig);\n\t\t\t\tsymwriter.EndIteratorDispatcher (offset);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void MarkSequencePoint (ILGenerator ig, Location loc)\n\t\t{\n\t\t\tif (symwriter != null) {\n\t\t\t\tSourceFileEntry file = loc.SourceFile.SourceFileEntry;\n\t\t\t\tint offset = GetILOffset (ig);\n\t\t\t\tsymwriter.MarkSequencePoint (offset, file, loc.Row, loc.Column, false);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Reset ()\n\t\t{\n\t\t\tsymwriter = null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typemanager.cs",
    "content": "//\n// typemanager.cs: C# type manager\n//\n// Author: Miguel de Icaza (miguel@gnu.org)\n//         Ravi Pratap     (ravi@ximian.com)\n//         Marek Safar     (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)\n// Copyright 2003-2011 Novell, Inc.\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Globalization;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace Mono.CSharp\n{\n\t//\n\t// All compiler built-in types (they have to exist otherwise the compiler will not work)\n\t//\n\tpublic class BuiltinTypes\n\t{\n\t\tpublic readonly BuiltinTypeSpec Object;\n\t\tpublic readonly BuiltinTypeSpec ValueType;\n\t\tpublic readonly BuiltinTypeSpec Attribute;\n\n\t\tpublic readonly BuiltinTypeSpec Int;\n\t\tpublic readonly BuiltinTypeSpec UInt;\n\t\tpublic readonly BuiltinTypeSpec Long;\n\t\tpublic readonly BuiltinTypeSpec ULong;\n\t\tpublic readonly BuiltinTypeSpec Float;\n\t\tpublic readonly BuiltinTypeSpec Double;\n\t\tpublic readonly BuiltinTypeSpec Char;\n\t\tpublic readonly BuiltinTypeSpec Short;\n\t\tpublic readonly BuiltinTypeSpec Decimal;\n\t\tpublic readonly BuiltinTypeSpec Bool;\n\t\tpublic readonly BuiltinTypeSpec SByte;\n\t\tpublic readonly BuiltinTypeSpec Byte;\n\t\tpublic readonly BuiltinTypeSpec UShort;\n\t\tpublic readonly BuiltinTypeSpec String;\n\n\t\tpublic readonly BuiltinTypeSpec Enum;\n\t\tpublic readonly BuiltinTypeSpec Delegate;\n\t\tpublic readonly BuiltinTypeSpec MulticastDelegate;\n\t\tpublic readonly BuiltinTypeSpec Void;\n\t\tpublic readonly BuiltinTypeSpec Array;\n\t\tpublic readonly BuiltinTypeSpec Type;\n\t\tpublic readonly BuiltinTypeSpec IEnumerator;\n\t\tpublic readonly BuiltinTypeSpec IEnumerable;\n\t\tpublic readonly BuiltinTypeSpec IDisposable;\n\t\tpublic readonly BuiltinTypeSpec IntPtr;\n\t\tpublic readonly BuiltinTypeSpec UIntPtr;\n\t\tpublic readonly BuiltinTypeSpec RuntimeFieldHandle;\n\t\tpublic readonly BuiltinTypeSpec RuntimeTypeHandle;\n\t\tpublic readonly BuiltinTypeSpec Exception;\n\n\t\t//\n\t\t// These are internal buil-in types which depend on other\n\t\t// build-in type (mostly object)\n\t\t//\n\t\tpublic readonly BuiltinTypeSpec Dynamic;\n\n\t\t// Predefined operators tables\n\t\tpublic readonly Binary.PredefinedOperator[] OperatorsBinaryStandard;\n\t\tpublic readonly Binary.PredefinedOperator[] OperatorsBinaryEquality;\n\t\tpublic readonly Binary.PredefinedOperator[] OperatorsBinaryUnsafe;\n\t\tpublic readonly TypeSpec[][] OperatorsUnary;\n\t\tpublic readonly TypeSpec[] OperatorsUnaryMutator;\n\n\t\tpublic readonly TypeSpec[] BinaryPromotionsTypes;\n\n\t\treadonly BuiltinTypeSpec[] types;\n\n\t\tpublic BuiltinTypes ()\n\t\t{\n\t\t\tObject = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"Object\", BuiltinTypeSpec.Type.Object);\n\t\t\tValueType = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"ValueType\", BuiltinTypeSpec.Type.ValueType);\n\t\t\tAttribute = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"Attribute\", BuiltinTypeSpec.Type.Attribute);\n\n\t\t\tInt = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Int32\", BuiltinTypeSpec.Type.Int);\n\t\t\tLong = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Int64\", BuiltinTypeSpec.Type.Long);\n\t\t\tUInt = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"UInt32\", BuiltinTypeSpec.Type.UInt);\n\t\t\tULong = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"UInt64\", BuiltinTypeSpec.Type.ULong);\n\t\t\tByte = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Byte\", BuiltinTypeSpec.Type.Byte);\n\t\t\tSByte = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"SByte\", BuiltinTypeSpec.Type.SByte);\n\t\t\tShort = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Int16\", BuiltinTypeSpec.Type.Short);\n\t\t\tUShort = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"UInt16\", BuiltinTypeSpec.Type.UShort);\n\n\t\t\tIEnumerator = new BuiltinTypeSpec (MemberKind.Interface, \"System.Collections\", \"IEnumerator\", BuiltinTypeSpec.Type.IEnumerator);\n\t\t\tIEnumerable = new BuiltinTypeSpec (MemberKind.Interface, \"System.Collections\", \"IEnumerable\", BuiltinTypeSpec.Type.IEnumerable);\n\t\t\tIDisposable = new BuiltinTypeSpec (MemberKind.Interface, \"System\", \"IDisposable\", BuiltinTypeSpec.Type.IDisposable);\n\n\t\t\tChar = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Char\", BuiltinTypeSpec.Type.Char);\n\t\t\tString = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"String\", BuiltinTypeSpec.Type.String);\n\t\t\tFloat = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Single\", BuiltinTypeSpec.Type.Float);\n\t\t\tDouble = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Double\", BuiltinTypeSpec.Type.Double);\n\t\t\tDecimal = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Decimal\", BuiltinTypeSpec.Type.Decimal);\n\t\t\tBool = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"Boolean\", BuiltinTypeSpec.Type.Bool);\n\t\t\tIntPtr = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"IntPtr\", BuiltinTypeSpec.Type.IntPtr);\n\t\t\tUIntPtr = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"UIntPtr\", BuiltinTypeSpec.Type.UIntPtr);\n\n\t\t\tMulticastDelegate = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"MulticastDelegate\", BuiltinTypeSpec.Type.MulticastDelegate);\n\t\t\tDelegate = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"Delegate\", BuiltinTypeSpec.Type.Delegate);\n\t\t\tEnum = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"Enum\", BuiltinTypeSpec.Type.Enum);\n\t\t\tArray = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"Array\", BuiltinTypeSpec.Type.Array);\n\t\t\tVoid = new BuiltinTypeSpec (MemberKind.Void, \"System\", \"Void\", BuiltinTypeSpec.Type.Other);\n\t\t\tType = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"Type\", BuiltinTypeSpec.Type.Type);\n\t\t\tException = new BuiltinTypeSpec (MemberKind.Class, \"System\", \"Exception\", BuiltinTypeSpec.Type.Exception);\n\t\t\tRuntimeFieldHandle = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"RuntimeFieldHandle\", BuiltinTypeSpec.Type.Other);\n\t\t\tRuntimeTypeHandle = new BuiltinTypeSpec (MemberKind.Struct, \"System\", \"RuntimeTypeHandle\", BuiltinTypeSpec.Type.Other);\n\n\t\t\t// TODO: Maybe I should promote it to different kind for faster compares\n\t\t\tDynamic = new BuiltinTypeSpec (\"dynamic\", BuiltinTypeSpec.Type.Dynamic);\n\n\t\t\tOperatorsBinaryStandard = Binary.CreateStandardOperatorsTable (this);\n\t\t\tOperatorsBinaryEquality = Binary.CreateEqualityOperatorsTable (this);\n\t\t\tOperatorsBinaryUnsafe = Binary.CreatePointerOperatorsTable (this);\n\t\t\tOperatorsUnary = Unary.CreatePredefinedOperatorsTable (this);\n\t\t\tOperatorsUnaryMutator = UnaryMutator.CreatePredefinedOperatorsTable (this);\n\n\t\t\tBinaryPromotionsTypes = ConstantFold.CreateBinaryPromotionsTypes (this);\n\n\t\t\ttypes = new BuiltinTypeSpec[] {\n\t\t\t\tObject, ValueType, Attribute,\n\t\t\t\tInt, UInt, Long, ULong, Float, Double, Char, Short, Decimal, Bool, SByte, Byte, UShort, String,\n\t\t\t\tEnum, Delegate, MulticastDelegate, Void, Array, Type, IEnumerator, IEnumerable, IDisposable,\n\t\t\t\tIntPtr, UIntPtr, RuntimeFieldHandle, RuntimeTypeHandle, Exception };\n\t\t}\n\n\t\tpublic BuiltinTypeSpec[] AllTypes {\n\t\t\tget {\n\t\t\t\treturn types;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool CheckDefinitions (ModuleContainer module)\n\t\t{\n\t\t\tvar ctx = module.Compiler;\n\t\t\tforeach (var p in types) {\n\t\t\t\tvar found = PredefinedType.Resolve (module, p.Kind, p.Namespace, p.Name, p.Arity, true, true);\n\t\t\t\tif (found == null || found == p)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar tc = found.MemberDefinition as TypeDefinition;\n\t\t\t\tif (tc != null) {\n\t\t\t\t\tvar ns = module.GlobalRootNamespace.GetNamespace (p.Namespace, false);\n\t\t\t\t\tns.SetBuiltinType (p);\n\n\t\t\t\t\ttc.SetPredefinedSpec (p);\n\t\t\t\t\tp.SetDefinition (found);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ctx.Report.Errors != 0)\n\t\t\t\treturn false;\n\n\t\t\t// Set internal build-in types\n\t\t\tDynamic.SetDefinition (Object);\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//\n\t// Compiler predefined types. Usually used for compiler generated\n\t// code or for comparison against well known framework type. They\n\t// may not exist as they are optional\n\t//\n\tclass PredefinedTypes\n\t{\n\t\tpublic readonly PredefinedType ArgIterator;\n\t\tpublic readonly PredefinedType TypedReference;\n\t\tpublic readonly PredefinedType MarshalByRefObject;\n\t\tpublic readonly PredefinedType RuntimeHelpers;\n\t\tpublic readonly PredefinedType IAsyncResult;\n\t\tpublic readonly PredefinedType AsyncCallback;\n\t\tpublic readonly PredefinedType RuntimeArgumentHandle;\n\t\tpublic readonly PredefinedType CharSet;\n\t\tpublic readonly PredefinedType IsVolatile;\n\t\tpublic readonly PredefinedType IEnumeratorGeneric;\n\t\tpublic readonly PredefinedType IListGeneric;\n\t\tpublic readonly PredefinedType IReadOnlyListGeneric;\n\t\tpublic readonly PredefinedType ICollectionGeneric;\n\t\tpublic readonly PredefinedType IReadOnlyCollectionGeneric;\n\t\tpublic readonly PredefinedType IEnumerableGeneric;\n\t\tpublic readonly PredefinedType Nullable;\n\t\tpublic readonly PredefinedType Activator;\n\t\tpublic readonly PredefinedType Interlocked;\n\t\tpublic readonly PredefinedType Monitor;\n\t\tpublic readonly PredefinedType NotSupportedException;\n\t\tpublic readonly PredefinedType RuntimeFieldHandle;\n\t\tpublic readonly PredefinedType RuntimeMethodHandle;\n\t\tpublic readonly PredefinedType SecurityAction;\n\t\tpublic readonly PredefinedType Dictionary;\n\t\tpublic readonly PredefinedType Hashtable;\n\t\tpublic readonly TypeSpec[] SwitchUserTypes;\n\n\t\t//\n\t\t// C# 3.0\n\t\t//\n\t\tpublic readonly PredefinedType Expression;\n\t\tpublic readonly PredefinedType ExpressionGeneric;\n\t\tpublic readonly PredefinedType ParameterExpression;\n\t\tpublic readonly PredefinedType FieldInfo;\n\t\tpublic readonly PredefinedType MethodBase;\n\t\tpublic readonly PredefinedType MethodInfo;\n\t\tpublic readonly PredefinedType ConstructorInfo;\n\t\tpublic readonly PredefinedType MemberBinding;\n\n\t\t//\n\t\t// C# 4.0\n\t\t//\n\t\tpublic readonly PredefinedType Binder;\n\t\tpublic readonly PredefinedType CallSite;\n\t\tpublic readonly PredefinedType CallSiteGeneric;\n\t\tpublic readonly PredefinedType BinderFlags;\n\n\t\t//\n\t\t// C# 5.0\n\t\t//\n\t\tpublic readonly PredefinedType AsyncVoidMethodBuilder;\n\t\tpublic readonly PredefinedType AsyncTaskMethodBuilder;\n\t\tpublic readonly PredefinedType AsyncTaskMethodBuilderGeneric;\n\t\tpublic readonly PredefinedType Action;\n\t\tpublic readonly PredefinedType Task;\n\t\tpublic readonly PredefinedType TaskGeneric;\n\t\tpublic readonly PredefinedType IAsyncStateMachine;\n\t\tpublic readonly PredefinedType INotifyCompletion;\n\t\tpublic readonly PredefinedType ICriticalNotifyCompletion;\n\n\t\tpublic PredefinedTypes (ModuleContainer module)\n\t\t{\n\t\t\tTypedReference = new PredefinedType (module, MemberKind.Struct, \"System\", \"TypedReference\");\n\t\t\tArgIterator = new PredefinedType (module, MemberKind.Struct, \"System\", \"ArgIterator\");\n\n\t\t\tMarshalByRefObject = new PredefinedType (module, MemberKind.Class, \"System\", \"MarshalByRefObject\");\n\t\t\tRuntimeHelpers = new PredefinedType (module, MemberKind.Class, \"System.Runtime.CompilerServices\", \"RuntimeHelpers\");\n\t\t\tIAsyncResult = new PredefinedType (module, MemberKind.Interface, \"System\", \"IAsyncResult\");\n\t\t\tAsyncCallback = new PredefinedType (module, MemberKind.Delegate, \"System\", \"AsyncCallback\");\n\t\t\tRuntimeArgumentHandle = new PredefinedType (module, MemberKind.Struct, \"System\", \"RuntimeArgumentHandle\");\n\t\t\tCharSet = new PredefinedType (module, MemberKind.Enum, \"System.Runtime.InteropServices\", \"CharSet\");\n\t\t\tIsVolatile = new PredefinedType (module, MemberKind.Class, \"System.Runtime.CompilerServices\", \"IsVolatile\");\n\t\t\tIEnumeratorGeneric = new PredefinedType (module, MemberKind.Interface, \"System.Collections.Generic\", \"IEnumerator\", 1);\n\t\t\tIListGeneric = new PredefinedType (module, MemberKind.Interface, \"System.Collections.Generic\", \"IList\", 1);\n\t\t\tIReadOnlyListGeneric = new PredefinedType (module, MemberKind.Interface, \"System.Collections.Generic\", \"IReadOnlyList\", 1);\n\t\t\tICollectionGeneric = new PredefinedType (module, MemberKind.Interface, \"System.Collections.Generic\", \"ICollection\", 1);\n\t\t\tIReadOnlyCollectionGeneric = new PredefinedType (module, MemberKind.Interface, \"System.Collections.Generic\", \"IReadOnlyCollection\", 1);\n\t\t\tIEnumerableGeneric = new PredefinedType (module, MemberKind.Interface, \"System.Collections.Generic\", \"IEnumerable\", 1);\n\t\t\tNullable = new PredefinedType (module, MemberKind.Struct, \"System\", \"Nullable\", 1);\n\t\t\tActivator = new PredefinedType (module, MemberKind.Class, \"System\", \"Activator\");\n\t\t\tInterlocked = new PredefinedType (module, MemberKind.Class, \"System.Threading\", \"Interlocked\");\n\t\t\tMonitor = new PredefinedType (module, MemberKind.Class, \"System.Threading\", \"Monitor\");\n\t\t\tNotSupportedException = new PredefinedType (module, MemberKind.Class, \"System\", \"NotSupportedException\");\n\t\t\tRuntimeFieldHandle = new PredefinedType (module, MemberKind.Struct, \"System\", \"RuntimeFieldHandle\");\n\t\t\tRuntimeMethodHandle = new PredefinedType (module, MemberKind.Struct, \"System\", \"RuntimeMethodHandle\");\n\t\t\tSecurityAction = new PredefinedType (module, MemberKind.Enum, \"System.Security.Permissions\", \"SecurityAction\");\n\t\t\tDictionary = new PredefinedType (module, MemberKind.Class, \"System.Collections.Generic\", \"Dictionary\", 2);\n\t\t\tHashtable = new PredefinedType (module, MemberKind.Class, \"System.Collections\", \"Hashtable\");\n\n\t\t\tExpression = new PredefinedType (module, MemberKind.Class, \"System.Linq.Expressions\", \"Expression\");\n\t\t\tExpressionGeneric = new PredefinedType (module, MemberKind.Class, \"System.Linq.Expressions\", \"Expression\", 1);\n\t\t\tMemberBinding = new PredefinedType (module, MemberKind.Class, \"System.Linq.Expressions\", \"MemberBinding\");\n\t\t\tParameterExpression = new PredefinedType (module, MemberKind.Class, \"System.Linq.Expressions\", \"ParameterExpression\");\n\t\t\tFieldInfo = new PredefinedType (module, MemberKind.Class, \"System.Reflection\", \"FieldInfo\");\n\t\t\tMethodBase = new PredefinedType (module, MemberKind.Class, \"System.Reflection\", \"MethodBase\");\n\t\t\tMethodInfo = new PredefinedType (module, MemberKind.Class, \"System.Reflection\", \"MethodInfo\");\n\t\t\tConstructorInfo = new PredefinedType (module, MemberKind.Class, \"System.Reflection\", \"ConstructorInfo\");\n\n\t\t\tCallSite = new PredefinedType (module, MemberKind.Class, \"System.Runtime.CompilerServices\", \"CallSite\");\n\t\t\tCallSiteGeneric = new PredefinedType (module, MemberKind.Class, \"System.Runtime.CompilerServices\", \"CallSite\", 1);\n\t\t\tBinder = new PredefinedType (module, MemberKind.Class, \"Microsoft.CSharp.RuntimeBinder\", \"Binder\");\n\t\t\tBinderFlags = new PredefinedType (module, MemberKind.Enum, \"Microsoft.CSharp.RuntimeBinder\", \"CSharpBinderFlags\");\n\n\t\t\tAction = new PredefinedType (module, MemberKind.Delegate, \"System\", \"Action\");\n\t\t\tAsyncVoidMethodBuilder = new PredefinedType (module, MemberKind.Struct, \"System.Runtime.CompilerServices\", \"AsyncVoidMethodBuilder\");\n\t\t\tAsyncTaskMethodBuilder = new PredefinedType (module, MemberKind.Struct, \"System.Runtime.CompilerServices\", \"AsyncTaskMethodBuilder\");\n\t\t\tAsyncTaskMethodBuilderGeneric = new PredefinedType (module, MemberKind.Struct, \"System.Runtime.CompilerServices\", \"AsyncTaskMethodBuilder\", 1);\n\t\t\tTask = new PredefinedType (module, MemberKind.Class, \"System.Threading.Tasks\", \"Task\");\n\t\t\tTaskGeneric = new PredefinedType (module, MemberKind.Class, \"System.Threading.Tasks\", \"Task\", 1);\n\t\t\tIAsyncStateMachine = new PredefinedType (module, MemberKind.Interface, \"System.Runtime.CompilerServices\", \"IAsyncStateMachine\");\n\t\t\tINotifyCompletion = new PredefinedType (module, MemberKind.Interface, \"System.Runtime.CompilerServices\", \"INotifyCompletion\");\n\t\t\tICriticalNotifyCompletion = new PredefinedType (module, MemberKind.Interface, \"System.Runtime.CompilerServices\", \"ICriticalNotifyCompletion\");\n\n\t\t\t//\n\t\t\t// Define types which are used for comparison. It does not matter\n\t\t\t// if they don't exist as no error report is needed\n\t\t\t//\n\t\t\tif (TypedReference.Define ())\n\t\t\t\tTypedReference.TypeSpec.IsSpecialRuntimeType = true;\n\n\t\t\tif (ArgIterator.Define ())\n\t\t\t\tArgIterator.TypeSpec.IsSpecialRuntimeType = true;\n\n\t\t\tif (IEnumerableGeneric.Define ())\n\t\t\t\tIEnumerableGeneric.TypeSpec.IsArrayGenericInterface = true;\n\n\t\t\tif (IListGeneric.Define ())\n\t\t\t\tIListGeneric.TypeSpec.IsArrayGenericInterface = true;\n\n\t\t\tif (IReadOnlyListGeneric.Define ())\n\t\t\t\tIReadOnlyListGeneric.TypeSpec.IsArrayGenericInterface = true;\n\n\t\t\tif (ICollectionGeneric.Define ())\n\t\t\t\tICollectionGeneric.TypeSpec.IsArrayGenericInterface = true;\n\n\t\t\tif (IReadOnlyCollectionGeneric.Define ())\n\t\t\t\tIReadOnlyCollectionGeneric.TypeSpec.IsArrayGenericInterface = true;\n\n\t\t\tif (Nullable.Define ())\n\t\t\t\tNullable.TypeSpec.IsNullableType = true;\n\n\t\t\tif (ExpressionGeneric.Define ())\n\t\t\t\tExpressionGeneric.TypeSpec.IsExpressionTreeType = true;\n\n\t\t\tTask.Define ();\n\t\t\tif (TaskGeneric.Define ())\n\t\t\t\tTaskGeneric.TypeSpec.IsGenericTask = true;\n\n\t\t\tSwitchUserTypes = Switch.CreateSwitchUserTypes (module, Nullable.TypeSpec);\n\t\t}\n\t}\n\n\tclass PredefinedMembers\n\t{\n\t\tpublic readonly PredefinedMember<MethodSpec> ActivatorCreateInstance;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderCreate;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderStart;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderSetResult;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderSetException;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderSetStateMachine;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderOnCompleted;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderOnCompletedUnsafe;\n\t\tpublic readonly PredefinedMember<PropertySpec> AsyncTaskMethodBuilderTask;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericCreate;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericStart;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericSetResult;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericSetException;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericSetStateMachine;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericOnCompleted;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncTaskMethodBuilderGenericOnCompletedUnsafe;\n\t\tpublic readonly PredefinedMember<PropertySpec> AsyncTaskMethodBuilderGenericTask;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderCreate;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderStart;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderSetException;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderSetResult;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderSetStateMachine;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderOnCompleted;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncVoidMethodBuilderOnCompletedUnsafe;\n\t\tpublic readonly PredefinedMember<MethodSpec> AsyncStateMachineAttributeCtor;\n\t\tpublic readonly PredefinedMember<MethodSpec> DebuggerBrowsableAttributeCtor;\n\t\tpublic readonly PredefinedMember<MethodSpec> DecimalCtor;\n\t\tpublic readonly PredefinedMember<MethodSpec> DecimalCtorInt;\n\t\tpublic readonly PredefinedMember<MethodSpec> DecimalCtorLong;\n\t\tpublic readonly PredefinedMember<MethodSpec> DecimalConstantAttributeCtor;\n\t\tpublic readonly PredefinedMember<MethodSpec> DefaultMemberAttributeCtor;\n\t\tpublic readonly PredefinedMember<MethodSpec> DelegateCombine;\n\t\tpublic readonly PredefinedMember<MethodSpec> DelegateEqual;\n\t\tpublic readonly PredefinedMember<MethodSpec> DelegateInequal;\n\t\tpublic readonly PredefinedMember<MethodSpec> DelegateRemove;\n\t\tpublic readonly PredefinedMember<MethodSpec> DynamicAttributeCtor;\n\t\tpublic readonly PredefinedMember<MethodSpec> FieldInfoGetFieldFromHandle;\n\t\tpublic readonly PredefinedMember<MethodSpec> FieldInfoGetFieldFromHandle2;\n\t\tpublic readonly PredefinedMember<MethodSpec> IDisposableDispose;\n\t\tpublic readonly PredefinedMember<MethodSpec> IEnumerableGetEnumerator;\n\t\tpublic readonly PredefinedMember<MethodSpec> InterlockedCompareExchange;\n\t\tpublic readonly PredefinedMember<MethodSpec> InterlockedCompareExchange_T;\n\t\tpublic readonly PredefinedMember<MethodSpec> FixedBufferAttributeCtor;\n\t\tpublic readonly PredefinedMember<MethodSpec> MethodInfoGetMethodFromHandle;\n\t\tpublic readonly PredefinedMember<MethodSpec> MethodInfoGetMethodFromHandle2;\n\t\tpublic readonly PredefinedMember<MethodSpec> MonitorEnter;\n\t\tpublic readonly PredefinedMember<MethodSpec> MonitorEnter_v4;\n\t\tpublic readonly PredefinedMember<MethodSpec> MonitorExit;\n\t\tpublic readonly PredefinedMember<PropertySpec> RuntimeCompatibilityWrapNonExceptionThrows;\n\t\tpublic readonly PredefinedMember<MethodSpec> RuntimeHelpersInitializeArray;\n\t\tpublic readonly PredefinedMember<PropertySpec> RuntimeHelpersOffsetToStringData;\n\t\tpublic readonly PredefinedMember<ConstSpec> SecurityActionRequestMinimum;\n\t\tpublic readonly PredefinedMember<FieldSpec> StringEmpty;\n\t\tpublic readonly PredefinedMember<MethodSpec> StringEqual;\n\t\tpublic readonly PredefinedMember<MethodSpec> StringInequal;\n\t\tpublic readonly PredefinedMember<MethodSpec> StructLayoutAttributeCtor;\n\t\tpublic readonly PredefinedMember<FieldSpec> StructLayoutCharSet;\n\t\tpublic readonly PredefinedMember<FieldSpec> StructLayoutSize;\n\t\tpublic readonly PredefinedMember<MethodSpec> TypeGetTypeFromHandle;\n\n\t\tpublic PredefinedMembers (ModuleContainer module)\n\t\t{\n\t\t\tvar types = module.PredefinedTypes;\n\t\t\tvar atypes = module.PredefinedAttributes;\n\t\t\tvar btypes = module.Compiler.BuiltinTypes;\n\n\t\t\tvar tp = new TypeParameter (0, new MemberName (\"T\"), null, null, Variance.None);\n\n\t\t\tActivatorCreateInstance = new PredefinedMember<MethodSpec> (module, types.Activator,\n\t\t\t\tMemberFilter.Method (\"CreateInstance\", 1, ParametersCompiled.EmptyReadOnlyParameters, null));\n\n\t\t\tAsyncTaskMethodBuilderCreate = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"Create\", 0, ParametersCompiled.EmptyReadOnlyParameters, types.AsyncTaskMethodBuilder.TypeSpec));\n\n\t\t\tAsyncTaskMethodBuilderSetResult = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"SetResult\", 0, ParametersCompiled.EmptyReadOnlyParameters, btypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderSetStateMachine = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\t\"SetStateMachine\", MemberKind.Method, () => new[] {\n\t\t\t\t\t\ttypes.IAsyncStateMachine.TypeSpec\n\t\t\t\t}, btypes.Void);\n\n\t\t\tAsyncTaskMethodBuilderSetException = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"SetException\", 0,\n\t\t\t\tParametersCompiled.CreateFullyResolved (btypes.Exception), btypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderOnCompleted = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"AwaitOnCompleted\", 2,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (1, tp, SpecialConstraint.None, Variance.None, null)\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderOnCompletedUnsafe = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"AwaitUnsafeOnCompleted\", 2,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (1, tp, SpecialConstraint.None, Variance.None, null)\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderStart = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"Start\", 1,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderTask = new PredefinedMember<PropertySpec> (module, types.AsyncTaskMethodBuilder,\n\t\t\t\tMemberFilter.Property (\"Task\", null));\n\n\t\t\tAsyncTaskMethodBuilderGenericCreate = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\tMemberFilter.Method (\"Create\", 0, ParametersCompiled.EmptyReadOnlyParameters, types.AsyncVoidMethodBuilder.TypeSpec));\n\n\t\t\tAsyncTaskMethodBuilderGenericSetResult = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\t\"SetResult\", MemberKind.Method, () => new TypeSpec[] {\n\t\t\t\t\t\ttypes.AsyncTaskMethodBuilderGeneric.TypeSpec.MemberDefinition.TypeParameters[0]\n\t\t\t\t}, btypes.Void);\n\n\t\t\tAsyncTaskMethodBuilderGenericSetStateMachine = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\t\"SetStateMachine\", MemberKind.Method, () => new[] {\n\t\t\t\t\t\ttypes.IAsyncStateMachine.TypeSpec\n\t\t\t\t}, btypes.Void);\n\n\t\t\tAsyncTaskMethodBuilderGenericSetException = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\tMemberFilter.Method (\"SetException\", 0,\n\t\t\t\tParametersCompiled.CreateFullyResolved (btypes.Exception), btypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderGenericOnCompleted = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\tMemberFilter.Method (\"AwaitOnCompleted\", 2,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (1, tp, SpecialConstraint.None, Variance.None, null)\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderGenericOnCompletedUnsafe = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\tMemberFilter.Method (\"AwaitUnsafeOnCompleted\", 2,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (1, tp, SpecialConstraint.None, Variance.None, null)\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderGenericStart = new PredefinedMember<MethodSpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\tMemberFilter.Method (\"Start\", 1,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncTaskMethodBuilderGenericTask = new PredefinedMember<PropertySpec> (module, types.AsyncTaskMethodBuilderGeneric,\n\t\t\t\tMemberFilter.Property (\"Task\", null));\n\n\t\t\tAsyncVoidMethodBuilderCreate = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"Create\", 0, ParametersCompiled.EmptyReadOnlyParameters, types.AsyncVoidMethodBuilder.TypeSpec));\n\n\t\t\tAsyncVoidMethodBuilderSetException = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"SetException\", 0, null, btypes.Void));\n\n\t\t\tAsyncVoidMethodBuilderSetResult = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"SetResult\", 0, ParametersCompiled.EmptyReadOnlyParameters, btypes.Void));\n\n\t\t\tAsyncVoidMethodBuilderSetStateMachine = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,\n\t\t\t\t\"SetStateMachine\", MemberKind.Method, () => new[] {\n\t\t\t\t\t\ttypes.IAsyncStateMachine.TypeSpec\n\t\t\t\t}, btypes.Void);\n\n\t\t\tAsyncVoidMethodBuilderOnCompleted = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"AwaitOnCompleted\", 2,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (1, tp, SpecialConstraint.None, Variance.None, null)\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncVoidMethodBuilderOnCompletedUnsafe = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"AwaitUnsafeOnCompleted\", 2,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (1, tp, SpecialConstraint.None, Variance.None, null)\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncVoidMethodBuilderStart = new PredefinedMember<MethodSpec> (module, types.AsyncVoidMethodBuilder,\n\t\t\t\tMemberFilter.Method (\"Start\", 1,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tbtypes.Void));\n\n\t\t\tAsyncStateMachineAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.AsyncStateMachine,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (\n\t\t\t\t\tbtypes.Type)));\n\n\t\t\tDebuggerBrowsableAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.DebuggerBrowsable,\n\t\t\t\tMemberFilter.Constructor (null));\n\n\t\t\tDecimalCtor = new PredefinedMember<MethodSpec> (module, btypes.Decimal,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (\n\t\t\t\t\tbtypes.Int, btypes.Int, btypes.Int, btypes.Bool, btypes.Byte)));\n\n\t\t\tDecimalCtorInt = new PredefinedMember<MethodSpec> (module, btypes.Decimal,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.Int)));\n\n\t\t\tDecimalCtorLong = new PredefinedMember<MethodSpec> (module, btypes.Decimal,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.Long)));\n\n\t\t\tDecimalConstantAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.DecimalConstant,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (\n\t\t\t\t\tbtypes.Byte, btypes.Byte, btypes.UInt, btypes.UInt, btypes.UInt)));\n\n\t\t\tDefaultMemberAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.DefaultMember,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.String)));\n\n\t\t\tDelegateCombine = new PredefinedMember<MethodSpec> (module, btypes.Delegate, \"Combine\", btypes.Delegate, btypes.Delegate);\n\t\t\tDelegateRemove = new PredefinedMember<MethodSpec> (module, btypes.Delegate, \"Remove\", btypes.Delegate, btypes.Delegate);\n\n\t\t\tDelegateEqual = new PredefinedMember<MethodSpec> (module, btypes.Delegate,\n\t\t\t\tnew MemberFilter (Operator.GetMetadataName (Operator.OpType.Equality), 0, MemberKind.Operator, null, btypes.Bool));\n\n\t\t\tDelegateInequal = new PredefinedMember<MethodSpec> (module, btypes.Delegate,\n\t\t\t\tnew MemberFilter (Operator.GetMetadataName (Operator.OpType.Inequality), 0, MemberKind.Operator, null, btypes.Bool));\n\n\t\t\tDynamicAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.Dynamic,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (\n\t\t\t\t\tArrayContainer.MakeType (module, btypes.Bool))));\n\n\t\t\tFieldInfoGetFieldFromHandle = new PredefinedMember<MethodSpec> (module, types.FieldInfo,\n\t\t\t\t\"GetFieldFromHandle\", MemberKind.Method, types.RuntimeFieldHandle);\n\n\t\t\tFieldInfoGetFieldFromHandle2 = new PredefinedMember<MethodSpec> (module, types.FieldInfo,\n\t\t\t\t\"GetFieldFromHandle\", MemberKind.Method, types.RuntimeFieldHandle, new PredefinedType (btypes.RuntimeTypeHandle));\n\n\t\t\tFixedBufferAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.FixedBuffer,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.Type, btypes.Int)));\n\n\t\t\tIDisposableDispose = new PredefinedMember<MethodSpec> (module, btypes.IDisposable, \"Dispose\", TypeSpec.EmptyTypes);\n\n\t\t\tIEnumerableGetEnumerator = new PredefinedMember<MethodSpec> (module, btypes.IEnumerable,\n\t\t\t\t\"GetEnumerator\", TypeSpec.EmptyTypes);\n\n\t\t\tInterlockedCompareExchange = new PredefinedMember<MethodSpec> (module, types.Interlocked,\n\t\t\t\tMemberFilter.Method (\"CompareExchange\", 0,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.NONE),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.NONE)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tbtypes.Int, btypes.Int, btypes.Int\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tfalse),\n\t\t\t\tbtypes.Int));\n\n\t\t\tInterlockedCompareExchange_T = new PredefinedMember<MethodSpec> (module, types.Interlocked,\n\t\t\t\tMemberFilter.Method (\"CompareExchange\", 1,\n\t\t\t\t\tnew ParametersImported (\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.NONE),\n\t\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.NONE)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t\tnew TypeParameterSpec (0, tp, SpecialConstraint.None, Variance.None, null),\n\t\t\t\t\t\t\t}, false),\n\t\t\t\t\tnull));\n\n\t\t\tMethodInfoGetMethodFromHandle = new PredefinedMember<MethodSpec> (module, types.MethodBase,\n\t\t\t\t\"GetMethodFromHandle\", MemberKind.Method, types.RuntimeMethodHandle);\n\n\t\t\tMethodInfoGetMethodFromHandle2 = new PredefinedMember<MethodSpec> (module, types.MethodBase,\n\t\t\t\t\"GetMethodFromHandle\", MemberKind.Method, types.RuntimeMethodHandle, new PredefinedType (btypes.RuntimeTypeHandle));\n\n\t\t\tMonitorEnter = new PredefinedMember<MethodSpec> (module, types.Monitor, \"Enter\", btypes.Object);\n\n\t\t\tMonitorEnter_v4 = new PredefinedMember<MethodSpec> (module, types.Monitor,\n\t\t\t\tMemberFilter.Method (\"Enter\", 0,\n\t\t\t\t\tnew ParametersImported (new[] {\n\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.NONE),\n\t\t\t\t\t\t\tnew ParameterData (null, Parameter.Modifier.REF)\n\t\t\t\t\t\t},\n\t\t\t\t\tnew[] {\n\t\t\t\t\t\t\tbtypes.Object, btypes.Bool\n\t\t\t\t\t\t}, false), null));\n\n\t\t\tMonitorExit = new PredefinedMember<MethodSpec> (module, types.Monitor, \"Exit\", btypes.Object);\n\n\t\t\tRuntimeCompatibilityWrapNonExceptionThrows = new PredefinedMember<PropertySpec> (module, atypes.RuntimeCompatibility,\n\t\t\t\tMemberFilter.Property (\"WrapNonExceptionThrows\", btypes.Bool));\n\n\t\t\tRuntimeHelpersInitializeArray = new PredefinedMember<MethodSpec> (module, types.RuntimeHelpers,\n\t\t\t\t\"InitializeArray\", btypes.Array, btypes.RuntimeFieldHandle);\n\n\t\t\tRuntimeHelpersOffsetToStringData = new PredefinedMember<PropertySpec> (module, types.RuntimeHelpers,\n\t\t\t\tMemberFilter.Property (\"OffsetToStringData\", btypes.Int));\n\n\t\t\tSecurityActionRequestMinimum = new PredefinedMember<ConstSpec> (module, types.SecurityAction, \"RequestMinimum\",\n\t\t\t\tMemberKind.Field, types.SecurityAction);\n\n\t\t\tStringEmpty = new PredefinedMember<FieldSpec> (module, btypes.String, MemberFilter.Field (\"Empty\", btypes.String));\n\n\t\t\tStringEqual = new PredefinedMember<MethodSpec> (module, btypes.String,\n\t\t\t\tnew MemberFilter (Operator.GetMetadataName (Operator.OpType.Equality), 0, MemberKind.Operator, null, btypes.Bool));\n\n\t\t\tStringInequal = new PredefinedMember<MethodSpec> (module, btypes.String,\n\t\t\t\tnew MemberFilter (Operator.GetMetadataName (Operator.OpType.Inequality), 0, MemberKind.Operator, null, btypes.Bool));\n\n\t\t\tStructLayoutAttributeCtor = new PredefinedMember<MethodSpec> (module, atypes.StructLayout,\n\t\t\t\tMemberFilter.Constructor (ParametersCompiled.CreateFullyResolved (btypes.Short)));\n\n\t\t\tStructLayoutCharSet = new PredefinedMember<FieldSpec> (module, atypes.StructLayout, \"CharSet\",\n\t\t\t\tMemberKind.Field, types.CharSet);\n\n\t\t\tStructLayoutSize = new PredefinedMember<FieldSpec> (module, atypes.StructLayout,\n\t\t\t\tMemberFilter.Field (\"Size\", btypes.Int));\n\n\t\t\tTypeGetTypeFromHandle = new PredefinedMember<MethodSpec> (module, btypes.Type, \"GetTypeFromHandle\", btypes.RuntimeTypeHandle);\n\t\t}\n\t}\n\n\tpublic class PredefinedType\n\t{\n\t\treadonly string name;\n\t\treadonly string ns;\n\t\treadonly int arity;\n\t\treadonly MemberKind kind;\n\t\tprotected readonly ModuleContainer module;\n\t\tprotected TypeSpec type;\n\t\tbool defined;\n\n\t\tpublic PredefinedType (ModuleContainer module, MemberKind kind, string ns, string name, int arity)\n\t\t\t: this (module, kind, ns, name)\n\t\t{\n\t\t\tthis.arity = arity;\n\t\t}\n\n\t\tpublic PredefinedType (ModuleContainer module, MemberKind kind, string ns, string name)\n\t\t{\n\t\t\tthis.module = module;\n\t\t\tthis.kind = kind;\n\t\t\tthis.name = name;\n\t\t\tthis.ns = ns;\n\t\t}\n\n\t\tpublic PredefinedType (BuiltinTypeSpec type)\n\t\t{\n\t\t\tthis.kind = type.Kind;\n\t\t\tthis.name = type.Name;\n\t\t\tthis.ns = type.Namespace;\n\t\t\tthis.type = type;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic int Arity {\n\t\t\tget {\n\t\t\t\treturn arity;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsDefined {\n\t\t\tget {\n\t\t\t\treturn type != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\treturn ns;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec TypeSpec {\n\t\t\tget {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic bool Define ()\n\t\t{\n\t\t\tif (type != null)\n\t\t\t\treturn true;\n\n\t\t\tif (!defined) {\n\t\t\t\tdefined = true;\n\t\t\t\ttype = Resolve (module, kind, ns, name, arity, false, false);\n\t\t\t}\n\n\t\t\treturn type != null;\n\t\t}\n\n\t\tpublic string GetSignatureForError ()\n\t\t{\n\t\t\treturn ns + \".\" + name;\n\t\t}\n\n\t\tpublic static TypeSpec Resolve (ModuleContainer module, MemberKind kind, string ns, string name, int arity, bool required, bool reportErrors)\n\t\t{\n\t\t\t//\n\t\t\t// Cannot call it with true because it could create non-existent namespaces for\n\t\t\t// predefined types. It's set to true only for build-in types which all must\n\t\t\t// exist therefore it does not matter, for predefined types we don't want to create\n\t\t\t// fake namespaces when type is optional and does not exist (e.g. System.Linq).\n\t\t\t//\n\t\t\tNamespace type_ns = module.GlobalRootNamespace.GetNamespace (ns, required);\n\n\t\t\tIList<TypeSpec> found = null;\n\t\t\tif (type_ns != null)\n\t\t\t\tfound = type_ns.GetAllTypes (name);\n\n\t\t\tif (found == null) {\n\t\t\t\tif (reportErrors)\n\t\t\t\t\tmodule.Compiler.Report.Error (518, \"The predefined type `{0}.{1}' is not defined or imported\", ns, name);\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tTypeSpec best_match = null;\n\t\t\tforeach (var candidate in found) {\n\t\t\t\tif (candidate.Kind != kind) {\n\t\t\t\t\tif (candidate.Kind == MemberKind.Struct && kind == MemberKind.Void && candidate.MemberDefinition is TypeContainer) {\n\t\t\t\t\t\t// Void is declared as struct but we keep it internally as\n\t\t\t\t\t\t// special kind, the swap will be done by caller\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (candidate.Arity != arity)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif ((candidate.Modifiers & Modifiers.INTERNAL) != 0 && !candidate.MemberDefinition.IsInternalAsPublic (module.DeclaringAssembly))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (best_match == null) {\n\t\t\t\t\tbest_match = candidate;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar other_match = best_match;\n\t\t\t\tif (!best_match.MemberDefinition.IsImported &&\n\t\t\t\t\tmodule.Compiler.BuiltinTypes.Object.MemberDefinition.DeclaringAssembly == candidate.MemberDefinition.DeclaringAssembly) {\n\t\t\t\t\tbest_match = candidate;\n\t\t\t\t}\n\n\t\t\t\tstring location;\n\t\t\t\tif (best_match.MemberDefinition is MemberCore) {\n\t\t\t\t\tlocation = ((MemberCore) best_match.MemberDefinition).Location.Name;\n\t\t\t\t} else {\n\t\t\t\t\tvar assembly = (ImportedAssemblyDefinition) best_match.MemberDefinition.DeclaringAssembly;\n\t\t\t\t\tlocation = Path.GetFileName (assembly.Location);\n\t\t\t\t}\n\n\t\t\t\tmodule.Compiler.Report.SymbolRelatedToPreviousError (other_match);\n\t\t\t\tmodule.Compiler.Report.SymbolRelatedToPreviousError (candidate);\n\n\t\t\t\tmodule.Compiler.Report.Warning (1685, 1,\n\t\t\t\t\t\"The predefined type `{0}.{1}' is defined multiple times. Using definition from `{2}'\",\n\t\t\t\t\tns, name, location);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (best_match == null && reportErrors) {\n\t\t\t\tvar found_member = found[0];\n\n\t\t\t\tif (found_member.Kind == MemberKind.MissingType) {\n\t\t\t\t\t// CSC: should be different error number\n\t\t\t\t\tmodule.Compiler.Report.Error (518, \"The predefined type `{0}.{1}' is defined in an assembly that is not referenced.\", ns, name);\n\t\t\t\t} else {\n\t\t\t\t\tLocation loc;\n\t\t\t\t\tif (found_member.MemberDefinition is MemberCore) {\n\t\t\t\t\t\tloc = ((MemberCore) found_member.MemberDefinition).Location;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tloc = Location.Null;\n\t\t\t\t\t\tmodule.Compiler.Report.SymbolRelatedToPreviousError (found_member);\n\t\t\t\t\t}\n\n\t\t\t\t\tmodule.Compiler.Report.Error (520, loc, \"The predefined type `{0}.{1}' is not declared correctly\", ns, name);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn best_match;\n\t\t}\n\n\t\tpublic TypeSpec Resolve ()\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\ttype = Resolve (module, kind, ns, name, arity, false, true);\n\n\t\t\treturn type;\n\t\t}\n\t}\n\n\tpublic class PredefinedMember<T> where T : MemberSpec\n\t{\n\t\treadonly ModuleContainer module;\n\t\tT member;\n\t\tTypeSpec declaring_type;\n\t\treadonly PredefinedType declaring_type_predefined;\n\t\tMemberFilter filter;\n\t\treadonly Func<TypeSpec[]> filter_builder;\n\n\t\tpublic PredefinedMember (ModuleContainer module, PredefinedType type, MemberFilter filter)\n\t\t{\n\t\t\tthis.module = module;\n\t\t\tthis.declaring_type_predefined = type;\n\t\t\tthis.filter = filter;\n\t\t}\n\n\t\tpublic PredefinedMember (ModuleContainer module, TypeSpec type, MemberFilter filter)\n\t\t{\n\t\t\tthis.module = module;\n\t\t\tthis.declaring_type = type;\n\t\t\tthis.filter = filter;\n\t\t}\n\n\t\tpublic PredefinedMember (ModuleContainer module, PredefinedType type, string name, params TypeSpec[] types)\n\t\t\t: this (module, type, MemberFilter.Method (name, 0, ParametersCompiled.CreateFullyResolved (types), null))\n\t\t{\n\t\t}\n\n\t\tpublic PredefinedMember (ModuleContainer module, PredefinedType type, string name, MemberKind kind, params PredefinedType[] types)\n\t\t\t: this (module, type, new MemberFilter (name, 0, kind, null, null))\n\t\t{\n\t\t\tfilter_builder = () => {\n\t\t\t\tvar ptypes = new TypeSpec[types.Length];\n\t\t\t\tfor (int i = 0; i < ptypes.Length; ++i) {\n\t\t\t\t\tvar p = types[i];\n\t\t\t\t\tif (!p.Define ())\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tptypes[i] = p.TypeSpec;\n\t\t\t\t}\n\n\t\t\t\treturn ptypes;\n\t\t\t};\n\t\t}\n\n\t\tpublic PredefinedMember (ModuleContainer module, PredefinedType type, string name, MemberKind kind, Func<TypeSpec[]> typesBuilder, TypeSpec returnType)\n\t\t\t: this (module, type, new MemberFilter (name, 0, kind, null, returnType))\n\t\t{\n\t\t\tfilter_builder = typesBuilder;\n\t\t}\n\n\t\tpublic PredefinedMember (ModuleContainer module, BuiltinTypeSpec type, string name, params TypeSpec[] types)\n\t\t\t: this (module, type, MemberFilter.Method (name, 0, ParametersCompiled.CreateFullyResolved (types), null))\n\t\t{\n\t\t}\n\n\t\tpublic T Get ()\n\t\t{\n\t\t\tif (member != null)\n\t\t\t\treturn member;\n\n\t\t\tif (declaring_type == null) {\n\t\t\t\tif (!declaring_type_predefined.Define ())\n\t\t\t\t\treturn null;\n\n\t\t\t\tdeclaring_type = declaring_type_predefined.TypeSpec;\n\t\t\t}\n\n\t\t\tif (filter_builder != null) {\n\t\t\t\tvar types = filter_builder ();\n\n\t\t\t\tif (filter.Kind == MemberKind.Field)\n\t\t\t\t\tfilter = new MemberFilter (filter.Name, filter.Arity, filter.Kind, null, types [0]);\n\t\t\t\telse\n\t\t\t\t\tfilter = new MemberFilter (filter.Name, filter.Arity, filter.Kind,\n\t\t\t\t\t\tParametersCompiled.CreateFullyResolved (types), filter.MemberType);\n\t\t\t}\n\n\t\t\tmember = MemberCache.FindMember (declaring_type, filter, BindingRestriction.DeclaredOnly) as T;\n\t\t\tif (member == null)\n\t\t\t\treturn null;\n\n\t\t\tif (!member.IsAccessible (module))\n\t\t\t\treturn null;\n\n\t\t\treturn member;\n\t\t}\n\n\t\tpublic T Resolve (Location loc)\n\t\t{\n\t\t\tif (member != null)\n\t\t\t\treturn member;\n\n\t\t\tif (Get () != null)\n\t\t\t\treturn member;\n\n\t\t\tif (declaring_type == null) {\n\t\t\t\tif (declaring_type_predefined.Resolve () == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (filter_builder != null) {\n\t\t\t\tfilter = new MemberFilter (filter.Name, filter.Arity, filter.Kind,\n\t\t\t\t\tParametersCompiled.CreateFullyResolved (filter_builder ()), filter.MemberType);\n\t\t\t}\n\n\t\t\tstring method_args = null;\n\t\t\tif (filter.Parameters != null)\n\t\t\t\tmethod_args = filter.Parameters.GetSignatureForError ();\n\n\t\t\tmodule.Compiler.Report.Error (656, loc, \"The compiler required member `{0}.{1}{2}' could not be found or is inaccessible\",\n\t\t\t\tdeclaring_type.GetSignatureForError (), filter.Name, method_args);\n\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class AwaiterDefinition\n\t{\n\t\tpublic PropertySpec IsCompleted { get; set; }\n\t\tpublic MethodSpec GetResult { get; set; }\n\t\tpublic bool INotifyCompletion { get; set; }\n\n\t\tpublic bool IsValidPattern {\n\t\t\tget {\n\t\t\t\treturn IsCompleted != null && GetResult != null && IsCompleted.HasGet;\n\t\t\t}\n\t\t}\n\t}\n\n\tpartial class TypeManager {\n\n\tstatic public string CSharpName(IList<TypeSpec> types)\n\t{\n\t\tif (types.Count == 0)\n\t\t\treturn string.Empty;\n\n\t\tStringBuilder sb = new StringBuilder ();\n\t\tfor (int i = 0; i < types.Count; ++i) {\n\t\t\tif (i > 0)\n\t\t\t\tsb.Append (\",\");\n\n\t\t\tsb.Append (types [i].GetSignatureForError ());\n\t\t}\n\t\treturn sb.ToString ();\n\t}\n\n\tstatic public string GetFullNameSignature (MemberSpec mi)\n\t{\n\t\treturn mi.GetSignatureForError ();\n\t}\n\n\tstatic public string CSharpSignature (MemberSpec mb)\n\t{\n\t\treturn mb.GetSignatureForError ();\n\t}\n\t\t\n\tpublic static bool IsFamilyAccessible (TypeSpec type, TypeSpec parent)\n\t{\n//\t\tTypeParameter tparam = LookupTypeParameter (type);\n//\t\tTypeParameter pparam = LookupTypeParameter (parent);\n\n\t\tif (type.Kind == MemberKind.TypeParameter && parent.Kind == MemberKind.TypeParameter) { // (tparam != null) && (pparam != null)) {\n\t\t\tif (type == parent)\n\t\t\t\treturn true;\n\n\t\t\tthrow new NotImplementedException (\"net\");\n//\t\t\treturn tparam.IsSubclassOf (parent);\n\t\t}\n\n\t\tdo {\n\t\t\tif (IsInstantiationOfSameGenericType (type, parent))\n\t\t\t\treturn true;\n\n\t\t\ttype = type.BaseType;\n\t\t} while (type != null);\n\n\t\treturn false;\n\t}\n\n\t//\n\t// Checks whether `type' is a nested child of `parent'.\n\t//\n\tpublic static bool IsNestedChildOf (TypeSpec type, ITypeDefinition parent)\n\t{\n\t\tif (type == null)\n\t\t\treturn false;\n\n\t\tif (type.MemberDefinition == parent)\n\t\t\treturn false;\n\n\t\ttype = type.DeclaringType;\n\t\twhile (type != null) {\n\t\t\tif (type.MemberDefinition == parent)\n\t\t\t\treturn true;\n\n\t\t\ttype = type.DeclaringType;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic static TypeSpec GetElementType (TypeSpec t)\n\t{\n\t\treturn ((ElementTypeSpec)t).Element;\n\t}\n\n\t/// <summary>\n\t/// This method is not implemented by MS runtime for dynamic types\n\t/// </summary>\n\tpublic static bool HasElementType (TypeSpec t)\n\t{\n\t\treturn t is ElementTypeSpec;\n\t}\n\n\t/// <summary>\n\t///   Utility function that can be used to probe whether a type\n\t///   is managed or not.  \n\t/// </summary>\n\tpublic static bool VerifyUnmanaged (ModuleContainer rc, TypeSpec t, Location loc)\n\t{\n\t\tif (t.IsUnmanaged)\n\t\t\treturn true;\n\n\t\twhile (t.IsPointer)\n\t\t\tt = ((ElementTypeSpec) t).Element;\n\n\t\trc.Compiler.Report.SymbolRelatedToPreviousError (t);\n\t\trc.Compiler.Report.Error (208, loc,\n\t\t\t\"Cannot take the address of, get the size of, or declare a pointer to a managed type `{0}'\",\n\t\t\tt.GetSignatureForError ());\n\n\t\treturn false;\t\n\t}\n#region Generics\n\t// This method always return false for non-generic compiler,\n\t// while Type.IsGenericParameter is returned if it is supported.\n\tpublic static bool IsGenericParameter (TypeSpec type)\n\t{\n\t\treturn type.IsGenericParameter;\n\t}\n\n\tpublic static bool IsGenericType (TypeSpec type)\n\t{\n\t\treturn type.IsGeneric;\n\t}\n\n\tpublic static TypeSpec[] GetTypeArguments (TypeSpec t)\n\t{\n\t\t// TODO: return empty array !!\n\t\treturn t.TypeArguments;\n\t}\n\n\t/// <summary>\n\t///   Check whether `type' and `parent' are both instantiations of the same\n\t///   generic type.  Note that we do not check the type parameters here.\n\t/// </summary>\n\tpublic static bool IsInstantiationOfSameGenericType (TypeSpec type, TypeSpec parent)\n\t{\n\t\treturn type == parent || type.MemberDefinition == parent.MemberDefinition;\n\t}\n#endregion\n}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typespec.cs",
    "content": "﻿//\n// typespec.cs: Type specification\n//\n// Authors: Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright 2010 Novell, Inc\n// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\n\n#if STATIC\nusing MetaType = IKVM.Reflection.Type;\nusing IKVM.Reflection;\n#else\nusing MetaType = System.Type;\nusing System.Reflection;\n#endif\n\nnamespace Mono.CSharp\n{\n\t//\n\t// Inflated or non-inflated representation of any type. \n\t//\n\tpublic class TypeSpec : MemberSpec\n\t{\n\t\tprotected MetaType info;\n\t\tprotected MemberCache cache;\n\t\tprotected IList<TypeSpec> ifaces;\n\t\tTypeSpec base_type;\n\n\t\tDictionary<TypeSpec[], InflatedTypeSpec> inflated_instances;\n\n\t\tpublic static readonly TypeSpec[] EmptyTypes = new TypeSpec[0];\n\n#if !STATIC\n\t\t// Reflection Emit hacking\n\t\tstatic readonly Type TypeBuilder;\n\t\tstatic readonly Type GenericTypeBuilder;\n\n\t\tstatic TypeSpec ()\n\t\t{\n\t\t\tvar assembly = typeof (object).Assembly;\n\t\t\tTypeBuilder = assembly.GetType (\"System.Reflection.Emit.TypeBuilder\");\n\t\t\tGenericTypeBuilder = assembly.GetType (\"System.Reflection.MonoGenericClass\");\n\t\t\tif (GenericTypeBuilder == null)\n\t\t\t\tGenericTypeBuilder = assembly.GetType (\"System.Reflection.Emit.TypeBuilderInstantiation\");\n\t\t}\n#endif\n\n\t\tpublic TypeSpec (MemberKind kind, TypeSpec declaringType, ITypeDefinition definition, MetaType info, Modifiers modifiers)\n\t\t\t: base (kind, declaringType, definition, modifiers)\n\t\t{\n\t\t\tthis.declaringType = declaringType;\n\t\t\tthis.info = info;\n\n\t\t\tif (definition != null && definition.TypeParametersCount > 0)\n\t\t\t\tstate |= StateFlags.IsGeneric;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override int Arity {\n\t\t\tget {\n\t\t\t\treturn MemberDefinition.TypeParametersCount;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual TypeSpec BaseType {\n\t\t\tget {\n\t\t\t\treturn base_type;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tbase_type = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual BuiltinTypeSpec.Type BuiltinType {\n\t\t\tget {\n\t\t\t\treturn BuiltinTypeSpec.Type.None;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasDynamicElement {\n\t\t\tget {\n\t\t\t\treturn (state & StateFlags.HasDynamicElement) != 0;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns a list of all interfaces including\n\t\t// interfaces from base type or base interfaces\n\t\t//\n\t\tpublic virtual IList<TypeSpec> Interfaces {\n\t\t\tget {\n\t\t\t\tif ((state & StateFlags.InterfacesImported) == 0) {\n\t\t\t\t\tstate |= StateFlags.InterfacesImported;\n\n\t\t\t\t\t//\n\t\t\t\t\t// Delay interfaces expansion to save memory and once all\n\t\t\t\t\t// base types has been imported to avoid problems where\n\t\t\t\t\t// interface references type before its base was imported\n\t\t\t\t\t//\n\t\t\t\t\tvar imported = MemberDefinition as ImportedTypeDefinition;\n\t\t\t\t\tif (imported != null && Kind != MemberKind.MissingType)\n\t\t\t\t\t\timported.DefineInterfaces (this);\n\n\t\t\t\t}\n\n\t\t\t\treturn ifaces;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tifaces = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsArray {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.ArrayType;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAttribute {\n\t\t\tget {\n\t\t\t\tif (!IsClass)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar type = this;\n\t\t\t\tdo {\n\t\t\t\t\tif (type.BuiltinType == BuiltinTypeSpec.Type.Attribute)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tif (type.IsGeneric)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t\ttype = type.base_type;\n\t\t\t\t} while (type != null);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsInterface {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.Interface;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsClass {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.Class;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConstantCompatible {\n\t\t\tget {\n\t\t\t\tif ((Kind & (MemberKind.Enum | MemberKind.Class | MemberKind.Interface | MemberKind.Delegate | MemberKind.ArrayType)) != 0)\n\t\t\t\t\treturn true;\n\n\t\t\t\tswitch (BuiltinType) {\n\t\t\t\tcase BuiltinTypeSpec.Type.Int:\n\t\t\t\tcase BuiltinTypeSpec.Type.UInt:\n\t\t\t\tcase BuiltinTypeSpec.Type.Long:\n\t\t\t\tcase BuiltinTypeSpec.Type.ULong:\n\t\t\t\tcase BuiltinTypeSpec.Type.Float:\n\t\t\t\tcase BuiltinTypeSpec.Type.Double:\n\t\t\t\tcase BuiltinTypeSpec.Type.Char:\n\t\t\t\tcase BuiltinTypeSpec.Type.Short:\n\t\t\t\tcase BuiltinTypeSpec.Type.Decimal:\n\t\t\t\tcase BuiltinTypeSpec.Type.Bool:\n\t\t\t\tcase BuiltinTypeSpec.Type.SByte:\n\t\t\t\tcase BuiltinTypeSpec.Type.Byte:\n\t\t\t\tcase BuiltinTypeSpec.Type.UShort:\n\t\t\t\tcase BuiltinTypeSpec.Type.Dynamic:\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsDelegate {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.Delegate;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true for instances of Expression<T>\n\t\t//\n\t\tpublic virtual bool IsExpressionTreeType {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.InflatedExpressionType : state & ~StateFlags.InflatedExpressionType;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsEnum {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.Enum;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true for instances of IList<T>, IEnumerable<T>, ICollection<T>\n\t\t//\n\t\tpublic virtual bool IsArrayGenericInterface {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.GenericIterateInterface : state & ~StateFlags.GenericIterateInterface;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true for instances of System.Threading.Tasks.Task<T>\n\t\t//\n\t\tpublic virtual bool IsGenericTask {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.GenericTask : state & ~StateFlags.GenericTask;\n\t\t\t}\n\t\t}\n\n\t\t// TODO: Should probably do\n\t\t// IsGenericType -- recursive\n\t\t// HasTypeParameter -- non-recursive\n\t\tpublic bool IsGenericOrParentIsGeneric {\n\t\t\tget {\n\t\t\t\tvar ts = this;\n\t\t\t\tdo {\n\t\t\t\t\tif (ts.IsGeneric)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tts = ts.declaringType;\n\t\t\t\t} while (ts != null);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsGenericParameter {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.TypeParameter;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Returns true for instances of Nullable<T>\n\t\t//\n\t\tpublic virtual bool IsNullableType {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.InflatedNullableType : state & ~StateFlags.InflatedNullableType;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsNested {\n\t\t\tget { return declaringType != null && Kind != MemberKind.TypeParameter; }\n\t\t}\n\n\t\tpublic bool IsPointer {\n\t\t\tget {\n\t\t\t\treturn Kind == MemberKind.PointerType;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsSealed {\n\t\t\tget { return (Modifiers & Modifiers.SEALED) != 0; }\n\t\t}\n\n\t\tpublic bool IsSpecialRuntimeType {\n\t\t\tget {\n\t\t\t\treturn (state & StateFlags.SpecialRuntimeType) != 0;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tstate = value ? state | StateFlags.SpecialRuntimeType : state & ~StateFlags.SpecialRuntimeType;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStruct {\n\t\t\tget { \n\t\t\t\treturn Kind == MemberKind.Struct;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStructOrEnum {\n\t\t\tget {\n\t\t\t\treturn (Kind & (MemberKind.Struct | MemberKind.Enum)) != 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsTypeBuilder {\n\t\t\tget {\n#if STATIC\n\t\t\t\treturn true;\n#else\n\t\t\t\tvar meta = GetMetaInfo().GetType ();\n\t\t\t\treturn meta == TypeBuilder || meta == GenericTypeBuilder;\n#endif\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Whether a type is unmanaged. This is used by the unsafe code\n\t\t//\n\t\tpublic bool IsUnmanaged {\n\t\t\tget {\n\t\t\t\tif (IsPointer)\n\t\t\t\t\treturn ((ElementTypeSpec) this).Element.IsUnmanaged;\n\n\t\t\t\tvar ds = MemberDefinition as TypeDefinition;\n\t\t\t\tif (ds != null)\n\t\t\t\t\treturn ds.IsUnmanagedType ();\n\n\t\t\t\tif (Kind == MemberKind.Void)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (Kind == MemberKind.TypeParameter)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (IsNested && DeclaringType.IsGenericOrParentIsGeneric)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn IsValueType (this);\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// A cache of all type members (including nested types)\n\t\t//\n\t\tpublic MemberCache MemberCache {\n\t\t\tget {\n\t\t\t\tif (cache == null || (state & StateFlags.PendingMemberCacheMembers) != 0)\n\t\t\t\t\tInitializeMemberCache (false);\n\n\t\t\t\treturn cache;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (cache != null)\n\t\t\t\t\tthrow new InternalErrorException (\"Membercache reset\");\n\n\t\t\t\tcache = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic MemberCache MemberCacheTypes {\n\t\t\tget {\n\t\t\t\tif (cache == null)\n\t\t\t\t\tInitializeMemberCache (true);\n\n\t\t\t\treturn cache;\n\t\t\t}\n\t\t}\t\n\n\t\tpublic new ITypeDefinition MemberDefinition {\n\t\t\tget {\n\t\t\t\treturn (ITypeDefinition) definition;\n\t\t\t}\n\t\t}\n\n\t\t// TODO: Wouldn't be better to rely on cast to InflatedTypeSpec and\n\t\t// remove the property, YES IT WOULD !!!\n\t\tpublic virtual TypeSpec[] TypeArguments {\n\t\t\tget { return TypeSpec.EmptyTypes; }\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic virtual bool AddInterface (TypeSpec iface)\n\t\t{\n\t\t\tif ((state & StateFlags.InterfacesExpanded) != 0)\n\t\t\t\tthrow new InternalErrorException (\"Modifying expanded interface list\");\n\n\t\t\tif (ifaces == null) {\n\t\t\t\tifaces = new List<TypeSpec> { iface };\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (!ifaces.Contains (iface)) {\n\t\t\t\tifaces.Add (iface);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t//\n\t\t// Special version used during type definition\n\t\t//\n\t\tpublic bool AddInterfaceDefined (TypeSpec iface)\n\t\t{\n\t\t\tif (!AddInterface (iface))\n\t\t\t\treturn false;\n\n\t\t\t//\n\t\t\t// We can get into a situation where a type is inflated before\n\t\t\t// its interfaces are resoved. Consider this situation\n\t\t\t//\n\t\t\t// class A<T> : X<A<int>>, IFoo {}\n\t\t\t//\n\t\t\t// When resolving base class of X`1 we inflate context type A`1\n\t\t\t// All this happens before we even hit IFoo resolve. Without\n\t\t\t// additional expansion any inside usage of A<T> would miss IFoo\n\t\t\t// interface because it comes from early inflated A`1 definition.\n\t\t\t//\n\t\t\tif (inflated_instances != null) {\n\t\t\t\t//\n\t\t\t\t// Inflate only existing instances not any new instances added\n\t\t\t\t// during AddInterface\n\t\t\t\t//\n\t\t\t\tvar inflated_existing = inflated_instances.Values.ToArray ();\n\t\t\t\tforeach (var inflated in inflated_existing) {\n\t\t\t\t\tinflated.AddInterface (iface);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Returns all type arguments, usefull for nested types\n\t\t//\n\t\tpublic static TypeSpec[] GetAllTypeArguments (TypeSpec type)\n\t\t{\n\t\t\tIList<TypeSpec> targs = TypeSpec.EmptyTypes;\n\n\t\t\tdo {\n\t\t\t\tif (type.Arity > 0) {\n\t\t\t\t\tif (targs.Count == 0) {\n\t\t\t\t\t\ttargs = type.TypeArguments;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar list = targs as List<TypeSpec> ?? new List<TypeSpec> (targs);\n\t\t\t\t\t\tlist.AddRange (type.TypeArguments);\n\t\t\t\t\t\ttargs = list;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttype = type.declaringType;\n\t\t\t} while (type != null);\n\n\t\t\treturn targs as TypeSpec[] ?? ((List<TypeSpec>) targs).ToArray ();\n\t\t}\n\n\t\tpublic AttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa)\n\t\t{\n\t\t\tif (Kind != MemberKind.Class)\n\t\t\t\tthrow new InternalErrorException ();\n\n\t\t\tif (!pa.IsDefined)\n\t\t\t\treturn Attribute.DefaultUsageAttribute;\n\n\t\t\tAttributeUsageAttribute aua = null;\n\t\t\tvar type = this;\n\t\t\twhile (type != null) {\n\t\t\t\taua = type.MemberDefinition.GetAttributeUsage (pa);\n\t\t\t\tif (aua != null)\n\t\t\t\t\tbreak;\n\n\t\t\t\ttype = type.BaseType;\n\t\t\t}\n\n\t\t\treturn aua;\n\t\t}\n\n\t\t//\n\t\t// Return metadata information used during emit to describe the type\n\t\t//\n\t\tpublic virtual MetaType GetMetaInfo ()\n\t\t{\n\t\t\treturn info;\n\t\t}\n\n\t\tpublic virtual TypeSpec GetDefinition ()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\t//\n\t\t// Text representation of type used by documentation writer\n\t\t//\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tif (IsNested) {\n\t\t\t\tsb.Append (DeclaringType.GetSignatureForDocumentation ());\n\t\t\t} else {\n\t\t\t\tsb.Append (MemberDefinition.Namespace);\n\t\t\t}\n\n\t\t\tif (sb.Length != 0)\n\t\t\t\tsb.Append (\".\");\n\n\t\t\tsb.Append (Name);\n\t\t\tif (Arity > 0) {\n\t\t\t\tif (this is InflatedTypeSpec) {\n\t\t\t\t    sb.Append (\"{\");\n\t\t\t\t    for (int i = 0; i < Arity; ++i) {\n\t\t\t\t        if (i > 0)\n\t\t\t\t            sb.Append (\",\");\n\n\t\t\t\t        sb.Append (TypeArguments[i].GetSignatureForDocumentation ());\n\t\t\t\t    }\n\t\t\t\t    sb.Append (\"}\");\n\t\t\t\t} else {\n\t\t\t\t\tsb.Append (\"`\");\n\t\t\t\t\tsb.Append (Arity.ToString ());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic string GetExplicitNameSignatureForDocumentation ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tif (IsNested) {\n\t\t\t\tsb.Append (DeclaringType.GetExplicitNameSignatureForDocumentation ());\n\t\t\t} else if (MemberDefinition.Namespace != null) {\n\t\t\t\tsb.Append (MemberDefinition.Namespace.Replace ('.', '#'));\n\t\t\t}\n\n\t\t\tif (sb.Length != 0)\n\t\t\t\tsb.Append (\"#\");\n\n\t\t\tsb.Append (Name);\n\t\t\tif (Arity > 0) {\n\t\t\t\tsb.Append (\"{\");\n\t\t\t\tfor (int i = 0; i < Arity; ++i) {\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tsb.Append (\",\");\n\n\t\t\t\t\tsb.Append (TypeArguments[i].GetExplicitNameSignatureForDocumentation ());\n\t\t\t\t}\n\t\t\t\tsb.Append (\"}\");\n\t\t\t}\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tstring s;\n\n\t\t\tif (IsNested) {\n\t\t\t\ts = DeclaringType.GetSignatureForError ();\n\t\t\t} else if (MemberDefinition is AnonymousTypeClass) {\n\t\t\t\treturn ((AnonymousTypeClass) MemberDefinition).GetSignatureForError ();\n\t\t\t} else {\n\t\t\t\ts = MemberDefinition.Namespace;\n\t\t\t}\n\n\t\t\tif (!string.IsNullOrEmpty (s))\n\t\t\t\ts += \".\";\n\n\t\t\treturn s + Name + GetTypeNameSignature ();\n\t\t}\n\n\t\tpublic string GetSignatureForErrorIncludingAssemblyName ()\n\t\t{\n\t\t\treturn string.Format (\"{0} [{1}]\", GetSignatureForError (), MemberDefinition.DeclaringAssembly.FullName);\n\t\t}\n\n\t\tprotected virtual string GetTypeNameSignature ()\n\t\t{\n\t\t\tif (!IsGeneric)\n\t\t\t\treturn null;\n\n\t\t\treturn \"<\" + TypeManager.CSharpName (MemberDefinition.TypeParameters) + \">\";\n\t\t}\n\n\t\tpublic bool ImplementsInterface (TypeSpec iface, bool variantly)\n\t\t{\n\t\t\tvar ifaces = Interfaces;\n\t\t\tif (ifaces != null) {\n\t\t\t\tfor (int i = 0; i < ifaces.Count; ++i) {\n\t\t\t\t\tif (TypeSpecComparer.IsEqual (ifaces[i], iface))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tif (variantly && TypeSpecComparer.Variant.IsEqual (ifaces[i], iface))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected virtual void InitializeMemberCache (bool onlyTypes)\n\t\t{\n\t\t\ttry {\n\t\t\t\tMemberDefinition.LoadMembers (this, onlyTypes, ref cache);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new InternalErrorException (e, \"Unexpected error when loading type `{0}'\", GetSignatureForError ());\n\t\t\t}\n\n\t\t\tif (onlyTypes)\n\t\t\t\tstate |= StateFlags.PendingMemberCacheMembers;\n\t\t\telse\n\t\t\t\tstate &= ~StateFlags.PendingMemberCacheMembers;\n\t\t}\n\n\t\t//\n\t\t// Is @baseClass base implementation of @type. With enabled @dynamicIsEqual the slower\n\t\t// comparison is used to hide differences between `object' and `dynamic' for generic\n\t\t// types. Should not be used for comparisons where G<object> != G<dynamic>\n\t\t//\n\t\tpublic static bool IsBaseClass (TypeSpec type, TypeSpec baseClass, bool dynamicIsObject)\n\t\t{\n\t\t\tif (dynamicIsObject && baseClass.IsGeneric) {\n\t\t\t\t//\n\t\t\t\t// Returns true for a hierarchies like this when passing baseClass of A<dynamic>\n\t\t\t\t//\n\t\t\t\t// class B : A<object> {}\n\t\t\t\t//\n\t\t\t\ttype = type.BaseType;\n\t\t\t\twhile (type != null) {\n\t\t\t\t\tif (TypeSpecComparer.IsEqual (type, baseClass))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\ttype = type.BaseType;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\twhile (type != null) {\n\t\t\t\ttype = type.BaseType;\n\t\t\t\tif (type == baseClass)\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool IsReferenceType (TypeSpec t)\n\t\t{\n\t\t\tswitch (t.Kind) {\n\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\treturn ((TypeParameterSpec) t).IsReferenceType;\n\t\t\tcase MemberKind.Struct:\n\t\t\tcase MemberKind.Enum:\n\t\t\tcase MemberKind.Void:\n\t\t\tcase MemberKind.PointerType:\n\t\t\t\treturn false;\n\t\t\tcase MemberKind.InternalCompilerType:\n\t\t\t\t//\n\t\t\t\t// Null is considered to be a reference type\n\t\t\t\t//\t\t\t\n\t\t\t\treturn t == InternalType.NullLiteral || t.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\t\t\tdefault:\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool IsNonNullableValueType (TypeSpec t)\n\t\t{\n\t\t\tswitch (t.Kind) {\n\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\treturn ((TypeParameterSpec) t).IsValueType;\n\t\t\tcase MemberKind.Struct:\n\t\t\t\treturn !t.IsNullableType;\n\t\t\tcase MemberKind.Enum:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool IsValueType (TypeSpec t)\n\t\t{\n\t\t\tswitch (t.Kind) {\n\t\t\tcase MemberKind.TypeParameter:\n\t\t\t\treturn ((TypeParameterSpec) t).IsValueType;\n\t\t\tcase MemberKind.Struct:\n\t\t\tcase MemberKind.Enum:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override MemberSpec InflateMember (TypeParameterInflator inflator)\n\t\t{\n\t\t\tvar targs = IsGeneric ? MemberDefinition.TypeParameters : TypeSpec.EmptyTypes;\n\n\t\t\t//\n\t\t\t// When inflating nested type from inside the type instance will be same\n\t\t\t// because type parameters are same for all nested types\n\t\t\t//\n\t\t\tif (DeclaringType == inflator.TypeInstance) {\n\t\t\t\treturn MakeGenericType (inflator.Context, targs);\n\t\t\t}\n\n\t\t\treturn new InflatedTypeSpec (inflator.Context, this, inflator.TypeInstance, targs);\n\t\t}\n\n\t\t//\n\t\t// Inflates current type using specific type arguments\n\t\t//\n\t\tpublic InflatedTypeSpec MakeGenericType (IModuleContext context, TypeSpec[] targs)\n\t\t{\n\t\t\tif (targs.Length == 0 && !IsNested)\n\t\t\t\tthrow new ArgumentException (\"Empty type arguments for type \" + GetSignatureForError ());\n\n\t\t\tInflatedTypeSpec instance;\n\n\t\t\tif (inflated_instances == null) {\n\t\t\t\tinflated_instances = new Dictionary<TypeSpec[], InflatedTypeSpec> (TypeSpecComparer.Default);\n\n\t\t\t\tif (IsNested) {\n\t\t\t\t\tinstance = this as InflatedTypeSpec;\n\t\t\t\t\tif (instance != null) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Nested types could be inflated on already inflated instances\n\t\t\t\t\t\t// Caching this type ensured we are using same instance for\n\t\t\t\t\t\t// inside/outside inflation using local type parameters\n\t\t\t\t\t\t//\n\t\t\t\t\t\tinflated_instances.Add (TypeArguments, instance);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!inflated_instances.TryGetValue (targs, out instance)) {\n\t\t\t\tif (GetDefinition () != this && !IsNested)\n\t\t\t\t\tthrow new InternalErrorException (\"`{0}' must be type definition or nested non-inflated type to MakeGenericType\",\n\t\t\t\t\t\tGetSignatureForError ());\n\n\t\t\t\tinstance = new InflatedTypeSpec (context, this, declaringType, targs);\n\t\t\t\tinflated_instances.Add (targs, instance);\n\t\t\t}\n\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic virtual TypeSpec Mutate (TypeParameterMutator mutator)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\tList<MissingTypeSpecReference> missing = null;\n\n\t\t\tif (Kind == MemberKind.MissingType) {\n\t\t\t\tmissing = new List<MissingTypeSpecReference> ();\n\t\t\t\tmissing.Add (new MissingTypeSpecReference (this, caller));\n\t\t\t\treturn missing;\n\t\t\t}\n\n\t\t\tforeach (var targ in TypeArguments) {\n\t\t\t\tif (targ.Kind == MemberKind.MissingType) {\n\t\t\t\t\tif (missing == null)\n\t\t\t\t\t\tmissing = new List<MissingTypeSpecReference> ();\n\n\t\t\t\t\tmissing.Add (new MissingTypeSpecReference (targ, caller));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Interfaces != null) {\n\t\t\t\tforeach (var iface in Interfaces) {\n\t\t\t\t\tif (iface.Kind == MemberKind.MissingType) {\n\t\t\t\t\t\tif (missing == null)\n\t\t\t\t\t\t\tmissing = new List<MissingTypeSpecReference> ();\n\n\t\t\t\t\t\tmissing.Add (new MissingTypeSpecReference (iface, caller));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (MemberDefinition.TypeParametersCount > 0) {\n\t\t\t\tforeach (var tp in MemberDefinition.TypeParameters) {\n\t\t\t\t\tvar tp_missing = tp.GetMissingDependencies (this);\n\t\t\t\t\tif (tp_missing != null) {\n\t\t\t\t\t\tif (missing == null)\n\t\t\t\t\t\t\tmissing = new List<MissingTypeSpecReference> ();\n\n\t\t\t\t\t\tmissing.AddRange (tp_missing);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (missing != null || BaseType == null)\n\t\t\t\treturn missing;\n\n\t\t\treturn BaseType.ResolveMissingDependencies (this);\n\t\t}\n\n\t\tpublic void SetMetaInfo (MetaType info)\n\t\t{\n\t\t\tif (this.info != null)\n\t\t\t\tthrow new InternalErrorException (\"MetaInfo reset\");\n\n\t\t\tthis.info = info;\n\t\t}\n\n\t\tpublic void SetExtensionMethodContainer ()\n\t\t{\n\t\t\tmodifiers |= Modifiers.METHOD_EXTENSION;\n\t\t}\n\n\t\tpublic void UpdateInflatedInstancesBaseType ()\n\t\t{\n\t\t\t//\n\t\t\t// When nested class has a partial part the situation where parent type\n\t\t\t// is inflated before its base type is defined can occur. In such case\n\t\t\t// all inflated (should be only 1) instansted need to be updated\n\t\t\t//\n\t\t\t// partial class A<T> {\n\t\t\t//   partial class B : A<int> { }\n\t\t\t// }\n\t\t\t//\n\t\t\t// partial class A<T> : X {}\n\t\t\t//\n\t\t\tif (inflated_instances == null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var inflated in inflated_instances) {\n\t\t\t\t//\n\t\t\t\t// Don't need to inflate possible generic type because for now the method\n\t\t\t\t// is always used from within the nested type\n\t\t\t\t//\n\t\t\t\tinflated.Value.BaseType = base_type;\n\t\t\t}\n\t\t}\n\t}\n\n\t//\n\t// Special version used for types which must exist in corlib or\n\t// the compiler cannot work\n\t//\n\tpublic sealed class BuiltinTypeSpec : TypeSpec\n\t{\n\t\tpublic enum Type\n\t\t{\n\t\t\tNone = 0,\n\n\t\t\t// Ordered carefully for fast compares\n\t\t\tFirstPrimitive = 1,\n\t\t\tBool = 1,\n\t\t\tByte = 2,\n\t\t\tSByte = 3,\n\t\t\tChar = 4,\n\t\t\tShort = 5,\n\t\t\tUShort = 6,\n\t\t\tInt = 7,\n\t\t\tUInt = 8,\n\t\t\tLong = 9,\n\t\t\tULong = 10,\n\t\t\tFloat = 11,\n\t\t\tDouble = 12,\n\t\t\tLastPrimitive = 12,\n\t\t\tDecimal = 13,\n\n\t\t\tIntPtr = 14,\n\t\t\tUIntPtr = 15,\n\n\t\t\tObject = 16,\n\t\t\tDynamic = 17,\n\t\t\tString = 18,\n\t\t\tType = 19,\n\n\t\t\tValueType = 20,\n\t\t\tEnum = 21,\n\t\t\tDelegate = 22,\n\t\t\tMulticastDelegate = 23,\n\t\t\tArray = 24,\n\n\t\t\tIEnumerator,\n\t\t\tIEnumerable,\n\t\t\tIDisposable,\n\t\t\tException,\n\t\t\tAttribute,\n\t\t\tOther,\n\t\t}\n\n\t\treadonly Type type;\n\t\treadonly string ns;\n\t\treadonly string name;\n\n\t\tpublic BuiltinTypeSpec (MemberKind kind, string ns, string name, Type builtinKind)\n\t\t\t: base (kind, null, null, null, Modifiers.PUBLIC)\n\t\t{\n\t\t\tthis.type = builtinKind;\n\t\t\tthis.ns = ns;\n\t\t\tthis.name = name;\n\t\t}\n\n\t\tpublic BuiltinTypeSpec (string name, Type builtinKind)\n\t\t\t: this (MemberKind.InternalCompilerType, \"\", name, builtinKind)\n\t\t{\n\t\t\t// Make all internal types CLS-compliant, non-obsolete, compact\n\t\t\tstate = (state & ~(StateFlags.CLSCompliant_Undetected | StateFlags.Obsolete_Undetected | StateFlags.MissingDependency_Undetected)) | StateFlags.CLSCompliant;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override int Arity {\n\t\t\tget {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override BuiltinTypeSpec.Type BuiltinType {\n\t\t\tget {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\n\t\tpublic string FullName {\n\t\t\tget {\n\t\t\t\treturn ns + '.' + name;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\treturn ns;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic static bool IsPrimitiveType (TypeSpec type)\n\t\t{\n\t\t\treturn type.BuiltinType >= Type.FirstPrimitive && type.BuiltinType <= Type.LastPrimitive;\n\t\t}\n\n\t\tpublic static bool IsPrimitiveTypeOrDecimal (TypeSpec type)\n\t\t{\n\t\t\treturn type.BuiltinType >= Type.FirstPrimitive && type.BuiltinType <= Type.Decimal;\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\tswitch (Name) {\n\t\t\tcase \"Int32\": return \"int\";\n\t\t\tcase \"Int64\": return \"long\";\n\t\t\tcase \"String\": return \"string\";\n\t\t\tcase \"Boolean\": return \"bool\";\n\t\t\tcase \"Void\": return \"void\";\n\t\t\tcase \"Object\": return \"object\";\n\t\t\tcase \"UInt32\": return \"uint\";\n\t\t\tcase \"Int16\": return \"short\";\n\t\t\tcase \"UInt16\": return \"ushort\";\n\t\t\tcase \"UInt64\": return \"ulong\";\n\t\t\tcase \"Single\": return \"float\";\n\t\t\tcase \"Double\": return \"double\";\n\t\t\tcase \"Decimal\": return \"decimal\";\n\t\t\tcase \"Char\": return \"char\";\n\t\t\tcase \"Byte\": return \"byte\";\n\t\t\tcase \"SByte\": return \"sbyte\";\n\t\t\t}\n\n\t\t\tif (ns.Length == 0)\n\t\t\t\treturn name;\n\n\t\t\treturn FullName;\n\t\t}\n\n\t\t//\n\t\t// Returns the size of type if known, otherwise, 0\n\t\t//\n\t\tpublic static int GetSize (TypeSpec type)\n\t\t{\n\t\t\tswitch (type.BuiltinType) {\n\t\t\tcase Type.Int:\n\t\t\tcase Type.UInt:\n\t\t\tcase Type.Float:\n\t\t\t\treturn 4;\n\t\t\tcase Type.Long:\n\t\t\tcase Type.ULong:\n\t\t\tcase Type.Double:\n\t\t\t\treturn 8;\n\t\t\tcase Type.Byte:\n\t\t\tcase Type.SByte:\n\t\t\tcase Type.Bool:\n\t\t\t\treturn 1;\n\t\t\tcase Type.Short:\n\t\t\tcase Type.Char:\n\t\t\tcase Type.UShort:\n\t\t\t\treturn 2;\n\t\t\tcase Type.Decimal:\n\t\t\t\treturn 16;\n\t\t\tdefault:\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetDefinition (ITypeDefinition td, MetaType type, Modifiers mod)\n\t\t{\n\t\t\tthis.definition = td;\n\t\t\tthis.info = type;\n\t\t\tthis.modifiers |= (mod & ~Modifiers.AccessibilityMask);\n\t\t}\n\n\t\tpublic void SetDefinition (TypeSpec ts)\n\t\t{\n\t\t\tthis.definition = ts.MemberDefinition;\n\t\t\tthis.info = ts.GetMetaInfo ();\n\t\t\tthis.BaseType = ts.BaseType;\n\t\t\tthis.Interfaces = ts.Interfaces;\n\t\t\tthis.modifiers = ts.Modifiers;\n\t\t}\n\t}\n\n\t//\n\t// Various type comparers used by compiler\n\t//\n\tstatic class TypeSpecComparer\n\t{\n\t\t//\n\t\t// Does strict reference comparion only\n\t\t//\n\t\tpublic static readonly DefaultImpl Default = new DefaultImpl ();\n\n\t\tpublic class DefaultImpl : IEqualityComparer<TypeSpec[]>\n\t\t{\n\t\t\t#region IEqualityComparer<TypeSpec[]> Members\n\n\t\t\tbool IEqualityComparer<TypeSpec[]>.Equals (TypeSpec[] x, TypeSpec[] y)\n\t\t\t{\n\t\t\t\tif (x == y)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (x.Length != y.Length)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfor (int i = 0; i < x.Length; ++i)\n\t\t\t\t\tif (x[i] != y[i])\n\t\t\t\t\t\treturn false;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tint IEqualityComparer<TypeSpec[]>.GetHashCode (TypeSpec[] obj)\n\t\t\t{\n\t\t\t\tint hash = 0;\n\t\t\t\tfor (int i = 0; i < obj.Length; ++i)\n\t\t\t\t\thash = (hash << 5) - hash + obj[i].GetHashCode ();\n\n\t\t\t\treturn hash;\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\t//\n\t\t// When comparing type signature of overrides or overloads\n\t\t// this version tolerates different MVARs at same position\n\t\t//\n\t\tpublic static class Override\n\t\t{\n\t\t\tpublic static bool IsEqual (TypeSpec a, TypeSpec b)\n\t\t\t{\n\t\t\t\tif (a == b)\n\t\t\t\t\treturn true;\n\n\t\t\t\t//\n\t\t\t\t// Consider the following example:\n\t\t\t\t//\n\t\t\t\t//     public abstract class A\n\t\t\t\t//     {\n\t\t\t\t//        public abstract T Foo<T>();\n\t\t\t\t//     }\n\t\t\t\t//\n\t\t\t\t//     public class B : A\n\t\t\t\t//     {\n\t\t\t\t//        public override U Foo<T>() { return default (U); }\n\t\t\t\t//     }\n\t\t\t\t//\n\t\t\t\t// Here, `T' and `U' are method type parameters from different methods\n\t\t\t\t// (A.Foo and B.Foo), so both `==' and Equals() will fail.\n\t\t\t\t//\n\t\t\t\t// However, since we're determining whether B.Foo() overrides A.Foo(),\n\t\t\t\t// we need to do a signature based comparision and consider them equal.\n\t\t\t\t//\n\n\t\t\t\tvar tp_a = a as TypeParameterSpec;\n\t\t\t\tif (tp_a != null) {\n\t\t\t\t\tvar tp_b = b as TypeParameterSpec;\n\t\t\t\t\treturn tp_b != null && tp_a.IsMethodOwned == tp_b.IsMethodOwned && tp_a.DeclaredPosition == tp_b.DeclaredPosition;\n\t\t\t\t}\n\n\t\t\t\tvar ac_a = a as ArrayContainer;\n\t\t\t\tif (ac_a != null) {\n\t\t\t\t\tvar ac_b = b as ArrayContainer;\n\t\t\t\t\treturn ac_b != null && ac_a.Rank == ac_b.Rank && IsEqual (ac_a.Element, ac_b.Element);\n\t\t\t\t}\n\n\t\t\t\tif (a.BuiltinType == BuiltinTypeSpec.Type.Dynamic || b.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\treturn b.BuiltinType == BuiltinTypeSpec.Type.Object || a.BuiltinType == BuiltinTypeSpec.Type.Object;\n\n\t\t\t\tif (a.MemberDefinition != b.MemberDefinition)\n\t\t\t\t\treturn false;\n\n\t\t\t\tdo {\n\t\t\t\t\tfor (int i = 0; i < a.TypeArguments.Length; ++i) {\n\t\t\t\t\t\tif (!IsEqual (a.TypeArguments[i], b.TypeArguments[i]))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\ta = a.DeclaringType;\n\t\t\t\t\tb = b.DeclaringType;\n\t\t\t\t} while (a != null);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic static bool IsEqual (TypeSpec[] a, TypeSpec[] b)\n\t\t\t{\n\t\t\t\tif (a == b)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (a.Length != b.Length)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfor (int i = 0; i < a.Length; ++i) {\n\t\t\t\t\tif (!IsEqual (a[i], b[i]))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\t//\n\t\t\t// Compares unordered arrays\n\t\t\t//\n\t\t\tpublic static bool IsSame (TypeSpec[] a, TypeSpec[] b)\n\t\t\t{\n\t\t\t\tif (a == b)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (a == null || b == null || a.Length != b.Length)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfor (int ai = 0; ai < a.Length; ++ai) {\n\t\t\t\t\tbool found = false;\n\t\t\t\t\tfor (int bi = 0; bi < b.Length; ++bi) {\n\t\t\t\t\t\tif (IsEqual (a[ai], b[bi])) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!found)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic static bool IsEqual (AParametersCollection a, AParametersCollection b)\n\t\t\t{\n\t\t\t\tif (a == b)\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (a.Count != b.Count)\n\t\t\t\t\treturn false;\n\n\t\t\t\tfor (int i = 0; i < a.Count; ++i) {\n\t\t\t\t\tif (!IsEqual (a.Types[i], b.Types[i]))\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tif ((a.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) != (b.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Type variance equality comparison\n\t\t//\n\t\tpublic static class Variant\n\t\t{\n\t\t\tpublic static bool IsEqual (TypeSpec type1, TypeSpec type2)\n\t\t\t{\n\t\t\t\tif (!type1.IsGeneric || !type2.IsGeneric)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar target_type_def = type2.MemberDefinition;\n\t\t\t\tif (type1.MemberDefinition != target_type_def)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar t1_targs = type1.TypeArguments;\n\t\t\t\tvar t2_targs = type2.TypeArguments;\n\t\t\t\tvar targs_definition = target_type_def.TypeParameters;\n\n\t\t\t\tif (!type1.IsInterface && !type1.IsDelegate) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; i < targs_definition.Length; ++i) {\n\t\t\t\t\tif (TypeSpecComparer.IsEqual (t1_targs[i], t2_targs[i]))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tVariance v = targs_definition[i].Variance;\n\t\t\t\t\tif (v == Variance.None) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (v == Variance.Covariant) {\n\t\t\t\t\t\tif (!Convert.ImplicitReferenceConversionExists (t1_targs[i], t2_targs[i]))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if (!Convert.ImplicitReferenceConversionExists (t2_targs[i], t1_targs[i])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t//\n\t\t// Checks whether two generic instances may become equal for some\n\t\t// particular instantiation (26.3.1).\n\t\t//\n\t\tpublic static class Unify\n\t\t{\n\t\t\t//\n\t\t\t// Either @a or @b must be generic type\n\t\t\t//\n\t\t\tpublic static bool IsEqual (TypeSpec a, TypeSpec b)\n\t\t\t{\n\t\t\t\tif (a.MemberDefinition != b.MemberDefinition) {\n\t\t\t\t\tvar base_ifaces = a.Interfaces;\n\t\t\t\t\tif (base_ifaces != null) {\n\t\t\t\t\t\tforeach (var base_iface in base_ifaces) {\n\t\t\t\t\t\t\tif (base_iface.Arity > 0 && IsEqual (base_iface, b))\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar ta = a.TypeArguments;\n\t\t\t\tvar tb = b.TypeArguments;\n\t\t\t\tfor (int i = 0; i < ta.Length; i++) {\n\t\t\t\t\tif (!MayBecomeEqualGenericTypes (ta[i], tb[i]))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (a.IsNested && b.IsNested)\n\t\t\t\t\treturn IsEqual (a.DeclaringType, b.DeclaringType);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tstatic bool ContainsTypeParameter (TypeSpec tparam, TypeSpec type)\n\t\t\t{\n\t\t\t\tTypeSpec[] targs = type.TypeArguments;\n\t\t\t\tfor (int i = 0; i < targs.Length; i++) {\n\t\t\t\t\tif (tparam == targs[i])\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tif (ContainsTypeParameter (tparam, targs[i]))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t///   Check whether `a' and `b' may become equal generic types.\n\t\t\t///   The algorithm to do that is a little bit complicated.\n\t\t\t/// </summary>\n\t\t\tstatic bool MayBecomeEqualGenericTypes (TypeSpec a, TypeSpec b)\n\t\t\t{\n\t\t\t\tif (a.IsGenericParameter) {\n\t\t\t\t\t//\n\t\t\t\t\t// If a is an array of a's type, they may never\n\t\t\t\t\t// become equal.\n\t\t\t\t\t//\n\t\t\t\t\tif (b.IsArray)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t//\n\t\t\t\t\t// If b is a generic parameter or an actual type,\n\t\t\t\t\t// they may become equal:\n\t\t\t\t\t//\n\t\t\t\t\t//    class X<T,U> : I<T>, I<U>\n\t\t\t\t\t//    class X<T> : I<T>, I<float>\n\t\t\t\t\t// \n\t\t\t\t\tif (b.IsGenericParameter)\n\t\t\t\t\t\treturn a != b && a.DeclaringType == b.DeclaringType;\n\n\t\t\t\t\t//\n\t\t\t\t\t// We're now comparing a type parameter with a\n\t\t\t\t\t// generic instance.  They may become equal unless\n\t\t\t\t\t// the type parameter appears anywhere in the\n\t\t\t\t\t// generic instance:\n\t\t\t\t\t//\n\t\t\t\t\t//    class X<T,U> : I<T>, I<X<U>>\n\t\t\t\t\t//        -> error because you could instanciate it as\n\t\t\t\t\t//           X<X<int>,int>\n\t\t\t\t\t//\n\t\t\t\t\t//    class X<T> : I<T>, I<X<T>> -> ok\n\t\t\t\t\t//\n\n\t\t\t\t\treturn !ContainsTypeParameter (a, b);\n\t\t\t\t}\n\n\t\t\t\tif (b.IsGenericParameter)\n\t\t\t\t\treturn MayBecomeEqualGenericTypes (b, a);\n\n\t\t\t\t//\n\t\t\t\t// At this point, neither a nor b are a type parameter.\n\t\t\t\t//\n\t\t\t\t// If one of them is a generic instance, compare them (if the\n\t\t\t\t// other one is not a generic instance, they can never\n\t\t\t\t// become equal).\n\t\t\t\t//\n\t\t\t\tif (TypeManager.IsGenericType (a) || TypeManager.IsGenericType (b))\n\t\t\t\t\treturn IsEqual (a, b);\n\n\t\t\t\t//\n\t\t\t\t// If both of them are arrays.\n\t\t\t\t//\n\t\t\t\tvar a_ac = a as ArrayContainer;\n\t\t\t\tif (a_ac != null) {\n\t\t\t\t\tvar b_ac = b as ArrayContainer;\n\t\t\t\t\tif (b_ac == null || a_ac.Rank != b_ac.Rank)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\treturn MayBecomeEqualGenericTypes (a_ac.Element, b_ac.Element);\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Ok, two ordinary types.\n\t\t\t\t//\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool Equals (TypeSpec[] x, TypeSpec[] y)\n\t\t{\n\t\t\tif (x == y)\n\t\t\t\treturn true;\n\n\t\t\tif (x.Length != y.Length)\n\t\t\t\treturn false;\n\n\t\t\tfor (int i = 0; i < x.Length; ++i)\n\t\t\t\tif (!IsEqual (x[i], y[i]))\n\t\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\t//\n\t\t// Identity type conversion\n\t\t//\n\t\t// Default reference comparison, it has to be used when comparing\n\t\t// two possible dynamic/internal types\n\t\t//\n\t\tpublic static bool IsEqual (TypeSpec a, TypeSpec b)\n\t\t{\n\t\t\tif (a == b) {\n\t\t\t\t// This also rejects dynamic == dynamic\n\t\t\t\treturn a.Kind != MemberKind.InternalCompilerType || a.BuiltinType == BuiltinTypeSpec.Type.Dynamic;\n\t\t\t}\n\n\t\t\tif (a == null || b == null)\n\t\t\t\treturn false;\n\n\t\t\tif (a.IsArray) {\n\t\t\t\tvar a_a = (ArrayContainer) a;\n\t\t\t\tvar b_a = b as ArrayContainer;\n\t\t\t\tif (b_a == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn a_a.Rank == b_a.Rank && IsEqual (a_a.Element, b_a.Element);\n\t\t\t}\n\n\t\t\tif (!a.IsGeneric || !b.IsGeneric) {\n\t\t\t\t//\n\t\t\t\t// object and dynamic are considered equivalent there is an identity conversion\n\t\t\t\t// between object and dynamic, and between constructed types that are the same\n\t\t\t\t// when replacing all occurences of dynamic with object.\n\t\t\t\t//\n\t\t\t\tif (a.BuiltinType == BuiltinTypeSpec.Type.Dynamic || b.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\t\treturn b.BuiltinType == BuiltinTypeSpec.Type.Object || a.BuiltinType == BuiltinTypeSpec.Type.Object;\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (a.MemberDefinition != b.MemberDefinition)\n\t\t\t\treturn false;\n\n\t\t\tdo {\n\t\t\t\tif (!Equals (a.TypeArguments, b.TypeArguments))\n\t\t\t\t\treturn false;\n\n\t\t\t\ta = a.DeclaringType;\n\t\t\t\tb = b.DeclaringType;\n\t\t\t} while (a != null);\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic interface ITypeDefinition : IMemberDefinition\n\t{\n\t\tIAssemblyDefinition DeclaringAssembly { get; }\n\t\tstring Namespace { get; }\n\t\tbool IsPartial { get; }\n\t\tbool IsComImport { get; }\n\t\tbool IsTypeForwarder { get; }\n\t\tbool IsCyclicTypeForwarder { get; }\n\t\tint TypeParametersCount { get; }\n\t\tTypeParameterSpec[] TypeParameters { get; }\n\n\t\tTypeSpec GetAttributeCoClass ();\n\t\tstring GetAttributeDefaultMember ();\n\t\tAttributeUsageAttribute GetAttributeUsage (PredefinedAttribute pa);\n\t\tbool IsInternalAsPublic (IAssemblyDefinition assembly);\n\t\tvoid LoadMembers (TypeSpec declaringType, bool onlyTypes, ref MemberCache cache);\n\t}\n\n\tclass InternalType : TypeSpec, ITypeDefinition\n\t{\n\t\tpublic static readonly InternalType AnonymousMethod = new InternalType (\"anonymous method\");\n\t\tpublic static readonly InternalType Arglist = new InternalType (\"__arglist\");\n\t\tpublic static readonly InternalType MethodGroup = new InternalType (\"method group\");\n\t\tpublic static readonly InternalType NullLiteral = new InternalType (\"null\");\n\t\tpublic static readonly InternalType FakeInternalType = new InternalType (\"<fake$type>\");\n\t\tpublic static readonly InternalType Namespace = new InternalType (\"<namespace>\");\n\t\tpublic static readonly InternalType ErrorType = new InternalType (\"<error>\");\n\n\t\treadonly string name;\n\n\t\tInternalType (string name)\n\t\t\t: base (MemberKind.InternalCompilerType, null, null, null, Modifiers.PUBLIC)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tthis.definition = this;\n\t\t\tcache = MemberCache.Empty;\n\n\t\t\t// Make all internal types CLS-compliant, non-obsolete\n\t\t\tstate = (state & ~(StateFlags.CLSCompliant_Undetected | StateFlags.Obsolete_Undetected | StateFlags.MissingDependency_Undetected)) | StateFlags.CLSCompliant;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic override int Arity {\n\t\t\tget {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tIAssemblyDefinition ITypeDefinition.DeclaringAssembly {\n\t\t\tget {\n\t\t\t\tthrow new NotImplementedException ();\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsComImport {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool IMemberDefinition.IsImported {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsPartial {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsCyclicTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\n\t\tstring ITypeDefinition.Namespace {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tint ITypeDefinition.TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tTypeParameterSpec[] ITypeDefinition.TypeParameters {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn name;\n\t\t}\n\n\t\t#region ITypeDefinition Members\n\n\t\tTypeSpec ITypeDefinition.GetAttributeCoClass ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tstring ITypeDefinition.GetAttributeDefaultMember ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tAttributeUsageAttribute ITypeDefinition.GetAttributeUsage (PredefinedAttribute pa)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tbool ITypeDefinition.IsInternalAsPublic (IAssemblyDefinition assembly)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tvoid ITypeDefinition.LoadMembers (TypeSpec declaringType, bool onlyTypes, ref MemberCache cache)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tstring[] IMemberDefinition.ConditionalConditions ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tObsoleteAttribute IMemberDefinition.GetAttributeObsolete ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tbool? IMemberDefinition.CLSAttributeValue {\n\t\t\tget {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tvoid IMemberDefinition.SetIsAssigned ()\n\t\t{\n\t\t}\n\n\t\tvoid IMemberDefinition.SetIsUsed ()\n\t\t{\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t//\n\t// Common base class for composite types\n\t//\n\tpublic abstract class ElementTypeSpec : TypeSpec, ITypeDefinition\n\t{\n\t\tprotected ElementTypeSpec (MemberKind kind, TypeSpec element, MetaType info)\n\t\t\t: base (kind, element.DeclaringType, null, info, element.Modifiers)\n\t\t{\n\t\t\tthis.Element = element;\n\n\t\t\tstate &= ~SharedStateFlags;\n\t\t\tstate |= (element.state & SharedStateFlags);\n\n\t\t\tif (element.BuiltinType == BuiltinTypeSpec.Type.Dynamic)\n\t\t\t\tstate |= StateFlags.HasDynamicElement;\n\n\t\t\t// Has to use its own type definition instead of just element definition to\n\t\t\t// correctly identify itself for cases like x.MemberDefininition == predefined.MemberDefinition\n\t\t\tthis.definition = this;\n\n\t\t\tcache = MemberCache.Empty;\n\t\t}\n\n\t\t#region Properties\n\n\t\tpublic TypeSpec Element { get; private set; }\n\n\t\tbool ITypeDefinition.IsComImport {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsPartial {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsCyclicTypeForwarder {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override ObsoleteAttribute GetAttributeObsolete ()\n\t\t{\n\t\t\treturn Element.GetAttributeObsolete ();\n\t\t}\n\n\t\tprotected virtual string GetPostfixSignature ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\treturn Element.GetSignatureForDocumentation () + GetPostfixSignature ();\n\t\t}\n\n\t\tpublic override string GetSignatureForError ()\n\t\t{\n\t\t\treturn Element.GetSignatureForError () + GetPostfixSignature ();\n\t\t}\n\n\t\tpublic override TypeSpec Mutate (TypeParameterMutator mutator)\n\t\t{\n\t\t\tvar me = Element.Mutate (mutator);\n\t\t\tif (me == Element)\n\t\t\t\treturn this;\n\n\t\t\tvar mutated = (ElementTypeSpec) MemberwiseClone ();\n\t\t\tmutated.Element = me;\n\t\t\tmutated.info = null;\n\t\t\treturn mutated;\n\t\t}\n\n\t\t#region ITypeDefinition Members\n\n\t\tIAssemblyDefinition ITypeDefinition.DeclaringAssembly {\n\t\t\tget {\n\t\t\t\treturn Element.MemberDefinition.DeclaringAssembly;\n\t\t\t}\n\t\t}\n\n\t\tbool ITypeDefinition.IsInternalAsPublic (IAssemblyDefinition assembly)\n\t\t{\n\t\t\treturn Element.MemberDefinition.IsInternalAsPublic (assembly);\n\t\t}\n\n\t\tpublic string Namespace {\n\t\t\tget { throw new NotImplementedException (); }\n\t\t}\n\n\t\tpublic int TypeParametersCount {\n\t\t\tget {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSpec[] TypeParameters {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeSpec GetAttributeCoClass ()\n\t\t{\n\t\t\treturn Element.MemberDefinition.GetAttributeCoClass ();\n\t\t}\n\n\t\tpublic string GetAttributeDefaultMember ()\n\t\t{\n\t\t\treturn Element.MemberDefinition.GetAttributeDefaultMember ();\n\t\t}\n\n\t\tpublic void LoadMembers (TypeSpec declaringType, bool onlyTypes, ref MemberCache cache)\n\t\t{\n\t\t\tElement.MemberDefinition.LoadMembers (declaringType, onlyTypes, ref cache);\n\t\t}\n\n\t\tpublic bool IsImported {\n\t\t\tget {\n\t\t\t\treturn Element.MemberDefinition.IsImported;\n\t\t\t}\n\t\t}\n\n\t\tpublic string[] ConditionalConditions ()\n\t\t{\n\t\t\treturn Element.MemberDefinition.ConditionalConditions ();\n\t\t}\n\n\t\tbool? IMemberDefinition.CLSAttributeValue {\n\t\t\tget {\n\t\t\t\treturn Element.MemberDefinition.CLSAttributeValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetIsAssigned ()\n\t\t{\n\t\t\tElement.MemberDefinition.SetIsAssigned ();\n\t\t}\n\n\t\tpublic void SetIsUsed ()\n\t\t{\n\t\t\tElement.MemberDefinition.SetIsUsed ();\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tpublic class ArrayContainer : ElementTypeSpec\n\t{\n\t\tpublic struct TypeRankPair : IEquatable<TypeRankPair>\n\t\t{\n\t\t\tTypeSpec ts;\n\t\t\tint rank;\n\n\t\t\tpublic TypeRankPair (TypeSpec ts, int rank)\n\t\t\t{\n\t\t\t\tthis.ts = ts;\n\t\t\t\tthis.rank = rank;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode ()\n\t\t\t{\n\t\t\t\treturn ts.GetHashCode () ^ rank.GetHashCode ();\n\t\t\t}\n\n\t\t\t#region IEquatable<Tuple<T1,T2>> Members\n\n\t\t\tpublic bool Equals (TypeRankPair other)\n\t\t\t{\n\t\t\t\treturn other.ts == ts && other.rank == rank;\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\n\t\treadonly int rank;\n\t\treadonly ModuleContainer module;\n\n\t\tprivate ArrayContainer (ModuleContainer module, TypeSpec element, int rank)\n\t\t\t: base (MemberKind.ArrayType, element, null)\n\t\t{\n\t\t\tthis.module = module;\n\t\t\tthis.rank = rank;\n\t\t}\n\n\t\tpublic int Rank {\n\t\t\tget {\n\t\t\t\treturn rank;\n\t\t\t}\n\t\t}\n\n\t\tpublic MethodInfo GetConstructor ()\n\t\t{\n\t\t\tvar mb = module.Builder;\n\n\t\t\tvar arg_types = new MetaType[rank];\n\t\t\tfor (int i = 0; i < rank; i++)\n\t\t\t\targ_types[i] = module.Compiler.BuiltinTypes.Int.GetMetaInfo ();\n\n\t\t\tvar ctor = mb.GetArrayMethod (\n\t\t\t\tGetMetaInfo (), Constructor.ConstructorName,\n\t\t\t\tCallingConventions.HasThis,\n\t\t\t\tnull, arg_types);\n\n\t\t\treturn ctor;\n\t\t}\n\n\t\tpublic MethodInfo GetAddressMethod ()\n\t\t{\n\t\t\tvar mb = module.Builder;\n\n\t\t\tvar arg_types = new MetaType[rank];\n\t\t\tfor (int i = 0; i < rank; i++)\n\t\t\t\targ_types[i] = module.Compiler.BuiltinTypes.Int.GetMetaInfo ();\n\n\t\t\tvar address = mb.GetArrayMethod (\n\t\t\t\tGetMetaInfo (), \"Address\",\n\t\t\t\tCallingConventions.HasThis | CallingConventions.Standard,\n\t\t\t\tReferenceContainer.MakeType (module, Element).GetMetaInfo (), arg_types);\n\n\t\t\treturn address;\n\t\t}\n\n\t\tpublic MethodInfo GetGetMethod ()\n\t\t{\n\t\t\tvar mb = module.Builder;\n\n\t\t\tvar arg_types = new MetaType[rank];\n\t\t\tfor (int i = 0; i < rank; i++)\n\t\t\t\targ_types[i] = module.Compiler.BuiltinTypes.Int.GetMetaInfo ();\n\n\t\t\tvar get = mb.GetArrayMethod (\n\t\t\t\tGetMetaInfo (), \"Get\",\n\t\t\t\tCallingConventions.HasThis | CallingConventions.Standard,\n\t\t\t\tElement.GetMetaInfo (), arg_types);\n\n\t\t\treturn get;\n\t\t}\n\n\t\tpublic MethodInfo GetSetMethod ()\n\t\t{\n\t\t\tvar mb = module.Builder;\n\n\t\t\tvar arg_types = new MetaType[rank + 1];\n\t\t\tfor (int i = 0; i < rank; i++)\n\t\t\t\targ_types[i] = module.Compiler.BuiltinTypes.Int.GetMetaInfo ();\n\n\t\t\targ_types[rank] = Element.GetMetaInfo ();\n\n\t\t\tvar set = mb.GetArrayMethod (\n\t\t\t\tGetMetaInfo (), \"Set\",\n\t\t\t\tCallingConventions.HasThis | CallingConventions.Standard,\n\t\t\t\tmodule.Compiler.BuiltinTypes.Void.GetMetaInfo (), arg_types);\n\n\t\t\treturn set;\n\t\t}\n\n\t\tpublic override MetaType GetMetaInfo ()\n\t\t{\n\t\t\tif (info == null) {\n\t\t\t\tif (rank == 1)\n\t\t\t\t\tinfo = Element.GetMetaInfo ().MakeArrayType ();\n\t\t\t\telse\n\t\t\t\t\tinfo = Element.GetMetaInfo ().MakeArrayType (rank);\n\t\t\t}\n\n\t\t\treturn info;\n\t\t}\n\n\t\tprotected override string GetPostfixSignature()\n\t\t{\n\t\t\treturn GetPostfixSignature (rank);\n\t\t}\n\n\t\tpublic static string GetPostfixSignature (int rank)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tsb.Append (\"[\");\n\t\t\tfor (int i = 1; i < rank; i++) {\n\t\t\t\tsb.Append (\",\");\n\t\t\t}\n\t\t\tsb.Append (\"]\");\n\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic override string GetSignatureForDocumentation ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tGetElementSignatureForDocumentation (sb);\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tvoid GetElementSignatureForDocumentation (StringBuilder sb)\n\t\t{\n\t\t\tvar ac = Element as ArrayContainer;\n\t\t\tif (ac == null)\n\t\t\t\tsb.Append (Element.GetSignatureForDocumentation ());\n\t\t\telse\n\t\t\t\tac.GetElementSignatureForDocumentation (sb);\n\n\t\t\tsb.Append (\"[\");\n\t\t\tfor (int i = 1; i < rank; i++) {\n\t\t\t\tif (i == 1)\n\t\t\t\t\tsb.Append (\"0:\");\n\n\t\t\t\tsb.Append (\",0:\");\n\t\t\t}\n\t\t\tsb.Append (\"]\");\n\t\t}\n\n\t\tpublic static ArrayContainer MakeType (ModuleContainer module, TypeSpec element)\n\t\t{\n\t\t\treturn MakeType (module, element, 1);\n\t\t}\n\n\t\tpublic static ArrayContainer MakeType (ModuleContainer module, TypeSpec element, int rank)\n\t\t{\n\t\t\tArrayContainer ac;\n\t\t\tvar key = new TypeRankPair (element, rank);\n\t\t\tif (!module.ArrayTypesCache.TryGetValue (key, out ac)) {\n\t\t\t\tac = new ArrayContainer (module, element, rank);\n\t\t\t\tac.BaseType = module.Compiler.BuiltinTypes.Array;\n\t\t\t\tac.Interfaces = ac.BaseType.Interfaces;\n\n\t\t\t\tmodule.ArrayTypesCache.Add (key, ac);\n\t\t\t}\n\n\t\t\treturn ac;\n\t\t}\n\n\t\tpublic override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)\n\t\t{\n\t\t\treturn Element.ResolveMissingDependencies (caller);\n\t\t}\n\t}\n\n\tclass ReferenceContainer : ElementTypeSpec\n\t{\n\t\tprivate ReferenceContainer (TypeSpec element)\n\t\t\t: base (MemberKind.Class, element, null)\t// TODO: Kind.Class is most likely wrong\n\t\t{\n\t\t}\n\n\t\tpublic override MetaType GetMetaInfo ()\n\t\t{\n\t\t\tif (info == null) {\n\t\t\t\tinfo = Element.GetMetaInfo ().MakeByRefType ();\n\t\t\t}\n\n\t\t\treturn info;\n\t\t}\n\n\t\tpublic static ReferenceContainer MakeType (ModuleContainer module, TypeSpec element)\n\t\t{\n\t\t\tReferenceContainer pc;\n\t\t\tif (!module.ReferenceTypesCache.TryGetValue (element, out pc)) {\n\t\t\t\tpc = new ReferenceContainer (element);\n\t\t\t\tmodule.ReferenceTypesCache.Add (element, pc);\n\t\t\t}\n\n\t\t\treturn pc;\n\t\t}\n\t}\n\n\tclass PointerContainer : ElementTypeSpec\n\t{\n\t\tprivate PointerContainer (TypeSpec element)\n\t\t\t: base (MemberKind.PointerType, element, null)\n\t\t{\n\t\t\t// It's never CLS-Compliant\n\t\t\tstate &= ~StateFlags.CLSCompliant_Undetected;\n\t\t}\n\n\t\tpublic override MetaType GetMetaInfo ()\n\t\t{\n\t\t\tif (info == null) {\n\t\t\t\tinfo = Element.GetMetaInfo ().MakePointerType ();\n\t\t\t}\n\n\t\t\treturn info;\n\t\t}\n\n\t\tprotected override string GetPostfixSignature()\n\t\t{\n \t\t\treturn \"*\";\n\t\t}\n\n\t\tpublic static PointerContainer MakeType (ModuleContainer module, TypeSpec element)\n\t\t{\n\t\t\tPointerContainer pc;\n\t\t\tif (!module.PointerTypesCache.TryGetValue (element, out pc)) {\n\t\t\t\tpc = new PointerContainer (element);\n\t\t\t\tmodule.PointerTypesCache.Add (element, pc);\n\t\t\t}\n\n\t\t\treturn pc;\n\t\t}\n\t}\n\n\tpublic class MissingTypeSpecReference\n\t{\n\t\tpublic MissingTypeSpecReference (TypeSpec type, MemberSpec caller)\n\t\t{\n\t\t\tType = type;\n\t\t\tCaller = caller;\n\t\t}\n\n\t\tpublic TypeSpec Type { get; private set; }\n\t\tpublic MemberSpec Caller { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/visit.cs",
    "content": "//\n// visit.cs: Visitors for parsed dom\n//\n// Authors: Mike Krger (mkrueger@novell.com)\n//          Marek Safar (marek.safar@gmail.com)\n//\n// Dual licensed under the terms of the MIT X11 or GNU GPL\n//\n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// Copyright 2011 Xamarin Inc\n//\n\nusing System;\nusing System.Diagnostics;\n\nnamespace Mono.CSharp\n{\n\tpublic abstract class StructuralVisitor\n\t{\n\t\tpublic virtual void Visit (MemberCore member)\n\t\t{\n\t\t\tDebug.Fail (\"unknown member type: \" + member.GetType ());\n\t\t}\n\n\t\tpublic virtual void Visit (ModuleContainer mc)\n\t\t{\n\t\t\tforeach (var container in mc.Containers) {\n\t\t\t\tcontainer.Accept (this);\n\t\t\t}\n\t\t}\n\n\t\tvoid VisitTypeDefinition (TypeDefinition tc)\n\t\t{\n\t\t\tforeach (var member in tc.Members) {\n\t\t\t\tmember.Accept (this);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void Visit (NamespaceContainer ns)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (UsingNamespace un)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (UsingAliasNamespace uan)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic virtual void Visit (UsingExternAlias uea)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (CompilationSourceFile csf)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Class c)\n\t\t{\n\t\t\tVisitTypeDefinition (c);\n\t\t}\n\n\t\tpublic virtual void Visit (Struct s)\n\t\t{\n\t\t\tVisitTypeDefinition (s);\n\t\t}\n\n\n\t\tpublic virtual void Visit (Interface i)\n\t\t{\n\t\t\tVisitTypeDefinition (i);\n\t\t}\n\n\t\tpublic virtual void Visit (Delegate d)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Enum e)\n\t\t{\n\t\t\tVisitTypeDefinition (e);\n\t\t}\n\n\t\tpublic virtual void Visit (FixedField f)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Const c)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Field f)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Operator o)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Indexer i)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Method m)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Property p)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Constructor c)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (Destructor d)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (EventField e)\n\t\t{\n\t\t}\n\t\tpublic virtual void Visit (EventProperty ep)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Visit (EnumMember em)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (Statement stmt)\n\t\t{\n\t\t\tDebug.Fail (\"unknown statement:\" + stmt);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (BlockVariable blockVariableDeclaration)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (BlockConstant blockConstantDeclaration)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (EmptyStatement emptyStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (EmptyExpressionStatement emptyExpressionStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (EmptyExpression emptyExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (ErrorExpression errorExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (If ifStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\n\t\tpublic virtual object Visit (Do doStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (While whileStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (For forStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (StatementExpression statementExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (StatementErrorExpression errorStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Return returnStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Goto gotoStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (LabeledStatement labeledStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (SwitchLabel switchLabel)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (GotoDefault gotoDefault)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (GotoCase gotoCase)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Throw throwStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Break breakStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Continue continueStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Block blockStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (Switch switchStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (StatementList statementList)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (Lock lockStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Unchecked uncheckedStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Checked checkedStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Unsafe unsafeStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\n\t\tpublic virtual object Visit (Fixed fixedStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\n\t\tpublic virtual object Visit (TryFinally tryFinallyStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (TryCatch tryCatchStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Using usingStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Foreach foreachStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Yield yieldStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (YieldBreak yieldBreakStatement)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (InvalidStatementExpression invalidStatementExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Expression expression)\n\t\t{\n\t\t\tDebug.Fail (\"Visit unknown expression:\" + expression);\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (MemberAccess memberAccess)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (QualifiedAliasMember qualifiedAliasMember)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (LocalVariableReference localVariableReference)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Constant constant)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (BooleanExpression booleanExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (SimpleName simpleName)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Unary unaryExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (UnaryMutator unaryMutatorExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t// *expr\n\t\tpublic virtual object Visit (Indirection indirectionExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Is isExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (As asExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Cast castExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (ComposedCast composedCast)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (DefaultValueExpression defaultValueExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (DefaultParameterValueExpression defaultParameterValueExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (Binary binaryExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Nullable.NullCoalescingOperator nullCoalescingOperator)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Conditional conditionalExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Invocation invocationExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (New newExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (NewAnonymousType newAnonymousType)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (NewInitialize newInitializeExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (ArrayCreation arrayCreationExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (This thisExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (ArglistAccess argListAccessExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Arglist argListExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (TypeOf typeOfExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (SizeOf sizeOfExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (CheckedExpr checkedExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (UnCheckedExpr uncheckedExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (ElementAccess elementAccessExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (BaseThis baseAccessExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (StackAlloc stackAllocExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (SimpleAssign simpleAssign)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (CompoundAssign compoundAssign)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (TypeExpression typeExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (LambdaExpression lambdaExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (ConstInitializer constInitializer)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (ArrayInitializer arrayInitializer)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (Linq.QueryExpression queryExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.QueryStartClause queryExpression)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (Linq.SelectMany selectMany)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.Select select)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.GroupBy groupBy)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.Let let)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.Where where)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.Join join)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.GroupJoin groupJoin)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.OrderByAscending orderByAscending)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.OrderByDescending orderByDescending)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Linq.ThenByAscending thenByAscending)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (Linq.ThenByDescending thenByDescending)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// undocumented expressions\n\t\tpublic virtual object Visit (RefValueExpr refValueExpr)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (RefTypeExpr refTypeExpr)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic virtual object Visit (MakeRefExpr makeRefExpr)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic virtual object Visit (Await awaitExpr)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/PatternMatching/AnyType.cs",
    "content": "//\n// AnyType.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.PatternMatching\n{\n\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Properties/AssemblyInfo.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\nusing System.Runtime.CompilerServices;\n\n#region Using directives\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#endregion\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.CSharp\")]\n[assembly: AssemblyDescription(\"C# parser and semantic analysis\")]\n[assembly: InternalsVisibleTo(\"ICSharpCode.NRefactory.CSharp.Refactoring, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf\")]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/QueryExpressionExpander.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp {\n\tpublic class QueryExpressionExpansionResult {\n\t\tpublic AstNode AstNode { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Maps original range variables to some node in the new tree that represents them.\n\t\t/// </summary>\n\t\tpublic IDictionary<Identifier, AstNode> RangeVariables { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Maps clauses to method calls. The keys will always be either a <see cref=\"QueryClause\"/> or a <see cref=\"QueryOrdering\"/>\n\t\t/// </summary>\n\t\tpublic IDictionary<AstNode, Expression> Expressions { get; private set; }\n\n\t\tpublic QueryExpressionExpansionResult(AstNode astNode, IDictionary<Identifier, AstNode> rangeVariables, IDictionary<AstNode, Expression> expressions) {\n\t\t\tAstNode = astNode;\n\t\t\tRangeVariables = rangeVariables;\n\t\t\tExpressions = expressions;\n\t\t}\n\t}\n\n\tpublic class QueryExpressionExpander {\n\t\tclass Visitor : DepthFirstAstVisitor<AstNode> {\n\t\t\tinternal IEnumerator<string> TransparentIdentifierNamePicker;\n\n\t\t\tprotected override AstNode VisitChildren(AstNode node) {\n\t\t\t\tList<AstNode> newChildren = null;\n\t\t\t\t\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (var child in node.Children) {\n\t\t\t\t\tvar newChild = child.AcceptVisitor(this);\n\t\t\t\t\tif (newChild != null) {\n\t\t\t\t\t\tnewChildren = newChildren ?? Enumerable.Repeat((AstNode)null, i).ToList();\n\t\t\t\t\t\tnewChildren.Add(newChild);\n\t\t\t\t\t}\n\t\t\t\t\telse if (newChildren != null) {\n\t\t\t\t\t\tnewChildren.Add(null);\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\tif (newChildren == null)\n\t\t\t\t\treturn null;\n\n\t\t\t\tvar result = node.Clone();\n\n\t\t\t\ti = 0;\n\t\t\t\tforeach (var children in result.Children) {\n\t\t\t\t\tif (newChildren[i] != null)\n\t\t\t\t\t\tchildren.ReplaceWith(newChildren[i]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tExpression MakeNestedMemberAccess(Expression target, IEnumerable<string> members) {\n\t\t\t\treturn members.Aggregate(target, (current, m) => current.Member(m));\n\t\t\t}\n\n\t\t\tExpression VisitNested(Expression node, ParameterDeclaration transparentParameter) {\n\t\t\t\tvar oldRangeVariableSubstitutions = activeRangeVariableSubstitutions;\n\t\t\t\ttry {\n\t\t\t\t\tif (transparentParameter != null && currentTransparentType.Count > 1) {\n\t\t\t\t\t\tactiveRangeVariableSubstitutions = new Dictionary<string, Expression>(activeRangeVariableSubstitutions);\n\t\t\t\t\t\tforeach (var t in currentTransparentType)\n\t\t\t\t\t\t\tactiveRangeVariableSubstitutions[t.Item1.Name] = MakeNestedMemberAccess(new IdentifierExpression(transparentParameter.Name), t.Item2);\n\t\t\t\t\t}\n\t\t\t\t\tvar result = node.AcceptVisitor(this);\n\t\t\t\t\treturn (Expression)(result ?? node.Clone());\n\t\t\t\t}\n\t\t\t\tfinally {\n\t\t\t\t\tactiveRangeVariableSubstitutions = oldRangeVariableSubstitutions;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tQueryClause GetNextQueryClause(QueryClause clause) {\n\t\t\t\tfor (AstNode node = clause.NextSibling; node != null; node = node.NextSibling) {\n\t\t\t\t\tif (node.Role == QueryExpression.ClauseRole)\n\t\t\t\t\t\treturn (QueryClause)node;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic IDictionary<Identifier, AstNode> rangeVariables = new Dictionary<Identifier, AstNode>();\n\t\t\tpublic IDictionary<AstNode, Expression> expressions = new Dictionary<AstNode, Expression>();\n\n\t\t\tDictionary<string, Expression> activeRangeVariableSubstitutions = new Dictionary<string, Expression>();\n\t\t\tList<Tuple<Identifier, List<string>>> currentTransparentType = new List<Tuple<Identifier, List<string>>>();\n\t\t\tExpression currentResult;\n\t\t\tbool eatSelect;\n\n\t\t\tvoid MapExpression(AstNode orig, Expression newExpr) {\n\t\t\t\tDebug.Assert(orig is QueryClause || orig is QueryOrdering);\n\t\t\t\texpressions[orig] = newExpr;\n\t\t\t}\n\n\t\t\tinternal static IEnumerable<string> FallbackTransparentIdentifierNamePicker()\n\t\t\t{\n\t\t\t\tconst string TransparentParameterNameTemplate = \"x{0}\";\n\t\t\t\tint currentTransparentParameter = 0;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tyield return string.Format(CultureInfo.InvariantCulture, TransparentParameterNameTemplate, currentTransparentParameter++);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tParameterDeclaration CreateParameterForCurrentRangeVariable() {\n\t\t\t\tvar param = new ParameterDeclaration();\n\n\t\t\t\tif (currentTransparentType.Count == 1) {\n\t\t\t\t\tvar clonedRangeVariable = (Identifier)currentTransparentType[0].Item1.Clone();\n\t\t\t\t\tif (!rangeVariables.ContainsKey(currentTransparentType[0].Item1))\n\t\t\t\t\t\trangeVariables[currentTransparentType[0].Item1] = param;\n\t\t\t\t\tparam.AddChild(clonedRangeVariable, Roles.Identifier);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!TransparentIdentifierNamePicker.MoveNext()) {\n\t\t\t\t\t\tTransparentIdentifierNamePicker = FallbackTransparentIdentifierNamePicker().GetEnumerator();\n\t\t\t\t\t\tTransparentIdentifierNamePicker.MoveNext();\n\t\t\t\t\t}\n\t\t\t\t\tstring name = TransparentIdentifierNamePicker.Current;\n\t\t\t\t\tparam.AddChild(Identifier.Create(name), Roles.Identifier);\n\t\t\t\t}\n\t\t\t\treturn param;\n\t\t\t}\n\n\t\t\tLambdaExpression CreateLambda(IList<ParameterDeclaration> parameters, Expression body) {\n\t\t\t\tvar result = new LambdaExpression();\n\t\t\t\tif (parameters.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(TextLocation.Empty, Roles.LPar), Roles.LPar);\n\t\t\t\tresult.AddChild(parameters[0], Roles.Parameter);\n\t\t\t\tfor (int i = 1; i < parameters.Count; i++) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(TextLocation.Empty, Roles.Comma), Roles.Comma);\n\t\t\t\t\tresult.AddChild(parameters[i], Roles.Parameter);\n\t\t\t\t}\n\t\t\t\tif (parameters.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(TextLocation.Empty, Roles.RPar), Roles.RPar);\n\t\t\t\tresult.AddChild(body, LambdaExpression.BodyRole);\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tParameterDeclaration CreateParameter(Identifier identifier) {\n\t\t\t\tvar result = new ParameterDeclaration();\n\t\t\t\tresult.AddChild(identifier, Roles.Identifier);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tExpression AddMemberToCurrentTransparentType(ParameterDeclaration param, Identifier name, Expression value, bool namedExpression) {\n\t\t\t\tExpression newAssignment = VisitNested(value, param);\n\t\t\t\tif (namedExpression) {\n\t\t\t\t\tnewAssignment = new NamedExpression(name.Name, VisitNested(value, param));\n\t\t\t\t\tif (!rangeVariables.ContainsKey(name) )\n\t\t\t\t\t\trangeVariables[name] = ((NamedExpression)newAssignment).NameToken;\n\t\t\t\t}\n\n\t\t\t\tforeach (var t in currentTransparentType)\n\t\t\t\t\tt.Item2.Insert(0, param.Name);\n\n\t\t\t\tcurrentTransparentType.Add(Tuple.Create(name, new List<string> { name.Name }));\n\t\t\t\treturn new AnonymousTypeCreateExpression(new[] { new IdentifierExpression(param.Name), newAssignment });\n\t\t\t}\n\n\t\t\tvoid AddFirstMemberToCurrentTransparentType(Identifier identifier) {\n\t\t\t\tDebug.Assert(currentTransparentType.Count == 0);\n\t\t\t\tcurrentTransparentType.Add(Tuple.Create(identifier, new List<string>()));\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryExpression(QueryExpression queryExpression) {\n\t\t\t\tvar oldTransparentType = currentTransparentType;\n\t\t\t\tvar oldResult = currentResult;\n\t\t\t\tvar oldEatSelect = eatSelect;\n\t\t\t\ttry {\n\t\t\t\t\tcurrentTransparentType = new List<Tuple<Identifier, List<string>>>();\n\t\t\t\t\tcurrentResult = null;\n\t\t\t\t\teatSelect = false;\n\n\t\t\t\t\tforeach (var clause in queryExpression.Clauses) {\n\t\t\t\t\t\tvar result = (Expression)clause.AcceptVisitor(this);\n\t\t\t\t\t\tMapExpression(clause, result ?? currentResult);\n\t\t\t\t\t\tcurrentResult = result;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn currentResult; \n\t\t\t\t}\n\t\t\t\tfinally {\n\t\t\t\t\tcurrentTransparentType = oldTransparentType;\n\t\t\t\t\tcurrentResult = oldResult;\n\t\t\t\t\teatSelect = oldEatSelect;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause) {\n\t\t\t\tvar prev = VisitNested(queryContinuationClause.PrecedingQuery, null);\n\t\t\t\tAddFirstMemberToCurrentTransparentType(queryContinuationClause.IdentifierToken);\n\t\t\t\treturn prev;\n\t\t\t}\n\n\t\t\tstatic bool NeedsToBeParenthesized(Expression expr)\n\t\t\t{\n\t\t\t\tUnaryOperatorExpression unary = expr as UnaryOperatorExpression;\n\t\t\t\tif (unary != null) {\n\t\t\t\t\tif (unary.Operator == UnaryOperatorType.PostIncrement || unary.Operator == UnaryOperatorType.PostDecrement) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (expr is BinaryOperatorExpression || expr is ConditionalExpression || expr is AssignmentExpression) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tstatic Expression ParenthesizeIfNeeded(Expression expr)\n\t\t\t{\n\t\t\t\treturn NeedsToBeParenthesized(expr) ? new ParenthesizedExpression(expr.Clone()) : expr;\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryFromClause(QueryFromClause queryFromClause) {\n\t\t\t\tif (currentResult == null) {\n\t\t\t\t\tAddFirstMemberToCurrentTransparentType(queryFromClause.IdentifierToken);\n\t\t\t\t\tif (queryFromClause.Type.IsNull) {\n\t\t\t\t\t\treturn VisitNested(ParenthesizeIfNeeded(queryFromClause.Expression), null);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn VisitNested(ParenthesizeIfNeeded(queryFromClause.Expression), null).Invoke(\"Cast\", new[] { queryFromClause.Type.Clone() }, new Expression[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar innerSelectorParam = CreateParameterForCurrentRangeVariable();\n\t\t\t\t\tvar lambdaContent = VisitNested(queryFromClause.Expression, innerSelectorParam);\n\t\t\t\t\tif (!queryFromClause.Type.IsNull) {\n\t\t\t\t\t\tlambdaContent = lambdaContent.Invoke(\"Cast\", new[] { queryFromClause.Type.Clone() }, new Expression[0]);\n\t\t\t\t\t}\n\t\t\t\t\tvar innerSelector = CreateLambda(new[] { innerSelectorParam }, lambdaContent);\n\n\t\t\t\t\tvar clonedIdentifier = (Identifier)queryFromClause.IdentifierToken.Clone();\n\n\t\t\t\t\tvar resultParam = CreateParameterForCurrentRangeVariable();\n\t\t\t\t\tExpression body;\n\t\t\t\t\t// Second from clause - SelectMany\n\t\t\t\t\tvar select = GetNextQueryClause(queryFromClause) as QuerySelectClause;\n\t\t\t\t\tif (select != null) {\n\t\t\t\t\t\tbody = VisitNested(select.Expression, resultParam);\n\t\t\t\t\t\teatSelect = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tbody = AddMemberToCurrentTransparentType(resultParam, queryFromClause.IdentifierToken, new IdentifierExpression(queryFromClause.Identifier), false);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar resultSelectorParam2 = CreateParameter(clonedIdentifier);\n\t\t\t\t\tvar resultSelector = CreateLambda(new[] { resultParam, resultSelectorParam2 }, body);\n\t\t\t\t\trangeVariables[queryFromClause.IdentifierToken] = resultSelectorParam2;\n\n\t\t\t\t\treturn currentResult.Invoke(\"SelectMany\", innerSelector, resultSelector);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryLetClause(QueryLetClause queryLetClause) {\n\t\t\t\tvar param = CreateParameterForCurrentRangeVariable();\n\t\t\t\tvar body = AddMemberToCurrentTransparentType(param, queryLetClause.IdentifierToken, queryLetClause.Expression, true);\n\t\t\t\tvar lambda = CreateLambda(new[] { param }, body);\n\n\t\t\t\treturn currentResult.Invoke(\"Select\", lambda);\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryWhereClause(QueryWhereClause queryWhereClause) {\n\t\t\t\tvar param = CreateParameterForCurrentRangeVariable();\n\t\t\t\treturn currentResult.Invoke(\"Where\", CreateLambda(new[] { param }, VisitNested(queryWhereClause.Condition, param)));\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryJoinClause(QueryJoinClause queryJoinClause) {\n\t\t\t\tExpression resultSelectorBody = null;\n\t\t\t\tvar inExpression = VisitNested(queryJoinClause.InExpression, null);\n\t\t\t\tif (!queryJoinClause.Type.IsNull) {\n\t\t\t\t\tinExpression = inExpression.Invoke(\"Cast\", new[] { queryJoinClause.Type.Clone() }, EmptyList<Expression>.Instance);\n\t\t\t\t}\n\t\t\t\tvar key1SelectorFirstParam = CreateParameterForCurrentRangeVariable();\n\t\t\t\tvar key1Selector = CreateLambda(new[] { key1SelectorFirstParam }, VisitNested(queryJoinClause.OnExpression, key1SelectorFirstParam));\n\t\t\t\tvar key2Param = CreateParameter(Identifier.Create(queryJoinClause.JoinIdentifier));\n\t\t\t\tvar key2Selector = CreateLambda(new[] { key2Param }, VisitNested(queryJoinClause.EqualsExpression, null));\n\n\t\t\t\tvar resultSelectorFirstParam = CreateParameterForCurrentRangeVariable();\n\n\t\t\t\tvar select = GetNextQueryClause(queryJoinClause) as QuerySelectClause;\n\t\t\t\tif (select != null) {\n\t\t\t\t\tresultSelectorBody = VisitNested(select.Expression, resultSelectorFirstParam);\n\t\t\t\t\teatSelect = true;\n\t\t\t\t}\n\n\t\t\t\tif (queryJoinClause.IntoKeyword.IsNull) {\n\t\t\t\t\t// Normal join\n\t\t\t\t\tif (resultSelectorBody == null)\n\t\t\t\t\t\tresultSelectorBody = AddMemberToCurrentTransparentType(resultSelectorFirstParam, queryJoinClause.JoinIdentifierToken, new IdentifierExpression(queryJoinClause.JoinIdentifier), false);\n\n\t\t\t\t\tvar resultSelector = CreateLambda(new[] { resultSelectorFirstParam, CreateParameter(Identifier.Create(queryJoinClause.JoinIdentifier)) }, resultSelectorBody);\n\t\t\t\t\trangeVariables[queryJoinClause.JoinIdentifierToken] = key2Param;\n\t\t\t\t\treturn currentResult.Invoke(\"Join\", inExpression, key1Selector, key2Selector, resultSelector);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Group join\n\t\t\t\t\tif (resultSelectorBody == null)\n\t\t\t\t\t\tresultSelectorBody = AddMemberToCurrentTransparentType(resultSelectorFirstParam, queryJoinClause.IntoIdentifierToken, new IdentifierExpression(queryJoinClause.IntoIdentifier), false);\n\n\t\t\t\t\tvar intoParam = CreateParameter(Identifier.Create(queryJoinClause.IntoIdentifier));\n\t\t\t\t\tvar resultSelector = CreateLambda(new[] { resultSelectorFirstParam, intoParam }, resultSelectorBody);\n\t\t\t\t\trangeVariables[queryJoinClause.IntoIdentifierToken] = intoParam;\n\n\t\t\t\t\treturn currentResult.Invoke(\"GroupJoin\", inExpression, key1Selector, key2Selector, resultSelector);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryOrderClause(QueryOrderClause queryOrderClause) {\n\t\t\t\tvar current = currentResult;\n\t\t\t\tbool first = true;\n\t\t\t\tforeach (var o in queryOrderClause.Orderings) {\n\t\t\t\t\tstring methodName = first ? (o.Direction == QueryOrderingDirection.Descending ? \"OrderByDescending\" : \"OrderBy\")\n\t\t\t\t\t                          : (o.Direction == QueryOrderingDirection.Descending ? \"ThenByDescending\" : \"ThenBy\");\n\n\t\t\t\t\tvar param = CreateParameterForCurrentRangeVariable();\n\t\t\t\t\tcurrent = current.Invoke(methodName, CreateLambda(new[] { param }, VisitNested(o.Expression, param)));\n\t\t\t\t\tMapExpression(o, current);\n\t\t\t\t\tfirst = false;\n\t\t\t\t}\n\t\t\t\treturn current;\n\t\t\t}\n\n\t\t\tbool IsSingleRangeVariable(Expression expr) {\n\t\t\t\tif (currentTransparentType.Count > 1)\n\t\t\t\t\treturn false;\n\t\t\t\tvar unpacked = ParenthesizedExpression.UnpackParenthesizedExpression(expr);\n\t\t\t\treturn unpacked is IdentifierExpression && ((IdentifierExpression)unpacked).Identifier == currentTransparentType[0].Item1.Name;\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQuerySelectClause(QuerySelectClause querySelectClause) {\n\t\t\t\tif (eatSelect) {\n\t\t\t\t\teatSelect = false;\n\t\t\t\t\treturn currentResult;\n\t\t\t\t}\n\t\t\t\telse if (((QueryExpression)querySelectClause.Parent).Clauses.Count > 2 && IsSingleRangeVariable(querySelectClause.Expression)) {\n\t\t\t\t\t// A simple query that ends with a trivial select should be removed.\n\t\t\t\t\treturn currentResult;\n\t\t\t\t}\n\n\t\t\t\tvar param = CreateParameterForCurrentRangeVariable();\n\t\t\t\tvar lambda = CreateLambda(new[] { param }, VisitNested(querySelectClause.Expression, param));\n\t\t\t\treturn currentResult.Invoke(\"Select\", lambda);\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitQueryGroupClause(QueryGroupClause queryGroupClause) {\n\t\t\t\tvar param = CreateParameterForCurrentRangeVariable();\n\t\t\t\tvar keyLambda = CreateLambda(new[] { param }, VisitNested(queryGroupClause.Key, param));\n\n\t\t\t\tif (IsSingleRangeVariable(queryGroupClause.Projection)) {\n\t\t\t\t\t// We are grouping by the single active range variable, so we can use the single argument form of GroupBy\n\t\t\t\t\treturn currentResult.Invoke(\"GroupBy\", keyLambda);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar projectionParam = CreateParameterForCurrentRangeVariable();\n\t\t\t\t\tvar projectionLambda = CreateLambda(new[] { projectionParam }, VisitNested(queryGroupClause.Projection, projectionParam));\n\t\t\t\t\treturn currentResult.Invoke(\"GroupBy\", keyLambda, projectionLambda);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override AstNode VisitIdentifierExpression(IdentifierExpression identifierExpression) {\n\t\t\t\tExpression subst;\n\t\t\t\tactiveRangeVariableSubstitutions.TryGetValue(identifierExpression.Identifier, out subst);\n\t\t\t\treturn subst != null ? subst.Clone() : null;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Expands all occurances of query patterns in the specified node. Returns a clone of the node with all query patterns expanded, or null if there was no query pattern to expand.\n\t\t/// </summary>\n\t\t/// <param name=\"node\"></param>\n\t\t/// <param name=\"transparentIdentifierNamePicker\">A sequence of names to use for transparent identifiers. Once the sequence is over, a fallback name generator is used</param> \n\t\t/// <returns></returns>\n\t\tpublic QueryExpressionExpansionResult ExpandQueryExpressions(AstNode node, IEnumerable<string> transparentIdentifierNamePicker) {\n\t\t\tvar visitor = new Visitor();\n\t\t\tvisitor.TransparentIdentifierNamePicker = transparentIdentifierNamePicker.GetEnumerator();\n\t\t\tvar astNode = node.AcceptVisitor(visitor);\n\t\t\tif (astNode != null) {\n\t\t\t\tastNode.Freeze();\n\t\t\t\treturn new QueryExpressionExpansionResult(astNode, visitor.rangeVariables, visitor.expressions);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t/// <summary>\n\t\t/// Expands all occurances of query patterns in the specified node. Returns a clone of the node with all query patterns expanded, or null if there was no query pattern to expand.\n\t\t/// </summary>\n\t\t/// <param name=\"node\"></param>\n\t\t/// <returns></returns>\n\t\tpublic QueryExpressionExpansionResult ExpandQueryExpressions(AstNode node)\n\t\t{\n\t\t\treturn ExpandQueryExpressions(node, Enumerable.Empty<string>());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/BaseRefactoringContext.cs",
    "content": "﻿// \n// BaseRefactoringContext.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Editor;\nusing System.ComponentModel.Design;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.Utils;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Analysis;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic abstract class BaseRefactoringContext : IServiceProvider\n\t{\n\t\treadonly CSharpAstResolver resolver;\n\t\treadonly CancellationToken cancellationToken;\n\t\t\n\t\tpublic virtual bool Supports(Version version)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the default namespace which should be defined in this file.\n\t\t/// </summary>\n\t\tpublic abstract string DefaultNamespace {\n\t\t\tget;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets a value indicating if 'var' keyword should be used or explicit types.\n\t\t/// </summary>\n\t\tpublic virtual bool UseExplicitTypes {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic CancellationToken CancellationToken {\n\t\t\tget { return cancellationToken; }\n\t\t}\n\t\t\n\t\tpublic virtual AstNode RootNode {\n\t\t\tget {\n\t\t\t\treturn resolver.RootNode;\n\t\t\t}\n\t\t}\n\n\t\tpublic CSharpAstResolver Resolver {\n\t\t\tget {\n\t\t\t\treturn resolver;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual CSharpUnresolvedFile UnresolvedFile {\n\t\t\tget {\n\t\t\t\treturn resolver.UnresolvedFile;\n\t\t\t}\n\t\t}\n\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return resolver.Compilation; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the type graph for the current compilation.\n\t\t/// </summary>\n\t\tpublic virtual TypeGraph TypeGraph {\n\t\t\tget { return new TypeGraph(Compilation.Assemblies); }\n\t\t}\n\t\t\n\t\tpublic BaseRefactoringContext (ICSharpCode.NRefactory.CSharp.Resolver.CSharpAstResolver resolver, System.Threading.CancellationToken cancellationToken)\n\t\t{\n\t\t\tthis.resolver = resolver;\n\t\t\tthis.cancellationToken = cancellationToken;\n\t\t\tthis.referenceFinder = new LocalReferenceFinder(resolver);\n\t\t}\n\n\n\t\t#region Resolving\n\t\tpublic ResolveResult Resolve (AstNode node)\n\t\t{\n\t\t\treturn resolver.Resolve (node, cancellationToken);\n\t\t}\n\t\t\n\t\tpublic CSharpResolver GetResolverStateBefore(AstNode node)\n\t\t{\n\t\t\treturn resolver.GetResolverStateBefore (node, cancellationToken);\n\t\t}\n\t\t\n\t\tpublic CSharpResolver GetResolverStateAfter(AstNode node)\n\t\t{\n\t\t\treturn resolver.GetResolverStateAfter (node, cancellationToken);\n\t\t}\n\n\t\tpublic IType ResolveType (AstType type)\n\t\t{\n\t\t\treturn resolver.Resolve (type, cancellationToken).Type;\n\t\t}\n\t\t\n\t\tpublic IType GetExpectedType (Expression expression)\n\t\t{\n\t\t\treturn resolver.GetExpectedType(expression, cancellationToken);\n\t\t}\n\t\t\n\t\tpublic Conversion GetConversion (Expression expression)\n\t\t{\n\t\t\treturn resolver.GetConversion(expression, cancellationToken);\n\t\t}\n\t\t\n\t\tpublic TypeSystemAstBuilder CreateTypeSystemAstBuilder(AstNode node)\n\t\t{\n\t\t\tvar csResolver = resolver.GetResolverStateBefore(node);\n\t\t\treturn new TypeSystemAstBuilder(csResolver);\n\t\t}\n\t\t#endregion\n\n\t\t#region Code Analyzation\n\t\t/// <summary>\n\t\t/// Creates a new definite assignment analysis object with a given root statement.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The definite assignment analysis object.\n\t\t/// </returns>\n\t\t/// <param name='root'>\n\t\t/// The root statement.\n\t\t/// </param>\n\t\tpublic DefiniteAssignmentAnalysis CreateDefiniteAssignmentAnalysis (Statement root)\n\t\t{\n\t\t\treturn new DefiniteAssignmentAnalysis (root, resolver, CancellationToken);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates a new reachability analysis object with a given statement.\n\t\t/// </summary>\n\t\t/// <param name=\"statement\">\n\t\t/// The statement to start the analysis.\n\t\t/// </param>\n\t\t/// <param name=\"recursiveDetectorVisitor\">\n\t\t/// TODO.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// The reachability analysis object.\n\t\t/// </returns>\n\t\tpublic ReachabilityAnalysis CreateReachabilityAnalysis (Statement statement, ReachabilityAnalysis.RecursiveDetectorVisitor recursiveDetectorVisitor = null)\n\t\t{\n\t\t\treturn ReachabilityAnalysis.Create (statement, resolver, recursiveDetectorVisitor, CancellationToken);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses a composite format string.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The format string parsing result.\n\t\t/// </returns>\n\t\tpublic virtual FormatStringParseResult ParseFormatString(string source)\n\t\t{\n\t\t\treturn new CompositeFormatStringParser().Parse(source);\n\t\t}\n\n\t\tLocalReferenceFinder referenceFinder;\n\n\t\tpublic IList<ReferenceResult> FindReferences(AstNode rootNode, IVariable variable)\n\t\t{\n\t\t\treturn referenceFinder.FindReferences(rootNode, variable);\n\t\t}\n\n\t\t#endregion\n\n\n\t\t#region Naming\n\t\tpublic virtual string GetNameProposal (string name, TextLocation loc, bool camelCase = true)\n\t\t{\n\t\t\tstring baseName = (camelCase ? char.ToLower (name [0]) : char.ToUpper (name [0])) + name.Substring (1);\n\n\t\t\tvar type = RootNode.GetNodeAt<TypeDeclaration>(loc);\n\t\t\tif (type == null)\n\t\t\t\treturn baseName;\n\n\t\t\tint number = -1;\n\t\t\tstring proposedName;\n\t\t\tdo {\n\t\t\t\tproposedName = AppendNumberToName (baseName, number++);\n\t\t\t} while (type.Members.Select (m => m.GetChildByRole (Roles.Identifier)).Any (n => n.Name == proposedName));\n\t\t\treturn proposedName;\n\t\t}\n\t\t\n\t\tpublic virtual string GetLocalNameProposal (string name, TextLocation loc, bool camelCase = true)\n\t\t{\n\t\t\tstring baseName = (camelCase ? char.ToLower (name [0]) : char.ToUpper (name [0])) + name.Substring (1);\n\t\t\tvar node = RootNode.GetNodeAt(loc);\n\t\t\tif (node == null)\n\t\t\t\treturn baseName;\n\t\t\t\n\t\t\tvar context = GetResolverStateBefore (node);\n\t\t\tint number = -1;\n\t\t\tstring proposedName;\n\t\t\tdo {\n\t\t\t\tproposedName = AppendNumberToName (baseName, number++);\n\t\t\t} while (!(context.ResolveSimpleName (proposedName, EmptyList<IType>.Instance) is UnknownIdentifierResolveResult));\n\t\t\treturn proposedName;\n\t\t}\n\n\t\tstatic string AppendNumberToName (string baseName, int number)\n\t\t{\n\t\t\treturn baseName + (number > 0 ? (number + 1).ToString () : \"\");\n\t\t}\n\t\t#endregion\n\n\t\t#region Text stuff\n\t\tpublic virtual TextEditorOptions TextEditorOptions {\n\t\t\tget {\n\t\t\t\treturn TextEditorOptions.Default;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool IsSomethingSelected {\n\t\t\tget {\n\t\t\t\treturn SelectionStart != TextLocation.Empty;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string SelectedText {\n\t\t\tget { return string.Empty; }\n\t\t}\n\n\t\tpublic virtual TextLocation SelectionStart {\n\t\t\tget {\n\t\t\t\treturn TextLocation.Empty;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual TextLocation SelectionEnd {\n\t\t\tget {\n\t\t\t\treturn TextLocation.Empty;\n\t\t\t}\n\t\t}\n\n\t\tpublic abstract int GetOffset (TextLocation location);\n\n\t\tpublic abstract IDocumentLine GetLineByOffset (int offset);\n\n\t\tpublic int GetOffset (int line, int col)\n\t\t{\n\t\t\treturn GetOffset (new TextLocation (line, col));\n\t\t}\n\n\t\tpublic abstract TextLocation GetLocation (int offset);\n\n\t\tpublic abstract string GetText (int offset, int length);\n\n\t\tpublic abstract string GetText (ISegment segment);\n\t\t#endregion\n\n\n\t\t/// <summary>\n\t\t/// Translates the english input string to the context language.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The translated string.\n\t\t/// </returns>\n\t\tpublic virtual string TranslateString(string str)\n\t\t{\n\t\t\treturn str;\n\t\t}\n\n\t\t#region IServiceProvider implementation\n\t\tIServiceContainer services = new ServiceContainer();\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a service container used to associate services with this context.\n\t\t/// </summary>\n\t\tpublic IServiceContainer Services {\n\t\t\tget { return services; }\n\t\t\tprotected set { services = value; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Retrieves a service from the refactoring context.\n\t\t/// If the service is not found in the <see cref=\"Services\"/> container.\n\t\t/// </summary>\n\t\tpublic object GetService(Type serviceType)\n\t\t{\n\t\t\treturn services.GetService(serviceType);\n\t\t}\n\t\t#endregion\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeAction.cs",
    "content": "// \n// CodeAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// A code action provides a code transformation with a description.\n\t/// </summary>\n\tpublic class CodeAction\n\t{\n\t\t/// <summary>\n\t\t/// Gets the description.\n\t\t/// </summary>\n\t\tpublic string Description {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the code transformation.\n\t\t/// </summary>\n\t\tpublic Action<Script> Run {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the action start location.\n\t\t/// </summary>\n\t\tpublic TextLocation Start {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the action end location.\n\t\t/// </summary>\n\t\tpublic TextLocation End {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// This property is used to identify which actions are \"siblings\", ie which actions\n\t\t/// are the same kind of fix. This is used to group issues when batch fixing them.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Although the type is <see cref=\"object\"/>, there is a restriction: The instance\n\t\t/// used must behave well as a key (for instance in a hash table). Additionaly, this\n\t\t/// value must be independent of the specific <see cref=\"CodeIssueProvider\"/> instance\n\t\t/// which created it. In other words two different instances of the same issue provider\n\t\t/// implementation should use the same sibling keys for the same kinds of issues.\n\t\t/// </remarks>\n\t\t/// <value>The non-null sibling key if this type of action is batchable, null otherwise.</value>\n\t\tpublic object SiblingKey {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\tSeverity severity = Severity.Suggestion;\n\n\t\t/// <summary>\n\t\t/// Gets or sets the severity of the code action. \n\t\t/// Actions are sorted according to their Severity.\n\t\t/// </summary>\n\t\t/// <value>The severity.</value>\n\t\tpublic Severity Severity {\n\t\t\tget {\n\t\t\t\treturn severity;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tseverity = value;\n\t\t\t}\n\t\t}\n\n\t\tconst string defaultSiblingKey = \"default\";\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeAction\"/> class,\n\t\t/// using a non-null default value for <see cref=\"SiblingKey\"/>.\n\t\t/// </summary>\n\t\t/// <param name='description'>\n\t\t/// The description.\n\t\t/// </param>\n\t\t/// <param name='action'>\n\t\t/// The code transformation.\n\t\t/// </param>\n\t\t/// <param name='astNode'>\n\t\t/// A node that specifies the start/end positions for the code action.\n\t\t/// </param>\n\t\tpublic CodeAction (string description, Action<Script> action, AstNode astNode)\n\t\t\t: this (description, action, astNode, defaultSiblingKey)\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeAction\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='description'>\n\t\t/// The description.\n\t\t/// </param>\n\t\t/// <param name='action'>\n\t\t/// The code transformation.\n\t\t/// </param>\n\t\t/// <param name='astNode'>\n\t\t/// A node that specifies the start/end positions for the code action.\n\t\t/// </param>\n\t\t/// <param name=\"siblingKey>\n\t\t/// The key used to associate this action with other actions that should be fixed together in batch mode.\n\t\t/// </param>\n\t\tpublic CodeAction (string description, Action<Script> action, AstNode astNode, object siblingKey)\n\t\t{\n\t\t\tif (action == null)\n\t\t\t\tthrow new ArgumentNullException (\"action\");\n\t\t\tif (description == null)\n\t\t\t\tthrow new ArgumentNullException (\"description\");\n\t\t\tif (astNode == null)\n\t\t\t\tthrow new ArgumentNullException(\"astNode\");\n\t\t\tDescription = description;\n\t\t\tRun = action;\n\t\t\tStart = astNode.StartLocation;\n\t\t\tEnd = astNode.EndLocation;\n\t\t\tSiblingKey = siblingKey;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeAction\"/> class,\n\t\t/// using a non-null default value for <see cref=\"SiblingKey\"/>.\n\t\t/// </summary>\n\t\t/// <param name='description'>\n\t\t/// The description.\n\t\t/// </param>\n\t\t/// <param name='action'>\n\t\t/// The code transformation.\n\t\t/// </param>\n\t\t/// <param name='start'>Start position for the code action.</param>\n\t\t/// <param name='end'>End position for the code action.</param>\n\t\tpublic CodeAction (string description, Action<Script> action, TextLocation start, TextLocation end)\n\t\t\t: this (description, action, start, end, defaultSiblingKey)\n\t\t{\n\t\t\tSiblingKey = defaultSiblingKey;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeAction\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='description'>\n\t\t/// The description.\n\t\t/// </param>\n\t\t/// <param name='action'>\n\t\t/// The code transformation.\n\t\t/// </param>\n\t\t/// <param name='start'>Start position for the code action.</param>\n\t\t/// <param name='end'>End position for the code action.</param>\n\t\t/// <param name=\"siblingKey>\n\t\t/// The key used to associate this action with other actions that should be fixed together in batch mode.\n\t\t/// </param>\n\t\tpublic CodeAction (string description, Action<Script> action, TextLocation start, TextLocation end, object siblingKey)\n\t\t{\n\t\t\tif (action == null)\n\t\t\t\tthrow new ArgumentNullException (\"action\");\n\t\t\tif (description == null)\n\t\t\t\tthrow new ArgumentNullException (\"description\");\n\t\t\tDescription = description;\n\t\t\tRun = action;\n\t\t\tthis.Start = start;\n\t\t\tthis.End = end;\n\t\t\tSiblingKey = siblingKey;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActionProvider.cs",
    "content": "﻿// \n// ContextAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic abstract class CodeActionProvider\n\t{\n\t\tpublic abstract IEnumerable<CodeAction> GetActions (RefactoringContext context);\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/RemoveFieldRefactoryActionRefactoringAction.cs",
    "content": "//\n// RemoveField.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n//\t[ContextAction(\"Removes a field from a class\", Description = \"It removes also the empty assingments and the usages\")]\n\tpublic class RemoveFieldRefactoryAction : ICodeActionProvider\n\t{\n\t\tpublic IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar fieldDeclaration = GetFieldDeclaration(context);\n            if(fieldDeclaration==null)\n\t\t\t    yield break;\n\n\t\t\t\n\t\t\tyield return new CodeAction(string.Format(context.TranslateString(\"Remove field '{0}'\"), fieldDeclaration.Name)\n\t\t\t                            , script => GenerateNewScript(\n                script, fieldDeclaration, context), fieldDeclaration);\n\t\t}\n\t\t\n\t\t\n\t\tvoid GenerateNewScript(Script script, FieldDeclaration fieldDeclaration, RefactoringContext context)\n        {\n            var firstOrNullObject = fieldDeclaration.Variables.FirstOrNullObject();\n\t\t    if(firstOrNullObject==null)\n                return;\n\t\t\tvar matchedNodes = ComputeMatchNodes(context, firstOrNullObject);\n\n\t\t    foreach (var matchNode in matchedNodes)\n            {\n                var parent = matchNode.Parent;\n                if (matchNode is VariableInitializer)\n                {\n                    script.Remove(parent);\n                }\n                else\n                if (matchNode is IdentifierExpression)\n                {\n                    if(parent is AssignmentExpression)\n                    {\n                        script.Remove(parent.Parent);\n                    }\n                    else\n                    {\n                        var clone = (IdentifierExpression)matchNode.Clone();\n                        clone.Identifier = \"TODO\";\n                        script.Replace(matchNode, clone);\n                    }\n                }\n            }\n        }\n\n\t    private static List<AstNode> ComputeMatchNodes(RefactoringContext context, VariableInitializer firstOrNullObject)\n\t    {\n\t        var referenceFinder = new FindReferences();\n\t        var matchedNodes = new List<AstNode>();\n\n\t        var resolveResult = context.Resolver.Resolve(firstOrNullObject);\n\t        var member = resolveResult as MemberResolveResult;\n            if (member == null)//not a member is unexpected case, so is better to return no match than to break the code\n                return matchedNodes;\n\n\t        FoundReferenceCallback callback = (matchNode, result) => matchedNodes.Add(matchNode);\n\n\t        var searchScopes = referenceFinder.GetSearchScopes(member.Member);\n\t        referenceFinder.FindReferencesInFile(searchScopes,\n\t                                             context.UnresolvedFile,\n\t                                             context.RootNode as SyntaxTree,\n\t                                             context.Compilation, callback,\n\t                                             context.CancellationToken);\n\t        return matchedNodes;\n\t    }\n\n\t    FieldDeclaration GetFieldDeclaration(RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<FieldDeclaration>();\n\n\t\t\treturn result;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeGenerationService.cs",
    "content": "//\n// CodeGenerationService.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic abstract class CodeGenerationService\n\t{\n\t\tpublic abstract EntityDeclaration GenerateMemberImplementation(RefactoringContext context, IMember member, bool explicitImplementation);\n\t}\n\n\tpublic class DefaultCodeGenerationService : CodeGenerationService\n\t{\n\t\tpublic override EntityDeclaration GenerateMemberImplementation(RefactoringContext context, IMember member, bool explicitImplementation)\n\t\t{\n\t\t\tvar builder = context.CreateTypeSystemAstBuilder();\n\t\t\tbuilder.GenerateBody = true;\n\t\t\tbuilder.ShowModifiers = false;\n\t\t\tbuilder.ShowAccessibility = true;\n\t\t\tbuilder.ShowConstantValues = !explicitImplementation;\n\t\t\tbuilder.ShowTypeParameterConstraints = !explicitImplementation;\n\t\t\tbuilder.UseCustomEvents = explicitImplementation;\n\t\t\tvar decl = builder.ConvertEntity(member);\n\t\t\tif (explicitImplementation) {\n\t\t\t\tdecl.Modifiers = Modifiers.None;\n\t\t\t\tdecl.AddChild(builder.ConvertType(member.DeclaringType), EntityDeclaration.PrivateImplementationTypeRole);\n\t\t\t} else if (member.DeclaringType.Kind == TypeKind.Interface) {\n\t\t\t\tdecl.Modifiers |= Modifiers.Public;\n\t\t\t} else {\n\t\t\t\t// Remove 'internal' modifier from 'protected internal' members if the override is in a different assembly than the member\n\t\t\t\tif (!member.ParentAssembly.InternalsVisibleTo(context.Compilation.MainAssembly)) {\n\t\t\t\t\tdecl.Modifiers &= ~Modifiers.Internal;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn decl;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssue.cs",
    "content": "﻿// \n// InspectionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// A code issue marks a region of text with an issue and can provide solution actions for this issue.\n\t/// </summary>\n\tpublic class CodeIssue\n\t{\n\t\t/// <summary>\n\t\t/// Gets the description of the issue.\n\t\t/// </summary>\n\t\tpublic string Description {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the issue start location.\n\t\t/// </summary>\n\t\tpublic TextLocation Start {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the issue end location.\n\t\t/// </summary>\n\t\tpublic TextLocation End {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets a list of potential solutions for the issue.\n\t\t/// </summary>\n\t\tpublic IList<CodeAction> Actions {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\tList<Type> actionProvider = new List<Type>();\n\t\tpublic List<Type> ActionProvider {\n\t\t\tget {\n\t\t\t\treturn actionProvider;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tactionProvider = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets the Issue marker which should be used to mark this issue in the editor.\n\t\t/// It's up to the editor implementation if and how this info is used.\n\t\t/// </summary>\n\t\tpublic IssueMarker IssueMarker {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(TextLocation start, TextLocation end, string issueDescription)\n\t\t{\n\t\t\tif (issueDescription == null)\n\t\t\t\tthrow new ArgumentNullException(\"issueDescription\");\n\t\t\tDescription = issueDescription;\n\t\t\tStart = start;\n\t\t\tEnd = end;\n\t\t\tActions = EmptyList<CodeAction>.Instance;\n\t\t\tIssueMarker = IssueMarker.WavedLine;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(TextLocation start, TextLocation end, string issueDescription, IEnumerable<CodeAction> actions) : this(start, end, issueDescription)\n\t\t{\n\t\t\tif (actions != null)\n\t\t\t\tActions = actions.ToArray();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(TextLocation start, TextLocation end, string issueDescription, params CodeAction[] actions) : this(start, end, issueDescription)\n\t\t{\n\t\t\tif (actions != null)\n\t\t\t\tActions = actions;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(TextLocation start, TextLocation end, string issueDescription, string actionDescription, Action<Script> fix) : this(start, end, issueDescription)\n\t\t{\n\t\t\tif (actionDescription == null)\n\t\t\t\tthrow new ArgumentNullException(\"actionDescription\");\n\t\t\tif (fix == null)\n\t\t\t\tthrow new ArgumentNullException(\"fix\");\n\t\t\tthis.Actions = new [] { new CodeAction(actionDescription, fix, start, end) };\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(AstNode node, string issueDescription)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\tif (issueDescription == null)\n\t\t\t\tthrow new ArgumentNullException(\"issueDescription\");\n\t\t\tDescription = issueDescription;\n\t\t\tStart = node.StartLocation;\n\t\t\tEnd = node.EndLocation;\n\t\t\tActions = EmptyList<CodeAction>.Instance;\n\t\t\tIssueMarker = IssueMarker.WavedLine;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(AstNode node, string issueDescription, IEnumerable<CodeAction> actions) : this(node, issueDescription)\n\t\t{\n\t\t\tif (actions != null)\n\t\t\t\tActions = actions.ToArray();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(AstNode node, string issueDescription, params CodeAction[] actions) : this(node, issueDescription)\n\t\t{\n\t\t\tif (actions != null)\n\t\t\t\tActions = actions;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue\"/> class.\n\t\t/// </summary>\n\t\tpublic CodeIssue(AstNode node, string issueDescription, string actionDescription, Action<Script> fix) : this(node, issueDescription)\n\t\t{\n\t\t\tif (actionDescription == null)\n\t\t\t\tthrow new ArgumentNullException(\"actionDescription\");\n\t\t\tif (fix == null)\n\t\t\t\tthrow new ArgumentNullException(\"fix\");\n\t\t\tthis.Actions = new [] { new CodeAction(actionDescription, fix, node) };\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssueProvider.cs",
    "content": "﻿// \n// IInspector.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// The code issue provider gets a list of all code issues in a syntax tree.\n\t/// </summary>\n\tpublic abstract class CodeIssueProvider\n\t{\n\t\tSubIssueAttribute[] subIssueAttributes;\n\n\t\tpublic bool HasSubIssues {\n\t\t\tget {\n\t\t\t\tInitialize ();\n\t\t\t\treturn subIssueAttributes.Length > 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<SubIssueAttribute> SubIssues {\n\t\t\tget {\n\t\t\t\tInitialize ();\n\t\t\t\treturn subIssueAttributes;\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly SubIssueAttribute[] emptyAttributes = new SubIssueAttribute[0];\n\t\tvoid Initialize()\n\t\t{\n\t\t\tif (subIssueAttributes != null)\n\t\t\t\treturn;\n\t\t\tsubIssueAttributes = GetType().GetCustomAttributes(typeof(SubIssueAttribute), false).OfType<SubIssueAttribute>().ToArray() ?? emptyAttributes;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets all code issues inside a syntax tree.\n\t\t/// </summary>\n\t\t/// <param name='context'>\n\t\t/// The refactoring context of the issues to get.\n\t\t/// </param>\n\t\t/// <param name='subIssue'>\n\t\t/// The name of the sub issue to run.\n\t\t/// </param>\n\t\tpublic virtual IEnumerable<CodeIssue> GetIssues (BaseRefactoringContext context, string subIssue = null)\n\t\t{\n\t\t\treturn GetIssues(context);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/CommonSubIssues.cs",
    "content": "//\n// ConvertToStaticMethodIssue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic class CommonSubIssues\n\t{\n\t\tpublic const string PrivateMember    = \"Private accessibility\";\n\t\tpublic const string NonPrivateMember = \"Non-private accessibility\";\n\n\t}\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/ContextActionAttribute.cs",
    "content": "﻿// \n// ProviderDescriptionAttribute.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[AttributeUsage(AttributeTargets.Class)]\n\tpublic class ContextActionAttribute : System.Attribute\n\t{\n\t\tpublic string Title { get; private set;}\n\t\tpublic string Description { get; set; }\n\t\tpublic string Category { get; set; }\n\n\t\tpublic ContextActionAttribute (string title)\n\t\t{\n\t\t\tTitle = title;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/DocumentScript.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Editor;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Script implementation based on IDocument.\n\t/// </summary>\n\tpublic class DocumentScript : Script\n\t{\n\t\treadonly IDocument currentDocument;\n\t\t\n\t\tpublic IDocument CurrentDocument {\n\t\t\tget { return currentDocument; }\n\t\t}\n\t\treadonly IDocument originalDocument;\n\t\t\n\t\tpublic IDocument OriginalDocument {\n\t\t\tget { return originalDocument; }\n\t\t}\n\t\treadonly IDisposable undoGroup;\n\t\t\n\t\t\n\t\tpublic DocumentScript(IDocument document, CSharpFormattingOptions formattingOptions, TextEditorOptions options) : base(formattingOptions, options)\n\t\t{\n\t\t\tthis.originalDocument = document.CreateDocumentSnapshot();\n\t\t\tthis.currentDocument = document;\n\t\t\tDebug.Assert(currentDocument.Version.CompareAge(originalDocument.Version) == 0);\n\t\t\tthis.undoGroup = document.OpenUndoGroup();\n\t\t}\n\t\t\n\t\tpublic override void Dispose()\n\t\t{\n\t\t\t// Since base.Dispose() reformats some nodes; we need to include it in the undo group\n\t\t\tbase.Dispose();\n\t\t\tif (undoGroup != null)\n\t\t\t\tundoGroup.Dispose();\n\t\t}\n\t\t\n\t\tpublic override void Remove(AstNode node, bool removeEmptyLine = true)\n\t\t{\n\t\t\tvar segment = GetSegment (node);\n\t\t\tint startOffset = segment.Offset;\n\t\t\tint endOffset = segment.EndOffset;\n\t\t\tvar startLine = currentDocument.GetLineByOffset (startOffset);\n\t\t\tvar endLine = currentDocument.GetLineByOffset (endOffset);\n\t\t\t\n\t\t\tif (startLine != null && endLine != null) {\n\t\t\t\tbool removeStart = string.IsNullOrWhiteSpace (currentDocument.GetText (startLine.Offset, startOffset - startLine.Offset));\n\t\t\t\tif (removeStart)\n\t\t\t\t\tstartOffset = startLine.Offset;\n\t\t\t\tbool removeEnd = string.IsNullOrWhiteSpace (currentDocument.GetText (endOffset, endLine.EndOffset - endOffset));\n\t\t\t\tif (removeEnd)\n\t\t\t\t\tendOffset = endLine.EndOffset;\n\t\t\t\t\n\t\t\t\t// Remove delimiter if the whole line get's removed.\n\t\t\t\tif (removeStart && removeEnd)\n\t\t\t\t\tendOffset += endLine.DelimiterLength;\n\t\t\t}\n\t\t\t\n\t\t\tReplace (startOffset, endOffset - startOffset, string.Empty);\n\t\t}\n\t\t\n\t\tpublic override void Replace(int offset, int length, string newText)\n\t\t{\n\t\t\tcurrentDocument.Replace(offset, length, newText);\n\t\t}\n\t\t\n\t\tpublic override int GetCurrentOffset(TextLocation originalDocumentLocation)\n\t\t{\n\t\t\tint offset = originalDocument.GetOffset(originalDocumentLocation);\n\t\t\treturn GetCurrentOffset(offset);\n\t\t}\n\t\t\n\t\tpublic override int GetCurrentOffset(int originalDocumentOffset)\n\t\t{\n\t\t\treturn originalDocument.Version.MoveOffsetTo(currentDocument.Version, originalDocumentOffset);\n\t\t}\n\t\t\n\t\tpublic override void FormatText(IEnumerable<AstNode> nodes)\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse(currentDocument, \"dummy.cs\");\n\t\t\tvar formatter = new CSharpFormatter(FormattingOptions, Options);\n\t\t\tvar segments = new List<ISegment>();\n\t\t\tforeach (var node in nodes.OrderByDescending (n => n.StartLocation)) {\n\t\t\t\tvar segment = GetSegment(node);\n\t\t\t\t\n\t\t\t\tformatter.AddFormattingRegion (new ICSharpCode.NRefactory.TypeSystem.DomRegion (\n\t\t\t\t\tcurrentDocument.GetLocation (segment.Offset), \n\t\t\t\t\tcurrentDocument.GetLocation (segment.EndOffset)\n\t\t\t\t\t));\n\t\t\t\tsegments.Add(segment);\n\t\t\t}\n\t\t\tif (segments.Count == 0)\n\t\t\t\treturn;\n\t\t\tvar changes = formatter.AnalyzeFormatting (currentDocument, syntaxTree);\n\t\t\tforeach (var segment in segments) {\n\t\t\t\tchanges.ApplyChanges(segment.Offset, segment.Length - 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected override int GetIndentLevelAt(int offset)\n\t\t{\n\t\t\tvar line = currentDocument.GetLineByOffset(offset);\n\t\t\tint spaces = 0;\n\t\t\tint indentationLevel = 0;\n\t\t\tfor (int i = line.Offset; i < currentDocument.TextLength; i++) {\n\t\t\t\tchar c = currentDocument.GetCharAt(i);\n\t\t\t\tif (c == '\\t') {\n\t\t\t\t\tspaces = 0;\n\t\t\t\t\tindentationLevel++;\n\t\t\t\t} else if (c == ' ') {\n\t\t\t\t\tspaces++;\n\t\t\t\t\tif (spaces == 4) {\n\t\t\t\t\t\tspaces = 0;\n\t\t\t\t\t\tindentationLevel++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn indentationLevel;\n\t\t}\n\t\t\n\t\tprotected override ISegment CreateTrackedSegment(int offset, int length)\n\t\t{\n\t\t\treturn new TrackedSegment(this, offset, offset + length);\n\t\t}\n\t\t\n\t\tsealed class TrackedSegment : ISegment\n\t\t{\n\t\t\treadonly DocumentScript script;\n\t\t\treadonly ITextSourceVersion originalVersion;\n\t\t\treadonly int originalStart;\n\t\t\treadonly int originalEnd;\n\t\t\t\n\t\t\tpublic TrackedSegment(DocumentScript script, int originalStart, int originalEnd)\n\t\t\t{\n\t\t\t\tthis.script = script;\n\t\t\t\tthis.originalVersion = script.currentDocument.Version;\n\t\t\t\tthis.originalStart = originalStart;\n\t\t\t\tthis.originalEnd = originalEnd;\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Offset {\n\t\t\t\tget { return originalVersion.MoveOffsetTo(script.currentDocument.Version, originalStart); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Length {\n\t\t\t\tget { return this.EndOffset - this.Offset; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int EndOffset {\n\t\t\t\tget { return originalVersion.MoveOffsetTo(script.currentDocument.Version, originalEnd); }\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/FormatStringHelper.cs",
    "content": "//\n// FormatStringHelper.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tstatic class FormatStringHelper\n\t{\n\t\tstatic readonly string[] parameterNames = { \"format\", \"frmt\", \"fmt\" };\n\t\t\n\t\tpublic static bool TryGetFormattingParameters(CSharpInvocationResolveResult invocationResolveResult, InvocationExpression invocationExpression,\n\t\t                                     \t\t  out Expression formatArgument, out IList<Expression> arguments,\n\t\t                                              Func<IParameter, Expression, bool> argumentFilter)\n\t\t{\n\t\t\tif (argumentFilter == null)\n\t\t\t\targumentFilter = (p, e) => true;\n\n\t\t\tformatArgument = null;\n\t\t\targuments = new List<Expression>();\n\n\t\t\t// Serach for method of type: void Name(string format, params object[] args);\n\t\t\tif (invocationResolveResult.Member.SymbolKind == SymbolKind.Method) {\n\t\t\t\tvar methods = invocationResolveResult.Member.DeclaringType.GetMethods(m => m.Name == invocationResolveResult.Member.Name).ToList();\n\t\t\t\tif (!methods.Any(m => m.Parameters.Count == 2 && \n\t\t\t\t\tm.Parameters[0].Type.IsKnownType(KnownTypeCode.String) && parameterNames.Contains(m.Parameters[0].Name) && \n\t\t\t\t\tm.Parameters[1].IsParams))\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar argumentToParameterMap = invocationResolveResult.GetArgumentToParameterMap();\n\t\t\tvar resolvedParameters = invocationResolveResult.Member.Parameters;\n\t\t\tvar allArguments = invocationExpression.Arguments.ToArray();\n\t\t\tfor (int i = 0; i < allArguments.Length; i++) {\n\t\t\t\tvar parameterIndex = argumentToParameterMap[i];\n\t\t\t\tif (parameterIndex < 0 || parameterIndex >= resolvedParameters.Count) {\n\t\t\t\t\t// No valid mapping for this argument, skip it\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar parameter = resolvedParameters[parameterIndex];\n\t\t\t\tvar argument = allArguments[i];\n\t\t\t\tif (i == 0 && parameter.Type.IsKnownType(KnownTypeCode.String) && parameterNames.Contains(parameter.Name)) {\n\t\t\t\t\tformatArgument = argument;\n\t\t\t\t} else if (formatArgument != null && parameter.IsParams && !invocationResolveResult.IsExpandedForm) {\n\t\t\t\t\tvar ace = argument as ArrayCreateExpression;\n\t\t\t\t\tif (ace == null || ace.Initializer.IsNull)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tforeach (var element in ace.Initializer.Elements) {\n\t\t\t\t\t\tif (argumentFilter(parameter, element))\n\t\t\t\t\t\t\targuments.Add(argument);\n\t\t\t\t\t}\n\t\t\t\t} else if (formatArgument != null && argumentFilter(parameter, argument)) {\n\t\t\t\t\targuments.Add(argument);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn formatArgument != null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/IssueAttribute.cs",
    "content": "﻿// \n// IssueAttribute.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[AttributeUsage(AttributeTargets.Class)]\n\tpublic class IssueDescriptionAttribute : System.Attribute\n\t{\n\t\tpublic string Title { get; private set;}\n\t\tpublic string Description { get; set; }\n\t\tpublic string Category { get; set; }\n\n\t\tpublic string AnalysisDisableKeyword { get; set; }\n\t\tpublic string SuppressMessageCategory { get; set; }\n\t\tpublic string SuppressMessageCheckId { get; set; }\n\t\tpublic int PragmaWarning { get; set; }\n\t\tpublic bool IsEnabledByDefault { get; set; }\n\t\tpublic bool SupportsAutoFix { get; set; }\n\n\t\tpublic Severity Severity { get; set; }\n\n\t\tpublic IssueDescriptionAttribute (string title)\n\t\t{\n\t\t\tTitle = title;\n\t\t\tSeverity = Severity.Suggestion;\n\t\t\tIsEnabledByDefault = true;\n\t\t}\n\t}\n\n\t[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]\n\tpublic class SubIssueAttribute : System.Attribute\n\t{\n\t\tpublic string Title { get; private set;}\n\t\tpublic string Description { get; set; }\n\n\t\tpublic bool? IsEnabledByDefault { get; set; }\n\t\tpublic Severity? Severity { get; set; }\n\n\t\tpublic SubIssueAttribute (string title)\n\t\t{\n\t\t\tTitle = title;\n\t\t}\n\n\t\tpublic SubIssueAttribute (string title, Severity severity)\n\t\t{\n\t\t\tTitle = title;\n\t\t\tthis.Severity = severity;\n\t\t}\n\n\t\tpublic SubIssueAttribute (string title, bool isEnabledByDefault)\n\t\t{\n\t\t\tTitle = title;\n\t\t\tthis.IsEnabledByDefault = isEnabledByDefault;\n\t\t}\n\n\t\tpublic SubIssueAttribute (string title, Severity severity, bool isEnabledByDefault)\n\t\t{\n\t\t\tTitle = title;\n\t\t\tthis.Severity = severity;\n\t\t\tthis.IsEnabledByDefault = isEnabledByDefault;\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/LambdaHelper.cs",
    "content": "﻿// \n// LambdaHelper.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic class LambdaHelper\n\t{\n\t\tpublic static IType GetLambdaReturnType(RefactoringContext context, LambdaExpression lambda)\n\t\t{\n\t\t\tLambdaResolveResult rr = context.Resolve(lambda) as LambdaResolveResult;\n\t\t\tif (rr == null)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\tif (rr.IsAsync) {\n\t\t\t\t// Unpack Task<T>\n\t\t\t\tif (rr.ReturnType.IsKnownType(KnownTypeCode.Task))\n\t\t\t\t\treturn context.Compilation.FindType(KnownTypeCode.Void);\n\t\t\t\telse if (rr.ReturnType.IsKnownType(KnownTypeCode.TaskOfT) && rr.ReturnType.IsParameterized)\n\t\t\t\t\treturn rr.ReturnType.TypeArguments[0];\n\t\t\t}\n\t\t\treturn rr.ReturnType;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/LocalReferenceFinder.cs",
    "content": "//\n// LocalReferenceFinder.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\n\t/// <summary>\n\t/// Finds references to <see cref=\"IVariable\">IVariables</see>.\n\t/// </summary>\n\t/// <remarks>\n\t/// This class is more efficient than <see cref=\"FindReferences\"/>\n\t/// if there is already a resolved tree or if multiple searches needs\n\t/// to be performed.\n\t/// </remarks>\t\t\n\tpublic class LocalReferenceFinder\n\t{\n\t\tLocalReferenceLocator locator;\n\n\t\tMultiDictionary<IVariable, ReferenceResult> references = new MultiDictionary<IVariable, ReferenceResult>();\n\t\t\n\t\tHashSet<AstNode> visitedRoots = new HashSet<AstNode>();\n\t\t\n\t\tpublic LocalReferenceFinder(CSharpAstResolver resolver)\n\t\t{\n\t\t\tlocator = new LocalReferenceLocator(resolver, this);\n\t\t}\n\n\t\tpublic LocalReferenceFinder(BaseRefactoringContext context) : this(context.Resolver)\n\t\t{\n\t\t}\n\n\t\tvoid VisitIfNeccessary(AstNode rootNode)\n\t\t{\n\t\t\t// If any of the parent nodes are recorded as visited,\n\t\t\t// we don't need to traverse rootNode this time.\n\t\t\tvar tmpRoot = rootNode;\n\t\t\twhile(tmpRoot != null){\n\t\t\t\tif (visitedRoots.Contains(tmpRoot))\n\t\t\t\t\treturn;\n\t\t\t\ttmpRoot = tmpRoot.Parent;\n\t\t\t}\n\n\t\t\tlocator.ProccessRoot (rootNode);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Finds the references to <paramref name=\"variable\"/>.\n\t\t/// </summary>\n\t\t/// <param name='rootNode'>\n\t\t/// Root node for the search.\n\t\t/// </param>\n\t\t/// <param name='variable'>\n\t\t/// The variable to find references for.\n\t\t/// </param>\n\t\t/// <remarks>\n\t\t/// When a single <see cref=\"LocalReferenceFinder\"/> is reused for multiple\n\t\t/// searches, which references outside of <paramref name=\"rootNode\"/> are\n\t\t/// or are not reported is undefined.\n\t\t/// </remarks>\n\t\tpublic IList<ReferenceResult> FindReferences(AstNode rootNode, IVariable variable)\n\t\t{\n\t\t\tlock (locator) {\n\t\t\t\tVisitIfNeccessary(rootNode);\n\t\t\t\tvar lookup = (ILookup<IVariable, ReferenceResult>)references;\n\t\t\t\tif (!lookup.Contains(variable))\n\t\t\t\t\treturn new List<ReferenceResult>();\n\t\t\t\t// Clone the list for thread safety\n\t\t\t\treturn references[variable].ToList();\n\t\t\t}\n\t\t}\n\n\t\tclass LocalReferenceLocator : DepthFirstAstVisitor\n\t\t{\n\t\t\tCSharpAstResolver resolver;\n\n\t\t\tLocalReferenceFinder referenceFinder;\n\n\t\t\tpublic LocalReferenceLocator(CSharpAstResolver resolver, LocalReferenceFinder referenceFinder)\n\t\t\t{\n\t\t\t\tthis.resolver = resolver;\n\t\t\t\tthis.referenceFinder = referenceFinder;\n\t\t\t}\n\n\t\t\tIList<IVariable> processedVariables = new List<IVariable>();\n\n\t\t\tpublic void ProccessRoot (AstNode rootNode)\n\t\t\t{\n\t\t\t\trootNode.AcceptVisitor(this);\n\t\t\t\treferenceFinder.visitedRoots.Add(rootNode);\n\t\t\t}\n\n\t\t\tpublic override void VisitCSharpTokenNode(CSharpTokenNode token)\n\t\t\t{\n\t\t\t\t// Nothing\n\t\t\t}\n\n\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t{\n\t\t\t\tif (referenceFinder.visitedRoots.Contains(node))\n\t\t\t\t\treturn;\n\t\t\t\tvar localResolveResult = resolver.Resolve(node) as LocalResolveResult;\n\t\t\t\tif (localResolveResult != null && !processedVariables.Contains(localResolveResult.Variable)) {\n\t\t\t\t\treferenceFinder.references.Add(localResolveResult.Variable, new ReferenceResult(node, localResolveResult));\n\n\t\t\t\t\tprocessedVariables.Add(localResolveResult.Variable);\n\t\t\t\t\tbase.VisitChildren(node);\n\t\t\t\t\tDebug.Assert(processedVariables.Contains(localResolveResult.Variable), \"Variable should still be in the list of processed variables.\");\n\t\t\t\t\tprocessedVariables.Remove(localResolveResult.Variable);\n\t\t\t\t} else {\n\t\t\t\t\tbase.VisitChildren(node);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class ReferenceResult\n\t{\n\t\tpublic ReferenceResult (AstNode node, LocalResolveResult resolveResult)\n\t\t{\n\t\t\tNode = node;\n\t\t\tResolveResult = resolveResult;\n\t\t}\n\n\t\tpublic AstNode Node { get; private set; }\n\n\t\tpublic LocalResolveResult ResolveResult { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NamingHelper.cs",
    "content": "//\n// NamingHelper.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic class NamingHelper\n\t{\n\t\tISet<string> usedVariableNames;\n\t\tRefactoringContext context;\n\n\t\tpublic NamingHelper(RefactoringContext context)\n\t\t{\n\t\t\tthis.context = context;\n\t\t\tif (usedVariableNames == null) {\n\t\t\t\tvar visitor = new VariableFinderVisitor();\n\t\t\t\tvar astNode = context.GetNode<Statement>();\n\t\t\t\tastNode.AcceptVisitor(visitor);\n\t\t\t\tusedVariableNames = visitor.VariableNames;\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<string> GenerateNameProposals(AstType type)\n\t\t{\n\t\t\tif (type is PrimitiveType) {\n\t\t\t\tvar pt = (PrimitiveType)type;\n\t\t\t\tswitch (pt.Keyword) {\n\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\tyield return \"o\";\n\t\t\t\t\t\tyield return \"obj\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"bool\":\n\t\t\t\t\t\tyield return \"b\";\n\t\t\t\t\t\tyield return \"pred\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"double\":\n\t\t\t\t\tcase \"float\":\n\t\t\t\t\tcase \"decimal\":\n\t\t\t\t\t\tyield return \"d\";\n\t\t\t\t\t\tyield return \"f\";\n\t\t\t\t\t\tyield return \"m\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"char\":\n\t\t\t\t\t\tyield return \"c\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tyield return \"i\";\n\t\t\t\t\t\tyield return \"j\";\n\t\t\t\t\t\tyield return \"k\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tstring name;\n\t\t\tif (type is SimpleType) {\n\t\t\t\tname = ((SimpleType)type).Identifier;\n\t\t\t} else if (type is MemberType) {\n\t\t\t\tname = ((MemberType)type).MemberName;\n\t\t\t} else {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar names = WordParser.BreakWords(name);\n\t\t\tif (names.Count > 0) {\n\t\t\t\tnames [0] = Char.ToLower(names [0] [0]) + names [0].Substring(1);\n\t\t\t}\n\t\t\tyield return string.Join(\"\", names);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates a variable name for a variable of the specified type.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The variable name.\n\t\t/// </returns>\n\t\t/// <param name='type'>\n\t\t/// The type of the variable.\n\t\t/// </param>\n\t\t/// <param name='baseName'>\n\t\t/// Suggested base name.\n\t\t/// </param>\n\t\tpublic string GenerateVariableName(AstType type, string baseName = null)\n\t\t{\n\t\t\tif (baseName == null) {\n\t\t\t\tforeach (var name in NamingHelper.GenerateNameProposals(type)) {\n\t\t\t\t\tbaseName = baseName ?? name;\n\t\t\t\t\tif (NameIsUnused(name)) {\n\t\t\t\t\t\tusedVariableNames.Add(name);\n\t\t\t\t\t\treturn name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (NameIsUnused(baseName)) {\n\t\t\t\treturn baseName;\n\t\t\t}\n\n\t\t\t// If we get here, all of the standard suggestions are already used.\n\t\t\t// This will at least be the second variable named based on firstSuggestion, so start at 2\n\t\t\tint counter = 2;\n\t\t\tstring proposedName;\n\t\t\tdo {\n\t\t\t\tproposedName = baseName + counter++;\n\t\t\t} while (!NameIsUnused(proposedName));\n\t\t\tusedVariableNames.Add(proposedName);\n\t\t\treturn proposedName;\n\t\t}\n\n\t\tbool NameIsUnused(string name)\n\t\t{\n\t\t\treturn !usedVariableNames.Contains(name) && LookupVariable(name) == null;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates a variable name for a variable of the specified type.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The variable name.\n\t\t/// </returns>\n\t\t/// <param name='type'>\n\t\t/// The type of the variable.\n\t\t/// </param>\n\t\t/// <param name='baseName'>\n\t\t/// Suggested base name.\n\t\t/// </param>\n\t\tpublic string GenerateVariableName(IType type, string baseName = null)\n\t\t{\n\t\t\tAstType astType = ToAstType(type);\n\t\t\treturn GenerateVariableName(astType, baseName);\n\t\t}\n\n\t\tAstType ToAstType(IType type)\n\t\t{\n\t\t\tswitch (type.FullName) {\n\t\t\t\tcase \"System.Object\":\n\t\t\t\t\treturn new PrimitiveType(\"object\");\n\t\t\t\tcase \"System.String\":\n\t\t\t\t\treturn new PrimitiveType(\"string\");\n\t\t\t\tcase \"System.Boolean\":\n\t\t\t\t\treturn new PrimitiveType(\"bool\");\n\t\t\t\tcase \"System.Char\":\n\t\t\t\t\treturn new PrimitiveType(\"char\");\n\t\t\t\tcase \"System.SByte\":\n\t\t\t\t\treturn new PrimitiveType(\"sbyte\");\n\t\t\t\tcase \"System.Byte\":\n\t\t\t\t\treturn new PrimitiveType(\"byte\");\n\t\t\t\tcase \"System.Int16\":\n\t\t\t\t\treturn new PrimitiveType(\"short\");\n\t\t\t\tcase \"System.UInt16\":\n\t\t\t\t\treturn new PrimitiveType(\"ushort\");\n\t\t\t\tcase \"System.Int32\":\n\t\t\t\t\treturn new PrimitiveType(\"int\");\n\t\t\t\tcase \"System.UInt32\":\n\t\t\t\t\treturn new PrimitiveType(\"uint\");\n\t\t\t\tcase \"System.Int64\":\n\t\t\t\t\treturn new PrimitiveType(\"long\");\n\t\t\t\tcase \"System.UInt64\":\n\t\t\t\t\treturn new PrimitiveType(\"ulong\");\n\t\t\t\tcase \"System.Single\":\n\t\t\t\t\treturn new PrimitiveType(\"float\");\n\t\t\t\tcase \"System.Double\":\n\t\t\t\t\treturn new PrimitiveType(\"double\");\n\t\t\t\tcase \"System.Decimal\":\n\t\t\t\t\treturn new PrimitiveType(\"decimal\");\n\t\t\t\tdefault:\n\t\t\t\t\treturn new SimpleType(type.Name);\n\t\t\t}\n\t\t}\n\n\t\tIVariable LookupVariable(string name)\n\t\t{\n\t\t\tvar blockStatement = context.GetNode<BlockStatement>();\n\t\t\tvar resolverState = context.GetResolverStateAfter(blockStatement.RBraceToken.PrevSibling);\n\t\t\tvar simpleNameRR = resolverState.ResolveSimpleName(name, new List<IType>()) as LocalResolveResult;\n\t\t\tif (simpleNameRR == null)\n\t\t\t\treturn null;\n\t\t\treturn simpleNameRR.Variable;\n\t\t}\n\n\t\tclass VariableFinderVisitor : DepthFirstAstVisitor\n\t\t{\n\n\t\t\tpublic ISet<string> VariableNames = new HashSet<string>();\n\n\t\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tProcessName(variableInitializer.Name);\n\t\t\t\tbase.VisitVariableInitializer(variableInitializer);\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t\t{\n\t\t\t\tProcessName(queryLetClause.Identifier);\n\t\t\t\tbase.VisitQueryLetClause(queryLetClause);\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t\t{\n\t\t\t\tProcessName(queryFromClause.Identifier);\n\t\t\t\tbase.VisitQueryFromClause(queryFromClause);\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t\t{\n\t\t\t\tProcessName(queryContinuationClause.Identifier);\n\t\t\t\tbase.VisitQueryContinuationClause(queryContinuationClause);\n\t\t\t}\n\n\t\t\tvoid ProcessName(string name)\n\t\t\t{\n\t\t\t\tif (!VariableNames.Contains(name))\n\t\t\t\t\tVariableNames.Add(name);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/PatternHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Helper class for constructing pattern ASTs.\n\t/// </summary>\n\tpublic class PatternHelper\n\t{\n\t\t/// <summary>\n\t\t/// Produces a choice pattern for <c>expr1 op expr2</c> or <c>expr2 op expr1</c>.\n\t\t/// </summary>\n\t\tpublic static Expression CommutativeOperator(Expression expr1, BinaryOperatorType op, Expression expr2)\n\t\t{\n\t\t\treturn new Choice {\n\t\t\t\tnew BinaryOperatorExpression(expr1, op, expr2),\n\t\t\t\tnew BinaryOperatorExpression(expr2.Clone(), op, expr1.Clone())\n\t\t\t};\n\t\t}\n\n\t\tpublic static Expression CommutativeOperatorWithOptionalParentheses(Expression expr1, BinaryOperatorType op, Expression expr2)\n\t\t{\n\t\t\treturn OptionalParentheses(CommutativeOperator(OptionalParentheses(expr1), op, OptionalParentheses(expr2)));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Optionally allows parentheses around the given expression.\n\t\t/// </summary>\n\t\tpublic static Expression OptionalParentheses(Expression expr)\n\t\t{\n\t\t\treturn new OptionalParenthesesPattern(expr);\n\t\t}\n\t\t\n\t\tsealed class OptionalParenthesesPattern : Pattern\n\t\t{\n\t\t\treadonly INode child;\n\t\t\t\n\t\t\tpublic OptionalParenthesesPattern(INode child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t\t{\n\t\t\t\tINode unpacked = ParenthesizedExpression.UnpackParenthesizedExpression(other as Expression);\n\t\t\t\treturn child.DoMatch(unpacked, match);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Optionally allow a block around the given statement;\n\t\t/// </summary>\n\t\t/// <returns>The statement.</returns>\n\t\tpublic static Statement EmbeddedStatement(Statement statement)\n\t\t{\n\t\t\treturn new OptionalBlockPattern(statement);\n\t\t}\n\n\t\tsealed class OptionalBlockPattern : Pattern\n\t\t{\n\t\t\treadonly INode child;\n\n\t\t\tpublic OptionalBlockPattern(INode child)\n\t\t\t{\n\t\t\t\tthis.child = child;\n\t\t\t}\n\n\t\t\tpublic override bool DoMatch(INode other, Match match)\n\t\t\t{\n\t\t\t\tINode unpacked = UnpackBlockStatement(other as Statement);\n\t\t\t\treturn child.DoMatch(unpacked, match);\n\t\t\t}\n\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Unpacks the given expression if it is a ParenthesizedExpression, CheckedExpression or UncheckedExpression.\n\t\t\t/// </summary>\n\t\t\tpublic static Statement UnpackBlockStatement(Statement stmt)\n\t\t\t{\n\t\t\t\twhile (stmt is BlockStatement) {\n\t\t\t\t\tstmt = stmt.GetChildByRole(BlockStatement.StatementRole);\n\t\t\t\t\tif (stmt.GetNextSibling(s => s.Role == BlockStatement.StatementRole) != null)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn stmt;\n\t\t\t}\n\t\t}\n\n\t\n\t\t/// <summary>\n\t\t/// Allows to give parameter declaration group names.\n\t\t/// </summary>\n\t\tpublic static ParameterDeclaration NamedParameter(string groupName)\n\t\t{\n\t\t\treturn new NamedParameterDeclaration (groupName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Allows to give parameter declaration group names.\n\t\t/// </summary>\n\t\tpublic static ParameterDeclaration NamedParameter(string groupName, AstType type, string name, ParameterModifier modifier = ParameterModifier.None)\n\t\t{\n\t\t\treturn new NamedParameterDeclaration (groupName, type, name, modifier);\n\t\t}\n\n\t\tsealed class NamedParameterDeclaration : ParameterDeclaration\n\t\t{\n\t\t\treadonly string groupName;\n\t\t\tpublic string GroupName {\n\t\t\t\tget { return groupName; }\n\t\t\t}\n\n\t\t\tpublic NamedParameterDeclaration(string groupName = null)\n\t\t\t{\n\t\t\t\tthis.groupName = groupName;\n\t\t\t}\n\n\t\t\tpublic NamedParameterDeclaration(string groupName, AstType type, string name, ParameterModifier modifier = ParameterModifier.None) : base (type, name, modifier)\n\t\t\t{\n\t\t\t\tthis.groupName = groupName;\n\t\t\t}\n\n\t\t\tprotected internal override bool DoMatch(AstNode other, Match match)\n\t\t\t{\n\t\t\t\tmatch.Add(this.groupName, other);\n\t\t\t\treturn base.DoMatch(other, match);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Matches any type\n\t\t/// </summary>\n\t\tpublic static AstType AnyType (bool doesMatchNullTypes = false)\n\t\t{\n\t\t\tif (doesMatchNullTypes)\n\t\t\t\treturn new OptionalNode(new AnyNode());\n\t\t\telse\n\t\t\t\treturn new AnyNode();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Matches any type\n\t\t/// </summary>\n\t\tpublic static AstType AnyType (string groupName, bool doesMatchNullTypes = false)\n\t\t{\n\t\t\tif (doesMatchNullTypes)\n\t\t\t\treturn new OptionalNode(new AnyNode(groupName));\n\t\t\telse\n\t\t\t\treturn new AnyNode(groupName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/RefactoringAstHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Helper methods for constructing ASTs for refactoring.\n\t/// These helpers work with frozen ASTs, i.e. they clone input nodes.\n\t/// </summary>\n\tpublic class RefactoringAstHelper\n\t{\n\t\t/// <summary>\n\t\t/// Removes the target from a member reference while preserving the identifier and type arguments.\n\t\t/// </summary>\n\t\tpublic static IdentifierExpression RemoveTarget(MemberReferenceExpression mre)\n\t\t{\n\t\t\tIdentifierExpression ident = new IdentifierExpression(mre.MemberName);\n\t\t\tident.TypeArguments.AddRange(mre.TypeArguments.Select(t => t.Clone()));\n\t\t\treturn ident;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Removes the target from a member reference while preserving the identifier and type arguments.\n\t\t/// </summary>\n\t\tpublic static SimpleType RemoveTarget(MemberType memberType)\n\t\t{\n\t\t\treturn new SimpleType(memberType.MemberName, memberType.TypeArguments.Select(t => t.Clone()));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/RefactoringContext.cs",
    "content": "﻿// \n// RefactoringContext.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Editor;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic abstract class RefactoringContext : BaseRefactoringContext\n\t{\n\t\tpublic RefactoringContext(CSharpAstResolver resolver, CancellationToken cancellationToken) : base (resolver, cancellationToken)\n\t\t{\n\n\t\t}\n\n\t\tpublic abstract TextLocation Location { get; }\n\t\t\n\t\tpublic TypeSystemAstBuilder CreateTypeSystemAstBuilder()\n\t\t{\n\t\t\tvar astNode = GetNode() ?? RootNode.GetNodeAt(Location) ?? RootNode;\n\t\t\tvar csResolver = Resolver.GetResolverStateBefore(astNode);\n\t\t\treturn new TypeSystemAstBuilder(csResolver);\n\t\t}\n\t\t\n\t\tpublic virtual AstType CreateShortType (IType fullType)\n\t\t{\n\t\t\tvar builder = CreateTypeSystemAstBuilder();\n\t\t\treturn builder.ConvertType(fullType);\n\t\t}\n\t\t\n\t\tpublic virtual AstType CreateShortType(string ns, string name, int typeParameterCount = 0)\n\t\t{\n\t\t\tvar builder = CreateTypeSystemAstBuilder();\n\t\t\treturn builder.ConvertType(new TopLevelTypeName(ns, name, typeParameterCount));\n\t\t}\n\n\t\tpublic virtual IEnumerable<AstNode> GetSelectedNodes()\n\t\t{\n\t\t\tif (!IsSomethingSelected) {\n\t\t\t\treturn Enumerable.Empty<AstNode> ();\n\t\t\t}\n\t\t\t\n\t\t\treturn RootNode.GetNodesBetween(SelectionStart, SelectionEnd);\n\t\t}\n\n\t\tpublic AstNode GetNode ()\n\t\t{\n\t\t\treturn RootNode.GetNodeAt (Location);\n\t\t}\n\t\t\n\t\tpublic AstNode GetNode (Predicate<AstNode> pred)\n\t\t{\n\t\t\treturn RootNode.GetNodeAt (Location, pred);\n\t\t}\n\t\t\n\t\tpublic T GetNode<T> () where T : AstNode\n\t\t{\n\t\t\treturn RootNode.GetNodeAt<T> (Location);\n\t\t}\n\t\t\n\t\tpublic CSharpTypeResolveContext GetTypeResolveContext()\n\t\t{\n\t\t\tif (UnresolvedFile != null)\n\t\t\t\treturn UnresolvedFile.GetTypeResolveContext(Compilation, Location);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\n\t\t#region Naming\n\t\tpublic virtual string GetNameProposal (string name, bool camelCase = true)\n\t\t{\n\t\t\treturn GetNameProposal(name, Location, camelCase);\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs",
    "content": "﻿// \n// Script.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading.Tasks;\nusing System.Linq;\nusing System.Text;\nusing Mono.CSharp;\nusing ITypeDefinition = ICSharpCode.NRefactory.TypeSystem.ITypeDefinition;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Class for creating change scripts.\n\t/// 'Original document' = document without the change script applied.\n\t/// 'Current document' = document with the change script (as far as it is already created) applies.\n\t/// </summary>\n\tpublic abstract class Script : IDisposable\n\t{\n\t\tinternal struct Segment : ISegment\n\t\t{\n\t\t\treadonly int offset;\n\t\t\treadonly int length;\n\t\t\t\n\t\t\tpublic int Offset {\n\t\t\t\tget { return offset; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int Length {\n\t\t\t\tget { return length; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic int EndOffset {\n\t\t\t\tget { return Offset + Length; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic Segment (int offset, int length)\n\t\t\t{\n\t\t\t\tthis.offset = offset;\n\t\t\t\tthis.length = length;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString ()\n\t\t\t{\n\t\t\t\treturn string.Format (\"[Script.Segment: Offset={0}, Length={1}, EndOffset={2}]\", Offset, Length, EndOffset);\n\t\t\t}\n\t\t}\n\t\t\n\t\treadonly CSharpFormattingOptions formattingOptions;\n\t\treadonly TextEditorOptions options;\n\t\treadonly Dictionary<AstNode, ISegment> segmentsForInsertedNodes = new Dictionary<AstNode, ISegment>();\n\t\t\n\t\tprotected Script(CSharpFormattingOptions formattingOptions, TextEditorOptions options)\n\t\t{\n\t\t\tif (formattingOptions == null)\n\t\t\t\tthrow new ArgumentNullException(\"formattingOptions\");\n\t\t\tif (options == null)\n\t\t\t\tthrow new ArgumentNullException(\"options\");\n\t\t\tthis.formattingOptions = formattingOptions;\n\t\t\tthis.options = options;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Given an offset in the original document (at the start of script execution),\n\t\t/// returns the offset in the current document.\n\t\t/// </summary>\n\t\tpublic abstract int GetCurrentOffset(int originalDocumentOffset);\n\t\t\n\t\t/// <summary>\n\t\t/// Given an offset in the original document (at the start of script execution),\n\t\t/// returns the offset in the current document.\n\t\t/// </summary>\n\t\tpublic abstract int GetCurrentOffset(TextLocation originalDocumentLocation);\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a tracked segment for the specified (offset,length)-segment.\n\t\t/// Offset is interpreted to be an offset in the current document.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A segment that initially has the specified values, and updates\n\t\t/// on every <see cref=\"Replace(int,int,string)\"/> call.\n\t\t/// </returns>\n\t\tprotected abstract ISegment CreateTrackedSegment(int offset, int length);\n\n\t\t/// <summary>\n\t\t/// Gets the current text segment of the specified AstNode.\n\t\t/// </summary>\n\t\t/// <param name=\"node\">The node to get the segment for.</param>\n\t\tpublic ISegment GetSegment(AstNode node)\n\t\t{\n\t\t\tISegment segment;\n\t\t\tif (segmentsForInsertedNodes.TryGetValue(node, out segment))\n\t\t\t\treturn segment;\n\t\t\tif (node.StartLocation.IsEmpty || node.EndLocation.IsEmpty) {\n\t\t\t\tthrow new InvalidOperationException(\"Trying to get the position of a node that is not part of the original document and was not inserted\");\n\t\t\t}\n\t\t\tint startOffset = GetCurrentOffset(node.StartLocation);\n\t\t\tint endOffset = GetCurrentOffset(node.EndLocation);\n\t\t\treturn new Segment(startOffset, endOffset - startOffset);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Replaces text.\n\t\t/// </summary>\n\t\t/// <param name=\"offset\">The starting offset of the text to be replaced.</param>\n\t\t/// <param name=\"length\">The length of the text to be replaced.</param>\n\t\t/// <param name=\"newText\">The new text.</param>\n\t\tpublic abstract void Replace (int offset, int length, string newText);\n\t\t\n\t\tpublic void InsertText(int offset, string newText)\n\t\t{\n\t\t\tReplace(offset, 0, newText);\n\t\t}\n\t\t\n\t\tpublic void RemoveText(int offset, int length)\n\t\t{\n\t\t\tReplace(offset, length, \"\");\n\t\t}\n\t\t\n\t\tpublic CSharpFormattingOptions FormattingOptions {\n\t\t\tget { return formattingOptions; }\n\t\t}\n\t\t\n\t\tpublic TextEditorOptions Options {\n\t\t\tget { return options; }\n\t\t}\n\t\t\n\t\tpublic void InsertBefore(AstNode node, AstNode newNode)\n\t\t{\n\t\t\tvar startOffset = GetCurrentOffset(new TextLocation(node.StartLocation.Line, 1));\n\t\t\tvar output = OutputNode (GetIndentLevelAt (startOffset), newNode);\n\t\t\tstring text = output.Text;\n\t\t\tif (!(newNode is Expression || newNode is AstType))\n\t\t\t\ttext += Options.EolMarker;\n\t\t\tInsertText(startOffset, text);\n\t\t\toutput.RegisterTrackedSegments(this, startOffset);\n\t\t\tCorrectFormatting (node, newNode);\n\t\t}\n\n\t\tpublic void InsertAfter(AstNode node, AstNode newNode)\n\t\t{\n            var indentLevel = IndentLevelFor(node);\n            var output = OutputNode(indentLevel, newNode);\n            string text =  PrefixFor(node, newNode) + output.Text;\n\n            var insertOffset = GetCurrentOffset(node.EndLocation);\n            InsertText(insertOffset, text);\n            output.RegisterTrackedSegments(this, insertOffset);\n            CorrectFormatting (node, newNode);\n\t\t}\n\n\t    private int IndentLevelFor(AstNode node)\n\t    {\n            if (!DoesInsertingAfterRequireNewline(node))\n\t            return 0;\n\t        \n            return GetIndentLevelAt(GetCurrentOffset(new TextLocation(node.StartLocation.Line, 1)));\n\t    }\n\n\t    bool DoesInsertingAfterRequireNewline(AstNode node)\n\t    {\n            if (node is Expression)\n                return false;\n\n            if (node is AstType)\n                return false;\n\n\t        if (node is ParameterDeclaration)\n\t            return false;\n\n\t        var token = node as CSharpTokenNode;\n\t        if (token != null && token.Role == Roles.LPar)\n\t            return false;\n\t        \n\t        return true;\n\t    }\n\n\t    private string PrefixFor(AstNode node, AstNode newNode)\n\t    {\n\t        if (DoesInsertingAfterRequireNewline(node))\n\t            return Options.EolMarker;\n\n\t        if (newNode is ParameterDeclaration && node is ParameterDeclaration)\n\t            //todo: worry about adding characters to the document without matching AstNode's. \n\t            return \", \";\n\n\t        return String.Empty;\n\t    }\n\n\t    public void AddTo(BlockStatement bodyStatement, AstNode newNode)\n\t\t{\n\t\t\tvar startOffset = GetCurrentOffset(bodyStatement.LBraceToken.EndLocation);\n\t\t\tvar output = OutputNode(1 + GetIndentLevelAt(startOffset), newNode, true);\n\t\t\tInsertText(startOffset, output.Text);\n\t\t\toutput.RegisterTrackedSegments(this, startOffset);\n\t\t\tCorrectFormatting (null, newNode);\n\t\t}\n\t\n\t\tpublic void AddTo(TypeDeclaration typeDecl, EntityDeclaration entityDecl)\n\t\t{\n\t\t\tvar startOffset = GetCurrentOffset(typeDecl.LBraceToken.EndLocation);\n\t\t\tvar output = OutputNode(1 + GetIndentLevelAt(startOffset), entityDecl, true);\n\t\t\tInsertText(startOffset, output.Text);\n\t\t\toutput.RegisterTrackedSegments(this, startOffset);\n\t\t\tCorrectFormatting (null, entityDecl);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Changes the modifier of a given entity declaration.\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity.</param>\n\t\t/// <param name=\"modifiers\">The new modifiers.</param>\n\t\tpublic void ChangeModifier(EntityDeclaration entity, Modifiers modifiers)\n\t\t{\n\t\t\tvar dummyEntity = new MethodDeclaration ();\n\t\t\tdummyEntity.Modifiers = modifiers;\n\n\t\t\tint offset;\n\t\t\tint endOffset;\n\n\t\t\tif (entity.ModifierTokens.Any ()) {\n\t\t\t\toffset = GetCurrentOffset(entity.ModifierTokens.First ().StartLocation);\n\t\t\t\tendOffset = GetCurrentOffset(entity.ModifierTokens.Last ().GetNextSibling (s => s.Role != Roles.NewLine && s.Role != Roles.Whitespace).StartLocation);\n\t\t\t} else {\n\t\t\t\tvar child = entity.FirstChild;\n\t\t\t\twhile (child.NodeType == NodeType.Whitespace ||\n\t\t\t\t       child.Role == EntityDeclaration.AttributeRole ||\n\t\t\t\t       child.Role == Roles.NewLine) {\n\t\t\t\t\tchild = child.NextSibling;\n\t\t\t\t}\n\t\t\t\toffset = endOffset = GetCurrentOffset(child.StartLocation);\n\t\t\t}\n\n\t\t\tvar sb = new StringBuilder();\n\t\t\tforeach (var modifier in dummyEntity.ModifierTokens) {\n\t\t\t\tsb.Append(modifier.ToString());\n\t\t\t\tsb.Append(' ');\n\t\t\t}\n\n\t\t\tReplace(offset, endOffset - offset, sb.ToString());\n\t\t}\n\n\t\tpublic void ChangeModifier(ParameterDeclaration param, ParameterModifier modifier)\n\t\t{\n\t\t\tvar child = param.FirstChild;\n\t\t\tFunc<AstNode, bool> pred = s => s.Role == ParameterDeclaration.RefModifierRole || s.Role == ParameterDeclaration.OutModifierRole || s.Role == ParameterDeclaration.ParamsModifierRole || s.Role == ParameterDeclaration.ThisModifierRole;\n\t\t\tif (!pred(child))\n\t\t\t\tchild = child.GetNextSibling(pred); \n\n\t\t\tint offset;\n\t\t\tint endOffset;\n\n\t\t\tif (child != null) {\n\t\t\t\toffset = GetCurrentOffset(child.StartLocation);\n\t\t\t\tendOffset = GetCurrentOffset(child.GetNextSibling (s => s.Role != Roles.NewLine && s.Role != Roles.Whitespace).StartLocation);\n\t\t\t} else {\n\t\t\t\toffset = endOffset = GetCurrentOffset(param.Type.StartLocation);\n\t\t\t}\n\t\t\tstring modString;\n\t\t\tswitch (modifier) {\n\t\t\t\tcase ParameterModifier.None:\n\t\t\t\t\tmodString = \"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.Ref:\n\t\t\t\t\tmodString = \"ref \";\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.Out:\n\t\t\t\t\tmodString = \"out \";\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.Params:\n\t\t\t\t\tmodString = \"params \";\n\t\t\t\t\tbreak;\n\t\t\t\tcase ParameterModifier.This:\n\t\t\t\t\tmodString = \"this \";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tReplace(offset, endOffset - offset, modString);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Changes the base types of a type declaration.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">The type declaration to modify.</param>\n\t\t/// <param name=\"baseTypes\">The new base types.</param>\n\t\tpublic void ChangeBaseTypes(TypeDeclaration type, IEnumerable<AstType> baseTypes)\n\t\t{\n\t\t\tvar dummyType = new TypeDeclaration();\n\t\t\tdummyType.BaseTypes.AddRange(baseTypes);\n\n\t\t\tint offset;\n\t\t\tint endOffset;\n\t\t\tvar sb = new StringBuilder();\n\n\t\t\tif (type.BaseTypes.Any ()) {\n\t\t\t\toffset = GetCurrentOffset(type.ColonToken.StartLocation);\n\t\t\t\tendOffset = GetCurrentOffset(type.BaseTypes.Last ().EndLocation);\n\t\t\t} else {\n\t\t\t\tsb.Append(' ');\n\t\t\t\tif (type.TypeParameters.Any()) {\n\t\t\t\t\toffset = endOffset = GetCurrentOffset(type.RChevronToken.EndLocation);\n\t\t\t\t} else {\n\t\t\t\t\toffset = endOffset = GetCurrentOffset(type.NameToken.EndLocation);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dummyType.BaseTypes.Any()) {\n\t\t\t\tsb.Append(\": \");\n\t\t\t\tsb.Append(string.Join(\", \", dummyType.BaseTypes));\n\t\t\t}\n\n\t\t\tReplace(offset, endOffset - offset, sb.ToString());\n\t\t\tFormatText(type);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Adds an attribute section to a given entity.\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity to add the attribute to.</param>\n\t\t/// <param name=\"attr\">The attribute to add.</param>\n\t\tpublic void AddAttribute(EntityDeclaration entity, AttributeSection attr)\n\t\t{\n\t\t\tvar node = entity.FirstChild;\n\t\t\twhile (node.NodeType == NodeType.Whitespace || node.Role == Roles.Attribute) {\n\t\t\t\tnode = node.NextSibling;\n\t\t\t}\n\t\t\tInsertBefore(node, attr);\n\t\t}\n\n\t\tpublic virtual Task Link (params AstNode[] nodes)\n\t\t{\n\t\t\t// Default implementation: do nothing\n\t\t\t// Derived classes are supposed to enter the text editor's linked state.\n\t\t\t\n\t\t\t// Immediately signal the task as completed:\n\t\t\tvar tcs = new TaskCompletionSource<object>();\n\t\t\ttcs.SetResult(null);\n\t\t\treturn tcs.Task;\n\t\t}\n\n\t\tpublic virtual Task Link (IEnumerable<AstNode> nodes)\n\t\t{\n\t\t\treturn Link(nodes.ToArray());\n\t\t}\n\t\t\n\t\tpublic void Replace (AstNode node, AstNode replaceWith)\n\t\t{\n\t\t\tvar segment = GetSegment (node);\n\t\t\tint startOffset = segment.Offset;\n\t\t\tint level = 0;\n\t\t\tif (!(replaceWith is Expression) && !(replaceWith is AstType))\n\t\t\t\tlevel = GetIndentLevelAt (startOffset);\n\t\t\tNodeOutput output = OutputNode (level, replaceWith);\n\t\t\toutput.TrimStart ();\n\t\t\tReplace (startOffset, segment.Length, output.Text);\n\t\t\toutput.RegisterTrackedSegments(this, startOffset);\n\t\t\tCorrectFormatting (node, node);\n\t\t}\n\n\t\tList<AstNode> nodesToFormat = new List<AstNode> ();\n\n\t\tvoid CorrectFormatting(AstNode node, AstNode newNode)\n\t\t{\n\t\t\tif (node is Identifier || node is IdentifierExpression || node is CSharpTokenNode || node is AstType)\n\t\t\t\treturn;\n\t\t\tif (node == null || node.Parent is BlockStatement) {\n\t\t\t\tnodesToFormat.Add (newNode); \n\t\t\t} else {\n\t\t\t\tnodesToFormat.Add ((node.Parent != null && (node.Parent is Statement || node.Parent is Expression || node.Parent is VariableInitializer)) ? node.Parent : newNode); \n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic abstract void Remove (AstNode node, bool removeEmptyLine = true);\n\n\t\t/// <summary>\n\t\t/// Safely removes an attribue from it's section (removes empty sections).\n\t\t/// </summary>\n\t\t/// <param name=\"attr\">The attribute to be removed.</param>\n\t\tpublic void RemoveAttribute(Attribute attr)\n\t\t{\n\t\t\tAttributeSection section = (AttributeSection)attr.Parent;\n\t\t\tif (section.Attributes.Count == 1) {\n\t\t\t\tRemove(section);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar newSection = (AttributeSection)section.Clone();\n\t\t\tint i = 0;\n\t\t\tforeach (var a in section.Attributes) {\n\t\t\t\tif (a == attr)\n\t\t\t\t\tbreak;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tnewSection.Attributes.Remove (newSection.Attributes.ElementAt (i));\n\t\t\tReplace(section, newSection);\n\t\t}\n\t\t\n\t\tpublic abstract void FormatText (IEnumerable<AstNode> nodes);\n\n\t\tpublic void FormatText (params AstNode[] nodes)\n\t\t{\n\t\t\tFormatText ((IEnumerable<AstNode>)nodes);\n\t\t}\n\n\t\tpublic virtual void Select (AstNode node)\n\t\t{\n\t\t\t// default implementation: do nothing\n\t\t\t// Derived classes are supposed to set the text editor's selection\n\t\t}\n\n\t\tpublic virtual void Select (TextLocation start, TextLocation end)\n\t\t{\n\t\t\t// default implementation: do nothing\n\t\t\t// Derived classes are supposed to set the text editor's selection\n\t\t}\n\n\t\tpublic virtual void Select (int startOffset, int endOffset)\n\t\t{\n\t\t\t// default implementation: do nothing\n\t\t\t// Derived classes are supposed to set the text editor's selection\n\t\t}\n\n\t\t\n\t\tpublic enum InsertPosition\n\t\t{\n\t\t\tStart,\n\t\t\tBefore,\n\t\t\tAfter,\n\t\t\tEnd\n\t\t}\n\t\t\n\t\tpublic virtual Task<Script> InsertWithCursor(string operation, InsertPosition defaultPosition, IList<AstNode> nodes)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t\t\n\t\tpublic virtual Task<Script> InsertWithCursor(string operation, ITypeDefinition parentType, Func<Script, RefactoringContext, IList<AstNode>> nodeCallback)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t\t\n\t\tpublic Task<Script> InsertWithCursor(string operation, InsertPosition defaultPosition, params AstNode[] nodes)\n\t\t{\n\t\t\treturn InsertWithCursor(operation, defaultPosition, (IList<AstNode>)nodes);\n\t\t}\n\n\t\tpublic Task<Script> InsertWithCursor(string operation, ITypeDefinition parentType, Func<Script, RefactoringContext, AstNode> nodeCallback)\n\t\t{\n\t\t\treturn InsertWithCursor(operation, parentType, (Func<Script, RefactoringContext, IList<AstNode>>)delegate (Script s, RefactoringContext ctx) {\n\t\t\t\treturn new AstNode[] { nodeCallback(s, ctx) };\n\t\t\t});\n\t\t}\n\t\t\n\t\tprotected virtual int GetIndentLevelAt (int offset)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tsealed class SegmentTrackingTokenWriter : TextWriterTokenWriter\n\t\t{\n\t\t\tinternal List<KeyValuePair<AstNode, Segment>> NewSegments = new List<KeyValuePair<AstNode, Segment>>();\n\t\t\treadonly Stack<int> startOffsets = new Stack<int>();\n\t\t\treadonly StringWriter stringWriter;\n\t\t\t\n\t\t\tpublic SegmentTrackingTokenWriter(StringWriter stringWriter)\n\t\t\t\t: base(stringWriter)\n\t\t\t{\n\t\t\t\tthis.stringWriter = stringWriter;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void WriteIdentifier (Identifier identifier)\n\t\t\t{\n\t\t\t\tint startOffset = stringWriter.GetStringBuilder ().Length;\n\t\t\t\tint endOffset = startOffset + (identifier.Name ?? \"\").Length + (identifier.IsVerbatim ? 1 : 0);\n\t\t\t\tNewSegments.Add(new KeyValuePair<AstNode, Segment>(identifier, new Segment(startOffset, endOffset - startOffset)));\n\t\t\t\tbase.WriteIdentifier (identifier);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void StartNode (AstNode node)\n\t\t\t{\n\t\t\t\tbase.StartNode (node);\n\t\t\t\tstartOffsets.Push(stringWriter.GetStringBuilder ().Length);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void EndNode (AstNode node)\n\t\t\t{\n\t\t\t\tint startOffset = startOffsets.Pop();\n\t\t\t\tint endOffset = stringWriter.GetStringBuilder ().Length;\n\t\t\t\tNewSegments.Add(new KeyValuePair<AstNode, Segment>(node, new Segment(startOffset, endOffset - startOffset)));\n\t\t\t\tbase.EndNode (node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected NodeOutput OutputNode(int indentLevel, AstNode node, bool startWithNewLine = false)\n\t\t{\n\t\t\tvar stringWriter = new StringWriter ();\n\t\t\tvar formatter = new SegmentTrackingTokenWriter(stringWriter);\n\t\t\tformatter.Indentation = indentLevel;\n\t\t\tformatter.IndentationString = Options.TabsToSpaces ? new string (' ', Options.IndentSize) : \"\\t\";\n\t\t\tstringWriter.NewLine = Options.EolMarker;\n\t\t\tif (startWithNewLine)\n\t\t\t\tformatter.NewLine ();\n\t\t\tvar visitor = new CSharpOutputVisitor (formatter, formattingOptions);\n\t\t\tnode.AcceptVisitor (visitor);\n\t\t\tstring text = stringWriter.ToString().TrimEnd();\n\t\t\treturn new NodeOutput(text, formatter.NewSegments);\n\t\t}\n\t\t\n\t\tprotected class NodeOutput\n\t\t{\n\t\t\tstring text;\n\t\t\treadonly List<KeyValuePair<AstNode, Segment>> newSegments;\n\t\t\tint trimmedLength;\n\t\t\t\n\t\t\tinternal NodeOutput(string text, List<KeyValuePair<AstNode, Segment>> newSegments)\n\t\t\t{\n\t\t\t\tthis.text = text;\n\t\t\t\tthis.newSegments = newSegments;\n\t\t\t}\n\t\t\t\n\t\t\tpublic string Text {\n\t\t\t\tget { return text; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic void TrimStart()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < text.Length; i++) {\n\t\t\t\t\tchar ch = text [i];\n\t\t\t\t\tif (ch != ' ' && ch != '\\t') {\n\t\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\t\ttext = text.Substring (i);\n\t\t\t\t\t\t\ttrimmedLength = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic void RegisterTrackedSegments(Script script, int insertionOffset)\n\t\t\t{\n\t\t\t\tforeach (var pair in newSegments) {\n\t\t\t\t\tint offset = insertionOffset + pair.Value.Offset - trimmedLength;\n\t\t\t\t\tISegment trackedSegment = script.CreateTrackedSegment(offset, pair.Value.Length);\n\t\t\t\t\tscript.segmentsForInsertedNodes.Add(pair.Key, trackedSegment);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Renames the specified symbol.\n\t\t/// </summary>\n\t\t/// <param name='symbol'>\n\t\t/// The symbol to rename\n\t\t/// </param>\n\t\t/// <param name='name'>\n\t\t/// The new name, if null the user is prompted for a new name.\n\t\t/// </param>\n\t\tpublic virtual void Rename(ISymbol symbol, string name = null)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic virtual void DoGlobalOperationOn(IEnumerable<IEntity> entities, Action<RefactoringContext, Script, IEnumerable<AstNode>> callback, string operationDescription = null)\n\t\t{\n\t\t}\n\n\t\tpublic virtual void Dispose()\n\t\t{\n\t\t\tFormatText (nodesToFormat);\n\t\t}\n\t\t\n\t\tpublic enum NewTypeContext {\n\t\t\t/// <summary>\n\t\t\t/// The class should be placed in a new file to the current namespace.\n\t\t\t/// </summary>\n\t\t\tCurrentNamespace,\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// The class should be placed in the unit tests. (not implemented atm.)\n\t\t\t/// </summary>\n\t\t\tUnitTests\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new file containing the type, namespace and correct usings.\n\t\t/// (Note: Should take care of IDE specific things, file headers, add to project, correct name).\n\t\t/// </summary>\n\t\t/// <param name='newType'>\n\t\t/// New type to be created.\n\t\t/// </param>\n\t\t/// <param name='context'>\n\t\t/// The Context in which the new type should be created.\n\t\t/// </param>\n\t\tpublic virtual void CreateNewType(AstNode newType, NewTypeContext context = NewTypeContext.CurrentNamespace)\n\t\t{\n\t\t}\n\t}\n\n\tstatic class ExtMethods\n\t{\n\t\tpublic static void ContinueScript (this Task task, Action act)\n\t\t{\n\t\t\tif (task.IsCompleted) {\n\t\t\t\tact();\n\t\t\t} else {\n\t\t\t\ttask.ContinueWith(delegate {\n\t\t\t\t\tact();\n\t\t\t\t}, TaskScheduler.FromCurrentSynchronizationContext());\n\t\t\t}\n\t\t}\n\n\t\tpublic static void ContinueScript (this Task<Script> task, Action<Script> act)\n\t\t{\n\t\t\tif (task.IsCompleted) {\n\t\t\t\tact(task.Result);\n\t\t\t} else {\n\t\t\t\ttask.ContinueWith(delegate {\n\t\t\t\t\tact(task.Result);\n\t\t\t\t}, TaskScheduler.FromCurrentSynchronizationContext());\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/TypeGuessing.cs",
    "content": "//\n// TypeGuessing.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic static class TypeGuessing\n\t{\n\t\tstatic int GetArgumentIndex(IEnumerable<Expression> arguments, AstNode parameter)\n\t\t{\n\t\t\tint argumentNumber = 0;\n\t\t\tforeach (var arg in arguments) {\n\t\t\t\tif (arg == parameter) {\n\t\t\t\t\treturn argumentNumber;\n\t\t\t\t}\n\t\t\t\targumentNumber++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tstatic IEnumerable<IType> GetAllValidTypesFromInvocation(CSharpAstResolver resolver, InvocationExpression invoke, AstNode parameter)\n\t\t{\n\t\t\tint index = GetArgumentIndex(invoke.Arguments, parameter);\n\t\t\tif (index < 0)\n\t\t\t\tyield break;\n\n\t\t\tvar targetResult = resolver.Resolve(invoke.Target) as MethodGroupResolveResult;\n\t\t\tif (targetResult != null) {\n\t\t\t\tforeach (var method in targetResult.Methods) {\n\t\t\t\t\tif (index < method.Parameters.Count) {\n\t\t\t\t\t\tif (method.Parameters [index].IsParams) {\n\t\t\t\t\t\t\tvar arrayType = method.Parameters [index].Type as ArrayType;\n\t\t\t\t\t\t\tif (arrayType != null)\n\t\t\t\t\t\t\t\tyield return arrayType.ElementType;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tyield return method.Parameters [index].Type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (var extMethods in targetResult.GetExtensionMethods ()) {\n\t\t\t\t\tforeach (var extMethod in extMethods) {\n\t\t\t\t\t\tIType[] inferredTypes;\n\t\t\t\t\t\tvar m = extMethod;\n\t\t\t\t\t\tif (CSharpResolver.IsEligibleExtensionMethod(targetResult.TargetType, extMethod, true, out inferredTypes)) {\n\t\t\t\t\t\t\tif (inferredTypes != null)\n\t\t\t\t\t\t\t\tm = extMethod.Specialize(new TypeParameterSubstitution(null, inferredTypes));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tint correctedIndex = index + 1;\n\t\t\t\t\t\tif (correctedIndex < m.Parameters.Count) {\n\t\t\t\t\t\t\tif (m.Parameters [correctedIndex].IsParams) {\n\t\t\t\t\t\t\t\tvar arrayType = m.Parameters [correctedIndex].Type as ArrayType;\n\t\t\t\t\t\t\t\tif (arrayType != null)\n\t\t\t\t\t\t\t\t\tyield return arrayType.ElementType;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tyield return m.Parameters [correctedIndex].Type;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic IEnumerable<IType> GetAllValidTypesFromObjectCreation(CSharpAstResolver resolver, ObjectCreateExpression invoke, AstNode parameter)\n\t\t{\n\t\t\tint index = GetArgumentIndex(invoke.Arguments, parameter);\n\t\t\tif (index < 0)\n\t\t\t\tyield break;\n\n\t\t\tvar targetResult = resolver.Resolve(invoke.Type);\n\t\t\tif (targetResult is TypeResolveResult) {\n\t\t\t\tvar type = ((TypeResolveResult)targetResult).Type;\n\t\t\t\tif (type.Kind == TypeKind.Delegate && index == 0) {\n\t\t\t\t\tyield return type;\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t\tforeach (var constructor in type.GetConstructors ()) {\n\t\t\t\t\tif (index < constructor.Parameters.Count)\n\t\t\t\t\t\tyield return constructor.Parameters [index].Type;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static IType GetElementType(CSharpAstResolver resolver, IType type)\n\t\t{\n\t\t\t// TODO: A better get element type method.\n\t\t\tif (type.Kind == TypeKind.Array || type.Kind == TypeKind.Dynamic) {\n\t\t\t\tif (type.Kind == TypeKind.Array)\n\t\t\t\t\treturn ((ArrayType)type).ElementType;\n\t\t\t\treturn resolver.Compilation.FindType(KnownTypeCode.Object);\n\t\t\t}\n\n\n\t\t\tforeach (var method in type.GetMethods (m => m.Name == \"GetEnumerator\")) {\n\t\t\t\tIType returnType = null;\n\t\t\t\tforeach (var prop in method.ReturnType.GetProperties(p => p.Name == \"Current\")) {\n\t\t\t\t\tif (returnType != null && prop.ReturnType.IsKnownType (KnownTypeCode.Object))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\treturnType = prop.ReturnType;\n\t\t\t\t}\n\t\t\t\tif (returnType != null)\n\t\t\t\t\treturn returnType;\n\t\t\t}\n\n\t\t\treturn resolver.Compilation.FindType(KnownTypeCode.Object);\n\t\t}\n\n\t\tstatic IEnumerable<IType> GuessFromConstructorInitializer(CSharpAstResolver resolver, AstNode expr)\n\t\t{\n\t\t\tvar init = expr.Parent as ConstructorInitializer;\n\t\t\tvar rr = resolver.Resolve(expr.Parent);\n\t\t\tint index = GetArgumentIndex(init.Arguments, expr);\n\t\t\tif (index >= 0) {\n\t\t\t\tforeach (var constructor in rr.Type.GetConstructors()) {\n\t\t\t\t\tif (index < constructor.Parameters.Count) {\n\t\t\t\t\t\tyield return constructor.Parameters[index].Type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<IType> GetValidTypes(CSharpAstResolver resolver, AstNode expr)\n\t\t{\n\t\t\tif (expr.Role == Roles.Condition) {\n\t\t\t\treturn new [] { resolver.Compilation.FindType (KnownTypeCode.Boolean) };\n\t\t\t}\n\n\t\t\tvar mref = expr as MemberReferenceExpression;\n\t\t\tif (mref != null) {\n\t\t\t\t// case: guess enum when trying to access not existent enum member\n\t\t\t\tvar rr = resolver.Resolve(mref.Target);\n\t\t\t\tif (!rr.IsError && rr.Type.Kind == TypeKind.Enum)\n\t\t\t\t\treturn new [] { rr.Type };\n\t\t\t}\n\n\t\t\tif (expr.Parent is ParenthesizedExpression || expr.Parent is NamedArgumentExpression) {\n\t\t\t\treturn GetValidTypes(resolver, expr.Parent);\n\t\t\t}\n\t\t\tif (expr.Parent is DirectionExpression) {\n\t\t\t\tvar parent = expr.Parent.Parent;\n\t\t\t\tif (parent is InvocationExpression) {\n\t\t\t\t\tvar invoke = (InvocationExpression)parent;\n\t\t\t\t\treturn GetAllValidTypesFromInvocation(resolver, invoke, expr.Parent);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr.Parent is ArrayInitializerExpression) {\n\t\t\t\tif (expr is NamedExpression)\n\t\t\t\t\treturn new [] { resolver.Resolve(((NamedExpression)expr).Expression).Type };\n\n\t\t\t\tvar aex = expr.Parent as ArrayInitializerExpression;\n\t\t\t\tif (aex.IsSingleElement)\n\t\t\t\t\taex = aex.Parent as ArrayInitializerExpression;\n\t\t\t\tvar type = GetElementType(resolver, resolver.Resolve(aex.Parent).Type);\n\t\t\t\tif (type.Kind != TypeKind.Unknown)\n\t\t\t\t\treturn new [] { type };\n\t\t\t}\n\n\t\t\tif (expr.Parent is ObjectCreateExpression) {\n\t\t\t\tvar invoke = (ObjectCreateExpression)expr.Parent;\n\t\t\t\treturn GetAllValidTypesFromObjectCreation(resolver, invoke, expr);\n\t\t\t}\n\n\t\t\tif (expr.Parent is ArrayCreateExpression) {\n\t\t\t\tvar ace = (ArrayCreateExpression)expr.Parent;\n\t\t\t\tif (!ace.Type.IsNull) {\n\t\t\t\t\treturn new [] { resolver.Resolve(ace.Type).Type };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr.Parent is InvocationExpression) {\n\t\t\t\tvar parent = expr.Parent;\n\t\t\t\tif (parent is InvocationExpression) {\n\t\t\t\t\tvar invoke = (InvocationExpression)parent;\n\t\t\t\t\treturn GetAllValidTypesFromInvocation(resolver, invoke, expr);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr.Parent is VariableInitializer) {\n\t\t\t\tvar initializer = (VariableInitializer)expr.Parent;\n\t\t\t\tvar field = initializer.GetParent<FieldDeclaration>();\n\t\t\t\tif (field != null) {\n\t\t\t\t\tvar rr = resolver.Resolve(field.ReturnType);\n\t\t\t\t\tif (!rr.IsError)\n\t\t\t\t\t\treturn new [] { rr.Type };\n\t\t\t\t}\n\t\t\t\tvar varStmt = initializer.GetParent<VariableDeclarationStatement>();\n\t\t\t\tif (varStmt != null) {\n\t\t\t\t\tvar rr = resolver.Resolve(varStmt.Type);\n\t\t\t\t\tif (!rr.IsError)\n\t\t\t\t\t\treturn new [] { rr.Type };\n\t\t\t\t}\n\t\t\t\treturn new [] { resolver.Resolve(initializer).Type };\n\t\t\t}\n\n\t\t\tif (expr.Parent is CastExpression) {\n\t\t\t\tvar cast = (CastExpression)expr.Parent;\n\t\t\t\treturn new [] { resolver.Resolve(cast.Type).Type };\n\t\t\t}\n\n\t\t\tif (expr.Parent is AsExpression) {\n\t\t\t\tvar cast = (AsExpression)expr.Parent;\n\t\t\t\treturn new [] { resolver.Resolve(cast.Type).Type };\n\t\t\t}\n\n\t\t\tif (expr.Parent is AssignmentExpression) {\n\t\t\t\tvar assign = (AssignmentExpression)expr.Parent;\n\t\t\t\tvar other = assign.Left == expr ? assign.Right : assign.Left;\n\t\t\t\treturn new [] { resolver.Resolve(other).Type };\n\t\t\t}\n\n\t\t\tif (expr.Parent is BinaryOperatorExpression) {\n\t\t\t\tvar assign = (BinaryOperatorExpression)expr.Parent;\n\t\t\t\tvar other = assign.Left == expr ? assign.Right : assign.Left;\n\t\t\t\treturn new [] { resolver.Resolve(other).Type };\n\t\t\t}\n\n\t\t\tif (expr.Parent is ReturnStatement) {\n\t\t\t\tvar parent = expr.Ancestors.FirstOrDefault(n => n is EntityDeclaration || n is AnonymousMethodExpression|| n is LambdaExpression);\n\t\t\t\tif (parent != null) {\n\t\t\t\t\tvar rr = resolver.Resolve(parent);\n\t\t\t\t\tif (!rr.IsError)\n\t\t\t\t\t\treturn new [] { rr.Type };\n\t\t\t\t}\n\t\t\t\tvar e = parent as EntityDeclaration;\n\t\t\t\tif (e != null) {\n\t\t\t\t\tvar rt = resolver.Resolve(e.ReturnType);\n\t\t\t\t\tif (!rt.IsError)\n\t\t\t\t\t\treturn new [] { rt.Type };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr.Parent is YieldReturnStatement) {\n\t\t\t\tvar state = resolver.GetResolverStateBefore(expr);\n\t\t\t\tif (state != null && (state.CurrentMember.ReturnType is ParameterizedType)) {\n\t\t\t\t\tvar pt = (ParameterizedType)state.CurrentMember.ReturnType;\n\t\t\t\t\tif (pt.FullName == \"System.Collections.Generic.IEnumerable\") {\n\t\t\t\t\t\treturn new [] { pt.TypeArguments.First() };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr.Parent is UnaryOperatorExpression) {\n\t\t\t\tvar uop = (UnaryOperatorExpression)expr.Parent;\n\t\t\t\tswitch (uop.Operator) {\n\t\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\t\t\treturn new [] { resolver.Compilation.FindType(KnownTypeCode.Boolean) };\n\t\t\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\t\t\treturn new [] { resolver.Compilation.FindType(KnownTypeCode.Int32) };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (expr.Parent is ConstructorInitializer)\n\t\t\t\treturn GuessFromConstructorInitializer(resolver, expr);\n\n\t\t\tif (expr.Parent is NamedExpression) {\n\t\t\t\tvar rr = resolver.Resolve(expr.Parent);\n\t\t\t\tif (!rr.IsError) {\n\t\t\t\t\treturn new [] { rr.Type };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn Enumerable.Empty<IType>();\n\t\t}\n\t\tstatic readonly IType[] emptyTypes = new IType[0];\n\t\tpublic static AstType GuessAstType(RefactoringContext context, AstNode expr)\n\t\t{\n\t\t\tvar type = GetValidTypes(context.Resolver, expr).ToArray();\n\t\t\tvar typeInference = new TypeInference(context.Compilation);\n\t\t\ttypeInference.Algorithm = TypeInferenceAlgorithm.Improved;\n\t\t\tvar inferedType = typeInference.FindTypeInBounds(type, emptyTypes);\n\t\t\tif (inferedType.Kind == TypeKind.Unknown)\n\t\t\t\treturn new PrimitiveType(\"object\");\n\t\t\treturn context.CreateShortType(inferedType);\n\t\t}\n\n\t\tpublic static IType GuessType(BaseRefactoringContext context, AstNode expr)\n\t\t{\n\t\t\tif (expr is SimpleType && expr.Role == Roles.TypeArgument) {\n\t\t\t\tif (expr.Parent is MemberReferenceExpression || expr.Parent is IdentifierExpression) {\n\t\t\t\t\tvar rr = context.Resolve (expr.Parent);\n\t\t\t\t\tvar argumentNumber = expr.Parent.GetChildrenByRole (Roles.TypeArgument).TakeWhile (c => c != expr).Count ();\n\n\t\t\t\t\tvar mgrr = rr as MethodGroupResolveResult;\n\t\t\t\t\tif (mgrr != null && mgrr.Methods.Any () && mgrr.Methods.First ().TypeArguments.Count > argumentNumber)\n\t\t\t\t\t\treturn mgrr.Methods.First ().TypeParameters[argumentNumber]; \n\t\t\t\t} else if (expr.Parent is MemberType || expr.Parent is SimpleType) {\n\t\t\t\t\tvar rr = context.Resolve (expr.Parent);\n\t\t\t\t\tvar argumentNumber = expr.Parent.GetChildrenByRole (Roles.TypeArgument).TakeWhile (c => c != expr).Count ();\n\t\t\t\t\tvar mgrr = rr as TypeResolveResult;\n\t\t\t\t\tif (mgrr != null &&  mgrr.Type.TypeParameterCount > argumentNumber) {\n\t\t\t\t\t\treturn mgrr.Type.GetDefinition ().TypeParameters[argumentNumber]; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar type = GetValidTypes(context.Resolver, expr).ToArray();\n\t\t\tvar typeInference = new TypeInference(context.Compilation);\n\t\t\ttypeInference.Algorithm = TypeInferenceAlgorithm.Improved;\n\t\t\tvar inferedType = typeInference.FindTypeInBounds(type, emptyTypes);\n\t\t\treturn inferedType;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/TypeSystemAstBuilder.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Converts from type system to the C# AST.\n\t/// </summary>\n\tpublic class TypeSystemAstBuilder\n\t{\n\t\treadonly CSharpResolver resolver;\n\t\t\n\t\t#region Constructor\n\t\t/// <summary>\n\t\t/// Creates a new TypeSystemAstBuilder.\n\t\t/// </summary>\n\t\t/// <param name=\"resolver\">\n\t\t/// A resolver initialized for the position where the type will be inserted.\n\t\t/// </param>\n\t\tpublic TypeSystemAstBuilder(CSharpResolver resolver)\n\t\t{\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\tthis.resolver = resolver;\n\t\t\tInitProperties();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new TypeSystemAstBuilder.\n\t\t/// </summary>\n\t\tpublic TypeSystemAstBuilder()\n\t\t{\n\t\t\tInitProperties();\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Properties\n\t\tvoid InitProperties()\n\t\t{\n\t\t\tthis.ShowAccessibility = true;\n\t\t\tthis.ShowModifiers = true;\n\t\t\tthis.ShowBaseTypes = true;\n\t\t\tthis.ShowTypeParameters = true;\n\t\t\tthis.ShowTypeParameterConstraints = true;\n\t\t\tthis.ShowParameterNames = true;\n\t\t\tthis.ShowConstantValues = true;\n\t\t\tthis.UseAliases = true;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Specifies whether the ast builder should add annotations to type references.\n\t\t/// The default value is <c>false</c>.\n\t\t/// </summary>\n\t\tpublic bool AddAnnotations { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls the accessibility modifiers are shown.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool ShowAccessibility { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls the non-accessibility modifiers are shown.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool ShowModifiers { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether base type references are shown.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool ShowBaseTypes { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether type parameter declarations are shown.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool ShowTypeParameters { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether constraints on type parameter declarations are shown.\n\t\t/// Has no effect if ShowTypeParameters is false.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool ShowTypeParameterConstraints { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether the names of parameters are shown.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool ShowParameterNames { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether to show default values of optional parameters, and the values of constant fields.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool ShowConstantValues { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether to use fully-qualified type names or short type names.\n\t\t/// The default value is <c>false</c>.\n\t\t/// </summary>\n\t\tpublic bool AlwaysUseShortTypeNames { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether to generate a body that throws a <c>System.NotImplementedException</c>.\n\t\t/// The default value is <c>false</c>.\n\t\t/// </summary>\n\t\tpublic bool GenerateBody { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Controls whether to generate custom events.\n\t\t/// The default value is <c>false</c>.\n\t\t/// </summary>\n\t\tpublic bool UseCustomEvents { get; set; }\n\n\t\t/// <summary>\n\t\t/// Controls if unbound type argument names are inserted in the ast or not.\n\t\t/// The default value is <c>false</c>.\n\t\t/// </summary>\n\t\tpublic bool ConvertUnboundTypeArguments { get; set;}\n\n\t\t/// <summary>\n\t\t/// Controls if aliases should be used inside the type name or not.\n\t\t/// The default value is <c>true</c>.\n\t\t/// </summary>\n\t\tpublic bool UseAliases { get; set;}\n\t\t#endregion\n\t\t\n\t\t#region Convert Type\n\t\tpublic AstType ConvertType(IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tAstType astType = ConvertTypeHelper(type);\n\t\t\tif (AddAnnotations)\n\t\t\t\tastType.AddAnnotation(type);\n\t\t\treturn astType;\n\t\t}\n\t\t\n\t\tpublic AstType ConvertType(FullTypeName fullTypeName)\n\t\t{\n\t\t\tif (resolver != null) {\n\t\t\t\tforeach (var asm in resolver.Compilation.Assemblies) {\n\t\t\t\t\tvar def = asm.GetTypeDefinition(fullTypeName);\n\t\t\t\t\tif (def != null) {\n\t\t\t\t\t\treturn ConvertType(def);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tTopLevelTypeName top = fullTypeName.TopLevelTypeName;\n\t\t\tAstType type;\n\t\t\tif (string.IsNullOrEmpty(top.Namespace)) {\n\t\t\t\ttype = new SimpleType(top.Name);\n\t\t\t} else {\n\t\t\t\ttype = new SimpleType(top.Namespace).MemberType(top.Name);\n\t\t\t}\n\t\t\tfor (int i = 0; i < fullTypeName.NestingLevel; i++) {\n\t\t\t\ttype = type.MemberType(fullTypeName.GetNestedTypeName(i));\n\t\t\t}\n\t\t\treturn type;\n\t\t}\n\t\t\n\t\tAstType ConvertTypeHelper(IType type)\n\t\t{\n\t\t\tTypeWithElementType typeWithElementType = type as TypeWithElementType;\n\t\t\tif (typeWithElementType != null) {\n\t\t\t\tif (typeWithElementType is PointerType) {\n\t\t\t\t\treturn ConvertType(typeWithElementType.ElementType).MakePointerType();\n\t\t\t\t} else if (typeWithElementType is ArrayType) {\n\t\t\t\t\treturn ConvertType(typeWithElementType.ElementType).MakeArrayType(((ArrayType)type).Dimensions);\n\t\t\t\t} else {\n\t\t\t\t\t// e.g. ByReferenceType; not supported as type in C#\n\t\t\t\t\treturn ConvertType(typeWithElementType.ElementType);\n\t\t\t\t}\n\t\t\t}\n\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\tif (pt != null) {\n\t\t\t\tif (pt.Name == \"Nullable\" && pt.Namespace == \"System\" && pt.TypeParameterCount == 1) {\n\t\t\t\t\treturn ConvertType(pt.TypeArguments[0]).MakeNullableType();\n\t\t\t\t}\n\t\t\t\treturn ConvertTypeHelper(pt.GetDefinition(), pt.TypeArguments);\n\t\t\t}\n\t\t\tITypeDefinition typeDef = type as ITypeDefinition;\n\t\t\tif (typeDef != null) {\n\t\t\t\tif (typeDef.TypeParameterCount > 0) {\n\t\t\t\t\t// Unbound type\n\t\t\t\t\tIType[] typeArguments = new IType[typeDef.TypeParameterCount];\n\t\t\t\t\tfor (int i = 0; i < typeArguments.Length; i++) {\n\t\t\t\t\t\ttypeArguments[i] = SpecialType.UnboundTypeArgument;\n\t\t\t\t\t}\n\t\t\t\t\treturn ConvertTypeHelper(typeDef, typeArguments);\n\t\t\t\t} else {\n\t\t\t\t\treturn ConvertTypeHelper(typeDef, EmptyList<IType>.Instance);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new SimpleType(type.Name);\n\t\t}\n\t\t\n\t\tAstType ConvertTypeHelper(ITypeDefinition typeDef, IList<IType> typeArguments)\n\t\t{\n\t\t\tDebug.Assert(typeArguments.Count >= typeDef.TypeParameterCount);\n\t\t\t\n\t\t\tstring keyword = KnownTypeReference.GetCSharpNameByTypeCode(typeDef.KnownTypeCode);\n\t\t\tif (keyword != null)\n\t\t\t\treturn new PrimitiveType(keyword);\n\t\t\t\n\t\t\t// The number of type parameters belonging to outer classes\n\t\t\tint outerTypeParameterCount;\n\t\t\tif (typeDef.DeclaringType != null)\n\t\t\t\touterTypeParameterCount = typeDef.DeclaringType.TypeParameterCount;\n\t\t\telse\n\t\t\t\touterTypeParameterCount = 0;\n\t\t\t\n\t\t\tif (resolver != null) {\n\t\t\t\t// Look if there's an alias to the target type\n\t\t\t\tif (UseAliases) {\n\t\t\t\t\tfor (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent) {\n\t\t\t\t\t\tforeach (var pair in usingScope.UsingAliases) {\n\t\t\t\t\t\t\tif (pair.Value is TypeResolveResult) {\n\t\t\t\t\t\t\t\tif (TypeMatches(pair.Value.Type, typeDef, typeArguments))\n\t\t\t\t\t\t\t\t\treturn new SimpleType(pair.Key);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIList<IType> localTypeArguments;\n\t\t\t\tif (typeDef.TypeParameterCount > outerTypeParameterCount) {\n\t\t\t\t\tlocalTypeArguments = new IType[typeDef.TypeParameterCount - outerTypeParameterCount];\n\t\t\t\t\tfor (int i = 0; i < localTypeArguments.Count; i++) {\n\t\t\t\t\t\tlocalTypeArguments[i] = typeArguments[outerTypeParameterCount + i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlocalTypeArguments = EmptyList<IType>.Instance;\n\t\t\t\t}\n\t\t\t\tResolveResult rr = resolver.ResolveSimpleName(typeDef.Name, localTypeArguments);\n\t\t\t\tTypeResolveResult trr = rr as TypeResolveResult;\n\t\t\t\tif (trr != null || (localTypeArguments.Count == 0 && resolver.IsVariableReferenceWithSameType(rr, typeDef.Name, out trr))) {\n\t\t\t\t\tif (!trr.IsError && TypeMatches(trr.Type, typeDef, typeArguments)) {\n\t\t\t\t\t\t// We can use the short type name\n\t\t\t\t\t\tSimpleType shortResult = new SimpleType(typeDef.Name);\n\t\t\t\t\t\tAddTypeArguments(shortResult, typeDef, typeArguments, outerTypeParameterCount, typeDef.TypeParameterCount);\n\t\t\t\t\t\treturn shortResult;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (AlwaysUseShortTypeNames) {\n\t\t\t\tvar shortResult = new SimpleType(typeDef.Name);\n\t\t\t\tAddTypeArguments(shortResult, typeDef, typeArguments, outerTypeParameterCount, typeDef.TypeParameterCount);\n\t\t\t\treturn shortResult;\n\t\t\t}\n\t\t\tMemberType result = new MemberType();\n\t\t\tif (typeDef.DeclaringTypeDefinition != null) {\n\t\t\t\t// Handle nested types\n\t\t\t\tresult.Target = ConvertTypeHelper(typeDef.DeclaringTypeDefinition, typeArguments);\n\t\t\t} else {\n\t\t\t\t// Handle top-level types\n\t\t\t\tif (string.IsNullOrEmpty(typeDef.Namespace)) {\n\t\t\t\t\tresult.Target = new SimpleType(\"global\");\n\t\t\t\t\tresult.IsDoubleColon = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult.Target = ConvertNamespace(typeDef.Namespace);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.MemberName = typeDef.Name;\n\t\t\tAddTypeArguments(result, typeDef, typeArguments, outerTypeParameterCount, typeDef.TypeParameterCount);\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether 'type' is the same as 'typeDef' parameterized with the given type arguments.\n\t\t/// </summary>\n\t\tbool TypeMatches(IType type, ITypeDefinition typeDef, IList<IType> typeArguments)\n\t\t{\n\t\t\tif (typeDef.TypeParameterCount == 0) {\n\t\t\t\treturn typeDef.Equals(type);\n\t\t\t} else {\n\t\t\t\tif (!typeDef.Equals(type.GetDefinition()))\n\t\t\t\t\treturn false;\n\t\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\t\tif (pt == null) {\n\t\t\t\t\treturn typeArguments.All(t => t.Kind == TypeKind.UnboundTypeArgument);\n\t\t\t\t}\n\t\t\t\tvar ta = pt.TypeArguments;\n\t\t\t\tfor (int i = 0; i < ta.Count; i++) {\n\t\t\t\t\tif (!ta[i].Equals(typeArguments[i]))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds type arguments to the result type.\n\t\t/// </summary>\n\t\t/// <param name=\"result\">The result AST node (a SimpleType or MemberType)</param>\n\t\t/// <param name=\"typeDef\">The type definition that owns the type parameters</param>\n\t\t/// <param name=\"typeArguments\">The list of type arguments</param>\n\t\t/// <param name=\"startIndex\">Index of first type argument to add</param>\n\t\t/// <param name=\"endIndex\">Index after last type argument to add</param>\n\t\tvoid AddTypeArguments(AstType result, ITypeDefinition typeDef, IList<IType> typeArguments, int startIndex, int endIndex)\n\t\t{\n\t\t\tDebug.Assert(endIndex <= typeDef.TypeParameterCount);\n\t\t\tfor (int i = startIndex; i < endIndex; i++) {\n\t\t\t\tif (ConvertUnboundTypeArguments && typeArguments[i].Kind == TypeKind.UnboundTypeArgument) {\n\t\t\t\t\tresult.AddChild(new SimpleType(typeDef.TypeParameters[i].Name), Roles.TypeArgument);\n\t\t\t\t} else {\n\t\t\t\t\tresult.AddChild(ConvertType(typeArguments[i]), Roles.TypeArgument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic AstType ConvertNamespace(string namespaceName)\n\t\t{\n\t\t\tif (resolver != null) {\n\t\t\t\t// Look if there's an alias to the target namespace\n\t\t\t\tif (UseAliases) {\n\t\t\t\t\tfor (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent) {\n\t\t\t\t\t\tforeach (var pair in usingScope.UsingAliases) {\n\t\t\t\t\t\t\tNamespaceResolveResult nrr = pair.Value as NamespaceResolveResult;\n\t\t\t\t\t\t\tif (nrr != null && nrr.NamespaceName == namespaceName)\n\t\t\t\t\t\t\t\treturn new SimpleType(pair.Key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint pos = namespaceName.LastIndexOf('.');\n\t\t\tif (pos < 0) {\n\t\t\t\tif (IsValidNamespace(namespaceName)) {\n\t\t\t\t\treturn new SimpleType(namespaceName);\n\t\t\t\t} else {\n\t\t\t\t\treturn new MemberType {\n\t\t\t\t\t\tTarget = new SimpleType(\"global\"),\n\t\t\t\t\t\tIsDoubleColon = true,\n\t\t\t\t\t\tMemberName = namespaceName\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstring parentNamespace = namespaceName.Substring(0, pos);\n\t\t\t\tstring localNamespace = namespaceName.Substring(pos + 1);\n\t\t\t\treturn new MemberType {\n\t\t\t\t\tTarget = ConvertNamespace(parentNamespace),\n\t\t\t\t\tMemberName = localNamespace\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsValidNamespace(string firstNamespacePart)\n\t\t{\n\t\t\tif (resolver == null)\n\t\t\t\treturn true; // just assume namespaces are valid if we don't have a resolver\n\t\t\tNamespaceResolveResult nrr = resolver.ResolveSimpleName(firstNamespacePart, EmptyList<IType>.Instance) as NamespaceResolveResult;\n\t\t\treturn nrr != null && !nrr.IsError && nrr.NamespaceName == firstNamespacePart;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Convert Attribute\n\t\tpublic Attribute ConvertAttribute(IAttribute attribute)\n\t\t{\n\t\t\tAttribute attr = new Attribute();\n\t\t\tattr.Type = ConvertType(attribute.AttributeType);\n\t\t\tSimpleType st = attr.Type as SimpleType;\n\t\t\tMemberType mt = attr.Type as MemberType;\n\t\t\tif (st != null && st.Identifier.EndsWith(\"Attribute\", StringComparison.Ordinal)) {\n\t\t\t\tst.Identifier = st.Identifier.Substring(0, st.Identifier.Length - 9);\n\t\t\t} else if (mt != null && mt.MemberName.EndsWith(\"Attribute\", StringComparison.Ordinal)) {\n\t\t\t\tmt.MemberName = mt.MemberName.Substring(0, mt.MemberName.Length - 9);\n\t\t\t}\n\t\t\tforeach (ResolveResult arg in attribute.PositionalArguments) {\n\t\t\t\tattr.Arguments.Add(ConvertConstantValue(arg));\n\t\t\t}\n\t\t\tforeach (var pair in attribute.NamedArguments) {\n\t\t\t\tattr.Arguments.Add(new NamedExpression(pair.Key.Name, ConvertConstantValue(pair.Value)));\n\t\t\t}\n\t\t\treturn attr;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Convert Constant Value\n\t\tpublic Expression ConvertConstantValue(ResolveResult rr)\n\t\t{\n\t\t\tif (rr == null)\n\t\t\t\tthrow new ArgumentNullException(\"rr\");\n\t\t\tif (rr is ConversionResolveResult) {\n\t\t\t\t// unpack ConversionResolveResult if necessary\n\t\t\t\t// (e.g. a boxing conversion or string->object reference conversion)\n\t\t\t\trr = ((ConversionResolveResult)rr).Input;\n\t\t\t}\n\t\t\t\n\t\t\tif (rr is TypeOfResolveResult) {\n\t\t\t\treturn new TypeOfExpression(ConvertType(rr.Type));\n\t\t\t} else if (rr is ArrayCreateResolveResult) {\n\t\t\t\tArrayCreateResolveResult acrr = (ArrayCreateResolveResult)rr;\n\t\t\t\tArrayCreateExpression ace = new ArrayCreateExpression();\n\t\t\t\tace.Type = ConvertType(acrr.Type);\n\t\t\t\tComposedType composedType = ace.Type as ComposedType;\n\t\t\t\tif (composedType != null) {\n\t\t\t\t\tcomposedType.ArraySpecifiers.MoveTo(ace.AdditionalArraySpecifiers);\n\t\t\t\t\tif (!composedType.HasNullableSpecifier && composedType.PointerRank == 0)\n\t\t\t\t\t\tace.Type = composedType.BaseType;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (acrr.SizeArguments != null && acrr.InitializerElements == null) {\n\t\t\t\t\tace.AdditionalArraySpecifiers.FirstOrNullObject().Remove();\n\t\t\t\t\tace.Arguments.AddRange(acrr.SizeArguments.Select(ConvertConstantValue));\n\t\t\t\t}\n\t\t\t\tif (acrr.InitializerElements != null) {\n\t\t\t\t\tArrayInitializerExpression initializer = new ArrayInitializerExpression();\n\t\t\t\t\tinitializer.Elements.AddRange(acrr.InitializerElements.Select(ConvertConstantValue));\n\t\t\t\t\tace.Initializer = initializer;\n\t\t\t\t}\n\t\t\t\treturn ace;\n\t\t\t} else if (rr.IsCompileTimeConstant) {\n\t\t\t\treturn ConvertConstantValue(rr.Type, rr.ConstantValue);\n\t\t\t} else {\n\t\t\t\treturn new ErrorExpression();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Expression ConvertConstantValue(IType type, object constantValue)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tif (constantValue == null) {\n\t\t\t\tif (type.IsReferenceType == true)\n\t\t\t\t\treturn new NullReferenceExpression();\n\t\t\t\telse\n\t\t\t\t\treturn new DefaultValueExpression(ConvertType(type));\n\t\t\t} else if (type.Kind == TypeKind.Enum) {\n\t\t\t\treturn ConvertEnumValue(type, (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, constantValue, false));\n\t\t\t} else {\n\t\t\t\treturn new PrimitiveExpression(constantValue);\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsFlagsEnum(ITypeDefinition type)\n\t\t{\n\t\t\tIType flagsAttributeType = type.Compilation.FindType(typeof(System.FlagsAttribute));\n\t\t\treturn type.GetAttribute(flagsAttributeType) != null;\n\t\t}\n\t\t\n\t\tExpression ConvertEnumValue(IType type, long val)\n\t\t{\n\t\t\tITypeDefinition enumDefinition = type.GetDefinition();\n\t\t\tTypeCode enumBaseTypeCode = ReflectionHelper.GetTypeCode(enumDefinition.EnumUnderlyingType);\n\t\t\tforeach (IField field in enumDefinition.Fields) {\n\t\t\t\tif (field.IsConst && object.Equals(CSharpPrimitiveCast.Cast(TypeCode.Int64, field.ConstantValue, false), val))\n\t\t\t\t\treturn ConvertType(type).Member(field.Name);\n\t\t\t}\n\t\t\tif (IsFlagsEnum(enumDefinition)) {\n\t\t\t\tlong enumValue = val;\n\t\t\t\tExpression expr = null;\n\t\t\t\tlong negatedEnumValue = ~val;\n\t\t\t\t// limit negatedEnumValue to the appropriate range\n\t\t\t\tswitch (enumBaseTypeCode) {\n\t\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\tnegatedEnumValue &= byte.MaxValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\t\tnegatedEnumValue &= ushort.MaxValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\t\tnegatedEnumValue &= uint.MaxValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tExpression negatedExpr = null;\n\t\t\t\tforeach (IField field in enumDefinition.Fields.Where(fld => fld.IsConst)) {\n\t\t\t\t\tlong fieldValue = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, field.ConstantValue, false);\n\t\t\t\t\tif (fieldValue == 0)\n\t\t\t\t\t\tcontinue;\t// skip None enum value\n\n\t\t\t\t\tif ((fieldValue & enumValue) == fieldValue) {\n\t\t\t\t\t\tvar fieldExpression = ConvertType(type).Member(field.Name);\n\t\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\t\texpr = fieldExpression;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\texpr = new BinaryOperatorExpression(expr, BinaryOperatorType.BitwiseOr, fieldExpression);\n\n\t\t\t\t\t\tenumValue &= ~fieldValue;\n\t\t\t\t\t}\n\t\t\t\t\tif ((fieldValue & negatedEnumValue) == fieldValue) {\n\t\t\t\t\t\tvar fieldExpression = ConvertType(type).Member(field.Name);\n\t\t\t\t\t\tif (negatedExpr == null)\n\t\t\t\t\t\t\tnegatedExpr = fieldExpression;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnegatedExpr = new BinaryOperatorExpression(negatedExpr, BinaryOperatorType.BitwiseOr, fieldExpression);\n\n\t\t\t\t\t\tnegatedEnumValue &= ~fieldValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (enumValue == 0 && expr != null) {\n\t\t\t\t\tif (!(negatedEnumValue == 0 && negatedExpr != null && negatedExpr.Descendants.Count() < expr.Descendants.Count())) {\n\t\t\t\t\t\treturn expr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (negatedEnumValue == 0 && negatedExpr != null) {\n\t\t\t\t\treturn new UnaryOperatorExpression(UnaryOperatorType.BitNot, negatedExpr);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new PrimitiveExpression(CSharpPrimitiveCast.Cast(enumBaseTypeCode, val, false)).CastTo(ConvertType(type));\n\t\t}\n\t\t\n\t\t#endregion\n\t\t\n\t\t#region Convert Parameter\n\t\tpublic ParameterDeclaration ConvertParameter(IParameter parameter)\n\t\t{\n\t\t\tif (parameter == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameter\");\n\t\t\tParameterDeclaration decl = new ParameterDeclaration();\n\t\t\tif (parameter.IsRef) {\n\t\t\t\tdecl.ParameterModifier = ParameterModifier.Ref;\n\t\t\t} else if (parameter.IsOut) {\n\t\t\t\tdecl.ParameterModifier = ParameterModifier.Out;\n\t\t\t} else if (parameter.IsParams) {\n\t\t\t\tdecl.ParameterModifier = ParameterModifier.Params;\n\t\t\t}\n\t\t\tdecl.Type = ConvertType(parameter.Type);\n\t\t\tif (this.ShowParameterNames) {\n\t\t\t\tdecl.Name = parameter.Name;\n\t\t\t}\n\t\t\tif (parameter.IsOptional && this.ShowConstantValues) {\n\t\t\t\tdecl.DefaultExpression = ConvertConstantValue(parameter.Type, parameter.ConstantValue);\n\t\t\t}\n\t\t\treturn decl;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Convert Entity\n\t\tpublic AstNode ConvertSymbol(ISymbol symbol)\n\t\t{\n\t\t\tif (symbol == null)\n\t\t\t\tthrow new ArgumentNullException(\"symbol\");\n\t\t\tswitch (symbol.SymbolKind) {\n\t\t\t\tcase SymbolKind.Namespace:\n\t\t\t\t\treturn ConvertNamespaceDeclaration((INamespace)symbol);\n\t\t\t\tcase SymbolKind.Variable:\n\t\t\t\t\treturn ConvertVariable((IVariable)symbol);\n\t\t\t\tcase SymbolKind.Parameter:\n\t\t\t\t\treturn ConvertParameter((IParameter)symbol);\n\t\t\t\tcase SymbolKind.TypeParameter:\n\t\t\t\t\treturn ConvertTypeParameter((ITypeParameter)symbol);\n\t\t\t\tdefault:\n\t\t\t\t\tIEntity entity = symbol as IEntity;\n\t\t\t\t\tif (entity != null)\n\t\t\t\t\t\treturn ConvertEntity(entity);\n\t\t\t\t\tthrow new ArgumentException(\"Invalid value for SymbolKind: \" + symbol.SymbolKind);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic EntityDeclaration ConvertEntity(IEntity entity)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\tswitch (entity.SymbolKind) {\n\t\t\t\tcase SymbolKind.TypeDefinition:\n\t\t\t\t\treturn ConvertTypeDefinition((ITypeDefinition)entity);\n\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\treturn ConvertField((IField)entity);\n\t\t\t\tcase SymbolKind.Property:\n\t\t\t\t\treturn ConvertProperty((IProperty)entity);\n\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\t\treturn ConvertIndexer((IProperty)entity);\n\t\t\t\tcase SymbolKind.Event:\n\t\t\t\t\treturn ConvertEvent((IEvent)entity);\n\t\t\t\tcase SymbolKind.Method:\n\t\t\t\t\treturn ConvertMethod((IMethod)entity);\n\t\t\t\tcase SymbolKind.Operator:\n\t\t\t\t\treturn ConvertOperator((IMethod)entity);\n\t\t\t\tcase SymbolKind.Constructor:\n\t\t\t\t\treturn ConvertConstructor((IMethod)entity);\n\t\t\t\tcase SymbolKind.Destructor:\n\t\t\t\t\treturn ConvertDestructor((IMethod)entity);\n\t\t\t\tcase SymbolKind.Accessor:\n\t\t\t\t\tIMethod accessor = (IMethod)entity;\n\t\t\t\t\treturn ConvertAccessor(accessor, accessor.AccessorOwner != null ? accessor.AccessorOwner.Accessibility : Accessibility.None);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentException(\"Invalid value for SymbolKind: \" + entity.SymbolKind);\n\t\t\t}\n\t\t}\n\t\t\n\t\tEntityDeclaration ConvertTypeDefinition(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tModifiers modifiers = Modifiers.None;\n\t\t\tif (this.ShowAccessibility) {\n\t\t\t\tmodifiers |= ModifierFromAccessibility(typeDefinition.Accessibility);\n\t\t\t}\n\t\t\tif (this.ShowModifiers) {\n\t\t\t\tif (typeDefinition.IsStatic) {\n\t\t\t\t\tmodifiers |= Modifiers.Static;\n\t\t\t\t} else if (typeDefinition.IsAbstract) {\n\t\t\t\t\tmodifiers |= Modifiers.Abstract;\n\t\t\t\t} else if (typeDefinition.IsSealed) {\n\t\t\t\t\tmodifiers |= Modifiers.Sealed;\n\t\t\t\t}\n\t\t\t\tif (typeDefinition.IsShadowing) {\n\t\t\t\t\tmodifiers |= Modifiers.New;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tClassType classType;\n\t\t\tswitch (typeDefinition.Kind) {\n\t\t\t\tcase TypeKind.Struct:\n\t\t\t\t\tclassType = ClassType.Struct;\n\t\t\t\t\tmodifiers &= ~Modifiers.Sealed;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeKind.Enum:\n\t\t\t\t\tclassType = ClassType.Enum;\n\t\t\t\t\tmodifiers &= ~Modifiers.Sealed;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeKind.Interface:\n\t\t\t\t\tclassType = ClassType.Interface;\n\t\t\t\t\tmodifiers &= ~Modifiers.Abstract;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeKind.Delegate:\n\t\t\t\t\tIMethod invoke = typeDefinition.GetDelegateInvokeMethod();\n\t\t\t\t\tif (invoke != null) {\n\t\t\t\t\t\treturn ConvertDelegate(invoke, modifiers);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgoto default;\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tclassType = ClassType.Class;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tvar decl = new TypeDeclaration();\n\t\t\tdecl.ClassType = classType;\n\t\t\tdecl.Modifiers = modifiers;\n\t\t\tdecl.Name = typeDefinition.Name;\n\t\t\t\n\t\t\tint outerTypeParameterCount = (typeDefinition.DeclaringTypeDefinition == null) ? 0 : typeDefinition.DeclaringTypeDefinition.TypeParameterCount;\n\t\t\t\n\t\t\tif (this.ShowTypeParameters) {\n\t\t\t\tforeach (ITypeParameter tp in typeDefinition.TypeParameters.Skip(outerTypeParameterCount)) {\n\t\t\t\t\tdecl.TypeParameters.Add(ConvertTypeParameter(tp));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (this.ShowBaseTypes) {\n\t\t\t\tforeach (IType baseType in typeDefinition.DirectBaseTypes) {\n\t\t\t\t\tdecl.BaseTypes.Add(ConvertType(baseType));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (this.ShowTypeParameters && this.ShowTypeParameterConstraints) {\n\t\t\t\tforeach (ITypeParameter tp in typeDefinition.TypeParameters) {\n\t\t\t\t\tvar constraint = ConvertTypeParameterConstraint(tp);\n\t\t\t\t\tif (constraint != null)\n\t\t\t\t\t\tdecl.Constraints.Add(constraint);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tDelegateDeclaration ConvertDelegate(IMethod invokeMethod, Modifiers modifiers)\n\t\t{\n\t\t\tITypeDefinition d = invokeMethod.DeclaringTypeDefinition;\n\t\t\t\n\t\t\tDelegateDeclaration decl = new DelegateDeclaration();\n\t\t\tdecl.Modifiers = modifiers & ~Modifiers.Sealed;\n\t\t\tdecl.ReturnType = ConvertType(invokeMethod.ReturnType);\n\t\t\tdecl.Name = d.Name;\n\t\t\t\n\t\t\tif (this.ShowTypeParameters) {\n\t\t\t\tforeach (ITypeParameter tp in d.TypeParameters) {\n\t\t\t\t\tdecl.TypeParameters.Add(ConvertTypeParameter(tp));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach (IParameter p in invokeMethod.Parameters) {\n\t\t\t\tdecl.Parameters.Add(ConvertParameter(p));\n\t\t\t}\n\t\t\t\n\t\t\tif (this.ShowTypeParameters && this.ShowTypeParameterConstraints) {\n\t\t\t\tforeach (ITypeParameter tp in d.TypeParameters) {\n\t\t\t\t\tvar constraint = ConvertTypeParameterConstraint(tp);\n\t\t\t\t\tif (constraint != null)\n\t\t\t\t\t\tdecl.Constraints.Add(constraint);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tFieldDeclaration ConvertField(IField field)\n\t\t{\n\t\t\tFieldDeclaration decl = new FieldDeclaration();\n\t\t\tif (ShowModifiers) {\n\t\t\t\tModifiers m = GetMemberModifiers(field);\n\t\t\t\tif (field.IsConst) {\n\t\t\t\t\tm &= ~Modifiers.Static;\n\t\t\t\t\tm |= Modifiers.Const;\n\t\t\t\t} else if (field.IsReadOnly) {\n\t\t\t\t\tm |= Modifiers.Readonly;\n\t\t\t\t} else if (field.IsVolatile) {\n\t\t\t\t\tm |= Modifiers.Volatile;\n\t\t\t\t}\n\t\t\t\tdecl.Modifiers = m;\n\t\t\t}\n\t\t\tdecl.ReturnType = ConvertType(field.ReturnType);\n\t\t\tExpression initializer = null;\n\t\t\tif (field.IsConst && this.ShowConstantValues)\n\t\t\t\tinitializer = ConvertConstantValue(field.Type, field.ConstantValue);\n\t\t\tdecl.Variables.Add(new VariableInitializer(field.Name, initializer));\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tBlockStatement GenerateBodyBlock()\n\t\t{\n\t\t\tif (GenerateBody) {\n\t\t\t\treturn new BlockStatement {\n\t\t\t\t\tnew ThrowStatement(new ObjectCreateExpression(ConvertType(new TopLevelTypeName(\"System\", \"NotImplementedException\", 0))))\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn BlockStatement.Null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tAccessor ConvertAccessor(IMethod accessor, Accessibility ownerAccessibility)\n\t\t{\n\t\t\tif (accessor == null)\n\t\t\t\treturn Accessor.Null;\n\t\t\tAccessor decl = new Accessor();\n\t\t\tif (this.ShowAccessibility && accessor.Accessibility != ownerAccessibility)\n\t\t\t\tdecl.Modifiers = ModifierFromAccessibility(accessor.Accessibility);\n\t\t\tdecl.Body = GenerateBodyBlock();\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tPropertyDeclaration ConvertProperty(IProperty property)\n\t\t{\n\t\t\tPropertyDeclaration decl = new PropertyDeclaration();\n\t\t\tdecl.Modifiers = GetMemberModifiers(property);\n\t\t\tdecl.ReturnType = ConvertType(property.ReturnType);\n\t\t\tdecl.Name = property.Name;\n\t\t\tdecl.Getter = ConvertAccessor(property.Getter, property.Accessibility);\n\t\t\tdecl.Setter = ConvertAccessor(property.Setter, property.Accessibility);\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tIndexerDeclaration ConvertIndexer(IProperty indexer)\n\t\t{\n\t\t\tIndexerDeclaration decl = new IndexerDeclaration();\n\t\t\tdecl.Modifiers = GetMemberModifiers(indexer);\n\t\t\tdecl.ReturnType = ConvertType(indexer.ReturnType);\n\t\t\tforeach (IParameter p in indexer.Parameters) {\n\t\t\t\tdecl.Parameters.Add(ConvertParameter(p));\n\t\t\t}\n\t\t\tdecl.Getter = ConvertAccessor(indexer.Getter, indexer.Accessibility);\n\t\t\tdecl.Setter = ConvertAccessor(indexer.Setter, indexer.Accessibility);\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tEntityDeclaration ConvertEvent(IEvent ev)\n\t\t{\n\t\t\tif (this.UseCustomEvents) {\n\t\t\t\tCustomEventDeclaration decl = new CustomEventDeclaration();\n\t\t\t\tdecl.Modifiers = GetMemberModifiers(ev);\n\t\t\t\tdecl.ReturnType = ConvertType(ev.ReturnType);\n\t\t\t\tdecl.Name = ev.Name;\n\t\t\t\tdecl.AddAccessor    = ConvertAccessor(ev.AddAccessor, ev.Accessibility);\n\t\t\t\tdecl.RemoveAccessor = ConvertAccessor(ev.RemoveAccessor, ev.Accessibility);\n\t\t\t\treturn decl;\n\t\t\t} else {\n\t\t\t\tEventDeclaration decl = new EventDeclaration();\n\t\t\t\tdecl.Modifiers = GetMemberModifiers(ev);\n\t\t\t\tdecl.ReturnType = ConvertType(ev.ReturnType);\n\t\t\t\tdecl.Variables.Add(new VariableInitializer(ev.Name));\n\t\t\t\treturn decl;\n\t\t\t}\n\t\t}\n\t\t\n\t\tMethodDeclaration ConvertMethod(IMethod method)\n\t\t{\n\t\t\tMethodDeclaration decl = new MethodDeclaration();\n\t\t\tdecl.Modifiers = GetMemberModifiers(method);\n\t\t\tif (method.IsAsync && ShowModifiers)\n\t\t\t\tdecl.Modifiers |= Modifiers.Async;\n\t\t\tdecl.ReturnType = ConvertType(method.ReturnType);\n\t\t\tdecl.Name = method.Name;\n\t\t\t\n\t\t\tif (this.ShowTypeParameters) {\n\t\t\t\tforeach (ITypeParameter tp in method.TypeParameters) {\n\t\t\t\t\tdecl.TypeParameters.Add(ConvertTypeParameter(tp));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach (IParameter p in method.Parameters) {\n\t\t\t\tdecl.Parameters.Add(ConvertParameter(p));\n\t\t\t}\n\t\t\tif (method.IsExtensionMethod && method.ReducedFrom == null && decl.Parameters.Any() && decl.Parameters.First().ParameterModifier == ParameterModifier.None)\n\t\t\t\tdecl.Parameters.First().ParameterModifier = ParameterModifier.This;\n\t\t\t\n\t\t\tif (this.ShowTypeParameters && this.ShowTypeParameterConstraints && !method.IsOverride && !method.IsExplicitInterfaceImplementation) {\n\t\t\t\tforeach (ITypeParameter tp in method.TypeParameters) {\n\t\t\t\t\tvar constraint = ConvertTypeParameterConstraint(tp);\n\t\t\t\t\tif (constraint != null)\n\t\t\t\t\t\tdecl.Constraints.Add(constraint);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdecl.Body = GenerateBodyBlock();\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tEntityDeclaration ConvertOperator(IMethod op)\n\t\t{\n\t\t\tOperatorType? opType = OperatorDeclaration.GetOperatorType(op.Name);\n\t\t\tif (opType == null)\n\t\t\t\treturn ConvertMethod(op);\n\t\t\t\n\t\t\tOperatorDeclaration decl = new OperatorDeclaration();\n\t\t\tdecl.Modifiers = GetMemberModifiers(op);\n\t\t\tdecl.OperatorType = opType.Value;\n\t\t\tdecl.ReturnType = ConvertType(op.ReturnType);\n\t\t\tforeach (IParameter p in op.Parameters) {\n\t\t\t\tdecl.Parameters.Add(ConvertParameter(p));\n\t\t\t}\n\t\t\tdecl.Body = GenerateBodyBlock();\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tConstructorDeclaration ConvertConstructor(IMethod ctor)\n\t\t{\n\t\t\tConstructorDeclaration decl = new ConstructorDeclaration();\n\t\t\tdecl.Modifiers = GetMemberModifiers(ctor);\n\t\t\tif (ctor.DeclaringTypeDefinition != null)\n\t\t\t\tdecl.Name = ctor.DeclaringTypeDefinition.Name;\n\t\t\tforeach (IParameter p in ctor.Parameters) {\n\t\t\t\tdecl.Parameters.Add(ConvertParameter(p));\n\t\t\t}\n\t\t\tdecl.Body = GenerateBodyBlock();\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tDestructorDeclaration ConvertDestructor(IMethod dtor)\n\t\t{\n\t\t\tDestructorDeclaration decl = new DestructorDeclaration();\n\t\t\tif (dtor.DeclaringTypeDefinition != null)\n\t\t\t\tdecl.Name = dtor.DeclaringTypeDefinition.Name;\n\t\t\tdecl.Body = GenerateBodyBlock();\n\t\t\treturn decl;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Convert Modifiers\n\t\tpublic static Modifiers ModifierFromAccessibility(Accessibility accessibility)\n\t\t{\n\t\t\tswitch (accessibility) {\n\t\t\t\tcase Accessibility.Private:\n\t\t\t\t\treturn Modifiers.Private;\n\t\t\t\tcase Accessibility.Public:\n\t\t\t\t\treturn Modifiers.Public;\n\t\t\t\tcase Accessibility.Protected:\n\t\t\t\t\treturn Modifiers.Protected;\n\t\t\t\tcase Accessibility.Internal:\n\t\t\t\t\treturn Modifiers.Internal;\n\t\t\t\tcase Accessibility.ProtectedOrInternal:\n\t\t\t\tcase Accessibility.ProtectedAndInternal:\n\t\t\t\t\treturn Modifiers.Protected | Modifiers.Internal;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Modifiers.None;\n\t\t\t}\n\t\t}\n\t\t\n\t\tModifiers GetMemberModifiers(IMember member)\n\t\t{\n\t\t\tbool isInterfaceMember = member.DeclaringType.Kind == TypeKind.Interface;\n\t\t\tModifiers m = Modifiers.None;\n\t\t\tif (this.ShowAccessibility && !isInterfaceMember) {\n\t\t\t\tm |= ModifierFromAccessibility(member.Accessibility);\n\t\t\t}\n\t\t\tif (this.ShowModifiers) {\n\t\t\t\tif (member.IsStatic) {\n\t\t\t\t\tm |= Modifiers.Static;\n\t\t\t\t} else {\n\t\t\t\t\tif (member.IsAbstract && !isInterfaceMember)\n\t\t\t\t\t\tm |= Modifiers.Abstract;\n\t\t\t\t\tif (member.IsOverride)\n\t\t\t\t\t\tm |= Modifiers.Override;\n\t\t\t\t\tif (member.IsVirtual && !member.IsAbstract && !member.IsOverride)\n\t\t\t\t\t\tm |= Modifiers.Virtual;\n\t\t\t\t\tif (member.IsSealed)\n\t\t\t\t\t\tm |= Modifiers.Sealed;\n\t\t\t\t}\n\t\t\t\tif (member.IsShadowing)\n\t\t\t\t\tm |= Modifiers.New;\n\t\t\t}\n\t\t\treturn m;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Convert Type Parameter\n\t\tTypeParameterDeclaration ConvertTypeParameter(ITypeParameter tp)\n\t\t{\n\t\t\tTypeParameterDeclaration decl = new TypeParameterDeclaration();\n\t\t\tdecl.Variance = tp.Variance;\n\t\t\tdecl.Name = tp.Name;\n\t\t\treturn decl;\n\t\t}\n\t\t\n\t\tConstraint ConvertTypeParameterConstraint(ITypeParameter tp)\n\t\t{\n\t\t\tif (!tp.HasDefaultConstructorConstraint && !tp.HasReferenceTypeConstraint && !tp.HasValueTypeConstraint && tp.DirectBaseTypes.All(IsObjectOrValueType)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tConstraint c = new Constraint();\n\t\t\tc.TypeParameter = new SimpleType (tp.Name);\n\t\t\tif (tp.HasReferenceTypeConstraint) {\n\t\t\t\tc.BaseTypes.Add(new PrimitiveType(\"class\"));\n\t\t\t} else if (tp.HasValueTypeConstraint) {\n\t\t\t\tc.BaseTypes.Add(new PrimitiveType(\"struct\"));\n\t\t\t}\n\t\t\tforeach (IType t in tp.DirectBaseTypes) {\n\t\t\t\tif (!IsObjectOrValueType(t))\n\t\t\t\t\tc.BaseTypes.Add(ConvertType(t));\n\t\t\t}\n\t\t\tif (tp.HasDefaultConstructorConstraint) {\n\t\t\t\tc.BaseTypes.Add(new PrimitiveType(\"new\"));\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\t\t\n\t\tstatic bool IsObjectOrValueType(IType type)\n\t\t{\n\t\t\tITypeDefinition d = type.GetDefinition();\n\t\t\treturn d != null && (d.KnownTypeCode == KnownTypeCode.Object || d.KnownTypeCode == KnownTypeCode.ValueType);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Convert Variable\n\t\tpublic VariableDeclarationStatement ConvertVariable(IVariable v)\n\t\t{\n\t\t\tVariableDeclarationStatement decl = new VariableDeclarationStatement();\n\t\t\tdecl.Modifiers = v.IsConst ? Modifiers.Const : Modifiers.None;\n\t\t\tdecl.Type = ConvertType(v.Type);\n\t\t\tExpression initializer = null;\n\t\t\tif (v.IsConst)\n\t\t\t\tinitializer = ConvertConstantValue(v.Type, v.ConstantValue);\n\t\t\tdecl.Variables.Add(new VariableInitializer(v.Name, initializer));\n\t\t\treturn decl;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tNamespaceDeclaration ConvertNamespaceDeclaration(INamespace ns)\n\t\t{\n\t\t\treturn new NamespaceDeclaration(ns.FullName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/UsingHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Helper methods for managing using declarations.\n\t/// </summary>\n\tpublic class UsingHelper\n\t{\n\t\t/// <summary>\n\t\t/// Inserts 'using ns;' in the current scope, and then removes all explicit\n\t\t/// usages of ns that were made redundant by the new using.\n\t\t/// </summary>\n\t\tpublic static void InsertUsingAndRemoveRedundantNamespaceUsage(RefactoringContext context, Script script, string ns)\n\t\t{\n\t\t\tInsertUsing(context, script, new UsingDeclaration(ns));\n\t\t\t// TODO: remove the usages that were made redundant\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Inserts 'newUsing' in the current scope.\n\t\t/// This method will try to insert new usings in the correct position (depending on\n\t\t/// where the existing usings are; and maintaining the sort order).\n\t\t/// </summary>\n\t\tpublic static void InsertUsing(RefactoringContext context, Script script, AstNode newUsing)\n\t\t{\n\t\t\tUsingInfo newUsingInfo = new UsingInfo(newUsing, context);\n\t\t\tAstNode enclosingNamespace = context.GetNode<NamespaceDeclaration>() ?? context.RootNode;\n\t\t\t// Find nearest enclosing parent that has usings:\n\t\t\tAstNode usingParent = enclosingNamespace;\n\t\t\twhile (usingParent != null && !usingParent.Children.OfType<UsingDeclaration>().Any())\n\t\t\t\tusingParent = usingParent.Parent;\n\t\t\tif (usingParent == null) {\n\t\t\t\t// No existing usings at all -> use the default location\n\t\t\t\tif (script.FormattingOptions.UsingPlacement == UsingPlacement.TopOfFile) {\n\t\t\t\t\tusingParent = context.RootNode;\n\t\t\t\t} else {\n\t\t\t\t\tusingParent = enclosingNamespace;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Find the main block of using declarations in the chosen scope:\n\t\t\tAstNode blockStart = usingParent.Children.FirstOrDefault(IsUsingDeclaration);\n\t\t\tAstNode insertionPoint;\n\t\t\tbool insertAfter = false;\n\t\t\tif (blockStart == null) {\n\t\t\t\t// no using declarations in the file\n\t\t\t\tDebug.Assert(SyntaxTree.MemberRole == NamespaceDeclaration.MemberRole);\n\t\t\t\tinsertionPoint = usingParent.GetChildrenByRole(SyntaxTree.MemberRole).SkipWhile(CanAppearBeforeUsings).FirstOrDefault();\n\t\t\t} else {\n\t\t\t\tinsertionPoint = blockStart;\n\t\t\t\twhile (IsUsingFollowing (ref insertionPoint) && newUsingInfo.CompareTo(new UsingInfo(insertionPoint, context)) > 0)\n\t\t\t\t\tinsertionPoint = insertionPoint.NextSibling;\n\t\t\t\tif (!IsUsingDeclaration(insertionPoint)) {\n\t\t\t\t\t// Insert after last using instead of before next node\n\t\t\t\t\t// This affects where empty lines get placed.\n\t\t\t\t\tinsertionPoint = insertionPoint.PrevSibling;\n\t\t\t\t\tinsertAfter = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (insertionPoint != null) {\n\t\t\t\tif (insertAfter)\n\t\t\t\t\tscript.InsertAfter(insertionPoint, newUsing);\n\t\t\t\telse\n\t\t\t\t\tscript.InsertBefore(insertionPoint, newUsing);\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsUsingFollowing(ref AstNode insertionPoint)\n\t\t{\n\t\t\tvar node = insertionPoint;\n\t\t\twhile (node != null && node.Role == Roles.NewLine)\n\t\t\t\tnode = node.NextSibling;\n\t\t\tif (IsUsingDeclaration(node)) {\n\t\t\t\tinsertionPoint = node;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tstatic bool IsUsingDeclaration(AstNode node)\n\t\t{\n\t\t\treturn node is UsingDeclaration || node is UsingAliasDeclaration;\n\t\t}\n\t\t\n\t\tstatic bool CanAppearBeforeUsings(AstNode node)\n\t\t{\n\t\t\tif (node is ExternAliasDeclaration)\n\t\t\t\treturn true;\n\t\t\tif (node is PreProcessorDirective)\n\t\t\t\treturn true;\n\t\t\tif (node is NewLineNode)\n\t\t\t\treturn true;\n\t\t\tComment c = node as Comment;\n\t\t\tif (c != null)\n\t\t\t\treturn !c.IsDocumentation;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sorts the specified usings.\n\t\t/// </summary>\n\t\tpublic static IEnumerable<AstNode> SortUsingBlock(IEnumerable<AstNode> nodes, BaseRefactoringContext context)\n\t\t{\n\t\t\tvar infos = nodes.Select(_ => new UsingInfo(_, context));\n\t\t\tvar orderedInfos = infos.OrderBy(_ => _);\n\t\t\tvar orderedNodes = orderedInfos.Select(_ => _.Node);\n\n\t\t\treturn orderedNodes;\n\t\t}\n\n\n\t\tprivate sealed class UsingInfo : IComparable<UsingInfo>\n\t\t{\n\t\t\tpublic AstNode Node;\n\n\t\t\tpublic string Alias;\n\t\t\tpublic string Name;\n\n\t\t\tpublic bool IsAlias;\n\t\t\tpublic bool HasTypesFromOtherAssemblies;\n\t\t\tpublic bool IsSystem;\n\n\t\t\tpublic UsingInfo(AstNode node, BaseRefactoringContext context)\n\t\t\t{\n\t\t\t\tvar importAndAlias = GetImportAndAlias(node);\n\n\t\t\t\tNode = node;\n\n\t\t\t\tAlias = importAndAlias.Item2;\n\t\t\t\tName = importAndAlias.Item1.ToString();\n\n\t\t\t\tIsAlias = Alias != null;\n\n\t\t\t\tResolveResult rr;\n\t\t\t\tif (node.Ancestors.Contains(context.RootNode)) {\n\t\t\t\t\trr = context.Resolve(importAndAlias.Item1);\n\t\t\t\t} else {\n\t\t\t\t\t// It's possible that we're looking at a new using that\n\t\t\t\t\t// isn't part of the AST.\n\t\t\t\t\tvar resolver = new CSharpAstResolver(new CSharpResolver(context.Compilation), node);\n\t\t\t\t\trr = resolver.Resolve(importAndAlias.Item1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar nrr = rr as NamespaceResolveResult;\n\t\t\t\tHasTypesFromOtherAssemblies = nrr != null && nrr.Namespace.ContributingAssemblies.Any(a => !a.IsMainAssembly);\n\n\t\t\t\tIsSystem = HasTypesFromOtherAssemblies && (Name == \"System\" || Name.StartsWith(\"System.\", StringComparison.Ordinal));\n\t\t\t}\n\n\t\t\tprivate static Tuple<AstType, string> GetImportAndAlias(AstNode node)\n\t\t\t{\n\t\t\t\tvar plainUsing = node as UsingDeclaration;\n\t\t\t\tif (plainUsing != null)\n\t\t\t\t\treturn Tuple.Create(plainUsing.Import, (string)null);\n\t\t\t\t\n\t\t\t\tvar aliasUsing = node as UsingAliasDeclaration;\n\t\t\t\tif (aliasUsing != null)\n\t\t\t\t\treturn Tuple.Create(aliasUsing.Import, aliasUsing.Alias);\n\n\t\t\t\tthrow new InvalidOperationException(string.Format(\"Invalid using node: {0}\", node));\n\t\t\t}\n\n\t\t\tpublic int CompareTo(UsingInfo y)\n\t\t\t{\n\t\t\t\tUsingInfo x = this;\n\t\t\t\tif (x.IsAlias != y.IsAlias)\n\t\t\t\t\treturn x.IsAlias ? 1 : -1;\n\t\t\t\telse if (x.HasTypesFromOtherAssemblies != y.HasTypesFromOtherAssemblies)\n\t\t\t\t\treturn x.HasTypesFromOtherAssemblies ? -1 : 1;\n\t\t\t\telse if (x.IsSystem != y.IsSystem)\n\t\t\t\t\treturn x.IsSystem ? -1 : 1;\n\t\t\t\telse if (x.Alias != y.Alias)\n\t\t\t\t\treturn StringComparer.Ordinal.Compare(x.Alias, y.Alias);\n\t\t\t\telse if (x.Name != y.Name)\n\t\t\t\t\treturn StringComparer.Ordinal.Compare(x.Name, y.Name);\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/VariableReferenceGraph.cs",
    "content": "﻿// \n// VariableReferenceGraph.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tclass VariableReferenceNode\n\t{\n\t\tpublic IList<AstNode> References {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\tpublic IList<VariableReferenceNode> NextNodes {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\tpublic IList<VariableReferenceNode> PreviousNodes {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\n\t\tpublic VariableReferenceNode ()\n\t\t{\n\t\t\tReferences = new List<AstNode> ();\n\t\t\tNextNodes = new List<VariableReferenceNode> ();\n\t\t\tPreviousNodes = new List<VariableReferenceNode> ();\n\t\t}\n\n\t\tpublic void AddNextNode (VariableReferenceNode node)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\treturn;\n\t\t\tNextNodes.Add (node);\n\t\t\tnode.PreviousNodes.Add (this);\n\t\t}\n\t}\n\n\tclass VariableReferenceGraphBuilder\n\t{\n\t\tControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder ();\n\t\tCfgVariableReferenceNodeBuilder cfgVrNodeBuilder;\n\t\tBaseRefactoringContext ctx;\n\n\t\tpublic VariableReferenceGraphBuilder(BaseRefactoringContext ctx)\n\t\t{\n\t\t\tthis.ctx = ctx;\n\t\t\tcfgVrNodeBuilder = new CfgVariableReferenceNodeBuilder (this);\n\t\t}\n\n\t\tpublic VariableReferenceNode Build (ISet<AstNode> references, CSharpAstResolver resolver,\n\t\t\tExpression expression)\n\t\t{\n\t\t\treturn ExpressionNodeCreationVisitor.CreateNode (references, resolver, new [] { expression });\n\t\t}\n\n\t\tpublic VariableReferenceNode Build (Statement statement, ISet<AstNode> references,\n\t\t\tISet<Statement> refStatements, BaseRefactoringContext context)\n\t\t{\n\t\t\tvar cfg = cfgBuilder.BuildControlFlowGraph (statement, context.Resolver, context.CancellationToken);\n\t\t\tif (cfg.Count == 0)\n\t\t\t\treturn new VariableReferenceNode ();\n\t\t\treturn cfgVrNodeBuilder.Build (cfg [0], references, refStatements, context.Resolver);\n\t\t}\n\n\t\tpublic VariableReferenceNode Build (Statement statement, ISet<AstNode> references,\n\t\t                                           ISet<Statement> refStatements, CSharpAstResolver resolver, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tvar cfg = cfgBuilder.BuildControlFlowGraph (statement, resolver, cancellationToken);\n\t\t\tif (cfg.Count == 0)\n\t\t\t\treturn new VariableReferenceNode();\n\t\t\treturn cfgVrNodeBuilder.Build (cfg [0], references, refStatements, resolver);\n\t\t}\n\n\t\tclass GetExpressionsVisitor : DepthFirstAstVisitor<IEnumerable<Expression>>\n\t\t{\n\n\t\t\tpublic override IEnumerable<Expression> VisitIfElseStatement (IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tyield return ifElseStatement.Condition;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitSwitchStatement (SwitchStatement switchStatement)\n\t\t\t{\n\t\t\t\tyield return switchStatement.Expression;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitForStatement (ForStatement forStatement)\n\t\t\t{\n\t\t\t\tyield return forStatement.Condition;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitDoWhileStatement (DoWhileStatement doWhileStatement)\n\t\t\t{\n\t\t\t\tyield return doWhileStatement.Condition;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitWhileStatement (WhileStatement whileStatement)\n\t\t\t{\n\t\t\t\tyield return whileStatement.Condition;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitForeachStatement (ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\tyield return foreachStatement.InExpression;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitExpressionStatement (ExpressionStatement expressionStatement)\n\t\t\t{\n\t\t\t\tyield return expressionStatement.Expression;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitLockStatement (LockStatement lockStatement)\n\t\t\t{\n\t\t\t\tyield return lockStatement.Expression;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitReturnStatement (ReturnStatement returnStatement)\n\t\t\t{\n\t\t\t\tyield return returnStatement.Expression;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitThrowStatement (ThrowStatement throwStatement)\n\t\t\t{\n\t\t\t\tyield return throwStatement.Expression;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitUsingStatement (UsingStatement usingStatement)\n\t\t\t{\n\t\t\t\tvar expr = usingStatement.ResourceAcquisition as Expression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\treturn new [] { expr };\n\n\t\t\t\treturn usingStatement.ResourceAcquisition.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitVariableDeclarationStatement (\n\t\t\t\tVariableDeclarationStatement variableDeclarationStatement)\n\t\t\t{\n\t\t\t\treturn variableDeclarationStatement.Variables.Select (v => v.Initializer);\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement)\n\t\t\t{\n\t\t\t\tyield return yieldReturnStatement.Expression;\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Expression> VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\tyield break;\n\t\t\t}\n\t\t}\n\n\t\tclass CfgVariableReferenceNodeBuilder\n\t\t{\n\t\t\treadonly VariableReferenceGraphBuilder variableReferenceGraphBuilder;\n\t\t\tGetExpressionsVisitor getExpr = new GetExpressionsVisitor ();\n\n\t\t\tISet<AstNode> references;\n\t\t\tISet<Statement> refStatements;\n\t\t\tCSharpAstResolver resolver;\n\t\t\tDictionary<ControlFlowNode, VariableReferenceNode> nodeDict;\n\n\t\t\tpublic CfgVariableReferenceNodeBuilder(VariableReferenceGraphBuilder variableReferenceGraphBuilder)\n\t\t\t{\n\t\t\t\tthis.variableReferenceGraphBuilder = variableReferenceGraphBuilder;\n\t\t\t}\n\n\t\t\tpublic VariableReferenceNode Build (ControlFlowNode startNode, ISet<AstNode> references,\n\t\t\t\tISet<Statement> refStatements, CSharpAstResolver resolver)\n\t\t\t{\n\t\t\t\tthis.references = references;\n\t\t\t\tthis.refStatements = refStatements;\n\t\t\t\tthis.resolver = resolver;\n\t\t\t\tnodeDict = new Dictionary<ControlFlowNode, VariableReferenceNode> ();\n\t\t\t\treturn AddNode (startNode);\n\t\t\t}\n\n\t\t\tstatic bool IsValidControlFlowNode (ControlFlowNode node)\n\t\t\t{\n\t\t\t\tif (node.NextStatement == null)\n\t\t\t\t\treturn false;\n\t\t\t\tif (node.Type == ControlFlowNodeType.LoopCondition) {\n\t\t\t\t\tif (node.NextStatement is ForeachStatement)\n\t\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tif (node.NextStatement is WhileStatement || node.NextStatement is DoWhileStatement ||\n\t\t\t\t\t\tnode.NextStatement is ForStatement)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tVariableReferenceNode GetStatementEndNode (VariableReferenceNode currentNode, Statement statement)\n\t\t\t{\n\t\t\t\tvar expressions = statement.AcceptVisitor (getExpr);\n\t\t\t\tVariableReferenceNode endNode;\n\t\t\t\tExpressionNodeCreationVisitor.CreateNode (references, resolver, expressions, currentNode, out endNode);\n\t\t\t\treturn endNode;\n\t\t\t}\n\n\t\t\tVariableReferenceNode AddNode (ControlFlowNode startNode)\n\t\t\t{\n\t\t\t\tvar node = new VariableReferenceNode ();\n\t\t\t\tvar cfNode = startNode;\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (variableReferenceGraphBuilder.ctx.CancellationToken.IsCancellationRequested)\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tif (nodeDict.ContainsKey (cfNode)) {\n\t\t\t\t\t\tnode.AddNextNode (nodeDict [cfNode]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// create a new node for fork point\n\t\t\t\t\tif (cfNode.Incoming.Count > 1 || cfNode.Outgoing.Count > 1) {\n\t\t\t\t\t\tnodeDict [cfNode] = node;\n\n\t\t\t\t\t\tvar forkNode = new VariableReferenceNode ();\n\t\t\t\t\t\tnode.AddNextNode (forkNode);\n\t\t\t\t\t\tnode = forkNode;\n\t\t\t\t\t}\n\t\t\t\t\tnodeDict [cfNode] = node;\n\n\t\t\t\t\tif (IsValidControlFlowNode (cfNode) && refStatements.Contains (cfNode.NextStatement)) {\n\t\t\t\t\t\tnode = GetStatementEndNode (node, cfNode.NextStatement);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (cfNode.Outgoing.Count == 1) {\n\t\t\t\t\t\tcfNode = cfNode.Outgoing [0].To;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach (var e in cfNode.Outgoing) {\n\t\t\t\t\t\t\tnode.AddNextNode (AddNode (e.To));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tVariableReferenceNode result;\n\t\t\t\tif (!nodeDict.TryGetValue (startNode, out result))\n\t\t\t\t\treturn new VariableReferenceNode ();\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tclass ExpressionNodeCreationVisitor : DepthFirstAstVisitor\n\t\t{\n\t\t\tVariableReferenceNode startNode;\n\t\t\tVariableReferenceNode endNode;\n\t\t\tISet<AstNode> references;\n\t\t\tCSharpAstResolver resolver;\n\n\t\t\tExpressionNodeCreationVisitor (ISet<AstNode> references, CSharpAstResolver resolver,\n\t\t\t\tVariableReferenceNode startNode)\n\t\t\t{\n\t\t\t\tthis.references = references;\n\t\t\t\tthis.resolver = resolver;\n\t\t\t\tthis.startNode = this.endNode = startNode ?? new VariableReferenceNode ();\n\t\t\t}\n\n\t\t\tpublic static VariableReferenceNode CreateNode (ISet<AstNode> references, CSharpAstResolver resolver,\n\t\t\t\tparams Expression [] expressions)\n\t\t\t{\n\t\t\t\tVariableReferenceNode endNode;\n\t\t\t\treturn CreateNode (references, resolver, expressions, null, out endNode);\n\t\t\t}\n\n\t\t\tpublic static VariableReferenceNode CreateNode (ISet<AstNode> references, CSharpAstResolver resolver,\n\t\t\t\tIEnumerable<Expression> expressions, VariableReferenceNode startNode, out VariableReferenceNode endNode)\n\t\t\t{\n\t\t\t\tstartNode = startNode ?? new VariableReferenceNode ();\n\t\t\t\tendNode = startNode;\n\t\t\t\tif (expressions != null) {\n\t\t\t\t\tforeach (var expr in expressions) {\n\t\t\t\t\t\tvar visitor = CreateVisitor(references, resolver, expr, endNode);\n\t\t\t\t\t\tendNode = visitor.endNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn startNode;\n\t\t\t}\n\n\t\t\tstatic ExpressionNodeCreationVisitor CreateVisitor (ISet<AstNode> references, CSharpAstResolver resolver,\n\t\t\t\tExpression rootExpr, VariableReferenceNode startNode = null, VariableReferenceNode nextNode = null)\n\t\t\t{\n\t\t\t\tvar visitor = new ExpressionNodeCreationVisitor (references, resolver, startNode);\n\t\t\t\trootExpr.AcceptVisitor (visitor);\n\t\t\t\tif (nextNode != null)\n\t\t\t\t\tvisitor.endNode.AddNextNode (nextNode);\n\t\t\t\treturn visitor;\n\t\t\t}\n\n\t\t\tstatic VariableReferenceNode CreateNode (ISet<AstNode> references, CSharpAstResolver resolver, \n\t\t\t\tExpression rootExpr, VariableReferenceNode startNode = null, VariableReferenceNode nextNode = null)\n\t\t\t{\n\t\t\t\treturn CreateVisitor (references, resolver, rootExpr, startNode, nextNode).startNode;\n\t\t\t}\n\n\t\t\t#region Skipped Expressions\n\t\t\tpublic override void VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression (LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitPrimitiveExpression (PrimitiveExpression primitiveExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitSizeOfExpression (SizeOfExpression sizeOfExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitThisReferenceExpression (ThisReferenceExpression thisReferenceExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeOfExpression (TypeOfExpression typeOfExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeReferenceExpression (TypeReferenceExpression typeReferenceExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression)\n\t\t\t{\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\tpublic override void VisitAssignmentExpression (AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tassignmentExpression.Right.AcceptVisitor (this);\n\t\t\t\tassignmentExpression.Left.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbinaryOperatorExpression.Left.AcceptVisitor (this);\n\t\t\t\tbinaryOperatorExpression.Right.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitCastExpression (CastExpression castExpression)\n\t\t\t{\n\t\t\t\tcastExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitCheckedExpression (CheckedExpression checkedExpression)\n\t\t\t{\n\t\t\t\tcheckedExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitConditionalExpression (ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tconditionalExpression.Condition.AcceptVisitor (this);\n\t\t\t\tvar resolveResult = resolver.Resolve (conditionalExpression.Condition);\n\t\t\t\tif (resolveResult.ConstantValue is bool) {\n\t\t\t\t\tif ((bool) resolveResult.ConstantValue)\n\t\t\t\t\t\tconditionalExpression.TrueExpression.AcceptVisitor (this);\n\t\t\t\t\telse\n\t\t\t\t\t\tconditionalExpression.FalseExpression.AcceptVisitor (this);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar nextEndNode = new VariableReferenceNode ();\n\t\t\t\tvar trueNode = CreateNode (references, resolver, conditionalExpression.TrueExpression, null, \n\t\t\t\t\tnextEndNode);\n\t\t\t\tvar falseNode = CreateNode (references, resolver, conditionalExpression.FalseExpression, null, \n\t\t\t\t\tnextEndNode);\n\t\t\t\tendNode.AddNextNode (trueNode);\n\t\t\t\tendNode.AddNextNode (falseNode);\n\t\t\t\tendNode = nextEndNode;\n\t\t\t}\n\n\t\t\tpublic override void VisitIdentifierExpression (IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tif (references.Contains (identifierExpression))\n\t\t\t\t\tendNode.References.Add (identifierExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerExpression (IndexerExpression indexerExpression)\n\t\t\t{\n\t\t\t\tindexerExpression.Target.AcceptVisitor (this);\n\t\t\t\tforeach (var arg in indexerExpression.Arguments)\n\t\t\t\t\targ.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression (InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tinvocationExpression.Target.AcceptVisitor (this);\n\t\t\t\tvar outArguments = new List<Expression> ();\n\t\t\t\tforeach (var arg in invocationExpression.Arguments) {\n\t\t\t\t\tvar directionExpr = arg as DirectionExpression;\n\t\t\t\t\tif (directionExpr != null && directionExpr.FieldDirection == FieldDirection.Out) {\n\t\t\t\t\t\toutArguments.Add (directionExpr);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\targ.AcceptVisitor (this);\n\t\t\t\t}\n\t\t\t\tforeach (var arg in outArguments)\n\t\t\t\t\targ.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitDirectionExpression (DirectionExpression directionExpression)\n\t\t\t{\n\t\t\t\tdirectionExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tmemberReferenceExpression.Target.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tforeach (var arg in objectCreateExpression.Arguments)\n\t\t\t\t\targ.AcceptVisitor (this);\n\t\t\t\tobjectCreateExpression.Initializer.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousTypeCreateExpression (\n\t\t\t\tAnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t\t{\n\t\t\t\tforeach (var init in anonymousTypeCreateExpression.Initializers)\n\t\t\t\t\tinit.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression)\n\t\t\t{\n\t\t\t\tforeach (var arg in arrayCreateExpression.Arguments)\n\t\t\t\t\targ.AcceptVisitor (this);\n\t\t\t\tarrayCreateExpression.Initializer.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression)\n\t\t\t{\n\t\t\t\tparenthesizedExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression)\n\t\t\t{\n\t\t\t\tpointerReferenceExpression.Target.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitStackAllocExpression (StackAllocExpression stackAllocExpression)\n\t\t\t{\n\t\t\t\tstackAllocExpression.CountExpression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tunaryOperatorExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitUncheckedExpression (UncheckedExpression uncheckedExpression)\n\t\t\t{\n\t\t\t\tuncheckedExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitAsExpression (AsExpression asExpression)\n\t\t\t{\n\t\t\t\tasExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitIsExpression (IsExpression isExpression)\n\t\t\t{\n\t\t\t\tisExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression)\n\t\t\t{\n\t\t\t\tforeach (var element in arrayInitializerExpression.Elements)\n\t\t\t\t\telement.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression)\n\t\t\t{\n\t\t\t\tnamedArgumentExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitNamedExpression (NamedExpression namedExpression)\n\t\t\t{\n\t\t\t\tnamedExpression.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryExpression (QueryExpression queryExpression)\n\t\t\t{\n\t\t\t\tforeach (var clause in queryExpression.Clauses)\n\t\t\t\t\tclause.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\t#region Query Clauses\n\n\t\t\tpublic override void VisitQueryContinuationClause (QueryContinuationClause queryContinuationClause)\n\t\t\t{\n\t\t\t\tqueryContinuationClause.PrecedingQuery.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryFromClause (QueryFromClause queryFromClause)\n\t\t\t{\n\t\t\t\tqueryFromClause.Expression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryJoinClause (QueryJoinClause queryJoinClause)\n\t\t\t{\n\t\t\t\tqueryJoinClause.InExpression.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryLetClause (QueryLetClause queryLetClause)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryWhereClause (QueryWhereClause queryWhereClause)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryOrderClause (QueryOrderClause queryOrderClause)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryOrdering (QueryOrdering queryOrdering)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitQuerySelectClause (QuerySelectClause querySelectClause)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitQueryGroupClause (QueryGroupClause queryGroupClause)\n\t\t\t{\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/WordParser.cs",
    "content": "// \n// WordParser.cs\n//  \n// Author:\n//       Michael Hutchinson <mhutch@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic static class WordParser\n\t{\n\t\tpublic static List<string> BreakWords (string identifier)\n\t\t{\n\t\t\tvar words = new List<string> ();\n\t\t\tint wordStart = 0;\n\t\t\tbool lastWasLower = false, lastWasUpper = false;\n\t\t\tfor (int i = 0; i < identifier.Length; i++) {\n\t\t\t\tchar c = identifier[i];\n\t\t\t\tvar category = char.GetUnicodeCategory (c);\n\t\t\t\tif (category == System.Globalization.UnicodeCategory.LowercaseLetter) {\n\t\t\t\t\tif (lastWasUpper && (i - wordStart) > 2) {\n\t\t\t\t\t\twords.Add (identifier.Substring (wordStart, i - wordStart - 1));\n\t\t\t\t\t\twordStart = i - 1;\n\t\t\t\t\t}\n\t\t\t\t\tlastWasLower = true;\n\t\t\t\t\tlastWasUpper = false;\n\t\t\t\t} else if (category == System.Globalization.UnicodeCategory.UppercaseLetter) {\n\t\t\t\t\tif (lastWasLower) {\n\t\t\t\t\t\twords.Add (identifier.Substring (wordStart, i - wordStart));\n\t\t\t\t\t\twordStart = i;\n\t\t\t\t\t}\n\t\t\t\t\tlastWasLower = false;\n\t\t\t\t\tlastWasUpper = true;\n\t\t\t\t} else {\n\t\t\t\t\tif (c == '_') {\n\t\t\t\t\t\tif ((i - wordStart) > 0)\n\t\t\t\t\t\t\twords.Add(identifier.Substring(wordStart, i - wordStart));\n\t\t\t\t\t\twordStart = i + 1;\n\t\t\t\t\t\tlastWasLower = lastWasUpper = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (wordStart < identifier.Length)\n\t\t\t\twords.Add (identifier.Substring (wordStart));\n\t\t\treturn words;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/AliasNamespaceResolveResult.cs",
    "content": "﻿//\n// AliasResolveResult.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents a namespace resolve result that's resolved using an alias.\n\t/// </summary>\n\tpublic class AliasNamespaceResolveResult : NamespaceResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// The alias used.\n\t\t/// </summary>\n\t\tpublic string Alias {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\tpublic AliasNamespaceResolveResult(string alias, NamespaceResolveResult underlyingResult) : base (underlyingResult.Namespace)\n\t\t{\n\t\t\tthis.Alias = alias;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/AliasTypeResolveResult.cs",
    "content": "﻿//\n// AliasTypeResolveResult.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents a type resolve result that's resolved using an alias.\n\t/// </summary>\n\tpublic class AliasTypeResolveResult : TypeResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// The alias used.\n\t\t/// </summary>\n\t\tpublic string Alias {\n\t\t\tget;\n\t\t\tprivate set;\n\t\t}\n\t\t\n\t\tpublic AliasTypeResolveResult(string alias, TypeResolveResult underlyingResult) : base (underlyingResult.Type)\n\t\t{\n\t\t\tthis.Alias = alias;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/AwaitResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents the result of an await expression.\n\t/// </summary>\n\tpublic class AwaitResolveResult : ResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// The method representing the GetAwaiter() call. Can be an <see cref=\"InvocationResolveResult\"/> or a <see cref=\"DynamicInvocationResolveResult\"/>.\n\t\t/// </summary>\n\t\tpublic readonly ResolveResult GetAwaiterInvocation;\n\n\t\t/// <summary>\n\t\t/// Awaiter type. Will not be null (but can be UnknownType).\n\t\t/// </summary>\n\t\tpublic readonly IType AwaiterType;\n\n\t\t/// <summary>\n\t\t/// Property representing the IsCompleted property on the awaiter type. Can be null if the awaiter type or the property was not found, or when awaiting a dynamic expression.\n\t\t/// </summary>\n\t\tpublic readonly IProperty IsCompletedProperty;\n\n\t\t/// <summary>\n\t\t/// Method representing the OnCompleted method on the awaiter type. Can be null if the awaiter type or the method was not found, or when awaiting a dynamic expression.\n\t\t/// This can also refer to an UnsafeOnCompleted method, if the awaiter type implements <c>System.Runtime.CompilerServices.ICriticalNotifyCompletion</c>.\n\t\t/// </summary>\n\t\tpublic readonly IMethod OnCompletedMethod;\n\t\t\n\t\t/// <summary>\n\t\t/// Method representing the GetResult method on the awaiter type. Can be null if the awaiter type or the method was not found, or when awaiting a dynamic expression.\n\t\t/// </summary>\n\t\tpublic readonly IMethod GetResultMethod;\n\n\t\tpublic AwaitResolveResult(IType resultType, ResolveResult getAwaiterInvocation, IType awaiterType, IProperty isCompletedProperty, IMethod onCompletedMethod, IMethod getResultMethod)\n\t\t\t: base(resultType)\n\t\t{\n\t\t\tif (awaiterType == null)\n\t\t\t\tthrow new ArgumentNullException(\"awaiterType\");\n\t\t\tif (getAwaiterInvocation == null)\n\t\t\t\tthrow new ArgumentNullException(\"getAwaiterInvocation\");\n\t\t\tthis.GetAwaiterInvocation = getAwaiterInvocation;\n\t\t\tthis.AwaiterType = awaiterType;\n\t\t\tthis.IsCompletedProperty = isCompletedProperty;\n\t\t\tthis.OnCompletedMethod = onCompletedMethod;\n\t\t\tthis.GetResultMethod = getResultMethod;\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return this.GetAwaiterInvocation.IsError || (AwaiterType.Kind != TypeKind.Dynamic && (this.IsCompletedProperty == null || this.OnCompletedMethod == null || this.GetResultMethod == null)); }\n\t\t}\n\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults() {\n\t\t\treturn new[] { GetAwaiterInvocation };\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpAstResolver.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Resolves C# AST nodes.\n\t/// </summary>\n\t/// <remarks>This class is thread-safe.</remarks>\n\tpublic class CSharpAstResolver\n\t{\n\t\treadonly CSharpResolver initialResolverState;\n\t\treadonly AstNode rootNode;\n\t\treadonly CSharpUnresolvedFile unresolvedFile;\n\t\treadonly ResolveVisitor resolveVisitor;\n\t\tbool resolverInitialized;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new C# AST resolver.\n\t\t/// Use this overload if you are resolving within a complete C# file.\n\t\t/// </summary>\n\t\t/// <param name=\"compilation\">The current compilation.</param>\n\t\t/// <param name=\"syntaxTree\">The syntax tree to be resolved.</param>\n\t\t/// <param name=\"unresolvedFile\">\n\t\t/// Optional: Result of <see cref=\"SyntaxTree.ToTypeSystem()\"/> for the file being resolved.\n\t\t/// <para>\n\t\t/// This is used for setting up the context on the resolver. The unresolved file must be registered in the compilation.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// When a unresolvedFile is specified, the resolver will use the member's StartLocation/EndLocation to identify\n\t\t/// member declarations in the AST with members in the type system.\n\t\t/// When no unresolvedFile is specified (<c>null</c> value for this parameter), the resolver will instead compare the\n\t\t/// member's signature in the AST with the signature in the type system.\n\t\t/// </para>\n\t\t/// </param>\n\t\tpublic CSharpAstResolver(ICompilation compilation, SyntaxTree syntaxTree, CSharpUnresolvedFile unresolvedFile = null)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (syntaxTree == null)\n\t\t\t\tthrow new ArgumentNullException(\"syntaxTree\");\n\t\t\tthis.initialResolverState = new CSharpResolver(compilation);\n\t\t\tthis.rootNode = syntaxTree;\n\t\t\tthis.unresolvedFile = unresolvedFile;\n\t\t\tthis.resolveVisitor = new ResolveVisitor(initialResolverState, unresolvedFile);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new C# AST resolver.\n\t\t/// Use this overload if you are resolving code snippets (not necessarily complete files).\n\t\t/// </summary>\n\t\t/// <param name=\"resolver\">The resolver state at the root node (to be more precise: just outside the root node).</param>\n\t\t/// <param name=\"rootNode\">The root node of the tree to be resolved.</param>\n\t\t/// <param name=\"unresolvedFile\">\n\t\t/// Optional: Result of <see cref=\"SyntaxTree.ToTypeSystem()\"/> for the file being resolved.\n\t\t/// <para>\n\t\t/// This is used for setting up the context on the resolver. The unresolved file must be registered in the compilation.\n\t\t/// </para>\n\t\t/// <para>\n\t\t/// When a unresolvedFile is specified, the resolver will use the member's StartLocation/EndLocation to identify\n\t\t/// member declarations in the AST with members in the type system.\n\t\t/// When no unresolvedFile is specified (<c>null</c> value for this parameter), the resolver will instead compare the\n\t\t/// member's signature in the AST with the signature in the type system.\n\t\t/// </para>\n\t\t/// </param>\n\t\tpublic CSharpAstResolver(CSharpResolver resolver, AstNode rootNode, CSharpUnresolvedFile unresolvedFile = null)\n\t\t{\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\tif (rootNode == null)\n\t\t\t\tthrow new ArgumentNullException(\"rootNode\");\n\t\t\tthis.initialResolverState = resolver;\n\t\t\tthis.rootNode = rootNode;\n\t\t\tthis.unresolvedFile = unresolvedFile;\n\t\t\tthis.resolveVisitor = new ResolveVisitor(initialResolverState, unresolvedFile);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type resolve context for the root resolver.\n\t\t/// </summary>\n\t\tpublic CSharpTypeResolveContext TypeResolveContext {\n\t\t\tget { return initialResolverState.CurrentTypeResolveContext; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the compilation for this resolver.\n\t\t/// </summary>\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return initialResolverState.Compilation; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the root node for which this CSharpAstResolver was created.\n\t\t/// </summary>\n\t\tpublic AstNode RootNode {\n\t\t\tget { return rootNode; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the unresolved file used by this CSharpAstResolver.\n\t\t/// Can return null.\n\t\t/// </summary>\n\t\tpublic CSharpUnresolvedFile UnresolvedFile {\n\t\t\tget { return unresolvedFile; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Applies a resolver navigator. This will resolve the nodes requested by the navigator, and will inform the\n\t\t/// navigator of the results.\n\t\t/// This method must be called as the first operation on the CSharpAstResolver, it is invalid to apply a navigator\n\t\t/// after a portion of the file was already resolved.\n\t\t/// </summary>\n\t\tpublic void ApplyNavigator(IResolveVisitorNavigator navigator, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (navigator == null)\n\t\t\t\tthrow new ArgumentNullException(\"navigator\");\n\t\t\t\n\t\t\tlock (resolveVisitor) {\n\t\t\t\tif (resolverInitialized)\n\t\t\t\t\tthrow new InvalidOperationException(\"Applying a navigator is only valid as the first operation on the CSharpAstResolver.\");\n\t\t\t\t\n\t\t\t\tresolverInitialized = true;\n\t\t\t\tresolveVisitor.cancellationToken = cancellationToken;\n\t\t\t\tresolveVisitor.SetNavigator(navigator);\n\t\t\t\ttry {\n\t\t\t\t\tresolveVisitor.Scan(rootNode);\n\t\t\t\t} finally {\n\t\t\t\t\tresolveVisitor.SetNavigator(null);\n\t\t\t\t\tresolveVisitor.cancellationToken = CancellationToken.None;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the specified node.\n\t\t/// </summary>\n\t\tpublic ResolveResult Resolve(AstNode node, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (node == null || node.IsNull || IsUnresolvableNode(node))\n\t\t\t\treturn ErrorResolveResult.UnknownError;\n\t\t\tlock (resolveVisitor) {\n\t\t\t\tInitResolver();\n\t\t\t\tresolveVisitor.cancellationToken = cancellationToken;\n\t\t\t\ttry {\n\t\t\t\t\tResolveResult rr = resolveVisitor.GetResolveResult(node);\n\t\t\t\t\tif (rr == null)\n\t\t\t\t\t\tDebug.Fail (node.GetType () + \" resolved to null.\", node.StartLocation + \":'\" + node.ToString () + \"'\");\n\t\t\t\t\treturn rr;\n\t\t\t\t} finally {\n\t\t\t\t\tresolveVisitor.cancellationToken = CancellationToken.None;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid InitResolver()\n\t\t{\n\t\t\tif (!resolverInitialized) {\n\t\t\t\tresolverInitialized = true;\n\t\t\t\tresolveVisitor.Scan(rootNode);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the resolver state immediately before the specified node.\n\t\t/// That is, if the node is a variable declaration, the returned state will not contain the newly declared variable.\n\t\t/// </summary>\n\t\tpublic CSharpResolver GetResolverStateBefore(AstNode node, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (node == null || node.IsNull)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\tlock (resolveVisitor) {\n\t\t\t\tInitResolver();\n\t\t\t\tresolveVisitor.cancellationToken = cancellationToken;\n\t\t\t\ttry {\n\t\t\t\t\tCSharpResolver resolver = resolveVisitor.GetResolverStateBefore(node);\n\t\t\t\t\tDebug.Assert(resolver != null);\n\t\t\t\t\treturn resolver;\n\t\t\t\t} finally {\n\t\t\t\t\tresolveVisitor.cancellationToken = CancellationToken.None;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the resolver state immediately after the specified node.\n\t\t/// That is, if the node is a variable declaration, the returned state will include the newly declared variable.\n\t\t/// </summary>\n\t\tpublic CSharpResolver GetResolverStateAfter(AstNode node, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (node == null || node.IsNull)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\twhile (node != null && IsUnresolvableNode(node))\n\t\t\t\tnode = node.Parent;\n\t\t\tif (node == null)\n\t\t\t\treturn initialResolverState;\n\t\t\tlock (resolveVisitor) {\n\t\t\t\tInitResolver();\n\t\t\t\tresolveVisitor.cancellationToken = cancellationToken;\n\t\t\t\ttry {\n\t\t\t\t\tCSharpResolver resolver = resolveVisitor.GetResolverStateAfter(node);\n\t\t\t\t\tDebug.Assert(resolver != null);\n\t\t\t\t\treturn resolver;\n\t\t\t\t} finally {\n\t\t\t\t\tresolveVisitor.cancellationToken = CancellationToken.None;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveVisitor.ConversionWithTargetType GetConversionWithTargetType(Expression expr, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (expr == null || expr.IsNull)\n\t\t\t\treturn new ResolveVisitor.ConversionWithTargetType(Conversion.None, SpecialType.UnknownType);\n\t\t\tlock (resolveVisitor) {\n\t\t\t\tInitResolver();\n\t\t\t\tresolveVisitor.cancellationToken = cancellationToken;\n\t\t\t\ttry {\n\t\t\t\t\treturn resolveVisitor.GetConversionWithTargetType(expr);\n\t\t\t\t} finally {\n\t\t\t\t\tresolveVisitor.cancellationToken = CancellationToken.None;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the expected type for the specified node. This is the type that a node is being converted to.\n\t\t/// </summary>\n\t\tpublic IType GetExpectedType(Expression expr, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\treturn GetConversionWithTargetType(expr, cancellationToken).TargetType;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the conversion that is being applied to the specified expression.\n\t\t/// </summary>\n\t\tpublic Conversion GetConversion(Expression expr, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\treturn GetConversionWithTargetType(expr, cancellationToken).Conversion;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the specified node is unresolvable.\n\t\t/// </summary>\n\t\tpublic static bool IsUnresolvableNode(AstNode node)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\tif (node.NodeType == NodeType.Token) {\n\t\t\t\t// Most tokens cannot be resolved, but there are a couple of special cases:\n\t\t\t\tif (node.Parent is QueryClause && node is Identifier) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (node.Role == Roles.Identifier) {\n\t\t\t\t\treturn !(node.Parent is ForeachStatement || node.Parent is CatchClause);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn (node.NodeType == NodeType.Whitespace || node is ArraySpecifier);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpConversions.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Contains logic that determines whether an implicit conversion exists between two types.\n\t/// </summary>\n\t/// <remarks>\n\t/// This class is thread-safe.\n\t/// </remarks>\n\tpublic sealed class CSharpConversions\n\t{\n\t\treadonly ConcurrentDictionary<TypePair, Conversion> implicitConversionCache = new ConcurrentDictionary<TypePair, Conversion>();\n\t\treadonly ICompilation compilation;\n\t\treadonly IType objectType;\n\t\t\n\t\tpublic CSharpConversions(ICompilation compilation)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.objectType = compilation.FindType(KnownTypeCode.Object);\n\t\t\tthis.dynamicErasure = new DynamicErasure(this);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the Conversions instance for the specified <see cref=\"ICompilation\"/>.\n\t\t/// This will make use of the context's cache manager to reuse the Conversions instance.\n\t\t/// </summary>\n\t\tpublic static CSharpConversions Get(ICompilation compilation)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tCacheManager cache = compilation.CacheManager;\n\t\t\tCSharpConversions operators = (CSharpConversions)cache.GetShared(typeof(CSharpConversions));\n\t\t\tif (operators == null) {\n\t\t\t\toperators = (CSharpConversions)cache.GetOrAddShared(typeof(CSharpConversions), new CSharpConversions(compilation));\n\t\t\t}\n\t\t\treturn operators;\n\t\t}\n\t\t\n\t\t#region TypePair (for caching)\n\t\tstruct TypePair : IEquatable<TypePair>\n\t\t{\n\t\t\tpublic readonly IType FromType;\n\t\t\tpublic readonly IType ToType;\n\t\t\t\n\t\t\tpublic TypePair(IType fromType, IType toType)\n\t\t\t{\n\t\t\t\tDebug.Assert(fromType != null && toType != null);\n\t\t\t\tthis.FromType = fromType;\n\t\t\t\tthis.ToType = toType;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\treturn (obj is TypePair) && Equals((TypePair)obj);\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool Equals(TypePair other)\n\t\t\t{\n\t\t\t\treturn object.Equals(this.FromType, other.FromType) && object.Equals(this.ToType, other.ToType);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\tunchecked {\n\t\t\t\t\treturn 1000000007 * FromType.GetHashCode() + 1000000009 * ToType.GetHashCode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ImplicitConversion\n\t\tprivate Conversion ImplicitConversion(ResolveResult resolveResult, IType toType, bool allowUserDefined)\n\t\t{\n\t\t\tConversion c;\n\t\t\tif (resolveResult.IsCompileTimeConstant) {\n\t\t\t\tc = ImplicitEnumerationConversion(resolveResult, toType);\n\t\t\t\tif (c.IsValid) return c;\n\t\t\t\tif (ImplicitConstantExpressionConversion(resolveResult, toType))\n\t\t\t\t\treturn Conversion.ImplicitConstantExpressionConversion;\n\t\t\t\tc = StandardImplicitConversion(resolveResult.Type, toType);\n\t\t\t\tif (c != Conversion.None) return c;\n\t\t\t\tif (allowUserDefined) {\n\t\t\t\t\tc = UserDefinedImplicitConversion(resolveResult, resolveResult.Type, toType);\n\t\t\t\t\tif (c != Conversion.None) return c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tc = ImplicitConversion(resolveResult.Type, toType, allowUserDefined);\n\t\t\t\tif (c != Conversion.None) return c;\n\t\t\t}\n\t\t\tif (resolveResult.Type.Kind == TypeKind.Dynamic)\n\t\t\t\treturn Conversion.ImplicitDynamicConversion;\n\t\t\tc = AnonymousFunctionConversion(resolveResult, toType);\n\t\t\tif (c != Conversion.None) return c;\n\t\t\tc = MethodGroupConversion(resolveResult, toType);\n\t\t\treturn c;\n\t\t}\n\t\t\n\t\tprivate Conversion ImplicitConversion(IType fromType, IType toType, bool allowUserDefined)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1\n\t\t\tvar c = StandardImplicitConversion(fromType, toType);\n\t\t\tif (c == Conversion.None && allowUserDefined) {\n\t\t\t\tc = UserDefinedImplicitConversion(null, fromType, toType);\n\t\t\t}\n\t\t\treturn c;\n\t\t}\n\n\t\tpublic Conversion ImplicitConversion(ResolveResult resolveResult, IType toType)\n\t\t{\n\t\t\tif (resolveResult == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolveResult\");\n\t\t\treturn ImplicitConversion(resolveResult, toType, allowUserDefined: true);\n\t\t}\n\n\t\tpublic Conversion ImplicitConversion(IType fromType, IType toType)\n\t\t{\n\t\t\tif (fromType == null)\n\t\t\t\tthrow new ArgumentNullException(\"fromType\");\n\t\t\tif (toType == null)\n\t\t\t\tthrow new ArgumentNullException(\"toType\");\n\t\t\t\n\t\t\tTypePair pair = new TypePair(fromType, toType);\n\t\t\tConversion c;\n\t\t\tif (implicitConversionCache.TryGetValue(pair, out c))\n\t\t\t\treturn c;\n\n\t\t\tc = ImplicitConversion(fromType, toType, allowUserDefined: true);\n\n\t\t\timplicitConversionCache[pair] = c;\n\t\t\treturn c;\n\t\t}\n\t\t\n\t\tpublic Conversion StandardImplicitConversion(IType fromType, IType toType)\n\t\t{\n\t\t\tif (fromType == null)\n\t\t\t\tthrow new ArgumentNullException(\"fromType\");\n\t\t\tif (toType == null)\n\t\t\t\tthrow new ArgumentNullException(\"toType\");\n\t\t\t// C# 4.0 spec: §6.3.1\n\t\t\tif (IdentityConversion(fromType, toType))\n\t\t\t\treturn Conversion.IdentityConversion;\n\t\t\tif (ImplicitNumericConversion(fromType, toType))\n\t\t\t\treturn Conversion.ImplicitNumericConversion;\n\t\t\tConversion c = ImplicitNullableConversion(fromType, toType);\n\t\t\tif (c != Conversion.None)\n\t\t\t\treturn c;\n\t\t\tif (NullLiteralConversion(fromType, toType))\n\t\t\t\treturn Conversion.NullLiteralConversion;\n\t\t\tif (ImplicitReferenceConversion(fromType, toType, 0))\n\t\t\t\treturn Conversion.ImplicitReferenceConversion;\n\t\t\tif (IsBoxingConversion(fromType, toType))\n\t\t\t\treturn Conversion.BoxingConversion;\n\t\t\tif (ImplicitTypeParameterConversion(fromType, toType)) {\n\t\t\t\t// Implicit type parameter conversions that aren't also\n\t\t\t\t// reference conversions are considered to be boxing conversions\n\t\t\t\treturn Conversion.BoxingConversion;\n\t\t\t}\n\t\t\tif (ImplicitPointerConversion(fromType, toType))\n\t\t\t\treturn Conversion.ImplicitPointerConversion;\n\t\t\treturn Conversion.None;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the type 'fromType' is convertible to 'toType'\n\t\t/// using one of the conversions allowed when satisying constraints (§4.4.4)\n\t\t/// </summary>\n\t\tpublic bool IsConstraintConvertible(IType fromType, IType toType)\n\t\t{\n\t\t\tif (fromType == null)\n\t\t\t\tthrow new ArgumentNullException(\"fromType\");\n\t\t\tif (toType == null)\n\t\t\t\tthrow new ArgumentNullException(\"toType\");\n\t\t\t\n\t\t\tif (IdentityConversion(fromType, toType))\n\t\t\t\treturn true;\n\t\t\tif (ImplicitReferenceConversion(fromType, toType, 0))\n\t\t\t\treturn true;\n\t\t\tif (NullableType.IsNullable(fromType)) {\n\t\t\t\t// An 'object' constraint still allows nullable value types\n\t\t\t\t// (object constraints don't exist in C#, but are inserted by DefaultResolvedTypeParameter.DirectBaseTypes)\n\t\t\t\tif (toType.IsKnownType(KnownTypeCode.Object))\n\t\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif (IsBoxingConversion(fromType, toType))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (ImplicitTypeParameterConversion(fromType, toType))\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ExplicitConversion\n\t\tpublic Conversion ExplicitConversion(ResolveResult resolveResult, IType toType)\n\t\t{\n\t\t\tif (resolveResult == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolveResult\");\n\t\t\tif (toType == null)\n\t\t\t\tthrow new ArgumentNullException(\"toType\");\n\t\t\t\n\t\t\tif (resolveResult.Type.Kind == TypeKind.Dynamic)\n\t\t\t\treturn Conversion.ExplicitDynamicConversion;\n\t\t\tConversion c = ImplicitConversion(resolveResult, toType, allowUserDefined: false);\n\t\t\tif (c != Conversion.None)\n\t\t\t\treturn c;\n\t\t\tc = ExplicitConversionImpl(resolveResult.Type, toType);\n\t\t\tif (c != Conversion.None)\n\t\t\t\treturn c;\n\t\t\treturn UserDefinedExplicitConversion(resolveResult, resolveResult.Type, toType);\n\t\t}\n\t\t\n\t\tpublic Conversion ExplicitConversion(IType fromType, IType toType)\n\t\t{\n\t\t\tif (fromType == null)\n\t\t\t\tthrow new ArgumentNullException(\"fromType\");\n\t\t\tif (toType == null)\n\t\t\t\tthrow new ArgumentNullException(\"toType\");\n\t\t\t\n\t\t\tConversion c = ImplicitConversion(fromType, toType, allowUserDefined: false);\n\t\t\tif (c != Conversion.None)\n\t\t\t\treturn c;\n\t\t\tc = ExplicitConversionImpl(fromType, toType);\n\t\t\tif (c != Conversion.None)\n\t\t\t\treturn c;\n\t\t\treturn UserDefinedExplicitConversion(null, fromType, toType);\n\t\t}\n\t\t\n\t\tConversion ExplicitConversionImpl(IType fromType, IType toType)\n\t\t{\n\t\t\t// This method is called after we already checked for implicit conversions,\n\t\t\t// so any remaining conversions must be explicit.\n\t\t\tif (AnyNumericConversion(fromType, toType))\n\t\t\t\treturn Conversion.ExplicitNumericConversion;\n\t\t\tif (ExplicitEnumerationConversion(fromType, toType))\n\t\t\t\treturn Conversion.EnumerationConversion(false, false);\n\t\t\tConversion c = ExplicitNullableConversion(fromType, toType);\n\t\t\tif (c != Conversion.None)\n\t\t\t\treturn c;\n\t\t\tif (ExplicitReferenceConversion(fromType, toType))\n\t\t\t\treturn Conversion.ExplicitReferenceConversion;\n\t\t\tif (UnboxingConversion(fromType, toType))\n\t\t\t\treturn Conversion.UnboxingConversion;\n\t\t\tc = ExplicitTypeParameterConversion(fromType, toType);\n\t\t\tif (c != Conversion.None)\n\t\t\t\treturn c;\n\t\t\tif (ExplicitPointerConversion(fromType, toType))\n\t\t\t\treturn Conversion.ExplicitPointerConversion;\n\t\t\treturn Conversion.None;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Identity Conversion\n\t\t/// <summary>\n\t\t/// Gets whether there is an identity conversion from <paramref name=\"fromType\"/> to <paramref name=\"toType\"/>\n\t\t/// </summary>\n\t\tpublic bool IdentityConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.1\n\t\t\treturn fromType.AcceptVisitor(dynamicErasure).Equals(toType.AcceptVisitor(dynamicErasure));\n\t\t}\n\t\t\n\t\treadonly DynamicErasure dynamicErasure;\n\t\t\n\t\tsealed class DynamicErasure : TypeVisitor\n\t\t{\n\t\t\treadonly IType objectType;\n\t\t\t\n\t\t\tpublic DynamicErasure(CSharpConversions conversions)\n\t\t\t{\n\t\t\t\tthis.objectType = conversions.objectType;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitOtherType(IType type)\n\t\t\t{\n\t\t\t\tif (type.Kind == TypeKind.Dynamic)\n\t\t\t\t\treturn objectType;\n\t\t\t\telse\n\t\t\t\t\treturn base.VisitOtherType(type);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Numeric Conversions\n\t\tstatic readonly bool[,] implicitNumericConversionLookup = {\n\t\t\t//       to:   short  ushort  int   uint   long   ulong\n\t\t\t// from:\n\t\t\t/* char   */ { false, true , true , true , true , true  },\n\t\t\t/* sbyte  */ { true , false, true , false, true , false },\n\t\t\t/* byte   */ { true , true , true , true , true , true  },\n\t\t\t/* short  */ { false, false, true , false, true , false },\n\t\t\t/* ushort */ { false, false, true , true , true , true  },\n\t\t\t/* int    */ { false, false, false, false, true , false },\n\t\t\t/* uint   */ { false, false, false, false, true , true  },\n\t\t};\n\t\t\n\t\tbool ImplicitNumericConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.2\n\t\t\t\n\t\t\tTypeCode from = ReflectionHelper.GetTypeCode(fromType);\n\t\t\tTypeCode to = ReflectionHelper.GetTypeCode(toType);\n\t\t\tif (to >= TypeCode.Single && to <= TypeCode.Decimal) {\n\t\t\t\t// Conversions to float/double/decimal exist from all integral types,\n\t\t\t\t// and there's a conversion from float to double.\n\t\t\t\treturn from >= TypeCode.Char && from <= TypeCode.UInt64\n\t\t\t\t\t|| from == TypeCode.Single && to == TypeCode.Double;\n\t\t\t} else {\n\t\t\t\t// Conversions to integral types: look at the table\n\t\t\t\treturn from >= TypeCode.Char && from <= TypeCode.UInt32\n\t\t\t\t\t&& to >= TypeCode.Int16 && to <= TypeCode.UInt64\n\t\t\t\t\t&& implicitNumericConversionLookup[from - TypeCode.Char, to - TypeCode.Int16];\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsNumericType(IType type)\n\t\t{\n\t\t\tTypeCode c = ReflectionHelper.GetTypeCode(type);\n\t\t\treturn c >= TypeCode.Char && c <= TypeCode.Decimal;\n\t\t}\n\t\t\n\t\tbool AnyNumericConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.2 + §6.2.1\n\t\t\treturn IsNumericType(fromType) && IsNumericType(toType);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Enumeration Conversions\n\t\tConversion ImplicitEnumerationConversion(ResolveResult rr, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.3\n\t\t\tDebug.Assert(rr.IsCompileTimeConstant);\n\t\t\tTypeCode constantType = ReflectionHelper.GetTypeCode(rr.Type);\n\t\t\tif (constantType >= TypeCode.SByte && constantType <= TypeCode.Decimal && Convert.ToDouble(rr.ConstantValue) == 0) {\n\t\t\t\tif (NullableType.GetUnderlyingType(toType).Kind == TypeKind.Enum) {\n\t\t\t\t\treturn Conversion.EnumerationConversion(true, NullableType.IsNullable(toType));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Conversion.None;\n\t\t}\n\t\t\n\t\tbool ExplicitEnumerationConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.2.2\n\t\t\tif (fromType.Kind == TypeKind.Enum) {\n\t\t\t\treturn toType.Kind == TypeKind.Enum || IsNumericType(toType);\n\t\t\t} else if (IsNumericType(fromType)) {\n\t\t\t\treturn toType.Kind == TypeKind.Enum;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Nullable Conversions\n\t\tConversion ImplicitNullableConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.4\n\t\t\tif (NullableType.IsNullable(toType)) {\n\t\t\t\tIType t = NullableType.GetUnderlyingType(toType);\n\t\t\t\tIType s = NullableType.GetUnderlyingType(fromType); // might or might not be nullable\n\t\t\t\tif (IdentityConversion(s, t))\n\t\t\t\t\treturn Conversion.ImplicitNullableConversion;\n\t\t\t\tif (ImplicitNumericConversion(s, t))\n\t\t\t\t\treturn Conversion.ImplicitLiftedNumericConversion;\n\t\t\t}\n\t\t\treturn Conversion.None;\n\t\t}\n\t\t\n\t\tConversion ExplicitNullableConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.4\n\t\t\tif (NullableType.IsNullable(toType) || NullableType.IsNullable(fromType)) {\n\t\t\t\tIType t = NullableType.GetUnderlyingType(toType);\n\t\t\t\tIType s = NullableType.GetUnderlyingType(fromType);\n\t\t\t\tif (IdentityConversion(s, t))\n\t\t\t\t\treturn Conversion.ExplicitNullableConversion;\n\t\t\t\tif (AnyNumericConversion(s, t))\n\t\t\t\t\treturn Conversion.ExplicitLiftedNumericConversion;\n\t\t\t\tif (ExplicitEnumerationConversion(s, t))\n\t\t\t\t\treturn Conversion.EnumerationConversion(false, true);\n\t\t\t}\n\t\t\treturn Conversion.None;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Null Literal Conversion\n\t\tbool NullLiteralConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.5\n\t\t\tif (fromType.Kind == TypeKind.Null) {\n\t\t\t\treturn NullableType.IsNullable(toType) || toType.IsReferenceType == true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Implicit Reference Conversion\n\t\tpublic bool IsImplicitReferenceConversion(IType fromType, IType toType)\n\t\t{\n\t\t\treturn ImplicitReferenceConversion(fromType, toType, 0);\n\t\t}\n\t\t\n\t\tbool ImplicitReferenceConversion(IType fromType, IType toType, int subtypeCheckNestingDepth)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.6\n\t\t\t\n\t\t\t// reference conversions are possible:\n\t\t\t// - if both types are known to be reference types\n\t\t\t// - if both types are type parameters and fromType has a class constraint\n\t\t\t//     (ImplicitTypeParameterConversionWithClassConstraintOnlyOnT)\n\t\t\tif (!(fromType.IsReferenceType == true && toType.IsReferenceType != false))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tArrayType fromArray = fromType as ArrayType;\n\t\t\tif (fromArray != null) {\n\t\t\t\tArrayType toArray = toType as ArrayType;\n\t\t\t\tif (toArray != null) {\n\t\t\t\t\t// array covariance (the broken kind)\n\t\t\t\t\treturn fromArray.Dimensions == toArray.Dimensions\n\t\t\t\t\t\t&& ImplicitReferenceConversion(fromArray.ElementType, toArray.ElementType, subtypeCheckNestingDepth);\n\t\t\t\t}\n\t\t\t\t// conversion from single-dimensional array S[] to IList<T>:\n\t\t\t\tIType toTypeArgument = UnpackGenericArrayInterface(toType);\n\t\t\t\tif (fromArray.Dimensions == 1 && toTypeArgument != null) {\n\t\t\t\t\t// array covariance plays a part here as well (string[] is IList<object>)\n\t\t\t\t\treturn IdentityConversion(fromArray.ElementType, toTypeArgument)\n\t\t\t\t\t\t|| ImplicitReferenceConversion(fromArray.ElementType, toTypeArgument, subtypeCheckNestingDepth);\n\t\t\t\t}\n\t\t\t\t// conversion from any array to System.Array and the interfaces it implements:\n\t\t\t\tIType systemArray = compilation.FindType(KnownTypeCode.Array);\n\t\t\t\treturn ImplicitReferenceConversion(systemArray, toType, subtypeCheckNestingDepth);\n\t\t\t}\n\t\t\t\n\t\t\t// now comes the hard part: traverse the inheritance chain and figure out generics+variance\n\t\t\treturn IsSubtypeOf(fromType, toType, subtypeCheckNestingDepth);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// For IList{T}, ICollection{T}, IEnumerable{T} and IReadOnlyList{T}, returns T.\n\t\t/// Otherwise, returns null.\n\t\t/// </summary>\n\t\tIType UnpackGenericArrayInterface(IType interfaceType)\n\t\t{\n\t\t\tParameterizedType pt = interfaceType as ParameterizedType;\n\t\t\tif (pt != null) {\n\t\t\t\tKnownTypeCode tc = pt.GetDefinition().KnownTypeCode;\n\t\t\t\tif (tc == KnownTypeCode.IListOfT || tc == KnownTypeCode.ICollectionOfT || tc == KnownTypeCode.IEnumerableOfT || tc == KnownTypeCode.IReadOnlyListOfT) {\n\t\t\t\t\treturn pt.GetTypeArgument(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Determines whether s is a subtype of t.\n\t\t// Helper method used for ImplicitReferenceConversion, BoxingConversion and ImplicitTypeParameterConversion\n\t\t\n\t\tbool IsSubtypeOf(IType s, IType t, int subtypeCheckNestingDepth)\n\t\t{\n\t\t\t// conversion to dynamic + object are always possible\n\t\t\tif (t.Kind == TypeKind.Dynamic || t.Equals(objectType))\n\t\t\t\treturn true;\n\t\t\tif (subtypeCheckNestingDepth > 10) {\n\t\t\t\t// Subtyping in C# is undecidable\n\t\t\t\t// (see \"On Decidability of Nominal Subtyping with Variance\" by Andrew J. Kennedy and Benjamin C. Pierce),\n\t\t\t\t// so we'll prevent infinite recursions by putting a limit on the nesting depth of variance conversions.\n\t\t\t\t\n\t\t\t\t// No real C# code should use generics nested more than 10 levels deep, and even if they do, most of\n\t\t\t\t// those nestings should not involve variance.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// let GetAllBaseTypes do the work for us\n\t\t\tforeach (IType baseType in s.GetAllBaseTypes()) {\n\t\t\t\tif (IdentityOrVarianceConversion(baseType, t, subtypeCheckNestingDepth + 1))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool IdentityOrVarianceConversion(IType s, IType t, int subtypeCheckNestingDepth)\n\t\t{\n\t\t\tITypeDefinition def = s.GetDefinition();\n\t\t\tif (def != null) {\n\t\t\t\tif (!def.Equals(t.GetDefinition()))\n\t\t\t\t\treturn false;\n\t\t\t\tParameterizedType ps = s as ParameterizedType;\n\t\t\t\tParameterizedType pt = t as ParameterizedType;\n\t\t\t\tif (ps != null && pt != null) {\n\t\t\t\t\t// C# 4.0 spec: §13.1.3.2 Variance Conversion\n\t\t\t\t\tfor (int i = 0; i < def.TypeParameters.Count; i++) {\n\t\t\t\t\t\tIType si = ps.GetTypeArgument(i);\n\t\t\t\t\t\tIType ti = pt.GetTypeArgument(i);\n\t\t\t\t\t\tif (IdentityConversion(si, ti))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tITypeParameter xi = def.TypeParameters[i];\n\t\t\t\t\t\tswitch (xi.Variance) {\n\t\t\t\t\t\t\tcase VarianceModifier.Covariant:\n\t\t\t\t\t\t\t\tif (!ImplicitReferenceConversion(si, ti, subtypeCheckNestingDepth))\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase VarianceModifier.Contravariant:\n\t\t\t\t\t\t\t\tif (!ImplicitReferenceConversion(ti, si, subtypeCheckNestingDepth))\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (ps != null || pt != null) {\n\t\t\t\t\treturn false; // only of of them is parameterized, or counts don't match? -> not valid conversion\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// not type definitions? we still need to check for equal types (e.g. s and t might be type parameters)\n\t\t\t\treturn s.Equals(t);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Explicit Reference Conversion\n\t\tbool ExplicitReferenceConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.2.4\n\t\t\t\n\t\t\t// test that the types are reference types:\n\t\t\tif (toType.IsReferenceType != true)\n\t\t\t\treturn false;\n\t\t\tif (fromType.IsReferenceType != true) {\n\t\t\t\t// special case:\n\t\t\t\t// converting from F to T is a reference conversion where T : class, F\n\t\t\t\t// (because F actually must be a reference type as well, even though C# doesn't treat it as one)\n\t\t\t\tif (fromType.Kind == TypeKind.TypeParameter)\n\t\t\t\t\treturn IsSubtypeOf(toType, fromType, 0);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif (toType.Kind == TypeKind.Array) {\n\t\t\t\tArrayType toArray = (ArrayType)toType;\n\t\t\t\tif (fromType.Kind == TypeKind.Array) {\n\t\t\t\t\t// Array covariance\n\t\t\t\t\tArrayType fromArray = (ArrayType)fromType;\n\t\t\t\t\tif (fromArray.Dimensions != toArray.Dimensions)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn ExplicitReferenceConversion(fromArray.ElementType, toArray.ElementType);\n\t\t\t\t}\n\t\t\t\tIType fromTypeArgument = UnpackGenericArrayInterface(fromType);\n\t\t\t\tif (fromTypeArgument != null && toArray.Dimensions == 1) {\n\t\t\t\t\treturn ExplicitReferenceConversion(fromTypeArgument, toArray.ElementType)\n\t\t\t\t\t\t|| IdentityConversion(fromTypeArgument, toArray.ElementType);\n\t\t\t\t}\n\t\t\t\t// Otherwise treat the array like a sealed class - require implicit conversion in the opposite direction\n\t\t\t\treturn IsImplicitReferenceConversion(toType, fromType);\n\t\t\t} else if (fromType.Kind == TypeKind.Array) {\n\t\t\t\tArrayType fromArray = (ArrayType)fromType;\n\t\t\t\tIType toTypeArgument = UnpackGenericArrayInterface(toType);\n\t\t\t\tif (toTypeArgument != null && fromArray.Dimensions == 1) {\n\t\t\t\t\treturn ExplicitReferenceConversion(fromArray.ElementType, toTypeArgument);\n\t\t\t\t}\n\t\t\t\t// Otherwise treat the array like a sealed class\n\t\t\t\treturn IsImplicitReferenceConversion(fromType, toType);\n\t\t\t} else if (fromType.Kind == TypeKind.Delegate && toType.Kind == TypeKind.Delegate) {\n\t\t\t\tITypeDefinition def = fromType.GetDefinition();\n\t\t\t\tif (def == null || !def.Equals(toType.GetDefinition()))\n\t\t\t\t\treturn false;\n\t\t\t\tParameterizedType ps = fromType as ParameterizedType;\n\t\t\t\tParameterizedType pt = toType as ParameterizedType;\n\t\t\t\tif (ps == null || pt == null) {\n\t\t\t\t\t// non-generic delegate - return true for the identity conversion\n\t\t\t\t\treturn ps == null && pt == null;\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < def.TypeParameters.Count; i++) {\n\t\t\t\t\tIType si = ps.GetTypeArgument(i);\n\t\t\t\t\tIType ti = pt.GetTypeArgument(i);\n\t\t\t\t\tif (IdentityConversion(si, ti))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tITypeParameter xi = def.TypeParameters[i];\n\t\t\t\t\tswitch (xi.Variance) {\n\t\t\t\t\t\tcase VarianceModifier.Covariant:\n\t\t\t\t\t\t\tif (!ExplicitReferenceConversion(si, ti))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase VarianceModifier.Contravariant:\n\t\t\t\t\t\t\tif (!(si.IsReferenceType == true && ti.IsReferenceType == true))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (IsSealedReferenceType(fromType)) {\n\t\t\t\t// If the source type is sealed, explicit conversions can't do anything more than implicit ones\n\t\t\t\treturn IsImplicitReferenceConversion(fromType, toType);\n\t\t\t} else if (IsSealedReferenceType(toType)) {\n\t\t\t\t// The the target type is sealed, there must be an implicit conversion in the opposite direction\n\t\t\t\treturn IsImplicitReferenceConversion(toType, fromType);\n\t\t\t} else {\n\t\t\t\tif (fromType.Kind == TypeKind.Interface || toType.Kind == TypeKind.Interface)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn IsImplicitReferenceConversion(toType, fromType)\n\t\t\t\t\t\t|| IsImplicitReferenceConversion(fromType, toType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsSealedReferenceType(IType type)\n\t\t{\n\t\t\tTypeKind kind = type.Kind;\n\t\t\treturn kind == TypeKind.Class && type.GetDefinition().IsSealed\n\t\t\t\t|| kind == TypeKind.Delegate || kind == TypeKind.Anonymous;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Boxing Conversions\n\t\tpublic bool IsBoxingConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.1.7\n\t\t\tfromType = NullableType.GetUnderlyingType(fromType);\n\t\t\tif (fromType.IsReferenceType == false && toType.IsReferenceType == true)\n\t\t\t\treturn IsSubtypeOf(fromType, toType, 0);\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool UnboxingConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §6.2.5\n\t\t\ttoType = NullableType.GetUnderlyingType(toType);\n\t\t\tif (fromType.IsReferenceType == true && toType.IsReferenceType == false)\n\t\t\t\treturn IsSubtypeOf(toType, fromType, 0);\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Implicit Constant-Expression Conversion\n\t\tbool ImplicitConstantExpressionConversion(ResolveResult rr, IType toType)\n\t\t{\n\t\t\tif (rr == null || !rr.IsCompileTimeConstant)\n\t\t\t\treturn false;\n\t\t\t// C# 4.0 spec: §6.1.9\n\t\t\tTypeCode fromTypeCode = ReflectionHelper.GetTypeCode(rr.Type);\n\t\t\tTypeCode toTypeCode = ReflectionHelper.GetTypeCode(NullableType.GetUnderlyingType(toType));\n\t\t\tif (fromTypeCode == TypeCode.Int64) {\n\t\t\t\tlong val = (long)rr.ConstantValue;\n\t\t\t\treturn val >= 0 && toTypeCode == TypeCode.UInt64;\n\t\t\t} else if (fromTypeCode == TypeCode.Int32) {\n\t\t\t\tobject cv = rr.ConstantValue;\n\t\t\t\tif (cv == null)\n\t\t\t\t\treturn false;\n\t\t\t\tint val = (int)cv;\n\t\t\t\tswitch (toTypeCode) {\n\t\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\t\treturn val >= SByte.MinValue && val <= SByte.MaxValue;\n\t\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\t\treturn val >= Byte.MinValue && val <= Byte.MaxValue;\n\t\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\t\treturn val >= Int16.MinValue && val <= Int16.MaxValue;\n\t\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\t\treturn val >= UInt16.MinValue && val <= UInt16.MaxValue;\n\t\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\t\t\treturn val >= 0;\n\t\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\t\t\treturn val >= 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Conversions involving type parameters\n\t\t/// <summary>\n\t\t/// Implicit conversions involving type parameters.\n\t\t/// </summary>\n\t\tbool ImplicitTypeParameterConversion(IType fromType, IType toType)\n\t\t{\n\t\t\tif (fromType.Kind != TypeKind.TypeParameter)\n\t\t\t\treturn false; // not a type parameter\n\t\t\tif (fromType.IsReferenceType == true)\n\t\t\t\treturn false; // already handled by ImplicitReferenceConversion\n\t\t\treturn IsSubtypeOf(fromType, toType, 0);\n\t\t}\n\t\t\n\t\tConversion ExplicitTypeParameterConversion(IType fromType, IType toType)\n\t\t{\n\t\t\tif (toType.Kind == TypeKind.TypeParameter) {\n\t\t\t\t// Explicit type parameter conversions that aren't also\n\t\t\t\t// reference conversions are considered to be unboxing conversions\n\t\t\t\tif (fromType.Kind == TypeKind.Interface || IsSubtypeOf(toType, fromType, 0))\n\t\t\t\t\treturn Conversion.UnboxingConversion;\n\t\t\t} else {\n\t\t\t\tif (fromType.Kind == TypeKind.TypeParameter && toType.Kind == TypeKind.Interface)\n\t\t\t\t\treturn Conversion.BoxingConversion;\n\t\t\t}\n\t\t\treturn Conversion.None;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Pointer Conversions\n\t\tbool ImplicitPointerConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §18.4 Pointer conversions\n\t\t\tif (fromType is PointerType && toType is PointerType && toType.ReflectionName == \"System.Void*\")\n\t\t\t\treturn true;\n\t\t\tif (fromType.Kind == TypeKind.Null && toType is PointerType)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool ExplicitPointerConversion(IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec: §18.4 Pointer conversions\n\t\t\tif (fromType.Kind == TypeKind.Pointer) {\n\t\t\t\treturn toType.Kind == TypeKind.Pointer || IsIntegerType(toType);\n\t\t\t} else {\n\t\t\t\treturn toType.Kind == TypeKind.Pointer && IsIntegerType(fromType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsIntegerType(IType type)\n\t\t{\n\t\t\tTypeCode c = ReflectionHelper.GetTypeCode(type);\n\t\t\treturn c >= TypeCode.SByte && c <= TypeCode.UInt64;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region User-Defined Conversions\n\t\t/// <summary>\n\t\t/// Gets whether type A is encompassed by type B.\n\t\t/// </summary>\n\t\tbool IsEncompassedBy(IType a, IType b)\n\t\t{\n\t\t\treturn a.Kind != TypeKind.Interface && b.Kind != TypeKind.Interface && StandardImplicitConversion(a, b).IsValid;\n\t\t}\n\t\t\n\t\tbool IsEncompassingOrEncompassedBy(IType a, IType b)\n\t\t{\n\t\t\treturn a.Kind != TypeKind.Interface && b.Kind != TypeKind.Interface\n\t\t\t\t&& (StandardImplicitConversion(a, b).IsValid || StandardImplicitConversion(b, a).IsValid);\n\t\t}\n\n\t\tIType FindMostEncompassedType(IEnumerable<IType> candidates)\n\t\t{\n\t\t\tIType best = null;\n\t\t\tforeach (var current in candidates) {\n\t\t\t\tif (best == null || IsEncompassedBy(current, best))\n\t\t\t\t\tbest = current;\n\t\t\t\telse if (!IsEncompassedBy(best, current))\n\t\t\t\t\treturn null;\t// Ambiguous\n\t\t\t}\n\t\t\treturn best;\n\t\t}\n\n\t\tIType FindMostEncompassingType(IEnumerable<IType> candidates)\n\t\t{\n\t\t\tIType best = null;\n\t\t\tforeach (var current in candidates) {\n\t\t\t\tif (best == null || IsEncompassedBy(best, current))\n\t\t\t\t\tbest = current;\n\t\t\t\telse if (!IsEncompassedBy(current, best))\n\t\t\t\t\treturn null;\t// Ambiguous\n\t\t\t}\n\t\t\treturn best;\n\t\t}\n\n\t\tConversion SelectOperator(IType mostSpecificSource, IType mostSpecificTarget, IList<OperatorInfo> operators, bool isImplicit, IType source, IType target)\n\t\t{\n\t\t\tvar selected = operators.Where(op => op.SourceType.Equals(mostSpecificSource) && op.TargetType.Equals(mostSpecificTarget)).ToList();\n\t\t\tif (selected.Count == 0)\n\t\t\t\treturn Conversion.None;\n\n\t\t\tif (selected.Count == 1)\n\t\t\t\treturn Conversion.UserDefinedConversion(selected[0].Method, isLifted: selected[0].IsLifted, isImplicit: isImplicit, conversionBeforeUserDefinedOperator: ExplicitConversion(source, mostSpecificSource), conversionAfterUserDefinedOperator: ExplicitConversion(mostSpecificTarget, target));\n\n\t\t\tint nNonLifted = selected.Count(s => !s.IsLifted);\n\t\t\tif (nNonLifted == 1) {\n\t\t\t\tvar op = selected.First(s => !s.IsLifted);\n\t\t\t\treturn Conversion.UserDefinedConversion(op.Method, isLifted: op.IsLifted, isImplicit: isImplicit, conversionBeforeUserDefinedOperator: ExplicitConversion(source, mostSpecificSource), conversionAfterUserDefinedOperator: ExplicitConversion(mostSpecificTarget, target));\n\t\t\t}\n\t\t\t\n\t\t\treturn Conversion.UserDefinedConversion(selected[0].Method, isLifted: selected[0].IsLifted, isImplicit: isImplicit, isAmbiguous: true, conversionBeforeUserDefinedOperator: ExplicitConversion(source, mostSpecificSource), conversionAfterUserDefinedOperator: ExplicitConversion(mostSpecificTarget, target));\n\t\t}\n\n\t\tConversion UserDefinedImplicitConversion(ResolveResult fromResult, IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec §6.4.4 User-defined implicit conversions\n\t\t\tvar operators = GetApplicableConversionOperators(fromResult, fromType, toType, false);\n\n\t\t\tif (operators.Count > 0) {\n\t\t\t\tvar mostSpecificSource = operators.Any(op => op.SourceType.Equals(fromType)) ? fromType : FindMostEncompassedType(operators.Select(op => op.SourceType));\n\t\t\t\tif (mostSpecificSource == null)\n\t\t\t\t\treturn Conversion.UserDefinedConversion(operators[0].Method, isImplicit: true, isLifted: operators[0].IsLifted, isAmbiguous: true, conversionBeforeUserDefinedOperator: Conversion.None, conversionAfterUserDefinedOperator: Conversion.None);\n\t\t\t\tvar mostSpecificTarget = operators.Any(op => op.TargetType.Equals(toType)) ? toType : FindMostEncompassingType(operators.Select(op => op.TargetType));\n\t\t\t\tif (mostSpecificTarget == null) {\n\t\t\t\t\tif (NullableType.IsNullable(toType))\n\t\t\t\t\t\treturn UserDefinedImplicitConversion(fromResult, fromType, NullableType.GetUnderlyingType(toType));\n\t\t\t\t\telse\n\t\t\t\t\t\treturn Conversion.UserDefinedConversion(operators[0].Method, isImplicit: true, isLifted: operators[0].IsLifted, isAmbiguous: true, conversionBeforeUserDefinedOperator: Conversion.None, conversionAfterUserDefinedOperator: Conversion.None);\n\t\t\t\t}\n\n\t\t\t\tvar selected = SelectOperator(mostSpecificSource, mostSpecificTarget, operators, true, fromType, toType);\n\t\t\t\tif (selected != Conversion.None) {\n\t\t\t\t\tif (selected.IsLifted && NullableType.IsNullable(toType)) {\n\t\t\t\t\t\t// Prefer A -> B -> B? over A -> A? -> B?\n\t\t\t\t\t\tvar other = UserDefinedImplicitConversion(fromResult, fromType, NullableType.GetUnderlyingType(toType));\n\t\t\t\t\t\tif (other != Conversion.None)\n\t\t\t\t\t\t\treturn other;\n\t\t\t\t\t}\n\t\t\t\t\treturn selected;\n\t\t\t\t}\n\t\t\t\telse if (NullableType.IsNullable(toType))\n\t\t\t\t\treturn UserDefinedImplicitConversion(fromResult, fromType, NullableType.GetUnderlyingType(toType));\n\t\t\t\telse\n\t\t\t\t\treturn Conversion.None;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn Conversion.None;\n\t\t\t}\n\t\t}\n\t\t\n\t\tConversion UserDefinedExplicitConversion(ResolveResult fromResult, IType fromType, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec §6.4.5 User-defined implicit conversions\n\t\t\tvar operators = GetApplicableConversionOperators(fromResult, fromType, toType, true);\n\t\t\tif (operators.Count > 0) {\n\t\t\t\tIType mostSpecificSource;\n\t\t\t\tif (operators.Any(op => op.SourceType.Equals(fromType))) {\n\t\t\t\t\tmostSpecificSource = fromType;\n\t\t\t\t} else {\n\t\t\t\t\tvar operatorsWithSourceEncompassingFromType = operators.Where(op => IsEncompassedBy(fromType, op.SourceType) || ImplicitConstantExpressionConversion(fromResult, NullableType.GetUnderlyingType(op.SourceType))).ToList();\n\t\t\t\t\tif (operatorsWithSourceEncompassingFromType.Any())\n\t\t\t\t\t\tmostSpecificSource = FindMostEncompassedType(operatorsWithSourceEncompassingFromType.Select(op => op.SourceType));\n\t\t\t\t\telse\n\t\t\t\t\t\tmostSpecificSource = FindMostEncompassingType(operators.Select(op => op.SourceType));\n\t\t\t\t}\n\t\t\t\tif (mostSpecificSource == null)\n\t\t\t\t\treturn Conversion.UserDefinedConversion(operators[0].Method, isImplicit: false, isLifted: operators[0].IsLifted, isAmbiguous: true, conversionBeforeUserDefinedOperator: Conversion.None, conversionAfterUserDefinedOperator: Conversion.None);\n\n\t\t\t\tIType mostSpecificTarget;\n\t\t\t\tif (operators.Any(op => op.TargetType.Equals(toType)))\n\t\t\t\t\tmostSpecificTarget = toType;\n\t\t\t\telse if (operators.Any(op => IsEncompassedBy(op.TargetType, toType)))\n\t\t\t\t\tmostSpecificTarget = FindMostEncompassingType(operators.Where(op => IsEncompassedBy(op.TargetType, toType)).Select(op => op.TargetType));\n\t\t\t\telse\n\t\t\t\t\tmostSpecificTarget = FindMostEncompassedType(operators.Select(op => op.TargetType));\n\t\t\t\tif (mostSpecificTarget == null) {\n\t\t\t\t\tif (NullableType.IsNullable(toType))\n\t\t\t\t\t\treturn UserDefinedExplicitConversion(fromResult, fromType, NullableType.GetUnderlyingType(toType));\n\t\t\t\t\telse\n\t\t\t\t\t\treturn Conversion.UserDefinedConversion(operators[0].Method, isImplicit: false, isLifted: operators[0].IsLifted, isAmbiguous: true, conversionBeforeUserDefinedOperator: Conversion.None, conversionAfterUserDefinedOperator: Conversion.None);\n\t\t\t\t}\n\n\t\t\t\tvar selected = SelectOperator(mostSpecificSource, mostSpecificTarget, operators, false, fromType, toType);\n\t\t\t\tif (selected != Conversion.None) {\n\t\t\t\t\tif (selected.IsLifted && NullableType.IsNullable(toType)) {\n\t\t\t\t\t\t// Prefer A -> B -> B? over A -> A? -> B?\n\t\t\t\t\t\tvar other = UserDefinedImplicitConversion(fromResult, fromType, NullableType.GetUnderlyingType(toType));\n\t\t\t\t\t\tif (other != Conversion.None)\n\t\t\t\t\t\t\treturn other;\n\t\t\t\t\t}\n\t\t\t\t\treturn selected;\n\t\t\t\t}\n\t\t\t\telse if (NullableType.IsNullable(toType))\n\t\t\t\t\treturn UserDefinedExplicitConversion(fromResult, fromType, NullableType.GetUnderlyingType(toType));\n\t\t\t\telse if (NullableType.IsNullable(fromType))\n\t\t\t\t\treturn UserDefinedExplicitConversion(null, NullableType.GetUnderlyingType(fromType), toType);\t// A? -> A -> B\n\t\t\t\telse\n\t\t\t\t\treturn Conversion.None;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn Conversion.None;\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass OperatorInfo\n\t\t{\n\t\t\tpublic readonly IMethod Method;\n\t\t\tpublic readonly IType SourceType;\n\t\t\tpublic readonly IType TargetType;\n\t\t\tpublic readonly bool IsLifted;\n\t\t\t\n\t\t\tpublic OperatorInfo(IMethod method, IType sourceType, IType targetType, bool isLifted)\n\t\t\t{\n\t\t\t\tthis.Method = method;\n\t\t\t\tthis.SourceType = sourceType;\n\t\t\t\tthis.TargetType = targetType;\n\t\t\t\tthis.IsLifted = isLifted;\n\t\t\t}\n\t\t}\n\t\t\n\t\tList<OperatorInfo> GetApplicableConversionOperators(ResolveResult fromResult, IType fromType, IType toType, bool isExplicit)\n\t\t{\n\t\t\t// Find the candidate operators:\n\t\t\tPredicate<IUnresolvedMethod> opFilter;\n\t\t\tif (isExplicit)\n\t\t\t\topFilter = m => m.IsStatic && m.IsOperator && (m.Name == \"op_Explicit\" || m.Name == \"op_Implicit\") && m.Parameters.Count == 1;\n\t\t\telse\n\t\t\t\topFilter = m => m.IsStatic && m.IsOperator && m.Name == \"op_Implicit\" && m.Parameters.Count == 1;\n\t\t\t\n\t\t\tvar operators = NullableType.GetUnderlyingType(fromType).GetMethods(opFilter)\n\t\t\t\t.Concat(NullableType.GetUnderlyingType(toType).GetMethods(opFilter)).Distinct();\n\t\t\t// Determine whether one of them is applicable:\n\t\t\tList<OperatorInfo> result = new List<OperatorInfo>();\n\t\t\tforeach (IMethod op in operators) {\n\t\t\t\tIType sourceType = op.Parameters[0].Type;\n\t\t\t\tIType targetType = op.ReturnType;\n\t\t\t\t// Try if the operator is applicable:\n\t\t\t\tbool isApplicable;\n\t\t\t\tif (isExplicit) {\n\t\t\t\t\tisApplicable = (IsEncompassingOrEncompassedBy(fromType, sourceType) || ImplicitConstantExpressionConversion(fromResult, sourceType))\n\t\t\t\t\t\t&& IsEncompassingOrEncompassedBy(targetType, toType);\n\t\t\t\t} else {\n\t\t\t\t\tisApplicable = (IsEncompassedBy(fromType, sourceType) || ImplicitConstantExpressionConversion(fromResult, sourceType))\n\t\t\t\t\t\t&& IsEncompassedBy(targetType, toType);\n\t\t\t\t}\n\t\t\t\t// Try if the operator is applicable in lifted form:\n\t\t\t\tif (isApplicable) {\n\t\t\t\t\tresult.Add(new OperatorInfo(op, sourceType, targetType, false));\n\t\t\t\t}\n\t\t\t\tif (NullableType.IsNonNullableValueType(sourceType)) {\n\t\t\t\t\t// An operator can be applicable in both lifted and non-lifted form in case of explicit conversions\n\t\t\t\t\tIType liftedSourceType = NullableType.Create(compilation, sourceType);\n\t\t\t\t\tIType liftedTargetType = NullableType.IsNonNullableValueType(targetType) ? NullableType.Create(compilation, targetType) : targetType;\n\t\t\t\t\tif (isExplicit) {\n\t\t\t\t\t\tisApplicable = IsEncompassingOrEncompassedBy(fromType, liftedSourceType)\n\t\t\t\t\t\t\t&& IsEncompassingOrEncompassedBy(liftedTargetType, toType);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisApplicable = IsEncompassedBy(fromType, liftedSourceType) && IsEncompassedBy(liftedTargetType, toType);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isApplicable) {\n\t\t\t\t\t\tresult.Add(new OperatorInfo(op, liftedSourceType, liftedTargetType, true));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region AnonymousFunctionConversion\n\t\tConversion AnonymousFunctionConversion(ResolveResult resolveResult, IType toType)\n\t\t{\n\t\t\t// C# 5.0 spec §6.5 Anonymous function conversions\n\t\t\tLambdaResolveResult f = resolveResult as LambdaResolveResult;\n\t\t\tif (f == null)\n\t\t\t\treturn Conversion.None;\n\t\t\tif (!f.IsAnonymousMethod) {\n\t\t\t\t// It's a lambda, so conversions to expression trees exist\n\t\t\t\t// (even if the conversion leads to a compile-time error, e.g. for statement lambdas)\n\t\t\t\ttoType = UnpackExpressionTreeType(toType);\n\t\t\t}\n\t\t\tIMethod d = toType.GetDelegateInvokeMethod();\n\t\t\tif (d == null)\n\t\t\t\treturn Conversion.None;\n\t\t\t\n\t\t\tIType[] dParamTypes = new IType[d.Parameters.Count];\n\t\t\tfor (int i = 0; i < dParamTypes.Length; i++) {\n\t\t\t\tdParamTypes[i] = d.Parameters[i].Type;\n\t\t\t}\n\t\t\tIType dReturnType = d.ReturnType;\n\t\t\t\n\t\t\tif (f.HasParameterList) {\n\t\t\t\t// If F contains an anonymous-function-signature, then D and F have the same number of parameters.\n\t\t\t\tif (d.Parameters.Count != f.Parameters.Count)\n\t\t\t\t\treturn Conversion.None;\n\t\t\t\t\n\t\t\t\tif (f.IsImplicitlyTyped) {\n\t\t\t\t\t// If F has an implicitly typed parameter list, D has no ref or out parameters.\n\t\t\t\t\tforeach (IParameter p in d.Parameters) {\n\t\t\t\t\t\tif (p.IsOut || p.IsRef)\n\t\t\t\t\t\t\treturn Conversion.None;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If F has an explicitly typed parameter list, each parameter in D has the same type\n\t\t\t\t\t// and modifiers as the corresponding parameter in F.\n\t\t\t\t\tfor (int i = 0; i < f.Parameters.Count; i++) {\n\t\t\t\t\t\tIParameter pD = d.Parameters[i];\n\t\t\t\t\t\tIParameter pF = f.Parameters[i];\n\t\t\t\t\t\tif (pD.IsRef != pF.IsRef || pD.IsOut != pF.IsOut)\n\t\t\t\t\t\t\treturn Conversion.None;\n\t\t\t\t\t\tif (!IdentityConversion(dParamTypes[i], pF.Type))\n\t\t\t\t\t\t\treturn Conversion.None;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If F does not contain an anonymous-function-signature, then D may have zero or more parameters of any\n\t\t\t\t// type, as long as no parameter of D has the out parameter modifier.\n\t\t\t\tforeach (IParameter p in d.Parameters) {\n\t\t\t\t\tif (p.IsOut)\n\t\t\t\t\t\treturn Conversion.None;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn f.IsValid(dParamTypes, dReturnType, this);\n\t\t}\n\n\t\tstatic IType UnpackExpressionTreeType(IType type)\n\t\t{\n\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\tif (pt != null && pt.TypeParameterCount == 1 && pt.Name == \"Expression\" && pt.Namespace == \"System.Linq.Expressions\") {\n\t\t\t\treturn pt.GetTypeArgument(0);\n\t\t\t} else {\n\t\t\t\treturn type;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MethodGroupConversion\n\t\tConversion MethodGroupConversion(ResolveResult resolveResult, IType toType)\n\t\t{\n\t\t\t// C# 4.0 spec §6.6 Method group conversions\n\t\t\tMethodGroupResolveResult rr = resolveResult as MethodGroupResolveResult;\n\t\t\tif (rr == null)\n\t\t\t\treturn Conversion.None;\n\t\t\tIMethod invoke = toType.GetDelegateInvokeMethod();\n\t\t\tif (invoke == null)\n\t\t\t\treturn Conversion.None;\n\t\t\t\n\t\t\tResolveResult[] args = new ResolveResult[invoke.Parameters.Count];\n\t\t\tfor (int i = 0; i < args.Length; i++) {\n\t\t\t\tIParameter param = invoke.Parameters[i];\n\t\t\t\tIType parameterType = param.Type;\n\t\t\t\tif ((param.IsRef || param.IsOut) && parameterType.Kind == TypeKind.ByReference) {\n\t\t\t\t\tparameterType = ((ByReferenceType)parameterType).ElementType;\n\t\t\t\t\targs[i] = new ByReferenceResolveResult(parameterType, param.IsOut);\n\t\t\t\t} else {\n\t\t\t\t\targs[i] = new ResolveResult(parameterType);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar or = rr.PerformOverloadResolution(compilation, args, allowExpandingParams: false, allowOptionalParameters: false, conversions: this);\n\t\t\tif (or.FoundApplicableCandidate) {\n\t\t\t\tIMethod method = (IMethod)or.GetBestCandidateWithSubstitutedTypeArguments();\n\t\t\t\tvar thisRR = rr.TargetResult as ThisResolveResult;\n\t\t\t\tbool isVirtual = method.IsOverridable && !(thisRR != null && thisRR.CausesNonVirtualInvocation);\n\t\t\t\tbool isValid = !or.IsAmbiguous && IsDelegateCompatible(method, invoke, or.IsExtensionMethodInvocation);\n\t\t\t\tbool delegateCapturesFirstArgument = or.IsExtensionMethodInvocation || !method.IsStatic;\n\t\t\t\tif (isValid)\n\t\t\t\t\treturn Conversion.MethodGroupConversion(method, isVirtual, delegateCapturesFirstArgument);\n\t\t\t\telse\n\t\t\t\t\treturn Conversion.InvalidMethodGroupConversion(method, isVirtual, delegateCapturesFirstArgument);\n\t\t\t} else {\n\t\t\t\treturn Conversion.None;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether a <paramref name=\"method\"/> is compatible with a delegate type.\n\t\t/// §15.2 Delegate compatibility\n\t\t/// </summary>\n\t\t/// <param name=\"method\">The method to test for compatibility</param>\n\t\t/// <param name=\"delegateType\">The delegate type</param>\n\t\tpublic bool IsDelegateCompatible(IMethod method, IType delegateType)\n\t\t{\n\t\t\tif (method == null)\n\t\t\t\tthrow new ArgumentNullException(\"method\");\n\t\t\tif (delegateType == null)\n\t\t\t\tthrow new ArgumentNullException(\"delegateType\");\n\t\t\tIMethod invoke = delegateType.GetDelegateInvokeMethod();\n\t\t\tif (invoke == null)\n\t\t\t\treturn false;\n\t\t\treturn IsDelegateCompatible(method, invoke, false);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether a method <paramref name=\"m\"/> is compatible with a delegate type.\n\t\t/// §15.2 Delegate compatibility\n\t\t/// </summary>\n\t\t/// <param name=\"m\">The method to test for compatibility</param>\n\t\t/// <param name=\"invoke\">The invoke method of the delegate</param>\n\t\t/// <param name=\"isExtensionMethodInvocation\">Gets whether m is accessed using extension method syntax.\n\t\t/// If this parameter is true, the first parameter of <paramref name=\"m\"/> will be ignored.</param>\n\t\tbool IsDelegateCompatible(IMethod m, IMethod invoke, bool isExtensionMethodInvocation)\n\t\t{\n\t\t\tif (m == null)\n\t\t\t\tthrow new ArgumentNullException(\"m\");\n\t\t\tif (invoke == null)\n\t\t\t\tthrow new ArgumentNullException(\"invoke\");\n\t\t\tint firstParameterInM = isExtensionMethodInvocation ? 1 : 0;\n\t\t\tif (m.Parameters.Count - firstParameterInM != invoke.Parameters.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < invoke.Parameters.Count; i++) {\n\t\t\t\tvar pm = m.Parameters[firstParameterInM + i];\n\t\t\t\tvar pd = invoke.Parameters[i];\n\t\t\t\t// ret/out must match\n\t\t\t\tif (pm.IsRef != pd.IsRef || pm.IsOut != pd.IsOut)\n\t\t\t\t\treturn false;\n\t\t\t\tif (pm.IsRef || pm.IsOut) {\n\t\t\t\t\t// ref/out parameters must have same types\n\t\t\t\t\tif (!pm.Type.Equals(pd.Type))\n\t\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t// non-ref/out parameters must have an identity or reference conversion from pd to pm\n\t\t\t\t\tif (!IdentityConversion(pd.Type, pm.Type) && !IsImplicitReferenceConversion(pd.Type, pm.Type))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check return type compatibility\n\t\t\treturn IdentityConversion(m.ReturnType, invoke.ReturnType)\n\t\t\t\t|| IsImplicitReferenceConversion(m.ReturnType, invoke.ReturnType);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region BetterConversion\n\t\t/// <summary>\n\t\t/// Gets the better conversion (C# 4.0 spec, §7.5.3.3)\n\t\t/// </summary>\n\t\t/// <returns>0 = neither is better; 1 = t1 is better; 2 = t2 is better</returns>\n\t\tpublic int BetterConversion(ResolveResult resolveResult, IType t1, IType t2)\n\t\t{\n\t\t\tLambdaResolveResult lambda = resolveResult as LambdaResolveResult;\n\t\t\tif (lambda != null) {\n\t\t\t\tif (!lambda.IsAnonymousMethod) {\n\t\t\t\t\tt1 = UnpackExpressionTreeType(t1);\n\t\t\t\t\tt2 = UnpackExpressionTreeType(t2);\n\t\t\t\t}\n\t\t\t\tIMethod m1 = t1.GetDelegateInvokeMethod();\n\t\t\t\tIMethod m2 = t2.GetDelegateInvokeMethod();\n\t\t\t\tif (m1 == null || m2 == null)\n\t\t\t\t\treturn 0;\n\t\t\t\tif (m1.Parameters.Count != m2.Parameters.Count)\n\t\t\t\t\treturn 0;\n\t\t\t\tIType[] parameterTypes = new IType[m1.Parameters.Count];\n\t\t\t\tfor (int i = 0; i < parameterTypes.Length; i++) {\n\t\t\t\t\tparameterTypes[i] = m1.Parameters[i].Type;\n\t\t\t\t\tif (!parameterTypes[i].Equals(m2.Parameters[i].Type))\n\t\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (lambda.HasParameterList && parameterTypes.Length != lambda.Parameters.Count)\n\t\t\t\t\treturn 0;\n\t\t\t\t\n\t\t\t\tIType ret1 = m1.ReturnType;\n\t\t\t\tIType ret2 = m2.ReturnType;\n\t\t\t\tif (ret1.Kind == TypeKind.Void && ret2.Kind != TypeKind.Void)\n\t\t\t\t\treturn 2;\n\t\t\t\tif (ret1.Kind != TypeKind.Void && ret2.Kind == TypeKind.Void)\n\t\t\t\t\treturn 1;\n\t\t\t\t\n\t\t\t\tIType inferredRet = lambda.GetInferredReturnType(parameterTypes);\n\t\t\t\tint r = BetterConversion(inferredRet, ret1, ret2);\n\t\t\t\tif (r == 0 && lambda.IsAsync) {\n\t\t\t\t\tret1 = UnpackTask(ret1);\n\t\t\t\t\tret2 = UnpackTask(ret2);\n\t\t\t\t\tinferredRet = UnpackTask(inferredRet);\n\t\t\t\t\tif (ret1 != null && ret2 != null && inferredRet != null)\n\t\t\t\t\t\tr = BetterConversion(inferredRet, ret1, ret2);\n\t\t\t\t}\n\t\t\t\treturn r;\n\t\t\t} else {\n\t\t\t\treturn BetterConversion(resolveResult.Type, t1, t2);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Unpacks the generic Task[T]. Returns null if the input is not Task[T].\n\t\t/// </summary>\n\t\tstatic IType UnpackTask(IType type)\n\t\t{\n\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\tif (pt != null && pt.TypeParameterCount == 1 && pt.Name == \"Task\" && pt.Namespace == \"System.Threading.Tasks\") {\n\t\t\t\treturn pt.GetTypeArgument(0);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the better conversion (C# 4.0 spec, §7.5.3.4)\n\t\t/// </summary>\n\t\t/// <returns>0 = neither is better; 1 = t1 is better; 2 = t2 is better</returns>\n\t\tpublic int BetterConversion(IType s, IType t1, IType t2)\n\t\t{\n\t\t\tbool ident1 = IdentityConversion(s, t1);\n\t\t\tbool ident2 = IdentityConversion(s, t2);\n\t\t\tif (ident1 && !ident2)\n\t\t\t\treturn 1;\n\t\t\tif (ident2 && !ident1)\n\t\t\t\treturn 2;\n\t\t\treturn BetterConversionTarget(t1, t2);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the better conversion target (C# 4.0 spec, §7.5.3.5)\n\t\t/// </summary>\n\t\t/// <returns>0 = neither is better; 1 = t1 is better; 2 = t2 is better</returns>\n\t\tint BetterConversionTarget(IType t1, IType t2)\n\t\t{\n\t\t\tbool t1To2 = ImplicitConversion(t1, t2).IsValid;\n\t\t\tbool t2To1 = ImplicitConversion(t2, t1).IsValid;\n\t\t\tif (t1To2 && !t2To1)\n\t\t\t\treturn 1;\n\t\t\tif (t2To1 && !t1To2)\n\t\t\t\treturn 2;\n\t\t\tTypeCode t1Code = ReflectionHelper.GetTypeCode(t1);\n\t\t\tTypeCode t2Code = ReflectionHelper.GetTypeCode(t2);\n\t\t\tif (IsBetterIntegralType(t1Code, t2Code))\n\t\t\t\treturn 1;\n\t\t\tif (IsBetterIntegralType(t2Code, t1Code))\n\t\t\t\treturn 2;\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tbool IsBetterIntegralType(TypeCode t1, TypeCode t2)\n\t\t{\n\t\t\t// signed types are better than unsigned types\n\t\t\tswitch (t1) {\n\t\t\t\tcase TypeCode.SByte:\n\t\t\t\t\treturn t2 == TypeCode.Byte || t2 == TypeCode.UInt16 || t2 == TypeCode.UInt32 || t2 == TypeCode.UInt64;\n\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\treturn t2 == TypeCode.UInt16 || t2 == TypeCode.UInt32 || t2 == TypeCode.UInt64;\n\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\treturn t2 == TypeCode.UInt32 || t2 == TypeCode.UInt64;\n\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\treturn t2 == TypeCode.UInt64;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpInvocationResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents the result of a method, constructor or indexer invocation.\n\t/// Provides additional C#-specific information for InvocationResolveResult.\n\t/// </summary>\n\tpublic class CSharpInvocationResolveResult : InvocationResolveResult\n\t{\n\t\tpublic readonly OverloadResolutionErrors OverloadResolutionErrors;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this invocation is calling an extension method using extension method syntax.\n\t\t/// </summary>\n\t\tpublic readonly bool IsExtensionMethodInvocation;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this invocation is calling a delegate (without explicitly calling \".Invoke()\").\n\t\t/// </summary>\n\t\tpublic readonly bool IsDelegateInvocation;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether a params-Array is being used in its expanded form.\n\t\t/// </summary>\n\t\tpublic readonly bool IsExpandedForm;\n\t\t\n\t\treadonly IList<int> argumentToParameterMap;\n\n\t\t/// <summary>\n\t\t/// If IsExtensionMethodInvocation is true this property holds the reduced method.\n\t\t/// </summary>\n\t\tIMethod reducedMethod;\n\t\tpublic IMethod ReducedMethod {\n\t\t\tget {\n\t\t\t\tif (!IsExtensionMethodInvocation)\n\t\t\t\t\treturn null;\n\t\t\t\tif (reducedMethod == null && Member is IMethod)\n\t\t\t\t\treducedMethod = new ReducedExtensionMethod ((IMethod)Member);\n\t\t\t\treturn reducedMethod;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpInvocationResolveResult(\n\t\t\tResolveResult targetResult, IParameterizedMember member,\n\t\t\tIList<ResolveResult> arguments,\n\t\t\tOverloadResolutionErrors overloadResolutionErrors = OverloadResolutionErrors.None,\n\t\t\tbool isExtensionMethodInvocation = false,\n\t\t\tbool isExpandedForm = false,\n\t\t\tbool isDelegateInvocation = false,\n\t\t\tIList<int> argumentToParameterMap = null,\n\t\t\tIList<ResolveResult> initializerStatements = null,\n\t\t\tIType returnTypeOverride = null\n\t\t)\n\t\t\t: base(targetResult, member, arguments, initializerStatements, returnTypeOverride)\n\t\t{\n\t\t\tthis.OverloadResolutionErrors = overloadResolutionErrors;\n\t\t\tthis.IsExtensionMethodInvocation = isExtensionMethodInvocation;\n\t\t\tthis.IsExpandedForm = isExpandedForm;\n\t\t\tthis.IsDelegateInvocation = isDelegateInvocation;\n\t\t\tthis.argumentToParameterMap = argumentToParameterMap;\n\t\t}\n\t\t\n\t\tpublic override bool IsError {\n\t\t\tget { return this.OverloadResolutionErrors != OverloadResolutionErrors.None; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets an array that maps argument indices to parameter indices.\n\t\t/// For arguments that could not be mapped to any parameter, the value will be -1.\n\t\t/// \n\t\t/// parameterIndex = ArgumentToParameterMap[argumentIndex]\n\t\t/// </summary>\n\t\tpublic IList<int> GetArgumentToParameterMap()\n\t\t{\n\t\t\treturn argumentToParameterMap;\n\t\t}\n\t\t\n\t\tpublic override IList<ResolveResult> GetArgumentsForCall()\n\t\t{\n\t\t\tResolveResult[] results = new ResolveResult[Member.Parameters.Count];\n\t\t\tList<ResolveResult> paramsArguments = IsExpandedForm ? new List<ResolveResult>() : null;\n\t\t\t// map arguments to parameters:\n\t\t\tfor (int i = 0; i < Arguments.Count; i++) {\n\t\t\t\tint mappedTo;\n\t\t\t\tif (argumentToParameterMap != null)\n\t\t\t\t\tmappedTo = argumentToParameterMap[i];\n\t\t\t\telse\n\t\t\t\t\tmappedTo = IsExpandedForm ? Math.Min(i, results.Length - 1) : i;\n\t\t\t\t\n\t\t\t\tif (mappedTo >= 0 && mappedTo < results.Length) {\n\t\t\t\t\tif (IsExpandedForm && mappedTo == results.Length - 1) {\n\t\t\t\t\t\tparamsArguments.Add(Arguments[i]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar narr = Arguments[i] as NamedArgumentResolveResult;\n\t\t\t\t\t\tif (narr != null)\n\t\t\t\t\t\t\tresults[mappedTo] = narr.Argument;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tresults[mappedTo] = Arguments[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (IsExpandedForm){\n\t\t\t\tIType arrayType = Member.Parameters.Last().Type;\n\t\t\t\tIType int32 = Member.Compilation.FindType(KnownTypeCode.Int32);\n\t\t\t\tResolveResult[] sizeArguments = { new ConstantResolveResult(int32, paramsArguments.Count) };\n\t\t\t\tresults[results.Length - 1] = new ArrayCreateResolveResult(arrayType, sizeArguments, paramsArguments);\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < results.Length; i++) {\n\t\t\t\tif (results[i] == null) {\n\t\t\t\t\tif (Member.Parameters[i].IsOptional) {\n\t\t\t\t\t\tresults[i] = new ConstantResolveResult(Member.Parameters[i].Type, Member.Parameters[i].ConstantValue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresults[i] = ErrorResolveResult.UnknownError;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn results;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpOperators.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\tsealed class CSharpOperators\n\t{\n\t\treadonly ICompilation compilation;\n\t\t\n\t\tprivate CSharpOperators(ICompilation compilation)\n\t\t{\n\t\t\tthis.compilation = compilation;\n\t\t\tInitParameterArrays();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the CSharpOperators instance for the specified <see cref=\"ICompilation\"/>.\n\t\t/// This will make use of the context's cache manager (if available) to reuse the CSharpOperators instance.\n\t\t/// </summary>\n\t\tpublic static CSharpOperators Get(ICompilation compilation)\n\t\t{\n\t\t\tCacheManager cache = compilation.CacheManager;\n\t\t\tCSharpOperators operators = (CSharpOperators)cache.GetShared(typeof(CSharpOperators));\n\t\t\tif (operators == null) {\n\t\t\t\toperators = (CSharpOperators)cache.GetOrAddShared(typeof(CSharpOperators), new CSharpOperators(compilation));\n\t\t\t}\n\t\t\treturn operators;\n\t\t}\n\t\t\n\t\t#region class OperatorMethod\n\t\tOperatorMethod[] Lift(params OperatorMethod[] methods)\n\t\t{\n\t\t\tList<OperatorMethod> result = new List<OperatorMethod>(methods);\n\t\t\tforeach (OperatorMethod method in methods) {\n\t\t\t\tOperatorMethod lifted = method.Lift(this);\n\t\t\t\tif (lifted != null)\n\t\t\t\t\tresult.Add(lifted);\n\t\t\t}\n\t\t\treturn result.ToArray();\n\t\t}\n\t\t\n\t\tIParameter[] normalParameters = new IParameter[(int)(TypeCode.String + 1 - TypeCode.Object)];\n\t\tIParameter[] nullableParameters = new IParameter[(int)(TypeCode.Decimal + 1 - TypeCode.Boolean)];\n\t\t\n\t\tvoid InitParameterArrays()\n\t\t{\n\t\t\tfor (TypeCode i = TypeCode.Object; i <= TypeCode.String; i++) {\n\t\t\t\tnormalParameters[i - TypeCode.Object] = new DefaultParameter(compilation.FindType(i), string.Empty);\n\t\t\t}\n\t\t\tfor (TypeCode i = TypeCode.Boolean; i <= TypeCode.Decimal; i++) {\n\t\t\t\tIType type = NullableType.Create(compilation, compilation.FindType(i));\n\t\t\t\tnullableParameters[i - TypeCode.Boolean] = new DefaultParameter(type, string.Empty);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIParameter MakeParameter(TypeCode code)\n\t\t{\n\t\t\treturn normalParameters[code - TypeCode.Object];\n\t\t}\n\t\t\n\t\tIParameter MakeNullableParameter(IParameter normalParameter)\n\t\t{\n\t\t\tfor (TypeCode i = TypeCode.Boolean; i <= TypeCode.Decimal; i++) {\n\t\t\t\tif (normalParameter == normalParameters[i - TypeCode.Object])\n\t\t\t\t\treturn nullableParameters[i - TypeCode.Boolean];\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\t\t\n\t\tinternal class OperatorMethod : IParameterizedMember\n\t\t{\n\t\t\treadonly ICompilation compilation;\n\t\t\treadonly IList<IParameter> parameters = new List<IParameter>();\n\t\t\t\n\t\t\tprotected OperatorMethod(ICompilation compilation)\n\t\t\t{\n\t\t\t\tthis.compilation = compilation;\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IParameter> Parameters {\n\t\t\t\tget { return parameters; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IType ReturnType { get; internal set; }\n\t\t\t\n\t\t\tpublic ICompilation Compilation {\n\t\t\t\tget { return compilation; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual OperatorMethod Lift(CSharpOperators operators)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tITypeDefinition IEntity.DeclaringTypeDefinition {\n\t\t\t\tget { return null; }\n\t\t\t}\n\t\t\t\n\t\t\tIType IEntity.DeclaringType {\n\t\t\t\tget { return SpecialType.UnknownType; }\n\t\t\t}\n\t\t\t\n\t\t\tIMember IMember.MemberDefinition {\n\t\t\t\tget { return this; }\n\t\t\t}\n\t\t\t\n\t\t\tIUnresolvedMember IMember.UnresolvedMember {\n\t\t\t\tget { return null; }\n\t\t\t}\n\t\t\t\n\t\t\tIList<IMember> IMember.ImplementedInterfaceMembers {\n\t\t\t\tget { return EmptyList<IMember>.Instance; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IMember.IsVirtual {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IMember.IsOverride {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IMember.IsOverridable {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tSymbolKind ISymbol.SymbolKind {\n\t\t\t\tget { return SymbolKind.Operator; }\n\t\t\t}\n\t\t\t\n\t\t\t[Obsolete(\"Use the SymbolKind property instead.\")]\n\t\t\tEntityType IEntity.EntityType {\n\t\t\t\tget { return EntityType.Operator; }\n\t\t\t}\n\t\t\t\n\t\t\tDomRegion IEntity.Region {\n\t\t\t\tget { return DomRegion.Empty; }\n\t\t\t}\n\t\t\t\n\t\t\tDomRegion IEntity.BodyRegion {\n\t\t\t\tget { return DomRegion.Empty; }\n\t\t\t}\n\t\t\t\n\t\t\tIList<IAttribute> IEntity.Attributes {\n\t\t\t\tget { return EmptyList<IAttribute>.Instance; }\n\t\t\t}\n\t\t\t\n\t\t\tDocumentation.DocumentationComment IEntity.Documentation {\n\t\t\t\tget { return null; }\n\t\t\t}\n\t\t\t\n\t\t\tAccessibility IHasAccessibility.Accessibility {\n\t\t\t\tget { return Accessibility.Public; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IEntity.IsStatic {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IEntity.IsAbstract {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IEntity.IsSealed {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IEntity.IsShadowing {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IEntity.IsSynthetic {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IHasAccessibility.IsPrivate {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IHasAccessibility.IsPublic {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IHasAccessibility.IsProtected {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IHasAccessibility.IsInternal {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IHasAccessibility.IsProtectedOrInternal {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IHasAccessibility.IsProtectedAndInternal {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tbool IMember.IsExplicitInterfaceImplementation {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tIAssembly IEntity.ParentAssembly {\n\t\t\t\tget { return compilation.MainAssembly; }\n\t\t\t}\n\t\t\t\n\t\t\tIMemberReference IMember.ToMemberReference()\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tISymbolReference ISymbol.ToReference()\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tIMemberReference IMember.ToReference()\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tTypeParameterSubstitution IMember.Substitution {\n\t\t\t\tget {\n\t\t\t\t\treturn TypeParameterSubstitution.Identity;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIMember IMember.Specialize(TypeParameterSubstitution substitution)\n\t\t\t{\n\t\t\t\tif (TypeParameterSubstitution.Identity.Equals(substitution))\n\t\t\t\t\treturn this;\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tstring INamedElement.FullName {\n\t\t\t\tget { return \"operator\"; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic string Name {\n\t\t\t\tget { return \"operator\"; }\n\t\t\t}\n\t\t\t\n\t\t\tstring INamedElement.Namespace {\n\t\t\t\tget { return string.Empty; }\n\t\t\t}\n\t\t\t\n\t\t\tstring INamedElement.ReflectionName {\n\t\t\t\tget { return \"operator\"; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tStringBuilder b = new StringBuilder();\n\t\t\t\tb.Append(ReturnType + \" operator(\");\n\t\t\t\tfor (int i = 0; i < parameters.Count; i++) {\n\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\tb.Append(\", \");\n\t\t\t\t\tb.Append(parameters[i].Type);\n\t\t\t\t}\n\t\t\t\tb.Append(')');\n\t\t\t\treturn b.ToString();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Unary operator class definitions\n\t\tinternal class UnaryOperatorMethod : OperatorMethod\n\t\t{\n\t\t\tpublic virtual bool CanEvaluateAtCompileTime { get { return false; } }\n\t\t\t\n\t\t\tpublic virtual object Invoke(CSharpResolver resolver, object input)\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic UnaryOperatorMethod(ICompilation compilaton) : base(compilaton)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class LambdaUnaryOperatorMethod<T> : UnaryOperatorMethod\n\t\t{\n\t\t\treadonly Func<T, T> func;\n\t\t\t\n\t\t\tpublic LambdaUnaryOperatorMethod(CSharpOperators operators, Func<T, T> func)\n\t\t\t\t: base(operators.compilation)\n\t\t\t{\n\t\t\t\tTypeCode typeCode = Type.GetTypeCode(typeof(T));\n\t\t\t\tthis.ReturnType = operators.compilation.FindType(typeCode);\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(typeCode));\n\t\t\t\tthis.func = func;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool CanEvaluateAtCompileTime {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object Invoke(CSharpResolver resolver, object input)\n\t\t\t{\n\t\t\t\tif (input == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn func((T)resolver.CSharpPrimitiveCast(Type.GetTypeCode(typeof(T)), input));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override OperatorMethod Lift(CSharpOperators operators)\n\t\t\t{\n\t\t\t\treturn new LiftedUnaryOperatorMethod(operators, this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class LiftedUnaryOperatorMethod : UnaryOperatorMethod, OverloadResolution.ILiftedOperator\n\t\t{\n\t\t\tUnaryOperatorMethod baseMethod;\n\t\t\t\n\t\t\tpublic LiftedUnaryOperatorMethod(CSharpOperators operators, UnaryOperatorMethod baseMethod) : base(operators.compilation)\n\t\t\t{\n\t\t\t\tthis.baseMethod = baseMethod;\n\t\t\t\tthis.ReturnType = NullableType.Create(baseMethod.Compilation, baseMethod.ReturnType);\n\t\t\t\tthis.Parameters.Add(operators.MakeNullableParameter(baseMethod.Parameters[0]));\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IParameter> NonLiftedParameters {\n\t\t\t\tget { return baseMethod.Parameters; }\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Unary operator definitions\n\t\t// C# 4.0 spec: §7.7.1 Unary plus operator\n\t\tOperatorMethod[] unaryPlusOperators;\n\t\t\n\t\tpublic OperatorMethod[] UnaryPlusOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref unaryPlusOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref unaryPlusOperators, Lift(\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<int>    (this, i => +i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<uint>   (this, i => +i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<long>   (this, i => +i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<ulong>  (this, i => +i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<float>  (this, i => +i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<double> (this, i => +i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<decimal>(this, i => +i)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.7.2 Unary minus operator\n\t\tOperatorMethod[] uncheckedUnaryMinusOperators;\n\t\t\n\t\tpublic OperatorMethod[] UncheckedUnaryMinusOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref uncheckedUnaryMinusOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref uncheckedUnaryMinusOperators, Lift(\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<int>    (this, i => unchecked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<long>   (this, i => unchecked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<float>  (this, i => unchecked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<double> (this, i => unchecked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<decimal>(this, i => unchecked(-i))\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] checkedUnaryMinusOperators;\n\t\t\n\t\tpublic OperatorMethod[] CheckedUnaryMinusOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref checkedUnaryMinusOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref checkedUnaryMinusOperators, Lift(\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<int>    (this, i => checked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<long>   (this, i => checked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<float>  (this, i => checked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<double> (this, i => checked(-i)),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<decimal>(this, i => checked(-i))\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.7.3 Logical negation operator\n\t\tOperatorMethod[] logicalNegationOperators;\n\t\t\n\t\tpublic OperatorMethod[] LogicalNegationOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref logicalNegationOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref logicalNegationOperators, Lift(\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<bool>(this, b => !b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.7.4 Bitwise complement operator\n\t\tOperatorMethod[] bitwiseComplementOperators;\n\t\t\n\t\tpublic OperatorMethod[] BitwiseComplementOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref bitwiseComplementOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref bitwiseComplementOperators, Lift(\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<int>  (this, i => ~i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<uint> (this, i => ~i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<long> (this, i => ~i),\n\t\t\t\t\t\tnew LambdaUnaryOperatorMethod<ulong>(this, i => ~i)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Binary operator class definitions\n\t\tinternal class BinaryOperatorMethod : OperatorMethod\n\t\t{\n\t\t\tpublic virtual bool CanEvaluateAtCompileTime { get { return false; } }\n\t\t\tpublic virtual object Invoke(CSharpResolver resolver, object lhs, object rhs) {\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic BinaryOperatorMethod(ICompilation compilation) : base(compilation) {}\n\t\t}\n\t\t\n\t\tsealed class LambdaBinaryOperatorMethod<T1, T2> : BinaryOperatorMethod\n\t\t{\n\t\t\treadonly Func<T1, T2, T1> checkedFunc;\n\t\t\treadonly Func<T1, T2, T1> uncheckedFunc;\n\t\t\t\n\t\t\tpublic LambdaBinaryOperatorMethod(CSharpOperators operators, Func<T1, T2, T1> func)\n\t\t\t\t: this(operators, func, func)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic LambdaBinaryOperatorMethod(CSharpOperators operators, Func<T1, T2, T1> checkedFunc, Func<T1, T2, T1> uncheckedFunc)\n\t\t\t\t: base(operators.compilation)\n\t\t\t{\n\t\t\t\tTypeCode t1 = Type.GetTypeCode(typeof(T1));\n\t\t\t\tthis.ReturnType = operators.compilation.FindType(t1);\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(t1));\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(Type.GetTypeCode(typeof(T2))));\n\t\t\t\tthis.checkedFunc = checkedFunc;\n\t\t\t\tthis.uncheckedFunc = uncheckedFunc;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool CanEvaluateAtCompileTime {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object Invoke(CSharpResolver resolver, object lhs, object rhs)\n\t\t\t{\n\t\t\t\tif (lhs == null || rhs == null)\n\t\t\t\t\treturn null;\n\t\t\t\tFunc<T1, T2, T1> func = resolver.CheckForOverflow ? checkedFunc : uncheckedFunc;\n\t\t\t\treturn func((T1)resolver.CSharpPrimitiveCast(Type.GetTypeCode(typeof(T1)), lhs),\n\t\t\t\t            (T2)resolver.CSharpPrimitiveCast(Type.GetTypeCode(typeof(T2)), rhs));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override OperatorMethod Lift(CSharpOperators operators)\n\t\t\t{\n\t\t\t\treturn new LiftedBinaryOperatorMethod(operators, this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class LiftedBinaryOperatorMethod : BinaryOperatorMethod, OverloadResolution.ILiftedOperator\n\t\t{\n\t\t\treadonly BinaryOperatorMethod baseMethod;\n\t\t\t\n\t\t\tpublic LiftedBinaryOperatorMethod(CSharpOperators operators, BinaryOperatorMethod baseMethod)\n\t\t\t\t: base(operators.compilation)\n\t\t\t{\n\t\t\t\tthis.baseMethod = baseMethod;\n\t\t\t\tthis.ReturnType = NullableType.Create(operators.compilation, baseMethod.ReturnType);\n\t\t\t\tthis.Parameters.Add(operators.MakeNullableParameter(baseMethod.Parameters[0]));\n\t\t\t\tthis.Parameters.Add(operators.MakeNullableParameter(baseMethod.Parameters[1]));\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IParameter> NonLiftedParameters {\n\t\t\t\tget { return baseMethod.Parameters; }\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Arithmetic operators\n\t\t// C# 4.0 spec: §7.8.1 Multiplication operator\n\t\t\n\t\tOperatorMethod[] multiplicationOperators;\n\t\t\n\t\tpublic OperatorMethod[] MultiplicationOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref multiplicationOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref multiplicationOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int,     int>    (this, (a, b) => checked(a * b), (a, b) => unchecked(a * b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint,    uint>   (this, (a, b) => checked(a * b), (a, b) => unchecked(a * b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long,    long>   (this, (a, b) => checked(a * b), (a, b) => unchecked(a * b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong,   ulong>  (this, (a, b) => checked(a * b), (a, b) => unchecked(a * b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<float,   float>  (this, (a, b) => checked(a * b), (a, b) => unchecked(a * b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<double,  double> (this, (a, b) => checked(a * b), (a, b) => unchecked(a * b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<decimal, decimal>(this, (a, b) => checked(a * b), (a, b) => unchecked(a * b))\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.8.2 Division operator\n\t\tOperatorMethod[] divisionOperators;\n\t\t\n\t\tpublic OperatorMethod[] DivisionOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref divisionOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref divisionOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int,     int>    (this, (a, b) => checked(a / b), (a, b) => unchecked(a / b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint,    uint>   (this, (a, b) => checked(a / b), (a, b) => unchecked(a / b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long,    long>   (this, (a, b) => checked(a / b), (a, b) => unchecked(a / b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong,   ulong>  (this, (a, b) => checked(a / b), (a, b) => unchecked(a / b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<float,   float>  (this, (a, b) => checked(a / b), (a, b) => unchecked(a / b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<double,  double> (this, (a, b) => checked(a / b), (a, b) => unchecked(a / b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<decimal, decimal>(this, (a, b) => checked(a / b), (a, b) => unchecked(a / b))\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.8.3 Remainder operator\n\t\tOperatorMethod[] remainderOperators;\n\t\t\n\t\tpublic OperatorMethod[] RemainderOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref remainderOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref remainderOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int,     int>    (this, (a, b) => checked(a % b), (a, b) => unchecked(a % b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint,    uint>   (this, (a, b) => checked(a % b), (a, b) => unchecked(a % b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long,    long>   (this, (a, b) => checked(a % b), (a, b) => unchecked(a % b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong,   ulong>  (this, (a, b) => checked(a % b), (a, b) => unchecked(a % b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<float,   float>  (this, (a, b) => checked(a % b), (a, b) => unchecked(a % b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<double,  double> (this, (a, b) => checked(a % b), (a, b) => unchecked(a % b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<decimal, decimal>(this, (a, b) => checked(a % b), (a, b) => unchecked(a % b))\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.8.3 Addition operator\n\t\tOperatorMethod[] additionOperators;\n\t\t\n\t\tpublic OperatorMethod[] AdditionOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref additionOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref additionOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int,     int>    (this, (a, b) => checked(a + b), (a, b) => unchecked(a + b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint,    uint>   (this, (a, b) => checked(a + b), (a, b) => unchecked(a + b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long,    long>   (this, (a, b) => checked(a + b), (a, b) => unchecked(a + b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong,   ulong>  (this, (a, b) => checked(a + b), (a, b) => unchecked(a + b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<float,   float>  (this, (a, b) => checked(a + b), (a, b) => unchecked(a + b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<double,  double> (this, (a, b) => checked(a + b), (a, b) => unchecked(a + b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<decimal, decimal>(this, (a, b) => checked(a + b), (a, b) => unchecked(a + b)),\n\t\t\t\t\t\tnew StringConcatenation(this, TypeCode.String, TypeCode.String),\n\t\t\t\t\t\tnew StringConcatenation(this, TypeCode.String, TypeCode.Object),\n\t\t\t\t\t\tnew StringConcatenation(this, TypeCode.Object, TypeCode.String)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// not in this list, but handled manually: enum addition, delegate combination\n\t\tsealed class StringConcatenation : BinaryOperatorMethod\n\t\t{\n\t\t\tbool canEvaluateAtCompileTime;\n\t\t\t\n\t\t\tpublic StringConcatenation(CSharpOperators operators, TypeCode p1, TypeCode p2)\n\t\t\t\t: base(operators.compilation)\n\t\t\t{\n\t\t\t\tthis.canEvaluateAtCompileTime = p1 == TypeCode.String && p2 == TypeCode.String;\n\t\t\t\tthis.ReturnType = operators.compilation.FindType(KnownTypeCode.String);\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(p1));\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(p2));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool CanEvaluateAtCompileTime {\n\t\t\t\tget { return canEvaluateAtCompileTime; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object Invoke(CSharpResolver resolver, object lhs, object rhs)\n\t\t\t{\n\t\t\t\treturn string.Concat(lhs, rhs);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.8.4 Subtraction operator\n\t\tOperatorMethod[] subtractionOperators;\n\t\t\n\t\tpublic OperatorMethod[] SubtractionOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref subtractionOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref subtractionOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int,     int>    (this, (a, b) => checked(a - b), (a, b) => unchecked(a - b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint,    uint>   (this, (a, b) => checked(a - b), (a, b) => unchecked(a - b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long,    long>   (this, (a, b) => checked(a - b), (a, b) => unchecked(a - b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong,   ulong>  (this, (a, b) => checked(a - b), (a, b) => unchecked(a - b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<float,   float>  (this, (a, b) => checked(a - b), (a, b) => unchecked(a - b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<double,  double> (this, (a, b) => checked(a - b), (a, b) => unchecked(a - b)),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<decimal, decimal>(this, (a, b) => checked(a - b), (a, b) => unchecked(a - b))\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.8.5 Shift operators\n\t\tOperatorMethod[] shiftLeftOperators;\n\t\t\n\t\tpublic OperatorMethod[] ShiftLeftOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref shiftLeftOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref shiftLeftOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int,   int>(this, (a, b) => a << b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint,  int>(this, (a, b) => a << b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long,  int>(this, (a, b) => a << b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong, int>(this, (a, b) => a << b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] shiftRightOperators;\n\t\t\n\t\tpublic OperatorMethod[] ShiftRightOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref shiftRightOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref shiftRightOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int,   int>(this, (a, b) => a >> b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint,  int>(this, (a, b) => a >> b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long,  int>(this, (a, b) => a >> b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong, int>(this, (a, b) => a >> b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Equality operators\n\t\tsealed class EqualityOperatorMethod : BinaryOperatorMethod\n\t\t{\n\t\t\tpublic readonly TypeCode Type;\n\t\t\tpublic readonly bool Negate;\n\t\t\t\n\t\t\tpublic EqualityOperatorMethod(CSharpOperators operators, TypeCode type, bool negate)\n\t\t\t\t: base(operators.compilation)\n\t\t\t{\n\t\t\t\tthis.Negate = negate;\n\t\t\t\tthis.Type = type;\n\t\t\t\tthis.ReturnType = operators.compilation.FindType(KnownTypeCode.Boolean);\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(type));\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(type));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool CanEvaluateAtCompileTime {\n\t\t\t\tget { return Type != TypeCode.Object; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object Invoke(CSharpResolver resolver, object lhs, object rhs)\n\t\t\t{\n\t\t\t\tif (lhs == null && rhs == null)\n\t\t\t\t\treturn !Negate; // ==: true; !=: false\n\t\t\t\tif (lhs == null || rhs == null)\n\t\t\t\t\treturn Negate; // ==: false; !=: true\n\t\t\t\tlhs = resolver.CSharpPrimitiveCast(Type, lhs);\n\t\t\t\trhs = resolver.CSharpPrimitiveCast(Type, rhs);\n\t\t\t\tbool equal;\n\t\t\t\tif (Type == TypeCode.Single) {\n\t\t\t\t\tequal = (float)lhs == (float)rhs;\n\t\t\t\t} else if (Type == TypeCode.Double) {\n\t\t\t\t\tequal = (double)lhs == (double)rhs;\n\t\t\t\t} else {\n\t\t\t\t\tequal = object.Equals(lhs, rhs);\n\t\t\t\t}\n\t\t\t\treturn equal ^ Negate;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override OperatorMethod Lift(CSharpOperators operators)\n\t\t\t{\n\t\t\t\tif (Type == TypeCode.Object || Type == TypeCode.String)\n\t\t\t\t\treturn null;\n\t\t\t\telse\n\t\t\t\t\treturn new LiftedEqualityOperatorMethod(operators, this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class LiftedEqualityOperatorMethod : BinaryOperatorMethod, OverloadResolution.ILiftedOperator\n\t\t{\n\t\t\treadonly EqualityOperatorMethod baseMethod;\n\t\t\t\n\t\t\tpublic LiftedEqualityOperatorMethod(CSharpOperators operators, EqualityOperatorMethod baseMethod)\n\t\t\t\t: base(operators.compilation)\n\t\t\t{\n\t\t\t\tthis.baseMethod = baseMethod;\n\t\t\t\tthis.ReturnType = baseMethod.ReturnType;\n\t\t\t\tIParameter p = operators.MakeNullableParameter(baseMethod.Parameters[0]);\n\t\t\t\tthis.Parameters.Add(p);\n\t\t\t\tthis.Parameters.Add(p);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool CanEvaluateAtCompileTime {\n\t\t\t\tget { return baseMethod.CanEvaluateAtCompileTime; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object Invoke(CSharpResolver resolver, object lhs, object rhs)\n\t\t\t{\n\t\t\t\treturn baseMethod.Invoke(resolver, lhs, rhs);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IParameter> NonLiftedParameters {\n\t\t\t\tget { return baseMethod.Parameters; }\n\t\t\t}\n\t\t}\n\t\t\n\t\t// C# 4.0 spec: §7.10 Relational and type-testing operators\n\t\tstatic readonly TypeCode[] valueEqualityOperatorsFor = {\n\t\t\tTypeCode.Int32, TypeCode.UInt32,\n\t\t\tTypeCode.Int64, TypeCode.UInt64,\n\t\t\tTypeCode.Single, TypeCode.Double,\n\t\t\tTypeCode.Decimal,\n\t\t\tTypeCode.Boolean\n\t\t};\n\t\t\n\t\tOperatorMethod[] valueEqualityOperators;\n\t\t\n\t\tpublic OperatorMethod[] ValueEqualityOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref valueEqualityOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref valueEqualityOperators, Lift(\n\t\t\t\t\t\tvalueEqualityOperatorsFor.Select(c => new EqualityOperatorMethod(this, c, false)).ToArray()\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] valueInequalityOperators;\n\t\t\n\t\tpublic OperatorMethod[] ValueInequalityOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref valueInequalityOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref valueInequalityOperators, Lift(\n\t\t\t\t\t\tvalueEqualityOperatorsFor.Select(c => new EqualityOperatorMethod(this, c, true)).ToArray()\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] referenceEqualityOperators;\n\t\t\n\t\tpublic OperatorMethod[] ReferenceEqualityOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref referenceEqualityOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref referenceEqualityOperators, Lift(\n\t\t\t\t\t\tnew EqualityOperatorMethod(this, TypeCode.Object, false),\n\t\t\t\t\t\tnew EqualityOperatorMethod(this, TypeCode.String, false)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] referenceInequalityOperators;\n\t\t\n\t\tpublic OperatorMethod[] ReferenceInequalityOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref referenceInequalityOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref referenceInequalityOperators, Lift(\n\t\t\t\t\t\tnew EqualityOperatorMethod(this, TypeCode.Object, true),\n\t\t\t\t\t\tnew EqualityOperatorMethod(this, TypeCode.String, true)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Relational Operators\n\t\tsealed class RelationalOperatorMethod<T1, T2> : BinaryOperatorMethod\n\t\t{\n\t\t\treadonly Func<T1, T2, bool> func;\n\t\t\t\n\t\t\tpublic RelationalOperatorMethod(CSharpOperators operators, Func<T1, T2, bool> func)\n\t\t\t\t: base(operators.compilation)\n\t\t\t{\n\t\t\t\tthis.ReturnType = operators.compilation.FindType(KnownTypeCode.Boolean);\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(Type.GetTypeCode(typeof(T1))));\n\t\t\t\tthis.Parameters.Add(operators.MakeParameter(Type.GetTypeCode(typeof(T2))));\n\t\t\t\tthis.func = func;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool CanEvaluateAtCompileTime {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object Invoke(CSharpResolver resolver, object lhs, object rhs)\n\t\t\t{\n\t\t\t\tif (lhs == null || rhs == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn func((T1)resolver.CSharpPrimitiveCast(Type.GetTypeCode(typeof(T1)), lhs),\n\t\t\t\t            (T2)resolver.CSharpPrimitiveCast(Type.GetTypeCode(typeof(T2)), rhs));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override OperatorMethod Lift(CSharpOperators operators)\n\t\t\t{\n\t\t\t\tvar lifted = new LiftedBinaryOperatorMethod(operators, this);\n\t\t\t\tlifted.ReturnType = this.ReturnType; // don't lift the return type for relational operators\n\t\t\t\treturn lifted;\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] lessThanOperators;\n\t\t\n\t\tpublic OperatorMethod[] LessThanOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref lessThanOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref lessThanOperators, Lift(\n\t\t\t\t\t\tnew RelationalOperatorMethod<int, int>        (this, (a, b) => a < b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<uint, uint>      (this, (a, b) => a < b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<long, long>      (this, (a, b) => a < b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<ulong, ulong>    (this, (a, b) => a < b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<float, float>    (this, (a, b) => a < b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<double, double>  (this, (a, b) => a < b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<decimal, decimal>(this, (a, b) => a < b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] lessThanOrEqualOperators;\n\t\t\n\t\tpublic OperatorMethod[] LessThanOrEqualOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref lessThanOrEqualOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref lessThanOrEqualOperators, Lift(\n\t\t\t\t\t\tnew RelationalOperatorMethod<int, int>        (this, (a, b) => a <= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<uint, uint>      (this, (a, b) => a <= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<long, long>      (this, (a, b) => a <= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<ulong, ulong>    (this, (a, b) => a <= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<float, float>    (this, (a, b) => a <= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<double, double>  (this, (a, b) => a <= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<decimal, decimal>(this, (a, b) => a <= b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] greaterThanOperators;\n\t\t\n\t\tpublic OperatorMethod[] GreaterThanOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref greaterThanOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref greaterThanOperators, Lift(\n\t\t\t\t\t\tnew RelationalOperatorMethod<int, int>        (this, (a, b) => a > b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<uint, uint>      (this, (a, b) => a > b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<long, long>      (this, (a, b) => a > b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<ulong, ulong>    (this, (a, b) => a > b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<float, float>    (this, (a, b) => a > b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<double, double>  (this, (a, b) => a > b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<decimal, decimal>(this, (a, b) => a > b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] greaterThanOrEqualOperators;\n\t\t\n\t\tpublic OperatorMethod[] GreaterThanOrEqualOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref greaterThanOrEqualOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref greaterThanOrEqualOperators, Lift(\n\t\t\t\t\t\tnew RelationalOperatorMethod<int, int>        (this, (a, b) => a >= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<uint, uint>      (this, (a, b) => a >= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<long, long>      (this, (a, b) => a >= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<ulong, ulong>    (this, (a, b) => a >= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<float, float>    (this, (a, b) => a >= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<double, double>  (this, (a, b) => a >= b),\n\t\t\t\t\t\tnew RelationalOperatorMethod<decimal, decimal>(this, (a, b) => a >= b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Bitwise operators\n\t\tOperatorMethod[] logicalAndOperators;\n\t\t\n\t\tpublic OperatorMethod[] LogicalAndOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref logicalAndOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref logicalAndOperators, new OperatorMethod[] {\n\t\t\t\t\t                         \tnew LambdaBinaryOperatorMethod<bool, bool>(this, (a, b) => a & b)\n\t\t\t\t\t                         });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tOperatorMethod[] bitwiseAndOperators;\n\t\t\n\t\tpublic OperatorMethod[] BitwiseAndOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref bitwiseAndOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref bitwiseAndOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int, int>    (this, (a, b) => a & b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint, uint>  (this, (a, b) => a & b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long, long>  (this, (a, b) => a & b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong, ulong>(this, (a, b) => a & b),\n\t\t\t\t\t\tthis.LogicalAndOperators[0]\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tOperatorMethod[] logicalOrOperators;\n\t\t\n\t\tpublic OperatorMethod[] LogicalOrOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref logicalOrOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref logicalOrOperators, new OperatorMethod[] {\n\t\t\t\t\t                         \tnew LambdaBinaryOperatorMethod<bool, bool>(this, (a, b) => a | b)\n\t\t\t\t\t                         });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorMethod[] bitwiseOrOperators;\n\t\t\n\t\tpublic OperatorMethod[] BitwiseOrOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref bitwiseOrOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref bitwiseOrOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int, int>    (this, (a, b) => a | b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint, uint>  (this, (a, b) => a | b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long, long>  (this, (a, b) => a | b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong, ulong>(this, (a, b) => a | b),\n\t\t\t\t\t\tthis.LogicalOrOperators[0]\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Note: the logic for the lifted bool? bitwise operators is wrong;\n\t\t// we produce \"true | null\" = \"null\" when it should be true. However, this is irrelevant\n\t\t// because bool? cannot be a compile-time type.\n\t\t\n\t\tOperatorMethod[] bitwiseXorOperators;\n\n\t\tpublic OperatorMethod[] BitwiseXorOperators {\n\t\t\tget {\n\t\t\t\tOperatorMethod[] ops = LazyInit.VolatileRead(ref bitwiseXorOperators);\n\t\t\t\tif (ops != null) {\n\t\t\t\t\treturn ops;\n\t\t\t\t} else {\n\t\t\t\t\treturn LazyInit.GetOrSet(ref bitwiseXorOperators, Lift(\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<int, int>    (this, (a, b) => a ^ b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<uint, uint>  (this, (a, b) => a ^ b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<long, long>  (this, (a, b) => a ^ b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<ulong, ulong>(this, (a, b) => a ^ b),\n\t\t\t\t\t\tnew LambdaBinaryOperatorMethod<bool, bool>  (this, (a, b) => a ^ b)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Contains the main resolver logic.\n\t/// </summary>\n\t/// <remarks>\n\t/// This class is thread-safe.\n\t/// </remarks>\n\tpublic class CSharpResolver : ICodeContext\n\t{\n\t\tstatic readonly ResolveResult ErrorResult = ErrorResolveResult.UnknownError;\n\t\treadonly ICompilation compilation;\n\t\tinternal readonly CSharpConversions conversions;\n\t\treadonly CSharpTypeResolveContext context;\n\t\treadonly bool checkForOverflow;\n\t\treadonly bool isWithinLambdaExpression;\n\t\t\n\t\t#region Constructor\n\t\tpublic CSharpResolver(ICompilation compilation)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.conversions = CSharpConversions.Get(compilation);\n\t\t\tthis.context = new CSharpTypeResolveContext(compilation.MainAssembly);\n\t\t\t\n\t\t\tvar pc = compilation.MainAssembly.UnresolvedAssembly as CSharpProjectContent;\n\t\t\tif (pc != null) {\n\t\t\t\tthis.checkForOverflow = pc.CompilerSettings.CheckForOverflow;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CSharpResolver(CSharpTypeResolveContext context)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tthis.compilation = context.Compilation;\n\t\t\tthis.conversions = CSharpConversions.Get(compilation);\n\t\t\tthis.context = context;\n\t\t\tif (context.CurrentTypeDefinition != null)\n\t\t\t\tcurrentTypeDefinitionCache = new TypeDefinitionCache(context.CurrentTypeDefinition);\n\t\t}\n\t\t\n\t\tprivate CSharpResolver(ICompilation compilation, CSharpConversions conversions, CSharpTypeResolveContext context, bool checkForOverflow, bool isWithinLambdaExpression, TypeDefinitionCache currentTypeDefinitionCache, ImmutableStack<IVariable> localVariableStack, ObjectInitializerContext objectInitializerStack)\n\t\t{\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.conversions = conversions;\n\t\t\tthis.context = context;\n\t\t\tthis.checkForOverflow = checkForOverflow;\n\t\t\tthis.isWithinLambdaExpression = isWithinLambdaExpression;\n\t\t\tthis.currentTypeDefinitionCache = currentTypeDefinitionCache;\n\t\t\tthis.localVariableStack = localVariableStack;\n\t\t\tthis.objectInitializerStack = objectInitializerStack;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Properties\n\t\t/// <summary>\n\t\t/// Gets the compilation used by the resolver.\n\t\t/// </summary>\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return compilation; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current type resolve context.\n\t\t/// </summary>\n\t\tpublic CSharpTypeResolveContext CurrentTypeResolveContext {\n\t\t\tget { return context; }\n\t\t}\n\n\t\tIAssembly ITypeResolveContext.CurrentAssembly {\n\t\t\tget { return context.CurrentAssembly; }\n\t\t}\n\t\t\n\t\tCSharpResolver WithContext(CSharpTypeResolveContext newContext)\n\t\t{\n\t\t\treturn new CSharpResolver(compilation, conversions, newContext, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, localVariableStack, objectInitializerStack);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the current context is <c>checked</c>.\n\t\t/// </summary>\n\t\tpublic bool CheckForOverflow {\n\t\t\tget { return checkForOverflow; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets whether the current context is <c>checked</c>.\n\t\t/// </summary>\n\t\tpublic CSharpResolver WithCheckForOverflow(bool checkForOverflow)\n\t\t{\n\t\t\tif (checkForOverflow == this.checkForOverflow)\n\t\t\t\treturn this;\n\t\t\treturn new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, localVariableStack, objectInitializerStack);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the resolver is currently within a lambda expression or anonymous method.\n\t\t/// </summary>\n\t\tpublic bool IsWithinLambdaExpression {\n\t\t\tget { return isWithinLambdaExpression; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets whether the resolver is currently within a lambda expression.\n\t\t/// </summary>\n\t\tpublic CSharpResolver WithIsWithinLambdaExpression(bool isWithinLambdaExpression)\n\t\t{\n\t\t\treturn new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, localVariableStack, objectInitializerStack);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current member definition that is used to look up identifiers as parameters\n\t\t/// or type parameters.\n\t\t/// </summary>\n\t\tpublic IMember CurrentMember {\n\t\t\tget { return context.CurrentMember; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets the current member definition.\n\t\t/// </summary>\n\t\t/// <remarks>Don't forget to also set CurrentTypeDefinition when setting CurrentMember;\n\t\t/// setting one of the properties does not automatically set the other.</remarks>\n\t\tpublic CSharpResolver WithCurrentMember(IMember member)\n\t\t{\n\t\t\treturn WithContext(context.WithCurrentMember(member));\n\t\t}\n\t\t\n\t\tITypeResolveContext ITypeResolveContext.WithCurrentMember(IMember member)\n\t\t{\n\t\t\treturn WithCurrentMember(member);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current using scope that is used to look up identifiers as class names.\n\t\t/// </summary>\n\t\tpublic ResolvedUsingScope CurrentUsingScope {\n\t\t\tget { return context.CurrentUsingScope; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets the current using scope that is used to look up identifiers as class names.\n\t\t/// </summary>\n\t\tpublic CSharpResolver WithCurrentUsingScope(ResolvedUsingScope usingScope)\n\t\t{\n\t\t\treturn WithContext(context.WithUsingScope(usingScope));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Per-CurrentTypeDefinition Cache\n\t\treadonly TypeDefinitionCache currentTypeDefinitionCache;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current type definition.\n\t\t/// </summary>\n\t\tpublic ITypeDefinition CurrentTypeDefinition {\n\t\t\tget { return context.CurrentTypeDefinition; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets the current type definition.\n\t\t/// </summary>\n\t\tpublic CSharpResolver WithCurrentTypeDefinition(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (this.CurrentTypeDefinition == typeDefinition)\n\t\t\t\treturn this;\n\t\t\t\n\t\t\tTypeDefinitionCache newTypeDefinitionCache;\n\t\t\tif (typeDefinition != null)\n\t\t\t\tnewTypeDefinitionCache = new TypeDefinitionCache(typeDefinition);\n\t\t\telse\n\t\t\t\tnewTypeDefinitionCache = null;\n\t\t\t\n\t\t\treturn new CSharpResolver(compilation, conversions, context.WithCurrentTypeDefinition(typeDefinition),\n\t\t\t                          checkForOverflow, isWithinLambdaExpression, newTypeDefinitionCache, localVariableStack, objectInitializerStack);\n\t\t}\n\t\t\n\t\tITypeResolveContext ITypeResolveContext.WithCurrentTypeDefinition(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\treturn WithCurrentTypeDefinition(typeDefinition);\n\t\t}\n\t\t\n\t\tsealed class TypeDefinitionCache\n\t\t{\n\t\t\tpublic readonly ITypeDefinition TypeDefinition;\n\t\t\tpublic readonly Dictionary<string, ResolveResult> SimpleNameLookupCacheExpression = new Dictionary<string, ResolveResult>();\n\t\t\tpublic readonly Dictionary<string, ResolveResult> SimpleNameLookupCacheInvocationTarget = new Dictionary<string, ResolveResult>();\n\t\t\tpublic readonly Dictionary<string, ResolveResult> SimpleTypeLookupCache = new Dictionary<string, ResolveResult>();\n\t\t\t\n\t\t\tpublic TypeDefinitionCache(ITypeDefinition typeDefinition)\n\t\t\t{\n\t\t\t\tthis.TypeDefinition = typeDefinition;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Local Variable Management\n\t\t\n\t\t// We store the local variables in an immutable stack.\n\t\t// The beginning of a block is marked by a null entry.\n\t\t\n\t\t// This data structure is used to allow efficient cloning of the resolver with its local variable context.\n\t\treadonly ImmutableStack<IVariable> localVariableStack = ImmutableStack<IVariable>.Empty;\n\t\t\n\t\tCSharpResolver WithLocalVariableStack(ImmutableStack<IVariable> stack)\n\t\t{\n\t\t\treturn new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, stack, objectInitializerStack);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Opens a new scope for local variables.\n\t\t/// </summary>\n\t\tpublic CSharpResolver PushBlock()\n\t\t{\n\t\t\treturn WithLocalVariableStack(localVariableStack.Push(null));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Closes the current scope for local variables; removing all variables in that scope.\n\t\t/// </summary>\n\t\tpublic CSharpResolver PopBlock()\n\t\t{\n\t\t\tvar stack = localVariableStack;\n\t\t\tIVariable removedVar;\n\t\t\tdo {\n\t\t\t\tremovedVar = stack.Peek();\n\t\t\t\tstack = stack.Pop();\n\t\t\t} while (removedVar != null);\n\t\t\treturn WithLocalVariableStack(stack);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds a new variable or lambda parameter to the current block.\n\t\t/// </summary>\n\t\tpublic CSharpResolver AddVariable(IVariable variable)\n\t\t{\n\t\t\tif (variable == null)\n\t\t\t\tthrow new ArgumentNullException(\"variable\");\n\t\t\treturn WithLocalVariableStack(localVariableStack.Push(variable));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Removes the variable that was just added.\n\t\t/// </summary>\n\t\tpublic CSharpResolver PopLastVariable()\n\t\t{\n\t\t\tif (localVariableStack.Peek() == null)\n\t\t\t\tthrow new InvalidOperationException(\"There is no variable within the current block.\");\n\t\t\treturn WithLocalVariableStack(localVariableStack.Pop());\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all currently visible local variables and lambda parameters.\n\t\t/// Does not include method parameters.\n\t\t/// </summary>\n\t\tpublic IEnumerable<IVariable> LocalVariables {\n\t\t\tget {\n\t\t\t\treturn localVariableStack.Where(v => v != null);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Object Initializer Context\n\t\tsealed class ObjectInitializerContext\n\t\t{\n\t\t\tinternal readonly ResolveResult initializedObject;\n\t\t\tinternal readonly ObjectInitializerContext prev;\n\t\t\t\n\t\t\tpublic ObjectInitializerContext(ResolveResult initializedObject, CSharpResolver.ObjectInitializerContext prev)\n\t\t\t{\n\t\t\t\tthis.initializedObject = initializedObject;\n\t\t\t\tthis.prev = prev;\n\t\t\t}\n\t\t}\n\t\t\n\t\treadonly ObjectInitializerContext objectInitializerStack;\n\t\t\n\t\tCSharpResolver WithObjectInitializerStack(ObjectInitializerContext stack)\n\t\t{\n\t\t\treturn new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, localVariableStack, stack);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Pushes the type of the object that is currently being initialized.\n\t\t/// </summary>\n\t\tpublic CSharpResolver PushObjectInitializer(ResolveResult initializedObject)\n\t\t{\n\t\t\tif (initializedObject == null)\n\t\t\t\tthrow new ArgumentNullException(\"initializedObject\");\n\t\t\treturn WithObjectInitializerStack(new ObjectInitializerContext(initializedObject, objectInitializerStack));\n\t\t}\n\t\t\n\t\tpublic CSharpResolver PopObjectInitializer()\n\t\t{\n\t\t\tif (objectInitializerStack == null)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\treturn WithObjectInitializerStack(objectInitializerStack.prev);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this context is within an object initializer.\n\t\t/// </summary>\n\t\tpublic bool IsInObjectInitializer {\n\t\t\tget { return objectInitializerStack != null; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the current object initializer. This usually is an <see cref=\"InitializedObjectResolveResult\"/>\n\t\t/// or (for nested initializers) a semantic tree based on an <see cref=\"InitializedObjectResolveResult\"/>.\n\t\t/// Returns ErrorResolveResult if there is no object initializer.\n\t\t/// </summary>\n\t\tpublic ResolveResult CurrentObjectInitializer {\n\t\t\tget {\n\t\t\t\treturn objectInitializerStack != null ? objectInitializerStack.initializedObject : ErrorResult;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type of the object currently being initialized.\n\t\t/// Returns SharedTypes.Unknown if no object initializer is currently open (or if the object initializer\n\t\t/// has unknown type).\n\t\t/// </summary>\n\t\tpublic IType CurrentObjectInitializerType {\n\t\t\tget { return CurrentObjectInitializer.Type; }\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Clone\n\t\t/// <summary>\n\t\t/// Creates a copy of this CSharp resolver.\n\t\t/// </summary>\n\t\t[Obsolete(\"CSharpResolver is immutable, cloning is no longer necessary\")]\n\t\tpublic CSharpResolver Clone()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveUnaryOperator\n\t\t#region ResolveUnaryOperator method\n\t\tpublic ResolveResult ResolveUnaryOperator(UnaryOperatorType op, ResolveResult expression)\n\t\t{\n\t\t\tif (expression.Type.Kind == TypeKind.Dynamic) {\n\t\t\t\tif (op == UnaryOperatorType.Await) {\n\t\t\t\t\treturn new AwaitResolveResult(SpecialType.Dynamic, new DynamicInvocationResolveResult(new DynamicMemberResolveResult(expression, \"GetAwaiter\"), DynamicInvocationType.Invocation, EmptyList<ResolveResult>.Instance), SpecialType.Dynamic, null, null, null);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn UnaryOperatorResolveResult(SpecialType.Dynamic, op, expression);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// C# 4.0 spec: §7.3.3 Unary operator overload resolution\n\t\t\tstring overloadableOperatorName = GetOverloadableOperatorName(op);\n\t\t\tif (overloadableOperatorName == null) {\n\t\t\t\tswitch (op) {\n\t\t\t\t\tcase UnaryOperatorType.Dereference:\n\t\t\t\t\t\tPointerType p = expression.Type as PointerType;\n\t\t\t\t\t\tif (p != null)\n\t\t\t\t\t\t\treturn UnaryOperatorResolveResult(p.ElementType, op, expression);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn ErrorResult;\n\t\t\t\t\tcase UnaryOperatorType.AddressOf:\n\t\t\t\t\t\treturn UnaryOperatorResolveResult(new PointerType(expression.Type), op, expression);\n\t\t\t\t\tcase UnaryOperatorType.Await: {\n\t\t\t\t\t\tResolveResult getAwaiterMethodGroup = ResolveMemberAccess(expression, \"GetAwaiter\", EmptyList<IType>.Instance, NameLookupMode.InvocationTarget);\n\t\t\t\t\t\tResolveResult getAwaiterInvocation = ResolveInvocation(getAwaiterMethodGroup, new ResolveResult[0], argumentNames: null, allowOptionalParameters: false);\n\n\t\t\t\t\t\tvar lookup = CreateMemberLookup();\n\t\t\t\t\t\tIMethod getResultMethod;\n\t\t\t\t\t\tIType awaitResultType;\n\t\t\t\t\t\tvar getResultMethodGroup = lookup.Lookup(getAwaiterInvocation, \"GetResult\", EmptyList<IType>.Instance, true) as MethodGroupResolveResult;\n\t\t\t\t\t\tif (getResultMethodGroup != null) {\n\t\t\t\t\t\t\tvar getResultOR = getResultMethodGroup.PerformOverloadResolution(compilation, new ResolveResult[0], allowExtensionMethods: false, conversions: conversions);\n\t\t\t\t\t\t\tgetResultMethod = getResultOR.FoundApplicableCandidate ? getResultOR.GetBestCandidateWithSubstitutedTypeArguments() as IMethod : null;\n\t\t\t\t\t\t\tawaitResultType = getResultMethod != null ? getResultMethod.ReturnType : SpecialType.UnknownType;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tgetResultMethod = null;\n\t\t\t\t\t\t\tawaitResultType = SpecialType.UnknownType;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar isCompletedRR = lookup.Lookup(getAwaiterInvocation, \"IsCompleted\", EmptyList<IType>.Instance, false);\n\t\t\t\t\t\tvar isCompletedProperty = (isCompletedRR is MemberResolveResult ? ((MemberResolveResult)isCompletedRR).Member as IProperty : null);\n\t\t\t\t\t\tif (isCompletedProperty != null && (!isCompletedProperty.ReturnType.IsKnownType(KnownTypeCode.Boolean) || !isCompletedProperty.CanGet))\n\t\t\t\t\t\t\tisCompletedProperty = null;\n\n\t\t\t\t\t\tvar interfaceOnCompleted = compilation.FindType(KnownTypeCode.INotifyCompletion).GetMethods().FirstOrDefault(x => x.Name == \"OnCompleted\");\n\t\t\t\t\t\tvar interfaceUnsafeOnCompleted = compilation.FindType(KnownTypeCode.ICriticalNotifyCompletion).GetMethods().FirstOrDefault(x => x.Name == \"UnsafeOnCompleted\");\n\n\t\t\t\t\t\tIMethod onCompletedMethod = null;\n\t\t\t\t\t\tvar candidates = getAwaiterInvocation.Type.GetMethods().Where(x => x.ImplementedInterfaceMembers.Select(y => y.MemberDefinition).Contains(interfaceUnsafeOnCompleted)).ToList();\n\t\t\t\t\t\tif (candidates.Count == 0) {\n\t\t\t\t\t\t\tcandidates = getAwaiterInvocation.Type.GetMethods().Where(x => x.ImplementedInterfaceMembers.Select(y => y.MemberDefinition).Contains(interfaceOnCompleted)).ToList();\n\t\t\t\t\t\t\tif (candidates.Count == 1)\n\t\t\t\t\t\t\t\tonCompletedMethod = candidates[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (candidates.Count == 1) {\n\t\t\t\t\t\t\tonCompletedMethod = candidates[0];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new AwaitResolveResult(awaitResultType, getAwaiterInvocation, getAwaiterInvocation.Type, isCompletedProperty, onCompletedMethod, getResultMethod);\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn ErrorResolveResult.UnknownError;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If the type is nullable, get the underlying type:\n\t\t\tIType type = NullableType.GetUnderlyingType(expression.Type);\n\t\t\tbool isNullable = NullableType.IsNullable(expression.Type);\n\t\t\t\n\t\t\t// the operator is overloadable:\n\t\t\tOverloadResolution userDefinedOperatorOR = CreateOverloadResolution(new[] { expression });\n\t\t\tforeach (var candidate in GetUserDefinedOperatorCandidates(type, overloadableOperatorName)) {\n\t\t\t\tuserDefinedOperatorOR.AddCandidate(candidate);\n\t\t\t}\n\t\t\tif (userDefinedOperatorOR.FoundApplicableCandidate) {\n\t\t\t\treturn CreateResolveResultForUserDefinedOperator(userDefinedOperatorOR, UnaryOperatorExpression.GetLinqNodeType(op, this.CheckForOverflow));\n\t\t\t}\n\t\t\t\n\t\t\texpression = UnaryNumericPromotion(op, ref type, isNullable, expression);\n\t\t\tCSharpOperators.OperatorMethod[] methodGroup;\n\t\t\tCSharpOperators operators = CSharpOperators.Get(compilation);\n\t\t\tswitch (op) {\n\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\t\t// C# 4.0 spec: §7.6.9 Postfix increment and decrement operators\n\t\t\t\t\t// C# 4.0 spec: §7.7.5 Prefix increment and decrement operators\n\t\t\t\t\tTypeCode code = ReflectionHelper.GetTypeCode(type);\n\t\t\t\t\tif ((code >= TypeCode.Char && code <= TypeCode.Decimal) || type.Kind == TypeKind.Enum || type.Kind == TypeKind.Pointer)\n\t\t\t\t\t\treturn UnaryOperatorResolveResult(expression.Type, op, expression, isNullable);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn new ErrorResolveResult(expression.Type);\n\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\t\tmethodGroup = operators.UnaryPlusOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\tmethodGroup = CheckForOverflow ? operators.CheckedUnaryMinusOperators : operators.UncheckedUnaryMinusOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\t\tmethodGroup = operators.LogicalNegationOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase UnaryOperatorType.BitNot:\n\t\t\t\t\tif (type.Kind == TypeKind.Enum) {\n\t\t\t\t\t\tif (expression.IsCompileTimeConstant && !isNullable && expression.ConstantValue != null) {\n\t\t\t\t\t\t\t// evaluate as (E)(~(U)x);\n\t\t\t\t\t\t\tvar U = compilation.FindType(expression.ConstantValue.GetType());\n\t\t\t\t\t\t\tvar unpackedEnum = new ConstantResolveResult(U, expression.ConstantValue);\n\t\t\t\t\t\t\tvar rr = ResolveUnaryOperator(op, unpackedEnum);\n\t\t\t\t\t\t\trr = WithCheckForOverflow(false).ResolveCast(type, rr);\n\t\t\t\t\t\t\tif (rr.IsCompileTimeConstant)\n\t\t\t\t\t\t\t\treturn rr;\n\t\t\t\t\t\t} \n\t\t\t\t\t\treturn UnaryOperatorResolveResult(expression.Type, op, expression, isNullable);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmethodGroup = operators.BitwiseComplementOperators;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\tOverloadResolution builtinOperatorOR = CreateOverloadResolution(new[] { expression });\n\t\t\tforeach (var candidate in methodGroup) {\n\t\t\t\tbuiltinOperatorOR.AddCandidate(candidate);\n\t\t\t}\n\t\t\tCSharpOperators.UnaryOperatorMethod m = (CSharpOperators.UnaryOperatorMethod)builtinOperatorOR.BestCandidate;\n\t\t\tIType resultType = m.ReturnType;\n\t\t\tif (builtinOperatorOR.BestCandidateErrors != OverloadResolutionErrors.None) {\n\t\t\t\tif (userDefinedOperatorOR.BestCandidate != null) {\n\t\t\t\t\t// If there are any user-defined operators, prefer those over the built-in operators.\n\t\t\t\t\t// It'll be a more informative error.\n\t\t\t\t\treturn CreateResolveResultForUserDefinedOperator(userDefinedOperatorOR, UnaryOperatorExpression.GetLinqNodeType(op, this.CheckForOverflow));\n\t\t\t\t} else if (builtinOperatorOR.BestCandidateAmbiguousWith != null) {\n\t\t\t\t\t// If the best candidate is ambiguous, just use the input type instead\n\t\t\t\t\t// of picking one of the ambiguous overloads.\n\t\t\t\t\treturn new ErrorResolveResult(expression.Type);\n\t\t\t\t} else {\n\t\t\t\t\treturn new ErrorResolveResult(resultType);\n\t\t\t\t}\n\t\t\t} else if (expression.IsCompileTimeConstant && m.CanEvaluateAtCompileTime) {\n\t\t\t\tobject val;\n\t\t\t\ttry {\n\t\t\t\t\tval = m.Invoke(this, expression.ConstantValue);\n\t\t\t\t} catch (ArithmeticException) {\n\t\t\t\t\treturn new ErrorResolveResult(resultType);\n\t\t\t\t}\n\t\t\t\treturn new ConstantResolveResult(resultType, val);\n\t\t\t} else {\n\t\t\t\texpression = Convert(expression, m.Parameters[0].Type, builtinOperatorOR.ArgumentConversions[0]);\n\t\t\t\treturn UnaryOperatorResolveResult(resultType, op, expression,\n\t\t\t\t                                  builtinOperatorOR.BestCandidate is OverloadResolution.ILiftedOperator);\n\t\t\t}\n\t\t}\n\t\t\n\t\tOperatorResolveResult UnaryOperatorResolveResult(IType resultType, UnaryOperatorType op, ResolveResult expression, bool isLifted = false)\n\t\t{\n\t\t\treturn new OperatorResolveResult(\n\t\t\t\tresultType, UnaryOperatorExpression.GetLinqNodeType(op, this.CheckForOverflow),\n\t\t\t\tnull, isLifted, new[] { expression });\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region UnaryNumericPromotion\n\t\tResolveResult UnaryNumericPromotion(UnaryOperatorType op, ref IType type, bool isNullable, ResolveResult expression)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.3.6.1\n\t\t\tTypeCode code = ReflectionHelper.GetTypeCode(type);\n\t\t\tif (isNullable && type.Kind == TypeKind.Null)\n\t\t\t\tcode = TypeCode.SByte; // cause promotion of null to int32\n\t\t\tswitch (op) {\n\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\tif (code == TypeCode.UInt32) {\n\t\t\t\t\t\ttype = compilation.FindType(KnownTypeCode.Int64);\n\t\t\t\t\t\treturn Convert(expression, MakeNullable(type, isNullable),\n\t\t\t\t\t\t               isNullable ? Conversion.ImplicitNullableConversion : Conversion.ImplicitNumericConversion);\n\t\t\t\t\t}\n\t\t\t\t\tgoto case UnaryOperatorType.Plus;\n\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\tcase UnaryOperatorType.BitNot:\n\t\t\t\t\tif (code >= TypeCode.Char && code <= TypeCode.UInt16) {\n\t\t\t\t\t\ttype = compilation.FindType(KnownTypeCode.Int32);\n\t\t\t\t\t\treturn Convert(expression, MakeNullable(type, isNullable),\n\t\t\t\t\t\t               isNullable ? Conversion.ImplicitNullableConversion : Conversion.ImplicitNumericConversion);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn expression;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetOverloadableOperatorName\n\t\tstatic string GetOverloadableOperatorName(UnaryOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\t\treturn \"op_LogicalNot\";\n\t\t\t\tcase UnaryOperatorType.BitNot:\n\t\t\t\t\treturn \"op_OnesComplement\";\n\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\treturn \"op_UnaryNegation\";\n\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\t\treturn \"op_UnaryPlus\";\n\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\t\treturn \"op_Increment\";\n\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\t\treturn \"op_Decrement\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t#endregion\n\t\t\n\t\t#region ResolveBinaryOperator\n\t\t#region ResolveBinaryOperator method\n\t\tpublic ResolveResult ResolveBinaryOperator(BinaryOperatorType op, ResolveResult lhs, ResolveResult rhs)\n\t\t{\n\t\t\tif (lhs.Type.Kind == TypeKind.Dynamic || rhs.Type.Kind == TypeKind.Dynamic) {\n\t\t\t\tlhs = Convert(lhs, SpecialType.Dynamic);\n\t\t\t\trhs = Convert(rhs, SpecialType.Dynamic);\n\t\t\t\treturn BinaryOperatorResolveResult(SpecialType.Dynamic, lhs, op, rhs);\n\t\t\t}\n\t\t\t\n\t\t\t// C# 4.0 spec: §7.3.4 Binary operator overload resolution\n\t\t\tstring overloadableOperatorName = GetOverloadableOperatorName(op);\n\t\t\tif (overloadableOperatorName == null) {\n\t\t\t\t\n\t\t\t\t// Handle logical and/or exactly as bitwise and/or:\n\t\t\t\t// - If the user overloads a bitwise operator, that implicitly creates the corresponding logical operator.\n\t\t\t\t// - If both inputs are compile-time constants, it doesn't matter that we don't short-circuit.\n\t\t\t\t// - If inputs aren't compile-time constants, we don't evaluate anything, so again it doesn't matter that we don't short-circuit\n\t\t\t\tif (op == BinaryOperatorType.ConditionalAnd) {\n\t\t\t\t\toverloadableOperatorName = GetOverloadableOperatorName(BinaryOperatorType.BitwiseAnd);\n\t\t\t\t} else if (op == BinaryOperatorType.ConditionalOr) {\n\t\t\t\t\toverloadableOperatorName = GetOverloadableOperatorName(BinaryOperatorType.BitwiseOr);\n\t\t\t\t} else if (op == BinaryOperatorType.NullCoalescing) {\n\t\t\t\t\t// null coalescing operator is not overloadable and needs to be handled separately\n\t\t\t\t\treturn ResolveNullCoalescingOperator(lhs, rhs);\n\t\t\t\t} else {\n\t\t\t\t\treturn ErrorResolveResult.UnknownError;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// If the type is nullable, get the underlying type:\n\t\t\tbool isNullable = NullableType.IsNullable(lhs.Type) || NullableType.IsNullable(rhs.Type);\n\t\t\tIType lhsType = NullableType.GetUnderlyingType(lhs.Type);\n\t\t\tIType rhsType = NullableType.GetUnderlyingType(rhs.Type);\n\t\t\t\n\t\t\t// the operator is overloadable:\n\t\t\tOverloadResolution userDefinedOperatorOR = CreateOverloadResolution(new[] { lhs, rhs });\n\t\t\tHashSet<IParameterizedMember> userOperatorCandidates = new HashSet<IParameterizedMember>();\n\t\t\tuserOperatorCandidates.UnionWith(GetUserDefinedOperatorCandidates(lhsType, overloadableOperatorName));\n\t\t\tuserOperatorCandidates.UnionWith(GetUserDefinedOperatorCandidates(rhsType, overloadableOperatorName));\n\t\t\tforeach (var candidate in userOperatorCandidates) {\n\t\t\t\tuserDefinedOperatorOR.AddCandidate(candidate);\n\t\t\t}\n\t\t\tif (userDefinedOperatorOR.FoundApplicableCandidate) {\n\t\t\t\treturn CreateResolveResultForUserDefinedOperator(userDefinedOperatorOR, BinaryOperatorExpression.GetLinqNodeType(op, this.CheckForOverflow));\n\t\t\t}\n\t\t\t\n\t\t\tif (lhsType.Kind == TypeKind.Null && rhsType.IsReferenceType == false\n\t\t\t    || lhsType.IsReferenceType == false && rhsType.Kind == TypeKind.Null)\n\t\t\t{\n\t\t\t\tisNullable = true;\n\t\t\t}\n\t\t\tif (op == BinaryOperatorType.ShiftLeft || op == BinaryOperatorType.ShiftRight) {\n\t\t\t\t// special case: the shift operators allow \"var x = null << null\", producing int?.\n\t\t\t\tif (lhsType.Kind == TypeKind.Null && rhsType.Kind == TypeKind.Null)\n\t\t\t\t\tisNullable = true;\n\t\t\t\t// for shift operators, do unary promotion independently on both arguments\n\t\t\t\tlhs = UnaryNumericPromotion(UnaryOperatorType.Plus, ref lhsType, isNullable, lhs);\n\t\t\t\trhs = UnaryNumericPromotion(UnaryOperatorType.Plus, ref rhsType, isNullable, rhs);\n\t\t\t} else {\n\t\t\t\tbool allowNullableConstants = op == BinaryOperatorType.Equality || op == BinaryOperatorType.InEquality;\n\t\t\t\tif (!BinaryNumericPromotion(isNullable, ref lhs, ref rhs, allowNullableConstants))\n\t\t\t\t\treturn new ErrorResolveResult(lhs.Type);\n\t\t\t}\n\t\t\t// re-read underlying types after numeric promotion\n\t\t\tlhsType = NullableType.GetUnderlyingType(lhs.Type);\n\t\t\trhsType = NullableType.GetUnderlyingType(rhs.Type);\n\t\t\t\n\t\t\tIEnumerable<CSharpOperators.OperatorMethod> methodGroup;\n\t\t\tCSharpOperators operators = CSharpOperators.Get(compilation);\n\t\t\tswitch (op) {\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\t\tmethodGroup = operators.MultiplicationOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\t\tmethodGroup = operators.DivisionOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\tmethodGroup = operators.RemainderOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\t\tmethodGroup = operators.AdditionOperators;\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t// E operator +(E x, U y);\n\t\t\t\t\t\t\tIType underlyingType = MakeNullable(GetEnumUnderlyingType(lhsType), isNullable);\n\t\t\t\t\t\t\tif (TryConvertEnum(ref rhs, underlyingType, ref isNullable, ref lhs)) {\n\t\t\t\t\t\t\t\treturn HandleEnumOperator(isNullable, lhsType, op, lhs, rhs);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (rhsType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t// E operator +(U x, E y);\n\t\t\t\t\t\t\tIType underlyingType = MakeNullable(GetEnumUnderlyingType(rhsType), isNullable);\n\t\t\t\t\t\t\tif (TryConvertEnum(ref lhs, underlyingType, ref isNullable, ref rhs)) {\n\t\t\t\t\t\t\t\treturn HandleEnumOperator(isNullable, rhsType, op, lhs, rhs);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Delegate && TryConvert(ref rhs, lhsType)) {\n\t\t\t\t\t\t\treturn BinaryOperatorResolveResult(lhsType, lhs, op, rhs);\n\t\t\t\t\t\t} else if (rhsType.Kind == TypeKind.Delegate && TryConvert(ref lhs, rhsType)) {\n\t\t\t\t\t\t\treturn BinaryOperatorResolveResult(rhsType, lhs, op, rhs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (lhsType is PointerType) {\n\t\t\t\t\t\t\tmethodGroup = new [] {\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.Int32),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.UInt32),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.Int64),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.UInt64)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else if (rhsType is PointerType) {\n\t\t\t\t\t\t\tmethodGroup = new [] {\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(rhsType, KnownTypeCode.Int32, rhsType),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(rhsType, KnownTypeCode.UInt32, rhsType),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(rhsType, KnownTypeCode.Int64, rhsType),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(rhsType, KnownTypeCode.UInt64, rhsType)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Null && rhsType.Kind == TypeKind.Null)\n\t\t\t\t\t\t\treturn new ErrorResolveResult(SpecialType.NullType);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\tmethodGroup = operators.SubtractionOperators;\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t// U operator –(E x, E y);\n\t\t\t\t\t\t\tif (TryConvertEnum(ref rhs, lhs.Type, ref isNullable, ref lhs, allowConversionFromConstantZero: false)) {\n\t\t\t\t\t\t\t\treturn HandleEnumSubtraction(isNullable, lhsType, lhs, rhs);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// E operator –(E x, U y);\n\t\t\t\t\t\t\tIType underlyingType = MakeNullable(GetEnumUnderlyingType(lhsType), isNullable);\n\t\t\t\t\t\t\tif (TryConvertEnum(ref rhs, underlyingType, ref isNullable, ref lhs)) {\n\t\t\t\t\t\t\t\treturn HandleEnumOperator(isNullable, lhsType, op, lhs, rhs);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (rhsType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t// U operator –(E x, E y);\n\t\t\t\t\t\t\tif (TryConvertEnum(ref lhs, rhs.Type, ref isNullable, ref rhs, allowConversionFromConstantZero: false)) {\n\t\t\t\t\t\t\t\treturn HandleEnumSubtraction(isNullable, rhsType, lhs, rhs);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// E operator -(U x, E y);\n\t\t\t\t\t\t\tIType underlyingType = MakeNullable(GetEnumUnderlyingType(rhsType), isNullable);\n\t\t\t\t\t\t\tif (TryConvertEnum(ref lhs, underlyingType, ref isNullable, ref rhs)) {\n\t\t\t\t\t\t\t\treturn HandleEnumOperator(isNullable, rhsType, op, lhs, rhs);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Delegate && TryConvert(ref rhs, lhsType)) {\n\t\t\t\t\t\t\treturn BinaryOperatorResolveResult(lhsType, lhs, op, rhs);\n\t\t\t\t\t\t} else if (rhsType.Kind == TypeKind.Delegate && TryConvert(ref lhs, rhsType)) {\n\t\t\t\t\t\t\treturn BinaryOperatorResolveResult(rhsType, lhs, op, rhs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (lhsType is PointerType) {\n\t\t\t\t\t\t\tif (rhsType is PointerType) {\n\t\t\t\t\t\t\t\tIType int64 = compilation.FindType(KnownTypeCode.Int64);\n\t\t\t\t\t\t\t\tif (lhsType.Equals(rhsType)) {\n\t\t\t\t\t\t\t\t\treturn BinaryOperatorResolveResult(int64, lhs, op, rhs);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn new ErrorResolveResult(int64);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmethodGroup = new [] {\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.Int32),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.UInt32),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.Int64),\n\t\t\t\t\t\t\t\tPointerArithmeticOperator(lhsType, lhsType, KnownTypeCode.UInt64)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Null && rhsType.Kind == TypeKind.Null)\n\t\t\t\t\t\t\treturn new ErrorResolveResult(SpecialType.NullType);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\t\tmethodGroup = operators.ShiftLeftOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\tmethodGroup = operators.ShiftRightOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Enum && TryConvert(ref rhs, lhs.Type)) {\n\t\t\t\t\t\t\t// bool operator op(E x, E y);\n\t\t\t\t\t\t\treturn HandleEnumComparison(op, lhsType, isNullable, lhs, rhs);\n\t\t\t\t\t\t} else if (rhsType.Kind == TypeKind.Enum && TryConvert(ref lhs, rhs.Type)) {\n\t\t\t\t\t\t\t// bool operator op(E x, E y);\n\t\t\t\t\t\t\treturn HandleEnumComparison(op, rhsType, isNullable, lhs, rhs);\n\t\t\t\t\t\t} else if (lhsType is PointerType && rhsType is PointerType) {\n\t\t\t\t\t\t\treturn BinaryOperatorResolveResult(compilation.FindType(KnownTypeCode.Boolean), lhs, op, rhs);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (op == BinaryOperatorType.Equality || op == BinaryOperatorType.InEquality) {\n\t\t\t\t\t\t\tif (lhsType.IsReferenceType == true && rhsType.IsReferenceType == true) {\n\t\t\t\t\t\t\t\t// If it's a reference comparison\n\t\t\t\t\t\t\t\tif (op == BinaryOperatorType.Equality)\n\t\t\t\t\t\t\t\t\tmethodGroup = operators.ReferenceEqualityOperators;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tmethodGroup = operators.ReferenceInequalityOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else if (lhsType.Kind == TypeKind.Null && IsNullableTypeOrNonValueType(rhs.Type)\n\t\t\t\t\t\t\t           || IsNullableTypeOrNonValueType(lhs.Type) && rhsType.Kind == TypeKind.Null) {\n\t\t\t\t\t\t\t\t// compare type parameter or nullable type with the null literal\n\t\t\t\t\t\t\t\treturn BinaryOperatorResolveResult(compilation.FindType(KnownTypeCode.Boolean), lhs, op, rhs);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch (op) {\n\t\t\t\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\t\t\t\t\tmethodGroup = operators.ValueEqualityOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\t\t\t\tmethodGroup = operators.ValueInequalityOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\t\t\t\tmethodGroup = operators.LessThanOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\t\t\t\tmethodGroup = operators.GreaterThanOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\t\t\t\tmethodGroup = operators.LessThanOrEqualOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\t\t\t\tmethodGroup = operators.GreaterThanOrEqualOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lhsType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t// bool operator op(E x, E y);\n\t\t\t\t\t\t\tif (TryConvertEnum(ref rhs, lhs.Type, ref isNullable, ref lhs)) {\n\t\t\t\t\t\t\t\treturn HandleEnumOperator(isNullable, lhsType, op, lhs, rhs);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (rhsType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\t\t// bool operator op(E x, E y);\n\t\t\t\t\t\t\tif (TryConvertEnum (ref lhs, rhs.Type, ref isNullable, ref rhs)) {\n\t\t\t\t\t\t\t\treturn HandleEnumOperator(isNullable, rhsType, op, lhs, rhs);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch (op) {\n\t\t\t\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\t\t\t\tmethodGroup = operators.BitwiseAndOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\t\t\t\tmethodGroup = operators.BitwiseOrOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\t\t\t\tmethodGroup = operators.BitwiseXorOperators;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\tmethodGroup = operators.LogicalAndOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\tmethodGroup = operators.LogicalOrOperators;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\tOverloadResolution builtinOperatorOR = CreateOverloadResolution(new[] { lhs, rhs });\n\t\t\tforeach (var candidate in methodGroup) {\n\t\t\t\tbuiltinOperatorOR.AddCandidate(candidate);\n\t\t\t}\n\t\t\tCSharpOperators.BinaryOperatorMethod m = (CSharpOperators.BinaryOperatorMethod)builtinOperatorOR.BestCandidate;\n\t\t\tIType resultType = m.ReturnType;\n\t\t\tif (builtinOperatorOR.BestCandidateErrors != OverloadResolutionErrors.None) {\n\t\t\t\t// If there are any user-defined operators, prefer those over the built-in operators.\n\t\t\t\t// It'll be a more informative error.\n\t\t\t\tif (userDefinedOperatorOR.BestCandidate != null)\n\t\t\t\t\treturn CreateResolveResultForUserDefinedOperator(userDefinedOperatorOR, BinaryOperatorExpression.GetLinqNodeType(op, this.CheckForOverflow));\n\t\t\t\telse\n\t\t\t\t\treturn new ErrorResolveResult(resultType);\n\t\t\t} else if (lhs.IsCompileTimeConstant && rhs.IsCompileTimeConstant && m.CanEvaluateAtCompileTime) {\n\t\t\t\tobject val;\n\t\t\t\ttry {\n\t\t\t\t\tval = m.Invoke(this, lhs.ConstantValue, rhs.ConstantValue);\n\t\t\t\t} catch (ArithmeticException) {\n\t\t\t\t\treturn new ErrorResolveResult(resultType);\n\t\t\t\t}\n\t\t\t\treturn new ConstantResolveResult(resultType, val);\n\t\t\t} else {\n\t\t\t\tlhs = Convert(lhs, m.Parameters[0].Type, builtinOperatorOR.ArgumentConversions[0]);\n\t\t\t\trhs = Convert(rhs, m.Parameters[1].Type, builtinOperatorOR.ArgumentConversions[1]);\n\t\t\t\treturn BinaryOperatorResolveResult(resultType, lhs, op, rhs,\n\t\t\t\t                                   builtinOperatorOR.BestCandidate is OverloadResolution.ILiftedOperator);\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsNullableTypeOrNonValueType(IType type)\n\t\t{\n\t\t\treturn NullableType.IsNullable(type) || type.IsReferenceType != false;\n\t\t}\n\t\t\n\t\tResolveResult BinaryOperatorResolveResult(IType resultType, ResolveResult lhs, BinaryOperatorType op, ResolveResult rhs, bool isLifted = false)\n\t\t{\n\t\t\treturn new OperatorResolveResult(\n\t\t\t\tresultType, BinaryOperatorExpression.GetLinqNodeType(op, this.CheckForOverflow),\n\t\t\t\tnull, isLifted, new[] { lhs, rhs });\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Pointer arithmetic\n\t\tCSharpOperators.BinaryOperatorMethod PointerArithmeticOperator(IType resultType, IType inputType1, KnownTypeCode inputType2)\n\t\t{\n\t\t\treturn PointerArithmeticOperator(resultType, inputType1, compilation.FindType(inputType2));\n\t\t}\n\t\t\n\t\tCSharpOperators.BinaryOperatorMethod PointerArithmeticOperator(IType resultType, KnownTypeCode inputType1, IType inputType2)\n\t\t{\n\t\t\treturn PointerArithmeticOperator(resultType, compilation.FindType(inputType1), inputType2);\n\t\t}\n\t\t\n\t\tCSharpOperators.BinaryOperatorMethod PointerArithmeticOperator(IType resultType, IType inputType1, IType inputType2)\n\t\t{\n\t\t\treturn new CSharpOperators.BinaryOperatorMethod(compilation) {\n\t\t\t\tReturnType = resultType,\n\t\t\t\tParameters = {\n\t\t\t\t\tnew DefaultParameter(inputType1, string.Empty),\n\t\t\t\t\tnew DefaultParameter(inputType2, string.Empty)\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Enum helper methods\n\t\tIType GetEnumUnderlyingType(IType enumType)\n\t\t{\n\t\t\tITypeDefinition def = enumType.GetDefinition();\n\t\t\treturn def != null ? def.EnumUnderlyingType : SpecialType.UnknownType;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Handle the case where an enum value is compared with another enum value\n\t\t/// bool operator op(E x, E y);\n\t\t/// </summary>\n\t\tResolveResult HandleEnumComparison(BinaryOperatorType op, IType enumType, bool isNullable, ResolveResult lhs, ResolveResult rhs)\n\t\t{\n\t\t\t// evaluate as ((U)x op (U)y)\n\t\t\tIType elementType = GetEnumUnderlyingType(enumType);\n\t\t\tif (lhs.IsCompileTimeConstant && rhs.IsCompileTimeConstant && !isNullable && elementType.Kind != TypeKind.Enum) {\n\t\t\t\tvar rr = ResolveBinaryOperator(op, ResolveCast(elementType, lhs), ResolveCast(elementType, rhs));\n\t\t\t\tif (rr.IsCompileTimeConstant)\n\t\t\t\t\treturn rr;\n\t\t\t}\n\t\t\tIType resultType = compilation.FindType(KnownTypeCode.Boolean);\n\t\t\treturn BinaryOperatorResolveResult(resultType, lhs, op, rhs, isNullable);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Handle the case where an enum value is subtracted from another enum value\n\t\t/// U operator –(E x, E y);\n\t\t/// </summary>\n\t\tResolveResult HandleEnumSubtraction(bool isNullable, IType enumType, ResolveResult lhs, ResolveResult rhs)\n\t\t{\n\t\t\t// evaluate as (U)((U)x – (U)y)\n\t\t\tIType elementType = GetEnumUnderlyingType(enumType);\n\t\t\tif (lhs.IsCompileTimeConstant && rhs.IsCompileTimeConstant && !isNullable && elementType.Kind != TypeKind.Enum) {\n\t\t\t\tvar rr = ResolveBinaryOperator(BinaryOperatorType.Subtract, ResolveCast(elementType, lhs), ResolveCast(elementType, rhs));\n\t\t\t\trr = WithCheckForOverflow(false).ResolveCast(elementType, rr);\n\t\t\t\tif (rr.IsCompileTimeConstant)\n\t\t\t\t\treturn rr;\n\t\t\t}\n\t\t\tIType resultType = MakeNullable(elementType, isNullable);\n\t\t\treturn BinaryOperatorResolveResult(resultType, lhs, BinaryOperatorType.Subtract, rhs, isNullable);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Handle the following enum operators:\n\t\t/// E operator +(E x, U y);\n\t\t/// E operator +(U x, E y);\n\t\t/// E operator –(E x, U y);\n\t\t/// E operator &amp;(E x, E y);\n\t\t/// E operator |(E x, E y);\n\t\t/// E operator ^(E x, E y);\n\t\t/// </summary>\n\t\tResolveResult HandleEnumOperator(bool isNullable, IType enumType, BinaryOperatorType op, ResolveResult lhs, ResolveResult rhs)\n\t\t{\n\t\t\t// evaluate as (E)((U)x op (U)y)\n\t\t\tif (lhs.IsCompileTimeConstant && rhs.IsCompileTimeConstant && !isNullable) {\n\t\t\t\tIType elementType = GetEnumUnderlyingType(enumType);\n\t\t\t\tif (elementType.Kind != TypeKind.Enum) {\n\t\t\t\t\tvar rr = ResolveBinaryOperator(op, ResolveCast(elementType, lhs), ResolveCast(elementType, rhs));\n\t\t\t\t\trr = WithCheckForOverflow(false).ResolveCast(enumType, rr);\n\t\t\t\t\tif (rr.IsCompileTimeConstant) // only report result if it's a constant; use the regular OperatorResolveResult codepath otherwise\n\t\t\t\t\t\treturn rr;\n\t\t\t\t}\n\t\t\t}\n\t\t\tIType resultType = MakeNullable(enumType, isNullable);\n\t\t\treturn BinaryOperatorResolveResult(resultType, lhs, op, rhs, isNullable);\n\t\t}\n\t\t\n\t\tIType MakeNullable(IType type, bool isNullable)\n\t\t{\n\t\t\tif (isNullable)\n\t\t\t\treturn NullableType.Create(compilation, type);\n\t\t\telse\n\t\t\t\treturn type;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region BinaryNumericPromotion\n\t\tbool BinaryNumericPromotion(bool isNullable, ref ResolveResult lhs, ref ResolveResult rhs, bool allowNullableConstants)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.3.6.2\n\t\t\tTypeCode lhsCode = ReflectionHelper.GetTypeCode(NullableType.GetUnderlyingType(lhs.Type));\n\t\t\tTypeCode rhsCode = ReflectionHelper.GetTypeCode(NullableType.GetUnderlyingType(rhs.Type));\n\t\t\t// if one of the inputs is the null literal, promote that to the type of the other operand\n\t\t\tif (isNullable && lhs.Type.Kind == TypeKind.Null && rhsCode >= TypeCode.Boolean && rhsCode <= TypeCode.Decimal) {\n\t\t\t\tlhs = CastTo(rhsCode, isNullable, lhs, allowNullableConstants);\n\t\t\t\tlhsCode = rhsCode;\n\t\t\t} else if (isNullable && rhs.Type.Kind == TypeKind.Null && lhsCode >= TypeCode.Boolean && lhsCode <= TypeCode.Decimal) {\n\t\t\t\trhs = CastTo(lhsCode, isNullable, rhs, allowNullableConstants);\n\t\t\t\trhsCode = lhsCode;\n\t\t\t}\n\t\t\tbool bindingError = false;\n\t\t\tif (lhsCode >= TypeCode.Char && lhsCode <= TypeCode.Decimal\n\t\t\t    && rhsCode >= TypeCode.Char && rhsCode <= TypeCode.Decimal)\n\t\t\t{\n\t\t\t\tTypeCode targetType;\n\t\t\t\tif (lhsCode == TypeCode.Decimal || rhsCode == TypeCode.Decimal) {\n\t\t\t\t\ttargetType = TypeCode.Decimal;\n\t\t\t\t\tbindingError = (lhsCode == TypeCode.Single || lhsCode == TypeCode.Double\n\t\t\t\t\t                || rhsCode == TypeCode.Single || rhsCode == TypeCode.Double);\n\t\t\t\t} else if (lhsCode == TypeCode.Double || rhsCode == TypeCode.Double) {\n\t\t\t\t\ttargetType = TypeCode.Double;\n\t\t\t\t} else if (lhsCode == TypeCode.Single || rhsCode == TypeCode.Single) {\n\t\t\t\t\ttargetType = TypeCode.Single;\n\t\t\t\t} else if (lhsCode == TypeCode.UInt64 || rhsCode == TypeCode.UInt64) {\n\t\t\t\t\ttargetType = TypeCode.UInt64;\n\t\t\t\t\tbindingError = IsSigned(lhsCode, lhs) || IsSigned(rhsCode, rhs);\n\t\t\t\t} else if (lhsCode == TypeCode.Int64 || rhsCode == TypeCode.Int64) {\n\t\t\t\t\ttargetType = TypeCode.Int64;\n\t\t\t\t} else if (lhsCode == TypeCode.UInt32 || rhsCode == TypeCode.UInt32) {\n\t\t\t\t\ttargetType = (IsSigned(lhsCode, lhs) || IsSigned(rhsCode, rhs)) ? TypeCode.Int64 : TypeCode.UInt32;\n\t\t\t\t} else {\n\t\t\t\t\ttargetType = TypeCode.Int32;\n\t\t\t\t}\n\t\t\t\tlhs = CastTo(targetType, isNullable, lhs, allowNullableConstants);\n\t\t\t\trhs = CastTo(targetType, isNullable, rhs, allowNullableConstants);\n\t\t\t}\n\t\t\treturn !bindingError;\n\t\t}\n\t\t\n\t\tbool IsSigned(TypeCode code, ResolveResult rr)\n\t\t{\n\t\t\t// Determine whether the rr with code==ReflectionHelper.GetTypeCode(NullableType.GetUnderlyingType(rr.Type))\n\t\t\t// is a signed primitive type.\n\t\t\tswitch (code) {\n\t\t\t\tcase TypeCode.SByte:\n\t\t\t\tcase TypeCode.Int16:\n\t\t\t\t\treturn true;\n\t\t\t\tcase TypeCode.Int32:\n\t\t\t\t\t// for int, consider implicit constant expression conversion\n\t\t\t\t\tif (rr.IsCompileTimeConstant && rr.ConstantValue != null && (int)rr.ConstantValue >= 0)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn true;\n\t\t\t\tcase TypeCode.Int64:\n\t\t\t\t\t// for long, consider implicit constant expression conversion\n\t\t\t\t\tif (rr.IsCompileTimeConstant && rr.ConstantValue != null && (long)rr.ConstantValue >= 0)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult CastTo(TypeCode targetType, bool isNullable, ResolveResult expression, bool allowNullableConstants)\n\t\t{\n\t\t\tIType elementType = compilation.FindType(targetType);\n\t\t\tIType nullableType = MakeNullable(elementType, isNullable);\n\t\t\tif (nullableType.Equals(expression.Type))\n\t\t\t\treturn expression;\n\t\t\tif (allowNullableConstants && expression.IsCompileTimeConstant) {\n\t\t\t\tif (expression.ConstantValue == null)\n\t\t\t\t\treturn new ConstantResolveResult(nullableType, null);\n\t\t\t\tResolveResult rr = ResolveCast(elementType, expression);\n\t\t\t\tif (rr.IsError)\n\t\t\t\t\treturn rr;\n\t\t\t\tDebug.Assert(rr.IsCompileTimeConstant);\n\t\t\t\treturn new ConstantResolveResult(nullableType, rr.ConstantValue);\n\t\t\t} else {\n\t\t\t\treturn Convert(expression, nullableType,\n\t\t\t\t               isNullable ? Conversion.ImplicitNullableConversion : Conversion.ImplicitNumericConversion);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetOverloadableOperatorName\n\t\tstatic string GetOverloadableOperatorName(BinaryOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\t\treturn \"op_Addition\";\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\treturn \"op_Subtraction\";\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\t\treturn \"op_Multiply\";\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\t\treturn \"op_Division\";\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\treturn \"op_Modulus\";\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\treturn \"op_BitwiseAnd\";\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\treturn \"op_BitwiseOr\";\n\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\treturn \"op_ExclusiveOr\";\n\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\t\treturn \"op_LeftShift\";\n\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\treturn \"op_RightShift\";\n\t\t\t\tcase BinaryOperatorType.Equality:\n\t\t\t\t\treturn \"op_Equality\";\n\t\t\t\tcase BinaryOperatorType.InEquality:\n\t\t\t\t\treturn \"op_Inequality\";\n\t\t\t\tcase BinaryOperatorType.GreaterThan:\n\t\t\t\t\treturn \"op_GreaterThan\";\n\t\t\t\tcase BinaryOperatorType.LessThan:\n\t\t\t\t\treturn \"op_LessThan\";\n\t\t\t\tcase BinaryOperatorType.GreaterThanOrEqual:\n\t\t\t\t\treturn \"op_GreaterThanOrEqual\";\n\t\t\t\tcase BinaryOperatorType.LessThanOrEqual:\n\t\t\t\t\treturn \"op_LessThanOrEqual\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Null coalescing operator\n\t\tResolveResult ResolveNullCoalescingOperator(ResolveResult lhs, ResolveResult rhs)\n\t\t{\n\t\t\tif (NullableType.IsNullable(lhs.Type)) {\n\t\t\t\tIType a0 = NullableType.GetUnderlyingType(lhs.Type);\n\t\t\t\tif (TryConvert(ref rhs, a0)) {\n\t\t\t\t\treturn BinaryOperatorResolveResult(a0, lhs, BinaryOperatorType.NullCoalescing, rhs);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (TryConvert(ref rhs, lhs.Type)) {\n\t\t\t\treturn BinaryOperatorResolveResult(lhs.Type, lhs, BinaryOperatorType.NullCoalescing, rhs);\n\t\t\t}\n\t\t\tif (TryConvert(ref lhs, rhs.Type)) {\n\t\t\t\treturn BinaryOperatorResolveResult(rhs.Type, lhs, BinaryOperatorType.NullCoalescing, rhs);\n\t\t\t} else {\n\t\t\t\treturn new ErrorResolveResult(lhs.Type);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t#endregion\n\t\t\n\t\t#region Get user-defined operator candidates\n\t\tIEnumerable<IParameterizedMember> GetUserDefinedOperatorCandidates(IType type, string operatorName)\n\t\t{\n\t\t\tif (operatorName == null)\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\tTypeCode c = ReflectionHelper.GetTypeCode(type);\n\t\t\tif (TypeCode.Boolean <= c && c <= TypeCode.Decimal || c == TypeCode.String) {\n\t\t\t\t// The .NET framework contains some of C#'s built-in operators as user-defined operators.\n\t\t\t\t// However, we must not use those as user-defined operators (we would skip numeric promotion).\n\t\t\t\treturn EmptyList<IMethod>.Instance;\n\t\t\t}\n\t\t\t// C# 4.0 spec: §7.3.5 Candidate user-defined operators\n\t\t\tvar operators = type.GetMethods(m => m.IsOperator && m.Name == operatorName).ToList();\n\t\t\tLiftUserDefinedOperators(operators);\n\t\t\treturn operators;\n\t\t}\n\t\t\n\t\tvoid LiftUserDefinedOperators(List<IMethod> operators)\n\t\t{\n\t\t\tint nonLiftedMethodCount = operators.Count;\n\t\t\t// Construct lifted operators\n\t\t\tfor (int i = 0; i < nonLiftedMethodCount; i++) {\n\t\t\t\tvar liftedMethod = LiftUserDefinedOperator(operators[i]);\n\t\t\t\tif (liftedMethod != null)\n\t\t\t\t\toperators.Add(liftedMethod);\n\t\t\t}\n\t\t}\n\t\t\n\t\tLiftedUserDefinedOperator LiftUserDefinedOperator(IMethod m)\n\t\t{\n\t\t\tif (IsComparisonOperator(m)) {\n\t\t\t\tif (!m.ReturnType.Equals(compilation.FindType(KnownTypeCode.Boolean)))\n\t\t\t\t\treturn null; // cannot lift this operator\n\t\t\t} else {\n\t\t\t\tif (!NullableType.IsNonNullableValueType(m.ReturnType))\n\t\t\t\t\treturn null; // cannot lift this operator\n\t\t\t}\n\t\t\tfor (int i = 0; i < m.Parameters.Count; i++) {\n\t\t\t\tif (!NullableType.IsNonNullableValueType(m.Parameters[i].Type))\n\t\t\t\t\treturn null; // cannot lift this operator\n\t\t\t}\n\t\t\treturn new LiftedUserDefinedOperator(m);\n\t\t}\n\t\t\n\t\tstatic bool IsComparisonOperator(IMethod m)\n\t\t{\n\t\t\tvar type = OperatorDeclaration.GetOperatorType(m.Name);\n\t\t\treturn type.HasValue && type.Value.IsComparisonOperator();\n\t\t}\n\t\t\n\t\tsealed class LiftedUserDefinedOperator : SpecializedMethod, OverloadResolution.ILiftedOperator\n\t\t{\n\t\t\tinternal readonly IParameterizedMember nonLiftedOperator;\n\t\t\t\n\t\t\tpublic LiftedUserDefinedOperator(IMethod nonLiftedMethod)\n\t\t\t\t: base((IMethod)nonLiftedMethod.MemberDefinition, nonLiftedMethod.Substitution)\n\t\t\t{\n\t\t\t\tthis.nonLiftedOperator = nonLiftedMethod;\n\t\t\t\tvar substitution = new MakeNullableVisitor(nonLiftedMethod.Compilation, nonLiftedMethod.Substitution);\n\t\t\t\tthis.Parameters = base.CreateParameters(substitution);\n\t\t\t\t// Comparison operators keep the 'bool' return type even when lifted.\n\t\t\t\tif (IsComparisonOperator(nonLiftedMethod))\n\t\t\t\t\tthis.ReturnType = nonLiftedMethod.ReturnType;\n\t\t\t\telse\n\t\t\t\t\tthis.ReturnType = nonLiftedMethod.ReturnType.AcceptVisitor(substitution);\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IParameter> NonLiftedParameters {\n\t\t\t\tget { return nonLiftedOperator.Parameters; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tLiftedUserDefinedOperator op = obj as LiftedUserDefinedOperator;\n\t\t\t\treturn op != null && this.nonLiftedOperator.Equals(op.nonLiftedOperator);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn nonLiftedOperator.GetHashCode() ^ 0x7191254;\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class MakeNullableVisitor : TypeVisitor\n\t\t{\n\t\t\treadonly ICompilation compilation;\n\t\t\treadonly TypeParameterSubstitution typeParameterSubstitution;\n\t\t\t\n\t\t\tpublic MakeNullableVisitor(ICompilation compilation, TypeParameterSubstitution typeParameterSubstitution)\n\t\t\t{\n\t\t\t\tthis.compilation = compilation;\n\t\t\t\tthis.typeParameterSubstitution = typeParameterSubstitution;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitTypeDefinition(ITypeDefinition type)\n\t\t\t{\n\t\t\t\treturn NullableType.Create(compilation, type.AcceptVisitor(typeParameterSubstitution));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitTypeParameter(ITypeParameter type)\n\t\t\t{\n\t\t\t\treturn NullableType.Create(compilation, type.AcceptVisitor(typeParameterSubstitution));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitParameterizedType(ParameterizedType type)\n\t\t\t{\n\t\t\t\treturn NullableType.Create(compilation, type.AcceptVisitor(typeParameterSubstitution));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitOtherType(IType type)\n\t\t\t{\n\t\t\t\treturn NullableType.Create(compilation, type.AcceptVisitor(typeParameterSubstitution));\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult CreateResolveResultForUserDefinedOperator(OverloadResolution r, System.Linq.Expressions.ExpressionType operatorType)\n\t\t{\n\t\t\tif (r.BestCandidateErrors != OverloadResolutionErrors.None)\n\t\t\t\treturn r.CreateResolveResult(null);\n\t\t\tIMethod method = (IMethod)r.BestCandidate;\n\t\t\treturn new OperatorResolveResult(method.ReturnType, operatorType, method,\n\t\t\t                                 isLiftedOperator: method is OverloadResolution.ILiftedOperator,\n\t\t\t                                 operands: r.GetArgumentsWithConversions());\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveCast\n\t\tbool TryConvert(ref ResolveResult rr, IType targetType)\n\t\t{\n\t\t\tConversion c = conversions.ImplicitConversion(rr, targetType);\n\t\t\tif (c.IsValid) {\n\t\t\t\trr = Convert(rr, targetType, c);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// \n\t\t/// </summary>\n\t\t/// <param name=\"rr\">The input resolve result that should be converted.\n\t\t/// If a conversion exists, it is applied to the resolve result</param>\n\t\t/// <param name=\"targetType\">The target type that we should convert to</param>\n\t\t/// <param name=\"isNullable\">Whether we are dealing with a lifted operator</param>\n\t\t/// <param name=\"enumRR\">The resolve result that is enum-typed.\n\t\t/// If necessary, a nullable conversion is applied.</param>\n\t\t/// <param name=\"allowConversionFromConstantZero\">\n\t\t/// Whether the conversion from the constant zero is allowed.\n\t\t/// </param>\n\t\t/// <returns>True if the conversion is successful; false otherwise.\n\t\t/// If the conversion is not successful, the ref parameters will not be modified.</returns>\n\t\tbool TryConvertEnum(ref ResolveResult rr, IType targetType, ref bool isNullable, ref ResolveResult enumRR, bool allowConversionFromConstantZero = true)\n\t\t{\n\t\t\tConversion c;\n\t\t\tif (!isNullable) {\n\t\t\t\t// Try non-nullable\n\t\t\t\tc = conversions.ImplicitConversion(rr, targetType);\n\t\t\t\tif (c.IsValid && (allowConversionFromConstantZero || !c.IsEnumerationConversion)) {\n\t\t\t\t\trr = Convert(rr, targetType, c);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// make targetType nullable if it isn't already:\n\t\t\tif (!targetType.IsKnownType(KnownTypeCode.NullableOfT))\n\t\t\t\ttargetType = NullableType.Create(compilation, targetType);\n\t\t\t\n\t\t\tc = conversions.ImplicitConversion(rr, targetType);\n\t\t\tif (c.IsValid && (allowConversionFromConstantZero || !c.IsEnumerationConversion)) {\n\t\t\t\trr = Convert(rr, targetType, c);\n\t\t\t\tisNullable = true;\n\t\t\t\t// Also convert the enum-typed RR to nullable, if it isn't already\n\t\t\t\tif (!enumRR.Type.IsKnownType(KnownTypeCode.NullableOfT)) {\n\t\t\t\t\tvar nullableType = NullableType.Create(compilation, enumRR.Type);\n\t\t\t\t\tenumRR = new ConversionResolveResult(nullableType, enumRR, Conversion.ImplicitNullableConversion);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tResolveResult Convert(ResolveResult rr, IType targetType)\n\t\t{\n\t\t\treturn Convert(rr, targetType, conversions.ImplicitConversion(rr, targetType));\n\t\t}\n\t\t\n\t\tResolveResult Convert(ResolveResult rr, IType targetType, Conversion c)\n\t\t{\n\t\t\tif (c == Conversion.IdentityConversion)\n\t\t\t\treturn rr;\n\t\t\telse if (rr.IsCompileTimeConstant && c != Conversion.None && !c.IsUserDefined)\n\t\t\t\treturn ResolveCast(targetType, rr);\n\t\t\telse\n\t\t\t\treturn new ConversionResolveResult(targetType, rr, c, checkForOverflow);\n\t\t}\n\t\t\n\t\tpublic ResolveResult ResolveCast(IType targetType, ResolveResult expression)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.7.6 Cast expressions\n\t\t\tConversion c = conversions.ExplicitConversion(expression, targetType);\n\t\t\tif (expression.IsCompileTimeConstant && !c.IsUserDefined) {\n\t\t\t\tTypeCode code = ReflectionHelper.GetTypeCode(targetType);\n\t\t\t\tif (code >= TypeCode.Boolean && code <= TypeCode.Decimal && expression.ConstantValue != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn new ConstantResolveResult(targetType, CSharpPrimitiveCast(code, expression.ConstantValue));\n\t\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\t\treturn new ErrorResolveResult(targetType);\n\t\t\t\t\t} catch (InvalidCastException) {\n\t\t\t\t\t\treturn new ErrorResolveResult(targetType);\n\t\t\t\t\t}\n\t\t\t\t} else if (code == TypeCode.String) {\n\t\t\t\t\tif (expression.ConstantValue == null || expression.ConstantValue is string)\n\t\t\t\t\t\treturn new ConstantResolveResult(targetType, expression.ConstantValue);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn new ErrorResolveResult(targetType);\n\t\t\t\t} else if (targetType.Kind == TypeKind.Enum) {\n\t\t\t\t\tcode = ReflectionHelper.GetTypeCode(GetEnumUnderlyingType(targetType));\n\t\t\t\t\tif (code >= TypeCode.SByte && code <= TypeCode.UInt64 && expression.ConstantValue != null) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn new ConstantResolveResult(targetType, CSharpPrimitiveCast(code, expression.ConstantValue));\n\t\t\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\t\t\treturn new ErrorResolveResult(targetType);\n\t\t\t\t\t\t} catch (InvalidCastException) {\n\t\t\t\t\t\t\treturn new ErrorResolveResult(targetType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new ConversionResolveResult(targetType, expression, c, checkForOverflow);\n\t\t}\n\t\t\n\t\tinternal object CSharpPrimitiveCast(TypeCode targetType, object input)\n\t\t{\n\t\t\treturn Utils.CSharpPrimitiveCast.Cast(targetType, input, this.CheckForOverflow);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveSimpleName\n\t\tpublic ResolveResult ResolveSimpleName(string identifier, IList<IType> typeArguments, bool isInvocationTarget = false)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.6.2 Simple Names\n\t\t\t\n\t\t\treturn LookupSimpleNameOrTypeName(\n\t\t\t\tidentifier, typeArguments,\n\t\t\t\tisInvocationTarget ? NameLookupMode.InvocationTarget : NameLookupMode.Expression);\n\t\t}\n\t\t\n\t\tpublic ResolveResult LookupSimpleNameOrTypeName(string identifier, IList<IType> typeArguments, NameLookupMode lookupMode)\n\t\t{\n\t\t\t// C# 4.0 spec: §3.8 Namespace and type names; §7.6.2 Simple Names\n\t\t\t\n\t\t\tif (identifier == null)\n\t\t\t\tthrow new ArgumentNullException(\"identifier\");\n\t\t\tif (typeArguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeArguments\");\n\t\t\t\n\t\t\tint k = typeArguments.Count;\n\t\t\t\n\t\t\tif (k == 0) {\n\t\t\t\tif (lookupMode == NameLookupMode.Expression || lookupMode == NameLookupMode.InvocationTarget) {\n\t\t\t\t\t// Look in local variables\n\t\t\t\t\tforeach (IVariable v in this.LocalVariables) {\n\t\t\t\t\t\tif (v.Name == identifier) {\n\t\t\t\t\t\t\treturn new LocalResolveResult(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Look in parameters of current method\n\t\t\t\t\tIParameterizedMember parameterizedMember = this.CurrentMember as IParameterizedMember;\n\t\t\t\t\tif (parameterizedMember != null) {\n\t\t\t\t\t\tforeach (IParameter p in parameterizedMember.Parameters) {\n\t\t\t\t\t\t\tif (p.Name == identifier) {\n\t\t\t\t\t\t\t\treturn new LocalResolveResult(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// look in type parameters of current method\n\t\t\t\tIMethod m = this.CurrentMember as IMethod;\n\t\t\t\tif (m != null) {\n\t\t\t\t\tforeach (ITypeParameter tp in m.TypeParameters) {\n\t\t\t\t\t\tif (tp.Name == identifier)\n\t\t\t\t\t\t\treturn new TypeResolveResult(tp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbool parameterizeResultType = !(typeArguments.Count != 0 && typeArguments.All(t => t.Kind == TypeKind.UnboundTypeArgument));\n\t\t\t\n\t\t\tResolveResult r = null;\n\t\t\tif (currentTypeDefinitionCache != null) {\n\t\t\t\tDictionary<string, ResolveResult> cache = null;\n\t\t\t\tbool foundInCache = false;\n\t\t\t\tif (k == 0) {\n\t\t\t\t\tswitch (lookupMode) {\n\t\t\t\t\t\tcase NameLookupMode.Expression:\n\t\t\t\t\t\t\tcache = currentTypeDefinitionCache.SimpleNameLookupCacheExpression;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase NameLookupMode.InvocationTarget:\n\t\t\t\t\t\t\tcache = currentTypeDefinitionCache.SimpleNameLookupCacheInvocationTarget;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase NameLookupMode.Type:\n\t\t\t\t\t\t\tcache = currentTypeDefinitionCache.SimpleTypeLookupCache;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (cache != null) {\n\t\t\t\t\t\tlock (cache)\n\t\t\t\t\t\t\tfoundInCache = cache.TryGetValue(identifier, out r);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (foundInCache) {\n\t\t\t\t\tr = (r != null ? r.ShallowClone() : null);\n\t\t\t\t} else {\n\t\t\t\t\tr = LookInCurrentType(identifier, typeArguments, lookupMode, parameterizeResultType);\n\t\t\t\t\tif (cache != null) {\n\t\t\t\t\t\t// also cache missing members (r==null)\n\t\t\t\t\t\tlock (cache)\n\t\t\t\t\t\t\tcache[identifier] = r;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (r != null)\n\t\t\t\t\treturn r;\n\t\t\t}\n\t\t\t\n\t\t\tif (context.CurrentUsingScope == null) {\n\t\t\t\t// If no using scope was specified, we still need to look in the global namespace:\n\t\t\t\tr = LookInUsingScopeNamespace(null, compilation.RootNamespace, identifier, typeArguments, parameterizeResultType);\n\t\t\t} else {\n\t\t\t\tif (k == 0 && lookupMode != NameLookupMode.TypeInUsingDeclaration) {\n\t\t\t\t\tif (context.CurrentUsingScope.ResolveCache.TryGetValue(identifier, out r)) {\n\t\t\t\t\t\tr = (r != null ? r.ShallowClone() : null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tr = LookInCurrentUsingScope(identifier, typeArguments, false, false);\n\t\t\t\t\t\tcontext.CurrentUsingScope.ResolveCache.TryAdd(identifier, r);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tr = LookInCurrentUsingScope(identifier, typeArguments, lookupMode == NameLookupMode.TypeInUsingDeclaration, parameterizeResultType);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (r != null)\n\t\t\t\treturn r;\n\t\t\t\n\t\t\tif (typeArguments.Count == 0 && identifier == \"dynamic\") {\n\t\t\t\treturn new TypeResolveResult(SpecialType.Dynamic);\n\t\t\t} else {\n\t\t\t\treturn new UnknownIdentifierResolveResult(identifier, typeArguments.Count);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool IsVariableReferenceWithSameType (ResolveResult rr, string identifier, out TypeResolveResult trr)\n\t\t{\n\t\t\tif (!(rr is MemberResolveResult || rr is LocalResolveResult)) {\n\t\t\t\ttrr = null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ttrr = LookupSimpleNameOrTypeName (identifier, EmptyList<IType>.Instance, NameLookupMode.Type) as TypeResolveResult;\n\t\t\treturn trr != null && trr.Type.Equals (rr.Type);\n\t\t}\n\t\t\n\t\tResolveResult LookInCurrentType(string identifier, IList<IType> typeArguments, NameLookupMode lookupMode, bool parameterizeResultType)\n\t\t{\n\t\t\tint k = typeArguments.Count;\n\t\t\tMemberLookup lookup = CreateMemberLookup(lookupMode);\n\t\t\t// look in current type definitions\n\t\t\tfor (ITypeDefinition t = this.CurrentTypeDefinition; t != null; t = t.DeclaringTypeDefinition) {\n\t\t\t\tif (k == 0) {\n\t\t\t\t\t// Look for type parameter with that name\n\t\t\t\t\tvar typeParameters = t.TypeParameters;\n\t\t\t\t\t// Look at all type parameters, including those copied from outer classes,\n\t\t\t\t\t// so that we can fetch the version with the correct owner.\n\t\t\t\t\tfor (int i = 0; i < typeParameters.Count; i++) {\n\t\t\t\t\t\tif (typeParameters[i].Name == identifier)\n\t\t\t\t\t\t\treturn new TypeResolveResult(typeParameters[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (lookupMode == NameLookupMode.BaseTypeReference && t == this.CurrentTypeDefinition) {\n\t\t\t\t\t// don't look in current type when resolving a base type reference\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tResolveResult r;\n\t\t\t\tif (lookupMode == NameLookupMode.Expression || lookupMode == NameLookupMode.InvocationTarget) {\n\t\t\t\t\tvar targetResolveResult = (t == this.CurrentTypeDefinition ? ResolveThisReference() : new TypeResolveResult(t));\n\t\t\t\t\tr = lookup.Lookup(targetResolveResult, identifier, typeArguments, lookupMode == NameLookupMode.InvocationTarget);\n\t\t\t\t} else {\n\t\t\t\t\tr = lookup.LookupType(t, identifier, typeArguments, parameterizeResultType);\n\t\t\t\t}\n\t\t\t\tif (!(r is UnknownMemberResolveResult)) // but do return AmbiguousMemberResolveResult\n\t\t\t\t\treturn r;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult LookInCurrentUsingScope(string identifier, IList<IType> typeArguments, bool isInUsingDeclaration, bool parameterizeResultType)\n\t\t{\n\t\t\t// look in current namespace definitions\n\t\t\tResolvedUsingScope currentUsingScope = this.CurrentUsingScope;\n\t\t\tfor (ResolvedUsingScope u = currentUsingScope; u != null; u = u.Parent) {\n\t\t\t\tvar resultInNamespace = LookInUsingScopeNamespace(u, u.Namespace, identifier, typeArguments, parameterizeResultType);\n\t\t\t\tif (resultInNamespace != null)\n\t\t\t\t\treturn resultInNamespace;\n\t\t\t\t// then look for aliases:\n\t\t\t\tif (typeArguments.Count == 0) {\n\t\t\t\t\tif (u.ExternAliases.Contains(identifier)) {\n\t\t\t\t\t\treturn ResolveExternAlias(identifier);\n\t\t\t\t\t}\n\t\t\t\t\tif (!(isInUsingDeclaration && u == currentUsingScope)) {\n\t\t\t\t\t\tforeach (var pair in u.UsingAliases) {\n\t\t\t\t\t\t\tif (pair.Key == identifier) {\n\t\t\t\t\t\t\t\treturn pair.Value.ShallowClone();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// finally, look in the imported namespaces:\n\t\t\t\tif (!(isInUsingDeclaration && u == currentUsingScope)) {\n\t\t\t\t\tIType firstResult = null;\n\t\t\t\t\tforeach (var importedNamespace in u.Usings) {\n\t\t\t\t\t\tITypeDefinition def = importedNamespace.GetTypeDefinition(identifier, typeArguments.Count);\n\t\t\t\t\t\tif (def != null) {\n\t\t\t\t\t\t\tIType resultType;\n\t\t\t\t\t\t\tif (parameterizeResultType && typeArguments.Count > 0)\n\t\t\t\t\t\t\t\tresultType = new ParameterizedType(def, typeArguments);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tresultType = def;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (firstResult == null || !TopLevelTypeDefinitionIsAccessible(firstResult.GetDefinition())) {\n\t\t\t\t\t\t\t\tif (TopLevelTypeDefinitionIsAccessible(resultType.GetDefinition()))\n\t\t\t\t\t\t\t\t\tfirstResult = resultType;\n\t\t\t\t\t\t\t} else if (TopLevelTypeDefinitionIsAccessible(def)) {\n\t\t\t\t\t\t\t\treturn new AmbiguousTypeResolveResult(firstResult);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (firstResult != null)\n\t\t\t\t\t\treturn new TypeResolveResult(firstResult);\n\t\t\t\t}\n\t\t\t\t// if we didn't find anything: repeat lookup with parent namespace\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tResolveResult LookInUsingScopeNamespace(ResolvedUsingScope usingScope, INamespace n, string identifier, IList<IType> typeArguments, bool parameterizeResultType)\n\t\t{\n\t\t\tif (n == null)\n\t\t\t\treturn null;\n\t\t\t// first look for a namespace\n\t\t\tint k = typeArguments.Count;\n\t\t\tif (k == 0) {\n\t\t\t\tINamespace childNamespace = n.GetChildNamespace(identifier);\n\t\t\t\tif (childNamespace != null) {\n\t\t\t\t\tif (usingScope != null && usingScope.HasAlias(identifier))\n\t\t\t\t\t\treturn new AmbiguousTypeResolveResult(new UnknownType(null, identifier));\n\t\t\t\t\treturn new NamespaceResolveResult(childNamespace);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// then look for a type\n\t\t\tITypeDefinition def = n.GetTypeDefinition(identifier, k);\n\t\t\tif (def != null) {\n\t\t\t\tIType result = def;\n\t\t\t\tif (parameterizeResultType && k > 0) {\n\t\t\t\t\tresult = new ParameterizedType(def, typeArguments);\n\t\t\t\t}\n\t\t\t\tif (usingScope != null && usingScope.HasAlias(identifier))\n\t\t\t\t\treturn new AmbiguousTypeResolveResult(result);\n\t\t\t\telse\n\t\t\t\t\treturn new TypeResolveResult(result);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tbool TopLevelTypeDefinitionIsAccessible(ITypeDefinition typeDef)\n\t\t{\n\t\t\tif (typeDef.IsInternal) {\n\t\t\t\treturn typeDef.ParentAssembly.InternalsVisibleTo(compilation.MainAssembly);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Looks up an alias (identifier in front of :: operator)\n\t\t/// </summary>\n\t\tpublic ResolveResult ResolveAlias(string identifier)\n\t\t{\n\t\t\tif (identifier == \"global\")\n\t\t\t\treturn new NamespaceResolveResult(compilation.RootNamespace);\n\t\t\t\n\t\t\tfor (ResolvedUsingScope n = this.CurrentUsingScope; n != null; n = n.Parent) {\n\t\t\t\tif (n.ExternAliases.Contains(identifier)) {\n\t\t\t\t\treturn ResolveExternAlias(identifier);\n\t\t\t\t}\n\t\t\t\tforeach (var pair in n.UsingAliases) {\n\t\t\t\t\tif (pair.Key == identifier) {\n\t\t\t\t\t\treturn (pair.Value as NamespaceResolveResult) ?? ErrorResult;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ErrorResult;\n\t\t}\n\t\t\n\t\tResolveResult ResolveExternAlias(string alias)\n\t\t{\n\t\t\tINamespace ns = compilation.GetNamespaceForExternAlias(alias);\n\t\t\tif (ns != null)\n\t\t\t\treturn new NamespaceResolveResult(ns);\n\t\t\telse\n\t\t\t\treturn ErrorResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveMemberAccess\n\t\tpublic ResolveResult ResolveMemberAccess(ResolveResult target, string identifier, IList<IType> typeArguments, NameLookupMode lookupMode = NameLookupMode.Expression)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.6.4\n\t\t\t\n\t\t\tbool parameterizeResultType = !(typeArguments.Count != 0 && typeArguments.All(t => t.Kind == TypeKind.UnboundTypeArgument));\n\t\t\tNamespaceResolveResult nrr = target as NamespaceResolveResult;\n\t\t\tif (nrr != null) {\n\t\t\t\treturn ResolveMemberAccessOnNamespace(nrr, identifier, typeArguments, parameterizeResultType);\n\t\t\t}\n\t\t\t\n\t\t\tif (target.Type.Kind == TypeKind.Dynamic)\n\t\t\t\treturn new DynamicMemberResolveResult(target, identifier);\n\t\t\t\n\t\t\tMemberLookup lookup = CreateMemberLookup(lookupMode);\n\t\t\tResolveResult result;\n\t\t\tswitch (lookupMode) {\n\t\t\t\tcase NameLookupMode.Expression:\n\t\t\t\t\tresult = lookup.Lookup(target, identifier, typeArguments, isInvocation: false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase NameLookupMode.InvocationTarget:\n\t\t\t\t\tresult = lookup.Lookup(target, identifier, typeArguments, isInvocation: true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase NameLookupMode.Type:\n\t\t\t\tcase NameLookupMode.TypeInUsingDeclaration:\n\t\t\t\tcase NameLookupMode.BaseTypeReference:\n\t\t\t\t\t// Don't do the UnknownMemberResolveResult/MethodGroupResolveResult processing,\n\t\t\t\t\t// it's only relevant for expressions.\n\t\t\t\t\treturn lookup.LookupType(target.Type, identifier, typeArguments, parameterizeResultType);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotSupportedException(\"Invalid value for NameLookupMode\");\n\t\t\t}\n\t\t\tif (result is UnknownMemberResolveResult) {\n\t\t\t\t// We intentionally use all extension methods here, not just the eligible ones.\n\t\t\t\t// Proper eligibility checking is only possible for the full invocation\n\t\t\t\t// (after we know the remaining arguments).\n\t\t\t\t// The eligibility check in GetExtensionMethods is only intended for code completion.\n\t\t\t\tvar extensionMethods = GetExtensionMethods(identifier, typeArguments);\n\t\t\t\tif (extensionMethods.Count > 0) {\n\t\t\t\t\treturn new MethodGroupResolveResult(target, identifier, EmptyList<MethodListWithDeclaringType>.Instance, typeArguments) {\n\t\t\t\t\t\textensionMethods = extensionMethods\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tMethodGroupResolveResult mgrr = result as MethodGroupResolveResult;\n\t\t\t\tif (mgrr != null) {\n\t\t\t\t\tDebug.Assert(mgrr.extensionMethods == null);\n\t\t\t\t\t// set the values that are necessary to make MethodGroupResolveResult.GetExtensionMethods() work\n\t\t\t\t\tmgrr.resolver = this;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t[Obsolete(\"Use ResolveMemberAccess() with NameLookupMode.Type instead\")]\n\t\tpublic ResolveResult ResolveMemberType(ResolveResult target, string identifier, IList<IType> typeArguments)\n\t\t{\n\t\t\treturn ResolveMemberAccess(target, identifier, typeArguments, NameLookupMode.Type);\n\t\t}\n\t\t\n\t\tResolveResult ResolveMemberAccessOnNamespace(NamespaceResolveResult nrr, string identifier, IList<IType> typeArguments, bool parameterizeResultType)\n\t\t{\n\t\t\tif (typeArguments.Count == 0) {\n\t\t\t\tINamespace childNamespace = nrr.Namespace.GetChildNamespace(identifier);\n\t\t\t\tif (childNamespace != null)\n\t\t\t\t\treturn new NamespaceResolveResult(childNamespace);\n\t\t\t}\n\t\t\tITypeDefinition def = nrr.Namespace.GetTypeDefinition(identifier, typeArguments.Count);\n\t\t\tif (def != null) {\n\t\t\t\tif (parameterizeResultType && typeArguments.Count > 0)\n\t\t\t\t\treturn new TypeResolveResult(new ParameterizedType(def, typeArguments));\n\t\t\t\telse\n\t\t\t\t\treturn new TypeResolveResult(def);\n\t\t\t}\n\t\t\treturn ErrorResult;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a MemberLookup instance using this resolver's settings.\n\t\t/// </summary>\n\t\tpublic MemberLookup CreateMemberLookup()\n\t\t{\n\t\t\tITypeDefinition currentTypeDefinition = this.CurrentTypeDefinition;\n\t\t\tbool isInEnumMemberInitializer = this.CurrentMember != null && this.CurrentMember.SymbolKind == SymbolKind.Field\n\t\t\t\t&& currentTypeDefinition != null && currentTypeDefinition.Kind == TypeKind.Enum;\n\t\t\treturn new MemberLookup(currentTypeDefinition, this.Compilation.MainAssembly, isInEnumMemberInitializer);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a MemberLookup instance using this resolver's settings.\n\t\t/// </summary>\n\t\tpublic MemberLookup CreateMemberLookup(NameLookupMode lookupMode)\n\t\t{\n\t\t\tif (lookupMode == NameLookupMode.BaseTypeReference && this.CurrentTypeDefinition != null) {\n\t\t\t\t// When looking up a base type reference, treat us as being outside the current type definition\n\t\t\t\t// for accessibility purposes.\n\t\t\t\t// This avoids a stack overflow when referencing a protected class nested inside the base class\n\t\t\t\t// of a parent class. (NameLookupTests.InnerClassInheritingFromProtectedBaseInnerClassShouldNotCauseStackOverflow)\n\t\t\t\treturn new MemberLookup(this.CurrentTypeDefinition.DeclaringTypeDefinition, this.Compilation.MainAssembly, false);\n\t\t\t} else {\n\t\t\t\treturn CreateMemberLookup();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveIdentifierInObjectInitializer\n\t\tpublic ResolveResult ResolveIdentifierInObjectInitializer(string identifier)\n\t\t{\n\t\t\tMemberLookup memberLookup = CreateMemberLookup();\n\t\t\treturn memberLookup.Lookup(this.CurrentObjectInitializer, identifier, EmptyList<IType>.Instance, false);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetExtensionMethods\n\t\t/// <summary>\n\t\t/// Gets all extension methods that are available in the current context.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">Name of the extension method. Pass null to retrieve all extension methods.</param>\n\t\t/// <param name=\"typeArguments\">Explicitly provided type arguments.\n\t\t/// An empty list will return all matching extension method definitions;\n\t\t/// a non-empty list will return <see cref=\"SpecializedMethod\"/>s for all extension methods\n\t\t/// with the matching number of type parameters.</param>\n\t\t/// <remarks>\n\t\t/// The results are stored in nested lists because they are grouped by using scope.\n\t\t/// That is, for \"using SomeExtensions; namespace X { using MoreExtensions; ... }\",\n\t\t/// the return value will be\n\t\t/// new List {\n\t\t///    new List { all extensions from MoreExtensions },\n\t\t///    new List { all extensions from SomeExtensions }\n\t\t/// }\n\t\t/// </remarks>\n\t\tpublic List<List<IMethod>> GetExtensionMethods(string name = null, IList<IType> typeArguments = null)\n\t\t{\n\t\t\treturn GetExtensionMethods(null, name, typeArguments);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the extension methods that are called 'name'\n\t\t/// and are applicable with a first argument type of 'targetType'.\n\t\t/// </summary>\n\t\t/// <param name=\"targetType\">Type of the 'this' argument</param>\n\t\t/// <param name=\"name\">Name of the extension method. Pass null to retrieve all extension methods.</param>\n\t\t/// <param name=\"typeArguments\">Explicitly provided type arguments.\n\t\t/// An empty list will return all matching extension method definitions;\n\t\t/// a non-empty list will return <see cref=\"SpecializedMethod\"/>s for all extension methods\n\t\t/// with the matching number of type parameters.</param>\n\t\t/// <param name=\"substituteInferredTypes\">\n\t\t/// Specifies whether to produce a <see cref=\"SpecializedMethod\"/>\n\t\t/// when type arguments could be inferred from <paramref name=\"targetType\"/>. This parameter\n\t\t/// is only used for inferred types and has no effect if <paramref name=\"typeArguments\"/> is non-empty.\n\t\t/// </param>\n\t\t/// <remarks>\n\t\t/// The results are stored in nested lists because they are grouped by using scope.\n\t\t/// That is, for \"using SomeExtensions; namespace X { using MoreExtensions; ... }\",\n\t\t/// the return value will be\n\t\t/// new List {\n\t\t///    new List { all extensions from MoreExtensions },\n\t\t///    new List { all extensions from SomeExtensions }\n\t\t/// }\n\t\t/// </remarks>\n\t\tpublic List<List<IMethod>> GetExtensionMethods(IType targetType, string name = null, IList<IType> typeArguments = null, bool substituteInferredTypes = false)\n\t\t{\n\t\t\tvar lookup = CreateMemberLookup();\n\t\t\tList<List<IMethod>> extensionMethodGroups = new List<List<IMethod>>();\n\t\t\tforeach (var inputGroup in GetAllExtensionMethods()) {\n\t\t\t\tList<IMethod> outputGroup = new List<IMethod>();\n\t\t\t\tforeach (var method in inputGroup) {\n\t\t\t\t\tif (name != null && method.Name != name)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (!lookup.IsAccessible(method, false))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tIType[] inferredTypes;\n\t\t\t\t\tif (typeArguments != null && typeArguments.Count > 0) {\n\t\t\t\t\t\tif (method.TypeParameters.Count != typeArguments.Count)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar sm = method.Specialize(new TypeParameterSubstitution(null, typeArguments));\n\t\t\t\t\t\tif (IsEligibleExtensionMethod(compilation, conversions, targetType, sm, false, out inferredTypes))\n\t\t\t\t\t\t\toutputGroup.Add(sm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (IsEligibleExtensionMethod(compilation, conversions, targetType, method, true, out inferredTypes)) {\n\t\t\t\t\t\t\tif (substituteInferredTypes && inferredTypes != null) {\n\t\t\t\t\t\t\t\toutputGroup.Add(method.Specialize(new TypeParameterSubstitution(null, inferredTypes)));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\toutputGroup.Add(method);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (outputGroup.Count > 0)\n\t\t\t\t\textensionMethodGroups.Add(outputGroup);\n\t\t\t}\n\t\t\treturn extensionMethodGroups;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Checks whether the specified extension method is eligible on the target type.\n\t\t/// </summary>\n\t\t/// <param name=\"targetType\">Target type that is passed as first argument to the extension method.</param>\n\t\t/// <param name=\"method\">The extension method.</param>\n\t\t/// <param name=\"useTypeInference\">Whether to perform type inference for the method.\n\t\t/// Use <c>false</c> if <paramref name=\"method\"/> is already parameterized (e.g. when type arguments were given explicitly).\n\t\t/// Otherwise, use <c>true</c>.\n\t\t/// </param>\n\t\t/// <param name=\"outInferredTypes\">If the method is generic and <paramref name=\"useTypeInference\"/> is <c>true</c>,\n\t\t/// and at least some of the type arguments could be inferred, this parameter receives the inferred type arguments.\n\t\t/// Since only the type for the first parameter is considered, not all type arguments may be inferred.\n\t\t/// If an array is returned, any slot with an uninferred type argument will be set to the method's\n\t\t/// corresponding type parameter.\n\t\t/// </param>\n\t\tpublic static bool IsEligibleExtensionMethod(IType targetType, IMethod method, bool useTypeInference, out IType[] outInferredTypes)\n\t\t{\n\t\t\tif (targetType == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetType\");\n\t\t\tif (method == null)\n\t\t\t\tthrow new ArgumentNullException(\"method\");\n\t\t\tvar compilation = method.Compilation;\n\t\t\treturn IsEligibleExtensionMethod(compilation, CSharpConversions.Get(compilation), targetType, method, useTypeInference, out outInferredTypes);\n\t\t}\n\t\t\n\t\tstatic bool IsEligibleExtensionMethod(ICompilation compilation, CSharpConversions conversions, IType targetType, IMethod method, bool useTypeInference, out IType[] outInferredTypes)\n\t\t{\n\t\t\toutInferredTypes = null;\n\t\t\tif (targetType == null)\n\t\t\t\treturn true;\n\t\t\tif (method.Parameters.Count == 0)\n\t\t\t\treturn false;\n\t\t\tIType thisParameterType = method.Parameters[0].Type;\n\t\t\tif (useTypeInference && method.TypeParameters.Count > 0) {\n\t\t\t\t// We need to infer type arguments from targetType:\n\t\t\t\tTypeInference ti = new TypeInference(compilation, conversions);\n\t\t\t\tResolveResult[] arguments = { new ResolveResult(targetType) };\n\t\t\t\tIType[] parameterTypes = { method.Parameters[0].Type };\n\t\t\t\tbool success;\n\t\t\t\tvar inferredTypes = ti.InferTypeArguments(method.TypeParameters, arguments, parameterTypes, out success);\n\t\t\t\tvar substitution = new TypeParameterSubstitution(null, inferredTypes);\n\t\t\t\t// Validate that the types that could be inferred (aren't unknown) satisfy the constraints:\n\t\t\t\tbool hasInferredTypes = false;\n\t\t\t\tfor (int i = 0; i < inferredTypes.Length; i++) {\n\t\t\t\t\tif (inferredTypes[i].Kind != TypeKind.Unknown && inferredTypes[i].Kind != TypeKind.UnboundTypeArgument) {\n\t\t\t\t\t\thasInferredTypes = true;\n\t\t\t\t\t\tif (!OverloadResolution.ValidateConstraints(method.TypeParameters[i], inferredTypes[i], substitution, conversions))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinferredTypes[i] = method.TypeParameters[i]; // do not substitute types that could not be inferred\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (hasInferredTypes)\n\t\t\t\t\toutInferredTypes = inferredTypes;\n\t\t\t\tthisParameterType = thisParameterType.AcceptVisitor(substitution);\n\t\t\t}\n\t\t\tConversion c = conversions.ImplicitConversion(targetType, thisParameterType);\n\t\t\treturn c.IsValid && (c.IsIdentityConversion || c.IsReferenceConversion || c.IsBoxingConversion);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all extension methods available in the current using scope.\n\t\t/// This list includes inaccessible methods.\n\t\t/// </summary>\n\t\tIList<List<IMethod>> GetAllExtensionMethods()\n\t\t{\n\t\t\tvar currentUsingScope = context.CurrentUsingScope;\n\t\t\tif (currentUsingScope == null)\n\t\t\t\treturn EmptyList<List<IMethod>>.Instance;\n\t\t\tList<List<IMethod>> extensionMethodGroups = LazyInit.VolatileRead(ref currentUsingScope.AllExtensionMethods);\n\t\t\tif (extensionMethodGroups != null) {\n\t\t\t\treturn extensionMethodGroups;\n\t\t\t}\n\t\t\textensionMethodGroups = new List<List<IMethod>>();\n\t\t\tList<IMethod> m;\n\t\t\tfor (ResolvedUsingScope scope = currentUsingScope; scope != null; scope = scope.Parent) {\n\t\t\t\tINamespace ns = scope.Namespace;\n\t\t\t\tif (ns != null) {\n\t\t\t\t\tm = GetExtensionMethods(ns).ToList();\n\t\t\t\t\tif (m.Count > 0)\n\t\t\t\t\t\textensionMethodGroups.Add(m);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tm = scope.Usings\n\t\t\t\t\t.Distinct()\n\t\t\t\t\t.SelectMany(importedNamespace => GetExtensionMethods(importedNamespace))\n\t\t\t\t\t.ToList();\n\t\t\t\tif (m.Count > 0)\n\t\t\t\t\textensionMethodGroups.Add(m);\n\t\t\t}\n\t\t\treturn LazyInit.GetOrSet(ref currentUsingScope.AllExtensionMethods, extensionMethodGroups);\n\t\t}\n\t\t\n\t\tIEnumerable<IMethod> GetExtensionMethods(INamespace ns)\n\t\t{\n\t\t\t// TODO: maybe make this a property on INamespace?\n\t\t\treturn\n\t\t\t\tfrom c in ns.Types\n\t\t\t\twhere c.IsStatic && c.HasExtensionMethods && c.TypeParameters.Count == 0\n\t\t\t\tfrom m in c.Methods\n\t\t\t\twhere m.IsExtensionMethod\n\t\t\t\tselect m;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveInvocation\n\n\t\tIList<ResolveResult> AddArgumentNamesIfNecessary(ResolveResult[] arguments, string[] argumentNames) {\n\t\t\tif (argumentNames == null) {\n\t\t\t\treturn arguments;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar result = new ResolveResult[arguments.Length];\n\t\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\t\tresult[i] = (argumentNames[i] != null ? new NamedArgumentResolveResult(argumentNames[i], arguments[i]) : arguments[i]);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\n\t\tprivate ResolveResult ResolveInvocation(ResolveResult target, ResolveResult[] arguments, string[] argumentNames, bool allowOptionalParameters)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.6.5\n\t\t\t\n\t\t\tif (target.Type.Kind == TypeKind.Dynamic) {\n\t\t\t\treturn new DynamicInvocationResolveResult(target, DynamicInvocationType.Invocation, AddArgumentNamesIfNecessary(arguments, argumentNames));\n\t\t\t}\n\t\t\t\n\t\t\tbool isDynamic = arguments.Any(a => a.Type.Kind == TypeKind.Dynamic);\n\t\t\tMethodGroupResolveResult mgrr = target as MethodGroupResolveResult;\n\t\t\tif (mgrr != null) {\n\t\t\t\tif (isDynamic) {\n\t\t\t\t\t// If we have dynamic arguments, we need to represent the invocation as a dynamic invocation if there is more than one applicable method.\n\t\t\t\t\tvar or2 = CreateOverloadResolution(arguments, argumentNames, mgrr.TypeArguments.ToArray());\n\t\t\t\t\tvar applicableMethods = mgrr.MethodsGroupedByDeclaringType.SelectMany(m => m, (x, m) => new { x.DeclaringType, Method = m }).Where(x => OverloadResolution.IsApplicable(or2.AddCandidate(x.Method))).ToList();\n\n\t\t\t\t\tif (applicableMethods.Count > 1) {\n\t\t\t\t\t\tResolveResult actualTarget;\n\t\t\t\t\t\tif (applicableMethods.All(x => x.Method.IsStatic) && !(mgrr.TargetResult is TypeResolveResult))\n\t\t\t\t\t\t\tactualTarget = new TypeResolveResult(mgrr.TargetType);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tactualTarget = mgrr.TargetResult;\n\n\t\t\t\t\t\tvar l = new List<MethodListWithDeclaringType>();\n\t\t\t\t\t\tforeach (var m in applicableMethods) {\n\t\t\t\t\t\t\tif (l.Count == 0 || l[l.Count - 1].DeclaringType != m.DeclaringType)\n\t\t\t\t\t\t\t\tl.Add(new MethodListWithDeclaringType(m.DeclaringType));\n\t\t\t\t\t\t\tl[l.Count - 1].Add(m.Method);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn new DynamicInvocationResolveResult(new MethodGroupResolveResult(actualTarget, mgrr.MethodName, l, mgrr.TypeArguments), DynamicInvocationType.Invocation, AddArgumentNamesIfNecessary(arguments, argumentNames));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tOverloadResolution or = mgrr.PerformOverloadResolution(compilation, arguments, argumentNames, checkForOverflow: checkForOverflow, conversions: conversions, allowOptionalParameters: allowOptionalParameters);\n\t\t\t\tif (or.BestCandidate != null) {\n\t\t\t\t\tif (or.BestCandidate.IsStatic && !or.IsExtensionMethodInvocation && !(mgrr.TargetResult is TypeResolveResult))\n\t\t\t\t\t\treturn or.CreateResolveResult(new TypeResolveResult(mgrr.TargetType), returnTypeOverride: isDynamic ? SpecialType.Dynamic : null);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn or.CreateResolveResult(mgrr.TargetResult, returnTypeOverride: isDynamic ? SpecialType.Dynamic : null);\n\t\t\t\t} else {\n\t\t\t\t\t// No candidate found at all (not even an inapplicable one).\n\t\t\t\t\t// This can happen with empty method groups (as sometimes used with extension methods)\n\t\t\t\t\treturn new UnknownMethodResolveResult(\n\t\t\t\t\t\tmgrr.TargetType, mgrr.MethodName, mgrr.TypeArguments, CreateParameters(arguments, argumentNames));\n\t\t\t\t}\n\t\t\t}\n\t\t\tUnknownMemberResolveResult umrr = target as UnknownMemberResolveResult;\n\t\t\tif (umrr != null) {\n\t\t\t\treturn new UnknownMethodResolveResult(umrr.TargetType, umrr.MemberName, umrr.TypeArguments, CreateParameters(arguments, argumentNames));\n\t\t\t}\n\t\t\tUnknownIdentifierResolveResult uirr = target as UnknownIdentifierResolveResult;\n\t\t\tif (uirr != null && CurrentTypeDefinition != null) {\n\t\t\t\treturn new UnknownMethodResolveResult(CurrentTypeDefinition, uirr.Identifier, EmptyList<IType>.Instance, CreateParameters(arguments, argumentNames));\n\t\t\t}\n\t\t\tIMethod invokeMethod = target.Type.GetDelegateInvokeMethod();\n\t\t\tif (invokeMethod != null) {\n\t\t\t\tOverloadResolution or = CreateOverloadResolution(arguments, argumentNames);\n\t\t\t\tor.AddCandidate(invokeMethod);\n\t\t\t\treturn new CSharpInvocationResolveResult(\n\t\t\t\t\ttarget, invokeMethod, //invokeMethod.ReturnType.Resolve(context),\n\t\t\t\t\tor.GetArgumentsWithConversionsAndNames(), or.BestCandidateErrors,\n\t\t\t\t\tisExpandedForm: or.BestCandidateIsExpandedForm,\n\t\t\t\t\tisDelegateInvocation: true,\n\t\t\t\t\targumentToParameterMap: or.GetArgumentToParameterMap(),\n\t\t\t\t\treturnTypeOverride: isDynamic ? SpecialType.Dynamic : null);\n\t\t\t}\n\t\t\treturn ErrorResult;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Resolves an invocation.\n\t\t/// </summary>\n\t\t/// <param name=\"target\">The target of the invocation. Usually a MethodGroupResolveResult.</param>\n\t\t/// <param name=\"arguments\">\n\t\t/// Arguments passed to the method.\n\t\t/// The resolver may mutate this array to wrap elements in <see cref=\"ConversionResolveResult\"/>s!\n\t\t/// </param>\n\t\t/// <param name=\"argumentNames\">\n\t\t/// The argument names. Pass the null string for positional arguments.\n\t\t/// </param>\n\t\t/// <returns>InvocationResolveResult or UnknownMethodResolveResult</returns>\n\t\tpublic ResolveResult ResolveInvocation(ResolveResult target, ResolveResult[] arguments, string[] argumentNames = null)\n\t\t{\n\t\t\treturn ResolveInvocation(target, arguments, argumentNames, allowOptionalParameters: true);\n\t\t}\n\t\t\n\t\tList<IParameter> CreateParameters(ResolveResult[] arguments, string[] argumentNames)\n\t\t{\n\t\t\tList<IParameter> list = new List<IParameter>();\n\t\t\tif (argumentNames == null) {\n\t\t\t\targumentNames = new string[arguments.Length];\n\t\t\t} else {\n\t\t\t\tif (argumentNames.Length != arguments.Length)\n\t\t\t\t\tthrow new ArgumentException();\n\t\t\t\targumentNames = (string[])argumentNames.Clone();\n\t\t\t}\n\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\t// invent argument names where necessary:\n\t\t\t\tif (argumentNames[i] == null) {\n\t\t\t\t\tstring newArgumentName = GuessParameterName(arguments[i]);\n\t\t\t\t\tif (argumentNames.Contains(newArgumentName)) {\n\t\t\t\t\t\t// disambiguate argument name (e.g. add a number)\n\t\t\t\t\t\tint num = 1;\n\t\t\t\t\t\tstring newName;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tnewName = newArgumentName + num.ToString();\n\t\t\t\t\t\t\tnum++;\n\t\t\t\t\t\t} while(argumentNames.Contains(newName));\n\t\t\t\t\t\tnewArgumentName = newName;\n\t\t\t\t\t}\n\t\t\t\t\targumentNames[i] = newArgumentName;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// create the parameter:\n\t\t\t\tByReferenceResolveResult brrr = arguments[i] as ByReferenceResolveResult;\n\t\t\t\tif (brrr != null) {\n\t\t\t\t\tlist.Add(new DefaultParameter(arguments[i].Type, argumentNames[i], isRef: brrr.IsRef, isOut: brrr.IsOut));\n\t\t\t\t} else {\n\t\t\t\t\t// argument might be a lambda or delegate type, so we have to try to guess the delegate type\n\t\t\t\t\tIType type = arguments[i].Type;\n\t\t\t\t\tif (type.Kind == TypeKind.Null || type.Kind == TypeKind.Unknown) {\n\t\t\t\t\t\tlist.Add(new DefaultParameter(compilation.FindType(KnownTypeCode.Object), argumentNames[i]));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist.Add(new DefaultParameter(type, argumentNames[i]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn list;\n\t\t}\n\t\t\n\t\tstatic string GuessParameterName(ResolveResult rr)\n\t\t{\n\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\tif (mrr != null)\n\t\t\t\treturn mrr.Member.Name;\n\t\t\t\n\t\t\tUnknownMemberResolveResult umrr = rr as UnknownMemberResolveResult;\n\t\t\tif (umrr != null)\n\t\t\t\treturn umrr.MemberName;\n\t\t\t\n\t\t\tMethodGroupResolveResult mgrr = rr as MethodGroupResolveResult;\n\t\t\tif (mgrr != null)\n\t\t\t\treturn mgrr.MethodName;\n\t\t\t\n\t\t\tLocalResolveResult vrr = rr as LocalResolveResult;\n\t\t\tif (vrr != null)\n\t\t\t\treturn MakeParameterName(vrr.Variable.Name);\n\t\t\t\n\t\t\tif (rr.Type.Kind != TypeKind.Unknown && !string.IsNullOrEmpty(rr.Type.Name)) {\n\t\t\t\treturn MakeParameterName(rr.Type.Name);\n\t\t\t} else {\n\t\t\t\treturn \"parameter\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic string MakeParameterName(string variableName)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(variableName))\n\t\t\t\treturn \"parameter\";\n\t\t\tif (variableName.Length > 1 && variableName[0] == '_')\n\t\t\t\tvariableName = variableName.Substring(1);\n\t\t\treturn char.ToLower(variableName[0]) + variableName.Substring(1);\n\t\t}\n\t\t\n\t\tOverloadResolution CreateOverloadResolution(ResolveResult[] arguments, string[] argumentNames = null, IType[] typeArguments = null)\n\t\t{\n\t\t\tvar or = new OverloadResolution(compilation, arguments, argumentNames, typeArguments, conversions);\n\t\t\tor.CheckForOverflow = checkForOverflow;\n\t\t\treturn or;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveIndexer\n\t\t/// <summary>\n\t\t/// Resolves an indexer access.\n\t\t/// </summary>\n\t\t/// <param name=\"target\">Target expression.</param>\n\t\t/// <param name=\"arguments\">\n\t\t/// Arguments passed to the indexer.\n\t\t/// The resolver may mutate this array to wrap elements in <see cref=\"ConversionResolveResult\"/>s!\n\t\t/// </param>\n\t\t/// <param name=\"argumentNames\">\n\t\t/// The argument names. Pass the null string for positional arguments.\n\t\t/// </param>\n\t\t/// <returns>ArrayAccessResolveResult, InvocationResolveResult, or ErrorResolveResult</returns>\n\t\tpublic ResolveResult ResolveIndexer(ResolveResult target, ResolveResult[] arguments, string[] argumentNames = null)\n\t\t{\n\t\t\tswitch (target.Type.Kind) {\n\t\t\t\tcase TypeKind.Dynamic:\n\t\t\t\t\treturn new DynamicInvocationResolveResult(target, DynamicInvocationType.Indexing, AddArgumentNamesIfNecessary(arguments, argumentNames));\n\t\t\t\t\t\n\t\t\t\tcase TypeKind.Array:\n\t\t\t\tcase TypeKind.Pointer:\n\t\t\t\t\t// §7.6.6.1 Array access / §18.5.3 Pointer element access\n\t\t\t\t\tAdjustArrayAccessArguments(arguments);\n\t\t\t\t\treturn new ArrayAccessResolveResult(((TypeWithElementType)target.Type).ElementType, target, arguments);\n\t\t\t}\n\t\t\t\n\t\t\t// §7.6.6.2 Indexer access\n\n\t\t\tMemberLookup lookup = CreateMemberLookup();\n\t\t\tvar indexers = lookup.LookupIndexers(target);\n\n\t\t\tif (arguments.Any(a => a.Type.Kind == TypeKind.Dynamic)) {\n\t\t\t\t// If we have dynamic arguments, we need to represent the invocation as a dynamic invocation if there is more than one applicable indexer.\n\t\t\t\tvar or2 = CreateOverloadResolution(arguments, argumentNames, null);\n\t\t\t\tvar applicableIndexers = indexers.SelectMany(x => x).Where(m => OverloadResolution.IsApplicable(or2.AddCandidate(m))).ToList();\n\n\t\t\t\tif (applicableIndexers.Count > 1) {\n\t\t\t\t\treturn new DynamicInvocationResolveResult(target, DynamicInvocationType.Indexing, AddArgumentNamesIfNecessary(arguments, argumentNames));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tOverloadResolution or = CreateOverloadResolution(arguments, argumentNames);\n\t\t\tor.AddMethodLists(indexers);\n\t\t\tif (or.BestCandidate != null) {\n\t\t\t\treturn or.CreateResolveResult(target);\n\t\t\t} else {\n\t\t\t\treturn ErrorResult;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts all arguments to int,uint,long or ulong.\n\t\t/// </summary>\n\t\tvoid AdjustArrayAccessArguments(ResolveResult[] arguments)\n\t\t{\n\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\tif (!(TryConvert(ref arguments[i], compilation.FindType(KnownTypeCode.Int32)) ||\n\t\t\t\t      TryConvert(ref arguments[i], compilation.FindType(KnownTypeCode.UInt32)) ||\n\t\t\t\t      TryConvert(ref arguments[i], compilation.FindType(KnownTypeCode.Int64)) ||\n\t\t\t\t      TryConvert(ref arguments[i], compilation.FindType(KnownTypeCode.UInt64))))\n\t\t\t\t{\n\t\t\t\t\t// conversion failed\n\t\t\t\t\targuments[i] = Convert(arguments[i], compilation.FindType(KnownTypeCode.Int32), Conversion.None);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveObjectCreation\n\t\t/// <summary>\n\t\t/// Resolves an object creation.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">Type of the object to create.</param>\n\t\t/// <param name=\"arguments\">\n\t\t/// Arguments passed to the constructor.\n\t\t/// The resolver may mutate this array to wrap elements in <see cref=\"ConversionResolveResult\"/>s!\n\t\t/// </param>\n\t\t/// <param name=\"argumentNames\">\n\t\t/// The argument names. Pass the null string for positional arguments.\n\t\t/// </param>\n\t\t/// <param name=\"allowProtectedAccess\">\n\t\t/// Whether to allow calling protected constructors.\n\t\t/// This should be false except when resolving constructor initializers.\n\t\t/// </param>\n\t\t/// <param name=\"initializerStatements\">\n\t\t/// Statements for Objects/Collections initializer.\n\t\t/// <see cref=\"InvocationResolveResult.InitializerStatements\"/>\n\t\t/// </param>\n\t\t/// <returns>InvocationResolveResult or ErrorResolveResult</returns>\n\t\tpublic ResolveResult ResolveObjectCreation(IType type, ResolveResult[] arguments, string[] argumentNames = null, bool allowProtectedAccess = false, IList<ResolveResult> initializerStatements = null)\n\t\t{\n\t\t\tif (type.Kind == TypeKind.Delegate && arguments.Length == 1) {\n\t\t\t\tResolveResult input = arguments[0];\n\t\t\t\tIMethod invoke = input.Type.GetDelegateInvokeMethod();\n\t\t\t\tif (invoke != null) {\n\t\t\t\t\tinput = new MethodGroupResolveResult(\n\t\t\t\t\t\tinput, invoke.Name,\n\t\t\t\t\t\tmethods: new[] { new MethodListWithDeclaringType(invoke.DeclaringType) { invoke } },\n\t\t\t\t\t\ttypeArguments: EmptyList<IType>.Instance\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn Convert(input, type);\n\t\t\t}\n\t\t\tOverloadResolution or = CreateOverloadResolution(arguments, argumentNames);\n\t\t\tMemberLookup lookup = CreateMemberLookup();\n\t\t\tvar allApplicable = (arguments.Any(a => a.Type.Kind == TypeKind.Dynamic) ? new List<IMethod>() : null);\n\t\t\tforeach (IMethod ctor in type.GetConstructors()) {\n\t\t\t\tif (lookup.IsAccessible(ctor, allowProtectedAccess)) {\n\t\t\t\t\tvar orErrors = or.AddCandidate(ctor);\n\t\t\t\t\tif (allApplicable != null && OverloadResolution.IsApplicable(orErrors))\n\t\t\t\t\t\tallApplicable.Add(ctor);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tor.AddCandidate(ctor, OverloadResolutionErrors.Inaccessible);\n\t\t\t}\n\n\t\t\tif (allApplicable != null && allApplicable.Count > 1) {\n\t\t\t\t// If we have dynamic arguments, we need to represent the invocation as a dynamic invocation if there is more than one applicable constructor.\n\t\t\t\treturn new DynamicInvocationResolveResult(new MethodGroupResolveResult(null, allApplicable[0].Name, new[] { new MethodListWithDeclaringType(type, allApplicable) }, null), DynamicInvocationType.ObjectCreation, AddArgumentNamesIfNecessary(arguments, argumentNames), initializerStatements);\n\t\t\t}\n\n\t\t\tif (or.BestCandidate != null) {\n\t\t\t\treturn or.CreateResolveResult(null, initializerStatements);\n\t\t\t} else {\n\t\t\t\treturn new ErrorResolveResult(type);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveSizeOf\n\t\t/// <summary>\n\t\t/// Resolves 'sizeof(type)'.\n\t\t/// </summary>\n\t\tpublic ResolveResult ResolveSizeOf(IType type)\n\t\t{\n\t\t\tIType int32 = compilation.FindType(KnownTypeCode.Int32);\n\t\t\tint? size = null;\n\t\t\tvar typeForConstant = (type.Kind == TypeKind.Enum) ? type.GetDefinition().EnumUnderlyingType : type;\n\n\t\t\tswitch (ReflectionHelper.GetTypeCode(typeForConstant)) {\n\t\t\t\tcase TypeCode.Boolean:\n\t\t\t\tcase TypeCode.SByte:\n\t\t\t\tcase TypeCode.Byte:\n\t\t\t\t\tsize = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Char:\n\t\t\t\tcase TypeCode.Int16:\n\t\t\t\tcase TypeCode.UInt16:\n\t\t\t\t\tsize = 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Int32:\n\t\t\t\tcase TypeCode.UInt32:\n\t\t\t\tcase TypeCode.Single:\n\t\t\t\t\tsize = 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeCode.Int64:\n\t\t\t\tcase TypeCode.UInt64:\n\t\t\t\tcase TypeCode.Double:\n\t\t\t\t\tsize = 8;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn new SizeOfResolveResult(int32, type, size);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Resolve This/Base Reference\n\t\t/// <summary>\n\t\t/// Resolves 'this'.\n\t\t/// </summary>\n\t\tpublic ResolveResult ResolveThisReference()\n\t\t{\n\t\t\tITypeDefinition t = CurrentTypeDefinition;\n\t\t\tif (t != null) {\n\t\t\t\tif (t.TypeParameterCount != 0) {\n\t\t\t\t\t// Self-parameterize the type\n\t\t\t\t\treturn new ThisResolveResult(new ParameterizedType(t, t.TypeParameters));\n\t\t\t\t} else {\n\t\t\t\t\treturn new ThisResolveResult(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ErrorResult;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves 'base'.\n\t\t/// </summary>\n\t\tpublic ResolveResult ResolveBaseReference()\n\t\t{\n\t\t\tITypeDefinition t = CurrentTypeDefinition;\n\t\t\tif (t != null) {\n\t\t\t\tforeach (IType baseType in t.DirectBaseTypes) {\n\t\t\t\t\tif (baseType.Kind != TypeKind.Unknown && baseType.Kind != TypeKind.Interface) {\n\t\t\t\t\t\treturn new ThisResolveResult(baseType, causesNonVirtualInvocation: true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ErrorResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveConditional\n\t\t/// <summary>\n\t\t/// Converts the input to <c>bool</c> using the rules for boolean expressions.\n\t\t/// That is, <c>operator true</c> is used if a regular conversion to <c>bool</c> is not possible.\n\t\t/// </summary>\n\t\tpublic ResolveResult ResolveCondition(ResolveResult input)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\tthrow new ArgumentNullException(\"input\");\n\t\t\tIType boolean = compilation.FindType(KnownTypeCode.Boolean);\n\t\t\tConversion c = conversions.ImplicitConversion(input, boolean);\n\t\t\tif (!c.IsValid) {\n\t\t\t\tvar opTrue = input.Type.GetMethods(m => m.IsOperator && m.Name == \"op_True\").FirstOrDefault();\n\t\t\t\tif (opTrue != null) {\n\t\t\t\t\tc = Conversion.UserDefinedConversion(opTrue, isImplicit: true, conversionBeforeUserDefinedOperator: Conversion.None, conversionAfterUserDefinedOperator: Conversion.None);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Convert(input, boolean, c);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Converts the negated input to <c>bool</c> using the rules for boolean expressions.\n\t\t/// Computes <c>!(bool)input</c> if the implicit cast to bool is valid; otherwise\n\t\t/// computes <c>input.operator false()</c>.\n\t\t/// </summary>\n\t\tpublic ResolveResult ResolveConditionFalse(ResolveResult input)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\tthrow new ArgumentNullException(\"input\");\n\t\t\tIType boolean = compilation.FindType(KnownTypeCode.Boolean);\n\t\t\tConversion c = conversions.ImplicitConversion(input, boolean);\n\t\t\tif (!c.IsValid) {\n\t\t\t\tvar opFalse = input.Type.GetMethods(m => m.IsOperator && m.Name == \"op_False\").FirstOrDefault();\n\t\t\t\tif (opFalse != null) {\n\t\t\t\t\tc = Conversion.UserDefinedConversion(opFalse, isImplicit: true, conversionBeforeUserDefinedOperator: Conversion.None, conversionAfterUserDefinedOperator: Conversion.None);\n\t\t\t\t\treturn Convert(input, boolean, c);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ResolveUnaryOperator(UnaryOperatorType.Not, Convert(input, boolean, c));\n\t\t}\n\t\t\n\t\tpublic ResolveResult ResolveConditional(ResolveResult condition, ResolveResult trueExpression, ResolveResult falseExpression)\n\t\t{\n\t\t\t// C# 4.0 spec §7.14: Conditional operator\n\t\t\t\n\t\t\tbool isValid;\n\t\t\tIType resultType;\n\t\t\tif (trueExpression.Type.Kind == TypeKind.Dynamic || falseExpression.Type.Kind == TypeKind.Dynamic) {\n\t\t\t\tresultType = SpecialType.Dynamic;\n\t\t\t\tisValid = TryConvert(ref trueExpression, resultType) & TryConvert(ref falseExpression, resultType);\n\t\t\t} else if (HasType(trueExpression) && HasType(falseExpression)) {\n\t\t\t\tConversion t2f = conversions.ImplicitConversion(trueExpression, falseExpression.Type);\n\t\t\t\tConversion f2t = conversions.ImplicitConversion(falseExpression, trueExpression.Type);\n\t\t\t\t// The operator is valid:\n\t\t\t\t// a) if there's a conversion in one direction but not the other\n\t\t\t\t// b) if there are conversions in both directions, and the types are equivalent\n\t\t\t\tif (IsBetterConditionalConversion(t2f, f2t)) {\n\t\t\t\t\tresultType = falseExpression.Type;\n\t\t\t\t\tisValid = true;\n\t\t\t\t\ttrueExpression = Convert(trueExpression, resultType, t2f);\n\t\t\t\t} else if (IsBetterConditionalConversion(f2t, t2f)) {\n\t\t\t\t\tresultType = trueExpression.Type;\n\t\t\t\t\tisValid = true;\n\t\t\t\t\tfalseExpression = Convert(falseExpression, resultType, f2t);\n\t\t\t\t} else {\n\t\t\t\t\tresultType = trueExpression.Type;\n\t\t\t\t\tisValid = trueExpression.Type.Equals(falseExpression.Type);\n\t\t\t\t}\n\t\t\t} else if (HasType(trueExpression)) {\n\t\t\t\tresultType = trueExpression.Type;\n\t\t\t\tisValid = TryConvert(ref falseExpression, resultType);\n\t\t\t} else if (HasType(falseExpression)) {\n\t\t\t\tresultType = falseExpression.Type;\n\t\t\t\tisValid = TryConvert(ref trueExpression, resultType);\n\t\t\t} else {\n\t\t\t\treturn ErrorResult;\n\t\t\t}\n\t\t\tcondition = ResolveCondition(condition);\n\t\t\tif (isValid) {\n\t\t\t\tif (condition.IsCompileTimeConstant && trueExpression.IsCompileTimeConstant && falseExpression.IsCompileTimeConstant) {\n\t\t\t\t\tbool? val = condition.ConstantValue as bool?;\n\t\t\t\t\tif (val == true)\n\t\t\t\t\t\treturn trueExpression;\n\t\t\t\t\telse if (val == false)\n\t\t\t\t\t\treturn falseExpression;\n\t\t\t\t}\n\t\t\t\treturn new OperatorResolveResult(resultType, System.Linq.Expressions.ExpressionType.Conditional,\n\t\t\t\t                                 condition, trueExpression, falseExpression);\n\t\t\t} else {\n\t\t\t\treturn new ErrorResolveResult(resultType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsBetterConditionalConversion(Conversion c1, Conversion c2)\n\t\t{\n\t\t\t// Valid is better than ImplicitConstantExpressionConversion is better than invalid\n\t\t\tif (!c1.IsValid)\n\t\t\t\treturn false;\n\t\t\tif (c1 != Conversion.ImplicitConstantExpressionConversion && c2 == Conversion.ImplicitConstantExpressionConversion)\n\t\t\t\treturn true;\n\t\t\treturn !c2.IsValid;\n\t\t}\n\t\t\n\t\tbool HasType(ResolveResult r)\n\t\t{\n\t\t\treturn r.Type.Kind != TypeKind.Unknown && r.Type.Kind != TypeKind.Null;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolvePrimitive\n\t\tpublic ResolveResult ResolvePrimitive(object value)\n\t\t{\n\t\t\tif (value == null) {\n\t\t\t\treturn new ResolveResult(SpecialType.NullType);\n\t\t\t} else {\n\t\t\t\tTypeCode typeCode = Type.GetTypeCode(value.GetType());\n\t\t\t\tIType type = compilation.FindType(typeCode);\n\t\t\t\treturn new ConstantResolveResult(type, value);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveDefaultValue\n\t\tpublic ResolveResult ResolveDefaultValue(IType type)\n\t\t{\n\t\t\treturn new ConstantResolveResult(type, GetDefaultValue(type));\n\t\t}\n\t\t\n\t\tpublic static object GetDefaultValue(IType type)\n\t\t{\n\t\t\tITypeDefinition typeDef = type.GetDefinition();\n\t\t\tif (typeDef == null)\n\t\t\t\treturn null;\n\t\t\tif (typeDef.Kind == TypeKind.Enum) {\n\t\t\t\ttypeDef = typeDef.EnumUnderlyingType.GetDefinition();\n\t\t\t\tif (typeDef == null)\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\tswitch (typeDef.KnownTypeCode) {\n\t\t\t\tcase KnownTypeCode.Boolean:\n\t\t\t\t\treturn false;\n\t\t\t\tcase KnownTypeCode.Char:\n\t\t\t\t\treturn '\\0';\n\t\t\t\tcase KnownTypeCode.SByte:\n\t\t\t\t\treturn (sbyte)0;\n\t\t\t\tcase KnownTypeCode.Byte:\n\t\t\t\t\treturn (byte)0;\n\t\t\t\tcase KnownTypeCode.Int16:\n\t\t\t\t\treturn (short)0;\n\t\t\t\tcase KnownTypeCode.UInt16:\n\t\t\t\t\treturn (ushort)0;\n\t\t\t\tcase KnownTypeCode.Int32:\n\t\t\t\t\treturn 0;\n\t\t\t\tcase KnownTypeCode.UInt32:\n\t\t\t\t\treturn 0U;\n\t\t\t\tcase KnownTypeCode.Int64:\n\t\t\t\t\treturn 0L;\n\t\t\t\tcase KnownTypeCode.UInt64:\n\t\t\t\t\treturn 0UL;\n\t\t\t\tcase KnownTypeCode.Single:\n\t\t\t\t\treturn 0f;\n\t\t\t\tcase KnownTypeCode.Double:\n\t\t\t\t\treturn 0.0;\n\t\t\t\tcase KnownTypeCode.Decimal:\n\t\t\t\t\treturn 0m;\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResolveArrayCreation\n\t\t/// <summary>\n\t\t/// Resolves an array creation.\n\t\t/// </summary>\n\t\t/// <param name=\"elementType\">\n\t\t/// The array element type.\n\t\t/// Pass null to resolve an implicitly-typed array creation.\n\t\t/// </param>\n\t\t/// <param name=\"sizeArguments\">\n\t\t/// The size arguments.\n\t\t/// The length of this array will be used as the number of dimensions of the array type.\n\t\t/// Negative values will be treated as errors.\n\t\t/// </param>\n\t\t/// <param name=\"initializerElements\">\n\t\t/// The initializer elements. May be null if no array initializer was specified.\n\t\t/// The resolver may mutate this array to wrap elements in <see cref=\"ConversionResolveResult\"/>s!\n\t\t/// </param>\n\t\tpublic ArrayCreateResolveResult ResolveArrayCreation(IType elementType, int[] sizeArguments, ResolveResult[] initializerElements = null)\n\t\t{\n\t\t\tResolveResult[] sizeArgResults = new ResolveResult[sizeArguments.Length];\n\t\t\tfor (int i = 0; i < sizeArguments.Length; i++) {\n\t\t\t\tif (sizeArguments[i] < 0)\n\t\t\t\t\tsizeArgResults[i] = ErrorResolveResult.UnknownError;\n\t\t\t\telse\n\t\t\t\t\tsizeArgResults[i] = new ConstantResolveResult(compilation.FindType(KnownTypeCode.Int32), sizeArguments[i]);\n\t\t\t}\n\t\t\treturn ResolveArrayCreation(elementType, sizeArgResults, initializerElements);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves an array creation.\n\t\t/// </summary>\n\t\t/// <param name=\"elementType\">\n\t\t/// The array element type.\n\t\t/// Pass null to resolve an implicitly-typed array creation.\n\t\t/// </param>\n\t\t/// <param name=\"sizeArguments\">\n\t\t/// The size arguments.\n\t\t/// The length of this array will be used as the number of dimensions of the array type.\n\t\t/// The resolver may mutate this array to wrap elements in <see cref=\"ConversionResolveResult\"/>s!\n\t\t/// </param>\n\t\t/// <param name=\"initializerElements\">\n\t\t/// The initializer elements. May be null if no array initializer was specified.\n\t\t/// The resolver may mutate this array to wrap elements in <see cref=\"ConversionResolveResult\"/>s!\n\t\t/// </param>\n\t\tpublic ArrayCreateResolveResult ResolveArrayCreation(IType elementType, ResolveResult[] sizeArguments, ResolveResult[] initializerElements = null)\n\t\t{\n\t\t\tint dimensions = sizeArguments.Length;\n\t\t\tif (dimensions == 0)\n\t\t\t\tthrow new ArgumentException(\"sizeArguments.Length must not be 0\");\n\t\t\tif (elementType == null) {\n\t\t\t\tTypeInference typeInference = new TypeInference(compilation, conversions);\n\t\t\t\tbool success;\n\t\t\t\telementType = typeInference.GetBestCommonType(initializerElements, out success);\n\t\t\t}\n\t\t\tIType arrayType = new ArrayType(compilation, elementType, dimensions);\n\t\t\t\n\t\t\tAdjustArrayAccessArguments(sizeArguments);\n\t\t\t\n\t\t\tif (initializerElements != null) {\n\t\t\t\tfor (int i = 0; i < initializerElements.Length; i++) {\n\t\t\t\t\tinitializerElements[i] = Convert(initializerElements[i], elementType);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new ArrayCreateResolveResult(arrayType, sizeArguments, initializerElements);\n\t\t}\n\t\t#endregion\n\t\t\n\t\tpublic ResolveResult ResolveTypeOf(IType referencedType)\n\t\t{\n\t\t\treturn new TypeOfResolveResult(compilation.FindType(KnownTypeCode.Type), referencedType);\n\t\t}\n\t\t\n\t\t#region ResolveAssignment\n\t\tpublic ResolveResult ResolveAssignment(AssignmentOperatorType op, ResolveResult lhs, ResolveResult rhs)\n\t\t{\n\t\t\tvar linqOp = AssignmentExpression.GetLinqNodeType(op, this.CheckForOverflow);\n\t\t\tvar bop = AssignmentExpression.GetCorrespondingBinaryOperator(op);\n\t\t\tif (bop == null) {\n\t\t\t\treturn new OperatorResolveResult(lhs.Type, linqOp, lhs, this.Convert(rhs, lhs.Type));\n\t\t\t}\n\t\t\tResolveResult bopResult = ResolveBinaryOperator(bop.Value, lhs, rhs);\n\t\t\tOperatorResolveResult opResult = bopResult as OperatorResolveResult;\n\t\t\tif (opResult == null || opResult.Operands.Count != 2)\n\t\t\t\treturn bopResult;\n\t\t\treturn new OperatorResolveResult(lhs.Type, linqOp, opResult.UserDefinedOperatorMethod, opResult.IsLiftedOperator,\n\t\t\t                                 new [] { lhs, opResult.Operands[1] });\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CastResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents an explicitly applied conversion (CastExpression or AsExpression)\n\t/// (a result belonging to an AST node; not implicitly inserted 'between' nodes).\n\t/// </summary>\n\tclass CastResolveResult : ConversionResolveResult\n\t{\n\t\t// The reason this class exists is that for code like this:\n\t\t//    int i = ...;\n\t\t//    long n = 0;\n\t\t//    n = n + (long)i;\n\t\t// The resolver will produce (and process) an CastResolveResult for the cast,\n\t\t// (with Conversion = implicit numeric conversion)\n\t\t// and then pass it into CSharpResolver.ResolveBinaryOperator().\n\t\t// That method normally wraps input arguments into another conversion\n\t\t// (the implicit conversion applied by the operator).\n\t\t// However, identity conversions do not cause the creation of ConversionResolveResult instances,\n\t\t// so the OperatorResolveResult's argument will be the CastResolveResult\n\t\t// of the cast.\n\t\t// Without this class (and instead using ConversionResolveResult for both purposes),\n\t\t// it would be hard for the conversion-processing code\n\t\t// in the ResolveVisitor to distinguish the existing conversion from the CastExpression\n\t\t// from an implicit conversion introduced by the binary operator.\n\t\t// This would cause the conversion to be processed yet again.\n\t\t// The following unit tests would fail without this class:\n\t\t//  * CastTests.ExplicitConversion_In_Assignment\n\t\t//  * FindReferencesTest.FindReferencesForOpImplicitInAssignment_ExplicitCast\n\t\t//  * CS0029InvalidConversionIssueTests.ExplicitConversionFromUnknownType\n\t\t\n\t\tpublic CastResolveResult(ConversionResolveResult rr)\n\t\t\t: base(rr.Type, rr.Input, rr.Conversion, rr.CheckForOverflow)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic CastResolveResult(IType targetType, ResolveResult input, Conversion conversion, bool checkForOverflow)\n\t\t\t: base(targetType, input, conversion, checkForOverflow)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CompositeResolveVisitorNavigator.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\tpublic sealed class CompositeResolveVisitorNavigator : IResolveVisitorNavigator\n\t{\n\t\tIResolveVisitorNavigator[] navigators;\n\t\t\n\t\tpublic CompositeResolveVisitorNavigator(params IResolveVisitorNavigator[] navigators)\n\t\t{\n\t\t\tif (navigators == null)\n\t\t\t\tthrow new ArgumentNullException(\"navigators\");\n\t\t\tthis.navigators = navigators;\n\t\t\tforeach (var n in navigators) {\n\t\t\t\tif (n == null)\n\t\t\t\t\tthrow new ArgumentException(\"Array must not contain nulls.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t{\n\t\t\tbool needsScan = false;\n\t\t\tforeach (var navigator in navigators) {\n\t\t\t\tResolveVisitorNavigationMode mode = navigator.Scan(node);\n\t\t\t\tif (mode == ResolveVisitorNavigationMode.Resolve)\n\t\t\t\t\treturn mode; // resolve has highest priority\n\t\t\t\telse if (mode == ResolveVisitorNavigationMode.Scan)\n\t\t\t\t\tneedsScan = true;\n\t\t\t}\n\t\t\treturn needsScan ? ResolveVisitorNavigationMode.Scan : ResolveVisitorNavigationMode.Skip;\n\t\t}\n\t\t\n\t\tpublic void Resolved(AstNode node, ResolveResult result)\n\t\t{\n\t\t\tforeach (var navigator in navigators) {\n\t\t\t\tnavigator.Resolved(node, result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t{\n\t\t\tforeach (var navigator in navigators) {\n\t\t\t\tnavigator.ProcessConversion(expression, result, conversion, targetType);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/DetectSkippableNodesNavigator.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// When an <see cref=\"IResolveVisitorNavigator\"/> is searching for specific nodes\n\t/// (e.g. all IdentifierExpressions), it has to scan the whole syntax tree for those nodes.\n\t/// However, scanning in the ResolveVisitor is expensive (e.g. any lambda that is scanned must be resolved),\n\t/// so it makes sense to detect when a whole subtree is scan-only, and skip that tree instead.\n\t/// \n\t/// The DetectSkippableNodesNavigator performs this job by running the input IResolveVisitorNavigator\n\t/// over the whole AST, and detecting subtrees that are scan-only, and replaces them with Skip.\n\t/// </summary>\n\tpublic sealed class DetectSkippableNodesNavigator : IResolveVisitorNavigator\n\t{\n\t\treadonly Dictionary<AstNode, ResolveVisitorNavigationMode> dict = new Dictionary<AstNode, ResolveVisitorNavigationMode>();\n\t\tIResolveVisitorNavigator navigator;\n\t\t\n\t\tpublic DetectSkippableNodesNavigator(IResolveVisitorNavigator navigator, AstNode root)\n\t\t{\n\t\t\tthis.navigator = navigator;\n\t\t\tInit(root);\n\t\t}\n\t\t\n\t\tbool Init(AstNode node)\n\t\t{\n\t\t\tvar mode = navigator.Scan(node);\n\t\t\tif (mode == ResolveVisitorNavigationMode.Skip)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tbool needsResolve = (mode != ResolveVisitorNavigationMode.Scan);\n\t\t\t\n\t\t\tfor (AstNode child = node.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\tneedsResolve |= Init(child);\n\t\t\t}\n\t\t\t\n\t\t\tif (needsResolve) {\n\t\t\t\t// If this node or any child node needs resolving, store the mode in the dictionary.\n\t\t\t\tdict.Add(node, mode);\n\t\t\t}\n\t\t\treturn needsResolve;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t{\n\t\t\tResolveVisitorNavigationMode mode;\n\t\t\tif (dict.TryGetValue(node, out mode)) {\n\t\t\t\treturn mode;\n\t\t\t} else {\n\t\t\t\treturn ResolveVisitorNavigationMode.Skip;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void Resolved(AstNode node, ResolveResult result)\n\t\t{\n\t\t\tnavigator.Resolved(node, result);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t{\n\t\t\tnavigator.ProcessConversion(expression, result, conversion, targetType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/DynamicInvocationResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\tpublic enum DynamicInvocationType {\n\t\t/// <summary>\n\t\t/// The invocation is a normal invocation ( 'a(b)' ).\n\t\t/// </summary>\n\t\tInvocation,\n\n\t\t/// <summary>\n\t\t/// The invocation is an indexing ( 'a[b]' ).\n\t\t/// </summary>\n\t\tIndexing,\n\n\t\t/// <summary>\n\t\t/// The invocation is an object creation ( 'new a(b)' ). Also used when invoking a base constructor ( ' : base(a) ' ) and chaining constructors ( ' : this(a) ').\n\t\t/// </summary>\n\t\tObjectCreation,\n\t}\n\n\t/// <summary>\n\t/// Represents the result of an invocation of a member of a dynamic object.\n\t/// </summary>\n\tpublic class DynamicInvocationResolveResult : ResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// Target of the invocation. Can be a dynamic expression or a <see cref=\"MethodGroupResolveResult\"/>.\n\t\t/// </summary>\n\t\tpublic readonly ResolveResult Target;\n\n\t\t/// <summary>\n\t\t/// Type of the invocation.\n\t\t/// </summary>\n\t\tpublic readonly DynamicInvocationType InvocationType;\n\n\t\t/// <summary>\n\t\t/// Arguments for the call. Named arguments will be instances of <see cref=\"NamedArgumentResolveResult\"/>.\n\t\t/// </summary>\n\t\tpublic readonly IList<ResolveResult> Arguments; \n\n\t\t/// <summary>\n\t\t/// Gets the list of initializer statements that are appplied to the result of this invocation.\n\t\t/// This is used to represent object and collection initializers.\n\t\t/// With the initializer statements, the <see cref=\"InitializedObjectResolveResult\"/> is used\n\t\t/// to refer to the result of this invocation.\n\t\t/// Initializer statements can only exist if the <see cref=\"InvocationType\"/> is <see cref=\"DynamicInvocationType.ObjectCreation\"/>.\n\t\t/// </summary>\n\t\tpublic readonly IList<ResolveResult> InitializerStatements;\n\n\t\tpublic DynamicInvocationResolveResult(ResolveResult target, DynamicInvocationType invocationType, IList<ResolveResult> arguments, IList<ResolveResult> initializerStatements = null) : base(SpecialType.Dynamic) {\n\t\t\tthis.Target                = target;\n\t\t\tthis.InvocationType        = invocationType;\n\t\t\tthis.Arguments             = arguments ?? EmptyList<ResolveResult>.Instance;\n\t\t\tthis.InitializerStatements = initializerStatements ?? EmptyList<ResolveResult>.Instance;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[Dynamic invocation ]\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/DynamicMemberResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents the result of an access to a member of a dynamic object.\n\t/// </summary>\n\tpublic class DynamicMemberResolveResult : ResolveResult\n\t{\n\t\t/// <summary>\n\t\t/// Target of the member access (a dynamic object).\n\t\t/// </summary>\n\t\tpublic readonly ResolveResult Target;\n\n\t\t/// <summary>\n\t\t/// Name of the accessed member.\n\t\t/// </summary>\n\t\tpublic readonly string Member;\n\n\t\tpublic DynamicMemberResolveResult(ResolveResult target, string member) : base(SpecialType.Dynamic) {\n\t\t\tthis.Target = target;\n\t\t\tthis.Member = member;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[Dynamic member '{0}']\", Member);\n\t\t}\n\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults() {\n\t\t\treturn new[] { Target };\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferenceSearchScope.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents a scope in which references are searched.\n\t/// </summary>\n\tpublic interface IFindReferenceSearchScope\n\t{\n\t\t/// <summary>\n\t\t/// Gets the compilation in which the entity being search for was defined.\n\t\t/// This is not necessarily the same compilation as is being searched in.\n\t\t/// </summary>\n\t\tICompilation Compilation { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the search term. Only files that contain this identifier need to be parsed.\n\t\t/// Can return null if all files need to be parsed.\n\t\t/// </summary>\n\t\tstring SearchTerm { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the accessibility that defines the search scope.\n\t\t/// </summary>\n\t\tAccessibility Accessibility { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the top-level entity that defines the search scope.\n\t\t/// </summary>\n\t\tITypeDefinition TopLevelTypeDefinition { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the file name that defines the search scope.\n\t\t/// If null, all files are searched.\n\t\t/// </summary>\n\t\tstring FileName { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a navigator that can find references to this entity and reports\n\t\t/// them to the specified callback.\n\t\t/// </summary>\n\t\tIResolveVisitorNavigator GetNavigator(ICompilation compilation, FoundReferenceCallback callback);\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferencedEntities.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Find all entities that are referenced in the scanned AST.\n\t/// </summary>\n\tpublic sealed class FindReferencedEntities : IResolveVisitorNavigator\n\t{\n\t\treadonly Action<AstNode, IMember> memberReferenceFound;\n\t\treadonly Action<AstNode, IType> typeReferenceFound;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new FindReferencedEntities instance that\n\t\t/// looks for entity definitions.\n\t\t/// The visitor will report type definitions and member definitions (not specialized members).\n\t\t/// </summary>\n\t\tpublic FindReferencedEntities(Action<AstNode, IEntity> referenceFound)\n\t\t{\n\t\t\tif (referenceFound == null)\n\t\t\t\tthrow new ArgumentNullException(\"referenceFound\");\n\t\t\tthis.memberReferenceFound = (node, member) => referenceFound(node, member.MemberDefinition);\n\t\t\tthis.typeReferenceFound = (node, type) => {\n\t\t\t\tvar def = type.GetDefinition();\n\t\t\t\tif (def != null)\n\t\t\t\t\treferenceFound(node, def);\n\t\t\t};\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new FindReferencedEntities instance that\n\t\t/// looks for types and members.\n\t\t/// The visitor will report parameterized types and potentially specialized members.\n\t\t/// </summary>\n\t\tpublic FindReferencedEntities(Action<AstNode, IType> typeReferenceFound, Action<AstNode, IMember> memberReferenceFound)\n\t\t{\n\t\t\tif (typeReferenceFound == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeReferenceFound\");\n\t\t\tif (memberReferenceFound == null)\n\t\t\t\tthrow new ArgumentNullException(\"memberReferenceFound\");\n\t\t\tthis.typeReferenceFound = typeReferenceFound;\n\t\t\tthis.memberReferenceFound = memberReferenceFound;\n\t\t}\n\t\t\n\t\tpublic ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t{\n\t\t\treturn ResolveVisitorNavigationMode.Resolve;\n\t\t}\n\t\t\n\t\tpublic void Resolved(AstNode node, ResolveResult result)\n\t\t{\n\t\t\tif (ParenthesizedExpression.ActsAsParenthesizedExpression(node))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tMemberResolveResult mrr = result as MemberResolveResult;\n\t\t\tif (mrr != null) {\n\t\t\t\tmemberReferenceFound(node, mrr.Member);\n\t\t\t}\n\t\t\tTypeResolveResult trr = result as TypeResolveResult;\n\t\t\tif (trr != null) {\n\t\t\t\ttypeReferenceFound(node, trr.Type);\n\t\t\t}\n\t\t\tForEachResolveResult ferr = result as ForEachResolveResult;\n\t\t\tif (ferr != null) {\n\t\t\t\tResolved(node, ferr.GetEnumeratorCall);\n\t\t\t\tif (ferr.CurrentProperty != null)\n\t\t\t\t\tmemberReferenceFound(node, ferr.CurrentProperty);\n\t\t\t\tif (ferr.MoveNextMethod != null)\n\t\t\t\t\tmemberReferenceFound(node, ferr.MoveNextMethod);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t{\n\t\t\tif (conversion.IsUserDefined || conversion.IsMethodGroupConversion) {\n\t\t\t\tmemberReferenceFound(expression, conversion.Method);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferences.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\tpublic delegate void FoundReferenceCallback(AstNode astNode, ResolveResult result);\n\t\n\t/// <summary>\n\t/// 'Find references' implementation.\n\t/// </summary>\n\t/// <remarks>\n\t/// This class is thread-safe.\n\t/// The intended multi-threaded usage is to call GetSearchScopes() once, and then\n\t/// call FindReferencesInFile() concurrently on multiple threads (parallel foreach over all interesting files).\n\t/// </remarks>\n\tpublic sealed class FindReferences\n\t{\n\t\t#region Properties\n\t\t/// <summary>\n\t\t/// Specifies whether to find type references even if an alias is being used.\n\t\t/// Aliases may be <c>var</c> or <c>using Alias = ...;</c>.\n\t\t/// </summary>\n\t\tpublic bool FindTypeReferencesEvenIfAliased { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Specifies whether find references should only look for specialized matches\n\t\t/// with equal type parameter substitution to the member we are searching for.\n\t\t/// </summary>\n\t\tpublic bool FindOnlySpecializedReferences { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// If this option is enabled, find references on a overridden member\n\t\t/// will find calls to the base member.\n\t\t/// </summary>\n\t\tpublic bool FindCallsThroughVirtualBaseMethod { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// If this option is enabled, find references on a member implementing\n\t\t/// an interface will also find calls to the interface.\n\t\t/// </summary>\n\t\tpublic bool FindCallsThroughInterface { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// If this option is enabled, find references will look for all references\n\t\t/// to the virtual method slot.\n\t\t/// </summary>\n\t\tpublic bool WholeVirtualSlot { get; set; }\n\t\t\n\t\t//public bool FindAllOverloads { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Specifies whether to look for references in documentation comments.\n\t\t/// This will find entity references in <c>cref</c> attributes and\n\t\t/// parameter references in <c>&lt;param&gt;</c> and <c>&lt;paramref&gt;</c> tags.\n\t\t/// TODO: implement this feature.\n\t\t/// </summary>\n\t\tpublic bool SearchInDocumentationComments { get; set; }\n\t\t#endregion\n\t\t\n\t\t#region GetEffectiveAccessibility\n\t\t/// <summary>\n\t\t/// Gets the effective accessibility of the specified entity -\n\t\t/// that is, the accessibility viewed from the top level.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// internal member in public class -> internal\n\t\t/// public member in internal class -> internal\n\t\t/// protected member in public class -> protected\n\t\t/// protected member in internal class -> protected and internal\n\t\t/// </remarks>\n\t\tpublic static Accessibility GetEffectiveAccessibility(IEntity entity)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\tAccessibility a = entity.Accessibility;\n\t\t\tfor (ITypeDefinition declType = entity.DeclaringTypeDefinition; declType != null; declType = declType.DeclaringTypeDefinition) {\n\t\t\t\ta = MergeAccessibility(declType.Accessibility, a);\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t\t\n\t\tstatic Accessibility MergeAccessibility(Accessibility outer, Accessibility inner)\n\t\t{\n\t\t\tif (outer == inner)\n\t\t\t\treturn inner;\n\t\t\tif (outer == Accessibility.None || inner == Accessibility.None)\n\t\t\t\treturn Accessibility.None;\n\t\t\tif (outer == Accessibility.Private || inner == Accessibility.Private)\n\t\t\t\treturn Accessibility.Private;\n\t\t\tif (outer == Accessibility.Public)\n\t\t\t\treturn inner;\n\t\t\tif (inner == Accessibility.Public)\n\t\t\t\treturn outer;\n\t\t\t// Inner and outer are both in { protected, internal, protected and internal, protected or internal }\n\t\t\t// (but they aren't both the same)\n\t\t\tif (outer == Accessibility.ProtectedOrInternal)\n\t\t\t\treturn inner;\n\t\t\tif (inner == Accessibility.ProtectedOrInternal)\n\t\t\t\treturn outer;\n\t\t\t// Inner and outer are both in { protected, internal, protected and internal },\n\t\t\t// but aren't both the same, so the result is protected and internal.\n\t\t\treturn Accessibility.ProtectedAndInternal;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region class SearchScope\n\t\tsealed class SearchScope : IFindReferenceSearchScope\n\t\t{\n\t\t\treadonly Func<ICompilation, FindReferenceNavigator> factory;\n\t\t\t\n\t\t\tpublic SearchScope(Func<ICompilation, FindReferenceNavigator> factory)\n\t\t\t{\n\t\t\t\tthis.factory = factory;\n\t\t\t}\n\t\t\t\n\t\t\tpublic SearchScope(string searchTerm, Func<ICompilation, FindReferenceNavigator> factory)\n\t\t\t{\n\t\t\t\tthis.searchTerm = searchTerm;\n\t\t\t\tthis.factory = factory;\n\t\t\t}\n\t\t\t\n\t\t\tinternal string searchTerm;\n\t\t\tinternal FindReferences findReferences;\n\t\t\tinternal ICompilation declarationCompilation;\n\t\t\tinternal Accessibility accessibility;\n\t\t\tinternal ITypeDefinition topLevelTypeDefinition;\n\t\t\tinternal string fileName;\n\t\t\t\n\t\t\tIResolveVisitorNavigator IFindReferenceSearchScope.GetNavigator(ICompilation compilation, FoundReferenceCallback callback)\n\t\t\t{\n\t\t\t\tFindReferenceNavigator n = factory(compilation);\n\t\t\t\tif (n != null) {\n\t\t\t\t\tn.callback = callback;\n\t\t\t\t\tn.findReferences = findReferences;\n\t\t\t\t\treturn n;\n\t\t\t\t} else {\n\t\t\t\t\treturn new ConstantModeResolveVisitorNavigator(ResolveVisitorNavigationMode.Skip, null);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tICompilation IFindReferenceSearchScope.Compilation {\n\t\t\t\tget { return declarationCompilation; }\n\t\t\t}\n\t\t\t\n\t\t\tstring IFindReferenceSearchScope.SearchTerm {\n\t\t\t\tget { return searchTerm; }\n\t\t\t}\n\t\t\t\n\t\t\tAccessibility IFindReferenceSearchScope.Accessibility {\n\t\t\t\tget { return accessibility; }\n\t\t\t}\n\t\t\t\n\t\t\tITypeDefinition IFindReferenceSearchScope.TopLevelTypeDefinition {\n\t\t\t\tget { return topLevelTypeDefinition; }\n\t\t\t}\n\t\t\t\n\t\t\tstring IFindReferenceSearchScope.FileName {\n\t\t\t\tget { return fileName; }\n\t\t\t}\n\t\t}\n\t\t\n\t\tabstract class FindReferenceNavigator : IResolveVisitorNavigator\n\t\t{\n\t\t\tinternal FoundReferenceCallback callback;\n\t\t\tinternal FindReferences findReferences;\n\t\t\t\n\t\t\tinternal abstract bool CanMatch(AstNode node);\n\t\t\tinternal abstract bool IsMatch(ResolveResult rr);\n\t\t\t\n\t\t\tResolveVisitorNavigationMode IResolveVisitorNavigator.Scan(AstNode node)\n\t\t\t{\n\t\t\t\tif (CanMatch(node))\n\t\t\t\t\treturn ResolveVisitorNavigationMode.Resolve;\n\t\t\t\telse\n\t\t\t\t\treturn ResolveVisitorNavigationMode.Scan;\n\t\t\t}\n\t\t\t\n\t\t\tvoid IResolveVisitorNavigator.Resolved(AstNode node, ResolveResult result)\n\t\t\t{\n\t\t\t\tif (CanMatch(node) && IsMatch(result)) {\n\t\t\t\t\tReportMatch(node, result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tprotected void ReportMatch(AstNode node, ResolveResult result)\n\t\t\t{\n\t\t\t\tif (callback != null)\n\t\t\t\t\tcallback(node, result);\n\t\t\t}\n\t\t\t\n\t\t\tinternal virtual void NavigatorDone(CSharpAstResolver resolver, CancellationToken cancellationToken)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetSearchScopes\n\t\tpublic IList<IFindReferenceSearchScope> GetSearchScopes(ISymbol symbol)\n\t\t{\n\t\t\tif (symbol == null)\n\t\t\t\tthrow new ArgumentNullException(\"symbol\");\n\t\t\tswitch (symbol.SymbolKind) {\n\t\t\t\tcase SymbolKind.Namespace:\n\t\t\t\t\treturn new[] { GetSearchScopeForNamespace((INamespace)symbol) };\n\t\t\t\tcase SymbolKind.TypeParameter:\n\t\t\t\t\treturn new[] { GetSearchScopeForTypeParameter((ITypeParameter)symbol) };\n\t\t\t}\n\t\t\tSearchScope scope;\n\t\t\tSearchScope additionalScope = null;\n\t\t\tIEntity entity = null;\n\n\t\t\tif (symbol.SymbolKind == SymbolKind.Variable) {\n\t\t\t\tvar variable = (IVariable) symbol;\n\t\t\t\tscope = GetSearchScopeForLocalVariable(variable);\n\t\t\t} else if (symbol.SymbolKind == SymbolKind.Parameter) {\n\t\t\t\tvar par = (IParameter)symbol;\n\t\t\t\tscope = GetSearchScopeForParameter(par);\n\t\t\t\tentity = par.Owner;\n\t\t\t} else {\n\t\t\t\tentity = symbol as IEntity;\n\t\t\t\tif (entity == null)\n\t\t\t\t\tthrow new NotSupportedException(\"Unsupported symbol type\");\n\t\t\t\tif (entity is IMember)\n\t\t\t\t\tentity = NormalizeMember((IMember)entity);\n\t\t\t\tswitch (entity.SymbolKind) {\n\t\t\t\t\tcase SymbolKind.TypeDefinition:\n\t\t\t\t\t\tscope = FindTypeDefinitionReferences((ITypeDefinition)entity, this.FindTypeReferencesEvenIfAliased, out additionalScope);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\t\tif (entity.DeclaringTypeDefinition != null && entity.DeclaringTypeDefinition.Kind == TypeKind.Enum)\n\t\t\t\t\t\t\tscope = FindMemberReferences(entity, m => new FindEnumMemberReferences((IField)m));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tscope = FindMemberReferences(entity, m => new FindFieldReferences((IField)m));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Property:\n\t\t\t\t\t\tscope = FindMemberReferences(entity, m => new FindPropertyReferences((IProperty)m));\n\t\t\t\t\t\tif (entity.Name == \"Current\")\n\t\t\t\t\t\t\tadditionalScope = FindEnumeratorCurrentReferences((IProperty)entity);\n\t\t\t\t\t\telse if (entity.Name == \"IsCompleted\")\n\t\t\t\t\t\t\tadditionalScope = FindAwaiterIsCompletedReferences((IProperty)entity);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Event:\n\t\t\t\t\t\tscope = FindMemberReferences(entity, m => new FindEventReferences((IEvent)m));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Method:\n\t\t\t\t\t\tscope = GetSearchScopeForMethod((IMethod)entity);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Indexer:\n\t\t\t\t\t\tscope = FindIndexerReferences((IProperty)entity);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Operator:\n\t\t\t\t\t\tscope = GetSearchScopeForOperator((IMethod)entity);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Constructor:\n\t\t\t\t\t\tIMethod ctor = (IMethod)entity;\n\t\t\t\t\t\tscope = FindObjectCreateReferences(ctor);\n\t\t\t\t\t\tadditionalScope = FindChainedConstructorReferences(ctor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SymbolKind.Destructor:\n\t\t\t\t\t\tscope = GetSearchScopeForDestructor((IMethod)entity);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new ArgumentException(\"Unknown entity type \" + entity.SymbolKind);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar effectiveAccessibility = entity != null ? GetEffectiveAccessibility(entity) : Accessibility.Private;\n\t\t\tvar topLevelTypeDefinition = GetTopLevelTypeDefinition(entity);\n\n\t\t\tif (scope.accessibility == Accessibility.None)\n\t\t\t\tscope.accessibility = effectiveAccessibility;\n\t\t\tscope.declarationCompilation = entity != null ? entity.Compilation : null;\n\t\t\tscope.topLevelTypeDefinition = topLevelTypeDefinition;\n\t\t\tscope.findReferences = this;\n\t\t\tif (additionalScope != null) {\n\t\t\t\tif (additionalScope.accessibility == Accessibility.None)\n\t\t\t\t\tadditionalScope.accessibility = effectiveAccessibility;\n\t\t\t\tadditionalScope.declarationCompilation = scope.declarationCompilation;\n\t\t\t\tadditionalScope.topLevelTypeDefinition = topLevelTypeDefinition;\n\t\t\t\tadditionalScope.findReferences = this;\n\t\t\t\treturn new[] { scope, additionalScope };\n\t\t\t} else {\n\t\t\t\treturn new[] { scope };\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<IFindReferenceSearchScope> GetSearchScopes(IEnumerable<ISymbol> symbols)\n\t\t{\n\t\t\tif (symbols == null)\n\t\t\t\tthrow new ArgumentNullException(\"symbols\");\n\t\t\treturn symbols.SelectMany(GetSearchScopes).ToList();\n\t\t}\n\t\t\n\t\tstatic ITypeDefinition GetTopLevelTypeDefinition(IEntity entity)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\treturn null;\n\t\t\tITypeDefinition topLevelTypeDefinition = entity.DeclaringTypeDefinition;\n\t\t\twhile (topLevelTypeDefinition != null && topLevelTypeDefinition.DeclaringTypeDefinition != null)\n\t\t\t\ttopLevelTypeDefinition = topLevelTypeDefinition.DeclaringTypeDefinition;\n\t\t\treturn topLevelTypeDefinition;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetInterestingFileNames\n\t\t/// <summary>\n\t\t/// Gets the file names that possibly contain references to the element being searched for.\n\t\t/// </summary>\n\t\tpublic IEnumerable<CSharpUnresolvedFile> GetInterestingFiles(IFindReferenceSearchScope searchScope, ICompilation compilation)\n\t\t{\n\t\t\tif (searchScope == null)\n\t\t\t\tthrow new ArgumentNullException(\"searchScope\");\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tvar pc = compilation.MainAssembly.UnresolvedAssembly as IProjectContent;\n\t\t\tif (pc == null)\n\t\t\t\tthrow new ArgumentException(\"Main assembly is not a project content\");\n\t\t\tif (searchScope.TopLevelTypeDefinition != null) {\n\t\t\t\tITypeDefinition topLevelTypeDef = compilation.Import(searchScope.TopLevelTypeDefinition);\n\t\t\t\tif (topLevelTypeDef == null) {\n\t\t\t\t\t// This compilation cannot have references to the target entity.\n\t\t\t\t\treturn EmptyList<CSharpUnresolvedFile>.Instance;\n\t\t\t\t}\n\t\t\t\tswitch (searchScope.Accessibility) {\n\t\t\t\t\tcase Accessibility.None:\n\t\t\t\t\tcase Accessibility.Private:\n\t\t\t\t\t\tif (topLevelTypeDef.ParentAssembly == compilation.MainAssembly)\n\t\t\t\t\t\t\treturn topLevelTypeDef.Parts.Select(p => p.UnresolvedFile).OfType<CSharpUnresolvedFile>().Distinct();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn EmptyList<CSharpUnresolvedFile>.Instance;\n\t\t\t\t\tcase Accessibility.Protected:\n\t\t\t\t\t\treturn GetInterestingFilesProtected(topLevelTypeDef);\n\t\t\t\t\tcase Accessibility.Internal:\n\t\t\t\t\t\tif (topLevelTypeDef.ParentAssembly.InternalsVisibleTo(compilation.MainAssembly))\n\t\t\t\t\t\t\treturn pc.Files.OfType<CSharpUnresolvedFile>();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn EmptyList<CSharpUnresolvedFile>.Instance;\n\t\t\t\t\tcase Accessibility.ProtectedAndInternal:\n\t\t\t\t\t\tif (topLevelTypeDef.ParentAssembly.InternalsVisibleTo(compilation.MainAssembly))\n\t\t\t\t\t\t\treturn GetInterestingFilesProtected(topLevelTypeDef);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn EmptyList<CSharpUnresolvedFile>.Instance;\n\t\t\t\t\tcase Accessibility.ProtectedOrInternal:\n\t\t\t\t\t\tif (topLevelTypeDef.ParentAssembly.InternalsVisibleTo(compilation.MainAssembly))\n\t\t\t\t\t\t\treturn pc.Files.OfType<CSharpUnresolvedFile>();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn GetInterestingFilesProtected(topLevelTypeDef);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn pc.Files.OfType<CSharpUnresolvedFile>();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (searchScope.FileName == null)\n\t\t\t\t\treturn pc.Files.OfType<CSharpUnresolvedFile>();\n\t\t\t\telse\n\t\t\t\t\treturn pc.Files.OfType<CSharpUnresolvedFile>().Where(f => f.FileName == searchScope.FileName);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIEnumerable<CSharpUnresolvedFile> GetInterestingFilesProtected(ITypeDefinition referencedTypeDefinition)\n\t\t{\n\t\t\treturn (from typeDef in referencedTypeDefinition.Compilation.MainAssembly.GetAllTypeDefinitions()\n\t\t\t        where typeDef.IsDerivedFrom(referencedTypeDefinition)\n\t\t\t        from part in typeDef.Parts\n\t\t\t        select part.UnresolvedFile\n\t\t\t       ).OfType<CSharpUnresolvedFile>().Distinct();\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region FindReferencesInFile\n\t\t/// <summary>\n\t\t/// Finds all references in the given file.\n\t\t/// </summary>\n\t\t/// <param name=\"searchScope\">The search scope for which to look.</param>\n\t\t/// <param name=\"resolver\">AST resolver for the file to search in.</param>\n\t\t/// <param name=\"callback\">Callback used to report the references that were found.</param>\n\t\t/// <param name=\"cancellationToken\">CancellationToken that may be used to cancel the operation.</param>\n\t\tpublic void FindReferencesInFile(IFindReferenceSearchScope searchScope, CSharpAstResolver resolver,\n\t\t                                 FoundReferenceCallback callback, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\tFindReferencesInFile(searchScope, resolver.UnresolvedFile, (SyntaxTree)resolver.RootNode, resolver.Compilation, callback, cancellationToken);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Finds all references in the given file.\n\t\t/// </summary>\n\t\t/// <param name=\"searchScopes\">The search scopes for which to look.</param>\n\t\t/// <param name=\"resolver\">AST resolver for the file to search in.</param>\n\t\t/// <param name=\"callback\">Callback used to report the references that were found.</param>\n\t\t/// <param name=\"cancellationToken\">CancellationToken that may be used to cancel the operation.</param>\n\t\tpublic void FindReferencesInFile(IList<IFindReferenceSearchScope> searchScopes, CSharpAstResolver resolver,\n\t\t                                 FoundReferenceCallback callback, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\tFindReferencesInFile(searchScopes, resolver.UnresolvedFile, (SyntaxTree)resolver.RootNode, resolver.Compilation, callback, cancellationToken);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Finds all references in the given file.\n\t\t/// </summary>\n\t\t/// <param name=\"searchScope\">The search scope for which to look.</param>\n\t\t/// <param name=\"unresolvedFile\">The type system representation of the file being searched.</param>\n\t\t/// <param name=\"syntaxTree\">The syntax tree of the file being searched.</param>\n\t\t/// <param name=\"compilation\">The compilation for the project that contains the file.</param>\n\t\t/// <param name=\"callback\">Callback used to report the references that were found.</param>\n\t\t/// <param name=\"cancellationToken\">CancellationToken that may be used to cancel the operation.</param>\n\t\tpublic void FindReferencesInFile(IFindReferenceSearchScope searchScope, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree,\n\t\t                                 ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (searchScope == null)\n\t\t\t\tthrow new ArgumentNullException(\"searchScope\");\n\t\t\tFindReferencesInFile(new[] { searchScope }, unresolvedFile, syntaxTree, compilation, callback, cancellationToken);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Finds all references in the given file.\n\t\t/// </summary>\n\t\t/// <param name=\"searchScopes\">The search scopes for which to look.</param>\n\t\t/// <param name=\"unresolvedFile\">The type system representation of the file being searched.</param>\n\t\t/// <param name=\"syntaxTree\">The syntax tree of the file being searched.</param>\n\t\t/// <param name=\"compilation\">The compilation for the project that contains the file.</param>\n\t\t/// <param name=\"callback\">Callback used to report the references that were found.</param>\n\t\t/// <param name=\"cancellationToken\">CancellationToken that may be used to cancel the operation.</param>\n\t\tpublic void FindReferencesInFile(IList<IFindReferenceSearchScope> searchScopes, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree,\n\t\t                                 ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (searchScopes == null)\n\t\t\t\tthrow new ArgumentNullException(\"searchScopes\");\n\t\t\tif (syntaxTree == null)\n\t\t\t\tthrow new ArgumentNullException(\"syntaxTree\");\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (callback == null)\n\t\t\t\tthrow new ArgumentNullException(\"callback\");\n\t\t\t\n\t\t\tif (searchScopes.Count == 0)\n\t\t\t\treturn;\n\t\t\tvar navigators = new IResolveVisitorNavigator[searchScopes.Count];\n\t\t\tfor (int i = 0; i < navigators.Length; i++) {\n\t\t\t\tnavigators[i] = searchScopes[i].GetNavigator(compilation, callback);\n\t\t\t}\n\t\t\tIResolveVisitorNavigator combinedNavigator;\n\t\t\tif (searchScopes.Count == 1) {\n\t\t\t\tcombinedNavigator = navigators[0];\n\t\t\t} else {\n\t\t\t\tcombinedNavigator = new CompositeResolveVisitorNavigator(navigators);\n\t\t\t}\n\t\t\t\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\tcombinedNavigator = new DetectSkippableNodesNavigator(combinedNavigator, syntaxTree);\n\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(compilation, syntaxTree, unresolvedFile);\n\t\t\tresolver.ApplyNavigator(combinedNavigator, cancellationToken);\n\t\t\tforeach (var n in navigators) {\n\t\t\t\tvar frn = n as FindReferenceNavigator;\n\t\t\t\tif (frn != null)\n\t\t\t\t\tfrn.NavigatorDone(resolver, cancellationToken);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region RenameReferencesInFile\n\n\t\tpublic static AstNode GetNodeToReplace(AstNode node)\n\t\t{\n\t\t\tif (node is ConstructorInitializer)\n\t\t\t\treturn null;\n\t\t\tif (node is ObjectCreateExpression)\n\t\t\t\tnode = ((ObjectCreateExpression)node).Type;\n\n\t\t\tif (node is InvocationExpression)\n\t\t\t\tnode = ((InvocationExpression)node).Target;\n\n\t\t\tif (node is MemberReferenceExpression)\n\t\t\t\tnode = ((MemberReferenceExpression)node).MemberNameToken;\n\n\t\t\tif (node is SimpleType)\n\t\t\t\tnode = ((SimpleType)node).IdentifierToken;\n\n\t\t\tif (node is MemberType)\n\t\t\t\tnode = ((MemberType)node).MemberNameToken;\n\n\t\t\tif (node is NamespaceDeclaration) {\n//\t\t\t\tvar nsd = ((NamespaceDeclaration)node);\n//\t\t\t\tnode = nsd.Identifiers.LastOrDefault (n => n.Name == memberName) ?? nsd.Identifiers.FirstOrDefault ();\n//\t\t\t\tif (node == null)\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (node is TypeDeclaration)\n\t\t\t\tnode = ((TypeDeclaration)node).NameToken;\n\t\t\tif (node is DelegateDeclaration)\n\t\t\t\tnode = ((DelegateDeclaration)node).NameToken;\n\n\t\t\tif (node is EntityDeclaration)\n\t\t\t\tnode = ((EntityDeclaration)node).NameToken;\n\n\t\t\tif (node is ParameterDeclaration)\n\t\t\t\tnode = ((ParameterDeclaration)node).NameToken;\n\t\t\tif (node is ConstructorDeclaration)\n\t\t\t\tnode = ((ConstructorDeclaration)node).NameToken;\n\t\t\tif (node is DestructorDeclaration)\n\t\t\t\tnode = ((DestructorDeclaration)node).NameToken;\n\t\t\tif (node is NamedArgumentExpression)\n\t\t\t\tnode = ((NamedArgumentExpression)node).NameToken;\n\t\t\tif (node is NamedExpression)\n\t\t\t\tnode = ((NamedExpression)node).NameToken;\n\t\t\tif (node is VariableInitializer)\n\t\t\t\tnode = ((VariableInitializer)node).NameToken;\n\n\t\t\tif (node is IdentifierExpression) {\n\t\t\t\tnode = ((IdentifierExpression)node).IdentifierToken;\n\t\t\t}\n\t\t\treturn node;\n\t\t}\n\n\t\tpublic void RenameReferencesInFile(IList<IFindReferenceSearchScope> searchScopes, string newName, CSharpAstResolver resolver,\n\t\t                                   Action<RenameCallbackArguments> callback, Action<Error> errorCallback, CancellationToken cancellationToken = default (CancellationToken))\n\t\t{\n\t\t\tFindReferencesInFile(\n\t\t\t\tsearchScopes,\n\t\t\t\tresolver,\n\t\t\t\tdelegate(AstNode astNode, ResolveResult result) {\n\t\t\t\t\tvar nodeToReplace = GetNodeToReplace(astNode);\n\t\t\t\t\tif (nodeToReplace == null) {\n\t\t\t\t\t\terrorCallback (new Error (ErrorType.Error, \"no node to replace found.\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcallback (new RenameCallbackArguments(nodeToReplace, Identifier.Create(newName)));\n\t\t\t\t},\n\t\t\t\tcancellationToken);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find TypeDefinition References\n\t\tSearchScope FindTypeDefinitionReferences(ITypeDefinition typeDefinition, bool findTypeReferencesEvenIfAliased, out SearchScope additionalScope)\n\t\t{\n\t\t\tstring searchTerm = null;\n\t\t\tadditionalScope = null;\n\t\t\tif (!findTypeReferencesEvenIfAliased && KnownTypeReference.GetCSharpNameByTypeCode(typeDefinition.KnownTypeCode) == null) {\n\t\t\t\t// We can optimize the search by looking only for the type references with the right identifier,\n\t\t\t\t// but only if it's not a primitive type and we're not looking for indirect references (through an alias)\n\t\t\t\tsearchTerm = typeDefinition.Name;\n\t\t\t\tif (searchTerm.Length > 9 && searchTerm.EndsWith(\"Attribute\", StringComparison.Ordinal)) {\n\t\t\t\t\t// The type might be an attribute, so we also need to look for the short form:\n\t\t\t\t\tstring shortForm = searchTerm.Substring(0, searchTerm.Length - 9);\n\t\t\t\t\tadditionalScope = FindTypeDefinitionReferences(typeDefinition, shortForm);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn FindTypeDefinitionReferences(typeDefinition, searchTerm);\n\t\t}\n\t\t\n\t\tSearchScope FindTypeDefinitionReferences(ITypeDefinition typeDefinition, string searchTerm)\n\t\t{\n\t\t\treturn new SearchScope(\n\t\t\t\tsearchTerm,\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\tITypeDefinition imported = compilation.Import(typeDefinition);\n\t\t\t\t\tif (imported != null)\n\t\t\t\t\t\treturn new FindTypeDefinitionReferencesNavigator(imported, searchTerm);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tsealed class FindTypeDefinitionReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly ITypeDefinition typeDefinition;\n\t\t\treadonly string searchTerm;\n\t\t\t\n\t\t\tpublic FindTypeDefinitionReferencesNavigator(ITypeDefinition typeDefinition, string searchTerm)\n\t\t\t{\n\t\t\t\tthis.typeDefinition = typeDefinition;\n\t\t\t\tthis.searchTerm = searchTerm;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tIdentifierExpression ident = node as IdentifierExpression;\n\t\t\t\tif (ident != null)\n\t\t\t\t\treturn searchTerm == null || ident.Identifier == searchTerm;\n\t\t\t\t\n\t\t\t\tMemberReferenceExpression mre = node as MemberReferenceExpression;\n\t\t\t\tif (mre != null)\n\t\t\t\t\treturn searchTerm == null || mre.MemberName == searchTerm;\n\t\t\t\t\n\t\t\t\tSimpleType st = node as SimpleType;\n\t\t\t\tif (st != null)\n\t\t\t\t\treturn searchTerm == null || st.Identifier == searchTerm;\n\t\t\t\t\n\t\t\t\tMemberType mt = node as MemberType;\n\t\t\t\tif (mt != null)\n\t\t\t\t\treturn searchTerm == null || mt.MemberName == searchTerm;\n\t\t\t\t\n\t\t\t\tif (searchTerm == null && node is PrimitiveType)\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\tTypeDeclaration typeDecl = node as TypeDeclaration;\n\t\t\t\tif (typeDecl != null)\n\t\t\t\t\treturn searchTerm == null || typeDecl.Name == searchTerm;\n\t\t\t\t\n\t\t\t\tDelegateDeclaration delegateDecl = node as DelegateDeclaration;\n\t\t\t\tif (delegateDecl != null)\n\t\t\t\t\treturn searchTerm == null || delegateDecl.Name == searchTerm;\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tTypeResolveResult trr = rr as TypeResolveResult;\n\t\t\t\treturn trr != null && typeDefinition.Equals(trr.Type.GetDefinition());\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Member References\n\t\tSearchScope FindMemberReferences(IEntity member, Func<IMember, FindMemberReferencesNavigator> factory)\n\t\t{\n\t\t\tstring searchTerm = member.Name;\n\t\t\treturn new SearchScope(\n\t\t\t\tsearchTerm,\n\t\t\t\tdelegate(ICompilation compilation) {\n\t\t\t\t\tIMember imported = compilation.Import((IMember)member);\n\t\t\t\t\treturn imported != null ? factory(imported) : null;\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tclass FindMemberReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMember member;\n\t\t\treadonly string searchTerm;\n\t\t\t\n\t\t\tpublic FindMemberReferencesNavigator(IMember member)\n\t\t\t{\n\t\t\t\tthis.member = member;\n\t\t\t\tthis.searchTerm = member.Name;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tIdentifierExpression ident = node as IdentifierExpression;\n\t\t\t\tif (ident != null)\n\t\t\t\t\treturn ident.Identifier == searchTerm;\n\t\t\t\t\n\t\t\t\tMemberReferenceExpression mre = node as MemberReferenceExpression;\n\t\t\t\tif (mre != null)\n\t\t\t\t\treturn mre.MemberName == searchTerm;\n\t\t\t\t\n\t\t\t\tPointerReferenceExpression pre = node as PointerReferenceExpression;\n\t\t\t\tif (pre != null)\n\t\t\t\t\treturn pre.MemberName == searchTerm;\n\t\t\t\t\n\t\t\t\tNamedExpression ne = node as NamedExpression;\n\t\t\t\tif (ne != null)\n\t\t\t\t\treturn ne.Name == searchTerm;\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(member, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIMember NormalizeMember(IMember member)\n\t\t{\n\t\t\tif (WholeVirtualSlot && member.IsOverride)\n\t\t\t\tmember = InheritanceHelper.GetBaseMembers(member, false).FirstOrDefault(m => !m.IsOverride) ?? member;\n\t\t\tif (!FindOnlySpecializedReferences)\n\t\t\t\tmember = member.MemberDefinition;\n\t\t\treturn member;\n\t\t}\n\t\t\n\t\tbool IsMemberMatch(IMember member, IMember referencedMember, bool isVirtualCall)\n\t\t{\n\t\t\treferencedMember = NormalizeMember(referencedMember);\n\t\t\tif (member.Equals(referencedMember))\n\t\t\t\treturn true;\n\t\t\tif (FindCallsThroughInterface && member.DeclaringTypeDefinition != null && member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {\n\t\t\t\tif (FindOnlySpecializedReferences) {\n\t\t\t\t\treturn referencedMember.ImplementedInterfaceMembers.Contains(member);\n\t\t\t\t} else {\n\t\t\t\t\treturn referencedMember.ImplementedInterfaceMembers.Any(m => m.MemberDefinition.Equals(member));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isVirtualCall)\n\t\t\t\treturn false;\n\t\t\tbool isInterfaceCall = referencedMember.DeclaringTypeDefinition != null && referencedMember.DeclaringTypeDefinition.Kind == TypeKind.Interface;\n\t\t\tif (FindCallsThroughVirtualBaseMethod && member.IsOverride && !WholeVirtualSlot && !isInterfaceCall) {\n\t\t\t\t// Test if 'member' overrides 'referencedMember':\n\t\t\t\tforeach (var baseMember in InheritanceHelper.GetBaseMembers(member, false)) {\n\t\t\t\t\tif (FindOnlySpecializedReferences) {\n\t\t\t\t\t\tif (baseMember.Equals(referencedMember))\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (baseMember.MemberDefinition.Equals(referencedMember))\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (!baseMember.IsOverride)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} else if (FindCallsThroughInterface && isInterfaceCall) {\n\t\t\t\t// Test if 'member' implements 'referencedMember':\n\t\t\t\tif (FindOnlySpecializedReferences) {\n\t\t\t\t\treturn member.ImplementedInterfaceMembers.Contains(referencedMember);\n\t\t\t\t} else {\n\t\t\t\t\treturn member.ImplementedInterfaceMembers.Any(m => m.MemberDefinition.Equals(referencedMember));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/*\n\t\tbool PerformVirtualLookup(IMember member, IMember referencedMember)\n\t\t{\n\t\t\tif (FindCallsThroughVirtualBaseMethod && member.IsOverride && !WholeVirtualSlot)\n\t\t\t\treturn true;\n\t\t\tvar typeDef = referencedMember.DeclaringTypeDefinition;\n\t\t\treturn FindCallsThroughInterface && typeDef != null && typeDef.Kind == TypeKind.Interface;\n\t\t}*/\n\t\t\n\t\tsealed class FindFieldReferences : FindMemberReferencesNavigator\n\t\t{\n\t\t\tpublic FindFieldReferences(IField field) : base(field)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tif (node is VariableInitializer) {\n\t\t\t\t\treturn node.Parent is FieldDeclaration;\n\t\t\t\t}\n\t\t\t\treturn base.CanMatch(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class FindEnumMemberReferences : FindMemberReferencesNavigator\n\t\t{\n\t\t\tpublic FindEnumMemberReferences(IField field) : base(field)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is EnumMemberDeclaration || base.CanMatch(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class FindPropertyReferences : FindMemberReferencesNavigator\n\t\t{\n\t\t\tpublic FindPropertyReferences(IProperty property) : base(property)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is PropertyDeclaration || base.CanMatch(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class FindEventReferences : FindMemberReferencesNavigator\n\t\t{\n\t\t\tpublic FindEventReferences(IEvent ev) : base(ev)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tif (node is VariableInitializer) {\n\t\t\t\t\treturn node.Parent is EventDeclaration;\n\t\t\t\t}\n\t\t\t\treturn node is CustomEventDeclaration || base.CanMatch(node);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find References to IEnumerator.Current\n\t\tSearchScope FindEnumeratorCurrentReferences(IProperty property)\n\t\t{\n\t\t\treturn new SearchScope(\n\t\t\t\tdelegate(ICompilation compilation) {\n\t\t\t\t\tIProperty imported = compilation.Import(property);\n\t\t\t\t\treturn imported != null ? new FindEnumeratorCurrentReferencesNavigator(imported) : null;\n\t\t\t\t});\n\t\t}\n\n\t\tSearchScope FindAwaiterIsCompletedReferences(IProperty property)\n\t\t{\n\t\t\treturn new SearchScope(\n\t\t\t\tdelegate(ICompilation compilation) {\n\t\t\t\t\tIProperty imported = compilation.Import(property);\n\t\t\t\t\treturn imported != null ? new FindAwaiterIsCompletedReferencesNavigator(imported) : null;\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tsealed class FindEnumeratorCurrentReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\tIProperty property;\n\t\t\t\n\t\t\tpublic FindEnumeratorCurrentReferencesNavigator(IProperty property)\n\t\t\t{\n\t\t\t\tthis.property = property;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is ForeachStatement;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tForEachResolveResult ferr = rr as ForEachResolveResult;\n\t\t\t\treturn ferr != null && ferr.CurrentProperty != null && findReferences.IsMemberMatch(property, ferr.CurrentProperty, true);\n\t\t\t}\n\t\t}\n\n\t\tsealed class FindAwaiterIsCompletedReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\tIProperty property;\n\t\t\t\n\t\t\tpublic FindAwaiterIsCompletedReferencesNavigator(IProperty property)\n\t\t\t{\n\t\t\t\tthis.property = property;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is UnaryOperatorExpression;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tAwaitResolveResult arr = rr as AwaitResolveResult;\n\t\t\t\treturn arr != null && arr.IsCompletedProperty != null && findReferences.IsMemberMatch(property, arr.IsCompletedProperty, true);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Method References\n\t\tSearchScope GetSearchScopeForMethod(IMethod method)\n\t\t{\n\t\t\tType specialNodeType;\n\t\t\tswitch (method.Name) {\n\t\t\t\tcase \"Add\":\n\t\t\t\t\tspecialNodeType = typeof(ArrayInitializerExpression);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Where\":\n\t\t\t\t\tspecialNodeType = typeof(QueryWhereClause);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Select\":\n\t\t\t\t\tspecialNodeType = typeof(QuerySelectClause);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"SelectMany\":\n\t\t\t\t\tspecialNodeType = typeof(QueryFromClause);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Join\":\n\t\t\t\tcase \"GroupJoin\":\n\t\t\t\t\tspecialNodeType = typeof(QueryJoinClause);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"OrderBy\":\n\t\t\t\tcase \"OrderByDescending\":\n\t\t\t\tcase \"ThenBy\":\n\t\t\t\tcase \"ThenByDescending\":\n\t\t\t\t\tspecialNodeType = typeof(QueryOrdering);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"GroupBy\":\n\t\t\t\t\tspecialNodeType = typeof(QueryGroupClause);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Invoke\":\n\t\t\t\t\tif (method.DeclaringTypeDefinition != null && method.DeclaringTypeDefinition.Kind == TypeKind.Delegate)\n\t\t\t\t\t\tspecialNodeType = typeof(InvocationExpression);\n\t\t\t\t\telse\n\t\t\t\t\t\tspecialNodeType = null;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"GetEnumerator\":\n\t\t\t\tcase \"MoveNext\":\n\t\t\t\t\tspecialNodeType = typeof(ForeachStatement);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"GetAwaiter\":\n\t\t\t\tcase \"GetResult\":\n\t\t\t\tcase \"OnCompleted\":\n\t\t\t\tcase \"UnsafeOnCompleted\":\n\t\t\t\t\tspecialNodeType = typeof(UnaryOperatorExpression);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tspecialNodeType = null;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Use searchTerm only if specialNodeType==null\n\t\t\tstring searchTerm = (specialNodeType == null) ? method.Name : null;\n\t\t\treturn new SearchScope(\n\t\t\t\tsearchTerm,\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\tIMethod imported = compilation.Import(method);\n\t\t\t\t\tif (imported != null)\n\t\t\t\t\t\treturn new FindMethodReferences(imported, specialNodeType);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tsealed class FindMethodReferences : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod method;\n\t\t\treadonly Type specialNodeType;\n\t\t\tHashSet<Expression> potentialMethodGroupConversions = new HashSet<Expression>();\n\t\t\t\n\t\t\tpublic FindMethodReferences(IMethod method, Type specialNodeType)\n\t\t\t{\n\t\t\t\tthis.method = method;\n\t\t\t\tthis.specialNodeType = specialNodeType;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tif (specialNodeType != null && node.GetType() == specialNodeType)\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\tExpression expr = node as Expression;\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn node is MethodDeclaration;\n\t\t\t\t\n\t\t\t\tInvocationExpression ie = node as InvocationExpression;\n\t\t\t\tif (ie != null) {\n\t\t\t\t\tExpression target = ParenthesizedExpression.UnpackParenthesizedExpression(ie.Target);\n\t\t\t\t\t\n\t\t\t\t\tIdentifierExpression ident = target as IdentifierExpression;\n\t\t\t\t\tif (ident != null)\n\t\t\t\t\t\treturn ident.Identifier == method.Name;\n\t\t\t\t\t\n\t\t\t\t\tMemberReferenceExpression mre = target as MemberReferenceExpression;\n\t\t\t\t\tif (mre != null)\n\t\t\t\t\t\treturn mre.MemberName == method.Name;\n\t\t\t\t\t\n\t\t\t\t\tPointerReferenceExpression pre = target as PointerReferenceExpression;\n\t\t\t\t\tif (pre != null)\n\t\t\t\t\t\treturn pre.MemberName == method.Name;\n\t\t\t\t} else if (expr.Role != Roles.TargetExpression) {\n\t\t\t\t\t// MemberReferences & Identifiers that aren't used in an invocation can still match the method\n\t\t\t\t\t// as delegate name.\n\t\t\t\t\tif (expr.GetChildByRole(Roles.Identifier).Name == method.Name)\n\t\t\t\t\t\tpotentialMethodGroupConversions.Add(expr);\n\t\t\t\t}\n\t\t\t\treturn node is MethodDeclaration;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tif (specialNodeType != null) {\n\t\t\t\t\tvar ferr = rr as ForEachResolveResult;\n\t\t\t\t\tif (ferr != null) {\n\t\t\t\t\t\treturn IsMatch(ferr.GetEnumeratorCall)\n\t\t\t\t\t\t\t|| (ferr.MoveNextMethod != null && findReferences.IsMemberMatch(method, ferr.MoveNextMethod, true));\n\t\t\t\t\t}\n\t\t\t\t\tvar arr = rr as AwaitResolveResult;\n\t\t\t\t\tif (arr != null) {\n\t\t\t\t\t\treturn IsMatch(arr.GetAwaiterInvocation)\n\t\t\t\t\t\t\t|| (arr.GetResultMethod != null && findReferences.IsMemberMatch(method, arr.GetResultMethod, true))\n\t\t\t\t\t\t\t|| (arr.OnCompletedMethod != null && findReferences.IsMemberMatch(method, arr.OnCompletedMethod, true));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(method, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t\t\n\t\t\tinternal override void NavigatorDone(CSharpAstResolver resolver, CancellationToken cancellationToken)\n\t\t\t{\n\t\t\t\tforeach (var expr in potentialMethodGroupConversions) {\n\t\t\t\t\tvar conversion = resolver.GetConversion(expr, cancellationToken);\n\t\t\t\t\tif (conversion.IsMethodGroupConversion && findReferences.IsMemberMatch(method, conversion.Method, conversion.IsVirtualMethodLookup)) {\n\t\t\t\t\t\tIType targetType = resolver.GetExpectedType(expr, cancellationToken);\n\t\t\t\t\t\tResolveResult result = resolver.Resolve(expr, cancellationToken);\n\t\t\t\t\t\tReportMatch(expr, new ConversionResolveResult(targetType, result, conversion));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbase.NavigatorDone(resolver, cancellationToken);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Indexer References\n\t\tSearchScope FindIndexerReferences(IProperty indexer)\n\t\t{\n\t\t\treturn new SearchScope(\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\tIProperty imported = compilation.Import(indexer);\n\t\t\t\t\tif (imported != null)\n\t\t\t\t\t\treturn new FindIndexerReferencesNavigator(imported);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tsealed class FindIndexerReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IProperty indexer;\n\t\t\t\n\t\t\tpublic FindIndexerReferencesNavigator(IProperty indexer)\n\t\t\t{\n\t\t\t\tthis.indexer = indexer;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is IndexerExpression || node is IndexerDeclaration;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(indexer, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Operator References\n\t\tSearchScope GetSearchScopeForOperator(IMethod op)\n\t\t{\n\t\t\tOperatorType? opType = OperatorDeclaration.GetOperatorType(op.Name);\n\t\t\tif (opType == null)\n\t\t\t\treturn GetSearchScopeForMethod(op);\n\t\t\tswitch (opType.Value) {\n\t\t\t\tcase OperatorType.LogicalNot:\n\t\t\t\t\treturn FindUnaryOperator(op, UnaryOperatorType.Not);\n\t\t\t\tcase OperatorType.OnesComplement:\n\t\t\t\t\treturn FindUnaryOperator(op, UnaryOperatorType.BitNot);\n\t\t\t\tcase OperatorType.UnaryPlus:\n\t\t\t\t\treturn FindUnaryOperator(op, UnaryOperatorType.Plus);\n\t\t\t\tcase OperatorType.UnaryNegation:\n\t\t\t\t\treturn FindUnaryOperator(op, UnaryOperatorType.Minus);\n\t\t\t\tcase OperatorType.Increment:\n\t\t\t\t\treturn FindUnaryOperator(op, UnaryOperatorType.Increment);\n\t\t\t\tcase OperatorType.Decrement:\n\t\t\t\t\treturn FindUnaryOperator(op, UnaryOperatorType.Decrement);\n\t\t\t\tcase OperatorType.True:\n\t\t\t\tcase OperatorType.False:\n\t\t\t\t\t// TODO: implement search for op_True/op_False correctly\n\t\t\t\t\treturn GetSearchScopeForMethod(op);\n\t\t\t\tcase OperatorType.Addition:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.Add);\n\t\t\t\tcase OperatorType.Subtraction:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.Subtract);\n\t\t\t\tcase OperatorType.Multiply:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.Multiply);\n\t\t\t\tcase OperatorType.Division:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.Divide);\n\t\t\t\tcase OperatorType.Modulus:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.Modulus);\n\t\t\t\tcase OperatorType.BitwiseAnd:\n\t\t\t\t\t// TODO: an overloaded bitwise operator can also be called using the corresponding logical operator\n\t\t\t\t\t// (if op_True/op_False is defined)\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.BitwiseAnd);\n\t\t\t\tcase OperatorType.BitwiseOr:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.BitwiseOr);\n\t\t\t\tcase OperatorType.ExclusiveOr:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.ExclusiveOr);\n\t\t\t\tcase OperatorType.LeftShift:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.ShiftLeft);\n\t\t\t\tcase OperatorType.RightShift:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.ShiftRight);\n\t\t\t\tcase OperatorType.Equality:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.Equality);\n\t\t\t\tcase OperatorType.Inequality:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.InEquality);\n\t\t\t\tcase OperatorType.GreaterThan:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.GreaterThan);\n\t\t\t\tcase OperatorType.LessThan:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.LessThan);\n\t\t\t\tcase OperatorType.GreaterThanOrEqual:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.GreaterThanOrEqual);\n\t\t\t\tcase OperatorType.LessThanOrEqual:\n\t\t\t\t\treturn FindBinaryOperator(op, BinaryOperatorType.LessThanOrEqual);\n\t\t\t\tcase OperatorType.Implicit:\n\t\t\t\t\treturn FindOperator(op, m => new FindImplicitOperatorNavigator(m));\n\t\t\t\tcase OperatorType.Explicit:\n\t\t\t\t\treturn FindOperator(op, m => new FindExplicitOperatorNavigator(m));\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException(\"Invalid value for OperatorType\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tSearchScope FindOperator(IMethod op, Func<IMethod, FindReferenceNavigator> factory)\n\t\t{\n\t\t\treturn new SearchScope(\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\tIMethod imported = compilation.Import(op);\n\t\t\t\t\treturn imported != null ? factory(imported) : null;\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tSearchScope FindUnaryOperator(IMethod op, UnaryOperatorType operatorType)\n\t\t{\n\t\t\treturn FindOperator(op, m => new FindUnaryOperatorNavigator(m, operatorType));\n\t\t}\n\t\t\n\t\tsealed class FindUnaryOperatorNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod op;\n\t\t\treadonly UnaryOperatorType operatorType;\n\t\t\t\n\t\t\tpublic FindUnaryOperatorNavigator(IMethod op, UnaryOperatorType operatorType)\n\t\t\t{\n\t\t\t\tthis.op = op;\n\t\t\t\tthis.operatorType = operatorType;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tUnaryOperatorExpression uoe = node as UnaryOperatorExpression;\n\t\t\t\tif (uoe != null) {\n\t\t\t\t\tif (operatorType == UnaryOperatorType.Increment)\n\t\t\t\t\t\treturn uoe.Operator == UnaryOperatorType.Increment || uoe.Operator == UnaryOperatorType.PostIncrement;\n\t\t\t\t\telse if (operatorType == UnaryOperatorType.Decrement)\n\t\t\t\t\t\treturn uoe.Operator == UnaryOperatorType.Decrement || uoe.Operator == UnaryOperatorType.PostDecrement;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn uoe.Operator == operatorType;\n\t\t\t\t}\n\t\t\t\treturn node is OperatorDeclaration;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(op, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSearchScope FindBinaryOperator(IMethod op, BinaryOperatorType operatorType)\n\t\t{\n\t\t\treturn FindOperator(op, m => new FindBinaryOperatorNavigator(m, operatorType));\n\t\t}\n\t\t\n\t\tsealed class FindBinaryOperatorNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod op;\n\t\t\treadonly BinaryOperatorType operatorType;\n\t\t\t\n\t\t\tpublic FindBinaryOperatorNavigator(IMethod op, BinaryOperatorType operatorType)\n\t\t\t{\n\t\t\t\tthis.op = op;\n\t\t\t\tthis.operatorType = operatorType;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tBinaryOperatorExpression boe = node as BinaryOperatorExpression;\n\t\t\t\tif (boe != null) {\n\t\t\t\t\treturn boe.Operator == operatorType;\n\t\t\t\t}\n\t\t\t\treturn node is OperatorDeclaration;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(op, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class FindImplicitOperatorNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod op;\n\t\t\t\n\t\t\tpublic FindImplicitOperatorNavigator(IMethod op)\n\t\t\t{\n\t\t\t\tthis.op = op;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(op, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t\tif (conversion.IsUserDefined && findReferences.IsMemberMatch(op, conversion.Method, conversion.IsVirtualMethodLookup)) {\n\t\t\t\t\tReportMatch(expression, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class FindExplicitOperatorNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod op;\n\t\t\t\n\t\t\tpublic FindExplicitOperatorNavigator(IMethod op)\n\t\t\t{\n\t\t\t\tthis.op = op;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is CastExpression;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tConversionResolveResult crr = rr as ConversionResolveResult;\n\t\t\t\treturn crr != null && crr.Conversion.IsUserDefined\n\t\t\t\t\t&& findReferences.IsMemberMatch(op, crr.Conversion.Method, crr.Conversion.IsVirtualMethodLookup);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Constructor References\n\t\tSearchScope FindObjectCreateReferences(IMethod ctor)\n\t\t{\n\t\t\tstring searchTerm = null;\n\t\t\tif (KnownTypeReference.GetCSharpNameByTypeCode(ctor.DeclaringTypeDefinition.KnownTypeCode) == null) {\n\t\t\t\t// not a built-in type\n\t\t\t\tsearchTerm = ctor.DeclaringTypeDefinition.Name;\n\t\t\t\tif (searchTerm.Length > 9 && searchTerm.EndsWith(\"Attribute\", StringComparison.Ordinal)) {\n\t\t\t\t\t// we also need to look for the short form\n\t\t\t\t\tsearchTerm = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new SearchScope(\n\t\t\t\tsearchTerm,\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\tIMethod imported = compilation.Import(ctor);\n\t\t\t\t\tif (imported != null)\n\t\t\t\t\t\treturn new FindObjectCreateReferencesNavigator(imported);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tsealed class FindObjectCreateReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod ctor;\n\t\t\t\n\t\t\tpublic FindObjectCreateReferencesNavigator(IMethod ctor)\n\t\t\t{\n\t\t\t\tthis.ctor = ctor;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is ObjectCreateExpression || node is ConstructorDeclaration || node is Attribute;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(ctor, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSearchScope FindChainedConstructorReferences(IMethod ctor)\n\t\t{\n\t\t\tSearchScope searchScope = new SearchScope(\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\tIMethod imported = compilation.Import(ctor);\n\t\t\t\t\tif (imported != null)\n\t\t\t\t\t\treturn new FindChainedConstructorReferencesNavigator(imported);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t});\n\t\t\tif (ctor.DeclaringTypeDefinition.IsSealed)\n\t\t\t\tsearchScope.accessibility = Accessibility.Private;\n\t\t\telse\n\t\t\t\tsearchScope.accessibility = Accessibility.Protected;\n\t\t\tsearchScope.accessibility = MergeAccessibility(GetEffectiveAccessibility(ctor), searchScope.accessibility);\n\t\t\treturn searchScope;\n\t\t}\n\t\t\n\t\tsealed class FindChainedConstructorReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod ctor;\n\t\t\t\n\t\t\tpublic FindChainedConstructorReferencesNavigator(IMethod ctor)\n\t\t\t{\n\t\t\t\tthis.ctor = ctor;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is ConstructorInitializer;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(ctor, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Destructor References\n\t\tSearchScope GetSearchScopeForDestructor(IMethod dtor)\n\t\t{\n\t\t\tvar scope = new SearchScope (\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\tIMethod imported = compilation.Import(dtor);\n\t\t\t\t\tif (imported != null) {\n\t\t\t\t\t\treturn new FindDestructorReferencesNavigator (imported);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tscope.accessibility = Accessibility.Private;\n\t\t\treturn scope;\n\t\t}\n\t\t\n\t\tsealed class FindDestructorReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IMethod dtor;\n\t\t\t\n\t\t\tpublic FindDestructorReferencesNavigator (IMethod dtor)\n\t\t\t{\n\t\t\t\tthis.dtor = dtor;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\treturn node is DestructorDeclaration;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\t\treturn mrr != null && findReferences.IsMemberMatch(dtor, mrr.Member, mrr.IsVirtualCall);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Find Local Variable References\n\t\t/// <summary>\n\t\t/// Finds all references of a given variable.\n\t\t/// </summary>\n\t\t/// <param name=\"variable\">The variable for which to look.</param>\n\t\t/// <param name=\"unresolvedFile\">The type system representation of the file being searched.</param>\n\t\t/// <param name=\"syntaxTree\">The syntax tree of the file being searched.</param>\n\t\t/// <param name=\"compilation\">The compilation.</param>\n\t\t/// <param name=\"callback\">Callback used to report the references that were found.</param>\n\t\t/// <param name=\"cancellationToken\">Cancellation token that may be used to cancel the operation.</param>\n\t\tpublic void FindLocalReferences(IVariable variable, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree,\n\t\t                                ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (variable == null)\n\t\t\t\tthrow new ArgumentNullException(\"variable\");\n\t\t\tvar searchScope = new SearchScope(c => new FindLocalReferencesNavigator(variable));\n\t\t\tsearchScope.declarationCompilation = compilation;\n\t\t\tFindReferencesInFile(searchScope, unresolvedFile, syntaxTree, compilation, callback, cancellationToken);\n\t\t}\n\t\t\n\t\tSearchScope GetSearchScopeForLocalVariable(IVariable variable)\n\t\t{\n\t\t\tvar scope = new SearchScope (\n\t\t\t\tdelegate {\n\t\t\t\t\treturn new FindLocalReferencesNavigator(variable);\n\t\t\t\t}\n\t\t\t);\n\t\t\tscope.fileName = variable.Region.FileName;\n\t\t\treturn scope;\n\t\t}\n\t\t\n\t\tclass FindLocalReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IVariable variable;\n\t\t\t\n\t\t\tpublic FindLocalReferencesNavigator(IVariable variable)\n\t\t\t{\n\t\t\t\tthis.variable = variable;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tvar expr = node as IdentifierExpression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\treturn expr.TypeArguments.Count == 0 && variable.Name == expr.Identifier;\n\t\t\t\tvar vi = node as VariableInitializer;\n\t\t\t\tif (vi != null)\n\t\t\t\t\treturn vi.Name == variable.Name;\n\t\t\t\tvar pd = node as ParameterDeclaration;\n\t\t\t\tif (pd != null)\n\t\t\t\t\treturn pd.Name == variable.Name;\n\t\t\t\tvar id = node as Identifier;\n\t\t\t\tif (id != null)\n\t\t\t\t\treturn id.Name == variable.Name;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tvar lrr = rr as LocalResolveResult;\n\t\t\t\treturn lrr != null && lrr.Variable.Name == variable.Name && lrr.Variable.Region == variable.Region;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Find Type Parameter References\n\t\t/// <summary>\n\t\t/// Finds all references of a given type parameter.\n\t\t/// </summary>\n\t\t/// <param name=\"typeParameter\">The type parameter for which to look.</param>\n\t\t/// <param name=\"unresolvedFile\">The type system representation of the file being searched.</param>\n\t\t/// <param name=\"syntaxTree\">The syntax tree of the file being searched.</param>\n\t\t/// <param name=\"compilation\">The compilation.</param>\n\t\t/// <param name=\"callback\">Callback used to report the references that were found.</param>\n\t\t/// <param name=\"cancellationToken\">Cancellation token that may be used to cancel the operation.</param>\n\t\t[Obsolete(\"Use GetSearchScopes(typeParameter) instead\")]\n\t\tpublic void FindTypeParameterReferences(IType typeParameter, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree,\n\t\t                                        ICompilation compilation, FoundReferenceCallback callback, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (typeParameter == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeParameter\");\n\t\t\tif (typeParameter.Kind != TypeKind.TypeParameter)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"typeParameter\", \"Only type parameters are allowed\");\n\t\t\tvar searchScope = new SearchScope(c => new FindTypeParameterReferencesNavigator((ITypeParameter)typeParameter));\n\t\t\tsearchScope.declarationCompilation = compilation;\n\t\t\tsearchScope.accessibility = Accessibility.Private;\n\t\t\tFindReferencesInFile(searchScope, unresolvedFile, syntaxTree, compilation, callback, cancellationToken);\n\t\t}\n\t\t\n\t\tSearchScope GetSearchScopeForTypeParameter(ITypeParameter tp)\n\t\t{\n\t\t\tvar searchScope = new SearchScope(c => new FindTypeParameterReferencesNavigator(tp));\n\t\t\tvar compilationProvider = tp as ICompilationProvider;\n\t\t\tif (compilationProvider != null)\n\t\t\t\tsearchScope.declarationCompilation = compilationProvider.Compilation;\n\t\t\tsearchScope.topLevelTypeDefinition = GetTopLevelTypeDefinition(tp.Owner);\n\t\t\tsearchScope.accessibility = Accessibility.Private;\n\t\t\treturn searchScope;\n\t\t}\n\n\t\tclass FindTypeParameterReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly ITypeParameter typeParameter;\n\t\t\t\n\t\t\tpublic FindTypeParameterReferencesNavigator(ITypeParameter typeParameter)\n\t\t\t{\n\t\t\t\tthis.typeParameter = typeParameter;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tvar type = node as SimpleType;\n\t\t\t\tif (type != null)\n\t\t\t\t\treturn type.Identifier == typeParameter.Name;\n\t\t\t\tvar declaration = node as TypeParameterDeclaration;\n\t\t\t\tif (declaration != null)\n\t\t\t\t\treturn declaration.Name == typeParameter.Name;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tvar lrr = rr as TypeResolveResult;\n\t\t\t\treturn lrr != null && lrr.Type.Kind == TypeKind.TypeParameter && ((ITypeParameter)lrr.Type).Region == typeParameter.Region;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Namespace References\n\t\tSearchScope GetSearchScopeForNamespace(INamespace ns)\n\t\t{\n\t\t\tvar scope = new SearchScope (\n\t\t\t\tdelegate (ICompilation compilation) {\n\t\t\t\t\treturn new FindNamespaceNavigator (ns);\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn scope;\n\t\t}\n\n\t\tsealed class FindNamespaceNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly INamespace ns;\n\n\t\t\tpublic FindNamespaceNavigator (INamespace ns)\n\t\t\t{\n\t\t\t\tthis.ns = ns;\n\t\t\t}\n\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tvar nsd = node as NamespaceDeclaration;\n\t\t\t\tif (nsd != null && nsd.FullName.StartsWith(ns.FullName, StringComparison.Ordinal))\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar ud = node as UsingDeclaration;\n\t\t\t\tif (ud != null && ud.Namespace == ns.FullName)\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar st = node as SimpleType;\n\t\t\t\tif (st != null && st.Identifier == ns.Name)\n\t\t\t\t\treturn !st.AncestorsAndSelf.TakeWhile (n => n is AstType).Any (m => m.Role == NamespaceDeclaration.NamespaceNameRole);\n\n\t\t\t\tvar mt = node as MemberType;\n\t\t\t\tif (mt != null && mt.MemberName == ns.Name)\n\t\t\t\t\treturn !mt.AncestorsAndSelf.TakeWhile (n => n is AstType).Any (m => m.Role == NamespaceDeclaration.NamespaceNameRole);\n\n\t\t\t\tvar identifer = node as IdentifierExpression;\n\t\t\t\tif (identifer != null && identifer.Identifier == ns.Name)\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar mrr = node as MemberReferenceExpression;\n\t\t\t\tif (mrr != null && mrr.MemberName == ns.Name)\n\t\t\t\t\treturn true;\n\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tvar nsrr = rr as NamespaceResolveResult;\n\t\t\t\treturn nsrr != null && nsrr.NamespaceName.StartsWith(ns.FullName, StringComparison.Ordinal);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Find Parameter References\n\n\t\tSearchScope GetSearchScopeForParameter(IParameter parameter)\n\t\t{\n\t\t\tvar scope = new SearchScope (\n\t\t\t\tdelegate {\n\t\t\t\t\treturn new FindParameterReferencesNavigator (parameter);\n\t\t\t\t}\n\t\t\t);\n\t\t\tif (parameter.Owner == null) {\n\t\t\t\tscope.fileName = parameter.Region.FileName;\n\t\t\t}\n\t\t\treturn scope;\n\t\t}\n\n\t\tclass FindParameterReferencesNavigator : FindReferenceNavigator\n\t\t{\n\t\t\treadonly IParameter parameter;\n\n\t\t\tpublic FindParameterReferencesNavigator(IParameter parameter)\n\t\t\t{\n\t\t\t\tthis.parameter = parameter;\n\t\t\t}\n\n\t\t\tinternal override bool CanMatch(AstNode node)\n\t\t\t{\n\t\t\t\tvar expr = node as IdentifierExpression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\treturn expr.TypeArguments.Count == 0 && parameter.Name == expr.Identifier;\n\t\t\t\tvar vi = node as VariableInitializer;\n\t\t\t\tif (vi != null)\n\t\t\t\t\treturn vi.Name == parameter.Name;\n\t\t\t\tvar pd = node as ParameterDeclaration;\n\t\t\t\tif (pd != null)\n\t\t\t\t\treturn pd.Name == parameter.Name;\n\t\t\t\tvar id = node as Identifier;\n\t\t\t\tif (id != null)\n\t\t\t\t\treturn id.Name == parameter.Name;\n\t\t\t\tvar nae = node as NamedArgumentExpression;\n\t\t\t\tif (nae != null)\n\t\t\t\t\treturn nae.Name == parameter.Name;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tinternal override bool IsMatch(ResolveResult rr)\n\t\t\t{\n\t\t\t\tvar lrr = rr as LocalResolveResult;\n\t\t\t\tif (lrr != null)\n\t\t\t\t\treturn lrr.Variable.Name == parameter.Name && lrr.Variable.Region == parameter.Region;\n\n\t\t\t\tvar nar = rr as NamedArgumentResolveResult;\n\t\t\t\treturn nar != null && nar.Parameter.Name == parameter.Name && nar.Parameter.Region == parameter.Region;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/IResolveVisitorNavigator.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Allows controlling which nodes are resolved by the resolve visitor.\n\t/// </summary>\n\t/// <seealso cref=\"ResolveVisitor\"/>\n\tpublic interface IResolveVisitorNavigator\n\t{\n\t\t/// <summary>\n\t\t/// Asks the navigator whether to scan, skip, or resolve a node.\n\t\t/// </summary>\n\t\tResolveVisitorNavigationMode Scan(AstNode node);\n\t\t\n\t\t/// <summary>\n\t\t/// Notifies the navigator that a node was resolved.\n\t\t/// </summary>\n\t\t/// <param name=\"node\">The node that was resolved</param>\n\t\t/// <param name=\"result\">Resolve result</param>\n\t\tvoid Resolved(AstNode node, ResolveResult result);\n\t\t\n\t\t/// <summary>\n\t\t/// Notifies the navigator that an implicit conversion was applied.\n\t\t/// </summary>\n\t\t/// <param name=\"expression\">The expression that was resolved.</param>\n\t\t/// <param name=\"result\">The resolve result of the expression.</param>\n\t\t/// <param name=\"conversion\">The conversion applied to the expressed.</param>\n\t\t/// <param name=\"targetType\">The target type of the conversion.</param>\n\t\tvoid ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType);\n\t}\n\t\n\t/// <summary>\n\t/// Represents the operation mode of the resolve visitor.\n\t/// </summary>\n\t/// <seealso cref=\"ResolveVisitor\"/>\n\tpublic enum ResolveVisitorNavigationMode\n\t{\n\t\t/// <summary>\n\t\t/// Scan into the children of the current node, without resolving the current node.\n\t\t/// </summary>\n\t\tScan,\n\t\t/// <summary>\n\t\t/// Skip the current node - do not scan into it; do not resolve it.\n\t\t/// </summary>\n\t\tSkip,\n\t\t/// <summary>\n\t\t/// Resolve the current node.\n\t\t/// Subnodes which are not required for resolving the current node\n\t\t/// will ask the navigator again whether they should be resolved.\n\t\t/// </summary>\n\t\tResolve\n\t}\n\t\n\tsealed class ConstantModeResolveVisitorNavigator : IResolveVisitorNavigator\n\t{\n\t\treadonly ResolveVisitorNavigationMode mode;\n\t\treadonly IResolveVisitorNavigator targetForResolveCalls;\n\t\t\n\t\tpublic ConstantModeResolveVisitorNavigator(ResolveVisitorNavigationMode mode, IResolveVisitorNavigator targetForResolveCalls)\n\t\t{\n\t\t\tthis.mode = mode;\n\t\t\tthis.targetForResolveCalls = targetForResolveCalls;\n\t\t}\n\t\t\n\t\tResolveVisitorNavigationMode IResolveVisitorNavigator.Scan(AstNode node)\n\t\t{\n\t\t\treturn mode;\n\t\t}\n\t\t\n\t\tvoid IResolveVisitorNavigator.Resolved(AstNode node, ResolveResult result)\n\t\t{\n\t\t\tif (targetForResolveCalls != null)\n\t\t\t\ttargetForResolveCalls.Resolved(node, result);\n\t\t}\n\t\t\n\t\tvoid IResolveVisitorNavigator.ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t{\n\t\t\tif (targetForResolveCalls != null)\n\t\t\t\ttargetForResolveCalls.ProcessConversion(expression, result, conversion, targetType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/LambdaResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Represents an anonymous method or lambda expression.\n\t/// Note: the lambda has no type.\n\t/// To retrieve the delegate type, look at the anonymous function conversion.\n\t/// </summary>\n\tpublic abstract class LambdaResolveResult : ResolveResult\n\t{\n\t\tprotected LambdaResolveResult() : base(SpecialType.UnknownType)\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether there is a parameter list.\n\t\t/// This property always returns true for C# 3.0-lambdas, but may return false\n\t\t/// for C# 2.0 anonymous methods.\n\t\t/// </summary>\n\t\tpublic abstract bool HasParameterList { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this lambda is using the C# 2.0 anonymous method syntax.\n\t\t/// </summary>\n\t\tpublic abstract bool IsAnonymousMethod { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the lambda parameters are implicitly typed.\n\t\t/// </summary>\n\t\t/// <remarks>This property returns false for anonymous methods without parameter list.</remarks>\n\t\tpublic abstract bool IsImplicitlyTyped { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the lambda is async.\n\t\t/// </summary>\n\t\tpublic abstract bool IsAsync { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the return type inferred when the parameter types are inferred to be <paramref name=\"parameterTypes\"/>\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method determines the return type inferred from the lambda body, which is used as part of C# type inference.\n\t\t/// Use the <see cref=\"ReturnType\"/> property to retrieve the actual return type as determined by the target delegate type.\n\t\t/// </remarks>\n\t\tpublic abstract IType GetInferredReturnType(IType[] parameterTypes);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of parameters.\n\t\t/// </summary>\n\t\tpublic abstract IList<IParameter> Parameters { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the return type of the lambda.\n\t\t/// \n\t\t/// If the lambda is async, the return type includes <code>Task&lt;T&gt;</code>\n\t\t/// </summary>\n\t\tpublic abstract IType ReturnType { get; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether the lambda body is valid for the given parameter types and return type.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// Produces a conversion with <see cref=\"Conversion.IsAnonymousFunctionConversion\"/>=<c>true</c> if the lambda is valid;\n\t\t/// otherwise returns <see cref=\"Conversion.None\"/>.\n\t\t/// </returns>\n\t\tpublic abstract Conversion IsValid(IType[] parameterTypes, IType returnType, CSharpConversions conversions);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the resolve result for the lambda body.\n\t\t/// Returns a resolve result for 'void' for statement lambdas.\n\t\t/// </summary>\n\t\tpublic abstract ResolveResult Body { get; }\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\treturn new [] { this.Body };\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Log.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Resolver logging helper.\n\t/// Wraps System.Diagnostics.Debug so that resolver-specific logging can be enabled/disabled on demand.\n\t/// (it's a huge amount of debug spew and slows down the resolver quite a bit)\n\t/// </summary>\n\tstatic class Log\n\t{\n\t\tconst bool logEnabled = false;\n#if __MonoCS__\n\t\t[Conditional(\"MCS_DEBUG\")]\n#else\n\t\t[Conditional(logEnabled ? \"DEBUG\" : \"LOG_DISABLED\")]\n#endif\n\t\tinternal static void WriteLine(string text)\n\t\t{\n\t\t\tDebug.WriteLine(text);\n\t\t}\n\t\t\n#if __MonoCS__\n\t\t[Conditional(\"MCS_DEBUG\")]\n#else\n\t\t[Conditional(logEnabled ? \"DEBUG\" : \"LOG_DISABLED\")]\n#endif\n\t\tinternal static void WriteLine(string format, params object[] args)\n\t\t{\n\t\t\tDebug.WriteLine(format, args);\n\t\t}\n\t\t\n#if __MonoCS__\n\t\t[Conditional(\"MCS_DEBUG\")]\n#else\n\t\t[Conditional(logEnabled ? \"DEBUG\" : \"LOG_DISABLED\")]\n#endif\n\t\tinternal static void WriteCollection<T>(string text, IEnumerable<T> lines)\n\t\t{\n\t\t\t#if DEBUG\n\t\t\tT[] arr = lines.ToArray();\n\t\t\tif (arr.Length == 0) {\n\t\t\t\tDebug.WriteLine(text + \"<empty collection>\");\n\t\t\t} else {\n\t\t\t\tDebug.WriteLine(text + (arr[0] != null ? arr[0].ToString() : \"<null>\"));\n\t\t\t\tfor (int i = 1; i < arr.Length; i++) {\n\t\t\t\t\tDebug.WriteLine(new string(' ', text.Length) + (arr[i] != null ? arr[i].ToString() : \"<null>\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endif\n\t\t}\n\t\t\n#if __MonoCS__\n\t\t[Conditional(\"MCS_DEBUG\")]\n#else\n\t\t[Conditional(logEnabled ? \"DEBUG\" : \"LOG_DISABLED\")]\n#endif\n\t\tpublic static void Indent()\n\t\t{\n\t\t\tDebug.Indent();\n\t\t}\n\t\t\n#if __MonoCS__\n\t\t[Conditional(\"MCS_DEBUG\")]\n#else\n\t\t[Conditional(logEnabled ? \"DEBUG\" : \"LOG_DISABLED\")]\n#endif\n\t\tpublic static void Unindent()\n\t\t{\n\t\t\tDebug.Unindent();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MemberLookup.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Implementation of member lookup (C# 4.0 spec, §7.4).\n\t/// </summary>\n\tpublic class MemberLookup\n\t{\n\t\t#region Static helper methods\n\t\t/// <summary>\n\t\t/// Gets whether the member is considered to be invocable.\n\t\t/// </summary>\n\t\tpublic static bool IsInvocable(IMember member)\n\t\t{\n\t\t\tif (member == null)\n\t\t\t\tthrow new ArgumentNullException(\"member\");\n\t\t\t// C# 4.0 spec, §7.4 member lookup\n\t\t\tif (member is IEvent || member is IMethod)\n\t\t\t\treturn true;\n\t\t\tIType returnType = member.ReturnType;\n\t\t\treturn returnType.Kind == TypeKind.Dynamic || returnType.Kind == TypeKind.Delegate;\n\t\t}\n\t\t#endregion\n\t\t\n\t\treadonly ITypeDefinition currentTypeDefinition;\n\t\treadonly IAssembly currentAssembly;\n\t\treadonly bool isInEnumMemberInitializer;\n\t\t\n\t\tpublic MemberLookup(ITypeDefinition currentTypeDefinition, IAssembly currentAssembly, bool isInEnumMemberInitializer = false)\n\t\t{\n\t\t\tthis.currentTypeDefinition = currentTypeDefinition;\n\t\t\tthis.currentAssembly = currentAssembly;\n\t\t\tthis.isInEnumMemberInitializer = isInEnumMemberInitializer;\n\t\t}\n\t\t\n\t\t#region IsAccessible\n\t\t/// <summary>\n\t\t/// Gets whether access to protected instance members of the target expression is possible.\n\t\t/// </summary>\n\t\tpublic bool IsProtectedAccessAllowed(ResolveResult targetResolveResult)\n\t\t{\n\t\t\treturn targetResolveResult is ThisResolveResult || IsProtectedAccessAllowed(targetResolveResult.Type);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether access to protected instance members of the target type is possible.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This method does not consider the special case of the 'base' reference. If possible, use the\n\t\t/// <c>IsProtectedAccessAllowed(ResolveResult)</c> overload instead.\n\t\t/// </remarks>\n\t\tpublic bool IsProtectedAccessAllowed(IType targetType)\n\t\t{\n\t\t\tif (targetType.Kind == TypeKind.TypeParameter)\n\t\t\t\ttargetType = ((ITypeParameter)targetType).EffectiveBaseClass;\n\t\t\tITypeDefinition typeDef = targetType.GetDefinition();\n\t\t\tif (typeDef == null)\n\t\t\t\treturn false;\n\t\t\tfor (ITypeDefinition c = currentTypeDefinition; c != null; c = c.DeclaringTypeDefinition) {\n\t\t\t\tif (typeDef.IsDerivedFrom(c))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether <paramref name=\"entity\"/> is accessible in the current class.\n\t\t/// </summary>\n\t\t/// <param name=\"entity\">The entity to test</param>\n\t\t/// <param name=\"allowProtectedAccess\">\n\t\t/// Whether protected access to instance members is allowed.\n\t\t/// True if the type of the reference is derived from the current class.\n\t\t/// Protected static members may be accessible even if false is passed for this parameter.\n\t\t/// </param>\n\t\tpublic bool IsAccessible(IEntity entity, bool allowProtectedAccess)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\t// C# 4.0 spec, §3.5.2 Accessiblity domains\n\t\t\tswitch (entity.Accessibility) {\n\t\t\t\tcase Accessibility.None:\n\t\t\t\t\treturn false;\n\t\t\t\tcase Accessibility.Private:\n\t\t\t\t\t// check for members of outer classes (private members of outer classes can be accessed)\n\t\t\t\t\tfor (var t = currentTypeDefinition; t != null; t = t.DeclaringTypeDefinition) {\n\t\t\t\t\t\tif (t.Equals(entity.DeclaringTypeDefinition))\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\tcase Accessibility.Public:\n\t\t\t\t\treturn true;\n\t\t\t\tcase Accessibility.Protected:\n\t\t\t\t\treturn IsProtectedAccessible(allowProtectedAccess, entity);\n\t\t\t\tcase Accessibility.Internal:\n\t\t\t\t\treturn IsInternalAccessible(entity.ParentAssembly);\n\t\t\t\tcase Accessibility.ProtectedOrInternal:\n\t\t\t\t\treturn IsInternalAccessible(entity.ParentAssembly) || IsProtectedAccessible(allowProtectedAccess, entity);\n\t\t\t\tcase Accessibility.ProtectedAndInternal:\n\t\t\t\t\treturn IsInternalAccessible(entity.ParentAssembly) && IsProtectedAccessible(allowProtectedAccess, entity);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Invalid value for Accessibility\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IsInternalAccessible(IAssembly assembly)\n\t\t{\n\t\t\treturn assembly != null && currentAssembly != null && assembly.InternalsVisibleTo(currentAssembly);\n\t\t}\n\t\t\n\t\tbool IsProtectedAccessible(bool allowProtectedAccess, IEntity entity)\n\t\t{\n\t\t\t// For static members and type definitions, we do not require the qualifying reference\n\t\t\t// to be derived from the current class (allowProtectedAccess).\n\t\t\tif (entity.IsStatic || entity.SymbolKind == SymbolKind.TypeDefinition)\n\t\t\t\tallowProtectedAccess = true;\n\t\t\t\n\t\t\tfor (var t = currentTypeDefinition; t != null; t = t.DeclaringTypeDefinition) {\n\t\t\t\tif (t.Equals(entity.DeclaringTypeDefinition))\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t// PERF: this might hurt performance as this method is called several times (once for each member)\n\t\t\t\t// make sure resolving base types is cheap (caches?) or cache within the MemberLookup instance\n\t\t\t\tif (allowProtectedAccess && t.IsDerivedFrom(entity.DeclaringTypeDefinition))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetAccessibleMembers\n\t\t/// <summary>\n\t\t/// Retrieves all members that are accessible and not hidden (by being overridden or shadowed).\n\t\t/// Returns both members and nested type definitions. Does not include extension methods.\n\t\t/// </summary>\n\t\tpublic IEnumerable<IEntity> GetAccessibleMembers(ResolveResult targetResolveResult)\n\t\t{\n\t\t\tif (targetResolveResult == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetResolveResult\");\n\t\t\t\n\t\t\tbool targetIsTypeParameter = targetResolveResult.Type.Kind == TypeKind.TypeParameter;\n\t\t\tbool allowProtectedAccess = IsProtectedAccessAllowed(targetResolveResult);\n\t\t\t\n\t\t\t// maps the member name to the list of lookup groups\n\t\t\tvar lookupGroupDict = new Dictionary<string, List<LookupGroup>>();\n\t\t\t\n\t\t\t// This loop will handle base types before derived types.\n\t\t\t// The loop performs three jobs:\n\t\t\t// 1) It marks entries in lookup groups from base classes as removed when those members\n\t\t\t//    are hidden by a derived class.\n\t\t\t// 2) It adds a new lookup group with the members from a declaring type.\n\t\t\t// 3) It replaces virtual members with the overridden version, placing the override in the\n\t\t\t//    lookup group belonging to the base class.\n\t\t\tforeach (IType type in targetResolveResult.Type.GetNonInterfaceBaseTypes()) {\n\t\t\t\t\n\t\t\t\tList<IEntity> entities = new List<IEntity>();\n\t\t\t\tentities.AddRange(type.GetMembers(options: GetMemberOptions.IgnoreInheritedMembers));\n\t\t\t\tif (!targetIsTypeParameter) {\n\t\t\t\t\tvar nestedTypes = type.GetNestedTypes(options: GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions);\n\t\t\t\t\t// GetDefinition() might return null if some IType has a strange implementation of GetNestedTypes.\n\t\t\t\t\tentities.AddRange(nestedTypes.Select(t => t.GetDefinition()).Where(td => td != null));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach (var entityGroup in entities.GroupBy(e => e.Name)) {\n\t\t\t\t\t\n\t\t\t\t\tList<LookupGroup> lookupGroups = new List<LookupGroup>();\n\t\t\t\t\tif (!lookupGroupDict.TryGetValue(entityGroup.Key, out lookupGroups))\n\t\t\t\t\t\tlookupGroupDict.Add(entityGroup.Key, lookupGroups = new List<LookupGroup>());\n\t\t\t\t\t\n\t\t\t\t\tList<IType> newNestedTypes = null;\n\t\t\t\t\tList<IParameterizedMember> newMethods = null;\n\t\t\t\t\tIMember newNonMethod = null;\n\t\t\t\t\t\n\t\t\t\t\tIEnumerable<IType> typeBaseTypes = null;\n\t\t\t\t\t\n\t\t\t\t\tif (!targetIsTypeParameter) {\n\t\t\t\t\t\tAddNestedTypes(type, entityGroup.OfType<IType>(), 0, lookupGroups, ref typeBaseTypes, ref newNestedTypes);\n\t\t\t\t\t}\n\t\t\t\t\tAddMembers(type, entityGroup.OfType<IMember>(), allowProtectedAccess, lookupGroups, false, ref typeBaseTypes, ref newMethods, ref newNonMethod);\n\t\t\t\t\t\n\t\t\t\t\tif (newNestedTypes != null || newMethods != null || newNonMethod != null)\n\t\t\t\t\t\tlookupGroups.Add(new LookupGroup(type, newNestedTypes, newMethods, newNonMethod));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach (List<LookupGroup> lookupGroups in lookupGroupDict.Values) {\n\t\t\t\t// Remove interface members hidden by class members.\n\t\t\t\tif (targetIsTypeParameter) {\n\t\t\t\t\t// This can happen only with type parameters.\n\t\t\t\t\tRemoveInterfaceMembersHiddenByClassMembers(lookupGroups);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Now report the results:\n\t\t\t\tforeach (LookupGroup lookupGroup in lookupGroups) {\n\t\t\t\t\tif (!lookupGroup.MethodsAreHidden) {\n\t\t\t\t\t\tforeach (IMethod method in lookupGroup.Methods) {\n\t\t\t\t\t\t\tyield return method;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!lookupGroup.NonMethodIsHidden) {\n\t\t\t\t\t\tyield return lookupGroup.NonMethod;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookupGroup.NestedTypes != null) {\n\t\t\t\t\t\tforeach (IType type in lookupGroup.NestedTypes) {\n\t\t\t\t\t\t\tITypeDefinition typeDef = type.GetDefinition();\n\t\t\t\t\t\t\tif (typeDef != null)\n\t\t\t\t\t\t\t\tyield return typeDef;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region class LookupGroup\n\t\tsealed class LookupGroup\n\t\t{\n\t\t\tpublic readonly IType DeclaringType;\n\t\t\t\n\t\t\t// When a nested type is hidden, it is simply removed from the list.\n\t\t\tpublic List<IType> NestedTypes;\n\t\t\t\n\t\t\t// When members are hidden, they are merely marked as hidden.\n\t\t\t// We still need to store the hidden methods so that the 'override' processing can\n\t\t\t// find them, so that it won't introduce the override as a new method.\n\t\t\tpublic readonly List<IParameterizedMember> Methods;\n\t\t\tpublic bool MethodsAreHidden;\n\t\t\t\n\t\t\tpublic IMember NonMethod;\n\t\t\tpublic bool NonMethodIsHidden;\n\t\t\t\n\t\t\tpublic LookupGroup(IType declaringType, List<IType> nestedTypes, List<IParameterizedMember> methods, IMember nonMethod)\n\t\t\t{\n\t\t\t\tthis.DeclaringType = declaringType;\n\t\t\t\tthis.NestedTypes = nestedTypes;\n\t\t\t\tthis.Methods = methods;\n\t\t\t\tthis.NonMethod = nonMethod;\n\t\t\t\tthis.MethodsAreHidden = (methods == null || methods.Count == 0);\n\t\t\t\tthis.NonMethodIsHidden = (nonMethod == null);\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool AllHidden {\n\t\t\t\tget {\n\t\t\t\t\tif (NestedTypes != null && NestedTypes.Count > 0)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn NonMethodIsHidden && MethodsAreHidden;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region LookupType\n\t\tpublic ResolveResult LookupType(IType declaringType, string name, IList<IType> typeArguments, bool parameterizeResultType = true)\n\t\t{\n\t\t\tif (declaringType == null)\n\t\t\t\tthrow new ArgumentNullException(\"declaringType\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tif (typeArguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeArguments\");\n\t\t\t\n\t\t\tint typeArgumentCount = typeArguments.Count;\n\t\t\tPredicate<ITypeDefinition> filter = delegate (ITypeDefinition d) {\n\t\t\t\treturn InnerTypeParameterCount(d) == typeArgumentCount && d.Name == name && IsAccessible(d, true);\n\t\t\t};\n\t\t\t\n\t\t\tList<LookupGroup> lookupGroups = new List<LookupGroup>();\n\t\t\tif (declaringType.Kind != TypeKind.TypeParameter) {\n\t\t\t\tforeach (IType type in declaringType.GetNonInterfaceBaseTypes()) {\n\t\t\t\t\tList<IType> newNestedTypes = null;\n\t\t\t\t\tIEnumerable<IType> typeBaseTypes = null;\n\t\t\t\t\t\n\t\t\t\t\tIEnumerable<IType> nestedTypes;\n\t\t\t\t\tif (parameterizeResultType) {\n\t\t\t\t\t\tnestedTypes = type.GetNestedTypes(typeArguments, filter, GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnestedTypes = type.GetNestedTypes(filter, GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions);\n\t\t\t\t\t}\n\t\t\t\t\tAddNestedTypes(type, nestedTypes, typeArgumentCount, lookupGroups, ref typeBaseTypes, ref newNestedTypes);\n\t\t\t\t\t\n\t\t\t\t\tif (newNestedTypes != null)\n\t\t\t\t\t\tlookupGroups.Add(new LookupGroup(type, newNestedTypes, null, null));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlookupGroups.RemoveAll(g => g.AllHidden);\n\t\t\tDebug.Assert(lookupGroups.All(g => g.NestedTypes != null && g.NestedTypes.Count > 0));\n\t\t\t\n\t\t\tif (lookupGroups.Count == 0) {\n\t\t\t\treturn new UnknownMemberResolveResult(declaringType, name, typeArguments);\n\t\t\t}\n\t\t\t\n\t\t\tLookupGroup resultGroup = lookupGroups[lookupGroups.Count - 1];\n\t\t\t\n\t\t\tif (resultGroup.NestedTypes.Count > 1 || lookupGroups.Count > 1)\n\t\t\t\treturn new AmbiguousTypeResolveResult(resultGroup.NestedTypes[0]);\n\t\t\telse\n\t\t\t\treturn new TypeResolveResult(resultGroup.NestedTypes[0]);\n\t\t}\n\t\t\n\t\tstatic int InnerTypeParameterCount(IType type)\n\t\t{\n\t\t\t// inner types contain the type parameters of outer types. therefore this count has to been adjusted.\n\t\t\treturn type.TypeParameterCount - (type.DeclaringType != null ? type.DeclaringType.TypeParameterCount : 0);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Lookup\n\t\t/// <summary>\n\t\t/// Performs a member lookup.\n\t\t/// </summary>\n\t\tpublic ResolveResult Lookup(ResolveResult targetResolveResult, string name, IList<IType> typeArguments, bool isInvocation)\n\t\t{\n\t\t\tif (targetResolveResult == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetResolveResult\");\n\t\t\tif (name == null)\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tif (typeArguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeArguments\");\n\t\t\t\n\t\t\tbool targetIsTypeParameter = targetResolveResult.Type.Kind == TypeKind.TypeParameter;\n\t\t\t\n\t\t\tbool allowProtectedAccess = IsProtectedAccessAllowed(targetResolveResult);\n\t\t\tPredicate<ITypeDefinition> nestedTypeFilter = delegate(ITypeDefinition entity) {\n\t\t\t\treturn entity.Name == name && IsAccessible(entity, allowProtectedAccess);\n\t\t\t};\n\t\t\tPredicate<IUnresolvedMember> memberFilter = delegate(IUnresolvedMember entity) {\n\t\t\t\t// NOTE: Atm destructors can be looked up with 'Finalize'\n\t\t\t\treturn entity.SymbolKind != SymbolKind.Indexer &&\n\t\t\t\t       entity.SymbolKind != SymbolKind.Operator && \n\t\t\t\t       entity.Name == name;\n\t\t\t};\n\t\t\t\n\t\t\tList<LookupGroup> lookupGroups = new List<LookupGroup>();\n\t\t\t// This loop will handle base types before derived types.\n\t\t\t// The loop performs three jobs:\n\t\t\t// 1) It marks entries in lookup groups from base classes as removed when those members\n\t\t\t//    are hidden by a derived class.\n\t\t\t// 2) It adds a new lookup group with the members from a declaring type.\n\t\t\t// 3) It replaces virtual members with the overridden version, placing the override in the\n\t\t\t//    lookup group belonging to the base class.\n\t\t\tforeach (IType type in targetResolveResult.Type.GetNonInterfaceBaseTypes()) {\n\t\t\t\t\n\t\t\t\tList<IType> newNestedTypes = null;\n\t\t\t\tList<IParameterizedMember> newMethods = null;\n\t\t\t\tIMember newNonMethod = null;\n\t\t\t\t\n\t\t\t\tIEnumerable<IType> typeBaseTypes = null;\n\t\t\t\t\n\t\t\t\tif (!isInvocation && !targetIsTypeParameter) {\n\t\t\t\t\t// Consider nested types only if it's not an invocation.\n\t\t\t\t\t// type.GetNestedTypes() is checking the type parameter count for an exact match,\n\t\t\t\t\t// so we don't need to do that in our filter.\n\t\t\t\t\tvar nestedTypes = type.GetNestedTypes(typeArguments, nestedTypeFilter, GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\t\tAddNestedTypes(type, nestedTypes, typeArguments.Count, lookupGroups, ref typeBaseTypes, ref newNestedTypes);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIEnumerable<IMember> members;\n\t\t\t\tif (typeArguments.Count == 0) {\n\t\t\t\t\t// Note: IsInvocable-checking cannot be done as part of the filter;\n\t\t\t\t\t// because it must be done after type substitution.\n\t\t\t\t\tmembers = type.GetMembers(memberFilter, GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\t\tif (isInvocation)\n\t\t\t\t\t\tmembers = members.Where(m => IsInvocable(m));\n\t\t\t\t} else {\n\t\t\t\t\t// No need to check for isInvocation/isInvocable here:\n\t\t\t\t\t// we only fetch methods\n\t\t\t\t\tmembers = type.GetMethods(typeArguments, memberFilter, GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\t}\n\t\t\t\tAddMembers(type, members, allowProtectedAccess, lookupGroups, false, ref typeBaseTypes, ref newMethods, ref newNonMethod);\n\t\t\t\t\n\t\t\t\tif (newNestedTypes != null || newMethods != null || newNonMethod != null)\n\t\t\t\t\tlookupGroups.Add(new LookupGroup(type, newNestedTypes, newMethods, newNonMethod));\n\t\t\t}\n\t\t\t\n\t\t\t// Remove interface members hidden by class members.\n\t\t\tif (targetIsTypeParameter) {\n\t\t\t\t// This can happen only with type parameters.\n\t\t\t\tRemoveInterfaceMembersHiddenByClassMembers(lookupGroups);\n\t\t\t}\n\t\t\t\n\t\t\treturn CreateResult(targetResolveResult, lookupGroups, name, typeArguments);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Lookup Indexer\n\t\t/// <summary>\n\t\t/// Looks up the indexers on the target type.\n\t\t/// </summary>\n\t\tpublic IList<MethodListWithDeclaringType> LookupIndexers(ResolveResult targetResolveResult)\n\t\t{\n\t\t\tif (targetResolveResult == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetResolveResult\");\n\t\t\t\n\t\t\tIType targetType = targetResolveResult.Type;\n\t\t\tbool allowProtectedAccess = IsProtectedAccessAllowed(targetResolveResult);\n\t\t\tPredicate<IUnresolvedProperty> filter = p => p.IsIndexer;\n\t\t\t\n\t\t\tList<LookupGroup> lookupGroups = new List<LookupGroup>();\n\t\t\tforeach (IType type in targetType.GetNonInterfaceBaseTypes()) {\n\t\t\t\tList<IParameterizedMember> newMethods = null;\n\t\t\t\tIMember newNonMethod = null;\n\t\t\t\t\n\t\t\t\tIEnumerable<IType> typeBaseTypes = null;\n\t\t\t\t\n\t\t\t\tvar members = type.GetProperties(filter, GetMemberOptions.IgnoreInheritedMembers);\n\t\t\t\tAddMembers(type, members, allowProtectedAccess, lookupGroups, true, ref typeBaseTypes, ref newMethods, ref newNonMethod);\n\t\t\t\t\n\t\t\t\tif (newMethods != null || newNonMethod != null)\n\t\t\t\t\tlookupGroups.Add(new LookupGroup(type, null, newMethods, newNonMethod));\n\t\t\t}\n\t\t\t\n\t\t\t// Remove interface members hidden by class members.\n\t\t\tif (targetType.Kind == TypeKind.TypeParameter) {\n\t\t\t\t// This can happen only with type parameters.\n\t\t\t\tRemoveInterfaceMembersHiddenByClassMembers(lookupGroups);\n\t\t\t}\n\t\t\t\n\t\t\t// Remove all hidden groups\n\t\t\tlookupGroups.RemoveAll(g => g.MethodsAreHidden || g.Methods.Count == 0);\n\t\t\t\n\t\t\tMethodListWithDeclaringType[] methodLists = new MethodListWithDeclaringType[lookupGroups.Count];\n\t\t\tfor (int i = 0; i < methodLists.Length; i++) {\n\t\t\t\tmethodLists[i] = new MethodListWithDeclaringType(lookupGroups[i].DeclaringType, lookupGroups[i].Methods);\n\t\t\t}\n\t\t\treturn methodLists;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region AddNestedTypes\n\t\t/// <summary>\n\t\t/// Adds the nested types to 'newNestedTypes' and removes any hidden members from the existing lookup groups.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">Declaring type of the nested types</param>\n\t\t/// <param name=\"nestedTypes\">List of nested types to add.</param>\n\t\t/// <param name=\"typeArgumentCount\">The number of type arguments - used for hiding types from the base class</param>\n\t\t/// <param name=\"lookupGroups\">List of existing lookup groups</param>\n\t\t/// <param name=\"typeBaseTypes\">The base types of 'type' (initialized on demand)</param>\n\t\t/// <param name=\"newNestedTypes\">The target list (created on demand).</param>\n\t\tvoid AddNestedTypes(IType type, IEnumerable<IType> nestedTypes, int typeArgumentCount,\n\t\t                    List<LookupGroup> lookupGroups,\n\t\t                    ref IEnumerable<IType> typeBaseTypes,\n\t\t                    ref List<IType> newNestedTypes)\n\t\t{\n\t\t\tforeach (IType nestedType in nestedTypes) {\n\t\t\t\t// Remove all non-types declared in a base type of 'type',\n\t\t\t\t// and all types with same number of type parameters declared in a base type of 'type'.\n\t\t\t\tforeach (var lookupGroup in lookupGroups) {\n\t\t\t\t\tif (lookupGroup.AllHidden)\n\t\t\t\t\t\tcontinue; // everything is already hidden\n\t\t\t\t\tif (typeBaseTypes == null)\n\t\t\t\t\t\ttypeBaseTypes = type.GetNonInterfaceBaseTypes();\n\t\t\t\t\t\n\t\t\t\t\tif (typeBaseTypes.Contains(lookupGroup.DeclaringType)) {\n\t\t\t\t\t\tlookupGroup.MethodsAreHidden = true;\n\t\t\t\t\t\tlookupGroup.NonMethodIsHidden = true;\n\t\t\t\t\t\tif (lookupGroup.NestedTypes != null)\n\t\t\t\t\t\t\tlookupGroup.NestedTypes.RemoveAll(t => InnerTypeParameterCount(t) == typeArgumentCount);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add the new nested type.\n\t\t\t\tif (newNestedTypes == null)\n\t\t\t\t\tnewNestedTypes = new List<IType>();\n\t\t\t\tnewNestedTypes.Add(nestedType);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region AddMembers\n\t\t/// <summary>\n\t\t/// Adds members to 'newMethods'/'newNonMethod'.\n\t\t/// Removes any members in the existing lookup groups that were hidden by added members.\n\t\t/// Substitutes 'virtual' members in the existing lookup groups for added 'override' members.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">Declaring type of the members</param>\n\t\t/// <param name=\"members\">List of members to add.</param>\n\t\t/// <param name=\"allowProtectedAccess\">Whether protected members are accessible</param>\n\t\t/// <param name=\"lookupGroups\">List of existing lookup groups</param>\n\t\t/// <param name=\"treatAllParameterizedMembersAsMethods\">Whether to treat properties as methods</param>\n\t\t/// <param name=\"typeBaseTypes\">The base types of 'type' (initialized on demand)</param>\n\t\t/// <param name=\"newMethods\">The target list for methods (created on demand).</param>\n\t\t/// <param name=\"newNonMethod\">The target variable for non-method members.</param>\n\t\tvoid AddMembers(IType type, IEnumerable<IMember> members,\n\t\t                bool allowProtectedAccess,\n\t\t                List<LookupGroup> lookupGroups,\n\t\t                bool treatAllParameterizedMembersAsMethods,\n\t\t                ref IEnumerable<IType> typeBaseTypes, ref List<IParameterizedMember> newMethods, ref IMember newNonMethod)\n\t\t{\n\t\t\tforeach (IMember member in members) {\n\t\t\t\tif (!IsAccessible(member, allowProtectedAccess))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tIParameterizedMember method;\n\t\t\t\tif (treatAllParameterizedMembersAsMethods)\n\t\t\t\t\tmethod = member as IParameterizedMember;\n\t\t\t\telse\n\t\t\t\t\tmethod = member as IMethod;\n\t\t\t\t\n\t\t\t\tbool replacedVirtualMemberWithOverride = false;\n\t\t\t\tif (member.IsOverride) {\n\t\t\t\t\t// Replacing virtual member with override:\n\t\t\t\t\t\n\t\t\t\t\t// Go backwards so that we find the corresponding virtual member\n\t\t\t\t\t// in the most-derived type\n\t\t\t\t\tfor (int i = lookupGroups.Count - 1; i >= 0 && !replacedVirtualMemberWithOverride; i--) {\n\t\t\t\t\t\tif (typeBaseTypes == null)\n\t\t\t\t\t\t\ttypeBaseTypes = type.GetNonInterfaceBaseTypes();\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar lookupGroup = lookupGroups[i];\n\t\t\t\t\t\tif (typeBaseTypes.Contains(lookupGroup.DeclaringType)) {\n\t\t\t\t\t\t\tif (method != null) {\n\t\t\t\t\t\t\t\t// Find the matching method, and replace it with the override\n\t\t\t\t\t\t\t\tfor (int j = 0; j < lookupGroup.Methods.Count; j++) {\n\t\t\t\t\t\t\t\t\tif (SignatureComparer.Ordinal.Equals(method, lookupGroup.Methods[j])) {\n\t\t\t\t\t\t\t\t\t\tlookupGroup.Methods[j] = method;\n\t\t\t\t\t\t\t\t\t\treplacedVirtualMemberWithOverride = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// If the member type matches, replace it with the override\n\t\t\t\t\t\t\t\tif (lookupGroup.NonMethod != null && lookupGroup.NonMethod.SymbolKind == member.SymbolKind) {\n\t\t\t\t\t\t\t\t\tlookupGroup.NonMethod = member;\n\t\t\t\t\t\t\t\t\treplacedVirtualMemberWithOverride = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the member wasn't an override, or if we didn't find any matching virtual method,\n\t\t\t\t// proceed to add the member.\n\t\t\t\tif (!replacedVirtualMemberWithOverride) {\n\t\t\t\t\t// Make the member hide other members:\n\t\t\t\t\tforeach (var lookupGroup in lookupGroups) {\n\t\t\t\t\t\tif (lookupGroup.AllHidden)\n\t\t\t\t\t\t\tcontinue; // everything is already hidden\n\t\t\t\t\t\tif (typeBaseTypes == null)\n\t\t\t\t\t\t\ttypeBaseTypes = type.GetNonInterfaceBaseTypes();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (typeBaseTypes.Contains(lookupGroup.DeclaringType)) {\n\t\t\t\t\t\t\t// Methods hide all non-methods; Non-methods hide everything\n\t\t\t\t\t\t\tlookupGroup.NestedTypes = null;\n\t\t\t\t\t\t\tlookupGroup.NonMethodIsHidden = true;\n\t\t\t\t\t\t\tif (method == null) { // !(member is IMethod)\n\t\t\t\t\t\t\t\tlookupGroup.MethodsAreHidden = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add the new member\n\t\t\t\t\tif (method != null) {\n\t\t\t\t\t\tif (newMethods == null)\n\t\t\t\t\t\t\tnewMethods = new List<IParameterizedMember>();\n\t\t\t\t\t\tnewMethods.Add(method);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewNonMethod = member;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region RemoveInterfaceMembersHiddenByClassMembers\n\t\tvoid RemoveInterfaceMembersHiddenByClassMembers(List<LookupGroup> lookupGroups)\n\t\t{\n\t\t\tforeach (var classLookupGroup in lookupGroups) {\n\t\t\t\tif (IsInterfaceOrSystemObject(classLookupGroup.DeclaringType))\n\t\t\t\t\tcontinue;\n\t\t\t\t// The current lookup groups contains class members that might hide interface members\n\t\t\t\tbool hasNestedTypes = classLookupGroup.NestedTypes != null && classLookupGroup.NestedTypes.Count > 0;\n\t\t\t\tif (hasNestedTypes || !classLookupGroup.NonMethodIsHidden) {\n\t\t\t\t\t// Hide all members from interface types\n\t\t\t\t\tforeach (var interfaceLookupGroup in lookupGroups) {\n\t\t\t\t\t\tif (IsInterfaceOrSystemObject(interfaceLookupGroup.DeclaringType)) {\n\t\t\t\t\t\t\tinterfaceLookupGroup.NestedTypes = null;\n\t\t\t\t\t\t\tinterfaceLookupGroup.NonMethodIsHidden = true;\n\t\t\t\t\t\t\tinterfaceLookupGroup.MethodsAreHidden = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (!classLookupGroup.MethodsAreHidden) {\n\t\t\t\t\tforeach (var classMethod in classLookupGroup.Methods) {\n\t\t\t\t\t\t// Hide all non-methods from interface types, and all methods with the same signature\n\t\t\t\t\t\t// as a method in this class type.\n\t\t\t\t\t\tforeach (var interfaceLookupGroup in lookupGroups) {\n\t\t\t\t\t\t\tif (IsInterfaceOrSystemObject(interfaceLookupGroup.DeclaringType)) {\n\t\t\t\t\t\t\t\tinterfaceLookupGroup.NestedTypes = null;\n\t\t\t\t\t\t\t\tinterfaceLookupGroup.NonMethodIsHidden = true;\n\t\t\t\t\t\t\t\tif (interfaceLookupGroup.Methods != null && !interfaceLookupGroup.MethodsAreHidden) {\n\t\t\t\t\t\t\t\t\t// The mapping of virtual to overridden methods is already done,\n\t\t\t\t\t\t\t\t\t// so we can simply remove the methods from the collection\n\t\t\t\t\t\t\t\t\tinterfaceLookupGroup.Methods.RemoveAll(\n\t\t\t\t\t\t\t\t\t\tm => SignatureComparer.Ordinal.Equals(classMethod, m));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool IsInterfaceOrSystemObject(IType type)\n\t\t{\n\t\t\t// return true if type is an interface or System.Object\n\t\t\tif (type.Kind == TypeKind.Interface)\n\t\t\t\treturn true;\n\t\t\tITypeDefinition d = type.GetDefinition();\n\t\t\treturn d != null && d.KnownTypeCode == KnownTypeCode.Object;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region CreateResult\n\t\tResolveResult CreateResult(ResolveResult targetResolveResult, List<LookupGroup> lookupGroups, string name, IList<IType> typeArguments)\n\t\t{\n\t\t\t// Remove all hidden groups\n\t\t\tlookupGroups.RemoveAll(g => g.AllHidden);\n\t\t\t\n\t\t\tif (lookupGroups.Count == 0) {\n\t\t\t\t// No members found\n\t\t\t\treturn new UnknownMemberResolveResult(targetResolveResult.Type, name, typeArguments);\n\t\t\t}\n\t\t\t\n\t\t\tif (lookupGroups.Any(g => !g.MethodsAreHidden && g.Methods.Count > 0)) {\n\t\t\t\t// If there are methods, make a MethodGroupResolveResult.\n\t\t\t\t// Note that a conflict between a member and a method (possible with multiple interface inheritance)\n\t\t\t\t// is only a warning, not an error, and the C# compiler will prefer the method group.\n\t\t\t\tList<MethodListWithDeclaringType> methodLists = new List<MethodListWithDeclaringType>();\n\t\t\t\tforeach (var lookupGroup in lookupGroups) {\n\t\t\t\t\tif (!lookupGroup.MethodsAreHidden && lookupGroup.Methods.Count > 0) {\n\t\t\t\t\t\tvar methodListWithDeclType = new MethodListWithDeclaringType(lookupGroup.DeclaringType);\n\t\t\t\t\t\tforeach (var method in lookupGroup.Methods) {\n\t\t\t\t\t\t\tmethodListWithDeclType.Add((IMethod)method);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmethodLists.Add(methodListWithDeclType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn new MethodGroupResolveResult(targetResolveResult, name, methodLists, typeArguments);\n\t\t\t}\n\t\t\t\n\t\t\t// If there are ambiguities, report the most-derived result (last group)\n\t\t\tLookupGroup resultGroup = lookupGroups[lookupGroups.Count - 1];\n\t\t\tif (resultGroup.NestedTypes != null && resultGroup.NestedTypes.Count > 0) {\n\t\t\t\tif (resultGroup.NestedTypes.Count > 1 || !resultGroup.NonMethodIsHidden || lookupGroups.Count > 1)\n\t\t\t\t\treturn new AmbiguousTypeResolveResult(resultGroup.NestedTypes[0]);\n\t\t\t\telse\n\t\t\t\t\treturn new TypeResolveResult(resultGroup.NestedTypes[0]);\n\t\t\t}\n\t\t\t\n\t\t\tif (resultGroup.NonMethod.IsStatic && targetResolveResult is ThisResolveResult) {\n\t\t\t\ttargetResolveResult = new TypeResolveResult(targetResolveResult.Type);\n\t\t\t}\n\t\t\t\n\t\t\tif (lookupGroups.Count > 1) {\n\t\t\t\treturn new AmbiguousMemberResolveResult(targetResolveResult, resultGroup.NonMethod);\n\t\t\t} else {\n\t\t\t\tif (isInEnumMemberInitializer) {\n\t\t\t\t\tIField field = resultGroup.NonMethod as IField;\n\t\t\t\t\tif (field != null && field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum) {\n\t\t\t\t\t\treturn new MemberResolveResult(\n\t\t\t\t\t\t\ttargetResolveResult, field,\n\t\t\t\t\t\t\tfield.DeclaringTypeDefinition.EnumUnderlyingType,\n\t\t\t\t\t\t\tfield.IsConst, field.ConstantValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new MemberResolveResult(targetResolveResult, resultGroup.NonMethod);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MethodGroupResolveResult.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// A method list that belongs to a declaring type.\n\t/// </summary>\n\tpublic class MethodListWithDeclaringType : List<IParameterizedMember>\n\t{\n\t\treadonly IType declaringType;\n\t\t\n\t\t/// <summary>\n\t\t/// The declaring type.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Not all methods in this list necessarily have this as their declaring type.\n\t\t/// For example, this program:\n\t\t/// <code>\n\t\t///  class Base {\n\t\t///    public virtual void M() {}\n\t\t///  }\n\t\t///  class Derived : Base {\n\t\t///    public override void M() {}\n\t\t///    public void M(int i) {}\n\t\t///  }\n\t\t/// </code>\n\t\t/// results in two lists:\n\t\t///  <c>new MethodListWithDeclaringType(Base) { Derived.M() }</c>,\n\t\t///  <c>new MethodListWithDeclaringType(Derived) { Derived.M(int) }</c>\n\t\t/// </remarks>\n\t\tpublic IType DeclaringType {\n\t\t\tget { return declaringType; }\n\t\t}\n\t\t\n\t\tpublic MethodListWithDeclaringType(IType declaringType)\n\t\t{\n\t\t\tthis.declaringType = declaringType;\n\t\t}\n\t\t\n\t\tpublic MethodListWithDeclaringType(IType declaringType, IEnumerable<IParameterizedMember> methods)\n\t\t\t: base(methods)\n\t\t{\n\t\t\tthis.declaringType = declaringType;\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents a group of methods.\n\t/// A method reference used to create a delegate is resolved to a MethodGroupResolveResult.\n\t/// The MethodGroupResolveResult has no type.\n\t/// To retrieve the delegate type or the chosen overload, look at the method group conversion.\n\t/// </summary>\n\tpublic class MethodGroupResolveResult : ResolveResult\n\t{\n\t\treadonly IList<MethodListWithDeclaringType> methodLists;\n\t\treadonly IList<IType> typeArguments;\n\t\treadonly ResolveResult targetResult;\n\t\treadonly string methodName;\n\t\t\n\t\tpublic MethodGroupResolveResult(ResolveResult targetResult, string methodName, IList<MethodListWithDeclaringType> methods, IList<IType> typeArguments) : base(SpecialType.UnknownType)\n\t\t{\n\t\t\tif (methods == null)\n\t\t\t\tthrow new ArgumentNullException(\"methods\");\n\t\t\tthis.targetResult = targetResult;\n\t\t\tthis.methodName = methodName;\n\t\t\tthis.methodLists = methods;\n\t\t\tthis.typeArguments = typeArguments ?? EmptyList<IType>.Instance;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the resolve result for the target object.\n\t\t/// </summary>\n\t\tpublic ResolveResult TargetResult {\n\t\t\tget { return targetResult; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type of the reference to the target object.\n\t\t/// </summary>\n\t\tpublic IType TargetType {\n\t\t\tget { return targetResult != null ? targetResult.Type : SpecialType.UnknownType; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name of the methods in this group.\n\t\t/// </summary>\n\t\tpublic string MethodName {\n\t\t\tget { return methodName; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the methods that were found.\n\t\t/// This list does not include extension methods.\n\t\t/// </summary>\n\t\tpublic IEnumerable<IMethod> Methods {\n\t\t\tget { return methodLists.SelectMany(m => m.Cast<IMethod>()); }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the methods that were found, grouped by their declaring type.\n\t\t/// This list does not include extension methods.\n\t\t/// Base types come first in the list.\n\t\t/// </summary>\n\t\tpublic IEnumerable<MethodListWithDeclaringType> MethodsGroupedByDeclaringType {\n\t\t\tget { return methodLists; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the type arguments that were explicitly provided.\n\t\t/// </summary>\n\t\tpublic IList<IType> TypeArguments {\n\t\t\tget { return typeArguments; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// List of extension methods, used to avoid re-calculating it in ResolveInvocation() when it was already\n\t\t/// calculated by ResolveMemberAccess().\n\t\t/// </summary>\n\t\tinternal List<List<IMethod>> extensionMethods;\n\t\t\n\t\t// the resolver is used to fetch extension methods on demand\n\t\tinternal CSharpResolver resolver;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets all candidate extension methods.\n\t\t/// Note: this includes candidates that are not eligible due to an inapplicable\n\t\t/// this argument.\n\t\t/// The candidates will only be specialized if the type arguments were provided explicitly.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// The results are stored in nested lists because they are grouped by using scope.\n\t\t/// That is, for \"using SomeExtensions; namespace X { using MoreExtensions; ... }\",\n\t\t/// the return value will be\n\t\t/// new List {\n\t\t///    new List { all extensions from MoreExtensions },\n\t\t///    new List { all extensions from SomeExtensions }\n\t\t/// }\n\t\t/// </remarks>\n\t\tpublic IEnumerable<IEnumerable<IMethod>> GetExtensionMethods()\n\t\t{\n\t\t\tif (resolver != null) {\n\t\t\t\tDebug.Assert(extensionMethods == null);\n\t\t\t\ttry {\n\t\t\t\t\textensionMethods = resolver.GetExtensionMethods(methodName, typeArguments);\n\t\t\t\t} finally {\n\t\t\t\t\tresolver = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn extensionMethods ?? Enumerable.Empty<IEnumerable<IMethod>>();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the eligible extension methods.\n\t\t/// </summary>\n\t\t/// <param name=\"substituteInferredTypes\">\n\t\t/// Specifies whether to produce a <see cref=\"SpecializedMethod\"/>\n\t\t/// when type arguments could be inferred from <see cref=\"TargetType\"/>.\n\t\t/// This setting is only used for inferred types and has no effect if the type parameters are\n\t\t/// specified explicitly.\n\t\t/// </param>\n\t\t/// <remarks>\n\t\t/// The results are stored in nested lists because they are grouped by using scope.\n\t\t/// That is, for \"using SomeExtensions; namespace X { using MoreExtensions; ... }\",\n\t\t/// the return value will be\n\t\t/// new List {\n\t\t///    new List { all extensions from MoreExtensions },\n\t\t///    new List { all extensions from SomeExtensions }\n\t\t/// }\n\t\t/// </remarks>\n\t\tpublic IEnumerable<IEnumerable<IMethod>> GetEligibleExtensionMethods(bool substituteInferredTypes)\n\t\t{\n\t\t\tvar result = new List<List<IMethod>>();\n\t\t\tforeach (var methodGroup in GetExtensionMethods()) {\n\t\t\t\tvar outputGroup = new List<IMethod>();\n\t\t\t\tforeach (var method in methodGroup) {\n\t\t\t\t\tIType[] inferredTypes;\n\t\t\t\t\tif (CSharpResolver.IsEligibleExtensionMethod(this.TargetType, method, true, out inferredTypes)) {\n\t\t\t\t\t\tif (substituteInferredTypes && inferredTypes != null) {\n\t\t\t\t\t\t\toutputGroup.Add(method.Specialize(new TypeParameterSubstitution(null, inferredTypes)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutputGroup.Add(method);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (outputGroup.Count > 0)\n\t\t\t\t\tresult.Add(outputGroup);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"[{0} with {1} method(s)]\", GetType().Name, this.Methods.Count());\n\t\t}\n\t\t\n\t\tpublic OverloadResolution PerformOverloadResolution(ICompilation compilation, ResolveResult[] arguments, string[] argumentNames = null,\n\t\t                                                    bool allowExtensionMethods = true,\n\t\t                                                    bool allowExpandingParams = true, \n\t\t                                                    bool allowOptionalParameters = true,\n\t\t                                                    bool checkForOverflow = false, CSharpConversions conversions = null)\n\t\t{\n\t\t\tLog.WriteLine(\"Performing overload resolution for \" + this);\n\t\t\tLog.WriteCollection(\"  Arguments: \", arguments);\n\t\t\t\n\t\t\tvar typeArgumentArray = this.TypeArguments.ToArray();\n\t\t\tOverloadResolution or = new OverloadResolution(compilation, arguments, argumentNames, typeArgumentArray, conversions);\n\t\t\tor.AllowExpandingParams = allowExpandingParams;\n\t\t\tor.AllowOptionalParameters = allowOptionalParameters;\n\t\t\tor.CheckForOverflow = checkForOverflow;\n\t\t\t\n\t\t\tor.AddMethodLists(methodLists);\n\t\t\t\n\t\t\tif (allowExtensionMethods && !or.FoundApplicableCandidate) {\n\t\t\t\t// No applicable match found, so let's try extension methods.\n\t\t\t\t\n\t\t\t\tvar extensionMethods = this.GetExtensionMethods();\n\t\t\t\t\n\t\t\t\tif (extensionMethods.Any()) {\n\t\t\t\t\tLog.WriteLine(\"No candidate is applicable, trying {0} extension methods groups...\", extensionMethods.Count());\n\t\t\t\t\tResolveResult[] extArguments = new ResolveResult[arguments.Length + 1];\n\t\t\t\t\textArguments[0] = new ResolveResult(this.TargetType);\n\t\t\t\t\targuments.CopyTo(extArguments, 1);\n\t\t\t\t\tstring[] extArgumentNames = null;\n\t\t\t\t\tif (argumentNames != null) {\n\t\t\t\t\t\textArgumentNames = new string[argumentNames.Length + 1];\n\t\t\t\t\t\targumentNames.CopyTo(extArgumentNames, 1);\n\t\t\t\t\t}\n\t\t\t\t\tvar extOr = new OverloadResolution(compilation, extArguments, extArgumentNames, typeArgumentArray, conversions);\n\t\t\t\t\textOr.AllowExpandingParams = allowExpandingParams;\n\t\t\t\t\textOr.AllowOptionalParameters = allowOptionalParameters;\n\t\t\t\t\textOr.IsExtensionMethodInvocation = true;\n\t\t\t\t\textOr.CheckForOverflow = checkForOverflow;\n\t\t\t\t\t\n\t\t\t\t\tforeach (var g in extensionMethods) {\n\t\t\t\t\t\tforeach (var method in g) {\n\t\t\t\t\t\t\tLog.Indent();\n\t\t\t\t\t\t\tOverloadResolutionErrors errors = extOr.AddCandidate(method);\n\t\t\t\t\t\t\tLog.Unindent();\n\t\t\t\t\t\t\tor.LogCandidateAddingResult(\"  Extension\", method, errors);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (extOr.FoundApplicableCandidate)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// For the lack of a better comparison function (the one within OverloadResolution\n\t\t\t\t\t// cannot be used as it depends on the argument set):\n\t\t\t\t\tif (extOr.FoundApplicableCandidate || or.BestCandidate == null) {\n\t\t\t\t\t\t// Consider an extension method result better than the normal result only\n\t\t\t\t\t\t// if it's applicable; or if there is no normal result.\n\t\t\t\t\t\tor = extOr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog.WriteLine(\"Overload resolution finished, best candidate is {0}.\", or.GetBestCandidateWithSubstitutedTypeArguments());\n\t\t\treturn or;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<ResolveResult> GetChildResults()\n\t\t{\n\t\t\tif (targetResult != null)\n\t\t\t\treturn new[] { targetResult };\n\t\t\telse\n\t\t\t\treturn Enumerable.Empty<ResolveResult>();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/NodeListResolveVisitorNavigator.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// <see cref=\"IResolveVisitorNavigator\"/> implementation that resolves a list of nodes.\n\t/// We will skip all nodes which are not the target nodes or ancestors of the target nodes.\n\t/// </summary>\n\tpublic class NodeListResolveVisitorNavigator : IResolveVisitorNavigator\n\t{\n\t\treadonly Dictionary<AstNode, ResolveVisitorNavigationMode> dict = new Dictionary<AstNode, ResolveVisitorNavigationMode>();\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new NodeListResolveVisitorNavigator that resolves the specified nodes.\n\t\t/// </summary>\n\t\tpublic NodeListResolveVisitorNavigator(params AstNode[] nodes)\n\t\t\t: this((IEnumerable<AstNode>)nodes)\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new NodeListResolveVisitorNavigator that resolves the specified nodes.\n\t\t/// </summary>\n\t\tpublic NodeListResolveVisitorNavigator(IEnumerable<AstNode> nodes, bool scanOnly = false)\n\t\t{\n\t\t\tif (nodes == null)\n\t\t\t\tthrow new ArgumentNullException(\"nodes\");\n\t\t\tforeach (var node in nodes) {\n\t\t\t\tdict[node] = scanOnly ? ResolveVisitorNavigationMode.Scan : ResolveVisitorNavigationMode.Resolve;\n\t\t\t\tfor (var ancestor = node.Parent; ancestor != null && !dict.ContainsKey(ancestor); ancestor = ancestor.Parent) {\n\t\t\t\t\tdict.Add(ancestor, ResolveVisitorNavigationMode.Scan);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic virtual ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t{\n\t\t\tResolveVisitorNavigationMode mode;\n\t\t\tif (dict.TryGetValue(node, out mode)) {\n\t\t\t\treturn mode;\n\t\t\t} else {\n\t\t\t\treturn ResolveVisitorNavigationMode.Skip;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic virtual void Resolved(AstNode node, ResolveResult result)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic virtual void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// C# overload resolution (C# 4.0 spec: §7.5).\n\t/// </summary>\n\tpublic class OverloadResolution\n\t{\n\t\tsealed class Candidate\n\t\t{\n\t\t\tpublic readonly IParameterizedMember Member;\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Returns the normal form candidate, if this is an expanded candidate.\n\t\t\t/// </summary>\n\t\t\tpublic readonly bool IsExpandedForm;\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Gets the parameter types. In the first step, these are the types without any substition.\n\t\t\t/// After type inference, substitutions will be performed.\n\t\t\t/// </summary>\n\t\t\tpublic readonly IType[] ParameterTypes;\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// argument index -> parameter index; -1 for arguments that could not be mapped\n\t\t\t/// </summary>\n\t\t\tpublic int[] ArgumentToParameterMap;\n\t\t\t\n\t\t\tpublic OverloadResolutionErrors Errors;\n\t\t\tpublic int ErrorCount;\n\t\t\t\n\t\t\tpublic bool HasUnmappedOptionalParameters;\n\t\t\t\n\t\t\tpublic IType[] InferredTypes;\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Gets the original member parameters (before any substitution!)\n\t\t\t/// </summary>\n\t\t\tpublic readonly IList<IParameter> Parameters;\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Gets the original method type parameters (before any substitution!)\n\t\t\t/// </summary>\n\t\t\tpublic readonly IList<ITypeParameter> TypeParameters;\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Conversions applied to the arguments.\n\t\t\t/// This field is set by the CheckApplicability step.\n\t\t\t/// </summary>\n\t\t\tpublic Conversion[] ArgumentConversions;\n\t\t\t\n\t\t\tpublic bool IsGenericMethod {\n\t\t\t\tget {\n\t\t\t\t\tIMethod method = Member as IMethod;\n\t\t\t\t\treturn method != null && method.TypeParameters.Count > 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic int ArgumentsPassedToParamsArray {\n\t\t\t\tget {\n\t\t\t\t\tint count = 0;\n\t\t\t\t\tif (IsExpandedForm) {\n\t\t\t\t\t\tint paramsParameterIndex = this.Parameters.Count - 1;\n\t\t\t\t\t\tforeach (int parameterIndex in ArgumentToParameterMap) {\n\t\t\t\t\t\t\tif (parameterIndex == paramsParameterIndex)\n\t\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn count;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic Candidate(IParameterizedMember member, bool isExpanded)\n\t\t\t{\n\t\t\t\tthis.Member = member;\n\t\t\t\tthis.IsExpandedForm = isExpanded;\n\t\t\t\tIParameterizedMember memberDefinition = (IParameterizedMember)member.MemberDefinition;\n\t\t\t\t// For specificialized methods, go back to the original parameters:\n\t\t\t\t// (without any type parameter substitution, not even class type parameters)\n\t\t\t\t// We'll re-substitute them as part of RunTypeInference().\n\t\t\t\tthis.Parameters = memberDefinition.Parameters;\n\t\t\t\tIMethod methodDefinition = memberDefinition as IMethod;\n\t\t\t\tif (methodDefinition != null && methodDefinition.TypeParameters.Count > 0) {\n\t\t\t\t\tthis.TypeParameters = methodDefinition.TypeParameters;\n\t\t\t\t}\n\t\t\t\tthis.ParameterTypes = new IType[this.Parameters.Count];\n\t\t\t}\n\t\t\t\n\t\t\tpublic void AddError(OverloadResolutionErrors newError)\n\t\t\t{\n\t\t\t\tthis.Errors |= newError;\n\t\t\t\tif (!IsApplicable(newError))\n\t\t\t\t\tthis.ErrorCount++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treadonly ICompilation compilation;\n\t\treadonly ResolveResult[] arguments;\n\t\treadonly string[] argumentNames;\n\t\treadonly CSharpConversions conversions;\n\t\t//List<Candidate> candidates = new List<Candidate>();\n\t\tCandidate bestCandidate;\n\t\tCandidate bestCandidateAmbiguousWith;\n\t\tIType[] explicitlyGivenTypeArguments;\n\t\tbool bestCandidateWasValidated;\n\t\tOverloadResolutionErrors bestCandidateValidationResult;\n\t\t\n\t\t#region Constructor\n\t\tpublic OverloadResolution(ICompilation compilation, ResolveResult[] arguments, string[] argumentNames = null, IType[] typeArguments = null, CSharpConversions conversions = null)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tif (arguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"arguments\");\n\t\t\tif (argumentNames == null)\n\t\t\t\targumentNames = new string[arguments.Length];\n\t\t\telse if (argumentNames.Length != arguments.Length)\n\t\t\t\tthrow new ArgumentException(\"argumentsNames.Length must be equal to arguments.Length\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.arguments = arguments;\n\t\t\tthis.argumentNames = argumentNames;\n\t\t\t\n\t\t\t// keep explicitlyGivenTypeArguments==null when no type arguments were specified\n\t\t\tif (typeArguments != null && typeArguments.Length > 0)\n\t\t\t\tthis.explicitlyGivenTypeArguments = typeArguments;\n\t\t\t\n\t\t\tthis.conversions = conversions ?? CSharpConversions.Get(compilation);\n\t\t\tthis.AllowExpandingParams = true;\n\t\t\tthis.AllowOptionalParameters = true;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Input Properties\n\t\t/// <summary>\n\t\t/// Gets/Sets whether the methods are extension methods that are being called using extension method syntax.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Setting this property to true restricts the possible conversions on the first argument to\n\t\t/// implicit identity, reference, or boxing conversions.\n\t\t/// </remarks>\n\t\tpublic bool IsExtensionMethodInvocation { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether expanding 'params' into individual elements is allowed.\n\t\t/// The default value is true.\n\t\t/// </summary>\n\t\tpublic bool AllowExpandingParams { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether optional parameters may be left at their default value.\n\t\t/// The default value is true.\n\t\t/// If this property is set to false, optional parameters will be treated like regular parameters.\n\t\t/// </summary>\n\t\tpublic bool AllowOptionalParameters { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether ConversionResolveResults created by this OverloadResolution\n\t\t/// instance apply overflow checking.\n\t\t/// The default value is false.\n\t\t/// </summary>\n\t\tpublic bool CheckForOverflow { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the arguments for which this OverloadResolution instance was created.\n\t\t/// </summary>\n\t\tpublic IList<ResolveResult> Arguments {\n\t\t\tget { return arguments; }\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region AddCandidate\n\t\t/// <summary>\n\t\t/// Adds a candidate to overload resolution.\n\t\t/// </summary>\n\t\t/// <param name=\"member\">The candidate member to add.</param>\n\t\t/// <returns>The errors that prevent the member from being applicable, if any.\n\t\t/// Note: this method does not return errors that do not affect applicability.</returns>\n\t\tpublic OverloadResolutionErrors AddCandidate(IParameterizedMember member)\n\t\t{\n\t\t\treturn AddCandidate(member, OverloadResolutionErrors.None);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds a candidate to overload resolution.\n\t\t/// </summary>\n\t\t/// <param name=\"member\">The candidate member to add.</param>\n\t\t/// <param name=\"additionalErrors\">Additional errors that apply to the candidate.\n\t\t/// This is used to represent errors during member lookup (e.g. OverloadResolutionErrors.Inaccessible)\n\t\t/// in overload resolution.</param>\n\t\t/// <returns>The errors that prevent the member from being applicable, if any.\n\t\t/// Note: this method does not return errors that do not affect applicability.</returns>\n\t\tpublic OverloadResolutionErrors AddCandidate(IParameterizedMember member, OverloadResolutionErrors additionalErrors)\n\t\t{\n\t\t\tif (member == null)\n\t\t\t\tthrow new ArgumentNullException(\"member\");\n\t\t\t\n\t\t\tCandidate c = new Candidate(member, false);\n\t\t\tc.AddError(additionalErrors);\n\t\t\tif (CalculateCandidate(c)) {\n\t\t\t\t//candidates.Add(c);\n\t\t\t}\n\t\t\t\n\t\t\tif (this.AllowExpandingParams && member.Parameters.Count > 0\n\t\t\t    && member.Parameters[member.Parameters.Count - 1].IsParams)\n\t\t\t{\n\t\t\t\tCandidate expandedCandidate = new Candidate(member, true);\n\t\t\t\texpandedCandidate.AddError(additionalErrors);\n\t\t\t\t// consider expanded form only if it isn't obviously wrong\n\t\t\t\tif (CalculateCandidate(expandedCandidate)) {\n\t\t\t\t\t//candidates.Add(expandedCandidate);\n\t\t\t\t\t\n\t\t\t\t\tif (expandedCandidate.ErrorCount < c.ErrorCount)\n\t\t\t\t\t\treturn expandedCandidate.Errors;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn c.Errors;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Calculates applicability etc. for the candidate.\n\t\t/// </summary>\n\t\t/// <returns>True if the calculation was successful, false if the candidate should be removed without reporting an error</returns>\n\t\tbool CalculateCandidate(Candidate candidate)\n\t\t{\n\t\t\tif (!ResolveParameterTypes(candidate, false))\n\t\t\t\treturn false;\n\t\t\tMapCorrespondingParameters(candidate);\n\t\t\tRunTypeInference(candidate);\n\t\t\tCheckApplicability(candidate);\n\t\t\tConsiderIfNewCandidateIsBest(candidate);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tbool ResolveParameterTypes(Candidate candidate, bool useSpecializedParameters)\n\t\t{\n\t\t\tfor (int i = 0; i < candidate.Parameters.Count; i++) {\n\t\t\t\tIType type;\n\t\t\t\tif (useSpecializedParameters) {\n\t\t\t\t\t// Use the parameter type of the specialized non-generic method or indexer\n\t\t\t\t\tDebug.Assert(!candidate.IsGenericMethod);\n\t\t\t\t\ttype = candidate.Member.Parameters[i].Type;\n\t\t\t\t} else {\n\t\t\t\t\t// Use the type of the original formal parameter\n\t\t\t\t\ttype = candidate.Parameters[i].Type;\n\t\t\t\t}\n\t\t\t\tif (candidate.IsExpandedForm && i == candidate.Parameters.Count - 1) {\n\t\t\t\t\tArrayType arrayType = type as ArrayType;\n\t\t\t\t\tif (arrayType != null && arrayType.Dimensions == 1)\n\t\t\t\t\t\ttype = arrayType.ElementType;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn false; // error: cannot unpack params-array. abort considering the expanded form for this candidate\n\t\t\t\t}\n\t\t\t\tcandidate.ParameterTypes[i] = type;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region AddMethodLists\n\t\t/// <summary>\n\t\t/// Adds all candidates from the method lists.\n\t\t/// \n\t\t/// This method implements the logic that causes applicable methods in derived types to hide\n\t\t/// all methods in base types.\n\t\t/// </summary>\n\t\t/// <param name=\"methodLists\">The methods, grouped by declaring type. Base types must come first in the list.</param>\n\t\tpublic void AddMethodLists(IList<MethodListWithDeclaringType> methodLists)\n\t\t{\n\t\t\tif (methodLists == null)\n\t\t\t\tthrow new ArgumentNullException(\"methodLists\");\n\t\t\t// Base types come first, so go through the list backwards (derived types first)\n\t\t\tbool[] isHiddenByDerivedType;\n\t\t\tif (methodLists.Count > 1)\n\t\t\t\tisHiddenByDerivedType = new bool[methodLists.Count];\n\t\t\telse\n\t\t\t\tisHiddenByDerivedType = null;\n\t\t\tfor (int i = methodLists.Count - 1; i >= 0; i--) {\n\t\t\t\tif (isHiddenByDerivedType != null && isHiddenByDerivedType[i]) {\n\t\t\t\t\tLog.WriteLine(\"  Skipping methods in {0} because they are hidden by an applicable method in a derived type\", methodLists[i].DeclaringType);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMethodListWithDeclaringType methodList = methodLists[i];\n\t\t\t\tbool foundApplicableCandidateInCurrentList = false;\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < methodList.Count; j++) {\n\t\t\t\t\tIParameterizedMember method = methodList[j];\n\t\t\t\t\tLog.Indent();\n\t\t\t\t\tOverloadResolutionErrors errors = AddCandidate(method);\n\t\t\t\t\tLog.Unindent();\n\t\t\t\t\tLogCandidateAddingResult(\"  Candidate\", method, errors);\n\t\t\t\t\t\n\t\t\t\t\tfoundApplicableCandidateInCurrentList |= IsApplicable(errors);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (foundApplicableCandidateInCurrentList && i > 0) {\n\t\t\t\t\tforeach (IType baseType in methodList.DeclaringType.GetAllBaseTypes()) {\n\t\t\t\t\t\tfor (int j = 0; j < i; j++) {\n\t\t\t\t\t\t\tif (!isHiddenByDerivedType[j] && baseType.Equals(methodLists[j].DeclaringType))\n\t\t\t\t\t\t\t\tisHiddenByDerivedType[j] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Conditional(\"DEBUG\")]\n\t\tinternal void LogCandidateAddingResult(string text, IParameterizedMember method, OverloadResolutionErrors errors)\n\t\t{\n\t\t\t#if DEBUG\n\t\t\tLog.WriteLine(string.Format(\"{0} {1} = {2}{3}\",\n\t\t\t                            text, method,\n\t\t\t                            errors == OverloadResolutionErrors.None ? \"Success\" : errors.ToString(),\n\t\t\t                            this.BestCandidate == method ? \" (best candidate so far)\" :\n\t\t\t                            this.BestCandidateAmbiguousWith == method ? \" (ambiguous)\" : \"\"\n\t\t\t                           ));\n\t\t\t#endif\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MapCorrespondingParameters\n\t\tvoid MapCorrespondingParameters(Candidate candidate)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.5.1.1 Corresponding parameters\n\t\t\tcandidate.ArgumentToParameterMap = new int[arguments.Length];\n\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\tcandidate.ArgumentToParameterMap[i] = -1;\n\t\t\t\tif (argumentNames[i] == null) {\n\t\t\t\t\t// positional argument\n\t\t\t\t\tif (i < candidate.ParameterTypes.Length) {\n\t\t\t\t\t\tcandidate.ArgumentToParameterMap[i] = i;\n\t\t\t\t\t} else if (candidate.IsExpandedForm) {\n\t\t\t\t\t\tcandidate.ArgumentToParameterMap[i] = candidate.ParameterTypes.Length - 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.TooManyPositionalArguments);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// named argument\n\t\t\t\t\tfor (int j = 0; j < candidate.Parameters.Count; j++) {\n\t\t\t\t\t\tif (argumentNames[i] == candidate.Parameters[j].Name) {\n\t\t\t\t\t\t\tcandidate.ArgumentToParameterMap[i] = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (candidate.ArgumentToParameterMap[i] < 0)\n\t\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.NoParameterFoundForNamedArgument);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region RunTypeInference\n\t\tvoid RunTypeInference(Candidate candidate)\n\t\t{\n\t\t\tif (candidate.TypeParameters == null) {\n\t\t\t\tif (explicitlyGivenTypeArguments != null) {\n\t\t\t\t\t// method does not expect type arguments, but was given some\n\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.WrongNumberOfTypeArguments);\n\t\t\t\t}\n\t\t\t\t// Grab new parameter types:\n\t\t\t\tResolveParameterTypes(candidate, true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tParameterizedType parameterizedDeclaringType = candidate.Member.DeclaringType as ParameterizedType;\n\t\t\tIList<IType> classTypeArguments;\n\t\t\tif (parameterizedDeclaringType != null) {\n\t\t\t\tclassTypeArguments = parameterizedDeclaringType.TypeArguments;\n\t\t\t} else {\n\t\t\t\tclassTypeArguments = null;\n\t\t\t}\n\t\t\t// The method is generic:\n\t\t\tif (explicitlyGivenTypeArguments != null) {\n\t\t\t\tif (explicitlyGivenTypeArguments.Length == candidate.TypeParameters.Count) {\n\t\t\t\t\tcandidate.InferredTypes = explicitlyGivenTypeArguments;\n\t\t\t\t} else {\n\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.WrongNumberOfTypeArguments);\n\t\t\t\t\t// wrong number of type arguments given, so truncate the list or pad with UnknownType\n\t\t\t\t\tcandidate.InferredTypes = new IType[candidate.TypeParameters.Count];\n\t\t\t\t\tfor (int i = 0; i < candidate.InferredTypes.Length; i++) {\n\t\t\t\t\t\tif (i < explicitlyGivenTypeArguments.Length)\n\t\t\t\t\t\t\tcandidate.InferredTypes[i] = explicitlyGivenTypeArguments[i];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcandidate.InferredTypes[i] = SpecialType.UnknownType;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTypeInference ti = new TypeInference(compilation, conversions);\n\t\t\t\tbool success;\n\t\t\t\tcandidate.InferredTypes = ti.InferTypeArguments(candidate.TypeParameters, arguments, candidate.ParameterTypes, out success, classTypeArguments);\n\t\t\t\tif (!success)\n\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.TypeInferenceFailed);\n\t\t\t}\n\t\t\t// Now substitute in the formal parameters:\n\t\t\tvar substitution = new ConstraintValidatingSubstitution(classTypeArguments, candidate.InferredTypes, this);\n\t\t\tfor (int i = 0; i < candidate.ParameterTypes.Length; i++) {\n\t\t\t\tcandidate.ParameterTypes[i] = candidate.ParameterTypes[i].AcceptVisitor(substitution);\n\t\t\t}\n\t\t\tif (!substitution.ConstraintsValid)\n\t\t\t\tcandidate.AddError(OverloadResolutionErrors.ConstructedTypeDoesNotSatisfyConstraint);\n\t\t}\n\t\t\n\t\tsealed class ConstraintValidatingSubstitution : TypeParameterSubstitution\n\t\t{\n\t\t\treadonly CSharpConversions conversions;\n\t\t\tpublic bool ConstraintsValid = true;\n\t\t\t\n\t\t\tpublic ConstraintValidatingSubstitution(IList<IType> classTypeArguments, IList<IType> methodTypeArguments, OverloadResolution overloadResolution)\n\t\t\t\t: base(classTypeArguments, methodTypeArguments)\n\t\t\t{\n\t\t\t\tthis.conversions = overloadResolution.conversions;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitParameterizedType(ParameterizedType type)\n\t\t\t{\n\t\t\t\tIType newType = base.VisitParameterizedType(type);\n\t\t\t\tif (newType != type && ConstraintsValid) {\n\t\t\t\t\t// something was changed, so we need to validate the constraints\n\t\t\t\t\tParameterizedType newParameterizedType = newType as ParameterizedType;\n\t\t\t\t\tif (newParameterizedType != null) {\n\t\t\t\t\t\t// C# 4.0 spec: §4.4.4 Satisfying constraints\n\t\t\t\t\t\tvar typeParameters = newParameterizedType.GetDefinition().TypeParameters;\n\t\t\t\t\t\tvar substitution = newParameterizedType.GetSubstitution();\n\t\t\t\t\t\tfor (int i = 0; i < typeParameters.Count; i++) {\n\t\t\t\t\t\t\tif (!ValidateConstraints(typeParameters[i], newParameterizedType.GetTypeArgument(i), substitution, conversions)) {\n\t\t\t\t\t\t\t\tConstraintsValid = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn newType;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Validate Constraints\n\t\tOverloadResolutionErrors ValidateMethodConstraints(Candidate candidate)\n\t\t{\n\t\t\t// If type inference already failed, we won't check the constraints:\n\t\t\tif ((candidate.Errors & OverloadResolutionErrors.TypeInferenceFailed) != 0)\n\t\t\t\treturn OverloadResolutionErrors.None;\n\t\t\t\n\t\t\tif (candidate.TypeParameters == null || candidate.TypeParameters.Count == 0)\n\t\t\t\treturn OverloadResolutionErrors.None; // the method isn't generic\n\t\t\tvar substitution = GetSubstitution(candidate);\n\t\t\tfor (int i = 0; i < candidate.TypeParameters.Count; i++) {\n\t\t\t\tif (!ValidateConstraints(candidate.TypeParameters[i], substitution.MethodTypeArguments[i], substitution))\n\t\t\t\t\treturn OverloadResolutionErrors.MethodConstraintsNotSatisfied;\n\t\t\t}\n\t\t\treturn OverloadResolutionErrors.None;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Validates whether the given type argument satisfies the constraints for the given type parameter.\n\t\t/// </summary>\n\t\t/// <param name=\"typeParameter\">The type parameter.</param>\n\t\t/// <param name=\"typeArgument\">The type argument.</param>\n\t\t/// <param name=\"substitution\">The substitution that defines how type parameters are replaced with type arguments.\n\t\t/// The substitution is used to check constraints that depend on other type parameters (or recursively on the same type parameter).\n\t\t/// May be null if no substitution should be used.</param>\n\t\t/// <returns>True if the constraints are satisfied; false otherwise.</returns>\n\t\tpublic static bool ValidateConstraints(ITypeParameter typeParameter, IType typeArgument, TypeVisitor substitution = null)\n\t\t{\n\t\t\tif (typeParameter == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeParameter\");\n\t\t\tif (typeArgument == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeArgument\");\n\t\t\treturn ValidateConstraints(typeParameter, typeArgument, substitution, CSharpConversions.Get(typeParameter.Owner.Compilation));\n\t\t}\n\t\t\n\t\tinternal static bool ValidateConstraints(ITypeParameter typeParameter, IType typeArgument, TypeVisitor substitution, CSharpConversions conversions)\n\t\t{\n\t\t\tswitch (typeArgument.Kind) { // void, null, and pointers cannot be used as type arguments\n\t\t\t\tcase TypeKind.Void:\n\t\t\t\tcase TypeKind.Null:\n\t\t\t\tcase TypeKind.Pointer:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (typeParameter.HasReferenceTypeConstraint) {\n\t\t\t\tif (typeArgument.IsReferenceType != true)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (typeParameter.HasValueTypeConstraint) {\n\t\t\t\tif (!NullableType.IsNonNullableValueType(typeArgument))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (typeParameter.HasDefaultConstructorConstraint) {\n\t\t\t\tITypeDefinition def = typeArgument.GetDefinition();\n\t\t\t\tif (def != null && def.IsAbstract)\n\t\t\t\t\treturn false;\n\t\t\t\tvar ctors = typeArgument.GetConstructors(\n\t\t\t\t\tm => m.Parameters.Count == 0 && m.Accessibility == Accessibility.Public,\n\t\t\t\t\tGetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions\n\t\t\t\t);\n\t\t\t\tif (!ctors.Any())\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tforeach (IType constraintType in typeParameter.DirectBaseTypes) {\n\t\t\t\tIType c = constraintType;\n\t\t\t\tif (substitution != null)\n\t\t\t\t\tc = c.AcceptVisitor(substitution);\n\t\t\t\tif (!conversions.IsConstraintConvertible(typeArgument, c))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region CheckApplicability\n\t\t/// <summary>\n\t\t/// Returns whether a candidate with the given errors is still considered to be applicable.\n\t\t/// </summary>\n\t\tpublic static bool IsApplicable(OverloadResolutionErrors errors)\n\t\t{\n\t\t\tconst OverloadResolutionErrors errorsThatDoNotMatterForApplicability =\n\t\t\t\tOverloadResolutionErrors.AmbiguousMatch | OverloadResolutionErrors.MethodConstraintsNotSatisfied;\n\t\t\treturn (errors & ~errorsThatDoNotMatterForApplicability) == OverloadResolutionErrors.None;\n\t\t}\n\t\t\n\t\tvoid CheckApplicability(Candidate candidate)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.5.3.1 Applicable function member\n\t\t\t\n\t\t\t// Test whether parameters were mapped the correct number of arguments:\n\t\t\tint[] argumentCountPerParameter = new int[candidate.ParameterTypes.Length];\n\t\t\tforeach (int parameterIndex in candidate.ArgumentToParameterMap) {\n\t\t\t\tif (parameterIndex >= 0)\n\t\t\t\t\targumentCountPerParameter[parameterIndex]++;\n\t\t\t}\n\t\t\tfor (int i = 0; i < argumentCountPerParameter.Length; i++) {\n\t\t\t\tif (candidate.IsExpandedForm && i == argumentCountPerParameter.Length - 1)\n\t\t\t\t\tcontinue; // any number of arguments is fine for the params-array\n\t\t\t\tif (argumentCountPerParameter[i] == 0) {\n\t\t\t\t\tif (this.AllowOptionalParameters && candidate.Parameters[i].IsOptional)\n\t\t\t\t\t\tcandidate.HasUnmappedOptionalParameters = true;\n\t\t\t\t\telse\n\t\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.MissingArgumentForRequiredParameter);\n\t\t\t\t} else if (argumentCountPerParameter[i] > 1) {\n\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.MultipleArgumentsForSingleParameter);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tcandidate.ArgumentConversions = new Conversion[arguments.Length];\n\t\t\t// Test whether argument passing mode matches the parameter passing mode\n\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\tint parameterIndex = candidate.ArgumentToParameterMap[i];\n\t\t\t\tif (parameterIndex < 0) {\n\t\t\t\t\tcandidate.ArgumentConversions[i] = Conversion.None;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tByReferenceResolveResult brrr = arguments[i] as ByReferenceResolveResult;\n\t\t\t\tif (brrr != null) {\n\t\t\t\t\tif ((brrr.IsOut && !candidate.Parameters[parameterIndex].IsOut) || (brrr.IsRef && !candidate.Parameters[parameterIndex].IsRef))\n\t\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.ParameterPassingModeMismatch);\n\t\t\t\t} else {\n\t\t\t\t\tif (candidate.Parameters[parameterIndex].IsOut || candidate.Parameters[parameterIndex].IsRef)\n\t\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.ParameterPassingModeMismatch);\n\t\t\t\t}\n\t\t\t\tIType parameterType = candidate.ParameterTypes[parameterIndex];\n\t\t\t\tConversion c = conversions.ImplicitConversion(arguments[i], parameterType);\n\t\t\t\tcandidate.ArgumentConversions[i] = c;\n\t\t\t\tif (IsExtensionMethodInvocation && parameterIndex == 0) {\n\t\t\t\t\t// First parameter to extension method must be an identity, reference or boxing conversion\n\t\t\t\t\tif (!(c == Conversion.IdentityConversion || c == Conversion.ImplicitReferenceConversion || c == Conversion.BoxingConversion))\n\t\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.ArgumentTypeMismatch);\n\t\t\t\t} else {\n\t\t\t\t\tif ((!c.IsValid && !c.IsUserDefined && !c.IsMethodGroupConversion) && parameterType.Kind != TypeKind.Unknown)\n\t\t\t\t\t\tcandidate.AddError(OverloadResolutionErrors.ArgumentTypeMismatch);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region BetterFunctionMember\n\t\t/// <summary>\n\t\t/// Returns 1 if c1 is better than c2; 2 if c2 is better than c1; or 0 if neither is better.\n\t\t/// </summary>\n\t\tint BetterFunctionMember(Candidate c1, Candidate c2)\n\t\t{\n\t\t\t// prefer applicable members (part of heuristic that produces a best candidate even if none is applicable)\n\t\t\tif (c1.ErrorCount == 0 && c2.ErrorCount > 0)\n\t\t\t\treturn 1;\n\t\t\tif (c1.ErrorCount > 0 && c2.ErrorCount == 0)\n\t\t\t\treturn 2;\n\t\t\t\n\t\t\t// C# 4.0 spec: §7.5.3.2 Better function member\n\t\t\tbool c1IsBetter = false;\n\t\t\tbool c2IsBetter = false;\n\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\tint p1 = c1.ArgumentToParameterMap[i];\n\t\t\t\tint p2 = c2.ArgumentToParameterMap[i];\n\t\t\t\tif (p1 >= 0 && p2 < 0) {\n\t\t\t\t\tc1IsBetter = true;\n\t\t\t\t} else if (p1 < 0 && p2 >= 0) {\n\t\t\t\t\tc2IsBetter = true;\n\t\t\t\t} else if (p1 >= 0 && p2 >= 0) {\n\t\t\t\t\tswitch (conversions.BetterConversion(arguments[i], c1.ParameterTypes[p1], c2.ParameterTypes[p2])) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tc1IsBetter = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tc2IsBetter = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (c1IsBetter && !c2IsBetter)\n\t\t\t\treturn 1;\n\t\t\tif (!c1IsBetter && c2IsBetter)\n\t\t\t\treturn 2;\n\t\t\t\n\t\t\t// prefer members with less errors (part of heuristic that produces a best candidate even if none is applicable)\n\t\t\tif (c1.ErrorCount < c2.ErrorCount) return 1;\n\t\t\tif (c1.ErrorCount > c2.ErrorCount) return 2;\n\t\t\t\n\t\t\tif (!c1IsBetter && !c2IsBetter) {\n\t\t\t\t// we need the tie-breaking rules\n\t\t\t\t\n\t\t\t\t// non-generic methods are better\n\t\t\t\tif (!c1.IsGenericMethod && c2.IsGenericMethod)\n\t\t\t\t\treturn 1;\n\t\t\t\telse if (c1.IsGenericMethod && !c2.IsGenericMethod)\n\t\t\t\t\treturn 2;\n\t\t\t\t\n\t\t\t\t// non-expanded members are better\n\t\t\t\tif (!c1.IsExpandedForm && c2.IsExpandedForm)\n\t\t\t\t\treturn 1;\n\t\t\t\telse if (c1.IsExpandedForm && !c2.IsExpandedForm)\n\t\t\t\t\treturn 2;\n\t\t\t\t\n\t\t\t\t// prefer the member with less arguments mapped to the params-array\n\t\t\t\tint r = c1.ArgumentsPassedToParamsArray.CompareTo(c2.ArgumentsPassedToParamsArray);\n\t\t\t\tif (r < 0) return 1;\n\t\t\t\telse if (r > 0) return 2;\n\t\t\t\t\n\t\t\t\t// prefer the member where no default values need to be substituted\n\t\t\t\tif (!c1.HasUnmappedOptionalParameters && c2.HasUnmappedOptionalParameters)\n\t\t\t\t\treturn 1;\n\t\t\t\telse if (c1.HasUnmappedOptionalParameters && !c2.HasUnmappedOptionalParameters)\n\t\t\t\t\treturn 2;\n\t\t\t\t\n\t\t\t\t// compare the formal parameters\n\t\t\t\tr = MoreSpecificFormalParameters(c1, c2);\n\t\t\t\tif (r != 0)\n\t\t\t\t\treturn r;\n\t\t\t\t\n\t\t\t\t// prefer non-lifted operators\n\t\t\t\tILiftedOperator lift1 = c1.Member as ILiftedOperator;\n\t\t\t\tILiftedOperator lift2 = c2.Member as ILiftedOperator;\n\t\t\t\tif (lift1 == null && lift2 != null)\n\t\t\t\t\treturn 1;\n\t\t\t\tif (lift1 != null && lift2 == null)\n\t\t\t\t\treturn 2;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Implement this interface to give overload resolution a hint that the member represents a lifted operator,\n\t\t/// which is used in the tie-breaking rules.\n\t\t/// </summary>\n\t\tpublic interface ILiftedOperator : IParameterizedMember\n\t\t{\n\t\t\tIList<IParameter> NonLiftedParameters { get; }\n\t\t}\n\t\t\n\t\tint MoreSpecificFormalParameters(Candidate c1, Candidate c2)\n\t\t{\n\t\t\t// prefer the member with more formal parmeters (in case both have different number of optional parameters)\n\t\t\tint r = c1.Parameters.Count.CompareTo(c2.Parameters.Count);\n\t\t\tif (r > 0) return 1;\n\t\t\telse if (r < 0) return 2;\n\t\t\t\n\t\t\treturn MoreSpecificFormalParameters(c1.Parameters.Select(p => p.Type), c2.Parameters.Select(p => p.Type));\n\t\t}\n\t\t\n\t\tstatic int MoreSpecificFormalParameters(IEnumerable<IType> t1, IEnumerable<IType> t2)\n\t\t{\n\t\t\tbool c1IsBetter = false;\n\t\t\tbool c2IsBetter = false;\n\t\t\tforeach (var pair in t1.Zip(t2, (a,b) => new { Item1 = a, Item2 = b })) {\n\t\t\t\tswitch (MoreSpecificFormalParameter(pair.Item1, pair.Item2)) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tc1IsBetter = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tc2IsBetter = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (c1IsBetter && !c2IsBetter)\n\t\t\t\treturn 1;\n\t\t\tif (!c1IsBetter && c2IsBetter)\n\t\t\t\treturn 2;\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tstatic int MoreSpecificFormalParameter(IType t1, IType t2)\n\t\t{\n\t\t\tif ((t1 is ITypeParameter) && !(t2 is ITypeParameter))\n\t\t\t\treturn 2;\n\t\t\tif ((t2 is ITypeParameter) && !(t1 is ITypeParameter))\n\t\t\t\treturn 1;\n\t\t\t\n\t\t\tParameterizedType p1 = t1 as ParameterizedType;\n\t\t\tParameterizedType p2 = t2 as ParameterizedType;\n\t\t\tif (p1 != null && p2 != null && p1.TypeParameterCount == p2.TypeParameterCount) {\n\t\t\t\tint r = MoreSpecificFormalParameters(p1.TypeArguments, p2.TypeArguments);\n\t\t\t\tif (r > 0)\n\t\t\t\t\treturn r;\n\t\t\t}\n\t\t\tTypeWithElementType tew1 = t1 as TypeWithElementType;\n\t\t\tTypeWithElementType tew2 = t2 as TypeWithElementType;\n\t\t\tif (tew1 != null && tew2 != null) {\n\t\t\t\treturn MoreSpecificFormalParameter(tew1.ElementType, tew2.ElementType);\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ConsiderIfNewCandidateIsBest\n\t\tvoid ConsiderIfNewCandidateIsBest(Candidate candidate)\n\t\t{\n\t\t\tif (bestCandidate == null) {\n\t\t\t\tbestCandidate = candidate;\n\t\t\t\tbestCandidateWasValidated = false;\n\t\t\t} else {\n\t\t\t\tswitch (BetterFunctionMember(candidate, bestCandidate)) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t// Overwrite 'bestCandidateAmbiguousWith' so that API users can\n\t\t\t\t\t\t// detect the set of all ambiguous methods if they look at\n\t\t\t\t\t\t// bestCandidateAmbiguousWith after each step.\n\t\t\t\t\t\tbestCandidateAmbiguousWith = candidate;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tbestCandidate = candidate;\n\t\t\t\t\t\tbestCandidateWasValidated = false;\n\t\t\t\t\t\tbestCandidateAmbiguousWith = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// case 2: best candidate stays best\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Output Properties\n\t\tpublic IParameterizedMember BestCandidate {\n\t\t\tget { return bestCandidate != null ? bestCandidate.Member : null; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the errors that apply to the best candidate.\n\t\t/// This includes additional errors that do not affect applicability (e.g. AmbiguousMatch, MethodConstraintsNotSatisfied)\n\t\t/// </summary>\n\t\tpublic OverloadResolutionErrors BestCandidateErrors {\n\t\t\tget {\n\t\t\t\tif (bestCandidate == null)\n\t\t\t\t\treturn OverloadResolutionErrors.None;\n\t\t\t\tif (!bestCandidateWasValidated) {\n\t\t\t\t\tbestCandidateValidationResult = ValidateMethodConstraints(bestCandidate);\n\t\t\t\t\tbestCandidateWasValidated = true;\n\t\t\t\t}\n\t\t\t\tOverloadResolutionErrors err = bestCandidate.Errors | bestCandidateValidationResult;\n\t\t\t\tif (bestCandidateAmbiguousWith != null)\n\t\t\t\t\terr |= OverloadResolutionErrors.AmbiguousMatch;\n\t\t\t\treturn err;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool FoundApplicableCandidate {\n\t\t\tget { return bestCandidate != null && IsApplicable(bestCandidate.Errors); }\n\t\t}\n\t\t\n\t\tpublic IParameterizedMember BestCandidateAmbiguousWith {\n\t\t\tget { return bestCandidateAmbiguousWith != null ? bestCandidateAmbiguousWith.Member : null; }\n\t\t}\n\t\t\n\t\tpublic bool BestCandidateIsExpandedForm {\n\t\t\tget { return bestCandidate != null ? bestCandidate.IsExpandedForm : false; }\n\t\t}\n\t\t\n\t\tpublic bool IsAmbiguous {\n\t\t\tget { return bestCandidateAmbiguousWith != null; }\n\t\t}\n\t\t\n\t\tpublic IList<IType> InferredTypeArguments {\n\t\t\tget {\n\t\t\t\tif (bestCandidate != null && bestCandidate.InferredTypes != null)\n\t\t\t\t\treturn bestCandidate.InferredTypes;\n\t\t\t\telse\n\t\t\t\t\treturn EmptyList<IType>.Instance;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the implicit conversions that are being applied to the arguments.\n\t\t/// </summary>\n\t\tpublic IList<Conversion> ArgumentConversions {\n\t\t\tget {\n\t\t\t\tif (bestCandidate != null && bestCandidate.ArgumentConversions != null)\n\t\t\t\t\treturn bestCandidate.ArgumentConversions;\n\t\t\t\telse\n\t\t\t\t\treturn Enumerable.Repeat(Conversion.None, arguments.Length).ToList();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets an array that maps argument indices to parameter indices.\n\t\t/// For arguments that could not be mapped to any parameter, the value will be -1.\n\t\t/// \n\t\t/// parameterIndex = GetArgumentToParameterMap()[argumentIndex]\n\t\t/// </summary>\n\t\tpublic IList<int> GetArgumentToParameterMap()\n\t\t{\n\t\t\tif (bestCandidate != null)\n\t\t\t\treturn bestCandidate.ArgumentToParameterMap;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the arguments for the method call in the order they were provided (not in the order of the parameters).\n\t\t/// Arguments are wrapped in a <see cref=\"ConversionResolveResult\"/> if an implicit conversion is being applied\n\t\t/// to them when calling the method.\n\t\t/// </summary>\n\t\tpublic IList<ResolveResult> GetArgumentsWithConversions()\n\t\t{\n\t\t\tif (bestCandidate == null)\n\t\t\t\treturn arguments;\n\t\t\telse\n\t\t\t\treturn GetArgumentsWithConversions(null, null);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the arguments for the method call in the order they were provided (not in the order of the parameters).\n\t\t/// Arguments are wrapped in a <see cref=\"ConversionResolveResult\"/> if an implicit conversion is being applied\n\t\t/// to them when calling the method.\n\t\t/// For arguments where an explicit argument name was provided, the argument will\n\t\t/// be wrapped in a <see cref=\"NamedArgumentResolveResult\"/>.\n\t\t/// </summary>\n\t\tpublic IList<ResolveResult> GetArgumentsWithConversionsAndNames()\n\t\t{\n\t\t\tif (bestCandidate == null)\n\t\t\t\treturn arguments;\n\t\t\telse\n\t\t\t\treturn GetArgumentsWithConversions(null, GetBestCandidateWithSubstitutedTypeArguments());\n\t\t}\n\t\t\n\t\tIList<ResolveResult> GetArgumentsWithConversions(ResolveResult targetResolveResult, IParameterizedMember bestCandidateForNamedArguments)\n\t\t{\n\t\t\tvar conversions = this.ArgumentConversions;\n\t\t\tResolveResult[] args = new ResolveResult[arguments.Length];\n\t\t\tfor (int i = 0; i < args.Length; i++) {\n\t\t\t\tvar argument = arguments[i];\n\t\t\t\tif (this.IsExtensionMethodInvocation && i == 0 && targetResolveResult != null)\n\t\t\t\t\targument = targetResolveResult;\n\t\t\t\tint parameterIndex = bestCandidate.ArgumentToParameterMap[i];\n\t\t\t\tif (parameterIndex >= 0 && conversions[i] != Conversion.IdentityConversion) {\n\t\t\t\t\t// Wrap argument in ConversionResolveResult\n\t\t\t\t\tIType parameterType = bestCandidate.ParameterTypes[parameterIndex];\n\t\t\t\t\tif (parameterType.Kind != TypeKind.Unknown) {\n\t\t\t\t\t\tif (arguments[i].IsCompileTimeConstant && conversions[i].IsValid && !conversions[i].IsUserDefined) {\n\t\t\t\t\t\t\targument = new CSharpResolver(compilation).WithCheckForOverflow(CheckForOverflow).ResolveCast(parameterType, argument);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\targument = new ConversionResolveResult(parameterType, argument, conversions[i], CheckForOverflow);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (bestCandidateForNamedArguments != null && argumentNames[i] != null) {\n\t\t\t\t\t// Wrap argument in NamedArgumentResolveResult\n\t\t\t\t\tif (parameterIndex >= 0) {\n\t\t\t\t\t\targument = new NamedArgumentResolveResult(bestCandidateForNamedArguments.Parameters[parameterIndex], argument, bestCandidateForNamedArguments);\n\t\t\t\t\t} else {\n\t\t\t\t\t\targument = new NamedArgumentResolveResult(argumentNames[i], argument);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\targs[i] = argument;\n\t\t\t}\n\t\t\treturn args;\n\t\t}\n\t\t\n\t\tpublic IParameterizedMember GetBestCandidateWithSubstitutedTypeArguments()\n\t\t{\n\t\t\tif (bestCandidate == null)\n\t\t\t\treturn null;\n\t\t\tIMethod method = bestCandidate.Member as IMethod;\n\t\t\tif (method != null && method.TypeParameters.Count > 0) {\n\t\t\t\treturn ((IMethod)method.MemberDefinition).Specialize(GetSubstitution(bestCandidate));\n\t\t\t} else {\n\t\t\t\treturn bestCandidate.Member;\n\t\t\t}\n\t\t}\n\t\t\n\t\tTypeParameterSubstitution GetSubstitution(Candidate candidate)\n\t\t{\n\t\t\t// Do not compose the substitutions, but merge them.\n\t\t\t// This is required for InvocationTests.SubstituteClassAndMethodTypeParametersAtOnce\n\t\t\treturn new TypeParameterSubstitution(candidate.Member.Substitution.ClassTypeArguments, candidate.InferredTypes);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a ResolveResult representing the result of overload resolution.\n\t\t/// </summary>\n\t\t/// <param name=\"targetResolveResult\">\n\t\t/// The target expression of the call. May be <c>null</c> for static methods/constructors.\n\t\t/// </param>\n\t\t/// <param name=\"initializerStatements\">\n\t\t/// Statements for Objects/Collections initializer.\n\t\t/// <see cref=\"InvocationResolveResult.InitializerStatements\"/>\n\t\t/// <param name=\"returnTypeOverride\">\n\t\t/// If not null, use this instead of the ReturnType of the member as the type of the created resolve result.\n\t\t/// </param>\n\t\tpublic CSharpInvocationResolveResult CreateResolveResult(ResolveResult targetResolveResult, IList<ResolveResult> initializerStatements = null, IType returnTypeOverride = null)\n\t\t{\n\t\t\tIParameterizedMember member = GetBestCandidateWithSubstitutedTypeArguments();\n\t\t\tif (member == null)\n\t\t\t\tthrow new InvalidOperationException();\n\n\t\t\treturn new CSharpInvocationResolveResult(\n\t\t\t\tthis.IsExtensionMethodInvocation ? new TypeResolveResult(member.DeclaringType) : targetResolveResult,\n\t\t\t\tmember,\n\t\t\t\tGetArgumentsWithConversions(targetResolveResult, member),\n\t\t\t\tthis.BestCandidateErrors,\n\t\t\t\tthis.IsExtensionMethodInvocation,\n\t\t\t\tthis.BestCandidateIsExpandedForm,\n\t\t\t\tisDelegateInvocation: false,\n\t\t\t\targumentToParameterMap: this.GetArgumentToParameterMap(),\n\t\t\t\tinitializerStatements: initializerStatements,\n\t\t\t\treturnTypeOverride: returnTypeOverride);\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolutionErrors.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[Flags]\n\tpublic enum OverloadResolutionErrors\n\t{\n\t\tNone = 0,\n\t\t/// <summary>\n\t\t/// Too many positional arguments (some could not be mapped to any parameter).\n\t\t/// </summary>\n\t\tTooManyPositionalArguments = 0x0001,\n\t\t/// <summary>\n\t\t/// A named argument could not be mapped to any parameter\n\t\t/// </summary>\n\t\tNoParameterFoundForNamedArgument = 0x0002,\n\t\t/// <summary>\n\t\t/// Type inference failed for a generic method.\n\t\t/// </summary>\n\t\tTypeInferenceFailed = 0x0004,\n\t\t/// <summary>\n\t\t/// Type arguments were explicitly specified, but did not match the number of type parameters.\n\t\t/// </summary>\n\t\tWrongNumberOfTypeArguments = 0x0008,\n\t\t/// <summary>\n\t\t/// After substituting type parameters with the inferred types; a constructed type within the formal parameters\n\t\t/// does not satisfy its constraint.\n\t\t/// </summary>\n\t\tConstructedTypeDoesNotSatisfyConstraint = 0x0010,\n\t\t/// <summary>\n\t\t/// No argument was mapped to a non-optional parameter\n\t\t/// </summary>\n\t\tMissingArgumentForRequiredParameter = 0x0020,\n\t\t/// <summary>\n\t\t/// Several arguments were mapped to a single (non-params-array) parameter\n\t\t/// </summary>\n\t\tMultipleArgumentsForSingleParameter = 0x0040,\n\t\t/// <summary>\n\t\t/// 'ref'/'out' passing mode doesn't match for at least 1 parameter\n\t\t/// </summary>\n\t\tParameterPassingModeMismatch = 0x0080,\n\t\t/// <summary>\n\t\t/// Argument type cannot be converted to parameter type\n\t\t/// </summary>\n\t\tArgumentTypeMismatch = 0x0100,\n\t\t/// <summary>\n\t\t/// There is no unique best overload.\n\t\t/// This error does not apply to any single candidate, but only to the overall result of overload resolution.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This error does not prevent a candidate from being applicable.\n\t\t/// </remarks>\n\t\tAmbiguousMatch = 0x0200,\n\t\t/// <summary>\n\t\t/// The member is not accessible.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This error is generated by member lookup; not by overload resolution.\n\t\t/// </remarks>\n\t\tInaccessible = 0x0400,\n\t\t/// <summary>\n\t\t/// A generic method \n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This error does not prevent a candidate from being applicable.\n\t\t/// </remarks>\n\t\tMethodConstraintsNotSatisfied = 0x0800\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ReducedExtensionMethod.cs",
    "content": "﻿//\n// ReducedExtensionMethod.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// An invocated extension method hides the extension parameter in its parameter list.\n\t/// It's used to hide the internals of extension method invocation in certain situation to simulate the\n\t/// syntactic way of writing extension methods on semantic level.\n\t/// </summary>\n\tpublic class ReducedExtensionMethod : IMethod\n\t{\n\t\treadonly IMethod baseMethod;\n\n\t\tpublic ReducedExtensionMethod(IMethod baseMethod)\n\t\t{\n\t\t\tthis.baseMethod = baseMethod;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as ReducedExtensionMethod;\n\t\t\tif (other == null)\n\t\t\t\treturn false;\n\t\t\treturn baseMethod.Equals(other.baseMethod);\n\t\t}\n\t\t\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn baseMethod.GetHashCode() + 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"[ReducedExtensionMethod: ReducedFrom={0}]\", ReducedFrom);\n\t\t}\n\n\t\t#region IMember implementation\n\n\t\t[Serializable]\n\t\tpublic sealed class ReducedExtensionMethodMemberReference : IMemberReference\n\t\t{\n\t\t\treadonly IMethod baseMethod;\n\n\t\t\tpublic ReducedExtensionMethodMemberReference (IMethod baseMethod)\n\t\t\t{\n\t\t\t\tthis.baseMethod = baseMethod;\n\t\t\t}\n\n\t\t\tpublic IMember Resolve(ITypeResolveContext context)\n\t\t\t{\n\t\t\t\treturn new ReducedExtensionMethod ((IMethod)baseMethod.ToReference ().Resolve (context));\n\t\t\t}\n\t\t\t\n\t\t\tISymbol ISymbolReference.Resolve(ITypeResolveContext context)\n\t\t\t{\n\t\t\t\treturn Resolve(context);\n\t\t\t}\n\n\t\t\tpublic ITypeReference DeclaringTypeReference {\n\t\t\t\tget {\n\t\t\t\t\treturn baseMethod.ToReference ().DeclaringTypeReference;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic IMemberReference ToMemberReference()\n\t\t{\n\t\t\treturn new ReducedExtensionMethodMemberReference (baseMethod);\n\t\t}\n\t\t\n\t\tpublic IMemberReference ToReference()\n\t\t{\n\t\t\treturn new ReducedExtensionMethodMemberReference (baseMethod);\n\t\t}\n\t\t\n\t\tISymbolReference ISymbol.ToReference()\n\t\t{\n\t\t\treturn ToReference();\n\t\t}\n\n\t\tpublic IMember MemberDefinition {\n\t\t\tget {\n\t\t\t\treturn baseMethod.MemberDefinition;\n\t\t\t}\n\t\t}\n\n\t\tpublic IUnresolvedMember UnresolvedMember {\n\t\t\tget {\n\t\t\t\treturn baseMethod.UnresolvedMember;\n\t\t\t}\n\t\t}\n\n\t\tpublic IType ReturnType {\n\t\t\tget {\n\t\t\t\treturn baseMethod.ReturnType;\n\t\t\t}\n\t\t}\n\n\t\tpublic System.Collections.Generic.IList<IMember> ImplementedInterfaceMembers {\n\t\t\tget {\n\t\t\t\treturn baseMethod.ImplementedInterfaceMembers;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsExplicitInterfaceImplementation {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsExplicitInterfaceImplementation;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsVirtual {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsVirtual;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsOverride {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsOverride;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsOverridable {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsOverridable;\n\t\t\t}\n\t\t}\n\n\t\tpublic TypeParameterSubstitution Substitution {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Substitution;\n\t\t\t}\n\t\t}\n\n\t\tpublic IMethod Specialize(TypeParameterSubstitution substitution)\n\t\t{\n\t\t\treturn new ReducedExtensionMethod((IMethod)baseMethod.Specialize(substitution));\n\t\t}\n\t\t\n\t\tIMember IMember.Specialize(TypeParameterSubstitution substitution)\n\t\t{\n\t\t\treturn Specialize(substitution);\n\t\t}\n\t\t\n\t\tpublic bool IsParameterized {\n\t\t\tget  { return baseMethod.IsParameterized; }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IMethod implementation\n\n\t\tpublic System.Collections.Generic.IList<IUnresolvedMethod> Parts {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Parts;\n\t\t\t}\n\t\t}\n\n\t\tpublic System.Collections.Generic.IList<IAttribute> ReturnTypeAttributes {\n\t\t\tget {\n\t\t\t\treturn baseMethod.ReturnTypeAttributes;\n\t\t\t}\n\t\t}\n\n\t\tpublic System.Collections.Generic.IList<ITypeParameter> TypeParameters {\n\t\t\tget {\n\t\t\t\treturn baseMethod.TypeParameters;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsExtensionMethod {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsConstructor {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsConstructor;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsDestructor {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsDestructor;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsOperator {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsOperator;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsPartial {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsPartial;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAsync {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsAsync;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasBody {\n\t\t\tget {\n\t\t\t\treturn baseMethod.HasBody;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAccessor {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsAccessor;\n\t\t\t}\n\t\t}\n\n\t\tpublic IMember AccessorOwner {\n\t\t\tget {\n\t\t\t\treturn baseMethod.AccessorOwner;\n\t\t\t}\n\t\t}\n\n\t\tpublic IMethod ReducedFrom {\n\t\t\tget {\n\t\t\t\treturn baseMethod;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<IType> TypeArguments {\n\t\t\tget {\n\t\t\t\treturn baseMethod.TypeArguments;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region IParameterizedMember implementation\n\t\tList<IParameter> parameters;\n\t\tpublic System.Collections.Generic.IList<IParameter> Parameters {\n\t\t\tget {\n\t\t\t\tif (parameters == null)\n\t\t\t\t\tparameters = new List<IParameter> (baseMethod.Parameters.Skip (1));\n\t\t\t\treturn parameters;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEntity implementation\n\n\t\tpublic SymbolKind SymbolKind {\n\t\t\tget {\n\t\t\t\treturn baseMethod.SymbolKind;\n\t\t\t}\n\t\t}\n\n\t\t[Obsolete(\"Use the SymbolKind property instead.\")]\n\t\tpublic EntityType EntityType {\n\t\t\tget {\n\t\t\t\treturn baseMethod.EntityType;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Region;\n\t\t\t}\n\t\t}\n\n\t\tpublic DomRegion BodyRegion {\n\t\t\tget {\n\t\t\t\treturn baseMethod.BodyRegion;\n\t\t\t}\n\t\t}\n\n\t\tpublic ITypeDefinition DeclaringTypeDefinition {\n\t\t\tget {\n\t\t\t\treturn baseMethod.DeclaringTypeDefinition;\n\t\t\t}\n\t\t}\n\n\t\tpublic IType DeclaringType {\n\t\t\tget {\n\t\t\t\treturn baseMethod.DeclaringType;\n\t\t\t}\n\t\t}\n\n\t\tpublic IAssembly ParentAssembly {\n\t\t\tget {\n\t\t\t\treturn baseMethod.ParentAssembly;\n\t\t\t}\n\t\t}\n\n\t\tpublic System.Collections.Generic.IList<IAttribute> Attributes {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Attributes;\n\t\t\t}\n\t\t}\n\n\t\tpublic ICSharpCode.NRefactory.Documentation.DocumentationComment Documentation {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Documentation;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsStatic {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAbstract {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsAbstract;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsSealed {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsSealed;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsShadowing {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsShadowing;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsSynthetic {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsSynthetic;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IHasAccessibility implementation\n\n\t\tpublic Accessibility Accessibility {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Accessibility;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsPrivate {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsPrivate;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsPublic {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsPublic;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsProtected {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsProtected;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsInternal {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsInternal;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsProtectedOrInternal {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsProtectedOrInternal;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsProtectedAndInternal {\n\t\t\tget {\n\t\t\t\treturn baseMethod.IsProtectedAndInternal;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region INamedElement implementation\n\n\t\tpublic string FullName {\n\t\t\tget {\n\t\t\t\treturn baseMethod.FullName;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic string ReflectionName {\n\t\t\tget {\n\t\t\t\treturn baseMethod.ReflectionName;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Namespace;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ICompilationProvider implementation\n\n\t\tpublic ICompilation Compilation {\n\t\t\tget {\n\t\t\t\treturn baseMethod.Compilation;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/RenameCallbackArguments.cs",
    "content": "﻿// Copyright (c) 2010-2014 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Arguments for the callback of <see cref=\"FindReferences.RenameReferencesInFile\"/>.\n\t/// </summary>\n\tpublic class RenameCallbackArguments\n\t{\n\t\tpublic AstNode NodeToReplace { get; private set; }\n\t\tpublic AstNode NewNode { get; private set; }\n\t\t\n\t\tpublic RenameCallbackArguments(AstNode nodeToReplace, AstNode newNode)\n\t\t{\n\t\t\tif (nodeToReplace == null)\n\t\t\t\tthrow new ArgumentNullException(\"nodeToReplace\");\n\t\t\tif (newNode == null)\n\t\t\t\tthrow new ArgumentNullException(\"newNode\");\n\t\t\tthis.NodeToReplace = nodeToReplace;\n\t\t\tthis.NewNode = newNode;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Helper class that resolves the node at a specified location.\n\t/// Can be used for implementing tool tips.\n\t/// </summary>\n\tpublic static class ResolveAtLocation\n\t{\n\t\tpublic static ResolveResult Resolve (ICompilation compilation, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, TextLocation location,\n\t\t                                    CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\treturn Resolve (new Lazy<ICompilation>(() => compilation), unresolvedFile, syntaxTree, location, cancellationToken);\n\t\t}\n\t\tpublic static ResolveResult Resolve(Lazy<ICompilation> compilation, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, TextLocation location,\n\t\t                                    CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tAstNode node;\n\t\t\treturn Resolve(compilation, unresolvedFile, syntaxTree, location, out node, cancellationToken);\n\t\t}\n\t\t\n\t\tpublic static ResolveResult Resolve (ICompilation compilation, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, TextLocation location, out AstNode node,\n\t\t                                    CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\treturn Resolve (new Lazy<ICompilation>(() => compilation), unresolvedFile, syntaxTree, location, out node, cancellationToken);\n\t\t}\n\t\tpublic static ResolveResult Resolve(Lazy<ICompilation> compilation, CSharpUnresolvedFile unresolvedFile, SyntaxTree syntaxTree, TextLocation location, out AstNode node,\n\t\t                                    CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tnode = syntaxTree.GetNodeAt(location);\n\t\t\tif (node == null || node is ArrayInitializerExpression)\n\t\t\t\treturn null;\n\t\t\tif (node.Parent is UsingAliasDeclaration && node.Role == UsingAliasDeclaration.AliasRole) {\n\t\t\t\tvar r = new CSharpAstResolver(compilation.Value, syntaxTree, unresolvedFile);\n\t\t\t\treturn r.Resolve(((UsingAliasDeclaration)node.Parent).Import, cancellationToken);\n\t\t\t}\n\t\t\tif (CSharpAstResolver.IsUnresolvableNode(node)) {\n\t\t\t\tif (node is Identifier) {\n\t\t\t\t\tnode = node.Parent;\n\t\t\t\t} else if (node.NodeType == NodeType.Token) {\n\t\t\t\t\tif (node.Parent is IndexerExpression || node.Parent is ConstructorInitializer || node.Role == IndexerDeclaration.ThisKeywordRole) {\n\t\t\t\t\t\t// There's no other place where one could hover to see the indexer's tooltip,\n\t\t\t\t\t\t// so we need to resolve it when hovering over the '[' or ']'.\n\t\t\t\t\t\t// For constructor initializer, the same applies to the 'base'/'this' token.\n\t\t\t\t\t\tnode = node.Parent;\n\t\t\t\t\t} else if (node.Parent is BinaryOperatorExpression || node.Parent is UnaryOperatorExpression) {\n\t\t\t\t\t\t// Resolve user-defined operator\n\t\t\t\t\t\tnode = node.Parent;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// don't resolve arbitrary nodes - we don't want to show tooltips for everything\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// It's a resolvable node.\n\t\t\t\t// However, we usually don't want to show the tooltip everywhere\n\t\t\t\t// For example, hovering with the mouse over an empty line between two methods causes\n\t\t\t\t// node==TypeDeclaration, but we don't want to show any tooltip.\n\t\t\t\t\n\t\t\t\tif (!node.GetChildByRole(Roles.Identifier).IsNull) {\n\t\t\t\t\t// We'll suppress the tooltip for resolvable nodes if there is an identifier that\n\t\t\t\t\t// could be hovered over instead:\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node == null)\n\t\t\t\treturn null;\n\t\t\tif (node.Parent is ObjectCreateExpression && node.Role == Roles.Type) {\n\t\t\t\tnode = node.Parent;\n\t\t\t} else if (node is ThisReferenceExpression && node.Parent is IndexerExpression) {\n\t\t\t\tnode = node.Parent;\n\t\t\t}\n\n\t\t\tInvocationExpression parentInvocation = null;\n\t\t\tif ((node is IdentifierExpression || node is MemberReferenceExpression || node is PointerReferenceExpression) && node.Role != Roles.Argument) {\n\t\t\t\t// we also need to resolve the invocation\n\t\t\t\tparentInvocation = node.Parent as InvocationExpression;\n\t\t\t}\n\t\t\t\n\t\t\t// TODO: I think we should provide an overload so that an existing CSharpAstResolver can be reused\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(compilation.Value, syntaxTree, unresolvedFile);\n\t\t\tResolveResult rr = resolver.Resolve(node, cancellationToken);\n\t\t\tMethodGroupResolveResult mgrr = rr as MethodGroupResolveResult;\n\t\t\tif (mgrr != null) {\n\t\t\t\t// For method groups, resolve the parent invocation instead.\n\t\t\t\tif (parentInvocation != null)\n\t\t\t\t\treturn resolver.Resolve(parentInvocation);\n\t\t\t\tif (node is Expression) {\n\t\t\t\t\t// If it's not an invocation, try if it's a conversion to a delegate type:\n\t\t\t\t\tConversion c = resolver.GetConversion((Expression)node, cancellationToken);\n\t\t\t\t\tif (c.IsMethodGroupConversion)\n\t\t\t\t\t\treturn new MemberResolveResult(mgrr.TargetResult, c.Method);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn rr;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Traverses the DOM and resolves expressions.\n\t/// </summary>\n\t/// <remarks>\n\t/// The ResolveVisitor does two jobs at the same time: it tracks the resolve context (properties on CSharpResolver)\n\t/// and it resolves the expressions visited.\n\t/// To allow using the context tracking without having to resolve every expression in the file (e.g. when you want to resolve\n\t/// only a single node deep within the DOM), you can use the <see cref=\"IResolveVisitorNavigator\"/> interface.\n\t/// The navigator allows you to switch the between scanning mode and resolving mode.\n\t/// In scanning mode, the context is tracked (local variables registered etc.), but nodes are not resolved.\n\t/// While scanning, the navigator will get asked about every node that the resolve visitor is about to enter.\n\t/// This allows the navigator whether to keep scanning, whether switch to resolving mode, or whether to completely skip the\n\t/// subtree rooted at that node.\n\t/// \n\t/// In resolving mode, the context is tracked and nodes will be resolved.\n\t/// The resolve visitor may decide that it needs to resolve other nodes as well in order to resolve the current node.\n\t/// In this case, those nodes will be resolved automatically, without asking the navigator interface.\n\t/// For child nodes that are not essential to resolving, the resolve visitor will switch back to scanning mode (and thus will\n\t/// ask the navigator for further instructions).\n\t/// \n\t/// Moreover, there is the <c>ResolveAll</c> mode - it works similar to resolving mode, but will not switch back to scanning mode.\n\t/// The whole subtree will be resolved without notifying the navigator.\n\t/// </remarks>\n\tsealed class ResolveVisitor : IAstVisitor<ResolveResult>\n\t{\n\t\t// The ResolveVisitor is also responsible for handling lambda expressions.\n\t\t\n\t\tstatic readonly ResolveResult errorResult = ErrorResolveResult.UnknownError;\n\t\t\n\t\tCSharpResolver resolver;\n\t\t/// <summary>Resolve result of the current LINQ query.</summary>\n\t\t/// <remarks>We do not have to put this into the stored state (resolver) because\n\t\t/// query expressions are always resolved in a single operation.</remarks>\n\t\tResolveResult currentQueryResult;\n\t\treadonly CSharpUnresolvedFile unresolvedFile;\n\t\treadonly Dictionary<AstNode, ResolveResult> resolveResultCache = new Dictionary<AstNode, ResolveResult>();\n\t\treadonly Dictionary<AstNode, CSharpResolver> resolverBeforeDict = new Dictionary<AstNode, CSharpResolver>();\n\t\treadonly Dictionary<AstNode, CSharpResolver> resolverAfterDict = new Dictionary<AstNode, CSharpResolver>();\n\t\treadonly Dictionary<Expression, ConversionWithTargetType> conversionDict = new Dictionary<Expression, ConversionWithTargetType>();\n\t\t\n\t\tinternal struct ConversionWithTargetType\n\t\t{\n\t\t\tpublic readonly Conversion Conversion;\n\t\t\tpublic readonly IType TargetType;\n\t\t\t\n\t\t\tpublic ConversionWithTargetType(Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t\tthis.Conversion = conversion;\n\t\t\t\tthis.TargetType = targetType;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIResolveVisitorNavigator navigator;\n\t\tbool resolverEnabled;\n\t\tList<LambdaBase> undecidedLambdas;\n\t\tinternal CancellationToken cancellationToken;\n\t\t\n\t\t#region Constructor\n\t\tstatic readonly IResolveVisitorNavigator skipAllNavigator = new ConstantModeResolveVisitorNavigator(ResolveVisitorNavigationMode.Skip, null);\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new ResolveVisitor instance.\n\t\t/// </summary>\n\t\tpublic ResolveVisitor(CSharpResolver resolver, CSharpUnresolvedFile unresolvedFile)\n\t\t{\n\t\t\tif (resolver == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolver\");\n\t\t\tthis.resolver = resolver;\n\t\t\tthis.unresolvedFile = unresolvedFile;\n\t\t\tthis.navigator = skipAllNavigator;\n\t\t}\n\t\t\n\t\tinternal void SetNavigator(IResolveVisitorNavigator navigator)\n\t\t{\n\t\t\tthis.navigator = navigator ?? skipAllNavigator;\n\t\t}\n\t\t\n\t\tResolveResult voidResult {\n\t\t\tget {\n\t\t\t\treturn new ResolveResult(resolver.Compilation.FindType(KnownTypeCode.Void));\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region ResetContext\n\t\t/// <summary>\n\t\t/// Resets the visitor to the stored position, runs the action, and then reverts the visitor to the previous position.\n\t\t/// </summary>\n\t\tvoid ResetContext(CSharpResolver storedContext, Action action)\n\t\t{\n\t\t\tvar oldResolverEnabled = this.resolverEnabled;\n\t\t\tvar oldResolver = this.resolver;\n\t\t\tvar oldQueryResult = this.currentQueryResult;\n\t\t\ttry {\n\t\t\t\tthis.resolverEnabled = false;\n\t\t\t\tthis.resolver = storedContext;\n\t\t\t\tthis.currentQueryResult = null;\n\t\t\t\t\n\t\t\t\taction();\n\t\t\t} finally {\n\t\t\t\tthis.resolverEnabled = oldResolverEnabled;\n\t\t\t\tthis.resolver = oldResolver;\n\t\t\t\tthis.currentQueryResult = oldQueryResult;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Scan / Resolve\n\t\t/// <summary>\n\t\t/// Scans the AST rooted at the given node.\n\t\t/// </summary>\n\t\tpublic void Scan(AstNode node)\n\t\t{\n\t\t\tif (node == null || node.IsNull)\n\t\t\t\treturn;\n\t\t\tswitch (node.NodeType) {\n\t\t\t\tcase NodeType.Token:\n\t\t\t\tcase NodeType.Whitespace:\n\t\t\t\t\treturn; // skip tokens, identifiers, comments, etc.\n\t\t\t}\n\t\t\t// don't Scan again if the node was already resolved\n\t\t\tif (resolveResultCache.ContainsKey(node)) {\n\t\t\t\t// Restore state change caused by this node:\n\t\t\t\tCSharpResolver newResolver;\n\t\t\t\tif (resolverAfterDict.TryGetValue(node, out newResolver))\n\t\t\t\t\tresolver = newResolver;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tvar mode = navigator.Scan(node);\n\t\t\tswitch (mode) {\n\t\t\t\tcase ResolveVisitorNavigationMode.Skip:\n\t\t\t\t\tif (node is VariableDeclarationStatement || node is SwitchSection) {\n\t\t\t\t\t\t// Enforce scanning of variable declarations.\n\t\t\t\t\t\tgoto case ResolveVisitorNavigationMode.Scan;\n\t\t\t\t\t}\n\t\t\t\t\tStoreCurrentState(node);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ResolveVisitorNavigationMode.Scan:\n\t\t\t\t\tbool oldResolverEnabled = resolverEnabled;\n\t\t\t\t\tvar oldResolver = resolver;\n\t\t\t\t\tresolverEnabled = false;\n\t\t\t\t\tStoreCurrentState(node);\n\t\t\t\t\tResolveResult result = node.AcceptVisitor(this);\n\t\t\t\t\tif (result != null) {\n\t\t\t\t\t\t// If the node was resolved, store the result even though it wasn't requested.\n\t\t\t\t\t\t// This is necessary so that Visit-methods that decide to always resolve are\n\t\t\t\t\t\t// guaranteed to get called only once.\n\t\t\t\t\t\t// This is used for lambda registration.\n\t\t\t\t\t\tStoreResult(node, result);\n\t\t\t\t\t\tif (resolver != oldResolver) {\n\t\t\t\t\t\t\t// The node changed the resolver state:\n\t\t\t\t\t\t\tresolverAfterDict.Add(node, resolver);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\t\t}\n\t\t\t\t\tresolverEnabled = oldResolverEnabled;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ResolveVisitorNavigationMode.Resolve:\n\t\t\t\t\tResolve(node);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException(\"Invalid value for ResolveVisitorNavigationMode\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Equivalent to 'Scan', but also resolves the node at the same time.\n\t\t/// This method should be only used if the CSharpResolver passed to the ResolveVisitor was manually set\n\t\t/// to the correct state.\n\t\t/// Otherwise, use <c>resolver.Scan(syntaxTree); var result = resolver.GetResolveResult(node);</c>\n\t\t/// instead.\n\t\t/// --\n\t\t/// This method now is internal, because it is difficult to use correctly.\n\t\t/// Users of the public API should use Scan()+GetResolveResult() instead.\n\t\t/// </summary>\n\t\tinternal ResolveResult Resolve(AstNode node)\n\t\t{\n\t\t\tif (node == null || node.IsNull)\n\t\t\t\treturn errorResult;\n\t\t\tbool oldResolverEnabled = resolverEnabled;\n\t\t\tresolverEnabled = true;\n\t\t\tResolveResult result;\n\t\t\tif (!resolveResultCache.TryGetValue(node, out result)) {\n\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\tStoreCurrentState(node);\n\t\t\t\tvar oldResolver = resolver;\n\t\t\t\tresult = node.AcceptVisitor(this) ?? errorResult;\n\t\t\t\tStoreResult(node, result);\n\t\t\t\tif (resolver != oldResolver) {\n\t\t\t\t\t// The node changed the resolver state:\n\t\t\t\t\tresolverAfterDict.Add(node, resolver);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolverEnabled = oldResolverEnabled;\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tIType ResolveType(AstType type)\n\t\t{\n\t\t\treturn Resolve(type).Type;\n\t\t}\n\t\t\n\t\tvoid StoreCurrentState(AstNode node)\n\t\t{\n\t\t\t// It's possible that we re-visit an expression that we scanned over earlier,\n\t\t\t// so we might have to overwrite an existing state.\n\t\t\t\n\t\t\t#if DEBUG\n\t\t\tCSharpResolver oldResolver;\n\t\t\tif (resolverBeforeDict.TryGetValue(node, out oldResolver)) {\n\t\t\t\tDebug.Assert(oldResolver.LocalVariables.SequenceEqual(resolver.LocalVariables));\n\t\t\t}\n\t\t\t#endif\n\t\t\t\n\t\t\tresolverBeforeDict[node] = resolver;\n\t\t}\n\t\t\n\t\tvoid StoreResult(AstNode node, ResolveResult result)\n\t\t{\n\t\t\tDebug.Assert(result != null);\n\t\t\tif (node.IsNull)\n\t\t\t\treturn;\n\t\t\tLog.WriteLine(\"Resolved '{0}' to {1}\", node, result);\n\t\t\tDebug.Assert(!CSharpAstResolver.IsUnresolvableNode(node));\n\t\t\t// The state should be stored before the result is.\n\t\t\tDebug.Assert(resolverBeforeDict.ContainsKey(node));\n\t\t\t// Don't store results twice.\n\t\t\tDebug.Assert(!resolveResultCache.ContainsKey(node));\n\t\t\t// Don't use ConversionResolveResult as a result, because it can get\n\t\t\t// confused with an implicit conversion.\n\t\t\tDebug.Assert(!(result is ConversionResolveResult) || result is CastResolveResult);\n\t\t\tresolveResultCache[node] = result;\n\t\t\tif (navigator != null)\n\t\t\t\tnavigator.Resolved(node, result);\n\t\t}\n\t\t\n\t\tvoid ScanChildren(AstNode node)\n\t\t{\n\t\t\tfor (AstNode child = node.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\tScan(child);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Process Conversions\n\t\tsealed class AnonymousFunctionConversion : Conversion\n\t\t{\n\t\t\tpublic readonly IType ReturnType;\n\t\t\tpublic readonly ExplicitlyTypedLambda ExplicitlyTypedLambda;\n\t\t\tpublic readonly LambdaTypeHypothesis Hypothesis;\n\t\t\treadonly bool isValid;\n\t\t\t\n\t\t\tpublic AnonymousFunctionConversion(IType returnType, LambdaTypeHypothesis hypothesis, bool isValid)\n\t\t\t{\n\t\t\t\tif (returnType == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"returnType\");\n\t\t\t\tthis.ReturnType = returnType;\n\t\t\t\tthis.Hypothesis = hypothesis;\n\t\t\t\tthis.isValid = isValid;\n\t\t\t}\n\t\t\t\n\t\t\tpublic AnonymousFunctionConversion(IType returnType, ExplicitlyTypedLambda explicitlyTypedLambda, bool isValid)\n\t\t\t{\n\t\t\t\tif (returnType == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"returnType\");\n\t\t\t\tthis.ReturnType = returnType;\n\t\t\t\tthis.ExplicitlyTypedLambda = explicitlyTypedLambda;\n\t\t\t\tthis.isValid = isValid;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsValid {\n\t\t\t\tget { return isValid; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicit {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAnonymousFunctionConversion {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Convert 'rr' to the target type using the specified conversion.\n\t\t/// </summary>\n\t\tvoid ProcessConversion(Expression expr, ResolveResult rr, Conversion conversion, IType targetType)\n\t\t{\n\t\t\tAnonymousFunctionConversion afc = conversion as AnonymousFunctionConversion;\n\t\t\tif (afc != null) {\n\t\t\t\tLog.WriteLine(\"Processing conversion of anonymous function to \" + targetType + \"...\");\n\t\t\t\t\n\t\t\t\tLog.Indent();\n\t\t\t\tif (afc.Hypothesis != null)\n\t\t\t\t\tafc.Hypothesis.MergeInto(this, afc.ReturnType);\n\t\t\t\tif (afc.ExplicitlyTypedLambda != null)\n\t\t\t\t\tafc.ExplicitlyTypedLambda.ApplyReturnType(this, afc.ReturnType);\n\t\t\t\tLog.Unindent();\n\t\t\t}\n\t\t\tif (expr != null && !expr.IsNull && conversion != Conversion.IdentityConversion) {\n\t\t\t\tnavigator.ProcessConversion(expr, rr, conversion, targetType);\n\t\t\t\tconversionDict[expr] = new ConversionWithTargetType(conversion, targetType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid ImportConversions(ResolveVisitor childVisitor)\n\t\t{\n\t\t\tforeach (var pair in childVisitor.conversionDict) {\n\t\t\t\tconversionDict.Add(pair.Key, pair.Value);\n\t\t\t\tnavigator.ProcessConversion(pair.Key, resolveResultCache[pair.Key], pair.Value.Conversion, pair.Value.TargetType);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Convert 'rr' to the target type.\n\t\t/// </summary>\n\t\tvoid ProcessConversion(Expression expr, ResolveResult rr, IType targetType)\n\t\t{\n\t\t\tif (expr == null || expr.IsNull)\n\t\t\t\treturn;\n\t\t\tProcessConversion(expr, rr, resolver.conversions.ImplicitConversion(rr, targetType), targetType);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the specified expression and processes the conversion to targetType.\n\t\t/// </summary>\n\t\tvoid ResolveAndProcessConversion(Expression expr, IType targetType)\n\t\t{\n\t\t\tif (targetType.Kind == TypeKind.Unknown) {\n\t\t\t\t// no need to resolve the expression right now\n\t\t\t\tScan(expr);\n\t\t\t} else {\n\t\t\t\tProcessConversion(expr, Resolve(expr), targetType);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid ProcessConversionResult(Expression expr, ConversionResolveResult rr)\n\t\t{\n\t\t\tif (rr != null && !(rr is CastResolveResult))\n\t\t\t\tProcessConversion(expr, rr.Input, rr.Conversion, rr.Type);\n\t\t}\n\t\t\n\t\tvoid ProcessConversionResults(IEnumerable<Expression> expr, IEnumerable<ResolveResult> conversionResolveResults)\n\t\t{\n\t\t\tDebug.Assert(expr.Count() == conversionResolveResults.Count());\n\t\t\tusing (var e1 = expr.GetEnumerator()) {\n\t\t\t\tusing (var e2 = conversionResolveResults.GetEnumerator()) {\n\t\t\t\t\twhile (e1.MoveNext() && e2.MoveNext()) {\n\t\t\t\t\t\tProcessConversionResult(e1.Current, e2.Current as ConversionResolveResult);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid MarkUnknownNamedArguments(IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tforeach (var nae in arguments.OfType<NamedArgumentExpression>()) {\n\t\t\t\tStoreCurrentState(nae);\n\t\t\t\tStoreResult(nae, new NamedArgumentResolveResult(nae.Name, resolveResultCache[nae.Expression]));\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid ProcessInvocationResult(Expression target, IEnumerable<Expression> arguments, ResolveResult invocation)\n\t\t{\n\t\t\tif (invocation is CSharpInvocationResolveResult || invocation is DynamicInvocationResolveResult) {\n\t\t\t\tint i = 0;\n\t\t\t\tIList<ResolveResult> argumentsRR;\n\t\t\t\tif (invocation is CSharpInvocationResolveResult) {\n\t\t\t\t\tvar csi = (CSharpInvocationResolveResult)invocation;\n\t\t\t\t\tif (csi.IsExtensionMethodInvocation) {\n\t\t\t\t\t\tDebug.Assert(arguments.Count() + 1 == csi.Arguments.Count);\n\t\t\t\t\t\tProcessConversionResult(target, csi.Arguments[0] as ConversionResolveResult);\n\t\t\t\t\t\ti = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tDebug.Assert(arguments.Count() == csi.Arguments.Count);\n\t\t\t\t\t}\n\t\t\t\t\targumentsRR = csi.Arguments;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\targumentsRR = ((DynamicInvocationResolveResult)invocation).Arguments;\n\t\t\t\t}\n\n\t\t\t\tforeach (Expression arg in arguments) {\n\t\t\t\t\tResolveResult argRR = argumentsRR[i++];\n\t\t\t\t\tNamedArgumentExpression nae = arg as NamedArgumentExpression;\n\t\t\t\t\tNamedArgumentResolveResult nrr = argRR as NamedArgumentResolveResult;\n\t\t\t\t\tDebug.Assert((nae == null) == (nrr == null));\n\t\t\t\t\tif (nae != null && nrr != null) {\n\t\t\t\t\t\tStoreCurrentState(nae);\n\t\t\t\t\t\tStoreResult(nae, nrr);\n\t\t\t\t\t\tProcessConversionResult(nae.Expression, nrr.Argument as ConversionResolveResult);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tProcessConversionResult(arg, argRR as ConversionResolveResult);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tMarkUnknownNamedArguments(arguments);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetResolveResult\n\t\t/// <summary>\n\t\t/// Gets the resolve result for the specified node.\n\t\t/// If the node was not resolved by the navigator, this method will resolve it.\n\t\t/// </summary>\n\t\tpublic ResolveResult GetResolveResult(AstNode node)\n\t\t{\n\t\t\tDebug.Assert(!CSharpAstResolver.IsUnresolvableNode(node));\n\t\t\t\n\t\t\tMergeUndecidedLambdas();\n\t\t\tResolveResult result;\n\t\t\tif (resolveResultCache.TryGetValue(node, out result))\n\t\t\t\treturn result;\n\t\t\t\n\t\t\tAstNode parent;\n\t\t\tCSharpResolver storedResolver = GetPreviouslyScannedContext(node, out parent);\n\t\t\tResetContext(\n\t\t\t\tstoredResolver,\n\t\t\t\tdelegate {\n\t\t\t\t\tnavigator = new NodeListResolveVisitorNavigator(node);\n\t\t\t\t\tDebug.Assert(!resolverEnabled);\n\t\t\t\t\tScan(parent);\n\t\t\t\t\tnavigator = skipAllNavigator;\n\t\t\t\t});\n\t\t\t\n\t\t\tMergeUndecidedLambdas();\n\t\t\treturn resolveResultCache[node];\n\t\t}\n\t\t\n\t\tCSharpResolver GetPreviouslyScannedContext(AstNode node, out AstNode parent)\n\t\t{\n\t\t\tparent = node;\n\t\t\tCSharpResolver storedResolver;\n\t\t\twhile (!resolverBeforeDict.TryGetValue(parent, out storedResolver)) {\n\t\t\t\tAstNode tmp = parent.Parent;\n\t\t\t\tif (tmp == null)\n\t\t\t\t\tthrow new InvalidOperationException(\"Could not find a resolver state for any parent of the specified node. Are you trying to resolve a node that is not a descendant of the CSharpAstResolver's root node?\");\n\t\t\t\tif (tmp.NodeType == NodeType.Whitespace)\n\t\t\t\t\treturn resolver; // special case: resolve expression within preprocessor directive\n\t\t\t\tparent = tmp;\n\t\t\t}\n\t\t\treturn storedResolver;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the resolver state in front of the specified node.\n\t\t/// If the node was not visited by a previous scanning process, the\n\t\t/// AST will be scanned again to determine the state.\n\t\t/// </summary>\n\t\tpublic CSharpResolver GetResolverStateBefore(AstNode node)\n\t\t{\n\t\t\tMergeUndecidedLambdas();\n\t\t\tCSharpResolver r;\n\t\t\tif (resolverBeforeDict.TryGetValue(node, out r))\n\t\t\t\treturn r;\n\t\t\t\n\t\t\tAstNode parent;\n\t\t\tCSharpResolver storedResolver = GetPreviouslyScannedContext(node, out parent);\n\t\t\tResetContext(\n\t\t\t\tstoredResolver,\n\t\t\t\tdelegate {\n\t\t\t\t\tnavigator = new NodeListResolveVisitorNavigator(new[] { node }, scanOnly: true);\n\t\t\t\t\tDebug.Assert(!resolverEnabled);\n\t\t\t\t\t// parent might already be resolved if 'node' is an unresolvable node\n\t\t\t\t\tScan(parent);\n\t\t\t\t\tnavigator = skipAllNavigator;\n\t\t\t\t});\n\t\t\t\n\t\t\tMergeUndecidedLambdas();\n\t\t\twhile (node != null) {\n\t\t\t\tif (resolverBeforeDict.TryGetValue(node, out r))\n\t\t\t\t\treturn r;\n\t\t\t\tnode = node.Parent;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic CSharpResolver GetResolverStateAfter(AstNode node)\n\t\t{\n\t\t\t// Resolve the node to fill the resolverAfterDict\n\t\t\tGetResolveResult(node);\n\t\t\tCSharpResolver result;\n\t\t\tif (resolverAfterDict.TryGetValue(node, out result))\n\t\t\t\treturn result;\n\t\t\telse\n\t\t\t\treturn GetResolverStateBefore(node);\n\t\t}\n\t\t\n\t\tpublic ConversionWithTargetType GetConversionWithTargetType(Expression expr)\n\t\t{\n\t\t\tGetResolverStateBefore(expr);\n\t\t\tResolveParentForConversion(expr);\n\t\t\tConversionWithTargetType result;\n\t\t\tif (conversionDict.TryGetValue(expr, out result)) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tResolveResult rr = GetResolveResult(expr);\n\t\t\t\treturn new ConversionWithTargetType(Conversion.IdentityConversion, rr.Type);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Track UsingScope\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitSyntaxTree(SyntaxTree unit)\n\t\t{\n\t\t\tCSharpResolver previousResolver = resolver;\n\t\t\ttry {\n\t\t\t\tif (unresolvedFile != null) {\n\t\t\t\t\tresolver = resolver.WithCurrentUsingScope(unresolvedFile.RootUsingScope.Resolve(resolver.Compilation));\n\t\t\t\t} else {\n\t\t\t\t\tvar cv = new TypeSystemConvertVisitor(unit.FileName ?? string.Empty);\n\t\t\t\t\tApplyVisitorToUsings(cv, unit.Children);\n\t\t\t\t\tPushUsingScope(cv.UnresolvedFile.RootUsingScope);\n\t\t\t\t}\n\t\t\t\tScanChildren(unit);\n\t\t\t\treturn voidResult;\n\t\t\t} finally {\n\t\t\t\tresolver = previousResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid ApplyVisitorToUsings(TypeSystemConvertVisitor visitor, IEnumerable<AstNode> children)\n\t\t{\n\t\t\tforeach (var child in children) {\n\t\t\t\tif (child is ExternAliasDeclaration || child is UsingDeclaration || child is UsingAliasDeclaration) {\n\t\t\t\t\tchild.AcceptVisitor(visitor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid PushUsingScope(UsingScope usingScope)\n\t\t{\n\t\t\tusingScope.Freeze();\n\t\t\tresolver = resolver.WithCurrentUsingScope(new ResolvedUsingScope(resolver.CurrentTypeResolveContext, usingScope));\n\t\t}\n\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\tCSharpResolver previousResolver = resolver;\n\t\t\ttry {\n\t\t\t\tvar nsName = namespaceDeclaration.NamespaceName;\n\t\t\t\tAstNode child = namespaceDeclaration.FirstChild;\n\n\t\t\t\tfor (; child != null && child.Role != Roles.LBrace; child = child.NextSibling) {\n\t\t\t\t\tScan(child);\n\t\t\t\t}\n\n\t\t\t\tif (unresolvedFile != null) {\n\t\t\t\t\tresolver = resolver.WithCurrentUsingScope(unresolvedFile.GetUsingScope(namespaceDeclaration.StartLocation).Resolve(resolver.Compilation));\n\n\t\t\t\t} else {\n//\t\t\t\t\tstring fileName = namespaceDeclaration.GetRegion().FileName ?? string.Empty;\n\t\t\t\t\t// Fetch parent using scope\n\t\t\t\t\t// Create root using scope if necessary\n\t\t\t\t\tif (resolver.CurrentUsingScope == null)\n\t\t\t\t\t\tPushUsingScope(new UsingScope());\n\t\t\t\t\t\n\t\t\t\t\t// Create child using scope\n\t\t\t\t\tDomRegion region = namespaceDeclaration.GetRegion();\n\t\t\t\t\tvar identifiers = namespaceDeclaration.Identifiers.ToList();\n\t\t\t\t\t// For all but the last identifier:\n\t\t\t\t\tUsingScope usingScope;\n\t\t\t\t\tfor (int i = 0; i < identifiers.Count - 1; i++) {\n\t\t\t\t\t\tusingScope = new UsingScope(resolver.CurrentUsingScope.UnresolvedUsingScope, identifiers[i]);\n\t\t\t\t\t\tusingScope.Region = region;\n\t\t\t\t\t\tPushUsingScope(usingScope);\n\t\t\t\t\t}\n\t\t\t\t\t// Last using scope:\n\t\t\t\t\tusingScope = new UsingScope(resolver.CurrentUsingScope.UnresolvedUsingScope, identifiers.Last());\n\t\t\t\t\tusingScope.Region = region;\n\t\t\t\t\tvar cv = new TypeSystemConvertVisitor(new CSharpUnresolvedFile(), usingScope);\n\t\t\t\t\tApplyVisitorToUsings(cv, namespaceDeclaration.Children);\n\t\t\t\t\tPushUsingScope(usingScope);\n\t\t\t\t}\n\t\t\t\tfor (; child != null; child = child.NextSibling) {\n\t\t\t\t\tScan(child);\n\t\t\t\t}\n\n\t\t\t\t// merge undecided lambdas before leaving the using scope so that\n\t\t\t\t// the resolver can make better use of its cache\n\t\t\t\tMergeUndecidedLambdas();\n\t\t\t\tif (resolver.CurrentUsingScope != null && resolver.CurrentUsingScope.Namespace != null)\n\t\t\t\t\treturn new NamespaceResolveResult(resolver.CurrentUsingScope.Namespace);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t} finally {\n\t\t\t\tresolver = previousResolver;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Track CurrentTypeDefinition\n\t\tResolveResult VisitTypeOrDelegate(AstNode typeDeclaration, string name, int typeParameterCount)\n\t\t{\n\t\t\tCSharpResolver previousResolver = resolver;\n\t\t\ttry {\n\t\t\t\tITypeDefinition newTypeDefinition = null;\n\t\t\t\tif (resolver.CurrentTypeDefinition != null) {\n\t\t\t\t\tint totalTypeParameterCount = resolver.CurrentTypeDefinition.TypeParameterCount + typeParameterCount;\n\t\t\t\t\tforeach (ITypeDefinition nestedType in resolver.CurrentTypeDefinition.NestedTypes) {\n\t\t\t\t\t\tif (nestedType.Name == name && nestedType.TypeParameterCount == totalTypeParameterCount) {\n\t\t\t\t\t\t\tnewTypeDefinition = nestedType;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (resolver.CurrentUsingScope != null) {\n\t\t\t\t\tnewTypeDefinition = resolver.CurrentUsingScope.Namespace.GetTypeDefinition(name, typeParameterCount);\n\t\t\t\t}\n\t\t\t\tif (newTypeDefinition != null)\n\t\t\t\t\tresolver = resolver.WithCurrentTypeDefinition(newTypeDefinition);\n\t\t\t\t\n\t\t\t\tScanChildren(typeDeclaration);\n\t\t\t\t\n\t\t\t\t// merge undecided lambdas before leaving the type definition so that\n\t\t\t\t// the resolver can make better use of its cache\n\t\t\t\tMergeUndecidedLambdas();\n\t\t\t\t\n\t\t\t\treturn newTypeDefinition != null ? new TypeResolveResult(newTypeDefinition) : errorResult;\n\t\t\t} finally {\n\t\t\t\tresolver = previousResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\treturn VisitTypeOrDelegate(typeDeclaration, typeDeclaration.Name, typeDeclaration.TypeParameters.Count);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\treturn VisitTypeOrDelegate(delegateDeclaration, delegateDeclaration.Name, delegateDeclaration.TypeParameters.Count);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Track CurrentMember\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\treturn VisitFieldOrEventDeclaration(fieldDeclaration, SymbolKind.Field);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\treturn VisitFieldOrEventDeclaration(fixedFieldDeclaration, SymbolKind.Field);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\treturn VisitFieldOrEventDeclaration(eventDeclaration, SymbolKind.Event);\n\t\t}\n\t\t\n\t\tResolveResult VisitFieldOrEventDeclaration(EntityDeclaration fieldOrEventDeclaration, SymbolKind symbolKind)\n\t\t{\n\t\t\t//int initializerCount = fieldOrEventDeclaration.GetChildrenByRole(Roles.Variable).Count;\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\tfor (AstNode node = fieldOrEventDeclaration.FirstChild; node != null; node = node.NextSibling) {\n\t\t\t\tif (node.Role == Roles.Variable || node.Role == FixedFieldDeclaration.VariableRole) {\n\t\t\t\t\tIMember member;\n\t\t\t\t\tif (unresolvedFile != null) {\n\t\t\t\t\t\tmember = GetMemberFromLocation(node);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstring name = ((VariableInitializer)node).Name;\n\t\t\t\t\t\tmember = AbstractUnresolvedMember.Resolve(resolver.CurrentTypeResolveContext, symbolKind, name);\n\t\t\t\t\t}\n\t\t\t\t\tresolver = resolver.WithCurrentMember(member);\n\t\t\t\t\t\n\t\t\t\t\tScan(node);\n\t\t\t\t\t\n\t\t\t\t\tresolver = oldResolver;\n\t\t\t\t} else {\n\t\t\t\t\tScan(node);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tIMember GetMemberFromLocation(AstNode node)\n\t\t{\n\t\t\tITypeDefinition typeDef = resolver.CurrentTypeDefinition;\n\t\t\tif (typeDef == null)\n\t\t\t\treturn null;\n\t\t\tTextLocation location = TypeSystemConvertVisitor.GetStartLocationAfterAttributes(node);\n\t\t\treturn typeDef.GetMembers(\n\t\t\t\tdelegate (IUnresolvedMember m) {\n\t\t\t\t\tif (m.UnresolvedFile != unresolvedFile)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tDomRegion region = m.Region;\n\t\t\t\t\treturn !region.IsEmpty && region.Begin <= location && region.End > location;\n\t\t\t\t},\n\t\t\t\tGetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions\n\t\t\t).FirstOrDefault();\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\t// Within the variable initializer, the newly declared variable is not yet available:\n\t\t\tvar resolverWithVariable = resolver;\n\t\t\tif (variableInitializer.Parent is VariableDeclarationStatement)\n\t\t\t\tresolver = resolver.PopLastVariable();\n\t\t\t\n\t\t\tArrayInitializerExpression aie = variableInitializer.Initializer as ArrayInitializerExpression;\n\t\t\tif (resolverEnabled || aie != null) {\n\t\t\t\tResolveResult result = errorResult;\n\t\t\t\tif (variableInitializer.Parent is FieldDeclaration || variableInitializer.Parent is EventDeclaration) {\n\t\t\t\t\tif (resolver.CurrentMember != null) {\n\t\t\t\t\t\tresult = new MemberResolveResult(null, resolver.CurrentMember, false);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstring identifier = variableInitializer.Name;\n\t\t\t\t\tforeach (IVariable v in resolverWithVariable.LocalVariables) {\n\t\t\t\t\t\tif (v.Name == identifier) {\n\t\t\t\t\t\t\tresult = new LocalResolveResult(v);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tArrayType arrayType = result.Type as ArrayType;\n\t\t\t\tif (aie != null && arrayType != null) {\n\t\t\t\t\tStoreCurrentState(aie);\n\t\t\t\t\tList<Expression> initializerElements = new List<Expression>();\n\t\t\t\t\tint[] sizes = new int[arrayType.Dimensions];\n\t\t\t\t\tUnpackArrayInitializer(initializerElements, sizes, aie, 0, true);\n\t\t\t\t\tResolveResult[] initializerElementResults = new ResolveResult[initializerElements.Count];\n\t\t\t\t\tfor (int i = 0; i < initializerElementResults.Length; i++) {\n\t\t\t\t\t\tinitializerElementResults[i] = Resolve(initializerElements[i]);\n\t\t\t\t\t}\n\t\t\t\t\tvar arrayCreation = resolver.ResolveArrayCreation(arrayType.ElementType, sizes, initializerElementResults);\n\t\t\t\t\tStoreResult(aie, arrayCreation);\n\t\t\t\t\tProcessConversionResults(initializerElements, arrayCreation.InitializerElements);\n\t\t\t\t} else if (variableInitializer.Parent is FixedStatement) {\n\t\t\t\t\tvar initRR = Resolve(variableInitializer.Initializer);\n\t\t\t\t\tPointerType pointerType;\n\t\t\t\t\tif (initRR.Type.Kind == TypeKind.Array) {\n\t\t\t\t\t\tpointerType = new PointerType(((ArrayType)initRR.Type).ElementType);\n\t\t\t\t\t} else if (ReflectionHelper.GetTypeCode(initRR.Type) == TypeCode.String) {\n\t\t\t\t\t\tpointerType = new PointerType(resolver.Compilation.FindType(KnownTypeCode.Char));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpointerType = null;\n\t\t\t\t\t\tProcessConversion(variableInitializer.Initializer, initRR, result.Type);\n\t\t\t\t\t}\n\t\t\t\t\tif (pointerType != null) {\n\t\t\t\t\t\tvar conversion = resolver.conversions.ImplicitConversion(pointerType, result.Type);\n\t\t\t\t\t\tif (conversion.IsIdentityConversion)\n\t\t\t\t\t\t\tconversion = Conversion.ImplicitPointerConversion;\n\t\t\t\t\t\tProcessConversion(variableInitializer.Initializer, initRR, conversion, result.Type);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tResolveAndProcessConversion(variableInitializer.Initializer, result.Type);\n\t\t\t\t}\n\t\t\t\tresolver = resolverWithVariable;\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tScan(variableInitializer.Initializer);\n\t\t\t\tresolver = resolverWithVariable;\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tResolveResult result = errorResult;\n\t\t\t\tif (resolver.CurrentMember != null) {\n\t\t\t\t\tresult = new MemberResolveResult(null, resolver.CurrentMember, false);\n\t\t\t\t}\n\t\t\t\tResolveAndProcessConversion(fixedVariableInitializer.CountExpression, resolver.Compilation.FindType(KnownTypeCode.Int32));\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tScanChildren(fixedVariableInitializer);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult VisitMethodMember(EntityDeclaration memberDeclaration)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\tIMember member = null;\n\t\t\t\tif (unresolvedFile != null) {\n\t\t\t\t\tmember = GetMemberFromLocation(memberDeclaration);\n\t\t\t\t}\n\t\t\t\tif (member == null) {\n\t\t\t\t\t// Re-discover the method:\n\t\t\t\t\tSymbolKind symbolKind = memberDeclaration.SymbolKind;\n\t\t\t\t\tvar parameterTypes = TypeSystemConvertVisitor.GetParameterTypes(memberDeclaration.GetChildrenByRole(Roles.Parameter), InterningProvider.Dummy);\n\t\t\t\t\tif (symbolKind == SymbolKind.Constructor) {\n\t\t\t\t\t\tstring name = memberDeclaration.HasModifier(Modifiers.Static) ? \".cctor\" : \".ctor\";\n\t\t\t\t\t\tmember = AbstractUnresolvedMember.Resolve(\n\t\t\t\t\t\t\tresolver.CurrentTypeResolveContext, symbolKind, name,\n\t\t\t\t\t\t\tparameterTypeReferences: parameterTypes);\n\t\t\t\t\t} else if (symbolKind == SymbolKind.Destructor) {\n\t\t\t\t\t\tmember = AbstractUnresolvedMember.Resolve(resolver.CurrentTypeResolveContext, symbolKind, \"Finalize\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstring[] typeParameterNames = memberDeclaration.GetChildrenByRole(Roles.TypeParameter).Select(tp => tp.Name).ToArray();\n\t\t\t\t\t\tAstType explicitInterfaceAstType = memberDeclaration.GetChildByRole(EntityDeclaration.PrivateImplementationTypeRole);\n\t\t\t\t\t\tITypeReference explicitInterfaceType = null;\n\t\t\t\t\t\tif (!explicitInterfaceAstType.IsNull) {\n\t\t\t\t\t\t\texplicitInterfaceType = explicitInterfaceAstType.ToTypeReference();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmember = AbstractUnresolvedMember.Resolve(\n\t\t\t\t\t\t\tresolver.CurrentTypeResolveContext, symbolKind, memberDeclaration.Name,\n\t\t\t\t\t\t\texplicitInterfaceType, typeParameterNames, parameterTypes);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresolver = resolver.WithCurrentMember(member);\n\t\t\t\tScanChildren(memberDeclaration);\n\t\t\t\t\n\t\t\t\tif (member != null)\n\t\t\t\t\treturn new MemberResolveResult(null, member, false);\n\t\t\t\telse\n\t\t\t\t\treturn errorResult;\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\treturn VisitMethodMember(methodDeclaration);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\treturn VisitMethodMember(operatorDeclaration);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\treturn VisitMethodMember(constructorDeclaration);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\treturn VisitMethodMember(destructorDeclaration);\n\t\t}\n\t\t\n\t\t// handle properties/indexers\n\t\tResolveResult VisitPropertyMember(EntityDeclaration propertyOrIndexerDeclaration)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\tIMember member;\n\t\t\t\tif (unresolvedFile != null) {\n\t\t\t\t\tmember = GetMemberFromLocation(propertyOrIndexerDeclaration);\n\t\t\t\t} else {\n\t\t\t\t\t// Re-discover the property:\n\t\t\t\t\tstring name = propertyOrIndexerDeclaration.Name;\n\t\t\t\t\tvar parameterTypeReferences = TypeSystemConvertVisitor.GetParameterTypes(propertyOrIndexerDeclaration.GetChildrenByRole(Roles.Parameter), InterningProvider.Dummy);\n\t\t\t\t\tAstType explicitInterfaceAstType = propertyOrIndexerDeclaration.GetChildByRole(EntityDeclaration.PrivateImplementationTypeRole);\n\t\t\t\t\tITypeReference explicitInterfaceType = null;\n\t\t\t\t\tif (!explicitInterfaceAstType.IsNull) {\n\t\t\t\t\t\texplicitInterfaceType = explicitInterfaceAstType.ToTypeReference();\n\t\t\t\t\t}\n\t\t\t\t\tmember = AbstractUnresolvedMember.Resolve(\n\t\t\t\t\t\tresolver.CurrentTypeResolveContext, propertyOrIndexerDeclaration.SymbolKind, name,\n\t\t\t\t\t\texplicitInterfaceType, parameterTypeReferences: parameterTypeReferences);\n\t\t\t\t}\n\t\t\t\t// We need to use the property as current member so that indexer parameters can be resolved correctly.\n\t\t\t\tresolver = resolver.WithCurrentMember(member);\n\t\t\t\tvar resolverWithPropertyAsMember = resolver;\n\t\t\t\t\n\t\t\t\tfor (AstNode node = propertyOrIndexerDeclaration.FirstChild; node != null; node = node.NextSibling) {\n\t\t\t\t\tif (node.Role == PropertyDeclaration.GetterRole && member is IProperty) {\n\t\t\t\t\t\tresolver = resolver.WithCurrentMember(((IProperty)member).Getter);\n\t\t\t\t\t\tScan(node);\n\t\t\t\t\t\tresolver = resolverWithPropertyAsMember;\n\t\t\t\t\t} else if (node.Role == PropertyDeclaration.SetterRole && member is IProperty) {\n\t\t\t\t\t\tresolver = resolver.WithCurrentMember(((IProperty)member).Setter);\n\t\t\t\t\t\tScan(node);\n\t\t\t\t\t\tresolver = resolverWithPropertyAsMember;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tScan(node);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (member != null)\n\t\t\t\t\treturn new MemberResolveResult(null, member, false);\n\t\t\t\telse\n\t\t\t\t\treturn errorResult;\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\treturn VisitPropertyMember(propertyDeclaration);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\treturn VisitPropertyMember(indexerDeclaration);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\tIMember member;\n\t\t\t\tif (unresolvedFile != null) {\n\t\t\t\t\tmember = GetMemberFromLocation(eventDeclaration);\n\t\t\t\t} else {\n\t\t\t\t\tstring name = eventDeclaration.Name;\n\t\t\t\t\tAstType explicitInterfaceAstType = eventDeclaration.PrivateImplementationType;\n\t\t\t\t\tif (explicitInterfaceAstType.IsNull) {\n\t\t\t\t\t\tmember = AbstractUnresolvedMember.Resolve(resolver.CurrentTypeResolveContext, SymbolKind.Event, name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmember = AbstractUnresolvedMember.Resolve(resolver.CurrentTypeResolveContext, SymbolKind.Event, name,\n\t\t\t\t\t\t                                          explicitInterfaceAstType.ToTypeReference());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresolver = resolver.WithCurrentMember(member);\n\t\t\t\tvar resolverWithEventAsMember = resolver;\n\t\t\t\t\n\t\t\t\tfor (AstNode node = eventDeclaration.FirstChild; node != null; node = node.NextSibling) {\n\t\t\t\t\tif (node.Role == CustomEventDeclaration.AddAccessorRole && member is IEvent) {\n\t\t\t\t\t\tresolver = resolver.WithCurrentMember(((IEvent)member).AddAccessor);\n\t\t\t\t\t\tScan(node);\n\t\t\t\t\t\tresolver = resolverWithEventAsMember;\n\t\t\t\t\t} else if (node.Role == CustomEventDeclaration.RemoveAccessorRole && member is IEvent) {\n\t\t\t\t\t\tresolver = resolver.WithCurrentMember(((IEvent)member).RemoveAccessor);\n\t\t\t\t\t\tScan(node);\n\t\t\t\t\t\tresolver = resolverWithEventAsMember;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tScan(node);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (member != null)\n\t\t\t\t\treturn new MemberResolveResult(null, member, false);\n\t\t\t\telse\n\t\t\t\t\treturn errorResult;\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t{\n\t\t\tScanChildren(parameterDeclaration);\n\t\t\tif (resolverEnabled) {\n\t\t\t\tstring name = parameterDeclaration.Name;\n\t\t\t\t\n\t\t\t\tif (parameterDeclaration.Parent is DocumentationReference) {\n\t\t\t\t\t// create a dummy parameter\n\t\t\t\t\tIType type = ResolveType(parameterDeclaration.Type);\n\t\t\t\t\tswitch (parameterDeclaration.ParameterModifier) {\n\t\t\t\t\t\tcase ParameterModifier.Ref:\n\t\t\t\t\t\tcase ParameterModifier.Out:\n\t\t\t\t\t\t\ttype = new ByReferenceType(type);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\treturn new LocalResolveResult(new DefaultParameter(\n\t\t\t\t\t\ttype, name,\n\t\t\t\t\t\tisRef: parameterDeclaration.ParameterModifier == ParameterModifier.Ref,\n\t\t\t\t\t\tisOut: parameterDeclaration.ParameterModifier == ParameterModifier.Out,\n\t\t\t\t\t\tisParams: parameterDeclaration.ParameterModifier == ParameterModifier.Params));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Look in lambda parameters:\n\t\t\t\tforeach (IParameter p in resolver.LocalVariables.OfType<IParameter>()) {\n\t\t\t\t\tif (p.Name == name)\n\t\t\t\t\t\treturn new LocalResolveResult(p);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIParameterizedMember pm = resolver.CurrentMember as IParameterizedMember;\n\t\t\t\tif (pm == null && resolver.CurrentTypeDefinition != null) {\n\t\t\t\t\t// Also consider delegate parameters:\n\t\t\t\t\tpm = resolver.CurrentTypeDefinition.GetDelegateInvokeMethod();\n\t\t\t\t\t// pm will be null if the current type isn't a delegate\n\t\t\t\t}\n\t\t\t\tif (pm != null) {\n\t\t\t\t\tforeach (IParameter p in pm.Parameters) {\n\t\t\t\t\t\tif (p.Name == name) {\n\t\t\t\t\t\t\treturn new LocalResolveResult(p);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn errorResult;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration)\n\t\t{\n\t\t\tScanChildren(typeParameterDeclaration);\n\t\t\tif (resolverEnabled) {\n\t\t\t\tstring name = typeParameterDeclaration.Name;\n\t\t\t\tIMethod m = resolver.CurrentMember as IMethod;\n\t\t\t\tif (m != null) {\n\t\t\t\t\tforeach (var tp in m.TypeParameters) {\n\t\t\t\t\t\tif (tp.Name == name)\n\t\t\t\t\t\t\treturn new TypeResolveResult(tp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (resolver.CurrentTypeDefinition != null) {\n\t\t\t\t\tvar typeParameters = resolver.CurrentTypeDefinition.TypeParameters;\n\t\t\t\t\t// look backwards so that TPs in the current type take precedence over those copied from outer types\n\t\t\t\t\tfor (int i = typeParameters.Count - 1; i >= 0; i--) {\n\t\t\t\t\t\tif (typeParameters[i].Name == name)\n\t\t\t\t\t\t\treturn new TypeResolveResult(typeParameters[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn errorResult;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\t// Scan enum member attributes before setting resolver.CurrentMember, so that\n\t\t\t\t// enum values used as attribute arguments have the correct type.\n\t\t\t\t// (within an enum member, all other enum members are treated as having their underlying type)\n\t\t\t\tforeach (var attributeSection in enumMemberDeclaration.Attributes)\n\t\t\t\t\tScan(attributeSection);\n\t\t\t\t\n\t\t\t\tIMember member = null;\n\t\t\t\tif (unresolvedFile != null) {\n\t\t\t\t\tmember = GetMemberFromLocation(enumMemberDeclaration);\n\t\t\t\t} else if (resolver.CurrentTypeDefinition != null) {\n\t\t\t\t\tstring name = enumMemberDeclaration.Name;\n\t\t\t\t\tmember = resolver.CurrentTypeDefinition.GetFields(f => f.Name == name, GetMemberOptions.IgnoreInheritedMembers).FirstOrDefault();\n\t\t\t\t}\n\t\t\t\tresolver = resolver.WithCurrentMember(member);\n\t\t\t\t\n\t\t\t\tif (resolverEnabled && resolver.CurrentTypeDefinition != null) {\n\t\t\t\t\tResolveAndProcessConversion(enumMemberDeclaration.Initializer, resolver.CurrentTypeDefinition.EnumUnderlyingType);\n\t\t\t\t\tif (resolverEnabled && member != null)\n\t\t\t\t\t\treturn new MemberResolveResult(null, member, false);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn errorResult;\n\t\t\t\t} else {\n\t\t\t\t\tScan(enumMemberDeclaration.Initializer);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Track CheckForOverflow\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitCheckedExpression(CheckedExpression checkedExpression)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\tresolver = resolver.WithCheckForOverflow(true);\n\t\t\t\tif (resolverEnabled) {\n\t\t\t\t\treturn Resolve(checkedExpression.Expression);\n\t\t\t\t} else {\n\t\t\t\t\tScanChildren(checkedExpression);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUncheckedExpression(UncheckedExpression uncheckedExpression)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\tresolver = resolver.WithCheckForOverflow(false);\n\t\t\t\tif (resolverEnabled) {\n\t\t\t\t\treturn Resolve(uncheckedExpression.Expression);\n\t\t\t\t} else {\n\t\t\t\t\tScanChildren(uncheckedExpression);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitCheckedStatement(CheckedStatement checkedStatement)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\tresolver = resolver.WithCheckForOverflow(true);\n\t\t\t\tScanChildren(checkedStatement);\n\t\t\t\treturn voidResult;\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUncheckedStatement(UncheckedStatement uncheckedStatement)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\ttry {\n\t\t\t\tresolver = resolver.WithCheckForOverflow(false);\n\t\t\t\tScanChildren(uncheckedStatement);\n\t\t\t\treturn voidResult;\n\t\t\t} finally {\n\t\t\t\tresolver = oldResolver;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Visit AnonymousTypeCreateExpression\n\t\tstatic string GetAnonymousTypePropertyName(Expression expr, out Expression resolveExpr)\n\t\t{\n\t\t\tif (expr is NamedExpression) {\n\t\t\t\tvar namedArgExpr = (NamedExpression)expr;\n\t\t\t\tresolveExpr = namedArgExpr.Expression;\n\t\t\t\treturn namedArgExpr.Name;\n\t\t\t}\n\t\t\t// no name given, so it's a projection initializer\n\t\t\tif (expr is MemberReferenceExpression) {\n\t\t\t\tresolveExpr = expr;\n\t\t\t\treturn ((MemberReferenceExpression)expr).MemberName;\n\t\t\t}\n\t\t\tif (expr is IdentifierExpression) {\n\t\t\t\tresolveExpr = expr;\n\t\t\t\treturn ((IdentifierExpression)expr).Identifier;\n\t\t\t}\n\t\t\tresolveExpr = null;\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tclass AnonymousTypeMember\n\t\t{\n\t\t\tpublic readonly Expression Expression;\n\t\t\tpublic readonly ResolveResult Initializer;\n\t\t\t\n\t\t\tpublic AnonymousTypeMember(Expression expression, ResolveResult initializer)\n\t\t\t{\n\t\t\t\tthis.Expression = expression;\n\t\t\t\tthis.Initializer = initializer;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t{\n\t\t\t// 7.6.10.6 Anonymous object creation expressions\n\t\t\tList<IUnresolvedProperty> unresolvedProperties = new List<IUnresolvedProperty>();\n\t\t\tList<AnonymousTypeMember> members = new List<AnonymousTypeMember>();\n\t\t\tforeach (var expr in anonymousTypeCreateExpression.Initializers) {\n\t\t\t\tExpression resolveExpr;\n\t\t\t\tvar name = GetAnonymousTypePropertyName(expr, out resolveExpr);\n\t\t\t\tif (resolveExpr != null) {\n\t\t\t\t\tvar initRR = Resolve(resolveExpr);\n\t\t\t\t\tvar returnTypeRef = initRR.Type.ToTypeReference();\n\t\t\t\t\tvar property = new DefaultUnresolvedProperty();\n\t\t\t\t\tproperty.Name = name;\n\t\t\t\t\tproperty.Accessibility = Accessibility.Public;\n\t\t\t\t\tproperty.ReturnType = returnTypeRef;\n\t\t\t\t\tproperty.Getter = new DefaultUnresolvedMethod {\n\t\t\t\t\t\tName = \"get_\" + name,\n\t\t\t\t\t\tAccessibility = Accessibility.Public,\n\t\t\t\t\t\tReturnType = returnTypeRef,\n\t\t\t\t\t\tSymbolKind = SymbolKind.Accessor,\n\t\t\t\t\t\tAccessorOwner = property\n\t\t\t\t\t};\n\t\t\t\t\tunresolvedProperties.Add(property);\n\t\t\t\t\tmembers.Add(new AnonymousTypeMember(expr, initRR));\n\t\t\t\t} else {\n\t\t\t\t\tScan(expr);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar anonymousType = new AnonymousType(resolver.Compilation, unresolvedProperties);\n\t\t\tvar properties = anonymousType.GetProperties().ToList();\n\t\t\tDebug.Assert(properties.Count == members.Count);\n\t\t\tList<ResolveResult> assignments = new List<ResolveResult>();\n\t\t\tfor (int i = 0; i < members.Count; i++) {\n\t\t\t\tResolveResult lhs = new MemberResolveResult(new InitializedObjectResolveResult(anonymousType), properties[i]);\n\t\t\t\tResolveResult rhs = members[i].Initializer;\n\t\t\t\tResolveResult assignment = resolver.ResolveAssignment(AssignmentOperatorType.Assign, lhs, rhs);\n\t\t\t\tvar ne = members[i].Expression as NamedExpression;\n\t\t\t\tif (ne != null) {\n\t\t\t\t\tStoreCurrentState(ne);\n\t\t\t\t\t// ne.Expression was already resolved by the first loop\n\t\t\t\t\tStoreResult(ne, lhs);\n\t\t\t\t}\n\t\t\t\tassignments.Add(assignment);\n\t\t\t}\n\t\t\tvar anonymousCtor = DefaultResolvedMethod.GetDummyConstructor(resolver.Compilation, anonymousType);\n\t\t\treturn new InvocationResolveResult(null, anonymousCtor, initializerStatements: assignments);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Visit Expressions\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t{\n\t\t\tint dimensions = arrayCreateExpression.Arguments.Count;\n\t\t\tIEnumerable<Expression> sizeArgumentExpressions;\n\t\t\tResolveResult[] sizeArguments;\n\t\t\tIEnumerable<ArraySpecifier> additionalArraySpecifiers;\n\t\t\tif (dimensions == 0) {\n\t\t\t\tvar firstSpecifier = arrayCreateExpression.AdditionalArraySpecifiers.FirstOrDefault();\n\t\t\t\tif (firstSpecifier != null) {\n\t\t\t\t\tdimensions = firstSpecifier.Dimensions;\n\t\t\t\t\tadditionalArraySpecifiers = arrayCreateExpression.AdditionalArraySpecifiers.Skip(1);\n\t\t\t\t} else {\n\t\t\t\t\t// No array specifiers (neither with nor without size) - can happen if there are syntax errors.\n\t\t\t\t\t// Dimensions must be at least one; otherwise 'new ArrayType' will crash.\n\t\t\t\t\tdimensions = 1;\n\t\t\t\t\tadditionalArraySpecifiers = arrayCreateExpression.AdditionalArraySpecifiers;\n\t\t\t\t}\n\t\t\t\tsizeArguments = null;\n\t\t\t\tsizeArgumentExpressions = null;\n\t\t\t} else {\n\t\t\t\tsizeArgumentExpressions = arrayCreateExpression.Arguments;\n\t\t\t\tsizeArguments = new ResolveResult[dimensions];\n\t\t\t\tint pos = 0;\n\t\t\t\tforeach (var node in sizeArgumentExpressions)\n\t\t\t\t\tsizeArguments[pos++] = Resolve(node);\n\t\t\t\tadditionalArraySpecifiers = arrayCreateExpression.AdditionalArraySpecifiers;\n\t\t\t}\n\t\t\t\n\t\t\tint[] sizes;\n\t\t\tList<Expression> initializerElements;\n\t\t\tResolveResult[] initializerElementResults;\n\t\t\tif (arrayCreateExpression.Initializer.IsNull) {\n\t\t\t\tsizes = null;\n\t\t\t\tinitializerElements = null;\n\t\t\t\tinitializerElementResults = null;\n\t\t\t} else {\n\t\t\t\tStoreCurrentState(arrayCreateExpression.Initializer);\n\t\t\t\t\n\t\t\t\tinitializerElements = new List<Expression>();\n\t\t\t\tsizes = new int[dimensions];\n\t\t\t\tUnpackArrayInitializer(initializerElements, sizes, arrayCreateExpression.Initializer, 0, true);\n\t\t\t\tinitializerElementResults = new ResolveResult[initializerElements.Count];\n\t\t\t\tfor (int i = 0; i < initializerElementResults.Length; i++) {\n\t\t\t\t\tinitializerElementResults[i] = Resolve(initializerElements[i]);\n\t\t\t\t}\n\t\t\t\tStoreResult(arrayCreateExpression.Initializer, voidResult);\n\t\t\t}\n\t\t\t\n\t\t\tIType elementType;\n\t\t\tif (arrayCreateExpression.Type.IsNull) {\n\t\t\t\telementType = null;\n\t\t\t} else {\n\t\t\t\telementType = ResolveType(arrayCreateExpression.Type);\n\t\t\t\tforeach (var spec in additionalArraySpecifiers.Reverse()) {\n\t\t\t\t\telementType = new ArrayType(resolver.Compilation, elementType, spec.Dimensions);\n\t\t\t\t}\n\t\t\t}\n\t\t\tArrayCreateResolveResult acrr;\n\t\t\tif (sizeArguments != null) {\n\t\t\t\tacrr = resolver.ResolveArrayCreation(elementType, sizeArguments, initializerElementResults);\n\t\t\t} else if (sizes != null) {\n\t\t\t\tacrr = resolver.ResolveArrayCreation(elementType, sizes, initializerElementResults);\n\t\t\t} else {\n\t\t\t\t// neither size arguments nor an initializer exist -> error\n\t\t\t\treturn new ErrorResolveResult(new ArrayType(resolver.Compilation, elementType ?? SpecialType.UnknownType, dimensions));\n\t\t\t}\n\t\t\tif (sizeArgumentExpressions != null)\n\t\t\t\tProcessConversionResults(sizeArgumentExpressions, acrr.SizeArguments);\n\t\t\tif (acrr.InitializerElements != null)\n\t\t\t\tProcessConversionResults(initializerElements, acrr.InitializerElements);\n\t\t\treturn acrr;\n\t\t}\n\t\t\n\t\tvoid UnpackArrayInitializer(List<Expression> elementList, int[] sizes, ArrayInitializerExpression initializer, int dimension, bool resolveNestedInitializersToVoid)\n\t\t{\n\t\t\tDebug.Assert(dimension < sizes.Length);\n\t\t\tint elementCount = 0;\n\t\t\tif (dimension + 1 < sizes.Length) {\n\t\t\t\tforeach (var node in initializer.Elements) {\n\t\t\t\t\tArrayInitializerExpression aie = node as ArrayInitializerExpression;\n\t\t\t\t\tif (aie != null) {\n\t\t\t\t\t\tif (resolveNestedInitializersToVoid) {\n\t\t\t\t\t\t\tStoreCurrentState(aie);\n\t\t\t\t\t\t\tStoreResult(aie, voidResult);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tUnpackArrayInitializer(elementList, sizes, aie, dimension + 1, resolveNestedInitializersToVoid);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telementList.Add(node);\n\t\t\t\t\t}\n\t\t\t\t\telementCount++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach (var expr in initializer.Elements) {\n\t\t\t\t\telementList.Add(expr);\n\t\t\t\t\telementCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (sizes[dimension] == 0) // 0 = uninitialized\n\t\t\t\tsizes[dimension] = elementCount;\n\t\t\telse if (sizes[dimension] != elementCount)\n\t\t\t\tsizes[dimension] = -1; // -1 = error\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression)\n\t\t{\n\t\t\t// Array initializers are handled by their parent expression.\n\t\t\tScanChildren(arrayInitializerExpression);\n\t\t\treturn errorResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitAsExpression(AsExpression asExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tResolveResult input = Resolve(asExpression.Expression);\n\t\t\t\tvar targetType = ResolveType(asExpression.Type);\n\t\t\t\treturn new CastResolveResult(targetType, input, Conversion.TryCast, resolver.CheckForOverflow);\n\t\t\t} else {\n\t\t\t\tScanChildren(asExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tExpression left = assignmentExpression.Left;\n\t\t\t\tExpression right = assignmentExpression.Right;\n\t\t\t\tResolveResult leftResult = Resolve(left);\n\t\t\t\tResolveResult rightResult = Resolve(right);\n\t\t\t\tResolveResult rr = resolver.ResolveAssignment(assignmentExpression.Operator, leftResult, rightResult);\n\t\t\t\tProcessConversionsInBinaryOperatorResult(left, right, rr);\n\t\t\t\treturn rr;\n\t\t\t} else {\n\t\t\t\tScanChildren(assignmentExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\treturn resolver.ResolveBaseReference();\n\t\t\t} else {\n\t\t\t\tScanChildren(baseReferenceExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tExpression left = binaryOperatorExpression.Left;\n\t\t\t\tExpression right = binaryOperatorExpression.Right;\n\t\t\t\tResolveResult leftResult = Resolve(left);\n\t\t\t\tResolveResult rightResult = Resolve(right);\n\t\t\t\tResolveResult rr = resolver.ResolveBinaryOperator(binaryOperatorExpression.Operator, leftResult, rightResult);\n\t\t\t\tProcessConversionsInBinaryOperatorResult(left, right, rr);\n\t\t\t\treturn rr;\n\t\t\t} else {\n\t\t\t\tScanChildren(binaryOperatorExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult ProcessConversionsInBinaryOperatorResult(Expression left, Expression right, ResolveResult rr)\n\t\t{\n\t\t\tOperatorResolveResult orr = rr as OperatorResolveResult;\n\t\t\tif (orr != null && orr.Operands.Count == 2) {\n\t\t\t\tProcessConversionResult(left, orr.Operands[0] as ConversionResolveResult);\n\t\t\t\tProcessConversionResult(right, orr.Operands[1] as ConversionResolveResult);\n\t\t\t} else {\n\t\t\t\tInvocationResolveResult irr = rr as InvocationResolveResult;\n\t\t\t\tif (irr != null && irr.Arguments.Count == 2) {\n\t\t\t\t\tProcessConversionResult(left, irr.Arguments[0] as ConversionResolveResult);\n\t\t\t\t\tProcessConversionResult(right, irr.Arguments[1] as ConversionResolveResult);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn rr;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitCastExpression(CastExpression castExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tvar targetType = ResolveType(castExpression.Type);\n\t\t\t\tvar expr = castExpression.Expression;\n\t\t\t\tvar rr = resolver.ResolveCast(targetType, Resolve(expr));\n\t\t\t\tvar crr = rr as ConversionResolveResult;\n\t\t\t\tif (crr != null) {\n\t\t\t\t\tDebug.Assert(!(crr is CastResolveResult));\n\t\t\t\t\tProcessConversion(expr, crr.Input, crr.Conversion, targetType);\n\t\t\t\t\trr = new CastResolveResult(crr);\n\t\t\t\t}\n\t\t\t\treturn rr;\n\t\t\t} else {\n\t\t\t\tScanChildren(castExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tExpression condition = conditionalExpression.Condition;\n\t\t\t\tExpression trueExpr = conditionalExpression.TrueExpression;\n\t\t\t\tExpression falseExpr = conditionalExpression.FalseExpression;\n\t\t\t\t\n\t\t\t\tResolveResult rr = resolver.ResolveConditional(Resolve(condition), Resolve(trueExpr), Resolve(falseExpr));\n\t\t\t\tOperatorResolveResult corr = rr as OperatorResolveResult;\n\t\t\t\tif (corr != null && corr.Operands.Count == 3) {\n\t\t\t\t\tProcessConversionResult(condition, corr.Operands[0] as ConversionResolveResult);\n\t\t\t\t\tProcessConversionResult(trueExpr, corr.Operands[1] as ConversionResolveResult);\n\t\t\t\t\tProcessConversionResult(falseExpr, corr.Operands[2] as ConversionResolveResult);\n\t\t\t\t}\n\t\t\t\treturn rr;\n\t\t\t} else {\n\t\t\t\tScanChildren(conditionalExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\treturn resolver.ResolveDefaultValue(ResolveType(defaultValueExpression.Type));\n\t\t\t} else {\n\t\t\t\tScanChildren(defaultValueExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tResolveResult rr = Resolve(directionExpression.Expression);\n\t\t\t\treturn new ByReferenceResolveResult(rr, directionExpression.FieldDirection == FieldDirection.Out);\n\t\t\t} else {\n\t\t\t\tScanChildren(directionExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t{\n\t\t\tif (resolverEnabled || NeedsResolvingDueToNamedArguments(indexerExpression)) {\n\t\t\t\tExpression target = indexerExpression.Target;\n\t\t\t\tResolveResult targetResult = Resolve(target);\n\t\t\t\tstring[] argumentNames;\n\t\t\t\tResolveResult[] arguments = GetArguments(indexerExpression.Arguments, out argumentNames);\n\t\t\t\tResolveResult rr = resolver.ResolveIndexer(targetResult, arguments, argumentNames);\n\t\t\t\tArrayAccessResolveResult aarr = rr as ArrayAccessResolveResult;\n\t\t\t\tif (aarr != null) {\n\t\t\t\t\tMarkUnknownNamedArguments(indexerExpression.Arguments);\n\t\t\t\t\tProcessConversionResults(indexerExpression.Arguments, aarr.Indexes);\n\t\t\t\t} else {\n\t\t\t\t\tProcessInvocationResult(target, indexerExpression.Arguments, rr);\n\t\t\t\t}\n\t\t\t\treturn rr;\n\t\t\t} else {\n\t\t\t\tScanChildren(indexerExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitIsExpression(IsExpression isExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tResolveResult input = Resolve(isExpression.Expression);\n\t\t\t\tIType targetType = ResolveType(isExpression.Type);\n\t\t\t\tIType booleanType = resolver.Compilation.FindType(KnownTypeCode.Boolean);\n\t\t\t\treturn new TypeIsResolveResult(input, targetType, booleanType);\n\t\t\t} else {\n\t\t\t\tScanChildren(isExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// NamedArgumentExpression is \"identifier: Expression\"\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression)\n\t\t{\n\t\t\t// The parent expression takes care of handling NamedArgumentExpressions\n\t\t\t// by calling GetArguments().\n\t\t\t// This method gets called only when scanning, or when the named argument is used\n\t\t\t// in an invalid context.\n\t\t\tif (resolverEnabled) {\n\t\t\t\treturn new NamedArgumentResolveResult(namedArgumentExpression.Name, Resolve(namedArgumentExpression.Expression));\n\t\t\t} else {\n\t\t\t\tScan(namedArgumentExpression.Expression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// NamedExpression is \"identifier = Expression\" in object initializers and attributes\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitNamedExpression(NamedExpression namedExpression)\n\t\t{\n\t\t\t// The parent expression takes care of handling NamedExpression\n\t\t\t// by calling HandleObjectInitializer() or HandleNamedExpression().\n\t\t\t// This method gets called only when scanning, or when the named expression is used\n\t\t\t// in an invalid context.\n\t\t\tScanChildren(namedExpression);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tvoid HandleNamedExpression(NamedExpression namedExpression, List<ResolveResult> initializerStatements)\n\t\t{\n\t\t\tStoreCurrentState(namedExpression);\n\t\t\tExpression rhs = namedExpression.Expression;\n\t\t\tResolveResult lhsRR = resolver.ResolveIdentifierInObjectInitializer(namedExpression.Name);\n\t\t\tif (rhs is ArrayInitializerExpression) {\n\t\t\t\tHandleObjectInitializer(lhsRR, (ArrayInitializerExpression)rhs, initializerStatements);\n\t\t\t} else {\n\t\t\t\tvar rhsRR = Resolve(rhs);\n\t\t\t\tvar rr = resolver.ResolveAssignment(AssignmentOperatorType.Assign, lhsRR, rhsRR) as OperatorResolveResult;\n\t\t\t\tif (rr != null) {\n\t\t\t\t\tProcessConversionResult(rhs, rr.Operands[1] as ConversionResolveResult);\n\t\t\t\t\tinitializerStatements.Add(rr);\n\t\t\t\t}\n\t\t\t}\n\t\t\tStoreResult(namedExpression, lhsRR);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression)\n\t\t{\n\t\t\treturn resolver.ResolvePrimitive(null);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t{\n\t\t\tvar typeResolveResult = Resolve(objectCreateExpression.Type);\n\t\t\tif (typeResolveResult.IsError) {\n\t\t\t\tScanChildren (objectCreateExpression);\n\t\t\t\treturn typeResolveResult;\n\t\t\t}\n\t\t\tIType type = typeResolveResult.Type;\n\t\t\t\n\t\t\tList<ResolveResult> initializerStatements = null;\n\t\t\tvar initializer = objectCreateExpression.Initializer;\n\t\t\tif (!initializer.IsNull) {\n\t\t\t\tinitializerStatements = new List<ResolveResult>();\n\t\t\t\tHandleObjectInitializer(new InitializedObjectResolveResult(type), initializer, initializerStatements);\n\t\t\t}\n\t\t\t\n\t\t\tstring[] argumentNames;\n\t\t\tResolveResult[] arguments = GetArguments(objectCreateExpression.Arguments, out argumentNames);\n\t\t\t\n\t\t\tResolveResult rr = resolver.ResolveObjectCreation(type, arguments, argumentNames, false, initializerStatements);\n\t\t\tif (arguments.Length == 1 && rr.Type.Kind == TypeKind.Delegate) {\n\t\t\t\tMarkUnknownNamedArguments(objectCreateExpression.Arguments);\n\t\t\t\t// Apply conversion to argument if it directly wraps the argument\n\t\t\t\t// (but not when creating a delegate from a delegate, as then there would be a MGRR for .Invoke in between)\n\t\t\t\t// This is necessary for lambda type inference.\n\t\t\t\tvar crr = rr as ConversionResolveResult;\n\t\t\t\tif (crr != null) {\n\t\t\t\t\tif (objectCreateExpression.Arguments.Count == 1)\n\t\t\t\t\t\tProcessConversionResult(objectCreateExpression.Arguments.Single(), crr);\n\t\t\t\t\t\n\t\t\t\t\t// wrap the result so that the delegate creation is not handled as a reference\n\t\t\t\t\t// to the target method - otherwise FindReferencedEntities would produce two results for\n\t\t\t\t\t// the same delegate creation.\n\t\t\t\t\treturn new CastResolveResult(crr);\n\t\t\t\t} else {\n\t\t\t\t\treturn rr;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// process conversions in all other cases\n\t\t\t\tProcessInvocationResult(null, objectCreateExpression.Arguments, rr);\n\t\t\t\treturn rr;\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid HandleObjectInitializer(ResolveResult initializedObject, ArrayInitializerExpression initializer, List<ResolveResult> initializerStatements)\n\t\t{\n\t\t\tStoreCurrentState(initializer);\n\t\t\tresolver = resolver.PushObjectInitializer(initializedObject);\n\t\t\tforeach (Expression element in initializer.Elements) {\n\t\t\t\tArrayInitializerExpression aie = element as ArrayInitializerExpression;\n\t\t\t\tif (aie != null) {\n\t\t\t\t\tStoreCurrentState(aie);\n\t\t\t\t\t// constructor argument list in collection initializer\n\t\t\t\t\tResolveResult[] addArguments = new ResolveResult[aie.Elements.Count];\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var addArgument in aie.Elements) {\n\t\t\t\t\t\taddArguments[i++] = Resolve(addArgument);\n\t\t\t\t\t}\n\t\t\t\t\tMemberLookup memberLookup = resolver.CreateMemberLookup();\n\t\t\t\t\tvar addRR = memberLookup.Lookup(initializedObject, \"Add\", EmptyList<IType>.Instance, true);\n\t\t\t\t\tvar mgrr = addRR as MethodGroupResolveResult;\n\t\t\t\t\tif (mgrr != null) {\n\t\t\t\t\t\tOverloadResolution or = mgrr.PerformOverloadResolution(resolver.Compilation, addArguments, null, false, false, false, resolver.CheckForOverflow, resolver.conversions);\n\t\t\t\t\t\tvar invocationRR = or.CreateResolveResult(initializedObject);\n\t\t\t\t\t\tStoreResult(aie, invocationRR);\n\t\t\t\t\t\tProcessInvocationResult(null, aie.Elements, invocationRR);\n\t\t\t\t\t\tinitializerStatements.Add(invocationRR);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tStoreResult(aie, addRR);\n\t\t\t\t\t}\n\t\t\t\t} else if (element is NamedExpression) {\n\t\t\t\t\tHandleNamedExpression((NamedExpression)element, initializerStatements);\n\t\t\t\t} else {\n\t\t\t\t\t// unknown kind of expression\n\t\t\t\t\tScan(element);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolver = resolver.PopObjectInitializer();\n\t\t\tStoreResult(initializer, voidResult);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\treturn Resolve(parenthesizedExpression.Expression);\n\t\t\t} else {\n\t\t\t\tScan(parenthesizedExpression.Expression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tResolveResult target = Resolve(pointerReferenceExpression.Target);\n\t\t\t\tResolveResult deferencedTarget = resolver.ResolveUnaryOperator(UnaryOperatorType.Dereference, target);\n\t\t\t\tList<IType> typeArguments = new List<IType>();\n\t\t\t\tforeach (AstType typeArgument in pointerReferenceExpression.TypeArguments) {\n\t\t\t\t\ttypeArguments.Add(ResolveType(typeArgument));\n\t\t\t\t}\n\t\t\t\treturn resolver.ResolveMemberAccess(deferencedTarget, pointerReferenceExpression.MemberName,\n\t\t\t\t                                    typeArguments,\n\t\t\t\t                                    GetNameLookupMode(pointerReferenceExpression));\n\t\t\t} else {\n\t\t\t\tScanChildren(pointerReferenceExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t{\n\t\t\treturn resolver.ResolvePrimitive(primitiveExpression.Value);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitSizeOfExpression(SizeOfExpression sizeOfExpression)\n\t\t{\n\t\t\treturn resolver.ResolveSizeOf(ResolveType(sizeOfExpression.Type));\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitStackAllocExpression(StackAllocExpression stackAllocExpression)\n\t\t{\n\t\t\tResolveAndProcessConversion(stackAllocExpression.CountExpression, resolver.Compilation.FindType(KnownTypeCode.Int32));\n\t\t\treturn new ResolveResult(new PointerType(ResolveType(stackAllocExpression.Type)));\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t{\n\t\t\treturn resolver.ResolveThisReference();\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitTypeOfExpression(TypeOfExpression typeOfExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\treturn resolver.ResolveTypeOf(ResolveType(typeOfExpression.Type));\n\t\t\t} else {\n\t\t\t\tScan(typeOfExpression.Type);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\treturn Resolve(typeReferenceExpression.Type).ShallowClone();\n\t\t\t} else {\n\t\t\t\tScan(typeReferenceExpression.Type);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tExpression expr = unaryOperatorExpression.Expression;\n\t\t\t\tResolveResult input = Resolve(expr);\n\t\t\t\tITypeDefinition inputTypeDef = input.Type.GetDefinition();\n\t\t\t\tif (input.IsCompileTimeConstant && expr is PrimitiveExpression && inputTypeDef != null) {\n\t\t\t\t\t// Special cases for int.MinValue and long.MinValue\n\t\t\t\t\tif (inputTypeDef.KnownTypeCode == KnownTypeCode.UInt32 && 2147483648.Equals(input.ConstantValue)) {\n\t\t\t\t\t\treturn new ConstantResolveResult(resolver.Compilation.FindType(KnownTypeCode.Int32), -2147483648);\n\t\t\t\t\t} else if (inputTypeDef.KnownTypeCode == KnownTypeCode.UInt64 && 9223372036854775808.Equals(input.ConstantValue)) {\n\t\t\t\t\t\treturn new ConstantResolveResult(resolver.Compilation.FindType(KnownTypeCode.Int64), -9223372036854775808);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tResolveResult rr = resolver.ResolveUnaryOperator(unaryOperatorExpression.Operator, input);\n\t\t\t\tOperatorResolveResult uorr = rr as OperatorResolveResult;\n\t\t\t\tif (uorr != null && uorr.Operands.Count == 1) {\n\t\t\t\t\tProcessConversionResult(expr, uorr.Operands[0] as ConversionResolveResult);\n\t\t\t\t} else {\n\t\t\t\t\tInvocationResolveResult irr = rr as InvocationResolveResult;\n\t\t\t\t\tif (irr != null && irr.Arguments.Count == 1) {\n\t\t\t\t\t\tProcessConversionResult(expr, irr.Arguments[0] as ConversionResolveResult);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn rr;\n\t\t\t} else {\n\t\t\t\tScanChildren(unaryOperatorExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression)\n\t\t{\n\t\t\tScanChildren(undocumentedExpression);\n\t\t\tIType resultType;\n\t\t\tswitch (undocumentedExpression.UndocumentedExpressionType) {\n\t\t\t\tcase UndocumentedExpressionType.ArgListAccess:\n\t\t\t\tcase UndocumentedExpressionType.ArgList:\n\t\t\t\t\tresultType = resolver.Compilation.FindType(typeof(RuntimeArgumentHandle));\n\t\t\t\t\tbreak;\n\t\t\t\tcase UndocumentedExpressionType.RefValue:\n\t\t\t\t\tvar tre = undocumentedExpression.Arguments.ElementAtOrDefault(1) as TypeReferenceExpression;\n\t\t\t\t\tif (tre != null)\n\t\t\t\t\t\tresultType = ResolveType(tre.Type);\n\t\t\t\t\telse\n\t\t\t\t\t\tresultType = SpecialType.UnknownType;\n\t\t\t\t\tbreak;\n\t\t\t\tcase UndocumentedExpressionType.RefType:\n\t\t\t\t\tresultType = resolver.Compilation.FindType(KnownTypeCode.Type);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UndocumentedExpressionType.MakeRef:\n\t\t\t\t\tresultType = resolver.Compilation.FindType(typeof(TypedReference));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException(\"Invalid value for UndocumentedExpressionType\");\n\t\t\t}\n\t\t\treturn new ResolveResult(resultType);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Visit Identifier/MemberReference/Invocation-Expression\n\t\t// IdentifierExpression, MemberReferenceExpression and InvocationExpression\n\t\t// are grouped together because they have to work together for\n\t\t// \"7.6.4.1 Identical simple names and type names\" support\n\t\tList<IType> ResolveTypeArguments(IEnumerable<AstType> typeArguments)\n\t\t{\n\t\t\tList<IType> result = new List<IType>();\n\t\t\tforeach (AstType typeArgument in typeArguments) {\n\t\t\t\tresult.Add(ResolveType(typeArgument));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets and resolves the arguments; unpacking any NamedArgumentExpressions.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Callers of GetArguments must also call either ProcessConversionsInInvocation or MarkUnknownNamedArguments\n\t\t/// to ensure the named arguments get resolved.\n\t\t/// Also, as named arguments get resolved by the parent node, the parent node must not scan\n\t\t/// into the argument list without being resolved - see NeedsResolvingDueToNamedArguments().\n\t\t/// </remarks>\n\t\tResolveResult[] GetArguments(IEnumerable<Expression> argumentExpressions, out string[] argumentNames)\n\t\t{\n\t\t\targumentNames = null;\n\t\t\tResolveResult[] arguments = new ResolveResult[argumentExpressions.Count()];\n\t\t\tint i = 0;\n\t\t\tforeach (AstNode argument in argumentExpressions) {\n\t\t\t\tNamedArgumentExpression nae = argument as NamedArgumentExpression;\n\t\t\t\tAstNode argumentValue;\n\t\t\t\tif (nae != null) {\n\t\t\t\t\tif (argumentNames == null)\n\t\t\t\t\t\targumentNames = new string[arguments.Length];\n\t\t\t\t\targumentNames[i] = nae.Name;\n\t\t\t\t\targumentValue = nae.Expression;\n\t\t\t\t} else {\n\t\t\t\t\targumentValue = argument;\n\t\t\t\t}\n\t\t\t\targuments[i++] = Resolve(argumentValue);\n\t\t\t}\n\t\t\treturn arguments;\n\t\t}\n\t\t\n\t\tbool NeedsResolvingDueToNamedArguments(Expression nodeWithArguments)\n\t\t{\n\t\t\tfor (AstNode child = nodeWithArguments.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\tif (child is NamedArgumentExpression)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic NameLookupMode GetNameLookupMode(Expression expr)\n\t\t{\n\t\t\tInvocationExpression ie = expr.Parent as InvocationExpression;\n\t\t\tif (ie != null && ie.Target == expr)\n\t\t\t\treturn NameLookupMode.InvocationTarget;\n\t\t\telse\n\t\t\t\treturn NameLookupMode.Expression;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets whether 'rr' is considered a static access on the target identifier.\n\t\t/// </summary>\n\t\t/// <param name=\"rr\">Resolve Result of the MemberReferenceExpression</param>\n\t\t/// <param name=\"invocationRR\">Resolve Result of the InvocationExpression</param>\n\t\tbool IsStaticResult(ResolveResult rr, ResolveResult invocationRR)\n\t\t{\n\t\t\tif (rr is TypeResolveResult)\n\t\t\t\treturn true;\n\t\t\tMemberResolveResult mrr = (rr is MethodGroupResolveResult ? invocationRR : rr) as MemberResolveResult;\n\t\t\treturn mrr != null && mrr.Member.IsStatic;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\t// Note: this method is not called when it occurs in a situation where an ambiguity between\n\t\t\t// simple names and type names might occur.\n\t\t\tif (resolverEnabled) {\n\t\t\t\tvar typeArguments = ResolveTypeArguments(identifierExpression.TypeArguments);\n\t\t\t\tvar lookupMode = GetNameLookupMode(identifierExpression);\n\t\t\t\treturn resolver.LookupSimpleNameOrTypeName(\n\t\t\t\t\tidentifierExpression.Identifier, typeArguments, lookupMode);\n\t\t\t} else {\n\t\t\t\tScanChildren(identifierExpression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\t// target = Resolve(identifierExpression = memberReferenceExpression.Target)\n\t\t\t// trr = ResolveType(identifierExpression)\n\t\t\t// rr = Resolve(memberReferenceExpression)\n\t\t\t\n\t\t\tIdentifierExpression identifierExpression = memberReferenceExpression.Target as IdentifierExpression;\n\t\t\tif (identifierExpression != null && identifierExpression.TypeArguments.Count == 0) {\n\t\t\t\t// Special handling for §7.6.4.1 Identicial simple names and type names\n\t\t\t\tStoreCurrentState(identifierExpression);\n\t\t\t\tResolveResult target = resolver.ResolveSimpleName(identifierExpression.Identifier, EmptyList<IType>.Instance);\n\t\t\t\tTypeResolveResult trr;\n\t\t\t\tif (resolver.IsVariableReferenceWithSameType(target, identifierExpression.Identifier, out trr)) {\n\t\t\t\t\t// It's ambiguous\n\t\t\t\t\tResolveResult rr = ResolveMemberReferenceOnGivenTarget(target, memberReferenceExpression);\n\t\t\t\t\tResolveResult simpleNameRR = IsStaticResult(rr, null) ? trr : target;\n\t\t\t\t\tLog.WriteLine(\"Ambiguous simple name '{0}' was resolved to {1}\", identifierExpression, simpleNameRR);\n\t\t\t\t\tStoreResult(identifierExpression, simpleNameRR);\n\t\t\t\t\treturn rr;\n\t\t\t\t} else {\n\t\t\t\t\t// It's not ambiguous\n\t\t\t\t\tLog.WriteLine(\"Simple name '{0}' was resolved to {1}\", identifierExpression, target);\n\t\t\t\t\tStoreResult(identifierExpression, target);\n\t\t\t\t\treturn ResolveMemberReferenceOnGivenTarget(target, memberReferenceExpression);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Regular code path\n\t\t\t\tif (resolverEnabled) {\n\t\t\t\t\tResolveResult target = Resolve(memberReferenceExpression.Target);\n\t\t\t\t\treturn ResolveMemberReferenceOnGivenTarget(target, memberReferenceExpression);\n\t\t\t\t} else {\n\t\t\t\t\tScanChildren(memberReferenceExpression);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult ResolveMemberReferenceOnGivenTarget(ResolveResult target, MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tvar typeArguments = ResolveTypeArguments(memberReferenceExpression.TypeArguments);\n\t\t\treturn resolver.ResolveMemberAccess(\n\t\t\t\ttarget, memberReferenceExpression.MemberName, typeArguments,\n\t\t\t\tGetNameLookupMode(memberReferenceExpression));\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\t// rr = Resolve(invocationExpression)\n\t\t\t// target = Resolve(memberReferenceExpression = invocationExpression.Target)\n\t\t\t// idRR = Resolve(identifierExpression = memberReferenceExpression.Target)\n\t\t\t// trr = ResolveType(identifierExpression)\n\t\t\t\n\t\t\tMemberReferenceExpression mre = invocationExpression.Target as MemberReferenceExpression;\n\t\t\tIdentifierExpression identifierExpression = mre != null ? mre.Target as IdentifierExpression : null;\n\t\t\tif (identifierExpression != null && identifierExpression.TypeArguments.Count == 0) {\n\t\t\t\t// Special handling for §7.6.4.1 Identicial simple names and type names\n\t\t\t\t\n\t\t\t\tStoreCurrentState(identifierExpression);\n\t\t\t\tStoreCurrentState(mre);\n\t\t\t\t\n\t\t\t\tResolveResult idRR = resolver.ResolveSimpleName(identifierExpression.Identifier, EmptyList<IType>.Instance);\n\t\t\t\tResolveResult target = ResolveMemberReferenceOnGivenTarget(idRR, mre);\n\t\t\t\tLog.WriteLine(\"Member reference '{0}' on potentially-ambiguous simple-name was resolved to {1}\", mre, target);\n\t\t\t\tStoreResult(mre, target);\n\t\t\t\tTypeResolveResult trr;\n\t\t\t\tif (resolver.IsVariableReferenceWithSameType(idRR, identifierExpression.Identifier, out trr)) {\n\t\t\t\t\t// It's ambiguous\n\t\t\t\t\tResolveResult rr = ResolveInvocationOnGivenTarget(target, invocationExpression);\n\t\t\t\t\tResolveResult simpleNameRR = IsStaticResult(target, rr) ? trr : idRR;\n\t\t\t\t\tLog.WriteLine(\"Ambiguous simple name '{0}' was resolved to {1}\",\n\t\t\t\t\t              identifierExpression, simpleNameRR);\n\t\t\t\t\tStoreResult(identifierExpression, simpleNameRR);\n\t\t\t\t\treturn rr;\n\t\t\t\t} else {\n\t\t\t\t\t// It's not ambiguous\n\t\t\t\t\tLog.WriteLine(\"Simple name '{0}' was resolved to {1}\", identifierExpression, idRR);\n\t\t\t\t\tStoreResult(identifierExpression, idRR);\n\t\t\t\t\treturn ResolveInvocationOnGivenTarget(target, invocationExpression);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Regular code path\n\t\t\t\tif (resolverEnabled || NeedsResolvingDueToNamedArguments(invocationExpression)) {\n\t\t\t\t\tResolveResult target = Resolve(invocationExpression.Target);\n\t\t\t\t\treturn ResolveInvocationOnGivenTarget(target, invocationExpression);\n\t\t\t\t} else {\n\t\t\t\t\tScanChildren(invocationExpression);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult ResolveInvocationOnGivenTarget(ResolveResult target, InvocationExpression invocationExpression)\n\t\t{\n\t\t\tstring[] argumentNames;\n\t\t\tResolveResult[] arguments = GetArguments(invocationExpression.Arguments, out argumentNames);\n\t\t\tResolveResult rr = resolver.ResolveInvocation(target, arguments, argumentNames);\n\t\t\tProcessInvocationResult(invocationExpression.Target, invocationExpression.Arguments, rr);\n\t\t\treturn rr;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Lamdbas / Anonymous Functions\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\treturn HandleExplicitlyTypedLambda(\n\t\t\t\tanonymousMethodExpression.Parameters, anonymousMethodExpression.Body,\n\t\t\t\tisAnonymousMethod: true,\n\t\t\t\thasParameterList: anonymousMethodExpression.HasParameterList,\n\t\t\t\tisAsync: anonymousMethodExpression.IsAsync);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tbool isExplicitlyTyped = false;\n\t\t\tbool isImplicitlyTyped = false;\n\t\t\tforeach (var p in lambdaExpression.Parameters) {\n\t\t\t\tisImplicitlyTyped |= p.Type.IsNull;\n\t\t\t\tisExplicitlyTyped |= !p.Type.IsNull;\n\t\t\t}\n\t\t\tif (isExplicitlyTyped || !isImplicitlyTyped) {\n\t\t\t\treturn HandleExplicitlyTypedLambda(\n\t\t\t\t\tlambdaExpression.Parameters, lambdaExpression.Body,\n\t\t\t\t\tisAnonymousMethod: false, hasParameterList: true, isAsync: lambdaExpression.IsAsync);\n\t\t\t} else {\n\t\t\t\treturn new ImplicitlyTypedLambda(lambdaExpression, this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#region Explicitly typed\n\t\tExplicitlyTypedLambda HandleExplicitlyTypedLambda(\n\t\t\tAstNodeCollection<ParameterDeclaration> parameterDeclarations,\n\t\t\tAstNode body, bool isAnonymousMethod, bool hasParameterList, bool isAsync)\n\t\t{\n\t\t\tCSharpResolver oldResolver = resolver;\n\t\t\tList<IParameter> parameters = (hasParameterList || parameterDeclarations.Any()) ? new List<IParameter>() : null;\n\t\t\t//bool oldIsWithinLambdaExpression = resolver.IsWithinLambdaExpression;\n\t\t\tresolver = resolver.WithIsWithinLambdaExpression(true);\n\t\t\tforeach (var pd in parameterDeclarations) {\n\t\t\t\tIType type = ResolveType(pd.Type);\n\t\t\t\tif (pd.ParameterModifier == ParameterModifier.Ref || pd.ParameterModifier == ParameterModifier.Out)\n\t\t\t\t\ttype = new ByReferenceType(type);\n\t\t\t\t\n\t\t\t\tIParameter p = new DefaultParameter(type, pd.Name,\n\t\t\t\t                                    region: MakeRegion(pd),\n\t\t\t\t                                    isRef: pd.ParameterModifier == ParameterModifier.Ref,\n\t\t\t\t                                    isOut: pd.ParameterModifier == ParameterModifier.Out);\n\t\t\t\t// The parameter declaration must be scanned in the current context (without the new parameter)\n\t\t\t\t// in order to be consistent with the context in which we resolved pd.Type.\n\t\t\t\tStoreCurrentState(pd);\n\t\t\t\tStoreResult(pd, new LocalResolveResult(p));\n\t\t\t\tScanChildren(pd);\n\t\t\t\t\n\t\t\t\tresolver = resolver.AddVariable(p);\n\t\t\t\tparameters.Add(p);\n\t\t\t}\n\t\t\t\n\t\t\tvar lambda = new ExplicitlyTypedLambda(parameters, isAnonymousMethod, isAsync, resolver, this, body);\n\t\t\t\n\t\t\t// Don't scan the lambda body here - we'll do that later when analyzing the ExplicitlyTypedLambda.\n\t\t\t\n\t\t\tresolver = oldResolver;\n\t\t\treturn lambda;\n\t\t}\n\t\t\n\t\tDomRegion MakeRegion(AstNode node)\n\t\t{\n\t\t\tif (unresolvedFile != null)\n\t\t\t\treturn new DomRegion(unresolvedFile.FileName, node.StartLocation, node.EndLocation);\n\t\t\telse\n\t\t\t\treturn node.GetRegion();\n\t\t}\n\t\t\n\t\tsealed class ExplicitlyTypedLambda : LambdaBase\n\t\t{\n\t\t\treadonly IList<IParameter> parameters;\n\t\t\treadonly bool isAnonymousMethod;\n\t\t\treadonly bool isAsync;\n\t\t\t\n\t\t\tCSharpResolver storedContext;\n\t\t\tResolveVisitor visitor;\n\t\t\tAstNode body;\n\t\t\tResolveResult bodyRR;\n\t\t\t\n\t\t\tIType inferredReturnType;\n\t\t\tIList<Expression> returnExpressions;\n\t\t\tIList<ResolveResult> returnValues;\n\t\t\tbool isValidAsVoidMethod;\n\t\t\tbool isEndpointUnreachable;\n\t\t\t\n\t\t\t// The actual return type is set when the lambda is applied by the conversion.\n\t\t\t// For async lambdas, this includes the task type\n\t\t\tIType actualReturnType;\n\t\t\t\n\t\t\tinternal override bool IsUndecided {\n\t\t\t\tget { return actualReturnType == null; }\n\t\t\t}\n\t\t\t\n\t\t\tinternal override AstNode LambdaExpression {\n\t\t\t\tget { return body.Parent; }\n\t\t\t}\n\t\t\t\n\t\t\tinternal override AstNode BodyExpression {\n\t\t\t\tget { return body; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ResolveResult Body {\n\t\t\t\tget {\n\t\t\t\t\tif (bodyRR != null)\n\t\t\t\t\t\treturn bodyRR;\n\n\t\t\t\t\tif (body is Expression) {\n\t\t\t\t\t\tAnalyze();\n\t\t\t\t\t\tif (returnValues.Count == 1) {\n\t\t\t\t\t\t\tbodyRR = returnValues[0];\n\t\t\t\t\t\t\tif (actualReturnType != null) {\n\t\t\t\t\t\t\t\tIType unpackedActualReturnType = isAsync ? visitor.UnpackTask(actualReturnType) : actualReturnType;\n\t\t\t\t\t\t\t\tif (unpackedActualReturnType.Kind != TypeKind.Void) {\n\t\t\t\t\t\t\t\t\tvar conv = storedContext.conversions.ImplicitConversion(bodyRR, unpackedActualReturnType);\n\t\t\t\t\t\t\t\t\tif (!conv.IsIdentityConversion)\n\t\t\t\t\t\t\t\t\t\tbodyRR = new ConversionResolveResult(unpackedActualReturnType, bodyRR, conv, storedContext.CheckForOverflow);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn bodyRR;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn bodyRR = visitor.voidResult;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic ExplicitlyTypedLambda(IList<IParameter> parameters, bool isAnonymousMethod, bool isAsync, CSharpResolver storedContext, ResolveVisitor visitor, AstNode body)\n\t\t\t{\n\t\t\t\tthis.parameters = parameters;\n\t\t\t\tthis.isAnonymousMethod = isAnonymousMethod;\n\t\t\t\tthis.isAsync = isAsync;\n\t\t\t\tthis.storedContext = storedContext;\n\t\t\t\tthis.visitor = visitor;\n\t\t\t\tthis.body = body;\n\t\t\t\t\n\t\t\t\tif (visitor.undecidedLambdas == null)\n\t\t\t\t\tvisitor.undecidedLambdas = new List<LambdaBase>();\n\t\t\t\tvisitor.undecidedLambdas.Add(this);\n\t\t\t\tLog.WriteLine(\"Added undecided explicitly-typed lambda: \" + this.LambdaExpression);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IList<IParameter> Parameters {\n\t\t\t\tget {\n\t\t\t\t\treturn parameters ?? EmptyList<IParameter>.Instance;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbool Analyze()\n\t\t\t{\n\t\t\t\t// If it's not already analyzed\n\t\t\t\tif (inferredReturnType == null) {\n\t\t\t\t\tLog.WriteLine(\"Analyzing \" + this.LambdaExpression + \"...\");\n\t\t\t\t\tLog.Indent();\n\t\t\t\t\t\n\t\t\t\t\tvisitor.ResetContext(\n\t\t\t\t\t\tstoredContext,\n\t\t\t\t\t\tdelegate {\n\t\t\t\t\t\t\tvar oldNavigator = visitor.navigator;\n\t\t\t\t\t\t\tvisitor.navigator = new ConstantModeResolveVisitorNavigator(ResolveVisitorNavigationMode.Resolve, oldNavigator);\n\t\t\t\t\t\t\tvisitor.AnalyzeLambda(body, isAsync, out isValidAsVoidMethod, out isEndpointUnreachable, out inferredReturnType, out returnExpressions, out returnValues);\n\t\t\t\t\t\t\tvisitor.navigator = oldNavigator;\n\t\t\t\t\t\t});\n\t\t\t\t\tLog.Unindent();\n\t\t\t\t\tLog.WriteLine(\"Finished analyzing \" + this.LambdaExpression);\n\t\t\t\t\t\n\t\t\t\t\tif (inferredReturnType == null)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"AnalyzeLambda() didn't set inferredReturnType\");\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Conversion IsValid(IType[] parameterTypes, IType returnType, CSharpConversions conversions)\n\t\t\t{\n\t\t\t\tLog.WriteLine(\"Testing validity of {0} for return-type {1}...\", this, returnType);\n\t\t\t\tLog.Indent();\n\t\t\t\tbool valid = Analyze() && IsValidLambda(isValidAsVoidMethod, isEndpointUnreachable, isAsync, returnValues, returnType, conversions);\n\t\t\t\tLog.Unindent();\n\t\t\t\tLog.WriteLine(\"{0} is {1} for return-type {2}\", this, valid ? \"valid\" : \"invalid\", returnType);\n\t\t\t\treturn new AnonymousFunctionConversion(returnType, this, valid);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType GetInferredReturnType(IType[] parameterTypes)\n\t\t\t{\n\t\t\t\tAnalyze();\n\t\t\t\treturn inferredReturnType;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType ReturnType {\n\t\t\t\tget {\n\t\t\t\t\treturn actualReturnType ?? SpecialType.UnknownType;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicitlyTyped {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAsync {\n\t\t\t\tget { return isAsync; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAnonymousMethod {\n\t\t\t\tget { return isAnonymousMethod; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasParameterList {\n\t\t\t\tget { return parameters != null; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"[ExplicitlyTypedLambda \" + this.LambdaExpression + \"]\";\n\t\t\t}\n\t\t\t\n\t\t\tpublic void ApplyReturnType(ResolveVisitor parentVisitor, IType returnType)\n\t\t\t{\n\t\t\t\tif (returnType == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"returnType\");\n\t\t\t\tif (parentVisitor != visitor) {\n\t\t\t\t\t// Explicitly typed lambdas do not use a nested visitor\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t}\n\t\t\t\tif (actualReturnType != null) {\n\t\t\t\t\tif (actualReturnType.Equals(returnType))\n\t\t\t\t\t\treturn; // return type already set\n\t\t\t\t\tthrow new InvalidOperationException(\"inconsistent return types for explicitly-typed lambda\");\n\t\t\t\t}\n\t\t\t\tactualReturnType = returnType;\n\t\t\t\tvisitor.undecidedLambdas.Remove(this);\n\t\t\t\tAnalyze();\n\t\t\t\tIType unpackedReturnType = isAsync ? visitor.UnpackTask(returnType) : returnType;\n\t\t\t\tLog.WriteLine(\"Applying return type {0} to explicitly-typed lambda {1}\", unpackedReturnType, this.LambdaExpression);\n\t\t\t\tif (unpackedReturnType.Kind != TypeKind.Void || body is BlockStatement) {\n\t\t\t\t\tfor (int i = 0; i < returnExpressions.Count; i++) {\n\t\t\t\t\t\tvisitor.ProcessConversion(returnExpressions[i], returnValues[i], unpackedReturnType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tinternal override void EnforceMerge(ResolveVisitor parentVisitor)\n\t\t\t{\n\t\t\t\tApplyReturnType(parentVisitor, SpecialType.UnknownType);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Implicitly typed\n\t\t// Implicitly-typed lambdas are really complex, as the lambda depends on the target type (the delegate to which\n\t\t// the lambda is converted), but figuring out the target type might involve overload resolution (for method\n\t\t// calls in which the lambda is used as argument), which requires knowledge about the lamdba.\n\t\t// \n\t\t// The implementation in NRefactory works like this:\n\t\t// 1. The lambda resolves to a ImplicitlyTypedLambda (derived from LambdaResolveResult).\n\t\t//     The lambda body is not resolved yet (one of the few places where ResolveVisitor\n\t\t//     deviates from the usual depth-first AST traversal).\n\t\t// 2. The parent statement is resolved as usual. This might require analyzing the lambda in detail (for example\n\t\t//    as part of overload resolution). Such analysis happens using LambdaResolveResult.IsValid, where the caller\n\t\t//    (i.e. the overload resolution algorithm) supplies the parameter types to the lambda body. For every IsValid()\n\t\t//    call, a nested LambdaTypeHypothesis is constructed for analyzing the lambda using the supplied type assignment.\n\t\t//    Multiple IsValid() calls may use several LambdaTypeHypothesis instances, one for each set of parameter types.\n\t\t// 3. When the resolver reports the conversions that occurred as part of the parent statement (as with any\n\t\t//    conversions), the results from the LambdaTypeHypothesis corresponding to the actually chosen\n\t\t//    conversion are merged into the main resolver.\n\t\t// 4. LambdaResolveResult.Body is set to the main resolve result from the chosen nested resolver. I think this\n\t\t//    is the only place where NRefactory is mutating a ResolveResult (normally all resolve results are immutable).\n\t\t//    As this step is guaranteed to occur before the resolver returns the LamdbaResolveResult to user code, the\n\t\t//    mutation shouldn't cause any problems.\n\t\tsealed class ImplicitlyTypedLambda : LambdaBase\n\t\t{\n\t\t\treadonly LambdaExpression lambda;\n\t\t\treadonly QuerySelectClause selectClause;\n\t\t\t\n\t\t\treadonly CSharpResolver storedContext;\n\t\t\treadonly CSharpUnresolvedFile unresolvedFile;\n\t\t\treadonly List<LambdaTypeHypothesis> hypotheses = new List<LambdaTypeHypothesis>();\n\t\t\tinternal IList<IParameter> parameters = new List<IParameter>();\n\t\t\t\n\t\t\tinternal IType actualReturnType;\n\t\t\tinternal LambdaTypeHypothesis winningHypothesis;\n\t\t\tinternal ResolveResult bodyResult;\n\t\t\tinternal readonly ResolveVisitor parentVisitor;\n\t\t\t\n\t\t\tinternal override bool IsUndecided {\n\t\t\t\tget { return winningHypothesis == null;  }\n\t\t\t}\n\t\t\t\n\t\t\tinternal override AstNode LambdaExpression {\n\t\t\t\tget {\n\t\t\t\t\tif (selectClause != null)\n\t\t\t\t\t\treturn selectClause.Expression;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn lambda;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tinternal override AstNode BodyExpression {\n\t\t\t\tget {\n\t\t\t\t\tif (selectClause != null)\n\t\t\t\t\t\treturn selectClause.Expression;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn lambda.Body;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ResolveResult Body {\n\t\t\t\tget { return bodyResult; }\n\t\t\t}\n\t\t\t\n\t\t\tprivate ImplicitlyTypedLambda(ResolveVisitor parentVisitor)\n\t\t\t{\n\t\t\t\tthis.parentVisitor = parentVisitor;\n\t\t\t\tthis.storedContext = parentVisitor.resolver;\n\t\t\t\tthis.unresolvedFile = parentVisitor.unresolvedFile;\n\t\t\t\tthis.bodyResult = parentVisitor.voidResult;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ImplicitlyTypedLambda(LambdaExpression lambda, ResolveVisitor parentVisitor)\n\t\t\t\t: this(parentVisitor)\n\t\t\t{\n\t\t\t\tthis.lambda = lambda;\n\t\t\t\tforeach (var pd in lambda.Parameters) {\n\t\t\t\t\tparameters.Add(new DefaultParameter(SpecialType.UnknownType, pd.Name, region: parentVisitor.MakeRegion(pd)));\n\t\t\t\t}\n\t\t\t\tRegisterUndecidedLambda();\n\t\t\t}\n\t\t\t\n\t\t\tpublic ImplicitlyTypedLambda(QuerySelectClause selectClause, IEnumerable<IParameter> parameters, ResolveVisitor parentVisitor)\n\t\t\t\t: this(parentVisitor)\n\t\t\t{\n\t\t\t\tthis.selectClause = selectClause;\n\t\t\t\tforeach (IParameter p in parameters)\n\t\t\t\t\tthis.parameters.Add(p);\n\t\t\t\t\n\t\t\t\tRegisterUndecidedLambda();\n\t\t\t}\n\t\t\t\n\t\t\tvoid RegisterUndecidedLambda()\n\t\t\t{\n\t\t\t\tif (parentVisitor.undecidedLambdas == null)\n\t\t\t\t\tparentVisitor.undecidedLambdas = new List<LambdaBase>();\n\t\t\t\tparentVisitor.undecidedLambdas.Add(this);\n\t\t\t\tLog.WriteLine(\"Added undecided implicitly-typed lambda: \" + this.LambdaExpression);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IList<IParameter> Parameters {\n\t\t\t\tget { return parameters; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Conversion IsValid(IType[] parameterTypes, IType returnType, CSharpConversions conversions)\n\t\t\t{\n\t\t\t\tLog.WriteLine(\"Testing validity of {0} for parameters ({1}) and return-type {2}...\",\n\t\t\t\t              this, string.Join<IType>(\", \", parameterTypes), returnType);\n\t\t\t\tLog.Indent();\n\t\t\t\tvar hypothesis = GetHypothesis(parameterTypes);\n\t\t\t\tConversion c = hypothesis.IsValid(returnType, conversions);\n\t\t\t\tLog.Unindent();\n\t\t\t\tLog.WriteLine(\"{0} is {1} for return-type {2}\", hypothesis, c.IsValid ? \"valid\" : \"invalid\", returnType);\n\t\t\t\treturn c;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType GetInferredReturnType(IType[] parameterTypes)\n\t\t\t{\n\t\t\t\treturn GetHypothesis(parameterTypes).inferredReturnType;\n\t\t\t}\n\t\t\t\n\t\t\tLambdaTypeHypothesis GetHypothesis(IType[] parameterTypes)\n\t\t\t{\n\t\t\t\tif (parameterTypes.Length != parameters.Count)\n\t\t\t\t\tthrow new ArgumentException(\"Incorrect parameter type count\");\n\t\t\t\tforeach (var h in hypotheses) {\n\t\t\t\t\tbool ok = true;\n\t\t\t\t\tfor (int i = 0; i < parameterTypes.Length; i++) {\n\t\t\t\t\t\tif (!parameterTypes[i].Equals(h.parameterTypes[i])) {\n\t\t\t\t\t\t\tok = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (ok)\n\t\t\t\t\t\treturn h;\n\t\t\t\t}\n\t\t\t\tResolveVisitor visitor = new ResolveVisitor(storedContext, unresolvedFile);\n\t\t\t\tvar newHypothesis = new LambdaTypeHypothesis(this, parameterTypes, visitor, lambda != null ? lambda.Parameters : null, storedContext);\n\t\t\t\thypotheses.Add(newHypothesis);\n\t\t\t\treturn newHypothesis;\n\t\t\t}\n\t\t\t\n\t\t\t/// <summary>\n\t\t\t/// Get any hypothesis for this lambda.\n\t\t\t/// This method is used as fallback if the lambda isn't merged the normal way (AnonymousFunctionConversion)\n\t\t\t/// </summary>\n\t\t\tinternal LambdaTypeHypothesis GetAnyHypothesis()\n\t\t\t{\n\t\t\t\tif (winningHypothesis != null)\n\t\t\t\t\treturn winningHypothesis;\n\t\t\t\tif (hypotheses.Count == 0) {\n\t\t\t\t\t// make a new hypothesis with unknown parameter types\n\t\t\t\t\tIType[] parameterTypes = new IType[parameters.Count];\n\t\t\t\t\tfor (int i = 0; i < parameterTypes.Length; i++) {\n\t\t\t\t\t\tparameterTypes[i] = SpecialType.UnknownType;\n\t\t\t\t\t}\n\t\t\t\t\treturn GetHypothesis(parameterTypes);\n\t\t\t\t} else {\n\t\t\t\t\t// We have the choice, so pick the hypothesis with the least missing parameter types\n\t\t\t\t\tLambdaTypeHypothesis bestHypothesis = hypotheses[0];\n\t\t\t\t\tint bestHypothesisUnknownParameters = bestHypothesis.CountUnknownParameters();\n\t\t\t\t\tfor (int i = 1; i < hypotheses.Count; i++) {\n\t\t\t\t\t\tint c = hypotheses[i].CountUnknownParameters();\n\t\t\t\t\t\tif (c < bestHypothesisUnknownParameters ||\n\t\t\t\t\t\t    (c == bestHypothesisUnknownParameters && hypotheses[i].success && !bestHypothesis.success))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbestHypothesis = hypotheses[i];\n\t\t\t\t\t\t\tbestHypothesisUnknownParameters = c;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn bestHypothesis;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tinternal override void EnforceMerge(ResolveVisitor parentVisitor)\n\t\t\t{\n\t\t\t\tGetAnyHypothesis().MergeInto(parentVisitor, SpecialType.UnknownType);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType ReturnType {\n\t\t\t\tget { return actualReturnType ?? SpecialType.UnknownType; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicitlyTyped {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAnonymousMethod {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasParameterList {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAsync {\n\t\t\t\tget { return lambda != null && lambda.IsAsync; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"[ImplicitlyTypedLambda \" + this.LambdaExpression + \"]\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Every possible set of parameter types gets its own 'hypothetical world'.\n\t\t/// It uses a nested ResolveVisitor that has its own resolve cache, so that resolve results cannot leave the hypothetical world.\n\t\t/// \n\t\t/// Only after overload resolution is applied and the actual parameter types are known, the winning hypothesis will be merged\n\t\t/// with the parent ResolveVisitor.\n\t\t/// This is done when the AnonymousFunctionConversion is applied on the parent visitor.\n\t\t/// </summary>\n\t\tsealed class LambdaTypeHypothesis : IResolveVisitorNavigator\n\t\t{\n\t\t\treadonly ImplicitlyTypedLambda lambda;\n\t\t\treadonly IParameter[] lambdaParameters;\n\t\t\tinternal readonly IType[] parameterTypes;\n\t\t\treadonly ResolveVisitor visitor;\n\t\t\treadonly CSharpResolver storedContext;\n\t\t\t\n\t\t\tinternal readonly IType inferredReturnType;\n\t\t\tIList<Expression> returnExpressions;\n\t\t\tIList<ResolveResult> returnValues;\n\t\t\tbool isValidAsVoidMethod;\n\t\t\tbool isEndpointUnreachable;\n\t\t\tinternal bool success;\n\t\t\t\n\t\t\tpublic LambdaTypeHypothesis(ImplicitlyTypedLambda lambda, IType[] parameterTypes, ResolveVisitor visitor,\n\t\t\t                            ICollection<ParameterDeclaration> parameterDeclarations, CSharpResolver storedContext)\n\t\t\t{\n\t\t\t\tDebug.Assert(parameterTypes.Length == lambda.Parameters.Count);\n\t\t\t\t\n\t\t\t\tthis.lambda = lambda;\n\t\t\t\tthis.parameterTypes = parameterTypes;\n\t\t\t\tthis.visitor = visitor;\n\t\t\t\tthis.storedContext = storedContext;\n\t\t\t\tvisitor.SetNavigator(this);\n\t\t\t\t\n\t\t\t\tLog.WriteLine(\"Analyzing \" + ToString() + \"...\");\n\t\t\t\tLog.Indent();\n\t\t\t\tCSharpResolver oldResolver = visitor.resolver;\n\t\t\t\tvisitor.resolver = visitor.resolver.WithIsWithinLambdaExpression(true);\n\t\t\t\tlambdaParameters = new IParameter[parameterTypes.Length];\n\t\t\t\tif (parameterDeclarations != null) {\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var pd in parameterDeclarations) {\n\t\t\t\t\t\tlambdaParameters[i] = new DefaultParameter(parameterTypes[i], pd.Name, region: visitor.MakeRegion(pd));\n\t\t\t\t\t\tvisitor.resolver = visitor.resolver.AddVariable(lambdaParameters[i]);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tvisitor.Scan(pd);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (int i = 0; i < parameterTypes.Length; i++) {\n\t\t\t\t\t\tvar p = lambda.Parameters[i];\n\t\t\t\t\t\tlambdaParameters[i] = new DefaultParameter(parameterTypes[i], p.Name, region: p.Region);\n\t\t\t\t\t\tvisitor.resolver = visitor.resolver.AddVariable(lambdaParameters[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsuccess = true;\n\t\t\t\tvisitor.AnalyzeLambda(lambda.BodyExpression, lambda.IsAsync, out isValidAsVoidMethod, out isEndpointUnreachable, out inferredReturnType, out returnExpressions, out returnValues);\n\t\t\t\tvisitor.resolver = oldResolver;\n\t\t\t\tLog.Unindent();\n\t\t\t\tLog.WriteLine(\"Finished analyzing \" + ToString());\n\t\t\t}\n\t\t\t\n\t\t\tResolveVisitorNavigationMode IResolveVisitorNavigator.Scan(AstNode node)\n\t\t\t{\n\t\t\t\treturn ResolveVisitorNavigationMode.Resolve;\n\t\t\t}\n\t\t\t\n\t\t\tvoid IResolveVisitorNavigator.Resolved(AstNode node, ResolveResult result)\n\t\t\t{\n\t\t\t\tif (result.IsError)\n\t\t\t\t\tsuccess = false;\n\t\t\t}\n\t\t\t\n\t\t\tvoid IResolveVisitorNavigator.ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t\tsuccess &= conversion.IsValid;\n\t\t\t}\n\t\t\t\n\t\t\tinternal int CountUnknownParameters()\n\t\t\t{\n\t\t\t\tint c = 0;\n\t\t\t\tforeach (IType t in parameterTypes) {\n\t\t\t\t\tif (t.Kind == TypeKind.Unknown)\n\t\t\t\t\t\tc++;\n\t\t\t\t}\n\t\t\t\treturn c;\n\t\t\t}\n\t\t\t\n\t\t\tpublic Conversion IsValid(IType returnType, CSharpConversions conversions)\n\t\t\t{\n\t\t\t\tbool valid = success && IsValidLambda(isValidAsVoidMethod, isEndpointUnreachable, lambda.IsAsync, returnValues, returnType, conversions);\n\t\t\t\treturn new AnonymousFunctionConversion(returnType, this, valid);\n\t\t\t}\n\t\t\t\n\t\t\tpublic void MergeInto(ResolveVisitor parentVisitor, IType returnType)\n\t\t\t{\n\t\t\t\tif (returnType == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"returnType\");\n\t\t\t\tif (parentVisitor != lambda.parentVisitor)\n\t\t\t\t\tthrow new InvalidOperationException(\"parent visitor mismatch\");\n\t\t\t\t\n\t\t\t\tif (lambda.winningHypothesis == this)\n\t\t\t\t\treturn;\n\t\t\t\telse if (lambda.winningHypothesis != null)\n\t\t\t\t\tthrow new InvalidOperationException(\"Trying to merge conflicting hypotheses\");\n\t\t\t\t\n\t\t\t\tlambda.actualReturnType = returnType;\n\t\t\t\tif (lambda.IsAsync)\n\t\t\t\t\treturnType = parentVisitor.UnpackTask(returnType);\n\t\t\t\t\n\t\t\t\tlambda.winningHypothesis = this;\n\t\t\t\tlambda.parameters = lambdaParameters; // replace untyped parameters with typed parameters\n\t\t\t\tif (lambda.BodyExpression is Expression && returnValues.Count == 1) {\n\t\t\t\t\tlambda.bodyResult = returnValues[0];\n\t\t\t\t\tif (returnType.Kind != TypeKind.Void) {\n\t\t\t\t\t\tvar conv = storedContext.conversions.ImplicitConversion(lambda.bodyResult, returnType);\n\t\t\t\t\t\tif (!conv.IsIdentityConversion)\n\t\t\t\t\t\t\tlambda.bodyResult = new ConversionResolveResult(returnType, lambda.bodyResult, conv, storedContext.CheckForOverflow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tLog.WriteLine(\"Applying return type {0} to implicitly-typed lambda {1}\", returnType, lambda.LambdaExpression);\n\t\t\t\tif (returnType.Kind != TypeKind.Void || lambda.BodyExpression is Statement) {\n\t\t\t\t\tfor (int i = 0; i < returnExpressions.Count; i++) {\n\t\t\t\t\t\tvisitor.ProcessConversion(returnExpressions[i], returnValues[i], returnType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvisitor.MergeUndecidedLambdas();\n\t\t\t\tLog.WriteLine(\"Merging \" + ToString());\n\t\t\t\tforeach (var pair in visitor.resolverBeforeDict) {\n\t\t\t\t\tDebug.Assert(!parentVisitor.resolverBeforeDict.ContainsKey(pair.Key));\n\t\t\t\t\tparentVisitor.resolverBeforeDict[pair.Key] = pair.Value;\n\t\t\t\t}\n\t\t\t\tforeach (var pair in visitor.resolverAfterDict) {\n\t\t\t\t\tDebug.Assert(!parentVisitor.resolverAfterDict.ContainsKey(pair.Key));\n\t\t\t\t\tparentVisitor.resolverAfterDict[pair.Key] = pair.Value;\n\t\t\t\t}\n\t\t\t\tforeach (var pair in visitor.resolveResultCache) {\n\t\t\t\t\tparentVisitor.StoreResult(pair.Key, pair.Value);\n\t\t\t\t}\n\t\t\t\tparentVisitor.ImportConversions(visitor);\n\t\t\t\tparentVisitor.undecidedLambdas.Remove(lambda);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\tStringBuilder b = new StringBuilder();\n\t\t\t\tb.Append(\"[LambdaTypeHypothesis (\");\n\t\t\t\tfor (int i = 0; i < parameterTypes.Length; i++) {\n\t\t\t\t\tif (i > 0) b.Append(\", \");\n\t\t\t\t\tb.Append(parameterTypes[i]);\n\t\t\t\t\tb.Append(' ');\n\t\t\t\t\tb.Append(lambda.Parameters[i].Name);\n\t\t\t\t}\n\t\t\t\tb.Append(\") => \");\n\t\t\t\tb.Append(lambda.BodyExpression.ToString());\n\t\t\t\tb.Append(']');\n\t\t\t\treturn b.ToString();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MergeUndecidedLambdas\n\t\tabstract class LambdaBase : LambdaResolveResult\n\t\t{\n\t\t\tinternal abstract bool IsUndecided { get; }\n\t\t\tinternal abstract AstNode LambdaExpression { get; }\n\t\t\tinternal abstract AstNode BodyExpression { get; }\n\t\t\t\n\t\t\tinternal abstract void EnforceMerge(ResolveVisitor parentVisitor);\n\t\t\t\n\t\t\tpublic override ResolveResult ShallowClone()\n\t\t\t{\n\t\t\t\tif (IsUndecided)\n\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\treturn base.ShallowClone();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid MergeUndecidedLambdas()\n\t\t{\n\t\t\tif (undecidedLambdas == null || undecidedLambdas.Count == 0)\n\t\t\t\treturn;\n\t\t\tLog.WriteLine(\"MergeUndecidedLambdas()...\");\n\t\t\tLog.Indent();\n\t\t\twhile (undecidedLambdas.Count > 0) {\n\t\t\t\tLambdaBase lambda = undecidedLambdas[0];\n\t\t\t\t// may happen caused by parse error l =>\n\t\t\t\tif (lambda.LambdaExpression == null) {\n\t\t\t\t\tundecidedLambdas.Remove (lambda);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tResolveParentForConversion(lambda.LambdaExpression);\n\t\t\t\tif (lambda.IsUndecided) {\n\t\t\t\t\t// Lambda wasn't merged by resolving its parent -> enforce merging\n\t\t\t\t\tLog.WriteLine(\"Lambda wasn't merged by conversion - enforce merging\");\n\t\t\t\t\tlambda.EnforceMerge(this);\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog.Unindent();\n\t\t\tLog.WriteLine(\"MergeUndecidedLambdas() finished.\");\n\t\t}\n\t\t\n\t\tvoid ResolveParentForConversion(AstNode expression)\n\t\t{\n\t\t\tAstNode parent = expression.Parent;\n\t\t\t// Continue going upwards until we find a node that can be resolved and provides\n\t\t\t// an expected type.\n\t\t\twhile (ParenthesizedExpression.ActsAsParenthesizedExpression(parent) || CSharpAstResolver.IsUnresolvableNode(parent)) {\n\t\t\t\tparent = parent.Parent;\n\t\t\t}\n\t\t\tCSharpResolver storedResolver;\n\t\t\tif (parent != null && resolverBeforeDict.TryGetValue(parent, out storedResolver)) {\n\t\t\t\tLog.WriteLine(\"Trying to resolve '\" + parent + \"' in order to find the conversion applied to '\" + expression + \"'...\");\n\t\t\t\tLog.Indent();\n\t\t\t\tResetContext(storedResolver, delegate { Resolve(parent); });\n\t\t\t\tLog.Unindent();\n\t\t\t} else {\n\t\t\t\tLog.WriteLine(\"Could not find a suitable parent for '\" + expression + \"'\");\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region AnalyzeLambda\n\t\tIType GetTaskType(IType resultType)\n\t\t{\n\t\t\tif (resultType.Kind == TypeKind.Unknown)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\tif (resultType.Kind == TypeKind.Void)\n\t\t\t\treturn resolver.Compilation.FindType(KnownTypeCode.Task);\n\t\t\t\n\t\t\tITypeDefinition def = resolver.Compilation.FindType(KnownTypeCode.TaskOfT).GetDefinition();\n\t\t\tif (def != null)\n\t\t\t\treturn new ParameterizedType(def, new[] { resultType });\n\t\t\telse\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t}\n\t\t\n\t\tvoid AnalyzeLambda(AstNode body, bool isAsync, out bool isValidAsVoidMethod, out bool isEndpointUnreachable, out IType inferredReturnType, out IList<Expression> returnExpressions, out IList<ResolveResult> returnValues)\n\t\t{\n\t\t\tisEndpointUnreachable = false;\n\t\t\tExpression expr = body as Expression;\n\t\t\tif (expr != null) {\n\t\t\t\tisValidAsVoidMethod = ExpressionPermittedAsStatement(expr);\n\t\t\t\treturnExpressions = new [] { expr };\n\t\t\t\treturnValues = new[] { Resolve(expr) };\n\t\t\t\tinferredReturnType = returnValues[0].Type;\n\t\t\t} else {\n\t\t\t\tScan(body);\n\t\t\t\t\n\t\t\t\tAnalyzeLambdaVisitor alv = new AnalyzeLambdaVisitor();\n\t\t\t\tbody.AcceptVisitor(alv);\n\t\t\t\tisValidAsVoidMethod = (alv.ReturnExpressions.Count == 0);\n\t\t\t\tif (alv.HasVoidReturnStatements) {\n\t\t\t\t\treturnExpressions = EmptyList<Expression>.Instance;\n\t\t\t\t\treturnValues = EmptyList<ResolveResult>.Instance;\n\t\t\t\t\tinferredReturnType = resolver.Compilation.FindType(KnownTypeCode.Void);\n\t\t\t\t} else {\n\t\t\t\t\treturnExpressions = alv.ReturnExpressions;\n\t\t\t\t\treturnValues = new ResolveResult[returnExpressions.Count];\n\t\t\t\t\tfor (int i = 0; i < returnValues.Count; i++) {\n\t\t\t\t\t\treturnValues[i] = resolveResultCache[returnExpressions[i]];\n\t\t\t\t\t}\n\n\t\t\t\t\t// async lambdas without return statements are resolved as Task return types.\n\t\t\t\t\tif (returnExpressions.Count == 0 && isAsync) {\n\t\t\t\t\t\tinferredReturnType = resolver.Compilation.FindType(KnownTypeCode.Task);\n\t\t\t\t\t\tLog.WriteLine(\"Lambda return type was inferred to: \" + inferredReturnType);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tTypeInference ti = new TypeInference(resolver.Compilation, resolver.conversions);\n\t\t\t\t\tbool tiSuccess;\n\t\t\t\t\tinferredReturnType = ti.GetBestCommonType(returnValues, out tiSuccess);\n\t\t\t\t\t// Failure to infer a return type does not make the lambda invalid,\n\t\t\t\t\t// so we can ignore the 'tiSuccess' value\n\t\t\t\t\tif (isValidAsVoidMethod && returnExpressions.Count == 0 && body is Statement) {\n\t\t\t\t\t\tvar reachabilityAnalysis = ReachabilityAnalysis.Create(\n\t\t\t\t\t\t\t(Statement)body, (node, _) => resolveResultCache[node],\n\t\t\t\t\t\t\tresolver.CurrentTypeResolveContext, cancellationToken);\n\t\t\t\t\t\tisEndpointUnreachable = !reachabilityAnalysis.IsEndpointReachable((Statement)body);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isAsync)\n\t\t\t\tinferredReturnType = GetTaskType(inferredReturnType);\n\t\t\tLog.WriteLine(\"Lambda return type was inferred to: \" + inferredReturnType);\n\t\t}\n\t\t\n\t\tstatic bool ExpressionPermittedAsStatement(Expression expr)\n\t\t{\n\t\t\tUnaryOperatorExpression uoe = expr as UnaryOperatorExpression;\n\t\t\tif (uoe != null) {\n\t\t\t\tswitch (uoe.Operator) {\n\t\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\t\tcase UnaryOperatorType.Await:\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn expr is InvocationExpression\n\t\t\t\t|| expr is ObjectCreateExpression\n\t\t\t\t|| expr is AssignmentExpression;\n\t\t}\n\t\t\n\t\tstatic bool IsValidLambda(bool isValidAsVoidMethod, bool isEndpointUnreachable, bool isAsync, IList<ResolveResult> returnValues, IType returnType, CSharpConversions conversions)\n\t\t{\n\t\t\tif (returnType.Kind == TypeKind.Void) {\n\t\t\t\t// Lambdas that are valid statement lambdas or expression lambdas with a statement-expression\n\t\t\t\t// can be converted to delegates with void return type.\n\t\t\t\t// This holds for both async and regular lambdas.\n\t\t\t\treturn isValidAsVoidMethod;\n\t\t\t} else if (isAsync && TaskType.IsTask(returnType) && returnType.TypeParameterCount == 0) {\n\t\t\t\t// Additionally, async lambdas with the above property can be converted to non-generic Task.\n\t\t\t\treturn isValidAsVoidMethod;\n\t\t\t} else {\n\t\t\t\tif (returnValues.Count == 0)\n\t\t\t\t\treturn isEndpointUnreachable;\n\t\t\t\tif (isAsync) {\n\t\t\t\t\t// async lambdas must return Task<T>\n\t\t\t\t\tif (!(TaskType.IsTask(returnType) && returnType.TypeParameterCount == 1))\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t// unpack Task<T> for testing the implicit conversions\n\t\t\t\t\treturnType = ((ParameterizedType)returnType).GetTypeArgument(0);\n\t\t\t\t}\n\t\t\t\tforeach (ResolveResult returnRR in returnValues) {\n\t\t\t\t\tif (!conversions.ImplicitConversion(returnRR, returnType).IsValid)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIType UnpackTask(IType type)\n\t\t{\n\t\t\treturn TaskType.UnpackTask(resolver.Compilation, type);\n\t\t}\n\t\t\n\t\tsealed class AnalyzeLambdaVisitor : DepthFirstAstVisitor\n\t\t{\n\t\t\tpublic bool HasVoidReturnStatements;\n\t\t\tpublic List<Expression> ReturnExpressions = new List<Expression>();\n\t\t\t\n\t\t\tpublic override void VisitReturnStatement(ReturnStatement returnStatement)\n\t\t\t{\n\t\t\t\tExpression expr = returnStatement.Expression;\n\t\t\t\tif (expr.IsNull) {\n\t\t\t\t\tHasVoidReturnStatements = true;\n\t\t\t\t} else {\n\t\t\t\t\tReturnExpressions.Add(expr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\t// don't go into nested lambdas\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\t// don't go into nested lambdas\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t#endregion\n\t\t\n\t\t#region ForEach Statement\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t{\n\t\t\tvar compilation = resolver.Compilation;\n\t\t\tResolveResult expression = Resolve(foreachStatement.InExpression);\n\t\t\tbool isImplicitlyTypedVariable = foreachStatement.VariableType.IsVar();\n\t\t\tvar memberLookup = resolver.CreateMemberLookup();\n\t\t\t\n\t\t\tIType collectionType, enumeratorType, elementType;\n\t\t\tResolveResult getEnumeratorInvocation;\n\t\t\tResolveResult currentRR = null;\n\t\t\t// C# 4.0 spec: §8.8.4 The foreach statement\n\t\t\tif (expression.Type.Kind == TypeKind.Array || expression.Type.Kind == TypeKind.Dynamic) {\n\t\t\t\tcollectionType = compilation.FindType(KnownTypeCode.IEnumerable);\n\t\t\t\tenumeratorType = compilation.FindType(KnownTypeCode.IEnumerator);\n\t\t\t\tif (expression.Type.Kind == TypeKind.Array) {\n\t\t\t\t\telementType = ((ArrayType)expression.Type).ElementType;\n\t\t\t\t} else {\n\t\t\t\t\telementType = isImplicitlyTypedVariable ? SpecialType.Dynamic : compilation.FindType(KnownTypeCode.Object);\n\t\t\t\t}\n\t\t\t\tgetEnumeratorInvocation = resolver.ResolveCast(collectionType, expression);\n\t\t\t\tgetEnumeratorInvocation = resolver.ResolveMemberAccess(getEnumeratorInvocation, \"GetEnumerator\", EmptyList<IType>.Instance, NameLookupMode.InvocationTarget);\n\t\t\t\tgetEnumeratorInvocation = resolver.ResolveInvocation(getEnumeratorInvocation, new ResolveResult[0]);\n\t\t\t} else {\n\t\t\t\tvar getEnumeratorMethodGroup = memberLookup.Lookup(expression, \"GetEnumerator\", EmptyList<IType>.Instance, true) as MethodGroupResolveResult;\n\t\t\t\tif (getEnumeratorMethodGroup != null) {\n\t\t\t\t\tvar or = getEnumeratorMethodGroup.PerformOverloadResolution(\n\t\t\t\t\t\tcompilation, new ResolveResult[0],\n\t\t\t\t\t\tallowExtensionMethods: false, allowExpandingParams: false, allowOptionalParameters: false);\n\t\t\t\t\tif (or.FoundApplicableCandidate && !or.IsAmbiguous && !or.BestCandidate.IsStatic && or.BestCandidate.IsPublic) {\n\t\t\t\t\t\tcollectionType = expression.Type;\n\t\t\t\t\t\tgetEnumeratorInvocation = or.CreateResolveResult(expression);\n\t\t\t\t\t\tenumeratorType = getEnumeratorInvocation.Type;\n\t\t\t\t\t\tcurrentRR = memberLookup.Lookup(new ResolveResult(enumeratorType), \"Current\", EmptyList<IType>.Instance, false);\n\t\t\t\t\t\telementType = currentRR.Type;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCheckForEnumerableInterface(expression, out collectionType, out enumeratorType, out elementType, out getEnumeratorInvocation);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tCheckForEnumerableInterface(expression, out collectionType, out enumeratorType, out elementType, out getEnumeratorInvocation);\n\t\t\t\t}\n\t\t\t}\n\t\t\tIMethod moveNextMethod = null;\n\t\t\tvar moveNextMethodGroup = memberLookup.Lookup(new ResolveResult(enumeratorType), \"MoveNext\", EmptyList<IType>.Instance, false) as MethodGroupResolveResult;\n\t\t\tif (moveNextMethodGroup != null) {\n\t\t\t\tvar or = moveNextMethodGroup.PerformOverloadResolution(\n\t\t\t\t\tcompilation, new ResolveResult[0],\n\t\t\t\t\tallowExtensionMethods: false, allowExpandingParams: false, allowOptionalParameters: false);\n\t\t\t\tmoveNextMethod = or.GetBestCandidateWithSubstitutedTypeArguments() as IMethod;\n\t\t\t}\n\t\t\t\n\t\t\tif (currentRR == null)\n\t\t\t\tcurrentRR = memberLookup.Lookup(new ResolveResult(enumeratorType), \"Current\", EmptyList<IType>.Instance, false);\n\t\t\tIProperty currentProperty = null;\n\t\t\tif (currentRR is MemberResolveResult)\n\t\t\t\tcurrentProperty = ((MemberResolveResult)currentRR).Member as IProperty;\n\t\t\t// end of foreach resolve logic\n\t\t\t// back to resolve visitor:\n\t\t\t\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tIVariable v;\n\t\t\tif (isImplicitlyTypedVariable) {\n\t\t\t\tStoreCurrentState(foreachStatement.VariableType);\n\t\t\t\tStoreResult(foreachStatement.VariableType, new TypeResolveResult(elementType));\n\t\t\t\tv = MakeVariable(elementType, foreachStatement.VariableNameToken);\n\t\t\t} else {\n\t\t\t\tIType variableType = ResolveType(foreachStatement.VariableType);\n\t\t\t\tv = MakeVariable(variableType, foreachStatement.VariableNameToken);\n\t\t\t}\n\t\t\tStoreCurrentState(foreachStatement.VariableNameToken);\n\t\t\tresolver = resolver.AddVariable(v);\n\t\t\t\n\t\t\tStoreResult(foreachStatement.VariableNameToken, new LocalResolveResult(v));\n\t\t\t\n\t\t\tScan(foreachStatement.EmbeddedStatement);\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn new ForEachResolveResult(getEnumeratorInvocation, collectionType, enumeratorType, elementType,\n\t\t\t                                v, currentProperty, moveNextMethod, voidResult.Type);\n\t\t}\n\t\t\n\t\tvoid CheckForEnumerableInterface(ResolveResult expression, out IType collectionType, out IType enumeratorType, out IType elementType, out ResolveResult getEnumeratorInvocation)\n\t\t{\n\t\t\tvar compilation = resolver.Compilation;\n\t\t\tbool? isGeneric;\n\t\t\telementType = GetElementTypeFromIEnumerable(expression.Type, compilation, false, out isGeneric);\n\t\t\tif (isGeneric == true) {\n\t\t\t\tITypeDefinition enumerableOfT = compilation.FindType(KnownTypeCode.IEnumerableOfT).GetDefinition();\n\t\t\t\tif (enumerableOfT != null)\n\t\t\t\t\tcollectionType = new ParameterizedType(enumerableOfT, new [] { elementType });\n\t\t\t\telse\n\t\t\t\t\tcollectionType = SpecialType.UnknownType;\n\t\t\t\t\n\t\t\t\tITypeDefinition enumeratorOfT = compilation.FindType(KnownTypeCode.IEnumeratorOfT).GetDefinition();\n\t\t\t\tif (enumeratorOfT != null)\n\t\t\t\t\tenumeratorType = new ParameterizedType(enumeratorOfT, new [] { elementType });\n\t\t\t\telse\n\t\t\t\t\tenumeratorType = SpecialType.UnknownType;\n\t\t\t} else if (isGeneric == false) {\n\t\t\t\tcollectionType = compilation.FindType(KnownTypeCode.IEnumerable);\n\t\t\t\tenumeratorType = compilation.FindType(KnownTypeCode.IEnumerator);\n\t\t\t} else {\n\t\t\t\tcollectionType = SpecialType.UnknownType;\n\t\t\t\tenumeratorType = SpecialType.UnknownType;\n\t\t\t}\n\t\t\tgetEnumeratorInvocation = resolver.ResolveCast(collectionType, expression);\n\t\t\tgetEnumeratorInvocation = resolver.ResolveMemberAccess(getEnumeratorInvocation, \"GetEnumerator\", EmptyList<IType>.Instance, NameLookupMode.InvocationTarget);\n\t\t\tgetEnumeratorInvocation = resolver.ResolveInvocation(getEnumeratorInvocation, new ResolveResult[0]);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Local Variable Scopes (Block Statements)\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitBlockStatement(BlockStatement blockStatement)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tScanChildren(blockStatement);\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUsingStatement(UsingStatement usingStatement)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tif (resolverEnabled) {\n\t\t\t\tfor (AstNode child = usingStatement.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\t\tif (child.Role == UsingStatement.ResourceAcquisitionRole && child is Expression) {\n\t\t\t\t\t\tResolveAndProcessConversion((Expression)child, resolver.Compilation.FindType(KnownTypeCode.IDisposable));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tScan(child);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tScanChildren(usingStatement);\n\t\t\t}\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn resolverEnabled ? voidResult : null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitFixedStatement(FixedStatement fixedStatement)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tIType type = ResolveType(fixedStatement.Type);\n\t\t\tforeach (VariableInitializer vi in fixedStatement.Variables) {\n\t\t\t\tresolver = resolver.AddVariable(MakeVariable(type, vi.NameToken));\n\t\t\t\tScan(vi);\n\t\t\t}\n\t\t\tScan(fixedStatement.EmbeddedStatement);\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitSwitchStatement(SwitchStatement switchStatement)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tScanChildren(switchStatement);\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitCatchClause(CatchClause catchClause)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tif (string.IsNullOrEmpty(catchClause.VariableName)) {\n\t\t\t\tScan(catchClause.Type);\n\t\t\t} else {\n\t\t\t\t//DomRegion region = MakeRegion(catchClause.VariableNameToken);\n\t\t\t\tStoreCurrentState(catchClause.VariableNameToken);\n\t\t\t\tIVariable v = MakeVariable(ResolveType(catchClause.Type), catchClause.VariableNameToken);\n\t\t\t\tresolver = resolver.AddVariable(v);\n\t\t\t\tStoreResult(catchClause.VariableNameToken, new LocalResolveResult(v));\n\t\t\t}\n\t\t\tScan(catchClause.Body);\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn voidResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region VariableDeclarationStatement\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\tbool isConst = (variableDeclarationStatement.Modifiers & Modifiers.Const) != 0;\n\t\t\tif (!isConst && variableDeclarationStatement.Type.IsVar() && variableDeclarationStatement.Variables.Count == 1) {\n\t\t\t\tVariableInitializer vi = variableDeclarationStatement.Variables.Single();\n\t\t\t\tStoreCurrentState(variableDeclarationStatement.Type);\n\t\t\t\tIType type = Resolve(vi.Initializer).Type;\n\t\t\t\tStoreResult(variableDeclarationStatement.Type, new TypeResolveResult(type));\n\t\t\t\tIVariable v = MakeVariable(type, vi.NameToken);\n\t\t\t\tresolver = resolver.AddVariable(v);\n\t\t\t\tScan(vi);\n\t\t\t} else {\n\t\t\t\tIType type = ResolveType(variableDeclarationStatement.Type);\n\n\t\t\t\tforeach (VariableInitializer vi in variableDeclarationStatement.Variables) {\n\t\t\t\t\tIVariable v;\n\t\t\t\t\tif (isConst) {\n\t\t\t\t\t\tResolveResult rr = Resolve(vi.Initializer);\n\t\t\t\t\t\trr = resolver.ResolveCast(type, rr);\n\t\t\t\t\t\tv = MakeConstant(type, vi.NameToken, rr.ConstantValue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tv = MakeVariable(type, vi.NameToken);\n\t\t\t\t\t}\n\t\t\t\t\tresolver = resolver.AddVariable(v);\n\t\t\t\t\tScan(vi);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn voidResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Condition Statements\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitForStatement(ForStatement forStatement)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tvar result = HandleConditionStatement(forStatement);\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t{\n\t\t\treturn HandleConditionStatement(ifElseStatement);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitWhileStatement(WhileStatement whileStatement)\n\t\t{\n\t\t\treturn HandleConditionStatement(whileStatement);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitDoWhileStatement(DoWhileStatement doWhileStatement)\n\t\t{\n\t\t\treturn HandleConditionStatement(doWhileStatement);\n\t\t}\n\t\t\n\t\tResolveResult HandleConditionStatement(Statement conditionStatement)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tfor (AstNode child = conditionStatement.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\t\tif (child.Role == Roles.Condition) {\n\t\t\t\t\t\tExpression condition = (Expression)child;\n\t\t\t\t\t\tResolveResult conditionRR = Resolve(condition);\n\t\t\t\t\t\tResolveResult convertedRR = resolver.ResolveCondition(conditionRR);\n\t\t\t\t\t\tif (convertedRR != conditionRR)\n\t\t\t\t\t\t\tProcessConversionResult(condition, convertedRR as ConversionResolveResult);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tScan(child);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn voidResult;\n\t\t\t} else {\n\t\t\t\tScanChildren(conditionStatement);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Return Statements\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitReturnStatement(ReturnStatement returnStatement)\n\t\t{\n\t\t\tif (resolverEnabled && !resolver.IsWithinLambdaExpression && resolver.CurrentMember != null) {\n\t\t\t\tIType type = resolver.CurrentMember.ReturnType;\n\t\t\t\tif (TaskType.IsTask(type)) {\n\t\t\t\t\tvar methodDecl = returnStatement.Ancestors.OfType<EntityDeclaration>().FirstOrDefault();\n\t\t\t\t\tif (methodDecl != null && (methodDecl.Modifiers & Modifiers.Async) == Modifiers.Async)\n\t\t\t\t\t\ttype = UnpackTask(type);\n\t\t\t\t}\n\t\t\t\tResolveAndProcessConversion(returnStatement.Expression, type);\n\t\t\t} else {\n\t\t\t\tScan(returnStatement.Expression);\n\t\t\t}\n\t\t\treturn resolverEnabled ? voidResult : null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitYieldReturnStatement(YieldReturnStatement yieldStatement)\n\t\t{\n\t\t\tif (resolverEnabled && resolver.CurrentMember != null) {\n\t\t\t\tIType returnType = resolver.CurrentMember.ReturnType;\n\t\t\t\tbool? isGeneric;\n\t\t\t\tIType elementType = GetElementTypeFromIEnumerable(returnType, resolver.Compilation, true, out isGeneric);\n\t\t\t\tResolveAndProcessConversion(yieldStatement.Expression, elementType);\n\t\t\t} else {\n\t\t\t\tScan(yieldStatement.Expression);\n\t\t\t}\n\t\t\treturn resolverEnabled ? voidResult : null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Other statements\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitExpressionStatement(ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tScanChildren(expressionStatement);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitLockStatement(LockStatement lockStatement)\n\t\t{\n\t\t\tScanChildren(lockStatement);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitEmptyStatement(EmptyStatement emptyStatement)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitBreakStatement(BreakStatement breakStatement)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitContinueStatement(ContinueStatement continueStatement)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitThrowStatement(ThrowStatement throwStatement)\n\t\t{\n\t\t\tif (resolverEnabled) {\n\t\t\t\tResolveAndProcessConversion(throwStatement.Expression, resolver.Compilation.FindType(KnownTypeCode.Exception));\n\t\t\t\treturn voidResult;\n\t\t\t} else {\n\t\t\t\tScan(throwStatement.Expression);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitTryCatchStatement(TryCatchStatement tryCatchStatement)\n\t\t{\n\t\t\tScanChildren(tryCatchStatement);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement)\n\t\t{\n\t\t\tScanChildren(gotoCaseStatement);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitGotoStatement(GotoStatement gotoStatement)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitLabelStatement(LabelStatement labelStatement)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUnsafeStatement(UnsafeStatement unsafeStatement)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tScanChildren(unsafeStatement);\n\t\t\tresolver = resolver.PopBlock();\n\t\t\treturn voidResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Local Variable Type Inference\n\t\tIVariable MakeVariable(IType type, Identifier variableName)\n\t\t{\n\t\t\treturn new SimpleVariable(MakeRegion(variableName), type, variableName.Name);\n\t\t}\n\t\t\n\t\tIVariable MakeConstant(IType type, Identifier variableName, object constantValue)\n\t\t{\n\t\t\treturn new SimpleConstant(MakeRegion(variableName), type, variableName.Name, constantValue);\n\t\t}\n\t\t\n\t\tclass SimpleVariable : IVariable\n\t\t{\n\t\t\treadonly DomRegion region;\n\t\t\treadonly IType type;\n\t\t\treadonly string name;\n\t\t\t\n\t\t\tpublic SimpleVariable(DomRegion region, IType type, string name)\n\t\t\t{\n\t\t\t\tDebug.Assert(type != null);\n\t\t\t\tDebug.Assert(name != null);\n\t\t\t\tthis.region = region;\n\t\t\t\tthis.type = type;\n\t\t\t\tthis.name = name;\n\t\t\t}\n\t\t\t\n\t\t\tpublic SymbolKind SymbolKind {\n\t\t\t\tget { return SymbolKind.Variable; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic string Name {\n\t\t\t\tget { return name; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic DomRegion Region {\n\t\t\t\tget { return region; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IType Type {\n\t\t\t\tget { return type; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual bool IsConst {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual object ConstantValue {\n\t\t\t\tget { return null; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn type.ToString() + \" \" + name + \";\";\n\t\t\t}\n\n\t\t\tpublic ISymbolReference ToReference()\n\t\t\t{\n\t\t\t\treturn new VariableReference(type.ToTypeReference(), name, region, IsConst, ConstantValue);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class SimpleConstant : SimpleVariable\n\t\t{\n\t\t\treadonly object constantValue;\n\t\t\t\n\t\t\tpublic SimpleConstant(DomRegion region, IType type, string name, object constantValue)\n\t\t\t\t: base(region, type, name)\n\t\t\t{\n\t\t\t\tthis.constantValue = constantValue;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsConst {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object ConstantValue {\n\t\t\t\tget { return constantValue; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn Type.ToString() + \" \" + Name + \" = \" + new PrimitiveExpression(constantValue).ToString() + \";\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IType GetElementTypeFromIEnumerable(IType collectionType, ICompilation compilation, bool allowIEnumerator, out bool? isGeneric)\n\t\t{\n\t\t\tbool foundNonGenericIEnumerable = false;\n\t\t\tforeach (IType baseType in collectionType.GetAllBaseTypes()) {\n\t\t\t\tITypeDefinition baseTypeDef = baseType.GetDefinition();\n\t\t\t\tif (baseTypeDef != null) {\n\t\t\t\t\tKnownTypeCode typeCode = baseTypeDef.KnownTypeCode;\n\t\t\t\t\tif (typeCode == KnownTypeCode.IEnumerableOfT || (allowIEnumerator && typeCode == KnownTypeCode.IEnumeratorOfT)) {\n\t\t\t\t\t\tParameterizedType pt = baseType as ParameterizedType;\n\t\t\t\t\t\tif (pt != null) {\n\t\t\t\t\t\t\tisGeneric = true;\n\t\t\t\t\t\t\treturn pt.GetTypeArgument(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (typeCode == KnownTypeCode.IEnumerable || (allowIEnumerator && typeCode == KnownTypeCode.IEnumerator))\n\t\t\t\t\t\tfoundNonGenericIEnumerable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.Collections.IEnumerable found in type hierarchy -> Object is element type.\n\t\t\tif (foundNonGenericIEnumerable) {\n\t\t\t\tisGeneric = false;\n\t\t\t\treturn compilation.FindType(KnownTypeCode.Object);\n\t\t\t}\n\t\t\tisGeneric = null;\n\t\t\treturn SpecialType.UnknownType;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Attributes\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitAttribute(Attribute attribute)\n\t\t{\n\t\t\tvar type = ResolveType(attribute.Type);\n\t\t\t\n\t\t\t// Separate arguments into ctor arguments and non-ctor arguments:\n\t\t\tvar constructorArguments = attribute.Arguments.Where(a => !(a is NamedExpression));\n\t\t\tvar nonConstructorArguments = attribute.Arguments.OfType<NamedExpression>();\n\t\t\t\n\t\t\t// Scan the non-constructor arguments\n\t\t\tresolver = resolver.PushObjectInitializer(new InitializedObjectResolveResult(type));\n\t\t\tList<ResolveResult> initializerStatements = new List<ResolveResult>();\n\t\t\tforeach (var arg in nonConstructorArguments)\n\t\t\t\tHandleNamedExpression(arg, initializerStatements);\n\t\t\tresolver = resolver.PopObjectInitializer();\n\t\t\t\n\t\t\t// Resolve the ctor arguments and find the matching ctor overload\n\t\t\tstring[] argumentNames;\n\t\t\tResolveResult[] arguments = GetArguments(constructorArguments, out argumentNames);\n\t\t\tResolveResult rr = resolver.ResolveObjectCreation(type, arguments, argumentNames, false, initializerStatements);\n\t\t\tProcessInvocationResult(null, constructorArguments, rr);\n\t\t\treturn rr;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitAttributeSection(AttributeSection attributeSection)\n\t\t{\n\t\t\tScanChildren(attributeSection);\n\t\t\treturn voidResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Using Declaration\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\tScanChildren(usingDeclaration);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitUsingAliasDeclaration(UsingAliasDeclaration usingDeclaration)\n\t\t{\n\t\t\tScanChildren(usingDeclaration);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\treturn voidResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type References\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitPrimitiveType(PrimitiveType primitiveType)\n\t\t{\n\t\t\tif (!resolverEnabled)\n\t\t\t\treturn null;\n\t\t\tKnownTypeCode typeCode = primitiveType.KnownTypeCode;\n\t\t\tif (typeCode == KnownTypeCode.None && primitiveType.Parent is Constraint && primitiveType.Role == Roles.BaseType) {\n\t\t\t\tswitch (primitiveType.Keyword) {\n\t\t\t\t\tcase \"class\":\n\t\t\t\t\tcase \"struct\":\n\t\t\t\t\tcase \"new\":\n\t\t\t\t\t\treturn voidResult;\n\t\t\t\t}\n\t\t\t}\n\t\t\tIType type = resolver.Compilation.FindType(typeCode);\n\t\t\treturn new TypeResolveResult(type);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitSimpleType(SimpleType simpleType)\n\t\t{\n\t\t\tif (!resolverEnabled) {\n\t\t\t\tScanChildren(simpleType);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\t// Figure out the correct lookup mode:\n\t\t\tNameLookupMode lookupMode = simpleType.GetNameLookupMode();\n\t\t\t\n\t\t\tvar typeArguments = ResolveTypeArguments(simpleType.TypeArguments);\n\t\t\tIdentifier identifier = simpleType.IdentifierToken;\n\t\t\tif (string.IsNullOrEmpty(identifier.Name))\n\t\t\t\treturn new TypeResolveResult(SpecialType.UnboundTypeArgument);\n\t\t\tResolveResult rr = resolver.LookupSimpleNameOrTypeName(identifier.Name, typeArguments, lookupMode);\n\t\t\tif (simpleType.Parent is Attribute && !identifier.IsVerbatim) {\n\t\t\t\tvar withSuffix = resolver.LookupSimpleNameOrTypeName(identifier.Name + \"Attribute\", typeArguments, lookupMode);\n\t\t\t\tif (AttributeTypeReference.PreferAttributeTypeWithSuffix(rr.Type, withSuffix.Type, resolver.Compilation))\n\t\t\t\t\treturn withSuffix;\n\t\t\t}\n\t\t\treturn rr;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitMemberType(MemberType memberType)\n\t\t{\n\t\t\tResolveResult target;\n\t\t\tNameLookupMode lookupMode = memberType.GetNameLookupMode();\n\t\t\tif (memberType.IsDoubleColon && memberType.Target is SimpleType) {\n\t\t\t\tSimpleType t = (SimpleType)memberType.Target;\n\t\t\t\tStoreCurrentState(t);\n\t\t\t\ttarget = resolver.ResolveAlias(t.Identifier);\n\t\t\t\tStoreResult(t, target);\n\t\t\t} else {\n\t\t\t\tif (!resolverEnabled) {\n\t\t\t\t\tScanChildren(memberType);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\ttarget = Resolve(memberType.Target);\n\t\t\t}\n\t\t\tvar typeArguments = ResolveTypeArguments(memberType.TypeArguments);\n\t\t\tIdentifier identifier = memberType.MemberNameToken;\n\t\t\tResolveResult rr = resolver.ResolveMemberAccess(target, identifier.Name, typeArguments, lookupMode);\n\t\t\tif (memberType.Parent is Attribute && !identifier.IsVerbatim) {\n\t\t\t\tvar withSuffix = resolver.ResolveMemberAccess(target, identifier.Name + \"Attribute\", typeArguments, lookupMode);\n\t\t\t\tif (AttributeTypeReference.PreferAttributeTypeWithSuffix(rr.Type, withSuffix.Type, resolver.Compilation))\n\t\t\t\t\treturn withSuffix;\n\t\t\t}\n\t\t\treturn rr;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitComposedType(ComposedType composedType)\n\t\t{\n\t\t\tif (!resolverEnabled) {\n\t\t\t\tScanChildren(composedType);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tIType t = ResolveType(composedType.BaseType);\n\t\t\tif (composedType.HasNullableSpecifier) {\n\t\t\t\tt = NullableType.Create(resolver.Compilation, t);\n\t\t\t}\n\t\t\tfor (int i = 0; i < composedType.PointerRank; i++) {\n\t\t\t\tt = new PointerType(t);\n\t\t\t}\n\t\t\tforeach (var a in composedType.ArraySpecifiers.Reverse()) {\n\t\t\t\tt = new ArrayType(resolver.Compilation, t, a.Dimensions);\n\t\t\t}\n\t\t\treturn new TypeResolveResult(t);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Query Expressions\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryExpression(QueryExpression queryExpression)\n\t\t{\n\t\t\tresolver = resolver.PushBlock();\n\t\t\tvar oldQueryResult = currentQueryResult;\n\t\t\tvar oldCancellationToken = cancellationToken;\n\t\t\ttry {\n\t\t\t\t// Because currentQueryResult isn't part of the stored state,\n\t\t\t\t// query expressions must be resolved in a single operation.\n\t\t\t\t// This means we can't allow cancellation within the query expression.\n\t\t\t\tcancellationToken = CancellationToken.None;\n\t\t\t\tcurrentQueryResult = null;\n\t\t\t\tforeach (var clause in queryExpression.Clauses) {\n\t\t\t\t\tcurrentQueryResult = Resolve(clause);\n\t\t\t\t}\n\t\t\t\treturn WrapResult(currentQueryResult);\n\t\t\t} finally {\n\t\t\t\tcurrentQueryResult = oldQueryResult;\n\t\t\t\tcancellationToken = oldCancellationToken;\n\t\t\t\tresolver = resolver.PopBlock();\n\t\t\t}\n\t\t}\n\t\t\n\t\tIType GetTypeForQueryVariable(IType type)\n\t\t{\n\t\t\tbool? isGeneric;\n\t\t\t// This assumes queries are only used on IEnumerable.\n\t\t\tvar result = GetElementTypeFromIEnumerable(type, resolver.Compilation, false, out isGeneric);\n\n\t\t\t// If that fails try to resolve the Select method and resolve the projection.\n\t\t\tif (result.Kind == TypeKind.Unknown) {\n\t\t\t\tvar selectAccess = resolver.ResolveMemberAccess(new ResolveResult (type), \"Select\", EmptyList<IType>.Instance);\n\t\t\t\tResolveResult[] arguments = {\n\t\t\t\t\tnew QueryExpressionLambda(1, voidResult) \n\t\t\t\t};\n\t\t\t\t \n\t\t\t\tvar rr = resolver.ResolveInvocation(selectAccess, arguments) as CSharpInvocationResolveResult; \n\t\t\t\tif (rr != null && rr.Arguments.Count == 2) {\n\t\t\t\t\tvar invokeMethod = rr.Arguments[1].Type.GetDelegateInvokeMethod();\n\t\t\t\t\tif (invokeMethod != null && invokeMethod.Parameters.Count > 0)\n\t\t\t\t\t\treturn invokeMethod.Parameters[0].Type;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tResolveResult MakeTransparentIdentifierResolveResult()\n\t\t{\n\t\t\treturn new ResolveResult(new AnonymousType(resolver.Compilation, EmptyList<IUnresolvedProperty>.Instance));\n\t\t}\n\t\t\n\t\tsealed class QueryExpressionLambdaConversion : Conversion\n\t\t{\n\t\t\tinternal readonly IType[] ParameterTypes;\n\t\t\t\n\t\t\tpublic QueryExpressionLambdaConversion(IType[] parameterTypes)\n\t\t\t{\n\t\t\t\tthis.ParameterTypes = parameterTypes;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicit {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAnonymousFunctionConversion {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class QueryExpressionLambda : LambdaResolveResult\n\t\t{\n\t\t\treadonly IParameter[] parameters;\n\t\t\treadonly ResolveResult bodyExpression;\n\t\t\t\n\t\t\tinternal IType[] inferredParameterTypes;\n\t\t\t\n\t\t\tpublic QueryExpressionLambda(int parameterCount, ResolveResult bodyExpression)\n\t\t\t{\n\t\t\t\tthis.parameters = new IParameter[parameterCount];\n\t\t\t\tfor (int i = 0; i < parameterCount; i++) {\n\t\t\t\t\tparameters[i] = new DefaultParameter(SpecialType.UnknownType, \"x\" + i);\n\t\t\t\t}\n\t\t\t\tthis.bodyExpression = bodyExpression;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IList<IParameter> Parameters {\n\t\t\t\tget { return parameters; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Conversion IsValid(IType[] parameterTypes, IType returnType, CSharpConversions conversions)\n\t\t\t{\n\t\t\t\tif (parameterTypes.Length == parameters.Length) {\n\t\t\t\t\tthis.inferredParameterTypes = parameterTypes;\n\t\t\t\t\treturn new QueryExpressionLambdaConversion(parameterTypes);\n\t\t\t\t} else {\n\t\t\t\t\treturn Conversion.None;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAsync {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicitlyTyped {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAnonymousMethod {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasParameterList {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ResolveResult Body {\n\t\t\t\tget { return bodyExpression; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType GetInferredReturnType(IType[] parameterTypes)\n\t\t\t{\n\t\t\t\treturn bodyExpression.Type;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType ReturnType {\n\t\t\t\tget {\n\t\t\t\t\treturn bodyExpression.Type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn string.Format(\"[QueryExpressionLambda ({0}) => {1}]\", string.Join(\",\", parameters.Select(p => p.Name)), bodyExpression);\n\t\t\t}\n\t\t}\n\t\t\n\t\tQueryClause GetPreviousQueryClause(QueryClause clause)\n\t\t{\n\t\t\tfor (AstNode node = clause.PrevSibling; node != null; node = node.PrevSibling) {\n\t\t\t\tif (node.Role == QueryExpression.ClauseRole)\n\t\t\t\t\treturn (QueryClause)node;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tQueryClause GetNextQueryClause(QueryClause clause)\n\t\t{\n\t\t\tfor (AstNode node = clause.NextSibling; node != null; node = node.NextSibling) {\n\t\t\t\tif (node.Role == QueryExpression.ClauseRole)\n\t\t\t\t\treturn (QueryClause)node;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryFromClause(QueryFromClause queryFromClause)\n\t\t{\n\t\t\tResolveResult result = errorResult;\n\t\t\tResolveResult expr = Resolve(queryFromClause.Expression);\n\t\t\tIVariable v;\n\t\t\tif (queryFromClause.Type.IsNull) {\n\t\t\t\tv = MakeVariable(GetTypeForQueryVariable(expr.Type), queryFromClause.IdentifierToken);\n\t\t\t\tresult = expr;\n\t\t\t} else {\n\t\t\t\tv = MakeVariable(ResolveType(queryFromClause.Type), queryFromClause.IdentifierToken);\n\t\t\t\t\n\t\t\t\t// resolve the .Cast<>() call\n\t\t\t\tResolveResult methodGroup = resolver.ResolveMemberAccess(expr, \"Cast\", new[] { v.Type }, NameLookupMode.InvocationTarget);\n\t\t\t\tresult = resolver.ResolveInvocation(methodGroup, new ResolveResult[0]);\n\t\t\t}\n\t\t\t\n\t\t\tStoreCurrentState(queryFromClause.IdentifierToken);\n\t\t\tresolver = resolver.AddVariable(v);\n\t\t\tStoreResult(queryFromClause.IdentifierToken, new LocalResolveResult(v));\n\t\t\t\n\t\t\tif (currentQueryResult != null) {\n\t\t\t\t// this is a second 'from': resolve the .SelectMany() call\n\t\t\t\tQuerySelectClause selectClause = GetNextQueryClause(queryFromClause) as QuerySelectClause;\n\t\t\t\tResolveResult selectResult;\n\t\t\t\tif (selectClause != null) {\n\t\t\t\t\t// from ... from ... select - the SelectMany call also performs the Select operation\n\t\t\t\t\tselectResult = Resolve(selectClause.Expression);\n\t\t\t\t} else {\n\t\t\t\t\t// from .. from ... ... - introduce a transparent identifier\n\t\t\t\t\tselectResult = MakeTransparentIdentifierResolveResult();\n\t\t\t\t}\n\t\t\t\tResolveResult methodGroup = resolver.ResolveMemberAccess(currentQueryResult, \"SelectMany\", EmptyList<IType>.Instance, NameLookupMode.InvocationTarget);\n\t\t\t\tResolveResult[] arguments = {\n\t\t\t\t\tnew QueryExpressionLambda(1, result),\n\t\t\t\t\tnew QueryExpressionLambda(2, selectResult)\n\t\t\t\t};\n\t\t\t\tresult = resolver.ResolveInvocation(methodGroup, arguments);\n\t\t\t}\n\t\t\tif (result == expr)\n\t\t\t\treturn WrapResult(result);\n\t\t\telse\n\t\t\t\treturn result;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Wraps the result in an identity conversion.\n\t\t/// This is necessary so that '$from x in variable$ select x*2' does not resolve\n\t\t/// to the LocalResolveResult for the variable, which would confuse find references.\n\t\t/// </summary>\n\t\tResolveResult WrapResult(ResolveResult result)\n\t\t{\n\t\t\treturn new CastResolveResult(result.Type, result, Conversion.IdentityConversion, resolver.CheckForOverflow);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause)\n\t\t{\n\t\t\tResolveResult rr = Resolve(queryContinuationClause.PrecedingQuery);\n\t\t\tIType variableType = GetTypeForQueryVariable(rr.Type);\n\t\t\tStoreCurrentState(queryContinuationClause.IdentifierToken);\n\t\t\tIVariable v = MakeVariable(variableType, queryContinuationClause.IdentifierToken);\n\t\t\tresolver = resolver.AddVariable(v);\n\t\t\tStoreResult(queryContinuationClause.IdentifierToken, new LocalResolveResult(v));\n\t\t\treturn WrapResult(rr);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryLetClause(QueryLetClause queryLetClause)\n\t\t{\n\t\t\tResolveResult expr = Resolve(queryLetClause.Expression);\n\t\t\tStoreCurrentState(queryLetClause.IdentifierToken);\n\t\t\tIVariable v = MakeVariable(expr.Type, queryLetClause.IdentifierToken);\n\t\t\tresolver = resolver.AddVariable(v);\n\t\t\tStoreResult(queryLetClause.IdentifierToken, new LocalResolveResult(v));\n\t\t\tif (currentQueryResult != null) {\n\t\t\t\t// resolve the .Select() call\n\t\t\t\tResolveResult methodGroup = resolver.ResolveMemberAccess(currentQueryResult, \"Select\", EmptyList<IType>.Instance, NameLookupMode.InvocationTarget);\n\t\t\t\tResolveResult[] arguments = { new QueryExpressionLambda(1, MakeTransparentIdentifierResolveResult()) };\n\t\t\t\treturn resolver.ResolveInvocation(methodGroup, arguments);\n\t\t\t} else {\n\t\t\t\treturn errorResult;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryJoinClause(QueryJoinClause queryJoinClause)\n\t\t{\n\t\t\t// join v in expr on onExpr equals equalsExpr [into g]\n\t\t\tResolveResult inResult = null;\n\t\t\tResolveResult expr = Resolve(queryJoinClause.InExpression);\n\t\t\tIType variableType;\n\t\t\tif (queryJoinClause.Type.IsNull) {\n\t\t\t\tvariableType = GetTypeForQueryVariable(expr.Type);\n\t\t\t\tinResult = expr;\n\t\t\t} else {\n\t\t\t\tvariableType = ResolveType(queryJoinClause.Type);\n\t\t\t\t\n\t\t\t\t// resolve the .Cast<>() call\n\t\t\t\tResolveResult methodGroup = resolver.ResolveMemberAccess(expr, \"Cast\", new[] { variableType }, NameLookupMode.InvocationTarget);\n\t\t\t\tinResult = resolver.ResolveInvocation(methodGroup, new ResolveResult[0]);\n\t\t\t}\n\t\t\t\n\t\t\t// resolve the 'On' expression in a context that contains only the previously existing range variables:\n\t\t\t// (before adding any variable)\n\t\t\tResolveResult onResult = Resolve(queryJoinClause.OnExpression);\n\t\t\t\n\t\t\t// scan the 'Equals' expression in a context that contains only the variable 'v'\n\t\t\tCSharpResolver resolverOutsideQuery = resolver;\n\t\t\tresolverOutsideQuery = resolverOutsideQuery.PopBlock(); // pop all variables from the current query expression\n\t\t\tIVariable v = MakeVariable(variableType, queryJoinClause.JoinIdentifierToken);\n\t\t\tresolverOutsideQuery = resolverOutsideQuery.AddVariable(v);\n\t\t\tResolveResult equalsResult = errorResult;\n\t\t\tResetContext(resolverOutsideQuery, delegate {\n\t\t\t             \tequalsResult = Resolve(queryJoinClause.EqualsExpression);\n\t\t\t             });\n\t\t\tStoreCurrentState(queryJoinClause.JoinIdentifierToken);\n\t\t\tStoreResult(queryJoinClause.JoinIdentifierToken, new LocalResolveResult(v));\n\t\t\t\n\t\t\tif (queryJoinClause.IsGroupJoin) {\n\t\t\t\treturn ResolveGroupJoin(queryJoinClause, inResult, onResult, equalsResult);\n\t\t\t} else {\n\t\t\t\tresolver = resolver.AddVariable(v);\n\t\t\t\tif (currentQueryResult != null) {\n\t\t\t\t\tQuerySelectClause selectClause = GetNextQueryClause(queryJoinClause) as QuerySelectClause;\n\t\t\t\t\tResolveResult selectResult;\n\t\t\t\t\tif (selectClause != null) {\n\t\t\t\t\t\t// from ... join ... select - the Join call also performs the Select operation\n\t\t\t\t\t\tselectResult = Resolve(selectClause.Expression);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// from .. join ... ... - introduce a transparent identifier\n\t\t\t\t\t\tselectResult = MakeTransparentIdentifierResolveResult();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar methodGroup = resolver.ResolveMemberAccess(currentQueryResult, \"Join\", EmptyList<IType>.Instance);\n\t\t\t\t\tResolveResult[] arguments = {\n\t\t\t\t\t\tinResult,\n\t\t\t\t\t\tnew QueryExpressionLambda(1, onResult),\n\t\t\t\t\t\tnew QueryExpressionLambda(1, equalsResult),\n\t\t\t\t\t\tnew QueryExpressionLambda(2, selectResult)\n\t\t\t\t\t};\n\t\t\t\t\treturn resolver.ResolveInvocation(methodGroup, arguments);\n\t\t\t\t} else {\n\t\t\t\t\treturn errorResult;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult ResolveGroupJoin(QueryJoinClause queryJoinClause,\n\t\t                               ResolveResult inResult, ResolveResult onResult, ResolveResult equalsResult)\n\t\t{\n\t\t\tDebug.Assert(queryJoinClause.IsGroupJoin);\n\t\t\t\n\t\t\tDomRegion intoIdentifierRegion = MakeRegion(queryJoinClause.IntoIdentifierToken);\n\t\t\t\n\t\t\t// We need to declare the group variable, but it's a bit tricky to determine its type:\n\t\t\t// We'll have to resolve the GroupJoin invocation and take a look at the inferred types\n\t\t\t// for the lambda given as last parameter.\n\t\t\tvar methodGroup = resolver.ResolveMemberAccess(currentQueryResult, \"GroupJoin\", EmptyList<IType>.Instance);\n\t\t\tQuerySelectClause selectClause = GetNextQueryClause(queryJoinClause) as QuerySelectClause;\n\t\t\tLambdaResolveResult groupJoinLambda;\n\t\t\tif (selectClause != null) {\n\t\t\t\t// from ... join ... into g select - the GroupJoin call also performs the Select operation\n\t\t\t\tIParameter[] selectLambdaParameters = {\n\t\t\t\t\tnew DefaultParameter(SpecialType.UnknownType, \"<>transparentIdentifier\"),\n\t\t\t\t\tnew DefaultParameter(SpecialType.UnknownType, queryJoinClause.IntoIdentifier, region: intoIdentifierRegion)\n\t\t\t\t};\n\t\t\t\tgroupJoinLambda = new ImplicitlyTypedLambda(selectClause, selectLambdaParameters, this);\n\t\t\t} else {\n\t\t\t\t// from .. join ... ... - introduce a transparent identifier\n\t\t\t\tgroupJoinLambda = new QueryExpressionLambda(2, MakeTransparentIdentifierResolveResult());\n\t\t\t}\n\t\t\t\n\t\t\tResolveResult[] arguments = {\n\t\t\t\tinResult,\n\t\t\t\tnew QueryExpressionLambda(1, onResult),\n\t\t\t\tnew QueryExpressionLambda(1, equalsResult),\n\t\t\t\tgroupJoinLambda\n\t\t\t};\n\t\t\tResolveResult rr = resolver.ResolveInvocation(methodGroup, arguments);\n\t\t\tInvocationResolveResult invocationRR = rr as InvocationResolveResult;\n\t\t\t\n\t\t\tIVariable groupVariable;\n\t\t\tif (groupJoinLambda is ImplicitlyTypedLambda) {\n\t\t\t\tvar implicitlyTypedLambda = (ImplicitlyTypedLambda)groupJoinLambda;\n\t\t\t\t\n\t\t\t\tif (invocationRR != null && invocationRR.Arguments.Count > 0) {\n\t\t\t\t\tConversionResolveResult crr = invocationRR.Arguments[invocationRR.Arguments.Count - 1] as ConversionResolveResult;\n\t\t\t\t\tif (crr != null)\n\t\t\t\t\t\tProcessConversion(null, crr.Input, crr.Conversion, crr.Type);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\timplicitlyTypedLambda.EnforceMerge(this);\n\t\t\t\tif (implicitlyTypedLambda.Parameters.Count == 2) {\n\t\t\t\t\tStoreCurrentState(queryJoinClause.IntoIdentifierToken);\n\t\t\t\t\tgroupVariable = implicitlyTypedLambda.Parameters[1];\n\t\t\t\t} else {\n\t\t\t\t\tgroupVariable = null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tDebug.Assert(groupJoinLambda is QueryExpressionLambda);\n\t\t\t\t\n\t\t\t\t// Add the variable if the query expression continues after the group join\n\t\t\t\t// (there's no need to do this if there's only a select clause remaining, as\n\t\t\t\t// we already handled that in the ImplicitlyTypedLambda).\n\t\t\t\t\n\t\t\t\t// Get the inferred type of the group variable:\n\t\t\t\tIType[] inferredParameterTypes = null;\n\t\t\t\tif (invocationRR != null && invocationRR.Arguments.Count > 0) {\n\t\t\t\t\tConversionResolveResult crr = invocationRR.Arguments[invocationRR.Arguments.Count - 1] as ConversionResolveResult;\n\t\t\t\t\tif (crr != null && crr.Conversion is QueryExpressionLambdaConversion) {\n\t\t\t\t\t\tinferredParameterTypes = ((QueryExpressionLambdaConversion)crr.Conversion).ParameterTypes;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (inferredParameterTypes == null)\n\t\t\t\t\tinferredParameterTypes = ((QueryExpressionLambda)groupJoinLambda).inferredParameterTypes;\n\t\t\t\t\n\t\t\t\tIType groupParameterType;\n\t\t\t\tif (inferredParameterTypes != null && inferredParameterTypes.Length == 2)\n\t\t\t\t\tgroupParameterType = inferredParameterTypes[1];\n\t\t\t\telse\n\t\t\t\t\tgroupParameterType = SpecialType.UnknownType;\n\t\t\t\t\n\t\t\t\tStoreCurrentState(queryJoinClause.IntoIdentifierToken);\n\t\t\t\tgroupVariable = MakeVariable(groupParameterType, queryJoinClause.IntoIdentifierToken);\n\t\t\t\tresolver = resolver.AddVariable(groupVariable);\n\t\t\t}\n\t\t\t\n\t\t\tif (groupVariable != null) {\n\t\t\t\tStoreResult(queryJoinClause.IntoIdentifierToken, new LocalResolveResult(groupVariable));\n\t\t\t}\n\t\t\t\n\t\t\treturn rr;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryWhereClause(QueryWhereClause queryWhereClause)\n\t\t{\n\t\t\tResolveResult condition = Resolve(queryWhereClause.Condition);\n\t\t\tIType boolType = resolver.Compilation.FindType(KnownTypeCode.Boolean);\n\t\t\tConversion conversionToBool = resolver.conversions.ImplicitConversion(condition, boolType);\n\t\t\tProcessConversion(queryWhereClause.Condition, condition, conversionToBool, boolType);\n\t\t\tif (currentQueryResult != null) {\n\t\t\t\tif (conversionToBool != Conversion.IdentityConversion && conversionToBool != Conversion.None) {\n\t\t\t\t\tcondition = new ConversionResolveResult(boolType, condition, conversionToBool, resolver.CheckForOverflow);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar methodGroup = resolver.ResolveMemberAccess(currentQueryResult, \"Where\", EmptyList<IType>.Instance);\n\t\t\t\tResolveResult[] arguments = { new QueryExpressionLambda(1, condition) };\n\t\t\t\treturn resolver.ResolveInvocation(methodGroup, arguments);\n\t\t\t} else {\n\t\t\t\treturn errorResult;\n\t\t\t}\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQuerySelectClause(QuerySelectClause querySelectClause)\n\t\t{\n\t\t\tif (currentQueryResult == null) {\n\t\t\t\tScanChildren(querySelectClause);\n\t\t\t\treturn errorResult;\n\t\t\t}\n\t\t\tQueryClause previousQueryClause = GetPreviousQueryClause(querySelectClause);\n\t\t\t// If the 'select' follows on a 'SelectMany', 'Join' or 'GroupJoin' clause, then the 'select' portion\n\t\t\t// was already done as part of the previous clause.\n\t\t\tif (((previousQueryClause is QueryFromClause && GetPreviousQueryClause(previousQueryClause) != null))\n\t\t\t    || previousQueryClause is QueryJoinClause)\n\t\t\t{\n\t\t\t\t// GroupJoin already scans the following select clause in a different context,\n\t\t\t\t// so we must not scan it again.\n\t\t\t\tif (!(previousQueryClause is QueryJoinClause && ((QueryJoinClause)previousQueryClause).IsGroupJoin))\n\t\t\t\t\tScan(querySelectClause.Expression);\n\t\t\t\treturn WrapResult(currentQueryResult);\n\t\t\t}\n\t\t\t\n\t\t\tQueryExpression query = querySelectClause.Parent as QueryExpression;\n\t\t\tstring rangeVariable = GetSingleRangeVariable(query);\n\t\t\tif (rangeVariable != null) {\n\t\t\t\tIdentifierExpression ident = ParenthesizedExpression.UnpackParenthesizedExpression(querySelectClause.Expression) as IdentifierExpression;\n\t\t\t\tif (ident != null && ident.Identifier == rangeVariable && !ident.TypeArguments.Any()) {\n\t\t\t\t\t// selecting the single identifier that is the range variable\n\t\t\t\t\tif (query.Clauses.Count > 2) {\n\t\t\t\t\t\t// only if the query is not degenerate:\n\t\t\t\t\t\t// the Select call will be optimized away, so directly return the previous result\n\t\t\t\t\t\tScan(querySelectClause.Expression);\n\t\t\t\t\t\treturn WrapResult(currentQueryResult);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tResolveResult expr = Resolve(querySelectClause.Expression);\n\t\t\tvar methodGroup = resolver.ResolveMemberAccess(currentQueryResult, \"Select\", EmptyList<IType>.Instance);\n\t\t\tResolveResult[] arguments = { new QueryExpressionLambda(1, expr) };\n\t\t\treturn resolver.ResolveInvocation(methodGroup, arguments);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the name of the range variable in the specified query.\n\t\t/// If the query has multiple range variables, this method returns null.\n\t\t/// </summary>\n\t\tstring GetSingleRangeVariable(QueryExpression query)\n\t\t{\n\t\t\tif (query == null)\n\t\t\t\treturn null;\n\t\t\tforeach (QueryClause clause in query.Clauses.Skip(1)) {\n\t\t\t\tif (clause is QueryFromClause || clause is QueryJoinClause || clause is QueryLetClause) {\n\t\t\t\t\t// query has more than 1 range variable\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tQueryFromClause fromClause = query.Clauses.FirstOrDefault() as QueryFromClause;\n\t\t\tif (fromClause != null)\n\t\t\t\treturn fromClause.Identifier;\n\t\t\tQueryContinuationClause continuationClause = query.Clauses.FirstOrDefault() as QueryContinuationClause;\n\t\t\tif (continuationClause != null)\n\t\t\t\treturn continuationClause.Identifier;\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryGroupClause(QueryGroupClause queryGroupClause)\n\t\t{\n\t\t\tif (currentQueryResult == null) {\n\t\t\t\tScanChildren(queryGroupClause);\n\t\t\t\treturn errorResult;\n\t\t\t}\n\t\t\t\n\t\t\t// ... group projection by key\n\t\t\tResolveResult projection = Resolve(queryGroupClause.Projection);\n\t\t\tResolveResult key = Resolve(queryGroupClause.Key);\n\t\t\t\n\t\t\tvar methodGroup = resolver.ResolveMemberAccess(currentQueryResult, \"GroupBy\", EmptyList<IType>.Instance);\n\t\t\tResolveResult[] arguments = {\n\t\t\t\tnew QueryExpressionLambda(1, key),\n\t\t\t\tnew QueryExpressionLambda(1, projection)\n\t\t\t};\n\t\t\treturn resolver.ResolveInvocation(methodGroup, arguments);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryOrderClause(QueryOrderClause queryOrderClause)\n\t\t{\n\t\t\tforeach (QueryOrdering ordering in queryOrderClause.Orderings) {\n\t\t\t\tcurrentQueryResult = Resolve(ordering);\n\t\t\t}\n\t\t\treturn WrapResult(currentQueryResult);\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitQueryOrdering(QueryOrdering queryOrdering)\n\t\t{\n\t\t\tif (currentQueryResult == null) {\n\t\t\t\tScanChildren(queryOrdering);\n\t\t\t\treturn errorResult;\n\t\t\t}\n\t\t\t// ... orderby sortKey [descending]\n\t\t\tResolveResult sortKey = Resolve(queryOrdering.Expression);\n\t\t\t\n\t\t\tQueryOrderClause parentClause = queryOrdering.Parent as QueryOrderClause;\n\t\t\tbool isFirst = (parentClause == null || parentClause.Orderings.FirstOrDefault() == queryOrdering);\n\t\t\tstring methodName = isFirst ? \"OrderBy\" : \"ThenBy\";\n\t\t\tif (queryOrdering.Direction == QueryOrderingDirection.Descending)\n\t\t\t\tmethodName += \"Descending\";\n\t\t\t\n\t\t\tvar methodGroup = resolver.ResolveMemberAccess(currentQueryResult, methodName, EmptyList<IType>.Instance);\n\t\t\tResolveResult[] arguments = {\n\t\t\t\tnew QueryExpressionLambda(1, sortKey),\n\t\t\t};\n\t\t\treturn resolver.ResolveInvocation(methodGroup, arguments);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Constructor Initializer\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitConstructorInitializer(ConstructorInitializer constructorInitializer)\n\t\t{\n\t\t\tResolveResult target;\n\t\t\tif (constructorInitializer.ConstructorInitializerType == ConstructorInitializerType.Base) {\n\t\t\t\ttarget = resolver.ResolveBaseReference();\n\t\t\t} else {\n\t\t\t\ttarget = resolver.ResolveThisReference();\n\t\t\t}\n\t\t\tstring[] argumentNames;\n\t\t\tResolveResult[] arguments = GetArguments(constructorInitializer.Arguments, out argumentNames);\n\t\t\tResolveResult rr = resolver.ResolveObjectCreation(target.Type, arguments, argumentNames, allowProtectedAccess: true);\n\t\t\tProcessInvocationResult(null, constructorInitializer.Arguments, rr);\n\t\t\treturn rr;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Other Nodes\n\t\t// Token nodes\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitIdentifier(Identifier identifier)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitComment (Comment comment)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitNewLine (NewLineNode comment)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitWhitespace(WhitespaceNode whitespaceNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitText(TextNode textNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitArraySpecifier(ArraySpecifier arraySpecifier)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitNullNode(AstNode nullNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitErrorNode(AstNode errorNode)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitPatternPlaceholder(AstNode placeholder, ICSharpCode.NRefactory.PatternMatching.Pattern pattern)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Nodes where we just need to visit the children:\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitAccessor(Accessor accessor)\n\t\t{\n\t\t\tScanChildren(accessor);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitSwitchSection(SwitchSection switchSection)\n\t\t{\n\t\t\tScanChildren(switchSection);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitCaseLabel(CaseLabel caseLabel)\n\t\t{\n\t\t\tScanChildren(caseLabel);\n\t\t\treturn voidResult;\n\t\t}\n\t\t\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitConstraint(Constraint constraint)\n\t\t{\n\t\t\tScanChildren(constraint);\n\t\t\treturn voidResult;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Documentation Reference\n\t\tResolveResult IAstVisitor<ResolveResult>.VisitDocumentationReference(DocumentationReference documentationReference)\n\t\t{\n\t\t\t// Resolve child nodes:\n\t\t\tITypeDefinition declaringTypeDef;\n\t\t\tif (documentationReference.DeclaringType.IsNull)\n\t\t\t\tdeclaringTypeDef = resolver.CurrentTypeDefinition;\n\t\t\telse\n\t\t\t\tdeclaringTypeDef = ResolveType(documentationReference.DeclaringType).GetDefinition();\n\t\t\tIType[] typeArguments = documentationReference.TypeArguments.Select(ResolveType).ToArray();\n\t\t\tIType conversionOperatorReturnType = ResolveType(documentationReference.ConversionOperatorReturnType);\n\t\t\tIParameter[] parameters = documentationReference.Parameters.Select(ResolveXmlDocParameter).ToArray();\n\t\t\t\n\t\t\tif (documentationReference.SymbolKind == SymbolKind.TypeDefinition) {\n\t\t\t\tif (declaringTypeDef != null)\n\t\t\t\t\treturn new TypeResolveResult(declaringTypeDef);\n\t\t\t\telse\n\t\t\t\t\treturn errorResult;\n\t\t\t}\n\t\t\t\n\t\t\tif (documentationReference.SymbolKind == SymbolKind.None) {\n\t\t\t\t// might be a type, member or ctor\n\t\t\t\tstring memberName = documentationReference.MemberName;\n\t\t\t\tResolveResult rr;\n\t\t\t\tif (documentationReference.DeclaringType.IsNull) {\n\t\t\t\t\trr = resolver.LookupSimpleNameOrTypeName(memberName, typeArguments, NameLookupMode.Expression);\n\t\t\t\t} else {\n\t\t\t\t\tvar target = Resolve(documentationReference.DeclaringType);\n\t\t\t\t\trr = resolver.ResolveMemberAccess(target, memberName, typeArguments);\n\t\t\t\t}\n\t\t\t\t// reduce to definition:\n\t\t\t\tif (rr.IsError) {\n\t\t\t\t\treturn rr;\n\t\t\t\t} else if (rr is TypeResolveResult) {\n\t\t\t\t\tvar typeDef = rr.Type.GetDefinition();\n\t\t\t\t\tif (typeDef == null)\n\t\t\t\t\t\treturn errorResult;\n\t\t\t\t\tif (documentationReference.HasParameterList) {\n\t\t\t\t\t\tvar ctors = typeDef.GetConstructors(options: GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions);\n\t\t\t\t\t\treturn FindByParameters(ctors, parameters);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new TypeResolveResult(typeDef);\n\t\t\t\t\t}\n\t\t\t\t} else if (rr is MemberResolveResult) {\n\t\t\t\t\tvar mrr = (MemberResolveResult)rr;\n\t\t\t\t\treturn new MemberResolveResult(null, mrr.Member.MemberDefinition);\n\t\t\t\t} else if (rr is MethodGroupResolveResult) {\n\t\t\t\t\tvar mgrr = (MethodGroupResolveResult)rr;\n\t\t\t\t\tvar methods = mgrr.MethodsGroupedByDeclaringType.Reverse()\n\t\t\t\t\t\t.SelectMany(ml => ml.Select(m => (IParameterizedMember)m.MemberDefinition));\n\t\t\t\t\treturn FindByParameters(methods, parameters);\n\t\t\t\t}\n\t\t\t\treturn rr;\n\t\t\t}\n\t\t\t\n\t\t\t// Indexer or operator\n\t\t\tif (declaringTypeDef == null)\n\t\t\t\treturn errorResult;\n\t\t\tif (documentationReference.SymbolKind == SymbolKind.Indexer) {\n\t\t\t\tvar indexers = declaringTypeDef.Properties.Where(p => p.IsIndexer && !p.IsExplicitInterfaceImplementation);\n\t\t\t\treturn FindByParameters(indexers, parameters);\n\t\t\t} else if (documentationReference.SymbolKind == SymbolKind.Operator) {\n\t\t\t\tvar opType = documentationReference.OperatorType;\n\t\t\t\tstring memberName = OperatorDeclaration.GetName(opType);\n\t\t\t\tvar methods = declaringTypeDef.Methods.Where(m => m.IsOperator && m.Name == memberName);\n\t\t\t\tif (opType == OperatorType.Implicit || opType == OperatorType.Explicit) {\n\t\t\t\t\t// conversion operator\n\t\t\t\t\tforeach (var method in methods) {\n\t\t\t\t\t\tif (ParameterListComparer.Instance.Equals(method.Parameters, parameters)) {\n\t\t\t\t\t\t\tif (method.ReturnType.Equals(conversionOperatorReturnType))\n\t\t\t\t\t\t\t\treturn new MemberResolveResult(null, method);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn new MemberResolveResult(null, methods.FirstOrDefault());\n\t\t\t\t} else {\n\t\t\t\t\t// not a conversion operator\n\t\t\t\t\treturn FindByParameters(methods, parameters);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new NotSupportedException(); // unknown entity type\n\t\t\t}\n\t\t}\n\t\t\n\t\tIParameter ResolveXmlDocParameter(ParameterDeclaration p)\n\t\t{\n\t\t\tvar lrr = Resolve(p) as LocalResolveResult;\n\t\t\tif (lrr != null && lrr.IsParameter)\n\t\t\t\treturn (IParameter)lrr.Variable;\n\t\t\telse\n\t\t\t\treturn new DefaultParameter(SpecialType.UnknownType, string.Empty);\n\t\t}\n\t\t\n\t\tResolveResult FindByParameters(IEnumerable<IParameterizedMember> methods, IList<IParameter> parameters)\n\t\t{\n\t\t\tforeach (var method in methods) {\n\t\t\t\tif (ParameterListComparer.Instance.Equals(method.Parameters, parameters))\n\t\t\t\t\treturn new MemberResolveResult(null, method);\n\t\t\t}\n\t\t\treturn new MemberResolveResult(null, methods.FirstOrDefault());\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/TypeInference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\tpublic enum TypeInferenceAlgorithm\n\t{\n\t\t/// <summary>\n\t\t/// C# 4.0 type inference.\n\t\t/// </summary>\n\t\tCSharp4,\n\t\t/// <summary>\n\t\t/// Improved algorithm (not part of any specification) using FindTypeInBounds for fixing.\n\t\t/// </summary>\n\t\tImproved,\n\t\t/// <summary>\n\t\t/// Improved algorithm (not part of any specification) using FindTypeInBounds for fixing;\n\t\t/// uses <see cref=\"IntersectionType\"/> to report all results (in case of ambiguities).\n\t\t/// </summary>\n\t\tImprovedReturnAllResults\n\t}\n\t\n\t/// <summary>\n\t/// Implements C# 4.0 Type Inference (§7.5.2).\n\t/// </summary>\n\tpublic sealed class TypeInference\n\t{\n\t\treadonly ICompilation compilation;\n\t\treadonly CSharpConversions conversions;\n\t\tTypeInferenceAlgorithm algorithm = TypeInferenceAlgorithm.CSharp4;\n\t\t\n\t\t// determines the maximum generic nesting level; necessary to avoid infinite recursion in 'Improved' mode.\n\t\tconst int maxNestingLevel = 5;\n\t\tint nestingLevel;\n\t\t\n\t\t#region Constructor\n\t\tpublic TypeInference(ICompilation compilation)\n\t\t{\n\t\t\tif (compilation == null)\n\t\t\t\tthrow new ArgumentNullException(\"compilation\");\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.conversions = CSharpConversions.Get(compilation);\n\t\t}\n\t\t\n\t\tinternal TypeInference(ICompilation compilation, CSharpConversions conversions)\n\t\t{\n\t\t\tDebug.Assert(compilation != null);\n\t\t\tDebug.Assert(conversions != null);\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.conversions = conversions;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Properties\n\t\t/// <summary>\n\t\t/// Gets/Sets the type inference algorithm used.\n\t\t/// </summary>\n\t\tpublic TypeInferenceAlgorithm Algorithm {\n\t\t\tget { return algorithm; }\n\t\t\tset { algorithm = value; }\n\t\t}\n\t\t\n\t\tTypeInference CreateNestedInstance()\n\t\t{\n\t\t\tTypeInference c = new TypeInference(compilation, conversions);\n\t\t\tc.algorithm = algorithm;\n\t\t\tc.nestingLevel = nestingLevel + 1;\n\t\t\treturn c;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tTP[] typeParameters;\n\t\tIType[] parameterTypes;\n\t\tResolveResult[] arguments;\n\t\tbool[,] dependencyMatrix;\n\t\tIList<IType> classTypeArguments;\n\t\t\n\t\t#region InferTypeArguments (main function)\n\t\t/// <summary>\n\t\t/// Performs type inference.\n\t\t/// </summary>\n\t\t/// <param name=\"typeParameters\">The method type parameters that should be inferred.</param>\n\t\t/// <param name=\"arguments\">The arguments passed to the method.</param>\n\t\t/// <param name=\"parameterTypes\">The parameter types of the method.</param>\n\t\t/// <param name=\"success\">Out: whether type inference was successful</param>\n\t\t/// <param name=\"classTypeArguments\">\n\t\t/// Class type arguments. These are substituted for class type parameters in the formal parameter types\n\t\t/// when inferring a method group or lambda.\n\t\t/// </param>\n\t\t/// <returns>The inferred type arguments.</returns>\n\t\tpublic IType[] InferTypeArguments(IList<ITypeParameter> typeParameters, IList<ResolveResult> arguments, IList<IType> parameterTypes, out bool success, IList<IType> classTypeArguments = null)\n\t\t{\n\t\t\tif (typeParameters == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeParameters\");\n\t\t\tif (arguments == null)\n\t\t\t\tthrow new ArgumentNullException(\"arguments\");\n\t\t\tif (parameterTypes == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameterTypes\");\n\t\t\ttry {\n\t\t\t\tthis.typeParameters = new TP[typeParameters.Count];\n\t\t\t\tfor (int i = 0; i < this.typeParameters.Length; i++) {\n\t\t\t\t\tif (i != typeParameters[i].Index)\n\t\t\t\t\t\tthrow new ArgumentException(\"Type parameter has wrong index\");\n\t\t\t\t\tif (typeParameters[i].OwnerType != SymbolKind.Method)\n\t\t\t\t\t\tthrow new ArgumentException(\"Type parameter must be owned by a method\");\n\t\t\t\t\tthis.typeParameters[i] = new TP(typeParameters[i]);\n\t\t\t\t}\n\t\t\t\tthis.parameterTypes = new IType[Math.Min(arguments.Count, parameterTypes.Count)];\n\t\t\t\tthis.arguments = new ResolveResult[this.parameterTypes.Length];\n\t\t\t\tfor (int i = 0; i < this.parameterTypes.Length; i++) {\n\t\t\t\t\tif (arguments[i] == null || parameterTypes[i] == null)\n\t\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\t\tthis.arguments[i] = arguments[i];\n\t\t\t\t\tthis.parameterTypes[i] = parameterTypes[i];\n\t\t\t\t}\n\t\t\t\tthis.classTypeArguments = classTypeArguments;\n\t\t\t\tLog.WriteLine(\"Type Inference\");\n\t\t\t\tLog.WriteLine(\"  Signature: M<\" + string.Join<TP>(\", \", this.typeParameters) + \">\"\n\t\t\t\t              + \"(\" + string.Join<IType>(\", \", this.parameterTypes) + \")\");\n\t\t\t\tLog.WriteCollection(\"  Arguments: \", arguments);\n\t\t\t\tLog.Indent();\n\t\t\t\t\n\t\t\t\tPhaseOne();\n\t\t\t\tsuccess = PhaseTwo();\n\t\t\t\t\n\t\t\t\tLog.Unindent();\n\t\t\t\tLog.WriteLine(\"  Type inference finished \" + (success ? \"successfully\" : \"with errors\") + \": \" +\n\t\t\t\t              \"M<\" + string.Join(\", \", this.typeParameters.Select(tp => tp.FixedTo ?? SpecialType.UnknownType)) + \">\");\n\t\t\t\treturn this.typeParameters.Select(tp => tp.FixedTo ?? SpecialType.UnknownType).ToArray();\n\t\t\t} finally {\n\t\t\t\tReset();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid Reset()\n\t\t{\n\t\t\t// clean up so that memory used by the operation can be garbage collected as soon as possible\n\t\t\tthis.typeParameters = null;\n\t\t\tthis.parameterTypes = null;\n\t\t\tthis.arguments = null;\n\t\t\tthis.dependencyMatrix = null;\n\t\t\tthis.classTypeArguments = null;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Infers type arguments for the <paramref name=\"typeParameters\"/> occurring in the <paramref name=\"targetType\"/>\n\t\t/// so that the resulting type (after substition) satisfies the given bounds.\n\t\t/// </summary>\n\t\tpublic IType[] InferTypeArgumentsFromBounds(IList<ITypeParameter> typeParameters, IType targetType, IList<IType> lowerBounds, IList<IType> upperBounds, out bool success)\n\t\t{\n\t\t\tif (typeParameters == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeParameters\");\n\t\t\tif (targetType == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetType\");\n\t\t\tif (lowerBounds == null)\n\t\t\t\tthrow new ArgumentNullException(\"lowerBounds\");\n\t\t\tif (upperBounds == null)\n\t\t\t\tthrow new ArgumentNullException(\"upperBounds\");\n\t\t\tthis.typeParameters = new TP[typeParameters.Count];\n\t\t\tfor (int i = 0; i < this.typeParameters.Length; i++) {\n\t\t\t\tif (i != typeParameters[i].Index)\n\t\t\t\t\tthrow new ArgumentException(\"Type parameter has wrong index\");\n\t\t\t\tthis.typeParameters[i] = new TP(typeParameters[i]);\n\t\t\t}\n\t\t\tforeach (IType b in lowerBounds) {\n\t\t\t\tMakeLowerBoundInference(b, targetType);\n\t\t\t}\n\t\t\tforeach (IType b in upperBounds) {\n\t\t\t\tMakeUpperBoundInference(b, targetType);\n\t\t\t}\n\t\t\tIType[] result = new IType[this.typeParameters.Length];\n\t\t\tsuccess = true;\n\t\t\tfor (int i = 0; i < result.Length; i++) {\n\t\t\t\tsuccess &= Fix(this.typeParameters[i]);\n\t\t\t\tresult[i] = this.typeParameters[i].FixedTo ?? SpecialType.UnknownType;\n\t\t\t}\n\t\t\tReset();\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\t\t\n\t\tsealed class TP\n\t\t{\n\t\t\tpublic readonly HashSet<IType> LowerBounds = new HashSet<IType>();\n\t\t\tpublic readonly HashSet<IType> UpperBounds = new HashSet<IType>();\n\t\t\tpublic IType ExactBound;\n\t\t\tpublic bool MultipleDifferentExactBounds;\n\t\t\tpublic readonly ITypeParameter TypeParameter;\n\t\t\tpublic IType FixedTo;\n\t\t\t\n\t\t\tpublic bool IsFixed {\n\t\t\t\tget { return FixedTo != null; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool HasBounds {\n\t\t\t\tget { return LowerBounds.Count > 0 || UpperBounds.Count > 0 || ExactBound != null; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic TP(ITypeParameter typeParameter)\n\t\t\t{\n\t\t\t\tif (typeParameter == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"typeParameter\");\n\t\t\t\tthis.TypeParameter = typeParameter;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void AddExactBound(IType type)\n\t\t\t{\n\t\t\t\t// Exact bounds need to stored separately, not just as Lower+Upper bounds,\n\t\t\t\t// due to TypeInferenceTests.GenericArgumentImplicitlyConvertibleToAndFromAnotherTypeList (see #281)\n\t\t\t\tif (ExactBound == null)\n\t\t\t\t\tExactBound = type;\n\t\t\t\telse if (!ExactBound.Equals(type))\n\t\t\t\t\tMultipleDifferentExactBounds = true;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn TypeParameter.Name;\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class OccursInVisitor : TypeVisitor\n\t\t{\n\t\t\treadonly TP[] tp;\n\t\t\tpublic readonly bool[] Occurs;\n\t\t\t\n\t\t\tpublic OccursInVisitor(TypeInference typeInference)\n\t\t\t{\n\t\t\t\tthis.tp = typeInference.typeParameters;\n\t\t\t\tthis.Occurs = new bool[tp.Length];\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType VisitTypeParameter(ITypeParameter type)\n\t\t\t{\n\t\t\t\tint index = type.Index;\n\t\t\t\tif (index < tp.Length && tp[index].TypeParameter == type)\n\t\t\t\t\tOccurs[index] = true;\n\t\t\t\treturn base.VisitTypeParameter(type);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#region Inference Phases\n\t\tvoid PhaseOne()\n\t\t{\n\t\t\t// C# 4.0 spec: §7.5.2.1 The first phase\n\t\t\tLog.WriteLine(\"Phase One\");\n\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\tResolveResult Ei = arguments[i];\n\t\t\t\tIType Ti = parameterTypes[i];\n\t\t\t\t\n\t\t\t\tLambdaResolveResult lrr = Ei as LambdaResolveResult;\n\t\t\t\tif (lrr != null) {\n\t\t\t\t\tMakeExplicitParameterTypeInference(lrr, Ti);\n\t\t\t\t}\n\t\t\t\tif (lrr != null || Ei is MethodGroupResolveResult) {\n\t\t\t\t\t// this is not in the spec???\n\t\t\t\t\tif (OutputTypeContainsUnfixed(Ei, Ti) && !InputTypesContainsUnfixed(Ei, Ti)) {\n\t\t\t\t\t\tMakeOutputTypeInference(Ei, Ti);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (IsValidType(Ei.Type)) {\n\t\t\t\t\tif (Ti is ByReferenceType) {\n\t\t\t\t\t\tMakeExactInference(Ei.Type, Ti);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tMakeLowerBoundInference(Ei.Type, Ti);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool IsValidType(IType type)\n\t\t{\n\t\t\treturn type.Kind != TypeKind.Unknown && type.Kind != TypeKind.Null;\n\t\t}\n\t\t\n\t\tbool PhaseTwo()\n\t\t{\n\t\t\t// C# 4.0 spec: §7.5.2.2 The second phase\n\t\t\tLog.WriteLine(\"Phase Two\");\n\t\t\t// All unfixed type variables Xi which do not depend on any Xj are fixed.\n\t\t\tList<TP> typeParametersToFix = new List<TP>();\n\t\t\tforeach (TP Xi in typeParameters) {\n\t\t\t\tif (Xi.IsFixed == false) {\n\t\t\t\t\tif (!typeParameters.Any((TP Xj) => !Xj.IsFixed && DependsOn(Xi, Xj))) {\n\t\t\t\t\t\ttypeParametersToFix.Add(Xi);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If no such type variables exist, all unfixed type variables Xi are fixed for which all of the following hold:\n\t\t\tif (typeParametersToFix.Count == 0) {\n\t\t\t\tLog.WriteLine(\"Type parameters cannot be fixed due to dependency cycles\");\n\t\t\t\tLog.WriteLine(\"Trying to break the cycle by fixing any TPs that have non-empty bounds...\");\n\t\t\t\tforeach (TP Xi in typeParameters) {\n\t\t\t\t\t// Xi has a non­empty set of bounds\n\t\t\t\t\tif (!Xi.IsFixed && Xi.HasBounds) {\n\t\t\t\t\t\t// There is at least one type variable Xj that depends on Xi\n\t\t\t\t\t\tif (typeParameters.Any((TP Xj) => DependsOn(Xj, Xi))) {\n\t\t\t\t\t\t\ttypeParametersToFix.Add(Xi);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// now fix 'em\n\t\t\tbool errorDuringFix = false;\n\t\t\tforeach (TP tp in typeParametersToFix) {\n\t\t\t\tif (!Fix(tp))\n\t\t\t\t\terrorDuringFix = true;\n\t\t\t}\n\t\t\tif (errorDuringFix)\n\t\t\t\treturn false;\n\t\t\tbool unfixedTypeVariablesExist = typeParameters.Any((TP X) => X.IsFixed == false);\n\t\t\tif (typeParametersToFix.Count == 0 && unfixedTypeVariablesExist) {\n\t\t\t\t// If no such type variables exist and there are still unfixed type variables, type inference fails.\n\t\t\t\tLog.WriteLine(\"Type inference fails: there are still unfixed TPs remaining\");\n\t\t\t\treturn false;\n\t\t\t} else if (!unfixedTypeVariablesExist) {\n\t\t\t\t// Otherwise, if no further unfixed type variables exist, type inference succeeds.\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// Otherwise, for all arguments ei with corresponding parameter type Ti\n\t\t\t\tfor (int i = 0; i < arguments.Length; i++) {\n\t\t\t\t\tResolveResult Ei = arguments[i];\n\t\t\t\t\tIType Ti = parameterTypes[i];\n\t\t\t\t\t// where the output types (§7.4.2.4) contain unfixed type variables Xj\n\t\t\t\t\t// but the input types (§7.4.2.3) do not\n\t\t\t\t\tif (OutputTypeContainsUnfixed(Ei, Ti) && !InputTypesContainsUnfixed(Ei, Ti)) {\n\t\t\t\t\t\t// an output type inference (§7.4.2.6) is made for ei with type Ti.\n\t\t\t\t\t\tLog.WriteLine(\"MakeOutputTypeInference for argument #\" + i);\n\t\t\t\t\t\tMakeOutputTypeInference(Ei, Ti);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Then the second phase is repeated.\n\t\t\t\treturn PhaseTwo();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Input Types / Output Types (§7.5.2.3 + §7.5.2.4)\n\t\tstatic readonly IType[] emptyTypeArray = new IType[0];\n\t\t\n\t\tIType[] InputTypes(ResolveResult e, IType t)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.5.2.3 Input types\n\t\t\tLambdaResolveResult lrr = e as LambdaResolveResult;\n\t\t\tif (lrr != null && lrr.IsImplicitlyTyped || e is MethodGroupResolveResult) {\n\t\t\t\tIMethod m = GetDelegateOrExpressionTreeSignature(t);\n\t\t\t\tif (m != null) {\n\t\t\t\t\tIType[] inputTypes = new IType[m.Parameters.Count];\n\t\t\t\t\tfor (int i = 0; i < inputTypes.Length; i++) {\n\t\t\t\t\t\tinputTypes[i] = m.Parameters[i].Type;\n\t\t\t\t\t}\n\t\t\t\t\treturn inputTypes;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn emptyTypeArray;\n\t\t}\n\t\t\n\t\tIType[] OutputTypes(ResolveResult e, IType t)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.5.2.4 Output types\n\t\t\tLambdaResolveResult lrr = e as LambdaResolveResult;\n\t\t\tif (lrr != null || e is MethodGroupResolveResult) {\n\t\t\t\tIMethod m = GetDelegateOrExpressionTreeSignature(t);\n\t\t\t\tif (m != null) {\n\t\t\t\t\treturn new[] { m.ReturnType };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn emptyTypeArray;\n\t\t}\n\t\t\n\t\tstatic IMethod GetDelegateOrExpressionTreeSignature(IType t)\n\t\t{\n\t\t\tParameterizedType pt = t as ParameterizedType;\n\t\t\tif (pt != null && pt.TypeParameterCount == 1 && pt.Name == \"Expression\"\n\t\t\t    && pt.Namespace == \"System.Linq.Expressions\")\n\t\t\t{\n\t\t\t\tt = pt.GetTypeArgument(0);\n\t\t\t}\n\t\t\treturn t.GetDelegateInvokeMethod();\n\t\t}\n\t\t\n\t\tbool InputTypesContainsUnfixed(ResolveResult argument, IType parameterType)\n\t\t{\n\t\t\treturn AnyTypeContainsUnfixedParameter(InputTypes(argument, parameterType));\n\t\t}\n\t\t\n\t\tbool OutputTypeContainsUnfixed(ResolveResult argument, IType parameterType)\n\t\t{\n\t\t\treturn AnyTypeContainsUnfixedParameter(OutputTypes(argument, parameterType));\n\t\t}\n\t\t\n\t\tbool AnyTypeContainsUnfixedParameter(IEnumerable<IType> types)\n\t\t{\n\t\t\tOccursInVisitor o = new OccursInVisitor(this);\n\t\t\tforeach (var type in types) {\n\t\t\t\ttype.AcceptVisitor(o);\n\t\t\t}\n\t\t\tfor (int i = 0; i < typeParameters.Length; i++) {\n\t\t\t\tif (!typeParameters[i].IsFixed && o.Occurs[i])\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region DependsOn (§7.5.2.5)\n\t\t// C# 4.0 spec: §7.5.2.5 Dependance\n\t\t\n\t\tvoid CalculateDependencyMatrix()\n\t\t{\n\t\t\tint n = typeParameters.Length;\n\t\t\tdependencyMatrix = new bool[n, n];\n\t\t\tfor (int k = 0; k < arguments.Length; k++) {\n\t\t\t\tOccursInVisitor input = new OccursInVisitor(this);\n\t\t\t\tOccursInVisitor output = new OccursInVisitor(this);\n\t\t\t\tforeach (var type in InputTypes(arguments[k], parameterTypes[k])) {\n\t\t\t\t\ttype.AcceptVisitor(input);\n\t\t\t\t}\n\t\t\t\tforeach (var type in OutputTypes(arguments[k], parameterTypes[k])) {\n\t\t\t\t\ttype.AcceptVisitor(output);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\t\tdependencyMatrix[i, j] |= input.Occurs[j] && output.Occurs[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// calculate transitive closure using Warshall's algorithm:\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (dependencyMatrix[i, j]) {\n\t\t\t\t\t\tfor (int k = 0; k < n; k++) {\n\t\t\t\t\t\t\tif (dependencyMatrix[j, k])\n\t\t\t\t\t\t\t\tdependencyMatrix[i, k] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool DependsOn(TP x, TP y)\n\t\t{\n\t\t\tif (dependencyMatrix == null)\n\t\t\t\tCalculateDependencyMatrix();\n\t\t\t// x depends on y\n\t\t\treturn dependencyMatrix[x.TypeParameter.Index, y.TypeParameter.Index];\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MakeOutputTypeInference (§7.5.2.6)\n\t\tvoid MakeOutputTypeInference(ResolveResult e, IType t)\n\t\t{\n\t\t\tLog.WriteLine(\" MakeOutputTypeInference from \" + e + \" to \" + t);\n\t\t\t// If E is an anonymous function with inferred return type  U (§7.5.2.12) and T is a delegate type or expression\n\t\t\t// tree type with return type Tb, then a lower-bound inference (§7.5.2.9) is made from U to Tb.\n\t\t\tLambdaResolveResult lrr = e as LambdaResolveResult;\n\t\t\tif (lrr != null) {\n\t\t\t\tIMethod m = GetDelegateOrExpressionTreeSignature(t);\n\t\t\t\tif (m != null) {\n\t\t\t\t\tIType inferredReturnType;\n\t\t\t\t\tif (lrr.IsImplicitlyTyped) {\n\t\t\t\t\t\tif (m.Parameters.Count != lrr.Parameters.Count)\n\t\t\t\t\t\t\treturn; // cannot infer due to mismatched parameter lists\n\t\t\t\t\t\tTypeParameterSubstitution substitution = GetSubstitutionForFixedTPs();\n\t\t\t\t\t\tIType[] inferredParameterTypes = new IType[m.Parameters.Count];\n\t\t\t\t\t\tfor (int i = 0; i < inferredParameterTypes.Length; i++) {\n\t\t\t\t\t\t\tIType parameterType = m.Parameters[i].Type;\n\t\t\t\t\t\t\tinferredParameterTypes[i] = parameterType.AcceptVisitor(substitution);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinferredReturnType = lrr.GetInferredReturnType(inferredParameterTypes);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinferredReturnType = lrr.GetInferredReturnType(null);\n\t\t\t\t\t}\n\t\t\t\t\tMakeLowerBoundInference(inferredReturnType, m.ReturnType);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise, if E is a method group and T is a delegate type or expression tree type\n\t\t\t// with parameter types T1…Tk and return type Tb, and overload resolution\n\t\t\t// of E with the types T1…Tk yields a single method with return type U, then a lower­-bound\n\t\t\t// inference is made from U to Tb.\n\t\t\tMethodGroupResolveResult mgrr = e as MethodGroupResolveResult;\n\t\t\tif (mgrr != null) {\n\t\t\t\tIMethod m = GetDelegateOrExpressionTreeSignature(t);\n\t\t\t\tif (m != null) {\n\t\t\t\t\tResolveResult[] args = new ResolveResult[m.Parameters.Count];\n\t\t\t\t\tTypeParameterSubstitution substitution = GetSubstitutionForFixedTPs();\n\t\t\t\t\tfor (int i = 0; i < args.Length; i++) {\n\t\t\t\t\t\tIParameter param = m.Parameters[i];\n\t\t\t\t\t\tIType parameterType = param.Type.AcceptVisitor(substitution);\n\t\t\t\t\t\tif ((param.IsRef || param.IsOut) && parameterType.Kind == TypeKind.ByReference) {\n\t\t\t\t\t\t\tparameterType = ((ByReferenceType)parameterType).ElementType;\n\t\t\t\t\t\t\targs[i] = new ByReferenceResolveResult(parameterType, param.IsOut);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\targs[i] = new ResolveResult(parameterType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar or = mgrr.PerformOverloadResolution(compilation,\n\t\t\t\t\t                                        args,\n\t\t\t\t\t                                        allowExpandingParams: false, allowOptionalParameters: false);\n\t\t\t\t\tif (or.FoundApplicableCandidate && or.BestCandidateAmbiguousWith == null) {\n\t\t\t\t\t\tIType returnType = or.GetBestCandidateWithSubstitutedTypeArguments().ReturnType;\n\t\t\t\t\t\tMakeLowerBoundInference(returnType, m.ReturnType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Otherwise, if E is an expression with type U, then a lower-bound inference is made from U to T.\n\t\t\tif (IsValidType(e.Type)) {\n\t\t\t\tMakeLowerBoundInference(e.Type, t);\n\t\t\t}\n\t\t}\n\t\t\n\t\tTypeParameterSubstitution GetSubstitutionForFixedTPs()\n\t\t{\n\t\t\tIType[] fixedTypes = new IType[typeParameters.Length];\n\t\t\tfor (int i = 0; i < fixedTypes.Length; i++) {\n\t\t\t\tfixedTypes[i] = typeParameters[i].FixedTo ?? SpecialType.UnknownType;\n\t\t\t}\n\t\t\treturn new TypeParameterSubstitution(classTypeArguments, fixedTypes);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MakeExplicitParameterTypeInference (§7.5.2.7)\n\t\tvoid MakeExplicitParameterTypeInference(LambdaResolveResult e, IType t)\n\t\t{\n\t\t\t// C# 4.0 spec: §7.5.2.7 Explicit parameter type inferences\n\t\t\tif (e.IsImplicitlyTyped || !e.HasParameterList)\n\t\t\t\treturn;\n\t\t\tLog.WriteLine(\" MakeExplicitParameterTypeInference from \" + e + \" to \" + t);\n\t\t\tIMethod m = GetDelegateOrExpressionTreeSignature(t);\n\t\t\tif (m == null)\n\t\t\t\treturn;\n\t\t\tfor (int i = 0; i < e.Parameters.Count && i < m.Parameters.Count; i++) {\n\t\t\t\tMakeExactInference(e.Parameters[i].Type, m.Parameters[i].Type);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MakeExactInference (§7.5.2.8)\n\t\t/// <summary>\n\t\t/// Make exact inference from U to V.\n\t\t/// C# 4.0 spec: §7.5.2.8 Exact inferences\n\t\t/// </summary>\n\t\tvoid MakeExactInference(IType U, IType V)\n\t\t{\n\t\t\tLog.WriteLine(\"MakeExactInference from \" + U + \" to \" + V);\n\t\t\t\n\t\t\t// If V is one of the unfixed Xi then U is added to the set of bounds for Xi.\n\t\t\tTP tp = GetTPForType(V);\n\t\t\tif (tp != null && tp.IsFixed == false) {\n\t\t\t\tLog.WriteLine(\" Add exact bound '\" + U + \"' to \" + tp);\n\t\t\t\ttp.AddExactBound(U);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle by reference types:\n\t\t\tByReferenceType brU = U as ByReferenceType;\n\t\t\tByReferenceType brV = V as ByReferenceType;\n\t\t\tif (brU != null && brV != null) {\n\t\t\t\tMakeExactInference(brU.ElementType, brV.ElementType);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle array types:\n\t\t\tArrayType arrU = U as ArrayType;\n\t\t\tArrayType arrV = V as ArrayType;\n\t\t\tif (arrU != null && arrV != null && arrU.Dimensions == arrV.Dimensions) {\n\t\t\t\tMakeExactInference(arrU.ElementType, arrV.ElementType);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle parameterized type:\n\t\t\tParameterizedType pU = U as ParameterizedType;\n\t\t\tParameterizedType pV = V as ParameterizedType;\n\t\t\tif (pU != null && pV != null\n\t\t\t    && object.Equals(pU.GetDefinition(), pV.GetDefinition())\n\t\t\t    && pU.TypeParameterCount == pV.TypeParameterCount)\n\t\t\t{\n\t\t\t\tLog.Indent();\n\t\t\t\tfor (int i = 0; i < pU.TypeParameterCount; i++) {\n\t\t\t\t\tMakeExactInference(pU.GetTypeArgument(i), pV.GetTypeArgument(i));\n\t\t\t\t}\n\t\t\t\tLog.Unindent();\n\t\t\t}\n\t\t}\n\t\t\n\t\tTP GetTPForType(IType v)\n\t\t{\n\t\t\tITypeParameter p = v as ITypeParameter;\n\t\t\tif (p != null) {\n\t\t\t\tint index = p.Index;\n\t\t\t\tif (index < typeParameters.Length && typeParameters[index].TypeParameter == p)\n\t\t\t\t\treturn typeParameters[index];\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MakeLowerBoundInference (§7.5.2.9)\n\t\t/// <summary>\n\t\t/// Make lower bound inference from U to V.\n\t\t/// C# 4.0 spec: §7.5.2.9 Lower-bound inferences\n\t\t/// </summary>\n\t\tvoid MakeLowerBoundInference(IType U, IType V)\n\t\t{\n\t\t\tLog.WriteLine(\" MakeLowerBoundInference from \" + U + \" to \" + V);\n\t\t\t\n\t\t\t// If V is one of the unfixed Xi then U is added to the set of bounds for Xi.\n\t\t\tTP tp = GetTPForType(V);\n\t\t\tif (tp != null && tp.IsFixed == false) {\n\t\t\t\tLog.WriteLine(\"  Add lower bound '\" + U + \"' to \" + tp);\n\t\t\t\ttp.LowerBounds.Add(U);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle nullable covariance:\n\t\t\tif (NullableType.IsNullable(U) && NullableType.IsNullable(V)) {\n\t\t\t\tMakeLowerBoundInference(NullableType.GetUnderlyingType(U), NullableType.GetUnderlyingType(V));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Handle array types:\n\t\t\tArrayType arrU = U as ArrayType;\n\t\t\tArrayType arrV = V as ArrayType;\n\t\t\tParameterizedType pV = V as ParameterizedType;\n\t\t\tif (arrU != null && arrV != null && arrU.Dimensions == arrV.Dimensions) {\n\t\t\t\tMakeLowerBoundInference(arrU.ElementType, arrV.ElementType);\n\t\t\t\treturn;\n\t\t\t} else if (arrU != null && IsGenericInterfaceImplementedByArray(pV) && arrU.Dimensions == 1) {\n\t\t\t\tMakeLowerBoundInference(arrU.ElementType, pV.GetTypeArgument(0));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle parameterized types:\n\t\t\tif (pV != null) {\n\t\t\t\tParameterizedType uniqueBaseType = null;\n\t\t\t\tforeach (IType baseU in U.GetAllBaseTypes()) {\n\t\t\t\t\tParameterizedType pU = baseU as ParameterizedType;\n\t\t\t\t\tif (pU != null && object.Equals(pU.GetDefinition(), pV.GetDefinition()) && pU.TypeParameterCount == pV.TypeParameterCount) {\n\t\t\t\t\t\tif (uniqueBaseType == null)\n\t\t\t\t\t\t\tuniqueBaseType = pU;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn; // cannot make an inference because it's not unique\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLog.Indent();\n\t\t\t\tif (uniqueBaseType != null) {\n\t\t\t\t\tfor (int i = 0; i < uniqueBaseType.TypeParameterCount; i++) {\n\t\t\t\t\t\tIType Ui = uniqueBaseType.GetTypeArgument(i);\n\t\t\t\t\t\tIType Vi = pV.GetTypeArgument(i);\n\t\t\t\t\t\tif (Ui.IsReferenceType == true) {\n\t\t\t\t\t\t\t// look for variance\n\t\t\t\t\t\t\tITypeParameter Xi = pV.GetDefinition().TypeParameters[i];\n\t\t\t\t\t\t\tswitch (Xi.Variance) {\n\t\t\t\t\t\t\t\tcase VarianceModifier.Covariant:\n\t\t\t\t\t\t\t\t\tMakeLowerBoundInference(Ui, Vi);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase VarianceModifier.Contravariant:\n\t\t\t\t\t\t\t\t\tMakeUpperBoundInference(Ui, Vi);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault: // invariant\n\t\t\t\t\t\t\t\t\tMakeExactInference(Ui, Vi);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// not known to be a reference type\n\t\t\t\t\t\t\tMakeExactInference(Ui, Vi);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLog.Unindent();\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool IsGenericInterfaceImplementedByArray(ParameterizedType rt)\n\t\t{\n\t\t\tif (rt == null || rt.TypeParameterCount != 1)\n\t\t\t\treturn false;\n\t\t\tswitch (rt.GetDefinition().KnownTypeCode) {\n\t\t\t\tcase KnownTypeCode.IEnumerableOfT:\n\t\t\t\tcase KnownTypeCode.ICollectionOfT:\n\t\t\t\tcase KnownTypeCode.IListOfT:\n\t\t\t\tcase KnownTypeCode.IReadOnlyCollectionOfT:\n\t\t\t\tcase KnownTypeCode.IReadOnlyListOfT:\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MakeUpperBoundInference (§7.5.2.10)\n\t\t/// <summary>\n\t\t/// Make upper bound inference from U to V.\n\t\t/// C# 4.0 spec: §7.5.2.10 Upper-bound inferences\n\t\t/// </summary>\n\t\tvoid MakeUpperBoundInference(IType U, IType V)\n\t\t{\n\t\t\tLog.WriteLine(\" MakeUpperBoundInference from \" + U + \" to \" + V);\n\t\t\t\n\t\t\t// If V is one of the unfixed Xi then U is added to the set of bounds for Xi.\n\t\t\tTP tp = GetTPForType(V);\n\t\t\tif (tp != null && tp.IsFixed == false) {\n\t\t\t\tLog.WriteLine(\"  Add upper bound '\" + U + \"' to \" + tp);\n\t\t\t\ttp.UpperBounds.Add(U);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Handle array types:\n\t\t\tArrayType arrU = U as ArrayType;\n\t\t\tArrayType arrV = V as ArrayType;\n\t\t\tParameterizedType pU = U as ParameterizedType;\n\t\t\tif (arrV != null && arrU != null && arrU.Dimensions == arrV.Dimensions) {\n\t\t\t\tMakeUpperBoundInference(arrU.ElementType, arrV.ElementType);\n\t\t\t\treturn;\n\t\t\t} else if (arrV != null && IsGenericInterfaceImplementedByArray(pU) && arrV.Dimensions == 1) {\n\t\t\t\tMakeUpperBoundInference(pU.GetTypeArgument(0), arrV.ElementType);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle parameterized types:\n\t\t\tif (pU != null) {\n\t\t\t\tParameterizedType uniqueBaseType = null;\n\t\t\t\tforeach (IType baseV in V.GetAllBaseTypes()) {\n\t\t\t\t\tParameterizedType pV = baseV as ParameterizedType;\n\t\t\t\t\tif (pV != null && object.Equals(pU.GetDefinition(), pV.GetDefinition()) && pU.TypeParameterCount == pV.TypeParameterCount) {\n\t\t\t\t\t\tif (uniqueBaseType == null)\n\t\t\t\t\t\t\tuniqueBaseType = pV;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn; // cannot make an inference because it's not unique\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLog.Indent();\n\t\t\t\tif (uniqueBaseType != null) {\n\t\t\t\t\tfor (int i = 0; i < uniqueBaseType.TypeParameterCount; i++) {\n\t\t\t\t\t\tIType Ui = pU.GetTypeArgument(i);\n\t\t\t\t\t\tIType Vi = uniqueBaseType.GetTypeArgument(i);\n\t\t\t\t\t\tif (Ui.IsReferenceType == true) {\n\t\t\t\t\t\t\t// look for variance\n\t\t\t\t\t\t\tITypeParameter Xi = pU.GetDefinition().TypeParameters[i];\n\t\t\t\t\t\t\tswitch (Xi.Variance) {\n\t\t\t\t\t\t\t\tcase VarianceModifier.Covariant:\n\t\t\t\t\t\t\t\t\tMakeUpperBoundInference(Ui, Vi);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase VarianceModifier.Contravariant:\n\t\t\t\t\t\t\t\t\tMakeLowerBoundInference(Ui, Vi);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault: // invariant\n\t\t\t\t\t\t\t\t\tMakeExactInference(Ui, Vi);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// not known to be a reference type\n\t\t\t\t\t\t\tMakeExactInference(Ui, Vi);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLog.Unindent();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Fixing (§7.5.2.11)\n\t\tbool Fix(TP tp)\n\t\t{\n\t\t\tLog.WriteLine(\" Trying to fix \" + tp);\n\t\t\tDebug.Assert(!tp.IsFixed);\n\t\t\tif (tp.ExactBound != null) {\n\t\t\t\t// the exact bound will always be the result\n\t\t\t\ttp.FixedTo = tp.ExactBound;\n\t\t\t\t// check validity\n\t\t\t\tif (tp.MultipleDifferentExactBounds)\n\t\t\t\t\treturn false;\n\t\t\t\treturn tp.LowerBounds.All(b => conversions.ImplicitConversion(b, tp.FixedTo).IsValid)\n\t\t\t\t\t&& tp.UpperBounds.All(b => conversions.ImplicitConversion(tp.FixedTo, b).IsValid);\n\t\t\t}\n\t\t\tLog.Indent();\n\t\t\tvar types = CreateNestedInstance().FindTypesInBounds(tp.LowerBounds.ToArray(), tp.UpperBounds.ToArray());\n\t\t\tLog.Unindent();\n\t\t\tif (algorithm == TypeInferenceAlgorithm.ImprovedReturnAllResults) {\n\t\t\t\ttp.FixedTo = IntersectionType.Create(types);\n\t\t\t\tLog.WriteLine(\"  T was fixed \" + (types.Count >= 1 ? \"successfully\" : \"(with errors)\") + \" to \" + tp.FixedTo);\n\t\t\t\treturn types.Count >= 1;\n\t\t\t} else {\n\t\t\t\ttp.FixedTo = GetFirstTypePreferNonInterfaces(types);\n\t\t\t\tLog.WriteLine(\"  T was fixed \" + (types.Count == 1 ? \"successfully\" : \"(with errors)\") + \" to \" + tp.FixedTo);\n\t\t\t\treturn types.Count == 1;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Finding the best common type of a set of expresssions\n\t\t/// <summary>\n\t\t/// Gets the best common type (C# 4.0 spec: §7.5.2.14) of a set of expressions.\n\t\t/// </summary>\n\t\tpublic IType GetBestCommonType(IList<ResolveResult> expressions, out bool success)\n\t\t{\n\t\t\tif (expressions == null)\n\t\t\t\tthrow new ArgumentNullException(\"expressions\");\n\t\t\tif (expressions.Count == 1) {\n\t\t\t\tsuccess = (expressions[0].Type.Kind != TypeKind.Unknown);\n\t\t\t\treturn expressions[0].Type;\n\t\t\t}\n\t\t\tLog.WriteCollection(\"GetBestCommonType() for \", expressions);\n\t\t\ttry {\n\t\t\t\tITypeParameter tp = DummyTypeParameter.GetMethodTypeParameter(0);\n\t\t\t\tthis.typeParameters = new TP[1] { new TP(tp) };\n\t\t\t\tforeach (ResolveResult r in expressions) {\n\t\t\t\t\tMakeOutputTypeInference(r, tp);\n\t\t\t\t}\n\t\t\t\tsuccess = Fix(typeParameters[0]);\n\t\t\t\treturn typeParameters[0].FixedTo ?? SpecialType.UnknownType;\n\t\t\t} finally {\n\t\t\t\tReset();\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region FindTypeInBounds\n\t\t/// <summary>\n\t\t/// Finds a type that satisfies the given lower and upper bounds.\n\t\t/// </summary>\n\t\tpublic IType FindTypeInBounds(IList<IType> lowerBounds, IList<IType> upperBounds)\n\t\t{\n\t\t\tif (lowerBounds == null)\n\t\t\t\tthrow new ArgumentNullException(\"lowerBounds\");\n\t\t\tif (upperBounds == null)\n\t\t\t\tthrow new ArgumentNullException(\"upperBounds\");\n\t\t\t\n\t\t\tIList<IType> result = FindTypesInBounds(lowerBounds, upperBounds);\n\t\t\t\n\t\t\tif (algorithm == TypeInferenceAlgorithm.ImprovedReturnAllResults) {\n\t\t\t\treturn IntersectionType.Create(result);\n\t\t\t} else {\n\t\t\t\t// return any of the candidates (prefer non-interfaces)\n\t\t\t\treturn GetFirstTypePreferNonInterfaces(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IType GetFirstTypePreferNonInterfaces(IList<IType> result)\n\t\t{\n\t\t\treturn result.FirstOrDefault(c => c.Kind != TypeKind.Interface)\n\t\t\t\t?? result.FirstOrDefault() ?? SpecialType.UnknownType;\n\t\t}\n\t\t\n\t\tIList<IType> FindTypesInBounds(IList<IType> lowerBounds, IList<IType> upperBounds)\n\t\t{\n\t\t\t// If there's only a single type; return that single type.\n\t\t\t// If both inputs are empty, return the empty list.\n\t\t\tif (lowerBounds.Count == 0 && upperBounds.Count <= 1)\n\t\t\t\treturn upperBounds;\n\t\t\tif (upperBounds.Count == 0 && lowerBounds.Count <= 1)\n\t\t\t\treturn lowerBounds;\n\t\t\tif (nestingLevel > maxNestingLevel)\n\t\t\t\treturn EmptyList<IType>.Instance;\n\t\t\t\n\t\t\t// Finds a type X so that \"LB <: X <: UB\"\n\t\t\tLog.WriteCollection(\"FindTypesInBound, LowerBounds=\", lowerBounds);\n\t\t\tLog.WriteCollection(\"FindTypesInBound, UpperBounds=\", upperBounds);\n\t\t\t\n\t\t\t// First try the Fixing algorithm from the C# spec (§7.5.2.11)\n\t\t\tList<IType> candidateTypes = lowerBounds.Union(upperBounds)\n\t\t\t\t.Where(c => lowerBounds.All(b => conversions.ImplicitConversion(b, c).IsValid))\n\t\t\t\t.Where(c => upperBounds.All(b => conversions.ImplicitConversion(c, b).IsValid))\n\t\t\t\t.ToList(); // evaluate the query only once\n\n\t\t\tLog.WriteCollection(\"FindTypesInBound, Candidates=\", candidateTypes);\n\t\t\t\n\t\t\t// According to the C# specification, we need to pick the most specific\n\t\t\t// of the candidate types. (the type which has conversions to all others)\n\t\t\t// However, csc actually seems to choose the least specific.\n\t\t\tcandidateTypes = candidateTypes.Where(\n\t\t\t\tc => candidateTypes.All(o => conversions.ImplicitConversion(o, c).IsValid)\n\t\t\t).ToList();\n\n\t\t\t// If the specified algorithm produces a single candidate, we return\n\t\t\t// that candidate.\n\t\t\t// We also return the whole candidate list if we're not using the improved\n\t\t\t// algorithm.\n\t\t\tif (candidateTypes.Count == 1 || !(algorithm == TypeInferenceAlgorithm.Improved || algorithm == TypeInferenceAlgorithm.ImprovedReturnAllResults))\n\t\t\t{\n\t\t\t\treturn candidateTypes;\n\t\t\t}\n\t\t\tcandidateTypes.Clear();\n\t\t\t\n\t\t\t// Now try the improved algorithm\n\t\t\tLog.Indent();\n\t\t\tList<ITypeDefinition> candidateTypeDefinitions;\n\t\t\tif (lowerBounds.Count > 0) {\n\t\t\t\t// Find candidates by using the lower bounds:\n\t\t\t\tvar hashSet = new HashSet<ITypeDefinition>(lowerBounds[0].GetAllBaseTypeDefinitions());\n\t\t\t\tfor (int i = 1; i < lowerBounds.Count; i++) {\n\t\t\t\t\thashSet.IntersectWith(lowerBounds[i].GetAllBaseTypeDefinitions());\n\t\t\t\t}\n\t\t\t\tcandidateTypeDefinitions = hashSet.ToList();\n\t\t\t} else {\n\t\t\t\t// Find candidates by looking at all classes in the project:\n\t\t\t\tcandidateTypeDefinitions = compilation.GetAllTypeDefinitions().ToList();\n\t\t\t}\n\t\t\t\n\t\t\t// Now filter out candidates that violate the upper bounds:\n\t\t\tforeach (IType ub in upperBounds) {\n\t\t\t\tITypeDefinition ubDef = ub.GetDefinition();\n\t\t\t\tif (ubDef != null) {\n\t\t\t\t\tcandidateTypeDefinitions.RemoveAll(c => !c.IsDerivedFrom(ubDef));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach (ITypeDefinition candidateDef in candidateTypeDefinitions) {\n\t\t\t\t// determine the type parameters for the candidate:\n\t\t\t\tIType candidate;\n\t\t\t\tif (candidateDef.TypeParameterCount == 0) {\n\t\t\t\t\tcandidate = candidateDef;\n\t\t\t\t} else {\n\t\t\t\t\tLog.WriteLine(\"Inferring arguments for candidate type definition: \" + candidateDef);\n\t\t\t\t\tbool success;\n\t\t\t\t\tIType[] result = InferTypeArgumentsFromBounds(\n\t\t\t\t\t\tcandidateDef.TypeParameters,\n\t\t\t\t\t\tnew ParameterizedType(candidateDef, candidateDef.TypeParameters),\n\t\t\t\t\t\tlowerBounds, upperBounds,\n\t\t\t\t\t\tout success);\n\t\t\t\t\tif (success) {\n\t\t\t\t\t\tcandidate = new ParameterizedType(candidateDef, result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tLog.WriteLine(\"Inference failed; ignoring candidate\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLog.WriteLine(\"Candidate type: \" + candidate);\n\t\t\t\t\n\t\t\t\tif (upperBounds.Count == 0) {\n\t\t\t\t\t// if there were only lower bounds, we aim for the most specific candidate:\n\t\t\t\t\t\n\t\t\t\t\t// if this candidate isn't made redundant by an existing, more specific candidate:\n\t\t\t\t\tif (!candidateTypes.Any(c => c.GetDefinition().IsDerivedFrom(candidateDef))) {\n\t\t\t\t\t\t// remove all existing candidates made redundant by this candidate:\n\t\t\t\t\t\tcandidateTypes.RemoveAll(c => candidateDef.IsDerivedFrom(c.GetDefinition()));\n\t\t\t\t\t\t// add new candidate\n\t\t\t\t\t\tcandidateTypes.Add(candidate);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// if there were upper bounds, we aim for the least specific candidate:\n\t\t\t\t\t\n\t\t\t\t\t// if this candidate isn't made redundant by an existing, less specific candidate:\n\t\t\t\t\tif (!candidateTypes.Any(c => candidateDef.IsDerivedFrom(c.GetDefinition()))) {\n\t\t\t\t\t\t// remove all existing candidates made redundant by this candidate:\n\t\t\t\t\t\tcandidateTypes.RemoveAll(c => c.GetDefinition().IsDerivedFrom(candidateDef));\n\t\t\t\t\t\t// add new candidate\n\t\t\t\t\t\tcandidateTypes.Add(candidate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog.Unindent();\n\t\t\treturn candidateTypes;\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/AliasNamespaceReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Looks up an alias (identifier in front of :: operator).\n\t/// </summary>\n\t/// <remarks>\n\t/// The member lookup performed by the :: operator is handled\n\t/// by <see cref=\"MemberTypeOrNamespaceReference\"/>.\n\t/// </remarks>\n\t[Serializable]\n\tpublic sealed class AliasNamespaceReference : TypeOrNamespaceReference, ISupportsInterning\n\t{\n\t\treadonly string identifier;\n\t\t\n\t\tpublic AliasNamespaceReference(string identifier)\n\t\t{\n\t\t\tif (identifier == null)\n\t\t\t\tthrow new ArgumentNullException(\"identifier\");\n\t\t\tthis.identifier = identifier;\n\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget { return identifier; }\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn resolver.ResolveAlias(identifier);\n\t\t}\n\t\t\n\t\tpublic override IType ResolveType(CSharpResolver resolver)\n\t\t{\n\t\t\t// alias cannot refer to types\n\t\t\treturn SpecialType.UnknownType;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn identifier + \"::\";\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn identifier.GetHashCode();\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tAliasNamespaceReference anr = other as AliasNamespaceReference;\n\t\t\treturn anr != null && this.identifier == anr.identifier;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/AttributeTypeReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Type reference used within an attribute.\n\t/// Looks up both 'withoutSuffix' and 'withSuffix' and returns the type that exists.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class AttributeTypeReference : ITypeReference, ISupportsInterning\n\t{\n\t\treadonly ITypeReference withoutSuffix, withSuffix;\n\t\t\n\t\tpublic AttributeTypeReference(ITypeReference withoutSuffix, ITypeReference withSuffix)\n\t\t{\n\t\t\tif (withoutSuffix == null)\n\t\t\t\tthrow new ArgumentNullException(\"withoutSuffix\");\n\t\t\tif (withSuffix == null)\n\t\t\t\tthrow new ArgumentNullException(\"withSuffix\");\n\t\t\tthis.withoutSuffix = withoutSuffix;\n\t\t\tthis.withSuffix = withSuffix;\n\t\t}\n\t\t\n\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tIType t1 = withoutSuffix.Resolve(context);\n\t\t\tIType t2 = withSuffix.Resolve(context);\n\t\t\treturn PreferAttributeTypeWithSuffix(t1, t2, context.Compilation) ? t2 : t1;\n\t\t}\n\t\t\n\t\tinternal static bool PreferAttributeTypeWithSuffix(IType t1, IType t2, ICompilation compilation)\n\t\t{\n\t\t\tif (t2.Kind == TypeKind.Unknown) return false;\n\t\t\tif (t1.Kind == TypeKind.Unknown) return true;\n\t\t\t\n\t\t\tvar attrTypeDef = compilation.FindType(KnownTypeCode.Attribute).GetDefinition();\n\t\t\tif (attrTypeDef != null) {\n\t\t\t\tbool t1IsAttribute = (t1.GetDefinition() != null && t1.GetDefinition().IsDerivedFrom(attrTypeDef));\n\t\t\t\tbool t2IsAttribute = (t2.GetDefinition() != null && t2.GetDefinition().IsDerivedFrom(attrTypeDef));\n\t\t\t\tif (t2IsAttribute && !t1IsAttribute)\n\t\t\t\t\treturn true;\n\t\t\t\t// If both types exist and are attributes, C# considers that to be an ambiguity, but we are less strict.\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn withoutSuffix.ToString() + \"[Attribute]\";\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn withoutSuffix.GetHashCode() + 715613 * withSuffix.GetHashCode();\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tAttributeTypeReference atr = other as AttributeTypeReference;\n\t\t\treturn atr != null && this.withoutSuffix == atr.withoutSuffix && this.withSuffix == atr.withSuffix;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\tpublic class CSharpAssembly : IAssembly\n\t{\n\t\treadonly ICompilation compilation;\n\t\treadonly ITypeResolveContext context;\n\t\treadonly CSharpProjectContent projectContent;\n\t\tIList<IAttribute> assemblyAttributes;\n\t\tIList<IAttribute> moduleAttributes;\n\t\t\n\t\tinternal CSharpAssembly(ICompilation compilation, CSharpProjectContent projectContent)\n\t\t{\n\t\t\tthis.compilation = compilation;\n\t\t\tthis.projectContent = projectContent;\n\t\t\tthis.context = new SimpleTypeResolveContext(this);\n\t\t}\n\t\t\n\t\tpublic bool IsMainAssembly {\n\t\t\tget { return compilation.MainAssembly == this; }\n\t\t}\n\t\t\n\t\tpublic IUnresolvedAssembly UnresolvedAssembly {\n\t\t\tget { return projectContent; }\n\t\t}\n\t\t\n\t\tpublic string AssemblyName {\n\t\t\tget { return projectContent.AssemblyName; }\n\t\t}\n\t\t\n\t\tpublic string FullAssemblyName {\n\t\t\tget { return projectContent.FullAssemblyName; }\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> AssemblyAttributes {\n\t\t\tget {\n\t\t\t\treturn GetAttributes(ref assemblyAttributes, true);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<IAttribute> ModuleAttributes {\n\t\t\tget {\n\t\t\t\treturn GetAttributes(ref moduleAttributes, false);\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<IAttribute> GetAttributes(ref IList<IAttribute> field, bool assemblyAttributes)\n\t\t{\n\t\t\tIList<IAttribute> result = LazyInit.VolatileRead(ref field);\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tresult = new List<IAttribute>();\n\t\t\t\tforeach (var unresolvedFile in projectContent.Files.OfType<CSharpUnresolvedFile>()) {\n\t\t\t\t\tvar attributes = assemblyAttributes ? unresolvedFile.AssemblyAttributes : unresolvedFile.ModuleAttributes;\n\t\t\t\t\tvar context = new CSharpTypeResolveContext(this, unresolvedFile.RootUsingScope.Resolve(compilation));\n\t\t\t\t\tforeach (var unresolvedAttr in attributes) {\n\t\t\t\t\t\tresult.Add(unresolvedAttr.CreateResolvedAttribute(context));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn LazyInit.GetOrSet(ref field, result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tNS rootNamespace;\n\t\t\n\t\tpublic INamespace RootNamespace {\n\t\t\tget {\n\t\t\t\tNS root = LazyInit.VolatileRead(ref this.rootNamespace);\n\t\t\t\tif (root != null) {\n\t\t\t\t\treturn root;\n\t\t\t\t} else {\n\t\t\t\t\troot = new NS(this);\n\t\t\t\t\tDictionary<string, NS> dict = new Dictionary<string, NS>(compilation.NameComparer);\n\t\t\t\t\tdict.Add(string.Empty, root);\n\t\t\t\t\t// Add namespaces declared in C# files, even if they're empty:\n\t\t\t\t\tforeach (var usingScope in projectContent.Files.OfType<CSharpUnresolvedFile>().SelectMany(f => f.UsingScopes)) {\n\t\t\t\t\t\tGetOrAddNamespace(dict, usingScope.NamespaceName);\n\t\t\t\t\t}\n\t\t\t\t\tforeach (var pair in GetTypes()) {\n\t\t\t\t\t\tNS ns = GetOrAddNamespace(dict, pair.Key.Namespace);\n\t\t\t\t\t\tif (ns.types != null)\n\t\t\t\t\t\t\tns.types[pair.Key] = pair.Value;\n\t\t\t\t\t}\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.rootNamespace, root);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic NS GetOrAddNamespace(Dictionary<string, NS> dict, string fullName)\n\t\t{\n\t\t\tNS ns;\n\t\t\tif (dict.TryGetValue(fullName, out ns))\n\t\t\t\treturn ns;\n\t\t\tint pos = fullName.LastIndexOf('.');\n\t\t\tNS parent;\n\t\t\tstring name;\n\t\t\tif (pos < 0) {\n\t\t\t\tparent = dict[string.Empty]; // root\n\t\t\t\tname = fullName;\n\t\t\t} else {\n\t\t\t\tparent = GetOrAddNamespace(dict, fullName.Substring(0, pos));\n\t\t\t\tname = fullName.Substring(pos + 1);\n\t\t\t}\n\t\t\tns = new NS(parent, fullName, name);\n\t\t\tparent.childNamespaces.Add(ns);\n\t\t\tdict.Add(fullName, ns);\n\t\t\treturn ns;\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return compilation; }\n\t\t}\n\t\t\n\t\tpublic bool InternalsVisibleTo(IAssembly assembly)\n\t\t{\n\t\t\tif (this == assembly)\n\t\t\t\treturn true;\n\t\t\tforeach (string shortName in GetInternalsVisibleTo()) {\n\t\t\t\tif (assembly.AssemblyName == shortName)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvolatile string[] internalsVisibleTo;\n\t\t\n\t\tstring[] GetInternalsVisibleTo()\n\t\t{\n\t\t\tvar result = this.internalsVisibleTo;\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tusing (var busyLock = BusyManager.Enter(this)) {\n\t\t\t\t\tDebug.Assert(busyLock.Success);\n\t\t\t\t\tif (!busyLock.Success) {\n\t\t\t\t\t\treturn new string[0];\n\t\t\t\t\t}\n\t\t\t\t\tinternalsVisibleTo = (\n\t\t\t\t\t\tfrom attr in this.AssemblyAttributes\n\t\t\t\t\t\twhere attr.AttributeType.Name == \"InternalsVisibleToAttribute\"\n\t\t\t\t\t\t&& attr.AttributeType.Namespace == \"System.Runtime.CompilerServices\"\n\t\t\t\t\t\t&& attr.PositionalArguments.Count == 1\n\t\t\t\t\t\tselect GetShortName(attr.PositionalArguments.Single().ConstantValue as string)\n\t\t\t\t\t).ToArray();\n\t\t\t\t}\n\t\t\t\treturn internalsVisibleTo;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic string GetShortName(string fullAssemblyName)\n\t\t{\n\t\t\tif (fullAssemblyName == null)\n\t\t\t\treturn null;\n\t\t\tint pos = fullAssemblyName.IndexOf(',');\n\t\t\tif (pos < 0)\n\t\t\t\treturn fullAssemblyName;\n\t\t\telse\n\t\t\t\treturn fullAssemblyName.Substring(0, pos);\n\t\t}\n\t\t\n\t\tDictionary<TopLevelTypeName, ITypeDefinition> typeDict;\n\t\t\n\t\tDictionary<TopLevelTypeName, ITypeDefinition> GetTypes()\n\t\t{\n\t\t\tvar dict = LazyInit.VolatileRead(ref this.typeDict);\n\t\t\tif (dict != null) {\n\t\t\t\treturn dict;\n\t\t\t} else {\n\t\t\t\t// Always use the ordinal comparer for the main dictionary so that partial classes\n\t\t\t\t// get merged correctly.\n\t\t\t\t// The compilation's comparer will be used for the per-namespace dictionaries.\n\t\t\t\tvar comparer = TopLevelTypeNameComparer.Ordinal;\n\t\t\t\tdict = projectContent.TopLevelTypeDefinitions\n\t\t\t\t\t.GroupBy(t => new TopLevelTypeName(t.Namespace, t.Name, t.TypeParameters.Count), comparer)\n\t\t\t\t\t.ToDictionary(g => g.Key, g => CreateResolvedTypeDefinition(g.ToArray()), comparer);\n\t\t\t\treturn LazyInit.GetOrSet(ref this.typeDict, dict);\n\t\t\t}\n\t\t}\n\t\t\n\t\tITypeDefinition CreateResolvedTypeDefinition(IUnresolvedTypeDefinition[] parts)\n\t\t{\n\t\t\treturn new DefaultResolvedTypeDefinition(context, parts);\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition GetTypeDefinition(TopLevelTypeName topLevelTypeName)\n\t\t{\n\t\t\tITypeDefinition def;\n\t\t\tif (GetTypes().TryGetValue(topLevelTypeName, out def))\n\t\t\t\treturn def;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IEnumerable<ITypeDefinition> TopLevelTypeDefinitions {\n\t\t\tget {\n\t\t\t\treturn GetTypes().Values;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[CSharpAssembly \" + this.AssemblyName + \"]\";\n\t\t}\n\t\t\n\t\tsealed class NS : INamespace\n\t\t{\n\t\t\treadonly CSharpAssembly assembly;\n\t\t\treadonly NS parentNamespace;\n\t\t\treadonly string fullName;\n\t\t\treadonly string name;\n\t\t\tinternal readonly List<NS> childNamespaces = new List<NS>();\n\t\t\tinternal readonly Dictionary<TopLevelTypeName, ITypeDefinition> types;\n\t\t\t\n\t\t\tpublic NS(CSharpAssembly assembly)\n\t\t\t{\n\t\t\t\tthis.assembly = assembly;\n\t\t\t\tthis.fullName = string.Empty;\n\t\t\t\tthis.name = string.Empty;\n\t\t\t\t// Our main dictionary for the CSharpAssembly is using an ordinal comparer.\n\t\t\t\t// If the compilation's comparer isn't ordinal, we need to create a new dictionary with the compilation's comparer.\n\t\t\t\tif (assembly.compilation.NameComparer != StringComparer.Ordinal) {\n\t\t\t\t\tthis.types = new Dictionary<TopLevelTypeName, ITypeDefinition>(new TopLevelTypeNameComparer(assembly.compilation.NameComparer));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic NS(NS parentNamespace, string fullName, string name)\n\t\t\t{\n\t\t\t\tthis.assembly = parentNamespace.assembly;\n\t\t\t\tthis.parentNamespace = parentNamespace;\n\t\t\t\tthis.fullName = fullName;\n\t\t\t\tthis.name = name;\n\t\t\t\tif (parentNamespace.types != null)\n\t\t\t\t\tthis.types = new Dictionary<TopLevelTypeName, ITypeDefinition>(parentNamespace.types.Comparer);\n\t\t\t}\n\t\t\t\n\t\t\tstring INamespace.ExternAlias {\n\t\t\t\tget { return null; }\n\t\t\t}\n\t\t\t\n\t\t\tstring INamespace.FullName {\n\t\t\t\tget { return fullName; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic string Name {\n\t\t\t\tget { return name; }\n\t\t\t}\n\t\t\t\n\t\t\tSymbolKind ISymbol.SymbolKind {\n\t\t\t\tget { return SymbolKind.Namespace; }\n\t\t\t}\n\t\t\t\n\t\t\tINamespace INamespace.ParentNamespace {\n\t\t\t\tget { return parentNamespace; }\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<INamespace> INamespace.ChildNamespaces {\n\t\t\t\tget { return childNamespaces; }\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<ITypeDefinition> INamespace.Types {\n\t\t\t\tget {\n\t\t\t\t\tif (types != null)\n\t\t\t\t\t\treturn types.Values;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tfrom t in assembly.GetTypes()\n\t\t\t\t\t\t\twhere t.Key.Namespace == fullName\n\t\t\t\t\t\t\tselect t.Value\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tICompilation ICompilationProvider.Compilation {\n\t\t\t\tget { return assembly.Compilation; }\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<IAssembly> INamespace.ContributingAssemblies {\n\t\t\t\tget { return new [] { assembly }; }\n\t\t\t}\n\t\t\t\n\t\t\tINamespace INamespace.GetChildNamespace(string name)\n\t\t\t{\n\t\t\t\tvar nameComparer = assembly.compilation.NameComparer;\n\t\t\t\tforeach (NS childNamespace in childNamespaces) {\n\t\t\t\t\tif (nameComparer.Equals(name, childNamespace.name))\n\t\t\t\t\t\treturn childNamespace;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tITypeDefinition INamespace.GetTypeDefinition(string name, int typeParameterCount)\n\t\t\t{\n\t\t\t\tvar key = new TopLevelTypeName(fullName, name, typeParameterCount);\n\t\t\t\tif (types != null) {\n\t\t\t\t\tITypeDefinition typeDef;\n\t\t\t\t\tif (types.TryGetValue(key, out typeDef))\n\t\t\t\t\t\treturn typeDef;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\treturn assembly.GetTypeDefinition(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic ISymbolReference ToReference()\n\t\t\t{\n\t\t\t\treturn new NamespaceReference(new DefaultAssemblyReference(assembly.AssemblyName), fullName);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAttribute.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t[Serializable]\n\tpublic sealed class CSharpAttribute : IUnresolvedAttribute\n\t{\n\t\tITypeReference attributeType;\n\t\tDomRegion region;\n\t\tIList<IConstantValue> positionalArguments;\n\t\tIList<KeyValuePair<string, IConstantValue>> namedCtorArguments;\n\t\tIList<KeyValuePair<string, IConstantValue>> namedArguments;\n\t\t\n\t\tpublic CSharpAttribute(ITypeReference attributeType, DomRegion region,\n\t\t                       IList<IConstantValue> positionalArguments,\n\t\t                       IList<KeyValuePair<string, IConstantValue>> namedCtorArguments,\n\t\t                       IList<KeyValuePair<string, IConstantValue>> namedArguments)\n\t\t{\n\t\t\tif (attributeType == null)\n\t\t\t\tthrow new ArgumentNullException(\"attributeType\");\n\t\t\tthis.attributeType = attributeType;\n\t\t\tthis.region = region;\n\t\t\tthis.positionalArguments = positionalArguments ?? EmptyList<IConstantValue>.Instance;\n\t\t\tthis.namedCtorArguments = namedCtorArguments ?? EmptyList<KeyValuePair<string, IConstantValue>>.Instance;\n\t\t\tthis.namedArguments = namedArguments ?? EmptyList<KeyValuePair<string, IConstantValue>>.Instance;\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t}\n\t\t\n\t\tpublic ITypeReference AttributeType {\n\t\t\tget { return attributeType; }\n\t\t}\n\t\t\n\t\tpublic IAttribute CreateResolvedAttribute(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new CSharpResolvedAttribute((CSharpTypeResolveContext)context, this);\n\t\t}\n\t\t\n\t\tsealed class CSharpResolvedAttribute : IAttribute\n\t\t{\n\t\t\treadonly CSharpTypeResolveContext context;\n\t\t\treadonly CSharpAttribute unresolved;\n\t\t\treadonly IType attributeType;\n\t\t\t\n\t\t\tIList<KeyValuePair<IMember, ResolveResult>> namedArguments;\n\t\t\t\n\t\t\tpublic CSharpResolvedAttribute(CSharpTypeResolveContext context, CSharpAttribute unresolved)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t\tthis.unresolved = unresolved;\n\t\t\t\t// Pretty much any access to the attribute checks the type first, so\n\t\t\t\t// we don't need to use lazy-loading for that.\n\t\t\t\tthis.attributeType = unresolved.AttributeType.Resolve(context);\n\t\t\t}\n\t\t\t\n\t\t\tDomRegion IAttribute.Region {\n\t\t\t\tget { return unresolved.Region; }\n\t\t\t}\n\t\t\t\n\t\t\tIType IAttribute.AttributeType {\n\t\t\t\tget { return attributeType; }\n\t\t\t}\n\t\t\t\n\t\t\tResolveResult ctorInvocation;\n\t\t\t\n\t\t\tInvocationResolveResult GetCtorInvocation()\n\t\t\t{\n\t\t\t\tResolveResult rr = LazyInit.VolatileRead(ref this.ctorInvocation);\n\t\t\t\tif (rr != null) {\n\t\t\t\t\treturn rr as InvocationResolveResult;\n\t\t\t\t} else {\n\t\t\t\t\tCSharpResolver resolver = new CSharpResolver(context);\n\t\t\t\t\tint totalArgumentCount = unresolved.positionalArguments.Count + unresolved.namedCtorArguments.Count;\n\t\t\t\t\tResolveResult[] arguments = new ResolveResult[totalArgumentCount];\n\t\t\t\t\tstring[] argumentNames = new string[totalArgumentCount];\n\t\t\t\t\tint i = 0;\n\t\t\t\t\twhile (i < unresolved.positionalArguments.Count) {\n\t\t\t\t\t\tIConstantValue cv = unresolved.positionalArguments[i];\n\t\t\t\t\t\targuments[i] = cv.Resolve(context);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tforeach (var pair in unresolved.namedCtorArguments) {\n\t\t\t\t\t\targumentNames[i] = pair.Key;\n\t\t\t\t\t\targuments[i] = pair.Value.Resolve(context);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\trr = resolver.ResolveObjectCreation(attributeType, arguments, argumentNames);\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.ctorInvocation, rr) as InvocationResolveResult;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tIMethod IAttribute.Constructor {\n\t\t\t\tget {\n\t\t\t\t\tvar invocation = GetCtorInvocation();\n\t\t\t\t\tif (invocation != null)\n\t\t\t\t\t\treturn invocation.Member as IMethod;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tIList<ResolveResult> positionalArguments;\n\t\t\t\n\t\t\tIList<ResolveResult> IAttribute.PositionalArguments {\n\t\t\t\tget {\n\t\t\t\t\tvar result = LazyInit.VolatileRead(ref this.positionalArguments);\n\t\t\t\t\tif (result != null) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar invocation = GetCtorInvocation();\n\t\t\t\t\t\tif (invocation != null)\n\t\t\t\t\t\t\tresult = invocation.GetArgumentsForCall();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tresult = EmptyList<ResolveResult>.Instance;\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.positionalArguments, result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tIList<KeyValuePair<IMember, ResolveResult>> IAttribute.NamedArguments {\n\t\t\t\tget {\n\t\t\t\t\tvar namedArgs = LazyInit.VolatileRead(ref this.namedArguments);\n\t\t\t\t\tif (namedArgs != null) {\n\t\t\t\t\t\treturn namedArgs;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnamedArgs = new List<KeyValuePair<IMember, ResolveResult>>();\n\t\t\t\t\t\tforeach (var pair in unresolved.namedArguments) {\n\t\t\t\t\t\t\tIMember member = attributeType.GetMembers(m => (m.SymbolKind == SymbolKind.Field || m.SymbolKind == SymbolKind.Property) && m.Name == pair.Key).FirstOrDefault();\n\t\t\t\t\t\t\tif (member != null) {\n\t\t\t\t\t\t\t\tResolveResult val = pair.Value.Resolve(context);\n\t\t\t\t\t\t\t\tnamedArgs.Add(new KeyValuePair<IMember, ResolveResult>(member, val));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.namedArguments, namedArgs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpDocumentationComment.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// DocumentationComment with C# cref lookup.\n\t/// </summary>\n\tsealed class CSharpDocumentationComment : DocumentationComment\n\t{\n\t\tpublic CSharpDocumentationComment(ITextSource xmlDoc, ITypeResolveContext context) : base(xmlDoc, context)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic override IEntity ResolveCref(string cref)\n\t\t{\n\t\t\tif (cref.Length > 2 && cref[1] == ':') {\n\t\t\t\t// resolve ID string\n\t\t\t\treturn base.ResolveCref(cref);\n\t\t\t}\n\t\t\tvar documentationReference = new CSharpParser().ParseDocumentationReference(cref);\n\t\t\tvar csharpContext = context as CSharpTypeResolveContext;\n\t\t\tCSharpResolver resolver;\n\t\t\tif (csharpContext != null) {\n\t\t\t\tresolver = new CSharpResolver(csharpContext);\n\t\t\t} else {\n\t\t\t\tresolver = new CSharpResolver(context.Compilation);\n\t\t\t}\n\t\t\tvar astResolver = new CSharpAstResolver(resolver, documentationReference);\n\t\t\tvar rr = astResolver.Resolve(documentationReference);\n\t\t\t\n\t\t\tMemberResolveResult mrr = rr as MemberResolveResult;\n\t\t\tif (mrr != null)\n\t\t\t\treturn mrr.Member;\n\t\t\tTypeResolveResult trr = rr as TypeResolveResult;\n\t\t\tif (trr != null)\n\t\t\t\treturn trr.Type.GetDefinition();\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpTypeResolveContext.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\tpublic sealed class CSharpTypeResolveContext : ITypeResolveContext\n\t{\n\t\treadonly IAssembly assembly;\n\t\treadonly ResolvedUsingScope currentUsingScope;\n\t\treadonly ITypeDefinition currentTypeDefinition;\n\t\treadonly IMember currentMember;\n\t\treadonly string[] methodTypeParameterNames;\n\t\t\n\t\tpublic CSharpTypeResolveContext(IAssembly assembly, ResolvedUsingScope usingScope = null, ITypeDefinition typeDefinition = null, IMember member = null)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tthrow new ArgumentNullException(\"assembly\");\n\t\t\tthis.assembly = assembly;\n\t\t\tthis.currentUsingScope = usingScope;\n\t\t\tthis.currentTypeDefinition = typeDefinition;\n\t\t\tthis.currentMember = member;\n\t\t}\n\t\t\n\t\tprivate CSharpTypeResolveContext(IAssembly assembly, ResolvedUsingScope usingScope, ITypeDefinition typeDefinition, IMember member, string[] methodTypeParameterNames)\n\t\t{\n\t\t\tthis.assembly = assembly;\n\t\t\tthis.currentUsingScope = usingScope;\n\t\t\tthis.currentTypeDefinition = typeDefinition;\n\t\t\tthis.currentMember = member;\n\t\t\tthis.methodTypeParameterNames = methodTypeParameterNames;\n\t\t}\n\t\t\n\t\tpublic ResolvedUsingScope CurrentUsingScope {\n\t\t\tget { return currentUsingScope; }\n\t\t}\n\t\t\n\t\tpublic ICompilation Compilation {\n\t\t\tget { return assembly.Compilation; }\n\t\t}\n\t\t\n\t\tpublic IAssembly CurrentAssembly {\n\t\t\tget { return assembly; }\n\t\t}\n\t\t\n\t\tpublic ITypeDefinition CurrentTypeDefinition {\n\t\t\tget { return currentTypeDefinition; }\n\t\t}\n\t\t\n\t\tpublic IMember CurrentMember {\n\t\t\tget { return currentMember; }\n\t\t}\n\t\t\n\t\tpublic CSharpTypeResolveContext WithCurrentTypeDefinition(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\treturn new CSharpTypeResolveContext(assembly, currentUsingScope, typeDefinition, currentMember, methodTypeParameterNames);\n\t\t}\n\t\t\n\t\tITypeResolveContext ITypeResolveContext.WithCurrentTypeDefinition(ITypeDefinition typeDefinition)\n\t\t{\n\t\t\treturn WithCurrentTypeDefinition(typeDefinition);\n\t\t}\n\t\t\n\t\tpublic CSharpTypeResolveContext WithCurrentMember(IMember member)\n\t\t{\n\t\t\treturn new CSharpTypeResolveContext(assembly, currentUsingScope, currentTypeDefinition, member, methodTypeParameterNames);\n\t\t}\n\t\t\n\t\tITypeResolveContext ITypeResolveContext.WithCurrentMember(IMember member)\n\t\t{\n\t\t\treturn WithCurrentMember(member);\n\t\t}\n\t\t\n\t\tpublic CSharpTypeResolveContext WithUsingScope(ResolvedUsingScope usingScope)\n\t\t{\n\t\t\treturn new CSharpTypeResolveContext(assembly, usingScope, currentTypeDefinition, currentMember, methodTypeParameterNames);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpUnresolvedFile.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a file that was parsed and converted for the type system.\n\t/// </summary>\n\t[Serializable, FastSerializerVersion(TypeSystemConvertVisitor.version)]\n\tpublic class CSharpUnresolvedFile : AbstractFreezable, IUnresolvedFile, IUnresolvedDocumentationProvider\n\t{\n\t\t// The 'FastSerializerVersion' attribute on CSharpUnresolvedFile must be incremented when fixing \n\t\t// bugs in the TypeSystemConvertVisitor\n\t\t\n\t\tstring fileName = string.Empty;\n\t\treadonly UsingScope rootUsingScope = new UsingScope();\n\t\tIList<IUnresolvedTypeDefinition> topLevelTypeDefinitions = new List<IUnresolvedTypeDefinition>();\n\t\tIList<IUnresolvedAttribute> assemblyAttributes = new List<IUnresolvedAttribute>();\n\t\tIList<IUnresolvedAttribute> moduleAttributes = new List<IUnresolvedAttribute>();\n\t\tIList<UsingScope> usingScopes = new List<UsingScope>();\n\t\tIList<Error> errors = new List<Error> ();\n\t\tDictionary<IUnresolvedEntity, string> documentation;\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tbase.FreezeInternal();\n\t\t\trootUsingScope.Freeze();\n\t\t\ttopLevelTypeDefinitions = FreezableHelper.FreezeListAndElements(topLevelTypeDefinitions);\n\t\t\tassemblyAttributes = FreezableHelper.FreezeListAndElements(assemblyAttributes);\n\t\t\tmoduleAttributes = FreezableHelper.FreezeListAndElements(moduleAttributes);\n\t\t\tusingScopes = FreezableHelper.FreezeListAndElements(usingScopes);\n\t\t}\n\t\t\n\t\tpublic string FileName {\n\t\t\tget { return fileName; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tfileName = value ?? string.Empty;\n\t\t\t}\n\t\t}\n\t\t\n\t\tDateTime? lastWriteTime;\n\t\t\n\t\tpublic DateTime? LastWriteTime {\n\t\t\tget { return lastWriteTime; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tlastWriteTime = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic UsingScope RootUsingScope {\n\t\t\tget { return rootUsingScope; }\n\t\t}\n\t\t\n\t\tpublic IList<Error> Errors {\n\t\t\tget { return errors; }\n\t\t\tinternal set { errors = (List<Error>)value; }\n\t\t}\n\t\t\n\t\tpublic IList<UsingScope> UsingScopes {\n\t\t\tget { return usingScopes; }\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedTypeDefinition> TopLevelTypeDefinitions {\n\t\t\tget { return topLevelTypeDefinitions; }\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> AssemblyAttributes {\n\t\t\tget { return assemblyAttributes; }\n\t\t}\n\t\t\n\t\tpublic IList<IUnresolvedAttribute> ModuleAttributes {\n\t\t\tget { return moduleAttributes; }\n\t\t}\n\t\t\n\t\tpublic void AddDocumentation(IUnresolvedEntity entity, string xmlDocumentation)\n\t\t{\n\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\tif (documentation == null)\n\t\t\t\tdocumentation = new Dictionary<IUnresolvedEntity, string>();\n\t\t\tdocumentation.Add(entity, xmlDocumentation);\n\t\t}\n\t\t\n\t\tpublic UsingScope GetUsingScope(TextLocation location)\n\t\t{\n\t\t\tforeach (UsingScope scope in usingScopes) {\n\t\t\t\tif (scope.Region.IsInside(location.Line, location.Column))\n\t\t\t\t\treturn scope;\n\t\t\t}\n\t\t\treturn rootUsingScope;\n\t\t}\n\t\t\n\t\tpublic IUnresolvedTypeDefinition GetTopLevelTypeDefinition(TextLocation location)\n\t\t{\n\t\t\treturn FindEntity(topLevelTypeDefinitions, location);\n\t\t}\n\t\t\n\t\tpublic IUnresolvedTypeDefinition GetInnermostTypeDefinition(TextLocation location)\n\t\t{\n\t\t\tIUnresolvedTypeDefinition parent = null;\n\t\t\tIUnresolvedTypeDefinition type = GetTopLevelTypeDefinition(location);\n\t\t\twhile (type != null) {\n\t\t\t\tparent = type;\n\t\t\t\ttype = FindEntity(parent.NestedTypes, location);\n\t\t\t}\n\t\t\treturn parent;\n\t\t}\n\t\t\n\t\tpublic IUnresolvedMember GetMember(TextLocation location)\n\t\t{\n\t\t\tIUnresolvedTypeDefinition type = GetInnermostTypeDefinition(location);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\t\t\treturn FindEntity(type.Members, location);\n\t\t}\n\t\t\n\t\tstatic T FindEntity<T>(IList<T> list, TextLocation location) where T : class, IUnresolvedEntity\n\t\t{\n\t\t\t// This could be improved using a binary search\n\t\t\tforeach (T entity in list) {\n\t\t\t\tif (entity.Region.IsInside(location.Line, location.Column))\n\t\t\t\t\treturn entity;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic CSharpTypeResolveContext GetTypeResolveContext(ICompilation compilation, TextLocation loc)\n\t\t{\n\t\t\tvar rctx = new CSharpTypeResolveContext (compilation.MainAssembly);\n\t\t\trctx = rctx.WithUsingScope (GetUsingScope (loc).Resolve (compilation));\n\t\t\tvar curDef = GetInnermostTypeDefinition (loc);\n\t\t\tif (curDef != null) {\n\t\t\t\tvar resolvedDef = curDef.Resolve (rctx).GetDefinition ();\n\t\t\t\tif (resolvedDef == null)\n\t\t\t\t\treturn rctx;\n\t\t\t\trctx = rctx.WithCurrentTypeDefinition (resolvedDef);\n\t\t\t\t\n\t\t\t\tvar curMember = resolvedDef.Members.FirstOrDefault (m => m.Region.FileName == FileName && m.Region.Begin <= loc && loc < m.BodyRegion.End);\n\t\t\t\tif (curMember != null)\n\t\t\t\t\trctx = rctx.WithCurrentMember (curMember);\n\t\t\t}\n\t\t\t\n\t\t\treturn rctx;\n\t\t}\n\t\t\n\t\tpublic ICSharpCode.NRefactory.CSharp.Resolver.CSharpResolver GetResolver (ICompilation compilation, TextLocation loc)\n\t\t{\n\t\t\treturn new ICSharpCode.NRefactory.CSharp.Resolver.CSharpResolver (GetTypeResolveContext (compilation, loc));\n\t\t}\n\t\t\n\t\tpublic string GetDocumentation(IUnresolvedEntity entity)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\tif (documentation == null)\n\t\t\t\treturn null;\n\t\t\tstring xmlDoc;\n\t\t\tif (documentation.TryGetValue(entity, out xmlDoc))\n\t\t\t\treturn xmlDoc;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic DocumentationComment GetDocumentation(IUnresolvedEntity entity, IEntity resolvedEntity)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\tif (resolvedEntity == null)\n\t\t\t\tthrow new ArgumentNullException(\"resolvedEntity\");\n\t\t\tstring xmlDoc = GetDocumentation(entity);\n\t\t\tif (xmlDoc == null)\n\t\t\t\treturn null;\n\t\t\tvar unresolvedTypeDef = entity as IUnresolvedTypeDefinition ?? entity.DeclaringTypeDefinition;\n\t\t\tvar resolvedTypeDef = resolvedEntity as ITypeDefinition ?? resolvedEntity.DeclaringTypeDefinition;\n\t\t\tif (unresolvedTypeDef != null && resolvedTypeDef != null) {\n\t\t\t\t// Strictly speaking, we would have to pass the parent context into CreateResolveContext,\n\t\t\t\t// then transform the result using WithTypeDefinition().\n\t\t\t\t// However, we can simplify this here because we know this is a C# type definition.\n\t\t\t\tvar context = unresolvedTypeDef.CreateResolveContext(new SimpleTypeResolveContext(resolvedTypeDef));\n\t\t\t\tif (resolvedEntity is IMember)\n\t\t\t\t\tcontext = context.WithCurrentMember((IMember)resolvedEntity);\n\t\t\t\treturn new CSharpDocumentationComment(new StringTextSource(xmlDoc), context);\n\t\t\t} else {\n\t\t\t\treturn new DocumentationComment(new StringTextSource(xmlDoc), new SimpleTypeResolveContext(resolvedEntity));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpUnresolvedTypeDefinition.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t[Serializable, FastSerializerVersion(TypeSystemConvertVisitor.version)]\n\tpublic class CSharpUnresolvedTypeDefinition : DefaultUnresolvedTypeDefinition\n\t{\n\t\treadonly UsingScope usingScope;\n\t\t\n\t\tpublic CSharpUnresolvedTypeDefinition(UsingScope usingScope, string name)\n\t\t\t: base(usingScope.NamespaceName, name)\n\t\t{\n\t\t\tthis.usingScope = usingScope;\n\t\t\tthis.AddDefaultConstructorIfRequired = true;\n\t\t}\n\t\t\n\t\tpublic CSharpUnresolvedTypeDefinition(CSharpUnresolvedTypeDefinition declaringTypeDefinition, string name)\n\t\t\t: base(declaringTypeDefinition, name)\n\t\t{\n\t\t\tthis.usingScope = declaringTypeDefinition.usingScope;\n\t\t\tthis.AddDefaultConstructorIfRequired = true;\n\t\t}\n\t\t\n\t\tpublic override ITypeResolveContext CreateResolveContext(ITypeResolveContext parentContext)\n\t\t{\n\t\t\treturn new CSharpTypeResolveContext(parentContext.CurrentAssembly, usingScope.Resolve(parentContext.Compilation), parentContext.CurrentTypeDefinition);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/ConstantValues.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem.ConstantValues\n{\n\t// Contains representations for constant C# expressions.\n\t// We use these instead of storing the full AST to reduce the memory usage.\n\t\n\t[Serializable]\n\tpublic abstract class ConstantExpression : IConstantValue\n\t{\n\t\tpublic abstract ResolveResult Resolve(CSharpResolver resolver);\n\t\t\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tvar csContext = (CSharpTypeResolveContext)context;\n\t\t\tif (context.CurrentAssembly != context.Compilation.MainAssembly) {\n\t\t\t\t// The constant needs to be resolved in a different compilation.\n\t\t\t\tIProjectContent pc = context.CurrentAssembly as IProjectContent;\n\t\t\t\tif (pc != null) {\n\t\t\t\t\tICompilation nestedCompilation = context.Compilation.SolutionSnapshot.GetCompilation(pc);\n\t\t\t\t\tif (nestedCompilation != null) {\n\t\t\t\t\t\tvar nestedContext = MapToNestedCompilation(csContext, nestedCompilation);\n\t\t\t\t\t\tResolveResult rr = Resolve(new CSharpResolver(nestedContext));\n\t\t\t\t\t\treturn MapToNewContext(rr, context);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Resolve in current context.\n\t\t\treturn Resolve(new CSharpResolver(csContext));\n\t\t}\n\t\t\n\t\tCSharpTypeResolveContext MapToNestedCompilation(CSharpTypeResolveContext context, ICompilation nestedCompilation)\n\t\t{\n\t\t\tvar nestedContext = new CSharpTypeResolveContext(nestedCompilation.MainAssembly);\n\t\t\tif (context.CurrentUsingScope != null) {\n\t\t\t\tnestedContext = nestedContext.WithUsingScope(context.CurrentUsingScope.UnresolvedUsingScope.Resolve(nestedCompilation));\n\t\t\t}\n\t\t\tif (context.CurrentTypeDefinition != null) {\n\t\t\t\tnestedContext = nestedContext.WithCurrentTypeDefinition(nestedCompilation.Import(context.CurrentTypeDefinition));\n\t\t\t}\n\t\t\treturn nestedContext;\n\t\t}\n\t\t\n\t\tstatic ResolveResult MapToNewContext(ResolveResult rr, ITypeResolveContext newContext)\n\t\t{\n\t\t\tif (rr is TypeOfResolveResult) {\n\t\t\t\treturn new TypeOfResolveResult(\n\t\t\t\t\trr.Type.ToTypeReference().Resolve(newContext),\n\t\t\t\t\t((TypeOfResolveResult)rr).ReferencedType.ToTypeReference().Resolve(newContext));\n\t\t\t} else if (rr is ArrayCreateResolveResult) {\n\t\t\t\tArrayCreateResolveResult acrr = (ArrayCreateResolveResult)rr;\n\t\t\t\treturn new ArrayCreateResolveResult(\n\t\t\t\t\tacrr.Type.ToTypeReference().Resolve(newContext),\n\t\t\t\t\tMapToNewContext(acrr.SizeArguments, newContext),\n\t\t\t\t\tMapToNewContext(acrr.InitializerElements, newContext));\n\t\t\t} else if (rr.IsCompileTimeConstant) {\n\t\t\t\treturn new ConstantResolveResult(\n\t\t\t\t\trr.Type.ToTypeReference().Resolve(newContext),\n\t\t\t\t\trr.ConstantValue\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn new ErrorResolveResult(rr.Type.ToTypeReference().Resolve(newContext));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic ResolveResult[] MapToNewContext(IList<ResolveResult> input, ITypeResolveContext newContext)\n\t\t{\n\t\t\tif (input == null)\n\t\t\t\treturn null;\n\t\t\tResolveResult[] output = new ResolveResult[input.Count];\n\t\t\tfor (int i = 0; i < output.Length; i++) {\n\t\t\t\toutput[i] = MapToNewContext(input[i], newContext);\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Used for constants that could not be converted to IConstantValue.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class ErrorConstantValue : IConstantValue\n\t{\n\t\treadonly ITypeReference type;\n\t\t\n\t\tpublic ErrorConstantValue(ITypeReference type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tthis.type = type;\n\t\t}\n\t\t\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ErrorResolveResult(type.Resolve(context));\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Increments an integer <see cref=\"IConstantValue\"/> by a fixed amount without changing the type.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class IncrementConstantValue : IConstantValue, ISupportsInterning\n\t{\n\t\treadonly IConstantValue baseValue;\n\t\treadonly int incrementAmount;\n\t\t\n\t\tpublic IncrementConstantValue(IConstantValue baseValue, int incrementAmount = 1)\n\t\t{\n\t\t\tif (baseValue == null)\n\t\t\t\tthrow new ArgumentNullException(\"baseValue\");\n\t\t\tIncrementConstantValue icv = baseValue as IncrementConstantValue;\n\t\t\tif (icv != null) {\n\t\t\t\tthis.baseValue = icv.baseValue;\n\t\t\t\tthis.incrementAmount = icv.incrementAmount + incrementAmount;\n\t\t\t} else {\n\t\t\t\tthis.baseValue = baseValue;\n\t\t\t\tthis.incrementAmount = incrementAmount;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\tResolveResult rr = baseValue.Resolve(context);\n\t\t\tif (rr.IsCompileTimeConstant && rr.ConstantValue != null) {\n\t\t\t\tobject val = rr.ConstantValue;\n\t\t\t\tTypeCode typeCode = Type.GetTypeCode(val.GetType());\n\t\t\t\tif (typeCode >= TypeCode.SByte && typeCode <= TypeCode.UInt64) {\n\t\t\t\t\tlong intVal = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, val, false);\n\t\t\t\t\tobject newVal = CSharpPrimitiveCast.Cast(typeCode, unchecked(intVal + incrementAmount), false);\n\t\t\t\t\treturn new ConstantResolveResult(rr.Type, newVal);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new ErrorResolveResult(rr.Type);\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn baseValue.GetHashCode() * 33 ^ incrementAmount;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tIncrementConstantValue o = other as IncrementConstantValue;\n\t\t\treturn o != null && baseValue == o.baseValue && incrementAmount == o.incrementAmount;\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// C#'s equivalent to the SimpleConstantValue.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class PrimitiveConstantExpression : ConstantExpression, ISupportsInterning\n\t{\n\t\treadonly ITypeReference type;\n\t\treadonly object value;\n\t\t\n\t\tpublic ITypeReference Type {\n\t\t\tget { return type; }\n\t\t}\n\t\t\n\t\tpublic object Value {\n\t\t\tget { return value; }\n\t\t}\n\t\t\n\t\tpublic PrimitiveConstantExpression(ITypeReference type, object value)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tthis.type = type;\n\t\t\tthis.value = value;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn new ConstantResolveResult(type.Resolve(resolver.CurrentTypeResolveContext), value);\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn type.GetHashCode() ^ (value != null ? value.GetHashCode() : 0);\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tPrimitiveConstantExpression scv = other as PrimitiveConstantExpression;\n\t\t\treturn scv != null && type == scv.type && value == scv.value;\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class TypeOfConstantExpression : ConstantExpression\n\t{\n\t\treadonly ITypeReference type;\n\t\t\n\t\tpublic ITypeReference Type {\n\t\t\tget { return type; }\n\t\t}\n\t\t\n\t\tpublic TypeOfConstantExpression(ITypeReference type)\n\t\t{\n\t\t\tthis.type = type;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn resolver.ResolveTypeOf(type.Resolve(resolver.CurrentTypeResolveContext));\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ConstantCast : ConstantExpression, ISupportsInterning\n\t{\n\t\treadonly ITypeReference targetType;\n\t\treadonly ConstantExpression expression;\n\t\treadonly bool allowNullableConstants;\n\t\t\n\t\tpublic ConstantCast(ITypeReference targetType, ConstantExpression expression, bool allowNullableConstants)\n\t\t{\n\t\t\tif (targetType == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetType\");\n\t\t\tif (expression == null)\n\t\t\t\tthrow new ArgumentNullException(\"expression\");\n\t\t\tthis.targetType = targetType;\n\t\t\tthis.expression = expression;\n\t\t\tthis.allowNullableConstants = allowNullableConstants;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\tvar type = targetType.Resolve(resolver.CurrentTypeResolveContext);\n\t\t\tvar resolveResult = expression.Resolve(resolver);\n\t\t\tif (allowNullableConstants && NullableType.IsNullable(type)) {\n\t\t\t\tresolveResult = resolver.ResolveCast(NullableType.GetUnderlyingType(type), resolveResult);\n\t\t\t\tif (resolveResult.IsCompileTimeConstant)\n\t\t\t\t\treturn new ConstantResolveResult(type, resolveResult.ConstantValue);\n\t\t\t}\n\t\t\treturn resolver.ResolveCast(type, resolveResult);\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tunchecked {\n\t\t\t\treturn targetType.GetHashCode() + expression.GetHashCode() * 1018829;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tConstantCast cast = other as ConstantCast;\n\t\t\treturn cast != null\n\t\t\t\t&& this.targetType == cast.targetType && this.expression == cast.expression && this.allowNullableConstants == cast.allowNullableConstants;\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ConstantIdentifierReference : ConstantExpression\n\t{\n\t\treadonly string identifier;\n\t\treadonly IList<ITypeReference> typeArguments;\n\t\t\n\t\tpublic ConstantIdentifierReference(string identifier, IList<ITypeReference> typeArguments = null)\n\t\t{\n\t\t\tif (identifier == null)\n\t\t\t\tthrow new ArgumentNullException(\"identifier\");\n\t\t\tthis.identifier = identifier;\n\t\t\tthis.typeArguments = typeArguments ?? EmptyList<ITypeReference>.Instance;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn resolver.ResolveSimpleName(identifier, typeArguments.Resolve(resolver.CurrentTypeResolveContext));\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ConstantMemberReference : ConstantExpression\n\t{\n\t\treadonly ITypeReference targetType;\n\t\treadonly ConstantExpression targetExpression;\n\t\treadonly string memberName;\n\t\treadonly IList<ITypeReference> typeArguments;\n\t\t\n\t\tpublic ConstantMemberReference(ITypeReference targetType, string memberName, IList<ITypeReference> typeArguments = null)\n\t\t{\n\t\t\tif (targetType == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetType\");\n\t\t\tif (memberName == null)\n\t\t\t\tthrow new ArgumentNullException(\"memberName\");\n\t\t\tthis.targetType = targetType;\n\t\t\tthis.memberName = memberName;\n\t\t\tthis.typeArguments = typeArguments ?? EmptyList<ITypeReference>.Instance;\n\t\t}\n\t\t\n\t\tpublic ConstantMemberReference(ConstantExpression targetExpression, string memberName, IList<ITypeReference> typeArguments = null)\n\t\t{\n\t\t\tif (targetExpression == null)\n\t\t\t\tthrow new ArgumentNullException(\"targetExpression\");\n\t\t\tif (memberName == null)\n\t\t\t\tthrow new ArgumentNullException(\"memberName\");\n\t\t\tthis.targetExpression = targetExpression;\n\t\t\tthis.memberName = memberName;\n\t\t\tthis.typeArguments = typeArguments ?? EmptyList<ITypeReference>.Instance;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\tResolveResult rr;\n\t\t\tif (targetType != null)\n\t\t\t\trr = new TypeResolveResult(targetType.Resolve(resolver.CurrentTypeResolveContext));\n\t\t\telse\n\t\t\t\trr = targetExpression.Resolve(resolver);\n\t\t\treturn resolver.ResolveMemberAccess(rr, memberName, typeArguments.Resolve(resolver.CurrentTypeResolveContext));\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ConstantCheckedExpression : ConstantExpression\n\t{\n\t\treadonly bool checkForOverflow;\n\t\treadonly ConstantExpression expression;\n\t\t\n\t\tpublic ConstantCheckedExpression(bool checkForOverflow, ConstantExpression expression)\n\t\t{\n\t\t\tif (expression == null)\n\t\t\t\tthrow new ArgumentNullException(\"expression\");\n\t\t\tthis.checkForOverflow = checkForOverflow;\n\t\t\tthis.expression = expression;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn expression.Resolve(resolver.WithCheckForOverflow(checkForOverflow));\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ConstantDefaultValue : ConstantExpression, ISupportsInterning\n\t{\n\t\treadonly ITypeReference type;\n\t\t\n\t\tpublic ConstantDefaultValue(ITypeReference type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tthis.type = type;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn resolver.ResolveDefaultValue(type.Resolve(resolver.CurrentTypeResolveContext));\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn type.GetHashCode();\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tConstantDefaultValue o = other as ConstantDefaultValue;\n\t\t\treturn o != null && this.type == o.type;\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ConstantUnaryOperator : ConstantExpression\n\t{\n\t\treadonly UnaryOperatorType operatorType;\n\t\treadonly ConstantExpression expression;\n\t\t\n\t\tpublic ConstantUnaryOperator(UnaryOperatorType operatorType, ConstantExpression expression)\n\t\t{\n\t\t\tif (expression == null)\n\t\t\t\tthrow new ArgumentNullException(\"expression\");\n\t\t\tthis.operatorType = operatorType;\n\t\t\tthis.expression = expression;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn resolver.ResolveUnaryOperator(operatorType, expression.Resolve(resolver));\n\t\t}\n\t}\n\n\t[Serializable]\n\tpublic sealed class ConstantBinaryOperator : ConstantExpression\n\t{\n\t\treadonly ConstantExpression left;\n\t\treadonly BinaryOperatorType operatorType;\n\t\treadonly ConstantExpression right;\n\t\t\n\t\tpublic ConstantBinaryOperator(ConstantExpression left, BinaryOperatorType operatorType, ConstantExpression right)\n\t\t{\n\t\t\tif (left == null)\n\t\t\t\tthrow new ArgumentNullException(\"left\");\n\t\t\tif (right == null)\n\t\t\t\tthrow new ArgumentNullException(\"right\");\n\t\t\tthis.left = left;\n\t\t\tthis.operatorType = operatorType;\n\t\t\tthis.right = right;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\tResolveResult lhs = left.Resolve(resolver);\n\t\t\tResolveResult rhs = right.Resolve(resolver);\n\t\t\treturn resolver.ResolveBinaryOperator(operatorType, lhs, rhs);\n\t\t}\n\t}\n\t\n\t[Serializable]\n\tpublic sealed class ConstantConditionalOperator : ConstantExpression\n\t{\n\t\treadonly ConstantExpression condition, trueExpr, falseExpr;\n\t\t\n\t\tpublic ConstantConditionalOperator(ConstantExpression condition, ConstantExpression trueExpr, ConstantExpression falseExpr)\n\t\t{\n\t\t\tif (condition == null)\n\t\t\t\tthrow new ArgumentNullException(\"condition\");\n\t\t\tif (trueExpr == null)\n\t\t\t\tthrow new ArgumentNullException(\"trueExpr\");\n\t\t\tif (falseExpr == null)\n\t\t\t\tthrow new ArgumentNullException(\"falseExpr\");\n\t\t\tthis.condition = condition;\n\t\t\tthis.trueExpr = trueExpr;\n\t\t\tthis.falseExpr = falseExpr;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn resolver.ResolveConditional(\n\t\t\t\tcondition.Resolve(resolver),\n\t\t\t\ttrueExpr.Resolve(resolver),\n\t\t\t\tfalseExpr.Resolve(resolver)\n\t\t\t);\n\t\t}\n\t}\n\t\n\t/// <summary>\n\t/// Represents an array creation (as used within an attribute argument)\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class ConstantArrayCreation : ConstantExpression\n\t{\n\t\t// type may be null when the element is being inferred\n\t\treadonly ITypeReference elementType;\n\t\treadonly IList<ConstantExpression> arrayElements;\n\t\t\n\t\tpublic ConstantArrayCreation(ITypeReference type, IList<ConstantExpression> arrayElements)\n\t\t{\n\t\t\tif (arrayElements == null)\n\t\t\t\tthrow new ArgumentNullException(\"arrayElements\");\n\t\t\tthis.elementType = type;\n\t\t\tthis.arrayElements = arrayElements;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\tResolveResult[] elements = new ResolveResult[arrayElements.Count];\n\t\t\tfor (int i = 0; i < elements.Length; i++) {\n\t\t\t\telements[i] = arrayElements[i].Resolve(resolver);\n\t\t\t}\n\t\t\tint[] sizeArguments = { elements.Length };\n\t\t\tif (elementType != null) {\n\t\t\t\treturn resolver.ResolveArrayCreation(elementType.Resolve(resolver.CurrentTypeResolveContext), sizeArguments, elements);\n\t\t\t} else {\n\t\t\t\treturn resolver.ResolveArrayCreation(null, sizeArguments, elements);\n\t\t\t}\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Used for sizeof() expressions in constants.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class SizeOfConstantValue : ConstantExpression\n\t{\n\t\treadonly ITypeReference type;\n\t\t\n\t\tpublic SizeOfConstantValue(ITypeReference type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tthis.type = type;\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\treturn resolver.ResolveSizeOf(type.Resolve(resolver.CurrentTypeResolveContext));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/MemberTypeOrNamespaceReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Reference to a qualified type or namespace name.\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class MemberTypeOrNamespaceReference : TypeOrNamespaceReference, ISupportsInterning\n\t{\n\t\treadonly TypeOrNamespaceReference target;\n\t\treadonly string identifier;\n\t\treadonly IList<ITypeReference> typeArguments;\n\t\treadonly NameLookupMode lookupMode;\n\t\t\n\t\tpublic MemberTypeOrNamespaceReference(TypeOrNamespaceReference target, string identifier, IList<ITypeReference> typeArguments, NameLookupMode lookupMode = NameLookupMode.Type)\n\t\t{\n\t\t\tif (target == null)\n\t\t\t\tthrow new ArgumentNullException(\"target\");\n\t\t\tif (identifier == null)\n\t\t\t\tthrow new ArgumentNullException(\"identifier\");\n\t\t\tthis.target = target;\n\t\t\tthis.identifier = identifier;\n\t\t\tthis.typeArguments = typeArguments ?? EmptyList<ITypeReference>.Instance;\n\t\t\tthis.lookupMode = lookupMode;\n\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget { return identifier; }\n\t\t}\n\t\t\n\t\tpublic TypeOrNamespaceReference Target {\n\t\t\tget { return target; }\n\t\t}\n\t\t\n\t\tpublic IList<ITypeReference> TypeArguments {\n\t\t\tget { return typeArguments; }\n\t\t}\n\t\t\n\t\tpublic NameLookupMode LookupMode {\n\t\t\tget { return lookupMode; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds a suffix to the identifier.\n\t\t/// Does not modify the existing type reference, but returns a new one.\n\t\t/// </summary>\n\t\tpublic MemberTypeOrNamespaceReference AddSuffix(string suffix)\n\t\t{\n\t\t\treturn new MemberTypeOrNamespaceReference(target, identifier + suffix, typeArguments, lookupMode);\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\tResolveResult targetRR = target.Resolve(resolver);\n\t\t\tif (targetRR.IsError)\n\t\t\t\treturn targetRR;\n\t\t\tIList<IType> typeArgs = typeArguments.Resolve(resolver.CurrentTypeResolveContext);\n\t\t\treturn resolver.ResolveMemberAccess(targetRR, identifier, typeArgs, lookupMode);\n\t\t}\n\t\t\n\t\tpublic override IType ResolveType(CSharpResolver resolver)\n\t\t{\n\t\t\tTypeResolveResult trr = Resolve(resolver) as TypeResolveResult;\n\t\t\treturn trr != null ? trr.Type : new UnknownType(null, identifier, typeArguments.Count);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (typeArguments.Count == 0)\n\t\t\t\treturn target.ToString() + \".\" + identifier;\n\t\t\telse\n\t\t\t\treturn target.ToString() + \".\" + identifier + \"<\" + string.Join(\",\", typeArguments) + \">\";\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tint hashCode = 0;\n\t\t\tunchecked {\n\t\t\t\thashCode += 1000000007 * target.GetHashCode();\n\t\t\t\thashCode += 1000000033 * identifier.GetHashCode();\n\t\t\t\thashCode += 1000000087 * typeArguments.GetHashCode();\n\t\t\t\thashCode += 1000000021 * (int)lookupMode;\n\t\t\t}\n\t\t\treturn hashCode;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tMemberTypeOrNamespaceReference o = other as MemberTypeOrNamespaceReference;\n\t\t\treturn o != null && this.target == o.target\n\t\t\t\t&& this.identifier == o.identifier && this.typeArguments == o.typeArguments\n\t\t\t\t&& this.lookupMode == o.lookupMode;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/MethodTypeParameterWithInheritedConstraints.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t[Serializable]\n\tpublic sealed class MethodTypeParameterWithInheritedConstraints : DefaultUnresolvedTypeParameter\n\t{\n\t\tpublic MethodTypeParameterWithInheritedConstraints(int index, string name)\n\t\t\t: base(SymbolKind.Method, index, name)\n\t\t{\n\t\t}\n\t\t\n\t\tstatic ITypeParameter ResolveBaseTypeParameter(IMethod parentMethod, int index)\n\t\t{\n\t\t\tIMethod baseMethod = null;\n\t\t\tif (parentMethod.IsOverride) {\n\t\t\t\tforeach (IMethod m in InheritanceHelper.GetBaseMembers(parentMethod, false).OfType<IMethod>()) {\n\t\t\t\t\tif (!m.IsOverride) {\n\t\t\t\t\t\tbaseMethod = m;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (parentMethod.IsExplicitInterfaceImplementation && parentMethod.ImplementedInterfaceMembers.Count == 1) {\n\t\t\t\tbaseMethod = parentMethod.ImplementedInterfaceMembers[0] as IMethod;\n\t\t\t}\n\t\t\tif (baseMethod != null && index < baseMethod.TypeParameters.Count)\n\t\t\t\treturn baseMethod.TypeParameters[index];\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override ITypeParameter CreateResolvedTypeParameter(ITypeResolveContext context)\n\t\t{\n\t\t\tif (context.CurrentMember is IMethod) {\n\t\t\t\treturn new ResolvedMethodTypeParameterWithInheritedConstraints(this, context);\n\t\t\t} else {\n\t\t\t\treturn base.CreateResolvedTypeParameter(context);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class ResolvedMethodTypeParameterWithInheritedConstraints : AbstractTypeParameter\n\t\t{\n\t\t\tvolatile ITypeParameter baseTypeParameter;\n\t\t\t\n\t\t\tpublic ResolvedMethodTypeParameterWithInheritedConstraints(MethodTypeParameterWithInheritedConstraints unresolved, ITypeResolveContext context)\n\t\t\t\t: base(context.CurrentMember, unresolved.Index, unresolved.Name, unresolved.Variance,\n\t\t\t\t       unresolved.Attributes.CreateResolvedAttributes(context), unresolved.Region)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tITypeParameter GetBaseTypeParameter()\n\t\t\t{\n\t\t\t\tITypeParameter baseTP = this.baseTypeParameter;\n\t\t\t\tif (baseTP == null) {\n\t\t\t\t\t// ResolveBaseTypeParameter() is idempotent, so this is thread-safe.\n\t\t\t\t\tthis.baseTypeParameter = baseTP = ResolveBaseTypeParameter((IMethod)this.Owner, this.Index);\n\t\t\t\t}\n\t\t\t\treturn baseTP;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasValueTypeConstraint {\n\t\t\t\tget {\n\t\t\t\t\tITypeParameter baseTP = GetBaseTypeParameter();\n\t\t\t\t\treturn baseTP != null ? baseTP.HasValueTypeConstraint : false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasReferenceTypeConstraint {\n\t\t\t\tget {\n\t\t\t\t\tITypeParameter baseTP = GetBaseTypeParameter();\n\t\t\t\t\treturn baseTP != null ? baseTP.HasReferenceTypeConstraint : false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasDefaultConstructorConstraint {\n\t\t\t\tget {\n\t\t\t\t\tITypeParameter baseTP = GetBaseTypeParameter();\n\t\t\t\t\treturn baseTP != null ? baseTP.HasDefaultConstructorConstraint : false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IEnumerable<IType> DirectBaseTypes {\n\t\t\t\tget {\n\t\t\t\t\tITypeParameter baseTP = GetBaseTypeParameter();\n\t\t\t\t\tif (baseTP != null) {\n\t\t\t\t\t\t// Substitute occurrences of the base method's type parameters in the constraints\n\t\t\t\t\t\t// with the type parameters from the\n\t\t\t\t\t\tIMethod owner = (IMethod)this.Owner;\n\t\t\t\t\t\tvar substitution = new TypeParameterSubstitution(null, new ProjectedList<ITypeParameter, IType>(owner.TypeParameters, t => t));\n\t\t\t\t\t\treturn baseTP.DirectBaseTypes.Select(t => t.AcceptVisitor(substitution));\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn EmptyList<IType>.Instance;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Resolved version of using scope.\n\t/// </summary>\n\tpublic class ResolvedUsingScope\n\t{\n\t\treadonly CSharpTypeResolveContext parentContext;\n\t\treadonly UsingScope usingScope;\n\t\t\n\t\tinternal readonly ConcurrentDictionary<string, ResolveResult> ResolveCache = new ConcurrentDictionary<string, ResolveResult>();\n\t\tinternal List<List<IMethod>> AllExtensionMethods;\n\t\t\n\t\tpublic ResolvedUsingScope(CSharpTypeResolveContext context, UsingScope usingScope)\n\t\t{\n\t\t\tif (context == null)\n\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\tif (usingScope == null)\n\t\t\t\tthrow new ArgumentNullException(\"usingScope\");\n\t\t\tthis.parentContext = context;\n\t\t\tthis.usingScope = usingScope;\n\t\t\tif (usingScope.Parent != null) {\n\t\t\t\tif (context.CurrentUsingScope == null)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t} else {\n\t\t\t\tif (context.CurrentUsingScope != null)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic UsingScope UnresolvedUsingScope {\n\t\t\tget { return usingScope; }\n\t\t}\n\t\t\n\t\tINamespace @namespace;\n\t\t\n\t\tpublic INamespace Namespace {\n\t\t\tget {\n\t\t\t\tINamespace result = LazyInit.VolatileRead(ref this.@namespace);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tif (parentContext.CurrentUsingScope != null) {\n\t\t\t\t\t\tresult = parentContext.CurrentUsingScope.Namespace.GetChildNamespace(usingScope.ShortNamespaceName);\n\t\t\t\t\t\tif (result == null)\n\t\t\t\t\t\t\tresult = new DummyNamespace(parentContext.CurrentUsingScope.Namespace, usingScope.ShortNamespaceName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = parentContext.Compilation.RootNamespace;\n\t\t\t\t\t}\n\t\t\t\t\tDebug.Assert(result != null);\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.@namespace, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ResolvedUsingScope Parent {\n\t\t\tget { return parentContext.CurrentUsingScope; }\n\t\t}\n\t\t\n\t\tIList<INamespace> usings;\n\t\t\n\t\tpublic IList<INamespace> Usings {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.usings);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tresult = new List<INamespace>();\n\t\t\t\t\tCSharpResolver resolver = new CSharpResolver(parentContext.WithUsingScope(this));\n\t\t\t\t\tforeach (var u in usingScope.Usings) {\n\t\t\t\t\t\tINamespace ns = u.ResolveNamespace(resolver);\n\t\t\t\t\t\tif (ns != null && !result.Contains(ns))\n\t\t\t\t\t\t\tresult.Add(ns);\n\t\t\t\t\t}\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.usings, new ReadOnlyCollection<INamespace>(result));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<KeyValuePair<string, ResolveResult>> usingAliases;\n\t\t\n\t\tpublic IList<KeyValuePair<string, ResolveResult>> UsingAliases {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.usingAliases);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tCSharpResolver resolver = new CSharpResolver(parentContext.WithUsingScope(this));\n\t\t\t\t\tresult = new KeyValuePair<string, ResolveResult>[usingScope.UsingAliases.Count];\n\t\t\t\t\tfor (int i = 0; i < result.Count; i++) {\n\t\t\t\t\t\tvar rr = usingScope.UsingAliases[i].Value.Resolve(resolver);\n\t\t\t\t\t\tif (rr is TypeResolveResult) {\n\t\t\t\t\t\t\trr = new AliasTypeResolveResult (usingScope.UsingAliases[i].Key, (TypeResolveResult)rr);\n\t\t\t\t\t\t} else if (rr is NamespaceResolveResult) {\n\t\t\t\t\t\t\trr = new AliasNamespaceResolveResult (usingScope.UsingAliases[i].Key, (NamespaceResolveResult)rr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult[i] = new KeyValuePair<string, ResolveResult>(\n\t\t\t\t\t\t\tusingScope.UsingAliases[i].Key,\n\t\t\t\t\t\t\trr\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.usingAliases, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<string> ExternAliases {\n\t\t\tget { return usingScope.ExternAliases; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this using scope has an alias (either using or extern)\n\t\t/// with the specified name.\n\t\t/// </summary>\n\t\tpublic bool HasAlias(string identifier)\n\t\t{\n\t\t\treturn usingScope.HasAlias(identifier);\n\t\t}\n\t\t\n\t\tsealed class DummyNamespace : INamespace\n\t\t{\n\t\t\treadonly INamespace parentNamespace;\n\t\t\treadonly string name;\n\t\t\t\n\t\t\tpublic DummyNamespace(INamespace parentNamespace, string name)\n\t\t\t{\n\t\t\t\tthis.parentNamespace = parentNamespace;\n\t\t\t\tthis.name = name;\n\t\t\t}\n\t\t\t\n\t\t\tpublic string ExternAlias { get; set; }\n\t\t\t\n\t\t\tstring INamespace.FullName {\n\t\t\t\tget { return NamespaceDeclaration.BuildQualifiedName(parentNamespace.FullName, name); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic string Name {\n\t\t\t\tget { return name; }\n\t\t\t}\n\t\t\t\n\t\t\tSymbolKind ISymbol.SymbolKind {\n\t\t\t\tget { return SymbolKind.Namespace; }\n\t\t\t}\n\t\t\t\n\t\t\tINamespace INamespace.ParentNamespace {\n\t\t\t\tget { return parentNamespace; }\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<INamespace> INamespace.ChildNamespaces {\n\t\t\t\tget { return EmptyList<INamespace>.Instance; }\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<ITypeDefinition> INamespace.Types {\n\t\t\t\tget { return EmptyList<ITypeDefinition>.Instance; }\n\t\t\t}\n\t\t\t\n\t\t\tIEnumerable<IAssembly> INamespace.ContributingAssemblies {\n\t\t\t\tget { return EmptyList<IAssembly>.Instance; }\n\t\t\t}\n\t\t\t\n\t\t\tICompilation ICompilationProvider.Compilation {\n\t\t\t\tget { return parentNamespace.Compilation; }\n\t\t\t}\n\t\t\t\n\t\t\tINamespace INamespace.GetChildNamespace(string name)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tITypeDefinition INamespace.GetTypeDefinition(string name, int typeParameterCount)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic ISymbolReference ToReference()\n\t\t\t{\n\t\t\t\treturn new MergedNamespaceReference(ExternAlias, ((INamespace)this).FullName);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/SimpleTypeOrNamespaceReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\n\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a simple C# name. (a single non-qualified identifier with an optional list of type arguments)\n\t/// </summary>\n\t[Serializable]\n\tpublic sealed class SimpleTypeOrNamespaceReference : TypeOrNamespaceReference, ISupportsInterning\n\t{\n\t\treadonly string identifier;\n\t\treadonly IList<ITypeReference> typeArguments;\n\t\treadonly NameLookupMode lookupMode;\n\t\t\n\t\tpublic SimpleTypeOrNamespaceReference(string identifier, IList<ITypeReference> typeArguments, NameLookupMode lookupMode = NameLookupMode.Type)\n\t\t{\n\t\t\tif (identifier == null)\n\t\t\t\tthrow new ArgumentNullException(\"identifier\");\n\t\t\tthis.identifier = identifier;\n\t\t\tthis.typeArguments = typeArguments ?? EmptyList<ITypeReference>.Instance;\n\t\t\tthis.lookupMode = lookupMode;\n\t\t}\n\t\t\n\t\tpublic string Identifier {\n\t\t\tget { return identifier; }\n\t\t}\n\t\t\n\t\tpublic IList<ITypeReference> TypeArguments {\n\t\t\tget { return typeArguments; }\n\t\t}\n\t\t\n\t\tpublic NameLookupMode LookupMode {\n\t\t\tget { return lookupMode; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds a suffix to the identifier.\n\t\t/// Does not modify the existing type reference, but returns a new one.\n\t\t/// </summary>\n\t\tpublic SimpleTypeOrNamespaceReference AddSuffix(string suffix)\n\t\t{\n\t\t\treturn new SimpleTypeOrNamespaceReference(identifier + suffix, typeArguments, lookupMode);\n\t\t}\n\t\t\n\t\tpublic override ResolveResult Resolve(CSharpResolver resolver)\n\t\t{\n\t\t\tvar typeArgs = typeArguments.Resolve(resolver.CurrentTypeResolveContext);\n\t\t\treturn resolver.LookupSimpleNameOrTypeName(identifier, typeArgs, lookupMode);\n\t\t}\n\t\t\n\t\tpublic override IType ResolveType(CSharpResolver resolver)\n\t\t{\n\t\t\tTypeResolveResult trr = Resolve(resolver) as TypeResolveResult;\n\t\t\treturn trr != null ? trr.Type : new UnknownType(null, identifier, typeArguments.Count);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (typeArguments.Count == 0)\n\t\t\t\treturn identifier;\n\t\t\telse\n\t\t\t\treturn identifier + \"<\" + string.Join(\",\", typeArguments) + \">\";\n\t\t}\n\t\t\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\tint hashCode = 0;\n\t\t\tunchecked {\n\t\t\t\thashCode += 1000000021 * identifier.GetHashCode();\n\t\t\t\thashCode += 1000000033 * typeArguments.GetHashCode();\n\t\t\t\thashCode += 1000000087 * (int)lookupMode;\n\t\t\t}\n\t\t\treturn hashCode;\n\t\t}\n\t\t\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tSimpleTypeOrNamespaceReference o = other as SimpleTypeOrNamespaceReference;\n\t\t\treturn o != null && this.identifier == o.identifier\n\t\t\t\t&& this.typeArguments == o.typeArguments && this.lookupMode == o.lookupMode;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/TypeOrNamespaceReference.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a reference which could point to a type or namespace.\n\t/// </summary>\n\t[Serializable]\n\tpublic abstract class TypeOrNamespaceReference : ITypeReference\n\t{\n\t\t/// <summary>\n\t\t/// Resolves the reference and returns the ResolveResult.\n\t\t/// </summary>\n\t\tpublic abstract ResolveResult Resolve(CSharpResolver resolver);\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the type that is referenced; or an <c>UnknownType</c> if the type isn't found.\n\t\t/// </summary>\n\t\tpublic abstract IType ResolveType(CSharpResolver resolver);\n\t\t\n\t\t/// <summary>\n\t\t/// Returns the namespace that is referenced; or null if no such namespace is found.\n\t\t/// </summary>\n\t\tpublic INamespace ResolveNamespace(CSharpResolver resolver)\n\t\t{\n\t\t\tNamespaceResolveResult nrr = Resolve(resolver) as NamespaceResolveResult;\n\t\t\treturn nrr != null ? nrr.Namespace : null;\n\t\t}\n\t\t\n\t\tIType ITypeReference.Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\t// Strictly speaking, we might have to resolve the type in a nested compilation, similar\n\t\t\t// to what we're doing with ConstantExpression.\n\t\t\t// However, in almost all cases this will work correctly - if the resulting type is only available in the\n\t\t\t// nested compilation and not in this, we wouldn't be able to map it anyways.\n\t\t\tvar ctx = context as CSharpTypeResolveContext;\n\t\t\tif (ctx == null) {\n\t\t\t\tctx = new CSharpTypeResolveContext(context.CurrentAssembly ?? context.Compilation.MainAssembly, null, context.CurrentTypeDefinition, context.CurrentMember);\n\t\t\t}\n\t\t\treturn ResolveType(new CSharpResolver(ctx));\n\t\t\t\n\t\t\t// A potential issue might be this scenario:\n\t\t\t\n\t\t\t// Assembly 1:\n\t\t\t//  class A { public class Nested {} }\n\t\t\t\n\t\t\t// Assembly 2: (references asm 1)\n\t\t\t//  class B : A {}\n\t\t\t\n\t\t\t// Assembly 3: (references asm 1 and 2)\n\t\t\t//  class C { public B.Nested Field; }\n\t\t\t\n\t\t\t// Assembly 4: (references asm 1 and 3, but not 2):\n\t\t\t//  uses C.Field;\n\t\t\t\n\t\t\t// Here we would not be able to resolve 'B.Nested' in the compilation of assembly 4, as type B is missing there.\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/TypeSystemConvertVisitor.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem.ConstantValues;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Produces type and member definitions from the DOM.\n\t/// </summary>\n\tpublic class TypeSystemConvertVisitor : DepthFirstAstVisitor<IUnresolvedEntity>\n\t{\n\t\t/// <summary>\n\t\t/// Version of the C# type system loader.\n\t\t/// Should be incremented when fixing bugs so that project contents cached on disk\n\t\t/// (which might be incorrect due to the bug) are re-created.\n\t\t/// </summary>\n\t\tinternal const int version = 2;\n\t\t\n\t\treadonly CSharpUnresolvedFile unresolvedFile;\n\t\tUsingScope usingScope;\n\t\tCSharpUnresolvedTypeDefinition currentTypeDefinition;\n\t\tDefaultUnresolvedMethod currentMethod;\n\t\t\n\t\tInterningProvider interningProvider = new SimpleInterningProvider();\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets the interning provider to use.\n\t\t/// The default value is a new <see cref=\"SimpleInterningProvider\"/> instance.\n\t\t/// </summary>\n\t\tpublic InterningProvider InterningProvider {\n\t\t\tget { return interningProvider; }\n\t\t\tset {\n\t\t\t\tif (interningProvider == null)\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\tinterningProvider = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets/Sets whether to ignore XML documentation.\n\t\t/// The default value is false.\n\t\t/// </summary>\n\t\tpublic bool SkipXmlDocumentation { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new TypeSystemConvertVisitor.\n\t\t/// </summary>\n\t\t/// <param name=\"fileName\">The file name (used for DomRegions).</param>\n\t\tpublic TypeSystemConvertVisitor(string fileName)\n\t\t{\n\t\t\tif (fileName == null)\n\t\t\t\tthrow new ArgumentNullException(\"fileName\");\n\t\t\tthis.unresolvedFile = new CSharpUnresolvedFile();\n\t\t\tthis.unresolvedFile.FileName = fileName;\n\t\t\tthis.usingScope = unresolvedFile.RootUsingScope;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new TypeSystemConvertVisitor and initializes it with a given context.\n\t\t/// </summary>\n\t\t/// <param name=\"unresolvedFile\">The parsed file to which members should be added.</param>\n\t\t/// <param name=\"currentUsingScope\">The current using scope.</param>\n\t\t/// <param name=\"currentTypeDefinition\">The current type definition.</param>\n\t\tpublic TypeSystemConvertVisitor(CSharpUnresolvedFile unresolvedFile, UsingScope currentUsingScope = null, CSharpUnresolvedTypeDefinition currentTypeDefinition = null)\n\t\t{\n\t\t\tif (unresolvedFile == null)\n\t\t\t\tthrow new ArgumentNullException(\"unresolvedFile\");\n\t\t\tthis.unresolvedFile = unresolvedFile;\n\t\t\tthis.usingScope = currentUsingScope ?? unresolvedFile.RootUsingScope;\n\t\t\tthis.currentTypeDefinition = currentTypeDefinition;\n\t\t}\n\t\t\n\t\tpublic CSharpUnresolvedFile UnresolvedFile {\n\t\t\tget { return unresolvedFile; }\n\t\t}\n\t\t\n\t\tDomRegion MakeRegion(TextLocation start, TextLocation end)\n\t\t{\n\t\t\treturn new DomRegion(unresolvedFile.FileName, start.Line, start.Column, end.Line, end.Column);\n\t\t}\n\t\t\n\t\tDomRegion MakeRegion(AstNode node)\n\t\t{\n\t\t\tif (node == null || node.IsNull)\n\t\t\t\treturn DomRegion.Empty;\n\t\t\telse\n\t\t\t\treturn MakeRegion(GetStartLocationAfterAttributes(node), node.EndLocation);\n\t\t}\n\t\t\n\t\tinternal static TextLocation GetStartLocationAfterAttributes(AstNode node)\n\t\t{\n\t\t\tAstNode child = node.FirstChild;\n\t\t\t// Skip attributes and comments between attributes for the purpose of\n\t\t\t// getting a declaration's region.\n\t\t\twhile (child != null && (child is AttributeSection || child.NodeType == NodeType.Whitespace))\n\t\t\t\tchild = child.NextSibling;\n\t\t\treturn (child ?? node).StartLocation;\n\t\t}\n\t\t\n\t\tDomRegion MakeBraceRegion(AstNode node)\n\t\t{\n\t\t\tif (node == null || node.IsNull)\n\t\t\t\treturn DomRegion.Empty;\n\t\t\telse\n\t\t\t\treturn MakeRegion(node.GetChildByRole(Roles.LBrace).StartLocation,\n\t\t\t\t                  node.GetChildByRole(Roles.RBrace).EndLocation);\n\t\t}\n\t\t\n\t\t#region Compilation Unit\n\t\tpublic override IUnresolvedEntity VisitSyntaxTree (SyntaxTree unit)\n\t\t{\n\t\t\tunresolvedFile.Errors = unit.Errors;\n\t\t\treturn base.VisitSyntaxTree (unit);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Using Declarations\n\t\tpublic override IUnresolvedEntity VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t{\n\t\t\tusingScope.ExternAliases.Add(externAliasDeclaration.Name);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t{\n\t\t\tvar u = ConvertTypeReference(usingDeclaration.Import, NameLookupMode.TypeInUsingDeclaration) as TypeOrNamespaceReference;\n\t\t\tif (u != null) {\n\t\t\t\tusingScope.Usings.Add(u);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitUsingAliasDeclaration(UsingAliasDeclaration usingDeclaration)\n\t\t{\n\t\t\tTypeOrNamespaceReference u = ConvertTypeReference(usingDeclaration.Import, NameLookupMode.TypeInUsingDeclaration) as TypeOrNamespaceReference;\n\t\t\tif (u != null) {\n\t\t\t\tusingScope.UsingAliases.Add(new KeyValuePair<string, TypeOrNamespaceReference>(usingDeclaration.Alias, u));\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Namespace Declaration\n\t\tpublic override IUnresolvedEntity VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t{\n\t\t\tDomRegion region = MakeRegion(namespaceDeclaration);\n\t\t\tUsingScope previousUsingScope = usingScope;\n\t\t\tforeach (var ident in namespaceDeclaration.Identifiers) {\n\t\t\t\tusingScope = new UsingScope(usingScope, ident);\n\t\t\t\tusingScope.Region = region;\n\t\t\t}\n\t\t\tbase.VisitNamespaceDeclaration(namespaceDeclaration);\n\t\t\tunresolvedFile.UsingScopes.Add(usingScope); // add after visiting children so that nested scopes come first\n\t\t\tusingScope = previousUsingScope;\n\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type Definitions\n\t\tCSharpUnresolvedTypeDefinition CreateTypeDefinition(string name)\n\t\t{\n\t\t\tCSharpUnresolvedTypeDefinition newType;\n\t\t\tif (currentTypeDefinition != null) {\n\t\t\t\tnewType = new CSharpUnresolvedTypeDefinition(currentTypeDefinition, name);\n\t\t\t\tforeach (var typeParameter in currentTypeDefinition.TypeParameters)\n\t\t\t\t\tnewType.TypeParameters.Add(typeParameter);\n\t\t\t\tcurrentTypeDefinition.NestedTypes.Add(newType);\n\t\t\t} else {\n\t\t\t\tnewType = new CSharpUnresolvedTypeDefinition(usingScope, name);\n\t\t\t\tunresolvedFile.TopLevelTypeDefinitions.Add(newType);\n\t\t\t}\n\t\t\tnewType.UnresolvedFile = unresolvedFile;\n\t\t\tnewType.HasExtensionMethods = false; // gets set to true when an extension method is added\n\t\t\treturn newType;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\tvar td = currentTypeDefinition = CreateTypeDefinition(typeDeclaration.Name);\n\t\t\ttd.Region = MakeRegion(typeDeclaration);\n\t\t\ttd.BodyRegion = MakeBraceRegion(typeDeclaration);\n\t\t\tAddXmlDocumentation(td, typeDeclaration);\n\t\t\t\n\t\t\tApplyModifiers(td, typeDeclaration.Modifiers);\n\t\t\tswitch (typeDeclaration.ClassType) {\n\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\ttd.Kind = TypeKind.Enum;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\ttd.Kind = TypeKind.Interface;\n\t\t\t\t\ttd.IsAbstract = true; // interfaces are implicitly abstract\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\ttd.Kind = TypeKind.Struct;\n\t\t\t\t\ttd.IsSealed = true; // enums/structs are implicitly sealed\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tConvertAttributes(td.Attributes, typeDeclaration.Attributes);\n\t\t\t\n\t\t\tConvertTypeParameters(td.TypeParameters, typeDeclaration.TypeParameters, typeDeclaration.Constraints, SymbolKind.TypeDefinition);\n\t\t\t\n\t\t\tforeach (AstType baseType in typeDeclaration.BaseTypes) {\n\t\t\t\ttd.BaseTypes.Add(ConvertTypeReference(baseType, NameLookupMode.BaseTypeReference));\n\t\t\t}\n\t\t\t\n\t\t\tforeach (EntityDeclaration member in typeDeclaration.Members) {\n\t\t\t\tmember.AcceptVisitor(this);\n\t\t\t}\n\t\t\t\n\t\t\tcurrentTypeDefinition = (CSharpUnresolvedTypeDefinition)currentTypeDefinition.DeclaringTypeDefinition;\n\t\t\ttd.ApplyInterningProvider(interningProvider);\n\t\t\treturn td;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t{\n\t\t\tvar td = currentTypeDefinition = CreateTypeDefinition(delegateDeclaration.Name);\n\t\t\ttd.Kind = TypeKind.Delegate;\n\t\t\ttd.Region = MakeRegion(delegateDeclaration);\n\t\t\ttd.BaseTypes.Add(KnownTypeReference.MulticastDelegate);\n\t\t\tAddXmlDocumentation(td, delegateDeclaration);\n\t\t\t\n\t\t\tApplyModifiers(td, delegateDeclaration.Modifiers);\n\t\t\ttd.IsSealed = true; // delegates are implicitly sealed\n\t\t\t\n\t\t\tConvertTypeParameters(td.TypeParameters, delegateDeclaration.TypeParameters, delegateDeclaration.Constraints, SymbolKind.TypeDefinition);\n\t\t\t\n\t\t\tITypeReference returnType = ConvertTypeReference(delegateDeclaration.ReturnType);\n\t\t\tList<IUnresolvedParameter> parameters = new List<IUnresolvedParameter>();\n\t\t\tConvertParameters(parameters, delegateDeclaration.Parameters);\n\t\t\tAddDefaultMethodsToDelegate(td, returnType, parameters);\n\t\t\t\n\t\t\tforeach (AttributeSection section in delegateDeclaration.Attributes) {\n\t\t\t\tif (section.AttributeTarget == \"return\") {\n\t\t\t\t\tList<IUnresolvedAttribute> returnTypeAttributes = new List<IUnresolvedAttribute>();\n\t\t\t\t\tConvertAttributes(returnTypeAttributes, section);\n\t\t\t\t\tIUnresolvedMethod invokeMethod = (IUnresolvedMethod)td.Members.Single(m => m.Name == \"Invoke\");\n\t\t\t\t\tIUnresolvedMethod endInvokeMethod = (IUnresolvedMethod)td.Members.Single(m => m.Name == \"EndInvoke\");\n\t\t\t\t\tforeach (IUnresolvedAttribute attr in returnTypeAttributes) {\n\t\t\t\t\t\tinvokeMethod.ReturnTypeAttributes.Add(attr);\n\t\t\t\t\t\tendInvokeMethod.ReturnTypeAttributes.Add(attr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tConvertAttributes(td.Attributes, section);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tcurrentTypeDefinition = (CSharpUnresolvedTypeDefinition)currentTypeDefinition.DeclaringTypeDefinition;\n\t\t\ttd.ApplyInterningProvider(interningProvider);\n\t\t\treturn td;\n\t\t}\n\t\t\n\t\tstatic readonly IUnresolvedParameter delegateObjectParameter = MakeParameter(KnownTypeReference.Object, \"object\");\n\t\tstatic readonly IUnresolvedParameter delegateIntPtrMethodParameter = MakeParameter(KnownTypeReference.IntPtr, \"method\");\n\t\tstatic readonly IUnresolvedParameter delegateAsyncCallbackParameter = MakeParameter(typeof(AsyncCallback).ToTypeReference(), \"callback\");\n\t\tstatic readonly IUnresolvedParameter delegateResultParameter = MakeParameter(typeof(IAsyncResult).ToTypeReference(), \"result\");\n\t\t\n\t\tstatic IUnresolvedParameter MakeParameter(ITypeReference type, string name)\n\t\t{\n\t\t\tDefaultUnresolvedParameter p = new DefaultUnresolvedParameter(type, name);\n\t\t\tp.Freeze();\n\t\t\treturn p;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Adds the 'Invoke', 'BeginInvoke', 'EndInvoke' methods, and a constructor, to the <paramref name=\"delegateType\"/>.\n\t\t/// </summary>\n\t\tpublic static void AddDefaultMethodsToDelegate(DefaultUnresolvedTypeDefinition delegateType, ITypeReference returnType, IEnumerable<IUnresolvedParameter> parameters)\n\t\t{\n\t\t\tif (delegateType == null)\n\t\t\t\tthrow new ArgumentNullException(\"delegateType\");\n\t\t\tif (returnType == null)\n\t\t\t\tthrow new ArgumentNullException(\"returnType\");\n\t\t\tif (parameters == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameters\");\n\t\t\t\n\t\t\tDomRegion region = delegateType.Region;\n\t\t\tregion = new DomRegion(region.FileName, region.BeginLine, region.BeginColumn); // remove end position\n\t\t\t\n\t\t\tDefaultUnresolvedMethod invoke = new DefaultUnresolvedMethod(delegateType, \"Invoke\");\n\t\t\tinvoke.Accessibility = Accessibility.Public;\n\t\t\tinvoke.IsSynthetic = true;\n\t\t\tforeach (var p in parameters)\n\t\t\t\tinvoke.Parameters.Add(p);\n\t\t\tinvoke.ReturnType = returnType;\n\t\t\tinvoke.Region = region;\n\t\t\tdelegateType.Members.Add(invoke);\n\t\t\t\n\t\t\tDefaultUnresolvedMethod beginInvoke = new DefaultUnresolvedMethod(delegateType, \"BeginInvoke\");\n\t\t\tbeginInvoke.Accessibility = Accessibility.Public;\n\t\t\tbeginInvoke.IsSynthetic = true;\n\t\t\tforeach (var p in parameters)\n\t\t\t\tbeginInvoke.Parameters.Add(p);\n\t\t\tbeginInvoke.Parameters.Add(delegateAsyncCallbackParameter);\n\t\t\tbeginInvoke.Parameters.Add(delegateObjectParameter);\n\t\t\tbeginInvoke.ReturnType = delegateResultParameter.Type;\n\t\t\tbeginInvoke.Region = region;\n\t\t\tdelegateType.Members.Add(beginInvoke);\n\t\t\t\n\t\t\tDefaultUnresolvedMethod endInvoke = new DefaultUnresolvedMethod(delegateType, \"EndInvoke\");\n\t\t\tendInvoke.Accessibility = Accessibility.Public;\n\t\t\tendInvoke.IsSynthetic = true;\n\t\t\tendInvoke.Parameters.Add(delegateResultParameter);\n\t\t\tendInvoke.ReturnType = invoke.ReturnType;\n\t\t\tendInvoke.Region = region;\n\t\t\tdelegateType.Members.Add(endInvoke);\n\t\t\t\n\t\t\tDefaultUnresolvedMethod ctor = new DefaultUnresolvedMethod(delegateType, \".ctor\");\n\t\t\tctor.SymbolKind = SymbolKind.Constructor;\n\t\t\tctor.Accessibility = Accessibility.Public;\n\t\t\tctor.IsSynthetic = true;\n\t\t\tctor.Parameters.Add(delegateObjectParameter);\n\t\t\tctor.Parameters.Add(delegateIntPtrMethodParameter);\n\t\t\tctor.ReturnType = delegateType;\n\t\t\tctor.Region = region;\n\t\t\tdelegateType.Members.Add(ctor);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Fields\n\t\tpublic override IUnresolvedEntity VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tbool isSingleField = fieldDeclaration.Variables.Count == 1;\n\t\t\tModifiers modifiers = fieldDeclaration.Modifiers;\n\t\t\tDefaultUnresolvedField field = null;\n\t\t\tforeach (VariableInitializer vi in fieldDeclaration.Variables) {\n\t\t\t\tfield = new DefaultUnresolvedField(currentTypeDefinition, vi.Name);\n\t\t\t\t\n\t\t\t\tfield.Region = isSingleField ? MakeRegion(fieldDeclaration) : MakeRegion(vi);\n\t\t\t\tfield.BodyRegion = MakeRegion(vi);\n\t\t\t\tConvertAttributes(field.Attributes, fieldDeclaration.Attributes);\n\t\t\t\tAddXmlDocumentation(field, fieldDeclaration);\n\t\t\t\t\n\t\t\t\tApplyModifiers(field, modifiers);\n\t\t\t\tfield.IsVolatile = (modifiers & Modifiers.Volatile) != 0;\n\t\t\t\tfield.IsReadOnly = (modifiers & Modifiers.Readonly) != 0;\n\t\t\t\t\n\t\t\t\tfield.ReturnType = ConvertTypeReference(fieldDeclaration.ReturnType);\n\t\t\t\t\n\t\t\t\tif ((modifiers & Modifiers.Const) != 0) {\n\t\t\t\t\tfield.ConstantValue = ConvertConstantValue(field.ReturnType, vi.Initializer);\n\t\t\t\t\tfield.IsStatic = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentTypeDefinition.Members.Add(field);\n\t\t\t\tfield.ApplyInterningProvider(interningProvider);\n\t\t\t}\n\t\t\treturn isSingleField ? field : null;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t{\n\t\t\tbool isSingleField = fixedFieldDeclaration.Variables.Count == 1;\n\t\t\tModifiers modifiers = fixedFieldDeclaration.Modifiers;\n\t\t\tDefaultUnresolvedField field = null;\n\t\t\tforeach (var vi in fixedFieldDeclaration.Variables) {\n\t\t\t\tfield = new DefaultUnresolvedField(currentTypeDefinition, vi.Name);\n\n\t\t\t\tfield.Region = isSingleField ? MakeRegion(fixedFieldDeclaration) : MakeRegion(vi);\n\t\t\t\tfield.BodyRegion = MakeRegion(vi);\n\t\t\t\tConvertAttributes(field.Attributes, fixedFieldDeclaration.Attributes);\n\t\t\t\tAddXmlDocumentation(field, fixedFieldDeclaration);\n\n\t\t\t\tApplyModifiers(field, modifiers);\n\n\t\t\t\tfield.ReturnType = ConvertTypeReference(fixedFieldDeclaration.ReturnType);\n\t\t\t\tfield.IsFixed = true;\n\t\t\t\tfield.ConstantValue = ConvertConstantValue(field.ReturnType, vi.CountExpression);\n\n\t\t\t\tcurrentTypeDefinition.Members.Add(field);\n\t\t\t\tfield.ApplyInterningProvider(interningProvider);\n\t\t\t}\n\t\t\treturn isSingleField ? field : null;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t{\n\t\t\tDefaultUnresolvedField field = new DefaultUnresolvedField(currentTypeDefinition, enumMemberDeclaration.Name);\n\t\t\tfield.Region = field.BodyRegion = MakeRegion(enumMemberDeclaration);\n\t\t\tConvertAttributes(field.Attributes, enumMemberDeclaration.Attributes);\n\t\t\tAddXmlDocumentation(field, enumMemberDeclaration);\n\t\t\t\n\t\t\tif (currentTypeDefinition.TypeParameters.Count == 0) {\n\t\t\t\tfield.ReturnType = currentTypeDefinition;\n\t\t\t} else {\n\t\t\t\tITypeReference[] typeArgs = new ITypeReference[currentTypeDefinition.TypeParameters.Count];\n\t\t\t\tfor (int i = 0; i < typeArgs.Length; i++) {\n\t\t\t\t\ttypeArgs[i] = TypeParameterReference.Create(SymbolKind.TypeDefinition, i);\n\t\t\t\t}\n\t\t\t\tfield.ReturnType = interningProvider.Intern(new ParameterizedTypeReference(currentTypeDefinition, typeArgs));\n\t\t\t}\n\t\t\tfield.Accessibility = Accessibility.Public;\n\t\t\tfield.IsStatic = true;\n\t\t\tif (!enumMemberDeclaration.Initializer.IsNull) {\n\t\t\t\tfield.ConstantValue = ConvertConstantValue(field.ReturnType, enumMemberDeclaration.Initializer);\n\t\t\t} else {\n\t\t\t\tDefaultUnresolvedField prevField = currentTypeDefinition.Members.LastOrDefault() as DefaultUnresolvedField;\n\t\t\t\tif (prevField == null || prevField.ConstantValue == null) {\n\t\t\t\t\tfield.ConstantValue = ConvertConstantValue(field.ReturnType, new PrimitiveExpression(0));\n\t\t\t\t} else {\n\t\t\t\t\tfield.ConstantValue = interningProvider.Intern(new IncrementConstantValue(prevField.ConstantValue));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tcurrentTypeDefinition.Members.Add(field);\n\t\t\tfield.ApplyInterningProvider(interningProvider);\n\t\t\treturn field;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Methods\n\t\tpublic override IUnresolvedEntity VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tDefaultUnresolvedMethod m = new DefaultUnresolvedMethod(currentTypeDefinition, methodDeclaration.Name);\n\t\t\tcurrentMethod = m; // required for resolving type parameters\n\t\t\tm.Region = MakeRegion(methodDeclaration);\n\t\t\tm.BodyRegion = MakeRegion(methodDeclaration.Body);\n\t\t\tAddXmlDocumentation(m, methodDeclaration);\n\t\t\t\n\t\t\tif (InheritsConstraints(methodDeclaration) && methodDeclaration.Constraints.Count == 0) {\n\t\t\t\tint index = 0;\n\t\t\t\tforeach (TypeParameterDeclaration tpDecl in methodDeclaration.TypeParameters) {\n\t\t\t\t\tvar tp = new MethodTypeParameterWithInheritedConstraints(index++, tpDecl.Name);\n\t\t\t\t\ttp.Region = MakeRegion(tpDecl);\n\t\t\t\t\tConvertAttributes(tp.Attributes, tpDecl.Attributes);\n\t\t\t\t\ttp.Variance = tpDecl.Variance;\n\t\t\t\t\ttp.ApplyInterningProvider(interningProvider);\n\t\t\t\t\tm.TypeParameters.Add(tp);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tConvertTypeParameters(m.TypeParameters, methodDeclaration.TypeParameters, methodDeclaration.Constraints, SymbolKind.Method);\n\t\t\t}\n\t\t\tm.ReturnType = ConvertTypeReference(methodDeclaration.ReturnType);\n\t\t\tConvertAttributes(m.Attributes, methodDeclaration.Attributes.Where(s => s.AttributeTarget != \"return\"));\n\t\t\tConvertAttributes(m.ReturnTypeAttributes, methodDeclaration.Attributes.Where(s => s.AttributeTarget == \"return\"));\n\t\t\t\n\t\t\tApplyModifiers(m, methodDeclaration.Modifiers);\n\t\t\tif (methodDeclaration.IsExtensionMethod) {\n\t\t\t\tm.IsExtensionMethod = true;\n\t\t\t\tcurrentTypeDefinition.HasExtensionMethods = true;\n\t\t\t}\n\t\t\tm.IsPartial = methodDeclaration.HasModifier(Modifiers.Partial);\n\t\t\tm.IsAsync = methodDeclaration.HasModifier(Modifiers.Async);\n\n\t\t\tm.HasBody = !methodDeclaration.Body.IsNull;\n\t\t\t\n\t\t\tConvertParameters(m.Parameters, methodDeclaration.Parameters);\n\t\t\tif (!methodDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\tm.Accessibility = Accessibility.None;\n\t\t\t\tm.IsExplicitInterfaceImplementation = true;\n\t\t\t\tm.ExplicitInterfaceImplementations.Add(\n\t\t\t\t\tinterningProvider.Intern(new DefaultMemberReference(\n\t\t\t\t\t\tm.SymbolKind,\n\t\t\t\t\t\tConvertTypeReference(methodDeclaration.PrivateImplementationType),\n\t\t\t\t\t\tm.Name, m.TypeParameters.Count, GetParameterTypes(m.Parameters))));\n\t\t\t}\n\t\t\t\n\t\t\tcurrentTypeDefinition.Members.Add(m);\n\t\t\tcurrentMethod = null;\n\t\t\tm.ApplyInterningProvider(interningProvider);\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\tIList<ITypeReference> GetParameterTypes(IList<IUnresolvedParameter> parameters)\n\t\t{\n\t\t\tif (parameters.Count == 0)\n\t\t\t\treturn EmptyList<ITypeReference>.Instance;\n\t\t\tITypeReference[] types = new ITypeReference[parameters.Count];\n\t\t\tfor (int i = 0; i < types.Length; i++) {\n\t\t\t\ttypes[i] = parameters[i].Type;\n\t\t\t}\n\t\t\treturn interningProvider.InternList(types);\n\t\t}\n\t\t\n\t\tbool InheritsConstraints(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\t// overrides and explicit interface implementations inherit constraints\n\t\t\tif ((methodDeclaration.Modifiers & Modifiers.Override) == Modifiers.Override)\n\t\t\t\treturn true;\n\t\t\treturn !methodDeclaration.PrivateImplementationType.IsNull;\n\t\t}\n\t\t\n\t\tvoid ConvertTypeParameters(IList<IUnresolvedTypeParameter> output, AstNodeCollection<TypeParameterDeclaration> typeParameters,\n\t\t                           AstNodeCollection<Constraint> constraints, SymbolKind ownerType)\n\t\t{\n\t\t\t// output might be non-empty when type parameters were copied from an outer class\n\t\t\tint index = output.Count;\n\t\t\tList<DefaultUnresolvedTypeParameter> list = new List<DefaultUnresolvedTypeParameter>();\n\t\t\tforeach (TypeParameterDeclaration tpDecl in typeParameters) {\n\t\t\t\tDefaultUnresolvedTypeParameter tp = new DefaultUnresolvedTypeParameter(ownerType, index++, tpDecl.Name);\n\t\t\t\ttp.Region = MakeRegion(tpDecl);\n\t\t\t\tConvertAttributes(tp.Attributes, tpDecl.Attributes);\n\t\t\t\ttp.Variance = tpDecl.Variance;\n\t\t\t\tlist.Add(tp);\n\t\t\t\toutput.Add(tp); // tp must be added to list here so that it can be referenced by constraints\n\t\t\t}\n\t\t\tforeach (Constraint c in constraints) {\n\t\t\t\tforeach (var tp in list) {\n\t\t\t\t\tif (tp.Name == c.TypeParameter.Identifier) {\n\t\t\t\t\t\tforeach (AstType type in c.BaseTypes) {\n\t\t\t\t\t\t\tPrimitiveType primType = type as PrimitiveType;\n\t\t\t\t\t\t\tif (primType != null) {\n\t\t\t\t\t\t\t\tif (primType.Keyword == \"new\") {\n\t\t\t\t\t\t\t\t\ttp.HasDefaultConstructorConstraint = true;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else if (primType.Keyword == \"class\") {\n\t\t\t\t\t\t\t\t\ttp.HasReferenceTypeConstraint = true;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t} else if (primType.Keyword == \"struct\") {\n\t\t\t\t\t\t\t\t\ttp.HasValueTypeConstraint = true;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar lookupMode = (ownerType == SymbolKind.TypeDefinition) ? NameLookupMode.BaseTypeReference : NameLookupMode.Type;\n\t\t\t\t\t\t\ttp.Constraints.Add(ConvertTypeReference(type, lookupMode));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach (DefaultUnresolvedTypeParameter tp in list) {\n\t\t\t\ttp.ApplyInterningProvider(interningProvider);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Operators\n\t\tpublic override IUnresolvedEntity VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t{\n\t\t\tDefaultUnresolvedMethod m = new DefaultUnresolvedMethod(currentTypeDefinition, operatorDeclaration.Name);\n\t\t\tm.SymbolKind = SymbolKind.Operator;\n\t\t\tm.Region = MakeRegion(operatorDeclaration);\n\t\t\tm.BodyRegion = MakeRegion(operatorDeclaration.Body);\n\t\t\tAddXmlDocumentation(m, operatorDeclaration);\n\t\t\t\n\t\t\tm.ReturnType = ConvertTypeReference(operatorDeclaration.ReturnType);\n\t\t\tConvertAttributes(m.Attributes, operatorDeclaration.Attributes.Where(s => s.AttributeTarget != \"return\"));\n\t\t\tConvertAttributes(m.ReturnTypeAttributes, operatorDeclaration.Attributes.Where(s => s.AttributeTarget == \"return\"));\n\t\t\t\n\t\t\tApplyModifiers(m, operatorDeclaration.Modifiers);\n\t\t\tm.HasBody = !operatorDeclaration.Body.IsNull;\n\t\t\t\n\t\t\tConvertParameters(m.Parameters, operatorDeclaration.Parameters);\n\t\t\t\n\t\t\tcurrentTypeDefinition.Members.Add(m);\n\t\t\tm.ApplyInterningProvider(interningProvider);\n\t\t\treturn m;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Constructors\n\t\tpublic override IUnresolvedEntity VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t{\n\t\t\tModifiers modifiers = constructorDeclaration.Modifiers;\n\t\t\tbool isStatic = (modifiers & Modifiers.Static) != 0;\n\t\t\tDefaultUnresolvedMethod ctor = new DefaultUnresolvedMethod(currentTypeDefinition, isStatic ? \".cctor\" : \".ctor\");\n\t\t\tctor.SymbolKind = SymbolKind.Constructor;\n\t\t\tctor.Region = MakeRegion(constructorDeclaration);\n\t\t\tif (!constructorDeclaration.Initializer.IsNull) {\n\t\t\t\tctor.BodyRegion = MakeRegion(constructorDeclaration.Initializer.StartLocation, constructorDeclaration.EndLocation);\n\t\t\t} else {\n\t\t\t\tctor.BodyRegion = MakeRegion(constructorDeclaration.Body);\n\t\t\t}\n\t\t\tctor.ReturnType = KnownTypeReference.Void;\n\t\t\t\n\t\t\tConvertAttributes(ctor.Attributes, constructorDeclaration.Attributes);\n\t\t\tConvertParameters(ctor.Parameters, constructorDeclaration.Parameters);\n\t\t\tAddXmlDocumentation(ctor, constructorDeclaration);\n\t\t\tctor.HasBody = !constructorDeclaration.Body.IsNull;\n\t\t\t\n\t\t\tif (isStatic)\n\t\t\t\tctor.IsStatic = true;\n\t\t\telse\n\t\t\t\tApplyModifiers(ctor, modifiers);\n\t\t\t\n\t\t\tcurrentTypeDefinition.Members.Add(ctor);\n\t\t\tctor.ApplyInterningProvider(interningProvider);\n\t\t\treturn ctor;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Destructors\n\t\tpublic override IUnresolvedEntity VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t{\n\t\t\tDefaultUnresolvedMethod dtor = new DefaultUnresolvedMethod(currentTypeDefinition, \"Finalize\");\n\t\t\tdtor.SymbolKind = SymbolKind.Destructor;\n\t\t\tdtor.Region = MakeRegion(destructorDeclaration);\n\t\t\tdtor.BodyRegion = MakeRegion(destructorDeclaration.Body);\n\t\t\tdtor.Accessibility = Accessibility.Protected;\n\t\t\tdtor.IsOverride = true;\n\t\t\tdtor.ReturnType = KnownTypeReference.Void;\n\t\t\tdtor.HasBody = !destructorDeclaration.Body.IsNull;\n\t\t\t\n\t\t\tConvertAttributes(dtor.Attributes, destructorDeclaration.Attributes);\n\t\t\tAddXmlDocumentation(dtor, destructorDeclaration);\n\t\t\t\n\t\t\tcurrentTypeDefinition.Members.Add(dtor);\n\t\t\tdtor.ApplyInterningProvider(interningProvider);\n\t\t\treturn dtor;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Properties / Indexers\n\t\tpublic override IUnresolvedEntity VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tDefaultUnresolvedProperty p = new DefaultUnresolvedProperty(currentTypeDefinition, propertyDeclaration.Name);\n\t\t\tp.Region = MakeRegion(propertyDeclaration);\n\t\t\tp.BodyRegion = MakeBraceRegion(propertyDeclaration);\n\t\t\tApplyModifiers(p, propertyDeclaration.Modifiers);\n\t\t\tp.ReturnType = ConvertTypeReference(propertyDeclaration.ReturnType);\n\t\t\tConvertAttributes(p.Attributes, propertyDeclaration.Attributes);\n\t\t\tAddXmlDocumentation(p, propertyDeclaration);\n\t\t\tif (!propertyDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\tp.Accessibility = Accessibility.None;\n\t\t\t\tp.IsExplicitInterfaceImplementation = true;\n\t\t\t\tp.ExplicitInterfaceImplementations.Add(interningProvider.Intern(new DefaultMemberReference(\n\t\t\t\t\tp.SymbolKind, ConvertTypeReference(propertyDeclaration.PrivateImplementationType), p.Name)));\n\t\t\t}\n\t\t\tbool isExtern = propertyDeclaration.HasModifier(Modifiers.Extern);\n\t\t\tp.Getter = ConvertAccessor(propertyDeclaration.Getter, p, \"get_\", isExtern);\n\t\t\tp.Setter = ConvertAccessor(propertyDeclaration.Setter, p, \"set_\", isExtern);\n\t\t\tcurrentTypeDefinition.Members.Add(p);\n\t\t\tp.ApplyInterningProvider(interningProvider);\n\t\t\treturn p;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t{\n\t\t\tDefaultUnresolvedProperty p = new DefaultUnresolvedProperty(currentTypeDefinition, \"Item\");\n\t\t\tp.SymbolKind = SymbolKind.Indexer;\n\t\t\tp.Region = MakeRegion(indexerDeclaration);\n\t\t\tp.BodyRegion = MakeBraceRegion(indexerDeclaration);\n\t\t\tApplyModifiers(p, indexerDeclaration.Modifiers);\n\t\t\tp.ReturnType = ConvertTypeReference(indexerDeclaration.ReturnType);\n\t\t\tConvertAttributes(p.Attributes, indexerDeclaration.Attributes);\n\t\t\tAddXmlDocumentation(p, indexerDeclaration);\n\t\t\t\n\t\t\tConvertParameters(p.Parameters, indexerDeclaration.Parameters);\n\t\t\t\n\t\t\tif (!indexerDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\tp.Accessibility = Accessibility.None;\n\t\t\t\tp.IsExplicitInterfaceImplementation = true;\n\t\t\t\tp.ExplicitInterfaceImplementations.Add(interningProvider.Intern(new DefaultMemberReference(\n\t\t\t\t\tp.SymbolKind, indexerDeclaration.PrivateImplementationType.ToTypeReference(), p.Name, 0, GetParameterTypes(p.Parameters))));\n\t\t\t}\n\t\t\tbool isExtern = indexerDeclaration.HasModifier(Modifiers.Extern);\n\t\t\tp.Getter = ConvertAccessor(indexerDeclaration.Getter, p, \"get_\", isExtern);\n\t\t\tp.Setter = ConvertAccessor(indexerDeclaration.Setter, p, \"set_\", isExtern);\n\t\t\t\n\t\t\tcurrentTypeDefinition.Members.Add(p);\n\t\t\tp.ApplyInterningProvider(interningProvider);\n\t\t\treturn p;\n\t\t}\n\t\t\n\t\tDefaultUnresolvedMethod ConvertAccessor(Accessor accessor, IUnresolvedMember p, string prefix, bool memberIsExtern)\n\t\t{\n\t\t\tif (accessor.IsNull)\n\t\t\t\treturn null;\n\t\t\tvar a = new DefaultUnresolvedMethod(currentTypeDefinition, prefix + p.Name);\n\t\t\ta.SymbolKind = SymbolKind.Accessor;\n\t\t\ta.AccessorOwner = p;\n\t\t\ta.Accessibility = GetAccessibility(accessor.Modifiers) ?? p.Accessibility;\n\t\t\ta.IsAbstract = p.IsAbstract;\n\t\t\ta.IsOverride = p.IsOverride;\n\t\t\ta.IsSealed = p.IsSealed;\n\t\t\ta.IsStatic = p.IsStatic;\n\t\t\ta.IsSynthetic = p.IsSynthetic;\n\t\t\ta.IsVirtual = p.IsVirtual;\n\t\t\t\n\t\t\ta.Region = MakeRegion(accessor);\n\t\t\ta.BodyRegion = MakeRegion(accessor.Body);\n\t\t\t// An accessor has no body if both are true:\n\t\t\t//  a) there's no body in the code\n\t\t\t//  b) the member is either abstract or extern\n\t\t\ta.HasBody = !(accessor.Body.IsNull && (p.IsAbstract || memberIsExtern));\n\t\t\tif (p.SymbolKind == SymbolKind.Indexer) {\n\t\t\t\tforeach (var indexerParam in ((IUnresolvedProperty)p).Parameters)\n\t\t\t\t\ta.Parameters.Add(indexerParam);\n\t\t\t}\n\t\t\tDefaultUnresolvedParameter param = null;\n\t\t\tif (accessor.Role == PropertyDeclaration.GetterRole) {\n\t\t\t\ta.ReturnType = p.ReturnType;\n\t\t\t} else {\n\t\t\t\tparam = new DefaultUnresolvedParameter(p.ReturnType, \"value\");\n\t\t\t\ta.Parameters.Add(param);\n\t\t\t\ta.ReturnType = KnownTypeReference.Void;\n\t\t\t}\n\t\t\tforeach (AttributeSection section in accessor.Attributes) {\n\t\t\t\tif (section.AttributeTarget == \"return\") {\n\t\t\t\t\tConvertAttributes(a.ReturnTypeAttributes, section);\n\t\t\t\t} else if (param != null && section.AttributeTarget == \"param\") {\n\t\t\t\t\tConvertAttributes(param.Attributes, section);\n\t\t\t\t} else {\n\t\t\t\t\tConvertAttributes(a.Attributes, section);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (p.IsExplicitInterfaceImplementation) {\n\t\t\t\ta.IsExplicitInterfaceImplementation = true;\n\t\t\t\tDebug.Assert(p.ExplicitInterfaceImplementations.Count == 1);\n\t\t\t\ta.ExplicitInterfaceImplementations.Add(interningProvider.Intern(new DefaultMemberReference(\n\t\t\t\t\tSymbolKind.Accessor,\n\t\t\t\t\tp.ExplicitInterfaceImplementations[0].DeclaringTypeReference,\n\t\t\t\t\ta.Name, 0, GetParameterTypes(a.Parameters)\n\t\t\t\t)));\n\t\t\t}\n\t\t\ta.ApplyInterningProvider(interningProvider);\n\t\t\treturn a;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Events\n\t\tpublic override IUnresolvedEntity VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t{\n\t\t\tbool isSingleEvent = eventDeclaration.Variables.Count == 1;\n\t\t\tModifiers modifiers = eventDeclaration.Modifiers;\n\t\t\tDefaultUnresolvedEvent ev = null;\n\t\t\tforeach (VariableInitializer vi in eventDeclaration.Variables) {\n\t\t\t\tev = new DefaultUnresolvedEvent(currentTypeDefinition, vi.Name);\n\t\t\t\t\n\t\t\t\tev.Region = isSingleEvent ? MakeRegion(eventDeclaration) : MakeRegion(vi);\n\t\t\t\tev.BodyRegion = MakeRegion(vi);\n\t\t\t\t\n\t\t\t\tApplyModifiers(ev, modifiers);\n\t\t\t\tAddXmlDocumentation(ev, eventDeclaration);\n\t\t\t\t\n\t\t\t\tev.ReturnType = ConvertTypeReference(eventDeclaration.ReturnType);\n\t\t\t\t\n\t\t\t\tvar valueParameter = new DefaultUnresolvedParameter(ev.ReturnType, \"value\");\n\t\t\t\tev.AddAccessor = CreateDefaultEventAccessor(ev, \"add_\" + ev.Name, valueParameter);\n\t\t\t\tev.RemoveAccessor = CreateDefaultEventAccessor(ev, \"remove_\" + ev.Name, valueParameter);\n\t\t\t\t\n\t\t\t\tforeach (AttributeSection section in eventDeclaration.Attributes) {\n\t\t\t\t\tif (section.AttributeTarget == \"method\") {\n\t\t\t\t\t\tforeach (var attrNode in section.Attributes) {\n\t\t\t\t\t\t\tIUnresolvedAttribute attr = ConvertAttribute(attrNode);\n\t\t\t\t\t\t\tev.AddAccessor.Attributes.Add(attr);\n\t\t\t\t\t\t\tev.RemoveAccessor.Attributes.Add(attr);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (section.AttributeTarget != \"field\") {\n\t\t\t\t\t\tConvertAttributes(ev.Attributes, section);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentTypeDefinition.Members.Add(ev);\n\t\t\t\tev.ApplyInterningProvider(interningProvider);\n\t\t\t}\n\t\t\treturn isSingleEvent ? ev : null;\n\t\t}\n\t\t\n\t\tDefaultUnresolvedMethod CreateDefaultEventAccessor(IUnresolvedEvent ev, string name, IUnresolvedParameter valueParameter)\n\t\t{\n\t\t\tvar a = new DefaultUnresolvedMethod(currentTypeDefinition, name);\n\t\t\ta.SymbolKind = SymbolKind.Accessor;\n\t\t\ta.AccessorOwner = ev;\n\t\t\ta.Region = ev.BodyRegion;\n\t\t\ta.BodyRegion = DomRegion.Empty;\n\t\t\ta.Accessibility = ev.Accessibility;\n\t\t\ta.IsAbstract = ev.IsAbstract;\n\t\t\ta.IsOverride = ev.IsOverride;\n\t\t\ta.IsSealed = ev.IsSealed;\n\t\t\ta.IsStatic = ev.IsStatic;\n\t\t\ta.IsSynthetic = ev.IsSynthetic;\n\t\t\ta.IsVirtual = ev.IsVirtual;\n\t\t\ta.HasBody = true; // even if it's compiler-generated; the body still exists\n\t\t\ta.ReturnType = KnownTypeReference.Void;\n\t\t\ta.Parameters.Add(valueParameter);\n\t\t\treturn a;\n\t\t}\n\t\t\n\t\tpublic override IUnresolvedEntity VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t{\n\t\t\tDefaultUnresolvedEvent e = new DefaultUnresolvedEvent(currentTypeDefinition, eventDeclaration.Name);\n\t\t\te.Region = MakeRegion(eventDeclaration);\n\t\t\te.BodyRegion = MakeBraceRegion(eventDeclaration);\n\t\t\tApplyModifiers(e, eventDeclaration.Modifiers);\n\t\t\te.ReturnType = ConvertTypeReference(eventDeclaration.ReturnType);\n\t\t\tConvertAttributes(e.Attributes, eventDeclaration.Attributes);\n\t\t\tAddXmlDocumentation(e, eventDeclaration);\n\t\t\t\n\t\t\tif (!eventDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\te.Accessibility = Accessibility.None;\n\t\t\t\te.IsExplicitInterfaceImplementation = true;\n\t\t\t\te.ExplicitInterfaceImplementations.Add(interningProvider.Intern(new DefaultMemberReference(\n\t\t\t\t\te.SymbolKind, eventDeclaration.PrivateImplementationType.ToTypeReference(), e.Name)));\n\t\t\t}\n\t\t\t\n\t\t\t// custom events can't be extern; the non-custom event syntax must be used for extern events\n\t\t\te.AddAccessor = ConvertAccessor(eventDeclaration.AddAccessor, e, \"add_\", false);\n\t\t\te.RemoveAccessor = ConvertAccessor(eventDeclaration.RemoveAccessor, e, \"remove_\", false);\n\t\t\t\n\t\t\tcurrentTypeDefinition.Members.Add(e);\n\t\t\te.ApplyInterningProvider(interningProvider);\n\t\t\treturn e;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Modifiers\n\t\tstatic void ApplyModifiers(DefaultUnresolvedTypeDefinition td, Modifiers modifiers)\n\t\t{\n\t\t\ttd.Accessibility = GetAccessibility(modifiers) ?? (td.DeclaringTypeDefinition != null ? Accessibility.Private : Accessibility.Internal);\n\t\t\ttd.IsAbstract = (modifiers & (Modifiers.Abstract | Modifiers.Static)) != 0;\n\t\t\ttd.IsSealed = (modifiers & (Modifiers.Sealed | Modifiers.Static)) != 0;\n\t\t\ttd.IsShadowing = (modifiers & Modifiers.New) != 0;\n\t\t\ttd.IsPartial = (modifiers & Modifiers.Partial) != 0;\n\t\t}\n\t\t\n\t\tstatic void ApplyModifiers(AbstractUnresolvedMember m, Modifiers modifiers)\n\t\t{\n\t\t\t// members from interfaces are always Public+Abstract. (NOTE: 'new' modifier is valid in interfaces as well.)\n\t\t\tif (m.DeclaringTypeDefinition.Kind == TypeKind.Interface) {\n\t\t\t\tm.Accessibility = Accessibility.Public;\n\t\t\t\tm.IsAbstract = true;\n\t\t\t\tm.IsShadowing = (modifiers & Modifiers.New) != 0;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tm.Accessibility = GetAccessibility(modifiers) ?? Accessibility.Private;\n\t\t\tm.IsAbstract = (modifiers & Modifiers.Abstract) != 0;\n\t\t\tm.IsOverride = (modifiers & Modifiers.Override) != 0;\n\t\t\tm.IsSealed = (modifiers & Modifiers.Sealed) != 0;\n\t\t\tm.IsShadowing = (modifiers & Modifiers.New) != 0;\n\t\t\tm.IsStatic = (modifiers & Modifiers.Static) != 0;\n\t\t\tm.IsVirtual = (modifiers & Modifiers.Virtual) != 0;\n\t\t}\n\t\t\n\t\tstatic Accessibility? GetAccessibility(Modifiers modifiers)\n\t\t{\n\t\t\tswitch (modifiers & Modifiers.VisibilityMask) {\n\t\t\t\tcase Modifiers.Private:\n\t\t\t\t\treturn Accessibility.Private;\n\t\t\t\tcase Modifiers.Internal:\n\t\t\t\t\treturn Accessibility.Internal;\n\t\t\t\tcase Modifiers.Protected | Modifiers.Internal:\n\t\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\t\t\t\tcase Modifiers.Protected:\n\t\t\t\t\treturn Accessibility.Protected;\n\t\t\t\tcase Modifiers.Public:\n\t\t\t\t\treturn Accessibility.Public;\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Attributes\n\t\tpublic override IUnresolvedEntity VisitAttributeSection(AttributeSection attributeSection)\n\t\t{\n\t\t\t// non-assembly attributes are handled by their parent entity\n\t\t\tif (attributeSection.AttributeTarget == \"assembly\") {\n\t\t\t\tConvertAttributes(unresolvedFile.AssemblyAttributes, attributeSection);\n\t\t\t} else if (attributeSection.AttributeTarget == \"module\") {\n\t\t\t\tConvertAttributes(unresolvedFile.ModuleAttributes, attributeSection);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tvoid ConvertAttributes(IList<IUnresolvedAttribute> outputList, IEnumerable<AttributeSection> attributes)\n\t\t{\n\t\t\tforeach (AttributeSection section in attributes) {\n\t\t\t\tConvertAttributes(outputList, section);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid ConvertAttributes(IList<IUnresolvedAttribute> outputList, AttributeSection attributeSection)\n\t\t{\n\t\t\tforeach (CSharp.Attribute attr in attributeSection.Attributes) {\n\t\t\t\toutputList.Add(ConvertAttribute(attr));\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static ITypeReference ConvertAttributeType(AstType type, InterningProvider interningProvider)\n\t\t{\n\t\t\tITypeReference tr = type.ToTypeReference(NameLookupMode.Type, interningProvider);\n\t\t\tif (!type.GetChildByRole(Roles.Identifier).IsVerbatim) {\n\t\t\t\t// Try to add \"Attribute\" suffix, but only if the identifier\n\t\t\t\t// (=last identifier in fully qualified name) isn't a verbatim identifier.\n\t\t\t\tSimpleTypeOrNamespaceReference st = tr as SimpleTypeOrNamespaceReference;\n\t\t\t\tMemberTypeOrNamespaceReference mt = tr as MemberTypeOrNamespaceReference;\n\t\t\t\tif (st != null)\n\t\t\t\t\treturn interningProvider.Intern(new AttributeTypeReference(st, interningProvider.Intern(st.AddSuffix(\"Attribute\"))));\n\t\t\t\telse if (mt != null)\n\t\t\t\t\treturn interningProvider.Intern(new AttributeTypeReference(mt, interningProvider.Intern(mt.AddSuffix(\"Attribute\"))));\n\t\t\t}\n\t\t\treturn tr;\n\t\t}\n\t\t\n\t\tCSharpAttribute ConvertAttribute(CSharp.Attribute attr)\n\t\t{\n\t\t\tDomRegion region = MakeRegion(attr);\n\t\t\tITypeReference type = ConvertAttributeType(attr.Type, interningProvider);\n\t\t\tList<IConstantValue> positionalArguments = null;\n\t\t\tList<KeyValuePair<string, IConstantValue>> namedCtorArguments = null;\n\t\t\tList<KeyValuePair<string, IConstantValue>> namedArguments = null;\n\t\t\tforeach (Expression expr in attr.Arguments) {\n\t\t\t\tNamedArgumentExpression nae = expr as NamedArgumentExpression;\n\t\t\t\tif (nae != null) {\n\t\t\t\t\tstring name = interningProvider.Intern(nae.Name);\n\t\t\t\t\tif (namedCtorArguments == null)\n\t\t\t\t\t\tnamedCtorArguments = new List<KeyValuePair<string, IConstantValue>>();\n\t\t\t\t\tnamedCtorArguments.Add(new KeyValuePair<string, IConstantValue>(name, ConvertAttributeArgument(nae.Expression)));\n\t\t\t\t} else {\n\t\t\t\t\tNamedExpression namedExpression = expr as NamedExpression;\n\t\t\t\t\tif (namedExpression != null) {\n\t\t\t\t\t\tstring name = interningProvider.Intern(namedExpression.Name);\n\t\t\t\t\t\tif (namedArguments == null)\n\t\t\t\t\t\t\tnamedArguments = new List<KeyValuePair<string, IConstantValue>>();\n\t\t\t\t\t\tnamedArguments.Add(new KeyValuePair<string, IConstantValue>(name, ConvertAttributeArgument(namedExpression.Expression)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (positionalArguments == null)\n\t\t\t\t\t\t\tpositionalArguments = new List<IConstantValue>();\n\t\t\t\t\t\tpositionalArguments.Add(ConvertAttributeArgument(expr));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new CSharpAttribute(type, region, interningProvider.InternList(positionalArguments), namedCtorArguments, namedArguments);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Types\n\t\tITypeReference ConvertTypeReference(AstType type, NameLookupMode lookupMode = NameLookupMode.Type)\n\t\t{\n\t\t\treturn type.ToTypeReference(lookupMode, interningProvider);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Constant Values\n\t\tIConstantValue ConvertConstantValue(ITypeReference targetType, AstNode expression)\n\t\t{\n\t\t\treturn ConvertConstantValue(targetType, expression, currentTypeDefinition, currentMethod, usingScope, interningProvider);\n\t\t}\n\t\t\n\t\tinternal static IConstantValue ConvertConstantValue(\n\t\t\tITypeReference targetType, AstNode expression,\n\t\t\tIUnresolvedTypeDefinition parentTypeDefinition, IUnresolvedMethod parentMethodDefinition, UsingScope parentUsingScope,\n\t\t\tInterningProvider interningProvider)\n\t\t{\n\t\t\tConstantValueBuilder b = new ConstantValueBuilder(false, interningProvider);\n\t\t\tConstantExpression c = expression.AcceptVisitor(b);\n\t\t\tif (c == null)\n\t\t\t\treturn new ErrorConstantValue(targetType);\n\t\t\tPrimitiveConstantExpression pc = c as PrimitiveConstantExpression;\n\t\t\tif (pc != null && pc.Type == targetType) {\n\t\t\t\t// Save memory by directly using a SimpleConstantValue.\n\t\t\t\treturn interningProvider.Intern(new SimpleConstantValue(targetType, pc.Value));\n\t\t\t}\n\t\t\t// cast to the desired type\n\t\t\treturn interningProvider.Intern(new ConstantCast(targetType, c, true));\n\t\t}\n\t\t\n\t\tIConstantValue ConvertAttributeArgument(Expression expression)\n\t\t{\n\t\t\tConstantValueBuilder b = new ConstantValueBuilder(true, interningProvider);\n\t\t\treturn expression.AcceptVisitor(b);\n\t\t}\n\t\t\n\t\tsealed class ConstantValueBuilder : DepthFirstAstVisitor<ConstantExpression>\n\t\t{\n\t\t\treadonly InterningProvider interningProvider;\n\t\t\treadonly bool isAttributeArgument;\n\t\t\t\n\t\t\tpublic ConstantValueBuilder(bool isAttributeArgument, InterningProvider interningProvider)\n\t\t\t{\n\t\t\t\tthis.interningProvider = interningProvider;\n\t\t\t\tthis.isAttributeArgument = isAttributeArgument;\n\t\t\t}\n\t\t\t\n\t\t\tprotected override ConstantExpression VisitChildren(AstNode node)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression)\n\t\t\t{\n\t\t\t\treturn interningProvider.Intern(\n\t\t\t\t\tnew PrimitiveConstantExpression(KnownTypeReference.Object, null));\n\t\t\t}\n\n\t\t\tpublic override ConstantExpression VisitSizeOfExpression(SizeOfExpression sizeOfExpression) {\n\t\t\t\treturn new SizeOfConstantValue(sizeOfExpression.Type.ToTypeReference(NameLookupMode.Type, interningProvider));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t\t{\n\t\t\t\tobject val = interningProvider.InternValue(primitiveExpression.Value);\n\t\t\t\tTypeCode typeCode = (val == null ? TypeCode.Object : Type.GetTypeCode(val.GetType()));\n\t\t\t\treturn interningProvider.Intern(\n\t\t\t\t\tnew PrimitiveConstantExpression(typeCode.ToTypeReference(), val));\n\t\t\t}\n\t\t\t\n\t\t\tITypeReference ConvertTypeReference(AstType type)\n\t\t\t{\n\t\t\t\treturn type.ToTypeReference(NameLookupMode.Type, interningProvider);\n\t\t\t}\n\t\t\t\n\t\t\tIList<ITypeReference> ConvertTypeArguments(AstNodeCollection<AstType> types)\n\t\t\t{\n\t\t\t\tint count = types.Count;\n\t\t\t\tif (count == 0)\n\t\t\t\t\treturn null;\n\t\t\t\tITypeReference[] result = new ITypeReference[count];\n\t\t\t\tint pos = 0;\n\t\t\t\tforeach (AstType type in types) {\n\t\t\t\t\tresult[pos++] = ConvertTypeReference(type);\n\t\t\t\t}\n\t\t\t\treturn interningProvider.InternList(result);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tstring identifier = interningProvider.Intern(identifierExpression.Identifier);\n\t\t\t\treturn new ConstantIdentifierReference(identifier, ConvertTypeArguments(identifierExpression.TypeArguments));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tstring memberName = interningProvider.Intern(memberReferenceExpression.MemberName);\n\t\t\t\tTypeReferenceExpression tre = memberReferenceExpression.Target as TypeReferenceExpression;\n\t\t\t\tif (tre != null) {\n\t\t\t\t\t// handle \"int.MaxValue\"\n\t\t\t\t\treturn new ConstantMemberReference(\n\t\t\t\t\t\tConvertTypeReference(tre.Type),\n\t\t\t\t\t\tmemberName,\n\t\t\t\t\t\tConvertTypeArguments(memberReferenceExpression.TypeArguments));\n\t\t\t\t}\n\t\t\t\tConstantExpression v = memberReferenceExpression.Target.AcceptVisitor(this);\n\t\t\t\tif (v == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn new ConstantMemberReference(\n\t\t\t\t\tv, memberName,\n\t\t\t\t\tConvertTypeArguments(memberReferenceExpression.TypeArguments));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression)\n\t\t\t{\n\t\t\t\treturn parenthesizedExpression.Expression.AcceptVisitor(this);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitCastExpression(CastExpression castExpression)\n\t\t\t{\n\t\t\t\tConstantExpression v = castExpression.Expression.AcceptVisitor(this);\n\t\t\t\tif (v == null)\n\t\t\t\t\treturn null;\n\t\t\t\tvar typeReference = ConvertTypeReference(castExpression.Type);\n\t\t\t\treturn interningProvider.Intern(new ConstantCast(typeReference, v, false));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitCheckedExpression(CheckedExpression checkedExpression)\n\t\t\t{\n\t\t\t\tConstantExpression v = checkedExpression.Expression.AcceptVisitor(this);\n\t\t\t\tif (v != null)\n\t\t\t\t\treturn new ConstantCheckedExpression(true, v);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitUncheckedExpression(UncheckedExpression uncheckedExpression)\n\t\t\t{\n\t\t\t\tConstantExpression v = uncheckedExpression.Expression.AcceptVisitor(this);\n\t\t\t\tif (v != null)\n\t\t\t\t\treturn new ConstantCheckedExpression(false, v);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression)\n\t\t\t{\n\t\t\t\treturn interningProvider.Intern(\n\t\t\t\t\tnew ConstantDefaultValue(ConvertTypeReference(defaultValueExpression.Type)));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tConstantExpression v = unaryOperatorExpression.Expression.AcceptVisitor(this);\n\t\t\t\tif (v == null)\n\t\t\t\t\treturn null;\n\t\t\t\tswitch (unaryOperatorExpression.Operator) {\n\t\t\t\t\tcase UnaryOperatorType.Not:\n\t\t\t\t\tcase UnaryOperatorType.BitNot:\n\t\t\t\t\tcase UnaryOperatorType.Minus:\n\t\t\t\t\tcase UnaryOperatorType.Plus:\n\t\t\t\t\t\treturn new ConstantUnaryOperator(unaryOperatorExpression.Operator, v);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tConstantExpression left = binaryOperatorExpression.Left.AcceptVisitor(this);\n\t\t\t\tConstantExpression right = binaryOperatorExpression.Right.AcceptVisitor(this);\n\t\t\t\tif (left == null || right == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn new ConstantBinaryOperator(left, binaryOperatorExpression.Operator, right);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ConstantExpression VisitTypeOfExpression(TypeOfExpression typeOfExpression)\n\t\t\t{\n\t\t\t\tif (isAttributeArgument) {\n\t\t\t\t\treturn new TypeOfConstantExpression(ConvertTypeReference(typeOfExpression.Type));\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override ConstantExpression VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tif (!objectCreateExpression.Arguments.Any()) {\n\t\t\t\t\t// built in primitive type constants can be created with new\n\t\t\t\t\t// Todo: correctly resolve the type instead of doing the string approach\n\t\t\t\t\tswitch (objectCreateExpression.Type.ToString()) {\n\t\t\t\t\t\tcase \"System.Boolean\":\n\t\t\t\t\t\tcase \"bool\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Boolean, new bool());\n\t\t\t\t\t\tcase \"System.Char\":\n\t\t\t\t\t\tcase \"char\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Char, new char());\n\t\t\t\t\t\tcase \"System.SByte\":\n\t\t\t\t\t\tcase \"sbyte\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.SByte, new sbyte());\n\t\t\t\t\t\tcase \"System.Byte\":\n\t\t\t\t\t\tcase \"byte\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Byte, new byte());\n\t\t\t\t\t\tcase \"System.Int16\":\n\t\t\t\t\t\tcase \"short\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Int16, new short());\n\t\t\t\t\t\tcase \"System.UInt16\":\n\t\t\t\t\t\tcase \"ushort\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.UInt16, new ushort());\n\t\t\t\t\t\tcase \"System.Int32\":\n\t\t\t\t\t\tcase \"int\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Int32, new int());\n\t\t\t\t\t\tcase \"System.UInt32\":\n\t\t\t\t\t\tcase \"uint\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.UInt32, new uint());\n\t\t\t\t\t\tcase \"System.Int64\":\n\t\t\t\t\t\tcase \"long\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Int64, new long());\n\t\t\t\t\t\tcase \"System.UInt64\":\n\t\t\t\t\t\tcase \"ulong\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.UInt64, new ulong());\n\t\t\t\t\t\tcase \"System.Single\":\n\t\t\t\t\t\tcase \"float\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Single, new float());\n\t\t\t\t\t\tcase \"System.Double\":\n\t\t\t\t\t\tcase \"double\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Double, new double());\n\t\t\t\t\t\tcase \"System.Decimal\":\n\t\t\t\t\t\tcase \"decimal\":\n\t\t\t\t\t\t\treturn new PrimitiveConstantExpression(KnownTypeReference.Decimal, new decimal());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override ConstantExpression VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t\t{\n\t\t\t\tvar initializer = arrayCreateExpression.Initializer;\n\t\t\t\t// Attributes only allow one-dimensional arrays\n\t\t\t\tif (isAttributeArgument && !initializer.IsNull && arrayCreateExpression.Arguments.Count < 2) {\n\t\t\t\t\tITypeReference type;\n\t\t\t\t\tif (arrayCreateExpression.Type.IsNull) {\n\t\t\t\t\t\ttype = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttype = ConvertTypeReference(arrayCreateExpression.Type);\n\t\t\t\t\t\tforeach (var spec in arrayCreateExpression.AdditionalArraySpecifiers.Reverse()) {\n\t\t\t\t\t\t\ttype = interningProvider.Intern(new ArrayTypeReference(type, spec.Dimensions));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tConstantExpression[] elements = new ConstantExpression[initializer.Elements.Count];\n\t\t\t\t\tint pos = 0;\n\t\t\t\t\tforeach (Expression expr in initializer.Elements) {\n\t\t\t\t\t\tConstantExpression c = expr.AcceptVisitor(this);\n\t\t\t\t\t\tif (c == null)\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\telements[pos++] = c;\n\t\t\t\t\t}\n\t\t\t\t\treturn new ConstantArrayCreation(type, elements);\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Parameters\n\t\tvoid ConvertParameters(IList<IUnresolvedParameter> outputList, IEnumerable<ParameterDeclaration> parameters)\n\t\t{\n\t\t\tforeach (ParameterDeclaration pd in parameters) {\n\t\t\t\tDefaultUnresolvedParameter p = new DefaultUnresolvedParameter(ConvertTypeReference(pd.Type), interningProvider.Intern(pd.Name));\n\t\t\t\tp.Region = MakeRegion(pd);\n\t\t\t\tConvertAttributes(p.Attributes, pd.Attributes);\n\t\t\t\tswitch (pd.ParameterModifier) {\n\t\t\t\t\tcase ParameterModifier.Ref:\n\t\t\t\t\t\tp.IsRef = true;\n\t\t\t\t\t\tp.Type = interningProvider.Intern(new ByReferenceTypeReference(p.Type));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ParameterModifier.Out:\n\t\t\t\t\t\tp.IsOut = true;\n\t\t\t\t\t\tp.Type = interningProvider.Intern(new ByReferenceTypeReference(p.Type));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ParameterModifier.Params:\n\t\t\t\t\t\tp.IsParams = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!pd.DefaultExpression.IsNull)\n\t\t\t\t\tp.DefaultValue = ConvertConstantValue(p.Type, pd.DefaultExpression);\n\t\t\t\toutputList.Add(interningProvider.Intern(p));\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static IList<ITypeReference> GetParameterTypes(IEnumerable<ParameterDeclaration> parameters, InterningProvider interningProvider)\n\t\t{\n\t\t\tList<ITypeReference> result = new List<ITypeReference>();\n\t\t\tforeach (ParameterDeclaration pd in parameters) {\n\t\t\t\tITypeReference type = pd.Type.ToTypeReference(NameLookupMode.Type, interningProvider);\n\t\t\t\tif (pd.ParameterModifier == ParameterModifier.Ref || pd.ParameterModifier == ParameterModifier.Out)\n\t\t\t\t\ttype = interningProvider.Intern(new ByReferenceTypeReference(type));\n\t\t\t\tresult.Add(type);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region XML Documentation\n\t\tvoid AddXmlDocumentation(IUnresolvedEntity entity, AstNode entityDeclaration)\n\t\t{\n\t\t\tif (this.SkipXmlDocumentation)\n\t\t\t\treturn;\n\t\t\tStringBuilder documentation = null;\n\t\t\t// traverse children until the first non-whitespace node\n\t\t\tfor (AstNode node = entityDeclaration.FirstChild; node != null && node.NodeType == NodeType.Whitespace; node = node.NextSibling) {\n\t\t\t\tComment c = node as Comment;\n\t\t\t\tif (c != null && c.IsDocumentation) {\n\t\t\t\t\tif (documentation == null)\n\t\t\t\t\t\tdocumentation = new StringBuilder();\n\t\t\t\t\tif (c.CommentType == CommentType.MultiLineDocumentation) {\n\t\t\t\t\t\tPrepareMultilineDocumentation(c.Content, documentation);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (documentation.Length > 0)\n\t\t\t\t\t\t\tdocumentation.AppendLine();\n\t\t\t\t\t\tif (c.Content.Length > 0 && c.Content[0] == ' ')\n\t\t\t\t\t\t\tdocumentation.Append(c.Content.Substring(1));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdocumentation.Append(c.Content);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (documentation != null) {\n\t\t\t\tunresolvedFile.AddDocumentation(entity, documentation.ToString());\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid PrepareMultilineDocumentation(string content, StringBuilder b)\n\t\t{\n\t\t\tusing (var reader = new StringReader(content)) {\n\t\t\t\tstring firstLine = reader.ReadLine();\n\t\t\t\t// Add first line only if it's not empty:\n\t\t\t\tif (!string.IsNullOrWhiteSpace(firstLine)) {\n\t\t\t\t\tif (firstLine[0] == ' ')\n\t\t\t\t\t\tb.Append(firstLine, 1, firstLine.Length - 1);\n\t\t\t\t\telse\n\t\t\t\t\t\tb.Append(firstLine);\n\t\t\t\t}\n\t\t\t\t// Read lines into list:\n\t\t\t\tList<string> lines = new List<string>();\n\t\t\t\tstring line;\n\t\t\t\twhile ((line = reader.ReadLine()) != null)\n\t\t\t\t\tlines.Add(line);\n\t\t\t\t// If the last line (the line with '*/' delimiter) is white space only, ignore it.\n\t\t\t\tif (lines.Count > 0 && string.IsNullOrWhiteSpace(lines[lines.Count - 1]))\n\t\t\t\t\tlines.RemoveAt(lines.Count - 1);\n\t\t\t\tif (lines.Count > 0) {\n\t\t\t\t\t// Extract pattern from lines[0]: whitespace, asterisk, whitespace\n\t\t\t\t\tint patternLength = 0;\n\t\t\t\t\tstring secondLine = lines[0];\n\t\t\t\t\twhile (patternLength < secondLine.Length && char.IsWhiteSpace(secondLine[patternLength]))\n\t\t\t\t\t\tpatternLength++;\n\t\t\t\t\tif (patternLength < secondLine.Length && secondLine[patternLength] == '*') {\n\t\t\t\t\t\tpatternLength++;\n\t\t\t\t\t\twhile (patternLength < secondLine.Length && char.IsWhiteSpace(secondLine[patternLength]))\n\t\t\t\t\t\t\tpatternLength++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// no asterisk\n\t\t\t\t\t\tpatternLength = 0;\n\t\t\t\t\t}\n\t\t\t\t\t// Now reduce pattern length to the common pattern:\n\t\t\t\t\tfor (int i = 1; i < lines.Count; i++) {\n\t\t\t\t\t\tline = lines[i];\n\t\t\t\t\t\tif (line.Length < patternLength)\n\t\t\t\t\t\t\tpatternLength = line.Length;\n\t\t\t\t\t\tfor (int j = 0; j < patternLength; j++) {\n\t\t\t\t\t\t\tif (secondLine[j] != line[j])\n\t\t\t\t\t\t\t\tpatternLength = j;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Append the lines to the string builder:\n\t\t\t\t\tfor (int i = 0; i < lines.Count; i++) {\n\t\t\t\t\t\tif (b.Length > 0 || i > 0)\n\t\t\t\t\t\t\tb.Append(Environment.NewLine);\n\t\t\t\t\t\tb.Append(lines[i], patternLength, lines[i].Length - patternLength);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/TypeSystem/UsingScope.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.CSharp.TypeSystem\n{\n\t/// <summary>\n\t/// Represents a scope that contains \"using\" statements.\n\t/// This is either the file itself, or a namespace declaration.\n\t/// </summary>\n\t[Serializable]\n\tpublic class UsingScope : AbstractFreezable\n\t{\n\t\treadonly UsingScope parent;\n\t\tDomRegion region;\n\t\tstring shortName = \"\";\n\t\tIList<TypeOrNamespaceReference> usings;\n\t\tIList<KeyValuePair<string, TypeOrNamespaceReference>> usingAliases;\n\t\tIList<string> externAliases;\n\t\t\n\t\tprotected override void FreezeInternal()\n\t\t{\n\t\t\tusings = FreezableHelper.FreezeList(usings);\n\t\t\tusingAliases = FreezableHelper.FreezeList(usingAliases);\n\t\t\texternAliases = FreezableHelper.FreezeList(externAliases);\n\t\t\t\n\t\t\t// In current model (no child scopes), it makes sense to freeze the parent as well\n\t\t\t// to ensure the whole lookup chain is immutable.\n\t\t\tif (parent != null)\n\t\t\t\tparent.Freeze();\n\t\t\t\n\t\t\tbase.FreezeInternal();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new root using scope.\n\t\t/// </summary>\n\t\tpublic UsingScope()\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new nested using scope.\n\t\t/// </summary>\n\t\t/// <param name=\"parent\">The parent using scope.</param>\n\t\t/// <param name=\"shortName\">The short namespace name.</param>\n\t\tpublic UsingScope(UsingScope parent, string shortName)\n\t\t{\n\t\t\tif (parent == null)\n\t\t\t\tthrow new ArgumentNullException(\"parent\");\n\t\t\tif (shortName == null)\n\t\t\t\tthrow new ArgumentNullException(\"shortName\");\n\t\t\tthis.parent = parent;\n\t\t\tthis.shortName = shortName;\n\t\t}\n\t\t\n\t\tpublic UsingScope Parent {\n\t\t\tget { return parent; }\n\t\t}\n\t\t\n\t\tpublic DomRegion Region {\n\t\t\tget { return region; }\n\t\t\tset {\n\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n\t\t\t\tregion = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string ShortNamespaceName {\n\t\t\tget {\n\t\t\t\treturn shortName;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic string NamespaceName {\n\t\t\tget {\n\t\t\t\tif (parent != null)\n\t\t\t\t\treturn NamespaceDeclaration.BuildQualifiedName(parent.NamespaceName, shortName);\n\t\t\t\telse\n\t\t\t\t\treturn shortName;\n\t\t\t}\n//\t\t\tset {\n//\t\t\t\tif (value == null)\n//\t\t\t\t\tthrow new ArgumentNullException(\"NamespaceName\");\n//\t\t\t\tFreezableHelper.ThrowIfFrozen(this);\n//\t\t\t\tnamespaceName = value;\n//\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<TypeOrNamespaceReference> Usings {\n\t\t\tget {\n\t\t\t\tif (usings == null)\n\t\t\t\t\tusings = new List<TypeOrNamespaceReference>();\n\t\t\t\treturn usings;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<KeyValuePair<string, TypeOrNamespaceReference>> UsingAliases {\n\t\t\tget {\n\t\t\t\tif (usingAliases == null)\n\t\t\t\t\tusingAliases = new List<KeyValuePair<string, TypeOrNamespaceReference>>();\n\t\t\t\treturn usingAliases;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic IList<string> ExternAliases {\n\t\t\tget {\n\t\t\t\tif (externAliases == null)\n\t\t\t\t\texternAliases = new List<string>();\n\t\t\t\treturn externAliases;\n\t\t\t}\n\t\t}\n\t\t\n//\t\tpublic IList<UsingScope> ChildScopes {\n//\t\t\tget {\n//\t\t\t\tif (childScopes == null)\n//\t\t\t\t\tchildScopes = new List<UsingScope>();\n//\t\t\t\treturn childScopes;\n//\t\t\t}\n//\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this using scope has an alias (either using or extern)\n\t\t/// with the specified name.\n\t\t/// </summary>\n\t\tpublic bool HasAlias(string identifier)\n\t\t{\n\t\t\tif (usingAliases != null) {\n\t\t\t\tforeach (var pair in usingAliases) {\n\t\t\t\t\tif (pair.Key == identifier)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn externAliases != null && externAliases.Contains(identifier);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Resolves the namespace represented by this using scope.\n\t\t/// </summary>\n\t\tpublic ResolvedUsingScope Resolve(ICompilation compilation)\n\t\t{\n\t\t\tCacheManager cache = compilation.CacheManager;\n\t\t\tResolvedUsingScope resolved = cache.GetShared(this) as ResolvedUsingScope;\n\t\t\tif (resolved == null) {\n\t\t\t\tvar csContext = new CSharpTypeResolveContext(compilation.MainAssembly, parent != null ? parent.Resolve(compilation) : null);\n\t\t\t\tresolved = (ResolvedUsingScope)cache.GetOrAddShared(this, new ResolvedUsingScope(csContext, this));\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp/Util/CloneableStack.cs",
    "content": "﻿//\n// CloneableStack.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Collections;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tclass CloneableStack<T> : IEnumerable<T>, ICollection<T>, ICloneable, IEquatable<CloneableStack<T>>\n\t{\n\t\tint count;\n\t\tStackItem top;\n\n\t\t#region IEnumerable[T] implementation\n\t\tpublic IEnumerator<T> GetEnumerator ()\n\t\t{\n\t\t\treturn new StackItemEnumerator (top);\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator ()\n\t\t{\n\t\t\treturn new StackItemEnumerator (top);\n\t\t}\n\t\t#endregion\n\n\t\t#region ICloneable implementation\n\t\tpublic CloneableStack<T> Clone ()\n\t\t{\n\t\t\tCloneableStack<T> result = new CloneableStack<T> ();\n\t\t\tresult.count = count;\n\t\t\tresult.top   = top;\n\t\t\treturn result;\n\t\t}\n\n\t\tobject ICloneable.Clone ()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\t\t#endregion\n\n\t\tpublic void Clear ()\n\t\t{\n\t\t\ttop = null;\n\t\t\tcount = 0;\n\t\t}\n\n\t\tpublic void Push (T item)\n\t\t{\n\t\t\ttop = new StackItem (top, item);\n\t\t\tcount++;\n\t\t}\n\n\t\tpublic T Peek ()\n\t\t{\n\t\t\treturn top.Item;\n\t\t}\n\n\t\tpublic T Pop ()\n\t\t{\n\t\t\tT result = top.Item;\n\t\t\ttop = top.Parent;\n\t\t\tcount--;\n\t\t\treturn result;\n\t\t}\n\n\t\t#region IEquatable[T] implementation\n\t\tpublic bool Equals (CloneableStack<T> other)\n\t\t{\n\t\t\treturn ReferenceEquals (top, other.top);\n\t\t}\n\t\t#endregion\n\n\t\t#region ICollection[T] implementation\n\t\tvoid ICollection<T>.Add (T item)\n\t\t{\n\t\t\tPush (item);\n\t\t}\n\n\t\tvoid ICollection<T>.Clear ()\n\t\t{\n\t\t\ttop = null;\n\t\t\tcount = 0;\n\t\t}\n\n\t\tbool ICollection<T>.Contains (T item)\n\t\t{\n\t\t\tforeach (T t in this) {\n\t\t\t\tif (t.Equals (item))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tvoid ICollection<T>.CopyTo (T[] array, int arrayIndex)\n\t\t{\n\t\t\tint idx = arrayIndex;\n\t\t\tforeach (T t in this) {\n\t\t\t\tarray[idx++] = t;\n\t\t\t}\n\t\t}\n\n\t\tbool ICollection<T>.Remove (T item)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn count;\n\t\t\t}\n\t\t}\n\n\t\tbool ICollection<T>.IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tclass StackItem\n\t\t{\n\t\t\tpublic readonly StackItem Parent;\n\t\t\tpublic readonly T Item;\n\n\t\t\tpublic StackItem (StackItem parent, T item)\n\t\t\t{\n\t\t\t\tParent = parent;\n\t\t\t\tItem = item;\n\t\t\t}\n\t\t}\n\n\t\tclass StackItemEnumerator : IEnumerator<T>\n\t\t{\n\t\t\tStackItem cur, first;\n\n\t\t\tpublic StackItemEnumerator (StackItem cur)\n\t\t\t{\n\t\t\t\tthis.cur = first = new StackItem (cur, default(T));\n\t\t\t}\n\n\t\t\t#region IDisposable implementation\n\t\t\tvoid IDisposable.Dispose ()\n\t\t\t{\n\t\t\t\tcur = first = null;\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region IEnumerator implementation\n\t\t\tbool IEnumerator.MoveNext ()\n\t\t\t{\n\t\t\t\tif (cur == null)\n\t\t\t\t\treturn false;\n\t\t\t\tcur = cur.Parent;\n\t\t\t\treturn cur != null;\n\t\t\t}\n\n\t\t\tvoid IEnumerator.Reset ()\n\t\t\t{\n\t\t\t\tcur = first;\n\t\t\t}\n\n\t\t\tobject IEnumerator.Current {\n\t\t\t\tget {\n\t\t\t\t\treturn cur.Item;\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region IEnumerator[T] implementation\n\t\t\tT IEnumerator<T>.Current {\n\t\t\t\tget {\n\t\t\t\t\treturn cur.Item;\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.AstVerifier/AssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n// Information about this assembly is defined by the following attributes. \n// Change them to the values specific to your project.\n\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.CSharp.AstVerifier\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"\")]\n[assembly: AssemblyCopyright(\"mike\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// The assembly version has the format \"{Major}.{Minor}.{Build}.{Revision}\".\n// The form \"{Major}.{Minor}.*\" will automatically update the build and revision,\n// and \"{Major}.{Minor}.{Build}.*\" will update just the revision.\n\n[assembly: AssemblyVersion(\"1.0.*\")]\n\n// The following attributes are used to specify the signing key for the assembly, \n// if desired. See the Mono documentation for more information about signing.\n\n//[assembly: AssemblyDelaySign(false)]\n//[assembly: AssemblyKeyFile(\"\")]\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.AstVerifier/ICSharpCode.NRefactory.CSharp.AstVerifier.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <ProjectGuid>{961DADFA-7CE6-429F-BC22-47630D6DB826}</ProjectGuid>\r\n    <OutputType>Exe</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.CSharp.AstVerifier</RootNamespace>\r\n    <AssemblyName>AstVerifier</AssemblyName>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug\\</OutputPath>\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <Externalconsole>true</Externalconsole>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Release\\</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <Externalconsole>true</Externalconsole>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\net_4_5_Debug\\</OutputPath>\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <Externalconsole>true</Externalconsole>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\net_4_5_Release\\</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <Externalconsole>true</Externalconsole>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Main.cs\" />\r\n    <Compile Include=\"AssemblyInfo.cs\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.CSharp\\ICSharpCode.NRefactory.CSharp.csproj\">\r\n      <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>\r\n      <Name>ICSharpCode.NRefactory.CSharp</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.AstVerifier/Main.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace ICSharpCode.NRefactory.CSharp.AstVerifier\n{\n\tclass MainClass\n\t{\n\t\tstatic bool IsMatch (string src1, string src2, out int i, out int j)\n\t\t{\n\t\t\ti = 0;\n\t\t\tj = 0;\n\t\t\twhile (i < src1.Length && j < src2.Length) {\n\t\t\t\tchar c1 = src1 [i];\n\t\t\t\tchar c2 = src2 [j];\n\t\t\t\tif (char.IsWhiteSpace (c1)) {\n\t\t\t\t\ti++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (char.IsWhiteSpace (c2)) {\n\t\t\t\t\tj++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (c1 != c2)\n\t\t\t\t\treturn false;\n\t\t\t\ti++;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\twhile (i < src1.Length && char.IsWhiteSpace (src1[i])) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\twhile (j < src2.Length && char.IsWhiteSpace (src2[j])) {\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t\treturn i == src1.Length && j == src2.Length;\n\t\t}\n\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tif (args.Length == 0) {\n\t\t\t\tConsole.WriteLine (\"Usage: AstVerifier [-v|-verbose] [Directory]\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstring directory = args[args.Length - 1];\n\t\t\tbool verboseOutput =  args.Length > 1 && (args[0] == \"-v\" || args[0] == \"-verbose\");\n\n\t\t\ttry {\n\t\t\t\tif (!Directory.Exists (directory)) {\n\t\t\t\t\tConsole.WriteLine (\"Directory not found.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (IOException) {\n\t\t\t\tConsole.WriteLine (\"Exception while trying to access the directory.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tint failed = 0, passed = 0;\n\t\t\tConsole.WriteLine (\"search in \" + directory);\n\t\t\tforeach (var file in Directory.GetFileSystemEntries (directory, \"*\", SearchOption.AllDirectories)) {\n\t\t\t\tif (!file.EndsWith (\".cs\", StringComparison.Ordinal))\n\t\t\t\t\tcontinue;\n\t\t\t\tstring text = File.ReadAllText (file);\n\t\t\t\tvar unit = SyntaxTree.Parse (text, file);\n\t\t\t\tif (unit == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tstring generated = unit.ToString ();\n\t\t\t\tint i, j;\n\t\t\t\tif (!IsMatch (text, generated, out i, out j)) {\n\t\t\t\t\tif (i > 0 && j > 0 && verboseOutput) {\n\t\t\t\t\t\tConsole.WriteLine (\"fail :\" + file + \"----original:\");\n\t\t\t\t\t\tConsole.WriteLine (text.Substring (0, Math.Min (text.Length, i + 1)));\n\t\t\t\t\t\tConsole.WriteLine (\"----generated:\");\n\t\t\t\t\t\tConsole.WriteLine (generated.Substring (0, Math.Min (generated.Length, j + 1)));\n\t\t\t\t\t}\n\t\t\t\t\tfailed++;\n\t\t\t\t} else {\n\t\t\t\t\tpassed++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tConsole.WriteLine (\"{0} passed, {1} failed\", passed, failed);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AbstractAndVirtualConversionAction.cs",
    "content": "//\n// AbstractAndVirtualConversionAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Make abstract member virtual\", Description = \"Implements an abstract member as a virtual one\")]\n\tpublic class AbstractAndVirtualConversionAction : CodeActionProvider\n\t{\n\t\tstatic BlockStatement CreateNotImplementedBody(RefactoringContext context, out ThrowStatement throwStatement)\n\t\t{\n\t\t\tthrowStatement = new ThrowStatement(new ObjectCreateExpression(context.CreateShortType(\"System\", \"NotImplementedException\")));\n\t\t\treturn new BlockStatement { throwStatement };\n\t\t}\n\n\t\tstatic ThrowStatement ImplementStub (RefactoringContext context, EntityDeclaration newNode)\n\t\t{\n\t\t\tThrowStatement throwStatement = null;\n\t\t\tif (newNode is PropertyDeclaration || newNode is IndexerDeclaration) {\n\t\t\t\tvar setter = newNode.GetChildByRole(PropertyDeclaration.SetterRole);\n\t\t\t\tif (!setter.IsNull)\n\t\t\t\t\tsetter.AddChild(CreateNotImplementedBody(context, out throwStatement), Roles.Body); \n\n\t\t\t\tvar getter = newNode.GetChildByRole(PropertyDeclaration.GetterRole);\n\t\t\t\tif (!getter.IsNull)\n\t\t\t\t\tgetter.AddChild(CreateNotImplementedBody(context, out throwStatement), Roles.Body); \n\t\t\t} else {\n\t\t\t\tnewNode.AddChild(CreateNotImplementedBody(context, out throwStatement), Roles.Body); \n\t\t\t}\n\t\t\treturn throwStatement;\n\t\t}\n\n\t\tstatic bool CheckBody(EntityDeclaration node)\n\t\t{\n\t\t\tvar custom = node as CustomEventDeclaration;\n\t\t\tif (custom != null && !(IsValidBody (custom.AddAccessor.Body) || IsValidBody (custom.RemoveAccessor.Body)))\n\t\t\t    return false;\n\t\t\tif (node is PropertyDeclaration || node is IndexerDeclaration) {\n\t\t\t\tvar setter = node.GetChildByRole(PropertyDeclaration.SetterRole);\n\t\t\t\tvar getter = node.GetChildByRole(PropertyDeclaration.GetterRole);\n\t\t\t\treturn IsValidBody(setter.Body) && IsValidBody(getter.Body);\n\t\t\t} \n\t\t\treturn IsValidBody(node.GetChildByRole(Roles.Body));\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<EntityDeclaration>();\n\t\t\tif (node == null || node.HasModifier(Modifiers.Override))\n\t\t\t\tyield break;\n\n\t\t\tvar parent = node.Parent as TypeDeclaration;\n\t\t\tif (parent == null)\n\t\t\t\tyield break;\n\n\t\t\tvar custom = node as CustomEventDeclaration;\n\t\t\tif (custom != null) {\n\t\t\t\tif (!custom.PrivateImplementationType.IsNull)\n\t\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar selectedNode = node.GetNodeAt(context.Location);\n\t\t\tif (selectedNode == null)\n\t\t\t\tyield break;\n\t\t\tif (selectedNode != node.NameToken) {\n\t\t\t\tif ((node is EventDeclaration && node is CustomEventDeclaration || selectedNode.Role != Roles.Identifier) && \n\t\t\t\t    selectedNode.Role != IndexerDeclaration.ThisKeywordRole) {\n\t\t\t\t\tvar modToken = selectedNode as CSharpModifierToken;\n\t\t\t\t\tif (modToken == null || (modToken.Modifier & (Modifiers.Abstract | Modifiers.Virtual)) == 0)\n\t\t\t\t\t\tyield break;\n\t\t\t\t} else {\n\t\t\t\t\tif (!(node is EventDeclaration || node is CustomEventDeclaration) && selectedNode.Parent != node)\n\t\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!node.GetChildByRole(EntityDeclaration.PrivateImplementationTypeRole).IsNull)\n\t\t\t\tyield break;\n\n\t\t\tif (parent.HasModifier(Modifiers.Abstract)) {\n\t\t\t\tif ((node.Modifiers & Modifiers.Abstract) != 0) {\n\t\t\t\t\tyield return new CodeAction(context.TranslateString(\"To non-abstract\"), script => {\n\t\t\t\t\t\tvar newNode = (EntityDeclaration)node.Clone();\n\t\t\t\t\t\tnewNode.Modifiers &= ~Modifiers.Abstract;\n\t\t\t\t\t\tvar throwStmt = ImplementStub (context, newNode);\n\t\t\t\t\t\tscript.Replace(node, newNode);\n\t\t\t\t\t\tif (throwStmt != null)\n\t\t\t\t\t\t\tscript.Select(throwStmt); \n\t\t\t\t\t}, selectedNode);\n\t\t\t\t} else {\n\t\t\t\t\tif (CheckBody(node)) {\n\t\t\t\t\t\tyield return new CodeAction(context.TranslateString(\"To abstract\"), script => {\n\t\t\t\t\t\t\tvar newNode = CloneNodeWithoutBodies(node);\n\t\t\t\t\t\t\tnewNode.Modifiers &= ~Modifiers.Virtual;\n\t\t\t\t\t\t\tnewNode.Modifiers &= ~Modifiers.Static;\n\t\t\t\t\t\t\tnewNode.Modifiers |= Modifiers.Abstract;\n\t\t\t\t\t\t\tscript.Replace(node, newNode);\n\t\t\t\t\t\t}, selectedNode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((node.Modifiers & Modifiers.Virtual) != 0) {\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"To non-virtual\"), script => {\n\t\t\t\t\tscript.ChangeModifier(node, node.Modifiers & ~Modifiers.Virtual);\n\t\t\t\t}, selectedNode);\n\t\t\t} else {\n\t\t\t\tif ((node.Modifiers & Modifiers.Abstract) != 0) {\n\t\t\t\t\tyield return new CodeAction(context.TranslateString(\"To virtual\"), script => {\n\t\t\t\t\t\tvar newNode = CloneNodeWithoutBodies(node);\n\t\t\t\t\t\tnewNode.Modifiers &= ~Modifiers.Abstract;\n\t\t\t\t\t\tnewNode.Modifiers &= ~Modifiers.Static;\n\t\t\t\t\t\tnewNode.Modifiers |= Modifiers.Virtual;\n\t\t\t\t\t\tvar throwStmt = ImplementStub (context, newNode);\n\t\t\t\t\t\tscript.Replace(node, newNode);\n\t\t\t\t\t\tif (throwStmt != null)\n\t\t\t\t\t\t\tscript.Select(throwStmt);\n\t\t\t\t\t}, selectedNode);\n\t\t\t\t} else {\n\t\t\t\t\tyield return new CodeAction(context.TranslateString(\"To virtual\"), script => {\n\t\t\t\t\t\tscript.ChangeModifier(node, (node.Modifiers & ~Modifiers.Static)  | Modifiers.Virtual);\n\t\t\t\t\t}, selectedNode);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tstatic EntityDeclaration CloneNodeWithoutBodies(EntityDeclaration node)\n\t\t{\n\t\t\tEntityDeclaration newNode;\n\t\t\tvar custom = node as CustomEventDeclaration;\n\n\t\t\tif (custom == null) {\n\t\t\t\tnewNode = (EntityDeclaration)node.Clone();\n\n\t\t\t\tif (newNode is PropertyDeclaration || node is IndexerDeclaration) {\n\t\t\t\t\tvar getter = newNode.GetChildByRole(PropertyDeclaration.GetterRole);\n\t\t\t\t\tif (!getter.IsNull)\n\t\t\t\t\t\tgetter.Body.Remove();\n\t\t\t\t\tvar setter = newNode.GetChildByRole(PropertyDeclaration.SetterRole);\n\t\t\t\t\tif (!setter.IsNull)\n\t\t\t\t\t\tsetter.Body.Remove();\n\t\t\t\t} else {\n\t\t\t\t\tnewNode.GetChildByRole(Roles.Body).Remove();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewNode = new EventDeclaration {\n\t\t\t\t\tModifiers = custom.Modifiers,\n\t\t\t\t\tReturnType = custom.ReturnType.Clone(),\n\t\t\t\t\tVariables =  {\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = custom.Name\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn newNode;\n\t\t}\n\n\t\tstatic bool IsValidBody(BlockStatement body)\n\t\t{\n\t\t\tif (body.IsNull)\n\t\t\t\treturn true;\n\t\t\tvar first = body.Statements.FirstOrDefault();\n\t\t\tif (first == null)\n\t\t\t\treturn true;\n\t\t\tif (first.GetNextSibling(s => s.Role == BlockStatement.StatementRole) != null)\n\t\t\t\treturn false;\n\t\t\treturn first is EmptyStatement || first is ThrowStatement;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AddAnotherAccessorAction.cs",
    "content": "// \n// AddAnotherAccessor.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Add another accessor to a property declaration that has only one.\n\t/// </summary>\n\t[ContextAction(\"Add another accessor\", Description = \"Adds second accessor to a property.\")]\n\tpublic class AddAnotherAccessorAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar pdecl = context.GetNode<PropertyDeclaration> ();\n\t\t\tif (pdecl == null || !pdecl.Getter.IsNull && !pdecl.Setter.IsNull || !pdecl.NameToken.Contains(context.Location)) { \n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar type = pdecl.Parent as TypeDeclaration;\n\t\t\tif (type != null && type.ClassType == ClassType.Interface) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tyield return new CodeAction (pdecl.Setter.IsNull ? context.TranslateString(\"Add setter\") : context.TranslateString(\"Add getter\"), script => {\n\t\t\t\tStatement accessorStatement = null;\n\t\t\t\n\t\t\t\tvar accessor = new Accessor ();\n\t\t\t\tif (!pdecl.Getter.IsNull && !pdecl.Getter.Body.IsNull || !pdecl.Setter.IsNull && !pdecl.Setter.Body.IsNull) {\n\t\t\t\t\taccessorStatement = BuildAccessorStatement(context, pdecl);\n\t\t\t\t\taccessor.Body = new BlockStatement { accessorStatement };\n\t\t\t\t}\n\n\t\t\t\taccessor.Role = pdecl.Setter.IsNull ? PropertyDeclaration.SetterRole : PropertyDeclaration.GetterRole;\n\n\t\t\t\tif (pdecl.Setter.IsNull && !pdecl.Getter.IsNull) {\n\t\t\t\t\tscript.InsertAfter(pdecl.Getter, accessor);\n\t\t\t\t} else if (pdecl.Getter.IsNull && !pdecl.Setter.IsNull) {\n\t\t\t\t\tscript.InsertBefore(pdecl.Setter, accessor);\n\t\t\t\t} else {\n\t\t\t\t\tscript.InsertBefore(pdecl.Getter, accessor);\n\t\t\t\t}\n\t\t\t\tscript.FormatText(pdecl);\n\t\t\t\tif (accessorStatement != null)\n\t\t\t\t\tscript.Select(accessorStatement);\n\t\t\t}, pdecl.NameToken);\n\t\t}\n\t\t\n\t\tstatic Statement BuildAccessorStatement (RefactoringContext context, PropertyDeclaration pdecl)\n\t\t{\n\t\t\tif (pdecl.Setter.IsNull && !pdecl.Getter.IsNull) {\n\t\t\t\tvar field = RemoveBackingStoreAction.ScanGetter (context, pdecl);\n\t\t\t\tif (field != null && !field.IsReadOnly && !field.IsConst) \n\t\t\t\t\treturn new AssignmentExpression (new IdentifierExpression (field.Name), AssignmentOperatorType.Assign, new IdentifierExpression (\"value\"));\n\t\t\t}\n\t\t\t\n\t\t\tif (!pdecl.Setter.IsNull && pdecl.Getter.IsNull) {\n\t\t\t\tvar field = RemoveBackingStoreAction.ScanSetter (context, pdecl);\n\t\t\t\tif (field != null) \n\t\t\t\t\treturn new ReturnStatement (new IdentifierExpression (field.Name));\n\t\t\t}\n\t\t\t\n\t\t\treturn new ThrowStatement (new ObjectCreateExpression (context.CreateShortType (\"System\", \"NotImplementedException\")));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AddArgumentNameAction.cs",
    "content": "﻿// \n// AddArgumentNameAction.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t///  Add name for argument\n\t/// </summary>\n\t[ContextAction(\"Add name for argument\", Description = \"Add name for argument including method, indexer invocation and Attibute Usage\")]\n\tpublic class AddArgumentNameAction : SpecializedCodeAction<Expression>\n\t{\n\t\tList<Expression> CollectNodes(AstNode parant, AstNode node)\n\t\t{\n\t\t\tList<Expression> returned = new List<Expression>();\n\n\t\t\tvar children = parant.GetChildrenByRole(Roles.Argument);\n\t\t\tfor (int i = 0; i< children.Count(); i++) {\n\t\t\t\tif (children.ElementAt(i).Equals(node)) {\n\t\t\t\t\tfor (int j = i; j< children.Count(); j++) {\n\t\t\t\t\t\tif (children.ElementAt(j) is Expression && children.ElementAt(j).Role == Roles.Argument && !(children.ElementAt(j) is NamedArgumentExpression)) {\n\t\t\t\t\t\t\treturned.Add(children.ElementAt(j));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn returned;\n\t\t}\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, Expression expression)\n\t\t{\t\n\t\t\tif (expression == null)\n\t\t\t\treturn null;\n\t\t\tif (expression.Role != Roles.Argument || expression is NamedArgumentExpression)\n\t\t\t\treturn null;\n\t\t\tif (context.Location != expression.StartLocation)\n\t\t\t\treturn null;\n\t\t\tvar parent = expression.Parent;\n\t\t\tif (!(parent is CSharp.Attribute) && !(parent is IndexerExpression) && !(parent is InvocationExpression))\n\t\t\t\treturn null;\n\n\t\t\tvar attribute = parent as CSharp.Attribute;\n\t\t\tif (attribute != null) {\n\t\t\t\tvar resolvedResult = context.Resolve(attribute) as CSharpInvocationResolveResult;\n\t\t\t\tif (resolvedResult == null || resolvedResult.IsError)\n\t\t\t\t\treturn null;\n\t\t\t\tvar arguments = attribute.Arguments;\n\t\t\t\tIMember member = resolvedResult.Member;\n\n\t\t\t\tint index = 0;\n\t\t\t\tint temp = 0; \n\t\t\t\tList<Expression> nodes = new List<Expression>();\n\t\t\t\tforeach (var argument in arguments) {\n\t\t\t\t\tif (argument.Equals(expression)) {\n\t\t\t\t\t\tnodes = CollectNodes(parent, expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ttemp++;\n\t\t\t\t}\n\t\t\t\tindex = temp;\n\t\t\t\tif (!nodes.Any())\n\t\t\t\t\treturn null;\n\t\t\t\tvar method = member as IMethod;\n\t\t\t\tif (method == null || method.Parameters.Count == 0 || method.Parameters.Last().IsParams)\n\t\t\t\t\treturn null;\n\n\t\t\t\tvar parameterMap = resolvedResult.GetArgumentToParameterMap();\n\t\t\t\tvar parameters = method.Parameters;\n\t\t\t\tif (index >= parameterMap.Count)\n\t\t\t\t\treturn null;\n\t\t\t\tvar name = parameters[parameterMap[index]].Name;\n\t\t\t\treturn new CodeAction(string.Format(context.TranslateString(\"Add argument name '{0}'\"), name), script => {\n\t\t\t\t\tfor (int i = 0; i < nodes.Count; i++) {\n\t\t\t\t\t\tint p = index + i;\n\t\t\t\t\t\tif (p >= parameterMap.Count)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tname = parameters[parameterMap[p]].Name;\n\t\t\t\t\t\tvar namedArgument = new NamedArgumentExpression(name, arguments.ElementAt(p).Clone());\n\t\t\t\t\t\tscript.Replace(arguments.ElementAt(p), namedArgument);\n\t\t\t\t\t}}, \n\t\t\t\texpression\n\t\t\t\t);\n\t\t\t} \n\n\t\t\tvar indexerExpression = parent as IndexerExpression;\n\t\t\tif (indexerExpression != null) {\n\t\t\t\tvar resolvedResult = context.Resolve(indexerExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (resolvedResult == null || resolvedResult.IsError)\n\t\t\t\t\treturn null;\n\t\t\t\tvar arguments = indexerExpression.Arguments;\n\t\t\t\tIMember member = resolvedResult.Member;\n\t\t\t\t\n\t\t\t\tint index = 0;\n\t\t\t\tint temp = 0; \n\t\t\t\tList<Expression> nodes = new List<Expression>();\n\t\t\t\tforeach (var argument in arguments) {\n\t\t\t\t\tif (argument.Equals(expression)) {\n\t\t\t\t\t\tnodes = CollectNodes(parent, expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ttemp++;\n\t\t\t\t}\n\t\t\t\tindex = temp;\n\t\t\t\tif (!nodes.Any())\n\t\t\t\t\treturn null;\n\t\t\t\tvar property = member as IProperty;\n\t\t\t\tif (property == null || property.Parameters.Count == 0 || property.Parameters.Last().IsParams) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tvar parameterMap = resolvedResult.GetArgumentToParameterMap();\n\t\t\t\tvar parameters = property.Parameters;\n\t\t\t\tif (index >= parameterMap.Count)\n\t\t\t\t\treturn null;\n\t\t\t\tvar name = parameters[parameterMap[index]].Name;\n\t\t\t\treturn new CodeAction(string.Format(context.TranslateString(\"Add argument name '{0}'\"), name), script => {\n\t\t\t\t\tfor (int i = 0; i< nodes.Count; i++) {\n\t\t\t\t\t\tint p = index + i;\n\t\t\t\t\t\tif (p >= parameterMap.Count)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tname = parameters[parameterMap[p]].Name;\n\t\t\t\t\t\tvar namedArgument = new NamedArgumentExpression(name, arguments.ElementAt(p).Clone());\n\t\t\t\t\t\tscript.Replace(arguments.ElementAt(p), namedArgument);\n\t\t\t\t\t}}, \n\t\t\t\texpression\n\t\t\t\t);\n\t\t\t} \n\n\t\t\tvar invocationExpression = parent as InvocationExpression;\n\t\t\tif (invocationExpression != null) {\n\t\t\t\tvar resolvedResult = context.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (resolvedResult == null || resolvedResult.IsError)\n\t\t\t\t\treturn null;\n\t\t\t\tvar arguments = invocationExpression.Arguments;\n\t\t\t\tIMember member = resolvedResult.Member;\n\t\t\t\t\n\t\t\t\tint index = 0;\n\t\t\t\tint temp = 0; \n\t\t\t\tList<Expression> nodes = new List<Expression>();\n\t\t\t\tforeach (var argument in arguments) {\n\t\t\t\t\tif (argument.Equals(expression)) {\n\t\t\t\t\t\tnodes = CollectNodes(parent, expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ttemp++;\n\t\t\t\t}\n\t\t\t\tindex = temp;\n\t\t\t\tif (!nodes.Any())\n\t\t\t\t\treturn null;\n\t\t\t\n\t\t\t\tvar method = member as IMethod;\n\t\t\t\tif (method == null || method.Parameters.Count == 0 || method.Parameters.Last().IsParams)\n\t\t\t\t\treturn null;\n\n\t\t\t\tvar parameterMap = (resolvedResult as CSharpInvocationResolveResult).GetArgumentToParameterMap();\n\t\t\t\tvar parameters = method.Parameters;\n\t\t\t\tif (index >= parameterMap.Count)\n\t\t\t\t\treturn null;\n\t\t\t\tvar name = parameters[parameterMap[index]].Name;\n\t\t\t\treturn new CodeAction(string.Format(context.TranslateString(\"Add argument name '{0}'\"), name), script => {\n\t\t\t\t\tfor (int i = 0; i< nodes.Count; i++) {\n\t\t\t\t\t\tint p = index + i;\n\t\t\t\t\t\tif (p >= parameterMap.Count)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tname = parameters[parameterMap[p]].Name;\n\t\t\t\t\t\tvar namedArgument = new NamedArgumentExpression(name, arguments.ElementAt(p).Clone());\n\t\t\t\t\t\tscript.Replace(arguments.ElementAt(p), namedArgument);\n\t\t\t\t\t}}, \n\t\t\t\texpression\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AddBracesAction.cs",
    "content": "//\n// AddBracesAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Add braces\", Description = \"Removes redundant braces around a statement.\")]\n\tpublic class AddBracesAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tstring keyword;\n\t\t\tStatement embeddedStatement;\n//\t\t\tBlockStatement block;\n\n\t\t\tvar curNode = context.GetNode();\n\t\t\tif (!RemoveBracesAction.IsSpecialNode(curNode, out keyword, out embeddedStatement))\n\t\t\t\tyield break;\n\t\t\tif (embeddedStatement is BlockStatement)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction (\n\t\t\t\tstring.Format(context.TranslateString(\"Add braces to '{0}'\"), keyword),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace(embeddedStatement, new BlockStatement { embeddedStatement.Clone() });\n\t\t\t\t}, \n\t\t\t\tcurNode\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AddCatchTypeAction.cs",
    "content": "//\n// AddCatchTypeAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Add type to general catch clause\",\n\t               Description = \"Adds an exception type specifier to general catch clauses.\")]\n\tpublic class AddCatchTypeAction : CodeActionProvider\n\t{\n\t\t#region ICodeActionProvider implementation\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar catchClause = context.GetNode<CatchClause>();\n\t\t\tif (catchClause == null)\n\t\t\t\tyield break;\n\t\t\tif (!catchClause.Type.IsNull)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Add type specifier\"), script => {\n\t\t\t\tvar newType = context.CreateShortType(\"System\", \"Exception\");\n\t\t\t\tvar namingHelper = new NamingHelper(context);\n\t\t\t\tvar newIdentifier = Identifier.Create(namingHelper.GenerateVariableName(newType, \"e\"));\n\n\t\t\t\tscript.Replace(catchClause, new CatchClause {\n\t\t\t\t\tType = newType,\n\t\t\t\t\tVariableNameToken = newIdentifier,\n\t\t\t\t\tBody = catchClause.Body.Clone() as BlockStatement\n\t\t\t\t});\n\t\t\t\tscript.Select(newType);\n\t\t\t}, catchClause);\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AddExceptionDescriptionAction.cs",
    "content": "//\n// AddExceptionDescriptionAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Xml;\nusing ICSharpCode.NRefactory.Documentation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Add an exception description to the xml documentation\",\n\t               Description = \"Add an exception description to the xml documentation\")]\n\tpublic class AddExceptionDescriptionAction : SpecializedCodeAction<ThrowStatement>\n\t{\n\t\tstatic AstNode SearchInsertionNode (AstNode entity)\n\t\t{\n\t\t\tAstNode result = entity;\n\t\t\twhile (result != null && (result.Role == Roles.Comment || result.Role == Roles.NewLine || result.Role == Roles.Whitespace))\n\t\t\t\tresult = result.NextSibling;\n\t\t\treturn result;\n\t\t}\n\n\t\tprotected override CodeAction GetAction (RefactoringContext context, ThrowStatement node)\n\t\t{\n\t\t\tvar entity = node.GetParent<EntityDeclaration> ();\n\t\t\tif (entity == null)\n\t\t\t\treturn null;\n\t\t\tvar rr = context.Resolve (entity) as MemberResolveResult;\n\t\t\tif (rr == null || rr.IsError)\n\t\t\t\treturn null;\n\t\t\tvar expr = context.Resolve (node.Expression);\n\t\t\tif (expr == null || expr.IsError || expr.Type.GetDefinition () == null)\n\t\t\t\treturn null;\n\n\t\t\tvar docElement = XmlDocumentationElement.Get (rr.Member);\n\t\t\tif (docElement == null || docElement.Children.Count == 0)\n\t\t\t\treturn null;\n\t\t\tforeach (var de in docElement.Children) {\n\t\t\t\tif (de.Name == \"exception\") {\n\t\t\t\t\tif (de.ReferencedEntity == expr.Type)\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new CodeAction (\n\t\t\t\tcontext.TranslateString (\"Add exception to xml documentation\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar startText = string.Format (\" <exception cref=\\\"{0}\\\">\", expr.Type.GetDefinition ().GetIdString ());\n\t\t\t\t\tvar comment = new Comment (startText +\"</exception>\", CommentType.Documentation);\n\t\t\t\t\tscript.InsertBefore (\n\t\t\t\t\t\tSearchInsertionNode (entity.FirstChild) ?? entity, \n\t\t\t\t\t\tcomment\n\t\t\t\t\t);\n\t\t\t\t\tscript.Select (script.GetSegment (comment).Offset + (\"///\" + startText).Length, 0);\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AddOptionalParameterToInvocationAction.cs",
    "content": "//\n// AddOptionalParameterToInvocationAction.cs\n//\n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Xml;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Add one or more optional parameters to an invocation, using their default values\",\n\t               Description = \"Add one or more optional parameters to an invocation.\")]\n\tpublic class AddOptionalParameterToInvocationAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar invocationExpression = context.GetNode<InvocationExpression>();\n\t\t\tif (invocationExpression == null)\n\t\t\t\tyield break;\n\n\t\t\tvar resolveResult = context.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\tif (resolveResult == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\t\n\t\t\tvar method = (IMethod)resolveResult.Member;\n\t\t\tbool[] parameterIsSpecified = new bool[method.Parameters.Count];\n\t\t\tvar argumentToParameterMap = resolveResult.GetArgumentToParameterMap();\n\t\t\tif (argumentToParameterMap != null) {\n\t\t\t\tforeach (int paramIndex in argumentToParameterMap)\n\t\t\t\t\tparameterIsSpecified[paramIndex] = true;\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < Math.Min(resolveResult.Arguments.Count, parameterIsSpecified.Length); i++) {\n\t\t\t\t\tparameterIsSpecified[i] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar missingParameters = new List<IParameter>();\n\t\t\tfor (int i = 0; i < method.Parameters.Count; i++) {\n\t\t\t\tif (!parameterIsSpecified[i] && method.Parameters[i].IsOptional)\n\t\t\t\t\tmissingParameters.Add(method.Parameters[i]);\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var parameterToAdd in missingParameters) {\n\t\t\t\t//Add specific parameter\n\t\t\t\tyield return new CodeAction(string.Format(context.TranslateString(\"Add optional parameter \\\"{0}\\\"\"),\n\t\t\t\t                                         parameterToAdd.Name),\n\t\t\t\t                           script => {\n\n\t\t\t\t\tvar newInvocation = (InvocationExpression)invocationExpression.Clone();\n\t\t\t\t\tAddArgument(newInvocation, parameterToAdd, parameterToAdd == missingParameters.First());\n\t\t\t\t\tscript.Replace(invocationExpression, newInvocation);\n\n\t\t\t\t}, invocationExpression);\n\t\t\t}\n\n\t\t\tif (missingParameters.Count > 1) {\n\t\t\t\t//Add all parameters at once\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Add all optional parameters\"),\n\t\t\t\t                            script => {\n\n\t\t\t\t\tvar newInvocation = (InvocationExpression)invocationExpression.Clone();\n\n\t\t\t\t\tforeach (var parameterToAdd in missingParameters) {\n\t\t\t\t\t\t//We'll add the remaining parameters, in the order they were declared in the function\n\t\t\t\t\t\tAddArgument(newInvocation, parameterToAdd, true);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace(invocationExpression, newInvocation);\n\n\t\t\t\t}, invocationExpression);\n\t\t\t}\n\t\t}\n\n\t\tstatic void AddArgument(InvocationExpression newNode, IParameter parameterToAdd, bool isNextInSequence)\n\t\t{\n\t\t\tExpression defaultValue;\n\t\t\tif (parameterToAdd.ConstantValue == null) {\n\t\t\t\tdefaultValue = new NullReferenceExpression();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdefaultValue = new PrimitiveExpression(parameterToAdd.ConstantValue);\n\t\t\t}\n\t\t\tExpression newArgument;\n\t\t\tif (newNode.Arguments.Any(argument => argument is NamedExpression) || !isNextInSequence) {\n\t\t\t\tnewArgument = new NamedArgumentExpression(parameterToAdd.Name, defaultValue);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewArgument = defaultValue;\n\t\t\t}\n\t\t\tnewNode.Arguments.Add(newArgument);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AddUsingAction.cs",
    "content": "﻿// Copyright (c) 2013 Daniel Grunwald\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// 1) When a type cannot be resolved, offers to add a using declaration\n\t/// or to replace it with the fully qualified type name.\n\t/// 2) When an extension method cannot be resolved, offers to add a using declaration.\n\t/// 3) When the caret is on a namespace name, offers to add a using declaration\n\t/// and simplify the type references to use the new shorter option.\n\t/// </summary>\n\t[ContextAction (\"Add using\", Description = \"Add missing using declaration.\")]\n\tpublic class AddUsingAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tAstNode node = context.GetNode();\n\t\t\tif (node is Identifier)\n\t\t\t\tnode = node.Parent;\n\t\t\tif (node is SimpleType || node is IdentifierExpression) {\n\t\t\t\treturn GetActionsForType(context, node)\n\t\t\t\t\t.Concat(GetActionsForAddNamespaceUsing(context, node));\n\t\t\t} else if (node is MemberReferenceExpression && node.Parent is InvocationExpression) {\n\t\t\t\treturn GetActionsForExtensionMethodInvocation(context, (InvocationExpression)node.Parent);\n\t\t\t} else if (node is MemberReferenceExpression) {\n\t\t\t\treturn GetActionsForAddNamespaceUsing(context, node);\n\t\t\t} else {\n\t\t\t\treturn EmptyList<CodeAction>.Instance;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIEnumerable<CodeAction> GetActionsForType(RefactoringContext context, AstNode node)\n\t\t{\n\t\t\tvar rr = context.Resolve(node) as UnknownIdentifierResolveResult;\n\t\t\tif (rr == null)\n\t\t\t\treturn EmptyList<CodeAction>.Instance;\n\t\t\t\n\t\t\tstring identifier = rr.Identifier;\n\t\t\tint tc = rr.TypeArgumentCount;\n\t\t\tstring attributeIdentifier = null;\n\t\t\tif (node.Parent is Attribute)\n\t\t\t\tattributeIdentifier = identifier + \"Attribute\";\n\t\t\t\n\t\t\tvar lookup = new MemberLookup(null, context.Compilation.MainAssembly);\n\t\t\tList<CodeAction> actions = new List<CodeAction>();\n\t\t\tforeach (var typeDefinition in context.Compilation.GetAllTypeDefinitions()) {\n\t\t\t\tif ((typeDefinition.Name == identifier || typeDefinition.Name == attributeIdentifier)\n\t\t\t\t    && typeDefinition.TypeParameterCount == tc\n\t\t\t\t    && lookup.IsAccessible(typeDefinition, false))\n\t\t\t\t{\n\t\t\t\t\tif (typeDefinition.DeclaringTypeDefinition == null) {\n\t\t\t\t\t\tactions.Add(NewUsingAction(context, node, typeDefinition.Namespace));\n\t\t\t\t\t}\n\t\t\t\t\tactions.Add(ReplaceWithFullTypeNameAction(context, node, typeDefinition));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn actions;\n\t\t}\n\t\t\n\t\tCodeAction NewUsingAction(RefactoringContext context, AstNode node, string ns)\n\t\t{\n\t\t\treturn new CodeAction(\"using \" + ns + \";\", s => UsingHelper.InsertUsingAndRemoveRedundantNamespaceUsage(context, s, ns), node);\n\t\t}\n\t\t\n\t\tCodeAction ReplaceWithFullTypeNameAction(RefactoringContext context, AstNode node, ITypeDefinition typeDefinition)\n\t\t{\n\t\t\tAstType astType = context.CreateShortType(typeDefinition);\n\t\t\tstring textWithoutGenerics = astType.ToString();\n\t\t\tforeach (var typeArg in node.GetChildrenByRole(Roles.TypeArgument)) {\n\t\t\t\tastType.AddChild(typeArg.Clone(), Roles.TypeArgument);\n\t\t\t}\n\t\t\treturn new CodeAction(textWithoutGenerics, s => s.Replace(node, astType), node);\n\t\t}\n\t\t\n\t\tIEnumerable<CodeAction> GetActionsForExtensionMethodInvocation(RefactoringContext context, InvocationExpression invocation)\n\t\t{\n\t\t\tvar rr = context.Resolve(invocation) as UnknownMethodResolveResult;\n\t\t\tif (rr == null)\n\t\t\t\treturn EmptyList<CodeAction>.Instance;\n\t\t\t\n\t\t\tvar lookup = new MemberLookup(null, context.Compilation.MainAssembly);\n\t\t\tHashSet<string> namespaces = new HashSet<string>();\n\t\t\tList<CodeAction> result = new List<CodeAction>();\n\t\t\tforeach (var typeDefinition in context.Compilation.GetAllTypeDefinitions()) {\n\t\t\t\tif (!(typeDefinition.HasExtensionMethods && lookup.IsAccessible(typeDefinition, false))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach (var method in typeDefinition.Methods.Where(m => m.IsExtensionMethod && m.Name == rr.MemberName)) {\n\t\t\t\t\tIType[] inferredTypes;\n\t\t\t\t\tif (CSharpResolver.IsEligibleExtensionMethod(rr.TargetType, method, true, out inferredTypes)) {\n\t\t\t\t\t\t// avoid offering the same namespace twice\n\t\t\t\t\t\tif (namespaces.Add(typeDefinition.Namespace)) {\n\t\t\t\t\t\t\tresult.Add(NewUsingAction(context, invocation, typeDefinition.Namespace));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak; // continue with the next type\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tIEnumerable<CodeAction> GetActionsForAddNamespaceUsing(RefactoringContext context, AstNode node)\n\t\t{\n\t\t\tvar nrr = context.Resolve(node) as NamespaceResolveResult;\n\t\t\tif (nrr == null)\n\t\t\t\treturn EmptyList<CodeAction>.Instance;\n\t\t\t\n\t\t\tvar trr = context.Resolve(node.Parent) as TypeResolveResult;\n\t\t\tif (trr == null)\n\t\t\t\treturn EmptyList<CodeAction>.Instance;\n\t\t\tITypeDefinition typeDef = trr.Type.GetDefinition();\n\t\t\tif (typeDef == null)\n\t\t\t\treturn EmptyList<CodeAction>.Instance;\n\t\t\t\n\t\t\tIList<IType> typeArguments;\n\t\t\tParameterizedType parameterizedType = trr.Type as ParameterizedType;\n\t\t\tif (parameterizedType != null)\n\t\t\t\ttypeArguments = parameterizedType.TypeArguments;\n\t\t\telse\n\t\t\t\ttypeArguments = EmptyList<IType>.Instance;\n\t\t\t\n\t\t\tvar resolver = context.GetResolverStateBefore(node.Parent);\n\t\t\tif (resolver.ResolveSimpleName(typeDef.Name, typeArguments) is UnknownIdentifierResolveResult) {\n\t\t\t\t// It's possible to remove the explicit namespace usage and introduce a using instead\n\t\t\t\treturn new[] { NewUsingAction(context, node, typeDef.Namespace) };\n\t\t\t}\n\t\t\treturn EmptyList<CodeAction>.Instance;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/AutoLinqSumAction.cs",
    "content": "// \n// AutoLinqSum.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis <luiscubal@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Convers a loop to a Linq expression.\n\t/// </summary>\n\t[ContextAction(\"Convert loop to Linq expression\", Description = \"Converts a loop to a Linq expression\")]\n\tpublic class AutoLinqSumAction : CodeActionProvider\n\t{\n\t\t// Disabled for nullables, since int? x = 3; x += null; has result x = null,\n\t\t// but LINQ Sum behaves differently : nulls are treated as zero\n\t\tstatic readonly IEnumerable<string> LinqSummableTypes = new string[] {\n\t\t\t\"System.UInt16\",\n\t\t\t\"System.Int16\",\n\t\t\t\"System.UInt32\",\n\t\t\t\"System.Int32\",\n\t\t\t\"System.UInt64\",\n\t\t\t\"System.Int64\",\n\t\t\t\"System.Single\",\n\t\t\t\"System.Double\",\n\t\t\t\"System.Decimal\"\n\t\t};\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar loop = GetForeachStatement (context);\n\t\t\tif (loop == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tif (context.GetResolverStateBefore(loop)\n\t\t\t    .LookupSimpleNameOrTypeName(\"Enumerable\", new List<IType>(), NameLookupMode.Type)\n\t\t\t    .Type.FullName != \"System.Linq.Enumerable\") {\n\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar outputStatement = GetTransformedAssignmentExpression (context, loop);\n\t\t\tif (outputStatement == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert foreach loop to LINQ expression\"), script => {\n\n\t\t\t\tvar prevSibling = loop.GetPrevSibling(node => node is Statement);\n\n\t\t\t\tExpression leftSide = outputStatement.Left;\n\t\t\t\tExpression rightSide = outputStatement.Right;\n\n\t\t\t\tExpression expressionToReplace = GetExpressionToReplace(prevSibling, leftSide);\n\n\t\t\t\tif (expressionToReplace != null) {\n\t\t\t\t\tExpression replacementExpression = rightSide.Clone();\n\t\t\t\t\tif (!IsZeroPrimitive(expressionToReplace)) {\n\t\t\t\t\t\treplacementExpression = new BinaryOperatorExpression(ParenthesizeIfNeeded(expressionToReplace).Clone(),\n\t\t\t\t\t\t                                                     BinaryOperatorType.Add,\n\t\t\t\t\t\t                                                     replacementExpression);\n\t\t\t\t\t}\n\n\t\t\t\t\tscript.Replace(expressionToReplace, replacementExpression);\n\t\t\t\t\tscript.Remove(loop);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tscript.Replace(loop, new ExpressionStatement(outputStatement));\n\t\t\t\t}\n\n\t\t\t}, loop);\n\t\t}\n\n\t\tbool IsZeroPrimitive(Expression expr)\n\t\t{\n\t\t\t//We want a very simple check -- no looking at constants, no constant folding, etc.\n\t\t\t//So 1+1 should return false, but (0) should return true\n\n\t\t\tvar parenthesizedExpression = expr as ParenthesizedExpression;\n\t\t\tif (parenthesizedExpression != null) {\n\t\t\t\treturn IsZeroPrimitive(parenthesizedExpression.Expression);\n\t\t\t}\n\n\t\t\tvar zeroLiteralInteger = new PrimitiveExpression(0);\n\t\t\tvar zeroLiteralFloat = new PrimitiveExpression(0.0f);\n\t\t\tvar zeroLiteralDouble = new PrimitiveExpression(0.0);\n\t\t\tvar zeroLiteralDecimal = new PrimitiveExpression(0.0m);\n\n\t\t\treturn SameNode(zeroLiteralInteger, expr) ||\n\t\t\t\tSameNode(zeroLiteralFloat, expr) ||\n\t\t\t\tSameNode(zeroLiteralDouble, expr) ||\n\t\t\t\tSameNode(zeroLiteralDecimal, expr);\n\t\t}\n\n\t\tExpression GetExpressionToReplace(AstNode prevSibling, Expression requiredLeftSide)\n\t\t{\n\t\t\tif (prevSibling == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar declarationStatement = prevSibling as VariableDeclarationStatement;\n\t\t\tif (declarationStatement != null)\n\t\t\t{\n\t\t\t\tif (declarationStatement.Variables.Count != 1) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tvar identifierExpr = requiredLeftSide as IdentifierExpression;\n\t\t\t\tif (identifierExpr == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tvar variableDecl = declarationStatement.Variables.First();\n\n\t\t\t\tif (!SameNode(identifierExpr.IdentifierToken, variableDecl.NameToken)) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn variableDecl.Initializer;\n\t\t\t}\n\n\t\t\tvar exprStatement = prevSibling as ExpressionStatement;\n\t\t\tif (exprStatement != null) {\n\t\t\t\tvar assignment = exprStatement.Expression as AssignmentExpression;\n\t\t\t\tif (assignment != null) {\n\t\t\t\t\tif (assignment.Operator != AssignmentOperatorType.Assign &&\n\t\t\t\t\t\tassignment.Operator != AssignmentOperatorType.Add) {\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!SameNode(requiredLeftSide, assignment.Left)) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn assignment.Right;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tbool IsUnaryModifierExpression(UnaryOperatorExpression expr)\n\t\t{\n\t\t\treturn expr.Operator == UnaryOperatorType.Increment || expr.Operator == UnaryOperatorType.PostIncrement || expr.Operator == UnaryOperatorType.Decrement || expr.Operator == UnaryOperatorType.PostDecrement;\n\t\t}\n\n\t\tAssignmentExpression GetTransformedAssignmentExpression (RefactoringContext context, ForeachStatement foreachStatement)\n\t\t{\n\t\t\tvar enumerableToIterate = foreachStatement.InExpression.Clone();\n\n\t\t\tStatement statement = foreachStatement.EmbeddedStatement;\n\n\t\t\tExpression leftExpression, rightExpression;\n\t\t\tif (!ExtractExpression(statement, out leftExpression, out rightExpression)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (leftExpression == null || rightExpression == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar type = context.Resolve(leftExpression).Type;\n\t\t\tif (!IsLinqSummableType(type)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (rightExpression.DescendantsAndSelf.OfType<AssignmentExpression>().Any()) {\n\t\t\t\t// Reject loops such as\n\t\t\t\t// int k = 0;\n\t\t\t\t// foreach (var x in y) { k += (z = 2); }\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (rightExpression.DescendantsAndSelf.OfType<UnaryOperatorExpression>().Any(IsUnaryModifierExpression)) {\n\t\t\t\t// int k = 0;\n\t\t\t\t// foreach (var x in y) { k += (z++); }\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar zeroLiteral = new PrimitiveExpression(0);\n\n\t\t\tExpression baseExpression = enumerableToIterate;\n\t\t\tfor (;;) {\n\t\t\t\tConditionalExpression condition = rightExpression as ConditionalExpression;\n\t\t\t\tif (condition == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (SameNode(zeroLiteral, condition.TrueExpression)) {\n\t\t\t\t\tbaseExpression = new InvocationExpression(new MemberReferenceExpression(baseExpression.Clone(), \"Where\"),\n\t\t\t\t\t                                          BuildLambda(foreachStatement.VariableName, CSharpUtil.InvertCondition(condition.Condition)));\n\t\t\t\t\trightExpression = condition.FalseExpression.Clone();\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (SameNode(zeroLiteral, condition.FalseExpression)) {\n\t\t\t\t\tbaseExpression = new InvocationExpression(new MemberReferenceExpression(baseExpression.Clone(), \"Where\"),\n\t\t\t\t\t                                          BuildLambda(foreachStatement.VariableName, condition.Condition.Clone()));\n\t\t\t\t\trightExpression = condition.TrueExpression.Clone();\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar primitiveOne = new PrimitiveExpression(1);\n\t\t\tbool isPrimitiveOne = SameNode(primitiveOne, rightExpression);\n\n\t\t\tvar arguments = new List<Expression>();\n\n\t\t\tstring method = isPrimitiveOne ? \"Count\" : \"Sum\";\n\n\t\t\tif (!isPrimitiveOne && !IsIdentifier(rightExpression, foreachStatement.VariableName)) {\n\t\t\t\tvar lambda = BuildLambda(foreachStatement.VariableName, rightExpression);\n\n\t\t\t\targuments.Add(lambda);\n\t\t\t}\n\n\t\t\tvar rightSide = new InvocationExpression(new MemberReferenceExpression(baseExpression, method), arguments);\n\n\t\t\treturn new AssignmentExpression(leftExpression.Clone(), AssignmentOperatorType.Add, rightSide);\n\t\t}\n\n\t\tstatic LambdaExpression BuildLambda(string variableName, Expression expression)\n\t\t{\n\t\t\tvar lambda = new LambdaExpression();\n\t\t\tlambda.Parameters.Add(new ParameterDeclaration() {\n\t\t\t\tName = variableName\n\t\t\t});\n\t\t\tlambda.Body = expression.Clone();\n\t\t\treturn lambda;\n\t\t}\n\n\t\tbool IsIdentifier(Expression expr, string variableName)\n\t\t{\n\t\t\tvar identifierExpr = expr as IdentifierExpression;\n\t\t\tif (identifierExpr != null) {\n\t\t\t\treturn identifierExpr.Identifier == variableName;\n\t\t\t}\n\n\t\t\tvar parenthesizedExpr = expr as ParenthesizedExpression;\n\t\t\tif (parenthesizedExpr != null) {\n\t\t\t\treturn IsIdentifier(parenthesizedExpr.Expression, variableName);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tbool IsLinqSummableType(IType type) {\n\t\t\treturn LinqSummableTypes.Contains(type.FullName);\n\t\t}\n\n\t\tbool ExtractExpression (Statement statement, out Expression leftSide, out Expression rightSide) {\n\t\t\tExpressionStatement expression = statement as ExpressionStatement;\n\t\t\tif (expression != null) {\n\t\t\t\tAssignmentExpression assignment = expression.Expression as AssignmentExpression;\n\t\t\t\tif (assignment != null) {\n\t\t\t\t\tif (assignment.Operator == AssignmentOperatorType.Add) {\n\t\t\t\t\t\tleftSide = assignment.Left;\n\t\t\t\t\t\trightSide = assignment.Right;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (assignment.Operator == AssignmentOperatorType.Subtract) {\n\t\t\t\t\t\tleftSide = assignment.Left;\n\t\t\t\t\t\trightSide = new UnaryOperatorExpression(UnaryOperatorType.Minus, assignment.Right.Clone());\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tleftSide = null;\n\t\t\t\t\trightSide = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tUnaryOperatorExpression unary = expression.Expression as UnaryOperatorExpression;\n\t\t\t\tif (unary != null) {\n\t\t\t\t\tleftSide = unary.Expression;\n\t\t\t\t\tif (unary.Operator == UnaryOperatorType.Increment || unary.Operator == UnaryOperatorType.PostIncrement) {\n\t\t\t\t\t\trightSide = new PrimitiveExpression(1);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (unary.Operator == UnaryOperatorType.Decrement || unary.Operator == UnaryOperatorType.PostDecrement) {\n\t\t\t\t\t\trightSide = new PrimitiveExpression(-1);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tleftSide = null;\n\t\t\t\t\t\trightSide = null;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (statement is EmptyStatement || statement.IsNull) {\n\t\t\t\tleftSide = null;\n\t\t\t\trightSide = null;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tBlockStatement block = statement as BlockStatement;\n\t\t\tif (block != null) {\n\t\t\t\tleftSide = null;\n\t\t\t\trightSide = null;\n\n\t\t\t\tforeach (Statement child in block.Statements) {\n\t\t\t\t\tExpression newLeft, newRight;\n\t\t\t\t\tif (!ExtractExpression(child, out newLeft, out newRight)) {\n\t\t\t\t\t\tleftSide = null;\n\t\t\t\t\t\trightSide = null;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (newLeft == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (leftSide == null) {\n\t\t\t\t\t\tleftSide = newLeft;\n\t\t\t\t\t\trightSide = newRight;\n\t\t\t\t\t} else if (SameNode(leftSide, newLeft)) {\n\t\t\t\t\t\trightSide = new BinaryOperatorExpression(ParenthesizeIfNeeded(rightSide).Clone(),\n\t\t\t\t\t\t                                         BinaryOperatorType.Add,\n\t\t\t\t\t\t                                         ParenthesizeIfNeeded(newRight).Clone());\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tIfElseStatement condition = statement as IfElseStatement;\n\t\t\tif (condition != null) {\n\t\t\t\tExpression ifLeft, ifRight;\n\t\t\t\tif (!ExtractExpression(condition.TrueStatement, out ifLeft, out ifRight)) {\n\t\t\t\t\tleftSide = null;\n\t\t\t\t\trightSide = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tExpression elseLeft, elseRight;\n\t\t\t\tif (!ExtractExpression(condition.FalseStatement, out elseLeft, out elseRight)) {\n\t\t\t\t\tleftSide = null;\n\t\t\t\t\trightSide = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (ifLeft == null && elseLeft == null) {\n\t\t\t\t\tleftSide = null;\n\t\t\t\t\trightSide = null;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (ifLeft != null && elseLeft != null && !SameNode(ifLeft, elseLeft)) {\n\t\t\t\t\tleftSide = null;\n\t\t\t\t\trightSide = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tifRight = ifRight ?? new PrimitiveExpression(0);\n\t\t\t\telseRight = elseRight ?? new PrimitiveExpression(0);\n\n\t\t\t\tleftSide = ifLeft ?? elseLeft;\n\t\t\t\trightSide = new ConditionalExpression(condition.Condition.Clone(), ifRight.Clone(), elseRight.Clone());\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tleftSide = null;\n\t\t\trightSide = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tExpression ParenthesizeIfNeeded(Expression expr)\n\t\t{\n\t\t\tif (expr is ConditionalExpression) {\n\t\t\t\treturn new ParenthesizedExpression(expr.Clone());\n\t\t\t}\n\n\t\t\tvar binaryExpression = expr as BinaryOperatorExpression;\n\t\t\tif (binaryExpression != null) {\n\t\t\t\tif (binaryExpression.Operator != BinaryOperatorType.Multiply &&\n\t\t\t\t\tbinaryExpression.Operator != BinaryOperatorType.Divide &&\n\t\t\t\t\tbinaryExpression.Operator != BinaryOperatorType.Modulus) {\n\n\t\t\t\t\treturn new ParenthesizedExpression(expr.Clone());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn expr;\n\t\t}\n\n\t\tbool SameNode(INode expr1, INode expr2)\n\t\t{\n\t\t\tMatch m = expr1.Match(expr2);\n\t\t\treturn m.Success;\n\t\t}\n\n\t\tstatic ForeachStatement GetForeachStatement (RefactoringContext context)\n\t\t{\n\t\t\tvar foreachStatement = context.GetNode<ForeachStatement>();\n\t\t\tif (foreachStatement == null || !foreachStatement.ForeachToken.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\treturn foreachStatement;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CS1105ExtensionMethodMustBeDeclaredStaticAction.cs",
    "content": "﻿//\n// CS1105ExtensionMethodMustBeDeclaredStaticAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Extension methods must be declared static\")]\n\tpublic class CS1105ExtensionMethodMustBeDeclaredStaticAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar method = context.GetNode<MethodDeclaration>();\n\t\t\tif (method == null || !method.NameToken.Contains(context.Location))\n\t\t\t\tyield break;\n\n\t\t\tif (method.HasModifier(Modifiers.Static))\n\t\t\t\tyield break;\n\t\t\tvar param = method.Parameters.FirstOrDefault();\n\t\t\tif (param == null || param.ParameterModifier != ParameterModifier.This)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Convert method to static\"),\n\t\t\t\tscript => script.ChangeModifier(method, method.Modifiers | Modifiers.Static), \n\t\t\t\tmethod) {\n\t\t\t\tSeverity = ICSharpCode.NRefactory.Refactoring.Severity.Error\n\t\t\t};\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CS1520MethodMustHaveAReturnTypeAction.cs",
    "content": "//\n// CS1520MethodMustHaveAReturnTypeAction.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Class, struct or interface method must have a return type\", Description = \"Found method without return type.\")]\n\tpublic class CS1520MethodMustHaveAReturnTypeAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar entity = context.GetNode<ConstructorDeclaration>();\n\t\t\tif (entity == null)\n\t\t\t\tyield break;\n\t\t\tvar type = entity.Parent as TypeDeclaration;\n\n\t\t\tif (type == null || entity.Name == type.Name)\n\t\t\t\tyield break;\n\n\t\t\tvar typeDeclaration = entity.GetParent<TypeDeclaration>();\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"This is a constructor\"), script => script.Replace(entity.NameToken, Identifier.Create(typeDeclaration.Name, TextLocation.Empty)), entity) {\n\t\t\t\tSeverity = ICSharpCode.NRefactory.Refactoring.Severity.Error\n\t\t\t};\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"This is a void method\"), script => {\n\t\t\t\tvar generatedMethod = new MethodDeclaration();\n\t\t\t\tgeneratedMethod.Modifiers = entity.Modifiers;\n\t\t\t\tgeneratedMethod.ReturnType = new PrimitiveType(\"void\");\n\t\t\t\tgeneratedMethod.Name = entity.Name;\n\t\t\t\tgeneratedMethod.Parameters.AddRange(entity.Parameters.Select(parameter => (ParameterDeclaration)parameter.Clone()));\n\t\t\t\tgeneratedMethod.Body = (BlockStatement)entity.Body.Clone();\n\t\t\t\tgeneratedMethod.Attributes.AddRange(entity.Attributes.Select(attribute => (AttributeSection)attribute.Clone()));\n\n\t\t\t\tscript.Replace(entity, generatedMethod);\n\t\t\t}, entity) {\n\t\t\t\tSeverity = ICSharpCode.NRefactory.Refactoring.Severity.Error\n\t\t\t};\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ChangeAccessModifierAction.cs",
    "content": "//\n// ChangeAccessModifierAction.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Changes the access level of an entity declaration\n\t/// </summary>\n\t[ContextAction(\"Change the access level of an entity declaration\", Description = \"Changes the access level of an entity declaration\")]\n\tpublic class ChangeAccessModifierAction : CodeActionProvider\n\t{\n\t\tDictionary<string, Modifiers> accessibilityLevels = new Dictionary<string, Modifiers> {\n\t\t\t{ \"private\", Modifiers.Private },\n\t\t\t{ \"protected\", Modifiers.Protected },\n\t\t\t{ \"protected internal\", Modifiers.Protected | Modifiers.Internal },\n\t\t\t{ \"internal\", Modifiers.Internal },\n\t\t\t{ \"public\", Modifiers.Public }\n\t\t};\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<EntityDeclaration>();\n\t\t\tif (node == null)\n\t\t\t\tyield break;\n\n\t\t\tvar selectedNode = node.GetNodeAt(context.Location);\n\t\t\tif (selectedNode == null)\n\t\t\t\tyield break;\n\n\t\t\tif (selectedNode.Role != PropertyDeclaration.SetKeywordRole && \n\t\t\t    selectedNode.Role != PropertyDeclaration.GetKeywordRole && \n\t\t\t    selectedNode != node.NameToken) {\n\t\t\t\tif (selectedNode.Role == EntityDeclaration.ModifierRole) {\n\t\t\t\t\tvar mod = (CSharpModifierToken)selectedNode;\n\t\t\t\t\tif ((mod.Modifier & Modifiers.VisibilityMask) == 0)\n\t\t\t\t\t\tyield break;\n\t\t\t\t} else {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node is EnumMemberDeclaration) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tif (node.HasModifier(Modifiers.Override))\n\t\t\t\tyield break;\n\n\t\t\tvar parentTypeDeclaration = node.GetParent<TypeDeclaration>();\n\t\t\tif (parentTypeDeclaration != null && parentTypeDeclaration.ClassType == ClassType.Interface) {\n\t\t\t\t//Interface members have no access modifiers\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar resolveResult = context.Resolve(node) as MemberResolveResult;\n\t\t\tif (resolveResult != null) {\n\t\t\t\tif (resolveResult.Member.ImplementedInterfaceMembers.Any())\n\t\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tforeach (var accessName in accessibilityLevels.Keys) {\n\t\t\t\tvar access = accessibilityLevels [accessName];\n\n\t\t\t\tif (parentTypeDeclaration == null && ((access & (Modifiers.Private | Modifiers.Protected)) != 0)) {\n\t\t\t\t\t//Top-level declarations can only be public or internal\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar accessor = node as Accessor;\n\t\t\t\tif (accessor != null) {\n\t\t\t\t\t//Allow only converting to modifiers stricter than the parent entity\n\n\t\t\t\t\tvar actualParentAccess = GetActualAccess(parentTypeDeclaration, accessor.GetParent<EntityDeclaration>());\n\t\t\t\t\tif (access != actualParentAccess && !IsStricterThan (access, actualParentAccess)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (GetActualAccess(parentTypeDeclaration, node) != access) {\n\t\t\t\t\tyield return GetActionForLevel(context, accessName, access, node, selectedNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsStricterThan(Modifiers access1, Modifiers access2)\n\t\t{\n\t\t\t//First cover the basic cases\n\t\t\tif (access1 == access2) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (access1 == Modifiers.Private) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (access2 == Modifiers.Private) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (access1 == Modifiers.Public) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (access2 == Modifiers.Public) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn access2 == (Modifiers.Protected | Modifiers.Internal);\n\t\t}\n\n\t\tstatic Modifiers GetActualAccess(AstNode parentTypeDeclaration, EntityDeclaration node)\n\t\t{\n\t\t\tModifiers nodeAccess = node.Modifiers & Modifiers.VisibilityMask;\n\t\t\tif (nodeAccess == Modifiers.None && node is Accessor) {\n\t\t\t\tEntityDeclaration parent = node.GetParent<EntityDeclaration>();\n\n\t\t\t\tnodeAccess = parent.Modifiers & Modifiers.VisibilityMask;\n\t\t\t}\n\n\t\t\tif (nodeAccess == Modifiers.None) {\n\t\t\t\tif (parentTypeDeclaration == null) {\n\t\t\t\t\treturn Modifiers.Internal;\n\t\t\t\t}\n\t\t\t\treturn Modifiers.Private;\n\t\t\t}\n\n\t\t\treturn nodeAccess & Modifiers.VisibilityMask;\n\t\t}\n\n\t\tCodeAction GetActionForLevel(RefactoringContext context, string accessName, Modifiers access, EntityDeclaration node, AstNode selectedNode)\n\t\t{\n\t\t\treturn new CodeAction(context.TranslateString(\"To \" + accessName), script => {\n\n\t\t\t\tModifiers newModifiers = node.Modifiers;\n\t\t\t\tnewModifiers &= ~Modifiers.VisibilityMask;\n\t\t\t\t\n\t\t\t\tif (!(node is Accessor) || access != (node.GetParent<EntityDeclaration>().Modifiers & Modifiers.VisibilityMask)) {\n\t\t\t\t\t//Do not add access modifier for accessors if the new access level is the same as the parent\n\t\t\t\t\t//That is, in public int X { $private get; } if access == public, then the result should not have the modifier\n\t\t\t\t\tnewModifiers |= access;\n\t\t\t\t}\n\n\t\t\t\tscript.ChangeModifier(node, newModifiers);\n\n\t\t\t}, selectedNode);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CheckIfParameterIsNullAction.cs",
    "content": "﻿// \n// CheckIfParameterIsNull.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Creates a 'if (param == null) throw new System.ArgumentNullException ();' contruct for a parameter.\n\t/// </summary>\n\t[ContextAction(\"Check if parameter is null\", Description = \"Checks function parameter is not null.\")]\n\tpublic class CheckIfParameterIsNullAction : SpecializedCodeAction<ParameterDeclaration>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, ParameterDeclaration parameter)\n\t\t{\n\t\t\tif (!parameter.NameToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tBlockStatement bodyStatement;\n\t\t\tif (parameter.Parent is LambdaExpression) {\n\t\t\t\tbodyStatement = parameter.Parent.GetChildByRole (LambdaExpression.BodyRole) as BlockStatement;\n\t\t\t} else {\n\t\t\t\tbodyStatement = parameter.Parent.GetChildByRole (Roles.Body);\n\t\t\t}\n\t\t\tif (bodyStatement == null || bodyStatement.IsNull)\n\t\t\t\treturn null;\n\t\t\tvar type = context.ResolveType(parameter.Type);\n\t\t\tif (type.IsReferenceType == false || HasNullCheck(parameter)) \n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn new CodeAction(context.TranslateString(\"Add null check for parameter\"), script => {\n\t\t\t\tvar statement = new IfElseStatement() {\n\t\t\t\t\tCondition = new BinaryOperatorExpression (new IdentifierExpression (parameter.Name), BinaryOperatorType.Equality, new NullReferenceExpression ()),\n\t\t\t\t\tTrueStatement = new ThrowStatement (new ObjectCreateExpression (context.CreateShortType(\"System\", \"ArgumentNullException\"), new PrimitiveExpression (parameter.Name)))\n\t\t\t\t};\n\t\t\t\tscript.AddTo(bodyStatement, statement);\n\t\t\t}, parameter.NameToken);\n\t\t}\n\n\t\tstatic bool HasNullCheck (ParameterDeclaration parameter)\n\t\t{\n\t\t\tvar visitor = new CheckNullVisitor (parameter);\n\t\t\tparameter.Parent.AcceptVisitor (visitor, null);\n\t\t\treturn visitor.ContainsNullCheck;\n\t\t}\n\t\t\n\t\tclass CheckNullVisitor : DepthFirstAstVisitor<object, object>\n\t\t{\n\t\t\treadonly Expression pattern;\n\t\t\t\n\t\t\tinternal bool ContainsNullCheck;\n\t\t\t\n\t\t\tpublic CheckNullVisitor (ParameterDeclaration parameter)\n\t\t\t{\n\t\t\t\tpattern = PatternHelper.CommutativeOperator(new IdentifierExpression(parameter.Name), BinaryOperatorType.Any, new NullReferenceExpression());\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object VisitIfElseStatement (IfElseStatement ifElseStatement, object data)\n\t\t\t{\n\t\t\t\tif (ifElseStatement.Condition is BinaryOperatorExpression) {\n\t\t\t\t\tvar binOp = ifElseStatement.Condition as BinaryOperatorExpression;\n\t\t\t\t\tif ((binOp.Operator == BinaryOperatorType.Equality || binOp.Operator == BinaryOperatorType.InEquality) && pattern.IsMatch(binOp)) {\n\t\t\t\t\t\tContainsNullCheck = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn base.VisitIfElseStatement (ifElseStatement, data);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ComputeConstantValueAction.cs",
    "content": "﻿// \n// ComputeConstantValueAction.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Compute constant value\", Description = \"Computes the value of the current expression and replaces it.\")]\n\tpublic class ComputeConstantValueAction : CodeActionProvider\n\t{\n\t\tpublic override System.Collections.Generic.IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar expression = context.GetNode(i => i is BinaryOperatorExpression || i is UnaryOperatorExpression);\n\t\t\tif (expression == null)\n\t\t\t\tyield break;\n\t\t\tvar node = context.GetNode();\n\t\t\tif (node == null || !(node is PrimitiveExpression) && node.StartLocation != context.Location)\n\t\t\t\tyield break;\n\n\t\t\tvar rr = context.Resolve(expression);\n\t\t\tif (rr.ConstantValue == null)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Compute constant value\"),\n\t\t\t\tscript => script.Replace(expression, new PrimitiveExpression(rr.ConstantValue)), \n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertAnonymousDelegateToLambdaAction.cs",
    "content": "//\n// ConvertAnonymousDelegateToExpression.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert anonymous delegate to lambda\",\n\t\tDescription = \"Converts an anonymous delegate into a lambda\")]\n\tpublic class ConvertAnonymousDelegateToLambdaAction : SpecializedCodeAction<AnonymousMethodExpression>\n\t{\n\t\t#region implemented abstract members of SpecializedCodeAction\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, AnonymousMethodExpression node)\n\t\t{\n\t\t\tif (context.Location < node.DelegateToken.StartLocation || context.Location >= node.Body.StartLocation)\n\t\t\t\treturn null;\n\n\t\t\tExpression convertExpression = null;\n\n\t\t\tvar stmt = node.Body.Statements.FirstOrDefault();\n\t\t\tif (stmt == null)\n\t\t\t\treturn null;\n\t\t\tif (stmt.GetNextSibling(s => s.Role == BlockStatement.StatementRole) == null) {\n\t\t\t\tvar exprStmt = stmt as ExpressionStatement;\n\t\t\t\tif (exprStmt != null) {\n\t\t\t\t\tconvertExpression = exprStmt.Expression;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIType guessedType = null;\n\t\t\tif (!node.HasParameterList) {\n\t\t\t\tguessedType = TypeGuessing.GuessType(context, node);\n\t\t\t\tif (guessedType.Kind != TypeKind.Delegate)\n\t\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn new CodeAction(context.TranslateString(\"Convert to lambda\"), \n\t\t\t\tscript => {\n\t\t\t\t\tvar parent = node.Parent;\n\t\t\t\t\twhile (!(parent is Statement))\n\t\t\t\t\t\tparent = parent.Parent;\n\t\t\t\t\tbool explicitLambda = parent is VariableDeclarationStatement && ((VariableDeclarationStatement)parent).Type.IsVar();\n\t\t\t\t\tvar lambda = new LambdaExpression ();\n\n\t\t\t\t\tif (convertExpression != null) {\n\t\t\t\t\t\tlambda.Body = convertExpression.Clone();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlambda.Body = node.Body.Clone();\n\t\t\t\t\t}\n\t\t\t\t\tif (node.HasParameterList) {\n\t\t\t\t\t\tforeach (var parameter in node.Parameters) {\n\t\t\t\t\t\t\tif (explicitLambda) {\n\t\t\t\t\t\t\t\tlambda.Parameters.Add(new ParameterDeclaration { Type = parameter.Type.Clone(), Name = parameter.Name });\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlambda.Parameters.Add(new ParameterDeclaration { Name = parameter.Name });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar method = guessedType.GetDelegateInvokeMethod ();\n\t\t\t\t\t\tforeach (var parameter in method.Parameters) {\n\t\t\t\t\t\t\tlambda.Parameters.Add(new ParameterDeclaration { Name = parameter.Name });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace(node, lambda);\n\t\t\t\t}, \n\t\t\t\tnode);\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertAsToCastAction.cs",
    "content": "﻿// \n// ConvertAsToCastAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Converts an 'as' expression to a cast expression\n\t/// </summary>\n\t[ContextAction(\"Convert 'as' to cast.\", Description = \"Convert 'as' to cast.\")]\n\tpublic class ConvertAsToCastAction : SpecializedCodeAction <AsExpression>\n\t{\n\t\tstatic InsertParenthesesVisitor insertParentheses = new InsertParenthesesVisitor ();\n\t\tprotected override CodeAction GetAction (RefactoringContext context, AsExpression node)\n\t\t{\n\t\t\tif (!node.AsToken.Contains (context.Location))\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction (context.TranslateString (\"Convert 'as' to cast\"),  script => {\n\t\t\t\tvar castExpr = new CastExpression (node.Type.Clone (), node.Expression.Clone ());\n\t\t\t\tvar parenthesizedExpr = node.Parent as ParenthesizedExpression;\n\t\t\t\tif (parenthesizedExpr != null && parenthesizedExpr.Parent is Expression) {\n\t\t\t\t\t// clone parent expression and replace the ParenthesizedExpression with castExpr to remove\n\t\t\t\t\t// parentheses, then insert parentheses if necessary\n\t\t\t\t\tvar parentExpr = (Expression)parenthesizedExpr.Parent.Clone ();\n\t\t\t\t\tparentExpr.GetNodeContaining (parenthesizedExpr.StartLocation, parenthesizedExpr.EndLocation)\n\t\t\t\t\t\t.ReplaceWith (castExpr);\n\t\t\t\t\tparentExpr.AcceptVisitor (insertParentheses);\n\t\t\t\t\tscript.Replace (parenthesizedExpr.Parent, parentExpr);\n\t\t\t\t} else {\n\t\t\t\t\tcastExpr.AcceptVisitor (insertParentheses);\n\t\t\t\t\tscript.Replace (node, castExpr);\n\t\t\t\t}\n\t\t\t}, node.AsToken);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertAssignmentToIfAction.cs",
    "content": "//\n// ConvertAssignmentToIfAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert assignment to 'if'\",\n\t               Description = \"Convert assignment to 'if'\")]\n\tpublic class ConvertAssignmentToIfAction : SpecializedCodeAction<AssignmentExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, AssignmentExpression node)\n\t\t{\n\t\t\tif (!node.OperatorToken.Contains(context.Location) || !(node.Parent is ExpressionStatement))\n\t\t\t\treturn null;\n\n\t\t\tif (node.Right is ConditionalExpression)\n\t\t\t\treturn CreateForConditionalExpression(context, node, (ConditionalExpression)node.Right);\n\n\t\t\tvar bOp = node.Right as BinaryOperatorExpression;\n\t\t\tif (bOp != null && bOp.Operator == BinaryOperatorType.NullCoalescing)\n\t\t\t\treturn CreateForNullCoalesingExpression(context, node, bOp);\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic CodeAction CreateForConditionalExpression(RefactoringContext ctx, AssignmentExpression node, ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\treturn new CodeAction (\n\t\t\t\tctx.TranslateString(\"Replace with 'if' statement\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar ifStatement = new IfElseStatement(\n\t\t\t\t\t\tconditionalExpression.Condition.Clone(),\n\t\t\t\t\t\tnew AssignmentExpression(node.Left.Clone(), node.Operator, conditionalExpression.TrueExpression.Clone()),\n\t\t\t\t\t\tnew AssignmentExpression(node.Left.Clone(), node.Operator, conditionalExpression.FalseExpression.Clone())\n\t\t\t\t\t);\n\t\t\t\t\tscript.Replace(node.Parent, ifStatement); \n\t\t\t\t},\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\n\t\tstatic CodeAction CreateForNullCoalesingExpression(RefactoringContext ctx, AssignmentExpression node, BinaryOperatorExpression bOp)\n\t\t{\n\t\t\treturn new CodeAction (\n\t\t\t\tctx.TranslateString(\"Replace with 'if' statement\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar ifStatement = new IfElseStatement(\n\t\t\t\t\t\tnew BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.InEquality, new NullReferenceExpression()), \n\t\t\t\t\t\tnew AssignmentExpression(node.Left.Clone(), node.Operator, bOp.Left.Clone()),\n\t\t\t\t\t\tnew AssignmentExpression(node.Left.Clone(), node.Operator, bOp.Right.Clone())\n\t\t\t\t\t);\n\t\t\t\t\tscript.Replace(node.Parent, ifStatement); \n\t\t\t\t},\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertBitwiseFlagComparisonToHasFlagsAction.cs",
    "content": "//\n// ConvertBitwiseFlagComparisonToHasFlagsAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Replace bitwise flag comparison with call to 'Enum.HasFlag'\", Description = \"Replace bitwise flag comparison with call to 'Enum.HasFlag'\")]\n\tpublic class ConvertBitwiseFlagComparisonToHasFlagsAction : SpecializedCodeAction<BinaryOperatorExpression>\n\t{\n\t\tstatic readonly AstNode truePattern = new Choice {\n\t\t\tnew BinaryOperatorExpression (new ParenthesizedExpression(new BinaryOperatorExpression (PatternHelper.OptionalParentheses(new AnyNode(\"target\")), BinaryOperatorType.BitwiseAnd, PatternHelper.OptionalParentheses(new AnyNode(\"expr\")))), BinaryOperatorType.InEquality, PatternHelper.OptionalParentheses(new PrimitiveExpression(0))),\n\t\t\tnew BinaryOperatorExpression (new ParenthesizedExpression(new BinaryOperatorExpression (PatternHelper.OptionalParentheses(new AnyNode(\"target\")), BinaryOperatorType.BitwiseAnd, PatternHelper.OptionalParentheses(new AnyNode(\"expr\")))), BinaryOperatorType.Equality, PatternHelper.OptionalParentheses(new Backreference(\"expr\")))\n\t\t};\n\n\t\tstatic readonly AstNode falsePattern = new Choice {\n\t\t\tnew BinaryOperatorExpression (new ParenthesizedExpression(new BinaryOperatorExpression (PatternHelper.OptionalParentheses(new AnyNode(\"target\")), BinaryOperatorType.BitwiseAnd, PatternHelper.OptionalParentheses(new AnyNode(\"expr\")))), BinaryOperatorType.Equality, PatternHelper.OptionalParentheses(new PrimitiveExpression(0))),\n\t\t\tnew BinaryOperatorExpression (new ParenthesizedExpression(new BinaryOperatorExpression (PatternHelper.OptionalParentheses(new AnyNode(\"target\")), BinaryOperatorType.BitwiseAnd, PatternHelper.OptionalParentheses(new AnyNode(\"expr\")))), BinaryOperatorType.InEquality, PatternHelper.OptionalParentheses(new Backreference(\"expr\")))\n\t\t};\n\n\t\tinternal static Expression MakeFlatExpression (Expression expr, BinaryOperatorType opType)\n\t\t{\n\t\t\tvar bOp = expr as BinaryOperatorExpression;\n\t\t\tif (bOp == null)\n\t\t\t\treturn expr.Clone();\n\t\t\treturn new BinaryOperatorExpression(\n\t\t\t\tMakeFlatExpression(bOp.Left, opType),\n\t\t\t\topType,\n\t\t\t\tMakeFlatExpression(bOp.Right, opType)\n\t\t\t);\n\t\t}\n\n\t\tstatic Expression BuildHasFlagExpression (Expression target, Expression expr)\n\t\t{\n\t\t\tvar bOp = expr as BinaryOperatorExpression;\n\t\t\tif (bOp == null)\n\t\t\t\treturn new InvocationExpression(new MemberReferenceExpression(target.Clone(), \"HasFlag\"), expr.Clone());\n\n\t\t\tif (bOp.Operator == BinaryOperatorType.BitwiseOr) {\n\t\t\t\treturn new BinaryOperatorExpression(\n\t\t\t\t\tBuildHasFlagExpression(target, bOp.Left),\n\t\t\t\t\tBinaryOperatorType.BitwiseOr,\n\t\t\t\t\tBuildHasFlagExpression(target, bOp.Right)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn new InvocationExpression(new MemberReferenceExpression(target.Clone(), \"HasFlag\"), MakeFlatExpression (bOp, BinaryOperatorType.BitwiseOr));\n\t\t}\n\n\t\tstatic CodeAction CreateAction(BaseRefactoringContext context, Match match, bool negateMatch, BinaryOperatorExpression node)\n\t\t{\n\t\t\tvar target = match.Get<Expression>(\"target\").Single();\n\t\t\tvar expr = match.Get<Expression>(\"expr\").Single();\n\n\t\t\tif (!expr.DescendantsAndSelf.All(x => !(x is BinaryOperatorExpression) || ((BinaryOperatorExpression)x).Operator == BinaryOperatorType.BitwiseOr) &&\n\t\t\t\t!expr.DescendantsAndSelf.All(x => !(x is BinaryOperatorExpression) || ((BinaryOperatorExpression)x).Operator == BinaryOperatorType.BitwiseAnd))\n\t\t\t\treturn null;\n\t\t\tvar rr = context.Resolve(target);\n\t\t\tif (rr.Type.Kind != ICSharpCode.NRefactory.TypeSystem.TypeKind.Enum)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Replace with 'Enum.HasFlag'\"), \n\t\t\t\tscript => {\n\t\t\t\t\tExpression newExpr = BuildHasFlagExpression (target, expr);\n\t\t\t\t\tif (negateMatch)\n\t\t\t\t\t\tnewExpr = new UnaryOperatorExpression(UnaryOperatorType.Not, newExpr);\n\t\t\t\t\tscript.Replace(node, newExpr);\n\t\t\t\t}, \n\t\t\t\tnode.OperatorToken);\n\t\t}\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, BinaryOperatorExpression node)\n\t\t{\n\t\t\tif (!node.OperatorToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tvar match = truePattern.Match(node);\n\t\t\tif (match.Success)\n\t\t\t\treturn CreateAction(context, match, false, node);\n\t\t\tmatch = falsePattern.Match(node);\n\t\t\tif (match.Success)\n\t\t\t\treturn CreateAction(context, match, true, node);\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertCastToAsAction.cs",
    "content": "﻿// \n// ConvertCastToAsAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Converts a cast expression to an 'as' expression\n\t/// </summary>\n\t[ContextAction (\"Convert cast to 'as'.\", Description = \"Convert cast to 'as'.\")]\n\tpublic class ConvertCastToAsAction : SpecializedCodeAction<CastExpression>\n\t{\n\t\tstatic InsertParenthesesVisitor insertParentheses = new InsertParenthesesVisitor ();\n\t\tprotected override CodeAction GetAction (RefactoringContext context, CastExpression node)\n\t\t{\n\t\t\tif (node.Expression.Contains (context.Location))\n\t\t\t\treturn null;\n\t\t\t// only works on reference and nullable types\n\t\t\tvar type = context.ResolveType (node.Type);\n\t\t\tvar typeDef = type.GetDefinition ();\n\t\t\tvar isNullable = typeDef != null && typeDef.KnownTypeCode == KnownTypeCode.NullableOfT;\n\t\t\tif (type.IsReferenceType == true || isNullable) {\n\t\t\t\treturn new CodeAction (context.TranslateString (\"Convert cast to 'as'\"), script => {\n\t\t\t\t\tvar asExpr = new AsExpression (node.Expression.Clone (), node.Type.Clone ());\n\t\t\t\t\t// if parent is an expression, clone parent and replace the case expression with asExpr,\n\t\t\t\t\t// so that we can inset parentheses\n\t\t\t\t\tvar parentExpr = node.Parent.Clone () as Expression;\n\t\t\t\t\tif (parentExpr != null) {\n\t\t\t\t\t\tvar castExpr = parentExpr.GetNodeContaining (node.StartLocation, node.EndLocation);\n\t\t\t\t\t\tcastExpr.ReplaceWith (asExpr);\n\t\t\t\t\t\tparentExpr.AcceptVisitor (insertParentheses);\n\t\t\t\t\t\tscript.Replace (node.Parent, parentExpr);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscript.Replace (node, asExpr);\n\t\t\t\t\t}\n\t\t\t\t}, node);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertDecToHexAction.cs",
    "content": "﻿// \n// ConvertDecToHex.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Convert a dec numer to hex. For example: 16 -> 0x10\n\t/// </summary>\n\t[ContextAction(\"Convert dec to hex.\", Description = \"Convert dec to hex.\")]\n\tpublic class ConvertDecToHexAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar pexpr = context.GetNode<PrimitiveExpression>();\n\t\t\tif (pexpr == null || pexpr.LiteralValue.StartsWith(\"0X\", System.StringComparison.OrdinalIgnoreCase))\n\t\t\t\tyield break;\n\n\t\t\tvar value = pexpr.Value;\n\t\t\tif (value is string || value is bool || value is float || value is double || value is char)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert to hex\"), script => {\n\t\t\t\tscript.Replace(pexpr, new PrimitiveExpression (value, string.Format(\"0x{0:x}\", value)));\n\t\t\t}, pexpr);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertDoWhileToWhileLoopAction.cs",
    "content": "//\n// ConvertDoWhileToWhileLoopAction.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Convert do...while to while. For instance, { do x++; while (Foo(x)); } becomes { while(Foo(x)) x++; }.\n\t/// Note that this action will often change the semantics of the code.\n\t/// </summary>\n\t[ContextAction(\"Convert do...while to while.\", Description = \"Converts a do...while to a while loop (changing semantics).\")]\n\tpublic class ConvertDoWhileToWhileLoopAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<DoWhileStatement>();\n\t\t\tif (node == null)\n\t\t\t\tyield break;\n\n\t\t\tvar target = node.DoToken;\n\t\t\tif (!target.Contains(context.Location)) {\n\t\t\t\ttarget = node.WhileToken;\n\t\t\t\tif (!target.Contains(context.Location)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert to while loop\"),\n\t\t\t                            script => ConvertToWhileLoop(script, node),\n\t\t\t                            target);\n\n\t\t}\n\n\t\tstatic void ConvertToWhileLoop(Script script, DoWhileStatement originalStatement)\n\t\t{\n\t\t\tscript.Replace(originalStatement, new WhileStatement {\n\t\t\t\tCondition = originalStatement.Condition.Clone(),\n\t\t\t\tEmbeddedStatement = originalStatement.EmbeddedStatement.Clone()\n\t\t\t});\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertEqualityOperatorToEqualsAction.cs",
    "content": "//\n// ConvertEqualityOperatorToEqualsAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Convert do...while to while. For instance, { do x++; while (Foo(x)); } becomes { while(Foo(x)) x++; }.\n\t/// Note that this action will often change the semantics of the code.\n\t/// </summary>\n\t[ContextAction(\"Convert '==' to 'Equals'\", Description = \"Converts '==' to call to 'object.Equals'\")]\n\tpublic class ConvertEqualityOperatorToEqualsAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<BinaryOperatorExpression>();\n\t\t\tif (node == null || \n\t\t\t    (node.Operator != BinaryOperatorType.Equality && node.Operator != BinaryOperatorType.InEquality) ||\n\t\t\t    !node.OperatorToken.Contains(context.Location))\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Use 'Equals'\"),\n\t\t\t\tscript => {\n\t\t\t\t\tExpression expr = new InvocationExpression(GenerateTarget(context, node), node.Left.Clone(), node.Right.Clone());\n\t\t\t\t\tif (node.Operator == BinaryOperatorType.InEquality)\n\t\t\t\t\t\texpr = new UnaryOperatorExpression(UnaryOperatorType.Not, expr);\n\t\t\t\t\tscript.Replace(node, expr);\n\t\t\t\t}, \n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\n\t\treadonly IList<IType> emptyTypes = new IType[0];\n\n\t\tbool HasDifferentEqualsMethod(IEnumerable<IMethod> methods)\n\t\t{\n\t\t\tforeach (var method in methods) {\n\t\t\t\tif (method.Parameters.Count == 2 && method.FullName != \"System.Object.Equals\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tExpression GenerateTarget(RefactoringContext context, BinaryOperatorExpression bOp)\n\t\t{\n\t\t\tvar rr = context.Resolver.GetResolverStateBefore(bOp).LookupSimpleNameOrTypeName(\"Equals\", emptyTypes, NameLookupMode.Expression) as MethodGroupResolveResult;\n\t\t\tif (rr == null || rr.IsError || HasDifferentEqualsMethod (rr.Methods)) {\n\t\t\t\treturn new PrimitiveType (\"object\").Member(\"Equals\");\n\t\t\t}\n\t\t\treturn new IdentifierExpression(\"Equals\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertEqualsToEqualityOperatorAction.cs",
    "content": "//\n// ConvertEqualsToEqualityOperatorAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp;\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Convert do...while to while. For instance, { do x++; while (Foo(x)); } becomes { while(Foo(x)) x++; }.\n\t/// Note that this action will often change the semantics of the code.\n\t/// </summary>\n\t[ContextAction(\"Convert 'Equals' to '=='\", Description = \"Converts 'Equals' call to '=='\")]\n\tpublic class ConvertEqualsToEqualityOperatorAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<InvocationExpression>();\n\t\t\tif (node == null)\n\t\t\t\tyield break;\n\t\t\tif ((node.Target is IdentifierExpression) && !node.Target.IsInside(context.Location))\n\t\t\t\tyield break;\n\t\t\tvar memberRefExpr = node.Target as MemberReferenceExpression;\n\t\t\tif ((memberRefExpr != null) && !memberRefExpr.MemberNameToken.IsInside(context.Location))\n\t\t\t\tyield break;\n\t\t\tvar rr = context.Resolve(node) as CSharpInvocationResolveResult;\n\t\t\tif (rr == null || rr.IsError || rr.Member.Name != \"Equals\" || !rr.Member.DeclaringType.IsKnownType(KnownTypeCode.Object))\n\t\t\t\tyield break;\n\t\t\tExpression expr = node;\n\t\t\tbool useEquality = true;\n\t\t\tvar uOp = node.Parent as UnaryOperatorExpression;\n\t\t\tif (uOp != null && uOp.Operator == UnaryOperatorType.Not) {\n\t\t\t\texpr = uOp;\n\t\t\t\tuseEquality = false;\n\t\t\t}\n\t\t\tif (node.Arguments.Count != 2 && (memberRefExpr == null || node.Arguments.Count != 1))\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(\n\t\t\t\tuseEquality ? context.TranslateString(\"Use '=='\") : context.TranslateString(\"Use '!='\"),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\texpr,\n\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\tnode.Arguments.Count == 1 ? memberRefExpr.Target.Clone() : node.Arguments.First().Clone(),\n\t\t\t\t\t\t\tuseEquality ? BinaryOperatorType.Equality :  BinaryOperatorType.InEquality,\n\t\t\t\t\t\t\tnode.Arguments.Last().Clone()\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}, \n\t\t\t\tnode.Target\n\t\t\t);\n\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertExplicitToImplicitImplementationAction.cs",
    "content": "﻿// \n// ConvertExplicitToImplicitImplementation.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Convert explicit to implict implementation\",\n\t\t\t\t\tDescription = \" Convert explicit implementation of an interface method to implicit implementation\")]\n\tpublic class ConvertExplicitToImplicitImplementationAction : SpecializedCodeAction<MethodDeclaration>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, MethodDeclaration node)\n\t\t{\n\t\t\tif (node.PrivateImplementationType.IsNull)\n\t\t\t\treturn null;\n\n\t\t\tif (!node.NameToken.Contains (context.Location) && \n\t\t\t\t!node.PrivateImplementationType.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar method = (IMethod)((MemberResolveResult)context.Resolve (node)).Member;\n\t\t\tvar type = method.DeclaringType;\n\n\t\t\t// find existing method with the same signature\n\t\t\tif (type.GetMethods (m => m.Name == node.Name && m.TypeParameters.Count == method.TypeParameters.Count\n\t\t\t\t&& !m.IsExplicitInterfaceImplementation)\n\t\t\t\t.Any (m => ParameterListComparer.Instance.Equals (m.Parameters, method.Parameters)))\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (context.TranslateString (\"Convert explict to implicit implementation\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar implicitImpl = (MethodDeclaration)node.Clone ();\n\t\t\t\t\timplicitImpl.PrivateImplementationType = AstType.Null;\n\n\t\t\t\t\t// remove visibility modifier, in case the code contains error\n\t\t\t\t\timplicitImpl.Modifiers &= ~Modifiers.VisibilityMask;\n\n\t\t\t\t\timplicitImpl.Modifiers |= Modifiers.Public;\n\t\t\t\t\tscript.Replace (node, implicitImpl);\n\t\t\t\t}, \n\t\t\tnode.NameToken);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertForToWhileAction.cs",
    "content": "//\n// ConvertForToWhileAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert 'for' loop to 'while'\", Description = \"Works on 'for' loops.\")]\n\tpublic class ConvertForToWhileAction : SpecializedCodeAction<ForStatement>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, ForStatement node)\n\t\t{\n\t\t\tif (!node.ForToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Convert to 'while'\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar body = node.EmbeddedStatement.Clone();\n\t\t\t\t\tvar blockStatement = body as BlockStatement ?? new BlockStatement { Statements = { body } };\n\t\t\t\t\tblockStatement.Statements.AddRange(node.Iterators.Select(i => i.Clone ()));\n\t\t\t\t\tvar whileStatement = new WhileStatement(node.Condition.IsNull ? new PrimitiveExpression(true) : node.Condition.Clone(), blockStatement);\n\t\t\t\t\tforeach (var init in node.Initializers) {\n\t\t\t\t\t\tvar stmt = init.Clone();\n\t\t\t\t\t\tstmt.Role = BlockStatement.StatementRole;\n\t\t\t\t\t\tscript.InsertBefore(node, stmt);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace(node, whileStatement);\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertForeachToForAction.cs",
    "content": "﻿// \n// ConvertForeachToFor.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Converts a foreach loop to for.\n\t/// </summary>\n\t[ContextAction(\"Convert 'foreach' loop to 'for'\", Description = \"Works on 'foreach' loops that allow direct access to its elements.\")]\n\tpublic class ConvertForeachToForAction : CodeActionProvider\n\t{\n\t\tstatic readonly string[] VariableNames = { \"i\", \"j\", \"k\", \"l\", \"n\", \"m\", \"x\", \"y\", \"z\"};\n\t\tstatic readonly string[] CollectionNames = { \"list\" };\n\n\t\tstatic string GetName(ICSharpCode.NRefactory.CSharp.Resolver.CSharpResolver state, string[] variableNames)\n\t\t{\n\t\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\t\tforeach (var vn in variableNames) {\n\t\t\t\t\tstring id = i > 0 ? vn + i : vn;\n\t\t\t\t\tvar rr = state.LookupSimpleNameOrTypeName(id, new IType[0], NameLookupMode.Expression);\n\t\t\t\t\tif (rr.IsError) \n\t\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tstring GetBoundName(Expression inExpression)\n\t\t{\n\t\t\tvar ie = inExpression as IdentifierExpression;\n\t\t\tif (ie != null)\n\t\t\t\treturn ie.Identifier;\n\t\t\tvar mre = inExpression as MemberReferenceExpression;\n\t\t\tif (mre != null)\n\t\t\t\treturn GetBoundName(mre.Target) + mre.MemberName;\n\t\t\treturn \"max\";\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tbool hasIndexAccess;\n\t\t\tvar foreachStatement = GetForeachStatement(context, out hasIndexAccess);\n\t\t\tif (foreachStatement == null || foreachStatement.EmbeddedStatement.IsNull)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore (foreachStatement.EmbeddedStatement);\n\t\t\tstring name = GetName(state, VariableNames);\n\t\t\tif (name == null) // very unlikely, but just in case ...\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert 'foreach' loop to 'for'\"), script => {\n\t\t\t\tvar result = context.Resolve(foreachStatement.InExpression);\n\t\t\t\tvar countProperty = GetCountProperty(result.Type);\n\t\t\t\tvar inExpression = foreachStatement.InExpression;\n\n\t\t\t\tvar initializer = hasIndexAccess ? new VariableDeclarationStatement(new PrimitiveType(\"int\"), name, new PrimitiveExpression(0)) :\n\t\t\t\t                  new VariableDeclarationStatement(new SimpleType(\"var\"), name, new InvocationExpression(new MemberReferenceExpression (inExpression.Clone (), \"GetEnumerator\")));\n\t\t\t\tvar id1 = new IdentifierExpression(name);\n\t\t\t\tvar id2 = id1.Clone();\n\t\t\t\tvar id3 = id1.Clone();\n\t\t\t\tStatement declarationStatement = null;\n\t\t\t\tif (inExpression is ObjectCreateExpression || inExpression is ArrayCreateExpression) {\n\t\t\t\t\tstring listName = GetName(state, CollectionNames) ?? \"col\";\n\t\t\t\t\tdeclarationStatement = new VariableDeclarationStatement (\n\t\t\t\t\t\tnew PrimitiveType (\"var\"),\n\t\t\t\t\t\tlistName,\n\t\t\t\t\t\tinExpression.Clone ()\n\t\t\t\t\t);\n\t\t\t\t\tinExpression = new IdentifierExpression (listName);\n\t\t\t\t}\n\n\t\t\t\tvar variableDeclarationStatement = new VariableDeclarationStatement(\n\t\t\t\t\tforeachStatement.VariableType.Clone(),\n\t\t\t\t\tforeachStatement.VariableName,\n\t\t\t\t\thasIndexAccess ? (Expression)new IndexerExpression(inExpression.Clone(), id3) : new MemberReferenceExpression(id1, \"Current\")\n\t\t\t\t);\n\n\t\t\t\tvar forStatement = new ForStatement {\n\t\t\t\t\tInitializers = { initializer },\n\t\t\t\t\tCondition = hasIndexAccess ? (Expression)new BinaryOperatorExpression (id1, BinaryOperatorType.LessThan, new MemberReferenceExpression (inExpression.Clone (), countProperty)) :\n\t\t\t\t\t            new InvocationExpression(new MemberReferenceExpression (id2, \"MoveNext\")),\n\t\t\t\t\tEmbeddedStatement = new BlockStatement {\n\t\t\t\t\t\tvariableDeclarationStatement\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (hasIndexAccess)\n\t\t\t\t\tforStatement.Iterators.Add(new UnaryOperatorExpression (UnaryOperatorType.PostIncrement, id2));\n\n\t\t\t\tif (foreachStatement.EmbeddedStatement is BlockStatement) {\n\t\t\t\t\tvariableDeclarationStatement.Remove();\n\t\t\t\t\tvar oldBlock = (BlockStatement)foreachStatement.EmbeddedStatement.Clone();\n\t\t\t\t\tif (oldBlock.Statements.Any()) {\n\t\t\t\t\t\toldBlock.Statements.InsertBefore(oldBlock.Statements.First(), variableDeclarationStatement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toldBlock.Statements.Add(variableDeclarationStatement);\n\t\t\t\t\t}\n\t\t\t\t\tforStatement.EmbeddedStatement = oldBlock;\n\t\t\t\t} else {\n\t\t\t\t\tforStatement.EmbeddedStatement.AddChild (foreachStatement.EmbeddedStatement.Clone (), BlockStatement.StatementRole);\n\t\t\t\t}\n\t\t\t\tif (declarationStatement != null)\n\t\t\t\t\tscript.InsertBefore (foreachStatement, declarationStatement);\n\t\t\t\tscript.Replace (foreachStatement, forStatement);\n\t\t\t\tif (hasIndexAccess) {\n\t\t\t\t\tscript.Link (initializer.Variables.First ().NameToken, id1, id2, id3);\n\t\t\t\t} else {\n\t\t\t\t\tscript.Link (initializer.Variables.First ().NameToken, id1, id2);\n\t\t\t\t}\n\t\t\t}, foreachStatement);\n\n\t\t\tif (!hasIndexAccess)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert 'foreach' loop to optimized 'for'\"), script => {\n\t\t\t\tvar result = context.Resolve(foreachStatement.InExpression);\n\t\t\t\tvar countProperty = GetCountProperty(result.Type);\n\n\t\t\t\tvar initializer = new VariableDeclarationStatement(new PrimitiveType(\"int\"), name, new PrimitiveExpression(0));\n\t\t\t\tvar id1 = new IdentifierExpression(name);\n\t\t\t\tvar id2 = id1.Clone();\n\t\t\t\tvar id3 = id1.Clone();\n\t\t\t\tvar inExpression = foreachStatement.InExpression;\n\t\t\t\tStatement declarationStatement = null;\n\t\t\t\tif (inExpression is ObjectCreateExpression || inExpression is ArrayCreateExpression) {\n\t\t\t\t\tstring listName = GetName(state, CollectionNames) ?? \"col\";\n\t\t\t\t\tdeclarationStatement = new VariableDeclarationStatement (\n\t\t\t\t\t\tnew PrimitiveType (\"var\"),\n\t\t\t\t\t\tlistName,\n\t\t\t\t\t\tinExpression.Clone ()\n\t\t\t\t\t\t);\n\t\t\t\t\tinExpression = new IdentifierExpression (listName);\n\t\t\t\t}\n\n\t\t\t\tvar variableDeclarationStatement = new VariableDeclarationStatement(\n\t\t\t\t\tforeachStatement.VariableType.Clone(),\n\t\t\t\t\tforeachStatement.VariableName,\n\t\t\t\t\tnew IndexerExpression(inExpression.Clone(), id3)\n\t\t\t\t\t);\n\n\t\t\t\tstring optimizedUpperBound = GetBoundName(inExpression) + countProperty;\n\t\t\t\tinitializer.Variables.Add(new VariableInitializer(optimizedUpperBound, new MemberReferenceExpression (inExpression.Clone (), countProperty)));\n\t\t\t\tvar forStatement = new ForStatement {\n\t\t\t\t\tInitializers = { initializer },\n\t\t\t\t\tCondition = new BinaryOperatorExpression (id1, BinaryOperatorType.LessThan, new IdentifierExpression(optimizedUpperBound)),\n\t\t\t\t\tIterators = { new UnaryOperatorExpression (UnaryOperatorType.PostIncrement, id2) },\n\t\t\t\t\tEmbeddedStatement = new BlockStatement {\n\t\t\t\t\t\tvariableDeclarationStatement\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (foreachStatement.EmbeddedStatement is BlockStatement) {\n\t\t\t\t\tvariableDeclarationStatement.Remove();\n\t\t\t\t\tvar oldBlock = (BlockStatement)foreachStatement.EmbeddedStatement.Clone();\n\t\t\t\t\tif (oldBlock.Statements.Any()) {\n\t\t\t\t\t\toldBlock.Statements.InsertBefore(oldBlock.Statements.First(), variableDeclarationStatement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toldBlock.Statements.Add(variableDeclarationStatement);\n\t\t\t\t\t}\n\t\t\t\t\tforStatement.EmbeddedStatement = oldBlock;\n\t\t\t\t} else {\n\t\t\t\t\tforStatement.EmbeddedStatement.AddChild (foreachStatement.EmbeddedStatement.Clone (), BlockStatement.StatementRole);\n\t\t\t\t}\n\t\t\t\tif (declarationStatement != null)\n\t\t\t\t\tscript.InsertBefore (foreachStatement, declarationStatement);\n\t\t\t\tscript.Replace (foreachStatement, forStatement);\n\t\t\t\tscript.Link (initializer.Variables.First ().NameToken, id1, id2, id3);\n\t\t\t}, foreachStatement);\n\t\t}\n\t\t\n\t\tstatic string GetCountProperty(IType type)\n\t\t{\n\t\t\treturn type.Kind == TypeKind.Array ? \"Length\" : \"Count\";\n\t\t}\n\n\t\tstatic ForeachStatement GetForeachStatement (RefactoringContext context, out bool hasIndexAccess)\n\t\t{\n\t\t\tvar astNode = context.GetNode ();\n\t\t\tif (astNode == null) {\n\t\t\t\thasIndexAccess = false;\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar result = (astNode as ForeachStatement) ?? astNode.Parent as ForeachStatement;\n\t\t\tif (result == null) {\n\t\t\t\thasIndexAccess = false;\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar collection = context.Resolve (result.InExpression);\n\t\t\thasIndexAccess = collection.Type.Kind == TypeKind.Array || collection.Type.GetProperties(p => p.IsIndexer).Any();\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertHasFlagsToBitwiseFlagComparisonAction.cs",
    "content": "//\n// ConvertHasFlagsToBitwiseFlagComparisonAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Replace 'Enum.HasFlag' call with bitwise flag comparison\", Description = \"Replace 'Enum.HasFlag' call with bitwise flag comparison\")]\n\tpublic class ConvertHasFlagsToBitwiseFlagComparisonAction : SpecializedCodeAction<InvocationExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, InvocationExpression node)\n\t\t{\n\t\t\tvar mRef = node.Target as MemberReferenceExpression;\n\t\t\tif (mRef == null)\n\t\t\t\treturn null;\n\t\t\tvar rr = context.Resolve(node) as CSharpInvocationResolveResult;\n\t\t\tif (rr == null || rr.IsError)\n\t\t\t\treturn null;\n\t\t\tif (rr.Member.Name != \"HasFlag\" || rr.Member.DeclaringType.GetDefinition().KnownTypeCode != ICSharpCode.NRefactory.TypeSystem.KnownTypeCode.Enum)\n\t\t\t\treturn null;\n\t\t\tvar arg = node.Arguments.First ().Clone ();\n\t\t\tif (!arg.DescendantsAndSelf.All(x => !(x is BinaryOperatorExpression) || ((BinaryOperatorExpression)x).Operator == BinaryOperatorType.BitwiseOr))\n\t\t\t\treturn null;\n\t\t\targ = ConvertBitwiseFlagComparisonToHasFlagsAction.MakeFlatExpression(arg, BinaryOperatorType.BitwiseAnd);\n\t\t\tif (arg is BinaryOperatorExpression)\n\t\t\t\targ = new ParenthesizedExpression(arg);\n\t\t\treturn new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Replace with bitwise flag comparison\"), \n\t\t\t\tscript => {\n\t\t\t\t\tvar uOp = node.Parent as UnaryOperatorExpression;\n\t\t\t\t\tif (uOp != null && uOp.Operator == UnaryOperatorType.Not) {\n\t\t\t\t\t\tscript.Replace(uOp, \n\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew ParenthesizedExpression(new BinaryOperatorExpression(mRef.Target.Clone(), BinaryOperatorType.BitwiseAnd, arg)), \n\t\t\t\t\t\t\t\tBinaryOperatorType.Equality, \n\t\t\t\t\t\t\t\tnew PrimitiveExpression(0)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscript.Replace(node, \n\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew ParenthesizedExpression(new BinaryOperatorExpression(mRef.Target.Clone(), BinaryOperatorType.BitwiseAnd, arg)), \n\t\t\t\t\t\t\t\tBinaryOperatorType.InEquality, \n\t\t\t\t\t\t\t\tnew PrimitiveExpression(0)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertHexToDecAction.cs",
    "content": "﻿// \n// ConvertHexToDec.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Convert a hex numer to dec. For example: 0x10 -> 16\n\t/// </summary>\n\t[ContextAction(\"Convert hex to dec.\", Description = \"Convert hex to dec.\")]\n\tpublic class ConvertHexToDecAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar pexpr = context.GetNode<PrimitiveExpression>();\n\t\t\tif (pexpr == null || !pexpr.LiteralValue.StartsWith(\"0X\", System.StringComparison.OrdinalIgnoreCase)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tif (!((pexpr.Value is int) || (pexpr.Value is long) || (pexpr.Value is short) || (pexpr.Value is sbyte) ||\n\t\t\t\t(pexpr.Value is uint) || (pexpr.Value is ulong) || (pexpr.Value is ushort) || (pexpr.Value is byte))) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\t\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert to dec\"), script => {\n\t\t\t\tscript.Replace(pexpr, new PrimitiveExpression (pexpr.Value));\n\t\t\t}, pexpr);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertIfStatementToConditionalTernaryExpressionAction.cs",
    "content": "//\n// ConvertIfStatementToConditionalTernaryExpressionAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert 'if' to '?:'\",\n\t               Description = \"Convert 'if' to '?:'\")]\n\tpublic class ConvertIfStatementToConditionalTernaryExpressionAction : SpecializedCodeAction <IfElseStatement>\n\t{\n\t\tstatic readonly AstNode Pattern = \n\t\t\tnew IfElseStatement(\n\t\t\t\tnew AnyNode(\"condition\"),\n\t\t\t\tPatternHelper.EmbeddedStatement (new ExpressionStatement(new NamedNode (\"assign1\", new AssignmentExpression(new AnyNode(\"target\"), AssignmentOperatorType.Any, new AnyNode(\"expr1\"))))),\n\t\t\t\tPatternHelper.EmbeddedStatement (new ExpressionStatement(new NamedNode (\"assign2\", new AssignmentExpression(new Backreference(\"target\"), AssignmentOperatorType.Any, new AnyNode(\"expr2\")))))\n\t\t\t);\n\n\t\tpublic static bool GetMatch(IfElseStatement ifElseStatement, out Match match)\n\t\t{\n\t\t\tmatch = ConvertIfStatementToConditionalTernaryExpressionAction.Pattern.Match(ifElseStatement);\n\t\t\tif (!match.Success || ifElseStatement.Parent is IfElseStatement)\n\t\t\t\treturn false;\n\t\t\tvar firstAssign = match.Get<AssignmentExpression>(\"assign1\").Single();\n\t\t\tvar secondAssign = match.Get<AssignmentExpression>(\"assign2\").Single();\n\t\t\treturn firstAssign.Operator == secondAssign.Operator;\n\t\t}\n\n\t\tstatic CodeAction CreateAction (BaseRefactoringContext ctx, IfElseStatement ifElseStatement, Match match)\n\t\t{\n\t\t\tvar target = match.Get<Expression>(\"target\").Single();\n\t\t\tvar condition = match.Get<Expression>(\"condition\").Single();\n\t\t\tvar trueExpr = match.Get<Expression>(\"expr1\").Single();\n\t\t\tvar falseExpr = match.Get<Expression>(\"expr2\").Single();\n\t\t\tvar firstAssign = match.Get<AssignmentExpression>(\"assign1\").Single();\n\n\t\t\treturn new CodeAction(\n\t\t\t\tctx.TranslateString(\"Replace with '?:' expression\"),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\tifElseStatement, \n\t\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\t\t\t\ttarget.Clone(),\n\t\t\t\t\t\t\t\tfirstAssign.Operator,\n\t\t\t\t\t\t\t\tnew ConditionalExpression(condition.Clone(), trueExpr.Clone(), falseExpr.Clone())\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t); \n\t\t\t\t},\n\t\t\t\tifElseStatement\n\t\t\t);\n\t\t}\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, IfElseStatement node)\n\t\t{\n\t\t\tif (!node.IfToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tMatch match;\n\t\t\tif (!GetMatch(node, out match))\n\t\t\t\treturn null;\n\t\t\treturn CreateAction(context, node, match);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertIfStatementToNullCoalescingExpressionAction.cs",
    "content": "﻿// \n// ConvertIfToNullCoalescingAction.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Convert 'if' to '??' expression\",\n\t                Category = IssueCategories.Opportunities,\n\t                Description = \"Convert 'if' statement to '??' expression.\")]\n\tpublic class ConvertIfStatementToNullCoalescingExpressionAction : SpecializedCodeAction <IfElseStatement>\n\t{\n\t\tconst string expressionGroupName = \"expression\";\n\t\tconst string comparedNodeGroupName = \"comparedNode\";\n\t\tconst string valueOnNullGroupName = \"valueOnNull\";\n\n\t\tstatic readonly Expression ActionPattern = \n\t\t\tPatternHelper.OptionalParentheses(\n\t\t\t\tnew NamedNode(\n\t\t\t\t\texpressionGroupName, \n\t\t\t\t\tnew Choice {\n\t\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(comparedNodeGroupName), BinaryOperatorType.Equality, new NullReferenceExpression()),\n\t\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(comparedNodeGroupName), BinaryOperatorType.InEquality, new NullReferenceExpression())\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\n\t\tinternal static Expression CheckNode(IfElseStatement node, out Expression rightSide)\n\t\t{\n\t\t\trightSide = null;\n\t\t\tvar match = ActionPattern.Match(node.Condition);\n\t\t\tif (!match.Success)\n\t\t\t\treturn null;\n\t\t\tvar conditionExpression = match.Get<BinaryOperatorExpression>(expressionGroupName).Single();\n\t\t\tbool isEqualityComparison = conditionExpression.Operator == BinaryOperatorType.Equality;\n\t\t\tExpression comparedNode = match.Get<Expression>(comparedNodeGroupName).Single();\n\t\t\tStatement contentStatement;\n\t\t\tif (isEqualityComparison) {\n\t\t\t\tcontentStatement = node.TrueStatement;\n\t\t\t\tif (!IsEmpty(node.FalseStatement))\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcontentStatement = node.FalseStatement;\n\t\t\t\tif (!IsEmpty(node.TrueStatement))\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\tcontentStatement = GetSimpleStatement(contentStatement);\n\t\t\tif (contentStatement == null)\n\t\t\t\treturn null;\n\t\t\tvar leftExpressionPattern = PatternHelper.OptionalParentheses(comparedNode);\n\t\t\tvar expressionPattern = new AssignmentExpression(leftExpressionPattern, AssignmentOperatorType.Assign, new AnyNode(valueOnNullGroupName));\n\t\t\tvar statementPattern = new ExpressionStatement(PatternHelper.OptionalParentheses(expressionPattern));\n\t\t\tvar statementMatch = statementPattern.Match(contentStatement);\n\t\t\tif (!statementMatch.Success)\n\t\t\t\treturn null;\n\t\t\trightSide = statementMatch.Get<Expression>(valueOnNullGroupName).Single();\n\t\t\treturn comparedNode;\n\t\t}\n\n\t\tprotected override CodeAction GetAction (RefactoringContext context, IfElseStatement node)\n\t\t{\n\t\t\tif (!node.IfToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tExpression rightSide;\n\t\t\tvar comparedNode = CheckNode(node, out rightSide);\n\t\t\tif (comparedNode == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction(context.TranslateString(\"Replace with '??'\"),\n\t\t\t                      script => {\n\n\t\t\t\tvar previousNode = node.GetPrevSibling(sibling => sibling is Statement);\n\n\t\t\t\tvar previousDeclaration = previousNode as VariableDeclarationStatement;\n\t\t\t\tif (previousDeclaration != null && previousDeclaration.Variables.Count() == 1) {\n\t\t\t\t\tvar variable = previousDeclaration.Variables.First();\n\n\t\t\t\t\tvar comparedNodeIdentifierExpression = comparedNode as IdentifierExpression;\n\t\t\t\t\tif (comparedNodeIdentifierExpression != null &&\n\t\t\t\t\t    comparedNodeIdentifierExpression.Identifier == variable.Name) {\n\n\t\t\t\t\t\tscript.Replace(variable.Initializer, new BinaryOperatorExpression(variable.Initializer.Clone(),\n\t\t\t\t\t\t                                                                  BinaryOperatorType.NullCoalescing,\n\t\t\t\t\t\t                                                                  rightSide.Clone()));\n\t\t\t\t\t\tscript.Remove(node);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar previousExpressionStatement = previousNode as ExpressionStatement;\n\t\t\t\tif (previousExpressionStatement != null)\n\t\t\t\t{\n\t\t\t\t\tvar previousAssignment = previousExpressionStatement.Expression as AssignmentExpression;\n\t\t\t\t\tif (previousAssignment != null &&\n\t\t\t\t\t    comparedNode.IsMatch(previousAssignment.Left)) {\n\n\t\t\t\t\t\tvar newExpression = new BinaryOperatorExpression(previousAssignment.Right.Clone(),\n\t\t\t\t\t\t                                                 BinaryOperatorType.NullCoalescing,\n\t\t\t\t\t\t                                                 rightSide.Clone());\n\n\t\t\t\t\t\tscript.Replace(previousAssignment.Right, newExpression);\n\t\t\t\t\t\tscript.Remove(node);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar coalescedExpression = new BinaryOperatorExpression(comparedNode.Clone(),\n\t\t\t\t                                                       BinaryOperatorType.NullCoalescing,\n\t\t\t\t                                                       rightSide.Clone());\n\n\t\t\t\tvar newAssignment = new ExpressionStatement(new AssignmentExpression(comparedNode.Clone(), coalescedExpression));\n\t\t\t\tscript.Replace(node, newAssignment);\n\t\t\t}, node);\n\t\t}\n\n\t\tstatic Statement GetSimpleStatement (Statement statement)\n\t\t{\n\t\t\tBlockStatement blockStatement;\n\t\t\twhile ((blockStatement = statement as BlockStatement) != null) {\n\t\t\t\tvar statements = blockStatement.Descendants.OfType<Statement>()\n\t\t\t\t\t.Where(descendant => !IsEmpty(descendant)).ToList();\n\n\t\t\t\tif (statements.Count() != 1) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tstatement = statements.First();\n\t\t\t}\n\t\t\treturn statement;\n\t\t}\n\n\t\tstatic bool IsEmpty (Statement statement)\n\t\t{\n\t\t\treturn statement.IsNull || \n\t\t\t\t!statement.DescendantsAndSelf.OfType<Statement>().Any(descendant => !(descendant is EmptyStatement || descendant is BlockStatement));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertIfStatementToReturnStatementAction.cs",
    "content": "//\n// ConvertIfStatementToReturnStatementAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert 'if' to 'return'\",\n\t               Description = \"Convert 'if' to 'return'\")]\n\tpublic class ConvertIfStatementToReturnStatementAction : SpecializedCodeAction <IfElseStatement>\n\t{\n\t\tstatic readonly AstNode ifElsePattern = \n\t\t\tnew IfElseStatement(\n\t\t\t\tnew AnyNode(\"condition\"),\n\t\t\t\tPatternHelper.EmbeddedStatement (new ReturnStatement(new AnyNode(\"expr1\"))),\n\t\t\t\tPatternHelper.EmbeddedStatement (new ReturnStatement(new AnyNode(\"expr2\")))\n\t\t\t);\n\n\t\tstatic readonly AstNode ifPattern = \n\t\t\tnew IfElseStatement(\n\t\t\t\tnew AnyNode(\"condition\"),\n\t\t\t\tPatternHelper.EmbeddedStatement (new ReturnStatement(new AnyNode(\"expr1\")))\n\t\t\t);\n\n\t\tstatic readonly AstNode returnPattern = \n\t\t\tnew ReturnStatement(new AnyNode(\"expr2\"));\n\n\t\tpublic static bool GetMatch(IfElseStatement ifElseStatement, out Expression condition, out Expression expr1, out Expression expr2, out AstNode returnStatement)\n\t\t{\n\t\t\tvar match = ifElsePattern.Match(ifElseStatement);\n\t\t\treturnStatement = null;\n\t\t\tif (match.Success) {\n\t\t\t\tcondition = match.Get<Expression>(\"condition\").Single();\n\t\t\t\texpr1 = match.Get<Expression>(\"expr1\").Single();\n\t\t\t\texpr2 = match.Get<Expression>(\"expr2\").Single();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tmatch = ifPattern.Match(ifElseStatement);\n\t\t\tif (match.Success) {\n\t\t\t\treturnStatement = ifElseStatement.GetNextSibling(s => s.Role == BlockStatement.StatementRole);\n\t\t\t\tvar match2 = returnPattern.Match(returnStatement);\n\n\t\t\t\tif (match2.Success) {\n\t\t\t\t\tcondition = match.Get<Expression>(\"condition\").Single();\n\t\t\t\t\texpr1 = match.Get<Expression>(\"expr1\").Single();\n\t\t\t\t\texpr2 = match2.Get<Expression>(\"expr2\").Single();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcondition = expr1 = expr2 = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic readonly AstNode truePattern = PatternHelper.OptionalParentheses(new PrimitiveExpression (true));\n\t\tstatic readonly AstNode falsePattern = PatternHelper.OptionalParentheses(new PrimitiveExpression (false));\n\n\t\tstatic Expression CreateCondition(Expression c, Expression e1, Expression e2)\n\t\t{\n\t\t\tif (truePattern.IsMatch(e1) && falsePattern.IsMatch(e2))\n\t\t\t\treturn c.Clone();\n\t\t\treturn new ConditionalExpression(c.Clone(), e1.Clone(), e2.Clone());\n\t\t}\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, IfElseStatement ifElseStatement)\n\t\t{\n\t\t\tif (!ifElseStatement.IfToken.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\tExpression c, e1, e2;\n\t\t\tAstNode rs;\n\t\t\tif (!ConvertIfStatementToReturnStatementAction.GetMatch(ifElseStatement, out c, out e1, out e2, out rs))\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction (\n\t\t\t\tcontext.TranslateString(\"Replace with 'return'\"),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace(ifElseStatement, new ReturnStatement(\n\t\t\t\t\tCreateCondition(c, e1, e2)\n\t\t\t\t)); \n\t\t\t\t\tif (rs != null)\n\t\t\t\t\t\tscript.Remove(rs); \n\t\t\t\t},\n\t\t\t\tifElseStatement\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertIfStatementToSwitchStatementAction.cs",
    "content": "﻿// \n// ConvertIfToSwitchAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\n\t\t\"Convert 'if' to 'switch'\", \n\t\tDescription = \"Convert 'if' statement to 'switch' statement\")]\n\tpublic class ConvertIfStatementToSwitchStatementAction : SpecializedCodeAction<IfElseStatement>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, IfElseStatement node)\n\t\t{\n\t\t\tif (!node.IfToken.Contains (context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar switchExpr = GetSwitchExpression (context, node.Condition);\n\t\t\tif (switchExpr == null)\n\t\t\t\treturn null;\n\n\t\t\tvar switchSections = new List<SwitchSection> ();\n\t\t\tif (!CollectSwitchSections (switchSections, context, node, switchExpr))\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (context.TranslateString (\"Convert to 'switch'\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar switchStatement = new SwitchStatement { Expression = switchExpr.Clone () };\n\t\t\t\t\tswitchStatement.SwitchSections.AddRange (switchSections);\n\t\t\t\t\tscript.Replace (node, switchStatement);\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\n\t\tinternal static Expression GetSwitchExpression (BaseRefactoringContext context, Expression expr)\n\t\t{\n\t\t\tvar binaryOp = expr as BinaryOperatorExpression;\n\t\t\tif (binaryOp == null)\n\t\t\t\treturn null;\n\n\t\t\tif (binaryOp.Operator == BinaryOperatorType.ConditionalOr)\n\t\t\t\treturn GetSwitchExpression (context, binaryOp.Left);\n\n\t\t\tif (binaryOp.Operator == BinaryOperatorType.Equality) {\n\t\t\t\tExpression switchExpr = null;\n\t\t\t\tif (IsConstantExpression (context, binaryOp.Right))\n\t\t\t\t\tswitchExpr = binaryOp.Left;\n\t\t\t\tif (IsConstantExpression (context, binaryOp.Left))\n\t\t\t\t\tswitchExpr = binaryOp.Right;\n\t\t\t\tif (switchExpr != null && IsValidSwitchType (context.Resolve (switchExpr).Type))\n\t\t\t\t\treturn switchExpr;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic bool IsConstantExpression (BaseRefactoringContext context, Expression expr)\n\t\t{\n\t\t\tif (expr is PrimitiveExpression || expr is NullReferenceExpression)\n\t\t\t\treturn true;\n\t\t\treturn context.Resolve (expr).IsCompileTimeConstant;\n\t\t}\n\n\t\tstatic readonly KnownTypeCode [] validTypes = \n\t\t{\n\t\t\tKnownTypeCode.String, KnownTypeCode.Boolean, KnownTypeCode.Char,\n\t\t\tKnownTypeCode.Byte, KnownTypeCode.SByte,\n\t\t\tKnownTypeCode.Int16, KnownTypeCode.Int32, KnownTypeCode.Int64,\n\t\t\tKnownTypeCode.UInt16, KnownTypeCode.UInt32, KnownTypeCode.UInt64\n\t\t};\n\n\t\tstatic bool IsValidSwitchType (IType type)\n\t\t{\n\t\t\tif (type.Kind == TypeKind.Enum)\n\t\t\t\treturn true;\n\t\t\tvar typeDefinition = type.GetDefinition ();\n\t\t\tif (typeDefinition == null)\n\t\t\t\treturn false;\n\n\t\t\tif (typeDefinition.KnownTypeCode == KnownTypeCode.NullableOfT) {\n\t\t\t\tvar nullableType = (ParameterizedType)type;\n\t\t\t\ttypeDefinition = nullableType.TypeArguments [0].GetDefinition ();\n\t\t\t\tif (typeDefinition == null)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Array.IndexOf (validTypes, typeDefinition.KnownTypeCode) != -1;\n\t\t}\n\n\t\tinternal static bool CollectSwitchSections (ICollection<SwitchSection> result, BaseRefactoringContext context, \n\t\t\t\t\t\t\t\t\t\t   IfElseStatement ifStatement, Expression switchExpr)\n\t\t{\n\t\t\t// if\n\t\t\tvar section = new SwitchSection ();\n\t\t\tif (!CollectCaseLabels (section.CaseLabels, context, ifStatement.Condition, switchExpr))\n\t\t\t\treturn false;\n\t\t\tCollectSwitchSectionStatements (section.Statements, context, ifStatement.TrueStatement);\n\t\t\tresult.Add (section);\n\n\t\t\tif (ifStatement.TrueStatement.Descendants.Any(n => n is BreakStatement))\n\t\t\t\treturn false;\n\n\t\t\tif (ifStatement.FalseStatement.IsNull)\n\t\t\t\treturn true;\n\n\t\t\t// else if\n\t\t\tvar falseStatement = ifStatement.FalseStatement as IfElseStatement;\n\t\t\tif (falseStatement != null)\n\t\t\t\treturn CollectSwitchSections (result, context, falseStatement, switchExpr);\n\n\t\t\tif (ifStatement.FalseStatement.Descendants.Any(n => n is BreakStatement))\n\t\t\t\treturn false;\n\t\t\t// else (default label)\n\t\t\tvar defaultSection = new SwitchSection ();\n\t\t\tdefaultSection.CaseLabels.Add (new CaseLabel ());\n\t\t\tCollectSwitchSectionStatements (defaultSection.Statements, context, ifStatement.FalseStatement);\n\t\t\tresult.Add (defaultSection);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic bool CollectCaseLabels (AstNodeCollection<CaseLabel> result, BaseRefactoringContext context, \n\t\t\t\t\t\t\t\t\t   Expression condition, Expression switchExpr)\n\t\t{\n\t\t\tif (condition is ParenthesizedExpression)\n\t\t\t\treturn CollectCaseLabels (result, context, ((ParenthesizedExpression)condition).Expression, switchExpr);\n\n\t\t\tvar binaryOp = condition as BinaryOperatorExpression;\n\t\t\tif (binaryOp == null)\n\t\t\t\treturn false;\n\n\t\t\tif (binaryOp.Operator == BinaryOperatorType.ConditionalOr)\n\t\t\t\treturn CollectCaseLabels (result, context, binaryOp.Left, switchExpr) &&\n\t\t\t\t\t   CollectCaseLabels (result, context, binaryOp.Right, switchExpr);\n\n\t\t\tif (binaryOp.Operator == BinaryOperatorType.Equality) {\n\t\t\t\tif (switchExpr.Match (binaryOp.Left).Success) {\n\t\t\t\t\tif (IsConstantExpression (context, binaryOp.Right)) {\n\t\t\t\t\t\tresult.Add (new CaseLabel (binaryOp.Right.Clone ()));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else if (switchExpr.Match (binaryOp.Right).Success) {\n\t\t\t\t\tif (IsConstantExpression (context, binaryOp.Left)) {\n\t\t\t\t\t\tresult.Add (new CaseLabel (binaryOp.Left.Clone ()));\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tstatic void CollectSwitchSectionStatements (AstNodeCollection<Statement> result, BaseRefactoringContext context, \n\t\t\t\t\t\t\t\t\t\t\t\t    Statement statement)\n\t\t{\n\t\t\tBlockStatement blockStatement = statement as BlockStatement;\n\t\t\tif (blockStatement != null)\n\t\t\t\tresult.AddRange(blockStatement.Statements.Select(s => s.Clone()));\n\t\t\telse\n\t\t\t\tresult.Add(statement.Clone());\n\n\t\t\t// add 'break;' at end if necessary\n\t\t\tvar reachabilityAnalysis = context.CreateReachabilityAnalysis (statement);\n\t\t\tif (reachabilityAnalysis.IsEndpointReachable(statement))\n\t\t\t\tresult.Add(new BreakStatement());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertImplicitToExplicitImplementationAction.cs",
    "content": "﻿// \n// ConvertImplicitToExplicitImplementationAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Convert implict to explicit implementation\",\n\t\t\t\t\tDescription = \" Convert implict implementation of an interface method to explicit implementation\")]\n\tpublic class ConvertImplicitToExplicitImplementationAction : SpecializedCodeAction<MethodDeclaration>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, MethodDeclaration node)\n\t\t{\n\t\t\tif (!node.PrivateImplementationType.IsNull)\n\t\t\t\treturn null;\n\n\t\t\tif (!node.NameToken.Contains (context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar memberResolveResult = context.Resolve(node) as MemberResolveResult;\n\t\t\tif (memberResolveResult == null)\n\t\t\t\treturn null;\n\t\t\tvar method = memberResolveResult.Member as IMethod;\n\t\t\tif (method == null || method.ImplementedInterfaceMembers.Count != 1 || method.DeclaringType.Kind == TypeKind.Interface)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (context.TranslateString (\"Convert implict to explicit implementation\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar explicitImpl = (MethodDeclaration)node.Clone ();\n\t\t\t\t\t// remove visibility modifier\n\t\t\t\t\texplicitImpl.Modifiers &= ~Modifiers.VisibilityMask;\n\t\t\t\t\tvar implementedInterface = method.ImplementedInterfaceMembers [0].DeclaringType;\n\t\t\t\t\texplicitImpl.PrivateImplementationType = context.CreateShortType (implementedInterface);\n\t\t\t\t\tscript.Replace (node, explicitImpl);\n\t\t\t\t},\n\t\t\t\tnode.NameToken\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertLambdaBodyExpressionToStatementAction.cs",
    "content": "﻿// \n// ConvertLambdaBodyExpressionToStatementAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Converts expression of lambda body to statement\",\n\t\t\t\t\tDescription = \"Converts expression of lambda body to statement\")]\n\tpublic class ConvertLambdaBodyExpressionToStatementAction : SpecializedCodeAction<LambdaExpression>\n\t{\n\n\t\tprotected override CodeAction GetAction (RefactoringContext context, LambdaExpression node)\n\t\t{\n\t\t\tif (!node.ArrowToken.Contains (context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar bodyExpr = node.Body as Expression;\n\t\t\tif (bodyExpr == null)\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction (context.TranslateString (\"Convert to lambda statement\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar body = new BlockStatement ();\n\t\t\t\t\tif (RequireReturnStatement (context, node)) {\n\t\t\t\t\t\tbody.Add (new ReturnStatement (bodyExpr.Clone ()));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody.Add (bodyExpr.Clone ());\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace (bodyExpr, body);\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\n\t\tstatic bool RequireReturnStatement (RefactoringContext context, LambdaExpression lambda)\n\t\t{\n\t\t\tvar type = LambdaHelper.GetLambdaReturnType (context, lambda);\n\t\t\treturn type != null && type.ReflectionName != \"System.Void\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertLambdaBodyStatementToExpressionAction.cs",
    "content": "﻿// \n// ConvertLambdaBodyStatementToExpressionAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Converts statement of lambda body to expression\",\n\t\t\t\t\tDescription = \"Converts statement of lambda body to expression\")]\n\tpublic class ConvertLambdaBodyStatementToExpressionAction : SpecializedCodeAction<LambdaExpression>\n\t{\n\t\tinternal static bool TryGetConvertableExpression(AstNode body, out BlockStatement blockStatement, out Expression expr)\n\t\t{\n\t\t\texpr = null;\n\t\t\tblockStatement = body as BlockStatement;\n\t\t\tif (blockStatement == null || blockStatement.Statements.Count > 1)\n\t\t\t\treturn false;\n\t\t\tvar returnStatement = blockStatement.Statements.FirstOrNullObject() as ReturnStatement;\n\t\t\tif (returnStatement != null) {\n\t\t\t\texpr = returnStatement.Expression;\n\t\t\t} else {\n\t\t\t\tvar exprStatement = blockStatement.Statements.FirstOrNullObject() as ExpressionStatement;\n\t\t\t\tif (exprStatement == null)\n\t\t\t\t\treturn false;\n\t\t\t\texpr = exprStatement.Expression;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tinternal static CodeAction CreateAction (BaseRefactoringContext context, AstNode node, BlockStatement blockStatement, Expression expr)\n\t\t{\n\t\t\treturn new CodeAction (\n\t\t\t\tcontext.TranslateString (\"Convert to lambda expression\"),\n\t\t\t\tscript => script.Replace (blockStatement, expr.Clone ()), \n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\n\t\tprotected override CodeAction GetAction (RefactoringContext context, LambdaExpression node)\n\t\t{\n\t\t\tif (!node.ArrowToken.Contains (context.Location))\n\t\t\t\treturn null;\n\n\t\t\tBlockStatement blockStatement;\n\t\t\tExpression expr;\n\t\t\tif (!TryGetConvertableExpression(node.Body, out blockStatement, out expr))\n\t\t\t\treturn null;\n\n\t\t\t\n\t\t\treturn CreateAction (context, node.ArrowToken, blockStatement, expr);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertLambdaToAnonymousDelegateAction.cs",
    "content": "//\n// ConvertLambdaToDelegateAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert lambda to anonymous delegate\",\n\t               Description = \"Converts a lambda to an anonymous delegate.\")]\n\tpublic class ConvertLambdaToAnonymousDelegateAction : SpecializedCodeAction<LambdaExpression>\n\t{\n\t\t#region implemented abstract members of SpecializedCodeAction\n\t\tprotected override CodeAction GetAction(RefactoringContext context, LambdaExpression node)\n\t\t{\n\t\t\tif (context.Location < node.StartLocation || context.Location >= node.Body.StartLocation)\n\t\t\t\treturn null;\n\n\t\t\tvar lambdaResolveResult = context.Resolve(node) as LambdaResolveResult;\n\t\t\tif (lambdaResolveResult == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction(context.TranslateString(\"Convert to anonymous delegate\"), script => {\n\t\t\t\tBlockStatement newBody;\n\t\t\t\tif (node.Body is BlockStatement) {\n\t\t\t\t\tnewBody = (BlockStatement)node.Body.Clone();\n\t\t\t\t} else {\n\t\t\t\t\tvar expression = (Expression)node.Body.Clone();\n\n\t\t\t\t\tStatement statement;\n\t\t\t\t\tif (RequireReturnStatement(context, node)) {\n\t\t\t\t\t\tstatement = new ReturnStatement(expression);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tstatement = expression;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewBody = new BlockStatement {\n\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\tstatement\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tvar method = new AnonymousMethodExpression (newBody, GetParameters(lambdaResolveResult.Parameters, context));\n\t\t\t\tscript.Replace(node, method);\n\t\t\t}, node);\n\t\t}\n\t\t#endregion\n\n\t\tIEnumerable<ParameterDeclaration> GetParameters(IList<IParameter> parameters, RefactoringContext context)\n\t\t{\n\t\t\tif (parameters == null || parameters.Count == 0)\n\t\t\t\treturn null;\n\t\t\tvar result = new List<ParameterDeclaration> ();\n\t\t\tforeach (var parameter in parameters) {\n\t\t\t\tvar type = context.CreateShortType(parameter.Type);\n\t\t\t\tvar name = parameter.Name;\n\t\t\t\tParameterModifier modifier = ParameterModifier.None;\n\t\t\t\tif (parameter.IsRef) \n\t\t\t\t\tmodifier |= ParameterModifier.Ref;\n\t\t\t\tif (parameter.IsOut)\n\t\t\t\t\tmodifier |= ParameterModifier.Out;\n\t\t\t\tresult.Add (new ParameterDeclaration(type, name, modifier));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tstatic bool RequireReturnStatement (RefactoringContext context, LambdaExpression lambda)\n\t\t{\n\t\t\tvar type = LambdaHelper.GetLambdaReturnType (context, lambda);\n\t\t\treturn type != null && type.ReflectionName != \"System.Void\";\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertMethodGroupToAnonymousMethodAction.cs",
    "content": "//\n// ConvertMethodGroupToAnonymousMethodAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert method group to anoymous method\",\n\t               Description = \"Convert method group to anoymous method\")]\n\tpublic class ConvertMethodGroupToAnonymousMethodAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tExpression node = context.GetNode<IdentifierExpression>();\n\t\t\tif (node == null) {\n\t\t\t\tvar mr = context.GetNode<MemberReferenceExpression>();\n\t\t\t\tif (mr == null || !mr.MemberNameToken.IsInside(context.Location))\n\t\t\t\t\tyield break;\n\t\t\t\tnode = mr;\n\t\t\t}\n\t\t\tif (node == null)\n\t\t\t\tyield break;\n\t\t\tvar rr = context.Resolve(node) as MethodGroupResolveResult;\n\t\t\tif (rr == null || rr.IsError)\n\t\t\t\tyield break;\n\t\t\tvar type = TypeGuessing.GetValidTypes(context.Resolver, node).FirstOrDefault(t => t.Kind == TypeKind.Delegate);\n\t\t\tif (type == null)\n\t\t\t\tyield break;\n\t\t\tvar invocationMethod = type.GetDelegateInvokeMethod();\n\t\t\tif (invocationMethod == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Convert to anonymous method\"), \n\t\t\t\tscript => {\n\t\t\t\t\tvar expr = new InvocationExpression(node.Clone(), invocationMethod.Parameters.Select(p => new IdentifierExpression(context.GetNameProposal(p.Name))));\n\t\t\t\t\tvar stmt = invocationMethod.ReturnType.IsKnownType(KnownTypeCode.Void) ? (Statement)expr : new ReturnStatement(expr);\n\t\t\t\t\tvar anonymousMethod = new AnonymousMethodExpression {\n\t\t\t\t\t\tBody = new BlockStatement { stmt }\n\t\t\t\t\t};\n\t\t\t\t\tforeach (var p in invocationMethod.Parameters) {\n\t\t\t\t\t\tvar decl = new ParameterDeclaration(context.CreateShortType(p.Type), context.GetNameProposal(p.Name));\n\t\t\t\t\t\tanonymousMethod.Parameters.Add(decl); \n\t\t\t\t\t}\n\n\t\t\t\t\tscript.Replace(node, anonymousMethod);\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertMethodGroupToLambdaAction.cs",
    "content": "//\n// ConvertMethodGroupToLambdaAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert method group to lambda expression\",\n\t               Description = \"Convert method group to lambda expression\")]\n\tpublic class ConvertMethodGroupToLambdaAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tExpression node = context.GetNode<IdentifierExpression>();\n\t\t\tif (node == null) {\n\t\t\t\tvar mr = context.GetNode<MemberReferenceExpression>();\n\t\t\t\tif (mr == null || !mr.MemberNameToken.IsInside(context.Location))\n\t\t\t\t\tyield break;\n\t\t\t\tnode = mr;\n\t\t\t}\n\t\t\tif (node == null)\n\t\t\t\tyield break;\n\t\t\tvar rr = context.Resolve(node) as MethodGroupResolveResult;\n\t\t\tif (rr == null || rr.IsError)\n\t\t\t\tyield break;\n\t\t\tvar type = TypeGuessing.GetValidTypes(context.Resolver, node).FirstOrDefault(t => t.Kind == TypeKind.Delegate);\n\t\t\tif (type == null)\n\t\t\t\tyield break;\n\t\t\tvar invocationMethod = type.GetDelegateInvokeMethod();\n\t\t\tif (invocationMethod == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Convert to lambda expression\"), \n\t\t\t\tscript => {\n\t\t\t\t\tvar invocation = new InvocationExpression(node.Clone(), invocationMethod.Parameters.Select(p => new IdentifierExpression(context.GetNameProposal(p.Name))));\n\t\t\t\t\tvar lambda = new LambdaExpression {\n\t\t\t\t\t\tBody = invocation\n\t\t\t\t\t};\n\t\t\t\t\tlambda.Parameters.AddRange(\n\t\t\t\t\t\tinvocation.Arguments\n\t\t\t\t\t\t\t.Cast<IdentifierExpression>()\n\t\t\t\t\t\t\t.Select(p => new ParameterDeclaration { Name = p.Identifier })\n\t\t\t\t\t);\n\t\t\t\t\tscript.Replace(node, lambda);\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertMultiplyToShiftAction.cs",
    "content": "//\n// ConvertMultiplyToShiftAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert '*'/'/' to '<<'/'>>'\",\n\t               Description = \"Convert '*'/'/' to '<<'/'>>'\")]\n\tpublic class ConvertMultiplyToShiftAction : SpecializedCodeAction<BinaryOperatorExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, BinaryOperatorExpression node)\n\t\t{\n\t\t\tif (!node.OperatorToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tif (node.Operator != BinaryOperatorType.Multiply && node.Operator != BinaryOperatorType.Divide || !(node.Right is PrimitiveExpression))\n\t\t\t\treturn null;\n\n\t\t\tvar valueObj = context.Resolve(node.Right).ConstantValue;\n\t\t\tif (!(valueObj is int))\n\t\t\t\treturn null;\n\t\t\tvar value = (int)valueObj;\n\n\t\t\tvar log2 = (int)Math.Log(value, 2);\n\t\t\tif (value != 1 << log2)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (\n\t\t\t\tnode.Operator == BinaryOperatorType.Multiply ? context.TranslateString(\"Replace with '<<'\") : context.TranslateString(\"Replace with '>>'\"),\n\t\t\t\tscript => script.Replace(\n\t\t\t\t\tnode, \n\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\tnode.Left.Clone(), \n\t\t\t\t\t\tnode.Operator == BinaryOperatorType.Multiply ? BinaryOperatorType.ShiftLeft : BinaryOperatorType.ShiftRight,\n\t\t\t\t\t\tnew PrimitiveExpression(log2)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertNullCoalescingToConditionalExpressionAction.cs",
    "content": "//\n// ConvertNullCoalescingToConditionalExpressionAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert '??' to '?:'\",\n\t               Description = \"Convert '??' to '?:'\")]\n\tpublic class ConvertNullCoalescingToConditionalExpressionAction : SpecializedCodeAction<BinaryOperatorExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext ctx, BinaryOperatorExpression node)\n\t\t{\n\t\t\tif (node.Operator != BinaryOperatorType.NullCoalescing || !node.OperatorToken.Contains(ctx.Location))\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction(\n\t\t\t\tctx.TranslateString(\"Replace with '?:' expression\"),\n\t\t\t\tscript => {\n\t\t\t\t\tExpression expr = new ConditionalExpression (\n\t\t\t\t\t\tnew BinaryOperatorExpression(node.Left.Clone(), BinaryOperatorType.InEquality, new NullReferenceExpression ()),\n\t\t\t\t\t\tnode.Left.Clone(),\n\t\t\t\t\t\tnode.Right.Clone()\n\t\t\t\t\t);\n\t\t\t\t\tscript.Replace(node, expr);\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertReturnStatementToIfAction.cs",
    "content": "//\n// ConvertReturnStatementToIfAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert 'return' to 'if'\",\n\t               Description = \"Convert 'return' to 'if'\")]\n\tpublic class ConvertReturnStatementToIfAction : SpecializedCodeAction <ReturnStatement>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, ReturnStatement node)\n\t\t{\n\t\t\tif (!node.ReturnToken.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\tif (node.Expression is ConditionalExpression)\n\t\t\t\treturn CreateForConditionalExpression(context, node, (ConditionalExpression)node.Expression);\n\t\t\tvar bOp = node.Expression as BinaryOperatorExpression;\n\t\t\tif (bOp != null && bOp.Operator == BinaryOperatorType.NullCoalescing)\n\t\t\t\treturn CreateForNullCoalesingExpression(context, node, bOp);\n\t\t\treturn null;\n\t\t}\n\n\t\tCodeAction CreateForConditionalExpression(RefactoringContext ctx, ReturnStatement node, ConditionalExpression conditionalExpression)\n\t\t{\n\t\t\treturn new CodeAction (\n\t\t\t\tctx.TranslateString(\"Replace with 'if' statement\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar ifStatement = new IfElseStatement(conditionalExpression.Condition.Clone(), new ReturnStatement(conditionalExpression.TrueExpression.Clone()));\n\t\t\t\t\tscript.Replace(node, ifStatement); \n\t\t\t\t\tscript.InsertAfter(ifStatement, new ReturnStatement(conditionalExpression.FalseExpression.Clone()));\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\n\t\tCodeAction CreateForNullCoalesingExpression(RefactoringContext ctx, ReturnStatement node, BinaryOperatorExpression bOp)\n\t\t{\n\t\t\treturn new CodeAction (\n\t\t\t\tctx.TranslateString(\"Replace with 'if' statement\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar ifStatement = new IfElseStatement(new BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.InEquality, new NullReferenceExpression()), new ReturnStatement(bOp.Left.Clone()));\n\t\t\t\t\tscript.Replace(node, ifStatement); \n\t\t\t\t\tscript.InsertAfter(ifStatement, new ReturnStatement(bOp.Right.Clone()));\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertShiftToMultiplyAction.cs",
    "content": "//\n// ConvertShiftToMultiplyAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert '<<'/'>>' to '*'/'/'\",\n\t               Description = \"Convert '<<'/'>>' to '*'/'/'\")]\n\tpublic class ConvertShiftToMultiplyAction : SpecializedCodeAction <BinaryOperatorExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, BinaryOperatorExpression node)\n\t\t{\n\t\t\tif (!node.OperatorToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tif (node.Operator != BinaryOperatorType.ShiftLeft && node.Operator != BinaryOperatorType.ShiftRight || !(node.Right is PrimitiveExpression))\n\t\t\t\treturn null;\n\n\t\t\tvar value = context.Resolve(node.Right).ConstantValue;\n\t\t\tif (!(value is int))\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (\n\t\t\t\tnode.Operator == BinaryOperatorType.ShiftLeft ? context.TranslateString(\"Replace with '*'\") : context.TranslateString(\"Replace with '/'\"),\n\t\t\t\tscript => script.Replace(\n\t\t\t\t\tnode, \n\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\tnode.Left.Clone(), \n\t\t\t\t\t\tnode.Operator == BinaryOperatorType.ShiftLeft ? BinaryOperatorType.Multiply : BinaryOperatorType.Divide,\n\t\t\t\t\t\tnew PrimitiveExpression(1 << (int)value)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertSwitchToIfAction.cs",
    "content": "﻿// \n// ConvertSwitchToIfAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Convert 'switch' to 'if'\", Description = \"Convert 'switch' statement to 'if' statement\")]\n\tpublic class ConvertSwitchToIfAction : SpecializedCodeAction<SwitchStatement>\n\t{\n\t\tstatic readonly InsertParenthesesVisitor insertParenthesesVisitor = new InsertParenthesesVisitor ();\n\n\t\tprotected override CodeAction GetAction (RefactoringContext context, SwitchStatement node)\n\t\t{\n\t\t\tif (!node.SwitchToken.Contains (context.Location))\n\t\t\t\treturn null;\n\n\t\t\t// empty switch\n\t\t\tif (node.SwitchSections.Count == 0)\n\t\t\t\treturn null;\n\n\t\t\t// switch with default only\n\t\t\tif (node.SwitchSections.First ().CaseLabels.Any (label => label.Expression.IsNull))\n\t\t\t\treturn null;\n\n\t\t\t// check non-trailing breaks\n\t\t\tforeach (var switchSection in node.SwitchSections) {\n\t\t\t\tvar lastStatement = switchSection.Statements.LastOrDefault ();\n\t\t\t\tvar finder = new NonTrailingBreakFinder (lastStatement as BreakStatement);\n\t\t\t\tif (switchSection.AcceptVisitor (finder))\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn new CodeAction (context.TranslateString (\"Convert to 'if'\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tIfElseStatement ifStatement = null;\n\t\t\t\t\tIfElseStatement currentStatement = null;\n\t\t\t\t\tforeach (var switchSection in node.SwitchSections) {\n\t\t\t\t\t\tvar condition = CollectCondition (node.Expression, switchSection.CaseLabels);\n\t\t\t\t\t\tvar bodyStatement = new BlockStatement ();\n\t\t\t\t\t\tvar lastStatement = switchSection.Statements.LastOrDefault ();\n\t\t\t\t\t\tforeach (var statement in switchSection.Statements) {\n\t\t\t\t\t\t\t// skip trailing break\n\t\t\t\t\t\t\tif (statement == lastStatement && statement is BreakStatement)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tbodyStatement.Add (statement.Clone ());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// default -> else\n\t\t\t\t\t\tif (condition == null) {\n\t\t\t\t\t\t\tcurrentStatement.FalseStatement = bodyStatement;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar elseIfStatement = new IfElseStatement (condition, bodyStatement);\n\t\t\t\t\t\tif (ifStatement == null)\n\t\t\t\t\t\t\tifStatement = elseIfStatement;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcurrentStatement.FalseStatement = elseIfStatement;\n\t\t\t\t\t\tcurrentStatement = elseIfStatement;\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace (node, ifStatement);\n\t\t\t\t\tscript.FormatText (ifStatement);\n\t\t\t\t}, node);\n\t\t}\n\n\t\tstatic Expression CollectCondition(Expression switchExpr, AstNodeCollection<CaseLabel> caseLabels)\n\t\t{\n\t\t\t// default\n\t\t\tif (caseLabels.Count == 0 || caseLabels.Any (label => label.Expression.IsNull))\n\t\t\t\treturn null;\n\n\t\t\tvar conditionList = caseLabels.Select (\n\t\t\t\tlabel => new BinaryOperatorExpression (switchExpr.Clone (), BinaryOperatorType.Equality, label.Expression.Clone ()))\n\t\t\t\t.ToArray ();\n\n\t\t\t// insert necessary parentheses\n\t\t\tforeach (var expr in conditionList)\n\t\t\t\texpr.AcceptVisitor (insertParenthesesVisitor);\n\n\t\t\tif (conditionList.Length == 1)\n\t\t\t\treturn conditionList [0];\n\n\t\t\t// combine case labels into an conditional or expression\n\t\t\tBinaryOperatorExpression condition = null;\n\t\t\tBinaryOperatorExpression currentCondition = null;\n\t\t\tfor (int i = 0; i < conditionList.Length - 1; i++) {\n\t\t\t\tvar newCondition = new BinaryOperatorExpression\n\t\t\t\t{\n\t\t\t\t\tOperator = BinaryOperatorType.ConditionalOr,\n\t\t\t\t\tLeft = conditionList[i]\n\t\t\t\t};\n\t\t\t\tif (currentCondition == null)\n\t\t\t\t\tcondition = newCondition;\n\t\t\t\telse\n\t\t\t\t\tcurrentCondition.Right = newCondition;\n\t\t\t\tcurrentCondition = newCondition;\n\t\t\t}\n\t\t\tcurrentCondition.Right = conditionList [conditionList.Length - 1];\n\n\t\t\treturn condition;\n\t\t}\n\t\t\n\t\tclass NonTrailingBreakFinder : DepthFirstAstVisitor<bool>\n\t\t{\n\t\t\tBreakStatement trailingBreakStatement;\n\n\t\t\tpublic NonTrailingBreakFinder (BreakStatement trailingBreak)\n\t\t\t{\n\t\t\t\ttrailingBreakStatement = trailingBreak;\n\t\t\t}\n\n\t\t\tprotected override bool VisitChildren (AstNode node)\n\t\t\t{\n\t\t\t\treturn node.Children.Any (child => child.AcceptVisitor (this));\n\t\t\t}\n\n\t\t\tpublic override bool VisitBreakStatement (BreakStatement breakStatement)\n\t\t\t{\n\t\t\t\treturn breakStatement != trailingBreakStatement;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertToInitializer/AccessPath.cs",
    "content": "//\n// InitializerPath.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tclass AccessPath\n\t{\n\t\tpublic AccessPath(IVariable target)\n\t\t{\n\t\t\tVariableRoot = target;\n\t\t\tMemberPath = new List<IMember>();\n\t\t}\n\n\t\tpublic static AccessPath FromResolveResult(ResolveResult resolveResult)\n\t\t{\n\t\t\tvar memberPath = new List<IMember>();\n\t\t\tvar currentResolveResult = resolveResult;\n\t\t\tdo {\n\t\t\t\tif (currentResolveResult is MemberResolveResult) {\n\t\t\t\t\tvar memberResolveResult = (MemberResolveResult)currentResolveResult;\n\t\t\t\t\tmemberPath.Add(memberResolveResult.Member);\n\t\t\t\t\tcurrentResolveResult = memberResolveResult.TargetResult;\n\t\t\t\t} else if (currentResolveResult is LocalResolveResult) {\n\t\t\t\t\t// This is the root variable\n\t\t\t\t\tvar localResolveResult = (LocalResolveResult)currentResolveResult;\n\t\t\t\t\tmemberPath.Reverse();\n\t\t\t\t\treturn new AccessPath(localResolveResult.Variable) {\n\t\t\t\t\t\tMemberPath = memberPath\n\t\t\t\t\t};\n\t\t\t\t} else if (currentResolveResult is ThisResolveResult) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t// Unsupported path\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} while (currentResolveResult != null);\n\n\t\t\tmemberPath.Reverse();\n\t\t\treturn new AccessPath(null) {\n\t\t\t\tMemberPath = memberPath\n\t\t\t};\n\t\t}\n\n\t\tpublic AccessPath GetParentPath()\n\t\t{\n\t\t\tif (MemberPath.Count < 1)\n\t\t\t\tthrow new InvalidOperationException(\"Cannot get the parent path of a path that does not contain any members.\");\n\t\t\treturn new AccessPath(VariableRoot) {\n\t\t\t\tMemberPath = MemberPath.Take(MemberPath.Count - 1).ToList()\n\t\t\t};\n\t\t}\n\n\t\tpublic bool IsSubPath(AccessPath other)\n\t\t{\n\t\t\tif (!object.Equals(other.VariableRoot, VariableRoot))\n\t\t\t\treturn false;\n\t\t\tif (MemberPath.Count <= other.MemberPath.Count)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < other.MemberPath.Count; i++) {\n\t\t\t\tif (MemberPath [i] != other.MemberPath [i])\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic IVariable VariableRoot { get; set; }\n\n\t\tpublic int PartCount {\n\t\t\tget {\n\t\t\t\treturn MemberPath.Count + (VariableRoot == null ? 0 : 1);\n\t\t\t}\n\t\t}\n\n\t\tpublic string RootName {\n\t\t\tget {\n\t\t\t\tif (VariableRoot != null)\n\t\t\t\t\treturn VariableRoot.Name;\n\t\t\t\treturn MemberPath.First().Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<IMember> MemberPath { get; private set; }\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (obj == null || obj.GetType() != typeof(AccessPath))\n\t\t\t\treturn false;\n\n\t\t\tvar other = (AccessPath)obj;\n\n\t\t\tif (!object.Equals(VariableRoot, other.VariableRoot))\n\t\t\t\treturn false;\n\n\t\t\tif (MemberPath.Count != other.MemberPath.Count)\n\t\t\t\treturn false;\n\n\t\t\tfor (int i = 0; i < MemberPath.Count; i++) {\n\t\t\t\tif (!object.Equals(MemberPath [i], other.MemberPath [i]))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tint hash = VariableRoot != null ? VariableRoot.GetHashCode() : 37;\n\t\t\tforeach (var member in MemberPath)\n\t\t\t\thash ^= 31 * member.GetHashCode();\n\t\t\treturn hash;\n\t\t}\n\n\t\tpublic static bool operator==(AccessPath left, AccessPath right)\n\t\t{\n\t\t\treturn object.Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator!=(AccessPath left, AccessPath right)\n\t\t{\n\t\t\treturn !object.Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tstring memberPathString = string.Join(\".\", MemberPath.Select<IMember, string>(member => member.Name));\n\t\t\tif (VariableRoot == null)\n\t\t\t\treturn string.Format(\"[AccessPath: {0}]\", memberPathString);\n\t\t\treturn string.Format(\"[AccessPath: {0}.{1}]\", VariableRoot.Name, memberPathString);\n\t\t}\n\t}\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertToInitializer/ConvertInitializerToExplicitInitializationsAction.cs",
    "content": "//\n// ConvertInitializerToExplicitInitializationsAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert to explicit initializers\",\n\t               Description = \"Converts an object or collection initializer to explicit initializations.\")]\n\tpublic class ConvertInitializerToExplicitInitializationsAction : CodeActionProvider\n\t{\n\t\t#region ICodeActionProvider implementation\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar codeAction = GetActionForVariableInitializer(context);\n\t\t\tif (codeAction != null) {\n\t\t\t\tyield return codeAction;\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tcodeAction = GetActionForAssignmentExpression(context);\n\t\t\tif (codeAction != null) {\n\t\t\t\tyield return codeAction;\n\t\t\t\tyield break;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic CodeAction GetActionForVariableInitializer(RefactoringContext context)\n\t\t{\n\t\t\tvar variableInitializer = context.GetNode<VariableInitializer>();\n\t\t\tif (variableInitializer == null)\n\t\t\t\treturn null;\n\t\t\tvar declaration = variableInitializer.Parent as VariableDeclarationStatement;\n\t\t\tif (declaration == null)\n\t\t\t\treturn null;\n\t\t\tif (variableInitializer.Initializer.IsNull)\n\t\t\t\treturn null;\n\t\t\tvar objectCreateExpression = variableInitializer.Initializer as ObjectCreateExpression;\n\t\t\tif (objectCreateExpression == null)\n\t\t\t\treturn null;\n\t\t\tvar converter = new InitializerConversionVisitor(context);\n\t\t\tExpression finalExpression;\n\t\t\tvar statements = converter.ConvertInitializer(objectCreateExpression, out finalExpression);\n\t\t\tif (statements.Count > 0) {\n\t\t\t\treturn new CodeAction(context.TranslateString(\"Convert to explicit initializers\"), script => {\n\t\t\t\t\tforeach (var statement in statements) {\n\t\t\t\t\t\tscript.InsertBefore(declaration, statement);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace(variableInitializer.Initializer, finalExpression);\n\t\t\t\t}, variableInitializer);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic CodeAction GetActionForAssignmentExpression(RefactoringContext context)\n\t\t{\n\t\t\tvar assignmentExpression = context.GetNode<AssignmentExpression>();\n\t\t\tif (assignmentExpression == null)\n\t\t\t\treturn null;\n\t\t\tvar expressionStatement = assignmentExpression.Parent as ExpressionStatement;\n\t\t\tif (expressionStatement == null)\n\t\t\t\treturn null;\n\t\t\tvar objectCreateExpression = assignmentExpression.Right as ObjectCreateExpression;\n\t\t\tif (objectCreateExpression == null)\n\t\t\t\treturn null;\n\t\t\tvar converter = new InitializerConversionVisitor(context);\n\t\t\tExpression finalExpression;\n\t\t\tvar statements = converter.ConvertInitializer(objectCreateExpression, out finalExpression);\n\t\t\tif (statements.Count > 0) {\n\t\t\t\treturn new CodeAction(context.TranslateString(\"Convert to explicit initializers\"), script => {\n\t\t\t\t\tforeach (var statement in statements) {\n\t\t\t\t\t\tscript.InsertBefore(expressionStatement, statement);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace(assignmentExpression.Right, finalExpression);\n\t\t\t\t}, assignmentExpression);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t#endregion\n\n\t\tclass InitializerConversionVisitor : DepthFirstAstVisitor<Expression, Expression>\n\t\t{\n\t\t\tRefactoringContext context;\n\t\t\tIList<Statement> statements;\n\t\t\tNamingHelper namingHelper;\n\n\t\t\tpublic InitializerConversionVisitor(RefactoringContext context)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t\tnamingHelper = new NamingHelper(context);\n\t\t\t}\n\n\t\t\tAstType GetDeclarationType(AstType type)\n\t\t\t{\n\t\t\t\tAstType declarationType;\n\t\t\t\tif (context.UseExplicitTypes) {\n\t\t\t\t\tdeclarationType = type.Clone();\n\t\t\t\t} else {\n\t\t\t\t\tdeclarationType = new SimpleType(\"var\");\n\t\t\t\t}\n\t\t\t\treturn declarationType;\n\t\t\t}\n\n\t\t\tpublic IList<Statement> ConvertInitializer(ObjectCreateExpression initializer, out Expression finalExpression)\n\t\t\t{\n\t\t\t\tstatements = new List<Statement>();\n\n\t\t\t\tfinalExpression = initializer.AcceptVisitor(this, null);\n\n\t\t\t\treturn statements;\n\t\t\t}\n\n\t\t\tpublic override Expression VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, Expression data)\n\t\t\t{\n\t\t\t\tvar creationType = objectCreateExpression.Type.Clone();\n\n\t\t\t\tvar parameters = objectCreateExpression.Arguments.Select(arg => arg.Clone());\n\t\t\t\tvar newCreation = new ObjectCreateExpression(creationType, parameters);\n\t\t\t\tif (objectCreateExpression.Initializer.IsNull) {\n\t\t\t\t\treturn newCreation;\n\t\t\t\t} else {\n\t\t\t\t\tAstType declarationType = GetDeclarationType(objectCreateExpression.Type);\n\t\t\t\t\tvar name = namingHelper.GenerateVariableName(objectCreateExpression.Type);\n\t\t\t\t\tvar variableInitializer = new VariableDeclarationStatement(declarationType, name, newCreation);\n\t\t\t\t\tstatements.Add(variableInitializer);\n\n\t\t\t\t\tvar identifier = new IdentifierExpression(name);\n\t\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression, identifier);\n\n\t\t\t\t\treturn identifier;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override Expression VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression, Expression data)\n\t\t\t{\n\t\t\t\tif (!(arrayInitializerExpression.Parent is ArrayInitializerExpression)) {\n\t\t\t\t\treturn base.VisitArrayInitializerExpression(arrayInitializerExpression, data);\n\t\t\t\t}\n\t\t\t\t// this a tuple in a collection initializer\n\t\t\t\tvar arguments = arrayInitializerExpression.Elements.Select(element => element.AcceptVisitor(this, null).Clone());\n\t\t\t\tvar method = new MemberReferenceExpression {\n\t\t\t\t\tTarget = data.Clone(),\n\t\t\t\t\tMemberName = \"Add\"\n\t\t\t\t};\n\t\t\t\tstatements.Add(new InvocationExpression(method, arguments));\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override Expression VisitNamedExpression(NamedExpression namedExpression, Expression data)\n\t\t\t{\n\t\t\t\tvar member = new MemberReferenceExpression {\n\t\t\t\t\tTarget = data.Clone(),\n\t\t\t\t\tMemberName = namedExpression.Name\n\t\t\t\t};\n\t\t\t\tvar expression = namedExpression.Expression.AcceptVisitor(this, member);\n\t\t\t\tif (expression != null) {\n\t\t\t\t\tvar statement = new ExpressionStatement {\n\t\t\t\t\t\tExpression = new AssignmentExpression {\n\t\t\t\t\t\t\tLeft = member,\n\t\t\t\t\t\t\tRight = expression.Clone()\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tstatements.Add(statement);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tprotected override Expression VisitChildren(AstNode node, Expression data)\n\t\t\t{\n\t\t\t\t// Most expressions should just be used as-is, and\n\t\t\t\t// a) need not be visited\n\t\t\t\t// b) only return themselves\n\t\t\t\tif (node is Expression && !(node is ObjectCreateExpression || node is ArrayInitializerExpression || node is NamedExpression)){\n\t\t\t\t\treturn (Expression)node;\n\t\t\t\t}\n\t\t\t\treturn base.VisitChildren(node, data);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertToInitializer/ConvertToInitializerAction.cs",
    "content": "//\n// ConvertToInitializerAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[ContextAction(\"Convert to initializer\",\n//\t               Description = \"Converts a set of assignments and .Add() calls to an initializer.\")]\n\tpublic class ConvertToInitializerAction : CodeActionProvider\n\t{\n\t\t#region ICodeActionProvider implementation\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar initializer = context.GetNode<VariableInitializer>();\n\t\t\tif (initializer != null) {\n\t\t\t\tvar action = HandleInitializer(context, initializer);\n\t\t\t\tif (action != null)\n\t\t\t\t\tyield return action;\n\t\t\t}\n\t\t\tvar expressionStatement = context.GetNode<ExpressionStatement>();\n\t\t\tif (expressionStatement != null) {\n\t\t\t\tvar action = HandleExpressionStatement(context, expressionStatement);\n\t\t\t\tif (action != null)\n\t\t\t\t\tyield return action;\n\t\t\t}\n\t\t}\n\n\t\tCodeAction HandleInitializer(RefactoringContext context, VariableInitializer initializer)\n\t\t{\n\t\t\tvar objectCreateExpression = initializer.Initializer as ObjectCreateExpression;\n\t\t\tif (objectCreateExpression == null)\n\t\t\t\treturn null;\n\t\t\tvar initializerRR = context.Resolve(initializer) as LocalResolveResult;\n\t\t\tif (initializerRR == null)\n\t\t\t\treturn null;\n\t\t\tIList<AstNode> statements = GetNodes(context.GetNode<Statement>());\n\t\t\tvar converter = new StatementsToInitializerConverter(context);\n\t\t\tvar newInitializer = converter.ConvertToInitializer(initializer, ref statements);\n\t\t\tif (newInitializer == null || statements.Count == 0)\n\t\t\t\treturn null;\n\t\t\treturn MakeAction(context, initializer, newInitializer, statements);\n\t\t}\n\n\t\tCodeAction HandleExpressionStatement(RefactoringContext context, ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tvar expression = expressionStatement.Expression as AssignmentExpression;\n\t\t\tif (expression == null || expression.Operator != AssignmentOperatorType.Assign)\n\t\t\t\treturn null;\n\t\t\tif (!(expression.Right is ObjectCreateExpression))\n\t\t\t\treturn null;\n\t\t\tvar expressionResolveResult = context.Resolve(expression.Left);\n\t\t\tif (!(expressionResolveResult is LocalResolveResult) && !(expressionResolveResult is MemberResolveResult))\n\t\t\t\treturn null;\n\t\t\tIList<AstNode> statements = GetNodes(context.GetNode<Statement>());\n\t\t\tvar converter = new StatementsToInitializerConverter(context);\n\t\t\tvar newExpression = converter.ConvertToInitializer(expression, ref statements);\n\t\t\tif (newExpression == null || statements.Count == 0)\n\t\t\t\treturn null;\n\t\t\treturn MakeAction(context, expression, newExpression, statements);\n\t\t}\n\t\t\n\t\tList<AstNode> GetNodes(Statement startStatement)\n\t\t{\n\t\t\tvar statements = new List<AstNode>();\n\t\t\tAstNode currentNode = startStatement.NextSibling;\n\t\t\twhile (currentNode != null) {\n\t\t\t\tif (currentNode is Statement || currentNode is Comment)\n\t\t\t\t\tstatements.Add(currentNode);\n\t\t\t\tcurrentNode = currentNode.NextSibling;\n\t\t\t}\n\t\t\treturn statements;\n\t\t}\n\t\t\n\t\tCodeAction MakeAction(RefactoringContext context, AstNode oldNode, AstNode replacementNode, IEnumerable<AstNode> toRemove)\n\t\t{\n\t\t\treturn new CodeAction(context.TranslateString(\"Convert to initializer\"), script => {\n\t\t\t\tforeach (var statement in toRemove)\n\t\t\t\t\tscript.Remove(statement);\n\t\t\t\tscript.Replace(oldNode, replacementNode);\n\t\t\t}, oldNode);\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertToInitializer/StatementsToInitializerConverter.cs",
    "content": "//\n// StatementsToInitializerConverter.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Threading;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic class StatementsToInitializerConverter\n\t{\n\t\tIDictionary<AccessPath, Expression> accessPaths = new Dictionary<AccessPath, Expression>();\n\t\tIList<Comment> comments = new List<Comment>();\n\t\tAccessPath mainAccessPath;\n\t\tRefactoringContext context;\n\n\t\tpublic StatementsToInitializerConverter(RefactoringContext context)\n\t\t{\n\t\t\tthis.context = context;\n\t\t}\n\n\t\tbool Initialize(AstNode targetNode)\n\t\t{\n\t\t\tvar target = context.Resolve(targetNode);\n\t\t\tvar targetInitializerPath = AccessPath.FromResolveResult(target);\n\t\t\tif (targetInitializerPath == null)\n\t\t\t\treturn false;\n\n\t\t\tmainAccessPath = targetInitializerPath;\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic VariableInitializer ConvertToInitializer(VariableInitializer variableInitializer, ref IList<AstNode> statements)\n\t\t{\n\t\t\tif (variableInitializer == null)\n\t\t\t\tthrow new ArgumentNullException(\"variableInitializer\");\n\t\t\tif (statements == null)\n\t\t\t\tthrow new ArgumentNullException(\"statements\");\n\n\t\t\tif (!Initialize(variableInitializer))\n\t\t\t\treturn null;\n\t\t\taccessPaths [mainAccessPath] = variableInitializer.Initializer.Clone();\n\n\t\t\tConvert(statements);\n\t\t\tstatements = ReplacementNodeHelper.GetReplacedNodes(accessPaths [mainAccessPath]);\n\t\t\treturn new VariableInitializer(mainAccessPath.RootName, accessPaths [mainAccessPath]);\n\t\t}\n\n\t\tpublic AssignmentExpression ConvertToInitializer(AssignmentExpression assignmentExpression, ref IList<AstNode> statements)\n\t\t{\n\t\t\tif (assignmentExpression == null)\n\t\t\t\tthrow new ArgumentNullException(\"assignmentExpression\");\n\t\t\tif (statements == null)\n\t\t\t\tthrow new ArgumentNullException(\"statements\");\n\t\t\tif (!(assignmentExpression.Right is ObjectCreateExpression))\n\t\t\t\tthrow new ArgumentException(\"assignmentExpression.Right must be an ObjectCreateExpression\", \"assignmentExpression\");\n\n\t\t\tif (!Initialize(assignmentExpression.Left))\n\t\t\t\treturn null;\n\t\t\taccessPaths [mainAccessPath] = assignmentExpression.Right.Clone();\n\n\t\t\tConvert(statements);\n\t\t\tstatements = ReplacementNodeHelper.GetReplacedNodes(accessPaths [mainAccessPath]);\n\t\t\treturn new AssignmentExpression(new IdentifierExpression(mainAccessPath.RootName), accessPaths [mainAccessPath]);\n\t\t}\n\n\t\tvoid Convert(IList<AstNode> originalStatements)\n\t\t{\n\t\t\tforeach (var node in originalStatements) {\n\t\t\t\tvar comment = node as Comment;\n\t\t\t\tif (comment != null) {\n\t\t\t\t\tcomments.Add((Comment)ReplacementNodeHelper.CloneWithReplacementAnnotation(comment, node));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar success = TryHandleInitializer(node);\n\t\t\t\tif (success) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar expressionStatement = node as ExpressionStatement;\n\t\t\t\tif (expressionStatement == null)\n\t\t\t\t\tbreak;\n\t\t\t\tsuccess = TryHandleAssignmentExpression(expressionStatement);\n\t\t\t\tif (success) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsuccess = TryHandleAddCall(expressionStatement);\n\t\t\t\tif (success) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tbool TryHandleInitializer(AstNode node)\n\t\t{\n\t\t\tVariableInitializer variableInitializer;\n\t\t\tvar variableDeclarationStatement = node as VariableDeclarationStatement;\n\t\t\tif (variableDeclarationStatement == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvariableInitializer = variableDeclarationStatement.Variables.FirstOrNullObject();\n\t\t\tif (variableInitializer.IsNull || variableInitializer.Initializer.IsNull)\n\t\t\t\treturn false;\n\t\t\tvar sourceResolveResult = context.Resolve(variableInitializer.Initializer) as LocalResolveResult;\n\t\t\tif (HasDependency(variableInitializer.Initializer) && !CanReplaceDependent(sourceResolveResult))\n\t\t\t\treturn false;\n\t\t\tvar targetResolveResult = context.Resolve(variableInitializer) as LocalResolveResult;\n\t\t\tif (targetResolveResult == null)\n\t\t\t\treturn false;\n\t\t\tAddNewVariable(targetResolveResult.Variable, variableInitializer.Initializer, node);\n\t\t\treturn true;\n\t\t}\n\n\t\tbool TryHandleAddCall(ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tvar invocationExpression = expressionStatement.Expression as InvocationExpression;\n\t\t\tif (invocationExpression == null)\n\t\t\t\treturn false;\n\t\t\tvar invocationResolveResult = context.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\tif (invocationResolveResult == null)\n\t\t\t\treturn false;\n\t\t\tif (invocationResolveResult.Member.Name != \"Add\")\n\t\t\t\treturn false;\n\t\t\tvar targetResult = invocationResolveResult.TargetResult;\n\t\t\tif (targetResult is MemberResolveResult)\n\t\t\t\treturn false;\n\n\t\t\tvar tuple = new ArrayInitializerExpression();\n\t\t\tforeach (var argument in invocationExpression.Arguments) {\n\t\t\t\tvar argumentLocalResolveResult = context.Resolve(argument) as LocalResolveResult;\n\t\t\t\tif (argumentLocalResolveResult != null) {\n\t\t\t\t\tvar initializerPath = AccessPath.FromResolveResult(argumentLocalResolveResult);\n\t\t\t\t\tif (initializerPath == null || !accessPaths.ContainsKey(initializerPath))\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t// Add a clone, since we do not yet know if this is where the initializer will be used\n\t\t\t\t\tvar initializerClone = accessPaths[initializerPath].Clone();\n\t\t\t\t\ttuple.Elements.Add(initializerClone);\n\t\t\t\t} else {\n\t\t\t\t\ttuple.Elements.Add(argument.Clone());\n\t\t\t\t}\n\t\t\t}\n\t\t\tReplacementNodeHelper.AddReplacementAnnotation(tuple, expressionStatement);\n\n\t\t\tvar targetPath = AccessPath.FromResolveResult(targetResult);\n\t\t\tif (targetPath == null || !accessPaths.ContainsKey(targetPath))\n\t\t\t\treturn false;\n\t\t\tInsertImplicitInitializersForPath(targetPath);\n\t\t\tvar targetInitializer = accessPaths [targetPath];\n\t\t\tAddToInitializer(targetInitializer, tuple);\n\t\t\treturn true;\n\t\t}\n\n\t\tbool TryHandleAssignmentExpression(ExpressionStatement expressionStatement)\n\t\t{\n\t\t\tvar assignmentExpression = expressionStatement.Expression as AssignmentExpression;\n\t\t\tif (assignmentExpression == null || assignmentExpression.Operator != AssignmentOperatorType.Assign)\n\t\t\t\treturn false;\n\t\t\tvar resolveResult = context.Resolve(assignmentExpression.Right);\n\t\t\tif (HasDependency(assignmentExpression.Right) && !CanReplaceDependent(resolveResult))\n\t\t\t\treturn false;\n\t\t\tvar success = PushAssignment(assignmentExpression.Left, assignmentExpression.Right, expressionStatement);\n\t\t\treturn success;\n\t\t}\n\n\t\tbool CanReplaceDependent(ResolveResult resolveResult)\n\t\t{\n\t\t\treturn resolveResult is LocalResolveResult;\n\t\t}\n\n\t\tvoid AddNewVariable(IVariable variable, Expression initializer, AstNode node)\n\t\t{\n\t\t\tvar variablePath = new AccessPath(variable);\n\t\t\tvar rightResolveResult = context.Resolve(initializer) as LocalResolveResult;\n\t\t\tif (rightResolveResult != null) {\n\t\t\t\tvar rightPath = AccessPath.FromResolveResult(rightResolveResult);\n\t\t\t\tif (rightPath != null && accessPaths.ContainsKey(rightPath)) {\n\t\t\t\t\tvar rightInitializer = accessPaths [rightPath];\n\t\t\t\t\tReplacementNodeHelper.AddReplacementAnnotation(rightInitializer, node);\n\t\t\t\t\taccessPaths.Remove(rightPath);\n\t\t\t\t\taccessPaths [variablePath] = rightInitializer;\n\t\t\t\t\tif (rightPath == mainAccessPath) {\n\t\t\t\t\t\tmainAccessPath = variablePath;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taccessPaths [variablePath] = ReplacementNodeHelper.CloneWithReplacementAnnotation(initializer, node);\n\t\t\t}\n\t\t}\n\n\t\tvoid AddOldAnnotationsToInitializer(AccessPath targetPath, IAnnotatable initializer)\n\t\t{\n\t\t\tif (targetPath != null) {\n\t\t\t\tif (accessPaths.ContainsKey(targetPath)) {\n\t\t\t\t\tforeach (var astNode in ReplacementNodeHelper.GetAllReplacementAnnotations(accessPaths[targetPath])) {\n\t\t\t\t\t\tinitializer.AddAnnotation(astNode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbool PushAssignment(Expression left, Expression right, AstNode node)\n\t\t{\n\t\t\tvar rightResolveResult = context.Resolve(right) as LocalResolveResult;\n\t\t\tvar leftResolveResult = context.Resolve(left);\n\t\t\tExpression initializer;\n\t\t\tif (rightResolveResult != null) {\n\t\t\t\tvar rightPath = AccessPath.FromResolveResult(rightResolveResult);\n\t\t\t\tif (accessPaths.ContainsKey(rightPath)) {\n\t\t\t\t\tinitializer = accessPaths [rightPath];\n\t\t\t\t} else {\n\t\t\t\t\tinitializer = right.Clone();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinitializer = right.Clone();\n\t\t\t}\n\t\t\tvar leftPath = AccessPath.FromResolveResult(leftResolveResult);\n\t\t\tif (leftPath == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Move replacement annotations over, in case this is the second assignment\n\t\t\t// to the same variable/member.\n\t\t\tAddOldAnnotationsToInitializer(leftPath, initializer);\n\n\t\t\tif (leftPath.PartCount == 1) {\n\t\t\t\tReplacementNodeHelper.AddReplacementAnnotation(initializer, node);\n\t\t\t\taccessPaths [leftPath] = initializer;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (!(leftResolveResult is MemberResolveResult))\n\t\t\t\treturn false;\n\n\t\t\tDebug.Assert(leftPath.PartCount > 1, \"No top level assignment should get here.\");\n\n\t\t\tvar parentKey = leftPath.GetParentPath();\n\t\t\tvar member = leftPath.MemberPath.Last();\n\n\t\t\tvar success = InsertImplicitInitializersForPath(parentKey);\n\t\t\tif (!success)\n\t\t\t\treturn false;\n\n\t\t\tvar parentInitializer = accessPaths [parentKey];\n\t\t\tAddToInitializer(parentInitializer, comments.ToArray());\n\t\t\tcomments.Clear();\n\n\t\t\tAddToInitializer(parentInitializer, new NamedExpression(member.Name, initializer));\n\t\t\tReplacementNodeHelper.AddReplacementAnnotation(initializer, node);\n\t\t\taccessPaths [leftPath] = initializer;\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic void AddNodesToInitializer(Expression initializer, params AstNode[] nodes)\n\t\t{\n\t\t\tforeach (var node in nodes) {\n\t\t\t\tif (node is Expression) {\n\t\t\t\t\tinitializer.AddChild((Expression)node, Roles.Expression);\n\t\t\t\t} else if (node is Comment) {\n\t\t\t\t\tinitializer.AddChild((Comment)node, Roles.Comment);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid AddToInitializer(Expression initializer, params AstNode[] nodes)\n\t\t{\n\t\t\tif (initializer is ArrayInitializerExpression) {\n\t\t\t\tvar arrayInitializerExpression = (ArrayInitializerExpression)initializer;\n\t\t\t\tAddNodesToInitializer(arrayInitializerExpression, nodes);\n\t\t\t} else if (initializer is ObjectCreateExpression) {\n\t\t\t\tvar objectCreateExpression = (ObjectCreateExpression)initializer;\n\n\t\t\t\tif (objectCreateExpression.Initializer.IsNull)\n\t\t\t\t\tobjectCreateExpression.Initializer = new ArrayInitializerExpression();\n\n\t\t\t\tAddNodesToInitializer(objectCreateExpression.Initializer, nodes);\n\t\t\t}\n\t\t}\n\n\t\tbool HasDependency(Expression expression)\n\t\t{\n\t\t\tvar referenceFinder = new FindReferences();\n\t\t\treturn HasDependency(referenceFinder, expression);\n\t\t}\n\n\t\tbool HasDependency(FindReferences referenceFinder, Expression expression)\n\t\t{\n\t\t\tif (HasDependencyCheck(referenceFinder, expression))\n\t\t\t\treturn true;\n\t\t\tvar queue = new Queue<ResolveResult>();\n\t\t\tqueue.Enqueue(context.Resolve(expression));\n\t\t\tdo {\n\t\t\t\tvar result = queue.Dequeue();\n\t\t\t\tif (result is LocalResolveResult && HasDependencyCheck(referenceFinder, (LocalResolveResult)result)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tforeach (var childResult in result.GetChildResults()) {\n\t\t\t\t\tqueue.Enqueue(childResult);\n\t\t\t\t}\n\t\t\t} while (queue.Count > 0);\n\t\t\treturn false;\n\t\t}\n\n\t\tbool HasDependencyCheck(FindReferences referenceFinder, LocalResolveResult localResolveResult)\n\t\t{\n\t\t\tbool result = false;\n\t\t\treferenceFinder.FindLocalReferences(localResolveResult.Variable, context.UnresolvedFile,\n\t\t\t                                    (SyntaxTree)context.RootNode, context.Compilation,\n\t\t\t                                    (node, resolveResult) => {\n\t\t\t\tresult |= VariableHasBeenConverted(localResolveResult.Variable);\n\t\t\t}, CancellationToken.None);\n\t\t\treturn result;\n\t\t}\n\n\t\tbool HasDependencyCheck(FindReferences referenceFinder, Expression expression)\n\t\t{\n\t\t\tvar memberReferences = from exp in expression.DescendantsAndSelf\n\t\t\t\tlet memberReference = exp as MemberReferenceExpression\n\t\t\t\twhere memberReference != null\n\t\t\t\tselect memberReference;\n\t\t\tforeach (var memberReference in memberReferences) {\n\t\t\t\tvar resolveResult = context.Resolve(memberReference) as MemberResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tvar initializerPath = AccessPath.FromResolveResult(resolveResult);\n\t\t\t\tif (initializerPath != null && accessPaths.ContainsKey(initializerPath))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tbool VariableHasBeenConverted(IVariable variable)\n\t\t{\n\t\t\tif (variable == null)\n\t\t\t\tthrow new ArgumentNullException(\"variable\");\n\t\t\treturn accessPaths.Any(item => item.Key != null && item.Key.VariableRoot != null && item.Key.VariableRoot.Equals(variable));\n\t\t}\n\n\t\tbool InsertImplicitInitializersForPath(AccessPath path)\n\t\t{\n\t\t\tif (accessPaths.ContainsKey(path))\n\t\t\t\treturn true;\n\n\t\t\tif (path.MemberPath.Count == 0)\n\t\t\t\treturn false;\n\t\t\tvar parentPath = path.GetParentPath();\n\t\t\tvar success = InsertImplicitInitializersForPath(parentPath);\n\t\t\tif (!success)\n\t\t\t\treturn false;\n\n\t\t\tvar parentInitializer = accessPaths [parentPath];\n\t\t\tvar initializer = new ArrayInitializerExpression();\n\t\t\tvar namedExpression = new NamedExpression(path.MemberPath [path.MemberPath.Count - 1].Name, initializer);\n\t\t\tAddToInitializer(parentInitializer, namedExpression);\n\t\t\taccessPaths [path] = initializer;\n\t\t\treturn true;\n\t\t}\n\n\t}\n\n\tclass ReplacementNodeAnnotation\n\t{\n\t\tpublic AstNode ReplacedNode { get; set; }\n\t}\n\n\tclass ReplacementNodeHelper\n\t{\n\t\tpublic static void AddReplacementAnnotation(AstNode node, AstNode replacedNode)\n\t\t{\n\t\t\tnode.AddAnnotation(new ReplacementNodeAnnotation {\n\t\t\t\tReplacedNode = replacedNode\n\t\t\t});\n\t\t}\n\n\t\tpublic static AstNode CloneWithReplacementAnnotation(AstNode node, AstNode replacedNode)\n\t\t{\n\t\t\tvar newNode = node.Clone();\n\t\t\tAddReplacementAnnotation(newNode, replacedNode);\n\t\t\treturn newNode;\n\t\t}\n\n\t\tpublic static Expression CloneWithReplacementAnnotation(Expression expression, AstNode replacedNode)\n\t\t{\n\t\t\tvar newExpression = expression.Clone();\n\t\t\tAddReplacementAnnotation(newExpression, replacedNode);\n\t\t\treturn newExpression;\n\t\t}\n\n\t\tpublic static IEnumerable<ReplacementNodeAnnotation> GetAllReplacementAnnotations(AstNode node)\n\t\t{\n\t\t\treturn\n\t\t\t\tfrom n in node.DescendantsAndSelf\n\t\t\t\tfrom replacementAnnotation in n.Annotations.OfType<ReplacementNodeAnnotation>()\n\t\t\t\tselect replacementAnnotation;\n\t\t}\n\n\t\tpublic static IList<AstNode> GetReplacedNodes(AstNode expression)\n\t\t{\n\t\t\treturn GetAllReplacementAnnotations(expression)\n\t\t\t\t.Select(a => a.ReplacedNode)\n\t\t\t\t.ToList();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertWhileToDoWhileLoopAction.cs",
    "content": "// \n// ConvertWhileToDoWhileLoopAction.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Converts a while loop to a do...while loop.\n\t/// For instance: while (foo) {} becomes do { } while (foo);\n\t/// </summary>\n\t[ContextAction(\"Convert while loop to do...while\", Description = \"Convert while loop to do...while (changing semantics)\")]\n\tpublic class ConvertWhileToDoWhileLoopAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar whileLoop = context.GetNode<WhileStatement>();\n\t\t\tif (whileLoop == null || !whileLoop.WhileToken.Contains(context.Location)) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert to do...while loop\"),\n\t\t\t                            script => ApplyAction(script, whileLoop),\n\t\t\t                            whileLoop.WhileToken);\n\t\t}\n\n\t\tvoid ApplyAction(Script script, WhileStatement statement) {\n\t\t\tvar doWhile = new DoWhileStatement {\n\t\t\t\tCondition = statement.Condition.Clone(),\n\t\t\t\tEmbeddedStatement = statement.EmbeddedStatement.Clone()\n\t\t\t};\n\n\t\t\tscript.Replace(statement, doWhile);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CopyCommentsFromBase.cs",
    "content": "﻿// \n// CopyCommentsFromBase.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus0@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t///  Copies documented comments from base to overriding methods.\n\t/// </summary>\n\tusing System;\n\tusing System.Collections.Generic;\n\t\n\t[ContextAction(\"Copy comments from base\", Description = \"Copies documented comments from base to overriding methods.\")]\n\tpublic class CopyCommentsFromBase: SpecializedCodeAction <MethodDeclaration>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, MethodDeclaration node)\n\t\t{\n\t\t\tif (node == null || !node.HasModifier(Modifiers.Override))\n\t\t\t\treturn null;\n\t\t\tif (!node.NameToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tIMethod resolvedMember = (IMethod)(context.Resolve(node) as MemberResolveResult).Member;\n\t\t\t\n\t\t\tif (resolvedMember == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tIMethod originalMember = (IMethod)InheritanceHelper.GetBaseMember(resolvedMember);\n\t\t\n\t\t\tif (originalMember == null || originalMember.Documentation == null)\n\t\t\t\treturn null;\n\t\t\tstring comments = originalMember.Documentation.ToString();\n\t\t\t\n\t\t\tif (string.IsNullOrEmpty(comments))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tstring[] lines = comments.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);\n\t\t\treturn new CodeAction(context.TranslateString(\"Copy comments from base\"), script => {\n\t\t\t\tforeach (string co in lines) {\n\t\t\t\t\tscript.InsertBefore(node, new Comment(co, CommentType.Documentation));\n\t\t\t\t}\n\t\t\t}, node.NameToken);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CopyCommentsFromInterface.cs",
    "content": "// \n// CopyCommentsFromInterface.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t///  Copies documented comments from interface to overriding methods.\n\t/// </summary>\n\tusing System;\n\tusing System.Collections.Generic;\n\tusing System.Linq;\n\t\n\t[ContextAction(\"Copy comments from interface\", Description = \"Copies documented comments from interface to implementing methods.\")]\n\tpublic class CopyCommentsFromInterface: SpecializedCodeAction <MethodDeclaration>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, MethodDeclaration node)\n\t\t{\n\t\t\tif (!(node.PrivateImplementationType.IsNull))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif (!node.NameToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tvar memberResolveResult = context.Resolve(node) as MemberResolveResult;\n\t\t\tif (memberResolveResult == null)\n\t\t\t\treturn null;\n\t\t\tvar method = memberResolveResult.Member as IMethod;\n\t\t\tif (method == null || method.Documentation != null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tIList<IMember> interfaceMethods = method.ImplementedInterfaceMembers;\n\t\t\t\n\t\t\tif (interfaceMethods.Count != 1 || method.DeclaringType.Kind == TypeKind.Interface)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tvar interfaceMethod = interfaceMethods.SingleOrDefault();\n\n\t\t\tif (interfaceMethod == null)\n\t\t\t\treturn null;\n\n\t\t\tif (interfaceMethod.Documentation == null)\n\t\t\t\treturn null;\n\n\t\t\tstring comments = interfaceMethod.Documentation.ToString();\n\t\t\t\n\t\t\tif (comments == \"\")\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tstring[] lines = comments.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);\n\t\t\treturn new CodeAction(context.TranslateString(\"Copy comments from interface\"), script =>\n\t\t\t{\n\t\t\t\tforeach (string co in lines) {\n\t\t\t\t\tscript.InsertBefore(node, new Comment(co, CommentType.Documentation));\n\t\t\t\t}\n\t\t\t}, node);\n\t\t\t\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateBackingStoreAction.cs",
    "content": "﻿// \n// CreateBackingStore.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create backing store for auto property\", Description = \"Creates a backing field for an auto property.\")]\n\tpublic class CreateBackingStoreAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar property = context.GetNode<PropertyDeclaration>();\n\t\t\tif (property == null || !property.NameToken.Contains(context.Location))\n\t\t\t\tyield break;\n\n\t\t\tif (!(!property.Getter.IsNull && !property.Setter.IsNull && // automatic properties always need getter & setter\n\t\t\t      property.Getter.Body.IsNull &&\n\t\t\t      property.Setter.Body.IsNull)) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create backing store\"), script => {\n\t\t\t\tstring backingStoreName = context.GetNameProposal (property.Name);\n\t\t\t\t\n\t\t\t\t// create field\n\t\t\t\tvar backingStore = new FieldDeclaration ();\n\t\t\t\tif (property.Modifiers.HasFlag (Modifiers.Static))\n\t\t\t\t\tbackingStore.Modifiers |= Modifiers.Static;\n\t\t\t\tbackingStore.ReturnType = property.ReturnType.Clone ();\n\t\t\t\t\n\t\t\t\tvar initializer = new VariableInitializer (backingStoreName);\n\t\t\t\tbackingStore.Variables.Add (initializer);\n\t\t\t\t\n\t\t\t\t// create new property & implement the get/set bodies\n\t\t\t\tvar newProperty = (PropertyDeclaration)property.Clone ();\n\t\t\t\tExpression id1;\n\t\t\t\tif (backingStoreName == \"value\")\n\t\t\t\t\tid1 = new ThisReferenceExpression().Member(\"value\");\n\t\t\t\telse\n\t\t\t\t\tid1 = new IdentifierExpression (backingStoreName);\n\t\t\t\tExpression id2 = id1.Clone();\n\t\t\t\tnewProperty.Getter.Body = new BlockStatement () {\n\t\t\t\t\tnew ReturnStatement (id1)\n\t\t\t\t};\n\t\t\t\tnewProperty.Setter.Body = new BlockStatement () {\n\t\t\t\t\tnew AssignmentExpression (id2, AssignmentOperatorType.Assign, new IdentifierExpression (\"value\"))\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tscript.Replace (property, newProperty);\n\t\t\t\tscript.InsertBefore (property, backingStore);\n\t\t\t\tscript.Link (initializer, id1, id2);\n\t\t\t}, property.NameToken);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateChangedEventAction.cs",
    "content": "//\n// CreateChangedEvent.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create changed event for property\", Description = \"Creates a changed event for an property.\")]\n\tpublic class CreateChangedEventAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar property = context.GetNode<PropertyDeclaration>();\n\t\t\tif (property == null || !property.NameToken.Contains(context.Location))\n\t\t\t\tyield break;\n\n\t\t\tvar field = RemoveBackingStoreAction.GetBackingField(context, property);\n\t\t\tif (field == null)\n\t\t\t\tyield break;\n\t\t\tvar resolvedType = ReflectionHelper.ParseReflectionName (\"System.EventHandler\").Resolve (context.Compilation);\n\t\t\tif (resolvedType == null)\n\t\t\t\tyield break;\n\t\t\tvar type = (TypeDeclaration)property.Parent;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create changed event\"), script => {\n\t\t\t\tvar eventDeclaration = CreateChangedEventDeclaration (context, property);\n\t\t\t\tvar methodDeclaration = CreateEventInvocatorAction.CreateEventInvocator (context, type, eventDeclaration, eventDeclaration.Variables.First (), resolvedType.GetDelegateInvokeMethod (), false);\n\t\t\t\tvar stmt = new ExpressionStatement (new InvocationExpression (\n\t\t\t\t\tnew IdentifierExpression (methodDeclaration.Name),\n\t\t\t\t\tcontext.CreateShortType(\"System\", \"EventArgs\").Member(\"Empty\")\n\t\t\t\t));\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Create event invocator\"),\n\t\t\t\t\tScript.InsertPosition.After,\n\t\t\t\t\tnew AstNode[] { eventDeclaration, methodDeclaration }\n\t\t\t\t).ContinueScript(delegate {\n\t\t\t\t\tscript.InsertBefore (property.Setter.Body.RBraceToken, stmt);\n\t\t\t\t\tscript.FormatText (stmt);\n\t\t\t\t});\n\t\t\t}, property.NameToken);\n\t\t}\n\n\t\tEventDeclaration CreateChangedEventDeclaration (RefactoringContext context, PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\treturn new EventDeclaration {\n\t\t\t\tModifiers = propertyDeclaration.HasModifier (Modifiers.Static) ? Modifiers.Public | Modifiers.Static : Modifiers.Public,\n\t\t\t\tReturnType = context.CreateShortType(\"System\", \"EventHandler\"),\n\t\t\t\tVariables = {\n\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\tName = propertyDeclaration.Name + \"Changed\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateClassDeclarationAction.cs",
    "content": "﻿// \n// CreateClassDeclarationAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create class\", Description = \"Creates a class declaration out of an object creation.\")]\n\tpublic class CreateClassDeclarationAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar simpleType = context.GetNode<SimpleType>();\n\t\t\tif (simpleType != null && !(simpleType.Parent is EventDeclaration || simpleType.Parent is CustomEventDeclaration)) \n\t\t\t\treturn GetActions(context, simpleType);\n\n\t\t\tvar createExpression = context.GetNode<ObjectCreateExpression>();\n\t\t\tif (createExpression != null) \n\t\t\t\treturn GetActions(context, createExpression);\n\n\t\t\tvar identifier = context.GetNode<IdentifierExpression>();\n\t\t\tif (identifier != null && (identifier.Parent is MemberReferenceExpression)) \n\t\t\t\treturn GetActions(context, identifier);\n\n\t\t\treturn Enumerable.Empty<CodeAction>();\n\t\t}\n\n\t\tstatic IEnumerable<CodeAction> GetActions(RefactoringContext context, AstNode node)\n\t\t{\n\t\t\tvar resolveResult = context.Resolve(node) as UnknownIdentifierResolveResult;\n\t\t\tif (resolveResult == null)\n\t\t\t\tyield break;\n\n\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n\t\t\tif (service != null && !service.IsValidName(resolveResult.Identifier, AffectedEntity.Class)) { \n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tClassType classType = GuessClassTypeByName(service, node);\n\t\t\tModifyClassTypeBasedOnTypeGuessing(context, node, ref classType);\n\n\t\t\tstring message;\n\t\t\tswitch (classType) {\n\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\tmessage = context.TranslateString(\"Create struct\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\tmessage = context.TranslateString(\"Create interface\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tmessage = context.TranslateString(\"Create class\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tyield return new CodeAction(message, script => {\n\t\t\t\tscript.CreateNewType(CreateType(context, service, node, classType));\n\t\t\t}, node);\n\n\t\t\tif (node.Parent is TypeDeclaration || classType != ClassType.Class)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create nested class\"), script => {\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Create nested class\"),\n\t\t\t\t\tScript.InsertPosition.Before,\n\t\t\t\t\tCreateType(context, service, node, classType)\n\t\t\t\t);\n\t\t\t}, node);\n\t\t}\n\n\t\tstatic void ModifyClassTypeBasedOnTypeGuessing(RefactoringContext context, AstNode node, ref ClassType classType)\n\t\t{\n\t\t\tvar guessedType = TypeGuessing.GuessType(context, node);\n\t\t\tif (guessedType.Kind == TypeKind.TypeParameter) {\n\t\t\t\tvar tp = (ITypeParameter)guessedType;\n\t\t\t\tif (tp.HasValueTypeConstraint)\n\t\t\t\t\tclassType = ClassType.Struct;\n\t\t\t\tif (tp.HasReferenceTypeConstraint)\n\t\t\t\t\tclassType = ClassType.Class;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic ClassType GuessClassTypeByName(NamingConventionService service,  string identifier)\n\t\t{\n\t\t\tif (service == null)\n\t\t\t\treturn ClassType.Class;\n\t\t\tif (service.IsValidName (identifier, AffectedEntity.Interface, Modifiers.Public))\n\t\t\t\treturn ClassType.Interface;\n\t\t\tif (!service.IsValidName (identifier, AffectedEntity.Class, Modifiers.Public) &&\n\t\t\t     service.IsValidName (identifier, AffectedEntity.Struct, Modifiers.Public))\n\t\t\t\treturn ClassType.Struct;\n\t\t\treturn ClassType.Class;\n\t\t}\n\n\t\tstatic ClassType GuessClassTypeByName(NamingConventionService service, AstNode node)\n\t\t{\n\t\t\tif (node is SimpleType) \n\t\t\t\treturn GuessClassTypeByName (service, ((SimpleType)node).Identifier);\n\t\t\tif (node is IdentifierExpression) \n\t\t\t\treturn GuessClassTypeByName (service, ((IdentifierExpression)node).Identifier);\n\t\t\treturn ClassType.Class;\n\t\t}\n\n\t\tstatic TypeDeclaration CreateType(RefactoringContext context, NamingConventionService service, AstNode node, ClassType classType)\n\t\t{\n\t\t\tTypeDeclaration result;\n\t\t\tif (node is SimpleType) {\n\t\t\t\tresult = CreateClassFromType(context, classType, (SimpleType)node);\n\t\t\t} else if (node is ObjectCreateExpression) {\n\t\t\t\tresult = CreateClassFromObjectCreation(context, (ObjectCreateExpression)node);\n\t\t\t} else {\n\t\t\t\tresult = CreateClassFromIdentifier(context, classType, (IdentifierExpression)node);\n\t\t\t}\n\n\t\t\treturn AddBaseTypesAccordingToNamingRules(context, service, result);\n\t\t}\n\n\t\tstatic TypeDeclaration CreateClassFromIdentifier(RefactoringContext context, ClassType classType, IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tvar result = new TypeDeclaration { Name = identifierExpression.Identifier, ClassType = classType };\n\t\t\tvar entity = identifierExpression.GetParent<EntityDeclaration>();\n\t\t\tif (entity != null)\n\t\t\t\tresult.Modifiers |= entity.Modifiers & Modifiers.Public;\n\t\t\treturn result;\n\t\t}\n\n\t\tstatic TypeDeclaration CreateClassFromType(RefactoringContext context, ClassType classType, SimpleType simpleType)\n\t\t{\n\t\t\tTypeDeclaration result;\n\t\t\tstring className = simpleType.Identifier;\n\n\t\t\tif (simpleType.Parent is Attribute && classType == ClassType.Class) {\n\t\t\t\tif (!className.EndsWith(\"Attribute\", System.StringComparison.Ordinal))\n\t\t\t\t\tclassName += \"Attribute\";\n\t\t\t}\n\n\t\t\tresult = new TypeDeclaration { Name = className, ClassType = classType };\n\t\t\tvar entity = simpleType.GetParent<EntityDeclaration>();\n\t\t\tif (entity != null)\n\t\t\t\tresult.Modifiers |= entity.Modifiers & Modifiers.Public;\n\n\t\t\tvar guessedType = TypeGuessing.GuessType (context, simpleType);\n\t\t\tif (guessedType.Kind == TypeKind.TypeParameter)\n\t\t\t\tImplementConstraints (context, result, (ITypeParameter)guessedType);\n\t\t\treturn result;\n\t\t}\n\n\t\tstatic void ImplementConstraints(RefactoringContext context, TypeDeclaration result, ITypeParameter tp)\n\t\t{\n\t\t\tif (tp.HasValueTypeConstraint)\n\t\t\t\tresult.ClassType = ClassType.Struct;\n\t\t\tif (tp.HasReferenceTypeConstraint)\n\t\t\t\tresult.ClassType = ClassType.Class;\n\t\t\tif (tp.HasDefaultConstructorConstraint)\n\t\t\t\tresult.AddChild (new ConstructorDeclaration { Modifiers = Modifiers.Public, Body = new BlockStatement () }, Roles.TypeMemberRole);\n\t\t\tforeach (var baseType in tp.DirectBaseTypes) {\n\t\t\t\tif (baseType.Namespace == \"System\") {\n\t\t\t\t\tif (baseType.Name == \"Object\" || baseType.Name == \"ValueType\")\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tresult.BaseTypes.Add (context.CreateShortType (baseType));\n\t\t\t}\n\t\t}\n\n\t\tstatic TypeDeclaration CreateClassFromObjectCreation(RefactoringContext context, ObjectCreateExpression createExpression)\n\t\t{\n\t\t\tTypeDeclaration result;\n\t\t\tstring className = createExpression.Type.ToString();\n\t\t\tif (!createExpression.Arguments.Any()) {\n\t\t\t\tresult = new TypeDeclaration { Name = className };\n\t\t\t} else {\n\t\t\t\tvar decl = new ConstructorDeclaration {\n\t\t\t\t\tName = className,\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew ThrowStatement(new ObjectCreateExpression(context.CreateShortType(\"System\", \"NotImplementedException\")))\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tresult = new TypeDeclaration {\n\t\t\t\t\tName = className,\n\t\t\t\t\tMembers = {\n\t\t\t\t\t\tdecl\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tdecl.Parameters.AddRange(CreateMethodDeclarationAction.GenerateParameters(context, createExpression.Arguments));\n\t\t\t}\n\t\t\tvar guessedType = TypeGuessing.GuessType(context, createExpression);\n\t\t\tif (guessedType.Kind == TypeKind.Interface || guessedType.Kind == TypeKind.Class && guessedType.GetDefinition ().IsAbstract) {\n\t\t\t\tresult.BaseTypes.Add(context.CreateShortType(guessedType));\n\t\t\t\tAddImplementation(context, result, guessedType);\n\t\t\t}\n\t\t\t\n\t\t\treturn result;\n\t\t}\n\n\t\tstatic Modifiers GetModifiers(IEntity property)\n\t\t{\n\t\t\tif (property.DeclaringType.Kind == TypeKind.Interface)\n\t\t\t\treturn Modifiers.Public;\n\t\t\tswitch (property.Accessibility) {\n\t\t\t\tcase Accessibility.Public:\n\t\t\t\t\treturn Modifiers.Public | Modifiers.Override;\n\t\t\t\tcase Accessibility.Protected:\n\t\t\t\t\treturn Modifiers.Protected | Modifiers.Override;\n\t\t\t\tcase Accessibility.Internal:\n\t\t\t\t\treturn Modifiers.Internal | Modifiers.Override;\n\t\t\t\tcase Accessibility.ProtectedOrInternal:\n\t\t\t\t\t// TODO: oops\n\t\t\t\t\treturn Modifiers.Internal | Modifiers.Protected | Modifiers.Override;\n\t\t\t\tcase Accessibility.ProtectedAndInternal:\n\t\t\t\t\t// TODO: oops\n\t\t\t\t\treturn Modifiers.Internal | Modifiers.Protected | Modifiers.Override;\n\t\t\t}\n\t\t\treturn Modifiers.Override;\n\t\t}\n\n\t\tstatic void AddImplementation(RefactoringContext context, TypeDeclaration result, IType guessedType)\n\t\t{\n\t\t\tforeach (var property in guessedType.GetProperties ()) {\n\t\t\t\tif (!property.IsAbstract)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (property.IsIndexer) {\n\t\t\t\t\tvar indexerDecl = new IndexerDeclaration {\n\t\t\t\t\t\tReturnType = context.CreateShortType(property.ReturnType),\n\t\t\t\t\t\tModifiers = GetModifiers(property),\n\t\t\t\t\t\tName = property.Name\n\t\t\t\t\t};\n\t\t\t\t\tindexerDecl.Parameters.AddRange(ConvertParameters(context, property.Parameters));\n\t\t\t\t\tif (property.CanGet)\n\t\t\t\t\t\tindexerDecl.Getter = new Accessor();\n\t\t\t\t\tif (property.CanSet)\n\t\t\t\t\t\tindexerDecl.Setter = new Accessor();\n\t\t\t\t\tresult.AddChild(indexerDecl, Roles.TypeMemberRole);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar propDecl = new PropertyDeclaration {\n\t\t\t\t\tReturnType = context.CreateShortType(property.ReturnType),\n\t\t\t\t\tModifiers = GetModifiers (property),\n\t\t\t\t\tName = property.Name\n\t\t\t\t};\n\t\t\t\tif (property.CanGet)\n\t\t\t\t\tpropDecl.Getter = new Accessor();\n\t\t\t\tif (property.CanSet)\n\t\t\t\t\tpropDecl.Setter = new Accessor();\n\t\t\t\tresult.AddChild(propDecl, Roles.TypeMemberRole);\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var method in guessedType.GetMethods ()) {\n\t\t\t\tif (!method.IsAbstract)\n\t\t\t\t\tcontinue;\n\t\t\t\tvar decl = new MethodDeclaration {\n\t\t\t\t\tReturnType = context.CreateShortType(method.ReturnType),\n\t\t\t\t\tModifiers = GetModifiers (method),\n\t\t\t\t\tName = method.Name,\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew ThrowStatement(new ObjectCreateExpression(context.CreateShortType(\"System\", \"NotImplementedException\")))\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tdecl.Parameters.AddRange(ConvertParameters(context, method.Parameters));\n\t\t\t\tresult.AddChild(decl, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tforeach (var evt in guessedType.GetEvents ()) {\n\t\t\t\tif (!evt.IsAbstract)\n\t\t\t\t\tcontinue;\n\t\t\t\tvar decl = new EventDeclaration {\n\t\t\t\t\tReturnType = context.CreateShortType(evt.ReturnType),\n\t\t\t\t\tModifiers = GetModifiers (evt),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = evt.Name\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tdecl.Variables.Add(new VariableInitializer(evt.Name));\n\t\t\t\tresult.AddChild(decl, Roles.TypeMemberRole);\n\t\t\t}\n\t\t}\n\n\t\tstatic IEnumerable<ParameterDeclaration> ConvertParameters(RefactoringContext context, IList<IParameter> parameters)\n\t\t{\n\t\t\tforeach (var param in parameters) {\n\t\t\t\tParameterModifier mod = ParameterModifier.None;\n\t\t\t\tif (param.IsOut) {\n\t\t\t\t\tmod = ParameterModifier.Out;\n\t\t\t\t} else if (param.IsRef) {\n\t\t\t\t\tmod = ParameterModifier.Ref;\n\t\t\t\t} else if (param.IsParams) {\n\t\t\t\t\tmod = ParameterModifier.Params;\n\t\t\t\t}\n\t\t\t\tyield return new ParameterDeclaration(context.CreateShortType(param.Type), param.Name, mod);\n\t\t\t}\n\t\t}\n\n\t\tstatic TypeDeclaration AddBaseTypesAccordingToNamingRules(RefactoringContext context, NamingConventionService service, TypeDeclaration result)\n\t\t{\n\t\t\tif (service.HasValidRule(result.Name, AffectedEntity.CustomAttributes, Modifiers.Public)) {\n\t\t\t\tresult.BaseTypes.Add(context.CreateShortType(\"System\", \"Attribute\"));\n\t\t\t} else if (service.HasValidRule(result.Name, AffectedEntity.CustomEventArgs, Modifiers.Public)) {\n\t\t\t\tresult.BaseTypes.Add(context.CreateShortType(\"System\", \"EventArgs\"));\n\t\t\t} else if (service.HasValidRule(result.Name, AffectedEntity.CustomExceptions, Modifiers.Public)) {\n\t\t\t\tresult.BaseTypes.Add(context.CreateShortType(\"System\", \"Exception\"));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateConstructorDeclarationAction.cs",
    "content": "// \n// CreateClassDeclarationAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create constructor\", Description = \"Creates a constructor declaration out of an object creation.\")]\n\tpublic class CreateConstructorDeclarationAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar createExpression = context.GetNode<Expression>() as ObjectCreateExpression;\n\t\t\tif (createExpression == null) \n\t\t\t\tyield break;\n\t\t\t\n\t\t\tvar resolveResult = context.Resolve(createExpression) as CSharpInvocationResolveResult;\n\t\t\tif (resolveResult == null || !resolveResult.IsError || resolveResult.Member.DeclaringTypeDefinition == null || resolveResult.Member.DeclaringTypeDefinition.IsSealed || resolveResult.Member.DeclaringTypeDefinition.Region.IsEmpty)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create constructor\"), script =>\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Create constructor\"),\n\t\t\t\t\tresolveResult.Member.DeclaringTypeDefinition,\n\t\t\t\t\t(s, c) => {\n\t\t\t\t\t\tvar decl = new ConstructorDeclaration {\n\t\t\t\t\t\t\tName = resolveResult.Member.DeclaringTypeDefinition.Name,\n\t\t\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\t\t\tnew ThrowStatement(new ObjectCreateExpression(c.CreateShortType(\"System\", \"NotImplementedException\")))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tdecl.Parameters.AddRange(CreateMethodDeclarationAction.GenerateParameters(context, createExpression.Arguments));\n\t\t\t\t\t\treturn decl;\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t, createExpression) { Severity = ICSharpCode.NRefactory.Refactoring.Severity.Error };\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateCustomEventImplementationAction.cs",
    "content": "﻿// \n// CreateCustomEventImplementationAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Create custom event implementation\", Description = \"Create custom event implementation.\")]\n\tpublic class CreateCustomEventImplementationAction : SpecializedCodeAction<VariableInitializer>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, VariableInitializer node)\n\t\t{\n\t\t\tvar eventDecl = node.Parent as EventDeclaration;\n\t\t\tif (eventDecl == null)\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction (context.TranslateString (\"Create custom event implementation\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar accessor = new Accessor\n\t\t\t\t\t{\n\t\t\t\t\t\tBody = new BlockStatement\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnew ThrowStatement(\n\t\t\t\t\t\t\t\tnew ObjectCreateExpression(context.CreateShortType(\"System\", \"NotImplementedException\")))\t\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tvar e = new CustomEventDeclaration\n\t\t\t\t\t{\n\t\t\t\t\t\tName = node.Name,\n\t\t\t\t\t\tModifiers = eventDecl.Modifiers,\n\t\t\t\t\t\tReturnType = eventDecl.ReturnType.Clone (),\n\t\t\t\t\t\tAddAccessor = accessor,\n\t\t\t\t\t\tRemoveAccessor = (Accessor)accessor.Clone(),\n\t\t\t\t\t};\n\t\t\t\t\tif (eventDecl.Variables.Count > 1) {\n\t\t\t\t\t\tvar newEventDecl = (EventDeclaration)eventDecl.Clone ();\n\t\t\t\t\t\tnewEventDecl.Variables.Remove (\n\t\t\t\t\t\t\tnewEventDecl.Variables.FirstOrNullObject (v => v.Name == node.Name));\n\t\t\t\t\t\tscript.InsertBefore (eventDecl, newEventDecl);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace (eventDecl, e);\n\t\t\t\t}, node.NameToken);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateDelegateAction.cs",
    "content": "// \n// CreateDelegateAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create delegate\", Description = \"Creates a delegate declaration out of an event declaration.\")]\n\tpublic class CreateDelegateAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar simpleType = context.GetNode<SimpleType>();\n\t\t\tif (simpleType != null && (simpleType.Parent is EventDeclaration || simpleType.Parent is CustomEventDeclaration)) \n\t\t\t\treturn GetActions(context, simpleType);\n\n\t\t\treturn Enumerable.Empty<CodeAction>();\n\t\t}\n\n\t\tstatic IEnumerable<CodeAction> GetActions(RefactoringContext context, SimpleType node)\n\t\t{\n\t\t\tvar resolveResult = context.Resolve(node) as UnknownIdentifierResolveResult;\n\t\t\tif (resolveResult == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create delegate\"), script => {\n\t\t\t\tscript.CreateNewType(CreateType(context,  node));\n\t\t\t}, node);\n\n\t\t}\n\n\t\tstatic DelegateDeclaration CreateType(RefactoringContext context, SimpleType simpleType)\n\t\t{\n\t\t\tvar result = new DelegateDeclaration() {\n\t\t\t\tName = simpleType.Identifier,\n\t\t\t\tModifiers = ((EntityDeclaration)simpleType.Parent).Modifiers,\n\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\tParameters = {\n\t\t\t\t\tnew ParameterDeclaration(new PrimitiveType(\"object\"), \"sender\"),\n\t\t\t\t\tnew ParameterDeclaration(context.CreateShortType(\"System\", \"EventArgs\"), \"e\")\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateEnumValue.cs",
    "content": "//\n// CreateEnumValue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create enum value\", Description = \"Creates an enum value for a undefined enum value.\")]\n\tpublic class CreateEnumValue : CodeActionProvider\n\t{\n\t\tinternal static bool IsInvocationTarget(AstNode node)\n\t\t{\n\t\t\tvar invoke = node.Parent as InvocationExpression;\n\t\t\treturn invoke != null && invoke.Target == node;\n\t\t}\n\t\t\n\t\tinternal static Expression GetCreatePropertyOrFieldNode(RefactoringContext context)\n\t\t{\n\t\t\treturn context.GetNode(n => n is IdentifierExpression || n is MemberReferenceExpression || n is NamedExpression) as Expression;\n\t\t}\n\t\t\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar expr = GetCreatePropertyOrFieldNode(context);\n\t\t\tif (expr == null)\n\t\t\t\tyield break;\n\t\t\tif (!(expr is MemberReferenceExpression))\n\t\t\t\tyield break;\n\t\t\tvar propertyName = CreatePropertyAction.GetPropertyName(expr);\n\t\t\tif (propertyName == null)\n\t\t\t\tyield break;\n\t\t\tif (IsInvocationTarget(expr))\n\t\t\t\tyield break;\n\t\t\tvar statement = expr.GetParent<Statement>();\n\t\t\tif (statement == null)\n\t\t\t\tyield break;\n\t\t\tif (!(context.Resolve(expr).IsError))\n\t\t\t\tyield break;\n\t\t\tvar guessedType = TypeGuessing.GuessType(context, expr);\n\t\t\tif (guessedType == null || guessedType.Kind != TypeKind.Enum)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore(expr);\n\t\t\tif (state.CurrentMember == null || state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create enum value\"), script => {\n\t\t\t\tvar decl = new EnumMemberDeclaration {\n\t\t\t\t\tName = propertyName\n\t\t\t\t};\n\t\t\t\tscript.InsertWithCursor(context.TranslateString(\"Create enum value\"), guessedType.GetDefinition (), (s, c) => decl);\n\t\t\t}, expr) { Severity = ICSharpCode.NRefactory.Refactoring.Severity.Error };\n\t\t}\n\t\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateEventInvocatorAction.cs",
    "content": "﻿// \n// CreateEventInvocator.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create event invocator\", Description = \"Creates a standard OnXXX event method.\")]\n\tpublic class CreateEventInvocatorAction : CodeActionProvider\n\t{\n\t\t/// <summary>\n\t\t/// If <c>true</c> an explicit type will be used for the handler variable; otherwise, 'var' will be used as type.\n\t\t/// Default value is <c>false</c>\n\t\t/// </summary>\n\t\tpublic bool UseExplictType {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic static MethodDeclaration CreateEventInvocator (RefactoringContext context, TypeDeclaration declaringType, EventDeclaration eventDeclaration, VariableInitializer initializer, IMethod invokeMethod, bool useExplictType)\n\t\t{\n\t\t\tbool hasSenderParam = false;\n\t\t\tIEnumerable<IParameter> pars = invokeMethod.Parameters;\n\t\t\tif (invokeMethod.Parameters.Any()) {\n\t\t\t\tvar first = invokeMethod.Parameters [0];\n\t\t\t\tif (first.Name == \"sender\" /*&& first.Type == \"System.Object\"*/) {\n\t\t\t\t\thasSenderParam = true;\n\t\t\t\t\tpars = invokeMethod.Parameters.Skip(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst string handlerName = \"handler\";\n\n\t\t\tvar arguments = new List<Expression>();\n\t\t\tif (hasSenderParam)\n\t\t\t\targuments.Add(eventDeclaration.HasModifier (Modifiers.Static) ? (Expression)new PrimitiveExpression (null) : new ThisReferenceExpression());\n\t\t\tbool useThisMemberReference = false;\n\t\t\tforeach (var par in pars) {\n\t\t\t\targuments.Add(new IdentifierExpression(par.Name));\n\t\t\t\tuseThisMemberReference |= par.Name == initializer.Name;\n\t\t\t}\n\t\t\tvar proposedHandlerName = GetNameProposal(initializer);\n\t\t\tvar modifiers = eventDeclaration.HasModifier(Modifiers.Static) ? Modifiers.Static : Modifiers.Protected | Modifiers.Virtual;\n\t\t\tif (declaringType.HasModifier (Modifiers.Sealed)) {\n\t\t\t\tmodifiers = Modifiers.None;\n\t\t\t}\n\t\t\tvar methodDeclaration = new MethodDeclaration {\n\t\t\t\tName = proposedHandlerName,\n\t\t\t\tReturnType = new PrimitiveType (\"void\"),\n\t\t\t\tModifiers = modifiers,\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew VariableDeclarationStatement (\n\t\t\t\t\t\tuseExplictType ? eventDeclaration.ReturnType.Clone () : new PrimitiveType (\"var\"), handlerName, \n\t\t\t\t\t\tuseThisMemberReference ? \n\t\t\t\t\t\t(Expression)new MemberReferenceExpression (new ThisReferenceExpression (), initializer.Name) \n\t\t\t\t\t\t: new IdentifierExpression (initializer.Name)\n\t\t\t\t\t\t),\n\t\t\t\t\tnew IfElseStatement {\n\t\t\t\t\t\tCondition = new BinaryOperatorExpression (new IdentifierExpression (handlerName), BinaryOperatorType.InEquality, new PrimitiveExpression (null)),\n\t\t\t\t\t\tTrueStatement = new InvocationExpression (new IdentifierExpression (handlerName), arguments)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tforeach (var par in pars) {\n\t\t\t\tvar typeName = context.CreateShortType(par.Type);\n\t\t\t\tvar decl = new ParameterDeclaration(typeName, par.Name);\n\t\t\t\tmethodDeclaration.Parameters.Add(decl);\n\t\t\t}\n\t\t\treturn methodDeclaration;\n\t\t}\n\n\t\tstatic string GetNameProposal(VariableInitializer initializer)\n\t\t{\n\t\t\treturn \"On\" + char.ToUpper(initializer.Name[0]) + initializer.Name.Substring(1);\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tVariableInitializer initializer;\n\t\t\tvar eventDeclaration = GetEventDeclaration(context, out initializer);\n\t\t\tif (eventDeclaration == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar type = (TypeDeclaration)eventDeclaration.Parent;\n\t\t\tvar proposedHandlerName = GetNameProposal(initializer);\n\t\t\tif (type.Members.Any(m => m is MethodDeclaration && m.Name == proposedHandlerName)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar resolvedType = context.Resolve(eventDeclaration.ReturnType).Type;\n\t\t\tif (resolvedType.Kind == TypeKind.Unknown) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar invokeMethod = resolvedType.GetDelegateInvokeMethod();\n\t\t\tif (invokeMethod == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create event invocator\"), script => {\n\t\t\t\tvar methodDeclaration = CreateEventInvocator (context, type, eventDeclaration, initializer, invokeMethod, UseExplictType);\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Create event invocator\"),\n\t\t\t\t\tScript.InsertPosition.After,\n\t\t\t\t\tmethodDeclaration\n\t\t\t\t);\n\t\t\t}, initializer);\n\t\t}\n\n\t\tstatic EventDeclaration GetEventDeclaration (RefactoringContext context, out VariableInitializer initializer)\n\t\t{\n\t\t\tvar result = context.GetNode<EventDeclaration> ();\n\t\t\tif (result == null) {\n\t\t\t\tinitializer = null;\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tinitializer = result.Variables.FirstOrDefault (v => v.NameToken.Contains (context.Location));\n\t\t\treturn initializer != null ? result : null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateFieldAction.cs",
    "content": "﻿// \n// CreateField.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create field\", Description = \"Creates a field for a undefined variable.\")]\n\tpublic class CreateFieldAction : CodeActionProvider\n\t{\n\t\tinternal static bool IsInvocationTarget(AstNode node)\n\t\t{\n\t\t\tvar invoke = node.Parent as InvocationExpression;\n\t\t\treturn invoke != null && invoke.Target == node;\n\t\t}\n\n\t\tinternal static Expression GetCreatePropertyOrFieldNode(RefactoringContext context)\n\t\t{\n\t\t\treturn context.GetNode(n => n is IdentifierExpression || n is MemberReferenceExpression || n is NamedExpression) as Expression;\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar expr = GetCreatePropertyOrFieldNode(context);\n\t\t\tif (expr == null)\n\t\t\t\tyield break;\n\n\t\t\tif (expr is MemberReferenceExpression && !(((MemberReferenceExpression)expr).Target is ThisReferenceExpression))\n\t\t\t\tyield break;\n\n\t\t\tvar propertyName = CreatePropertyAction.GetPropertyName(expr);\n\t\t\tif (propertyName == null)\n\t\t\t\tyield break;\n\n\t\t\tif (IsInvocationTarget(expr))\n\t\t\t\tyield break;\n\t\t\tvar statement = expr.GetParent<Statement>();\n\t\t\tif (statement == null)\n\t\t\t\tyield break;\n\t\t\tif (!(context.Resolve(expr).IsError))\n\t\t\t\tyield break;\n\t\t\tvar guessedType = TypeGuessing.GuessAstType(context, expr);\n\t\t\tif (guessedType == null)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore(expr);\n\t\t\tif (state.CurrentMember == null || state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\t\t\tbool isStatic =  !(expr is NamedExpression) && (state.CurrentMember.IsStatic | state.CurrentTypeDefinition.IsStatic);\n\n//\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n//\t\t\tif (service != null && !service.IsValidName(identifier.Identifier, AffectedEntity.Field, Modifiers.Private, isStatic)) { \n//\t\t\t\tyield break;\n//\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create field\"), script => {\n\t\t\t\tvar decl = new FieldDeclaration {\n\t\t\t\t\tReturnType = guessedType,\n\t\t\t\t\tVariables = { new VariableInitializer(propertyName) }\n\t\t\t\t};\n\t\t\t\tif (isStatic)\n\t\t\t\t\tdecl.Modifiers |= Modifiers.Static;\n\t\t\t\tscript.InsertWithCursor(context.TranslateString(\"Create field\"), Script.InsertPosition.Before, decl);\n\t\t\t}, expr.GetNodeAt(context.Location) ?? expr) { Severity = ICSharpCode.NRefactory.Refactoring.Severity.Error };\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateIndexerAction.cs",
    "content": "// \n// CreateIndexerAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create indexer\", Description = \"Creates an indexer declaration out of an indexer expression.\")]\n\tpublic class CreateIndexerAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar indexer = context.GetNode<IndexerExpression>();\n\t\t\tif (indexer == null)\n\t\t\t\tyield break;\n\t\t\tif (!(context.Resolve(indexer).IsError))\n\t\t\t\tyield break;\n\n\t\t\tvar state = context.GetResolverStateBefore(indexer);\n\t\t\tif (state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\t\t\tvar guessedType = TypeGuessing.GuessAstType(context, indexer);\n\n\t\t\tbool createInOtherType = false;\n\t\t\tResolveResult targetResolveResult = null;\n\t\t\ttargetResolveResult = context.Resolve(indexer.Target);\n\t\t\tcreateInOtherType = !state.CurrentTypeDefinition.Equals(targetResolveResult.Type.GetDefinition());\n\n\t\t\tbool isStatic;\n\t\t\tif (createInOtherType) {\n\t\t\t\tif (targetResolveResult.Type.GetDefinition() == null || targetResolveResult.Type.GetDefinition().Region.IsEmpty)\n\t\t\t\t\tyield break;\n\t\t\t\tisStatic = targetResolveResult is TypeResolveResult;\n\t\t\t\tif (isStatic && targetResolveResult.Type.Kind == TypeKind.Interface || targetResolveResult.Type.Kind == TypeKind.Enum)\n\t\t\t\t\tyield break;\n\t\t\t} else {\n\t\t\t\tisStatic = indexer.Target is IdentifierExpression && state.CurrentMember.IsStatic;\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create indexer\"), script => {\n\t\t\t\tvar decl = new IndexerDeclaration() {\n\t\t\t\t\tReturnType = guessedType,\n\t\t\t\t\tGetter = new Accessor() {\n\t\t\t\t\t\tBody = new BlockStatement() {\n\t\t\t\t\t\t\tnew ThrowStatement(new ObjectCreateExpression(context.CreateShortType(\"System\", \"NotImplementedException\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tSetter = new Accessor() {\n\t\t\t\t\t\tBody = new BlockStatement() {\n\t\t\t\t\t\t\tnew ThrowStatement(new ObjectCreateExpression(context.CreateShortType(\"System\", \"NotImplementedException\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tdecl.Parameters.AddRange(CreateMethodDeclarationAction.GenerateParameters(context, indexer.Arguments));\n\t\t\t\tif (isStatic)\n\t\t\t\t\tdecl.Modifiers |= Modifiers.Static;\n\t\t\t\t\n\t\t\t\tif (createInOtherType) {\n\t\t\t\t\tif (targetResolveResult.Type.Kind == TypeKind.Interface) {\n\t\t\t\t\t\tdecl.Getter.Body = null;\n\t\t\t\t\t\tdecl.Setter.Body = null;\n\t\t\t\t\t\tdecl.Modifiers = Modifiers.None;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdecl.Modifiers |= Modifiers.Public;\n\t\t\t\t\t}\n\n\t\t\t\t\tscript.InsertWithCursor(context.TranslateString(\"Create indexer\"), targetResolveResult.Type.GetDefinition(), (s, c) => decl);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tscript.InsertWithCursor(context.TranslateString(\"Create indexer\"), Script.InsertPosition.Before, decl);\n\t\t\t}, indexer) { Severity = ICSharpCode.NRefactory.Refactoring.Severity.Error };\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateLocalVariableAction.cs",
    "content": "// \n// CreateLocalVariable.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create local variable\", Description = \"Creates a local variable for a undefined variable.\")]\n\tpublic class CreateLocalVariableAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar identifier = context.GetNode<IdentifierExpression>();\n\t\t\tif (identifier == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tif (CreateFieldAction.IsInvocationTarget(identifier)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar statement = context.GetNode<Statement>();\n\t\t\tif (statement == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tif (!(context.Resolve(identifier).IsError)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar guessedType = TypeGuessing.GuessAstType(context, identifier);\n\t\t\tif (guessedType == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create local variable\"), script => {\n\t\t\t\tvar initializer = new VariableInitializer(identifier.Identifier);\n\t\t\t\tvar decl = new VariableDeclarationStatement() {\n\t\t\t\t\tType = guessedType,\n\t\t\t\t\tVariables = { initializer }\n\t\t\t\t};\n\t\t\t\tif (identifier.Parent is AssignmentExpression && ((AssignmentExpression)identifier.Parent).Left == identifier) {\n\t\t\t\t\tinitializer.Initializer = ((AssignmentExpression)identifier.Parent).Right.Clone();\n\t\t\t\t\tif (!context.UseExplicitTypes)\n\t\t\t\t\t\tdecl.Type = new SimpleType(\"var\");\n\t\t\t\t\tscript.Replace(statement, decl);\n\t\t\t\t} else {\n\t\t\t\t\tscript.InsertBefore(statement, decl);\n\t\t\t\t}\n\t\t\t}, identifier) { Severity = ICSharpCode.NRefactory.Refactoring.Severity.Error };\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateMethodDeclarationAction.cs",
    "content": "// \n// CreateMethodDeclarationAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create method\", Description = \"Creates a method declaration out of an invocation.\")]\n\tpublic class CreateMethodDeclarationAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar identifier = context.GetNode<IdentifierExpression>();\n\t\t\tif (identifier != null && !(identifier.Parent is InvocationExpression && ((InvocationExpression)identifier.Parent).Target == identifier))\n\t\t\t\treturn GetActionsFromIdentifier(context, identifier);\n\t\t\t\n\t\t\tvar memberReference = context.GetNode<MemberReferenceExpression>();\n\t\t\tif (memberReference != null && !(memberReference.Parent is InvocationExpression && ((InvocationExpression)memberReference.Parent).Target == memberReference))\n\t\t\t\treturn GetActionsFromMemberReferenceExpression(context, memberReference);\n\n\t\t\tvar invocation = context.GetNode<InvocationExpression>();\n\t\t\tif (invocation != null)\n\t\t\t\treturn GetActionsFromInvocation(context, invocation);\n\t\t\treturn Enumerable.Empty<CodeAction>();\n\t\t}\n\n\t\tIEnumerable<CodeAction> GetActionsFromMemberReferenceExpression(RefactoringContext context, MemberReferenceExpression invocation)\n\t\t{\n\t\t\tif (!(context.Resolve(invocation).IsError)) \n\t\t\t\t\tyield break;\n\n\t\t\tvar methodName = invocation.MemberName;\n\t\t\tvar guessedType = TypeGuessing.GuessType(context, invocation);\n\t\t\tif (guessedType.Kind != TypeKind.Delegate)\n\t\t\t\t\tyield break;\n\t\t\tvar invocationMethod = guessedType.GetDelegateInvokeMethod();\n\t\t\tvar state = context.GetResolverStateBefore(invocation);\n\t\t\tif (state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\t\t\tResolveResult targetResolveResult = context.Resolve(invocation.Target);\n\t\t\tbool createInOtherType = !state.CurrentTypeDefinition.Equals(targetResolveResult.Type.GetDefinition());\n\n\t\t\tbool isStatic;\n\t\t\tif (createInOtherType) {\n\t\t\t\tif (targetResolveResult.Type.GetDefinition() == null || targetResolveResult.Type.GetDefinition().Region.IsEmpty)\n\t\t\t\t\tyield break;\n\t\t\t\tisStatic = targetResolveResult is TypeResolveResult;\n\t\t\t\tif (isStatic && targetResolveResult.Type.Kind == TypeKind.Interface || targetResolveResult.Type.Kind == TypeKind.Enum)\n\t\t\t\t\tyield break;\n\t\t\t} else {\n\t\t\t\tif (state.CurrentMember == null)\n\t\t\t\t\tyield break;\n\t\t\t\tisStatic = state.CurrentMember.IsStatic || state.CurrentTypeDefinition.IsStatic;\n\t\t\t}\n\n//\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n//\t\t\tif (service != null && !service.IsValidName(methodName, AffectedEntity.Method, Modifiers.Private, isStatic)) { \n//\t\t\t\tyield break;\n//\t\t\t}\n\n\t\t\tyield return CreateAction(\n\t\t\t\tcontext, \n\t\t\t\tinvocation,\n\t\t\t\tmethodName, \n\t\t\t\tcontext.CreateShortType(invocationMethod.ReturnType),\n\t\t\t\tinvocationMethod.Parameters.Select(parameter => new ParameterDeclaration(context.CreateShortType(parameter.Type), parameter.Name) { \n\t\t\t\t\tParameterModifier = GetModifiers(parameter)\n\t\t\t\t}),\n\t\t\t\tcreateInOtherType,\n\t\t\t\tisStatic,\n\t\t\t\ttargetResolveResult);\n\t\t}\n\t\t\n\t\tIEnumerable<CodeAction> GetActionsFromIdentifier(RefactoringContext context, IdentifierExpression identifier)\n\t\t{\n\t\t\tif (!(context.Resolve(identifier).IsError))\n\t\t\t\tyield break;\n\t\t\tvar methodName = identifier.Identifier;\n\t\t\tvar guessedType = TypeGuessing.GuessType(context, identifier);\n\t\t\tif (guessedType.Kind != TypeKind.Delegate)\n\t\t\t\tyield break;\n\t\t\tvar invocationMethod = guessedType.GetDelegateInvokeMethod();\n\t\t\tif (invocationMethod == null)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore(identifier);\n\t\t\tif (state.CurrentMember == null || state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\t\t\tbool isStatic = state.CurrentMember.IsStatic || state.CurrentTypeDefinition.IsStatic;\n\n\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n\t\t\tif (service != null && !service.IsValidName(methodName, AffectedEntity.Method, Modifiers.Private, isStatic))\n\t\t\t\tyield break;\n\n\t\t\tyield return CreateAction(\n\t\t\t\tcontext, \n\t\t\t\tidentifier,\n\t\t\t\tmethodName, \n\t\t\t\tcontext.CreateShortType(invocationMethod.ReturnType),\n\t\t\t\tinvocationMethod.Parameters.Select(parameter => new ParameterDeclaration(context.CreateShortType(parameter.Type), parameter.Name) { \n\t\t\t\t\tParameterModifier = GetModifiers(parameter)\n\t\t\t\t}),\n\t\t\t\tfalse,\n\t\t\t\tisStatic,\n\t\t\t\tnull);\n\t\t}\n\n\t\tIEnumerable<CodeAction> GetActionsFromInvocation(RefactoringContext context, InvocationExpression invocation)\n\t\t{\n\t\t\tif (!(context.Resolve(invocation.Target).IsError)) \n\t\t\t\tyield break;\n\n\t\t\tvar methodName = GetMethodName(invocation);\n\t\t\tif (methodName == null)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore(invocation);\n\t\t\tif (state.CurrentMember == null || state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\t\t\tvar guessedType = invocation.Parent is ExpressionStatement ? new PrimitiveType(\"void\") : TypeGuessing.GuessAstType(context, invocation);\n\n\t\t\tbool createInOtherType = false;\n\t\t\tResolveResult targetResolveResult = null;\n\t\t\tif (invocation.Target is MemberReferenceExpression) {\n\t\t\t\ttargetResolveResult = context.Resolve(((MemberReferenceExpression)invocation.Target).Target);\n\t\t\t\tcreateInOtherType = !state.CurrentTypeDefinition.Equals(targetResolveResult.Type.GetDefinition());\n\t\t\t}\n\n\t\t\tbool isStatic;\n\t\t\tif (createInOtherType) {\n\t\t\t\tif (targetResolveResult.Type.GetDefinition() == null || targetResolveResult.Type.GetDefinition().Region.IsEmpty)\n\t\t\t\t\tyield break;\n\t\t\t\tisStatic = targetResolveResult is TypeResolveResult;\n\t\t\t\tif (isStatic && targetResolveResult.Type.Kind == TypeKind.Interface || targetResolveResult.Type.Kind == TypeKind.Enum)\n\t\t\t\t\tyield break;\n\t\t\t} else {\n\t\t\t\tisStatic = state.CurrentMember.IsStatic || state.CurrentTypeDefinition.IsStatic;\n\t\t\t}\n\n//\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n//\t\t\tif (service != null && !service.IsValidName(methodName, AffectedEntity.Method, Modifiers.Private, isStatic)) { \n//\t\t\t\tyield break;\n//\t\t\t}\n\n\n\t\t\tyield return CreateAction(\n\t\t\t\tcontext, \n\t\t\t\tinvocation,\n\t\t\t\tmethodName, \n\t\t\t\tguessedType,\n\t\t\t\tGenerateParameters(context, invocation.Arguments),\n\t\t\t\tcreateInOtherType,\n\t\t\t\tisStatic,\n\t\t\t\ttargetResolveResult);\n\t\t}\n\n\t\tstatic ParameterModifier GetModifiers(IParameter parameter)\n\t\t{\n\t\t\tif (parameter.IsOut)\n\t\t\t\treturn ParameterModifier.Out;\n\t\t\tif (parameter.IsRef)\n\t\t\t\treturn ParameterModifier.Ref;\n\t\t\tif (parameter.IsParams)\n\t\t\t\treturn ParameterModifier.Params;\n\t\t\treturn ParameterModifier.None;\n\t\t}\n\n\t\tstatic CodeAction CreateAction(RefactoringContext context, AstNode createFromNode, string methodName, AstType returnType, IEnumerable<ParameterDeclaration> parameters, bool createInOtherType, bool isStatic, ResolveResult targetResolveResult)\n\t\t{\n\t\t\treturn new CodeAction(context.TranslateString(\"Create method\"), script => {\n\t\t\t\tvar throwStatement = new ThrowStatement();\n\t\t\t\tvar decl = new MethodDeclaration {\n\t\t\t\t\tReturnType = returnType,\n\t\t\t\t\tName = methodName,\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tthrowStatement\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tdecl.Parameters.AddRange(parameters);\n\t\t\t\t\n\t\t\t\tif (isStatic)\n\t\t\t\t\tdecl.Modifiers |= Modifiers.Static;\n\t\t\t\t\n\t\t\t\tif (createInOtherType) {\n\t\t\t\t\tif (targetResolveResult.Type.Kind == TypeKind.Interface) {\n\t\t\t\t\t\tdecl.Body = null;\n\t\t\t\t\t\tdecl.Modifiers = Modifiers.None;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdecl.Modifiers |= Modifiers.Public;\n\t\t\t\t\t}\n\n\t\t\t\t\tscript\n\t\t\t\t\t\t.InsertWithCursor(context.TranslateString(\"Create method\"), targetResolveResult.Type.GetDefinition(), (s, c) => {\n\t\t\t\t\t\tthrowStatement.Expression = new ObjectCreateExpression(c.CreateShortType(\"System\", \"NotImplementedException\"));\n\t\t\t\t\t\treturn decl;\n\t\t\t\t\t})\n\t\t\t\t\t\t.ContinueScript(s => s.Select(throwStatement));\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tthrowStatement.Expression = new ObjectCreateExpression(context.CreateShortType(\"System\", \"NotImplementedException\"));\n\t\t\t\t}\n\n\t\t\t\tscript\n\t\t\t\t\t.InsertWithCursor(context.TranslateString(\"Create method\"), Script.InsertPosition.Before, decl)\n\t\t\t\t\t.ContinueScript(() => script.Select(throwStatement));\n\t\t\t}, createFromNode.GetNodeAt(context.Location) ?? createFromNode)  { Severity = ICSharpCode.NRefactory.Refactoring.Severity.Error };\n\t\t}\n\n\t\tpublic static IEnumerable<ParameterDeclaration> GenerateParameters(RefactoringContext context, IEnumerable<Expression> arguments)\n\t\t{\n\t\t\tvar nameCounter = new Dictionary<string, int>();\n\t\t\tforeach (var argument in arguments) {\n\t\t\t\tvar direction = ParameterModifier.None;\n\t\t\t\tAstNode node;\n\t\t\t\tif (argument is DirectionExpression) {\n\t\t\t\t\tvar de = (DirectionExpression)argument;\n\t\t\t\t\tdirection = de.FieldDirection == FieldDirection.Out ? ParameterModifier.Out : ParameterModifier.Ref;\n\t\t\t\t\tnode = de.Expression;\n\t\t\t\t} else {\n\t\t\t\t\tnode = argument;\n\t\t\t\t}\n\n\t\t\t\tvar resolveResult = context.Resolve(node);\n\t\t\t\tstring name = CreateBaseName(argument, resolveResult.Type);\n\t\t\t\tif (!nameCounter.ContainsKey(name)) {\n\t\t\t\t\tnameCounter [name] = 1;\n\t\t\t\t} else {\n\t\t\t\t\tnameCounter [name]++;\n\t\t\t\t\tname += nameCounter [name].ToString();\n\t\t\t\t}\n\t\t\t\tvar type = resolveResult.Type.Kind == TypeKind.Unknown || resolveResult.Type.Kind == TypeKind.Null ? new PrimitiveType(\"object\") : context.CreateShortType(resolveResult.Type);\n\n\t\t\t\tyield return new ParameterDeclaration(type, name) { ParameterModifier = direction};\n\t\t\t}\n\t\t}\n\n\t\tstatic string CreateBaseNameFromString(string str)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(str)) {\n\t\t\t\treturn \"empty\";\n\t\t\t}\n\t\t\tvar sb = new StringBuilder();\n\t\t\tbool firstLetter = true, wordStart = false;\n\t\t\tforeach (char ch in str) {\n\t\t\t\tif (char.IsWhiteSpace(ch)) {\n\t\t\t\t\twordStart = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!char.IsLetter(ch))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (firstLetter) {\n\t\t\t\t\tsb.Append(char.ToLower(ch));\n\t\t\t\t\tfirstLetter = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (wordStart) {\n\t\t\t\t\tsb.Append(char.ToUpper(ch));\n\t\t\t\t\twordStart = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append(ch);\n\t\t\t}\n\t\t\treturn sb.Length == 0 ? \"str\" : sb.ToString();\n\t\t}\n\n\t\tpublic static string CreateBaseName(AstNode node, IType type)\n\t\t{\n\t\t\tstring name = null;\n\t\t\tif (node is NullReferenceExpression)\n\t\t\t\treturn \"o\";\n\t\t\tif (node is DirectionExpression)\n\t\t\t\tnode = ((DirectionExpression)node).Expression;\n\t\t\tif (node is IdentifierExpression) {\n\t\t\t\tname = ((IdentifierExpression)node).Identifier;\n\t\t\t} else if (node is MemberReferenceExpression) {\n\t\t\t\tname = ((MemberReferenceExpression)node).MemberName;\n\t\t\t} else if (node is PrimitiveExpression) {\n\t\t\t\tvar pe = (PrimitiveExpression)node;\n\t\t\t\tif (pe.Value is string) {\n\t\t\t\t\tname = CreateBaseNameFromString(pe.Value.ToString());\n\t\t\t\t} else {\n\t\t\t\t\treturn char.ToLower(type.Name [0]).ToString();\n\t\t\t\t}\n\t\t\t} else if (node is ArrayCreateExpression) {\n\t\t\t\tname = \"arr\";\n\t\t\t} else {\n\t\t\t\tif (type.Kind == TypeKind.Unknown)\n\t\t\t\t\treturn \"par\";\n\t\t\t\tname = GuessNameFromType(type);\n\t\t\t}\n\t\t\tvar sb = new StringBuilder ();\n\t\t\tsb.Append (char.ToLower(name [0]));\n\t\t\tfor (int i = 1; i < name.Length; i++) {\n\t\t\t\tvar ch = name[i];\n\t\t\t\tif (char.IsLetterOrDigit (ch) || ch == '_')\n\t\t\t\t\tsb.Append (ch);\n\t\t\t}\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tinternal static string GuessNameFromType(IType returnType)\n\t\t{\n\t\t\tswitch (returnType.ReflectionName) {\n\t\t\t\tcase \"System.Byte\":\n\t\t\t\tcase \"System.SByte\":\n\t\t\t\t\treturn \"b\";\n\t\t\t\t\n\t\t\t\tcase \"System.Int16\":\n\t\t\t\tcase \"System.UInt16\":\n\t\t\t\tcase \"System.Int32\":\n\t\t\t\tcase \"System.UInt32\":\n\t\t\t\tcase \"System.Int64\":\n\t\t\t\tcase \"System.UInt64\":\n\t\t\t\t\treturn \"i\";\n\t\t\t\t\n\t\t\t\tcase \"System.Boolean\":\n\t\t\t\t\treturn \"b\";\n\t\t\t\t\n\t\t\t\tcase \"System.DateTime\":\n\t\t\t\t\treturn \"date\";\n\t\t\t\t\n\t\t\t\tcase \"System.Char\":\n\t\t\t\t\treturn \"ch\";\n\t\t\t\tcase \"System.Double\":\n\t\t\t\tcase \"System.Decimal\":\n\t\t\t\t\treturn \"d\";\n\t\t\t\tcase \"System.Single\":\n\t\t\t\t\treturn \"f\";\n\t\t\t\tcase \"System.String\":\n\t\t\t\t\treturn \"str\";\n\t\t\t\t\n\t\t\t\tcase \"System.Exception\":\n\t\t\t\t\treturn \"e\";\n\t\t\t\tcase \"System.Object\":\n\t\t\t\t\treturn \"obj\";\n\t\t\t\tcase \"System.Func\":\n\t\t\t\t\treturn \"func\";\n\t\t\t\tcase \"System.Action\":\n\t\t\t\t\treturn \"action\";\n\t\t\t}\n\t\t\tif (returnType.Kind == TypeKind.Interface && returnType.Name.StartsWith(\"I\", System.StringComparison.Ordinal))\n\t\t\t\treturn returnType.Name.Substring(1);\n\t\t\telse\n\t\t\t\treturn returnType.Name;\n\t\t}\n\t\t\n\t\tstring GetMethodName(InvocationExpression invocation)\n\t\t{\n\t\t\tif (invocation.Target is IdentifierExpression)\n\t\t\t\treturn ((IdentifierExpression)invocation.Target).Identifier;\n\t\t\tif (invocation.Target is MemberReferenceExpression)\n\t\t\t\treturn ((MemberReferenceExpression)invocation.Target).MemberName;\n\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateOverloadWithoutParameterAction.cs",
    "content": "﻿// \n// CreateOverloadWithoutParameterAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading.Tasks;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Create overload without parameter\", Description = \"Create overload without the selected parameter.\")]\n\tpublic class CreateOverloadWithoutParameterAction : SpecializedCodeAction<ParameterDeclaration>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, ParameterDeclaration node)\n\t\t{\n\t\t\tif (!node.DefaultExpression.IsNull)\n\t\t\t\treturn null;\n\t\t\tif (node.ParameterModifier == ParameterModifier.This || node.ParameterModifier == ParameterModifier.Params)\n\t\t\t\treturn null;\n\t\t\tif (!node.NameToken.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar methodDecl = node.Parent as MethodDeclaration;\n\t\t\tif (methodDecl == null)\n\t\t\t\treturn null;\n\n\t\t\t// explicit implementation\n\t\t\tif (!methodDecl.PrivateImplementationType.IsNull)\n\t\t\t\treturn null;\n\n\t\t\t// find existing method\n\t\t\tvar resolveResult = context.Resolve(methodDecl) as MemberResolveResult;\n\t\t\tif (resolveResult == null)\n\t\t\t\treturn null;\n\t\t\tvar method = resolveResult.Member as IMethod;\n\t\t\tif (method == null)\n\t\t\t\treturn null;\n\t\t\tvar parameters = new List<IParameter> (method.Parameters.Where (param => param.Name != node.Name));\n\t\t\tif (method.DeclaringType.GetMethods (\n\t\t\t\tm => m.Name == method.Name && m.TypeParameters.Count == method.TypeParameters.Count)\n\t\t\t\t.Any (m => ParameterListComparer.Instance.Equals (m.Parameters, parameters)))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn new CodeAction (context.TranslateString (\"Create overload without parameter\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar defaultExpr = GetDefaultValueExpression (context, node.Type);\n\n\t\t\t\t\tvar body = new BlockStatement ();\n\t\t\t\t\tExpression argExpr;\n\t\t\t\t\tif (node.ParameterModifier == ParameterModifier.Ref) {\n\t\t\t\t\t\tbody.Add (new VariableDeclarationStatement (node.Type.Clone (), node.Name, defaultExpr));\n\t\t\t\t\t\targExpr = GetArgumentExpression (node);\n\t\t\t\t\t} else if (node.ParameterModifier == ParameterModifier.Out) {\n\t\t\t\t\t\tbody.Add (new VariableDeclarationStatement (node.Type.Clone (), node.Name));\n\t\t\t\t\t\targExpr = GetArgumentExpression (node);\n\t\t\t\t\t} else {\n\t\t\t\t\t\targExpr = defaultExpr;\n\t\t\t\t\t}\n\t\t\t\t\tbody.Add (new InvocationExpression (new IdentifierExpression (methodDecl.Name),\n\t\t\t\t\t\tmethodDecl.Parameters.Select (param => param == node ? argExpr : GetArgumentExpression(param))));\n\n\t\t\t\t\tvar decl = (MethodDeclaration)methodDecl.Clone ();\n\t\t\t\t\tdecl.Parameters.Remove (decl.Parameters.First (param => param.Name == node.Name));\n\t\t\t\t\tdecl.Body = body;\n\n\t\t\t\t\tscript\n\t\t\t\t\t\t.InsertWithCursor (\"Create overload without parameter\", Script.InsertPosition.Before, decl)\n\t\t\t\t\t\t.ContinueScript (() => script.Select(argExpr));\n\t\t\t\t}, node.NameToken); \n\t\t}\n\n\t\tstatic Expression GetArgumentExpression(ParameterDeclaration parameter)\n\t\t{\n\t\t\tvar identifierExpr = new IdentifierExpression(parameter.Name);\n\t\t\tswitch (parameter.ParameterModifier) {\n\t\t\t\tcase ParameterModifier.Out:\n\t\t\t\t\treturn new DirectionExpression (FieldDirection.Out, identifierExpr);\n\t\t\t\tcase ParameterModifier.Ref:\n\t\t\t\t\treturn new DirectionExpression (FieldDirection.Ref, identifierExpr);\n\t\t\t}\n\t\t\treturn identifierExpr;\n\t\t}\n\n\t\tstatic Expression GetDefaultValueExpression (RefactoringContext context, AstType astType)\n\t\t{\n\t\t\tvar type = context.ResolveType (astType);\n\n\t\t\t// array\n\t\t\tif (type.Kind == TypeKind.Array)\n\t\t\t\treturn new ObjectCreateExpression (astType.Clone ());\n\n\t\t\t// enum\n\t\t\tif (type.Kind == TypeKind.Enum) {\n\t\t\t\tvar members = type.GetMembers ().ToArray();\n\t\t\t\tif (members.Length == 0)\n\t\t\t\t\treturn new DefaultValueExpression (astType.Clone ());\n\t\t\t\treturn astType.Member(members[0].Name).Clone ();\n\t\t\t}\n\n\t\t\tif ((type.IsReferenceType ?? false) || type.Kind == TypeKind.Dynamic)\n\t\t\t\treturn new NullReferenceExpression ();\n\n\t\t\tvar typeDefinition = type.GetDefinition ();\n\t\t\tif (typeDefinition != null) {\n\t\t\t\tswitch (typeDefinition.KnownTypeCode) {\n\t\t\t\t\tcase KnownTypeCode.Boolean:\n\t\t\t\t\t\treturn new PrimitiveExpression (false);\n\n\t\t\t\t\tcase KnownTypeCode.Char:\n\t\t\t\t\t\treturn new PrimitiveExpression ('\\0');\n\n\t\t\t\t\tcase KnownTypeCode.SByte:\n\t\t\t\t\tcase KnownTypeCode.Byte:\n\t\t\t\t\tcase KnownTypeCode.Int16:\n\t\t\t\t\tcase KnownTypeCode.UInt16:\n\t\t\t\t\tcase KnownTypeCode.Int32:\n\t\t\t\t\tcase KnownTypeCode.UInt32:\n\t\t\t\t\tcase KnownTypeCode.Int64:\n\t\t\t\t\tcase KnownTypeCode.UInt64:\n\t\t\t\t\tcase KnownTypeCode.Single:\n\t\t\t\t\tcase KnownTypeCode.Double:\n\t\t\t\t\tcase KnownTypeCode.Decimal:\n\t\t\t\t\t\treturn new PrimitiveExpression (0);\n\n\t\t\t\t\tcase KnownTypeCode.NullableOfT:\n\t\t\t\t\t\treturn new NullReferenceExpression ();\n\t\t\t\t}\n\t\t\t\tif (type.Kind == TypeKind.Struct)\n\t\t\t\t\treturn new ObjectCreateExpression (astType.Clone ());\n\t\t\t}\n\t\t\treturn new DefaultValueExpression (astType.Clone ());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreatePropertyAction.cs",
    "content": "﻿// \n// CreateProperty.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create property\", Description = \"Creates a property for a undefined variable.\")]\n\tpublic class CreatePropertyAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar identifier = CreateFieldAction.GetCreatePropertyOrFieldNode (context);\n\t\t\tif (identifier == null)\n\t\t\t\tyield break;\n\t\t\tif (CreateFieldAction.IsInvocationTarget(identifier))\n\t\t\t\tyield break;\n\n\t\t\tvar propertyName = GetPropertyName(identifier);\n\t\t\tif (propertyName == null)\n\t\t\t\tyield break;\n\n\t\t\tvar statement = context.GetNode<Statement>();\n\t\t\tif (statement == null)\n\t\t\t\tyield break;\n\n\t\t\tif (!(context.Resolve(identifier).IsError))\n\t\t\t\tyield break;\n\n\t\t\tvar guessedType = TypeGuessing.GuessAstType(context, identifier);\n\t\t\tif (guessedType == null)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore(identifier);\n\t\t\tif (state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\t\t\t\n\t\t\tbool createInOtherType = false;\n\t\t\tResolveResult targetResolveResult = null;\n\t\t\tif (identifier is MemberReferenceExpression) {\n\t\t\t\ttargetResolveResult = context.Resolve(((MemberReferenceExpression)identifier).Target);\n\t\t\t\tif (targetResolveResult.Type.GetDefinition() == null || targetResolveResult.Type.GetDefinition().Region.IsEmpty)\n\t\t\t\t\tyield break;\n\t\t\t\tcreateInOtherType = !state.CurrentTypeDefinition.Equals(targetResolveResult.Type.GetDefinition());\n\t\t\t}\n\n\t\t\tbool isStatic = targetResolveResult is TypeResolveResult;\n\t\t\tif (createInOtherType) {\n\t\t\t\tif (isStatic && targetResolveResult.Type.Kind == TypeKind.Interface || targetResolveResult.Type.Kind == TypeKind.Enum)\n\t\t\t\t\tyield break;\n\t\t\t} else {\n\t\t\t\tif (state.CurrentMember == null)\n\t\t\t\t\tyield break;\n\t\t\t\tisStatic |= state.CurrentTypeDefinition.IsStatic;\n\t\t\t\tif (targetResolveResult == null)\n\t\t\t\t\tisStatic |= state.CurrentMember.IsStatic;\n\t\t\t}\n\t\t\tisStatic &= !(identifier is NamedExpression);\n\n\t//\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n//\t\t\tif (service != null && !service.IsValidName(propertyName, AffectedEntity.Property, Modifiers.Private, isStatic)) { \n//\t\t\t\tyield break;\n//\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create property\"), script => {\n\t\t\t\tvar decl = new PropertyDeclaration() {\n\t\t\t\t\tReturnType = guessedType,\n\t\t\t\t\tName = propertyName,\n\t\t\t\t\tGetter = new Accessor(),\n\t\t\t\t\tSetter = new Accessor()\n\t\t\t\t};\n\t\t\t\tif (isStatic)\n\t\t\t\t\tdecl.Modifiers |= Modifiers.Static;\n\t\t\t\t\n\t\t\t\tif (createInOtherType) {\n\t\t\t\t\tif (targetResolveResult.Type.Kind == TypeKind.Interface) {\n\t\t\t\t\t\tdecl.Modifiers = Modifiers.None;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdecl.Modifiers |= Modifiers.Public;\n\t\t\t\t\t}\n\t\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\t\tcontext.TranslateString(\"Create property\"),\n\t\t\t\t\t\ttargetResolveResult.Type.GetDefinition(),\n\t\t\t\t\t\t(s, c) => decl);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tscript.InsertWithCursor(context.TranslateString(\"Create property\"), Script.InsertPosition.Before, decl);\n\n\t\t\t}, identifier.GetNodeAt(context.Location) ?? identifier) { Severity = ICSharpCode.NRefactory.Refactoring.Severity.Error };\n\t\t}\n\n\t\tinternal static string GetPropertyName(Expression expr)\n\t\t{\n\t\t\tif (expr is IdentifierExpression) \n\t\t\t\treturn ((IdentifierExpression)expr).Identifier;\n\t\t\tif (expr is MemberReferenceExpression) \n\t\t\t\treturn ((MemberReferenceExpression)expr).MemberName;\n\t\t\tif (expr is NamedExpression) \n\t\t\t\treturn ((NamedExpression)expr).Name;\n\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/DeclareLocalVariableAction.cs",
    "content": "// \n// DeclareLocalVariableAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Declare local variable\", Description = \"Declare a local variable out of a selected expression.\")]\n\tpublic class DeclareLocalVariableAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tif (!context.IsSomethingSelected) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar selected = new List<AstNode>(context.GetSelectedNodes());\n\n\t\t\tif (selected.Count != 1 || !(selected [0] is Expression)) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar expr = selected [0] as Expression;\n\t\t\tif (expr is ArrayInitializerExpression) {\n\t\t\t\tvar arr = (ArrayInitializerExpression)expr;\n\t\t\t\tif (arr.IsSingleElement) {\n\t\t\t\t\texpr = arr.Elements.First();\n\t\t\t\t} else {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar visitor = new SearchNodeVisitior(expr);\n\t\t\t\n\t\t\tvar node = context.GetNode <BlockStatement>();\n\t\t\tif (node != null) {\n\t\t\t\tnode.AcceptVisitor(visitor);\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Declare local variable\"), script => {\n\t\t\t\tvar resolveResult = context.Resolve(expr);\n\t\t\t\tvar guessedType = resolveResult.Type;\n\t\t\t\tif (resolveResult is MethodGroupResolveResult) {\n\t\t\t\t\tguessedType = GetDelegateType(context, ((MethodGroupResolveResult)resolveResult).Methods.First(), expr);\n\t\t\t\t}\n\t\t\t\tvar name = CreateMethodDeclarationAction.CreateBaseName(expr, guessedType);\n\t\t\t\tname = context.GetLocalNameProposal(name, expr.StartLocation);\n\t\t\t\tvar type = context.UseExplicitTypes ? context.CreateShortType(guessedType) : new SimpleType(\"var\");\n\t\t\t\tvar varDecl = new VariableDeclarationStatement(type, name, expr.Clone());\n\t\t\t\tvar replaceNode = visitor.Matches.First () as Expression;\n\t\t\t\tif (replaceNode.Parent is ExpressionStatement) {\n\t\t\t\t\tscript.Replace(replaceNode.Parent, varDecl);\n\t\t\t\t\tscript.Select(varDecl.Variables.First().NameToken);\n\t\t\t\t} else {\n\t\t\t\t\tvar containing = replaceNode.Parent;\n\t\t\t\t\twhile (!(containing.Parent is BlockStatement)) {\n\t\t\t\t\t\tcontaining = containing.Parent;\n\t\t\t\t\t}\n\n\t\t\t\t\tscript.InsertBefore(containing, varDecl);\n\t\t\t\t\tvar identifierExpression = new IdentifierExpression(name);\n\t\t\t\t\tscript.Replace(replaceNode, identifierExpression);\n\t\t\t\t\tscript.Link(varDecl.Variables.First().NameToken, identifierExpression);\n\t\t\t\t}\n\t\t\t}, expr);\n\n\t\t\tif (visitor.Matches.Count > 1) {\n\t\t\t\tyield return new CodeAction(string.Format(context.TranslateString(\"Declare local variable (replace '{0}' occurrences)\"), visitor.Matches.Count), script => {\n\t\t\t\t\tvar resolveResult = context.Resolve(expr);\n\t\t\t\t\tvar guessedType = resolveResult.Type;\n\t\t\t\t\tif (resolveResult is MethodGroupResolveResult) {\n\t\t\t\t\t\tguessedType = GetDelegateType(context, ((MethodGroupResolveResult)resolveResult).Methods.First(), expr);\n\t\t\t\t\t}\n\t\t\t\t\tvar linkedNodes = new List<AstNode>();\n\t\t\t\t\tvar name = CreateMethodDeclarationAction.CreateBaseName(expr, guessedType);\n\t\t\t\t\tname = context.GetLocalNameProposal(name, expr.StartLocation);\n\t\t\t\t\tvar type = context.UseExplicitTypes ? context.CreateShortType(guessedType) : new SimpleType(\"var\");\n\t\t\t\t\tvar varDecl = new VariableDeclarationStatement(type, name, expr.Clone());\n\t\t\t\t\tlinkedNodes.Add(varDecl.Variables.First().NameToken);\n\t\t\t\t\tvar first = visitor.Matches [0];\n\t\t\t\t\tif (first.Parent is ExpressionStatement) {\n\t\t\t\t\t\tscript.Replace(first.Parent, varDecl);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar containing = first.Parent;\n\t\t\t\t\t\twhile (!(containing.Parent is BlockStatement)) {\n\t\t\t\t\t\t\tcontaining = containing.Parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscript.InsertBefore(containing, varDecl);\n\t\t\t\t\t\tvar identifierExpression = new IdentifierExpression(name);\n\t\t\t\t\t\tlinkedNodes.Add(identifierExpression);\n\t\t\t\t\t\tscript.Replace(first, identifierExpression);\n\t\t\t\t\t}\n\t\t\t\t\tfor (int i = 1; i < visitor.Matches.Count; i++) {\n\t\t\t\t\t\tvar identifierExpression = new IdentifierExpression(name);\n\t\t\t\t\t\tlinkedNodes.Add(identifierExpression);\n\t\t\t\t\t\tscript.Replace(visitor.Matches [i], identifierExpression);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Link(linkedNodes.ToArray ());\n\t\t\t\t}, expr);\n\t\t\t}\n\t\t}\n\n\t\t// Gets Action/Func delegate types for a given method.\n\t\tIType GetDelegateType(RefactoringContext context, IMethod method, Expression expr)\n\t\t{\n\t\t\tvar parameters = new List<IType>();\n\t\t\tvar invoke = expr.Parent as InvocationExpression;\n\t\t\tif (invoke == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tforeach (var arg in invoke.Arguments) {\n\t\t\t\tparameters.Add(context.Resolve(arg).Type);\n\t\t\t}\n\n\t\t\tITypeDefinition genericType;\n\t\t\tif (method.ReturnType.FullName == \"System.Void\") {\n\t\t\t\tgenericType = context.Compilation.GetAllTypeDefinitions().FirstOrDefault(t => t.FullName == \"System.Action\" && t.TypeParameterCount == parameters.Count);\n\t\t\t} else {\n\t\t\t\tparameters.Add(method.ReturnType);\n\t\t\t\tgenericType = context.Compilation.GetAllTypeDefinitions().FirstOrDefault(t => t.FullName == \"System.Func\" && t.TypeParameterCount == parameters.Count);\n\t\t\t}\n\t\t\tif (genericType == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new ParameterizedType(genericType, parameters);\n\t\t}\n\n\t\t\t\t\n\t\tinternal class SearchNodeVisitior : DepthFirstAstVisitor\n\t\t{\n\t\t\treadonly AstNode searchForNode;\n\t\t\tpublic readonly List<AstNode> Matches = new List<AstNode> ();\n\t\t\t\n\t\t\tpublic SearchNodeVisitior (AstNode searchForNode)\n\t\t\t{\n\t\t\t\tthis.searchForNode = searchForNode;\n\t\t\t\tAddNode (searchForNode);\n\t\t\t}\n\n\t\t\tvoid AddNode(AstNode node)\n\t\t\t{\n\t\t\t\tif (node.Parent is ParenthesizedExpression) {\n\t\t\t\t\tMatches.Add(node.Parent);\n\t\t\t\t} else {\n\t\t\t\t\tMatches.Add(node);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t{\n\t\t\t\tif (node.StartLocation > searchForNode.StartLocation && node.IsMatch(searchForNode)) {\n\t\t\t\t\tAddNode(node);\n\t\t\t\t\treturn;\n\t\t\t\t} \n\t\t\t\tbase.VisitChildren (node);\n\t\t\t}\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtensionMethodInvocationToStaticMethodInvocationAction.cs",
    "content": "//\n// ExtensionMethodInvocationToStaticMethodInvocationAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Invoke using static method syntax\",\n\t               Description = \"Converts the call into static method call syntax.\")]\n\tpublic class ExtensionMethodInvocationToStaticMethodInvocationAction : CodeActionProvider\n\t{\n\t\t#region ICodeActionProvider implementation\n\n\t\tpublic override IEnumerable<CodeAction> GetActions (RefactoringContext context)\n\t\t{\n\t\t\tvar invocation = context.GetNode<InvocationExpression>();\n\t\t\tif (invocation == null)\n\t\t\t\tyield break;\n\t\t\tvar memberReference = invocation.Target as MemberReferenceExpression;\n\t\t\tif (memberReference == null)\n\t\t\t\tyield break;\n\t\t\tvar invocationRR = context.Resolve(invocation) as CSharpInvocationResolveResult;\n\t\t\tif (invocationRR == null)\n\t\t\t\tyield break;\n\t\t\tif (invocationRR.IsExtensionMethodInvocation)\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Convert to static method call\"), script => {\n\t\t\t\t\tscript.Replace(invocation, ToStaticMethodInvocation(invocation, memberReference, invocationRR));\n\t\t\t\t}, invocation);\n\t\t}\n\n\t\t#endregion\n\n\t\tAstNode ToStaticMethodInvocation(InvocationExpression invocation, MemberReferenceExpression memberReference,\n\t\t                                 CSharpInvocationResolveResult invocationRR)\n\t\t{\n\t\t\tvar newArgumentList = invocation.Arguments.Select(arg => arg.Clone()).ToList();\n\t\t\tnewArgumentList.Insert(0, memberReference.Target.Clone());\n\t\t\tvar newTarget = memberReference.Clone() as MemberReferenceExpression;\n\t\t\tnewTarget.Target = new IdentifierExpression(invocationRR.Member.DeclaringType.Name);\n\t\t\treturn new InvocationExpression(newTarget, newArgumentList);\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtractAnonymousMethodAction.cs",
    "content": "﻿// \n// ExtractAnonymousMethodAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Extract anonymous method\",\n\t\t\t\t\tDescription = \"Extract anonymous method to method of the containing type\")]\n\tpublic class ExtractAnonymousMethodAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions (RefactoringContext context)\n\t\t{\n\t\t\t// lambda\n\t\t\tvar lambda = context.GetNode<LambdaExpression> ();\n\t\t\tif (lambda != null && lambda.ArrowToken.Contains(context.Location)) {\n\t\t\t\tif (ContainsLocalReferences (context, lambda, lambda.Body))\n\t\t\t\t\tyield break;\n\n\t\t\t\tbool noReturn = false;\n\t\t\t\tBlockStatement body;\n\t\t\t\tif (lambda.Body is BlockStatement) {\n\t\t\t\t\tbody = (BlockStatement)lambda.Body.Clone ();\n\t\t\t\t} else {\n\t\t\t\t\tif (!(lambda.Body is Expression))\n\t\t\t\t\t\tyield break;\n\t\t\t\t\tbody = new BlockStatement ();\n\n\t\t\t\t\tvar type = LambdaHelper.GetLambdaReturnType (context, lambda);\n\t\t\t\t\tif (type == null || type.ReflectionName == \"System.Void\") {\n\t\t\t\t\t\tnoReturn = true;\n\t\t\t\t\t\tbody.Add ((Expression)lambda.Body.Clone ());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody.Add (new ReturnStatement ((Expression)lambda.Body.Clone ()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar method = GetMethod (context, (LambdaResolveResult)context.Resolve (lambda), body, noReturn);\n\t\t\t\tyield return GetAction (context, lambda, method);\n\t\t\t}\n\n\t\t\t// anonymous method\n\t\t\tvar anonymousMethod = context.GetNode<AnonymousMethodExpression> ();\n\t\t\tif (anonymousMethod != null && anonymousMethod.DelegateToken.Contains(context.Location)) {\n\t\t\t\tif (ContainsLocalReferences (context, anonymousMethod, anonymousMethod.Body))\n\t\t\t\t\tyield break;\n\n\t\t\t\tvar method = GetMethod (context, (LambdaResolveResult)context.Resolve (anonymousMethod), \n\t\t\t\t\t\t\t\t\t\t(BlockStatement)anonymousMethod.Body.Clone ());\n\t\t\t\tyield return GetAction (context, anonymousMethod, method);\n\t\t\t}\n\t\t}\n\n\t\tCodeAction GetAction (RefactoringContext context, AstNode node, MethodDeclaration method)\n\t\t{\n\t\t\treturn new CodeAction (context.TranslateString (\"Extract anonymous method\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar identifier = new IdentifierExpression (\"Method\");\n\t\t\t\t\tscript.Replace (node, identifier);\n\t\t\t\t\tscript.InsertBefore (node.GetParent<EntityDeclaration> (), method);\n\t\t\t\t\tscript.Link (method.NameToken, identifier);\n\t\t\t\t}, method.NameToken);\n\t\t}\n\n\t\tstatic MethodDeclaration GetMethod (RefactoringContext context, LambdaResolveResult lambda, BlockStatement body,\n\t\t\tbool noReturnValue = false)\n\t\t{\n\t\t\tvar method = new MethodDeclaration { Name = \"Method\" };\n\n\t\t\tif (noReturnValue) {\n\t\t\t\tmethod.ReturnType = new PrimitiveType (\"void\"); \n\t\t\t} else {\n\t\t\t\tvar type = lambda.ReturnType;\n\t\t\t\tmethod.ReturnType = type.Kind == TypeKind.Unknown ? new PrimitiveType (\"void\") : context.CreateShortType (type);\n\t\t\t}\n\n\t\t\tforeach (var param in lambda.Parameters)\n\t\t\t\tmethod.Parameters.Add (new ParameterDeclaration (context.CreateShortType (param.Type), param.Name));\n\n\t\t\tmethod.Body = body;\n\t\t\tif (lambda.IsAsync)\n\t\t\t\tmethod.Modifiers |= Modifiers.Async;\n\n\t\t\treturn method;\n\t\t}\n\n\t\tstatic bool ContainsLocalReferences (RefactoringContext context, AstNode expr, AstNode body)\n\t\t{\n\t\t\tvar visitor = new ExtractMethod.VariableLookupVisitor (context);\n\t\t\tbody.AcceptVisitor (visitor);\n\t\t\treturn visitor.UsedVariables.Any (variable => !expr.Contains (variable.Region.Begin));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtractFieldAction.cs",
    "content": "// \n// ExtractFieldAction.cs\n//  \n// Author:\n//       Nieve <>\n// \n// Copyright (c) 2012 Nieve\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Extract field\", Description = \"Extracts a field from a local variable declaration.\")]\n\tpublic class ExtractFieldAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\t//TODO: implement variable assignment & ctor param\n\t\t\tvar varInit = context.GetNode<VariableInitializer>();\n\t\t\tif (varInit != null) {\n\t\t\t\tvar selectedNode = varInit.GetNodeAt(context.Location);\n\t\t\t\tif (selectedNode != varInit.NameToken)\n\t\t\t\t\tyield break;\n\n\t\t\t\tAstType type = varInit.GetPrevNode() as AstType;\n\t\t\t\tif (type == null) yield break;\n\t\t\t\tif (varInit.Parent is FieldDeclaration) yield break;\n\t\t\t\tif (CannotExtractField(context, varInit)) yield break;\n\t\t\t\t\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Assign to new field\"), s=>{\n\t\t\t\t\tvar name = varInit.Name;\n\n\t\t\t\t\tAstType extractedType;\n\t\t\t\t\tif (type.IsVar()) {\n\t\t\t\t\t\tIType resolvedType = context.Resolve(varInit.Initializer).Type;\n\t\t\t\t\t\textractedType = context.CreateShortType(resolvedType);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\textractedType = (AstType) type.Clone();\n\t\t\t\t\t}\n\n\t\t\t\t\tAstNode entityDeclarationNode = varInit.Parent;\n\t\t\t\t\twhile (!(entityDeclarationNode is EntityDeclaration) || (entityDeclarationNode is Accessor)) {\n\t\t\t\t\t\tentityDeclarationNode = entityDeclarationNode.Parent;\n\t\t\t\t\t}\n\t\t\t\t\tvar entity = (EntityDeclaration) entityDeclarationNode;\n\t\t\t\t\tbool isStatic = entity.HasModifier(Modifiers.Static);\n\n\t\t\t\t\tFieldDeclaration field = new FieldDeclaration(){\n\t\t\t\t\t\tModifiers = isStatic ? Modifiers.Static : Modifiers.None,\n\t\t\t\t\t\tReturnType = extractedType,\n\t\t\t\t\t\tVariables = { new VariableInitializer(name) }\n\t\t\t\t\t};\n\t\t\t\t\tAstNode nodeToRemove = RemoveDeclaration(varInit) ? varInit.Parent : type;\n\t\t\t\t\ts.Remove(nodeToRemove, true);\n\t\t\t\t\ts.InsertWithCursor(context.TranslateString(\"Insert new field\"),Script.InsertPosition.Before,field);\n\t\t\t\t\ts.FormatText(varInit.Parent);\n\t\t\t\t}, selectedNode);\n\t\t\t}\n\t\t\t\n\t\t\tvar idntf = context.GetNode<Identifier>();\n\t\t\tif (idntf == null) yield break;\n\t\t\tvar paramDec = idntf.Parent as ParameterDeclaration;\n\t\t\tif (paramDec != null) {\n\t\t\t\tvar ctor = paramDec.Parent as ConstructorDeclaration;\n\t\t\t\tif (ctor == null) yield break;\n\t\t\t\tMemberReferenceExpression thisField = new MemberReferenceExpression(new ThisReferenceExpression(), idntf.Name, new AstType[]{});\n\t\t\t\tvar assign = new AssignmentExpression(thisField, AssignmentOperatorType.Assign, new IdentifierExpression(idntf.Name));\n\t\t\t\tvar statement = new ExpressionStatement(assign);\n\t\t\t\tvar type = (idntf.GetPrevNode() as AstType).Clone();\n\t\t\t\tFieldDeclaration field = new FieldDeclaration(){\n\t\t\t\t\tReturnType = type.Clone(),\n\t\t\t\t\tVariables = { new VariableInitializer(idntf.Name) }\n\t\t\t\t};\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Assign to new field\"), s=>{\n\t\t\t\t\ts.InsertWithCursor(context.TranslateString(\"Insert new field\"),Script.InsertPosition.Before,field);\n\t\t\t\t\ts.AddTo(ctor.Body, statement);\n\t\t\t\t}, paramDec.NameToken);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool RemoveDeclaration (VariableInitializer varInit){\n\t\t\tvar result = varInit.Parent as VariableDeclarationStatement;\n\t\t\treturn result.Variables.First ().Initializer.IsNull;\n\t\t}\n\t\t\n\t\tstatic bool CannotExtractField (RefactoringContext context, VariableInitializer varInit)\n\t\t{\n\t\t\tvar result = varInit.Parent as VariableDeclarationStatement;\n\t\t\treturn result == null || result.Variables.Count != 1 || ContainsAnonymousType(context.Resolve(varInit.Initializer).Type);\n\t\t}\n\n\t\tstatic bool ContainsAnonymousType (IType type)\n\t\t{\n\t\t\tif (type.Kind == TypeKind.Anonymous)\n\t\t\t\treturn true;\n\n\t\t\tvar arrayType = type as ArrayType;\n\t\t\treturn arrayType != null && ContainsAnonymousType (arrayType.ElementType);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtractMethod/ExtractMethodAction.cs",
    "content": "// \n// ExtractMethodAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing System.Threading;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading.Tasks;\nusing Mono.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod\n{\n\t[ContextAction(\"Extract method\", Description = \"Creates a new method out of selected text.\")]\n\tpublic class ExtractMethodAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tif (!context.IsSomethingSelected)\n\t\t\t\tyield break;\n\t\t\tvar selected = new List<AstNode>(context.GetSelectedNodes());\n\t\t\tif (selected.Count == 0)\n\t\t\t\tyield break;\n\t\t\t\n\t\t\tif (selected.Count == 1 && selected [0] is Expression) {\n\t\t\t\tvar codeAction = CreateFromExpression(context, (Expression)selected [0]);\n\t\t\t\tif (codeAction == null)\n\t\t\t\t\tyield break;\n\t\t\t\tyield return codeAction;\n\t\t\t}\n\n\t\t\tforeach (var node in selected) {\n\t\t\t\tif (!(node is Statement) && !(node is Comment) && !(node is NewLineNode) && !(node is PreProcessorDirective))\n\t\t\t\t\tyield break;\n\t\t\t\tif (node.DescendantNodesAndSelf().Any(n => n is YieldBreakStatement || n is YieldReturnStatement))\n\t\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar action = CreateFromStatements (context, new List<AstNode> (selected));\n\t\t\tif (action != null)\n\t\t\t\tyield return action;\n\t\t}\n\t\t\n\t\tCodeAction CreateFromExpression(RefactoringContext context, Expression expression)\n\t\t{\n\t\t\tvar resolveResult = context.Resolve(expression);\n\t\t\tif (resolveResult.IsError)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn new CodeAction(context.TranslateString(\"Extract method\"), script => {\n\t\t\t\tstring methodName = \"NewMethod\";\n\t\t\t\tvar method = new MethodDeclaration {\n\t\t\t\t\tReturnType = context.CreateShortType(resolveResult.Type),\n\t\t\t\t\tName = methodName,\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew ReturnStatement(expression.Clone())\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tif (!StaticVisitor.UsesNotStaticMember(context, expression))\n\t\t\t\t\tmethod.Modifiers |= Modifiers.Static;\n\n\t\t\t\tvar usedVariables = VariableLookupVisitor.Analyze(context, expression);\n\t\t\t\t\n\t\t\t\tvar inExtractedRegion = new VariableUsageAnalyzation (context, usedVariables);\n\n\t\t\t\tusedVariables.Sort ((l, r) => l.Region.Begin.CompareTo (r.Region.Begin));\n\t\t\t\tvar target = new IdentifierExpression(methodName);\n\t\t\t\tvar invocation = new InvocationExpression(target);\n\t\t\t\tforeach (var variable in usedVariables) {\n\t\t\t\t\tExpression argumentExpression = new IdentifierExpression(variable.Name); \n\t\t\t\t\t\n\t\t\t\t\tvar mod = ParameterModifier.None;\n\t\t\t\t\tif (inExtractedRegion.GetStatus (variable) == VariableState.Changed) {\n\t\t\t\t\t\tmod = ParameterModifier.Ref;\n\t\t\t\t\t\targumentExpression = new DirectionExpression(FieldDirection.Ref, argumentExpression);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmethod.Parameters.Add(new ParameterDeclaration(context.CreateShortType(variable.Type), variable.Name, mod));\n\t\t\t\t\tinvocation.Arguments.Add(argumentExpression);\n\t\t\t\t}\n\n\t\t\t\tscript\n\t\t\t\t\t.InsertWithCursor(context.TranslateString(\"Extract method\"), Script.InsertPosition.Before, method)\n\t\t\t\t\t.ContinueScript (delegate {\n\t\t\t\t\t\tscript.Replace(expression, invocation);\n\t\t\t\t\t\tscript.Link(target, method.NameToken);\n\t\t\t\t\t});\n\t\t\t}, expression);\n\t\t}\n\t\t\n\t\tCodeAction CreateFromStatements(RefactoringContext context, List<AstNode> statements)\n\t\t{\n\t\t\tif (!(statements [0].Parent is Statement))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn new CodeAction(context.TranslateString(\"Extract method\"), script => {\n\t\t\t\tstring methodName = \"NewMethod\";\n\t\t\t\tvar method = new MethodDeclaration() {\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tName = methodName,\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t};\n\t\t\t\tbool usesNonStaticMember = false;\n\t\t\t\tforeach (var node in statements) {\n\t\t\t\t\tusesNonStaticMember |= StaticVisitor.UsesNotStaticMember(context, node);\n\t\t\t\t\tif (node is Statement) {\n\t\t\t\t\t\tmethod.Body.Add((Statement)node.Clone());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmethod.Body.AddChildUnsafe (node.Clone (), node.Role);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!usesNonStaticMember)\n\t\t\t\t\tmethod.Modifiers |= Modifiers.Static;\n\t\t\t\t\n\t\t\t\tvar target = new IdentifierExpression(methodName);\n\t\t\t\tvar invocation = new InvocationExpression(target);\n\t\t\t\t\n\t\t\t\tvar usedVariables = VariableLookupVisitor.Analyze(context, statements);\n\t\t\t\t\n\t\t\t\tvar inExtractedRegion = new VariableUsageAnalyzation (context, usedVariables);\n\t\t\t\tvar lastStatement = statements [statements.Count - 1];\n\t\t\t\t\n\t\t\t\tvar stmt = statements [0].GetParent<BlockStatement>();\n\t\t\t\twhile (stmt.GetParent<BlockStatement> () != null) {\n\t\t\t\t\tstmt = stmt.GetParent<BlockStatement>();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tinExtractedRegion.SetAnalyzedRange(statements [0], lastStatement);\n\t\t\t\tstmt.AcceptVisitor (inExtractedRegion);\n\t\t\t\t\n\t\t\t\tvar beforeExtractedRegion = new VariableUsageAnalyzation (context, usedVariables);\n\t\t\t\tbeforeExtractedRegion.SetAnalyzedRange(statements [0].Parent, statements [0], true, false);\n\t\t\t\tstmt.AcceptVisitor (beforeExtractedRegion);\n\t\t\t\t\n\t\t\t\tvar afterExtractedRegion = new VariableUsageAnalyzation (context, usedVariables);\n\t\t\t\tafterExtractedRegion.SetAnalyzedRange(lastStatement, stmt.Statements.Last(), false, true);\n\t\t\t\tstmt.AcceptVisitor (afterExtractedRegion);\n\t\t\t\tusedVariables.Sort ((l, r) => l.Region.Begin.CompareTo (r.Region.Begin));\n\n\t\t\t\tIVariable generatedReturnVariable = null;\n\t\t\t\tforeach (var variable in usedVariables) {\n\t\t\t\t\tif ((variable is IParameter) || beforeExtractedRegion.Has (variable) || !afterExtractedRegion.Has (variable))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tgeneratedReturnVariable = variable;\n\t\t\t\t\tmethod.ReturnType = context.CreateShortType (variable.Type);\n\t\t\t\t\tmethod.Body.Add (new ReturnStatement (new IdentifierExpression (variable.Name)));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tint parameterOutCount = 0;\n\t\t\t\tforeach (var variable in usedVariables) {\n\t\t\t\t\tif (!(variable is IParameter) && !beforeExtractedRegion.Has (variable) && !afterExtractedRegion.Has (variable))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (variable == generatedReturnVariable)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tExpression argumentExpression = new IdentifierExpression(variable.Name); \n\t\t\t\t\t\n\t\t\t\t\tParameterModifier mod = ParameterModifier.None;\n\t\t\t\t\tif (inExtractedRegion.GetStatus (variable) == VariableState.Changed) {\n\t\t\t\t\t\tif (beforeExtractedRegion.GetStatus (variable) == VariableState.None) {\n\t\t\t\t\t\t\tmod = ParameterModifier.Out;\n\t\t\t\t\t\t\targumentExpression = new DirectionExpression(FieldDirection.Out, argumentExpression);\n\t\t\t\t\t\t\tparameterOutCount++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmod = ParameterModifier.Ref;\n\t\t\t\t\t\t\targumentExpression = new DirectionExpression(FieldDirection.Ref, argumentExpression);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmethod.Parameters.Add(new ParameterDeclaration(context.CreateShortType(variable.Type), variable.Name, mod));\n\t\t\t\t\tinvocation.Arguments.Add(argumentExpression);\n\t\t\t\t}\n\n\t\t\t\tParameterDeclaration parameterToTransform = null;\n\t\t\t\tbool transformParameterToReturn = method.ReturnType is PrimitiveType && \n\t\t\t\t                                  ((PrimitiveType)method.ReturnType).Keyword == \"void\" &&\n\t\t\t\t                                  parameterOutCount == 1;\n\t\t\t\tif(transformParameterToReturn) {\n\t\t\t\t\tparameterToTransform = method.Parameters.First(p => p.ParameterModifier == ParameterModifier.Out);\n\t\t\t\t\tparameterToTransform.Remove();\n\t\t\t\t\tvar argumentExpression = invocation.Arguments.OfType<DirectionExpression>().First(a => a.FieldDirection == FieldDirection.Out);\n\t\t\t\t\targumentExpression.Remove();\n\t\t\t\t\tmethod.ReturnType = parameterToTransform.Type.Clone();\n\t\t\t\t\tvar argumentDecl = new VariableDeclarationStatement(parameterToTransform.Type.Clone(),parameterToTransform.Name);\n\t\t\t\t\tmethod.Body.InsertChildBefore(method.Body.First(),argumentDecl,BlockStatement.StatementRole);\n\t\t\t\t\tmethod.Body.Add(new ReturnStatement (new IdentifierExpression (parameterToTransform.Name)));\n\t\t\t\t}\n\n\t\t\t\tscript\n\t\t\t\t\t.InsertWithCursor(context.TranslateString(\"Extract method\"), Script.InsertPosition.Before, method)\n\t\t\t\t\t.ContinueScript(delegate {\n\t\t\t\t\t\tforeach (var node in statements.Skip (1)) {\n\t\t\t\t\t\t\tif (node is NewLineNode)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tscript.Remove(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach (var variable in usedVariables) {\n\t\t\t\t\t\t\tif ((variable is IParameter) || beforeExtractedRegion.Has (variable) || !afterExtractedRegion.Has (variable))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tif (variable == generatedReturnVariable)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tscript.InsertBefore (statements [0], new VariableDeclarationStatement (context.CreateShortType(variable.Type), variable.Name));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tStatement invocationStatement;\n\n\t\t\t\t\t\tif (generatedReturnVariable != null) {\n\t\t\t\t\t\t\tinvocationStatement = new VariableDeclarationStatement (new SimpleType (\"var\"), generatedReturnVariable.Name, invocation);\n\t\t\t\t\t\t} else if(transformParameterToReturn) {\n\t\t\t\t\t\t\tinvocationStatement = new AssignmentExpression(new IdentifierExpression(parameterToTransform.Name), invocation);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinvocationStatement = invocation;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscript.Replace(statements [0], invocationStatement);\n\n\n\t\t\t\t\t\tscript.Link(target, method.NameToken);\n\t\t\t\t\t});\n\t\t\t}, statements.First ().StartLocation, statements.Last ().EndLocation);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtractMethod/StaticVisitor.cs",
    "content": "// \n// StaticVisitor.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod\n{\n\tclass StaticVisitor : DepthFirstAstVisitor\n\t{\n\t\treadonly BaseRefactoringContext context;\n\t\tpublic bool UsesNonStaticMember = false;\n\n\t\tStaticVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tthis.context = context;\n\t\t}\n\t\t\n\t\t\n\t\tpublic static bool UsesNotStaticMember(BaseRefactoringContext context, AstNode node)\n\t\t{\n\t\t\tvar visitor = new StaticVisitor(context);\n\t\t\tnode.AcceptVisitor(visitor);\n\t\t\treturn visitor.UsesNonStaticMember;\n\t\t}\n\n\t\tprotected override void VisitChildren(AstNode node)\n\t\t{\n\t\t\tif (UsesNonStaticMember)\n\t\t\t\treturn;\n\t\t\tbase.VisitChildren(node);\n\t\t}\n\n\t\tpublic override void VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t{\n\t\t\tUsesNonStaticMember = true;\n\t\t\tbase.VisitThisReferenceExpression(thisReferenceExpression);\n\t\t}\n\n\t\tpublic override void VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression)\n\t\t{\n\t\t\tUsesNonStaticMember = true;\n\t\t\tbase.VisitBaseReferenceExpression(baseReferenceExpression);\n\t\t}\n\n\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tvar resolveResult = context.Resolve(identifierExpression);\n\t\t\tif (resolveResult is MemberResolveResult) {\n\t\t\t\tvar memberResult = (MemberResolveResult)resolveResult;\n\t\t\t\tif (!memberResult.Member.IsStatic)\n\t\t\t\t\tUsesNonStaticMember = true;\n\t\t\t} else if (resolveResult is MethodGroupResolveResult) {\n\t\t\t\tvar methodGroupResolveResult = (MethodGroupResolveResult)resolveResult;\n\t\t\t\tif (methodGroupResolveResult.Methods.Any(m => !m.IsStatic))\n\t\t\t\t\tUsesNonStaticMember = true;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtractMethod/VariableLookupVisitor.cs",
    "content": "// \n// VariableLookupVisitor.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod\n{\n\tclass VariableLookupVisitor : DepthFirstAstVisitor\n\t{\n\t\treadonly RefactoringContext context;\n\t\t\n\t\tpublic List<IVariable> UsedVariables = new List<IVariable> ();\n\t\t\n\t\tTextLocation startLocation = TextLocation.Empty;\n\t\tTextLocation endLocation = TextLocation.Empty;\n\t\t\n\t\tpublic VariableLookupVisitor (RefactoringContext context)\n\t\t{\n\t\t\tthis.context = context;\n\t\t}\n\t\t\n\t\tpublic bool Has (IVariable item1)\n\t\t{\n\t\t\treturn UsedVariables.Contains (item1);\n\t\t}\n\t\t\n\t\tpublic void SetAnalyzedRange(AstNode start, AstNode end, bool startInclusive = true, bool endInclusive = true)\n\t\t{\n\t\t\tif (start == null)\n\t\t\t\tthrow new ArgumentNullException(\"start\");\n\t\t\tif (end == null)\n\t\t\t\tthrow new ArgumentNullException(\"end\");\n\t\t\tstartLocation = startInclusive ? start.StartLocation : start.EndLocation;\n\t\t\tendLocation = endInclusive ? end.EndLocation : end.StartLocation;\n\t\t}\n\t\t\n\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tif (startLocation.IsEmpty || startLocation <= identifierExpression.StartLocation && identifierExpression.EndLocation <= endLocation) {\n\t\t\t\tvar result = context.Resolve(identifierExpression);\n\t\t\t\tvar local = result as LocalResolveResult;\n\t\t\t\tif (local != null && !UsedVariables.Contains(local.Variable)&& !anonymousParameters.Contains(local.Variable)) {\n\t\t\t\t\tUsedVariables.Add(local.Variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tHashSet<IVariable> anonymousParameters = new HashSet<IVariable> ();\n\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t{\n\t\t\tforeach (var param in lambdaExpression.Parameters) {\n\t\t\t\tvar result = context.Resolve(param);\n\t\t\t\tvar local = result as LocalResolveResult;\n\t\t\t\tanonymousParameters.Add(local.Variable); \n\t\t\t}\n\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\tforeach (var param in lambdaExpression.Parameters) {\n\t\t\t\tvar result = context.Resolve(param);\n\t\t\t\tvar local = result as LocalResolveResult;\n\t\t\t\tanonymousParameters.Remove(local.Variable); \n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t{\n\t\t\tforeach (var param in anonymousMethodExpression.Parameters) {\n\t\t\t\tvar result = context.Resolve(param);\n\t\t\t\tvar local = result as LocalResolveResult;\n\t\t\t\tanonymousParameters.Add(local.Variable); \n\t\t\t}\n\n\n\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\tforeach (var param in anonymousMethodExpression.Parameters) {\n\t\t\t\tvar result = context.Resolve(param);\n\t\t\t\tvar local = result as LocalResolveResult;\n\t\t\t\tanonymousParameters.Remove(local.Variable); \n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t{\n\t\t\tbase.VisitVariableDeclarationStatement(variableDeclarationStatement);\n\t\t\tforeach (var varDecl in variableDeclarationStatement.Variables) {\n\t\t\t\tif (startLocation.IsEmpty || startLocation <= varDecl.StartLocation && varDecl.EndLocation <= endLocation) {\n\t\t\t\t\tvar result = context.Resolve(varDecl);\n\t\t\t\t\tvar local = result as LocalResolveResult;\n\t\t\t\t\tif (local != null && !UsedVariables.Contains(local.Variable) && !anonymousParameters.Contains(local.Variable))\n\t\t\t\t\t\tUsedVariables.Add(local.Variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tpublic static List<IVariable> Analyze(RefactoringContext context, Expression expression)\n\t\t{\n\t\t\tvar visitor = new VariableLookupVisitor(context);\n\t\t\texpression.AcceptVisitor(visitor);\n\t\t\treturn visitor.UsedVariables;\n\t\t}\n\t\t\n\t\tpublic static List<IVariable> Analyze(RefactoringContext context, List<AstNode> statements)\n\t\t{\n\t\t\tvar visitor = new VariableLookupVisitor(context);\n\t\t\tstatements.ForEach(stmt => stmt.AcceptVisitor(visitor));\n\t\t\treturn visitor.UsedVariables;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtractMethod/VariableUsageAnalyzation.cs",
    "content": "//\n// VariableUsageAnalyzation.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod\n{\n\t\n\tpublic enum VariableState {\n\t\tNone,\n\t\tUsed,\n\t\tChanged\n\t}\n\t\n\t\n\tpublic class VariableUsageAnalyzation : DepthFirstAstVisitor\n\t{\n\t\treadonly RefactoringContext context;\n\t\treadonly List<IVariable> usedVariables;\n\t\t\n\t\tDictionary<IVariable, VariableState> states = new Dictionary<IVariable, VariableState> ();\n\t\t\n\t\tTextLocation startLocation = TextLocation.Empty;\n\t\tTextLocation endLocation = TextLocation.Empty;\n\t\t\n\t\tpublic VariableUsageAnalyzation (RefactoringContext context, List<IVariable> usedVariables)\n\t\t{\n\t\t\tthis.context = context;\n\t\t\tthis.usedVariables = usedVariables;\n\t\t}\n\n\t\tpublic bool Has(IVariable variable)\n\t\t{\n\t\t\treturn states.ContainsKey (variable);\n\t\t}\n\t\t\n\t\tpublic void SetAnalyzedRange(AstNode start, AstNode end, bool startInclusive = true, bool endInclusive = true)\n\t\t{\n\t\t\tif (start == null)\n\t\t\t\tthrow new ArgumentNullException(\"start\");\n\t\t\tif (end == null)\n\t\t\t\tthrow new ArgumentNullException(\"end\");\n\t\t\tstartLocation = startInclusive ? start.StartLocation : start.EndLocation;\n\t\t\tendLocation = endInclusive ? end.EndLocation : end.StartLocation;\n\t\t\tstates.Clear ();\n\t\t}\n\t\t\n\t\tpublic VariableState GetStatus (IVariable variable)\n\t\t{\n\t\t\tVariableState state;\n\t\t\tif (!states.TryGetValue (variable, out state))\n\t\t\t\treturn VariableState.None;\n\t\t\treturn state;\n\t\t}\n\t\t\n\t\tvoid SetState (string identifier, VariableState state)\n\t\t{\n\t\t\tvar variable = usedVariables.FirstOrDefault (v => v.Name == identifier);\n\t\t\tif (variable == null)\n\t\t\t\treturn;\n\t\t\tVariableState oldState;\n\t\t\tif (states.TryGetValue (variable, out oldState)) {\n\t\t\t\tif (oldState < state)\n\t\t\t\t\tstates [variable] = state;\n\t\t\t} else {\n\t\t\t\tstates [variable] = state;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tif (startLocation.IsEmpty || startLocation <= identifierExpression.StartLocation && identifierExpression.EndLocation <= endLocation) {\n\t\t\t\tvar result = context.Resolve(identifierExpression) as LocalResolveResult;\n\t\t\t\tif (result != null && usedVariables.Contains (result.Variable))\n\t\t\t\t\tSetState (identifierExpression.Identifier, VariableState.Used);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\tif (startLocation.IsEmpty || startLocation <= assignmentExpression.StartLocation && assignmentExpression.EndLocation <= endLocation) {\n\t\t\t\tvar left = assignmentExpression.Left as IdentifierExpression;\n\t\t\t\tif (left != null) {\n\t\t\t\t\tvar result = context.Resolve(left) as LocalResolveResult;\n\t\t\t\t\tif (result != null && usedVariables.Contains (result.Variable))\n\t\t\t\t\t\tSetState(left.Identifier, VariableState.Changed);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.VisitAssignmentExpression (assignmentExpression);\n\t\t}\n\t\t\n\t\tpublic override void VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t{\n\t\t\tif (startLocation.IsEmpty || startLocation <= directionExpression.StartLocation && directionExpression.EndLocation <= endLocation) {\n\t\t\t\tvar expr = directionExpression.Expression as IdentifierExpression;\n\t\t\t\tif (expr != null) {\n\t\t\t\t\tvar result = context.Resolve(expr) as LocalResolveResult;\n\t\t\t\t\tif (result != null && usedVariables.Contains (result.Variable))\n\t\t\t\t\t\tSetState(expr.Identifier, VariableState.Changed);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.VisitDirectionExpression (directionExpression);\n\t\t}\n\n\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t{\n\t\t\tif (startLocation.IsEmpty || startLocation <= variableInitializer.StartLocation && variableInitializer.EndLocation <= endLocation) {\n\t\t\t\tvar result = context.Resolve(variableInitializer) as LocalResolveResult;\n\t\t\t\tif (result != null && usedVariables.Contains (result.Variable)) {\n\t\t\t\t\tSetState(variableInitializer.Name, variableInitializer.Initializer.IsNull ?  VariableState.None : VariableState.Changed);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbase.VisitVariableInitializer(variableInitializer);\n\t\t}\n\n\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t{\n\t\t\tif (startLocation.IsEmpty || startLocation <= unaryOperatorExpression.StartLocation && unaryOperatorExpression.EndLocation <= endLocation) {\n\t\t\t\tif (unaryOperatorExpression.Operator == UnaryOperatorType.Increment || unaryOperatorExpression.Operator == UnaryOperatorType.Decrement ||\n\t\t\t\t\tunaryOperatorExpression.Operator == UnaryOperatorType.PostIncrement || unaryOperatorExpression.Operator == UnaryOperatorType.PostDecrement) {\n\t\t\t\t\tvar expr = unaryOperatorExpression.Expression as IdentifierExpression;\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tvar result = context.Resolve(expr) as LocalResolveResult;\n\t\t\t\t\t\tif (result != null && usedVariables.Contains (result.Variable))\n\t\t\t\t\t\t\tSetState(expr.Identifier, VariableState.Changed);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.VisitUnaryOperatorExpression (unaryOperatorExpression);\n\t\t}\n\t\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ExtractWhileConditionToInternalIfStatementAction.cs",
    "content": "//\n// ExtractWhileConditionToInternalIfStatementAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Extract field\", Description = \"Extracts a field from a local variable declaration.\")]\n\tpublic class ExtractWhileConditionToInternalIfStatementAction : SpecializedCodeAction<WhileStatement>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, WhileStatement node)\n\t\t{\n\t\t\tif (!node.WhileToken.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Extract condition to internal 'if' statement\"),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace(node.Condition, new PrimitiveExpression(true));\n\t\t\t\t\tvar ifStmt = new IfElseStatement(\n\t\t\t\t\t\tCSharpUtil.InvertCondition(node.Condition),\n\t\t\t\t\t\tnew BreakStatement()\n\t\t\t\t\t);\n\n\t\t\t\t\tvar block = node.EmbeddedStatement as BlockStatement;\n\t\t\t\t\tif (block != null) {\n\t\t\t\t\t\tscript.InsertAfter(block.LBraceToken, ifStmt);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar blockStatement = new BlockStatement {\n\t\t\t\t\t\t\tifStmt\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (!(node.EmbeddedStatement is EmptyStatement))\n\t\t\t\t\t\t\tblockStatement.Statements.Add(node.EmbeddedStatement.Clone());\n\t\t\t\t\t\tscript.Replace(node.EmbeddedStatement, blockStatement);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/FlipEqualsTargetAndArgumentAction.cs",
    "content": "//\n// FlipEqualsQualifierAndArgumentAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Swap 'Equals' target and argument\", Description = \"Swap 'Equals' target and argument\")]\n\tpublic class FlipEqualsTargetAndArgumentAction : CodeActionProvider\n\t{\n\t\tExpression GetInnerMostExpression(Expression target)\n\t\t{\n\t\t\twhile (target is ParenthesizedExpression)\n\t\t\t\ttarget = ((ParenthesizedExpression)target).Expression;\n\t\t\treturn target;\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar invocation = context.GetNode<InvocationExpression>();\n\t\t\tif (invocation == null)\n\t\t\t\tyield break;\n\t\t\tif (invocation.Arguments.Count != 1 || invocation.Arguments.First() is NullReferenceExpression)\n\t\t\t\tyield break;\n\t\t\tvar target = invocation.Target as MemberReferenceExpression;\n\n\t\t\tif (target == null || target.MemberNameToken.StartLocation > context.Location || invocation.LParToken.StartLocation < context.Location)\n\t\t\t\tyield break;\n\n\t\t\tvar rr = context.Resolve(invocation) as InvocationResolveResult;\n\t\t\tif (rr == null || rr.Member.Name != \"Equals\" || rr.Member.IsStatic || !rr.Member.ReturnType.IsKnownType(KnownTypeCode.Boolean))\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Flip 'Equals' target and argument\"),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\tinvocation,\n\t\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\t\tnew MemberReferenceExpression(\n\t\t\t\t\t\t\t\tAddParensIfRequired(invocation.Arguments.First ().Clone()),\n\t\t\t\t\t\t\t\t\"Equals\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tGetInnerMostExpression (target.Target).Clone()\n\t\t\t\t\t\t)\n\t\t\t\t    );\n\t\t\t\t},\n\t\t\t\tinvocation\n\t\t\t);\n\t\t}\n\n\t\tExpression AddParensIfRequired(Expression expression)\n\t\t{\n\t\t\tif ((expression is BinaryOperatorExpression) ||\n\t\t\t    (expression is UnaryOperatorExpression) ||\n\t\t\t    (expression is CastExpression) ||\n\t\t\t    (expression is AssignmentExpression) ||\n\t\t\t\t(expression is AsExpression) ||\n\t\t\t    (expression is IsExpression) ||\n\t\t\t    (expression is LambdaExpression) ||\n\t\t\t    (expression is ConditionalExpression)) {\n\t\t\t\treturn new ParenthesizedExpression(expression);\n\t\t\t}\n\n\t\t\treturn expression;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/FlipOperatorArgumentsAction.cs",
    "content": "﻿// \n// FlipOperatorArguments.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Swaps left and right arguments.\", Description = \"Swaps left and right arguments.\")]\n\tpublic class FlipOperatorArgumentsAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar binop = GetBinaryOperatorExpression(context);\n\t\t\tif (binop == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\n\n\t\t\tyield return new CodeAction(string.Format(context.TranslateString(\"Flip '{0}' operator arguments\"), binop.OperatorToken.ToString()), script => {\n\t\t\t\tscript.Replace(binop.Left, binop.Right.Clone());\n\t\t\t\tscript.Replace(binop.Right, binop.Left.Clone());\n\t\t\t}, binop.OperatorToken);\n\t\t}\n\t\t\n\t\tpublic static BinaryOperatorExpression GetBinaryOperatorExpression (RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<BinaryOperatorExpression> ();\n\t\t\t\n\t\t\tif (node == null || !node.OperatorToken.Contains (context.Location))\n\t\t\t\treturn null;\n\t\t\tvar result = node as BinaryOperatorExpression;\n\t\t\tif (result == null || (result.Operator != BinaryOperatorType.Equality && result.Operator != BinaryOperatorType.InEquality))\n\t\t\t\treturn null;\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/GenerateGetterAction.cs",
    "content": "﻿// \n// GenerateGetter.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Generate getter\", Description = \"Generates a getter for a field.\")]\n\tpublic class GenerateGetterAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar initializer = GetVariableInitializer(context);\n\t\t\tif (initializer == null || !initializer.NameToken.Contains(context.Location)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar type = initializer.Parent.Parent as TypeDeclaration;\n\t\t\tif (type == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tforeach (var member in type.Members) {\n\t\t\t\tif (member is PropertyDeclaration && ContainsGetter((PropertyDeclaration)member, initializer)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar field = initializer.Parent as FieldDeclaration;\n\t\t\tif (field == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\t\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create getter\"), script => {\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Create getter\"),\n\t\t\t\t\tScript.InsertPosition.After,\n\t\t\t\t\tGeneratePropertyDeclaration(context, field, initializer));\n\t\t\t}, initializer);\n\t\t}\n\t\t\n\t\tstatic PropertyDeclaration GeneratePropertyDeclaration (RefactoringContext context, FieldDeclaration field, VariableInitializer initializer)\n\t\t{\n\t\t\tvar mod = ICSharpCode.NRefactory.CSharp.Modifiers.Public;\n\t\t\tif (field.HasModifier (ICSharpCode.NRefactory.CSharp.Modifiers.Static))\n\t\t\t\tmod |= ICSharpCode.NRefactory.CSharp.Modifiers.Static;\n\t\t\t\n\t\t\treturn new PropertyDeclaration () {\n\t\t\t\tModifiers = mod,\n\t\t\t\tName = context.GetNameProposal (initializer.Name, false),\n\t\t\t\tReturnType = field.ReturnType.Clone (),\n\t\t\t\tGetter = new Accessor () {\n\t\t\t\t\tBody = new BlockStatement () {\n\t\t\t\t\t\tnew ReturnStatement (new IdentifierExpression (initializer.Name))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t\n\t\tbool ContainsGetter (PropertyDeclaration property, VariableInitializer initializer)\n\t\t{\n\t\t\tif (property.Getter.IsNull || property.Getter.Body.Statements.Count () != 1)\n\t\t\t\treturn false;\n\t\t\tvar ret = property.Getter.Body.Statements.Single () as ReturnStatement;\n\t\t\tif (ret == null)\n\t\t\t\treturn false;\n\t\t\treturn ret.Expression.IsMatch (new IdentifierExpression (initializer.Name)) || \n\t\t\t\tret.Expression.IsMatch (new MemberReferenceExpression (new ThisReferenceExpression (), initializer.Name));\n\t\t}\n\t\t\n\t\tVariableInitializer GetVariableInitializer (RefactoringContext context)\n\t\t{\n\t\t\treturn context.GetNode<VariableInitializer> ();\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/GeneratePropertyAction.cs",
    "content": "﻿// \n// GenerateProperty.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Generate property\", Description = \"Generates a getter and setter for a field.\")]\n\tpublic class GeneratePropertyAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar initializer = context.GetNode<VariableInitializer>();\n\t\t\tif (initializer == null || !initializer.NameToken.Contains(context.Location.Line, context.Location.Column)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar type = initializer.Parent.Parent as TypeDeclaration;\n\t\t\tif (type == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tforeach (var member in type.Members) {\n\t\t\t\tif (member is PropertyDeclaration && ContainsGetter((PropertyDeclaration)member, initializer)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar field = initializer.Parent as FieldDeclaration;\n\t\t\tif (field == null || field.HasModifier(Modifiers.Readonly) || field.HasModifier(Modifiers.Const)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar resolveResult = context.Resolve(initializer) as MemberResolveResult;\n\t\t\tif (resolveResult == null)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create property\"), script => {\n\t\t\t\tvar fieldName = context.GetNameProposal(initializer.Name, true);\n\t\t\t\tif (initializer.Name == context.GetNameProposal(initializer.Name, false)) {\n\t\t\t\t\tscript.Rename(resolveResult.Member, fieldName);\n\t\t\t\t}\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Create property\"),\n\t\t\t\t\tScript.InsertPosition.After, GeneratePropertyDeclaration(context, field, fieldName));\n\t\t\t}, initializer);\n\t\t}\n\t\t\n\t\tstatic PropertyDeclaration GeneratePropertyDeclaration (RefactoringContext context, FieldDeclaration field, string fieldName)\n\t\t{\n\t\t\tvar mod = ICSharpCode.NRefactory.CSharp.Modifiers.Public;\n\t\t\tif (field.HasModifier (ICSharpCode.NRefactory.CSharp.Modifiers.Static))\n\t\t\t\tmod |= ICSharpCode.NRefactory.CSharp.Modifiers.Static;\n\t\t\t\n\t\t\treturn new PropertyDeclaration () {\n\t\t\t\tModifiers = mod,\n\t\t\t\tName = context.GetNameProposal (fieldName, false),\n\t\t\t\tReturnType = field.ReturnType.Clone (),\n\t\t\t\tGetter = new Accessor {\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew ReturnStatement (new IdentifierExpression (fieldName))\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tSetter = new Accessor {\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew AssignmentExpression (new IdentifierExpression (fieldName), new IdentifierExpression (\"value\"))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t\n\t\tbool ContainsGetter (PropertyDeclaration property, VariableInitializer initializer)\n\t\t{\n\t\t\tif (property.Getter.IsNull || property.Getter.Body.Statements.Count () != 1)\n\t\t\t\treturn false;\n\t\t\tvar ret = property.Getter.Body.Statements.Single () as ReturnStatement;\n\t\t\tif (ret == null)\n\t\t\t\treturn false;\n\t\t\treturn ret.Expression.IsMatch (new IdentifierExpression (initializer.Name)) || \n\t\t\t\tret.Expression.IsMatch (new MemberReferenceExpression (new ThisReferenceExpression (), initializer.Name));\n\t\t}\n\t\t\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/GenerateSwitchLabelsAction.cs",
    "content": "﻿// \n// GenerateSwitchLabels.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Generate switch labels\", Description = \"Creates switch lables for enumerations.\")]\n\tpublic class GenerateSwitchLabelsAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar switchStatement = context.GetNode<SwitchStatement> ();\n\n\t\t\tif (switchStatement == null || !switchStatement.SwitchToken.Contains(context.Location))\n\t\t\t\tyield break;\n\t\t\tvar result = context.Resolve(switchStatement.Expression);\n\t\t\tif (result.Type.Kind != TypeKind.Enum)\n\t\t\t\tyield break;\n\n\t\t\tif (switchStatement.SwitchSections.Count == 0) {\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Create switch labels\"), script => {\n\t\t\t\t\tvar type = result.Type;\n\t\t\t\t\tvar newSwitch = (SwitchStatement)switchStatement.Clone();\n\t\t\t\t\t\n\t\t\t\t\tvar target = context.CreateShortType(result.Type);\n\t\t\t\t\tforeach (var field in type.GetFields ()) {\n\t\t\t\t\t\tif (field.IsSynthetic || !field.IsConst)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tnewSwitch.SwitchSections.Add(new SwitchSection() {\n\t\t\t\t\t\t\tCaseLabels = {\n\t\t\t\t\t\t\t\tnew CaseLabel(target.Clone().Member(field.Name))\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\t\tnew BreakStatement()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tnewSwitch.SwitchSections.Add(new SwitchSection() {\n\t\t\t\t\t\tCaseLabels = {\n\t\t\t\t\t\t\tnew CaseLabel()\n\t\t\t\t\t\t},\n\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\tnew ThrowStatement(new ObjectCreateExpression(context.CreateShortType(\"System\", \"ArgumentOutOfRangeException\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tscript.Replace(switchStatement, newSwitch);\n\t\t\t\t}, switchStatement);\n\t\t\t} else {\n\t\t\t\tvar missingFields = new List<IField>();\n\t\t\t\tforeach (var field in result.Type.GetFields ()) {\n\t\t\t\t\tif (field.IsSynthetic || !field.IsConst)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (!IsHandled(context, switchStatement, field)) {\n\t\t\t\t\t\tmissingFields.Add(field); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (missingFields.Count == 0)\n\t\t\t\t\tyield break;\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Create missing switch labels\"), script => {\n\t\t\t\t\tvar type = result.Type;\n\t\t\t\t\t//var newSwitch = (SwitchStatement)switchStatement.Clone();\n\t\t\t\t\tvar insertNode = (AstNode)switchStatement.SwitchSections.LastOrDefault(s => !s.CaseLabels.Any(label => label.Expression.IsNull)) ?? switchStatement.LBraceToken;\n\n\t\t\t\t\tvar target = context.CreateShortType(result.Type);\n\t\t\t\t\tforeach (var field in missingFields) {\n\t\t\t\t\t\tscript.InsertAfter(insertNode, new SwitchSection() {\n\t\t\t\t\t\t\tCaseLabels =  {\n\t\t\t\t\t\t\t\tnew CaseLabel(target.Clone().Member(field.Name))\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tStatements =  {\n\t\t\t\t\t\t\t\tnew BreakStatement()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}, switchStatement);\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsHandled(RefactoringContext context, SwitchStatement switchStatement, IField field)\n\t\t{\n\t\t\tforeach (var sect in switchStatement.SwitchSections) {\n\t\t\t\tforeach (var caseLabel in sect.CaseLabels) {\n\t\t\t\t\tvar resolveCase = context.Resolve(caseLabel.Expression) as MemberResolveResult;\n\t\t\t\t\tif (resolveCase == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (field == resolveCase.Member)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ImplementAbstractMembersAction.cs",
    "content": "// \n// ImplementAbstractMembersAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Implement abstract members\", Description = \"Implements abstract members from an abstract class.\")]\n\tpublic class ImplementAbstractMembersAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar service = (CodeGenerationService)context.GetService(typeof(CodeGenerationService)); \n\t\t\tif (service == null)\n\t\t\t\tyield break;\n\n\t\t\tvar type = context.GetNode<AstType>();\n\t\t\tif (type == null || type.Role != Roles.BaseType)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore(type);\n\t\t\tif (state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\n\t\t\tvar resolveResult = context.Resolve(type);\n\t\t\tif (resolveResult.Type.Kind != TypeKind.Class || resolveResult.Type.GetDefinition() == null || !resolveResult.Type.GetDefinition().IsAbstract)\n\t\t\t\tyield break;\n\n\t\t\tvar toImplement = CollectMembersToImplement(state.CurrentTypeDefinition, resolveResult.Type);\n\t\t\tif (toImplement.Count == 0)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Implement abstract members\"), \n\t\t\t\tscript => script.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Implement abstract members\"), \n\t\t\t\t\tstate.CurrentTypeDefinition, (s, c) => ImplementInterfaceAction.GenerateImplementation(c, toImplement.Select(m => Tuple.Create(m, false)), true)\n\t\t\t\t.Select(entity => {\n\t\t\t\t\tvar decl = entity as EntityDeclaration;\n\t\t\t\t\tif (decl != null)\n\t\t\t\t\t\tdecl.Modifiers |= Modifiers.Override;\n\t\t\t\t\treturn entity;\n\t\t\t\t}).ToList()), type);\n\t\t}\n\n\t\tpublic static List<IMember> CollectMembersToImplement(ITypeDefinition implementingType, IType abstractType)\n\t\t{\n\t\t\tvar toImplement = new List<IMember>();\n\t\t\tbool alreadyImplemented;\n\t\t\tforeach (var member in abstractType.GetMembers (d => !d.IsSynthetic  && d.IsAbstract)) {\n\t\t\t\talreadyImplemented = false;\n\t\t\t\tvar allBaseTypes = member.DeclaringType.GetAllBaseTypes().ToList ();\n\t\t\t\tforeach (var cmet in implementingType.GetMembers (d => d.SymbolKind == member.SymbolKind && d.Name == member.Name)) {\n\t\t\t\t\tif (allBaseTypes.Contains(cmet.DeclaringType))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (ImplementInterfaceAction.CompareMembers(member, cmet)) {\n\t\t\t\t\t\talreadyImplemented = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!alreadyImplemented) \n\t\t\t\t\ttoImplement.Add(member);\n\t\t\t}\n\t\t\treturn toImplement;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ImplementInterfaceAction.cs",
    "content": "﻿// \n// ImplementInterfaceAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Implement interface\", Description = \"Creates an interface implementation.\")]\n\tpublic class ImplementInterfaceAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar service = (CodeGenerationService)context.GetService(typeof(CodeGenerationService)); \n\t\t\tif (service == null)\n\t\t\t\tyield break;\n\n\t\t\tvar type = context.GetNode<AstType>();\n\t\t\tif (type == null || type.Role != Roles.BaseType)\n\t\t\t\tyield break;\n\t\t\t\n\t\t\tvar state = context.GetResolverStateBefore(type);\n\t\t\tif (state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\n\t\t\tvar resolveResult = context.Resolve(type);\n\t\t\tif (resolveResult.Type.Kind != TypeKind.Interface)\n\t\t\t\tyield break;\n\t\t\t\n\t\t\tbool interfaceMissing;\n\t\t\tvar toImplement = CollectMembersToImplement(state.CurrentTypeDefinition, resolveResult.Type, false, out interfaceMissing);\n\t\t\tif (toImplement.Count == 0)\n\t\t\t\tyield break;\n\t\t\t\n\t\t\tyield return new CodeAction(context.TranslateString(\"Implement interface\"), script =>\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Implement Interface\"),\n\t\t\t\t\tstate.CurrentTypeDefinition,\n\t\t\t\t\t(s, c) => GenerateImplementation(c, toImplement, interfaceMissing).ToList()\n\t\t\t\t)\n\t\t\t, type);\n\t\t}\n\n\t\tstatic void RemoveConstraints(EntityDeclaration decl)\n\t\t{\n\t\t\tforeach (var child in decl.GetChildrenByRole(Roles.Constraint).ToArray()) {\n\t\t\t\tchild.Remove();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static IEnumerable<AstNode> GenerateImplementation(RefactoringContext context, IEnumerable<Tuple<IMember, bool>> toImplement, bool generateRegion)\n\t\t{\n\t\t\tvar service = (CodeGenerationService)context.GetService(typeof(CodeGenerationService)); \n\t\t\tif (service == null)\n\t\t\t\tyield break;\n\t\t\tvar nodes = new Dictionary<IType, List<EntityDeclaration>>();\n\t\t\t\n\t\t\tforeach (var member in toImplement) {\n\t\t\t\tif (!nodes.ContainsKey(member.Item1.DeclaringType)) \n\t\t\t\t\tnodes [member.Item1.DeclaringType] = new List<EntityDeclaration>();\n\t\t\t\tvar decl = service.GenerateMemberImplementation(context, member.Item1, member.Item2);\n\t\t\t\tif (member.Item2 || member.Item1.DeclaringType.Kind != TypeKind.Interface)\n\t\t\t\t\tRemoveConstraints(decl);\n\n\t\t\t\tnodes[member.Item1.DeclaringType].Add(decl);\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var kv in nodes) {\n\t\t\t\tif (generateRegion) {\n\t\t\t\t\tif (kv.Key.Kind == TypeKind.Interface) {\n\t\t\t\t\t\tyield return new PreProcessorDirective(\n\t\t\t\t\t\t\tPreProcessorDirectiveType.Region,\n\t\t\t\t\t\t\tstring.Format(\"{0} implementation\", kv.Key.Name));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tyield return new PreProcessorDirective(\n\t\t\t\t\t\t\tPreProcessorDirectiveType.Region,\n\t\t\t\t\t\t\tstring.Format(\"implemented abstract members of {0}\", kv.Key.Name));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (var member in kv.Value)\n\t\t\t\t\tyield return member;\n\t\t\t\tif (generateRegion) {\n\t\t\t\t\tyield return new PreProcessorDirective(\n\t\t\t\t\t\tPreProcessorDirectiveType.Endregion\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsImplementation(IMember m, IMember method)\n\t\t{\n\t\t\treturn m.UnresolvedMember == method.UnresolvedMember;\n\t\t}\n\n\t\tpublic static List<Tuple<IMember, bool>> CollectMembersToImplement(ITypeDefinition implementingType, IType interfaceType, bool explicitly, out bool interfaceMissing)\n\t\t{\n\t\t\t//var def = interfaceType.GetDefinition();\n\t\t\tList<Tuple<IMember, bool>> toImplement = new List<Tuple<IMember, bool>>();\n\t\t\tbool alreadyImplemented;\n\t\t\tinterfaceMissing = true;\n\t\t\t// Stub out non-implemented events defined by @iface\n\t\t\tforeach (var evGroup in interfaceType.GetEvents (e => !e.IsSynthetic).GroupBy (m => m.DeclaringType).Reverse ())\n\t\t\t\tforeach (var ev in evGroup) {\n\t\t\t\t\tif (ev.DeclaringType.Kind != TypeKind.Interface)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tbool needsExplicitly = explicitly;\n\t\t\t\t\talreadyImplemented = implementingType.GetMembers().Any(m => m.ImplementedInterfaceMembers.Any(im => IsImplementation (im, ev)));\n\t\t\t\t\n\t\t\t\t\tif (!alreadyImplemented) {\n\t\t\t\t\t\ttoImplement.Add(new Tuple<IMember, bool>(ev, needsExplicitly));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinterfaceMissing = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t// Stub out non-implemented methods defined by @iface\n\t\t\tforeach (var methodGroup in interfaceType.GetMethods (d => !d.IsSynthetic).GroupBy (m => m.DeclaringType).Reverse ())\n\t\t\t\tforeach (var method in methodGroup) {\n\t\t\t\t\tif (method.DeclaringType.Kind != TypeKind.Interface)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tbool needsExplicitly = explicitly;\n\t\t\t\t\talreadyImplemented = false;\n\n\t\t\t\t\tforeach (var cmet in implementingType.GetMethods ()) {\n\t\t\t\t\t\talreadyImplemented |= cmet.ImplementedInterfaceMembers.Any(m => IsImplementation (m, method));\n\n\t\t\t\t\t\tif (CompareMembers(method, cmet)) {\n\t\t\t\t\t\t\tif (!needsExplicitly && !cmet.ReturnType.Equals(method.ReturnType))\n\t\t\t\t\t\t\t\tneedsExplicitly = true;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\talreadyImplemented |= !needsExplicitly /*|| cmet.InterfaceImplementations.Any (impl => impl.InterfaceType.Equals (interfaceType))*/;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (toImplement.Where(t => t.Item1 is IMethod).Any(t => CompareMembers(method, (IMethod)t.Item1)))\n\t\t\t\t\t\tneedsExplicitly = true;\n\t\t\t\t\tif (!alreadyImplemented) {\n\t\t\t\t\t\ttoImplement.Add(new Tuple<IMember, bool>(method, needsExplicitly));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinterfaceMissing = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t// Stub out non-implemented properties defined by @iface\n\t\t\tforeach (var propGroup in interfaceType.GetProperties (p => !p.IsSynthetic).GroupBy (m => m.DeclaringType).Reverse ())\n\t\t\t\tforeach (var prop in propGroup) {\n\t\t\t\t\tif (prop.DeclaringType.Kind != TypeKind.Interface)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tbool needsExplicitly = explicitly;\n\t\t\t\t\talreadyImplemented = implementingType.GetMembers().Any(m => m.ImplementedInterfaceMembers.Any(im => IsImplementation (im, prop)));\n\n\t\t\t\t\tforeach (var t in implementingType.GetAllBaseTypeDefinitions ()) {\n\t\t\t\t\t\tif (t.Kind == TypeKind.Interface) {\n\t\t\t\t\t\t\tforeach (var cprop in t.Properties) {\n\t\t\t\t\t\t\t\tif (cprop.Name == prop.Name && cprop.IsShadowing) {\n\t\t\t\t\t\t\t\t\tif (!needsExplicitly && !cprop.ReturnType.Equals(prop.ReturnType))\n\t\t\t\t\t\t\t\t\t\tneedsExplicitly = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach (var cprop in t.Properties) {\n\t\t\t\t\t\t\tif (cprop.Name == prop.Name) {\n\t\t\t\t\t\t\t\tif (!needsExplicitly && !cprop.ReturnType.Equals(prop.ReturnType))\n\t\t\t\t\t\t\t\t\tneedsExplicitly = true;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\talreadyImplemented |= !needsExplicitly/* || cprop.InterfaceImplementations.Any (impl => impl.InterfaceType.Resolve (ctx).Equals (interfaceType))*/;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!alreadyImplemented) {\n\t\t\t\t\t\ttoImplement.Add(new Tuple<IMember, bool>(prop, needsExplicitly));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinterfaceMissing = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\treturn toImplement;\n\t\t}\n\t\t\n\t\tinternal static bool CompareMembers(IMember interfaceMethod, IMember typeMethod)\n\t\t{\n\t\t\tif (typeMethod.IsExplicitInterfaceImplementation)\n\t\t\t\treturn typeMethod.ImplementedInterfaceMembers.Any(m => m.Equals(interfaceMethod));\n\t\t\treturn SignatureComparer.Ordinal.Equals(interfaceMethod, typeMethod);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ImplementInterfaceExplicitAction.cs",
    "content": "// \n// ImplementInterfaceExplicitAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Implement interface explicit\", Description = \"Creates an interface implementation.\")]\n\tpublic class ImplementInterfaceExplicitAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar service = (CodeGenerationService)context.GetService(typeof(CodeGenerationService)); \n\t\t\tif (service == null)\n\t\t\t\tyield break;\n\n\t\t\tvar type = context.GetNode<AstType>();\n\t\t\tif (type == null || type.Role != Roles.BaseType)\n\t\t\t\tyield break;\n\t\t\tvar state = context.GetResolverStateBefore(type);\n\t\t\tif (state.CurrentTypeDefinition == null)\n\t\t\t\tyield break;\n\n\t\t\tvar resolveResult = context.Resolve(type);\n\t\t\tif (resolveResult.Type.Kind != TypeKind.Interface)\n\t\t\t\tyield break;\n\n\t\t\tbool interfaceMissing;\n\t\t\tvar toImplement = ImplementInterfaceAction.CollectMembersToImplement(\n\t\t\t\tstate.CurrentTypeDefinition,\n\t\t\t\tresolveResult.Type,\n\t\t\t\tfalse,\n\t\t\t\tout interfaceMissing\n\t\t\t);\n\t\t\tif (toImplement.Count == 0)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Implement interface explicit\"), script =>\n\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\tcontext.TranslateString(\"Implement Interface\"),\n\t\t\t\t\tstate.CurrentTypeDefinition,\n\t\t\t\t\t(s, c) => ImplementInterfaceAction.GenerateImplementation (c, toImplement.Select (t => Tuple.Create (t.Item1, true)), interfaceMissing).ToList()\n\t\t\t\t)\n\t\t\t, type);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ImplementNotImplementedProperty.cs",
    "content": "//\n// ImplementNotImplementedProperty.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Create a backing field for a not implemented property\", Description = \"Creates a backing field for a not implemented property.\")]\n\tpublic class ImplementNotImplementedProperty : CodeActionProvider\n\t{\n\t\tbool IsNotImplemented(RefactoringContext context, BlockStatement body)\n\t\t{\n\t\t\tif (body.IsNull)\n\t\t\t\treturn true;\n\t\t\tif (body.Statements.Count == 1) {\n\t\t\t\tvar throwStmt = body.Statements.First () as ThrowStatement;\n\t\t\t\tif (throwStmt != null) {\n\t\t\t\t\treturn context.Resolve (throwStmt.Expression).Type.FullName == \"System.NotImplementedException\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar property = context.GetNode<PropertyDeclaration> ();\n\t\t\tif (property == null || !property.NameToken.Contains(context.Location))\n\t\t\t\tyield break;\n\n\t\t\tif (!IsNotImplemented (context, property.Getter.Body) ||\n\t\t\t    !IsNotImplemented (context, property.Setter.Body)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\t\n\t\t\tyield return new CodeAction(context.TranslateString(\"Implement property\"), script => {\n\t\t\t\tstring backingStoreName = context.GetNameProposal (property.Name);\n\t\t\t\t\n\t\t\t\t// create field\n\t\t\t\tvar backingStore = new FieldDeclaration ();\n\t\t\t\tif (property.Modifiers.HasFlag (Modifiers.Static))\n\t\t\t\t\tbackingStore.Modifiers |= Modifiers.Static;\n\n\t\t\t\tif (property.Setter.IsNull)\n\t\t\t\t\tbackingStore.Modifiers |= Modifiers.Readonly;\n\t\t\t\t\n\t\t\t\tbackingStore.ReturnType = property.ReturnType.Clone ();\n\t\t\t\t\n\t\t\t\tvar initializer = new VariableInitializer (backingStoreName);\n\t\t\t\tbackingStore.Variables.Add (initializer);\n\t\t\t\t\n\t\t\t\t// create new property & implement the get/set bodies\n\t\t\t\tvar newProperty = (PropertyDeclaration)property.Clone ();\n\t\t\t\tExpression id1;\n\t\t\t\tif (backingStoreName == \"value\")\n\t\t\t\t\tid1 = new ThisReferenceExpression().Member(\"value\");\n\t\t\t\telse\n\t\t\t\t\tid1 = new IdentifierExpression (backingStoreName);\n\t\t\t\tExpression id2 = id1.Clone();\n\t\t\t\tnewProperty.Getter.Body = new BlockStatement () {\n\t\t\t\t\tnew ReturnStatement (id1)\n\t\t\t\t};\n\t\t\t\tif (!property.Setter.IsNull) {\n\t\t\t\t\tnewProperty.Setter.Body = new BlockStatement () {\n\t\t\t\t\t\tnew AssignmentExpression (id2, AssignmentOperatorType.Assign, new IdentifierExpression (\"value\"))\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tscript.Replace (property, newProperty);\n\t\t\t\tscript.InsertBefore (property, backingStore);\n\t\t\t\tif (!property.Setter.IsNull)\n\t\t\t\t\tscript.Link (initializer, id1, id2);\n\t\t\t\telse\n\t\t\t\t\tscript.Link (initializer, id1);\n\t\t\t}, property.NameToken);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/InlineLocalVariableAction.cs",
    "content": "﻿// \n// InlineLocalVariableAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Inline local variable\", Description = \"Inlines a local variable.\")]\n\tpublic class InlineLocalVariableAction : CodeActionProvider\n\t{\n\t\tstatic FindReferences refFinder = new FindReferences();\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tif (context.IsSomethingSelected) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar node = context.GetNode<VariableDeclarationStatement>();\n\t\t\tif (node == null || node.Variables.Count != 1) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar initializer = node.Variables.First();\n\t\t\tif (!initializer.NameToken.Contains(context.Location) || initializer.Initializer.IsNull) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar resolveResult = context.Resolve(initializer) as LocalResolveResult;\n\t\t\tif (resolveResult == null || resolveResult.IsError) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar unit = context.RootNode as SyntaxTree;\n\t\t\tif (unit == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tyield return new CodeAction(context.TranslateString(\"Inline local variable\"), script => {\n\t\t\t\trefFinder.FindLocalReferences(resolveResult.Variable, context.UnresolvedFile, unit, context.Compilation, (n, r) => script.Replace(n, AddParensIfRequired (n, initializer.Initializer.Clone())), default(CancellationToken));\n\t\t\t\tscript.Remove(node);\n\t\t\t}, initializer);\n\t\t}\n\n\t\tpublic static bool RequiresParens(AstNode replaceNode, AstNode replaceWithNode)\n\t\t{\n\t\t\tif (!(replaceWithNode is BinaryOperatorExpression) &&\n\t\t\t    !(replaceWithNode is AssignmentExpression) &&\n\t\t\t    !(replaceWithNode is AsExpression) &&\n\t\t\t    !(replaceWithNode is IsExpression) &&\n\t\t\t    !(replaceWithNode is CastExpression) &&\n\t\t\t    !(replaceWithNode is LambdaExpression) &&\n\t\t\t\t!(replaceWithNode is ConditionalExpression)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar cond = replaceNode.Parent as ConditionalExpression;\n\t\t\tif (cond != null && cond.Condition == replaceNode)\n\t\t\t\treturn true;\n\n\t\t\tvar indexer = replaceNode.Parent as IndexerExpression;\n\t\t\tif (indexer != null && indexer.Target == replaceNode)\n\t\t\t\treturn true;\n\n\t\t\treturn replaceNode.Parent is BinaryOperatorExpression || \n\t\t\t\treplaceNode.Parent is UnaryOperatorExpression || \n\t\t\t\treplaceNode.Parent is AssignmentExpression || \n\t\t\t\treplaceNode.Parent is MemberReferenceExpression ||\n\t\t\t\treplaceNode.Parent is AsExpression || \n\t\t\t\treplaceNode.Parent is IsExpression || \n\t\t\t\treplaceNode.Parent is CastExpression ||\n\t\t\t\treplaceNode.Parent is LambdaExpression ||\n\t\t\t\treplaceNode.Parent is PointerReferenceExpression;\n\t\t}\n\n\t\tstatic Expression AddParensIfRequired(AstNode replaceNode, Expression expression)\n\t\t{\n\t\t\tif (RequiresParens(replaceNode, expression))\n\t\t\t\treturn new ParenthesizedExpression(expression);\n\t\t\treturn expression;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/InsertAnonymousMethodSignatureAction.cs",
    "content": "﻿// \n// InsertAnonymousMethodSignature.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Insert anonymous method signature\", Description = \"Inserts a signature to parameterless anonymous methods.\")]\n\tpublic class InsertAnonymousMethodSignatureAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tIType type;\n\t\t\tvar anonymousMethodExpression = GetAnonymousMethodExpression(context, out type);\n\t\t\tif (anonymousMethodExpression == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tyield return new CodeAction (context.TranslateString(\"Insert anonymous method signature\"), script => {\n\t\t\t\tvar delegateMethod = type.GetDelegateInvokeMethod();\n\t\t\t\t\n\t\t\t\tvar sb = new StringBuilder (\"(\");\n\t\t\t\tfor (int k = 0; k < delegateMethod.Parameters.Count; k++) {\n\t\t\t\t\tif (k > 0) {\n\t\t\t\t\t\tsb.Append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar paramType = delegateMethod.Parameters [k].Type;\n\t\t\t\t\t\n\t\t\t\t\tsb.Append(context.CreateShortType(paramType));\n\t\t\t\t\tsb.Append(\" \");\n\t\t\t\t\tsb.Append(delegateMethod.Parameters [k].Name);\n\t\t\t\t}\n\t\t\t\tsb.Append(\")\");\n\t\t\t\t\n\t\t\t\tscript.InsertText(context.GetOffset(anonymousMethodExpression.DelegateToken.EndLocation), sb.ToString());\n\t\t\t}, anonymousMethodExpression);\n\t\t}\n\t\t\n\t\tstatic AnonymousMethodExpression GetAnonymousMethodExpression (RefactoringContext context, out IType delegateType)\n\t\t{\n\t\t\tdelegateType = null;\n\t\t\t\n\t\t\tvar anonymousMethodExpression = context.GetNode<AnonymousMethodExpression> ();\n\t\t\tif (anonymousMethodExpression == null || !anonymousMethodExpression.DelegateToken.Contains (context.Location) || anonymousMethodExpression.HasParameterList)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tIType resolvedType = null;\n\t\t\tvar parent = anonymousMethodExpression.Parent;\n\t\t\t\n\t\t\tif (parent is AssignmentExpression) {\n\t\t\t\tresolvedType = context.Resolve (((AssignmentExpression)parent).Left).Type;\n\t\t\t} else if (parent is VariableInitializer) {\n\t\t\t\tresolvedType = context.Resolve (((VariableDeclarationStatement)parent.Parent).Type).Type;\n\t\t\t} else if (parent is InvocationExpression) {\n\t\t\t\t// TODO: handle invocations\n\t\t\t}\n\t\t\tif (resolvedType == null)\n\t\t\t\treturn null;\n\t\t\tdelegateType = resolvedType;\n\t\t\tif (delegateType.Kind != TypeKind.Delegate) \n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn anonymousMethodExpression;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/IntroduceConstantAction.cs",
    "content": "﻿// \n// IntroduceConstantAction.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Introduce constant\", Description = \"Creates a constant for a non constant primitive expression.\")]\n\tpublic class IntroduceConstantAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar pexpr = context.GetNode<PrimitiveExpression>();\n\t\t\tif (pexpr == null)\n\t\t\t\tyield break;\n\n\t\t\tvar visitor = new DeclareLocalVariableAction.SearchNodeVisitior(pexpr);\n\n\t\t\tif (pexpr.Parent is VariableInitializer) {\n\t\t\t\tvar varDec = pexpr.Parent.Parent as VariableDeclarationStatement;\n\t\t\t\tif (varDec != null && (varDec.Modifiers & Modifiers.Const) != 0)\n\t\t\t\t\tyield break;\n\t\t\t\tvar fieldDecl = pexpr.Parent.Parent as FieldDeclaration;\n\t\t\t\tif (fieldDecl != null && (fieldDecl.Modifiers & Modifiers.Const) != 0)\n\t\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar node = context.GetNode <BlockStatement>();\n\t\t\tif (node != null)\n\t\t\t\tnode.AcceptVisitor(visitor);\n\n\t\t\tvar resolveResult = context.Resolve(pexpr);\n\t\t\tvar statement = context.GetNode<Statement>();\n\t\t\tif (statement != null) {\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Create local constant\"), script => {\n\t\t\t\t\tstring name = CreateMethodDeclarationAction.CreateBaseName(pexpr, resolveResult.Type);\n\t\t\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n\t\t\t\t\tif (service != null)\n\t\t\t\t\t\tname = service.CheckName(context, name, AffectedEntity.LocalConstant);\n\t\t\t\t\t\n\t\t\t\t\tvar initializer = new VariableInitializer(name, pexpr.Clone());\n\t\t\t\t\tvar decl = new VariableDeclarationStatement() {\n\t\t\t\t\t\tType = context.CreateShortType(resolveResult.Type),\n\t\t\t\t\t\tModifiers = Modifiers.Const,\n\t\t\t\t\t\tVariables = { initializer }\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tscript.InsertBefore(statement, decl);\n\t\t\t\t\tvar variableUsage = new IdentifierExpression(name);\n\t\t\t\t\tscript.Replace(pexpr, variableUsage);\n\t\t\t\t\tscript.Link(initializer.NameToken, variableUsage);\n\t\t\t\t}, pexpr);\n\t\t\t}\n\t\t\t\n\t\t\tyield return new CodeAction(context.TranslateString(\"Create constant field\"), script => {\n\t\t\t\tstring name = CreateMethodDeclarationAction.CreateBaseName(pexpr, resolveResult.Type);\n\t\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n\t\t\t\tif (service != null)\n\t\t\t\t\tname = service.CheckName(context, name, AffectedEntity.ConstantField);\n\t\t\t\t\n\t\t\t\tvar initializer = new VariableInitializer(name, pexpr.Clone());\n\t\t\t\t\n\t\t\t\tvar decl = new FieldDeclaration() {\n\t\t\t\t\tReturnType = context.CreateShortType(resolveResult.Type),\n\t\t\t\t\tModifiers = Modifiers.Const,\n\t\t\t\t\tVariables = { initializer }\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tvar variableUsage = new IdentifierExpression(name);\n\t\t\t\tscript.Replace(pexpr, variableUsage);\n\t\t\t\t//\t\t\t\tscript.Link(initializer.NameToken, variableUsage);\n\t\t\t\tscript.InsertWithCursor(context.TranslateString(\"Create constant\"), Script.InsertPosition.Before, decl);\n\t\t\t}, pexpr);\n\n\t\t\tif (visitor.Matches.Count > 1) {\n\t\t\t\tyield return new CodeAction(string.Format(context.TranslateString(\"Create local constant (replace '{0}' occurrences)\"), visitor.Matches.Count), script => {\n\t\t\t\t\tstring name = CreateMethodDeclarationAction.CreateBaseName(pexpr, resolveResult.Type);\n\t\t\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n\t\t\t\t\tif (service != null)\n\t\t\t\t\t\tname = service.CheckName(context, name, AffectedEntity.LocalConstant);\n\t\t\t\t\t\n\t\t\t\t\tvar initializer = new VariableInitializer(name, pexpr.Clone());\n\t\t\t\t\tvar decl = new VariableDeclarationStatement() {\n\t\t\t\t\t\tType = context.CreateShortType(resolveResult.Type),\n\t\t\t\t\t\tModifiers = Modifiers.Const,\n\t\t\t\t\t\tVariables = { initializer }\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tscript.InsertBefore(statement, decl);\n\n\t\t\t\t\tvar linkedNodes = new List<AstNode>();\n\t\t\t\t\tlinkedNodes.Add(initializer.NameToken);\n\t\t\t\t\tfor (int i = 0; i < visitor.Matches.Count; i++) {\n\t\t\t\t\t\tvar identifierExpression = new IdentifierExpression(name);\n\t\t\t\t\t\tlinkedNodes.Add(identifierExpression);\n\t\t\t\t\t\tscript.Replace(visitor.Matches [i], identifierExpression);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Link(linkedNodes.ToArray ());\n\t\t\t\t}, pexpr);\n\t\t\t\t\n\t\t\t\tyield return new CodeAction(string.Format(context.TranslateString(\"Create constant field (replace '{0}' occurrences)\"), visitor.Matches.Count), script => {\n\t\t\t\t\tstring name = CreateMethodDeclarationAction.CreateBaseName(pexpr, resolveResult.Type);\n\t\t\t\t\tvar service = (NamingConventionService)context.GetService(typeof(NamingConventionService));\n\t\t\t\t\tif (service != null)\n\t\t\t\t\t\tname = service.CheckName(context, name, AffectedEntity.ConstantField);\n\t\t\t\t\t\n\t\t\t\t\tvar initializer = new VariableInitializer(name, pexpr.Clone());\n\t\t\t\t\t\n\t\t\t\t\tvar decl = new FieldDeclaration() {\n\t\t\t\t\t\tReturnType = context.CreateShortType(resolveResult.Type),\n\t\t\t\t\t\tModifiers = Modifiers.Const,\n\t\t\t\t\t\tVariables = { initializer }\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tvar linkedNodes = new List<AstNode>();\n\t\t\t\t\tlinkedNodes.Add(initializer.NameToken);\n\t\t\t\t\tfor (int i = 0; i < visitor.Matches.Count; i++) {\n\t\t\t\t\t\tvar identifierExpression = new IdentifierExpression(name);\n\t\t\t\t\t\tlinkedNodes.Add(identifierExpression);\n\t\t\t\t\t\tscript.Replace(visitor.Matches [i], identifierExpression);\n\t\t\t\t\t}\n\t\t\t\t\tscript.InsertWithCursor(context.TranslateString(\"Create constant\"), Script.InsertPosition.Before, decl);\n\t\t\t\t}, pexpr);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/IntroduceFormatItemAction.cs",
    "content": "﻿// \n// IntroduceFormatItem.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Introduce format item. Works on strings that contain selections.\n\t/// \"this is <some> string\" => string.Format (\"this is {0} string\", <some>)\n\t/// </summary>\n\t[ContextAction(\"Introduce format item\", Description = \"Creates a string.format call with the selection as parameter.\")]\n\tpublic class IntroduceFormatItemAction : CodeActionProvider\n\t{\n\t\treadonly static MemberReferenceExpression PrototypeFormatReference = new PrimitiveType (\"string\").Member(\"Format\");\n\t\t\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tif (!context.IsSomethingSelected) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar pexpr = context.GetNode<PrimitiveExpression>();\n\t\t\tif (pexpr == null || !(pexpr.Value is string)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tif (pexpr.LiteralValue.StartsWith(\"@\", StringComparison.Ordinal)) {\n\t\t\t\tif (!(pexpr.StartLocation < new TextLocation(context.Location.Line, context.Location.Column - 1) && new TextLocation(context.Location.Line, context.Location.Column + 1) < pexpr.EndLocation)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!(pexpr.StartLocation < context.Location && context.Location < pexpr.EndLocation)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tyield return new CodeAction (context.TranslateString(\"Introduce format item\"), script => {\n\t\t\t\tvar invocation = context.GetNode<InvocationExpression>();\n\t\t\t\tif (invocation != null && invocation.Target.IsMatch(PrototypeFormatReference)) {\n\t\t\t\t\tAddFormatCallToInvocation(context, script, pexpr, invocation);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvar arg = CreateFormatArgument(context);\n\t\t\t\tvar newInvocation = new InvocationExpression (PrototypeFormatReference.Clone()) {\n\t\t\t\t\tArguments = { CreateFormatString(context, pexpr, 0), arg }\n\t\t\t\t};\n\t\t\t\n\t\t\t\tscript.Replace(pexpr, newInvocation);\n\t\t\t\tscript.Select(arg);\n\t\t\t}, pexpr);\n\n\t\t}\n\t\t\n\t\tvoid AddFormatCallToInvocation (RefactoringContext context, Script script, PrimitiveExpression pExpr, InvocationExpression invocation)\n\t\t{\n\t\t\tvar newInvocation = (InvocationExpression)invocation.Clone ();\n\t\t\t\n\t\t\tnewInvocation.Arguments.First ().ReplaceWith (CreateFormatString (context, pExpr, newInvocation.Arguments.Count () - 1));\n\t\t\tnewInvocation.Arguments.Add (CreateFormatArgument (context));\n\t\t\t\n\t\t\tscript.Replace (invocation, newInvocation);\n\t\t}\n\t\t\n\t\tstatic PrimitiveExpression CreateFormatArgument (RefactoringContext context)\n\t\t{\n\t\t\treturn new PrimitiveExpression (context.SelectedText);\n\t\t}\n\t\t\n\t\tstatic PrimitiveExpression CreateFormatString(RefactoringContext context, PrimitiveExpression pExpr, int argumentNumber)\n\t\t{\n\t\t\tvar start = context.GetOffset(pExpr.StartLocation);\n\t\t\tvar end = context.GetOffset(pExpr.EndLocation);\n\t\t\tvar sStart = context.GetOffset(context.SelectionStart);\n\t\t\tvar sEnd = context.GetOffset(context.SelectionEnd);\n\t\t\treturn new PrimitiveExpression(\"\", context.GetText(start, sStart - start) + \"{\" + argumentNumber + \"}\" + context.GetText(sEnd, end - sEnd));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/InvertConditionalOperatorAction.cs",
    "content": "//\n// InvertConditionalOperatorAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Invert conditional operator\", Description = \"Inverts an '?:' expression.\")]\n\tpublic class InvertConditionalOperatorAction : SpecializedCodeAction<ConditionalExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, ConditionalExpression conditionalExpr)\n\t\t{\n\t\t\tif (context.Location != conditionalExpr.Condition.StartLocation && context.Location < conditionalExpr.Condition.EndLocation ||\n\t\t\t    context.Location != conditionalExpr.TrueExpression.StartLocation && conditionalExpr.TrueExpression.Contains(context.Location) ||\n\t\t\t    context.Location != conditionalExpr.FalseExpression.StartLocation && conditionalExpr.FalseExpression.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar node = conditionalExpr.GetNodeAt(context.Location);\n\t\t\tif (node == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (context.TranslateString(\"Invert '?:'\"), script => {\n\t\t\t\tscript.Replace(conditionalExpr.Condition, CSharpUtil.InvertCondition(conditionalExpr.Condition.Clone()));\n\t\t\t\tscript.Replace(conditionalExpr.TrueExpression, conditionalExpr.FalseExpression.Clone());\n\t\t\t\tscript.Replace(conditionalExpr.FalseExpression, conditionalExpr.TrueExpression.Clone());\n\t\t\t\tscript.FormatText(conditionalExpr);\n\t\t\t}, node);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/InvertIfAction.cs",
    "content": "﻿// \n// InvertIf.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Invert if\", Description = \"Inverts an 'if ... else' expression.\")]\n\tpublic class InvertIfAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\t// TODO: Invert if without else\n\t\t\t// ex. if (cond) DoSomething () == if (!cond) return; DoSomething ()\n\t\t\t// beware of loop contexts return should be continue then.\n\t\t\t\n\t\t\tvar ifStatement = GetIfElseStatement(context);\n\t\t\tif (!(ifStatement != null && !ifStatement.TrueStatement.IsNull && !ifStatement.FalseStatement.IsNull)) {\n\t\t\t\tyield break;\n\n\t\t\t}\n\t\t\tyield return new CodeAction (context.TranslateString(\"Invert if\"), script => {\n\t\t\t\tscript.Replace(ifStatement.Condition, CSharpUtil.InvertCondition(ifStatement.Condition.Clone()));\n\t\t\t\tscript.Replace(ifStatement.TrueStatement, ifStatement.FalseStatement.Clone());\n\t\t\t\tscript.Replace(ifStatement.FalseStatement, ifStatement.TrueStatement.Clone());\n\t\t\t\tscript.FormatText(ifStatement);\n\t\t\t}, ifStatement);\n\t\t}\n\t\t\n\t\tstatic IfElseStatement GetIfElseStatement (RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<IfElseStatement> ();\n\t\t\tif (result != null && result.IfToken.Contains (context.Location))\n\t\t\t\treturn result;\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/InvertIfAndSimplify.cs",
    "content": "//\n// InvertIfAndSimplify.cs\n//\n// Author:\n//      Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Invert If and Simplify\", Description = \"Inverts if and simplify branching\")]\n\tpublic class InvertIfAndSimplify : CodeActionProvider\n\t{\n\t\treadonly InsertParenthesesVisitor _insertParenthesesVisitor = new InsertParenthesesVisitor();\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\t// if (condition) {CodeBlock();}else { return|break|continue;} \n\t\t\t// will be reduced to:\n\t\t\t//if (!condition) return|break|continue;\n\t\t\t//CodeBlock();\n\n\t\t\tvar ifStatement = GetIfElseStatement(context);\n\t\t\tif (ifStatement == null)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Simplify if in loops\"), script => GenerateNewScript(\n\t\t\t\tscript, ifStatement), ifStatement);\n\t\t}\n\n\t\tstatic Statement GenerateNewTrueStatement(Statement falseStatement)\n\t\t{\n\t\t\tvar blockStatement = falseStatement as BlockStatement;\n\t\t\tif (blockStatement != null) {\n\t\t\t\tif (blockStatement.Children.Count(n => n.Role != Roles.NewLine && n.Role != Roles.LBrace && n.Role != Roles.RBrace) == 1)\n\t\t\t\t\treturn blockStatement.Statements.First().Clone ();\n\t\t\t}\n\t\t\treturn falseStatement.Clone();\n\t\t}\n\n\t\tvoid GenerateNewScript(Script script, IfElseStatement ifStatement)\n\t\t{\n\t\t\tvar mergedIfStatement = new IfElseStatement\n\t\t\t{\n\t\t\t\tCondition = CSharpUtil.InvertCondition(ifStatement.Condition)\n\t\t\t};\n\t\t\tvar falseStatement = ifStatement.FalseStatement;\n\t\t\tmergedIfStatement.TrueStatement = GenerateNewTrueStatement(falseStatement);\n\t\t\tmergedIfStatement.Condition.AcceptVisitor(_insertParenthesesVisitor);\n\n\t\t\tscript.Replace(ifStatement, mergedIfStatement);\n\n\t\t\tSimplifyIfFlowAction.InsertBody(script, ifStatement);\n\t\t}\n\n\t\tstatic IfElseStatement GetIfElseStatement(RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<IfElseStatement>();\n\t\t\tif (result == null || !result.IfToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tvar falseStatement = result.FalseStatement;\n\t\t\tvar isQuitingStatement = falseStatement;\n\t\t\tvar blockStatement = falseStatement as BlockStatement;\n\t\t\tif (blockStatement != null)\n\t\t\t\tisQuitingStatement = blockStatement.Statements.FirstOrDefault();\n\t\t\tif (isQuitingStatement is ReturnStatement || isQuitingStatement is ContinueStatement || isQuitingStatement is BreakStatement)\n\t\t\t\treturn result;\n\t\t\treturn null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/InvertLogicalExpressionAction.cs",
    "content": "﻿// \n// InvertLogicalExpressionAction.cs\n// \n// Author:\n//      Ji Kun<jikun.nus@gmail.com>\n// \n// Copyright (c) 2012 Ji Kun<jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Invert logical expression\", Description = \"Inverts a logical expression\")]\n\tpublic class InvertLogicalExpressionAction : CodeActionProvider\n\t{\n\t\tpublic override System.Collections.Generic.IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tExpression expr = null;\n\t\t\tAstNode token;\n\t\t\tif (!NegateRelationalExpressionAction.GetLogicalExpression (context, out expr, out token))\n\t\t\t\tyield break;\n\n\t\t\tvar uOp = expr as UnaryOperatorExpression;\n\t\t\tif (uOp != null) {\n\t\t\t\tyield return new CodeAction(\n\t\t\t\t\tstring.Format(context.TranslateString(\"Invert '{0}'\"), expr),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.Replace(uOp, CSharpUtil.InvertCondition(CSharpUtil.GetInnerMostExpression(uOp.Expression)));\n\t\t\t\t\t}, token\n\t\t\t\t);\t\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar negativeExpression = CSharpUtil.InvertCondition(expr);\n\t\t\tif (expr.Parent is ParenthesizedExpression && expr.Parent.Parent is UnaryOperatorExpression) {\n\t\t\t\tvar unaryOperatorExpression = expr.Parent.Parent as UnaryOperatorExpression;\n\t\t\t\tif (unaryOperatorExpression.Operator == UnaryOperatorType.Not) {\n\t\t\t\t\tyield return new CodeAction(\n\t\t\t\t\t\tstring.Format(context.TranslateString(\"Invert '{0}'\"), unaryOperatorExpression),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tscript.Replace(unaryOperatorExpression, negativeExpression);\n\t\t\t\t\t\t}, token\n\t\t\t\t\t);\t\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newExpression = new UnaryOperatorExpression(UnaryOperatorType.Not, new ParenthesizedExpression(negativeExpression));\n\t\t\tyield return new CodeAction(\n\t\t\t\tstring.Format(context.TranslateString(\"Invert '{0}'\"), expr),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace(expr, newExpression);\n\t\t\t\t}, token\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/IterateViaForeachAction.cs",
    "content": "//\n// IterateViaForeachTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Iterate via foreach\", Description = \"Iterates an IEnumerable with a foreach loop.\")]\n\tpublic class IterateViaForeachAction : CodeActionProvider\n\t{\n\t\t#region ICodeActionProvider implementation\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tCodeAction action;\n\t\t\taction = ActionFromUsingStatement(context);\n\t\t\tif (action != null)\n\t\t\t\tyield return action;\n\t\t\taction = ActionFromVariableInitializer(context);\n\t\t\tif (action != null)\n\t\t\t\tyield return action;\n\t\t\taction = ActionFromExpressionStatement(context);\n\t\t\tif (action != null)\n\t\t\t\tyield return action;\n\t\t}\n\n\t\tCodeAction ActionFromUsingStatement(RefactoringContext context)\n\t\t{\n\t\t\tvar initializer = context.GetNode<VariableInitializer>();\n\t\t\tif (initializer == null || !initializer.NameToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tvar initializerRR = context.Resolve(initializer) as LocalResolveResult;\n\t\t\tif (initializerRR == null)\n\t\t\t\treturn null;\n\t\t\tvar elementType = GetElementType(initializerRR, context);\n\t\t\tif (elementType == null)\n\t\t\t\treturn null;\n\t\t\tvar usingStatement = initializer.Parent.Parent as UsingStatement;\n\t\t\tif (usingStatement == null)\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction(context.TranslateString(\"Iterate via foreach\"), script => {\n\t\t\t\tvar iterator = MakeForeach(new IdentifierExpression(initializer.Name), elementType, context);\n\t\t\t\tif (usingStatement.EmbeddedStatement is EmptyStatement) {\n\t\t\t\t\tvar blockStatement = new BlockStatement();\n\t\t\t\t\tblockStatement.Statements.Add(iterator);\n\t\t\t\t\tscript.Replace(usingStatement.EmbeddedStatement, blockStatement);\n\t\t\t\t\tscript.FormatText((AstNode)blockStatement);\n\t\t\t\t} else if (usingStatement.EmbeddedStatement is BlockStatement) {\n\t\t\t\t\tvar anchorNode = usingStatement.EmbeddedStatement.FirstChild;\n\t\t\t\t\tscript.InsertAfter(anchorNode, iterator);\n\t\t\t\t\tscript.FormatText(usingStatement.EmbeddedStatement);\n\t\t\t\t}\n\t\t\t}, initializer);\n\t\t}\n\n\t\tCodeAction ActionFromVariableInitializer(RefactoringContext context)\n\t\t{\n\t\t\tvar initializer = context.GetNode<VariableInitializer>();\n\t\t\tif (initializer == null || initializer.Parent.Parent is ForStatement || !initializer.NameToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tvar initializerRR = context.Resolve(initializer) as LocalResolveResult;\n\t\t\tif (initializerRR == null)\n\t\t\t\treturn null;\n\t\t\tvar elementType = GetElementType(initializerRR, context);\n\t\t\tif (elementType == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction(context.TranslateString(\"Iterate via foreach\"), script => {\n\t\t\t\tvar iterator = MakeForeach(new IdentifierExpression(initializer.Name), elementType, context);\n\t\t\t\tscript.InsertAfter(context.GetNode<Statement>(), iterator);\n\t\t\t}, initializer);\n\t\t}\n\n\t\tCodeAction ActionFromExpressionStatement(RefactoringContext context)\n\t\t{\n\t\t\tvar expressionStatement = context.GetNode<ExpressionStatement>();\n\t\t\tif (expressionStatement == null)\n\t\t\t\treturn null;\n\t\t\tvar expression = expressionStatement.Expression;\n\t\t\tvar assignment = expression as AssignmentExpression;\n\t\t\tif (assignment != null)\n\t\t\t\texpression = assignment.Left;\n\t\t\tif (!expression.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tvar expressionRR = context.Resolve(expression);\n\t\t\tif (expressionRR == null)\n\t\t\t\treturn null;\n\t\t\tvar elementType = GetElementType(expressionRR, context);\n\t\t\tif (elementType == null)\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction(context.TranslateString(\"Iterate via foreach\"), script => {\n\t\t\t\tvar iterator = MakeForeach(expression, elementType, context);\n\t\t\t\tif (expression == expressionStatement.Expression)\n\t\t\t\t\tscript.Replace(expressionStatement, iterator);\n\t\t\t\telse\n\t\t\t\t\tscript.InsertAfter(expressionStatement, iterator);\n\t\t\t}, expression);\n\t\t}\n\n\t\tstatic ForeachStatement MakeForeach(Expression node, IType type, RefactoringContext context)\n\t\t{\n\t\t\tvar namingHelper = new NamingHelper(context);\n\t\t\treturn new ForeachStatement {\n\t\t\t\tVariableType = new SimpleType(\"var\"),\n\t\t\t\tVariableName = namingHelper.GenerateVariableName(type),\n\t\t\t\tInExpression = node.Clone(),\n\t\t\t\tEmbeddedStatement = new BlockStatement()\n\t\t\t};\n\t\t}\n\n\t\tstatic IType GetElementType(ResolveResult rr, BaseRefactoringContext context)\n\t\t{\n\t\t\tif (rr.IsError || rr.Type.Kind == TypeKind.Unknown)\n\t\t\t\treturn null;\n\t\t\tvar type = GetCollectionType(rr.Type);\n\t\t\tif (type == null)\n\t\t\t\treturn null;\n\n\t\t\tvar parameterizedType = type as ParameterizedType;\n\t\t\tif (parameterizedType != null)\n\t\t\t\treturn parameterizedType.TypeArguments.First();\n\t\t\treturn context.Compilation.FindType(KnownTypeCode.Object);\n\t\t}\n\n\t\tstatic IType GetCollectionType(IType type)\n\t\t{\n\t\t\tIType collectionType = null;\n\t\t\tforeach (var baseType in type.GetAllBaseTypes()) {\n\t\t\t\tif (baseType.IsKnownType(KnownTypeCode.IEnumerableOfT)) {\n\t\t\t\t\tcollectionType = baseType;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (baseType.IsKnownType(KnownTypeCode.IEnumerable)) {\n\t\t\t\t\tcollectionType = baseType;\n\t\t\t\t\t// Don't break, continue in case type implements IEnumerable<T>\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn collectionType;\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/JoinDeclarationAndAssignmentAction.cs",
    "content": "﻿// \n// JoinDeclarationAndAssignmentAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Join local variable declaration and assignment\",\n\t\t\t\t\tDescription = \"Join local variable declaration and assignment.\")]\n\tpublic class JoinDeclarationAndAssignmentAction : SpecializedCodeAction<VariableInitializer>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, VariableInitializer node)\n\t\t{\n\t\t\tvar variableDecl = node.Parent as VariableDeclarationStatement;\n\t\t\tif (variableDecl == null || !node.Initializer.IsNull)\n\t\t\t\treturn null;\n\n\t\t\tvar assignmentPattern = new ExpressionStatement(\n\t\t\t\tnew AssignmentExpression (new IdentifierExpression (node.Name), new AnyNode (\"value\")));\n\t\t\tvar nextSibling = variableDecl.GetNextSibling(n => n is Statement);\n\t\t\tvar match = assignmentPattern.Match(nextSibling);\n\t\t\tif (!match.Success)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (context.TranslateString (\"Join local variable declaration and assignment\"), script => {\n\t\t\t\tvar jointVariableDecl = new VariableDeclarationStatement (variableDecl.Type.Clone (),\n\t\t\t\t\tnode.Name, match.Get<Expression> (\"value\").First ().Clone ());\n\t\t\t\tscript.Replace (nextSibling, jointVariableDecl);\n\t\t\t\tif (variableDecl.Variables.Count == 1) {\n\t\t\t\t\tscript.Remove (variableDecl);\n\t\t\t\t} else {\n\t\t\t\t\tvar newVariableDecl = new VariableDeclarationStatement { Type = variableDecl.Type.Clone () };\n\t\t\t\t\tforeach (var variable in variableDecl.Variables.Where (variable => variable != node))\n\t\t\t\t\t\tnewVariableDecl.Variables.Add ((VariableInitializer) variable.Clone ());\n\t\t\t\t\tscript.Replace (variableDecl, newVariableDecl);\n\t\t\t\t}\n\t\t\t}, node.NameToken);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/JoinStringAction.cs",
    "content": "﻿// \n// JoinStringAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Join string literal\", Description = \"Join string literals.\")]\n\tpublic class JoinStringAction : SpecializedCodeAction<BinaryOperatorExpression>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, BinaryOperatorExpression node)\n\t\t{\n\t\t\tif (node.Operator != BinaryOperatorType.Add)\n\t\t\t\treturn null;\n\n\t\t\tPrimitiveExpression left;\n\t\t\tvar leftBinaryOperatorExpr = node.Left as BinaryOperatorExpression;\n\t\t\tif (leftBinaryOperatorExpr != null && leftBinaryOperatorExpr.Operator == BinaryOperatorType.Add) {\n\t\t\t\tleft = leftBinaryOperatorExpr.Right as PrimitiveExpression;\n\t\t\t} else {\n\t\t\t\tleft = node.Left as PrimitiveExpression;\n\t\t\t}\n\t\t\tvar right = node.Right as PrimitiveExpression;\n\n\t\t\tif (left == null || right == null ||\n\t\t\t\t!(left.Value is string) || !(right.Value is string) || !node.OperatorToken.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar isLeftVerbatim = left.LiteralValue.StartsWith(\"@\", System.StringComparison.Ordinal);\n\t\t\tvar isRightVerbatime = right.LiteralValue.StartsWith(\"@\", System.StringComparison.Ordinal);\n\t\t\tif (isLeftVerbatim != isRightVerbatime)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (context.TranslateString (\"Join strings\"), script => {\n\t\t\t\tvar start = context.GetOffset (left.EndLocation) - 1;\n\t\t\t\tvar end = context.GetOffset (right.StartLocation) + (isLeftVerbatim ? 2 : 1);\n\t\t\t\tscript.RemoveText (start, end - start);\n\t\t\t}, node.OperatorToken);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/LinqFluentToQueryAction.cs",
    "content": "// \n// LinqFluentToQueryAction.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Convert LINQ query to fluent syntax\", Description = \"Convert LINQ query to fluent syntax\")]\n\tpublic class LinqFluentToQueryAction : SpecializedCodeAction<InvocationExpression>\n\t{\n\t\tstatic readonly List<string> LinqQueryMethods = new List<string>() {\n\t\t\t\"Select\", \"SelectMany\", \"GroupBy\",\n\t\t\t\"OrderBy\", \"OrderByDescending\", \"ThenBy\", \"ThenByDescending\",\n\t\t\t\"Where\", \"Cast\",\n\t\t\t\"Join\", \"GroupJoin\"\n\t\t};\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, InvocationExpression node)\n\t\t{\n\t\t\tif (!IsLinqMethodInvocation(node)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\twhile (node.Parent is MemberReferenceExpression) {\n\t\t\t\tvar parentInvocation = ((MemberReferenceExpression)node.Parent).Parent;\n\t\t\t\tif (!IsLinqMethodInvocation(parentInvocation)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnode = (InvocationExpression) parentInvocation;\n\t\t\t}\n\n\t\t\tIntroduceQueryExpressions queryExpressionIntroducer = new IntroduceQueryExpressions();\n\t\t\tCombineQueryExpressions queryExpressionCombiner = new CombineQueryExpressions();\n\t\t\tExpression newNode = queryExpressionIntroducer.ConvertFluentToQuery(node);\n\n\t\t\tqueryExpressionCombiner.CombineQuery(newNode);\n\n\t\t\tif (!(newNode is QueryExpression)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn new CodeAction(context.TranslateString(\"Convert to query syntax\"), script => {\n\t\t\t\tList<string> newNames = new List<string>();\n\t\t\t\tvar identifiers = newNode.Descendants.OfType<Identifier>().ToList();\n\t\t\t\tforeach (var identifier in identifiers.Where(id => id.Name.StartsWith(\"<>\")))\n\t\t\t\t{\n\t\t\t\t\tint nameId = int.Parse(identifier.Name.Substring(2)) - 1;\n\t\t\t\t\twhile (newNames.Count <= nameId) {\n\t\t\t\t\t\t//Find new name\n\n\t\t\t\t\t\t//This might skip some legitimate names, but that's not a real problem.\n\t\t\t\t\t\tvar topMostBlock = node.AncestorsAndSelf.OfType<BlockStatement>().Last();\n\t\t\t\t\t\tvar variableDeclarations = topMostBlock.Descendants.OfType<VariableDeclarationStatement>();\n\t\t\t\t\t\tvar declaredNames = variableDeclarations.SelectMany(variableDeclaration => variableDeclaration.Variables).Select(variable => variable.Name).ToList();\n\n\t\t\t\t\t\tint currentId = 1;\n\t\t\t\t\t\twhile (identifiers.Any(id => id.Name == \"_\" + currentId) || declaredNames.Contains(\"_\" + currentId)) {\n\t\t\t\t\t\t\t++currentId;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnewNames.Add(\"_\" + currentId);\n\t\t\t\t\t}\n\n\t\t\t\t\tidentifier.Name = newNames[nameId];\n\t\t\t\t}\n\n\t\t\t\tif (NeedsParenthesis(node)) {\n\t\t\t\t\tnewNode = new ParenthesizedExpression(newNode);\n\t\t\t\t}\n\n\t\t\t\tscript.Replace(node, newNode);\n\t\t\t}, node);\n\t\t}\n\n\t\tbool NeedsParenthesis(AstNode node)\n\t\t{\n\t\t\tAstNode parent = node.Parent;\n\t\t\tif (parent is BinaryOperatorExpression)\n\t\t\t\treturn true;\n\n\t\t\tUnaryOperatorExpression unaryExpression = parent as UnaryOperatorExpression;\n\t\t\tif (unaryExpression != null) {\n\t\t\t\treturn unaryExpression.Operator == UnaryOperatorType.PostIncrement ||\n\t\t\t\t\tunaryExpression.Operator == UnaryOperatorType.PostDecrement;\n\t\t\t}\n\n\t\t\treturn parent is MemberReferenceExpression ||\n\t\t\t\tparent is InvocationExpression;\n\t\t}\n\n\t\tbool IsLinqMethodInvocation(AstNode node)\n\t\t{\n\t\t\tvar invocation = node as InvocationExpression;\n\t\t\treturn invocation != null && IsLinqMethodInvocation(invocation);\n\t\t}\n\n\t\tbool IsLinqMethodInvocation(InvocationExpression node)\n\t\t{\n\t\t\tvar target = node.Target as MemberReferenceExpression;\n\t\t\treturn target != null && IsLinqMethod(target);\n\t\t}\n\n\t\tbool IsLinqMethod(MemberReferenceExpression node)\n\t\t{\n\t\t\treturn LinqQueryMethods.Contains(node.MemberName);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/LinqQueryToFluentAction.cs",
    "content": "// \n// LinqQueryToFluentAction.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Convert LINQ query to fluent syntax\",\n\t               Description = \"Converts a LINQ query to the equivalent fluent syntax.\")]\n\tpublic class LinqQueryToFluentAction : SpecializedCodeAction<QueryExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, QueryExpression node)\n\t\t{\n\t\t\tAstNode currentNode = node;\n\t\t\tfor (;;) {\n\t\t\t\tQueryContinuationClause continuationParent = currentNode.Parent as QueryContinuationClause;\n\t\t\t\tif (continuationParent != null) {\n\t\t\t\t\tcurrentNode = continuationParent;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tQueryExpression exprParent = currentNode.Parent as QueryExpression;\n\t\t\t\tif (exprParent != null) {\n\t\t\t\t\tcurrentNode = exprParent;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tnode = (QueryExpression)currentNode;\n\n\t\t\treturn new CodeAction(context.TranslateString(\"Convert LINQ query to fluent syntax\"),\n\t\t\t                      script => ConvertQueryToFluent(context, script, node),\n\t\t\t                      node);\n\t\t}\n\n\t\tstatic void ConvertQueryToFluent(RefactoringContext context, Script script, QueryExpression query) {\n\t\t\tIEnumerable<string> underscoreIdentifiers = GetNameProposals (context, query, \"_\");\n\t\t\tExpression newExpression = GetFluentFromQuery(query, underscoreIdentifiers);\n\t\t\tscript.Replace (query, newExpression);\n\t\t}\n\n\t\tstatic IEnumerable<string> GetNameProposals(RefactoringContext context, QueryExpression query, string baseName)\n\t\t{\n\t\t\tvar resolver = context.GetResolverStateBefore(query);\n\t\t\tint current = -1;\n\t\t\tstring nameProposal;\n\t\t\tfor (;;) {\n\t\t\t\tdo {\n\t\t\t\t\t++current;\n\t\t\t\t\tnameProposal = baseName + (current == 0 ? string.Empty : current.ToString());\n\t\t\t\t} while (IsNameUsed (resolver, query, nameProposal));\n\n\t\t\t\tyield return nameProposal;\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsNameUsed(CSharpResolver resolver, QueryExpression query, string name)\n\t\t{\n\t\t\tif (resolver.ResolveSimpleName(name, new List<IType>()) is LocalResolveResult) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (query.Ancestors.OfType <VariableInitializer>().Any(variable => variable.Name == name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (query.Ancestors.OfType <BlockStatement>()\n\t\t\t    .Any(blockStatement => DeclaresLocalVariable(blockStatement, name))) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn query.Descendants.OfType<Identifier> ().Any (identifier => identifier.Name == name);\n\t\t}\n\n\t\tstatic bool DeclaresLocalVariable(BlockStatement blockStatement, string name) {\n\t\t\treturn blockStatement.Descendants.OfType <VariableInitializer>()\n\t\t\t\t.Any(variable => variable.Name == name &&\n\t\t\t\t     variable.Ancestors.OfType<BlockStatement>().First() == blockStatement);\n\t\t}\n\n\t\tstatic Expression GetFluentFromQuery (QueryExpression query, IEnumerable<string> underscoreIdentifiers)\n\t\t{\n\t\t\tvar queryExpander = new QueryExpressionExpander();\n\t\t\tvar expandResult = queryExpander.ExpandQueryExpressions(query, underscoreIdentifiers);\n\n\t\t\treturn (Expression) expandResult.AstNode;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/MergeNestedIfAction.cs",
    "content": "﻿// \n// MergeNestedIfAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Merge nested 'if'\", Description = \"Merge two nested 'if' statements.\")]\n\tpublic class MergeNestedIfAction : SpecializedCodeAction<IfElseStatement>\n\t{\n\t\tstatic readonly InsertParenthesesVisitor insertParenthesesVisitor = new InsertParenthesesVisitor ();\n\n\t\tprotected override CodeAction GetAction (RefactoringContext context, IfElseStatement node)\n\t\t{\n\t\t\tif (!node.IfToken.Contains (context.Location))\n\t\t\t\treturn null;\n\n\t\t\tIfElseStatement outerIfStatement;\n\t\t\tIfElseStatement innerIfStatement = GetInnerIfStatement (node);\n\t\t\tif (innerIfStatement != null) {\n\t\t\t\tif (!innerIfStatement.FalseStatement.IsNull)\n\t\t\t\t\treturn null;\n\t\t\t\touterIfStatement = node;\n\t\t\t} else {\n\t\t\t\touterIfStatement = GetOuterIfStatement (node);\n\t\t\t\tif (outerIfStatement == null || !outerIfStatement.FalseStatement.IsNull)\n\t\t\t\t\treturn null;\n\t\t\t\tinnerIfStatement = node;\n\t\t\t}\n\n\t\t\treturn new CodeAction (context.TranslateString (\"Merge nested 'if's\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar mergedIfStatement = new IfElseStatement\n\t\t\t\t\t{\n\t\t\t\t\t\tCondition = new BinaryOperatorExpression (outerIfStatement.Condition.Clone (),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  BinaryOperatorType.ConditionalAnd, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  innerIfStatement.Condition.Clone ()),\n\t\t\t\t\t\tTrueStatement = innerIfStatement.TrueStatement.Clone ()\n\t\t\t\t\t};\n\t\t\t\t\tmergedIfStatement.Condition.AcceptVisitor (insertParenthesesVisitor);\n\t\t\t\t\tscript.Replace (outerIfStatement, mergedIfStatement);\n\t\t\t\t}, node);\n\t\t}\n\n\t\tstatic IfElseStatement GetOuterIfStatement (IfElseStatement node)\n\t\t{\n\t\t\tvar outerIf = node.Parent as IfElseStatement;\n\t\t\tif (outerIf != null)\n\t\t\t\treturn outerIf;\n\n\t\t\tvar blockStatement = node.Parent as BlockStatement;\n\t\t\twhile (blockStatement != null && blockStatement.Statements.Count == 1) {\n\t\t\t\touterIf = blockStatement.Parent as IfElseStatement;\n\t\t\t\tif (outerIf != null)\n\t\t\t\t\treturn outerIf;\n\t\t\t\tblockStatement = blockStatement.Parent as BlockStatement;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic IfElseStatement GetInnerIfStatement (IfElseStatement node)\n\t\t{\n\t\t\tif (!node.FalseStatement.IsNull)\n\t\t\t\treturn null;\n\n\t\t\tvar innerIf = node.TrueStatement as IfElseStatement;\n\t\t\tif (innerIf != null)\n\t\t\t\treturn innerIf;\n\n\t\t\tvar blockStatement = node.TrueStatement as BlockStatement;\n\t\t\twhile (blockStatement != null && blockStatement.Statements.Count == 1) {\n\t\t\t\tinnerIf = blockStatement.Statements.First () as IfElseStatement;\n\t\t\t\tif (innerIf != null)\n\t\t\t\t\treturn innerIf;\n\t\t\t\tblockStatement = blockStatement.Statements.First () as BlockStatement;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/MoveToOuterScopeAction.cs",
    "content": "//\n// MoveToOuterScopeAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Threading;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t\n\t[ContextAction(\"Move to outer scope\", Description = \"Moves a declaration to the parent scope.\")]\n\tpublic class MoveToOuterScopeAction : CodeActionProvider\n\t{\n\t\t#region ICodeActionProvider implementation\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar variableDeclaration = context.GetNode<VariableDeclarationStatement>();\n\t\t\tif (variableDeclaration == null)\n\t\t\t\tyield break;\n\t\t\tvar entryNode = FindCurrentScopeEntryNode(variableDeclaration);\n\t\t\tif (entryNode == null)\n\t\t\t\tyield break;\n\t\t\tvar selectedInitializer = context.GetNode<VariableInitializer>();\n\t\t\tif (selectedInitializer != null) {\n\t\t\t\tif (!selectedInitializer.NameToken.Contains(context.Location))\n\t\t\t\t\tyield break;\n\t\t\t\tif (HasDependency(context, entryNode, selectedInitializer)) {\n\t\t\t\t\tyield return MoveDeclarationAction(context, entryNode, variableDeclaration, selectedInitializer);\n\t\t\t\t} else {\n\t\t\t\t\tyield return MoveInitializerAction(context, entryNode, variableDeclaration, selectedInitializer);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!variableDeclaration.Type.Contains(context.Location) || variableDeclaration.Variables.Count <= 1)\n\t\t\t\t\tyield break;\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Move declaration to outer scope\"), script => {\n\t\t\t\t\tscript.Remove(variableDeclaration);\n\t\t\t\t\tscript.InsertBefore(entryNode, variableDeclaration.Clone());\n\t\t\t\t}, variableDeclaration);\n\t\t\t}\n\t\t}\n\n\t\tstatic CodeAction MoveInitializerAction(RefactoringContext context, AstNode insertAnchor,\n\t\t                                        VariableDeclarationStatement declaration, VariableInitializer initializer)\n\t\t{\n\t\t\tvar type = declaration.Type.Clone();\n\t\t\tvar name = initializer.Name;\n\t\t\treturn new CodeAction(context.TranslateString(\"Move initializer to outer scope\"), script =>  {\n\t\t\t\tif (declaration.Variables.Count != 1) {\n\t\t\t\t\tvar innerDeclaration = RemoveInitializer(declaration, initializer);\n\t\t\t\t\tscript.InsertBefore(declaration, innerDeclaration);\n\t\t\t\t}\n\t\t\t\tscript.Remove(declaration);\n\t\t\t\tvar outerDeclaration = new VariableDeclarationStatement(type, name, initializer.Initializer.Clone());\n\t\t\t\tscript.InsertBefore(insertAnchor, outerDeclaration);\n\t\t\t}, initializer.NameToken);\n\t\t}\n\n\t\tstatic CodeAction MoveDeclarationAction(RefactoringContext context, AstNode insertAnchor,\n\t\t                                        VariableDeclarationStatement declarationStatement, VariableInitializer initializer)\n\t\t{\n\t\t\tvar type = declarationStatement.Type.Clone();\n\t\t\tvar name = initializer.Name;\n\t\t\t\n\t\t\treturn new CodeAction(context.TranslateString(\"Move declaration to outer scope\"), script =>  {\n\t\t\t\tscript.InsertBefore(declarationStatement, new ExpressionStatement {\n\t\t\t\t\tExpression = new AssignmentExpression(new IdentifierExpression(name), initializer.Initializer.Clone())\n\t\t\t\t});\n\t\t\t\tscript.Remove(declarationStatement);\n\t\t\t\tscript.InsertBefore(insertAnchor, new VariableDeclarationStatement(type, name, Expression.Null));\n\t\t\t}, initializer.NameToken);\n\t\t}\n\n\t\tbool HasDependency(RefactoringContext context, AstNode firstSearchNode, AstNode targetNode)\n\t\t{\n\t\t\tvar referenceFinder = new FindReferences();\n\t\t\tvar identifiers = targetNode.Descendants\n\t\t\t\t.Where(n => n is IdentifierExpression)\n\t\t\t\t\t.Select<AstNode, IdentifierExpression>(node => (IdentifierExpression)node);\n\t\t\tforeach (var identifier in identifiers) {\n\t\t\t\tvar resolveResult = context.Resolve(identifier);\n\t\t\t\tvar localResolveResult = resolveResult as LocalResolveResult;\n\t\t\t\tif (localResolveResult == null)\n\t\t\t\t\tcontinue;\n\t\t\t\tbool referenceFound = false;\n//\t\t\t\tvar variable = localResolveResult.Variable;\n\t\t\t\tvar syntaxTree = context.RootNode as SyntaxTree;\n\t\t\t\treferenceFinder.FindLocalReferences(localResolveResult.Variable, context.UnresolvedFile, syntaxTree,\n\t\t\t\t                                    context.Compilation, (node, nodeResolveResult) => {\n\t\t\t\t\tif (node.StartLocation > firstSearchNode.StartLocation && node.EndLocation < targetNode.StartLocation)\n\t\t\t\t\t\treferenceFound = true;\n\t\t\t\t}, CancellationToken.None);\n\t\t\t\tif (referenceFound)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic VariableDeclarationStatement RemoveInitializer(VariableDeclarationStatement variableDeclarationStatement, VariableInitializer selectedVariableInitializer)\n\t\t{\n\t\t\tvar newVariableDeclarationStatement = new VariableDeclarationStatement() {\n\t\t\t\tType = variableDeclarationStatement.Type.Clone()\n\t\t\t};\n\t\t\tforeach (var variableInitializer in variableDeclarationStatement.Variables) {\n\t\t\t\tif (variableInitializer != selectedVariableInitializer) {\n\t\t\t\t\tnewVariableDeclarationStatement.AddChild((VariableInitializer)variableInitializer.Clone(), Roles.Variable);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn newVariableDeclarationStatement;\n\t\t}\n\n\t\tAstNode FindCurrentScopeEntryNode(Statement startNode)\n\t\t{\n\t\t\t// Start one node up in the tree, otherwise we may stop at the BlockStatement\n\t\t\t// of the current scope instead of moving up to the enclosing scope\n\t\t\tvar currentNode = startNode.Parent;\n\t\t\tAstNode lastNode;\n\t\t\tdo {\n\t\t\t\tlastNode = currentNode;\n\t\t\t\tcurrentNode = currentNode.Parent;\n\t\t\t\tif (currentNode == null)\n\t\t\t\t\treturn null;\n\t\t\t} while (!(currentNode is BlockStatement));\n\t\t\treturn lastNode;\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/NegateIsExpressionAction.cs",
    "content": "//\n// NegateIsExpressionAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Negate 'is' expression\", Description = \"Negate an is expression.\")]\n\tpublic class NegateIsExpressionAction : SpecializedCodeAction<IsExpression>\n\t{\n\t\tprotected override CodeAction GetAction (RefactoringContext context, IsExpression node)\n\t\t{\n\t\t\tif (!node.IsToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tvar pExpr = node.Parent as ParenthesizedExpression;\n\t\t\tif (pExpr != null) {\n\t\t\t\tvar uOp = pExpr.Parent as UnaryOperatorExpression;\n\t\t\t\tif (uOp != null && uOp.Operator == UnaryOperatorType.Not) {\n\t\t\t\t\treturn new CodeAction(\n\t\t\t\t\t\tstring.Format(context.TranslateString(\"Negate '{0}'\"), uOp),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tscript.Replace(uOp, node.Clone());\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tnode.IsToken\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new CodeAction (\n\t\t\t\tstring.Format (context.TranslateString (\"Negate '{0}'\"), node),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace (node, new UnaryOperatorExpression(UnaryOperatorType.Not, new ParenthesizedExpression(node.Clone())));\n\t\t\t\t}, \n\t\t\t\tnode.IsToken\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/NegateRelationalExpressionAction.cs",
    "content": "﻿//\n// NegateRelationalExpressionAction.cs\n//\n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n//      Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Negate a relational expression\", Description = \"Negate a relational expression.\")]\n\tpublic class NegateRelationalExpressionAction : CodeActionProvider\n\t{\n\t\tpublic static bool GetLogicalExpression (RefactoringContext context, out Expression expr, out AstNode token)\n\t\t{\n\t\t\texpr = null;\n\t\t\ttoken = null;\n\t\t\tvar bOp = context.GetNode<BinaryOperatorExpression>();\n\t\t\tif (bOp != null && bOp.OperatorToken.Contains(context.Location) && CSharpUtil.IsRelationalOperator (bOp.Operator)) {\n\t\t\t\texpr = bOp;\n\t\t\t\ttoken = bOp.OperatorToken;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar uOp = context.GetNode<UnaryOperatorExpression>();\n\t\t\tif (uOp != null && uOp.OperatorToken.Contains(context.Location) && uOp.Operator == UnaryOperatorType.Not) {\n\t\t\t\texpr = uOp;\n\t\t\t\ttoken = uOp.OperatorToken;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override System.Collections.Generic.IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tExpression expr = null;\n\t\t\tAstNode token;\n\t\t\tif (!GetLogicalExpression (context, out expr, out token))\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction (\n\t\t\t\tstring.Format (context.TranslateString (\"Negate '{0}'\"), expr),\n\t\t\t\tscript => {\n\t\t\t\t\tscript.Replace (expr, CSharpUtil.InvertCondition(expr));\n\t\t\t\t}, \n\t\t\t\ttoken\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/PutInsideUsingAction.cs",
    "content": "﻿// \n// PutInsideUsingAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"put inside 'using'\", Description = \"put IDisposable inside 'using' construct\")]\n\tpublic class PutInsideUsingAction : SpecializedCodeAction <VariableInitializer>\n\t{\n\t\tstatic readonly FindReferences refFinder = new FindReferences ();\n\t\tprotected override CodeAction GetAction (RefactoringContext context, VariableInitializer node)\n\t\t{\n\t\t\tif (node.Initializer.IsNull)\n\t\t\t\treturn null;\n\n\t\t\tvar variableDecl = node.Parent as VariableDeclarationStatement;\n\t\t\tif (variableDecl == null || !(variableDecl.Parent is BlockStatement))\n\t\t\t\treturn null;\n\n\t\t\tvar type = context.ResolveType (variableDecl.Type);\n\t\t\tif (!IsIDisposable (type))\n\t\t\t\treturn null;\n\n\t\t\tvar unit = context.RootNode as SyntaxTree;\n\t\t\tif (unit == null)\n\t\t\t\treturn null;\n\n\t\t\tvar resolveResult = (LocalResolveResult)context.Resolve (node);\n\n\t\t\treturn new CodeAction (context.TranslateString (\"put inside 'using'\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar lastReference = GetLastReference (resolveResult.Variable, context, unit);\n\n\t\t\t\t\tvar body = new BlockStatement ();\n\t\t\t\t\tvar variableToMoveOutside = new List<VariableDeclarationStatement> ();\n\n\t\t\t\t\tif (lastReference != node) {\n\t\t\t\t\t\tvar statements = CollectStatements (variableDecl.GetNextSibling (n => n is Statement) as Statement, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlastReference.EndLocation).ToArray();\n\n\t\t\t\t\t\t// collect statements to put inside 'using' and variable declaration to move outside 'using'\n\t\t\t\t\t\tforeach (var statement in statements) {\n\t\t\t\t\t\t\tscript.Remove (statement);\n\n\t\t\t\t\t\t\tvar decl = statement as VariableDeclarationStatement;\n\t\t\t\t\t\t\tif (decl == null) {\n\t\t\t\t\t\t\t\tbody.Statements.Add (statement.Clone ());\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar outsideDecl = (VariableDeclarationStatement)decl.Clone ();\n\t\t\t\t\t\t\toutsideDecl.Variables.Clear ();\n\t\t\t\t\t\t\tvar insideDecl = (VariableDeclarationStatement)outsideDecl.Clone ();\n\n\t\t\t\t\t\t\tforeach (var variable in decl.Variables) {\n\t\t\t\t\t\t\t\tvar reference = GetLastReference (\n\t\t\t\t\t\t\t\t\t((LocalResolveResult)context.Resolve (variable)).Variable, context, unit);\n\t\t\t\t\t\t\t\tif (reference.StartLocation > lastReference.EndLocation)\n\t\t\t\t\t\t\t\t\toutsideDecl.Variables.Add ((VariableInitializer)variable.Clone ());\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tinsideDecl.Variables.Add ((VariableInitializer)variable.Clone ());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (outsideDecl.Variables.Count > 0)\n\t\t\t\t\t\t\t\tvariableToMoveOutside.Add (outsideDecl);\n\t\t\t\t\t\t\tif (insideDecl.Variables.Count > 0)\n\t\t\t\t\t\t\t\tbody.Statements.Add (insideDecl);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (var decl in variableToMoveOutside)\n\t\t\t\t\t\tscript.InsertBefore (variableDecl, decl);\n\n\t\t\t\t\tif (body.Statements.Count > 0) {\n\t\t\t\t\t\tvar lastStatement = body.Statements.Last ();\n\t\t\t\t\t\tif (IsDisposeInvocation (resolveResult.Variable.Name, lastStatement))\n\t\t\t\t\t\t\tlastStatement.Remove ();\n\t\t\t\t\t}\n\t\t\t\t\tvar usingStatement = new UsingStatement\n\t\t\t\t\t{\n\t\t\t\t\t\tResourceAcquisition = new VariableDeclarationStatement (variableDecl.Type.Clone (), node.Name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnode.Initializer.Clone ()),\n\t\t\t\t\t\tEmbeddedStatement = body\n\t\t\t\t\t};\n\t\t\t\t\tscript.Replace (variableDecl, usingStatement);\n\n\t\t\t\t\tif (variableDecl.Variables.Count == 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\t// other variables in the same declaration statement\n\t\t\t\t\tvar remainingVariables = (VariableDeclarationStatement)variableDecl.Clone ();\n\t\t\t\t\tremainingVariables.Variables.Remove (\n\t\t\t\t\t\tremainingVariables.Variables.FirstOrDefault (v => v.Name == node.Name));\n\t\t\t\t\tscript.InsertBefore (usingStatement, remainingVariables);\n\t\t\t\t}, node.NameToken);\n\t\t}\n\n\t\tstatic bool IsIDisposable (IType type)\n\t\t{\n\t\t\treturn type.GetAllBaseTypeDefinitions ().Any (t => t.KnownTypeCode == KnownTypeCode.IDisposable);\n\t\t}\n\t\n\t\tstatic IEnumerable<Statement> CollectStatements (Statement statement, TextLocation end)\n\t\t{\n\t\t\twhile (statement != null) {\n\t\t\t\tyield return statement;\n\t\t\t\tif (statement.Contains (end))\n\t\t\t\t\tbreak;\n\t\t\t\tstatement = statement.GetNextSibling (n => n is Statement) as Statement;\n\t\t\t}\n\t\t}\n\n\t\tstatic AstNode GetLastReference (IVariable variable, RefactoringContext context, SyntaxTree unit)\n\t\t{\n\t\t\tAstNode lastReference = null;\n\t\t\trefFinder.FindLocalReferences (variable, context.UnresolvedFile, unit, context.Compilation,\n\t\t\t\t(v, r) =>\n\t\t\t\t{\n\t\t\t\t\tif (lastReference == null || v.EndLocation > lastReference.EndLocation)\n\t\t\t\t\t\tlastReference = v;\n\t\t\t\t}, context.CancellationToken);\n\t\t\treturn lastReference;\n\t\t}\n\n\t\tstatic bool IsDisposeInvocation (string variableName, Statement statement)\n\t\t{\n\t\t\tvar memberReferenceExpr = new MemberReferenceExpression (new IdentifierExpression (variableName), \"Dispose\");\n\t\t\tvar pattern = new ExpressionStatement (new InvocationExpression (memberReferenceExpr));\n\t\t\treturn pattern.Match (statement).Success;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/RemoveBackingStoreAction.cs",
    "content": "﻿// \n// RemoveBackingStore.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Remove backing store for property\", Description = \"Removes the backing store of a property and creates an auto property.\")]\n\tpublic class RemoveBackingStoreAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar property = context.GetNode<PropertyDeclaration>();\n\t\t\tif (property == null || !property.NameToken.Contains(context.Location))\n\t\t\t\tyield break;\n\n\t\t\tvar field = GetBackingField(context, property);\n\t\t\tif (!IsValidField(field, property.GetParent<TypeDeclaration>())) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\t// create new auto property\n\t\t\tvar newProperty = (PropertyDeclaration)property.Clone();\n\t\t\tnewProperty.Getter.Body = BlockStatement.Null;\n\t\t\tnewProperty.Setter.Body = BlockStatement.Null;\n\t\t\t\n\t\t\tyield return new CodeAction(context.TranslateString(\"Convert to auto property\"), script => {\n\t\t\t\tscript.Rename((IEntity)field, newProperty.Name);\n\t\t\t\tvar oldField = context.RootNode.GetNodeAt<FieldDeclaration>(field.Region.Begin);\n\t\t\t\tif (oldField.Variables.Count == 1) {\n\t\t\t\t\tscript.Remove(oldField);\n\t\t\t\t} else {\n\t\t\t\t\tvar newField = (FieldDeclaration)oldField.Clone();\n\t\t\t\t\tforeach (var init in newField.Variables) {\n\t\t\t\t\t\tif (init.Name == field.Name) {\n\t\t\t\t\t\t\tinit.Remove();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace(oldField, newField);\n\t\t\t\t}\n\t\t\t\tscript.Replace (property, newProperty);\n\t\t\t}, property.NameToken);\n\t\t}\n\n\t\tstatic bool IsValidField(IField field, TypeDeclaration declaringType)\n\t\t{\n\t\t\tif (field == null || field.Attributes.Count > 0)\n\t\t\t\treturn false;\n\t\t\tforeach (var m in declaringType.Members.OfType<FieldDeclaration>()) {\n\t\t\t\tforeach (var i in m.Variables) {\n\t\t\t\t\tif (i.StartLocation == field.BodyRegion.Begin) {\n\t\t\t\t\t\tif (!i.Initializer.IsNull)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n//\t\tvoid ReplaceBackingFieldReferences (MDRefactoringContext context, IField backingStore, PropertyDeclaration property)\n//\t\t{\n//\t\t\tusing (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {\n//\t\t\t\tforeach (var memberRef in MonoDevelop.Ide.FindInFiles.ReferenceFinder.FindReferences (backingStore, monitor)) {\n//\t\t\t\t\tif (property.Contains (memberRef.Line, memberRef.Column))\n//\t\t\t\t\t\tcontinue;\n//\t\t\t\t\tif (backingStore.Location.Line == memberRef.Line && backingStore.Location.Column == memberRef.Column)\n//\t\t\t\t\t\tcontinue;\n//\t\t\t\t\tcontext.Do (new TextReplaceChange () {\n//\t\t\t\t\t\tFileName = memberRef.FileName,\n//\t\t\t\t\t\tOffset = memberRef.Position,\n//\t\t\t\t\t\tRemovedChars = memberRef.Name.Length,\n//\t\t\t\t\t\tInsertedText = property.Name\n//\t\t\t\t\t});\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\n\t\tstatic readonly Version csharp3 = new Version(3, 0);\n\t\t\n\t\tinternal static IField GetBackingField (BaseRefactoringContext context, PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\t// automatic properties always need getter & setter\n\t\t\tif (propertyDeclaration == null || propertyDeclaration.Getter.IsNull || propertyDeclaration.Setter.IsNull || propertyDeclaration.Getter.Body.IsNull || propertyDeclaration.Setter.Body.IsNull)\n\t\t\t\treturn null;\n\t\t\tif (!context.Supports(csharp3) || propertyDeclaration.HasModifier (ICSharpCode.NRefactory.CSharp.Modifiers.Abstract) || ((TypeDeclaration)propertyDeclaration.Parent).ClassType == ClassType.Interface)\n\t\t\t\treturn null;\n\t\t\tvar getterField = ScanGetter (context, propertyDeclaration);\n\t\t\tif (getterField == null)\n\t\t\t\treturn null;\n\t\t\tvar setterField = ScanSetter (context, propertyDeclaration);\n\t\t\tif (setterField == null)\n\t\t\t\treturn null;\n\t\t\tif (!getterField.Equals(setterField))\n\t\t\t\treturn null;\n\t\t\treturn getterField;\n\t\t}\n\t\t\n\t\tinternal static IField ScanGetter (BaseRefactoringContext context, PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tif (propertyDeclaration.Getter.Body.Statements.Count != 1)\n\t\t\t\treturn null;\n\t\t\tvar returnStatement = propertyDeclaration.Getter.Body.Statements.First () as ReturnStatement;\n\t\t\tif (returnStatement == null)\n\t\t\t\treturn null;\n\t\t\tif (!IsPossibleExpression(returnStatement.Expression))\n\t\t\t\treturn null;\n\t\t\tvar result = context.Resolve (returnStatement.Expression);\n\t\t\tif (result == null || !(result is MemberResolveResult))\n\t\t\t\treturn null;\n\t\t\treturn ((MemberResolveResult)result).Member as IField;\n\t\t}\n\t\t\n\t\tinternal static IField ScanSetter (BaseRefactoringContext context, PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tif (propertyDeclaration.Setter.Body.Statements.Count != 1)\n\t\t\t\treturn null;\n\t\t\tvar setAssignment = propertyDeclaration.Setter.Body.Statements.First () as ExpressionStatement;\n\t\t\tvar assignment = setAssignment != null ? setAssignment.Expression as AssignmentExpression : null;\n\t\t\tif (assignment == null || assignment.Operator != AssignmentOperatorType.Assign)\n\t\t\t\treturn null;\n\t\t\tvar idExpr = assignment.Right as IdentifierExpression;\n\t\t\tif (idExpr == null || idExpr.Identifier != \"value\")\n\t\t\t\treturn null;\n\t\t\tif (!IsPossibleExpression(assignment.Left))\n\t\t\t\treturn null;\n\t\t\tvar result = context.Resolve (assignment.Left);\n\t\t\tif (result == null || !(result is MemberResolveResult))\n\t\t\t\treturn null;\n\t\t\treturn ((MemberResolveResult)result).Member as IField;\n\t\t}\n\n\t\tstatic bool IsPossibleExpression(Expression left)\n\t\t{\n\t\t\tif (left is IdentifierExpression)\n\t\t\t\treturn true;\n\t\t\tvar mr = left as MemberReferenceExpression;\n\t\t\tif (mr == null)\n\t\t\t\treturn false;\n\t\t\treturn mr.Target is ThisReferenceExpression;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/RemoveBracesAction.cs",
    "content": "﻿// \n// RemoveBraces.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Remove braces\", Description = \"Removes redundant braces around a statement.\")]\n\tpublic class RemoveBracesAction : CodeActionProvider\n\t{\n\t\tinternal static bool IsSpecialNode (AstNode node, out string keyword, out Statement embeddedStatement)\n\t\t{\n\t\t\tif (node != null) {\n\t\t\t\tif (node.Role == IfElseStatement.IfKeywordRole) {\n\t\t\t\t\tkeyword = \"if\";\n\t\t\t\t\tembeddedStatement = ((IfElseStatement)node.Parent).TrueStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (node.Role == IfElseStatement.ElseKeywordRole) {\n\t\t\t\t\tkeyword = \"else\";\n\t\t\t\t\tembeddedStatement = ((IfElseStatement)node.Parent).FalseStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (node.Role == DoWhileStatement.DoKeywordRole || node.Role == DoWhileStatement.WhileKeywordRole) {\n\t\t\t\t\tkeyword = \"do\";\n\t\t\t\t\tembeddedStatement = ((DoWhileStatement)node.Parent).EmbeddedStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (node.Role == ForeachStatement.ForeachKeywordRole) {\n\t\t\t\t\tkeyword = \"foreach\";\n\t\t\t\t\tembeddedStatement = ((ForeachStatement)node.Parent).EmbeddedStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (node.Role == ForStatement.ForKeywordRole) {\n\t\t\t\t\tkeyword = \"for\";\n\t\t\t\t\tembeddedStatement = ((ForStatement)node.Parent).EmbeddedStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (node.Role == LockStatement.LockKeywordRole) {\n\t\t\t\t\tkeyword = \"lock\";\n\t\t\t\t\tembeddedStatement = ((LockStatement)node.Parent).EmbeddedStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (node.Role == UsingStatement.UsingKeywordRole) {\n\t\t\t\t\tkeyword = \"using\";\n\t\t\t\t\tembeddedStatement = ((UsingStatement)node.Parent).EmbeddedStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (node.Role == WhileStatement.WhileKeywordRole) {\n\t\t\t\t\tkeyword = \"while\";\n\t\t\t\t\tembeddedStatement = ((WhileStatement)node.Parent).EmbeddedStatement;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tkeyword = null;\n\t\t\tembeddedStatement = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tstring keyword;\n\t\t\tStatement embeddedStatement;\n\t\t\tBlockStatement block;\n\n\t\t\tvar currentNode = context.GetNode();\n\t\t\tif (IsSpecialNode(currentNode, out keyword, out embeddedStatement)) {\n\t\t\t\tblock = embeddedStatement as BlockStatement;\n\t\t\t\tif (block == null || block.Statements.Count != 1 || block.Statements.First() is VariableDeclarationStatement)\n\t\t\t\t\tyield break;\n\t\t\t} else {\n\t\t\t\tblock = GetBlockStatement(context);\n\t\t\t}\n\n\t\t\tif (block == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction (\n\t\t\t\tkeyword != null ? string.Format(context.TranslateString(\"Remove braces from '{0}'\"), keyword) : context.TranslateString(\"Remove braces\"), \n\t\t\t\tscript => {\n\t\t\t\t\tvar start = script.GetCurrentOffset (block.LBraceToken.GetPrevNode ().EndLocation);\n\t\t\t\t\tvar end = script.GetCurrentOffset (block.LBraceToken.EndLocation);\n\t\t\t\t\tif (end <= start)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tscript.RemoveText (start, end - start);\n\t\t\t\t\tscript.Remove(block.LBraceToken);\n\t\t\t\t\tscript.Remove(block.RBraceToken);\n\t\t\t\t\tscript.FormatText(block.Parent);\n\t\t\t\t}, \n\t\t\t\tcurrentNode\n\t\t\t);\n\t\t}\n\t\t\n\t\tstatic BlockStatement GetBlockStatement(RefactoringContext context)\n\t\t{\n\t\t\tvar block = context.GetNode<BlockStatement>();\n\t\t\tif (block == null || block.LBraceToken.IsNull || block.RBraceToken.IsNull)\n\t\t\t\treturn null;\n\t\t\tif (!(block.LBraceToken.IsInside(context.Location) || block.RBraceToken.IsInside(context.Location)))\n\t\t\t\treturn null;\n\t\t\tif (!(block.Parent is Statement) || block.Parent is TryCatchStatement) \n\t\t\t\treturn null;\n\t\t\tif (block.Statements.Count != 1 || block.Statements.First () is VariableDeclarationStatement) \n\t\t\t\treturn null;\n\t\t\treturn block;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/RemoveRedundantCatchTypeAction.cs",
    "content": "//\n// RemoveRedundantCatchTypeAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\t\n\t[ContextAction(\"Remove redundant type\",\n\t               Description = \"Removes a redundant exception type specifier from catch clauses.\")]\n\tpublic class RemoveRedundantCatchTypeAction : CodeActionProvider\n\t{\n\t\t#region ICodeActionProvider implementation\n\t\tpublic override System.Collections.Generic.IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar catchClause = context.GetNode<CatchClause>();\n\t\t\tif (catchClause == null)\n\t\t\t\tyield break;\n\t\t\tif (catchClause.Type.IsNull)\n\t\t\t\tyield break;\n\t\t\tvar exceptionType = context.ResolveType(catchClause.Type);\n\t\t\tif (exceptionType != context.Compilation.FindType(typeof(Exception)))\n\t\t\t\tyield break;\n\t\t\tvar syntaxTree = context.RootNode as SyntaxTree;\n\t\t\tif (syntaxTree == null)\n\t\t\t\tyield break;\n\t\t\tvar exceptionIdentifierRR = context.Resolve(catchClause.VariableNameToken) as LocalResolveResult;\n\t\t\tif (exceptionIdentifierRR != null &&\n\t\t\t\tIsReferenced(exceptionIdentifierRR.Variable, catchClause.Body, syntaxTree, context))\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Remove type specifier\"), script => {\n\t\t\t\tscript.Replace(catchClause, new CatchClause() {\n\t\t\t\t\tBody = catchClause.Body.Clone() as BlockStatement\n\t\t\t\t});\n\t\t\t}, catchClause.Type);\n\t\t}\n\n\t\tbool IsReferenced(IVariable variable, AstNode node, SyntaxTree syntaxTree, RefactoringContext context)\n\t\t{\n\t\t\tint referencesFound = 0;\n\t\t\tvar findRef = new FindReferences();\n\t\t\tfindRef.FindLocalReferences(variable, context.UnresolvedFile, syntaxTree, context.Compilation, (n, entity) => {\n\t\t\t\treferencesFound++;\n\t\t\t}, CancellationToken.None);\n\n\t\t\t// One reference is the declaration, and that does not count\n\t\t\treturn referencesFound > 1;\n\t\t}\n\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/RemoveRegionAction.cs",
    "content": "﻿// \n// RemoveRegion.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Remove region\", Description = \"Removes a pre processor #region/#endregion directive.\")]\n\tpublic class RemoveRegionAction : CodeActionProvider\n\t{\n\t\tstatic PreProcessorDirective GetEndDirective(PreProcessorDirective directive)\n\t\t{\n\t\t\tvar nextNode = directive.GetNextNode();\n\t\t\tint d = 0;\n\t\t\twhile (nextNode != null) {\n\t\t\t\tvar pp = nextNode as PreProcessorDirective;\n\t\t\t\tif (pp != null) {\n\t\t\t\t\tif (pp.Type == PreProcessorDirectiveType.Region) {\n\t\t\t\t\t\td++;\n\t\t\t\t\t} else if (pp.Type == PreProcessorDirectiveType.Endregion) {\n\t\t\t\t\t\tif (d == 0) {\n\t\t\t\t\t\t\treturn pp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextNode = nextNode.GetNextNode();\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic PreProcessorDirective GetStartDirective(PreProcessorDirective directive)\n\t\t{\n\t\t\tvar nextNode = directive.GetPrevNode();\n\t\t\tint d = 0;\n\t\t\twhile (nextNode != null) {\n\t\t\t\tvar pp = nextNode as PreProcessorDirective;\n\t\t\t\tif (pp != null) {\n\t\t\t\t\tif (pp.Type == PreProcessorDirectiveType.Endregion) {\n\t\t\t\t\t\td++;\n\t\t\t\t\t} else if (pp.Type == PreProcessorDirectiveType.Region) {\n\t\t\t\t\t\tif (d == 0) {\n\t\t\t\t\t\t\treturn pp;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextNode = nextNode.GetPrevNode();\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar directive = GetDirective(context);\n\t\t\tif (directive == null)\n\t\t\t\tyield break;\n\n\t\t\tPreProcessorDirective endDirective = directive.Type == PreProcessorDirectiveType.Region ? GetEndDirective(directive) : GetStartDirective(directive);\n\n\t\t\tif (endDirective == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction (context.TranslateString(\"Remove region\"), script => {\n\t\t\t\tscript.Remove (directive);\n\t\t\t\tscript.Remove (endDirective);\n\t\t\t}, directive);\n\t\t}\n\t\t\n\t\tstatic PreProcessorDirective GetDirective (RefactoringContext context)\n\t\t{\n\t\t\tvar directive = context.GetNode<PreProcessorDirective> ();\n\t\t\tif (directive == null || directive.Type != PreProcessorDirectiveType.Region && directive.Type != PreProcessorDirectiveType.Endregion)\n\t\t\t\treturn null;\n\t\t\treturn directive;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ReplaceAssignmentWithPostfixExpressionAction.cs",
    "content": "//\n// ReplaceAssignmentWithPostfixExpressionAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Replace assignment with postfix expression\", Description = \"Replace assignment with postfix expression\")]\n\tpublic class ReplaceAssignmentWithPostfixExpressionAction : SpecializedCodeAction<AssignmentExpression>\n\t{\n\t\tstatic readonly AstNode onePattern = PatternHelper.OptionalParentheses(new PrimitiveExpression (1));\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, AssignmentExpression node)\n\t\t{\n\t\t\tif (!node.OperatorToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tnode = ReplaceWithOperatorAssignmentAction.CreateAssignment(node) ?? node;\n\t\t\tif (node.Operator != AssignmentOperatorType.Add && node.Operator != AssignmentOperatorType.Subtract || !onePattern.IsMatch (node.Right))\n\t\t\t\treturn null;\n\t\t\tstring desc = node.Operator == AssignmentOperatorType.Add ? context.TranslateString(\"Replace with '{0}++'\") : context.TranslateString(\"Replace with '{0}--'\");\n\t\t\treturn new CodeAction(\n\t\t\t\tstring.Format(desc, node.Left),\n\t\t\t\ts => s.Replace(node, new UnaryOperatorExpression(\n\t\t\t\t\tnode.Operator == AssignmentOperatorType.Add ? UnaryOperatorType.PostIncrement : UnaryOperatorType.PostDecrement,\n\t\t\t\t\tnode.Left.Clone()\n\t\t\t\t)),\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ReplaceEmptyStringAction.cs",
    "content": "﻿// \n// ReplaceEmptyString.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Use string.Empty\", Description = \"Replaces \\\"\\\" with string.Empty\")]\n\tpublic class ReplaceEmptyStringAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar expr = GetEmptyString(context);\n\t\t\tif (expr == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tyield return new CodeAction(context.TranslateString(\"Use string.Empty\"), script => {\n\t\t\t\tscript.Replace(expr, new PrimitiveType (\"string\").Member(\"Empty\"));\n\t\t\t}, expr);\n\t\t}\n\t\t\n\t\tstatic PrimitiveExpression GetEmptyString (RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<PrimitiveExpression> ();\n\t\t\tif (node == null || !(node.Value is string) || node.Value.ToString () != \"\")\n\t\t\t\treturn null;\n\t\t\treturn  node;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ReplaceOperatorAssignmentWithAssignmentAction.cs",
    "content": "//\n// ReplaceOperatorAssignmentWithAssignmentAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Replace operator assignment with assignment\", Description = \"Replace operator assignment with assignment\")]\n\tpublic class ReplaceOperatorAssignmentWithAssignmentAction : SpecializedCodeAction<AssignmentExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, AssignmentExpression node)\n\t\t{\n\t\t\tif (!node.OperatorToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tvar op = GetAssignmentOperator(node.Operator);\n\t\t\tif (op == BinaryOperatorType.Any)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Replace with '='\"),\n\t\t\t\ts => s.Replace(\n\t\t\t\t\tnode,\n\t\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\t\tnode.Left.Clone(), \n\t\t\t\t\t\tnew BinaryOperatorExpression(node.Left.Clone(), op, node.Right.Clone())\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\n\t\tstatic BinaryOperatorType GetAssignmentOperator(AssignmentOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase AssignmentOperatorType.BitwiseAnd:\n\t\t\t\t\treturn BinaryOperatorType.BitwiseAnd;\n\t\t\t\tcase AssignmentOperatorType.BitwiseOr:\n\t\t\t\t\treturn BinaryOperatorType.BitwiseOr;\n\t\t\t\tcase AssignmentOperatorType.ExclusiveOr:\n\t\t\t\t\treturn BinaryOperatorType.ExclusiveOr;\n\t\t\t\tcase AssignmentOperatorType.Add:\n\t\t\t\t\treturn BinaryOperatorType.Add;\n\t\t\t\tcase AssignmentOperatorType.Subtract:\n\t\t\t\t\treturn BinaryOperatorType.Subtract;\n\t\t\t\tcase AssignmentOperatorType.Multiply:\n\t\t\t\t\treturn BinaryOperatorType.Multiply;\n\t\t\t\tcase AssignmentOperatorType.Divide:\n\t\t\t\t\treturn BinaryOperatorType.Divide;\n\t\t\t\tcase AssignmentOperatorType.Modulus:\n\t\t\t\t\treturn BinaryOperatorType.Modulus;\n\t\t\t\tcase AssignmentOperatorType.ShiftLeft:\n\t\t\t\t\treturn BinaryOperatorType.ShiftLeft;\n\t\t\t\tcase AssignmentOperatorType.ShiftRight:\n\t\t\t\t\treturn BinaryOperatorType.ShiftRight;\n\t\t\t\tdefault:\n\t\t\t\t\treturn BinaryOperatorType.Any;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ReplacePostfixExpressionWithAssignmentAction.cs",
    "content": "//\n// ReplacePostfixExpressionWithAssignmentAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Replace postfix expression with assignment\", Description = \"Replace postfix expression with assignment\")]\n\tpublic class ReplacePostfixExpressionWithAssignmentAction : SpecializedCodeAction<UnaryOperatorExpression>\n\t{\n\t\tprotected override CodeAction GetAction(RefactoringContext context, UnaryOperatorExpression node)\n\t\t{\n\t\t\tif (node.Operator != UnaryOperatorType.PostIncrement && node.Operator != UnaryOperatorType.PostDecrement)\n\t\t\t\treturn null;\n\t\t\tstring desc = node.Operator == UnaryOperatorType.PostIncrement ? context.TranslateString(\"Replace with '{0} += 1'\") : context.TranslateString(\"Replace with '{0} -= 1'\");\n\t\t\treturn new CodeAction(\n\t\t\t\tstring.Format(desc, CSharpUtil.GetInnerMostExpression(node.Expression)),\n\t\t\t\ts => s.Replace(node, new AssignmentExpression (\n\t\t\t\t\tCSharpUtil.GetInnerMostExpression(node.Expression).Clone(),\n\t\t\t\t\tnode.Operator == UnaryOperatorType.PostIncrement ? AssignmentOperatorType.Add : AssignmentOperatorType.Subtract,\n\t\t\t\t\tnew PrimitiveExpression(1)\n\t\t\t\t)),\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ReplaceWithOperatorAssignmentAction.cs",
    "content": "//\n// ReplaceWithOperatorAssignmentAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Replace assignment with operator assignment\", Description = \"Replace assignment with operator assignment\")]\n\tpublic class ReplaceWithOperatorAssignmentAction : SpecializedCodeAction<AssignmentExpression>\n\t{\n\t\tinternal static AssignmentExpression CreateAssignment(AssignmentExpression node)\n\t\t{\n\t\t\tvar bop = node.Right as BinaryOperatorExpression;\n\t\t\tif (bop == null)\n\t\t\t\treturn null;\n\t\t\tvar outerLeft = GetOuterLeft(bop);\n\t\t\tif (!outerLeft.IsMatch(node.Left))\n\t\t\t\treturn null;\n\t\t\tvar op = GetAssignmentOperator(bop.Operator);\n\t\t\tif (op == AssignmentOperatorType.Any)\n\t\t\t\treturn null;\n\t\t\treturn new AssignmentExpression(node.Left.Clone(), op, SplitIfAction.GetRightSide((BinaryOperatorExpression)outerLeft.Parent));\n\t\t}\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, AssignmentExpression node)\n\t\t{\n\t\t\tif (!node.OperatorToken.Contains(context.Location))\n\t\t\t\treturn null;\n\n\t\t\tvar ae = CreateAssignment(node);\n\t\t\tif (ae == null)\n\t\t\t\treturn null;\n\t\t\treturn new CodeAction (\n\t\t\t\tstring.Format(context.TranslateString(\"Replace with '{0}='\"), ((BinaryOperatorExpression)node.Right).OperatorToken),\n\t\t\t\ts => s.Replace(node, ae),\n\t\t\t\tnode.OperatorToken\n\t\t\t);\n\t\t}\n\n\t\tstatic AssignmentOperatorType GetAssignmentOperator(BinaryOperatorType op)\n\t\t{\n\t\t\tswitch (op) {\n\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\treturn AssignmentOperatorType.BitwiseAnd;\n\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\treturn AssignmentOperatorType.BitwiseOr;\n\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\treturn AssignmentOperatorType.ExclusiveOr;\n\t\t\t\tcase BinaryOperatorType.Add:\n\t\t\t\t\treturn AssignmentOperatorType.Add;\n\t\t\t\tcase BinaryOperatorType.Subtract:\n\t\t\t\t\treturn AssignmentOperatorType.Subtract;\n\t\t\t\tcase BinaryOperatorType.Multiply:\n\t\t\t\t\treturn AssignmentOperatorType.Multiply;\n\t\t\t\tcase BinaryOperatorType.Divide:\n\t\t\t\t\treturn AssignmentOperatorType.Divide;\n\t\t\t\tcase BinaryOperatorType.Modulus:\n\t\t\t\t\treturn AssignmentOperatorType.Modulus;\n\t\t\t\tcase BinaryOperatorType.ShiftLeft:\n\t\t\t\t\treturn AssignmentOperatorType.ShiftLeft;\n\t\t\t\tcase BinaryOperatorType.ShiftRight:\n\t\t\t\t\treturn AssignmentOperatorType.ShiftRight;\n\t\t\t\tdefault:\n\t\t\t\t\treturn AssignmentOperatorType.Any;\n\t\t\t}\n\t\t}\n\n\t\tstatic Expression GetOuterLeft (BinaryOperatorExpression bop)\n\t\t{\n\t\t\tvar leftBop = bop.Left as BinaryOperatorExpression;\n\t\t\tif (leftBop != null && bop.Operator == leftBop.Operator)\n\t\t\t\treturn GetOuterLeft(leftBop);\n\t\t\treturn bop.Left;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ReverseDirectionForForLoopAction.cs",
    "content": "//\n// ReverseDirectionForForLoopAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Reverse the direction of a for loop\", Description = \"Reverse the direction of a for loop\")]\n\tpublic class ReverseDirectionForForLoopAction : SpecializedCodeAction<ForStatement>\n\t{\n\t\tstatic bool? IsForward(ExpressionStatement statement, string name, out Expression step)\n\t\t{\n\t\t\tstep = null;\n\t\t\tif (statement == null)\n\t\t\t\treturn null;\n\n\t\t\tvar forwardPattern = new Choice {\n\t\t\t\tPatternHelper.OptionalParentheses(new UnaryOperatorExpression (UnaryOperatorType.Increment, new IdentifierExpression(name))),\n\t\t\t\tPatternHelper.OptionalParentheses(new UnaryOperatorExpression (UnaryOperatorType.PostIncrement, new IdentifierExpression(name))),\n\t\t\t\tPatternHelper.OptionalParentheses(new AssignmentExpression (new IdentifierExpression(name), AssignmentOperatorType.Add, PatternHelper.OptionalParentheses(new AnyNode(\"step\"))))\n\t\t\t};\n\t\t\tvar match = forwardPattern.Match(statement.Expression);\n\t\t\tif (match.Success) {\n\t\t\t\tstep = match.Get<Expression>(\"step\").FirstOrDefault();\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar backwardPattern = new Choice {\n\t\t\t\tPatternHelper.OptionalParentheses(new UnaryOperatorExpression (UnaryOperatorType.Decrement, new IdentifierExpression(name))),\n\t\t\t\tPatternHelper.OptionalParentheses(new UnaryOperatorExpression (UnaryOperatorType.PostDecrement, new IdentifierExpression(name))),\n\t\t\t\tPatternHelper.OptionalParentheses(new AssignmentExpression (new IdentifierExpression(name), AssignmentOperatorType.Subtract, PatternHelper.OptionalParentheses(new AnyNode(\"step\"))))\n\t\t\t};\n\n\t\t\tmatch = backwardPattern.Match(statement.Expression);\n\t\t\tif (match.Success) {\n\t\t\t\tstep = match.Get<Expression>(\"step\").FirstOrDefault();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tExpression GetNewCondition(Expression condition, VariableInitializer initializer, bool? direction, Expression step, out Expression newInitializer)\n\t\t{\n\t\t\tvar name = initializer.Name;\n\t\t\tnewInitializer = null;\n\t\t\tvar bOp = condition as BinaryOperatorExpression;\n\t\t\tif (bOp == null || direction == null)\n\t\t\t\treturn null;\n\t\t\tif (direction == true) {\n\t\t\t\tvar upwardPattern = new Choice {\n\t\t\t\t\tPatternHelper.OptionalParentheses(new BinaryOperatorExpression(PatternHelper.OptionalParentheses(new IdentifierExpression(name)), BinaryOperatorType.LessThan, PatternHelper.OptionalParentheses(new AnyNode(\"bound\")))),\n\t\t\t\t\tPatternHelper.OptionalParentheses(new BinaryOperatorExpression(PatternHelper.OptionalParentheses(new AnyNode(\"bound\")), BinaryOperatorType.GreaterThan, PatternHelper.OptionalParentheses(new IdentifierExpression(name))))\n\t\t\t\t};\n\t\t\t\tvar upMatch = upwardPattern.Match(condition);\n\t\t\t\tif (upMatch.Success) {\n\t\t\t\t\tvar bound = upMatch.Get<Expression>(\"bound\").FirstOrDefault();\n\t\t\t\t\tnewInitializer = direction == true ? Subtract(bound, step) : bound.Clone();\n\t\t\t\t\treturn GetNewBound(name, false, initializer.Initializer.Clone(), step);\n\t\t\t\t}\n\n\t\t\t\tvar altUpwardPattern = new Choice {\n\t\t\t\t\tPatternHelper.OptionalParentheses(new BinaryOperatorExpression(PatternHelper.OptionalParentheses(new IdentifierExpression(name)), BinaryOperatorType.LessThanOrEqual, PatternHelper.OptionalParentheses(new AnyNode(\"bound\")))),\n\t\t\t\t\tPatternHelper.OptionalParentheses(new BinaryOperatorExpression(PatternHelper.OptionalParentheses(new AnyNode(\"bound\")), BinaryOperatorType.GreaterThanOrEqual, PatternHelper.OptionalParentheses(new IdentifierExpression(name))))\n\t\t\t\t};\n\t\t\t\tvar altUpMatch = altUpwardPattern.Match(condition);\n\t\t\t\tif (altUpMatch.Success) {\n\t\t\t\t\tvar bound = altUpMatch.Get<Expression>(\"bound\").FirstOrDefault();\n\t\t\t\t\tnewInitializer = bound.Clone();\n\t\t\t\t\treturn GetNewBound(name, false, initializer.Initializer.Clone(), step);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar downPattern = new Choice {\n\t\t\t\tPatternHelper.OptionalParentheses(new BinaryOperatorExpression(PatternHelper.OptionalParentheses(new IdentifierExpression(name)), BinaryOperatorType.GreaterThanOrEqual, PatternHelper.OptionalParentheses(new AnyNode(\"bound\")))),\n\t\t\t\tPatternHelper.OptionalParentheses(new BinaryOperatorExpression(PatternHelper.OptionalParentheses(new AnyNode(\"bound\")), BinaryOperatorType.LessThanOrEqual, PatternHelper.OptionalParentheses(new IdentifierExpression(name))))\n\t\t\t};\n\t\t\tvar downMatch = downPattern.Match(condition);\n\t\t\tif (!downMatch.Success)\n\t\t\t\treturn null;\n\t\t\tvar bound2 = downMatch.Get<Expression>(\"bound\").FirstOrDefault();\n\t\t\tnewInitializer = direction == true ? Subtract(bound2, step) : bound2.Clone();\n\t\t\treturn GetNewBound(name, true, initializer.Initializer.Clone(), step);\n\t\t}\n\n\t\tstatic readonly AstNode zeroExpr = new PrimitiveExpression(0);\n\t\tstatic readonly AstNode oneExpr = new PrimitiveExpression(1);\n\n\t\tExpression Subtract(Expression expr, Expression step)\n\t\t{\n\t\t\tif (step != null && CSharpUtil.GetInnerMostExpression(expr).IsMatch(CSharpUtil.GetInnerMostExpression(step)))\n\t\t\t\treturn new PrimitiveExpression(0);\n\n\t\t\tvar pe = expr as PrimitiveExpression;\n\t\t\tif (pe != null) {\n\t\t\t\tif (step == null)\n\t\t\t\t\treturn new PrimitiveExpression((int)pe.Value - 1);\n\t\t\t\tvar stepExpr = step as PrimitiveExpression;\n\t\t\t\tif (stepExpr != null)\n\t\t\t\t\treturn new PrimitiveExpression((int)pe.Value - (int)stepExpr.Value);\n\t\t\t} \n\n\t\t\tvar bOp = expr as BinaryOperatorExpression;\n\t\t\tif (bOp != null) {\n\t\t\t\tif (bOp.Operator == BinaryOperatorType.Subtract) {\n\t\t\t\t\tvar right = Add(bOp.Right, step);\n\t\t\t\t\tif (zeroExpr.IsMatch(right))\n\t\t\t\t\t\treturn bOp.Left.Clone();\n\t\t\t\t\treturn new BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.Subtract, right);\n\t\t\t\t}\n\t\t\t\tif (bOp.Operator == BinaryOperatorType.Add) {\n\t\t\t\t\tvar right = Subtract(bOp.Right, step);\n\t\t\t\t\tif (zeroExpr.IsMatch(right))\n\t\t\t\t\t\treturn bOp.Left.Clone();\n\t\t\t\t\treturn new BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.Add, Subtract(bOp.Right, step));\n\t\t\t\t}\n\t\t\t} \n\t\t\tif (step == null)\n\t\t\t\treturn new BinaryOperatorExpression(expr.Clone(), BinaryOperatorType.Subtract, new PrimitiveExpression(1));\n\n\t\t\treturn new BinaryOperatorExpression(expr.Clone(), BinaryOperatorType.Subtract, CSharpUtil.AddParensForUnaryExpressionIfRequired(step.Clone()));\n\t\t}\n\n\t\tExpression Add(Expression expr, Expression step)\n\t\t{\n\t\t\tvar pe = expr as PrimitiveExpression;\n\t\t\tif (pe != null) {\n\t\t\t\tif (step == null)\n\t\t\t\t\treturn new PrimitiveExpression((int)pe.Value + 1);\n\t\t\t\tvar stepExpr = step as PrimitiveExpression;\n\t\t\t\tif (stepExpr != null)\n\t\t\t\t\treturn new PrimitiveExpression((int)pe.Value + (int)stepExpr.Value);\n\t\t\t} \n\n\t\t\tvar bOp = expr as BinaryOperatorExpression;\n\t\t\tif (bOp != null) {\n\t\t\t\tif (bOp.Operator == BinaryOperatorType.Add) {\n\t\t\t\t\tvar right = Add(bOp.Right, step);\n\t\t\t\t\tif (zeroExpr.IsMatch(right))\n\t\t\t\t\t\treturn bOp.Left.Clone();\n\t\t\t\t\treturn new BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.Add, right);\n\t\t\t\t}\n\t\t\t\tif (bOp.Operator == BinaryOperatorType.Subtract) {\n\t\t\t\t\tvar right = Subtract(bOp.Right, step);\n\t\t\t\t\tif (zeroExpr.IsMatch(right))\n\t\t\t\t\t\treturn bOp.Left.Clone();\n\t\t\t\t\treturn new BinaryOperatorExpression(bOp.Left.Clone(), BinaryOperatorType.Subtract, right);\n\t\t\t\t}\n\t\t\t} \n\t\t\tif (step == null)\n\t\t\t\treturn new BinaryOperatorExpression(expr.Clone(), BinaryOperatorType.Add, new PrimitiveExpression(1));\n\n\t\t\treturn new BinaryOperatorExpression(expr.Clone(), BinaryOperatorType.Add, CSharpUtil.AddParensForUnaryExpressionIfRequired(step.Clone()));\n\t\t}\n\n\t\tExpression GetNewBound(string name, bool? direction, Expression initializer, Expression step)\n\t\t{\n\t\t\tif (initializer == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new BinaryOperatorExpression (\n\t\t\t\tnew IdentifierExpression (name),\n\t\t\t\tdirection == true ? BinaryOperatorType.LessThan : BinaryOperatorType.GreaterThanOrEqual,\n\t\t\t\tdirection == true ? Add(initializer, step) : initializer\n\t\t\t);\n\t\t}\n\n\t\tExpression CreateIterator(string name, bool? direction, Expression step)\n\t\t{\n\t\t\tif (direction == true) {\n\t\t\t\tif (step == null || oneExpr.IsMatch(step)) {\n\t\t\t\t\treturn new UnaryOperatorExpression(UnaryOperatorType.PostIncrement, new IdentifierExpression(name));\n\t\t\t\t}\n\t\t\t\treturn new AssignmentExpression(new IdentifierExpression(name), AssignmentOperatorType.Add, step.Clone());\n\t\t\t}\n\t\t\tif (step == null || oneExpr.IsMatch(step)) {\n\t\t\t\treturn new UnaryOperatorExpression(UnaryOperatorType.PostDecrement, new IdentifierExpression(name));\n\t\t\t}\n\t\t\treturn new AssignmentExpression(new IdentifierExpression(name), AssignmentOperatorType.Subtract, step.Clone());\n\t\t}\n\n\t\tprotected override CodeAction GetAction(RefactoringContext context, ForStatement node)\n\t\t{\n\t\t\tif (!node.ForToken.Contains(context.Location))\n\t\t\t\treturn null;\n\t\t\tif (node.Initializers.Count() != 1)\n\t\t\t\treturn null;\n\t\t\tvar varDelc = node.Initializers.Single() as VariableDeclarationStatement;\n\t\t\tif (varDelc == null)\n\t\t\t\treturn null;\n\n\t\t\tif (varDelc.Variables.Count() != 1)\n\t\t\t\treturn null;\n\t\t\tvar initalizer = varDelc.Variables.First ();\n\t\t\tif (initalizer == null)\n\t\t\t\treturn null;\n\n\t\t\tif (!context.Resolve(initalizer.Initializer).Type.IsKnownType(KnownTypeCode.Int32))\n\t\t\t\treturn null;\n\n\t\t\tif (node.Iterators.Count() != 1)\n\t\t\t\treturn null;\n\t\t\tvar iterator = node.Iterators.First();\n\t\t\tExpression step;\n\t\t\tvar direction = IsForward(iterator as ExpressionStatement, initalizer.Name, out step);\n\n\t\t\tExpression newInitializer;\n\t\t\tvar newCondition = GetNewCondition(node.Condition, initalizer, direction, step, out newInitializer);\n\t\t\tif (newCondition == null)\n\t\t\t\treturn null;\n\n\t\t\treturn new CodeAction (\n\t\t\t\tcontext.TranslateString(\"Reverse 'for' loop\"),\n\t\t\t\ts => {\n\t\t\t\t\tvar newFor = new ForStatement() {\n\t\t\t\t\t\tInitializers = { new VariableDeclarationStatement(varDelc.Type.Clone(), initalizer.Name, newInitializer) },\n\t\t\t\t\t\tCondition = newCondition,\n\t\t\t\t\t\tIterators = { CreateIterator(initalizer.Name, !direction, step) },\n\t\t\t\t\t\tEmbeddedStatement = node.EmbeddedStatement.Clone()\n\t\t\t\t\t};\n\t\t\t\t\ts.Replace(node, newFor);\n\t\t\t\t},\n\t\t\t\tnode.ForToken\n\t\t\t);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SimplifyIfFlowAction.cs",
    "content": "//\n// SimplifyIfFlowAction.cs\n//\n// Author:\n//      Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Simplify if flow\", Description = \"Inverts if and reduces branching \")]\n\tpublic class SimplifyIfFlowAction : CodeActionProvider\n\t{\n\t\treadonly InsertParenthesesVisitor _insertParenthesesVisitor = new InsertParenthesesVisitor();\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar ifStatement = GetIfElseStatement(context);\n\t\t\tif (ifStatement == null)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Invert if\"), script =>\n\t\t\t{\n\t\t\t\tGenerateNewScript(script, ifStatement);\n\t\t\t}, ifStatement);\n\t\t}\n\n\t\tinternal static void InsertBody(Script script, IfElseStatement ifStatement)\n\t\t{\n\t\t\tvar ifBody = ifStatement.TrueStatement.Clone();\n\n\t\t\tif (ifBody is BlockStatement) {\n\t\t\t\tAstNode last = ifStatement;\n\t\t\t\tforeach (var stmt in ((BlockStatement)ifBody).Children) {\n\t\t\t\t\tif (stmt.Role == Roles.LBrace || stmt.Role == Roles.RBrace || stmt.Role == Roles.NewLine)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tscript.InsertAfter(last, stmt);\n\t\t\t\t\tlast = stmt;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tscript.InsertAfter(ifStatement, ifBody);\n\t\t\t}\n\t\t\tscript.FormatText(ifStatement.Parent);\n\t\t}\n\t\t\n\t\tvoid GenerateNewScript(Script script, IfElseStatement ifStatement)\n\t\t{\n\t\t\tvar mergedIfStatement = new IfElseStatement {\n\t\t\t\tCondition = CSharpUtil.InvertCondition(ifStatement.Condition),\n\t\t\t\tTrueStatement = new ReturnStatement()\n\t\t\t};\n\t\t\tmergedIfStatement.Condition.AcceptVisitor(_insertParenthesesVisitor);\n\t\t\t\n\t\t\tscript.Replace(ifStatement, mergedIfStatement);\n\n\t\t\tInsertBody(script, ifStatement);\n\t\t}\n\t\t\n\t\tstatic IfElseStatement GetIfElseStatement(RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<IfElseStatement>();\n\t\t\tif (result == null)\n\t\t\t\treturn null;\n\t\t\tif (!(result.IfToken.Contains(context.Location)\n\t\t\t\t&& !result.TrueStatement.IsNull\n\t\t\t\t&& result.FalseStatement.IsNull))\n\t\t\t\treturn null;\n\t\t\tif (!(result.Parent is BlockStatement) || !(result.Parent.Parent is MethodDeclaration))\n\t\t\t\treturn null;\n\t\t\tvar parentMethod = (MethodDeclaration)result.Parent.Parent;\n\t\t\tif (parentMethod.ReturnType.ToString() != \"void\")\n\t\t\t\treturn null;\n\t\t\tvar nextSibling = result.GetNextSibling(n => n is Statement);\n\t\t\tif (nextSibling == null)\n\t\t\t\treturn result;\n\t\t\tnextSibling = nextSibling.GetNextSibling (n => n is Statement);\n\t\t\tif (nextSibling != null)\n\t\t\t\treturn null;\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SimplifyIfInLoopsFlowAction.cs",
    "content": "//\n// SimplifyIfInLoopsFlowAction.cs\n//\n// Author:\n//      Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Simplify if flow in loops\", Description = \"Inverts if and reduces branching \")]\n\tpublic class SimplifyIfInLoopsFlowAction : CodeActionProvider\n\t{\n\t\treadonly InsertParenthesesVisitor _insertParenthesesVisitor = new InsertParenthesesVisitor();\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar ifStatement = GetIfElseStatement(context);\n\t\t\tif (ifStatement == null)\n\t\t\t\tyield break;\n\t\t\tyield return new CodeAction(context.TranslateString(\"Simplify if in loops\"), script => {\n\t\t\t\tGenerateNewScript(script, ifStatement);\n\t\t\t}, ifStatement);\n\t\t}\n\t\t\n\t\tvoid GenerateNewScript(Script script, IfElseStatement ifStatement)\n\t\t{\n\t\t\tvar mergedIfStatement = new IfElseStatement {\n\t\t\t\tCondition = CSharpUtil.InvertCondition(ifStatement.Condition),\n\t\t\t\tTrueStatement = new ContinueStatement()\n\t\t\t};\n\t\t\tmergedIfStatement.Condition.AcceptVisitor(_insertParenthesesVisitor);\n\t\t\t\n\t\t\tscript.Replace(ifStatement, mergedIfStatement);\n\t\t\t\n\t\t\tSimplifyIfFlowAction.InsertBody(script, ifStatement);\n\t\t}\n\t\t\n\t\tstatic IfElseStatement GetIfElseStatement(RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<IfElseStatement>();\n\t\t\tif (result == null)\n\t\t\t\treturn null;\n\t\t\tif (!(result.IfToken.Contains(context.Location)\n\t\t\t\t&& !result.TrueStatement.IsNull\n\t\t\t\t&& result.FalseStatement.IsNull))\n\t\t\t\treturn null;\n\t\t\tif (!(result.Parent is BlockStatement))\n\t\t\t\treturn null;\n\t\t\tvar condition = (result.Parent.Parent is WhileStatement) \n\t\t\t\t|| (result.Parent.Parent is ForeachStatement) \n\t\t\t\t|| (result.Parent.Parent is ForStatement);\n\t\t\tif (!condition)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tvar nextSibling = result.GetNextSibling(n => n is Statement);\n\t\t\tif (nextSibling == null)\n\t\t\t\treturn result;\n\t\t\tnextSibling = nextSibling.GetNextSibling (n => n is Statement);\n\t\t\tif (nextSibling != null)\n\t\t\t\treturn null;\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SortUsingsAction.cs",
    "content": "//\n// SortUsingsAction.cs\n//\n// Author:\n//      Lopatkin Ilja\n//\n// Copyright (c) 2012 Lopatkin Ilja\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Sort usings\", Description = \"Sorts usings by their origin and then alphabetically.\")]\n\tpublic class SortUsingsAction: CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar usingNode = FindUsingNodeAtCursor(context);\n\t\t\tif (usingNode == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Sort usings\"), script =>\n\t\t\t{\n\t\t\t\tvar blocks = EnumerateUsingBlocks(context.RootNode);\n\n\t\t\t\tforeach (var block in blocks)\n\t\t\t\t{\n\t\t\t\t\tvar originalNodes = block.ToArray();\n\t\t\t\t\tvar sortedNodes = UsingHelper.SortUsingBlock(originalNodes, context).ToArray();\n\n\t\t\t\t\tfor (var i = 0; i < originalNodes.Length; ++i)\n\t\t\t\t\t\tscript.Replace(originalNodes[i], sortedNodes[i].Clone());\n\t\t\t\t}\n\t\t\t}, usingNode);\n\t\t}\n\n\t\tprivate static AstNode FindUsingNodeAtCursor(RefactoringContext context)\n\t\t{\n\t\t\t// If cursor is inside using declaration\n\t\t\tvar locationAsIs = context.Location;\n\t\t\t// If cursor is at end of line with using declaration\n\t\t\tvar locationLeft = new TextLocation(locationAsIs.Line, locationAsIs.Column - 1);\n\n\t\t\tvar possibleNodes = new[] { locationAsIs, locationLeft }\n\t\t\t\t.Select(_ => context.RootNode.GetNodeAt(_, IsUsingDeclaration));\n\t\t\tvar usingNode = possibleNodes.Where(_ => _ != null).Distinct().SingleOrDefault();\n\n\t\t\treturn usingNode;\n\t\t}\n\n\t\tprivate static bool IsUsingDeclaration(AstNode node)\n\t\t{\n\t\t\treturn node is UsingDeclaration || node is UsingAliasDeclaration;\n\t\t}\n\n\t\tprivate static IEnumerable<IEnumerable<AstNode>> EnumerateUsingBlocks(AstNode root)\n\t\t{\n\t\t\tvar alreadyAddedNodes = new HashSet<AstNode>();\n\n\t\t\tforeach (var child in root.Descendants)\n\t\t\t\tif (IsUsingDeclaration(child) && !alreadyAddedNodes.Contains(child)) {\n\t\t\t\t\tvar blockNodes = EnumerateUsingBlockNodes(child);\n\n\t\t\t\t\talreadyAddedNodes.UnionWith(blockNodes);\n\t\t\t\t\tyield return blockNodes;\n\t\t\t\t}\n\t\t}\n\n\t\tprivate static IEnumerable<AstNode> EnumerateUsingBlockNodes(AstNode firstNode)\n\t\t{\n\t\t\tfor (var node = firstNode; IsUsingDeclaration(node); node = node.GetNextSibling (n => n.Role != Roles.NewLine))\n\t\t\t\tyield return node;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SpecializedCodeAction.cs",
    "content": "using System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// A specialized code action creates a code action assoziated with one special type of ast nodes.\n\t/// </summary>\n\tpublic abstract class SpecializedCodeAction<T> : CodeActionProvider where T : AstNode\n\t{\n\t\t/// <summary>\n\t\t/// Gets the action for the specified ast node.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The code action. May return <c>null</c>, if no action can be provided.\n\t\t/// </returns>\n\t\t/// <param name='context'>\n\t\t/// The refactoring conext.\n\t\t/// </param>\n\t\t/// <param name='node'>\n\t\t/// The AstNode it's ensured that the node is always != null, if called.\n\t\t/// </param>\n\t\tprotected abstract CodeAction GetAction(RefactoringContext context, T node);\n\n\t\t#region ICodeActionProvider implementation\n\t\tpublic override System.Collections.Generic.IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar node = context.GetNode<T>();\n\t\t\tif (node == null)\n\t\t\t\tyield break;\n\t\t\tvar action = GetAction(context, node);\n\t\t\tif (action == null)\n\t\t\t\tyield break;\n\t\t\tyield return action;\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SplitDeclarationAndAssignmentAction.cs",
    "content": "﻿//\n// SplitDeclarationAndAssignmentAction.cs\n// \n// SplitDeclarationAndAssignment.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Split local variable declaration and assignment\", Description = \"Splits local variable declaration and assignment.\")]\n\tpublic class SplitDeclarationAndAssignmentAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tif (context.IsSomethingSelected) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tAstType type;\n\t\t\tvar varInitializer = GetVariableDeclarationStatement(context, out type);\n\t\t\tif (varInitializer == null)\n\t\t\t\tyield break;\n\t\t\tvar statement = varInitializer.GetParent<Statement>();\n\t\t\tvar declaration = varInitializer.GetParent<VariableDeclarationStatement>();\n\t\t\tif (declaration == null || (declaration.Modifiers & Modifiers.Const) != 0)\n\t\t\t\tyield break;\n\n\t\t\tvar selectedNode = varInitializer.GetNodeAt(context.Location) ?? varInitializer;\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Split local variable declaration and assignment\"), script => {\n\t\t\t\tvar assign = new AssignmentExpression (new IdentifierExpression (varInitializer.Name), AssignmentOperatorType.Assign, varInitializer.Initializer.Clone());\n\n\t\t\t\tif (declaration != null && declaration.Type.IsVar())\n\t\t\t\t\tscript.Replace(declaration.Type, type);\n\t\t\t\tif (declaration.Parent is ForStatement) {\n\t\t\t\t\tscript.InsertBefore(statement, new VariableDeclarationStatement (type, varInitializer.Name));\n\t\t\t\t\tscript.Replace(declaration, assign);\n\t\t\t\t} else {\n\t\t\t\t\tscript.Replace(varInitializer, new IdentifierExpression (varInitializer.Name));\n\t\t\t\t\tscript.InsertAfter(statement, new ExpressionStatement (assign));\n\t\t\t\t}\n\n\t\t\t}, selectedNode);\n\t\t}\n\t\t\n\t\tstatic VariableInitializer GetVariableDeclarationStatement (RefactoringContext context, out AstType resolvedType, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tvar result = context.GetNode<VariableInitializer> ();\n\t\t\tif (result != null && !result.Initializer.IsNull && context.Location <= result.Initializer.StartLocation) {\n\t\t\t\tvar type = context.Resolve(result).Type;\n\t\t\t\tif (type.Equals(SpecialType.NullType) || type.Equals(SpecialType.UnknownType)) {\n\t\t\t\t\tresolvedType = new PrimitiveType (\"object\");\n\t\t\t\t} else {\n\t\t\t\t\tresolvedType = context.CreateShortType (type);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tresolvedType = null;\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SplitDeclarationListAction.cs",
    "content": "﻿// \n// SplitDeclarationListAction.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Split declaration list\", \n\t\tDescription = \"Split variable declaration with multiple variables into declarations with a single variable\")] \n\tpublic class SplitDeclarationListAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions (RefactoringContext context)\n\t\t{\n\t\t\t// field, local var, event, fixed var, fixed field\n\n\t\t\t// local variable\n\t\t\tvar variableDecl = context.GetNode<VariableDeclarationStatement> ();\n\t\t\tif (variableDecl != null && variableDecl.Parent is BlockStatement) {\n\t\t\t\treturn GetAction (context, variableDecl, v => v.Variables);\n\t\t\t}\n\n\t\t\t// field\n\t\t\tvar fieldDecl = context.GetNode<FieldDeclaration> ();\n\t\t\tif (fieldDecl != null)\n\t\t\t\treturn GetAction (context, fieldDecl, f => f.Variables);\n\n\t\t\t// event\n\t\t\tvar eventDecl = context.GetNode<EventDeclaration> ();\n\t\t\tif (eventDecl != null)\n\t\t\t\treturn GetAction (context, eventDecl, e => e.Variables);\n\n\t\t\t// fixed field\n\t\t\tvar fixedFieldDecl = context.GetNode<FixedFieldDeclaration> ();\n\t\t\tif (fixedFieldDecl != null)\n\t\t\t\treturn GetAction (context, fixedFieldDecl, f => f.Variables);\n\n\t\t\treturn Enumerable.Empty<CodeAction> ();\n\t\t}\n\n\t\tIEnumerable<CodeAction> GetAction<T, S> (RefactoringContext context, T decl, \n\t\t\t\t\t\t\t\t\t\t\t\t Func<T, AstNodeCollection<S>> getInitializers)\n\t\t\twhere T : AstNode\n\t\t\twhere S : AstNode\n\t\t{\n\t\t\tvar initializers = getInitializers(decl);\n\t\t\tif (initializers.Count < 2)\n\t\t\t\tyield break;\n\n\t\t\tyield return new CodeAction (context.TranslateString (\"Split declaration list\"),\n\t\t\t\tscript =>\n\t\t\t\t{\n\t\t\t\t\tvar emptyDecl = (T)decl.Clone ();\n\t\t\t\t\tgetInitializers (emptyDecl).Clear ();\n\n\t\t\t\t\tvar declList = initializers.Select (v =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar singleDecl = (T)emptyDecl.Clone ();\n\t\t\t\t\t\tgetInitializers(singleDecl).Add ((S)v.Clone ());\n\t\t\t\t\t\treturn singleDecl;\n\t\t\t\t\t});\n\n\t\t\t\t\tforeach (var singleDecl in declList)\n\t\t\t\t\t\tscript.InsertBefore (decl, singleDecl);\n\t\t\t\t\tscript.Remove (decl);\n\t\t\t\t}, decl);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SplitIfAction.cs",
    "content": "//\n// SplitIfAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction (\"Split 'if' statement\", \n\t                Description = \"Splits an if statement into two nested if statements\")] \n\tpublic class SplitIfAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions (RefactoringContext context)\n\t\t{\n\t\t\tvar ifStatement = context.GetNode<IfElseStatement>();\n\t\t\tif (ifStatement == null)\n\t\t\t\tyield break;\n\t\t\tvar bOp = ifStatement.GetNodeAt<BinaryOperatorExpression>(context.Location);\n\t\t\tif (bOp == null || !bOp.OperatorToken.Contains(context.Location))\n\t\t\t\tyield break;\n\t\t\tif (bOp.Ancestors.OfType<BinaryOperatorExpression>().Any(b => b.Operator != bOp.Operator))\n\t\t\t\tyield break;\n\t\t\tif (bOp.Operator == BinaryOperatorType.ConditionalAnd) {\n\t\t\t\tyield return CreateAndSplit(context, ifStatement, bOp);\n\t\t\t} else if (bOp.Operator == BinaryOperatorType.ConditionalOr) {\n\t\t\t\tyield return CreateOrSplit(context, ifStatement, bOp);\n\t\t\t}\n\t\t}\n\n\t\tstatic CodeAction CreateAndSplit(RefactoringContext context, IfElseStatement ifStatement, BinaryOperatorExpression bOp)\n\t\t{\n\t\t\treturn new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Split if\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar nestedIf = (IfElseStatement)ifStatement.Clone();\n\t\t\t\t\tnestedIf.Condition = GetRightSide(bOp); \n\t\t\t\t\tscript.Replace(ifStatement.Condition, GetLeftSide(bOp));\n\t\t\t\t\tscript.Replace(ifStatement.TrueStatement, new BlockStatement { nestedIf });\n\t\t\t\t},\n\t\t\t\tbOp.OperatorToken\n\t\t\t);\n\t\t}\n\n\t\tstatic CodeAction CreateOrSplit(RefactoringContext context, IfElseStatement ifStatement, BinaryOperatorExpression bOp)\n\t\t{\n\t\t\treturn new CodeAction(\n\t\t\t\tcontext.TranslateString(\"Split if\"),\n\t\t\t\tscript => {\n\t\t\t\t\tvar newElse = (IfElseStatement)ifStatement.Clone();\n\t\t\t\t\tnewElse.Condition = GetRightSide(bOp); \n\t\t\t\t\t\n\t\t\t\t\tvar newIf = (IfElseStatement)ifStatement.Clone();\n\t\t\t\t\tnewIf.Condition = GetLeftSide(bOp); \n\t\t\t\t\tnewIf.FalseStatement = newElse;\n\n\t\t\t\t\tscript.Replace(ifStatement, newIf);\n\t\t\t\t\tscript.FormatText(newIf);\n\t\t\t\t},\n\t\t\t\tbOp.OperatorToken\n\t\t\t);\n\t\t}\n\n\t\tinternal static Expression GetRightSide(BinaryOperatorExpression expression)\n\t\t{\n\t\t\tvar parent = expression.Parent as BinaryOperatorExpression;\n\t\t\tif (parent != null) {\n\t\t\t\tif (parent.Left == expression) {\n\t\t\t\t\tvar parentClone = (BinaryOperatorExpression)parent.Clone();\n\t\t\t\t\tparentClone.Left = expression.Right.Clone();\n\t\t\t\t\treturn parentClone;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn expression.Right.Clone();\n\t\t}\n\n\t\tinternal static Expression GetLeftSide(BinaryOperatorExpression expression)\n\t\t{\n\t\t\tvar parent = expression.Parent as BinaryOperatorExpression;\n\t\t\tif (parent != null) {\n\t\t\t\tif (parent.Right == expression) {\n\t\t\t\t\tvar parentClone = (BinaryOperatorExpression)parent.Clone();\n\t\t\t\t\tparentClone.Right = expression.Left.Clone();\n\t\t\t\t\treturn parentClone;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn expression.Left.Clone();\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/SplitStringAction.cs",
    "content": "﻿// \n// SplitString.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Split string literal\", Description = \"Splits string literal into two.\")]\n\tpublic class SplitStringAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tif (context.IsSomethingSelected) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tvar pexpr = context.GetNode<PrimitiveExpression>();\n\t\t\tif (pexpr == null || !(pexpr.Value is string)) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tif (pexpr.LiteralValue.StartsWith(\"@\", StringComparison.Ordinal)) {\n\t\t\t\tif (!(pexpr.StartLocation < new TextLocation(context.Location.Line, context.Location.Column - 2) &&\n\t\t\t\t\tnew TextLocation(context.Location.Line, context.Location.Column + 2) < pexpr.EndLocation)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!(pexpr.StartLocation < new TextLocation(context.Location.Line, context.Location.Column - 1) && new TextLocation(context.Location.Line, context.Location.Column + 1) < pexpr.EndLocation)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Split string literal\"), script => {\n\t\t\t\tint offset = context.GetOffset (context.Location);\n\t\t\t\tscript.InsertText (offset, pexpr.LiteralValue.StartsWith(\"@\", StringComparison.Ordinal) ? \"\\\" + @\\\"\" : \"\\\" + \\\"\");\n\t\t\t}, pexpr);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/UseAsAndNullCheckAction.cs",
    "content": "//\n// UseAsAndNullCheckAction.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Threading;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\n\t\t\"Use 'as' and null check\", \n\t\tDescription = \"Converts a 'is' into an 'as' and null check\")]\n\tpublic class UseAsAndNullCheckAction : SpecializedCodeAction<IfElseStatement>\n\t{\n\t\tstatic readonly AstNode pattern = \n\t\t\tnew IfElseStatement(\n\t\t\t\tnew NamedNode (\"isExpression\", PatternHelper.OptionalParentheses(new IsExpression(PatternHelper.OptionalParentheses(new AnyNode()), PatternHelper.AnyType()))),\n\t\t\t\tnew AnyNode(\"embedded\"),\n\t\t\t\tnew AnyNodeOrNull()\n\t\t\t);\n\n\t\tstatic readonly AstNode negatedPattern = \n\t\t\tnew IfElseStatement(\n\t\t\t\tnew UnaryOperatorExpression (UnaryOperatorType.Not, new NamedNode (\"isExpression\", PatternHelper.OptionalParentheses(new IsExpression(PatternHelper.OptionalParentheses(new AnyNode()), PatternHelper.AnyType())))),\n\t\t\t\tPatternHelper.EmbeddedStatement(new Choice { new ReturnStatement (new AnyNodeOrNull()), new BreakStatement (), new ContinueStatement () } ),\n\t\t\t\tnew AnyNodeOrNull()\n\t\t\t);\n\n\n\t\tinternal static bool IsEmbeddedStatement(AstNode stmt)\n\t\t{\n\t\t\treturn stmt.Role == Roles.EmbeddedStatement || \n\t\t\t\tstmt.Role == IfElseStatement.TrueRole || \n\t\t\t\tstmt.Role == IfElseStatement.FalseRole;\n\t\t}\n\n\t\tstatic CodeAction HandleNegatedCase(BaseRefactoringContext ctx, IfElseStatement ifElseStatement, Match match, out IsExpression isExpression, out int foundCastCount)\n\t\t{\n\t\t\tfoundCastCount = 0;\n\t\t\tvar outerIs          = match.Get<Expression>(\"isExpression\").Single();\n\t\t\tisExpression         = CSharpUtil.GetInnerMostExpression(outerIs) as IsExpression;\n\t\t\tvar obj              = CSharpUtil.GetInnerMostExpression(isExpression.Expression);\n\t\t\tvar castToType       = isExpression.Type;\n\n\t\t\tvar cast = new Choice {\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastTo(castToType.Clone())),\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastAs(castToType.Clone()))\n\t\t\t};\n\n\t\t\tvar rr = ctx.Resolve(castToType);\n\t\t\tif (rr == null || rr.IsError || rr.Type.IsReferenceType == false)\n\t\t\t\treturn null;\n\t\t\tvar foundCasts = ifElseStatement.GetParent<BlockStatement>().DescendantNodes(n => n.StartLocation >= ifElseStatement.StartLocation && !cast.IsMatch(n)).Where(n => cast.IsMatch(n)).ToList();\n\t\t\tfoundCastCount = foundCasts.Count;\n\n\t\t\treturn new CodeAction(ctx.TranslateString(\"Use 'as' and check for null\"), script =>  {\n\t\t\t\tvar varName = ctx.GetNameProposal(CreateMethodDeclarationAction.GuessNameFromType(rr.Type), ifElseStatement.StartLocation);\n\t\t\t\tvar varDec = new VariableDeclarationStatement(new PrimitiveType(\"var\"), varName, new AsExpression(obj.Clone(), castToType.Clone()));\n\t\t\t\tvar binaryOperatorIdentifier = new IdentifierExpression(varName);\n\t\t\t\tvar binaryOperatorExpression = new BinaryOperatorExpression(binaryOperatorIdentifier, BinaryOperatorType.Equality, new NullReferenceExpression());\n\t\t\t\tvar linkedNodes = new List<AstNode>();\n\t\t\t\tlinkedNodes.Add(varDec.Variables.First().NameToken);\n\t\t\t\tlinkedNodes.Add(binaryOperatorIdentifier);\n\t\t\t\tif (IsEmbeddedStatement(ifElseStatement)) {\n\t\t\t\t\tvar block = new BlockStatement();\n\t\t\t\t\tblock.Add(varDec);\n\t\t\t\t\tvar newIf = (IfElseStatement)ifElseStatement.Clone();\n\t\t\t\t\tnewIf.Condition = binaryOperatorExpression;\n\t\t\t\t\tforeach (var node in newIf.DescendantNodesAndSelf(n => !cast.IsMatch(n)).Where(n => cast.IsMatch(n))) {\n\t\t\t\t\t\tvar id = new IdentifierExpression(varName);\n\t\t\t\t\t\tlinkedNodes.Add(id);\n\t\t\t\t\t\tnode.ReplaceWith(id);\n\t\t\t\t\t}\n\t\t\t\t\tblock.Add(newIf);\n\t\t\t\t\tscript.Replace(ifElseStatement, block);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tscript.InsertBefore(ifElseStatement, varDec);\n\t\t\t\t\tscript.Replace(ifElseStatement.Condition, binaryOperatorExpression);\n\t\t\t\t\tforeach (var c in foundCasts) {\n\t\t\t\t\t\tvar id = new IdentifierExpression(varName);\n\t\t\t\t\t\tlinkedNodes.Add(id);\n\t\t\t\t\t\tscript.Replace(c, id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscript.Link(linkedNodes);\n\t\t\t}, isExpression.IsToken);\n\n\t\t}\n\n\t\tinternal static CodeAction ScanIfElse (BaseRefactoringContext ctx, IfElseStatement ifElseStatement, out IsExpression isExpression, out int foundCastCount)\n\t\t{\n\t\t\tfoundCastCount = 0;\n\t\t\tvar match = pattern.Match(ifElseStatement);\n\t\t\tif (!match.Success) {\n\t\t\t\tmatch = negatedPattern.Match(ifElseStatement);\n\t\t\t\tif (match.Success)\n\t\t\t\t\treturn HandleNegatedCase(ctx, ifElseStatement, match, out isExpression, out foundCastCount);\n\t\t\t\tisExpression = null;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar outerIs          = match.Get<Expression>(\"isExpression\").Single();\n\t\t\tisExpression         = CSharpUtil.GetInnerMostExpression(outerIs) as IsExpression;\n\t\t\tvar obj              = CSharpUtil.GetInnerMostExpression(isExpression.Expression);\n\t\t\tvar castToType       = isExpression.Type;\n\t\t\tvar embeddedStatment = match.Get<Statement>(\"embedded\").Single();\n\n\t\t\tvar cast = new Choice {\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastTo(castToType.Clone())),\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastAs(castToType.Clone()))\n\t\t\t};\n\n\t\t\tvar rr = ctx.Resolve(castToType);\n\t\t\tif (rr == null || rr.IsError || rr.Type.IsReferenceType == false)\n\t\t\t\treturn null;\n\t\t\tvar foundCasts = embeddedStatment.DescendantNodesAndSelf(n => !cast.IsMatch(n)).Where(n => cast.IsMatch(n)).ToList();\n\t\t\tfoundCastCount = foundCasts.Count;\n\n\t\t\treturn new CodeAction(ctx.TranslateString(\"Use 'as' and check for null\"), script =>  {\n\t\t\t\tvar varName = ctx.GetNameProposal(CreateMethodDeclarationAction.GuessNameFromType(rr.Type), ifElseStatement.StartLocation);\n\t\t\t\tvar varDec = new VariableDeclarationStatement(new PrimitiveType(\"var\"), varName, new AsExpression(obj.Clone(), castToType.Clone()));\n\t\t\t\tvar binaryOperatorIdentifier = new IdentifierExpression(varName);\n\t\t\t\tvar binaryOperatorExpression = new BinaryOperatorExpression(binaryOperatorIdentifier, BinaryOperatorType.InEquality, new NullReferenceExpression());\n\t\t\t\tvar linkedNodes = new List<AstNode>();\n\t\t\t\tlinkedNodes.Add(varDec.Variables.First().NameToken);\n\t\t\t\tlinkedNodes.Add(binaryOperatorIdentifier);\n\t\t\t\tif (IsEmbeddedStatement(ifElseStatement)) {\n\t\t\t\t\tvar block = new BlockStatement();\n\t\t\t\t\tblock.Add(varDec);\n\t\t\t\t\tvar newIf = (IfElseStatement)ifElseStatement.Clone();\n\t\t\t\t\tnewIf.Condition = binaryOperatorExpression;\n\t\t\t\t\tforeach (var node in newIf.DescendantNodesAndSelf(n => !cast.IsMatch(n)).Where(n => cast.IsMatch(n))) {\n\t\t\t\t\t\tvar id = new IdentifierExpression(varName);\n\t\t\t\t\t\tlinkedNodes.Add(id);\n\t\t\t\t\t\tnode.ReplaceWith(id);\n\t\t\t\t\t}\n\t\t\t\t\tblock.Add(newIf);\n\t\t\t\t\tscript.Replace(ifElseStatement, block);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tscript.InsertBefore(ifElseStatement, varDec);\n\t\t\t\t\tscript.Replace(outerIs, binaryOperatorExpression);\n\t\t\t\t\tforeach (var c in foundCasts) {\n\t\t\t\t\t\tvar id = new IdentifierExpression(varName);\n\t\t\t\t\t\tlinkedNodes.Add(id);\n\t\t\t\t\t\tscript.Replace(c, id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscript.Link(linkedNodes);\n\t\t\t}, isExpression.IsToken);\n\n\t\t}\n\n\t\tstatic List<AstNode> SearchCasts(RefactoringContext ctx, Statement embeddedStatement, Expression obj, AstType type, out ResolveResult rr)\n\t\t{\n\t\t\tvar cast = new Choice {\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastTo(type.Clone())),\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastAs(type.Clone()))\n\t\t\t};\n\n\t\t\trr = ctx.Resolve(type);\n\t\t\tif (rr == null || rr.IsError)\n\t\t\t\treturn null;\n\t\t\treturn embeddedStatement.DescendantNodesAndSelf(n => !cast.IsMatch(n)).Where(n => cast.IsMatch(n)).ToList();\n\t\t}\n\n\t\tprotected override CodeAction GetAction(RefactoringContext ctx, IfElseStatement ifElseStatement)\n\t\t{\n\t\t\tvar isExpr = ctx.GetNode<IsExpression>();\n\t\t\tif (isExpr == null || !isExpr.IsToken.Contains(ctx.Location))\n\t\t\t\treturn null;\n\n\t\t\tint foundCasts;\n\t\t\tvar action = ScanIfElse(ctx, ifElseStatement, out isExpr, out foundCasts);\n\t\t\tif (action != null)\n\t\t\t\treturn action;\n\n\t\t\tisExpr = ctx.GetNode<IsExpression>();\n\t\t\tvar node = isExpr.Parent;\n\t\t\twhile (node is ParenthesizedExpression)\n\t\t\t\tnode = node.Parent;\n\t\t\tvar uOp = node as UnaryOperatorExpression;\n\t\t\tif (uOp != null && uOp.Operator == UnaryOperatorType.Not) {\n\t\t\t\tvar rr = ctx.Resolve(isExpr.Type);\n\t\t\t\tif (rr == null || rr.IsError || rr.Type.IsReferenceType == false)\n\t\t\t\t\treturn null;\n\n\t\t\t\treturn new CodeAction(ctx.TranslateString(\"Use 'as' and check for null\"), script =>  {\n\t\t\t\t\tvar varName = ctx.GetNameProposal(CreateMethodDeclarationAction.GuessNameFromType(rr.Type), ifElseStatement.StartLocation);\n\t\t\t\t\tvar varDec = new VariableDeclarationStatement(new PrimitiveType(\"var\"), varName, new AsExpression(isExpr.Expression.Clone(), isExpr.Type.Clone()));\n\t\t\t\t\tvar binaryOperatorIdentifier = new IdentifierExpression(varName);\n\t\t\t\t\tvar binaryOperatorExpression = new BinaryOperatorExpression(binaryOperatorIdentifier, BinaryOperatorType.Equality, new NullReferenceExpression());\n\t\t\t\t\tif (IsEmbeddedStatement(ifElseStatement)) {\n\t\t\t\t\t\tvar block = new BlockStatement();\n\t\t\t\t\t\tblock.Add(varDec);\n\t\t\t\t\t\tvar newIf = (IfElseStatement)ifElseStatement.Clone();\n\t\t\t\t\t\tnewIf.Condition = binaryOperatorExpression;\n\t\t\t\t\t\tblock.Add(newIf);\n\t\t\t\t\t\tscript.Replace(ifElseStatement, block);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tscript.InsertBefore(ifElseStatement, varDec);\n\t\t\t\t\t\tscript.Replace(uOp, binaryOperatorExpression);\n\t\t\t\t\t}\n\t\t\t\t}, isExpr.IsToken);\n\t\t\t}\n\n\t\t\tvar obj = isExpr.Expression;\n\t\t\tvar castToType = isExpr.Type;\n\n\t\t\tvar cast = new Choice {\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastTo(castToType.Clone())),\n\t\t\t\tPatternHelper.OptionalParentheses(PatternHelper.OptionalParentheses(obj.Clone()).CastAs(castToType.Clone()))\n\t\t\t};\n\n\t\t\tvar rr2 = ctx.Resolve(castToType);\n\t\t\tif (rr2 == null || rr2.IsError || rr2.Type.IsReferenceType == false)\n\t\t\t\treturn null;\n\t\t\tvar foundCasts2 = isExpr.GetParent<Statement>().DescendantNodesAndSelf(n => !cast.IsMatch(n)).Where(n => isExpr.StartLocation < n.StartLocation && cast.IsMatch(n)).ToList();\n\n\t\t\treturn new CodeAction(ctx.TranslateString(\"Use 'as' and check for null\"), script =>  {\n\t\t\t\tvar varName = ctx.GetNameProposal(CreateMethodDeclarationAction.GuessNameFromType(rr2.Type), ifElseStatement.StartLocation);\n\t\t\t\tvar varDec = new VariableDeclarationStatement(new PrimitiveType(\"var\"), varName, new AsExpression(obj.Clone(), castToType.Clone()));\n\t\t\t\tvar binaryOperatorIdentifier = new IdentifierExpression(varName);\n\t\t\t\tvar binaryOperatorExpression = new BinaryOperatorExpression(binaryOperatorIdentifier, BinaryOperatorType.InEquality, new NullReferenceExpression());\n\t\t\t\tvar linkedNodes = new List<AstNode>();\n\t\t\t\tlinkedNodes.Add(varDec.Variables.First().NameToken);\n\t\t\t\tlinkedNodes.Add(binaryOperatorIdentifier);\n\t\t\t\tif (IsEmbeddedStatement(ifElseStatement)) {\n\t\t\t\t\tvar block = new BlockStatement();\n\t\t\t\t\tblock.Add(varDec);\n\t\t\t\t\tvar newIf = (IfElseStatement)ifElseStatement.Clone();\n\t\t\t\t\tnewIf.Condition = binaryOperatorExpression;\n\t\t\t\t\tforeach (var node2 in newIf.DescendantNodesAndSelf(n => !cast.IsMatch(n)).Where(n => cast.IsMatch(n))) {\n\t\t\t\t\t\tvar id = new IdentifierExpression(varName);\n\t\t\t\t\t\tlinkedNodes.Add(id);\n\t\t\t\t\t\tnode2.ReplaceWith(id);\n\t\t\t\t\t}\n\t\t\t\t\tblock.Add(newIf);\n\t\t\t\t\tscript.Replace(ifElseStatement, block);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tscript.InsertBefore(ifElseStatement, varDec);\n\t\t\t\t\tscript.Replace(isExpr, binaryOperatorExpression);\n\t\t\t\t\tforeach (var c in foundCasts2) {\n\t\t\t\t\t\tvar id = new IdentifierExpression(varName);\n\t\t\t\t\t\tlinkedNodes.Add(id);\n\t\t\t\t\t\tscript.Replace(c, id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tscript.Link(linkedNodes);\n\t\t\t}, isExpr.IsToken);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/UseExplicitTypeAction.cs",
    "content": "﻿// \n// UseExplicitType.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Use explicit type\", Description = \"Converts local variable declaration to be explicit typed.\")]\n\tpublic class UseExplicitTypeAction: CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tvar varDecl = GetVariableDeclarationStatement(context);\n\t\t\tAstNode node;\n\t\t\tIType type;\n\t\t\tif (varDecl != null) {\n\t\t\t\ttype = context.Resolve(varDecl.Variables.First().Initializer).Type;\n\t\t\t\tnode = varDecl;\n\t\t\t} else {\n\t\t\t\tvar foreachStatement = GetForeachStatement(context);\n\t\t\t\tif (foreachStatement == null) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t\ttype = context.Resolve(foreachStatement.VariableType).Type;\n\t\t\t\tnode = foreachStatement;\n\t\t\t}\n\n\t\t\tif (!(!type.Equals(SpecialType.NullType) && !type.Equals(SpecialType.UnknownType) && !ContainsAnonymousType(type))) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tyield return new CodeAction (context.TranslateString(\"Use explicit type\"), script => {\n\t\t\t\tif (varDecl != null) {\n\t\t\t\t\tscript.Replace (varDecl.Type, context.CreateShortType (type));\n\t\t\t\t} else {\n\t\t\t\t\tvar foreachStatement = GetForeachStatement (context);\n\t\t\t\t\tscript.Replace (foreachStatement.VariableType, context.CreateShortType (type));\n\t\t\t\t}\n\t\t\t}, node);\n\t\t}\n\n\t\tstatic bool ContainsAnonymousType (IType type)\n\t\t{\n\t\t\tif (type.Kind == TypeKind.Anonymous)\n\t\t\t\treturn true;\n\n\t\t\tvar arrayType = type as ArrayType;\n\t\t\treturn arrayType != null && ContainsAnonymousType (arrayType.ElementType);\n\t\t}\n\n\t\tstatic VariableDeclarationStatement GetVariableDeclarationStatement (RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<VariableDeclarationStatement> ();\n\t\t\tif (result != null && result.Variables.Count == 1 && !result.Variables.First ().Initializer.IsNull && result.Type.Contains (context.Location.Line, context.Location.Column) && result.Type.IsVar ()) {\n\t\t\t\tif (context.Resolve (result.Variables.First ().Initializer) == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tstatic ForeachStatement GetForeachStatement (RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<ForeachStatement> ();\n\t\t\tif (result != null && result.VariableType.Contains (context.Location) && result.VariableType.IsVar ())\n\t\t\t\treturn result;\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/UseStringFormatAction.cs",
    "content": "﻿//\n// UseStringFormatAction.cs\n//\n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n//\n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Use string.Format()\",\n\t                Description = \"Convert concatenation of strings and objects to string.Format()\")]\n\tpublic class UseStringFormatAction : CodeActionProvider\n\t{\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\t// NOTE: @, multiple occurance\n\t\t\tvar node = context.GetNode();\n\t\t\twhile (node != null && !IsStringConcatenation(context, node as BinaryOperatorExpression))\n\t\t\t\tnode = node.Parent;\n\n\t\t\tif (node == null)\n\t\t\t\tyield break;\n\n\t\t\tvar expr = (BinaryOperatorExpression)node;\n\t\t\tvar parent = expr.Parent as BinaryOperatorExpression;\n\t\t\twhile (parent != null && parent.Operator == BinaryOperatorType.Add) {\n\t\t\t\texpr = parent;\n\t\t\t\tparent = expr.Parent as BinaryOperatorExpression;\n\t\t\t}\n\n\t\t\tyield return new CodeAction(context.TranslateString(\"Use 'string.Format()'\"),\n\t\t\t                             script => {\n\t\t\t\tvar stringType = new PrimitiveType(\"string\");\n\t\t\t\tvar formatInvocation = stringType.Invoke(\"Format\");\n\t\t\t\tvar formatLiteral = new PrimitiveExpression(\"\");\n\t\t\t\tvar counter = 0;\n\t\t\t\tvar arguments = new List<Expression>();\n\n\t\t\t\tformatInvocation.Arguments.Add(formatLiteral);\n\t\t\t\tvar concatItems = GetConcatItems(context, expr);\n\t\t\t\tbool hasVerbatimStrings = false;\n\t\t\t\tbool hasNonVerbatimStrings = false;\n\n\t\t\t\tforeach (var item in concatItems) {\n\t\t\t\t\tif (IsStringLiteral(item)) {\n\t\t\t\t\t\tvar stringLiteral = (PrimitiveExpression)item;\n\t\t\t\t\t\tif (stringLiteral.LiteralValue[0] == '@') {\n\t\t\t\t\t\t\thasVerbatimStrings = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thasNonVerbatimStrings = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tvar format = new StringBuilder();\n\t\t\t\tvar verbatim = hasVerbatimStrings && hasNonVerbatimStrings;\n\t\t\t\tformat.Append('\"');\n\t\t\t\tforeach (var item in concatItems) {\n\t\t\t\t\tif (IsStringLiteral(item)) {\n\t\t\t\t\t\tvar stringLiteral = (PrimitiveExpression)item;\n\n\t\t\t\t\t\tstring rawLiteral;\n\t\t\t\t\t\tif (hasVerbatimStrings && hasNonVerbatimStrings) {\n\t\t\t\t\t\t\trawLiteral = stringLiteral.Value.ToString().Replace(\"\\\"\", \"\\\"\\\"\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (stringLiteral.LiteralValue[0] == '@') {\n\t\t\t\t\t\t\t\tverbatim = true;\n\t\t\t\t\t\t\t\trawLiteral = stringLiteral.LiteralValue.Substring(2, stringLiteral.LiteralValue.Length - 3);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trawLiteral = stringLiteral.LiteralValue.Substring(1, stringLiteral.LiteralValue.Length - 2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tformat.Append(QuoteBraces(rawLiteral));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tExpression myItem = RemoveUnnecessaryToString(item);\n\t\t\t\t\t\tstring itemFormatStr = DetermineItemFormatString(ref myItem);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar index = IndexOf(arguments, myItem);\n\t\t\t\t\t\tif (index == -1) {\n\t\t\t\t\t\t\t// new item\n\t\t\t\t\t\t\tformatInvocation.Arguments.Add(myItem.Clone());\n\t\t\t\t\t\t\targuments.Add(item);\n\t\t\t\t\t\t\tformat.Append(\"{\" + counter++ + itemFormatStr + \"}\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// existing item\n\t\t\t\t\t\t\tformat.Append(\"{\" + index + itemFormatStr + \"}\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tformat.Append('\"');\n\t\t\t\tif (verbatim)\n\t\t\t\t\tformat.Insert(0, '@');\n\t\t\t\tformatLiteral.SetValue(format.ToString(), format.ToString());\n\t\t\t\tif (arguments.Count > 0)\n\t\t\t\t\tscript.Replace(expr, formatInvocation);\n\t\t\t\telse\n\t\t\t\t\tscript.Replace(expr, formatLiteral);\n\t\t\t}, node);\n\t\t}\n\n\t\tExpression RemoveUnnecessaryToString(Expression myItem)\n\t\t{\n\t\t\tif (myItem is InvocationExpression) {\n\t\t\t\tInvocationExpression invocation = (InvocationExpression)myItem;\n\t\t\t\tif (invocation.Target is MemberReferenceExpression &&\n\t\t\t\t\t((MemberReferenceExpression)invocation.Target).MemberName.Equals(\"ToString\") &&\n\t\t\t\t\tinvocation.Arguments.Count == 0) {\n\t\t\t\t\tmyItem = invocation.Target.FirstChild as Expression;\n\t\t\t\t}\n                \n\t\t\t}\n\t\t\treturn myItem;\n\t\t}\n\n\t\tstring QuoteBraces(string rawLiteral)\n\t\t{\n\t\t\tif (!rawLiteral.Contains(\"{\") && !rawLiteral.Contains(\"}\"))\n\t\t\t\treturn rawLiteral;\n\n\t\t\tStringBuilder quoted = new StringBuilder();\n\t\t\tfor (int i = 0; i < rawLiteral.Length; i++) {\n\t\t\t\tchar c = rawLiteral[i];\n\t\t\t\tif (c == '{')\n\t\t\t\t\tquoted.Append(\"{{\");\n\t\t\t\telse if (c == '}')\n\t\t\t\t\tquoted.Append(\"}}\");\n\t\t\t\telse\n\t\t\t\t\tquoted.Append(c);\n\t\t\t}\n\t\t\treturn quoted.ToString();\n\t\t}\n\n\t\tstatic string DetermineItemFormatString(ref Expression myItem)\n\t\t{\n\t\t\tif (myItem is InvocationExpression) {\n\t\t\t\tInvocationExpression invocation = myItem as InvocationExpression;\n\t\t\t\tif (invocation.Target is MemberReferenceExpression &&\n\t\t\t\t\t((MemberReferenceExpression)invocation.Target).MemberName.Equals(\"ToString\") &&\n\t\t\t\t\tinvocation.Arguments.Count == 1) {\n\t\t\t\t\tIEnumerator<Expression> i = invocation.Arguments.GetEnumerator();\n\t\t\t\t\ti.MoveNext();\n\t\t\t\t\tExpression arg = i.Current;\n\t\t\t\t\tif (IsStringLiteral(arg) && invocation.Target.FirstChild is Expression) {\n\t\t\t\t\t\tstring formatStr = ((PrimitiveExpression)arg).Value as string;\n\t\t\t\t\t\tmyItem = invocation.Target.FirstChild as Expression; // invocation target identifier is first child\n\t\t\t\t\t\treturn \":\" + formatStr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n            \n\t\t\treturn \"\";\n\t\t}\n\n\t\tstatic int IndexOf(IList<Expression> arguments, Expression item)\n\t\t{\n\t\t\tfor (int i = 0; i < arguments.Count; i++) {\n\t\t\t\tif (item.Match(arguments[i]).Success)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tstatic IEnumerable<Expression> GetConcatItems(RefactoringContext context, BinaryOperatorExpression expr)\n\t\t{\n\t\t\tvar leftExpr = expr.Left as BinaryOperatorExpression;\n\t\t\tif (IsStringConcatenation(context, leftExpr)) {\n\t\t\t\tforeach (var item in GetConcatItems (context, leftExpr))\n\t\t\t\t\tyield return item;\n\t\t\t} else {\n\t\t\t\tyield return expr.Left;\n\t\t\t}\n\n\t\t\tvar rightExpr = expr.Right as BinaryOperatorExpression;\n\t\t\tif (IsStringConcatenation(context, rightExpr)) {\n\t\t\t\tforeach (var item in GetConcatItems (context, rightExpr))\n\t\t\t\t\tyield return item;\n\t\t\t} else {\n\t\t\t\tyield return expr.Right;\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsStringConcatenation(RefactoringContext context, BinaryOperatorExpression expr)\n\t\t{\n\t\t\tif (expr == null || expr.Operator != BinaryOperatorType.Add)\n\t\t\t\treturn false;\n\t\t\tvar typeDef = context.Resolve(expr).Type.GetDefinition();\n\t\t\treturn typeDef != null && typeDef.KnownTypeCode == KnownTypeCode.String;\n\t\t}\n\n\t\tstatic bool IsStringLiteral(AstNode node)\n\t\t{\n\t\t\tvar expr = node as PrimitiveExpression;\n\t\t\treturn expr != null && expr.Value is string;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/UseVarKeywordAction.cs",
    "content": "﻿// \n// UseVarKeyword.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Threading;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[ContextAction(\"Use 'var' keyword\",\n\t               Description = \"Converts local variable declaration to be implicit typed.\")]\n\tpublic class UseVarKeywordAction : CodeActionProvider\n\t{\n\t\tinternal static readonly Version minimumVersion = new Version (3, 0, 0);\n\n\t\tpublic override IEnumerable<CodeAction> GetActions(RefactoringContext context)\n\t\t{\n\t\t\tif (!context.Supports(minimumVersion))\n\t\t\t\tyield break;\n\t\t\tvar varDecl = GetVariableDeclarationStatement(context);\n\t\t\tvar foreachStmt = GetForeachStatement(context);\n\t\t\tif (varDecl == null && foreachStmt == null) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tyield return new CodeAction(context.TranslateString(\"Use 'var' keyword\"), script => {\n\t\t\t\tif (varDecl != null) {\n\t\t\t\t\tscript.Replace(varDecl.Type, new SimpleType (\"var\"));\n\t\t\t\t} else {\n\t\t\t\t\tscript.Replace(foreachStmt.VariableType, new SimpleType (\"var\"));\n\t\t\t\t}\n\t\t\t}, (AstNode)varDecl ?? foreachStmt);\n\t\t}\n\t\t\n\t\tstatic VariableDeclarationStatement GetVariableDeclarationStatement (RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<VariableDeclarationStatement> ();\n\t\t\tif (result != null && result.Variables.Count == 1 && !result.Variables.First ().Initializer.IsNull && result.Type.Contains (context.Location) && !result.Type.IsVar ())\n\t\t\t\treturn result;\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tstatic ForeachStatement GetForeachStatement (RefactoringContext context)\n\t\t{\n\t\t\tvar result = context.GetNode<ForeachStatement> ();\n\t\t\tif (result != null && result.VariableType.Contains (context.Location) && !result.VariableType.IsVar ())\n\t\t\t\treturn result;\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/AdditionalOfTypeIssues.cs",
    "content": "//\n// AdditionalOfTypeIssues.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T> (extended)\",\n\t                  Description = \"Replace with call to OfType<T> (extended cases)\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Hint)]\n\tpublic class AdditionalOfTypeIssues : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly AstNode whereSimpleCase =\n\t\t\tnew InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"target\"), \"Where\"),\n\t\t\t\tnew NamedNode(\"lambda\", \n\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\tParameters = { PatternHelper.NamedParameter(\"param1\", PatternHelper.AnyType(\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\t\tBody = PatternHelper.OptionalParentheses(\n\t\t\t\t\t\t\t\tnew IsExpression(PatternHelper.OptionalParentheses(new NamedNode(\"expr1\", new IdentifierExpression(Pattern.AnyString))), new AnyNode(\"type\"))\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<AdditionalOfTypeIssues>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression (InvocationExpression anyInvoke)\n\t\t\t{\n\t\t\t\tvar match = ReplaceWithOfTypeIssue.selectNotNullPattern.Match (anyInvoke);\n\t\t\t\tif (match.Success)\n\t\t\t\t\treturn;\n\n\t\t\t\tmatch = ReplaceWithOfTypeIssue.wherePatternCase1.Match (anyInvoke);\n\t\t\t\tif (match.Success)\n\t\t\t\t\treturn;\n\n\t\t\t\tmatch = ReplaceWithOfTypeIssue.wherePatternCase2.Match (anyInvoke); \n\t\t\t\tif (match.Success)\n\t\t\t\t\treturn;\n\n\t\t\t\t// Warning: The simple case is not 100% equal in semantic, but it's one common code smell\n\t\t\t\tmatch = whereSimpleCase.Match (anyInvoke); \n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar lambda = match.Get<LambdaExpression>(\"lambda\").Single();\n\t\t\t\tvar expr = match.Get<IdentifierExpression>(\"expr1\").Single();\n\t\t\t\tif (lambda.Parameters.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\tif (expr.Identifier != lambda.Parameters.Single().Name)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue (new CodeIssue(\n\t\t\t\t\tanyInvoke,\n\t\t\t\t\tctx.TranslateString(\"Replace with OfType<T>\"),\n\t\t\t\t\tctx.TranslateString(\"Replace with call to OfType<T>\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar target = match.Get<Expression>(\"target\").Single().Clone ();\n\t\t\t\t\t\tvar type = match.Get<AstType>(\"type\").Single().Clone();\n\t\t\t\t\t\tscript.Replace(anyInvoke, new InvocationExpression(new MemberReferenceExpression(target, \"OfType\", type)));\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/BaseMethodParameterNameMismatchIssue.cs",
    "content": "//\n// BaseMethodParameterNameMismatchIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Parameter name differs in base declaration\",\n\t\tDescription = \"Parameter name differs in base declaration\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning)]\n\tpublic class BaseMethodParameterNameMismatchIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<BaseMethodParameterNameMismatchIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tCheck (indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tCheck (methodDeclaration);\n\t\t\t}\n\n\t\t\tvoid Check (EntityDeclaration entity)\n\t\t\t{\n\t\t\t\tif (!entity.HasModifier(Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(entity) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar method = rr.Member as IParameterizedMember;\n\t\t\t\tif (method == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar baseMethod = InheritanceHelper.GetBaseMember(method) as IParameterizedMember;\n\t\t\t\tif (baseMethod == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tfor (int i = 0; i < Math.Min (method.Parameters.Count, baseMethod.Parameters.Count); i++) {\n\t\t\t\t\tvar arg     = method.Parameters[i];\n\t\t\t\t\tvar baseArg = baseMethod.Parameters[i];\n\n\t\t\t\t\tif (arg.Name != baseArg.Name) {\n\t\t\t\t\t\tint _i = i;\n\t\t\t\t\t\tvar parameters = entity.GetChildrenByRole (Roles.Parameter);\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tparameters.ElementAt(_i).NameToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Parameter name differs in base method declaration\"),\n\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Rename to '{0}'\"), baseArg.Name),\n\t\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\t\ts.Rename(arg, baseArg.Name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CallToObjectEqualsViaBaseIssue.cs",
    "content": "//\n// CallToObjectEqualsViaBaseIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Call to base.Equals resolves to Object.Equals, which is reference equality\",\n\t                  Description = \"Finds potentially erroneous calls to Object.Equals.\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n                      AnalysisDisableKeyword = \"BaseObjectEqualsIsObjectEquals\")]\n\tpublic class CallToObjectEqualsViaBaseIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<CallToObjectEqualsViaBaseIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tif (invocationExpression.Arguments.Count != 1) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar memberExpression = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (memberExpression == null || memberExpression.MemberName != \"Equals\" || !(memberExpression.Target is BaseReferenceExpression)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar resolveResult = ctx.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (resolveResult == null || !resolveResult.Member.DeclaringTypeDefinition.IsKnownType(KnownTypeCode.Object)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar title = ctx.TranslateString(\"Call to base.Equals resolves to Object.Equals, which is reference equality\");\n\t\t\t\tAddIssue(new CodeIssue(invocationExpression, title, GetActions(invocationExpression)));\n\t\t\t}\n\n\t\t\tIEnumerable<CodeAction> GetActions(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tyield return new CodeAction(ctx.TranslateString(\"Change invocation to call Object.ReferenceEquals\"), script => {\n\t\t\t\t\tvar args = Enumerable.Concat(new [] { new ThisReferenceExpression() }, invocationExpression.Arguments.Select(arg => arg.Clone()));\n\t\t\t\t\tvar newInvocation = MakeInvocation(\"object.ReferenceEquals\", args);\n\t\t\t\t\tscript.Replace(invocationExpression, newInvocation);\n\t\t\t\t}, invocationExpression);\n\t\t\t\tyield return new CodeAction(ctx.TranslateString(\"Remove 'base.'\"), script => {\n\t\t\t\t\tvar newInvocation = MakeInvocation(\"Equals\", invocationExpression.Arguments.Select(arg => arg.Clone()));\n\t\t\t\t\tscript.Replace(invocationExpression, newInvocation);\n\t\t\t\t}, invocationExpression);\n\t\t\t}\n\n\t\t\tstatic InvocationExpression MakeInvocation(string memberName, IEnumerable<Expression> unClonedArguments)\n\t\t\t{\n\t\t\t\treturn new InvocationExpression(new IdentifierExpression(memberName), unClonedArguments);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CastExpressionOfIncompatibleTypeIssue.cs",
    "content": "﻿// \n// CastExpressionOfIncompatibleTypeIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Type cast expression of incompatible type\",\n\t\tDescription = \"Type cast expression of incompatible type\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning)]\n\tpublic class CastExpressionOfIncompatibleTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CastExpressionOfIncompatibleTypeIssue>\n\t\t{\n\t\t\treadonly CSharpConversions conversion;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tconversion = new CSharpConversions(ctx.Compilation);\n\t\t\t}\n\n\t\t\tpublic override void VisitCastExpression(CastExpression castExpression)\n\t\t\t{\n\t\t\t\tbase.VisitCastExpression(castExpression);\n\n\t\t\t\tVisitTypeCastExpression(castExpression, ctx.Resolve(castExpression.Expression).Type,\n\t\t\t\t\tctx.ResolveType(castExpression.Type));\n\t\t\t}\n\n\t\t\tpublic override void VisitAsExpression(AsExpression asExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAsExpression(asExpression);\n\n\t\t\t\tVisitTypeCastExpression(asExpression, ctx.Resolve(asExpression.Expression).Type,\n\t\t\t\t\tctx.ResolveType(asExpression.Type));\n\t\t\t}\n\n\t\t\tvoid VisitTypeCastExpression(Expression expression, IType exprType, IType castToType)\n\t\t\t{\n\t\t\t\tif (exprType.Kind == TypeKind.Unknown || castToType.Kind == TypeKind.Unknown || castToType.Kind == TypeKind.TypeParameter)\n\t\t\t\t\treturn;\n\t\t\t\tvar foundConversion = conversion.ExplicitConversion(exprType, castToType);\n\t\t\t\tif (foundConversion == Conversion.None)\n\t\t\t\t\tAddIssue(new CodeIssue(expression, ctx.TranslateString(\"Type cast expression of incompatible type\")));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CheckNamespaceIssue.cs",
    "content": "//\n// CheckNamespaceIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\n\t\t\"Check if a namespace corresponds to a file location\",\n\t\tDescription = \"Check if a namespace corresponds to a file location\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"CheckNamespace\")]\n\tpublic class CheckNamespaceIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CheckNamespaceIssue>\n\t\t{\n\t\t\treadonly string defaultNamespace;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t\tdefaultNamespace = ctx.DefaultNamespace;\n\t\t\t}\n\n\t\t\tpublic override void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tif (string.IsNullOrEmpty(defaultNamespace))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitSyntaxTree(syntaxTree);\n\t\t\t}\n\n\t\t\tpublic override void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitNamespaceDeclaration(namespaceDeclaration);\n\t\t\t\t// only check top level namespaces\n\t\t\t\tif (namespaceDeclaration.Parent is NamespaceDeclaration ||\n\t\t\t\t    namespaceDeclaration.FullName == defaultNamespace)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tnamespaceDeclaration.NamespaceName,\n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Namespace does not correspond to file location, should be: '{0}'\"), ctx.DefaultNamespace)\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tvar ns = typeDeclaration.Parent as NamespaceDeclaration;\n\t\t\t\tif (ns == null) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\ttypeDeclaration.NameToken,\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Type should be declared inside the namespace '{0}'\"), ctx.DefaultNamespace)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\t// skip children\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0029InvalidConversionIssue.cs",
    "content": "// \n// CS0029InvalidConversionIssue.cs\n// \n// Author:\n//      Daniel Grunwald <daniel@danielgrunwald.de>\n// \n// Copyright (c) 2013 Daniel Grunwald <daniel@danielgrunwald.de>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"CS0029: Cannot implicitly convert type 'A' to 'B'.\",\n\t                  Description = \"This error occurs when trying to assign a value of an incompatible type.\",\n\t                  Category = IssueCategories.CompilerErrors,\n\t                  Severity = Severity.Error)]\n\tpublic class CS0029InvalidConversionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\t// This class handles both\n\t\t// CS0029: Cannot implicitly convert type 'type' to 'type'\n\t\t// and\n\t\t// CS0266: Cannot implicitly convert type 'type1' to 'type2'. An explicit conversion exists (are you missing a cast?)\n\t\t\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0029InvalidConversionIssue>\n\t\t{\n\t\t\treadonly CSharpConversions conversion;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tconversion = new CSharpConversions(ctx.Compilation);\n\t\t\t}\n\n\t\t\t// Currently, we only checks assignments\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t\t\tif (assignmentExpression.Operator != AssignmentOperatorType.Assign)\n\t\t\t\t\treturn;\n\t\t\t\tvar variableType = ctx.Resolve(assignmentExpression.Left).Type;\n\t\t\t\tCheckConversion(variableType, assignmentExpression.Right);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tbase.VisitVariableInitializer(variableInitializer);\n\t\t\t\tif (!variableInitializer.Initializer.IsNull) {\n\t\t\t\t\tvar variableType = ctx.Resolve(variableInitializer).Type;\n\t\t\t\t\tCheckConversion(variableType, variableInitializer.Initializer);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitReturnStatement(ReturnStatement returnStatement)\n\t\t\t{\n\t\t\t\tbase.VisitReturnStatement(returnStatement);\n\t\t\t\tif (!returnStatement.Expression.IsNull)\n\t\t\t\t\tCheckConversion(ctx.GetExpectedType (returnStatement.Expression), returnStatement.Expression);\t\t\t\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tforeach (var expr in invocationExpression.Arguments) {\n\t\t\t\t\tCheckConversion(ctx.GetExpectedType(expr), expr);\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedStatement(FixedStatement fixedStatement)\n\t\t\t{\n\t\t\t\t// TODO: Check the initializer - but it can't contain a type cast anyways.\n\t\t\t\tfixedStatement.EmbeddedStatement.AcceptVisitor (this);\n\t\t\t}\n\n\t\t\tpublic override void VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression)\n\t\t\t{\n\t\t\t\tbase.VisitArrayInitializerExpression(arrayInitializerExpression);\n\t\t\t\tforeach (var expr in arrayInitializerExpression.Elements) {\n\t\t\t\t\tCheckConversion(ctx.GetExpectedType(expr), expr);\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvoid CheckConversion(IType variableType, Expression expression)\n\t\t\t{\n\t\t\t\tif (variableType.Kind == TypeKind.Unknown)\n\t\t\t\t\treturn; // ignore error if the variable type is unknown\n\t\t\t\tif (ctx.GetConversion(expression).IsValid)\n\t\t\t\t\treturn; // don't complain if the code is valid\n\t\t\t\t\n\t\t\t\tvar rr = ctx.Resolve(expression);\n\t\t\t\tif (rr.Type.Kind == TypeKind.Unknown)\n\t\t\t\t\treturn; // ignore error if expression type is unknown\n\t\t\t\t\n\t\t\t\tvar foundConversion = conversion.ExplicitConversion(rr, variableType);\n\t\t\t\t\n\t\t\t\tvar builder = ctx.CreateTypeSystemAstBuilder(expression);\n\t\t\t\tAstType variableTypeNode = builder.ConvertType(variableType);\n\t\t\t\tAstType expressionTypeNode = builder.ConvertType(rr.Type);\n\n\t\t\t\tstring title;\n\t\t\t\tList<CodeAction> fixes = new List<CodeAction>();\n\t\t\t\tif (foundConversion.IsValid) {\n\t\t\t\t\t// CS0266: An explicit conversion exists -> suggested fix is to insert the cast\n\t\t\t\t\ttitle = string.Format(ctx.TranslateString(\"Cannot implicitly convert type `{0}' to `{1}'. An explicit conversion exists (are you missing a cast?)\"),\n\t\t\t\t\t                      expressionTypeNode, variableTypeNode);\n\t\t\t\t\tstring fixTitle = string.Format(ctx.TranslateString(\"Cast to '{0}'\"), variableTypeNode);\n\t\t\t\t\tAction<Script> fixAction = script => {\n\t\t\t\t\t\tvar right = expression.Clone();\n\t\t\t\t\t\tvar castRight = right.CastTo(variableTypeNode);\n\t\t\t\t\t\tscript.Replace(expression, castRight);\n\t\t\t\t\t};\n\t\t\t\t\tfixes.Add(new CodeAction(fixTitle, fixAction, expression));\n\t\t\t\t} else {\n\t\t\t\t\t// CS0029: No explicit conversion -> Issue without suggested fix\n\t\t\t\t\ttitle = string.Format(ctx.TranslateString(\"Cannot implicitly convert type `{0}' to `{1}'\"),\n\t\t\t\t\t                             expressionTypeNode, variableTypeNode);\n\n\t\t\t\t}\n\n\t\t\t\tif (expression.Parent is VariableInitializer) {\n\t\t\t\t\tvar fd = expression.Parent.Parent as FieldDeclaration;\n\t\t\t\t\tif (fd != null) {\n\t\t\t\t\t\tfixes.Add(new CodeAction(\n\t\t\t\t\t\t\tctx.TranslateString(\"Change field type\"), \n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tscript.Replace(fd.ReturnType, ctx.CreateTypeSystemAstBuilder(fd).ConvertType(rr.Type));\n\t\t\t\t\t\t\t}, \n\t\t\t\t\t\t\texpression\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\n\t\t\t\t\tvar lc =  expression.Parent.Parent as VariableDeclarationStatement;\n\t\t\t\t\tif (lc != null) {\n\t\t\t\t\t\tfixes.Add(new CodeAction(\n\t\t\t\t\t\t\tctx.TranslateString(\"Change local variable type\"), \n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tscript.Replace(lc.Type, new SimpleType(\"var\"));\n\t\t\t\t\t\t\t}, \n\t\t\t\t\t\t\texpression\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (expression.Parent is ReturnStatement) {\n\t\t\t\t\tAstNode entityNode;\n\t\t\t\t\tvar type = CS0126ReturnMustBeFollowedByAnyExpression.GetRequestedReturnType(ctx, expression.Parent, out entityNode);\n\t\t\t\t\tif (type != null) {\n\t\t\t\t\t\tvar entity = entityNode as EntityDeclaration;\n\t\t\t\t\t\tif (entity != null) {\n\t\t\t\t\t\t\tfixes.Add(new CodeAction(\n\t\t\t\t\t\t\t\tctx.TranslateString(\"Change return type\"), \n\t\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\t\tscript.Replace(entity.ReturnType, ctx.CreateTypeSystemAstBuilder(entity).ConvertType(rr.Type));\n\t\t\t\t\t\t\t\t}, \n\t\t\t\t\t\t\t\texpression\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(expression, title, fixes));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0126ReturnMustBeFollowedByAnyExpression.cs",
    "content": "//\n// CS0126ReturnMustBeFollowedByAnyExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"CS0126: A method with return type cannot return without value.\",\n\t                  Description = \"Since 'function' doesn't return void, a return keyword must be followed by an object expression\",\n\t                  Category = IssueCategories.CompilerErrors,\n\t                  Severity = Severity.Error)]\n\tpublic class CS0126ReturnMustBeFollowedByAnyExpression : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tinternal static IType GetRequestedReturnType (BaseRefactoringContext ctx, AstNode returnStatement, out AstNode entityNode)\n\t\t{\n\t\t\tentityNode = returnStatement.GetParent(p => p is LambdaExpression || p is AnonymousMethodExpression || !(p is Accessor) && p is EntityDeclaration);\n\t\t\tif (entityNode == null)\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\tif (entityNode is EntityDeclaration) {\n\t\t\t\tvar rr = ctx.Resolve(entityNode) as MemberResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t\tif (((EntityDeclaration)entityNode).HasModifier(Modifiers.Async))\n\t\t\t\t\treturn TaskType.UnpackTask(ctx.Compilation, rr.Member.ReturnType);\n\t\t\t\treturn rr.Member.ReturnType;\n\t\t\t}\n\t\t\tbool isAsync = false;\n\t\t\tif (entityNode is LambdaExpression)\n\t\t\t\tisAsync = ((LambdaExpression)entityNode).IsAsync;\n\t\t\tif (entityNode is AnonymousMethodExpression)\n\t\t\t\tisAsync = ((AnonymousMethodExpression)entityNode).IsAsync;\n\t\t\tforeach (var type in TypeGuessing.GetValidTypes(ctx.Resolver, entityNode)) {\n\t\t\t\tif (type.Kind != TypeKind.Delegate)\n\t\t\t\t\tcontinue;\n\t\t\t\tvar invoke = type.GetDelegateInvokeMethod();\n\t\t\t\tif (invoke != null) {\n\t\t\t\t\treturn isAsync ? TaskType.UnpackTask(ctx.Compilation, invoke.ReturnType) : invoke.ReturnType;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn SpecialType.UnknownType;\n\t\t}\n\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0126ReturnMustBeFollowedByAnyExpression>\n\t\t{\n\t\t\tstring currentMethodName;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tbool skip;\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tvar primitiveType = methodDeclaration.ReturnType as PrimitiveType;\n\t\t\t\tskip = (primitiveType != null && primitiveType.Keyword == \"void\");\n\t\t\t\tcurrentMethodName = methodDeclaration.Name;\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tcurrentMethodName = constructorDeclaration.Name;\n\t\t\t\tskip = true;\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tcurrentMethodName = \"~\" + destructorDeclaration.Name;\n\t\t\t\tskip = true;\n\t\t\t\tbase.VisitDestructorDeclaration(destructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitAccessor(Accessor accessor)\n\t\t\t{\n\t\t\t\tbool old = skip; \n\t\t\t\tskip = accessor.Role != PropertyDeclaration.GetterRole && accessor.Role != IndexerDeclaration.GetterRole;\n\t\t\t\tbase.VisitAccessor(accessor);\n\t\t\t\tskip = old;\n\t\t\t}\n\n\t\t\tstatic bool AnonymousMethodMayReturnVoid(BaseRefactoringContext ctx, Expression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tforeach (var type in TypeGuessing.GetValidTypes(ctx.Resolver, anonymousMethodExpression)) {\n\t\t\t\t\tif (type.Kind != TypeKind.Delegate)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar invoke = type.GetDelegateInvokeMethod();\n\t\t\t\t\tif (invoke != null && invoke.ReturnType.IsKnownType(KnownTypeCode.Void))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tbool old = skip;\n\t\t\t\tskip = AnonymousMethodMayReturnVoid(ctx, anonymousMethodExpression);\n\t\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\t\tskip = old;\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tbool old = skip;\n\t\t\t\tskip = AnonymousMethodMayReturnVoid(ctx, lambdaExpression);\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\t\tskip = old;\n\t\t\t}\n\n\t\t\tpublic override void VisitReturnStatement(ReturnStatement returnStatement)\n\t\t\t{\n\t\t\t\tbase.VisitReturnStatement(returnStatement);\n\t\t\t\tif (skip)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (returnStatement.Expression.IsNull) {\n\t\t\t\t\tvar entity = returnStatement.GetParent<EntityDeclaration>();\n\t\t\t\t\tif (entity is Accessor)\n\t\t\t\t\t\tentity = entity.GetParent<EntityDeclaration>();\n\t\t\t\t\tif (entity == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tAstNode entityNode;\n\t\t\t\t\tvar rr = GetRequestedReturnType (ctx, returnStatement, out entityNode);\n\t\t\t\t\tif (rr.Kind == TypeKind.Void)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar actions = new List<CodeAction>();\n\t\t\t\t\tif (rr.Kind != TypeKind.Unknown) {\n\t\t\t\t\t\tactions.Add(new CodeAction(ctx.TranslateString(\"Return default value\"), script => {\n\t\t\t\t\t\t\tExpression p;\n\t\t\t\t\t\t\tif (rr.IsKnownType(KnownTypeCode.Boolean)) {\n\t\t\t\t\t\t\t\tp = new PrimitiveExpression(false);\n\t\t\t\t\t\t\t} else if (rr.IsKnownType(KnownTypeCode.String)) {\n\t\t\t\t\t\t\t\tp = new PrimitiveExpression(\"\");\n\t\t\t\t\t\t\t} else if (rr.IsKnownType(KnownTypeCode.Char)) {\n\t\t\t\t\t\t\t\tp = new PrimitiveExpression(' ');\n\t\t\t\t\t\t\t} else if (rr.IsReferenceType == true) {\n\t\t\t\t\t\t\t\tp = new NullReferenceExpression();\n\t\t\t\t\t\t\t} else if (rr.GetDefinition() != null &&\n\t\t\t\t\t\t\t\trr.GetDefinition().KnownTypeCode < KnownTypeCode.DateTime) {\n\t\t\t\t\t\t\t\tp = new PrimitiveExpression(0x0);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tp = new DefaultValueExpression(ctx.CreateTypeSystemAstBuilder(returnStatement).ConvertType(rr));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tscript.Replace(returnStatement, new ReturnStatement(p));\n\t\t\t\t\t\t}, returnStatement));\n\t\t\t\t\t}\n\t\t\t\t\tvar method = returnStatement.GetParent<MethodDeclaration>();\n\t\t\t\t\tif (method != null) {\n\t\t\t\t\t\tactions.Add(new CodeAction(ctx.TranslateString(\"Change method return type to 'void'\"), script => {\n\t\t\t\t\t\t\tscript.Replace(method.ReturnType, new PrimitiveType(\"void\"));\n\t\t\t\t\t\t}, returnStatement));\n\t\t\t\t\t}\n\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\treturnStatement, \n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"`{0}': A return keyword must be followed by any expression when method returns a value\"), currentMethodName),\n\t\t\t\t\t\tactions\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0127ReturnMustNotBeFollowedByAnyExpression.cs",
    "content": "﻿//\n// CS0127ReturnMustNotBeFollowedByAnyExpression.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"CS0127: A method with a void return type cannot return a value.\",\n\t                  Description = \"Since 'function' returns void, a return keyword must not be followed by an object expression\",\n\t                  Category = IssueCategories.CompilerErrors,\n\t                  Severity = Severity.Error)]\n\tpublic class CS0127ReturnMustNotBeFollowedByAnyExpression : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0127ReturnMustNotBeFollowedByAnyExpression>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitReturnStatement(ReturnStatement returnStatement)\n\t\t\t{\n\t\t\t\tbase.VisitReturnStatement(returnStatement);\n\n\t\t\t\tif (ctx.GetExpectedType(returnStatement.Expression).Kind == TypeKind.Void) {\n\t\t\t\t\tvar actions = new List<CodeAction>();\n\t\t\t\t\tactions.Add(new CodeAction(ctx.TranslateString(\"Remove returned expression\"), script => {\n\t\t\t\t\t\tscript.Replace(returnStatement, new ReturnStatement());\n\t\t\t\t\t}, returnStatement));\n\n\t\t\t\t\tvar method = returnStatement.GetParent<MethodDeclaration>();\n\t\t\t\t\tif (method != null) {\n\t\t\t\t\t\tvar rr = ctx.Resolve(returnStatement.Expression);\n\t\t\t\t\t\tif (rr != null && !rr.IsError) {\n\t\t\t\t\t\t\tactions.Add(new CodeAction(ctx.TranslateString(\"Change return type of method.\"), script => {\n\t\t\t\t\t\t\t\tscript.Replace(method.ReturnType, ctx.CreateTypeSystemAstBuilder(method).ConvertType(rr.Type));\n\t\t\t\t\t\t\t}, returnStatement));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\treturnStatement, \n\t\t\t\t\t\tctx.TranslateString(\"Return type is 'void'\"),\n\t\t\t\t\t\tactions\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0152DuplicateCaseLabelValueIssue.cs",
    "content": "//\n// DuplicateCaseLabelValueIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Duplicate case label value issue\",\n\t                   Description = \"A case label value is duplicate.\",\n\t                   Category = IssueCategories.CompilerErrors,\n\t                   Severity = Severity.Error)]\n\tpublic class CS0152DuplicateCaseLabelValueIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0152DuplicateCaseLabelValueIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitSwitchSection(SwitchSection switchSection)\n\t\t\t{\n\t\t\t\tbase.VisitSwitchSection(switchSection);\n\n\t\t\t\tvar parent = switchSection.Parent as SwitchStatement;\n\t\t\t\tif (parent == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tforeach (var curLabel in switchSection.CaseLabels) {\n\t\t\t\t\tif (curLabel.Expression.IsNull)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar curValue = ctx.Resolve(curLabel.Expression).ConstantValue;\n\t\t\t\t\tif (curValue == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tforeach (var sect in parent.SwitchSections) {\n\t\t\t\t\t\tif (sect.CaseLabels.Any(label => label != curLabel && Equals(curValue, ctx.Resolve(label.Expression).ConstantValue))) {\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(curLabel, string.Format(ctx.TranslateString(\"Duplicate case label value '{0}'\"), curValue)));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0169FieldIsNeverUsedIssue.cs",
    "content": "﻿//\n// CS0169FieldIsNeverUsedIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"CS0169: Field is never used\",\n\t\tDescription = \"CS0169: Field is never used\",\n\t\tCategory = IssueCategories.CompilerWarnings,\n\t\tSeverity = Severity.Warning,\n\t\tPragmaWarning = 169)]\n\tpublic class CS0169FieldIsNeverUsedIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0169FieldIsNeverUsedIssue>\n\t\t{\n\t\t\treadonly Stack<List<Tuple<VariableInitializer, IVariable>>> fieldStack = new Stack<List<Tuple<VariableInitializer, IVariable>>>();\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid Collect()\n\t\t\t{\n\t\t\t\tforeach (var varDecl in fieldStack.Peek()) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tvarDecl.Item1.NameToken,\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"The private field '{0}' is never assigned\"), varDecl.Item2.Name)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\t\n\t\t\t\tvar list = new List<Tuple<VariableInitializer, IVariable>>();\n\t\t\t\tfieldStack.Push(list);\n\n\t\t\t\tforeach (var fieldDeclaration in ConvertToConstantIssue.CollectFields (this, typeDeclaration)) {\n\t\t\t\t\tif (fieldDeclaration.HasModifier(Modifiers.Const))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.HasModifier(Modifiers.Public) || fieldDeclaration.HasModifier(Modifiers.Protected) || fieldDeclaration.HasModifier(Modifiers.Internal))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.Variables.Count() > 1)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar variable = fieldDeclaration.Variables.First();\n\t\t\t\t\tif (!variable.Initializer.IsNull)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar rr = ctx.Resolve(fieldDeclaration.ReturnType);\n\t\t\t\t\tif (rr.Type.IsReferenceType == false) {\n\t\t\t\t\t\t// Value type:\n\t\t\t\t\t\tvar def = rr.Type.GetDefinition();\n\t\t\t\t\t\tif (def != null && def.KnownTypeCode == KnownTypeCode.None) {\n\t\t\t\t\t\t\t// user-defined value type -- might be mutable\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (ctx.Resolve (variable.Initializer).IsCompileTimeConstant) {\n\t\t\t\t\t\t\t// handled by ConvertToConstantIssue\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar mr = ctx.Resolve(variable) as MemberResolveResult;\n\t\t\t\t\tif (mr == null || !(mr.Member is IVariable))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tlist.Add(Tuple.Create(variable, (IVariable)mr.Member)); \n\t\t\t\t}\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tCollect();\n\t\t\t\tfieldStack.Pop();\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\tvar assignmentAnalysis = new ConvertToConstantIssue.VariableUsageAnalyzation (ctx);\n\t\t\t\tvar newVars = new List<Tuple<VariableInitializer, IVariable>>();\n\t\t\t\tblockStatement.AcceptVisitor(assignmentAnalysis); \n\t\t\t\tforeach (var variable in fieldStack.Pop()) {\n\t\t\t\t\tif (assignmentAnalysis.GetStatus(variable.Item2) == VariableState.Changed)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tnewVars.Add(variable);\n\t\t\t\t}\n\t\t\t\tfieldStack.Push(newVars);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0618UsageOfObsoleteMemberIssue.cs",
    "content": "﻿//\n// CS0618UsageOfObsoleteMemberIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"CS0618: Member is obsolete\",\n\t\tDescription = \"CS0618: Member is obsolete\",\n\t\tCategory = IssueCategories.CompilerWarnings,\n\t\tSeverity = Severity.Warning,\n\t\tPragmaWarning = 618)]\n\tpublic class CS0618UsageOfObsoleteMemberIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0618UsageOfObsoleteMemberIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid Check(ResolveResult rr, AstNode nodeToMark)\n\t\t\t{\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tIMember member = null;\n\t\t\t\tvar memberRR = rr as MemberResolveResult;\n\t\t\t\tif (memberRR != null)\n\t\t\t\t\tmember = memberRR.Member;\n\n\t\t\t\tvar operatorRR = rr as OperatorResolveResult;\n\t\t\t\tif (operatorRR != null)\n\t\t\t\t\tmember = operatorRR.UserDefinedOperatorMethod;\n\n\t\t\t\tif (member == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar attr = member.Attributes.FirstOrDefault(a => a.AttributeType.Name == \"ObsoleteAttribute\" && a.AttributeType.Namespace == \"System\");\n\t\t\t\tif (attr == null)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(nodeToMark, string.Format(ctx.TranslateString(\"'{0}' is obsolete\"), member.FullName)));\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t\t\tCheck(ctx.Resolve(memberReferenceExpression), memberReferenceExpression.MemberNameToken);\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tCheck(ctx.Resolve(invocationExpression), invocationExpression.Target);\n\t\t\t}\n\n\t\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIdentifierExpression(identifierExpression);\n\t\t\t\tCheck(ctx.Resolve(identifierExpression), identifierExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIndexerExpression(indexerExpression);\n\t\t\t\tCheck(ctx.Resolve(indexerExpression), indexerExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tCheck(ctx.Resolve(binaryOperatorExpression), binaryOperatorExpression.OperatorToken);\n\t\t\t}\n\n\t\t\tbool IsObsolete(EntityDeclaration entity)\n\t\t\t{\n\t\t\t\tforeach (var section in entity.Attributes) {\n\t\t\t\t\tforeach (var attr in section.Attributes) {\n\t\t\t\t\t\tvar rr = ctx.Resolve(attr); \n\t\t\t\t\t\tif (rr.Type.Name == \"ObsoleteAttribute\" && rr.Type.Namespace == \"System\")\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(typeDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(methodDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(propertyDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitPropertyDeclaration(propertyDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitAccessor(Accessor accessor)\n\t\t\t{\n\t\t\t\tif (IsObsolete(accessor))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitAccessor(accessor);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(indexerDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitIndexerDeclaration(indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(eventDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitCustomEventDeclaration(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(fieldDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(constructorDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(destructorDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitDestructorDeclaration(destructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tif (IsObsolete(operatorDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitOperatorDeclaration(operatorDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0659OverrideEqualWithoutGetHashCode.cs",
    "content": "// \n// CS0659ClassOverrideEqualsWithoutGetHashCode.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"CS0659: Class overrides Object.Equals but not Object.GetHashCode.\",\n\t\tDescription = \"If two objects are equal then they must both have the same hash code\",\n\t\tCategory = IssueCategories.CompilerWarnings,\n\t\tSeverity = Severity.Warning,\n\t\tPragmaWarning = 1717,\n\t\tAnalysisDisableKeyword = \"CSharpWarnings::CS0659\")]\n\tpublic class CS0659ClassOverrideEqualsWithoutGetHashCode : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<CS0659ClassOverrideEqualsWithoutGetHashCode>\n\t\t{\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, CS0659ClassOverrideEqualsWithoutGetHashCode issueProvider) : base (ctx, issueProvider)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\n\t\t\t\tvar resolvedResult = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (resolvedResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar method = resolvedResult.Member as IMethod;\n\n\t\t\t\tif (method == null || !method.Name.Equals(\"Equals\") || ! method.IsOverride)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (methodDeclaration.Parameters.Count != 1)\n\t\t\t\t\treturn;\n\t\n\t\t\t\tif (!method.Parameters.Single().Type.FullName.Equals(\"System.Object\"))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar classDeclration = method.DeclaringTypeDefinition;\n\t\t\t\tif (classDeclration == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tList<IMethod> getHashCode = new List<IMethod>();\n\t\t\t\tvar methods = classDeclration.GetMethods();\n\n\t\t\t\tforeach (var m in methods) {\n\t\t\t\t\tif (m.Name.Equals(\"GetHashCode\")) {\n\t\t\t\t\t\tgetHashCode.Add(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!getHashCode.Any()) {\n\t\t\t\t\tAddIssue(ctx, methodDeclaration);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (getHashCode.Any(f => (f.IsOverride && f.ReturnType.IsKnownType(KnownTypeCode.Int32)))) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tAddIssue(ctx, methodDeclaration);\n\t\t\t}\n\n\t\t\tprivate void AddIssue(BaseRefactoringContext ctx, AstNode node)\n\t\t\t{\n\t\t\t\tvar getHashCode = new MethodDeclaration();\n\t\t\t\tgetHashCode.Name = \"GetHashCode\";\n\t\t\t\tgetHashCode.Modifiers = Modifiers.Public;\n\t\t\t\tgetHashCode.Modifiers |= Modifiers.Override;\n\t\t\t\tgetHashCode.ReturnType = new PrimitiveType(\"int\");\n\n\t\t\t\tvar blockStatement = new BlockStatement();\n\t\t\t\tvar invocationExpression = new InvocationExpression(new MemberReferenceExpression(new BaseReferenceExpression(),\"GetHashCode\"));\n\t\t\t\tvar returnStatement = new ReturnStatement(invocationExpression);\n\t\t\t\tblockStatement.Add(returnStatement);\n\t\t\t\tgetHashCode.Body = blockStatement;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t(node as MethodDeclaration).NameToken, \n\t\t\t\t\tctx.TranslateString(\"If two objects are equal then they must both have the same hash code\"),\n\t\t\t\t\tnew CodeAction(\n\t\t\t\t\tctx.TranslateString(\"Override GetHashCode\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\tscript.InsertAfter(node, getHashCode); \n\t\t\t\t},\n\t\t\t\tnode\n\t\t\t\t\t)));\n\t\t\t}\n\t\t}\n\t}\n}\n\n\t"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS0759RedundantPartialMethodIssue.cs",
    "content": "// RedundantPartialMethodIssue.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"CS0759: A partial method implementation is missing a partial method declaration\",\n\t                   Description = \"A partial method must have a defining declaration that defines the signature (name, return type and parameters) of the method. The implementation or method body is optional.\",\n\t                   Category = IssueCategories.CompilerErrors,\n\t                   Severity = Severity.Error)]\n\tpublic class CS0759RedundantPartialMethodIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0759RedundantPartialMethodIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!methodDeclaration.HasModifier(Modifiers.Partial))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar resolveResult = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar method = (IMethod) resolveResult.Member;\n\t\t\t\tif (method == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!method.HasBody)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (method.Parts.Count == 1) {\n\t\t\t\t\tAddIssue(new CodeIssue(methodDeclaration.NameToken,\n\t\t\t\t\t         string.Format(ctx.TranslateString(\"CS0759: A partial method `{0}' implementation is missing a partial method declaration\"), method.FullName),\n\t\t\t\t\t\tGetFixAction(methodDeclaration)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t//We never need to visit the children of block statements\n\t\t\t}\n\n\t\t\tCodeAction GetFixAction(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\treturn new CodeAction(ctx.TranslateString(\"Remove 'partial'\"), script => {\n\t\t\t\t\tscript.ChangeModifier (methodDeclaration, methodDeclaration.Modifiers & ~Modifiers.Partial);\n\t\t\t\t}, methodDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/CS1729TypeHasNoConstructorWithNArgumentsIssue.cs",
    "content": "//\n// CS1729TypeHasNoConstructorWithNArgumentsIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"CS1729: Class does not contain a 0 argument constructor\",\n\t                   Description = \"CS1729: Class does not contain a 0 argument constructor\",\n\t                   Category = IssueCategories.CompilerErrors,\n\t                   Severity = Severity.Error)]\n\tpublic class CS1729TypeHasNoConstructorWithNArgumentsIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tprivate class GatherVisitor : GatherVisitorBase<CS1729TypeHasNoConstructorWithNArgumentsIssue>\n\t\t{\n\t\t\tIType currentType;\n\t\t\tIType baseType;\n\t\t\t\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context)\n\t\t\t\t: base(context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration declaration)\n\t\t\t{\n\t\t\t\tIType outerType = currentType;\n\t\t\t\tIType outerBaseType = baseType;\n\t\t\t\t\n\t\t\t\tvar result = ctx.Resolve(declaration) as TypeResolveResult;\n\t\t\t\tcurrentType = result != null ? result.Type : SpecialType.UnknownType;\n\t\t\t\tbaseType = currentType.DirectBaseTypes.FirstOrDefault(t => t.Kind != TypeKind.Interface) ?? SpecialType.UnknownType;\n\t\t\t\t\n\t\t\t\tbase.VisitTypeDeclaration(declaration);\n\t\t\t\t\n\t\t\t\tif (currentType.Kind == TypeKind.Class && currentType.GetConstructors().All(ctor => ctor.IsSynthetic)) {\n\t\t\t\t\t// current type only has the compiler-provided default ctor\n\t\t\t\t\tif (!BaseTypeHasUsableParameterlessConstructor()) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(declaration.NameToken, GetIssueText(baseType)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentType = outerType;\n\t\t\t\tbaseType = outerBaseType;\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration declaration)\n\t\t\t{\n\t\t\t\tbase.VisitConstructorDeclaration(declaration);\n\t\t\t\t\n\t\t\t\tif (declaration.Initializer.IsNull && !declaration.HasModifier(Modifiers.Static)) {\n\t\t\t\t\t// Check if parameterless ctor is available:\n\t\t\t\t\tif (!BaseTypeHasUsableParameterlessConstructor()) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(declaration.NameToken, GetIssueText(baseType)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tconst OverloadResolutionErrors errorsIndicatingWrongNumberOfArguments =\n\t\t\t\t\tOverloadResolutionErrors.MissingArgumentForRequiredParameter\n\t\t\t\t\t| OverloadResolutionErrors.TooManyPositionalArguments\n\t\t\t\t\t| OverloadResolutionErrors.Inaccessible;\n\t\t\t\n\t\t\tpublic override void VisitConstructorInitializer(ConstructorInitializer constructorInitializer)\n\t\t\t{\n\t\t\t\tbase.VisitConstructorInitializer(constructorInitializer);\n\t\t\t\t\n\t\t\t\t// Check if existing initializer is valid:\n\t\t\t\tvar rr = ctx.Resolve(constructorInitializer) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr != null && (rr.OverloadResolutionErrors & errorsIndicatingWrongNumberOfArguments) != 0) {\n\t\t\t\t\tIType targetType = constructorInitializer.ConstructorInitializerType == ConstructorInitializerType.Base ? baseType : currentType;\n\t\t\t\t\tAddIssue(new CodeIssue(constructorInitializer.Keyword, GetIssueText(targetType, constructorInitializer.Arguments.Count)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\t\t\t\t\n\t\t\t\tvar rr = ctx.Resolve(objectCreateExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr != null && (rr.OverloadResolutionErrors & errorsIndicatingWrongNumberOfArguments) != 0) {\n\t\t\t\t\tAddIssue(new CodeIssue(objectCreateExpression.Type, GetIssueText(rr.Type, objectCreateExpression.Arguments.Count)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbool BaseTypeHasUsableParameterlessConstructor()\n\t\t\t{\n\t\t\t\tif (baseType.Kind == TypeKind.Unknown)\n\t\t\t\t\treturn true; // don't show CS1729 error message if base type is unknown \n\t\t\t\tvar memberLookup = new MemberLookup(currentType.GetDefinition(), ctx.Compilation.MainAssembly);\n\t\t\t\tOverloadResolution or = new OverloadResolution(ctx.Compilation, new ResolveResult[0]);\n\t\t\t\tforeach (var ctor in baseType.GetConstructors()) {\n\t\t\t\t\tif (memberLookup.IsAccessible(ctor, allowProtectedAccess: true)) {\n\t\t\t\t\t\tif (or.AddCandidate(ctor) == OverloadResolutionErrors.None)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tstring GetIssueText(IType targetType, int argumentCount = 0)\n\t\t\t{\n\t\t\t\treturn string.Format(ctx.TranslateString(\"CS1729: The type '{0}' does not contain a constructor that takes '{1}' arguments\"), targetType.Name, argumentCount);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/ExpressionIsNeverOfProvidedTypeIssue.cs",
    "content": "﻿// \n// ExpressionIsNeverOfProvidedTypeIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"CS0184:Given expression is never of the provided type\",\n\t\tDescription = \"CS0184:Given expression is never of the provided type.\",\n\t\tCategory = IssueCategories.CompilerWarnings,\n\t\tSeverity = Severity.Warning)]\n\tpublic class ExpressionIsNeverOfProvidedTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ExpressionIsNeverOfProvidedTypeIssue>\n\t\t{\n\t\t\treadonly CSharpConversions conversions;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tconversions = CSharpConversions.Get(ctx.Compilation);\n\t\t\t}\n\n\t\t\tpublic override void VisitIsExpression(IsExpression isExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIsExpression(isExpression);\n\n//\t\t\t\tvar conversions = CSharpConversions.Get(ctx.Compilation);\n\t\t\t\tvar exprType = ctx.Resolve(isExpression.Expression).Type;\n\t\t\t\tvar providedType = ctx.ResolveType(isExpression.Type);\n\n\t\t\t\tif (exprType.Kind == TypeKind.Unknown || providedType.Kind == TypeKind.Unknown)\n\t\t\t\t\treturn;\n\t\t\t\tif (IsValidReferenceOrBoxingConversion(exprType, providedType))\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar exprTP = exprType as ITypeParameter;\n\t\t\t\tvar providedTP = providedType as ITypeParameter;\n\t\t\t\tif (exprTP != null) {\n\t\t\t\t\tif (IsValidReferenceOrBoxingConversion(exprTP.EffectiveBaseClass, providedType)\n\t\t\t\t\t    && exprTP.EffectiveInterfaceSet.All(i => IsValidReferenceOrBoxingConversion(i, providedType)))\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (providedTP != null) {\n\t\t\t\t\tif (IsValidReferenceOrBoxingConversion(exprType, providedTP.EffectiveBaseClass))\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAddIssue(new CodeIssue(isExpression, ctx.TranslateString(\"Given expression is never of the provided type\")));\n\t\t\t}\n\n\t\t\tbool IsValidReferenceOrBoxingConversion(IType fromType, IType toType)\n\t\t\t{\n\t\t\t\tConversion c = conversions.ExplicitConversion(fromType, toType);\n\t\t\t\treturn c.IsValid && (c.IsIdentityConversion || c.IsReferenceConversion || c.IsBoxingConversion || c.IsUnboxingConversion);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/MissingInterfaceMemberImplementationIssue.cs",
    "content": "//\n// MissingInterfaceMemberImplementationIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Missing interface members\",\n\t\tDescription = \"Searches for missing interface implementations\",\n\t\tCategory = IssueCategories.CompilerErrors,\n\t\tSeverity = Severity.Error)]\n\tpublic class MissingInterfaceMemberImplementationIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<MissingInterfaceMemberImplementationIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration.ClassType == ClassType.Interface || typeDeclaration.ClassType == ClassType.Enum)\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tvar rr = ctx.Resolve(typeDeclaration);\n\t\t\t\tif (rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tforeach (var baseType in typeDeclaration.BaseTypes) {\n\t\t\t\t\tvar bt = ctx.Resolve(baseType);\n\t\t\t\t\tif (bt.IsError || bt.Type.Kind != TypeKind.Interface)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tbool interfaceMissing;\n\t\t\t\t\tvar toImplement = ImplementInterfaceAction.CollectMembersToImplement(rr.Type.GetDefinition(), bt.Type, false, out interfaceMissing);\n\t\t\t\t\tif (toImplement.Count == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tAddIssue(new CodeIssue(baseType, ctx.TranslateString(\"Missing interface member implementations\")) { ActionProvider = { typeof(ImplementInterfaceAction), typeof(ImplementInterfaceExplicitAction)} });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/CompilerErrors/StaticConstructorParameterIssue.cs",
    "content": "﻿//\n// \n// StaticConstructorParameterIssue.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n//      Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Ji Kun\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Static constructor should be parameterless\",\n\t\tDescription = \"Static constructor should be parameterless\",\n\t\tCategory = IssueCategories.CompilerErrors,\n\t\tSeverity = Severity.Error)]\n\tpublic class StaticConstructorParameterIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<StaticConstructorParameterIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tif (!constructorDeclaration.HasModifier(Modifiers.Static) || !constructorDeclaration.Parameters.Any())\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tconstructorDeclaration.Parameters.First().StartLocation,\n\t\t\t\t\tconstructorDeclaration.Parameters.Last().EndLocation,\n\t\t\t\t\tctx.TranslateString(\"Static constructor cannot take parameters\"),\n\t\t\t\t\tctx.TranslateString(\"Remove parameters\"),\n\t\t\t\t\ts => {\n\t\t\t\t\t\tint o1 = ctx.GetOffset(constructorDeclaration.LParToken.EndLocation);\n\t\t\t\t\t\tint o2 = ctx.GetOffset(constructorDeclaration.RParToken.StartLocation);\n\t\t\t\t\t\ts.RemoveText(o1, o2 - o1);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/ConstantConditionIssue.cs",
    "content": "﻿// \n// ConstantConditionIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Condition is always 'true' or always 'false'\",\n\t\tDescription = \"Condition is always 'true' or always 'false'.\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning)]\n\tpublic class ConstantConditionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConstantConditionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\n\t\t\t\tCheckCondition(conditionalExpression.Condition);\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\n\t\t\t\tCheckCondition(ifElseStatement.Condition);\n\t\t\t}\n\n\t\t\tpublic override void VisitWhileStatement(WhileStatement whileStatement)\n\t\t\t{\n\t\t\t\tbase.VisitWhileStatement(whileStatement);\n\n\t\t\t\tCheckCondition(whileStatement.Condition);\n\t\t\t}\n\n\t\t\tpublic override void VisitDoWhileStatement(DoWhileStatement doWhileStatement)\n\t\t\t{\n\t\t\t\tbase.VisitDoWhileStatement(doWhileStatement);\n\n\t\t\t\tCheckCondition(doWhileStatement.Condition);\n\t\t\t}\n\n\t\t\tpublic override void VisitForStatement(ForStatement forStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForStatement(forStatement);\n\n\t\t\t\tCheckCondition(forStatement.Condition);\n\t\t\t}\n\n\t\t\tvoid CheckCondition(Expression condition)\n\t\t\t{\n\t\t\t\tif (condition is PrimitiveExpression)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar resolveResult = ctx.Resolve(condition);\n\t\t\t\tif (!(resolveResult.IsCompileTimeConstant && resolveResult.ConstantValue is bool))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar value = (bool)resolveResult.ConstantValue;\n\t\t\t\tvar conditionalExpr = condition.Parent as ConditionalExpression;\n\t\t\t\tvar ifElseStatement = condition.Parent as IfElseStatement;\n\t\t\t\tvar valueStr = value.ToString().ToLowerInvariant();\n\n\t\t\t\tCodeAction action;\n\t\t\t\tif (conditionalExpr != null) {\n\t\t\t\t\tvar replaceExpr = value ? conditionalExpr.TrueExpression : conditionalExpr.FalseExpression;\n\t\t\t\t\taction = new CodeAction(\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace '?:' with '{0}' branch\"), valueStr),\n\t\t\t\t\t\tscript => script.Replace(conditionalExpr, replaceExpr.Clone()),\n\t\t\t\t\t\tcondition);\n\t\t\t\t} else if (ifElseStatement != null) {\n\t\t\t\t\taction = new CodeAction(\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace 'if' with '{0}' branch\"), valueStr),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar statement = value ? ifElseStatement.TrueStatement : ifElseStatement.FalseStatement;\n\t\t\t\t\t\t\tvar blockStatement = statement as BlockStatement;\n\t\t\t\t\t\t\tif (statement.IsNull || (blockStatement != null && blockStatement.Statements.Count == 0)) {\n\t\t\t\t\t\t\t\tscript.Remove(ifElseStatement);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tTextLocation start, end;\n\t\t\t\t\t\t\tif (blockStatement != null) {\n\t\t\t\t\t\t\t\tstart = blockStatement.Statements.FirstOrNullObject().StartLocation;\n\t\t\t\t\t\t\t\tend = blockStatement.Statements.LastOrNullObject().EndLocation;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstart = statement.StartLocation;\n\t\t\t\t\t\t\t\tend = statement.EndLocation;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tRemoveText(script, ifElseStatement.StartLocation, start);\n\t\t\t\t\t\t\tRemoveText(script, end, ifElseStatement.EndLocation);\n\t\t\t\t\t\t\tscript.FormatText(ifElseStatement.Parent);\n\t\t\t\t\t\t}, condition);\n\t\t\t\t} else {\n\t\t\t\t\taction = new CodeAction(\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace expression with '{0}'\"), valueStr),\n\t\t\t\t\t\tscript => script.Replace(condition, new PrimitiveExpression(value)), \n\t\t\t\t\t\tcondition\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(condition, string.Format(ctx.TranslateString(\"Condition is always '{0}'\"), valueStr), \n\t\t\t\t\tnew [] { action }));\n\t\t\t}\n\n\t\t\tvoid RemoveText(Script script, TextLocation start, TextLocation end)\n\t\t\t{\n\t\t\t\tvar startOffset = script.GetCurrentOffset(start);\n\t\t\t\tvar endOffset = script.GetCurrentOffset(end);\n\t\t\t\tif (startOffset < endOffset)\n\t\t\t\t\tscript.RemoveText(startOffset, endOffset - startOffset);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/ConvertIfToAndExpressionIssue.cs",
    "content": "//\n// ConvertIfToAndExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'if' statement can be re-written as '&&' expression\",\n\t                  Description = \"Convert 'if' to '&&' expression\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Hint)]\n\tpublic class ConvertIfToAndExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertIfToAndExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode ifPattern = \n\t\t\t\tnew IfElseStatement(\n\t\t\t\t\tnew AnyNode (\"condition\"),\n\t\t\t\t\tPatternHelper.EmbeddedStatement (\n\t\t\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\t\t\tnew AnyNode(\"target\"),\n\t\t\t\t\t\t\tnew PrimitiveExpression (false)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\tstatic readonly AstNode varDelarationPattern = \n\t\t\t\tnew VariableDeclarationStatement(new AnyNode(\"type\"), Pattern.AnyString, new AnyNode(\"initializer\"));\n\n\t\t\tvoid AddTo(IfElseStatement ifElseStatement, VariableDeclarationStatement varDeclaration, Expression expr)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\n\t\t\t\tvar match = ifPattern.Match(ifElseStatement);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tvar varDeclaration = ifElseStatement.GetPrevSibling(s => s.Role == BlockStatement.StatementRole) as VariableDeclarationStatement;\n\t\t\t\t\tvar target = match.Get<Expression>(\"target\").Single();\n\t\t\t\t\tvar match2 = varDelarationPattern.Match(varDeclaration);\n\t\t\t\t\tif (match2.Success) {\n\t\t\t\t\t\tvar initializer = varDeclaration.Variables.FirstOrDefault();\n\t\t\t\t\t\tif (initializer != null && target is IdentifierExpression && ((IdentifierExpression)target).Identifier != initializer.Name)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tvar expr = match.Get<Expression>(\"condition\").Single();\n\t\t\t\t\t\tif (!ConvertIfToOrExpressionIssue.CheckTarget(target, expr))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Convert to '&&' expresssion\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Replace with '&&'\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tvar variable = initializer;\n\t\t\t\t\t\t\t\tvar initalizerExpression = variable.Initializer.Clone();\n\t\t\t\t\t\t\t\tvar bOp = initalizerExpression as BinaryOperatorExpression;\n\t\t\t\t\t\t\t\tif (bOp != null && bOp.Operator == BinaryOperatorType.ConditionalOr)\n\t\t\t\t\t\t\t\t\tinitalizerExpression = new ParenthesizedExpression (initalizerExpression);\n\t\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\t\tvarDeclaration, \n\t\t\t\t\t\t\t\t\tnew VariableDeclarationStatement(\n\t\t\t\t\t\t\t\t\t\tvarDeclaration.Type.Clone(),\n\t\t\t\t\t\t\t\t\t\tvariable.Name,\n\t\t\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(initalizerExpression, BinaryOperatorType.ConditionalAnd, CSharpUtil.InvertCondition(expr)) \n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tscript.Remove(ifElseStatement); \n\t\t\t\t\t\t}\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tIssueMarker = IssueMarker.DottedLine\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar expr = match.Get<Expression>(\"condition\").Single();\n\t\t\t\t\t\tif (!ConvertIfToOrExpressionIssue.CheckTarget(target, expr))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Convert to '&=' expresssion\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Replace with '&='\"),\n\t\t\t\t\t\t\tscript =>\n\t\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\t\tifElseStatement, \n\t\t\t\t\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\t\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\t\t\t\t\t\t\ttarget.Clone(),\n\t\t\t\t\t\t\t\t\t\t\tAssignmentOperatorType.BitwiseAnd,\n\t\t\t\t\t\t\t\t\t\t\tCSharpUtil.InvertCondition(expr)\n\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.DottedLine });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/LockThisIssue.cs",
    "content": "// LockThisIssue.cs \n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis <luiscubal@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Threading.Tasks;\nusing System.Runtime.CompilerServices;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Use of lock (this) or MethodImplOptions.Synchronized is discouraged\",\n\t                  Description = \"Warns about using lock (this) or MethodImplOptions.Synchronized.\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning)]\n\tpublic class LockThisIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<LockThisIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitAttribute(Attribute attribute)\n\t\t\t{\n\t\t\t\tbase.VisitAttribute(attribute);\n\n\t\t\t\tif (IsMethodSynchronizedAttribute(attribute)) {\n\t\t\t\t\tvar fixAction = new CodeAction(ctx.TranslateString(\"Create private locker field\"), script => {\n\t\t\t\t\t\tvar containerEntity = GetParentMethodOrProperty(attribute);\n\t\t\t\t\t\tvar containerType = containerEntity.GetParent<TypeDeclaration>();\n\n\t\t\t\t\t\tFixLockThisIssue(script, containerEntity, containerType);\n\t\t\t\t\t}, attribute);\n\n\t\t\t\t\tAddIssue(new CodeIssue(attribute, ctx.TranslateString(\"Found [MethodImpl(MethodImplOptions.Synchronized)]\"), fixAction));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic EntityDeclaration GetParentMethodOrProperty(AstNode node)\n\t\t\t{\n\t\t\t\tvar containerEntity = node.GetParent<EntityDeclaration>();\n\t\t\t\tif (containerEntity is Accessor) {\n\t\t\t\t\tcontainerEntity = containerEntity.GetParent<EntityDeclaration>();\n\t\t\t\t}\n\n\t\t\t\treturn containerEntity;\n\t\t\t}\n\n\t\t\tpublic override void VisitLockStatement(LockStatement lockStatement)\n\t\t\t{\n\t\t\t\tbase.VisitLockStatement(lockStatement);\n\n\t\t\t\tvar expression = lockStatement.Expression;\n\n\t\t\t\tif (IsThisReference(expression)) {\n\t\t\t\t\tvar fixAction = new CodeAction(ctx.TranslateString(\"Create private locker field\"), script => {\n\t\t\t\t\t\tvar containerEntity = GetParentMethodOrProperty(lockStatement);\n\n\t\t\t\t\t\tvar containerType = containerEntity.GetParent<TypeDeclaration>();\n\n\t\t\t\t\t\tFixLockThisIssue(script, containerEntity, containerType);\n\n\t\t\t\t\t}, lockStatement);\n\n\t\t\t\t\tAddIssue(new CodeIssue(lockStatement.LockToken.StartLocation,\n\t\t\t\t\t\tlockStatement.RParToken.EndLocation, ctx.TranslateString(\"Found lock (this)\"), fixAction));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic bool IsEntityStatic(EntityDeclaration containerEntity)\n\t\t\t{\n\t\t\t\treturn containerEntity.Modifiers.HasFlag(Modifiers.Static);\n\t\t\t}\n\n\t\t\tvoid FixLockThisIssue(Script script, EntityDeclaration containerEntity, TypeDeclaration containerType)\n\t\t\t{\n\t\t\t\tbool isStatic = IsEntityStatic(containerEntity);\n\n\t\t\t\tList<BlockStatement> synchronizedStatements = FixMethodsWithMethodImplAttribute(script, containerType, isStatic).ToList();\n\n\t\t\t\tList<AstNode> linkNodes = new List<AstNode>();\n\n\t\t\t\tvar locksToModify = LocksToModify(containerType, synchronizedStatements);\n\t\t\t\tList<AstNode> nodeContexts = new List<AstNode>(locksToModify);\n\n\t\t\t\tforeach (var synchronizedStatement in synchronizedStatements) {\n\t\t\t\t\tif (synchronizedStatement.Statements.Count > 0) {\n\t\t\t\t\t\tnodeContexts.Add(synchronizedStatement.Statements.First());\n\n\t\t\t\t\t\tif (!isStatic) {\n\t\t\t\t\t\t\tforeach (var childLock in synchronizedStatement.Descendants.OfType<LockStatement>()) {\n\t\t\t\t\t\t\t\tif (IsThisReference(childLock.Expression)) {\n\t\t\t\t\t\t\t\t\tnodeContexts.Add(childLock);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstring proposedName = GetNameProposal(nodeContexts, \"locker\");\n\n\t\t\t\tif (!isStatic) {\n\t\t\t\t\tforeach (var lockToModify in locksToModify) {\n\t\t\t\t\t\tvar identifier = new IdentifierExpression (proposedName);\n\t\t\t\t\t\tscript.Replace(lockToModify.Expression, identifier);\n\n\t\t\t\t\t\tlinkNodes.Add(identifier);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach (var synchronizedStatement in synchronizedStatements) {\n\t\t\t\t\tif (synchronizedStatement.Statements.Count > 0) {\n\t\t\t\t\t\tvar newBody = synchronizedStatement.Clone();\n\n\t\t\t\t\t\tvar outerLock = new LockStatement();\n\t\t\t\t\t\tvar outerLockIdentifier = new IdentifierExpression (proposedName);\n\t\t\t\t\t\touterLock.Expression = outerLockIdentifier;\n\t\t\t\t\t\touterLock.EmbeddedStatement = newBody;\n\n\t\t\t\t\t\tlinkNodes.Add(outerLockIdentifier);\n\n\t\t\t\t\t\tif (!isStatic) {\n\t\t\t\t\t\t\tforeach (var childLock in newBody.Descendants.OfType<LockStatement>()) {\n\t\t\t\t\t\t\t\tif (IsThisReference(childLock.Expression)) {\n\t\t\t\t\t\t\t\t\tvar identifier = new IdentifierExpression (proposedName);\n\t\t\t\t\t\t\t\t\tchildLock.Expression.ReplaceWith(identifier);\n\n\t\t\t\t\t\t\t\t\tlinkNodes.Add(identifier);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscript.InsertBefore(synchronizedStatement.Statements.First(), outerLock);\n\n\t\t\t\t\t\tforeach (var stmt in synchronizedStatement.Statements) {\n\t\t\t\t\t\t\tscript.Remove(stmt);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (linkNodes.Any()) {\n\t\t\t\t\tvar objectType = new PrimitiveType(\"object\");\n\n\t\t\t\t\tvar lockerFieldDeclaration = new FieldDeclaration() {\n\t\t\t\t\t\tModifiers = isStatic ? Modifiers.Static : Modifiers.None,\n\t\t\t\t\t\tReturnType = objectType.Clone()\n\t\t\t\t\t};\n\n\t\t\t\t\tvar lockerVariable = new VariableInitializer(proposedName, new ObjectCreateExpression(objectType.Clone()));\n\t\t\t\t\tlockerFieldDeclaration.Variables.Add(lockerVariable);\n\t\t\t\t\tscript.InsertBefore(containerEntity, lockerFieldDeclaration);\n\n\t\t\t\t\tlinkNodes.Add(lockerVariable.NameToken);\n\n\t\t\t\t\tscript.Link(linkNodes.ToArray());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstring GetNameProposal(List<AstNode> nodeContexts, string baseName)\n\t\t\t{\n\t\t\t\tvar resolverStates = nodeContexts.Select(ctx.GetResolverStateBefore).ToList();\n\t\t\t\tstring nameProposal;\n\t\t\t\tint n = 0;\n\t\t\t\tdo {\n\t\t\t\t\tnameProposal = baseName + (n == 0 ? string.Empty : n.ToString());\n\t\t\t\t\tn++;\n\t\t\t\t} while (IdentifierNameExists(resolverStates, nameProposal));\n\t\t\t\treturn nameProposal;\n\t\t\t}\n\n\t\t\tstatic bool IdentifierNameExists(List<CSharpResolver> resolverStates, string nameProposal)\n\t\t\t{\n\t\t\t\treturn resolverStates.Any(resolverState => {\n\t\t\t\t\tResolveResult result = resolverState.LookupSimpleNameOrTypeName(nameProposal, new List<IType>(), NameLookupMode.Expression);\n\t\t\t\t\treturn !result.IsError;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tIEnumerable<LockStatement> LocksToModify(TypeDeclaration containerType, IEnumerable<BlockStatement> synchronizedStatements)\n\t\t\t{\n\t\t\t\tforeach (var lockToModify in LocksInType(containerType)) {\n\t\t\t\t\tif (lockToModify.Ancestors.OfType<BlockStatement>()\n\t\t\t\t\t    .Any(ancestor => synchronizedStatements.Contains(ancestor))) {\n\n\t\t\t\t\t\t//These will be modified separately\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!IsThisReference (lockToModify.Expression)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tyield return lockToModify;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIEnumerable<BlockStatement> FixMethodsWithMethodImplAttribute(Script script, TypeDeclaration containerType, bool isStatic)\n\t\t\t{\n\t\t\t\tvar bodies = new List<BlockStatement>();\n\n\t\t\t\tforeach (var entityDeclarationToModify in EntitiesInType(containerType)) {\n\t\t\t\t\tvar methodDeclaration = entityDeclarationToModify as MethodDeclaration;\n\t\t\t\t\tvar accessor = entityDeclarationToModify as Accessor;\n\t\t\t\t\tif (methodDeclaration == null && accessor == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((methodDeclaration != null && IsEntityStatic(methodDeclaration) != isStatic) ||\n\t\t\t\t\t    (accessor != null && IsEntityStatic(accessor.GetParent<EntityDeclaration>()) != isStatic)) {\n\t\t\t\t\t\t//These will need a separate lock and therefore will not be changed.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar attributes = entityDeclarationToModify.Attributes.SelectMany(attributeSection => attributeSection.Attributes);\n\t\t\t\t\tvar methodSynchronizedAttribute = attributes.FirstOrDefault(IsMethodSynchronizedAttribute);\n\t\t\t\t\tif (methodSynchronizedAttribute != null) {\n\t\t\t\t\t\tshort methodImplValue = GetMethodImplValue(methodSynchronizedAttribute);\n\t\t\t\t\t\tshort newValue = (short)(methodImplValue & ~((short)MethodImplOptions.Synchronized));\n\t\t\t\t\t\tif (newValue != 0) {\n\t\t\t\t\t\t\tInsertNewAttribute(script, methodSynchronizedAttribute, newValue);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar section = methodSynchronizedAttribute.GetParent<AttributeSection>();\n\t\t\t\t\t\t\tif (section.Attributes.Count == 1) {\n\t\t\t\t\t\t\t\tscript.Remove(section);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tscript.Remove(methodSynchronizedAttribute);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbool isAbstract = entityDeclarationToModify.Modifiers.HasFlag(Modifiers.Abstract);\n\t\t\t\t\t\tif (!isAbstract) {\n\t\t\t\t\t\t\tvar body = methodDeclaration == null ? accessor.Body : methodDeclaration.Body;\n\t\t\t\t\t\t\tbodies.Add(body);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn bodies;\n\t\t\t}\n\n\t\t\tvoid InsertNewAttribute(Script script, Attribute attribute, short newValue) {\n\t\t\t\tvar availableValues = (MethodImplOptions[]) Enum.GetValues(typeof(MethodImplOptions));\n\t\t\t\tvar activeValues = availableValues.Where(value => (newValue & (short)value) != 0).ToList();\n\n\t\t\t\tvar astBuilder = ctx.CreateTypeSystemAstBuilder(attribute);\n\t\t\t\tvar methodImplOptionsType = astBuilder.ConvertType(new FullTypeName(typeof(MethodImplOptions).FullName));\n\n\t\t\t\tExpression expression = CreateMethodImplReferenceNode(activeValues[0], methodImplOptionsType);\n\t\t\t\tfor (int optionIndex = 1; optionIndex < activeValues.Count; ++optionIndex) {\n\t\t\t\t\texpression = new BinaryOperatorExpression(expression,\n\t\t\t\t\t                                          BinaryOperatorType.BitwiseOr,\n\t\t\t\t\t                                          CreateMethodImplReferenceNode(activeValues [optionIndex], methodImplOptionsType));\n\t\t\t\t}\n\n\t\t\t\tvar newAttribute = new Attribute();\n\t\t\t\tnewAttribute.Type = attribute.Type.Clone();\n\t\t\t\tnewAttribute.Arguments.Add(expression);\n\n\t\t\t\tscript.Replace(attribute, newAttribute);\n\t\t\t}\n\n\t\t\tstatic MemberReferenceExpression CreateMethodImplReferenceNode(MethodImplOptions option, AstType methodImplOptionsType)\n\t\t\t{\n\t\t\t\treturn methodImplOptionsType.Clone().Member(Enum.GetName(typeof(MethodImplOptions), option));\n\t\t\t}\n\n\t\t\tbool IsMethodSynchronizedAttribute(Attribute attribute)\n\t\t\t{\n\t\t\t\tvar unresolvedType = attribute.Type;\n\t\t\t\tvar resolvedType = ctx.ResolveType(unresolvedType);\n\n\t\t\t\tif (resolvedType.FullName != typeof(MethodImplAttribute).FullName) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tshort methodImpl = GetMethodImplValue(attribute);\n\n\t\t\t\treturn (methodImpl & (short) MethodImplOptions.Synchronized) != 0;\n\t\t\t}\n\n\t\t\tshort GetMethodImplValue(Attribute attribute)\n\t\t\t{\n\t\t\t\tshort methodImpl = 0;\n\t\t\t\tforeach (var argument in attribute.Arguments) {\n\t\t\t\t\tvar namedExpression = argument as NamedExpression;\n\n\t\t\t\t\tif (namedExpression == null) {\n\t\t\t\t\t\tshort? implValue = GetMethodImplOptionsAsShort(argument);\n\n\t\t\t\t\t\tif (implValue != null) {\n\t\t\t\t\t\t\tmethodImpl = (short)implValue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if (namedExpression.Name == \"Value\") {\n\t\t\t\t\t\tshort? implValue = GetMethodImplOptionsAsShort(namedExpression.Expression);\n\n\t\t\t\t\t\tif (implValue != null) {\n\t\t\t\t\t\t\tmethodImpl = (short)implValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn methodImpl;\n\t\t\t}\n\n\t\t\tshort? GetMethodImplOptionsAsShort(AstNode argument)\n\t\t\t{\n\t\t\t\t//Returns null if the value could not be guessed\n\n\t\t\t\tvar result = ctx.Resolve(argument);\n\t\t\t\tif (!result.IsCompileTimeConstant) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif (result.Type.FullName == typeof(MethodImplOptions).FullName) {\n\t\t\t\t\treturn (short)(MethodImplOptions)result.ConstantValue;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tstatic IEnumerable<EntityDeclaration> EntitiesInType(TypeDeclaration containerType)\n\t\t\t{\n\t\t\t\treturn containerType.Descendants.OfType<EntityDeclaration>().Where(entityDeclaration => {\n\t\t\t\t\tvar childContainerType = entityDeclaration.GetParent<TypeDeclaration>();\n\n\t\t\t\t\treturn childContainerType == containerType;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tstatic IEnumerable<LockStatement> LocksInType(TypeDeclaration containerType)\n\t\t\t{\n\t\t\t\treturn containerType.Descendants.OfType<LockStatement>().Where(lockStatement => {\n\t\t\t\t\tvar childContainerType = lockStatement.GetParent<TypeDeclaration>();\n\n\t\t\t\t\treturn childContainerType == containerType;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tstatic bool IsThisReference (Expression expression)\n\t\t\t{\n\t\t\t\tif (expression is ThisReferenceExpression) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar parenthesizedExpression = expression as ParenthesizedExpression;\n\t\t\t\tif (parenthesizedExpression != null) {\n\t\t\t\t\treturn IsThisReference(parenthesizedExpression.Expression);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/MixedUseOfFieldsAndGettersIssue.cs",
    "content": "//\n// MixedUseOfFieldsAndGettersIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Threading.Tasks;\nusing System.Runtime.CompilerServices;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Detects if fields & simple getters are used at the same time inside a class.\",\n//\t                  Description = \"Detects if fields & simple getters are used at the same time inside a class.\",\n//\t                  Category = IssueCategories.CodeQualityIssues,\n//\t                  Severity = Severity.Suggestion)]\n//\tpublic class MixedUseOfFieldsAndGettersIssue : GatherVisitorCodeIssueProvider\n//\t{\n//\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n//\t\t{\n//\t\t\treturn new GatherVisitor(context);\n//\t\t}\n//\n//\t\tclass GatherVisitor : GatherVisitorBase<LockThisIssue>\n//\t\t{\n//\t\t\tpublic GatherVisitor (BaseRefactoringContext context) : base (context)\n//\t\t\t{\n//\t\t\t}\n//\n//\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n//\t\t\t{\n//\t\t\t\tforeach (var entity in typeDeclaration.Members) {\n//\t\t\t\t\tvar propertyDeclaration = entity as PropertyDeclaration;\n//\t\t\t\t\tif (propertyDeclaration == null)\n//\t\t\t\t\t\tcontinue;\n//\n//\t\t\t\t}\n//\n//\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n//\n//\n//\n//\t\t\t}\n//\n//\t\t}\n//\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/NegativeRelationalExpressionIssue.cs",
    "content": "﻿// \n// NegativeRelationalExpressionIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Simplify negative relational expression\",\n\t\t\t\t\t   Description = \"Simplify negative relational expression\",\n                       Category = IssueCategories.PracticesAndImprovements,\n\t\t\t\t\t   Severity = Severity.Suggestion)]\n\tpublic class NegativeRelationalExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<NegativeRelationalExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tbool IsFloatingPoint (AstNode node)\n\t\t\t{\n\t\t\t\tvar typeDef = ctx.Resolve (node).Type.GetDefinition ();\n\t\t\t\treturn typeDef != null &&\n\t\t\t\t\t(typeDef.KnownTypeCode == KnownTypeCode.Single || typeDef.KnownTypeCode == KnownTypeCode.Double);\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitUnaryOperatorExpression (unaryOperatorExpression);\n\n\t\t\t\tif (unaryOperatorExpression.Operator != UnaryOperatorType.Not)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar expr = unaryOperatorExpression.Expression;\n\t\t\t\twhile (expr != null && expr is ParenthesizedExpression)\n\t\t\t\t\texpr = ((ParenthesizedExpression)expr).Expression;\n\n\t\t\t\tvar binaryOperatorExpr = expr as BinaryOperatorExpression;\n\t\t\t\tif (binaryOperatorExpr == null)\n\t\t\t\t\treturn;\n\t\t\t\tswitch (binaryOperatorExpr.Operator) {\n\t\t\t\t\tcase BinaryOperatorType.BitwiseAnd:\n\t\t\t\t\tcase BinaryOperatorType.BitwiseOr:\n\t\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\tcase BinaryOperatorType.ExclusiveOr:\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar negatedOp = CSharpUtil.NegateRelationalOperator(binaryOperatorExpr.Operator);\n\t\t\t\tif (negatedOp == BinaryOperatorType.Any)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (IsFloatingPoint (binaryOperatorExpr.Left) || IsFloatingPoint (binaryOperatorExpr.Right)) {\n\t\t\t\t\tif (negatedOp != BinaryOperatorType.Equality && negatedOp != BinaryOperatorType.InEquality)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tAddIssue (new CodeIssue(unaryOperatorExpression, ctx.TranslateString (\"Simplify negative relational expression\"), ctx.TranslateString (\"Simplify negative relational expression\"),\n\t\t\t\t\tscript => script.Replace (unaryOperatorExpression,\n\t\t\t\t\t\tnew BinaryOperatorExpression (binaryOperatorExpr.Left.Clone (), negatedOp,\n\t\t\t\t\t\t\tbinaryOperatorExpr.Right.Clone ()))));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tif (operatorDeclaration.OperatorType.IsComparisonOperator()) {\n\t\t\t\t\t// Ignore operator declaration; within them it's common to define one operator\n\t\t\t\t\t// by negating another.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbase.VisitOperatorDeclaration(operatorDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/NotImplementedExceptionIssue.cs",
    "content": "﻿// \n// NotImplementedExceptionInspector.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// This inspector just shows that there is a not implemented exception. It doesn't offer a fix.\n\t/// Should only be shown in overview bar, no underlining.\n\t/// </summary>\n\t[IssueDescription(\"Show NotImplementedExceptions\", Description=\"Shows NotImplementedException throws in the quick task bar.\", Category = IssueCategories.Notifications, Severity = Severity.Suggestion)]\n\tpublic class NotImplementedExceptionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<NotImplementedExceptionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, NotImplementedExceptionIssue qualifierDirectiveEvidentIssueProvider) : base (ctx, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitThrowStatement(ThrowStatement throwStatement)\n\t\t\t{\n\t\t\t\tvar result = ctx.Resolve(throwStatement.Expression);\n\t\t\t\tif (result.Type.Equals(ctx.Compilation.FindType(typeof(System.NotImplementedException)))) {\n\t\t\t\t\tAddIssue(new CodeIssue(throwStatement, ctx.TranslateString(\"NotImplemented exception thrown\")) { IssueMarker = IssueMarker.None });\n\t\t\t\t}\n\n\t\t\t\tbase.VisitThrowStatement(throwStatement);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/ParameterOnlyAssignedIssue.cs",
    "content": "﻿// \n// ParameterOnlyAssignedIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Parameter is only assigned\",\n\t\t\t\t\t   Description = \"Parameter is assigned but its value is never used.\",\n\t\t\t\t\t   Category = IssueCategories.CodeQualityIssues,\n\t\t\t\t\t   Severity = Severity.Warning)]\n\tpublic class ParameterOnlyAssignedIssue : VariableOnlyAssignedIssue\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tprivate class GatherVisitor : GatherVisitorBase<ParameterOnlyAssignedIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitParameterDeclaration(parameterDeclaration);\n\n\t\t\t\tvar resolveResult = ctx.Resolve(parameterDeclaration) as LocalResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar parameterModifier = parameterDeclaration.ParameterModifier;\n\t\t\t\tif (parameterModifier == ParameterModifier.Out || parameterModifier == ParameterModifier.Ref ||\n\t\t\t\t\t!TestOnlyAssigned(ctx, parameterDeclaration.Parent, resolveResult.Variable)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(parameterDeclaration.NameToken, \n\t\t\t\t\tctx.TranslateString(\"Parameter is assigned but its value is never used\")));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantAssignmentIssue.cs",
    "content": "﻿// \n// RedundantAssignmentIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant assignment\",\n\t                  Description = \"Value assigned to a variable or parameter is not used in all execution path.\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning)]\n\tpublic class RedundantAssignmentIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar unit = context.RootNode as SyntaxTree;\n\t\t\tif (unit == null)\n\t\t\t\treturn null;\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantAssignmentIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitParameterDeclaration(parameterDeclaration);\n\t\t\t\tif (parameterDeclaration.ParameterModifier == ParameterModifier.Out ||\n\t\t\t\t\tparameterDeclaration.ParameterModifier == ParameterModifier.Ref)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar resolveResult = ctx.Resolve(parameterDeclaration) as LocalResolveResult;\n\t\t\t\tBlockStatement rootStatement = null;\n\t\t\t\tif (parameterDeclaration.Parent is MethodDeclaration) {\n\t\t\t\t\trootStatement = ((MethodDeclaration)parameterDeclaration.Parent).Body;\n\t\t\t\t} else if (parameterDeclaration.Parent is AnonymousMethodExpression) {\n\t\t\t\t\trootStatement = ((AnonymousMethodExpression)parameterDeclaration.Parent).Body;\n\t\t\t\t} else if (parameterDeclaration.Parent is LambdaExpression) {\n\t\t\t\t\trootStatement = ((LambdaExpression)parameterDeclaration.Parent).Body as BlockStatement;\n\t\t\t\t}\n\t\t\t\tCollectIssues(parameterDeclaration, rootStatement, resolveResult);\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tbase.VisitVariableInitializer(variableInitializer);\n\t\t\t\tif (!inUsingStatementResourceAcquisition) {\n\t\t\t\t\tvar resolveResult = ctx.Resolve(variableInitializer) as LocalResolveResult;\n\t\t\t\t\tCollectIssues(variableInitializer, variableInitializer.GetParent<BlockStatement>(), resolveResult);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool inUsingStatementResourceAcquisition;\n\n\t\t\tpublic override void VisitUsingStatement(UsingStatement usingStatement)\n\t\t\t{\n\t\t\t\tinUsingStatementResourceAcquisition = true;\n\t\t\t\tusingStatement.ResourceAcquisition.AcceptVisitor(this);\n\t\t\t\tinUsingStatementResourceAcquisition = false;\n\t\t\t\tusingStatement.EmbeddedStatement.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tvoid CollectIssues(AstNode variableDecl, BlockStatement rootStatement, LocalResolveResult resolveResult)\n\t\t\t{\n\t\t\t\tif (rootStatement == null || resolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar references = new HashSet<AstNode>();\n\t\t\t\tvar refStatements = new HashSet<Statement>();\n\t\t\t\tvar usedInLambda = false;\n\t\t\t\tvar results = ctx.FindReferences(rootStatement, resolveResult.Variable);\n\t\t\t\tforeach (var result in results) {\n\t\t\t\t\tvar node = result.Node;\n\t\t\t\t\tif (node == variableDecl)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar parent = node.Parent;\n\t\t\t\t\twhile (!(parent == null || parent is Statement || parent is LambdaExpression || parent is QueryExpression))\n\t\t\t\t\t\tparent = parent.Parent;\n\t\t\t\t\tif (parent == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar statement = parent as Statement;\n\t\t\t\t\tif (statement != null) {\n\t\t\t\t\t\treferences.Add(node);\n\t\t\t\t\t\trefStatements.Add(statement);\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (parent != null && parent != rootStatement) {\n\t\t\t\t\t\tif (parent is LambdaExpression || parent is AnonymousMethodExpression || parent is QueryExpression) {\n\t\t\t\t\t\t\tusedInLambda = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparent = parent.Parent;\n\t\t\t\t\t}\n\t\t\t\t\tif (usedInLambda) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// stop analyzing if the variable is used in any lambda expression or anonymous method\n\t\t\t\tif (usedInLambda)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar startNode = new VariableReferenceGraphBuilder(ctx).Build(rootStatement, references, refStatements, ctx);\n\t\t\t\tvar variableInitializer = variableDecl as VariableInitializer;\n\t\t\t\tif (variableInitializer != null && !variableInitializer.Initializer.IsNull)\n\t\t\t\t\tstartNode.References.Insert(0, variableInitializer);\n\n\t\t\t\tProcessNodes(startNode);\n\t\t\t}\n\n\t\t\tclass SearchInvocationsVisitor : DepthFirstAstVisitor\n\t\t\t{\n\t\t\t\tbool foundInvocations;\n\n\t\t\t\tpublic bool ContainsInvocations(AstNode node)\n\t\t\t\t{\n\t\t\t\t\tfoundInvocations = false;\n\t\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t\t\treturn foundInvocations;\n\t\t\t\t}\n\n\t\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t\t{\n\t\t\t\t\tAstNode next;\n\t\t\t\t\tfor (var child = node.FirstChild; child != null && !foundInvocations; child = next) {\n\t\t\t\t\t\tnext = child.NextSibling;\n\t\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t\t{\n\t\t\t\t\tfoundInvocations = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate class SearchRefOrOutVisitor : DepthFirstAstVisitor\n\t\t\t{\n\t\t\t\tprivate bool foundInvocations;\n\t\t\t\tprivate string _varName;\n\n\t\t\t\tpublic bool ContainsRefOrOut(VariableInitializer variableInitializer)\n\t\t\t\t{\n\t\t\t\t\tvar node = variableInitializer.Parent.Parent;\n\t\t\t\t\tfoundInvocations = false;\n\t\t\t\t\t_varName = variableInitializer.Name;\n\t\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t\t\treturn foundInvocations;\n\t\t\t\t}\n\n\t\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t\t{\n\t\t\t\t\tAstNode next;\n\t\t\t\t\tfor (var child = node.FirstChild; child != null && !foundInvocations; child = next) {\n\t\t\t\t\t\tnext = child.NextSibling;\n\t\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic override void VisitInvocationExpression(InvocationExpression methodDeclaration)\n\t\t\t\t{\n\t\t\t\t\tif (foundInvocations)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (methodDeclaration.Arguments.Count == 0)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tforeach (var argument in methodDeclaration.Arguments) {\n\t\t\t\t\t\tvar directionExpression = argument as DirectionExpression;\n\t\t\t\t\t\tif (directionExpression == null)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tif (directionExpression.FieldDirection != FieldDirection.Out && directionExpression.FieldDirection != FieldDirection.Ref)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar idExpression = (directionExpression.Expression) as IdentifierExpression;\n\t\t\t\t\t\tif (idExpression == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tfoundInvocations = (idExpression.Identifier == _varName);\n\n\t\t\t\t\t\tfoundInvocations = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclass SearchAssignmentForVarVisitor : DepthFirstAstVisitor\n\t\t\t{\n\t\t\t\tbool _foundInvocations;\n\t\t\t\tprivate VariableInitializer _variableInitializer;\n\n\t\t\t\tpublic bool ContainsLaterAssignments(VariableInitializer variableInitializer)\n\t\t\t\t{\n\t\t\t\t\t_foundInvocations = false;\n\t\t\t\t\t_variableInitializer = variableInitializer;\n\t\t\t\t\tvariableInitializer.Parent.Parent.AcceptVisitor(this);\n\t\t\t\t\treturn _foundInvocations;\n\t\t\t\t}\n\n\t\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t\t{\n\t\t\t\t\tAstNode next;\n\t\t\t\t\tfor (var child = node.FirstChild; child != null && !_foundInvocations; child = next) {\n\t\t\t\t\t\tnext = child.NextSibling;\n\t\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t\t{\n\t\t\t\t\tif (_foundInvocations)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t\t\t\tif (assignmentExpression.Left.ToString() == _variableInitializer.Name\n\t\t\t\t\t\t&& assignmentExpression.StartLocation > _variableInitializer.StartLocation) {\n\t\t\t\t\t\t_foundInvocations = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool ContainsOtherAssignments(AstNode parent)\n\t\t\t{\n\t\t\t\tint count = 0;\n\t\t\t\tforeach (var child in parent.Children.OfType<VariableInitializer>()) {\n\t\t\t\t\tcount++;\n\t\t\t\t\tif (count > 1)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvoid AddIssue(AstNode node)\n\t\t\t{\n\t\t\t\tvar issueDescription = ctx.TranslateString(\"Assignment is redundant\");\n\t\t\t\tvar actionDescription = ctx.TranslateString(\"Remove redundant assignment\");\n\n\t\t\t\tvar variableInitializer = node as VariableInitializer;\n\t\t\t\tif (variableInitializer != null) {\n\t\t\t\t\tvar containsInvocations =\n\t\t\t\t\t\tnew SearchInvocationsVisitor().ContainsInvocations(variableInitializer.Initializer);\n\n\t\t\t\t\tvar varDecl = node.Parent as VariableDeclarationStatement;\n\n\t\t\t\t\tvar isDeclareStatement = varDecl != null;\n\t\t\t\t\tvar isUsingVar = isDeclareStatement && varDecl.Type.IsVar();\n\n\t\t\t\t\tvar expressionType = ctx.Resolve(node).Type;\n\n\t\t\t\t\tvar containsLaterAssignments = false;\n\t\t\t\t\tif (isDeclareStatement) {\n\t\t\t\t\t\t//if it is used later, the redundant removal should remove the assignment \n\t\t\t\t\t\t//but not the variable\n\t\t\t\t\t\tcontainsLaterAssignments = \n\t\t\t\t\t\t\tnew SearchAssignmentForVarVisitor().ContainsLaterAssignments(variableInitializer);\n\t\t\t\t\t}\n\n\t\t\t\t\tAstNode grayOutNode;\n\t\t\t\t\tvar containsRefOrOut = new SearchRefOrOutVisitor().ContainsRefOrOut(variableInitializer);\n\t\t\t\t\tif (containsInvocations && isDeclareStatement) {\n\t\t\t\t\t\tgrayOutNode = variableInitializer.AssignToken;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (isDeclareStatement && !containsRefOrOut && !containsLaterAssignments && !ContainsOtherAssignments(variableInitializer.Parent)) {\n\t\t\t\t\t\t\tgrayOutNode = variableInitializer.Parent;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tgrayOutNode = variableInitializer.Initializer;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tAddIssue(new CodeIssue(grayOutNode, issueDescription, actionDescription, script => {\n\t\t\t\t\t\tvar variableNode = (VariableInitializer)node;\n\t\t\t\t\t\tif (containsInvocations && isDeclareStatement) {\n\t\t\t\t\t\t\t//add the column ';' that will be removed after the next line replacement\n\t\t\t\t\t\t\tvar expression = (Statement)variableNode.Initializer.Clone();\n\t\t\t\t\t\t\tif (containsLaterAssignments && varDecl != null) {\n\t\t\t\t\t\t\t\tvar clonedDefinition = (VariableDeclarationStatement)varDecl.Clone();\n\n\t\t\t\t\t\t\t\tvar shortExpressionType = CreateShortType(ctx, expressionType, node);\n\t\t\t\t\t\t\t\tclonedDefinition.Type = shortExpressionType;\n\t\t\t\t\t\t\t\tvar variableNodeClone = clonedDefinition.GetVariable(variableNode.Name);\n\t\t\t\t\t\t\t\tvariableNodeClone.Initializer = null;\n\t\t\t\t\t\t\t\tscript.InsertBefore(node.Parent, clonedDefinition);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tscript.Replace(node.Parent, expression);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isDeclareStatement && !containsRefOrOut && !containsLaterAssignments&& !ContainsOtherAssignments(variableInitializer.Parent)) {\n\t\t\t\t\t\t\tscript.Remove(node.Parent);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar replacement = (VariableInitializer)variableNode.Clone();\n\t\t\t\t\t\treplacement.Initializer = Expression.Null;\n\t\t\t\t\t\tif (isUsingVar) {\n\t\t\t\t\t\t\tvar shortExpressionType = CreateShortType(ctx, expressionType, node);\n\t\t\t\t\t\t\tscript.Replace(varDecl.Type, shortExpressionType);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscript.Replace(node, replacement);\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\n\t\t\t\tvar assignmentExpr = node.Parent as AssignmentExpression;\n\t\t\t\tif (assignmentExpr == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (assignmentExpr.Parent is ExpressionStatement) {\n\t\t\t\t\tAddIssue(new CodeIssue(assignmentExpr.Parent, issueDescription, actionDescription, script => script.Remove(assignmentExpr.Parent)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t} else {\n\t\t\t\t\tAddIssue(new CodeIssue(assignmentExpr.Left.StartLocation, assignmentExpr.OperatorToken.EndLocation, issueDescription, actionDescription,\n\t\t\t\t\t\tscript => script.Replace(assignmentExpr, assignmentExpr.Right.Clone())) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate static AstType CreateShortType(BaseRefactoringContext refactoringContext, IType expressionType, AstNode node)\n\t\t\t{\n\n\t\t\t\tvar csResolver = refactoringContext.Resolver.GetResolverStateBefore(node);\n\t\t\t\tvar builder = new TypeSystemAstBuilder(csResolver);\n\t\t\t\treturn builder.ConvertType(expressionType);\n\t\t\t}\n\n\t\t\tstatic bool IsAssignment(AstNode node)\n\t\t\t{\n\t\t\t\tif (node is VariableInitializer)\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar assignmentExpr = node.Parent as AssignmentExpression;\n\t\t\t\tif (assignmentExpr != null)\n\t\t\t\t\treturn assignmentExpr.Left == node && assignmentExpr.Operator == AssignmentOperatorType.Assign;\n\n\t\t\t\tvar direction = node.Parent as DirectionExpression;\n\t\t\t\tif (direction != null)\n\t\t\t\t\treturn direction.FieldDirection == FieldDirection.Out && direction.Expression == node;\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tstatic bool IsInsideTryOrCatchBlock(AstNode node)\n\t\t\t{\n\t\t\t\tvar tryCatchStatement = node.GetParent<TryCatchStatement>();\n\t\t\t\tif (tryCatchStatement != null) {\n\t\t\t\t\tif (tryCatchStatement.TryBlock.Contains(node.StartLocation))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tforeach (var catchBlock in tryCatchStatement.CatchClauses)\n\t\t\t\t\t\tif (catchBlock.Body.Contains(node.StartLocation))\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tenum NodeState\n\t\t\t{\n\t\t\t\tNone,\n\t\t\t\tUsageReachable,\n\t\t\t\tUsageUnreachable,\n\t\t\t\tProcessing,\n\t\t\t}\n\n\t\t\tvoid ProcessNodes(VariableReferenceNode startNode)\n\t\t\t{\n\t\t\t\t// node state of a node indicates whether it is possible for an upstream node to reach any usage via\n\t\t\t\t// the node\n\t\t\t\tvar nodeStates = new Dictionary<VariableReferenceNode, NodeState>();\n\t\t\t\tvar assignments = new List<VariableReferenceNode>();\n\n\t\t\t\t// dfs to preprocess all nodes and find nodes which end with assignment\n\t\t\t\tvar stack = new Stack<VariableReferenceNode>();\n\t\t\t\tstack.Push(startNode);\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\tvar node = stack.Pop();\n\t\t\t\t\tif (node == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (node.References.Count > 0) {\n\t\t\t\t\t\tnodeStates [node] = IsAssignment(node.References [0]) ?\n\t\t\t\t\t\t\tNodeState.UsageUnreachable : NodeState.UsageReachable;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnodeStates [node] = NodeState.None;\n\t\t\t\t\t}\n\n\t\t\t\t\t// find indices of all assignments in node.References\n\t\t\t\t\tvar assignmentIndices = new List<int>();\n\t\t\t\t\tfor (int i = 0; i < node.References.Count; i++) {\n\t\t\t\t\t\tif (IsAssignment(node.References [i]))\n\t\t\t\t\t\t\tassignmentIndices.Add(i);\n\t\t\t\t\t}\n\t\t\t\t\t// for two consecutive assignments, the first one is redundant\n\t\t\t\t\tfor (int i = 0; i < assignmentIndices.Count - 1; i++) {\n\t\t\t\t\t\tvar index1 = assignmentIndices [i];\n\t\t\t\t\t\tvar index2 = assignmentIndices [i + 1];\n\t\t\t\t\t\tif (index1 + 1 == index2)\n\t\t\t\t\t\t\tAddIssue(node.References [index1]);\n\t\t\t\t\t}\n\t\t\t\t\t// if the node ends with an assignment, add it to assignments so as to check if it is redundant\n\t\t\t\t\t// later\n\t\t\t\t\tif (assignmentIndices.Count > 0 &&\n\t\t\t\t\t\tassignmentIndices [assignmentIndices.Count - 1] == node.References.Count - 1)\n\t\t\t\t\t\tassignments.Add(node);\n\n\t\t\t\t\tforeach (var nextNode in node.NextNodes) {\n\t\t\t\t\t\tif (!nodeStates.ContainsKey(nextNode))\n\t\t\t\t\t\t\tstack.Push(nextNode);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach (var node in assignments) {\n\t\t\t\t\t// we do not analyze an assignment inside a try block as it can jump to any catch block or finally block\n\t\t\t\t\tif (IsInsideTryOrCatchBlock(node.References [0]))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tProcessNode(node, true, nodeStates);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid ProcessNode(VariableReferenceNode node, bool addIssue,\n\t\t\t                 IDictionary<VariableReferenceNode, NodeState> nodeStates)\n\t\t\t{\n\t\t\t\tif (nodeStates [node] == NodeState.None)\n\t\t\t\t\tnodeStates [node] = NodeState.Processing;\n\n\t\t\t\tbool? reachable = false;\n\t\t\t\tforeach (var nextNode in node.NextNodes) {\n\t\t\t\t\tif (nodeStates [nextNode] == NodeState.None)\n\t\t\t\t\t\tProcessNode(nextNode, false, nodeStates);\n\n\t\t\t\t\tif (nodeStates [nextNode] == NodeState.UsageReachable) {\n\t\t\t\t\t\treachable = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// downstream nodes are not fully processed (e.g. due to loop), there is no enough info to\n\t\t\t\t\t// determine the node state\n\t\t\t\t\tif (nodeStates [nextNode] != NodeState.UsageUnreachable)\n\t\t\t\t\t\treachable = null;\n\t\t\t\t}\n\n\t\t\t\t// add issue if it is not possible to reach any usage via NextNodes\n\t\t\t\tif (addIssue && reachable == false)\n\t\t\t\t\tAddIssue(node.References [node.References.Count - 1]);\n\n\t\t\t\tif (nodeStates [node] != NodeState.Processing)\n\t\t\t\t\treturn;\n\n\t\t\t\tswitch (reachable) {\n\t\t\t\t\tcase null:\n\t\t\t\t\t\tnodeStates [node] = NodeState.None;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase true:\n\t\t\t\t\t\tnodeStates [node] = NodeState.UsageReachable;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase false:\n\t\t\t\t\t\tnodeStates [node] = NodeState.UsageUnreachable;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantInternalIssue.cs",
    "content": "﻿// \n// RedundantInternalInspector.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Finds redundant internal modifiers.\n\t/// </summary>\n\t[IssueDescription(\"Remove redundant 'internal' modifier\",\n\t       Description=\"Removes 'internal' modifiers that are not required.\", \n\t       Category = IssueCategories.RedundanciesInCode,\n\t       Severity = Severity.Hint)]\n\tpublic class RedundantInternalIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantInternalIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, RedundantInternalIssue qualifierDirectiveEvidentIssueProvider) : base (ctx, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tforeach (var token_ in typeDeclaration.ModifierTokens) {\n\t\t\t\t\tvar token = token_;\n\t\t\t\t\tif (token.Modifier == Modifiers.Internal) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(token, ctx.TranslateString(\"Keyword 'internal' is redundant.  This is the default modifier.\"), ctx.TranslateString(\"Remove 'internal' modifier\"), script => {\n\t\t\t\t\t\t\tint offset = script.GetCurrentOffset(token.StartLocation);\n\t\t\t\t\t\t\tint endOffset = script.GetCurrentOffset(token.GetNextNode().StartLocation);\n\t\t\t\t\t\t\tscript.RemoveText(offset, endOffset - offset);\n\t\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantPrivateIssue.cs",
    "content": "﻿// \n// RedundantPrivateInspector.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n    /// <summary>\n\t/// Finds redundant internal modifiers.\n\t/// </summary>\n\t[IssueDescription(\"Remove redundant 'private' modifier\",\n\t       Description = \"Removes 'private' modifiers that are not required.\",\n\t       Category = IssueCategories.RedundanciesInCode,\n\t       Severity = Severity.Hint)]\n\tpublic class RedundantPrivateIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantPrivateIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, RedundantPrivateIssue qualifierDirectiveEvidentIssueProvider) : base (ctx, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid CheckNode(EntityDeclaration node)\n\t\t\t{\n\t\t\t\tforeach (var token_ in node.ModifierTokens) {\n\t\t\t\t\tvar token = token_;\n\t\t\t\t\tif (token.Modifier == Modifiers.Private) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(token, ctx.TranslateString(\"Keyword 'private' is redundant. This is the default modifier.\"), ctx.TranslateString(\"Remove redundant 'private' modifier\"), script => {\n\t\t\t\t\t\t\tscript.ChangeModifier (node, node.Modifiers & ~Modifiers.Private);\n\t\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(methodDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(fieldDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(propertyDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(eventDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(eventDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(constructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(operatorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t\tCheckNode(fixedFieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration.Parent is TypeDeclaration) {\n\t\t\t\t\tCheckNode(typeDeclaration);\n\t\t\t\t}\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/StaticEventSubscriptionIssue.cs",
    "content": "﻿//\n// StaticEventSubscriptionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Static event removal check\",\n\t\tDescription = \"Checks if static events are removed\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning)]\n\tpublic class StaticEventSubscriptionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<StaticEventSubscriptionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tbase.VisitSyntaxTree(syntaxTree);\n\n\t\t\t\tforeach (var assignedEvent in assignedEvents) {\n\t\t\t\t\taddedEvents.Remove(assignedEvent); \n\t\t\t\t}\n\n\t\t\t\tforeach (var hs in removedEvents) {\n\t\t\t\t\tHashSet<Tuple<IMember, AssignmentExpression>> h;\n\t\t\t\t\tif (!addedEvents.TryGetValue(hs.Key, out h))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tforeach (var evt in hs.Value) {\n\t\t\t\t\t\trestart:\n\t\t\t\t\t\tforeach (var m in h) {\n\t\t\t\t\t\t\tif (m.Item1 == evt) {\n\t\t\t\t\t\t\t\th.Remove(m);\n\t\t\t\t\t\t\t\tgoto restart;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach (var added in addedEvents) {\n\t\t\t\t\tforeach (var usage in added.Value) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(usage.Item2.OperatorToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Subscription to static events without unsubscription may cause memory leaks.\"))); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (methodDeclaration.HasModifier(Modifiers.Static))\n\t\t\t\t\treturn;\n\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tif (constructorDeclaration.HasModifier(Modifiers.Static))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t}\n\t\t\treadonly Dictionary<IMember, HashSet<Tuple<IMember, AssignmentExpression>>> addedEvents = new Dictionary<IMember, HashSet<Tuple<IMember, AssignmentExpression>>>();\n\t\t\treadonly Dictionary<IMember, HashSet<IMember>> removedEvents = new Dictionary<IMember, HashSet<IMember>>();\n\t\t\treadonly HashSet<IMember> assignedEvents = new HashSet<IMember> ();\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\n\t\t\t\tif (assignmentExpression.Operator == AssignmentOperatorType.Add) {\n\t\t\t\t\tvar left = ctx.Resolve(assignmentExpression.Left) as MemberResolveResult;\n\t\t\t\t\tif (left == null || left.Member.SymbolKind != SymbolKind.Event || !left.Member.IsStatic)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tif (assignmentExpression.Right is AnonymousMethodExpression || assignmentExpression.Right is LambdaExpression) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(assignmentExpression.OperatorToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Subscription to static events with an anonymous method may cause memory leaks.\"))); \n\t\t\t\t\t}\n\n\n\t\t\t\t\tvar right = ctx.Resolve(assignmentExpression.Right) as MethodGroupResolveResult;\n\t\t\t\t\tif (right == null || right.Methods.Count() != 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tHashSet<Tuple<IMember, AssignmentExpression>> hs;\n\t\t\t\t\tif (!addedEvents.TryGetValue(left.Member, out hs))\n\t\t\t\t\t\taddedEvents[left.Member] = hs = new HashSet<Tuple<IMember, AssignmentExpression>>();\n\t\t\t\t\ths.Add(Tuple.Create((IMember)right.Methods.First(), assignmentExpression));\n\t\t\t\t} else if (assignmentExpression.Operator == AssignmentOperatorType.Subtract) {\n\t\t\t\t\tvar left = ctx.Resolve(assignmentExpression.Left) as MemberResolveResult;\n\t\t\t\t\tif (left == null || left.Member.SymbolKind != SymbolKind.Event || !left.Member.IsStatic)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar right = ctx.Resolve(assignmentExpression.Right) as MethodGroupResolveResult;\n\t\t\t\t\tif (right == null || right.Methods.Count() != 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tHashSet<IMember> hs;\n\t\t\t\t\tif (!removedEvents.TryGetValue(left.Member, out hs))\n\t\t\t\t\t\tremovedEvents[left.Member] = hs = new HashSet<IMember>();\n\t\t\t\t\ths.Add(right.Methods.First());\n\t\t\t\t} else if (assignmentExpression.Operator == AssignmentOperatorType.Assign) {\n\t\t\t\t\tvar left = ctx.Resolve(assignmentExpression.Left) as MemberResolveResult;\n\t\t\t\t\tif (left == null || left.Member.SymbolKind != SymbolKind.Event || !left.Member.IsStatic)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tassignedEvents.Add(left.Member); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/UnreachableCodeIssue.cs",
    "content": "﻿// \n// UnreachableCodeIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Code is unreachable\",\n\t\tDescription = \"Code is unreachable.\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning)]\n\tpublic class UnreachableCodeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UnreachableCodeIssue>\n\t\t{\n\t\t\tHashSet<AstNode> unreachableNodes;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tunreachableNodes = new HashSet<AstNode>();\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tStatementIssueCollector.Collect(this, methodDeclaration.Body);\n\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tvar blockStatement = lambdaExpression.Body as BlockStatement;\n\t\t\t\tif (blockStatement != null)\n\t\t\t\t\tStatementIssueCollector.Collect(this, blockStatement);\n\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tStatementIssueCollector.Collect(this, anonymousMethodExpression.Body);\n\n\t\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tvar resolveResult = ctx.Resolve(conditionalExpression.Condition);\n\t\t\t\tif (resolveResult.ConstantValue is bool) {\n\t\t\t\t\tvar condition = (bool)resolveResult.ConstantValue;\n\t\t\t\t\tExpression resultExpr, unreachableExpr;\n\t\t\t\t\tif (condition) {\n\t\t\t\t\t\tresultExpr = conditionalExpression.TrueExpression;\n\t\t\t\t\t\tunreachableExpr = conditionalExpression.FalseExpression;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresultExpr = conditionalExpression.FalseExpression;\n\t\t\t\t\t\tunreachableExpr = conditionalExpression.TrueExpression;\n\t\t\t\t\t}\n\t\t\t\t\tunreachableNodes.Add(unreachableExpr);\n\n\t\t\t\t\tAddIssue(new CodeIssue(unreachableExpr, ctx.TranslateString(\"Code is unreachable\"), ctx.TranslateString(\"Remove unreachable code\"),\n\t\t\t\t\t\tscript => script.Replace(conditionalExpression, resultExpr.Clone())) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\t\t\t}\n\n\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t{\n\t\t\t\t// skip unreachable nodes\n\t\t\t\tif (!unreachableNodes.Contains(node))\n\t\t\t\t\tbase.VisitChildren(node);\n\t\t\t}\n\n\t\t\tclass StatementIssueCollector : DepthFirstAstVisitor\n\t\t\t{\n\t\t\t\tGatherVisitor visitor;\n\t\t\t\tReachabilityAnalysis reachability;\n\t\t\t\tList<AstNode> collectedStatements;\n\n\t\t\t\tprivate StatementIssueCollector(GatherVisitor visitor, ReachabilityAnalysis reachability)\n\t\t\t\t{\n\t\t\t\t\tcollectedStatements = new List<AstNode>();\n\t\t\t\t\tthis.visitor = visitor;\n\t\t\t\t\tthis.reachability = reachability;\n\t\t\t\t}\n\n\t\t\t\tpublic static void Collect(GatherVisitor visitor, BlockStatement body)\n\t\t\t\t{\n\t\t\t\t\tif (body.IsNull)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar reachability = visitor.ctx.CreateReachabilityAnalysis(body);\n\n\t\t\t\t\tvar collector = new StatementIssueCollector(visitor, reachability);\n\t\t\t\t\tcollector.VisitBlockStatement(body);\n\t\t\t\t}\n\n\t\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t\t{\n\t\t\t\t\tvar statement = node as Statement;\n\t\t\t\t\tif (statement == null || !AddStatement(statement))\n\t\t\t\t\t\tbase.VisitChildren(node);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tstatic TextLocation GetPrevEnd(AstNode node)\n\t\t\t\t{\n\t\t\t\t\tvar prev = node.GetPrevNode(n => !(n is NewLineNode));\n\t\t\t\t\treturn prev != null ? prev.EndLocation : node.StartLocation;\n\t\t\t\t}\n\n\t\t\t\tstatic TextLocation GetNextStart(AstNode node)\n\t\t\t\t{\n\t\t\t\t\tvar next = node.GetNextNode(n => !(n is NewLineNode));\n\t\t\t\t\treturn next != null ? next.StartLocation : node.EndLocation;\n\t\t\t\t}\n\n\t\t\t\tbool AddStatement(Statement statement)\n\t\t\t\t{\n\t\t\t\t\tif (reachability.IsReachable(statement))\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tif (collectedStatements.Contains(statement))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\tif (statement is BlockStatement && statement.GetChildrenByRole<Statement>(BlockStatement.StatementRole).Any(reachability.IsReachable)) {\n\t\t\t\t\t\t//There's reachable content\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tvar prevEnd = GetPrevEnd(statement);\n\t\t\t\t\tTextLocation start;\n\t\t\t\t\tTextLocation end;\n\n\t\t\t\t\tif (statement.Role == IfElseStatement.TrueRole) {\n\t\t\t\t\t\tvar ife = (IfElseStatement)statement.Parent;\n\t\t\t\t\t\tstart = ife.IfToken.StartLocation;\n\t\t\t\t\t\tcollectedStatements.Add(ife.IfToken);\n\t\t\t\t\t\tprevEnd = ife.IfToken.StartLocation;\n\t\t\t\t\t\tcollectedStatements.Add(statement);\n\t\t\t\t\t\tvisitor.unreachableNodes.Add(statement);\n\t\t\t\t\t\tcollectedStatements.Add(ife.ElseToken);\n\t\t\t\t\t\tend = GetNextStart(ife.ElseToken);\n\t\t\t\t\t} else if (statement.Role == IfElseStatement.FalseRole) {\n\t\t\t\t\t\tvar ife = (IfElseStatement)statement.Parent;\n\t\t\t\t\t\tstart = ife.ElseToken.StartLocation;\n\t\t\t\t\t\tcollectedStatements.Add(ife.ElseToken);\n\t\t\t\t\t\tprevEnd = GetPrevEnd(ife.ElseToken);\n\t\t\t\t\t\tcollectedStatements.Add(statement);\n\t\t\t\t\t\tvisitor.unreachableNodes.Add(statement);\n\t\t\t\t\t\tend = statement.EndLocation;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// group multiple continuous statements into one issue\n\t\t\t\t\t\tstart = statement.StartLocation;\n\t\t\t\t\t\tcollectedStatements.Add(statement);\n\t\t\t\t\t\tvisitor.unreachableNodes.Add(statement);\n\t\t\t\t\t\tStatement nextStatement;\n\t\t\t\t\t\twhile ((nextStatement = (Statement)statement.GetNextSibling(s => s is Statement)) != null && !(nextStatement is LabelStatement)) {\n\t\t\t\t\t\t\tif (nextStatement.Role == IfElseStatement.FalseRole)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tstatement = nextStatement;\n\t\t\t\t\t\t\tcollectedStatements.Add(statement);\n\t\t\t\t\t\t\tvisitor.unreachableNodes.Add(statement);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tend = statement.EndLocation;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar removeAction = new CodeAction(\n\t\t\t\t\t\tvisitor.ctx.TranslateString(\"Remove unreachable code\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar startOffset = script.GetCurrentOffset(prevEnd);\n\t\t\t\t\t\t\tvar endOffset = script.GetCurrentOffset(end);\n\t\t\t\t\t\t\tscript.RemoveText(startOffset, endOffset - startOffset);\n\t\t\t\t\t\t}, collectedStatements.First().StartLocation, collectedStatements.Last().EndLocation);\n\t\t\t\t\tvar commentAction = new CodeAction(\n\t\t\t\t\t\tvisitor.ctx.TranslateString(\"Comment unreachable code\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar startOffset = script.GetCurrentOffset(prevEnd);\n\t\t\t\t\t\t\tscript.InsertText(startOffset, Environment.NewLine + \"/*\");\n\t\t\t\t\t\t\tvar endOffset = script.GetCurrentOffset(end);\n\t\t\t\t\t\t\tscript.InsertText(endOffset, Environment.NewLine + \"*/\");\n\t\t\t\t\t\t}, collectedStatements.First().StartLocation, collectedStatements.Last().EndLocation);\n\t\t\t\t\tvar actions = new [] { removeAction, commentAction };\n\t\t\t\t\tvisitor.AddIssue(new CodeIssue(start, end, visitor.ctx.TranslateString(\"Code is unreachable\"), actions) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// skip lambda and anonymous method\n\t\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t\t{\n\t\t\t\t}\n\n\t\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/VariableOnlyAssignedIssue.cs",
    "content": "﻿// \n// VariableOnlyAssignedIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic abstract class VariableOnlyAssignedIssue : GatherVisitorCodeIssueProvider\n\t{\n\n\t\tprotected static bool TestOnlyAssigned(BaseRefactoringContext ctx, AstNode rootNode, IVariable variable)\n\t\t{\n\t\t\tvar assignment = false;\n\t\t\tvar nonAssignment = false;\n\t\t\tforeach (var result in ctx.FindReferences(rootNode, variable)) {\n\t\t\t\tvar node = result.Node;\n\t\t\t\tif (node is ParameterDeclaration)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (node is VariableInitializer) {\n\t\t\t\t\tif (!(node as VariableInitializer).Initializer.IsNull)\n\t\t\t\t\t\tassignment = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (node is IdentifierExpression) {\n\t\t\t\t\tvar parent = node.Parent;\n\t\t\t\t\tif (parent is AssignmentExpression) {\n\t\t\t\t\t\tif (((AssignmentExpression)parent).Left == node) {\n\t\t\t\t\t\t\tassignment = true;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (parent is UnaryOperatorExpression) {\n\t\t\t\t\t\tvar op = ((UnaryOperatorExpression)parent).Operator;\n\t\t\t\t\t\tswitch (op) {\n\t\t\t\t\t\t\tcase UnaryOperatorType.Increment:\n\t\t\t\t\t\t\tcase UnaryOperatorType.PostIncrement:\n\t\t\t\t\t\t\tcase UnaryOperatorType.Decrement:\n\t\t\t\t\t\t\tcase UnaryOperatorType.PostDecrement:\n\t\t\t\t\t\t\t\tassignment = true;\n\t\t\t\t\t\t\t\tif (!(parent.Parent is ExpressionStatement))\n\t\t\t\t\t\t\t\t\tnonAssignment = true;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (parent is DirectionExpression) {\n\t\t\t\t\t\tif (((DirectionExpression)parent).FieldDirection == FieldDirection.Out) {\n\t\t\t\t\t\t\tassignment = true;\n\t\t\t\t\t\t\t// Using dummy variables is necessary for ignoring\n\t\t\t\t\t\t\t// out-arguments, so we don't want to warn for those.\n\t\t\t\t\t\t\tnonAssignment = true;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnonAssignment = true;\n\t\t\t}\n\t\t\treturn assignment && !nonAssignment;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/XmlDocIssue.cs",
    "content": "//\n// XmlDocIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Xml;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Validate Xml documentation\",\n\t\tDescription = \"Validate Xml docs\",\n\t\tCategory = IssueCategories.CompilerWarnings,\n\t\tSeverity = Severity.Warning)]\n\tpublic class XmlDocIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<XmlDocIssue>\n\t\t{\n\t\t\treadonly List<Comment> storedXmlComment = new List<Comment>();\n\t\t\t\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tvoid InvalideXmlComments()\n\t\t\t{\n\t\t\t\tif (storedXmlComment.Count == 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar from = storedXmlComment.First().StartLocation;\n\t\t\t\tvar to = storedXmlComment.Last().EndLocation;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tfrom,\n\t\t\t\t\tto,\n\t\t\t\t\tctx.TranslateString(\"Xml comment is not placed before a valid language element\"),\n\t\t\t\t\tctx.TranslateString(\"Remove comment\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar startOffset = script.GetCurrentOffset(from);\n\t\t\t\t\t\tvar endOffset = script.GetCurrentOffset(to);\n\t\t\t\t\t\tendOffset += ctx.GetLineByOffset(endOffset).DelimiterLength;\n\t\t\t\t\t\tscript.RemoveText(startOffset, endOffset - startOffset);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t\tstoredXmlComment.Clear();\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitComment(Comment comment)\n\t\t\t{\n\t\t\t\tif (comment.CommentType == CommentType.Documentation)\n\t\t\t\t\tstoredXmlComment.Add(comment);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitNamespaceDeclaration(namespaceDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitUsingDeclaration(usingDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitUsingAliasDeclaration(UsingAliasDeclaration usingDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitUsingAliasDeclaration(usingDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitExternAliasDeclaration(externAliasDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tTextLocation TranslateOffset(int offset)\n\t\t\t{\n\t\t\t\tint line = storedXmlComment.First().StartLocation.Line;\n\t\t\t\tforeach (var cmt in storedXmlComment) {\n\t\t\t\t\tvar next = offset - cmt.Content.Length - \"\\n\".Length;\n\t\t\t\t\tif (next <= 0)\n\t\t\t\t\t\treturn new TextLocation(line, cmt.StartLocation.Column + \"///\".Length + offset);\n\t\t\t\t\toffset = next;\n\t\t\t\t\tline++;\n\t\t\t\t}\n\t\t\t\treturn TextLocation.Empty;\n\t\t\t}\n\t\t\t\n\t\t\tvoid AddXmlIssue(int offset, int length, string str)\n\t\t\t{\n\t\t\t\tvar textLocation = TranslateOffset(offset);\n\t\t\t\tvar textLocation2 = TranslateOffset(offset + length);\n\t\t\t\tif (textLocation.IsEmpty && textLocation2.IsEmpty) {\n\t\t\t\t\tAddIssue(new CodeIssue(storedXmlComment.Last(), str));\n\t\t\t\t} else if (textLocation.IsEmpty) {\n\t\t\t\t\tAddIssue(new CodeIssue(storedXmlComment.First().StartLocation, textLocation2, str));\n\t\t\t\t} else if (textLocation2.IsEmpty) {\n\t\t\t\t\tAddIssue(new CodeIssue(textLocation, storedXmlComment.Last().EndLocation, str));\n\t\t\t\t} else {\n\t\t\t\t\tAddIssue(new CodeIssue(textLocation, textLocation2, str));\n\t\t\t\t}\n\t\t\t}\n\t\t\treadonly StringTextSource emptySource = new StringTextSource(\"\");\n\t\t\tvoid CheckXmlDoc(AstNode node)\n\t\t\t{\n\t\t\t\tResolveResult resolveResult = ctx.Resolve(node);\n\t\t\t\tIEntity member = null;\n\t\t\t\tif (resolveResult is TypeResolveResult)\n\t\t\t\t\tmember = resolveResult.Type.GetDefinition();\n\t\t\t\tif (resolveResult is MemberResolveResult)\n\t\t\t\t\tmember = ((MemberResolveResult)resolveResult).Member;\n\t\t\t\tvar xml = new StringBuilder();\n\t\t\t\tvar firstline = \"<root>\\n\";\n\t\t\t\txml.Append(firstline);\n\t\t\t\tforeach (var cmt in storedXmlComment)\n\t\t\t\t\txml.Append(cmt.Content + \"\\n\");\n\t\t\t\txml.Append(\"</root>\\n\");\n\t\t\t\t\n\t\t\t\tvar doc = new AXmlParser().Parse(new StringTextSource(xml.ToString()));\n\t\t\t\t\n\t\t\t\tvar stack = new Stack<AXmlObject>();\n\t\t\t\tstack.Push(doc);\n\t\t\t\tforeach (var err in doc.SyntaxErrors)\n\t\t\t\t\tAddXmlIssue(err.StartOffset - firstline.Length, err.EndOffset - err.StartOffset, err.Description);\n\t\t\t\t\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\tvar cur = stack.Pop();\n\t\t\t\t\tvar el = cur as AXmlElement;\n\t\t\t\t\tif (el != null) {\n\t\t\t\t\t\tswitch (el.Name) {\n\t\t\t\t\t\t\tcase \"typeparam\":\n\t\t\t\t\t\t\tcase \"typeparamref\":\n\t\t\t\t\t\t\t\tvar name = el.Attributes.FirstOrDefault(attr => attr.Name == \"name\");\n\t\t\t\t\t\t\t\tif (name == null)\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tif (member != null && member.SymbolKind == SymbolKind.TypeDefinition) {\n\t\t\t\t\t\t\t\t\tvar type = (ITypeDefinition)member;\n\t\t\t\t\t\t\t\t\tif (!type.TypeArguments.Any(arg => arg.Name == name.Value)) {\n\t\t\t\t\t\t\t\t\t\tAddXmlIssue(name.ValueSegment.Offset - firstline.Length + 1, name.ValueSegment.Length - 2, string.Format(ctx.TranslateString(\"Type parameter '{0}' not found\"), name.Value));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"param\":\n\t\t\t\t\t\t\tcase \"paramref\":\n\t\t\t\t\t\t\t\tname = el.Attributes.FirstOrDefault(attr => attr.Name == \"name\");\n\t\t\t\t\t\t\t\tif (name == null)\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tvar m = member as IParameterizedMember;\n\t\t\t\t\t\t\t\tif (m != null && m.Parameters.Any(p => p.Name == name.Value))\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tvar dtype = member as ITypeDefinition;\n\t\t\t\t\t\t\t\tif ((dtype != null) && (dtype.Kind == TypeKind.Delegate)) {\n\t\t\t\t\t\t\t\t\tvar invokeMethod = dtype.Methods.FirstOrDefault(method => method.Name == \"Invoke\");\n\t\t\t\t\t\t\t\t\tif ((invokeMethod != null) && invokeMethod.Parameters.Any(p => p.Name == name.Value))\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (name.Value == \"value\" && member != null && (member.SymbolKind == SymbolKind.Property || member.SymbolKind == SymbolKind.Indexer || member.SymbolKind == SymbolKind.Event) && el.Name == \"paramref\")\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tAddXmlIssue(name.ValueSegment.Offset - firstline.Length + 1, name.ValueSegment.Length - 2, string.Format(ctx.TranslateString(\"Parameter '{0}' not found\"), name.Value));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"exception\":\n\t\t\t\t\t\t\tcase \"seealso\":\n\t\t\t\t\t\t\tcase \"see\":\n\t\t\t\t\t\t\t\tvar cref = el.Attributes.FirstOrDefault(attr => attr.Name == \"cref\");\n\t\t\t\t\t\t\t\tif (cref == null)\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tvar trctx = ctx.Resolver.TypeResolveContext;\n\t\t\t\t\t\t\t\t\tif (member is IMember)\n\t\t\t\t\t\t\t\t\t\ttrctx = trctx.WithCurrentTypeDefinition(member.DeclaringTypeDefinition).WithCurrentMember((IMember)member);\n\t\t\t\t\t\t\t\t\tif (member is ITypeDefinition)\n\t\t\t\t\t\t\t\t\t\ttrctx = trctx.WithCurrentTypeDefinition((ITypeDefinition)member);\n\t\t\t\t\t\t\t\t\tvar state = ctx.Resolver.GetResolverStateBefore(node);\n\t\t\t\t\t\t\t\t\tif (state.CurrentUsingScope != null)\n\t\t\t\t\t\t\t\t\t\ttrctx = trctx.WithUsingScope(state.CurrentUsingScope);\n\t\t\t\t\t\t\t\t\tvar cdc = new CSharpDocumentationComment (emptySource, trctx);\n\t\t\t\t\t\t\t\t\tvar entity = cdc.ResolveCref(cref.Value);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (entity == null) {\n\t\t\t\t\t\t\t\t\t\tAddXmlIssue(cref.ValueSegment.Offset - firstline.Length + 1, cref.ValueSegment.Length - 2, string.Format(ctx.TranslateString(\"Cannot find reference '{0}'\"), cref.Value));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\tAddXmlIssue(cref.ValueSegment.Offset - firstline.Length + 1, cref.ValueSegment.Length - 2, string.Format(ctx.TranslateString(\"Reference parsing error '{0}'.\"), e.Message));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tforeach (var child in cur.Children)\n\t\t\t\t\t\tstack.Push(child);\n\t\t\t\t}\n\t\t\t\tstoredXmlComment.Clear();\n\t\t\t}\n\t\t\t\n\t\t\tprotected virtual void VisitXmlChildren(AstNode node, Action checkDocumentationAction)\n\t\t\t{\n\t\t\t\tAstNode next;\n\t\t\t\tvar child = node.FirstChild;\n\t\t\t\twhile (child != null && (child is Comment || child.Role == Roles.NewLine)) {\n\t\t\t\t\tnext = child.NextSibling;\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t\tchild = next;\n\t\t\t\t}\n\t\t\t\tcheckDocumentationAction();\n\t\t\t\t\n\t\t\t\tfor (; child != null; child = next) {\n\t\t\t\t\t// Store next to allow the loop to continue\n\t\t\t\t\t// if the visitor removes/replaces child.\n\t\t\t\t\tnext = child.NextSibling;\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t\tInvalideXmlComments();\n\t\t\t}\n\t\t\t\n\t\t\tprotected virtual void VisitXmlChildren(AstNode node)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(node, () => CheckXmlDoc(node));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(typeDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(methodDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(delegateDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(constructorDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(eventDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(destructorDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(enumMemberDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(eventDeclaration, () => {\n\t\t\t\t\tforeach (var e in eventDeclaration.Variables) {\n\t\t\t\t\t\tCheckXmlDoc(e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(fieldDeclaration, () => {\n\t\t\t\t\tforeach (var e in fieldDeclaration.Variables) {\n\t\t\t\t\t\tCheckXmlDoc(e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(indexerDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(propertyDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(operatorDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/GatherVisitorBase.cs",
    "content": "﻿// \n// GatherVisitorBase.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tclass GatherVisitorConstants\n\t{\n\t\tpublic const string DisableAllString = \"disable All\";\n\t\tpublic const string RestoreAllString = \"restore All\";\n\n\t}\n\n\tpublic interface IGatherVisitor\n\t{\n\t\tBaseRefactoringContext Ctx { get; }\n\t\tstring SubIssue { get; set; }\n\t\tIEnumerable<CodeIssue> GetIssues();\n\t}\n\n\t/// <summary>\n\t/// The code issue provider gets a list of all code issues in a syntax tree.\n\t/// </summary>\n\tpublic abstract class GatherVisitorCodeIssueProvider : CodeIssueProvider\n\t{\n\t\tprotected abstract IGatherVisitor CreateVisitor (BaseRefactoringContext context);\n\n\t\tpublic sealed override IEnumerable<CodeIssue> GetIssues (BaseRefactoringContext context, string subIssue = null)\n\t\t{\n\t\t\tvar visitor = CreateVisitor(context);\n\t\t\tif (visitor == null)\n\t\t\t\treturn Enumerable.Empty<CodeIssue> ();\n\t\t\tvisitor.SubIssue = subIssue;\n\t\t\treturn visitor.GetIssues();\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// A base class for writing issue provider visitor implementations.\n\t/// </summary>\n\tclass GatherVisitorBase<T> : DepthFirstAstVisitor, IGatherVisitor where T : CodeIssueProvider\n\t{\n\t\t/// <summary>\n\t\t/// The issue provider. May be <c>null</c> if none was specified.\n\t\t/// </summary>\n\t\tprotected readonly T issueProvider;\n\t\tprotected readonly BaseRefactoringContext ctx;\n\n\t\tpublic BaseRefactoringContext Ctx {\n\t\t\tget {\n\t\t\t\treturn ctx;\n\t\t\t}\n\t\t}\n\n\t\tbool isAllDisabled;\n\t\tbool isDisabled;\n\t\tbool isDisabledOnce;\n\t\tbool isGloballySuppressed;\n\t\tbool isPragmaDisabled;\n\t\tList<DomRegion> suppressedRegions = new List<DomRegion>();\n\t\t[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n\t\tstatic string disableString;\n\t\t[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n\t\tstatic string disableOnceString;\n\t\t[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n\t\tstatic string restoreString;\n\t\t[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n\t\tstatic string suppressMessageCategory;\n\t\t[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n\t\tstatic string suppressMessageCheckId;\n\t\t[SuppressMessage(\"Microsoft.Design\", \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\")]\n\t\tstatic int pragmaWarning;\n\n\t\tstatic void SetDisableKeyword(string disableKeyword)\n\t\t{\n\t\t\tdisableString = \"disable \" + disableKeyword;\n\t\t\tdisableOnceString = \"disable once \" + disableKeyword;\n\t\t\trestoreString = \"restore \" + disableKeyword;\n\t\t}\n\n\t\tpublic readonly List<CodeIssue> FoundIssues = new List<CodeIssue>();\n\n\t\tpublic string SubIssue { get; set; }\n\n\t\tstatic GatherVisitorBase()\n\t\t{\n\t\t\tvar attr = (IssueDescriptionAttribute)typeof(T).GetCustomAttributes(false).FirstOrDefault(a => a is IssueDescriptionAttribute);\n\t\t\tif (attr == null)\n\t\t\t\treturn;\n\t\t\tif (attr.AnalysisDisableKeyword != null) \n\t\t\t\tSetDisableKeyword(attr.AnalysisDisableKeyword);\n\t\t\tsuppressMessageCheckId = attr.SuppressMessageCheckId;\n\t\t\tsuppressMessageCategory = attr.SuppressMessageCategory;\n\t\t\tpragmaWarning = attr.PragmaWarning;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"GatherVisitorBase{T}\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='ctx'>\n\t\t/// The refactoring context.\n\t\t/// </param>\n\t\t/// <param name='qualifierDirectiveEvidentIssueProvider'>\n\t\t/// The issue provider.\n\t\t/// </param>\n\t\tpublic GatherVisitorBase(BaseRefactoringContext ctx, T qualifierDirectiveEvidentIssueProvider = default(T))\n\t\t{\n\t\t\tthis.ctx = ctx;\n\t\t\tthis.issueProvider = qualifierDirectiveEvidentIssueProvider;\n\t\t\tif (suppressMessageCheckId != null) {\n\t\t\t\tforeach (var attr in this.ctx.Compilation.MainAssembly.AssemblyAttributes) {\n\t\t\t\t\tif (attr.AttributeType.Name == \"SuppressMessageAttribute\" && attr.AttributeType.Namespace == \"System.Diagnostics.CodeAnalysis\") {\n\t\t\t\t\t\tif (attr.PositionalArguments.Count < 2)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tvar category = attr.PositionalArguments [0].ConstantValue;\n\t\t\t\t\t\tif (category == null || category.ToString() != suppressMessageCategory)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar checkId = attr.PositionalArguments [1].ConstantValue;\n\t\t\t\t\t\tif (checkId == null || checkId.ToString() != suppressMessageCheckId) \n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tisGloballySuppressed = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets all the issues using the context root node as base.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// The issues.\n\t\t/// </returns>\n\t\tpublic IEnumerable<CodeIssue> GetIssues()\n\t\t{\n\t\t\tctx.RootNode.AcceptVisitor(this);\n\t\t\treturn FoundIssues;\n\t\t}\n\n\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t{\n\t\t\tif (ctx.CancellationToken.IsCancellationRequested)\n\t\t\t\treturn;\n\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t}\n\n\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tif (ctx.CancellationToken.IsCancellationRequested)\n\t\t\t\treturn;\n\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t}\n\n\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t{\n\t\t\tif (ctx.CancellationToken.IsCancellationRequested)\n\t\t\t\treturn;\n\t\t\tbase.VisitPropertyDeclaration(propertyDeclaration);\n\t\t}\n\n\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t{\n\t\t\tif (ctx.CancellationToken.IsCancellationRequested)\n\t\t\t\treturn;\n\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t}\n\n\t\tpublic override void VisitComment(Comment comment)\n\t\t{\n\t\t\tif (comment.CommentType == CommentType.SingleLine) {\n\t\t\t\tvar txt = comment.Content;\n\t\t\t\tif (string.IsNullOrEmpty(txt))\n\t\t\t\t\treturn;\n\t\t\t\tif (isAllDisabled) {\n\t\t\t\t\tisAllDisabled &= txt.IndexOf(GatherVisitorConstants.RestoreAllString, StringComparison.InvariantCultureIgnoreCase) < 0;\n\t\t\t\t} else {\n\t\t\t\t\tisAllDisabled |= txt.IndexOf(GatherVisitorConstants.DisableAllString, StringComparison.InvariantCultureIgnoreCase) > 0;\n\t\t\t\t}\n\n\t\t\t\tif (restoreString != null) {\n\t\t\t\t\tif (isDisabled) {\n\t\t\t\t\t\tisDisabled &= txt.IndexOf(restoreString, StringComparison.InvariantCulture) < 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisDisabled |= txt.IndexOf(disableString, StringComparison.InvariantCulture) > 0;\n\t\t\t\t\t\tisDisabledOnce |= txt.IndexOf(disableOnceString, StringComparison.InvariantCulture) > 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitPreProcessorDirective(PreProcessorDirective preProcessorDirective)\n\t\t{\n\t\t\tif (pragmaWarning == 0)\n\t\t\t\treturn;\n\n\t\t\tvar warning = preProcessorDirective as PragmaWarningPreprocessorDirective;\n\t\t\tif (warning == null)\n\t\t\t\treturn;\n\t\t\tif (warning.IsDefined(pragmaWarning))\n\t\t\t\tisPragmaDisabled = warning.Disable;\n\t\t}\n\n\t\tpublic override void VisitAttribute(Attribute attribute)\n\t\t{\n\t\t\tbase.VisitAttribute(attribute);\n\t\t\tif (suppressMessageCheckId == null)\n\t\t\t\treturn;\n\t\t\tvar resolveResult = ctx.Resolve(attribute);\n\t\t\tif (resolveResult.Type.Name == \"SuppressMessageAttribute\" && resolveResult.Type.Namespace == \"System.Diagnostics.CodeAnalysis\") {\n\t\t\t\tif (attribute.Arguments.Count < 2)\n\t\t\t\t\treturn;\n\t\t\t\tvar category = attribute.Arguments.First() as PrimitiveExpression;\n\t\t\t\tif (category == null || category.Value.ToString() != suppressMessageCategory)\n\t\t\t\t\treturn;\n\t\t\t\tvar checkId = attribute.Arguments.Skip(1).First() as PrimitiveExpression;\n\t\t\t\tif (checkId == null || checkId.Value.ToString() != suppressMessageCheckId) \n\t\t\t\t\treturn;\n\t\t\t\tsuppressedRegions.Add(attribute.Parent.Parent.Region);\n\t\t\t}\n\t\t}\n\n\t\tprotected bool IsSuppressed(TextLocation location)\n\t\t{\n\t\t\tif (isAllDisabled)\n\t\t\t\treturn true;\n\t\t\tif (isDisabledOnce) {\n\t\t\t\tisDisabledOnce = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn isDisabled || isGloballySuppressed || isPragmaDisabled || suppressedRegions.Any(r => r.IsInside(location));\n\t\t}\n\n\t\tprotected void AddIssue(CodeIssue issue)\n\t\t{\n\t\t\tif (IsSuppressed(issue.Start))\n\t\t\t\treturn;\n\t\t\tFoundIssues.Add(issue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/IssueCategories.cs",
    "content": "// \n// IssueCategories.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class IssueCategories\n\t{\n\t\tpublic const string CodeQualityIssues = \"Potential Code Quality Issues\";\n\t\tpublic const string ConstraintViolations = \"Constraint Violations\";\n\t\tpublic const string PracticesAndImprovements = \"Common Practices and Code Improvements\";\n\t\tpublic const string RedundanciesInCode = \"Redundancies in Code\";\n\t\tpublic const string RedundanciesInDeclarations = \"Redundancies in Symbol Declarations\";\n\t\tpublic const string Opportunities = \"Language Usage Opportunities\";\n\t\tpublic const string Notifications = \"Code Notifications\";\n\t\tpublic const string CompilerWarnings = \"Compiler Warnings\";\n\t\tpublic const string CompilerErrors = \"Compiler Errors\";\n\t\tpublic const string NUnit = \"NUnit\";\n\t}\n}\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToClosureIssue.cs",
    "content": "﻿// \n// AccessToClosureIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic abstract class AccessToClosureIssue : GatherVisitorCodeIssueProvider\n\t{\n\n\t\tpublic string Title\n\t\t{ get; private set; }\n\n\t\tprotected AccessToClosureIssue (string title)\n\t\t{\n\t\t\tTitle = title;\n\t\t}\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar unit = context.RootNode as SyntaxTree;\n\t\t\tif (unit == null)\n\t\t\t\treturn null;\n\t\t\treturn new GatherVisitor(context, unit, this);\n\t\t}\n\n\t\tprotected virtual bool IsTargetVariable (IVariable variable)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tprotected abstract NodeKind GetNodeKind (AstNode node);\n\n\t\tprotected virtual bool CanReachModification (ControlFlowNode node, Statement start,\n\t\t\t\t\t\t\t\t\t\t\t\t     IDictionary<Statement, IList<Node>> modifications)\n\t\t{\n\t\t\treturn node.NextStatement != null && node.NextStatement != start &&\n\t\t\t\t   modifications.ContainsKey (node.NextStatement);\n\t\t}\n\n\t\tprotected abstract IEnumerable<CodeAction> GetFixes (BaseRefactoringContext context, Node env, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t string variableName);\n\n\t\t#region GatherVisitor\n\n\t\tclass GatherVisitor : GatherVisitorBase<AccessToClosureIssue>\n\t\t{\n\t\t\treadonly ControlFlowGraphBuilder cfgBuilder = new ControlFlowGraphBuilder ();\n\t\t\tstring title;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext context, SyntaxTree unit,\n\t\t\t\t\t\t\t\t  AccessToClosureIssue qualifierDirectiveEvidentIssueProvider)\n\t\t\t\t: base (context, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t\tthis.title = context.TranslateString (qualifierDirectiveEvidentIssueProvider.Title);\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableInitializer (VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tvar variableDecl = variableInitializer.Parent as VariableDeclarationStatement;\n\t\t\t\tif (variableDecl != null)\n\t\t\t\t\tCheckVariable (GetVariable(ctx.Resolve (variableInitializer)), \n\t\t\t\t\t\t\t\t   variableDecl.GetParent<Statement> ());\n\t\t\t\tbase.VisitVariableInitializer (variableInitializer);\n\t\t\t}\n\n\t\t\tpublic override void VisitForeachStatement (ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\tCheckVariable (GetVariable(ctx.Resolve (foreachStatement.VariableNameToken)),\n\t\t\t\t\t\t\t   foreachStatement);\n\t\t\t\tbase.VisitForeachStatement (foreachStatement);\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tvar parent = parameterDeclaration.Parent;\n\t\t\t\tStatement body = null;\n\t\t\t\tif (parent is MethodDeclaration) {\n\t\t\t\t\tbody = ((MethodDeclaration)parent).Body;\n\t\t\t\t} else if (parent is AnonymousMethodExpression) {\n\t\t\t\t\tbody = ((AnonymousMethodExpression)parent).Body;\n\t\t\t\t} else if (parent is LambdaExpression) {\n\t\t\t\t\tbody = ((LambdaExpression)parent).Body as Statement;\n\t\t\t\t} else if (parent is ConstructorDeclaration) {\n\t\t\t\t\tbody = ((ConstructorDeclaration)parent).Body;\n\t\t\t\t} else if (parent is OperatorDeclaration) {\n\t\t\t\t\tbody = ((OperatorDeclaration)parent).Body;\n\t\t\t\t}\n\t\t\t\tif (body != null) {\n\t\t\t\t\tvar lrr = ctx.Resolve (parameterDeclaration) as LocalResolveResult;\n\t\t\t\t\tif (lrr != null)\n\t\t\t\t\t\tCheckVariable (lrr.Variable, body);\n\t\t\t\t}\n\t\t\t\tbase.VisitParameterDeclaration (parameterDeclaration);\n\t\t\t}\n\t\t\t\n\t\t\tIVariable GetVariable(ResolveResult rr)\n\t\t\t{\n\t\t\t\tvar lrr = rr as LocalResolveResult;\n\t\t\t\treturn lrr != null ? lrr.Variable : null;\n\t\t\t}\n\n\t\t\tvoid CheckVariable(IVariable variable, Statement env)\n\t\t\t{\n\t\t\t\tif (variable == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (!issueProvider.IsTargetVariable(variable))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar root = new Environment (env, env);\n\t\t\t\tvar envLookup = new Dictionary<AstNode, Environment> ();\n\t\t\t\tenvLookup [env] = root;\n\n\t\t\t\tforeach (var result in ctx.FindReferences(env, variable)) {\n\t\t\t\t\tAddNode(envLookup, new Node(result.Node, issueProvider.GetNodeKind(result.Node)));\n\t\t\t\t}\n\n\t\t\t\troot.SortChildren ();\n\t\t\t\tCollectIssues (root, variable.Name);\n\t\t\t}\n\n\t\t\tvoid CollectIssues (Environment env, string variableName)\n\t\t\t{\n\t\t\t\tIList<ControlFlowNode> cfg = null;\n\t\t\t\tIDictionary<Statement, IList<Node>> modifications = null;\n\n\t\t\t\tif (env.Body != null) {\n\t\t\t\t\ttry { \n\t\t\t\t\t\tcfg = cfgBuilder.BuildControlFlowGraph (env.Body);\n\t\t\t\t\t} catch (Exception) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tmodifications = new Dictionary<Statement, IList<Node>> ();\n\t\t\t\t\tforeach (var node in env.Children) {\n\t\t\t\t\t\tif (node.Kind == NodeKind.Modification || node.Kind == NodeKind.ReferenceAndModification) {\n\t\t\t\t\t\t\tIList<Node> nodes;\n\t\t\t\t\t\t\tif (!modifications.TryGetValue (node.ContainingStatement, out nodes))\n\t\t\t\t\t\t\t\tmodifications [node.ContainingStatement] = nodes = new List<Node> ();\n\t\t\t\t\t\t\tnodes.Add (node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach (var child in env.GetChildEnvironments ()) {\n\t\t\t\t\tif (!child.IssueCollected && cfg != null && \n\t\t\t\t\t\tCanReachModification (cfg, child, modifications))\n\t\t\t\t\t\tCollectAllIssues (child, variableName);\n\n\t\t\t\t\tCollectIssues (child, variableName);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CollectAllIssues (Environment env, string variableName)\n\t\t\t{\n\t\t\t\tvar fixes = issueProvider.GetFixes (ctx, env, variableName).ToArray ();\n\t\t\t\tenv.IssueCollected = true;\n\n\t\t\t\tforeach (var child in env.Children) {\n\t\t\t\t\tif (child is Environment) {\n\t\t\t\t\t\tCollectAllIssues ((Environment)child, variableName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (child.Kind != NodeKind.Modification)\n\t\t\t\t\t\t\tAddIssue (new CodeIssue(child.AstNode, title, fixes));\n\t\t\t\t\t\t// stop marking references after the variable is modified in current environment\n\t\t\t\t\t\tif (child.Kind != NodeKind.Reference)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddNode (IDictionary<AstNode, Environment> envLookup, Node node)\n\t\t\t{\n\t\t\t\tvar astParent = node.AstNode.Parent;\n\t\t\t\tvar path = new List<AstNode> ();\n\t\t\t\twhile (astParent != null) {\n\t\t\t\t\tEnvironment parent;\n\t\t\t\t\tif (envLookup.TryGetValue (astParent, out parent)) {\n\t\t\t\t\t\tparent.Children.Add (node);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (astParent is LambdaExpression) {\n\t\t\t\t\t\tparent = new Environment (astParent, ((LambdaExpression)astParent).Body as Statement);\n\t\t\t\t\t} else if (astParent is AnonymousMethodExpression) {\n\t\t\t\t\t\tparent = new Environment (astParent, ((AnonymousMethodExpression)astParent).Body);\n\t\t\t\t\t}\n\n\t\t\t\t\tpath.Add (astParent);\n\t\t\t\t\tif (parent != null) {\n\t\t\t\t\t\tforeach (var astNode in path)\n\t\t\t\t\t\t\tenvLookup [astNode] = parent;\n\t\t\t\t\t\tpath.Clear ();\n\n\t\t\t\t\t\tparent.Children.Add (node);\n\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t}\n\t\t\t\t\tastParent = astParent.Parent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool CanReachModification (IEnumerable<ControlFlowNode> cfg, Environment env,\n\t\t\t\t\t\t\t\t\t   IDictionary<Statement, IList<Node>> modifications)\n\t\t\t{\n\t\t\t\tif (modifications.Count == 0)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar start = env.ContainingStatement;\n\t\t\t\tif (modifications.ContainsKey (start) &&\n\t\t\t\t\tmodifications [start].Any (v => v.AstNode.StartLocation > env.AstNode.EndLocation))\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar stack = new Stack<ControlFlowNode> (cfg.Where (node => node.NextStatement == start));\n\t\t\t\tvar visitedNodes = new HashSet<ControlFlowNode> (stack);\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\tvar node = stack.Pop ();\n\t\t\t\t\tif (issueProvider.CanReachModification (node, start, modifications))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tforeach (var edge in node.Outgoing) {\n\t\t\t\t\t\tif (visitedNodes.Add (edge.To))\n\t\t\t\t\t\t\tstack.Push (edge.To);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Node\n\n\t\tprotected enum NodeKind\n\t\t{\n\t\t\tReference,\n\t\t\tModification,\n\t\t\tReferenceAndModification,\n\t\t\tEnvironment,\n\t\t}\n\n\t\tprotected class Node\n\t\t{\n\t\t\tpublic AstNode AstNode\n\t\t\t{ get; private set; }\n\n\t\t\tpublic NodeKind Kind\n\t\t\t{ get; private set; }\n\n\t\t\tpublic Statement ContainingStatement\n\t\t\t{ get; private set; }\n\n\t\t\tpublic Node (AstNode astNode, NodeKind kind)\n\t\t\t{\n\t\t\t\tAstNode = astNode;\n\t\t\t\tKind = kind;\n\t\t\t\tContainingStatement = astNode.GetParent<Statement> ();\n\t\t\t}\n\n\t\t\tpublic virtual IEnumerable<Node> GetAllReferences ()\n\t\t\t{\n\t\t\t\tyield return this;\n\t\t\t}\n\t\t}\n\n\t\tprotected class Environment : Node\n\t\t{\n\t\t\tpublic Statement Body\n\t\t\t{ get; private set; }\n\n\t\t\tpublic bool IssueCollected\n\t\t\t{ get; set; }\n\n\t\t\tpublic List<Node> Children\n\t\t\t{ get; private set; }\n\n\t\t\tpublic Environment (AstNode astNode, Statement body)\n\t\t\t\t: base (astNode, NodeKind.Environment)\n\t\t\t{\n\t\t\t\tBody = body;\n\t\t\t\tChildren = new List<Node> ();\n\t\t\t}\n\n\t\t\tpublic override IEnumerable<Node> GetAllReferences ()\n\t\t\t{\n\t\t\t\treturn Children.SelectMany (child => child.GetAllReferences ());\n\t\t\t}\n\n\t\t\tpublic IEnumerable<Environment> GetChildEnvironments ()\n\t\t\t{\n\t\t\t\treturn from child in Children\n\t\t\t\t\t   where child is Environment\n\t\t\t\t\t   select (Environment)child;\n\t\t\t}\n\n\t\t\tpublic void SortChildren ()\n\t\t\t{\n\t\t\t\tChildren.Sort ((x, y) => x.AstNode.StartLocation.CompareTo(y.AstNode.StartLocation));\n\t\t\t\tforeach (var env in GetChildEnvironments ())\n\t\t\t\t\tenv.SortChildren ();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToDisposedClosureIssue.cs",
    "content": "﻿// \n// AccessToDisposedClosureIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//    [IssueDescription (\"Access to disposed closure variable\",\n//                       Description = \"Access to closure variable from anonymous method when the variable is\" + \n//                                     \" disposed externally\",\n//                       Category = IssueCategories.CodeQualityIssues,\n//                       Severity = Severity.Warning,\n//\t                   AnalysisDisableKeyword = \"AccessToDisposedClosure\")]\n\tpublic class AccessToDisposedClosureIssue : AccessToClosureIssue\n\t{\n\t\tpublic AccessToDisposedClosureIssue ()\n\t\t\t: base (\"Access to disposed closure\")\n\t\t{\n\t\t}\n\n\t\tprotected override bool IsTargetVariable (IVariable variable)\n\t\t{\n\t\t\treturn variable.Type.GetAllBaseTypeDefinitions ().Any (t => t.KnownTypeCode == KnownTypeCode.IDisposable);\n\t\t}\n\n\t\tprotected override NodeKind GetNodeKind (AstNode node)\n\t\t{\n\t\t\tif (node.Parent is UsingStatement)\n\t\t\t\treturn NodeKind.ReferenceAndModification;\n\n\t\t\tif (node.Parent is VariableDeclarationStatement && node.Parent.Parent is UsingStatement)\n\t\t\t\treturn NodeKind.Modification;\n\n\t\t\tvar memberRef = node.Parent as MemberReferenceExpression;\n\t\t\tif (memberRef != null && memberRef.Parent is InvocationExpression && memberRef.MemberName == \"Dispose\")\n\t\t\t\treturn NodeKind.ReferenceAndModification;\n\n\t\t\treturn NodeKind.Reference;\n\t\t}\n\n\t\tprotected override bool CanReachModification (ControlFlowNode node, Statement start,\n\t\t\t\t\t\t\t\t\t\t\t\t   IDictionary<Statement, IList<Node>> modifications)\n\t\t{\n\t\t\tif (base.CanReachModification (node, start, modifications))\n\t\t\t\treturn true;\n\n\t\t\tif (node.NextStatement != start) {\n\t\t\t\tvar usingStatement = node.PreviousStatement as UsingStatement;\n\t\t\t\tif (usingStatement != null) {\n\t\t\t\t\tif (modifications.ContainsKey(usingStatement))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif (usingStatement.ResourceAcquisition is Statement &&\n\t\t\t\t\t\tmodifications.ContainsKey ((Statement)usingStatement.ResourceAcquisition))\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprotected override IEnumerable<CodeAction> GetFixes (BaseRefactoringContext context, Node env,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t string variableName)\n\t\t{\n\t\t\tyield break;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/AccessToModifiedClosureIssue.cs",
    "content": "﻿// \n// AccessToModifiedClosureIssue.cs\n//  \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//    [IssueDescription(\"Access to modified closure variable\",\n//                       Description = \"Access to closure variable from anonymous method when the variable is modified \" +\n//                                     \"externally\",\n//                       Category = IssueCategories.CodeQualityIssues,\n//                       Severity = Severity.Warning,\n//\t                   AnalysisDisableKeyword = \"AccessToModifiedClosure\")]\t\n\tpublic class AccessToModifiedClosureIssue : AccessToClosureIssue\n\t{\n\t\tpublic AccessToModifiedClosureIssue ()\n\t\t\t: base (\"Access to modified closure\")\n\t\t{\n\t\t}\n\n\t\tprotected override NodeKind GetNodeKind (AstNode node)\n\t\t{\n\t\t\tvar assignment = node.GetParent<AssignmentExpression> ();\n\t\t\tif (assignment != null && assignment.Left == node) {\n\t\t\t\tif (assignment.Operator == AssignmentOperatorType.Assign) \n\t\t\t\t\treturn NodeKind.Modification;\n\t\t\t\treturn NodeKind.ReferenceAndModification;\n\t\t\t}\n\t\t\tvar unaryExpr = node.GetParent<UnaryOperatorExpression> ();\n\t\t\tif (unaryExpr != null && unaryExpr.Expression == node &&\n\t\t\t\t(unaryExpr.Operator == UnaryOperatorType.Increment ||\n\t\t\t\t unaryExpr.Operator == UnaryOperatorType.PostIncrement ||\n\t\t\t\t unaryExpr.Operator == UnaryOperatorType.Decrement ||\n\t\t\t\t unaryExpr.Operator == UnaryOperatorType.PostDecrement)) {\n\t\t\t\treturn NodeKind.ReferenceAndModification;\n\t\t\t}\n\t\t\tif (node.Parent is ForeachStatement)\n\t\t\t\treturn NodeKind.Modification;\n\n\t\t\treturn NodeKind.Reference;\n\t\t}\n\n\t\tprotected override IEnumerable<CodeAction> GetFixes (BaseRefactoringContext context, Node env,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t string variableName)\n\t\t{\n\t\t\tvar containingStatement = env.ContainingStatement;\n\n\t\t\t// we don't give a fix for these cases since the general fix may not work\n\t\t\t// lambda in while/do-while/for condition\n\t\t\tif (containingStatement is WhileStatement || containingStatement is DoWhileStatement ||\n\t\t\t\tcontainingStatement is ForStatement)\n\t\t\t\tyield break;\n\t\t\t// lambda in for initializer/iterator\n\t\t\tif (containingStatement.Parent is ForStatement &&\n\t\t\t\t((ForStatement)containingStatement.Parent).EmbeddedStatement != containingStatement)\n\t\t\t\tyield break;\n\n\t\t\tAction<Script> action = script =>\n\t\t\t{\n\t\t\t\tvar newName = LocalVariableNamePicker.PickSafeName (\n\t\t\t\t\tcontainingStatement.GetParent<EntityDeclaration> (),\n\t\t\t\t\tEnumerable.Range (1, 100).Select (i => variableName + i));\n\n\t\t\t\tvar variableDecl = new VariableDeclarationStatement (new SimpleType(\"var\"), newName, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new IdentifierExpression (variableName));\n\t\t\t\t\n\t\t\t\tif (containingStatement.Parent is BlockStatement || containingStatement.Parent is SwitchSection) {\n\t\t\t\t\tscript.InsertBefore (containingStatement, variableDecl);\n\t\t\t\t} else {\n\t\t\t\t\tvar offset = script.GetCurrentOffset (containingStatement.StartLocation);\n\t\t\t\t\tscript.InsertBefore (containingStatement, variableDecl);\n\t\t\t\t\tscript.InsertText (offset, \"{\");\n\t\t\t\t\tscript.InsertText (script.GetCurrentOffset (containingStatement.EndLocation), \"}\");\n\t\t\t\t\tscript.FormatText (containingStatement.Parent);\n\t\t\t\t}\n\n\t\t\t\tvar textNodes = new List<AstNode> ();\n\t\t\t\ttextNodes.Add (variableDecl.Variables.First ().NameToken);\n\n\t\t\t\tforeach (var reference in env.GetAllReferences ()) {\n\t\t\t\t\tvar identifier = new IdentifierExpression (newName);\n\t\t\t\t\tscript.Replace (reference.AstNode, identifier);\n\t\t\t\t\ttextNodes.Add (identifier);\n\t\t\t\t}\n\t\t\t\tscript.Link (textNodes.ToArray ());\n\t\t\t};\n\t\t\tyield return new CodeAction (context.TranslateString (\"Copy to local variable\"), action, env.AstNode);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/AccessToClosureIssues/LocalVariableNamePicker.cs",
    "content": "﻿// \n// NamePicker.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic static class LocalVariableNamePicker\n\t{\n\t\tpublic static string PickSafeName (AstNode node, IEnumerable<string> candidates)\n\t\t{\n\t\t\tvar existingNames = new VariableNameCollector ().Collect (node);\n\t\t\treturn candidates.FirstOrDefault (name => !existingNames.Contains (name));\n\t\t}\n\n\t\tclass VariableNameCollector : DepthFirstAstVisitor\n\t\t{\n\t\t\tprivate ISet<string> variableNames = new HashSet<string> ();\n\n\t\t\tpublic ISet<string> Collect (AstNode node)\n\t\t\t{\n\t\t\t\tvariableNames.Clear ();\n\t\t\t\tnode.AcceptVisitor (this);\n\t\t\t\treturn variableNames;\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tvariableNames.Add (parameterDeclaration.Name);\n\t\t\t\tbase.VisitParameterDeclaration (parameterDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableInitializer (VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tvariableNames.Add (variableInitializer.Name);\n\t\t\t\tbase.VisitVariableInitializer (variableInitializer);\n\t\t\t}\n\n\t\t\tpublic override void VisitForeachStatement (ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\tvariableNames.Add (foreachStatement.VariableName);\n\t\t\t\tbase.VisitForeachStatement (foreachStatement);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/DuplicateBodyMethodIssue.cs",
    "content": "//\n// DuplicateBodyMethodIssue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Text;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Methods have duplicate body\",\n//                      Description = \"One method has the same body as other method\",\n//                      Severity = Severity.Hint,\n//                      IssueMarker = IssueMarker.Underline)]\n\tpublic class DuplicateBodyMethodIssue : CodeIssueProvider\n\t{\n\t\t#region ICodeIssueProvider implementation\n\t\tpublic override IEnumerable<CodeIssue> GetIssues(BaseRefactoringContext context, string subIssue)\n\t\t{\n\t\t\tvar visitor = new GatherVisitor(context);\n\t\t\tvisitor.GetMethods();\n\t\t\tvisitor.ComputeConflicts();\n\t\t\treturn visitor.GetIssues();\n\t\t}\n\t\t#endregion\n\n\t\tprivate class GatherVisitor : GatherVisitorBase<DuplicateBodyMethodIssue>\n\t\t{\n\t\t\tpublic List<MethodDeclaration> DeclaredMethods;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context)\n\t\t\t\t: base(context)\n\t\t\t{\n\t\t\t\tDeclaredMethods = new List<MethodDeclaration>();\n\t\t\t}\n\n\t\t\tstatic string GetMethodDescriptor(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tvar sb = new StringBuilder();\n\t\t\t\tsb.Append(methodDeclaration.ReturnType);\n\t\t\t\tsb.Append(\";\");\n\t\t\t\tforeach (var parameter in methodDeclaration.Parameters) {\n\t\t\t\t\tsb.AppendFormat(\"{0}:{1};\", parameter.Name, parameter.Type);\n\t\t\t\t}\n\t\t\t\tsb.Append(methodDeclaration.Modifiers);\n\t\t\t\treturn sb.ToString();\n\t\t\t}\n\n\t\t\tpublic void GetMethods()\n\t\t\t{\n\t\t\t\tctx.RootNode.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tinternal void ComputeConflicts()\n\t\t\t{\n\t\t\t\tvar dict = new Dictionary<string, List<MethodDeclaration>>();\n\t\t\t\tforeach (var declaredMethod in DeclaredMethods) {\n\t\t\t\t\tvar methodDescriptor = GetMethodDescriptor(declaredMethod);\n\t\t\t\t\tList<MethodDeclaration> listMethods;\n\t\t\t\t\tif (!dict.TryGetValue(methodDescriptor, out listMethods)) {\n\t\t\t\t\t\tlistMethods = new List<MethodDeclaration>();\n\t\t\t\t\t\tdict [methodDescriptor] = listMethods;\n\t\t\t\t\t}\n\t\t\t\t\tlistMethods.Add(declaredMethod);\n\t\t\t\t}\n\t\t\t\tDeclaredMethods.Clear();\n\n\t\t\t\tforeach (var list in dict.Values.Where(list => list.Count >= 2)) {\n\t\t\t\t\tfor (var i = 0; i < list.Count - 1; i++) {\n\t\t\t\t\t\tvar firstMethod = list [i];\n\t\t\t\t\t\tfor (var j = i + 1; j < list.Count; j++) {\n\t\t\t\t\t\t\tvar secondMethod = list [j];\n\t\t\t\t\t\t\tif (firstMethod.Body.IsMatch(secondMethod.Body)) {\n\t\t\t\t\t\t\t\tAddIssue(new CodeIssue(secondMethod.NameToken,\n\t\t\t\t\t\t\t\t         string.Format(\"Method '{0}' has the same with '{1}' \", secondMethod.Name,\n\t\t\t\t\t\t\t\t              firstMethod.Name), string.Format(\"Method '{0}' has the same with '{1}' \", secondMethod.Name,\n\t\t\t\t\t\t\t\t                                 firstMethod.Name),\n\t\t\t\t\t\t\t\t                                 script => {\n\t\t\t\t\t\t\t\t\tInvokeMethod(script, firstMethod, secondMethod); }\n\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treadonly InsertParenthesesVisitor _insertParenthesesVisitor = new InsertParenthesesVisitor();\n\t\t\tprivate TypeDeclaration _parentType;\n\n\t\t\tprivate void InvokeMethod(Script script, MethodDeclaration firstMethod, MethodDeclaration secondMethod)\n\t\t\t{\n\t\t\t\tvar statement =\n                    new ExpressionStatement(new InvocationExpression(new IdentifierExpression(firstMethod.Name),\n                                                                     firstMethod.Parameters.Select(\n                                                                         declaration =>\n                                                                         GetArgumentExpression(declaration).Clone())));\n\t\t\t\tstatement.AcceptVisitor(_insertParenthesesVisitor);\n\t\t\t\tif (firstMethod.ReturnType.ToString() != \"System.Void\") {\n\t\t\t\t\tvar returnStatement = new ReturnStatement(statement.Expression.Clone());\n\n\t\t\t\t\tscript.Replace(secondMethod.Body, new BlockStatement { returnStatement });\n\t\t\t\t} else {\n\t\t\t\t\tscript.Replace(secondMethod.Body, new BlockStatement { statement });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic Expression GetArgumentExpression(ParameterDeclaration parameter)\n\t\t\t{\n\t\t\t\tvar identifierExpr = new IdentifierExpression(parameter.Name);\n\t\t\t\tswitch (parameter.ParameterModifier) {\n\t\t\t\t\tcase ParameterModifier.Out:\n\t\t\t\t\t\treturn new DirectionExpression(FieldDirection.Out, identifierExpr);\n\t\t\t\t\tcase ParameterModifier.Ref:\n\t\t\t\t\t\treturn new DirectionExpression(FieldDirection.Ref, identifierExpr);\n\t\t\t\t}\n\t\t\t\treturn identifierExpr;\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration declaration)\n\t\t\t{\n\t\t\t\tvar context = ctx;\n\t\t\t\tvar methodDeclaration = declaration;\n\n\t\t\t\tvar resolved = context.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (resolved == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar isImplementingInterface = resolved.Member.ImplementedInterfaceMembers.Any();\n\n\t\t\t\tif (isImplementingInterface)\n\t\t\t\t\treturn;\n\t\t\t\tif (declaration.Body.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tvar parentType = declaration.Parent as TypeDeclaration;\n\t\t\t\tif (parentType == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (_parentType == null)\n\t\t\t\t\t_parentType = parentType;\n\t\t\t\telse {\n\t\t\t\t\t//if we are here, it means that we switched from one class to another, so it means that we should compute \n\t\t\t\t\t//the duplicates up-to now, then reset the list of methods\n\t\t\t\t\tif (parentType != _parentType) {\n\t\t\t\t\t\tComputeConflicts();\n\t\t\t\t\t\tDeclaredMethods.Add(declaration); \n\t\t\t\t\t\t_parentType = parentType;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tDeclaredMethods.Add(declaration);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/DuplicateExpressionsInConditionsIssue.cs",
    "content": "//\n// DuplicateExpressionsInConditionsIssue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//    [IssueDescription(\"Expression has some redundant items\",\n//\t\t                   Description = \"Expression has some redundant items\",\n//\t\t                   Category = IssueCategories.CodeQualityIssues,\n//\t\t                   Severity = Severity.Warning,\n//\t\t                   AnalysisDisableKeyword = \"ConditionalTernaryEqualBranch\")]\n\tpublic class DuplicateExpressionsInConditionsIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n        static readonly List<BinaryOperatorType> SupportedOperators = new List<BinaryOperatorType>();\n        static DuplicateExpressionsInConditionsIssue()\n        {\n            SupportedOperators.Add(BinaryOperatorType.BitwiseAnd);\n            SupportedOperators.Add(BinaryOperatorType.BitwiseOr);\n            SupportedOperators.Add(BinaryOperatorType.ConditionalAnd);\n            SupportedOperators.Add(BinaryOperatorType.ConditionalOr);\n        }\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<DuplicateExpressionsInConditionsIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n            public override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n            {\n                var expression = binaryOperatorExpression;\n                base.VisitBinaryOperatorExpression(expression);\n                if(!SupportedOperators.Contains(expression.Operator) )\n                    return;\n                var parentExpression = expression.Parent as BinaryOperatorExpression;\n                if(parentExpression!=null && parentExpression.Operator==expression.Operator)\n                {\n                    //handle only parent sequence\n                    return;\n                }\n                var expressions = GetExpressions(binaryOperatorExpression, expression);\n                for(var i=0;i<expressions.Count-1;i++)\n                {\n                    for (var j = i+1; j < expressions.Count; j++)\n                    {\n                        var expressionLeft = expressions[i];\n                        var expressionRight = expressions[j];\n                        if (!expressionLeft.IsMatch(expressionRight))\n                            continue;\n                        var action = new CodeAction(ctx.TranslateString(\"Remove redundant expression\"),\n                                                    script => RemoveRedundantExpression(script, expressionRight),\n                                                    expressionRight);\n                    \n\t\t\t\t\t\tAddIssue(\n\t\t\t\t\t\t\tnew CodeIssue(expressionRight, \n\t\t\t\t\t\t\t\tctx.TranslateString(string.Format(\"The expression '{0}' is identical in the left branch\", expressionRight)), \n\t\t\t\t\t\t\t\taction\n\t\t\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut }\n\t\t\t\t\t\t);\n\n\n                    }\n                }\n            }\n\n\t\t    private static void RemoveRedundantExpression(Script script, AstNode expressionRight)\n\t\t    {\n                var parent = expressionRight.Parent as BinaryOperatorExpression;\n                if(parent==null) //should never happen!\n                    return;\n                script.Replace(parent, parent.Left.Clone());\n\t\t    }\n\n\t\t    private static List<Expression> GetExpressions(BinaryOperatorExpression binaryOperatorExpression,\n\t\t                                       BinaryOperatorExpression expression)\n\t\t    {\n\t\t        var baseExpression = expression;\n\t\t        var leftExpression = baseExpression.FirstChild as BinaryOperatorExpression;\n\t\t        var expressions = new List<Expression>();\n\t\t        while (leftExpression != null && binaryOperatorExpression.Operator == leftExpression.Operator)\n\t\t        {\n\t\t            expressions.Add(baseExpression.Right);\n\t\t            baseExpression = leftExpression;\n\t\t            leftExpression = leftExpression.Left as BinaryOperatorExpression;\n\t\t        }\n\t\t        expressions.Add(baseExpression.Right);\n\t\t        expressions.Add(baseExpression.Left);\n\t\t        expressions.Reverse();\n\t\t        return expressions;\n\t\t    }\n\t\t}\n\t}\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/DuplicateIfInIfChainIssue.cs",
    "content": "//\n// DuplicateIfInIfChainIssue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Else branch has some redundant if\",\n//\t                  Description = \"One Else-if was checked before so is not be true\",\n//\t                  Category = IssueCategories.CodeQualityIssues,\n//\t                  Severity = Severity.Warning,\n//\t                  AnalysisDisableKeyword = \"ConditionalTernaryEqualBranch\")]\n\tpublic class DuplicateIfInIfChainIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<DuplicateIfInIfChainIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifStatement);\n\t\t\t\tvar parentExpression = ifStatement.Parent as IfElseStatement;\n\t\t\t\t//handle only parent sequence\n\t\t\t\tif (parentExpression != null)\n\t\t\t\t\treturn;\n\t\t\t\tvar expressions = GetExpressions(ifStatement);\n\t\t\t\tfor(var i=0;i<expressions.Count-1;i++) {\n\t\t\t\t\tfor (var j = i+1; j < expressions.Count; j++) {\n\t\t\t\t\t\tvar leftCondition = expressions[i].Condition;\n                        var rightIf = expressions[j];\n                        var rightCondition = rightIf.Condition;\n\t\t\t\t\t    \n\t\t\t\t\t\tif (!leftCondition.IsMatch(rightCondition))\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar action = new CodeAction(ctx.TranslateString(\"Remove redundant expression\"),\n                                                    script => RemoveRedundantIf(script, rightIf),\n\t\t\t\t\t\t                            rightCondition);\n\t\t\t\t\t\t\n\t\t\t\t\t\tAddIssue(new CodeIssue(rightCondition,\n\t\t\t\t\t\t         ctx.TranslateString(string.Format(\"The expression '{0}' is identical in the left branch\",\n\t\t\t\t\t\t\t\trightCondition)), action) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n            private static void RemoveRedundantIf(Script script, IfElseStatement expressionRight)\n            {\n                var parent = expressionRight.Parent as IfElseStatement;\n                if(parent==null) { //should never happen!\n                    return;\n                }\n                if (expressionRight.FalseStatement.IsNull) {\n                    script.Remove(parent.ElseToken);\n                    script.Remove(parent.FalseStatement);\n                    script.FormatText(parent);\n\t\t\t\t} else {\n\t\t\t\t\tscript.Replace(parent.FalseStatement, expressionRight.FalseStatement.Clone());\n\t\t\t\t}\n            }\n\n\t\t    private static List<IfElseStatement> GetExpressions(IfElseStatement expression)\n\t\t\t{\n\t\t\t\tvar baseExpression = expression;\n\t\t\t\tvar falseExpression = baseExpression.FalseStatement as IfElseStatement;\n                var expressions = new List<IfElseStatement>();\n\t\t\t\twhile (falseExpression != null) {\n\t\t\t\t\texpressions.Add(baseExpression);\n\t\t\t\t\tbaseExpression = falseExpression;\n\t\t\t\t\tfalseExpression = falseExpression.FalseStatement as IfElseStatement;\n\t\t\t\t}\n\t\t\t\texpressions.Add(baseExpression);\n\t\t\t\treturn expressions;\n\t\t\t}\n\t\t}\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/ParameterCanBeIEnumerableIssue.cs",
    "content": "//\n// ParameterCanBeIEnumerableIssue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n// Does this even make sense ? We've a parameter can be demoted issue which does mostly the same.\n//\t[IssueDescription(\"A parameter can IEnumerable/ICollection/IList<T>\",\n//\t                  Description = \"Finds parameters that can be demoted to a generic list.\",\n//\t                  Category = IssueCategories.Opportunities,\n//\t                  Severity = Severity.Suggestion\n//\t                  )]\n\tpublic class ParameterCanBeIEnumerableIssue : GatherVisitorCodeIssueProvider\n\t{\n\t    readonly bool tryResolve;\n\t\t\n\t\tpublic ParameterCanBeIEnumerableIssue() : this (true)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic ParameterCanBeIEnumerableIssue(bool tryResolve)\n\t\t{\n\t\t\tthis.tryResolve = tryResolve;\n\t\t}\n\t\t\n\t\t#region ICodeIssueProvider implementation\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, tryResolve);\n\t\t}\n\t\t#endregion\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<ParameterCanBeIEnumerableIssue>\n\t\t{\n\t\t\tbool tryResolve;\n\t\t\t\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context, bool tryResolve) : base (context)\n\t\t\t{\n\t\t\t\tthis.tryResolve = tryResolve;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tmethodDeclaration.Attributes.AcceptVisitor(this);\n\t\t\t\tif (HasEntryPointSignature(methodDeclaration))\n\t\t\t\t\treturn;\n\t\t\t\tvar eligibleParameters = methodDeclaration.Parameters\n\t\t\t\t\t.Where(p => p.ParameterModifier != ParameterModifier.Out && p.ParameterModifier != ParameterModifier.Ref)\n\t\t\t\t\t\t.ToList();\n\t\t\t\tif (eligibleParameters.Count == 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar declarationResolveResult = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (declarationResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar member = declarationResolveResult.Member;\n\t\t\t\tif (member.IsOverride || member.IsOverridable || member.ImplementedInterfaceMembers.Any())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar collector = new TypeCriteriaCollector(ctx);\n\t\t\t\tmethodDeclaration.AcceptVisitor(collector);\n\t\t\t\t\n\t\t\t\tforeach (var parameter in eligibleParameters) {\n\t\t\t\t\tProcessParameter(parameter, methodDeclaration.Body, collector);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbool HasEntryPointSignature(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!methodDeclaration.Modifiers.HasFlag(Modifiers.Static))\n\t\t\t\t\treturn false;\n\t\t\t\tvar returnType = ctx.Resolve(methodDeclaration.ReturnType).Type;\n\t\t\t\tif (!returnType.IsKnownType(KnownTypeCode.Int32) && !returnType.IsKnownType(KnownTypeCode.Void))\n\t\t\t\t\treturn false;\n\t\t\t\tvar parameterCount = methodDeclaration.Parameters.Count;\n\t\t\t\tif (parameterCount == 0)\n\t\t\t\t\treturn true;\n\t\t\t\tif (parameterCount != 1)\n\t\t\t\t\treturn false;\n\t\t\t\tvar parameterType = ctx.Resolve(methodDeclaration.Parameters.First()).Type as ArrayType;\n\t\t\t\treturn parameterType != null && parameterType.ElementType.IsKnownType(KnownTypeCode.String);\n\t\t\t}\n\n            void ProcessParameter(ParameterDeclaration parameter, AstNode rootResolutionNode, TypeCriteriaCollector collector)\n            {\n                var localResolveResult = ctx.Resolve(parameter) as LocalResolveResult;\n                if (localResolveResult == null)\n                    return;\n                var variable = localResolveResult.Variable;\n                var typeKind = variable.Type.Kind;\n                if (!(typeKind == TypeKind.Class ||\n                      typeKind == TypeKind.Struct ||\n                      typeKind == TypeKind.Interface ||\n                      typeKind == TypeKind.Array) ||\n                    !collector.UsedVariables.Contains(variable))\n                {\n                    return;\n                }\n\n                var candidateTypes = localResolveResult.Type.GetAllBaseTypes()\n                    .Where(t => t.IsParameterized)\n                    .ToList();\n\n                var validTypes =\n                    (from type in candidateTypes\n                     where !tryResolve || ParameterCanBeDeclaredWithBaseTypeIssue.TypeChangeResolvesCorrectly(ctx, parameter, rootResolutionNode, type)\n                     select type).ToList();\n                if (!validTypes.Any()) return;\n\n                var foundType = validTypes.FirstOrDefault();\n                if (foundType == null)\n                    return;\n\n\t\t\t\tAddIssue(new CodeIssue(parameter.NameToken, string.Format(ctx.TranslateString(\"Parameter can be {0}\"),\n\t\t\t\t                                            foundType.Name),string.Format(ctx.TranslateString(\"Parameter can be {0}\"),\n\t\t\t\t                              foundType.Name),\n\t\t\t\t\tscript => script.Replace(parameter.Type, CreateShortType(ctx, foundType, parameter))));\n            }\n\n\t\t    public static AstType CreateShortType(BaseRefactoringContext refactoringContext, IType expressionType, AstNode node)\n            {\n\n                var csResolver = refactoringContext.Resolver.GetResolverStateBefore(node);\n                var builder = new TypeSystemAstBuilder(csResolver);\n                return builder.ConvertType(expressionType);\n            }\n\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/NotWorking/VariableDeclaredInWideScopeIssue.cs",
    "content": "//\n// VariableDeclaredWideScopeIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"The variable can be declared in a nested scope\",\n//\t                   Description = \"Highlights variables that can be declared in a nested scope.\",\n//\t                   Category = IssueCategories.Opportunities,\n//\t                   Severity = Severity.Suggestion)]\n\tpublic class VariableDeclaredInWideScopeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\t#region ICodeIssueProvider implementation\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\t\t#endregion\n\n\t\tclass GatherVisitor : GatherVisitorBase<VariableDeclaredInWideScopeIssue>\n\t\t{\n\t\t\treadonly BaseRefactoringContext context;\n\t\t\t\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context, VariableDeclaredInWideScopeIssue qualifierDirectiveEvidentIssueProvider) : base (context, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t}\n\n\t\t\tstatic readonly IList<Type> moveTargetBlacklist = new List<Type> {\n\t\t\t\ttypeof(WhileStatement),\n\t\t\t\ttypeof(ForeachStatement),\n\t\t\t\ttypeof(ForStatement),\n\t\t\t\ttypeof(DoWhileStatement),\n\t\t\t\ttypeof(TryCatchStatement),\n\t\t\t\ttypeof(AnonymousMethodExpression),\n\t\t\t\ttypeof(LambdaExpression),\n\t\t\t\ttypeof(LockStatement)\n\t\t\t};\n\n\t\t\tclass CheckInitializer : DepthFirstAstVisitor\n\t\t\t{\n\t\t\t\tpublic bool IsValid {\n\t\t\t\t\tget;\n\t\t\t\t\tprivate set;\n\t\t\t\t}\n\n\t\t\t\tpublic CheckInitializer()\n\t\t\t\t{\n\t\t\t\t\tIsValid = true;\n\t\t\t\t}\n\n\t\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t\t{\n\t\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\t\tIsValid = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbool CheckForInvocations(Expression initializer)\n\t\t\t{\n\t\t\t\tvar visitor = new CheckInitializer();\n\t\t\t\tinitializer.AcceptVisitor(visitor);\n\t\t\t\treturn visitor.IsValid;\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t\t{\n\t\t\t\tbase.VisitVariableDeclarationStatement(variableDeclarationStatement);\n\n\t\t\t\tvar rootNode = variableDeclarationStatement.Parent as BlockStatement;\n\t\t\t\tif (rootNode == null)\n\t\t\t\t\t// We are somewhere weird, like a the ResourceAquisition of a using statement\n\t\t\t\t\treturn;\n\n\t\t\t\t// TODO: Handle declarations with more than one variable?\n\t\t\t\tif (variableDeclarationStatement.Variables.Count > 1)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar variableInitializer = variableDeclarationStatement.Variables.First();\n\t\t\t\tvar identifiers = GetIdentifiers(rootNode.Descendants, variableInitializer.Name).ToList();\n\n\t\t\t\tif (identifiers.Count == 0)\n\t\t\t\t\t// variable is not used\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!CheckForInvocations(variableInitializer.Initializer))\n\t\t\t\t\treturn;\n\n\t\t\t\tAstNode deepestCommonAncestor = GetDeepestCommonAncestor(rootNode, identifiers);\n\t\t\t\tvar path = GetPath(rootNode, deepestCommonAncestor);\n\n\t\t\t\t// The node that will follow the moved declaration statement\n\t\t\t\tAstNode anchorNode = GetInitialAnchorNode(rootNode, identifiers, path);\n\n\t\t\t\t// Restrict path to only those where the initializer has not changed\n\t\t\t\tvar pathToCheck = path.Skip(1).ToList();\n\t\t\t\tvar firstInitializerChangeNode = GetFirstInitializerChange(variableDeclarationStatement, pathToCheck, variableInitializer.Initializer);\n\t\t\t\tif (firstInitializerChangeNode != null) {\n\t\t\t\t\t// The node changing the initializer expression may not be on the path\n\t\t\t\t\t// to the actual usages of the variable, so we need to merge the paths\n\t\t\t\t\t// so we get the part of the paths that are common between them\n\t\t\t\t\tvar pathToChange = GetPath(rootNode, firstInitializerChangeNode);\n\t\t\t\t\tvar deepestCommonIndex = GetLowestCommonAncestorIndex(path, pathToChange);\n\t\t\t\t\tanchorNode = pathToChange [deepestCommonIndex + 1];\n\t\t\t\t\tpath = pathToChange.Take(deepestCommonIndex).ToList();\n\t\t\t\t}\n\n\t\t\t\t// Restrict to locations outside of blacklisted node types\n\t\t\t\tvar firstBlackListedNode = path.FirstOrDefault(node => moveTargetBlacklist.Contains(node.GetType()));\n\t\t\t\tif (firstBlackListedNode != null) {\n\t\t\t\t\tpath = GetPath(rootNode, firstBlackListedNode.Parent);\n\t\t\t\t\tanchorNode = firstBlackListedNode;\n\t\t\t\t}\n\n\t\t\t\tanchorNode = GetInsertionPoint(anchorNode);\n\n\t\t\t\tif (anchorNode != null && anchorNode != rootNode && anchorNode.Parent != rootNode) {\n\t\t\t\t\tAddIssue(new CodeIssue(variableDeclarationStatement, context.TranslateString(\"Variable could be moved to a nested scope\"),\n\t\t\t\t\t\tGetActions(variableDeclarationStatement, (Statement)anchorNode)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic bool IsBannedInsertionPoint(AstNode anchorNode)\n\t\t\t{\n\t\t\t\tvar parent = anchorNode.Parent;\n\n\t\t\t\t// Don't split 'else if ...' into else { if ... }\n\t\t\t\tif (parent is IfElseStatement && anchorNode is IfElseStatement)\n\t\t\t\t\treturn true;\n\t\t\t\t// Don't allow moving the declaration into the resource aquisition of a using statement\n\t\t\t\tif (parent is UsingStatement)\n\t\t\t\t\treturn true;\n\t\t\t\t// Don't allow moving things into arbitrary positions of for statements\n\t\t\t\tif (parent is ForStatement && anchorNode.Role != Roles.EmbeddedStatement)\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tstatic AstNode GetInsertionPoint(AstNode node)\n\t\t\t{\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (node == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (node is Statement && !IsBannedInsertionPoint(node))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tnode = node.Parent;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\n\t\t\tAstNode GetInitialAnchorNode (BlockStatement rootNode, List<IdentifierExpression> identifiers, IList<AstNode> path)\n\t\t\t{\n\t\t\t\tif (identifiers.Count > 1) {\n\t\t\t\t\t// Assume the first identifier is the first in the execution flow\n\t\t\t\t\t// firstPath will always be longer than path since path is the\n\t\t\t\t\t// combination of a least two (different) paths.\n\t\t\t\t\tvar firstPath = GetPath(rootNode, identifiers [0]);\n\t\t\t\t\tif (firstPath [path.Count].Role == IfElseStatement.TrueRole) {\n\t\t\t\t\t\t// IfElseStatement has a slightly weird structure; Don't\n\t\t\t\t\t\t// consider the true role eligible for anchor node in this case\n\t\t\t\t\t\treturn firstPath [path.Count - 1];\n\t\t\t\t\t}\n\t\t\t\t\treturn firstPath [path.Count];\n\t\t\t\t}\n\t\t\t\t// We only have one path, and a statement in itself cannot be an identifier\n\t\t\t\t// so we're safe\n\t\t\t\treturn path [path.Count - 1];\n\t\t\t}\n\n\t\t\tstatic IEnumerable<IdentifierExpression> GetIdentifiers(IEnumerable<AstNode> candidates, string name = null)\n\t\t\t{\n\t\t\t\treturn \n\t\t\t\t\tfrom node in candidates\n\t\t\t\t\tlet identifier = node as IdentifierExpression\n\t\t\t\t\twhere identifier != null && (name == null || identifier.Identifier == name)\n\t\t\t\t\tselect identifier;\n\t\t\t}\n\n\t\t\tAstNode GetFirstInitializerChange(AstNode variableDeclarationStatement, IList<AstNode> path, Expression initializer)\n\t\t\t{\n\t\t\t\tvar identifiers = GetIdentifiers(initializer.DescendantsAndSelf).ToList();\n\t\t\t\tvar mayChangeInitializer = GetChecker (initializer, identifiers);\n\t\t\t\tAstNode lastChange = null;\n\t\t\t\tfor (int i = path.Count - 1; i >= 0; i--) {\n\t\t\t\t\tfor (AstNode node = path[i].PrevSibling; node != null && node != variableDeclarationStatement; node = node.PrevSibling) {\n\t\t\t\t\t\t// Special case for IfElseStatement: The AST nesting does not match the scope nesting, so\n\t\t\t\t\t\t// don't handle branches here: The correct one has already been checked anyway.\n\t\t\t\t\t\t// This also works to our advantage: No special checking is needed for the condition since\n\t\t\t\t\t\t// it is a the same level in the tree as the false branch\n\t\t\t\t\t\tif (node.Role == IfElseStatement.TrueRole || node.Role == IfElseStatement.FalseRole)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tforeach (var expression in node.DescendantsAndSelf.Where(n => n is Expression).Cast<Expression>()) {\n\t\t\t\t\t\t\tif (mayChangeInitializer(expression)) {\n\t\t\t\t\t\t\t\tlastChange = expression;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn lastChange;\n\t\t\t}\n\n\t\t\tFunc<Expression, bool> GetChecker(Expression expression, IList<IdentifierExpression> identifiers)\n\t\t\t{\n\t\t\t\t// TODO: This only works for simple cases.\n\t\t\t\tIList<IMember> members;\n\t\t\t\tIList<IVariable> locals;\n\t\t\t\tvar identifierResolveResults = identifiers.Select(identifier => context.Resolve(identifier)).ToList();\n\t\t\t\tSplitResolveResults(identifierResolveResults, out members, out locals);\n\t\t\t\t\n\t\t\t\tif (expression is InvocationExpression || expression is ObjectCreateExpression) {\n\t\t\t\t\treturn node => {\n\t\t\t\t\t\tif (node is InvocationExpression || node is ObjectCreateExpression)\n\t\t\t\t\t\t\t// We don't know what these might do, so assume it will change the initializer\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\tvar binaryOperator = node as BinaryOperatorExpression;\n\t\t\t\t\t\tif (binaryOperator != null) {\n\t\t\t\t\t\t\tvar resolveResult = context.Resolve(binaryOperator) as OperatorResolveResult;\n\t\t\t\t\t\t\tif (resolveResult == null)\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t// Built-in operators are ok, user defined ones not so much\n\t\t\t\t\t\t\treturn resolveResult.UserDefinedOperatorMethod != null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn IsConflictingAssignment(node, identifiers, members, locals);\n\t\t\t\t\t};\n\t\t\t\t} else if (expression is IdentifierExpression) {\n\t\t\t\t\tvar initializerDependsOnMembers = identifierResolveResults.Any(result => result is MemberResolveResult);\n\t\t\t\t\tvar initializerDependsOnReferenceType = identifierResolveResults.Any(result => result.Type.IsReferenceType == true);\n\t\t\t\t\treturn node => {\n\t\t\t\t\t\tif ((node is InvocationExpression || node is ObjectCreateExpression) &&\n\t\t\t\t\t\t    (initializerDependsOnMembers || initializerDependsOnReferenceType))\n\t\t\t\t\t\t\t// Anything can happen...\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\tvar binaryOperator = node as BinaryOperatorExpression;\n\t\t\t\t\t\tif (binaryOperator != null) {\n\t\t\t\t\t\t\tvar resolveResult = context.Resolve(binaryOperator) as OperatorResolveResult;\n\t\t\t\t\t\t\tif (resolveResult == null)\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\treturn resolveResult.UserDefinedOperatorMethod != null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn IsConflictingAssignment(node, identifiers, members, locals);\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn node => false;\n\t\t\t}\n\n\t\t\tbool IsConflictingAssignment (Expression node, IList<IdentifierExpression> identifiers, IList<IMember> members, IList<IVariable> locals)\n\t\t\t{\n\t\t\t\tvar assignmentExpression = node as AssignmentExpression;\n\t\t\t\tif (assignmentExpression != null) {\n\t\t\t\t\tIList<IMember> targetMembers;\n\t\t\t\t\tIList<IVariable> targetLocals;\n\t\t\t\t\tvar identifierResolveResults = identifiers.Select(identifier => context.Resolve(identifier)).ToList();\n\t\t\t\t\tSplitResolveResults(identifierResolveResults, out targetMembers, out targetLocals);\n\n\t\t\t\t\treturn members.Any(member => targetMembers.Contains(member)) ||\n\t\t\t\t\t\tlocals.Any(local => targetLocals.Contains(local));\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tstatic void SplitResolveResults(List<ResolveResult> identifierResolveResults, out IList<IMember> members, out IList<IVariable> locals)\n\t\t\t{\n\t\t\t\tmembers = new List<IMember>();\n\t\t\t\tlocals = new List<IVariable>();\n\t\t\t\tforeach (var resolveResult in identifierResolveResults) {\n\t\t\t\t\tvar memberResolveResult = resolveResult as MemberResolveResult;\n\t\t\t\t\tif (memberResolveResult != null) {\n\t\t\t\t\t\tmembers.Add(memberResolveResult.Member);\n\t\t\t\t\t}\n\t\t\t\t\tvar localResolveResult = resolveResult as LocalResolveResult;\n\t\t\t\t\tif (localResolveResult != null) {\n\t\t\t\t\t\tlocals.Add(localResolveResult.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool IsScopeContainer(AstNode node)\n\t\t\t{\n\t\t\t\tif (node == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar blockStatement = node as BlockStatement;\n\t\t\t\tif (blockStatement != null)\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar statement = node as Statement;\n\t\t\t\tif (statement == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar role = node.Role;\n\t\t\t\tif (role == Roles.EmbeddedStatement ||\n\t\t\t\t\trole == IfElseStatement.TrueRole ||\n\t\t\t\t\trole == IfElseStatement.FalseRole) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tIEnumerable<CodeAction> GetActions(Statement oldStatement, Statement followingStatement)\n\t\t\t{\n\t\t\t\tyield return new CodeAction(context.TranslateString(\"Move to nested scope\"), script => {\n\t\t\t\t\tvar parent = followingStatement.Parent;\n\t\t\t\t\tif (parent is SwitchSection || parent is BlockStatement) {\n\t\t\t\t\t\tscript.InsertBefore(followingStatement, oldStatement.Clone());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar newBlockStatement = new BlockStatement {\n\t\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\t\toldStatement.Clone(),\n\t\t\t\t\t\t\t\tfollowingStatement.Clone()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tscript.Replace(followingStatement, newBlockStatement);\n\t\t\t\t\t\tscript.FormatText(parent);\n\t\t\t\t\t}\n\t\t\t\t\tscript.Remove(oldStatement);\n\t\t\t\t}, oldStatement);\n\t\t\t}\n\n\t\t\tAstNode GetDeepestCommonAncestor(AstNode assumedRoot, IEnumerable<AstNode> leaves)\n\t\t\t{\n\t\t\t\tvar previousPath = GetPath(assumedRoot, leaves.First());\n\t\t\t\tint lowestIndex = previousPath.Count - 1;\n\t\t\t\tforeach (var leaf in leaves.Skip(1)) {\n\t\t\t\t\tvar currentPath = GetPath(assumedRoot, leaf);\n\t\t\t\t\tlowestIndex = GetLowestCommonAncestorIndex(previousPath, currentPath, lowestIndex);\n\t\t\t\t\tpreviousPath = currentPath;\n\t\t\t\t}\n\t\t\t\treturn previousPath [lowestIndex];\n\t\t\t}\n\t\t\t\n\t\t\tint GetLowestCommonAncestorIndex(IList<AstNode> path1, IList<AstNode> path2, int maxIndex = int.MaxValue)\n\t\t\t{\n\t\t\t\tvar max = Math.Min(Math.Min(path1.Count, path2.Count), maxIndex);\n\t\t\t\tfor (int i = 0; i <= max; i++) {\n\t\t\t\t\tif (path1 [i] != path2 [i])\n\t\t\t\t\t\treturn i - 1;\n\t\t\t\t}\n\t\t\t\treturn max;\n\t\t\t}\n\n\t\t\tIList<AstNode> GetPath(AstNode from, AstNode to)\n\t\t\t{\n\t\t\t\tvar reversePath = new List<AstNode>();\n\t\t\t\tdo {\n\t\t\t\t\treversePath.Add(to);\n\t\t\t\t\tto = to.Parent;\n\t\t\t\t} while (to != from.Parent);\n\t\t\t\treversePath.Reverse();\n\t\t\t\treturn reversePath;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/RefactoringExtensions.cs",
    "content": "//\n// RefactoringExtensions.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2013 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tstatic class RefactoringExtensions\n\t{\n\t\t/// <summary>\n\t\t/// Gets the local variable declaration space, as defined by §3.3 Declarations.\n\t\t/// </summary>\n\t\t/// <returns>The local variable declaration space.</returns>\n\t\tpublic static AstNode GetLocalVariableDeclarationSpace (this AstNode self)\n\t\t{\n\t\t\tvar node = self.Parent;\n\t\t\twhile (node != null && !CreatesLocalVariableDeclarationSpace(node))\n\t\t\t\tnode = node.Parent;\n\t\t\treturn node;\n\t\t}\n\t\t\n\t\tstatic ISet<Type> localVariableDeclarationSpaceCreators = new HashSet<Type> () {\n\t\t\ttypeof(BlockStatement),\n\t\t\ttypeof(SwitchStatement),\n\t\t\ttypeof(ForeachStatement),\n\t\t\ttypeof(ForStatement),\n\t\t\ttypeof(UsingStatement),\n\t\t\ttypeof(LambdaExpression),\n\t\t\ttypeof(AnonymousMethodExpression)\n\t\t};\n\n\t\tstatic bool CreatesLocalVariableDeclarationSpace(AstNode node)\n\t\t{\n\t\t\treturn localVariableDeclarationSpaceCreators.Contains(node.GetType());\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/BaseMethodCallWithDefaultParameterIssue.cs",
    "content": "//\n// BaseMethodCallWithDefaultParameterIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[IssueDescription(\"Call to base member with implicit default parameters\",\n\t                  Description=\"Call to base member with implicit default parameters\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"BaseMethodCallWithDefaultParameter\")]\n\tpublic class BaseMethodCallWithDefaultParameterIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<BaseMethodCallWithDefaultParameterIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tvar mr = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (mr == null || !(mr.Target is BaseReferenceExpression))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar invocationRR = ctx.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (invocationRR == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar parentEntity = invocationExpression.GetParent<EntityDeclaration>();\n\t\t\t\tif (parentEntity == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(parentEntity) as MemberResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (invocationExpression.Arguments.Count >= invocationRR.Member.Parameters.Count ||\n\t\t\t\t\tinvocationRR.Member.Parameters.Count == 0 || \n\t\t\t\t    !invocationRR.Member.Parameters.Last().IsOptional)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!InheritanceHelper.GetBaseMembers(rr.Member, false).Any(m => m == invocationRR.Member))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression.RParToken,\n\t\t\t\t\tctx.TranslateString(\"Call to base member with implicit default parameters\")\n\t\t\t\t));\n\t\t\t}\n\t\t\n\t\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIndexerExpression(indexerExpression);\n\t\t\t\tif (!(indexerExpression.Target is BaseReferenceExpression))\n\t\t\t\t\treturn;\n\t\t\t\tvar invocationRR = ctx.Resolve(indexerExpression) as InvocationResolveResult;\n\t\t\t\tif (invocationRR == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar parentEntity = indexerExpression.GetParent<IndexerDeclaration>();\n\t\t\t\tif (parentEntity == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(parentEntity) as MemberResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (indexerExpression.Arguments.Count >= invocationRR.Member.Parameters.Count ||\n\t\t\t\t    invocationRR.Member.Parameters.Count == 0 || \n\t\t\t\t    !invocationRR.Member.Parameters.Last().IsOptional)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!InheritanceHelper.GetBaseMembers(rr.Member, false).Any(m => m == invocationRR.Member))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tindexerExpression.RBracketToken,\n\t\t\t\t\tctx.TranslateString(\"Call to base member with implicit default parameters\")\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/BitwiseOperatorOnEnumWithoutFlagsIssue.cs",
    "content": "﻿// \n// BitwiseOperationOnNonFlagsEnumIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Bitwise operation on enum which has no [Flags] attribute\",\n\t                   Description = \"Bitwise operation on enum which has no [Flags] attribute\",\n\t\t\t\t\t   Category = IssueCategories.CodeQualityIssues,\n\t\t\t\t\t   Severity = Severity.Warning,\n                       AnalysisDisableKeyword = \"BitwiseOperatorOnEnumWithoutFlags\")]\n\tpublic class BitwiseOperatorOnEnumWithoutFlagsIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<BitwiseOperatorOnEnumWithoutFlagsIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tstatic bool IsBitwiseOperator (UnaryOperatorType op)\n\t\t\t{\n\t\t\t\treturn op == UnaryOperatorType.BitNot;\n\t\t\t}\n\n\t\t\tstatic bool IsBitwiseOperator (AssignmentOperatorType op)\n\t\t\t{\n\t\t\t\treturn op == AssignmentOperatorType.BitwiseAnd || op == AssignmentOperatorType.BitwiseOr ||\n\t\t\t\t\top == AssignmentOperatorType.ExclusiveOr;\n\t\t\t}\n\n\t\t\tstatic bool IsBitwiseOperator (BinaryOperatorType op)\n\t\t\t{\n\t\t\t\treturn op == BinaryOperatorType.BitwiseAnd || op == BinaryOperatorType.BitwiseOr || \n\t\t\t\t\top == BinaryOperatorType.ExclusiveOr;\n\t\t\t}\n\n\t\t\tbool IsNonFlagsEnum (Expression expr)\n\t\t\t{\n\t\t\t\tvar resolveResult = ctx.Resolve (expr);\n\t\t\t\tif (resolveResult == null || resolveResult.Type.Kind != TypeKind.Enum)\n\t\t\t\t\treturn false;\n\n\t\t\t\t// check [Flags]\n\t\t\t\tvar typeDef = resolveResult.Type.GetDefinition ();\n\t\t\t\treturn typeDef != null &&\n\t\t\t\t\ttypeDef.Attributes.All (attr => attr.AttributeType.FullName != \"System.FlagsAttribute\");\n\t\t\t}\n\n\t\t\tprivate void AddIssue (CSharpTokenNode operatorToken)\n\t\t\t{\n\t\t\t\tAddIssue (new CodeIssue (operatorToken, ctx.TranslateString (\"Bitwise Operations on enum not marked with Flags attribute\")));\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitUnaryOperatorExpression (unaryOperatorExpression);\n\n\t\t\t\tif (!IsBitwiseOperator (unaryOperatorExpression.Operator))\n\t\t\t\t\treturn;\n\t\t\t\tif (IsNonFlagsEnum (unaryOperatorExpression.Expression))\n\t\t\t\t\tAddIssue (unaryOperatorExpression.OperatorToken);\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression (AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression (assignmentExpression);\n\n\t\t\t\tif (!IsBitwiseOperator (assignmentExpression.Operator))\n\t\t\t\t\treturn;\n\t\t\t\tif (IsNonFlagsEnum (assignmentExpression.Right))\n\t\t\t\t\tAddIssue (assignmentExpression.OperatorToken);\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression (binaryOperatorExpression);\n\n\t\t\t\tif (!IsBitwiseOperator (binaryOperatorExpression.Operator))\n\t\t\t\t\treturn;\n\t\t\t\tif (IsNonFlagsEnum (binaryOperatorExpression.Left) || IsNonFlagsEnum (binaryOperatorExpression.Right))\n\t\t\t\t\tAddIssue (binaryOperatorExpression.OperatorToken);\n\t\t\t}\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/CanBeReplacedWithTryCastAndCheckForNullIssue.cs",
    "content": "//\n// CanBeReplacedWithTryCastAndCheckForNullIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Type check and casts can be replaced with 'as' and null check\",\n\t                  Description=\"Type check and casts can be replaced with 'as' and null check\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"CanBeReplacedWithTryCastAndCheckForNull\")]\n\tpublic class CanBeReplacedWithTryCastAndCheckForNullIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CanBeReplacedWithTryCastAndCheckForNullIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\n\t\t\t\tIsExpression isExpression;\n\t\t\t\tint foundCastCount;\n\t\t\t\tif (UseAsAndNullCheckAction.ScanIfElse(ctx, ifElseStatement, out isExpression, out foundCastCount) == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (foundCastCount == 0)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tisExpression.IsToken,\n\t\t\t\t\tctx.TranslateString(\"Type check and casts can be replaced with 'as' and null check\")\n\t\t\t\t) { ActionProvider = { typeof(UseAsAndNullCheckAction) } } );\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/CompareNonConstrainedGenericWithNullIssue.cs",
    "content": "//\n// CompareNonConstrainedGenericWithNullIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\n\t\t\"Possible compare of value type with 'null'\",\n\t\tDescription = \"Possible compare of value type with 'null'\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"CompareNonConstrainedGenericWithNull\")]\n\tpublic class CompareNonConstrainedGenericWithNullIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CompareNonConstrainedGenericWithNullIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode pattern = new Choice {\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"node\"), BinaryOperatorType.Equality, new NullReferenceExpression ()),\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"node\"), BinaryOperatorType.InEquality, new NullReferenceExpression ())\n\t\t\t};\n\n\t\t\tvoid CheckCase(IType type, BinaryOperatorExpression binaryOperatorExpression, Expression expr)\n\t\t\t{\n\t\t\t\tif (type.Kind != TypeKind.TypeParameter || type.IsReferenceType == true)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tbinaryOperatorExpression,\n\t\t\t\t\tctx.TranslateString(\"Possible compare of value type with 'null'\"),\n\t\t\t\t\tctx.TranslateString(\"Replace with 'default'\"),\n\t\t\t\t\ts => {\n\t\t\t\t\t\tvar builder = ctx.CreateTypeSystemAstBuilder(binaryOperatorExpression);\n\t\t\t\t\t\ts.Replace(binaryOperatorExpression, \n\t\t\t\t\t\t\tnew BinaryOperatorExpression(expr.Clone(), \n\t\t\t\t\t\t\t\tbinaryOperatorExpression.Operator,\n\t\t\t\t\t\t\t\tnew DefaultValueExpression(builder.ConvertType(type))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t); \n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tvar match = pattern.Match(binaryOperatorExpression);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar expr = match.Get<Expression>(\"node\").SingleOrDefault();\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(expr);\n\n\t\t\t\tvar lr = rr as LocalResolveResult;\n\t\t\t\tif (lr != null)\n\t\t\t\t\tCheckCase (lr.Variable.Type, binaryOperatorExpression, expr);\n\t\t\t\tvar mr = rr as MemberResolveResult;\n\t\t\t\tif (mr != null)\n\t\t\t\t\tCheckCase (mr.Member.ReturnType, binaryOperatorExpression, expr);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/CompareOfFloatsByEqualityOperatorIssue.cs",
    "content": "﻿// \n// CompareFloatWithEqualityOperatorIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Compare floating point numbers with equality operator\",\n\t\t\t\t\t   Description = \"Comparison of floating point numbers with equality operator.\",\n\t\t\t\t\t   Category = IssueCategories.CodeQualityIssues,\n\t\t\t\t\t   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"CompareOfFloatsByEqualityOperator\")]\n\tpublic class CompareOfFloatsByEqualityOperatorIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CompareOfFloatsByEqualityOperatorIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic bool IsFloatingPointType (IType type)\n\t\t\t{\n\t\t\t\tvar typeDef = type.GetDefinition ();\n\t\t\t\treturn typeDef != null &&\n\t\t\t\t\t(typeDef.KnownTypeCode == KnownTypeCode.Single || typeDef.KnownTypeCode == KnownTypeCode.Double);\n\t\t\t}\n\n\t\t\tbool IsFloatingPoint(AstNode node)\n\t\t\t{\n\t\t\t\treturn IsFloatingPointType (ctx.Resolve (node).Type);\n\t\t\t}\n\n\t\t\tbool IsConstantInfinity(AstNode node)\n\t\t\t{\n\t\t\t\tResolveResult rr = ctx.Resolve(node);\n\t\t\t\tif (!rr.IsCompileTimeConstant)\n\t\t\t\t\treturn false;\n\t\t\t\tif (rr.ConstantValue is float)\n\t\t\t\t\treturn float.IsInfinity((float)rr.ConstantValue);\n\t\t\t\tif (rr.ConstantValue is double)\n\t\t\t\t\treturn double.IsInfinity((double)rr.ConstantValue);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tstring GetFloatType(Expression left, Expression right)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve (left);\n\t\t\t\tif (rr.IsCompileTimeConstant)\n\t\t\t\t\treturn rr.ConstantValue is float ? \"float\" : \"double\";\n\t\t\t\t\n\t\t\t\trr = ctx.Resolve (right);\n\t\t\t\tif (rr.IsCompileTimeConstant)\n\t\t\t\t\treturn rr.ConstantValue is float ? \"float\" : \"double\";\n\t\t\t\treturn \"double\";\n\t\t\t}\n\n\t\t\tbool IsNaN (AstNode node)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve (node);\n\t\t\t\tif (!rr.IsCompileTimeConstant)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn rr.ConstantValue is double && double.IsNaN((double)rr.ConstantValue) || \n\t\t\t\t\t   rr.ConstantValue is float && float.IsNaN((float)rr.ConstantValue);\n\t\t\t}\n\n\t\t\tstatic bool IsZero (AstNode node)\n\t\t\t{\n\t\t\t\tvar pe = node as PrimitiveExpression;\n\t\t\t\tif (pe == null)\n\t\t\t\t\treturn false;\n\t\t\t\tif (pe.Value is char || pe.Value is string || pe.Value is bool)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (pe.Value is double && (double)pe.Value == 0d || \n\t\t\t\t\tpe.Value is float && (float)pe.Value == 0f || \n\t\t\t\t\tpe.Value is decimal && (decimal)pe.Value == 0m)\n\t\t\t\t\treturn true;\n\n\t\t\t\treturn !pe.LiteralValue.Any(c => char.IsDigit(c) && c != '0');\n\t\t\t}\n\n\t\t\tbool IsNegativeInfinity (AstNode node)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve (node);\n\t\t\t\tif (!rr.IsCompileTimeConstant)\n\t\t\t\t\treturn false;\n\t\t\t\treturn rr.ConstantValue is double && double.IsNegativeInfinity((double)rr.ConstantValue) ||\n\t\t\t\t\t   rr.ConstantValue is float && float.IsNegativeInfinity((float)rr.ConstantValue);\n\t\t\t}\n\n\t\t\tbool IsPositiveInfinity (AstNode node)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve (node);\n\t\t\t\tif (!rr.IsCompileTimeConstant)\n\t\t\t\t\treturn false;\n\n\t\t\t\treturn rr.ConstantValue is double && double.IsPositiveInfinity ((double)rr.ConstantValue) ||\n\t\t\t\t\trr.ConstantValue is float && float.IsPositiveInfinity((float)rr.ConstantValue);\n\t\t\t}\n\n\t\t\tvoid AddIsNaNIssue(BinaryOperatorExpression binaryOperatorExpression, Expression argExpr, string floatType)\n\t\t\t{\n\t\t\t\tif (!ctx.Resolve(argExpr).Type.IsKnownType(KnownTypeCode.Single))\n\t\t\t\t\tfloatType = \"double\";\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tbinaryOperatorExpression, \n\t\t\t\t\tctx.TranslateString (\"NaN doesn't equal to any floating point number including to itself. Use 'IsNaN' instead.\"),\n\t\t\t\t\tbinaryOperatorExpression.Operator == BinaryOperatorType.InEquality ? \n\t\t\t\t\t\tstring.Format(ctx.TranslateString (\"Replace with '!{0}.IsNaN(...)' call\"), floatType) :\n\t\t\t\t\t\tstring.Format(ctx.TranslateString (\"Replace with '{0}.IsNaN(...)' call\"), floatType),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tExpression expr = new PrimitiveType(floatType).Invoke(\"IsNaN\", argExpr.Clone());\n\t\t\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.InEquality)\n\t\t\t\t\t\t\texpr = new UnaryOperatorExpression (UnaryOperatorType.Not, expr);\n\t\t\t\t\t\tscript.Replace (binaryOperatorExpression, expr);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tvoid AddIsNegativeInfinityIssue(BinaryOperatorExpression binaryOperatorExpression, Expression argExpr, string floatType)\n\t\t\t{\n\t\t\t\tif (!ctx.Resolve(argExpr).Type.IsKnownType(KnownTypeCode.Single))\n\t\t\t\t\tfloatType = \"double\";\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tbinaryOperatorExpression, \n\t\t\t\t\tctx.TranslateString (\"Comparison of floating point numbers with equality operator. Use 'IsNegativeInfinity' method.\"),\n\t\t\t\t\tbinaryOperatorExpression.Operator == BinaryOperatorType.InEquality ? \n\t\t\t\t\tstring.Format(ctx.TranslateString (\"Replace with '!{0}.IsNegativeInfinity(...)' call\"), floatType) :\n\t\t\t\t\tstring.Format(ctx.TranslateString (\"Replace with '{0}.IsNegativeInfinity(...)' call\"), floatType),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tExpression expr = new PrimitiveType(floatType).Invoke(\"IsNegativeInfinity\", argExpr.Clone());\n\t\t\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.InEquality)\n\t\t\t\t\t\t\texpr = new UnaryOperatorExpression (UnaryOperatorType.Not, expr);\n\t\t\t\t\t\tscript.Replace (binaryOperatorExpression, expr);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tvoid AddIsPositiveInfinityIssue(BinaryOperatorExpression binaryOperatorExpression, Expression argExpr, string floatType)\n\t\t\t{\n\t\t\t\tif (!ctx.Resolve(argExpr).Type.IsKnownType(KnownTypeCode.Single))\n\t\t\t\t\tfloatType = \"double\";\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tbinaryOperatorExpression, \n\t\t\t\t\tctx.TranslateString (\"Comparison of floating point numbers with equality operator. Use 'IsPositiveInfinity' method.\"),\n\t\t\t\t\tbinaryOperatorExpression.Operator == BinaryOperatorType.InEquality ? \n\t\t\t\t\tstring.Format(ctx.TranslateString (\"Replace with '!{0}.IsPositiveInfinity(...)' call\"), floatType) :\n\t\t\t\t\tstring.Format(ctx.TranslateString (\"Replace with '{0}.IsPositiveInfinity(...)' call\"), floatType),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tExpression expr = new PrimitiveType(floatType).Invoke(\"IsPositiveInfinity\", argExpr.Clone());\n\t\t\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.InEquality)\n\t\t\t\t\t\t\texpr = new UnaryOperatorExpression (UnaryOperatorType.Not, expr);\n\t\t\t\t\t\tscript.Replace (binaryOperatorExpression, expr);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tvoid AddIsZeroIssue(BinaryOperatorExpression binaryOperatorExpression, Expression argExpr)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tbinaryOperatorExpression, \n\t\t\t\t\tctx.TranslateString (\"Comparison of floating point numbers can be unequal due to the differing precision of the two values.\"),\n\t\t\t\t\tctx.TranslateString (\"Fix floating point number comparing. Compare a difference with epsilon.\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar builder = ctx.CreateTypeSystemAstBuilder(binaryOperatorExpression);\n\t\t\t\t\tvar diff = argExpr.Clone();\n\t\t\t\t\t\tvar abs = builder.ConvertType(new TopLevelTypeName(\"System\", \"Math\")).Invoke(\"Abs\", diff);\n\t\t\t\t\t\tvar op = binaryOperatorExpression.Operator == BinaryOperatorType.Equality ? BinaryOperatorType.LessThan : BinaryOperatorType.GreaterThan;\n\t\t\t\t\t\tvar epsilon = new IdentifierExpression (\"EPSILON\");\n\t\t\t\t\t\tvar compare = new BinaryOperatorExpression (abs, op, epsilon);\n\t\t\t\t\t\tscript.Replace (binaryOperatorExpression, compare);\n\t\t\t\t\t\tscript.Select (epsilon);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression (binaryOperatorExpression);\n\n\t\t\t\tif (binaryOperatorExpression.Operator != BinaryOperatorType.Equality &&\n\t\t\t\t\tbinaryOperatorExpression.Operator != BinaryOperatorType.InEquality)\n\t\t\t\t\treturn;\n\n\t\t\t\tstring floatType = GetFloatType (binaryOperatorExpression.Left, binaryOperatorExpression.Right);\n\n\n\t\t\t\tif (IsNaN(binaryOperatorExpression.Left)) {\n\t\t\t\t\tAddIsNaNIssue (binaryOperatorExpression, binaryOperatorExpression.Right, floatType);\n\t\t\t\t} else if (IsNaN (binaryOperatorExpression.Right)) {\n\t\t\t\t\tAddIsNaNIssue (binaryOperatorExpression, binaryOperatorExpression.Left, floatType);\n\t\t\t\t} else if (IsPositiveInfinity(binaryOperatorExpression.Left)) {\n\t\t\t\t\tAddIsPositiveInfinityIssue (binaryOperatorExpression, binaryOperatorExpression.Right, floatType);\n\t\t\t\t} else if (IsPositiveInfinity (binaryOperatorExpression.Right)) {\n\t\t\t\t\tAddIsPositiveInfinityIssue (binaryOperatorExpression, binaryOperatorExpression.Left, floatType);\n\t\t\t\t} else if (IsNegativeInfinity (binaryOperatorExpression.Left)) {\n\t\t\t\t\tAddIsNegativeInfinityIssue (binaryOperatorExpression, binaryOperatorExpression.Right, floatType);\n\t\t\t\t} else if (IsNegativeInfinity (binaryOperatorExpression.Right)) {\n\t\t\t\t\tAddIsNegativeInfinityIssue (binaryOperatorExpression, binaryOperatorExpression.Left, floatType);\n\t\t\t\t} else if (IsFloatingPoint(binaryOperatorExpression.Left) || IsFloatingPoint(binaryOperatorExpression.Right)) {\n\t\t\t\t\tif (IsConstantInfinity(binaryOperatorExpression.Left) || IsConstantInfinity(binaryOperatorExpression.Right))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (IsZero(binaryOperatorExpression.Left)) {\n\t\t\t\t\t\tAddIsZeroIssue(binaryOperatorExpression, binaryOperatorExpression.Right);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (IsZero(binaryOperatorExpression.Right)) {\n\t\t\t\t\t\tAddIsZeroIssue(binaryOperatorExpression, binaryOperatorExpression.Left);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tbinaryOperatorExpression, \n\t\t\t\t\t\tctx.TranslateString(\"Comparison of floating point numbers can be unequal due to the differing precision of the two values.\"),\n\t\t\t\t\t\tctx.TranslateString(\"Fix floating point number comparing. Compare a difference with epsilon.\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t// Math.Abs(diff) op EPSILON\n\t\t\t\t\t\t\tvar builder = ctx.CreateTypeSystemAstBuilder(binaryOperatorExpression);\n\t\t\t\t\t\t\tvar diff = new BinaryOperatorExpression(binaryOperatorExpression.Left.Clone(),\n\t\t\t\t\t\t\t                                         BinaryOperatorType.Subtract, binaryOperatorExpression.Right.Clone());\n\t\t\t\t\t\t\tvar abs = builder.ConvertType(new TopLevelTypeName(\"System\", \"Math\")).Invoke(\"Abs\", diff);\n\t\t\t\t\t\t\tvar op = binaryOperatorExpression.Operator == BinaryOperatorType.Equality ?\n\t\t\t\t\t\t\t\tBinaryOperatorType.LessThan : BinaryOperatorType.GreaterThan;\n\t\t\t\t\t\t\tvar epsilon = new IdentifierExpression(\"EPSILON\");\n\t\t\t\t\t\t\tvar compare = new BinaryOperatorExpression(abs, op, epsilon);\n\t\t\t\t\t\t\tscript.Replace(binaryOperatorExpression, compare);\n\t\t\t\t\t\t\tscript.Select(epsilon);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/ConditionalTernaryEqualBranchIssue.cs",
    "content": "﻿// \n// ConditionalTernaryEqualBranchIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\n\t[IssueDescription (\"'?:' expression has identical true and false branches\",\n\t\t\t\t\t   Description = \"'?:' expression has identical true and false branches.\",\n\t\t\t\t\t   Category = IssueCategories.CodeQualityIssues,\n\t\t\t\t\t   Severity = Severity.Warning,\n                       AnalysisDisableKeyword = \"ConditionalTernaryEqualBranch\")]\n    public class ConditionalTernaryEqualBranchIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n        class GatherVisitor : GatherVisitorBase<ConditionalTernaryEqualBranchIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConditionalExpression (ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tbase.VisitConditionalExpression (conditionalExpression);\n\n\t\t\t\tif (!conditionalExpression.TrueExpression.Match (conditionalExpression.FalseExpression).Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar action = new CodeAction (ctx.TranslateString (\"Replace '?:' with branch\"),\n\t\t\t\t\tscript => script.Replace (conditionalExpression, conditionalExpression.TrueExpression.Clone ()), conditionalExpression.QuestionMarkToken);\n\t\t\t\tAddIssue (new CodeIssue(conditionalExpression, \n\t\t\t\t\tctx.TranslateString (\"'?:' expression has identical true and false branches\"), new [] { action }));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/DelegateSubtractionIssue.cs",
    "content": "//\n// DelegateSubtractionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Delegate subtractions\",\n\t\tDescription = \"Delegate subtraction has unpredictable result\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"DelegateSubtraction\")]\n\tpublic class DelegateSubtractionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<DelegateSubtractionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tif (binaryOperatorExpression.Operator != BinaryOperatorType.Subtract)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(binaryOperatorExpression.Right);\n\t\t\t\tif (rr.Type.Kind == ICSharpCode.NRefactory.TypeSystem.TypeKind.Delegate && !IsEvent (binaryOperatorExpression.Left)) {\n\t\t\t\t\tAddIssue(new CodeIssue(binaryOperatorExpression, ctx.TranslateString(\"Delegate subtraction has unpredictable result\")));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool IsEvent(AstNode node)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(node) as MemberResolveResult;\n\t\t\t\treturn rr != null && rr.Member.SymbolKind == ICSharpCode.NRefactory.TypeSystem.SymbolKind.Event;\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t\t\tif (assignmentExpression.Operator != AssignmentOperatorType.Subtract)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(assignmentExpression.Right);\n\t\t\t\tif (rr.Type.Kind == ICSharpCode.NRefactory.TypeSystem.TypeKind.Delegate && !IsEvent (assignmentExpression.Left))\n\t\t\t\t\tAddIssue(new CodeIssue(assignmentExpression, ctx.TranslateString(\"Delegate subtraction has unpredictable result\")));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/DoNotCallOverridableMethodsInConstructorIssue.cs",
    "content": "//\n// DoNotCallOverridableMethodsInConstructorIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Virtual member call in constructor\",\n\t                  Description = \"Warns about calls to virtual member functions occuring in the constructor.\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"DoNotCallOverridableMethodsInConstructor\")]\n\tpublic class DoNotCallOverridableMethodsInConstructorIssue : CodeIssueProvider\n\t{\n\t\tpublic override IEnumerable<CodeIssue> GetIssues(BaseRefactoringContext context, string subIssue)\n\t\t{\n\t\t\tvar gv = new GatherVisitor(context);\n\t\t\tcontext.RootNode.AcceptVisitor(gv);\n\t\t\treturn gv.CallFinder.FoundIssues;\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<DoNotCallOverridableMethodsInConstructorIssue>\n\t\t{\n\t\t\tinternal readonly VirtualCallFinderVisitor CallFinder;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t\tCallFinder = new VirtualCallFinderVisitor(context);\n\t\t\t}\n\n\t\t\tbool isSealedType;\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration.ClassType != ClassType.Class && typeDeclaration.ClassType != ClassType.Struct)\n\t\t\t\t\treturn;\n\t\t\t\tbool oldIsSealedType = isSealedType;\n\t\t\t\tisSealedType = typeDeclaration.Modifiers.HasFlag(Modifiers.Sealed);\n\t\t\t\tCallFinder.CurrentType = typeDeclaration;\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tisSealedType = oldIsSealedType;\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tif (isSealedType)\n\t\t\t\t\treturn;\n\t\t\t\tvar body = constructorDeclaration.Body;\n\t\t\t\tif (body == null || body.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tbody.AcceptVisitor(CallFinder);\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\t\t}\n\n\t\tclass VirtualCallFinderVisitor: GatherVisitorBase<DoNotCallOverridableMethodsInConstructorIssue>\n\t\t{\n\t\t\treadonly BaseRefactoringContext context;\n\t\t\tpublic TypeDeclaration CurrentType;\n\t\t\tpublic VirtualCallFinderVisitor(BaseRefactoringContext context) : base(context)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t\t\tvar targetMember = context.Resolve(memberReferenceExpression) as MemberResolveResult;\n\t\t\t\tif (targetMember != null && targetMember.IsVirtualCall && targetMember.TargetResult is ThisResolveResult) {\n\t\t\t\t\tCreateIssue(memberReferenceExpression);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tvar targetMethod = context.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (targetMethod != null && targetMethod.IsVirtualCall && targetMethod.TargetResult is ThisResolveResult) {\n\t\t\t\t\tCreateIssue(invocationExpression);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CreateIssue(AstNode node)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.TranslateString(\"Virtual member call in constructor\"),\n\t\t\t\t\tnew CodeAction(string.Format(context.TranslateString(\"Make class '{0}' sealed\"), CurrentType.Name),\n\t\t\t\t\t               script => script.ChangeModifier(CurrentType, CurrentType.Modifiers | Modifiers.Sealed),\n\t\t\t\t\t               node)));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\t// ignore lambdas\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\t// ignore anonymous methods\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/EmptyGeneralCatchClauseIssue.cs",
    "content": "//\n// EmptyGeneralCatchClauseIssue.cs\n//\n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n//\n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// A catch clause that catches System.Exception and has an empty body\n\t/// </summary>\n\t[IssueDescription(\"Empty general catch clause\",\n\t                  Description= \"A catch clause that catches System.Exception and has an empty body\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"EmptyGeneralCatchClause\")]\n\tpublic class EmptyGeneralCatchClauseIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<EmptyGeneralCatchClauseIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, EmptyGeneralCatchClauseIssue issueProvider) : base (ctx, issueProvider)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitCatchClause(CatchClause catchClause)\n\t\t\t{\n\t\t\t\tbase.VisitCatchClause(catchClause);\n\n\t\t\t\tAstType type = catchClause.Type;\n\t\t\t\tif (!type.IsNull) {\n\t\t\t\t\tvar resolvedType = ctx.Resolve(type);\n\n\t\t\t\t\tif (resolvedType.IsError ||\n\t\t\t\t\t\t!resolvedType.Type.Namespace.Equals(\"System\") || !resolvedType.Type.Name.Equals(\"Exception\"))\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar body = catchClause.Body;\n\t\t\t\tif (body.Statements.Any())\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(catchClause.CatchToken, ctx.TranslateString(\"Empty general catch clause suppresses any error\")));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/EqualExpressionComparisonIssue.cs",
    "content": "//\n// EqualExpressionComparisonIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Equal expression comparison\",\n\t                  Description=\"Comparing equal expression for equality is usually useless\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"EqualExpressionComparison\")]\n\tpublic class EqualExpressionComparisonIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<EqualExpressionComparisonIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid AddIssue(AstNode nodeToReplace, AstNode highlightNode, bool replaceWithTrue)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\thighlightNode, \n\t\t\t\t\tctx.TranslateString(\"Equal expression comparison\"), \n\t\t\t\t\treplaceWithTrue ? ctx.TranslateString(\"Replace with 'true'\") : ctx.TranslateString(\"Replace with 'false'\"), \n\t\t\t\t\tscript =>  {\n\t\t\t\t\t\tscript.Replace(nodeToReplace, new PrimitiveExpression(replaceWithTrue));\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\n\t\t\treadonly BinaryOperatorExpression pattern = \n\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\tPatternHelper.OptionalParentheses(new AnyNode(\"expression\")), \n\t\t\t\t\tBinaryOperatorType.Any, \n\t\t\t\t\tPatternHelper.OptionalParentheses(new Backreference(\"expression\"))\n\t\t\t\t);\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\n\t\t\t\tif (binaryOperatorExpression.Operator != BinaryOperatorType.Equality &&\n\t\t\t\t    binaryOperatorExpression.Operator != BinaryOperatorType.InEquality &&\n\t\t\t\t    binaryOperatorExpression.Operator != BinaryOperatorType.GreaterThan &&\n\t\t\t\t    binaryOperatorExpression.Operator != BinaryOperatorType.GreaterThanOrEqual &&\n\t\t\t\t    binaryOperatorExpression.Operator != BinaryOperatorType.LessThan &&\n\t\t\t\t    binaryOperatorExpression.Operator != BinaryOperatorType.LessThanOrEqual) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar match = pattern.Match(binaryOperatorExpression);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tAddIssue(binaryOperatorExpression, binaryOperatorExpression.OperatorToken, binaryOperatorExpression.Operator == BinaryOperatorType.Equality);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (rr == null || rr.Member.Name != \"Equals\" || !rr.Member.ReturnType.IsKnownType(KnownTypeCode.Boolean))\n\t\t\t\t\treturn;\n\n\t\t\t\tif (rr.Member.IsStatic) {\n\t\t\t\t\tif (rr.Member.Parameters.Count != 2)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (CSharpUtil.AreConditionsEqual(invocationExpression.Arguments.FirstOrDefault(), invocationExpression.Arguments.Last())) {\n\t\t\t\t\t\tif ((invocationExpression.Parent is UnaryOperatorExpression) && ((UnaryOperatorExpression)invocationExpression.Parent).Operator == UnaryOperatorType.Not) {\n\t\t\t\t\t\t\tAddIssue(invocationExpression.Parent, invocationExpression.Parent, false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tAddIssue(invocationExpression, invocationExpression, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (rr.Member.Parameters.Count != 1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar target = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\t\tif (target == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (CSharpUtil.AreConditionsEqual(invocationExpression.Arguments.FirstOrDefault(), target.Target)) {\n\t\t\t\t\t\tif ((invocationExpression.Parent is UnaryOperatorExpression) && ((UnaryOperatorExpression)invocationExpression.Parent).Operator == UnaryOperatorType.Not) {\n\t\t\t\t\t\t\tAddIssue(invocationExpression.Parent, invocationExpression.Parent, false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tAddIssue(invocationExpression, invocationExpression, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/EventUnsubscriptionViaAnonymousDelegateIssue.cs",
    "content": "//\n// EventUnsubscriptionViaAnonymousDelegateIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Event unsubscription via anonymous delegate\",\n\t                  Description=\"Event unsubscription via anonymous delegate is useless\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"EventUnsubscriptionViaAnonymousDelegate\")]\n\tpublic class EventUnsubscriptionViaAnonymousDelegateIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<EventUnsubscriptionViaAnonymousDelegateIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t\t\tif (assignmentExpression.Operator != AssignmentOperatorType.Subtract)\n\t\t\t\t\treturn;\n\t\t\t\tif (!(assignmentExpression.Right is AnonymousMethodExpression || assignmentExpression.Right is LambdaExpression))\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(assignmentExpression.Left) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.Member.SymbolKind != ICSharpCode.NRefactory.TypeSystem.SymbolKind.Event)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tassignmentExpression.OperatorToken,\n\t\t\t\t\tctx.TranslateString(\"Event unsubscription via anonymous delegate is useless\")\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/ForControlVariableIsNeverModifiedIssue.cs",
    "content": "﻿// \n// ForControlVariableIsNeverModifiedIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"'for' loop control variable is never modified\",\n\t\t\t\t\t   Description = \"'for' loop control variable is never modified.\",\n\t\t\t\t\t   Category = IssueCategories.CodeQualityIssues,\n\t\t\t\t\t   Severity = Severity.Warning,\n                       AnalysisDisableKeyword = \"ForControlVariableIsNeverModified\")]\n    public class ForControlVariableIsNeverModifiedIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ForControlVariableIsNeverModifiedIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic VariableInitializer GetControlVariable(VariableDeclarationStatement variableDecl, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  BinaryOperatorExpression condition)\n\t\t\t{\n\t\t\t\tvar controlVariables = variableDecl.Variables.Where (\n\t\t\t\t\tv =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar identifier = new IdentifierExpression (v.Name);\n\t\t\t\t\t\treturn condition.Left.Match (identifier).Success ||\n\t\t\t\t\t\t\tcondition.Right.Match (identifier).Success;\n\t\t\t\t\t}).ToList ();\n\t\t\t\treturn controlVariables.Count == 1 ? controlVariables [0] : null;\n\t\t\t}\n\n\t\t\tstatic VariableInitializer GetControlVariable(VariableDeclarationStatement variableDecl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  UnaryOperatorExpression condition)\n\t\t\t{\n\t\t\t\tvar controlVariables = variableDecl.Variables.Where (\n\t\t\t\t\tv =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar identifier = new IdentifierExpression (v.Name);\n\t\t\t\t\t\treturn condition.Expression.Match (identifier).Success;\n\t\t\t\t\t}).ToList ();\n\t\t\t\treturn controlVariables.Count == 1 ? controlVariables [0] : null;\n\t\t\t}\n\n\t\t\tpublic override void VisitForStatement (ForStatement forStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForStatement (forStatement);\n\n\t\t\t\tif (forStatement.Initializers.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\tvar variableDecl = forStatement.Initializers.First () as VariableDeclarationStatement;\n\t\t\t\tif (variableDecl == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tVariableInitializer controlVariable = null;\n\t\t\t\tif (forStatement.Condition is BinaryOperatorExpression) {\n\t\t\t\t\tcontrolVariable = GetControlVariable (variableDecl, (BinaryOperatorExpression)forStatement.Condition);\n\t\t\t\t} else if (forStatement.Condition is UnaryOperatorExpression) {\n\t\t\t\t\tcontrolVariable = GetControlVariable (variableDecl, (UnaryOperatorExpression)forStatement.Condition);\n\t\t\t\t} else if (forStatement.Condition is IdentifierExpression) {\n\t\t\t\t\tcontrolVariable = variableDecl.Variables.FirstOrDefault (\n\t\t\t\t\t\tv => v.Name == ((IdentifierExpression)forStatement.Condition).Identifier);\n\t\t\t\t}\n\n\t\t\t\tif (controlVariable == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar localResolveResult = ctx.Resolve (controlVariable) as LocalResolveResult;\n\t\t\t\tif (localResolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar results = ctx.FindReferences (forStatement, localResolveResult.Variable);\n\t\t\t\tvar modified = false;\n\t\t\t\tforeach (var result in results) {\n\t\t\t\t\tif (modified)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tvar node = result.Node;\n\t\t\t\t\tvar unary = node.Parent as UnaryOperatorExpression;\n\t\t\t\t\tif (unary != null && unary.Expression == node) {\n\t\t\t\t\t\tmodified = unary.Operator == UnaryOperatorType.Decrement ||\n\t\t\t\t\t\t\tunary.Operator == UnaryOperatorType.PostDecrement ||\n\t\t\t\t\t\t\tunary.Operator == UnaryOperatorType.Increment ||\n\t\t\t\t\t\t\tunary.Operator == UnaryOperatorType.PostIncrement;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar assignment = node.Parent as AssignmentExpression;\n\t\t\t\t\tmodified = assignment != null && assignment.Left == node;\n\t\t\t\t}\n\n\t\t\t\tif (!modified)\n\t\t\t\t\tAddIssue (new CodeIssue(controlVariable.NameToken,\n\t\t\t\t\t\tctx.TranslateString (\"'for' loop control variable is never modified\")));\n\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/FormatStringProblemIssue.cs",
    "content": "//\n// FormatStringIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Utils;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"String formatting problems\",\n\t                  Description = \"Finds issues with format strings.\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"FormatStringProblem\")]\n\tpublic class FormatStringProblemIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<FormatStringProblemIssue>\n\t\t{\n\t\t\treadonly BaseRefactoringContext context;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\t// Speed up the inspector by discarding some invocations early\n\t\t\t\tvar hasEligibleArgument = invocationExpression.Arguments.Any(argument => {\n\t\t\t\t\tvar primitiveArg = argument as PrimitiveExpression;\n\t\t\t\t\treturn primitiveArg != null && primitiveArg.Value is string;\n\t\t\t\t});\n\t\t\t\tif (!hasEligibleArgument)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar invocationResolveResult = context.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (invocationResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tExpression formatArgument;\n\t\t\t\tIList<Expression> formatArguments;\n\t\t\t\tif (!FormatStringHelper.TryGetFormattingParameters(invocationResolveResult, invocationExpression,\n\t\t\t\t                                                   out formatArgument, out formatArguments, null)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar primitiveArgument = formatArgument as PrimitiveExpression;\n\t\t\t\tif (primitiveArgument == null || !(primitiveArgument.Value is string))\n\t\t\t\t\treturn;\n\t\t\t\tvar format = (string)primitiveArgument.Value;\n\t\t\t\tvar parsingResult = context.ParseFormatString(format);\n\t\t\t\tCheckSegments(parsingResult.Segments, formatArgument.StartLocation, formatArguments, invocationExpression);\n\n\t\t\t\tvar argUsed = new HashSet<int> ();\n\n\t\t\t\tforeach (var item in parsingResult.Segments) {\n\t\t\t\t\tvar fi = item as FormatItem;\n\t\t\t\t\tif (fi == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\targUsed.Add(fi.Index);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < formatArguments.Count; i++) {\n\t\t\t\t\tif (!argUsed.Contains(i)) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(formatArguments[i], ctx.TranslateString(\"Argument is not used in format string\")) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CheckSegments(IList<IFormatStringSegment> segments, TextLocation formatStart, IList<Expression> formatArguments, AstNode anchor)\n\t\t\t{\n\t\t\t\tint argumentCount = formatArguments.Count;\n\t\t\t\tforeach (var segment in segments) {\n\t\t\t\t\tvar errors = segment.Errors.ToList();\n\t\t\t\t\tvar formatItem = segment as FormatItem;\n\t\t\t\t\tif (formatItem != null) {\n\t\t\t\t\t\tvar segmentEnd = new TextLocation(formatStart.Line, formatStart.Column + segment.EndLocation + 1);\n\t\t\t\t\t\tvar segmentStart = new TextLocation(formatStart.Line, formatStart.Column + segment.StartLocation + 1);\n\t\t\t\t\t\tif (formatItem.Index >= argumentCount) {\n\t\t\t\t\t\t\tvar outOfBounds = context.TranslateString(\"The index '{0}' is out of bounds of the passed arguments\");\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(segmentStart, segmentEnd, string.Format(outOfBounds, formatItem.Index)));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (formatItem.HasErrors) {\n\t\t\t\t\t\t\tvar errorMessage = string.Join(Environment.NewLine, errors.Select(error => error.Message).ToArray());\n\t\t\t\t\t\t\tstring messageFormat;\n\t\t\t\t\t\t\tif (errors.Count > 1) {\n\t\t\t\t\t\t\t\tmessageFormat = context.TranslateString(\"Multiple:\\n{0}\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmessageFormat = context.TranslateString(\"{0}\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(segmentStart, segmentEnd, string.Format(messageFormat, errorMessage)));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (segment.HasErrors) {\n\t\t\t\t\t\tforeach (var error in errors) {\n\t\t\t\t\t\t\tvar errorStart = new TextLocation(formatStart.Line, formatStart.Column + error.StartLocation + 1);\n\t\t\t\t\t\t\tvar errorEnd = new TextLocation(formatStart.Line, formatStart.Column + error.EndLocation + 1);\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(errorStart, errorEnd, error.Message));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/FunctionNeverReturnsIssue.cs",
    "content": "// \n// MethodNeverReturnsIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Function never returns\",\n\t\tDescription = \"Function does not reach its end or a 'return' statement by any of possible execution paths.\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"FunctionNeverReturns\")]\n\tpublic class FunctionNeverReturnsIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<FunctionNeverReturnsIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration (MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tvar body = methodDeclaration.Body;\n\n\t\t\t\t// partial method\n\t\t\t\tif (body.IsNull)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar memberResolveResult = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tVisitBody(\"Method\", methodDeclaration.NameToken, body,\n\t\t\t\t          memberResolveResult == null ? null : memberResolveResult.Member, null);\n\n\t\t\t\tbase.VisitMethodDeclaration (methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tVisitBody(\"Delegate\", anonymousMethodExpression.DelegateToken,\n\t\t\t\t          anonymousMethodExpression.Body, null, null);\n\n\t\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitAccessor(Accessor accessor)\n\t\t\t{\n\t\t\t\tif (accessor.Body.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tvar parentProperty = accessor.GetParent<PropertyDeclaration>();\n\t\t\t\tvar resolveResult = ctx.Resolve(parentProperty);\n\t\t\t\tvar memberResolveResult = resolveResult as MemberResolveResult;\n\n\t\t\t\tVisitBody(\"Accessor\", accessor.Keyword, accessor.Body,\n\t\t\t\t          memberResolveResult == null ? null : memberResolveResult.Member,\n\t\t\t\t          accessor.Keyword.Role);\n\n\t\t\t\tbase.VisitAccessor (accessor);\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tvar body = lambdaExpression.Body as BlockStatement;\n\t\t\t\tif (body != null) {\n\t\t\t\t\tVisitBody(\"Lambda expression\", lambdaExpression.ArrowToken, body, null, null);\n\t\t\t\t}\n\n\t\t\t\t//Even if it is an expression, we still need to check for children\n\t\t\t\t//for cases like () => () => { while (true) {}}\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\t}\n\n\t\t\tvoid VisitBody(string entityType, AstNode node, BlockStatement body, IMember member, Role accessorRole)\n\t\t\t{\n\t\t\t\tvar recursiveDetector = new RecursiveDetector(ctx, member, accessorRole);\n\t\t\t\tvar reachability = ctx.CreateReachabilityAnalysis(body, recursiveDetector);\n\t\t\t\tbool hasReachableReturn = false;\n\t\t\t\tforeach (var statement in reachability.ReachableStatements) {\n\t\t\t\t\tif (statement is ReturnStatement || statement is ThrowStatement || statement is YieldBreakStatement) {\n\t\t\t\t\t\tif (!statement.AcceptVisitor(recursiveDetector)) {\n\t\t\t\t\t\t\thasReachableReturn = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!hasReachableReturn && !reachability.IsEndpointReachable(body)) {\n\t\t\t\t\tAddIssue(new CodeIssue(node, ctx.TranslateString(string.Format(\"{0} never reaches its end or a 'return' statement.\", entityType))));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclass RecursiveDetector : ReachabilityAnalysis.RecursiveDetectorVisitor\n\t\t\t{\n\t\t\t\tBaseRefactoringContext ctx;\n\t\t\t\tIMember member;\n\t\t\t\tRole accessorRole;\n\n\t\t\t\tinternal RecursiveDetector(BaseRefactoringContext ctx, IMember member, Role accessorRole) {\n\t\t\t\t\tthis.ctx = ctx;\n\t\t\t\t\tthis.member = member;\n\t\t\t\t\tthis.accessorRole = accessorRole;\n\t\t\t\t}\n\n\t\t\t\tpublic override bool VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t\t{\n\t\t\t\t\tswitch (binaryOperatorExpression.Operator) {\n\t\t\t\t\t\tcase BinaryOperatorType.ConditionalAnd:\n\t\t\t\t\t\tcase BinaryOperatorType.ConditionalOr:\n\t\t\t\t\t\t\treturn binaryOperatorExpression.Left.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t\treturn base.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\t}\n\n\t\t\t\tpublic override bool VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t\t{\n\t\t\t\t\tif (accessorRole != null) {\n\t\t\t\t\t\tif (accessorRole == PropertyDeclaration.SetKeywordRole) {\n\t\t\t\t\t\t\treturn assignmentExpression.Left.AcceptVisitor(this); \n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn assignmentExpression.Right.AcceptVisitor(this); \n\t\t\t\t\t}\n\t\t\t\t\treturn base.VisitAssignmentExpression(assignmentExpression);\n\t\t\t\t}\n\n\t\t\t\tpublic override bool VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tpublic override bool VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tpublic override bool VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t\t{\n\t\t\t\t\treturn CheckRecursion(identifierExpression);\n\t\t\t\t}\n\n\t\t\t\tpublic override bool VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t\t{\n\t\t\t\t\tif (base.VisitMemberReferenceExpression(memberReferenceExpression))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\treturn CheckRecursion(memberReferenceExpression);\n\t\t\t\t}\n\n\t\t\t\tpublic override bool VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t\t{\n\t\t\t\t\tif (base.VisitInvocationExpression(invocationExpression))\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\treturn CheckRecursion(invocationExpression);\n\t\t\t\t}\n\n\t\t\t\tbool CheckRecursion(AstNode node) {\n\t\t\t\t\tif (member == null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar resolveResult = ctx.Resolve(node);\n\n\t\t\t\t\t//We'll ignore Method groups here\n\t\t\t\t\t//If the invocation expressions will be dealt with later anyway\n\t\t\t\t\t//and properties are never in \"method groups\".\n\t\t\t\t\tvar memberResolveResult = resolveResult as MemberResolveResult;\n\t\t\t\t\tif (memberResolveResult == null || memberResolveResult.Member != this.member) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Now check for virtuals\n\t\t\t\t\tif (memberResolveResult.Member.IsVirtual && !memberResolveResult.Member.DeclaringTypeDefinition.IsSealed) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar parentAssignment = node.Parent as AssignmentExpression;\n\t\t\t\t\tif (parentAssignment != null) {\n\t\t\t\t\t\tif (accessorRole == CustomEventDeclaration.AddKeywordRole) {\n\t\t\t\t\t\t\treturn parentAssignment.Operator == AssignmentOperatorType.Add;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (accessorRole == CustomEventDeclaration.RemoveKeywordRole) {\n\t\t\t\t\t\t\treturn parentAssignment.Operator == AssignmentOperatorType.Subtract;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (accessorRole == PropertyDeclaration.GetKeywordRole) {\n\t\t\t\t\t\t\treturn parentAssignment.Operator != AssignmentOperatorType.Assign;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar parentUnaryOperation = node.Parent as UnaryOperatorExpression;\n\t\t\t\t\tif (parentUnaryOperation != null) {\n\t\t\t\t\t\tvar operatorType = parentUnaryOperation.Operator;\n\t\t\t\t\t\tif (operatorType == UnaryOperatorType.Increment ||\n\t\t\t\t\t\t\toperatorType == UnaryOperatorType.Decrement ||\n\t\t\t\t\t\t\toperatorType == UnaryOperatorType.PostIncrement ||\n\t\t\t\t\t\t\toperatorType == UnaryOperatorType.PostDecrement) {\n\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn accessorRole == null || accessorRole == PropertyDeclaration.GetKeywordRole;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/LocalVariableHidesMemberIssue.cs",
    "content": "﻿// \n// LocalVariableHideFieldIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Local variable hides member\",\n\t                   Description = \"Local variable has the same name as a member and hides it.\",\n\t                   Category = IssueCategories.CodeQualityIssues,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"LocalVariableHidesMember\")]\n\tpublic class LocalVariableHidesMemberIssue : VariableHidesMemberIssue\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<LocalVariableHidesMemberIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableInitializer (VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tbase.VisitVariableInitializer(variableInitializer);\n\n\t\t\t\tif (!(ctx.Resolve (variableInitializer) is LocalResolveResult))\n\t\t\t\t\treturn;\n\t\t\t\tvar mre = variableInitializer.Initializer as MemberReferenceExpression;\n\t\t\t\tif (mre != null && mre.MemberName == variableInitializer.Name && mre.Target is ThisReferenceExpression) {\n\t\t\t\t\t// Special case: the variable is initialized from the member it is hiding\n\t\t\t\t\t// In this case, the hiding is obviously intentional and we shouldn't show a warning.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tCheckLocal(variableInitializer, variableInitializer.Name, variableInitializer.NameToken);\n\t\t\t}\n\n\t\t\tvoid CheckLocal(AstNode node, string name, AstNode token)\n\t\t\t{\n\t\t\t\tIMember member;\n\t\t\t\tif (HidesMember(ctx, node, name, out member)) {\n\t\t\t\t\tstring msg;\n\t\t\t\t\tswitch (member.SymbolKind) {\n\t\t\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\t\t\tmsg = ctx.TranslateString(\"Local variable '{0}' hides field '{1}'\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase SymbolKind.Method:\n\t\t\t\t\t\t\tmsg = ctx.TranslateString(\"Local variable '{0}' hides method '{1}'\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase SymbolKind.Property:\n\t\t\t\t\t\t\tmsg = ctx.TranslateString(\"Local variable '{0}' hides property '{1}'\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase SymbolKind.Event:\n\t\t\t\t\t\t\tmsg = ctx.TranslateString(\"Local variable '{0}' hides event '{1}'\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tmsg = ctx.TranslateString(\"Local variable '{0}' hides member '{1}'\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tAddIssue(new CodeIssue(token, string.Format(msg, name, member.FullName)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitForeachStatement (ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForeachStatement (foreachStatement);\n\n\t\t\t\tCheckLocal(foreachStatement, foreachStatement.VariableName, foreachStatement.VariableNameToken);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class MemberCollectionService\n\t{\n\t\tDictionary<Tuple<IType, string>, IMember[]> memberCache = new Dictionary<Tuple<IType, string>, IMember[]> ();\n\t\tDictionary<IType, List<IMember>> allMembers = new Dictionary<IType, List<IMember>> ();\n\n\t\tpublic IMember[] GetMembers(IType type, string variableName)\n\t\t{\n\t\t\tIMember[] members;\n\t\t\tTuple<IType, string> key = Tuple.Create(type, variableName);\n\t\t\tif (!memberCache.TryGetValue (key, out members)) {\n\t\t\t\tlock (memberCache) {\n\t\t\t\t\tif (!memberCache.TryGetValue(key, out members)) {\n\t\t\t\t\t\tList<IMember> am;\n\t\t\t\t\t\tif (!allMembers.TryGetValue(type, out am)) {\n\t\t\t\t\t\t\tlock (allMembers) {\n\t\t\t\t\t\t\t\tif (!allMembers.TryGetValue(type, out am)) {\n\t\t\t\t\t\t\t\t\tam = new List<IMember>(type.GetMembers());\n\t\t\t\t\t\t\t\t\tallMembers [type] = am;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmembers = am.Where(m => m.Name == variableName).ToArray();\n\t\t\t\t\t\tmemberCache.Add(key, members);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn members;\n\t\t}\n\t}\n\n\tpublic abstract class VariableHidesMemberIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected static bool HidesMember(BaseRefactoringContext ctx, AstNode node, string variableName)\n\t\t{\n\t\t\tIMember member;\n\t\t\treturn HidesMember(ctx, node, variableName, out member);\n\t\t}\n\n\t\tprotected static bool HidesMember(BaseRefactoringContext ctx, AstNode node, string variableName, out IMember member)\n\t\t{\n\t\t\tMemberCollectionService mcs = (MemberCollectionService)ctx.GetService(typeof(MemberCollectionService));\n\t\t\tif (mcs == null) {\n\t\t\t\tlock (ctx) {\n\t\t\t\t\tif ((mcs = (MemberCollectionService)ctx.GetService(typeof(MemberCollectionService))) == null) {\n\t\t\t\t\t\tmcs = new MemberCollectionService();\n\t\t\t\t\t\tctx.Services.AddService(typeof(MemberCollectionService), mcs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar typeDecl = node.GetParent<TypeDeclaration>();\n\t\t\tmember = null;\n\t\t\tif (typeDecl == null)\n\t\t\t\treturn false;\n\t\t\tvar entityDecl = node.GetParent<EntityDeclaration>();\n\t\t\tvar memberResolveResult = ctx.Resolve(entityDecl) as MemberResolveResult;\n\t\t\tif (memberResolveResult == null)\n\t\t\t\treturn false;\n\t\t\tvar typeResolveResult = ctx.Resolve(typeDecl) as TypeResolveResult;\n\t\t\tif (typeResolveResult == null)\n\t\t\t\treturn false;\n\n\t\t\tvar sourceMember = memberResolveResult.Member;\n\n\t\t\tmember = mcs.GetMembers (typeResolveResult.Type, variableName).FirstOrDefault(m2 => IsAccessible(sourceMember, m2));\n\t\t\treturn member != null;\n\t\t}\n\n\t\tstatic bool IsAccessible(IMember sourceMember, IMember targetMember)\n\t\t{\n\t\t\tif (sourceMember.IsStatic != targetMember.IsStatic)\n\t\t\t\treturn false;\n\n\t\t\tvar sourceType = sourceMember.DeclaringType;\n\t\t\tvar targetType = targetMember.DeclaringType;\n\t\t\tswitch (targetMember.Accessibility)\n\t\t\t{\n\t\t\t\tcase Accessibility.None:\n\t\t\t\t\treturn false;\n\t\t\t\t\tcase Accessibility.Private:\n\t\t\t\t\t// check for members of outer classes (private members of outer classes can be accessed)\n\t\t\t\t\tvar targetTypeDefinition = targetType.GetDefinition();\n\t\t\t\t\tfor (var t = sourceType.GetDefinition(); t != null; t = t.DeclaringTypeDefinition)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (t.Equals(targetTypeDefinition))\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t\tcase Accessibility.Public:\n\t\t\t\t\treturn true;\n\t\t\t\t\tcase Accessibility.Protected:\n\t\t\t\t\treturn IsProtectedAccessible(sourceType, targetType);\n\t\t\t\t\tcase Accessibility.Internal:\n\t\t\t\t\treturn IsInternalAccessible(sourceMember.ParentAssembly, targetMember.ParentAssembly);\n\t\t\t\t\tcase Accessibility.ProtectedOrInternal:\n\t\t\t\t\treturn IsInternalAccessible(sourceMember.ParentAssembly, targetMember.ParentAssembly) || IsProtectedAccessible(sourceType, targetType);\n\t\t\t\t\tcase Accessibility.ProtectedAndInternal:\n\t\t\t\t\treturn IsInternalAccessible(sourceMember.ParentAssembly, targetMember.ParentAssembly) && IsProtectedAccessible(sourceType, targetType);\n\t\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Invalid value for Accessibility\");\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsProtectedAccessible(IType sourceType, IType targetType)\n\t\t{\n\t\t\treturn sourceType.GetAllBaseTypes().Any(type => targetType.Equals(type));\n\t\t}\n\n\t\tstatic bool IsInternalAccessible(IAssembly sourceAssembly, IAssembly targetAssembly)\n\t\t{\n\t\t\treturn sourceAssembly.InternalsVisibleTo(targetAssembly);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/LongLiteralEndingLowerLIssue.cs",
    "content": "//\n// LowercaseLongLiteralIssue.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Long literal ends with 'l' instead of 'L'\",\n\t                   Description = \"Lowercase 'l' is often confused with '1'\",\n\t                   Category = IssueCategories.CodeQualityIssues,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"LongLiteralEndingLowerL\")]\n\tpublic class LongLiteralEndingLowerLIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<LongLiteralEndingLowerLIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitPrimitiveExpression(PrimitiveExpression primitiveExpression)\n\t\t\t{\n\t\t\t\tif (!(primitiveExpression.Value is long || primitiveExpression.Value is ulong))\n\t\t\t\t{\n\t\t\t\t\t//Literals such as \"l\" or 'l' are perfectly acceptable.\n\t\t\t\t\t//Also, no point in visiting integer or boolean literals\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstring literalValue = primitiveExpression.LiteralValue;\n\t\t\t\tif (literalValue.Length < 2) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tchar prevChar = literalValue [literalValue.Length - 2];\n\t\t\t\tchar lastChar = literalValue [literalValue.Length - 1];\n\n\t\t\t\tif (prevChar == 'u' || prevChar == 'U') {\n\t\t\t\t\t//No problem, '3ul' is not confusing\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (lastChar == 'l' || prevChar == 'l') {\n\t\t\t\t\tAddIssue(new CodeIssue(primitiveExpression,\n\t\t\t\t\t         ctx.TranslateString(\"Long literal ends with 'l' instead of 'L'\"),\n\t\t\t\t\t         ctx.TranslateString(\"Make suffix upper case\"),\n\t\t\t\t\t         script => {\n\t\t\t\t\t\t\t\tobject newValue = primitiveExpression.Value;\n\t\t\t\t\t\t\t\tstring newLiteralValue = primitiveExpression.LiteralValue.ToUpperInvariant();\n\t\t\t\t\t\t\t\tscript.Replace(primitiveExpression, new PrimitiveExpression(newValue, newLiteralValue));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/MemberHidesStaticFromOuterClassIssue.cs",
    "content": "//\n// MemberHidesStaticFromOuterClass.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\n\t\t\"Member hides static member from outer class\",\n\t\tDescription = \"Member hides static member from outer class\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"MemberHidesStaticFromOuterClass\")]\n\tpublic class MemberHidesStaticFromOuterClassIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<MemberHidesStaticFromOuterClassIssue>\n\t\t{\n\t\t\treadonly List<List<IMember>> staticMembers = new List<List<IMember>>();\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(typeDeclaration);\n\n\t\t\t\tstaticMembers.Add(new List<IMember>(rr.Type.GetMembers(m => m.IsStatic)));\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tstaticMembers.RemoveAt(staticMembers.Count - 1); \n\t\t\t}\n\n\t\t\tvoid Check(string name, AstNode nodeToMark, string memberType)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < staticMembers.Count - 1; i++) {\n\t\t\t\t\tvar member = staticMembers[i].FirstOrDefault(m => m.Name == name);\n\t\t\t\t\tif (member == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tstring outerMemberType;\n\t\t\t\t\tswitch (member.SymbolKind) {\n\t\t\t\t\t\tcase SymbolKind.Field:\n\t\t\t\t\t\t\touterMemberType = ctx.TranslateString(\"field\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase SymbolKind.Property:\n\t\t\t\t\t\t\touterMemberType = ctx.TranslateString(\"property\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase SymbolKind.Event:\n\t\t\t\t\t\t\touterMemberType = ctx.TranslateString(\"event\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase SymbolKind.Method:\n\t\t\t\t\t\t\touterMemberType = ctx.TranslateString(\"method\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\touterMemberType = ctx.TranslateString(\"member\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tAddIssue(new CodeIssue(nodeToMark,\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"{0} '{1}' hides {2} from outer class\"),\n\t\t\t\t\t\t\tmemberType, member.Name, outerMemberType)));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tforeach (var init in eventDeclaration.Variables) {\n\t\t\t\t\tCheck(init.Name, init.NameToken, ctx.TranslateString(\"Event\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tCheck(eventDeclaration.Name, eventDeclaration.NameToken, ctx.TranslateString(\"Event\"));\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tforeach (var init in fieldDeclaration.Variables) {\n\t\t\t\t\tCheck(init.Name, init.NameToken, ctx.TranslateString(\"Field\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tCheck(propertyDeclaration.Name, propertyDeclaration.NameToken, ctx.TranslateString(\"Property\"));\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t\tCheck(fixedFieldDeclaration.Name, fixedFieldDeclaration.NameToken, ctx.TranslateString(\"Fixed field\"));\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tCheck(methodDeclaration.Name, methodDeclaration.NameToken, ctx.TranslateString(\"Method\"));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/MethodOverloadWithOptionalParameterIssue.cs",
    "content": "//\n// MethodOverloadWithOptionalParameterIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\n\t\t\"Method with optional parameter is hidden by overload\",\n\t\tDescription = \"Method with optional parameter is hidden by overload\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"MethodOverloadWithOptionalParameter\")]\n\tpublic class MethodOverloadWithOptionalParameterIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<MethodOverloadWithOptionalParameterIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\n\t\t\tvoid CheckParameters(IParameterizedMember member,  List<IParameterizedMember> overloads, List<ParameterDeclaration> parameterDeclarations)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < member.Parameters.Count; i++) {\n\t\t\t\t\tif (!member.Parameters[i].IsOptional)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tforeach (var overload in overloads) {\n\t\t\t\t\t\tif (overload.Parameters.Count != i)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tbool equal = true;\n\t\t\t\t\t\tfor (int j = 0; j < i; j++)  {\n\t\t\t\t\t\t\tif (overload.Parameters[j].Type != member.Parameters[j].Type) {\n\t\t\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (equal) {\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\t\tparameterDeclarations[i],\n\t\t\t\t\t\t\t\tmember.SymbolKind == SymbolKind.Method ?\n\t\t\t\t\t\t\t\tctx.TranslateString(\"Method with optional parameter is hidden by overload\") :\n\t\t\t\t\t\t\t\tctx.TranslateString(\"Indexer with optional parameter is hidden by overload\")));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar method = rr.Member as IMethod;\n\t\t\t\tif (method == null)\n\t\t\t\t\treturn;\n\t\t\t\tCheckParameters (method, \n\t\t\t\t\tmethod.DeclaringType.GetMethods(m =>\n\t\t\t\t\t\tm.Name == method.Name && m.TypeParameters.Count == method.TypeParameters.Count).Cast<IParameterizedMember>().ToList(),\n\t\t\t\t\tmethodDeclaration.Parameters.ToList()\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(indexerDeclaration) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar method = rr.Member as IProperty;\n\t\t\t\tif (method == null)\n\t\t\t\t\treturn;\n\t\t\t\tCheckParameters (method, \n\t\t\t\t\tmethod.DeclaringType.GetProperties(m =>\n\t\t\t\t\t\tm.IsIndexer &&\n\t\t\t\t\t\tm != method.UnresolvedMember).Cast<IParameterizedMember>().ToList(),\n\t\t\t\t\tindexerDeclaration.Parameters.ToList()\n\t\t\t\t);\n\t\t\t}\n\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/NonReadonlyReferencedInGetHashCodeIssue.cs",
    "content": "//\n// NonReadonlyReferencedInGetHashCodeIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Non-readonly field referenced in 'GetHashCode()'\",\n\t\tDescription= \"Non-readonly field referenced in 'GetHashCode()'\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"NonReadonlyReferencedInGetHashCode\")]\n\tpublic class NonReadonlyReferencedInGetHashCodeIssue : GatherVisitorCodeIssueProvider\n\t{\t\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<NonReadonlyReferencedInGetHashCodeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\t#region Skipped declarations\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t\t{\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (methodDeclaration.Name != \"GetHashCode\" || !methodDeclaration.HasModifier(Modifiers.Override) || methodDeclaration.Parameters.Any())\n\t\t\t\t\treturn;\n\t\t\t\tif (!ctx.Resolve(methodDeclaration.ReturnType).Type.IsKnownType(KnownTypeCode.Int32))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t\t\tCheckNode(memberReferenceExpression, memberReferenceExpression.MemberNameToken);\n\t\t\t}\n\n\t\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIdentifierExpression(identifierExpression);\n\t\t\t\tCheckNode(identifierExpression, identifierExpression);\n\t\t\t}\n\n\t\t\tvoid CheckNode(AstNode expr, AstNode nodeToMark)\n\t\t\t{\n\t\t\t\tvar resolvedResult = ctx.Resolve(expr);\n\t\t\t\tvar mrr = resolvedResult as MemberResolveResult;\n\t\t\t\tif (mrr == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar member = mrr.Member;\n\t\t\t\tvar field = member as IField;\n\t\t\t\tif (field != null) {\n\t\t\t\t\tif (!field.IsReadOnly && !field.IsConst)\n\t\t\t\t\t\tAddIssue(new CodeIssue(nodeToMark, \"Non-readonly field referenced in 'GetHashCode()'\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/NotResolvedInTextIssue.cs",
    "content": "//\n// ExceptionParameterCantBeResolvedIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Cannot resolve symbol in text argument\",\n\t\tDescription = \"Cannot resolve symbol in text argument\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"NotResolvedInText\")]\n\tpublic class NotResolvedInTextIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<NotResolvedInTextIssue>\n\t\t{\n\t\t\treadonly BaseRefactoringContext context;\n\n\t\t\tstatic GatherVisitor()\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t}\n\n\t\t\tstatic string GetArgumentParameterName(Expression expression)\n\t\t\t{\n\t\t\t\tvar pExpr = expression as PrimitiveExpression;\n\t\t\t\tif (pExpr != null)\n\t\t\t\t\treturn pExpr.Value as string;\n\t\t\t\treturn null;\n\t\t\t}\n\n\n\t\t\tbool CheckExceptionType(ObjectCreateExpression objectCreateExpression, out Expression paramNode, out Expression altParam, out bool canAddParameterName)\n\t\t\t{\n\t\t\t\tparamNode = null;\n\t\t\t\taltParam = null;\n\t\t\t\tcanAddParameterName = false;\n\t\t\t\tvar rr = context.Resolve(objectCreateExpression.Type) as TypeResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar type = rr.Type;\n\t\t\t\tif (type.Name == typeof(ArgumentException).Name && type.Namespace == typeof(ArgumentException).Namespace) {\n\t\t\t\t\tif (objectCreateExpression.Arguments.Count >= 2) {\n\t\t\t\t\t\taltParam = objectCreateExpression.Arguments.ElementAt(0);\n\t\t\t\t\t\tparamNode = objectCreateExpression.Arguments.ElementAt(1);\n\n\t\t\t\t\t}\n\t\t\t\t\treturn paramNode != null;\n\t\t\t\t}\n\t\t\t\tif (type.Name == typeof(ArgumentNullException).Name && type.Namespace == typeof(ArgumentNullException).Namespace ||\n\t\t\t\t    type.Name == typeof(ArgumentOutOfRangeException).Name && type.Namespace == typeof(ArgumentOutOfRangeException).Namespace ||\n\t\t\t\t    type.Name == typeof(DuplicateWaitObjectException).Name && type.Namespace == typeof(DuplicateWaitObjectException).Namespace) {\n\t\t\t\t\tcanAddParameterName = objectCreateExpression.Arguments.Count == 1;\n\t\t\t\t\tif (objectCreateExpression.Arguments.Count >= 1) {\n\t\t\t\t\t\tparamNode = objectCreateExpression.Arguments.FirstOrDefault();\n\t\t\t\t\t\tif (objectCreateExpression.Arguments.Count == 2) {\n\t\t\t\t\t\t\taltParam = objectCreateExpression.Arguments.ElementAt(1);\n\t\t\t\t\t\t\tif (!context.Resolve(altParam).Type.IsKnownType(KnownTypeCode.String))\n\t\t\t\t\t\t\t\tparamNode = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (objectCreateExpression.Arguments.Count == 3)\n\t\t\t\t\t\t\taltParam = objectCreateExpression.Arguments.ElementAt(2);\n\t\t\t\t\t}\n\t\t\t\t\treturn paramNode != null;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tstatic List<string> GetValidParameterNames(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tvar names = new List<string>();\n\t\t\t\tvar node = objectCreateExpression.Parent;\n\t\t\t\twhile (node != null && !(node is TypeDeclaration) && !(node is AnonymousTypeCreateExpression)) {\n\t\t\t\t\tvar lambda = node as LambdaExpression;\n\t\t\t\t\tif (lambda != null)\n\t\t\t\t\t\tnames.AddRange(lambda.Parameters.Select(p => p.Name));\n\t\t\t\t\tvar anonymousMethod = node as AnonymousMethodExpression;\n\t\t\t\t\tif (anonymousMethod != null)\n\t\t\t\t\t\tnames.AddRange(anonymousMethod.Parameters.Select(p => p.Name));\n\n\t\t\t\t\tvar indexer = node as IndexerDeclaration;\n\t\t\t\t\tif (indexer != null) {\n\t\t\t\t\t\tnames.AddRange(indexer.Parameters.Select(p => p.Name));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar methodDeclaration = node as MethodDeclaration;\n\t\t\t\t\tif (methodDeclaration != null) {\n\t\t\t\t\t\tnames.AddRange(methodDeclaration.Parameters.Select(p => p.Name));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar constructorDeclaration = node as ConstructorDeclaration;\n\t\t\t\t\tif (constructorDeclaration != null) {\n\t\t\t\t\t\tnames.AddRange(constructorDeclaration.Parameters.Select(p => p.Name));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvar accessor = node as Accessor;\n\t\t\t\t\tif (accessor != null) {\n\t\t\t\t\t\tif (accessor.Role == PropertyDeclaration.SetterRole ||\n\t\t\t\t\t\t    accessor.Role == CustomEventDeclaration.AddAccessorRole ||\n\t\t\t\t\t\t    accessor.Role == CustomEventDeclaration.RemoveAccessorRole) {\n\t\t\t\t\t\t\tnames.Add(\"value\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode = node.Parent;\n\t\t\t\t}\n\t\t\t\treturn names;\n\t\t\t}\n\n\t\t\tstring GetParameterName(Expression expr)\n\t\t\t{\n\t\t\t\tforeach (var node in expr.DescendantsAndSelf) {\n\t\t\t\t\tif (!(node is Expression))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar rr = context.Resolve(node) as LocalResolveResult;\n\t\t\t\t\tif (rr != null && rr.Variable.SymbolKind == SymbolKind.Parameter)\n\t\t\t\t\t\treturn rr.Variable.Name;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tstring GuessParameterName(ObjectCreateExpression objectCreateExpression, List<string> validNames)\n\t\t\t{\n\t\t\t\tif (validNames.Count == 1)\n\t\t\t\t\treturn validNames[0];\n\t\t\t\tvar parent = objectCreateExpression.GetParent<IfElseStatement>();\n\t\t\t\tif (parent == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn GetParameterName(parent.Condition);\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\n\t\t\t\tExpression paramNode;\n\t\t\t\tExpression altParamNode;\n\t\t\t\tbool canAddParameterName;\n\t\t\t\tif (!CheckExceptionType(objectCreateExpression, out paramNode, out altParamNode, out canAddParameterName))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar paramName = GetArgumentParameterName(paramNode);\n\t\t\t\tif (paramName == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar validNames = GetValidParameterNames(objectCreateExpression);\n\n\t\t\t\tif (!validNames.Contains(paramName)) {\n\t\t\t\t\t// Case 1: Parameter name is swapped\n\t\t\t\t\tvar altParamName = GetArgumentParameterName(altParamNode);\n\t\t\t\t\tif (altParamName != null && validNames.Contains(altParamName)) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tparamNode,\n\t\t\t\t\t\t\tstring.Format(context.TranslateString(\"The parameter '{0}' can't be resolved\"), paramName),\n\t\t\t\t\t\t\tcontext.TranslateString(\"Swap parameter.\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tvar newAltNode = paramNode.Clone();\n\t\t\t\t\t\t\t\tscript.Replace(paramNode, altParamNode.Clone());\n\t\t\t\t\t\t\t\tscript.Replace(altParamNode, newAltNode);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\taltParamNode,\n\t\t\t\t\t\t\tcontext.TranslateString(\"The parameter name is on the wrong argument.\"),\n\t\t\t\t\t\t\tcontext.TranslateString(\"Swap parameter.\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tvar newAltNode = paramNode.Clone();\n\t\t\t\t\t\t\t\tscript.Replace(paramNode, altParamNode.Clone());\n\t\t\t\t\t\t\t\tscript.Replace(altParamNode, newAltNode);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar guessName = GuessParameterName(objectCreateExpression, validNames);\n\t\t\t\t\tif (guessName != null) {\n\n\t\t\t\t\t\tvar actions = new List<CodeAction>();\n\t\t\t\t\t\t\n\t\t\t\t\t\tactions.Add(new CodeAction (\n\t\t\t\t\t\t\tstring.Format(context.TranslateString(\"Replace with '\\\"{0}\\\"'.\"), guessName),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tscript.Replace(paramNode, new PrimitiveExpression(guessName));\n\t\t\t\t\t\t\t}, paramNode\n\t\t\t\t\t\t)); \n\n\t\t\t\t\t\tif (canAddParameterName) {\n\t\t\t\t\t\t\tactions.Add(new CodeAction(\n\t\t\t\t\t\t\t\tstring.Format(context.TranslateString(\"Add '\\\"{0}\\\"' parameter.\"), guessName),\n\t\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\t\tvar oce = (ObjectCreateExpression)objectCreateExpression.Clone();\n\t\t\t\t\t\t\t\t\toce.Arguments.Clear();\n\t\t\t\t\t\t\t\t\toce.Arguments.Add(new PrimitiveExpression(guessName));\n\t\t\t\t\t\t\t\t\toce.Arguments.Add(objectCreateExpression.Arguments.First().Clone());\n\t\t\t\t\t\t\t\t\tscript.Replace(objectCreateExpression, oce);\n\t\t\t\t\t\t\t\t}, paramNode\n\t\t\t\t\t\t\t)); \n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tparamNode,\n\t\t\t\t\t\t\tstring.Format(context.TranslateString(\"The parameter '{0}' can't be resolved\"), paramName),\n\t\t\t\t\t\t\tactions\n\t\t\t\t\t\t));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// General case: mark only\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tparamNode,\n\t\t\t\t\t\tstring.Format(context.TranslateString(\"The parameter '{0}' can't be resolved\"), paramName)\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/ObjectCreationAsStatementIssue.cs",
    "content": "//\n// ObjectCreationAsStatementIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Possible unassigned object created by 'new'\",\n\t\tDescription = \"Possible unassigned object created by 'new'\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"ObjectCreationAsStatement\")]\n\tpublic class ObjectCreationAsStatementIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tsealed class GatherVisitor : GatherVisitorBase<ObjectCreationAsStatementIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\t\t\t\tif (!(objectCreateExpression.Parent is ExpressionStatement))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(objectCreateExpression.NewToken,\n\t\t\t\t\tctx.TranslateString(\"Possible unassigned object created by 'new' expression\")));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/OperatorIsCanBeUsedIssue.cs",
    "content": "//\n// ReplaceWithIsOperatorIssue.cs\n//\n// Author:\n//\t   Ji Kun <jikun.nus@gmail.com>\n//\n// Copyright (c) 2013 Ji Kun\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.using System;\n\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Operator 'is' can be used\",\n\t\tDescription = \"Operator Is can be used instead of comparing object GetType() and instances of System.Type object.\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"OperatorIsCanBeUsed\")]\n\tpublic class OperatorIsCanBeUsedIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tsealed class GatherVisitor : GatherVisitorBase<OperatorIsCanBeUsedIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode pattern = \n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(\n\t\t\t\t\tnew InvocationExpression(new MemberReferenceExpression(new AnyNode(\"a\"), \"GetType\"), null),\n\t\t\t\t\tBinaryOperatorType.Equality,\n\t\t\t\t\tnew TypeOfExpression(new AnyNode(\"b\"))\n\t\t\t\t);\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\n\t\t\t\tvar m = pattern.Match(binaryOperatorExpression);\n\t\t\t\tif (!m.Success)\n\t\t\t\t\treturn;\n\n\t\t\t\tExpression identifier = m.Get<Expression>(\"a\").Single();\n\t\t\t\tAstType type = m.Get<AstType>(\"b\").Single();\n\t\t\t\t\n\t\t\t\tvar typeResolved = ctx.Resolve(type) as TypeResolveResult;\n\t\t\t\tif (typeResolved == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (typeResolved.Type.Kind == TypeKind.Class) {\n\t\t\t\t\tif (!typeResolved.Type.GetDefinition().IsSealed) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tbinaryOperatorExpression, \n\t\t\t\t\tctx.TranslateString(\"Operator 'is' can be used\"), \n\t\t\t\t\tctx.TranslateString(\"Replace with 'is' operator\"), \n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar isExpr = new IsExpression(identifier.Clone(), type.Clone());\n\t\t\t\t\t\tscript.Replace(binaryOperatorExpression, isExpr);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/OptionalParameterHierarchyMismatchIssue.cs",
    "content": "// \n// OptionalParameterValueIssueMismatch.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Mismatch optional parameter value in overridden method\",\n\t                   Description = \"The value of an optional parameter in a method does not match the base method.\",\n\t                   Category = IssueCategories.CodeQualityIssues,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"OptionalParameterHierarchyMismatch\")]\n\tpublic class OptionalParameterHierarchyMismatchIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<OptionalParameterHierarchyMismatchIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\t//Delegate declarations are not visited even though they can have optional\n\t\t\t//parameters because they can not be overriden.\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tVisitParameterizedEntityDeclaration(\"method\", methodDeclaration, methodDeclaration.Parameters);\n\t\t\t}\n\n\t\t\tvoid VisitParameterizedEntityDeclaration(string memberType, EntityDeclaration entityDeclaration, AstNodeCollection<ParameterDeclaration> parameters)\n\t\t\t{\n\t\t\t\t// Ignore explicit interface implementations (those should have no optional parameters as there can't be any direct calls) \n\t\t\t\tif (!entityDeclaration.GetChildByRole(EntityDeclaration.PrivateImplementationTypeRole).IsNull)\n\t\t\t\t\treturn;\n\t\t\t\t//Override is not strictly necessary because methodDeclaration\n\t\t\t\t//might still implement an interface member\n\t\t\t\tvar memberResolveResult = ctx.Resolve(entityDeclaration) as MemberResolveResult;\n\t\t\t\tif (memberResolveResult == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar member = (IParameterizedMember)memberResolveResult.Member;\n\t\t\t\tvar baseMembers = InheritanceHelper.GetBaseMembers(member, true).ToList();\n\t\t\t\tforeach (IParameterizedMember baseMember in baseMembers) {\n\t\t\t\t\tif (baseMember.IsOverride || baseMember.DeclaringType.Kind == TypeKind.Interface)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tCompareMethods(memberType, parameters, member, baseMember);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// only check 1 interface method -> multiple interface implementations could lead to deault value conflicts\n\t\t\t\t// possible other solutions: Skip the interface check entirely\n\t\t\t\tvar interfaceBaseMethods = baseMembers.Where(b => b.DeclaringType.Kind == TypeKind.Interface).ToList();\n\t\t\t\tif (interfaceBaseMethods.Count == 1) {\n\t\t\t\t\tforeach (IParameterizedMember baseMember in interfaceBaseMethods) {\n\t\t\t\t\t\tif (baseMember.DeclaringType.Kind == TypeKind.Interface) {\n\t\t\t\t\t\t\tCompareMethods(memberType, parameters, member, baseMember);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic Expression CreateDefaultValueExpression(BaseRefactoringContext ctx, AstNode node, IType type, object constantValue)\n\t\t\t{\n\t\t\t\tvar astBuilder = ctx.CreateTypeSystemAstBuilder(node);\n\t\t\t\treturn astBuilder.ConvertConstantValue(type, constantValue); \n\t\t\t}\n\n\t\t\tvoid CompareMethods(string memberType, AstNodeCollection<ParameterDeclaration> parameters, IParameterizedMember overridenMethod, IParameterizedMember baseMethod)\n\t\t\t{\n\t\t\t\tvar parameterEnumerator = parameters.GetEnumerator();\n\t\t\t\tfor (int parameterIndex = 0; parameterIndex < overridenMethod.Parameters.Count; parameterIndex++) {\n\t\t\t\t\tparameterEnumerator.MoveNext();\n\n\t\t\t\t\tvar baseParameter = baseMethod.Parameters [parameterIndex];\n\n\t\t\t\t\tvar overridenParameter = overridenMethod.Parameters [parameterIndex];\n\n\t\t\t\t\tstring parameterName = overridenParameter.Name;\n\t\t\t\t\tvar parameterDeclaration = parameterEnumerator.Current;\n\n\t\t\t\t\tif (overridenParameter.IsOptional) {\n\t\t\t\t\t\tif (!baseParameter.IsOptional) {\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(parameterDeclaration,\n\t\t\t\t\t\t\t         string.Format(ctx.TranslateString(\"Optional parameter value {0} differs from base \" + memberType + \" '{1}'\"), parameterName, baseMethod.DeclaringType.FullName),\n\t\t\t\t\t\t\t         ctx.TranslateString(\"Remove parameter default value\"),\n\t\t\t\t\t\t\t         script => {\n\t\t\t\t\t\t\t\tscript.Remove(parameterDeclaration.AssignToken);\n\t\t\t\t\t\t\t\tscript.Remove(parameterDeclaration.DefaultExpression);\n\t\t\t\t\t\t\t\tscript.FormatText(parameterDeclaration);\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t} else if (!object.Equals(overridenParameter.ConstantValue, baseParameter.ConstantValue)) {\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(parameterDeclaration,\n\t\t\t\t\t\t\t         string.Format(ctx.TranslateString(\"Optional parameter value {0} differs from base \" + memberType + \" '{1}'\"), parameterName, baseMethod.DeclaringType.FullName),\n\t\t\t\t\t\t\t         string.Format(ctx.TranslateString(\"Change default value to {0}\"), baseParameter.ConstantValue),\n\t\t\t\t\t\t\t\tscript => script.Replace(parameterDeclaration.DefaultExpression, CreateDefaultValueExpression(ctx, parameterDeclaration, baseParameter.Type, baseParameter.ConstantValue))));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!baseParameter.IsOptional)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tAddIssue(new CodeIssue(parameterDeclaration,\n\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Parameter {0} has default value in base method '{1}'\"), parameterName, baseMethod.FullName),\n\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Add default value from base '{0}'\"), CreateDefaultValueExpression(ctx, parameterDeclaration, baseParameter.Type, baseParameter.ConstantValue)),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tvar newParameter = (ParameterDeclaration)parameterDeclaration.Clone();\n\t\t\t\t\t\t\t\tnewParameter.DefaultExpression = CreateDefaultValueExpression(ctx, parameterDeclaration, baseParameter.Type, baseParameter.ConstantValue);\n\t\t\t\t\t\t\t\tscript.Replace(parameterDeclaration, newParameter);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tVisitParameterizedEntityDeclaration(\"indexer\", indexerDeclaration, indexerDeclaration.Parameters);\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t//No need to visit statements\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/OptionalParameterRefOutIssue.cs",
    "content": "//\n// OptionalParameterRefOutIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"[Optional] attribute with 'ref' or 'out' parameter\",\n\t                  Description=\"C# doesn't support optional 'ref' or 'out' parameters\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"OptionalParameterRefOut\")]\n\tpublic class OptionalParameterRefOutIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<OptionalParameterRefOutIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitParameterDeclaration(parameterDeclaration);\n\t\t\t\tif (parameterDeclaration.ParameterModifier != ParameterModifier.Ref && parameterDeclaration.ParameterModifier != ParameterModifier.Out)\n\t\t\t\t\treturn;\n\t\t\t\tforeach (var sect in parameterDeclaration.Attributes) {\n\t\t\t\t\tforeach (var attr in sect.Attributes) {\n\t\t\t\t\t\tvar rr = ctx.Resolve(attr);\n\t\t\t\t\t\tif (rr.Type.Name == \"OptionalAttribute\" && rr.Type.Namespace == \"System.Runtime.InteropServices\") {\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(attr, ctx.TranslateString(\"A 'ref' or 'out' parameter can't be optional\")));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/ParameterHidesMemberIssue.cs",
    "content": "﻿// \n// ParameterHidesMemberIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Parameter hides a member\",\n\t\t\t\t\t   Description = \"Parameter has the same name as a member and hides it.\",\n\t\t\t\t\t   Category = IssueCategories.CodeQualityIssues,\n\t\t\t\t\t   Severity = Severity.Warning,\n                       AnalysisDisableKeyword = \"ParameterHidesMember\")]\n    public class ParameterHidesMemberIssue : VariableHidesMemberIssue\n\t{\n\t    protected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ParameterHidesMemberIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitParameterDeclaration (parameterDeclaration);\n\n\t\t\t\tvar rr = ctx.Resolve(parameterDeclaration.Parent) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar parent = rr.Member;\n\t\t\t\tif (parent.SymbolKind == SymbolKind.Constructor || parent.ImplementedInterfaceMembers.Any ())\n\t\t\t\t\treturn;\n\t\t\t\tif (parent.IsOverride || parent.IsAbstract || parent.IsPublic || parent.IsProtected)\n\t\t\t\t\treturn;\n\t\t\t\t\t\n\t\t\t\tIMember member;\n                if (HidesMember(ctx, parameterDeclaration, parameterDeclaration.Name, out member)) {\n                    string msg;\n                    switch (member.SymbolKind) {\n                        case SymbolKind.Field:\n                            msg = ctx.TranslateString(\"Parameter '{0}' hides field '{1}'\");\n                            break;\n                        case SymbolKind.Method:\n                            msg = ctx.TranslateString(\"Parameter '{0}' hides method '{1}'\");\n                            break;\n                        case SymbolKind.Property:\n                            msg = ctx.TranslateString(\"Parameter '{0}' hides property '{1}'\");\n                            break;\n                        case SymbolKind.Event:\n                            msg = ctx.TranslateString(\"Parameter '{0}' hides event '{1}'\");\n                            break;\n                        default:\n                            msg = ctx.TranslateString(\"Parameter '{0}' hides member '{1}'\");\n                            break;\n                    }\n\t\t\t\t\tAddIssue(new CodeIssue(parameterDeclaration.NameToken,\n\t\t\t\t\t\tstring.Format(msg, parameterDeclaration.Name, member.FullName)));\n\t\t\t    }\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/PartialMethodParameterNameMismatchIssue.cs",
    "content": "//\n// PartialMethodParameterNameMismatchIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Parameter name differs in partial method declaration\",\n\t\tDescription = \"Parameter name differs in partial method declaration\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"PartialMethodParameterNameMismatch\")]\n\tpublic class PartialMethodParameterNameMismatchIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<PartialMethodParameterNameMismatchIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\t// skip\n\t\t\t}\n\t\t\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!methodDeclaration.HasModifier(Modifiers.Partial))\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar method = rr.Member as IMethod;\n\t\t\t\tif (method == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tint arg = 0;\n\t\t\t\tforeach (var param in methodDeclaration.Parameters) {\n\t\t\t\t\tvar pr = ctx.Resolve(param) as LocalResolveResult;\n\t\t\t\t\tif (pr == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tforeach (var part in method.Parts) {\n\t\t\t\t\t\tif (param.Name != part.Parameters[arg].Name) {\n\t\t\t\t\t\t\tList<CodeAction> fixes = new List<CodeAction>();\n\t\t\t\t\t\t\tforeach (var p2 in method.Parts) {\n\t\t\t\t\t\t\t\tif (param.Name != p2.Parameters[arg].Name) {\n\t\t\t\t\t\t\t\t\tint _arg = arg;\n\t\t\t\t\t\t\t\t\tfixes.Add(new CodeAction (\n\t\t\t\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Rename to '{0}'\"), p2.Parameters[_arg].Name),\n\t\t\t\t\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\t\t\t\t\ts.Rename(pr.Variable, p2.Parameters[_arg].Name);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tparam\n\t\t\t\t\t\t\t\t\t)); \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// TODO: Atm I think it makes only sense to offer a fix if the issue disappears\n\t\t\t\t\t\t\t// which might not be the case here.\n\t\t\t\t\t\t\tif (fixes.Count > 1) {\n\t\t\t\t\t\t\t\tfixes.Clear();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\t\tparam.NameToken,\n\t\t\t\t\t\t\t\tctx.TranslateString(\"Parameter name differs in partial method declaration\"),\n\t\t\t\t\t\t\t\tfixes\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\targ++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/PolymorphicFieldLikeEventInvocationIssue.cs",
    "content": "//\n// PolymorphicFieldLikeEventInvocationIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\n\t\t\"Invocation of polymorphic field event\",\n\t\tDescription = \"Invocation of polymorphic field event leads to unpredictable result since invocation lists are not virtual\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"PolymorphicFieldLikeEventInvocation\")]\n\tpublic class PolymorphicFieldLikeEventInvocationIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<PolymorphicFieldLikeEventInvocationIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression.Target) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar evt = rr.Member as IEvent;\n\t\t\t\tif (evt == null || !evt.IsOverride)\n\t\t\t\t\treturn;\n\t\t\t\tif (evt.AddAccessor.HasBody) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tinvocationExpression.Target,\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"The event `{0}' can only appear on the left hand side of `+=' or `-=' operator\"), evt.Name)\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression,\n\t\t\t\t\tctx.TranslateString(\"Invocation of polymorphic field like event\")));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/PossibleAssignmentToReadonlyFieldIssue.cs",
    "content": "//\n// PossibleAssignmentToReadonlyFieldIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\n\t\t\"Possible assignment to readonly field\",\n\t\tDescription = \"Check if a readonly field is used as assignment target\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"PossibleAssignmentToReadonlyField\")]\n\tpublic class PossibleAssignmentToReadonlyFieldIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<PossibleAssignmentToReadonlyFieldIssue>\n\t\t{\n\t\t\tbool inConstructor;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tinConstructor = true;\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t\tinConstructor = false;\n\t\t\t}\n\n\t\t\tvoid Check(Expression expr)\n\t\t\t{\n\t\t\t\tvar mr = expr as MemberReferenceExpression;\n\t\t\t\tif (mr != null) {\n\t\t\t\t\tif (inConstructor && mr.Descendants.Any(d => d.Parent is MemberReferenceExpression && d is ThisReferenceExpression))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tCheck(mr.Target);\n\t\t\t\t}\n\t\t\t\tif (inConstructor && expr is IdentifierExpression)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar rr = ctx.Resolve(expr) as MemberResolveResult;\n\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar field = rr.Member as IField;\n\n\t\t\t\tif (field == null || !field.IsReadOnly)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (field.Type.Kind == TypeKind.TypeParameter) {\n\t\t\t\t\tvar param = (ITypeParameter)field.Type;\n\t\t\t\t\tif (param.HasReferenceTypeConstraint)\n\t\t\t\t\t\treturn;\n\t\t\t\t\t// TODO: Add resolve actions: Add class constraint + remove readonly modifier\n\t\t\t\t\tAddIssue(new CodeIssue(expr,\n\t\t\t\t\t\tctx.TranslateString(\"Assignment to a property of a readonly field can be useless. Type parameter is not known to be a reference type.\")));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (field.Type.Kind == TypeKind.Struct) {\n\t\t\t\t\t// TODO: Add resolve actions: Remove readonly modifier\n\t\t\t\t\tAddIssue(new CodeIssue(expr, ctx.TranslateString(\"Readonly field can not be used as assignment target.\")));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression (assignmentExpression);\n\t\t\t\tCheck(assignmentExpression.Left);\n\t\t\t}\n\n\t\t\tpublic override void VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t\t{\n\t\t\t\tbase.VisitDirectionExpression (directionExpression);\n\t\t\t\tCheck(directionExpression.Expression);\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitUnaryOperatorExpression (unaryOperatorExpression);\n\t\t\t\tif (unaryOperatorExpression.Operator == UnaryOperatorType.Increment || unaryOperatorExpression.Operator == UnaryOperatorType.Decrement ||\n\t\t\t\t\tunaryOperatorExpression.Operator == UnaryOperatorType.PostIncrement || unaryOperatorExpression.Operator == UnaryOperatorType.PostDecrement) {\n\t\t\t\t\tCheck(unaryOperatorExpression.Expression);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/PossibleMultipleEnumerationIssue.cs",
    "content": "﻿// \n// MultipleEnumerationIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Possible multiple enumeration of IEnumerable\",\n\t\tDescription = \"Possible multiple enumeration of IEnumerable\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"PossibleMultipleEnumeration\")]\n\tpublic class PossibleMultipleEnumerationIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass AnalysisStatementCollector : DepthFirstAstVisitor\n\t\t{\n\t\t\tList<Statement> statements;\n\t\t\tAstNode variableDecl;\n\n\t\t\tAnalysisStatementCollector (AstNode variableDecl)\n\t\t\t{\n\t\t\t\tthis.variableDecl = variableDecl;\n\t\t\t}\n\n\t\t\tIList<Statement> GetStatements ()\n\t\t\t{\n\t\t\t\tif (statements != null)\n\t\t\t\t\treturn statements;\n\n\t\t\t\tstatements = new List<Statement> ();\n\t\t\t\tvar parent = variableDecl.Parent;\n\t\t\t\twhile (parent != null) {\n\t\t\t\t\tif (parent is BlockStatement || parent is MethodDeclaration ||\n\t\t\t\t\t\tparent is AnonymousMethodExpression || parent is LambdaExpression) {\n\t\t\t\t\t\tparent.AcceptVisitor (this);\n\t\t\t\t\t\tif (parent is BlockStatement)\n\t\t\t\t\t\t\tstatements.Add ((BlockStatement)parent);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tparent = parent.Parent;\n\t\t\t\t}\n\t\t\t\treturn statements;\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration (MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tstatements.Add (methodDeclaration.Body);\n\n\t\t\t\tbase.VisitMethodDeclaration (methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tstatements.Add (anonymousMethodExpression.Body);\n\n\t\t\t\tbase.VisitAnonymousMethodExpression (anonymousMethodExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression (LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tvar body = lambdaExpression.Body as BlockStatement;\n\t\t\t\tif (body != null)\n\t\t\t\t\tstatements.Add (body);\n\n\t\t\t\tbase.VisitLambdaExpression (lambdaExpression);\n\t\t\t}\n\n\t\t\tpublic static IList<Statement> Collect (AstNode variableDecl)\n\t\t\t{\n\t\t\t\treturn new AnalysisStatementCollector (variableDecl).GetStatements ();\n\t\t\t}\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<PossibleMultipleEnumerationIssue>\n\t\t{\n\t\t\tHashSet<AstNode> collectedAstNodes;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t\tthis.collectedAstNodes = new HashSet<AstNode> ();\n\t\t\t}\n\n\t\t\tvoid ResolveIssue(Script s, AstNode node, Func<TypeSystemAstBuilder, AstType> type, string methodCall)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(node) as LocalResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tvar refs = ctx.FindReferences(ctx.RootNode, rr.Variable);\n\t\t\t\tvar nodes = refs.Select(r => r.Node).Where(IsEnumeration).OfType<Expression>().ToList(); \n\t\t\t\tif (nodes.Count == 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar first = nodes.First().GetParent<Statement>();\n\t\t\t\tvar varName = ctx.GetNameProposal(\"enumerable\", first.StartLocation);\n\t\t\t\tvar astBuilder = ctx.CreateTypeSystemAstBuilder(first);\n\n\t\t\t\tvar links = new List<AstNode>();\n\t\t\t\tvar varDec = new VariableDeclarationStatement(new PrimitiveType(\"var\"), varName, new BinaryOperatorExpression(new AsExpression((Expression)node.Clone(), type (astBuilder)), BinaryOperatorType.NullCoalescing, new InvocationExpression(new MemberReferenceExpression((Expression)node.Clone(), methodCall))));\n\n\t\t\t\tlinks.Add(varDec.Variables.First().NameToken);\n\t\t\t\ts.InsertBefore(first, varDec);\n\t\t\t\tforeach (var n in nodes) {\n\t\t\t\t\tvar id = new IdentifierExpression(varName);\n\t\t\t\t\tlinks.Add(id);\n\t\t\t\t\ts.Replace(n, id);\n\t\t\t\t}\n\t\t\t\ts.Link(links);\n\t\t\t}\n\n\t\t\tvoid AddIssue (AstNode node, IType elementType, IList<AstNode> nodes)\n\t\t\t{\n\t\t\t\tif (collectedAstNodes.Add(node)) {\n\t\t\t\t\tvar actions = new List<CodeAction>();\n\t\t\t\t\tactions.Add(\n\t\t\t\t\t\tnew CodeAction(\n\t\t\t\t\t\t\tctx.TranslateString(\"Enumerate to array\"),\n\t\t\t\t\t\t\ts => ResolveIssue(s, node, ab => new ComposedType { BaseType = ab.ConvertType(elementType), ArraySpecifiers =  { new ArraySpecifier() } }, \"ToArray\"),\n\t\t\t\t\t\t\tnode\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\tactions.Add(\n\t\t\t\t\t\tnew CodeAction(\n\t\t\t\t\t\t\tctx.TranslateString(\"Enumerate to list\"),\n\t\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\t\tvar listType = ctx.Compilation.FindType(typeof(IList<>));\n\t\t\t\t\t\t\t\tResolveIssue(s, node, ab => ab.ConvertType(new ParameterizedType(listType.GetDefinition(), new IType[]{ elementType })), \"ToList\");\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnode\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\tAddIssue(new CodeIssue(node, ctx.TranslateString(\"Possible multiple enumeration of IEnumerable\"), actions));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddIssues (IList<AstNode> nodes)\n\t\t\t{\n\t\t\t\tif (nodes.Count == 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(nodes[0]);\n\t\t\t\tvar elementType = TypeGuessing.GetElementType(ctx.Resolver, rr.Type);\n\n\t\t\t\tforeach (var node in nodes)\n\t\t\t\t\tAddIssue (node, elementType, nodes);\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitParameterDeclaration (parameterDeclaration);\n\n\t\t\t\tvar resolveResult = ctx.Resolve (parameterDeclaration) as LocalResolveResult;\n\t\t\t\tCollectIssues (parameterDeclaration, parameterDeclaration.Parent, resolveResult);\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableInitializer (VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tbase.VisitVariableInitializer (variableInitializer);\n\n\t\t\t\tvar resolveResult = ctx.Resolve (variableInitializer) as LocalResolveResult;\n\t\t\t\tCollectIssues (variableInitializer, variableInitializer.Parent.Parent, resolveResult);\n\t\t\t}\n\n\t\t\tstatic bool IsAssignment (AstNode node)\n\t\t\t{\n\t\t\t\tvar assignment = node.Parent as AssignmentExpression;\n\t\t\t\tif (assignment != null)\n\t\t\t\t\treturn assignment.Left == node;\n\n\t\t\t\tvar direction = node.Parent as DirectionExpression;\n\t\t\t\tif (direction != null)\n\t\t\t\t\treturn direction.FieldDirection == FieldDirection.Out && direction.Expression == node;\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool IsEnumeration (AstNode node)\n\t\t\t{\n\t\t\t\tvar foreachStatement = node.Parent as ForeachStatement;\n\t\t\t\tif (foreachStatement != null && foreachStatement.InExpression == node) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar memberRef = node.Parent as MemberReferenceExpression;\n\t\t\t\tif (memberRef != null && memberRef.Target == node) {\n\t\t\t\t\tvar invocation = memberRef.Parent as InvocationExpression;\n\t\t\t\t\tif (invocation == null || invocation.Target != memberRef)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar methodGroup = ctx.Resolve (memberRef) as MethodGroupResolveResult;\n\t\t\t\t\tif (methodGroup == null)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar method = methodGroup.Methods.FirstOrDefault ();\n\t\t\t\t\tif (method != null) {\n\t\t\t\t\t\tvar declaringTypeDef = method.DeclaringTypeDefinition;\n\t\t\t\t\t\tif (declaringTypeDef != null && declaringTypeDef.KnownTypeCode == KnownTypeCode.Object)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tHashSet<AstNode> references;\n\t\t\tHashSet<Statement> refStatements;\n\t\t\tHashSet<LambdaExpression> lambdaExpressions;\n\n\t\t\tHashSet<VariableReferenceNode> visitedNodes;\n\t\t\tHashSet<VariableReferenceNode> collectedNodes;\n\t\t\tDictionary<VariableReferenceNode, int> nodeDegree; // number of enumerations a node can reach\n\n\t\t\tvoid FindReferences (AstNode variableDecl, AstNode rootNode, IVariable variable)\n\t\t\t{\n\t\t\t\treferences = new HashSet<AstNode> ();\n\t\t\t\trefStatements = new HashSet<Statement> ();\n\t\t\t\tlambdaExpressions = new HashSet<LambdaExpression> ();\n\n\t\t\t\tforeach (var result in ctx.FindReferences (rootNode, variable)) {\n\t\t\t\t\tvar astNode = result.Node;\n\t\t\t\t\tif (astNode == variableDecl)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar parent = astNode.Parent;\n\t\t\t\t\twhile (!(parent == null || parent is Statement || parent is LambdaExpression))\n\t\t\t\t\t\tparent = parent.Parent;\n\t\t\t\t\tif (parent == null)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// lambda expression with expression body, should be analyzed separately\n\t\t\t\t\tvar expr = parent as LambdaExpression;\n\t\t\t\t\tif (expr != null) {\n\t\t\t\t\t\tif (IsAssignment (astNode) || IsEnumeration (astNode)) {\n\t\t\t\t\t\t\treferences.Add (astNode);\n\t\t\t\t\t\t\tlambdaExpressions.Add (expr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (IsAssignment (astNode) || IsEnumeration (astNode)) {\n\t\t\t\t\t\treferences.Add (astNode);\n\t\t\t\t\t\tvar statement = (Statement)parent;\n\t\t\t\t\t\trefStatements.Add (statement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CollectIssues (AstNode variableDecl, AstNode rootNode, LocalResolveResult resolveResult)\n\t\t\t{\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar type = resolveResult.Type;\n\t\t\t\tvar typeDef = type.GetDefinition ();\n\t\t\t\tif (typeDef == null ||\n\t\t\t\t    (typeDef.KnownTypeCode != KnownTypeCode.IEnumerable &&\n\t\t\t\t     typeDef.KnownTypeCode != KnownTypeCode.IEnumerableOfT))\n\t\t\t\t\treturn;\n\n\t\t\t\tFindReferences (variableDecl, rootNode, resolveResult.Variable);\n\n\t\t\t\tvar statements = AnalysisStatementCollector.Collect (variableDecl);\n\t\t\t\tvar builder = new VariableReferenceGraphBuilder (ctx);\n\t\t\t\tforeach (var statement in statements) {\n\t\t\t\t\tvar vrNode = builder.Build (statement, references, refStatements, ctx);\n\t\t\t\t\tFindMultipleEnumeration (vrNode);\n\t\t\t\t}\n\t\t\t\tforeach (var lambda in lambdaExpressions) {\n\t\t\t\t\tvar vrNode = builder.Build (references, ctx.Resolver, (Expression)lambda.Body);\n\t\t\t\t\tFindMultipleEnumeration (vrNode);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// split references in the specified node into sub nodes according to the value they uses\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"node\">node to split</param>\n\t\t\t/// <returns>list of sub nodes</returns>\n\t\t\tstatic IList<VariableReferenceNode> SplitNode (VariableReferenceNode node)\n\t\t\t{\n\t\t\t\tvar subNodes = new List<VariableReferenceNode> ();\n\t\t\t\t// find indices of all assignments in node and use them to split references\n\t\t\t\tvar assignmentIndices = new List<int> { -1 };\n\t\t\t\tfor (int i = 0; i < node.References.Count; i++) {\n\t\t\t\t\tif (IsAssignment (node.References [i]))\n\t\t\t\t\t\tassignmentIndices.Add (i);\n\t\t\t\t}\n\t\t\t\tassignmentIndices.Add (node.References.Count);\n\t\t\t\tfor (int i = 0; i < assignmentIndices.Count - 1; i++) {\n\t\t\t\t\tvar index1 = assignmentIndices [i];\n\t\t\t\t\tvar index2 = assignmentIndices [i + 1];\n\t\t\t\t\tif (index1 + 1 >= index2)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar subNode = new VariableReferenceNode ();\n\t\t\t\t\tfor (int refIndex = index1 + 1; refIndex < index2; refIndex++)\n\t\t\t\t\t\tsubNode.References.Add (node.References [refIndex]);\n\t\t\t\t\tsubNodes.Add (subNode);\n\t\t\t\t}\n\t\t\t\tif (subNodes.Count == 0)\n\t\t\t\t\tsubNodes.Add (new VariableReferenceNode ());\n\n\t\t\t\tvar firstNode = subNodes [0];\n\t\t\t\tforeach (var prevNode in node.PreviousNodes) {\n\t\t\t\t\tprevNode.NextNodes.Remove (node);\n\t\t\t\t\t// connect two nodes if the first ref is not an assignment\n\t\t\t\t\tif (firstNode.References.FirstOrDefault () == node.References.FirstOrDefault ())\n\t\t\t\t\t\tprevNode.NextNodes.Add (firstNode);\n\t\t\t\t}\n\n\t\t\t\tvar lastNode = subNodes [subNodes.Count - 1];\n\t\t\t\tforeach (var nextNode in node.NextNodes) {\n\t\t\t\t\tnextNode.PreviousNodes.Remove (node);\n\t\t\t\t\tlastNode.AddNextNode (nextNode);\n\t\t\t\t}\n\n\t\t\t\treturn subNodes;\n\t\t\t}\n\n\t\t\t/// <summary>\n\t\t\t/// convert a variable reference graph starting from the specified node to an assignment usage graph,\n\t\t\t/// in which nodes are connect if and only if they contains references using the same assigned value\n\t\t\t/// </summary>\n\t\t\t/// <param name=\"startNode\">starting node of the variable reference graph</param>\n\t\t\t/// <returns>\n\t\t\t/// list of VariableReferenceNode, each of which is a starting node of a sub-graph in which references all\n\t\t\t/// use the same assigned value\n\t\t\t/// </returns>\n\t\t\tstatic IEnumerable<VariableReferenceNode> GetAssignmentUsageGraph (VariableReferenceNode startNode)\n\t\t\t{\n\t\t\t\tvar graph = new List<VariableReferenceNode> ();\n\t\t\t\tvar visited = new HashSet<VariableReferenceNode> ();\n\t\t\t\tvar stack = new Stack<VariableReferenceNode> ();\n\t\t\t\tstack.Push (startNode);\n\t\t\t\twhile (stack.Count > 0) {\n\t\t\t\t\tvar node = stack.Pop ();\n\t\t\t\t\tif (!visited.Add (node))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar nodes = SplitNode (node);\n\t\t\t\t\tgraph.AddRange (nodes);\n\t\t\t\t\tforeach (var addedNode in nodes)\n\t\t\t\t\t\tvisited.Add (addedNode);\n\n\t\t\t\t\tforeach (var nextNode in nodes.Last ().NextNodes)\n\t\t\t\t\t\tstack.Push (nextNode);\n\t\t\t\t}\n\t\t\t\treturn graph;\n\t\t\t}\n\n\t\t\tvoid FindMultipleEnumeration (VariableReferenceNode startNode)\n\t\t\t{\n\t\t\t\tvar vrg = GetAssignmentUsageGraph (startNode);\n\t\t\t\tvisitedNodes = new HashSet<VariableReferenceNode> ();\n\t\t\t\tcollectedNodes = new HashSet<VariableReferenceNode> ();\n\n\t\t\t\t// degree of a node is the number of references that can be reached by the node\n\t\t\t\tnodeDegree = new Dictionary<VariableReferenceNode, int> ();\n\n\t\t\t\tforeach (var node in vrg) {\n\t\t\t\t\tif (node.References.Count == 0 || !visitedNodes.Add (node))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tProcessNode (node);\n\t\t\t\t\tif (nodeDegree [node] > 1)\n\t\t\t\t\t\tcollectedNodes.Add (node);\n\t\t\t\t}\n\t\t\t\tforeach (var node in collectedNodes)\n\t\t\t\t\tAddIssues (node.References);\n\t\t\t}\n\n\t\t\tvoid ProcessNode (VariableReferenceNode node)\n\t\t\t{\n\t\t\t\tvar degree = nodeDegree [node] = 0;\n\t\t\t\tforeach (var nextNode in node.NextNodes) {\n\t\t\t\t\tcollectedNodes.Add (nextNode);\n\t\t\t\t\tif (visitedNodes.Add (nextNode))\n\t\t\t\t\t\tProcessNode (nextNode);\n\t\t\t\t\tdegree = Math.Max (degree, nodeDegree [nextNode]);\n\t\t\t\t}\n\t\t\t\tnodeDegree [node] = degree + node.References.Count;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/StaticFieldInGenericTypeIssue.cs",
    "content": "//\n// StaticFieldInGenericTypeIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Diagnostics.CodeAnalysis;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Static field in generic type\",\n\t                  Description = \"Warns about static fields in generic types.\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n\t                  SuppressMessageCategory = \"Microsoft.Design\",\n\t                  SuppressMessageCheckId  = \"CA1000:DoNotDeclareStaticMembersOnGenericTypes\",\n                      AnalysisDisableKeyword = \"StaticFieldInGenericType\"\n\t                  )]\n\tpublic class StaticFieldInGenericTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<StaticFieldInGenericTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tIList<ITypeParameter> availableTypeParameters = new List<ITypeParameter>();\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tvar typeResolveResult = ctx.Resolve(typeDeclaration);\n\t\t\t\tvar typeDefinition = typeResolveResult.Type.GetDefinition();\n\t\t\t\tif (typeDefinition == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar newTypeParameters = typeDefinition.TypeParameters;\n\n\t\t\t\tvar oldTypeParameters = availableTypeParameters; \n\t\t\t\tavailableTypeParameters = Concat(availableTypeParameters, newTypeParameters);\n\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\n\t\t\t\tavailableTypeParameters = oldTypeParameters;\n\t\t\t}\n\n\t\t\tstatic IList<ITypeParameter> Concat(params IList<ITypeParameter>[] lists)\n\t\t\t{\n\t\t\t\treturn lists.SelectMany(l => l).ToList();\n\t\t\t}\n\n\t\t\tbool UsesAllTypeParameters(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tif (availableTypeParameters.Count == 0)\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar fieldType = ctx.Resolve(fieldDeclaration.ReturnType).Type as ParameterizedType;\n\t\t\t\tif (fieldType == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\t// Check that all current type parameters are used in the field type\n\t\t\t\tvar fieldTypeParameters = fieldType.TypeArguments;\n\t\t\t\tforeach (var typeParameter in availableTypeParameters) {\n\t\t\t\t\tif (!fieldTypeParameters.Contains(typeParameter))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t\t\tif (fieldDeclaration.Modifiers.HasFlag(Modifiers.Static) && !UsesAllTypeParameters(fieldDeclaration)) {\n\t\t\t\t\tAddIssue(new CodeIssue(fieldDeclaration, ctx.TranslateString(\"Static field in generic type\")));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/ThreadStaticAtInstanceFieldIssue.cs",
    "content": "//\n// ThreadStaticAtInstanceFieldIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n    [IssueDescription(\"[ThreadStatic] doesn't work with instance fields\",\n                      Description = \"[ThreadStatic] doesn't work with instance fields\",\n\t                  Category = IssueCategories.CodeQualityIssues,\n\t                  Severity = Severity.Warning,\n                      AnalysisDisableKeyword = \"ThreadStaticAtInstanceField\")]\n\tpublic class ThreadStaticAtInstanceFieldIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<ThreadStaticAtInstanceFieldIssue>\n\t\t{\n\t\t\tIType threadStaticAttribute;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t\tthreadStaticAttribute = ctx.Compilation.FindType(typeof(ThreadStaticAttribute));\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n                if (fieldDeclaration.HasModifier(Modifiers.Static))\n                    return;\n\n                foreach (var attributeSection in fieldDeclaration.Attributes) {\n\t\t\t\t\tint attributeCount = attributeSection.Attributes.Count;\n\t\t\t\t\tforeach (var attribute in attributeSection.Attributes) {\n\t\t\t\t\t\tvar resolvedAttribute = ctx.Resolve(attribute.Type) as TypeResolveResult;\n\t\t\t\t\t\tif (resolvedAttribute == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (threadStaticAttribute.Equals(resolvedAttribute.Type)) {\n\t\t\t\t\t\t\tstring title = ctx.TranslateString(\"ThreadStatic does nothing on instance fields\");\n\t\t\t\t\t\t\tif (attributeCount == 1)\n\t\t\t\t\t\t\t\tAddIssue(new CodeIssue(attributeSection, title, GetActions(attribute, attributeSection, fieldDeclaration)));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tAddIssue(new CodeIssue(attribute, title, GetActions(attribute, attributeSection, fieldDeclaration)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIEnumerable<CodeAction> GetActions(Attribute attribute, AttributeSection attributeSection, FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tstring removeAttributeMessage = ctx.TranslateString(\"Remove attribute\");\n\t\t\t\tyield return new CodeAction(removeAttributeMessage, script => {\n\t\t\t\t\tif (attributeSection.Attributes.Count > 1) {\n\t\t\t\t\t\tvar newSection = new AttributeSection();\n\t\t\t\t\t\tnewSection.AttributeTarget = attributeSection.AttributeTarget;\n\t\t\t\t\t\tforeach (var attr in attributeSection.Attributes) {\n\t\t\t\t\t\t\tif (attr != attribute)\n\t\t\t\t\t\t\t\tnewSection.Attributes.Add((Attribute)attr.Clone());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscript.Replace(attributeSection, newSection);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscript.Remove(attributeSection);\n\t\t\t\t\t}\n\t\t\t\t}, attribute);\n\n\t\t\t\tvar makeStaticMessage = ctx.TranslateString(\"Make the field static\");\n\t\t\t\tyield return new CodeAction(makeStaticMessage, script => {\n\t\t\t\t\tvar newDeclaration = (FieldDeclaration)fieldDeclaration.Clone();\n\t\t\t\t\tnewDeclaration.Modifiers |= Modifiers.Static;\n\t\t\t\t\tscript.Replace(fieldDeclaration, newDeclaration);\n\t\t\t\t}, fieldDeclaration.NameToken);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CodeQuality/ValueParameterNotUsedIssue.cs",
    "content": "//\n// SetterDoesNotUseValueParameterTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'value' parameter not used\",\n\t       Description = \"Warns about property or indexer setters and event adders or removers that do not use the value parameter.\",\n\t       Category = IssueCategories.CodeQualityIssues,\n\t       Severity = Severity.Warning,\n           AnalysisDisableKeyword = \"ValueParameterNotUsed\")]\n\tpublic class ValueParameterNotUsedIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<ValueParameterNotUsedIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context, ValueParameterNotUsedIssue inspector) : base (context)\n\t\t\t{\n\t\t\t}\n\n            public override void VisitAccessor(Accessor accessor)\n\t\t    {\n\t\t        if (accessor.Role == PropertyDeclaration.SetterRole) {\n                    FindIssuesInAccessor(accessor, ctx.TranslateString(\"The setter does not use the 'value' parameter\"));\n                } else if (accessor.Role == CustomEventDeclaration.AddAccessorRole) {\n                    FindIssuesInAccessor(accessor, ctx.TranslateString(\"The add accessor does not use the 'value' parameter\"));\n                } else if (accessor.Role == CustomEventDeclaration.RemoveAccessorRole) {\n                    FindIssuesInAccessor(accessor, ctx.TranslateString(\"The remove accessor does not use the 'value' parameter\"));\n                }\n\t\t    }\n\n\t\t    public override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t    {\n                if (eventDeclaration.AddAccessor.Body.Statements.Count == 0 && eventDeclaration.RemoveAccessor.Body.Statements.Count == 0)\n                    return;\n\t\t        \n\t\t        base.VisitCustomEventDeclaration(eventDeclaration);\n\t\t    }\n\n\t\t    void FindIssuesInAccessor(Accessor accessor, string accessorName)\n\t\t\t{\n\t\t\t\tvar body = accessor.Body;\n\t\t\t\tif (!IsEligible(body))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar localResolveResult = ctx.GetResolverStateBefore(body)\n\t\t\t\t\t.LookupSimpleNameOrTypeName(\"value\", new List<IType>(), NameLookupMode.Expression) as LocalResolveResult; \n\t\t\t\tif (localResolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tbool referenceFound = false;\n\t\t\t\tforeach (var result in ctx.FindReferences (body, localResolveResult.Variable)) {\n\t\t\t\t\tvar node = result.Node;\n\t\t\t\t\tif (node.StartLocation >= body.StartLocation && node.EndLocation <= body.EndLocation) {\n\t\t\t\t\t\treferenceFound = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(!referenceFound)\n\t\t\t\t\tAddIssue(new CodeIssue(accessor.Keyword, accessorName));\n\t\t\t}\n\n\t\t\tstatic bool IsEligible(BlockStatement body)\n\t\t\t{\n\t\t\t\tif (body == null || body.IsNull)\n\t\t\t\t\treturn false;\n\t\t\t\tif (body.Statements.FirstOrNullObject() is ThrowStatement)\n\t\t\t\t\treturn false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CompilerErrors/ProhibitedModifiersIssue.cs",
    "content": "//\n// ProhibitedModifiersIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Checks for prohibited modifiers\",\n\t\tDescription = \"Checks for prohibited modifiers\",\n\t\tCategory = IssueCategories.CompilerErrors,\n\t\tSeverity = Severity.Error)]\n\tpublic class ProhibitedModifiersIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ProhibitedModifiersIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\treadonly Stack<TypeDeclaration> curType = new Stack<TypeDeclaration> ();\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tcurType.Push(typeDeclaration); \n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tcurType.Pop();\n\t\t\t}\n\n\t\t\tvoid AddStaticRequiredError (EntityDeclaration entity, AstNode node)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tnode,\n\t\t\t\t\tctx.TranslateString(\"'static' modifier is required inside a static class\"),\n\t\t\t\t\tctx.TranslateString(\"Add 'static' modifier\"), \n\t\t\t\t\ts => {\n\t\t\t\t\t\ts.ChangeModifier(entity, (entity.Modifiers & ~(Modifiers.Virtual | Modifiers.Override)) | Modifiers.Static);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tvoid CheckStaticRequired(EntityDeclaration entity)\n\t\t\t{\n\t\t\t\tif (!curType.Peek().HasModifier(Modifiers.Static) || entity.HasModifier(Modifiers.Static) || entity.HasModifier(Modifiers.Const))\n\t\t\t\t\treturn;\n\t\t\t\tvar fd = entity as FieldDeclaration;\n\t\t\t\tif (fd != null) {\n\t\t\t\t\tforeach (var init in fd.Variables)\n\t\t\t\t\t\tAddStaticRequiredError(entity, init.NameToken);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar ed = entity as EventDeclaration;\n\t\t\t\tif (ed != null) {\n\t\t\t\t\tforeach (var init in ed.Variables)\n\t\t\t\t\t\tAddStaticRequiredError(entity, init.NameToken);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tAddStaticRequiredError(entity, entity.NameToken);\n\t\t\t}\n\n\t\t\tvoid CheckVirtual(EntityDeclaration entity)\n\t\t\t{\n\t\t\t\tif (!curType.Peek().HasModifier(Modifiers.Static) && !curType.Peek().HasModifier(Modifiers.Sealed) && entity.HasModifier(Modifiers.Virtual)) {\n\t\t\t\t\tif (!entity.HasModifier(Modifiers.Public) && !entity.HasModifier(Modifiers.Protected)  && !entity.HasModifier(Modifiers.Internal)) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tentity.NameToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"'virtual' members can't be private\")\n\t\t\t\t\t\t));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (entity.HasModifier(Modifiers.Sealed) && !entity.HasModifier(Modifiers.Override)) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tentity.ModifierTokens.First(t => t.Modifier == Modifiers.Sealed),\n\t\t\t\t\t\tctx.TranslateString(\"'sealed' modifier is not usable without override\"),\n\t\t\t\t\t\tctx.TranslateString(\"Remove 'sealed' modifier\"), \n\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\ts.ChangeModifier(entity, entity.Modifiers & ~Modifiers.Sealed);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\n\t\t\t\t}\n\n\t\t\t\tif (!curType.Peek().HasModifier(Modifiers.Sealed) || !entity.HasModifier(Modifiers.Virtual))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tentity.ModifierTokens.First(t => t.Modifier == Modifiers.Virtual),\n\t\t\t\t\tctx.TranslateString(\"'virtual' modifier is not usable in a sealed class\"),\n\t\t\t\t\tctx.TranslateString(\"Remove 'virtual' modifier\"), \n\t\t\t\t\ts => s.ChangeModifier(entity, entity.Modifiers & ~Modifiers.Virtual)\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tCheckStaticRequired(methodDeclaration);\n\t\t\t\tCheckVirtual(methodDeclaration);\n\t\t\t\tif (methodDeclaration.IsExtensionMethod) {\n\t\t\t\t\tvar parent = methodDeclaration.Parent as TypeDeclaration;\n\t\t\t\t\tif (parent != null && !parent.HasModifier(Modifiers.Static)) {\n\t\t\t\t\t\tvar actions = new List<CodeAction>();\n\t\t\t\t\t\tvar token = methodDeclaration.Parameters.First().FirstChild;\n\t\t\t\t\t\tactions.Add(new CodeAction(\n\t\t\t\t\t\t\tctx.TranslateString(\"Make class 'static'\"),\n\t\t\t\t\t\t\ts => s.ChangeModifier(parent, (parent.Modifiers & ~Modifiers.Sealed) | Modifiers.Static),\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\tactions.Add(new CodeAction(\n\t\t\t\t\t\t\tctx.TranslateString(\"Remove 'this'\"),\n\t\t\t\t\t\t\ts => s.ChangeModifier(methodDeclaration.Parameters.First(), ParameterModifier.None),\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\ttoken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Extension methods are only allowed in static classes\"),\n\t\t\t\t\t\t\tactions\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tCheckStaticRequired(fieldDeclaration);\n\t\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t\tCheckStaticRequired(fixedFieldDeclaration);\n\t\t\t\tbase.VisitFixedFieldDeclaration(fixedFieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tCheckStaticRequired(eventDeclaration);\n\t\t\t\tbase.VisitEventDeclaration(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tCheckStaticRequired(eventDeclaration);\n\t\t\t\tCheckVirtual(eventDeclaration);\n\t\t\t\tbase.VisitCustomEventDeclaration(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tCheckStaticRequired(constructorDeclaration);\n\n\t\t\t\tif (constructorDeclaration.HasModifier(Modifiers.Static)) {\n\t\t\t\t\tif ((constructorDeclaration.Modifiers & Modifiers.Static) != 0) {\n\t\t\t\t\t\tforeach (var mod in constructorDeclaration.ModifierTokens) {\n\t\t\t\t\t\t\tif (mod.Modifier == Modifiers.Static)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\t\tmod,\n\t\t\t\t\t\t\t\tctx.TranslateString(\"Static constructors can't have any other modifier\"),\n\t\t\t\t\t\t\t\tctx.TranslateString(\"Remove prohibited modifier\"), \n\t\t\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\t\t\ts.ChangeModifier(constructorDeclaration, Modifiers.Static);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitDestructorDeclaration(destructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tCheckStaticRequired(propertyDeclaration);\n\t\t\t\tCheckVirtual(propertyDeclaration);\n\t\t\t\tbase.VisitPropertyDeclaration(propertyDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tCheckVirtual(indexerDeclaration);\n\t\t\t\tbase.VisitIndexerDeclaration(indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CompilerWarnings/CS0183ExpressionIsAlwaysOfProvidedTypeIssue.cs",
    "content": "﻿// \n// ExpressionIsAlwaysOfProvidedTypeIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"CS0183:Given expression is always of the provided type\",\n\t\tDescription = \"CS0183:Given expression is always of the provided type.\",\n\t\tCategory = IssueCategories.CompilerWarnings,\n\t\tSeverity = Severity.Warning,\n\t\tPragmaWarning = 183,\n\t\tAnalysisDisableKeyword = \"CSharpWarnings::CS0183\"\n\t)]\n\tpublic class CS0183ExpressionIsAlwaysOfProvidedTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS0183ExpressionIsAlwaysOfProvidedTypeIssue>\n\t\t{\n\t\t\treadonly CSharpConversions conversions;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tconversions = CSharpConversions.Get(ctx.Compilation);\n\t\t\t}\n\n\t\t\tpublic override void VisitIsExpression(IsExpression isExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIsExpression(isExpression);\n\n\t\t\t\tvar type = ctx.Resolve(isExpression.Expression).Type;\n\t\t\t\tvar providedType = ctx.ResolveType(isExpression.Type);\n\n\t\t\t\tif (type.Kind == TypeKind.Unknown || providedType.Kind == TypeKind.Unknown)\n\t\t\t\t\treturn;\n//\t\t\t\tvar foundConversion = conversions.ImplicitConversion(type, providedType);\n\t\t\t\tif (!IsValidReferenceOrBoxingConversion(type, providedType))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar action = new CodeAction(\n\t\t\t\t\t             ctx.TranslateString(\"Compare with 'null'\"), \n\t\t\t\t\t             script => script.Replace(isExpression, new BinaryOperatorExpression(\n\t\t\t\t\t\t             isExpression.Expression.Clone(), BinaryOperatorType.InEquality, new PrimitiveExpression(null))),\n\t\t\t\t\t             isExpression\n\t\t\t\t             );\n\t\t\t\tAddIssue(new CodeIssue(isExpression, ctx.TranslateString(\"Given expression is always of the provided type. Consider comparing with 'null' instead\"), new [] { action }));\n\t\t\t}\n\n\t\t\tbool IsValidReferenceOrBoxingConversion(IType fromType, IType toType)\n\t\t\t{\n\t\t\t\tConversion c = conversions.ImplicitConversion(fromType, toType);\n\t\t\t\treturn c.IsValid && (c.IsIdentityConversion || c.IsReferenceConversion || c.IsBoxingConversion);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CompilerWarnings/CS1573ParameterHasNoMatchingParamTagIssue.cs",
    "content": "//\n// CS1573ParameterHasNoMatchingParamTagIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\nusing System.Text;\nusing System.Xml;\nusing System.IO;\nusing ICSharpCode.NRefactory.Documentation;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Parameter has no matching param tag in the XML comment\",\n\t                  Description = \"Parameter has no matching param tag in the XML comment\",\n\t                  Category = IssueCategories.CompilerWarnings,\n\t                  Severity = Severity.Warning,\n\t                  PragmaWarning = 1573,\n\t                  AnalysisDisableKeyword = \"CSharpWarnings::CS1573\")]\n\tpublic class CS1573ParameterHasNoMatchingParamTagIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS1573ParameterHasNoMatchingParamTagIssue>\n\t\t{\n\t\t\treadonly List<Comment> storedXmlComment = new List<Comment>();\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid InvalideXmlComments()\n\t\t\t{\n\t\t\t\tstoredXmlComment.Clear();\n\t\t\t}\n\n\t\t\tpublic override void VisitComment(Comment comment)\n\t\t\t{\n\t\t\t\tbase.VisitComment(comment);\n\t\t\t\tif (comment.CommentType == CommentType.Documentation)\n\t\t\t\t\tstoredXmlComment.Add(comment);\n\t\t\t}\n\n\t\t\tpublic override void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitNamespaceDeclaration(namespaceDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitUsingDeclaration(usingDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitUsingAliasDeclaration(UsingAliasDeclaration usingDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitUsingAliasDeclaration(usingDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration)\n\t\t\t{\n\t\t\t\tInvalideXmlComments();\n\t\t\t\tbase.VisitExternAliasDeclaration(externAliasDeclaration);\n\t\t\t}\n\n\t\t\tvoid AddXmlIssue(int line, int col, int length, string str)\n\t\t\t{\n\t\t\t\tvar cmt = storedXmlComment [Math.Max(0, Math.Min(storedXmlComment.Count - 1, line))];\n\n\t\t\t\tAddIssue(new CodeIssue(new TextLocation(cmt.StartLocation.Line, cmt.StartLocation.Column + 3 + col),\n\t\t\t\t         new TextLocation(cmt.StartLocation.Line, cmt.StartLocation.Column + 3 + col + length),\n\t\t\t\t\tstr));\n\t\t\t}\n\n\t\t\tint SearchAttributeColumn(int x, int line)\n\t\t\t{\n\t\t\t\tvar comment = storedXmlComment [Math.Max(0, Math.Min(storedXmlComment.Count - 1, line))];\n\t\t\t\tvar idx = comment.Content.IndexOfAny(new char[] { '\"', '\\'' }, x);\n\t\t\t\treturn idx < 0 ? x : idx + 1;\n\t\t\t}\n\n\t\t\tvoid CheckXmlDoc(AstNode node)\n\t\t\t{\n\t\t\t\tResolveResult resolveResult = ctx.Resolve(node);\n\t\t\t\tIEntity member = null;\n\t\t\t\tif (resolveResult is TypeResolveResult)\n\t\t\t\t\tmember = resolveResult.Type.GetDefinition();\n\t\t\t\tif (resolveResult is MemberResolveResult)\n\t\t\t\t\tmember = ((MemberResolveResult)resolveResult).Member;\n\t\t\t\tvar xml = new StringBuilder();\n\t\t\t\txml.AppendLine(\"<root>\");\n\t\t\t\tforeach (var cmt in storedXmlComment)\n\t\t\t\t\txml.AppendLine(cmt.Content);\n\t\t\t\txml.AppendLine(\"</root>\");\n\n\t\t\t\tList<Tuple<string, int>> parameters = new List<Tuple<string, int>>();\n\n\t\t\t\tusing (var reader = new XmlTextReader(new StringReader(xml.ToString()))) {\n\t\t\t\t\treader.XmlResolver = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\twhile (reader.Read()) {\n\t\t\t\t\t\t\tif (member == null)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tif (reader.NodeType == XmlNodeType.Element) {\n\t\t\t\t\t\t\t\tswitch (reader.Name) {\n\t\t\t\t\t\t\t\t\tcase \"param\":\n\t\t\t\t\t\t\t\t\t\treader.MoveToFirstAttribute();\n\t\t\t\t\t\t\t\t\t\tvar line = reader.LineNumber;\n\t\t\t\t\t\t\t\t\t\tvar name = reader.GetAttribute(\"name\");\n\t\t\t\t\t\t\t\t\t\tif (name == null)\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tparameters.Add(Tuple.Create(name, line));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (XmlException) {\n\t\t\t\t\t}\n\n\t\t\t\t\tif (storedXmlComment.Count > 0 && parameters.Count > 0) {\n\t\t\t\t\t\tvar pm = member as IParameterizedMember;\n\t\t\t\t\t\tif (pm != null) {\n\t\t\t\t\t\t\tfor (int i = 0; i < pm.Parameters.Count; i++) {\n\t\t\t\t\t\t\t\tvar p = pm.Parameters [i];\n\t\t\t\t\t\t\t\tif (!parameters.Any(tp => tp.Item1 == p.Name)) {\n\t\t\t\t\t\t\t\t\tAstNode before = i < parameters.Count ? storedXmlComment [parameters [i].Item2 - 2] : null;\n\t\t\t\t\t\t\t\t\tAstNode afterNode = before == null ? storedXmlComment [storedXmlComment.Count - 1] : null;\n\t\t\t\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\t\t\t\tGetParameterHighlightNode(node, i),\n\t\t\t\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Missing xml documentation for Parameter '{0}'\"), p.Name),\n\t\t\t\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Create xml documentation for Parameter '{0}'\"), p.Name),\n\t\t\t\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\t\t\tif (before != null) {\n\t\t\t\t\t\t\t\t\t\t\tscript.InsertBefore(\n\t\t\t\t\t\t\t\t\t\t\t\tbefore, \n\t\t\t\t\t\t\t\t\t\t\t\tnew Comment(string.Format(\" <param name = \\\"{0}\\\"></param>\", p.Name), CommentType.Documentation)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tscript.InsertAfter(\n\t\t\t\t\t\t\t\t\t\t\t\tafterNode, \n\t\t\t\t\t\t\t\t\t\t\t\tnew Comment(string.Format(\" <param name = \\\"{0}\\\"></param>\", p.Name), CommentType.Documentation)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tstoredXmlComment.Clear();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAstNode GetParameterHighlightNode(AstNode node, int i)\n\t\t\t{\n\t\t\t\tif (node is MethodDeclaration)\n\t\t\t\t\treturn ((MethodDeclaration)node).Parameters.ElementAt(i).NameToken;\n\t\t\t\tif (node is ConstructorDeclaration)\n\t\t\t\t\treturn ((ConstructorDeclaration)node).Parameters.ElementAt(i).NameToken;\n\t\t\t\tif (node is OperatorDeclaration)\n\t\t\t\t\treturn ((OperatorDeclaration)node).Parameters.ElementAt(i).NameToken;\n\t\t\t\tif (node is IndexerDeclaration)\n\t\t\t\t\treturn ((IndexerDeclaration)node).Parameters.ElementAt(i).NameToken;\n\t\t\t\tthrow new InvalidOperationException(\"invalid parameterized node:\" + node);\n\t\t\t}\n\n\t\t\tprotected virtual void VisitXmlChildren(AstNode node)\n\t\t\t{\n\t\t\t\tAstNode next;\n\t\t\t\tvar child = node.FirstChild;\n\t\t\t\twhile (child != null && (child is Comment || child is PreProcessorDirective || child.Role == Roles.NewLine)) {\n\t\t\t\t\tnext = child.NextSibling;\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t\tchild = next;\n\t\t\t\t}\n\n\t\t\t\tCheckXmlDoc(node);\n\n\t\t\t\tfor (; child != null; child = next) {\n\t\t\t\t\t// Store next to allow the loop to continue\n\t\t\t\t\t// if the visitor removes/replaces child.\n\t\t\t\t\tnext = child.NextSibling;\n\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t}\n\t\t\t\tInvalideXmlComments();\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(typeDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(delegateDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(constructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(destructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(enumMemberDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(fieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(propertyDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tVisitXmlChildren(operatorDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CompilerWarnings/CS1717AssignmentMadeToSameVariableIssue.cs",
    "content": "﻿// \n// CS1717AssignmentMadeToSameVariableIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n    [IssueDescription(\"CS1717:Assignment made to same variable\",\n\t\t\t\t\t   Description = \"CS1717:Assignment made to same variable.\",\n\t\t\t\t\t   Category = IssueCategories.CompilerWarnings,\n\t\t\t\t\t   Severity = Severity.Warning,\n                       PragmaWarning = 1717,\n                       AnalysisDisableKeyword = \"CSharpWarnings::CS1717\")]\n    public class CS1717AssignmentMadeToSameVariableIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<CS1717AssignmentMadeToSameVariableIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression (AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression (assignmentExpression);\n\n\t\t\t\tif (assignmentExpression.Operator != AssignmentOperatorType.Assign)\n\t\t\t\t\treturn;\n\t\t\t\tif (!(assignmentExpression.Left is IdentifierExpression) && \n\t\t\t\t\t!(assignmentExpression.Left is MemberReferenceExpression))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar resolveResult = ctx.Resolve (assignmentExpression.Left);\n\t\t\t\tvar memberResolveResult = resolveResult as MemberResolveResult;\n\t\t\t\tif (memberResolveResult != null) {\n\t\t\t\t\tvar memberResolveResult2 = ctx.Resolve (assignmentExpression.Right) as MemberResolveResult;\n\t\t\t\t\tif (memberResolveResult2 == null || !AreEquivalent(memberResolveResult, memberResolveResult2))\n\t\t\t\t\t\treturn;\n\t\t\t\t} else if (resolveResult is LocalResolveResult) {\n\t\t\t\t\tif (!assignmentExpression.Left.Match (assignmentExpression.Right).Success)\n\t\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tAstNode node;\n\t\t\t\tAction<Script> action;\n\t\t\t\tif (assignmentExpression.Parent is ExpressionStatement) {\n\t\t\t\t\tnode = assignmentExpression.Parent;\n\t\t\t\t\taction = script => script.Remove (assignmentExpression.Parent);\n\t\t\t\t} else {\n\t\t\t\t\tnode = assignmentExpression;\n\t\t\t\t\taction = script => script.Replace (assignmentExpression, assignmentExpression.Left.Clone ());\n\t\t\t\t}\n\t\t\t\tAddIssue (new CodeIssue(node, ctx.TranslateString (\"CS1717:Assignment made to same variable\"),\n\t\t\t\t\tnew [] { new CodeAction (ctx.TranslateString (\"Remove assignment\"), action, node) })\n\t\t\t\t\t{ IssueMarker = IssueMarker.GrayOut }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tstatic bool AreEquivalent(ResolveResult first, ResolveResult second)\n\t\t\t{\n\t\t\t\tvar firstPath = AccessPath.FromResolveResult(first);\n\t\t\t\tvar secondPath = AccessPath.FromResolveResult(second);\n\t\t\t\treturn firstPath != null && firstPath.Equals(secondPath) && !firstPath.MemberPath.Any(m => !(m is IField));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/CompilerWarnings/UnassignedReadonlyFieldIssue.cs",
    "content": "//\n// UnassignedReadonlyFieldIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing System.Linq;\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Unassigned readonly field\",\n\t                  Description = \"Unassigned readonly field\",\n\t                  Category = IssueCategories.CompilerWarnings,\n\t                  Severity = Severity.Warning,\n\t                  PragmaWarning = 649,\n\t                  AnalysisDisableKeyword = \"UnassignedReadonlyField.Compiler\")]\n\tpublic class UnassignedReadonlyFieldIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UnassignedReadonlyFieldIssue>\n\t\t{\n\t\t\treadonly Stack<List<Tuple<VariableInitializer, IVariable>>> fieldStack = new Stack<List<Tuple<VariableInitializer, IVariable>>>();\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid Collect()\n\t\t\t{\n\t\t\t\tforeach (var varDecl in fieldStack.Peek()) {\n\t\t\t\t\tvar resolveResult = ctx.Resolve(varDecl.Item1) as MemberResolveResult;\n\t\t\t\t\tif (resolveResult == null || resolveResult.IsError)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tvarDecl.Item1.NameToken,\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Readonly field '{0}' is never assigned\"), varDecl.Item1.Name),\n\t\t\t\t\t\tctx.TranslateString(\"Initialize field from constructor parameter\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.InsertWithCursor(\n\t\t\t\t\t\t\tctx.TranslateString(\"Create constructor\"),\n\t\t\t\t\t\t\tresolveResult.Member.DeclaringTypeDefinition,\n\t\t\t\t\t\t\t(s, c) => {\n\t\t\t\t\t\t\treturn new ConstructorDeclaration {\n\t\t\t\t\t\t\t\tName = resolveResult.Member.DeclaringTypeDefinition.Name,\n\t\t\t\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\t\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\t\t\t\t\t\t\tnew MemberReferenceExpression(new ThisReferenceExpression(), varDecl.Item1.Name),\n\t\t\t\t\t\t\t\t\t\t\tnew IdentifierExpression(varDecl.Item1.Name)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tParameters = {\n\t\t\t\t\t\t\t\t\tnew ParameterDeclaration(c.CreateShortType(resolveResult.Type), varDecl.Item1.Name)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tvar list = new List<Tuple<VariableInitializer, IVariable>>();\n\t\t\t\tfieldStack.Push(list);\n\t\t\t\tforeach (var fieldDeclaration in ConvertToConstantIssue.CollectFields(this, typeDeclaration)) {\n\t\t\t\t\tif (!fieldDeclaration.HasModifier(Modifiers.Readonly))\n\t\t\t\t\t\tcontinue;\n//\t\t\t\t\tvar rr = ctx.Resolve(fieldDeclaration.ReturnType);\n\t\t\t\t\n\t\t\t\t\tif (fieldDeclaration.Variables.Count() > 1)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (!fieldDeclaration.Variables.First().Initializer.IsNull)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar variable = fieldDeclaration.Variables.First();\n\t\t\t\t\tvar mr = ctx.Resolve(variable) as MemberResolveResult;\n\t\t\t\t\tif (mr == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tlist.Add(Tuple.Create(variable, mr.Member as IVariable)); \n\t\t\t\t}\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tCollect();\n\t\t\t\tfieldStack.Pop();\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\tvar assignmentAnalysis = new ConvertToConstantIssue.VariableUsageAnalyzation(ctx);\n\t\t\t\tvar newVars = new List<Tuple<VariableInitializer, IVariable>>();\n\t\t\t\tblockStatement.AcceptVisitor(assignmentAnalysis); \n\t\t\t\tforeach (var variable in fieldStack.Pop()) {\n\t\t\t\t\tif (assignmentAnalysis.GetStatus(variable.Item2) == VariableState.Changed)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tnewVars.Add(variable);\n\t\t\t\t}\n\t\t\t\tfieldStack.Push(newVars);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/AffectedEntity.cs",
    "content": "// \n// AffectedEntity.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[Flags]\n\tpublic enum AffectedEntity\n\t{\n\t\tNone,\n\n\t\tNamespace = 1 << 0,\n\n\t\tClass     = 1 << 1,\n\t\tStruct    = 1 << 2,\n\t\tEnum      = 1 << 3,\n\t\tInterface = 1 << 4,\n\t\tDelegate  = 1 << 5,\n\n\t\tCustomAttributes = 1 << 6,\n\t\tCustomEventArgs  = 1 << 7,\n\t\tCustomExceptions = 1 << 8,\n\n\t\tProperty      = 1 << 9,\n\t\tMethod        = 1 << 10,\n\t\tAsyncMethod   = 1 << 11,\n\t\tField         = 1 << 12,\n\t\tReadonlyField = 1 << 13,\n\t\tConstantField = 1 << 14,\n\n\t\tEvent      = 1 << 15,\n\t\tEnumMember = 1 << 16,\n\n\t\tParameter     = 1 << 17,\n\t\tTypeParameter = 1 << 18,\n\n\t\t// Unit test special case\n\t\tTestType   = 1 << 19,\n\t\tTestMethod = 1 << 20,\n\n\t\t// private entities\n\t\tLambdaParameter = 1 << 21,\n\t\tLocalVariable   = 1 << 22,\n\t\tLocalConstant   = 1 << 23,\n\t\tLabel           = 1 << 24,\n\n\t\tLocalVars = LocalVariable | Parameter | LambdaParameter | LocalConstant,\n\t\tMethods = Method | AsyncMethod,\n\t\tFields = Field | ReadonlyField | ConstantField,\n\t\tMember = Property | Methods | Fields | Event | EnumMember,\n\t\t\n\t\tType = Class | Struct | Enum | Interface | Delegate,\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/DefaultRules.cs",
    "content": "﻿// \n// DefaultRules.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic static class DefaultRules\n\t{\n\t\tpublic static IEnumerable<NamingRule> GetFdgRules()\n\t\t{\n\t\t\tyield return new NamingRule(AffectedEntity.Namespace) {\n\t\t\t\tName = \"Namespaces\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase\n\t\t\t};\n\t\t\t\n\t\t\tyield return new NamingRule(AffectedEntity.Class | AffectedEntity.Struct | AffectedEntity.Enum | AffectedEntity.Delegate) {\n\t\t\t\tName = \"Types\",\n\t\t\t\tVisibilityMask = Modifiers.Public,\n\t\t\t\tNamingStyle = NamingStyle.PascalCase\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.Interface) {\n\t\t\t\tName = \"Interfaces\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tVisibilityMask = Modifiers.Public,\n\t\t\t\tRequiredPrefixes = new [] { \"I\" }\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.CustomAttributes) {\n\t\t\t\tName = \"Attributes\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tVisibilityMask = Modifiers.Public,\n\t\t\t\tRequiredSuffixes = new [] { \"Attribute\" }\n\t\t\t};\n\t\t\t\n\t\t\tyield return new NamingRule(AffectedEntity.CustomEventArgs) {\n\t\t\t\tName = \"Event Arguments\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tVisibilityMask = Modifiers.Public,\n\t\t\t\tRequiredSuffixes = new [] { \"EventArgs\" }\n\t\t\t};\n\t\t\t\n\t\t\tyield return new NamingRule(AffectedEntity.CustomExceptions) {\n\t\t\t\tName = \"Exceptions\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tRequiredSuffixes = new [] { \"Exception\" }\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.Methods) {\n\t\t\t\tName = \"Methods\",\n\t\t\t\tVisibilityMask = Modifiers.Public | Modifiers.Protected,\n\t\t\t\tNamingStyle = NamingStyle.PascalCase\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.ReadonlyField) {\n\t\t\t\tName = \"Static Readonly Fields\",\n\t\t\t\tVisibilityMask = Modifiers.Public | Modifiers.Protected,\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tIncludeInstanceMembers = false\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.Field) {\n\t\t\t\tName = \"Fields\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tVisibilityMask = Modifiers.Public | Modifiers.Protected\n\t\t\t};\n\t\t\t\n\t\t\tyield return new NamingRule(AffectedEntity.ReadonlyField) {\n\t\t\t\tName = \"ReadOnly Fields\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tVisibilityMask = Modifiers.Public | Modifiers.Protected,\n\t\t\t\tIncludeStaticEntities = false\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.ConstantField) {\n\t\t\t\tName = \"Constant Fields\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tVisibilityMask = Modifiers.Public | Modifiers.Protected\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.Property) {\n\t\t\t\tName = \"Properties\",\n\t\t\t\tVisibilityMask = Modifiers.Public | Modifiers.Protected,\n\t\t\t\tNamingStyle = NamingStyle.PascalCase\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.Event) {\n\t\t\t\tName = \"Events\",\n\t\t\t\tVisibilityMask = Modifiers.Public | Modifiers.Protected,\n\t\t\t\tNamingStyle = NamingStyle.PascalCase\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.EnumMember) {\n\t\t\t\tName = \"Enum Members\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.Parameter) {\n\t\t\t\tName = \"Parameters\",\n\t\t\t\tNamingStyle = NamingStyle.CamelCase\n\t\t\t};\n\n\t\t\tyield return new NamingRule(AffectedEntity.TypeParameter) {\n\t\t\t\tName = \"Type Parameters\",\n\t\t\t\tNamingStyle = NamingStyle.PascalCase,\n\t\t\t\tRequiredPrefixes = new [] { \"T\" }\n\t\t\t};\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/InconsistentNamingIssue.cs",
    "content": "﻿// \n// InconsistentNamingIssue.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Inconsistent Naming\",\n\t       Description = \"Name doesn't match the defined style for this entity.\",\n           Category = IssueCategories.ConstraintViolations,\n\t       Severity = Severity.Warning,\n           AnalysisDisableKeyword = \"InconsistentNaming\")]\n\tpublic class InconsistentNamingIssue : CodeIssueProvider\n\t{\n\t\tpublic override IEnumerable<CodeIssue> GetIssues(BaseRefactoringContext context, string subIssue)\n\t\t{\n\t\t\tvar visitor = new GatherVisitor(context);\n\t\t\tcontext.RootNode.AcceptVisitor(visitor);\n\t\t\treturn visitor.FoundIssues;\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<InconsistentNamingIssue>\n\t\t{\n\t\t\treadonly NamingConventionService service;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t\tservice = (NamingConventionService)ctx.GetService (typeof (NamingConventionService));\n\t\t\t}\n\n\t\t\tvoid CheckName(TypeDeclaration node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)\n\t\t\t{\n\t\t\t\tTypeResolveResult resolveResult = ctx.Resolve(node) as TypeResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar type = resolveResult.Type;\n\t\t\t\tif (type.DirectBaseTypes.Any(t => t.FullName == \"System.Attribute\")) {\n\t\t\t\t\tif (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomAttributes, identifier, accessibilty)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else if (type.DirectBaseTypes.Any(t => t.FullName == \"System.EventArgs\")) {\n\t\t\t\t\tif (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomEventArgs, identifier, accessibilty)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else if (type.DirectBaseTypes.Any(t => t.FullName == \"System.Exception\")) {\n\t\t\t\t\tif (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomExceptions, identifier, accessibilty)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar typeDef = type.GetDefinition();\n\t\t\t\tif (typeDef != null && typeDef.Attributes.Any(attr => attr.AttributeType.FullName == \"NUnit.Framework.TestFixtureAttribute\")) {\n\t\t\t\t\tif (CheckNamedResolveResult(resolveResult, node, AffectedEntity.TestType, identifier, accessibilty)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tCheckNamedResolveResult(resolveResult, node, entity, identifier, accessibilty);\n\t\t\t}\n\n\t\t\tvoid CheckName(MethodDeclaration node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)\n\t\t\t{\n\t\t\t\tResolveResult resolveResult = null;\n\t\t\t\tif (node != null && node.Attributes.Any ())\n\t\t\t\t\tresolveResult = ctx.Resolve(node);\n\t\t\t\t\n\t\t\t\tif (resolveResult is MemberResolveResult) {\n\t\t\t\t\tvar member = ((MemberResolveResult)resolveResult).Member;\n\t\t\t\t\tif (member.SymbolKind == SymbolKind.Method && member.Attributes.Any(attr => attr.AttributeType.FullName == \"NUnit.Framework.TestAttribute\")) {\n\t\t\t\t\t\tif (CheckNamedResolveResult(resolveResult, node, AffectedEntity.TestMethod, identifier, accessibilty)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tCheckNamedResolveResult(resolveResult, node, entity, identifier, accessibilty);\n\t\t\t}\n\n\t\t\tvoid CheckName(AstNode node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)\n\t\t\t{\n\t\t\t\tCheckNamedResolveResult(null, node, entity, identifier, accessibilty);\n\t\t\t}\n\n\t\t\tbool CheckNamedResolveResult(ResolveResult resolveResult, AstNode node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)\n\t\t\t{\n\t\t\t\tbool wasHandled = false;\n\t\t\t\tforeach (var rule in service.Rules) {\n\t\t\t\t\tif (!rule.AffectedEntity.HasFlag(entity)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!rule.VisibilityMask.HasFlag(accessibilty)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (!rule.IncludeInstanceMembers || !rule.IncludeStaticEntities) {\n\t\t\t\t\t\tEntityDeclaration typeSystemEntity;\n\t\t\t\t\t\tif (node is VariableInitializer) {\n\t\t\t\t\t\t\ttypeSystemEntity = node.Parent as EntityDeclaration;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttypeSystemEntity = node as EntityDeclaration;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!rule.IncludeInstanceMembers) {\n\t\t\t\t\t\t\tif (typeSystemEntity == null || !typeSystemEntity.HasModifier (Modifiers.Static) || typeSystemEntity.HasModifier (Modifiers.Sealed)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!rule.IncludeStaticEntities) {\n\t\t\t\t\t\t\tif (typeSystemEntity == null || typeSystemEntity.HasModifier (Modifiers.Static) || typeSystemEntity.HasModifier (Modifiers.Sealed)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\twasHandled = true;\n\t\t\t\t\tif (!rule.IsValid(identifier.Name)) {\n\t\t\t\t\t\tIList<string> suggestedNames;\n\t\t\t\t\t\tvar msg = rule.GetErrorMessage(ctx, identifier.Name, out suggestedNames);\n\t\t\t\t\t\tvar actions = new List<CodeAction>(suggestedNames.Select(n => new CodeAction(string.Format(ctx.TranslateString(\"Rename to '{0}'\"), n), (Script script) => {\n\t\t\t\t\t\t\tif (resolveResult == null)\n\t\t\t\t\t\t\t\tresolveResult = ctx.Resolve (node);\n\t\t\t\t\t\t\tif (resolveResult is MemberResolveResult) {\n\t\t\t\t\t\t\t\tscript.Rename(((MemberResolveResult)resolveResult).Member, n);\n\t\t\t\t\t\t\t} else if (resolveResult is TypeResolveResult) {\n\t\t\t\t\t\t\t\tvar def = resolveResult.Type.GetDefinition();\n\t\t\t\t\t\t\t\tif (def != null) {\n\t\t\t\t\t\t\t\t\tscript.Rename(def, n);\n\t\t\t\t\t\t\t\t} else if (resolveResult.Type.Kind == TypeKind.TypeParameter) {\n\t\t\t\t\t\t\t\t\tscript.Rename((ITypeParameter)resolveResult.Type, n);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (resolveResult is LocalResolveResult) {\n\t\t\t\t\t\t\t\tscript.Rename(((LocalResolveResult)resolveResult).Variable, n);\n\t\t\t\t\t\t\t} else if (resolveResult is NamespaceResolveResult) {\n\t\t\t\t\t\t\t\tscript.Rename(((NamespaceResolveResult)resolveResult).Namespace, n);\n\t\t\t\t\t\t\t} else { \n\t\t\t\t\t\t\t\tscript.Replace(identifier, Identifier.Create(n));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, identifier)));\n\n\t\t\t\t\t\tif (entity != AffectedEntity.Label) {\n\t\t\t\t\t\t\tactions.Add(new CodeAction(string.Format(ctx.TranslateString(\"Rename '{0}'...\"), identifier.Name), (Script script) => {\n\t\t\t\t\t\t\t\tif (resolveResult == null)\n\t\t\t\t\t\t\t\t\tresolveResult = ctx.Resolve (node);\n\t\t\t\t\t\t\t\tif (resolveResult is MemberResolveResult) {\n\t\t\t\t\t\t\t\t\tscript.Rename(((MemberResolveResult)resolveResult).Member);\n\t\t\t\t\t\t\t\t} else if (resolveResult is TypeResolveResult) {\n\t\t\t\t\t\t\t\t\tvar def = resolveResult.Type.GetDefinition();\n\t\t\t\t\t\t\t\t\tif (def != null) {\n\t\t\t\t\t\t\t\t\t\tscript.Rename(def);\n\t\t\t\t\t\t\t\t\t} else if (resolveResult.Type.Kind == TypeKind.TypeParameter) {\n\t\t\t\t\t\t\t\t\t\tscript.Rename((ITypeParameter)resolveResult.Type);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (resolveResult is LocalResolveResult) {\n\t\t\t\t\t\t\t\t\tscript.Rename(((LocalResolveResult)resolveResult).Variable);\n\t\t\t\t\t\t\t\t} else if (resolveResult is NamespaceResolveResult) {\n\t\t\t\t\t\t\t\t\tscript.Rename(((NamespaceResolveResult)resolveResult).Namespace);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, identifier));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tAddIssue(new CodeIssue(identifier, msg, actions));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn wasHandled;\n\t\t\t}\n\n\t\t\tpublic override void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitNamespaceDeclaration(namespaceDeclaration);\n\t\t\t\tvar type = namespaceDeclaration.NamespaceName;\n\t\t\t\twhile (type is MemberType) {\n\t\t\t\t\tvar mt = (MemberType)type;\n\t\t\t\t\tCheckNamedResolveResult(null, namespaceDeclaration, AffectedEntity.Namespace, mt.MemberNameToken, Modifiers.None);\n\t\t\t\t\ttype = mt.Target;\n\t\t\t\t}\n\t\t\t\tif (type is SimpleType)\n\t\t\t\t\tCheckNamedResolveResult(null, namespaceDeclaration, AffectedEntity.Namespace, ((SimpleType)type).IdentifierToken, Modifiers.None);\n\t\t\t}\n\n\t\t\tModifiers GetAccessibiltiy(EntityDeclaration decl, Modifiers defaultModifier)\n\t\t\t{\n\t\t\t\tvar accessibility = (decl.Modifiers & Modifiers.VisibilityMask);\n\t\t\t\tif (accessibility == Modifiers.None) {\n\t\t\t\t\treturn defaultModifier;\n\t\t\t\t}\n\t\t\t\treturn accessibility;\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tAffectedEntity entity;\n\t\t\t\tswitch (typeDeclaration.ClassType) {\n\t\t\t\t\tcase ClassType.Class:\n\t\t\t\t\t\tentity = AffectedEntity.Class;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\t\tentity = AffectedEntity.Struct;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\t\tentity = AffectedEntity.Interface;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ClassType.Enum:\n\t\t\t\t\t\tentity = AffectedEntity.Enum;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new System.ArgumentOutOfRangeException();\n\t\t\t\t}\n\t\t\t\tCheckName(typeDeclaration, entity, typeDeclaration.NameToken, GetAccessibiltiy(typeDeclaration, typeDeclaration.Parent is TypeDeclaration ? Modifiers.Private : Modifiers.Internal));\n\t\t\t}\n\n\t\t\tpublic override void VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitDelegateDeclaration(delegateDeclaration);\n\t\t\t\tCheckName(delegateDeclaration, AffectedEntity.Delegate, delegateDeclaration.NameToken, GetAccessibiltiy(delegateDeclaration, delegateDeclaration.Parent is TypeDeclaration ? Modifiers.Private : Modifiers.Internal));\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tif (propertyDeclaration.Modifiers.HasFlag (Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitPropertyDeclaration(propertyDeclaration);\n\t\t\t\tCheckName(propertyDeclaration, AffectedEntity.Property, propertyDeclaration.NameToken, GetAccessibiltiy(propertyDeclaration, Modifiers.Private));\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tif (indexerDeclaration.Modifiers.HasFlag(Modifiers.Override)) {\n\t\t\t\t\tvar rr = ctx.Resolve (indexerDeclaration) as MemberResolveResult;\n\t\t\t\t\tif (rr == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar baseType = rr.Member.DeclaringType.DirectBaseTypes.FirstOrDefault (t => t.Kind != TypeKind.Interface);\n\t\t\t\t\tvar method = baseType != null ? baseType.GetProperties (m => m.IsIndexer && m.IsOverridable && m.Parameters.Count == indexerDeclaration.Parameters.Count).FirstOrDefault () : null;\n\t\t\t\t\tif (method == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var par in indexerDeclaration.Parameters) {\n\t\t\t\t\t\tif (method.Parameters[i++].Name != par.Name) {\n\t\t\t\t\t\t\tpar.AcceptVisitor (this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbase.VisitIndexerDeclaration(indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (methodDeclaration.Modifiers.HasFlag(Modifiers.Override)) {\n\t\t\t\t\tvar rr = ctx.Resolve (methodDeclaration) as MemberResolveResult;\n\t\t\t\t\tif (rr == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar baseType = rr.Member.DeclaringType.DirectBaseTypes.FirstOrDefault (t => t.Kind != TypeKind.Interface);\n\t\t\t\t\tvar method = baseType != null ? baseType.GetMethods (m => m.Name == rr.Member.Name && m.IsOverridable && m.Parameters.Count == methodDeclaration.Parameters.Count).FirstOrDefault () : null;\n\t\t\t\t\tif (method == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var par in methodDeclaration.Parameters) {\n\t\t\t\t\t\tif (method.Parameters[i++].Name != par.Name) {\n\t\t\t\t\t\t\tpar.AcceptVisitor (this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\n\t\t\t\tCheckName(methodDeclaration, methodDeclaration.Modifiers.HasFlag(Modifiers.Async) ? AffectedEntity.AsyncMethod : AffectedEntity.Method, methodDeclaration.NameToken, GetAccessibiltiy(methodDeclaration, Modifiers.Private));\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t\t\tvar entity = AffectedEntity.Field;\n\t\t\t\tif (fieldDeclaration.Modifiers.HasFlag(Modifiers.Const)) {\n\t\t\t\t\tentity = AffectedEntity.ConstantField;\n\t\t\t\t} else if (fieldDeclaration.Modifiers.HasFlag(Modifiers.Readonly)) {\n\t\t\t\t\tentity = AffectedEntity.ReadonlyField;\n\t\t\t\t}\n\t\t\t\tforeach (var init in fieldDeclaration.Variables) {\n\t\t\t\t\tCheckName(init, entity, init.NameToken, GetAccessibiltiy(fieldDeclaration, Modifiers.Private));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitFixedFieldDeclaration(fixedFieldDeclaration);\n\t\t\t\tvar entity = AffectedEntity.Field;\n\t\t\t\tif (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Const)) {\n\t\t\t\t\tentity = AffectedEntity.ConstantField;\n\t\t\t\t} else if (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Readonly)) {\n\t\t\t\t\tentity = AffectedEntity.ReadonlyField;\n\t\t\t\t}\n\t\t\t\tCheckName(fixedFieldDeclaration, entity, fixedFieldDeclaration.NameToken, GetAccessibiltiy(fixedFieldDeclaration, Modifiers.Private));\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitEventDeclaration(eventDeclaration);\n\t\t\t\tforeach (var init in eventDeclaration.Variables) {\n\t\t\t\t\tCheckName(init, AffectedEntity.Event, init.NameToken, GetAccessibiltiy(eventDeclaration, Modifiers.Private));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tif (eventDeclaration.Modifiers.HasFlag (Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitCustomEventDeclaration(eventDeclaration);\n\t\t\t\tCheckName(eventDeclaration, AffectedEntity.Event, eventDeclaration.NameToken, GetAccessibiltiy(eventDeclaration, Modifiers.Private));\n\t\t\t}\n\n\t\t\tpublic override void VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitEnumMemberDeclaration(enumMemberDeclaration);\n\t\t\t\tCheckName(enumMemberDeclaration, AffectedEntity.EnumMember, enumMemberDeclaration.NameToken, GetAccessibiltiy(enumMemberDeclaration, Modifiers.Private));\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitParameterDeclaration(parameterDeclaration);\n\t\t\t\tCheckNamedResolveResult(null, parameterDeclaration, parameterDeclaration.Parent is LambdaExpression ? AffectedEntity.LambdaParameter : AffectedEntity.Parameter, parameterDeclaration.NameToken, Modifiers.None);\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitTypeParameterDeclaration(typeParameterDeclaration);\n\t\t\t\tCheckNamedResolveResult(null, typeParameterDeclaration, AffectedEntity.TypeParameter, typeParameterDeclaration.NameToken, Modifiers.None);\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t\t{\n\t\t\t\tbase.VisitVariableDeclarationStatement(variableDeclarationStatement);\n\t\t\t\tvar entity = variableDeclarationStatement.Modifiers.HasFlag(Modifiers.Const) ? AffectedEntity.LocalConstant : AffectedEntity.LocalVariable;\n\t\t\t\tforeach (var init in variableDeclarationStatement.Variables) {\n\t\t\t\t\tCheckNamedResolveResult(null, init, entity, init.NameToken, Modifiers.None);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitLabelStatement(LabelStatement labelStatement)\n\t\t\t{\n\t\t\t\tbase.VisitLabelStatement(labelStatement);\n\t\t\t\tCheckNamedResolveResult(null, labelStatement, AffectedEntity.Label, labelStatement.LabelToken, Modifiers.None);\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/NamingConventionService.cs",
    "content": "﻿// \n// NamingConventionService.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic abstract class NamingConventionService\n\t{\n\t\tpublic abstract IEnumerable<NamingRule> Rules {\n\t\t\tget;\n\t\t}\n\n\t\tpublic string CheckName(RefactoringContext ctx, string name, AffectedEntity entity, Modifiers accessibilty = Modifiers.Private, bool isStatic = false)\n\t\t{\n\t\t\tforeach (var rule in Rules) {\n\t\t\t\tif (!rule.AffectedEntity.HasFlag(entity)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!rule.VisibilityMask.HasFlag(accessibilty)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isStatic && !rule.IncludeStaticEntities || !isStatic && !rule.IncludeInstanceMembers) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!rule.IsValid(name)) {\n\t\t\t\t\tIList<string> suggestedNames;\n\t\t\t\t\trule.GetErrorMessage(ctx, name, out suggestedNames);\n\t\t\t\t\tif (suggestedNames.Any ())\n\t\t\t\t\t\treturn suggestedNames [0];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn name;\n\t\t}\n\n\t\tpublic bool IsValidName(string name, AffectedEntity entity, Modifiers accessibilty = Modifiers.Private, bool isStatic = false)\n\t\t{\n\t\t\tforeach (var rule in Rules) {\n\t\t\t\tif (!rule.AffectedEntity.HasFlag(entity)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!rule.VisibilityMask.HasFlag(accessibilty)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isStatic && !rule.IncludeStaticEntities || !isStatic && !rule.IncludeInstanceMembers) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!rule.IsValid(name)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic bool HasValidRule(string name, AffectedEntity entity, Modifiers accessibilty = Modifiers.Private, bool isStatic = false)\n\t\t{\n\t\t\tforeach (var rule in Rules) {\n\t\t\t\tif (!rule.AffectedEntity.HasFlag(entity)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!rule.VisibilityMask.HasFlag(accessibilty)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isStatic && !rule.IncludeStaticEntities || !isStatic && !rule.IncludeInstanceMembers) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (rule.IsValid(name)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/NamingRule.cs",
    "content": "﻿// \n// NamingRule.cs\n//  \n// Author:\n//       Michael Hutchinson <mhutch@xamarin.com>\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Text;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic class NamingRule : IEquatable<NamingRule>\n\t{\n\t\tpublic string Name { get; set; }\n\n\t\t/// <summary>\n\t\t/// If set, identifiers are required to be prefixed with one of these values.\n\t\t/// </summary>\n\t\tpublic string[] RequiredPrefixes { get; set; }\n\n\t\t/// <summary>\n\t\t/// If set, identifiers are allowed to be prefixed with one of these values.\n\t\t/// </summary>\n\t\tpublic string[] AllowedPrefixes { get; set; }\n\n\t\t/// <summary>\n\t\t/// If set, identifiers are required to be suffixed with one of these values.\n\t\t/// </summary>\n\t\tpublic string[] RequiredSuffixes { get; set; }\n\n\t\t/// <summary>\n\t\t/// If set, identifiers cannot be prefixed by any of these values.\n\t\t/// </summary>\n\t\tpublic string[] ForbiddenPrefixes { get; set; }\n\n\t\t/// <summary>\n\t\t/// If set, identifiers cannot be suffixed by with any of these values.\n\t\t/// </summary\n\t\tpublic string[] ForbiddenSuffixes { get; set; }\n\n\t\t/// <summary>\n\t\t/// Gets or sets the affected entity.\n\t\t/// </summary>\n\t\tpublic AffectedEntity AffectedEntity { get; set; }\n\n\t\t/// <summary>\n\t\t/// Gets or sets the modifiers mask\n\t\t/// </summary>\n\t\tpublic Modifiers VisibilityMask { get; set; }\n\n\t\t/// <summary>\n\t\t/// The way that the identifier is cased and that words are separated.\n\t\t/// </summary>\n\t\tpublic NamingStyle NamingStyle { get; set; }\n\n\t\tpublic bool IncludeStaticEntities { get; set; }\n\n\t\tpublic bool IncludeInstanceMembers { get; set; }\n\n\t\tpublic bool IsValid(string name)\n\t\t{\n\t\t\tstring id = name;\n\t\t\tbool foundPrefix = false;\n\t\t\tif (RequiredPrefixes != null && RequiredPrefixes.Length > 0) {\n\t\t\t\tvar prefix = RequiredPrefixes.FirstOrDefault(p => id.StartsWith(p, StringComparison.Ordinal));\n\t\t\t\tif (prefix == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tid = id.Substring(prefix.Length);\n\t\t\t\tfoundPrefix = true;\n\t\t\t}\n\t\t\t\n\t\t\tif (!foundPrefix && AllowedPrefixes != null && AllowedPrefixes.Length > 0) {\n\t\t\t\tvar prefix = AllowedPrefixes.FirstOrDefault(p => id.StartsWith(p, StringComparison.Ordinal));\n\t\t\t\tif (prefix != null) {\n\t\t\t\t\tid = id.Substring(prefix.Length);\n\t\t\t\t\tfoundPrefix = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (!foundPrefix && ForbiddenPrefixes != null && ForbiddenPrefixes.Length > 0) {\n\t\t\t\tif (ForbiddenPrefixes.Any(p => id.StartsWith(p, StringComparison.Ordinal))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (RequiredSuffixes != null && RequiredSuffixes.Length > 0) {\n\t\t\t\tvar suffix = RequiredSuffixes.FirstOrDefault(s => id.EndsWith(s, StringComparison.Ordinal));\n\t\t\t\tif (suffix == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tid = id.Substring(0, id.Length - suffix.Length);\n\t\t\t} else if (ForbiddenSuffixes != null && ForbiddenSuffixes.Length > 0) {\n\t\t\t\tif (ForbiddenSuffixes.Any(p => id.EndsWith(p, StringComparison.Ordinal))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tswitch (NamingStyle) {\n\t\t\t\tcase NamingStyle.AllLower:\n\t\t\t\t\tfor (int i = 0; i < id.Length; i++) {\n\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.Allow, id, ref i))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif (char.IsLetter(ch) && char.IsUpper(ch))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tcase NamingStyle.AllUpper:\n\t\t\t\t\tfor (int i = 0; i < id.Length; i++) {\n\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.Allow, id, ref i))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif (char.IsLetter(ch) && char.IsLower(ch))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tcase NamingStyle.CamelCase:\n\t\t\t\t\tif (id.Length > 0) {\n\t\t\t\t\t\tif (char.IsUpper(id [0]) || id [0] == '_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.Forbid, id, ref i))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tcase NamingStyle.CamelCaseWithLowerLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0) {\n\t\t\t\t\t\tif (char.IsUpper(id [0]) || id [0] == '_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.AllowWithLowerStartingLetter, id, ref i))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\n\t\t\t\tcase NamingStyle.CamelCaseWithUpperLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0) {\n\t\t\t\t\t\tif (char.IsUpper(id [0]) || id [0] == '_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.AllowWithUpperStartingLetter, id, ref i))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\n\t\t\t\tcase NamingStyle.PascalCase:\n\t\t\t\t\tif (id.Length > 0) {\n\t\t\t\t\t\tif (char.IsLower(id [0]) || id [0] == '_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.Forbid, id, ref i))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tcase NamingStyle.PascalCaseWithLowerLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0) {\n\t\t\t\t\t\tif (char.IsLower(id [0]) || id [0] == '_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.AllowWithLowerStartingLetter, id, ref i))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tcase NamingStyle.PascalCaseWithUpperLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0) {\n\t\t\t\t\t\tif (char.IsLower(id [0]) || id [0] == '_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.AllowWithUpperStartingLetter, id, ref i))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tcase NamingStyle.FirstUpper:\n\t\t\t\t\tif (id.Length > 0) {\n\t\t\t\t\t\tif (char.IsLower(id [0]) || id [0] == '_')\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\t\t\t\tchar ch = id [i];\n\t\t\t\t\t\t\tif (ch == '_' && !HandleUnderscore(UnderscoreHandling.Allow, id, ref i))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tif (char.IsLetter(ch) && char.IsUpper(ch))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic NamingRule(AffectedEntity affectedEntity)\n\t\t{\n\t\t\tAffectedEntity = affectedEntity;\n\t\t\tVisibilityMask = Modifiers.VisibilityMask;\n\t\t\tIncludeStaticEntities = true;\n\t\t\tIncludeInstanceMembers = true;\n\t\t}\n\n\t\tstatic bool CheckUnderscore(string id, UnderscoreHandling handling)\n\t\t{\n\t\t\tfor (int i = 1; i < id.Length; i++) {\n\t\t\t\tchar ch = id [i];\n\t\t\t\tif (ch == '_' && !HandleUnderscore(handling, id, ref i))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tenum UnderscoreHandling {\n\t\t\tForbid,\n\t\t\tAllow,\n\t\t\tAllowWithLowerStartingLetter,\n\t\t\tAllowWithUpperStartingLetter\n\t\t}\n\n\t\tstatic bool HandleUnderscore(UnderscoreHandling handling, string id, ref int i)\n\t\t{\n\t\t\tswitch (handling) {\n\t\t\t\tcase UnderscoreHandling.Forbid:\n\t\t\t\t\tif (i + 1 < id.Length) {\n\t\t\t\t\t\tchar ch = id [i + 1];\n\t\t\t\t\t\tif (char.IsDigit(ch)) {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\tcase UnderscoreHandling.Allow:\n\t\t\t\t\treturn true;\n\t\t\t\tcase UnderscoreHandling.AllowWithLowerStartingLetter:\n\t\t\t\t\tif (i + 1 < id.Length) {\n\t\t\t\t\t\tchar ch = id [i + 1];\n\t\t\t\t\t\tif (char.IsLetter(ch) && !char.IsLower(ch) || ch =='_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tcase UnderscoreHandling.AllowWithUpperStartingLetter:\n\t\t\t\t\tif (i + 1 < id.Length) {\n\t\t\t\t\t\tchar ch = id [i + 1];\n\t\t\t\t\t\tif (char.IsLetter(ch) && !char.IsUpper(ch) || ch =='_')\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Applies a suffix to a name and tries to reuse the suffix of the suffix.\n\t\t/// MyArgs + EventArgs -> MyEventArgs instead of MyArgsEventArgs\n\t\t/// </summary>\n\t\tstatic string ApplySuffix(string name, string suffix)\n\t\t{\n\t\t\tvar words = WordParser.BreakWords(suffix);\n\n\t\t\tbool found = false;\n\t\t\tfor (int j = words.Count - 1; j >= 0; j--) {\n\t\t\t\tif (name.EndsWith(words[j], StringComparison.Ordinal)) {\n\t\t\t\t\tname = name.Substring(0, name.Length - words[j].Length);\n\t\t\t\t\tfound = true;\n\t\t\t\t} else {\n\t\t\t\t\tif (found)\n\t\t\t\t\t\treturn name + string.Join(\"\", words.ToArray(), j, words.Count - j);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn name + suffix;\n\t\t}\n\t\n\t\tpublic string GetErrorMessage(BaseRefactoringContext ctx, string name, out IList<string> suggestedNames)\n\t\t{\n\t\t\tsuggestedNames = new List<string>();\n\t\t\tstring id = name;\n\t\t\t\n\t\t\tstring errorMessage = null;\n\t\t\t\n\t\t\tbool missingRequiredPrefix = false;\n\t\t\tbool missingRequiredSuffix = false;\n\t\t\tstring requiredPrefix = null;\n\t\t\tstring allowedPrefix = null;\n\t\t\tstring suffix = null;\n\t\t\t\n\t\t\tif (AllowedPrefixes != null && AllowedPrefixes.Length > 0) {\n\t\t\t\tallowedPrefix = AllowedPrefixes.FirstOrDefault(p => id.StartsWith(p, StringComparison.Ordinal));\n\t\t\t\tif (allowedPrefix != null)\n\t\t\t\t\tid = id.Substring(allowedPrefix.Length);\n\n\t\t\t}\n\n\t\t\tif (RequiredPrefixes != null && RequiredPrefixes.Length > 0) {\n\t\t\t\trequiredPrefix = RequiredPrefixes.FirstOrDefault(p => id.StartsWith(p, StringComparison.Ordinal));\n\t\t\t\tif (requiredPrefix == null) {\n\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"Name should have prefix '{0}'. (Rule '{1}').\"), RequiredPrefixes [0], Name);\n\t\t\t\t\tmissingRequiredPrefix = true;\n\t\t\t\t} else {\n\t\t\t\t\tid = id.Substring(requiredPrefix.Length);\n\t\t\t\t}\n\t\t\t} else if (ForbiddenPrefixes != null && ForbiddenPrefixes.Length > 0) {\n\t\t\t\trequiredPrefix = ForbiddenPrefixes.FirstOrDefault(p => id.StartsWith(p, StringComparison.Ordinal));\n\t\t\t\tif (requiredPrefix != null) {\n\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"Name has forbidden prefix '{0}'. (Rule '{1}')\"), requiredPrefix, Name);\n\t\t\t\t\tid = id.Substring(requiredPrefix.Length);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (RequiredSuffixes != null && RequiredSuffixes.Length > 0) {\n\t\t\t\tsuffix = RequiredSuffixes.FirstOrDefault(s => id.EndsWith(s, StringComparison.Ordinal));\n\t\t\t\tif (suffix == null) {\n\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"Name should have suffix '{0}'. (Rule '{1}')\"), RequiredSuffixes [0], Name);\n\t\t\t\t\tmissingRequiredSuffix = true;\n\t\t\t\t} else {\n\t\t\t\t\tid = id.Substring(0, id.Length - suffix.Length);\n\t\t\t\t}\n\t\t\t} else if (ForbiddenSuffixes != null && ForbiddenSuffixes.Length > 0) {\n\t\t\t\tsuffix = ForbiddenSuffixes.FirstOrDefault(p => id.EndsWith(p, StringComparison.Ordinal));\n\t\t\t\tif (suffix != null) {\n\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"Name has forbidden suffix '{0}'. (Rule '{1}')\"), suffix, Name);\n\t\t\t\t\tid = id.Substring(0, id.Length - suffix.Length);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tswitch (NamingStyle) {\n\t\t\t\tcase NamingStyle.AllLower:\n\t\t\t\t\tif (id.Any(ch => char.IsLetter(ch) && char.IsUpper(ch))) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' contains upper case letters. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t\tsuggestedNames.Add(LowerCaseIdentifier(WordParser.BreakWords(id)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.AllUpper:\n\t\t\t\t\tif (id.Any(ch => char.IsLetter(ch) && char.IsLower(ch))) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' contains lower case letters. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t\tsuggestedNames.Add(UpperCaseIdentifier(WordParser.BreakWords(id)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NamingStyle.CamelCase:\n\t\t\t\t\tif (id.Length > 0 && !char.IsLower(id [0])) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should start with a lower case letter. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else if (!CheckUnderscore(id, UnderscoreHandling.Forbid)) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should not separate words with an underscore. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsuggestedNames.Add(CamelCaseIdentifier(id));\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.CamelCaseWithLowerLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0 && !char.IsLower(id [0])) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should start with a lower case letter. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithLowerStartingLetter)) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"after '_' a lower letter should follow. (Rule '{0}')\"), Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsuggestedNames.Add(CamelCaseWithLowerLetterUnderscore(id));\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.CamelCaseWithUpperLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0 && !char.IsLower(id [0])) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should start with a lower case letter. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithUpperStartingLetter)) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"after '_' an upper letter should follow. (Rule '{0}')\"), Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsuggestedNames.Add(CamelCaseWithUpperLetterUnderscore(id));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NamingStyle.PascalCase:\n\t\t\t\t\tif (id.Length > 0 && !char.IsUpper(id [0])) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should start with an upper case letter. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else if (!CheckUnderscore(id, UnderscoreHandling.Forbid)) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should not separate words with an underscore. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsuggestedNames.Add(PascalCaseIdentifier(id));\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.PascalCaseWithLowerLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0 && !char.IsUpper(id [0])) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should start with an upper case letter. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithLowerStartingLetter)) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"after '_' a lower letter should follow. (Rule '{0}')\"), Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsuggestedNames.Add(PascalCaseWithLowerLetterUnderscore(id));\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.PascalCaseWithUpperLetterUnderscore:\n\t\t\t\t\tif (id.Length > 0 && !char.IsUpper(id [0])) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should start with an upper case letter. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else if (!CheckUnderscore(id, UnderscoreHandling.AllowWithUpperStartingLetter)) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"after '_' an upper letter should follow. (Rule '{0}')\"), Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsuggestedNames.Add(PascalCaseWithUpperLetterUnderscore(id));\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.FirstUpper:\n\t\t\t\t\tif (id.Length > 0 && !char.IsUpper(id [0])) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' should start with an upper case letter. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else if (id.Take(1).Any(ch => char.IsLetter(ch) && char.IsUpper(ch))) {\n\t\t\t\t\t\terrorMessage = string.Format(ctx.TranslateString(\"'{0}' contains an upper case letter after the first. (Rule '{1}')\"), name, Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuggestedNames.Add(id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsuggestedNames.Add(FirstUpperIdentifier(WordParser.BreakWords(id)));\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (requiredPrefix != null) {\n\t\t\t\tfor (int i = 0; i < suggestedNames.Count; i++) {\n\t\t\t\t\tsuggestedNames [i] = requiredPrefix + suggestedNames [i];\n\t\t\t\t}\n\t\t\t} else if (allowedPrefix != null) {\n\t\t\t\tint count = suggestedNames.Count;\n\t\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\t\tsuggestedNames.Add(suggestedNames [i]);\n\t\t\t\t\tsuggestedNames [i] = allowedPrefix + suggestedNames [i];\n\t\t\t\t}\n\t\t\t} else if (missingRequiredPrefix) {\n\t\t\t\tfor (int i = 0; i < suggestedNames.Count; i++) {\n\t\t\t\t\tvar n = suggestedNames [i];\n\t\t\t\t\tbool first = true;\n\t\t\t\t\tforeach (var p in RequiredPrefixes) {\n\t\t\t\t\t\tif (first) {\n\t\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t\t\tsuggestedNames [i] = p + n;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsuggestedNames.Add(p + n);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (suffix != null) {\n\t\t\t\tfor (int i = 0; i < suggestedNames.Count; i++) {\n\t\t\t\t\tsuggestedNames [i] = ApplySuffix (suggestedNames [i], suffix);\n\t\t\t\t}\n\t\t\t} else if (missingRequiredSuffix) {\n\t\t\t\tfor (int i = 0; i < suggestedNames.Count; i++) {\n\t\t\t\t\tvar n = suggestedNames [i];\n\t\t\t\t\tbool first = true;\n\t\t\t\t\tforeach (var s in RequiredSuffixes) {\n\t\t\t\t\t\tif (first) {\n\t\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t\t\tsuggestedNames [i] = ApplySuffix (n, s);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsuggestedNames.Add(ApplySuffix (n, s));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn errorMessage\n\t\t\t// should never happen.\n\t\t\t\t?? \"no known errors.\";\n\t\t}\n\n\t\tstatic string CamelCaseIdentifier(string id)\n\t\t{\n\t\t\treturn ConvertToValidName(id, ch => char.ToLower(ch), ch => char.ToUpper (ch));\n\t\t}\n\n\t\tstatic string CamelCaseWithLowerLetterUnderscore(string id)\n\t\t{\n\t\t\treturn ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToLower(ch), ch => char.ToLower(ch));\n\t\t}\n\n\t\tstatic string CamelCaseWithUpperLetterUnderscore(string id)\n\t\t{\n\t\t\treturn ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToLower(ch), ch => char.ToUpper(ch));\n\t\t}\n\n\t\tstatic string ConvertToValidName(string id, Func<char, char> firstCharFunc, Func<char, char> followingCharFunc)\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tbool first = true;\n\t\t\tfor (int i = 0; i < id.Length; i++) {\n\t\t\t\tchar ch = id[i];\n\t\t\t\tif (i == 0 && ch == '_')\n\t\t\t\t\tcontinue;\n\t\t\t\tif (first && char.IsLetter(ch)) {\n\t\t\t\t\tsb.Append(firstCharFunc(ch));\n\t\t\t\t\tfirstCharFunc = followingCharFunc;\n\t\t\t\t\tfirst = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (ch == '_') {\n\t\t\t\t\tif (first)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (i + 1 < id.Length && id[i + 1] == '_')\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (i + 1 < id.Length) {\n\t\t\t\t\t\tif (char.IsDigit(id[i + 1])) {\n\t\t\t\t\t\t\tsb.Append('_');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfirst = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append(ch);\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tstatic string ConvertToValidNameWithSpecialUnderscoreHandling(string id, Func<char, char> firstCharFunc, Func<char, char> afterUnderscoreLetter)\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tbool first = true;\n\t\t\tfor (int i = 0; i < id.Length; i++) {\n\t\t\t\tchar ch = id[i];\n\t\t\t\tif (first && char.IsLetter(ch)) {\n\t\t\t\t\tsb.Append(firstCharFunc(ch));\n\t\t\t\t\tfirst = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (ch == '_') {\n\t\t\t\t\tif (first)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (i + 1 < id.Length && id[i + 1] == '_')\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tsb.Append('_');\n\t\t\t\t\ti++;\n\t\t\t\t\tif (i < id.Length)\n\t\t\t\t\t\tsb.Append(afterUnderscoreLetter (id[i]));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append(ch);\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\n\t\tstatic string PascalCaseIdentifier(string id)\n\t\t{\n\t\t\treturn ConvertToValidName(id, ch => char.ToUpper(ch), ch => char.ToUpper (ch));\n\t\t}\n\n\t\tstatic string PascalCaseWithLowerLetterUnderscore(string id)\n\t\t{\n\t\t\treturn ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToUpper(ch), ch => char.ToLower (ch));\n\t\t}\n\n\t\tstatic string PascalCaseWithUpperLetterUnderscore(string id)\n\t\t{\n\t\t\treturn ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToUpper(ch), ch => char.ToUpper(ch));\n\t\t}\n\n\t\tstatic string LowerCaseIdentifier(List<string> words)\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tsb.Append(words [0].ToLower());\n\t\t\tfor (int i = 1; i < words.Count; i++) {\n\t\t\t\tsb.Append('_');\n\t\t\t\tsb.Append(words [i].ToLower());\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tstatic string UpperCaseIdentifier(List<string> words)\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tsb.Append(words [0].ToUpper());\n\t\t\tfor (int i = 1; i < words.Count; i++) {\n\t\t\t\tsb.Append('_');\n\t\t\t\tsb.Append(words [i].ToUpper());\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tstatic string FirstUpperIdentifier(List<string> words)\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tAppendCapitalized(words [0], sb);\n\t\t\tfor (int i = 1; i < words.Count; i++) {\n\t\t\t\tsb.Append('_');\n\t\t\t\tsb.Append(words [i].ToLower());\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tstatic void AppendCapitalized(string word, StringBuilder sb)\n\t\t{\n\t\t\tsb.Append(word.ToLower());\n\t\t\tsb [sb.Length - word.Length] = char.ToUpper(sb [sb.Length - word.Length]);\n\t\t}\n\n\t\t#region IEquatable implementation\n\n\t\tpublic bool Equals(NamingRule other)\n\t\t{\n\t\t\treturn Name == other.Name &&\n\t\t\t\tAffectedEntity == other.AffectedEntity && \n\t\t\t\tVisibilityMask == other.VisibilityMask && \n\t\t\t\tNamingStyle == other.NamingStyle;\n\t\t}\n\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Gets an identifier (or comma separated list of identifiers) which apply to this naming rule.\n\t\t/// </summary>\n\t\tpublic string GetPreview()\n\t\t{\n\t\t\tvar result = new StringBuilder();\n\t\t\tif (RequiredPrefixes != null && RequiredPrefixes.Length > 0)\n\t\t\t\tresult.Append(RequiredPrefixes [0]);\n\t\t\tswitch (NamingStyle) {\n\t\t\t\tcase NamingStyle.PascalCase:\n\t\t\t\t\tresult.Append(\"PascalCase\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.PascalCaseWithLowerLetterUnderscore:\n\t\t\t\t\tresult.Append(\"PascalCase_underscoreTolerant\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.PascalCaseWithUpperLetterUnderscore:\n\t\t\t\t\tresult.Append(\"PascalCase_UnderscoreTolerant\");\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NamingStyle.CamelCase:\n\t\t\t\t\tresult.Append(\"camelCase\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.CamelCaseWithLowerLetterUnderscore:\n\t\t\t\t\tresult.Append(\"camelCase_underscoreTolerant\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.CamelCaseWithUpperLetterUnderscore:\n\t\t\t\t\tresult.Append(\"camelCase_UnderscoreTolerant\");\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NamingStyle.AllUpper:\n\t\t\t\t\tresult.Append(\"ALL_UPPER\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.AllLower:\n\t\t\t\t\tresult.Append(\"all_Lower\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase NamingStyle.FirstUpper:\n\t\t\t\t\tresult.Append(\"First_Upper\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (RequiredSuffixes != null && RequiredSuffixes.Length > 0)\n\t\t\t\tresult.Append(RequiredSuffixes [0]);\n\t\t\tif (AllowedPrefixes != null) {\n\t\t\t\tstring baseString = result.ToString();\n\t\t\t\tforeach (var str in AllowedPrefixes) {\n\t\t\t\t\tresult.Append(\", \" + str + baseString);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result.ToString();\n\t\t}\n\n\t\tpublic NamingRule Clone()\n\t\t{\n\t\t\treturn (NamingRule)MemberwiseClone();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"[NamingRule: Name={0}, AffectedEntity={1}, VisibilityMask={2}, NamingStyle={3}, IncludeStaticEntities={4}, IncludeInstanceMembers={5}]\", Name, AffectedEntity, VisibilityMask, NamingStyle, IncludeStaticEntities, IncludeInstanceMembers);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/ConstraintViolations/InconsistentNamingIssue/NamingStyle.cs",
    "content": "// \n// NamingStyle.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\tpublic enum NamingStyle {\n\t\tNone,\n\t\t\n\t\t/// <summary>\n\t\t/// PascalCase\n\t\t/// </summary>\n\t\tPascalCase,\n\t\t\n\t\t/// <summary>\n\t\t/// camelCase\n\t\t/// </summary>\n\t\tCamelCase,\n\n\t\t/// <summary>\n\t\t/// ALLUPPER\n\t\t/// </summary>\n\t\tAllUpper,\n\n\t\t/// <summary>\n\t\t/// alllower\n\t\t/// </summary>\n\t\tAllLower,\n\n\t\t/// <summary>\n\t\t/// Firstupper\n\t\t/// </summary>\n\t\tFirstUpper,\n\n\t\t/// <summary>\n\t\t/// PascalCaseWithLowerLetterUnderscore\n\t\t/// </summary>\n\t\tPascalCaseWithLowerLetterUnderscore,\n\n\t\t/// <summary>\n\t\t/// PascalCaseWithUpperLetterUnderscore\n\t\t/// </summary>\n\t\tPascalCaseWithUpperLetterUnderscore,\n\n\t\t/// <summary>\n\t\t/// CamelCaseWithLowerLetterUnderscore\n\t\t/// </summary>\n\t\tCamelCaseWithLowerLetterUnderscore,\n\n\t\t/// <summary>\n\t\t/// CamelCaseWithUpperLetterUnderscore\n\t\t/// </summary>\n\t\tCamelCaseWithUpperLetterUnderscore\n\n\t}\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/NUnit/NonPublicMethodWithTestAttributeIssue.cs",
    "content": "//\n// NonPublicMethodWithTestAttributeIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"NUnit Test methods should have public visibility\",\n\t                  Description = \"Non public methods are not found by NUnit.\",\n\t                  Category = IssueCategories.NUnit,\n\t                  Severity = Severity.Hint,\n\t                  AnalysisDisableKeyword = \"NUnit.NonPublicMethodWithTestAttribute\")]\n\tpublic class NonPublicMethodWithTestAttributeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<NonPublicMethodWithTestAttributeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tvar result = ctx.Resolve(methodDeclaration) as MemberResolveResult; \n\t\t\t\tif (result == null || result.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar member = result.Member;\n\t\t\t\tif (member.IsOverride || member.IsStatic || member.IsPublic)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!member.Attributes.Any(attr => attr.AttributeType.Name == \"TestAttribute\" && attr.AttributeType.Namespace == \"NUnit.Framework\"))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tmethodDeclaration.NameToken,\n\t\t\t\t\tctx.TranslateString(\"NUnit test methods should be public\"),\n\t\t\t\t\tctx.TranslateString(\"Make method public\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.ChangeModifier(methodDeclaration, Modifiers.Public);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// Empty\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertClosureToMethodGroupIssue.cs",
    "content": "//\n// SimplifyAnonymousMethodToDelegateIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{ \n\t[IssueDescription(\"Convert anonymous method to method group\",\n\t                  Description = \"Anonymous method or lambda expression can be simplified to method group.\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ConvertClosureToMethodGroup\")]\n\tpublic class ConvertClosureToMethodGroupIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertClosureToMethodGroupIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tstatic readonly Pattern pattern = new Choice {\n\t\t\t\tnew BlockStatement {\n\t\t\t\t\tnew ReturnStatement (new AnyNode (\"invoke\")) \n\t\t\t\t},\n\t\t\t\tnew AnyNode (\"invoke\")\n\t\t\t};\n\n\t\t\tstatic InvocationExpression AnalyzeBody(AstNode body)\n\t\t\t{\n\t\t\t\tvar m = pattern.Match(body);\n\t\t\t\tif (m.Success)\n\t\t\t\t\treturn m.Get(\"invoke\").Single () as InvocationExpression;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tstatic bool IsSimpleTarget(Expression target)\n\t\t\t{\n\t\t\t\tif (target is IdentifierExpression)\n\t\t\t\t\treturn true;\n\t\t\t\tvar mref = target as MemberReferenceExpression;\n\t\t\t\tif (mref != null)\n\t\t\t\t\treturn IsSimpleTarget (mref.Target);\n\t\t\t\tvar pref = target as PointerReferenceExpression;\n\t\t\t\tif (pref != null)\n\t\t\t\t\treturn IsSimpleTarget (pref.Target);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvoid AnalyzeExpression(AstNode expression, AstNode body, AstNodeCollection<ParameterDeclaration> parameters)\n\t\t\t{\n\t\t\t\tvar invocation = AnalyzeBody(body);\n\t\t\t\tif (invocation == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (!IsSimpleTarget (invocation.Target))\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve (invocation) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar lambdaParameters = parameters.ToList();\n\t\t\t\tvar arguments = rr.GetArgumentsForCall();\n\t\t\t\tif (lambdaParameters.Count != arguments.Count)\n\t\t\t\t\treturn;\n\t\t\t\tfor (int i = 0; i < arguments.Count; i++) {\n\t\t\t\t\tvar arg = UnpackImplicitIdentityOrReferenceConversion(arguments[i]) as LocalResolveResult;\n\t\t\t\t\tif (arg == null || arg.Variable.Name != lambdaParameters[i].Name)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar returnConv = ctx.GetConversion(invocation);\n\t\t\t\tif (returnConv.IsExplicit || !(returnConv.IsIdentityConversion || returnConv.IsReferenceConversion))\n\t\t\t\t\treturn;\n\t\t\t\tvar validTypes = TypeGuessing.GetValidTypes (ctx.Resolver, expression).ToList ();\n\n\t\t\t\t// search for method group collisions\n\t\t\t\tvar targetResult = ctx.Resolve(invocation.Target) as MethodGroupResolveResult;\n\t\t\t\tif (targetResult != null) {\n\t\t\t\t\tforeach (var t in validTypes) {\n\t\t\t\t\t\tif (t.Kind != TypeKind.Delegate)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar invokeMethod = t.GetDelegateInvokeMethod();\n\n\t\t\t\t\t\tforeach (var otherMethod in targetResult.Methods) {\n\t\t\t\t\t\t\tif (otherMethod == rr.Member)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tif (ParameterListComparer.Instance.Equals(otherMethod.Parameters, invokeMethod.Parameters))\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbool isValidReturnType = false;\n\t\t\t\tforeach (var t in validTypes) {\n\t\t\t\t\tif (t.Kind != TypeKind.Delegate)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar invokeMethod = t.GetDelegateInvokeMethod();\n\t\t\t\t\tisValidReturnType = rr.Member.ReturnType == invokeMethod.ReturnType || rr.Member.ReturnType.GetAllBaseTypes().Contains(invokeMethod.ReturnType);\n\t\t\t\t\tif (isValidReturnType)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isValidReturnType)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (rr.IsDelegateInvocation) {\n\t\t\t\t\tif (!validTypes.Contains(rr.Member.DeclaringType))\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tAddIssue(new CodeIssue(expression,\n\t\t\t\t         expression is AnonymousMethodExpression ? ctx.TranslateString(\"Anonymous method can be simplified to method group\") : ctx.TranslateString(\"Lambda expression can be simplified to method group\"), \n\t\t\t\t         ctx.TranslateString(\"Replace with method group\"), script =>  {\n\t\t\t\t\tif (validTypes.Any (t => t.FullName == \"System.Func\" && t.TypeParameterCount == 1 + parameters.Count) && validTypes.Any (t => t.FullName == \"System.Action\")) {\n\t\t\t\t\t\tif (rr != null && rr.Member.ReturnType.Kind != TypeKind.Void) {\n\t\t\t\t\t\t\tvar builder = ctx.CreateTypeSystemAstBuilder (expression);\n\t\t\t\t\t\t\tvar type = builder.ConvertType(new TopLevelTypeName(\"System\", \"Func\", 1));\n\t\t\t\t\t\t\tvar args = type.GetChildrenByRole(Roles.TypeArgument);\n\t\t\t\t\t\t\targs.Clear ();\n\t\t\t\t\t\t\tforeach (var pde in parameters) {\n\t\t\t\t\t\t\t\targs.Add (builder.ConvertType (ctx.Resolve (pde).Type));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\targs.Add (builder.ConvertType (rr.Member.ReturnType));\n\t\t\t\t\t\t\tscript.Replace(expression, new CastExpression (type, invocation.Target.Clone()));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tscript.Replace(expression, invocation.Target.Clone());\n\t\t\t\t}));\n\t\t\t}\n\t\t\t\n\t\t\tstatic ResolveResult UnpackImplicitIdentityOrReferenceConversion(ResolveResult rr)\n\t\t\t{\n\t\t\t\tvar crr = rr as ConversionResolveResult;\n\t\t\t\tif (crr != null && crr.Conversion.IsImplicit && (crr.Conversion.IsIdentityConversion || crr.Conversion.IsReferenceConversion))\n\t\t\t\t\treturn crr.Input;\n\t\t\t\treturn rr;\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\t\tAnalyzeExpression(lambdaExpression, lambdaExpression.Body, lambdaExpression.Parameters);\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\t\tAnalyzeExpression(anonymousMethodExpression, anonymousMethodExpression.Body, anonymousMethodExpression.Parameters);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertConditionalTernaryToNullCoalescingIssue.cs",
    "content": "// \n// ConditionalToNullCoalescingInspector.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Checks for \"a != null ? a : other\"<expr>\n\t/// Converts to: \"a ?? other\"<expr>\n\t/// </summary>\n\t[IssueDescription(\"'?:' expression can be converted to '??' expression\",\n\t                  Description=\"'?:' expression can be converted to '??' expression.\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ConvertConditionalTernaryToNullCoalescing\")]\n\tpublic class ConvertConditionalTernaryToNullCoalescingIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly Pattern unequalPattern = new Choice {\n\t\t\t// a != null ? a : other\n\t\t\tnew ConditionalExpression(\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"a\"), BinaryOperatorType.InEquality, new NullReferenceExpression()),\n\t\t\t\tnew Backreference(\"a\"),\n\t\t\t\tnew AnyNode(\"other\")\n\t\t\t),\n\n\t\t\t// obj != null ? (Type)obj : other\n\t\t\tnew ConditionalExpression(\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"obj\"), BinaryOperatorType.InEquality, new NullReferenceExpression()),\n\t\t\t\tnew NamedNode(\"a\", new CastExpression(new AnyNode(), new Backreference(\"obj\"))),\n\t\t\t\tnew AnyNode(\"other\")\n\t\t\t)\n\n\t\t};\n\n\t\tstatic readonly Pattern equalPattern = new Choice {\n\t\t\t// a == null ? other : a\n\t\t\tnew ConditionalExpression(\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"a\"), BinaryOperatorType.Equality, new NullReferenceExpression()),\n\t\t\t\tnew AnyNode(\"other\"),\n\t\t\t\tnew Backreference(\"a\")\n\t\t\t)\n\t\t};\n\n\t\t\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertConditionalTernaryToNullCoalescingIssue>\n\t\t{\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tMatch m = unequalPattern.Match(conditionalExpression);\n\t\t\t\tbool isEqual = false;\n\t\t\t\tif (!m.Success) {\n\t\t\t\t\tisEqual = true;\n\t\t\t\t\tm = equalPattern.Match(conditionalExpression);\n\t\t\t\t}\n\t\t\t\tif (m.Success) {\n\t\t\t\t\tvar a = m.Get<Expression>(\"a\").Single();\n\t\t\t\t\tvar other = m.Get<Expression>(\"other\").Single();\n\n\t\t\t\t\tif (isEqual) {\n\t\t\t\t\t\tvar castExpression = other as CastExpression;\n\t\t\t\t\t\tif (castExpression != null) {\n\t\t\t\t\t\t\ta = new CastExpression(castExpression.Type.Clone(), a.Clone());\n\t\t\t\t\t\t\tother = castExpression.Expression;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tAddIssue(new CodeIssue(conditionalExpression, ctx.TranslateString(\"'?:' expression can be re-written as '??' expression\"), new CodeAction (\n\t\t\t\t\t\tctx.TranslateString(\"Replace '?:'  operator with '??\"), script => {\n\t\t\t\t\t\t\tvar expr = new BinaryOperatorExpression (a.Clone (), BinaryOperatorType.NullCoalescing, other.Clone ());\n\t\t\t\t\t\t\tscript.Replace (conditionalExpression, expr);\n\t\t\t\t\t\t}, conditionalExpression)));\n\t\t\t\t}\n\t\t\t\tbase.VisitConditionalExpression (conditionalExpression);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertIfStatementToConditionalTernaryExpressionIssue.cs",
    "content": "//\n// ConvertIfStatementToConditionalTernaryExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'if' statement can be re-written as '?:' expression\",\n\t                  Description = \"Convert 'if' to '?:'\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Hint,\n\t                  AnalysisDisableKeyword = \"ConvertIfStatementToConditionalTernaryExpression\")]\n\tpublic class ConvertIfStatementToConditionalTernaryExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tpublic static bool IsComplexExpression(AstNode expr)\n\t\t{\n\t\t\treturn expr.StartLocation.Line != expr.EndLocation.Line ||\n\t\t\texpr is ConditionalExpression ||\n\t\t\texpr is BinaryOperatorExpression;\n\t\t}\n\n\t\tpublic static bool IsComplexCondition(Expression expr)\n\t\t{\n\t\t\tif (expr.StartLocation.Line != expr.EndLocation.Line)\n\t\t\t\treturn true;\n\n\t\t\tif (expr is PrimitiveExpression || expr is IdentifierExpression || expr is MemberReferenceExpression || expr is InvocationExpression)\n\t\t\t\treturn false;\n\n\t\t\tvar pexpr = expr as ParenthesizedExpression;\n\t\t\tif (pexpr != null)\n\t\t\t\treturn IsComplexCondition(pexpr.Expression);\n\n\t\t\tvar uOp = expr as UnaryOperatorExpression;\n\t\t\tif (uOp != null)\n\t\t\t\treturn IsComplexCondition(uOp.Expression);\n\n\t\t\tvar bop = expr as BinaryOperatorExpression;\n\t\t\tif (bop == null)\n\t\t\t\treturn true;\n\t\t\treturn !(bop.Operator == BinaryOperatorType.GreaterThan ||\n\t\t\tbop.Operator == BinaryOperatorType.GreaterThanOrEqual ||\n\t\t\tbop.Operator == BinaryOperatorType.Equality ||\n\t\t\tbop.Operator == BinaryOperatorType.InEquality ||\n\t\t\tbop.Operator == BinaryOperatorType.LessThan ||\n\t\t\tbop.Operator == BinaryOperatorType.LessThanOrEqual);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertIfStatementToConditionalTernaryExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\t\t\t\tMatch match;\n\t\t\t\tif (!ConvertIfStatementToConditionalTernaryExpressionAction.GetMatch(ifElseStatement, out match))\n\t\t\t\t\treturn;\n//\t\t\t\tvar target = match.Get<Expression>(\"target\").Single();\n\t\t\t\tvar condition = match.Get<Expression>(\"condition\").Single();\n\t\t\t\tvar trueExpr = match.Get<Expression>(\"expr1\").Single();\n\t\t\t\tvar falseExpr = match.Get<Expression>(\"expr2\").Single();\n\n\t\t\t\tif (IsComplexCondition(condition) || IsComplexExpression(trueExpr) || IsComplexExpression(falseExpr))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\tctx.TranslateString(\"Convert to '?:' expression\")\n\t\t\t\t){ IssueMarker = IssueMarker.DottedLine, ActionProvider = { typeof(ConvertIfStatementToConditionalTernaryExpressionAction) } });\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertIfStatementToNullCoalescingExpressionIssue.cs",
    "content": "//\n// ConvertIfStatementToNullCoalescingExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'if' statement can be re-written as '??' expression\",\n\t                  Description=\"Convert 'if' to '??'\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Hint,\n\t                  AnalysisDisableKeyword = \"ConvertIfStatementToNullCoalescingExpression\")]\n\tpublic class ConvertIfStatementToNullCoalescingExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertIfStatementToNullCoalescingExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\t\t\t\tExpression rightSide;\n\t\t\t\tvar leftSide = ConvertIfStatementToNullCoalescingExpressionAction.CheckNode(ifElseStatement, out rightSide);\n\t\t\t\tif (leftSide == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (ConvertIfStatementToConditionalTernaryExpressionIssue.IsComplexExpression(leftSide) || \n\t\t\t\t    ConvertIfStatementToConditionalTernaryExpressionIssue.IsComplexExpression(rightSide))\n\t\t\t\t\treturn;\n\t\t\t\tvar previousNode = ifElseStatement.GetPrevSibling(sibling => sibling is Statement) as VariableDeclarationStatement;\n\t\t\t\tif (previousNode == null || ConvertIfStatementToConditionalTernaryExpressionIssue.IsComplexExpression(previousNode))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\tctx.TranslateString(\"Convert to '??' expresssion\")\n\t\t\t\t){ IssueMarker = IssueMarker.DottedLine, ActionProvider = { typeof(ConvertIfStatementToNullCoalescingExpressionAction) } });\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertIfStatementToSwitchStatementIssue.cs",
    "content": "//\n// ConvertIfStatementToSwitchStatementIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'if' statement can be re-written as 'switch' statement\",\n\t                  Description=\"Convert 'if' to 'switch'\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Hint)]\n\tpublic class ConvertIfStatementToSwitchStatementIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertIfStatementToSwitchStatementIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\n\t\t\t\tif (ifElseStatement.Parent is IfElseStatement)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar switchExpr = ConvertIfStatementToSwitchStatementAction.GetSwitchExpression (ctx, ifElseStatement.Condition);\n\t\t\t\tif (switchExpr == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar switchSections = new List<SwitchSection> ();\n\t\t\t\tif (!ConvertIfStatementToSwitchStatementAction.CollectSwitchSections(switchSections, ctx, ifElseStatement, switchExpr))\n\t\t\t\t\treturn;\n\t\t\t\tif (switchSections.Count(s => !s.CaseLabels.Any(l => l.Expression.IsNull)) <= 2)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\tctx.TranslateString(\"Convert to 'switch' statement\")) { IssueMarker = IssueMarker.DottedLine, ActionProvider = { typeof(ConvertIfStatementToSwitchStatementAction) } });\n\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertNullableToShortFormIssue.cs",
    "content": "//\n// ConvertNullableToShortFormIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Convert 'Nullable<T>' to 'T?'\",\n\t                  Description = \"Convert 'Nullable<T>' to the short form 'T?'\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ConvertNullableToShortForm\")]\n\tpublic class ConvertNullableToShortFormIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertNullableToShortFormIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\tstatic readonly AstType nullType = new SimpleType(\"\");\n\n\t\t\tvoid CheckType(AstType simpleType, AstType arg)\n\t\t\t{\n\t\t\t\tif (arg == null || nullType.IsMatch(arg))\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(simpleType);\n\t\t\t\tif (rr == null || rr.IsError || rr.Type.Namespace != \"System\" || rr.Type.Name != \"Nullable\")\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tsimpleType,\n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Type can be simplified to '{0}?'\"), arg), \n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Rewrite to '{0}?'\"), arg),\n\t\t\t\t\tscript =>  {\n\t\t\t\t\t\tscript.Replace(simpleType, arg.Clone().MakeNullableType());\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitSimpleType(SimpleType simpleType)\n\t\t\t{\n\t\t\t\tCheckType(simpleType, simpleType.TypeArguments.FirstOrDefault());\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberType(MemberType memberType)\n\t\t\t{\n\t\t\t\tCheckType(memberType, memberType.TypeArguments.FirstOrDefault());\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertToAutoPropertyIssue.cs",
    "content": "//\n// ConvertToAutoPropertyIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Convert property to auto property\",\n\t\tDescription = \"Convert property to auto property\",\n\t\tCategory = IssueCategories.Opportunities,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ConvertToAutoProperty\")]\n\tpublic class ConvertToAutoPropertyIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertToAutoPropertyIssue>\n\t\t{\n\t\t\treadonly Stack<TypeDeclaration> typeStack = new Stack<TypeDeclaration>();\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\n\t\t\tbool IsValidField(IField field)\n\t\t\t{\n\t\t\t\tif (field == null || field.Attributes.Count > 0 || field.IsVolatile)\n\t\t\t\t\treturn false;\n\t\t\t\tforeach (var m in typeStack.Peek().Members.OfType<FieldDeclaration>()) {\n\t\t\t\t\tforeach (var i in m.Variables) {\n\t\t\t\t\t\tif (i.StartLocation == field.BodyRegion.Begin) {\n\t\t\t\t\t\t\tif (!i.Initializer.IsNull)\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tvar field = RemoveBackingStoreAction.GetBackingField(ctx, propertyDeclaration);\n\t\t\t\tif (!IsValidField(field))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tpropertyDeclaration.NameToken,\n\t\t\t\t\tctx.TranslateString(\"Convert to auto property\")\n\t\t\t\t) {\n\t\t\t\t\tActionProvider = { typeof (RemoveBackingStoreAction) }\n\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\ttypeStack.Push(typeDeclaration); \n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\ttypeStack.Pop();\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertToLambdaExpressionIssue.cs",
    "content": "//\n// ConvertToLambdaExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Convert to lambda expression\",\n\t\tDescription = \"Convert to lambda with expression\",\n\t\tCategory = IssueCategories.Opportunities,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ConvertToLambdaExpression\")]\n\tpublic class ConvertToLambdaExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertToLambdaExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\t\tBlockStatement block;\n\t\t\t\tExpression expr;\n\t\t\t\tif (!ConvertLambdaBodyStatementToExpressionAction.TryGetConvertableExpression(lambdaExpression.Body, out block, out expr))\n\t\t\t\t\treturn;\n\t\t\t\tvar node = block.Statements.FirstOrDefault() ?? block;\n\t\t\t\tvar expressionStatement = node as ExpressionStatement;\n\t\t\t\tif (expressionStatement != null) {\n\t\t\t\t\tif (expressionStatement.Expression is AssignmentExpression)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar returnTypes = new List<IType>();\n\t\t\t\tforeach (var type in TypeGuessing.GetValidTypes(ctx.Resolver, lambdaExpression)) {\n\t\t\t\t\tif (type.Kind != TypeKind.Delegate)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar invoke = type.GetDelegateInvokeMethod();\n\t\t\t\t\tif (!returnTypes.Contains(invoke.ReturnType))\n\t\t\t\t\t\treturnTypes.Add(invoke.ReturnType);\n\t\t\t\t}\n\t\t\t\tif (returnTypes.Count > 1)\n\t\t\t\t\treturn;\n\t\t\t\t// can't convert return statements without expression.\n\t\t\t\tvar returnExpr = node as ReturnStatement;\n\t\t\t\tif (returnExpr != null && returnExpr.Expression.IsNull)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tnode,\n\t\t\t\t\tctx.TranslateString(\"Can be converted to expression\"),\n\t\t\t\t\tConvertLambdaBodyStatementToExpressionAction.CreateAction(ctx, node, block, expr)\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\t\tif (!anonymousMethodExpression.HasParameterList)\n\t\t\t\t\treturn;\n\t\t\t\tBlockStatement block;\n\t\t\t\tExpression expr;\n\t\t\t\tif (!ConvertLambdaBodyStatementToExpressionAction.TryGetConvertableExpression(anonymousMethodExpression.Body, out block, out expr))\n\t\t\t\t\treturn;\n\t\t\t\tvar node = block.Statements.FirstOrDefault() ?? block;\n\t\t\t\tvar returnTypes = new List<IType>();\n\t\t\t\tforeach (var type in TypeGuessing.GetValidTypes(ctx.Resolver, anonymousMethodExpression)) {\n\t\t\t\t\tif (type.Kind != TypeKind.Delegate)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar invoke = type.GetDelegateInvokeMethod();\n\t\t\t\t\tif (!returnTypes.Contains(invoke.ReturnType))\n\t\t\t\t\t\treturnTypes.Add(invoke.ReturnType);\n\t\t\t\t}\n\t\t\t\tif (returnTypes.Count > 1)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tnode,\n\t\t\t\t\tctx.TranslateString(\"Can be converted to expression\"),\n\t\t\t\t\tctx.TranslateString(\"Convert to lambda expression\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar lambdaExpression = new LambdaExpression();\n\t\t\t\t\t\tforeach (var parameter in anonymousMethodExpression.Parameters)\n\t\t\t\t\t\t\tlambdaExpression.Parameters.Add(parameter.Clone());\n\t\t\t\t\t\tlambdaExpression.Body = expr.Clone();\n\t\t\t\t\t\tscript.Replace(anonymousMethodExpression, lambdaExpression);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ConvertToStaticTypeIssue.cs",
    "content": "﻿// \n// ConvertToStaticTypeIssue.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013  Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Class can be converted to static\",\n\t                  Description = \"If all fields, properties and methods members are static, the class can be made static.\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Hint,\n\t                  AnalysisDisableKeyword = \"ConvertToStaticType\")]\n\tpublic class ConvertToStaticTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertToStaticTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic bool IsMainMethod(IMember f)\n\t\t\t{\n\t\t\t\treturn \n\t\t\t\t\tf.SymbolKind == SymbolKind.Method &&\n\t\t\t\t\t(f.ReturnType.IsKnownType(KnownTypeCode.Void) || f.ReturnType.IsKnownType(KnownTypeCode.Int32)) &&\n\t\t\t\t\tf.IsStatic &&\n\t\t\t\t\tf.Name == \"Main\";\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\n\t\t\t\tif (typeDeclaration == null || typeDeclaration.ClassType != ClassType.Class || typeDeclaration.HasModifier(Modifiers.Static))\n\t\t\t\t\treturn;\n\t\t\t\tif (!typeDeclaration.Members.Any() || typeDeclaration.HasModifier(Modifiers.Abstract) || typeDeclaration.HasModifier(Modifiers.Partial))\n\t\t\t\t\treturn;\n\t\t\t\tif (typeDeclaration.Members.Where(m => !(m is TypeDeclaration)).Any(f => !f.HasModifier(Modifiers.Static) && !f.HasModifier(Modifiers.Const)))\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(typeDeclaration);\n\t\t\t\tif (rr.IsError || rr.Type.GetMembers().Any(IsMainMethod))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\ttypeDeclaration.NameToken, \n\t\t\t\t\tctx.TranslateString(\"This class is recommended to be defined as static\"),\n\t\t\t\t\tctx.TranslateString(\"Make class static\"),\n\t\t\t\t\ts => s.ChangeModifier(typeDeclaration, (typeDeclaration.Modifiers & ~Modifiers.Sealed) | Modifiers.Static)\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/ForCanBeConvertedToForeachIssue.cs",
    "content": "//\n// ForCanBeConvertedToForeachIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'for' can be converted into 'foreach'\",\n\t                  Description = \"Foreach loops are more efficient\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ForCanBeConvertedToForeach\")]\n\tpublic class ForCanBeConvertedToForeachIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ForCanBeConvertedToForeachIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode forPattern =\n\t\t\t\tnew Choice {\n\t\t\t\t\tnew ForStatement {\n\t\t\t\t\t\tInitializers = {\n\t\t\t\t\t\t\tnew VariableDeclarationStatement {\n\t\t\t\t\t\t\t\tType = new AnyNode(\"int\"),\n\t\t\t\t\t\t\t\tVariables = {\n\t\t\t\t\t\t\t\t\tnew NamedNode(\"iteratorInitialzer\", new VariableInitializer(Pattern.AnyString, new PrimitiveExpression(0)))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCondition = PatternHelper.OptionalParentheses(\n\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tPatternHelper.OptionalParentheses(new AnyNode(\"iterator\")), \n\t\t\t\t\t\t\t\tBinaryOperatorType.LessThan,\n\t\t\t\t\t\t\t\tPatternHelper.OptionalParentheses(\n\t\t\t\t\t\t\t\t\tnew NamedNode(\"upperBound\", new MemberReferenceExpression(new AnyNode (), Pattern.AnyString))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tIterators = {\n\t\t\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\t\t\tnew Choice {\n\t\t\t\t\t\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.Increment, new Backreference(\"iterator\")), \n\t\t\t\t\t\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.PostIncrement, new Backreference(\"iterator\")) \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tEmbeddedStatement = new AnyNode(\"body\")\n\t\t\t\t\t},\n\t\t\t\t\tnew ForStatement {\n\t\t\t\t\t\tInitializers = {\n\t\t\t\t\t\t\tnew VariableDeclarationStatement {\n\t\t\t\t\t\t\t\tType = new AnyNode(\"int\"),\n\t\t\t\t\t\t\t\tVariables = {\n\t\t\t\t\t\t\t\t\tnew NamedNode(\"iteratorInitialzer\", new VariableInitializer(Pattern.AnyString, new PrimitiveExpression(0))),\n\t\t\t\t\t\t\t\t\tnew NamedNode(\"upperBoundInitializer\", new VariableInitializer(Pattern.AnyString, new NamedNode(\"upperBound\", new MemberReferenceExpression(new AnyNode (), Pattern.AnyString)))),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCondition = PatternHelper.OptionalParentheses(\n\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tPatternHelper.OptionalParentheses(new AnyNode(\"iterator\")), \n\t\t\t\t\t\t\t\tBinaryOperatorType.LessThan,\n\t\t\t\t\t\t\t\tPatternHelper.OptionalParentheses(\n\t\t\t\t\t\t\t\t\tnew AnyNode(\"upperBoundInitializerName\")\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tIterators = {\n\t\t\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\t\t\tnew Choice {\n\t\t\t\t\t\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.Increment, new Backreference(\"iterator\")), \n\t\t\t\t\t\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.PostIncrement, new Backreference(\"iterator\")) \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tEmbeddedStatement = new AnyNode(\"body\")\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\tstatic readonly AstNode varDeclPattern =\n\t\t\t\tnew VariableDeclarationStatement {\n\t\t\t\t\tType = new AnyNode(),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer(Pattern.AnyString, new NamedNode(\"indexer\", new IndexerExpression(new AnyNode(), new IdentifierExpression(Pattern.AnyString))))\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\tstatic readonly AstNode varTypePattern =\n\t\t\t\tnew SimpleType(\"var\");\n\n\t\t\tstatic bool IsEnumerable(IType type)\n\t\t\t{\n\t\t\t\treturn type.Name == \"IEnumerable\" && (type.Namespace == \"System.Collections.Generic\" || type.Namespace == \"System.Collections\");\n\t\t\t}\n\n\t\t\tpublic override void VisitForStatement(ForStatement forStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForStatement(forStatement);\n\t\t\t\tvar forMatch = forPattern.Match(forStatement);\n\t\t\t\tif (!forMatch.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar body = forStatement.EmbeddedStatement as BlockStatement;\n\t\t\t\tif (body == null || !body.Statements.Any())\n\t\t\t\t\treturn;\n\t\t\t\tvar varDeclStmt = body.Statements.First() as VariableDeclarationStatement;\n\t\t\t\tif (varDeclStmt == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar varMatch = varDeclPattern.Match(varDeclStmt);\n\t\t\t\tif (!varMatch.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar typeNode = forMatch.Get<AstNode>(\"int\").FirstOrDefault();\n\t\t\t\tvar varDecl = forMatch.Get<VariableInitializer>(\"iteratorInitialzer\").FirstOrDefault();\n\t\t\t\tvar iterator = forMatch.Get<IdentifierExpression>(\"iterator\").FirstOrDefault();\n\t\t\t\tvar upperBound = forMatch.Get<MemberReferenceExpression>(\"upperBound\").FirstOrDefault();\n\t\t\t\tif (typeNode == null || varDecl == null || iterator == null || upperBound == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t// Check iterator type\n\t\t\t\tif (!varTypePattern.IsMatch(typeNode)) {\n\t\t\t\t\tvar typeRR = ctx.Resolve(typeNode);\n\t\t\t\t\tif (!typeRR.Type.IsKnownType(KnownTypeCode.Int32))\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (varDecl.Name != iterator.Identifier)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar upperBoundInitializer = forMatch.Get<VariableInitializer>(\"upperBoundInitializer\").FirstOrDefault();\n\t\t\t\tvar upperBoundInitializerName = forMatch.Get<IdentifierExpression>(\"upperBoundInitializerName\").FirstOrDefault();\n\t\t\t\tif (upperBoundInitializer != null) {\n\t\t\t\t\tif (upperBoundInitializerName == null || upperBoundInitializer.Name != upperBoundInitializerName.Identifier)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar indexer = varMatch.Get<IndexerExpression>(\"indexer\").Single();\n\t\t\t\tif (((IdentifierExpression)indexer.Arguments.First()).Identifier != iterator.Identifier)\n\t\t\t\t\treturn;\n\t\t\t\tif (!indexer.Target.IsMatch(upperBound.Target))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar rr = ctx.Resolve(upperBound) as MemberResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!(rr.Member.Name == \"Length\" && rr.Member.DeclaringType.Name == \"Array\" && rr.Member.DeclaringType.Namespace == \"System\") &&\n\t\t\t\t!(rr.Member.Name == \"Count\" && (IsEnumerable(rr.TargetResult.Type) || rr.TargetResult.Type.GetAllBaseTypes().Any(IsEnumerable))))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar variableInitializer = varDeclStmt.Variables.First();\n\t\t\t\tvar lr = ctx.Resolve(variableInitializer) as LocalResolveResult;\n\t\t\t\tif (lr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar ir = ctx.Resolve(varDecl) as LocalResolveResult;\n\t\t\t\tif (ir == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar analyze = new ConvertToConstantIssue.VariableUsageAnalyzation(ctx);\n\t\t\t\tanalyze.SetAnalyzedRange(\n\t\t\t\t\tvarDeclStmt,\n\t\t\t\t\tforStatement.EmbeddedStatement,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tforStatement.EmbeddedStatement.AcceptVisitor(analyze);\n\t\t\t\tif (analyze.GetStatus(lr.Variable) == ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod.VariableState.Changed ||\n\t\t\t\t    analyze.GetStatus(ir.Variable) == ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod.VariableState.Changed ||\n\t\t\t\t    analyze.GetStatus(ir.Variable) == ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod.VariableState.Used)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tforStatement.ForToken,\n\t\t\t\t\tctx.TranslateString(\"'for' loop can be converted to 'foreach'\"),\n\t\t\t\t\tctx.TranslateString(\"Convert to 'foreach'\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar foreachBody = (BlockStatement)forStatement.EmbeddedStatement.Clone();\n\t\t\t\t\t\tforeachBody.Statements.First().Remove();\n\n\t\t\t\t\t\tvar fe = new ForeachStatement {\n\t\t\t\t\t\t\tVariableType = new PrimitiveType(\"var\"),\n\t\t\t\t\t\t\tVariableName = variableInitializer.Name,\n\t\t\t\t\t\t\tInExpression = upperBound.Target.Clone(),\n\t\t\t\t\t\t\tEmbeddedStatement = foreachBody\n\t\t\t\t\t\t};\n\t\t\t\t\t\tscript.Replace(forStatement, fe); \n\t\t\t\t\t}\n\t\t\t\t) { IssueMarker = IssueMarker.DottedLine });\n\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/InvokeAsExtensionMethodIssue.cs",
    "content": "//\n// InvokeAsExtensionMethodIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Convert static method call to extension method call\",\n\t                  Description = \"If an extension method is called as static method convert it to method syntax\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"InvokeAsExtensionMethod\")]\n\tpublic class InvokeAsExtensionMethodIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<InvokeAsExtensionMethodIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocation)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocation);\n\t\t\t\tvar memberReference = invocation.Target as MemberReferenceExpression;\n\t\t\t\tif (memberReference == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar firstArgument = invocation.Arguments.FirstOrDefault();\n\t\t\t\tif (firstArgument is NullReferenceExpression)\n\t\t\t\t\treturn;\n\t\t\t\tvar invocationRR = ctx.Resolve(invocation) as CSharpInvocationResolveResult;\n\t\t\t\tif (invocationRR == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar method = invocationRR.Member as IMethod;\n\t\t\t\tif (method == null || !method.IsExtensionMethod || invocationRR.IsExtensionMethodInvocation)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tmemberReference.MemberNameToken,\n\t\t\t\t\tctx.TranslateString(\"Convert static method call to extension method call\"),\n\t\t\t\t\tctx.TranslateString(\"Convert to extension method call\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.Replace (\n\t\t\t\t\t\t\tinvocation, \n\t\t\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\t\t\tnew MemberReferenceExpression(firstArgument.Clone(), memberReference.MemberName),\n\t\t\t\t\t\t\t\tinvocation.Arguments.Skip(1).Select(arg => arg.Clone())\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/RewriteIfReturnToReturnIssue.cs",
    "content": "//\n// RewriteIfReturnToReturnIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'if...return' statement can be re-written as 'return' statement\",\n\t                  Description=\"Convert 'if...return' to 'return'\",\n\t                  Category = IssueCategories.Opportunities,\n\t                  Severity = Severity.Hint)]\n\tpublic class RewriteIfReturnToReturnIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RewriteIfReturnToReturnIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\n\t\t\t\tif (ifElseStatement.Parent is IfElseStatement)\n\t\t\t\t\treturn;\n\t\t\t\tExpression c, e1, e2;\n\t\t\t\tAstNode rs;\n\t\t\t\tif (!ConvertIfStatementToReturnStatementAction.GetMatch(ifElseStatement, out c, out e1, out e2, out rs))\n\t\t\t\t\treturn;\n\t\t\t\tif (ConvertIfStatementToConditionalTernaryExpressionIssue.IsComplexCondition(c) || \n\t\t\t\t    ConvertIfStatementToConditionalTernaryExpressionIssue.IsComplexExpression(e1) || \n\t\t\t\t    ConvertIfStatementToConditionalTernaryExpressionIssue.IsComplexExpression(e2))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\tctx.TranslateString(\"Convert to 'return' statement\")\n\t\t\t\t) { IssueMarker = IssueMarker.DottedLine, ActionProvider = { typeof(ConvertIfStatementToReturnStatementAction) } });\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/Opportunities/SuggestUseVarKeywordEvidentIssue.cs",
    "content": "﻿// \n// UseVarKeywordInspector.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Checks for places where the 'var' keyword can be used. Note that the action is actually done with a context\n\t/// action.\n\t/// </summary>\n\t[IssueDescription(\"Use 'var'\",\n\t\tDescription = \"Use 'var' keyword when possible\",\n\t\tCategory = IssueCategories.Opportunities,\n\t\tSeverity = Severity.Hint,\n\t\tAnalysisDisableKeyword = \"SuggestUseVarKeywordEvident\")]\n\tpublic class SuggestUseVarKeywordEvidentIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\n        class GatherVisitor : GatherVisitorBase<SuggestUseVarKeywordEvidentIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, SuggestUseVarKeywordEvidentIssue qualifierDirectiveEvidentIssueProvider) : base (ctx, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n            }\n\n\t\t\tpublic override void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tif (!ctx.Supports(UseVarKeywordAction.minimumVersion))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitSyntaxTree(syntaxTree);\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)\n\t\t\t{\n\t\t\t\tbase.VisitVariableDeclarationStatement(variableDeclarationStatement);\n\t\t\t\tif (variableDeclarationStatement.Type is PrimitiveType) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (variableDeclarationStatement.Type.IsVar()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (variableDeclarationStatement.Variables.Count != 1) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//only checks for cases where the type would be obvious - assignment of new, cast, etc.\n\t\t\t\t//also check the type actually matches else the user might want to assign different subclasses later\n\t\t\t\tvar v = variableDeclarationStatement.Variables.Single();\n\t\t\t\t\n\t\t\t\tvar arrCreate = v.Initializer as ArrayCreateExpression;\n\t\t\t\tif (arrCreate != null) {\n\t\t\t\t\tvar n = variableDeclarationStatement.Type as ComposedType;\n\t\t\t\t\t//FIXME: check the specifier compatibility\n\t\t\t\t\tif (n != null && n.ArraySpecifiers.Any() && n.BaseType.IsMatch(arrCreate.Type)) {\n\t\t\t\t\t\tAddIssue(variableDeclarationStatement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar objCreate = v.Initializer as ObjectCreateExpression;\n\t\t\t\tif (objCreate != null && objCreate.Type.IsMatch(variableDeclarationStatement.Type)) {\n\t\t\t\t\tAddIssue(variableDeclarationStatement);\n\t\t\t\t}\n\t\t\t\tvar asCast = v.Initializer as AsExpression;\n\t\t\t\tif (asCast != null && asCast.Type.IsMatch(variableDeclarationStatement.Type)) {\n\t\t\t\t\tAddIssue(variableDeclarationStatement);\n\t\t\t\t}\n\t\t\t\tvar cast = v.Initializer as CastExpression;\n\t\t\t\tif (cast != null && cast.Type.IsMatch(variableDeclarationStatement.Type)) {\n\t\t\t\t\tAddIssue(variableDeclarationStatement);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvoid AddIssue(VariableDeclarationStatement variableDeclarationStatement)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(variableDeclarationStatement.Type, ctx.TranslateString(\"Use 'var' keyword\")) { IssueMarker = IssueMarker.DottedLine, ActionProvider = { typeof(UseVarKeywordAction) } });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/AccessToStaticMemberViaDerivedTypeIssue.cs",
    "content": "//\n// CallToStaticMemberViaDerivedTypeIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Call to static member via a derived class\",\n\t                   Description = \"Suggests using the class declaring a static function when calling it.\",\n\t                   Category = IssueCategories.PracticesAndImprovements,\n\t                   Severity = Severity.Warning,\n                       AnalysisDisableKeyword = \"AccessToStaticMemberViaDerivedType\")]\n\tpublic class AccessToStaticMemberViaDerivedTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\n\t\t#region ICodeIssueProvider implementation\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<AccessToStaticMemberViaDerivedTypeIssue>\n\t\t{\n\t\t\treadonly BaseRefactoringContext context;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t\t\tif (memberReferenceExpression == null || memberReferenceExpression.Target is ThisReferenceExpression)\n\t\t\t\t\t// Call within current class scope using 'this' or 'base'\n\t\t\t\t\treturn;\n\t\t\t\tvar memberResolveResult = context.Resolve(memberReferenceExpression) as MemberResolveResult;\n\t\t\t\tif (memberResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (!memberResolveResult.Member.IsStatic)\n\t\t\t\t\treturn;\n\t\t\t\tHandleMember(memberReferenceExpression, memberReferenceExpression.Target, memberResolveResult.Member, memberResolveResult.TargetResult);\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tif (invocationExpression.Target is IdentifierExpression)\n\t\t\t\t\t// Call within current class scope without 'this' or 'base'\n\t\t\t\t\treturn;\n\t\t\t\tvar memberReference = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (memberReference == null || memberReference.Target is ThisReferenceExpression)\n\t\t\t\t\t// Call within current class scope using 'this' or 'base'\n\t\t\t\t\treturn;\n\t\t\t\tvar invocationResolveResult = context.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (invocationResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tHandleMember(invocationExpression, memberReference.Target, invocationResolveResult.Member, invocationResolveResult.TargetResult);\n\t\t\t}\n\n\t\t\tvoid HandleMember(Expression issueAnchor, Expression targetExpression, IMember member, ResolveResult targetResolveResult)\n\t\t\t{\n\t\t\t\tvar typeResolveResult = targetResolveResult as TypeResolveResult;\n\t\t\t\tif (typeResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (!member.IsStatic)\n\t\t\t\t\treturn;\n\t\t\t\tif (typeResolveResult.Type.Equals(member.DeclaringType))\n\t\t\t\t\treturn;\n\t\t\t\t// check whether member.DeclaringType contains the original type\n\t\t\t\t// (curiously recurring template pattern)\n\t\t\t\tvar v = new ContainsTypeVisitor(typeResolveResult.Type.GetDefinition());\n\t\t\t\tmember.DeclaringType.AcceptVisitor(v);\n\t\t\t\tif (v.IsContained)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(issueAnchor, context.TranslateString(\"Static method invoked via derived type\"),\n\t\t\t\t\tGetAction(context, targetExpression, member)));\n\t\t\t}\n\n\t\t\tCodeAction GetAction(BaseRefactoringContext context, Expression targetExpression,\n\t\t\t                     IMember member)\n\t\t\t{\n\t\t\t\tvar builder = context.CreateTypeSystemAstBuilder(targetExpression);\n\t\t\t\tvar newType = builder.ConvertType(member.DeclaringType);\n\t\t\t\tstring description = string.Format(\"{0} '{1}'\", context.TranslateString(\"Use base qualifier\"), newType.ToString());\n\t\t\t\treturn new CodeAction(description, script => {\n\t\t\t\t\tscript.Replace(targetExpression, newType);\n\t\t\t\t}, targetExpression);\n\t\t\t}\n\n\t\t\tsealed class ContainsTypeVisitor : TypeVisitor\n\t\t\t{\n\t\t\t\treadonly ITypeDefinition searchedType;\n\t\t\t\tinternal bool IsContained;\n\n\t\t\t\tpublic ContainsTypeVisitor(ITypeDefinition searchedType)\n\t\t\t\t{\n\t\t\t\t\tthis.searchedType = searchedType;\n\t\t\t\t}\n\n\t\t\t\tpublic override IType VisitTypeDefinition(ITypeDefinition type)\n\t\t\t\t{\n\t\t\t\t\tif (type.Equals(searchedType))\n\t\t\t\t\t\tIsContained = true;\n\t\t\t\t\treturn base.VisitTypeDefinition(type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/BaseMemberHasParamsIssue.cs",
    "content": "//\n// BaseMemberHasParamsIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Base parameter has 'params' modifier, but missing in overrider\",\n\t                  Description = \"Base parameter has 'params' modifier, but missing in overrider\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"BaseMemberHasParams\")]\n\tpublic class BaseMemberHasParamsIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<BaseMemberHasParamsIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!methodDeclaration.HasModifier(Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\tvar lastParam = methodDeclaration.Parameters.LastOrDefault();\n\t\t\t\tif (lastParam == null || lastParam.ParameterModifier == ParameterModifier.Params)\n\t\t\t\t\treturn;\n\t\t\t\tvar type = lastParam.Type as ComposedType;\n\t\t\t\tif (type == null || !type.ArraySpecifiers.Any())\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar baseMember = InheritanceHelper.GetBaseMember(rr.Member) as IMethod;\n\t\t\t\tif (baseMember == null || baseMember.Parameters.Count == 0 || !baseMember.Parameters.Last().IsParams)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tlastParam.NameToken,\n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Base method '{0}' has a 'params' modifier\"), baseMember.FullName),\n\t\t\t\t\tctx.TranslateString(\"Add 'params' modifier\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.ChangeModifier(lastParam, ParameterModifier.Params);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ConvertIfDoToWhileIssue.cs",
    "content": "//\n// ConvertIfDoToWhileIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'if-do-while' statement can be re-written as 'while' statement\",\n\t                  Description = \"Convert 'if-do-while' to 'while' statement\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ConvertIfDoToWhile\")]\n\tpublic class ConvertIfDoToWhileIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertIfDoToWhileIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode ifPattern = \n\t\t\t\tnew IfElseStatement(\n\t\t\t\t\tnew AnyNode (\"condition\"),\n\t\t\t\t\tPatternHelper.EmbeddedStatement (\n\t\t\t\t\t\tnew DoWhileStatement (new AnyNode(\"condition2\"), new AnyNode (\"EmbeddedStatement\"))\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\t\t\t\tvar match = ifPattern.Match(ifElseStatement);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tvar cond1 = match.Get<Expression>(\"condition\").Single();\n\t\t\t\t\tvar cond2 = match.Get<Expression>(\"condition2\").Single();\n\t\t\t\t\tif (!CSharpUtil.AreConditionsEqual(cond1, cond2))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\t\tctx.TranslateString(\"Statement can be simplified to 'while' statement\"),\n\t\t\t\t\t\tctx.TranslateString(\"Replace with 'while'\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\tifElseStatement, \n\t\t\t\t\t\t\t\tnew WhileStatement(\n\t\t\t\t\t\t\t\t\tcond1.Clone(),\n\t\t\t\t\t\t\t\t\tmatch.Get<Statement>(\"EmbeddedStatement\").Single().Clone()\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t) { IssueMarker = IssueMarker.DottedLine });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ConvertIfToOrExpressionIssue.cs",
    "content": "//\n// ConvertIfToOrExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'if' statement can be re-written as '||' expression\",\n\t                  Description = \"Convert 'if' to '||' expression\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ConvertIfToOrExpression\")]\n\tpublic class ConvertIfToOrExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tinternal static bool CheckTarget(Expression target, Expression expr)\n\t\t{\n\t\t\treturn !target.DescendantNodesAndSelf().Any(\n\t\t\t\tn => (n is IdentifierExpression || n is MemberReferenceExpression) && \n\t\t\t\texpr.DescendantNodesAndSelf().Any(n2 => ((INode)n).IsMatch(n2))\n\t\t\t);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertIfToOrExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode ifPattern = \n\t\t\t\tnew IfElseStatement(\n\t\t\t\t\tnew AnyNode (\"condition\"),\n\t\t\t\t\tPatternHelper.EmbeddedStatement (\n\t\t\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\t\t\tnew AnyNode(\"target\"),\n\t\t\t\t\t\t\tnew PrimitiveExpression (true)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\tstatic readonly AstNode varDelarationPattern = \n\t\t\t\tnew VariableDeclarationStatement(new AnyNode(\"type\"), Pattern.AnyString, new AnyNode(\"initializer\"));\n\n\t\t\tvoid AddTo(IfElseStatement ifElseStatement, VariableDeclarationStatement varDeclaration, Expression expr)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\n\t\t\t\tvar match = ifPattern.Match(ifElseStatement);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tvar varDeclaration = ifElseStatement.GetPrevSibling(s => s.Role == BlockStatement.StatementRole) as VariableDeclarationStatement;\n\t\t\t\t\tvar target = match.Get<Expression>(\"target\").Single();\n\t\t\t\t\tvar match2 = varDelarationPattern.Match(varDeclaration);\n\t\t\t\t\tif (match2.Success) {\n\t\t\t\t\t\tif (varDeclaration == null || target == null)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tvar initializer = varDeclaration.Variables.FirstOrDefault();\n\t\t\t\t\t\tif (initializer == null || !(target is IdentifierExpression) || ((IdentifierExpression)target).Identifier != initializer.Name)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tvar expr = match.Get<Expression>(\"condition\").Single();\n\t\t\t\t\t\tif (!CheckTarget(target, expr))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Convert to '||' expresssion\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Replace with '||'\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tvar variable = varDeclaration.Variables.First();\n\t\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\t\tvarDeclaration, \n\t\t\t\t\t\t\t\t\tnew VariableDeclarationStatement(\n\t\t\t\t\t\t\t\t\tvarDeclaration.Type.Clone(),\n\t\t\t\t\t\t\t\t\tvariable.Name,\n\t\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(variable.Initializer.Clone(), BinaryOperatorType.ConditionalOr, expr.Clone()) \n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tscript.Remove(ifElseStatement); \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.DottedLine });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar expr = match.Get<Expression>(\"condition\").Single();\n\t\t\t\t\t\tif (!CheckTarget(target, expr))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tifElseStatement.IfToken,\n\t\t\t\t\t\t\tctx.TranslateString(\"Convert to '|=' expresssion\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Replace with '|='\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\t\tifElseStatement, \n\t\t\t\t\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\t\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\t\t\t\t\t\t\ttarget.Clone(),\n\t\t\t\t\t\t\t\t\t\t\tAssignmentOperatorType.BitwiseOr,\n\t\t\t\t\t\t\t\t\t\t\texpr.Clone()) \n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ConvertToConstantIssue.cs",
    "content": "//\n// ConvertToConstantIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Threading;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing System;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Utils;\nusing ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Convert local variable or field to constant\",\n\t                  Description = \"Convert local variable or field to constant\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ConvertToConstant.Local\")]\n\tpublic class ConvertToConstantIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tinternal static IEnumerable<FieldDeclaration> CollectFields<T>(GatherVisitorBase<T> provider, TypeDeclaration typeDeclaration) where T : CodeIssueProvider\n\t\t{\n\t\t\tvar fieldVisitor = new ConvertToConstantIssue.FieldCollectVisitor<T>(provider.Ctx, typeDeclaration);\n\t\t\ttypeDeclaration.AcceptVisitor(fieldVisitor);\n\t\t\treturn fieldVisitor.CollectedFields;\n\t\t}\n\n\t\tclass FieldCollectVisitor<T> : GatherVisitorBase<T>  where T : CodeIssueProvider\n\t\t{\n\t\t\treadonly TypeDeclaration typeDeclaration;\n\t\t\tpublic readonly List<FieldDeclaration> CollectedFields = new List<FieldDeclaration>();\n\n\t\t\tpublic FieldCollectVisitor(BaseRefactoringContext context, TypeDeclaration typeDeclaration) : base (context)\n\t\t\t{\n\t\t\t\tthis.typeDeclaration = typeDeclaration;\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tif (IsSuppressed(fieldDeclaration.StartLocation))\n\t\t\t\t\treturn;\n\t\t\t\tCollectedFields.Add(fieldDeclaration); \n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration != this.typeDeclaration)\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertToConstantIssue>\n\t\t{\n\t\t\treadonly Stack<List<Tuple<VariableInitializer, IVariable>>> fieldStack = new Stack<List<Tuple<VariableInitializer, IVariable>>>();\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid Collect()\n\t\t\t{\n\t\t\t\tforeach (var varDecl in fieldStack.Peek()) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tvarDecl.Item1.NameToken,\n\t\t\t\t\t\tctx.TranslateString(\"Convert to constant\"),\n\t\t\t\t\t\tctx.TranslateString(\"To const\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar constVarDecl = (FieldDeclaration)varDecl.Item1.Parent;\n\t\t\t\t\t\t\tscript.ChangeModifier(constVarDecl, (constVarDecl.Modifiers & ~Modifiers.Static) | Modifiers.Const);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\tbase.VisitBlockStatement(blockStatement);\n\t\t\t\tif (blockStatement.Parent is EntityDeclaration || blockStatement.Parent is Accessor) {\n\t\t\t\t\tvar assignmentAnalysis = new VariableUsageAnalyzation (ctx);\n\t\t\t\t\tvar newVars = new List<Tuple<VariableInitializer, IVariable>>();\n\t\t\t\t\tblockStatement.AcceptVisitor(assignmentAnalysis); \n\t\t\t\t\tforeach (var variable in fieldStack.Pop()) {\n\t\t\t\t\t\tif (assignmentAnalysis.GetStatus(variable.Item2) == VariableState.Changed)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tnewVars.Add(variable);\n\t\t\t\t\t}\n\t\t\t\t\tfieldStack.Push(newVars);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic bool IsValidConstType(IType type)\n\t\t\t{\n\t\t\t\tvar def = type.GetDefinition();\n\t\t\t\tif (def == null)\n\t\t\t\t\treturn false;\n\t\t\t\treturn KnownTypeCode.Boolean <= def.KnownTypeCode && def.KnownTypeCode <= KnownTypeCode.Decimal ||\n\t\t\t\t\tdef.KnownTypeCode == KnownTypeCode.String;\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tvar list = new List<Tuple<VariableInitializer, IVariable>>();\n\t\t\t\tfieldStack.Push(list);\n\t\t\t\tforeach (var fieldDeclaration in ConvertToConstantIssue.CollectFields(this, typeDeclaration)) {\n\t\t\t\t\tif (IsSuppressed(fieldDeclaration.StartLocation))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.Modifiers.HasFlag (Modifiers.Const) || fieldDeclaration.Modifiers.HasFlag (Modifiers.Readonly))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.HasModifier(Modifiers.Public) || fieldDeclaration.HasModifier(Modifiers.Protected) || fieldDeclaration.HasModifier(Modifiers.Internal))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.Variables.Any (v => !ctx.Resolve (v.Initializer).IsCompileTimeConstant))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar rr = ctx.Resolve(fieldDeclaration.ReturnType);\n\t\t\t\t\tif (!IsValidConstType(rr.Type))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.Variables.Count() > 1)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar variable = fieldDeclaration.Variables.First();\n\t\t\t\t\tvar mr = ctx.Resolve(variable) as MemberResolveResult;\n\t\t\t\t\tif (mr == null || !(mr.Member is IVariable))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tlist.Add(Tuple.Create(variable, (IVariable)mr.Member)); \n\t\t\t\t}\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tCollect();\n\t\t\t\tfieldStack.Pop();\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableDeclarationStatement (VariableDeclarationStatement varDecl)\n\t\t\t{\n\t\t\t\tbase.VisitVariableDeclarationStatement(varDecl);\n\t\t\t\tif (varDecl.Modifiers.HasFlag (Modifiers.Const) || varDecl.Role == ForStatement.InitializerRole)\n\t\t\t\t\treturn;\n\t\t\t\tif (varDecl.Variables.Count () > 1)\n\t\t\t\t\treturn;\n\t\t\t\tif (varDecl.Variables.Any (v => !ctx.Resolve (v.Initializer).IsCompileTimeConstant))\n\t\t\t\t\treturn;\n\t\t\t\tvar containingBlock = varDecl.GetParent<BlockStatement> ();\n\t\t\t\tif (containingBlock == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar returnTypeRR = ctx.Resolve(varDecl.Type);\n\t\t\t\tif (!IsValidConstType(returnTypeRR.Type))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar variable = varDecl.Variables.First();\n\t\t\t\tvar vr = ctx.Resolve(variable) as LocalResolveResult;\n\t\t\t\tif (vr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (ctx.Resolve(variable.Initializer).ConstantValue == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar assignmentAnalysis = new VariableUsageAnalyzation (ctx);\n\n\t\t\t\tcontainingBlock.AcceptVisitor(assignmentAnalysis);\n\n\t\t\t\tif (assignmentAnalysis.GetStatus(vr.Variable) == VariableState.Changed)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue (new CodeIssue(\n\t\t\t\t\tvariable.NameToken,\n\t\t\t\t\tctx.TranslateString (\"Convert to constant\"),\n\t\t\t\t\tctx.TranslateString (\"To const\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar constVarDecl = (VariableDeclarationStatement)varDecl.Clone ();\n\t\t\t\t\t\tconstVarDecl.Modifiers |= Modifiers.Const;\n\t\t\t\t\t\tif (varDecl.Type.IsVar()) {\n\t\t\t\t\t\t\tvar builder = ctx.CreateTypeSystemAstBuilder(varDecl);\n\t\t\t\t\t\t\tconstVarDecl.Type = builder.ConvertType (ctx.Resolve(varDecl.Type).Type);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscript.Replace (varDecl, constVarDecl);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\n\n\t\tpublic class VariableUsageAnalyzation : DepthFirstAstVisitor\n\t\t{\n\t\t\treadonly BaseRefactoringContext context;\n\n\t\t\treadonly Dictionary<IVariable, VariableState> states = new Dictionary<IVariable, VariableState> ();\n\n\t\t\tTextLocation startLocation = TextLocation.Empty;\n\t\t\tTextLocation endLocation = TextLocation.Empty;\n\n\t\t\tpublic VariableUsageAnalyzation (BaseRefactoringContext context)\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t}\n\n\t\t\tpublic bool Has(IVariable variable)\n\t\t\t{\n\t\t\t\treturn states.ContainsKey (variable);\n\t\t\t}\n\n\t\t\tpublic void SetAnalyzedRange(AstNode start, AstNode end, bool startInclusive = true, bool endInclusive = true)\n\t\t\t{\n\t\t\t\tif (start == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"start\");\n\t\t\t\tif (end == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"end\");\n\t\t\t\tstartLocation = startInclusive ? start.StartLocation : start.EndLocation;\n\t\t\t\tendLocation = endInclusive ? end.EndLocation : end.StartLocation;\n\t\t\t\tstates.Clear ();\n\t\t\t}\n\n\t\t\tpublic VariableState GetStatus (IVariable variable)\n\t\t\t{\n\t\t\t\tVariableState state;\n\t\t\t\tif (!states.TryGetValue (variable, out state))\n\t\t\t\t\treturn VariableState.None;\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\tvoid SetState (ResolveResult rr, VariableState state)\n\t\t\t{\n\t\t\t\tIVariable variable = null;\n\t\t\t\tvar lr = rr as LocalResolveResult;\n\t\t\t\tif (lr != null)\n\t\t\t\t\tvariable = lr.Variable;\n\t\t\t\tvar mr = rr as MemberResolveResult;\n\t\t\t\tif (mr != null)\n\t\t\t\t\tvariable = mr.Member as IVariable;\n\t\t\t\tif (variable == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar sv = variable as SpecializedField;\n\t\t\t\tif (sv != null) {\n\t\t\t\t\tvariable = sv.MemberDefinition as IVariable;\n\t\t\t\t}\n\t\t\t\tVariableState oldState;\n\t\t\t\tif (states.TryGetValue (variable, out oldState)) {\n\t\t\t\t\tif (oldState < state)\n\t\t\t\t\t\tstates [variable] = state;\n\t\t\t\t} else {\n\t\t\t\t\tstates [variable] = state;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tif (startLocation.IsEmpty || startLocation <= identifierExpression.StartLocation && identifierExpression.EndLocation <= endLocation) {\n\t\t\t\t\tSetState (context.Resolve(identifierExpression), VariableState.Used);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tif (startLocation.IsEmpty || startLocation <= assignmentExpression.StartLocation && assignmentExpression.EndLocation <= endLocation) {\n\t\t\t\t\tSetState(context.Resolve(assignmentExpression.Left), VariableState.Changed);\n\t\t\t\t}\n\t\t\t\tbase.VisitAssignmentExpression (assignmentExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t\t{\n\t\t\t\tif (startLocation.IsEmpty || startLocation <= directionExpression.StartLocation && directionExpression.EndLocation <= endLocation) {\n\t\t\t\t\tSetState(context.Resolve(directionExpression.Expression), VariableState.Changed);\n\t\t\t\t}\n\t\t\t\tbase.VisitDirectionExpression (directionExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tif (startLocation.IsEmpty || startLocation <= unaryOperatorExpression.StartLocation && unaryOperatorExpression.EndLocation <= endLocation) {\n\t\t\t\t\tif (unaryOperatorExpression.Operator == UnaryOperatorType.Increment || unaryOperatorExpression.Operator == UnaryOperatorType.Decrement ||\n\t\t\t\t\t    unaryOperatorExpression.Operator == UnaryOperatorType.PostIncrement || unaryOperatorExpression.Operator == UnaryOperatorType.PostDecrement) {\n\t\t\t\t\t\tSetState(context.Resolve(unaryOperatorExpression.Expression), VariableState.Changed);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbase.VisitUnaryOperatorExpression (unaryOperatorExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitNamedExpression(NamedExpression namedExpression)\n\t\t\t{\n\t\t\t\tSetState(context.Resolve(namedExpression), VariableState.Changed);\n\t\t\t\tbase.VisitNamedExpression(namedExpression);\n\t\t\t}\n\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/EmptyEmbeddedStatementIssue.cs",
    "content": "//\n// Issue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Empty control statement body\",\n\t                   Description = \"';' should be avoided. Use '{}' instead\",\n\t                   Category = IssueCategories.PracticesAndImprovements,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"EmptyEmbeddedStatement\")]\n\tpublic class EmptyEmbeddedStatementIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<EmptyEmbeddedStatementIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitWhileStatement(WhileStatement whileStatement)\n\t\t\t{\n\t\t\t\tbase.VisitWhileStatement(whileStatement);\n\t\t\t\tvar statement = whileStatement.EmbeddedStatement as EmptyStatement;\n\t\t\t\tif (statement == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(whileStatement.EmbeddedStatement,\n\t\t\t\t                     ctx.TranslateString(\"';' should be avoided. Use '{}' instead\"), ctx.TranslateString(\"Replace with '{}'\"),\n\t\t\t\t\tscript => script.Replace(whileStatement.EmbeddedStatement, new BlockStatement())));\n\t\t\t}\n\n\t\t\tpublic override void VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForeachStatement(foreachStatement);\n\t\t\t\tvar statement = foreachStatement.EmbeddedStatement as EmptyStatement;\n\t\t\t\tif (statement == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(foreachStatement.EmbeddedStatement,\n\t\t\t\t                     ctx.TranslateString(\"';' should be avoided. Use '{}' instead\"), ctx.TranslateString(\"Replace with '{}'\"),\n\t\t\t\t\tscript => script.Replace(foreachStatement.EmbeddedStatement, new BlockStatement())));\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\t\t\t\tvar statement = ifElseStatement.TrueStatement as EmptyStatement;\n\t\t\t\tif (statement == null)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(ifElseStatement.TrueStatement, \n\t\t\t\t                     ctx.TranslateString(\"';' should be avoided. Use '{}' instead\"), ctx.TranslateString(\"Replace with '{}'\"),\n\t\t\t\t\tscript => script.Replace(ifElseStatement.TrueStatement, new BlockStatement())));\n\t\t\t}\n\n\t\t\tpublic override void VisitForStatement(ForStatement forStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForStatement(forStatement);\n\n\t\t\t\tvar statement = forStatement.EmbeddedStatement as EmptyStatement;\n\t\t\t\tif (statement == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(forStatement.EmbeddedStatement,\n\t\t\t\t                     ctx.TranslateString(\"';' should be avoided. Use '{}' instead\"), ctx.TranslateString(\"Replace with '{}'\"),\n\t\t\t\t\tscript => script.Replace(forStatement.EmbeddedStatement, new BlockStatement())));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/FieldCanBeMadeReadOnlyIssue.cs",
    "content": "//\n// FieldCanBeMadeReadOnlyIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Threading;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing System;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Utils;\nusing ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Convert field to readonly\",\n\t                  Description = \"Convert field to readonly\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"FieldCanBeMadeReadOnly.Local\")]\n\tpublic class FieldCanBeMadeReadOnlyIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<FieldCanBeMadeReadOnlyIssue>\n\t\t{\n\t\t\treadonly Stack<List<Tuple<VariableInitializer, IVariable, VariableState>>> fieldStack = new Stack<List<Tuple<VariableInitializer, IVariable, VariableState>>>();\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid Collect()\n\t\t\t{\n\t\t\t\tforeach (var varDecl in fieldStack.Peek()) {\n\t\t\t\t\tif (varDecl.Item3 == VariableState.None)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tvarDecl.Item1.NameToken,\n\t\t\t\t\t\tctx.TranslateString(\"Convert to readonly\"),\n\t\t\t\t\t\tctx.TranslateString(\"To readonly\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar field = (FieldDeclaration)varDecl.Item1.Parent;\n\t\t\t\t\t\tscript.ChangeModifier(field, field.Modifiers | Modifiers.Readonly);\n\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\t\n\t\t\t\tvar list = new List<Tuple<VariableInitializer, IVariable, VariableState>>();\n\t\t\t\tfieldStack.Push(list);\n\n\t\t\t\tforeach (var fieldDeclaration in ConvertToConstantIssue.CollectFields (this, typeDeclaration)) {\n\t\t\t\t\tif (fieldDeclaration.HasModifier(Modifiers.Const) || fieldDeclaration.HasModifier(Modifiers.Readonly))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.HasModifier(Modifiers.Public) || fieldDeclaration.HasModifier(Modifiers.Protected) || fieldDeclaration.HasModifier(Modifiers.Internal))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (fieldDeclaration.Variables.Count() > 1)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar variable = fieldDeclaration.Variables.First();\n\t\t\t\t\tvar rr = ctx.Resolve(fieldDeclaration.ReturnType);\n\t\t\t\t\tif (rr.Type.IsReferenceType == false) {\n\t\t\t\t\t\t// Value type:\n\t\t\t\t\t\tvar def = rr.Type.GetDefinition();\n\t\t\t\t\t\tif (def != null && def.KnownTypeCode == KnownTypeCode.None) {\n\t\t\t\t\t\t\t// user-defined value type -- might be mutable\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (ctx.Resolve (variable.Initializer).IsCompileTimeConstant) {\n\t\t\t\t\t\t\t// handled by ConvertToConstantIssue\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar mr = ctx.Resolve(variable) as MemberResolveResult;\n\t\t\t\t\tif (mr == null || !(mr.Member is IVariable))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tlist.Add(Tuple.Create(variable, (IVariable)mr.Member, VariableState.None)); \n\t\t\t\t}\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tCollect();\n\t\t\t\tfieldStack.Pop();\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\n\t\t\t\tforeach (var node in constructorDeclaration.Descendants) {\n\t\t\t\t\tif (node is AnonymousMethodExpression || node is LambdaExpression) {\n\t\t\t\t\t\tnode.AcceptVisitor(this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar assignmentAnalysis = new ConvertToConstantIssue.VariableUsageAnalyzation (ctx);\n\t\t\t\t\t\tvar newVars = new List<Tuple<VariableInitializer, IVariable, VariableState>>();\n\t\t\t\t\t\tnode.AcceptVisitor(assignmentAnalysis); \n\t\t\t\t\t\tforeach (var variable in fieldStack.Pop()) {\n\t\t\t\t\t\t\tvar state = assignmentAnalysis.GetStatus(variable.Item2);\n\t\t\t\t\t\t\tif (variable.Item3 > state)\n\t\t\t\t\t\t\t\tstate = variable.Item3;\n\t\t\t\t\t\t\tnewVars.Add(new Tuple<VariableInitializer, IVariable, VariableState> (variable.Item1, variable.Item2, state));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfieldStack.Push(newVars);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\tvar assignmentAnalysis = new ConvertToConstantIssue.VariableUsageAnalyzation (ctx);\n\t\t\t\tvar newVars = new List<Tuple<VariableInitializer, IVariable, VariableState>>();\n\t\t\t\tblockStatement.AcceptVisitor(assignmentAnalysis); \n\t\t\t\t\tforeach (var variable in fieldStack.Pop()) {\n\t\t\t\t\t\tvar state = assignmentAnalysis.GetStatus(variable.Item2);\n\t\t\t\t\t\tif (state == VariableState.Changed)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tnewVars.Add(new Tuple<VariableInitializer, IVariable, VariableState> (variable.Item1, variable.Item2, state));\n\t\t\t\t\t}\n\t\t\t\t\tfieldStack.Push(newVars);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/MemberCanBeMadeStaticIssue.cs",
    "content": "//\n// MemberCanBeMadeStaticIssue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//       Mike krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Member can be made static\",\n\t                  Description = \"A member doesn't use 'this' object neither explicit nor implicit. It can be made static.\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Hint,\n\t                  AnalysisDisableKeyword = \"MemberCanBeMadeStatic.Local\"\n\t                  )]\n\t[SubIssueAttribute(CommonSubIssues.PrivateMember)]\n\t[SubIssueAttribute(CommonSubIssues.NonPrivateMember, false)]\n\tpublic class MemberCanBeMadeStaticIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tprivate class GatherVisitor : GatherVisitorBase<MemberCanBeMadeStaticIssue>\n\t\t{\n\t\t\tbool CheckPrivateMember {\n\t\t\t\tget {\n\t\t\t\t\treturn SubIssue == CommonSubIssues.PrivateMember;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context)\n\t\t\t\t: base(context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(typeDeclaration);\n\t\t\t\tif (rr.Type.GetNonInterfaceBaseTypes().Any(t => t.Name == \"MarshalByRefObject\" && t.Namespace == \"System\"))\n\t\t\t\t\treturn; // ignore MarshalByRefObject, as only instance method calls get marshaled\n\t\t\t\t\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t}\n\n\t\t\tbool SkipMember(IMember resolved)\n\t\t\t{\n\t\t\t\treturn resolved.Accessibility == Accessibility.Private && !CheckPrivateMember ||\n\t\t\t\t\tresolved.Accessibility != Accessibility.Private && CheckPrivateMember;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tvar context = ctx;\n\t\t\t\tif (methodDeclaration.HasModifier(Modifiers.Static) ||\n\t\t\t\t    methodDeclaration.HasModifier(Modifiers.Virtual) ||\n\t\t\t\t    methodDeclaration.HasModifier(Modifiers.Override) ||\n\t\t\t\t    methodDeclaration.HasModifier(Modifiers.New) ||\n\t\t\t\t    methodDeclaration.Attributes.Any())\n\t\t\t\t\treturn;\n\n\t\t\t\tvar body = methodDeclaration.Body;\n\t\t\t\t// skip empty methods\n\t\t\t\tif (!body.Statements.Any())\n\t\t\t\t\treturn;\n\n\t\t\t\tif (body.Statements.Count == 1) {\n\t\t\t\t\tif (body.Statements.First () is ThrowStatement)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tvar resolved = context.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (resolved == null || SkipMember(resolved.Member))\n\t\t\t\t\treturn;\n\t\t\t\tvar isImplementingInterface = resolved.Member.ImplementedInterfaceMembers.Any();\n\t\t\t\tif (isImplementingInterface)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (StaticVisitor.UsesNotStaticMember(context, body))\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tmethodDeclaration.NameToken.StartLocation, methodDeclaration.NameToken.EndLocation,\n\t\t\t\t\tstring.Format(context.TranslateString(\"Method '{0}' can be made static.\"), methodDeclaration.Name),\n\t\t\t\t\tstring.Format(context.TranslateString(\"Make '{0}' static\"), methodDeclaration.Name),\n\t\t\t\t\tscript => script.ChangeModifier(methodDeclaration, methodDeclaration.Modifiers | Modifiers.Static)) { IssueMarker = IssueMarker.DottedLine });\n\t\t\t}\n\n\t\t\tstatic bool IsEmpty(Accessor setter)\n\t\t\t{\n\t\t\t\treturn setter.IsNull || \n\t\t\t\t\t!setter.Body.Statements.Any() ||\n\t\t\t\t\tsetter.Body.Statements.Count == 1 && setter.Body.Statements.First () is ThrowStatement;\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tif (propertyDeclaration.HasModifier(Modifiers.Static) ||\n\t\t\t\t    propertyDeclaration.HasModifier(Modifiers.Virtual) ||\n\t\t\t\t    propertyDeclaration.HasModifier(Modifiers.Override) ||\n\t\t\t\t    propertyDeclaration.HasModifier(Modifiers.New) ||\n\t\t\t\t    propertyDeclaration.Attributes.Any())\n\t\t\t\t\treturn;\n\n\t\t\t\tif (IsEmpty(propertyDeclaration.Setter) && IsEmpty(propertyDeclaration.Getter))\n\t\t\t\t\treturn;\n\n\n\t\t\t\tvar resolved = ctx.Resolve(propertyDeclaration) as MemberResolveResult;\n\t\t\t\tif (resolved == null || SkipMember(resolved.Member))\n\t\t\t\t\treturn;\n\t\t\t\tvar isImplementingInterface = resolved.Member.ImplementedInterfaceMembers.Any();\n\t\t\t\tif (isImplementingInterface)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!propertyDeclaration.Getter.IsNull && StaticVisitor.UsesNotStaticMember(ctx, propertyDeclaration.Getter.Body) ||\n\t\t\t\t    !propertyDeclaration.Setter.IsNull && StaticVisitor.UsesNotStaticMember(ctx, propertyDeclaration.Setter.Body))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(propertyDeclaration.NameToken.StartLocation, propertyDeclaration.NameToken.EndLocation,\n\t\t\t\t         string.Format(ctx.TranslateString(\"Property '{0}' can be made static.\"), propertyDeclaration.Name),\n\t\t\t\t         string.Format(ctx.TranslateString(\"Make '{0}' static\"), propertyDeclaration.Name),\n\t\t\t\t\tscript => script.ChangeModifier(propertyDeclaration, propertyDeclaration.Modifiers | Modifiers.Static)) { IssueMarker = IssueMarker.DottedLine });\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tif (eventDeclaration.HasModifier(Modifiers.Static) ||\n\t\t\t\t    eventDeclaration.HasModifier(Modifiers.Virtual) ||\n\t\t\t\t    eventDeclaration.HasModifier(Modifiers.Override) ||\n\t\t\t\t    eventDeclaration.HasModifier(Modifiers.New) ||\n\t\t\t\t    eventDeclaration.Attributes.Any())\n\t\t\t\t\treturn;\n\n\t\t\t\tif (IsEmpty(eventDeclaration.RemoveAccessor) && IsEmpty(eventDeclaration.AddAccessor))\n\t\t\t\t\treturn;\n\n\n\t\t\t\tvar resolved = ctx.Resolve(eventDeclaration) as MemberResolveResult;\n\t\t\t\tif (resolved == null || SkipMember(resolved.Member))\n\t\t\t\t\treturn;\n\t\t\t\tvar isImplementingInterface = resolved.Member.ImplementedInterfaceMembers.Any();\n\t\t\t\tif (isImplementingInterface)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!eventDeclaration.AddAccessor.IsNull && StaticVisitor.UsesNotStaticMember(ctx, eventDeclaration.AddAccessor.Body) ||\n\t\t\t\t    !eventDeclaration.RemoveAccessor.IsNull && StaticVisitor.UsesNotStaticMember(ctx, eventDeclaration.RemoveAccessor.Body))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(eventDeclaration.NameToken.StartLocation, eventDeclaration.NameToken.EndLocation,\n\t\t\t\t         string.Format(ctx.TranslateString(\"Event '{0}' can be made static.\"), eventDeclaration.Name),\n\t\t\t\t         string.Format(ctx.TranslateString(\"Make '{0}' static\"), eventDeclaration.Name),\n\t\t\t\t\tscript => script.ChangeModifier(eventDeclaration, eventDeclaration.Modifiers | Modifiers.Static)) { IssueMarker = IssueMarker.DottedLine });\n\t\t\t}\n\n\n\t\t\tstatic void DoStaticMethodGlobalOperation(AstNode fnode, RefactoringContext fctx, MemberResolveResult rr,\n\t\t\t                                                           Script fscript)\n\t\t\t{\n\t\t\t\tif (fnode is MemberReferenceExpression) {\n\t\t\t\t\tvar memberReference = fctx.CreateShortType(rr.Member.DeclaringType).Member(rr.Member.Name);\n\t\t\t\t\tfscript.Replace(fnode, memberReference);\n\t\t\t\t} else {\n\t\t\t\t\tvar invoke = fnode as InvocationExpression;\n\t\t\t\t\tif (invoke == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif ((invoke.Target is MemberReferenceExpression))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar memberReference = fctx.CreateShortType(rr.Member.DeclaringType).Member(rr.Member.Name);\n\t\t\t\t\tfscript.Replace(invoke.Target, memberReference);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ParameterCanBeDeclaredWithBaseTypeIssue.cs",
    "content": "//\n// ParameterCouldBeDeclaredWithBaseTypeIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Parameter can be declared with base type\",\n\t\tDescription = \"Finds parameters that can be demoted to a base class.\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Hint,\n\t\tSuppressMessageCategory=\"Microsoft.Design\",\n\t\tSuppressMessageCheckId=\"CA1011:ConsiderPassingBaseTypesAsParameters\"\n\t)]\n\tpublic class ParameterCanBeDeclaredWithBaseTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tbool tryResolve;\n\n\t\tpublic ParameterCanBeDeclaredWithBaseTypeIssue() : this (true)\n\t\t{\n\t\t}\n\n\t\tpublic ParameterCanBeDeclaredWithBaseTypeIssue(bool tryResolve)\n\t\t{\n\t\t\tthis.tryResolve = tryResolve;\n\t\t}\n\n\t\t#region ICodeIssueProvider implementation\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, tryResolve);\n\t\t}\n\t\t#endregion\n\n\t\tclass GatherVisitor : GatherVisitorBase<ParameterCanBeDeclaredWithBaseTypeIssue>\n\t\t{\n\t\t\tbool tryResolve;\n\t\t\t\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context, bool tryResolve) : base (context)\n\t\t\t{\n\t\t\t\tthis.tryResolve = tryResolve;\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tmethodDeclaration.Attributes.AcceptVisitor(this);\n\t\t\t\tif (HasEntryPointSignature(methodDeclaration) || methodDeclaration.HasModifier(Modifiers.Public) || methodDeclaration.HasModifier(Modifiers.Protected))\n\t\t\t\t\treturn;\n\t\t\t\tvar eligibleParameters = methodDeclaration.Parameters\n\t\t\t\t\t.Where(p => p.ParameterModifier != ParameterModifier.Out && p.ParameterModifier != ParameterModifier.Ref)\n\t\t\t\t\t.ToList();\n\t\t\t\tif (eligibleParameters.Count == 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar declarationResolveResult = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (declarationResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar member = declarationResolveResult.Member;\n\t\t\t\tif (member.IsOverride || member.IsOverridable || member.ImplementedInterfaceMembers.Any())\n\t\t\t\t\treturn;\n\n\t\t\t\tvar collector = new TypeCriteriaCollector(ctx);\n\t\t\t\tmethodDeclaration.AcceptVisitor(collector);\n\n\t\t\t\tforeach (var parameter in eligibleParameters) {\n\t\t\t\t\tProcessParameter(parameter, methodDeclaration.Body, collector);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool HasEntryPointSignature(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!methodDeclaration.Modifiers.HasFlag(Modifiers.Static))\n\t\t\t\t\treturn false;\n\t\t\t\tvar returnType = ctx.Resolve(methodDeclaration.ReturnType).Type;\n\t\t\t\tif (!returnType.IsKnownType(KnownTypeCode.Int32) && !returnType.IsKnownType(KnownTypeCode.Void))\n\t\t\t\t\treturn false;\n\t\t\t\tvar parameterCount = methodDeclaration.Parameters.Count;\n\t\t\t\tif (parameterCount == 0)\n\t\t\t\t\treturn true;\n\t\t\t\tif (parameterCount != 1)\n\t\t\t\t\treturn false;\n\t\t\t\tvar parameterType = ctx.Resolve(methodDeclaration.Parameters.First()).Type as ArrayType;\n\t\t\t\tif (parameterType == null || !parameterType.ElementType.IsKnownType(KnownTypeCode.String))\n\t\t\t\t\treturn false;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tbool FilterOut(IType current, IType newType)\n\t\t\t{\n\t\t\t\t// Filter out some strange framework types like _Exception\n\t\t\t\treturn newType.Namespace.StartsWith(\"System.\", StringComparison.Ordinal) && \n\t\t\t\t\t   newType.Name.StartsWith(\"_\", StringComparison.Ordinal) ? true : false;\n\t\t\t}\n\n\t\t\tvoid ProcessParameter(ParameterDeclaration parameter, AstNode rootResolutionNode, TypeCriteriaCollector collector)\n\t\t\t{\n\t\t\t\tvar localResolveResult = ctx.Resolve(parameter) as LocalResolveResult;\n\t\t\t\tif (localResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar variable = localResolveResult.Variable;\n\t\t\t\tvar typeKind = variable.Type.Kind;\n\t\t\t\tif (!(typeKind == TypeKind.Class ||\n\t\t\t\t\t  typeKind == TypeKind.Struct ||\n\t\t\t\t\t  typeKind == TypeKind.Interface ||\n\t\t\t\t\t  typeKind == TypeKind.Array) ||\n\t\t\t\t    parameter.Type is PrimitiveType ||\n\t\t\t\t\t!collector.UsedVariables.Contains(variable)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar candidateTypes = localResolveResult.Type.GetAllBaseTypes().ToList();\n\t\t\t\tTypesChecked += candidateTypes.Count;\n\t\t\t\tvar criterion = collector.GetCriterion(variable);\n\n\t\t\t\tvar possibleTypes = \n\t\t\t\t\t(from type in candidateTypes\n\t\t\t\t\t where !type.Equals(localResolveResult.Type) && criterion.SatisfiedBy(type)\n\t\t\t\t\t select type).ToList();\n\n\t\t\t\tTypeResolveCount += possibleTypes.Count;\n\t\t\t\tvar validTypes = \n\t\t\t\t\t(from type in possibleTypes\n\t\t\t\t\t where (!tryResolve || TypeChangeResolvesCorrectly(ctx, parameter, rootResolutionNode, type)) && !FilterOut (variable.Type, type)\n\t\t\t\t\t select type).ToList();\n\t\t\t\tif (validTypes.Any()) {\n\t\t\t\t\tAddIssue(new CodeIssue(parameter.Type, ctx.TranslateString(\"Parameter can be declared with base type\"), GetActions(parameter, validTypes)) {\n\t\t\t\t\t\tIssueMarker = IssueMarker.DottedLine\n\t\t\t\t\t});\n\t\t\t\t\tMembersWithIssues++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinternal int TypeResolveCount = 0;\n\t\t\tinternal int TypesChecked = 0;\n\t\t\tinternal int MembersWithIssues = 0;\n\t\t\tinternal int MethodResolveCount = 0;\n\n\t\t\tIEnumerable<CodeAction> GetActions(ParameterDeclaration parameter, IEnumerable<IType> possibleTypes)\n\t\t\t{\n\t\t\t\tvar csResolver = ctx.Resolver.GetResolverStateBefore(parameter);\n\t\t\t\tvar astBuilder = new TypeSystemAstBuilder(csResolver);\n\t\t\t\tforeach (var type in possibleTypes) {\n\t\t\t\t\tvar localType = type;\n\t\t\t\t\tvar message = String.Format(ctx.TranslateString(\"Demote parameter to '{0}'\"), type.FullName);\n\t\t\t\t\tyield return new CodeAction(message, script => {\n\t\t\t\t\t\tscript.Replace(parameter.Type, astBuilder.ConvertType(localType));\n\t\t\t\t\t}, parameter.Type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t    public static bool TypeChangeResolvesCorrectly(BaseRefactoringContext ctx, ParameterDeclaration parameter, AstNode rootNode, IType type)\n\t    {\n\t        var resolver = ctx.GetResolverStateBefore(rootNode);\n\t        resolver = resolver.AddVariable(new DefaultParameter(type, parameter.Name));\n\t        var astResolver = new CSharpAstResolver(resolver, rootNode, ctx.UnresolvedFile);\n\t        var validator = new TypeChangeValidationNavigator();\n\t        astResolver.ApplyNavigator(validator, ctx.CancellationToken);\n\t        return !validator.FoundErrors;\n\t    }\n\n\t    class TypeChangeValidationNavigator : IResolveVisitorNavigator\n\t\t{\n\t\t\tpublic bool FoundErrors { get; private set; }\n\n\t\t\t#region IResolveVisitorNavigator implementation\n\t\t\tpublic ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t\t{\n\t\t\t\tif (FoundErrors)\n\t\t\t\t\treturn ResolveVisitorNavigationMode.Skip;\n\t\t\t\treturn ResolveVisitorNavigationMode.Resolve;\n\t\t\t}\n\n\t\t\tpublic void Resolved(AstNode node, ResolveResult result)\n\t\t\t{\n//\t\t\t\tbool errors = result.IsError;\n\t\t\t\tFoundErrors |= result.IsError;\n\t\t\t}\n\n\t\t\tpublic void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t\t// no-op\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t}\n\t}\n\n\tpublic interface ITypeCriterion\n\t{\n\t\t/// <summary>\n\t\t/// Checks if the given type satisfies the critrion.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// <c>true</c>, if the type satisfies the criterion, <c>false</c> otherwise.\n\t\t/// </returns>\n\t\t/// <param name='type'>\n\t\t/// The type to check.\n\t\t/// </param>\n\t\tbool SatisfiedBy(IType type);\n\t}\n\n\tpublic class SupportsIndexingCriterion : ITypeCriterion\n\t{\n\t\tIType returnType;\n\n\t\tIList<IType> argumentTypes;\n\n\t\tCSharpConversions conversions;\n\n\t\tbool isWriteAccess;\n\n\t\tpublic SupportsIndexingCriterion(IType returnType, IEnumerable<IType> argumentTypes, CSharpConversions conversions, bool isWriteAccess = false)\n\t\t{\n\t\t\tif (returnType == null)\n\t\t\t\tthrow new ArgumentNullException(\"returnType\");\n\t\t\tif (argumentTypes == null)\n\t\t\t\tthrow new ArgumentNullException(\"argumentTypes\");\n\t\t\tif (conversions == null)\n\t\t\t\tthrow new ArgumentNullException(\"conversions\");\n\n\t\t\tthis.returnType = returnType;\n\t\t\tthis.argumentTypes = argumentTypes.ToList();\n\t\t\tthis.conversions = conversions;\n\t\t\tthis.isWriteAccess = isWriteAccess;\n\t\t}\n\n\t\t#region ITypeCriterion implementation\n\n\t\tpublic bool SatisfiedBy(IType type)\n\t\t{\n\t\t\tvar accessors = type.GetAccessors().ToList();\n\t\t\treturn accessors.Any(member => {\n\t\t\t\tvar parameterizedMember = member as IParameterizedMember;\n\t\t\t\tif (parameterizedMember == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (isWriteAccess) {\n\t\t\t\t\tvar parameterCount = member.Parameters.Count;\n\t\t\t\t\tif (member.Name != \"set_Item\" || parameterCount < 2)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tvar indexerElementType = parameterizedMember.Parameters.Last().Type;\n\t\t\t\t\tvar indexerParameterTypes = parameterizedMember.Parameters.Take(parameterCount - 1).Select(p => p.Type).ToList();\n\t\t\t\t\treturn IsSignatureMatch(indexerElementType, indexerParameterTypes);\n\t\t\t\t} else {\n\t\t\t\t\tif (member.Name != \"get_Item\" || member.Parameters.Count < 1)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tvar indexerElementType = parameterizedMember.ReturnType;\n\t\t\t\t\tvar indexerParameterTypes = parameterizedMember.Parameters.Select(p => p.Type).ToList();\n\t\t\t\t\treturn IsSignatureMatch(indexerElementType, indexerParameterTypes);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t#endregion\n\n\t\tbool IsSignatureMatch(IType indexerElementType, IList<IType> indexerParameterTypes)\n\t\t{\n\t\t\tindexerElementType.GetAllBaseTypes();\n\t\t\tif (indexerParameterTypes.Count != argumentTypes.Count)\n\t\t\t\treturn false;\n\t\t\tvar returnConversion = conversions.ImplicitConversion(indexerElementType, returnType);\n\t\t\tif (!returnConversion.IsValid)\n\t\t\t\treturn false;\n\t\t\tfor (int i = 0; i < argumentTypes.Count; i++) {\n\t\t\t\tvar conversion = conversions.ImplicitConversion(indexerParameterTypes[i], argumentTypes[i]);\n\t\t\t\tif (!conversion.IsValid)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic class TypeCriteriaCollector : DepthFirstAstVisitor\n\t{\n\t\tBaseRefactoringContext context;\n\n\t\tpublic TypeCriteriaCollector(BaseRefactoringContext context)\n\t\t{\n\t\t\tthis.context = context;\n\t\t\tTypeCriteria = new Dictionary<IVariable, IList<ITypeCriterion>>();\n\t\t\tUsedVariables = new HashSet<IVariable>();\n\t\t}\n\n\t\tIDictionary<IVariable, IList<ITypeCriterion>> TypeCriteria { get; set; }\n\n\t\tpublic HashSet<IVariable> UsedVariables { get; private set; }\n\n\t\tpublic ITypeCriterion GetCriterion(IVariable variable)\n\t\t{\n\t\t\tif (!TypeCriteria.ContainsKey(variable))\n\t\t\t\treturn new ConjunctionCriteria(new List<ITypeCriterion>());\n\t\t\treturn new ConjunctionCriteria(TypeCriteria[variable]);\n\t\t}\n\n\t\tvoid AddCriterion(IVariable variable, ITypeCriterion criterion)\n\t\t{\n\t\t\tif (!TypeCriteria.ContainsKey(variable))\n\t\t\t\tTypeCriteria[variable] = new List<ITypeCriterion>();\n\t\t\tTypeCriteria[variable].Add(criterion);\n\t\t}\n\n\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t{\n\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\n\t\t\tvar targetResolveResult = context.Resolve(memberReferenceExpression.Target) as LocalResolveResult;\n\t\t\tif (targetResolveResult == null)\n\t\t\t\treturn;\n\t\t\tvar variable = targetResolveResult.Variable;\n\t\t\tvar conversion = context.GetConversion(memberReferenceExpression);\n\t\t\tif (conversion.IsMethodGroupConversion) {\n\t\t\t\tAddCriterion(variable, new HasMemberCriterion(conversion.Method));\n\t\t\t} else {\n\t\t\t\tvar resolveResult = context.Resolve(memberReferenceExpression);\n\t\t\t\tvar memberResolveResult = resolveResult as MemberResolveResult;\n\t\t\t\tif (memberResolveResult != null)\n\t\t\t\t\tAddCriterion(variable, new HasMemberCriterion(memberResolveResult.Member));\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t{\n\t\t\tbase.VisitIndexerExpression(indexerExpression);\n\n\t\t\tvar localResolveResult = context.Resolve(indexerExpression.Target) as LocalResolveResult;\n\t\t\tif (localResolveResult == null)\n\t\t\t\treturn;\n\t\t\tvar resolveResult = context.Resolve(indexerExpression);\n\t\t\tif (localResolveResult == null)\n\t\t\t\treturn;\n\t\t\tvar parent = indexerExpression.Parent;\n\t\t\twhile (parent is ParenthesizedExpression)\n\t\t\t\tparent = parent.Parent;\n\t\t\tif (parent is DirectionExpression) {\n\t\t\t\t// The only types which are indexable and where the indexing expression\n\t\t\t\t// results in a variable is an actual array type\n\t\t\t\tAddCriterion(localResolveResult.Variable, new IsArrayTypeCriterion());\n\t\t\t} else if (resolveResult is ArrayAccessResolveResult) {\n\t\t\t\tvar arrayResolveResult = (ArrayAccessResolveResult)resolveResult;\n\t\t\t\tvar arrayType = arrayResolveResult.Array.Type as ArrayType;\n\t\t\t\tif (arrayType != null) {\n\t\t\t\t\tvar parameterTypes = arrayResolveResult.Indexes.Select(index => index.Type);\n\t\t\t\t\tvar criterion = new SupportsIndexingCriterion(arrayType.ElementType, parameterTypes, CSharpConversions.Get(context.Compilation));\n\t\t\t\t\tAddCriterion(localResolveResult.Variable, criterion);\n\t\t\t\t}\n\t\t\t} else if (resolveResult is CSharpInvocationResolveResult) {\n\t\t\t\tvar invocationResolveResult = (CSharpInvocationResolveResult)resolveResult;\n\t\t\t\tvar parameterTypes = invocationResolveResult.Arguments.Select(arg => arg.Type);\n\t\t\t\tvar criterion = new SupportsIndexingCriterion(invocationResolveResult.Member.ReturnType, parameterTypes, CSharpConversions.Get(context.Compilation));\n\t\t\t\tAddCriterion(localResolveResult.Variable, criterion);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t{\n\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\tvar resolveResult = context.Resolve(invocationExpression);\n\t\t\tvar invocationResolveResult = resolveResult as InvocationResolveResult;\n\t\t\tif (invocationResolveResult == null)\n\t\t\t\treturn;\n\n\t\t\t// invocationExpression.Target resolves to a method group and VisitMemberReferenceExpression\n\t\t\t// only handles members, so handle method groups here\n\t\t\tvar targetResolveResult = invocationResolveResult.TargetResult as LocalResolveResult;\n\t\t\tif (targetResolveResult != null) {\n\t\t\t\tvar variable = targetResolveResult.Variable;\n\t\t\t\tAddCriterion(variable, new HasMemberCriterion(invocationResolveResult.Member));\n\t\t\t}\n\t\t}\n\n\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\n\t\t\tvar lastParameter = methodDeclaration.Parameters.LastOrNullObject();\n\t\t\tif (lastParameter.IsNull || !lastParameter.ParameterModifier.HasFlag(ParameterModifier.Params))\n\t\t\t\treturn;\n\t\t\tvar localResolveResult = context.Resolve(lastParameter) as LocalResolveResult;\n\t\t\tif (localResolveResult == null)\n\t\t\t\treturn;\n\t\t\tAddCriterion(localResolveResult.Variable, new IsArrayTypeCriterion());\n\t\t}\n\n\t\tRole[] roles = new [] {\n\t\t\tRoles.Expression,\n\t\t\tRoles.Argument,\n\t\t\tRoles.Condition,\n\t\t\tBinaryOperatorExpression.RightRole,\n\t\t\tBinaryOperatorExpression.LeftRole\n\t\t};\n\n\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t{\n\t\t\tvar resolveResult = context.Resolve(identifierExpression);\n\t\t\tvar localResolveResult = resolveResult as LocalResolveResult;\n\t\t\tif (localResolveResult == null)\n\t\t\t\treturn;\n\n\t\t\tvar variable = localResolveResult.Variable;\n\t\t\tif (!UsedVariables.Contains(variable))\n\t\t\t\tUsedVariables.Add(variable);\n\n\t\t\t// Assignment expressions are checked separately, see VisitAssignmentExpression\n\t\t\tif (!roles.Contains(identifierExpression.Role) || identifierExpression.Parent is AssignmentExpression)\n\t\t\t\treturn;\n\n\t\t\tCheckForCriterion(identifierExpression, variable);\n\t\t}\n\n\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t{\n\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\n\t\t\t// Only check the right side; The left side always has the type of\n\t\t\t// the variable, which is not what we want to check\n\n\t\t\tvar rightResolveResult = context.Resolve(assignmentExpression.Right) as LocalResolveResult;\n\t\t\tif (rightResolveResult != null) {\n\t\t\t\tCheckForCriterion(assignmentExpression.Right, rightResolveResult.Variable);\n\t\t\t}\n\t\t}\n\n\t\tvoid CheckForCriterion(Expression expression, IVariable variable)\n\t\t{\n\t\t\tAddCriterion(variable, new IsTypeCriterion(context.GetExpectedType(expression)));\n\t\t}\n\n\t\tclass ConjunctionCriteria : ITypeCriterion\n\t\t{\n\t\t\tIList<ITypeCriterion> criteria;\n\n\t\t\tpublic ConjunctionCriteria(IList<ITypeCriterion> criteria)\n\t\t\t{\n\t\t\t\tthis.criteria = criteria;\n\t\t\t}\n\n\t\t\tpublic bool SatisfiedBy(IType type)\n\t\t\t{\n\t\t\t\tforeach (var criterion in criteria) {\n\t\t\t\t\tif (!criterion.SatisfiedBy(type)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class IsTypeCriterion : ITypeCriterion\n\t{\n\t\tIType isType;\n\n\t\tpublic IsTypeCriterion(IType isType)\n\t\t{\n\t\t\tthis.isType = isType;\n\t\t}\n\n\t\t#region ITypeCriterion implementation\n\t\tpublic bool SatisfiedBy (IType type)\n\t\t{\n\t\t\treturn isType == type ||\n\t\t\t\ttype.GetAllBaseTypes().Any(t => t == isType);\n\t\t}\n\t\t#endregion\n\t}\n\n\tpublic class IsArrayTypeCriterion : ITypeCriterion\n\t{\n\t\t#region ITypeCriterion implementation\n\n\t\tpublic bool SatisfiedBy(IType type)\n\t\t{\n\t\t\treturn type is ArrayType;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tpublic class HasMemberCriterion : ITypeCriterion\n\t{\n//\t\tIMember neededMember;\n\t\tIList<IMember> acceptableMembers;\n\n\t\tpublic HasMemberCriterion(IMember neededMember)\n\t\t{\n//\t\t\tthis.neededMember = neededMember;\n\n\t\t\tif (neededMember.ImplementedInterfaceMembers.Any()) {\n\t\t\t\tacceptableMembers = neededMember.ImplementedInterfaceMembers.ToList();\n\t\t\t} else if (neededMember.IsOverride) {\n\t\t\t\tacceptableMembers = new List<IMember>();\n\t\t\t\tforeach (var member in InheritanceHelper.GetBaseMembers(neededMember, true)) {\n\t\t\t\t\tacceptableMembers.Add(member);\n\t\t\t\t\tif (member.IsShadowing)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tacceptableMembers.Add(neededMember);\n\t\t\t} else {\n\t\t\t\tacceptableMembers = new List<IMember> { neededMember };\n\t\t\t}\n\t\t}\n\n\t\t#region ITypeCriterion implementation\n\t\tpublic bool SatisfiedBy (IType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\n\t\t\tvar typeMembers = type.GetMembers();\n\t\t\treturn typeMembers.Any(member => HasCommonMemberDeclaration(acceptableMembers, member));\n\t\t}\n\t\t#endregion\n\n\t\tstatic bool HasCommonMemberDeclaration(IEnumerable<IMember> acceptableMembers, IMember member)\n\t\t{\n\t\t\tvar implementedInterfaceMembers = member.MemberDefinition.ImplementedInterfaceMembers;\n\t\t\tif (implementedInterfaceMembers.Any()) {\n\t\t\t\treturn ContainsAny(acceptableMembers, implementedInterfaceMembers);\n\t\t\t} else {\n\t\t\t\treturn acceptableMembers.Contains(member/*\t\t\t\t.MemberDefinition*/);\n\t\t\t}\n\t\t}\n\n\t\tstatic bool ContainsAny<T>(IEnumerable<T> collection, IEnumerable<T> items)\n\t\t{\n\t\t\tforeach (var item in items) {\n\t\t\t\tif (collection.Contains(item))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/PossibleMistakenCallToGetTypeIssue.cs",
    "content": "//\n// PossibleMistakenCallToGetTypeIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Possible mistaken call to 'object.GetType()'\",\n\t\tDescription = \"Possible mistaken call to 'object.GetType()'\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Warning, \n\t\tAnalysisDisableKeyword = \"PossibleMistakenCallToGetType\" )]\n\tpublic class PossibleMistakenCallToGetTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<PossibleMistakenCallToGetTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tvar mref = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (mref == null || mref.MemberName != \"GetType\")\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || !rr.Member.DeclaringType.IsKnownType(KnownTypeCode.Type) || rr.Member.IsStatic)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue (\n\t\t\t\t\tinvocationExpression,\n\t\t\t\t\tctx.TranslateString(\"Possible mistaken call to 'object.GetType()'\"),\n\t\t\t\t\tctx.TranslateString(\"Remove call to 'object.GetType()'\"),\n\t\t\t\t\ts => s.Replace(invocationExpression, mref.Target.Clone())\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/PublicConstructorInAbstractClass.cs",
    "content": "// EmptyConstructorIssue.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SaHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Make constructor in abstract class protected\",\n                      Description = \"Constructor in abstract class should not be public\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"PublicConstructorInAbstractClass\")]\n\tpublic class PublicConstructorInAbstractClassIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar unit = context.RootNode as SyntaxTree;\n\t\t\tif (unit == null)\n\t\t\t\treturn null;\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<PublicConstructorInAbstractClassIssue>\n\t\t{\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (!typeDeclaration.HasModifier(Modifiers.Abstract)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tforeach (var constructor in typeDeclaration.Children.OfType<ConstructorDeclaration>()){\n\t\t\t\t\tVisitConstructorDeclaration(constructor);\n\t\t\t\t}\n\t\t\t}\n\n            public override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tif (constructorDeclaration.HasModifier (Modifiers.Public)) {\n\n                    var makeProtected = new CodeAction(ctx.TranslateString(\"Make constructor protected\"), script => script.Replace(constructorDeclaration.ModifierTokens.First(t => t.Modifier == Modifiers.Public), new CSharpModifierToken(TextLocation.Empty, Modifiers.Protected)), constructorDeclaration.NameToken);\n                    var makePrivate = new CodeAction(ctx.TranslateString(\"Make constructor private\"), script => script.Remove(constructorDeclaration.ModifierTokens.First(t => t.Modifier == Modifiers.Public)), constructorDeclaration.NameToken);\n\n\t\t\t\t\tAddIssue(new CodeIssue(constructorDeclaration.NameToken, ctx.TranslateString(\"Constructor in Abstract Class should not be public\"), new[] { makeProtected, makePrivate }));\n                }\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReferenceEqualsWithValueTypeIssue.cs",
    "content": "﻿// \n// ReferenceEqualsCalledWithValueTypeIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Check for reference equality instead\",\n\t\tDescription = \"Check for reference equality instead\",\n\t\tCategory = IssueCategories.CodeQualityIssues,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ReferenceEqualsWithValueType\"\n\t)]\n\tpublic class ReferenceEqualsWithValueTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ReferenceEqualsWithValueTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\t// Quickly determine if this invocation is eligible to speed up the inspector\n\t\t\t\tvar nameToken = invocationExpression.Target.GetChildByRole(Roles.Identifier);\n\t\t\t\tif (nameToken.Name != \"ReferenceEquals\")\n\t\t\t\t\treturn;\n\n\t\t\t\tvar resolveResult = ctx.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (resolveResult == null ||\n\t\t\t\t    resolveResult.Member.DeclaringTypeDefinition == null ||\n\t\t\t\t    resolveResult.Member.DeclaringTypeDefinition.KnownTypeCode != KnownTypeCode.Object ||\n\t\t\t\t    resolveResult.Member.Name != \"ReferenceEquals\" ||\n\t\t\t\t    invocationExpression.Arguments.All(arg => ctx.Resolve(arg).Type.IsReferenceType ?? true))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar action1 = new CodeAction(ctx.TranslateString(\"Replace expression with 'false'\"),\n\t\t\t\t\t              script => script.Replace(invocationExpression, new PrimitiveExpression(false)), invocationExpression);\n\n\t\t\t\tvar action2 = new CodeAction(ctx.TranslateString(\"Use Equals()\"),\n\t\t\t\t\t              script => script.Replace(invocationExpression.Target,\n\t\t\t\t\t\t              new PrimitiveType(\"object\").Member(\"Equals\")), invocationExpression);\n\n\t\t\t\tAddIssue(new CodeIssue(invocationExpression,\n\t\t\t\t\tctx.TranslateString(\"'Object.ReferenceEquals' is always false because it is called with value type\"),\n\t\t\t\t\tnew [] { action1, action2 }));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithFirstOrDefaultIssue.cs",
    "content": "//\n// ReplaceWithFirstOrDefaultIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with FirstOrDefault<T>()\",\n\t                  Description = \"Replace with call to FirstOrDefault<T>()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithFirstOrDefault\")]\n\tpublic class ReplaceWithFirstOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ReplaceWithFirstOrDefaultIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\treadonly AstNode pattern =\n\t\t\t\tnew ConditionalExpression(\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"expr\"), \"Any\"),\n\t\t\t\t\t\tnew AnyNodeOrNull(\"param\")\n\t\t\t\t\t),\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new Backreference(\"expr\"), \"First\"),\n\t\t\t\t\t\tnew Backreference(\"param\")\n\t\t\t\t\t),\n\t\t\t\t\tnew Choice {\n\t\t\t\t\t\tnew NullReferenceExpression(),\n\t\t\t\t\t\tnew DefaultValueExpression(new AnyNode())\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\t\t\t\tvar match = pattern.Match(conditionalExpression);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar expression = match.Get<Expression>(\"expr\").First();\n\t\t\t\tvar param      = match.Get<Expression>(\"param\").First();\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tconditionalExpression,\n\t\t\t\t\tctx.TranslateString(\"Expression can be simlified to 'FirstOrDefault<T>()'\"),\n\t\t\t\t\tctx.TranslateString(\"Replace with 'FirstOrDefault<T>()'\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar invocation = new InvocationExpression(new MemberReferenceExpression(expression.Clone(), \"FirstOrDefault\"));\n\t\t\t\t\t\tif (param != null && !param.IsNull)\n\t\t\t\t\t\t\tinvocation.Arguments.Add(param.Clone());\n\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\tconditionalExpression,\n\t\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithLastOrDefaultIssue.cs",
    "content": "//\n// ReplaceWithLastOrDefaultIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with LastOrDefault<T>()\",\n\t                  Description = \"Replace with call to LastOrDefault<T>()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithLastOrDefault\")]\n\tpublic class ReplaceWithLastOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ReplaceWithLastOrDefaultIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\treadonly AstNode pattern =\n\t\t\t\tnew ConditionalExpression(\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"expr\"), \"Any\"),\n\t\t\t\t\t\tnew AnyNodeOrNull(\"param\")\n\t\t\t\t\t),\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new Backreference(\"expr\"), \"Last\"),\n\t\t\t\t\t\tnew Backreference(\"param\")\n\t\t\t\t\t),\n\t\t\t\t\tnew Choice {\n\t\t\t\t\t\tnew NullReferenceExpression(),\n\t\t\t\t\t\tnew DefaultValueExpression(new AnyNode())\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\t\t\t\tvar match = pattern.Match(conditionalExpression);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar expression = match.Get<Expression>(\"expr\").First();\n\t\t\t\tvar param      = match.Get<Expression>(\"param\").First();\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tconditionalExpression,\n\t\t\t\t\tctx.TranslateString(\"Expression can be simlified to 'LastOrDefault<T>()'\"),\n\t\t\t\t\tctx.TranslateString(\"Replace with 'LastOrDefault<T>()'\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar invocation = new InvocationExpression(new MemberReferenceExpression(expression.Clone(), \"LastOrDefault\"));\n\t\t\t\t\t\tif (param != null && !param.IsNull)\n\t\t\t\t\t\t\tinvocation.Arguments.Add(param.Clone());\n\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\tconditionalExpression,\n\t\t\t\t\t\t\tinvocation\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeAny.cs",
    "content": "//\n// ReplaceWithOfTypeAny.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().Any()\",\n\t                  Description = \"Replace with call to OfType<T>().Any()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.Any\")]\n\tpublic class ReplaceWithOfTypeAnyIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly AstNode selectPattern =\n\t\t\tnew InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"targetExpr\"), \"Select\"),\n\t\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param1\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\t\t\tBody = PatternHelper.OptionalParentheses (new AsExpression(new AnyNode(\"expr1\"), PatternHelper.AnyType(\"type\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t), \n\t\t\t\t\tPattern.AnyString\n\t\t\t\t),\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param2\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\tBody = PatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"expr2\"), BinaryOperatorType.InEquality, new NullReferenceExpression())\n\t\t\t\t}\n\t\t\t);\n\n\t\tstatic readonly AstNode selectPatternWithFollowUp =\n\t\t\tnew InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"targetExpr\"), \"Select\"),\n\t\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param1\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\t\t\tBody = PatternHelper.OptionalParentheses (new AsExpression(new AnyNode(\"expr1\"), PatternHelper.AnyType(\"type\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t),\t \n\t\t\t\t\tPattern.AnyString\n\t\t\t\t),\n\t\t\t\tnew NamedNode(\"lambda\", \n\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param2\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\t\tBody = new BinaryOperatorExpression(\n\t\t\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"expr2\"), BinaryOperatorType.InEquality, new NullReferenceExpression()),\n\t\t\t\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\t\t\t\tnew AnyNode(\"followUpExpr\")\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor<ReplaceWithOfTypeIssue>(context, \"Any\");\n\t\t}\n\n\t\tinternal class GatherVisitor<T> : GatherVisitorBase<T> where T : GatherVisitorCodeIssueProvider\n\t\t{\n\t\t\treadonly string member;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, string member) : base (ctx)\n\t\t\t{\n\t\t\t\tthis.member = member;\n\t\t\t}\n\n\t\t\tbool CheckParameterMatches(IEnumerable<INode> param, IEnumerable<INode> expr)\n\t\t\t{\n\t\t\t\tvar p = param.Single() as ParameterDeclaration;\n\t\t\t\tvar e = expr.Single();\n\n\t\t\t\tif (p == null)\n\t\t\t\t\treturn false;\n\t\t\t\tif (e is IdentifierExpression)\n\t\t\t\t\treturn p.Name == ((IdentifierExpression)e).Identifier;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression (InvocationExpression anyInvoke)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression (anyInvoke);\n\n\t\t\t\tvar anyResolve = ctx.Resolve (anyInvoke) as InvocationResolveResult;\n\t\t\t\tif (anyResolve == null || !HasPredicateVersion(anyResolve.Member))\n\t\t\t\t\treturn;\n\t\t\t\tMatch match;\n\n\t\t\t\tif (member != \"Where\") {\n\t\t\t\t\tmatch = selectPattern.Match(anyInvoke);\n\t\t\t\t\tif (match.Success) {\n\t\t\t\t\t\tif (!ReplaceWithOfTypeIssue.CheckParameterMatches(match.Get(\"param1\"), match.Get(\"expr1\")) ||\n\t\t\t\t\t\t\t!ReplaceWithOfTypeIssue.CheckParameterMatches(match.Get(\"param2\"), match.Get(\"expr2\")))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tanyInvoke,\n\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with OfType<T>().{0}()\"), member),\n\t\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with call to OfType<T>().{0}()\"), member),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar target = match.Get<Expression>(\"targetExpr\").Single().Clone();\n\t\t\t\t\t\t\tvar type = match.Get<AstType>(\"type\").Single().Clone();\n\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\tanyInvoke,\n\t\t\t\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\t\t\tnew MemberReferenceExpression(\n\t\t\t\t\t\t\t\tnew InvocationExpression(new MemberReferenceExpression(target, \"OfType\", type)),\n\t\t\t\t\t\t\t\tmember\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmatch = selectPatternWithFollowUp.Match (anyInvoke);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tif (!ReplaceWithOfTypeIssue.CheckParameterMatches(match.Get(\"param1\"), match.Get(\"expr1\")) ||\n\t\t\t\t\t    !ReplaceWithOfTypeIssue.CheckParameterMatches(match.Get(\"param2\"), match.Get(\"expr2\")))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tanyInvoke,\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with OfType<T>().{0}()\"), member),\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with call to OfType<T>().{0}()\"), member),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar target = match.Get<Expression>(\"targetExpr\").Single().Clone();\n\t\t\t\t\t\t\tvar type = match.Get<AstType>(\"type\").Single().Clone();\n\t\t\t\t\t\t\tvar lambda = match.Get<LambdaExpression>(\"lambda\").Single();\n\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\tanyInvoke,\n\t\t\t\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\t\t\t\tnew MemberReferenceExpression(\n\t\t\t\t\t\t\t\t\t\tnew InvocationExpression(new MemberReferenceExpression(target, \"OfType\", type)),\n\t\t\t\t\t\t\t\t\t\tmember\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\t\t\t\t\tParameters = { (ParameterDeclaration)lambda.Parameters.First().Clone() },\n\t\t\t\t\t\t\t\t\t\tBody = match.Get<Expression>(\"followUpExpr\").Single().Clone()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t );\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool IsQueryExtensionClass(ITypeDefinition typeDef)\n\t\t\t{\n\t\t\t\tif (typeDef == null || typeDef.Namespace != \"System.Linq\")\n\t\t\t\t\treturn false;\n\t\t\t\tswitch (typeDef.Name) {\n\t\t\t\t\tcase \"Enumerable\":\n\t\t\t\t\t\tcase \"ParallelEnumerable\":\n\t\t\t\t\t\tcase \"Queryable\":\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool HasPredicateVersion(IParameterizedMember member)\n\t\t\t{\n\t\t\t\tif (!IsQueryExtensionClass(member.DeclaringTypeDefinition))\n\t\t\t\t\treturn false;\n\t\t\t\treturn member.Name == this.member;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeCountIssue.cs",
    "content": "//\n// ReplaceWithOfTypeCountIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().Count()\",\n\t                  Description = \"Replace with call to OfType<T>().Count()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.Count\")]\n\tpublic class ReplaceWithOfTypeCountIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeCountIssue>(context, \"Count\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeFirstIssue.cs",
    "content": "//\n// ReplaceWithOfTypeFirstIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().First()\",\n\t                  Description = \"Replace with call to OfType<T>().First()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.First\")]\n\tpublic class ReplaceWithOfTypeFirstIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeFirstIssue>(context, \"First\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeFirstOrDefaultIssue.cs",
    "content": "//\n// ReplaceWithOfTypeFirstOrDefaultIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().FirstOrDefault()\",\n\t                  Description = \"Replace with call to OfType<T>().FirstOrDefault()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.FirstOrDefault\")]\n\tpublic class ReplaceWithOfTypeFirstOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeFirstOrDefaultIssue>(context, \"FirstOrDefault\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeIssue.cs",
    "content": "//\n// ReplaceWithOfTypeIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>\",\n\t                  Description = \"Replace with call to OfType<T>\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType\")]\n\tpublic class ReplaceWithOfTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tinternal static readonly AstNode selectNotNullPattern =\n\t\t\tnew InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"target\"), \"SelectNotNull\"),\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param1\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\tBody = PatternHelper.OptionalParentheses (new AsExpression(new AnyNode(\"expr1\"), new AnyNode(\"type\")))\n\t\t\t\t}\n\t\t\t);\n\n\t\tinternal static readonly AstNode wherePatternCase1 =\n\t\t\tnew InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"target\"), \"Where\"),\n\t\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param1\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\t\t\tBody = PatternHelper.OptionalParentheses (new IsExpression(new AnyNode(\"expr1\"), new AnyNode(\"type\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t), \"Select\"),\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param2\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\tBody = PatternHelper.OptionalParentheses (new AsExpression(PatternHelper.OptionalParentheses (new AnyNode(\"expr2\")), new Backreference(\"type\")))\n\t\t\t\t}\n\t\t);\n\n\t\tinternal static readonly AstNode wherePatternCase2 =\n\t\t\tnew InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(\n\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"target\"), \"Where\"),\n\t\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param1\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\t\t\tBody = PatternHelper.OptionalParentheses (new IsExpression(PatternHelper.OptionalParentheses (new AnyNode(\"expr1\")), new AnyNode(\"type\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t), \"Select\"),\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { PatternHelper.NamedParameter (\"param2\", PatternHelper.AnyType (\"paramType\", true), Pattern.AnyString) },\n\t\t\t\t\tBody = PatternHelper.OptionalParentheses (new CastExpression(new Backreference(\"type\"), PatternHelper.OptionalParentheses (new AnyNode(\"expr2\"))))\n\t\t\t\t}\n\t\t);\n\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tinternal static bool CheckParameterMatches(IEnumerable<INode> paramMatch, IEnumerable<INode> expressionMatch)\n\t\t{\n\t\t\tvar p = paramMatch.Single() as ParameterDeclaration;\n\t\t\tvar e = expressionMatch.Single();\n\n\t\t\tif (p == null)\n\t\t\t\treturn false;\n\t\t\tif (e is IdentifierExpression)\n\t\t\t\treturn p.Name == ((IdentifierExpression)e).Identifier;\n\t\t\treturn false;\n\t\t}\n\n\n\t\tclass GatherVisitor : GatherVisitorBase<ReplaceWithOfTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression (InvocationExpression anyInvoke)\n\t\t\t{\n\t\t\t\tvar match = selectNotNullPattern.Match (anyInvoke);\n\t\t\t\tif (!match.Success) {\n\t\t\t\t\tmatch = wherePatternCase1.Match (anyInvoke);\n\t\t\t\t\tif (!match.Success) {\n\t\t\t\t\t\tmatch = wherePatternCase2.Match (anyInvoke); \n\t\t\t\t\t\tif (!match.Success) {\n\t\t\t\t\t\t\tbase.VisitInvocationExpression(anyInvoke);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!CheckParameterMatches(match.Get(\"param1\"), match.Get(\"expr1\")) ||\n\t\t\t\t\t    !CheckParameterMatches(match.Get(\"param2\"), match.Get(\"expr2\"))) {\n\t\t\t\t\t\tbase.VisitInvocationExpression (anyInvoke);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!CheckParameterMatches(match.Get(\"param1\"), match.Get(\"expr1\"))) {\n\t\t\t\t\t\tbase.VisitInvocationExpression (anyInvoke);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tanyInvoke,\n\t\t\t\t\tctx.TranslateString(\"Replace with OfType<T>\"),\n\t\t\t\t\tctx.TranslateString(\"Replace with call to OfType<T>\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar target = match.Get<Expression>(\"target\").Single().Clone ();\n\t\t\t\t\t\tvar type = match.Get<AstType>(\"type\").Single().Clone();\n\t\t\t\t\t\tscript.Replace(anyInvoke, new InvocationExpression(new MemberReferenceExpression(target, \"OfType\", type)));\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeLastIssue.cs",
    "content": "//\n// ReplaceWithOfTypeLastIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().Last()\",\n\t                  Description = \"Replace with call to OfType<T>().Last()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.Last\")]\n\tpublic class ReplaceWithOfTypeLastIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeLastIssue>(context, \"Last\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeLastOrDefaultIssue.cs",
    "content": "//\n// ReplaceWithOfTypeLastOrDefaultIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().LastOrDefault()\",\n\t                  Description = \"Replace with call to OfType<T>().LastOrDefault()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.LastOrDefault\")]\n\tpublic class ReplaceWithOfTypeLastOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeLastOrDefaultIssue>(context, \"LastOrDefault\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeLongCountIssue.cs",
    "content": "//\n// ReplaceWithOfTypeLongCountIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().LongCount()\",\n\t                  Description = \"Replace with call to OfType<T>().LongCount()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.LongCount\")]\n\tpublic class ReplaceWithOfTypeLongCountIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeLongCountIssue>(context, \"LongCount\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeSingleIssue.cs",
    "content": "//\n// ReplaceWithOfTypeSingleIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().Single()\",\n\t                  Description = \"Replace with call to OfType<T>().Single()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.Single\")]\n\tpublic class ReplaceWithOfTypeSingleIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeSingleIssue>(context, \"Single\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeSingleOrDefaultIssue.cs",
    "content": "//\n// ReplaceWithOfTypeSingleOrDefaultIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().SingleOrDefault()\",\n\t                  Description = \"Replace with call to OfType<T>().SingleOrDefault()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.SingleOrDefault\")]\n\tpublic class ReplaceWithOfTypeSingleOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeSingleOrDefaultIssue>(context, \"SingleOrDefault\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithOfTypeWhereIssue.cs",
    "content": "//\n// ReplaceWithOfTypeWhereIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with OfType<T>().Where()\",\n\t                  Description = \"Replace with call to OfType<T>().Where()\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"ReplaceWithOfType.Where\")]\n\tpublic class ReplaceWithOfTypeWhereIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithOfTypeAnyIssue.GatherVisitor<ReplaceWithOfTypeWhereIssue>(context, \"Where\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSimpleAssignmentIssue.cs",
    "content": "//\n// ReplaceWithSimpleAssignmentIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Replace with simple assignment\",\n\t\tDescription = \"Replace with simple assignment\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ReplaceWithSimpleAssignment\")]\n\tpublic class ReplaceWithSimpleAssignmentIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ReplaceWithSimpleAssignmentIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode truePattern = \n\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\tnew AnyNode(\"expr\"),\n\t\t\t\t\tAssignmentOperatorType.BitwiseOr,\n\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(true))\n\t\t\t\t);\n\n\t\t\tstatic readonly AstNode falsePattern = \n\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\tnew AnyNode(\"expr\"),\n\t\t\t\t\tAssignmentOperatorType.BitwiseAnd,\n\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(false))\n\t\t\t\t);\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t\t\tvar match = truePattern.Match(assignmentExpression);\n\t\t\t\tAssignmentExpression simpleAssignment;\n\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tvar expr = match.Get<Expression>(\"expr\").Single();\n\t\t\t\t\tsimpleAssignment = new AssignmentExpression(expr.Clone(), new PrimitiveExpression(true));\n\t\t\t\t} else {\n\t\t\t\t\tmatch = falsePattern.Match(assignmentExpression);\n\t\t\t\t\tif (!match.Success)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar expr = match.Get<Expression>(\"expr\").Single();\n\t\t\t\t\tsimpleAssignment = new AssignmentExpression(expr.Clone(), new PrimitiveExpression(false));\n\t\t\t\t}\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tassignmentExpression,\n\t\t\t\t\tctx.TranslateString(\"Replace with simple assignment\"),\n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with '{0}'\"), simpleAssignment),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.Replace(assignmentExpression, simpleAssignment);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToAnyIssue.cs",
    "content": "// \n// ReplaceWithSingleCallToAnyIssue.cs\n//\n// Author:\n//       Mike Krger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n    [IssueDescription(\"Replace with single call to Any(...)\",\n                      Description = \"Replace with single call to Any(...)\",\n                      Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n                      AnalysisDisableKeyword = \"ReplaceWithSingleCallToAny\")]\n    public class ReplaceWithSingleCallToAnyIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly AstNode pattern =\n\t\t\tnew InvocationExpression (\n\t\t\t\tnew MemberReferenceExpression (\n\t\t\t\t\tnew NamedNode (\"whereInvoke\",\n\t\t\t\t\t               new InvocationExpression (\n\t\t\t\t\t               \tnew MemberReferenceExpression (new AnyNode (\"target\"), \"Where\"),\n\t\t\t\t\t               \tnew AnyNode ())),\n\t\t\t\t\tPattern.AnyString));\n\t\t\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor<ReplaceWithSingleCallToAnyIssue>(context, \"Any\");\n\t\t}\n\t\t\n\t\tinternal class GatherVisitor<T> : GatherVisitorBase<T> where T : GatherVisitorCodeIssueProvider\n\t\t{\n\t\t\treadonly string member;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, string member) : base (ctx)\n\t\t\t{\n\t\t\t\tthis.member = member;\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression (InvocationExpression anyInvoke)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression (anyInvoke);\n\t\t\t\t\n\t\t\t\tvar match = pattern.Match (anyInvoke);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar anyResolve = ctx.Resolve (anyInvoke) as InvocationResolveResult;\n\t\t\t\tif (anyResolve == null || !HasPredicateVersion(anyResolve.Member))\n\t\t\t\t\treturn;\n\t\t\t\tvar whereInvoke = match.Get<InvocationExpression> (\"whereInvoke\").Single ();\n\t\t\t\tvar whereResolve = ctx.Resolve (whereInvoke) as InvocationResolveResult;\n\t\t\t\tif (whereResolve == null || whereResolve.Member.Name != \"Where\" || !IsQueryExtensionClass(whereResolve.Member.DeclaringTypeDefinition))\n\t\t\t\t\treturn;\n\t\t\t\tif (whereResolve.Member.Parameters.Count != 2)\n\t\t\t\t\treturn;\n\t\t\t\tvar predResolve = whereResolve.Member.Parameters [1];\n\t\t\t\tif (predResolve.Type.TypeParameterCount != 2)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tanyInvoke, string.Format(ctx.TranslateString(\"Redundant Where() call with predicate followed by {0}()\"), anyResolve.Member.Name),\n\t\t\t\t\tnew CodeAction (\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with single call to '{0}'\"), anyResolve.Member.Name),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar arg = whereInvoke.Arguments.Single ().Clone ();\n\t\t\t\t\t\t\tvar target = match.Get<Expression> (\"target\").Single ().Clone ();\n\t\t\t\t\t\t\tscript.Replace (anyInvoke, new InvocationExpression (new MemberReferenceExpression (target, anyResolve.Member.Name), arg));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tanyInvoke\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t\t\n\t\t\tbool IsQueryExtensionClass(ITypeDefinition typeDef)\n\t\t\t{\n\t\t\t\tif (typeDef == null || typeDef.Namespace != \"System.Linq\")\n\t\t\t\t\treturn false;\n\t\t\t\tswitch (typeDef.Name) {\n\t\t\t\t\tcase \"Enumerable\":\n\t\t\t\t\tcase \"ParallelEnumerable\":\n\t\t\t\t\tcase \"Queryable\":\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbool HasPredicateVersion(IParameterizedMember member)\n\t\t\t{\n\t\t\t\tif (!IsQueryExtensionClass(member.DeclaringTypeDefinition))\n\t\t\t\t\treturn false;\n\t\t\t    return member.Name == this.member;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToAverageIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToAverageIssue.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to Average(...)\",\n\t\tDescription = \"Replace with single call to Average(...)\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ReplaceWithSingleCallToAverage\")]\n\tpublic class ReplaceWithSingleCallToAverageIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly AstNode pattern =\n\t\t\tnew InvocationExpression (\n\t\t\t\tnew MemberReferenceExpression (\n\t\t\t\t\tnew NamedNode (\"selectInvoke\",\n\t\t\t\t\t\tnew InvocationExpression (\n\t\t\t\t\t\t\tnew MemberReferenceExpression (new AnyNode (\"target\"), \"Select\"),\n\t\t\t\t\t\t\tnew AnyNode ())),\n\t\t\t\t\tPattern.AnyString));\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor<ReplaceWithSingleCallToAverageIssue>(context, \"Average\");\n\t\t}\n\n\t\tinternal class GatherVisitor<T> : GatherVisitorBase<T> where T : GatherVisitorCodeIssueProvider\n\t\t{\n\t\t\treadonly string member;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, string member) : base (ctx)\n\t\t\t{\n\t\t\t\tthis.member = member;\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression (InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression (invocationExpression);\n\n\t\t\t\tvar match = pattern.Match (invocationExpression);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar averageResolve = ctx.Resolve (invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (averageResolve == null || !HasPredicateVersion(averageResolve.Member))\n\t\t\t\t\treturn;\n\t\t\t\tvar selectInvoke = match.Get<InvocationExpression> (\"selectInvoke\").Single ();\n\t\t\t\tvar selectResolve = ctx.Resolve (selectInvoke) as InvocationResolveResult;\n\t\t\t\tif (selectResolve == null || selectResolve.Member.Name != \"Select\" || !IsQueryExtensionClass(selectResolve.Member.DeclaringTypeDefinition))\n\t\t\t\t\treturn;\n\t\t\t\tif (selectResolve.Member.Parameters.Count != 2)\n\t\t\t\t\treturn;\n\t\t\t\tvar predResolve = selectResolve.Member.Parameters [1];\n\t\t\t\tif (predResolve.Type.TypeParameterCount != 2)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression, string.Format(ctx.TranslateString(\"Redundant Select() call with predicate followed by {0}()\"), averageResolve.Member.Name),\n\t\t\t\t\tnew CodeAction (\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with single call to '{0}'\"), averageResolve.Member.Name),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tvar arg = selectInvoke.Arguments.Single ().Clone ();\n\t\t\t\t\t\t\tvar target = match.Get<Expression> (\"target\").Single ().Clone ();\n\t\t\t\t\t\t\tscript.Replace (invocationExpression, new InvocationExpression (new MemberReferenceExpression (target, averageResolve.Member.Name), arg));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinvocationExpression\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tstatic bool IsQueryExtensionClass(ITypeDefinition typeDef)\n\t\t\t{\n\t\t\t\tif (typeDef == null || typeDef.Namespace != \"System.Linq\")\n\t\t\t\t\treturn false;\n\t\t\t\tswitch (typeDef.Name) {\n\t\t\t\t\tcase \"Enumerable\":\n\t\t\t\t\tcase \"ParallelEnumerable\":\n\t\t\t\t\tcase \"Queryable\":\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool HasPredicateVersion(IParameterizedMember member)\n\t\t\t{\n\t\t\t\tif (!IsQueryExtensionClass(member.DeclaringTypeDefinition))\n\t\t\t\t\treturn false;\n\t\t\t\treturn member.Name == this.member;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToCountIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToCountIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to Count(...)\",\n        Description = \"Replace with single call to Count(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToCount\")]\n\tpublic class ReplaceWithSingleCallToCountIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToCountIssue>(context, \"Count\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToFirstIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToFirst.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to First(...)\",\n        Description = \"Replace with single call to First(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToFirst\")]\n\tpublic class ReplaceWithSingleCallToFirstIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToFirstIssue>(context, \"First\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToFirstOrDefaultIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToFirstOrDefault.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to FirstOrDefault(...)\",\n        Description = \"Replace with single call to FirstOrDefault(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToFirstOrDefault\")]\n\tpublic class ReplaceWithSingleCallToFirstOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToFirstOrDefaultIssue>(context, \"FirstOrDefault\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToLastIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToLast.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to Last(...)\",\n        Description = \"Replace with single call to Last(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToLast\")]\n\tpublic class ReplaceWithSingleCallToLastIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToLastIssue>(context, \"Last\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToLastOrDefaultIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToLastOrDefault.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to LastOrDefault(...)\",\n        Description = \"Replace with single call to LastOrDefault(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToLastOrDefault\")]\n\tpublic class ReplaceWithSingleCallToLastOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToLastOrDefaultIssue>(context, \"LastOrDefault\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToLongCountIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToLongCount.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to LongCount(...)\",\n        Description = \"Replace with single call to LongCount(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToLongCount\")]\n\tpublic class ReplaceWithSingleCallToLongCountIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToLongCountIssue>(context, \"LongCount\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMaxIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToMaxIssue.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to Max(...)\",\n\t\tDescription = \"Replace with single call to Max(...)\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ReplaceWithSingleCallToMax\")]\n\tpublic class ReplaceWithSingleCallToMaxIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAverageIssue.GatherVisitor<ReplaceWithSingleCallToMaxIssue>(context, \"Max\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToMinIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToMinIssue.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to Min(...)\",\n\t\tDescription = \"Replace with single call to Min(...)\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ReplaceWithSingleCallToMin\")]\n\tpublic class ReplaceWithSingleCallToMinIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAverageIssue.GatherVisitor<ReplaceWithSingleCallToMinIssue>(context, \"Min\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToSingleIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToSingle.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to Single(...)\",\n        Description = \"Replace with single call to Single(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToSingle\")]\n\tpublic class ReplaceWithSingleCallToSingleIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToSingleIssue>(context, \"Single\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToSingleOrDefaultIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToSingleOrDefault.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to SingleOrDefault(...)\",\n        Description = \"Replace with single call to SingleOrDefault(...)\",\n        Category = IssueCategories.PracticesAndImprovements,\n        Severity = Severity.Suggestion,\n        AnalysisDisableKeyword = \"ReplaceWithSingleCallToSingleOrDefault\")]\n\tpublic class ReplaceWithSingleCallToSingleOrDefaultIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAnyIssue.GatherVisitor<ReplaceWithSingleCallToSingleOrDefaultIssue>(context, \"SingleOrDefault\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithSingleCallToSumIssue.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToSumIssue.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Replace with single call to Sum(...)\",\n\t\tDescription = \"Replace with single call to Sum(...)\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"ReplaceWithSingleCallToSum\")]\n\tpublic class ReplaceWithSingleCallToSumIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new ReplaceWithSingleCallToAverageIssue.GatherVisitor<ReplaceWithSingleCallToSumIssue>(context, \"Sum\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/ReplaceWithStringIsNullOrEmptyIssue.cs",
    "content": "// \n// StringIsNullOrEmptyInspector.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Checks for str == null &amp;&amp; str == \" \"\n\t/// Converts to: string.IsNullOrEmpty (str)\n\t/// </summary>\n\t[IssueDescription(\"Use 'String.IsNullOrEmpty'\",\n\t       Description = \"Uses shorter string.IsNullOrEmpty call instead of a longer condition.\",\n           Category = IssueCategories.PracticesAndImprovements,\n\t       Severity = Severity.Suggestion,\n           AnalysisDisableKeyword = \"ReplaceWithStringIsNullOrEmpty\")]\n\tpublic class ReplaceWithStringIsNullOrEmptyIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly Pattern pattern = new Choice {\n\t\t\t// str == null || str == \"\"\n\t\t\t// str == null || str.Length == 0\n\t\t\tnew BinaryOperatorExpression (\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new AnyNode (\"str\"), BinaryOperatorType.Equality, new NullReferenceExpression ()),\n\t\t\t\tBinaryOperatorType.ConditionalOr,\n\t\t\t\tnew Choice {\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new Backreference (\"str\"), BinaryOperatorType.Equality, new PrimitiveExpression (\"\")),\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new Backreference (\"str\"), BinaryOperatorType.Equality,\n\t\t\t\t                                       new PrimitiveType(\"string\").Member(\"Empty\")),\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (\n\t\t\t\t\t\tnew MemberReferenceExpression (new Backreference (\"str\"), \"Length\"),\n\t\t\t\t\t\tBinaryOperatorType.Equality,\n\t\t\t\t\t\tnew PrimitiveExpression (0)\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t),\n\t\t\t// str == \"\" || str == null\n\t\t\tnew BinaryOperatorExpression (\n\t\t\t\tnew Choice {\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new AnyNode (\"str\"), BinaryOperatorType.Equality, new PrimitiveExpression (\"\")),\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new AnyNode (\"str\"), BinaryOperatorType.Equality,\n\t\t\t\t                                       new PrimitiveType(\"string\").Member(\"Empty\"))\n\t\t\t\t},\n\t\t\t\tBinaryOperatorType.ConditionalOr,\n\t\t\t\tPatternHelper.CommutativeOperator(new Backreference (\"str\"), BinaryOperatorType.Equality, new NullReferenceExpression ())\n\t\t\t)\n\t\t};\n\t\tstatic readonly Pattern negPattern = new Choice {\n\t\t\t// str != null && str != \"\"\n\t\t\t// str != null && str.Length != 0\n\t\t\t// str != null && str.Length > 0\n\t\t\tnew BinaryOperatorExpression (\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode (\"str\"), BinaryOperatorType.InEquality, new NullReferenceExpression ()),\n\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\tnew Choice {\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new Backreference (\"str\"), BinaryOperatorType.InEquality, new PrimitiveExpression (\"\")),\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new Backreference (\"str\"), BinaryOperatorType.InEquality,\n\t\t\t\t                                   \t   new PrimitiveType(\"string\").Member(\"Empty\")),\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (\n\t\t\t\t\t\tnew MemberReferenceExpression (new Backreference (\"str\"), \"Length\"),\n\t\t\t\t\t\tBinaryOperatorType.InEquality,\n\t\t\t\t\t\tnew PrimitiveExpression (0)\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tnew MemberReferenceExpression (new Backreference (\"str\"), \"Length\"),\n\t\t\t\t\t\tBinaryOperatorType.GreaterThan,\n\t\t\t\t\t\tnew PrimitiveExpression (0)\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t),\n\t\t\t// str != \"\" && str != null\n\t\t\tnew BinaryOperatorExpression (\n\t\t\t\tnew Choice {\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new AnyNode (\"str\"), BinaryOperatorType.InEquality, new PrimitiveExpression (\"\")),\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses (new AnyNode (\"str\"), BinaryOperatorType.Equality,\n\t\t\t\t                                   \t   new PrimitiveType(\"string\").Member(\"Empty\"))\n\t\t\t\t},\n\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new Backreference (\"str\"), BinaryOperatorType.InEquality, new NullReferenceExpression ())\n\t\t\t)\n\t\t};\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ReplaceWithStringIsNullOrEmptyIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tMatch m = pattern.Match(binaryOperatorExpression);\n\t\t\t\tbool isNegated = false;\n\t\t\t\tif (!m.Success) {\n\t\t\t\t\tm = negPattern.Match(binaryOperatorExpression);\n\t\t\t\t\tisNegated = true;\n\t\t\t\t}\n\t\t\t\tif (m.Success) {\n\t\t\t\t\tvar str = m.Get<Expression>(\"str\").Single();\n\t\t\t\t\tvar def = ctx.Resolve(str).Type.GetDefinition();\n\t\t\t\t\tif (def == null || def.KnownTypeCode != ICSharpCode.NRefactory.TypeSystem.KnownTypeCode.String)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tbinaryOperatorExpression,\n\t\t\t\t\t\tisNegated ? ctx.TranslateString(\"Expression can be replaced with !string.IsNullOrEmpty\") : ctx.TranslateString(\"Expression can be replaced with string.IsNullOrEmpty\"),\n\t\t\t\t\t\tnew CodeAction (\n\t\t\t\t\t\t\tisNegated ? ctx.TranslateString(\"Use !string.IsNullOrEmpty\") : ctx.TranslateString(\"Use string.IsNullOrEmpty\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tExpression expr = new PrimitiveType(\"string\").Invoke(\"IsNullOrEmpty\", str.Clone());\n\t\t\t\t\t\t\t\tif (isNegated)\n\t\t\t\t\t\t\t\t\texpr = new UnaryOperatorExpression(UnaryOperatorType.Not, expr);\n\t\t\t\t\t\t\t\tscript.Replace(binaryOperatorExpression, expr);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbinaryOperatorExpression\n\t\t\t\t\t\t)\n\t\t\t\t\t));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/SimplifyConditionalTernaryExpressionIssue.cs",
    "content": "//\n// SimplifyConditionalTernaryExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Simplify conditional expression\",\n\t                  Description = \"Conditional expression can be simplified\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"SimplifyConditionalTernaryExpression\")]\n\tpublic class SimplifyConditionalTernaryExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<SimplifyConditionalTernaryExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic bool? GetBool(Expression trueExpression)\n\t\t\t{\n\t\t\t\tvar pExpr = trueExpression as PrimitiveExpression;\n\t\t\t\tif (pExpr == null || !(pExpr.Value is bool))\n\t\t\t\t\treturn null;\n\t\t\t\treturn (bool)pExpr.Value;\n\t\t\t}\n\n\t\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\n\t\t\t\tbool? trueBranch = GetBool(CSharpUtil.GetInnerMostExpression(conditionalExpression.TrueExpression));\n\t\t\t\tbool? falseBranch = GetBool(CSharpUtil.GetInnerMostExpression(conditionalExpression.FalseExpression));\n\n\t\t\t\tif (trueBranch == falseBranch || \n\t\t\t\t    trueBranch == true && falseBranch == false) // Handled by RedundantTernaryExpressionIssue\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tconditionalExpression.QuestionMarkToken.StartLocation,\n\t\t\t\t\tconditionalExpression.FalseExpression.EndLocation,\n\t\t\t\t\tctx.TranslateString(\"Simplify conditional expression\"),\n\t\t\t\t\tctx.TranslateString(\"Simplify conditional expression\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tif (trueBranch == false && falseBranch == true) {\n\t\t\t\t\t\t\tscript.Replace(conditionalExpression, CSharpUtil.InvertCondition(conditionalExpression.Condition));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (trueBranch == true) {\n\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\tconditionalExpression,\n\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\t\tconditionalExpression.Condition.Clone(), \n\t\t\t\t\t\t\t\t\tBinaryOperatorType.ConditionalOr,\n\t\t\t\t\t\t\t\t\tconditionalExpression.FalseExpression.Clone()\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (trueBranch == false) {\n\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\tconditionalExpression,\n\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\t\tCSharpUtil.InvertCondition(conditionalExpression.Condition), \n\t\t\t\t\t\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\t\t\t\t\t\tconditionalExpression.FalseExpression.Clone()\n\t\t\t\t\t\t\t\t)\n\t\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\t\n\t\t\t\t\t\tif (falseBranch == true) {\n\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\tconditionalExpression,\n\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\t\tCSharpUtil.InvertCondition(conditionalExpression.Condition), \n\t\t\t\t\t\t\t\t\tBinaryOperatorType.ConditionalOr,\n\t\t\t\t\t\t\t\t\tconditionalExpression.TrueExpression.Clone()\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (falseBranch == false) {\n\t\t\t\t\t\t\tscript.Replace(\n\t\t\t\t\t\t\t\tconditionalExpression,\n\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\t\t\t\t\tconditionalExpression.Condition.Clone(), \n\t\t\t\t\t\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\t\t\t\t\t\tconditionalExpression.TrueExpression.Clone()\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Should never happen\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/SimplifyLinqExpressionIssue.cs",
    "content": "//\n// SimplifyLinqExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Simplify LINQ expression\",\n\t\tDescription = \"Simplify LINQ expression\",\n\t\tCategory = IssueCategories.PracticesAndImprovements,\n\t\tSeverity = Severity.Suggestion,\n\t\tAnalysisDisableKeyword = \"SimplifyLinqExpression\")]\n\tpublic class SimplifyLinqExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<SimplifyLinqExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly Expression simpleExpression = new Choice {\n\t\t\t\tnew UnaryOperatorExpression (UnaryOperatorType.Not, new AnyNode()),\n\t\t\t\tnew BinaryOperatorExpression(new AnyNode(), BinaryOperatorType.Equality, new AnyNode()),\n\t\t\t\tnew BinaryOperatorExpression(new AnyNode(), BinaryOperatorType.InEquality, new AnyNode())\n\t\t\t};\n\n\t\t\tstatic readonly AstNode argumentPattern = new Choice {\n\t\t\t\tnew LambdaExpression  {\n\t\t\t\t\tParameters = { new ParameterDeclaration(PatternHelper.AnyType(true), Pattern.AnyString) },\n\t\t\t\t\tBody = new Choice {\n\t\t\t\t\t\tnew NamedNode (\"expr\", simpleExpression),\n\t\t\t\t\t\tnew BlockStatement { new ReturnStatement(new NamedNode (\"expr\", simpleExpression))}\n\t\t\t\t\t} \n\t\t\t\t},\n\t\t\t\tnew AnonymousMethodExpression {\n\t\t\t\t\tParameters = { new ParameterDeclaration(PatternHelper.AnyType(true), Pattern.AnyString) },\n\t\t\t\t\tBody = new BlockStatement { new ReturnStatement(new NamedNode (\"expr\", simpleExpression))}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitUnaryOperatorExpression(unaryOperatorExpression);\n\t\t\t\tif (unaryOperatorExpression.Operator != UnaryOperatorType.Not)\n\t\t\t\t\treturn;\n\t\t\t\tvar invocation =  CSharpUtil.GetInnerMostExpression(unaryOperatorExpression.Expression) as InvocationExpression;\n\t\t\t\tif (invocation == null)\n\t\t\t\t\treturn; \n\t\t\t\tvar rr = ctx.Resolve(invocation) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (rr.Member.DeclaringType.Name != \"Enumerable\" || rr.Member.DeclaringType.Namespace != \"System.Linq\")\n\t\t\t\t\treturn;\n\t\t\t\tif (!new[] { \"All\", \"Any\" }.Contains(rr.Member.Name))\n\t\t\t\t\treturn;\n\t\t\t\tif (invocation.Arguments.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\tvar arg = invocation.Arguments.First();\n\t\t\t\tvar match = argumentPattern.Match(arg);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue (\n\t\t\t\t\tunaryOperatorExpression,\n\t\t\t\t\tctx.TranslateString(\"Simplify LINQ expression\"),\n\t\t\t\t\tctx.TranslateString(\"Simplify LINQ expression\"),\n\t\t\t\t\ts => {\n\t\t\t\t\t\tvar target = invocation.Target.Clone() as MemberReferenceExpression;\n\t\t\t\t\t\ttarget.MemberName = target.MemberName == \"All\" ? \"Any\" : \"All\";\n\n\t\t\t\t\t\tvar expr = arg.Clone();\n\t\t\t\t\t\tvar nmatch = argumentPattern.Match(expr);\n\t\t\t\t\t\tvar cond = nmatch.Get<Expression>(\"expr\").Single();\n\t\t\t\t\t\tcond.ReplaceWith(CSharpUtil.InvertCondition(cond));\n\t\t\t\t\t\tvar simplifiedInvocation = new InvocationExpression(\n\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\texpr\n\t\t\t\t\t\t);\n\t\t\t\t\t\ts.Replace(unaryOperatorExpression, simplifiedInvocation);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/StringCompareIsCultureSpecificIssue.cs",
    "content": "//\n// StringCompareIsCultureSpecificIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'string.Compare' is culture-aware\",\n\t                  Description = \"Warns when a culture-aware 'Compare' call is used by default.\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"StringCompareIsCultureSpecific\")]\n\tpublic class StringCompareIsCultureSpecificIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<StringCompareIsCultureSpecificIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!rr.Member.IsStatic ||\n\t\t\t\t\trr.Member.Name != \"Compare\" || \n\t\t\t\t    !rr.Member.DeclaringType.IsKnownType (KnownTypeCode.String) ||\n\t\t\t\t    !rr.Member.Parameters[0].Type.IsKnownType(KnownTypeCode.String)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (rr.Member.Parameters.Count != 2 &&\n\t\t\t\t    rr.Member.Parameters.Count != 3 &&\n\t\t\t\t    rr.Member.Parameters.Count != 5 &&\n\t\t\t\t    rr.Member.Parameters.Count != 6)\n\t\t\t\t\treturn;\n\n\t\t\t\tbool? ignoreCase = null;\n\t\t\t\tExpression caseArg = null;\n\t\t\t\tIParameter lastParameter = rr.Member.Parameters.Last();\n\t\t\t\tif (lastParameter.Type.Name == \"StringComparison\")\n\t\t\t\t\treturn; // already specifying a string comparison\n\n\t\t\t\tif (rr.Member.Parameters.Count == 3) {\n\t\t\t\t\tif (!rr.Member.Parameters[2].Type.IsKnownType(KnownTypeCode.Boolean))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (rr.Arguments[2].IsCompileTimeConstant) {\n\t\t\t\t\t\tignoreCase = (bool)rr.Arguments[2].ConstantValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcaseArg = invocationExpression.Arguments.ElementAt(2);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (rr.Member.Parameters.Count == 6) {\n\t\t\t\t\tif (!rr.Member.Parameters[5].Type.IsKnownType(KnownTypeCode.Boolean))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (rr.Arguments[5].IsCompileTimeConstant) {\n\t\t\t\t\t\tignoreCase = (bool)rr.Arguments[5].ConstantValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcaseArg = invocationExpression.Arguments.ElementAt(5);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression,\n\t\t\t\t\tctx.TranslateString(\"'string.Compare' is culture-aware\"), \n\t\t\t\t\tnew CodeAction(\n\t\t\t\t\t\tctx.TranslateString(\"Use ordinal comparison\"), \n\t\t\t\t\t\tscript => AddArgument(script, invocationExpression, CreateCompareArgument (invocationExpression, ignoreCase, caseArg, \"Ordinal\")), \n\t\t\t\t\t\tinvocationExpression\n\t\t\t\t\t),\n\t\t\t\t\tnew CodeAction(\n\t\t\t\t\t\tctx.TranslateString(\"Use culture-aware comparison\"), \n\t\t\t\t\t\tscript => AddArgument(script, invocationExpression, CreateCompareArgument (invocationExpression, ignoreCase, caseArg, \"Ordinal\")), \n\t\t\t\t\t\tinvocationExpression\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tExpression CreateCompareArgument (InvocationExpression invocationExpression, bool? ignoreCase, Expression caseArg, string stringComparison)\n\t\t\t{\n\t\t\t\tvar astBuilder = ctx.CreateTypeSystemAstBuilder(invocationExpression);\n\t\t\t\tif (caseArg == null)\n\t\t\t\t\treturn astBuilder.ConvertType(new TopLevelTypeName(\"System\", \"StringComparison\")).Member(ignoreCase == true ? stringComparison + \"IgnoreCase\" : stringComparison);\n\n\t\t\t\treturn new ConditionalExpression(\n\t\t\t\t\tcaseArg.Clone(),\n\t\t\t\t\tastBuilder.ConvertType(new TopLevelTypeName(\"System\", \"StringComparison\")).Member(stringComparison + \"IgnoreCase\"),\n\t\t\t\t\tastBuilder.ConvertType(new TopLevelTypeName(\"System\", \"StringComparison\")).Member(stringComparison)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tvoid AddArgument(Script script, InvocationExpression invocationExpression, Expression compareArgument)\n\t\t\t{\n\t\t\t\tvar copy = (InvocationExpression)invocationExpression.Clone();\n\t\t\t\tcopy.Arguments.Clear();\n\t\t\t\tif (invocationExpression.Arguments.Count() <= 3) {\n\t\t\t\t\tcopy.Arguments.AddRange(invocationExpression.Arguments.Take(2).Select(a => a.Clone())); \n\t\t\t\t} else {\n\t\t\t\t\tcopy.Arguments.AddRange(invocationExpression.Arguments.Take(5).Select(a => a.Clone())); \n\t\t\t\t}\n\t\t\t\tcopy.Arguments.Add(compareArgument);\n\t\t\t\tscript.Replace(invocationExpression, copy);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/StringCompareToIsCultureSpecificIssue.cs",
    "content": "//\n// StringCompareToIsCultureSpecificIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'string.CompareTo' is culture-aware\",\n\t                  Description = \"Warns when a culture-aware 'string.CompareTo' call is used by default.\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"StringCompareToIsCultureSpecific\")]\n\tpublic class StringCompareToIsCultureSpecificIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<StringCompareToIsCultureSpecificIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (rr.Member.Name != \"CompareTo\" || \n\t\t\t\t    !rr.Member.DeclaringType.IsKnownType (KnownTypeCode.String) ||\n\t\t\t\t    rr.Member.Parameters.Count != 1 ||\n\t\t\t\t    !rr.Member.Parameters[0].Type.IsKnownType(KnownTypeCode.String)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression,\n\t\t\t\t\tctx.TranslateString(\"'string.CompareTo' is culture-aware\"), \n\t\t\t\t\tnew CodeAction(ctx.TranslateString(\"Use ordinal comparison\"), script => AddArgument(script, invocationExpression, \"Ordinal\"), invocationExpression),\n\t\t\t\t\tnew CodeAction(ctx.TranslateString(\"Use culture-aware comparison\"), script => AddArgument(script, invocationExpression, \"CurrentCulture\"), invocationExpression)\n\t\t\t\t));\n\n\t\t\t}\n\n\t\t\tvoid AddArgument(Script script, InvocationExpression invocationExpression, string ordinal)\n\t\t\t{\n\t\t\t\tvar mr = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (mr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar astBuilder = ctx.CreateTypeSystemAstBuilder(invocationExpression);\n\t\t\t\tvar newArgument = astBuilder.ConvertType(new TopLevelTypeName(\"System\", \"StringComparison\")).Member(ordinal);\n\n\t\t\t\tvar newInvocation = new PrimitiveType(\"string\").Invoke(\n\t\t\t\t\t\"Compare\",\n\t\t\t\t\tmr.Target.Clone(),\n\t\t\t\t\tinvocationExpression.Arguments.First().Clone(),\n\t\t\t\t\tnewArgument\n\t\t\t\t);\n\t\t\t\tscript.Replace(invocationExpression, newInvocation);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/StringEndsWithIsCultureSpecificIssue.cs",
    "content": "//\n// StringEndsWithIsCultureSpecific.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'string.EndsWith' is culture-aware\",\n\t                  Description = \"Warns when a culture-aware 'EndsWith' call is used by default.\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"StringEndsWithIsCultureSpecific\")]\n\tpublic class StringEndsWithIsCultureSpecificIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new StringIndexOfIsCultureSpecificIssue.GatherVisitor<StringEndsWithIsCultureSpecificIssue>(context, \"EndsWith\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/StringIndexOfIsCultureSpecificIssue.cs",
    "content": "//\n// StringIndexOfIsCultureSpecificIssue.cs\n//\n// Author:\n//       Daniel Grunwald <daniel@danielgrunwald.de>\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Daniel Grunwald\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'string.IndexOf' is culture-aware\",\n\t                  Description = \"Warns when a culture-aware 'IndexOf' call is used by default.\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"StringIndexOfIsCultureSpecific\")]\n\tpublic class StringIndexOfIsCultureSpecificIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor<StringIndexOfIsCultureSpecificIssue>(context, \"IndexOf\");\n\t\t}\n\n\t\tinternal class GatherVisitor<T> : GatherVisitorBase<T> where T : GatherVisitorCodeIssueProvider\n\t\t{\n\t\t\treadonly string memberName;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, string memberName) : base(ctx)\n\t\t\t{\n\t\t\t\tthis.memberName = memberName;\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tMemberReferenceExpression mre = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (mre == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (mre.MemberName != memberName)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError) {\n\t\t\t\t\t// Not an invocation resolve result - e.g. could be a UnknownMemberResolveResult instead\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!(rr.Member.DeclaringTypeDefinition != null && rr.Member.DeclaringTypeDefinition.KnownTypeCode == KnownTypeCode.String)) {\n\t\t\t\t\t// Not a string operation\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tIParameter firstParameter = rr.Member.Parameters.FirstOrDefault();\n\t\t\t\tif (firstParameter == null || !firstParameter.Type.IsKnownType(KnownTypeCode.String))\n\t\t\t\t\treturn; // First parameter not a string\n\t\t\t\tIParameter lastParameter = rr.Member.Parameters.Last();\n\t\t\t\tif (lastParameter.Type.Name == \"StringComparison\")\n\t\t\t\t\treturn; // already specifying a string comparison\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression.LParToken.StartLocation, \n\t\t\t\t\tinvocationExpression.RParToken.EndLocation,\n\t\t\t\t\tstring.Format(ctx.TranslateString(\"'{0}' is culture-aware and missing a StringComparison argument\"), rr.Member.FullName),\n\t\t\t\t\tnew CodeAction(ctx.TranslateString(\"Add 'StringComparison.Ordinal'\"), script => AddArgument(script, invocationExpression, \"Ordinal\"), invocationExpression),\n\t\t\t\t\tnew CodeAction(ctx.TranslateString(\"Add 'StringComparison.CurrentCulture'\"), script => AddArgument(script, invocationExpression, \"CurrentCulture\"), invocationExpression)\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tvoid AddArgument(Script script, InvocationExpression invocationExpression, string stringComparison)\n\t\t\t{\n\t\t\t\tvar astBuilder = ctx.CreateTypeSystemAstBuilder(invocationExpression);\n\t\t\t\tvar newArgument = astBuilder.ConvertType(new TopLevelTypeName(\"System\", \"StringComparison\")).Member(stringComparison);\n\t\t\t\tvar copy = (InvocationExpression)invocationExpression.Clone();\n\t\t\t\tcopy.Arguments.Add(newArgument);\n\t\t\t\tscript.Replace(invocationExpression, copy);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/StringLastIndexOfIsCultureSpecificIssue.cs",
    "content": "//\n// StringLastIndexOfIsCultureSpecificIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'string.LastIndexOf' is culture-aware\",\n\t                  Description = \"Warns when a culture-aware 'LastIndexOf' call is used by default.\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"StringLastIndexOfIsCultureSpecific\")]\n\tpublic class StringLastIndexOfIsCultureSpecificIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new StringIndexOfIsCultureSpecificIssue.GatherVisitor<StringLastIndexOfIsCultureSpecificIssue>(context, \"LastIndexOf\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/StringStartsWithIsCultureSpecificIssue.cs",
    "content": "//\n// StringStartsWithIsCultureSpecific.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'string.StartsWith' is culture-aware\",\n\t                  Description = \"Warns when a culture-aware 'StartsWith' call is used by default.\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"StringStartsWithIsCultureSpecific\")]\n\tpublic class StringStartsWithIsCultureSpecificIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new StringIndexOfIsCultureSpecificIssue.GatherVisitor<StringStartsWithIsCultureSpecificIssue>(context, \"StartsWith\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/UseArrayCreationExpressionIssue.cs",
    "content": "//\n// UseArrayCreationExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Use array creation expression\",\n\t                  Description = \"Use array creation expression\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"UseArrayCreationExpression\")]\n\tpublic class UseArrayCreationExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UseArrayCreationExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\t\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (rr.Member.Name != \"CreateInstance\" ||\n\t\t\t\t    !rr.Member.DeclaringType.IsKnownType(KnownTypeCode.Array))\n\t\t\t\t\treturn;\n\t\t\t\tvar firstArg = invocationExpression.Arguments.FirstOrDefault() as TypeOfExpression;\n\t\t\t\tif (firstArg == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar argRR = ctx.Resolve(invocationExpression.Arguments.ElementAt(1));\n\t\t\t\tif (!argRR.Type.IsKnownType(KnownTypeCode.Int32))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression,\n\t\t\t\t\tctx.TranslateString(\"Use array create expression\"), \n\t\t\t\t\tctx.TranslateString(\"Replace with 'new'\"), \n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar ac = new ArrayCreateExpression {\n\t\t\t\t\t\t\tType = firstArg.Type.Clone()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tforeach (var arg in invocationExpression.Arguments.Skip(1))\n\t\t\t\t\t\t\tac.Arguments.Add(arg.Clone()) ;\n\t\t\t\t\t\tscript.Replace(invocationExpression, ac);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/UseIsOperatorIssue.cs",
    "content": "//\n// UseIsOperatorIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Use 'is' operator\",\n\t                  Description = \"'is' operator can be used\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"UseIsOperator\")]\n\tpublic class UseIsOperatorIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UseIsOperatorIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly Expression pattern1 = new InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(new TypeOfExpression(new AnyNode(\"Type\")), \"IsAssignableFrom\"),\n\t\t\t\tnew InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"object\"), \"GetType\")\n\t\t\t)\n\t\t\t);\n\t\t\tstatic readonly Expression pattern2 = new InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(new TypeOfExpression(new AnyNode(\"Type\")), \"IsInstanceOfType\"),\n\t\t\t\tnew AnyNode(\"object\")\n\t\t\t);\n\n\n\n\t\t\tvoid AddIssue(AstNode invocationExpression, Match match, bool negate = false)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tinvocationExpression,\n\t\t\t\t\tctx.TranslateString(\"Use 'is' operator\"),\n\t\t\t\t\tctx.TranslateString(\"Replace with 'is' operator\"), \n\t\t\t\t\ts => {\n\t\t\t\t\t\tExpression expression = new IsExpression(CSharpUtil.AddParensForUnaryExpressionIfRequired(match.Get<Expression>(\"object\").Single().Clone()), match.Get<AstType>(\"Type\").Single().Clone());\n\t\t\t\t\t\tif (negate)\n\t\t\t\t\t\t\texpression = new UnaryOperatorExpression (UnaryOperatorType.Not, new ParenthesizedExpression(expression));\n\t\t\t\t\t\ts.Replace(invocationExpression, expression);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tvar match = pattern1.Match(invocationExpression);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\tmatch = pattern2.Match(invocationExpression);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tAddIssue(invocationExpression, match);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Unfortunately not quite the same :/\n\t\t\tstatic readonly AstNode equalityComparePattern =\n\t\t\t\tPatternHelper.CommutativeOperator(\n\t\t\t\t\tPatternHelper.OptionalParentheses(new TypeOfExpression(new AnyNode(\"Type\"))),\n\t\t\t\t\tBinaryOperatorType.Equality,\n\t\t\t\t\tPatternHelper.OptionalParentheses(new InvocationExpression(\n\t\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"object\"), \"GetType\")\n\t\t\t\t\t))\n\t\t\t\t);\n\t\t\tstatic readonly AstNode inEqualityComparePattern =\n\t\t\t\tPatternHelper.CommutativeOperator(\n\t\t\t\t\tPatternHelper.OptionalParentheses(new TypeOfExpression(new AnyNode(\"Type\"))),\n\t\t\t\t\tBinaryOperatorType.InEquality,\n\t\t\t\t\tPatternHelper.OptionalParentheses(new InvocationExpression(\n\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"object\"), \"GetType\")\n\t\t\t\t\t))\n\t\t\t\t\t);\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tvar match = equalityComparePattern.Match(binaryOperatorExpression);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tAddIssue(new CodeIssue(binaryOperatorExpression, match);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tmatch = inEqualityComparePattern.Match(binaryOperatorExpression);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tAddIssue(new CodeIssue(binaryOperatorExpression, match, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}*/\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/UseMethodAnyIssue.cs",
    "content": "//\n// UseMethodAnyIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Use method 'Any()'\",\n\t                  Description = \"Replace usages of 'Count()' with call to 'Any()'\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"UseMethodAny\")]\n\tpublic class UseMethodAnyIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UseMethodAnyIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid AddIssue2(BinaryOperatorExpression binaryOperatorExpression, Expression expr)\n\t\t\t{\n\t\t\t}\n\n\t\t\treadonly AstNode anyPattern =\n\t\t\t\tnew Choice {\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(\n\t\t\t\t\t\tnew NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\"))),\n\t\t\t\t\t\tBinaryOperatorType.InEquality,\n\t\t\t\t\t\tnew PrimitiveExpression(0)\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\")))),\n\t\t\t\t\t\tBinaryOperatorType.GreaterThan,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(0))\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(0)),\n\t\t\t\t\t\tBinaryOperatorType.LessThan,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\"))))\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\")))),\n\t\t\t\t\t\tBinaryOperatorType.GreaterThanOrEqual,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(1))\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(1)),\n\t\t\t\t\t\tBinaryOperatorType.LessThanOrEqual,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\"))))\n\t\t\t\t\t)\n\t\t\t};\n\n\t\t\treadonly AstNode notAnyPattern =\n\t\t\t\tnew Choice {\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(\n\t\t\t\t\t\tnew NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\"))),\n\t\t\t\t\t\tBinaryOperatorType.Equality,\n\t\t\t\t\t\tnew PrimitiveExpression(0)\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\")))),\n\t\t\t\t\t\tBinaryOperatorType.LessThan,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(1))\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(1)),\n\t\t\t\t\t\tBinaryOperatorType.GreaterThan,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\"))))\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\")))),\n\t\t\t\t\t\tBinaryOperatorType.LessThanOrEqual,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(0))\n\t\t\t\t\t),\n\t\t\t\t\tnew BinaryOperatorExpression (\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(0)),\n\t\t\t\t\t\tBinaryOperatorType.GreaterThanOrEqual,\n\t\t\t\t\t\tPatternHelper.OptionalParentheses(new NamedNode (\"invocation\", new InvocationExpression(new MemberReferenceExpression(new AnyNode(\"expr\"), \"Count\"))))\n\t\t\t\t\t)\n\t\t\t\t};\n\n\t\t\tvoid AddMatch(BinaryOperatorExpression binaryOperatorExpression, Match match, bool negateAny)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tbinaryOperatorExpression,\n\t\t\t\t\tctx.TranslateString(\"Use 'Any()' for increased performance.\"), \n\t\t\t\t\tnegateAny ? ctx.TranslateString(\"Replace with call to '!Any()'\") : ctx.TranslateString(\"Replace with call to 'Any()'\"), \n\t\t\t\t\tscript =>  {\n\t\t\t\t\t\tExpression expr = new InvocationExpression(new MemberReferenceExpression(match.Get<Expression>(\"expr\").First().Clone(), \"Any\"));\n\t\t\t\t\t\tif (negateAny)\n\t\t\t\t\t\t\texpr = new UnaryOperatorExpression(UnaryOperatorType.Not, expr);\n\t\t\t\t\t\tscript.Replace(binaryOperatorExpression, expr);\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tbool CheckMethod(Match match)\n\t\t\t{\n\t\t\t\tvar invocation = match.Get<Expression>(\"invocation\").First();\n\t\t\t\tvar rr = ctx.Resolve(invocation) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn false;\n\t\t\t\tvar method = rr.Member as IMethod;\n\t\t\t\treturn \n\t\t\t\t\tmethod != null &&\n\t\t\t\t\tmethod.IsExtensionMethod &&\n\t\t\t\t\tmethod.DeclaringTypeDefinition.Namespace == \"System.Linq\" && \n\t\t\t\t\tmethod.DeclaringTypeDefinition.Name == \"Enumerable\";\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tvar match = anyPattern.Match(binaryOperatorExpression);\n\t\t\t\tif (match.Success && CheckMethod (match)) {\n\t\t\t\t\tAddMatch(binaryOperatorExpression, match, false);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmatch = notAnyPattern.Match(binaryOperatorExpression);\n\t\t\t\tif (match.Success && CheckMethod (match)) {\n\t\t\t\t\tAddMatch(binaryOperatorExpression, match, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/PracticesAndImprovements/UseMethodIsInstanceOfTypeIssue.cs",
    "content": "//\n// UseMethodIsInstanceOfType.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Threading;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing System;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Utils;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Use method IsInstanceOfType\",\n\t                  Description = \"Use method IsInstanceOfType\",\n\t                  Category = IssueCategories.PracticesAndImprovements,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"UseMethodIsInstanceOfType\")]\n\tpublic class UseMethodIsInstanceOfTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UseMethodIsInstanceOfTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly Expression pattern = new InvocationExpression(\n\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"target\"), \"IsAssignableFrom\"),\n\t\t\t\tnew InvocationExpression(\n\t\t\t\t\tnew MemberReferenceExpression(new AnyNode(\"object\"), \"GetType\")\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tvar match = pattern.Match(invocationExpression);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tinvocationExpression,\n\t\t\t\t\t\tctx.TranslateString(\"Use method IsInstanceOfType (...)\"),\n\t\t\t\t\t\tctx.TranslateString(\"Replace with call to IsInstanceOfType\"),\n\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\ts.Replace(invocationExpression, new InvocationExpression(\n\t\t\t\t\t\t\t\tnew MemberReferenceExpression(match.Get<Expression>(\"target\").Single().Clone(), \"IsInstanceOfType\"),\n\t\t\t\t\t\t\t\tmatch.Get<Expression>(\"object\").Single().Clone()\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/ArrayCreationCanBeReplacedWithArrayInitializerIssue.cs",
    "content": "﻿// RedundantArrayCreationExpressionIssue.cs\n//\n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Array creation can be replaced with array initializer\",\n\t\tDescription = \"When initializing explicitly typed local variable or array type, array creation expression can be replaced with array initializer.\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning)]\n\tpublic class ArrayCreationCanBeReplacedWithArrayInitializerIssue : GatherVisitorCodeIssueProvider\n\t{\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\n\n\t\tclass GatherVisitor : GatherVisitorBase<ArrayCreationCanBeReplacedWithArrayInitializerIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, ArrayCreationCanBeReplacedWithArrayInitializerIssue issueProvider) : base (ctx, issueProvider)\n\t\t\t{\n\t\t\t}\n\n\t\t\tprivate void AddIssue(AstNode node, AstNode initializer)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tnode.StartLocation, \n\t\t\t\t\tinitializer.StartLocation, \n\t\t\t\t\tctx.TranslateString(\"Redundant array creation expression\"), \n\t\t\t\t\tctx.TranslateString(\"Use array initializer\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar startOffset = script.GetCurrentOffset(node.StartLocation);\n\t\t\t\t\t\tvar endOffset = script.GetCurrentOffset(initializer.StartLocation);\n\t\t\t\t\t\tif (startOffset < endOffset)\n\t\t\t\t\t\t\tscript.RemoveText(startOffset, endOffset - startOffset);\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpublic override void VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitArrayCreateExpression(arrayCreateExpression);\n\n\t\t\t\tif (arrayCreateExpression.Initializer.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\n\t\t\t\tvar variableInilizer = arrayCreateExpression.GetParent<VariableInitializer>();\n\t\t\t\tif (variableInilizer == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (variableInilizer.Parent is VariableDeclarationStatement) {\n\t\t\t\t\tvar variableDeclaration = variableInilizer.Parent;\n\n\t\t\t\t\tif (variableDeclaration.GetChildByRole(Roles.Type) is ComposedType) {\n\t\t\t\t\t\tvar composedType = variableDeclaration.GetChildByRole(Roles.Type) as ComposedType;\n\t\t\t\t\t\tif (composedType.ArraySpecifiers == null)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tAddIssue(arrayCreateExpression, arrayCreateExpression.Initializer);\n\t\t\t\t\t}\n\t\t\t\t} else if (variableInilizer.Parent is FieldDeclaration) {\n\t\t\t\t\tvar filedDeclaration = variableInilizer.Parent;\n\n\t\t\t\t\tif (filedDeclaration.GetChildByRole(Roles.Type) is ComposedType) {\n\t\t\t\t\t\tvar composedType = filedDeclaration.GetChildByRole(Roles.Type) as ComposedType;\n\t\t\t\t\t\tif (composedType.ArraySpecifiers == null)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tAddIssue(arrayCreateExpression, arrayCreateExpression.Initializer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/ConditionIsAlwaysTrueOrFalseIssue.cs",
    "content": "//\n// ConditionIsAlwaysTrueOrFalseIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Runtime.InteropServices.ComTypes;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Expression is always 'true' or always 'false'\",\n\t\tDescription = \"Value of the expression can be determined at compile time\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"ConditionIsAlwaysTrueOrFalse\")]\n\tpublic class ConditionIsAlwaysTrueOrFalseIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConditionIsAlwaysTrueOrFalseIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tif (CheckConstant(binaryOperatorExpression))\n\t\t\t\t\treturn;\n\t\t\t\tif (CSharpUtil.GetInnerMostExpression(binaryOperatorExpression.Left) is NullReferenceExpression) {\n\t\t\t\t\tif (CheckNullComparison(binaryOperatorExpression, binaryOperatorExpression.Right, binaryOperatorExpression.Left))\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (CSharpUtil.GetInnerMostExpression(binaryOperatorExpression.Right) is NullReferenceExpression) {\n\t\t\t\t\tif (CheckNullComparison(binaryOperatorExpression, binaryOperatorExpression.Left, binaryOperatorExpression.Right))\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t}\n\n\t\t\tbool CheckNullComparison(BinaryOperatorExpression binaryOperatorExpression, Expression right, Expression nullNode)\n\t\t\t{\n\t\t\t\tif (binaryOperatorExpression.Operator != BinaryOperatorType.Equality && binaryOperatorExpression.Operator != BinaryOperatorType.InEquality)\n\t\t\t\t\treturn false;\n\t\t\t\t// note null == null is checked by similiar expression comparison.\n\t\t\t\tvar expr = CSharpUtil.GetInnerMostExpression(right);\n\n\t\t\t\tvar rr = ctx.Resolve(expr);\n\t\t\t\tif (rr.Type.IsReferenceType == false) {\n\t\t\t\t\t// nullable check\n\t\t\t\t\tif (NullableType.IsNullable(rr.Type))\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar conversion = ctx.GetConversion(nullNode);\n\t\t\t\t\tif (conversion.ConversionAfterUserDefinedOperator == Conversion.IdentityConversion)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t// check for user operators\n\t\t\t\t\tforeach (var op in rr.Type.GetMethods(m => m.SymbolKind == SymbolKind.Operator && m.Parameters.Count == 2)) {\n\t\t\t\t\t\tif (op.Parameters[0].Type.IsReferenceType == false && op.Parameters[1].Type.IsReferenceType == false)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.Equality && op.Name == \"op_Equality\")\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif (binaryOperatorExpression.Operator == BinaryOperatorType.InEquality && op.Name == \"op_Inequality\")\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tAddIssue(binaryOperatorExpression, binaryOperatorExpression.Operator != BinaryOperatorType.Equality);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvoid AddIssue(Expression expr, bool result)\n\t\t\t{\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\texpr, \n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Expression is always '{0}'\"), result ? \"true\" : \"false\"), \n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Replace with '{0}'\"), result ? \"true\" : \"false\"), \n\t\t\t\t\ts => s.Replace(expr, new PrimitiveExpression(result))\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tbool CheckConstant(Expression expr)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(expr);\n\t\t\t\tif (rr.ConstantValue is bool) {\n\t\t\t\t\tvar result = (bool)rr.ConstantValue;\n\t\t\t\t\tAddIssue(expr, result);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tif (CheckConstant(unaryOperatorExpression))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitUnaryOperatorExpression(unaryOperatorExpression);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/ConstantNullCoalescingConditionIssue.cs",
    "content": "//\n// RedundantNullCoalescingExpressionIssue.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Runtime.InteropServices.ComTypes;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'??' condition is known to be null or not null\",\n\t                  Description = \"Finds redundant null coalescing expressions such as expr ?? expr\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"ConstantNullCoalescingCondition\")]\n\tpublic class ConstantNullCoalescingConditionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConstantNullCoalescingConditionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tDictionary<AstNode, NullValueAnalysis> cachedNullAnalysis = new Dictionary<AstNode, NullValueAnalysis>();\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\n\t\t\t\tif (binaryOperatorExpression.Operator != BinaryOperatorType.NullCoalescing) {\n\t\t\t\t\t//The issue is not applicable\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar parentFunction = GetParentFunctionNode(binaryOperatorExpression);\n\t\t\t\tvar analysis = GetAnalysis(parentFunction);\n\n\t\t\t\tNullValueStatus leftStatus = analysis.GetExpressionResult(binaryOperatorExpression.Left);\n\t\t\t\tif (leftStatus == NullValueStatus.DefinitelyNotNull) {\n\t\t\t\t\tAddIssue(new CodeIssue(binaryOperatorExpression.OperatorToken.StartLocation,\n\t\t\t\t\t         binaryOperatorExpression.Right.EndLocation,\n\t\t\t\t\t         ctx.TranslateString(\"Redundant ??. Left side is never null.\"),\n\t\t\t\t\t         ctx.TranslateString(\"Remove redundant right side\"),\n\t\t\t\t\t         script => {\n\n\t\t\t\t\t\tscript.Replace(binaryOperatorExpression, binaryOperatorExpression.Left.Clone());\n\n\t\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (leftStatus == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\tAddIssue(new CodeIssue(binaryOperatorExpression.Left.StartLocation,\n\t\t\t\t\t         binaryOperatorExpression.OperatorToken.EndLocation,\n\t\t\t\t\t         ctx.TranslateString(\"Redundant ??. Left side is always null.\"),\n\t\t\t\t\t         ctx.TranslateString(\"Remove redundant left side\"),\n\t\t\t\t\t         script => {\n\n\t\t\t\t\t\tscript.Replace(binaryOperatorExpression, binaryOperatorExpression.Right.Clone());\n\n\t\t\t\t\t\t}));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tNullValueStatus rightStatus = analysis.GetExpressionResult(binaryOperatorExpression.Right);\n\t\t\t\tif (rightStatus == NullValueStatus.DefinitelyNull) {\n\t\t\t\t\tAddIssue(new CodeIssue(binaryOperatorExpression.OperatorToken.StartLocation,\n\t\t\t\t\t         binaryOperatorExpression.Right.EndLocation,\n\t\t\t\t\t         ctx.TranslateString(\"Redundant ??. Right side is always null.\"),\n\t\t\t\t\t         ctx.TranslateString(\"Remove redundant right side\"),\n\t\t\t\t\t         script => {\n\n\t\t\t\t\t\tscript.Replace(binaryOperatorExpression, binaryOperatorExpression.Left.Clone());\n\n\t\t\t\t\t\t}));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tNullValueAnalysis GetAnalysis(AstNode parentFunction)\n\t\t\t{\n\t\t\t\tNullValueAnalysis analysis;\n\t\t\t\tif (cachedNullAnalysis.TryGetValue(parentFunction, out analysis)) {\n\t\t\t\t\treturn analysis;\n\t\t\t\t}\n\n\t\t\t\tanalysis = new NullValueAnalysis(ctx, parentFunction.GetChildByRole(Roles.Body), parentFunction.GetChildrenByRole(Roles.Parameter), ctx.CancellationToken);\n\t\t\t\tanalysis.IsParametersAreUninitialized = true;\n\t\t\t\tanalysis.Analyze();\n\t\t\t\tcachedNullAnalysis [parentFunction] = analysis;\n\t\t\t\treturn analysis;\n\t\t\t}\n\t\t}\n\n\t\tpublic static AstNode GetParentFunctionNode(AstNode node)\n\t\t{\n\t\t\tdo {\n\t\t\t\tnode = node.Parent;\n\t\t\t} while (node != null && !IsFunctionNode(node));\n\n\t\t\treturn node;\n\t\t}\n\n\t\tstatic bool IsFunctionNode(AstNode node)\n\t\t{\n\t\t\treturn node is EntityDeclaration ||\n\t\t\t\tnode is LambdaExpression ||\n\t\t\t\t\tnode is AnonymousMethodExpression;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/DoubleNegationOperatorIssue.cs",
    "content": "﻿// \n// DoubleNegationOperatorIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Double negation operator\",\n\t\t\t\t\t\tDescription = \"Double negation is meaningless.\",\n\t\t\t\t\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\t\t\t\t\tSeverity = Severity.Warning,\n                        AnalysisDisableKeyword = \"DoubleNegationOperator\")]\n    public class DoubleNegationOperatorIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<DoubleNegationOperatorIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic Expression RemoveParentheses (Expression expr)\n\t\t\t{\n\t\t\t\twhile (expr is ParenthesizedExpression)\n\t\t\t\t\texpr = ((ParenthesizedExpression) expr).Expression;\n\t\t\t\treturn expr;\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitUnaryOperatorExpression (unaryOperatorExpression);\n\n\t\t\t\tif (unaryOperatorExpression.Operator != UnaryOperatorType.Not)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar innerUnaryOperatorExpr = \n\t\t\t\t\tRemoveParentheses (unaryOperatorExpression.Expression) as UnaryOperatorExpression;\n\t\t\t\tif (innerUnaryOperatorExpr == null || innerUnaryOperatorExpr.Operator != UnaryOperatorType.Not)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar expression = RemoveParentheses (innerUnaryOperatorExpr.Expression);\n\t\t\t\tif (expression.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(unaryOperatorExpression, ctx.TranslateString (\"Double negation is redundant\"), ctx.TranslateString (\"Remove '!!'\"),\n\t\t\t\t\tscript => script.Replace (unaryOperatorExpression, expression.Clone ())));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/EmptyStatementIssue.cs",
    "content": "//\n// EmptyStatementIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Empty statement is redundant\",\n\t\tDescription = \"Empty statement is redundant\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"EmptyStatement\")]\n\tpublic class EmptyStatementIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<EmptyStatementIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitEmptyStatement(EmptyStatement emptyStatement)\n\t\t\t{\n\t\t\t\tif (UseAsAndNullCheckAction.IsEmbeddedStatement(emptyStatement))\n\t\t\t\t\treturn;\n\t\t\t\tif (emptyStatement.GetPrevSibling(s => s.Role == BlockStatement.StatementRole) is LabelStatement)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\temptyStatement,\n\t\t\t\t\tctx.TranslateString(\"Empty statement is redundant\"),\n\t\t\t\t\tctx.TranslateString(\"Remove ';'\"),\n\t\t\t\t\ts => s.Remove(emptyStatement)\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/ForStatementConditionIsTrueIssue.cs",
    "content": "// \n// ForStatementConditionIsTrueIssue.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"'true' is redundant as for statement condition\",\n\t                   Description = \"true is redundant as for statement condition, thus can be safely ommited\",\n\t                   Category = IssueCategories.RedundanciesInCode,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"ForStatementConditionIsTrue\")]\n\tpublic class ForStatementConditionIsTrueIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<ForStatementConditionIsTrueIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode pattern =  new PrimitiveExpression(true);\n\t\t\n\t\t\tpublic override void VisitForStatement (ForStatement forstatement)\n\t\t\t{\n\t\t\t\tbase.VisitForStatement(forstatement);\n\n\t\t\t\tvar m = pattern.Match(forstatement.Condition);\n\t\t\t\tif (m.Success) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tforstatement.Condition, \n\t\t\t\t\t\tctx.TranslateString(\"'true' is redundant as for statement condition\"), \n\t\t\t\t\t\tctx.TranslateString(\"Remove 'true'\"),\n\t\t\t\t\t\tscript => script.Remove(forstatement.Condition)\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantAnonymousTypePropertyNameIssue.cs",
    "content": "//\n// RedundantAnonymousTypePropertyNameIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Redundant anonymous type property name\",\n\t\tDescription = \"The name can be inferred from the initializer expression\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantAnonymousTypePropertyName\")]\n\tpublic class RedundantAnonymousTypePropertyNameIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantAnonymousTypePropertyNameIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic string GetAnonymousTypePropertyName(Expression expr)\n\t\t\t{\n\t\t\t\tif (expr is MemberReferenceExpression) {\n\t\t\t\t\treturn ((MemberReferenceExpression)expr).MemberName;\n\t\t\t\t}\n\t\t\t\tif (expr is IdentifierExpression) {\n\t\t\t\t\treturn ((IdentifierExpression)expr).Identifier;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAnonymousTypeCreateExpression(anonymousTypeCreateExpression);\n\t\t\t\tforeach (var expr in anonymousTypeCreateExpression.Initializers) {\n\t\t\t\t\tvar na = expr as NamedExpression;\n\t\t\t\t\tif (na == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (na.Name == GetAnonymousTypePropertyName(na.Expression)) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(na.StartLocation, na.AssignToken.EndLocation,\n\t\t\t\t\t\t\tctx.TranslateString(\"Redundant explicit property name\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Remove redundant name\"),\n\t\t\t\t\t\t\ts => s.Replace(na, na.Expression.Clone())\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantArgumentDefaultValueIssue.cs",
    "content": "//\n// RedundantArgumentDefaultValueIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Redundant argument with default value\",\n\t\tDescription = \"The parameter is optional with the same default value\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantArgumentDefaultValue\")]\n\tpublic class RedundantArgumentDefaultValueIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantArgumentDefaultValueIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tbool IsDefaultValue(Expression arg, ICSharpCode.NRefactory.TypeSystem.IParameter par)\n\t\t\t{\n\t\t\t\tvar ne = arg as NamedArgumentExpression;\n\t\t\t\tif (ne != null) {\n\t\t\t\t\tif (ne.Name != par.Name)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\targ = ne.Expression;\n\t\t\t\t}\n\t\t\t\tvar cr = ctx.Resolve(arg);\n\t\t\t\tif (cr == null || !cr.IsCompileTimeConstant || !par.IsOptional)\n\t\t\t\t\treturn false;\n\t\t\t\treturn \n\t\t\t\t\tcr.ConstantValue == null && par.ConstantValue == null || \n\t\t\t\t\tcr.ConstantValue.Equals(par.ConstantValue);\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\t\t\t\tCheck(objectCreateExpression, objectCreateExpression.Arguments.ToList());\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tCheck(invocationExpression, invocationExpression.Arguments.ToList());\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIndexerExpression(indexerExpression);\n\t\t\t\tCheck(indexerExpression, indexerExpression.Arguments.ToList());\n\t\t\t}\n\n\t\t\tvoid Check(AstNode invocationExpression, List<Expression> arguments)\n\t\t\t{\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tfor (int i = 0; i < arguments.Count && i < rr.Member.Parameters.Count; i++) {\n\n\t\t\t\t\tif (!IsDefaultValue(arguments[i], rr.Member.Parameters[i]))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tbool nextAreAllDefault = true;\n\t\t\t\t\tfor (int j = i + 1; j < arguments.Count && j < rr.Member.Parameters.Count; j++) {\n\t\t\t\t\t\tif (!IsDefaultValue(arguments[j], rr.Member.Parameters[j])) {\n\t\t\t\t\t\t\tnextAreAllDefault = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!nextAreAllDefault)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tfor (int j = i; j < arguments.Count && j < rr.Member.Parameters.Count; j++) {\n\t\t\t\t\t\tvar _i = j;\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\targuments[j],\n\t\t\t\t\t\t\ti + 1 < arguments.Count ? ctx.TranslateString(\"Argument values are redundant\") : ctx.TranslateString(\"Argument value is redundant\"),\n\t\t\t\t\t\t\ti + 1 < arguments.Count ? ctx.TranslateString(\"Remove redundant arguments\") : ctx.TranslateString(\"Remove redundant argument\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tvar invoke = invocationExpression.Clone();\n\n\t\t\t\t\t\t\t\tvar argCollection = invoke.GetChildrenByRole<Expression>(Roles.Argument);\n\t\t\t\t\t\t\t\targCollection.Clear();\n\t\t\t\t\t\t\t\tfor (int k = 0; k < _i; k++)\n\t\t\t\t\t\t\t\t\targCollection.Add(arguments[k].Clone());\n\t\t\t\t\t\t\t\tscript.Replace(invocationExpression, invoke);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* TODO: Merge:\n[IssueDescription(\"Optional argument has default value and can be skipped\",\n\t                  Description = \"Finds calls to functions where optional parameters are used and the passed argument is the same as the default.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Hint)]\n\tpublic class OptionalParameterCouldBeSkippedIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<OptionalParameterCouldBeSkippedIssue>\n\t\t{\n\t\t\tstatic readonly object removeAllRedundantArgumentsKey = new object ();\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\t\t\t\t\n\t\t\t\tCheckMethodCall(objectCreateExpression, objectCreateExpression.Arguments,\n\t\t\t\t                (objectCreation, args) => new ObjectCreateExpression(objectCreation.Type.Clone(), args));\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\t\n\t\t\t\tCheckMethodCall(invocationExpression, invocationExpression.Arguments,\n\t\t\t\t                (invocation, args) => new InvocationExpression(invocation.Target.Clone(), args));\n\t\t\t}\n\n\t\t\tvoid CheckMethodCall<T> (T node, IEnumerable<Expression> args, Func<T, IEnumerable<Expression>, T> generateReplacement) where T: AstNode\n\t\t\t{\n\t\t\t\t// The first two checks are unnecessary, but eliminates the majority of calls early,\n\t\t\t\t// improving performance.\n\t\t\t\tvar arguments = args.ToArray();\n\t\t\t\tif (arguments.Length == 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar lastArg = arguments[arguments.Length - 1];\n\t\t\t\tif (!(lastArg is PrimitiveExpression || lastArg is NamedArgumentExpression))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar invocationResolveResult = ctx.Resolve(node) as CSharpInvocationResolveResult;\n\t\t\t\tif (invocationResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tstring actionMessage = ctx.TranslateString(\"Remove redundant arguments\");\n\t\t\t\t\n\t\t\t\tvar redundantArguments = GetRedundantArguments(arguments, invocationResolveResult);\n\t\t\t\tvar action = new CodeAction(actionMessage, script => {\n\t\t\t\t\tvar newArgumentList = arguments\n\t\t\t\t\t\t.Where(arg => !redundantArguments.Contains(arg))\n\t\t\t\t\t\t.Select(arg => arg.Clone());\n\t\t\t\t\tvar newInvocation = generateReplacement(node, newArgumentList);\n\t\t\t\t\tscript.Replace(node, newInvocation);\n\t\t\t\t}, node, removeAllRedundantArgumentsKey);\n\t\t\t\tvar issueMessage = ctx.TranslateString(\"Argument is identical to the default value\");\n\t\t\t\tvar lastPositionalArgument = redundantArguments.FirstOrDefault(expression => !(expression is NamedArgumentExpression));\n\n\t\t\t\tforeach (var argument in redundantArguments) {\n\t\t\t\t\tvar localArgument = argument;\n\t\t\t\t\tvar actions = new List<CodeAction>();\n\t\t\t\t\tactions.Add(action);\n\n\t\t\t\t\tif (localArgument is NamedArgumentExpression || localArgument == lastPositionalArgument) {\n\t\t\t\t\t\tvar title = ctx.TranslateString(\"Remove this argument\");\n\t\t\t\t\t\tactions.Add(new CodeAction(title, script => {\n\t\t\t\t\t\t\tvar newArgumentList = arguments\n\t\t\t\t\t\t\t\t.Where(arg => arg != localArgument)\n\t\t\t\t\t\t\t\t.Select(arg => arg.Clone());\n\t\t\t\t\t\t\tvar newInvocation = generateReplacement(node, newArgumentList);\n\t\t\t\t\t\t\tscript.Replace(node, newInvocation);\n\t\t\t\t\t\t}, node, null));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar title = ctx.TranslateString(\"Remove this and the following positional arguments\");\n\t\t\t\t\t\tactions.Add(new CodeAction(title, script => {\n\t\t\t\t\t\t\tvar newArgumentList = arguments\n\t\t\t\t\t\t\t\t.Where(arg => arg.StartLocation < localArgument.StartLocation && !(arg is NamedArgumentExpression))\n\t\t\t\t\t\t\t\t.Select(arg => arg.Clone());\n\t\t\t\t\t\t\tvar newInvocation = generateReplacement(node, newArgumentList);\n\t\t\t\t\t\t\tscript.Replace(node, newInvocation);\n\t\t\t\t\t\t}, node, null));\n\t\t\t\t\t}\n\n\t\t\t\t\tAddIssue(new CodeIssue(localArgument, issueMessage, actions) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIList<Expression> GetRedundantArguments(Expression[] arguments, CSharpInvocationResolveResult invocationResolveResult)\n\t\t\t{\n\t\t\t\tvar argumentToParameterMap = invocationResolveResult.GetArgumentToParameterMap();\n\t\t\t\tvar resolvedParameters = invocationResolveResult.Member.Parameters;\n\n\t\t\t\tIList<Expression> redundantArguments = new List<Expression>();\n\n\t\t\t\tfor (int i = arguments.Length - 1; i >= 0; i--) {\n\t\t\t\t\tvar parameterIndex = argumentToParameterMap[i];\n\t\t\t\t\tif (parameterIndex == -1)\n\t\t\t\t\t\t// This particular parameter is an error, but keep trying the other ones\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar parameter = resolvedParameters[parameterIndex];\n\t\t\t\t\tvar argument = arguments[i];\n\t\t\t\t\tif (argument is PrimitiveExpression) {\n\t\t\t\t\t\tif (parameter.IsParams)\n\t\t\t\t\t\t\t// before positional params arguments all optional arguments are needed, otherwise some of the\n\t\t\t\t\t\t\t// param arguments will be shifted out of the params into the fixed parameters\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tif (!parameter.IsOptional)\n\t\t\t\t\t\t\t// There can be no optional parameters preceding a required one\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tvar argumentResolveResult = ctx.Resolve(argument) as ConstantResolveResult;\n\t\t\t\t\t\tif (argumentResolveResult == null || parameter.ConstantValue != argumentResolveResult.ConstantValue)\n\t\t\t\t\t\t\t// Stop here since any arguments before this one has to be there\n\t\t\t\t\t\t\t// to enable the passing of this argument\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tredundantArguments.Add(argument);\n\t\t\t\t\t} else if (argument is NamedArgumentExpression) {\n\t\t\t\t\t\tvar expression = ((NamedArgumentExpression)argument).Expression as PrimitiveExpression;\n\t\t\t\t\t\tif (expression == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar expressionResolveResult = ctx.Resolve(expression) as ConstantResolveResult;\n\t\t\t\t\t\tif (expressionResolveResult == null || parameter.ConstantValue != expressionResolveResult.ConstantValue)\n\t\t\t\t\t\t\t// continue, since there can still be more arguments that are redundant\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tredundantArguments.Add(argument);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is a non-constant positional argument => no more redundancies are possible\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn redundantArguments;\n\t\t\t}\n\t\t}\n\t}\n*/\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantArgumentNameIssue.cs",
    "content": "﻿// \n// RedundantArgumentNameIssue.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{ \n\t[IssueDescription(\"Redundant explicit argument name specification\",\n\t                  Description= \"Redundant explicit argument name specification\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Suggestion,\n\t                  AnalysisDisableKeyword = \"RedundantArgumentName\")]\n\tpublic class RedundantArgumentNameIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantArgumentNameIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid CheckParameters(ResolveResult resolveResult, AstNodeCollection<Expression> arguments)\n\t\t\t{\n\t\t\t\tvar ir = resolveResult as InvocationResolveResult;\n\t\t\t\tif (ir == null || ir.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (var arg in arguments) {\n\t\t\t\t\tvar na = arg as NamedArgumentExpression;\n\t\t\t\t\tif (na != null) {\n\t\t\t\t\t\tif (na.Name != ir.Member.Parameters[i].Name)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tvar _i = i;\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tna.NameToken.StartLocation,\n\t\t\t\t\t\t\tna.ColonToken.EndLocation,\n\t\t\t\t\t\t\tctx.TranslateString(\"Redundant argument name specification\"), \n\t\t\t\t\t\t\tctx.TranslateString(\"Remove argument name specification\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tforeach (var node in arguments.Take(_i + 1).OfType<NamedArgumentExpression>()) {\n\t\t\t\t\t\t\t\t\tscript.Replace(node, node.Expression.Clone());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tCheckParameters(ctx.Resolve(invocationExpression), invocationExpression.Arguments);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerExpression(IndexerExpression indexerExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIndexerExpression(indexerExpression);\n\t\t\t\tCheckParameters(ctx.Resolve(indexerExpression), indexerExpression.Arguments);\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\t\t\t\tCheckParameters(ctx.Resolve(objectCreateExpression), objectCreateExpression.Arguments);\n\t\t\t}\n\n\t\t\tpublic override void VisitAttribute(Attribute attribute)\n\t\t\t{\n\t\t\t\tbase.VisitAttribute(attribute);\n\t\t\t\tCheckParameters(ctx.Resolve(attribute), attribute.Arguments);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantAttributeParenthesesIssue.cs",
    "content": "﻿// \n// RedundantAttributeParenthesesIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Parentheses are redundant if attribute has no arguments\",\n\t\tDescription = \"Parentheses are redundant if attribute has no arguments.\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantAttributeParentheses\")]\n\tpublic class RedundantAttributeParenthesesIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantAttributeParenthesesIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitAttribute(Attribute attribute)\n\t\t\t{\n\t\t\t\tbase.VisitAttribute(attribute);\n\n\t\t\t\tif (attribute.Arguments.Count > 0 || !attribute.HasArgumentList)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(attribute.LParToken.StartLocation, attribute.RParToken.EndLocation, ctx.TranslateString(\"Parentheses are redundant if attribute has no arguments\"), ctx.TranslateString(\"Remove '()'\"), script =>\n\t\t\t\t\tscript.Replace(attribute, new Attribute { Type = attribute.Type.Clone() })) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantBaseQualifierIssue.cs",
    "content": "﻿//\n// RedundantBaseQualifierIssue.cs\n//\n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n//\n// Copyright (c) 2013  Ji Kun <jikun.nus@gmail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Finds redundant base qualifier \n\t/// </summary>\n\t[IssueDescription(\"Redundant 'base.' qualifier\",\n\t                  Description = \"'base.' is redundant and can safely be removed.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantBaseQualifier\")]\n\tpublic class RedundantBaseQualifierIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar declarationSpaceVisitor = new LocalDeclarationSpaceVisitor();\n\t\t\tcontext.RootNode.AcceptVisitor(declarationSpaceVisitor);\n\n\t\t\treturn new GatherVisitor(context, declarationSpaceVisitor);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantBaseQualifierIssue>\n\t\t{\n\t\t\tLocalDeclarationSpaceVisitor declarationsSpaceVisitor;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, LocalDeclarationSpaceVisitor visitor) : base (ctx)\n\t\t\t{\n\t\t\t\tdeclarationsSpaceVisitor = visitor;\n\t\t\t}\n\n\t\t\tpublic override void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tbase.VisitSyntaxTree(syntaxTree);\n\t\t\t\tAnalyzeAllThisReferences();\n\t\t\t}\n\n\t\t\tstatic IMember GetMember(ResolveResult result)\n\t\t\t{\n\t\t\t\tif (result is MemberResolveResult)\n\t\t\t\t\treturn ((MemberResolveResult)result).Member;\n\t\t\t\tif (result is MethodGroupResolveResult)\n\t\t\t\t\treturn ((MethodGroupResolveResult)result).Methods.FirstOrDefault();\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treadonly IList<BaseReferenceExpression> thisReferences = new List<BaseReferenceExpression>();\n\n\t\t\tpublic override void VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBaseReferenceExpression(baseReferenceExpression);\n\t\t\t\tif (!IsSuppressed(baseReferenceExpression.Location))\n\t\t\t\t\tthisReferences.Add(baseReferenceExpression);\n\t\t\t}\n\n\t\t\tvoid AnalyzeAllThisReferences()\n\t\t\t{\n\t\t\t\tforeach (var thisReference in thisReferences) {\n\t\t\t\t\tAnalyzeThisReferenceExpression(thisReference);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AnalyzeThisReferenceExpression(BaseReferenceExpression baseReferenceExpression)\n\t\t\t{\n\t\t\t\tvar memberReference = baseReferenceExpression.Parent as MemberReferenceExpression;\n\t\t\t\tif (memberReference == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar state = ctx.GetResolverStateAfter(baseReferenceExpression);\n\t\t\t\tvar wholeResult = ctx.Resolve(memberReference);\n\n\t\t\t\tIMember member = GetMember(wholeResult);\n\t\t\t\tif (member == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar localDeclarationSpace = declarationsSpaceVisitor.GetDeclarationSpace(baseReferenceExpression);\n\t\t\t\tif (localDeclarationSpace == null || localDeclarationSpace.IsNameUsed(member.Name))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar result = state.LookupSimpleNameOrTypeName(memberReference.MemberName, EmptyList<IType>.Instance, NameLookupMode.Expression);\n\t\t\t\tvar parentResult = ctx.Resolve(memberReference.Parent) as CSharpInvocationResolveResult;\n\n\t\t\t\tbool isRedundant;\n\t\t\t\tif (result is MemberResolveResult) {\n\t\t\t\t\tisRedundant = ((MemberResolveResult)result).Member.Region.Equals(member.Region);\n\t\t\t\t} else if (parentResult != null && parentResult.IsExtensionMethodInvocation) {\n\t\t\t\t\t// 'this.' is required for extension method invocation\n\t\t\t\t\tisRedundant = false;\n\t\t\t\t} else if (result is MethodGroupResolveResult) {\n\t\t\t\t\tisRedundant = ((MethodGroupResolveResult)result).Methods.Any(m => m.Region.Equals(member.Region));\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar basicMembers = state.CurrentTypeDefinition.DirectBaseTypes.First().GetMembers();\n\t\t\t\tvar extendedMembers = state.CurrentTypeDefinition.GetMembers().Except(basicMembers);\n\t\t\t\tif (extendedMembers.Any(f => f.Name.Equals(member.Name)))\n\t\t\t\t\treturn;\n\n\t\t\t\tif (isRedundant) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tbaseReferenceExpression.StartLocation, \n\t\t\t\t\t\tmemberReference.MemberNameToken.StartLocation, \n\t\t\t\t\t\tctx.TranslateString(\"'base.' is redundant and can be removed safely.\"), \n\t\t\t\t\t\tctx.TranslateString(\"Remove 'base.'\"), \n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tscript.Replace(memberReference, RefactoringAstHelper.RemoveTarget(memberReference));\n\t\t\t\t\t\t}\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantBoolCompareIssue.cs",
    "content": "﻿// \n// CompareBooleanWithTrueOrFalseIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Comparison of boolean with 'true' or 'false'\",\n\t\t\t\t\t   Description = \"Comparison of a boolean value with 'true' or 'false' constant.\",\n\t\t\t\t\t   Category = IssueCategories.RedundanciesInCode,\n\t\t\t\t\t   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"RedundantBoolCompare\")]\n\tpublic class RedundantBoolCompareIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantBoolCompareIssue>\n\t\t{\n\t\t\t// note:this action should only check <bool> == true or <bool> != null - it needs excectly \n\t\t\t//      mimic the RedundantBoolCompare behavior otherwise it's no 1:1 mapping\n\t\t\tstatic readonly Pattern pattern = new Choice {\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(\n\t\t\t\t\tnew NamedNode (\"const\", new Choice { new PrimitiveExpression(true), new PrimitiveExpression(false) }),\n\t\t\t\t\tBinaryOperatorType.Equality, new AnyNode(\"expr\")),\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(\n\t\t\t\t\tnew NamedNode (\"const\", new Choice { new PrimitiveExpression(true), new PrimitiveExpression(false) }),\n\t\t\t\t\tBinaryOperatorType.InEquality, new AnyNode(\"expr\")),\n\t\t\t};\n\n\t\t\tstatic readonly InsertParenthesesVisitor insertParenthesesVisitor = new InsertParenthesesVisitor ();\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression (binaryOperatorExpression);\n\n\t\t\t\tvar match = pattern.Match (binaryOperatorExpression);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar expr = match.Get<Expression> (\"expr\").First ();\n\t\t\t\t// check if expr is of boolean type\n\t\t\t\tvar exprType = ctx.Resolve (expr).Type.GetDefinition ();\n\t\t\t\tif (exprType == null || exprType.KnownTypeCode != KnownTypeCode.Boolean)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar boolExpr = match.Get<PrimitiveExpression>(\"const\").First();\n\t\t\t\tvar boolConstant = (bool)boolExpr.Value;\n\n\t\t\t\tTextLocation start, end;\n\t\t\t\tif (boolExpr == binaryOperatorExpression.Left) {\n\t\t\t\t\tstart = binaryOperatorExpression.StartLocation;\n\t\t\t\t\tend = binaryOperatorExpression.OperatorToken.EndLocation;\n\t\t\t\t} else {\n\t\t\t\t\tstart = binaryOperatorExpression.OperatorToken.StartLocation;\n\t\t\t\t\tend = binaryOperatorExpression.EndLocation;\n\t\t\t\t}\n\n\t\t\t\tAddIssue (new CodeIssue(\n\t\t\t\t\tstart, end, \n\t\t\t\t\tboolConstant ? ctx.TranslateString (\"Comparison with 'true' is redundant\") : ctx.TranslateString (\"Comparison with 'false' is redundant\"),\n\t\t\t\t\tctx.TranslateString (\"Remove redundant comparison\"), \n\t\t\t\t\tscript => {\n\t\t\t\t\t\tif ((binaryOperatorExpression.Operator == BinaryOperatorType.InEquality && boolConstant) ||\n\t\t\t\t\t\t\t(binaryOperatorExpression.Operator == BinaryOperatorType.Equality && !boolConstant)) {\n\t\t\t\t\t\t\texpr = new UnaryOperatorExpression (UnaryOperatorType.Not, expr.Clone());\n\t\t\t\t\t\t\texpr.AcceptVisitor (insertParenthesesVisitor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscript.Replace (binaryOperatorExpression, expr);\n\t\t\t\t\t}\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCaseLabelIssue.cs",
    "content": "﻿// \n// RedundantCaseLabelIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Redundant 'case' label\",\n\t\t\t\t\t\tDescription = \"'case' label is redundant.\",\n\t\t\t\t\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\t\t\t\t\tSeverity = Severity.Warning,\n                        AnalysisDisableKeyword = \"RedundantCaseLabel\")]\n\tpublic class RedundantCaseLabelIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantCaseLabelIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitSwitchSection (SwitchSection switchSection)\n\t\t\t{\n\t\t\t\tbase.VisitSwitchSection (switchSection);\n\n\t\t\t\tif (switchSection.CaseLabels.Count < 2)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!switchSection.CaseLabels.Any(label => label.Expression.IsNull))\n\t\t\t\t\treturn;\n\n\t\t\t\tforeach (var caseLabel in switchSection.CaseLabels) {\n\t\t\t\t\tif (caseLabel.Expression.IsNull)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tcaseLabel,\n\t\t\t\t\t\tctx.TranslateString(\"Redundant case label\"),\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Remove 'case {0}'\"), caseLabel.Expression),\n\t\t\t\t\t\tscipt => {\n\t\t\t\t\t\t\tscipt.Remove(caseLabel);\n\t\t\t\t\t\t}\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCastIssue.cs",
    "content": "﻿// \n// RedundantCastIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant cast\",\n\t\tDescription = \"Type cast can be safely removed.\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantCast\")]\n\tpublic class RedundantCastIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantCastIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitCastExpression(CastExpression castExpression)\n\t\t\t{\n\t\t\t\tbase.VisitCastExpression(castExpression);\n\n\t\t\t\tCheckTypeCast(castExpression, castExpression.Expression, castExpression.StartLocation, \n\t\t\t\t\tcastExpression.Expression.StartLocation);\n\t\t\t}\n\n\t\t\tpublic override void VisitAsExpression(AsExpression asExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAsExpression(asExpression);\n\n\t\t\t\tCheckTypeCast(asExpression, asExpression.Expression, asExpression.Expression.EndLocation,\n\t\t\t\t\tasExpression.EndLocation);\n\t\t\t}\n\n\t\t\tIType GetExpectedType(Expression typeCastNode, out IMember accessingMember)\n\t\t\t{\n\t\t\t\tvar memberRefExpr = typeCastNode.Parent as MemberReferenceExpression;\n\t\t\t\tif (memberRefExpr != null) {\n\t\t\t\t\tvar invocationExpr = memberRefExpr.Parent as InvocationExpression;\n\t\t\t\t\tif (invocationExpr != null && invocationExpr.Target == memberRefExpr) {\n\t\t\t\t\t\tvar invocationResolveResult = ctx.Resolve(invocationExpr) as InvocationResolveResult;\n\t\t\t\t\t\tif (invocationResolveResult != null) {\n\t\t\t\t\t\t\taccessingMember = invocationResolveResult.Member;\n\t\t\t\t\t\t\treturn invocationResolveResult.Member.DeclaringType;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar memberResolveResult = ctx.Resolve(memberRefExpr) as MemberResolveResult;\n\t\t\t\t\t\tif (memberResolveResult != null) {\n\t\t\t\t\t\t\taccessingMember = memberResolveResult.Member;\n\t\t\t\t\t\t\treturn memberResolveResult.Member.DeclaringType;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taccessingMember = null;\n\t\t\t\treturn ctx.GetExpectedType(typeCastNode);\n\t\t\t}\n\n\t\t\tbool IsExplicitImplementation(IType exprType, IType interfaceType, Expression typeCastNode)\n\t\t\t{\n\t\t\t\tvar memberRefExpr = typeCastNode.Parent as MemberReferenceExpression;\n\t\t\t\tif (memberRefExpr != null) {\n\t\t\t\t\tvar rr = ctx.Resolve(memberRefExpr);\n\t\t\t\t\tvar memberResolveResult = rr as MemberResolveResult;\n\t\t\t\t\tif (memberResolveResult != null) {\n\t\t\t\t\t\tforeach (var member in exprType.GetMembers (m => m.SymbolKind == memberResolveResult.Member.SymbolKind)) {\n\t\t\t\t\t\t\tif (member.IsExplicitInterfaceImplementation && member.ImplementedInterfaceMembers.Contains(memberResolveResult.Member)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar methodGroupResolveResult = rr as MethodGroupResolveResult;\n\t\t\t\t\tif (methodGroupResolveResult != null) {\n\t\t\t\t\t\tforeach (var member in exprType.GetMethods ()) {\n\t\t\t\t\t\t\tif (member.IsExplicitInterfaceImplementation && member.ImplementedInterfaceMembers.Any(m => methodGroupResolveResult.Methods.Contains((IMethod)m))) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvoid AddIssue(Expression outerTypeCastNode, Expression typeCastNode, Expression expr, TextLocation start, TextLocation end)\n\t\t\t{\n\t\t\t\tAstNode type;\n\t\t\t\tif (typeCastNode is CastExpression)\n\t\t\t\t\ttype = ((CastExpression)typeCastNode).Type;\n\t\t\t\telse\n\t\t\t\t\ttype = ((AsExpression)typeCastNode).Type;\n\t\t\t\tAddIssue(new CodeIssue(start, end, ctx.TranslateString(\"Type cast is redundant\"), string.Format(ctx.TranslateString(\"Remove cast to '{0}'\"), type),\n\t\t\t\t\tscript => script.Replace(outerTypeCastNode, expr.Clone())) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\tbool IsRedundantInBinaryExpression(BinaryOperatorExpression bop, Expression outerTypeCastNode, IType exprType)\n\t\t\t{\n\t\t\t\tif (bop.Operator == BinaryOperatorType.NullCoalescing) {\n\t\t\t\t\tif (outerTypeCastNode == bop.Left) {\n\t\t\t\t\t\tvar rr = ctx.Resolve(bop.Right).Type;\n\t\t\t\t\t\tif (rr != exprType)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn ctx.Resolve(bop.Left).Type != ctx.Resolve(bop.Right).Type;\n\t\t\t}\n\n\t\t\tbool IsBreaking(IType exprType, IType expectedType)\n\t\t\t{\n\t\t\t\tif (exprType.IsReferenceType == true &&\n\t\t\t\t\texpectedType.IsReferenceType == false &&\n\t\t\t\t\texprType != expectedType)\n\t\t\t\t\treturn true;\n\t\t\t\tif (exprType.IsReferenceType == false &&\n\t\t\t\t\texpectedType.IsReferenceType == true &&\n\t\t\t\t\texprType != expectedType)\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool IsRequiredToSelectOverload(IEnumerable<IMethod> methods, IType expectedType, int nArg)\n\t\t\t{\n\t\t\t\t// TODO: Check method accessibility & other parameter match.\n\t\t\t\tint count = 0;\n\t\t\t\tforeach (var method in methods) {\n\t\t\t\t\tif (method.Parameters.Count < nArg)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar baseTypes = method.Parameters[nArg].Type.GetAllBaseTypes();\n\t\t\t\t\tif (expectedType == method.Parameters[nArg].Type || baseTypes.Any(t => t.Equals(expectedType)))\n\t\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\treturn count > 1;\n\t\t\t}\n\n\t\t\tvoid CheckTypeCast(Expression typeCastNode, Expression expr, TextLocation castStart, TextLocation castEnd)\n\t\t\t{\n\t\t\t\tvar outerTypeCastNode = typeCastNode;\n\t\t\t\twhile (outerTypeCastNode.Parent is ParenthesizedExpression)\n\t\t\t\t\touterTypeCastNode = (Expression)outerTypeCastNode.Parent;\n\n\t\t\t\tIMember accessingMember;\n\t\t\t\tvar expectedType = GetExpectedType(outerTypeCastNode, out accessingMember);\n\t\t\t\tvar exprType = ctx.Resolve(expr).Type;\n\t\t\t\tif (expectedType.Kind == TypeKind.Interface && IsExplicitImplementation(exprType, expectedType, outerTypeCastNode))\n\t\t\t\t\treturn;\n\t\t\t\tvar baseTypes = exprType.GetAllBaseTypes().ToList();\n\t\t\t\tif (!baseTypes.Any(t => t.Equals(expectedType)))\n\t\t\t\t\treturn;\n\n\t\t\t\tif (IsBreaking(exprType, expectedType))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar cond = outerTypeCastNode.Parent as ConditionalExpression;\n\t\t\t\tif (cond != null) {\n\t\t\t\t\tif (outerTypeCastNode == cond.TrueExpression) {\n\t\t\t\t\t\tvar rr = ctx.Resolve(cond.FalseExpression).Type;\n\t\t\t\t\t\tif (rr != exprType)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar bop = outerTypeCastNode.Parent as BinaryOperatorExpression;\n\t\t\t\tif (bop != null && IsRedundantInBinaryExpression(bop, outerTypeCastNode, exprType))\n\t\t\t\t\treturn;\n\n\t\t\t\t// check if the called member doesn't change it's virtual slot when changing types\n\t\t\t\tif (accessingMember != null) {\n\t\t\t\t\tvar baseMember = InheritanceHelper.GetBaseMember(accessingMember);\n\t\t\t\t\tforeach (var bt in baseTypes) {\n\t\t\t\t\t\tforeach (var member in bt.GetMembers(m => m.Name == accessingMember.Name)) {\n\t\t\t\t\t\t\tif (InheritanceHelper.GetBaseMember(member) != baseMember)\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar mrr = ctx.Resolve(typeCastNode.Parent) as CSharpInvocationResolveResult;\n\t\t\t\tif (mrr != null) {\n\t\t\t\t\tif (mrr.Member.SymbolKind == SymbolKind.Constructor) {\n\t\t\t\t\t\tint nArg = typeCastNode.Parent.Children\n\t\t\t\t\t\t\t.Where(n => n.Role == Roles.Argument)\n\t\t\t\t\t\t\t.TakeWhile(n => n.DescendantNodesAndSelf().All(c => c != typeCastNode))\n\t\t\t\t\t\t\t.Count();\n\n\t\t\t\t\t\tif (IsRequiredToSelectOverload(mrr.Member.DeclaringTypeDefinition.GetConstructors(), expectedType, nArg))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (mrr.Member.SymbolKind == SymbolKind.Method) {\n\t\t\t\t\t\tint nArg = typeCastNode.Parent.Children\n\t\t\t\t\t\t\t.Where(n => n.Role == Roles.Argument)\n\t\t\t\t\t\t\t.TakeWhile(n => n.DescendantNodesAndSelf().All(c => c != typeCastNode))\n\t\t\t\t\t\t\t.Count();\n\t\t\t\t\t\tif (IsRequiredToSelectOverload(mrr.Member.DeclaringTypeDefinition.GetMethods(m => m.Name == mrr.Member.Name), expectedType, nArg))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tAddIssue(outerTypeCastNode, typeCastNode, expr, castStart, castEnd);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCatchClauseIssue.cs",
    "content": "//\n// RedundantCatchIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant catch clause\",\n                      Description = \"Catch clause with a single 'throw' statement is redundant.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Hint,\n                      AnalysisDisableKeyword = \"RedundantCatchClause\")]\n\tpublic class RedundantCatchClauseIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantCatchClauseIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTryCatchStatement(TryCatchStatement tryCatchStatement)\n\t\t\t{\n\t\t\t\tvar redundantCatchClauses = new List<CatchClause>();\n\t\t\t\tbool hasNonRedundantCatch = false;\n\t\t\t\tforeach (var catchClause in tryCatchStatement.CatchClauses) {\n\t\t\t\t\tif (IsRedundant(catchClause)) {\n\t\t\t\t\t\tredundantCatchClauses.Add(catchClause);\n\t\t\t\t\t} else {\n\t\t\t\t\t\thasNonRedundantCatch = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hasNonRedundantCatch || !tryCatchStatement.FinallyBlock.IsNull) {\n\t\t\t\t\tAddIssuesForClauses(tryCatchStatement, redundantCatchClauses);\n\t\t\t\t} else {\n\t\t\t\t\tAddIssueForTryCatchStatement(tryCatchStatement);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddIssuesForClauses(AstNode node, List<CatchClause> redundantCatchClauses)\n\t\t\t{\n\t\t\t\tvar allCatchClausesMessage = ctx.TranslateString(\"Remove all '{0}' redundant 'catch' clauses\");\n\t\t\t\tvar removeAllRedundantClausesAction = new CodeAction(allCatchClausesMessage, script => {\n\t\t\t\t\tforeach (var redundantCatchClause in redundantCatchClauses) {\n\t\t\t\t\t\tscript.Remove(redundantCatchClause);\n\t\t\t\t\t}\n\t\t\t\t}, node);\n\t\t\t\tvar singleCatchClauseMessage = ctx.TranslateString(\"Remove 'catch'\");\n                var redundantCatchClauseMessage = ctx.TranslateString(\"Catch clause with a single 'throw' statement is redundant.\");\n\t\t\t\tforeach (var redundantCatchClause in redundantCatchClauses) {\n\t\t\t\t\tvar closureLocalCatchClause = redundantCatchClause;\n\t\t\t\t\tvar removeRedundantClauseAction = new CodeAction(singleCatchClauseMessage, script => {\n\t\t\t\t\t\tscript.Remove(closureLocalCatchClause);\n\t\t\t\t\t}, node);\n\t\t\t\t\tvar actions = new List<CodeAction>();\n\t\t\t\t\tactions.Add(removeRedundantClauseAction);\n\t\t\t\t\tif (redundantCatchClauses.Count > 1) {\n\t\t\t\t\t\tactions.Add(removeAllRedundantClausesAction);\n\t\t\t\t\t}\n\t\t\t\t\tAddIssue(new CodeIssue(closureLocalCatchClause, redundantCatchClauseMessage, actions) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddIssueForTryCatchStatement(TryCatchStatement tryCatchStatement)\n\t\t\t{\n\t\t\t\tvar lastCatch = tryCatchStatement.CatchClauses.LastOrNullObject();\n\t\t\t\tif (lastCatch.IsNull)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar removeTryCatchMessage = ctx.TranslateString(\"Remove 'try' statement\");\n\n\t\t\t\tvar removeTryStatementAction = new CodeAction(removeTryCatchMessage, script => {\n\t\t\t\t\tvar statements = tryCatchStatement.TryBlock.Statements;\n\t\t\t\t\tif (statements.Count == 1 || tryCatchStatement.Parent is BlockStatement) {\n\t\t\t\t\t\tforeach (var statement in statements) {\n\t\t\t\t\t\t\tscript.InsertAfter(tryCatchStatement.GetPrevSibling (s => !(s is NewLineNode)), statement.Clone());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscript.Remove(tryCatchStatement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar blockStatement = new BlockStatement();\n\t\t\t\t\t\tforeach (var statement in statements) {\n\t\t\t\t\t\t\tblockStatement.Statements.Add(statement.Clone());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscript.Replace(tryCatchStatement, blockStatement);\n\t\t\t\t\t}\n\t\t\t\t\t// The replace and insert script functions does not format these things well on their own\n\t\t\t\t\tscript.FormatText(tryCatchStatement.Parent);\n\t\t\t\t}, tryCatchStatement);\n\n\t\t\t\tvar fixes = new [] {\n\t\t\t\t\tremoveTryStatementAction\n\t\t\t\t};\n\t\t\t\tAddIssue(new CodeIssue(tryCatchStatement.TryBlock.EndLocation, lastCatch.EndLocation, removeTryCatchMessage, fixes) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\tstatic bool IsThrowsClause (CatchClause catchClause)\n\t\t\t{\n\t\t\t\tvar firstStatement = catchClause.Body.Statements.FirstOrNullObject();\n\t\t\t\tif (firstStatement.IsNull)\n\t\t\t\t\treturn false;\n\t\t\t\tvar throwStatement = firstStatement as ThrowStatement;\n\t\t\t\tif (throwStatement == null || !throwStatement.Expression.IsNull)\n\t\t\t\t\treturn false;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tbool IsRedundant(CatchClause catchClause)\n\t\t\t{\n\t\t\t\tif (!IsThrowsClause (catchClause))\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar type = ctx.Resolve (catchClause.Type).Type;\n\t\t\t\tvar n = catchClause.NextSibling;\n\t\t\t\twhile (n != null) {\n\t\t\t\t\tvar nextClause = n as CatchClause;\n\t\t\t\t\tif (nextClause != null) {\n\t\t\t\t\t\tif (nextClause.Type.IsNull && !IsThrowsClause(nextClause))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif (!IsThrowsClause(nextClause)) {\n\t\t\t\t\t\t\tvar typeDef = type.GetDefinition();\n\t\t\t\t\t\t\tif (typeDef == null || typeDef.IsDerivedFrom(ctx.Resolve(nextClause.Type).Type.GetDefinition()))\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tn = n.NextSibling;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCheckBeforeAssignmentIssue.cs",
    "content": "// \n// RedundantCheckBeforeAssignmentIssue.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n//      Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant condition check before assignment\",\n\t                   Description = \"Check for inequality before assignment is redundant if (x != value) x = value;\",\n\t                   Category = IssueCategories.RedundanciesInCode,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"RedundantCheckBeforeAssignment\")]\n\tpublic class RedundantCheckBeforeAssignmentIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantCheckBeforeAssignmentIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode pattern = \n\t\t\t\tnew IfElseStatement(\n\t\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"a\"), BinaryOperatorType.InEquality, new AnyNode(\"b\")),\n\t\t\t\t\tPatternHelper.EmbeddedStatement(new AssignmentExpression(new Backreference(\"a\"), PatternHelper.OptionalParentheses(new Backreference(\"b\"))))\n\t\t\t\t);\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\t\t\t\tvar m = pattern.Match(ifElseStatement);\n\t\t\t\tif (!m.Success)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tifElseStatement.Condition,\n\t\t\t\t\tctx.TranslateString(\"Redundant condition check before assignment\"),\n\t\t\t\t\tctx.TranslateString(\"Remove redundant check\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar stmt = ifElseStatement.TrueStatement;\n\t\t\t\t\t\tvar block = stmt as BlockStatement;\n\t\t\t\t\t\tif (block != null)\n\t\t\t\t\t\t\tstmt = block.Statements.First();\n\t\t\t\t\t\tscript.Replace(ifElseStatement, stmt.Clone());\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCommaInArrayInitializerIssue.cs",
    "content": "﻿// \n// RedundantCommaInArrayInitializerIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Redundant comma in array initializer\",\n\t\t\t\t\t\tDescription = \"Redundant comma in array initializer.\",\n\t\t\t\t\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\t\t\t\t\tSeverity = Severity.Warning,\n                        AnalysisDisableKeyword = \"RedundantCommaInArrayInitializer\")]\n\tpublic class RedundantCommaInArrayInitializerIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantCommaInArrayInitializerIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression)\n\t\t\t{\n\t\t\t\tbase.VisitArrayInitializerExpression(arrayInitializerExpression);\n\n\t\t\t\tif (arrayInitializerExpression.IsSingleElement)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar commaToken = arrayInitializerExpression.RBraceToken.PrevSibling as CSharpTokenNode;\n\t\t\t\tif (commaToken == null || commaToken.ToString() != \",\")\n\t\t\t\t\treturn;\n\t\t\t\tstring issueDescription;\n\t\t\t\tif (arrayInitializerExpression.Parent is ObjectCreateExpression) {\n\t\t\t\t\tif (arrayInitializerExpression.Elements.FirstOrNullObject() is NamedExpression) {\n\t\t\t\t\t\tissueDescription = ctx.TranslateString(\"Redundant comma in object initializer\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tissueDescription = ctx.TranslateString(\"Redundant comma in collection initializer\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tissueDescription = ctx.TranslateString(\"Redundant comma in array initializer\");\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(commaToken,\n\t\t\t\t         issueDescription,\n\t\t\t\t         ctx.TranslateString(\"Remove ','\"),\n\t\t\t\t\tscript => script.Remove(commaToken)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantComparisonWithNullIssue.cs",
    "content": "//\n// RedundantComparisonWithNullIssue.cs\n//\n// Author:\n//\t   Ji Kun <jikun.nus@gmail.com>\n//\n// Copyright (c) 2013 Ji Kun\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.using System;\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant comparison with 'null'\",\n\t                  Description = \"When 'is' keyword is used, which implicitly check null.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n                      AnalysisDisableKeyword = \"RedundantComparisonWithNull\")]\n\tpublic class RedundantComparisonWithNullIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprivate static readonly Pattern pattern1\n\t\t\t= new Choice {\n\t\t\t//  a is Record && a != null\n\t\t\tnew BinaryOperatorExpression(\n\t\t\t\tPatternHelper.OptionalParentheses(\n\t\t\t\t\tnew IsExpression {\n\t\t\t\t\t\tExpression = new AnyNode(\"a\"),\n\t\t\t\t\t\tType = new AnyNode(\"t\")\n\t\t\t\t\t}),\n\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new Backreference(\"a\"),\n\t\t\t\t\t                                  BinaryOperatorType.InEquality,\n\t\t\t\t\t                                  new NullReferenceExpression())\n\t\t\t),\n\t\t\t//  a != null && a is Record\n\t\t\tnew BinaryOperatorExpression (\n\t\t\t\tPatternHelper.CommutativeOperatorWithOptionalParentheses(new AnyNode(\"a\"),\n\t\t\t\t\t                                  BinaryOperatorType.InEquality,\n\t\t\t\t\t                                  new NullReferenceExpression()),\n\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\tPatternHelper.OptionalParentheses(\n\t\t\t\t\tnew IsExpression {\n\t\t\t\t\t\tExpression = new Backreference(\"a\"),\n\t\t\t\t\t\tType = new AnyNode(\"t\")\n\t\t\t\t\t})\n\t\t\t)\n\t\t};\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantComparisonWithNullIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tMatch m1 = pattern1.Match(binaryOperatorExpression);\n\t\t\t\tif (m1.Success) {\n\t\t\t\t\tAddIssue(new CodeIssue(binaryOperatorExpression,\n\t\t\t\t\t         ctx.TranslateString(\"Redundant comparison with 'null'\"),\n\t\t\t\t\t         ctx.TranslateString(\"Remove expression\"), \n\t\t\t\t\t         script => {\n\t\t\t\t\t         \tvar isExpr = m1.Get<AstType>(\"t\").Single().Parent;\n\t\t\t\t\t         \tscript.Replace(binaryOperatorExpression, isExpr);\n\t\t\t\t\t         }\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantDelegateCreationIssue.cs",
    "content": "//\n// RedundantDelegateCreationIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\n\t\t\"Explicit delegate creation expression is redundant\",\n\t\tDescription = \"Explicit delegate creation expression is redundant\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantDelegateCreation\")]\n\tpublic class RedundantDelegateCreationIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantDelegateCreationIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\t\t\t\tif (assignmentExpression.Operator != AssignmentOperatorType.Add && assignmentExpression.Operator != AssignmentOperatorType.Subtract)\n\t\t\t\t\treturn;\n\t\t\t\tvar oce = assignmentExpression.Right as ObjectCreateExpression;\n\t\t\t\tif (oce == null || oce.Arguments.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\tvar left = ctx.Resolve(assignmentExpression.Left) as MemberResolveResult;\n\t\t\t\tif (left == null || left.Member.SymbolKind != SymbolKind.Event)\n\t\t\t\t\treturn;\n\t\t\t\tvar right = ctx.Resolve(assignmentExpression.Right);\n\t\t\t\tif (right.IsError || !Equals(left.Type, right.Type))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(oce.StartLocation, oce.Type.EndLocation,\n\t\t\t\t\tctx.TranslateString(\"Redundant explicit delegate declaration\"),\n\t\t\t\t\tctx.TranslateString(\"Remove redundant 'new'\"),\n\t\t\t\t\ts => s.Replace(assignmentExpression.Right, oce.Arguments.First())\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantEmptyDefaultSwitchBranchIssue.cs",
    "content": "//\n// RedundantEmptyDefaultSwitchBranchIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Redundant empty 'default' switch branch\",\n\t                   Description = \"Redundant empty 'default' switch branch\",\n\t                   Category = IssueCategories.RedundanciesInCode,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"RedundantEmptyDefaultSwitchBranch\")]\n\tpublic class RedundantEmptyDefaultSwitchBranchIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantEmptyDefaultSwitchBranchIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode pattern = new SwitchSection {\n\t\t\t\tCaseLabels = { new CaseLabel () },\n\t\t\t\tStatements = { new BreakStatement() }\n\t\t\t};\n\n\t\t\tpublic override void VisitSwitchSection(SwitchSection switchSection)\n\t\t\t{\n\t\t\t\tbase.VisitSwitchSection(switchSection);\n\t\t\t\tif (!pattern.IsMatch(switchSection))\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tswitchSection,\n\t\t\t\t\tctx.TranslateString(\"Redundant empty 'default' switch branch\"),\n\t\t\t\t\tctx.TranslateString(\"Remove redundant 'default' branch\"),\n\t\t\t\t\tscript => script.Remove(switchSection)\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantEmptyFinallyBlockIssue.cs",
    "content": "//\n// RedundantEmptyFinallyBlockIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Redundant empty finally block\",\n\t\tDescription = \"Redundant empty finally block\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantEmptyFinallyBlock\")]\n\tpublic class RedundantEmptyFinallyBlockIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantEmptyFinallyBlockIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic bool IsEmpty (BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\treturn !blockStatement.Descendants.Any(s => s is Statement && !(s is EmptyStatement || s is BlockStatement));\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\tbase.VisitBlockStatement(blockStatement);\n\t\t\t\tif (blockStatement.Role != TryCatchStatement.FinallyBlockRole || !IsEmpty (blockStatement))\n\t\t\t\t\treturn;\n\t\t\t\tvar tryCatch = blockStatement.Parent as TryCatchStatement;\n\t\t\t\tif (tryCatch == null)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\ttryCatch.FinallyToken.StartLocation,\n\t\t\t\t\tblockStatement.EndLocation,\n\t\t\t\t\tctx.TranslateString(\"Redundant empty finally block\"),\n\t\t\t\t\tctx.TranslateString(\"Remove 'finally'\"),\n\t\t\t\t\ts => {\n\t\t\t\t\t\tif (tryCatch.CatchClauses.Any()) {\n\t\t\t\t\t\t\ts.Remove(tryCatch.FinallyToken);\n\t\t\t\t\t\t\ts.Remove(blockStatement); \n\t\t\t\t\t\t\ts.FormatText(tryCatch);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ts.Remove(tryCatch.TryToken);\n\t\t\t\t\t\ts.Remove(tryCatch.TryBlock.LBraceToken);\n\t\t\t\t\t\ts.Remove(tryCatch.TryBlock.RBraceToken);\n\t\t\t\t\t\ts.Remove(tryCatch.FinallyToken);\n\t\t\t\t\t\ts.Remove(tryCatch.FinallyBlock); \n\t\t\t\t\t\ts.FormatText(tryCatch.Parent);\n\t\t\t\t\t}\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantEmptyObjectCreationArgumentListssue.cs",
    "content": "﻿// \n// RedundantObjectCreationArgumentListIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Redundant empty argument list on object creation expression\",\n\t                   Description = \"When object creation uses object or collection initializer, empty argument list is redundant.\",\n\t                   Category = IssueCategories.RedundanciesInCode,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"RedundantEmptyObjectCreationArgumentList\")]\n\tpublic class RedundantObjectCreationArgumentListIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantObjectCreationArgumentListIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\n\t\t\t\tif (objectCreateExpression.Initializer.IsNull ||\n\t\t\t\t\tobjectCreateExpression.Arguments.Count > 0 ||\n\t\t\t\t\tobjectCreateExpression.LParToken.IsNull)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(objectCreateExpression.LParToken.StartLocation, objectCreateExpression.RParToken.EndLocation,\n\t\t\t\t         ctx.TranslateString(\"Empty argument list is redundant\"),\n\t\t\t\t         ctx.TranslateString(\"Remove '()'\"), script => {\n\t\t\t\t\tvar l1 = objectCreateExpression.LParToken.GetPrevNode().EndLocation;\n\t\t\t\t\tvar l2 = objectCreateExpression.RParToken.GetNextNode().StartLocation;\n\t\t\t\t\tvar o1 = script.GetCurrentOffset(l1);\n\t\t\t\t\tvar o2 = script.GetCurrentOffset(l2);\n\n\t\t\t\t\tscript.Replace(o1, o2 - o1, \" \");\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantEnumerableCastCallIssue.cs",
    "content": "//\n// RedundantEnumerableCastCallIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t// OfType -> Underline (+suggest to compare to null)\n\t[IssueDescription (\n\t\t\"Redundant 'IEnumerable.Cast<T>' or 'IEnumerable.OfType<T>' call\",\n\t\tDescription = \"Redundant 'IEnumerable.Cast<T>' or 'IEnumerable.OfType<T>' call\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantEnumerableCastCall\")]\n\tpublic class RedundantEnumerableCastCallIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantEnumerableCastCallIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\tvar mt = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (mt == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (rr == null || rr.IsError)\n\t\t\t\t\treturn;\n\t\t\t\tif (rr.Member.DeclaringType.Name != \"Enumerable\" || rr.Member.DeclaringType.Namespace != \"System.Linq\")\n\t\t\t\t\treturn;\n\t\t\t\tbool isCast = rr.Member.Name == \"Cast\";\n\t\t\t\tif (!isCast && rr.Member.Name != \"OfType\")\n\t\t\t\t\treturn;\n\t\t\t\tvar tr = ctx.Resolve(mt.Target);\n\t\t\t\tif (tr.Type.Equals(rr.Type) || tr.Type.GetAllBaseTypes().Any (bt=> bt.Equals(rr.Type))) {\n\t\t\t\t\tif (isCast) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tmt.DotToken.StartLocation,\n\t\t\t\t\t\t\tmt.EndLocation,\n\t\t\t\t\t\t\tctx.TranslateString(\"Redundant 'IEnumerable.Cast<T>' call\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Remove 'Cast<T>' call\"),\n\t\t\t\t\t\t\ts => s.Replace(invocationExpression, mt.Target.Clone())\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tmt.DotToken.StartLocation,\n\t\t\t\t\t\t\tmt.EndLocation,\n\t\t\t\t\t\t\tctx.TranslateString(\"Redundant 'IEnumerable.OfType<T>' call.\"),\n\t\t\t\t\t\t\tnew [] {\n\t\t\t\t\t\t\t\tnew CodeAction(\n\t\t\t\t\t\t\t\t\tctx.TranslateString(\"Compare items with null\"),\n\t\t\t\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\t\t\t\tvar name = ctx.GetNameProposal(\"i\", mt.StartLocation);\n\t\t\t\t\t\t\t\t\t\ts.Replace(invocationExpression, \n\t\t\t\t\t\t\t\t\t\t\tnew InvocationExpression(\n\t\t\t\t\t\t\t\t\t\t\t\tnew MemberReferenceExpression(mt.Target.Clone(), \"Where\"), \n\t\t\t\t\t\t\t\t\t\t\t\tnew LambdaExpression {\n\t\t\t\t\t\t\t\t\t\t\t\t\tParameters = { new ParameterDeclaration(name) },\n\t\t\t\t\t\t\t\t\t\t\t\t\tBody = new BinaryOperatorExpression(new IdentifierExpression(name), BinaryOperatorType.InEquality, new NullReferenceExpression())\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tmt\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tnew CodeAction(\n\t\t\t\t\t\t\t\t\tctx.TranslateString(\"Remove 'OfType<T>' call\"),\n\t\t\t\t\t\t\t\t\ts => s.Replace(invocationExpression, mt.Target.Clone()),\n\t\t\t\t\t\t\t\t\tmt\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantExplicitArrayCreationIssue.cs",
    "content": "//\n// RedundantExplicitArrayCreationIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Redundant explicit type in array creation\",\n\t\tDescription = \"Redundant explicit type in array creation\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantExplicitArrayCreation\")]\n\tpublic class RedundantExplicitArrayCreationIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantExplicitArrayCreationIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tif (!ctx.Supports(new Version(3, 0)))\n\t\t\t\t\treturn;\n\t\t\t\tbase.VisitSyntaxTree(syntaxTree);\n\t\t\t}\n\n\t\t\tpublic override void VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitArrayCreateExpression(arrayCreateExpression);\n\t\t\t\tif (arrayCreateExpression.Arguments.Count != 0)\n\t\t\t\t\treturn;\n\t\t\t\tvar arrayType = arrayCreateExpression.Type;\n\t\t\t\tif (arrayType.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tvar arrayTypeRR = ctx.Resolve(arrayType);\n\t\t\t\tif (arrayTypeRR.IsError)\n\t\t\t\t\treturn;\n\n\t\t\t\tIType elementType = null;\n\t\t\t\tforeach (var element in arrayCreateExpression.Initializer.Elements) {\n\t\t\t\t\tvar elementTypeRR = ctx.Resolve(element);\n\t\t\t\t\tif (elementTypeRR.IsError)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (elementType == null) {\n\t\t\t\t\t\telementType = elementTypeRR.Type;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (elementType != elementTypeRR.Type)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (elementType != arrayTypeRR.Type)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(\n\t\t\t\t\tnew CodeIssue (\n\t\t\t\t\t\tarrayType,\n\t\t\t\t\t\tctx.TranslateString(\"Redundant explicit array type specification\"),\n\t\t\t\t\t\tctx.TranslateString(\"Remove redundant type specification\"),\n\t\t\t\t\t\ts => s.Remove(arrayType) \n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut }\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantExplicitArraySizeIssue.cs",
    "content": "//\n// RedundantExplicitArraySizeIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Redundant explicit size in array creation\",\n\t\tDescription = \"Redundant explicit size in array creation\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantExplicitArraySize\")]\n\tpublic class RedundantExplicitArraySizeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantExplicitArraySizeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitArrayCreateExpression(arrayCreateExpression);\n\t\t\t\tif (arrayCreateExpression.Arguments.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\tvar arg = arrayCreateExpression.Arguments.Single() as PrimitiveExpression;\n\t\t\t\tif (arg == null || !(arg.Value is int))\n\t\t\t\t\treturn;\n\t\t\t\tvar value = (int)arg.Value;\n\t\t\t\tif (value == 0)\n\t\t\t\t\treturn;\n\t\t\t\tif (arrayCreateExpression.Initializer.Elements.Count() == value) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\targ,\n\t\t\t\t\t\tctx.TranslateString(\"Redundant explicit size in array creation\"),\n\t\t\t\t\t\tstring.Format(ctx.TranslateString(\"Remove '{0}'\"), arg),\n\t\t\t\t\t\ts => { s.Remove(arg); }\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantExplicitNullableCreationIssue.cs",
    "content": "//\n// RedundantExplicitNullableCreationIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant explicit nullable type creation\",\n\t\tDescription= \"Value types are implicitly convertible to nullables\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantExplicitNullableCreation\")]\n\tpublic class RedundantExplicitNullableCreationIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantExplicitNullableCreationIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\n\t\t\t\t// test for var foo = new ... \n\t\t\t\tvar parentVarDecl = objectCreateExpression.Parent.Parent as VariableDeclarationStatement;\n\t\t\t\tif (parentVarDecl != null && parentVarDecl.Type.IsVar())\n\t\t\t\t\treturn;\n\n\t\t\t\tvar rr = ctx.Resolve(objectCreateExpression);\n\t\t\t\tif (!NullableType.IsNullable(rr.Type))\n\t\t\t\t\treturn;\n\t\t\t\tvar arg = objectCreateExpression.Arguments.FirstOrDefault();\n\t\t\t\tif (arg == null)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tobjectCreateExpression.StartLocation,\n\t\t\t\t\tobjectCreateExpression.Type.EndLocation,\n\t\t\t\t\tctx.TranslateString(\"Redundant explicit nullable type creation\"),\n\t\t\t\t\tctx.TranslateString(\"Remove redundant 'new'\"),\n\t\t\t\t\ts => s.Replace(objectCreateExpression, arg.Clone())\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantExtendsListEntryIssue.cs",
    "content": "﻿// \n// RedundantBaseTypeIssue.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013  Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Type is either mentioned in the base type list of other part, or it is interface and appears as other's type base and contains no explicit implementation.\n\t/// </summary>\n\t[IssueDescription(\"Redundant class or interface specification in base types list\",\n\t                  Description= \"Type is either mentioned in the base type list of another part or in another base type\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantExtendsListEntry\")]\n\tpublic class RedundantExtendsListEntryIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantExtendsListEntryIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, RedundantExtendsListEntryIssue issueProvider) : base (ctx, issueProvider)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\t\n\t\t\t\tif (typeDeclaration.BaseTypes.Count == 0)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tList<AstNode> redundantBase = new List<AstNode>();\n\t\t\t\tvar type = ctx.Resolve(typeDeclaration).Type;\n\n\t\t\t\tif (typeDeclaration.HasModifier(Modifiers.Partial) && type.GetDefinition() != null) {\n\t\t\t\t\tvar parts = type.GetDefinition().Parts;\n\t\t\t\t\tforeach (var node in typeDeclaration.BaseTypes) {\n\t\t\t\t\t\tint count = 0;\n\t\t\t\t\t\tforeach (var unresolvedTypeDefinition in parts) {\n\t\t\t\t\t\t\tvar baseTypes = unresolvedTypeDefinition.BaseTypes;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (baseTypes.Any(f => f.ToString().Equals(node.ToString()))) {\n\t\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t\t\tif (count > 1) {\n\t\t\t\t\t\t\t\t\tif (!redundantBase.Contains(node))\n\t\t\t\t\t\t\t\t\t\tredundantBase.Add(node);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar directBaseType = type.DirectBaseTypes.Where(f => f.Kind == TypeKind.Class);\n\t\t\t\tif (directBaseType.Count() != 1)\n\t\t\t\t\treturn;\n\t\t\t\tvar members = type.GetMembers();\n\t\t\t\tvar memberDeclaration = typeDeclaration.Members;\n\t\t\t\tvar interfaceBase = typeDeclaration.BaseTypes.Where(delegate(AstType f) {\n\t\t\t\t\tvar resolveResult = ctx.Resolve(f);\n\t\t\t\t\tif (resolveResult.IsError || resolveResult.Type.GetDefinition() == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn resolveResult.Type.GetDefinition().Kind == TypeKind.Interface;\n\t\t\t\t});\n\t\t\t\tforeach (var node in interfaceBase) {\n\t\t\t\t\tif (directBaseType.Single().GetDefinition().GetAllBaseTypeDefinitions().Any(f => f.Name.Equals(node.ToString()))) {\n\t\t\t\t\t\tbool flag = false;\n\t\t\t\t\t\tforeach (var member in members) {\n\t\t\t\t\t\t\tif (!memberDeclaration.Any(f => f.Name.Equals(member.Name))) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tmember.ImplementedInterfaceMembers.Any(\n\t\t\t\t\t\t\t\tg => g.DeclaringType.Name.Equals(node.ToString()))) {\n\t\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!flag) {\n\t\t\t\t\t\t\tif (!redundantBase.Contains(node))\n\t\t\t\t\t\t\t\tredundantBase.Add(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\tforeach (var node in redundantBase) {\n\t\t\t\t\tvar nodeType = ctx.Resolve(node).Type;\n\t\t\t\t\tvar issueText = nodeType.Kind == TypeKind.Interface ?\n\t\t\t\t\t\tctx.TranslateString(\"Base interface '{0}' is redundant\") :\n\t\t\t\t\t\tctx.TranslateString(\"Base type '{0}' is already specified in other parts\");\n\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tstring.Format(issueText, nodeType.Name), \n\t\t\t\t\t\tnew CodeAction (\n\t\t\t\t\t\t\tctx.TranslateString(\"Remove redundant base type reference\"),\n\t\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\t\tif (typeDeclaration.GetCSharpNodeBefore(node).ToString().Equals(\":\")) {\n\t\t\t\t\t\t\t\t\tif (node.GetNextNode().Role != Roles.BaseType) {\n\t\t\t\t\t\t\t\t\t\tscript.Remove(typeDeclaration.GetCSharpNodeBefore(node));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (typeDeclaration.GetCSharpNodeBefore(node).ToString().Equals(\",\")) {\n\t\t\t\t\t\t\t\t\tscript.Remove(typeDeclaration.GetCSharpNodeBefore(node));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tscript.Remove(node);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnode)\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantIfElseBlockIssue.cs",
    "content": "﻿// \n// RedundantIfElseBlockIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant 'else' keyword\",\n\t                  Description = \"Redundant 'else' keyword.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantIfElseBlock\")]\n\tpublic class RedundantIfElseBlockIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantIfElseBlockIssue>\n\t\t{\n\t\t\treadonly LocalDeclarationSpaceVisitor declarationSpaceVisitor;\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tthis.declarationSpaceVisitor = new LocalDeclarationSpaceVisitor();\n\t\t\t}\n\n\t\t\tpublic override void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tsyntaxTree.AcceptVisitor(declarationSpaceVisitor);\n\t\t\t\tbase.VisitSyntaxTree(syntaxTree);\n\t\t\t}\n\n\t\t\tbool ElseIsRedundantControlFlow(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tif (ifElseStatement.FalseStatement.IsNull || ifElseStatement.Parent is IfElseStatement)\n\t\t\t\t\treturn false;\n\t\t\t\tvar blockStatement = ifElseStatement.FalseStatement as BlockStatement;\n\t\t\t\tif (blockStatement != null && blockStatement.Statements.Count == 0)\n\t\t\t\t\treturn true;\n\t\t\t\tvar reachability = ctx.CreateReachabilityAnalysis(ifElseStatement.TrueStatement);\n\t\t\t\treturn !reachability.IsEndpointReachable(ifElseStatement.TrueStatement);\n\t\t\t}\n\n\t\t\tbool HasConflictingNames(AstNode targetContext, AstNode currentContext)\n\t\t\t{\n\t\t\t\tvar targetSpace = declarationSpaceVisitor.GetDeclarationSpace(targetContext);\n\t\t\t\tvar currentSpace = declarationSpaceVisitor.GetDeclarationSpace(currentContext);\n\t\t\t\tforeach (var name in currentSpace.DeclaredNames) {\n\t\t\t\t\tvar isUsed = targetSpace.GetNameDeclarations(name).Any(node => node.Ancestors.Any(n => n == currentContext));\n\t\t\t\t\tif (isUsed)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpublic override void VisitIfElseStatement (IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\n\t\t\t\tif (!ElseIsRedundantControlFlow(ifElseStatement) || HasConflictingNames(ifElseStatement.Parent, ifElseStatement.FalseStatement))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(ifElseStatement.ElseToken, ctx.TranslateString(\"Redundant 'else' keyword\"), ctx.TranslateString(\"Remove redundant 'else'\"), script =>  {\n\t\t\t\t\tint start = script.GetCurrentOffset(ifElseStatement.ElseToken.GetPrevNode(n => !(n is NewLineNode)).EndLocation);\n\t\t\t\t\tint end;\n\t\t\t\t\tvar blockStatement = ifElseStatement.FalseStatement as BlockStatement;\n\t\t\t\t\tif (blockStatement != null) {\n\t\t\t\t\t\tif (blockStatement.Statements.Count == 0) {\n\t\t\t\t\t\t\t// remove empty block\n\t\t\t\t\t\t\tend = script.GetCurrentOffset(blockStatement.LBraceToken.StartLocation);\n\t\t\t\t\t\t\tscript.Remove(blockStatement);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// remove block braces\n\t\t\t\t\t\t\tend = script.GetCurrentOffset(blockStatement.LBraceToken.EndLocation);\n\t\t\t\t\t\t\tscript.Remove(blockStatement.RBraceToken);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tend = script.GetCurrentOffset(ifElseStatement.ElseToken.EndLocation);\n\t\t\t\t\t}\n\t\t\t\t\tif (end > start)\n\t\t\t\t\t\tscript.RemoveText(start, end - start);\n\t\t\t\t\tscript.FormatText(ifElseStatement.Parent);\n\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantLambdaParameterTypeIssue.cs",
    "content": "﻿// \n// RedundantLambdaParameterTypeIssue.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n//\n// Copyright (c) 2013  Ji Kun <jikun.nus@gmail.com>\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant lambda explicit type specification\",\n\t                  Description= \"Explicit type specification can be removed as it can be implicitly inferred\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantLambdaParameterType\")]\n\tpublic class RedundantLambdaParameterTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantLambdaParameterTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\n\t\t\t\tvar arguments = lambdaExpression.Parameters.ToList();\n\t\t\t\tif (arguments.Any(f => f.Type.IsNull))\n\t\t\t\t\treturn;\n\t\t\t\tif (!LambdaTypeCanBeInferred(ctx, lambdaExpression, arguments))\n\t\t\t\t\treturn;\n\n\t\t\t\tforeach (var argument in arguments) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\targument.Type,\n\t\t\t\t\t\tctx.TranslateString(\"Redundant lambda explicit type specification\"), \n\t\t\t\t\t\tctx.TranslateString(\"Remove parameter type specification\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tif (arguments.Count == 1) {\n\t\t\t\t\t\t\t\tif (argument.NextSibling.ToString().Equals(\")\") && argument.PrevSibling.ToString().Equals(\"(\")) {\n\t\t\t\t\t\t\t\t\tscript.Remove(argument.NextSibling);\n\t\t\t\t\t\t\t\t\tscript.Remove(argument.PrevSibling);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach (var arg in arguments)\n\t\t\t\t\t\t\t\tscript.Replace(arg, new ParameterDeclaration(arg.Name));\n\t\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool LambdaTypeCanBeInferred(BaseRefactoringContext ctx, Expression expression, List<ParameterDeclaration> parameters)\n\t\t{\n\t\t\tvar validTypes = TypeGuessing.GetValidTypes(ctx.Resolver, expression).ToList();\n\t\t\tforeach (var type in validTypes) {\n\t\t\t\tif (type.Kind != TypeKind.Delegate)\n\t\t\t\t\tcontinue;\n\t\t\t\tvar invokeMethod = type.GetDelegateInvokeMethod();\n\t\t\t\tif (invokeMethod == null || invokeMethod.Parameters.Count != parameters.Count)\n\t\t\t\t\tcontinue;\n\t\t\t\tfor (int p = 0; p < invokeMethod.Parameters.Count; p++) {\n\t\t\t\t\tvar resolvedArgument = ctx.Resolve(parameters[p].Type);\n\t\t\t\t\tif (!invokeMethod.Parameters [p].Type.Equals(resolvedArgument.Type))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantLambdaSignatureParenthesesIssue.cs",
    "content": "//\n// RedundantLambdaSignatureParenthesesIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant lambda signature parentheses\",\n\t                  Description= \"Redundant lambda signature parentheses\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantLambdaSignatureParentheses\")]\n\tpublic class RedundantLambdaSignatureParenthesesIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantLambdaSignatureParenthesesIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\t\tvar p = lambdaExpression.Parameters.FirstOrDefault();\n\t\t\t\tif (p == null || !p.Type.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tvar lParToken = lambdaExpression.LParToken;\n\t\t\t\tif (lParToken.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tif (p.GetNextSibling(n => n.Role == Roles.Parameter) != null)\n\t\t\t\t\treturn;\n\t\t\t\tAction<Script> action = script =>  {\n\t\t\t\t\tscript.Remove(lParToken);\n\t\t\t\t\tscript.Remove(lambdaExpression.RParToken);\n\t\t\t\t\tscript.FormatText(lambdaExpression);\n\t\t\t\t};\n\n\t\t\t\tvar issueText = ctx.TranslateString(\"Redundant lambda signature parentheses\");\n\t\t\t\tvar fixText = ctx.TranslateString(\"Remove signature parentheses\");\n\t\t\t\tAddIssue(new CodeIssue(lambdaExpression.LParToken, issueText, fixText, action) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\tAddIssue(new CodeIssue(lambdaExpression.RParToken, issueText, fixText, action) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantLogicalConditionalExpressionOperandIssue.cs",
    "content": "//\n// RedundantLogicalConditionalExpressionOperandIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant operand in logical conditional expression\",\n\t                  Description= \"Redundant operand in logical conditional expression\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantLogicalConditionalExpressionOperand\")]\n\tpublic class RedundantLogicalConditionalExpressionOperandIssue: GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantLogicalConditionalExpressionOperandIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic readonly AstNode pattern = new Choice {\n\t\t\t\tPatternHelper.CommutativeOperator(new NamedNode (\"redundant\", PatternHelper.OptionalParentheses(new PrimitiveExpression(true))), BinaryOperatorType.ConditionalOr, new AnyNode(\"expr\")),\t\n\t\t\t\tPatternHelper.CommutativeOperator(new NamedNode (\"redundant\", PatternHelper.OptionalParentheses(new PrimitiveExpression(false))), BinaryOperatorType.ConditionalAnd, new AnyNode(\"expr\"))\n\t\t\t};\n\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\t\t\t\tvar match = pattern.Match(binaryOperatorExpression);\n\t\t\t\tif (!match.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar redundant = match.Get<Expression>(\"redundant\").Single();\n\t\t\t\tvar expr = match.Get<Expression>(\"expr\").Single();\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tredundant,\n\t\t\t\t\tctx.TranslateString(\"Redundant operand in logical conditional expression\"),\n\t\t\t\t\tctx.TranslateString(\"Remove expression\"),\n\t\t\t\t\tscript => script.Replace(binaryOperatorExpression, expr.Clone())\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantNameQualifierIssue.cs",
    "content": "﻿// \n// RedundantNamespaceUsageInspector.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Finds redundant namespace usages.\n\t/// </summary>\n\t[IssueDescription(\"Redundant name qualifier\",\n\t                  Description = \"Removes namespace usages that are obsolete.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n                      AnalysisDisableKeyword = \"RedundantNameQualifier\")]\n\tpublic class RedundantNameQualifierIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantNameQualifierIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, RedundantNameQualifierIssue qualifierDirectiveEvidentIssueProvider) : base (ctx, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t\t\tHandleMemberReference(\n\t\t\t\t\tmemberReferenceExpression, memberReferenceExpression.Target, memberReferenceExpression.MemberNameToken, memberReferenceExpression.TypeArguments, NameLookupMode.Expression,\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.Replace(memberReferenceExpression, RefactoringAstHelper.RemoveTarget(memberReferenceExpression));\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitMemberType(MemberType memberType)\n\t\t\t{\n\t\t\t\tbase.VisitMemberType(memberType);\n\t\t\t\tHandleMemberReference(\n\t\t\t\t\tmemberType, memberType.Target, memberType.MemberNameToken, memberType.TypeArguments, memberType.GetNameLookupMode(),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tscript.Replace(memberType, RefactoringAstHelper.RemoveTarget(memberType));\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tvoid HandleMemberReference(AstNode wholeNode, AstNode targetNode, Identifier memberName, IEnumerable<AstType> typeArguments, NameLookupMode mode, Action<Script> action)\n\t\t\t{\n\t\t\t\tvar result = ctx.Resolve(targetNode);\n\t\t\t\tif (!(result is NamespaceResolveResult)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar wholeResult = ctx.Resolve(wholeNode);\n\t\t\t\tif (!(wholeResult is TypeResolveResult)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar state = ctx.GetResolverStateBefore(wholeNode);\n\t\t\t\tvar resolvedTypeArguments = typeArguments.Select(ctx.ResolveType).ToList();\n\t\t\t\tvar lookupName = state.LookupSimpleNameOrTypeName(memberName.Name, resolvedTypeArguments, mode);\n\t\t\t\t\n\t\t\t\tif (lookupName is TypeResolveResult && !lookupName.IsError && wholeResult.Type.Equals(lookupName.Type)) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\twholeNode.StartLocation, \n\t\t\t\t\t\tmemberName.StartLocation, \n\t\t\t\t\t\tctx.TranslateString(\"Qualifier is redundant\"), \n\t\t\t\t\t\tctx.TranslateString(\"Remove redundant qualifier\"), \n\t\t\t\t\t\taction) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantObjectOrCollectionInitializerIssue.cs",
    "content": "﻿// \n// RedundantObjectOrCollectionInitializerIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant empty object or collection initializer\",\n\t\tDescription = \"Redundant empty object or collection initializer.\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantEmptyObjectOrCollectionInitializer\")]\n\tpublic class RedundantObjectOrCollectionInitializerIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantObjectOrCollectionInitializerIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitObjectCreateExpression(objectCreateExpression);\n\t\t\t\tif (objectCreateExpression.Initializer.IsNull || objectCreateExpression.Initializer.Elements.Count > 0)\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(objectCreateExpression.Initializer, ctx.TranslateString(\"Empty object or collection initializer is redundant\"), ctx.TranslateString(\"Remove initializer\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar expr = (ObjectCreateExpression)objectCreateExpression.Clone();\n\t\t\t\t\t\texpr.Initializer = ArrayInitializerExpression.Null;\n\t\t\t\t\t\tscript.Replace(objectCreateExpression, expr);\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantStringToCharArrayCallIssue.cs",
    "content": "//\n// RedundantStringToCharArrayCallIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant 'string.ToCharArray()' call\",\n\t\tDescription = \"Redundant 'string.ToCharArray()' call\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantStringToCharArrayCall\")]\n\tpublic class RedundantStringToCharArrayCallIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantStringToCharArrayCallIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid AddProblem(AstNode replaceExpression, InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tvar t = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tAddIssue(new CodeIssue (\n\t\t\t\t\tt.DotToken.StartLocation,\n\t\t\t\t\tt.MemberNameToken.EndLocation,\n\t\t\t\t\tctx.TranslateString(\"Redundant 'string.ToCharArray()' call\"),\n\t\t\t\t\tctx.TranslateString(\"Remove redundant 'string.ToCharArray()' call\"),\n\t\t\t\t\ts => s.Replace(replaceExpression, t.Target.Clone())\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tvar t = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (t == null || t.MemberName != \"ToCharArray\")\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(t.Target);\n\t\t\t\tif (!rr.Type.IsKnownType(KnownTypeCode.String))\n\t\t\t\t\treturn;\n\t\t\t\tif (invocationExpression.Parent is ForeachStatement && invocationExpression.Role == Roles.Expression) {\n\t\t\t\t\tAddProblem(invocationExpression, invocationExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar p = invocationExpression.Parent;\n\t\t\t\twhile (p is ParenthesizedExpression) {\n\t\t\t\t\tp = p.Parent;\n\t\t\t\t}\n\t\t\t\tvar idx = p as IndexerExpression;\n\t\t\t\tif (idx != null) {\n\t\t\t\t\tAddProblem(idx.Target, invocationExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantTernaryExpressionIssue.cs",
    "content": "//\n// RedundantTernaryExpressionIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant conditional expression\",\n\t                  Description = \"Redundant conditional expression\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantTernaryExpression\")]\n\tpublic class RedundantTernaryExpressionIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantTernaryExpressionIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\treadonly AstNode pattern = new ConditionalExpression(\n\t\t\t\tnew AnyNode (), \n\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(true)),\n\t\t\t\tPatternHelper.OptionalParentheses(new PrimitiveExpression(false))\n\t\t\t);\n\n\t\t\tpublic override void VisitConditionalExpression(ConditionalExpression conditionalExpression)\n\t\t\t{\n\t\t\t\tbase.VisitConditionalExpression(conditionalExpression);\n\t\t\t\tif (pattern.IsMatch(conditionalExpression)) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tconditionalExpression.QuestionMarkToken.StartLocation,\n\t\t\t\t\t\tconditionalExpression.FalseExpression.EndLocation,\n\t\t\t\t\t\tctx.TranslateString(\"Redundant conditional expression\"),\n\t\t\t\t\t\tctx.TranslateString(\"Replace by condition\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\t\tscript.Replace(conditionalExpression, conditionalExpression.Condition.Clone());\n\t\t\t\t\t\t}\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantThisQualifierIssue.cs",
    "content": "// \n// RedundantThisInspector.cs\n// \n// RedundantThisInspector.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Utils;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Finds redundant this usages.\n\t/// </summary>\n\t[IssueDescription(\"Redundant 'this.' qualifier\",\n\t                  Description= \"'this.' is redundant and can be removed safely.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantThisQualifier\")]\n\t[SubIssueAttribute(RedundantThisQualifierIssue.InsideConstructors)]\n\t[SubIssueAttribute(RedundantThisQualifierIssue.EverywhereElse)]\n\tpublic class RedundantThisQualifierIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tpublic const string InsideConstructors = \"Inside constructors\";\n\t\tpublic const string EverywhereElse = \"Everywhere else\";\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar declarationSpaceVisitor = new LocalDeclarationSpaceVisitor();\n\t\t\tcontext.RootNode.AcceptVisitor(declarationSpaceVisitor);\n\n\t\t\treturn new GatherVisitor(declarationSpaceVisitor, context, this);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantThisQualifierIssue>\n\t\t{\n\t\t\tbool InsideConstructors {\n\t\t\t\tget {\n\t\t\t\t\treturn SubIssue == RedundantThisQualifierIssue.InsideConstructors;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tLocalDeclarationSpaceVisitor declarationsSpaceVisitor;\n\n\t\t\tpublic GatherVisitor (LocalDeclarationSpaceVisitor visitor, BaseRefactoringContext ctx, RedundantThisQualifierIssue qualifierDirectiveEvidentIssueProvider) : base (ctx, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t\tdeclarationsSpaceVisitor = visitor;\n\t\t\t}\n\n\t\t\tstatic IMember GetMember (ResolveResult result)\n\t\t\t{\n\t\t\t\tif (result is MemberResolveResult) {\n\t\t\t\t\treturn ((MemberResolveResult)result).Member;\n\t\t\t\t}\n\t\t\t\tif (result is MethodGroupResolveResult) {\n\t\t\t\t\treturn ((MethodGroupResolveResult)result).Methods.FirstOrDefault();\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override void VisitSyntaxTree(SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tbase.VisitSyntaxTree(syntaxTree);\n\t\t\t\tAnalyzeAllThisReferences();\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tif (InsideConstructors)\n\t\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!InsideConstructors)\n\t\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tif (!InsideConstructors)\n\t\t\t\t\tbase.VisitIndexerDeclaration(indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tif (!InsideConstructors)\n\t\t\t\t\tbase.VisitCustomEventDeclaration(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tif (!InsideConstructors)\n\t\t\t\t\tbase.VisitDestructorDeclaration(destructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tif (!InsideConstructors)\n\t\t\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tif (!InsideConstructors)\n\t\t\t\t\tbase.VisitOperatorDeclaration(operatorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tif (!InsideConstructors)\n\t\t\t\t\tbase.VisitPropertyDeclaration(propertyDeclaration);\n\t\t\t}\n\n\t\t\tIList<ThisReferenceExpression> thisReferences = new List<ThisReferenceExpression> ();\n\n\t\t\tpublic override void VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression)\n\t\t\t{\n\t\t\t\tbase.VisitThisReferenceExpression(thisReferenceExpression);\n\t\t\t\tif (!IsSuppressed(thisReferenceExpression.Location))\n\t\t\t\t\tthisReferences.Add(thisReferenceExpression);\n\t\t\t}\n\n\t\t\tvoid AnalyzeAllThisReferences ()\n\t\t\t{\n\t\t\t\tforeach (var thisReference in thisReferences) {\n\t\t\t\t\tAnalyzeThisReferenceExpression(thisReference);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AnalyzeThisReferenceExpression (ThisReferenceExpression thisReferenceExpression)\n\t\t\t{\n\t\t\t\tvar memberReference = thisReferenceExpression.Parent as MemberReferenceExpression;\n\t\t\t\tif (memberReference == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar state = ctx.GetResolverStateAfter(thisReferenceExpression);\n\t\t\t\tvar wholeResult = ctx.Resolve(memberReference);\n\t\t\t\n\t\t\t\tIMember member = GetMember(wholeResult);\n\t\t\t\tif (member == null) { \n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar localDeclarationSpace = declarationsSpaceVisitor.GetDeclarationSpace(thisReferenceExpression);\n\t\t\t\tif (localDeclarationSpace == null || localDeclarationSpace.IsNameUsed(member.Name))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar result = state.LookupSimpleNameOrTypeName(memberReference.MemberName, EmptyList<IType>.Instance, NameLookupMode.Expression);\n\t\t\t\tvar parentResult = ctx.Resolve(memberReference.Parent) as CSharpInvocationResolveResult;\n\t\t\t\t\n\t\t\t\tbool isRedundant;\n\t\t\t\tif (result is MemberResolveResult) {\n\t\t\t\t\tisRedundant = ((MemberResolveResult)result).Member.Region.Equals(member.Region);\n\t\t\t\t} else if (parentResult != null && parentResult.IsExtensionMethodInvocation) {\n\t\t\t\t\t// 'this.' is required for extension method invocation\n\t\t\t\t\tisRedundant = false;\n\t\t\t\t} else if (result is MethodGroupResolveResult) {\n\t\t\t\t\tisRedundant = ((MethodGroupResolveResult)result).Methods.Any(m => m.Region.Equals(member.Region));\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isRedundant) {\n\t\t\t\t\tvar issueDescription = ctx.TranslateString(\"'this.' is redundant and can be removed safely.\");\n\t\t\t\t\tvar actionDescription = ctx.TranslateString(\"Remove 'this.'\");\n\t\t\t\t\tAddIssue(new CodeIssue(thisReferenceExpression.StartLocation, memberReference.MemberNameToken.StartLocation, issueDescription, actionDescription, script => {\n\t\t\t\t\t\tscript.Replace(memberReference, RefactoringAstHelper.RemoveTarget(memberReference));\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantToStringCallForValueTypesIssue.cs",
    "content": "//\n// RedundantToStringCallForValueTypesIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant 'object.ToString()' call for value types\",\n\t\tDescription = \"Finds value type calls to ToString() which would be generated automatically by the compiler.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Hint)]\n\tpublic class RedundantToStringCallForValueTypesIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantToStringCallForValueTypesIssue>\n\t\t{\n\t\t\tstatic Tuple<int, int> onlyFirst = Tuple.Create (0, 0);\n\n\t\t\tstatic IDictionary<Tuple<string, int>, Tuple<int, int>> membersCallingToString = new Dictionary<Tuple<string, int>, Tuple<int, int>> {\n\t\t\t\t{ Tuple.Create(\"System.IO.TextWriter.Write\", 1), onlyFirst },\n\t\t\t\t{ Tuple.Create(\"System.IO.TextWriter.WriteLine\", 1), onlyFirst },\n\t\t\t\t{ Tuple.Create(\"System.Console.Write\", 1), onlyFirst },\n\t\t\t\t{ Tuple.Create(\"System.Console.WriteLine\", 1), onlyFirst }\n\t\t\t};\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t\tbinOpVisitor = new BinaryExpressionVisitor (this);\n\t\t\t}\n\n\t\t\tHashSet<AstNode> processedNodes = new HashSet<AstNode>();\n\n\t\t\tvoid CheckExpressionInAutoCallContext(Expression expression)\n\t\t\t{\n\t\t\t\tif (expression is InvocationExpression && !processedNodes.Contains(expression)) {\n\t\t\t\t\tCheckInvocationInAutoCallContext((InvocationExpression)expression);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CheckInvocationInAutoCallContext(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tvar memberExpression = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (memberExpression == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (memberExpression.MemberName != \"ToString\" || invocationExpression.Arguments.Any ()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar resolveResult = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (ctx.Resolve(memberExpression.Target).Type.Kind == TypeKind.Struct) \n\t\t\t\t\tAddRedundantToStringIssue(memberExpression, invocationExpression);\n\t\t\t}\n\n\t\t\tvoid AddRedundantToStringIssue(MemberReferenceExpression memberExpression, InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\t// Simon Lindgren 2012-09-14: Previously there was a check here to see if the node had already been processed\n\t\t\t\t// This has been moved out to the callers, to check it earlier for a 30-40% run time reduction\n\t\t\t\tprocessedNodes.Add(invocationExpression);\n\n\t\t\t\tAddIssue(new CodeIssue(memberExpression.DotToken.StartLocation, invocationExpression.RParToken.EndLocation,\n\t\t\t\t         ctx.TranslateString(\"Redundant ToString() call\"), \n\t\t\t\t         ctx.TranslateString(\"Remove redundant '.ToString()'\"), script =>  {\n\t\t\t\t\tscript.Replace(invocationExpression, memberExpression.Target.Clone());\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\t#region Binary operator\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\n\t\t\t\tif (binaryOperatorExpression.Operator != BinaryOperatorType.Add)\n\t\t\t\t\treturn;\n\t\t\t\tbinOpVisitor.Reset();\n\t\t\t\tbinaryOperatorExpression.AcceptVisitor(binOpVisitor);\n\t\t\t}\n\n\t\t\tBinaryExpressionVisitor binOpVisitor;\n\t\t\tclass BinaryExpressionVisitor : DepthFirstAstVisitor\n\t\t\t{\n\t\t\t\tGatherVisitor issue;\n\t\t\t\tint stringExpressionCount;\n\t\t\t\tExpression firstStringExpression;\n\n\t\t\t\tpublic BinaryExpressionVisitor(GatherVisitor issue)\n\t\t\t\t{\n\t\t\t\t\tthis.issue = issue;\n\t\t\t\t}\n\n\t\t\t\tpublic void Reset()\n\t\t\t\t{\n\t\t\t\t\tstringExpressionCount = 0;\n\t\t\t\t\tfirstStringExpression = null;\n\t\t\t\t}\n\n\t\t\t\tvoid Check (Expression expression)\n\t\t\t\t{\n\t\t\t\t\tif (expression is BinaryOperatorExpression) {\n\t\t\t\t\t\texpression.AcceptVisitor(this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (stringExpressionCount <= 1) {\n\t\t\t\t\t\tvar resolveResult = issue.ctx.Resolve(expression);\n\t\t\t\t\t\tif (resolveResult.Type.IsKnownType(KnownTypeCode.String)) {\n\t\t\t\t\t\t\tstringExpressionCount++;\n\t\t\t\t\t\t\tif (stringExpressionCount == 1) {\n\t\t\t\t\t\t\t\tfirstStringExpression = expression;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tissue.CheckExpressionInAutoCallContext(firstStringExpression);\n\t\t\t\t\t\t\t\tissue.CheckExpressionInAutoCallContext(expression);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tissue.CheckExpressionInAutoCallContext(expression);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t\t{\n\t\t\t\t\tCheck(binaryOperatorExpression.Left);\n\t\t\t\t\tCheck(binaryOperatorExpression.Right);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Invocation expression\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\t//var target = invocationExpression.Target as MemberReferenceExpression;\n\n\t\t\t\tvar invocationResolveResult = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (invocationResolveResult == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tIMember member = invocationResolveResult.Member;\n\n\t\t\t\t// Check list of members that call ToString() automatically\n\t\t\t\tCheckAutomaticToStringCallers(invocationExpression, member);\n\n\t\t\t\t// Check formatting calls\n\t\t\t\tCheckFormattingCall(invocationExpression, invocationResolveResult);\n\t\t\t}\n\n\t\t\tvoid CheckAutomaticToStringCallers(InvocationExpression invocationExpression, IMember member)\n\t\t\t{\n\t\t\t\tif (member.IsOverride) {\n\t\t\t\t\tmember = InheritanceHelper.GetBaseMember(member);\n\t\t\t\t\tif (member == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar key = new Tuple<string, int>(member.ReflectionName, invocationExpression.Arguments.Count);\n\t\t\t\tTuple<int, int> checkInfo;\n\t\t\t\tif (membersCallingToString.TryGetValue(key, out checkInfo)) {\n\t\t\t\t\tvar arguments = invocationExpression.Arguments.ToList();\n\t\t\t\t\tfor (int i = checkInfo.Item1; i < Math.Min(invocationExpression.Arguments.Count, checkInfo.Item2 + 1); ++i) {\n\t\t\t\t\t\tCheckExpressionInAutoCallContext(arguments[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CheckFormattingCall(InvocationExpression invocationExpression, CSharpInvocationResolveResult invocationResolveResult)\n\t\t\t{\n\t\t\t\tExpression formatArgument;\n\t\t\t\tIList<Expression> formatArguments;\n\t\t\t\t// Only check parameters that are of type object: String means it is neccessary, others\n\t\t\t\t// means that there is another problem (ie no matching overload of the method).\n\t\t\t\tFunc<IParameter, Expression, bool> predicate = (parameter, argument) => {\n\t\t\t\t\tvar type = parameter.Type;\n\t\t\t\t\tif (type is TypeWithElementType && parameter.IsParams) {\n\t\t\t\t\t\ttype = ((TypeWithElementType)type).ElementType;\n\t\t\t\t\t}\n\t\t\t\t\tvar typeDefinition = type.GetDefinition();\n\t\t\t\t\tif (typeDefinition == null)\n\t\t\t\t\treturn false;\n\t\t\t\t\treturn typeDefinition.IsKnownType(KnownTypeCode.Object);\n\t\t\t\t};\n\t\t\t\tif (FormatStringHelper.TryGetFormattingParameters(invocationResolveResult, invocationExpression,\n\t\t\t\t                                                  out formatArgument, out formatArguments, predicate)) {\n\t\t\t\t\tforeach (var argument in formatArguments) {\n\t\t\t\t\t\tCheckExpressionInAutoCallContext(argument);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantToStringCallIssue.cs",
    "content": "//\n// RedundantToStringCallIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant 'object.ToString()' call\",\n\t                  Description = \"Finds calls to ToString() which would be generated automatically by the compiler.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantToStringCall\")]\n\tpublic class RedundantToStringCallIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantToStringCallIssue>\n\t\t{\n\t\t\tstatic Tuple<int, int> onlyFirst = Tuple.Create (0, 0);\n\n\t\t\tstatic IDictionary<Tuple<string, int>, Tuple<int, int>> membersCallingToString = new Dictionary<Tuple<string, int>, Tuple<int, int>> {\n\t\t\t\t{ Tuple.Create(\"System.IO.TextWriter.Write\", 1), onlyFirst },\n\t\t\t\t{ Tuple.Create(\"System.IO.TextWriter.WriteLine\", 1), onlyFirst },\n\t\t\t\t{ Tuple.Create(\"System.Console.Write\", 1), onlyFirst },\n\t\t\t\t{ Tuple.Create(\"System.Console.WriteLine\", 1), onlyFirst }\n\t\t\t};\n\t\t\t\t\t\t\n\t\t\tpublic GatherVisitor (BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t\tbinOpVisitor = new BinaryExpressionVisitor (this);\n\t\t\t}\n\t\t\t\n\t\t\tHashSet<AstNode> processedNodes = new HashSet<AstNode>();\n\n\t\t\tvoid CheckExpressionInAutoCallContext(Expression expression)\n\t\t\t{\n\t\t\t\tif (expression is InvocationExpression && !processedNodes.Contains(expression)) {\n\t\t\t\t\tCheckInvocationInAutoCallContext((InvocationExpression)expression);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CheckInvocationInAutoCallContext(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tvar memberExpression = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (memberExpression == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (memberExpression.MemberName != \"ToString\" || invocationExpression.Arguments.Any ()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar resolveResult = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (resolveResult == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (ctx.Resolve(memberExpression.Target).Type.Kind != TypeKind.Struct) \n\t\t\t\t\tAddRedundantToStringIssue(memberExpression, invocationExpression);\n\t\t\t}\n\t\t\t\n\t\t\tvoid AddRedundantToStringIssue(MemberReferenceExpression memberExpression, InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\t// Simon Lindgren 2012-09-14: Previously there was a check here to see if the node had already been processed\n\t\t\t\t// This has been moved out to the callers, to check it earlier for a 30-40% run time reduction\n\t\t\t\tprocessedNodes.Add(invocationExpression);\n\t\t\t\t\n\t\t\t\tAddIssue(new CodeIssue(memberExpression.DotToken.StartLocation, invocationExpression.RParToken.EndLocation,\n\t\t\t\t         ctx.TranslateString(\"Redundant ToString() call\"), \n\t\t\t\t         ctx.TranslateString(\"Remove redundant '.ToString()'\"), script =>  {\n\t\t\t\t\tscript.Replace(invocationExpression, memberExpression.Target.Clone());\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\t#region Binary operator\n\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitBinaryOperatorExpression(binaryOperatorExpression);\n\n\t\t\t\tif (binaryOperatorExpression.Operator != BinaryOperatorType.Add)\n\t\t\t\t\treturn;\n\t\t\t\tbinOpVisitor.Reset();\n\t\t\t\tbinaryOperatorExpression.AcceptVisitor(binOpVisitor);\n\t\t\t}\n\n\t\t\tBinaryExpressionVisitor binOpVisitor;\n\t\t\tclass BinaryExpressionVisitor : DepthFirstAstVisitor\n\t\t\t{\n\t\t\t\tGatherVisitor issue;\n\t\t\t\tint stringExpressionCount;\n\t\t\t\tExpression firstStringExpression;\n\n\t\t\t\tpublic BinaryExpressionVisitor(GatherVisitor issue)\n\t\t\t\t{\n\t\t\t\t\tthis.issue = issue;\n\t\t\t\t}\n\n\t\t\t\tpublic void Reset()\n\t\t\t\t{\n\t\t\t\t\tstringExpressionCount = 0;\n\t\t\t\t\tfirstStringExpression = null;\n\t\t\t\t}\n\n\t\t\t\tvoid Check (Expression expression)\n\t\t\t\t{\n\t\t\t\t\tif (expression is BinaryOperatorExpression) {\n\t\t\t\t\t\texpression.AcceptVisitor(this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (stringExpressionCount <= 1) {\n\t\t\t\t\t\tvar resolveResult = issue.ctx.Resolve(expression);\n\t\t\t\t\t\tif (resolveResult.Type.IsKnownType(KnownTypeCode.String)) {\n\t\t\t\t\t\t\tstringExpressionCount++;\n\t\t\t\t\t\t\tif (stringExpressionCount == 1) {\n\t\t\t\t\t\t\t\tfirstStringExpression = expression;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tissue.CheckExpressionInAutoCallContext(firstStringExpression);\n\t\t\t\t\t\t\t\tissue.CheckExpressionInAutoCallContext(expression);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tissue.CheckExpressionInAutoCallContext(expression);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic override void VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression)\n\t\t\t\t{\n\t\t\t\t\tCheck(binaryOperatorExpression.Left);\n\t\t\t\t\tCheck(binaryOperatorExpression.Right);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Invocation expression\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\t//var target = invocationExpression.Target as MemberReferenceExpression;\n\n\t\t\t\tvar invocationResolveResult = ctx.Resolve(invocationExpression) as CSharpInvocationResolveResult;\n\t\t\t\tif (invocationResolveResult == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tIMember member = invocationResolveResult.Member;\n\n\t\t\t\t// \"\".ToString()\n                CheckTargetedObject(invocationExpression, invocationResolveResult.TargetResult.Type, member);\n\n\t\t\t\t// Check list of members that call ToString() automatically\n\t\t\t\tCheckAutomaticToStringCallers(invocationExpression, member);\n\n\t\t\t\t// Check formatting calls\n\t\t\t\tCheckFormattingCall(invocationExpression, invocationResolveResult);\n\t\t\t}\n\n\t\t\tvoid CheckTargetedObject(InvocationExpression invocationExpression, IType type, IMember member)\n\t\t\t{\n\t\t\t\tvar memberExpression = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\tif (memberExpression != null && !processedNodes.Contains(invocationExpression)) {\n\t\t\t\t\tif (type.IsKnownType(KnownTypeCode.String) && member.Name == \"ToString\") {\n\t\t\t\t\t\tAddRedundantToStringIssue(memberExpression, invocationExpression);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvoid CheckAutomaticToStringCallers(InvocationExpression invocationExpression, IMember member)\n\t\t\t{\n\t\t\t\tif (member.IsOverride) {\n\t\t\t\t\tmember = InheritanceHelper.GetBaseMember(member);\n\t\t\t\t\tif (member == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar key = new Tuple<string, int>(member.ReflectionName, invocationExpression.Arguments.Count);\n\t\t\t\tTuple<int, int> checkInfo;\n\t\t\t\tif (membersCallingToString.TryGetValue(key, out checkInfo)) {\n\t\t\t\t\tvar arguments = invocationExpression.Arguments.ToList();\n\t\t\t\t\tfor (int i = checkInfo.Item1; i < Math.Min(invocationExpression.Arguments.Count, checkInfo.Item2 + 1); ++i) {\n\t\t\t\t\t\tCheckExpressionInAutoCallContext(arguments[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CheckFormattingCall(InvocationExpression invocationExpression, CSharpInvocationResolveResult invocationResolveResult)\n\t\t\t{\n\t\t\t\tExpression formatArgument;\n\t\t\t\tIList<Expression> formatArguments;\n\t\t\t\t// Only check parameters that are of type object: String means it is neccessary, others\n\t\t\t\t// means that there is another problem (ie no matching overload of the method).\n\t\t\t\tFunc<IParameter, Expression, bool> predicate = (parameter, argument) => {\n\t\t\t\t\tvar type = parameter.Type;\n\t\t\t\t\tif (type is TypeWithElementType && parameter.IsParams) {\n\t\t\t\t\t\ttype = ((TypeWithElementType)type).ElementType;\n\t\t\t\t\t}\n\t\t\t\t\tvar typeDefinition = type.GetDefinition();\n\t\t\t\t\tif (typeDefinition == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn typeDefinition.IsKnownType(KnownTypeCode.Object);\n\t\t\t\t};\n\t\t\t\tif (FormatStringHelper.TryGetFormattingParameters(invocationResolveResult, invocationExpression,\n\t\t\t\t                                                  out formatArgument, out formatArguments, predicate)) {\n\t\t\t\t\tforeach (var argument in formatArguments) {\n\t\t\t\t\t\tCheckExpressionInAutoCallContext(argument);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantUnsafeContextIssue.cs",
    "content": "//\n// RedundantUnsafeContextIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Redundant 'unsafe' modifier\",\n\t\tDescription = \"Unsafe modifier in redundant in unsafe context or when no unsafe constructs are used.\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RedundantUnsafeContext\")]\n\tpublic class RedundantUnsafeContextIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantUnsafeContextIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tclass UnsafeState \n\t\t\t{\n\t\t\t\tpublic bool InUnsafeContext;\n\t\t\t\tpublic bool UseUnsafeConstructs;\n\n\t\t\t\tpublic UnsafeState(bool inUnsafeContext)\n\t\t\t\t{\n\t\t\t\t\tthis.InUnsafeContext = inUnsafeContext;\n\t\t\t\t\tthis.UseUnsafeConstructs = false;\n\t\t\t\t}\n\n\t\t\t\tpublic override string ToString()\n\t\t\t\t{\n\t\t\t\t\treturn string.Format(\"[UnsafeState: InUnsafeContext={0}, UseUnsafeConstructs={1}]\", InUnsafeContext, UseUnsafeConstructs);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treadonly Stack<UnsafeState> unsafeStateStack = new Stack<UnsafeState> ();\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tbool unsafeIsRedundant = false;\n\t\t\t\tif (unsafeStateStack.Count > 0) {\n\t\t\t\t\tvar curState = unsafeStateStack.Peek();\n\n\t\t\t\t\tunsafeIsRedundant |= typeDeclaration.HasModifier(Modifiers.Unsafe);\n\n\t\t\t\t\tunsafeStateStack.Push(new UnsafeState (curState.InUnsafeContext)); \n\t\t\t\t} else {\n\t\t\t\t\tunsafeStateStack.Push(new UnsafeState (typeDeclaration.HasModifier(Modifiers.Unsafe))); \n\t\t\t\t}\n\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\n\t\t\t\tvar state = unsafeStateStack.Pop();\n\t\t\t\tunsafeIsRedundant = typeDeclaration.HasModifier(Modifiers.Unsafe) && !state.UseUnsafeConstructs;\n\t\t\t\tif (unsafeIsRedundant) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\ttypeDeclaration.ModifierTokens.First (t => t.Modifier == Modifiers.Unsafe),\n\t\t\t\t\t\tctx.TranslateString(\"'unsafe' modifier is redundant.\"), \n\t\t\t\t\t\tctx.TranslateString(\"Remove redundant 'unsafe' modifier\"), \n\t\t\t\t\t\tscript => script.ChangeModifier(typeDeclaration, typeDeclaration.Modifiers & ~Modifiers.Unsafe)\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitFixedFieldDeclaration(fixedFieldDeclaration);\n\t\t\t\tunsafeStateStack.Peek().UseUnsafeConstructs = true;\n\t\t\t}\n\n\t\t\tpublic override void VisitComposedType(ComposedType composedType)\n\t\t\t{\n\t\t\t\tbase.VisitComposedType(composedType);\n\t\t\t\tif (composedType.PointerRank > 0)\n\t\t\t\t\tunsafeStateStack.Peek().UseUnsafeConstructs = true;\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedStatement(FixedStatement fixedStatement)\n\t\t\t{\n\t\t\t\tbase.VisitFixedStatement(fixedStatement);\n\n\t\t\t\tunsafeStateStack.Peek().UseUnsafeConstructs = true;\n\t\t\t}\n\n\t\t\tpublic override void VisitSizeOfExpression(SizeOfExpression sizeOfExpression)\n\t\t\t{\n\t\t\t\tbase.VisitSizeOfExpression(sizeOfExpression);\n\t\t\t\tunsafeStateStack.Peek().UseUnsafeConstructs = true;\n\t\t\t}\n\n\t\t\tpublic override void VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression)\n\t\t\t{\n\t\t\t\tbase.VisitUnaryOperatorExpression(unaryOperatorExpression);\n\t\t\t\tif (unaryOperatorExpression.Operator == UnaryOperatorType.AddressOf ||\n\t\t\t\t    unaryOperatorExpression.Operator == UnaryOperatorType.Dereference)\n\t\t\t\t\tunsafeStateStack.Peek().UseUnsafeConstructs = true;\n\t\t\t}\n\t\t\n\t\t\tpublic override void VisitUnsafeStatement(UnsafeStatement unsafeStatement)\n\t\t\t{\n\t\t\t\tunsafeStateStack.Peek().UseUnsafeConstructs = true;\n\t\t\t\tbool isRedundant = unsafeStateStack.Peek().InUnsafeContext;\n\t\t\t\tunsafeStateStack.Push(new UnsafeState (true)); \n\t\t\t\tbase.VisitUnsafeStatement(unsafeStatement);\n\t\t\t\tisRedundant |= !unsafeStateStack.Pop().UseUnsafeConstructs;\n\n\t\t\t\tif (isRedundant) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tunsafeStatement.UnsafeToken,\n\t\t\t\t\t\tctx.TranslateString(\"'unsafe' statement is redundant.\"), \n\t\t\t\t\t\tctx.TranslateString(\"Replace 'unsafe' statement with it's body\"), \n\t\t\t\t\t\ts => {\n\t\t\t\t\t\t\ts.Remove(unsafeStatement.UnsafeToken);\n\t\t\t\t\t\t\ts.Remove(unsafeStatement.Body.LBraceToken);\n\t\t\t\t\t\t\ts.Remove(unsafeStatement.Body.RBraceToken);\n\t\t\t\t\t\t\ts.FormatText(unsafeStatement.Parent);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantUsingDirectiveIssue.cs",
    "content": "﻿// \n// RedundantUsingInspector.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// Finds redundant using declarations.\n\t/// </summary>\n\t[IssueDescription(\"Redundant using directive\",\n\t                  Description = \"Using directive is not required and can safely be removed.\",\n\t                  Category = IssueCategories.RedundanciesInCode,\n\t                  Severity = Severity.Hint,\n\t                  AnalysisDisableKeyword = \"RedundantUsingDirective\"\n\t                  )]\n\tpublic class RedundantUsingDirectiveIssue : CodeIssueProvider\n\t{\n\t\tList<string> namespacesToKeep = new List<string>();\n\n\t\t/// <summary>\n\t\t/// The list of namespaces that should be kept even if they are not being used.\n\t\t/// Used in SharpDevelop to always keep the \"System\" namespace around.\n\t\t/// </summary>\n\t\tpublic IList<string> NamespacesToKeep {\n\t\t\tget { return namespacesToKeep; }\n\t\t}\n\n\n\t\tpublic override IEnumerable<CodeIssue> GetIssues(BaseRefactoringContext context, string subIssue)\n\t\t{\n\t\t\tvar visitor = new GatherVisitor(context, this);\n\t\t\tcontext.RootNode.AcceptVisitor (visitor);\n\t\t\tvisitor.Collect (0);\n\t\t\treturn visitor.FoundIssues;\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantUsingDirectiveIssue>\n\t\t{\n\t\t\tclass UsingDeclarationSpecifier {\n\t\t\t\tpublic UsingDeclaration UsingDeclaration { get; set; }\n\t\t\t\tpublic bool IsUsed { get; set; }\n\n\t\t\t\tpublic UsingDeclarationSpecifier(UsingDeclaration usingDeclaration)\n\t\t\t\t{\n\t\t\t\t\tthis.UsingDeclaration = usingDeclaration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tList<UsingDeclarationSpecifier> declarations = new List<UsingDeclarationSpecifier>();\n\t\t\tHashSet<string> usedNamespaces = new HashSet<string>();\n\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx, RedundantUsingDirectiveIssue qualifierDirectiveEvidentIssueProvider) : base (ctx, qualifierDirectiveEvidentIssueProvider)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic void Collect(int startIndex)\n\t\t\t{\n\t\t\t\tvar unused = new List<UsingDeclaration>();\n\t\t\t\tforeach (var u in declarations.Skip (startIndex)) {\n\t\t\t\t\tif (u.IsUsed || \n\t\t\t\t\t    issueProvider.namespacesToKeep.Contains(u.UsingDeclaration.Namespace))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tunused.Add(u.UsingDeclaration);\n\t\t\t\t}\n\n\t\t\t\tforeach (var decl in unused) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\tdecl,\n\t\t\t\t\t\tctx.TranslateString(\"Using directive is not used by code and can be removed safely.\"), ctx.TranslateString(\"Remove redundant using directives\"),\n\t\t\t\t\t\tscript => {\n\t\t\t\t\t\tforeach (var u2 in unused) {\n\t\t\t\t\t\t\tscript.Remove (u2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t\t{\n\t\t\t\tif (IsSuppressed(usingDeclaration.StartLocation))\n\t\t\t\t\treturn;\n\t\t\t\tdeclarations.Add(new UsingDeclarationSpecifier (usingDeclaration));\n\t\t\t}\n\n\t\t\tpublic override void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t\t{\n\t\t\t\tint idx = declarations.Count;\n\t\t\t\tusedNamespaces.Clear();\n\t\t\t\tbase.VisitNamespaceDeclaration(namespaceDeclaration);\n\t\t\t\tCollect(idx);\n\t\t\t\tdeclarations.RemoveRange(idx, declarations.Count - idx);\n\t\t\t}\n\t\t\t\n\t\t\tvoid UseNamespace(string ns)\n\t\t\t{\n\t\t\t\tif (usedNamespaces.Contains(ns))\n\t\t\t\t\treturn;\n\t\t\t\tusedNamespaces.Add(ns);\n\t\t\t\tfor (int i = declarations.Count - 1; i >= 0; i--) {\n\t\t\t\t\tvar decl = declarations [i];\n\t\t\t\t\tif (decl.UsingDeclaration.Namespace == ns) {\n\t\t\t\t\t\tdecl.IsUsed = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tbase.VisitIdentifierExpression(identifierExpression);\n\t\t\t\tvar trr = ctx.Resolve(identifierExpression) as TypeResolveResult;\n\t\t\t\tif (trr != null) {\n\t\t\t\t\tUseNamespace(trr.Type.Namespace);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitSimpleType(SimpleType simpleType)\n\t\t\t{\n\t\t\t\tbase.VisitSimpleType(simpleType);\n\t\t\t\tUseNamespace(ctx.Resolve(simpleType).Type.Namespace);\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression (InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression (invocationExpression);\n\t\t\t\tUseExtensionMethod(ctx.Resolve(invocationExpression));\n\t\t\t}\n\t\t\t\n\t\t\tvoid UseExtensionMethod(ResolveResult rr)\n\t\t\t{\n\t\t\t\tvar mg = rr as CSharpInvocationResolveResult;\n\t\t\t\tif (mg != null && mg.IsExtensionMethodInvocation) {\n\t\t\t\t\tUseNamespace (mg.Member.DeclaringType.Namespace);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitQueryExpression(QueryExpression queryExpression)\n\t\t\t{\n\t\t\t\tbase.VisitQueryExpression(queryExpression);\n\t\t\t\tforeach (var clause in queryExpression.Clauses) {\n\t\t\t\t\tUseExtensionMethod(ctx.Resolve(clause));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RemoveRedundantOrStatementIssue.cs",
    "content": "//\n// RemoveRedundantOrStatementIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Remove redundant statement\",\n\t\tDescription = \"Remove redundant statement\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"RemoveRedundantOrStatement\")]\n\tpublic class RemoveRedundantOrStatementIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RemoveRedundantOrStatementIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\treadonly AstNode pattern = new ExpressionStatement (\n\t\t\t\tnew Choice {\n\t\t\t\t\tnew AssignmentExpression(new AnyNode(), AssignmentOperatorType.BitwiseOr, new PrimitiveExpression(false)),\n\t\t\t\t\tnew AssignmentExpression(new AnyNode(), AssignmentOperatorType.BitwiseAnd, new PrimitiveExpression(true))\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tpublic override void VisitExpressionStatement(ExpressionStatement expressionStatement)\n\t\t\t{\n\t\t\t\tbase.VisitExpressionStatement(expressionStatement);\n\t\t\t\tif (pattern.IsMatch(expressionStatement)) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\texpressionStatement,\n\t\t\t\t\t\tctx.TranslateString(\"Statement is redundant\"),\n\t\t\t\t\t\tctx.TranslateString(\"Remove redundant statement\"),\n\t\t\t\t\t\ts => s.Remove(expressionStatement)\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/UnusedAnonymousMethodSignatureIssue.cs",
    "content": "// \n// UnusedAnonymousMethodSignatureIssue.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n//      Mike Krüger <mkrueger@xamarn.com>\n//\n// Copyright (c) 2013 Luís Reis\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Anonymous method signature is not required\",\n\t\tDescription = \"Detects when no delegate parameter is used in the anonymous method body.\",\n\t\tCategory = IssueCategories.RedundanciesInCode,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"UnusedAnonymousMethodSignature\")]\n\tpublic class UnusedAnonymousMethodSignatureIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UnusedAnonymousMethodSignatureIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tbool IsParameterListRedundant(Expression expression)\n\t\t\t{\n\t\t\t\tvar validTypes = TypeGuessing.GetValidTypes(ctx.Resolver, expression);\n\t\t\t\treturn validTypes.Count(t => t.Kind == TypeKind.Delegate) == 1;\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\t\tif (!anonymousMethodExpression.HasParameterList || !IsParameterListRedundant(anonymousMethodExpression))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar parameters = anonymousMethodExpression.Parameters.ToList();\n\t\t\t\tif (parameters.Count > 0) {\n\t\t\t\t\tvar usageAnalysis = new ConvertToConstantIssue.VariableUsageAnalyzation(ctx);\n\t\t\t\t\tanonymousMethodExpression.Body.AcceptVisitor(usageAnalysis); \n\t\t\t\t\tforeach (var parameter in parameters) {\n\t\t\t\t\t\tvar rr = ctx.Resolve(parameter) as LocalResolveResult;\n\t\t\t\t\t\tif (rr == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif (usageAnalysis.GetStatus(rr.Variable) != ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod.VariableState.None)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tAddIssue(new CodeIssue(anonymousMethodExpression.LParToken.StartLocation,\n\t\t\t\t\tanonymousMethodExpression.RParToken.EndLocation,\n\t\t\t\t\tctx.TranslateString(\"Specifying signature is redundant because no parameter is used\"),\n\t\t\t\t\tctx.TranslateString(\"Remove redundant signature\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tint start = script.GetCurrentOffset(anonymousMethodExpression.DelegateToken.EndLocation);\n\t\t\t\t\t\tint end = script.GetCurrentOffset(anonymousMethodExpression.Body.StartLocation);\n\n\t\t\t\t\t\tscript.Replace(start, end - start, \" \");\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/EmptyConstructorIssue.cs",
    "content": "﻿// \n// EmptyConstructorIssue.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SaHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Empty constructor\",\n\t                   Description = \"An empty public constructor without paramaters is redundant.\",\n\t                   Category = IssueCategories.RedundanciesInDeclarations,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"EmptyConstructor\")]\n\tpublic class EmptyConstructorIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar unit = context.RootNode as SyntaxTree;\n\t\t\tif (unit == null)\n\t\t\t\treturn null;\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<EmptyConstructorIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n                : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typedeclaration)\n\t\t\t{\n\t\t\t\tbool hasEmptyConstructor = false;\n\t\t\t\tbool hasUnemptyConstructor = false;\n\t\t\t\tConstructorDeclaration emptyContructorNode = null;\n\n\t\t\t\tforeach (var child in typedeclaration.Children.OfType<ConstructorDeclaration>()) {\n\t\t\t\t\tif (child.HasModifier(Modifiers.Static)) \n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (child.Body.Any() || child.Parameters.Count > 0) {\n\t\t\t\t\t\thasUnemptyConstructor = true;\n\t\t\t\t\t} else if (child.HasModifier(Modifiers.Public)) {\n\t\t\t\t\t\tif (child.Initializer.Arguments.Any())\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\thasEmptyConstructor = true;\n\t\t\t\t\t\temptyContructorNode = child;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!hasUnemptyConstructor && hasEmptyConstructor) {\n\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\temptyContructorNode.NameToken,\n\t\t\t\t\t\tctx.TranslateString(\"Empty constructor is redundant.\"), \n\t\t\t\t\t\tnew CodeAction(\n\t\t\t\t\t\t\tctx.TranslateString(\"Remove redundant constructor\"),\n\t\t\t\t\t\t\tscript => script.Remove(emptyContructorNode),\n\t\t\t\t\t\t\temptyContructorNode.NameToken\n\t\t\t\t\t\t)\n\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/EmptyDestructorIssue.cs",
    "content": "// EmptyDestructorIssue.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Empty destructor\",\n\t                   Description = \"Empty destructor is redundant\",\n\t                   Category = IssueCategories.RedundanciesInDeclarations,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"EmptyDestructor\"\n\t                   )]\n\tpublic class EmptyDestructorIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<EmptyDestructorIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tif (IsEmpty (destructorDeclaration.Body)) {\n\t\t\t\t\tAddIssue(new CodeIssue(destructorDeclaration.NameToken,\n\t\t\t\t\t         ctx.TranslateString(\"Empty destructor is redundant\"),\n\t\t\t\t\t\tGetFixAction(destructorDeclaration)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitUsingDeclaration(UsingDeclaration usingDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitUsingAliasDeclaration(UsingAliasDeclaration usingDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tbool IsEmpty(AstNode node)\n\t\t\t{\n\t\t\t\tif (node is EmptyStatement) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tBlockStatement block = node as BlockStatement;\n\t\t\t\treturn block != null && block.Statements.All(IsEmpty);\n\t\t\t}\n\n\t\t\tCodeAction GetFixAction(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\treturn new CodeAction(ctx.TranslateString(\"Remove redundant destructor\"), script =>\n\t\t\t\t{\n\t\t\t\t\tscript.Remove(destructorDeclaration);\n\t\t\t\t}, destructorDeclaration.NameToken);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/EmptyNamespaceIssue.cs",
    "content": "// EmptyNamespaceIssue.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Empty namespace declaration\",\n\t                   Description = \"Empty namespace declaration is redundant\",\n\t                   Category = IssueCategories.RedundanciesInDeclarations,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"EmptyNamespace\")]\n\tpublic class EmptyNamespaceIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<EmptyNamespaceIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration)\n\t\t\t{\n\t\t\t\tbool hasContents = false;\n\t\t\t\tforeach (var member in namespaceDeclaration.Members) {\n\t\t\t\t\tif (member is TypeDeclaration || member is DelegateDeclaration) {\n\t\t\t\t\t\thasContents = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (member is NamespaceDeclaration) {\n\t\t\t\t\t\thasContents = true;\n\t\t\t\t\t\tmember.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!hasContents) {\n\t\t\t\t\tAddIssue(new CodeIssue(namespaceDeclaration.NamespaceToken, ctx.TranslateString(\"Empty namespace declaration is redundant\"),\n\t\t\t\t\t\tGetFixAction(namespaceDeclaration)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tCodeAction GetFixAction(NamespaceDeclaration namespaceDeclaration)\n\t\t\t{\n\t\t\t\treturn new CodeAction(ctx.TranslateString(\"Remove empty namespace\"),\n\t\t\t\t                      script => script.Remove(namespaceDeclaration),\n\t\t\t\t                      namespaceDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/EnumUnderlyingTypeIsIntIssue.cs",
    "content": "//\n// EnumUnderlyingTypeIsIntIssue.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Underlying type of enum is int\",\n\t                  Description = \"The default underlying type of enums is int, so defining it explicitly is redundant.\",\n\t                  Category = IssueCategories.RedundanciesInDeclarations,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"EnumUnderlyingTypeIsInt\")]\n\tpublic class EnumUnderlyingTypeIsIntIssue : CodeIssueProvider\n\t{\n\t\tpublic override IEnumerable<CodeIssue> GetIssues(BaseRefactoringContext context, string subIssue)\n\t\t{\n\t\t\treturn new GatherVisitor(context).GetIssues();\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<EnumUnderlyingTypeIsIntIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context)\n\t\t\t\t: base(context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tswitch (typeDeclaration.ClassType) {\n\t\t\t\t\tcase ClassType.Class:\n\t\t\t\t\tcase ClassType.Struct:\n\t\t\t\t\t\t//Visit nested types\n\t\t\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase ClassType.Interface:\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar underlyingType = typeDeclaration.BaseTypes.FirstOrDefault();\n\n\t\t\t\tif (underlyingType != null && ctx.ResolveType(underlyingType).FullName == \"System.Int32\") {\n\t\t\t\t\tvar colonToken = typeDeclaration.ColonToken;\n\t\t\t\t\tvar startLocation = colonToken.StartLocation;\n\t\t\t\t\tvar endLocation = underlyingType.EndLocation;\n\n\t\t\t\t\tAddIssue(new CodeIssue(startLocation,\n\t\t\t\t\t         endLocation,\n\t\t\t\t\t         ctx.TranslateString(\"Default underlying type of enums is already int\"),\n\t\t\t\t\t         ctx.TranslateString(\"Remove redundant ': int'\"),\n\t\t\t\t\t         script =>\n\t\t\t\t\t{\n\t\t\t\t\t\tscript.ChangeBaseTypes(typeDeclaration, Enumerable.Empty<AstType>());\n\t\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tCodeAction GetFixAction(TypeDeclaration typeDeclaration, TextLocation start, TextLocation end)\n\t\t\t{\n\t\t\t\treturn new CodeAction(ctx.TranslateString(\"Remove redundant underlying type\"),\n\t\t\t\t                      script => {\n\n\t\t\t\t\tscript.ChangeBaseTypes(typeDeclaration, Enumerable.Empty<AstType>());\n\n\t\t\t\t}, start, end);\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t//No need to visit statements\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/LocalVariableNotUsedIssue.cs",
    "content": "﻿// \n// LocalVariableNotUsedIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Unused local variable\",\n\t\tDescription = \"Local variable is never used.\",\n\t\tCategory = IssueCategories.RedundanciesInDeclarations,\n\t\tSeverity = Severity.Warning,\n\t\tPragmaWarning = 163,\n\t\tAnalysisDisableKeyword = \"UnusedVariable.Compiler\")]\n\tpublic class LocalVariableNotUsedIssue : GatherVisitorCodeIssueProvider\n\t{\n\n\t\t#region ICodeIssueProvider implementation\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\t#endregion\n\n\t\tclass GatherVisitor : GatherVisitorBase<LocalVariableNotUsedIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitVariableInitializer(VariableInitializer variableInitializer)\n\t\t\t{\n\t\t\t\tbase.VisitVariableInitializer(variableInitializer);\n\n\t\t\t\t// check if variable is assigned\n\t\t\t\tif (!variableInitializer.Initializer.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tvar decl = variableInitializer.Parent as VariableDeclarationStatement;\n\t\t\t\tif (decl == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar resolveResult = ctx.Resolve(variableInitializer) as LocalResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (IsUsed(decl.Parent, resolveResult.Variable, variableInitializer))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(variableInitializer.NameToken, \n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Local variable '{0}' is never used\"), resolveResult.Variable.Name), ctx.TranslateString(\"Remove unused local variable\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tif (decl.Variables.Count == 1) {\n\t\t\t\t\t\t\tscript.Remove(decl);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar newDeclaration = (VariableDeclarationStatement)decl.Clone();\n\t\t\t\t\t\t\tnewDeclaration.Variables.Remove(\n\t\t\t\t\t\t\t\tnewDeclaration.Variables.FirstOrNullObject(v => v.Name == variableInitializer.Name));\n\t\t\t\t\t\t\tscript.Replace(decl, newDeclaration);\n\t\t\t\t\t\t}\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\tpublic override void VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForeachStatement(foreachStatement);\n\n\t\t\t\tvar resolveResult = ctx.Resolve(foreachStatement.VariableNameToken) as LocalResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (IsUsed(foreachStatement, resolveResult.Variable, foreachStatement.VariableNameToken))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(foreachStatement.VariableNameToken, ctx.TranslateString(\"Local variable is never used\")));\n\t\t\t}\n\n\t\t\tbool IsUsed(AstNode rootNode, IVariable variable, AstNode variableNode)\n\t\t\t{\n\t\t\t\treturn ctx.FindReferences(rootNode, variable).Any(result => result.Node != variableNode);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/PartialTypeWithSinglePartIssue.cs",
    "content": "// RedundantPartialTypeIssue.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\n\t[IssueDescription (\"Redundant 'partial' modifier in type declaration\",\n\t                   Description = \"Class is declared partial but has only one part\",\n\t                   Category = IssueCategories.RedundanciesInDeclarations,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"PartialTypeWithSinglePart\")]\n\tpublic class PartialTypeWithSinglePartIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<PartialTypeWithSinglePartIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (!typeDeclaration.HasModifier(Modifiers.Partial)) {\n\t\t\t\t\t//We still need to visit the children in search of partial nested types.\n\t\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar resolveResult = ctx.Resolve(typeDeclaration) as TypeResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar typeDefinition = resolveResult.Type.GetDefinition();\n\t\t\t\tif (typeDefinition == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (typeDefinition.Parts.Count == 1) {\n\t\t\t\t\tvar partialModifierToken = typeDeclaration.ModifierTokens.Single(modifier => modifier.Modifier == Modifiers.Partial);\n\t\t\t\t\t// there may be a disable comment before the partial token somewhere\n\t\t\t\t\tforeach (var child in typeDeclaration.Children.TakeWhile (child => child != partialModifierToken)) {\n\t\t\t\t\t\tchild.AcceptVisitor(this);\n\t\t\t\t\t}\n\t\t\t\t\tAddIssue(new CodeIssue(partialModifierToken,\n\t\t\t\t\t         ctx.TranslateString(\"Partial class with single part\"),\n\t\t\t\t\t\tGetFixAction(typeDeclaration, partialModifierToken)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t//We never need to visit the children of block statements\n\t\t\t}\n\n\t\t\tCodeAction GetFixAction(TypeDeclaration typeDeclaration, CSharpModifierToken partialModifierToken)\n\t\t\t{\n\t\t\t\treturn new CodeAction(ctx.TranslateString(\"Remove 'partial'\"), script => {\n\t\t\t\t\tscript.ChangeModifier (typeDeclaration, typeDeclaration.Modifiers & ~Modifiers.Partial);\n\t\t\t\t}, partialModifierToken);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/RedundantBaseConstructorCallIssue.cs",
    "content": "// \n// RedundantBaseConstructorCallIssue.cs\n// \n// Author:\n//      Ciprian Khlud <ciprian.mustiata@yahoo.com>\n// \n// Copyright (c) 2013 Ciprian Khlud <ciprian.mustiata@yahoo.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant base constructor call\",\n\t                   Description = \"This is generated by the compiler and can be safely removed.\",\n\t                   Category = IssueCategories.RedundanciesInDeclarations,\n\t                   Severity = Severity.Suggestion,\n\t                   AnalysisDisableKeyword = \"RedundantBaseConstructorCall\")]\n\tpublic class RedundantBaseConstructorCallIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantBaseConstructorCallIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\n\t\t\t\tif (constructorDeclaration.Initializer.ConstructorInitializerType != ConstructorInitializerType.Base)\n\t\t\t\t\treturn;\n\t\t\t\tif (constructorDeclaration.Initializer.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tif (constructorDeclaration.Initializer.Arguments.Count != 0)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(constructorDeclaration.Initializer.StartLocation, constructorDeclaration.Initializer.EndLocation,\n\t\t\t\t         ctx.TranslateString(\"Redundant base constructor call\"),\n\t\t\t\t         ctx.TranslateString(\"Remove redundant 'base()'\"),\n\t\t\t\t         script => {\n\t\t\t\t\tvar clone = (ConstructorDeclaration)constructorDeclaration.Clone();\n\t\t\t\t\tscript.Replace(clone.ColonToken, CSharpTokenNode.Null.Clone());\n\t\t\t\t\tscript.Replace(constructorDeclaration.Initializer, ConstructorInitializer.Null.Clone());\n\t\t\t\t\t}) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\t//ignore properties\n\t\t\t}\n\n\t\t\tpublic override void  VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\t//ignore fields\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\t//ignore method declarations\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/RedundantDefaultFieldInitializerIssue.cs",
    "content": "﻿// \n// RedundantDefaultFieldInitializerIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Redundant field initializer\",\n\t                   Description = \"Initializing field with default value is redundant.\",\n\t                   Category = IssueCategories.RedundanciesInDeclarations,\n\t                   Severity = Severity.Hint,\n\t                   AnalysisDisableKeyword = \"RedundantDefaultFieldInitializer\")]\n\tpublic class RedundantDefaultFieldInitializerIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantDefaultFieldInitializerIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t\t\tif (fieldDeclaration.HasModifier(Modifiers.Const) || fieldDeclaration.HasModifier(Modifiers.Readonly))\n\t\t\t\t\treturn;\n\t\t\t\tvar defaultValueExpr = GetDefaultValueExpression(fieldDeclaration.ReturnType);\n\t\t\t\tif (defaultValueExpr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tforeach (var variable1 in fieldDeclaration.Variables) {\n\t\t\t\t\tvar variable = variable1;\n\t\t\t\t\tif (!defaultValueExpr.Match(variable.Initializer).Success)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tAddIssue(new CodeIssue(variable.Initializer, ctx.TranslateString(\"Initializing field by default value is redundant\"),\n\t\t\t\t\t         new CodeAction(ctx.TranslateString(\"Remove field initializer\"),\n\t\t\t\t\t                         script => script.Replace(variable, new VariableInitializer(variable.Name)),\n\t\t\t\t\t\t\tvariable.Initializer)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tExpression GetDefaultValueExpression(AstType astType)\n\t\t\t{\n\t\t\t\tvar type = ctx.ResolveType(astType);\n\n\t\t\t\tif ((type.IsReferenceType ?? false) || type.Kind == TypeKind.Dynamic)\n\t\t\t\t\treturn new NullReferenceExpression();\n\n\t\t\t\tvar typeDefinition = type.GetDefinition();\n\t\t\t\tif (typeDefinition != null) {\n\t\t\t\t\tswitch (typeDefinition.KnownTypeCode) {\n\t\t\t\t\t\tcase KnownTypeCode.Boolean:\n\t\t\t\t\t\t\treturn new PrimitiveExpression(false);\n\n\t\t\t\t\t\tcase KnownTypeCode.Char:\n\t\t\t\t\t\t\treturn new PrimitiveExpression('\\0');\n\n\t\t\t\t\t\tcase KnownTypeCode.SByte:\n\t\t\t\t\t\tcase KnownTypeCode.Byte:\n\t\t\t\t\t\tcase KnownTypeCode.Int16:\n\t\t\t\t\t\tcase KnownTypeCode.UInt16:\n\t\t\t\t\t\tcase KnownTypeCode.Int32:\n\t\t\t\t\t\t\treturn new PrimitiveExpression(0);\n\n\t\t\t\t\t\tcase KnownTypeCode.Int64:\n\t\t\t\t\t\t\treturn new Choice { new PrimitiveExpression(0), new PrimitiveExpression(0L) };\n\t\t\t\t\t\tcase KnownTypeCode.UInt32:\n\t\t\t\t\t\t\treturn new Choice { new PrimitiveExpression(0), new PrimitiveExpression(0U) };\n\t\t\t\t\t\tcase KnownTypeCode.UInt64:\n\t\t\t\t\t\t\treturn new Choice {\n\t\t\t\t\t\t\t\tnew PrimitiveExpression(0), new PrimitiveExpression(0U), new PrimitiveExpression(0UL)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase KnownTypeCode.Single:\n\t\t\t\t\t\t\treturn new Choice { new PrimitiveExpression(0), new PrimitiveExpression(0F) };\n\t\t\t\t\t\tcase KnownTypeCode.Double:\n\t\t\t\t\t\t\treturn new Choice {\n\t\t\t\t\t\t\t\tnew PrimitiveExpression(0), new PrimitiveExpression(0F), new PrimitiveExpression(0D)\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase KnownTypeCode.Decimal:\n\t\t\t\t\t\t\treturn new Choice { new PrimitiveExpression(0), new PrimitiveExpression(0M) };\n\n\t\t\t\t\t\tcase KnownTypeCode.NullableOfT:\n\t\t\t\t\t\t\treturn new NullReferenceExpression();\n\t\t\t\t\t}\n\t\t\t\t\tif (type.Kind == TypeKind.Struct)\n\t\t\t\t\t\treturn new ObjectCreateExpression(astType.Clone());\n\t\t\t\t}\n\t\t\t\treturn new DefaultValueExpression(astType.Clone());\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/RedundantOverridenMemberIssue.cs",
    "content": "// \n// RedundantOverridenMemberIssue.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Runtime.InteropServices;\nusing Mono.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription (\"Redundant member override\",\n\t                   Description = \"The override of a virtual member is redundant because it consists of only a call to the base\",\n\t                   Category = IssueCategories.RedundanciesInDeclarations,\n\t                   Severity = Severity.Warning,\n\t                   AnalysisDisableKeyword = \"RedundantOverridenMember\")]\n\tpublic class RedundantOverridenMemberIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantOverridenMemberIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid AddIssue(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tvar title = ctx.TranslateString(\"Redundant method override\");\n\t\t\t\tAddIssue(new CodeIssue(methodDeclaration, title, ctx.TranslateString(\"Remove redundant method override\"), script => script.Remove(methodDeclaration)) {\n\t\t\t\t\tIssueMarker = IssueMarker.GrayOut\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t\t\n\t\t\t\tif (!methodDeclaration.HasModifier(Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (methodDeclaration.Body.Statements.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar expr = methodDeclaration.Body.Statements.FirstOrNullObject();\n\t\t\t\t//Debuger.WriteInFile(expr.FirstChild.ToString());\n\t\t\t\tif (expr == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar returnStatement = expr as ReturnStatement;\n\t\t\t\tif (returnStatement != null) {\n\t\t\t\t\tvar invocationExpression = returnStatement.Expression as InvocationExpression;\n\t\t\t\t\tif (invocationExpression == null)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar memberReferenceExpression = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\t\tif (memberReferenceExpression == null ||\n\t\t\t\t\t    memberReferenceExpression.MemberName != methodDeclaration.Name ||\n\t\t\t\t\t    !(memberReferenceExpression.FirstChild is BaseReferenceExpression))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (methodDeclaration.Name == \"GetHashCode\" && !methodDeclaration.Parameters.Any()) {\n\t\t\t\t\t\tvar rr = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\t\t\tif (rr != null && rr.Member.ReturnType.IsKnownType(KnownTypeCode.Int32)) {\n\t\t\t\t\t\t\tif (rr.Member.DeclaringType.GetMethods(m => m.Name == \"Equals\" && m.IsOverride, GetMemberOptions.IgnoreInheritedMembers).Any())\n\t\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\tAddIssue(methodDeclaration);\n\t\t\t\t}\n\t\t\t\tvar stmtExpr = expr as ExpressionStatement;\n\t\t\t\tif (stmtExpr == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar invocation = stmtExpr.Expression as InvocationExpression;\n\t\t\t\tif (invocation != null) {\n\t\t\t\t\tvar memberReferenceExpression = invocation.Target as MemberReferenceExpression;\n\t\t\t\t\tif (memberReferenceExpression == null ||\n\t\t\t\t\t    memberReferenceExpression.MemberName != methodDeclaration.Name ||\n\t\t\t\t\t    !(memberReferenceExpression.FirstChild is BaseReferenceExpression))\n\t\t\t\t\t\treturn;\n\t\t\t\t\tAddIssue(methodDeclaration);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic readonly AstNode setterPattern = new ExpressionStatement(\n\t\t\t\tnew AssignmentExpression (new AnyNode (\"left\"), new IdentifierExpression(\"value\"))\n\t\t\t);\n\t\t\t\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitPropertyDeclaration(propertyDeclaration);\n\t\t\t\t\n\t\t\t\tif (!propertyDeclaration.HasModifier(Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tbool hasGetter = !propertyDeclaration.Getter.IsNull;\n\t\t\t\tbool hasSetter = !propertyDeclaration.Setter.IsNull;\n\t\t\t\tif (!hasGetter && !hasSetter)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (hasGetter && propertyDeclaration.Getter.Body.Statements.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (hasSetter && propertyDeclaration.Setter.Body.Statements.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar resultProperty = ctx.Resolve(propertyDeclaration) as MemberResolveResult;\n\t\t\t\tif (resultProperty == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar baseProperty = InheritanceHelper.GetBaseMember(resultProperty.Member) as IProperty;\n\t\t\t\tif (baseProperty == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tbool hasBaseGetter = baseProperty.Getter != null;\n\t\t\t\tbool hasBaseSetter = baseProperty.Setter != null;\n\t\t\t\t\n\t\t\t\tif (hasBaseGetter) {\n\t\t\t\t\tif (hasGetter) {\n\t\t\t\t\t\tvar expr = propertyDeclaration.Getter.Body.Statements.FirstOrNullObject();\n\t\t\t\t\t\n\t\t\t\t\t\tif (expr == null || !(expr is ReturnStatement))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\n\t\t\t\t\t\tvar memberReferenceExpression = (expr as ReturnStatement).Expression as MemberReferenceExpression;\n\t\t\t\t\t\n\t\t\t\t\t\tif (memberReferenceExpression == null || \n\t\t\t\t\t\t\tmemberReferenceExpression.MemberName != propertyDeclaration.Name ||\n\t\t\t\t\t\t\t!(memberReferenceExpression.FirstChild is BaseReferenceExpression))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (hasBaseSetter) {\n\t\t\t\t\tif (hasSetter) {\n\t\t\t\t\t\tvar match = setterPattern.Match(propertyDeclaration.Setter.Body.Statements.FirstOrNullObject());\n\t\t\t\t\t\tif (!match.Success)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tvar memberReferenceExpression = match.Get(\"left\").Single() as MemberReferenceExpression;\n\t\t\t\t\t\tif (memberReferenceExpression == null || \n\t\t\t\t\t\t\tmemberReferenceExpression.MemberName != propertyDeclaration.Name ||\n\t\t\t\t\t\t\t!(memberReferenceExpression.FirstChild is BaseReferenceExpression))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar title = ctx.TranslateString(\"Redundant property override\");\n\t\t\t\tAddIssue(new CodeIssue(propertyDeclaration, title, ctx.TranslateString(\"Remove redundant property override\"), script => script.Remove(propertyDeclaration)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitIndexerDeclaration(indexerDeclaration);\n\t\t\t\t\n\t\t\t\tif (!indexerDeclaration.HasModifier(Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tbool hasGetter = !indexerDeclaration.Getter.IsNull;\n\t\t\t\tbool hasSetter = !indexerDeclaration.Setter.IsNull;\n\t\t\t\tif (!hasGetter && !hasSetter)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (hasGetter && indexerDeclaration.Getter.Body.Statements.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (hasSetter && indexerDeclaration.Setter.Body.Statements.Count != 1)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar resultIndexer = ctx.Resolve(indexerDeclaration) as MemberResolveResult;\n\t\t\t\tif (resultIndexer == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar baseIndexer = InheritanceHelper.GetBaseMember(resultIndexer.Member) as IProperty;\n\t\t\t\tif (baseIndexer == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tbool hasBaseGetter = (baseIndexer.Getter != null);\n\t\t\t\tbool hasBaseSetter = (baseIndexer.Setter != null);\n\t\t\t\t\n\t\t\t\tif (hasBaseGetter) {\n\t\t\t\t\tif (hasGetter) {\n\t\t\t\t\t\n\t\t\t\t\t\tvar expr = indexerDeclaration.Getter.Body.Statements.FirstOrNullObject() as ReturnStatement;\n\t\t\t\t\t\n\t\t\t\t\t\tif (expr == null)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\n\t\t\t\t\t\tExpression indexerExpression = expr.Expression;\n\t\t\t\t\t\n\t\t\t\t\t\tif (indexerExpression == null || \n\t\t\t\t\t\t\t!(indexerExpression.FirstChild is BaseReferenceExpression))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (hasBaseSetter) {\n\t\t\t\t\tif (hasSetter) {\n\t\t\t\t\t\tvar match = setterPattern.Match(indexerDeclaration.Setter.Body.Statements.FirstOrNullObject());\n\t\t\t\t\t\tif (!match.Success)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tvar memberReferenceExpression = match.Get(\"left\").Single() as IndexerExpression;\n\t\t\t\t\t\tif (memberReferenceExpression == null || \n\t\t\t\t\t\t\t!(memberReferenceExpression.FirstChild is BaseReferenceExpression))\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar title = ctx.TranslateString(\"Redundant indexer override\");\n\t\t\t\tAddIssue(new CodeIssue(indexerDeclaration, title, ctx.TranslateString(\"Remove redundant indexer override\"), script => script.Remove(indexerDeclaration)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\tstatic readonly AstNode customEventPattern =\n\t\t\t\tnew CustomEventDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Any,\n\t\t\t\t\tName = Pattern.AnyString,\n\t\t\t\t\tReturnType = new AnyNode(), \n\t\t\t\t\tAddAccessor = new Accessor {\n\t\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\t\tnew AssignmentExpression {\n\t\t\t\t\t\t\t\tLeft = new NamedNode (\"baseRef\", new MemberReferenceExpression(new BaseReferenceExpression(), Pattern.AnyString)),\n\t\t\t\t\t\t\t\tOperator = AssignmentOperatorType.Add,\n\t\t\t\t\t\t\t\tRight = new IdentifierExpression(\"value\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tRemoveAccessor = new Accessor {\n\t\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\t\tnew AssignmentExpression {\n\t\t\t\t\t\t\t\tLeft = new Backreference(\"baseRef\"),\n\t\t\t\t\t\t\t\tOperator = AssignmentOperatorType.Subtract,\n\t\t\t\t\t\t\t\tRight = new IdentifierExpression(\"value\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tvar m = customEventPattern.Match(eventDeclaration);\n\t\t\t\tif (!m.Success)\n\t\t\t\t\treturn;\n\t\t\t\tvar baseRef = m.Get<MemberReferenceExpression>(\"baseRef\").First();\n\t\t\t\tif (baseRef == null || baseRef.MemberName != eventDeclaration.Name)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar title = ctx.TranslateString(\"Redundant event override\");\n\t\t\t\tAddIssue(new CodeIssue(eventDeclaration, title, ctx.TranslateString(\"Remove event override\"), script => script.Remove(eventDeclaration)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/RedundantParamsIssue.cs",
    "content": "//\n// RedundantParamsIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"'params' is ignored on overrides\",\n\t                  Description = \"'params' is ignored on overrides\",\n\t                  Category = IssueCategories.RedundanciesInDeclarations,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"RedundantParams\")]\n\tpublic class RedundantParamsIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantParamsIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!methodDeclaration.HasModifier(Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\tvar lastParam = methodDeclaration.Parameters.LastOrDefault();\n\t\t\t\tif (lastParam == null || lastParam.ParameterModifier != ParameterModifier.Params)\n\t\t\t\t\treturn;\n\t\t\t\tvar type = lastParam.Type as ComposedType;\n\t\t\t\tif (type == null || !type.ArraySpecifiers.Any())\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar baseMember = InheritanceHelper.GetBaseMember(rr.Member) as IMethod;\n\t\t\t\tif (baseMember == null || baseMember.Parameters.Count == 0 || baseMember.Parameters.Last().IsParams)\n\t\t\t\t\treturn;\n\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\tlastParam.GetChildByRole(ParameterDeclaration.ParamsModifierRole),\n\t\t\t\t\tctx.TranslateString(\"'params' is always ignored in overrides\"),\n\t\t\t\t\tctx.TranslateString(\"Remove 'params' modifier\"),\n\t\t\t\t\tscript => {\n\t\t\t\t\t\tvar p = (ParameterDeclaration)lastParam.Clone();\n\t\t\t\t\t\tp.ParameterModifier = ParameterModifier.None;\n\t\t\t\t\t\tscript.Replace(lastParam, p);\n\t\t\t\t\t}\n\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/SealedMemberInSealedClassIssue.cs",
    "content": "//\n// SealedMemberInSealedClassIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Sealed member in sealed class\",\n\t                  Description = \"'sealed' modifier is redundant in sealed classes\",\n\t                  Category = IssueCategories.RedundanciesInDeclarations,\n\t                  Severity = Severity.Warning,\n\t                  AnalysisDisableKeyword = \"SealedMemberInSealedClass\")]\n\tpublic class SealedMemberInSealedClassIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<SealedMemberInSealedClassIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tvoid CheckNode(EntityDeclaration node)\n\t\t\t{\n\t\t\t\tif (!node.HasModifier(Modifiers.Override))\n\t\t\t\t\treturn;\n\t\t\t\tvar type = node.Parent as TypeDeclaration;\n\t\t\t\tif (type == null || !type.HasModifier(Modifiers.Sealed))\n\t\t\t\t\treturn;\n\t\t\t\tforeach (var token_ in node.ModifierTokens) {\n\t\t\t\t\tvar token = token_;\n\t\t\t\t\tif (token.Modifier == Modifiers.Sealed) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\ttoken, \n\t\t\t\t\t\t\tctx.TranslateString(\"Keyword 'sealed' is redundant in sealed classes.\"), \n\t\t\t\t\t\t\tctx.TranslateString(\"Remove redundant 'sealed' modifier\"), \n\t\t\t\t\t\t\tscript => script.ChangeModifier(node, node.Modifiers & ~Modifiers.Sealed)\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t\tCheckNode(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitFieldDeclaration(fieldDeclaration);\n\t\t\t\tCheckNode(fieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitPropertyDeclaration(propertyDeclaration);\n\t\t\t\tCheckNode(propertyDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitIndexerDeclaration(indexerDeclaration);\n\t\t\t\tCheckNode(indexerDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitEventDeclaration(eventDeclaration);\n\t\t\t\tCheckNode(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitCustomEventDeclaration(eventDeclaration);\n\t\t\t\tCheckNode(eventDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t\tCheckNode(constructorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitOperatorDeclaration(operatorDeclaration);\n\t\t\t\tCheckNode(operatorDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitFixedFieldDeclaration(fixedFieldDeclaration);\n\t\t\t\tCheckNode(fixedFieldDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\t// SKIP\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration.Parent is TypeDeclaration) {\n\t\t\t\t\tCheckNode(typeDeclaration);\n\t\t\t\t}\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/UnusedLabelIssue.cs",
    "content": "//\n// UnusedLabelIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\n\t\t\"Unused label\",\n\t\tDescription = \"Label is never referenced\",\n\t\tCategory = IssueCategories.RedundanciesInDeclarations,\n\t\tSeverity = Severity.Warning,\n\t\tPragmaWarning = 164,\n\t\tAnalysisDisableKeyword = \"UnusedLabel\")]\n\tpublic class UnusedLabelIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UnusedLabelIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tclass LabelDescriptor \n\t\t\t{\n\t\t\t\tpublic List<LabelStatement> LabelStatement = new List<ICSharpCode.NRefactory.CSharp.LabelStatement>();\n\t\t\t\tpublic bool IsUsed;\n\n\t\t\t\tpublic LabelDescriptor(LabelStatement labelStatement)\n\t\t\t\t{\n\t\t\t\t\tthis.LabelStatement.Add(labelStatement);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treadonly Dictionary<string, LabelDescriptor> labels = new Dictionary<string, LabelDescriptor> ();\n\n\t\t\tvoid GatherLabels(BlockStatement body)\n\t\t\t{\n\t\t\t\tforeach (var node in body.Descendants) {\n\t\t\t\t\tvar labelStatement = node as LabelStatement;\n\t\t\t\t\tif (labelStatement == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t// note: duplicate labels are checked by the parser.\n\t\t\t\t\tLabelDescriptor desc;\n\t\t\t\t\tif (!labels.TryGetValue(labelStatement.Label, out desc)) {\n\t\t\t\t\t\tlabels[labelStatement.Label] = new LabelDescriptor(labelStatement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdesc.LabelStatement.Add(labelStatement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid CheckLables()\n\t\t\t{\n\t\t\t\tforeach (var label in labels.Values) {\n\t\t\t\t\tif (label.IsUsed)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tforeach (var stmt in label.LabelStatement) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(\n\t\t\t\t\t\t\tstmt.LabelToken.StartLocation,\n\t\t\t\t\t\t\tstmt.ColonToken.EndLocation,\n\t\t\t\t\t\t\tctx.TranslateString(\"Label is unused\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Remove unused label\"),\n\t\t\t\t\t\t\ts => { s.Remove(stmt); s.FormatText(stmt.Parent); }\n\t\t\t\t\t\t) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlabels.Clear();\n\t\t\t}\n\n\t\t\tpublic override void VisitGotoStatement(GotoStatement gotoStatement)\n\t\t\t{\n\t\t\t\tLabelDescriptor desc;\n\t\t\t\tif (labels.TryGetValue(gotoStatement.Label, out desc)) {\n\t\t\t\t\tdesc.IsUsed = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitLabelStatement(LabelStatement labelStatement)\n\t\t\t{\n\t\t\t\tif (IsSuppressed(labelStatement.StartLocation)) {\n\t\t\t\t\tLabelDescriptor desc;\n\t\t\t\t\tif (labels.TryGetValue(labelStatement.Label, out desc)) \n\t\t\t\t\t\tdesc.LabelStatement.Remove(labelStatement);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tGatherLabels(methodDeclaration.Body);\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t\tCheckLables();\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t\tGatherLabels(constructorDeclaration.Body);\n\t\t\t\tbase.VisitConstructorDeclaration(constructorDeclaration);\n\t\t\t\tCheckLables();\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t\tGatherLabels(destructorDeclaration.Body);\n\t\t\t\tbase.VisitDestructorDeclaration(destructorDeclaration);\n\t\t\t\tCheckLables();\n\t\t\t}\n\n\t\t\tpublic override void VisitAccessor(Accessor accessor)\n\t\t\t{\n\t\t\t\tGatherLabels(accessor.Body);\n\t\t\t\tbase.VisitAccessor(accessor);\n\t\t\t\tCheckLables();\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t\tGatherLabels(operatorDeclaration.Body);\n\t\t\t\tbase.VisitOperatorDeclaration(operatorDeclaration);\n\t\t\t\tCheckLables();\n\t\t\t}\n\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/UnusedParameterIssue.cs",
    "content": "﻿// \n// UnusedParameterIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Unused parameter\",\n\t\tDescription = \"Parameter is never used.\",\n\t\tCategory = IssueCategories.RedundanciesInDeclarations,\n\t\tSeverity = Severity.Warning, \n\t\tAnalysisDisableKeyword = \"UnusedParameter\"\n\t)]\n\tpublic class UnusedParameterIssue : GatherVisitorCodeIssueProvider\n\t{\n\n\t\t#region ICodeIssueProvider implementation\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar delegateVisitor = new GetDelgateUsagesVisitor(context);\n\t\t\tcontext.RootNode.AcceptVisitor(delegateVisitor);\n\n\t\t\treturn new GatherVisitor(context, delegateVisitor);\n\t\t}\n\n\t\t#endregion\n\n\t\t// Collect all methods that are used as delegate\n\t\tclass GetDelgateUsagesVisitor : DepthFirstAstVisitor\n\t\t{\n\t\t\tBaseRefactoringContext ctx;\n\t\t\tpublic readonly List<IMethod> UsedMethods = new List<IMethod>();\n\n\t\t\tpublic GetDelgateUsagesVisitor(BaseRefactoringContext ctx)\n\t\t\t{\n\t\t\t\tthis.ctx = ctx;\n\t\t\t}\n\n\t\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tif (!IsTargetOfInvocation(identifierExpression)) {\n\t\t\t\t\tvar mgr = ctx.Resolve(identifierExpression) as MethodGroupResolveResult;\n\t\t\t\t\tif (mgr != null)\n\t\t\t\t\t\tUsedMethods.AddRange(mgr.Methods);\n\t\t\t\t}\n\t\t\t\tbase.VisitIdentifierExpression(identifierExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tif (!IsTargetOfInvocation(memberReferenceExpression)) {\n\t\t\t\t\tvar mgr = ctx.Resolve(memberReferenceExpression) as MethodGroupResolveResult;\n\t\t\t\t\tif (mgr != null)\n\t\t\t\t\t\tUsedMethods.AddRange(mgr.Methods);\n\t\t\t\t}\n\t\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t\t}\n\n\t\t\tstatic bool IsTargetOfInvocation(AstNode node)\n\t\t\t{\n\t\t\t\treturn node.Role == Roles.TargetExpression && node.Parent is InvocationExpression;\n\t\t\t}\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UnusedParameterIssue>\n\t\t{\n\t\t\tGetDelgateUsagesVisitor usedDelegates;\n\t\t\tbool currentTypeIsPartial;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, GetDelgateUsagesVisitor usedDelegates)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tthis.usedDelegates = usedDelegates;\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tbool outerTypeIsPartial = currentTypeIsPartial;\n\t\t\t\tcurrentTypeIsPartial = typeDeclaration.HasModifier(Modifiers.Partial);\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t\tcurrentTypeIsPartial = outerTypeIsPartial;\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\t// Only some methods are candidates for the warning\n\n\t\t\t\tif (methodDeclaration.Body.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\tif (methodDeclaration.Modifiers.HasFlag(Modifiers.Virtual) ||\n\t\t\t\t    methodDeclaration.Modifiers.HasFlag(Modifiers.New) ||\n\t\t\t\t    methodDeclaration.Modifiers.HasFlag(Modifiers.Partial))\n\t\t\t\t\treturn;\n\t\t\t\tvar methodResolveResult = ctx.Resolve(methodDeclaration) as MemberResolveResult;\n\t\t\t\tif (methodResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar member = methodResolveResult.Member;\n\t\t\t\tif (member.IsOverride)\n\t\t\t\t\treturn;\n\t\t\t\tif (member.ImplementedInterfaceMembers.Any())\n\t\t\t\t\treturn;\n\t\t\t\tif (usedDelegates.UsedMethods.Any(m => m.MemberDefinition == member))\n\t\t\t\t\treturn;\n\t\t\t\tif (currentTypeIsPartial && methodDeclaration.Parameters.Count == 2) {\n\t\t\t\t\tif (methodDeclaration.Parameters.First().Name == \"sender\") {\n\t\t\t\t\t\t// Looks like an event handler; the registration might be in the designer part\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (var parameter in methodDeclaration.Parameters)\n\t\t\t\t\tparameter.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tpublic override void VisitParameterDeclaration(ParameterDeclaration parameterDeclaration)\n\t\t\t{\n\t\t\t\tbase.VisitParameterDeclaration(parameterDeclaration);\n\n\t\t\t\tif (!(parameterDeclaration.Parent is MethodDeclaration || parameterDeclaration.Parent is ConstructorDeclaration))\n\t\t\t\t\treturn;\n\n\t\t\t\tvar resolveResult = ctx.Resolve(parameterDeclaration) as LocalResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (resolveResult.Type.Name == \"StreamingContext\" && resolveResult.Type.Namespace == \"System.Runtime.Serialization\") {\n\t\t\t\t\t// commonly unused parameter in constructors associated with ISerializable\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (ctx.FindReferences(parameterDeclaration.Parent, resolveResult.Variable).Any(r => r.Node != parameterDeclaration))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue (\n\t\t\t\t\tparameterDeclaration.NameToken, \n\t\t\t\t\tstring.Format(ctx.TranslateString(\"Parameter '{0}' is never used\"), parameterDeclaration.Name)) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInDeclaration/UnusedTypeParameterIssue.cs",
    "content": "﻿// \n// UnusedTypeParameterIssue.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[IssueDescription(\"Unused type parameter\",\n\t\tDescription = \"Type parameter is never used.\",\n\t\tCategory = IssueCategories.RedundanciesInDeclarations,\n\t\tSeverity = Severity.Warning,\n\t\tAnalysisDisableKeyword = \"UnusedTypeParameter\")]\n\tpublic class UnusedTypeParameterIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic FindReferences refFinder = new FindReferences();\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tvar unit = context.RootNode as SyntaxTree;\n\t\t\tif (unit == null)\n\t\t\t\treturn null;\n\t\t\treturn new GatherVisitor(context, unit);\n\t\t}\n\n\t\tprotected static bool FindUsage(BaseRefactoringContext context, SyntaxTree unit,\n\t\t                                 ITypeParameter typeParameter, AstNode declaration)\n\t\t{\n\t\t\tvar found = false;\n\t\t\tvar searchScopes = refFinder.GetSearchScopes(typeParameter);\n\t\t\trefFinder.FindReferencesInFile(searchScopes, context.Resolver,\n\t\t\t\t(node, resolveResult) => {\n\t\t\t\t\tif (node != declaration)\n\t\t\t\t\t\tfound = true;\n\t\t\t\t}, context.CancellationToken);\n\t\t\treturn found;\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UnusedTypeParameterIssue>\n\t\t{\n\t\t\tSyntaxTree unit;\n\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, SyntaxTree unit)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t\tthis.unit = unit;\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeParameterDeclaration(TypeParameterDeclaration decl)\n\t\t\t{\n\t\t\t\tbase.VisitTypeParameterDeclaration(decl);\n\n\t\t\t\tvar resolveResult = ctx.Resolve(decl) as TypeResolveResult;\n\t\t\t\tif (resolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar typeParameter = resolveResult.Type as ITypeParameter;\n\t\t\t\tif (typeParameter == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar methodDecl = decl.Parent as MethodDeclaration;\n\t\t\t\tif (methodDecl == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (FindUsage(ctx, unit, typeParameter, decl))\n\t\t\t\t\treturn;\n\n\t\t\t\tAddIssue(new CodeIssue(decl.NameToken, ctx.TranslateString(\"Type parameter is never used\")) { IssueMarker = IssueMarker.GrayOut });\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/TODO/ConvertTailRecursiveCallToLoopIssue.cs",
    "content": "//\n// ConvertTailRecursiveCallToLoopIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription (\"Tail recursive call may be replaced by loop\",\n//\t\tDescription = \"Tail recursive calls should be avoided.\",\n//\t\tCategory = IssueCategories.CodeQualityIssues,\n//\t\tSeverity = Severity.Hint)]\n\tpublic class ConvertTailRecursiveCallToLoopIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ConvertTailRecursiveCallToLoopIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\t// TODO\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/TODO/LoopCanBeConvertedToQueryIssue.cs",
    "content": "//\n// LoopCanBeConvertedToQueryIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription (\"Loop can be converted into LINQ expression\",\n//\t\tDescription = \"Loop can be converted into LINQ expression\",\n//\t\tCategory = IssueCategories.Opportunities,\n//\t\tSeverity = Severity.Suggestion,\n//\t\tAnalysisDisableKeyword = \"LoopCanBeConvertedToQuery\")]\n\tpublic class LoopCanBeConvertedToQueryIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<LoopCanBeConvertedToQueryIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/TODO/PartOfBodyCanBeConvertedToQueryIssue.cs",
    "content": "//\n// PartOfBodyCanBeConvertedToQueryIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription (\"Part of the loop body can be converted into LINQ expression\",\n//\t\tDescription = \"Part of the loop body can be converted into LINQ expression\",\n//\t\tCategory = IssueCategories.Opportunities,\n//\t\tSeverity = Severity.Hint)]\n\tpublic class PartOfBodyCanBeConvertedToQueryIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<PartOfBodyCanBeConvertedToQueryIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/TODO/RedundantTypeArgumentsOfMethodIssue.cs",
    "content": "//\n// RedundantTypeArgumentsOfMethodIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription (\"Redundant type arguments in method call\",\n//\t\tDescription = \"Explicit specifiction is redundant because they are inferred from arguments\",\n//\t\tCategory = IssueCategories.RedundanciesInCode,\n//\t\tSeverity = Severity.Hint, \n//\t\tAnalysisDisableKeyword = \"RedundantTypeArgumentsOfMethod\" )]\n\tpublic class RedundantTypeArgumentsOfMethodIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantTypeArgumentsOfMethodIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/AutoAsyncIssue.cs",
    "content": "//\n// AutoAsyncIssue.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.Refactoring;\n\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Old-style asynchronous function can be converted to C# 5 async\",\n//\t                  Description = \"Detects usage of old-style TaskCompletionSource/ContinueWith and suggests using async/await instead\",\n//\t                  Category = IssueCategories.Opportunities,\n//\t                  Severity = Severity.Hint)]\n\tpublic class AutoAsyncIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly ReturnStatement ReturnTaskCompletionSourcePattern = new ReturnStatement {\n\t\t\tExpression = new MemberReferenceExpression {\n\t\t\t\tTarget = new IdentifierExpression(Pattern.AnyString).WithName(\"target\"),\n\t\t\t\tMemberName = \"Task\"\n\t\t\t}\n\t\t};\n\n\t\tsealed class OriginalNodeAnnotation\n\t\t{\n\t\t\tinternal readonly AstNode sourceNode;\n\n\t\t\tinternal OriginalNodeAnnotation(AstNode sourceNode) {\n\t\t\t\tthis.sourceNode = sourceNode;\n\t\t\t}\n\t\t}\n\n\t\tstatic void AddOriginalNodeAnnotations(AstNode currentFunction)\n\t\t{\n\t\t\tforeach (var nodeToAnnotate in currentFunction\n\t\t\t         .DescendantNodesAndSelf(MayHaveChildrenToAnnotate)\n\t\t\t         .Where(ShouldAnnotate)) {\n\t\t\t\tnodeToAnnotate.AddAnnotation(new OriginalNodeAnnotation(nodeToAnnotate));\n\t\t\t}\n\t\t}\n\n\t\tstatic void RemoveOriginalNodeAnnotations(AstNode currentFunction)\n\t\t{\n\t\t\tforeach (var nodeToAnnotate in currentFunction\n\t\t\t         .DescendantNodesAndSelf(MayHaveChildrenToAnnotate)\n\t\t\t         .Where(ShouldAnnotate)) {\n\t\t\t\tnodeToAnnotate.RemoveAnnotations<OriginalNodeAnnotation>();\n\t\t\t}\n\t\t}\n\n\t\tstatic bool MayHaveChildrenToAnnotate(AstNode node)\n\t\t{\n\t\t\treturn node is Statement ||\n\t\t\t\tnode is Expression ||\n\t\t\t\tnode is MethodDeclaration;\n\t\t}\n\n\t\tstatic bool ShouldAnnotate(AstNode node)\n\t\t{\n\t\t\treturn node is InvocationExpression;\n\t\t}\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\tif (!context.Supports(new Version(5, 0))) {\n\t\t\t\t//Old C# version -- async/await are not available\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<AutoAsyncIssue>\n\t\t{\n\t\t\tinternal GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t: base(ctx) {}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tAddIssueFor(methodDeclaration);\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitLambdaExpression(LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tAddIssueFor(lambdaExpression);\n\t\t\t\tbase.VisitLambdaExpression(lambdaExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tAddIssueFor(anonymousMethodExpression);\n\t\t\t\tbase.VisitAnonymousMethodExpression(anonymousMethodExpression);\n\t\t\t}\n\n\t\t\tvoid AddIssueFor(AstNode currentFunction)\n\t\t\t{\n\t\t\t\tif (IsAsync(currentFunction))\n\t\t\t\t\treturn;\n\n\t\t\t\t//Only suggest modifying functions that return void, Task or Task<T>.\n\t\t\t\tIType returnType = GetReturnType(ctx, currentFunction);\n\t\t\t\tif (returnType == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbool isVoid = false;\n\t\t\t\tIType resultType = null;\n\t\t\t\tswitch (returnType.FullName) {\n\t\t\t\t\tcase \"System.Void\":\n\t\t\t\t\t\tisVoid = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"System.Threading.Tasks.Task\":\n\t\t\t\t\t\tresultType = returnType.IsParameterized ? returnType.TypeArguments.FirstOrDefault() : null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar functionBody = currentFunction.GetChildByRole(Roles.Body);\n\t\t\t\tvar statements = GetStatements(functionBody).ToList();\n\t\t\t\tvar returnStatements = statements.OfType<ReturnStatement>().ToList();\n\n\t\t\t\tvar invocations = new List<InvocationExpression>();\n\t\t\t\tvar nextInChain = new Dictionary<InvocationExpression, InvocationExpression>();\n\t\t\t\tforeach (var invocation in currentFunction.Descendants.OfType<InvocationExpression>()) {\n\t\t\t\t\tif (invocation.Arguments.Count != 1)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar lambdaOrDelegate = invocation.Arguments.Single();\n\t\t\t\t\tStatement lambdaBody;\n\t\t\t\t\tif (lambdaOrDelegate is LambdaExpression) {\n\t\t\t\t\t\tlambdaBody = lambdaOrDelegate.GetChildByRole(LambdaExpression.BodyRole) as BlockStatement;\n\t\t\t\t\t\tif (lambdaBody == null) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (lambdaOrDelegate is AnonymousMethodExpression) {\n\t\t\t\t\t\tlambdaBody = lambdaOrDelegate.GetChildByRole(Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar resolveResult = ctx.Resolve(invocation) as MemberResolveResult;\n\t\t\t\t\tif (resolveResult == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (resolveResult.Member.FullName != \"System.Threading.Tasks.Task.ContinueWith\")\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar parentExpression = invocation.Parent as Expression;\n\t\t\t\t\tif (parentExpression != null) {\n\t\t\t\t\t\tvar mreParent = parentExpression as MemberReferenceExpression;\n\t\t\t\t\t\tif (mreParent == null || mreParent.MemberName != \"ContinueWith\") {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar parentInvocation = mreParent.Parent as InvocationExpression;\n\t\t\t\t\t\tif (parentInvocation == null || parentInvocation.Arguments.Count != 1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnextInChain[invocation] = parentInvocation;\n\t\t\t\t\t}\n\n\t\t\t\t\tinvocations.Add(invocation);\n\t\t\t\t}\n\n\t\t\t\tif (isVoid && invocations.Count == 0) {\n\t\t\t\t\t//Prevent functions like void Foo() {} from being accepted\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstring taskCompletionSourceIdentifier = null;\n\t\t\t\tInvocationExpression returnedContinuation = null;\n\n\t\t\t\tif (isVoid) {\n\t\t\t\t\tif (returnStatements.Any())\n\t\t\t\t\t\treturn;\n\t\t\t\t} else if (!isVoid) {\n\t\t\t\t\tif (returnStatements.Count() != 1)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tvar returnStatement = returnStatements.Single();\n\t\t\t\t\tif (functionBody.Statements.Last() != returnStatement)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tvar match = ReturnTaskCompletionSourcePattern.Match(returnStatement);\n\t\t\t\t\tif (match.Success) {\n\t\t\t\t\t\tvar taskCompletionSource = match.Get<IdentifierExpression>(\"target\").Single();\n\t\t\t\t\t\tvar taskCompletionSourceResolveResult = ctx.Resolve(taskCompletionSource);\n\n\t\t\t\t\t\t//Make sure the TaskCompletionSource is a local variable\n\t\t\t\t\t\tif (!(taskCompletionSourceResolveResult is LocalResolveResult) ||\n\t\t\t\t\t\t    taskCompletionSourceResolveResult.Type.FullName != \"System.Threading.Tasks.TaskCompletionSource\") {\n\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttaskCompletionSourceIdentifier = taskCompletionSource.Identifier;\n\n\t\t\t\t\t\tvar cfgBuilder = new ControlFlowGraphBuilder();\n\t\t\t\t\t\tvar cachedControlFlowGraphs = new Dictionary<BlockStatement, IList<ControlFlowNode>>();\n\n\t\t\t\t\t\t//Make sure there are no unsupported uses of the task completion source\n\t\t\t\t\t\tforeach (var identifier in functionBody.Descendants.OfType<Identifier>()) {\n\t\t\t\t\t\t\tif (identifier.Name != taskCompletionSourceIdentifier)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tvar statement = identifier.GetParent<Statement>();\n\t\t\t\t\t\t\tvar variableStatement = statement as VariableDeclarationStatement;\n\t\t\t\t\t\t\tif (variableStatement != null) {\n\t\t\t\t\t\t\t\tif (functionBody.Statements.First() != variableStatement || variableStatement.Variables.Count != 1) {\n\t\t\t\t\t\t\t\t\t//This may actually be valid, but it would add even more complexity to this action\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar initializer = variableStatement.Variables.First().Initializer as ObjectCreateExpression;\n\t\t\t\t\t\t\t\tif (initializer == null || initializer.Arguments.Count != 0 || !initializer.Initializer.IsNull) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar constructedType = ctx.ResolveType(initializer.Type);\n\t\t\t\t\t\t\t\tif (constructedType.FullName != \"System.Threading.Tasks.TaskCompletionSource\") {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (statement == returnStatement)\n\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\tif (identifier.Parent is MemberReferenceExpression) {\n\t\t\t\t\t\t\t\t//Right side of the member.\n\t\t\t\t\t\t\t\t//We don't care about this case since it's not a reference to the variable.\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//The method's taskCompletionSource can only be used on the left side of a member\n\t\t\t\t\t\t\t//reference expression (specifically tcs.SetResult).\n\t\t\t\t\t\t\tvar identifierExpressionParent = identifier.Parent as IdentifierExpression;\n\t\t\t\t\t\t\tif (identifierExpressionParent == null) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar memberReferenceExpression = identifierExpressionParent.Parent as MemberReferenceExpression;\n\t\t\t\t\t\t\tif (memberReferenceExpression == null) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (memberReferenceExpression.MemberName != \"SetResult\") {\n\t\t\t\t\t\t\t\t//Aside from the final return statement, the only member of task completion source\n\t\t\t\t\t\t\t\t//that can be used is SetResult.\n\t\t\t\t\t\t\t\t//Perhaps future versions could also include SetException and SetCancelled.\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//We found a SetResult -- we will now find out if it is in a proper context\n\t\t\t\t\t\t\tAstNode node = memberReferenceExpression;\n\t\t\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\t\t\tnode = node.Parent;\n\n\t\t\t\t\t\t\t\tif (node == null) {\n\t\t\t\t\t\t\t\t\t//Abort since this is unexpected (it should never happen)\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (node is MethodDeclaration) {\n\t\t\t\t\t\t\t\t\t//Ok -- tcs.SetResult is in method declaration\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (node is LambdaExpression || node is AnonymousMethodExpression) {\n\t\t\t\t\t\t\t\t\t//It's time to verify if the lambda is supported\n\t\t\t\t\t\t\t\t\tvar lambdaParent = node.Parent as InvocationExpression;\n\t\t\t\t\t\t\t\t\tif (lambdaParent == null || !invocations.Contains(lambdaParent)) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar containingContinueWith = node.Parent as InvocationExpression;\n\t\t\t\t\t\t\tif (containingContinueWith != null) {\n\t\t\t\t\t\t\t\tif (nextInChain.ContainsKey(containingContinueWith)) {\n\t\t\t\t\t\t\t\t\t//Unsupported: ContinueWith has a SetResult\n\t\t\t\t\t\t\t\t\t//but it's not the last in the chain\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar containingFunctionBlock = node is LambdaExpression ? (BlockStatement)node.GetChildByRole(LambdaExpression.BodyRole) : node.GetChildByRole(Roles.Body);\n\n\t\t\t\t\t\t\t//Finally, tcs.SetResult must be at the end of its method\n\t\t\t\t\t\t\tIList<ControlFlowNode> nodes;\n\t\t\t\t\t\t\tif (!cachedControlFlowGraphs.TryGetValue(containingFunctionBlock, out nodes)) {\n\t\t\t\t\t\t\t\tnodes = cfgBuilder.BuildControlFlowGraph(containingFunctionBlock, ctx.CancellationToken);\n\t\t\t\t\t\t\t\tcachedControlFlowGraphs[containingFunctionBlock] = nodes;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar setResultNode = nodes.FirstOrDefault(candidateNode => candidateNode.PreviousStatement == statement);\n\t\t\t\t\t\t\tif (setResultNode != null && HasReachableNonReturnNodes(setResultNode)) {\n\t\t\t\t\t\t\t\t//The only allowed outgoing nodes are return statements\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Not TaskCompletionSource-based\n\t\t\t\t\t\t//Perhaps it is return Task.ContinueWith(foo);\n\n\t\t\t\t\t\tif (!invocations.Any()) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar outerMostInvocations = new List<InvocationExpression>();\n\t\t\t\t\t\tInvocationExpression currentInvocation = invocations.First();\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\touterMostInvocations.Add(currentInvocation);\n\t\t\t\t\t\t} while (nextInChain.TryGetValue(currentInvocation, out currentInvocation));\n\n\t\t\t\t\t\tvar lastInvocation = outerMostInvocations.Last();\n\t\t\t\t\t\tif (returnStatement.Expression != lastInvocation) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Found return <1>.ContinueWith(<2>);\n\t\t\t\t\t\treturnedContinuation = lastInvocation;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//We do not support \"return expr\" in continuations\n\t\t\t\t//The only exception is when the outer method returns that continuation.\n\t\t\t\tinvocations.RemoveAll(invocation => invocation != returnedContinuation &&\n\t\t\t\t                      invocation.Arguments.First().Children.OfType<Statement>().First().DescendantNodesAndSelf(node => node is Statement).OfType<ReturnStatement>().Any(returnStatement => !returnStatement.Expression.IsNull));\n\n\t\t\t\tAddIssue(new CodeIssue(GetFunctionToken(currentFunction),\n\t\t\t\t         ctx.TranslateString(\"Function can be converted to C# 5-style async function\"),\n\t\t\t\t         ctx.TranslateString(\"Convert to C# 5-style async function\"),\n\t\t\t\t                            script => {\n\t\t\t\t\tAddOriginalNodeAnnotations(currentFunction);\n\t\t\t\t\tvar newFunction = currentFunction.Clone();\n\t\t\t\t\tRemoveOriginalNodeAnnotations(currentFunction);\n\n\t\t\t\t\t//Set async\n\t\t\t\t\tvar lambda = newFunction as LambdaExpression;\n\t\t\t\t\tif (lambda != null)\n\t\t\t\t\t\tlambda.IsAsync = true;\n\t\t\t\t\tvar anonymousMethod = newFunction as AnonymousMethodExpression;\n\t\t\t\t\tif (anonymousMethod != null)\n\t\t\t\t\t\tanonymousMethod.IsAsync = true;\n\t\t\t\t\tvar methodDeclaration = newFunction as MethodDeclaration;\n\t\t\t\t\tif (methodDeclaration != null)\n\t\t\t\t\t\tmethodDeclaration.Modifiers |= Modifiers.Async;\n\n\t\t\t\t\tTransformBody(invocations, isVoid, resultType != null, returnedContinuation, taskCompletionSourceIdentifier, newFunction.GetChildByRole(Roles.Body));\n\n\t\t\t\t\tscript.Replace(currentFunction, newFunction);\n\t\t\t\t\t}));\n\t\t\t}\n\n\t\t\tvoid TransformBody(List<InvocationExpression> validInvocations, bool isVoid, bool isParameterizedTask, InvocationExpression returnedContinuation, string taskCompletionSourceIdentifier, BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\tif (!isVoid) {\n\t\t\t\t\tif (returnedContinuation == null) {\n\t\t\t\t\t\t//Is TaskCompletionSource-based\n\t\t\t\t\t\tblockStatement.Statements.First().Remove(); //Remove task completion source declaration\n\t\t\t\t\t\tblockStatement.Statements.Last().Remove(); //Remove final return\n\t\t\t\t\t}\n\n\t\t\t\t\t//We use ToList() because we will be modifying the original collection\n\t\t\t\t\tforeach (var expressionStatement in blockStatement.Descendants.OfType<ExpressionStatement>().ToList()) {\n\t\t\t\t\t\tvar invocationExpression = expressionStatement.Expression as InvocationExpression;\n\t\t\t\t\t\tif (invocationExpression == null || invocationExpression.Arguments.Count != 1)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\tvar target = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\t\t\tif (target == null || target.MemberName != \"SetResult\") {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar targetExpression = target.Target as IdentifierExpression;\n\t\t\t\t\t\tif (targetExpression == null || targetExpression.Identifier != taskCompletionSourceIdentifier) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar returnedExpression = invocationExpression.Arguments.Single();\n\t\t\t\t\t\treturnedExpression.Remove();\n\n\t\t\t\t\t\tvar originalInvocation = (InvocationExpression) invocationExpression.Annotation<OriginalNodeAnnotation>().sourceNode;\n\t\t\t\t\t\tvar originalReturnedExpression = originalInvocation.Arguments.Single();\n\t\t\t\t\t\tvar argumentType = ctx.Resolve(originalReturnedExpression).Type;\n\n\t\t\t\t\t\tif (!isParameterizedTask) {\n\t\t\t\t\t\t\tvar parent = expressionStatement.Parent;\n\t\t\t\t\t\t\tvar resultIdentifier = CreateVariableName(blockStatement, \"result\");\n\n\t\t\t\t\t\t\tvar blockParent = parent as BlockStatement;\n\t\t\t\t\t\t\tvar resultDeclarationType = argumentType == SpecialType.NullType ? new PrimitiveType(\"object\") : CreateShortType(originalInvocation, argumentType);\n\t\t\t\t\t\t\tvar declaration = new VariableDeclarationStatement(resultDeclarationType, resultIdentifier, returnedExpression);\n\t\t\t\t\t\t\tif (blockParent == null) {\n\t\t\t\t\t\t\t\tvar newStatement = new BlockStatement();\n\t\t\t\t\t\t\t\tnewStatement.Add(declaration);\n\t\t\t\t\t\t\t\tnewStatement.Add(new ReturnStatement());\n\t\t\t\t\t\t\t\texpressionStatement.ReplaceWith(newStatement);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tblockParent.Statements.InsertAfter(expressionStatement, new ReturnStatement());\n\t\t\t\t\t\t\t\texpressionStatement.ReplaceWith(declaration);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar newStatement = new ReturnStatement(returnedExpression);\n\t\t\t\t\t\t\texpressionStatement.ReplaceWith(newStatement);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Find all instances of ContinueWith to replace and associated \n\t\t\t\tvar continuations = new List<Tuple<InvocationExpression, InvocationExpression, string>>();\n\t\t\t\tforeach (var invocation in blockStatement.Descendants.OfType<InvocationExpression>()) {\n\t\t\t\t\tif (invocation.Arguments.Count != 1)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar originalInvocation = (InvocationExpression) invocation.Annotation<OriginalNodeAnnotation>().sourceNode;\n\t\t\t\t\tif (!validInvocations.Contains(originalInvocation))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar lambda = invocation.Arguments.Single();\n\n\t\t\t\t\tstring associatedTaskName = null;\n\n\t\t\t\t\tvar lambdaParameters = lambda.GetChildrenByRole(Roles.Parameter).Select(p => p.Name).ToList();\n\t\t\t\t\tvar lambdaTaskParameterName = lambdaParameters.FirstOrDefault();\n\t\t\t\t\tif (lambdaTaskParameterName != null) {\n\t\t\t\t\t\tassociatedTaskName = lambdaTaskParameterName;\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinuations.Add(Tuple.Create(invocation, originalInvocation, associatedTaskName));\n\t\t\t\t}\n\n\t\t\t\tforeach (var continuationTuple in continuations) {\n\t\t\t\t\tstring taskName = continuationTuple.Item3 ?? \"task\";\n\t\t\t\t\tstring effectiveTaskName = CreateVariableName(blockStatement, taskName);\n\t\t\t\t\tstring resultName = CreateVariableName(blockStatement, taskName + \"Result\");\n\t\t\t\t\tvar continuation = continuationTuple.Item1;\n\t\t\t\t\tvar originalInvocation = continuationTuple.Item2;\n\n\t\t\t\t\tvar target = continuation.Target.GetChildByRole(Roles.TargetExpression).Detach();\n\t\t\t\t\tvar awaitedExpression = new UnaryOperatorExpression(UnaryOperatorType.Await, target);\n\t\t\t\t\tvar replacements = new List<Statement>();\n\t\t\t\t\tvar lambdaExpression = originalInvocation.Arguments.First();\n\t\t\t\t\tvar continuationLambdaResolveResult = (LambdaResolveResult) ctx.Resolve(lambdaExpression);\n\n\t\t\t\t\tif (!continuationLambdaResolveResult.HasParameterList)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Lambda has no parameter, so creating a variable for the argument is not needed\n\t\t\t\t\t\t// (since you can't use an argument that doesn't exist).\n\t\t\t\t\t\treplacements.Add(new ExpressionStatement(awaitedExpression));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Lambda has a parameter, which can either be a Task or a Task<T>.\n\n\t\t\t\t\t\tvar lambdaParameter = continuationLambdaResolveResult.Parameters[0];\n\t\t\t\t\t\tbool isTaskIdentifierUsed = lambdaExpression.Descendants.OfType<IdentifierExpression>().Any(identifier => {\n\t\t\t\t\t\t\tif (identifier.Identifier != lambdaParameter.Name)\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tvar identifierMre = identifier.Parent as MemberReferenceExpression;\n\t\t\t\t\t\t\treturn identifierMre == null || identifierMre.MemberName != \"Result\";\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tvar precedentTaskType = lambdaParameter.Type;\n\n\t\t\t\t\t\t//We might need to separate the task creation and awaiting\n\t\t\t\t\t\tif (isTaskIdentifierUsed) {\n\t\t\t\t\t\t\t//Create new task variable\n\t\t\t\t\t\t\tvar taskExpression = awaitedExpression.Expression;\n\t\t\t\t\t\t\ttaskExpression.Detach();\n\t\t\t\t\t\t\treplacements.Add(new VariableDeclarationStatement(CreateShortType(lambdaExpression, precedentTaskType),\n\t\t\t\t\t\t\t                                                  effectiveTaskName,\n\t\t\t\t\t\t\t                                                  taskExpression));\n\t\t\t\t\t\t\tawaitedExpression.Expression = new IdentifierExpression(effectiveTaskName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (precedentTaskType.IsParameterized) {\n\t\t\t\t\t\t\t//precedent is Task<T>\n\t\t\t\t\t\t\tvar precedentResultType = precedentTaskType.TypeArguments.First();\n\t\t\t\t\t\t\treplacements.Add(new VariableDeclarationStatement(CreateShortType(originalInvocation, precedentResultType), resultName, awaitedExpression));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//precedent is Task\n\t\t\t\t\t\t\treplacements.Add(awaitedExpression);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar parentStatement = continuation.GetParent<Statement>();\n\t\t\t\t\tvar grandParentStatement = parentStatement.Parent;\n\t\t\t\t\tvar block = grandParentStatement as BlockStatement;\n\t\t\t\t\tif (block == null) {\n\t\t\t\t\t\tblock = new BlockStatement();\n\t\t\t\t\t\tblock.Statements.AddRange(replacements);\n\t\t\t\t\t\tparentStatement.ReplaceWith(block);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach (var replacement in replacements) {\n\t\t\t\t\t\t\tblock.Statements.InsertBefore(parentStatement, replacement);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparentStatement.Remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tvar lambdaOrDelegate = continuation.Arguments.Single();\n\t\t\t\t\tStatement lambdaContent;\n\t\t\t\t\tif (lambdaOrDelegate is LambdaExpression) {\n\t\t\t\t\t\tlambdaContent = (Statement)lambdaOrDelegate.GetChildByRole(LambdaExpression.BodyRole);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlambdaContent = lambdaOrDelegate.GetChildByRole(Roles.Body);\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (var identifierExpression in lambdaContent.Descendants.OfType<IdentifierExpression>()) {\n\t\t\t\t\t\tif (continuationTuple.Item3 != identifierExpression.Identifier) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar memberReference = identifierExpression.Parent as MemberReferenceExpression;\n\n\t\t\t\t\t\tif (memberReference == null || memberReference.MemberName != \"Result\") {\n\t\t\t\t\t\t\tidentifierExpression.ReplaceWith(new IdentifierExpression(effectiveTaskName));\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmemberReference.ReplaceWith(new IdentifierExpression(resultName));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (lambdaContent is BlockStatement) {\n\t\t\t\t\t\tStatement previousStatement = replacements.Last();\n\t\t\t\t\t\tforeach (var statementInContinuation in lambdaContent.GetChildrenByRole(BlockStatement.StatementRole)) {\n\t\t\t\t\t\t\tstatementInContinuation.Detach();\n\t\t\t\t\t\t\tblock.Statements.InsertAfter(previousStatement, statementInContinuation);\n\t\t\t\t\t\t\tpreviousStatement = statementInContinuation;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlambdaContent.Detach();\n\t\t\t\t\t\tblock.Statements.InsertAfter(replacements.Last(), lambdaContent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAstType CreateShortType(AstNode node, IType type)\n\t\t\t{\n\t\t\t\treturn ctx.CreateTypeSystemAstBuilder(node).ConvertType(type);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic string CreateVariableName(AstNode currentRootNode, string proposedName) {\n\t\t\tvar identifiers = currentRootNode.Descendants.OfType<Identifier>()\n\t\t\t\t.Select(identifier => identifier.Name).Where(identifier => identifier.StartsWith(proposedName, StringComparison.InvariantCulture)).ToList();\n\t\t\tfor (int i = 0;; ++i) {\n\t\t\t\tstring name = proposedName + (i == 0 ? string.Empty : i.ToString());\n\t\t\t\tif (!identifiers.Contains(name)) {\n\t\t\t\t\treturn name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool HasReachableNonReturnNodes(ControlFlowNode firstNode)\n\t\t{\n\t\t\tvar visitedNodes = new List<ControlFlowNode>();\n\t\t\tvar nodesToVisit = new HashSet<ControlFlowNode>();\n\t\t\tnodesToVisit.Add(firstNode);\n\n\t\t\twhile (nodesToVisit.Any()) {\n\t\t\t\tvar node = nodesToVisit.First();\n\t\t\t\tnodesToVisit.Remove(node);\n\t\t\t\tvisitedNodes.Add(node);\n\n\t\t\t\tif (node.Type == ControlFlowNodeType.LoopCondition)\n\t\t\t\t\treturn true;\n\n\t\t\t\tvar nextStatement = node.NextStatement;\n\t\t\t\tif (nextStatement != null) {\n\t\t\t\t\tif (!(nextStatement is ReturnStatement ||\n\t\t\t\t\t    nextStatement is GotoStatement ||\n\t\t\t\t\t    nextStatement is GotoCaseStatement ||\n\t\t\t\t\t    nextStatement is GotoDefaultStatement ||\n\t\t\t\t\t    nextStatement is ContinueStatement ||\n\t\t\t\t\t    nextStatement is BreakStatement)) {\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic IType GetReturnType(BaseRefactoringContext context, AstNode currentFunction)\n\t\t{\n\t\t\tvar resolveResult = context.Resolve(currentFunction);\n\t\t\treturn resolveResult.IsError ? null : resolveResult.Type;\n\t\t}\n\n\t\tstatic IEnumerable<Statement> GetStatements(Statement statement)\n\t\t{\n\t\t\treturn statement.DescendantNodesAndSelf(stmt => stmt is Statement).OfType<Statement>();\n\t\t}\n\n\t\tstatic AstNode GetFunctionToken(AstNode currentFunction)\n\t\t{\n\t\t\treturn (AstNode)currentFunction.GetChildByRole(Roles.Identifier) ??\n\t\t\tcurrentFunction.GetChildByRole(LambdaExpression.ArrowRole) ??\n\t\t\tcurrentFunction.GetChildByRole(AnonymousMethodExpression.DelegateKeywordRole);\n\t\t}\n\n\t\tstatic bool IsAsync(AstNode currentFunction)\n\t\t{\n\t\t\tvar method = currentFunction as MethodDeclaration;\n\t\t\tif (method != null) {\n\t\t\t\treturn method.HasModifier(Modifiers.Async);\n\t\t\t}\n\t\t\treturn !currentFunction.GetChildByRole(LambdaExpression.AsyncModifierRole).IsNull;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DisposeMethodInNonIDisposableTypeIssue.cs",
    "content": "// DisposeMethodInNonIDisposableTypeIssue.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Type does not implement IDisposable despite having a Dispose method\",\n//\t                  Description=\"This type declares a method named Dispose, but it does not implement the System.IDisposable interface\",\n//\t                  Category=IssueCategories.CodeQualityIssues,\n//\t                  Severity=Severity.Warning)]\n\tpublic class DisposeMethodInNonIDisposableTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tprivate class GatherVisitor : GatherVisitorBase<DisposeMethodInNonIDisposableTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context)\n\t\t\t\t: base(context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tstatic bool IsDisposeMethod(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!methodDeclaration.PrivateImplementationType.IsNull) {\n\t\t\t\t\t//Ignore explictly implemented methods\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (methodDeclaration.Name != \"Dispose\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (methodDeclaration.Parameters.Count != 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (methodDeclaration.HasModifier(Modifiers.Static)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar primitiveType = methodDeclaration.ReturnType as PrimitiveType;\n\t\t\t\tif (primitiveType == null || primitiveType.KnownTypeCode != KnownTypeCode.Void) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tif (typeDeclaration.ClassType == ClassType.Enum) {\n\t\t\t\t\t//enums have no methods\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar resolve = ctx.Resolve(typeDeclaration) as TypeResolveResult;\n\t\t\t\tif (resolve != null && Implements(resolve.Type, \"System.IDisposable\")) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbase.VisitTypeDeclaration(typeDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\tif (!IsDisposeMethod(methodDeclaration)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar type = methodDeclaration.GetParent<TypeDeclaration>();\n\t\t\t\tif (type == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tAddIssue(new CodeIssue(methodDeclaration.NameToken,\n\t\t\t\t         ctx.TranslateString(\"Type does not implement IDisposable despite having a Dispose method\"),\n\t\t\t\t         ctx.TranslateString(\"Implement IDisposable\"),\n\t\t\t\t\tscript => Fix(script, methodDeclaration, type)));\n\t\t\t}\n\n\t\t\tstatic IEnumerable<MethodDeclaration> DisposeMethods(TypeDeclaration newTypeDeclaration)\n\t\t\t{\n\t\t\t\treturn newTypeDeclaration.Members\n\t\t\t\t\t.OfType<MethodDeclaration>()\n\t\t\t\t\t\t.Where(IsDisposeMethod);\n\t\t\t}\n\n\t\t\tvoid Fix(Script script, MethodDeclaration methodDeclaration, TypeDeclaration typeDeclaration)\n\t\t\t{\n\t\t\t\tvar newTypeDeclaration = (TypeDeclaration) typeDeclaration.Clone();\n\n\t\t\t\tvar resolver = ctx.GetResolverStateAfter(typeDeclaration.LBraceToken);\n\n\t\t\t\tvar typeResolve = resolver.ResolveSimpleName(\"IDisposable\", new List<IType>()) as TypeResolveResult;\n\t\t\t\tbool canShortenIDisposable = typeResolve != null && typeResolve.Type.FullName == \"System.IDisposable\";\n\n\t\t\t\tstring interfaceName = (canShortenIDisposable ? string.Empty : \"System.\") + \"IDisposable\";\n\n\t\t\t\tnewTypeDeclaration.BaseTypes.Add(new SimpleType(interfaceName));\n\n\t\t\t\tforeach (var method in DisposeMethods(newTypeDeclaration).ToList()) {\n\t\t\t\t\tif (typeDeclaration.ClassType == ClassType.Interface) {\n\t\t\t\t\t\tmethod.Remove();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmethod.Modifiers &= ~Modifiers.Private;\n\t\t\t\t\t\tmethod.Modifiers &= ~Modifiers.Protected;\n\t\t\t\t\t\tmethod.Modifiers &= ~Modifiers.Internal;\n\t\t\t\t\t\tmethod.Modifiers |= Modifiers.Public;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (typeDeclaration.ClassType == ClassType.Interface) {\n\t\t\t\t\tvar disposeMember = ((MemberResolveResult)ctx.Resolve(methodDeclaration)).Member;\n\t\t\t\t\tscript.DoGlobalOperationOn(new List<IEntity>() { disposeMember }, (nCtx, nScript, nodes) => {\n\t\t\t\t\t\tList<Tuple<AstType, AstType>> pendingChanges = new List<Tuple<AstType, AstType>>();\n\t\t\t\t\t\tforeach (var node in nodes)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar method = node as MethodDeclaration;\n\t\t\t\t\t\t\tif (method != null && !method.PrivateImplementationType.IsNull) {\n\t\t\t\t\t\t\t\tvar nResolver = ctx.GetResolverStateAfter(typeDeclaration.LBraceToken);\n\n\t\t\t\t\t\t\t\tvar nTypeResolve = nResolver.ResolveSimpleName(\"IDisposable\", new List<IType>()) as TypeResolveResult;\n\t\t\t\t\t\t\t\tbool nCanShortenIDisposable = nTypeResolve != null && nTypeResolve.Type.FullName == \"System.IDisposable\";\n\n\t\t\t\t\t\t\t\tstring nInterfaceName = (nCanShortenIDisposable ? string.Empty : \"System.\") + \"IDisposable\";\n\n\t\t\t\t\t\t\t\tpendingChanges.Add(Tuple.Create(method.PrivateImplementationType, AstType.Create(nInterfaceName)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach (var change in pendingChanges) {\n\t\t\t\t\t\t\tnScript.Replace(change.Item1, change.Item2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, \"Fix explicitly implemented members\");\n\t\t\t\t}\n\n\t\t\t\tscript.Replace(typeDeclaration, newTypeDeclaration);\n\t\t\t}\n\n\t\t\tstatic bool Implements(IType type, string fullName)\n\t\t\t{\n\t\t\t\treturn type.GetAllBaseTypes ().Any (baseType => baseType.FullName == fullName);\n\t\t\t}\n\n\t\t\t//Ignore entities that are not methods -- don't visit children\n\t\t\tpublic override void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitEventDeclaration(EventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DontUseLinqWhenItsVerboseAndInefficientIssue.cs",
    "content": "// DontUseLinqWhenItsVerboseAndInefficientIssue.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Use of Linq methods when there's a better alternative\",\n//\t                  Description=\"Detects usage of Linq when there's a simpler and faster alternative\",\n//\t                  Category=IssueCategories.CodeQualityIssues,\n//\t                  Severity=Severity.Warning)]\n\tpublic class DontUseLinqWhenItsVerboseAndInefficientIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tclass LinqMethod {\n\t\t\tinternal string FullName;\n\t\t\tinternal bool IsLast;\n\t\t\t/// <summary>\n\t\t\t/// Indicates that the method should be considered bad even when used alone.\n\t\t\t/// </summary>\n\t\t\tinternal bool IsPoorStyleAlone;\n\t\t\t/// <summary>\n\t\t\t/// The number of parameters the definition has.\n\t\t\t/// </summary>\n\t\t\tinternal int ParameterCount;\n\t\t}\n\n\t\tstatic readonly List<LinqMethod> LinqMethods = new List<LinqMethod> {\n\t\t\tnew LinqMethod { FullName = \"System.Linq.Enumerable.First\", IsLast = true, ParameterCount = 1, IsPoorStyleAlone = true },\n\t\t\tnew LinqMethod { FullName = \"System.Linq.Enumerable.Last\", IsLast = true, ParameterCount = 1 },\n\t\t\tnew LinqMethod { FullName = \"System.Linq.Enumerable.ElementAt\", IsLast = true, ParameterCount = 2, IsPoorStyleAlone = true },\n\t\t\tnew LinqMethod { FullName = \"System.Linq.Enumerable.Count\", IsLast = true, ParameterCount = 1, IsPoorStyleAlone = true },\n\t\t\tnew LinqMethod { FullName = \"System.Linq.Enumerable.Any\", IsLast = true, ParameterCount = 1 },\n\t\t\tnew LinqMethod { FullName = \"System.Linq.Enumerable.Skip\", ParameterCount = 2 },\n\t\t\t//Take(n) is problematic -- it has a weird behavior if n > Count()\n\t\t\t//new LinqMethod { FullName = \"System.Linq.Enumerable.Take\", ParameterCount = 2 },\n\t\t\tnew LinqMethod { FullName = \"System.Linq.Enumerable.Reverse\", ParameterCount = 1 }\n\t\t};\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<DontUseLinqWhenItsVerboseAndInefficientIssue>\n\t\t{\n\t\t\tinternal GatherVisitor(BaseRefactoringContext ctx) : base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tInvocationExpression outerInvocationExpression = invocationExpression;\n\t\t\t\t//Note the invocations are in reverse order, so x.Foo().Bar() will have [0] be the Bar() and [1] be the Foo()\n\t\t\t\tList<InvocationExpression> invocations = new List<InvocationExpression>();\n\t\t\t\tLinqMethod outerMethod = null;\n\t\t\t\tExpression target = null;\n\n\t\t\t\tfor (;;) {\n\t\t\t\t\tvar resolveResult = ctx.Resolve(invocationExpression) as MemberResolveResult;\n\t\t\t\t\tif (resolveResult == null || !(resolveResult.Member is IMethod)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar method = LinqMethods.FirstOrDefault(candidate => candidate.FullName == resolveResult.Member.FullName &&\n\t\t\t\t\t                                        candidate.ParameterCount == ((IMethod) resolveResult.Member.MemberDefinition).Parameters.Count);\n\t\t\t\t\tif (method == null || (invocations.Any() && method.IsLast)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar mre = invocationExpression.Target as MemberReferenceExpression;\n\t\t\t\t\tif (mre == null) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (outerMethod == null) {\n\t\t\t\t\t\touterMethod = method;\n\t\t\t\t\t}\n\t\t\t\t\tinvocations.Add(invocationExpression);\n\n\t\t\t\t\ttarget = mre.Target;\n\n\t\t\t\t\tvar newInvocation = target as InvocationExpression;\n\t\t\t\t\tif (newInvocation == null) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tinvocationExpression = newInvocation;\n\t\t\t\t}\n\n\t\t\t\tif (target == null) {\n\t\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!outerMethod.IsPoorStyleAlone && invocations.Count == 1) {\n\t\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar currentTypeDeclaration = outerInvocationExpression.GetParent<TypeDeclaration>();\n\t\t\t\tvar currentTypeResolveResult = ctx.Resolve(currentTypeDeclaration) as TypeResolveResult;\n\t\t\t\tif (currentTypeResolveResult == null) {\n\t\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar currentTypeDefinition = currentTypeResolveResult.Type.GetDefinition();\n\n\t\t\t\tvar targetResolveResult = ctx.Resolve(target);\n\t\t\t\tif (!CanIndex(currentTypeDefinition, targetResolveResult)) {\n\t\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstring countPropertyName = GetCountProperty(currentTypeDefinition, targetResolveResult);\n\n\t\t\t\tstring lastInvocationName = ((MemberReferenceExpression)invocations[0].Target).MemberName;\n\n\t\t\t\tbool endsReversed = invocations.Count(invocation => ((MemberReferenceExpression)invocation.Target).MemberName == \"Reverse\") % 2 != 0;\n\t\t\t\tbool requiresCount = lastInvocationName == \"Count\" || lastInvocationName == \"Any\" ||\n\t\t\t\t\t(endsReversed ? lastInvocationName == \"First\" || lastInvocationName == \"ElementAt\" : lastInvocationName == \"Last\");\n\n\t\t\t\tif (countPropertyName == null && requiresCount) {\n\t\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tAddIssue(new CodeIssue(invocations.Last().LParToken.StartLocation,\n\t\t\t\t                       invocations.First().RParToken.EndLocation,\n\t\t\t\t                       ctx.TranslateString(\"Use of Linq method when there's a better alternative\"),\n\t\t\t\t                       ctx.TranslateString(\"Replace method by simpler version\"),\n\t\t\t\t                       script => {\n\n\t\t\t\t\tExpression startOffset = null;\n\t\t\t\t\tExpression endOffset = null;\n\n\t\t\t\t\tbool reversed = false;\n\t\t\t\t\tforeach (var invocation in invocations.AsEnumerable().Reverse()) {\n\t\t\t\t\t\tstring invocationName = ((MemberReferenceExpression)invocation.Target).MemberName;\n\n\t\t\t\t\t\tswitch(invocationName) {\n\t\t\t\t\t\t\tcase \"Skip\":\n\t\t\t\t\t\t\t\tExpression offset = reversed ? endOffset : startOffset;\n\t\t\t\t\t\t\t\tif (offset == null)\n\t\t\t\t\t\t\t\t\toffset = invocation.Arguments.Last().Clone();\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\toffset = new BinaryOperatorExpression(offset,\n\t\t\t\t\t\t\t\t\t                                      BinaryOperatorType.Add,\n\t\t\t\t\t\t\t\t\t                                      invocation.Arguments.Last().Clone());\n\n\t\t\t\t\t\t\t\tif (reversed)\n\t\t\t\t\t\t\t\t\tendOffset = offset;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tstartOffset = offset;\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"Reverse\":\n\t\t\t\t\t\t\t\treversed = !reversed;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"First\":\n\t\t\t\t\t\t\tcase \"ElementAt\":\n\t\t\t\t\t\t\tcase \"Last\":\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbool fromEnd = (invocationName == \"Last\") ^ reversed;\n\t\t\t\t\t\t\t\tExpression index = invocationName == \"ElementAt\" ? invocation.Arguments.Last().Clone() : null;\n\t\t\t\t\t\t\t\tExpression baseOffset = fromEnd ? endOffset : startOffset;\n\t\t\t\t\t\t\t\t//Our indexWithOffset is baseOffset + index\n\t\t\t\t\t\t\t\t//A baseOffset/index of null is considered \"0\".\n\n\t\t\t\t\t\t\t\tExpression indexWithOffset = baseOffset == null ? index :\n\t\t\t\t\t\t\t\t\tindex == null ? baseOffset :\n\t\t\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(baseOffset, BinaryOperatorType.Add, index);\n\n\t\t\t\t\t\t\t\tExpression indexerExpression = indexWithOffset;\n\t\t\t\t\t\t\t\tif (fromEnd) {\n\t\t\t\t\t\t\t\t\tvar endExpression = new BinaryOperatorExpression(new MemberReferenceExpression(target.Clone(), countPropertyName),\n\t\t\t\t\t\t\t\t\t                                                 BinaryOperatorType.Subtract,\n\t\t\t\t\t\t\t\t\t                                                 new PrimitiveExpression(1));\n\t\t\t\t\t\t\t\t\tif (indexerExpression == null) {\n\t\t\t\t\t\t\t\t\t\tindexerExpression = endExpression;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tindexerExpression = new BinaryOperatorExpression(endExpression,\n\t\t\t\t\t\t\t\t\t\t                                                 BinaryOperatorType.Subtract,\n\t\t\t\t\t\t\t\t\t\t                                                 new ParenthesizedExpression(indexerExpression));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tindexerExpression = indexerExpression ?? new PrimitiveExpression(0);\n\n\t\t\t\t\t\t\t\tvar newExpression = new IndexerExpression(target.Clone(),\n\t\t\t\t\t\t\t\t                                          indexerExpression);\n\n\t\t\t\t\t\t\t\tscript.Replace(outerInvocationExpression, newExpression);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase \"Count\":\n\t\t\t\t\t\t\tcase \"Any\":\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tExpression takenMembers;\n\t\t\t\t\t\t\t\tif (startOffset == null) {\n\t\t\t\t\t\t\t\t\ttakenMembers = endOffset;\n\t\t\t\t\t\t\t\t} else if (endOffset == null) {\n\t\t\t\t\t\t\t\t\ttakenMembers = startOffset;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttakenMembers = new BinaryOperatorExpression(startOffset,\n\t\t\t\t\t\t\t\t\t                                            BinaryOperatorType.Add,\n\t\t\t\t\t\t\t\t\t                                            endOffset);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar countExpression = new MemberReferenceExpression(target.Clone(), countPropertyName);\n\n\t\t\t\t\t\t\t\tExpression newExpression;\n\t\t\t\t\t\t\t\tif (invocationName == \"Count\") {\n\t\t\t\t\t\t\t\t\tif (takenMembers == null)\n\t\t\t\t\t\t\t\t\t\tnewExpression = countExpression;\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tnewExpression = new BinaryOperatorExpression(countExpression,\n\t\t\t\t\t\t\t\t\t\t                                             BinaryOperatorType.Subtract,\n\t\t\t\t\t\t\t\t\t\t                                             new ParenthesizedExpression(takenMembers));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewExpression = new BinaryOperatorExpression(countExpression,\n\t\t\t\t\t\t\t\t\t                                             BinaryOperatorType.GreaterThan,\n\t\t\t\t\t\t\t\t\t                                             new ParenthesizedExpression(takenMembers));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tscript.Replace(outerInvocationExpression, newExpression);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}));\n\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\t\t\t}\n\n\t\t\tbool CanIndex(ITypeDefinition currentTypeDefinition, ResolveResult targetResolveResult)\n\t\t\t{\n\t\t\t\tif (targetResolveResult.Type is ArrayType) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar memberLookup = new MemberLookup(currentTypeDefinition, ctx.Compilation.MainAssembly);\n\t\t\t\tvar indexers = memberLookup.LookupIndexers(targetResolveResult).ToList();\n\n\t\t\t\treturn indexers.SelectMany(methodList => methodList).Any(\n\t\t\t\t\tmember => ((IProperty)member).CanGet && ((IProperty)member).Getter.Parameters.Count == 1);\n\t\t\t}\n\n\t\t\tstring GetCountProperty(ITypeDefinition currentTypeDefinition, ResolveResult targetResolveResult)\n\t\t\t{\n\t\t\t\tvar memberLookup = new MemberLookup(currentTypeDefinition, ctx.Compilation.MainAssembly);\n\n\t\t\t\tstring countProperty = TryProperty(memberLookup, targetResolveResult, \"Count\");\n\t\t\t\tif (countProperty != null) {\n\t\t\t\t\treturn countProperty;\n\t\t\t\t}\n\n\t\t\t\treturn TryProperty(memberLookup, targetResolveResult, \"Length\");\n\t\t\t}\n\n\t\t\tstring TryProperty(MemberLookup memberLookup, ResolveResult targetResolveResult, string name)\n\t\t\t{\n\t\t\t\tvar countResolveResult = memberLookup.Lookup(targetResolveResult, name, EmptyList<IType>.Instance, false);\n\t\t\t\tvar countPropertyResolveResult = countResolveResult as MemberResolveResult;\n\t\t\t\tif (countPropertyResolveResult == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tvar property = countPropertyResolveResult.Member as IProperty;\n\t\t\t\tif (property == null || !property.CanGet) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/DuplicatedLinqToListOrArrayIssue.cs",
    "content": "// \n// DuplicatedLinqToListOrArrayIssue.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription (\"Duplicated ToList() or ToArray() call\",\n//\t                   Description = \"Duplicated call to ToList() or ToArray()\",\n//\t                   Category = IssueCategories.RedundanciesInCode,\n//\t                   Severity = Severity.Warning)]\n\tpublic class DuplicatedLinqToListOrArrayIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tconst string MemberTarget = \"target\";\n\t\tconst string MemberReference = \"member-reference\";\n\n\t\tstatic readonly InvocationExpression NoArgumentPattern = new InvocationExpression {\n\t\t\tTarget = new MemberReferenceExpression {\n\t\t\t\tTarget = new AnyNode(MemberTarget),\n\t\t\t\tMemberName = Pattern.AnyString\n\t\t\t}.WithName(MemberReference)\n\t\t};\n\n\t\tstatic readonly string[] RelevantMethods = { \"ToArray\", \"ToList\" };\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<DuplicatedLinqToListOrArrayIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tint matches = 0;\n\t\t\t\tExpression currentExpression = invocationExpression;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tvar match = NoArgumentPattern.Match(WithoutParenthesis(currentExpression));\n\t\t\t\t\tif (!match.Success) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!RelevantMethods.Contains(match.Get<MemberReferenceExpression>(MemberReference).Single().MemberName)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t++matches;\n\t\t\t\t\tcurrentExpression = match.Get<Expression>(MemberTarget).Single();\n\t\t\t\t}\n\n\t\t\t\tif (matches >= 2) {\n\t\t\t\t\tAddIssue(new CodeIssue(currentExpression.EndLocation,\n\t\t\t\t\t         invocationExpression.EndLocation,\n\t\t\t\t\t         ctx.TranslateString(\"Redundant Linq method invocations\"),\n\t\t\t\t\t         ctx.TranslateString(\"Remove redundant method invocations\"),\n\t\t\t\t\t         script => {\n\n\t\t\t\t\t\tstring lastInvocation = ((MemberReferenceExpression)invocationExpression.Target).MemberName;\n\t\t\t\t\t\tvar newMemberReference = new MemberReferenceExpression(currentExpression.Clone(),\n\t\t\t\t\t\t                                                       lastInvocation);\n\t\t\t\t\t\tvar newInvocation = new InvocationExpression(newMemberReference);\n\n\t\t\t\t\t\tscript.Replace(invocationExpression, newInvocation);\n\n\t\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\t//Visit the children\n\t\t\t\t//We need to make sure currentExpression != invocationExpression\n\t\t\t\t//otherwise we get an infinite loop\n\t\t\t\tvar expressionToVisit = currentExpression == invocationExpression ?\n\t\t\t\t\tinvocationExpression.Target : currentExpression;\n\t\t\t\texpressionToVisit.AcceptVisitor(this);\n\t\t\t}\n\n\t\t\tstatic Expression WithoutParenthesis(Expression expr) {\n\t\t\t\tParenthesizedExpression parenthesized;\n\t\t\t\twhile ((parenthesized = expr as ParenthesizedExpression) != null) {\n\t\t\t\t\texpr = parenthesized.Expression;\n\t\t\t\t}\n\t\t\t\treturn expr;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/ExceptionRethrowIssue.cs",
    "content": "//\n// ExceptionRethrowIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"A throw statement throws the caught exception by passing it explicitly\",\n//\t                  Description = \"Finds throws that throws the caught exception and therefore should be empty.\",\n//\t                  Category = IssueCategories.CodeQualityIssues,\n//\t                  Severity = Severity.Warning,\n//                      AnalysisDisableKeyword = \"PossibleIntendedRethrow\")]\n\tpublic class ExceptionRethrowIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<ExceptionRethrowIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitCatchClause(CatchClause catchClause)\n\t\t\t{\n\t\t\t\tbase.VisitCatchClause(catchClause);\n\t\t\t\tvar exceptionResolveResult = ctx.Resolve(catchClause.VariableNameToken) as LocalResolveResult;\n\t\t\t\tif (exceptionResolveResult == null)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar catchVisitor = new CatchClauseVisitor(ctx, exceptionResolveResult.Variable);\n\t\t\t\tcatchClause.Body.AcceptVisitor(catchVisitor);\n\n\t\t\t\tforeach (var throwStatement in catchVisitor.OffendingThrows) {\n\t\t\t\t\tvar localThrowStatement = throwStatement;\n\t\t\t\t\tvar title = ctx.TranslateString(\"The exception is rethrown with explicit usage of the variable\");\n\t\t\t\t\tvar action = new CodeAction(ctx.TranslateString(\"Change to 'throw;'\"), script => {\n\t\t\t\t\t\tscript.Replace(localThrowStatement, new ThrowStatement());\n\t\t\t\t\t}, catchClause);\n\t\t\t\t\tAddIssue(new CodeIssue(localThrowStatement, title, action));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass CatchClauseVisitor : DepthFirstAstVisitor\n\t\t{\n\t\t\tBaseRefactoringContext ctx;\n\n\t\t\tIVariable parameter;\n\n\t\t\tbool variableWritten = false;\n\n\t\t\tpublic CatchClauseVisitor(BaseRefactoringContext context, IVariable parameter)\n\t\t\t{\n\t\t\t\tctx = context;\n\t\t\t\tthis.parameter = parameter;\n\t\t\t\tOffendingThrows = new List<ThrowStatement>();\n\t\t\t}\n\n\t\t\tpublic IList<ThrowStatement> OffendingThrows { get; private set; }\n\n\t\t\tvoid HandlePotentialWrite (Expression expression)\n\t\t\t{\n\t\t\t\tvar variableResolveResult = ctx.Resolve(expression) as LocalResolveResult;\n\t\t\t\tif (variableResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvariableWritten |= variableResolveResult.Equals(parameter);\n\t\t\t}\n\n\t\t\tpublic override void VisitAssignmentExpression(AssignmentExpression assignmentExpression)\n\t\t\t{\n\t\t\t\tbase.VisitAssignmentExpression(assignmentExpression);\n\n\t\t\t\tvar variableResolveResult = ctx.Resolve(assignmentExpression.Left) as LocalResolveResult;\n\t\t\t\tif (variableResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tvariableWritten |= variableResolveResult.Variable.Equals(parameter);\n\t\t\t}\n\n\t\t\tpublic override void VisitDirectionExpression(DirectionExpression directionExpression)\n\t\t\t{\n\t\t\t\tbase.VisitDirectionExpression(directionExpression);\n\n\t\t\t\tHandlePotentialWrite(directionExpression);\n\t\t\t}\n\n\t\t\tpublic override void VisitThrowStatement(ThrowStatement throwStatement)\n\t\t\t{\n\t\t\t\tbase.VisitThrowStatement(throwStatement);\n\n\t\t\t\tif (variableWritten)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar argumentResolveResult = ctx.Resolve(throwStatement.Expression) as LocalResolveResult;\n\t\t\t\tif (argumentResolveResult == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (parameter.Equals(argumentResolveResult.Variable))\n\t\t\t\t\tOffendingThrows.Add(throwStatement);\n\t\t\t}\n\t\t}\n\t\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/ExplicitConversionInForEachIssue.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Incorrect element type in foreach over generic collection\",\n//\t                  Description= \"Detects hidden explicit conversions in foreach loops.\",\n//\t                  Category = IssueCategories.CodeQualityIssues,\n//\t                  Severity = Severity.Warning)]\n\tpublic class ExplicitConversionInForEachIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<ExplicitConversionInForEachIssue>\n\t\t{\n\t\t\tCSharpConversions conversions;\n\t\t\t\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx) : base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitForeachStatement(ForeachStatement foreachStatement)\n\t\t\t{\n\t\t\t\tbase.VisitForeachStatement(foreachStatement);\n\t\t\t\tvar rr = ctx.Resolve(foreachStatement) as ForEachResolveResult;\n\t\t\t\tif (rr == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (rr.ElementType.Kind == TypeKind.Unknown || rr.ElementVariable.Type.Kind == TypeKind.Unknown)\n\t\t\t\t\treturn;\n\t\t\t\tif (ReflectionHelper.GetTypeCode(rr.ElementType) == TypeCode.Object)\n\t\t\t\t\treturn;\n\t\t\t\tif (conversions == null) {\n\t\t\t\t\tconversions = CSharpConversions.Get(ctx.Compilation);\n\t\t\t\t}\n\t\t\t\tConversion c = conversions.ImplicitConversion(rr.ElementType, rr.ElementVariable.Type);\n\t\t\t\tif (c.IsValid)\n\t\t\t\t\treturn;\n\t\t\t\tvar csResolver = ctx.GetResolverStateBefore(foreachStatement);\n\t\t\t\tvar builder = new TypeSystemAstBuilder(csResolver);\n\t\t\t\tAstType elementType = builder.ConvertType(rr.ElementType);\n\t\t\t\tAstType variableType = foreachStatement.VariableType;\n\t\t\t\tstring issueText = ctx.TranslateString(\"Collection element type '{0}' is not implicitly convertible to '{1}'\");\n\t\t\t\tstring fixText = ctx.TranslateString(\"Use type '{0}'\");\n\t\t\t\tAddIssue(new CodeIssue(variableType, string.Format(issueText, elementType.ToString(), variableType.ToString()),\n\t\t\t\t         new CodeAction(\n\t\t\t\t\t\t\t\tstring.Format(fixText, elementType.ToString()),\n\t\t\t\t\t\t\t\tscript => script.Replace(variableType, elementType),\n\t\t\t\t\t\tforeachStatement)));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/IncorrectCallToObjectGetHashCodeIssue.cs",
    "content": "//\n// IncorrectCallToObjectGetHashCodeIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Call resolves to Object.GetHashCode, which is reference based\",\n//\t                   Description = \"Finds calls to Object.GetHashCode inside overridden GetHashCode.\",\n//\t                   Category = IssueCategories.CodeQualityIssues,\n//\t                   Severity = Severity.Warning,\n//                       AnalysisDisableKeyword = \"BaseObjectGetHashCodeCallInGetHashCode\")]\n\tpublic class IncorrectCallToObjectGetHashCodeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<IncorrectCallToObjectGetHashCodeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitMethodDeclaration(MethodDeclaration methodDeclaration)\n\t\t\t{\n\t\t\t\t// Check that this declaration is a GetHashCode override, _then_ continue traversing\n\n\t\t\t\tif (methodDeclaration.Name != \"GetHashCode\") {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!methodDeclaration.Modifiers.HasFlag(Modifiers.Override)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbase.VisitMethodDeclaration(methodDeclaration);\n\t\t\t}\n\n\t\t\tpublic override void VisitInvocationExpression(InvocationExpression invocationExpression)\n\t\t\t{\n\t\t\t\tbase.VisitInvocationExpression(invocationExpression);\n\n\t\t\t\tvar resolveResult = ctx.Resolve(invocationExpression) as InvocationResolveResult;\n\t\t\t\tif (resolveResult == null || !(resolveResult.TargetResult is ThisResolveResult) || resolveResult.Member.Name != \"GetHashCode\" ||\n\t\t\t\t    !resolveResult.Member.DeclaringTypeDefinition.IsKnownType(KnownTypeCode.Object)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tAddIssue(new CodeIssue(invocationExpression, ctx.TranslateString(\"Call resolves to Object.GetHashCode, which is reference based\")));\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantBlockInDifferentBranchesIssue.cs",
    "content": "﻿// RedundantBlockInDifferentBranchesIssue.cs\n//\n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"RedundantBlockInDifferentBranches\",\n//\t                  Description = \"Blocks in if/else can be simplified to any of the branches if they have the same block.\",\n//\t                  Category = IssueCategories.RedundanciesInCode,\n//\t                  Severity = Severity.Hint,\n//\t                  AnalysisDisableKeyword = \"RedundantBlockInDifferentBranches\")]\n\tpublic class RedundantBlockInDifferentBranchesIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\t\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context, this);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantBlockInDifferentBranchesIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx, RedundantBlockInDifferentBranchesIssue issueProvider) : base (ctx, issueProvider)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tstatic readonly AstNode pattern = new Choice{\n\t\t\t\tnew IfElseStatement(\n\t\t\t\t\tnew AnyNode(\"c\"), \n\t\t\t\t\tnew AnyNode(\"s\"), \n\t\t\t\t\tnew BlockStatement{new Backreference(\"s\")}),\n\t\t\t\tnew IfElseStatement(\n\t\t\t\t\tnew AnyNode(\"c\"), \n\t\t\t\t\tnew AnyNode(\"s\"), \n\t\t\t\t\tnew Backreference(\"s\")),\n\t\t\t\tnew IfElseStatement(\n\t\t\t\t\tnew AnyNode(\"c\"), \n\t\t\t\t\tnew BlockStatement{new AnyNode(\"s\")}, \n\t\t\t\t\tnew Backreference(\"s\"))\n\t\t\t};\n\n\t\t\tbool IsSafeExpression(Expression expression, BaseRefactoringContext context)\n\t\t\t{\n\t\t\t\tvar components = expression.DescendantsAndSelf;\n\t\t\t\tforeach (var c in components) {\n\t\t\t\t\tif (c is AssignmentExpression)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\telse if (c is UnaryOperatorExpression) {\n\t\t\t\t\t\tvar ope = ((UnaryOperatorExpression)c).Operator;\n\t\t\t\t\t\tif (ope == UnaryOperatorType.Decrement || ope == UnaryOperatorType.Increment \n\t\t\t\t\t\t\t|| ope == UnaryOperatorType.PostDecrement || ope == UnaryOperatorType.PostIncrement)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if (c is IdentifierExpression) {\n\t\t\t\t\t\tvar result = context.Resolve(c);\n\t\t\t\t\t\tif (result.IsError)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif (!(result is LocalResolveResult))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif ((((LocalResolveResult)result).IsParameter))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\t\t\t\tvar m = pattern.Match(ifElseStatement);\n\t\t\t\t\n\t\t\t\tif (!m.Success)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!IsSafeExpression(ifElseStatement.Condition, ctx))\n\t\t\t\t\treturn;\n\t\t\t\n\t\t\t\tAddIssue(new CodeIssue(ifElseStatement.ElseToken, ctx.TranslateString(\"Blocks in if/else or switch branches can be simplified to any of the branches if they have the same block.\"))\n\t\t\t\t{ IssueMarker = IssueMarker.WavedLine });\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/RedundantNotNullAttributeInNonNullableTypeIssue.cs",
    "content": "//\n// RedundantNotNullAttributeInNonNullableTypeIssue.cs\n//\n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Use of NotNullAttribute in non-nullable type is redundant.\",\n//\t\tDescription = \"Detects unnecessary usages of the NotNullAttribute.\",\n//\t\tCategory = IssueCategories.RedundanciesInDeclarations,\n//\t\tSeverity = Severity.Warning)]\n\tpublic class RedundantNotNullAttributeInNonNullableTypeIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<RedundantNotNullAttributeInNonNullableTypeIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base(context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void VisitBlockStatement(BlockStatement blockStatement)\n\t\t\t{\n\t\t\t\t// This is just here to prevent the visitor from unnecessarily visiting the children.\n\t\t\t}\n\n\t\t\tpublic override void VisitAttribute(Attribute attribute)\n\t\t\t{\n\t\t\t\tvar attributeType = ctx.Resolve(attribute).Type;\n\t\t\t\tif (attributeType.FullName == AnnotationNames.NotNullAttribute) {\n\t\t\t\t\tif (IsAttributeRedundant(attribute)) {\n\t\t\t\t\t\tAddIssue(new CodeIssue(attribute,\n\t\t\t\t\t\t\tctx.TranslateString(\"NotNullAttribute is not needed for non-nullable types\"),\n\t\t\t\t\t\t\tctx.TranslateString(\"Remove redundant NotNullAttribute\"),\n\t\t\t\t\t\t\tscript => script.RemoveAttribute(attribute)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool IsAttributeRedundant(Attribute attribute)\n\t\t\t{\n\t\t\t\tvar section = attribute.GetParent<AttributeSection>();\n\t\t\t\tvar targetDeclaration = section.Parent;\n\n\t\t\t\tif (targetDeclaration is FixedFieldDeclaration) {\n\t\t\t\t\t//Fixed fields are never null\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar fieldDeclaration = targetDeclaration as FieldDeclaration;\n\t\t\t\tif (fieldDeclaration != null) {\n\t\t\t\t\treturn fieldDeclaration.Variables.All(variable => NullableType.IsNonNullableValueType(ctx.Resolve(variable).Type));\n\t\t\t\t}\n\n\t\t\t\tvar resolveResult = ctx.Resolve(targetDeclaration);\n\t\t\t\tvar memberResolveResult = resolveResult as MemberResolveResult;\n\t\t\t\tif (memberResolveResult != null) {\n\t\t\t\t\treturn NullableType.IsNonNullableValueType(memberResolveResult.Member.ReturnType);\n\t\t\t\t}\n\t\t\t\tvar localResolveResult = resolveResult as LocalResolveResult;\n\t\t\t\tif (localResolveResult != null) {\n\t\t\t\t\treturn NullableType.IsNonNullableValueType(localResolveResult.Type);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/ResultOfAsyncCallShouldNotBeIgnoredIssue.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Result of async call is ignored\",\n//\t                  Description = \"Warns when the task returned by an async call is ignored, which causes exceptions\" +\n//\t                  \" thrown by the call to be silently ignored.\",\n//\t                  Category = IssueCategories.CodeQualityIssues,\n//\t                  Severity = Severity.Warning)]\n\tpublic class ResultOfAsyncCallShouldNotBeIgnoredIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tsealed class GatherVisitor : GatherVisitorBase<ResultOfAsyncCallShouldNotBeIgnoredIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext ctx)\n\t\t\t\t: base(ctx)\n\t\t\t{\n\t\t\t}\n\n\t\t\tAstNode GetNodeToUnderline(Expression target)\n\t\t\t{\n\t\t\t\tif (target is IdentifierExpression)\n\t\t\t\t\treturn target;\n\t\t\t\tif (target is MemberReferenceExpression)\n\t\t\t\t\treturn ((MemberReferenceExpression)target).MemberNameToken;\n\t\t\t\treturn target;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitExpressionStatement(ExpressionStatement expressionStatement)\n\t\t\t{\n\t\t\t\tbase.VisitExpressionStatement(expressionStatement);\n\t\t\t\tvar invocation = expressionStatement.Expression as InvocationExpression;\n\t\t\t\tif (invocation == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar rr = ctx.Resolve(invocation) as InvocationResolveResult;\n\t\t\t\tif (rr != null && (rr.Type.IsKnownType(KnownTypeCode.Task) || rr.Type.IsKnownType(KnownTypeCode.TaskOfT))) {\n\t\t\t\t\tAddIssue(new CodeIssue(GetNodeToUnderline (invocation.Target), ctx.TranslateString(\"Exceptions in async call will be silently ignored because the returned task is unused\")));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/SameGuardConditionExpressionInIfelseBranchesIssue.cs",
    "content": "﻿//\n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n//\n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Same guard condition expression in different if else branch\",\n//\t                  Description = \"A warning should be given for the case: if (condition) {…} else if (condition) {…}.\",\n//\t                  Category = IssueCategories.Notifications,\n//\t                  Severity = Severity.Warning)]\n\tpublic class SameGuardConditionExpressionInIfelseBranchesIssue : GatherVisitorCodeIssueProvider\n\t{\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<SameGuardConditionExpressionInIfelseBranchesIssue>\n\t\t{\n\t\t\tpublic GatherVisitor(BaseRefactoringContext context) : base (context)\n\t\t\t{\n\t\t\t}\n\n\t\t\tbool IsSafeExpression(Expression expression, BaseRefactoringContext context)\n\t\t\t{\n\t\t\t\tvar components = expression.DescendantsAndSelf;\n\t\t\t\tforeach (var c in components) {\n\t\t\t\t\tif (c is AssignmentExpression)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\telse if (c is UnaryOperatorExpression) {\n\t\t\t\t\t\tvar ope = ((UnaryOperatorExpression)c).Operator;\n\t\t\t\t\t\tif (ope == UnaryOperatorType.Decrement || ope == UnaryOperatorType.Increment \n\t\t\t\t\t\t\t|| ope == UnaryOperatorType.PostDecrement || ope == UnaryOperatorType.PostIncrement)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else if (c is IdentifierExpression) {\n\t\t\t\t\t\tvar result = context.Resolve(c);\n\t\t\t\t\t\tif (result.IsError)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif (!(result is LocalResolveResult))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tif ((((LocalResolveResult)result).IsParameter))\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic override void VisitIfElseStatement(IfElseStatement ifElseStatement)\n\t\t\t{\n\t\t\t\tbase.VisitIfElseStatement(ifElseStatement);\n\t\t\t\t\n\t\t\t\tHashSet<string> conditions = new HashSet<string>();\n\t\t\t\tconditions.Add(ifElseStatement.Condition.ToString());\n\t\t\t\tvar temp = ifElseStatement.FalseStatement;\n\t\t\t\tAstNode redundantCondition = null;\n\t\t\t\twhile (temp is IfElseStatement) {\n\t\t\t\t\tvar tempCondition = ((IfElseStatement)temp).Condition;\n\t\t\t\t\tif (conditions.Contains(tempCondition.ToString())) {\n\t\t\t\t\t\tif (IsSafeExpression(tempCondition, ctx)) {\n\t\t\t\t\t\t\tredundantCondition = tempCondition;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconditions.Add(tempCondition.ToString());\n\t\t\t\t\ttemp = ((IfElseStatement)temp).FalseStatement;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (redundantCondition == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tAddIssue(new CodeIssue(redundantCondition, ctx.TranslateString(\"Found duplicate condition\")));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UnmatchedSizeSpecificationInArrayCreationIssue.cs",
    "content": "// \n// UnmatchedSizeSpecificationInArrayCreationIssue.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.Refactoring;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t/// <summary>\n\t/// When array initializer has the different number of elements as specified in size creation, it is an error.\n\t/// </summary>\n//\t[IssueDescription(\"Correct size specification in array creation\",\n//\t                  Description= \"When array initializer has the different number of elements as specified in size creation, it is an error.\",\n//\t                  Category = IssueCategories.CompilerErrors,\n//\t                  Severity = Severity.Error,\n//\t                  AnalysisDisableKeyword = \"UnmatchedSizeSpecificationInArrayCreation\")]\n\tpublic class UnmatchedSizeSpecificationInArrayCreationIssue : GatherVisitorCodeIssueProvider\n\t{\t\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\t\t\n\t\tclass GatherVisitor : GatherVisitorBase<UnmatchedSizeSpecificationInArrayCreationIssue>\n\t\t{\n\t\t\tpublic GatherVisitor (BaseRefactoringContext ctx)\n\t\t\t\t: base (ctx)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression)\n\t\t\t{\n\t\t\t\tbase.VisitArrayCreateExpression(arrayCreateExpression);\n\t\t\t\t\n\t\t\t\tif (arrayCreateExpression == null)\n\t\t\t\t\treturn;\n\t\t\t\tif (arrayCreateExpression.Arguments == null || !arrayCreateExpression.Arguments.Any()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar argument = arrayCreateExpression.Arguments.FirstOrNullObject();\n\t\t\t\tif (argument == null || !(argument is PrimitiveExpression))\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tint arraySize = (Int32)((PrimitiveExpression)argument).Value;\n\t\t\t\t\n\t\t\t\tif (arraySize < 1)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar initializer = arrayCreateExpression.Initializer;\n\t\t\t\tif (initializer.IsNull)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (arraySize != initializer.Elements.Count) {\n\t\t\t\t\tAddIssue(new CodeIssue(argument, ctx.TranslateString(\"Unmatched size specification with array initializer\"), ctx.TranslateString(\"Correct array size specification\"), script => {\n\t\t\t\t\t\tvar newArgument = new PrimitiveExpression(initializer.Elements.Count);\n\t\t\t\t\t\tscript.Replace(argument, newArgument);}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Uncategorized/UseOfMemberOfNullReference.cs",
    "content": "//\n// UseOfMemberInNullReference.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.Analysis;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n//\t[IssueDescription(\"Use of (non-extension method) member of null value will cause a NullReferenceException\",\n//\t                  Description = \"Detects when a member of a null value is used\",\n//\t                  Category = IssueCategories.CodeQualityIssues,\n//\t                  Severity = Severity.Warning)]\n\tpublic class UseOfMemberOfNullReference : GatherVisitorCodeIssueProvider\n\t{\n\t\tstatic readonly ISet<NullValueStatus> ProblematicNullStates = new HashSet<NullValueStatus> {\n\t\t\tNullValueStatus.DefinitelyNull,\n\t\t\tNullValueStatus.PotentiallyNull\n\t\t};\n\n\t\tprotected override IGatherVisitor CreateVisitor(BaseRefactoringContext context)\n\t\t{\n\t\t\treturn new GatherVisitor(context);\n\t\t}\n\n\t\tclass GatherVisitor : GatherVisitorBase<UseOfMemberOfNullReference>\n\t\t{\n\t\t\tDictionary<AstNode, NullValueAnalysis> cachedNullAnalysis = new Dictionary<AstNode, NullValueAnalysis>();\n\n\t\t\tinternal GatherVisitor(BaseRefactoringContext ctx): base(ctx) {}\n\n\t\t\tpublic override void VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tIMember member = GetMember(memberReferenceExpression);\n\t\t\t\tif (member == null || member.IsStatic || member.FullName == \"System.Nullable.HasValue\") {\n\t\t\t\t\tbase.VisitMemberReferenceExpression(memberReferenceExpression);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar parentFunction = ConstantNullCoalescingConditionIssue.GetParentFunctionNode(memberReferenceExpression);\n\t\t\t\tvar analysis = GetAnalysis(parentFunction);\n\n\t\t\t\tvar nullStatus = analysis.GetExpressionResult(memberReferenceExpression.Target);\n\t\t\t\tif (ProblematicNullStates.Contains(nullStatus)) {\n\t\t\t\t\tAddIssue(new CodeIssue(memberReferenceExpression,\n\t\t\t\t\t\tctx.TranslateString(\"Using member of null value will cause a NullReferenceException\")));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIMember GetMember(AstNode expression)\n\t\t\t{\n\t\t\t\tvar resolveResult = ctx.Resolve(expression);\n\t\t\t\tMemberResolveResult memberResolveResult = resolveResult as MemberResolveResult;\n\t\t\t\tif (memberResolveResult != null) {\n\t\t\t\t\treturn memberResolveResult.Member;\n\t\t\t\t}\n\n\t\t\t\tvar methodGroupResolveResult = resolveResult as MethodGroupResolveResult;\n\t\t\t\tif (methodGroupResolveResult != null && expression.Parent is InvocationExpression) {\n\t\t\t\t\treturn GetMember(expression.Parent);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tNullValueAnalysis GetAnalysis(AstNode parentFunction)\n\t\t\t{\n\t\t\t\tNullValueAnalysis analysis;\n\t\t\t\tif (cachedNullAnalysis.TryGetValue(parentFunction, out analysis)) {\n\t\t\t\t\treturn analysis;\n\t\t\t\t}\n\n\t\t\t\tanalysis = new NullValueAnalysis(ctx, parentFunction.GetChildByRole(Roles.Body), parentFunction.GetChildrenByRole(Roles.Parameter), ctx.CancellationToken);\n\t\t\t\tanalysis.Analyze();\n\t\t\t\tcachedNullAnalysis [parentFunction] = analysis;\n\t\t\t\treturn analysis;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/ICSharpCode.NRefactory.CSharp.Refactoring.csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProductVersion>8.0.30703</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <ProjectGuid>{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}</ProjectGuid>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.CSharp.Refactoring</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.CSharp.Refactoring</AssemblyName>\r\n    <SignAssembly>true</SignAssembly>\r\n    <AssemblyOriginatorKeyFile>..\\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>\r\n    <DelaySign>False</DelaySign>\r\n    <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>\r\n    <DocumentationFile>..\\bin\\$(Configuration)\\ICSharpCode.NRefactory.CSharp.Refactoring.xml</DocumentationFile>\r\n    <NoWarn>1591,1587,1570</NoWarn>\r\n    <OutputPath>..\\bin\\$(Configuration)\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n    <RegisterForComInterop>False</RegisterForComInterop>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <BaseAddress>4194304</BaseAddress>\r\n    <FileAlignment>4096</FileAlignment>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE;FULL_AST;NET_4_0</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE;FULL_AST;NET_4_0</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <OutputPath>..\\bin\\Release\\</OutputPath>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <OutputPath>..\\bin\\Debug\\</OutputPath>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE;FULL_AST;NET_4_0;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Debug\\</OutputPath>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Release' \">\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE;FULL_AST;NET_4_0;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Release\\</OutputPath>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Xml\" />\r\n    <Reference Include=\"System.Core\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"CodeActions\\AbstractAndVirtualConversionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\AddAnotherAccessorAction.cs\" />\r\n    <Compile Include=\"CodeActions\\AddArgumentNameAction.cs\" />\r\n    <Compile Include=\"CodeActions\\AddCatchTypeAction.cs\" />\r\n    <Compile Include=\"CodeActions\\AddUsingAction.cs\" />\r\n    <Compile Include=\"CodeActions\\AutoLinqSumAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ChangeAccessModifierAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CheckIfParameterIsNullAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertAnonymousDelegateToLambdaAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertAsToCastAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertCastToAsAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertDecToHexAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertDoWhileToWhileLoopAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertEqualityOperatorToEqualsAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertEqualsToEqualityOperatorAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertExplicitToImplicitImplementationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertForeachToForAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertHexToDecAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertImplicitToExplicitImplementationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertLambdaBodyExpressionToStatementAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertLambdaBodyStatementToExpressionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertLambdaToAnonymousDelegateAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertMethodGroupToAnonymousMethodAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertMethodGroupToLambdaAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertSwitchToIfAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertToInitializer\\AccessPath.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertToInitializer\\ConvertInitializerToExplicitInitializationsAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertToInitializer\\ConvertToInitializerAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertToInitializer\\StatementsToInitializerConverter.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertWhileToDoWhileLoopAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CopyCommentsFromBase.cs\" />\r\n    <Compile Include=\"CodeActions\\CopyCommentsFromInterface.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateBackingStoreAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateChangedEventAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateClassDeclarationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateConstructorDeclarationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateCustomEventImplementationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateDelegateAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateEnumValue.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateEventInvocatorAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateFieldAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateIndexerAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateLocalVariableAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateMethodDeclarationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreateOverloadWithoutParameterAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CreatePropertyAction.cs\" />\r\n    <Compile Include=\"CodeActions\\CS1520MethodMustHaveAReturnTypeAction.cs\" />\r\n    <Compile Include=\"CodeActions\\DeclareLocalVariableAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtensionMethodInvocationToStaticMethodInvocationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtractAnonymousMethodAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtractFieldAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtractMethod\\ExtractMethodAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtractMethod\\StaticVisitor.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtractMethod\\VariableLookupVisitor.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtractMethod\\VariableUsageAnalyzation.cs\" />\r\n    <Compile Include=\"CodeActions\\FlipEqualsTargetAndArgumentAction.cs\" />\r\n    <Compile Include=\"CodeActions\\FlipOperatorArgumentsAction.cs\" />\r\n    <Compile Include=\"CodeActions\\GenerateGetterAction.cs\" />\r\n    <Compile Include=\"CodeActions\\GeneratePropertyAction.cs\" />\r\n    <Compile Include=\"CodeActions\\GenerateSwitchLabelsAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ImplementAbstractMembersAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ImplementInterfaceAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ImplementInterfaceExplicitAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ImplementNotImplementedProperty.cs\" />\r\n    <Compile Include=\"CodeActions\\InlineLocalVariableAction.cs\" />\r\n    <Compile Include=\"CodeActions\\InsertAnonymousMethodSignatureAction.cs\" />\r\n    <Compile Include=\"CodeActions\\IntroduceConstantAction.cs\" />\r\n    <Compile Include=\"CodeActions\\IntroduceFormatItemAction.cs\" />\r\n    <Compile Include=\"CodeActions\\InvertConditionalOperatorAction.cs\" />\r\n    <Compile Include=\"CodeActions\\InvertIfAction.cs\" />\r\n    <Compile Include=\"CodeActions\\InvertIfAndSimplify.cs\" />\r\n    <Compile Include=\"CodeActions\\InvertLogicalExpressionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\IterateViaForeachAction.cs\" />\r\n    <Compile Include=\"CodeActions\\JoinDeclarationAndAssignmentAction.cs\" />\r\n    <Compile Include=\"CodeActions\\JoinStringAction.cs\" />\r\n    <Compile Include=\"CodeActions\\LinqFluentToQueryAction.cs\" />\r\n    <Compile Include=\"CodeActions\\LinqQueryToFluentAction.cs\" />\r\n    <Compile Include=\"CodeActions\\MergeNestedIfAction.cs\" />\r\n    <Compile Include=\"CodeActions\\MoveToOuterScopeAction.cs\" />\r\n    <Compile Include=\"CodeActions\\NegateIsExpressionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\NegateRelationalExpressionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\PutInsideUsingAction.cs\" />\r\n    <Compile Include=\"CodeActions\\RemoveBackingStoreAction.cs\" />\r\n    <Compile Include=\"CodeActions\\RemoveBracesAction.cs\" />\r\n    <Compile Include=\"CodeActions\\RemoveRedundantCatchTypeAction.cs\" />\r\n    <Compile Include=\"CodeActions\\RemoveRegionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ReplaceEmptyStringAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SimplifyIfFlowAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SimplifyIfInLoopsFlowAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SortUsingsAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SpecializedCodeAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SplitDeclarationAndAssignmentAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SplitDeclarationListAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SplitStringAction.cs\" />\r\n    <Compile Include=\"CodeActions\\UseExplicitTypeAction.cs\" />\r\n    <Compile Include=\"CodeActions\\UseStringFormatAction.cs\" />\r\n    <Compile Include=\"CodeActions\\UseVarKeywordAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\ConvertIfToAndExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\LockThisIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\NegativeRelationalExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\NotImplementedExceptionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\RedundantInternalIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\RedundantPrivateIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\XmlDocIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\GatherVisitorBase.cs\" />\r\n    <Compile Include=\"CodeIssues\\IssueCategories.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\AccessToClosureIssues\\AccessToClosureIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\AccessToClosureIssues\\AccessToDisposedClosureIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\AccessToClosureIssues\\AccessToModifiedClosureIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\AccessToClosureIssues\\LocalVariableNamePicker.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\DuplicateBodyMethodIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\DuplicateExpressionsInConditionsIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\ParameterCanBeIEnumerableIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\VariableDeclaredInWideScopeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\RefactoringExtensions.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\BaseMethodCallWithDefaultParameterIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\BitwiseOperatorOnEnumWithoutFlagsIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\CanBeReplacedWithTryCastAndCheckForNullIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\CompareOfFloatsByEqualityOperatorIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\ConditionalTernaryEqualBranchIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\DoNotCallOverridableMethodsInConstructorIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\EmptyGeneralCatchClauseIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\EqualExpressionComparisonIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\EventUnsubscriptionViaAnonymousDelegateIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\ForControlVariableIsNeverModifiedIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\FunctionNeverReturnsIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\LocalVariableHidesMemberIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\LongLiteralEndingLowerLIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\OptionalParameterHierarchyMismatchIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\OptionalParameterRefOutIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\ParameterHidesMemberIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\StaticFieldInGenericTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\ThreadStaticAtInstanceFieldIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\ValueParameterNotUsedIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CompilerWarnings\\CS1573ParameterHasNoMatchingParamTagIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CompilerWarnings\\CS1717AssignmentMadeToSameVariableIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CompilerWarnings\\UnassignedReadonlyFieldIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\ConstraintViolations\\InconsistentNamingIssue\\AffectedEntity.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\ConstraintViolations\\InconsistentNamingIssue\\DefaultRules.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\ConstraintViolations\\InconsistentNamingIssue\\InconsistentNamingIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\ConstraintViolations\\InconsistentNamingIssue\\NamingConventionService.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\ConstraintViolations\\InconsistentNamingIssue\\NamingRule.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\ConstraintViolations\\InconsistentNamingIssue\\NamingStyle.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\NUnit\\NonPublicMethodWithTestAttributeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertClosureToMethodGroupIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertConditionalTernaryToNullCoalescingIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertIfStatementToConditionalTernaryExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertIfStatementToNullCoalescingExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertNullableToShortFormIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\InvokeAsExtensionMethodIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\RewriteIfReturnToReturnIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\SuggestUseVarKeywordEvidentIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\AccessToStaticMemberViaDerivedTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\BaseMemberHasParamsIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ConvertIfDoToWhileIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ConvertToConstantIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\EmptyEmbeddedStatementIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\FieldCanBeMadeReadOnlyIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\MemberCanBeMadeStaticIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\PublicConstructorInAbstractClass.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithFirstOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithLastOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeAny.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeCountIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeFirstIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeFirstOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeLastIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeLastOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeLongCountIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeSingleIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeSingleOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithOfTypeWhereIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToAnyIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToCountIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToFirstIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToFirstOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToLastIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToLastOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToLongCountIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToSingleIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToSingleOrDefaultIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithStringIsNullOrEmptyIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\SimplifyConditionalTernaryExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\StringEndsWithIsCultureSpecificIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\StringIndexOfIsCultureSpecificIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\StringLastIndexOfIsCultureSpecificIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\StringStartsWithIsCultureSpecificIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\UseMethodAnyIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\UseMethodIsInstanceOfTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\ConstantNullCoalescingConditionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\DoubleNegationOperatorIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantAttributeParenthesesIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantBaseQualifierIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantBoolCompareIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantCaseLabelIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantCastIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantCommaInArrayInitializerIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantComparisonWithNullIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantEmptyObjectCreationArgumentListssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantExtendsListEntryIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantIfElseBlockIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantNameQualifierIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantObjectOrCollectionInitializerIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantTernaryExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantThisQualifierIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantToStringCallForValueTypesIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantToStringCallIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantUsingDirectiveIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\EmptyConstructorIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\EmptyDestructorIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\EmptyNamespaceIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\EnumUnderlyingTypeIsIntIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\LocalVariableNotUsedIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\PartialTypeWithSinglePartIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\RedundantBaseConstructorCallIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\RedundantDefaultFieldInitializerIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\RedundantOverridenMemberIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\UnusedTypeParameterIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\DisposeMethodInNonIDisposableTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\DuplicatedLinqToListOrArrayIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\ExceptionRethrowIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\ExplicitConversionInForEachIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\IncorrectCallToObjectGetHashCodeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\ResultOfAsyncCallShouldNotBeIgnoredIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\UseOfMemberOfNullReference.cs\" />\r\n    <Compile Include=\"CodeActions\\AddExceptionDescriptionAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\DontUseLinqWhenItsVerboseAndInefficientIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertIfStatementToConditionalTernaryExpressionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertIfStatementToReturnStatementAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertIfStatementToNullCoalescingExpressionAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertIfStatementToSwitchStatementIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertIfStatementToSwitchStatementAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\RedundantParamsIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertNullCoalescingToConditionalExpressionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertReturnStatementToIfAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertAssignmentToIfAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ForCanBeConvertedToForeachIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\UseAsAndNullCheckAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\MixedUseOfFieldsAndGettersIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertForToWhileAction.cs\" />\r\n    <Compile Include=\"CodeActions\\AddBracesAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantEmptyDefaultSwitchBranchIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0126ReturnMustBeFollowedByAnyExpression.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0127ReturnMustNotBeFollowedByAnyExpression.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0152DuplicateCaseLabelValueIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0759RedundantPartialMethodIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0029InvalidConversionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\SealedMemberInSealedClassIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ConvertIfToOrExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\UnusedAnonymousMethodSignatureIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\EmptyStatementIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantArgumentDefaultValueIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantEmptyFinallyBlockIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\PartialMethodParameterNameMismatchIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSimpleAssignmentIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\StringCompareToIsCultureSpecificIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\StringCompareIsCultureSpecificIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\UseArrayCreationExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\BaseMethodParameterNameMismatchIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantExplicitArraySizeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantUnsafeContextIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CompilerErrors\\ProhibitedModifiersIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RemoveRedundantOrStatementIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ExtractWhileConditionToInternalIfStatementAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ReverseDirectionForForLoopAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\AutoAsyncIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\AdditionalOfTypeIssues.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantLambdaParameterTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantLambdaSignatureParenthesesIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertToLambdaExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantArgumentNameIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\AddOptionalParameterToInvocationAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ComputeConstantValueAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantCheckBeforeAssignmentIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertShiftToMultiplyAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertMultiplyToShiftAction.cs\" />\r\n    <Compile Include=\"CodeActions\\SplitIfAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantLogicalConditionalExpressionOperandIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\ForStatementConditionIsTrueIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertToStaticTypeIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ReplaceAssignmentWithPostfixExpressionAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ReplacePostfixExpressionWithAssignmentAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ReplaceWithOperatorAssignmentAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ReplaceOperatorAssignmentWithAssignmentAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\OperatorIsCanBeUsedIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\UseIsOperatorIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\FormatStringProblemIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantCatchClauseIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\PossibleMultipleEnumerationIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\ConditionIsAlwaysTrueOrFalseIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\UnusedLabelIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\MemberHidesStaticFromOuterClassIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\MethodOverloadWithOptionalParameterIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\NotWorking\\DuplicateIfInIfChainIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReferenceEqualsWithValueTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\CompareNonConstrainedGenericWithNullIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantDelegateCreationIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantEnumerableCastCallIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\MissingInterfaceMemberImplementationIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\UnmatchedSizeSpecificationInArrayCreationIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\RedundantBlockInDifferentBranchesIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\NonReadonlyReferencedInGetHashCodeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ParameterCanBeDeclaredWithBaseTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\SameGuardConditionExpressionInIfelseBranchesIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertHasFlagsToBitwiseFlagComparisonAction.cs\" />\r\n    <Compile Include=\"CodeActions\\ConvertBitwiseFlagComparisonToHasFlagsAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantExplicitArrayCreationIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\ArrayCreationCanBeReplacedWithArrayInitializerIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantAnonymousTypePropertyNameIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\PossibleAssignmentToReadonlyFieldIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\ObjectCreationAsStatementIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\NotResolvedInTextIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\DelegateSubtractionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInDeclaration\\UnusedParameterIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\SimplifyLinqExpressionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantExplicitNullableCreationIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\RedundanciesInCode\\RedundantStringToCharArrayCallIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\Opportunities\\ConvertToAutoPropertyIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\StaticConstructorParameterIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CompilerWarnings\\CS0183ExpressionIsAlwaysOfProvidedTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\CodeQuality\\PolymorphicFieldLikeEventInvocationIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\TODO\\ConvertTailRecursiveCallToLoopIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\TODO\\LoopCanBeConvertedToQueryIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\TODO\\PartOfBodyCanBeConvertedToQueryIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\TODO\\RedundantTypeArgumentsOfMethodIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\PossibleMistakenCallToGetTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Uncategorized\\RedundantNotNullAttributeInNonNullableTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0618UsageOfObsoleteMemberIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0169FieldIsNeverUsedIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\StaticEventSubscriptionIssue.cs\" />\r\n    <Compile Include=\"CodeActions\\CS1105ExtensionMethodMustBeDeclaredStaticAction.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS0659OverrideEqualWithoutGetHashCode.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\CS1729TypeHasNoConstructorWithNArgumentsIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\ParameterOnlyAssignedIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\VariableOnlyAssignedIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CallToObjectEqualsViaBaseIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\ConstantConditionIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CheckNamespaceIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CastExpressionOfIncompatibleTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\CompilerErrors\\ExpressionIsNeverOfProvidedTypeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\RedundantAssignmentIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Custom\\UnreachableCodeIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToMinIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToMaxIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToAverageIssue.cs\" />\r\n    <Compile Include=\"CodeIssues\\Synced\\PracticesAndImprovements\\ReplaceWithSingleCallToSumIssue.cs\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.CSharp\\ICSharpCode.NRefactory.CSharp.csproj\">\r\n      <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>\r\n      <Name>ICSharpCode.NRefactory.CSharp</Name>\r\n      <Private>False</Private>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.Xml\\ICSharpCode.NRefactory.Xml.csproj\">\r\n      <Project>{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}</Project>\r\n      <Name>ICSharpCode.NRefactory.Xml</Name>\r\n      <Private>False</Private>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n      <Private>False</Private>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <ProjectExtensions>\r\n    <MonoDevelop>\r\n      <Properties>\r\n        <Policies>\r\n          <TextStylePolicy FileWidth=\"120\" TabsToSpaces=\"False\" EolMarker=\"Unix\" inheritsSet=\"VisualStudio\" inheritsScope=\"text/plain\" scope=\"text/x-csharp\" />\r\n          <CSharpFormattingPolicy IndentSwitchBody=\"True\" BeforeMethodDeclarationParentheses=\"False\" BeforeMethodCallParentheses=\"False\" BeforeConstructorDeclarationParentheses=\"False\" BeforeDelegateDeclarationParentheses=\"False\" NewParentheses=\"False\" SpacesBeforeBrackets=\"False\" inheritsSet=\"Mono\" inheritsScope=\"text/x-csharp\" scope=\"text/x-csharp\" />\r\n        </Policies>\r\n      </Properties>\r\n    </MonoDevelop>\r\n  </ProjectExtensions>\r\n  <ItemGroup>\r\n    <Folder Include=\"CodeIssues\\TODO\\\" />\r\n  </ItemGroup>\r\n</Project>\r\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/Properties/AssemblyInfo.cs",
    "content": "//\n// AssemblyInfo.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyTitle (\"ICSharpCode.NRefactory.CSharp.Refactoring\")]\n[assembly: AssemblyDescription(\"C# refactorings\")]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Cecil/CecilLoader.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\nusing Mono.Cecil;\n\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Allows loading an IProjectContent from an already compiled assembly.\n\t/// </summary>\n\t/// <remarks>Instance methods are not thread-safe; you need to create multiple instances of CecilLoader\n\t/// if you want to load multiple project contents in parallel.</remarks>\n\tpublic sealed class CecilLoader : AssemblyLoader\n\t{\n\t\t/// <summary>\n\t\t/// Version number of the cecil loader.\n\t\t/// Should be incremented when fixing bugs in the cecil loader so that project contents cached on disk\n\t\t/// (which might be incorrect due to the bug) are re-created.\n\t\t/// </summary>\n\t\tconst int cecilLoaderVersion = 1;\n\t\t\n\t\t#region Options\n\t\t// Most options are defined in the AssemblyLoader base class\n\t\t\n\t\t/// <summary>\n\t\t/// Specifies whether to use lazy loading. The default is false.\n\t\t/// If this property is set to true, the CecilLoader will not copy all the relevant information\n\t\t/// out of the Cecil object model, but will maintain references to the Cecil objects.\n\t\t/// This speeds up the loading process and avoids loading unnecessary information, but it causes\n\t\t/// the Cecil objects to stay in memory (which can significantly increase memory usage).\n\t\t/// It also prevents serialization of the Cecil-loaded type system.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Because the type system can be used on multiple threads, but Cecil is not\n\t\t/// thread-safe for concurrent read access, the CecilLoader will lock on the <see cref=\"ModuleDefinition\"/> instance\n\t\t/// for every delay-loading operation.\n\t\t/// If you access the Cecil objects directly in your application, you may need to take the same lock.\n\t\t/// </remarks>\n\t\tpublic bool LazyLoad { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// This delegate gets executed whenever an entity was loaded.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This callback may be to build a dictionary that maps between\n\t\t/// entities and cecil objects.\n\t\t/// Warning: if delay-loading is used and the type system is accessed by multiple threads,\n\t\t/// the callback may be invoked concurrently on multiple threads.\n\t\t/// </remarks>\n\t\t[CLSCompliant(false)]\n\t\tpublic Action<IUnresolvedEntity, MemberReference> OnEntityLoaded { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a value indicating whether this instance stores references to the cecil objects.\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if this instance has references to the cecil objects; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tpublic bool HasCecilReferences { get { return typeSystemTranslationTable != null; } }\n\t\t#endregion\n\t\t\n\t\tModuleDefinition currentModule;\n\t\tCecilUnresolvedAssembly currentAssembly;\n\t\t\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.TypeSystem.CecilLoader\"/> class.\n\t\t/// </summary>\n\t\tpublic CecilLoader()\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.TypeSystem.CecilLoader\"/> class.\n\t\t/// </summary>\n\t\t/// <param name='createCecilReferences'>\n\t\t/// If true references to the cecil objects are hold. In this case the cecil loader can do a type system -> cecil mapping.\n\t\t/// </param>\n\t\t[Obsolete(\"The built-in entity<->cecil mapping is obsolete. Use the OnEntityLoaded callback instead!\")]\n\t\tpublic CecilLoader(bool createCecilReferences) : this()\n\t\t{\n\t\t\tif (createCecilReferences)\n\t\t\t\ttypeSystemTranslationTable = new Dictionary<object, object> ();\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a nested CecilLoader for lazy-loading.\n\t\t/// </summary>\n\t\tprivate CecilLoader(CecilLoader loader)\n\t\t{\n\t\t\t// use a shared typeSystemTranslationTable\n\t\t\tthis.typeSystemTranslationTable = loader.typeSystemTranslationTable;\n\t\t\tthis.IncludeInternalMembers = loader.IncludeInternalMembers;\n\t\t\tthis.LazyLoad = loader.LazyLoad;\n\t\t\tthis.OnEntityLoaded = loader.OnEntityLoaded;\n\t\t\tthis.currentModule = loader.currentModule;\n\t\t\tthis.currentAssembly = loader.currentAssembly;\n\t\t\t// don't use interning - the interning provider is most likely not thread-safe\n\t\t\tthis.interningProvider = InterningProvider.Dummy;\n\t\t\t// don't use cancellation for delay-loaded members\n\t\t}\n\n\t\t#region Load From AssemblyDefinition\n\t\t/// <summary>\n\t\t/// Loads the assembly definition into a project content.\n\t\t/// </summary>\n\t\t/// <returns>Unresolved type system representing the assembly</returns>\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedAssembly LoadAssembly(AssemblyDefinition assemblyDefinition)\n\t\t{\n\t\t\tif (assemblyDefinition == null)\n\t\t\t\tthrow new ArgumentNullException(\"assemblyDefinition\");\n\t\t\treturn LoadModule(assemblyDefinition.MainModule);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Loads the module definition into a project content.\n\t\t/// </summary>\n\t\t/// <returns>Unresolved type system representing the assembly</returns>\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedAssembly LoadModule(ModuleDefinition moduleDefinition)\n\t\t{\n\t\t\tif (moduleDefinition == null)\n\t\t\t\tthrow new ArgumentNullException(\"moduleDefinition\");\n\t\t\t\n\t\t\tthis.currentModule = moduleDefinition;\n\t\t\t\n\t\t\t// Read assembly and module attributes\n\t\t\tIList<IUnresolvedAttribute> assemblyAttributes = new List<IUnresolvedAttribute>();\n\t\t\tIList<IUnresolvedAttribute> moduleAttributes = new List<IUnresolvedAttribute>();\n\t\t\tAssemblyDefinition assemblyDefinition = moduleDefinition.Assembly;\n\t\t\tif (assemblyDefinition != null) {\n\t\t\t\tAddAttributes(assemblyDefinition, assemblyAttributes);\n\t\t\t}\n\t\t\tAddAttributes(moduleDefinition, moduleAttributes);\n\t\t\t\n\t\t\tassemblyAttributes = interningProvider.InternList(assemblyAttributes);\n\t\t\tmoduleAttributes = interningProvider.InternList(moduleAttributes);\n\t\t\t\n\t\t\tthis.currentAssembly = new CecilUnresolvedAssembly(assemblyDefinition != null ? assemblyDefinition.Name.FullName : moduleDefinition.Name, this.DocumentationProvider);\n\t\t\tcurrentAssembly.Location = moduleDefinition.FullyQualifiedName;\n\t\t\tcurrentAssembly.AssemblyAttributes.AddRange(assemblyAttributes);\n\t\t\tcurrentAssembly.ModuleAttributes.AddRange(assemblyAttributes);\n\t\t\t\n\t\t\t// Register type forwarders:\n\t\t\tforeach (ExportedType type in moduleDefinition.ExportedTypes) {\n\t\t\t\tif (type.IsForwarder) {\n\t\t\t\t\tint typeParameterCount;\n\t\t\t\t\tstring ns = type.Namespace;\n\t\t\t\t\tstring name = ReflectionHelper.SplitTypeParameterCountFromReflectionName(type.Name, out typeParameterCount);\n\t\t\t\t\tns = interningProvider.Intern(ns);\n\t\t\t\t\tname = interningProvider.Intern(name);\n\t\t\t\t\tvar typeRef = new GetClassTypeReference(GetAssemblyReference(type.Scope), ns, name, typeParameterCount);\n\t\t\t\t\ttypeRef = interningProvider.Intern(typeRef);\n\t\t\t\t\tvar key = new TopLevelTypeName(ns, name, typeParameterCount);\n\t\t\t\t\tcurrentAssembly.AddTypeForwarder(key, typeRef);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Create and register all types:\n\t\t\tCecilLoader cecilLoaderCloneForLazyLoading = LazyLoad ? new CecilLoader(this) : null;\n\t\t\tList<TypeDefinition> cecilTypeDefs = new List<TypeDefinition>();\n\t\t\tList<DefaultUnresolvedTypeDefinition> typeDefs = new List<DefaultUnresolvedTypeDefinition>();\n\t\t\tforeach (TypeDefinition td in moduleDefinition.Types) {\n\t\t\t\tthis.CancellationToken.ThrowIfCancellationRequested();\n\t\t\t\tif (this.IncludeInternalMembers || (td.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public) {\n\t\t\t\t\tstring name = td.Name;\n\t\t\t\t\tif (name.Length == 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\tif (this.LazyLoad) {\n\t\t\t\t\t\tvar t = new LazyCecilTypeDefinition(cecilLoaderCloneForLazyLoading, td);\n\t\t\t\t\t\tcurrentAssembly.AddTypeDefinition(t);\n\t\t\t\t\t\tRegisterCecilObject(t, td);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar t = CreateTopLevelTypeDefinition(td);\n\t\t\t\t\t\tcecilTypeDefs.Add(td);\n\t\t\t\t\t\ttypeDefs.Add(t);\n\t\t\t\t\t\tcurrentAssembly.AddTypeDefinition(t);\n\t\t\t\t\t\t// The registration will happen after the members are initialized\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Initialize the type's members:\n\t\t\tfor (int i = 0; i < typeDefs.Count; i++) {\n\t\t\t\tInitTypeDefinition(cecilTypeDefs[i], typeDefs[i]);\n\t\t\t}\n\t\t\t\n\t\t\tAddToTypeSystemTranslationTable(this.currentAssembly, assemblyDefinition);\n\t\t\t// Freezing the assembly here is important:\n\t\t\t// otherwise it will be frozen when a compilation is first created\n\t\t\t// from it. But freezing has the effect of changing some collection instances\n\t\t\t// (to ReadOnlyCollection). This hidden mutation was causing a crash\n\t\t\t// when the FastSerializer was saving the assembly at the same time as\n\t\t\t// the first compilation was created from it.\n\t\t\t// By freezing the assembly now, we ensure it is usable on multiple\n\t\t\t// threads without issues.\n\t\t\tcurrentAssembly.Freeze();\n\t\t\t\n\t\t\tvar result = this.currentAssembly;\n\t\t\tthis.currentAssembly = null;\n\t\t\tthis.currentModule = null;\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Sets the current module.\n\t\t/// This causes ReadTypeReference() to use <see cref=\"DefaultAssemblyReference.CurrentAssembly\"/> for references\n\t\t/// in that module.\n\t\t/// </summary>\n\t\t[CLSCompliant(false)]\n\t\tpublic void SetCurrentModule(ModuleDefinition module)\n\t\t{\n\t\t\tthis.currentModule = module;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Loads a type from Cecil.\n\t\t/// </summary>\n\t\t/// <param name=\"typeDefinition\">The Cecil TypeDefinition.</param>\n\t\t/// <returns>ITypeDefinition representing the Cecil type.</returns>\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedTypeDefinition LoadType(TypeDefinition typeDefinition)\n\t\t{\n\t\t\tif (typeDefinition == null)\n\t\t\t\tthrow new ArgumentNullException(\"typeDefinition\");\n\t\t\tvar td = CreateTopLevelTypeDefinition(typeDefinition);\n\t\t\tInitTypeDefinition(typeDefinition, td);\n\t\t\treturn td;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region IUnresolvedAssembly implementation\n\t\t[Serializable, FastSerializerVersion(cecilLoaderVersion)]\n\t\tsealed class CecilUnresolvedAssembly : DefaultUnresolvedAssembly, IDocumentationProvider\n\t\t{\n\t\t\treadonly IDocumentationProvider documentationProvider;\n\t\t\t\n\t\t\tpublic CecilUnresolvedAssembly(string fullAssemblyName, IDocumentationProvider documentationProvider)\n\t\t\t\t: base(fullAssemblyName)\n\t\t\t{\n\t\t\t\tthis.documentationProvider = documentationProvider;\n\t\t\t}\n\t\t\t\n\t\t\tDocumentationComment IDocumentationProvider.GetDocumentation(IEntity entity)\n\t\t\t{\n\t\t\t\tif (documentationProvider != null)\n\t\t\t\t\treturn documentationProvider.GetDocumentation(entity);\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Load Assembly From Disk\n\t\tpublic override IUnresolvedAssembly LoadAssemblyFile(string fileName)\n\t\t{\n\t\t\tif (fileName == null)\n\t\t\t\tthrow new ArgumentNullException(\"fileName\");\n\t\t\tvar param = new ReaderParameters { AssemblyResolver = new DummyAssemblyResolver() };\n\t\t\tModuleDefinition module = ModuleDefinition.ReadModule(fileName, param);\n\t\t\treturn LoadModule(module);\n\t\t}\n\t\t\n\t\t// used to prevent Cecil from loading referenced assemblies\n\t\tsealed class DummyAssemblyResolver : IAssemblyResolver\n\t\t{\n\t\t\tpublic AssemblyDefinition Resolve(AssemblyNameReference name)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic AssemblyDefinition Resolve(string fullName)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic AssemblyDefinition Resolve(string fullName, ReaderParameters parameters)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Type Reference\n\t\t/// <summary>\n\t\t/// Reads a type reference.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">The Cecil type reference that should be converted into\n\t\t/// a type system type reference.</param>\n\t\t/// <param name=\"typeAttributes\">Attributes associated with the Cecil type reference.\n\t\t/// This is used to support the 'dynamic' type.</param>\n\t\t[CLSCompliant(false)]\n\t\tpublic ITypeReference ReadTypeReference(TypeReference type, ICustomAttributeProvider typeAttributes = null)\n\t\t{\n\t\t\tint typeIndex = 0;\n\t\t\treturn CreateType(type, typeAttributes, ref typeIndex);\n\t\t}\n\t\t\n\t\tITypeReference CreateType(TypeReference type, ICustomAttributeProvider typeAttributes, ref int typeIndex)\n\t\t{\n\t\t\twhile (type is OptionalModifierType || type is RequiredModifierType) {\n\t\t\t\ttype = ((TypeSpecification)type).ElementType;\n\t\t\t}\n\t\t\tif (type == null) {\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t}\n\t\t\t\n\t\t\tif (type is Mono.Cecil.ByReferenceType) {\n\t\t\t\ttypeIndex++;\n\t\t\t\treturn interningProvider.Intern(\n\t\t\t\t\tnew ByReferenceTypeReference(\n\t\t\t\t\t\tCreateType(\n\t\t\t\t\t\t\t(type as Mono.Cecil.ByReferenceType).ElementType,\n\t\t\t\t\t\t\ttypeAttributes, ref typeIndex)));\n\t\t\t} else if (type is Mono.Cecil.PointerType) {\n\t\t\t\ttypeIndex++;\n\t\t\t\treturn interningProvider.Intern(\n\t\t\t\t\tnew PointerTypeReference(\n\t\t\t\t\t\tCreateType(\n\t\t\t\t\t\t\t(type as Mono.Cecil.PointerType).ElementType,\n\t\t\t\t\t\t\ttypeAttributes, ref typeIndex)));\n\t\t\t} else if (type is Mono.Cecil.ArrayType) {\n\t\t\t\ttypeIndex++;\n\t\t\t\treturn interningProvider.Intern(\n\t\t\t\t\tnew ArrayTypeReference(\n\t\t\t\t\t\tCreateType(\n\t\t\t\t\t\t\t(type as Mono.Cecil.ArrayType).ElementType,\n\t\t\t\t\t\t\ttypeAttributes, ref typeIndex),\n\t\t\t\t\t\t(type as Mono.Cecil.ArrayType).Rank));\n\t\t\t} else if (type is GenericInstanceType) {\n\t\t\t\tGenericInstanceType gType = (GenericInstanceType)type;\n\t\t\t\tITypeReference baseType = CreateType(gType.ElementType, typeAttributes, ref typeIndex);\n\t\t\t\tITypeReference[] para = new ITypeReference[gType.GenericArguments.Count];\n\t\t\t\tfor (int i = 0; i < para.Length; ++i) {\n\t\t\t\t\ttypeIndex++;\n\t\t\t\t\tpara[i] = CreateType(gType.GenericArguments[i], typeAttributes, ref typeIndex);\n\t\t\t\t}\n\t\t\t\treturn interningProvider.Intern(new ParameterizedTypeReference(baseType, para));\n\t\t\t} else if (type is GenericParameter) {\n\t\t\t\tGenericParameter typeGP = (GenericParameter)type;\n\t\t\t\treturn TypeParameterReference.Create(typeGP.Owner is MethodDefinition ? SymbolKind.Method : SymbolKind.TypeDefinition, typeGP.Position);\n\t\t\t} else if (type.IsNested) {\n\t\t\t\tITypeReference typeRef = CreateType(type.DeclaringType, typeAttributes, ref typeIndex);\n\t\t\t\tint partTypeParameterCount;\n\t\t\t\tstring namepart = ReflectionHelper.SplitTypeParameterCountFromReflectionName(type.Name, out partTypeParameterCount);\n\t\t\t\tnamepart = interningProvider.Intern(namepart);\n\t\t\t\treturn interningProvider.Intern(new NestedTypeReference(typeRef, namepart, partTypeParameterCount));\n\t\t\t} else {\n\t\t\t\tstring ns = interningProvider.Intern(type.Namespace ?? string.Empty);\n\t\t\t\tstring name = type.Name;\n\t\t\t\tif (name == null)\n\t\t\t\t\tthrow new InvalidOperationException(\"type.Name returned null. Type: \" + type.ToString());\n\t\t\t\t\n\t\t\t\tif (name == \"Object\" && ns == \"System\" && HasDynamicAttribute(typeAttributes, typeIndex)) {\n\t\t\t\t\treturn SpecialType.Dynamic;\n\t\t\t\t} else {\n\t\t\t\t\tint typeParameterCount;\n\t\t\t\t\tname = ReflectionHelper.SplitTypeParameterCountFromReflectionName(name, out typeParameterCount);\n\t\t\t\t\tname = interningProvider.Intern(name);\n\t\t\t\t\tif (currentAssembly != null) {\n\t\t\t\t\t\tIUnresolvedTypeDefinition c = currentAssembly.GetTypeDefinition(ns, name, typeParameterCount);\n\t\t\t\t\t\tif (c != null)\n\t\t\t\t\t\t\treturn c;\n\t\t\t\t\t}\n\t\t\t\t\treturn interningProvider.Intern(new GetClassTypeReference(GetAssemblyReference(type.Scope), ns, name, typeParameterCount));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tIAssemblyReference GetAssemblyReference(IMetadataScope scope)\n\t\t{\n\t\t\tif (scope == null || scope == currentModule)\n\t\t\t\treturn DefaultAssemblyReference.CurrentAssembly;\n\t\t\telse\n\t\t\t\treturn interningProvider.Intern(new DefaultAssemblyReference(scope.Name));\n\t\t}\n\t\t\n\t\tstatic bool HasDynamicAttribute(ICustomAttributeProvider attributeProvider, int typeIndex)\n\t\t{\n\t\t\tif (attributeProvider == null || !attributeProvider.HasCustomAttributes)\n\t\t\t\treturn false;\n\t\t\tforeach (CustomAttribute a in attributeProvider.CustomAttributes) {\n\t\t\t\tTypeReference type = a.AttributeType;\n\t\t\t\tif (type.Name == \"DynamicAttribute\" && type.Namespace == \"System.Runtime.CompilerServices\") {\n\t\t\t\t\tif (a.ConstructorArguments.Count == 1) {\n\t\t\t\t\t\tCustomAttributeArgument[] values = a.ConstructorArguments[0].Value as CustomAttributeArgument[];\n\t\t\t\t\t\tif (values != null && typeIndex < values.Length && values[typeIndex].Value is bool)\n\t\t\t\t\t\t\treturn (bool)values[typeIndex].Value;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Attributes\n\t\t#region Assembly Attributes\n\t\tstatic readonly ITypeReference assemblyVersionAttributeTypeRef = typeof(System.Reflection.AssemblyVersionAttribute).ToTypeReference();\n\t\t\n\t\tvoid AddAttributes(AssemblyDefinition assembly, IList<IUnresolvedAttribute> outputList)\n\t\t{\n\t\t\tif (assembly.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(assembly.CustomAttributes, outputList);\n\t\t\t}\n\t\t\tif (assembly.HasSecurityDeclarations) {\n\t\t\t\tAddSecurityAttributes(assembly.SecurityDeclarations, outputList);\n\t\t\t}\n\t\t\t\n\t\t\t// AssemblyVersionAttribute\n\t\t\tif (assembly.Name.Version != null) {\n\t\t\t\tvar assemblyVersion = new DefaultUnresolvedAttribute(assemblyVersionAttributeTypeRef, new[] { KnownTypeReference.String });\n\t\t\t\tassemblyVersion.PositionalArguments.Add(CreateSimpleConstantValue(KnownTypeReference.String, assembly.Name.Version.ToString()));\n\t\t\t\toutputList.Add(interningProvider.Intern(assemblyVersion));\n\t\t\t}\n\t\t}\n\t\t\n\t\tIConstantValue CreateSimpleConstantValue(ITypeReference type, object value)\n\t\t{\n\t\t\treturn interningProvider.Intern(new SimpleConstantValue(type, interningProvider.InternValue(value)));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Module Attributes\n\t\tvoid AddAttributes(ModuleDefinition module, IList<IUnresolvedAttribute> outputList)\n\t\t{\n\t\t\tif (module.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(module.CustomAttributes, outputList);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Parameter Attributes\n\t\tstatic readonly IUnresolvedAttribute inAttribute = new DefaultUnresolvedAttribute(typeof(InAttribute).ToTypeReference());\n\t\tstatic readonly IUnresolvedAttribute outAttribute = new DefaultUnresolvedAttribute(typeof(OutAttribute).ToTypeReference());\n\t\t\n\t\tvoid AddAttributes(ParameterDefinition parameter, DefaultUnresolvedParameter targetParameter)\n\t\t{\n\t\t\tif (!targetParameter.IsOut) {\n\t\t\t\tif (parameter.IsIn)\n\t\t\t\t\ttargetParameter.Attributes.Add(inAttribute);\n\t\t\t\tif (parameter.IsOut)\n\t\t\t\t\ttargetParameter.Attributes.Add(outAttribute);\n\t\t\t}\n\t\t\tif (parameter.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(parameter.CustomAttributes, targetParameter.Attributes);\n\t\t\t}\n\t\t\tif (parameter.HasMarshalInfo) {\n\t\t\t\ttargetParameter.Attributes.Add(ConvertMarshalInfo(parameter.MarshalInfo));\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Method Attributes\n\t\tstatic readonly ITypeReference dllImportAttributeTypeRef = typeof(DllImportAttribute).ToTypeReference();\n\t\tstatic readonly SimpleConstantValue trueValue = new SimpleConstantValue(KnownTypeReference.Boolean, true);\n\t\tstatic readonly SimpleConstantValue falseValue = new SimpleConstantValue(KnownTypeReference.Boolean, false);\n\t\tstatic readonly ITypeReference callingConventionTypeRef = typeof(CallingConvention).ToTypeReference();\n\t\tstatic readonly IUnresolvedAttribute preserveSigAttribute = new DefaultUnresolvedAttribute(typeof(PreserveSigAttribute).ToTypeReference());\n\t\tstatic readonly ITypeReference methodImplAttributeTypeRef = typeof(MethodImplAttribute).ToTypeReference();\n\t\tstatic readonly ITypeReference methodImplOptionsTypeRef = typeof(MethodImplOptions).ToTypeReference();\n\t\t\n\t\tstatic bool HasAnyAttributes(MethodDefinition methodDefinition)\n\t\t{\n\t\t\tif (methodDefinition.HasPInvokeInfo)\n\t\t\t\treturn true;\n\t\t\tif ((methodDefinition.ImplAttributes & ~MethodImplAttributes.CodeTypeMask) != 0)\n\t\t\t\treturn true;\n\t\t\tif (methodDefinition.MethodReturnType.HasFieldMarshal)\n\t\t\t\treturn true;\n\t\t\treturn methodDefinition.HasCustomAttributes || methodDefinition.MethodReturnType.HasCustomAttributes;\n\t\t}\n\t\t\n\t\tvoid AddAttributes(MethodDefinition methodDefinition, IList<IUnresolvedAttribute> attributes, IList<IUnresolvedAttribute> returnTypeAttributes)\n\t\t{\n\t\t\tMethodImplAttributes implAttributes = methodDefinition.ImplAttributes & ~MethodImplAttributes.CodeTypeMask;\n\t\t\t\n\t\t\t#region DllImportAttribute\n\t\t\tif (methodDefinition.HasPInvokeInfo && methodDefinition.PInvokeInfo != null) {\n\t\t\t\tPInvokeInfo info = methodDefinition.PInvokeInfo;\n\t\t\t\tvar dllImport = new DefaultUnresolvedAttribute(dllImportAttributeTypeRef, new[] { KnownTypeReference.String });\n\t\t\t\tdllImport.PositionalArguments.Add(CreateSimpleConstantValue(KnownTypeReference.String, info.Module.Name));\n\t\t\t\t\n\t\t\t\tif (info.IsBestFitDisabled)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"BestFitMapping\", falseValue);\n\t\t\t\tif (info.IsBestFitEnabled)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"BestFitMapping\", trueValue);\n\t\t\t\t\n\t\t\t\tCallingConvention callingConvention;\n\t\t\t\tswitch (info.Attributes & PInvokeAttributes.CallConvMask) {\n\t\t\t\t\tcase (PInvokeAttributes)0:\n\t\t\t\t\t\tDebug.WriteLine (\"P/Invoke calling convention not set on:\" + methodDefinition.FullName);\n\t\t\t\t\t\tcallingConvention = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PInvokeAttributes.CallConvCdecl:\n\t\t\t\t\t\tcallingConvention = CallingConvention.Cdecl;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PInvokeAttributes.CallConvFastcall:\n\t\t\t\t\t\tcallingConvention = CallingConvention.FastCall;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PInvokeAttributes.CallConvStdCall:\n\t\t\t\t\t\tcallingConvention = CallingConvention.StdCall;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PInvokeAttributes.CallConvThiscall:\n\t\t\t\t\t\tcallingConvention = CallingConvention.ThisCall;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PInvokeAttributes.CallConvWinapi:\n\t\t\t\t\t\tcallingConvention = CallingConvention.Winapi;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new NotSupportedException(\"unknown calling convention\");\n\t\t\t\t}\n\t\t\t\tif (callingConvention != CallingConvention.Winapi)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"CallingConvention\", CreateSimpleConstantValue(callingConventionTypeRef, (int)callingConvention));\n\t\t\t\t\n\t\t\t\tCharSet charSet = CharSet.None;\n\t\t\t\tswitch (info.Attributes & PInvokeAttributes.CharSetMask) {\n\t\t\t\t\tcase PInvokeAttributes.CharSetAnsi:\n\t\t\t\t\t\tcharSet = CharSet.Ansi;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PInvokeAttributes.CharSetAuto:\n\t\t\t\t\t\tcharSet = CharSet.Auto;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PInvokeAttributes.CharSetUnicode:\n\t\t\t\t\t\tcharSet = CharSet.Unicode;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (charSet != CharSet.None)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"CharSet\", CreateSimpleConstantValue(charSetTypeRef, (int)charSet));\n\t\t\t\t\n\t\t\t\tif (!string.IsNullOrEmpty(info.EntryPoint) && info.EntryPoint != methodDefinition.Name)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"EntryPoint\", CreateSimpleConstantValue(KnownTypeReference.String, info.EntryPoint));\n\t\t\t\t\n\t\t\t\tif (info.IsNoMangle)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"ExactSpelling\", trueValue);\n\t\t\t\t\n\t\t\t\tif ((implAttributes & MethodImplAttributes.PreserveSig) == MethodImplAttributes.PreserveSig)\n\t\t\t\t\timplAttributes &= ~MethodImplAttributes.PreserveSig;\n\t\t\t\telse\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"PreserveSig\", falseValue);\n\t\t\t\t\n\t\t\t\tif (info.SupportsLastError)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"SetLastError\", trueValue);\n\t\t\t\t\n\t\t\t\tif (info.IsThrowOnUnmappableCharDisabled)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"ThrowOnUnmappableChar\", falseValue);\n\t\t\t\tif (info.IsThrowOnUnmappableCharEnabled)\n\t\t\t\t\tdllImport.AddNamedFieldArgument(\"ThrowOnUnmappableChar\", trueValue);\n\t\t\t\t\n\t\t\t\tattributes.Add(interningProvider.Intern(dllImport));\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t\t#region PreserveSigAttribute\n\t\t\tif (implAttributes == MethodImplAttributes.PreserveSig) {\n\t\t\t\tattributes.Add(preserveSigAttribute);\n\t\t\t\timplAttributes = 0;\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t\t#region MethodImplAttribute\n\t\t\tif (implAttributes != 0) {\n\t\t\t\tvar methodImpl = new DefaultUnresolvedAttribute(methodImplAttributeTypeRef, new[] { methodImplOptionsTypeRef });\n\t\t\t\tmethodImpl.PositionalArguments.Add(CreateSimpleConstantValue(methodImplOptionsTypeRef, (int)implAttributes));\n\t\t\t\tattributes.Add(interningProvider.Intern(methodImpl));\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t\tif (methodDefinition.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(methodDefinition.CustomAttributes, attributes);\n\t\t\t}\n\t\t\tif (methodDefinition.HasSecurityDeclarations) {\n\t\t\t\tAddSecurityAttributes(methodDefinition.SecurityDeclarations, attributes);\n\t\t\t}\n\t\t\tif (methodDefinition.MethodReturnType.HasMarshalInfo) {\n\t\t\t\treturnTypeAttributes.Add(ConvertMarshalInfo(methodDefinition.MethodReturnType.MarshalInfo));\n\t\t\t}\n\t\t\tif (methodDefinition.MethodReturnType.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(methodDefinition.MethodReturnType.CustomAttributes, returnTypeAttributes);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type Attributes\n\t\tstatic readonly DefaultUnresolvedAttribute serializableAttribute = new DefaultUnresolvedAttribute(typeof(SerializableAttribute).ToTypeReference());\n\t\tstatic readonly DefaultUnresolvedAttribute comImportAttribute = new DefaultUnresolvedAttribute(typeof(ComImportAttribute).ToTypeReference());\n\t\tstatic readonly ITypeReference structLayoutAttributeTypeRef = typeof(StructLayoutAttribute).ToTypeReference();\n\t\tstatic readonly ITypeReference layoutKindTypeRef = typeof(LayoutKind).ToTypeReference();\n\t\tstatic readonly ITypeReference charSetTypeRef = typeof(CharSet).ToTypeReference();\n\t\t\n\t\tvoid AddAttributes(TypeDefinition typeDefinition, IUnresolvedTypeDefinition targetEntity)\n\t\t{\n\t\t\t// SerializableAttribute\n\t\t\tif (typeDefinition.IsSerializable)\n\t\t\t\ttargetEntity.Attributes.Add(serializableAttribute);\n\t\t\t\n\t\t\t// ComImportAttribute\n\t\t\tif (typeDefinition.IsImport)\n\t\t\t\ttargetEntity.Attributes.Add(comImportAttribute);\n\t\t\t\n\t\t\t#region StructLayoutAttribute\n\t\t\tLayoutKind layoutKind = LayoutKind.Auto;\n\t\t\tswitch (typeDefinition.Attributes & TypeAttributes.LayoutMask) {\n\t\t\t\tcase TypeAttributes.SequentialLayout:\n\t\t\t\t\tlayoutKind = LayoutKind.Sequential;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.ExplicitLayout:\n\t\t\t\t\tlayoutKind = LayoutKind.Explicit;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tCharSet charSet = CharSet.None;\n\t\t\tswitch (typeDefinition.Attributes & TypeAttributes.StringFormatMask) {\n\t\t\t\tcase TypeAttributes.AnsiClass:\n\t\t\t\t\tcharSet = CharSet.Ansi;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.AutoClass:\n\t\t\t\t\tcharSet = CharSet.Auto;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.UnicodeClass:\n\t\t\t\t\tcharSet = CharSet.Unicode;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tLayoutKind defaultLayoutKind = (typeDefinition.IsValueType && !typeDefinition.IsEnum) ? LayoutKind.Sequential: LayoutKind.Auto;\n\t\t\tif (layoutKind != defaultLayoutKind || charSet != CharSet.Ansi || typeDefinition.PackingSize > 0 || typeDefinition.ClassSize > 0) {\n\t\t\t\tDefaultUnresolvedAttribute structLayout = new DefaultUnresolvedAttribute(structLayoutAttributeTypeRef, new[] { layoutKindTypeRef });\n\t\t\t\tstructLayout.PositionalArguments.Add(CreateSimpleConstantValue(layoutKindTypeRef, (int)layoutKind));\n\t\t\t\tif (charSet != CharSet.Ansi) {\n\t\t\t\t\tstructLayout.AddNamedFieldArgument(\"CharSet\", CreateSimpleConstantValue(charSetTypeRef, (int)charSet));\n\t\t\t\t}\n\t\t\t\tif (typeDefinition.PackingSize > 0) {\n\t\t\t\t\tstructLayout.AddNamedFieldArgument(\"Pack\", CreateSimpleConstantValue(KnownTypeReference.Int32, (int)typeDefinition.PackingSize));\n\t\t\t\t}\n\t\t\t\tif (typeDefinition.ClassSize > 0) {\n\t\t\t\t\tstructLayout.AddNamedFieldArgument(\"Size\", CreateSimpleConstantValue(KnownTypeReference.Int32, (int)typeDefinition.ClassSize));\n\t\t\t\t}\n\t\t\t\ttargetEntity.Attributes.Add(interningProvider.Intern(structLayout));\n\t\t\t}\n\t\t\t#endregion\n\t\t\t\n\t\t\tif (typeDefinition.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(typeDefinition.CustomAttributes, targetEntity.Attributes);\n\t\t\t}\n\t\t\tif (typeDefinition.HasSecurityDeclarations) {\n\t\t\t\tAddSecurityAttributes(typeDefinition.SecurityDeclarations, targetEntity.Attributes);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Field Attributes\n\t\tstatic readonly ITypeReference fieldOffsetAttributeTypeRef = typeof(FieldOffsetAttribute).ToTypeReference();\n\t\tstatic readonly IUnresolvedAttribute nonSerializedAttribute = new DefaultUnresolvedAttribute(typeof(NonSerializedAttribute).ToTypeReference());\n\t\t\n\t\tvoid AddAttributes(FieldDefinition fieldDefinition, IUnresolvedEntity targetEntity)\n\t\t{\n\t\t\t// FieldOffsetAttribute\n\t\t\tif (fieldDefinition.HasLayoutInfo) {\n\t\t\t\tDefaultUnresolvedAttribute fieldOffset = new DefaultUnresolvedAttribute(fieldOffsetAttributeTypeRef, new[] { KnownTypeReference.Int32 });\n\t\t\t\tfieldOffset.PositionalArguments.Add(CreateSimpleConstantValue(KnownTypeReference.Int32, fieldDefinition.Offset));\n\t\t\t\ttargetEntity.Attributes.Add(interningProvider.Intern(fieldOffset));\n\t\t\t}\n\t\t\t\n\t\t\t// NonSerializedAttribute\n\t\t\tif (fieldDefinition.IsNotSerialized) {\n\t\t\t\ttargetEntity.Attributes.Add(nonSerializedAttribute);\n\t\t\t}\n\t\t\t\n\t\t\tif (fieldDefinition.HasMarshalInfo) {\n\t\t\t\ttargetEntity.Attributes.Add(ConvertMarshalInfo(fieldDefinition.MarshalInfo));\n\t\t\t}\n\t\t\t\n\t\t\tif (fieldDefinition.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(fieldDefinition.CustomAttributes, targetEntity.Attributes);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Event Attributes\n\t\tvoid AddAttributes(EventDefinition eventDefinition, IUnresolvedEntity targetEntity)\n\t\t{\n\t\t\tif (eventDefinition.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(eventDefinition.CustomAttributes, targetEntity.Attributes);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Property Attributes\n\t\tvoid AddAttributes(PropertyDefinition propertyDefinition, IUnresolvedEntity targetEntity)\n\t\t{\n\t\t\tif (propertyDefinition.HasCustomAttributes) {\n\t\t\t\tAddCustomAttributes(propertyDefinition.CustomAttributes, targetEntity.Attributes);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region MarshalAsAttribute (ConvertMarshalInfo)\n\t\tstatic readonly ITypeReference marshalAsAttributeTypeRef = typeof(MarshalAsAttribute).ToTypeReference();\n\t\tstatic readonly ITypeReference unmanagedTypeTypeRef = typeof(UnmanagedType).ToTypeReference();\n\t\t\n\t\tIUnresolvedAttribute ConvertMarshalInfo(MarshalInfo marshalInfo)\n\t\t{\n\t\t\tDefaultUnresolvedAttribute attr = new DefaultUnresolvedAttribute(marshalAsAttributeTypeRef, new[] { unmanagedTypeTypeRef });\n\t\t\tattr.PositionalArguments.Add(CreateSimpleConstantValue(unmanagedTypeTypeRef, (int)marshalInfo.NativeType));\n\t\t\t\n\t\t\tFixedArrayMarshalInfo fami = marshalInfo as FixedArrayMarshalInfo;\n\t\t\tif (fami != null) {\n\t\t\t\tattr.AddNamedFieldArgument(\"SizeConst\", CreateSimpleConstantValue(KnownTypeReference.Int32, (int)fami.Size));\n\t\t\t\tif (fami.ElementType != NativeType.None)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"ArraySubType\", CreateSimpleConstantValue(unmanagedTypeTypeRef, (int)fami.ElementType));\n\t\t\t}\n\t\t\tSafeArrayMarshalInfo sami = marshalInfo as SafeArrayMarshalInfo;\n\t\t\tif (sami != null && sami.ElementType != VariantType.None) {\n\t\t\t\tattr.AddNamedFieldArgument(\"SafeArraySubType\", CreateSimpleConstantValue(typeof(VarEnum).ToTypeReference(), (int)sami.ElementType));\n\t\t\t}\n\t\t\tArrayMarshalInfo ami = marshalInfo as ArrayMarshalInfo;\n\t\t\tif (ami != null) {\n\t\t\t\tif (ami.ElementType != NativeType.Max)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"ArraySubType\", CreateSimpleConstantValue(unmanagedTypeTypeRef, (int)ami.ElementType));\n\t\t\t\tif (ami.Size >= 0)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"SizeConst\", CreateSimpleConstantValue(KnownTypeReference.Int32, (int)ami.Size));\n\t\t\t\tif (ami.SizeParameterMultiplier != 0 && ami.SizeParameterIndex >= 0)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"SizeParamIndex\", CreateSimpleConstantValue(KnownTypeReference.Int16, (short)ami.SizeParameterIndex));\n\t\t\t}\n\t\t\tCustomMarshalInfo cmi = marshalInfo as CustomMarshalInfo;\n\t\t\tif (cmi != null) {\n\t\t\t\tif (cmi.ManagedType != null)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"MarshalType\", CreateSimpleConstantValue(KnownTypeReference.String, cmi.ManagedType.FullName));\n\t\t\t\tif (!string.IsNullOrEmpty(cmi.Cookie))\n\t\t\t\t\tattr.AddNamedFieldArgument(\"MarshalCookie\", CreateSimpleConstantValue(KnownTypeReference.String, cmi.Cookie));\n\t\t\t}\n\t\t\tFixedSysStringMarshalInfo fssmi = marshalInfo as FixedSysStringMarshalInfo;\n\t\t\tif (fssmi != null) {\n\t\t\t\tattr.AddNamedFieldArgument(\"SizeConst\", CreateSimpleConstantValue(KnownTypeReference.Int32, (int)fssmi.Size));\n\t\t\t}\n\t\t\t\n\t\t\treturn InterningProvider.Intern(attr);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Custom Attributes (ReadAttribute)\n\t\tvoid AddCustomAttributes(Mono.Collections.Generic.Collection<CustomAttribute> attributes, IList<IUnresolvedAttribute> targetCollection)\n\t\t{\n\t\t\tforeach (var cecilAttribute in attributes) {\n\t\t\t\tTypeReference type = cecilAttribute.AttributeType;\n\t\t\t\tif (type.Namespace == \"System.Runtime.CompilerServices\") {\n\t\t\t\t\tif (type.Name == \"DynamicAttribute\" || type.Name == \"ExtensionAttribute\" || type.Name == \"DecimalConstantAttribute\")\n\t\t\t\t\t\tcontinue;\n\t\t\t\t} else if (type.Name == \"ParamArrayAttribute\" && type.Namespace == \"System\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttargetCollection.Add(ReadAttribute(cecilAttribute));\n\t\t\t}\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedAttribute ReadAttribute(CustomAttribute attribute)\n\t\t{\n\t\t\tif (attribute == null)\n\t\t\t\tthrow new ArgumentNullException(\"attribute\");\n\t\t\tMethodReference ctor = attribute.Constructor;\n\t\t\tITypeReference attributeType = ReadTypeReference(attribute.AttributeType);\n\t\t\tIList<ITypeReference> ctorParameterTypes = EmptyList<ITypeReference>.Instance;\n\t\t\tif (ctor.HasParameters) {\n\t\t\t\tctorParameterTypes = new ITypeReference[ctor.Parameters.Count];\n\t\t\t\tfor (int i = 0; i < ctorParameterTypes.Count; i++) {\n\t\t\t\t\tctorParameterTypes[i] = ReadTypeReference(ctor.Parameters[i].ParameterType);\n\t\t\t\t}\n\t\t\t\tctorParameterTypes = interningProvider.InternList(ctorParameterTypes);\n\t\t\t}\n\t\t\treturn interningProvider.Intern(new UnresolvedAttributeBlob(attributeType, ctorParameterTypes, attribute.GetBlob()));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Security Attributes\n\t\t/// <summary>\n\t\t/// Reads a security declaration.\n\t\t/// </summary>\n\t\t[CLSCompliant(false)]\n\t\tpublic IList<IUnresolvedAttribute> ReadSecurityDeclaration(SecurityDeclaration secDecl)\n\t\t{\n\t\t\tif (secDecl == null)\n\t\t\t\tthrow new ArgumentNullException(\"secDecl\");\n\t\t\tvar result = new List<IUnresolvedAttribute>();\n\t\t\tAddSecurityAttributes(secDecl, result);\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tvoid AddSecurityAttributes(Mono.Collections.Generic.Collection<SecurityDeclaration> securityDeclarations, IList<IUnresolvedAttribute> targetCollection)\n\t\t{\n\t\t\tforeach (var secDecl in securityDeclarations) {\n\t\t\t\tAddSecurityAttributes(secDecl, targetCollection);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid AddSecurityAttributes(SecurityDeclaration secDecl, IList<IUnresolvedAttribute> targetCollection)\n\t\t{\n\t\t\tbyte[] blob;\n\t\t\ttry {\n\t\t\t\tblob = secDecl.GetBlob();\n\t\t\t} catch (NotSupportedException) {\n\t\t\t\treturn; // https://github.com/icsharpcode/SharpDevelop/issues/284\n\t\t\t}\n\t\t\tvar blobSecDecl = new UnresolvedSecurityDeclarationBlob((int)secDecl.Action, blob);\n\t\t\ttargetCollection.AddRange(blobSecDecl.UnresolvedAttributes);\n\t\t}\n\t\t#endregion\n\t\t#endregion\n\t\t\n\t\t#region Read Type Definition\n\t\tDefaultUnresolvedTypeDefinition CreateTopLevelTypeDefinition(TypeDefinition typeDefinition)\n\t\t{\n\t\t\tstring name = ReflectionHelper.SplitTypeParameterCountFromReflectionName(typeDefinition.Name);\n\t\t\tvar td = new DefaultUnresolvedTypeDefinition(typeDefinition.Namespace, name);\n\t\t\tif (typeDefinition.HasGenericParameters)\n\t\t\t\tInitTypeParameters(typeDefinition, td.TypeParameters);\n\t\t\treturn td;\n\t\t}\n\t\t\n\t\tstatic void InitTypeParameters(TypeDefinition typeDefinition, IList<IUnresolvedTypeParameter> typeParameters)\n\t\t{\n\t\t\t// Type parameters are initialized within the constructor so that the class can be put into the type storage\n\t\t\t// before the rest of the initialization runs - this allows it to be available for early binding as soon as possible.\n\t\t\tfor (int i = 0; i < typeDefinition.GenericParameters.Count; i++) {\n\t\t\t\tif (typeDefinition.GenericParameters[i].Position != i)\n\t\t\t\t\tthrow new InvalidOperationException(\"g.Position != i\");\n\t\t\t\ttypeParameters.Add(new DefaultUnresolvedTypeParameter(\n\t\t\t\t\tSymbolKind.TypeDefinition, i, typeDefinition.GenericParameters[i].Name));\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid InitTypeParameterConstraints(TypeDefinition typeDefinition, IList<IUnresolvedTypeParameter> typeParameters)\n\t\t{\n\t\t\tfor (int i = 0; i < typeParameters.Count; i++) {\n\t\t\t\tvar tp = (DefaultUnresolvedTypeParameter)typeParameters[i];\n\t\t\t\tAddConstraints(tp, typeDefinition.GenericParameters[i]);\n\t\t\t\ttp.ApplyInterningProvider(interningProvider);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid InitTypeDefinition(TypeDefinition typeDefinition, DefaultUnresolvedTypeDefinition td)\n\t\t{\n\t\t\ttd.Kind = GetTypeKind(typeDefinition);\n\t\t\tInitTypeModifiers(typeDefinition, td);\n\t\t\tInitTypeParameterConstraints(typeDefinition, td.TypeParameters);\n\t\t\t\n\t\t\t// nested types can be initialized only after generic parameters were created\n\t\t\tInitNestedTypes(typeDefinition, td, td.NestedTypes);\n\t\t\tAddAttributes(typeDefinition, td);\n\t\t\ttd.HasExtensionMethods = HasExtensionAttribute(typeDefinition);\n\t\t\t\n\t\t\tInitBaseTypes(typeDefinition, td.BaseTypes);\n\t\t\t\n\t\t\ttd.AddDefaultConstructorIfRequired = (td.Kind == TypeKind.Struct || td.Kind == TypeKind.Enum);\n\t\t\tInitMembers(typeDefinition, td, td.Members);\n\t\t\ttd.ApplyInterningProvider(interningProvider);\n\t\t\ttd.Freeze();\n\t\t\tRegisterCecilObject(td, typeDefinition);\n\t\t}\n\t\t\n\t\tvoid InitBaseTypes(TypeDefinition typeDefinition, IList<ITypeReference> baseTypes)\n\t\t{\n\t\t\t// set base classes\n\t\t\tif (typeDefinition.IsEnum) {\n\t\t\t\tforeach (FieldDefinition enumField in typeDefinition.Fields) {\n\t\t\t\t\tif (!enumField.IsStatic) {\n\t\t\t\t\t\tbaseTypes.Add(ReadTypeReference(enumField.FieldType));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeDefinition.BaseType != null) {\n\t\t\t\t\tbaseTypes.Add(ReadTypeReference(typeDefinition.BaseType));\n\t\t\t\t}\n\t\t\t\tif (typeDefinition.HasInterfaces) {\n\t\t\t\t\tforeach (TypeReference iface in typeDefinition.Interfaces) {\n\t\t\t\t\t\tbaseTypes.Add(ReadTypeReference(iface));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid InitNestedTypes(TypeDefinition typeDefinition, IUnresolvedTypeDefinition declaringTypeDefinition, IList<IUnresolvedTypeDefinition> nestedTypes)\n\t\t{\n\t\t\tif (!typeDefinition.HasNestedTypes)\n\t\t\t\treturn;\n\t\t\tforeach (TypeDefinition nestedTypeDef in typeDefinition.NestedTypes) {\n\t\t\t\tTypeAttributes visibility = nestedTypeDef.Attributes & TypeAttributes.VisibilityMask;\n\t\t\t\tif (this.IncludeInternalMembers\n\t\t\t\t    || visibility == TypeAttributes.NestedPublic\n\t\t\t\t    || visibility == TypeAttributes.NestedFamily\n\t\t\t\t    || visibility == TypeAttributes.NestedFamORAssem)\n\t\t\t\t{\n\t\t\t\t\tstring name = nestedTypeDef.Name;\n\t\t\t\t\tint pos = name.LastIndexOf('/');\n\t\t\t\t\tif (pos > 0)\n\t\t\t\t\t\tname = name.Substring(pos + 1);\n\t\t\t\t\tname = ReflectionHelper.SplitTypeParameterCountFromReflectionName(name);\n\t\t\t\t\tvar nestedType = new DefaultUnresolvedTypeDefinition(declaringTypeDefinition, name);\n\t\t\t\t\tInitTypeParameters(nestedTypeDef, nestedType.TypeParameters);\n\t\t\t\t\tnestedTypes.Add(nestedType);\n\t\t\t\t\tInitTypeDefinition(nestedTypeDef, nestedType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic TypeKind GetTypeKind(TypeDefinition typeDefinition)\n\t\t{\n\t\t\t// set classtype\n\t\t\tif (typeDefinition.IsInterface) {\n\t\t\t\treturn TypeKind.Interface;\n\t\t\t} else if (typeDefinition.IsEnum) {\n\t\t\t\treturn TypeKind.Enum;\n\t\t\t} else if (typeDefinition.IsValueType) {\n\t\t\t\treturn TypeKind.Struct;\n\t\t\t} else if (IsDelegate(typeDefinition)) {\n\t\t\t\treturn TypeKind.Delegate;\n\t\t\t} else if (IsModule(typeDefinition)) {\n\t\t\t\treturn TypeKind.Module;\n\t\t\t} else {\n\t\t\t\treturn TypeKind.Class;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void InitTypeModifiers(TypeDefinition typeDefinition, AbstractUnresolvedEntity td)\n\t\t{\n\t\t\ttd.IsSealed = typeDefinition.IsSealed;\n\t\t\ttd.IsAbstract = typeDefinition.IsAbstract;\n\t\t\tswitch (typeDefinition.Attributes & TypeAttributes.VisibilityMask) {\n\t\t\t\tcase TypeAttributes.NotPublic:\n\t\t\t\tcase TypeAttributes.NestedAssembly:\n\t\t\t\t\ttd.Accessibility = Accessibility.Internal;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.Public:\n\t\t\t\tcase TypeAttributes.NestedPublic:\n\t\t\t\t\ttd.Accessibility = Accessibility.Public;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedPrivate:\n\t\t\t\t\ttd.Accessibility = Accessibility.Private;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedFamily:\n\t\t\t\t\ttd.Accessibility = Accessibility.Protected;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedFamANDAssem:\n\t\t\t\t\ttd.Accessibility = Accessibility.ProtectedAndInternal;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedFamORAssem:\n\t\t\t\t\ttd.Accessibility = Accessibility.ProtectedOrInternal;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool IsDelegate(TypeDefinition type)\n\t\t{\n\t\t\tif (type.BaseType != null && type.BaseType.Namespace == \"System\") {\n\t\t\t\tif (type.BaseType.Name == \"MulticastDelegate\")\n\t\t\t\t\treturn true;\n\t\t\t\tif (type.BaseType.Name == \"Delegate\" && type.Name != \"MulticastDelegate\")\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tstatic bool IsModule(TypeDefinition type)\n\t\t{\n\t\t\tif (!type.HasCustomAttributes)\n\t\t\t\treturn false;\n\t\t\tforeach (var att in type.CustomAttributes) {\n\t\t\t\tif (att.AttributeType.FullName == \"Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute\"\n\t\t\t\t    || att.AttributeType.FullName == \"System.Runtime.CompilerServices.CompilerGlobalScopeAttribute\")\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid InitMembers(TypeDefinition typeDefinition, IUnresolvedTypeDefinition td, IList<IUnresolvedMember> members)\n\t\t{\n\t\t\tif (typeDefinition.HasMethods) {\n\t\t\t\tforeach (MethodDefinition method in typeDefinition.Methods) {\n\t\t\t\t\tif (IsVisible(method.Attributes) && !IsAccessor(method.SemanticsAttributes)) {\n\t\t\t\t\t\tSymbolKind type = SymbolKind.Method;\n\t\t\t\t\t\tif (method.IsSpecialName) {\n\t\t\t\t\t\t\tif (method.IsConstructor)\n\t\t\t\t\t\t\t\ttype = SymbolKind.Constructor;\n\t\t\t\t\t\t\telse if (method.Name.StartsWith(\"op_\", StringComparison.Ordinal))\n\t\t\t\t\t\t\t\ttype = SymbolKind.Operator;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmembers.Add(ReadMethod(method, td, type));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeDefinition.HasFields) {\n\t\t\t\tforeach (FieldDefinition field in typeDefinition.Fields) {\n\t\t\t\t\tif (IsVisible(field.Attributes) && !field.IsSpecialName) {\n\t\t\t\t\t\tmembers.Add(ReadField(field, td));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeDefinition.HasProperties) {\n\t\t\t\tstring defaultMemberName = null;\n\t\t\t\tvar defaultMemberAttribute = typeDefinition.CustomAttributes.FirstOrDefault(\n\t\t\t\t\ta => a.AttributeType.FullName == typeof(System.Reflection.DefaultMemberAttribute).FullName);\n\t\t\t\tif (defaultMemberAttribute != null && defaultMemberAttribute.ConstructorArguments.Count == 1) {\n\t\t\t\t\tdefaultMemberName = defaultMemberAttribute.ConstructorArguments[0].Value as string;\n\t\t\t\t}\n\t\t\t\tforeach (PropertyDefinition property in typeDefinition.Properties) {\n\t\t\t\t\tbool getterVisible = property.GetMethod != null && IsVisible(property.GetMethod.Attributes);\n\t\t\t\t\tbool setterVisible = property.SetMethod != null && IsVisible(property.SetMethod.Attributes);\n\t\t\t\t\tif (getterVisible || setterVisible) {\n\t\t\t\t\t\tSymbolKind type = SymbolKind.Property;\n\t\t\t\t\t\tif (property.HasParameters) {\n\t\t\t\t\t\t\t// Try to detect indexer:\n\t\t\t\t\t\t\tif (property.Name == defaultMemberName) {\n\t\t\t\t\t\t\t\ttype = SymbolKind.Indexer; // normal indexer\n\t\t\t\t\t\t\t} else if (property.Name.EndsWith(\".Item\", StringComparison.Ordinal) && (property.GetMethod ?? property.SetMethod).HasOverrides) {\n\t\t\t\t\t\t\t\t// explicit interface implementation of indexer\n\t\t\t\t\t\t\t\ttype = SymbolKind.Indexer;\n\t\t\t\t\t\t\t\t// We can't really tell parameterized properties and indexers apart in this case without\n\t\t\t\t\t\t\t\t// resolving the interface, so we rely on the \"Item\" naming convention instead.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmembers.Add(ReadProperty(property, td, type));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeDefinition.HasEvents) {\n\t\t\t\tforeach (EventDefinition ev in typeDefinition.Events) {\n\t\t\t\t\tif (ev.AddMethod != null && IsVisible(ev.AddMethod.Attributes)) {\n\t\t\t\t\t\tmembers.Add(ReadEvent(ev, td));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool IsAccessor(MethodSemanticsAttributes semantics)\n\t\t{\n\t\t\treturn !(semantics == MethodSemanticsAttributes.None || semantics == MethodSemanticsAttributes.Other);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Lazy-Loaded Type Definition\n\t\t/// <summary>\n\t\t/// Given an assembly that was created by the CecilLoader with lazy-loading enabled,\n\t\t/// this method will eagerly load all classes, and free any references to the source Cecil objects.\n\t\t/// \n\t\t/// The intended usage pattern for this method is:\n\t\t/// 1. use lazy-loading to improve the latency when new assemblies have to be loaded\n\t\t/// 2. later, when the CPU is idle, call FinishLazyLoading() to free up the memory consumed by the Cecil objects\n\t\t/// </summary>\n\t\tpublic static void FinishLazyLoading(IUnresolvedAssembly assembly)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tthrow new ArgumentNullException(\"assembly\");\n\t\t\tforeach (var type in assembly.TopLevelTypeDefinitions) {\n\t\t\t\tvar lctd = type as LazyCecilTypeDefinition;\n\t\t\t\tif (lctd != null)\n\t\t\t\t\tlctd.InitAndReleaseReferences();\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class LazyCecilTypeDefinition : AbstractUnresolvedEntity, IUnresolvedTypeDefinition\n\t\t{\n\t\t\t// loader + cecilTypeDef, used for lazy-loading; and set to null after lazy loading is complete\n\t\t\tCecilLoader loader;\n\t\t\tTypeDefinition cecilTypeDef;\n\t\t\t\n\t\t\treadonly string namespaceName;\n\t\t\treadonly TypeKind kind;\n\t\t\treadonly IList<IUnresolvedTypeParameter> typeParameters;\n\t\t\t\n\t\t\t// lazy-loaded fields\n\t\t\tIList<ITypeReference> baseTypes;\n\t\t\tIList<IUnresolvedTypeDefinition> nestedTypes;\n\t\t\tIList<IUnresolvedMember> members;\n\t\t\t\n\t\t\tpublic LazyCecilTypeDefinition(CecilLoader loader, TypeDefinition typeDefinition)\n\t\t\t{\n\t\t\t\tthis.loader = loader;\n\t\t\t\tthis.cecilTypeDef = typeDefinition;\n\t\t\t\tthis.SymbolKind = SymbolKind.TypeDefinition;\n\t\t\t\tthis.namespaceName = typeDefinition.Namespace;\n\t\t\t\tthis.Name = ReflectionHelper.SplitTypeParameterCountFromReflectionName(typeDefinition.Name);\n\t\t\t\tvar tps = new List<IUnresolvedTypeParameter>();\n\t\t\t\tInitTypeParameters(typeDefinition, tps);\n\t\t\t\tthis.typeParameters = FreezableHelper.FreezeList(tps);\n\t\t\t\t\n\t\t\t\tthis.kind = GetTypeKind(typeDefinition);\n\t\t\t\tInitTypeModifiers(typeDefinition, this);\n\t\t\t\tloader.InitTypeParameterConstraints(typeDefinition, typeParameters);\n\t\t\t\t\n\t\t\t\tloader.AddAttributes(typeDefinition, this);\n\t\t\t\tflags[FlagHasExtensionMethods] = HasExtensionAttribute(typeDefinition);\n\t\t\t\t\n\t\t\t\tthis.ApplyInterningProvider(loader.interningProvider);\n\t\t\t\tthis.Freeze();\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string Namespace {\n\t\t\t\tget { return namespaceName; }\n\t\t\t\tset { throw new NotSupportedException(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ReflectionName {\n\t\t\t\tget { return this.FullTypeName.ReflectionName; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic FullTypeName FullTypeName {\n\t\t\t\tget {\n\t\t\t\t\treturn new TopLevelTypeName(namespaceName, this.Name, typeParameters.Count);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic TypeKind Kind {\n\t\t\t\tget { return kind; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IUnresolvedTypeParameter> TypeParameters {\n\t\t\t\tget { return typeParameters; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<ITypeReference> BaseTypes {\n\t\t\t\tget {\n\t\t\t\t\tvar result = LazyInit.VolatileRead(ref this.baseTypes);\n\t\t\t\t\tif (result != null) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.baseTypes, TryInitBaseTypes());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tIList<ITypeReference> TryInitBaseTypes()\n\t\t\t{\n\t\t\t\tvar loader = LazyInit.VolatileRead(ref this.loader);\n\t\t\t\tvar cecilTypeDef = LazyInit.VolatileRead(ref this.cecilTypeDef);\n\t\t\t\tif (loader == null || cecilTypeDef == null) {\n\t\t\t\t\t// Cannot initialize because the references to loader/cecilTypeDef\n\t\t\t\t\t// have already been cleared.\n\t\t\t\t\t// This can only happen if the class was loaded by another thread concurrently to the TryInitBaseTypes() call,\n\t\t\t\t\t// so the GetOrSet() call in the property will retrieve the value set by the other thread.\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tlock (loader.currentModule) {\n\t\t\t\t\tvar result = new List<ITypeReference>();\n\t\t\t\t\tloader.InitBaseTypes(cecilTypeDef, result);\n\t\t\t\t\treturn FreezableHelper.FreezeList(result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IUnresolvedTypeDefinition> NestedTypes {\n\t\t\t\tget {\n\t\t\t\t\tvar result = LazyInit.VolatileRead(ref this.nestedTypes);\n\t\t\t\t\tif (result != null) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.nestedTypes, TryInitNestedTypes());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tIList<IUnresolvedTypeDefinition> TryInitNestedTypes()\n\t\t\t{\n\t\t\t\tvar loader = LazyInit.VolatileRead(ref this.loader);\n\t\t\t\tvar cecilTypeDef = LazyInit.VolatileRead(ref this.cecilTypeDef);\n\t\t\t\tif (loader == null || cecilTypeDef == null) {\n\t\t\t\t\t// Cannot initialize because the references to loader/cecilTypeDef\n\t\t\t\t\t// have already been cleared.\n\t\t\t\t\t// This can only happen if the class was loaded by another thread concurrently to the TryInitNestedTypes() call,\n\t\t\t\t\t// so the GetOrSet() call in the property will retrieve the value set by the other thread.\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tlock (loader.currentModule) {\n\t\t\t\t\tvar result = new List<IUnresolvedTypeDefinition>();\n\t\t\t\t\tloader.InitNestedTypes(cecilTypeDef, this, result);\n\t\t\t\t\treturn FreezableHelper.FreezeList(result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<IUnresolvedMember> Members {\n\t\t\t\tget {\n\t\t\t\t\tvar result = LazyInit.VolatileRead(ref this.members);\n\t\t\t\t\tif (result != null) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn LazyInit.GetOrSet(ref this.members, TryInitMembers());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tIList<IUnresolvedMember> TryInitMembers()\n\t\t\t{\n\t\t\t\tvar loader = LazyInit.VolatileRead(ref this.loader);\n\t\t\t\tvar cecilTypeDef = LazyInit.VolatileRead(ref this.cecilTypeDef);\n\t\t\t\tif (loader == null || cecilTypeDef == null) {\n\t\t\t\t\t// Cannot initialize because the references to loader/cecilTypeDef\n\t\t\t\t\t// have already been cleared.\n\t\t\t\t\t// This can only happen if the class was loaded by another thread concurrently to the TryInitMembers() call,\n\t\t\t\t\t// so the GetOrSet() call in the property will retrieve the value set by the other thread.\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tlock (loader.currentModule) {\n\t\t\t\t\tif (this.members != null)\n\t\t\t\t\t\treturn this.members;\n\t\t\t\t\tvar result = new List<IUnresolvedMember>();\n\t\t\t\t\tloader.InitMembers(cecilTypeDef, this, result);\n\t\t\t\t\treturn FreezableHelper.FreezeList(result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic void InitAndReleaseReferences()\n\t\t\t{\n\t\t\t\tif (LazyInit.VolatileRead(ref this.baseTypes) == null)\n\t\t\t\t\tLazyInit.GetOrSet(ref this.baseTypes, TryInitBaseTypes());\n\t\t\t\tif (LazyInit.VolatileRead(ref this.nestedTypes) == null)\n\t\t\t\t\tLazyInit.GetOrSet(ref this.nestedTypes, TryInitNestedTypes());\n\t\t\t\tif (LazyInit.VolatileRead(ref this.members) == null)\n\t\t\t\t\tLazyInit.GetOrSet(ref this.members, TryInitMembers());\n\t\t\t\tThread.MemoryBarrier(); // commit lazily-initialized fields to memory before nulling out the references\n\t\t\t\t// Allow the GC to collect the cecil type definition\n\t\t\t\tloader = null;\n\t\t\t\tcecilTypeDef = null;\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerable<IUnresolvedMethod> Methods {\n\t\t\t\tget { return Members.OfType<IUnresolvedMethod>(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerable<IUnresolvedProperty> Properties {\n\t\t\t\tget { return Members.OfType<IUnresolvedProperty>(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerable<IUnresolvedField> Fields {\n\t\t\t\tget { return Members.OfType<IUnresolvedField>(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic IEnumerable<IUnresolvedEvent> Events {\n\t\t\t\tget { return Members.OfType<IUnresolvedEvent>(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool AddDefaultConstructorIfRequired {\n\t\t\t\tget { return kind == TypeKind.Struct || kind == TypeKind.Enum; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool? HasExtensionMethods {\n\t\t\t\tget { return flags[FlagHasExtensionMethods]; }\n\t\t\t\t// we always return true or false, never null.\n\t\t\t\t// FlagHasNoExtensionMethods is unused in LazyCecilTypeDefinition\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool IsPartial {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override object Clone()\n\t\t\t{\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic IType Resolve(ITypeResolveContext context)\n\t\t\t{\n\t\t\t\tif (context == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"context\");\n\t\t\t\tif (context.CurrentAssembly == null)\n\t\t\t\t\tthrow new ArgumentException(\"An ITypeDefinition cannot be resolved in a context without a current assembly.\");\n\t\t\t\treturn context.CurrentAssembly.GetTypeDefinition(this.FullTypeName)\n\t\t\t\t\t?? (IType)new UnknownType(this.Namespace, this.Name, this.TypeParameters.Count);\n\t\t\t}\n\t\t\t\n\t\t\tpublic ITypeResolveContext CreateResolveContext(ITypeResolveContext parentContext)\n\t\t\t{\n\t\t\t\treturn parentContext;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Method\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedMethod ReadMethod(MethodDefinition method, IUnresolvedTypeDefinition parentType, SymbolKind methodType = SymbolKind.Method)\n\t\t{\n\t\t\treturn ReadMethod(method, parentType, methodType, null);\n\t\t}\n\t\t\n\t\tIUnresolvedMethod ReadMethod(MethodDefinition method, IUnresolvedTypeDefinition parentType, SymbolKind methodType, IUnresolvedMember accessorOwner)\n\t\t{\n\t\t\tif (method == null)\n\t\t\t\treturn null;\n\t\t\tDefaultUnresolvedMethod m = new DefaultUnresolvedMethod(parentType, method.Name);\n\t\t\tm.SymbolKind = methodType;\n\t\t\tm.AccessorOwner = accessorOwner;\n\t\t\tm.HasBody = method.HasBody;\n\t\t\tif (method.HasGenericParameters) {\n\t\t\t\tfor (int i = 0; i < method.GenericParameters.Count; i++) {\n\t\t\t\t\tif (method.GenericParameters[i].Position != i)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"g.Position != i\");\n\t\t\t\t\tm.TypeParameters.Add(new DefaultUnresolvedTypeParameter(\n\t\t\t\t\t\tSymbolKind.Method, i, method.GenericParameters[i].Name));\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < method.GenericParameters.Count; i++) {\n\t\t\t\t\tvar tp = (DefaultUnresolvedTypeParameter)m.TypeParameters[i];\n\t\t\t\t\tAddConstraints(tp, method.GenericParameters[i]);\n\t\t\t\t\ttp.ApplyInterningProvider(interningProvider);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tm.ReturnType = ReadTypeReference(method.ReturnType, typeAttributes: method.MethodReturnType);\n\t\t\t\n\t\t\tif (HasAnyAttributes(method))\n\t\t\t\tAddAttributes(method, m.Attributes, m.ReturnTypeAttributes);\n\t\t\tTranslateModifiers(method, m);\n\t\t\t\n\t\t\tif (method.HasParameters) {\n\t\t\t\tforeach (ParameterDefinition p in method.Parameters) {\n\t\t\t\t\tm.Parameters.Add(ReadParameter(p));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// mark as extension method if the attribute is set\n\t\t\tif (method.IsStatic && HasExtensionAttribute(method)) {\n\t\t\t\tm.IsExtensionMethod = true;\n\t\t\t}\n\n\t\t\tint lastDot = method.Name.LastIndexOf('.');\n\t\t\tif (lastDot >= 0 && method.HasOverrides) {\n\t\t\t\t// To be consistent with the parser-initialized type system, shorten the method name:\n\t\t\t\tm.Name = method.Name.Substring(lastDot + 1);\n\t\t\t\tm.IsExplicitInterfaceImplementation = true;\n\t\t\t\tforeach (var or in method.Overrides) {\n\t\t\t\t\tm.ExplicitInterfaceImplementations.Add(new DefaultMemberReference(\n\t\t\t\t\t\taccessorOwner != null ? SymbolKind.Accessor : SymbolKind.Method,\n\t\t\t\t\t\tReadTypeReference(or.DeclaringType),\n\t\t\t\t\t\tor.Name, or.GenericParameters.Count, m.Parameters.Select(p => p.Type).ToList()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFinishReadMember(m, method);\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\tstatic bool HasExtensionAttribute(ICustomAttributeProvider provider)\n\t\t{\n\t\t\tif (provider.HasCustomAttributes) {\n\t\t\t\tforeach (var attr in provider.CustomAttributes) {\n\t\t\t\t\tif (attr.AttributeType.Name == \"ExtensionAttribute\" && attr.AttributeType.Namespace == \"System.Runtime.CompilerServices\")\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool IsVisible(MethodAttributes att)\n\t\t{\n\t\t\tatt &= MethodAttributes.MemberAccessMask;\n\t\t\treturn IncludeInternalMembers\n\t\t\t\t|| att == MethodAttributes.Public\n\t\t\t\t|| att == MethodAttributes.Family\n\t\t\t\t|| att == MethodAttributes.FamORAssem;\n\t\t}\n\t\t\n\t\tstatic Accessibility GetAccessibility(MethodAttributes attr)\n\t\t{\n\t\t\tswitch (attr & MethodAttributes.MemberAccessMask) {\n\t\t\t\tcase MethodAttributes.Public:\n\t\t\t\t\treturn Accessibility.Public;\n\t\t\t\tcase MethodAttributes.FamANDAssem:\n\t\t\t\t\treturn Accessibility.ProtectedAndInternal;\n\t\t\t\tcase MethodAttributes.Assembly:\n\t\t\t\t\treturn Accessibility.Internal;\n\t\t\t\tcase MethodAttributes.Family:\n\t\t\t\t\treturn Accessibility.Protected;\n\t\t\t\tcase MethodAttributes.FamORAssem:\n\t\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Accessibility.Private;\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid TranslateModifiers(MethodDefinition method, AbstractUnresolvedMember m)\n\t\t{\n\t\t\tif (m.DeclaringTypeDefinition.Kind == TypeKind.Interface) {\n\t\t\t\t// interface members don't have modifiers, but we want to handle them as \"public abstract\"\n\t\t\t\tm.Accessibility = Accessibility.Public;\n\t\t\t\tm.IsAbstract = true;\n\t\t\t} else {\n\t\t\t\tm.Accessibility = GetAccessibility(method.Attributes);\n\t\t\t\tif (method.IsAbstract) {\n\t\t\t\t\tm.IsAbstract = true;\n\t\t\t\t\tm.IsOverride = !method.IsNewSlot;\n\t\t\t\t} else if (method.IsFinal) {\n\t\t\t\t\tif (!method.IsNewSlot) {\n\t\t\t\t\t\tm.IsSealed = true;\n\t\t\t\t\t\tm.IsOverride = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (method.IsVirtual) {\n\t\t\t\t\tif (method.IsNewSlot)\n\t\t\t\t\t\tm.IsVirtual = true;\n\t\t\t\t\telse\n\t\t\t\t\t\tm.IsOverride = true;\n\t\t\t\t}\n\t\t\t\tm.IsStatic = method.IsStatic;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Parameter\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedParameter ReadParameter(ParameterDefinition parameter)\n\t\t{\n\t\t\tif (parameter == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameter\");\n\t\t\tvar type = ReadTypeReference(parameter.ParameterType, typeAttributes: parameter);\n\t\t\tvar p = new DefaultUnresolvedParameter(type, interningProvider.Intern(parameter.Name));\n\t\t\t\n\t\t\tif (parameter.ParameterType is Mono.Cecil.ByReferenceType) {\n\t\t\t\tif (!parameter.IsIn && parameter.IsOut)\n\t\t\t\t\tp.IsOut = true;\n\t\t\t\telse\n\t\t\t\t\tp.IsRef = true;\n\t\t\t}\n\t\t\tAddAttributes(parameter, p);\n\t\t\t\n\t\t\tif (parameter.IsOptional) {\n\t\t\t\tp.DefaultValue = CreateSimpleConstantValue(type, parameter.Constant);\n\t\t\t}\n\t\t\t\n\t\t\tif (parameter.ParameterType is Mono.Cecil.ArrayType) {\n\t\t\t\tforeach (CustomAttribute att in parameter.CustomAttributes) {\n\t\t\t\t\tif (att.AttributeType.FullName == typeof(ParamArrayAttribute).FullName) {\n\t\t\t\t\t\tp.IsParams = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn interningProvider.Intern(p);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Field\n\t\tbool IsVisible(FieldAttributes att)\n\t\t{\n\t\t\tatt &= FieldAttributes.FieldAccessMask;\n\t\t\treturn IncludeInternalMembers\n\t\t\t\t|| att == FieldAttributes.Public\n\t\t\t\t|| att == FieldAttributes.Family\n\t\t\t\t|| att == FieldAttributes.FamORAssem;\n\t\t}\n\n\t\tdecimal? TryDecodeDecimalConstantAttribute(CustomAttribute attribute)\n\t\t{\n\t\t\tif (attribute.ConstructorArguments.Count != 5)\n\t\t\t\treturn null;\n\n\t\t\tBlobReader reader = new BlobReader(attribute.GetBlob(), null);\n\t\t\tif (reader.ReadUInt16() != 0x0001) {\n\t\t\t\tDebug.WriteLine(\"Unknown blob prolog\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// DecimalConstantAttribute has the arguments (byte scale, byte sign, uint hi, uint mid, uint low) or (byte scale, byte sign, int hi, int mid, int low)\n\t\t\t// Both of these invoke the Decimal constructor (int lo, int mid, int hi, bool isNegative, byte scale) with explicit argument conversions if required.\n\t\t\tvar ctorArgs = new object[attribute.ConstructorArguments.Count];\n\t\t\tfor (int i = 0; i < ctorArgs.Length; i++) {\n\t\t\t\tswitch (attribute.ConstructorArguments[i].Type.FullName) {\n\t\t\t\t\tcase \"System.Byte\":\n\t\t\t\t\t\tctorArgs[i] = reader.ReadByte();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"System.Int32\":\n\t\t\t\t\t\tctorArgs[i] = reader.ReadInt32();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"System.UInt32\":\n\t\t\t\t\t\tctorArgs[i] = unchecked((int)reader.ReadUInt32());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ctorArgs.Select(a => a.GetType()).SequenceEqual(new[] { typeof(byte), typeof(byte), typeof(int), typeof(int), typeof(int) }))\n\t\t\t\treturn null;\n\n\t\t\treturn new decimal((int)ctorArgs[4], (int)ctorArgs[3], (int)ctorArgs[2], (byte)ctorArgs[1] != 0, (byte)ctorArgs[0]);\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedField ReadField(FieldDefinition field, IUnresolvedTypeDefinition parentType)\n\t\t{\n\t\t\tif (field == null)\n\t\t\t\tthrow new ArgumentNullException(\"field\");\n\t\t\tif (parentType == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentType\");\n\t\t\t\n\t\t\tDefaultUnresolvedField f = new DefaultUnresolvedField(parentType, field.Name);\n\t\t\tf.Accessibility = GetAccessibility(field.Attributes);\n\t\t\tf.IsReadOnly = field.IsInitOnly;\n\t\t\tf.IsStatic = field.IsStatic;\n\t\t\tf.ReturnType = ReadTypeReference(field.FieldType, typeAttributes: field);\n\t\t\tif (field.HasConstant) {\n\t\t\t\tf.ConstantValue = CreateSimpleConstantValue(f.ReturnType, field.Constant);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar decConstant = field.CustomAttributes.FirstOrDefault(a => a.AttributeType.FullName == \"System.Runtime.CompilerServices.DecimalConstantAttribute\");\n\t\t\t\tif (decConstant != null) {\n\t\t\t\t\tvar constValue = TryDecodeDecimalConstantAttribute(decConstant);\n\t\t\t\t\tif (constValue != null)\n\t\t\t\t\t\tf.ConstantValue = CreateSimpleConstantValue(f.ReturnType, constValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddAttributes(field, f);\n\t\t\t\n\t\t\tRequiredModifierType modreq = field.FieldType as RequiredModifierType;\n\t\t\tif (modreq != null && modreq.ModifierType.FullName == typeof(IsVolatile).FullName) {\n\t\t\t\tf.IsVolatile = true;\n\t\t\t}\n\t\t\t\n\t\t\tFinishReadMember(f, field);\n\t\t\treturn f;\n\t\t}\n\t\t\n\t\tstatic Accessibility GetAccessibility(FieldAttributes attr)\n\t\t{\n\t\t\tswitch (attr & FieldAttributes.FieldAccessMask) {\n\t\t\t\tcase FieldAttributes.Public:\n\t\t\t\t\treturn Accessibility.Public;\n\t\t\t\tcase FieldAttributes.FamANDAssem:\n\t\t\t\t\treturn Accessibility.ProtectedAndInternal;\n\t\t\t\tcase FieldAttributes.Assembly:\n\t\t\t\t\treturn Accessibility.Internal;\n\t\t\t\tcase FieldAttributes.Family:\n\t\t\t\t\treturn Accessibility.Protected;\n\t\t\t\tcase FieldAttributes.FamORAssem:\n\t\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Accessibility.Private;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type Parameter Constraints\n\t\tvoid AddConstraints(DefaultUnresolvedTypeParameter tp, GenericParameter g)\n\t\t{\n\t\t\tswitch (g.Attributes & GenericParameterAttributes.VarianceMask) {\n\t\t\t\tcase GenericParameterAttributes.Contravariant:\n\t\t\t\t\ttp.Variance = VarianceModifier.Contravariant;\n\t\t\t\t\tbreak;\n\t\t\t\tcase GenericParameterAttributes.Covariant:\n\t\t\t\t\ttp.Variance = VarianceModifier.Covariant;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\ttp.HasReferenceTypeConstraint = g.HasReferenceTypeConstraint;\n\t\t\ttp.HasValueTypeConstraint = g.HasNotNullableValueTypeConstraint;\n\t\t\ttp.HasDefaultConstructorConstraint = g.HasDefaultConstructorConstraint;\n\t\t\t\n\t\t\tif (g.HasConstraints) {\n\t\t\t\tforeach (TypeReference constraint in g.Constraints) {\n\t\t\t\t\ttp.Constraints.Add(ReadTypeReference(constraint));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Property\n\n\t\tAccessibility MergePropertyAccessibility (Accessibility left, Accessibility right)\n\t\t{\n\t\t\tif (left == Accessibility.Public || right == Accessibility.Public)\n\t\t\t\treturn Accessibility.Public;\n\n\t\t\tif (left == Accessibility.ProtectedOrInternal || right == Accessibility.ProtectedOrInternal)\n\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\n\t\t\tif (left == Accessibility.Protected && right == Accessibility.Internal ||\n\t\t\t    left == Accessibility.Internal && right == Accessibility.Protected)\n\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\n\t\t\tif (left == Accessibility.Protected || right == Accessibility.Protected)\n\t\t\t\treturn Accessibility.Protected;\n\n\t\t\tif (left == Accessibility.Internal || right == Accessibility.Internal)\n\t\t\t\treturn Accessibility.Internal;\n\n\t\t\tif (left == Accessibility.ProtectedAndInternal || right == Accessibility.ProtectedAndInternal)\n\t\t\t\treturn Accessibility.ProtectedAndInternal;\n\n\t\t\treturn left;\n\t\t}\n\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedProperty ReadProperty(PropertyDefinition property, IUnresolvedTypeDefinition parentType, SymbolKind propertyType = SymbolKind.Property)\n\t\t{\n\t\t\tif (property == null)\n\t\t\t\tthrow new ArgumentNullException(\"property\");\n\t\t\tif (parentType == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentType\");\n\t\t\tDefaultUnresolvedProperty p = new DefaultUnresolvedProperty(parentType, property.Name);\n\t\t\tp.SymbolKind = propertyType;\n\t\t\tTranslateModifiers(property.GetMethod ?? property.SetMethod, p);\n\t\t\tif (property.GetMethod != null && property.SetMethod != null)\n\t\t\t\tp.Accessibility = MergePropertyAccessibility (GetAccessibility (property.GetMethod.Attributes), GetAccessibility (property.SetMethod.Attributes));\n\n\t\t\tp.ReturnType = ReadTypeReference(property.PropertyType, typeAttributes: property);\n\t\t\t\n\t\t\tp.Getter = ReadMethod(property.GetMethod, parentType, SymbolKind.Accessor, p);\n\t\t\tp.Setter = ReadMethod(property.SetMethod, parentType, SymbolKind.Accessor, p);\n\t\t\t\n\t\t\tif (property.HasParameters) {\n\t\t\t\tforeach (ParameterDefinition par in property.Parameters) {\n\t\t\t\t\tp.Parameters.Add(ReadParameter(par));\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddAttributes(property, p);\n\n\t\t\tvar accessor = p.Getter ?? p.Setter;\n\t\t\tif (accessor != null && accessor.IsExplicitInterfaceImplementation) {\n\t\t\t\tp.Name = property.Name.Substring(property.Name.LastIndexOf('.') + 1);\n\t\t\t\tp.IsExplicitInterfaceImplementation = true;\n\t\t\t\tforeach (var mr in accessor.ExplicitInterfaceImplementations) {\n\t\t\t\t\tp.ExplicitInterfaceImplementations.Add(new AccessorOwnerMemberReference(mr));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFinishReadMember(p, property);\n\t\t\treturn p;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Event\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedEvent ReadEvent(EventDefinition ev, IUnresolvedTypeDefinition parentType)\n\t\t{\n\t\t\tif (ev == null)\n\t\t\t\tthrow new ArgumentNullException(\"ev\");\n\t\t\tif (parentType == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentType\");\n\t\t\t\n\t\t\tDefaultUnresolvedEvent e = new DefaultUnresolvedEvent(parentType, ev.Name);\n\t\t\tTranslateModifiers(ev.AddMethod, e);\n\t\t\te.ReturnType = ReadTypeReference(ev.EventType, typeAttributes: ev);\n\t\t\t\n\t\t\te.AddAccessor    = ReadMethod(ev.AddMethod,    parentType, SymbolKind.Accessor, e);\n\t\t\te.RemoveAccessor = ReadMethod(ev.RemoveMethod, parentType, SymbolKind.Accessor, e);\n\t\t\te.InvokeAccessor = ReadMethod(ev.InvokeMethod, parentType, SymbolKind.Accessor, e);\n\t\t\t\n\t\t\tAddAttributes(ev, e);\n\t\t\t\n\t\t\tvar accessor = e.AddAccessor ?? e.RemoveAccessor ?? e.InvokeAccessor;\n\t\t\tif (accessor != null && accessor.IsExplicitInterfaceImplementation) {\n\t\t\t\te.Name = ev.Name.Substring(ev.Name.LastIndexOf('.') + 1);\n\t\t\t\te.IsExplicitInterfaceImplementation = true;\n\t\t\t\tforeach (var mr in accessor.ExplicitInterfaceImplementations) {\n\t\t\t\t\te.ExplicitInterfaceImplementations.Add(new AccessorOwnerMemberReference(mr));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFinishReadMember(e, ev);\n\t\t\t\n\t\t\treturn e;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region FinishReadMember / Interning\n\t\tvoid FinishReadMember(AbstractUnresolvedMember member, MemberReference cecilDefinition)\n\t\t{\n\t\t\tmember.ApplyInterningProvider(interningProvider);\n\t\t\tmember.Freeze();\n\t\t\tRegisterCecilObject(member, cecilDefinition);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type system translation table\n\t\treadonly Dictionary<object, object> typeSystemTranslationTable;\n\t\t\n\t\tvoid RegisterCecilObject(IUnresolvedEntity typeSystemObject, MemberReference cecilObject)\n\t\t{\n\t\t\tif (OnEntityLoaded != null)\n\t\t\t\tOnEntityLoaded(typeSystemObject, cecilObject);\n\t\t\t\n\t\t\tAddToTypeSystemTranslationTable(typeSystemObject, cecilObject);\n\t\t}\n\t\t\n\t\tvoid AddToTypeSystemTranslationTable(object typeSystemObject, object cecilObject)\n\t\t{\n\t\t\tif (typeSystemTranslationTable != null) {\n\t\t\t\t// When lazy-loading, the dictionary might be shared between multiple cecil-loaders that are used concurrently\n\t\t\t\tlock (typeSystemTranslationTable) {\n\t\t\t\t\ttypeSystemTranslationTable[typeSystemObject] = cecilObject;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tT InternalGetCecilObject<T> (object typeSystemObject) where T : class\n\t\t{\n\t\t\tif (typeSystemObject == null)\n\t\t\t\tthrow new ArgumentNullException (\"typeSystemObject\");\n\t\t\tif (!HasCecilReferences)\n\t\t\t\tthrow new NotSupportedException (\"This instance contains no cecil references.\");\n\t\t\tobject result;\n\t\t\tlock (typeSystemTranslationTable) {\n\t\t\t\tif (!typeSystemTranslationTable.TryGetValue (typeSystemObject, out result))\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn result as T;\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic AssemblyDefinition GetCecilObject (IUnresolvedAssembly content)\n\t\t{\n\t\t\treturn InternalGetCecilObject<AssemblyDefinition> (content);\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic TypeDefinition GetCecilObject (IUnresolvedTypeDefinition type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException (\"type\");\n\t\t\treturn InternalGetCecilObject<TypeDefinition> (type);\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic MethodDefinition GetCecilObject (IUnresolvedMethod method)\n\t\t{\n\t\t\treturn InternalGetCecilObject<MethodDefinition> (method);\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic FieldDefinition GetCecilObject (IUnresolvedField field)\n\t\t{\n\t\t\treturn InternalGetCecilObject<FieldDefinition> (field);\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic EventDefinition GetCecilObject (IUnresolvedEvent evt)\n\t\t{\n\t\t\treturn InternalGetCecilObject<EventDefinition> (evt);\n\t\t}\n\t\t\n\t\t[CLSCompliant(false)]\n\t\tpublic PropertyDefinition GetCecilObject (IUnresolvedProperty property)\n\t\t{\n\t\t\treturn InternalGetCecilObject<PropertyDefinition> (property);\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Cecil/ICSharpCode.NRefactory.Cecil.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <ProjectGuid>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</ProjectGuid>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.Cecil</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.Cecil</AssemblyName>\r\n    <SignAssembly>true</SignAssembly>\r\n    <AssemblyOriginatorKeyFile>..\\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>\r\n    <NoWin32Manifest>False</NoWin32Manifest>\r\n    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>\r\n    <NoStdLib>False</NoStdLib>\r\n    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>\r\n    <IntermediateOutputPath>obj\\$(Configuration)\\</IntermediateOutputPath>\r\n    <DocumentationFile>bin\\$(Configuration)\\ICSharpCode.NRefactory.Cecil.xml</DocumentationFile>\r\n    <NoWarn>1591</NoWarn>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <OutputPath>bin\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <BaseIntermediateOutputPath>obj\\</BaseIntermediateOutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <BaseAddress>4194304</BaseAddress>\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n    <RegisterForComInterop>False</RegisterForComInterop>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <FileAlignment>4096</FileAlignment>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"CecilLoader.cs\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\..\\cecil\\Mono.Cecil.csproj\">\r\n      <Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>\r\n      <Name>Mono.Cecil</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Cecil/Properties/AssemblyInfo.cs",
    "content": "//\n// AssemblyInfo.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Reflection;\n\n// Information about this assembly is defined by the following attributes. \n// Change them to the values specific to your project.\n\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.Cecil\")]\n[assembly: AssemblyDescription(\"Cecil Assembly Loader for NRefactory\")]\n\n[assembly: CLSCompliant(true)]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/CSharpFile.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\tpublic class CSharpFile\n\t{\n\t\tpublic readonly CSharpProject Project;\n\t\tpublic readonly string FileName;\n\t\tpublic readonly string OriginalText;\n\t\t\n\t\tpublic SyntaxTree SyntaxTree;\n\t\tpublic CSharpUnresolvedFile UnresolvedTypeSystemForFile;\n\t\t\n\t\tpublic CSharpFile(CSharpProject project, string fileName)\n\t\t{\n\t\t\tthis.Project = project;\n\t\t\tthis.FileName = fileName;\n\t\t\t\n\t\t\tCSharpParser p = new CSharpParser(project.CompilerSettings);\n//\t\t\tusing (var stream = File.OpenRead(fileName)) {\n//\t\t\t\tthis.CompilationUnit = p.Parse(stream, fileName);\n//\t\t\t}\n\t\t\t\n\t\t\t// Keep the original text around; we might use it for a refactoring later\n\t\t\tthis.OriginalText = File.ReadAllText(fileName);\n\t\t\tthis.SyntaxTree = p.Parse(this.OriginalText, fileName);\n\t\t\tthis.SyntaxTree.Freeze(); // the various tests shouldn't modify the AST shared by all tests\n\t\t\t\n\t\t\tif (p.HasErrors) {\n\t\t\t\tConsole.WriteLine(\"Error parsing \" + fileName + \":\");\n\t\t\t\tforeach (var error in p.ErrorsAndWarnings) {\n\t\t\t\t\tConsole.WriteLine(\"  \" + error.Region + \" \" + error.Message);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.UnresolvedTypeSystemForFile = this.SyntaxTree.ToTypeSystem();\n\t\t}\n\t\t\n\t\tpublic CSharpAstResolver CreateResolver()\n\t\t{\n\t\t\treturn new CSharpAstResolver(Project.Compilation, SyntaxTree, UnresolvedTypeSystemForFile);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/CSharpProject.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing Microsoft.Build.Framework;\nusing Microsoft.Build.Logging;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\t/// <summary>\n\t/// Represents a C# project (.csproj file)\n\t/// </summary>\n\tpublic class CSharpProject\n\t{\n\t\t/// <summary>\n\t\t/// Parent solution.\n\t\t/// </summary>\n\t\tpublic readonly Solution Solution;\n\t\t\n\t\t/// <summary>\n\t\t/// Title is the project name as specified in the .sln file.\n\t\t/// </summary>\n\t\tpublic readonly string Title;\n\t\t\n\t\t/// <summary>\n\t\t/// Name of the output assembly.\n\t\t/// </summary>\n\t\tpublic readonly string AssemblyName;\n\t\t\n\t\t/// <summary>\n\t\t/// Full path to the .csproj file.\n\t\t/// </summary>\n\t\tpublic readonly string FileName;\n\t\t\n\t\tpublic readonly List<CSharpFile> Files = new List<CSharpFile>();\n\t\t\n\t\tpublic readonly CompilerSettings CompilerSettings = new CompilerSettings();\n\t\t\n\t\t/// <summary>\n\t\t/// The unresolved type system for this project.\n\t\t/// </summary>\n\t\tpublic readonly IProjectContent ProjectContent;\n\t\t\n\t\t/// <summary>\n\t\t/// The resolved type system for this project.\n\t\t/// This field is initialized once all projects have been loaded (in Solution constructor).\n\t\t/// </summary>\n\t\tpublic ICompilation Compilation;\n\t\t\n\t\tpublic CSharpProject(Solution solution, string title, string fileName)\n\t\t{\n\t\t\t// Normalize the file name\n\t\t\tfileName = Path.GetFullPath(fileName);\n\t\t\t\n\t\t\tthis.Solution = solution;\n\t\t\tthis.Title = title;\n\t\t\tthis.FileName = fileName;\n\t\t\t\n\t\t\t// Use MSBuild to open the .csproj\n\t\t\tvar msbuildProject = new Microsoft.Build.Evaluation.Project(fileName);\n\t\t\t// Figure out some compiler settings\n\t\t\tthis.AssemblyName = msbuildProject.GetPropertyValue(\"AssemblyName\");\n\t\t\tthis.CompilerSettings.AllowUnsafeBlocks = GetBoolProperty(msbuildProject, \"AllowUnsafeBlocks\") ?? false;\n\t\t\tthis.CompilerSettings.CheckForOverflow = GetBoolProperty(msbuildProject, \"CheckForOverflowUnderflow\") ?? false;\n\t\t\tstring defineConstants = msbuildProject.GetPropertyValue(\"DefineConstants\");\n\t\t\tforeach (string symbol in defineConstants.Split(new char[] { ';', ',' }, StringSplitOptions.RemoveEmptyEntries))\n\t\t\t\tthis.CompilerSettings.ConditionalSymbols.Add(symbol.Trim());\n\t\t\t\n\t\t\t// Initialize the unresolved type system\n\t\t\tIProjectContent pc = new CSharpProjectContent();\n\t\t\tpc = pc.SetAssemblyName(this.AssemblyName);\n\t\t\tpc = pc.SetProjectFileName(fileName);\n\t\t\tpc = pc.SetCompilerSettings(this.CompilerSettings);\n\t\t\t// Parse the C# code files\n\t\t\tforeach (var item in msbuildProject.GetItems(\"Compile\")) {\n\t\t\t\tvar file = new CSharpFile(this, Path.Combine(msbuildProject.DirectoryPath, item.EvaluatedInclude));\n\t\t\t\tFiles.Add(file);\n\t\t\t}\n\t\t\t// Add parsed files to the type system\n\t\t\tpc = pc.AddOrUpdateFiles(Files.Select(f => f.UnresolvedTypeSystemForFile));\n\t\t\t\n\t\t\t// Add referenced assemblies:\n\t\t\tforeach (string assemblyFile in ResolveAssemblyReferences(msbuildProject)) {\n\t\t\t\tIUnresolvedAssembly assembly = solution.LoadAssembly(assemblyFile);\n\t\t\t\tpc = pc.AddAssemblyReferences(new [] { assembly });\n\t\t\t}\n\t\t\t\n\t\t\t// Add project references:\n\t\t\tforeach (var item in msbuildProject.GetItems(\"ProjectReference\")) {\n\t\t\t\tstring referencedFileName = Path.Combine(msbuildProject.DirectoryPath, item.EvaluatedInclude);\n\t\t\t\t// Normalize the path; this is required to match the name with the referenced project's file name\n\t\t\t\treferencedFileName = Path.GetFullPath(referencedFileName);\n\t\t\t\tpc = pc.AddAssemblyReferences(new[] { new ProjectReference(referencedFileName) });\n\t\t\t}\n\t\t\tthis.ProjectContent = pc;\n\t\t}\n\t\t\n\t\tIEnumerable<string> ResolveAssemblyReferences(Microsoft.Build.Evaluation.Project project)\n\t\t{\n\t\t\t// Use MSBuild to figure out the full path of the referenced assemblies\n\t\t\tvar projectInstance = project.CreateProjectInstance();\n\t\t\tprojectInstance.SetProperty(\"BuildingProject\", \"false\");\n\t\t\tproject.SetProperty(\"DesignTimeBuild\", \"true\");\n\t\t\t\n\t\t\tprojectInstance.Build(\"ResolveAssemblyReferences\", new [] { new ConsoleLogger(LoggerVerbosity.Minimal) });\n\t\t\tvar items = projectInstance.GetItems(\"_ResolveAssemblyReferenceResolvedFiles\");\n\t\t\tstring baseDirectory = Path.GetDirectoryName(this.FileName);\n\t\t\tvar result = items.Select(i => Path.Combine(baseDirectory, i.GetMetadataValue(\"Identity\"))).ToList();\n\t\t\tif (!result.Any(t => t.Contains(\"mscorlib\") || t.Contains(\"System.Runtime\")))\n\t\t\t\tresult.Add(typeof(object).Assembly.Location);\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\tstatic bool? GetBoolProperty(Microsoft.Build.Evaluation.Project p, string propertyName)\n\t\t{\n\t\t\tstring val = p.GetPropertyValue(propertyName);\n\t\t\tbool result;\n\t\t\tif (bool.TryParse(val, out result))\n\t\t\t\treturn result;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"[CSharpProject AssemblyName={0}]\", AssemblyName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/FindReferencesConsistencyCheck.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\tpublic class FindReferencesConsistencyCheck\n\t{\n\t\treadonly Solution solution;\n\t\tDictionary<IEntity, HashSet<AstNode>> referenceDict = new Dictionary<IEntity, HashSet<AstNode>>();\n\t\t\n\t\tpublic FindReferencesConsistencyCheck(Solution solution)\n\t\t{\n\t\t\tthis.solution = solution;\n\t\t}\n\t\t\n\t\tpublic void Run()\n\t\t{\n\t\t\tusing (new Timer(\"Finding referenced entities... \")) {\n\t\t\t\tforeach (var file in solution.AllFiles) {\n\t\t\t\t\tvar navigator = new FindReferencedEntities(\n\t\t\t\t\t\tdelegate (AstNode node, IEntity entity) {\n\t\t\t\t\t\t\tif (node == null)\n\t\t\t\t\t\t\t\tthrow new ArgumentNullException(\"node\");\n\t\t\t\t\t\t\tif (entity == null)\n\t\t\t\t\t\t\t\tthrow new ArgumentNullException(\"entity\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!IgnoreEntity(entity)) {\n\t\t\t\t\t\t\t\tHashSet<AstNode> list;\n\t\t\t\t\t\t\t\tif (!referenceDict.TryGetValue(entity, out list)) {\n\t\t\t\t\t\t\t\t\tlist = new HashSet<AstNode>();\n\t\t\t\t\t\t\t\t\treferenceDict.Add(entity, list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlist.Add(node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tfile.CreateResolver().ApplyNavigator(navigator);\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(\"For each entity, find all references...\");\n\t\t\tStopwatch w = Stopwatch.StartNew();\n\t\t\tforeach (var project in solution.Projects) {\n\t\t\t\tforeach (var type in project.Compilation.MainAssembly.GetAllTypeDefinitions()) {\n\t\t\t\t\tTestFindReferences(type);\n\t\t\t\t\tforeach (IMember m in type.Members) {\n\t\t\t\t\t\tTestFindReferences(m);\n\t\t\t\t\t}\n\t\t\t\t\tConsole.Write('.');\n\t\t\t\t}\n\t\t\t}\n\t\t\tw.Stop();\n\t\t\tConsole.WriteLine(\"FindReferencesConsistencyCheck is done ({0}).\", w.Elapsed);\n\t\t\tPrintTimingsPerEntityType();\n\t\t}\n\t\t\n\t\tbool IgnoreEntity(IEntity entity)\n\t\t{\n\t\t\treturn false;\n\t\t\t//return entity.FullName != \"ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultResolvedTypeDefinition.parts\";\n\t\t}\n\t\t\n\t\tDictionary<SymbolKind, TimeSpan> timings = new Dictionary<SymbolKind, TimeSpan>();\n\t\tDictionary<SymbolKind, int> entityCount = new Dictionary<SymbolKind, int>();\n\t\t\n\t\tvoid TestFindReferences(IEntity entity)\n\t\t{\n\t\t\tif (IgnoreEntity(entity))\n\t\t\t\treturn;\n\t\t\tFindReferences fr = new FindReferences();\n\t\t\tfr.FindTypeReferencesEvenIfAliased = true;\n\t\t\t\n\t\t\tStopwatch w = new Stopwatch();\n\t\t\tvar searchScopes = fr.GetSearchScopes(entity);\n\t\t\tforeach (var project in solution.Projects) {\n\t\t\t\tw.Restart();\n\t\t\t\tHashSet<AstNode> foundReferences = new HashSet<AstNode>();\n\t\t\t\tvar interestingFiles = new HashSet<CSharpFile>();\n\t\t\t\tforeach (var searchScope in searchScopes) {\n\t\t\t\t\tforeach (var unresolvedFile in fr.GetInterestingFiles(searchScope, project.Compilation)) {\n\t\t\t\t\t\tvar file = project.Files.Single(f => f.FileName == unresolvedFile.FileName);\n\t\t\t\t\t\tDebug.Assert(file.UnresolvedTypeSystemForFile == unresolvedFile);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Skip file if it doesn't contain the search term\n\t\t\t\t\t\tif (searchScope.SearchTerm != null && file.OriginalText.IndexOf(searchScope.SearchTerm, StringComparison.Ordinal) < 0)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\tinterestingFiles.Add(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (var file in interestingFiles) {\n\t\t\t\t\tfr.FindReferencesInFile(searchScopes, file.UnresolvedTypeSystemForFile, file.SyntaxTree, project.Compilation,\n\t\t\t\t\t                        delegate(AstNode node, ResolveResult result) {\n\t\t\t\t\t                        \tfoundReferences.Add(node);\n\t\t\t\t\t                        }, CancellationToken.None);\n\t\t\t\t}\n\t\t\t\tw.Stop();\n\t\t\t\tif (timings.ContainsKey(entity.SymbolKind)) {\n\t\t\t\t\ttimings[entity.SymbolKind] += w.Elapsed;\n\t\t\t\t} else {\n\t\t\t\t\ttimings[entity.SymbolKind] = w.Elapsed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tIEntity importedEntity = project.Compilation.Import(entity);\n\t\t\t\t\n\t\t\t\tHashSet<AstNode> expectedReferences;\n\t\t\t\tif (importedEntity == null || !referenceDict.TryGetValue(importedEntity, out expectedReferences)) {\n\t\t\t\t\tif (foundReferences.Any()) {\n\t\t\t\t\t\t// There aren't any expected references stored, but we found some references anyways:\n\t\t\t\t\t\tConsole.WriteLine();\n\t\t\t\t\t\tConsole.WriteLine(\"Entity not in reference dictionary: \" + entity);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (foundReferences.Except(expectedReferences).Any()) {\n\t\t\t\t\tConsole.WriteLine();\n\t\t\t\t\tConsole.WriteLine(\"Reference mismatch for \" + entity + \":\");\n\t\t\t\t\tvar n = foundReferences.Except(expectedReferences).First();\n\t\t\t\t\tConsole.WriteLine(\"Found unexpected reference \" + n + \" (\" + n.GetRegion() + \")\");\n\t\t\t\t}\n\t\t\t\tif (expectedReferences.Except(foundReferences).Any()) {\n\t\t\t\t\tConsole.WriteLine();\n\t\t\t\t\tConsole.WriteLine(\"Reference mismatch for \" + entity + \":\");\n\t\t\t\t\tvar n = expectedReferences.Except(foundReferences).First();\n\t\t\t\t\tConsole.WriteLine(\"Did not find expected reference \" + n + \" (\" + n.GetRegion() + \")\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (entityCount.ContainsKey(entity.SymbolKind)) {\n\t\t\t\tentityCount[entity.SymbolKind]++;\n\t\t\t} else {\n\t\t\t\tentityCount[entity.SymbolKind] = 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid PrintTimingsPerEntityType()\n\t\t{\n\t\t\tforeach (var pair in entityCount) {\n\t\t\t\tConsole.WriteLine(\"{0} - avg. {1} per entity\", pair.Key, TimeSpan.FromSeconds(timings[pair.Key].TotalSeconds / pair.Value));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/ICSharpCode.NRefactory.ConsistencyCheck.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" DefaultTargets=\"Build\">\r\n  <PropertyGroup>\r\n    <ProjectGuid>{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}</ProjectGuid>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\r\n    <OutputType>Exe</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.ConsistencyCheck</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.ConsistencyCheck</AssemblyName>\r\n    <TargetFrameworkProfile>\r\n    </TargetFrameworkProfile>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>\r\n    <NoStdLib>False</NoStdLib>\r\n    <WarningLevel>4</WarningLevel>\r\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r\n    <OutputPath>bin\\$(Configuration)\\</OutputPath>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'x86' \">\r\n    <PlatformTarget>x86</PlatformTarget>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>Full</DebugType>\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>Full</DebugType>\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Release' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\r\n    <OutputPath>bin\\Debug\\</OutputPath>\r\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\r\n    <OutputPath>bin\\Release\\</OutputPath>\r\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|x86' \">\r\n    <OutputPath>bin\\net_4_5_Debug\\</OutputPath>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|x86' \">\r\n    <OutputPath>bin\\net_4_5_Release\\</OutputPath>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"Microsoft.Build\" />\r\n    <Reference Include=\"Microsoft.Build.Framework\" />\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\">\r\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r\n    </Reference>\r\n    <Reference Include=\"System.Data\" />\r\n    <Reference Include=\"System.Data.DataSetExtensions\">\r\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r\n    </Reference>\r\n    <Reference Include=\"System.Xml\" />\r\n    <Reference Include=\"System.Xml.Linq\">\r\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r\n    </Reference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"CSharpFile.cs\" />\r\n    <Compile Include=\"CSharpProject.cs\" />\r\n    <Compile Include=\"FindReferencesConsistencyCheck.cs\" />\r\n    <Compile Include=\"PatternMatchingTest.cs\" />\r\n    <Compile Include=\"TypeSystemTests.cs\" />\r\n    <Compile Include=\"Program.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"RandomizedOrderResolverTest.cs\" />\r\n    <Compile Include=\"ResolverTest.cs\" />\r\n    <Compile Include=\"RoundtripTest.cs\" />\r\n    <Compile Include=\"Solution.cs\" />\r\n    <Compile Include=\"VisitorBenchmark.cs\" />\r\n    <Compile Include=\"Xml\\IncrementalXmlParserTests.cs\" />\r\n    <Compile Include=\"Xml\\XmlReaderTest.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"app.config\" />\r\n    <None Include=\"Readme.txt\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.Cecil\\ICSharpCode.NRefactory.Cecil.csproj\">\r\n      <Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>\r\n      <Name>ICSharpCode.NRefactory.Cecil</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.CSharp\\ICSharpCode.NRefactory.CSharp.csproj\">\r\n      <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>\r\n      <Name>ICSharpCode.NRefactory.CSharp</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.Xml\\ICSharpCode.NRefactory.Xml.csproj\">\r\n      <Project>{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}</Project>\r\n      <Name>ICSharpCode.NRefactory.Xml</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.Targets\" />\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/PatternMatchingTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\t/// <summary>\n\t/// Validates pattern matching:\n\t/// Every compilation must match its clone;\n\t/// and mutations to the cloned compilation must prevent the match.\n\t/// </summary>\n\t/// <remarks>\n\t/// This test is SLOW! (due to O(n^2) algorithm).\n\t/// Expect it to take a whole hour!\n\t/// </remarks>\n\tpublic class PatternMatchingTest\n\t{\n\t\tpublic static void RunTest(CSharpFile file)\n\t\t{\n\t\t\tAstNode copy = file.SyntaxTree.Clone();\n\t\t\tif (!copy.IsMatch(file.SyntaxTree))\n\t\t\t\tthrow new InvalidOperationException(\"Clone must match the compilation itself; in \" + file.FileName);\n\t\t\t\n\t\t\t// Mutate identifiers:\n\t\t\tforeach (var id in copy.Descendants.OfType<Identifier>()) {\n\t\t\t\tif (id.Parent is ConstructorDeclaration || id.Parent is DestructorDeclaration)\n\t\t\t\t\tcontinue; // identifier in ctor/dtor isn't relevant for matches\n\t\t\t\tstring oldName = id.Name;\n\t\t\t\tid.Name = \"mutatedName\";\n\t\t\t\tif (copy.IsMatch(file.SyntaxTree))\n\t\t\t\t\tthrow new InvalidOperationException(\"Mutation in \" + id.StartLocation + \" did not prevent the match; in \" + file.FileName);\n\t\t\t\tid.Name = oldName;\n\t\t\t\t//if (!copy.IsMatch(file.SyntaxTree))\n\t\t\t\t//\tthrow new InvalidOperationException(\"Clone must match the compilation itself after resetting the mutation\");\n\t\t\t}\n\t\t\t// Mutate primitive values:\n\t\t\tforeach (var pe in copy.Descendants.OfType<PrimitiveExpression>()) {\n\t\t\t\tif (pe.Ancestors.Any(a => a is PreProcessorDirective))\n\t\t\t\t\tcontinue;\n\t\t\t\tobject oldVal = pe.Value;\n\t\t\t\tpe.Value = \"Mutated \" + \"Value\";\n\t\t\t\tif (copy.IsMatch(file.SyntaxTree))\n\t\t\t\t\tthrow new InvalidOperationException(\"Mutation in \" + pe.StartLocation + \" did not prevent the match; in \" + file.FileName);\n\t\t\t\tpe.Value = oldVal;\n\t\t\t}\n\t\t\tConsole.Write('.');\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Program.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.ConsistencyCheck.Xml;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\tclass Program\n\t{\n\t\tpublic static readonly string[] AssemblySearchPaths = {\n\t\t\t@\"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.0\",\n\t\t\t@\"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\v3.5\",\n\t\t\t@\"C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\",\n\t\t\t@\"C:\\Program Files (x86)\\GtkSharp\\2.12\\lib\\gtk-sharp-2.0\",\n\t\t\t@\"C:\\Program Files (x86)\\GtkSharp\\2.12\\lib\\Mono.Posix\",\n\t\t\t@\"C:\\work\\SD\\src\\Tools\\NUnit\"\n\t\t};\n\t\tpublic const string SolutionFile = @\"C:\\work\\NRefactory\\NRefactory.sln\";\n\t\t//public const string SolutionFile = @\"C:\\work\\SD\\SharpDevelop.sln\";\n\t\t//public const string SolutionFile = @\"C:\\work\\ILSpy\\ILSpy.sln\";\n\t\t\n\t\tpublic const string TempPath = @\"C:\\temp\";\n\t\t\n\t\tstatic Solution solution;\n\t\t\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tusing (new Timer(\"Loading solution... \")) {\n\t\t\t\tsolution = new Solution(SolutionFile);\n\t\t\t}\n\t\t\t\n\t\t\tConsole.WriteLine(\"Loaded {0} lines of code ({1:f1} MB) in {2} files in {3} projects.\",\n\t\t\t                  solution.AllFiles.Sum(f => 1 + f.OriginalText.Count(c => c == '\\n')),\n\t\t\t                  solution.AllFiles.Sum(f => f.OriginalText.Length) / 1024.0 / 1024.0,\n\t\t\t                  solution.AllFiles.Count(),\n\t\t\t                  solution.Projects.Count);\n\t\t\t\n\t\t\t//VisitorBenchmark.Run(solution.AllFiles.Select(f => f.SyntaxTree));\n\t\t\t\n\t\t\tusing (new Timer(\"ID String test... \")) TypeSystemTests.IDStringConsistencyCheck(solution);\n\t\t\tusing (new Timer(\"Resolve unresolved members... \")) TypeSystemTests.ResolvedUnresolvedMembers(solution);\n\t\t\t//RunTestOnAllFiles(\"Roundtripping test\", RoundtripTest.RunTest);\n\t\t\tRunTestOnAllFiles(\"Resolver test\", ResolverTest.RunTest);\n\t\t\tRunTestOnAllFiles(\"Resolver test (no parsed file)\", ResolverTest.RunTestWithoutUnresolvedFile);\n\t\t\tRunTestOnAllFiles(\"Resolver test (randomized order)\", RandomizedOrderResolverTest.RunTest);\n\t\t\tnew FindReferencesConsistencyCheck(solution).Run();\n\t\t\tRunTestOnAllFiles(\"Pattern Matching test\", PatternMatchingTest.RunTest);\n\t\t\t\n\t\t\tConsole.Write(\"Press any key to continue . . . \");\n\t\t\tConsole.ReadKey(true);\n\t\t}\n\t\t\n\t\tstatic void RunTestOnAllFiles(string title, Action<CSharpFile> runTest)\n\t\t{\n\t\t\tusing (new Timer(title + \"... \")) {\n\t\t\t\tforeach (var file in solution.AllFiles) {\n\t\t\t\t\trunTest(file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic ConcurrentDictionary<string, IUnresolvedAssembly> assemblyDict = new ConcurrentDictionary<string, IUnresolvedAssembly>(Platform.FileNameComparer);\n\t\t\n\t\tpublic static IUnresolvedAssembly LoadAssembly(string assemblyFileName)\n\t\t{\n\t\t\treturn assemblyDict.GetOrAdd(assemblyFileName, file => new CecilLoader().LoadAssemblyFile(file));\n\t\t}\n\t}\n\t\n\tsealed class Timer : IDisposable\n\t{\n\t\tStopwatch w = Stopwatch.StartNew();\n\t\t\n\t\tpublic Timer(string title)\n\t\t{\n\t\t\tConsole.Write(title);\n\t\t}\n\t\t\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tConsole.WriteLine(w.Elapsed);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Properties/AssemblyInfo.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\n#region Using directives\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#endregion\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.ConsistencyCheck\")]\n[assembly: AssemblyDescription(\"Loads a solution and performs various self-tests using the parsed code.\")]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/RandomizedOrderResolverTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\tpublic class RandomizedOrderResolverTest\n\t{\n\t\tstatic Random sharedRnd = new Random();\n\t\tCSharpAstResolver resolver;\n\t\tCSharpAstResolver resolveAllResolver;\n\t\t\n\t\tpublic static void RunTest(CSharpFile file)\n\t\t{\n\t\t\tint seed;\n\t\t\tlock (sharedRnd) {\n\t\t\t\tseed = sharedRnd.Next();\n\t\t\t}\n\t\t\tRandom rnd = new Random(seed);\n\t\t\tvar test = new RandomizedOrderResolverTest();\n\t\t\t// Resolve all nodes, but in a random order without using a navigator.\n\t\t\ttest.resolver = new CSharpAstResolver(file.Project.Compilation, file.SyntaxTree, file.UnresolvedTypeSystemForFile);\n\t\t\t// For comparing whether the results are equivalent, we also use a normal 'resolve all' resolver:\n\t\t\ttest.resolveAllResolver = new CSharpAstResolver(file.Project.Compilation, file.SyntaxTree, file.UnresolvedTypeSystemForFile);\n\t\t\ttest.resolveAllResolver.ApplyNavigator(new ResolveAllNavigator(), CancellationToken.None);\n\t\t\t// Prepare list of actions that we need to verify:\n\t\t\tvar actions = new List<Func<bool>>();\n\t\t\tbool checkResults = rnd.Next(0, 2) == 0;\n\t\t\tbool checkStateBefore = rnd.Next(0, 2) == 0;\n\t\t\tbool checkStateAfter = rnd.Next(0, 2) == 0;\n\t\t\tbool checkConversion = rnd.Next(0, 2) == 0;\n\t\t\tbool checkExpectedType = rnd.Next(0, 2) == 0;\n\t\t\tforeach (var _node in file.SyntaxTree.DescendantsAndSelf) {\n\t\t\t\tvar node = _node;\n\t\t\t\tif (CSharpAstResolver.IsUnresolvableNode(node))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (checkResults)\n\t\t\t\t\tactions.Add(() => test.CheckResult(node));\n\t\t\t\tif (checkStateBefore)\n\t\t\t\t\tactions.Add(() => test.CheckStateBefore(node));\n\t\t\t\tif (checkStateAfter)\n\t\t\t\t\tactions.Add(() => test.CheckStateAfter(node));\n\t\t\t\tvar expr = node as Expression;\n\t\t\t\tif (expr != null) {\n\t\t\t\t\tif (checkConversion)\n\t\t\t\t\t\tactions.Add(() => test.CheckConversion(expr));\n\t\t\t\t\tif (checkExpectedType)\n\t\t\t\t\t\tactions.Add(() => test.CheckExpectedType(expr));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Fisher-Yates shuffle\n\t\t\tfor (int i = actions.Count - 1; i > 0; i--) {\n\t\t\t\tint j = rnd.Next(0, i);\n\t\t\t\tvar tmp = actions[i];\n\t\t\t\tactions[i] = actions[j];\n\t\t\t\tactions[j] = tmp;\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var action in actions) {\n\t\t\t\tif (!action()) {\n\t\t\t\t\tConsole.WriteLine(\"Seed for this file was: \" + seed);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool CheckResult(AstNode node)\n\t\t{\n\t\t\tResolveResult expectedResult = resolveAllResolver.Resolve(node);\n\t\t\tResolveResult actualResult = resolver.Resolve(node);\n\t\t\tif (IsEqualResolveResult(expectedResult, actualResult))\n\t\t\t\treturn true;\n\t\t\tConsole.WriteLine(\"Different resolve results for '{0}' at {1} in {2}:\", node, node.StartLocation, node.GetRegion().FileName);\n\t\t\tConsole.WriteLine(\" expected: \" + expectedResult);\n\t\t\tConsole.WriteLine(\" actual:   \" + actualResult);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool CheckStateBefore(AstNode node)\n\t\t{\n\t\t\tvar expectedState = resolveAllResolver.GetResolverStateBefore(node);\n\t\t\tvar actualState = resolver.GetResolverStateBefore(node);\n\t\t\tif (IsEqualResolverState(expectedState, actualState))\n\t\t\t\treturn true;\n\t\t\tConsole.WriteLine(\"Different resolver states before '{0}' at {1} in {2}.\", node, node.StartLocation, node.GetRegion().FileName);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool CheckStateAfter(AstNode node)\n\t\t{\n\t\t\tvar expectedState = resolveAllResolver.GetResolverStateAfter(node);\n\t\t\tvar actualState = resolver.GetResolverStateAfter(node);\n\t\t\tif (IsEqualResolverState(expectedState, actualState))\n\t\t\t\treturn true;\n\t\t\tConsole.WriteLine(\"Different resolver states after '{0}' at {1} in {2}.\", node, node.StartLocation, node.GetRegion().FileName);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool CheckConversion(Expression node)\n\t\t{\n\t\t\tConversion expectedConversion = resolveAllResolver.GetConversion(node);\n\t\t\tConversion actualConversion = resolver.GetConversion(node);\n\t\t\tif (Compare(expectedConversion, actualConversion, typeof(Conversion)))\n\t\t\t\treturn true;\n\t\t\tConsole.WriteLine(\"Different conversions for '{0}' at {1} in {2}:\", node, node.StartLocation, node.GetRegion().FileName);\n\t\t\tConsole.WriteLine(\" expected: \" + expectedConversion);\n\t\t\tConsole.WriteLine(\" actual:   \" + actualConversion);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tbool CheckExpectedType(Expression node)\n\t\t{\n\t\t\tIType expectedExpectedType = resolveAllResolver.GetExpectedType(node);\n\t\t\tIType actualExpectedType = resolver.GetExpectedType(node);\n\t\t\tif (expectedExpectedType.Equals(actualExpectedType))\n\t\t\t\treturn true;\n\t\t\tConsole.WriteLine(\"Different expected types for '{0}' at {1} in {2}:\", node, node.StartLocation, node.GetRegion().FileName);\n\t\t\tConsole.WriteLine(\" expected: \" + expectedExpectedType);\n\t\t\tConsole.WriteLine(\" actual:   \" + actualExpectedType);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tinternal static bool IsEqualResolveResult(ResolveResult rr1, ResolveResult rr2)\n\t\t{\n\t\t\tif (rr1 == rr2)\n\t\t\t\treturn true;\n\t\t\tif (rr1 == null || rr2 == null)\n\t\t\t\treturn false;\n\t\t\tif (rr1.GetType() != rr2.GetType())\n\t\t\t\treturn false;\n\t\t\tbool eq = true;\n\t\t\tforeach (var property in rr1.GetType().GetProperties()) {\n\t\t\t\tobject val1 = property.GetValue(rr1, null);\n\t\t\t\tobject val2 = property.GetValue(rr2, null);\n\t\t\t\teq &= Compare(val1, val2, property.PropertyType);\n\t\t\t}\n\t\t\tforeach (var field in rr1.GetType().GetFields()) {\n\t\t\t\tobject val1 = field.GetValue(rr1);\n\t\t\t\tobject val2 = field.GetValue(rr2);\n\t\t\t\teq &= Compare(val1, val2, field.FieldType);\n\t\t\t}\n\t\t\treturn eq;\n\t\t}\n\t\t\n\t\tstatic bool Compare(object val1, object val2, Type type)\n\t\t{\n\t\t\tif (val1 == val2)\n\t\t\t\treturn true;\n\t\t\tif (val1 == null || val2 == null)\n\t\t\t\treturn false;\n\t\t\tif (type == typeof(ResolveResult)) {\n\t\t\t\treturn IsEqualResolveResult((ResolveResult)val1, (ResolveResult)val2);\n\t\t\t} else if (type == typeof(IVariable) || type == typeof(IParameter)) {\n\t\t\t\treturn IsEqualVariable((IVariable)val1, (IVariable)val2);\n\t\t\t} else if (type == typeof(MethodListWithDeclaringType)) {\n\t\t\t\tvar l1 = (MethodListWithDeclaringType)val1;\n\t\t\t\tvar l2 = (MethodListWithDeclaringType)val2;\n\t\t\t\treturn object.Equals(l1.DeclaringType, l2.DeclaringType)\n\t\t\t\t\t&& Compare(l1, l2, type.BaseType);\n\t\t\t} else if (type.IsArray || type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(List<>) || type.GetGenericTypeDefinition() == typeof(ReadOnlyCollection<>) || type.GetGenericTypeDefinition() == typeof(IList<>) || type.GetGenericTypeDefinition() == typeof(ICollection<>) || type.GetGenericTypeDefinition() == typeof(IEnumerable<>))) {\n\t\t\t\tType elementType = type.IsArray ? type.GetElementType() : type.GetGenericArguments()[0];\n\t\t\t\tobject[] arr1 = ((IEnumerable)val1).Cast<object>().ToArray();\n\t\t\t\tobject[] arr2 = ((IEnumerable)val2).Cast<object>().ToArray();\n\t\t\t\tif (arr1.Length != arr2.Length)\n\t\t\t\t\treturn false;\n\t\t\t\tfor (int i = 0; i < arr1.Length; i++) {\n\t\t\t\t\tif (!Compare(arr1[i], arr2[i], elementType))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif (object.Equals(val1, val2))\n\t\t\t\t\treturn true;\n\t\t\t\telse if (val1 is Conversion && val2 is Conversion && ((Conversion)val1).IsAnonymousFunctionConversion && ((Conversion)val2).IsAnonymousFunctionConversion)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tinternal static bool IsEqualResolverState(CSharpResolver r1, CSharpResolver r2)\n\t\t{\n\t\t\tif (r1.CheckForOverflow != r2.CheckForOverflow)\n\t\t\t\treturn false;\n\t\t\tif (r1.Compilation != r2.Compilation)\n\t\t\t\treturn false;\n\t\t\tif (!object.Equals(r1.CurrentMember, r2.CurrentMember))\n\t\t\t\treturn false;\n\t\t\tif (!object.Equals(r1.CurrentObjectInitializerType, r2.CurrentObjectInitializerType))\n\t\t\t\treturn false;\n\t\t\tif (!object.Equals(r1.CurrentTypeDefinition, r2.CurrentTypeDefinition))\n\t\t\t\treturn false;\n\t\t\tif (!object.Equals(r1.CurrentUsingScope, r2.CurrentUsingScope))\n\t\t\t\treturn false;\n\t\t\tif (r1.IsWithinLambdaExpression != r2.IsWithinLambdaExpression)\n\t\t\t\treturn false;\n\t\t\tif (r1.LocalVariables.Count() != r2.LocalVariables.Count())\n\t\t\t\treturn false;\n\t\t\treturn r1.LocalVariables.Zip(r2.LocalVariables, IsEqualVariable).All(_ => _);\n\t\t}\n\t\t\n\t\tinternal static bool IsEqualVariable(IVariable v1, IVariable v2)\n\t\t{\n\t\t\treturn object.Equals(v1.ConstantValue, v2.ConstantValue)\n\t\t\t\t&& v1.IsConst == v2.IsConst\n\t\t\t\t&& v1.Name == v2.Name\n\t\t\t\t&& v1.Region == v2.Region\n\t\t\t\t&& object.Equals(v1.Type, v2.Type);\n\t\t}\n\t\t\n\t\tsealed class ResolveAllNavigator : IResolveVisitorNavigator\n\t\t{\n\t\t\tpublic ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t\t{\n\t\t\t\treturn ResolveVisitorNavigationMode.Resolve;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Resolved(AstNode node, ResolveResult result)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Readme.txt",
    "content": "﻿This is an automatic consistency check for NRefactory.\nIt loads a solution file and parses all the source code and referenced libraries,\nand then performs a set of consistency checks.\nThese checks assume that the code is valid C# without any compilation errors,\nso make sure to only pass in compilable source code.\n\nChecks currently being performed:\n - IDStringConsistencyCheck: Checks that ID strings are unique and refer back to the correct entity\n - RoundtripTest: parses C# code and outputs it again using CSharpOutputVisitor, checking that only whitespace is changing\n - ResolverTest: fully resolves all ASTs and validates that no errors are detected (no false positives in semantic error checking)\n - RandomizedOrderResolverTest: checks that the order of Resolve()/GetResolverState() calls has no effect on the result\n - FindReferencesConsistencyCheck: checks that FindReferences is the inverse of FindReferencedEntities\n \n XML Tests:\n - IncrementalXmlParserTests: tests that incremental parsing produces results identical to a full reparse\n - XmlReaderTests: compares AXmlParser.Parse().CreateReader() with new XmlTextReader()\n \n \n \n Ideas for further tests:\n  - Test token positions (see AstVerifier)\n  - Compare resolve results with csc compiler output (using Cecil)\n  - Randomly mutate a C# file (e.g. remove tokens) and verify that the parser does not crash\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/ResolverTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\t/// <summary>\n\t/// Validates that no compile errors are found in valid code.\n\t/// </summary>\n\tpublic class ResolverTest\n\t{\n\t\tpublic static void RunTest(CSharpFile file)\n\t\t{\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(file.Project.Compilation, file.SyntaxTree, file.UnresolvedTypeSystemForFile);\n\t\t\tvar navigator = new ValidatingResolveAllNavigator(file.FileName);\n\t\t\tresolver.ApplyNavigator(navigator, CancellationToken.None);\n\t\t\tnavigator.Validate(resolver, file.SyntaxTree);\n\t\t}\n\t\t\n\t\tclass ValidatingResolveAllNavigator : IResolveVisitorNavigator\n\t\t{\n\t\t\tstring fileName;\n\t\t\tbool allowErrors;\n\t\t\t\n\t\t\tpublic ValidatingResolveAllNavigator(string fileName)\n\t\t\t{\n\t\t\t\tthis.fileName = fileName;\n\t\t\t\t// We allow errors in XAML codebehind because we're currently not adding the XAML-generated\n\t\t\t\t// members to the type system.\n\t\t\t\tthis.allowErrors = (fileName.Contains(\".xaml\") || File.Exists(Path.ChangeExtension(fileName, \".xaml\")) || fileName.EndsWith(\"AvalonDockLayout.cs\") || fileName.EndsWith(\"ResourcesFileTreeNode.cs\") || fileName.EndsWith(\"ChangeMarkerMargin.cs\"));\n\t\t\t}\n\t\t\t\n\t\t\tDictionary<AstNode, ResolveResult> resolvedNodes = new Dictionary<AstNode, ResolveResult>();\n\t\t\tHashSet<ResolveResult> resolveResults = new HashSet<ResolveResult>();\n\t\t\tHashSet<AstNode> nodesWithConversions = new HashSet<AstNode>();\n\t\t\t\n\t\t\tpublic ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t\t{\n\t\t\t\treturn ResolveVisitorNavigationMode.Resolve;\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual void Resolved(AstNode node, ResolveResult result)\n\t\t\t{\n\t\t\t\tif (resolvedNodes.ContainsKey(node))\n\t\t\t\t\tthrow new InvalidOperationException(\"Duplicate Resolved() call\");\n\t\t\t\tresolvedNodes.Add(node, result);\n\t\t\t\tif (CSharpAstResolver.IsUnresolvableNode(node))\n\t\t\t\t\tthrow new InvalidOperationException(\"Resolved unresolvable node\");\n\t\t\t\tif (!ParenthesizedExpression.ActsAsParenthesizedExpression(node))\n\t\t\t\t\tif (!resolveResults.Add(result) && result != ErrorResolveResult.UnknownError)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Duplicate resolve result\");\n\t\t\t\t\n\t\t\t\tif (result.IsError && !allowErrors) {\n\t\t\t\t\tConsole.WriteLine(\"Compiler error at \" + fileName + \":\" + node.StartLocation + \": \" + result);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t\tif (!nodesWithConversions.Add(expression))\n\t\t\t\t\tthrow new InvalidOperationException(\"Duplicate ProcessConversion() call\");\n\t\t\t\tif (!conversion.IsValid && !allowErrors) {\n\t\t\t\t\tConsole.WriteLine(\"Compiler error at \" + fileName + \":\" + expression.StartLocation + \": Cannot convert from \" + result + \" to \" + targetType);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic virtual void Validate(CSharpAstResolver resolver, SyntaxTree syntaxTree)\n\t\t\t{\n\t\t\t\tforeach (AstNode node in syntaxTree.DescendantsAndSelf.Except(resolvedNodes.Keys)) {\n\t\t\t\t\tif (!CSharpAstResolver.IsUnresolvableNode(node)) {\n\t\t\t\t\t\tif (!node.Ancestors.Any(a => a is PreProcessorDirective)) {\n\t\t\t\t\t\t\tConsole.WriteLine(\"Forgot to resolve \" + node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach (var pair in resolvedNodes) {\n\t\t\t\t\tif (resolver.Resolve(pair.Key) != pair.Value)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Inconsistent result\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static void RunTestWithoutUnresolvedFile(CSharpFile file)\n\t\t{\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(file.Project.Compilation, file.SyntaxTree);\n\t\t\tvar navigator = new ValidatingResolveAllNavigator(file.FileName);\n\t\t\tresolver.ApplyNavigator(navigator, CancellationToken.None);\n\t\t\tnavigator.Validate(resolver, file.SyntaxTree);\n\t\t\t\n\t\t\tCSharpAstResolver originalResolver = new CSharpAstResolver(file.Project.Compilation, file.SyntaxTree, file.UnresolvedTypeSystemForFile);\n\t\t\tforeach (var node in file.SyntaxTree.DescendantsAndSelf) {\n\t\t\t\tvar originalResult = originalResolver.Resolve(node);\n\t\t\t\tvar result = resolver.Resolve(node);\n\t\t\t\tif (!RandomizedOrderResolverTest.IsEqualResolveResult(result, originalResult)) {\n\t\t\t\t\tConsole.WriteLine(\"Got different without IUnresolvedFile at \" + file.FileName + \":\" + node.StartLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/RoundtripTest.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\t/// <summary>\n\t/// Tests parser + output visitor by roundtripping code.\n\t/// Everything but whitespace must be preserved.\n\t/// </summary>\n\tpublic class RoundtripTest\n\t{\n\t\tpublic static void RunTest(CSharpFile file)\n\t\t{\n\t\t\tstring code = file.OriginalText.Replace(\"\\r\\n\", \"\\n\");\n\t\t\tDebug.Assert(code.IndexOf('\\r') < 0);\n\t\t\tif (code.Contains(\"#pragma\"))\n\t\t\t\treturn; // skip code with preprocessor directives\n\t\t\tif (code.Contains(\"enum VarianceModifier\") || file.FileName.EndsWith(\"ecore.cs\") || file.FileName.EndsWith(\"method.cs\"))\n\t\t\t\treturn; // skip enum with ; at end (see TypeDeclarationTests.EnumWithSemicolonAtEnd)\n\t\t\tif (file.FileName.EndsWith(\"KnownTypeReference.cs\") || file.FileName.EndsWith(\"typemanager.cs\") || file.FileName.EndsWith(\"GetAllBaseTypesTest.cs\") || file.FileName.EndsWith(\"Tokens.cs\") || file.FileName.EndsWith(\"OpCode.cs\") || file.FileName.EndsWith(\"MainWindow.cs\"))\n\t\t\t\treturn; // skip due to optional , at end of array initializer (see ArrayCreateExpressionTests.ArrayInitializerWithCommaAtEnd)\n\t\t\tif (file.FileName.EndsWith(\"cs-parser.cs\"))\n\t\t\t\treturn; // skip due to completely messed up comment locations\n\t\t\tif (file.FileName.Contains(\"FormattingTests\") || file.FileName.Contains(\"ContextAction\") || file.FileName.Contains(\"CodeCompletion\"))\n\t\t\t\treturn; // skip due to AttributeSectionTests.AttributeWithEmptyParenthesis\n\t\t\tif (file.FileName.EndsWith(\"TypeSystemTests.TestCase.cs\") || file.FileName.EndsWith(\"AssemblyInfo.cs\"))\n\t\t\t\treturn; // skip due to AttributeSectionTests.AssemblyAttributeBeforeNamespace\n\t\t\tif (file.FileName.EndsWith(\"dynamic.cs\") || file.FileName.EndsWith(\"expression.cs\"))\n\t\t\t\treturn; // skip due to PreprocessorDirectiveTests.NestedInactiveIf\n\t\t\tif (file.FileName.EndsWith(\"property.cs\"))\n\t\t\t\treturn; // skip due to PreprocessorDirectiveTests.CommentOnEndOfIfDirective\n\t\t\tif (file.FileName.EndsWith(\"DefaultResolvedTypeDefinition.cs\"))\n\t\t\t\treturn; // skip due to MethodDeclarationTests.GenericMethodWithMultipleConstraints\n\t\t\t\n\t\t\tRoundtrip(new CSharpParser(file.Project.CompilerSettings), file.FileName, code);\n\t\t\t// After trying unix-style newlines, also try windows-style newlines:\n\t\t\tRoundtrip(new CSharpParser(file.Project.CompilerSettings), file.FileName, code.Replace(\"\\n\", \"\\r\\n\"));\n\t\t}\n\t\t\n\t\tpublic static void Roundtrip(CSharpParser parser, string fileName, string code)\n\t\t{\n\t\t\t// 1. Parse\n\t\t\tSyntaxTree syntaxTree = parser.Parse(code, fileName);\n\t\t\tif (parser.HasErrors)\n\t\t\t\tthrow new InvalidOperationException(\"There were parse errors.\");\n\t\t\t\n\t\t\t// 2. Output\n\t\t\tStringWriter w = new StringWriter();\n\t\t\tsyntaxTree.AcceptVisitor(new CSharpOutputVisitor(w, FormattingOptionsFactory.CreateMono ()));\n\t\t\tstring generatedCode = w.ToString().TrimEnd();\n\t\t\t\n\t\t\t// 3. Compare output with original (modulo whitespaces)\n\t\t\tint pos2 = 0;\n\t\t\tfor (int pos1 = 0; pos1 < code.Length; pos1++) {\n\t\t\t\tif (!char.IsWhiteSpace(code[pos1])) {\n\t\t\t\t\twhile (pos2 < generatedCode.Length && char.IsWhiteSpace(generatedCode[pos2]))\n\t\t\t\t\t\tpos2++;\n\t\t\t\t\tif (pos2 >= generatedCode.Length || code[pos1] != generatedCode[pos2]) {\n\t\t\t\t\t\tReadOnlyDocument doc = new ReadOnlyDocument(code);\n\t\t\t\t\t\tFile.WriteAllText(Path.Combine(Program.TempPath, \"roundtrip-error.cs\"), generatedCode);\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Mismatch at \" + doc.GetLocation(pos1) + \" of file \" + fileName);\n\t\t\t\t\t}\n\t\t\t\t\tpos2++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pos2 != generatedCode.Length)\n\t\t\t\tthrow new InvalidOperationException(\"Mismatch at end of file \" + fileName);\n\t\t\t\n\t\t\t// 3b - validate that there are no lone \\r\n\t\t\tif (generatedCode.Replace(w.NewLine, \"\\n\").IndexOf('\\r') >= 0)\n\t\t\t\tthrow new InvalidOperationException(@\"Got lone \\r in \" + fileName);\n\t\t\t\n\t\t\t// 4. Parse generated output\n\t\t\tSyntaxTree generatedCU;\n\t\t\ttry {\n\t\t\t\tgeneratedCU = parser.Parse(generatedCode, fileName);\n\t\t\t} catch {\n\t\t\t\tFile.WriteAllText(Path.Combine(Program.TempPath, \"roundtrip-error.cs\"), generatedCode, Encoding.Unicode);\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\t\n\t\t\tif (parser.HasErrors) {\n\t\t\t\tFile.WriteAllText(Path.Combine(Program.TempPath, \"roundtrip-error.cs\"), generatedCode);\n\t\t\t\tthrow new InvalidOperationException(\"There were parse errors in the roundtripped \" + fileName);\n\t\t\t}\n\t\t\t\n\t\t\t// 5. Compare AST1 with AST2\n\t\t\tif (!syntaxTree.IsMatch(generatedCU))\n\t\t\t\tthrow new InvalidOperationException(\"AST match failed for \" + fileName + \".\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Solution.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\tpublic class Solution\n\t{\n\t\tpublic readonly string Directory;\n\t\tpublic readonly List<CSharpProject> Projects = new List<CSharpProject>();\n\t\tpublic readonly ISolutionSnapshot SolutionSnapshot = new DefaultSolutionSnapshot();\n\t\t\n\t\tpublic IEnumerable<CSharpFile> AllFiles {\n\t\t\tget {\n\t\t\t\treturn Projects.SelectMany(p => p.Files);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Solution(string fileName)\n\t\t{\n\t\t\tthis.Directory = Path.GetDirectoryName(fileName);\n\t\t\tvar projectLinePattern = new Regex(\"Project\\\\(\\\"(?<TypeGuid>.*)\\\"\\\\)\\\\s+=\\\\s+\\\"(?<Title>.*)\\\",\\\\s*\\\"(?<Location>.*)\\\",\\\\s*\\\"(?<Guid>.*)\\\"\");\n\t\t\tforeach (string line in File.ReadLines(fileName)) {\n\t\t\t\tMatch match = projectLinePattern.Match(line);\n\t\t\t\tif (match.Success) {\n\t\t\t\t\tstring typeGuid = match.Groups[\"TypeGuid\"].Value;\n\t\t\t\t\tstring title    = match.Groups[\"Title\"].Value;\n\t\t\t\t\tstring location = match.Groups[\"Location\"].Value;\n\t\t\t\t\tstring guid     = match.Groups[\"Guid\"].Value;\n\t\t\t\t\tswitch (typeGuid.ToUpperInvariant()) {\n\t\t\t\t\t\tcase \"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\": // Solution Folder\n\t\t\t\t\t\t\t// ignore folders\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\": // C# project\n\t\t\t\t\t\t\tProjects.Add(new CSharpProject(this, title, Path.Combine(Directory, location)));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tConsole.WriteLine(\"Project {0} has unsupported type {1}\", location, typeGuid);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Create compilations (resolved type systems) after all projects have been loaded.\n\t\t\t// (we can't do this earlier because project A might have a reference to project B, where A is loaded before B)\n\t\t\t// To allow NRefactory to resolve project references, we need to use a 'DefaultSolutionSnapshot'\n\t\t\t// instead of calling CreateCompilation() on each project individually.\n\t\t\tvar solutionSnapshot = new DefaultSolutionSnapshot(this.Projects.Select(p => p.ProjectContent));\n\t\t\tforeach (CSharpProject project in this.Projects) {\n\t\t\t\tproject.Compilation = solutionSnapshot.GetCompilation(project.ProjectContent);\n\t\t\t}\n\t\t}\n\t\t\n\t\tConcurrentDictionary<string, IUnresolvedAssembly> assemblyDict = new ConcurrentDictionary<string, IUnresolvedAssembly>(Platform.FileNameComparer);\n\t\t\n\t\t/// <summary>\n\t\t/// Loads a referenced assembly from a .dll.\n\t\t/// Returns the existing instance if the assembly was already loaded.\n\t\t/// </summary>\n\t\tpublic IUnresolvedAssembly LoadAssembly(string assemblyFileName)\n\t\t{\n\t\t\treturn assemblyDict.GetOrAdd(assemblyFileName, file => AssemblyLoader.Create().LoadAssemblyFile(file));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/TypeSystemTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\tpublic class TypeSystemTests\n\t{\n\t\tpublic static void IDStringConsistencyCheck(Solution solution)\n\t\t{\n\t\t\tforeach (var project in solution.Projects) {\n\t\t\t\tvar compilation = project.Compilation;\n\t\t\t\tHashSet<string> idStrings = new HashSet<string>();\n\t\t\t\tvar context = compilation.TypeResolveContext;\n\t\t\t\tforeach (var typeDef in compilation.MainAssembly.GetAllTypeDefinitions()) {\n\t\t\t\t\tCheck(typeDef, context, idStrings);\n\t\t\t\t\tforeach (var member in typeDef.Members) {\n\t\t\t\t\t\tCheck(member, context, idStrings);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void Check(IEntity entity, ITypeResolveContext context, HashSet<string> idStrings)\n\t\t{\n\t\t\tstring id = IdStringProvider.GetIdString(entity);\n\t\t\tif (!idStrings.Add(id))\n\t\t\t\tthrow new InvalidOperationException(\"Duplicate ID string \" + id);\n\t\t\tIEntity resolvedEntity = IdStringProvider.FindEntity(id, context);\n\t\t\tif (resolvedEntity != entity)\n\t\t\t\tthrow new InvalidOperationException(id);\n\t\t}\n\t\t\n\t\tpublic static void ResolvedUnresolvedMembers(Solution solution)\n\t\t{\n\t\t\tforeach (var project in solution.Projects) {\n\t\t\t\tvar compilation = project.Compilation;\n\t\t\t\tvar assemblyContext = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\t\tforeach (var typeDef in compilation.MainAssembly.GetAllTypeDefinitions()) {\n\t\t\t\t\tforeach (var part in typeDef.Parts) {\n\t\t\t\t\t\tif (!typeDef.Equals(part.Resolve(assemblyContext)))\n\t\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t}\n\t\t\t\t\tforeach (var member in IncludeAccessors(typeDef.Members)) {\n\t\t\t\t\t\tvar resolvedMember = member.UnresolvedMember.Resolve(assemblyContext);\n\t\t\t\t\t\tif (!member.Equals(resolvedMember))\n\t\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t}\n\t\t\t\t\t// ToMemberReference() requires an appropriate generic context if the member\n\t\t\t\t\t// contains open generics; otherwise the main context of the compilation is sufficient.\n\t\t\t\t\tITypeResolveContext context;\n\t\t\t\t\tif (typeDef.TypeParameterCount > 0)\n\t\t\t\t\t\tcontext = new SimpleTypeResolveContext(typeDef);\n\t\t\t\t\telse\n\t\t\t\t\t\tcontext = compilation.TypeResolveContext;\n\t\t\t\t\t// Include (potentially specialized) inherited members when testing ToMemberReference()\n\t\t\t\t\tforeach (var member in IncludeAccessors(typeDef.GetMembers())) {\n\t\t\t\t\t\tvar resolvedMember = member.ToReference().Resolve(context);\n\t\t\t\t\t\tif (!member.Equals(resolvedMember))\n\t\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IMember> IncludeAccessors(IEnumerable<IMember> members)\n\t\t{\n\t\t\tforeach (var member in members) {\n\t\t\t\tyield return member;\n\t\t\t\tIProperty p = member as IProperty;\n\t\t\t\tif (p != null && p.CanGet)\n\t\t\t\t\tyield return p.Getter;\n\t\t\t\tif (p != null && p.CanSet)\n\t\t\t\t\tyield return p.Setter;\n\t\t\t\tIEvent e = member as IEvent;\n\t\t\t\tif (e != null && e.CanAdd)\n\t\t\t\t\tyield return e.AddAccessor;\n\t\t\t\tif (e != null && e.CanRemove)\n\t\t\t\t\tyield return e.RemoveAccessor;\n\t\t\t\tif (e != null && e.CanInvoke)\n\t\t\t\t\tyield return e.InvokeAccessor;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/VisitorBenchmark.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\t/// <summary>\n\t/// Determines the fastest way to retrieve a List{IdentifierExpression} of all identifiers\n\t/// in a syntax tree.\n\t/// </summary>\n\tpublic class VisitorBenchmark\n\t{\n\t\tpublic static void Run(IEnumerable<SyntaxTree> files)\n\t\t{\n\t\t\tfiles = files.ToList();\n\t\t\t\n\t\t\tRunTest(\"recursive method using for\", files, (syntaxTree, list) => WalkTreeFor(syntaxTree, list));\n\t\t\tRunTest(\"recursive method using foreach\", files, (syntaxTree, list) => WalkTreeForEach(syntaxTree, list));\n\t\t\tRunTest(\"non-recursive loop\", files, (syntaxTree, list) => WalkTreeNonRecursive(syntaxTree, list));\n\t\t\tRunTest(\"foreach over Descendants.OfType()\", files, (syntaxTree, list) => {\n\t\t\t        \tforeach (var node in syntaxTree.Descendants.OfType<IdentifierExpression>()) {\n\t\t\t        \t\tlist.Add(node);\n\t\t\t        \t}\n\t\t\t        });\n\t\t\tRunTest(\"DepthFirstAstVisitor\", files, (syntaxTree, list) => syntaxTree.AcceptVisitor(new DepthFirst(list)));\n\t\t\tRunTest(\"DepthFirstAstVisitor<object>\", files, (syntaxTree, list) => syntaxTree.AcceptVisitor(new DepthFirst<object>(list)));\n\t\t\tRunTest(\"DepthFirstAstVisitor<object, object>\", files, (syntaxTree, list) => syntaxTree.AcceptVisitor(new DepthFirst<object, object>(list), null));\n\t\t\tRunTest(\"ObservableAstVisitor\", files, (syntaxTree, list) => {\n\t\t\t        \tvar visitor = new ObservableAstVisitor();\n\t\t\t        \tvisitor.EnterIdentifierExpression += list.Add;\n\t\t\t        \tsyntaxTree.AcceptVisitor(visitor);\n\t\t\t        });\n\t\t}\n\t\t\n\t\tstatic void WalkTreeForEach(AstNode node, List<IdentifierExpression> list)\n\t\t{\n\t\t\tforeach (AstNode child in node.Children) {\n\t\t\t\tIdentifierExpression id = child as IdentifierExpression;\n\t\t\t\tif (id != null) {\n\t\t\t\t\tlist.Add(id);\n\t\t\t\t}\n\t\t\t\tWalkTreeForEach(child, list);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void WalkTreeFor(AstNode node, List<IdentifierExpression> list)\n\t\t{\n\t\t\tfor (AstNode child = node.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\tIdentifierExpression id = child as IdentifierExpression;\n\t\t\t\tif (id != null) {\n\t\t\t\t\tlist.Add(id);\n\t\t\t\t}\n\t\t\t\tWalkTreeFor(child, list);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void WalkTreeNonRecursive(AstNode root, List<IdentifierExpression> list)\n\t\t{\n\t\t\tAstNode pos = root;\n\t\t\twhile (pos != null) {\n\t\t\t\t{\n\t\t\t\t\tIdentifierExpression id = pos as IdentifierExpression;\n\t\t\t\t\tif (id != null) {\n\t\t\t\t\t\tlist.Add(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pos.FirstChild != null) {\n\t\t\t\t\tpos = pos.FirstChild;\n\t\t\t\t} else {\n\t\t\t\t\tpos = pos.GetNextNode();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass DepthFirst : DepthFirstAstVisitor {\n\t\t\treadonly List<IdentifierExpression> list;\n\t\t\tpublic DepthFirst(List<IdentifierExpression> list) { this.list = list; }\n\t\t\tpublic override void VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tlist.Add(identifierExpression);\n\t\t\t\tbase.VisitIdentifierExpression(identifierExpression);\n\t\t\t}\n\t\t}\n\t\tclass DepthFirst<T> : DepthFirstAstVisitor<T> {\n\t\t\treadonly List<IdentifierExpression> list;\n\t\t\tpublic DepthFirst(List<IdentifierExpression> list) { this.list = list; }\n\t\t\tpublic override T VisitIdentifierExpression(IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tlist.Add(identifierExpression);\n\t\t\t\treturn base.VisitIdentifierExpression(identifierExpression);\n\t\t\t}\n\t\t}\n\t\tclass DepthFirst<T, S> : DepthFirstAstVisitor<T, S> {\n\t\t\treadonly List<IdentifierExpression> list;\n\t\t\tpublic DepthFirst(List<IdentifierExpression> list) { this.list = list; }\n\t\t\tpublic override S VisitIdentifierExpression(IdentifierExpression identifierExpression, T data)\n\t\t\t{\n\t\t\t\tlist.Add(identifierExpression);\n\t\t\t\treturn base.VisitIdentifierExpression(identifierExpression, data);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic void RunTest(string text, IEnumerable<SyntaxTree> files, Action<SyntaxTree, List<IdentifierExpression>> action)\n\t\t{\n\t\t\t// validation:\n\t\t\tvar list = new List<IdentifierExpression>();\n\t\t\tforeach (var file in files) {\n\t\t\t\tlist.Clear();\n\t\t\t\taction(file, list);\n\t\t\t\tif (!list.SequenceEqual(file.Descendants.OfType<IdentifierExpression>()))\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\tStopwatch w = Stopwatch.StartNew();\n\t\t\tforeach (var file in files) {\n\t\t\t\tfor (int i = 0; i < 20; i++) {\n\t\t\t\t\tlist.Clear();\n\t\t\t\t\taction(file, list);\n\t\t\t\t}\n\t\t\t}\n\t\t\tw.Stop();\n\t\t\tConsole.WriteLine(text.PadRight(40) + \": \" + w.Elapsed);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/IncrementalXmlParserTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.ConsistencyCheck.Xml;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Xml;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck\n{\n\t/// <summary>\n\t/// Tests incremental tag soup parser.\n\t/// </summary>\n\tpublic class IncrementalXmlParserTests\n\t{\n\t\tstatic Random sharedRnd = new Random();\n\t\t\n\t\tpublic static void Run(string fileName)\n\t\t{\n\t\t\tRun(new StringTextSource(File.ReadAllText(fileName)));\n\t\t}\n\t\t\n\t\tpublic static void Run(ITextSource originalXmlFile)\n\t\t{\n\t\t\tint seed;\n\t\t\tlock (sharedRnd) {\n\t\t\t\tseed = sharedRnd.Next();\n\t\t\t}\n\t\t\tConsole.WriteLine(seed);\n\t\t\tRandom rnd = new Random(seed);\n\t\t\t\n\t\t\tAXmlParser parser = new AXmlParser();\n\t\t\tStringBuilder b = new StringBuilder(originalXmlFile.Text);\n\t\t\tIncrementalParserState parserState = null;\n\t\t\tvar versionProvider = new TextSourceVersionProvider();\n\t\t\tint totalCharactersParsed = 0;\n\t\t\tint totalCharactersChanged = originalXmlFile.TextLength;\n\t\t\tTimeSpan incrementalParseTime = TimeSpan.Zero;\n\t\t\tTimeSpan nonIncrementalParseTime = TimeSpan.Zero;\n\t\t\tStopwatch w = new Stopwatch();\n\t\t\tfor (int iteration = 0; iteration < 100; iteration++) {\n\t\t\t\ttotalCharactersParsed += b.Length;\n\t\t\t\tvar textSource = new StringTextSource(b.ToString(), versionProvider.CurrentVersion);\n\t\t\t\tw.Restart();\n\t\t\t\tvar incrementalResult = parser.ParseIncremental(parserState, textSource, out parserState);\n\t\t\t\tw.Stop();\n\t\t\t\tincrementalParseTime += w.Elapsed;\n\t\t\t\tw.Restart();\n\t\t\t\tvar nonIncrementalResult = parser.Parse(textSource);\n\t\t\t\tw.Stop();\n\t\t\t\tnonIncrementalParseTime += w.Elapsed;\n\t\t\t\tCompareResults(incrementalResult, nonIncrementalResult);\n\t\t\t\t\n\t\t\t\tincrementalResult.AcceptVisitor(new ValidationVisitor(textSource));\n\t\t\t\t\n\t\t\t\t// Randomly mutate the file:\n\t\t\t\t\n//\t\t\t\tList<TextChangeEventArgs> changes = new List<TextChangeEventArgs>();\n\t\t\t\tint modifications = rnd.Next(0, 25);\n\t\t\t\tint offset = 0;\n\t\t\t\tfor (int i = 0; i < modifications; i++) {\n\t\t\t\t\tif (i == 0 || rnd.Next(0, 10) == 0)\n\t\t\t\t\t\toffset = rnd.Next(0, b.Length);\n\t\t\t\t\telse\n\t\t\t\t\t\toffset += rnd.Next(0, Math.Min(10, b.Length - offset));\n\t\t\t\t\tint originalOffset = rnd.Next(0, originalXmlFile.TextLength);\n\t\t\t\t\tint insertionLength;\n\t\t\t\t\tint removalLength;\n\t\t\t\t\tswitch (rnd.Next(0, 21) / 10) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tremovalLength = 0;\n\t\t\t\t\t\t\tinsertionLength = rnd.Next(0, Math.Min(50, originalXmlFile.TextLength - originalOffset));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tremovalLength = rnd.Next(0, Math.Min(20, b.Length - offset));\n\t\t\t\t\t\t\tinsertionLength = rnd.Next(0, Math.Min(20, originalXmlFile.TextLength - originalOffset));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tremovalLength = rnd.Next(0, b.Length - offset);\n\t\t\t\t\t\t\tinsertionLength = rnd.Next(0, originalXmlFile.TextLength - originalOffset);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tstring removedText = b.ToString(offset, removalLength);\n\t\t\t\t\tb.Remove(offset, removalLength);\n\t\t\t\t\tstring insertedText = originalXmlFile.GetText(originalOffset, insertionLength);\n\t\t\t\t\tb.Insert(offset, insertedText);\n\t\t\t\t\tversionProvider.AppendChange(new TextChangeEventArgs(offset, removedText, insertedText));\n\t\t\t\t\ttotalCharactersChanged += insertionLength;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine(\"Incremental parse time:     \" + incrementalParseTime + \" for \" + totalCharactersChanged + \" characters changed\");\n\t\t\tConsole.WriteLine(\"Non-Incremental parse time: \" + nonIncrementalParseTime + \" for \" + totalCharactersParsed + \" characters\");\n\t\t}\n\t\t\n\t\tstatic void CompareResults(IList<AXmlObject> result1, IList<AXmlObject> result2)\n\t\t{\n\t\t\tfor (int i = 0; i < Math.Min(result1.Count, result2.Count); i++) {\n\t\t\t\tCompareResults(result1[i], result2[i]);\n\t\t\t}\n\t\t\tif (result1.Count != result2.Count)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t}\n\t\t\n\t\tstatic void CompareResults(AXmlObject obj1, AXmlObject obj2)\n\t\t{\n\t\t\tif (obj1.GetType() != obj2.GetType())\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\tif (obj1.StartOffset != obj2.StartOffset)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\tif (obj1.EndOffset != obj2.EndOffset)\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\n\t\t\tif (obj1.MySyntaxErrors.Count() != obj2.MySyntaxErrors.Count())\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\tforeach (var pair in obj1.MySyntaxErrors.Zip(obj2.MySyntaxErrors, (a,b) => new { a, b })) {\n\t\t\t\tif (pair.a.StartOffset != pair.b.StartOffset)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (pair.a.EndOffset != pair.b.EndOffset)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (pair.a.Description != pair.b.Description)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\t\n\t\t\tif (obj1 is AXmlText) {\n\t\t\t\tvar a = (AXmlText)obj1;\n\t\t\t\tvar b = (AXmlText)obj2;\n\t\t\t\tif (a.ContainsOnlyWhitespace != b.ContainsOnlyWhitespace)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (a.Value != b.Value)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t} else if (obj1 is AXmlTag) {\n\t\t\t\tvar a = (AXmlTag)obj1;\n\t\t\t\tvar b = (AXmlTag)obj2;\n\t\t\t\tif (a.OpeningBracket != b.OpeningBracket)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (a.ClosingBracket != b.ClosingBracket)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (a.Name != b.Name)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t} else if (obj1 is AXmlAttribute) {\n\t\t\t\tvar a = (AXmlAttribute)obj1;\n\t\t\t\tvar b = (AXmlAttribute)obj2;\n\t\t\t\tif (a.Name != b.Name)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (a.Value != b.Value)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t} else if (obj1 is AXmlElement) {\n\t\t\t\tvar a = (AXmlElement)obj1;\n\t\t\t\tvar b = (AXmlElement)obj2;\n\t\t\t\tif (a.Name != b.Name)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (a.IsProperlyNested != b.IsProperlyNested)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (a.HasEndTag != b.HasEndTag)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t} else if (obj1 is AXmlDocument) {\n\t\t\t\t// only compare the children\n\t\t\t} else {\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t\t\n\t\t\tCompareResults(obj1.Children, obj2.Children);\n\t\t}\n\t\t\n\t\tsealed class ValidationVisitor : AXmlVisitor\n\t\t{\n\t\t\treadonly ITextSource textSource;\n\t\t\t\n\t\t\tpublic ValidationVisitor(ITextSource textSource)\n\t\t\t{\n\t\t\t\tthis.textSource = textSource;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitTag(AXmlTag tag)\n\t\t\t{\n\t\t\t\tif (textSource.GetText(tag.StartOffset, tag.OpeningBracket.Length) != tag.OpeningBracket)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (textSource.GetText(tag.NameSegment) != tag.Name)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tif (textSource.GetText(tag.EndOffset - tag.ClosingBracket.Length, tag.ClosingBracket.Length) != tag.ClosingBracket)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tbase.VisitTag(tag);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitAttribute(AXmlAttribute attribute)\n\t\t\t{\n\t\t\t\tif (textSource.GetText(attribute.NameSegment) != attribute.Name)\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\tbase.VisitAttribute(attribute);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/XmlReaderTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Xml;\nusing System.Xml.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Xml;\n\nnamespace ICSharpCode.NRefactory.ConsistencyCheck.Xml\n{\n\tpublic static class XmlReaderTest\n\t{\n\t\tpublic static void Run(string fileName)\n\t\t{\n\t\t\tbool includeAttributes = true;\n\t\t\tvar textSource = new StringTextSource(File.ReadAllText(fileName));\n\t\t\tusing (var textReader = textSource.CreateReader()) {\n\t\t\t\tusing (var xmlReader = new XmlTextReader(textReader)) {\n\t\t\t\t\tRun(xmlReader, includeAttributes);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar doc = new AXmlParser().Parse(textSource);\n\t\t\tusing (var xmlReader = doc.CreateReader()) {\n\t\t\t\tRun(xmlReader, includeAttributes);\n\t\t\t}\n\t\t\tvar xmlDocument = new XmlDocument();\n\t\t\txmlDocument.Load(doc.CreateReader());\n\t\t\txmlDocument.Save(Path.Combine(Program.TempPath, \"savedXmlDocument.xml\"));\n\t\t\tvar xDocument = XDocument.Load(doc.CreateReader());\n\t\t\txDocument.Save(Path.Combine(Program.TempPath, \"savedXDocument.xml\"));\n\t\t\tFile.WriteAllText(Path.Combine(Program.TempPath, \"inputDocument.xml\"), textSource.Text);\n\t\t}\n\t\t\n\t\tstatic string CSV(IEnumerable<string> input)\n\t\t{\n\t\t\treturn string.Join(\",\", input.Select(i => \"\\\"\" + i.Replace(\"\\\"\", \"\\\"\\\"\") + \"\\\"\"));\n\t\t}\n\t\t\n\t\tstatic readonly string[] ignoredProperties = {\n\t\t\t\"NameTable\", \"CanResolveEntity\", \"CanReadBinaryContent\", \"CanReadValueChunk\", \"ValueType\",\n\t\t\t\"SchemaInfo\", \"BaseURI\", \"Settings\"\n\t\t};\n\t\t\n\t\tpublic static void Run(XmlReader reader, bool includeAttributes, bool includeAttributeValues = true)\n\t\t{\n\t\t\tusing (StreamWriter output = File.CreateText(Path.Combine(Program.TempPath, reader.GetType().Name + \"-output.csv\"))) {\n\t\t\t\tvar properties = typeof(XmlReader).GetProperties(BindingFlags.Public | BindingFlags.Instance)\n\t\t\t\t\t.Where(p => p.GetIndexParameters().Length == 0 && !ignoredProperties.Contains(p.Name))\n\t\t\t\t\t.ToArray();\n\t\t\t\toutput.WriteLine(CSV(properties.Select(p => p.Name)));\n\t\t\t\tdo {\n\t\t\t\t\toutput.WriteLine(CSV(properties.Select(p => ToString(p.GetValue(reader, null)))));\n\t\t\t\t\tif (includeAttributes && reader.HasAttributes) {\n\t\t\t\t\t\tfor (int i = 0; i < reader.AttributeCount; i++) {\n\t\t\t\t\t\t\treader.MoveToAttribute(i);\n\t\t\t\t\t\t\toutput.WriteLine(CSV(properties.Select(p => ToString(p.GetValue(reader, null)))));\n\t\t\t\t\t\t\tif (includeAttributeValues) {\n\t\t\t\t\t\t\t\treader.ReadAttributeValue();\n\t\t\t\t\t\t\t\toutput.WriteLine(CSV(properties.Select(p => ToString(p.GetValue(reader, null)))));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} while (reader.Read());\n\t\t\t\toutput.WriteLine(CSV(properties.Select(p => ToString(p.GetValue(reader, null)))));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic string ToString(object val)\n\t\t{\n\t\t\treturn TextWriterTokenWriter.PrintPrimitiveValue(val);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n\t<startup>\n\t\t<supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.0\" />\n\t</startup>\n</configuration>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/CSDemo.Designer.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpartial class CSDemo\n\t{\n\t\t/// <summary>\n\t\t/// Designer variable used to keep track of non-visual components.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\t\t\n\t\t/// <summary>\n\t\t/// Disposes resources used by the control.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing) {\n\t\t\t\tif (components != null) {\n\t\t\t\t\tcomponents.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// This method is required for Windows Forms designer support.\n\t\t/// Do not change the method contents inside the source code editor. The Forms designer might\n\t\t/// not be able to load this method if it was changed manually.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tthis.splitContainer1 = new System.Windows.Forms.SplitContainer();\n\t\t\tthis.csharpCodeTextBox = new System.Windows.Forms.TextBox();\n\t\t\tthis.findReferencesButton = new System.Windows.Forms.Button();\n\t\t\tthis.resolveButton = new System.Windows.Forms.Button();\n\t\t\tthis.csharpTreeView = new System.Windows.Forms.TreeView();\n\t\t\tthis.csharpGenerateCodeButton = new System.Windows.Forms.Button();\n\t\t\tthis.csharpParseButton = new System.Windows.Forms.Button();\n\t\t\t((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();\n\t\t\tthis.splitContainer1.Panel1.SuspendLayout();\n\t\t\tthis.splitContainer1.Panel2.SuspendLayout();\n\t\t\tthis.splitContainer1.SuspendLayout();\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// splitContainer1\n\t\t\t// \n\t\t\tthis.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.splitContainer1.Location = new System.Drawing.Point(0, 0);\n\t\t\tthis.splitContainer1.Name = \"splitContainer1\";\n\t\t\tthis.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;\n\t\t\t// \n\t\t\t// splitContainer1.Panel1\n\t\t\t// \n\t\t\tthis.splitContainer1.Panel1.Controls.Add(this.csharpCodeTextBox);\n\t\t\t// \n\t\t\t// splitContainer1.Panel2\n\t\t\t// \n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.findReferencesButton);\n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.resolveButton);\n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.csharpTreeView);\n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.csharpGenerateCodeButton);\n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.csharpParseButton);\n\t\t\tthis.splitContainer1.Size = new System.Drawing.Size(475, 406);\n\t\t\tthis.splitContainer1.SplitterDistance = 178;\n\t\t\tthis.splitContainer1.TabIndex = 1;\n\t\t\t// \n\t\t\t// csharpCodeTextBox\n\t\t\t// \n\t\t\tthis.csharpCodeTextBox.AcceptsReturn = true;\n\t\t\tthis.csharpCodeTextBox.AcceptsTab = true;\n\t\t\tthis.csharpCodeTextBox.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.csharpCodeTextBox.Font = new System.Drawing.Font(\"Courier New\", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n\t\t\tthis.csharpCodeTextBox.HideSelection = false;\n\t\t\tthis.csharpCodeTextBox.Location = new System.Drawing.Point(0, 0);\n\t\t\tthis.csharpCodeTextBox.MaxLength = 99999999;\n\t\t\tthis.csharpCodeTextBox.Multiline = true;\n\t\t\tthis.csharpCodeTextBox.Name = \"csharpCodeTextBox\";\n\t\t\tthis.csharpCodeTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;\n\t\t\tthis.csharpCodeTextBox.Size = new System.Drawing.Size(475, 178);\n\t\t\tthis.csharpCodeTextBox.TabIndex = 0;\n\t\t\tthis.csharpCodeTextBox.Text = \"using System;\\r\\nusing System.Linq;\\r\\nclass Test\\r\\n{\\r\\n    public void Main(string[] a\" +\n\t\t\t\"rgs)\\r\\n    {\\r\\n         Console.WriteLine(\\\"Hello, World\\\");\\r\\n    }\\r\\n}\";\n\t\t\tthis.csharpCodeTextBox.WordWrap = false;\n\t\t\tthis.csharpCodeTextBox.TextChanged += new System.EventHandler(this.CsharpCodeTextBoxTextChanged);\n\t\t\t// \n\t\t\t// findReferencesButton\n\t\t\t// \n\t\t\tthis.findReferencesButton.Anchor = System.Windows.Forms.AnchorStyles.Top;\n\t\t\tthis.findReferencesButton.Enabled = false;\n\t\t\tthis.findReferencesButton.Location = new System.Drawing.Point(344, 4);\n\t\t\tthis.findReferencesButton.Name = \"findReferencesButton\";\n\t\t\tthis.findReferencesButton.Size = new System.Drawing.Size(100, 23);\n\t\t\tthis.findReferencesButton.TabIndex = 4;\n\t\t\tthis.findReferencesButton.Text = \"Find References\";\n\t\t\tthis.findReferencesButton.UseVisualStyleBackColor = true;\n\t\t\tthis.findReferencesButton.Click += new System.EventHandler(this.FindReferencesButtonClick);\n\t\t\t// \n\t\t\t// resolveButton\n\t\t\t// \n\t\t\tthis.resolveButton.Anchor = System.Windows.Forms.AnchorStyles.Top;\n\t\t\tthis.resolveButton.Location = new System.Drawing.Point(132, 4);\n\t\t\tthis.resolveButton.Name = \"resolveButton\";\n\t\t\tthis.resolveButton.Size = new System.Drawing.Size(100, 23);\n\t\t\tthis.resolveButton.TabIndex = 3;\n\t\t\tthis.resolveButton.Text = \"Resolve\";\n\t\t\tthis.resolveButton.UseVisualStyleBackColor = true;\n\t\t\tthis.resolveButton.Click += new System.EventHandler(this.ResolveButtonClick);\n\t\t\t// \n\t\t\t// csharpTreeView\n\t\t\t// \n\t\t\tthis.csharpTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) \n\t\t\t\t\t\t\t\t\t| System.Windows.Forms.AnchorStyles.Left) \n\t\t\t\t\t\t\t\t\t| System.Windows.Forms.AnchorStyles.Right)));\n\t\t\tthis.csharpTreeView.HideSelection = false;\n\t\t\tthis.csharpTreeView.Location = new System.Drawing.Point(3, 32);\n\t\t\tthis.csharpTreeView.Name = \"csharpTreeView\";\n\t\t\tthis.csharpTreeView.Size = new System.Drawing.Size(467, 189);\n\t\t\tthis.csharpTreeView.TabIndex = 2;\n\t\t\tthis.csharpTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.CSharpTreeViewAfterSelect);\n\t\t\t// \n\t\t\t// csharpGenerateCodeButton\n\t\t\t// \n\t\t\tthis.csharpGenerateCodeButton.Anchor = System.Windows.Forms.AnchorStyles.Top;\n\t\t\tthis.csharpGenerateCodeButton.Location = new System.Drawing.Point(238, 4);\n\t\t\tthis.csharpGenerateCodeButton.Name = \"csharpGenerateCodeButton\";\n\t\t\tthis.csharpGenerateCodeButton.Size = new System.Drawing.Size(100, 23);\n\t\t\tthis.csharpGenerateCodeButton.TabIndex = 1;\n\t\t\tthis.csharpGenerateCodeButton.Text = \"\\u2191 Generate \\u2191\";\n\t\t\tthis.csharpGenerateCodeButton.UseVisualStyleBackColor = true;\n\t\t\tthis.csharpGenerateCodeButton.Click += new System.EventHandler(this.CSharpGenerateCodeButtonClick);\n\t\t\t// \n\t\t\t// csharpParseButton\n\t\t\t// \n\t\t\tthis.csharpParseButton.Anchor = System.Windows.Forms.AnchorStyles.Top;\n\t\t\tthis.csharpParseButton.Location = new System.Drawing.Point(26, 4);\n\t\t\tthis.csharpParseButton.Name = \"csharpParseButton\";\n\t\t\tthis.csharpParseButton.Size = new System.Drawing.Size(100, 23);\n\t\t\tthis.csharpParseButton.TabIndex = 0;\n\t\t\tthis.csharpParseButton.Text = \"\\u2193 Parse \\u2193\";\n\t\t\tthis.csharpParseButton.UseVisualStyleBackColor = true;\n\t\t\tthis.csharpParseButton.Click += new System.EventHandler(this.CSharpParseButtonClick);\n\t\t\t// \n\t\t\t// CSDemo\n\t\t\t// \n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.Controls.Add(this.splitContainer1);\n\t\t\tthis.Name = \"CSDemo\";\n\t\t\tthis.Size = new System.Drawing.Size(475, 406);\n\t\t\tthis.splitContainer1.Panel1.ResumeLayout(false);\n\t\t\tthis.splitContainer1.Panel1.PerformLayout();\n\t\t\tthis.splitContainer1.Panel2.ResumeLayout(false);\n\t\t\t((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();\n\t\t\tthis.splitContainer1.ResumeLayout(false);\n\t\t\tthis.ResumeLayout(false);\n\t\t}\n\t\tprivate System.Windows.Forms.Button findReferencesButton;\n\t\tprivate System.Windows.Forms.Button csharpParseButton;\n\t\tprivate System.Windows.Forms.Button csharpGenerateCodeButton;\n\t\tprivate System.Windows.Forms.TreeView csharpTreeView;\n\t\tprivate System.Windows.Forms.Button resolveButton;\n\t\tprivate System.Windows.Forms.TextBox csharpCodeTextBox;\n\t\tprivate System.Windows.Forms.SplitContainer splitContainer1;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/CSDemo.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\t/// <summary>\n\t/// Description of CSDemo.\n\t/// </summary>\n\tpublic partial class CSDemo : UserControl\n\t{\n\t\tpublic CSDemo()\n\t\t{\n\t\t\t//\n\t\t\t// The InitializeComponent() call is required for Windows Forms designer support.\n\t\t\t//\n\t\t\tInitializeComponent();\n\t\t\t\n\t\t\tif (LicenseManager.UsageMode != LicenseUsageMode.Designtime) {\n\t\t\t\tcsharpCodeTextBox.SelectAll();\n\t\t\t\tCSharpParseButtonClick(null, null);\n\t\t\t\tresolveButton.UseWaitCursor = true;\n\t\t\t\tThreadPool.QueueUserWorkItem(\n\t\t\t\t\tdelegate {\n\t\t\t\t\t\tbuiltInLibs.Value.ToString();\n\t\t\t\t\t\tBeginInvoke(new Action(delegate { resolveButton.UseWaitCursor = false; }));\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t\n\t\tSyntaxTree syntaxTree;\n\t\t\n\t\tvoid CSharpParseButtonClick(object sender, EventArgs e)\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tsyntaxTree = parser.Parse(csharpCodeTextBox.Text, \"demo.cs\");\n\t\t\tif (parser.HasErrors) {\n\t\t\t\tMessageBox.Show(string.Join(Environment.NewLine, parser.Errors.Select(err => err.Message)));\n\t\t\t}\n\t\t\tcsharpTreeView.Nodes.Clear();\n\t\t\tforeach (var element in syntaxTree.Children) {\n\t\t\t\tcsharpTreeView.Nodes.Add(MakeTreeNode(element));\n\t\t\t}\n\t\t\tSelectCurrentNode(csharpTreeView.Nodes);\n\t\t\tresolveButton.Enabled = true;\n\t\t\tfindReferencesButton.Enabled = true;\n\t\t}\n\t\t\n\t\tTreeNode MakeTreeNode(AstNode node)\n\t\t{\n\t\t\tTreeNode t = new TreeNode(GetNodeTitle(node));\n\t\t\tt.Tag = node;\n\t\t\tforeach (AstNode child in node.Children) {\n\t\t\t\tt.Nodes.Add(MakeTreeNode(child));\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t\t\n\t\tstring GetNodeTitle(AstNode node)\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tb.Append(node.Role.ToString());\n\t\t\tb.Append(\": \");\n\t\t\tb.Append(node.GetType().Name);\n\t\t\tbool hasProperties = false;\n\t\t\tforeach (PropertyInfo p in node.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {\n\t\t\t\tif (p.Name == \"NodeType\" || p.Name == \"IsNull\" || p.Name == \"IsFrozen\" || p.Name == \"HasChildren\")\n\t\t\t\t\tcontinue;\n\t\t\t\tif (p.PropertyType == typeof(string) || p.PropertyType.IsEnum || p.PropertyType == typeof(bool)) {\n\t\t\t\t\tif (!hasProperties) {\n\t\t\t\t\t\thasProperties = true;\n\t\t\t\t\t\tb.Append(\" (\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tb.Append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\tb.Append(p.Name);\n\t\t\t\t\tb.Append(\" = \");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tobject val = p.GetValue(node, null);\n\t\t\t\t\t\tb.Append(val != null ? val.ToString() : \"**null**\");\n\t\t\t\t\t} catch (TargetInvocationException ex) {\n\t\t\t\t\t\tb.Append(\"**\" + ex.InnerException.GetType().Name + \"**\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasProperties)\n\t\t\t\tb.Append(\")\");\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tbool SelectCurrentNode(TreeNodeCollection c)\n\t\t{\n\t\t\tint selectionStart = csharpCodeTextBox.SelectionStart;\n\t\t\tint selectionEnd = selectionStart + csharpCodeTextBox.SelectionLength;\n\t\t\tforeach (TreeNode t in c) {\n\t\t\t\tAstNode node = t.Tag as AstNode;\n\t\t\t\tif (node != null && !node.StartLocation.IsEmpty && !node.EndLocation.IsEmpty\n\t\t\t\t    && selectionStart >= GetOffset(csharpCodeTextBox, node.StartLocation)\n\t\t\t\t    && selectionEnd <= GetOffset(csharpCodeTextBox, node.EndLocation))\n\t\t\t\t{\n\t\t\t\t\tif (selectionStart == selectionEnd\n\t\t\t\t\t    && (selectionStart == GetOffset(csharpCodeTextBox, node.StartLocation)\n\t\t\t\t\t        || selectionStart == GetOffset(csharpCodeTextBox, node.EndLocation)))\n\t\t\t\t\t{\n\t\t\t\t\t\t// caret is on border of this node; don't expand\n\t\t\t\t\t\tcsharpTreeView.SelectedNode = t;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt.Expand();\n\t\t\t\t\t\tif (!SelectCurrentNode(t.Nodes))\n\t\t\t\t\t\t\tcsharpTreeView.SelectedNode = t;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid CSharpGenerateCodeButtonClick(object sender, EventArgs e)\n\t\t{\n\t\t\tcsharpCodeTextBox.Text = syntaxTree.ToString();\n\t\t}\n\t\t\n\t\tint GetOffset(TextBox textBox, TextLocation location)\n\t\t{\n\t\t\t// TextBox uses 0-based coordinates, TextLocation is 1-based\n\t\t\treturn textBox.GetFirstCharIndexFromLine(location.Line - 1) + location.Column - 1;\n\t\t}\n\t\t\n\t\tTextLocation GetTextLocation(TextBox textBox, int offset)\n\t\t{\n\t\t\tint line = textBox.GetLineFromCharIndex(offset);\n\t\t\tint col = offset - textBox.GetFirstCharIndexFromLine(line);\n\t\t\treturn new TextLocation(line + 1, col + 1);\n\t\t}\n\t\t\n\t\tvoid CSharpTreeViewAfterSelect(object sender, TreeViewEventArgs e)\n\t\t{\n\t\t\tAstNode node = e.Node.Tag as AstNode;\n\t\t\tif (node != null) {\n\t\t\t\tif (node.StartLocation.IsEmpty || node.EndLocation.IsEmpty) {\n\t\t\t\t\tcsharpCodeTextBox.DeselectAll();\n\t\t\t\t} else {\n\t\t\t\t\tint startOffset = GetOffset(csharpCodeTextBox, node.StartLocation);\n\t\t\t\t\tint endOffset = GetOffset(csharpCodeTextBox, node.EndLocation);\n\t\t\t\t\tcsharpCodeTextBox.Select(startOffset, endOffset - startOffset);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tLazy<IList<IUnresolvedAssembly>> builtInLibs = new Lazy<IList<IUnresolvedAssembly>>(\n\t\t\tdelegate {\n\t\t\t\tAssembly[] assemblies = {\n\t\t\t\t\ttypeof(object).Assembly, // mscorlib\n\t\t\t\t\ttypeof(Uri).Assembly, // System.dll\n\t\t\t\t\ttypeof(System.Linq.Enumerable).Assembly, // System.Core.dll\n//\t\t\t\t\ttypeof(System.Xml.XmlDocument).Assembly, // System.Xml.dll\n//\t\t\t\t\ttypeof(System.Drawing.Bitmap).Assembly, // System.Drawing.dll\n//\t\t\t\t\ttypeof(Form).Assembly, // System.Windows.Forms.dll\n\t\t\t\t\ttypeof(ICSharpCode.NRefactory.TypeSystem.IProjectContent).Assembly,\n\t\t\t\t};\n\t\t\t\tIUnresolvedAssembly[] projectContents = new IUnresolvedAssembly[assemblies.Length];\n\t\t\t\tStopwatch total = Stopwatch.StartNew();\n\t\t\t\tParallel.For(\n\t\t\t\t\t0, assemblies.Length,\n\t\t\t\t\tdelegate (int i) {\n\t\t\t\t\t\tStopwatch w = Stopwatch.StartNew();\n\t\t\t\t\t\tAssemblyLoader loader = AssemblyLoader.Create();\n\t\t\t\t\t\tprojectContents[i] = loader.LoadAssemblyFile(assemblies[i].Location);\n\t\t\t\t\t\tDebug.WriteLine(Path.GetFileName(assemblies[i].Location) + \": \" + w.Elapsed);\n\t\t\t\t\t});\n\t\t\t\tDebug.WriteLine(\"Total: \" + total.Elapsed);\n\t\t\t\treturn projectContents;\n\t\t\t});\n\t\t\n\t\tvoid ResolveButtonClick(object sender, EventArgs e)\n\t\t{\n\t\t\tIProjectContent project = new CSharpProjectContent();\n\t\t\tvar unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tproject = project.AddOrUpdateFiles(unresolvedFile);\n\t\t\tproject = project.AddAssemblyReferences(builtInLibs.Value);\n\t\t\t\n\t\t\tICompilation compilation = project.CreateCompilation();\n\t\t\t\n\t\t\tResolveResult result;\n\t\t\tIType expectedType = null;\n\t\t\tConversion conversion = null;\n\t\t\tif (csharpTreeView.SelectedNode != null) {\n\t\t\t\tvar selectedNode = (AstNode)csharpTreeView.SelectedNode.Tag;\n\t\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(compilation, syntaxTree, unresolvedFile);\n\t\t\t\tresult = resolver.Resolve(selectedNode);\n\t\t\t\t// CSharpAstResolver.Resolve() never returns null\n\t\t\t\tExpression expr = selectedNode as Expression;\n\t\t\t\tif (expr != null) {\n\t\t\t\t\texpectedType = resolver.GetExpectedType(expr);\n\t\t\t\t\tconversion = resolver.GetConversion(expr);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTextLocation location = GetTextLocation(csharpCodeTextBox, csharpCodeTextBox.SelectionStart);\n\t\t\t\tresult = ResolveAtLocation.Resolve(compilation, unresolvedFile, syntaxTree, location);\n\t\t\t\tif (result == null) {\n\t\t\t\t\tMessageBox.Show(\"Could not find a resolvable node at the caret location.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tusing (var dlg = new SemanticTreeDialog()) {\n\t\t\t\tdlg.AddRoot(\"Resolve() = \", result);\n\t\t\t\tif (expectedType != null)\n\t\t\t\t\tdlg.AddRoot(\"GetExpectedType() = \", expectedType);\n\t\t\t\tif (conversion != null)\n\t\t\t\t\tdlg.AddRoot(\"GetConversion() = \", conversion);\n\t\t\t\tdlg.ShowDialog();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid CSharpCodeTextBoxKeyDown(object sender, KeyEventArgs e)\n\t\t{\n\t\t\tif (e.Control && e.KeyCode == Keys.A) {\n\t\t\t\te.Handled = true;\n\t\t\t\tcsharpCodeTextBox.SelectAll();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid CsharpCodeTextBoxTextChanged(object sender, EventArgs e)\n\t\t{\n\t\t\tresolveButton.Enabled = false;\n\t\t\tfindReferencesButton.Enabled = false;\n\t\t}\n\t\t\n\t\tvoid FindReferencesButtonClick(object sender, EventArgs e)\n\t\t{\n\t\t\tif (csharpTreeView.SelectedNode == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tIProjectContent project = new CSharpProjectContent();\n\t\t\tvar unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tproject = project.AddOrUpdateFiles(unresolvedFile);\n\t\t\tproject = project.AddAssemblyReferences(builtInLibs.Value);\n\t\t\t\n\t\t\tICompilation compilation = project.CreateCompilation();\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(compilation, syntaxTree, unresolvedFile);\n\t\t\t\n\t\t\tAstNode node = (AstNode)csharpTreeView.SelectedNode.Tag;\n\t\t\tIEntity entity;\n\t\t\tMemberResolveResult mrr = resolver.Resolve(node) as MemberResolveResult;\n\t\t\tTypeResolveResult trr = resolver.Resolve(node) as TypeResolveResult;\n\t\t\tif (mrr != null) {\n\t\t\t\tentity = mrr.Member;\n\t\t\t} else if (trr != null) {\n\t\t\t\tentity = trr.Type.GetDefinition();\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tFindReferences fr = new FindReferences();\n\t\t\tint referenceCount = 0;\n\t\t\tFoundReferenceCallback callback = delegate(AstNode matchNode, ResolveResult result) {\n\t\t\t\tDebug.WriteLine(matchNode.StartLocation + \" - \" + matchNode + \" - \" + result);\n\t\t\t\treferenceCount++;\n\t\t\t};\n\t\t\t\n\t\t\tvar searchScopes = fr.GetSearchScopes(entity);\n\t\t\tDebug.WriteLine(\"Find references to \" + entity.ReflectionName);\n\t\t\tfr.FindReferencesInFile(searchScopes, unresolvedFile, syntaxTree, compilation, callback, CancellationToken.None);\n\t\t\t\n\t\t\tMessageBox.Show(\"Found \" + referenceCount + \" references to \" + entity.FullName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/CSDemo.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" DefaultTargets=\"Build\">\r\n  <PropertyGroup>\r\n    <ProjectGuid>{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}</ProjectGuid>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\r\n    <OutputType>WinExe</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.Demo</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.Demo</AssemblyName>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <OutputPath>..\\bin\\$(Configuration)\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'x86' \">\r\n    <PlatformTarget>x86</PlatformTarget>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <DebugType>Full</DebugType>\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <PlatformTarget>x86</PlatformTarget>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <DebugType>Full</DebugType>\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|x86' \">\r\n    <WarningLevel>4</WarningLevel>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <WarningLevel>4</WarningLevel>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Release' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|x86' \">\r\n    <WarningLevel>4</WarningLevel>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <WarningLevel>4</WarningLevel>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\">\r\n      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r\n    </Reference>\r\n    <Reference Include=\"System.Drawing\" />\r\n    <Reference Include=\"System.Windows.Forms\" />\r\n    <Reference Include=\"System.Xml\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"CSDemo.cs\">\r\n      <SubType>UserControl</SubType>\r\n    </Compile>\r\n    <Compile Include=\"CSDemo.Designer.cs\">\r\n      <DependentUpon>CSDemo.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"MainForm.cs\">\r\n      <SubType>Form</SubType>\r\n    </Compile>\r\n    <Compile Include=\"MainForm.Designer.cs\">\r\n      <DependentUpon>MainForm.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"Program.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"SemanticTreeDialog.cs\">\r\n      <SubType>Form</SubType>\r\n    </Compile>\r\n    <Compile Include=\"SemanticTreeDialog.Designer.cs\">\r\n      <DependentUpon>SemanticTreeDialog.cs</DependentUpon>\r\n    </Compile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.CSharp\\ICSharpCode.NRefactory.CSharp.csproj\">\r\n      <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>\r\n      <Name>ICSharpCode.NRefactory.CSharp</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <EmbeddedResource Include=\"CSDemo.resx\">\r\n      <DependentUpon>CSDemo.cs</DependentUpon>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"MainForm.resx\">\r\n      <DependentUpon>MainForm.cs</DependentUpon>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"SemanticTreeDialog.resx\">\r\n      <DependentUpon>SemanticTreeDialog.cs</DependentUpon>\r\n    </EmbeddedResource>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.Targets\" />\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/MainForm.Designer.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpartial class MainForm\n\t{\n\t\t/// <summary>\n\t\t/// Designer variable used to keep track of non-visual components.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\t\t\n\t\t/// <summary>\n\t\t/// Disposes resources used by the form.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing) {\n\t\t\t\tif (components != null) {\n\t\t\t\t\tcomponents.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// This method is required for Windows Forms designer support.\n\t\t/// Do not change the method contents inside the source code editor. The Forms designer might\n\t\t/// not be able to load this method if it was changed manually.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tthis.miniToolStrip = new System.Windows.Forms.ToolStrip();\n\t\t\tthis.tabPage1 = new System.Windows.Forms.TabPage();\n\t\t\tthis.csDemo1 = new ICSharpCode.NRefactory.Demo.CSDemo();\n\t\t\tthis.tabControl1 = new System.Windows.Forms.TabControl();\n\t\t\tthis.tabPage2 = new System.Windows.Forms.TabPage();\n\t\t\tthis.tabPage1.SuspendLayout();\n\t\t\tthis.tabControl1.SuspendLayout();\n\t\t\tthis.tabPage2.SuspendLayout();\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// miniToolStrip\n\t\t\t// \n\t\t\tthis.miniToolStrip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\n\t\t\tthis.miniToolStrip.AutoSize = false;\n\t\t\tthis.miniToolStrip.CanOverflow = false;\n\t\t\tthis.miniToolStrip.Dock = System.Windows.Forms.DockStyle.None;\n\t\t\tthis.miniToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;\n\t\t\tthis.miniToolStrip.Location = new System.Drawing.Point(13, 3);\n\t\t\tthis.miniToolStrip.Name = \"miniToolStrip\";\n\t\t\tthis.miniToolStrip.Size = new System.Drawing.Size(16, 25);\n\t\t\tthis.miniToolStrip.TabIndex = 3;\n\t\t\t// \n\t\t\t// tabPage1\n\t\t\t// \n\t\t\tthis.tabPage1.Controls.Add(this.csDemo1);\n\t\t\tthis.tabPage1.Location = new System.Drawing.Point(4, 22);\n\t\t\tthis.tabPage1.Name = \"tabPage1\";\n\t\t\tthis.tabPage1.Padding = new System.Windows.Forms.Padding(3);\n\t\t\tthis.tabPage1.Size = new System.Drawing.Size(507, 458);\n\t\t\tthis.tabPage1.TabIndex = 0;\n\t\t\tthis.tabPage1.Text = \"C#\";\n\t\t\tthis.tabPage1.UseVisualStyleBackColor = true;\n\t\t\t// \n\t\t\t// csDemo1\n\t\t\t// \n\t\t\tthis.csDemo1.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.csDemo1.Location = new System.Drawing.Point(3, 3);\n\t\t\tthis.csDemo1.Name = \"csDemo1\";\n\t\t\tthis.csDemo1.Size = new System.Drawing.Size(501, 452);\n\t\t\tthis.csDemo1.TabIndex = 0;\n\t\t\t// \n\t\t\t// tabControl1\n\t\t\t// \n\t\t\tthis.tabControl1.Controls.Add(this.tabPage1);\n\t\t\tthis.tabControl1.Controls.Add(this.tabPage2);\n\t\t\tthis.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.tabControl1.Location = new System.Drawing.Point(0, 0);\n\t\t\tthis.tabControl1.Name = \"tabControl1\";\n\t\t\tthis.tabControl1.SelectedIndex = 0;\n\t\t\tthis.tabControl1.Size = new System.Drawing.Size(515, 484);\n\t\t\tthis.tabControl1.TabIndex = 0;\n\t\t\t// \n\t\t\t// tabPage2\n\t\t\t// \n\t\t\tthis.tabPage2.Location = new System.Drawing.Point(4, 22);\n\t\t\tthis.tabPage2.Name = \"tabPage2\";\n\t\t\tthis.tabPage2.Padding = new System.Windows.Forms.Padding(3);\n\t\t\tthis.tabPage2.Size = new System.Drawing.Size(507, 458);\n\t\t\tthis.tabPage2.TabIndex = 1;\n\t\t\tthis.tabPage2.Text = \"VB\";\n\t\t\tthis.tabPage2.UseVisualStyleBackColor = true;\n\t\t\t// \n\t\t\t// MainForm\n\t\t\t// \n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.ClientSize = new System.Drawing.Size(515, 484);\n\t\t\tthis.Controls.Add(this.tabControl1);\n\t\t\tthis.Name = \"MainForm\";\n\t\t\tthis.Text = \"NRefactory Demo\";\n\t\t\tthis.tabPage1.ResumeLayout(false);\n\t\t\tthis.tabControl1.ResumeLayout(false);\n\t\t\tthis.tabPage2.ResumeLayout(false);\n\t\t\tthis.ResumeLayout(false);\n\t\t}\n\t\tprivate System.Windows.Forms.TabPage tabPage2;\n\t\tprivate ICSharpCode.NRefactory.Demo.CSDemo csDemo1;\n\t\tprivate System.Windows.Forms.ToolStrip miniToolStrip;\n\t\tprivate System.Windows.Forms.TabPage tabPage1;\n\t\tprivate System.Windows.Forms.TabControl tabControl1;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/MainForm.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Windows.Forms;\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\t/// <summary>\n\t/// Description of MainForm.\n\t/// </summary>\n\tpublic partial class MainForm : Form\n\t{\n\t\tpublic MainForm()\n\t\t{\n\t\t\t//\n\t\t\t// The InitializeComponent() call is required for Windows Forms designer support.\n\t\t\t//\n\t\t\tInitializeComponent();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/MainForm.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"miniToolStrip.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n</root>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/Program.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Windows.Forms;\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\t/// <summary>\n\t/// Class with program entry point.\n\t/// </summary>\n\tinternal sealed class Program\n\t{\n\t\t/// <summary>\n\t\t/// Program entry point.\n\t\t/// </summary>\n\t\t[STAThread]\n\t\tprivate static void Main(string[] args)\n\t\t{\n\t\t\tApplication.EnableVisualStyles();\n\t\t\tApplication.SetCompatibleTextRenderingDefault(false);\n\t\t\tApplication.Run(new MainForm());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/Properties/AssemblyInfo.cs",
    "content": "﻿#region Using directives\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#endregion\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.Demo\")]\n[assembly: AssemblyDescription(\"WinForms-based demo application for NRefactory\")]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/SemanticTreeDialog.Designer.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpartial class SemanticTreeDialog\n\t{\n\t\t/// <summary>\n\t\t/// Designer variable used to keep track of non-visual components.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\t\t\n\t\t/// <summary>\n\t\t/// Disposes resources used by the form.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing) {\n\t\t\t\tif (components != null) {\n\t\t\t\t\tcomponents.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// This method is required for Windows Forms designer support.\n\t\t/// Do not change the method contents inside the source code editor. The Forms designer might\n\t\t/// not be able to load this method if it was changed manually.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tthis.cancelButton = new System.Windows.Forms.Button();\n\t\t\tthis.treeView = new System.Windows.Forms.TreeView();\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// cancelButton\n\t\t\t// \n\t\t\tthis.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));\n\t\t\tthis.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;\n\t\t\tthis.cancelButton.Location = new System.Drawing.Point(197, 236);\n\t\t\tthis.cancelButton.Name = \"cancelButton\";\n\t\t\tthis.cancelButton.Size = new System.Drawing.Size(75, 23);\n\t\t\tthis.cancelButton.TabIndex = 0;\n\t\t\tthis.cancelButton.Text = \"Close\";\n\t\t\tthis.cancelButton.UseVisualStyleBackColor = true;\n\t\t\t// \n\t\t\t// treeView\n\t\t\t// \n\t\t\tthis.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) \n\t\t\t\t\t\t\t\t\t| System.Windows.Forms.AnchorStyles.Left) \n\t\t\t\t\t\t\t\t\t| System.Windows.Forms.AnchorStyles.Right)));\n\t\t\tthis.treeView.Location = new System.Drawing.Point(12, 12);\n\t\t\tthis.treeView.Name = \"treeView\";\n\t\t\tthis.treeView.ShowRootLines = false;\n\t\t\tthis.treeView.Size = new System.Drawing.Size(260, 218);\n\t\t\tthis.treeView.TabIndex = 1;\n\t\t\t// \n\t\t\t// SemanticTreeDialog\n\t\t\t// \n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.CancelButton = this.cancelButton;\n\t\t\tthis.ClientSize = new System.Drawing.Size(284, 262);\n\t\t\tthis.Controls.Add(this.treeView);\n\t\t\tthis.Controls.Add(this.cancelButton);\n\t\t\tthis.Name = \"SemanticTreeDialog\";\n\t\t\tthis.Text = \"Semantic Tree\";\n\t\t\tthis.ResumeLayout(false);\n\t\t}\n\t\tprivate System.Windows.Forms.TreeView treeView;\n\t\tprivate System.Windows.Forms.Button cancelButton;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/SemanticTreeDialog.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Drawing;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Windows.Forms;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\t/// <summary>\n\t/// Description of SemanticTreeDialog.\n\t/// </summary>\n\tpublic partial class SemanticTreeDialog : Form\n\t{\n\t\tpublic SemanticTreeDialog()\n\t\t{\n\t\t\t//\n\t\t\t// The InitializeComponent() call is required for Windows Forms designer support.\n\t\t\t//\n\t\t\tInitializeComponent();\n\t\t}\n\t\t\n\t\tpublic void AddRoot(string prefix, object obj)\n\t\t{\n\t\t\tvar rootNode = MakeObjectNode(prefix, obj);\n\t\t\trootNode.Expand();\n\t\t\ttreeView.Nodes.Add(rootNode);\n\t\t}\n\t\t\n\t\tTreeNode MakeObjectNode(string prefix, object obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn new TreeNode(prefix + \"null\");\n\t\t\tif (obj is ResolveResult || (obj is Conversion && UseNodeForConversion((Conversion)obj))) {\n\t\t\t\tTreeNode t = new TreeNode(prefix + obj.GetType().Name);\n\t\t\t\tt.Tag = obj;\n\t\t\t\tforeach (PropertyInfo p in obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {\n\t\t\t\t\tif (p.Name == \"ConstantValue\" && !((ResolveResult)obj).IsCompileTimeConstant)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tTreeNode child = MakePropertyNode(p.Name, p.PropertyType, p.GetValue(obj, null));\n\t\t\t\t\tif (child != null)\n\t\t\t\t\t\tt.Nodes.Add(child);\n\t\t\t\t}\n\t\t\t\tforeach (FieldInfo p in obj.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance)) {\n\t\t\t\t\tTreeNode child = MakePropertyNode(p.Name, p.FieldType, p.GetValue(obj));\n\t\t\t\t\tif (child != null)\n\t\t\t\t\t\tt.Nodes.Add(child);\n\t\t\t\t}\n\t\t\t\treturn t;\n\t\t\t} else {\n\t\t\t\treturn new TreeNode(prefix + obj.ToString());\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool UseNodeForConversion(Conversion conversion)\n\t\t{\n\t\t\treturn conversion.IsMethodGroupConversion || conversion.IsUserDefined;\n\t\t}\n\t\t\n\t\tTreeNode MakePropertyNode(string propertyName, Type propertyType, object propertyValue)\n\t\t{\n\t\t\tif (propertyName == \"IsError\" && (propertyValue as bool?) == false)\n\t\t\t\treturn null;\n\t\t\tif (propertyName == \"IsCompileTimeConstant\" && (propertyValue as bool?) == false)\n\t\t\t\treturn null;\n\t\t\tif (propertyValue == null) {\n\t\t\t\treturn new TreeNode(propertyName + \" = null\");\n\t\t\t}\n\t\t\tif (propertyType.GetInterface(\"System.Collections.IEnumerable\") != null && propertyType != typeof(string)) {\n\t\t\t\tvar collection = ((IEnumerable)propertyValue).Cast<object>().ToList();\n\t\t\t\tvar node = new TreeNode(propertyName + \" = Collection with \" + collection.Count + \" elements\");\n\t\t\t\tforeach (object element in collection) {\n\t\t\t\t\tnode.Nodes.Add(MakeObjectNode(\"\", element));\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\treturn MakeObjectNode(propertyName + \" = \", propertyValue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/SemanticTreeDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.Designer.cs",
    "content": "﻿// Copyright (c) AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpartial class VBAstView : System.Windows.Forms.UserControl\n\t{\n\t\t/// <summary>\n\t\t/// Designer variable used to keep track of non-visual components.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\t\t\n\t\t/// <summary>\n\t\t/// Disposes resources used by the control.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing) {\n\t\t\t\tif (components != null) {\n\t\t\t\t\tcomponents.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// This method is required for Windows Forms designer support.\n\t\t/// Do not change the method contents inside the source code editor. The Forms designer might\n\t\t/// not be able to load this method if it was changed manually.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tthis.tree = new System.Windows.Forms.TreeView();\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// tree\n\t\t\t// \n\t\t\tthis.tree.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.tree.HideSelection = false;\n\t\t\tthis.tree.Location = new System.Drawing.Point(0, 0);\n\t\t\tthis.tree.Name = \"tree\";\n\t\t\tthis.tree.ShowRootLines = false;\n\t\t\tthis.tree.Size = new System.Drawing.Size(186, 182);\n\t\t\tthis.tree.TabIndex = 0;\n\t\t\tthis.tree.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TreeKeyDown);\n\t\t\t// \n\t\t\t// AstView\n\t\t\t// \n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.Controls.Add(this.tree);\n\t\t\tthis.Name = \"AstView\";\n\t\t\tthis.Size = new System.Drawing.Size(186, 182);\n\t\t\tthis.ResumeLayout(false);\n\t\t}\n\t\tprivate System.Windows.Forms.TreeView tree;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.cs",
    "content": "﻿// Copyright (c) AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Windows.Forms;\nusing System.Reflection;\n\nusing ICSharpCode.NRefactory.VB.Ast;\nusing ICSharpCode.NRefactory.VB;\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpublic partial class VBAstView\n\t{\n\t\tCompilationUnit unit;\n\t\t\n\t\tpublic CompilationUnit Unit {\n\t\t\tget {\n\t\t\t\treturn unit;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value != null) {\n\t\t\t\t\tunit = value;\n\t\t\t\t\tUpdateTree();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid UpdateTree()\n\t\t{\n\t\t\ttree.Nodes.Clear();\n\t\t\ttree.Nodes.Add(new CollectionNode(\"CompilationUnit\", unit.Children));\n\t\t\ttree.SelectedNode = tree.Nodes[0];\n\t\t}\n\t\t\n\t\tpublic VBAstView()\n\t\t{\n\t\t\tInitializeComponent();\n\t\t}\n\t\t\n//\t\tpublic void DeleteSelectedNode()\n//\t\t{\n//\t\t\tif (tree.SelectedNode is ElementNode) {\n//\t\t\t\tINode element = (tree.SelectedNode as ElementNode).element;\n//\t\t\t\tif (tree.SelectedNode.Parent is CollectionNode) {\n//\t\t\t\t\tif (MessageBox.Show(\"Remove selected node from parent collection?\", \"Remove node\", MessageBoxButtons.YesNo, MessageBoxIcon.Question)\n//\t\t\t\t\t    == DialogResult.Yes)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tIList col = (tree.SelectedNode.Parent as CollectionNode).collection;\n//\t\t\t\t\t\tcol.Remove(element);\n//\t\t\t\t\t\t(tree.SelectedNode.Parent as CollectionNode).Update();\n//\t\t\t\t\t}\n//\t\t\t\t} else if (tree.SelectedNode.Parent is ElementNode) {\n//\t\t\t\t\tif (MessageBox.Show(\"Set selected property to null?\", \"Remove node\", MessageBoxButtons.YesNo, MessageBoxIcon.Question)\n//\t\t\t\t\t    == DialogResult.Yes)\n//\t\t\t\t\t{\n//\t\t\t\t\t\t// get parent element\n//\t\t\t\t\t\telement = (tree.SelectedNode.Parent as ElementNode).element;\n//\t\t\t\t\t\tstring propertyName = (string)tree.SelectedNode.Tag;\n//\t\t\t\t\t\telement.GetType().GetProperty(propertyName).SetValue(element, null, null);\n//\t\t\t\t\t\t(tree.SelectedNode.Parent as ElementNode).Update();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} else if (tree.SelectedNode is CollectionNode) {\n//\t\t\t\tif (MessageBox.Show(\"Remove all elements from selected collection?\", \"Clear collection\", MessageBoxButtons.YesNo, MessageBoxIcon.Question)\n//\t\t\t\t    == DialogResult.Yes)\n//\t\t\t\t{\n//\t\t\t\t\tIList col = (tree.SelectedNode as CollectionNode).collection;\n//\t\t\t\t\tcol.Clear();\n//\t\t\t\t\t(tree.SelectedNode as CollectionNode).Update();\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t\t\n//\t\tpublic void EditSelectedNode()\n//\t\t{\n//\t\t\tTreeNode node = tree.SelectedNode;\n//\t\t\twhile (!(node is ElementNode)) {\n//\t\t\t\tif (node == null) {\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\tnode = node.Parent;\n//\t\t\t}\n//\t\t\tINode element = ((ElementNode)node).element;\n//\t\t\tusing (VBEditDialog dlg = new VBEditDialog(element)) {\n//\t\t\t\tdlg.ShowDialog();\n//\t\t\t}\n//\t\t\t((ElementNode)node).Update();\n//\t\t}\n//\t\t\n//\t\tpublic void ApplyTransformation(IAstVisitor visitor)\n//\t\t{\n//\t\t\tif (tree.SelectedNode == tree.Nodes[0]) {\n//\t\t\t\tunit.AcceptVisitor(visitor, null);\n//\t\t\t\tUpdateTree();\n//\t\t\t} else {\n//\t\t\t\tstring name = visitor.GetType().Name;\n//\t\t\t\tElementNode elementNode = tree.SelectedNode as ElementNode;\n//\t\t\t\tCollectionNode collectionNode = tree.SelectedNode as CollectionNode;\n//\t\t\t\tif (elementNode != null) {\n//\t\t\t\t\tif (MessageBox.Show((\"Apply \" + name + \" to selected element '\" + elementNode.Text + \"'?\"),\n//\t\t\t\t\t                    \"Apply transformation\", MessageBoxButtons.YesNo, MessageBoxIcon.Question)\n//\t\t\t\t\t    == DialogResult.Yes)\n//\t\t\t\t\t{\n//\t\t\t\t\t\telementNode.element.AcceptVisitor(visitor, null);\n//\t\t\t\t\t\telementNode.Update();\n//\t\t\t\t\t}\n//\t\t\t\t} else if (collectionNode != null) {\n//\t\t\t\t\tif (MessageBox.Show((\"Apply \" + name + \" to all elements in selected collection '\" + collectionNode.Text + \"'?\"),\n//\t\t\t\t\t                    \"Apply transformation\", MessageBoxButtons.YesNo, MessageBoxIcon.Question)\n//\t\t\t\t\t    == DialogResult.Yes)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tforeach (TreeNode subNode in collectionNode.Nodes) {\n//\t\t\t\t\t\t\tif (subNode is ElementNode) {\n//\t\t\t\t\t\t\t\t(subNode as ElementNode).element.AcceptVisitor(visitor, null);\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tcollectionNode.Update();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t\t\n\t\tstatic TreeNode CreateNode(object child)\n\t\t{\n\t\t\tif (child == null) {\n\t\t\t\treturn new TreeNode(\"*null reference*\");\n\t\t\t} else if (child is INode) {\n\t\t\t\treturn new ElementNode(child as INode);\n\t\t\t} else {\n\t\t\t\treturn new TreeNode(child.ToString());\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass CollectionNode : TreeNode\n\t\t{\n\t\t\tinternal IList collection;\n\t\t\tstring baseName;\n\t\t\t\n\t\t\tpublic CollectionNode(string text, IList children) : base(text)\n\t\t\t{\n\t\t\t\tthis.baseName = text;\n\t\t\t\tthis.collection = children;\n\t\t\t\tUpdate();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Update()\n\t\t\t{\n\t\t\t\tif (collection.Count == 0) {\n\t\t\t\t\tText = baseName + \" (empty collection)\";\n\t\t\t\t} else if (collection.Count == 1) {\n\t\t\t\t\tText = baseName + \" (collection with 1 element)\";\n\t\t\t\t} else {\n\t\t\t\t\tText = baseName + \" (collection with \" + collection.Count + \" elements)\";\n\t\t\t\t}\n\t\t\t\tNodes.Clear();\n\t\t\t\tforeach (object child in collection) {\n\t\t\t\t\tNodes.Add(CreateNode(child));\n\t\t\t\t}\n\t\t\t\tExpand();\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass ElementNode : TreeNode\n\t\t{\n\t\t\tinternal AstNode element;\n\t\t\t\n\t\t\tpublic ElementNode(AstNode node)\n\t\t\t{\n\t\t\t\tthis.element = node;\n\t\t\t\tUpdate();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Update()\n\t\t\t{\n\t\t\t\tNodes.Clear();\n\t\t\t\tType type = element.GetType();\n\t\t\t\tText = type.Name;\n\t\t\t\tif (Tag != null) { // HACK: after editing property element\n\t\t\t\t\tText = Tag.ToString() + \" = \" + Text;\n\t\t\t\t}\n\t\t\t\tif (!(element is INullable && (element as INullable).IsNull)) {\n\t\t\t\t\tAddProperties(type, element);\n\t\t\t\t\tif (element.Children.Count > 0) {\n\t\t\t\t\t\tNodes.Add(new CollectionNode(\"Children\", element.Children));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvoid AddProperties(Type type, AstNode node)\n\t\t\t{\n\t\t\t\tif (type == typeof(AbstractNode))\n\t\t\t\t\treturn;\n\t\t\t\tforeach (PropertyInfo pi in type.GetProperties(BindingFlags.Instance | BindingFlags.Public)) {\n\t\t\t\t\tif (pi.DeclaringType != type) // don't add derived properties\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (pi.Name == \"IsNull\")\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tobject value = pi.GetValue(node, null);\n\t\t\t\t\tif (value is IList) {\n\t\t\t\t\t\tNodes.Add(new CollectionNode(pi.Name, (IList)value));\n\t\t\t\t\t} else if (value is string) {\n\t\t\t\t\t\tText += \" \" + pi.Name + \"='\" + value + \"'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTreeNode treeNode = CreateNode(value);\n\t\t\t\t\t\ttreeNode.Text = pi.Name + \" = \" + treeNode.Text;\n\t\t\t\t\t\ttreeNode.Tag = pi.Name;\n\t\t\t\t\t\tNodes.Add(treeNode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAddProperties(type.BaseType, node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid TreeKeyDown(object sender, KeyEventArgs e)\n\t\t{\n\t\t\tif (e.KeyData == Keys.Delete) {\n\t\t\t\tDeleteSelectedNode();\n\t\t\t} else if (e.KeyData == Keys.Space || e.KeyData == Keys.Enter) {\n\t\t\t\tEditSelectedNode();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBDemo.Designer.cs",
    "content": "﻿// Copyright (c) AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpartial class VBDemo\n\t{\n\t\t/// <summary>\n\t\t/// Designer variable used to keep track of non-visual components.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\t\t\n\t\t/// <summary>\n\t\t/// Disposes resources used by the control.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing) {\n\t\t\t\tif (components != null) {\n\t\t\t\t\tcomponents.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// This method is required for Windows Forms designer support.\n\t\t/// Do not change the method contents inside the source code editor. The Forms designer might\n\t\t/// not be able to load this method if it was changed manually.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tthis.splitContainer1 = new System.Windows.Forms.SplitContainer();\n\t\t\tthis.codeView = new System.Windows.Forms.TextBox();\n\t\t\tthis.generateCodeButton = new System.Windows.Forms.Button();\n\t\t\tthis.parseButton = new System.Windows.Forms.Button();\n\t\t\tthis.treeView = new System.Windows.Forms.TreeView();\n\t\t\t((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();\n\t\t\tthis.splitContainer1.Panel1.SuspendLayout();\n\t\t\tthis.splitContainer1.Panel2.SuspendLayout();\n\t\t\tthis.splitContainer1.SuspendLayout();\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// splitContainer1\n\t\t\t// \n\t\t\tthis.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.splitContainer1.Location = new System.Drawing.Point(0, 0);\n\t\t\tthis.splitContainer1.Name = \"splitContainer1\";\n\t\t\tthis.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;\n\t\t\t// \n\t\t\t// splitContainer1.Panel1\n\t\t\t// \n\t\t\tthis.splitContainer1.Panel1.Controls.Add(this.codeView);\n\t\t\t// \n\t\t\t// splitContainer1.Panel2\n\t\t\t// \n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.generateCodeButton);\n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.parseButton);\n\t\t\tthis.splitContainer1.Panel2.Controls.Add(this.treeView);\n\t\t\tthis.splitContainer1.Size = new System.Drawing.Size(462, 391);\n\t\t\tthis.splitContainer1.SplitterDistance = 173;\n\t\t\tthis.splitContainer1.TabIndex = 1;\n\t\t\t// \n\t\t\t// codeView\n\t\t\t// \n\t\t\tthis.codeView.AcceptsReturn = true;\n\t\t\tthis.codeView.AcceptsTab = true;\n\t\t\tthis.codeView.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.codeView.Font = new System.Drawing.Font(\"Courier New\", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n\t\t\tthis.codeView.HideSelection = false;\n\t\t\tthis.codeView.Location = new System.Drawing.Point(0, 0);\n\t\t\tthis.codeView.Multiline = true;\n\t\t\tthis.codeView.Name = \"codeView\";\n\t\t\tthis.codeView.ScrollBars = System.Windows.Forms.ScrollBars.Both;\n\t\t\tthis.codeView.Size = new System.Drawing.Size(462, 173);\n\t\t\tthis.codeView.TabIndex = 0;\n\t\t\tthis.codeView.Text = \"Option Explicit\";\n\t\t\tthis.codeView.WordWrap = false;\n\t\t\t// \n\t\t\t// generateCodeButton\n\t\t\t// \n\t\t\tthis.generateCodeButton.Anchor = System.Windows.Forms.AnchorStyles.Top;\n\t\t\tthis.generateCodeButton.Location = new System.Drawing.Point(225, 2);\n\t\t\tthis.generateCodeButton.Name = \"generateCodeButton\";\n\t\t\tthis.generateCodeButton.Size = new System.Drawing.Size(100, 23);\n\t\t\tthis.generateCodeButton.TabIndex = 1;\n\t\t\tthis.generateCodeButton.Text = \"Generate\";\n\t\t\tthis.generateCodeButton.UseVisualStyleBackColor = true;\n\t\t\tthis.generateCodeButton.Click += new System.EventHandler(this.CSharpGenerateCodeButtonClick);\n\t\t\t// \n\t\t\t// parseButton\n\t\t\t// \n\t\t\tthis.parseButton.Anchor = System.Windows.Forms.AnchorStyles.Top;\n\t\t\tthis.parseButton.Location = new System.Drawing.Point(119, 2);\n\t\t\tthis.parseButton.Name = \"parseButton\";\n\t\t\tthis.parseButton.Size = new System.Drawing.Size(100, 23);\n\t\t\tthis.parseButton.TabIndex = 0;\n\t\t\tthis.parseButton.Text = \"Parse\";\n\t\t\tthis.parseButton.UseVisualStyleBackColor = true;\n\t\t\tthis.parseButton.Click += new System.EventHandler(this.CSharpParseButtonClick);\n\t\t\t// \n\t\t\t// treeView\n\t\t\t// \n\t\t\tthis.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) \n\t\t\t\t\t\t\t\t\t| System.Windows.Forms.AnchorStyles.Left) \n\t\t\t\t\t\t\t\t\t| System.Windows.Forms.AnchorStyles.Right)));\n\t\t\tthis.treeView.Location = new System.Drawing.Point(3, 31);\n\t\t\tthis.treeView.Name = \"treeView\";\n\t\t\tthis.treeView.Size = new System.Drawing.Size(459, 180);\n\t\t\tthis.treeView.TabIndex = 0;\n\t\t\tthis.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.CSharpTreeViewAfterSelect);\n\t\t\t// \n\t\t\t// VBDemo\n\t\t\t// \n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.Controls.Add(this.splitContainer1);\n\t\t\tthis.Name = \"VBDemo\";\n\t\t\tthis.Size = new System.Drawing.Size(462, 391);\n\t\t\tthis.splitContainer1.Panel1.ResumeLayout(false);\n\t\t\tthis.splitContainer1.Panel1.PerformLayout();\n\t\t\tthis.splitContainer1.Panel2.ResumeLayout(false);\n\t\t\t((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();\n\t\t\tthis.splitContainer1.ResumeLayout(false);\n\t\t\tthis.ResumeLayout(false);\n\t\t}\n\t\tprivate System.Windows.Forms.TextBox codeView;\n\t\tprivate System.Windows.Forms.TreeView treeView;\n\t\tprivate System.Windows.Forms.Button generateCodeButton;\n\t\tprivate System.Windows.Forms.Button parseButton;\n\t\tprivate System.Windows.Forms.SplitContainer splitContainer1;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBDemo.cs",
    "content": "﻿// Copyright (c) AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Windows.Forms;\n\nusing ICSharpCode.NRefactory.VB;\nusing ICSharpCode.NRefactory.VB.Ast;\nusing ICSharpCode.NRefactory.VB.Parser;\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\t/// <summary>\n\t/// Description of VBDemo.\n\t/// </summary>\n\tpublic partial class VBDemo : UserControl\n\t{\n\t\tpublic VBDemo()\n\t\t{\n\t\t\t//\n\t\t\t// The InitializeComponent() call is required for Windows Forms designer support.\n\t\t\t//\n\t\t\tInitializeComponent();\n\t\t}\n\t\t\n\t\tCompilationUnit compilationUnit;\n\t\t\n\t\tvoid CSharpParseButtonClick(object sender, EventArgs e)\n\t\t{\n\t\t\tvar parser = new VBParser();\n\t\t\tcompilationUnit = parser.Parse(new StringReader(codeView.Text));\n\t\t\tif (parser.HasErrors)\n\t\t\t\tMessageBox.Show(parser.Errors.ErrorOutput);\n\t\t\ttreeView.Nodes.Clear();\n\t\t\tforeach (var element in compilationUnit.Children) {\n\t\t\t\ttreeView.Nodes.Add(MakeTreeNode(element));\n\t\t\t}\n\t\t\tSelectCurrentNode(treeView.Nodes);\n\t\t}\n\t\t\n\t\tTreeNode MakeTreeNode(AstNode node)\n\t\t{\n\t\t\tTreeNode t = new TreeNode(GetNodeTitle(node));\n\t\t\tt.Tag = node;\n\t\t\tforeach (AstNode child in node.Children) {\n\t\t\t\tt.Nodes.Add(MakeTreeNode(child));\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t\t\n\t\tstring GetNodeTitle(AstNode node)\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tb.Append(node.Role.ToString());\n\t\t\tb.Append(\": \");\n\t\t\tb.Append(node.GetType().Name);\n\t\t\tbool hasProperties = false;\n\t\t\tforeach (PropertyInfo p in node.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {\n\t\t\t\tif (p.Name == \"NodeType\" || p.Name == \"IsNull\")\n\t\t\t\t\tcontinue;\n\t\t\t\tif (p.PropertyType == typeof(string) || p.PropertyType.IsEnum || p.PropertyType == typeof(bool)) {\n\t\t\t\t\tif (!hasProperties) {\n\t\t\t\t\t\thasProperties = true;\n\t\t\t\t\t\tb.Append(\" (\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tb.Append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\tb.Append(p.Name);\n\t\t\t\t\tb.Append(\" = \");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tobject val = p.GetValue(node, null);\n\t\t\t\t\t\tb.Append(val != null ? val.ToString() : \"**null**\");\n\t\t\t\t\t} catch (TargetInvocationException ex) {\n\t\t\t\t\t\tb.Append(\"**\" + ex.InnerException.GetType().Name + \"**\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasProperties)\n\t\t\t\tb.Append(\")\");\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tbool SelectCurrentNode(TreeNodeCollection c)\n\t\t{\n\t\t\tint selectionStart = codeView.SelectionStart;\n\t\t\tint selectionEnd = selectionStart + codeView.SelectionLength;\n\t\t\tforeach (TreeNode t in c) {\n\t\t\t\tAstNode node = t.Tag as AstNode;\n\t\t\t\tif (node != null\n\t\t\t\t    && selectionStart >= GetOffset(codeView, node.StartLocation)\n\t\t\t\t    && selectionEnd <= GetOffset(codeView, node.EndLocation))\n\t\t\t\t{\n\t\t\t\t\tif (selectionStart == selectionEnd\n\t\t\t\t\t    && (selectionStart == GetOffset(codeView, node.StartLocation)\n\t\t\t\t\t        || selectionStart == GetOffset(codeView, node.EndLocation)))\n\t\t\t\t\t{\n\t\t\t\t\t\t// caret is on border of this node; don't expand\n\t\t\t\t\t\ttreeView.SelectedNode = t;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt.Expand();\n\t\t\t\t\t\tif (!SelectCurrentNode(t.Nodes))\n\t\t\t\t\t\t\ttreeView.SelectedNode = t;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvoid CSharpGenerateCodeButtonClick(object sender, EventArgs e)\n\t\t{\n\t\t\tStringWriter w = new StringWriter();\n\t\t\tOutputVisitor output = new OutputVisitor(w, new VBFormattingOptions());\n\t\t\tcompilationUnit.AcceptVisitor(output, null);\n\t\t\tcodeView.Text = w.ToString();\n\t\t}\n\t\t\n\t\tint GetOffset(TextBox textBox, TextLocation location)\n\t\t{\n\t\t\treturn textBox.GetFirstCharIndexFromLine(location.Line - 1) + location.Column - 1;\n\t\t}\n\t\t\n\t\tvoid CSharpTreeViewAfterSelect(object sender, TreeViewEventArgs e)\n\t\t{\n\t\t\tAstNode node = e.Node.Tag as AstNode;\n\t\t\tif (node != null) {\n\t\t\t\tint startOffset = GetOffset(codeView, node.StartLocation);\n\t\t\t\tint endOffset = GetOffset(codeView, node.EndLocation);\n\t\t\t\tcodeView.Select(startOffset, endOffset - startOffset);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBDemo.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBEditDialog.Designer.cs",
    "content": "﻿// Copyright (c) AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpartial class VBEditDialog : System.Windows.Forms.Form\n\t{\n\t\t/// <summary>\n\t\t/// Designer variable used to keep track of non-visual components.\n\t\t/// </summary>\n\t\tprivate System.ComponentModel.IContainer components = null;\n\t\t\n\t\t/// <summary>\n\t\t/// Disposes resources used by the form.\n\t\t/// </summary>\n\t\t/// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing) {\n\t\t\t\tif (components != null) {\n\t\t\t\t\tcomponents.Dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// This method is required for Windows Forms designer support.\n\t\t/// Do not change the method contents inside the source code editor. The Forms designer might\n\t\t/// not be able to load this method if it was changed manually.\n\t\t/// </summary>\n\t\tprivate void InitializeComponent()\n\t\t{\n\t\t\tthis.propertyGrid = new System.Windows.Forms.PropertyGrid();\n\t\t\tthis.panel1 = new System.Windows.Forms.Panel();\n\t\t\tthis.okButton = new System.Windows.Forms.Button();\n\t\t\tthis.panel1.SuspendLayout();\n\t\t\tthis.SuspendLayout();\n\t\t\t// \n\t\t\t// propertyGrid\n\t\t\t// \n\t\t\tthis.propertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;\n\t\t\tthis.propertyGrid.HelpVisible = false;\n\t\t\tthis.propertyGrid.Location = new System.Drawing.Point(0, 0);\n\t\t\tthis.propertyGrid.Name = \"propertyGrid\";\n\t\t\tthis.propertyGrid.PropertySort = System.Windows.Forms.PropertySort.Alphabetical;\n\t\t\tthis.propertyGrid.Size = new System.Drawing.Size(477, 436);\n\t\t\tthis.propertyGrid.TabIndex = 0;\n\t\t\tthis.propertyGrid.ToolbarVisible = false;\n\t\t\t// \n\t\t\t// panel1\n\t\t\t// \n\t\t\tthis.panel1.Controls.Add(this.okButton);\n\t\t\tthis.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;\n\t\t\tthis.panel1.Location = new System.Drawing.Point(0, 436);\n\t\t\tthis.panel1.Name = \"panel1\";\n\t\t\tthis.panel1.Size = new System.Drawing.Size(477, 38);\n\t\t\tthis.panel1.TabIndex = 1;\n\t\t\t// \n\t\t\t// okButton\n\t\t\t// \n\t\t\tthis.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\n\t\t\tthis.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;\n\t\t\tthis.okButton.Location = new System.Drawing.Point(390, 6);\n\t\t\tthis.okButton.Name = \"okButton\";\n\t\t\tthis.okButton.Size = new System.Drawing.Size(75, 23);\n\t\t\tthis.okButton.TabIndex = 0;\n\t\t\tthis.okButton.Text = \"OK\";\n\t\t\tthis.okButton.UseVisualStyleBackColor = true;\n\t\t\t// \n\t\t\t// EditDialog\n\t\t\t// \n\t\t\tthis.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n\t\t\tthis.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n\t\t\tthis.CancelButton = this.okButton;\n\t\t\tthis.ClientSize = new System.Drawing.Size(477, 474);\n\t\t\tthis.Controls.Add(this.propertyGrid);\n\t\t\tthis.Controls.Add(this.panel1);\n\t\t\tthis.Name = \"EditDialog\";\n\t\t\tthis.Text = \"EditDialog\";\n\t\t\tthis.panel1.ResumeLayout(false);\n\t\t\tthis.ResumeLayout(false);\n\t\t}\n\t\tprivate System.Windows.Forms.PropertyGrid propertyGrid;\n\t\tprivate System.Windows.Forms.Button okButton;\n\t\tprivate System.Windows.Forms.Panel panel1;\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBEditDialog.cs",
    "content": "﻿// Copyright (c) AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nnamespace ICSharpCode.NRefactory.Demo\n{\n\tpublic partial class VBEditDialog\n\t{\n\t\tpublic VBEditDialog(object element)\n\t\t{\n\t\t\tInitializeComponent();\n\t\t\tpropertyGrid.SelectedObject = element;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Demo/VBEditDialog.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/AssemblyInfo.cs",
    "content": "// \n// AssemblyInfo.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\n\n// Information about this assembly is defined by the following attributes. \n// Change them to the values specific to your project.\n\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.GtkDemo\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Xamarin\")]\n[assembly: AssemblyProduct(\"\")]\n[assembly: AssemblyCopyright(\"Xamarin Inc. (http://xamarin.com)\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// The assembly version has the format \"{Major}.{Minor}.{Build}.{Revision}\".\n// The form \"{Major}.{Minor}.*\" will automatically update the build and revision,\n// and \"{Major}.{Minor}.{Build}.*\" will update just the revision.\n\n[assembly: AssemblyVersion(\"1.0.*\")]\n\n// The following attributes are used to specify the signing key for the assembly, \n// if desired. See the Mono documentation for more information about signing.\n\n//[assembly: AssemblyDelaySign(false)]\n//[assembly: AssemblyKeyFile(\"\")]\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/CSharpDemo.cs",
    "content": "// CSharpDemo.cs\nusing System;\nusing System.Linq;\n\nnamespace Demo\n{\n\t#region Demo\n\tpublic class CSharpDemo\n\t{\n\t\tstatic void TestMe (int i)\n\t\t{\n\t\t\tConsole.WriteLine (i);\n\t\t\tNotDefined ();\n\t\t}\n\t\t\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tTestMe (args.Count ());\n\t\t}\n\t}\n\t#endregion\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/ICSharpCode.NRefactory.GtkDemo.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <ProjectGuid>{A7EEF7F8-238F-459D-95A9-96467539641D}</ProjectGuid>\r\n    <OutputType>WinExe</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.GtkDemo</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.GtkDemo</AssemblyName>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f\" />\r\n    <Reference Include=\"gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f\" />\r\n    <Reference Include=\"glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f\" />\r\n    <Reference Include=\"glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f\" />\r\n    <Reference Include=\"pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f\" />\r\n    <Reference Include=\"atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f\" />\r\n    <Reference Include=\"Mono.Posix\" />\r\n    <Reference Include=\"System.Core\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <EmbeddedResource Include=\"gtk-gui\\gui.stetic\">\r\n      <LogicalName>gui.stetic</LogicalName>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"pixbuf\\comment.png\">\r\n      <LogicalName>comment.png</LogicalName>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"pixbuf\\element-class-16.png\">\r\n      <LogicalName>class.png</LogicalName>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"pixbuf\\element-field-16.png\">\r\n      <LogicalName>expression.png</LogicalName>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"pixbuf\\element-literal-16.png\">\r\n      <LogicalName>token.png</LogicalName>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"pixbuf\\element-method-16.png\">\r\n      <LogicalName>statement.png</LogicalName>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"pixbuf\\element-namespace-16.png\">\r\n      <LogicalName>namespace.png</LogicalName>\r\n    </EmbeddedResource>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"gtk-gui\\generated.cs\" />\r\n    <Compile Include=\"Main.cs\" />\r\n    <Compile Include=\"AssemblyInfo.cs\" />\r\n    <Compile Include=\"MainWindow.cs\" />\r\n    <Compile Include=\"gtk-gui\\ICSharpCode.NRefactory.GtkDemo.MainWindow.cs\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.CSharp\\ICSharpCode.NRefactory.CSharp.csproj\">\r\n      <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>\r\n      <Name>ICSharpCode.NRefactory.CSharp</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.Cecil\\ICSharpCode.NRefactory.Cecil.csproj\">\r\n      <Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>\r\n      <Name>ICSharpCode.NRefactory.Cecil</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\..\\cecil\\Mono.Cecil.csproj\">\r\n      <Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>\r\n      <Name>Mono.Cecil</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"CSharpDemo.cs\">\r\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\r\n    </None>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Folder Include=\"pixbuf\\\" />\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/Main.cs",
    "content": "// \n// Main.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing Gtk;\n\nnamespace ICSharpCode.NRefactory.GtkDemo\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tApplication.Init ();\n\t\t\tMainWindow win = new MainWindow ();\n\t\t\twin.Show ();\n\t\t\tApplication.Run ();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/MainWindow.cs",
    "content": "﻿// \n// MainWindow.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp;\nusing Gtk;\nusing System.IO;\nusing System.Text;\nusing System.Reflection;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading.Tasks;\nusing Gdk;\nusing System.Threading;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.GtkDemo\n{\n\tpublic partial class MainWindow : Gtk.Window\n\t{\n\t\tTreeStore store = new TreeStore (typeof (string), typeof (string), typeof (AstNode), typeof (Pixbuf));\n\t\tDictionary<AstNode, TreeIter> iterDict = new Dictionary<AstNode, TreeIter> ();\n//\t\tTextEditor editor = new TextEditor ();\n\t\tSyntaxTree unit;\n\t\t\n\t\tPixbuf comment = new Pixbuf (typeof (MainWindow).Assembly, \"comment.png\");\n\t\tPixbuf classPixbuf = new Pixbuf (typeof (MainWindow).Assembly, \"class.png\");\n\t\tPixbuf tokenPixbuf = new Pixbuf (typeof (MainWindow).Assembly, \"token.png\");\n\t\tPixbuf statementPixbuf = new Pixbuf (typeof (MainWindow).Assembly, \"statement.png\");\n\t\tPixbuf expressionPixbuf = new Pixbuf (typeof (MainWindow).Assembly, \"expression.png\");\n\t\tPixbuf namespacePixbuf = new Pixbuf (typeof (MainWindow).Assembly, \"namespace.png\");\n\t\t\n\t\tpublic MainWindow () : \n\t\t\t\tbase(Gtk.WindowType.Toplevel)\n\t\t{\n\t\t\tthis.Build ();\n\t\t\tthis.BorderWidth = 12;\n\t\t\tthis.treeviewNodes.Model = store;\n\t\t\tvar col =new TreeViewColumn ();\n\t\t\tcol.Title =\"Node\";\n\t\t\tvar pb = new CellRendererPixbuf ();\n\t\t\tcol.PackStart (pb, false);\n\t\t\tcol.AddAttribute (pb, \"pixbuf\", 3);\n\t\t\t\n\t\t\tvar text = new CellRendererText ();\n\t\t\tcol.PackStart (text, true);\n\t\t\tcol.AddAttribute (text, \"text\", 0);\n\t\t\t\n\t\t\tthis.treeviewNodes.AppendColumn (col);\n\t\t\tthis.treeviewNodes.AppendColumn (\"ResolveResult\", new CellRendererText (), \"text\", 1);\n\t\t\tthis.treeviewNodes.Selection.Changed += SelectionChanged;\n//\t\t\tthis.treeviewNodes.HeadersVisible = false;\n\t\t\tthis.textview1.ModifyFont (Pango.FontDescription.FromString (\"Mono 14\"));\n\t\t\tthis.textview1.MoveCursor += HandleMoveCursor;\n\t\t\tstring path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), \"CSharpDemo.cs\");\n\t\t\tthis.textview1.Buffer.Text = File.ReadAllText (path);\n\t\t\tbuttonParse.Clicked += HandleClicked;\n\t\t\tbuttonGenerate.Clicked += CSharpGenerateCodeButtonClick;\n\t\t\tHandleClicked (this, EventArgs.Empty);\n\t\t}\n\t\tprotected override void OnDestroyed ()\n\t\t{\n\t\t\tbase.OnDestroyed ();\n\t\t\tApplication.Quit ();\n\t\t}\n\t\t\n\t\tvoid HandleMoveCursor (object o, MoveCursorArgs args)\n\t\t{\n\t\t\tint cp = textview1.Buffer.CursorPosition;\n\t\t\tvar textIter = textview1.Buffer.GetIterAtOffset (cp);\n\t\t\tvar node = unit.GetNodeAt (textIter.Line + 1, textIter.LineOffset + 1);\n\t\t\tif (node == null)\n\t\t\t\treturn;\n\t\t\tTreeIter iter;\n\t\t\tif (!iterDict.TryGetValue (node, out iter))\n\t\t\t\treturn;\n\t\t\tthis.treeviewNodes.Selection.Changed -= SelectionChanged;\n\t\t\ttreeviewNodes.Selection.SelectIter (iter);\n\t\t\t\n\t\t\ttreeviewNodes.ScrollToCell (store.GetPath (iter), null, true, 0, 0);\n\t\t\tthis.treeviewNodes.Selection.Changed += SelectionChanged;\n\t\t}\n\n\t\tvoid CSharpGenerateCodeButtonClick(object sender, EventArgs e)\n\t\t{\n\t\t\tthis.textview1.Buffer.Text = unit.ToString();\n\t\t}\n\t\t\n\t\tvoid SelectionChanged (object sender, EventArgs e)\n\t\t{\n\t\t\tTreeIter iter;\n\t\t\t\n\t\t\tif (!this.treeviewNodes.Selection.GetSelected (out iter))\n\t\t\t\treturn;\n\t\t\tvar node = store.GetValue (iter, 2) as AstNode;\n\t\t\tif (node == null)\n\t\t\t\treturn;\n\t\t\tthis.textview1.MoveCursor -= HandleMoveCursor;\n\t\t\tif (node.StartLocation.IsEmpty || node.EndLocation.IsEmpty)\n\t\t\t\treturn;\n\t\t\tvar textIter = this.textview1.Buffer.GetIterAtLineOffset (node.StartLocation.Line - 1, node.StartLocation.Column - 1);\n\t\t\tthis.textview1.ScrollToIter (textIter, 0, false, 0, 0);\n\t\t\tthis.textview1.Buffer.PlaceCursor (textIter);\n\t\t\tthis.textview1.Buffer.SelectRange (textIter, this.textview1.Buffer.GetIterAtLineOffset (node.EndLocation.Line -1, node.EndLocation.Column - 1));\n\t\t\tthis.textview1.MoveCursor += HandleMoveCursor;\n\t\t}\n\n\n\t\tpublic void ShowUnit (SyntaxTree unit, CSharpAstResolver visitor)\n\t\t{\n\t\t\tthis.unit = unit;\n\t\t\tstore.Clear ();\n\t\t\titerDict.Clear ();\n\t\t\tif (unit == null)\n\t\t\t\treturn;\n\t\t\tvar iter = store.AppendValues (GetNodeTitle (unit), \"\", unit, GetIcon (unit));\n\t\t\tAddChildren (unit, visitor, iter);\n\t\t\ttreeviewNodes.ExpandAll ();\n\t\t}\n\n\t\tpublic Pixbuf GetIcon (AstNode child)\n\t\t{\n\t\t\tif (child is Comment)\n\t\t\t\treturn comment;\n\t\t\tif (child is PreProcessorDirective)\n\t\t\t\treturn comment;\n\t\t\tif (child is EntityDeclaration)\n\t\t\t\treturn classPixbuf;\n\t\t\tif (child is CSharpTokenNode)\n\t\t\t\treturn tokenPixbuf;\n\t\t\tif (child is Identifier)\n\t\t\t\treturn tokenPixbuf;\n\t\t\tif (child is Statement)\n\t\t\t\treturn statementPixbuf;\n\t\t\tif (child is Expression)\n\t\t\t\treturn expressionPixbuf;\n\t\t\tif (child is UsingDeclaration)\n\t\t\t\treturn namespacePixbuf;\n\t\t\tif (child is NamespaceDeclaration)\n\t\t\t\treturn namespacePixbuf;\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic void AddChildren (AstNode node, CSharpAstResolver visitor, TreeIter iter)\n\t\t{\n\t\t\tif (node == null)\n\t\t\t\treturn;\n\t\t\titerDict [node] = iter;\n\t\t\tforeach (var child in node.Children) {\n\t\t\t\tResolveResult result = null;\n\t\t\t\ttry {\n\t\t\t\t\tif (child is Expression)\n\t\t\t\t\t\tresult = visitor.Resolve (child, CancellationToken.None);\n\t\t\t\t} catch (Exception){\n\t\t\t\t\tresult = null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar childIter = store.AppendValues (iter, GetNodeTitle (child), result != null ? result.ToString () : \"\", child, GetIcon (child));\n\t\t\t\tAddChildren (child, visitor, childIter);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstring GetNodeTitle(AstNode node)\n\t\t{\n\t\t\tvar b = new StringBuilder();\n\t\t\tb.Append(node.Role.ToString());\n\t\t\tb.Append(\": \");\n\t\t\tb.Append(node.GetType().Name);\n\t\t\tbool hasProperties = false;\n\t\t\tforeach (PropertyInfo p in node.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {\n\t\t\t\tif (p.Name == \"NodeType\" || p.Name == \"IsNull\")\n\t\t\t\t\tcontinue;\n\t\t\t\tif (p.PropertyType == typeof(string) || p.PropertyType.IsEnum || p.PropertyType == typeof(bool)) {\n\t\t\t\t\tif (!hasProperties) {\n\t\t\t\t\t\thasProperties = true;\n\t\t\t\t\t\tb.Append(\" (\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tb.Append(\", \");\n\t\t\t\t\t}\n\t\t\t\t\tb.Append(p.Name);\n\t\t\t\t\tb.Append(\" = \");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tobject val = p.GetValue(node, null);\n\t\t\t\t\t\tb.Append(val != null ? val.ToString() : \"**null**\");\n\t\t\t\t\t} catch (TargetInvocationException ex) {\n\t\t\t\t\t\tb.Append(\"**\" + ex.InnerException.GetType().Name + \"**\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasProperties)\n\t\t\t\tb.Append(\")\");\n\t\t\tb.Append (node.StartLocation + \"-\" + node.EndLocation);\n//\t\t\tb.Append(\" Start \" + node.StartLocation);\n//\t\t\tb.Append(\" End \" + node.EndLocation);\n\t\t\treturn b.ToString();\n\t\t}\n\t\t\n\t\tvoid HandleClicked (object sender, EventArgs e)\n\t\t{\n\t\t\tvar parser = new CSharpParser ();\n\t\t\tvar unit = parser.Parse (textview1.Buffer.Text, \"dummy.cs\");\n\t\t\t\n\t\t\tvar unresolvedFile = unit.ToTypeSystem();\n\t\t\t\n\t\t\tIProjectContent project = new CSharpProjectContent ();\n\t\t\tproject = project.AddOrUpdateFiles (unresolvedFile);\n\t\t\tproject = project.AddAssemblyReferences (builtInLibs.Value);\n\t\t\t\n\t\t\t\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(project.CreateCompilation (), unit, unresolvedFile);\n\t\t\tShowUnit (unit, resolver);\n\t\t\t\n\t\t}\n\t\t\n\t\tLazy<IList<IUnresolvedAssembly>> builtInLibs = new Lazy<IList<IUnresolvedAssembly>>(\n\t\t\tdelegate {\n\t\t\t\tAssembly[] assemblies =  new Assembly[] {\n\t\t\t\t\ttypeof(object).Assembly, // mscorlib\n\t\t\t\t\ttypeof(Uri).Assembly, // System.dll\n\t\t\t\t\ttypeof(System.Linq.Enumerable).Assembly, // System.Core.dll\n//\t\t\t\t\ttypeof(System.Xml.XmlDocument).Assembly, // System.Xml.dll\n//\t\t\t\t\ttypeof(System.Drawing.Bitmap).Assembly, // System.Drawing.dll\n//\t\t\t\t\ttypeof(Form).Assembly, // System.Windows.Forms.dll\n\t\t\t\t\ttypeof(ICSharpCode.NRefactory.TypeSystem.IProjectContent).Assembly,\n\t\t\t\t};\n\t\t\t\tIUnresolvedAssembly[] projectContents = new IUnresolvedAssembly[assemblies.Length];\n\t\t\t\tParallel.For(\n\t\t\t\t\t0, assemblies.Length,\n\t\t\t\t\tdelegate (int i) {\n//\t\t\t\t\t\tStopwatch w = Stopwatch.StartNew();\n\t\t\t\t\t\tAssemblyLoader loader = AssemblyLoader.Create();\n\t\t\t\t\t\tprojectContents[i] = loader.LoadAssemblyFile(assemblies[i].Location);\n\t\t\t\t\t});\n\t\t\t\treturn projectContents;\n\t\t\t});\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/gtk-gui/ICSharpCode.NRefactory.GtkDemo.MainWindow.cs",
    "content": "\n// This file has been generated by the GUI designer. Do not modify.\nnamespace ICSharpCode.NRefactory.GtkDemo\n{\n\tpublic partial class MainWindow\n\t{\n\t\tprivate global::Gtk.VBox vbox1;\n\t\t\n\t\tprivate global::Gtk.ScrolledWindow scrolledwindow1;\n\t\t\n\t\tprivate global::Gtk.TextView textview1;\n\t\t\n\t\tprivate global::Gtk.HBox hbox1;\n\t\t\n\t\tprivate global::Gtk.Button buttonParse;\n\t\t\n\t\tprivate global::Gtk.Button buttonGenerate;\n\t\t\n\t\tprivate global::Gtk.ScrolledWindow GtkScrolledWindow1;\n\t\t\n\t\tprivate global::Gtk.TreeView treeviewNodes;\n\t\t\n\t\tprotected virtual void Build ()\n\t\t{\n\t\t\tglobal::Stetic.Gui.Initialize (this);\n\t\t\t// Widget ICSharpCode.NRefactory.GtkDemo.MainWindow\n\t\t\tthis.Name = \"ICSharpCode.NRefactory.GtkDemo.MainWindow\";\n\t\t\tthis.Title = global::Mono.Unix.Catalog.GetString (\"MainWindow\");\n\t\t\tthis.WindowPosition = ((global::Gtk.WindowPosition)(4));\n\t\t\t// Container child ICSharpCode.NRefactory.GtkDemo.MainWindow.Gtk.Container+ContainerChild\n\t\t\tthis.vbox1 = new global::Gtk.VBox ();\n\t\t\tthis.vbox1.Name = \"vbox1\";\n\t\t\tthis.vbox1.Spacing = 6;\n\t\t\t// Container child vbox1.Gtk.Box+BoxChild\n\t\t\tthis.scrolledwindow1 = new global::Gtk.ScrolledWindow ();\n\t\t\tthis.scrolledwindow1.CanFocus = true;\n\t\t\tthis.scrolledwindow1.Name = \"scrolledwindow1\";\n\t\t\tthis.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));\n\t\t\t// Container child scrolledwindow1.Gtk.Container+ContainerChild\n\t\t\tthis.textview1 = new global::Gtk.TextView ();\n\t\t\tthis.textview1.CanFocus = true;\n\t\t\tthis.textview1.Name = \"textview1\";\n\t\t\tthis.scrolledwindow1.Add (this.textview1);\n\t\t\tthis.vbox1.Add (this.scrolledwindow1);\n\t\t\tglobal::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.scrolledwindow1]));\n\t\t\tw2.Position = 0;\n\t\t\t// Container child vbox1.Gtk.Box+BoxChild\n\t\t\tthis.hbox1 = new global::Gtk.HBox ();\n\t\t\tthis.hbox1.Name = \"hbox1\";\n\t\t\tthis.hbox1.Spacing = 6;\n\t\t\t// Container child hbox1.Gtk.Box+BoxChild\n\t\t\tthis.buttonParse = new global::Gtk.Button ();\n\t\t\tthis.buttonParse.CanFocus = true;\n\t\t\tthis.buttonParse.Name = \"buttonParse\";\n\t\t\tthis.buttonParse.UseUnderline = true;\n\t\t\tthis.buttonParse.Label = global::Mono.Unix.Catalog.GetString (\"Parse\");\n\t\t\tthis.hbox1.Add (this.buttonParse);\n\t\t\tglobal::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonParse]));\n\t\t\tw3.Position = 0;\n\t\t\tw3.Expand = false;\n\t\t\tw3.Fill = false;\n\t\t\t// Container child hbox1.Gtk.Box+BoxChild\n\t\t\tthis.buttonGenerate = new global::Gtk.Button ();\n\t\t\tthis.buttonGenerate.CanFocus = true;\n\t\t\tthis.buttonGenerate.Name = \"buttonGenerate\";\n\t\t\tthis.buttonGenerate.UseUnderline = true;\n\t\t\tthis.buttonGenerate.Label = global::Mono.Unix.Catalog.GetString (\"Generate\");\n\t\t\tthis.hbox1.Add (this.buttonGenerate);\n\t\t\tglobal::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonGenerate]));\n\t\t\tw4.Position = 1;\n\t\t\tw4.Expand = false;\n\t\t\tw4.Fill = false;\n\t\t\tthis.vbox1.Add (this.hbox1);\n\t\t\tglobal::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));\n\t\t\tw5.Position = 1;\n\t\t\tw5.Expand = false;\n\t\t\tw5.Fill = false;\n\t\t\t// Container child vbox1.Gtk.Box+BoxChild\n\t\t\tthis.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();\n\t\t\tthis.GtkScrolledWindow1.Name = \"GtkScrolledWindow1\";\n\t\t\tthis.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));\n\t\t\t// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild\n\t\t\tthis.treeviewNodes = new global::Gtk.TreeView ();\n\t\t\tthis.treeviewNodes.CanFocus = true;\n\t\t\tthis.treeviewNodes.Name = \"treeviewNodes\";\n\t\t\tthis.GtkScrolledWindow1.Add (this.treeviewNodes);\n\t\t\tthis.vbox1.Add (this.GtkScrolledWindow1);\n\t\t\tglobal::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkScrolledWindow1]));\n\t\t\tw7.Position = 2;\n\t\t\tthis.Add (this.vbox1);\n\t\t\tif ((this.Child != null)) {\n\t\t\t\tthis.Child.ShowAll ();\n\t\t\t}\n\t\t\tthis.DefaultWidth = 400;\n\t\t\tthis.DefaultHeight = 300;\n\t\t\tthis.Show ();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/gtk-gui/generated.cs",
    "content": "\n// This file has been generated by the GUI designer. Do not modify.\nnamespace Stetic\n{\n\tinternal class Gui\n\t{\n\t\tprivate static bool initialized;\n\t\t\n\t\tinternal static void Initialize (Gtk.Widget iconRenderer)\n\t\t{\n\t\t\tif ((Stetic.Gui.initialized == false)) {\n\t\t\t\tStetic.Gui.initialized = true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tinternal class ActionGroups\n\t{\n\t\tpublic static Gtk.ActionGroup GetActionGroup (System.Type type)\n\t\t{\n\t\t\treturn Stetic.ActionGroups.GetActionGroup (type.FullName);\n\t\t}\n\t\t\n\t\tpublic static Gtk.ActionGroup GetActionGroup (string name)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.GtkDemo/gtk-gui/gui.stetic",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<stetic-interface>\n  <configuration>\n    <images-root-path>../../ICSharpCode.NRefactory.GtkDemo</images-root-path>\n    <target-gtk-version>2.12</target-gtk-version>\n  </configuration>\n  <import>\n    <widget-library name=\"glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f\" />\n    <widget-library name=\"../bin/Debug/ICSharpCode.NRefactory.GtkDemo.exe\" internal=\"true\" />\n  </import>\n  <widget class=\"Gtk.Window\" id=\"ICSharpCode.NRefactory.GtkDemo.MainWindow\" design-size=\"400 300\">\n    <property name=\"MemberName\" />\n    <property name=\"Title\" translatable=\"yes\">MainWindow</property>\n    <property name=\"WindowPosition\">CenterOnParent</property>\n    <child>\n      <widget class=\"Gtk.VBox\" id=\"vbox1\">\n        <property name=\"MemberName\" />\n        <property name=\"Spacing\">6</property>\n        <child>\n          <widget class=\"Gtk.ScrolledWindow\" id=\"scrolledwindow1\">\n            <property name=\"MemberName\" />\n            <property name=\"CanFocus\">True</property>\n            <property name=\"ShadowType\">In</property>\n            <child>\n              <widget class=\"Gtk.TextView\" id=\"textview1\">\n                <property name=\"MemberName\" />\n                <property name=\"CanFocus\">True</property>\n                <property name=\"Text\" translatable=\"yes\" />\n              </widget>\n            </child>\n          </widget>\n          <packing>\n            <property name=\"Position\">0</property>\n            <property name=\"AutoSize\">True</property>\n          </packing>\n        </child>\n        <child>\n          <widget class=\"Gtk.HBox\" id=\"hbox1\">\n            <property name=\"MemberName\" />\n            <property name=\"Spacing\">6</property>\n            <child>\n              <widget class=\"Gtk.Button\" id=\"buttonParse\">\n                <property name=\"MemberName\" />\n                <property name=\"CanFocus\">True</property>\n                <property name=\"Type\">TextOnly</property>\n                <property name=\"Label\" translatable=\"yes\">Parse</property>\n                <property name=\"UseUnderline\">True</property>\n              </widget>\n              <packing>\n                <property name=\"Position\">0</property>\n                <property name=\"AutoSize\">True</property>\n                <property name=\"Expand\">False</property>\n                <property name=\"Fill\">False</property>\n              </packing>\n            </child>\n            <child>\n              <widget class=\"Gtk.Button\" id=\"buttonGenerate\">\n                <property name=\"MemberName\" />\n                <property name=\"CanFocus\">True</property>\n                <property name=\"Type\">TextOnly</property>\n                <property name=\"Label\" translatable=\"yes\">Generate</property>\n                <property name=\"UseUnderline\">True</property>\n              </widget>\n              <packing>\n                <property name=\"Position\">1</property>\n                <property name=\"AutoSize\">True</property>\n                <property name=\"Expand\">False</property>\n                <property name=\"Fill\">False</property>\n              </packing>\n            </child>\n            <child>\n              <placeholder />\n            </child>\n          </widget>\n          <packing>\n            <property name=\"Position\">1</property>\n            <property name=\"AutoSize\">True</property>\n            <property name=\"Expand\">False</property>\n            <property name=\"Fill\">False</property>\n          </packing>\n        </child>\n        <child>\n          <widget class=\"Gtk.ScrolledWindow\" id=\"GtkScrolledWindow1\">\n            <property name=\"MemberName\" />\n            <property name=\"ShadowType\">In</property>\n            <child>\n              <widget class=\"Gtk.TreeView\" id=\"treeviewNodes\">\n                <property name=\"MemberName\" />\n                <property name=\"CanFocus\">True</property>\n                <property name=\"ShowScrollbars\">True</property>\n              </widget>\n            </child>\n          </widget>\n          <packing>\n            <property name=\"Position\">2</property>\n            <property name=\"AutoSize\">True</property>\n          </packing>\n        </child>\n      </widget>\n    </child>\n  </widget>\n</stetic-interface>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/ICSharpCode.NRefactory.IKVM.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <ProjectGuid>{A727169F-D94F-443F-B305-B057D7F3B420}</ProjectGuid>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.IKVM</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.IKVM</AssemblyName>\r\n    <SignAssembly>true</SignAssembly>\r\n    <AssemblyOriginatorKeyFile>..\\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n\t<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n\t<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n\t<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n\t<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"IkvmLoader.cs\" />\r\n    <Compile Include=\"StringConstantValue.cs\" />\r\n    <Compile Include=\"IntConstantValue.cs\" />\r\n    <Compile Include=\"StructConstantValue.cs\" />\r\n    <Compile Include=\"ShortConstantValue.cs\" />\r\n    <Compile Include=\"NonFrozenInterningProvider.cs\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\..\\ikvm\\reflect\\IKVM.Reflection.csproj\">\r\n      <Project>{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}</Project>\r\n      <Name>IKVM.Reflection</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/IkvmLoader.cs",
    "content": "﻿//\n// IkvmLoader.cs\n//\n// Author:\n//       Daniel Grunwald <daniel@danielgrunwald.de>\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\nusing IKVM.Reflection;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Allows loading an IProjectContent from an already compiled assembly.\n\t/// </summary>\n\t/// <remarks>Instance methods are not thread-safe; you need to create multiple instances of CecilLoader\n\t/// if you want to load multiple project contents in parallel.</remarks>\n\tpublic sealed class IkvmLoader : AssemblyLoader\n\t{\n\t\t/// <summary>\n\t\t/// Version number of the ikvm loader.\n\t\t/// Should be incremented when fixing bugs in the ikvm loader so that project contents cached on disk\n\t\t/// (which might be incorrect due to the bug) are re-created.\n\t\t/// </summary>\n\t\tconst int ikvmLoaderVersion = 1;\n\n\t\t#region Options\n\t\t// Most options are defined in the AssemblyLoader base class\n\t\t\n\t\t/// <summary>\n\t\t/// This delegate gets executed whenever an entity was loaded.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// This callback may be to build a dictionary that maps between\n\t\t/// entities and cecil objects.\n\t\t/// Warning: if delay-loading is used and the type system is accessed by multiple threads,\n\t\t/// the callback may be invoked concurrently on multiple threads.\n\t\t/// </remarks>\n\t\tpublic Action<IUnresolvedEntity, MemberInfo> OnEntityLoaded { get; set; }\n\t\t#endregion\n\n\t\t/// <summary>\n\t\t/// Initializes a new instance of the <see cref=\"ICSharpCode.NRefactory.TypeSystem.IkvmLoader\"/> class.\n\t\t/// </summary>\n\t\tpublic IkvmLoader()\n\t\t{\n\t\t\tinterningProvider = new NonFrozenInterningProvider ();\n\t\t}\n\n\t\t#region Load Assembly From Disk\n\n\t\tpublic override IUnresolvedAssembly LoadAssemblyFile(string fileName)\n\t\t{\n\t\t\tif (fileName == null)\n\t\t\t\tthrow new ArgumentNullException(\"fileName\");\n\n\t\t\tusing (var universe = new Universe (UniverseOptions.DisablePseudoCustomAttributeRetrieval | UniverseOptions.SupressReferenceTypeIdentityConversion | UniverseOptions.ResolveMissingMembers)) {\n\t\t\t\tuniverse.AssemblyResolve += delegate(object sender, IKVM.Reflection.ResolveEventArgs args) {\n\t\t\t\t\treturn universe.CreateMissingAssembly(args.Name);\n\t\t\t\t};\n\n\t\t\t\treturn LoadAssembly (universe.LoadFile (fileName));\n\t\t\t}\n\t\t}\n\n\t\tpublic IUnresolvedAssembly LoadAssemblyFile(string fileName, Stream stream)\n\t\t{\n\t\t\tif (fileName == null)\n\t\t\t\tthrow new ArgumentNullException(\"fileName\");\n\n\t\t\tusing (var universe = new Universe (UniverseOptions.DisablePseudoCustomAttributeRetrieval | UniverseOptions.SupressReferenceTypeIdentityConversion)) {\n\t\t\t\tuniverse.AssemblyResolve += delegate(object sender, IKVM.Reflection.ResolveEventArgs args) {\n\t\t\t\t\treturn universe.CreateMissingAssembly(args.Name);\n\t\t\t\t};\n\t\t\t\tusing (RawModule module = universe.OpenRawModule (stream, fileName)) {\n\t\t\t\t\treturn LoadAssembly (universe.LoadAssembly (module));\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tIkvmUnresolvedAssembly currentAssembly;\n\t\tAssembly currentAssemblyDefinition;\n\n\t\t/// <summary>\n\t\t/// Loads the assembly definition into a project content.\n\t\t/// </summary>\n\t\t/// <returns>Unresolved type system representing the assembly</returns>\n\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedAssembly LoadAssembly(Assembly assembly)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tthrow new ArgumentNullException (\"assembly\");\n\n\t\t\tcurrentAssemblyDefinition = assembly;\n\t\t\tcurrentAssembly = new IkvmUnresolvedAssembly (assembly.FullName, DocumentationProvider);\n\n\t\t\t// Read assembly and module attributes\n\t\t\tIList<IUnresolvedAttribute> assemblyAttributes = new List<IUnresolvedAttribute>();\n\t\t\tIList<IUnresolvedAttribute> moduleAttributes = new List<IUnresolvedAttribute>();\n\t\t\tAddAttributes(assembly, assemblyAttributes);\n\t\t\tAddAttributes(assembly.ManifestModule, moduleAttributes);\n\n\t\t\tassemblyAttributes = interningProvider.InternList(assemblyAttributes);\n\t\t\tmoduleAttributes = interningProvider.InternList(moduleAttributes);\n\n\t\t\tcurrentAssembly.Location = assembly.Location;\n\t\t\tcurrentAssembly.AssemblyAttributes.AddRange(assemblyAttributes);\n\t\t\tcurrentAssembly.ModuleAttributes.AddRange(moduleAttributes);\n\t\t\t// Register type forwarders:\n\t\t\tforeach (var type in assembly.ManifestModule.__GetExportedTypes ()) {\n\t\t\t\tif (type.Assembly != assembly) {\n\t\t\t\t\tint typeParameterCount;\n\t\t\t\t\tstring ns = type.Namespace ?? \"\";\n\t\t\t\t\tstring name = ReflectionHelper.SplitTypeParameterCountFromReflectionName(type.Name, out typeParameterCount);\n\t\t\t\t\tns = interningProvider.Intern(ns);\n\t\t\t\t\tname = interningProvider.Intern(name);\n\t\t\t\t\tvar typeRef = new GetClassTypeReference(GetAssemblyReference(type.Assembly), ns, name, typeParameterCount);\n\t\t\t\t\ttypeRef = interningProvider.Intern(typeRef);\n\t\t\t\t\tvar key = new TopLevelTypeName(ns, name, typeParameterCount);\n\t\t\t\t\tcurrentAssembly.AddTypeForwarder(key, typeRef);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Create and register all types:\n\t\t\tvar ikvmTypeDefs = new List<IKVM.Reflection.Type>();\n\t\t\tvar typeDefs = new List<DefaultUnresolvedTypeDefinition>();\n\n\t\t\tforeach (var td in assembly.GetTypes ()) {\n\t\t\t\tif (td.DeclaringType != null)\n\t\t\t\t\tcontinue;\n\t\t\t\tCancellationToken.ThrowIfCancellationRequested();\n\n\t\t\t\tif (IncludeInternalMembers || td.IsPublic) {\n\t\t\t\t\tstring name = td.Name;\n\t\t\t\t\tif (name.Length == 0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar t = CreateTopLevelTypeDefinition(td);\n\t\t\t\t\tikvmTypeDefs.Add(td);\n\t\t\t\t\ttypeDefs.Add(t);\n\t\t\t\t\tcurrentAssembly.AddTypeDefinition(t);\n\t\t\t\t\t// The registration will happen after the members are initialized\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Initialize the type's members:\n\t\t\tfor (int i = 0; i < typeDefs.Count; i++) {\n\t\t\t\tInitTypeDefinition(ikvmTypeDefs[i], typeDefs[i]);\n\t\t\t}\n\n\t\t\t// Freezing the assembly here is important:\n\t\t\t// otherwise it will be frozen when a compilation is first created\n\t\t\t// from it. But freezing has the effect of changing some collection instances\n\t\t\t// (to ReadOnlyCollection). This hidden mutation was causing a crash\n\t\t\t// when the FastSerializer was saving the assembly at the same time as\n\t\t\t// the first compilation was created from it.\n\t\t\t// By freezing the assembly now, we ensure it is usable on multiple\n\t\t\t// threads without issues.\n\t\t\tcurrentAssembly.Freeze();\n\n\t\t\tvar result = currentAssembly;\n\t\t\tcurrentAssembly = null;\n\t\t\treturn result;\n\t\t}\n\n\t\t#region IUnresolvedAssembly implementation\n\t\t[Serializable, FastSerializerVersion(ikvmLoaderVersion)]\n\t\tsealed class IkvmUnresolvedAssembly : DefaultUnresolvedAssembly, IDocumentationProvider\n\t\t{\n\t\t\treadonly IDocumentationProvider documentationProvider;\n\n\t\t\tpublic IkvmUnresolvedAssembly(string fullAssemblyName, IDocumentationProvider documentationProvider)\n\t\t\t\t: base(fullAssemblyName)\n\t\t\t{\n\t\t\t\tthis.documentationProvider = documentationProvider;\n\t\t\t}\n\n\t\t\tDocumentationComment IDocumentationProvider.GetDocumentation(IEntity entity)\n\t\t\t{\n\t\t\t\tif (documentationProvider != null)\n\t\t\t\t\treturn documentationProvider.GetDocumentation (entity);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Read Type Reference\n\t\t/// <summary>\n\t\t/// Reads a type reference.\n\t\t/// </summary>\n\t\t/// <param name=\"type\">The Cecil type reference that should be converted into\n\t\t/// a type system type reference.</param>\n\t\t/// <param name=\"typeAttributes\">Attributes associated with the Cecil type reference.\n\t\t/// This is used to support the 'dynamic' type.</param>\n\t\t[CLSCompliant(false)]\n\t\tpublic ITypeReference ReadTypeReference(IKVM.Reflection.Type type, IEnumerable<CustomAttributeData> typeAttributes = null)\n\t\t{\n\t\t\tint typeIndex = 0;\n\t\t\treturn CreateTypeReference(type, typeAttributes, ref typeIndex);\n\t\t}\n\n\t\tITypeReference CreateTypeReference(IKVM.Reflection.Type type, IEnumerable<CustomAttributeData> typeAttributes, ref int typeIndex)\n\t\t{\n\t\t\t// TODO:\n\t\t\t//\t\t\twhile (type is OptionalModifierType || type is RequiredModifierType) {\n\t\t\t//\t\t\t\ttype = ((TypeSpecification)type).ElementType;\n\t\t\t//\t\t\t}\n\n\t\t\tif (type == null) {\n\t\t\t\treturn SpecialType.UnknownType;\n\t\t\t}\n\t\t\tif (type.IsByRef) {\n\t\t\t\ttypeIndex++;\n\t\t\t\treturn interningProvider.Intern (\n\t\t\t\t\tnew ByReferenceTypeReference (\n\t\t\t\t\t\tCreateTypeReference (type.GetElementType (),typeAttributes, ref typeIndex))\n\t\t\t\t\t);\n\t\t\t}\n\t\t\tif (type.IsPointer) {\n\t\t\t\ttypeIndex++;\n\t\t\t\treturn interningProvider.Intern (\n\t\t\t\t\tnew PointerTypeReference (\n\t\t\t\t\t\tCreateTypeReference (type.GetElementType (), typeAttributes, ref typeIndex))\n\t\t\t\t\t);\n\t\t\t}\n\t\t\tif (type.IsArray) {\n\t\t\t\ttypeIndex++;\n\t\t\t\treturn interningProvider.Intern (\n\t\t\t\t\tnew ArrayTypeReference (\n\t\t\t\t\t\tCreateTypeReference (type.GetElementType (), typeAttributes, ref typeIndex),\n\t\t\t\t\t\ttype.GetArrayRank ()\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (type.IsConstructedGenericType) {\n\t\t\t\tITypeReference baseType = CreateTypeReference (type.GetGenericTypeDefinition (), typeAttributes, ref typeIndex);\n\t\t\t\tvar args = type.GetGenericArguments ();\n\t\t\t\tvar para = new ITypeReference[args.Length];\n\t\t\t\tfor (int i = 0; i < para.Length; ++i) {\n\t\t\t\t\ttypeIndex++;\n\t\t\t\t\tpara [i] = CreateTypeReference (args [i], typeAttributes, ref typeIndex);\n\t\t\t\t}\n\t\t\t\treturn interningProvider.Intern (new ParameterizedTypeReference (baseType, para));\n\t\t\t}\n\t\t\tif (type.IsGenericParameter) {\n\t\t\t\treturn TypeParameterReference.Create (type.DeclaringMethod != null ? SymbolKind.Method : SymbolKind.TypeDefinition, type.GenericParameterPosition);\n\t\t\t}\n\t\t\tif (type.IsNested) {\n\t\t\t\tITypeReference typeRef = CreateTypeReference (type.DeclaringType, typeAttributes, ref typeIndex);\n\t\t\t\tint partTypeParameterCount;\n\t\t\t\tstring namepart = ReflectionHelper.SplitTypeParameterCountFromReflectionName (type.Name, out partTypeParameterCount);\n\t\t\t\tnamepart = interningProvider.Intern (namepart);\n\t\t\t\treturn interningProvider.Intern (new NestedTypeReference (typeRef, namepart, partTypeParameterCount));\n\t\t\t}\n\n\t\t\tstring ns = interningProvider.Intern (type.Namespace ?? string.Empty);\n\t\t\tstring name = type.Name;\n\t\t\tif (name == null)\n\t\t\t\tthrow new InvalidOperationException (\"type.Name returned null. Type: \" + type);\n\n\t\t\tif (name == \"Object\" && ns == \"System\" && HasDynamicAttribute (typeAttributes, typeIndex)) {\n\t\t\t\treturn SpecialType.Dynamic;\n\t\t\t}\n\t\t\tint typeParameterCount;\n\t\t\tname = ReflectionHelper.SplitTypeParameterCountFromReflectionName (name, out typeParameterCount);\n\t\t\tname = interningProvider.Intern (name);\n\t\t\tif (currentAssembly != null) {\n\t\t\t\tvar c = currentAssembly.GetTypeDefinition (ns, name, typeParameterCount);\n\t\t\t\tif (c != null)\n\t\t\t\t\treturn c;\n\t\t\t}\n\t\t\treturn interningProvider.Intern (new GetClassTypeReference (GetAssemblyReference (type.Assembly), ns, name, typeParameterCount));\n\t\t}\n\n\t\tIAssemblyReference GetAssemblyReference(Assembly scope)\n\t\t{\n\t\t\tif (scope == null || scope == currentAssemblyDefinition)\n\t\t\t\treturn DefaultAssemblyReference.CurrentAssembly;\n\t\t\treturn interningProvider.Intern (new DefaultAssemblyReference (scope.FullName));\n\t\t}\n\n\t\tstatic bool HasDynamicAttribute(IEnumerable<CustomAttributeData> attributeProvider, int typeIndex)\n\t\t{\n\t\t\tif (attributeProvider == null)\n\t\t\t\treturn false;\n\t\t\tforeach (var a in attributeProvider) {\n\t\t\t\tvar declaringType = a.Constructor.DeclaringType;\n\t\t\t\tif (declaringType.__Name == \"DynamicAttribute\" && declaringType.__Namespace == \"System.Runtime.CompilerServices\") {\n\t\t\t\t\tif (a.ConstructorArguments.Count == 1) {\n\t\t\t\t\t\tvar values = a.ConstructorArguments[0].Value as CustomAttributeTypedArgument[];\n\t\t\t\t\t\tif (values != null && typeIndex < values.Length && values[typeIndex].Value is bool) {\n\t\t\t\t\t\t\treturn (bool)values [typeIndex].Value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\n\t\t#region Read Attributes\n\t\t#region Assembly Attributes\n\t\tstatic readonly ITypeReference assemblyVersionAttributeTypeRef = typeof(System.Reflection.AssemblyVersionAttribute).ToTypeReference();\n\n\t\tvoid AddAttributes(Assembly assembly, IList<IUnresolvedAttribute> outputList)\n\t\t{\n\t\t\tAddCustomAttributes(assembly.CustomAttributes, outputList);\n\t\t\tAddSecurityAttributes(CustomAttributeData.__GetDeclarativeSecurity (assembly), outputList);\n\n\t\t\t// AssemblyVersionAttribute\n\t\t\tif (assembly.GetName ().Version != null) {\n\t\t\t\tvar assemblyVersion = new DefaultUnresolvedAttribute(assemblyVersionAttributeTypeRef, new[] { KnownTypeReference.String });\n\t\t\t\tassemblyVersion.PositionalArguments.Add(CreateSimpleConstantValue(assembly.GetName ().Version.ToString()));\n\t\t\t\toutputList.Add(interningProvider.Intern(assemblyVersion));\n\t\t\t}\n\t\t}\n\n\t\tIConstantValue CreateSimpleConstantValue(string value)\n\t\t{\n\t\t\treturn interningProvider.Intern(new StringConstantValue(value));\n\t\t}\n\n\t\tIConstantValue CreateSimpleConstantValue(int value)\n\t\t{\n\t\t\treturn interningProvider.Intern(new IntConstantValue(value));\n\t\t}\n\n\t\tIConstantValue CreateSimpleConstantValue(short value)\n\t\t{\n\t\t\treturn interningProvider.Intern(new ShortConstantValue(value));\n\t\t}\t\t\n\n\t\tIConstantValue CreateSimpleConstantValue<T>(ITypeReference type, T value) where T : struct\n\t\t{\n\t\t\treturn interningProvider.Intern(new StructConstantValue<T>(type, value));\n\t\t}\n\n\t\tIConstantValue CreateSimpleConstantValue<T>(ITypeReference type, T? value) where T : struct\n\t\t{\n\t\t\treturn interningProvider.Intern(new SimpleConstantValue(type, value));\n\t\t}\n\n\t\tIConstantValue CreateSimpleConstantValue(ITypeReference type, object value)\n\t\t{\n\t\t\tif (ReferenceEquals(value, Missing.Value))\n\t\t\t\treturn CreateSimpleConstantValue(type, null);\n\t\t\treturn interningProvider.Intern(new SimpleConstantValue(type, interningProvider.InternValue(value)));\n\t\t}\t\t\n\t\t#endregion\n\n\t\t#region Module Attributes\n\t\tvoid AddAttributes(Module module, IList<IUnresolvedAttribute> outputList)\n\t\t{\n\t\t\tAddCustomAttributes(module.CustomAttributes, outputList);\n\t\t}\n\t\t#endregion\n\n\t\t#region Parameter Attributes\n\t\tstatic readonly IUnresolvedAttribute inAttribute = new DefaultUnresolvedAttribute(typeof(InAttribute).ToTypeReference());\n\t\tstatic readonly IUnresolvedAttribute outAttribute = new DefaultUnresolvedAttribute(typeof(OutAttribute).ToTypeReference());\n\n\t\tvoid AddAttributes(ParameterInfo parameter, DefaultUnresolvedParameter targetParameter, IEnumerable<CustomAttributeData> customAttributes)\n\t\t{\n\t\t\tif (!targetParameter.IsOut) {\n\t\t\t\tif (parameter.IsIn)\n\t\t\t\t\ttargetParameter.Attributes.Add(inAttribute);\n\t\t\t\tif (parameter.IsOut)\n\t\t\t\t\ttargetParameter.Attributes.Add(outAttribute);\n\t\t\t}\n\t\t\tAddCustomAttributes(customAttributes, targetParameter.Attributes);\n\n\t\t\tFieldMarshal marshalInfo;\n\t\t\tif (parameter.__TryGetFieldMarshal (out marshalInfo)) {\n\t\t\t\ttargetParameter.Attributes.Add(ConvertMarshalInfo(marshalInfo));\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Method Attributes\n\t\tstatic readonly ITypeReference dllImportAttributeTypeRef = typeof(DllImportAttribute).ToTypeReference();\n\t\tstatic readonly SimpleConstantValue trueValue = new SimpleConstantValue(KnownTypeReference.Boolean, true);\n\t\tstatic readonly SimpleConstantValue falseValue = new SimpleConstantValue(KnownTypeReference.Boolean, false);\n\t\tstatic readonly ITypeReference callingConventionTypeRef = typeof(CallingConvention).ToTypeReference();\n\t\tstatic readonly IUnresolvedAttribute preserveSigAttribute = new DefaultUnresolvedAttribute(typeof(PreserveSigAttribute).ToTypeReference());\n\t\tstatic readonly ITypeReference methodImplAttributeTypeRef = typeof(MethodImplAttribute).ToTypeReference();\n\t\tstatic readonly ITypeReference methodImplOptionsTypeRef = typeof(MethodImplOptions).ToTypeReference();\n\n\t\tstatic bool HasAnyAttributes(MethodInfo methodDefinition)\n\t\t{\n\t\t\tif ((methodDefinition.Attributes & MethodAttributes.PinvokeImpl) != 0)\n\t\t\t\treturn true;\n\n\t\t\tif ((methodDefinition.MethodImplementationFlags & MethodImplAttributes.CodeTypeMask) != 0)\n\t\t\t\treturn true;\n\t\t\tif ((methodDefinition.ReturnParameter.Attributes & ParameterAttributes.HasFieldMarshal) != 0)\n\t\t\t\treturn true;\n\t\t\treturn methodDefinition.CustomAttributes.Any () || methodDefinition.ReturnParameter.CustomAttributes.Any ();\n\t\t}\n\n\t\tstatic bool HasAnyAttributes(ConstructorInfo methodDefinition)\n\t\t{\n\t\t\tif ((methodDefinition.Attributes & MethodAttributes.PinvokeImpl) != 0)\n\t\t\t\treturn true;\n\n\t\t\tif ((methodDefinition.MethodImplementationFlags & MethodImplAttributes.CodeTypeMask) != 0)\n\t\t\t\treturn true;\n\t\t\treturn methodDefinition.CustomAttributes.Any ();\n\t\t}\n\n\t\tvoid AddAttributes(MethodInfo methodDefinition, IList<IUnresolvedAttribute> attributes, ICollection<IUnresolvedAttribute> returnTypeAttributes)\n\t\t{\n\t\t\tvar implAttributes = methodDefinition.MethodImplementationFlags;\n\n\t\t\t#region DllImportAttribute\n\t\t\tif ((methodDefinition.Attributes & MethodAttributes.PinvokeImpl) != 0) {\n\n\t\t\t\tImplMapFlags flags;\n\t\t\t\tstring importName;\n\t\t\t\tstring importScope;\n\t\t\t\tif (methodDefinition.__TryGetImplMap(out flags, out importName, out importScope)) {\n\t\t\t\t\tvar dllImport = new DefaultUnresolvedAttribute(dllImportAttributeTypeRef, new[] { KnownTypeReference.String });\n\t\t\t\t\tdllImport.PositionalArguments.Add(CreateSimpleConstantValue(importScope));\n\n\t\t\t\t\t\n\t\t\t\t\tif ((flags & ImplMapFlags.BestFitOff) != 0)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"BestFitMapping\", falseValue);\n\t\t\t\t\tif ((flags & ImplMapFlags.BestFitOn) != 0)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"BestFitMapping\", trueValue);\n\n\t\t\t\t\tCallingConvention callingConvention;\n\t\t\t\t\tswitch (flags & ImplMapFlags.CallConvMask) {\n\t\t\t\t\t\tcase (ImplMapFlags)0:\n\t\t\t\t\t\t\tDebug.WriteLine (\"P/Invoke calling convention not set on:\" + methodDefinition.Name);\n\t\t\t\t\t\t\tcallingConvention = 0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ImplMapFlags.CallConvCdecl:\n\t\t\t\t\t\t\tcallingConvention = CallingConvention.Cdecl;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ImplMapFlags.CallConvFastcall:\n\t\t\t\t\t\t\tcallingConvention = CallingConvention.FastCall;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ImplMapFlags.CallConvStdcall:\n\t\t\t\t\t\t\tcallingConvention = CallingConvention.StdCall;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ImplMapFlags.CallConvThiscall:\n\t\t\t\t\t\t\tcallingConvention = CallingConvention.ThisCall;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ImplMapFlags.CallConvWinapi:\n\t\t\t\t\t\t\tcallingConvention = CallingConvention.Winapi;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new NotSupportedException(\"unknown calling convention\");\n\t\t\t\t\t}\n\t\t\t\t\tif (callingConvention != CallingConvention.Winapi)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"CallingConvention\", CreateSimpleConstantValue(callingConventionTypeRef, (int)callingConvention));\n\n\t\t\t\t\tCharSet charSet = CharSet.None;\n\t\t\t\t\tswitch (flags & ImplMapFlags.CharSetMask) {\n\t\t\t\t\t\tcase ImplMapFlags.CharSetAnsi:\n\t\t\t\t\t\t\tcharSet = CharSet.Ansi;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ImplMapFlags.CharSetAuto:\n\t\t\t\t\t\t\tcharSet = CharSet.Auto;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase ImplMapFlags.CharSetUnicode:\n\t\t\t\t\t\t\tcharSet = CharSet.Unicode;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (charSet != CharSet.None)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"CharSet\", CreateSimpleConstantValue(charSetTypeRef, (int)charSet));\n\n\t\t\t\t\tif (!string.IsNullOrEmpty(importName) && importName != methodDefinition.Name)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"EntryPoint\", CreateSimpleConstantValue(importName));\n\n\t\t\t\t\tif ((flags & ImplMapFlags.NoMangle) != 0)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"ExactSpelling\", trueValue);\n\n\t\t\t\t\tif ((implAttributes & MethodImplAttributes.PreserveSig) == MethodImplAttributes.PreserveSig)\n\t\t\t\t\t\timplAttributes &= ~MethodImplAttributes.PreserveSig;\n\t\t\t\t\telse\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"PreserveSig\", falseValue);\n\n\t\t\t\t\tif ((flags & ImplMapFlags.SupportsLastError) != 0)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"SetLastError\", trueValue);\n\n\t\t\t\t\tif ((flags & ImplMapFlags.CharMapErrorOff) != 0)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"ThrowOnUnmappableChar\", falseValue);\n\t\t\t\t\tif ((flags & ImplMapFlags.CharMapErrorOn) != 0)\n\t\t\t\t\t\tdllImport.AddNamedFieldArgument(\"ThrowOnUnmappableChar\", trueValue);\n\n\t\t\t\t\tattributes.Add(interningProvider.Intern(dllImport));\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region PreserveSigAttribute\n\t\t\tif (implAttributes == MethodImplAttributes.PreserveSig) {\n\t\t\t\tattributes.Add(preserveSigAttribute);\n\t\t\t\timplAttributes = (MethodImplAttributes)0;\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region MethodImplAttribute\n\t\t\tif (implAttributes != MethodImplAttributes.IL) {\n\t\t\t\tvar methodImpl = new DefaultUnresolvedAttribute(methodImplAttributeTypeRef, new[] { methodImplOptionsTypeRef });\n\t\t\t\tmethodImpl.PositionalArguments.Add(CreateSimpleConstantValue(methodImplOptionsTypeRef, (int)implAttributes));\n\t\t\t\tattributes.Add(interningProvider.Intern(methodImpl));\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\tvar customAttributes = methodDefinition.CustomAttributes;\n\t\t\tAddCustomAttributes (customAttributes, attributes);\n\n\t\t\tif ((methodDefinition.Attributes & MethodAttributes.HasSecurity) != 0) {\n\t\t\t\tAddSecurityAttributes(CustomAttributeData.__GetDeclarativeSecurity (methodDefinition), attributes);\n\t\t\t}\n\n\t\t\tFieldMarshal marshalInfo;\n\t\t\tif (methodDefinition.ReturnParameter.__TryGetFieldMarshal (out marshalInfo)) {\n\t\t\t\treturnTypeAttributes.Add(ConvertMarshalInfo(marshalInfo));\n\t\t\t}\n\n\t\t\tAddCustomAttributes(methodDefinition.ReturnParameter.CustomAttributes, returnTypeAttributes);\n\t\t}\n\n\t\tvoid AddAttributes(ConstructorInfo methodDefinition, IList<IUnresolvedAttribute> attributes, IList<IUnresolvedAttribute> returnTypeAttributes)\n\t\t{\n\t\t\tvar implAttributes = methodDefinition.MethodImplementationFlags;\n\n\t\t\t#region PreserveSigAttribute\n\t\t\tif (implAttributes == MethodImplAttributes.PreserveSig) {\n\t\t\t\tattributes.Add(preserveSigAttribute);\n\t\t\t\timplAttributes = 0;\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region MethodImplAttribute\n\t\t\tif (implAttributes != MethodImplAttributes.IL) {\n\t\t\t\tvar methodImpl = new DefaultUnresolvedAttribute(methodImplAttributeTypeRef, new[] { methodImplOptionsTypeRef });\n\t\t\t\tmethodImpl.PositionalArguments.Add(CreateSimpleConstantValue(methodImplOptionsTypeRef, (int)implAttributes));\n\t\t\t\tattributes.Add(interningProvider.Intern(methodImpl));\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\tAddCustomAttributes(methodDefinition.CustomAttributes, attributes);\n\n\t\t\tif ((methodDefinition.Attributes & MethodAttributes.HasSecurity) != 0) {\n\t\t\t\tAddSecurityAttributes(CustomAttributeData.__GetDeclarativeSecurity (methodDefinition), attributes);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Type Attributes\n\t\tstatic readonly DefaultUnresolvedAttribute serializableAttribute = new DefaultUnresolvedAttribute(typeof(SerializableAttribute).ToTypeReference());\n\t\tstatic readonly DefaultUnresolvedAttribute comImportAttribute = new DefaultUnresolvedAttribute(typeof(ComImportAttribute).ToTypeReference());\n\t\tstatic readonly ITypeReference structLayoutAttributeTypeRef = typeof(StructLayoutAttribute).ToTypeReference();\n\t\tstatic readonly ITypeReference layoutKindTypeRef = typeof(LayoutKind).ToTypeReference();\n\t\tstatic readonly ITypeReference charSetTypeRef = typeof(CharSet).ToTypeReference();\n\n\t\tvoid AddAttributes(IKVM.Reflection.Type typeDefinition, IUnresolvedTypeDefinition targetEntity)\n\t\t{\n\t\t\t// SerializableAttribute\n\t\t\tif (typeDefinition.IsSerializable)\n\t\t\t\ttargetEntity.Attributes.Add(serializableAttribute);\n\n\t\t\t// ComImportAttribute\n\t\t\tif (typeDefinition.IsImport)\n\t\t\t\ttargetEntity.Attributes.Add(comImportAttribute);\n\n\t\t\t#region StructLayoutAttribute\n\t\t\tLayoutKind layoutKind = LayoutKind.Auto;\n\t\t\tswitch (typeDefinition.Attributes & TypeAttributes.LayoutMask) {\n\t\t\t\tcase TypeAttributes.SequentialLayout:\n\t\t\t\tlayoutKind = LayoutKind.Sequential;\n\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.ExplicitLayout:\n\t\t\t\tlayoutKind = LayoutKind.Explicit;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tCharSet charSet = CharSet.None;\n\t\t\tswitch (typeDefinition.Attributes & TypeAttributes.StringFormatMask) {\n\t\t\t\tcase TypeAttributes.AnsiClass:\n\t\t\t\tcharSet = CharSet.Ansi;\n\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.AutoClass:\n\t\t\t\tcharSet = CharSet.Auto;\n\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.UnicodeClass:\n\t\t\t\tcharSet = CharSet.Unicode;\n\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t\tint packingSize;\n\t\t\tint typeSize;\n\t\t\tif (typeDefinition.__GetLayout (out packingSize, out typeSize)) {\n\t\t\t\tLayoutKind defaultLayoutKind = (typeDefinition.IsValueType && !typeDefinition.IsEnum) ? LayoutKind.Sequential: LayoutKind.Auto;\n\t\t\t\tif (layoutKind != defaultLayoutKind || charSet != CharSet.Ansi || packingSize > 0 || typeSize > 0) {\n\t\t\t\t\tvar structLayout = new DefaultUnresolvedAttribute(structLayoutAttributeTypeRef, new[] { layoutKindTypeRef });\n\t\t\t\t\tstructLayout.PositionalArguments.Add(CreateSimpleConstantValue(layoutKindTypeRef, (int)layoutKind));\n\t\t\t\t\tif (charSet != CharSet.Ansi) {\n\t\t\t\t\t\tstructLayout.AddNamedFieldArgument(\"CharSet\", CreateSimpleConstantValue(charSetTypeRef, (int)charSet));\n\t\t\t\t\t}\n\t\t\t\t\tif (packingSize > 0) {\n\t\t\t\t\t\tstructLayout.AddNamedFieldArgument(\"Pack\", CreateSimpleConstantValue(packingSize));\n\t\t\t\t\t}\n\t\t\t\t\tif (typeSize > 0) {\n\t\t\t\t\t\tstructLayout.AddNamedFieldArgument(\"Size\", CreateSimpleConstantValue(typeSize));\n\t\t\t\t\t}\n\t\t\t\t\ttargetEntity.Attributes.Add(interningProvider.Intern(structLayout));\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\tAddCustomAttributes(typeDefinition.CustomAttributes, targetEntity.Attributes);\n\n\t\t\tif ((typeDefinition.Attributes & TypeAttributes.HasSecurity) != 0) {\n\t\t\t\tAddSecurityAttributes(CustomAttributeData.__GetDeclarativeSecurity(typeDefinition), targetEntity.Attributes);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Field Attributes\n\t\tstatic readonly ITypeReference fieldOffsetAttributeTypeRef = typeof(FieldOffsetAttribute).ToTypeReference();\n\t\tstatic readonly IUnresolvedAttribute nonSerializedAttribute = new DefaultUnresolvedAttribute(typeof(NonSerializedAttribute).ToTypeReference());\n\n\t\tvoid AddAttributes(FieldInfo fieldDefinition, IUnresolvedEntity targetEntity)\n\t\t{\n\t\t\t// FieldOffsetAttribute\n\t\t\tint fOffset;\n\t\t\tif (fieldDefinition.__TryGetFieldOffset(out fOffset)) {\n\t\t\t\tvar fieldOffset = new DefaultUnresolvedAttribute(fieldOffsetAttributeTypeRef, new[] { KnownTypeReference.Int32 });\n\t\t\t\tfieldOffset.PositionalArguments.Add(CreateSimpleConstantValue(fOffset));\n\t\t\t\ttargetEntity.Attributes.Add(interningProvider.Intern(fieldOffset));\n\t\t\t}\n\n\t\t\t// NonSerializedAttribute\n\t\t\tif (fieldDefinition.IsNotSerialized) {\n\t\t\t\ttargetEntity.Attributes.Add(nonSerializedAttribute);\n\t\t\t}\n\t\t\tFieldMarshal marshal;\n\t\t\tif (fieldDefinition.__TryGetFieldMarshal (out marshal))\n\t\t\t\ttargetEntity.Attributes.Add(ConvertMarshalInfo(marshal));\n\n\t\t\tAddCustomAttributes(fieldDefinition.CustomAttributes, targetEntity.Attributes);\n\t\t}\n\t\t#endregion\n\n\t\t#region Event Attributes\n\t\tvoid AddAttributes(EventInfo eventDefinition, IUnresolvedEntity targetEntity)\n\t\t{\n\t\t\tAddCustomAttributes(eventDefinition.CustomAttributes, targetEntity.Attributes);\n\t\t}\n\t\t#endregion\n\n\t\t#region Property Attributes\n\t\tvoid AddAttributes(PropertyInfo propertyDefinition, IUnresolvedEntity targetEntity)\n\t\t{\n\t\t\tAddCustomAttributes(propertyDefinition.CustomAttributes, targetEntity.Attributes);\n\t\t}\n\t\t#endregion\n\n\t\t#region MarshalAsAttribute (ConvertMarshalInfo)\n\t\tstatic readonly ITypeReference marshalAsAttributeTypeRef = typeof(MarshalAsAttribute).ToTypeReference();\n\t\tstatic readonly ITypeReference unmanagedTypeTypeRef = typeof(UnmanagedType).ToTypeReference();\n\n\n\t\tIUnresolvedAttribute ConvertMarshalInfo(FieldMarshal marshalInfo)\n\t\t{\n\t\t\tDefaultUnresolvedAttribute attr = new DefaultUnresolvedAttribute(marshalAsAttributeTypeRef, new[] { unmanagedTypeTypeRef });\n\t\t\tattr.PositionalArguments.Add(CreateSimpleConstantValue(unmanagedTypeTypeRef, (int)marshalInfo.UnmanagedType));\n\n\n\t\t\tif (marshalInfo.UnmanagedType ==UnmanagedType.ByValArray) {\n\t\t\t\tattr.AddNamedFieldArgument(\"SizeConst\", CreateSimpleConstantValue((int)marshalInfo.SizeConst));\n\t\t\t\tif (marshalInfo.ArraySubType.HasValue)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"ArraySubType\", CreateSimpleConstantValue(unmanagedTypeTypeRef, (int)marshalInfo.ArraySubType.Value));\n\t\t\t}\n\n\t\t\tif (marshalInfo.UnmanagedType == UnmanagedType.SafeArray && marshalInfo.SafeArraySubType.HasValue) {\n\t\t\t\tattr.AddNamedFieldArgument(\"SafeArraySubType\", CreateSimpleConstantValue(typeof(VarEnum).ToTypeReference(), (int)marshalInfo.SafeArraySubType));\n\t\t\t}\n\n\t\t\tif (marshalInfo.UnmanagedType == UnmanagedType.LPArray) {\n\t\t\t\tif (marshalInfo.ArraySubType != null)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"ArraySubType\", CreateSimpleConstantValue(unmanagedTypeTypeRef, (int)marshalInfo.ArraySubType));\n\t\t\t\tif (marshalInfo.SizeConst >= 0)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"SizeConst\", CreateSimpleConstantValue((int)marshalInfo.SizeConst));\n\t\t\t\tif (marshalInfo.SizeParamIndex >= 0)\n\t\t\t\t\tattr.AddNamedFieldArgument(\"SizeParamIndex\", CreateSimpleConstantValue((short)marshalInfo.SizeParamIndex));\n\t\t\t}\n\n\t\t\tif (marshalInfo.UnmanagedType == UnmanagedType.CustomMarshaler) {\n\t\t\t\tattr.AddNamedFieldArgument(\"MarshalType\", CreateSimpleConstantValue(marshalInfo.MarshalType));\n\t\t\t\tif (!string.IsNullOrEmpty(marshalInfo.MarshalCookie))\n\t\t\t\t\tattr.AddNamedFieldArgument(\"MarshalCookie\", CreateSimpleConstantValue(marshalInfo.MarshalCookie));\n\t\t\t}\n\n\t\t\tif (marshalInfo.UnmanagedType == UnmanagedType.ByValTStr) {\n\t\t\t\tattr.AddNamedFieldArgument(\"SizeConst\", CreateSimpleConstantValue((int)marshalInfo.SizeConst));\n\t\t\t}\n\n\t\t\treturn InterningProvider.Intern(attr);\n\t\t}\n\t\t#endregion\n\n\t\t#region Custom Attributes (ReadAttribute)\n\t\tvoid AddCustomAttributes(IEnumerable<CustomAttributeData> attributes, ICollection<IUnresolvedAttribute> targetCollection)\n\t\t{\n\t\t\tforeach (var cecilAttribute in attributes) {\n\t\t\t\tvar type = cecilAttribute.Constructor.DeclaringType;\n\t\t\t\tif (type.__Namespace == \"System.Runtime.CompilerServices\") {\n\t\t\t\t\tif (type.__Name == \"DynamicAttribute\" || type.__Name == \"ExtensionAttribute\" || type.__Name == \"DecimalConstantAttribute\")\n\t\t\t\t\t\tcontinue;\n\t\t\t\t} else if (type.__Name == \"ParamArrayAttribute\" && type.__Namespace == \"System\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttargetCollection.Add(ReadAttribute(cecilAttribute));\n\t\t\t}\n\t\t}\n\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedAttribute ReadAttribute(CustomAttributeData attribute)\n\t\t{\n\t\t\tif (attribute == null)\n\t\t\t\tthrow new ArgumentNullException(\"attribute\");\n\t\t\tvar ctor = attribute.Constructor;\n\t\t\tITypeReference attributeType = ReadTypeReference(attribute.AttributeType);\n\t\t\tIList<ITypeReference> ctorParameterTypes = EmptyList<ITypeReference>.Instance;\n\t\t\tvar parameters = ctor.GetParameters ();\n\t\t\tif (parameters.Length > 0) {\n\t\t\t\tctorParameterTypes = new ITypeReference[parameters.Length];\n\t\t\t\tfor (int i = 0; i < ctorParameterTypes.Count; i++) {\n\t\t\t\t\tctorParameterTypes[i] = ReadTypeReference(parameters[i].ParameterType);\n\t\t\t\t}\n\t\t\t\tctorParameterTypes = interningProvider.InternList(ctorParameterTypes);\n\t\t\t}\n\t\t\tbyte[] blob;\n\t\t\ttry {\n\t\t\t\tblob = attribute.__GetBlob ();\n\t\t\t} catch (IKVM.Reflection.MissingMemberException) {\n\t\t\t\tblob = new byte[0];\n\t\t\t} catch (Exception e) {\n\t\t\t\tblob = new byte[0];\n\t\t\t\tConsole.Error.WriteLine (\"IKVM error while getting blob:\" + e);\n\t\t\t}\n\t\t\treturn interningProvider.Intern(new UnresolvedAttributeBlob(attributeType, ctorParameterTypes, blob));\n\t\t}\n\t\t#endregion\n\n\t\t#region Security Attributes\n\t\tstatic readonly ITypeReference securityActionTypeReference = typeof(System.Security.Permissions.SecurityAction).ToTypeReference();\n\t\tstatic readonly ITypeReference permissionSetAttributeTypeReference = typeof(System.Security.Permissions.PermissionSetAttribute).ToTypeReference();\n\n//\t\t/// <summary>\n//\t\t/// Reads a security declaration.\n//\t\t/// </summary>\n//\t\t[CLSCompliant(false)]\n//\t\tpublic IList<IUnresolvedAttribute> ReadSecurityDeclaration(SecurityDeclaration secDecl)\n//\t\t{\n//\t\t\tif (secDecl == null)\n//\t\t\t\tthrow new ArgumentNullException(\"secDecl\");\n//\t\t\tvar result = new List<IUnresolvedAttribute>();\n//\t\t\tAddSecurityAttributes(secDecl, result);\n//\t\t\treturn result;\n//\t\t}\n//\n//\t\tvoid AddSecurityAttributes(Mono.Collections.Generic.Collection<SecurityDeclaration> securityDeclarations, IList<IUnresolvedAttribute> targetCollection)\n//\t\t{\n//\t\t\tforeach (var secDecl in securityDeclarations) {\n//\t\t\t\tAddSecurityAttributes(secDecl, targetCollection);\n//\t\t\t}\n//\t\t}\n\n\t\tvoid AddSecurityAttributes(IEnumerable<CustomAttributeData> securityAttributes, IList<IUnresolvedAttribute> targetCollection)\n\t\t{\n\t\t\tAddCustomAttributes (securityAttributes, targetCollection);\n\t\t}\n\n\t\t#endregion\n\t\t#endregion\n\n\t\t#region Read Type Definition\n\t\tDefaultUnresolvedTypeDefinition CreateTopLevelTypeDefinition(IKVM.Reflection.Type typeDefinition)\n\t\t{\n\t\t\tvar td = new DefaultUnresolvedTypeDefinition(typeDefinition.Namespace ?? \"\", ReflectionHelper.SplitTypeParameterCountFromReflectionName (typeDefinition.Name));\n\t\t\tif (typeDefinition.IsGenericTypeDefinition)\n\t\t\t\tInitTypeParameters(typeDefinition, td.TypeParameters);\n\t\t\treturn td;\n\t\t}\n\n\t\tstatic void InitTypeParameters(IKVM.Reflection.Type typeDefinition, ICollection<IUnresolvedTypeParameter> typeParameters)\n\t\t{\n\t\t\t// Type parameters are initialized within the constructor so that the class can be put into the type storage\n\t\t\t// before the rest of the initialization runs - this allows it to be available for early binding as soon as possible.\n\t\t\tvar genericArguments = typeDefinition.GetGenericArguments ();\n\t\t\tfor (int i = 0; i < genericArguments.Length; i++) {\n\t\t\t\tif (genericArguments[i].GenericParameterPosition != i)\n\t\t\t\t\tthrow new InvalidOperationException(\"g.GenericParameterPosition != i\");\n\t\t\t\ttypeParameters.Add(new DefaultUnresolvedTypeParameter(\n\t\t\t\t\tSymbolKind.TypeDefinition, i, genericArguments [i].Name));\n\t\t\t}\n\t\t}\n\n\t\tvoid InitTypeParameterConstraints(IKVM.Reflection.Type typeDefinition, IList<IUnresolvedTypeParameter> typeParameters)\n\t\t{\n\t\t\tvar args = typeDefinition.GetGenericArguments ();\n\t\t\tfor (int i = 0; i < typeParameters.Count; i++) {\n\t\t\t\tvar tp = (DefaultUnresolvedTypeParameter)typeParameters[i];\n\t\t\t\tAddConstraints(tp, args[i]);\n\t\t\t\ttp.ApplyInterningProvider(interningProvider);\n\t\t\t}\n\t\t}\n\n\t\tvoid InitTypeDefinition(IKVM.Reflection.Type typeDefinition, DefaultUnresolvedTypeDefinition td)\n\t\t{\n\t\t\ttd.Kind = GetTypeKind(typeDefinition);\n\t\t\tInitTypeModifiers(typeDefinition, td);\n\t\t\tInitTypeParameterConstraints(typeDefinition, td.TypeParameters);\n\n\t\t\t// nested types can be initialized only after generic parameters were created\n\t\t\tInitNestedTypes(typeDefinition, td, td.NestedTypes);\n\t\t\tAddAttributes(typeDefinition, td);\n\t\t\ttd.HasExtensionMethods = HasExtensionAttribute(typeDefinition);\n\n\t\t\tInitBaseTypes(typeDefinition, td.BaseTypes);\n\n\t\t\ttd.AddDefaultConstructorIfRequired = (td.Kind == TypeKind.Struct || td.Kind == TypeKind.Enum);\n\t\t\tInitMembers(typeDefinition, td, td.Members);\n\t\t\ttd.ApplyInterningProvider(interningProvider);\n\t\t\tRegisterCecilObject(td, typeDefinition);\n\t\t}\n\n\t\tvoid InitBaseTypes(IKVM.Reflection.Type typeDefinition, ICollection<ITypeReference> baseTypes)\n\t\t{\n\t\t\t// set base classes\n\t\t\tif (typeDefinition.IsEnum) {\n\t\t\t\tforeach (var enumField in typeDefinition.__GetDeclaredFields ()) {\n\t\t\t\t\tif (!enumField.IsStatic) {\n\t\t\t\t\t\tbaseTypes.Add(ReadTypeReference(enumField.FieldType));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (typeDefinition.BaseType != null) {\n\t\t\t\t\tbaseTypes.Add(ReadTypeReference(typeDefinition.BaseType));\n\t\t\t\t}\n\t\t\t\tforeach (var iface in typeDefinition.__GetDeclaredInterfaces ()) {\n\t\t\t\t\tbaseTypes.Add(ReadTypeReference(iface));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid InitNestedTypes(IKVM.Reflection.Type typeDefinition, IUnresolvedTypeDefinition declaringTypeDefinition, ICollection<IUnresolvedTypeDefinition> nestedTypes)\n\t\t{\n\t\t\tforeach (var nestedTypeDef in typeDefinition.__GetDeclaredTypes()) {\n\t\t\t\tif (IncludeInternalMembers\n\t\t\t\t\t|| nestedTypeDef.IsNestedPublic\n\t\t\t\t    || nestedTypeDef.IsNestedFamily\n\t\t\t\t    || nestedTypeDef.IsNestedFamORAssem)\n\t\t\t\t{\n\t\t\t\t\tstring name = nestedTypeDef.Name;\n\t\t\t\t\tint pos = name.LastIndexOf('/');\n\t\t\t\t\tif (pos > 0)\n\t\t\t\t\t\tname = name.Substring(pos + 1);\n\t\t\t\t\tname = ReflectionHelper.SplitTypeParameterCountFromReflectionName(name);\n\t\t\t\t\tvar nestedType = new DefaultUnresolvedTypeDefinition(declaringTypeDefinition, name);\n\t\t\t\t\tInitTypeParameters(nestedTypeDef, nestedType.TypeParameters);\n\t\t\t\t\tnestedTypes.Add(nestedType);\n\t\t\t\t\tInitTypeDefinition(nestedTypeDef, nestedType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic TypeKind GetTypeKind(IKVM.Reflection.Type typeDefinition)\n\t\t{\n\t\t\t// set classtype\n\t\t\tif (typeDefinition.IsInterface)\n\t\t\t\treturn TypeKind.Interface;\n\t\t\tif (typeDefinition.IsEnum)\n\t\t\t\treturn TypeKind.Enum;\n\t\t\tif (typeDefinition.IsValueType)\n\t\t\t\treturn TypeKind.Struct;\n\t\t\tif (IsDelegate (typeDefinition))\n\t\t\t\treturn TypeKind.Delegate;\n\t\t\tif (IsModule (typeDefinition))\n\t\t\t\treturn TypeKind.Module;\n\t\t\treturn TypeKind.Class;\n\t\t}\n\n\t\tstatic void InitTypeModifiers(IKVM.Reflection.Type typeDefinition, AbstractUnresolvedEntity td)\n\t\t{\n\t\t\ttd.IsSealed = typeDefinition.IsSealed;\n\t\t\ttd.IsAbstract = typeDefinition.IsAbstract;\n\t\t\tswitch (typeDefinition.Attributes & TypeAttributes.VisibilityMask) {\n\t\t\t\tcase TypeAttributes.NotPublic:\n\t\t\t\tcase TypeAttributes.NestedAssembly:\n\t\t\t\t\ttd.Accessibility = Accessibility.Internal;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.Public:\n\t\t\t\tcase TypeAttributes.NestedPublic:\n\t\t\t\t\ttd.Accessibility = Accessibility.Public;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedPrivate:\n\t\t\t\t\ttd.Accessibility = Accessibility.Private;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedFamily:\n\t\t\t\t\ttd.Accessibility = Accessibility.Protected;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedFamANDAssem:\n\t\t\t\t\ttd.Accessibility = Accessibility.ProtectedAndInternal;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TypeAttributes.NestedFamORAssem:\n\t\t\t\t\ttd.Accessibility = Accessibility.ProtectedOrInternal;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsDelegate(IKVM.Reflection.Type type)\n\t\t{\n\t\t\tif (type.BaseType != null && type.BaseType.Namespace == \"System\") {\n\t\t\t\tif (type.BaseType.Name == \"MulticastDelegate\")\n\t\t\t\t\treturn true;\n\t\t\t\tif (type.BaseType.Name == \"Delegate\" && type.Name != \"MulticastDelegate\")\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic bool IsModule(IKVM.Reflection.Type type)\n\t\t{\n\t\t\tforeach (var att in type.CustomAttributes) {\n\t\t\t\tvar dt = att.Constructor.DeclaringType;\n\t\t\t\tif (dt.__Name == \"StandardModuleAttribute\" && dt.__Namespace == \"Microsoft.VisualBasic.CompilerServices\" \n\t\t\t\t    || dt.__Name == \"CompilerGlobalScopeAttribute\" && dt.__Namespace == \"System.Runtime.CompilerServices\")\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tvoid InitMembers(IKVM.Reflection.Type typeDefinition, IUnresolvedTypeDefinition td, IList<IUnresolvedMember> members)\n\t\t{\n\t\t\tforeach (var method in typeDefinition.__GetDeclaredMethods ()) {\n\t\t\t\tif (method.IsConstructor) {\n\t\t\t\t\tif (IsVisible(method.Attributes)) {\n\t\t\t\t\t\tSymbolKind type = SymbolKind.Constructor;\n\t\t\t\t\t\tmembers.Add(ReadConstructor(method, td, type));\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (IsVisible(method.Attributes) && !IsAccessor(method)) {\n\t\t\t\t\tSymbolKind type = SymbolKind.Method;\n\t\t\t\t\tif (method.IsSpecialName) {\n\t\t\t\t\t\tif (method.Name.StartsWith(\"op_\", StringComparison.Ordinal))\n\t\t\t\t\t\t\ttype = SymbolKind.Operator;\n\t\t\t\t\t}\n\t\t\t\t\tmembers.Add(ReadMethod(method, td, type));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (var field in typeDefinition.__GetDeclaredFields ()) {\n\t\t\t\tif (IsVisible(field.Attributes) && !field.IsSpecialName) {\n\t\t\t\t\tmembers.Add(ReadField(field, td));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstring defaultMemberName = null;\n\t\t\tvar defaultMemberAttribute = typeDefinition.CustomAttributes.FirstOrDefault(\n\t\t\t\ta => {\n\t\t\t\t\tvar dt = a.Constructor.DeclaringType;\n\t\t\t\t\treturn dt.__Name == \"DefaultMemberAttribute\" && dt.Namespace == \"System.Reflection\";\n\t\t\t\t});\n\t\t\tif (defaultMemberAttribute != null && defaultMemberAttribute.ConstructorArguments.Count == 1) {\n\t\t\t\tdefaultMemberName = defaultMemberAttribute.ConstructorArguments[0].Value as string;\n\t\t\t}\n\n\t\t\tforeach (var property in typeDefinition.__GetDeclaredProperties ()) {\n\t\t\t\tbool getterVisible = property.GetMethod != null && IsVisible(property.GetMethod.Attributes);\n\t\t\t\tbool setterVisible = property.SetMethod != null && IsVisible(property.SetMethod.Attributes);\n\t\t\t\tif (getterVisible || setterVisible) {\n\t\t\t\t\tSymbolKind type = SymbolKind.Property;\n\t\t\t\t\tif (property.GetIndexParameters () != null) {\n\t\t\t\t\t\t// Try to detect indexer:\n\t\t\t\t\t\tif (property.Name == defaultMemberName) {\n\t\t\t\t\t\t\ttype = SymbolKind.Indexer; // normal indexer\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// TODO: HasOverrides ?\n\t\t\t\t\t\telse if (property.Name.EndsWith(\".Item\", StringComparison.Ordinal) /*&& (property.GetMethod ?? property.SetMethod).HasOverrides*/) {\n\t\t\t\t\t\t\t// explicit interface implementation of indexer\n\t\t\t\t\t\t\ttype = SymbolKind.Indexer;\n\t\t\t\t\t\t\t// We can't really tell parameterized properties and indexers apart in this case without\n\t\t\t\t\t\t\t// resolving the interface, so we rely on the \"Item\" naming convention instead.\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmembers.Add(ReadProperty(property, td, type));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach (var ev in typeDefinition.__GetDeclaredEvents ()) {\n\t\t\t\tif (ev.AddMethod != null && IsVisible(ev.AddMethod.Attributes)) {\n\t\t\t\t\tmembers.Add(ReadEvent(ev, td));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsAccessor(MethodBase methodInfo)\n\t\t{\n\t\t\tif (!methodInfo.IsSpecialName)\n\t\t\t\treturn false;\n\n\t\t\tvar name = methodInfo.Name;\n\t\t\treturn \n\t\t\t\tname.StartsWith(\"get_\", StringComparison.Ordinal) ||\n\t\t\t\tname.StartsWith(\"set_\", StringComparison.Ordinal) ||\n\t\t\t\tname.StartsWith(\"add_\", StringComparison.Ordinal) ||\n\t\t\t\tname.StartsWith(\"remove_\", StringComparison.Ordinal) ||\n\t\t\t\tname.StartsWith(\"raise_\", StringComparison.Ordinal);\n\t\t}\n\t\t#endregion\n\n\t\t#region Read Method\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedMethod ReadMethod(MethodBase method, IUnresolvedTypeDefinition parentType, SymbolKind methodType = SymbolKind.Method)\n\t\t{\n\t\t\treturn ReadMethod((MethodInfo)method, parentType, methodType, null);\n\t\t}\n\n\t\tconst MethodAttributes nonBodyAttr = MethodAttributes.Abstract | MethodAttributes.PinvokeImpl;\n\t\tconst MethodImplAttributes nonBodyImplAttr = MethodImplAttributes.InternalCall | MethodImplAttributes.Native | MethodImplAttributes.Unmanaged;\n\n\t\tIUnresolvedMethod ReadMethod(MethodInfo method, IUnresolvedTypeDefinition parentType, SymbolKind methodType, IUnresolvedMember accessorOwner)\n\t\t{\n\t\t\tif (method == null)\n\t\t\t\treturn null;\n\t\t\tvar m = new DefaultUnresolvedMethod(parentType, method.Name);\n\t\t\tm.SymbolKind = methodType;\n\t\t\tm.AccessorOwner = accessorOwner;\n\t\t\tm.HasBody = (method.Attributes & nonBodyAttr) == 0 && (method.GetMethodImplementationFlags () & nonBodyImplAttr) == 0;\n\t\t\tif (method.IsGenericMethodDefinition) {\n\t\t\t\tvar genericArguments = method.GetGenericArguments ();\n\t\t\t\tif (genericArguments != null) {\n\t\t\t\t\tfor (int i = 0; i < genericArguments.Length; i++) {\n\t\t\t\t\t\tif (genericArguments[i].GenericParameterPosition != i)\n\t\t\t\t\t\t\tthrow new InvalidOperationException(\"g.Position != i\");\n\t\t\t\t\t\tm.TypeParameters.Add(new DefaultUnresolvedTypeParameter(\n\t\t\t\t\t\t\tSymbolKind.Method, i, genericArguments[i].Name));\n\t\t\t\t\t}\n\t\t\t\t\tfor (int i = 0; i < genericArguments.Length; i++) {\n\t\t\t\t\t\tvar tp = (DefaultUnresolvedTypeParameter)m.TypeParameters[i];\n\t\t\t\t\t\tAddConstraints(tp, genericArguments[i]);\n\t\t\t\t\t\ttp.ApplyInterningProvider(interningProvider);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tm.ReturnType = ReadTypeReference(method.ReturnType, typeAttributes: method.ReturnParameter.CustomAttributes);\n\t\t\tif (HasAnyAttributes(method))\n\t\t\t\tAddAttributes(method, m.Attributes, m.ReturnTypeAttributes);\n\t\t\tTranslateModifiers(method, m);\n\n\t\t\tforeach (var p in method.GetParameters ()) {\n\t\t\t\tm.Parameters.Add(ReadParameter(p));\n\t\t\t}\n\n\t\t\t// mark as extension method if the attribute is set\n\t\t\tif (method.IsStatic && HasExtensionAttribute(method)) {\n\t\t\t\tm.IsExtensionMethod = true;\n\t\t\t}\n\n\t\t\tint lastDot = method.Name.LastIndexOf('.');\n\t\t\tif (lastDot >= 0 /*&& method.HasOverrides*/) {\n\t\t\t\t// To be consistent with the parser-initialized type system, shorten the method name:\n\t\t\t\tm.Name = method.Name.Substring(lastDot + 1);\n\t\t\t\tm.IsExplicitInterfaceImplementation = true;\n\t\t\t\t\n\t\t\t\tforeach (var or in method.__GetMethodImpls ()) {\n\t\t\t\t\tm.ExplicitInterfaceImplementations.Add(new DefaultMemberReference(\n\t\t\t\t\t\taccessorOwner != null ? SymbolKind.Accessor : SymbolKind.Method,\n\t\t\t\t\t\tReadTypeReference(or.DeclaringType),\n\t\t\t\t\t\tor.Name, or.GetGenericArguments ().Length, m.Parameters.Select(p => p.Type).ToList()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFinishReadMember(m, method);\n\t\t\treturn m;\n\t\t}\n\n\t\tstatic bool HasExtensionAttribute(MemberInfo provider)\n\t\t{\n\t\t\tforeach (var attr in provider.CustomAttributes) {\n\t\t\t\tvar attributeType = attr.Constructor.DeclaringType;\n\t\t\t\tif (attributeType.__Name == \"ExtensionAttribute\" && attributeType.__Namespace == \"System.Runtime.CompilerServices\")\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tbool IsVisible(MethodAttributes att)\n\t\t{\n\t\t\tatt &= MethodAttributes.MemberAccessMask;\n\t\t\treturn IncludeInternalMembers\n\t\t\t\t|| att == MethodAttributes.Public\n\t\t\t\t|| att == MethodAttributes.Family\n\t\t\t\t|| att == MethodAttributes.FamORAssem;\n\t\t}\n\n\t\tstatic Accessibility GetAccessibility(MethodAttributes attr)\n\t\t{\n\t\t\tswitch (attr & MethodAttributes.MemberAccessMask) {\n\t\t\t\tcase MethodAttributes.Public:\n\t\t\t\treturn Accessibility.Public;\n\t\t\t\tcase MethodAttributes.FamANDAssem:\n\t\t\t\treturn Accessibility.ProtectedAndInternal;\n\t\t\t\tcase MethodAttributes.Assembly:\n\t\t\t\treturn Accessibility.Internal;\n\t\t\t\tcase MethodAttributes.Family:\n\t\t\t\treturn Accessibility.Protected;\n\t\t\t\tcase MethodAttributes.FamORAssem:\n\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\t\t\t\tdefault:\n\t\t\t\treturn Accessibility.Private;\n\t\t\t}\n\t\t}\n\n\t\tvoid TranslateModifiers(MethodBase method, AbstractUnresolvedMember m)\n\t\t{\n\t\t\tif (m.DeclaringTypeDefinition.Kind == TypeKind.Interface) {\n\t\t\t\t// interface members don't have modifiers, but we want to handle them as \"public abstract\"\n\t\t\t\tm.Accessibility = Accessibility.Public;\n\t\t\t\tm.IsAbstract = true;\n\t\t\t} else {\n\t\t\t\tm.Accessibility = GetAccessibility(method.Attributes);\n\t\t\t\tif (method.IsAbstract) {\n\t\t\t\t\tm.IsAbstract = true;\n\t\t\t\t\tm.IsOverride = (method.Attributes & MethodAttributes.NewSlot) == 0;\n\t\t\t\t} else if (method.IsFinal) {\n\t\t\t\t\tif ((method.Attributes & MethodAttributes.NewSlot) == 0) {\n\t\t\t\t\t\tm.IsSealed = true;\n\t\t\t\t\t\tm.IsOverride = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (method.IsVirtual) {\n\t\t\t\t\tif ((method.Attributes & MethodAttributes.NewSlot) != 0)\n\t\t\t\t\t\tm.IsVirtual = true;\n\t\t\t\t\telse\n\t\t\t\t\t\tm.IsOverride = true;\n\t\t\t\t}\n\t\t\t\tm.IsStatic = method.IsStatic;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Read Constructor\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedMethod ReadConstructor(MethodBase method, IUnresolvedTypeDefinition parentType, SymbolKind methodType = SymbolKind.Method)\n\t\t{\n\t\t\treturn ReadConstructor((ConstructorInfo)method, parentType, methodType, null);\n\t\t}\n\n\t\tIUnresolvedMethod ReadConstructor(ConstructorInfo method, IUnresolvedTypeDefinition parentType, SymbolKind methodType, IUnresolvedMember accessorOwner)\n\t\t{\n\t\t\tif (method == null)\n\t\t\t\treturn null;\n\t\t\tvar m = new DefaultUnresolvedMethod(parentType, method.Name);\n\t\t\tm.SymbolKind = methodType;\n\t\t\tm.AccessorOwner = accessorOwner;\n\t\t\tm.HasBody = !method.DeclaringType.IsInterface && (method.GetMethodImplementationFlags () & MethodImplAttributes.CodeTypeMask) == MethodImplAttributes.IL;\n\t\t\tvar genericArguments = method.GetGenericArguments ();\n\t\t\tif (genericArguments != null) {\n\t\t\t\tfor (int i = 0; i < genericArguments.Length; i++) {\n\t\t\t\t\tif (genericArguments[i].GenericParameterPosition != i)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"g.Position != i\");\n\t\t\t\t\tm.TypeParameters.Add(new DefaultUnresolvedTypeParameter(\n\t\t\t\t\t\tSymbolKind.Method, i, genericArguments[i].Name));\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < genericArguments.Length; i++) {\n\t\t\t\t\tvar tp = (DefaultUnresolvedTypeParameter)m.TypeParameters[i];\n\t\t\t\t\tAddConstraints(tp, genericArguments[i]);\n\t\t\t\t\ttp.ApplyInterningProvider(interningProvider);\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.ReturnType = KnownTypeReference.Void;\n\n\n\t\t\tif (HasAnyAttributes(method))\n\t\t\t\tAddAttributes(method, m.Attributes, m.ReturnTypeAttributes);\n\t\t\tTranslateModifiers(method, m);\n\n\t\t\tforeach (var p in method.GetParameters ()) {\n\t\t\t\tm.Parameters.Add(ReadParameter(p));\n\t\t\t}\n\n\t\t\tFinishReadMember(m, method);\n\t\t\treturn m;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Read Parameter\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedParameter ReadParameter(ParameterInfo parameter)\n\t\t{\n\t\t\tif (parameter == null)\n\t\t\t\tthrow new ArgumentNullException(\"parameter\");\n\t\t\tvar customAttributes = parameter.CustomAttributes;\n\t\t\tvar parameterType = parameter.ParameterType;\n\t\t\tvar type = ReadTypeReference(parameterType, typeAttributes: customAttributes);\n\t\t\tvar p = new DefaultUnresolvedParameter(type, interningProvider.Intern(parameter.Name ?? \"index\"));\n\n\t\t\tif (parameterType.IsByRef) {\n\t\t\t\tif (!parameter.IsIn && parameter.IsOut)\n\t\t\t\t\tp.IsOut = true;\n\t\t\t\telse\n\t\t\t\t\tp.IsRef = true;\n\t\t\t}\n\t\t\tAddAttributes(parameter, p, customAttributes);\n\n\t\t\tif (parameter.IsOptional) {\n\t\t\t\tp.DefaultValue = CreateSimpleConstantValue(type, parameter.RawDefaultValue);\n\t\t\t}\n\n\t\t\tif (parameterType.IsArray) {\n\t\t\t\tforeach (var att in customAttributes) {\n\t\t\t\t\tvar dt = att.Constructor.DeclaringType;\n\t\t\t\t\tif (dt.__Name == \"ParamArrayAttribute\" && dt.Namespace == \"System\") {\n\t\t\t\t\t\tp.IsParams = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn interningProvider.Intern(p);\n\t\t}\n\t\t#endregion\n\n\t\t#region Read Field\n\t\tbool IsVisible(FieldAttributes att)\n\t\t{\n\t\t\tatt &= FieldAttributes.FieldAccessMask;\n\t\t\treturn IncludeInternalMembers\n\t\t\t\t|| att == FieldAttributes.Public\n\t\t\t\t\t|| att == FieldAttributes.Family\n\t\t\t\t\t|| att == FieldAttributes.FamORAssem;\n\t\t}\n\n\t\tdecimal? TryDecodeDecimalConstantAttribute(CustomAttributeData attribute)\n\t\t{\n\t\t\tif (attribute.ConstructorArguments.Count != 5)\n\t\t\t\treturn null;\n\n\t\t\tvar reader = new BlobReader(attribute.__GetBlob(), null);\n\t\t\tif (reader.ReadUInt16() != 0x0001) {\n\t\t\t\tDebug.WriteLine(\"Unknown blob prolog\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// DecimalConstantAttribute has the arguments (byte scale, byte sign, uint hi, uint mid, uint low) or (byte scale, byte sign, int hi, int mid, int low)\n\t\t\t// Both of these invoke the Decimal constructor (int lo, int mid, int hi, bool isNegative, byte scale) with explicit argument conversions if required.\n\t\t\tvar ctorArgs = new object[attribute.ConstructorArguments.Count];\n\t\t\tfor (int i = 0; i < ctorArgs.Length; i++) {\n\t\t\t\tswitch (attribute.ConstructorArguments[i].ArgumentType.FullName) {\n\t\t\t\t\tcase \"System.Byte\":\n\t\t\t\t\tctorArgs[i] = reader.ReadByte();\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"System.Int32\":\n\t\t\t\t\tctorArgs[i] = reader.ReadInt32();\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"System.UInt32\":\n\t\t\t\t\tctorArgs[i] = unchecked((int)reader.ReadUInt32());\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!ctorArgs.Select(a => a.GetType()).SequenceEqual(new[] { typeof(byte), typeof(byte), typeof(int), typeof(int), typeof(int) }))\n\t\t\t\treturn null;\n\n\t\t\treturn new decimal((int)ctorArgs[4], (int)ctorArgs[3], (int)ctorArgs[2], (byte)ctorArgs[1] != 0, (byte)ctorArgs[0]);\n\t\t}\n\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedField ReadField(FieldInfo field, IUnresolvedTypeDefinition parentType)\n\t\t{\n\t\t\tif (field == null)\n\t\t\t\tthrow new ArgumentNullException(\"field\");\n\t\t\tif (parentType == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentType\");\n\t\t\tvar f = new DefaultUnresolvedField(parentType, field.Name);\n\t\t\tf.Accessibility = GetAccessibility(field.Attributes);\n\t\t\tf.IsReadOnly = field.IsInitOnly;\n\t\t\tf.IsStatic = field.IsStatic;\n\t\t\tf.ReturnType = ReadTypeReference(field.FieldType, typeAttributes: field.CustomAttributes);\n\n\t\t\tif ((field.Attributes & FieldAttributes.HasDefault) != 0) {\n\t\t\t\tf.ConstantValue = CreateSimpleConstantValue(f.ReturnType, field.GetRawConstantValue ());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar decConstant = field.CustomAttributes.FirstOrDefault(a => {\n\t\t\t\t\tvar dt = a.Constructor.DeclaringType;\n\t\t\t\t\treturn dt.__Name == \"DecimalConstantAttribute\" && dt.__Namespace == \"System.Runtime.CompilerServices\";\n\t\t\t\t});\n\t\t\t\tif (decConstant != null) {\n\t\t\t\t\tvar constValue = TryDecodeDecimalConstantAttribute(decConstant);\n\t\t\t\t\tif (constValue != null)\n\t\t\t\t\t\tf.ConstantValue = CreateSimpleConstantValue(f.ReturnType, constValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAddAttributes(field, f);\n\n\t\t\tif (field.GetRequiredCustomModifiers ().Any (mt => mt.FullName == typeof(IsVolatile).FullName)) {\n\t\t\t\tf.IsVolatile = true;\n\t\t\t}\n\n\t\t\tFinishReadMember(f, field);\n\t\t\treturn f;\n\t\t}\n\n\t\tstatic Accessibility GetAccessibility(FieldAttributes attr)\n\t\t{\n\t\t\tswitch (attr & FieldAttributes.FieldAccessMask) {\n\t\t\t\tcase FieldAttributes.Public:\n\t\t\t\t\treturn Accessibility.Public;\n\t\t\t\tcase FieldAttributes.FamANDAssem:\n\t\t\t\t\treturn Accessibility.ProtectedAndInternal;\n\t\t\t\tcase FieldAttributes.Assembly:\n\t\t\t\t\treturn Accessibility.Internal;\n\t\t\t\tcase FieldAttributes.Family:\n\t\t\t\t\treturn Accessibility.Protected;\n\t\t\t\tcase FieldAttributes.FamORAssem:\n\t\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Accessibility.Private;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Type Parameter Constraints\n\t\tvoid AddConstraints(DefaultUnresolvedTypeParameter tp, IKVM.Reflection.Type g)\n\t\t{\n\t\t\tvar attr = g.GenericParameterAttributes;\n\t\t\tif ((attr & GenericParameterAttributes.Contravariant) != 0) {\n\t\t\t\ttp.Variance = VarianceModifier.Contravariant;\n\t\t\t} else if ((attr & GenericParameterAttributes.Covariant) != 0) {\n\t\t\t\ttp.Variance = VarianceModifier.Covariant;\n\t\t\t}\n\n\t\t\ttp.HasReferenceTypeConstraint = (attr & GenericParameterAttributes.ReferenceTypeConstraint) != 0;\n\t\t\ttp.HasValueTypeConstraint = (attr & GenericParameterAttributes.NotNullableValueTypeConstraint) != 0;\n\t\t\ttp.HasDefaultConstructorConstraint = (attr & GenericParameterAttributes.DefaultConstructorConstraint) != 0;\n\n\t\t\tforeach (var constraint in g.GetGenericParameterConstraints ()) {\n\t\t\t\ttp.Constraints.Add(ReadTypeReference(constraint));\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Read Property\n\n\t\tAccessibility MergePropertyAccessibility (Accessibility left, Accessibility right)\n\t\t{\n\t\t\tif (left == Accessibility.Public || right == Accessibility.Public)\n\t\t\t\treturn Accessibility.Public;\n\n\t\t\tif (left == Accessibility.ProtectedOrInternal || right == Accessibility.ProtectedOrInternal)\n\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\n\t\t\tif (left == Accessibility.Protected && right == Accessibility.Internal || \n\t\t\t    left == Accessibility.Internal && right == Accessibility.Protected)\n\t\t\t\treturn Accessibility.ProtectedOrInternal;\n\n\t\t\tif (left == Accessibility.Protected || right == Accessibility.Protected)\n\t\t\t\treturn Accessibility.Protected;\n\n\t\t\tif (left == Accessibility.Internal || right == Accessibility.Internal)\n\t\t\t\treturn Accessibility.Internal;\n\n\t\t\tif (left == Accessibility.ProtectedAndInternal || right == Accessibility.ProtectedAndInternal)\n\t\t\t\treturn Accessibility.ProtectedAndInternal;\n\n\t\t\treturn left;\n\t\t}\n\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedProperty ReadProperty(PropertyInfo property, IUnresolvedTypeDefinition parentType, SymbolKind propertyType = SymbolKind.Property)\n\t\t{\n\t\t\tif (property == null)\n\t\t\t\tthrow new ArgumentNullException(\"property\");\n\t\t\tif (parentType == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentType\");\n\n\t\t\tvar p = new DefaultUnresolvedProperty(parentType, property.Name);\n\t\t\tp.SymbolKind = propertyType;\n\t\t\tTranslateModifiers(property.GetMethod ?? property.SetMethod, p);\n\t\t\tif (property.GetMethod != null && property.SetMethod != null)\n\t\t\t\tp.Accessibility = MergePropertyAccessibility (GetAccessibility (property.GetMethod.Attributes), GetAccessibility (property.SetMethod.Attributes));\n\t\t\tp.ReturnType = ReadTypeReference(property.PropertyType, typeAttributes: property.CustomAttributes);\n\n\t\t\tp.Getter = ReadMethod(property.GetMethod, parentType, SymbolKind.Accessor, p);\n\t\t\tp.Setter = ReadMethod(property.SetMethod, parentType, SymbolKind.Accessor, p);\n\n\t\t\tforeach (var par in property.GetIndexParameters ()) {\n\t\t\t\tp.Parameters.Add(ReadParameter(par));\n\t\t\t}\n\n\t\t\tAddAttributes(property, p);\n\n\t\t\tvar accessor = p.Getter ?? p.Setter;\n\t\t\tif (accessor != null && accessor.IsExplicitInterfaceImplementation) {\n\t\t\t\tp.Name = property.Name.Substring(property.Name.LastIndexOf('.') + 1);\n\t\t\t\tp.IsExplicitInterfaceImplementation = true;\n\t\t\t\tforeach (var mr in accessor.ExplicitInterfaceImplementations) {\n\t\t\t\t\tp.ExplicitInterfaceImplementations.Add(new AccessorOwnerMemberReference(mr));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFinishReadMember(p, property);\n\t\t\treturn p;\n\t\t}\n\t\t#endregion\n\n\t\t#region Read Event\n\t\t[CLSCompliant(false)]\n\t\tpublic IUnresolvedEvent ReadEvent(EventInfo ev, IUnresolvedTypeDefinition parentType)\n\t\t{\n\t\t\tif (ev == null)\n\t\t\t\tthrow new ArgumentNullException(\"ev\");\n\t\t\tif (parentType == null)\n\t\t\t\tthrow new ArgumentNullException(\"parentType\");\n\n\t\t\tDefaultUnresolvedEvent e = new DefaultUnresolvedEvent(parentType, ev.Name);\n\t\t\tTranslateModifiers(ev.AddMethod, e);\n\t\t\te.ReturnType = ReadTypeReference(ev.EventHandlerType, typeAttributes: ev.CustomAttributes);\n\n\t\t\te.AddAccessor    = ReadMethod(ev.AddMethod,    parentType, SymbolKind.Accessor, e);\n\t\t\te.RemoveAccessor = ReadMethod(ev.RemoveMethod, parentType, SymbolKind.Accessor, e);\n\t\t\te.InvokeAccessor = ReadMethod(ev.RaiseMethod, parentType, SymbolKind.Accessor, e);\n\n\t\t\tAddAttributes(ev, e);\n\n\t\t\tvar accessor = e.AddAccessor ?? e.RemoveAccessor ?? e.InvokeAccessor;\n\t\t\tif (accessor != null && accessor.IsExplicitInterfaceImplementation) {\n\t\t\t\te.Name = ev.Name.Substring(ev.Name.LastIndexOf('.') + 1);\n\t\t\t\te.IsExplicitInterfaceImplementation = true;\n\t\t\t\tforeach (var mr in accessor.ExplicitInterfaceImplementations) {\n\t\t\t\t\te.ExplicitInterfaceImplementations.Add(new AccessorOwnerMemberReference(mr));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFinishReadMember(e, ev);\n\n\t\t\treturn e;\n\t\t}\n\t\t#endregion\n\n\t\t#region FinishReadMember / Interning\n\t\tvoid FinishReadMember(AbstractUnresolvedMember member, MemberInfo ikvmDefinition)\n\t\t{\n\t\t\tmember.ApplyInterningProvider(interningProvider);\n\t\t\tRegisterCecilObject(member, ikvmDefinition);\n\t\t}\n\t\t#endregion\n\n\t\t#region Type system translation table\n\t\tvoid RegisterCecilObject(IUnresolvedEntity typeSystemObject, MemberInfo cecilObject)\n\t\t{\n\t\t\tif (OnEntityLoaded != null)\n\t\t\t\tOnEntityLoaded(typeSystemObject, cecilObject);\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/IntConstantValue.cs",
    "content": "//\n// IntConstantValue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory\n{\n\t[Serializable]\n\tsealed class IntConstantValue : IConstantValue, ISupportsInterning \n\t{\n\t\treadonly int value;\n\n\t\tpublic IntConstantValue (int value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ConstantResolveResult(KnownTypeReference.Int32.Resolve (context), value);\n\t\t}\n\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \"CA1308:NormalizeStringsToUppercase\",\n\t\t\tJustification = \"The C# keyword is lower case\")]\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn value.ToString ();\n\t\t}\n\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn value.GetHashCode ();\n\t\t}\n\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tvar scv = other as IntConstantValue;\n\t\t\treturn scv != null && value == scv.value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/NonFrozenInterningProvider.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\n\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.TypeSystem.Implementation\n{\n\tsealed class NonFrozenInterningProvider : InterningProvider\n\t{\n\t\tsealed class InterningComparer : IEqualityComparer<ISupportsInterning>\n\t\t{\n\t\t\tpublic bool Equals(ISupportsInterning x, ISupportsInterning y)\n\t\t\t{\n\t\t\t\treturn x.EqualsForInterning(y);\n\t\t\t}\n\n\t\t\tpublic int GetHashCode(ISupportsInterning obj)\n\t\t\t{\n\t\t\t\treturn obj.GetHashCodeForInterning();\n\t\t\t}\n\t\t}\n\n\t\tsealed class ListComparer : IEqualityComparer<IEnumerable>\n\t\t{\n\t\t\tpublic bool Equals(IEnumerable a, IEnumerable b)\n\t\t\t{\n\t\t\t\tif (a.GetType() != b.GetType())\n\t\t\t\t\treturn false;\n\t\t\t\tIEnumerator e1 = a.GetEnumerator();\n\t\t\t\tIEnumerator e2 = b.GetEnumerator();\n\t\t\t\twhile (e1.MoveNext()) {\n\t\t\t\t\t// e1 has more elements than e2; or elements are different\n\t\t\t\t\tif (!e2.MoveNext() || e1.Current != e2.Current)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (e2.MoveNext()) // e2 has more elements than e1\n\t\t\t\t\treturn false;\n\t\t\t\t// No need to dispose e1/e2: non-generic IEnumerator doesn't implement IDisposable,\n\t\t\t\t// and the underlying enumerator will likely be a List<T>.Enumerator which has an empty Dispose() method.\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic int GetHashCode(IEnumerable obj)\n\t\t\t{\n\t\t\t\tint hashCode = obj.GetType().GetHashCode();\n\t\t\t\tunchecked {\n\t\t\t\t\tforeach (object o in obj) {\n\t\t\t\t\t\thashCode *= 27;\n\t\t\t\t\t\thashCode += RuntimeHelpers.GetHashCode(o);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tDictionary<object, object> byValueDict = new Dictionary<object, object>();\n\t\tDictionary<ISupportsInterning, ISupportsInterning> supportsInternDict = new Dictionary<ISupportsInterning, ISupportsInterning>(new InterningComparer());\n\t\tDictionary<IEnumerable, IEnumerable> listDict = new Dictionary<IEnumerable, IEnumerable>(new ListComparer());\n\n\t\tpublic override ISupportsInterning Intern(ISupportsInterning obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn null;\n\n\t\t\tISupportsInterning output;\n\t\t\tif (supportsInternDict.TryGetValue(obj, out output)) {\n\t\t\t\treturn output;\n\t\t\t} else {\n\t\t\t\tsupportsInternDict.Add(obj, obj);\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Intern(string text)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\treturn null;\n\n\t\t\tobject output;\n\t\t\tif (byValueDict.TryGetValue(text, out output))\n\t\t\t\treturn (string)output;\n\t\t\telse\n\t\t\t\treturn text;\n\t\t}\n\n\t\tpublic override object InternValue(object obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn null;\n\n\t\t\tobject output;\n\t\t\tif (byValueDict.TryGetValue(obj, out output))\n\t\t\t\treturn output;\n\t\t\telse\n\t\t\t\treturn obj;\n\t\t}\n\n\t\tpublic override IList<T> InternList<T>(IList<T> list)\n\t\t{\n\t\t\tif (list == null)\n\t\t\t\treturn null;\n\t\t\tif (list.Count == 0)\n\t\t\t\treturn EmptyList<T>.Instance;\n\t\t\tif (!list.IsReadOnly)\n\t\t\t\tlist = new ReadOnlyCollection<T>(list);\n\t\t\tIEnumerable output;\n\t\t\tif (listDict.TryGetValue(list, out output))\n\t\t\t\tlist = (IList<T>)output;\n\t\t\telse\n\t\t\t\tlistDict.Add(list, list);\n\t\t\treturn list;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/Properties/AssemblyInfo.cs",
    "content": "//\n// AssemblyInfo.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing System;\nusing System.Reflection;\n\n// Information about this assembly is defined by the following attributes. \n// Change them to the values specific to your project.\n\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.IKVM\")]\n[assembly: AssemblyDescription(\"IKVM.Reflection-based Assembly Loader for NRefactory\")]\n\n[assembly: CLSCompliant(true)]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/ShortConstantValue.cs",
    "content": "//\n// ShortConstantValue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory\n{\n\t[Serializable]\n\tsealed class ShortConstantValue : IConstantValue, ISupportsInterning \n\t{\n\t\treadonly short value;\n\n\t\tpublic ShortConstantValue (short value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ConstantResolveResult(KnownTypeReference.Int16.Resolve (context), value);\n\t\t}\n\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \"CA1308:NormalizeStringsToUppercase\",\n\t\t\tJustification = \"The C# keyword is lower case\")]\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn value.ToString ();\n\t\t}\n\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn value.GetHashCode ();\n\t\t}\n\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tvar scv = other as ShortConstantValue;\n\t\t\treturn scv != null && value == scv.value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/StringConstantValue.cs",
    "content": "//\n// StringConstantValue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory\n{\n\t[Serializable]\n\tsealed class StringConstantValue : IConstantValue, ISupportsInterning \n\t{\n\t\treadonly string value;\n\n\t\tpublic StringConstantValue (string value)\n\t\t{\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ConstantResolveResult(KnownTypeReference.String.Resolve (context), value);\n\t\t}\n\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \"CA1308:NormalizeStringsToUppercase\",\n\t\t\tJustification = \"The C# keyword is lower case\")]\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn value;\n\t\t}\n\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn (value ?? \"\").GetHashCode ();\n\t\t}\n\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tvar scv = other as StringConstantValue;\n\t\t\treturn scv != null && value == scv.value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.IKVM/StructConstantValue.cs",
    "content": "//\n// StructConstantValue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory\n{\n\t[Serializable]\n\tsealed class StructConstantValue<T> : IConstantValue, ISupportsInterning where T : struct\n\t{\n\t\treadonly ITypeReference type;\n\t\treadonly T value;\n\n\t\tpublic StructConstantValue(ITypeReference type, T value)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\tthrow new ArgumentNullException(\"type\");\n\t\t\tthis.type = type;\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic ResolveResult Resolve(ITypeResolveContext context)\n\t\t{\n\t\t\treturn new ConstantResolveResult(type.Resolve(context), value);\n\t\t}\n\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Globalization\", \"CA1308:NormalizeStringsToUppercase\",\n\t\t\tJustification = \"The C# keyword is lower case\")]\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (value is bool)\n\t\t\t\treturn value.ToString().ToLowerInvariant();\n\t\t\telse\n\t\t\t\treturn value.ToString();\n\t\t}\n\n\t\tint ISupportsInterning.GetHashCodeForInterning()\n\t\t{\n\t\t\treturn type.GetHashCode() ^ value.GetHashCode ();\n\t\t}\n\n\t\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t\t{\n\t\t\tvar scv = other as StructConstantValue<T>;\n\t\t\treturn scv != null && type == scv.type && Equals (value, scv.value);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Analysis/AbiComparerTests.cs",
    "content": "//\n// AbiComparerTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeCompletion;\n\nnamespace ICSharpCode.NRefactory.Analysis\n{\n\t[TestFixture]\n\tpublic class AbiComparerTests\n\t{\n\t\tAbiCompatibility Check (string before, string after)\n\t\t{\n\t\t\tIProjectContent oldPctx, newPctx;\n\t\t\tSyntaxTree tree;\n\t\t\tICSharpCode.NRefactory.CSharp.TypeSystem.CSharpUnresolvedFile file;\n\t\t\tCodeCompletionBugTests.CreateCompilation (before, out oldPctx, out tree, out file, false);\n\t\t\tCodeCompletionBugTests.CreateCompilation (after, out newPctx, out tree, out file, false);\n\t\t\treturn new AbiComparer ().Check (oldPctx.CreateCompilation (), newPctx.CreateCompilation ());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckEquality()\n\t\t{\n\t\t\tstring a1 = @\"namespace Foo { public class Bar { public void FooBar () {} public int Bar2 { get; set;} int removed; } class Removed {} }\";\n\t\t\tstring a2 = @\"namespace Foo { public class Bar { public void FooBar () {} public int Bar2 { get {} set{}} void Added () {} } class Added {} } namespace Added { class Test { } }\";\n\t\t\tAssert.AreEqual (AbiCompatibility.Equal, Check (a1, a2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckBigger()\n\t\t{\n\t\t\tstring a1 = @\"namespace Foo { public class Bar { public void FooBar () {} } }\";\n\t\t\tstring a2 = @\"namespace Foo { public class Bar { public void FooBar () {} public void BarFoo () {} } }\";\n\t\t\tAssert.AreEqual (AbiCompatibility.Bigger, Check (a1, a2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckIncompatible()\n\t\t{\n\t\t\tstring a1 = @\"namespace Foo { public class Bar { public void FooBar () {} } }\";\n\t\t\tstring a2 = @\"namespace Foo { public class Bar { public void FooBar (int bar) {} } }\";\n\t\t\tAssert.AreEqual (AbiCompatibility.Incompatible, Check (a1, a2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckIncompatibleInterfaceChange()\n\t\t{\n\t\t\tstring a1 = @\"public interface IFoo {}\";\n\t\t\tstring a2 = @\"public interface IFoo { void Bar (); }\";\n\t\t\tAssert.AreEqual (AbiCompatibility.Incompatible, Check (a1, a2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckTypeConstraintChange()\n\t\t{\n\t\t\tstring a1 = @\"public class IFoo<T> {}\";\n\t\t\tstring a2 = @\"public class IFoo<T> where T : System.IDisposable {}\";\n\t\t\tAssert.AreEqual (AbiCompatibility.Incompatible, Check (a1, a2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckTypeConstraintChangeCase2()\n\t\t{\n\t\t\tstring a1 = @\"public class IFoo<T> {}\";\n\t\t\tstring a2 = @\"public class IFoo<T> where T : class {}\";\n\t\t\tAssert.AreEqual (AbiCompatibility.Incompatible, Check (a1, a2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckMethodConstraintChange()\n\t\t{\n\t\t\tstring a1 = @\"public class IFoo { public void Bar<T> () {} }\";\n\t\t\tstring a2 = @\"public class IFoo { public void Bar<T> () where T : System.IDisposable {} }\";\n\t\t\tAssert.AreEqual (AbiCompatibility.Incompatible, Check (a1, a2));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Analysis/SymbolCollectorTests.cs",
    "content": "//\n// SymbolCollectorTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeCompletion;\nusing System.Text;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.Analysis\n{\n\t[TestFixture]\n\tpublic class SymbolCollectorTests\n\t{\n\n\t\tvoid CollectMembers(string code, string memberName, bool includeOverloads = true)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tList<int> offsets = new List<int>();\n\t\t\tforeach (var ch in code) {\n\t\t\t\tif (ch == '$') {\n\t\t\t\t\toffsets.Add(sb.Length);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append(ch);\n\t\t\t}\n\t\t\tvar syntaxTree = SyntaxTree.Parse(sb.ToString (), \"test.cs\");\n\t\t\tvar unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tvar compilation = TypeSystemHelper.CreateCompilation(unresolvedFile);\n\n\t\t\tvar symbol = FindReferencesTest.GetSymbol(compilation, memberName);\n\t\t\tvar col = new SymbolCollector();\n\t\t\tcol.IncludeOverloads = includeOverloads;\n\t\t\tcol.GroupForRenaming = true;\n\n\t\t\tvar result = col.GetRelatedSymbols (new Lazy<TypeGraph>(() => new TypeGraph (compilation.Assemblies)),\n\t\t\t                                   symbol);\n\t\t\tif (offsets.Count != result.Count()) {\n\t\t\t\tforeach (var a in result)\n\t\t\t\t\tConsole.WriteLine(a);\n\t\t\t}\n\t\t\tAssert.AreEqual(offsets.Count, result.Count());\n\t\t\tvar doc = new ReadOnlyDocument(sb.ToString ());\n\t\t\tresult\n\t\t\t\t.Select(r => doc.GetOffset ((r as IEntity).Region.Begin))\n\t\t\t\t.SequenceEqual(offsets);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSingleInterfaceImpl ()\n\t\t{\n\t\t\tvar code = @\"\ninterface IA\n{\n\tvoid $Method();\n}\n\nclass A : IA\n{\n\tpublic virtual void $Method() { };\n}\n\nclass B : A\n{\n\tpublic override void Method() { };\n}\n\nclass C : IA\n{\n\tpublic void $Method() { };\n}\";\n\t\t\tCollectMembers(code, \"IA.Method\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestMultiInterfacesImpl1 ()\n\t\t{\n\t\t\tvar code = @\"\ninterface IA\n{\n\tvoid $Method();\n}\ninterface IB\n{\n\tvoid $Method();\n}\nclass A : IA, IB\n{\n\tpublic void $Method() { }\n}\nclass B : IA\n{\n\tpublic void $Method() { }\n}\nclass C : IB\n{\n\tpublic void $Method() { }\n}\";\n\t\t\tCollectMembers(code, \"A.Method\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestOverloads ()\n\t\t{\n\t\t\tvar code = @\"\nclass A\n{\n\tpublic void $Method () { }\n\tpublic void $Method (int i) { }\n\tpublic void $Method (string i) { }\n}\n\";\n\t\t\tCollectMembers(code, \"A.Method\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tvar code = @\"\nclass $A\n{\n\tpublic $A() { }\n\tpublic $A(int i) { }\n}\n\";\n\t\t\tCollectMembers(code, \"A\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDestructor ()\n\t\t{\n\t\t\tvar code = @\"\nclass $A\n{\n\t$~A() { }\n}\n\";\n\t\t\tCollectMembers(code, \"A\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticConstructor ()\n\t\t{\n\t\t\tvar code = @\"\nclass $A\n{\n\tstatic $A() { }\n\tpublic $A(int i) { }\n}\n\";\n\t\t\tCollectMembers(code, \"A\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestShadowedMember ()\n\t\t{\n\t\t\tvar code = @\"\nclass A\n{\n\tpublic int $Prop\n\t{ get; set; }\n}\nclass B : A\n{\n\tpublic int Prop\n\t{ get; set; }\n}\n\";\n\t\t\tCollectMembers(code, \"A.Prop\");\n\t\t}\n\n\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestShadowedMemberCase2 ()\n\t\t{\n\t\t\tvar code = @\"interface IA \n{\n\tint $Prop { get; set; } \n}\n\nclass A : IA\n{\n\tpublic int $Prop\n\t{ get; set; }\n}\n\nclass B : A, IA\n{\n\tpublic int $Prop\n\t{ get; set; }\n}\n\";\n\t\t\tCollectMembers(code, \"A.Prop\");\n\t\t}\n\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Analysis/DeclarationSpace/LocalDeclarationSpaceTests.cs",
    "content": "//\n// LocalDeclarationSpaceTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2013 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t[TestFixture]\n\tpublic class LocalDeclarationSpaceTests\n\t{\n\t\tLocalDeclarationSpace parent;\n\n\t\tLocalDeclarationSpace child;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tparent = new LocalDeclarationSpace();\n\t\t\tchild = new LocalDeclarationSpace();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddChildSpace()\n\t\t{\n\t\t\tparent.AddChildSpace(child);\n\t\t\tAssert.AreEqual(child.Parent, parent, \"The parent was not set.\");\n\t\t\tAssert.That(parent.Children.Contains(child), \"The child was not added to the parents children.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddChildThrowsOnDuplicateChild ()\n\t\t{\n\t\t\tparent.AddChildSpace(child);\n\t\t\tAssert.Throws<InvalidOperationException>(delegate {\n\t\t\t\tparent.AddChildSpace(child);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ContainsNameSimpleVariableDeclaration()\n\t\t{\n\t\t\tparent.AddChildSpace(child);\n\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tint $i;\n\t}\n}\";\n\t\t\tvar context = TestRefactoringContext.Create(input);\n\t\t\tchild.AddDeclaration(\"i\", context.GetNode<VariableInitializer>());\n\t\t\t\n\t\t\tAssert.That(child.ContainsName(\"i\", false), \"The declaration was not added to child correctly.\");\n\t\t\tAssert.That(!parent.ContainsName(\"i\", false), \"parent incorrectly contained the declaration.\");\n\t\t\tAssert.That(parent.ContainsName(\"i\", true), \"parent did not contain the declaration, event though it should have.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IsNameTakenSimpleVariableDeclarationInParent()\n\t\t{\n\t\t\tparent.AddChildSpace(child);\n\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tint $i;\n\t}\n}\";\n\t\t\tvar context = TestRefactoringContext.Create(input);\n\t\t\tparent.AddDeclaration(\"i\", context.GetNode<VariableInitializer>());\n\n\t\t\tAssert.That(parent.IsNameUsed(\"i\"), \"The declaration was not added to parent correctly.\");\n\t\t\tAssert.That(child.IsNameUsed(\"i\"), \"child did not contain the declaration, event though it should have.\");\n\n\t\t\tAssert.That(!parent.IsNameUsed(\"j\"), \"parent contained a non-existent declaration.\");\n\t\t\tAssert.That(!child.IsNameUsed(\"j\"), \"parent contained a non-existent declaration.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IsNameTakenMultipleChildSpaces()\n\t\t{\n\t\t\tparent.AddChildSpace(child);\n\t\t\tvar child2 = new LocalDeclarationSpace();\n\t\t\tparent.AddChildSpace(child2);\n\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\t{\n\t\t\tint $i;\n\t\t}\n\t}\n}\";\n\t\t\tvar context = TestRefactoringContext.Create(input);\n\t\t\tchild2.AddDeclaration(\"i\", context.GetNode<VariableInitializer>());\n\n\t\t\tAssert.That(parent.IsNameUsed(\"i\"), \"The declaration was not added to parent correctly.\");\n\t\t\tAssert.That(!child.IsNameUsed(\"i\"), \"child contained the declaration, event though it shouldn't.\");\n\t\t\tAssert.That(child2.IsNameUsed(\"i\"), \"child2 did not contain the declaration, event though it should have.\");\n\n\t\t\tAssert.That(!parent.IsNameUsed(\"j\"), \"parent contained a non-existent declaration.\");\n\t\t\tAssert.That(!child.IsNameUsed(\"j\"), \"parent contained a non-existent declaration.\");\n\t\t\tAssert.That(!child2.IsNameUsed(\"j\"), \"parent contained a non-existent declaration.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetNameDeclarationsNoDeclarations()\n\t\t{\n\t\t\tvar node = new IdentifierExpression();\n\t\t\tchild.AddDeclaration(\"blah\", node);\n\n\t\t\tvar declarations = child.GetNameDeclarations(\"notBlah\");\n\t\t\tAssert.NotNull(declarations, \"declarations\");\n\t\t\tAssert.AreEqual(0, declarations.Count(), \"Wrong declaration count\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetNameDeclarationsInChildSpace()\n\t\t{\n\t\t\tvar child2 = new LocalDeclarationSpace();\n\t\t\tparent.AddChildSpace(child);\n\t\t\tparent.AddChildSpace(child2);\n\n\t\t\tvar node1 = new IdentifierExpression();\n\t\t\tchild.AddDeclaration(\"blah\", node1);\n\n\t\t\tvar node2 = new IdentifierExpression();\n\t\t\tchild.AddDeclaration(\"blah\", node2);\n\n\t\t\tvar declarations = parent.GetNameDeclarations(\"blah\").ToList();\n\t\t\tAssert.NotNull(declarations, \"declarations\");\n\t\t\tAssert.AreEqual(2, declarations.Count, \"Wrong declaration count\");\n\t\t\tAssert.That(declarations.Contains(node1), \"node1 was not one of the declarations\");\n\t\t\tAssert.That(declarations.Contains(node2), \"node2 was not one of the declarations\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Analysis/DeclarationSpace/LocalDeclarationSpaceVisitorTests.cs",
    "content": "//\n// LocalVariableLocalDeclarationSpaceVisitor.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2013 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t[TestFixture]\n\tpublic class LocalDeclarationSpaceVisitorTests\n\t{\n\t\tstatic LocalDeclarationSpaceVisitor GetVisitor(out TestRefactoringContext context, string input)\n\t\t{\n\t\t\tcontext = TestRefactoringContext.Create(input);\n\t\t\tvar visitor = new LocalDeclarationSpaceVisitor();\n\t\t\tcontext.RootNode.AcceptVisitor(visitor);\n\t\t\treturn visitor;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SimpleDeclaration()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar visitor = GetVisitor(out context, @\"\nclass A\n{\n\tvoid B()\n\t{\n\t\tint $c = 1;\n\t}\n}\");\n\t\t\tvar declarationSpace = visitor.GetDeclarationSpace(context.GetNode<VariableInitializer>());\n\t\t\tAssert.That(declarationSpace.ContainsName(\"c\", false), \"The variable name was missing in the declaration space.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FieldDeclaration()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar visitor = GetVisitor(out context, @\"\nclass A\n{\n\tint $c = 1;\n\tvoid B()\n\t{\n\t}\n}\");\n\t\t\tvar declarationSpace = visitor.GetDeclarationSpace(context.GetNode<VariableInitializer>());\n\t\t\tAssert.IsNull(declarationSpace);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodWithParameters()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar visitor = GetVisitor(out context, @\"\nclass A\n{\n\tvoid B(int c)\n\t{\n\t\tint $d = 0;\n\t}\n}\");\n\t\t\tvar bodyDeclarationSpace = visitor.GetDeclarationSpace(context.GetNode<VariableInitializer>());\n\t\t\tAssert.That(bodyDeclarationSpace.ContainsName(\"d\", false), \"The variable 'd' was not in the declaration space.\");\n\t\t\tAssert.That(!bodyDeclarationSpace.ContainsName(\"c\", false), \"The variable 'c' was in the wrong declaration space.\");\n\n\t\t\tvar methodDeclarationSpace = bodyDeclarationSpace.Parent;\n\t\t\tAssert.NotNull(methodDeclarationSpace, \"The declaration space did not have a parent.\");\n\t\t\tAssert.That(methodDeclarationSpace.ContainsName(\"c\", false), \"The variable 'c' was not in the declaration space.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CustomEventDeclaration()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar visitor = GetVisitor(out context, @\"\nclass A\n{\n\tevent Action SomethingHappened\n\t{\n\t\tadd {\n\t\t\tint $i = 1;\n\t\t}\n\t\tremove {\n\t\t\tint i = 2;\n\t\t}\n\t}\n}\");\n\t\t\tvar bodyDeclarationSpace = visitor.GetDeclarationSpace(context.GetNode<VariableInitializer>());\n\t\t\tAssert.That(bodyDeclarationSpace.ContainsName(\"i\", false), \"The variable 'i' was not in the declaration space.\");\n\t\t\tAssert.AreEqual(2, bodyDeclarationSpace.Parent.Children.Count, \"Wrong number of child declaration spaces in the event declaration\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Analysis/DefiniteAssignmentTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t[TestFixture]\n\tpublic class DefiniteAssignmentTests\n\t{\n\t\tDefiniteAssignmentAnalysis CreateDefiniteAssignmentAnalysis(Statement rootStatement)\n\t\t{\n\t\t\tvar resolver = new CSharpAstResolver(new CSharpResolver(new SimpleCompilation(CecilLoaderTests.Mscorlib)), rootStatement);\n\t\t\treturn new DefiniteAssignmentAnalysis(rootStatement, resolver, CancellationToken.None);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TryFinally()\n\t\t{\n\t\t\tBlockStatement block = new BlockStatement {\n\t\t\t\tnew TryCatchStatement {\n\t\t\t\t\tTryBlock = new BlockStatement {\n\t\t\t\t\t\tnew GotoStatement(\"LABEL\"),\n\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"i\"), new PrimitiveExpression(1))\n\t\t\t\t\t},\n\t\t\t\t\tCatchClauses = {\n\t\t\t\t\t\tnew CatchClause {\n\t\t\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"i\"), new PrimitiveExpression(3))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tFinallyBlock = new BlockStatement {\n\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"j\"), new PrimitiveExpression(5))\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tnew LabelStatement { Label = \"LABEL\" },\n\t\t\t\tnew EmptyStatement()\n\t\t\t};\n\t\t\tTryCatchStatement tryCatchStatement = (TryCatchStatement)block.Statements.First();\n\t\t\tStatement stmt1 = tryCatchStatement.TryBlock.Statements.ElementAt(1);\n\t\t\tStatement stmt3 = tryCatchStatement.CatchClauses.Single().Body.Statements.Single();\n\t\t\tStatement stmt5 = tryCatchStatement.FinallyBlock.Statements.Single();\n\t\t\tLabelStatement label = (LabelStatement)block.Statements.ElementAt(1);\n\t\t\t\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(block);\n\t\t\tda.Analyze(\"i\");\n\t\t\tAssert.AreEqual(0, da.UnassignedVariableUses.Count);\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(tryCatchStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.CodeUnreachable, da.GetStatusBefore(stmt1));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.CodeUnreachable, da.GetStatusAfter(stmt1));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(stmt3));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(stmt3));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(stmt5));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(stmt5));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(tryCatchStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(label));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(label));\n\t\t\t\n\t\t\tda.Analyze(\"j\");\n\t\t\tAssert.AreEqual(0, da.UnassignedVariableUses.Count);\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(tryCatchStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.CodeUnreachable, da.GetStatusBefore(stmt1));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.CodeUnreachable, da.GetStatusAfter(stmt1));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(stmt3));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(stmt3));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(stmt5));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(stmt5));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(tryCatchStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(label));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(label));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalAnd()\n\t\t{\n\t\t\tIfElseStatement ifStmt = new IfElseStatement {\n\t\t\t\tCondition = new BinaryOperatorExpression {\n\t\t\t\t\tLeft = new BinaryOperatorExpression(new IdentifierExpression(\"x\"), BinaryOperatorType.GreaterThan, new PrimitiveExpression(0)),\n\t\t\t\t\tOperator = BinaryOperatorType.ConditionalAnd,\n\t\t\t\t\tRight = new BinaryOperatorExpression {\n\t\t\t\t\t\tLeft = new ParenthesizedExpression {\n\t\t\t\t\t\t\tExpression = new AssignmentExpression {\n\t\t\t\t\t\t\t\tLeft = new IdentifierExpression(\"i\"),\n\t\t\t\t\t\t\t\tOperator = AssignmentOperatorType.Assign,\n\t\t\t\t\t\t\t\tRight = new IdentifierExpression(\"y\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tOperator = BinaryOperatorType.GreaterThanOrEqual,\n\t\t\t\t\t\tRight = new PrimitiveExpression(0)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTrueStatement = new BlockStatement(),\n\t\t\t\tFalseStatement = new BlockStatement()\n\t\t\t};\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(ifStmt);\n\t\t\tda.Analyze(\"i\");\n\t\t\tAssert.AreEqual(0, da.UnassignedVariableUses.Count);\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(ifStmt));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(ifStmt.TrueStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(ifStmt.FalseStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(ifStmt));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalOr()\n\t\t{\n\t\t\tIfElseStatement ifStmt = new IfElseStatement {\n\t\t\t\tCondition = new BinaryOperatorExpression {\n\t\t\t\t\tLeft = new BinaryOperatorExpression(new IdentifierExpression(\"x\"), BinaryOperatorType.GreaterThan, new PrimitiveExpression(0)),\n\t\t\t\t\tOperator = BinaryOperatorType.ConditionalOr,\n\t\t\t\t\tRight = new BinaryOperatorExpression {\n\t\t\t\t\t\tLeft = new ParenthesizedExpression {\n\t\t\t\t\t\t\tExpression = new AssignmentExpression {\n\t\t\t\t\t\t\t\tLeft = new IdentifierExpression(\"i\"),\n\t\t\t\t\t\t\t\tOperator = AssignmentOperatorType.Assign,\n\t\t\t\t\t\t\t\tRight = new IdentifierExpression(\"y\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tOperator = BinaryOperatorType.GreaterThanOrEqual,\n\t\t\t\t\t\tRight = new PrimitiveExpression(0)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTrueStatement = new BlockStatement(),\n\t\t\t\tFalseStatement = new BlockStatement()\n\t\t\t};\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(ifStmt);\n\t\t\tda.Analyze(\"i\");\n\t\t\tAssert.AreEqual(0, da.UnassignedVariableUses.Count);\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(ifStmt));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(ifStmt.TrueStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(ifStmt.FalseStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(ifStmt));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void WhileTrue()\n\t\t{\n\t\t\tWhileStatement loop = new WhileStatement {\n\t\t\t\tCondition = new PrimitiveExpression(true),\n\t\t\t\tEmbeddedStatement = new BlockStatement {\n\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"i\"), new PrimitiveExpression(0)),\n\t\t\t\t\tnew BreakStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(loop);\n\t\t\tda.Analyze(\"i\");\n\t\t\tAssert.AreEqual(0, da.UnassignedVariableUses.Count);\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(loop));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(loop.EmbeddedStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.CodeUnreachable, da.GetStatusAfter(loop.EmbeddedStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(loop));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ForLoop()\n\t\t{\n\t\t\tForStatement loop = new ForStatement {\n\t\t\t\tInitializers = {\n\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"i\"), new PrimitiveExpression(0))\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\tCondition = new BinaryOperatorExpression(new IdentifierExpression(\"i\"), BinaryOperatorType.LessThan, new PrimitiveExpression(1000)),\n\t\t\t\tIterators = {\n\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\tnew AssignmentExpression {\n\t\t\t\t\t\t\tLeft = new IdentifierExpression(\"i\"),\n\t\t\t\t\t\t\tOperator = AssignmentOperatorType.Add,\n\t\t\t\t\t\t\tRight = new IdentifierExpression(\"j\")\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\tEmbeddedStatement = new ExpressionStatement(\n\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"j\"), new IdentifierExpression(\"i\"))\n\t\t\t\t)};\n\t\t\t\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(loop);\n\t\t\tda.Analyze(\"i\");\n\t\t\tAssert.AreEqual(0, da.UnassignedVariableUses.Count);\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(loop));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(loop.Initializers.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(loop.Initializers.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBeforeLoopCondition(loop));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(loop.EmbeddedStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(loop.EmbeddedStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(loop.Iterators.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(loop.Iterators.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(loop));\n\t\t\t\n\t\t\tda.Analyze(\"j\");\n\t\t\tAssert.AreEqual(0, da.UnassignedVariableUses.Count);\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(loop));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(loop.Initializers.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(loop.Initializers.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBeforeLoopCondition(loop));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(loop.EmbeddedStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(loop.EmbeddedStatement));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(loop.Iterators.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(loop.Iterators.Single()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(loop));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SwitchWithGotoDefault()\n\t\t{\n\t\t\tSwitchStatement @switch = new SwitchStatement {\n\t\t\t\tSwitchSections = {\n\t\t\t\t\tnew SwitchSection { // case 0:\n\t\t\t\t\t\tCaseLabels = { new CaseLabel(new PrimitiveExpression(0)) },\n\t\t\t\t\t\tStatements = { new GotoDefaultStatement() }\n\t\t\t\t\t},\n\t\t\t\t\tnew SwitchSection { // default:\n\t\t\t\t\t\tCaseLabels = { new CaseLabel() },\n\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\tnew ExpressionStatement(new AssignmentExpression(new IdentifierExpression(\"a\"), new PrimitiveExpression(1))),\n\t\t\t\t\t\t\tnew BreakStatement()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}};\n\t\t\t\n\t\t\tSwitchSection case0 = @switch.SwitchSections.ElementAt(0);\n\t\t\tSwitchSection defaultSection = @switch.SwitchSections.ElementAt(1);\n\t\t\t\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(@switch);\n\t\t\tda.Analyze(\"a\");\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(@switch));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(case0.Statements.First()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(defaultSection.Statements.First()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(defaultSection.Statements.Last()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.CodeUnreachable, da.GetStatusAfter(defaultSection.Statements.Last()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(@switch));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SwitchWithGotoCase()\n\t\t{\n\t\t\tSwitchStatement @switch = new SwitchStatement {\n\t\t\t\tExpression = new PrimitiveExpression(1),\n\t\t\t\tSwitchSections = {\n\t\t\t\t\tnew SwitchSection { // case 0:\n\t\t\t\t\t\tCaseLabels = { new CaseLabel(new PrimitiveExpression(0)) },\n\t\t\t\t\t\tStatements = { new BreakStatement() }\n\t\t\t\t\t},\n\t\t\t\t\tnew SwitchSection { // case 1:\n\t\t\t\t\t\tCaseLabels = { new CaseLabel(new PrimitiveExpression(1)) },\n\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\tnew ExpressionStatement(new AssignmentExpression(new IdentifierExpression(\"a\"), new PrimitiveExpression(0))),\n\t\t\t\t\t\t\tnew GotoCaseStatement { LabelExpression = new PrimitiveExpression(2) }\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew SwitchSection { // case 2:\n\t\t\t\t\t\tCaseLabels = { new CaseLabel(new PrimitiveExpression(2)) },\n\t\t\t\t\t\tStatements = { new BreakStatement() }\n\t\t\t\t\t}\n\t\t\t\t}};\n\t\t\t\n\t\t\tSwitchSection case0 = @switch.SwitchSections.ElementAt(0);\n\t\t\tSwitchSection case1 = @switch.SwitchSections.ElementAt(1);\n\t\t\tSwitchSection case2 = @switch.SwitchSections.ElementAt(2);\n\t\t\t\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(@switch);\n\t\t\tda.Analyze(\"a\");\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(@switch));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.CodeUnreachable, da.GetStatusBefore(case0.Statements.First()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusBefore(case1.Statements.First()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusBefore(case2.Statements.First()));\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(@switch));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalExpression1()\n\t\t{\n\t\t\tstring code = \"int a; int b = X ? (a = 1) : 0;\";\n\t\t\tvar block = new BlockStatement();\n\t\t\tblock.Statements.AddRange(new CSharpParser().ParseStatements(code));\n\t\t\t\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(block);\n\t\t\tda.Analyze(\"a\");\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.PotentiallyAssigned, da.GetStatusAfter(block));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalExpression2()\n\t\t{\n\t\t\tstring code = \"int a; int b = X ? (a = 1) : (a = 2);\";\n\t\t\tvar block = new BlockStatement();\n\t\t\tblock.Statements.AddRange(new CSharpParser().ParseStatements(code));\n\t\t\t\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(block);\n\t\t\tda.Analyze(\"a\");\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(block));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalExpression3()\n\t\t{\n\t\t\tstring code = \"int a; int b = true ? (a = 1) : 0;\";\n\t\t\tvar block = new BlockStatement();\n\t\t\tblock.Statements.AddRange(new CSharpParser().ParseStatements(code));\n\t\t\t\n\t\t\tDefiniteAssignmentAnalysis da = CreateDefiniteAssignmentAnalysis(block);\n\t\t\tda.Analyze(\"a\");\n\t\t\tAssert.AreEqual(DefiniteAssignmentStatus.DefinitelyAssigned, da.GetStatusAfter(block));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Analysis/NullValueAnalysisTests.cs",
    "content": "//\n// NullValueAnalysisTests.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t[TestFixture]\n\tpublic class NullValueAnalysisTests\n\t{\n\t\tclass StubbedRefactoringContext : BaseRefactoringContext\n\t\t{\n\t\t\tbool supportsVersion5;\n\n\t\t\tpublic override string DefaultNamespace {\n\t\t\t\tget {\n\t\t\t\t\treturn string.Empty;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tStubbedRefactoringContext(CSharpAstResolver resolver, bool supportsVersion5) :\n\t\t\t\tbase(resolver, CancellationToken.None) {\n\t\t\t\tthis.supportsVersion5 = supportsVersion5;\n\t\t\t}\n\n\t\t\tinternal static StubbedRefactoringContext Create(SyntaxTree tree, bool supportsVersion5 = true)\n\t\t\t{\n\t\t\t\tIProjectContent pc = new CSharpProjectContent();\n\t\t\t\tpc = pc.AddAssemblyReferences(CecilLoaderTests.Mscorlib);\n\t\t\t\tpc = pc.AddOrUpdateFiles(new[] {\n\t\t\t\t\ttree.ToTypeSystem()\n\t\t\t\t});\n\t\t\t\tvar compilation = pc.CreateCompilation();\n\t\t\t\tvar resolver = new CSharpAstResolver(compilation, tree);\n\n\t\t\t\treturn new StubbedRefactoringContext(resolver, supportsVersion5);\n\t\t\t}\n\n\t\t\t#region implemented abstract members of BaseRefactoringContext\n\t\t\tpublic override int GetOffset(TextLocation location)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\tpublic override ICSharpCode.NRefactory.Editor.IDocumentLine GetLineByOffset(int offset)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\tpublic override TextLocation GetLocation(int offset)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\tpublic override string GetText(int offset, int length)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\tpublic override string GetText(ICSharpCode.NRefactory.Editor.ISegment segment)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\t#endregion\n\n\n\t\t\tpublic override bool Supports(Version version)\n\t\t\t{\n\t\t\t\tif (supportsVersion5)\n\t\t\t\t\treturn version.Major <= 5;\n\t\t\t\treturn version.Major <= 4;\n\t\t\t}\n\t\t}\n\n\t\tstatic NullValueAnalysis CreateNullValueAnalysis(SyntaxTree tree, MethodDeclaration methodDeclaration, bool supportsCSharp5 = true)\n\t\t{\n\t\t\tvar ctx = StubbedRefactoringContext.Create(tree, supportsCSharp5);\n\t\t\tvar analysis =  new NullValueAnalysis(ctx, methodDeclaration, CancellationToken.None) {\n\t\t\t\tIsParametersAreUninitialized = true\n\t\t\t};\n\t\t\tanalysis.Analyze();\n\t\t\treturn analysis;\n\t\t}\n\n\t\tstatic NullValueAnalysis CreateNullValueAnalysis(MethodDeclaration methodDeclaration)\n\t\t{\n\t\t\tvar type = new TypeDeclaration {\n\t\t\t\tName = \"DummyClass\",\n\t\t\t\tClassType = ClassType.Class\n\t\t\t};\n\t\t\ttype.Members.Add(methodDeclaration);\n\t\t\tvar tree = new SyntaxTree { FileName = \"test.cs\" };\n\t\t\ttree.Members.Add(type);\n\n\t\t\treturn CreateNullValueAnalysis(tree, methodDeclaration);\n\t\t}\n\n\t\tstatic ParameterDeclaration CreatePrimitiveParameter(string typeKeyword, string parameterName)\n\t\t{\n\t\t\treturn new ParameterDeclaration(new PrimitiveType(typeKeyword), parameterName);\n\t\t}\n\n\t\tstatic ParameterDeclaration CreateStringParameter(string parameterName = \"p\")\n\t\t{\n\t\t\treturn CreatePrimitiveParameter(\"string\", parameterName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimple()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew ExpressionStatement(new AssignmentExpression(\n\t\t\t\t\t\tnew IdentifierExpression(\"p\"), new NullReferenceExpression())),\n\t\t\t\t\tnew ExpressionStatement(new AssignmentExpression(\n\t\t\t\t\t\tnew IdentifierExpression(\"p\"), new PrimitiveExpression(\"Hello\"))),\n\t\t\t\t\tnew ReturnStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tmethod.Parameters.Add(CreateStringParameter());\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar stmt1 = method.Body.Statements.First();\n\t\t\tvar stmt2 = method.Body.Statements.ElementAt(1);\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfStatement()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew IfElseStatement {\n\t\t\t\t\t\tCondition = new BinaryOperatorExpression(new IdentifierExpression(\"p\"),\n\t\t\t\t\t\t                                         BinaryOperatorType.Equality,\n\t\t\t\t\t\t                                         new NullReferenceExpression()),\n\t\t\t\t\t\tTrueStatement = new ExpressionStatement(new AssignmentExpression(\n\t\t\t\t\t\t\tnew IdentifierExpression(\"p\"),\n\t\t\t\t\t\t\tnew PrimitiveExpression(\"Hello\")))\n\t\t\t\t\t},\n\t\t\t\t\tnew ReturnStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tmethod.Parameters.Add(CreateStringParameter());\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar stmt1 = (IfElseStatement)method.Body.Statements.First();\n\t\t\tvar stmt2 = (ExpressionStatement)stmt1.TrueStatement;\n\t\t\tvar stmt3 = (ReturnStatement)method.Body.Statements.ElementAt(1);\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(stmt3, \"p\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEndlessLoop()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew VariableDeclarationStatement(new PrimitiveType(\"string\"),\n\t\t\t\t\t                                 \"p2\", new NullReferenceExpression()),\n\t\t\t\t\tnew WhileStatement {\n\t\t\t\t\t\tCondition = new BinaryOperatorExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t                                 BinaryOperatorType.Equality,\n\t\t\t\t\t\t                                 new NullReferenceExpression()),\n\t\t\t\t\t\tEmbeddedStatement = new ExpressionStatement(\n\t\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"p2\"),\n\t\t\t\t\t\t                         AssignmentOperatorType.Assign,\n\t\t\t\t\t\t                         new PrimitiveExpression(\"\")))\n\t\t\t\t\t},\n\t\t\t\t\tnew ReturnStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p1\"));\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar stmt1 = (WhileStatement)method.Body.Statements.ElementAt(1);\n\t\t\tvar stmt2 = (ExpressionStatement)stmt1.EmbeddedStatement;\n\t\t\tvar stmt3 = (ReturnStatement)method.Body.Statements.ElementAt(2);\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(stmt3, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt3, \"p2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLoop()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew VariableDeclarationStatement(new PrimitiveType(\"string\"),\n\t\t\t\t\t                                 \"p2\", new NullReferenceExpression()),\n\t\t\t\t\tnew WhileStatement {\n\t\t\t\t\t\tCondition = new BinaryOperatorExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t                                         BinaryOperatorType.Equality,\n\t\t\t\t\t\t                                         new NullReferenceExpression()),\n\t\t\t\t\t\tEmbeddedStatement = new BlockStatement {\n\t\t\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"p2\"),\n\t\t\t\t\t\t                         AssignmentOperatorType.Assign,\n\t\t\t\t\t\t                         new PrimitiveExpression(\"\"))),\n\t\t\t\t\t\t\tnew ExpressionStatement(\n\t\t\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t\t                         AssignmentOperatorType.Assign,\n\t\t\t\t\t\t\t                         new PrimitiveExpression(\"\")))\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew ReturnStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p1\"));\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar stmt1 = (WhileStatement)method.Body.Statements.ElementAt(1);\n\t\t\tvar stmt2 = (ExpressionStatement)((BlockStatement)stmt1.EmbeddedStatement).Statements.Last();\n\t\t\tvar stmt3 = (ReturnStatement)method.Body.Statements.ElementAt(2);\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(stmt3, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt3, \"p2\"));\n\t\t}\n\n\t\tExpressionStatement MakeStatement(Expression expr)\n\t\t{\n\t\t\treturn new ExpressionStatement(expr);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForLoop()\n\t\t{\n\t\t\tvar forStatement = new ForStatement();\n\t\t\tforStatement.Initializers.Add(MakeStatement(new AssignmentExpression(new IdentifierExpression(\"p2\"),\n\t\t\t                                                                     new PrimitiveExpression(\"\"))));\n\t\t\tforStatement.Condition = new BinaryOperatorExpression(new IdentifierExpression(\"p1\"),\n\t\t\t                                                      BinaryOperatorType.Equality,\n\t\t\t                                                      new NullReferenceExpression());\n\t\t\tforStatement.Iterators.Add(MakeStatement(new AssignmentExpression(new IdentifierExpression(\"p2\"),\n\t\t\t                                                                  AssignmentOperatorType.Assign,\n\t\t\t                                                                  new NullReferenceExpression())));\n\t\t\tforStatement.EmbeddedStatement = MakeStatement(new AssignmentExpression(new IdentifierExpression(\"p1\"),\n\t\t\t                                                                        AssignmentOperatorType.Assign,\n\t\t\t                                                                        new PrimitiveExpression(\"\")));\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tforStatement,\n\t\t\t\t\tnew ReturnStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p1\"));\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p2\"));\n\n\t\t\tvar returnStatement = (ReturnStatement)method.Body.Statements.Last();\n\t\t\tvar content = forStatement.EmbeddedStatement;\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(forStatement, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(forStatement, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(content, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(content, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(content, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(returnStatement, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(returnStatement, \"p2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCoallescing()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew ExpressionStatement(new AssignmentExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t                                                 new BinaryOperatorExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t                             BinaryOperatorType.NullCoalescing,\n\t\t\t\t\t                             new PrimitiveExpression(\"\"))))\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p1\"));\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar stmt = method.Body.Statements.Single();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(stmt, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCapturedLambdaVariables()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew VariableDeclarationStatement(AstType.Create(\"System.Action\"),\n\t\t\t\t\t                                 \"action\",\n\t\t\t\t\t                                 new LambdaExpression {\n\t\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\t\tMakeStatement(new AssignmentExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t\t                                       new NullReferenceExpression()))\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tMakeStatement(new AssignmentExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t                                       new NullReferenceExpression())),\n\t\t\t\t\tnew ExpressionStatement(new InvocationExpression(new IdentifierExpression(\"action\"))),\n\t\t\t\t\tMakeStatement(new AssignmentExpression(new IdentifierExpression(\"p3\"),\n\t\t\t\t\t                                       new IdentifierExpression(\"p1\")))\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p1\"));\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p2\"));\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p3\"));\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar declareLambda = (VariableDeclarationStatement)method.Body.Statements.First();\n\t\t\tvar lastStatement = (ExpressionStatement)method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(declareLambda, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(declareLambda, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusBeforeStatement(lastStatement, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(lastStatement, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusAfterStatement(lastStatement, \"p3\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVariableVisitsCount()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tstring s = null;\n\t\twhile (s == null) {\n\t\t\tstring s2 = null;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tAssert.AreEqual(8, analysis.NodeVisits);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInvocation()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\ndelegate void MyDelegate(string p1, out string p2);\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tstring p1 = null;\n\t\tstring p2 = null;\n\t\tMyDelegate del = (string a, out string b) => { b = a; };\n\t\tdel(p1 = \"\"\"\", out p2);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = (ExpressionStatement)method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusAfterStatement(lastStatement, \"p2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLock()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tobject o = null;\n\t\tlock (o) {\n\t\t\t//Impossible\n\t\t\tint x1 = 1;\n\t\t}\n\t\t//Impossible\n\t\tint x2 = 1;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lockStatement = (LockStatement)method.Body.Statements.ElementAt(1);\n\t\t\tvar lockBlock = (BlockStatement)lockStatement.EmbeddedStatement;\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lockBlock.Statements.Single(), \"x1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"x2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComparisonWithNonNull()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tstring SomeValue () { return null; }\n\tbool PathMatches ()\n\t{\n\t\tstring handlerPath = SomeValue();\n\t\tif (handlerPath == \"\"*\"\")\n\t\t\treturn false;\n\t\treturn true;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar end = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusBeforeStatement(end, \"handlerPath\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLock2()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tobject MaybeNull() { return null; }\n\tvoid TestMethod()\n\t{\n\t\tobject o = MaybeNull();\n\t\ttry {\n\t\t\tlock (o) {\n\t\t\t}\n\t\t} catch (NullReferenceException e) {\n\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar tryStatement = (TryCatchStatement) method.Body.Statements.Last();\n\t\t\tvar tryBlock = tryStatement.TryBlock;\n\t\t\tvar catchBlock = tryStatement.CatchClauses.Single().Body;\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(tryBlock, \"o\"));\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusAfterStatement(catchBlock, \"o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMemberAccess()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tobject o = null;\n\t\tstring s = o.ToString();\n\t\tint x2 = 1;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"x2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMemberAccess2()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tobject MaybeNull()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = MaybeNull();\n\t\tstring s = o.ToString();\n\t\tint x2 = 1;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullableHasValue()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? x = null;\n\t\tbool y = x.HasValue;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMemberAccessExtensionMethod()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nstatic class ObjectExtensions {\n\tstatic internal string Extension(this object obj) {\n\t\treturn \"\"\"\";\n\t}\n}\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tobject o = null;\n\t\tstring s = o.Extension();\n\t\tint x2 = 1;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAs()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\ndelegate void MyDelegate(string p1, out string p2);\nclass TestClass\n{\n\tvoid TestMethod(object o)\n\t{\n\t\tstring p1 = o as string;\n\t\to = new object();\n\t\tstring p2 = o as string;\n\t\tstring p3 = typeof(string) as string;\n\t\to = null;\n\t\tstring p4 = o as string;\n\t\tstring p5 = \"\"\"\" as string;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar p5Statement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(p5Statement, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(p5Statement, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(p5Statement, \"p3\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(p5Statement, \"p4\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(p5Statement, \"p5\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUncaptureVariable()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\twhile (true) {\n\t\t\tstring p1 = null;\n\t\t\tAction action = () => { p1 = \"\"\"\"; };\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar whileStatement = (WhileStatement)method.Body.Statements.Single();\n\t\t\tvar whileBlock = (BlockStatement)whileStatement.EmbeddedStatement;\n\t\t\tvar actionStatement = whileBlock.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(actionStatement, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusAfterStatement(actionStatement, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleForeach()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? accum = 0;\n\t\tforeach (var x in new int[] { 1, 2, 3}) {\n\t\t\taccum += x;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = (ForeachStatement)method.Body.Statements.Last();\n\t\t\tvar content = (BlockStatement)lastStatement.EmbeddedStatement;\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(content, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(lastStatement, \"accum\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonNullEnumeratedValue()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? accum = 0;\n\t\tforeach (var x in new int?[] { 1, 2, 3}) {\n\t\t\taccum += x;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = (ForeachStatement)method.Body.Statements.Last();\n\t\t\tvar content = (BlockStatement)lastStatement.EmbeddedStatement;\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(content, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(lastStatement, \"accum\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCapturedForeachInCSharp5()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? accum = 0;\n\t\tforeach (var x in new int?[] { 1, 2, 3 }) {\n\t\t\tAction action = () => { x = null; };\n\t\t\taccum += x;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method, true);\n\n\t\t\tvar foreachStatement = (ForeachStatement)method.Body.Statements.ElementAt(1);\n\t\t\tvar foreachBody = (BlockStatement)foreachStatement.EmbeddedStatement;\n\t\t\tvar action = foreachBody.Statements.First();\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(action, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusAfterStatement(action, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusAfterStatement(lastStatement, \"accum\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCapturedForeachInCSharp4()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? accum = 0;\n\t\tforeach (var x in new int?[] { 1, 2, 3}) {\n\t\t\tAction action = () => { x = null; };\n\t\t\taccum += x;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method, false);\n\n\t\t\tvar foreachStatement = (ForeachStatement)method.Body.Statements.ElementAt(1);\n\t\t\tvar foreachBody = (BlockStatement)foreachStatement.EmbeddedStatement;\n\t\t\tvar action = foreachBody.Statements.First();\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusBeforeStatement(action, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusAfterStatement(action, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusAfterStatement(lastStatement, \"accum\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForCapture()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tstring TestMethod(string p)\n\t{\n\t\tfor (int? i = 0; i < 10; ++i) {\n\t\t\tint? inI = i;\n\t\t\tAction action = () => { i = null; inI = null; };\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\tvar forStatement = (ForStatement)method.Body.Statements.Single();\n\t\t\tvar forBody = (BlockStatement)forStatement.EmbeddedStatement;\n\t\t\tvar actionStatement = forBody.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusBeforeStatement(actionStatement, \"i\"));\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusAfterStatement(actionStatement, \"i\"));\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusBeforeStatement(actionStatement, \"inI\"));\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusAfterStatement(actionStatement, \"inI\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExpressionState()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\ndelegate void MyDelegate(string p1, out string p2);\nclass TestClass\n{\n\tstring TestMethod(string p)\n\t{\n\t\tif (p != null) p = \"\"\"\";\n\t\treturn p;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = (ReturnStatement)method.Body.Statements.Last();\n\t\t\tvar expr = lastStatement.Expression;\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetExpressionResult(expr));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestField()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tstatic object o;\n\tstring TestMethod()\n\t{\n\t\to = null;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullableCast()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tint? maybeNull;\n\tstring TestMethod()\n\t{\n\t\tint? x = maybeNull;\n\t\tint y = (int)x;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"y\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonNullableCapture()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tstring TestMethod()\n\t{\n\t\tint a = 0;\n\t\tAction action = () => { a = 1; };\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"a\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentFromNonNullableTypes()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tint this[int idx] { get { return 0; } }\n\tint i;\n\tint M() { return 0; }\n\tstring TestMethod()\n\t{\n\t\tobject o = TestClass.i;\n\t\tobject p = i;\n\t\tobject q = M();\n\t\tobject m = this[0];\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"q\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"m\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonNullReference()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tvoid M(ref int i) {}\n\n\tstring TestMethod()\n\t{\n\t\tint i = 1;\n\t\tM(ref i);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"i\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCompileConstants()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tconst int? value1 = null;\n\tconst bool value2 = true;\n\tvoid TestMethod()\n\t{\n\t\tint? p1 = value2 ? value1 : 0;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = (VariableDeclarationStatement)method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalAnd()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew IfElseStatement {\n\t\t\t\t\t\tCondition = new BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t                                         BinaryOperatorType.Equality,\n\t\t\t\t\t\t                                         new NullReferenceExpression()),\n\t\t\t\t\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\t\t\t\t\tnew BinaryOperatorExpression(new IdentifierExpression(\"p2\"),\n\t\t\t\t\t\t                                     BinaryOperatorType.Equality,\n\t\t\t\t\t\t                                     new NullReferenceExpression())),\n\t\t\t\t\t\tTrueStatement = new ExpressionStatement(new AssignmentExpression(\n\t\t\t\t\t\t\tnew IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t\tnew PrimitiveExpression(\"Hello\")))\n\t\t\t\t\t},\n\t\t\t\t\tnew ReturnStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p1\"));\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p2\"));\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar stmt1 = (IfElseStatement)method.Body.Statements.First();\n\t\t\tvar stmt2 = (ExpressionStatement)stmt1.TrueStatement;\n\t\t\tvar stmt3 = (ReturnStatement)method.Body.Statements.ElementAt(1);\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt3, \"p2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalOr()\n\t\t{\n\t\t\tvar method = new MethodDeclaration {\n\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\tnew IfElseStatement {\n\t\t\t\t\t\tCondition = new UnaryOperatorExpression(UnaryOperatorType.Not,\n\t\t\t\t\t\t                                        new BinaryOperatorExpression(\n\t\t\t\t\t\t\tnew BinaryOperatorExpression(new IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t                             BinaryOperatorType.Equality,\n\t\t\t\t\t\t                             new NullReferenceExpression()),\n\t\t\t\t\t\t\tBinaryOperatorType.ConditionalOr,\n\t\t\t\t\t\t\tnew BinaryOperatorExpression(new IdentifierExpression(\"p2\"),\n\t\t\t\t\t\t                             BinaryOperatorType.Equality,\n\t\t\t\t\t\t                             new NullReferenceExpression()))),\n\t\t\t\t\t\tTrueStatement = new ExpressionStatement(new AssignmentExpression(\n\t\t\t\t\t\t\tnew IdentifierExpression(\"p1\"),\n\t\t\t\t\t\t\tnew NullReferenceExpression()))\n\t\t\t\t\t},\n\t\t\t\t\tnew ReturnStatement()\n\t\t\t\t}\n\t\t\t};\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p1\"));\n\t\t\tmethod.Parameters.Add(CreateStringParameter(\"p2\"));\n\n\t\t\tvar analysis = CreateNullValueAnalysis(method);\n\t\t\tvar stmt1 = (IfElseStatement)method.Body.Statements.First();\n\t\t\tvar stmt2 = (ExpressionStatement)stmt1.TrueStatement;\n\t\t\tvar stmt3 = (ReturnStatement)method.Body.Statements.ElementAt(1);\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt1, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(stmt2, \"p2\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(stmt2, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(stmt3, \"p2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFinally()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? x = 1;\n\t\tint? y = 1;\n\t\ttry {\n\t\t\tx = 2;\n\t\t\tx = null;\n\t\t} finally {\n\t\t\ty = null;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar tryFinally = (TryCatchStatement) method.Body.Statements.Last();\n\t\t\tvar finallyStatement = tryFinally.FinallyBlock.Statements.Single();\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusBeforeStatement(finallyStatement, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(finallyStatement, \"y\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(finallyStatement, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(finallyStatement, \"y\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(tryFinally, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(tryFinally, \"y\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFinallyCapture()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? x = 1;\n\t\ttry {\n\t\t\tAction a = () => { x = null; };\n\t\t} finally {\n\t\t\tConsole.WriteLine(x);\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar tryFinally = (TryCatchStatement) method.Body.Statements.Last();\n\t\t\tvar finallyStatement = tryFinally.FinallyBlock.Statements.Single();\n\n\t\t\tAssert.AreEqual(NullValueStatus.CapturedUnknown, analysis.GetVariableStatusBeforeStatement(finallyStatement, \"x\"));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestReturnInFinally()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? x = 1;\n\t\tint? y = 1;\n\t\ttry {\n\t\t\tx = null;\n\t\t\treturn;\n\t\t} finally {\n\t\t\ty = null;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar tryFinally = (TryCatchStatement) method.Body.Statements.Last();\n\t\t\tvar finallyStatement = tryFinally.FinallyBlock.Statements.Single();\n\n\t\t\t//Make sure it's not unreachable\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusAfterStatement(finallyStatement, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(finallyStatement, \"y\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTryCatch()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint? x = 1;\n\t\tint? y = 2;\n\t\tint? z = 3;\n\t\ttry {\n\t\t\tx = null;\n\t\t} catch (Exception e) {\n\t\t\tx = null;\n\t\t\ty = 3;\n\t\t\tz = null;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar tryCatch = (TryCatchStatement) method.Body.Statements.Last();\n\t\t\tvar catchStatement = tryCatch.CatchClauses.First().Body.Statements.First();\n\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusBeforeStatement(catchStatement, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusBeforeStatement(catchStatement, \"e\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(tryCatch, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(tryCatch, \"y\"));\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(tryCatch, \"z\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexer()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tint[] MaybeNull() { return null; }\n\tvoid TestMethod()\n\t{\n\t\tint[] x = MaybeNull();\n\t\tx[(x = null) != null ? 0 : 1] = 2;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = (ExpressionStatement) method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexer2()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tint[] MaybeNull() { return null; }\n\tvoid TestMethod()\n\t{\n\t\tint[] x = MaybeNull();\n\t\tobject o = null;\n\t\tx[(x == null ? o = null : o = 1) != null ? 1 : 2] = 2;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = (ExpressionStatement) method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalInvocation()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tAction<int> x = i => {};\n\t\tx((x = null) != null ? 1 : 0);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalInvocation2()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tAction<int> MaybeNull()\n\t{\n\t\tAction<int> x = i => {};\n\t\treturn x;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tAction<int> x = MaybeNull();\n\t\tobject o = null;\n\t\tx((x == null ? o = null : o = 1) == null ? 1 : 2);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLinq()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint?[] collection = new int?[10];\n\t\tvar x = from item in collection\n\t\t\t\twhere item != null\n\t\t\t\tselect item\n\t\t\t\tinto item2\n\t\t\t\tlet item3 = item2\n\t\t\t\tselect item3;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar linqStatement = (VariableDeclarationStatement) method.Body.Statements.Last();\n\t\t\tvar linqExpression = (QueryExpression)linqStatement.Variables.Single().Initializer;\n\t\t\tvar continuation = (QueryContinuationClause)linqExpression.Clauses.First();\n\t\t\tvar itemInWhere = ((BinaryOperatorExpression)((QueryWhereClause)continuation.PrecedingQuery.Clauses.ElementAt(1)).Condition).Left;\n\t\t\tvar itemInSelect = ((QuerySelectClause)continuation.PrecedingQuery.Clauses.ElementAt(2)).Expression;\n\t\t\tvar item2InLet = ((QueryLetClause)linqExpression.Clauses.ElementAt(1)).Expression;\n\t\t\tvar item3InSelect = ((QuerySelectClause)linqExpression.Clauses.Last()).Expression;\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(linqStatement, \"x\"));\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetExpressionResult(itemInWhere));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetExpressionResult(itemInSelect));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetExpressionResult(item2InLet));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetExpressionResult(item3InSelect));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLinqMember()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint?[] collection = new int?[10];\n\t\tforeach (var x in from item in collection\n                 where item.Value > 1\n\t\t\t\t select item) {\n\t\t\t/* x is not null, or else item.Value would trigger an exception */\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar foreachStatement = (ForeachStatement) method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(foreachStatement.EmbeddedStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLinqGroupBy()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint?[] collection = new int?[10];\n\t\tforeach (var x in from item in collection\n\t\t                  group new { x = item } by item != null) {\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar foreachStatement = (ForeachStatement)method.Body.Statements.Last();\n\t\t\tvar foreachBody = foreachStatement.EmbeddedStatement;\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(foreachBody, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoExecutionLinq()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint?[] collection = new int?[0];\n\t\tvar x = from item in collection\n\t\t\t\twhere (collection = null) != null\n\t\t\t\tselect item;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar linqStatement = (VariableDeclarationStatement) method.Body.Statements.Last();\n\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(linqStatement, \"collection\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLinqMemberNoExecution()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nabstract class TestClass\n{\n\tabstract int?[] Collection { get; }\n\tvoid TestMethod()\n\t{\n\t\tobject o = null;\n\t\tint?[] collection = Collection;\n\t\tvar x = from item in collection\n                where o.ToString() == \"\"\"\"\n\t\t\t\tselect item;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Single();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\n\t\t\t//o.ToString always throws an exception, but the query might not be executed at all\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"o\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsing()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tSystem.IDisposable Foo() {\n\t\tthrow new NotImplementedException();\n\t}\n\n\tvoid TestMethod()\n\t{\n\t\tusing (var x = Foo()) {\n\t\t\t;\n\t\t}\n\t\tusing (Foo()) {\n\t\t\t//Ensure the analysis doesn't throw an exception for a non-declaration using\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar usingStatement = (UsingStatement)method.Body.Statements.First();\n\t\t\tvar content = usingStatement.EmbeddedStatement;\n\n\t\t\tAssert.AreEqual(NullValueStatus.Unknown, analysis.GetVariableStatusAfterStatement(content, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixed()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nusing System;\nclass TestClass\n{\n\tunsafe void TestMethod()\n\t{\n\t\tint y = 0;\n\t\tfixed (int* x = &y)\n\t\t{\n\t\t\t*x = 1;\n\t\t}\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\n\t\t\tvar fixedStatement = (FixedStatement)method.Body.Statements.Last();\n\t\t\tvar content = fixedStatement.EmbeddedStatement;\n\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(content, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotNullInvocation()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tobject NotNull() {\n\t\treturn 1;\n\t}\n\n\tvoid TestMethod()\n\t{\n\t\tstring p1 = NotNull();\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotNullDelegateInvocation()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Delegate)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\n[JetBrains.Annotations.NotNull]\ndelegate object NotNullDelegate();\nclass TestClass\n{\n\tNotNullDelegate myDelegate;\n\tvoid TestMethod()\n\t{\n\t\tstring p1 = myDelegate();\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotNullField()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Field)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tstring x = \"\"\"\";\n\tvoid TestMethod()\n\t{\n\t\tstring p1 = this.x;\n\t\tstring p2 = x;\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p2\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorOut()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass CanBeNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tpublic TestClass([JetBrains.Annotations.CanBeNull] out string o) {\n\t\to = null;\n\t}\n\t\n\tvoid TestMethod()\n\t{\n\t\tstring p1;\n\t\tnew TestClass(out p1);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorNamedOut()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass CanBeNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tpublic TestClass([JetBrains.Annotations.CanBeNull] out string o) {\n\t\to = null;\n\t}\n\t\n\tvoid TestMethod()\n\t{\n\t\tstring p1;\n\t\tnew TestClass(o: out p1);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodOut()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass CanBeNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tvoid TestMethod([JetBrains.Annotations.CanBeNull] out string o) {\n\t\to = null;\n\t}\n\t\n\tvoid TestMethod()\n\t{\n\t\tstring p1;\n\t\tTestMethod(out p1);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.PotentiallyNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"p1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid Assert([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_TRUE)] bool condition, string message) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssert(x != null, \"\"x is null\"\");\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion2()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid Assert([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_TRUE)] bool condition, string message) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssert(message: \"\"x is null\"\", condition: x != null);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion3()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid Assert([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_TRUE)] bool condition = false) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssert();\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion4()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid Assert([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_FALSE)] bool condition = true) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssert();\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion5()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid Assert([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_FALSE)] bool condition = false) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssert();\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreNotEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion6()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid AssertNotNull([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_NOT_NULL)] object condition) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssertNotNull(x);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion7()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid Assert([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_FALSE)] bool condition) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssert(x == null);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.DefinitelyNotNull, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion8()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid AssertNotNull([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_NOT_NULL)] string condition = \"\"x\"\") {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssertNotNull();\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreNotEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssertion9()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar tree = parser.Parse(@\"\nnamespace JetBrains.Annotations\n{\n\tenum AssertionConditionType\n\t{\n\t\tIS_FALSE,\n\t\tIS_TRUE,\n\t\tIS_NULL,\n\t\tIS_NOT_NULL\n\t}\n\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass AssertionConditionAttribute : System.Attribute\n\t{\n\t\tpublic AssertionConditionAttribute(AssertionConditionType conditionType) {}\n\t}\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass AssertionMethodAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.AssertionMethod]\n\tvoid AssertNotNull([JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_NOT_NULL)] object condition) {\n\t}\n\t\n\tvoid TestMethod(string x)\n\t{\n\t\tAssertNotNull(null);\n\t}\n}\n\", \"test.cs\");\n\t\t\tAssert.AreEqual(0, tree.Errors.Count);\n\t\t\t\n\t\t\tvar method = tree.Descendants.OfType<MethodDeclaration>().Last();\n\t\t\tvar analysis = CreateNullValueAnalysis(tree, method);\n\t\t\t\n\t\t\tvar lastStatement = method.Body.Statements.Last();\n\t\t\t\n\t\t\tAssert.AreEqual(NullValueStatus.UnreachableOrInexistent, analysis.GetVariableStatusAfterStatement(lastStatement, \"x\"));\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Analysis/SemanticHighlightingTests.cs",
    "content": "﻿//\n// SemanticHighlightingTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\nusing System.Reflection;\nusing System.Text;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.CSharp.Analysis\n{\n\t[TestFixture]\n\tpublic class SemanticHighlightingTests : SemanticHighlightingVisitor<FieldInfo>\n\t{\n\t\tstatic void SetupColors(object o)\n\t\t{\n\t\t\tvar fields = typeof(SemanticHighlightingVisitor<FieldInfo>).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);\n\t\t\tforeach (var field in fields) {\n\t\t\t\tif (field.FieldType == typeof(FieldInfo))\n\t\t\t\t\tfield.SetValue(o, field);\n\t\t\t}\n\t\t}\n\t\tprotected override void Colorize(TextLocation start, TextLocation end, FieldInfo color)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\n\t\t[SetUp]\n\t\tpublic void Setup ()\n\t\t{\n\t\t\tSetupColors (this);\n\t\t}\n\n\t\tclass TestSemanticHighlightingVisitor : SemanticHighlightingVisitor<FieldInfo>\n\t\t{\n\n\t\t\tpublic TestSemanticHighlightingVisitor(CSharpAstResolver resolver)\n\t\t\t{\n\t\t\t\tbase.resolver = resolver;\n\t\t\t\tthis.regionStart = new TextLocation (1, 1);\n\t\t\t\tthis.regionEnd = new TextLocation (int.MaxValue, int.MaxValue);\n\t\t\t\tSetupColors(this);\n\t\t\t}\n\n\t\t\tList<Tuple<DomRegion, string>> colors = new List<Tuple<DomRegion, string>> ();\n\n\t\t\tprotected override void Colorize(TextLocation start, TextLocation end, FieldInfo color)\n\t\t\t{\n\t\t\t\tcolors.Add (Tuple.Create (new DomRegion (start, end), color != null ? color.Name : null));\n\t\t\t}\n\n\t\t\tpublic string GetColor(TextLocation loc)\n\t\t\t{\n\t\t\t\tforeach (var color in colors) {\n\t\t\t\t\tif (color.Item1.Contains (loc))\n\t\t\t\t\t\treturn color.Item2;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tstatic TestSemanticHighlightingVisitor CreateHighighting (string text)\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse (text, \"a.cs\");\n\t\t\tif (syntaxTree.Errors.Count > 0) {\n\t\t\t\tConsole.WriteLine (text);\n\t\t\t\tConsole.WriteLine(\"---\");\n\t\t\t\tsyntaxTree.Errors.ForEach (err => Console.WriteLine (err.Message));\n\t\t\t\tAssert.Fail (\"parse error.\");\n\t\t\t}\n\t\t\tvar project = new CSharpProjectContent().AddAssemblyReferences(new [] { CecilLoaderTests.Mscorlib, CecilLoaderTests.SystemCore });\n\t\t\tvar file = syntaxTree.ToTypeSystem();\n\t\t\tproject = project.AddOrUpdateFiles(file);\n\n\t\t\tvar resolver = new CSharpAstResolver(project.CreateCompilation(), syntaxTree, file);\n\t\t\tvar result = new TestSemanticHighlightingVisitor (resolver);\n\t\t\tsyntaxTree.AcceptVisitor (result);\n\t\t\treturn result;\n\t\t}\n\n\t\tvoid TestColor(string text, FieldInfo keywordColor)\n\t\t{\n\t\t\tvar sb = new StringBuilder ();\n\t\t\tvar offsets = new List<int> ();\n\t\t\tforeach (var ch in text) {\n\t\t\t\tif (ch == '$') {\n\t\t\t\t\toffsets.Add (sb.Length);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append (ch);\n\t\t\t}\n\t\t\tvar visitor = CreateHighighting (sb.ToString ());\n\t\t\tvar doc = new ReadOnlyDocument (sb.ToString ());\n\n\t\t\tforeach (var offset in offsets) {\n\t\t\t\tvar loc = doc.GetLocation (offset);\n\t\t\t\tvar color = visitor.GetColor (loc) ?? \"defaultTextColor\";\n\t\t\t\tAssert.AreEqual (keywordColor.Name, color, \"Color at \" + loc + \" is wrong:\" + color);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class $Class { }\", referenceTypeColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStructDeclaration()\n\t\t{\n\t\t\tTestColor (@\"struct $Class { }\", valueTypeColor);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInterfaceDeclaration()\n\t\t{\n\t\t\tTestColor (@\"interface $Class { }\", interfaceTypeColor);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestEnumDeclaration()\n\t\t{\n\t\t\tTestColor (@\"enum $Class { }\", enumerationTypeColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDelegateDeclaration()\n\t\t{\n\t\t\tTestColor (@\"delegate void $Class();\", delegateTypeColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameter()\n\t\t{\n\t\t\tTestColor (@\"class Class<$T> where $T : class { void Foo<$Tx> () where $Tx : $T {} } \", typeParameterTypeColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { void $Foo () {} }\", methodDeclarationColor);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMethodCall()\n\t\t{\n\t\t\tTestColor (@\"class Class { void Foo () { $Foo (); } }\", methodCallColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { int $foo; }\", fieldDeclarationColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldAccess()\n\t\t{\n\t\t\tTestColor (@\"using System; class Class {  int Bar; void Foo () { Console.WriteLine ($Bar); } }\", fieldAccessColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { int $Foo { get; set; } }\", propertyDeclarationColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyAccess()\n\t\t{\n\t\t\tTestColor (@\"using System; class Class { int Bar {get; set; } void Foo () { Console.WriteLine ($Bar); } }\", propertyAccessColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEventDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { event System.EventHandler $Foo, $Bar; }\", eventDeclarationColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCustomEventDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { event System.EventHandler $Foo { add {} remove {} } }\", eventDeclarationColor);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestEventAccess()\n\t\t{\n\t\t\tTestColor (@\"class Class {  event System.EventHandler Bar; void Foo () { $Bar += (o, s) => {}; } }\", eventAccessColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodParameterDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { void Foo (int $a, string $b) {} }\", parameterDeclarationColor);\n\t\t}\n\t\t[Test]\n\t\tpublic void TestMethodParameterAccess()\n\t\t{\n\t\t\tTestColor (@\"class Class { void Foo (int a, string b) { int c = $a + $b;} }\", parameterAccessColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerParameterDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { int this[int $a, string $b] { get { } } }\", parameterDeclarationColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerParameterAccess()\n\t\t{\n\t\t\tTestColor (@\"class Class { int this[int a, string b] { get { return $a + $b; } } }\", parameterAccessColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVariableDeclaration()\n\t\t{\n\t\t\tTestColor (@\"class Class { void Test () { int $bar, $foo; } }\", variableDeclarationColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVariableAccess()\n\t\t{\n\t\t\tTestColor (@\"class Class { void Test () { int bar, foo; int c = $foo + $bar; } }\", variableAccessColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValueKeywordInPropertySetter()\n\t\t{\n\t\t\tTestColor (@\"class Class { int Property { get {} set { test = $value; } } }\", valueKeywordColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValueKeywordInPropertyGetter()\n\t\t{\n\t\t\tTestColor (@\"class Class { int value; int Property { get { return $value; } set { } } }\", fieldAccessColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValueKeywordInCustomEvent()\n\t\t{\n\t\t\tTestColor (@\"using System;\nclass Class {\n\tpublic event EventHandler Property { \n\t\tadd { Console.WriteLine ($value); } \n\t\tremove { Console.WriteLine ($value); }\n\t}\n}\", valueKeywordColor);\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestExternAliasKeyword()\n\t\t{\n\t\t\tTestColor (@\"extern $alias FooBar;\", externAliasKeywordColor);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9539 - Semantic highlighting does not detect invalid type\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9539()\n\t\t{\n\t\t\tstring code =@\"class C<T>\n\t\t{\n\t\t\tpublic class N<U>\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass A\n\t\t{\n\t\t\tpublic static int Main ()\n\t\t\t{\n\t\t\t\tvar a = typeof (C<>.$N<,>); // The type is not red even if this linedoes not compile\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\";\n\t\t\tTestColor (code, syntaxErrorColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullTypeError()\n\t\t{\n\t\t\tstring code =@\"\n\t\tclass A\n\t\t{\n\t\t\tpublic static void Main ()\n\t\t\t{\n\t\t\t\t$var a = null;\n\t\t\t}\n\t\t}\n\";\n\t\t\tTestColor (code, syntaxErrorColor);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestVarColorUserTypeCase()\n\t\t{\n\t\t\tstring code =@\"class var {\n\t\t\t$var aVar;\n\t\t\tpublic static void Main ()\n\t\t\t{\n\t\t\t\t$var a = new $var ();\n\t\t\t}\n\t\t}\n\";\n\t\t\tTestColor (code, referenceTypeColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVarColor()\n\t\t{\n\t\t\tTestColor (@\"class MyClass {\n\t\t\tpublic static void Main ()\n\t\t\t{\n\t\t\t\t$var a = 344;\n\t\t\t\tforeach ($var b in new [] { 1,2, 3}) {}\n\t\t\t}\n\t\t}\n\", varKeywordTypeColor);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestStringFormatItemColor()\n\t\t{\n\t\t\tTestColor (@\"using System;\nclass MyClass {\n\t\t\tpublic static void Main ()\n\t\t\t{\n\t\t\t\tstring str = string.Format (\"\" ${0} ${1} ${2} \"\", 1, 2, 3);\n\t\t\t}\n\t\t}\n\", stringFormatItemColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStringFormatItemInVerbatimStringColor()\n\t\t{\n\t\t\tTestColor (\"using System;\\nclass MyClass {\\n\\npublic static void Main () { Console.WriteLine (@\\\" ${0}\\n ${1} \\n\\n ${2} \\\", 1, 2, 3); } }\", stringFormatItemColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFormatItemBug()\n\t\t{\n\t\t\tTestColor (@\"using System;\nclass MyClass {\n\t\t\tpublic static void Main ()\n\t\t\t{\n\t\t\t\tstring str = string.Format (\"\" ${{ {0} {1} {2} $}} \"\", 1, 2, 3);\n\t\t\t}\n\t\t}\n\", defaultTextColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInactiveConditionalCall()\n\t\t{\n\t\t\tTestColor (@\"using System.Diagnostics;\n\nclass Test\n{\n\t[Conditional(\"\"FOO\"\")]\n\tpublic void Test22()\n\t{\n\t}\n\n\tpublic void Foo()\n\t{\n\t\t$Test22();\n\t}\n}\n\", inactiveCodeColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInactiveConditionalCallOverrideTest()\n\t\t{\n\t\t\tTestColor (@\"using System.Diagnostics;\nclass TestBase\n{\n\t[Conditional(\"\"FOO\"\")]\n\tpublic virtual void Test22()\n\t{\n\t}\n}\n\n\nclass Test : TestBase\n{\n\tpublic override void Test22()\n\t{\n\t}\n\n\tpublic void Foo()\n\t{\n\t\t$Test22();\n\t}\n}\n\", inactiveCodeColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInactivePartialCall()\n\t\t{\n\t\t\tTestColor (@\"using System.Diagnostics;\n\npartial class Test\n{\n\tpartial void FooBar();\n}\n\npartial class Test\n{\n\tpublic void Foo()\n\t{\n\t\t$FooBar();\n\t}\n}\n\", inactiveCodeColor);\n\t\t}\n\t\n\n\t\t/// <summary>\n\t\t/// Bug 17011 - XS does not recognize StringBuilder::AppendFormat \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17011()\n\t\t{\n\t\t\tTestColor (@\"\nusing System.Text;\n\nclass TestClass\n{\n\tvoid Foo(StringBuilder sb)\n\t{\n\t\tsb.AppendFormat(\"\"${0} ${1}\"\", 1, 2);\n\t}\n}\", stringFormatItemColor);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t///Bug 22247 - Wrong colouring of escaped string formater\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug22247()\n\t\t{\n\t\t\tTestColor (@\"\nclass X\n{\n\tpublic static void Main ()\n\t{\n\t\tvar l = string.Format(\"\"{{{0:d}$}$}\"\", 100);\n\t}\n}\", defaultTextColor);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStringFormatClosingBrace()\n\t\t{\n\t\t\tTestColor (@\"\nusing System.Text;\n\nclass TestClass\n{\n\tvoid Foo(StringBuilder sb)\n\t{\n\t\tsb.AppendFormat(\"\"{0$}\"\", 1, 2);\n\t}\n}\", stringFormatItemColor);\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/AstStructureTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Reflection;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[TestFixture]\n\tpublic class AstStructureTests\n\t{\n\t\t[Test]\n\t\tpublic void RolesAreStaticReadOnly ()\n\t\t{\n\t\t\tforeach (Type type in typeof(AstNode).Assembly.GetExportedTypes()) {\n\t\t\t\tif (type.IsSubclassOf (typeof(AstNode))) {\n\t\t\t\t\tforeach (FieldInfo field in type.GetFields()) {\n\t\t\t\t\t\tif (field.FieldType.IsSubclassOf(typeof(Role))) {\n\t\t\t\t\t\t\tAssert.IsTrue(field.IsPublic, field + \" should be public\");\n\t\t\t\t\t\t\tAssert.IsTrue(field.IsStatic, field + \" should be static\");\n\t\t\t\t\t\t\tAssert.IsTrue(field.IsInitOnly, field + \" should be readonly\");\n\t\t\t\t\t\t\tAssert.That(field.Name, Is.StringEnding(\"Role\"));\n\t\t\t\t\t\t\tAssert.IsNotNull(field.GetValue(null), field + \" should not have null value\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AstNodesDoNotDeriveFromEachOther()\n\t\t{\n\t\t\t// Ast nodes should derive only from abstract classes; not from concrete types.\n\t\t\t// For example, we want to avoid that an AST consumer doing \"if (node is PropertyDeclaration)\"\n\t\t\t// unknowingly also handles IndexerDeclarations.\n\t\t\tforeach (Type type in typeof(AstNode).Assembly.GetExportedTypes()) {\n\t\t\t\tif (type == typeof(CSharpModifierToken)) // CSharpModifierToken is the exception (though I'm not too happy about that)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (typeof(PreProcessorDirective).IsAssignableFrom (type)) // another exception - is it useful or not ?\n\t\t\t\t\tcontinue;\n\t\t\t\tif (type.IsSubclassOf(typeof(AstNode))) {\n\t\t\t\t\tAssert.IsTrue(type.BaseType.IsAbstract, type.FullName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullNodesCallVisitNullNode()\n\t\t{\n\t\t\tforeach (Type type in typeof(AstNode).Assembly.GetExportedTypes()) {\n\t\t\t\tif (type.IsSubclassOf(typeof(AstNode))) {\n\t\t\t\t\tvar nullField = type.GetField(\"Null\");\n\t\t\t\t\tif (nullField != null) {\n\t\t\t\t\t\tAstNode nullNode = (AstNode)nullField.GetValue(null);\n\t\t\t\t\t\tAssert.IsTrue(nullNode.IsNull, nullNode.GetType().Name + \" should be a null node\");\n\t\t\t\t\t\tvar v1 = new VisitNullNodeTest();\n\t\t\t\t\t\tvar v2 = new VisitNullNodeTest<string>();\n\t\t\t\t\t\tvar v3 = new VisitNullNodeTest<string, string>();\n\t\t\t\t\t\tnullNode.AcceptVisitor(v1);\n\t\t\t\t\t\tnullNode.AcceptVisitor(v2);\n\t\t\t\t\t\tnullNode.AcceptVisitor(v3, null);\n\t\t\t\t\t\tAssert.IsTrue(v1.called, nullNode.GetType().Name + \" should call 'void VisitNullNode();'\");\n\t\t\t\t\t\tAssert.IsTrue(v2.called, nullNode.GetType().Name + \" should call 'T VisitNullNode();'\");\n\t\t\t\t\t\tAssert.IsTrue(v3.called, nullNode.GetType().Name + \" should call 'S VisitNullNode(T data);'\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass VisitNullNodeTest : DepthFirstAstVisitor \n\t\t{\n\t\t\tinternal bool called;\n\t\t\tpublic override void VisitNullNode(AstNode nullNode)\n\t\t\t{\n\t\t\t\tcalled = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass VisitNullNodeTest<T> : DepthFirstAstVisitor<T> \n\t\t{\n\t\t\tinternal bool called;\n\t\t\tpublic override T VisitNullNode(AstNode nullNode)\n\t\t\t{\n\t\t\t\tcalled = true;\n\t\t\t\treturn base.VisitNullNode(nullNode);\n\t\t\t}\n\t\t}\n\t\t\n\t\tclass VisitNullNodeTest<T, S> : DepthFirstAstVisitor<T, S> \n\t\t{\n\t\t\tinternal bool called;\n\t\t\tpublic override S VisitNullNode(AstNode nullNode, T data)\n\t\t\t{\n\t\t\t\tcalled = true;\n\t\t\t\treturn base.VisitNullNode(nullNode, data);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/AstTests.cs",
    "content": "//\n// AstTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[TestFixture]\n\n\tpublic class AstTests\n\t{\n\t\t[Test]\n\t\tpublic void TestDescendants ()\n\t\t{\n\t\t\tvar tree = SyntaxTree.Parse(@\"class Test\n{\n\tvoid Foo()\n\t{\n\t\tCall1();\n\t\t{\n\t\t\tCall2();\n\t\t}\n\t\tCall3();\n\t}\n}\");\n\t\t\tvar method = tree.GetNodeAt<MethodDeclaration>(6, 1);\n\t\t\t// Body, Call1, Block, Call2 and Call 3\n\t\t\tAssert.AreEqual(5, method.DescendantNodes().Count(n => n is Statement)); \n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDescendantsWithPredicate ()\n\t\t{\n\t\t\tvar tree = SyntaxTree.Parse(@\"class Test\n{\n\tvoid Foo()\n\t{\n\t\tCall1();\n\t\t{\n\t\t\tCall2();\n\t\t}\n\t\tCall3();\n\t}\n}\");\n\t\t\tvar method = tree.GetNodeAt<MethodDeclaration>(6, 1);\n\t\t\t// Body, Call1, Block and Call 3 - NOT call2\n\t\t\tvar childs = method.DescendantNodes(child => !(child is BlockStatement) || (((BlockStatement)child).Parent is MethodDeclaration)).Where(n => n is Statement).ToList();\n\t\t\tAssert.AreEqual(4, childs.Count); \n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetNodesBetween()\n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar expr = parser.ParseExpression(\"a*b+c*d\");\n\t\t\tvar nodes = expr.GetNodesBetween(1, 3, 1, 6).ToList();\n\t\t\tAssert.AreEqual(new[] { \"b\", \"+\", \"c\" }, nodes.Select(n => n.ToString()).ToList());\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpAmbienceTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[TestFixture]\n\tpublic class CSharpAmbienceTests\n\t{\n\t\tIUnresolvedAssembly mscorlib;\n\t\tIUnresolvedAssembly myLib;\n\t\tICompilation compilation;\n\t\tCSharpAmbience ambience;\n\t\t\n\t\tpublic CSharpAmbienceTests()\n\t\t{\n\t\t\tambience = new CSharpAmbience();\n\t\t\tmscorlib = CecilLoaderTests.Mscorlib;\n\t\t\tvar loader = new CecilLoader();\n\t\t\tloader.IncludeInternalMembers = true;\n\t\t\tmyLib = loader.LoadAssemblyFile(typeof(CSharpAmbienceTests).Assembly.Location);\n\t\t\tcompilation = new SimpleCompilation(myLib, mscorlib);\n\t\t}\n\t\t\n\t\t#region ITypeDefinition tests\n\t\t[Test]\n\t\tpublic void GenericType()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(Dictionary<,>)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.ShowTypeParameterList;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.Dictionary<TKey, TValue>\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericTypeShortName()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(Dictionary<,>)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.ShowTypeParameterList;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"Dictionary<TKey, TValue>\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleType()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(Object)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.ShowTypeParameterList;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.Object\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleTypeDefinition()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(Object)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.All & ~(ConversionFlags.UseFullyQualifiedEntityNames);\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"public class Object\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleTypeDefinitionWithoutModifiers()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(Object)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.All & ~(ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.ShowModifiers | ConversionFlags.ShowAccessibility);\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"class Object\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericTypeDefinitionFull()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(List<>)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.All;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"public class System.Collections.Generic.List<T>\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericInterfaceFull()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(IEnumerable<>)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.All;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"public interface System.Collections.Generic.IEnumerable<out T>\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleTypeShortName()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(Object)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.ShowTypeParameterList;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"Object\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericTypeWithNested()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(List<>.Enumerator)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.UseFullyQualifiedEntityNames | ConversionFlags.ShowTypeParameterList;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List<T>.Enumerator\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericTypeWithNestedShortName()\n\t\t{\n\t\t\tvar typeDef = compilation.FindType(typeof(List<>.Enumerator)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.ShowDeclaringType | ConversionFlags.ShowTypeParameterList;\n\t\t\tstring result = ambience.ConvertSymbol(typeDef);\n\t\t\t\n\t\t\tAssert.AreEqual(\"List<T>.Enumerator\", result);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Delegate tests\n\t\t[Test]\n\t\tpublic void DelegateName()\n\t\t{\n\t\t\tvar func = compilation.FindType(typeof(Func<,>)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.ShowTypeParameterList;\n\t\t\t\n\t\t\tAssert.AreEqual(\"Func<in T, out TResult>\", ambience.ConvertSymbol(func));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FullDelegate()\n\t\t{\n\t\t\tvar func = compilation.FindType(typeof(Func<,>)).GetDefinition();\n\t\t\tambience.ConversionFlags = ConversionFlags.All;\n\t\t\tAssert.AreEqual(\"public delegate TResult System.Func<in T, out TResult>(T arg);\", ambience.ConvertSymbol(func));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region IField tests\n\t\t[Test]\n\t\tpublic void SimpleField()\n\t\t{\n\t\t\tvar field = compilation.FindType(typeof(CSharpAmbienceTests.Program)).GetFields(f => f.Name == \"test\").Single();\n\t\t\tambience.ConversionFlags = ConversionFlags.All;\n\t\t\tstring result = ambience.ConvertSymbol(field);\n\t\t\t\n\t\t\tAssert.AreEqual(\"private int ICSharpCode.NRefactory.CSharp.CSharpAmbienceTests.Program.test;\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleConstField()\n\t\t{\n\t\t\tvar field = compilation.FindType(typeof(CSharpAmbienceTests.Program)).GetFields(f => f.Name == \"TEST2\").Single();\n\t\t\tambience.ConversionFlags = ConversionFlags.All;\n\t\t\tstring result = ambience.ConvertSymbol(field);\n\t\t\t\n\t\t\tAssert.AreEqual(\"private const int ICSharpCode.NRefactory.CSharp.CSharpAmbienceTests.Program.TEST2;\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleFieldWithoutModifiers()\n\t\t{\n\t\t\tvar field = compilation.FindType(typeof(CSharpAmbienceTests.Program)).GetFields(f => f.Name == \"test\").Single();\n\t\t\tambience.ConversionFlags = ConversionFlags.All & ~(ConversionFlags.ShowDeclaringType | ConversionFlags.ShowModifiers | ConversionFlags.ShowAccessibility);\n\t\t\tstring result = ambience.ConvertSymbol(field);\n\t\t\t\n\t\t\tAssert.AreEqual(\"int test;\", result);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region IEvent tests\n\t\t[Test]\n\t\tpublic void EventWithDeclaringType()\n\t\t{\n\t\t\tvar ev = compilation.FindType(typeof(CSharpAmbienceTests.Program)).GetEvents(f => f.Name == \"ProgramChanged\").Single();\n\t\t\tambience.ConversionFlags = ConversionFlags.StandardConversionFlags | ConversionFlags.ShowDeclaringType;\n\t\t\tstring result = ambience.ConvertSymbol(ev);\n\t\t\t\n\t\t\tAssert.AreEqual(\"public event EventHandler Program.ProgramChanged;\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CustomEvent()\n\t\t{\n\t\t\tvar ev = compilation.FindType(typeof(CSharpAmbienceTests.Program)).GetEvents(f => f.Name == \"SomeEvent\").Single();\n\t\t\tambience.ConversionFlags = ConversionFlags.StandardConversionFlags;\n\t\t\tstring result = ambience.ConvertSymbol(ev);\n\t\t\t\n\t\t\tAssert.AreEqual(\"public event EventHandler SomeEvent;\", result);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Property tests\n\t\t[Test]\n\t\tpublic void AutomaticProperty()\n\t\t{\n\t\t\tvar prop = compilation.FindType(typeof(CSharpAmbienceTests.Program)).GetProperties(p => p.Name == \"Test\").Single();\n\t\t\tambience.ConversionFlags = ConversionFlags.StandardConversionFlags;\n\t\t\tstring result = ambience.ConvertSymbol(prop);\n\t\t\t\n\t\t\tAssert.AreEqual(\"public int Test { get; set; }\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Indexer()\n\t\t{\n\t\t\tvar prop = compilation.FindType(typeof(CSharpAmbienceTests.Program)).GetProperties(p => p.IsIndexer).Single();\n\t\t\tambience.ConversionFlags = ConversionFlags.StandardConversionFlags;\n\t\t\tstring result = ambience.ConvertSymbol(prop);\n\t\t\t\n\t\t\tAssert.AreEqual(\"public int this[int index] { get; }\", result);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Test types\n\t\t#pragma warning disable 169, 67\n\t\t\n\t\tclass Test {}\n\t\t\n\t\tclass Program\n\t\t{\n\t\t\tint test;\n\t\t\tconst int TEST2 = 2;\n\t\t\t\n\t\t\tpublic int Test { get; set; }\n\t\t\t\n\t\t\tpublic int this[int index] {\n\t\t\t\tget {\n\t\t\t\t\treturn index;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic event EventHandler ProgramChanged;\n\t\t\t\n\t\t\tpublic event EventHandler SomeEvent {\n\t\t\t\tadd {}\n\t\t\t\tremove {}\n\t\t\t}\n\t\t\t\n\t\t\tpublic static bool operator +(Program lhs, Program rhs)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic static implicit operator Test(Program lhs)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic static explicit operator int(Program lhs)\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\t\n\t\t\tpublic Program(int x)\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t~Program()\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tpublic static void Main(string[] args)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Hello World!\");\n\t\t\t\t\n\t\t\t\tConsole.Write(\"Press any key to continue . . . \");\n\t\t\t\tConsole.ReadKey(true);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[TestFixture]\n\tpublic class CSharpOutputVisitorTests\n\t{\n\t\tvoid AssertOutput(string expected, AstNode node, CSharpFormattingOptions policy = null)\n\t\t{\n\t\t\tif (policy == null)\n\t\t\t\tpolicy = FormattingOptionsFactory.CreateMono();\n\t\t\tStringWriter w = new StringWriter();\n\t\t\tw.NewLine = \"\\n\";\n\t\t\tnode.AcceptVisitor(new CSharpOutputVisitor(new TextWriterTokenWriter(w) { IndentationString = \"$\" }, policy));\n\t\t\tAssert.AreEqual(expected.Replace(\"\\r\", \"\"), w.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AnonymousLocalVariableDeclaration()\n\t\t{\n\t\t\tvar code = @\"class Test\n{\n\tvoid Foo ()\n\t{\n\t\tAction<int> act = delegate (int testMe) {\n\t\t};\n\t}\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tAssertOutput(\"class Test\\n{\\n$void Foo ()\\n${\\n$$Action<int> act = delegate (int testMe) {\\n$$};\\n$}\\n}\\n\", unit);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssignmentInCollectionInitializer()\n\t\t{\n\t\t\tExpression expr = new ObjectCreateExpression {\n\t\t\t\tType = new SimpleType(\"List\"),\n\t\t\t\tInitializer = new ArrayInitializerExpression(\n\t\t\t\t\tnew ArrayInitializerExpression(\n\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"a\"), new PrimitiveExpression(1))\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t};\n\t\t\t\n\t\t\tAssertOutput(\"new List {\\n${\\n$$a = 1\\n$}\\n}\", expr);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumDeclarationWithInitializers ()\n\t\t{\n\t\t\tTypeDeclaration type = new TypeDeclaration {\n\t\t\t\tClassType = ClassType.Enum,\n\t\t\t\tName = \"DisplayFlags\",\n\t\t\t\tMembers = {\n\t\t\t\t\tnew EnumMemberDeclaration {\n\t\t\t\t\t\tName = \"D\",\n\t\t\t\t\t\tInitializer = new PrimitiveExpression(4)\n\t\t\t\t\t}\n\t\t\t\t}};\n\t\t\t\n\t\t\tAssertOutput(\"enum DisplayFlags\\n{\\n$D = 4\\n}\\n\", type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InlineCommentAtEndOfCondition()\n\t\t{\n\t\t\tIfElseStatement condition = new IfElseStatement();\n\t\t\tcondition.AddChild(new CSharpTokenNode(new TextLocation(1, 1), IfElseStatement.IfKeywordRole), IfElseStatement.IfKeywordRole);\n\t\t\tcondition.AddChild(new CSharpTokenNode(new TextLocation(1, 4), Roles.LPar), Roles.LPar);\n\t\t\tcondition.AddChild(new IdentifierExpression(\"cond\", new TextLocation(1, 5)), IfElseStatement.ConditionRole);\n\t\t\tcondition.AddChild(new Comment(CommentType.MultiLine, new TextLocation(1, 9), new TextLocation(1, 14)) { Content = \"a\" }, Roles.Comment);\n\t\t\tcondition.AddChild(new CSharpTokenNode(new TextLocation(1, 14), Roles.RPar), Roles.RPar);\n\t\t\tcondition.AddChild(new ReturnStatement(), IfElseStatement.TrueRole);\n\t\t\t\n\t\t\tAssertOutput(\"if (cond/*a*/)\\n$return;\\n\", condition);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SwitchStatement()\n\t\t{\n\t\t\tSwitchStatement type = new SwitchStatement {\n\t\t\t\tExpression = new IdentifierExpression(\"i\"),\n\t\t\t\tSwitchSections = {\n\t\t\t\t\tnew SwitchSection {\n\t\t\t\t\t\tCaseLabels = {\n\t\t\t\t\t\t\tnew CaseLabel(new PrimitiveExpression(1)),\n\t\t\t\t\t\t\tnew CaseLabel(new PrimitiveExpression(2))\n\t\t\t\t\t\t},\n\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\tnew ExpressionStatement(new IdentifierExpression(\"A\").Invoke()),\n\t\t\t\t\t\t\tnew ExpressionStatement(new IdentifierExpression(\"B\").Invoke()),\n\t\t\t\t\t\t\tnew BreakStatement()\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew SwitchSection {\n\t\t\t\t\t\tCaseLabels = {\n\t\t\t\t\t\t\tnew CaseLabel(new PrimitiveExpression(3))\n\t\t\t\t\t\t},\n\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\tnew BlockStatement {\n\t\t\t\t\t\t\t\tnew VariableDeclarationStatement(new PrimitiveType(\"int\"), \"a\", new PrimitiveExpression(3)),\n\t\t\t\t\t\t\t\tnew ReturnStatement(new IdentifierExpression(\"a\")),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew SwitchSection {\n\t\t\t\t\t\tCaseLabels = {\n\t\t\t\t\t\t\tnew CaseLabel()\n\t\t\t\t\t\t},\n\t\t\t\t\t\tStatements = {\n\t\t\t\t\t\t\tnew BreakStatement()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}};\n\t\t\t\n\t\t\tAssertOutput(\"switch (i) {\\ncase 1:\\ncase 2:\\n$A ();\\n$B ();\\n$break;\\n\" +\n\t\t\t             \"case 3: {\\n$int a = 3;\\n$return a;\\n}\\n\" +\n\t\t\t             \"default:\\n$break;\\n}\\n\", type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ZeroLiterals()\n\t\t{\n\t\t\tAssertOutput(\"0.0\", new PrimitiveExpression(0.0));\n\t\t\tAssertOutput(\"-0.0\", new PrimitiveExpression(-0.0));\n\t\t\tAssertOutput(\"0f\", new PrimitiveExpression(0f));\n\t\t\tAssertOutput(\"-0f\", new PrimitiveExpression(-0f));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BlankLinesBetweenMembers()\n\t\t{\n\t\t\tvar code = @\"class Test\n{\n\tTest() {}\n\tvoid Foo() {}\n\tint P { get; set; }\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tvar options = FormattingOptionsFactory.CreateMono();\n\t\t\toptions.MinimumBlankLinesBetweenMembers = 2;\n\t\t\tAssertOutput(\"class Test\\n{\\n$Test ()\\n${\\n$}\\n\\n\\n$void Foo ()\\n${\\n$}\\n\\n\\n$int P {\\n$$get;\\n$$set;\\n$}\\n}\\n\", unit, options);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BlankLinesAfterUsings() {\n\t\t\tvar code = @\"using System;\nusing System.Collections;\nusing List = System.Collections.List;\nnamespace NS\n{\n\tusing System.Collections.Generic;\n\tusing Collection = System.Collections.Collection;\n\tusing System.Xml;\n\tclass C {}\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tvar options = FormattingOptionsFactory.CreateMono();\n\t\t\toptions.MinimumBlankLinesAfterUsings = 2;\n\t\t\tAssertOutput(\"using System;\\nusing System.Collections;\\nusing List = System.Collections.List;\\n\\n\\nnamespace NS\\n{\\n$using System.Collections.Generic;\\n$using Collection = System.Collections.Collection;\\n$using System.Xml;\\n\\n\\n$class C\\n${\\n$}\\n}\\n\", unit, options);\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"#pragma warning not implemented in output visitor - issue #188\")]\n\t\tpublic void PragmaWarning()\n\t\t{\n\t\t\tvar code = @\"#pragma warning disable 414\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tvar options = FormattingOptionsFactory.CreateMono();\n\t\t\tAssertOutput(\"#pragma warning disable 414\\n\", unit, options);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AbstractAndVirtualConversionActionTests.cs",
    "content": "//\n// AbstractAndVirtualConversionActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class AbstractAndVirtualConversionActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void VirtualToNonVirtualTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"class Test\n{\n\tpublic $virtual void Foo ()\n\t{\n\t}\n}\", @\"class Test\n{\n\tpublic void Foo ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void VirtualToAbstractTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"abstract class Test\n{\n\tpublic $virtual void Foo ()\n\t{\n\t}\n}\", @\"abstract class Test\n{\n\tpublic abstract void Foo ();\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void VirtualIndexerToAbstractTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"abstract class MainClass\n{\n\tpublic virtual int $this [int i] {\n\t\tget {\n\t\t\t;\n\t\t}\n\t}\n}\", @\"abstract class MainClass\n{\n\tpublic abstract int this [int i] {\n\t\tget;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void NonVirtualStaticToVirtualTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"class Test\n{\n\tpublic static void $Foo ()\n\t{\n\t}\n}\", @\"class Test\n{\n\tpublic virtual void Foo ()\n\t{\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void NonVirtualToVirtualTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"class Test\n{\n\tpublic void $Foo ()\n\t{\n\t}\n}\", @\"class Test\n{\n\tpublic virtual void Foo ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvalidPrivateImplementationTypeTest()\n\t\t{\n\t\t\tTestWrongContext<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"using System;\nclass Test : IDisposable\n{\n\tvoid IDisposable.$Dispose ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AbstractToNonAbstractTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"abstract class Test\n{\n\tpublic $abstract void Foo ();\n}\", @\"abstract class Test\n{\n\tpublic void Foo ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AbstractToVirtualTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"abstract class Test\n{\n\tpublic $abstract void Foo ();\n}\", @\"abstract class Test\n{\n\tpublic virtual void Foo ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AbstractPropertyToNonAbstractTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"abstract class Test\n{\n\tpublic abstract int $Foo {\n\t\tget;\n\t\tset;\n\t}\n}\", @\"abstract class Test\n{\n\tpublic int Foo {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AbstractEventToNonAbstractTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"using System;\nabstract class Test\n{\n\tpublic abstract event EventHandler $Foo;\n}\", @\"using System;\nabstract class Test\n{\n\tpublic event EventHandler Foo;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NonAbstractToAbstractTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"abstract class Test\n{\n\tpublic void $Foo ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\", @\"abstract class Test\n{\n\tpublic abstract void Foo ();\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NonAbstractEventToAbstractTest()\n\t\t{\n\t\t\tTest<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"abstract class Test\n{\n\tpublic event EventHandler $Foo  {\n\t\tadd {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tremove {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n}\", @\"abstract class Test\n{\n\tpublic abstract event EventHandler Foo;\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void InvalidLocalContext()\n\t\t{\n\t\t\tTestWrongContext<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"using System;\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint $fooBar = 1;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void InvalidOverrideTest()\n\t\t{\n\t\t\tTestWrongContext<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"using System;\nclass Test\n{\n\tpublic override string $ToString()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvalidMethodTest()\n\t\t{\n\t\t\tvar actions = GetActions<AbstractAndVirtualConversionAction>(\n\t\t\t\t@\"using System;\nabstract class Test\n{\n\tpublic virtual string $ToString()\n\t{\n\t\tConsole.WriteLine (\"\"Hello World\"\");\n\t}\n}\");\n\t\t\t// only virtual -> non virtual should be provided - no abstract conversion\n\t\t\tAssert.AreEqual(1, actions.Count); \n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddAnotherAccessorTests.cs",
    "content": "﻿// \n// AddAnotherAccessorTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class AddAnotherAccessorTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAddSet ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew AddAnotherAccessorAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int $Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\treturn field;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\treturn field;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t\tset {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tfield = value;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAddSet_ReadOnlyField ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew AddAnotherAccessorAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\treadonly int field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int $Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\treturn field;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\treadonly int field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\treturn field;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t\tset {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tthrow new System.NotImplementedException ();\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAddGet ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew AddAnotherAccessorAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int $Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tset {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tfield = value;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\treturn field;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t\tset {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tfield = value;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAutoProperty ()\n\t\t{\n\t\t\tTest<AddAnotherAccessorAction> (@\"class TestClass\n{\n\tstring $Test {\n\t\tget;\n\t}\n}\", @\"class TestClass\n{\n\tstring Test {\n\t\tget;\n\t\tset;\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddArgumentNameTests.cs",
    "content": "﻿// \n// AddArgumentNameTests.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class AddArgumentNameTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void MethodInvocation1()\n\t\t{\n\t\t\tTest<AddArgumentNameAction>(@\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, float c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo($1,b: 2);\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, float c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo (a: 1, b: 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodInvocation2()\n\t\t{\n\t\t\tTest<AddArgumentNameAction>(@\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, float c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo($1, 2);\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, float c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo (a: 1, b: 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AttributeUsage()\n\t\t{\n\t\t\tTest<AddArgumentNameAction>(@\"\nusing System;\npublic class AnyClass\n{\n\t[Obsolete($\"\" \"\", error: true)]\n\tstatic void Old() { }\n}\", @\"\nusing System;\npublic class AnyClass\n{\n\t[Obsolete(message: \"\" \"\", error: true)]\n\tstatic void Old() { }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AttributeNamedArgument()\n\t\t{\n\t\t\tTest<AddArgumentNameAction>(@\"\nclass MyAttribute : System.Attribute\n{\n\tpublic string Name1 { get; set; }\n\tpublic string Name2 { get; set; }\n\tpublic string Name3 { get; set; }\n\tprivate int foo;\n\n\tpublic MyAttribute(int foo)\n\t{\n\t\tthis.foo = foo;\n\t}\n}\n\n\n[My($1, Name1 = \"\"\"\", Name2 = \"\"\"\")]\npublic class Test\n{\n}\n\", @\"\nclass MyAttribute : System.Attribute\n{\n\tpublic string Name1 { get; set; }\n\tpublic string Name2 { get; set; }\n\tpublic string Name3 { get; set; }\n\tprivate int foo;\n\n\tpublic MyAttribute(int foo)\n\t{\n\t\tthis.foo = foo;\n\t}\n}\n\n\n[My(foo: 1, Name1 = \"\"\"\", Name2 = \"\"\"\")]\npublic class Test\n{\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AttributeNamedArgumentInvalidCase()\n\t\t{\n\t\t\tTestWrongContext<AddArgumentNameAction>(@\"\nclass MyAttribute : System.Attribute\n{\n\tpublic string Name1 { get; set; }\n\tpublic string Name2 { get; set; }\n\tpublic string Name3 { get; set; }\n\tprivate int foo;\n\n\tpublic MyAttribute(int foo)\n\t{\n\t\tthis.foo = foo;\n\t}\n}\n\n\n[My(1, $Name1 = \"\"\"\", Name2 = \"\"\"\")]\npublic class Test\n{\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexerInvocation()\n\t\t{\n\t\t\tTest<AddArgumentNameAction>(@\"\npublic class TestClass\n{\n\tpublic int this[int i, int j]\n\t{\n\t\tset { }\n\t\tget { return 0; }\n\t}\n}\ninternal class Test\n{\n\tprivate void Foo()\n\t{\n\t\tvar TestBases = new TestClass();\n\t\tint a = TestBases[ $1, 2];\n\t}\n}\", @\"\npublic class TestClass\n{\n\tpublic int this[int i, int j]\n\t{\n\t\tset { }\n\t\tget { return 0; }\n\t}\n}\ninternal class Test\n{\n\tprivate void Foo()\n\t{\n\t\tvar TestBases = new TestClass();\n\t\tint a = TestBases [i: 1, j: 2];\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestParamsInvalidContext()\n\t\t{\n\n\t\t\tTestWrongContext<AddArgumentNameAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tSystem.Console.WriteLine (\"\"foo\"\", 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, $12);\n\t}\n}\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddBracesActionTests.cs",
    "content": "//\n// AddBracesActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class AddBracesActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAddBracesToIf()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$if (true)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\",@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBracesToElse()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t} $else\n\t\t\tConsole.WriteLine (\"\"World\"\");\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t} else {\n\t\t\tConsole.WriteLine (\"\"World\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBracesToDoWhile()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$do\n\t\t\tConsole.WriteLine (\"\"Hello\"\"); \n\t\twhile (true);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tdo {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t} while (true);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBracesToForeach()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$foreach (var a in b)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tforeach (var a in b) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBracesToFor()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$for (;;)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tfor (;;) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBracesToLock()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$lock (this)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tlock (this) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBracesToUsing()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$using (var a = new A ())\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tusing (var a = new A ()) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBracesToWhile()\n\t\t{\n\t\t\tTest<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$while (true)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\twhile (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlockAlreadyInserted()\n\t\t{\n\t\t\tTestWrongContext<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$if (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullNode()\n\t\t{\n\t\t\tTestWrongContext<AddBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\n\n        $          \n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddCatchTypeTests.cs",
    "content": "//\n// AddCatchTypeTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\tpublic class AddCatchTypeTests : ContextActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void HandlesBasicCase()\n\t\t{\n\t\t\tTest<AddCatchTypeAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch$ {\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t} catch (System.Exception e) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Needs whitespace ast nodes\")]\n\t\tpublic void PreservesWhitespaceInBody()\n\t\t{\n\t\t\tTest<AddCatchTypeAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch$ {\n\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch (System.Exception e) {\n\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoesNotUseRedundantNamespace()\n\t\t{\n\t\t\tTest<AddCatchTypeAction>(@\"\nusing System;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch$ {\n\t\t}\n\t}\n}\", @\"\nusing System;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t} catch (Exception e) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoesNotMatchCatchesWithType()\n\t\t{\n\t\t\tTestWrongContext<AddCatchTypeAction>(@\"\nusing System;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch (Exception) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddExceptionDescriptionActionTests.cs",
    "content": "//\n// AddExceptionDescriptionActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class AddExceptionDescriptionActionTests : ContextActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void TestPlainEntity()\n\t\t{\n\t\t\tTestWrongContext<AddExceptionDescriptionAction>(@\"using System;\npublic class Test\n{\n\tpublic void Bar(Test test)\n\t{\n\t\tif (test == null) \n\t\t\t$throw new ArgumentNullException(\"\"test\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddToExistingDocumentation()\n\t\t{\n\t\t\tTest<AddExceptionDescriptionAction>(@\"using System;\npublic class Test\n{\n\t/// <summary>\n\t/// \n\t/// </summary>\n\t/// <param name=\"\"test\"\"></param>\n\tpublic void Bar(Test test)\n\t{\n\t\tif (test == null) \n\t\t\t$throw new ArgumentNullException(\"\"test\"\");\n\t}\n}\n\", @\"using System;\npublic class Test\n{\n\t/// <summary>\n\t/// \n\t/// </summary>\n\t/// <param name=\"\"test\"\"></param>\n\t/// <exception cref=\"\"T:System.ArgumentNullException\"\"></exception>\n\tpublic void Bar(Test test)\n\t{\n\t\tif (test == null) \n\t\t\tthrow new ArgumentNullException(\"\"test\"\");\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestAlreadyAdded()\n\t\t{\n\t\t\tTestWrongContext<AddExceptionDescriptionAction>(@\"\nusing System;\npublic class Test\n{\n\t/// <exception cref=\"\"T:System.ArgumentNullException\"\"></exception>\n\tpublic void Bar(Test test)\n\t{\n\t\tif (test == null) \n\t\t\t$throw new ArgumentNullException(\"\"test\"\");\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddOptionalParameterToInvocationTests.cs",
    "content": "﻿// \n// AddOptionalParameterToInvocationTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class AddOptionalParameterToInvocationTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple ()\n\t\t{\n\t\t\tTest<AddOptionalParameterToInvocationAction> (@\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\") {}\n\tpublic void Bar() {\n\t\t$Foo ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\") {}\n\tpublic void Bar() {\n\t\tFoo (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiple1 ()\n\t\t{\n\t\t\tTest<AddOptionalParameterToInvocationAction> (@\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\", string msg2 = \"\"Bar\"\") {}\n\tpublic void Bar() {\n\t\t$Foo ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\", string msg2 = \"\"Bar\"\") {}\n\tpublic void Bar() {\n\t\tFoo (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExtensionMethod ()\n\t\t{\n\t\t\tTest<AddOptionalParameterToInvocationAction> (@\"\nstatic class Extensions\n{\n\tpublic static void Foo(this string self, string msg = \"\"Hello\"\") {}\n}\nclass TestClass\n{\n\tpublic void Bar() {\n\t\tstring.$Foo ();\n\t}\n}\", @\"\nstatic class Extensions\n{\n\tpublic static void Foo(this string self, string msg = \"\"Hello\"\") {}\n}\nclass TestClass\n{\n\tpublic void Bar() {\n\t\tstring.Foo (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiple2 ()\n\t\t{\n\t\t\tTest<AddOptionalParameterToInvocationAction> (@\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\", string msg2 = \"\"Bar\"\") {}\n\tpublic void Bar() {\n\t\t$Foo ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\", string msg2 = \"\"Bar\"\") {}\n\tpublic void Bar() {\n\t\tFoo (msg2: \"\"Bar\"\");\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiple3 ()\n\t\t{\n\t\t\tTest<AddOptionalParameterToInvocationAction> (@\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\", string msg2 = \"\"Bar\"\") {}\n\tpublic void Bar() {\n\t\t$Foo ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\", string msg2 = \"\"Bar\"\") {}\n\tpublic void Bar() {\n\t\tFoo (\"\"Hello\"\", \"\"Bar\"\");\n\t}\n}\", 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoMoreParameters ()\n\t\t{\n\t\t\tTestWrongContext<AddOptionalParameterToInvocationAction>(@\"\nclass TestClass\n{\n\tpublic void Foo(string msg = \"\"Hello\"\", string msg2 = \"\"Bar\"\") {}\n\tpublic void Bar() {\n\t\t$Foo (string.Empty, string.Empty);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParams ()\n\t\t{\n\t\t\tTestWrongContext<AddOptionalParameterToInvocationAction>(@\"\nclass TestClass\n{\n\tpublic void Foo(params string[] p) {}\n\tpublic void Bar() {\n\t\t$Foo ();\n\t}\n}\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddUsing/AddUsingActionAlphabeticalTests.cs",
    "content": "using System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions.AddUsing\n{\n\t[TestFixture]\n\tpublic class AddUsingActionAlphabeticalTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void ShouldAddUsingAtStartIfItIsTheFirstAlphabetically()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tusing System.IO;\n\n\tclass TestClass\n\t{\n\t\tprivate $List<TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tusing System.Collections.Generic;\n\tusing System.IO;\n\n\tclass TestClass\n\t{\n\t\tprivate List<TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShouldInsertUsingBetweenExistingUsings()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tusing System;\n\tusing System.IO;\n\n\tclass TestClass\n\t{\n\t\tprivate $List<TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\tusing System.IO;\n\n\tclass TestClass\n\t{\n\t\tprivate List<TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShouldInsertUsingAfterExistingUsings()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\n\tclass TestClass\n\t{\n\t\tprivate List<$TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\tusing System.IO;\n\n\tclass TestClass\n\t{\n\t\tprivate List<TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddBlankLinesAfterUsingsWhenAddingAtEnd()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\tclass TestClass\n\t{\n\t\tprivate List<$TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\tusing System.IO;\n\n\tclass TestClass\n\t{\n\t\tprivate List<TextWriter> writerList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t#region System Namespaces\n\t\t\n\t\t[Test]\n\t\tpublic void ShouldBeAbleToPlaceSystemNamespacesFirst()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tusing ANamespace;\n\n\tclass TestClass\n\t{\n\t\tprivate $TextWriter writer;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tusing System.IO;\n\tusing ANamespace;\n\n\tclass TestClass\n\t{\n\t\tprivate TextWriter writer;\n\t}\n}\";\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotPlaceNonSystemNamespacesStartingWithSystemFirst()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace A { class B { } }\nnamespace OuterNamespace\n{\n\tusing SystemA;\n\n\tclass TestClass\n\t{\n\t\tprivate $B b;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace A { class B { } }\nnamespace OuterNamespace\n{\n\tusing A;\n\tusing SystemA;\n\n\tclass TestClass\n\t{\n\t\tprivate B b;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldPlaceSystemBeforeOtherNamespaces()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tusing System.Collections.Generic;\n\n\tclass TestClass\n\t{\n\t\tprivate List<$DateTime> dates;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\n\tclass TestClass\n\t{\n\t\tprivate List<DateTime> dates;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddUsing/AddUsingActionInsideNamespaceTests.cs",
    "content": "using NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeIssues;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions.AddUsing\n{\n\t[TestFixture]\n\tpublic class AddUsingActionInsideNamespaceTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void ShouldInsertUsingStatement()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace TestNamespace\n{\n\tusing System.Collections.Generic;\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tformattingOptions.UsingPlacement = UsingPlacement.InsideNamespace;\n\t\t\tformattingOptions.MinimumBlankLinesAfterUsings = 0;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddBlankLinesBeforeUsingStatement()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace TestNamespace\n{\n\n\n\tusing System.Collections.Generic;\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tformattingOptions.UsingPlacement = UsingPlacement.InsideNamespace;\n\t\t\tformattingOptions.MinimumBlankLinesBeforeUsings = 2;\n\t\t\tformattingOptions.MinimumBlankLinesAfterUsings = 0;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddBlankLinesAfterUsingStatements()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace TestNamespace\n{\n\tusing System.Collections.Generic;\n\n\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tformattingOptions.UsingPlacement = UsingPlacement.InsideNamespace;\n\t\t\tformattingOptions.MinimumBlankLinesAfterUsings = 2;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldAddUsingAfterExistingUsings()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\tusing System;\n\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace TestNamespace\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tformattingOptions.UsingPlacement = UsingPlacement.InsideNamespace;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddUsingInMostNestedNamespace()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tnamespace InnerNamespace\n\t{\n\t\tclass TestClass\n\t\t{\n\t\t\tprivate $List<string> stringList;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tnamespace InnerNamespace\n\t{\n\t\tusing System.Collections.Generic;\n\n\t\tclass TestClass\n\t\t{\n\t\t\tprivate List<string> stringList;\n\t\t}\n\t}\n}\";\n\n\t\t\tformattingOptions.UsingPlacement = UsingPlacement.InsideNamespace;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldAddUsingAfterExistingUsingsInMostNestedNamespace()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace OuterNamespace\n{\n\tnamespace InnerNamespace\n\t{\n\t\tusing System;\n\n\t\tclass TestClass\n\t\t{\n\t\t\tprivate $List<string> stringList;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"namespace OuterNamespace\n{\n\tnamespace InnerNamespace\n\t{\n\t\tusing System;\n\t\tusing System.Collections.Generic;\n\n\t\tclass TestClass\n\t\t{\n\t\t\tprivate List<string> stringList;\n\t\t}\n\t}\n}\";\n\n\t\t\tformattingOptions.UsingPlacement = UsingPlacement.InsideNamespace;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddUsing/AddUsingActionTests.cs",
    "content": "using ICSharpCode.NRefactory.CSharp.CodeIssues;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions.AddUsing\n{\n\t[TestFixture]\n\tpublic class AddUsingActionTests : ContextActionTestBase\n\t{\n\t\tvoid UnresolvedTypeName(string code, string typeName, params string[] namespaces)\n\t\t{\n\t\t\tTestActionDescriptions(\n\t\t\t\tnew AddUsingAction(), code,\n\t\t\t\tnamespaces.SelectMany(ns => new[] {\n\t\t\t\t                      \t\"using \" + ns + \";\",\n\t\t\t\t                      \tns + \".\" + typeName\n\t\t\t\t                      }).ToArray());\n\t\t}\n\t\t\n\t\t#region Field Declarations\n\t\t[Test]\n\t\tpublic void ShouldReturnAnIssueForUnresolvedFieldDeclarations()\n\t\t{\n\t\t\tUnresolvedTypeName(@\"class Foo {\n\tprivate $TextWriter textWriter;\n}\", \"TextWriter\", \"System.IO\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnAnyIssuesIfFieldTypeIsResolved()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(@\"using System.IO;\nclass Foo {\n\tprivate $TextWriter textWriter;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnAnIssueIfFieldTypeArgumentIsNotResolvable()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"using System.Collections.Generic;\n\nclass Foo\n{\n\tprivate List<$AttributeTargets> targets;\n}\", \"AttributeTargets\", \"System\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnAnIssueIfFieldTypeArgumentIsResolvable()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System;\nusing System.Collections.Generic;\n\nclass Foo\n{\n\tprivate List<$AttributeTargets> notifiers;\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShouldNotReturnAnIssueIfFieldTypeArgumentIsPrimitiveType()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System.Collections.Generic;\n\nclass Foo\n{\n\tprivate List<$string> notifiers;\n}\");\n\t\t}\n\t\t#endregion\n\n\t\t#region Method Return Types\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueForUnresolvedReturnType()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"class Foo\n{\n\t$TextWriter Bar ()\n\t{\n\t\treturn null;\n\t}\n}\", \"TextWriter\", \"System.IO\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueForResolvedReturnType()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System.IO;\n\nclass Foo\n{\n\t$TextWriter Bar ()\n\t{\n\t\treturn null;\n\t}\n}\");\n\t\t}\n\t\t#endregion\n\n\t\t#region Local Variables\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueForUnresolvedLocalVariableDeclaration()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\t$TextWriter writer;\n\t}\n}\", \"TextWriter\", \"System.IO\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueForResolvedLocalVariableDeclaration()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System.IO;\n\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\t$TextWriter writer;\n\t}\n}\");\n\t\t}\n\t\t#endregion\n\n\t\t#region Method Parameters\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfMethodParameterIsNotResolvable()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"class Foo\n{\n\tvoid Bar ($TextWriter writer)\n\t{\n\t}\n}\", \"TextWriter\", \"System.IO\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnAnIssueIfMethodParameterIsResolvable()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System.IO;\n\nclass Foo\n{\n\tvoid Bar ($TextWriter writer)\n\t{\n\t}\n}\");\n\t\t}\n\t\t#endregion\n\n\t\t#region Base Types\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfBaseClassIsNotResolvable()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"class Foo : $List<string>\n{\n}\", \"List<>\", \"System.Collections.Generic\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueIfBaseClassIsResolvable()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System.Collections.Generic;\n\nclass Foo : $List<string>\n{\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfGenericInterfaceIsMissingButNonGenericIsPresent()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"using System.Collections;\nclass Foo : $IEnumerable<string>\n{\n}\", \"IEnumerable<>\", \"System.Collections.Generic\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfNonGenericInterfaceIsMissingButGenericIsPresent()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"using System.Collections.Generic;\nclass Foo : $IEnumerable\n{\n}\", \"IEnumerable\", \"System.Collections\");\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Member Access\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfEnumValueIsNotResolvable()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar support = $AttributeTargets.Assembly;\n\t}\n}\", \"AttributeTargets\", \"System\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueIfEnumValueIsResolvable()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System;\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar support = $AttributeTargets.Assembly;\n\t}\n}\");\n\t\t}\n\t\t#endregion\n\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfAttributeIsNotResolvable()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"[$Serializable]\nclass Foo\n{\n}\", \"SerializableAttribute\", \"System\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueIfAttributeIsResolvable()\n\t\t{\n\t\t\tTestWrongContext<AddUsingAction>(\n\t\t\t\t@\"using System;\n\n[$Serializable]\nclass Foo\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfTypeArgumentIsNotResolvable()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"using System.Collections.Generic;\n\nclass Test\n{\n\tvoid TestMethod()\n\t{\n\t\tvar list = new List<$Stream>();\n\t}\n}\", \"Stream\", \"System.IO\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueForUnresolvedExtensionMethod()\n\t\t{\n\t\t\tTestActionDescriptions(\n\t\t\t\tnew AddUsingAction(),\n\t\t\t\t@\"using System.Collections.Generic;\n\nclass Test\n{\n\tvoid TestMethod()\n\t{\n\t\tvar list = new List<string>();\n\t\tvar first = list.$First();\n\t}\n}\", \"using System.Linq;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnMultipleNamespaceSuggestions()\n\t\t{\n\t\t\tUnresolvedTypeName(\n\t\t\t\t@\"namespace A { public class TestClass { } }\nnamespace B { public class TestClass { } }\nnamespace C\n{\n\tpublic class Test\n\t{\n\t\tprivate $TestClass testClass;\n\t}\n}\", \"TestClass\", \"A\", \"B\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerTypeCanOnlyBeReferredToByFullName()\n\t\t{\n\t\t\tTestActionDescriptions(\n\t\t\t\tnew AddUsingAction(),\n\t\t\t\t@\"class Outer { public class Inner {} }\npublic class Test\n{\n\tprivate $Inner t;\n}\n\", \"Outer.Inner\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AddUsing/AddUsingRunActionTests.cs",
    "content": "using NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeIssues;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions.AddUsing\n{\n\t[TestFixture]\n\tpublic class AddUsingRunActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldInsertUsingStatement()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"using System.Collections.Generic;\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddBlankLinesAfterUsings()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"using System.Collections.Generic;\n\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tformattingOptions.MinimumBlankLinesAfterUsings = 2;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddBlankLinesBeforeUsing()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"\n\nusing System.Collections.Generic;\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tformattingOptions.MinimumBlankLinesBeforeUsings = 2;\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddAfterExistingUsingStatements()\n\t\t{\n\t\t\tstring testCode =\n@\"using System;\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"using System;\nusing System.Collections.Generic;\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotAddBlankLinesAfterIfTheyAreAlreadyThere()\n\t\t{\n\t\t\tstring testCode =\n@\"using System;\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"using System;\nusing System.Collections.Generic;\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldLeaveAdditionalBlankLinesThatAlreadyExist()\n\t\t{\n\t\t\tstring testCode =\n@\"using System;\n\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"using System;\nusing System.Collections.Generic;\n\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldAddFirstUsingAfterComments()\n\t\t{\n\t\t\tstring testCode =\n@\"// This is the file header.\n// It contains any copyright information.\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate $List<string> stringList;\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"// This is the file header.\n// It contains any copyright information.\nusing System.Collections.Generic;\n\nnamespace TestNamespace\n{\n\tclass TestClass\n\t{\n\t\tprivate List<string> stringList;\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Add using does not honor the blank line setting yet\")]\n\t\tpublic void ShouldBeAbleToFixAttributeWithShortName()\n\t\t{\n\t\t\tstring testCode =\n@\"namespace TestNamespace\n{\n\t[$Serializable]\n\tclass TestClass\n\t{\n\t}\n}\";\n\n\t\t\tstring expectedOutput = \n@\"using System;\n\nnamespace TestNamespace\n{\n\t[Serializable]\n\tclass TestClass\n\t{\n\t}\n}\";\n\n\t\t\tTest(new AddUsingAction(), testCode, expectedOutput);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/AutoLinqSumTests.cs",
    "content": "// AutoLinqTests.cs\n//  \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class AutoLinqSumActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleIntegerLoop() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMergedIntegerLoop() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tint result = 0;\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tint result = list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonZeroMergedIntegerLoop() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tint result = 1;\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tint result = 1 + list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMergedAssignmentIntegerLoop() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tint result;\n\t\tresult = 1;\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tint result;\n\t\tresult = 1 + list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMergedDecimal() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tdecimal result = 0.0m;\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tdecimal result = list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIntegerLoopInBlock() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tresult += x;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExpression() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tresult += x * 2;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum (x => x * 2);\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForStrings() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tstring result = string.Empty;\n\t\tvar list = new string[] { \"\"a\"\", \"\"b\"\" };\n\t\t$foreach (var x in list) {\n\t\t\tresult += x;\n\t\t}\n\t}\n}\";\n\t\t\tTestWrongContext<AutoLinqSumAction>(source);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestShort() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tshort result = 0;\n\t\tvar list = new short[] { 1, 2, 3 };\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tshort result = 0;\n\t\tvar list = new short[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLong() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tlong result = 0;\n\t\tvar list = new long[] { 1, 2, 3 };\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tlong result = 0;\n\t\tvar list = new long[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnsignedLong() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tulong result = 0;\n\t\tvar list = new ulong[] { 1, 2, 3 };\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tulong result = 0;\n\t\tvar list = new ulong[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFloat() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tfloat result = 0;\n\t\tvar list = new float[] { 1, 2, 3 };\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tfloat result = 0;\n\t\tvar list = new float[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDouble() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tdouble result = 0;\n\t\tvar list = new double[] { 1, 2, 3 };\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tdouble result = 0;\n\t\tvar list = new double[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDecimal() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tdecimal result = 0;\n\t\tvar list = new decimal[] { 1, 2, 3 };\n\t\t$foreach (var x in list)\n\t\t\tresult += x;\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tdecimal result = 0;\n\t\tvar list = new decimal[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMinus() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tresult -= x;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum (x => -x);\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCombined() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tresult += x;\n\t\t\tresult += 2 * x;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum (x => x + 2 * x);\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCombinedPrecedence() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tresult += x;\n\t\t\tresult += x << 1;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum (x => x + (x << 1));\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmptyStatements() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tresult += x;\n\t\t\t;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleConditional() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tif (x > 0)\n\t\t\t\tresult += x;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Where (x => x > 0).Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvertedConditional() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tif (x > 0)\n\t\t\t\t;\n\t\t\telse\n\t\t\t\tresult += x;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Where (x => x <= 0).Sum ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIncrement() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tresult++;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Count ();\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCompleteConditional() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\t$foreach (var x in list) {\n\t\t\tif (x > 0)\n\t\t\t\tresult += x * 2;\n\t\t\telse\n\t\t\t\tresult += x;\n\t\t}\n\t}\n}\";\n\n\t\t\tstring result = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2, 3 };\n\t\tresult += list.Sum (x => x > 0 ? x * 2 : x);\n\t}\n}\";\n\n\t\t\tAssert.AreEqual(result, RunContextAction(new AutoLinqSumAction(), source));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForSideEffects() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tstring result = string.Empty;\n\t\tvar list = new string[] { \"\"a\"\", \"\"b\"\" };\n\t\t$foreach (var x in list) {\n\t\t\tTestMethod();\n\t\t\tresult += x;\n\t\t}\n\t}\n}\";\n\t\t\tTestWrongContext<AutoLinqSumAction>(source);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForInnerAssignments() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2 };\n\t\tint p = 0;\n\t\t$foreach (var x in list) {\n\t\t\tresult += (p = x);\n\t\t}\n\t}\n}\";\n\t\t\tTestWrongContext<AutoLinqSumAction>(source);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForInnerIncrements() {\n\t\t\tstring source = @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2 };\n\t\tint p = 0;\n\t\t$foreach (var x in list) {\n\t\t\tresult += (p++);\n\t\t}\n\t}\n}\";\n\t\t\tTestWrongContext<AutoLinqSumAction>(source);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForNoLinq() {\n\t\t\tstring source = @\"\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tint result = 0;\n\t\tvar list = new int[] { 1, 2 };\n\t\t$foreach (var x in list) {\n\t\t\tresult += x;\n\t\t}\n\t}\n}\";\n\t\t\tTestWrongContext<AutoLinqSumAction>(source);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CS1105ExtensionMethodMustBeDeclaredStaticActionTests.cs",
    "content": "﻿//\n// CS1105ExtensionMethodMustBeDeclaredStaticActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS1105ExtensionMethodMustBeDeclaredStaticActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestMethod()\n\t\t{\n\t\t\tTest<CS1105ExtensionMethodMustBeDeclaredStaticAction> (\n\t\t\t\t@\"static class Foo\n{\n\tpublic void $FooBar (this string foo)\n\t{\n\n\t}\n}\",\n\t\t\t\t@\"static class Foo\n{\n\tpublic static void FooBar (this string foo)\n\t{\n\n\t}\n}\", 0, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongContext1()\n\t\t{\n\t\t\tTestWrongContext<CS1105ExtensionMethodMustBeDeclaredStaticAction> (\n\t\t\t\t@\"static class Foo\n{\n\tpublic static void $FooBar (this string foo)\n\t{\n\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongContext2()\n\t\t{\n\t\t\tTestWrongContext<CS1105ExtensionMethodMustBeDeclaredStaticAction> (\n\t\t\t\t@\"class Foo\n{\n\tpublic void $FooBar (string foo)\n\t{\n\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CS1520MethodMustHaveAReturnTypeTests.cs",
    "content": "//\n// CS1520MethodMustHaveAReturnTypeTests.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS1520MethodMustHaveAReturnTypeTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestMethod()\n\t\t{\n\t\t\tTest<CS1520MethodMustHaveAReturnTypeAction> (\n\t\t\t\t@\"class Foo\n{\n\tstatic $Fa (string str)\n\t{\n\t}\n}\",\n\t\t\t\t@\"class Foo\n{\n\tstatic void Fa (string str)\n\t{\n\t}\n}\", 1, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor()\n\t\t{\n\t\t\tTest<CS1520MethodMustHaveAReturnTypeAction> (\n\t\t\t\t@\"class Foo\n{\n\tstatic $Fa (string str)\n\t{\n\t}\n}\",\n\t\t\t\t@\"class Foo\n{\n\tstatic Foo (string str)\n\t{\n\t}\n}\", 0, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorWithBase()\n\t\t{\n\t\t\tTest<CS1520MethodMustHaveAReturnTypeAction> (\n\t\t\t\t@\"class Foo\n{\n\tstatic $Fa (string str) : base (str)\n\t{\n\t}\n}\",\n\t\t\t\t@\"class Foo\n{\n\tstatic Foo (string str) : base (str)\n\t{\n\t}\n}\", 0, true);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ChangeAccessModifierTests.cs",
    "content": "// \n// ChangeAccessModifiersTests.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ChangeAccessModifierTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestNoEnumMember()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"\nenum Test\n{\n\t$Foo\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoInterfaceMember()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"\ninterface Test\n{\n\tvoid $Foo ();\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoExplicitInterfaceImplementationMember()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"\ninterface Test\n{\n\tvoid Foo ();\n}\nclass TestClass : Test\n{\n\tvoid $Test.Foo () {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoOverrideMember()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"\nclass TestClass : Test\n{\n\tpublic override string $ToString()\n\t{\n\t\treturn \"\"Test\"\";\n\t}\n\t\t\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestType ()\n\t\t{\n\t\t\tTest<ChangeAccessModifierAction>(@\"\nclass $Foo\n{\n}\", @\"\npublic class Foo\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodToProtected ()\n\t\t{\n\t\t\tTest<ChangeAccessModifierAction>(@\"\nclass Foo\n{\n\tvoid $Bar ()\n\t{\n\t}\n}\", @\"\nclass Foo\n{\n\tprotected void Bar ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrivateMethodToProtected ()\n\t\t{\n\t\t\tTest<ChangeAccessModifierAction>(@\"\nclass Foo\n{\n\t$private void Bar ()\n\t{\n\t}\n}\", @\"\nclass Foo\n{\n\tprotected void Bar ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodToProtectedInternal ()\n\t\t{\n\t\t\tTest<ChangeAccessModifierAction>(@\"\nclass Foo\n{\n\tvoid $Bar ()\n\t{\n\t}\n}\", @\"\nclass Foo\n{\n\tprotected internal void Bar ()\n\t{\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAccessor ()\n\t\t{\n\t\t\tTest<ChangeAccessModifierAction>(@\"\nclass Foo\n{\n\tpublic int Bar\n\t{\n\t\tget; $set;\n\t}\n}\", @\"\nclass Foo\n{\n\tpublic int Bar\n\t{\n\t\tget; private set;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStrictAccessor ()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"\nclass Foo\n{\n\tprivate int Bar\n\t{\n\t\tget; $set;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChangeAccessor ()\n\t\t{\n\t\t\tTest<ChangeAccessModifierAction>(@\"\nclass Foo\n{\n\tpublic int Bar\n\t{\n\t\tget; private $set;\n\t}\n}\", @\"\nclass Foo\n{\n\tpublic int Bar\n\t{\n\t\tget; protected set;\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestReturnTypeWrongContext()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"\nclass Test\n{\n\tpublic $void Foo () {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongModiferContext()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"\nclass Test\n{\n\tpublic $virtual void Foo () {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodImplementingInterface()\n\t\t{\n\t\t\tTestWrongContext<ChangeAccessModifierAction>(@\"using System;\n\nclass BaseClass : IDisposable\n{\n\tpublic void $Dispose()\n\t{\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CheckIfParameterIsNullTests.cs",
    "content": "// \n// CheckIfParameterIsNullTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CheckIfParameterIsNullTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CheckIfParameterIsNullAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (string $param)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tConsole.WriteLine (param);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (string param)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tif (param == null)\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tthrow new ArgumentNullException (\\\"param\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t\tConsole.WriteLine (param);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestLambda ()\n\t\t{\n\t\t\tTest<CheckIfParameterIsNullAction> (@\"class Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar lambda = ($sender, e) => {\n\t\t};\n\t}\n}\",@\"class Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar lambda = (sender, e) => {\n\t\t\tif (sender == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"\"sender\"\");\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAnonymousMethod ()\n\t\t{\n\t\t\tTest<CheckIfParameterIsNullAction> (@\"class Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar lambda = delegate(object $sender, object e) {\n\t\t};\n\t}\n}\",@\"class Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar lambda = delegate(object sender, object e) {\n\t\t\tif (sender == null)\n\t\t\t\tthrow new System.ArgumentNullException (\"\"sender\"\");\n\t\t};\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ComputeConstantValueTests.cs",
    "content": "﻿// \n// ComputeConstantValueTests.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ComputeConstantValueTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Rational1()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint a = 1 $+ 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint a = 2;\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void Rational2()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint b = 2 $* 2;\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint b = 4;\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void Rational3()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tdouble c = 0.2 $/ 2;\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tdouble c = 0.1;\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void Rational4()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tdouble d = 2 $* (-0.2);\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tdouble d = -0.4;\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void Rational5()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint e = 2 $* (1 << 2);\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint e = 8;\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void Rational6()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint f = 1 $+ (~4);\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint f = -4;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Bool1()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = $!(true);\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = false;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Bool2()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool b = $!!(!!!(true & false));\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool b = true;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Bool3()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool c = 1 $> 0;\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool c = true;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void String1()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tstring a = \"\"a\"\"$+\"\"b\"\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tstring a = \"\"ab\"\";\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UseConstant()\n\t\t{\n\t\t\tTest<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tconst double pi = 3.141;\n\tpublic void F()\n\t{\n\t\tdouble pi2 = $2 * pi;\n\t}\n}\", @\"\nclass TestClass\n{\n\tconst double pi = 3.141;\n\tpublic void F()\n\t{\n\t\tdouble pi2 = 6.282;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void Invalid()\n\t\t{\n\t\t\tTestWrongContext<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = !(true);\n\t\tbool b = $!!(!!!(true & a));\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestWrongHotSpot()\n\t\t{\n\t\t\tTestWrongContext<ComputeConstantValueAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint a = 1 +$ 1;\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ContextActionTestBase.cs",
    "content": "﻿// \n// ContextActionTestBase.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Threading;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\tpublic abstract class ContextActionTestBase\n\t{\n\t\tprotected CSharpFormattingOptions formattingOptions;\n\t\t\n\t\t[SetUp]\n\t\tpublic virtual void SetUp()\n\t\t{\n\t\t\tformattingOptions = FormattingOptionsFactory.CreateMono();\n\t\t}\n\t\t\n\t\tinternal static string HomogenizeEol (string str)\n\t\t{\n\t\t\tvar sb = new StringBuilder ();\n\t\t\tfor (int i = 0; i < str.Length; i++) {\n\t\t\t\tvar ch = str [i];\n\t\t\t\tvar possibleNewline = NewLine.GetDelimiterLength(ch, i + 1 < str.Length ? str [i + 1] : '\\0');\n\t\t\t\tif (possibleNewline > 0) {\n\t\t\t\t\tsb.AppendLine ();\n\t\t\t\t\tif (possibleNewline == 2)\n\t\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tsb.Append (ch);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sb.ToString ();\n\t\t}\n\n\t\tpublic void Test<T> (string input, string output, int action = 0, bool expectErrors = false)\n\t\t\twhere T : CodeActionProvider, new ()\n\t\t{\n\t\t\tTest(new T(), input, output, action, expectErrors);\n\t\t}\n\t\t\n\t\tpublic void Test (CodeActionProvider provider, string input, string output, int action = 0, bool expectErrors = false)\n\t\t{\n\t\t\tstring result = RunContextAction (provider, HomogenizeEol (input), action, expectErrors);\n\t\t\tbool passed = result == output;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine (\"-----------Expected:\");\n\t\t\t\tConsole.WriteLine (output);\n\t\t\t\tConsole.WriteLine (\"-----------Got:\");\n\t\t\t\tConsole.WriteLine (result);\n\t\t\t}\n\t\t\tAssert.AreEqual (HomogenizeEol (output), result);\n\t\t}\n\n\t\tprotected string RunContextAction (CodeActionProvider action, string input,\n\t\t                                          int actionIndex = 0, bool expectErrors = false)\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create (input, expectErrors);\n\t\t\tcontext.FormattingOptions = formattingOptions;\n\t\t\tbool isValid = action.GetActions (context).Any ();\n\n\t\t\tif (!isValid)\n\t\t\t\tConsole.WriteLine (\"invalid node is:\" + context.GetNode ());\n\t\t\tAssert.IsTrue (isValid, action.GetType () + \" is invalid.\");\n\t\t\tusing (var script = context.StartScript ()) {\n\t\t\t\taction.GetActions (context).Skip (actionIndex).First ().Run (script);\n\t\t\t}\n\n\t\t\treturn context.doc.Text;\n\t\t}\n\t\t\n\t\tprotected void TestWrongContext<T> (string input) where T : CodeActionProvider, new ()\n\t\t{\n\t\t\tTestWrongContext (new T(), input);\n\t\t}\n\t\t\n\t\tprotected void TestWrongContext (CodeActionProvider action, string input)\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create (input);\n\t\t\tcontext.FormattingOptions = formattingOptions;\n\t\t\tbool isValid = action.GetActions (context).Any ();\n\t\t\tif (isValid)\n\t\t\t\tConsole.WriteLine (\"valid node is:\" + context.GetNode ());\n\t\t\tAssert.IsTrue (!isValid, action.GetType () + \" shouldn't be valid there.\");\n\t\t}\n\n\t\tprotected List<CodeAction> GetActions<T> (string input) where T : CodeActionProvider, new ()\n\t\t{\n\t\t\tvar ctx = TestRefactoringContext.Create(input);\n\t\t\tctx.FormattingOptions = formattingOptions;\n\t\t\treturn new T().GetActions(ctx).ToList();\n\t\t}\n\n\t\tprotected void TestActionDescriptions (CodeActionProvider provider, string input, params string[] expected)\n\t\t{\n\t\t\tvar ctx = TestRefactoringContext.Create(input);\n\t\t\tctx.FormattingOptions = formattingOptions;\n\t\t\tvar actions = provider.GetActions(ctx).ToList();\n\t\t\tAssert.AreEqual(\n\t\t\t\texpected,\n\t\t\t\tactions.Select(a => a.Description).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertAnonymousDelegateToLambdaTests.cs",
    "content": "//\n// ConvertAnonymousDelegateToExpressionTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertAnonymousDelegateToLambdaTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void BasicTest ()\n\t\t{\n\t\t\tTest<ConvertAnonymousDelegateToLambdaAction>(@\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action<int, int> action = delegate$ (int i1, int i2) { System.Console.WriteLine (i1); };\n\t}\n}\", @\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action<int, int> action = (i1, i2) => System.Console.WriteLine (i1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void VarDeclaration ()\n\t\t{\n\t\t\tTest<ConvertAnonymousDelegateToLambdaAction>(@\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tvar action = delegate$ (int i1, int i2) { System.Console.WriteLine (i1); System.Console.WriteLine (i2); };\n\t}\n}\", @\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tvar action = (int i1, int i2) => {\n\t\t\tSystem.Console.WriteLine (i1);\n\t\t\tSystem.Console.WriteLine (i2);\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParameterLessDelegate ()\n\t\t{\n\t\t\tTest<ConvertAnonymousDelegateToLambdaAction>(@\"\nclass A\n{\n\tvoid F (int i)\n\t{\n\t\tSystem.Action<int> act = $delegate { System.Console.WriteLine (i); };\n\t}\n}\", @\"\nclass A\n{\n\tvoid F (int i)\n\t{\n\t\tSystem.Action<int> act = obj => System.Console.WriteLine (i);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertAsToCastTests.cs",
    "content": "﻿// \n// ConvertAsToCastTests.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertAsToCastTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<ConvertAsToCastAction> (@\"\nusing System;\nclass TestClass\n{\n\tvoid Test (object a)\n\t{\n\t\tvar b = a $as Exception;\n\t}\n}\", @\"\nusing System;\nclass TestClass\n{\n\tvoid Test (object a)\n\t{\n\t\tvar b = (Exception)a;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveParentheses ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass {\n\tvoid TestMethod (object o)\n\t{\n\t\tvar b = 1 + (o $as TestClass);\n\t}\n}\";\n\t\t\tstring output = @\"\nclass TestClass {\n\tvoid TestMethod (object o)\n\t{\n\t\tvar b = 1 + (TestClass)o;\n\t}\n}\";\n\t\t\tTest<ConvertAsToCastAction> (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInsertParentheses ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass {\n\tvoid TestMethod (object o)\n\t{\n\t\tvar b = 1 + o $as TestClass;\n\t}\n}\";\n\t\t\tstring output = @\"\nclass TestClass {\n\tvoid TestMethod (object o)\n\t{\n\t\tvar b = (TestClass)(1 + o);\n\t}\n}\";\n\t\t\tTest<ConvertAsToCastAction> (input, output);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertAssignmentToIfActionTests.cs",
    "content": "//\n// ConvertAssignmentToIfActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertAssignmentToIfActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestConditionalOperator ()\n\t\t{\n\t\t\tTest<ConvertAssignmentToIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int o, int p)\n\t{\n\t\tint z;\n\t\tz $= i > 0 ? o : p;\n\t\treturn z;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int o, int p)\n\t{\n\t\tint z;\n\t\tif (i > 0)\n\t\t\tz = o;\n\t\telse\n\t\t\tz = p;\n\t\treturn z;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCoalescingOperator ()\n\t\t{\n\t\t\tTest<ConvertAssignmentToIfAction> (@\"\nclass Test\n{\n\tobject TestMethod (object o, object p)\n\t{\n\t\tobject z;\n\t\tz $= o ?? p;\n\t\treturn z;\n\t}\n}\", @\"\nclass Test\n{\n\tobject TestMethod (object o, object p)\n\t{\n\t\tobject z;\n\t\tif (o != null)\n\t\t\tz = o;\n\t\telse\n\t\t\tz = p;\n\t\treturn z;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmbeddedStatement ()\n\t\t{\n\t\t\tTest<ConvertAssignmentToIfAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tif (i < 10)\n\t\t\ta $= i > 0 ? 0 : 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tif (i < 10)\n\t\tif (i > 0)\n\t\t\ta = 0;\n\t\telse\n\t\t\ta = 1;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tTest<ConvertAssignmentToIfAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\ta $= i > 0 ? 0 : 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tif (i > 0)\n\t\t\ta = 0;\n\t\telse\n\t\t\ta = 1;\n\t}\n}\");\n\t\t\tTest<ConvertAssignmentToIfAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\ta $+= i > 0 ? 0 : 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tif (i > 0)\n\t\t\ta += 0;\n\t\telse\n\t\t\ta += 1;\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertBitwiseFlagComparisonToHasFlagsActionTests.cs",
    "content": "//\n// ConvertBitwiseFlagComparisonToHasFlagsActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertBitwiseFlagComparisonToHasFlagsActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestComparisonWithNullInEqual ()\n\t\t{\n\t\t\tTest<ConvertBitwiseFlagComparisonToHasFlagsAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & Foo.A) $!= 0);\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (f.HasFlag (Foo.A));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComparisonWithNullEqual ()\n\t\t{\n\t\t\tTest<ConvertBitwiseFlagComparisonToHasFlagsAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & Foo.A) $== 0);\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (!f.HasFlag (Foo.A));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComparisonWithFlagInEqual ()\n\t\t{\n\t\t\tTest<ConvertBitwiseFlagComparisonToHasFlagsAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & Foo.A) $!= Foo.A);\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (!f.HasFlag (Foo.A));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComparisonWithFlagEqual ()\n\t\t{\n\t\t\tTest<ConvertBitwiseFlagComparisonToHasFlagsAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & Foo.A) $== Foo.A);\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (f.HasFlag (Foo.A));\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestMultipleFlags ()\n\t\t{\n\t\t\tTest<ConvertBitwiseFlagComparisonToHasFlagsAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & (Foo.A | Foo.B)) $!= 0);\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (f.HasFlag (Foo.A) | f.HasFlag (Foo.B));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleFlagsCase2 ()\n\t\t{\n\t\t\tTest<ConvertBitwiseFlagComparisonToHasFlagsAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & (Foo.A & Foo.B)) $!= 0);\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (f.HasFlag (Foo.A | Foo.B));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid ()\n\t\t{\n\t\t\tTestWrongContext<ConvertBitwiseFlagComparisonToHasFlagsAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & (Foo.A | Foo.B & 1)) $!= 0);\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertCastToAsTests.cs",
    "content": "﻿// \n// ConvertCastToAsTest.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertCastToAsTests : ContextActionTestBase\n\t{\n\t\tvoid TestType (string type)\n\t\t{\n\t\t\tstring input = @\"\nusing System;\nclass TestClass\n{\n\tvoid Test (object a)\n\t{\n\t\tvar b = ($\" + type + @\")a;\n\t}\n}\";\n\t\t\tstring output = @\"\nusing System;\nclass TestClass\n{\n\tvoid Test (object a)\n\t{\n\t\tvar b = a as \" + type + @\";\n\t}\n}\";\n\t\t\tTest<ConvertCastToAsAction> (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTestType (\"Exception\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullable ()\n\t\t{\n\t\t\tTestType (\"int?\");\t\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonReferenceType ()\n\t\t{\n\t\t\tTestWrongContext<ConvertCastToAsAction> (@\"\nusing System;\nclass TestClass\n{\n\tvoid Test (object a)\n\t{\n\t\tvar b = ($int)a;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInsertParentheses ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass {\n\tvoid TestMethod (object o)\n\t{\n\t\tvar b = 1 + ($TestClass)o;\n\t}\n}\";\n\t\t\tstring output = @\"\nclass TestClass {\n\tvoid TestMethod (object o)\n\t{\n\t\tvar b = 1 + (o as TestClass);\n\t}\n}\";\n\t\t\tTest<ConvertCastToAsAction> (input, output);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertDecToHexTests.cs",
    "content": "// \n// ConvertDecToHexTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertDecToHexTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ConvertDecToHexAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint i = $16;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint i = 0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertDoWhileToWhileLoopTests.cs",
    "content": "// \n// ConvertDoWhileToWhileLoopTests.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{/* TOOD: Enable - it's not possible to compile this file on mono 3.0.7 due to an internal compiler error.\n\t[TestFixture]\n\tpublic class ConvertDoWhileToWhileLoopTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple()\n\t\t{\n\t\t\tTest<ConvertDoWhileToWhileLoopAction>(@\"\nclass Foo {\n\tvoid TestMethod() {\n\t\tint x = 1;\n\t\t$do\n\t\t\tx++;\n\t\twhile (x != 1);\n\t}\n}\", @\"\nclass Foo {\n\tvoid TestMethod() {\n\t\tint x = 1;\n\t\twhile (x != 1)\n\t\t\tx++;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledInContent()\n\t\t{\n\t\t\tTestWrongContext<ConvertDoWhileToWhileLoopAction>(@\"\nclass Foo {\n\tvoid TestMethod() {\n\t\tint x = 1;\n\t\tdo\n\t\t\t$x++;\n\t\twhile (x != 1);\n\t}\n}\");\n\t\t}\n\t}*/\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertEqualityOperatorToEqualsActionTests.cs",
    "content": "//\n// ConvertEqualityOperatorToEqualsActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertEqualityOperatorToEqualsActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestEquality ()\n\t\t{\n\t\t\tTest<ConvertEqualityOperatorToEqualsAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x $== y) {\n\t\t}\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (Equals (x, y)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInEquality ()\n\t\t{\n\t\t\tTest<ConvertEqualityOperatorToEqualsAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x $!= y) {\n\t\t}\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (!Equals (x, y)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEqualsFallback ()\n\t\t{\n\t\t\tTest<ConvertEqualityOperatorToEqualsAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x $== y) {\n\t\t}\n\t}\n\tpublic new static bool Equals (object o, object x)\n\t{\n\t\treturn false;\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (object.Equals (x, y)) {\n\t\t}\n\t}\n\tpublic new static bool Equals (object o, object x)\n\t{\n\t\treturn false;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertEqualsToEqualityOperatorActionTests.cs",
    "content": "//\n// ConvertEqualsToEqualityOperatorActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertEqualsToEqualityOperatorActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestEquality ()\n\t\t{\n\t\t\tTest<ConvertEqualsToEqualityOperatorAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif ($Equals (x, y)) {\n\t\t}\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x == y) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInEquality ()\n\t\t{\n\t\t\tTest<ConvertEqualsToEqualityOperatorAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (!$Equals (x, y)) {\n\t\t}\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x != y) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEqualsFallback ()\n\t\t{\n\t\t\tTest<ConvertEqualsToEqualityOperatorAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (object.$Equals (x, y)) {\n\t\t}\n\t}\n\tpublic new static bool Equals (object o, object x)\n\t{\n\t\treturn false;\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x == y) {\n\t\t}\n\t}\n\tpublic new static bool Equals (object o, object x)\n\t{\n\t\treturn false;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMemberReferencEquals ()\n\t\t{\n\t\t\tTest<ConvertEqualsToEqualityOperatorAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x.$Equals (y)) {\n\t\t}\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x == y) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegatedMemberReferencEquals ()\n\t\t{\n\t\t\tTest<ConvertEqualsToEqualityOperatorAction> (@\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (!x.$Equals (y)) {\n\t\t}\n\t}\n}\", @\"class FooBar\n{\n\tpublic void Foo (object x , object y)\n\t{\n\t\tif (x != y) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertExplicitToImplicitImplementationTests.cs",
    "content": "﻿// \n// ConvertExplicitToImplicitImplementationTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertExplicitToImplicitImplementationTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<ConvertExplicitToImplicitImplementationAction> (@\"\ninterface ITest\n{\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tvoid $ITest.Method ()\n\t{\n\t}\n}\", @\"\ninterface ITest\n{\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tpublic void Method ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExistingMethod ()\n\t\t{\n\t\t\tTestWrongContext<ConvertExplicitToImplicitImplementationAction> (@\"\ninterface ITest\n{\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tvoid $ITest.Method ()\n\t{\n\t}\n\tvoid Method ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonExplitiImplementation ()\n\t\t{\n\t\t\tTestWrongContext<ConvertExplicitToImplicitImplementationAction> (@\"\nclass TestClass\n{\n\tvoid $Method ()\n\t{\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertForToWhileActionTests.cs",
    "content": "//\n// ConvertForToWhileActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertForToWhileActionTests  : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleFor ()\n\t\t{\n\t\t\tTest<ConvertForToWhileAction>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\t$for (int i = 0, oLength = o.Length; i < oLength; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tint i = 0, oLength = o.Length;\n\t\twhile (i < oLength) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t\ti++;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMissingInitializer ()\n\t\t{\n\t\t\tTest<ConvertForToWhileAction>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\t$for (; i < oLength; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\twhile (i < oLength) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t\ti++;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMissingCondition ()\n\t\t{\n\t\t\tTest<ConvertForToWhileAction>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\t$for (int i = 0, oLength = o.Length;; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tint i = 0, oLength = o.Length;\n\t\twhile (true) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t\ti++;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInfiniteLoop ()\n\t\t{\n\t\t\tTest<ConvertForToWhileAction>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\t$for (;;) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\twhile (true) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleInitializersAndIterators ()\n\t\t{\n\t\t\tTest<ConvertForToWhileAction>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\t$for (i=0,j=0; i < oLength; i++,j++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\ti = 0;\n\t\tj = 0;\n\t\twhile (i < oLength) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t\ti++;\n\t\t\tj++;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertForeachToForTests.cs",
    "content": "// \n// ConvertForeachToForTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertForeachToForTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestArray ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ConvertForeachToForAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (string[] args)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\t$foreach (var v in args) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tConsole.WriteLine (v);\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (string[] args)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tfor (int i = 0; i < args.Length; i++) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tvar v = args [i];\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tConsole.WriteLine (v);\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestListOfT ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ConvertForeachToForAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"using System.Collections.Generic;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (List<string> args)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\t$foreach (var v in args) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tConsole.WriteLine (v);\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"using System.Collections.Generic;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (List<string> args)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tfor (int i = 0; i < args.Count; i++) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tvar v = args [i];\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tConsole.WriteLine (v);\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9876 - Convert to for loop created invalid code if iteration variable is called i\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9876 ()\n\t\t{\n\t\t\tTest<ConvertForeachToForAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$foreach (var i in new[] { 1, 2, 3 }) {\n\t\t\tConsole.WriteLine (i);\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar list = new[] {\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t};\n\t\tfor (int j = 0; j < list.Length; j++) {\n\t\t\tvar i = list [j];\n\t\t\tConsole.WriteLine (i);\n\t\t}\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestOptimizedForLoop ()\n\t\t{\n\t\t\tTest<ConvertForeachToForAction>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\t$foreach (var p in o) {\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tfor (int i = 0, oLength = o.Length; i < oLength; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumerableConversion ()\n\t\t{\n\t\t\tTest<ConvertForeachToForAction>(@\"\nusing System;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tpublic void Foo (IEnumerable<string> bar)\n\t{\n\t\t$foreach (var b in bar) {\n\t\t\tConsole.WriteLine (b);\n\t\t}\n\t}\n}\", @\"\nusing System;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tpublic void Foo (IEnumerable<string> bar)\n\t{\n\t\tfor (var i = bar.GetEnumerator (); i.MoveNext ();) {\n\t\t\tvar b = i.Current;\n\t\t\tConsole.WriteLine (b);\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertHasFlagsToBitwiseFlagComparisonActionTests.cs",
    "content": "//\n// ConvertHasFlagsToBitwiseFlagComparisonActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertHasFlagsToBitwiseFlagComparisonActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleHasFlag ()\n\t\t{\n\t\t\tTest<ConvertHasFlagsToBitwiseFlagComparisonAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (f.$HasFlag (Foo.A));\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & Foo.A) != 0);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegatedSimpleHasFlag ()\n\t\t{\n\t\t\tTest<ConvertHasFlagsToBitwiseFlagComparisonAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (!f.$HasFlag (Foo.A));\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & Foo.A) == 0);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestMultipleFlagsCase2 ()\n\t\t{\n\t\t\tTest<ConvertHasFlagsToBitwiseFlagComparisonAction>(@\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine (f.$HasFlag (Foo.A | Foo.B));\n\t}\n}\n\", @\"\n[Flags]\nenum Foo\n{\n\tA, B\n}\n\nclass FooBar\n{\n\tpublic void Bar (Foo f)\n\t{\n\t\tConsole.WriteLine ((f & (Foo.A & Foo.B)) != 0);\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertHexToDecTests.cs",
    "content": "// \n// ConvertHexToDecTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertHexToDecTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ConvertHexToDecAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint i = $0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint i = 16;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertIfStatementToConditionalTernaryExpressionActionTests.cs",
    "content": "//\n// ConvertIfStatementToConditionalTernaryExpressionActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertIfStatementToConditionalTernaryExpressionActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToConditionalTernaryExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\t$if (i > 0)\n\t\t\ta = 0;\n\t\telse {\n\t\t\ta = 1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\ta = i > 0 ? 0 : 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddAssignment ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToConditionalTernaryExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\t$if (i > 0)\n\t\t\ta += 0;\n\t\telse {\n\t\t\ta += 1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\ta += i > 0 ? 0 : 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfElse ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\t$if (i > 0)\n\t\t\ta = 0;\n\t\telse if (i < 5) {\n\t\t\ta = 1;\n\t\t} else {\n\t\t\ta = 2;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MultipleStatementsInIf ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\t$if (i > 0) {\n\t\t\ta = 0;\n\t\t\ta = 2;\n\t\t} else {\n\t\t\ta = 2;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDifferentAssignmentOperator ()\n\t\t{\n\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\t$if (i > 0)\n\t\t\ta += 0;\n\t\telse {\n\t\t\ta -= 1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Are there any cases where this is needed ?\")]\n\t\t[Test]\n\t\tpublic void TestInsertNecessaryParentheses ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToConditionalTernaryExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tint b;\n\t\t$if (i > 0)\n\t\t\ta = b = 0;\n\t\telse {\n\t\t\ta = 1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tint b;\n\t\ta = i > 0 ? (b = 0) : 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidImplicitElse ()\n\t\t{\n\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\t$if (i > 0)\n\t\t\ta = 0;\n\t\ta = 1;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertIfStatementToNullCoalescingExpressionActionTests.cs",
    "content": "﻿// \n// ConvertIfStatementToNullCoalescingExpressionActionTests.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertIfStatementToNullCoalescingExpressionActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestDeclaration ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo ();\n\t\t$if (o == null)\n\t\t\to = new object ();\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo () ?? new object ();\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new ConvertIfStatementToNullCoalescingExpressionAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestYodaConditionals ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo ();\n\t\t$if (null == o)\n\t\t\to = new object ();\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo () ?? new object ();\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new ConvertIfStatementToNullCoalescingExpressionAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o;\n\t\to = Foo ();\n\t\t$if (o == null)\n\t\t\to = new object ();\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o;\n\t\to = Foo () ?? new object ();\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new ConvertIfStatementToNullCoalescingExpressionAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsolated ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tobject o;\n\tvoid TestMethod()\n\t{\n\t\t$if (o == null)\n\t\t\to = new object ();\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nclass TestClass\n{\n\tobject o;\n\tvoid TestMethod()\n\t{\n\t\to = o ?? new object ();\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new ConvertIfStatementToNullCoalescingExpressionAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlock ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo ();\n\t\t$if (o == null)\n\t\t{\n\t\t\to = new object ();\n\t\t}\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo () ?? new object ();\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new ConvertIfStatementToNullCoalescingExpressionAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvertedCondition ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo ();\n\t\t$if (o != null)\n\t\t{\n\t\t} else {\n\t\t\to = new object ();\n\t\t}\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo () ?? new object ();\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new ConvertIfStatementToNullCoalescingExpressionAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForImproperCondition()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\treturn null;\n\t}\n\tvoid TestMethod()\n\t{\n\t\tobject o = Foo ();\n\t\t$if (o != null)\n\t\t{\n\t\t\to = new object ();\n\t\t}\n\t}\n}\n\";\n\n\t\t\tTestWrongContext<ConvertIfStatementToNullCoalescingExpressionAction>(input);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertIfStatementToReturnStatementActionTests.cs",
    "content": "﻿// \n// ConvertIfStatementToReturnStatementAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertIfStatementToReturnStatementActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToReturnStatementAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\t$if (i > 0)\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i > 0 ? 1 : 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfElseWithBlocks ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToReturnStatementAction>(@\"class Foo\n{\n\tbool Bar (string str)\n\t{\n\t\t$if (str.Length > 10) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}\", @\"class Foo\n{\n\tbool Bar (string str)\n\t{\n\t\treturn str.Length > 10;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestImplicitElse ()\n\t\t{\n\n\t\t\tTest<ConvertIfStatementToReturnStatementAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\t$if (i > 0)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i > 0 ? 1 : 0;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertIfStatementToSwitchStatementActionTests.cs",
    "content": "﻿// \n// ConvertIfToSwtichTests.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertIfStatementToSwitchStatementActionTests : ContextActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void TestBreak ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\tswitch (a) {\n\t\tcase 0:\n\t\t\tb = 0;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tb = 1;\n\t\t\tbreak;\n\t\tcase 2:\n\t\tcase 3:\n\t\t\tb = 2;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tb = 3;\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a == 0) {\n\t\t\tint b = 1;\n\t\t\treturn b + 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\treturn 2;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tswitch (a) {\n\t\tcase 0:\n\t\t\tint b = 1;\n\t\t\treturn b + 1;\n\t\tcase 2:\n\t\tcase 3:\n\t\t\treturn 2;\n\t\tdefault:\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConstantExpression ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int? a)\n\t{\n\t\t$if (a == (1 == 1 ? 11 : 12)) {\n\t\t\treturn 1;\n\t\t} else if (a == (2 * 3) + 1 || a == 6 / 2) {\n\t\t\treturn 2;\n\t\t} else if (a == null || a == (int)(10L + 2) || a == default(int) || a == sizeof(int)) {\n\t\t\treturn 3;\t\t\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int? a)\n\t{\n\t\tswitch (a) {\n\t\tcase (1 == 1 ? 11 : 12):\n\t\t\treturn 1;\n\t\tcase (2 * 3) + 1:\n\t\tcase 6 / 2:\n\t\t\treturn 2;\n\t\tcase null:\n\t\tcase (int)(10L + 2):\n\t\tcase default(int):\n\t\tcase sizeof(int):\n\t\t\treturn 3;\n\t\tdefault:\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\n\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tconst int b = 0;\n\tint TestMethod (int a)\n\t{\n\t\tconst int c = 1;\n\t\t$if (a == b) {\n\t\t\treturn 1;\n\t\t} else if (a == b + c) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tconst int b = 0;\n\tint TestMethod (int a)\n\t{\n\t\tconst int c = 1;\n\t\tswitch (a) {\n\t\tcase b:\n\t\t\treturn 1;\n\t\tcase b + c:\n\t\t\treturn 0;\n\t\tdefault:\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNestedOr ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a == 0) {\n\t\t\treturn 1;\n\t\t} else if ((a == 2 || a == 4) || (a == 3 || a == 5)) {\n\t\t\treturn 2;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tswitch (a) {\n\t\tcase 0:\n\t\t\treturn 1;\n\t\tcase 2:\n\t\tcase 4:\n\t\tcase 3:\n\t\tcase 5:\n\t\t\treturn 2;\n\t\tdefault:\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexSwitchExpression ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a, int b)\n\t{\n\t\t$if (a + b == 0) {\n\t\t\treturn 1;\n\t\t} else if (1 == a + b) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a, int b)\n\t{\n\t\tswitch (a + b) {\n\t\tcase 0:\n\t\t\treturn 1;\n\t\tcase 1:\n\t\t\treturn 0;\n\t\tdefault:\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonConstantExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int c)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == c) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int c)\n\t{\n\t\tint b;\n\t\t$if (a == c) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int c)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == c) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNonEqualityComparison ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a > 4) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidType ()\n\t\t{\n\t\t\t// enum\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nenum TestEnum\n{\n\tFirst,\n\tSecond,\n}\nclass TestClass\n{\n\tint TestMethod (TestEnum a)\n\t{\n\t\t$if (a == TestEnum.First) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\", @\"\nenum TestEnum\n{\n\tFirst,\n\tSecond,\n}\nclass TestClass\n{\n\tint TestMethod (TestEnum a)\n\t{\n\t\tswitch (a) {\n\t\tcase TestEnum.First:\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\n\t\t\t// string, bool, char, integral, nullable\n\t\t\tTestValidType (\"string\", \"\\\"test\\\"\");\n\t\t\tTestValidType (\"bool\", \"true\");\n\t\t\tTestValidType (\"char\", \"'a'\");\n\t\t\tTestValidType (\"byte\", \"0\");\n\t\t\tTestValidType (\"sbyte\", \"0\");\n\t\t\tTestValidType (\"short\", \"0\");\n\t\t\tTestValidType (\"long\", \"0\");\n\t\t\tTestValidType (\"ushort\", \"0\");\n\t\t\tTestValidType (\"uint\", \"0\");\n\t\t\tTestValidType (\"ulong\", \"0\");\n\t\t\tTestValidType (\"bool?\", \"null\");\n\t\t}\n\n\t\tvoid TestValidType (string type, string caseValue)\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tint TestMethod (\" + type + @\" a)\n\t{\n\t\t$if (a == \" + caseValue + @\") {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (\" + type + @\" a)\n\t{\n\t\tswitch (a) {\n\t\tcase \" + caseValue + @\":\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidType ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (double a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoElse()\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\tswitch (a) {\n\t\tcase 0:\n\t\t\tb = 0;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tb = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestNestedIf ()\n\t\t{\n\t\t\tTest<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tif (b == 0)\n\t\t\t\treturn;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\tswitch (a) {\n\t\tcase 0:\n\t\t\tif (b == 0)\n\t\t\t\treturn;\n\t\t\tbreak;\n\t\tcase 2:\n\t\tcase 3:\n\t\t\tb = 2;\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\twhile (true) {\n\t\t\t$if (a == 0) {\n\t\t\t\tb = 0;\n\t\t\t} else if (a == 1) {\n\t\t\t\tb = 1;\n\t\t\t} else if (a == 2 || a == 3) {\n\t\t\t\tb = 2;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestInvalidCase2 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\twhile (true) {\n\t\t\t$if (a == 0) {\n\t\t\t\tbreak;\n\t\t\t} else if (a == 1) {\n\t\t\t\tb = 1;\n\t\t\t} else {\n\t\t\t\tb = 2;\n\t\t\t}\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertImplicitToExplicittImplementationTests.cs",
    "content": "﻿// \n// ConvertImplicitToExplicittImplementationTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertImplicitToExplicittImplementationTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<ConvertImplicitToExplicitImplementationAction> (@\"\ninterface ITest\n{\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tpublic void $Method ()\n\t{\n\t}\n}\", @\"\ninterface ITest\n{\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tvoid ITest.Method ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleInterfaces ()\n\t\t{\n\t\t\tTestWrongContext<ConvertImplicitToExplicitImplementationAction> (@\"\ninterface ITest\n{\n\tvoid Method ();\n}\ninterface ITest2\n{\n\tvoid Method ();\n}\nclass TestClass : ITest, ITest2\n{\n\tvoid $Method ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonImplicitImplementation ()\n\t\t{\n\t\t\tTestWrongContext<ConvertImplicitToExplicitImplementationAction> (@\"\nclass TestClass\n{\n\tvoid $Method ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceMethod ()\n\t\t{\n\t\t\tTestWrongContext<ConvertImplicitToExplicitImplementationAction> (@\"\ninterface ITest\n{\n\tvoid Method ();\n}\ninterface ITest2 : ITest\n{\n\tvoid $Method ();\n}\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertLambdaBodyExpressionToStatementTests.cs",
    "content": "﻿// \n// ConvertLambdaBodyExpressionToStatementTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertLambdaBodyExpressionToStatementTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tTest<ConvertLambdaBodyExpressionToStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = i $=> i + 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = i => {\n\t\t\treturn i + 1;\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExprStatement()\n\t\t{\n\t\t\tTest<ConvertLambdaBodyExpressionToStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> f = i $=> i++;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> f = i => {\n\t\t\ti++;\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongContext ()\n\t\t{\n\t\t\tTestWrongContext<ConvertLambdaBodyExpressionToStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = i $=> {\n\t\t\treturn i + 1;\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParenthesis ()\n\t\t{\n\t\t\tTest<ConvertLambdaBodyExpressionToStatementAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f;\n\t\tf = (i $=> i + 1);\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f;\n\t\tf = (i => {\n\t\t\treturn i + 1;\n\t\t});\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvocation ()\n\t\t{\n\t\t\tTest<ConvertLambdaBodyExpressionToStatementAction> (@\"\nclass TestClass\n{\n\tvoid Test (int k, System.Func<int, int> f) { }\n\tvoid TestMethod ()\n\t{\n\t\tTest (1, i $=> i + 1);\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Test (int k, System.Func<int, int> f) { }\n\tvoid TestMethod ()\n\t{\n\t\tTest (1, i => {\n\t\t\treturn i + 1;\n\t\t});\n\t}\n}\");\n\t\t\tTest<ConvertLambdaBodyExpressionToStatementAction> (@\"\nclass TestClass\n{\n\tvoid Test2 (System.Action<int> a) { }\n\tvoid TestMethod ()\n\t{\n\t\tTest2 (i $=> i++);\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Test2 (System.Action<int> a) { }\n\tvoid TestMethod ()\n\t{\n\t\tTest2 (i => {\n\t\t\ti++;\n\t\t});\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertLambdaBodyStatementToExpressionTests.cs",
    "content": "﻿// \n// ConvertLambdaBodyStatementToExpressionTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertLambdaBodyStatementToExpressionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tTest<ConvertLambdaBodyStatementToExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = i $=> {\n\t\t\treturn i + 1;\n\t\t};\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = i => i + 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExpressionStatement ()\n\t\t{\n\t\t\tTest<ConvertLambdaBodyStatementToExpressionAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> f = i $=> {\n\t\t\tSystem.Console.Write (i);\n\t\t};\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> f = i => System.Console.Write (i);\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertLamdaToAnonymousDelegateTests.cs",
    "content": "//\n// ConvertLambdaToDelegateAction.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertLamdaToAnonymousDelegateTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void LambdaBlock ()\n\t\t{\n\t\t\tTest<ConvertLambdaToAnonymousDelegateAction>(@\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action<int, int> = (i1, i2)$ => { System.Console.WriteLine (i1); };\n\t}\n}\", @\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action<int, int> = delegate (int i1, int i2) {\n\t\t\tSystem.Console.WriteLine (i1);\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void LambdaExpression ()\n\t\t{\n\t\t\tTest<ConvertLambdaToAnonymousDelegateAction>(@\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action<int, int> = (i1, i2)$ => System.Console.WriteLine (i1);\n\t}\n}\", @\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action<int, int> = delegate (int i1, int i2) {\n\t\t\tSystem.Console.WriteLine (i1);\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NonVoidExpressionTest ()\n\t\t{\n\t\t\tTest<ConvertLambdaToAnonymousDelegateAction>(@\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Func<int> = ()$ => 1;\n\t}\n}\", @\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Func<int> = delegate {\n\t\t\treturn 1;\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParameterLessLambdaTest ()\n\t\t{\n\t\t\tTest<ConvertLambdaToAnonymousDelegateAction>(@\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action = ()$ => { System.Console.WriteLine (); };\n\t}\n}\", @\"\nclass A\n{\n\tvoid F ()\n\t{\n\t\tSystem.Action = delegate {\n\t\t\tSystem.Console.WriteLine ();\n\t\t};\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertMethodGroupToAnonymousMethodActionTests.cs",
    "content": "//\n// ConvertMethodGroupToAnonymousMethodActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertMethodGroupToAnonymousMethodActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVoidMethod ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToAnonymousMethodAction>(@\"\nusing System;\npublic class Test\n{\n\tvoid Foo ()\n\t{\n\t\tAction act = $Foo;\n\t}\n}\n\", @\"\nusing System;\npublic class Test\n{\n\tvoid Foo ()\n\t{\n\t\tAction act = delegate {\n\tFoo ();\n};\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameter ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToAnonymousMethodAction>(@\"\nusing System;\npublic class Test\n{\n\tvoid Foo (int x, int y)\n\t{\n\t\tAction<int,int> act = $Foo;\n\t}\n}\n\", @\"\nusing System;\npublic class Test\n{\n\tvoid Foo (int x, int y)\n\t{\n\t\tAction<int,int> act = delegate (int arg1, int arg2) {\n\tFoo (arg1, arg2);\n};\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestFunction ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToAnonymousMethodAction>(@\"\nusing System;\npublic class Test\n{\n\tbool Foo (int x, int y)\n\t{\n\t\tFunc<int,int,bool> act = $Foo;\n\t}\n}\n\", @\"\nusing System;\npublic class Test\n{\n\tbool Foo (int x, int y)\n\t{\n\t\tFunc<int,int,bool> act = delegate (int arg1, int arg2) {\n\treturn Foo (arg1, arg2);\n};\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestOverloads ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToAnonymousMethodAction>(@\"\nusing System;\npublic class Test\n{\n\tstatic void Foo (int x) { }\n\tstatic void Foo (int x, int y) { }\n\tstatic void Foo () { }\n\n\tvoid Bar ()\n\t{\n\t\tAction<int, int> act = Test.$Foo;\n\t}\n}\", @\"\nusing System;\npublic class Test\n{\n\tstatic void Foo (int x) { }\n\tstatic void Foo (int x, int y) { }\n\tstatic void Foo () { }\n\n\tvoid Bar ()\n\t{\n\t\tAction<int, int> act = delegate (int arg1, int arg2) {\n\t\t\tTest.Foo (arg1, arg2);\n\t\t};\n\t}\n}\");\n\t\t}\n\t\n\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertMethodGroupToLambdaActionTests.cs",
    "content": "//\n// ConvertMethodGroupToLambdaActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertMethodGroupToLambdaActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVoidMethod ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToLambdaAction>(@\"\nusing System;\npublic class Test\n{\n\tvoid Foo ()\n\t{\n\t\tAction act = $Foo;\n\t}\n}\n\", @\"\nusing System;\npublic class Test\n{\n\tvoid Foo ()\n\t{\n\t\tAction act = () => Foo ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameter ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToLambdaAction>(@\"\nusing System;\npublic class Test\n{\n\tvoid Foo (int x, int y)\n\t{\n\t\tAction<int,int> act = $Foo;\n\t}\n}\n\", @\"\nusing System;\npublic class Test\n{\n\tvoid Foo (int x, int y)\n\t{\n\t\tAction<int,int> act = (arg1, arg2) => Foo (arg1, arg2);\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestFunction ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToLambdaAction>(@\"\nusing System;\npublic class Test\n{\n\tbool Foo (int x, int y)\n\t{\n\t\tFunc<int,int,bool> act = $Foo;\n\t}\n}\n\", @\"\nusing System;\npublic class Test\n{\n\tbool Foo (int x, int y)\n\t{\n\t\tFunc<int,int,bool> act = (arg1, arg2) => Foo (arg1, arg2);\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestOverloads ()\n\t\t{\n\t\t\tTest<ConvertMethodGroupToLambdaAction>(@\"\nusing System;\npublic class Test\n{\n\tstatic void Foo (int x) { }\n\tstatic void Foo (int x, int y) { }\n\tstatic void Foo () { }\n\n\tvoid Bar ()\n\t{\n\t\tAction<int, int> act = Test.$Foo;\n\t}\n}\", @\"\nusing System;\npublic class Test\n{\n\tstatic void Foo (int x) { }\n\tstatic void Foo (int x, int y) { }\n\tstatic void Foo () { }\n\n\tvoid Bar ()\n\t{\n\t\tAction<int, int> act = (arg1, arg2) => Test.Foo (arg1, arg2);\n\t}\n}\");\n\t\t}\n\t\n\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertMultiplyToShiftActionTests.cs",
    "content": "//\n// ConvertMultiplyToShiftActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertMultiplyToShiftActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestMultiply ()\n\t\t{\n\t\t\tTest<ConvertMultiplyToShiftAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i $* 256;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i << 8;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDivide ()\n\t\t{\n\t\t\tTest<ConvertMultiplyToShiftAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i $/ 16;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i >> 4;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvaid ()\n\t\t{\n\t\t\tTestWrongContext<ConvertMultiplyToShiftAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i $* 255;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertNullCoalescingToConditionalExpressionActionTests.cs",
    "content": "//\n// ConvertNullCoalescingToConditionalExpressionActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertNullCoalescingToConditionalExpressionActionTests: ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<ConvertNullCoalescingToConditionalExpressionAction>(@\"\nclass Test\n{\n\tobject Foo (object o, object p)\n\t{\n\t\treturn o $?? p;\n\t}\n}\n\", @\"\nclass Test\n{\n\tobject Foo (object o, object p)\n\t{\n\t\treturn o != null ? o : p;\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertReturnStatementToIfActionTests.cs",
    "content": "//\n// ConvertReturnStatementToIfActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertReturnStatementToIfActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestConditionalOperator ()\n\t\t{\n\t\t\tTest<ConvertReturnStatementToIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\t$return i > 0 ? 1 : 0;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tif (i > 0)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCoalescingOperator ()\n\t\t{\n\t\t\tTest<ConvertReturnStatementToIfAction> (@\"\nclass Test\n{\n\tobject Foo (object o, object p)\n\t{\n\t\t$return o ?? p;\n\t}\n}\", @\"\nclass Test\n{\n\tobject Foo (object o, object p)\n\t{\n\t\tif (o != null)\n\t\t\treturn o;\n\t\treturn p;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertShiftToMultiplyActionTests.cs",
    "content": "//\n// ConvertShiftToMultiplyActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertShiftToMultiplyActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestShiftLeft ()\n\t\t{\n\t\t\tTest<ConvertShiftToMultiplyAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i $<< 8;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i * 256;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestShiftRight ()\n\t\t{\n\t\t\tTest<ConvertShiftToMultiplyAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i $>> 4;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\treturn i / 16;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertSwitchToIfTests.cs",
    "content": "﻿// \n// ConvertSwitchToIfTests.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertSwitchToIfTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tTest<ConvertSwitchToIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$switch (a) {\n\t\tcase 0:\n\t\t\treturn 0;\n\t\tcase 1:\n\t\tcase 2:\n\t\t\treturn 1;\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\treturn 2;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a == 0) {\n\t\t\treturn 0;\n\t\t} else if (a == 1 || a == 2) {\n\t\t\treturn 1;\n\t\t} else if (a == 3 || a == 4 || a == 5) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 2;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithoutDefault ()\n\t\t{\n\t\t\tTest<ConvertSwitchToIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$switch (a) {\n\t\tcase 0:\n\t\t\treturn 0;\n\t\tcase 1:\n\t\tcase 2:\n\t\t\treturn 1;\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\t\treturn 1;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a == 0) {\n\t\t\treturn 0;\n\t\t} else if (a == 1 || a == 2) {\n\t\t\treturn 1;\n\t\t} else if (a == 3 || a == 4 || a == 5) {\n\t\t\treturn 1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBreak ()\n\t\t{\n\t\t\tTest<ConvertSwitchToIfAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\t$switch (a) {\n\t\tcase 0:\n\t\t\tint b = 1;\n\t\t\tbreak;\n\t\tcase 1:\n\t\tcase 2:\n\t\t\tbreak;\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tif (a == 0) {\n\t\t\tint b = 1;\n\t\t} else if (a == 1 || a == 2) {\n\t\t} else if (a == 3 || a == 4 || a == 5) {\n\t\t} else {\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOperatorPriority ()\n\t\t{\n\t\t\tTest<ConvertSwitchToIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$switch (a) {\n\t\tcase 0:\n\t\t\treturn 0;\n\t\tcase 1 == 1 ? 1 : 2:\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\treturn 2;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a == 0) {\n\t\t\treturn 0;\n\t\t} else if (a == (1 == 1 ? 1 : 2)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 2;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmptySwitch ()\n\t\t{\n\t\t\tTestWrongContext<ConvertSwitchToIfAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\t$switch (a)\n\t\t{\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchWithDefaultOnly ()\n\t\t{\n\t\t\tTestWrongContext<ConvertSwitchToIfAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\t$switch (a)\n\t\t{\n\t\t\tcase 0:\n\t\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNonTrailingBreak ()\n\t\t{\n\t\t\tTestWrongContext<ConvertSwitchToIfAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int b)\n\t{\n\t\t$switch (a)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tif (b == 0) break;\n\t\t\t\tb = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertToInitializer/ConvertInitializerToExplicitIntializationsTests.cs",
    "content": "//\n// ConvertInitializerToExplicitIntializationsTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertInitializerToExplicitIntializationsTests : ContextActionTestBase\n\t{\n\t\tstring baseText = @\"\nclass TestClass\n{\n\tpublic string Property { get; set; }\n\n\tpublic TestClass Nested { get; set; }\n\n\tvoid F ()\n\t{\n\t\t\";\n\t\t\n\t\t[Test]\n\t\tpublic void SingleLevelObjectIntializer ()\n\t\t{\n\t\t\tTest<ConvertInitializerToExplicitInitializationsAction>(baseText + @\"\n\t\tvar variable = new Test$Class () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\", baseText + @\"\n\t\tvar testClass = new TestClass ();\n\t\ttestClass.Property = \"\"Value\"\";\n\t\tvar variable = testClass;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ObjectCreateExpressionWithoutObjectInitializer ()\n\t\t{\n\t\t\tTest<ConvertInitializerToExplicitInitializationsAction>(baseText + @\"\n\t\tvar variable $= new System.Collection.Generic.List<TestClass> () {\n\t\t\tnew TestClass () {\n\t\t\t\tProperty = \"\"One\"\",\n\t\t\t\tNested = new TestClass ()\n\t\t\t}\n\t\t};\n\t}\n}\", baseText + @\"\n\t\tvar list = new System.Collection.Generic.List<TestClass> ();\n\t\tvar testClass = new TestClass ();\n\t\ttestClass.Property = \"\"One\"\";\n\t\ttestClass.Nested = new TestClass ();\n\t\tlist.Add (testClass);\n\t\tvar variable = list;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SingleLevelObjectIntializerToExistingVariable ()\n\t\t{\n\t\t\tTest<ConvertInitializerToExplicitInitializationsAction>(baseText + @\"\n\t\tvar variable = new TestClass ();\n\t\tvariable = new Test$Class () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass ();\n\t\tvar testClass = new TestClass ();\n\t\ttestClass.Property = \"\"Value\"\";\n\t\tvariable = testClass;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SingleLevelCollectionIntializer ()\n\t\t{\n\t\t\tTest<ConvertInitializerToExplicitInitializationsAction>(baseText + @\"\n\t\tvar variable $= new System.Collection.Generic.Dictionary<string, TestClass> () {\n\t\t\t{\"\"Key1\"\", new TestClass { Property = \"\"Value1\"\", Nested = { Property = \"\"Value1b\"\" }}}\n\t\t};\n\t}\n}\", baseText + @\"\n\t\tvar dictionary = new System.Collection.Generic.Dictionary<string, TestClass> ();\n\t\tvar testClass = new TestClass ();\n\t\ttestClass.Property = \"\"Value1\"\";\n\t\ttestClass.Nested.Property = \"\"Value1b\"\";\n\t\tdictionary.Add (\"\"Key1\"\", testClass);\n\t\tvar variable = dictionary;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CollectionOfIntializers ()\n\t\t{\n\t\t\tTest<ConvertInitializerToExplicitInitializationsAction>(baseText + @\"\n\t\tvar variable $= new System.Collection.Generic.Dictionary<string, TestClass> () {\n\t\t\t{\"\"Key1\"\", new TestClass { Property = \"\"Value1\"\", Nested = { Property = \"\"Value1b\"\" }}}\n\t\t};\n\t}\n}\", baseText + @\"\n\t\tvar dictionary = new System.Collection.Generic.Dictionary<string, TestClass> ();\n\t\tvar testClass = new TestClass ();\n\t\ttestClass.Property = \"\"Value1\"\";\n\t\ttestClass.Nested.Property = \"\"Value1b\"\";\n\t\tdictionary.Add (\"\"Key1\"\", testClass);\n\t\tvar variable = dictionary;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertToInitializer/ConvertToInitializerTests.cs",
    "content": "//\n// ConvertToInitializerTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertToInitializerTests : ContextActionTestBase\n\t{\n\t\t// TODO: Remove this when the formatter handles object and collection initializers\n\t\t// This tests the expected code vs the actual code based on their ASTs instead of the text they produce.\n\t\tpublic new void Test<T>(string input, string output, int action = 0, bool expectErrors = false)\n\t\t\twhere T : CodeActionProvider, new ()\n\t\t{\n\t\t\tstring result = RunContextAction(new T(), HomogenizeEol(input), action, expectErrors);\n\n\t\t\tvar expectedContext = TestRefactoringContext.Create(output, expectErrors);\n\t\t\tvar actualContext = TestRefactoringContext.Create(result, expectErrors);\n\n\t\t\tbool passed = expectedContext.RootNode.IsMatch(actualContext.RootNode);\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"-----------Expected:\");\n\t\t\t\tConsole.WriteLine(output);\n\t\t\t\tConsole.WriteLine(\"-----------Got:\");\n\t\t\t\tConsole.WriteLine(result);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed, \"The generated code and the expected code was not syntactically identical. See output for details.\");\n\t\t}\n\n\t\tstring baseText = @\"\nclass TestClass\n{\n\tpublic string Property { get; set; }\n\n\tpublic TestClass Nested { get; set; }\n\n\tvoid F ()\n\t{\n\t\t\";\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleObject()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleCollection()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List$<string> ();\n\t\tcollection.Add(\"\"string1\"\");\n\t\tcollection.Add(\"\"string2\"\");\n\t}\n}\", baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List<string> () {\n\t\t\t\"\"string1\"\",\n\t\t\t\"\"string2\"\"\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultiElementCollection()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar tc0 = new TestClass();\n\t\tvar collection = new System.Collections.Generic.Dictionary$<string, TestClass> ();\n\t\tvar tc1 = new TestClass();\n\t\ttc1.Property = \"\"tc1\"\";\n\t\tcollection.Add(\"\"string1\"\", tc1);\n\t\tvar tc2 = new TestClass();\n\t\ttc2.Property = \"\"tc2\"\";\n\t\tcollection.Add(\"\"string2\"\", tc2);\n\t\tcollection.Add(\"\"string0\"\", tc0);\n\t}\n}\", baseText + @\"\n\t\tvar tc0 = new TestClass();\n\t\tvar collection = new System.Collections.Generic.Dictionary<string, TestClass> () {\n\t\t\t{\"\"string1\"\", new TestClass() { Property = \"\"tc1\"\" }},\n\t\t\t{\"\"string2\"\", new TestClass() { Property = \"\"tc2\"\" }}\n\t\t};\n\t\tcollection.Add(\"\"string0\"\", tc0);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CollectionOfObjects()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List$<string> ();\n\t\tvar item = new TestClass ();\n\t\titem.Property = \"\"Value1\"\";\n\t\tcollection.Add(item);\n\t\titem = new TestClass ();\n\t\titem.Property = \"\"Value2\"\";\n\t\titem.Nested = new TestClass ();\n\t\titem.Nested.Property = \"\"Value3\"\";\n\t\tcollection.Add(item);\n\t}\n}\", baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List<string> () {\n\t\t\tnew TestClass () {\n\t\t\t\tProperty = \"\"Value1\"\"\n\t\t\t},\n\t\t\tnew TestClass () {\n\t\t\t\tProperty = \"\"Value2\"\",\n\t\t\t\tNested = new TestClass () {\n\t\t\t\t\tProperty = \"\"Value3\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownTargetForAdd()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List<string> ();\n\t\tvar item $= new TestClass ();\n\t\titem.Property = \"\"Value1\"\";\n\t\tcollection.Add(item);\n\t}\n}\", baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List<string> ();\n\t\tvar item = new TestClass () {\n\t\t\tProperty = \"\"Value1\"\"\n\t\t};\n\t\tcollection.Add(item);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ObjectContainingCollections()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value1\"\";\n\t\tvar collection = new System.Collections.Generic.List<TestClass>();\n\t\tcollection.Add (new TestClass());\n\t\tcollection.Add (new TestClass());\n\t\tcollection.Add (new TestClass());\n\t\tvariable.Children = collection;\n\t}\n\t\n\tpublic System.Collections.Generic.IList<TestClass> Children;\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value1\"\",\n\t\t\tChildren = new System.Collections.Generic.List<TestClass> () {\n\t\t\t\tnew TestClass (),\n\t\t\t\tnew TestClass (),\n\t\t\t\tnew TestClass ()\n\t\t\t}\n\t\t};\n\t}\n\t\n\tpublic System.Collections.Generic.IList<TestClass> Children;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SplitAssignmentAndInitialization()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tTestClass variable;\n\t\tvariable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t}\n}\", baseText + @\"\n\t\tTestClass variable;\n\t\tvariable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MemberAssignment()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tNested = new Test$Class ();\n\t\tNested.Property = \"\"Value\"\";\n\t}\n}\", baseText + @\"\n\t\tNested = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleMemberAssignments()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tNested = new Test$Class ();\n\t\tNested = new TestClass ();\n\t\tNested.Property = \"\"Value\"\";\n\t}\n}\", baseText + @\"\n\t\tNested = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NonCreatingInitialization()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Nested.Nested.Property = \"\"Value\"\";\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tNested = {\n\t\t\t\tNested = {\n\t\t\t\t\tProperty = \"\"Value\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresLinesPreceedingInitialization()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tSystem.Console.WriteLine(\"\"One\"\");\n\t\tfor(;;) {\n\t\t\tSystem.Console.WriteLine(\"\"Two\"\");\n\t\t}\n\t\tSystem.Console.WriteLine(\"\"Three\"\");\n\t\tTestClass variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t}\n}\", baseText + @\"\n\t\tSystem.Console.WriteLine(\"\"One\"\");\n\t\tfor(;;) {\n\t\t\tSystem.Console.WriteLine(\"\"Two\"\");\n\t\t}\n\t\tSystem.Console.WriteLine(\"\"Three\"\");\n\t\tTestClass variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedObject()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t\tvariable.Nested = new TestClass();\n\t\tvariable.Nested.Property = \"\"NestedValue\"\";\n\t\tvariable.Nested.Nested = new TestClass();\n\t\tvariable.Nested.Nested.Property = \"\"NestedNestedValue\"\";\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\",\n\t\t\tNested = new TestClass () {\n\t\t\t\tProperty = \"\"NestedValue\"\",\n\t\t\t\tNested = new TestClass () {\n\t\t\t\t\tProperty = \"\"NestedNestedValue\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedObjectWithSkippedLevel()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t\tvariable.Nested.Nested = new TestClass();\n\t\tvariable.Nested.Nested.Property = \"\"NestedNestedValue\"\";\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\",\n\t\t\tNested = {\n\t\t\t\tNested = new TestClass () {\n\t\t\t\t\tProperty = \"\"NestedNestedValue\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KeepsOriginalInitializer()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t\tvariable.Nested = new TestClass();\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\",\n\t\t\tNested = new TestClass ()\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"The pattern matching comparison does not find differences in comments. UnIgnore this when the regular test method is used again.\")]\n\t\tpublic void MovesComments()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t\t// This comment should be placed above the initializer corresponding to the statement below\n\t\t// This line should too.\n\t\tvariable.Nested = new TestClass();\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\",\n\t\t\t// This comment should be placed above the initializer corresponding to the statement below\n\t\t\t// This line should too.\n\t\t\tNested = new TestClass ()\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StopsAtArbitraryStatement()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t\tvariable.Nested = new TestClass();\n\t\tSystem.Console.WriteLine(\"\"\"\");\n\t\tvariable.Nested.Property = \"\"NestedValue\"\";\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\",\n\t\t\tNested = new TestClass ()\n\t\t};\n\t\tSystem.Console.WriteLine(\"\"\"\");\n\t\tvariable.Nested.Property = \"\"NestedValue\"\";\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StopsAtVariableDependentStatement()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t\tvariable.Nested = new TestClass();\n\t\tvariable.Nested.Property = variable.ToString();\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\",\n\t\t\tNested = new TestClass ()\n\t\t};\n\t\tvariable.Nested.Property = variable.ToString();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StopsAtVariableDependentCreationStatement()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t\tvar nested = new TestClass(variable);\n\t\tvariable.Nested = nested;\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t\tvar nested = new TestClass(variable);\n\t\tvariable.Nested = nested;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesIrrelevantAccessesAtTheEnd()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar tc = new TestClass();\n\t\ttc.Property = \"\"1\"\";\n\t\tvar tc$2 = new TestClass();\n\t\ttc2.Property = \"\"2\"\";\n\t\ttc2.Nested = new TestClass();\n\t\ttc2.Nested.Property = \"\"3\"\";\n\t\ttc.Nested = tc2;\n\t}\n}\", baseText + @\"\n\t\tvar tc = new TestClass();\n\t\ttc.Property = \"\"1\"\";\n\t\tvar tc2 = new TestClass () {\n\t\t\tProperty = \"\"2\"\",\n\t\t\tNested = new TestClass () {\n\t\t\t\tProperty = \"\"3\"\"\n\t\t\t}\n\t\t};\n\t\ttc.Nested = tc2;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void HandlesAssignmentWhereRightExpressionIsNotVisited()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar tc = new TestClass();\n\t\ttc.Property = \"\"1\"\";\n\t\tvar tc$2 = new TestClass();\n\t\ttc2.Property = \"\"2\"\";\n\t\ttc2.Nested = tc;\n\t\ttc.Nested = tc2;\n\t}\n}\", baseText + @\"\n\t\tvar tc = new TestClass();\n\t\ttc.Property = \"\"1\"\";\n\t\tvar tc2 = new TestClass () {\n\t\t\tProperty = \"\"2\"\",\n\t\t\tNested = tc\n\t\t};\n\t\ttc.Nested = tc2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesAssignmentToExistingVariable()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t\tvariable = new TestClass();\n\t\tvariable.Nested = new TestClass();\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tNested = new TestClass ()\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void HandlesAssignmentToFinalVariable()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar _variable = new Test$Class ();\n\t\t_variable.Property = \"\"Value\"\";\n\t\tvar variable = _variable;\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FinalVariableAssignmentOfOtherInitializer()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar tc $= new TestClass ();\n\t\ttc.Property = \"\"Value\"\";\n\t\tvar _variable = new TestClass ();\n\t\tvar variable = _variable;\n\t}\n}\", baseText + @\"\n\t\tvar tc = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t\tvar _variable = new TestClass ();\n\t\tvar variable = _variable;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StopsAtMemberDependentStatement()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tNested = new Test$Class ();\n\t\tNested.Nested = new TestClass();\n\t\tNested.Property = \"\"Value\"\";\n\t\tNested.Nested.Property = Nested.Property;\n\t\tNested.Nested.Nested = new TestClass();\n\t}\n}\", baseText + @\"\n\t\tNested = new TestClass () {\n\t\t\tNested = new TestClass (),\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t\tNested.Nested.Property = Nested.Property;\n\t\tNested.Nested.Nested = new TestClass();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KeepsStatementsWhichAreNotAdded()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List$<string> ();\n\t\tvar item = new TestClass ();\n\t\titem.Property = \"\"Value1\"\";\n\t\tcollection.Add(item);\n\t\titem = new TestClass ();\n\t\titem.Property = \"\"Value2\"\";\n\t\titem.Nested = new TestClass ();\n\t\titem.Nested.Property = \"\"Value3\"\";\n\t\tcollection.Add(item);\n\t\t// This should stay here\n\t\titem = new TestClass();\n\t}\n}\", baseText + @\"\n\t\tvar collection = new System.Collections.Generic.List<string> () {\n\t\t\tnew TestClass () {\n\t\t\t\tProperty = \"\"Value1\"\"\n\t\t\t},\n\t\t\tnew TestClass () {\n\t\t\t\tProperty = \"\"Value2\"\",\n\t\t\t\tNested = new TestClass () {\n\t\t\t\t\tProperty = \"\"Value3\"\"\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// This should stay here\n\t\titem = new TestClass();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StopsAtUnresolvableAssignmentTarget()\n\t\t{\n\t\t\tTest<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvariable.Property = \"\"Value\"\";\n\t\tVariable.Nested = new TestClass();\n\t}\n}\", baseText + @\"\n\t\tvar variable = new TestClass () {\n\t\t\tProperty = \"\"Value\"\"\n\t\t};\n\t\tVariable.Nested = new TestClass();\n\t}\n}\"\n\t\t\t                                 );\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoActionForSingleStepInitializers()\n\t\t{\n\t\t\tTestWrongContext<ConvertToInitializerAction>(baseText + @\"\n\t\tvar variable = new Test$Class ();\n\t\tvar s = string.Empty;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresNonCreation()\n\t\t{\n\t\t\tTestWrongContext<ConvertToInitializerAction>(@\"\nclass TestClass\n{\n\tvoid F()\n\t{\n\t\tSystem.Console.$WriteLine(\"\"\"\");\n\t\tvar variable = new TestClass();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresSingleCreation()\n\t\t{\n\t\t\tTestWrongContext<ConvertToInitializerAction>(@\"\nclass TestClass\n{\n\tvoid F()\n\t{\n\t\tvar variable = new $TestClass();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotCrashOnDeclarationInitializedToVariable()\n\t\t{\n\t\t\tTestWrongContext<ConvertToInitializerAction>(@\"\nclass TestClass\n{\n\tvoid F()\n\t{\n\t\tvar s = \"\"\"\";\n\t\ts$ = \"\"2\"\";\n\t\t// And another statement to make the converter even try\n\t\ts = \"\"\"\";\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotCrashOnVariableDeclarationWithoutInitializer()\n\t\t{\n\t\t\tTestWrongContext<ConvertToInitializerAction>(@\"\nclass TestClass\n{\n\tvoid F()\n\t{\n\t\tTestClass $s1 = new TestClass();\n\t\tTestClass s2;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotCrashOnDelegateAssignment()\n\t\t{\n\t\t\tTestWrongContext<ConvertToInitializerAction>(@\"\nusing System;\nusing System.Collections.Generic;\nclass TestClass {\n\tvoid F() {\n\t\t((CheckBox)ControlDictionary[\"\"ReplaceCheckBox\"\"]).CheckedChanged = new E$ventHandler(ReplaceCheckBox_CheckedChanged);\n\t}\n\tDictionary<string, Control> ControlDictionary;\n\tvoid ReplaceCheckBox_CheckedChanged(object sender, EventArgs e) {}\n}\nclass Control {}\nclass CheckBox : Control {\n\tpublic EventHandler CheckedChanged;\n}\n\");\n\t\t\t\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ConvertWhileToDoWhileLoopTests.cs",
    "content": "// \n// ConvertWhileToDoWhileLoopTests.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ConvertWhileToDoWhileLoopTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple() {\n\t\t\tTest<ConvertWhileToDoWhileLoopAction>(@\"\nclass Foo {\n\tvoid Bar(int x) {\n\t\t$while (x > 0) x++;\n\t}\n}\", @\"\nclass Foo {\n\tvoid Bar(int x) {\n\t\tdo\n\t\t\tx++;\n\t\twhile (x > 0);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlock() {\n\t\t\tTest<ConvertWhileToDoWhileLoopAction>(@\"\nclass Foo {\n\tvoid Bar(int x) {\n\t\t$while (x > 0) { x++; }\n\t}\n}\", @\"\nclass Foo {\n\tvoid Bar(int x) {\n\t\tdo {\n\t\t\tx++;\n\t\t}\n\t\twhile (x > 0);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledOutOfToken() {\n\t\t\tTestWrongContext<ConvertWhileToDoWhileLoopAction>(@\"\nclass Foo {\n\tvoid Bar(int x) {\n\t\twhile (x > 0) $x++;\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CopyCommentsFromBaseTests.cs",
    "content": "// \n// CopyCommentsFromBaseTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CopyCommentsFromBaseTest : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestMultiString()\n\t\t{\n\t\t\t\n\t\t\tTest<CopyCommentsFromBase>(@\"\nnamespace TestNS\n{\n\tclass TestClass\n\t{\n\t\t///ssss\n\t\t///ssss\n\t\tpublic virtual void Test()\n\t\t{\n\t\t\tint a;\n\t\t}\n\t}\n\tclass DerivdedClass : TestClass\n\t{\n\t\tpublic override void $Test()\n\t\t{\n\t\t\tstring str = string.Empty;\n\t\t}\n\t}\n}\", @\"\nnamespace TestNS\n{\n\tclass TestClass\n\t{\n\t\t///ssss\n\t\t///ssss\n\t\tpublic virtual void Test()\n\t\t{\n\t\t\tint a;\n\t\t}\n\t}\n\tclass DerivdedClass : TestClass\n\t{\n\t\t///ssss\n\t\t///ssss\n\t\tpublic override void Test()\n\t\t{\n\t\t\tstring str = string.Empty;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestSingleString()\n\t\t{\n\t\t\t\n\t\t\tTest<CopyCommentsFromBase>(@\"\nnamespace TestNS\n{\n\tclass TestClass\n\t{\n\t\t///ssss\n\t\tpublic virtual void Test()\n\t\t{\n\t\t\tint a;\n\t\t}\n\t}\n\tclass DerivdedClass : TestClass\n\t{\n\t\tpublic override void $Test()\n\t\t{\n\t\t\tstring str = string.Empty;\n\t\t}\n\t}\n}\", @\"\nnamespace TestNS\n{\n\tclass TestClass\n\t{\n\t\t///ssss\n\t\tpublic virtual void Test()\n\t\t{\n\t\t\tint a;\n\t\t}\n\t}\n\tclass DerivdedClass : TestClass\n\t{\n\t\t///ssss\n\t\tpublic override void Test()\n\t\t{\n\t\t\tstring str = string.Empty;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestAbstractClassString()\n\t\t{\n\t\t\t\n\t\t\tTest<CopyCommentsFromBase>(@\"\nnamespace TestNS\n{\n\tabstract class TestClass\n\t{\n\t\t///ssss\n\t\t///ssss\n\t\tpublic abstract void Test();\n\t}\n\tclass DerivdedClass : TestClass\n\t{\n\t\tpublic override void $Test()\n\t\t{\n\t\t\tstring str = string.Empty;\n\t\t}\n\t}\n}\", @\"\nnamespace TestNS\n{\n\tabstract class TestClass\n\t{\n\t\t///ssss\n\t\t///ssss\n\t\tpublic abstract void Test();\n\t}\n\tclass DerivdedClass : TestClass\n\t{\n\t\t///ssss\n\t\t///ssss\n\t\tpublic override void Test()\n\t\t{\n\t\t\tstring str = string.Empty;\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CopyCommentsFromIntefaceTests.cs",
    "content": "// \n// CopyCommentsFromInterfaceTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CopyCommentsFromInterfaceTest : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<CopyCommentsFromInterface>(@\"\ninterface ITest\n{\n\t///sssss\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tpublic void $Method ()\n\t{\n\t}\n}\", @\"\ninterface ITest\n{\n\t///sssss\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\t///sssss\n\tpublic void Method ()\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMultiCase()\n\t\t{\n\t\t\tTest<CopyCommentsFromInterface>(@\"\ninterface ITest\n{\n\t///sssss\n\t///sssss\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tpublic void $Method ()\n\t{\n\t}\n}\", @\"\ninterface ITest\n{\n\t///sssss\n\t///sssss\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\t///sssss\n\t///sssss\n\tpublic void Method ()\n\t{\n\t}\n}\");\n\t\t}\t\n\n\t\t[Ignore]\n\t\tpublic void TestNoProblem()\n\t\t{\n\t\t\tTest<CopyCommentsFromInterface>(@\"\ninterface ITest\n{\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tpublic void $Method ()\n\t{\n\t}\n}\", @\"\ninterface ITest\n{\n\tvoid Method ();\n}\nclass TestClass : ITest\n{\n\tpublic void Method ()\n\t{\n\t}\n}\");\n\t\t}\t\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateBackingStoreTests.cs",
    "content": "//\n// CreateBackingStoreTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateBackingStoreTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleStore ()\n\t\t{\n\t\t\tTest<CreateBackingStoreAction> (@\"class TestClass\n{\n\tstring $Test { get; set; }\n}\", @\"class TestClass\n{\n\tstring test;\n\tstring Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestStaticStore ()\n\t\t{\n\t\t\tTest<CreateBackingStoreAction> (@\"class TestClass\n{\n\tpublic static string $Test { get; set; }\n}\", @\"class TestClass\n{\n\tstatic string test;\n\tpublic static string Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongLocation()\n\t\t{\n\t\t\tTestWrongContext<CreateBackingStoreAction> (@\"class TestClass\n{\n\tpublic $string Test {\n\t\tget;\n\t\tset;\n\t}\n}\");\n\n\t\t\tTestWrongContext<CreateBackingStoreAction> (@\"class TestClass\n{\n\tpublic string $FooBar.Test {\n\t\tget;\n\t\tset;\n\t}\n}\");\n\n\t\t\tTestWrongContext<CreateBackingStoreAction> (@\"class TestClass\n{\n\tpublic string Test ${\n\t\tget;\n\t\tset;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateChangedEventTests.cs",
    "content": "//\n// CreateChangedEventTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateChangedEventTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<CreateChangedEventAction> (@\"class TestClass\n{\n\tstring test;\n\tpublic string $Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tstring test;\n\tpublic event System.EventHandler TestChanged;\n\tprotected virtual void OnTestChanged (System.EventArgs e)\n\t{\n\t\tvar handler = TestChanged;\n\t\tif (handler != null)\n\t\t\thandler (this, e);\n\t}\n\tpublic string Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t\tOnTestChanged (System.EventArgs.Empty);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticClassCase ()\n\t\t{\n\t\t\tTest<CreateChangedEventAction> (@\"static class TestClass\n{\n\tstatic string test;\n\tpublic static string $Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\", @\"static class TestClass\n{\n\tstatic string test;\n\tpublic static event System.EventHandler TestChanged;\n\tstatic void OnTestChanged (System.EventArgs e)\n\t{\n\t\tvar handler = TestChanged;\n\t\tif (handler != null)\n\t\t\thandler (null, e);\n\t}\n\tpublic static string Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t\tOnTestChanged (System.EventArgs.Empty);\n\t\t}\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestSealedCase ()\n\t\t{\n\t\t\tTest<CreateChangedEventAction> (@\"sealed class TestClass\n{\n\tstring test;\n\tpublic string $Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\", @\"sealed class TestClass\n{\n\tstring test;\n\tpublic event System.EventHandler TestChanged;\n\tvoid OnTestChanged (System.EventArgs e)\n\t{\n\t\tvar handler = TestChanged;\n\t\tif (handler != null)\n\t\t\thandler (this, e);\n\t}\n\tpublic string Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t\tOnTestChanged (System.EventArgs.Empty);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongLocation()\n\t\t{\n\t\t\tTestWrongContext<CreateChangedEventAction> (@\"class TestClass\n{\n\tstring test;\n\tpublic $string Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\n\t\t\tTestWrongContext<CreateChangedEventAction> (@\"class TestClass\n{\n\tstring test;\n\tpublic string $FooBar.Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\n\t\t\tTestWrongContext<CreateChangedEventAction> (@\"class TestClass\n{\n\tstring test;\n\tpublic string Test ${\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateClassDeclarationTests.cs",
    "content": "// \n// CreateClassDeclarationTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateClassDeclarationTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestCreateClass ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new Foo (0, \"\"Hello\"\");\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic Foo (int i, string hello)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tnew Foo (0, \"\"Hello\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNestedCreateClass()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction>(\n@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new Foo (0);\n\t}\n}\n\", @\"\nclass TestClass\n{\n\tclass Foo\n\t{\n\t\tpublic Foo (int i)\n\t\t{\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tnew Foo (0);\n\t}\n}\n\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmptyConstructor ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new Foo ();\n\t}\n}\n\", @\"\nclass Foo\n{\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tnew Foo ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCreatePublicEventArgs ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n@\"\nclass TestClass\n{\n\tpublic event EventHandler<$MyEventArgs> evt;\n}\n\", @\"\npublic class MyEventArgs : System.EventArgs\n{\n}\nclass TestClass\n{\n\tpublic event EventHandler<MyEventArgs> evt;\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCreateInternalEventArgs ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n@\"\nclass TestClass\n{\n\tinternal event EventHandler<$MyEventArgs> evt;\n}\n\", @\"\nclass MyEventArgs : System.EventArgs\n{\n}\nclass TestClass\n{\n\tinternal event EventHandler<MyEventArgs> evt;\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCreateAttribute ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n@\"\n[$MyAttribute]\nclass TestClass\n{\n}\n\", @\"\nclass MyAttribute : System.Attribute\n{\n}\n[MyAttribute]\nclass TestClass\n{\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCreateAttributeCase2 ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n@\"\n[$My]\nclass TestClass\n{\n}\n\", @\"\nclass MyAttribute : System.Attribute\n{\n}\n[My]\nclass TestClass\n{\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCreateException ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tthrow $new MyException ();\n\t}\n}\n\", @\"\nclass MyException : System.Exception\n{\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tthrow new MyException ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotShowInEventTypes()\n\t\t{\n\t\t\tTestWrongContext<CreateClassDeclarationAction>(\n@\"\nclass TestClass\n{\n\tevent $MyEventHandler evt;\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCreateClassImplementingInterface()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction>(\n@\"\nclass TestClass\n{\n\tvoid TestMethod (System.IDisposable d)\n\t{\n\t\tTestMethod ($new Foo ());\n\t}\n}\n\", @\"\nclass Foo : System.IDisposable\n{\n\tpublic void Dispose ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\nclass TestClass\n{\n\tvoid TestMethod (System.IDisposable d)\n\t{\n\t\tTestMethod (new Foo ());\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCreateClassExtendingAbstractClass()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction>(\n@\"\nclass TestClass\n{\n\tabstract class FooBar { protected abstract void SomeFoo (); public abstract int MoreFoo { get; } }\n\tvoid TestMethod (FooBar d)\n\t{\n\t\tTestMethod ($new Foo ());\n\t}\n}\n\", @\"\nclass Foo : FooBar\n{\n\tpublic override int MoreFoo {\n\t\tget;\n\t}\n\n\tprotected override void SomeFoo ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\nclass TestClass\n{\n\tabstract class FooBar { protected abstract void SomeFoo (); public abstract int MoreFoo { get; } }\n\tvoid TestMethod (FooBar d)\n\t{\n\t\tTestMethod (new Foo ());\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestModifierBug ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n\t\t\t\t@\"\nclass TestClass\n{\n\tprivate readonly $Foo _foo;\n}\n\", @\"\nclass Foo\n{\n}\nclass TestClass\n{\n\tprivate readonly Foo _foo;\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCreateClassFromMemberReferenceExpression ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n\t\t\t\t@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$Foo.Bar (1);\n\t}\n}\n\", @\"\nclass Foo\n{\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFoo.Bar (1);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 10671 - Auto-Fix of Base Class is wrong (generates invalid code) \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10671 ()\n\t\t{\n\t\t\tvar input = @\"\nnamespace TestConsole\n{\n    public class Test : $BaseMissing\n    {\n    }\n}\n\";\n\t\t\t// action allowed to create a nested class\n\t\t\tvar context = TestRefactoringContext.Create (input, false);\n\t\t\tvar actions = new CreateClassDeclarationAction().GetActions (context);\n\t\t\tAssert.AreEqual (1, actions.Count ());\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestCreateInterface ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n\t\t\t\t@\"\nclass TestClass\n{\n\tprivate readonly $IFoo _foo;\n}\n\", @\"\ninterface IFoo\n{\n}\nclass TestClass\n{\n\tprivate readonly IFoo _foo;\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 10672 - Auto-Fix of Generate Class to fill Generic params does not take in account constraints\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10672 ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n\t\t\t\t@\"\nnamespace TestConsole\n{\n    public interface IBase\n    {\n    }\n    public class Test \n    {\n        public void Generate<S, T>() where T:IBase, new()\n        {\n\n        }\n    }\n    class MainClass\n    {\n        public static void Main (string[] args)\n        {\n            var testConsole = new Test ();\n            testConsole.Generate<int, $Data> ();\n        }\n    }\n}\n\", @\"\npublic class Data : IBase\n{\n\tpublic Data ()\n\t{\n\t}\n}\nnamespace TestConsole\n{\n    public interface IBase\n    {\n    }\n    public class Test \n    {\n        public void Generate<S, T>() where T:IBase, new()\n        {\n\n        }\n    }\n    class MainClass\n    {\n        public static void Main (string[] args)\n        {\n            var testConsole = new Test ();\n            testConsole.Generate<int, Data> ();\n        }\n    }\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestStructConstraint ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n\t\t\t\t@\"\npublic class Test \n{\n\tpublic void Generate<T> () where T : struct\n\t{\n\t}\n\n\tpublic void FooBar ()\n\t{\n\t\tGenerate<$Data> ();\n\t}\n}\n\", @\"\npublic struct Data\n{\n}\npublic class Test \n{\n\tpublic void Generate<T> () where T : struct\n\t{\n\t}\n\n\tpublic void FooBar ()\n\t{\n\t\tGenerate<Data> ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassTypeParameter ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n\t\t\t\t@\"\npublic class Test \n{\n\tpublic class Generate<T> where T : struct {}\n\n\tpublic void FooBar ()\n\t{\n\t\tGenerate<$Data> foo;\n\t}\n}\n\", @\"\npublic struct Data\n{\n}\npublic class Test \n{\n\tpublic class Generate<T> where T : struct {}\n\n\tpublic void FooBar ()\n\t{\n\t\tGenerate<Data> foo;\n\t}\n}\n\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestClassTypeParameterCase2 ()\n\t\t{\n\t\t\tTest<CreateClassDeclarationAction> (\n\t\t\t\t@\"\npublic class Test \n{\n\tpublic class Generate<T> where T : struct {}\n\n\tpublic void FooBar ()\n\t{\n\t\tnew Generate<$Data> ();\n\t}\n}\n\", @\"\npublic struct Data\n{\n}\npublic class Test \n{\n\tpublic class Generate<T> where T : struct {}\n\n\tpublic void FooBar ()\n\t{\n\t\tnew Generate<Data> ();\n\t}\n}\n\");\n\t\t}\n\n\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateConstructorDeclarationTests.cs",
    "content": "// \n// CreateClassActionTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateConstructorDeclarationTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestCreateConstructor ()\n\t\t{\n\t\t\tTest<CreateConstructorDeclarationAction> (\n@\"\nclass Foo\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new Foo (0, \"\"Hello\"\");\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic Foo (int i, string hello)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tnew Foo (0, \"\"Hello\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestCreateConstructorInnerClass ()\n\t\t{\n\t\t\tTest<CreateConstructorDeclarationAction> (\n@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new Foo (0, \"\"Hello\"\");\n\t}\n\tclass Foo\n\t{\n\t}\n}\n\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tnew Foo (0, \"\"Hello\"\");\n\t}\n\tclass Foo\n\t{\n\tpublic Foo (int i, string hello)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestCreateConstructorInStaticClass ()\n\t\t{\n\t\t\tTestWrongContext<CreateConstructorDeclarationAction> (\n@\"\nstatic class Foo\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new Foo (0, \"\"Hello\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestCreateConstructorInSealedClass ()\n\t\t{\n\t\t\tTestWrongContext<CreateConstructorDeclarationAction> (\n@\"\nsealed class Foo\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new Foo (0, \"\"Hello\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestCreateConstructorInFramework ()\n\t\t{\n\n\t\t\tTestWrongContext<CreateConstructorDeclarationAction> (\n@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new System.NotImplementedException (0, \"\"Hello\"\", new TestClass ());\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug9664  ()\n\t\t{\n\t\t\tTestWrongContext<CreateConstructorDeclarationAction> (\n\t\t\t\t@\"enum Foo\n{\n    Bar,\n}\n\nclass Baz\n{\n    public Baz (Foo foo)\n    {\n    }\n}\n\nclass Program\n{\n    public void Main ()\n    {\n        var b = new Baz (Foo.$Something);\n    }\n}\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateCustomEventImplementationTests.cs",
    "content": "﻿// \n// CreateCustomEventImplementationTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateCustomEventImplementationTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<CreateCustomEventImplementationAction> (@\"\nusing System;\nclass TestClass\n{\n\tpublic event EventHandler $TestEvent;\n}\", @\"\nusing System;\nclass TestClass\n{\n\tpublic event EventHandler TestEvent {\n\t\tadd {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tremove {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleEventDeclaration ()\n\t\t{\n\t\t\tTest<CreateCustomEventImplementationAction> (@\"\nusing System;\nclass TestClass\n{\n\tevent EventHandler $TestEvent, TestEvent2;\n}\", @\"\nusing System;\nclass TestClass\n{\n\tevent EventHandler TestEvent2;\n\tevent EventHandler TestEvent {\n\t\tadd {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tremove {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateDelegateTests.cs",
    "content": "// \n// CreateDelegateTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateDelegateTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestCreateDelegate ()\n\t\t{\n\t\t\tTest<CreateDelegateAction> (\n@\"\nclass TestClass\n{\n\tevent $MyEventHandler evt;\n}\n\", @\"\ndelegate void MyEventHandler (object sender, System.EventArgs e);\nclass TestClass\n{\n\tevent MyEventHandler evt;\n}\n\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestCreatePublicDelegate ()\n\t\t{\n\t\t\tTest<CreateDelegateAction> (\n@\"\nclass TestClass\n{\n\tpublic event $MyEventHandler evt;\n}\n\", @\"\npublic delegate void MyEventHandler (object sender, System.EventArgs e);\nclass TestClass\n{\n\tpublic event MyEventHandler evt;\n}\n\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateEnumValueTests.cs",
    "content": "//\n// CreateEnumValueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateEnumValueTests: ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleEnum()\n\t\t{\n\t\t\tTest<CreateEnumValue>(\n\t\t\t\t@\"enum Foo\n{\n    Bar\n}\n\nclass Baz\n{\n    public Baz (Foo foo)\n    {\n    }\n}\n\nclass Program\n{\n    public void Main ()\n    {\n        var b = new Baz (Foo.$Something);\n    }\n}\n\",@\"enum Foo\n{\n\tSomething,\n    Bar\n}\n\nclass Baz\n{\n    public Baz (Foo foo)\n    {\n    }\n}\n\nclass Program\n{\n    public void Main ()\n    {\n        var b = new Baz (Foo.Something);\n    }\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 16663 - Enum constants with Flags are not recognized\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16663()\n\t\t{\n\t\t\tTest<CreateEnumValue>(@\"\npublic enum MyEnum\n{\n}\n\nclass Test  \n{\n\tstatic void Main ()\n\t{\n\t\tvar e = MyEnum.$NotDefinedYetValue;\n\t}\n}\n\",@\"\npublic enum MyEnum\n{\n\tNotDefinedYetValue\n}\n\nclass Test  \n{\n\tstatic void Main ()\n\t{\n\t\tvar e = MyEnum.NotDefinedYetValue;\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestBug16663_Case2()\n\t\t{\n\t\t\tTest<CreateEnumValue>(@\"\npublic enum MyEnum\n{\n}\n\nclass Test  \n{\n\tstatic void Main ()\n\t{\n\t\tvar e = MyEnum.$NotDefinedYetValue | MyEnum.Foo;\n\t}\n}\n\",@\"\npublic enum MyEnum\n{\n\tNotDefinedYetValue\n}\n\nclass Test  \n{\n\tstatic void Main ()\n\t{\n\t\tvar e = MyEnum.NotDefinedYetValue | MyEnum.Foo;\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateEventInvocatorTests.cs",
    "content": "// \n// CreateEventInvocatorTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateEventInvocatorTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<CreateEventInvocatorAction> (@\"using System;\nclass TestClass\n{\n\tpublic event EventHandler $Tested;\n}\", @\"using System;\nclass TestClass\n{\n\tprotected virtual void OnTested (EventArgs e)\n\t{\n\t\tvar handler = Tested;\n\t\tif (handler != null)\n\t\t\thandler (this, e);\n\t}\n\tpublic event EventHandler Tested;\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestNameClash ()\n\t\t{\n\t\t\tTest<CreateEventInvocatorAction> (@\"using System;\nclass TestClass\n{\n\tpublic event EventHandler $e;\n}\", @\"using System;\nclass TestClass\n{\n\tprotected virtual void OnE (EventArgs e)\n\t{\n\t\tvar handler = this.e;\n\t\tif (handler != null)\n\t\t\thandler (this, e);\n\t}\n\tpublic event EventHandler e;\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestStaticEvent ()\n\t\t{\n\t\t\tTest<CreateEventInvocatorAction> (@\"using System;\nclass TestClass\n{\n\tpublic static event EventHandler $Tested;\n}\", @\"using System;\nclass TestClass\n{\n\tstatic void OnTested (EventArgs e)\n\t{\n\t\tvar handler = Tested;\n\t\tif (handler != null)\n\t\t\thandler (null, e);\n\t}\n\tpublic static event EventHandler Tested;\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateFieldTests.cs",
    "content": "// \n// CreateFieldTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateFieldTests : ContextActionTestBase\n\t{\n\t[Test()]\n\t\tpublic void TestWrongContext2 ()\n\t\t{\n\t\t\tTestWrongContext<CreateFieldAction> (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tConsole.WriteLine ($Foo());\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestWrongContext3 ()\n\t\t{\n\t\t\t// May be syntactically possible, but very unlikely.\n\t\t\tTestWrongContext<CreateFieldAction> (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$foo();\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestSimpleMethodCall ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateFieldAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tConsole.WriteLine ($foo);\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tConsole.WriteLine (result);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tobject foo;\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tConsole.WriteLine (foo);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateFieldAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint foo;\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tfoo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestOutParamCall ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateFieldAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid FooBar(out string par) {}\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tFooBar(out $foo);\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid FooBar(out string par) {}\" + Environment.NewLine +\n\t\t\t\t\"\tstring foo;\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tFooBar(out foo);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestStaticClassField ()\n\t\t{\n\t\t\t// Not 100% correct input code, but should work in that case as well.\n\t\t\tTest<CreateFieldAction> (@\"static class TestClass\n{\n\tpublic TestClass ()\n\t{\n\t\t$foo = 5;\n\t}\n}\", @\"static class TestClass\n{\n\tstatic int foo;\n\tpublic TestClass ()\n\t{\n\t\tfoo = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumCase()\n\t\t{\n\t\t\tTestWrongContext<CreateFieldAction>(@\"\nenum AEnum { A }\nclass Foo\n{\n\tpublic void Test ()\n\t{\n\t\tAEnum e;\n\t\te.$foo = 2;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestThisMemberReferenceCreation ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateFieldAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tthis.$foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint foo;\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tthis.foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestObjectInitializer ()\n\t\t{\n\t\t\t// Not 100% correct input code, but should work in that case as well.\n\t\t\tTest<CreateFieldAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\t$NonExistantProperty = 5\n\t\t};\n\t}\n}\", @\"class TestClass\n{\n\tint NonExistantProperty;\n\tvoid TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\tNonExistantProperty = 5\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestObjectInitializerInStaticMethod ()\n\t\t{\n\t\t\t// Not 100% correct input code, but should work in that case as well.\n\t\t\tTest<CreateFieldAction> (@\"class TestClass\n{\n\tstatic void TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\t$NonExistantProperty = 5\n\t\t};\n\t}\n}\", @\"class TestClass\n{\n\tint NonExistantProperty;\n\tstatic void TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\tNonExistantProperty = 5\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIf ()\n\t\t{\n\t\t\tTest<CreateFieldAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tif ($NonExistantProperty)\n\t\t\t;\n\t}\n}\", @\"class TestClass\n{\n\tbool NonExistantProperty;\n\tvoid TestMethod ()\n\t{\n\t\tif (NonExistantProperty)\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhile ()\n\t\t{\n\t\t\tTest<CreateFieldAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\twhile ($NonExistantProperty)\n\t\t\t;\n\t}\n}\", @\"class TestClass\n{\n\tbool NonExistantProperty;\n\tvoid TestMethod ()\n\t{\n\t\twhile (NonExistantProperty)\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhile ()\n\t\t{\n\t\t\tTest<CreateFieldAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tdo {}\n\t\twhile ($NonExistantProperty);\n\t}\n}\", @\"class TestClass\n{\n\tbool NonExistantProperty;\n\tvoid TestMethod ()\n\t{\n\t\tdo {}\n\t\twhile (NonExistantProperty);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForCondition ()\n\t\t{\n\t\t\tTest<CreateFieldAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (;$NonExistantProperty;){}\n\t}\n}\", @\"class TestClass\n{\n\tbool NonExistantProperty;\n\tvoid TestMethod ()\n\t{\n\t\tfor (;NonExistantProperty;){}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalOperator ()\n\t\t{\n\t\t\tTest<CreateFieldAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar b = $NonExistantProperty ? 1 : 0;\n\t}\n}\", @\"class TestClass\n{\n\tbool NonExistantProperty;\n\tvoid TestMethod ()\n\t{\n\t\tvar b = NonExistantProperty ? 1 : 0;\n\t}\n}\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateIndexerTests.cs",
    "content": "// \n// CreateIndexerTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateIndexerTests : ContextActionTestBase\n\t{\n\t\tpublic void TestCreateIndexer (string input, string output)\n\t\t{\n\t\t\tstring result = RunContextAction (new CreateIndexerAction (), CreateMethodDeclarationTests.HomogenizeEol (input));\n\t\t\tbool passed = result == output;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine (\"-----------Expected:\");\n\t\t\t\tConsole.WriteLine (output);\n\t\t\t\tConsole.WriteLine (\"-----------Got:\");\n\t\t\t\tConsole.WriteLine (result);\n\t\t\t}\n\t\t\tAssert.AreEqual (CreateMethodDeclarationTests.HomogenizeEol (output), result);\n\t\t}\t\n\t\n\n\t\t[Test()]\n\t\tpublic void TestIndexer ()\n\t\t{\n\t\t\tTestCreateIndexer (\n@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$this[0] = 2;\n\t}\n}\n\", @\"\nclass TestClass\n{\n\tint this [int i] {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tthis[0] = 2;\n\t}\n}\n\");\n\t\t}\n\t\t[Test()]\n\t\tpublic void TestInterfaceIndexer ()\n\t\t{\n\t\t\tTestCreateIndexer (\n@\"\ninterface FooBar\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\t$fb[0] = 2;\n\t}\n}\n\", @\"\ninterface FooBar\n{\n\tint this [int i] {\n\t\tget;\n\t\tset;\n\t}\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\tfb[0] = 2;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestExternIndexer ()\n\t\t{\n\t\t\tTestCreateIndexer (\n@\"\nclass FooBar\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\t$fb[0] = 2;\n\t}\n}\n\", @\"\nclass FooBar\n{\n\tpublic int this [int i] {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\tfb[0] = 2;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestindexerInFrameworkClass ()\n\t\t{\n\t\t\tTestWrongContext<CreateIndexerAction> (\n@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$new System.Buffer ()[0] = 2;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumCase()\n\t\t{\n\t\t\tTestWrongContext<CreateIndexerAction>(@\"\nenum AEnum { A }\nclass Foo\n{\n\tpublic void Test ()\n\t{\n\t\tAEnum e;\n\t\t$e[0] = 2;\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateLocalVariableTests.cs",
    "content": "// \n// CreateLocalVariableTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateLocalVariableTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleMethodCall ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateLocalVariableAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tConsole.WriteLine ($foo);\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tobject foo;\" + Environment.NewLine +\n\t\t\t\t\"\t\tConsole.WriteLine (foo);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateLocalVariableAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tvar foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void ExplicitTestAssignment ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateLocalVariableAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestOutParamCall ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateLocalVariableAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid FooBar(out string par) {}\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tFooBar(out $foo);\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid FooBar(out string par) {}\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tstring foo;\" + Environment.NewLine +\n\t\t\t\t\"\t\tFooBar(out foo);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\n\t\t[Test()]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateLocalVariableAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tint Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\treturn $foo;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint foo;\" + Environment.NewLine +\n\t\t\t\t\"\t\treturn foo;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestYieldReturn ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreateLocalVariableAction (),\n\t\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"using System.Collections.Generic;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tIEnumerable<TestClass> Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tyield return $foo;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"using System.Collections.Generic;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tIEnumerable<TestClass> Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tTestClass foo;\" + Environment.NewLine +\n\t\t\t\t\"\t\tyield return foo;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\n\t\t[Test()]\n\t\tpublic void TestWrongContext1()\n\t\t{\n\t\t\t// May be syntactically possible, but very unlikely.\n\t\t\tTestWrongContext<CreateLocalVariableAction>(\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\t$foo();\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestBool()\n\t\t{\n\t\t\tTest<CreateLocalVariableAction>(\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tobject o = !$foo;\n\t}\n}\", \n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tbool foo;\n\t\tobject o = !foo;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExtensionMethod()\n\t\t{\n\t\t\tTest<CreateLocalVariableAction>(@\"static class Ext { public static void Foo(this object o, string str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\targs.Foo($foo);\n\t}\n}\", @\"static class Ext { public static void Foo(this object o, string str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tstring foo;\n\t\targs.Foo(foo);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestExtensionMethodStaticInvocation()\n\t\t{\n\t\t\tTest<CreateLocalVariableAction>(@\"static class Ext { public static void Foo(this object o, string str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tExt.Foo(args, $foo);\n\t}\n}\", @\"static class Ext { public static void Foo(this object o, string str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tstring foo;\n\t\tExt.Foo(args, foo);\n\t}\n}\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateMethodDeclarationTests.cs",
    "content": "﻿// \n// CreateMethodDeclarationTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateMethodDeclarationTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestPrivateSimpleCreateMethod ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tint member = 5;\n\tstring Test { get; set; }\n\n\tvoid TestMethod ()\n\t{\n\t\t$NonExistantMethod (member, Test, 5);\n\t}\n}\", @\"class TestClass\n{\n\tint member = 5;\n\tstring Test { get; set; }\n\n\tvoid NonExistantMethod (int member, string test, int i)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tNonExistantMethod (member, Test, 5);\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestStaticSimpleCreateMethod ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tpublic static void TestMethod ()\n\t{\n\t\tint testLocalVar;\n\t\t$NonExistantMethod (testLocalVar);\n\t}\n}\", @\"class TestClass\n{\n\tstatic void NonExistantMethod (int testLocalVar)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic static void TestMethod ()\n\t{\n\t\tint testLocalVar;\n\t\tNonExistantMethod (testLocalVar);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestGuessAssignmentReturnType ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tstatic void TestMethod ()\n\t{\n\t\tint testLocalVar = $NonExistantMethod ();\n\t}\n}\", @\"class TestClass\n{\n\tstatic int NonExistantMethod ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tstatic void TestMethod ()\n\t{\n\t\tint testLocalVar = NonExistantMethod ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestGuessAssignmentReturnTypeCase2 ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tstatic void TestMethod ()\n\t{\n\t\tint testLocalVar;\n\t\ttestLocalVar = $NonExistantMethod ();\n\t}\n}\", @\"class TestClass\n{\n\tstatic int NonExistantMethod ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tstatic void TestMethod ()\n\t{\n\t\tint testLocalVar;\n\t\ttestLocalVar = NonExistantMethod ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestGuessAssignmentReturnTypeCase3 ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tstatic void TestMethod ()\n\t{\n\t\tvar testLocalVar = (string)$NonExistantMethod ();\n\t}\n}\", @\"class TestClass\n{\n\tstatic string NonExistantMethod ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tstatic void TestMethod ()\n\t{\n\t\tvar testLocalVar = (string)NonExistantMethod ();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test()]\n\t\tpublic void TestGuessParameterType ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tTest ($NonExistantMethod ());\n\t}\n\tvoid Test (int a) {}\n\n}\", @\"class TestClass\n{\n\tint NonExistantMethod ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tTest (NonExistantMethod ());\n\t}\n\tvoid Test (int a) {}\n\n}\");\n\t\t}\n\n\n\t\t[Test()]\n\t\tpublic void TestCreateDelegateDeclarationIdentifierCase ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tpublic event MyDelegate MyEvent;\n\n\tvoid TestMethod ()\n\t{\n\t\tMyEvent += $NonExistantMethod;\n\t}\n}\n\npublic delegate string MyDelegate (int a, object b);\n\", @\"class TestClass\n{\n\tpublic event MyDelegate MyEvent;\n\n\tstring NonExistantMethod (int a, object b)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tMyEvent += NonExistantMethod;\n\t}\n}\n\npublic delegate string MyDelegate (int a, object b);\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestCreateDelegateDeclarationMemberReferenceCase ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tpublic event MyDelegate MyEvent;\n\n\tvoid TestMethod ()\n\t{\n\t\tMyEvent += $this.NonExistantMethod;\n\t}\n}\n\npublic delegate string MyDelegate (int a, object b);\n\", @\"class TestClass\n{\n\tpublic event MyDelegate MyEvent;\n\n\tstring NonExistantMethod (int a, object b)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tMyEvent += this.NonExistantMethod;\n\t}\n}\n\npublic delegate string MyDelegate (int a, object b);\n\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestCreateDelegateDeclarationInOtherClassMemberReferenceCase ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class Foo {\n}\n\nclass TestClass\n{\n\tpublic event MyDelegate MyEvent;\n\n\tvoid TestMethod ()\n\t{\n\t\tMyEvent += $new Foo ().NonExistantMethod;\n\t}\n}\n\npublic delegate string MyDelegate (int a, object b);\n\", @\"class Foo {\n\tpublic string NonExistantMethod (int a, object b)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\n\nclass TestClass\n{\n\tpublic event MyDelegate MyEvent;\n\n\tvoid TestMethod ()\n\t{\n\t\tMyEvent += new Foo ().NonExistantMethod;\n\t}\n}\n\npublic delegate string MyDelegate (int a, object b);\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestRefOutCreateMethod ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a, b;\n\t\t$NonExistantMethod (ref a, out b);\n\t}\n}\", @\"class TestClass\n{\n\tvoid NonExistantMethod (ref int a, out int b)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint a, b;\n\t\tNonExistantMethod (ref a, out b);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestExternMethod ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"\nclass FooBar\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar fb = new FooBar ();\n\t\tfb.$NonExistantMethod ();\n\t}\n}\n\", @\"\nclass FooBar\n{\n\tpublic void NonExistantMethod ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar fb = new FooBar ();\n\t\tfb.NonExistantMethod ();\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestCreateInterfaceMethod ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"\ninterface FooBar\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\tfb.$NonExistantMethod ();\n\t}\n}\n\", @\"\ninterface FooBar\n{\n\tvoid NonExistantMethod ();\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\tfb.NonExistantMethod ();\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestCreateInStaticClassMethod ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"\nstatic class FooBar\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar.$NonExistantMethod ();\n\t}\n}\n\", @\"\nstatic class FooBar\n{\n\tpublic static void NonExistantMethod ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar.NonExistantMethod ();\n\t}\n}\n\");\n\t\t}\n\t\t\n\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 677522 - \"Create Method\" creates at wrong indent level\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug677522 ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"namespace Test {\n\tclass TestClass\n\t{\n\t\tvoid TestMethod ()\n\t\t{\n\t\t\t$NonExistantMethod ();\n\t\t}\n\t}\n}\n\", @\"namespace Test {\n\tclass TestClass\n\t{\n\t\tvoid NonExistantMethod ()\n\t\t{\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tvoid TestMethod ()\n\t\t{\n\t\t\tNonExistantMethod ();\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 677527 - \"Create Method\" uses fully qualified namespace when \"using\" statement exists\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug677527 ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"using System.Text;\n\nnamespace Test {\n\tclass TestClass\n\t{\n\t\tvoid TestMethod ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\t$NonExistantMethod (sb);\n\t\t}\n\t}\n}\n\", @\"using System.Text;\n\nnamespace Test {\n\tclass TestClass\n\t{\n\t\tvoid NonExistantMethod (StringBuilder sb)\n\t\t{\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tvoid TestMethod ()\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder ();\n\t\t\tNonExistantMethod (sb);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 693949 - Create method uses the wrong type for param\n\t\t/// </summary>\n\t\t[Ignore(\"TODO\")]\n\t\t[Test()]\n\t\tpublic void TestBug693949 ()\n\t\t{\n\t\t\t// the c# code isn't 100% correct since test isn't accessible in Main (can't call non static method from static member)\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"using System.Text;\n\nnamespace Test {\n\tclass TestClass\n\t{\n\t\tstring test(string a)\n\t\t{\n\t\t}\n\t\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tType a = $M(test(\"\"a\"\"));\n\t\t}\n\t}\n}\n\", @\"using System.Text;\n\nnamespace Test {\n\tclass TestClass\n\t{\n\t\tstring test(string a)\n\t\t{\n\t\t}\n\t\n\t\tstatic Type M (string par1)\n\t\t{\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tType a = $M(test(\"\"a\"\"));\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 469 - CreateMethod created a method incorrectly\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug469 ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"class Test\n{\n\tpublic override string ToString ()\n\t{\n\t\t$BeginDownloadingImage (this);\n\t}\n}\n\", @\"class Test\n{\n\tvoid BeginDownloadingImage (Test test)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic override string ToString ()\n\t{\n\t\tBeginDownloadingImage (this);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestTestGuessReturnReturnType ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"class Test\n{\n\tpublic override string ToString ()\n\t{\n\t\treturn $BeginDownloadingImage (this);\n\t}\n}\n\", @\"class Test\n{\n\tstring BeginDownloadingImage (Test test)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic override string ToString ()\n\t{\n\t\treturn BeginDownloadingImage (this);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestStringParameterNameGuessing ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tstatic void TestMethod ()\n\t{\n\t\t$NonExistantMethod (\"\"Hello World!\"\");\n\t}\n}\", @\"class TestClass\n{\n\tstatic void NonExistantMethod (string helloWorld)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tstatic void TestMethod ()\n\t{\n\t\tNonExistantMethod (\"\"Hello World!\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestMethodInFrameworkClass ()\n\t\t{\n\t\t\tTestWrongContext<CreateMethodDeclarationAction> (\n@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$System.Console.ImprovedWriteLine (\"\"Think of it\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestCreateMethodOutOfDelegateCreation ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (\n@\"using System;\nclass Test\n{\n\tpublic void ATest ()\n\t{\n\t\tnew System.EventHandler<System.EventArgs>($BeginDownloadingImage);\n\t}\n}\n\", @\"using System;\nclass Test\n{\n\tvoid BeginDownloadingImage (object sender, EventArgs e)\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\tpublic void ATest ()\n\t{\n\t\tnew System.EventHandler<System.EventArgs>(BeginDownloadingImage);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestStaticClassMethod ()\n\t\t{\n\t\t\t// Not 100% correct input code, but should work in that case as well.\n\t\t\tTest<CreateMethodDeclarationAction> (@\"static class TestClass\n{\n\tpublic TestClass ()\n\t{\n\t\t$Foo (5);\n\t}\n}\", @\"static class TestClass\n{\n\tstatic void Foo (int i)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic TestClass ()\n\t{\n\t\tFoo (5);\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestCreateFromIdentifierNestedInMethodCall ()\n\t\t{\n\t\t\t// Not 100% correct input code, but should work in that case as well.\n\t\t\tTest<CreateMethodDeclarationAction> (@\"namespace System {\n\tclass TestClass\n\t{\n\t\tpublic void FooBar (object test)\n\t\t{\n\t\t\tFooBar (new EventHandler ($Foo));\n\t\t}\n\t}\n}\", @\"namespace System {\n\tclass TestClass\n\t{\n\t\tvoid Foo (object sender, EventArgs e)\n\t\t{\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tpublic void FooBar (object test)\n\t\t{\n\t\t\tFooBar (new EventHandler (Foo));\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumCase()\n\t\t{\n\t\t\tTestWrongContext<CreateMethodDeclarationAction>(@\"\nenum AEnum { A }\nclass Foo\n{\n\tpublic void Test ()\n\t{\n\t\tAEnum e = AEnum.B$ar ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPassNullArgument ()\n\t\t{\n\t\t\tTest<CreateMethodDeclarationAction> (@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$NonExistantMethod (null);\n\t}\n}\", @\"class TestClass\n{\n\tvoid NonExistantMethod (object o)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tNonExistantMethod (null);\n\t}\n}\");\n\t\t}\n\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateOverloadWithoutParameterTests.cs",
    "content": "﻿// \n// CreateOverloadWithoutParameterTests.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreateOverloadWithoutParameterTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<CreateOverloadWithoutParameterAction> (@\"\nclass Test\n{\n\tvoid TestMethod (int $i)\n\t{\n\t}\n}\", @\"\nclass Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tTestMethod (0);\n\t}\n\tvoid TestMethod (int i)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestByRefParameter ()\n\t\t{\n\t\t\tTest<CreateOverloadWithoutParameterAction> (\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod (ref int $i)\n\t{\n\t}\n}\",\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tTestMethod (ref i);\n\t}\n\tvoid TestMethod (ref int i)\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOutParameter ()\n\t\t{\n\t\t\tTest<CreateOverloadWithoutParameterAction> (\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod (out int $i)\n\t{\n\t}\n}\",\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i;\n\t\tTestMethod (out i);\n\t}\n\tvoid TestMethod (out int i)\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestDefaultValue ()\n\t\t{\n\t\t\tTestDefaultValue (\"object\", \"null\");\n\t\t\tTestDefaultValue (\"dynamic\", \"null\");\n\t\t\tTestDefaultValue (\"int?\", \"null\");\n\t\t\tTestDefaultValue (\"bool\", \"false\");\n\t\t\tTestDefaultValue (\"double\", \"0\");\n\t\t\tTestDefaultValue (\"char\", \"'\\\\0'\");\n\t\t\tTestDefaultValue (\"System.DateTime\", \"new System.DateTime ()\");\n\n\t\t\tTest<CreateOverloadWithoutParameterAction> (@\"\nclass Test\n{\n\tvoid TestMethod<T> (T $i)\n\t{\n\t}\n}\", @\"\nclass Test\n{\n\tvoid TestMethod<T> ()\n\t{\n\t\tTestMethod (default(T));\n\t}\n\tvoid TestMethod<T> (T i)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\tvoid TestDefaultValue (string type, string expectedValue)\n\t\t{\n\t\t\tTest<CreateOverloadWithoutParameterAction> (@\"\nclass Test\n{\n\tvoid TestMethod (\" + type + @\" $i)\n\t{\n\t}\n}\", @\"\nclass Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tTestMethod (\" + expectedValue + @\");\n\t}\n\tvoid TestMethod (\" + type + @\" i)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOptionalParameter ()\n\t\t{\n\t\t\tTestWrongContext<CreateOverloadWithoutParameterAction> (\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod (int $i = 0)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExistingMethod ()\n\t\t{\n\t\t\tTestWrongContext<CreateOverloadWithoutParameterAction> (\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod (int c)\n\t{\n\t}\n\tvoid TestMethod (int a, int $b)\n\t{\n\t}\n}\");\n\t\t\tTestWrongContext<CreateOverloadWithoutParameterAction> (\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod <T> (T c)\n\t{\n\t}\n\tvoid TestMethod <T> (T a, T $b)\n\t{\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestExplicitImpl ()\n\t\t{\n\t\t\tTestWrongContext<CreateOverloadWithoutParameterAction> (\n\t\t\t\t@\"\ninterface ITest\n{\n\tvoid Test (int a, int b);\n}\nclass Test : ITest\n{\n\tvoid ITest.Test (int a, int $b)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGenereatedCall ()\n\t\t{\n\t\t\tTest<CreateOverloadWithoutParameterAction> (\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod (ref int $i, ref int j, out int k)\n\t{\n\t}\n}\",\n\t\t\t\t@\"class Test\n{\n\tvoid TestMethod (ref int j, out int k)\n\t{\n\t\tint i = 0;\n\t\tTestMethod (ref i, ref j, out k);\n\t}\n\tvoid TestMethod (ref int i, ref int j, out int k)\n\t{\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreatePropertyTests.cs",
    "content": "﻿// \n// CreatePropertyTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class CreatePropertyTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleMethodCall ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreatePropertyAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tConsole.WriteLine ($Foo);\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tobject Foo {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget;\" + Environment.NewLine +\n\t\t\t\t\"\t\tset;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tConsole.WriteLine (Foo);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreatePropertyAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$Foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint Foo {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget;\" + Environment.NewLine +\n\t\t\t\t\"\t\tset;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tFoo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestOutParamCall ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreatePropertyAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid FooBar(out string par) {}\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tFooBar(out $Foo);\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid FooBar(out string par) {}\" + Environment.NewLine +\n\t\t\t\t\"\tstring Foo {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget;\" + Environment.NewLine +\n\t\t\t\t\"\t\tset;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tFooBar(out Foo);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestStaticProperty ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew CreatePropertyAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tstatic void Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$Foo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tstatic int Foo {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget;\" + Environment.NewLine +\n\t\t\t\t\"\t\tset;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"\tstatic void Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tFoo = 0x10;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\tpublic void TestCreateProperty (string input, string output)\n\t\t{\n\t\t\tstring result = RunContextAction (new CreatePropertyAction (), CreateMethodDeclarationTests.HomogenizeEol (input));\n\t\t\tbool passed = result == output;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine (\"-----------Expected:\");\n\t\t\t\tConsole.WriteLine (output);\n\t\t\t\tConsole.WriteLine (\"-----------Got:\");\n\t\t\t\tConsole.WriteLine (result);\n\t\t\t}\n\t\t\tAssert.AreEqual (CreateMethodDeclarationTests.HomogenizeEol (output), result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestExternProperty ()\n\t\t{\n\t\t\tTestCreateProperty (\n@\"\ninterface FooBar\n{\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\tfb.$NonExistantProperty = 5;\n\t}\n}\n\", @\"\ninterface FooBar\n{\n\tint NonExistantProperty {\n\t\tget;\n\t\tset;\n\t}\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tFooBar fb;\n\t\tfb.NonExistantProperty = 5;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestWrongContext1 ()\n\t\t{\n\t\t\t// May be syntactically possible, but very unlikely.\n\t\t\tTestWrongContext<CreatePropertyAction> (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$Foo();\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestStaticClassProperty ()\n\t\t{\n\t\t\t// Not 100% correct input code, but should work in that case as well.\n\t\t\tTest<CreatePropertyAction> (@\"static class TestClass\n{\n\tpublic TestClass ()\n\t{\n\t\t$Foo = 5;\n\t}\n}\", @\"static class TestClass\n{\n\tstatic int Foo {\n\t\tget;\n\t\tset;\n\t}\n\tpublic TestClass ()\n\t{\n\t\tFoo = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void CreateStaticPropertyInCurrentType()\n\t\t{\n\t\t\tTest<CreatePropertyAction> (@\"class TestClass\n{\n\tpublic TestClass ()\n\t{\n\t\tTestClass.$Foo = 5;\n\t}\n}\", @\"class TestClass\n{\n\tstatic int Foo {\n\t\tget;\n\t\tset;\n\t}\n\tpublic TestClass ()\n\t{\n\t\tTestClass.Foo = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumCase()\n\t\t{\n\t\t\tTestWrongContext<CreatePropertyAction>(@\"\nenum AEnum { A }\nclass Foo\n{\n\tpublic void Test ()\n\t{\n\t\tAEnum e = AEnum.B$ar;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestPropertyFromObjectInitializer ()\n\t\t{\n\t\t\tTestCreateProperty (\n\t\t\t\t@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\t$NonExistantProperty = 5\n\t\t};\n\t}\n}\n\", @\"class TestClass\n{\n\tint NonExistantProperty {\n\t\tget;\n\t\tset;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\tNonExistantProperty = 5\n\t\t};\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestPropertyFromObjectInitializerInStaticMember ()\n\t\t{\n\t\t\tTestCreateProperty (\n\t\t\t\t@\"class TestClass\n{\n\tstatic void TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\t$NonExistantProperty = 5\n\t\t};\n\t}\n}\n\", @\"class TestClass\n{\n\tint NonExistantProperty {\n\t\tget;\n\t\tset;\n\t}\n\tstatic void TestMethod ()\n\t{\n\t\tnew TestClass {\n\t\t\tNonExistantProperty = 5\n\t\t};\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestNonStaticPropertyInStaticMethod ()\n\t\t{\n\t\t\tTestCreateProperty (@\"class TestClass\n{\n\tstatic void Foo ()\n\t{\n\t\tnew TestClass ().$NonExistantProperty = 5;\n\t}\n}\", @\"class TestClass\n{\n\tint NonExistantProperty {\n\t\tget;\n\t\tset;\n\t}\n\tstatic void Foo ()\n\t{\n\t\tnew TestClass ().NonExistantProperty = 5;\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/DeclareLocalVariableTests.cs",
    "content": "﻿// \n// DeclareLocalVariableTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class DeclareLocalVariableTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleInline ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tint Foo() {}\n\tvoid Test ()\n\t{\n\t\t<-Foo()->;\n\t}\n}\", @\"class TestClass\n{\n\tint Foo() {}\n\tvoid Test ()\n\t{\n\t\tint i = Foo ();\n\t}\n}\");\n\t\t}\n\t\t[Test()]\n\t\tpublic void TestSimpleInlineImplicit ()\n\t\t{\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tint Foo() {}\n\tvoid Test ()\n\t{\n\t\t<-Foo()->;\n\t}\n}\", @\"class TestClass\n{\n\tint Foo() {}\n\tvoid Test ()\n\t{\n\t\tvar i = Foo ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestReplaceAll ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine (<-5 + 3->);\n\t\tConsole.WriteLine (5 + 3);\n\t\tConsole.WriteLine (5 + 3);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tint i = 5 + 3;\n\t\tConsole.WriteLine (i);\n\t\tConsole.WriteLine (i);\n\t\tConsole.WriteLine (i);\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestReplaceAllImplicit ()\n\t\t{\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine (<-5 + 3->);\n\t\tConsole.WriteLine (5 + 3);\n\t\tConsole.WriteLine (5 + 3);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tvar i = 5 + 3;\n\t\tConsole.WriteLine (i);\n\t\tConsole.WriteLine (i);\n\t\tConsole.WriteLine (i);\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void DeclareLocalExpressionTest ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine (1 +<- 9 ->+ 5);\n\t}\n}\n\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tint i = 9;\n\t\tConsole.WriteLine (1 + i + 5);\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 693855 - Extracting variable from ELSE IF puts it in the wrong place\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug693855 ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tstring str = \"\"test\"\";\n\t\tif (str == \"\"something\"\") {\n\t\t\t//do A\n\t\t} else if (<-str == \"\"other\"\"->) {\n\t\t\t//do B\n\t\t} else {\n\t\t\t//do C\n\t\t}\n\t}\n}\", \n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tstring str = \"\"test\"\";\n\t\tbool b = str == \"\"other\"\";\n\t\tif (str == \"\"something\"\") {\n\t\t\t//do A\n\t\t} else if (b) {\n\t\t\t//do B\n\t\t} else {\n\t\t\t//do C\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 693875 - Extract Local on just method name leaves brackets in wrong place\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug693875 ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid DoStuff() \n\t{\n\t\tif (<-GetInt->() == 0) {\n\t\t}\n\t}\n\t\n\tint GetInt()\n\t{\n\t\treturn 1;\n\t}\n}\", \n@\"class TestClass\n{\n\tvoid DoStuff() \n\t{\n\t\tSystem.Func<int> getInt = GetInt;\n\t\tif (getInt() == 0) {\n\t\t}\n\t}\n\t\n\tint GetInt()\n\t{\n\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveParens ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine ((<- 1 + 9 ->).ToString ());\n\t}\n}\n\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tint i = 1 + 9;\n\t\tConsole.WriteLine (i.ToString ());\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveParensComplexCase ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tint a = <-1 + 9->;\n\t\tConsole.WriteLine ((1 + 9).ToString ());\n\t\tConsole.WriteLine ((1 + 9));\n\t}\n}\n\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tint i = 1 + 9;\n\t\tint a = i;\n\t\tConsole.WriteLine (i.ToString ());\n\t\tConsole.WriteLine (i);\n\t}\n}\n\", 1);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 9873 - Declare local creates invalid code for implicitly typed array \n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug9873 ()\n\t\t{\n\t\t\tTestRefactoringContext.UseExplict = true;\n\t\t\tTest<DeclareLocalVariableAction> (@\"class TestClass\n{\n\tvoid DoStuff() \n\t{\n\t    foreach (var i in <-new[] { 1, 2, 3 }->) {\n\t        Console.WriteLine (i);\n\t    }\n\t}\n}\", \n\t\t\t                                  @\"class TestClass\n{\n\tvoid DoStuff() \n\t{\n\t\tint[] arr = new[] {\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t};\n\t\tforeach (var i in arr) {\n\t\t\tConsole.WriteLine (i);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCollectionInitializer ()\n\t\t{\n\t\t\tTest<DeclareLocalVariableAction> (@\"using System.Collections.Generic;\n\nclass TestClass\n{\n\tvoid Test (string str)\n\t{\n\t\tvar list = new List<int> { 1, <-str.Length->, 2 };\n\t}\n}\", @\"using System.Collections.Generic;\n\nclass TestClass\n{\n\tvoid Test (string str)\n\t{\n\t\tvar length = str.Length;\n\t\tvar list = new List<int> { 1, length, 2 };\n\t}\n}\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtensionMethodInvocationToStaticMethodInvocationTests.cs",
    "content": "//\n// ExtensionMethodInvocationToStaticMethodInvocationTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ExtensionMethodInvocationToStaticMethodInvocationTests : ContextActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void HandlesBasicCase()\n\t\t{\n\t\t\tTest<ExtensionMethodInvocationToStaticMethodInvocationAction>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\ta.$Ext (1);\n\t}\n}\", @\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\tB.Ext (a, 1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesReturnValueUsage()\n\t\t{\n\t\t\tTest<ExtensionMethodInvocationToStaticMethodInvocationAction>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static bool Ext (this A a, int i)\n\t{\n\t\treturn false;\n\t}\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\tif (a.$Ext (1))\n\t\t\treturn;\n\t}\n}\", @\"\nclass A { }\nstatic class B\n{\n\tpublic static bool Ext (this A a, int i)\n\t{\n\t\treturn false;\n\t}\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\tif (B.Ext (a, 1))\n\t\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresStaticMethodCalls()\n\t\t{\n\t\t\tTestWrongContext<ExtensionMethodInvocationToStaticMethodInvocationAction>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (this A a);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tB.Ext (a, 1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresRegularMemberMethodCalls()\n\t\t{\n\t\t\tTestWrongContext<ExtensionMethodInvocationToStaticMethodInvocationAction>(@\"\nclass A\n{\n\tpublic void Ext (int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\ta.Ext (1);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractAnonymousMethodTests.cs",
    "content": "﻿// \n// ExtractAnonymousMethodTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ExtractAnonymousMethodTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestLambdaWithBodyStatement ()\n\t\t{\n\t\t\tTest<ExtractAnonymousMethodAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = i $=>  { i++; };\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Method (int i)\n\t{\n\t\ti++;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = Method;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaWithBodyExpression ()\n\t\t{\n\t\t\tTest<ExtractAnonymousMethodAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = i $=> i++;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Method (int i)\n\t{\n\t\ti++;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = Method;\n\t}\n}\");\n\n\t\t\tTest<ExtractAnonymousMethodAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int> a = () $=> 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint Method ()\n\t{\n\t\treturn 1;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int> a = Method;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethod ()\n\t\t{\n\t\t\tTest<ExtractAnonymousMethodAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = $delegate (int i) { i++; };\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Method (int i)\n\t{\n\t\ti++;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = Method;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContainLocalReference ()\n\t\t{\n\t\t\tTestWrongContext<ExtractAnonymousMethodAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint j = 1;\n\t\tSystem.Func<int, int> a = $delegate (int i) { return i + j; };\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaInField ()\n\t\t{\n\t\t\tTest<ExtractAnonymousMethodAction> (@\"\nclass TestClass\n{\n\tSystem.Action<int> a = i $=>  { i++; };\n}\", @\"\nclass TestClass\n{\n\tvoid Method (int i)\n\t{\n\t\ti++;\n\t}\n\tSystem.Action<int> a = Method;\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractFieldTests.cs",
    "content": "// \n// CreateFieldTests.cs\n//  \n// Author:\n//       Nieve Goor\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ExtractFieldTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestWrongContext1 ()\n\t\t{\n\t\t\tTestWrongContext<ExtractFieldAction> (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$foo = 2;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestWrongContext2 ()\n\t\t{\n\t\t\tTestWrongContext<ExtractFieldAction> (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tint foo;\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t$foo = 2;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalInitializer()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ExtractFieldAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tint $foo = 5;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tConsole.WriteLine (result);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint foo;\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tfoo = 5;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalDeclaration()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ExtractFieldAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tint $foo;\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tConsole.WriteLine (result);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint foo;\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestCtorParam ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ExtractFieldAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tTestClass (int $foo)\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint foo;\" + Environment.NewLine +\n\t\t\t\t\"\tTestClass (int foo)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tthis.foo = foo;\" + Environment.NewLine +\n\t\t\t\t\"\t\t\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tTest<ExtractFieldAction>(@\"\nclass TestClass\n{\n\tTestClass () {\n\t\tint $i = 0;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint i;\n\tTestClass () {\n\t\ti = 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGetter ()\n\t\t{\n\t\t\tTest<ExtractFieldAction>(@\"\nclass TestClass\n{\n\tstatic int X {\n\t\tget {\n\t\t\tint $i = 0;\n\t\t\treturn i;\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tstatic int i;\n\tstatic int X {\n\t\tget {\n\t\t\ti = 0;\n\t\t\treturn i;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeInferenceDeclaration ()\n\t\t{\n\t\t\tTest<ExtractFieldAction> (@\"\nclass TestClass\n{\n\tvoid Test ()\n\t{\n\t\tvar $i = 0;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint i;\n\tvoid Test ()\n\t{\n\t\ti = 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeInferenceAnonymousType ()\n\t\t{\n\t\t\tTestWrongContext<ExtractFieldAction> (@\"\nclass TestClass\n{\n\tvoid Test ()\n\t{\n\t\tvar $i = new { A = 1 };\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeInferenceAnonymousArrayType ()\n\t\t{\n\t\t\tTestWrongContext<ExtractFieldAction> (@\"\nclass TestClass\n{\n\tvoid Test ()\n\t{\n\t\tvar $i = new [] { new { A = 1 } };\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticField ()\n\t\t{\n\t\t\tTest<ExtractFieldAction> (@\"\nclass TestClass\n{\n\tstatic void Test ()\n\t{\n\t\tint $i = 0;\n\t}\n}\", @\"\nclass TestClass\n{\n\tstatic int i;\n\tstatic void Test ()\n\t{\n\t\ti = 0;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractMethodTests.cs",
    "content": "// \n// ExtractMethodTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ExtractMethodTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void SimpleArgument()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\t<-Console.WriteLine (i);->\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic void NewMethod (int i)\n\t{\n\t\tConsole.WriteLine (i);\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\tNewMethod (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoArgument()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\t<-Console.WriteLine (\"\"Hello World\"\");->\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic void NewMethod ()\n\t{\n\t\tConsole.WriteLine (\"\"Hello World\"\");\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\tNewMethod ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExtractMethodResultStatementTest()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tint member = 5;\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\t<-i = member + 1;->\n\t\tConsole.WriteLine (i);\n\t}\n}\n\", @\"class TestClass\n{\n\tint member = 5;\n\tvoid NewMethod (ref int i)\n\t{\n\t\ti = member + 1;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\tNewMethod (ref i);\n\t\tConsole.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExtractMethodResultExpressionTest()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tint member = 5;\n\tvoid TestMethod ()\n\t{\n\t\tint i = <-member + 1->;\n\t\tConsole.WriteLine (i);\n\t}\n}\n\", @\"class TestClass\n{\n\tint member = 5;\n\tint NewMethod ()\n\t{\n\t\treturn member + 1;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = NewMethod ();\n\t\tConsole.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExtractMethodStaticResultStatementTest()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\t<-i = i + 1;->\n\t\tConsole.WriteLine (i);\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic void NewMethod (ref int i)\n\t{\n\t\ti = i + 1;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5;\n\t\tNewMethod (ref i);\n\t\tConsole.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExtractMethodStaticResultExpressionTest()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = <-5 + 1->;\n\t\tConsole.WriteLine (i);\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic int NewMethod ()\n\t{\n\t\treturn 5 + 1;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = NewMethod ();\n\t\tConsole.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExtractMethodMultiVariableTest()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tint member;\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5, j = 10, k;\n\t\t<-j = i + j;\n\t\tk = j + member;->\n\t\tConsole.WriteLine (k + j);\n\t}\n}\n\", @\"class TestClass\n{\n\tint member;\n\tint NewMethod (int i, ref int j)\n\t{\n\t\tint k;\n\t\tj = i + j;\n\t\tk = j + member;\n\t\treturn k;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5, j = 10, k;\n\t\tk = NewMethod (i, ref j);\n\t\tConsole.WriteLine (k + j);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 607990 - \"Extract Method\" refactoring sometimes tries to pass in unnecessary parameter depending on selection\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug607990()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"using System;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t<-Object obj1 = new Object();\n\t\tobj1.ToString();->\n\t}\n}\n\", @\"using System;\nclass TestClass\n{\n\tstatic void NewMethod ()\n\t{\n\t\tObject obj1 = new Object ();\n\t\tobj1.ToString ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tNewMethod ();\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 616193 - Extract method passes param with does not exists any more in main method\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug616193()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring ret;\n\t\tstring x;\n\t\tint y;\n\t\t<-string z = ret + y;\n\t\tret = x + z;->\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic string NewMethod (string x, int y)\n\t{\n\t\tstring ret;\n\t\tstring z = ret + y;\n\t\tret = x + z;\n\t\treturn ret;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tstring ret;\n\t\tstring x;\n\t\tint y;\n\t\tret = NewMethod (x, y);\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 616199 - Extract method forgets to return a local var which is used in main method\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug616199()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t<-string z = \"\"test\"\" + \"\"x\"\";->\n\t\tstring ret = \"\"test1\"\" + z;\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic string NewMethod ()\n\t{\n\t\tstring z = \"\"test\"\" + \"\"x\"\";\n\t\treturn z;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tvar z = NewMethod ();\n\t\tstring ret = \"\"test1\"\" + z;\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 666271 - \"Extract Method\" on single line adds two semi-colons in method, none in replaced text\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug666271()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t<-TestMethod ();->\n\t}\n}\n\", @\"class TestClass\n{\n\tvoid NewMethod ()\n\t{\n\t\tTestMethod ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tNewMethod ();\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 693944 - Extracted method returns void instead of the correct type\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug693944()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tTestMethod (<-\"\"Hello\"\"->);\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic string NewMethod ()\n\t{\n\t\treturn \"\"Hello\"\";\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tTestMethod (NewMethod ());\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Ignore(\"Fix me!\")]\n\t\t[Test]\n\t\tpublic void ExtractMethodMultiVariableWithLocalReturnVariableTest()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tint member;\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5, j = 10, k;\n\t\t<-int test;\n\t\tj = i + j;\n\t\tk = j + member;\n\t\ttest = i + j + k;->\n\t\tConsole.WriteLine (test);\n\t}\n}\n\", @\"class TestClass\n{\n\tint member;\n\tvoid NewMethod (int i, ref int j, out int k, out int test)\n\t{\n\t\tj = i + j;\n\t\tk = j + member;\n\t\ttest = i + j + k;\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tint i = 5, j = 10, k;\n\t\tint test;\n\t\tNewMethod (i, ref j, out k, out test);\n\t\tConsole.WriteLine (test);\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 8835 - missing \"extract method\" in the code editor\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug8835 ()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t<-// comment\n\t\tFoo ();->\n\t}\n}\n\", @\"class TestClass\n{\n\tstatic void NewMethod ()\n\t{\n\t\t// comment\n\t\tFoo ();\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tNewMethod ();\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9881 - Extract method is broken\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9881()\n\t\t{\n\t\t\tTest<ExtractMethodAction>(@\"using System.Linq;\nclass TestClass\n{\n\tvoid Foo ()\n\t{\n\t\tvar val = Enumerable.Range (0, 10).ToList ();\n\t\t<-for (int j = 0; j < val.Count; j++) {\n\t\t\tint i = val [j];\n\t\t\tConsole.WriteLine (i);\n\t\t}->\n\n\t\tforeach (var i in val) {\n\t\t\tConsole.WriteLine (i + 2);\n\t\t}\n\t}\n}\", @\"using System.Linq;\nclass TestClass\n{\n\tstatic void NewMethod (System.Collections.Generic.List<int> val)\n\t{\n\t\tfor (int j = 0; j < val.Count; j++) {\n\t\t\tint i = val [j];\n\t\t\tConsole.WriteLine (i);\n\t\t}\n\t}\n\tvoid Foo ()\n\t{\n\t\tvar val = Enumerable.Range (0, 10).ToList ();\n\t\tNewMethod (val);\n\n\t\tforeach (var i in val) {\n\t\t\tConsole.WriteLine (i + 2);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticSimpleExtractMethodFromExpression ()\n\t\t{\n\t\t\tTest<ExtractMethodAction> (@\"class TestClass\n{\n\tpublic static void TestMethod ()\n\t{\n\t\tint i;\n\t\tvar f = <-i % 5 == 0->;\n\t}\n}\", @\"class TestClass\n{\n\tstatic bool NewMethod (int i)\n\t{\n\t\treturn i % 5 == 0;\n\t}\n\tpublic static void TestMethod ()\n\t{\n\t\tint i;\n\t\tvar f = NewMethod (i);\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 10858 - Extract Method should use return, not out\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10858 ()\n\t\t{\n\t\t\tTest<ExtractMethodAction> (@\"class TestClass\n{\n\tpublic static void TestMethod ()\n\t{\n\t\tint i = 5, j, k = 7;\n\t\t\n\t\t<-j = i + k;->\n\n\t\tSystem.Console.WriteLine (j);\n\n\t}\n}\", @\"class TestClass\n{\n\tstatic int NewMethod (int i, int k)\n\t{\n\t\tint j;\n\t\tj = i + k;\n\t\treturn j;\n\t}\n\tpublic static void TestMethod ()\n\t{\n\t\tint i = 5, j, k = 7;\n\t\t\n\t\tj = NewMethod (i, k);\n\n\t\tSystem.Console.WriteLine (j);\n\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13054 - Extract method creates params on new method for params declared on lambdas in method body\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13054 ()\n\t\t{\n\t\t\tTest<ExtractMethodAction> (@\"class TestClass\n{\n\tpublic static void TestMethod ()\n\t{\n\t\t<-int i = 0;\n\t\tAction<string> action = (str) =>  {\n\t\t\tConsole.WriteLine (str);\n\t\t};->\n\t}\n}\", @\"class TestClass\n{\n\tstatic void NewMethod ()\n\t{\n\t\tint i = 0;\n\t\tAction<string> action = str =>  {\n\t\t\tConsole.WriteLine (str);\n\t\t};\n\t}\n\tpublic static void TestMethod ()\n\t{\n\t\tNewMethod ();\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13539 - Extracting method where last line is comment leaves comment outside new method\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13539 ()\n\t\t{\n\t\t\tTest<ExtractMethodAction> (@\"class TestClass\n{\n\tpublic static void TestMethod ()\n\t{\n\t\t<-\n\t\t\tFoo ();\n\t\t\t// Comment\n->\n\t}\n}\", @\"class TestClass\n{\n\tstatic void NewMethod ()\n\t{\n\t\tFoo ();\n\t\t// Comment\n\t}\n\tpublic static void TestMethod ()\n\t{\n\t\tNewMethod ();\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 11948 - Extract method incorrectly extracts code that contains yield return\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug11948()\n\t\t{\n\t\t\tTestWrongContext<ExtractMethodAction>(@\"class TestClass\n{\n\tint member = 5;\n\tIEnumerable<int> TestMethod ()\n\t{\n\t\tint i = 5;\n\t\t<-yield return i;->\n\t\tConsole.WriteLine (i);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractWhileConditionToInternalIfStatementActionTests.cs",
    "content": "//\n// ExtractWhileConditionToInternalIfStatementActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring.ExtractMethod;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ExtractWhileConditionToInternalIfStatementActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase()\n\t\t{\n\t\t\tTest<ExtractWhileConditionToInternalIfStatementAction>(@\"\npublic class Main \n{\n\tpublic int Foo (int i)\n\t{\n\t\t$while (i < 10) {\n\t\t\tSystem.Console.WriteLine (i);\n\t\t\ti++;\n\t\t}\n\t\treturn 2;\n\t}\n}\n\", @\"\npublic class Main \n{\n\tpublic int Foo (int i)\n\t{\n\t\twhile (true) {\n\t\t\tif (i >= 10)\n\t\t\t\tbreak;\n\t\t\tSystem.Console.WriteLine (i);\n\t\t\ti++;\n\t\t}\n\t\treturn 2;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBlock()\n\t\t{\n\t\t\tTest<ExtractWhileConditionToInternalIfStatementAction>(@\"\npublic class Main \n{\n\tpublic int Foo (int i)\n\t{\n\t\t$while (i < 10)\n\t\t\tSystem.Console.WriteLine (i++);\n\t\treturn 2;\n\t}\n}\n\", @\"\npublic class Main \n{\n\tpublic int Foo (int i)\n\t{\n\t\twhile (true) {\n\t\t\tif (i >= 10)\n\t\t\t\tbreak;\n\t\t\tSystem.Console.WriteLine (i++);\n\t\t}\n\t\treturn 2;\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestRemoveEmptyStatement()\n\t\t{\n\t\t\tTest<ExtractWhileConditionToInternalIfStatementAction>(@\"\npublic class Main \n{\n\tpublic int Foo (int i)\n\t{\n\t\t$while (i++ < 10)\n\t\t\t;\n\t\treturn 2;\n\t}\n}\n\", @\"\npublic class Main \n{\n\tpublic int Foo (int i)\n\t{\n\t\twhile (true) {\n\t\t\tif (i++ >= 10)\n\t\t\t\tbreak;\n\t\t}\n\t\treturn 2;\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/FlipEqualsTargetAndArgumentActionTests.cs",
    "content": "//\n// FlipEqualsTargetAndArgumentActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class FlipEqualsTargetAndArgumentActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (x.$Equals (y))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\", @\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (y.Equals (x))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexCase ()\n\t\t{\n\t\t\tTest<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (x.$Equals (1 + 2))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\", @\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif ((1 + 2).Equals (x))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveParens ()\n\t\t{\n\t\t\tTest<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif ((1 + 2).Equals $(x))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\", @\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (x.Equals (1 + 2))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnaryOperatorCase ()\n\t\t{\n\t\t\tTest<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic void FooFoo (object x, bool y)\n\t{\n\t\tif (x.$Equals (!y))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\", @\"\nclass Foo\n{\n\tpublic void FooFoo (object x, bool y)\n\t{\n\t\tif ((!y).Equals (x))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCase ()\n\t\t{\n\t\t\tTestWrongContext<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (x.$Equals (null))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticCase ()\n\t\t{\n\t\t\tTestWrongContext<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic static bool Equals (object a) { return false; }\n\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (Foo.$Equals (x))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaretLocation ()\n\t\t{\n\t\t\tTestWrongContext<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (x$.Equals (y))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t\tTestWrongContext<FlipEqualsTargetAndArgumentAction>(@\"\nclass Foo\n{\n\tpublic void FooFoo (object x, object y)\n\t{\n\t\tif (x.Equals ($y))\n\t\t\tConsole.WriteLine (x);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/FlipOperatorArgumentsTests.cs",
    "content": "// \n// FlipOperatorArgumentsTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class FlipOperatorArgumentsTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew FlipOperatorArgumentsAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tif (a $!= b)\" + Environment.NewLine +\n\t\t\t\t\"\t\t\t;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tif (b != a)\" + Environment.NewLine +\n\t\t\t\t\"\t\t\t;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/GenerateGetterTests.cs",
    "content": "// \n// GenerateGetterTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class GenerateGetterTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew GenerateGetterAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tint $myField;\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int MyField {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\treturn myField;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"\tint myField;\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/GeneratePropertyTests.cs",
    "content": "﻿// \n// GeneratePropertyTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class GeneratePropertyTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew GeneratePropertyAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tint $myField;\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int MyField {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\treturn myField;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t\tset {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tmyField = value;\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"\tint myField;\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void HandlesFieldsWhichMatchThePropertyNameTest ()\n\t\t{\n\t\t\tTest<GeneratePropertyAction> (\n@\"\nclass TestClass\n{\n\tpublic int $MyField;\n}\",\n@\"\nclass TestClass\n{\n\tpublic int MyField {\n\t\tget {\n\t\t\treturn myField;\n\t\t}\n\t\tset {\n\t\t\tmyField = value;\n\t\t}\n\t}\n\tpublic int myField;\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void HandlesMultiDeclarationTest ()\n\t\t{\n\t\t\tTest<GeneratePropertyAction> (\n@\"\nclass TestClass\n{\n\tint $MyField, myOtherField;\n}\",\n@\"\nclass TestClass\n{\n\tpublic int MyField {\n\t\tget {\n\t\t\treturn myField;\n\t\t}\n\t\tset {\n\t\t\tmyField = value;\n\t\t}\n\t}\n\tint myField, myOtherField;\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CannotGeneratePropertyForReadOnlyField()\n\t\t{\n\t\t\tTestWrongContext (\n\t\t\t\tnew GeneratePropertyAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\treadonly int $myField;\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CannotGeneratePropertyForConst()\n\t\t{\n\t\t\tTestWrongContext (\n\t\t\t\tnew GeneratePropertyAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tconst int $myField = 0;\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/GenerateSwitchLabelsTests.cs",
    "content": "// \n// GenerateSwitchLabelsTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class GenerateSwitchLabelsTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew GenerateSwitchLabelsAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (ConsoleModifiers mods)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\t$switch (mods) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test (ConsoleModifiers mods)\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tswitch (mods) {\" + Environment.NewLine +\n\t\t\t\t\"\t\tcase ConsoleModifiers.Alt:\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tbreak;\" + Environment.NewLine +\n\t\t\t\t\"\t\tcase ConsoleModifiers.Shift:\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tbreak;\" + Environment.NewLine +\n\t\t\t\t\"\t\tcase ConsoleModifiers.Control:\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tbreak;\" + Environment.NewLine +\n\t\t\t\t\"\t\tdefault:\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tthrow new ArgumentOutOfRangeException ();\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddMissing ()\n\t\t{\n\t\t\tTest<GenerateSwitchLabelsAction>(@\"\nusing System;\n\nclass Foo\n{\n\tvoid Bar (ConsoleModifiers mods)\n\t{\n\t\t$switch (mods) {\n\t\tcase ConsoleModifiers.Alt:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new ArgumentOutOfRangeException ();\n\t\t}\n\t}\n}\n\", @\"\nusing System;\n\nclass Foo\n{\n\tvoid Bar (ConsoleModifiers mods)\n\t{\n\t\tswitch (mods) {\n\t\tcase ConsoleModifiers.Alt:\n\t\t\tbreak;\n\t\tcase ConsoleModifiers.Shift:\n\t\t\tbreak;\n\t\tcase ConsoleModifiers.Control:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new ArgumentOutOfRangeException ();\n\t\t}\n\t}\n}\n\");\n\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ImplementAbstractMembersTest.cs",
    "content": "﻿// \n// ImplementAbstractMembersTest.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ImplementAbstractMembersTest : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleBaseType()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Simple {\n\tpublic abstract void FooBar (string foo, int bar);\n}\n\nclass Foo : $Simple\n{\n}\n\", @\"abstract class Simple {\n\tpublic abstract void FooBar (string foo, int bar);\n}\n\nclass Foo : Simple\n{\n\t#region implemented abstract members of Simple\n\tpublic override void FooBar (string foo, int bar)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestProtectedMembers()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Simple {\n\tprotected abstract string ServiceName { get; }\n}\n\nclass Foo : $Simple\n{\n}\n\", @\"abstract class Simple {\n\tprotected abstract string ServiceName { get; }\n}\n\nclass Foo : Simple\n{\n\t#region implemented abstract members of Simple\n\tprotected override string ServiceName {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestProtectedInternalMembers()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Simple {\n\tprotected internal abstract string ServiceName { get; }\n}\n\nclass Foo : $Simple\n{\n}\n\", @\"abstract class Simple {\n\tprotected internal abstract string ServiceName { get; }\n}\n\nclass Foo : Simple\n{\n\t#region implemented abstract members of Simple\n\tprotected internal override string ServiceName {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestAbstractOverrideMethodCase1()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"class A {\n\tpublic virtual void Foo() {\n\t\tConsole.WriteLine(\"\"A:Foo()\"\");\n\t}\n}\n\nabstract class B : A {\n\tpublic abstract override void Foo();\n\tpublic abstract void FooBar();\n}\n\nclass C : $B\n{\n}\n\", @\"class A {\n\tpublic virtual void Foo() {\n\t\tConsole.WriteLine(\"\"A:Foo()\"\");\n\t}\n}\n\nabstract class B : A {\n\tpublic abstract override void Foo();\n\tpublic abstract void FooBar();\n}\n\nclass C : B\n{\n\t#region implemented abstract members of B\n\tpublic override void Foo ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic override void FooBar ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAbstractOverrideMethodCase2()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Base {\n\tpublic abstract void Foo ();\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override void Foo ();\n}\n\nclass MockTypeInfo : $Base2\n{\n}\n\", @\"abstract class Base {\n\tpublic abstract void Foo ();\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override void Foo ();\n}\n\nclass MockTypeInfo : Base2\n{\n\t#region implemented abstract members of Base2\n\tpublic override void Foo ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAbstractOverrideEventCase1()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"using System;\nclass A {\n\tpublic virtual event EventHandler Foo { add {} remove {} }\n}\n\nabstract class B : A {\n\tpublic abstract override event EventHandler Foo;\n\tpublic abstract event EventHandler FooBar;\n}\n\nclass C : $B\n{\n}\n\", @\"using System;\nclass A {\n\tpublic virtual event EventHandler Foo { add {} remove {} }\n}\n\nabstract class B : A {\n\tpublic abstract override event EventHandler Foo;\n\tpublic abstract event EventHandler FooBar;\n}\n\nclass C : B\n{\n\t#region implemented abstract members of B\n\tpublic override event EventHandler Foo;\n\tpublic override event EventHandler FooBar;\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestAbstractOverridePropertyCase2()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Base {\n\tpublic abstract int Foo { get;  }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override int Foo { get; }\n}\n\nclass MockTypeInfo : $Base2\n{\n}\n\", @\"abstract class Base {\n\tpublic abstract int Foo { get;  }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override int Foo { get; }\n}\n\nclass MockTypeInfo : Base2\n{\n\t#region implemented abstract members of Base2\n\tpublic override int Foo {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestAbstractOverrideVirtualMethod()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Base {\n\tpublic virtual void Foo () { }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override void Foo () { }\n}\n\nclass MockTypeInfo : $Base2\n{\n}\n\", @\"abstract class Base {\n\tpublic virtual void Foo () { }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override void Foo () { }\n}\n\nclass MockTypeInfo : Base2\n{\n\t#region implemented abstract members of Base2\n\tpublic override void Foo ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestAbstractOverrideVirtualProperty()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Base {\n\tpublic virtual int Foo { get { return 1; } }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override int Foo { get; }\n}\n\nclass MockTypeInfo : $Base2\n{\n}\n\", @\"abstract class Base {\n\tpublic virtual int Foo { get { return 1; } }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override int Foo { get; }\n}\n\nclass MockTypeInfo : Base2\n{\n\t#region implemented abstract members of Base2\n\tpublic override int Foo {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAbstractOverrideVirtualIndexer()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"abstract class Base {\n\tpublic virtual int this [int i] { get { return 1; } }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override int this [int i] { get; }\n}\n\nclass MockTypeInfo : $Base2\n{\n}\n\", @\"abstract class Base {\n\tpublic virtual int this [int i] { get { return 1; } }\n}\n\nabstract class Base2 : Base {\n\tpublic abstract override int this [int i] { get; }\n}\n\nclass MockTypeInfo : Base2\n{\n\t#region implemented abstract members of Base2\n\tpublic override int this [int i] {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAbstractOverrideVirtualEvent()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"using System;\n\nabstract class Base {\n\tpublic virtual event EventHandler Foo {\n\t\tadd {}\n\t\tremove{}\n\t}\n}\n\nabstract class Base2 : Base {\n\tpublic override abstract event EventHandler Foo;\n}\n\nclass MockTypeInfo : $Base2\n{\n}\n\", @\"using System;\n\nabstract class Base {\n\tpublic virtual event EventHandler Foo {\n\t\tadd {}\n\t\tremove{}\n\t}\n}\n\nabstract class Base2 : Base {\n\tpublic override abstract event EventHandler Foo;\n}\n\nclass MockTypeInfo : Base2\n{\n\t#region implemented abstract members of Base2\n\tpublic override event EventHandler Foo;\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAlreadyImplementedMethods()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"class A {\n\tpublic abstract void Foo();\n\tpublic abstract void FooBar();\n}\n\nabstract class B : A {\n\tpublic override void Foo() {}\n}\n\nclass C : $B\n{\n}\n\", @\"class A {\n\tpublic abstract void Foo();\n\tpublic abstract void FooBar();\n}\n\nabstract class B : A {\n\tpublic override void Foo() {}\n}\n\nclass C : B\n{\n\t#region implemented abstract members of A\n\tpublic override void FooBar ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAlreadyImplementedProperties()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"class A {\n\tpublic abstract int Foo { get; }\n\tpublic abstract int FooBar { get; }\n}\n\nabstract class B : A {\n\tpublic override int Foo { get { return 1; } }\n}\n\nclass C : $B\n{\n}\n\", @\"class A {\n\tpublic abstract int Foo { get; }\n\tpublic abstract int FooBar { get; }\n}\n\nabstract class B : A {\n\tpublic override int Foo { get { return 1; } }\n}\n\nclass C : B\n{\n\t#region implemented abstract members of A\n\tpublic override int FooBar {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestConstraints()\n\t\t{\n\t\t\tTest<ImplementAbstractMembersAction>(@\"class NSObject\n{\n}\n\nabstract class A\n{\n\tpublic abstract void Foo<T, U> () where T : NSObject, U where U : NSObject;\n}\n\nclass B : $A\n{\n}\n\", @\"class NSObject\n{\n}\n\nabstract class A\n{\n\tpublic abstract void Foo<T, U> () where T : NSObject, U where U : NSObject;\n}\n\nclass B : A\n{\n\t#region implemented abstract members of A\n\tpublic override void Foo<T, U> ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ImplementInterfaceExplicitTests.cs",
    "content": "﻿// \n// ImplementInterfaceExplicitTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ImplementInterfaceExplicitTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleInterface()\n\t\t{\n\t\t\tTest<ImplementInterfaceExplicitAction>(@\"using System;\nclass Foo : $IDisposable\n{\n}\n\", @\"using System;\nclass Foo : IDisposable\n{\n\t#region IDisposable implementation\n\tvoid IDisposable.Dispose ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedInterfaceInGenericClass()\n\t\t{\n\t\t\tTest<ImplementInterfaceExplicitAction>(@\"using System;\nclass TestClass<T> {\n\tpublic interface INestedInterface { T Prop { get; } }\n}\nclass TargetClass : TestClass<string>.$INestedInterface\n{\n}\n\", @\"using System;\nclass TestClass<T> {\n\tpublic interface INestedInterface { T Prop { get; } }\n}\nclass TargetClass : TestClass<string>.INestedInterface\n{\n\t#region INestedInterface implementation\n\tstring TestClass<string>.INestedInterface.Prop {\n\t\tget {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestConstraints()\n\t\t{\n\t\t\tTest<ImplementInterfaceExplicitAction>(@\"class NSObject\n{\n}\n\ninterface A\n{\n\tvoid Foo<T, U> () where T : NSObject, U where U : NSObject;\n}\n\nclass B : $A\n{\n}\n\", @\"class NSObject\n{\n}\n\ninterface A\n{\n\tvoid Foo<T, U> () where T : NSObject, U where U : NSObject;\n}\n\nclass B : A\n{\n\t#region A implementation\n\tvoid A.Foo<T, U> ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ImplementInterfaceTests.cs",
    "content": "// \n// ImplementInterfaceTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ImplementInterfaceTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleInterface()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"using System;\nclass Foo : $IDisposable\n{\n}\n\", @\"using System;\nclass Foo : IDisposable\n{\n\t#region IDisposable implementation\n\tpublic void Dispose ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 663842 - Interface implementation does not include constraints\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug663842()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"using System;\ninterface ITest {\n\tvoid MyMethod1<T> (T t) where T : new ();\n\tvoid MyMethod2<T> (T t) where T : class;\n\tvoid MyMethod3<T> (T t) where T : struct;\n\tvoid MyMethod4<T> (T t) where T : IDisposable, IServiceProvider;\n}\n\nclass Foo : $ITest\n{\n}\n\", @\"using System;\ninterface ITest {\n\tvoid MyMethod1<T> (T t) where T : new ();\n\tvoid MyMethod2<T> (T t) where T : class;\n\tvoid MyMethod3<T> (T t) where T : struct;\n\tvoid MyMethod4<T> (T t) where T : IDisposable, IServiceProvider;\n}\n\nclass Foo : ITest\n{\n\t#region ITest implementation\n\tpublic void MyMethod1<T> (T t) where T : new()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\tpublic void MyMethod2<T> (T t) where T : class\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\tpublic void MyMethod3<T> (T t) where T : struct\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\tpublic void MyMethod4<T> (T t) where T : IDisposable, IServiceProvider\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 683007 - \"Refactor/Implement implicit\" creates explicit implementations of methods with same names\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug683007()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"interface ITest {\n\tvoid M1();\n\tvoid M1(int x);\n}\n\nclass Foo : $ITest\n{\n}\", @\"interface ITest {\n\tvoid M1();\n\tvoid M1(int x);\n}\n\nclass Foo : ITest\n{\n\t#region ITest implementation\n\tpublic void M1 ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic void M1 (int x)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 243 - Implement implicit interface doesn't handle overloads correctly. \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug243()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"interface ITest {\n\tvoid Inc (int n);\n\tvoid Inc (string message);\n}\n\nclass Foo : $ITest\n{\n}\n\", @\"interface ITest {\n\tvoid Inc (int n);\n\tvoid Inc (string message);\n}\n\nclass Foo : ITest\n{\n\t#region ITest implementation\n\tpublic void Inc (int n)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic void Inc (string message)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2074 - [Regression] Implement Interface implicitly does not check the methods already exist \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2074()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"interface ITest {\n\tvoid Method1 ();\n\tvoid Method2 ();\n}\n\nclass Foo : $ITest\n{\n\tpublic void Method2 () {}\n}\", @\"interface ITest {\n\tvoid Method1 ();\n\tvoid Method2 ();\n}\n\nclass Foo : ITest\n{\n\tpublic void Method1 ()\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n\tpublic void Method2 () {}\n}\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3365 - MD cannot implement IEnumerable interface correctly  - MD cannot implement IEnumerable interface correctly \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3365()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"using System;\nusing System.Collections;\n\npublic interface IA\n{\n\tbool GetEnumerator ();\n}\n\npublic interface ITest : IA, IEnumerable\n{\n}\n\nclass Foo : $ITest\n{\n}\", @\"using System;\nusing System.Collections;\n\npublic interface IA\n{\n\tbool GetEnumerator ();\n}\n\npublic interface ITest : IA, IEnumerable\n{\n}\n\nclass Foo : ITest\n{\n\t#region IEnumerable implementation\n\tpublic IEnumerator GetEnumerator ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n\t#region IA implementation\n\tbool IA.GetEnumerator ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 4818 - Implement implicit does not handle 'params' types \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4818()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"using System;\ninterface ITest {\n\tvoid OnScenesAdded (params ITest[] scenes);\n}\n\nclass Foo : $ITest\n{\n}\n\", @\"using System;\ninterface ITest {\n\tvoid OnScenesAdded (params ITest[] scenes);\n}\n\nclass Foo : ITest\n{\n\t#region ITest implementation\n\tpublic void OnScenesAdded (params ITest[] scenes)\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\n\t\t\tTestWrongContext<ImplementInterfaceAction>(@\"using System;\ninterface ITest {\n\tvoid OnScenesAdded (params ITest[] scenes);\n}\n\nclass Foo : $ITest\n{\n\t#region ITest implementation\n\tpublic void OnScenesAdded (params ITest[] scenes)\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9117 - [3.0.5] C#: Implementing interfaces inheriting from other interfaces\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9117()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"using System;\n public interface IAncestor\n{\n\tstring X { get; set; }\n\tvoid DoThings();\n}\n\npublic interface IDescendant: IAncestor\n{\n\tstring Y { get; set; }\n\tstring Z { get; set; }\n}\n\nclass Foo : $IDescendant\n{\n}\n\", @\"using System;\n public interface IAncestor\n{\n\tstring X { get; set; }\n\tvoid DoThings();\n}\n\npublic interface IDescendant: IAncestor\n{\n\tstring Y { get; set; }\n\tstring Z { get; set; }\n}\n\nclass Foo : IDescendant\n{\n\t#region IAncestor implementation\n\tpublic void DoThings ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\tpublic string X {\n\t\tget {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n\t#region IDescendant implementation\n\tpublic string Y {\n\t\tget {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\tpublic string Z {\n\t\tget {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\n\");\n\t\t\t\n\t\t\tTestWrongContext<ImplementInterfaceAction>(@\"using System;\ninterface ITest {\n\tvoid OnScenesAdded (params ITest[] scenes);\n}\n\nclass Foo : $ITest\n{\n\t#region ITest implementation\n\tpublic void OnScenesAdded (params ITest[] scenes)\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9603 - Implement interface cannot deal with member hidding\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9603()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"using System;\n\npublic interface IA\n{\n    string this[int index] { get; set; }\n}\n\npublic interface IB : IA\n{\n    new int this[int index] { get; set; }\n}\n\nclass M : $IB\n{\n}\", @\"using System;\n\npublic interface IA\n{\n    string this[int index] { get; set; }\n}\n\npublic interface IB : IA\n{\n    new int this[int index] { get; set; }\n}\n\nclass M : IB\n{\n\t#region IB implementation\n\tpublic int this [int index] {\n\t\tget {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n\t#region IA implementation\n\tstring IA.this [int index] {\n\t\tget {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t}\n\t#endregion\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestImplementMissingMembers()\n\t\t{\n\t\t\tTest<ImplementInterfaceAction>(@\"using System;\ninterface IFoo\n{\n\tvoid FooBar ();\n\tvoid BarFoo ();\n}\nclass Foo : $IFoo\n{\n\tpublic void FooBar () {}\n}\n\", @\"using System;\ninterface IFoo\n{\n\tvoid FooBar ();\n\tvoid BarFoo ();\n}\nclass Foo : IFoo\n{\n\tpublic void BarFoo ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\tpublic void FooBar () {}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ImplementNotImplementedPropertyTests.cs",
    "content": "//\n// ImplementNotImplementedPropertyTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ImplementNotImplementedPropertyTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestGetter ()\n\t\t{\n\t\t\tTest<ImplementNotImplementedProperty> (@\"class TestClass\n{\n\tstring $Test { get { throw new System.NotImplementedException (); } }\n}\", @\"class TestClass\n{\n\treadonly string test;\n\tstring Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGetterAndSetter ()\n\t\t{\n\t\t\tTest<ImplementNotImplementedProperty> (@\"class TestClass\n{\n\tstring $Test {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tstring test;\n\tstring Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestWrongLocation()\n\t\t{\n\t\t\tTestWrongContext<ImplementNotImplementedProperty> (@\"class TestClass\n{\n\tpublic $string Test {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n}\");\n\n\t\t\tTestWrongContext<ImplementNotImplementedProperty> (@\"class TestClass\n{\n\tpublic string $FooBar.Test {\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n}\");\n\n\t\t\tTestWrongContext<ImplementNotImplementedProperty> (@\"class TestClass\n{\n\tpublic string Test ${\n\t\tget {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\tset {\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/InlineLocalVariableTests.cs",
    "content": "// \n// InlineLocalVariableTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class InlineLocalVariableTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleInline ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tint $tmp = 5 + 6;\n\t\tConsole.WriteLine (tmp);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine (5 + 6);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddNoParensForSimpleReplacement ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test (int foo)\n\t{\n\t\tint $tmp = foo;\n\t\tConsole.WriteLine (tmp.ToString ());\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test (int foo)\n\t{\n\t\tConsole.WriteLine (foo.ToString ());\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddNoParensForMemberReferenceReplacement ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tstatic int Foo;\n\tvoid Test ()\n\t{\n\t\tint $tmp = TestClass.Foo;\n\t\tConsole.WriteLine (tmp.ToString ());\n\t}\n}\", @\"class TestClass\n{\n\tstatic int Foo;\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine (TestClass.Foo.ToString ());\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddParens ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tint $tmp = 5 + 6;\n\t\tConsole.WriteLine (tmp.ToString ());\n\t\tConsole.WriteLine (tmp * 3);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine ((5 + 6).ToString ());\n\t\tConsole.WriteLine ((5 + 6) * 3);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddParensConditionalOperatorCase ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tbool $tmp = 3 == 5;\n\t\tConsole.WriteLine (tmp ? tmp : 2);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine ((3 == 5) ? 3 == 5 : 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddParensAsOperatorCase ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tobject $tmp = 3 == 5;\n\t\tConsole.WriteLine (tmp as bool);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine ((3 == 5) as bool);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAddParensIsOperatorCase ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tobject $tmp = 3 == 5;\n\t\tConsole.WriteLine (tmp is bool);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine ((3 == 5) is bool);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddParensCastOperatorCase ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tobject $tmp = 3 == 5;\n\t\tConsole.WriteLine ((bool)tmp);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine ((bool)(3 == 5));\n\t}\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestPointerReferenceExpression ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"unsafe class TestClass\n{\n\tpublic void Test (int* foo)\n\t{\n\t\tint* $ptr = foo + 5;\n\t\tConsole.WriteLine (ptr->ToString ());\n\t}\n}\", @\"unsafe class TestClass\n{\n\tpublic void Test (int* foo)\n\t{\n\t\tConsole.WriteLine ((foo + 5)->ToString ());\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestUnaryOperatorCase ()\n\t\t{\n\t\t\tTest<InlineLocalVariableAction> (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tbool $tmp = 3 == 5;\n\t\tConsole.WriteLine (!tmp);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tConsole.WriteLine (!(3 == 5));\n\t}\n}\");\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/InsertAnonymousMethodSignatureTests.cs",
    "content": "// \n// InsertAnonymousMethodSignatureTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class InsertAnonymousMethodSignatureTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew InsertAnonymousMethodSignatureAction (),\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tEventHandler handler = $delegate {\" + Environment.NewLine +\n\t\t\t\t\"\t\t};\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"using System;\" + Environment.NewLine +\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tEventHandler handler = delegate(object sender, EventArgs e) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t};\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceConstantTests.cs",
    "content": "// \n// IntroduceConstantTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class IntroduceConstantTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestLocalConstant ()\n\t\t{\n\t\t\tTest<IntroduceConstantAction> (@\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tSystem.Console.WriteLine ($\"\"Hello World\"\");\n\t}\n}\", @\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tconst string helloWorld = \"\"Hello World\"\";\n\t\tSystem.Console.WriteLine (helloWorld);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalConstantHexNumber ()\n\t\t{\n\t\t\tTest<IntroduceConstantAction> (@\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tSystem.Console.WriteLine ($0xAFFE);\n\t}\n}\", @\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tconst int i = 0xAFFE;\n\t\tSystem.Console.WriteLine (i);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldConstant ()\n\t\t{\n\t\t\tTest<IntroduceConstantAction> (@\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tSystem.Console.WriteLine ($\"\"Hello World\"\");\n\t}\n}\", @\"class TestClass\n{\n\tconst string helloWorld = \"\"Hello World\"\";\n\tpublic void Hello ()\n\t{\n\t\tSystem.Console.WriteLine (helloWorld);\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalConstantReplaceAll ()\n\t\t{\n\t\t\tTest<IntroduceConstantAction> (@\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tSystem.Console.WriteLine ($\"\"Hello World\"\");\n\t\tSystem.Console.WriteLine (\"\"Hello World\"\");\n\t\tSystem.Console.WriteLine (\"\"Hello World\"\");\n\t}\n}\", @\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tconst string helloWorld = \"\"Hello World\"\";\n\t\tSystem.Console.WriteLine (helloWorld);\n\t\tSystem.Console.WriteLine (helloWorld);\n\t\tSystem.Console.WriteLine (helloWorld);\n\t}\n}\", 2);\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestAlreadyConstant ()\n\t\t{\n\t\t\tTestWrongContext<IntroduceConstantAction> (@\"class TestClass\n{\n\tpublic void Hello ()\n\t{\n\t\tconst int i = $0xAFFE;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAlreadyConstantCase2 ()\n\t\t{\n\t\t\tTestWrongContext<IntroduceConstantAction> (@\"class TestClass\n{\n\tconst int i = $0xAFFE;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIntroduceConstantInInitializer ()\n\t\t{\n\t\t\tTest<IntroduceConstantAction> (@\"class TestClass\n{\n\treadonly int foo = new Foo ($5);\n}\", @\"class TestClass\n{\n\tconst int i = 5;\n\treadonly int foo = new Foo (i);\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceFormatItemTests.cs",
    "content": "// \n// IntroduceFormatItemTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class IntroduceFormatItemTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestFirst ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew IntroduceFormatItemAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tstring str = \\\"Hello <-World->!\\\";\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tstring str = string.Format (\\\"Hello {0}!\\\", \\\"World\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestSecond ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew IntroduceFormatItemAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tstring str = string.Format (\\\"<-Hello-> {0}!\\\", \\\"World\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tstring str = string.Format (\\\"{1} {0}!\\\", \\\"World\\\", \\\"Hello\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/InvertConditionalOperatorActionTests.cs",
    "content": "//\n// InvertConditionalOperatorActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class InvertConditionalOperatorActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCase1()\n\t\t{\n\t\t\tTest<InvertConditionalOperatorAction>(@\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i > j $? i : j);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i <= j ? j : i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionStart()\n\t\t{\n\t\t\tTest<InvertConditionalOperatorAction>(@\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine ($i > j ? i : j);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i <= j ? j : i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTrueStart()\n\t\t{\n\t\t\tTest<InvertConditionalOperatorAction>(@\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i > j ? $i : j);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i <= j ? j : i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFalseStart()\n\t\t{\n\t\t\tTest<InvertConditionalOperatorAction>(@\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i > j ? i : $j);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i <= j ? j : i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPopupLocations()\n\t\t{\n\t\t\tTestWrongContext<InvertConditionalOperatorAction>(@\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i > $j ? i : j);\n\t}\n}\n\");\n\t\t\tTestWrongContext<InvertConditionalOperatorAction>(@\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i > j ? i$i : j);\n\t}\n}\n\");\n\n\t\t\tTestWrongContext<InvertConditionalOperatorAction>(@\"\nclass Foo\n{\n\tvoid Bar (int i, int j)\n\t{\n\t\tConsole.WriteLine (i > j ? ii : j$j);\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/InvertIfAndSimplifyTests.cs",
    "content": "using ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tclass InvertIfAndSimplifyTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test()\n\t\t{\n\t\t\tTest<InvertIfAndSimplify>(\n\t\t\t\t@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$if (true) {\n\t\t\tCase1 ();\n\t\t\tCase2 ();\n\t\t}\n        else \n        {\n            return;\n        }\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (false)\n\t\t\treturn;\n\t\tCase1 ();\n\t\tCase2 ();\n\t}\n}\"\n\t\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonVoidMoreComplexMethod()\n\t\t{\n\t\t\tTest<InvertIfAndSimplify>(\n\t\t\t\t@\"class TestClass\n{\n\tint Test ()\n\t{\n\t\t$if (true) {\n\t\t\tCase1 ();\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn 0;\n\t\t\ttestDummyCode ();\n\t\t}\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tint Test ()\n\t{\n\t\tif (false) {\n\t\t\treturn 0;\n\t\t\ttestDummyCode ();\n\t\t}\n\t\tCase1 ();\n\t}\n}\"\n\t\t\t\t);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexMethod()\n\t\t{\n\t\t\tTest<InvertIfAndSimplify>(\n\t\t\t\t@\"class TestClass\n{\n\tint Test ()\n\t{\n\t\t$if (true) {\n\t\t\tCase1 ();\n\t\t}\n        else \n            continue;\n        return 0;\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tint Test ()\n\t{\n\t\tif (false)\n\t\t\tcontinue;\n\t\tCase1 ();\n\t\treturn 0;\n\t}\n}\"\n\t\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComment()\n\t\t{\n\t\t\tTest<InvertIfAndSimplify>(\n\t\t\t\t@\"class TestClass\n{\n\tint Test ()\n\t{\n\t\t$if (true) {\n\t\t\tCase1 ();\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//TestComment\n\t\t\treturn 0;\n\t\t}\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tint Test ()\n\t{\n\t\tif (false) {\n\t\t\t//TestComment\n\t\t\treturn 0;\n\t\t}\n\t\tCase1 ();\n\t}\n}\"\n\t\t\t\t);\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/InvertIfTests.cs",
    "content": "// \n// InvertIfTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class InvertIfTestsTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew InvertIfAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\t$if (true) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tCase1 ();\" + Environment.NewLine +\n\t\t\t\t\"\t\t} else {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tCase2 ();\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tif (false) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tCase2 ();\" + Environment.NewLine +\n\t\t\t\t\"\t\t} else {\" + Environment.NewLine +\n\t\t\t\t\"\t\t\tCase1 ();\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/InvertLogicalExpressionTests.cs",
    "content": "﻿// \n// InvertLogicalExpressionTests.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class InvertLogicalExpressionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void ConditionlAnd()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (a $&& b){}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (!(!a || !b)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConditionlAndReverse()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (!(!a $|| !b)) {\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (a && b) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConditionlOr()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (a $|| b){}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (!(!a && !b)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConditionlOrReverse()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (!(!a $&& !b)){}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (a || b) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void ConditionlAnd2()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint a = 1;\n\t\tbool b = true;\n\t\tif ((a > 1) $&& b){}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint a = 1;\n\t\tbool b = true;\n\t\tif (!((a <= 1) || !b)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConditionlOr2()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint a = 1;\n\t\tbool b = true;\n\t\tif (!((a > 1) $|| b)){}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tint a = 1;\n\t\tbool b = true;\n\t\tif ((a <= 1) && !b) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void Equals()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (a $== b){}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (!(a != b)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EqualsReverse()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (!(a $!= b)){}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tbool a = true;\n\t\tbool b = false;\n\t\tif (a == b) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestNullCoalescing()\n\t\t{\n\t\t\tTestWrongContext<InvertLogicalExpressionAction>(@\"\nclass Foo\n{\n\tvoid Bar (object i, object j)\n\t{\n\t\tConsole.WriteLine (i $?? j);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestUnaryExpression()\n\t\t{\n\t\t\tTest<InvertLogicalExpressionAction>(@\"\nclass Foo\n{\n\tvoid Bar (bool a, bool b)\n\t{\n\t\tConsole.WriteLine ($!(a && b));\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (bool a, bool b)\n\t{\n\t\tConsole.WriteLine (!a || !b);\n\t}\n}\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IterateViaForeachTests.cs",
    "content": "//\n// IterateViaForeachTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class IterateViaForeachTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void HandlesNonGenericCase()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nusing System.Collections;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tvar $list = new ArrayList ();\n\t}\n}\", @\"\nusing System.Collections;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tvar list = new ArrayList ();\n\t\tforeach (var o in list) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesExpressionStatement()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic IEnumerable<int> GetInts()\n\t{\n\t\treturn new int[] { };\n\t}\n\n\tpublic void F()\n\t{\n\t\tGetInts$();\n\t}\n}\", @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic IEnumerable<int> GetInts()\n\t{\n\t\treturn new int[] { };\n\t}\n\n\tpublic void F()\n\t{\n\t\tforeach (var i in GetInts ()) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesAssignmentExpressionStatement()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic IEnumerable<int> GetInts ()\n\t{\n\t\treturn new int[] { };\n\t}\n\n\tpublic void F()\n\t{\n\t\tIEnumerable<int> ints;\n\t\t$ints = GetInts ();\n\t}\n}\", @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic IEnumerable<int> GetInts ()\n\t{\n\t\treturn new int[] { };\n\t}\n\n\tpublic void F()\n\t{\n\t\tIEnumerable<int> ints;\n\t\tints = GetInts ();\n\t\tforeach (var i in ints) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesAsExpressionStatement()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tobject s = \"\"\"\";\n\t\ts as IEnumerable$<char>;\n\t}\n}\", @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tobject s = \"\"\"\";\n\t\tforeach (var c in s as IEnumerable<char>) {\n\t\t}\n\t}\n}\", 0, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NonKnownTypeNamingTest()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tvar $items = new List<TestClass> ();\n\t}\n}\", @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tvar items = new List<TestClass> ();\n\t\tforeach (var testClass in items) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesAsExpression()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tobject s = \"\"\"\";\n\t\ts as IEnumerable$<char>\n\t}\n}\", @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tobject s = \"\"\"\";\n\t\tforeach (var c in s as IEnumerable<char>) {\n\t\t}\n\t}\n}\", 0, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesLinqExpressionAssignment()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tpublic IEnumerable<int> GetInts()\n\t{\n\t\treturn new int[] { };\n\t}\n\n\tpublic void F()\n\t{\n\t\tvar $filteredInts = from item in GetInts ()\n\t\t\t\t\t\t\twhere item > 0\n\t\t\t\t\t\t\tselect item;\n\t}\n}\", @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tpublic IEnumerable<int> GetInts()\n\t{\n\t\treturn new int[] { };\n\t}\n\n\tpublic void F()\n\t{\n\t\tvar filteredInts = from item in GetInts ()\n\t\t\t\t\t\t\twhere item > 0\n\t\t\t\t\t\t\tselect item;\n\t\tforeach (var i in filteredInts) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresExpressionsInForeachStatement()\n\t\t{\n\t\t\tTestWrongContext<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tpublic IEnumerable<int> GetInts()\n\t{\n\t\treturn new int[] { };\n\t}\n\n\tpublic void F()\n\t{\n\t\tforeach (var i in $GetInts ()) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresInitializersInForStatement()\n\t\t{\n\t\t\tTestWrongContext<IterateViaForeachAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tfor (int[] i = new $int[] {} ;;) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddsForToBodyOfUsingStatement()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tusing (int[] $i = new int[] {}) {\n\t\t}\n\t}\n}\",@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tusing (int[] i = new int[] {}) {\n\t\t\tforeach (var j in i) {\n\t\t\t}\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddsBlockStatementToUsingStatement()\n\t\t{\n\t\t\tTest<IterateViaForeachAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tusing (int[] $i = new int[] {});\n\t}\n}\",@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\tusing (int[] i = new int[] { }) {\n\t\t\tforeach (var j in i) {\n\t\t\t}\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresFieldDeclarations()\n\t\t{\n\t\t\tTestWrongContext<IterateViaForeachAction>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tList<int> list = $new List<int>();\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/JoinDeclarationAndAssignmentTests.cs",
    "content": "﻿// \n// JoinDeclarationAndAssignmentTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class JoinDeclarationAndAssignmentTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<JoinDeclarationAndAssignmentAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint $a;\n\t\ta = 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a = 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDeclarationList ()\n\t\t{\n\t\t\tTest<JoinDeclarationAndAssignmentAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a, $b;\n\t\tb = 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a;\n\t\tint b = 1;\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/JoinStringTests.cs",
    "content": "﻿// \n// JoinStringTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class JoinStringTests : ContextActionTestBase\n\t{\n\t\tpublic void Test (string input, string output)\n\t\t{\n\t\t\tTest<JoinStringAction> (@\"\nclass TestClass\n{\n\tstring TestMethod (string arg)\n\t{\n\t\treturn \" + input + @\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tstring TestMethod (string arg)\n\t{\n\t\treturn \" + output + @\";\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRegularString ()\n\t\t{\n\t\t\tTest (\"\\\"a\\\" $+ \\\"a\\\"\", \"\\\"aa\\\"\");\n\t\t\tTest (\"arg + \\\"a\\\" $+ \\\"a\\\"\", \"arg + \\\"aa\\\"\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatimString ()\n\t\t{\n\t\t\tTest (\"@\\\"a\\\" $+ @\\\"a\\\"\", \"@\\\"aa\\\"\");\n\t\t}\n\n\t\tpublic void TestWrongContext (string input)\n\t\t{\n\t\t\tTestWrongContext<JoinStringAction> (@\"\nclass TestClass\n{\n\tstring TestMethod ()\n\t{\n\t\treturn \" + input + @\";\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongContext ()\n\t\t{\n\t\t\tTestWrongContext (\"@\\\"a\\\" $+ \\\"a\\\"\");\n\t\t\tTestWrongContext (\"\\\"a\\\" $+ @\\\"a\\\"\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/LinqFluentToQueryTests.cs",
    "content": "//\n// LinqFluentToQueryTests.cs\n//\n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class LinqFluentToQueryTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$Select (t => t);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in new int[0]\n\t\t        select t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddedParenthesis()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$Select (t => t) + 1;\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = (from t in new int[0]\nselect t) + 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCast()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$Cast<int> ();\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from int _1 in new int[0]\n\t\t        select _1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLet()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].Select (w => new { w, two = w * 2 }).$Select (_ => _.two);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from w in new int[0]\n\t\t        let two = w * 2\n\t\t        select two;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLet2()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].Select (w => new { two = w * 2, w }).$Select (_ => _.two);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from w in new int[0]\n\t\t        let two = w * 2\n\t\t        select two;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLongLetChain()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].Select (w => new { w, two = w * 2 })\n\t\t\t.Select (h => new { h, three = h.w * 3 })\n\t\t\t.Select (k => new { k, four = k.h.w * 4 })\n\t\t\t.$Select (_ => _.k.h.w + _.k.h.two + _.k.three + _.four)\n\t\t\t.Select (sum => sum * 2);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from w in new int[0]\n\t\t        let two = w * 2\n\t\t        let three = w * 3\n\t\t        let four = w * 4\n\t\t        select w + two + three + four into sum\n\t\t        select sum * 2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLongLetChain2()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].Select (w => new { two = w * 2, w })\n\t\t\t.Select (h => new { three = h.w * 3, h })\n\t\t\t.Select (k => new { four = k.h.w * 4, k })\n\t\t\t.$Select (_ => _.k.h.w + _.k.h.two + _.k.three + _.four)\n\t\t\t.Select (sum => sum * 2);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from w in new int[0]\n\t\t        let two = w * 2\n\t\t        let three = w * 3\n\t\t        let four = w * 4\n\t\t        select w + two + three + four into sum\n\t\t        select sum * 2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSelectMany()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$SelectMany (elem => new int[0], (elem1, elem2) => elem1 + elem2);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from elem1 in new int[0]\n\t\t        from elem2 in new int[0]\n\t\t        select elem1 + elem2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSelectManyLet()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$SelectMany (elem => new int[0], (elem1, elem2) => new { elem1, elem2 }).Select(i => new { i, sum = i.elem1 + i.elem2 })\n\t\t\t.Select(j => j.i.elem1 + j.i.elem2 + j.sum);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from elem1 in new int[0]\n\t\t        from elem2 in new int[0]\n\t\t        let sum = elem1 + elem2\n\t\t        select elem1 + elem2 + sum;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSelectManyLet2()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$SelectMany (elem => new int[0], (elem1, elem2) => new { elem1, elem2 = elem2 + 1 }).Select(i => new { i, sum = i.elem1 + i.elem2 })\n\t\t\t.Select(j => j.i.elem1 + j.i.elem2 + j.sum);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from elem1 in new int[0]\n\t\t        from elem2 in new int[0]\n\t\t        select new {\n\telem1,\n\telem2 = elem2 + 1\n} into i\n\t\t        let sum = i.elem1 + i.elem2\n\t\t        select i.elem1 + i.elem2 + sum;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCastSelect()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$Cast<int> ().Select (t => t * 2);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from int t in new int[0]\n\t\t        select t * 2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSelectWhere ()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$Where (t => t > 0).Select (t => t * 2);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in new int[0]\n\t\t        where t > 0\n\t\t        select t * 2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSorting ()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$OrderBy (t => t).ThenByDescending (t => t);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in new int[0]\n\t\t        orderby t, t descending\n\t\t        select t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDegenerateWhere ()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$Where (t => t > 0);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in new int[0]\n\t\t        where t > 0\n\t\t        select t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChain ()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].Where (t => t > 0).$Where (u => u > 0);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in new int[0]\n\t\t        where t > 0\n\t\t        select t into u\n\t\t        where u > 0\n\t\t        select u;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJoin()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].Cast<char> ().$Join(new int[0].Cast<float> (), a => a * 2, b => b, (l, r) => l * r);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from char a in new int[0]\n\t\t        join float b in new int[0] on a * 2 equals b\n\t\t        select a * b;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGroupJoin()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].Cast<char> ().$GroupJoin(new int[0].Cast<float> (), a => a * 2, b => b, (l, r) => l * r [0]);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from char a in new int[0]\n\t\t        join float b in new int[0] on a * 2 equals b into r\n\t\t        select a * r [0];\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonRecursive()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = Enumerable.Empty<int[]> ().$Select (t => t.Select (v => v));\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in Enumerable.Empty<int[]> ()\n\t\t        select t.Select (v => v);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonRecursiveCombineQueries()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = Enumerable.Empty<int[]> ().$Select (t => (from g in t select g));\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in Enumerable.Empty<int[]> ()\n\t\t        select (from g in t\n\t\t      select g);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGroupBy()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$GroupBy (t => t, t => new int[0]);\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from t in new int[0]\n\t\t        group new int[0] by t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Test_1AlreadyUsed()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint _1;\n\t\tvar x = new int[0].$Cast<float> ();\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint _1;\n\t\tvar x = from float _2 in new int[0]\n\t\t        select _2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoubleCasts()\n\t\t{\n\t\t\tTest<LinqFluentToQueryAction>(@\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new int[0].$Cast<float> ().Cast<int> ();\n\t}\n}\", @\"\nusing System.Linq;\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = from int _1 in\n\t\t            from float _2 in new int[0]\n\t\tselect _2\n\t\t        select _1;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/LinqQueryToFluentTests.cs",
    "content": "// \n// LinqQueryToFluentTests.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class LinqQueryToFluentTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n                   select x;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().Select (x => x);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestName()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tint _;\n\t\tvar _2 = $from x in System.Enumerable.Empty<int> ()\n\t\t         let _1 = x\n\t\t         select x;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tint _;\n\t\tvar _2 = System.Enumerable.Empty<int> ().Select (x => new {\n\tx,\n\t_1 = x\n}).Select (_3 => _3.x);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrecedence()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in true ? System.Enumerable.Empty<int> () : null\n\t\t\t       select x;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = (true ? System.Enumerable.Empty<int> () : null).Select (x => x);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhereQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           where x > 1\n\t\t           select x;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().Where (x => x > 1);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOrderByQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           orderby x, x * 2 descending\n\t\t           select x;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().OrderBy (x => x).ThenByDescending (x => x * 2);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoubleFromWithSelectQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = System.Enumerable.Empty<int> ();\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           from y in newEnumerable\n\t\t           select x * y;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = System.Enumerable.Empty<int> ();\n\t\tvar data = System.Enumerable.Empty<int> ().SelectMany (x => newEnumerable, (x, y) => x * y);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoubleFromWithCastQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = System.Enumerable.Empty<int> ();\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           from float y in newEnumerable\n\t\t           select x * y;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = System.Enumerable.Empty<int> ();\n\t\tvar data = System.Enumerable.Empty<int> ().SelectMany (x => newEnumerable.Cast<float> (), (x, y) => x * y);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoubleFromWithIntermediateQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = System.Enumerable.Empty<int> ();\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           from y in newEnumerable\n\t\t           where x > y\n\t\t           select x * y;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = System.Enumerable.Empty<int> ();\n\t\tvar data = System.Enumerable.Empty<int> ().SelectMany (x => newEnumerable, (x, y) => new {\n\tx,\n\ty\n}).Where (_ => _.x > _.y).Select (_1 => _1.x * _1.y);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLetQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           let y = x * 2\n\t\t           select x * y;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().Select (x => new {\n\tx,\n\ty = x * 2\n}).Select (_ => _.x * _.y);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLongChainQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           let y = x * 2\n\t\t           let z = x * y * 2\n\t\t           select x * y * z;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().Select (x => new {\n\tx,\n\ty = x * 2\n}).Select (_ => new {\n\t_,\n\tz = _.x * _.y * 2\n}).Select (_1 => _1._.x * _1._.y * _1.z);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCastQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from float x in System.Enumerable.Empty<int> ()\n\t\t           select x;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().Cast<float> ().Select (x => x);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJoinQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 4, 5, 6 };\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           join float yy in newEnumerable on x * 2 equals yy\n\t\t           select x * yy;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 4, 5, 6 };\n\t\tvar data = System.Enumerable.Empty<int> ().Join (newEnumerable.Cast<float> (), x => x * 2, yy => yy, (x, yy) => x * yy);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJoinWithIntermediateQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 4, 5, 6 };\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           join float y in newEnumerable on x * 2 equals y\n\t\t           where x == 2\n\t\t           select x * y;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 4, 5, 6 };\n\t\tvar data = System.Enumerable.Empty<int> ().Join (newEnumerable.Cast<float> (), x => x * 2, y => y, (x, y) => new {\n\tx,\n\ty\n}).Where (_ => _.x == 2).Select (_1 => _1.x * _1.y);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJoinWithIntoSelectQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 1, 2, 3 };\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           join y in newEnumerable on x * 2 equals y\n\t\t           into g\n\t\t           select g;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 1, 2, 3 };\n\t\tvar data = System.Enumerable.Empty<int> ().GroupJoin (newEnumerable, x => x * 2, y => y, (x, g) => g);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJoinWithIntoIntermediateQuery()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 1, 2, 3 };\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           join y in newEnumerable on x * 2 equals y\n\t\t           into g\n\t\t           where true\n\t\t           select g;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar newEnumerable = new int[] { 1, 2, 3 };\n\t\tvar data = System.Enumerable.Empty<int> ().GroupJoin (newEnumerable, x => x * 2, y => y, (x, g) => new {\n\tx,\n\tg\n}).Where (_ => true).Select (_1 => _1.g);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleGroup()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           group x by x % 10;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().GroupBy (x => x % 10);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDifferentGroup()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           group x / 10 by x % 10;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().GroupBy (x => x % 10, x => x / 10);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInto()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = $from x in System.Enumerable.Empty<int> ()\n\t\t           select x * 2 into y\n\t\t           select y * 3;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar data = System.Enumerable.Empty<int> ().Select (x => x * 2).Select (y => y * 3);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoubleFromWithLet()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar src = System.Enumerable.Empty<int> ();\n\t\tvar data = $from x in src\n\t\t           from y in src\n\t\t           let k = x * y\n\t\t           select k;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar src = System.Enumerable.Empty<int> ();\n\t\tvar data = src.SelectMany (x => src, (x, y) => new {\n\tx,\n\ty\n}).Select (_ => new {\n\t_,\n\tk = _.x * _.y\n}).Select (_1 => _1.k);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoubleFromWithMidLet()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar src = System.Enumerable.Empty<int> ();\n\t\tvar data = $from x in src\n\t\t           let k = x * x\n\t\t           from y in src\n\t\t           select k * y;\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System.Linq;\npublic class TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar src = System.Enumerable.Empty<int> ();\n\t\tvar data = src.Select (x => new {\n\tx,\n\tk = x * x\n}).SelectMany (_ => src, (_1, y) => _1.k * y);\n\t}\n}\n\";\n\n\t\t\tAssert.AreEqual(output, RunContextAction(new LinqQueryToFluentAction(), input));\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/MergeNestedIfTests.cs",
    "content": "﻿// \n// MergeNestedIfTests.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class MergeNestedIfTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestOuterIf ()\n\t\t{\n\t\t\tTest<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a > 0)\n\t\t\tif (a < 5) \n\t\t\t\treturn 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a > 0 && a < 5)\n\t\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOuterIfWithBlock ()\n\t\t{\n\t\t\tTest<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a > 0) {\n\n\t\t{\n\t\t\tif (a < 5) \n\t\t\t\treturn 1;\n\t\t}\n\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a > 0 && a < 5)\n\t\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInnerIf ()\n\t\t{\n\t\t\tTest<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a > 0)\n\t\t\t$if (a < 5) \n\t\t\t\treturn 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a > 0 && a < 5)\n\t\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInnerIfWithBlock ()\n\t\t{\n\t\t\tTest<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a > 0) {\n\n\t\t{\n\t\t\t$if (a < 5) \n\t\t\t\treturn 1;\n\t\t}\n\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a > 0 && a < 5)\n\t\t\treturn 1;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOuterIfElse ()\n\t\t{\n\t\t\tTestWrongContext<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a > 0)\n\t\t\tif (a < 5) \n\t\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}\n}\");\n\t\t\tTestWrongContext<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a > 0) {\n\t\t\tif (a < 5) \n\t\t\t\treturn 1;\n\t\t} else\n\t\t\treturn 0;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInnerIfElse ()\n\t\t{\n\t\t\tTestWrongContext<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a > 0)\n\t\t\tif (a < 5) \n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn 0;\n\t}\n}\");\n\t\t\tTestWrongContext<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a > 0) {\n\t\t\tif (a < 5) \n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn 0;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMultipleTrueStatements ()\n\t\t{\n\t\t\tTestWrongContext<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a > 0) {\n\t\t\tif (a < 5) \n\t\t\t\treturn 1;\n\t\t\treturn 0;\n\t\t}\n\t}\n}\");\n\t\t\tTestWrongContext<MergeNestedIfAction> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\tif (a > 0) {\n\t\t\t$if (a < 5) \n\t\t\t\treturn 1;\n\t\t\treturn 0;\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/MetaTests.cs",
    "content": "﻿// \n// MetaTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t/// <summary>\n\t/// Tests for the test APIs.\n\t/// </summary>\n\t[TestFixture]\n\tpublic class MetaTests\n\t{\n\t\t[Test]\n\t\tpublic void TestGlobalOperation ()\n\t\t{\n\t\t\tList<string> contents = new List<string>() {\n\t\t\t\t@\"class Test1\n{\n\tpublic int $x;\n}\", @\"class Test2\n{\n\tpublic void Foo(Test1 test1)\n\t{\n\t\ttest1.x = 1;\n\t\ttest1.x = 2;\n\t}\n}\"\n\t\t\t};\n\t\t\tvar context = TestRefactoringContext.Create(contents, 0);\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar variable = context.GetNode<VariableInitializer>();\n\t\t\t\tscript.DoGlobalOperationOn(new List<IEntity>() {\n\t\t\t\t\t((MemberResolveResult) context.Resolve(variable)).Member\n\t\t\t\t}, (rCtx, rScript, nodes) => {\n\t\t\t\t\tforeach (var node in nodes) {\n\t\t\t\t\t\trScript.Replace(node, new IdentifierExpression(\"replacement\"));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"class Test1\n{\n\tpublic int replacement;\n}\", context.GetSideDocumentText(0));\n\n\t\t\tAssert.AreEqual(@\"class Test2\n{\n\tpublic void Foo(Test1 test1)\n\t{\n\t\treplacement = 1;\n\t\treplacement = 2;\n\t}\n}\", context.GetSideDocumentText(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRename ()\n\t\t{\n\t\t\tList<string> contents = new List<string>() {\n\t\t\t\t@\"class Test1\n{\n\tpublic int $x;\n}\", @\"class Test2\n{\n\tpublic void Foo(Test1 test1)\n\t{\n\t\ttest1.x = 1;\n\t\ttest1.x = 2;\n\t}\n}\"\n\t\t\t};\n\t\t\tvar context = TestRefactoringContext.Create(contents, 0);\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar variable = context.GetNode<VariableInitializer>();\n\t\t\t\tscript.Rename(((MemberResolveResult)context.Resolve(variable)).Member, \"newName\");\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"class Test1\n{\n\tpublic int newName;\n}\", context.GetSideDocumentText(0));\n\n\t\t\tAssert.AreEqual(@\"class Test2\n{\n\tpublic void Foo(Test1 test1)\n\t{\n\t\ttest1.newName = 1;\n\t\ttest1.newName = 2;\n\t}\n}\", context.GetSideDocumentText(1));\n\t\t}\n\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void TestRenameInterfaceMethod ()\n\t\t{\n\t\t\tList<string> contents = new List<string>() {\n\t\t\t\t@\"interface ITest1\n{\n\tint $method ();\n}\nclass Test2 : ITest1\n{\n\tint method ()\n\t{\n\t}\n}\", @\"class Test3 : ITest1\n{\n\tint method ()\n\t{\n\t}\n}\"\n\t\t\t};\n\t\t\tvar context = TestRefactoringContext.Create(contents, 0);\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar method = context.GetNode<MethodDeclaration>();\n\t\t\t\tscript.Rename(((MemberResolveResult)context.Resolve(method)).Member, \"newName\");\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"interface ITest1\n{\n\tint newName ();\n}\nclass Test2 : ITest1\n{\n\tint newName ()\n\t{\n\t}\n}\", context.GetSideDocumentText(0));\n\n\t\t\tAssert.AreEqual(@\"class Test3 : ITest1\n{\n\tint newName ()\n\t{\n\t}\n}\", context.GetSideDocumentText(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBaseType()\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create(@\"\npublic class $Foo : System.IDisposable\n{\n}\");\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar type = context.GetNode<TypeDeclaration>();\n\t\t\t\tscript.ChangeBaseTypes(type, Enumerable.Empty<AstType>());\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"\npublic class Foo\n{\n}\", context.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBaseTypeInNested()\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create(@\"\npublic class X\n{\n\tpublic class $Foo : System.IDisposable\n\t{\n\t}\n}\");\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar type = context.GetNode<TypeDeclaration>();\n\t\t\t\tscript.ChangeBaseTypes(type, Enumerable.Empty<AstType>());\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"\npublic class X\n{\n\tpublic class Foo\n\t{\n\t}\n}\", context.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReplaceBaseType()\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create(@\"\npublic class $Foo : System.IDisposable\n{\n}\");\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar type = context.GetNode<TypeDeclaration>();\n\t\t\t\tscript.ChangeBaseTypes(type, new AstType[] { AstType.Create(\"System.Test\") });\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"\npublic class Foo : System.Test\n{\n}\", context.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChangeBaseTypeGenerics()\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create(@\"\npublic class $Foo<T> : System.IDisposable where T : new()\n{\n}\");\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar type = context.GetNode<TypeDeclaration>();\n\t\t\t\tscript.ChangeBaseTypes(type, new AstType[] { AstType.Create(\"System.Test\") });\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"\npublic class Foo<T> : System.Test where T : new()\n{\n}\", context.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBaseType()\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create(@\"\npublic class $Foo\n{\n}\");\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar type = context.GetNode<TypeDeclaration>();\n\t\t\t\tscript.ChangeBaseTypes(type, new AstType[] { AstType.Create(\"System.Test\") });\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"\npublic class Foo : System.Test\n{\n}\", context.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddBaseTypeGenerics()\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create(@\"\npublic class $Foo<T> where T : new()\n{\n}\");\n\t\t\tusing (var script = context.StartScript()) {\n\t\t\t\tvar type = context.GetNode<TypeDeclaration>();\n\t\t\t\tscript.ChangeBaseTypes(type, new AstType[] { AstType.Create(\"System.Test\") });\n\t\t\t}\n\n\t\t\tAssert.AreEqual(@\"\npublic class Foo<T> : System.Test where T : new()\n{\n}\", context.Text);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/MoveToOuterScopeTests.cs",
    "content": "//\n// MoveToOuterScopeTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class MoveToOuterScopeTests : ContextActionTestBase\n\t{\n\t\tvoid TestStatements (string input, string output) \n\t\t{\n\t\t\tTest<MoveToOuterScopeAction>(@\"\nclass A\n{\n\tvoid F()\n\t{\"\n\t + input + \n@\"\t}\n}\", @\"\nclass A\n{\n\tvoid F()\n\t{\"\n     + output + \n@\"\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tTestStatements(@\"\n\twhile (true) {\n\t\tint $i = 2;\n\t}\n\", @\"\n\t\tint i = 2;\n\twhile (true) {\n\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresDeclarationsDirectlyInABody()\n\t\t{\n\t\t\tTestWrongContext<MoveToOuterScopeAction>(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\tint $i = 2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MovesOnlyTheCurrentVariableInitialization()\n\t\t{\n\t\t\tTestStatements(@\"\n\twhile (true) {\n\t\tint $i = 2, j = 3;\n\t}\n\", @\"\n\tint i = 2;\n\twhile (true) {\n\t\t\tint j = 3;\n\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MovesAllInitializersWhenOnType()\n\t\t{\n\t\t\tTestStatements(@\"\n\twhile (true) {\n\t\ti$nt i = 2, j = 3;\n\t}\n\", @\"\n\t\tint i = 2, j = 3;\n\twhile (true) {\n\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OnlyMovesDeclarationWhenInitializerDependsOnOtherStatements()\n\t\t{\n\t\t\tTestStatements(@\"\n\twhile (true) {\n\t\tint i = 2;\n\t\tint $j = i;\n\t}\n\", @\"\n\t\tint j;\n\twhile (true) {\n\t\tint i = 2;\n\t\tj = i;\n\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void HandlesLambdaDelegate()\n\t\t{\n\t\t\tTestStatements(@\"\n\tvar action = new Action<int>(i => {\n\t\tint $j = 2;\n\t});\n\", @\"\n\t\tint j = 2;\n\tvar action = new Action<int>(i => {\n\t});\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresDeclarationDirectlyInConstructorBody()\n\t\t{\n\t\t\tTestWrongContext<MoveToOuterScopeAction>(@\"\nclass A\n{\n\tpublic A()\n\t{\n\t\tint $i = 2;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/NegateIsExpressionActionTests.cs",
    "content": "//\n// NegateIsExpressionActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class NegateIsExpressionActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<NegateIsExpressionAction> (@\"\nclass TestClass\n{\n\tvoid Test (object x)\n\t{\n\t\tvar b = x $is TestClass;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Test (object x)\n\t{\n\t\tvar b = !(x is TestClass);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReverse ()\n\t\t{\n\t\t\tTest<NegateIsExpressionAction> (@\"\nclass TestClass\n{\n\tvoid Test (object x)\n\t{\n\t\tvar b = !(x $is TestClass);\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Test (object x)\n\t{\n\t\tvar b = x is TestClass;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/NegateRelationalExpressionTests.cs",
    "content": "﻿// \n// NegateRelationalExpressionTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class NegateRelationalExpressionTests : ContextActionTestBase\n\t{\n\t\tpublic void Test(string op, string negatedOp)\n\t\t{\n\t\t\tTest<NegateRelationalExpressionAction> (@\"\nclass TestClass\n{\n\tvoid Test ()\n\t{\n\t\tvar b = 1 $\" + op + @\" 2;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Test ()\n\t{\n\t\tvar b = 1 \" + negatedOp + @\" 2;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEquality ()\n\t\t{\n\t\t\tTest (\"==\", \"!=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInEquality ()\n\t\t{\n\t\t\tTest (\"!=\", \"==\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGreaterThan ()\n\t\t{\n\t\t\tTest (\">\", \"<=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGreaterThanOrEqual ()\n\t\t{\n\t\t\tTest (\">=\", \"<\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLessThan ()\n\t\t{\n\t\t\tTest (\"<\", \">=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLessThanOrEqual ()\n\t\t{\n\t\t\tTest (\"<=\", \">\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnaryOperator ()\n\t\t{\n\t\t\tTest<NegateRelationalExpressionAction> (\n\t\t\t\t@\"\nclass Foo \n{\n\tvoid Bar ()\n\t{\n\t\tvar cond = $!(1 < 2);\n\t}\n}\n\", @\"\nclass Foo \n{\n\tvoid Bar ()\n\t{\n\t\tvar cond = 1 < 2;\n\t}\n}\n\");\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/PutInsideUsingTests.cs",
    "content": "﻿// \n// PutInsideUsingAction.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class PutInsideUsingTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<PutInsideUsingAction> (@\"\ninterface ITest : System.IDisposable\n{\n\tvoid Test ();\n}\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tITest obj $= null;\n\t\tobj.Test ();\n\t\tint a;\n\t\tif (i > 0)\n\t\t\tobj.Test ();\n\t\ta = 0;\n\t}\n}\", @\"\ninterface ITest : System.IDisposable\n{\n\tvoid Test ();\n}\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tusing (ITest obj = null) {\n\t\t\tobj.Test ();\n\t\t\tif (i > 0)\n\t\t\t\tobj.Test ();\n\t\t}\n\t\ta = 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIDisposable ()\n\t\t{\n\t\t\tTest<PutInsideUsingAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.IDisposable obj $= null;\n\t\tobj.Method ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tusing (System.IDisposable obj = null) {\n\t\t\tobj.Method ();\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestTypeParameter ()\n\t\t{\n\n\t\t\tTest<PutInsideUsingAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod<T> ()\n\t\twhere T : System.IDisposable, new()\n\t{\n\t\tT obj $= new T ();\n\t\tobj.Method ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod<T> ()\n\t\twhere T : System.IDisposable, new()\n\t{\n\t\tusing (T obj = new T ()) {\n\t\t\tobj.Method ();\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMultipleVariablesDeclaration ()\n\t\t{\n\t\t\tTest<PutInsideUsingAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.IDisposable obj, obj2 $= null, obj3;\n\t\tobj2.Method ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.IDisposable obj, obj3;\n\t\tusing (System.IDisposable obj2 = null) {\n\t\t\tobj2.Method ();\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullInitializer ()\n\t\t{\n\t\t\tTestWrongContext<PutInsideUsingAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.IDisposable $obj;\n\t\tobj.Method ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMoveVariableDeclaration ()\n\t\t{\n\t\t\tTest<PutInsideUsingAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.IDisposable obj $= null;\n\t\tint a, b;\n\t\ta = b = 0;\n\t\tobj.Method ();\n\t\ta++;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a;\n\t\tusing (System.IDisposable obj = null) {\n\t\t\tint b;\n\t\t\ta = b = 0;\n\t\t\tobj.Method ();\n\t\t}\n\t\ta++;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveDisposeInvocation ()\n\t\t{\n\t\t\tTest<PutInsideUsingAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.IDisposable obj $= null;\n\t\tobj.Method ();\n\t\tobj.Dispose();\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tusing (System.IDisposable obj = null) {\n\t\t\tobj.Method ();\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/RemoveBackingStoreTests.cs",
    "content": "// \n// RemoveBackingStoreTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class RemoveBackingStoreTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleStore ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew RemoveBackingStoreAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int $Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget { return field; }\" + Environment.NewLine +\n\t\t\t\t\"\t\tset { field = value; }\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget;\" + Environment.NewLine +\n\t\t\t\t\"\t\tset;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3292 -Error in analysis service\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug3292 ()\n\t\t{\n\t\t\tTestWrongContext<RemoveBackingStoreAction> (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int $Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget { \" +\n\t\t\t\t\"\t\t\tConsole.WriteLine(field);\" +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t\tset { field = value; }\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestBug3292Case2 ()\n\t\t{\n\t\t\tTestWrongContext<RemoveBackingStoreAction> (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tint field;\" + Environment.NewLine +\n\t\t\t\t\"\tpublic int $Field {\" + Environment.NewLine +\n\t\t\t\t\"\t\tget { \" +\n\t\t\t\t\"\t\t\treturn field;\" +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t\tset { Console.WriteLine(field); }\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestWrongLocation()\n\t\t{\n\t\t\tTestWrongContext<RemoveBackingStoreAction> (@\"class TestClass\n{\n\tstring test;\n\tpublic $string Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\n\t\t\tTestWrongContext<RemoveBackingStoreAction> (@\"class TestClass\n{\n\tstring test;\n\tpublic string $FooBar.Test {\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\n\t\t\tTestWrongContext<RemoveBackingStoreAction> (@\"class TestClass\n{\n\tstring test;\n\tpublic string Test ${\n\t\tget {\n\t\t\treturn test;\n\t\t}\n\t\tset {\n\t\t\ttest = value;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 16108 - Convert to autoproperty issues\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16108Case1 ()\n\t\t{\n\t\t\tTestWrongContext<RemoveBackingStoreAction>(@\"\nclass MyClass\n{\n    [DebuggerHiddenAttribute]\n    int a;\n    int $A {\n        get { return a; }\n        set { a = value; }\n    }\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 16108 - Convert to autoproperty issues\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16108Case2 ()\n\t\t{\n\t\t\tTestWrongContext<RemoveBackingStoreAction>(@\"\nclass MyClass\n{\n    int a = 4;\n    int $A {\n        get { return a; }\n        set { a = value; }\n    }\n}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 16447 - Convert to Auto Property removes multiple variable if declared inline\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16447 ()\n\t\t{\n\t\t\tTest<RemoveBackingStoreAction>(@\"\npublic class Foo\n{\n\tint _bpm = 120, _index = 1, _count;\n\tint $Count {\n\t\tget { return _count; }\n\t\tset { _count = value; }\n\t}\n}\n\", @\"\npublic class Foo\n{\n\tint _bpm = 120, _index = 1;\n\tint Count {\n\t\tget;\n\t\tset;\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/RemoveBracesTests.cs",
    "content": "// \n// RemoveBracesTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class RemoveBracesTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleBraces()\n\t\t{\n\t\t\tstring result = RunContextAction(\n\t\t\t\tnew RemoveBracesAction(),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\t\"\t\tif (true) ${\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t\t;\" + Environment.NewLine +\n\t\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tif (true)\" + Environment.NewLine +\n\t\t\t\t\"\t\t\t;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTryCatch()\n\t\t{\n\t\t\tTestWrongContext<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\ttry ${ ; } catch (Exception) { ; }\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestTryCatchCatch()\n\t\t{\n\t\t\tTestWrongContext<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\ttry { ; } catch (Exception) ${ ; }\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestTryCatchFinally()\n\t\t{\n\t\t\tTestWrongContext<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\ttry { ; } catch (Exception) { ; } finally ${ ; }\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSwitchCatch()\n\t\t{\n\t\t\tTestWrongContext<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tswitch (foo\t) ${ default: break;}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclaration()\n\t\t{\n\t\t\tTestWrongContext<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t${\n\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromIf()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$if (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromElse()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t} $else {\n\t\t\tConsole.WriteLine (\"\"World\"\");\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t} else\n\t\t\tConsole.WriteLine (\"\"World\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromDoWhile()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$do {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t} while (true);\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tdo\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\twhile (true);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromForeach()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$foreach (var a in b) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tforeach (var a in b)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromFor()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$for (;;) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tfor (;;)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromLock()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$lock (this) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tlock (this)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromUsing()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$using (var a = new A ()) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tusing (var a = new A ())\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveBracesFromWhile()\n\t\t{\n\t\t\tTest<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$while (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\twhile (true)\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullNode()\n\t\t{\n\t\t\tTestWrongContext<RemoveBracesAction>(@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (true) {\n\t\t\tConsole.WriteLine (\"\"Hello\"\");\n\t\t}\n\t}\n}\n\n        $          \n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/RemoveFieldRefactoryActionTests.cs",
    "content": "//\n// RemoveFieldRefactoryActionTests.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class RemoveFieldRefactoryActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void RemoveOneField()\n\t\t{\n\t\t\tTest<RemoveFieldRefactoryAction>(\n\t\t\t\t@\"\nclass A {\n\tint $field;\n}\n\",\n\t\t\t\t@\"\nclass A {\n}\n\"\n\t\t\t\t);}\n\n        [Test]\n        public void RemoveOneFieldAndAssignmentValue()\n        {\n            Test<RemoveFieldRefactoryAction>(\n                @\"\nclass A {\n\tint $field;\n    A() {\n        field = 3;\n    }\n}\n\",\n                @\"\nclass A {\n    A() {\n    }\n}\n\"\n                );\n        }\n\n\t    [Test]\n        public void RemoveOneFieldAndAssignmentValueAndMethodCall()\n        {\n            Test<RemoveFieldRefactoryAction>(\n                @\"\nclass A {\n\tint $field;\n    A() {\n        field = 3;\nif(field!=0)\n        Method(field);\n    }\n}\n\",\n                @\"\nclass A {\n    A() {\nif(TODO!=0)\n        Method(TODO);\n    }\n}\n\"\n                );\n        }\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/RemoveRedundantCatchTypeTests.cs",
    "content": "//\n// RemoveRedundantCatchTypeTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\n\t[TestFixture]\n\tpublic class RemoveRedundantCatchTypeTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void RemovesSimpleExceptionMatch()\n\t\t{\n\t\t\tTest<RemoveRedundantCatchTypeAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch $(System.Exception) {\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t} catch {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PreservesBody()\n\t\t{\n\t\t\tTest<RemoveRedundantCatchTypeAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch $(System.Exception e) {\n\t\t\tSystem.Console.WriteLine (\"\"Hi\"\");\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t} catch {\n\t\t\tSystem.Console.WriteLine (\"\"Hi\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Needs whitespace ast nodes\")]\n\t\tpublic void PreservesWhitespaceInBody()\n\t\t{\n\t\t\tTest<RemoveRedundantCatchTypeAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch $(System.Exception e) {\n\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic void F()\n\t{\n\t\ttry {\n\t\t}\n\t\tcatch {\n\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresReferencedExceptionMatch()\n\t\t{\n\t\t\tTestWrongContext<RemoveRedundantCatchTypeAction>(@\"\nclass TestClass\n{\n\tpublic void F()\n\t{\t\n\t\ttry {\n\t\t}\n\t\tcatch $(System.Exception e) {\n\t\t\tSystem.Console.WriteLine (e);\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/RemoveRegionTests.cs",
    "content": "// \n// RemoveRegionTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class RemoveRegionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleRegion ()\n\t\t{\n\t\t\tTest<RemoveRegionAction> (@\"class TestClass{\n#region$ Foo\n\tvoid Test ()\n\t{\n\t}\n#endregion\n}\", @\"class TestClass{\n\tvoid Test ()\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNestedRegion ()\n\t\t{\n\t\t\tTest<RemoveRegionAction> (@\"class TestClass\n{\n\t#region$ Foo\n\tvoid Test ()\n\t{\n\t\t#region Nested\n\t\tFoo ();\n\t\t#endregion\n\t}\n\t#endregion\n}\", @\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t#region Nested\n\t\tFoo ();\n\t\t#endregion\n\t}\n}\");\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void TestEndRegion ()\n\t\t{\n\t\t\tTest<RemoveRegionAction> (@\"class TestClass{\n#region Foo\n\tvoid Test ()\n\t{\n\t}\n$#endregion\n}\", @\"class TestClass{\n\tvoid Test ()\n\t{\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ReplaceAssignmentWithPostfixExpressionActionTests.cs",
    "content": "//\n// ReplaceAssignmentWithPostfixExpressionActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ReplaceAssignmentWithPostfixExpressionActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAdd ()\n\t\t{\n\t\t\tTest<ReplaceAssignmentWithPostfixExpressionAction> (@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti $+= 1;\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti++;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSub ()\n\t\t{\n\t\t\tTest<ReplaceAssignmentWithPostfixExpressionAction> (@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti $-= 1;\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti--;\n\t}\n}\");\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void TestAddCase2 ()\n\t\t{\n\t\t\tTest<ReplaceAssignmentWithPostfixExpressionAction> (@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti $= i + 1;\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti++;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ReplaceEmptyStringTests.cs",
    "content": "// \n// ReplaceEmptyStringTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ReplaceEmptyStringTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleString()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew ReplaceEmptyStringAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tstring str = $\\\"\\\";\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tstring str = string.Empty;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ReplaceOperatorAssignmentWithAssignmentActionTests.cs",
    "content": "//\n// ReplaceOperatorAssignmentWithAssignmentActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ReplaceOperatorAssignmentWithAssignmentActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAdd ()\n\t\t{\n\t\t\tTest<ReplaceOperatorAssignmentWithAssignmentAction> (@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti $+= 1 + 2;\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti = i + 1 + 2;\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ReplacePostfixExpressionWithAssignmentActionTests.cs",
    "content": "//\n// ReplacePostfixExpressionWithAssignmentActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ReplacePostfixExpressionWithAssignmentActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAdd ()\n\t\t{\n\t\t\tTest<ReplacePostfixExpressionWithAssignmentAction> (@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\t$i++;\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti += 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSub ()\n\t\t{\n\t\t\tTest<ReplacePostfixExpressionWithAssignmentAction> (@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\t$i--;\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti -= 1;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ReplaceWithOperatorAssignmentActionTests.cs",
    "content": "//\n// ReplaceWithOperatorAssignmentActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOperatorAssignmentActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAdd ()\n\t\t{\n\t\t\tTest<ReplaceWithOperatorAssignmentAction> (@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti $= i + 1 + 2;\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\ti += 1 + 2;\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ReverseDirectionForForLoopTests.cs",
    "content": "//\n// ReverseDirectionForForLoopTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class ReverseDirectionForForLoopTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestPrimitveExpression()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0; i < 10; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 9; i >= 0; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrimitveExpressionCase2()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0; 10 > i; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 9; i >= 0; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrimitveExpressionReverse()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 9; i >= 0; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestLowerEqualPrimitveExpression()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0; i <= 10; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 10; i >= 0; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLowerEqualPrimitveExpressionCase2()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0; 10 >= i; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 10; i >= 0; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestArbitraryBounds()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar (int from, int to)\n\t{\n\t\t$for (int i = from; i < to; i += 1)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar (int from, int to)\n\t{\n\t\tfor (int i = to - 1; i >= from; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArbitraryBoundsCase2()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0; i < a.T; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = a.T - 1; i >= 0; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestComplex()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = Foo ().Bar + Test; i < (to - from).Length; i += a + b)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = (to - from).Length - (a + b); i >= Foo ().Bar + Test; i -= a + b)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexReverse()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = (to - from).Length - (a + b); i >= Foo ().Bar + Test; i -= a + b)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = Foo ().Bar + Test; i < (to - from).Length; i += a + b)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArbitraryBoundsReverse()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar (int from, int to)\n\t{\n\t\t$for (int i = to - 1; i >= from; --i)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar (int from, int to)\n\t{\n\t\tfor (int i = from; i < to; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrimitiveExpressionArbitrarySteps()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0; i < 100; i += 5)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 95; i >= 0; i -= 5)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrimitiveExpressionArbitraryStepsCase2()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0; i <= 100; i += 5)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 100; i >= 0; i -= 5)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrimitiveExpressionArbitraryStepsReverse()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 95; i >= 0; i -= 5)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 0; i < 100; i += 5)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArbitrarySteps()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar (int from, int to, int step)\n\t{\n\t\t$for (int i = from; i < to; i += step)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar (int from, int to, int step)\n\t{\n\t\tfor (int i = to - step; i >= from; i -= step)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArbitraryStepsReverse()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar (int from, int to, int step)\n\t{\n\t\t$for (int i = to - step; i >= from; i -= step)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar (int from, int to, int step)\n\t{\n\t\tfor (int i = from; i < to; i += step)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Ignore(\"Implement me\")]\n\t\t[Test]\n\t\tpublic void TestOptimizedFor()\n\t\t{\n\t\t\tTest<ReverseDirectionForForLoopAction>(@\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$for (int i = 0, upper = 10; i < upper; i++)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tfor (int i = 9; i >= 0; i--)\n\t\t\tSystem.Console.WriteLine (i);\n\t}\n}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SimplifyIfFlowInLoopsTests.cs",
    "content": "//\n// SimplifyIfFlowInLoopsTests.cs\n//\n// Author:\n//      Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class SimplifyIfFlowInLoopsTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test()\n\t\t{\n\t\t\tTest<SimplifyIfInLoopsFlowAction>(\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\twhile(true)\n       {\n   \t\t$if (true) {\n\t\t\t    Case1 ();\n\t\t    }\n\t    }\n\t}\n}\",\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\twhile(true) {\n\t\t\tif (false)\n\t\t\t\tcontinue;\n\t\t\tCase1 ();\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SimplifyIfFlowTests.cs",
    "content": "//\n// SimplifyIfFlowTests.cs\n//\n// Author:\n//      Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class SimplifyIfFlowTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test()\n\t\t{\n\t\t\tTest<SimplifyIfFlowAction>(\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$if (true) {\n\t\t\tCase1 ();\n\t\t}\n\t}\n}\",\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tif (false)\n\t\t\treturn;\n\t\tCase1 ();\n\t}\n}\"\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SortUsingsTests.cs",
    "content": "using NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class SortUsingsTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestActiveWhenCursorAtUsing()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"using Sys$tem.Linq;\nusing System;\", @\"using System;\nusing System.Linq;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestActiveWhenCursorBehindUsing()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"using System.Linq;$\nusing System;\", @\"using System;\nusing System.Linq;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInActiveWhenCursorOutsideUsings()\n\t\t{\n\t\t\tTestWrongContext<SortUsingsAction>(@\"using System.Linq;\nusing System;\n$\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSortsAllUsingBlocksInFile()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"using $System.Linq;\nusing System;\n\nnamespace Foo\n{\n\tusing System.IO;\n\tusing System.Collections;\n}\n\nnamespace Bar\n{\n\tusing System.IO;\n\tusing System.Runtime;\n\tusing System.Diagnostics;\n}\", @\"using System;\nusing System.Linq;\n\nnamespace Foo\n{\n\tusing System.Collections;\n\tusing System.IO;\n}\n\nnamespace Bar\n{\n\tusing System.Diagnostics;\n\tusing System.IO;\n\tusing System.Runtime;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAliasesGoesToTheEnd()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"$using Sys = System;\nusing System;\", @\"using System;\nusing Sys = System;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnknownNamespacesGoesAfterKnownOnes()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"$using Foo;\nusing System;\", @\"using System;\nusing Foo;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMixedStuff()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"$using Foo;\nusing System.Linq;\nusing Sys = System;\nusing System;\nusing FooAlias = Foo;\nusing Linq = System.Linq;\", @\"using System;\nusing System.Linq;\nusing Foo;\nusing Linq = System.Linq;\nusing Sys = System;\nusing FooAlias = Foo;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreservesEmptyLinesWhichIsInFactABug()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"$using System.Linq;\n\nusing System;\", @\"using System;\n\nusing System.Linq;\");\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestPreservesPreprocessorDirectives()\n\t\t{\n\t\t\tTest<SortUsingsAction>(@\"$using D;\nusing A;\n#if true\nusing C;\nusing B;\n#endif\", @\"using A;\nusing D;\n#if true\nusing B;\nusing C;\n#endif\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SplitDeclarationAndAssignmentTests.cs",
    "content": "// \n// SplitDeclarationAndAssignmentTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012-2013 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class SplitDeclarationAndAssignmentTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleExpression ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew SplitDeclarationAndAssignmentAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint $myInt = 5 + 3 * (2 - 10);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint myInt;\" + Environment.NewLine +\n\t\t\t\t\"\t\tmyInt = 5 + 3 * (2 - 10);\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestVarType ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew SplitDeclarationAndAssignmentAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tvar $aVar = this;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tTestClass aVar;\" + Environment.NewLine +\n\t\t\t\t\"\t\taVar = this;\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestForStatement ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew SplitDeclarationAndAssignmentAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tfor (int $i = 1; i < 10; i++) {}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tint i;\" + Environment.NewLine +\n\t\t\t\t\"\t\tfor (i = 1; i < 10; i++) {\" + Environment.NewLine +\n\t\t\t\t\"\t\t}\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\n\t\n\t\t[Test]\n\t\tpublic void TestPopupAtAssign ()\n\t\t{\n\t\t\tTest<SplitDeclarationAndAssignmentAction>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar foo $= 5;\n\t}\n}\", @\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint foo;\n\t\tfoo = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPopupAtBeginningOfExpression ()\n\t\t{\n\t\t\tTest<SplitDeclarationAndAssignmentAction>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar foo = $5;\n\t}\n}\", @\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint foo;\n\t\tfoo = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleInitializers ()\n\t\t{\n\t\t\tTest<SplitDeclarationAndAssignmentAction>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint a, b, $foo = 5 + 12, c;\n\t\tConsole.WriteLine(foo);\n\t}\n}\", @\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint a, b, foo, c;\n\t\tfoo = 5 + 12;\n\t\tConsole.WriteLine(foo);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestHideInExpression ()\n\t\t{\n\t\t\tTestWrongContext<SplitDeclarationAndAssignmentAction>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar foo = 5 $+ 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalConstants ()\n\t\t{\n\t\t\tTestWrongContext<SplitDeclarationAndAssignmentAction>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tconst int foo $= 5;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SplitDeclarationListTests.cs",
    "content": "﻿// \n// SplitDeclarationListTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class SplitDeclarationListTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestLocalVariable ()\n\t\t{\n\t\t\tTest<SplitDeclarationListAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint $a, b, c;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tint a;\n\t\tint b;\n\t\tint c;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tTest<SplitDeclarationListAction> (@\"\nclass TestClass\n{\n\tpublic int $a, b, c;\n}\", @\"\nclass TestClass\n{\n\tpublic int a;\n\tpublic int b;\n\tpublic int c;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEvent ()\n\t\t{\n\t\t\tTest<SplitDeclarationListAction> (@\"\nclass TestClass\n{\n\tevent System.EventHandler $a, b, c;\n}\", @\"\nclass TestClass\n{\n\tevent System.EventHandler a;\n\tevent System.EventHandler b;\n\tevent System.EventHandler c;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixedField ()\n\t\t{\n\t\t\tTest<SplitDeclarationListAction> (@\"\nstruct TestStruct\n{\n\tunsafe fixed int $a[10], b[10], c[10];\n}\", @\"\nstruct TestStruct\n{\n\tunsafe fixed int a[10];\n\tunsafe fixed int b[10];\n\tunsafe fixed int c[10];\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVariableInFor ()\n\t\t{\n\t\t\tTestWrongContext<SplitDeclarationListAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int a = 0, b = 0, $c = 0; a < 10; a++) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSingleVariable ()\n\t\t{\n\t\t\tTestWrongContext<SplitDeclarationListAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint $a;\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SplitIfActionTests.cs",
    "content": "//\n// SplitIfActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class SplitIfActionTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAndSimple()\n\t\t{\n\t\t\tTest <SplitIfAction> (@\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a $&& b) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a) {\n\t\t\tif (b) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAndIfElse()\n\t\t{\n\t\t\tTest <SplitIfAction> (@\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a $&& b) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tSomething ();\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a) {\n\t\t\tif (b) {\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tSomething ();\n\t\t\t}\n\t\t} else {\n\t\t\tSomething ();\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestOrSimple()\n\t\t{\n\t\t\tTest <SplitIfAction> (@\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a $|| b) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a) {\n\t\t\treturn;\n\t\t} else if (b) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOrIfElse()\n\t\t{\n\t\t\tTest <SplitIfAction> (@\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a $|| b) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tSomething ();\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a) {\n\t\t\treturn;\n\t\t} else if (b) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tSomething ();\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexAnd()\n\t\t{\n\t\t\tTest <SplitIfAction> (@\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a && b $&& !a && !b) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (a && b) {\n\t\t\tif (!a && !b) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAndOr()\n\t\t{\n\t\t\tTest <SplitIfAction> (@\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (!b $|| a && b) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (!b) {\n\t\t\treturn;\n\t\t} else if (a && b) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<SplitIfAction> (@\"\nclass Test\n{\n\tvoid Foo (bool a, bool b)\n\t{\n\t\tif (!b || a $&& b) {\n\t\t\treturn;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t}\n\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/SplitStringTests.cs",
    "content": "// \n// SplitStringTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class SplitStringTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestSimpleString ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew SplitStringAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tSystem.Console.WriteLine (\\\"Hello$World\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tSystem.Console.WriteLine (\\\"Hello\\\" + \\\"World\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestVerbatimString ()\n\t\t{\n\t\t\tstring result = RunContextAction (\n\t\t\t\tnew SplitStringAction (),\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tSystem.Console.WriteLine (@\\\"Hello$World\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\"\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual (\n\t\t\t\t\"class TestClass\" + Environment.NewLine +\n\t\t\t\t\"{\" + Environment.NewLine +\n\t\t\t\t\"\tvoid Test ()\" + Environment.NewLine +\n\t\t\t\t\"\t{\" + Environment.NewLine +\n\t\t\t\t\"\t\tSystem.Console.WriteLine (@\\\"Hello\\\" + @\\\"World\\\");\" + Environment.NewLine +\n\t\t\t\t\"\t}\" + Environment.NewLine +\n\t\t\t\t\"}\", result);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/TestRefactoringContext.cs",
    "content": "﻿// \n// TestRefactoringContext.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\tpublic class TestRefactoringContext : RefactoringContext\n\t{\n\t\tpublic static bool UseExplict {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tinternal string defaultNamespace;\n\t\tpublic override string DefaultNamespace {\n\t\t\tget {\n\t\t\t\treturn defaultNamespace;\n\t\t\t}\n\t\t}\n\n\t\tinternal readonly IDocument doc;\n\t\treadonly TextLocation location;\n\t\tList<TestRefactoringContext> projectContexts;\n\t\t\n\t\tpublic TestRefactoringContext (IDocument document, TextLocation location, CSharpAstResolver resolver) : base(resolver, CancellationToken.None)\n\t\t{\n\t\t\tthis.doc = document;\n\t\t\tthis.location = location;\n\t\t\tthis.UseExplicitTypes = UseExplict;\n\t\t\tthis.FormattingOptions = FormattingOptionsFactory.CreateMono ();\n\t\t\tUseExplict = false;\n\t\t\tServices.AddService (typeof(NamingConventionService), new TestNameService ());\n\t\t\tServices.AddService (typeof(CodeGenerationService), new DefaultCodeGenerationService ());\n\t\t}\n\t\t\n\t\tclass TestNameService : NamingConventionService\n\t\t{\n\t\t\tpublic override IEnumerable<NamingRule> Rules {\n\t\t\t\tget {\n\t\t\t\t\treturn DefaultRules.GetFdgRules ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Supports(Version version)\n\t\t{\n\t\t\treturn this.version == null || this.version.CompareTo(version) >= 0;\n\t\t}\n\t\t\n\t\tpublic override TextLocation Location {\n\t\t\tget { return location; }\n\t\t}\n\n\t\tpublic Version version;\n\t\t\n\t\tpublic CSharpFormattingOptions FormattingOptions { get; set; }\n\n\t\tpublic Script StartScript ()\n\t\t{\n\t\t\treturn new TestScript (this);\n\t\t}\n\t\t\n\t\tsealed class TestScript : DocumentScript\n\t\t{\n\t\t\treadonly TestRefactoringContext context;\n\t\t\tpublic TestScript(TestRefactoringContext context) : base(context.doc, context.FormattingOptions, new TextEditorOptions ())\n\t\t\t{\n\t\t\t\tthis.context = context;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Task Link (params AstNode[] nodes)\n\t\t\t{\n\t\t\t\t// check that all links are valid.\n\t\t\t\tforeach (var node in nodes) {\n\t\t\t\t\tAssert.IsNotNull (GetSegment (node));\n\t\t\t\t}\n\t\t\t\treturn new Task (() => {});\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Task<Script> InsertWithCursor(string operation, InsertPosition defaultPosition, IList<AstNode> nodes)\n\t\t\t{\n\t\t\t\tEntityDeclaration entity = context.GetNode<EntityDeclaration>();\n\t\t\t\tif (entity is Accessor) {\n\t\t\t\t\tentity = (EntityDeclaration) entity.Parent;\n\t\t\t\t}\n\n\t\t\t\tforeach (var node in nodes) {\n\t\t\t\t\tInsertBefore(entity, node);\n\t\t\t\t}\n\t\t\t\tvar tcs = new TaskCompletionSource<Script> ();\n\t\t\t\ttcs.SetResult (this);\n\t\t\t\treturn tcs.Task;\n\t\t\t}\n\n\t\t\tpublic override Task<Script> InsertWithCursor(string operation, ITypeDefinition parentType, Func<Script, RefactoringContext, IList<AstNode>> nodeCallback)\n\t\t\t{\n\t\t\t\tvar unit = context.RootNode;\n\t\t\t\tvar insertType = unit.GetNodeAt<TypeDeclaration> (parentType.Region.Begin);\n\n\t\t\t\tvar startOffset = GetCurrentOffset (insertType.LBraceToken.EndLocation);\n\t\t\t\tvar nodes = nodeCallback(this, context);\n\t\t\t\tforeach (var node in nodes.Reverse ()) {\n\t\t\t\t\tvar output = OutputNode (1, node, true);\n\t\t\t\t\tif (parentType.Kind == TypeKind.Enum) {\n\t\t\t\t\t\tInsertText (startOffset, output.Text + (!parentType.Fields.Any() ? \"\" : \",\"));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tInsertText (startOffset, output.Text);\n\t\t\t\t\t}\n\t\t\t\t\toutput.RegisterTrackedSegments (this, startOffset);\n\t\t\t\t}\n\t\t\t\tvar tcs = new TaskCompletionSource<Script> ();\n\t\t\t\ttcs.SetResult (this);\n\t\t\t\treturn tcs.Task;\n\t\t\t}\n\n\t\t\tvoid Rename (AstNode node, string newName)\n\t\t\t{\n\t\t\t\tif (node is ObjectCreateExpression)\n\t\t\t\t\tnode = ((ObjectCreateExpression)node).Type;\n\n\t\t\t\tif (node is InvocationExpression)\n\t\t\t\t\tnode = ((InvocationExpression)node).Target;\n\t\t\t\n\t\t\t\tif (node is MemberReferenceExpression)\n\t\t\t\t\tnode = ((MemberReferenceExpression)node).MemberNameToken;\n\t\t\t\n\t\t\t\tif (node is MemberType)\n\t\t\t\t\tnode = ((MemberType)node).MemberNameToken;\n\t\t\t\n\t\t\t\tif (node is EntityDeclaration) \n\t\t\t\t\tnode = ((EntityDeclaration)node).NameToken;\n\t\t\t\n\t\t\t\tif (node is ParameterDeclaration) \n\t\t\t\t\tnode = ((ParameterDeclaration)node).NameToken;\n\t\t\t\tif (node is ConstructorDeclaration)\n\t\t\t\t\tnode = ((ConstructorDeclaration)node).NameToken;\n\t\t\t\tif (node is DestructorDeclaration)\n\t\t\t\t\tnode = ((DestructorDeclaration)node).NameToken;\n\t\t\t\tif (node is VariableInitializer)\n\t\t\t\t\tnode = ((VariableInitializer)node).NameToken;\n\t\t\t\tReplace (node, new IdentifierExpression (newName));\n\t\t\t}\n\n\t\t\tpublic override void Rename (ISymbol symbol, string name)\n\t\t\t{\n\t\t\t\tif (symbol.SymbolKind == SymbolKind.Variable || symbol.SymbolKind == SymbolKind.Parameter) {\n\t\t\t\t\tRename(symbol as IVariable, name);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tFindReferences refFinder = new FindReferences ();\n\n\t\t\t\tforeach (var fileContext in context.projectContexts)\n\t\t\t\t{\n\t\t\t\t\tusing (var newScript = (TestScript) fileContext.StartScript()) {\n\t\t\t\t\t\trefFinder.FindReferencesInFile(refFinder.GetSearchScopes(symbol), \n\t\t\t\t\t\t                               fileContext.UnresolvedFile, \n\t\t\t\t\t\t                               fileContext.RootNode as SyntaxTree, \n\t\t\t\t\t\t                               fileContext.Compilation,\n\t\t\t\t\t\t                               (n, r) => newScript.Rename(n, name), \n\t\t\t\t\t\t                               context.CancellationToken);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid Rename (IVariable variable, string name)\n\t\t\t{\n\t\t\t\tFindReferences refFinder = new FindReferences ();\n\n\t\t\t\trefFinder.FindLocalReferences(variable, \n\t\t\t\t                              context.UnresolvedFile, \n\t\t\t\t                              context.RootNode as SyntaxTree, \n\t\t\t\t                              context.Compilation, (n, r) => Rename(n, name), \n\t\t\t\t                              context.CancellationToken);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void CreateNewType (AstNode newType, NewTypeContext context)\n\t\t\t{\n\t\t\t\tvar output = OutputNode (0, newType, true);\n\t\t\t\tInsertText (0, output.Text);\n\t\t\t}\n\n\t\t\tpublic override void DoGlobalOperationOn(IEnumerable<IEntity> entities, Action<RefactoringContext, Script, IEnumerable<AstNode>> callback, string operationDescripton)\n\t\t\t{\n\t\t\t\tforeach (var projectContext in context.projectContexts) {\n\t\t\t\t\tDoLocalOperationOn(projectContext, entities, callback);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid DoLocalOperationOn(TestRefactoringContext localContext, IEnumerable<IEntity> entities, Action<RefactoringContext, Script, IEnumerable<AstNode>> callback)\n\t\t\t{\n\t\t\t\tList<AstNode> nodes = new List<AstNode>();\n\t\t\t\tFindReferences refFinder = new FindReferences();\n\t\t\t\trefFinder.FindCallsThroughInterface = true;\n\t\t\t\trefFinder.FindReferencesInFile(refFinder.GetSearchScopes(entities),\n\t\t\t\t                               localContext.UnresolvedFile,\n\t\t\t\t                               localContext.RootNode as SyntaxTree,\n\t\t\t\t                               localContext.Compilation,\n\t\t\t\t                               (node, result) => {\n\t\t\t\t\t                               nodes.Add(node);\n\t\t\t\t                               },\n\t\t\t\t                               CancellationToken.None);\n\n\t\t\t\tusing (var script = localContext.StartScript()) {\n\t\t\t\t\tcallback(localContext, script, nodes);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#region Text stuff\n\n\t\tpublic override bool IsSomethingSelected { get { return selectionStart > 0; }  }\n\n\t\tpublic override string SelectedText { get { return IsSomethingSelected ? doc.GetText (selectionStart, selectionEnd - selectionStart) : \"\"; } }\n\t\t\n\t\tint selectionStart;\n\t\tpublic override TextLocation SelectionStart { get { return doc.GetLocation (selectionStart); } }\n\t\t\n\t\tint selectionEnd;\n\t\tpublic override TextLocation SelectionEnd { get { return doc.GetLocation (selectionEnd); } }\n\n\t\tpublic override int GetOffset (TextLocation location)\n\t\t{\n\t\t\treturn doc.GetOffset (location);\n\t\t}\n\t\t\n\t\tpublic override TextLocation GetLocation (int offset)\n\t\t{\n\t\t\treturn doc.GetLocation (offset);\n\t\t}\n\n\t\tpublic override string GetText (int offset, int length)\n\t\t{\n\t\t\treturn doc.GetText (offset, length);\n\t\t}\n\t\t\n\t\tpublic override string GetText (ISegment segment)\n\t\t{\n\t\t\treturn doc.GetText (segment);\n\t\t}\n\t\t\n\t\tpublic override IDocumentLine GetLineByOffset (int offset)\n\t\t{\n\t\t\treturn doc.GetLineByOffset (offset);\n\t\t}\n\t\t#endregion\n\t\tpublic string Text {\n\t\t\tget {\n\t\t\t\treturn doc.Text;\n\t\t\t}\n\t\t}\n\n\t\tpublic static TestRefactoringContext Create (string content, bool expectErrors = false, CSharpParser parser = null)\n\t\t{\n\t\t\treturn Create(new List<string>() { content }, 0, expectErrors, parser);\n\t\t}\n\n\t\tpublic static TestRefactoringContext Create (List<string> contents, int mainIndex, bool expectErrors = false, CSharpParser parser = null)\n\t\t{\n\t\t\tList<int> indexes = new List<int>();\n\t\t\tList<int> selectionStarts = new List<int>();\n\t\t\tList<int> selectionEnds = new List<int>();\n\t\t\tList<IDocument> documents = new List<IDocument>();\n\t\t\tList<CSharpUnresolvedFile> unresolvedFiles = new List<CSharpUnresolvedFile>();\n\t\t\tList<SyntaxTree> units = new List<SyntaxTree>();\n\n\t\t\tfor (int i = 0; i < contents.Count; i++) {\n\t\t\t\tstring content = contents[i];\n\t\t\t\tint idx = content.IndexOf(\"$\");\n\t\t\t\tif (idx >= 0)\n\t\t\t\t\tcontent = content.Substring(0, idx) + content.Substring(idx + 1);\n\t\t\t\tint idx1 = content.IndexOf(\"<-\");\n\t\t\t\tint idx2 = content.IndexOf(\"->\");\n\t\t\t\tint selectionStart = 0;\n\t\t\t\tint selectionEnd = 0;\n\t\t\t\tif (0 <= idx1 && idx1 < idx2) {\n\t\t\t\t\tcontent = content.Substring(0, idx2) + content.Substring(idx2 + 2);\n\t\t\t\t\tcontent = content.Substring(0, idx1) + content.Substring(idx1 + 2);\n\t\t\t\t\tselectionStart = idx1;\n\t\t\t\t\tselectionEnd = idx2 - 2;\n\t\t\t\t\tidx = selectionEnd;\n\t\t\t\t}\n\t\t\t\tindexes.Add(idx);\n\t\t\t\tselectionStarts.Add(selectionStart);\n\t\t\t\tselectionEnds.Add(selectionEnd);\n\t\t\t\tvar doc = new StringBuilderDocument(content);\n\t\t\t\tif (parser == null)\n\t\t\t\t\tparser = new CSharpParser();\n\t\t\t\tvar unit = parser.Parse(content, \"program_\" + i + \".cs\");\n\t\t\t\tif (!expectErrors) {\n\t\t\t\t\tif (parser.HasErrors) {\n\t\t\t\t\t\tConsole.WriteLine(content);\n\t\t\t\t\t\tConsole.WriteLine(\"----\");\n\t\t\t\t\t}\n\t\t\t\t\tforeach (var error in parser.ErrorsAndWarnings) {\n\t\t\t\t\t\tConsole.WriteLine(error.Message);\n\t\t\t\t\t}\n\t\t\t\t\tAssert.IsFalse(parser.HasErrors, \"The file \" + i + \" contains unexpected parsing errors.\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tAssert.IsTrue(parser.HasErrors, \"Expected parsing errors, but the file \" + i + \"doesn't contain any.\");\n\t\t\t\t}\n\t\t\t\tunit.Freeze();\n\t\t\t\tCSharpUnresolvedFile unresolvedFile = unit.ToTypeSystem();\n\t\t\t\tunits.Add(unit);\n\t\t\t\tdocuments.Add(doc);\n\t\t\t\tunresolvedFiles.Add(unresolvedFile);\n\t\t\t}\n\n\t\t\tIProjectContent pc = new CSharpProjectContent ();\n\t\t\tpc = pc.AddOrUpdateFiles (unresolvedFiles);\n\t\t\tpc = pc.AddAssemblyReferences (new[] { CecilLoaderTests.Mscorlib, CecilLoaderTests.SystemCore });\n\n\t\t\tvar compilation = pc.CreateCompilation ();\n\t\t\tList<TestRefactoringContext> contexts = new List<TestRefactoringContext>();\n\n\t\t\tfor (int documentIndex = 0; documentIndex < documents.Count; ++documentIndex)\n\t\t\t{\n\t\t\t\tvar doc = documents [documentIndex];\n\t\t\t\tvar resolver = new CSharpAstResolver (compilation, units[documentIndex], unresolvedFiles[documentIndex]);\n\t\t\t\tTextLocation location = TextLocation.Empty;\n\t\t\t\tif (indexes[documentIndex] >= 0)\n\t\t\t\t\tlocation = doc.GetLocation (indexes[documentIndex]);\n\t\t\t\tvar context = new TestRefactoringContext(doc, location, resolver) {\n\t\t\t\t\tselectionStart = selectionStarts[documentIndex],\n\t\t\t\t\tselectionEnd = selectionEnds[documentIndex],\n\t\t\t\t\tprojectContexts = contexts,\n\t\t\t\t\tversion = parser.CompilerSettings.LanguageVersion,\n\t\t\t\t\tdefaultNamespace = \"Test\"\n\t\t\t\t};\n\n\t\t\t\tcontexts.Add(context);\n\t\t\t}\n\n\t\t\treturn contexts [mainIndex];\n\t\t}\n\n\t\tpublic string GetSideDocumentText(int index)\n\t\t{\n\t\t\treturn projectContexts [index].Text;\n\t\t}\n\t\t\n\t\tinternal static void Print (AstNode node)\n\t\t{\n\t\t\tvar v = new CSharpOutputVisitor (Console.Out, FormattingOptionsFactory.CreateMono ());\n\t\t\tnode.AcceptVisitor (v);\n\t\t}\n\t}\n\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/UseAsAndNullCheckActionTests.cs",
    "content": "//\n// UseAsAndNullCheckActionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class UseAsAndNullCheckActionTests : ContextActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void EmptyCase()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo $is Bar) {\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tvar bar = foo as Bar;\n\t\tif (bar != null) {\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo $is Bar) {\n\t\t\tBaz ((Bar)foo);\n\t\t\treturn (Bar)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tvar bar = foo as Bar;\n\t\tif (bar != null) {\n\t\t\tBaz (bar);\n\t\t\treturn bar;\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void NegatedCase()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (!(foo $is Bar)) {\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tvar bar = foo as Bar;\n\t\tif (bar == null) {\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void NegatedEmbeddedCase()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (true) {\n\t\t} else if (!(foo $is Bar)) {\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (true) {\n\t\t} else {\n\t\t\tvar bar = foo as Bar;\n\t\t\tif (bar == null) {\n\t\t\t\tBaz ((Bar)foo);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ComplexCase()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic IDisposable Baz (object foo)\n\t{\n\t\tif (((foo) $is Bar)) {\n\t\t\tBaz ((Bar)foo);\n\t\t\tBaz (foo as Bar);\n\t\t\tBaz (((foo) as Bar));\n\t\t\tBaz ((Bar)(foo));\n\t\t\treturn (IDisposable)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic IDisposable Baz (object foo)\n\t{\n\t\tvar bar = foo as Bar;\n\t\tif (bar != null) {\n\t\t\tBaz (bar);\n\t\t\tBaz (bar);\n\t\t\tBaz (bar);\n\t\t\tBaz (bar);\n\t\t\treturn (IDisposable)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IfElseCase()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo $is Bar) {\n\t\t\tBaz ((Bar)foo);\n\t\t\treturn (Bar)foo;\n\t\t} else {\n\t\t\tConsole.WriteLine (\"\"Hello World \"\");\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tvar bar = foo as Bar;\n\t\tif (bar != null) {\n\t\t\tBaz (bar);\n\t\t\treturn bar;\n\t\t} else {\n\t\t\tConsole.WriteLine (\"\"Hello World \"\");\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedIf()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo is string) {\n\t\t} else if (foo $is Bar) {\n\t\t\tBaz ((Bar)foo);\n\t\t\treturn (Bar)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo is string) {\n\t\t} else {\n\t\t\tvar bar = foo as Bar;\n\t\t\tif (bar != null) {\n\t\t\t\tBaz (bar);\n\t\t\t\treturn bar;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegatedCaseWithReturn()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (!(foo $is Bar))\n\t\t\treturn null;\n\t\tBaz ((Bar)foo);\n\t\treturn (Bar)foo;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tvar bar = foo as Bar;\n\t\tif (bar == null)\n\t\t\treturn null;\n\t\tBaz (bar);\n\t\treturn bar;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegatedCaseWithBreak()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (!(foo $is Bar))\n\t\t\t\tbreak;\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn (Bar)foo;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tvar bar = foo as Bar;\n\t\t\tif (bar == null)\n\t\t\t\tbreak;\n\t\t\tBaz (bar);\n\t\t}\n\t\treturn (Bar)foo;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseWithContinue()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (!(foo $is Bar)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tfoo = new Bar ();\n\t\t\t}\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn (Bar)foo;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tvar bar = foo as Bar;\n\t\t\tif (bar == null) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tfoo = new Bar ();\n\t\t\t}\n\t\t\tBaz (bar);\n\t\t}\n\t\treturn (Bar)foo;\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void ConditionalCase()\n\t\t{\n\t\t\tTest<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (((Bar)foo).y && foo $is Bar && ((Bar)foo).x) {\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn null;\n\t}\n}\n\", @\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tvar bar = foo as Bar;\n\t\tif (((Bar)foo).y && bar != null && bar.x) {\n\t\t\tBaz (bar);\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvalidCase()\n\t\t{\n\t\t\tTestWrongContext<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic int Baz (object foo)\n\t{\n\t\tif (foo $is int) {\n\t\t\tBaz ((int)foo);\n\t\t\treturn (int)foo;\n\t\t}\n\t\treturn 0;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvalidCase2()\n\t\t{\n\t\t\tTestWrongContext<UseAsAndNullCheckAction>(@\"\nclass Bar\n{\n\tpublic int Baz (object foo)\n\t{\n\t\tif (!(foo $is int)) {\n\t\t}\n\t\treturn 0;\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/UseExplicitTypeTests.cs",
    "content": "// \n// UseVarKeywordTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class UseExplicitTypeTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void SimpleVarDeclaration ()\n\t\t{\n\t\t\tstring result = RunContextAction (new UseExplicitTypeAction (),\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$var aVar = this;\n\t}\n}\");\n\t\t\tAssert.AreEqual (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tTestClass aVar = this;\n\t}\n}\", result);\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void ForeachDeclaration ()\n\t\t{\n\t\t\tstring result = RunContextAction (new UseExplicitTypeAction (),\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tforeach ($var aVar in new TestClass[] { }) {\n\t\t}\n\t}\n}\");\n\t\t\tAssert.AreEqual (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tforeach (TestClass aVar in new TestClass[] { }) {\n\t\t}\n\t}\n}\", result);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void SimpleAnonymousTypeDeclaration ()\n\t\t{\n\t\t\tTestWrongContext<UseExplicitTypeAction>(@\"class TestClass\n{\n\tvoid Test()\n\t{\n\t\t$var aVar = new { A = 1 };\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void ForeachAnonymousTypeDeclaration ()\n\t\t{\n\t\t\tTestWrongContext<UseExplicitTypeAction>(@\"class TestClass\n{\n\tvoid Test()\n\t{\n\t\tvar value = new { A = 1 };\n\t\tforeach ($var k in new [] { value }) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAnonymousArrayType ()\n\t\t{\n\t\t\tTestWrongContext<UseExplicitTypeAction>(@\"class TestClass\n{\n\tvoid Test()\n\t{\n\t\tvar value = new [] { new { A = 1 } };\n\t\tforeach ($var k in new [] { value }) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAnonymousGenericType ()\n\t\t{\n\t\t\tTestWrongContext<UseExplicitTypeAction>(@\"class TestClass\n{\n\tT MakeList<T> (T value) { return new List<T> () { value }; }\n\n\tvoid Test()\n\t{\n\t\tvar value = new { A = 1 };\n\t\tvar list = MakeList (value);\n\t\tforeach ($var k in list) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/UseStringFormatTests.cs",
    "content": "﻿// \n// UseStringFormatTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class UseStringFormatTests : ContextActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tTest<UseStringFormatAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring str = 1 + $2 + \"\"test\"\" + 1 + \"\"test\"\" + 1.1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring str = string.Format (\"\"{0}test{1}test{2}\"\", 1 + 2, 1, 1.1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim ()\n\t\t{\n\t\t\tTest<UseStringFormatAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring str = $@\"\"\ntest \"\" + 1;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring str = string.Format (@\"\"\ntest {0}\"\", 1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRepeatedObject ()\n\t\t{\n\t\t\tTest<UseStringFormatAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tstring str = $\"\"test\"\" + i + \"\"test\"\" + i;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tstring str = string.Format (\"\"test{0}test{0}\"\", i);\n\t}\n}\");\n\t\t}\n\n        [Test]\n        public void TestFormatString ()\n        {\n            Test<UseStringFormatAction>(@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 42;\n\t\tstring res = $\"\"A test number: \"\" + i.ToString(\"\"N2\"\");\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 42;\n\t\tstring res = string.Format (\"\"A test number: {0:N2}\"\", i);\n\t}\n}\");\n        }\n\n        [Test]\n        public void TestFormatBracesRegular()\n        {\n            Test<UseStringFormatAction>(@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 42;\n\t\tstring res = $\"\"A test number: {\"\" + i + \"\"}\"\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 42;\n\t\tstring res = string.Format (\"\"A test number: {{{0}}}\"\", i);\n\t}\n}\");\n        }\n\n        /*\n        [Test]\n        public void TestFormatBracesWithFormat()\n        {\n            Test<UseStringFormatAction>(@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 42;\n\t\tstring res = $\"\"A test number: {\"\" + i.ToString(\"\"N2\"\") + \"\"}\"\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 42;\n\t\tstring res = string.Format (\"\"A test number: {0}{1:N2}{2}\"\", '{', i, '}');\n\t}\n}\");\n        }\n         */\n\n        [Test]\n        public void TestUnnecessaryStringFormat()\n        {\n            Test<UseStringFormatAction>(@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring res = $\"\"String 1\"\" + \"\"String 2\"\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring res = \"\"String 1String 2\"\";\n\t}\n}\");\n        }\n\n        [Test]\n        public void TestUnnecessaryToString()\n        {\n            Test<UseStringFormatAction>(@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n        int i = 42;\n\t\tstring res = $\"\"String 1\"\" + i.ToString();\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n        int i = 42;\n\t\tstring res = string.Format (\"\"String 1{0}\"\", i);\n\t}\n}\");\n        }\n\t\t\n\t\t[Test]\n\t\tpublic void EscapeBraces ()\n\t\t{\n\t\t\tTest<UseStringFormatAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tstring str = $\"\"{\"\" + i + \"\"}\"\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tstring str = string.Format (\"\"{{{0}}}\"\", i);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QuotesMixedVerbatim ()\n\t\t{\n\t\t\tTest<UseStringFormatAction> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tstring str = $\"\"\\\"\"\"\" + i + @\"\"\"\"\"\"\"\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tstring str = string.Format (@\"\"\"\"\"\"{0}\"\"\"\"\"\", i);\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/UseVarKeywordTests.cs",
    "content": "// \n// UseVarKeywordTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeActions\n{\n\t[TestFixture]\n\tpublic class UseVarKeywordTests : ContextActionTestBase\n\t{\n\t\t[Test()]\n\t\tpublic void SimpleVarDeclaration ()\n\t\t{\n\t\t\tstring result = RunContextAction (new UseVarKeywordAction (),\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$TestClass aVar = this;\n\t}\n}\");\n\t\t\tAssert.AreEqual (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tvar aVar = this;\n\t}\n}\", result);\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void ForeachDeclaration ()\n\t\t{\n\t\t\tstring result = RunContextAction (new UseVarKeywordAction (),\n@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tforeach ($TestClass aVar in this) {\n\t\t}\n\t}\n}\");\n\t\t\tAssert.AreEqual (@\"class TestClass\n{\n\tvoid Test ()\n\t{\n\t\tforeach (var aVar in this) {\n\t\t}\n\t}\n}\", result);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/BrowsableAttributeTests.cs",
    "content": "//\n// BrowsableAttributeTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class BrowsableAttributeTests : TestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestEditorBrowsableAttributeClasses ()\n\t\t{\n\t\t\tint cp;\n\t\t\tvar engine1 = CodeCompletionBugTests.CreateEngine (\n\t\t\t\t@\"\nusing System;\nusing System.ComponentModel;\n\n[EditorBrowsable(EditorBrowsableState.Always)]\npublic class BrowsableTest {}\n\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic class NotBrowsableTest {}\n\", out cp);\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"class Test\n{\n\tvoid Test ()\n\t{\n\t\t$B$\n\t}\n}\", false, engine1.ctx.CurrentAssembly.UnresolvedAssembly);\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BrowsableTest\"), \"'BrowsableTest' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"NotBrowsableTest\"), \"'NotBrowsableTest' found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestEditorBrowsableAttributeClassesSameAssembly ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"\nusing System;\nusing System.ComponentModel;\n\n[EditorBrowsable(EditorBrowsableState.Always)]\npublic class BrowsableTest {}\n\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic class NotBrowsableTest {}\n\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\t$B$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BrowsableTest\"), \"'BrowsableTest' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"NotBrowsableTest\"), \"'NotBrowsableTest' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestEditorBrowsableAttributeMembers ()\n\t\t{\n\t\t\tint cp;\n\t\t\tvar engine1 = CodeCompletionBugTests.CreateEngine (\n\t\t\t\t@\"\nusing System;\nusing System.ComponentModel;\npublic class FooBar\n{\n\t[EditorBrowsable(EditorBrowsableState.Always)]\n\tpublic int BrowsableTest { get; set; }\n\n\t[EditorBrowsable(EditorBrowsableState.Never)]\n\tpublic int NotBrowsableTest { get; set; }\n}\n\", out cp);\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"class Test : FooBar\n{\n\tvoid Test ()\n\t{\n\t\t$B$\n\t}\n}\", false, engine1.ctx.CurrentAssembly.UnresolvedAssembly);\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BrowsableTest\"), \"'BrowsableTest' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"NotBrowsableTest\"), \"'NotBrowsableTest' found.\");\n\t\t}\n\n\n\t\t[Test()]\n\t\tpublic void TestEditorBrowsableAttributeMembersSameAssembly ()\n\t\t{\n\t\t\t\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"\nusing System;\nusing System.ComponentModel;\n\nclass Test\n{\n\t[EditorBrowsable(EditorBrowsableState.Always)]\n\tint BrowsableTest { get; set; }\n\n\t[EditorBrowsable(EditorBrowsableState.Never)]\n\tint NotBrowsableTest { get; set; }\n\n\tvoid Test ()\n\t{\n\t\t$B$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BrowsableTest\"), \"'BrowsableTest' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"NotBrowsableTest\"), \"'NotBrowsableTest' not found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIgnore ()\n\t\t{\n\t\t\tint cp;\n\t\t\tvar engine1 = CodeCompletionBugTests.CreateEngine (\n\t\t\t\t@\"\nusing System;\nusing System.ComponentModel;\n\n[EditorBrowsable(EditorBrowsableState.Always)]\npublic class BrowsableTest {}\n\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic class NotBrowsableTest {}\n\", out cp);\n\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"class Test\n\t\t\t\t{\n\t\t\t\tvoid Test ()\n\t\t\t\t{\n\t\t\t\t\t$B$\n\t\t\t\t}\n\t\t\t}\", false, e => e.EditorBrowsableBehavior = ICSharpCode.NRefactory.CSharp.Completion.EditorBrowsableBehavior.Ignore, engine1.ctx.CurrentAssembly.UnresolvedAssembly);\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BrowsableTest\"), \"'BrowsableTest' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"NotBrowsableTest\"), \"'NotBrowsableTest' not found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestHideAdvanced ()\n\t\t{\n\t\t\tint cp;\n\t\t\tvar engine1 = CodeCompletionBugTests.CreateEngine (\n\t\t\t\t@\"\nusing System;\nusing System.ComponentModel;\n\n[EditorBrowsable(EditorBrowsableState.Always)]\npublic class BrowsableTest {}\n\n[EditorBrowsable(EditorBrowsableState.Advanced)]\npublic class NotBrowsableTest {}\n\", out cp);\n\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"class Test\n\t\t\t\t{\n\t\t\t\tvoid Test ()\n\t\t\t\t{\n\t\t\t\t\t$B$\n\t\t\t\t}\n\t\t\t}\", false, e => e.EditorBrowsableBehavior = ICSharpCode.NRefactory.CSharp.Completion.EditorBrowsableBehavior.Normal, engine1.ctx.CurrentAssembly.UnresolvedAssembly);\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BrowsableTest\"), \"'BrowsableTest' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"NotBrowsableTest\"), \"'NotBrowsableTest' found.\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionAccessibleTests.cs",
    "content": "//\n// CodeCompletionAccessibleTests.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing NUnit.Framework;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class CodeCompletionAccessibleTests : TestBase\n\t{\n\t\t\n\t\tstatic string testClass = @\"\nusing System;\n\npublic class TestClass\n{\n\tpublic int PubField;\n\tpublic int PubProperty { get; set; }\n\tpublic void PubMethod () { }\n\n\tprotected int ProtField;\n\tprotected int ProtProperty { get; set; }\n\tprotected void ProtMethod () { }\n\n\tinternal protected int ProtOrInternalField;\n\tinternal protected int ProtOrInternalProperty { get; set; }\n\tinternal protected void ProtOrInternalMethod () { }\n\t\n\tprotected internal int ProtAndInternalField;\n\tprotected internal int ProtAndInternalProperty { get; set; }\n\tprotected internal void ProtAndInternalMethod () { }\n\n\tinternal int InternalField;\n\tinternal int InternalProperty { get; set; }\n\tinternal void InternalMethod () { }\n\n\tprivate int PrivField;\n\tprivate int PrivProperty { get; set; }\n\tprivate void PrivMethod () { }\n\n\tpublic static int PubStaticField;\n\tpublic static int PubStaticProperty { get; set; }\n\tpublic static void PubStaticMethod () { }\n\n\tprotected static int ProtStaticField;\n\tprotected static int ProtStaticProperty { get; set; }\n\tprotected static void ProtStaticMethod () { }\n\t\n\tprivate static int PrivStaticField;\n\tprivate static int PrivStaticProperty { get; set; }\n\tprivate static void PrivStaticMethod () { }\n\";\n\t\t[Test()]\n\t\tpublic void TestDerivedClassGeneralAccess ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(testClass + @\"}\n// from\nclass Test : TestClass {\n\tpublic void Foo ()\n\t{\n\t\t$a$\n\t}\n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubField\"), \"'PubField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubProperty\"), \"'PubProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubMethod\"), \"'PubMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtField\"), \"'ProtField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtProperty\"), \"'ProtProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtMethod\"), \"'ProtMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalField\"), \"'ProtOrInternalField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalProperty\"), \"'ProtOrInternalProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalMethod\"), \"'ProtOrInternalMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalField\"), \"'ProtAndInternalField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalProperty\"), \"'ProtAndInternalProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalMethod\"), \"'ProtAndInternalMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"InternalField\"), \"'InternalField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"InternalProperty\"), \"'InternalProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"InternalMethod\"), \"'InternalMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticField\"), \"'PubStaticField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticProperty\"), \"'PubStaticProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticMethod\"), \"'PubStaticMethod' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticField\"), \"'ProtStaticField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticProperty\"), \"'ProtStaticProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticMethod\"), \"'ProtStaticMethod' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivField\"), \"'PrivField' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivProperty\"), \"'PrivProperty' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivMethod\"), \"'PrivMethod' found.\");\n\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivStaticField\"), \"'PrivStaticField' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivStaticProperty\"), \"'PrivStaticProperty' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivStaticMethod\"), \"'PrivStaticMethod' found.\");\n\t\t\t});\n\t\t}\n\t\n\t\t[Test()]\n\t\tpublic void TestDerivedClassMemberReferenceAccess ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(testClass + @\"}\n// from\nclass Test : TestClass {\n\tpublic void Foo ()\n\t{\n\t\t$this.$\n\t}\n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubField\"), \"'PubField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubProperty\"), \"'PubProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"PubMethod\"), \"'PubMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtField\"), \"'ProtField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtProperty\"), \"'ProtProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtMethod\"), \"'ProtMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalField\"), \"'ProtOrInternalField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalProperty\"), \"'ProtOrInternalProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalMethod\"), \"'ProtOrInternalMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalField\"), \"'ProtAndInternalField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalProperty\"), \"'ProtAndInternalProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalMethod\"), \"'ProtAndInternalMethod' not found.\");\n\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"InternalField\"), \"'InternalField' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"InternalProperty\"), \"'InternalProperty' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"InternalMethod\"), \"'InternalMethod' not found.\");\n\t\n//\t\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticField\"), \"'PubStaticField' not found.\");\n//\t\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticProperty\"), \"'PubStaticProperty' not found.\");\n//\t\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticMethod\"), \"'PubStaticMethod' not found.\");\n//\t\t\t\t\n//\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticField\"), \"'ProtStaticField' not found.\");\n//\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticProperty\"), \"'ProtStaticProperty' not found.\");\n//\t\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticMethod\"), \"'ProtStaticMethod' not found.\");\n//\t\t\t\t\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivField\"), \"'PrivField' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivProperty\"), \"'PrivProperty' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivMethod\"), \"'PrivMethod' found.\");\n\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivStaticField\"), \"'PrivStaticField' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivStaticProperty\"), \"'PrivStaticProperty' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"PrivStaticMethod\"), \"'PrivStaticMethod' found.\");\n\t\t\t});\n\t\t}\n\t\n\n\n\t\t[Test()]\n\t\tpublic void TestNonStaticClassAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (testClass +\n@\"\n\tvoid TestMethod () \n\t{\n\t\t$this.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\n\t\t\tCodeCompletionBugTests.CheckProtectedObjectMembers (provider); // 5 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"PubField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubMethod\"));\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtMethod\"));\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"PrivField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PrivProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PrivMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInternalAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (testClass +\n@\"\n\tvoid TestMethod () \n\t{\n\t\t$this.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"InternalField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"InternalProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"InternalMethod\"));\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtAndInternalMethod\"));\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInternalAccessOutside ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (testClass +\n@\"\n} \nclass Test2 {\n\tvoid TestMethod () \n\t{\n\t\tTestClass tc;\n\t\t$tc.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"InternalField\"), \"InternalField == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"InternalProperty\"), \"InternalProperty == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"InternalMethod\"), \"InternalMethod == null\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalField\"), \"ProtOrInternalField == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalProperty\"), \"ProtOrInternalProperty == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtOrInternalMethod\"), \"ProtOrInternalMethod == null\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestStaticClassAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (testClass +\n@\"\n\tvoid TestMethod () \n\t{\n\t\t$TestClass.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\n\t\t\tCodeCompletionBugTests.CheckStaticObjectMembers (provider); // 2 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticMethod\"));\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtStaticMethod\"));\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"PrivStaticField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PrivStaticProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PrivStaticMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestExternalNonStaticClassAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (testClass +\n@\"}\nclass AClass {\n\tvoid TestMethod () \n\t{\n\t\tTestClass c;\n\t\t$c.$ \n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"PubField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestExternalStaticClassAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (testClass +\n@\"}\nclass AClass {\n\tvoid TestMethod () \n\t{\n\t\t$TestClass.$ \n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\n\t\t\tCodeCompletionBugTests.CheckStaticObjectMembers (provider); // 2 members\n\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubStaticMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestExternalNonStaticSubclassAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (testClass +\n@\"}\nclass AClass : TestClass {\n\tvoid TestMethod () \n\t{\n\t\t$this.$ \n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\n\t\t\tCodeCompletionBugTests.CheckProtectedObjectMembers (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"PubField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"PubMethod\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtField\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtProperty\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"ProtMethod\"));\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestThisProtectedMemberAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tprotected void Test ()\n\t{\n\t}\n}\n\nclass Test2 : Test\n{\n\tvoid Test2 ()\n\t{\n\t\t$this.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestBasePrivateMemberAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\ntestClass + @\"\n}\n\nclass Test : TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$base.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNull (provider.Find (\"PrivField\"), \"field 'PrivField' found, but shouldn't.\");\n\t\t\tAssert.IsNull (provider.Find (\"PrivProperty\"), \"property 'PrivProperty' found, but shouldn't.\");\n\t\t\tAssert.IsNull (provider.Find (\"PrivMethod\"), \"method 'PrivMethod' found, but shouldn't.\");\n\t\t\t\n\t\t}\n\t\t[Test()]\n\t\tpublic void TestBaseProtectedMemberAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tprotected void Test ()\n\t{\n\t}\n}\n\nclass Test2 : Test\n{\n\tvoid Test2 ()\n\t{\n\t\t$base.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t[Test()]\n\t\tpublic void TestBasePublicMemberAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\ntestClass + @\"\nclass Test : TestClass\n{\n\tvoid Test ()\n\t{\n\t\t$base.$\n\t}\n} }\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"PubField\"), \"field 'PubField' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"PubProperty\"), \"property 'PubProperty' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"PubMethod\"), \"method 'PubMethod' not found.\");\n\t\t\t\n\t\t}\n\t\t[Test()]\n\t\tpublic void TestProtectedMemberAccess2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tprotected void Test ()\n\t{\n\t}\n}\n\nclass Test2\n{\n\tvoid Test2 ()\n\t{\n\t\t$(new Test ()).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNull (provider.Find (\"Test\"), \"method 'Test' found, but shouldn't.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestGenericParameter ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nclass Foo<T>\n{\n\t$public $\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"T\"), \"generic parameter 'T' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestUnclosedMember ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\n\nclass C\n{\n\t\n\tpublic void Hello ()\n\t{\n\t\t$C$\n\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"C\"), \"class 'C' not found\");\n\t\t}\n\t\t\n\t\t\n\t\t[Test()]\n\t\tpublic void TestUnclosedMember2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"using System;\n\nnamespace ConsoleTest\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t}\n\t\t\n\t\tpublic void Hello ()\n\t\t{\n\t\t}\n\t}\n\t\n\tclass Foo\n\t{\n\t\tvoid Hello ()\n\t\t{\n\t\t\t$M$\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"MainClass\"), \"class 'MainClass' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestGenericParameterB ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nclass Foo<T>\n{\n\tpublic void Bar<TValue> ()\n\t{\n\t\t$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"T\"), \"generic parameter 'T' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TValue\"), \"generic parameter 'TValue' found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestGenericParameterC ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nclass Foo<T>\n{\n\tpublic static void Bar<TValue> ()\n\t{\n\t\t$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"T\"), \"generic parameter 'T' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TValue\"), \"generic parameter 'TValue' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInheritedInnerClasses ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic class A {\n\tpublic class B {\n\t\tpublic void MethodB () \n\t\t{\n\t\t}\n\t}\n}\npublic class C : A \n{\n\tpublic override void MethodA (B something)\n\t{\n\t\t$something.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"MethodB\"), \"method 'MethodB' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestNamespaceAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nnamespace Foo.Bar {\n\tclass B\n\t{\n\t}\n}\n\nnamespace Foo {\n\tclass Test\n\t{\n\t\tvoid TestMethod ()\n\t\t{\n\t\t\t$Bar.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"B\"), \"class 'B' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestNamespaceAccess2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nnamespace Foo.Bar {\n\tclass B\n\t{\n\t}\n}\n\nnamespace FooBar {\n\tusing Foo;\n\tclass Test\n\t{\n\t\tvoid TestMethod ()\n\t\t{\n\t\t\t$Bar.$\n\t\t}\n\t}\n}\");\n\t\t\t// either provider == null, or B not found\n\t\t\tif (provider != null)\n\t\t\t\tAssert.IsNull (provider.Find (\"B\"), \"class 'B' found, but shouldn't\");\n\t\t}\n\t\t\n\t\t\n\t\t[Test()]\n\t\tpublic void TestNamespaceAccess3 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nnamespace SomeTest.TestNS {\n\tclass TestClass \n\t{\n\t\t\n\t}\n}\n\nnamespace A {\n\tusing SomeTest;\n\t\n\tpublic class Program2\n\t{\n\t\tpublic void Main () \n\t\t{\n\t\t\t$$\n\t\t}\n\t}\n}\t\t\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNull (provider.Find (\"TestNS\"), \"namespace 'TestNS' found, but shouldn't\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestNamespaceAccess4 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nnamespace SomeTest.TestNS {\n\tclass TestClass \n\t{\n\t\t\n\t}\n}\n\nnamespace SomeTest {\n\t\n\tpublic class Program2\n\t{\n\t\tpublic void Main () \n\t\t{\n\t\t\t$$\n\t\t}\n\t}\n}\t\t\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestNS\"), \"namespace 'TestNS' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestHideClassesWithPrivateConstructor ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass A\n{\n}\n\nclass TestClass : A\n{\n\tTestClass ()\n\t{\n\t}\n\t\n}\n\nclass Example\n{\n\tvoid TestMe ()\n\t{\n\t\t$A a = new $\n\t}\n}\t\t\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found\");\n\t\t\tAssert.IsNull (provider.Find (\"TestClass\"), \"class 'TestClass' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestAttributePropertyAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic class TestAttribute : System.Attribute\n{\n\tpublic int MyIntProperty {\n\t\tget;\n\t\tset;\n\t}\n\t\n\tpublic string MyStringProperty {\n\t\tget;\n\t\tset;\n\t}\n}\n\n[Test($M$)]\npublic class Program\n{\n\t\n}\t\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"MyIntProperty\"), \"property 'MyIntProperty' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"MyStringProperty\"), \"property 'MyStringProperty' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInnerClassEnumAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic class TestInnerEnum\n{\n\tenum InnerEnum { A, B, C }\n\n\tpublic class InnerClass\n\t{\n\t\tvoid TestMethod (InnerEnum e)\n\t\t{\n\t\t\t$e = InnerEnum.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"field 'A' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"B\"), \"field 'B' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"C\"), \"field 'C' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInnerClassPrivateOuterMembersAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t}\n\t\n\tpublic class InnerClass\n\t{\n\t\tvoid TestMethod ()\n\t\t{\n\t\t\tTestClass tc = new TestClass ();\n\t\t\t$tc.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestExplicitGenericMethodParameter ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic class TestClass\n{\n\tpublic static T TestMethod<T> ()\n\t{\n\t\treturn default(T);\n\t}\n}\n\npublic class Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\t$TestClass.TestMethod<Test> ().$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestImplicitGenericMethodParameter ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic class TestClass\n{\n\tpublic static T TestMethod<T> (T t)\n\t{\n\t\treturn t;\n\t}\n}\n\npublic class Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\t$TestClass.TestMethod (this).$\n\t}\n}\n \");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestImplicitGenericMethodParameterComplex ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nusing System;\n\nclass SomeTemplate<T>\n{\n\tpublic T Val { get; set; }\n\tpublic SomeTemplate (T val)\n\t{\n\t\tthis.Val = val;\n\t}\n}\n\nclass Test\n{\n\tpublic T GetVal<T> (SomeTemplate<T> t)\n\t{\n\t\treturn t.Val;\n\t}\n\t\n\tpublic void TestMethod ()\n\t{\n\t\tSomeTemplate<Test> c = SomeTemplate<Test> (this);\n\t\tvar x = GetVal (c);\n\t\t$x.$\n\t\t\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestImplicitGenericArrayMethodParameter ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic class TestClass\n{\n\tpublic static T[] Test<T> ()\n\t{\n\t\treturn default(T[]);\n\t}\n}\n\npublic class Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tvar v = TestClass.Test<Test>();\n\t\t$v[0].$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestExplicitResolving ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\ninterface IMyInterface {\n\tobject this [object i] { get; }\n}\n\nclass MyClass<S, T> : IMyInterface\n{\n\tobject IMyInterface.this[object i] {\n\t\tget {\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic S this[T i] {\n\t\tget {\n\t\t\treturn default(S);\n\t\t}\n\t}\n}\n\t\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tMyClass<TestClass, string> myClass = new MyClass<TestClass, string> ();\n\t\t$myClass[\"\"test\"\"].$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestAlias ()\n\t\t\t\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nnamespace A\n{\n\tpublic class MyClass \n\t{\n\t\tpublic void MyMethod ()\n\t\t{\n\t\t}\n\t}\n}\n\nnamespace X\n{\n\tusing GG = A.MyClass;\n\t\n\tpublic abstract class I\n\t{\n\t\tprotected virtual GG Foo ()\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\nnamespace X\n{\n\tpublic class B : I\n\t{\n\t\tpublic void A ()\n\t\t{\n\t\t\t$Foo ().$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"MyMethod\"), \"method 'MyMethod' not found\");\t\t\t\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestEnumInnerClass ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nusing System;\nnamespace CaptainHook.Mail\n{\n\tpublic class TestClass\n\t{\n\t\tenum ParsingState\n\t\t{\n\t\t\tAny,\n\t\t\tStart,\n\t\t\tInMacro,\n\t\t\tInMacroArgumentList,\n\t\t\tInQuotedMacroArgument,\n\t\t\tPlainText\n\t\t}\n\n\t\tParsingState state;\n\n\t\tpublic TestClass ()\n\t\t{\n\t\t\t$state = $\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNull (provider.Find (\"CaptainHook.Mail.TestClass.ParsingState\"), \"class 'CaptainHook.Mail.TestClass.ParsingState' found!\");\n\t\t\tAssert.IsNull (provider.Find (\"TestClass.ParsingState\"), \"class 'TestClass.ParsingState' found!\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ParsingState\"), \"class 'ParsingState' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInheritableTypeContext ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tpublic class Inner {}\n\tpublic static void Foo () {}\n}\n\n$class Test2 : Test.$\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner\"), \"class 'Inner' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"method 'Foo' found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInheritableTypeContextCase2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nnamespace A {\n\tclass Test\n\t{\n\t\tpublic class Inner {}\n\t\tpublic static void Foo () {}\n\t}\n\t\n\tclass Test2 $: Test.$\n\t{\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner\"), \"class 'Inner' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"method 'Foo' found.\");\n\t\t}\n\t\t\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInheritableTypeWhereContext ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tpublic class Inner {}\n\tpublic static void Foo () {}\n}\n\n$class Test2<T> where T : Test.$\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner\"), \"class 'Inner' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"method 'Foo' found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEnumAssignment ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic enum TestEnum { A, B, C}\n\nclass TestClass\n{\n\tpublic void Foo ()\n\t{\n\t\t$TestEnum test = $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEnumAssignmentCase2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic enum TestEnum { A, B, C}\n\nclass TestClass\n{\n\tpublic void Foo ()\n\t{\n\t\tTestEnum test;\n\t\t$test = $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEnumAsParameter ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic enum TestEnum { A, B, C}\n\nclass TestClass\n{\n\tvoid Bar (TestEnum test) {}\n\tpublic void Foo ()\n\t{\n\t\t$Bar ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestEnumInExtensionMethod()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider(@\"\npublic enum TestEnum { A, B, C}\nstatic class Ext { public static void Foo(this object o, TestEnum str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$args.Foo($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestEnumInExtensionMethodStaticInvocation()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider(@\"\npublic enum TestEnum { A, B, C}\nstatic class Ext { public static void Foo(this object o, TestEnum str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$Ext.Foo(args, $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\n\n\t\t[Test()]\n\t\tpublic void TestEnumAsParameterCase2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic enum TestEnum { A, B, C}\n\nclass TestClass\n{\n\tvoid Bar (int a, TestEnum test) {}\n\tpublic void Foo ()\n\t{\n\t\t$Bar (5, $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInnerEnums ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic class InnerEnumTest\n{\n\tpublic enum TestEnum { A, B, C}\n\tpublic void Bar (TestEnum test) {}\n}\n\nclass TestClass\n{\n\tpublic void Foo ()\n\t{\n\t\tInnerEnumTest test;\n\t\t$test.Bar ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"InnerEnumTest.TestEnum\"), \"enum 'InnerEnumTest.TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"InnerEnumTest.TestEnum.A\"), \"enum 'InnerEnumTest.TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"InnerEnumTest.TestEnum.B\"), \"enum 'InnerEnumTest.TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"InnerEnumTest.TestEnum.C\"), \"enum 'InnerEnumTest.TestEnum.C' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestEnumInBinaryOperatorExpression ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"\n[Flags]\npublic enum TestEnum { A, B, C}\n\nclass TestClass\n{\npublic void Foo ()\n{\n$TestEnum test = TestEnum.A | T$\n}\n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEnumComparison ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n\t\t\t\t@\"\npublic enum TestEnum { A, B, C}\n\nclass TestClass\n{\n\tpublic static TestEnum A (int i, int j, string s) {}\n\n\tpublic void Foo ()\n\t{\n\t\t$if (A(1,2,\"\"foo\"\") == $\n\t}\n}\");\n\t\t\tAssert.IsFalse(provider.AutoCompleteEmptyMatch);\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEnumComparisonCase2 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n\t\t\t\t@\"\npublic enum TestEnum { A, B, C}\n\nclass TestClass\n{\n\tpublic static TestEnum A (int i, int j, string s) {}\n\n\tpublic void Foo ()\n\t{\n\t\t$if (A(1,2,\"\"foo\"\") != $\n\t}\n}\");\n\t\t\tAssert.IsFalse(provider.AutoCompleteEmptyMatch);\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum\"), \"enum 'TestEnum' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.A\"), \"enum 'TestEnum.A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.B\"), \"enum 'TestEnum.B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestEnum.C\"), \"enum 'TestEnum.C' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestPrimimitiveTypeCompletionString ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"using System;\n\nclass Test\n{\n\tpublic static void Foo () \n\t{\n\t\tConsole.WriteLine ($\"\"\"\".$);\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ToString\"), \"method 'ToString' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t[Test()]\n\t\tpublic void TestUsingContext ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (@\"$using System.$\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"IO\"), \"namespace 'IO' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestNamedArgumentContext1 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (@\"\nusing System;\n\nclass Test {\npublic static void Query(MySqlConnection conn, string database, string table)\n\t\t{\n\t\t\tconn.Query(string.Format(\"\"SELECT * FROM {0}\"\", table))\n\t\t\t.On(row: delegate (Row data) {\n\t\t\t\t$Console.$\n\t\t\t});\n\t\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"WriteLine\"), \"method 'WriteLine' not found.\");\n\t\t}\n\t\t[Test()]\n\t\tpublic void TestAttributeContextClass ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"\nusing System;\n\n$[O$\nclass Test {\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Obsolete\"), \"attribute 'Obsolete' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Serializable\"), \"attribute 'Serializable' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestAttributeContextInNamespace ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"\nusing System;\n\nnamespace Test {\n\t$[O$\n\tclass Test {\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Obsolete\"), \"attribute 'Obsolete' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Serializable\"), \"attribute 'Serializable' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestAttributeContextMember ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"\nusing System;\n\nclass Test {\n\t$[O$\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Obsolete\"), \"attribute 'Obsolete' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Serializable\"), \"attribute 'Serializable' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestAttributeInNonAttributeContext ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (@\"\nusing System;\n\nclass Test {\n$$\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ObsoleteAttribute\"), \"attribute 'ObsoleteAttribute' not found.\");\n\t\t}\n\t\t\n\t\t// 'from' in comment activates linq context\n\t\t[Test()]\n\t\tpublic void TestBreakingComment ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (@\"\nusing System;\n// from\nclass Test {\n$$\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"class 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestAttributeContextParameterCompletion ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$[Obsolete(System.$\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Console\"), \"'Console' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3320 - Constants accessed by class name do not show in completion list\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug3320 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\npublic class Foo\n{\n    public const int Bar = 5;\n\n    public void DoStuff()\n    {\n        $Foo.$\n    } \n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"'Bar' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestImplicitShadowing ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\n\n\t\tnamespace ConsoleApplication2\n\t\t{\n\t\t\tclass A\n\t\t\t{\n\t\t\t\tpublic int Foo;\n\t\t\t}\n\n\t\t\tclass B : A\n\t\t\t{\n\t\t\t\tpublic string Foo;\n\t\t\t}\n\n\t\t\tclass Program\n\t\t\t{\n\t\t\t\tstatic void Main (string[] args)\n\t\t\t\t{\n\t\t\t\t\tvar b = new B ();\n\t\t\t\t\t$b.$\n\t\t\t\t}\n\t\t\t}\n\t\t}\", provider => {\n\t\t\t\tint count = 0;\n\t\t\t\tforeach (var data in provider.Data) \n\t\t\t\t\tif (data.DisplayText == \"Foo\")\n\t\t\t\t\t\tcount += data.HasOverloads ? data.OverloadedData.Count () : 1;\n\t\t\t\tAssert.AreEqual (1, count);\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestOverrideFiltering ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\n\nnamespace ConsoleApplication2\n{\n    class A\n    {\n        public virtual int Foo { set {} }\n    }\n\n    class B : A\n    {\n        public override int Foo {\n            set {\n                base.Foo = value;\n            }\n        }\n    }\n\n    class Program\n    {\n        static void Main (string[] args)\n        {\n            var b = new B ();\n            $b.$\n        }\n    }\n}\n\", provider => {\n\t\t\t\tint count = 0;\n\t\t\t\tforeach (var data in provider.Data) \n\t\t\t\t\tif (data.DisplayText == \"Foo\")\n\t\t\t\t\t\tcount += data.HasOverloads ? data.OverloadedData.Count () : 1;\n\t\t\t\tAssert.AreEqual (1, count);\n\t\t\t});\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 5648 - Types are displayed even when cannot be used \n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug5648 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\n\nnamespace N\n{\n\t$e$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"enum\"), \"'enum' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"namespace\"), \"'namespace' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"public\"), \"'public' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"CharEnumerator\"), \"'CharEnumerator' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"Console\"), \"'Console' found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void CheckInstanceMembersAreHiddenInStaticMethod ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\n\nclass Test\n{\n\tint foo;\n\tint Foo { get { return foo; } }\n\tvoid TestMethod () {}\n\n\tpublic static void Main (string[] args)\n\t{\n\t\t$f$\t\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Main\"), \"'Main' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"'Test' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"foo\"), \"'foo' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"'Foo' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"TestMethod\"), \"'TestMethod' found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestVariableHiding ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\n\nclass Test\n{\n\tstatic string test;\n\n\tpublic static void Main (int test)\n\t{\n\t\t$f$\t\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.AreEqual (1, provider.Data.Count (p => p.DisplayText == \"test\"));\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOverloadCount ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\n\nclass Test\n{\n\tstatic void Foo () {}\n\tstatic void Foo (int i) {}\n\tstatic void Foo (int i, string s) {}\n\n\tpublic static void Main (int test)\n\t{\n\t\t$f$\t\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.AreEqual (1, provider.Data.Count (p => p.DisplayText == \"Foo\"));\n\t\t\t\tvar data = provider.Find (\"Foo\");\n\t\t\t\tAssert.AreEqual (3, data.OverloadedData.Count ());\n\n\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs",
    "content": "﻿//\n// CodeCompletionBugTests.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nusing ICSharpCode.NRefactory.Completion;\nusing ICSharpCode.NRefactory.CSharp.Completion;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class CodeCompletionBugTests : TestBase\n\t{\n\n\t\tpublic static CompletionDataList CreateProvider (string text)\n\t\t{\n\t\t\treturn CreateProvider (text, false);\n\t\t}\n\t\t\n\t\tpublic static CompletionDataList CreateCtrlSpaceProvider (string text)\n\t\t{\n\t\t\treturn CreateProvider (text, true);\n\t\t}\n\t\t\n\t\tpublic static void CombinedProviderTest (string text, Action<CompletionDataList> act)\n\t\t{\n\t\t\tvar provider = CreateProvider (text);\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tact (provider);\n\t\t\t\n\t\t\tprovider = CreateCtrlSpaceProvider (text);\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tact (provider);\n\t\t}\n\t\t\n\t\tpublic class TestFactory\n\t\t: ICompletionDataFactory\n\t\t{\n//\t\t\treadonly CSharpResolver state;\n\t\t\treadonly TypeSystemAstBuilder builder;\n\n\t\t\tpublic TestFactory(CSharpResolver state)\n\t\t\t{\n//\t\t\t\tthis.state = state;\n\t\t\t\tbuilder = new TypeSystemAstBuilder(state);\n\t\t\t\tbuilder.ConvertUnboundTypeArguments = true;\n\t\t\t}\n\n\t\t\tpublic class CompletionData\n\t\t\t: ICompletionData\n\t\t\t{\n\t\t\t\t#region ICompletionData implementation\n\t\t\t\tpublic void AddOverload (ICompletionData data)\n\t\t\t\t{\n\t\t\t\t\tif (overloadedData.Count == 0)\n\t\t\t\t\t\toverloadedData.Add (this);\n\t\t\t\t\toverloadedData.Add (data);\n\t\t\t\t}\n\n\t\t\t\tpublic CompletionCategory CompletionCategory {\n\t\t\t\t\tget;\n\t\t\t\t\tset;\n\t\t\t\t}\n\n\t\t\t\tpublic string DisplayText {\n\t\t\t\t\tget;\n\t\t\t\t\tset;\n\t\t\t\t}\n\n\t\t\t\tpublic string Description {\n\t\t\t\t\tget;\n\t\t\t\t\tset;\n\t\t\t\t}\n\n\t\t\t\tpublic string CompletionText {\n\t\t\t\t\tget;\n\t\t\t\t\tset;\n\t\t\t\t}\n\n\t\t\t\tpublic DisplayFlags DisplayFlags {\n\t\t\t\t\tget;\n\t\t\t\t\tset;\n\t\t\t\t}\n\n\t\t\t\tpublic bool HasOverloads {\n\t\t\t\t\tget {\n\t\t\t\t\t\treturn overloadedData.Count > 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treadonly List<ICompletionData> overloadedData = new List<ICompletionData> ();\n\t\t\t\tpublic IEnumerable<ICompletionData> OverloadedData {\n\t\t\t\t\tget {\n\t\t\t\t\t\treturn overloadedData;\n\t\t\t\t\t}\n\t\t\t\t\tset {\n\t\t\t\t\t\tthrow new InvalidOperationException ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endregion\n\t\t\t\t\n\t\t\t\tpublic CompletionData (string text)\n\t\t\t\t{\n\t\t\t\t\tDisplayText = CompletionText = Description = text;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class OverrideCompletionData : CompletionData\n\t\t\t{\n\t\t\t\tpublic int DeclarationBegin {\n\t\t\t\t\tget;\n\t\t\t\t\tset;\n\t\t\t\t}\n\n\t\t\t\tpublic OverrideCompletionData (string text, int declarationBegin) : base(text)\n\t\t\t\t{\n\t\t\t\t\tthis.DeclarationBegin = declarationBegin;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class EntityCompletionData : CompletionData, IEntityCompletionData\n\t\t\t{\n\t\t\t\t#region IEntityCompletionData implementation\n\n\t\t\t\tpublic IEntity Entity {\n\t\t\t\t\tget;\n\t\t\t\t\tprivate set;\n\t\t\t\t}\n\n\t\t\t\t#endregion\n\n\t\t\t\tpublic EntityCompletionData(IEntity entity) : this(entity, entity.Name)\n\t\t\t\t{\n\t\t\t\t}\n\n\t\t\t\tpublic EntityCompletionData(IEntity entity, string txt) : base(txt)\n\t\t\t\t{\n\t\t\t\t\tthis.Entity = entity;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic class ImportCompletionData : CompletionData\n\t\t\t{\n\t\t\t\tpublic IType Type {\n\t\t\t\t\tget;\n\t\t\t\t\tprivate set;\n\t\t\t\t}\n\n\t\t\t\tpublic bool UseFullName {\n\t\t\t\t\tget;\n\t\t\t\t\tprivate set;\n\t\t\t\t}\n\n\t\t\t\tpublic ImportCompletionData(IType type, bool useFullName) : base (type.Name)\n\t\t\t\t{\n\t\t\t\t\tthis.Type = type;\n\t\t\t\t\tthis.UseFullName = useFullName;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#region ICompletionDataFactory implementation\n\t\t\tpublic ICompletionData CreateEntityCompletionData (IEntity entity)\n\t\t\t{\n\t\t\t\treturn new EntityCompletionData (entity);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateEntityCompletionData (IEntity entity, string text)\n\t\t\t{\n\t\t\t\treturn new CompletionData (text);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateTypeCompletionData (IType type, bool fullName, bool isInAttributeContext, bool addForTypeCreation)\n\t\t\t{\n\t\t\t\tstring name = fullName ? builder.ConvertType(type).ToString() : type.Name; \n\t\t\t\tif (isInAttributeContext && name.EndsWith(\"Attribute\", StringComparison.Ordinal) && name.Length > \"Attribute\".Length) {\n\t\t\t\t\tname = name.Substring(0, name.Length - \"Attribute\".Length);\n\t\t\t\t}\n\t\t\t\treturn new CompletionData (name);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateMemberCompletionData(IType type, IEntity member)\n\t\t\t{\n\t\t\t\tstring name = builder.ConvertType(type).ToString(); \n\t\t\t\treturn new EntityCompletionData (member, name + \".\"+ member.Name);\n\t\t\t}\n\n\n\t\t\tpublic ICompletionData CreateLiteralCompletionData (string title, string description = null, string insertText = null)\n\t\t\t{\n\t\t\t\treturn new CompletionData (title);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateXmlDocCompletionData (string title, string description = null, string insertText = null)\n\t\t\t{\n\t\t\t\treturn new CompletionData (title);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateNamespaceCompletionData (INamespace ns)\n\t\t\t{\n\t\t\t\treturn new CompletionData (ns.Name);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateVariableCompletionData (IVariable variable)\n\t\t\t{\n\t\t\t\treturn new CompletionData (variable.Name);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateVariableCompletionData (ITypeParameter parameter)\n\t\t\t{\n\t\t\t\treturn new CompletionData (parameter.Name);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateEventCreationCompletionData (string varName, IType delegateType, IEvent evt, string parameterDefinition, IUnresolvedMember currentMember, IUnresolvedTypeDefinition currentType)\n\t\t\t{\n\t\t\t\treturn new CompletionData (varName);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateNewOverrideCompletionData (int declarationBegin, IUnresolvedTypeDefinition type, IMember m)\n\t\t\t{\n\t\t\t\treturn new OverrideCompletionData (m.Name, declarationBegin);\n\t\t\t}\n\t\t\t\n\t\t\tpublic ICompletionData CreateNewPartialCompletionData (int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember m)\n\t\t\t{\n\t\t\t\treturn new OverrideCompletionData (m.Name, declarationBegin);\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateImportCompletionData(IType type, bool useFullName, bool addForTypeCreation)\n\t\t\t{\n\t\t\t\treturn new ImportCompletionData (type, useFullName);\n\t\t\t}\n\n\t\t\tpublic IEnumerable<ICompletionData> CreateCodeTemplateCompletionData ()\n\t\t\t{\n\t\t\t\treturn Enumerable.Empty<ICompletionData> ();\n\t\t\t}\n\n\t\t\tpublic ICompletionData CreateFormatItemCompletionData(string format, string description, object example)\n\t\t\t{\n\t\t\t\treturn new CompletionData (format + \" - \" + description +\":\" + example);\n\t\t\t}\n\n\t\t\tpublic IEnumerable<ICompletionData> CreatePreProcessorDefinesCompletionData ()\n\t\t\t{\n\t\t\t\tyield return new CompletionData (\"DEBUG\");\n\t\t\t\tyield return new CompletionData (\"TEST\");\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t\t\n\t\tstatic readonly Lazy<IUnresolvedAssembly> systemAssembly = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\tvar loader = new CecilLoader();\n\t\t\tloader.IncludeInternalMembers = true;\n\t\t\treturn loader.LoadAssemblyFile(typeof(System.ComponentModel.BrowsableAttribute).Assembly.Location);\n\t\t});\n\t\tstatic readonly Lazy<IUnresolvedAssembly> systemXmlLinq = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\tvar loader = new CecilLoader();\n\t\t\tloader.IncludeInternalMembers = true;\n\t\t\treturn loader.LoadAssemblyFile(typeof(System.Xml.Linq.XElement).Assembly.Location);\n\t\t});\n\n\n\t\tstatic readonly Lazy<IUnresolvedAssembly> mscorlib = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\tvar loader = new CecilLoader();\n\t\t\tloader.IncludeInternalMembers = true;\n\t\t\treturn loader.LoadAssemblyFile(typeof(object).Assembly.Location);\n\t\t});\n\n\t\tstatic readonly Lazy<IUnresolvedAssembly> systemCore = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\tvar loader = new CecilLoader();\n\t\t\tloader.IncludeInternalMembers = true;\n\t\t\treturn loader.LoadAssemblyFile(typeof(Enumerable).Assembly.Location);\n\t\t});\n\n\t\tpublic static void CreateCompilation (string parsedText, out IProjectContent pctx, out SyntaxTree syntaxTree, out CSharpUnresolvedFile unresolvedFile, bool expectErrors, params IUnresolvedAssembly[] references)\n\t\t{\n\t\t\tpctx = new CSharpProjectContent();\n\t\t\tvar refs = new List<IUnresolvedAssembly> { mscorlib.Value, systemCore.Value, systemAssembly.Value, systemXmlLinq.Value };\n\t\t\tif (references != null)\n\t\t\t\trefs.AddRange (references);\n\t\t\t\n\t\t\tpctx = pctx.AddAssemblyReferences(refs);\n\t\t\t\n\t\t\tsyntaxTree = new CSharpParser().Parse(parsedText, \"program.cs\");\n\t\t\tsyntaxTree.Freeze();\n\t\t\tif (!expectErrors && syntaxTree.Errors.Count > 0) {\n\t\t\t\tConsole.WriteLine (\"----\");\n\t\t\t\tConsole.WriteLine (parsedText);\n\t\t\t\tConsole.WriteLine (\"----\");\n\t\t\t\tforeach (var error in syntaxTree.Errors)\n\t\t\t\t\tConsole.WriteLine (error.Message);\n\t\t\t\tAssert.Fail (\"Parse error.\");\n\t\t\t}\n\n\t\t\tunresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tpctx = pctx.AddOrUpdateFiles(unresolvedFile);\n\t\t}\n\n\t\tpublic static CSharpCompletionEngine CreateEngine(string text, out int cursorPosition, params IUnresolvedAssembly[] references)\n\t\t{\n\t\t\tstring parsedText;\n\t\t\tstring editorText;\n\t\t\tvar selectionStart = text.IndexOf('$');\n\t\t\tcursorPosition = selectionStart;\n\t\t\tint endPos = text.IndexOf('$', cursorPosition + 1);\n\t\t\tif (endPos == -1) {\n\t\t\t\tparsedText = editorText = cursorPosition < 0 ? text : text.Substring(0, cursorPosition) + text.Substring(cursorPosition + 1);\n\t\t\t} else {\n\t\t\t\tparsedText = text.Substring(0, cursorPosition) + new string(' ', endPos - cursorPosition) + text.Substring(endPos + 1);\n\t\t\t\teditorText = text.Substring(0, cursorPosition) + text.Substring(cursorPosition + 1, endPos - cursorPosition - 1) + text.Substring(endPos + 1);\n\t\t\t\tcursorPosition = endPos - 1; \n\t\t\t}\n\t\t\tvar doc = new ReadOnlyDocument(editorText);\n\n\t\t\tIProjectContent pctx;\n\t\t\tSyntaxTree syntaxTree;\n\t\t\tCSharpUnresolvedFile unresolvedFile;\n\t\t\tCreateCompilation (parsedText, out pctx, out syntaxTree, out unresolvedFile, true, references);\n\t\t\tvar cmp = pctx.CreateCompilation();\n\n\t\t\tvar loc = cursorPosition > 0 ? doc.GetLocation(selectionStart) : new TextLocation (1, 1);\n\n\t\t\tvar rctx = new CSharpTypeResolveContext(cmp.MainAssembly);\n\t\t\trctx = rctx.WithUsingScope(unresolvedFile.GetUsingScope(loc).Resolve(cmp));\n\n\t\t\tvar curDef = unresolvedFile.GetInnermostTypeDefinition(loc);\n\t\t\tif (curDef != null) {\n\t\t\t\tvar resolvedDef = curDef.Resolve(rctx).GetDefinition();\n\t\t\t\trctx = rctx.WithCurrentTypeDefinition(resolvedDef);\n\t\t\t\tvar curMember = resolvedDef.Members.FirstOrDefault(m => m.Region.Begin <= loc && loc < m.BodyRegion.End);\n\t\t\t\tif (curMember != null) {\n\t\t\t\t\trctx = rctx.WithCurrentMember(curMember);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar mb = new DefaultCompletionContextProvider(doc, unresolvedFile);\n\t\t\tmb.AddSymbol (\"TEST\");\n\t\t\tforeach (var sym in syntaxTree.ConditionalSymbols) {\n\t\t\t\tmb.AddSymbol(sym);\n\t\t\t}\n\t\t\tvar engine = new CSharpCompletionEngine(doc, mb, new TestFactory(new CSharpResolver (rctx)), pctx, rctx);\n\t\t\tengine.AutomaticallyAddImports = true;\n\t\t\tengine.EolMarker = Environment.NewLine;\n\t\t\tengine.FormattingPolicy = FormattingOptionsFactory.CreateMono();\n\t\t\treturn engine;\n\t\t}\n\t\t\n\t\tpublic static CompletionDataList CreateProvider(string text, bool isCtrlSpace, Action<CSharpCompletionEngine> engineCallback, params IUnresolvedAssembly[] references)\n\t\t{\n\t\t\tint cursorPosition;\n\t\t\tvar engine = CreateEngine(text, out cursorPosition, references);\n\t\t\tif (engineCallback != null)\n\t\t\t\tengineCallback(engine);\n\t\t\tvar data = engine.GetCompletionData (cursorPosition, isCtrlSpace);\n\n\t\t\treturn new CompletionDataList {\n\t\t\t\tData = data,\n\t\t\t\tAutoCompleteEmptyMatch = engine.AutoCompleteEmptyMatch,\n\t\t\t\tAutoSelect = engine.AutoSelect,\n\t\t\t\tDefaultCompletionString = engine.DefaultCompletionString\n\t\t\t};\n\t\t}\n\t\t\n\t\tpublic static CompletionDataList CreateProvider(string text, bool isCtrlSpace, params IUnresolvedAssembly[] references)\n\t\t{\n\t\t\treturn CreateProvider(text, isCtrlSpace, null, references);\n\t\t}\n\n\t\tstatic Tuple<ReadOnlyDocument, CSharpCompletionEngine> GetContent(string text, SyntaxTree syntaxTree)\n\t\t{\n\t\t\tvar doc = new ReadOnlyDocument(text);\n\t\t\tIProjectContent pctx = new CSharpProjectContent();\n\t\t\tpctx = pctx.AddAssemblyReferences(new [] { mscorlib.Value, systemAssembly.Value, systemCore.Value, systemXmlLinq.Value });\n\t\t\tvar unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\t\n\t\t\tpctx = pctx.AddOrUpdateFiles(unresolvedFile);\n\t\t\tvar cmp = pctx.CreateCompilation();\n\t\t\t\n\t\t\tvar mb = new DefaultCompletionContextProvider(doc, unresolvedFile);\n\t\t\tvar engine = new CSharpCompletionEngine (doc, mb, new TestFactory (new CSharpResolver (new CSharpTypeResolveContext (cmp.MainAssembly))), pctx, new CSharpTypeResolveContext (cmp.MainAssembly));\n\t\t\tengine.EolMarker = Environment.NewLine;\n\t\t\tengine.FormattingPolicy = FormattingOptionsFactory.CreateMono ();\n\t\t\treturn Tuple.Create (doc, engine);\n\t\t}\n\t\t\n\t\tstatic CompletionDataList CreateProvider (CSharpCompletionEngine engine, IDocument doc, TextLocation loc)\n\t\t{\n\t\t\tvar cursorPosition = doc.GetOffset (loc);\n\t\t\t\n\t\t\tvar data = engine.GetCompletionData (cursorPosition, true);\n\t\t\t\n\t\t\treturn new CompletionDataList {\n\t\t\t\tData = data,\n\t\t\t\tAutoCompleteEmptyMatch = engine.AutoCompleteEmptyMatch,\n\t\t\t\tAutoSelect = engine.AutoSelect,\n\t\t\t\tDefaultCompletionString = engine.DefaultCompletionString\n\t\t\t};\n\t\t}\n\t\t\n\t\tpublic static void CheckObjectMembers (CompletionDataList provider)\n\t\t{\n\t\t\tAssert.IsNotNull (provider.Find (\"Equals\"), \"Method 'System.Object.Equals' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"GetHashCode\"), \"Method 'System.Object.GetHashCode' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"GetType\"), \"Method 'System.Object.GetType' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ToString\"), \"Method 'System.Object.ToString' not found.\");\n\t\t}\n\t\t\n\t\tpublic static void CheckProtectedObjectMembers (CompletionDataList provider)\n\t\t{\n\t\t\tCheckObjectMembers (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"MemberwiseClone\"), \"Method 'System.Object.MemberwiseClone' not found.\");\n\t\t}\n\t\t\n\t\tpublic static void CheckStaticObjectMembers (CompletionDataList provider)\n\t\t{\n\t\t\tAssert.IsNotNull (provider.Find (\"Equals\"), \"Method 'System.Object.Equals' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ReferenceEquals\"), \"Method 'System.Object.ReferenceEquals' not found.\");\n\t\t}\n\t\t\n\t\tclass TestLocVisitor : DepthFirstAstVisitor\n\t\t{\n\t\t\tpublic List<Tuple<TextLocation, string>> Output = new List<Tuple<TextLocation, string>> ();\n\t\t\t\n\t\t\tpublic override void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)\n\t\t\t{\n\t\t\t\tOutput.Add (Tuple.Create (memberReferenceExpression.MemberNameToken.StartLocation, memberReferenceExpression.MemberName));\n\t\t\t}\n\t\t\t\n\t\t\tpublic override void VisitIdentifierExpression (IdentifierExpression identifierExpression)\n\t\t\t{\n\t\t\t\tOutput.Add (Tuple.Create (identifierExpression.StartLocation, identifierExpression.Identifier));\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Ignore(\"TODO\")]\n\t\t[Test]\n\t\tpublic void TestLoadAllTests ()\n\t\t{\n\t\t\tint found = 0;\n\t\t\tint missing = 0;\n\t\t\tint exceptions = 0;\n\t\t\tint i = 0;\n\t\t\tforeach (var file in Directory.EnumerateFiles (\"/Users/mike/work/mono/mcs/tests\", \"*.cs\")) {\n\t\t\t\tif (i++ > 2)\n\t\t\t\t\tbreak;\n\t\t\t\tif (i <= 2)\n\t\t\t\t\tcontinue;\n\t\t\t\tvar text = File.ReadAllText (file, Encoding.Default);\n\t\t\t\ttry {\n\t\t\t\t\tvar unit = new CSharpParser ().Parse (text, file);\n\t\t\t\t\t\n\t\t\t\t\tvar cnt = GetContent (text, unit);\n\t\t\t\t\t\n\t\t\t\t\tvar visitor = new TestLocVisitor ();\n\t\t\t\t\tunit.AcceptVisitor (visitor);\n\t\t\t\t\tforeach (var loc in visitor.Output) {\n\t\t\t\t\t\tvar provider = CreateProvider (cnt.Item2, cnt.Item1, loc.Item1);\n\t\t\t\t\t\tif (provider.Find (loc.Item2) != null) {\n\t\t\t\t\t\t\tfound++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmissing++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tConsole.WriteLine (\"Exception in:\" + file  + \"/\" + e);\n\t\t\t\t\texceptions++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tConsole.WriteLine (\"Found:\" + found);\n\t\t\tConsole.WriteLine (\"Missing:\" + missing);\n\t\t\tConsole.WriteLine (\"Exceptions:\" + exceptions);\n\t\t\tif (missing > 0)\n\t\t\t\tAssert.Fail ();\n\t\t}\n\t\t\t\n\t\t[Test]\n\t\tpublic void TestSimpleCodeCompletion ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class Test { public void TM1 () {} public void TM2 () {} public int TF1; }\nclass CCTest {\nvoid TestMethod ()\n{\n\tTest t;\n\t$t.$\n}\n}\n\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.AreEqual (7, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"TM1\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"TM2\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"TF1\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleInterfaceCodeCompletion ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"interface ITest { void TM1 (); void TM2 (); int TF1 { get; } }\nclass CCTest {\nvoid TestMethod ()\n{\n\tITest t;\n\t$t.$\n}\n}\n\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.AreEqual (7, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"TM1\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"TM2\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"TF1\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 399695 - Code completion not working with an enum in a different namespace\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug399695 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"namespace Other { enum TheEnum { One, Two } }\nnamespace ThisOne { \n        public class Test {\n                public Other.TheEnum TheEnum {\n                        set { }\n                }\n\n                public void TestMethod () {\n                        $TheEnum = $\n                }\n        }\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"Other.TheEnum\"), \"Other.TheEnum not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInnerEnum ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"class Other { \n\tpublic enum TheEnum { One, Two }\n\tpublic Other (TheEnum e) { }\n}\n\npublic class Test {\n\tpublic void TestMethod () {\n\t\t$new Other (O$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"Other.TheEnum\"), \"'Other.TheEnum' not found.\");\n\t\t}\n\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 318834 - autocompletion kicks in when inputting decimals\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug318834 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class T\n{\n        static void Main ()\n        {\n                $decimal foo = 0.$\n        }\n}\n\n\");\n\t\t\tAssert.IsFalse(provider.AutoSelect);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBug318834CaseB ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class T\n{\n        static void Main ()\n        {\n                $decimal foo = 0.0.$\n        }\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsTrue(provider.AutoSelect);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 321306 - Code completion doesn't recognize child namespaces\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug321306 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"namespace a\n{\n\tnamespace b\n\t{\n\t\tpublic class c\n\t\t{\n\t\t\tpublic static int hi;\n\t\t}\n\t}\n\t\n\tpublic class d\n\t{\n\t\tpublic d ()\n\t\t{\n\t\t\t$b.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t\tAssert.IsNotNull (provider.Find (\"c\"), \"class 'c' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 322089 - Code completion for indexer\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug322089 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class AClass\n{\n\tpublic int AField;\n\tpublic int BField;\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tAClass[] list = new AClass[0];\n\t\t$list[0].$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tfor (int i = 0; i < provider.Count; i++) {\n\t\t\t\tvar varname = provider [i];\n\t\t\t\tConsole.WriteLine (varname.CompletionText);\n\t\t\t}\n\t\t\tAssert.AreEqual (6, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"AField\"), \"field 'AField' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BField\"), \"field 'BField' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 323283 - Code completion for indexers offered by generic types (generics)\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug323283 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class AClass\n{\n\tpublic int AField;\n\tpublic int BField;\n}\n\nclass MyClass<T>\n{\n\tpublic T this[int i] {\n\t\tget {\n\t\t\treturn default (T);\n\t\t}\n\t}\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tMyClass<AClass> list = new MyClass<AClass> ();\n\t\t$list[0].$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (6, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"AField\"), \"field 'AField' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BField\"), \"field 'BField' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 323317 - Code completion not working just after a constructor\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug323317 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class AClass\n{\n\tpublic int AField;\n\tpublic int BField;\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\t$new AClass().$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (6, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"AField\"), \"field 'AField' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BField\"), \"field 'BField' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 325509 - Inaccessible methods displayed in autocomplete\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug325509 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class AClass\n{\n\tpublic int A;\n\tpublic int B;\n\t\n\tprotected int C;\n\tint D;\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tAClass a;\n\t\t$a.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"field 'A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"B\"), \"field 'B' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"C\"), \"field 'C' found, but shouldn't.\");\n\t\t\tAssert.IsNull (provider.Find (\"D\"), \"field 'D' found, but shouldn't.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 338392 - MD tries to use types when declaring namespace\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug338392 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"namespace A\n{\n        class C\n        {\n        }\n}\n\n$namespace A.$\n\");\n\t\t\tif (provider != null)\n\t\t\t\tAssert.AreEqual (0, provider.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 427284 - Code Completion: class list shows the full name of classes\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug427284 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"namespace TestNamespace\n{\n        class Test\n        {\n        }\n}\nclass TestClass\n{\n\tvoid Method ()\n\t{\n\t\t$TestNamespace.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"class 'Test' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 427294 - Code Completion: completion on values returned by methods doesn't work\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug427294 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class TestClass\n{\n\tpublic TestClass GetTestClass ()\n\t{\n\t}\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tTestClass a;\n\t\t$a.GetTestClass ().$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (5, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"GetTestClass\"), \"method 'GetTestClass' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 405000 - Namespace alias qualifier operator (::) does not trigger code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug405000 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"namespace A {\n\tclass Test\n\t{\n\t}\n}\n\nnamespace B {\n\tusing foo = A;\n\tclass C\n\t{\n\t\tpublic static void Main ()\n\t\t{\n\t\t\t$foo::$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"class 'Test' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 427649 - Code Completion: protected methods shown in code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug427649 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class BaseClass\n{\n\tprotected void ProtecedMember ()\n\t{\n\t}\n}\n\nclass C : BaseClass\n{\n\tpublic static void Main ()\n\t{\n\t\tBaseClass bc;\n\t\t$bc.$\n\t}\n}\n\");\n\t\t\t// protected members should not be displayed in this case.\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (4, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 427734 - Code Completion issues with enums\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug427734A ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"public class Test\n{\n\tpublic enum SomeEnum { a,b }\n\t\n\tpublic void Run ()\n\t{\n\t\t$Test.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (3, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckStaticObjectMembers (provider); // 2 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"SomeEnum\"), \"enum 'SomeEnum' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 427734 - Code Completion issues with enums\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug427734B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"public class Test\n{\n\tpublic enum SomeEnum { a,b }\n\t\n\tpublic void Run ()\n\t{\n\t\t$SomeEnum.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"a\"), \"enum member 'a' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"b\"), \"enum member 'b' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 431764 - Completion doesn't work in properties\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug431764 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"public class Test\n{\n\tint number;\n\tpublic int Number {\n\t\tset { $this.number = $ }\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsTrue (provider.Count > 0, \"provider should not be empty.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"value\"), \"Should contain 'value'\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 431797 - Code completion showing invalid options\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug431797A ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"public class Test\n{\n\tprivate List<string> strings;\n\t$public $\n}\");\n\t\t\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"strings\"), \"should not contain 'strings'\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 431797 - Code completion showing invalid options\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug431797B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"public class Test\n{\n\tpublic delegate string [] AutoCompleteHandler (string text, int pos);\n\tpublic void Method ()\n\t{\n\t\tTest t = new Test ();\n\t\t$t.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"AutoCompleteHandler\"), \"should not contain 'AutoCompleteHandler' delegate\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 432681 - Incorrect completion in nested classes\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug432681 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\n\nclass C {\n        public class D\n        {\n        }\n\n        public void Method ()\n        {\n                $C.D c = new $\n        }\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (\"D\", provider.DefaultCompletionString, \"Completion string is incorrect\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestGenericObjectCreation ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass List<T>\n{\n}\nclass Test{\n\tpublic void Method ()\n\t{\n\t\t$List<int> i = new $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsTrue (provider.Find (\"List<int>\") != null, \"List<int> not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 431803 - Autocomplete not giving any options\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug431803 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"public class Test\n{\n\tpublic string[] GetStrings ()\n\t{\n\t\t$return new $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"string[]\"), \"type string not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 434770 - No autocomplete on array types\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug434770 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class Test\n{\n\tpublic void AMethod ()\n\t{\n\t\tbyte[] buffer = new byte[1024];\n\t\t$buffer.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Length\"), \"property 'Length' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 439601 - Intellisense Broken For Partial Classes\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug439601 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nnamespace MyNamespace\n{\n\tpartial class FormMain\n\t{\n\t\tprivate void Foo()\n\t\t{\n\t\t\tBar();\n\t\t}\n\t\t\n\t\tprivate void Blah()\n\t\t{\n\t\t\tFoo();\n\t\t}\n\t}\n}\n\nnamespace MyNamespace\n{\n\tpublic partial class FormMain\n\t{\n\t\tpublic FormMain()\n\t\t{\n\t\t}\n\t\t\n\t\tprivate void Bar()\n\t\t{\n\t\t\t$this.$\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Blah\"), \"method 'Blah' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 1932 - [new resolver] fields don't show up unless prefixed with 'this.'\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug1932 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nnamespace MyNamespace\n{\n\tpartial class FormMain\n\t{\n\t\tint field1;\n\t\tstring field2;\n\t}\n}\n\nnamespace MyNamespace\n{\n\tpublic partial class FormMain\n\t{\n\t\tprivate void Bar()\n\t\t{\n\t\t\t$f$\n\t\t}\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"field1\"), \"field 'field1' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"field2\"), \"field 'field2' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 1967 - [new resolver] Intellisense doesn't work\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug1967 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nnamespace MyNamespace\n{\n\tpartial class FormMain\n\t{\n\t\tFormMain field1;\n\t\tstring field2;\n\t}\n}\n\nnamespace MyNamespace\n{\n\tpublic partial class FormMain\n\t{\n\t\tprivate void Bar()\n\t\t{\n\t\t\t$field1.$\n\t\t}\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"field1\"), \"field 'field1' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"field2\"), \"field 'field2' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 432434 - Code completion doesn't work with subclasses\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug432434 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n\n@\"public class Test\n{\n\tpublic class Inner\n\t{\n\t\tpublic void Inner1 ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic void Inner2 ()\n\t\t{\n\t\t}\n\t}\n\t\n\tpublic void Run ()\n\t{\n\t\tInner inner = new Inner ();\n\t\t$inner.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner1\"), \"Method inner1 not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner2\"), \"Method inner2 not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 432434A - Code completion doesn't work with subclasses\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug432434A ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n\n@\"    public class E\n        {\n                public class Inner\n                {\n                        public void Method ()\n                        {\n                                Inner inner = new Inner();\n                                $inner.$\n                        }\n                }\n        }\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Method\"), \"Method 'Method' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 432434B - Code completion doesn't work with subclasses\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug432434B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n\n@\"  public class E\n        {\n                public class Inner\n                {\n                        public class ReallyInner $: $\n                        {\n\n                        }\n                }\n        }\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"E\"), \"Class 'E' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner\"), \"Class 'Inner' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"ReallyInner\"), \"Class 'ReallyInner' found, but shouldn't.\");\n\t\t}\n\t\t\n\n\t\t/// <summary>\n\t\t/// Bug 436705 - code completion for constructors does not handle class name collisions properly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug436705 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"namespace System.Drawing {\n\tpublic class Point\n\t{\n\t}\n}\n\npublic class Point\n{\n}\n\nclass C {\n\n        public void Method ()\n        {\n                $System.Drawing.Point p = new $\n        }\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (\"System.Drawing.Point\", provider.DefaultCompletionString, \"Completion string is incorrect\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 439963 - Lacking members in code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug439963 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"public class StaticTest\n{\n\tpublic void Test1()\n\t{}\n\tpublic void Test2()\n\t{}\n\t\n\tpublic static StaticTest GetObject ()\n\t{\n\t}\n}\n\npublic class Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\t$StaticTest.GetObject ().$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test1\"), \"Method 'Test1' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test2\"), \"Method 'Test2' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"GetObject\"), \"Method 'GetObject' found, but shouldn't.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 441671 - Finalisers show up in code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug441671 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class TestClass\n{\n\tpublic TestClass (int i)\n\t{\n\t}\n\tpublic void TestMethod ()\n\t{\n\t}\n\tpublic ~TestClass ()\n\t{\n\t}\n}\n\nclass AClass\n{\n\tvoid AMethod ()\n\t{\n\t\tTestClass c;\n\t\t$c.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (5, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNull (provider.Find (\".dtor\"), \"destructor found - but shouldn't.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 444110 - Code completion doesn't activate\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug444110 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"using System;\nusing System.Collections.Generic;\n\nnamespace System.Collections.Generic {\n\t\n\tpublic class TemplateClass<T>\n\t{\n\t\tpublic T TestField;\n\t}\n}\n\nnamespace CCTests\n{\n\t\n\tpublic class Test\n\t{\n\t\tpublic TemplateClass<int> TemplateClass { get; set; }\n\t}\n\t\n\tclass MainClass\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tTest t = new Test();\n\t\t\t$t.TemplateClass.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (5, provider.Count);\n\t\t\tCodeCompletionBugTests.CheckObjectMembers (provider); // 4 from System.Object\n\t\t\tAssert.IsNotNull (provider.Find (\"TestField\"), \"field 'TestField' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 460234 - Invalid options shown when typing 'override'\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug460234 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class TestMe : System.Object\n{\n\t$override $\n\n\tpublic override string ToString ()\n\t{\n\t\treturn null; \n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (2, provider.Count);\n\t\t\tAssert.IsNull (provider.Find (\"Finalize\"), \"method 'Finalize' found, but shouldn't.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"GetHashCode\"), \"method 'GetHashCode' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Equals\"), \"method 'Equals' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 457003 - code completion shows variables out of scope\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug457003 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass A\n{\n\tpublic void Test ()\n\t{\n\t\tif (true) {\n\t\t\tA st = null;\n\t\t}\n\t\t\n\t\tif (true) {\n\t\t\tint i = 0;\n\t\t\t$st.$\n\t\t}\n\t}\n}\n\");\n\t\t\tif (provider != null)\n\t\t\t\tAssert.IsTrue (provider.Count == 0, \"variable 'st' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 457237 - code completion doesn't show static methods when setting global variable\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug457237 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass Test\n{\n\tpublic static double Val = 0.5;\n}\n\nclass Test2\n{\n\t$double dd = Test.$\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Val\"), \"field 'Val' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 459682 - Static methods/properties don't show up in subclasses\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug459682 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"public class BaseC\n{\n\tpublic static int TESTER;\n}\npublic class Child : BaseC\n{\n\tpublic Child()\n\t{\n\t\t$Child.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TESTER\"), \"field 'TESTER' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 466692 - Missing completion for return/break keywords after yield\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug466692 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class TestMe \n{\n\tpublic int Test ()\n\t{\n\t\t$yield $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (2, provider.Count);\n\t\t\tAssert.IsNotNull (provider.Find (\"break\"), \"keyword 'break' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"return\"), \"keyword 'return' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 467507 - No completion of base members inside explicit events\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug467507 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nusing System;\n\nclass Test\n{\n\tpublic void TestMe ()\n\t{\n\t}\n\t\n\tpublic event EventHandler TestEvent {\n\t\tadd {\n\t\t\t$\n\t\t}\n\t\tremove {\n\t\t\t\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMe\"), \"method 'TestMe' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"value\"), \"keyword 'value' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 444643 - Extension methods don't show up on array types\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug444643 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nusing System;\nusing System.Collections.Generic;\n\n\tstatic class ExtensionTest\n\t{\n\t\tpublic static bool TestExt<T> (this IList<T> list, T val)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tclass MainClass\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\t$args.$\n\t\t}\n\t}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestExt\"), \"method 'TestExt' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 471935 - Code completion window not showing in MD1CustomDataItem.cs\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug471935 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\npublic class AClass\n{\n\tpublic AClass Test ()\n\t{\n\t\tif (true) {\n\t\t\tAClass data;\n\t\t\t$data.$\n\t\t\treturn data;\n\t\t} else if (false) {\n\t\t\tAClass data;\n\t\t\treturn data;\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 471937 - Code completion of 'new' showing invorrect entries \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug471937()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider(\n@\"\nclass B\n{\n}\n\nclass A\n{\n\tpublic void Test()\n\t{\n\t\tint i = 5;\n\t\ti += 5;\n\t\t$A a = new $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found.\");\n\t\t\tAssert.AreEqual (\"A\", provider.DefaultCompletionString);\n//\t\t\tAssert.IsNull (provider.Find (\"B\"), \"class 'B' found, but shouldn'tj.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2268 - Potential omission in code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2268 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\npublic class Outer\n{\n    static int value = 5;\n\n    class Inner\n    {\n        void Method ()\n        {\n            $v$\n        }\n    }\n}\n\", provider => Assert.IsNotNull(provider.Find(\"value\"), \"field 'value' not found.\"));\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2295 - [New Resolver] 'new' completion doesn't select the correct class name \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2295 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass A\n{\n\tpublic void Test()\n\t{\n\t\tA a;\n\t\t$a = new $\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found.\");\n\t\t\t\tAssert.AreEqual (\"A\", provider.DefaultCompletionString);\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2061 - Typing 'new' in a method all does not offer valid completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2061 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass A\n{\n\tvoid CallTest(A a)\n\t{\n\t}\n\tpublic void Test()\n\t{\n\t\t$CallTest(new $\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found.\");\n\t\t\t\tAssert.AreEqual (\"A\", provider.DefaultCompletionString);\n\t\t\t});\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestBug2061Case2 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass A\n{\n\tvoid CallTest(int i, string s, A a)\n\t{\n\t}\n\n\tpublic void Test()\n\t{\n\t\t$CallTest(5, \"\"\"\", new $\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found.\");\n\t\t\t\tAssert.AreEqual (\"A\", provider.DefaultCompletionString);\n\t\t\t});\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2788 - Locals do not show up inside the 'for' statement context\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2788 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass A\n{\n\tpublic void Test()\n\t{\n\t\t\n\t\tvar foo = new byte[100];\n\t\t$for (int i = 0; i < f$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"foo\"), \"'foo' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"i\"), \"'i' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2800 - Finalize is offered as a valid completion target\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2800 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass A\n{\n\tpublic void Test()\n\t{\n\t\t$this.$\n\t}\n}\n\", provider => Assert.IsNull(provider.Find(\"Finalize\"), \"'Finalize' found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBug2800B ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass A\n{\n\t$public override $\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ToString\"), \"'ToString' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"Finalize\"), \"'Finalize' found.\");\n\t\t\t});\n\t\t}\n\t\t[Test]\n\t\tpublic void TestOverrideCompletion ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"using System;\n\nclass Base\n{\n\n\tpublic virtual int Property { get;}\n\tpublic virtual int Method () { }\n\tpublic virtual event EventHandler Event;\n\tpublic virtual int this[int i] { get { } }\n}\n\n\nclass A : Base\n{\n\t$public override $\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Property\"), \"'Property' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Method\"), \"'Method' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Event\"), \"'Event' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ToString\"), \"'Event' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"GetHashCode\"), \"'GetHashCode' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Equals\"), \"'Equals' not found.\");\n\t\t\t\tAssert.AreEqual (7, provider.Count);\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3370 -MD ignores member hiding\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3370 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass A\n{\n\t$public override $\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ToString\"), \"'ToString' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"Finalize\"), \"'Finalize' found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2793 - op_Equality should not be offered in the completion list\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test2793 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nusing System;\n\npublic class MyClass\n{\n    public class A\n    {\n        public event EventHandler MouseClick;\n    }\n\n    public class B : A\n    {\n        public new event EventHandler MouseClick;\n    }\n\n    public class C : B\n    {\n        public new void MouseClick ()\n        {\n        }\n    }\n\n    static public void Main ()\n    {\n        C myclass = new C ();\n        $myclass.$\n    }\n}\", provider => Assert.AreEqual(1, provider.Data.Count(c => c.DisplayText == \"MouseClick\")));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2798 - Unnecessary namespace qualification being prepended\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test2798 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nusing System;\n\nnamespace Foobar\n{\n    class MainClass\n    {\n        public enum Foo\n        {\n            Value1,\n            Value2\n        }\n\n        public class Test\n        {\n            Foo Foo {\n                get; set;\n            }\n\n            public static void Method (Foo foo)\n            {\n                $if (foo == F$\n            }\n        }\n    }\n}\n\", provider => {\n\t\t\t\tAssert.IsNull (provider.Find (\"MainClass.Foo\"), \"'MainClass.Foo' found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"'Foo' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Foo.Value1\"), \"'Foo.Value1' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Foo.Value2\"), \"'Foo.Value2' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2799 - No completion offered when declaring fields in a class\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2799 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"namespace Foobar\n{\n    class MainClass\n    {\n        public enum Foo\n        {\n            Value1,\n            Value2\n        }\n    }\n\n\n    public class Second\n    {\n        $MainClass.$\n    }\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"Foo\"), \"'Foo' not found.\"));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3371 - MD intellisense ignores namespace aliases\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3371 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"namespace A\n{\n    using Base = B.Color;\n\n    class Color\n    {\n        protected Base Base\n        {\n            get { return Base.Blue; }\n        }\n\n        protected Base NewBase {\n            get {\n                $return Base.$\n            }\n        }\n\n        public static void Main ()\n        {\n        }\n    }\n}\n\nnamespace B\n{\n    public struct Color\n    {\n        public static Color Blue = new Color ();\n\n        public static Color From (int i)\n        {\n            return new Color ();\n        }\n    }\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Blue\"), \"'Blue' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"From\"), \"'From' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNewInConstructor ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nclass CallTest\n{\n\tpublic CallTest(int i, string s, A a)\n\t{\n\n\t}\n}\n\nclass A\n{\n\n\n\tpublic void Test()\n\t{\n\t\t$new CallTest(5, \"\"\"\", new $\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found.\");\n\t\t\t\tAssert.AreEqual (\"A\", provider.DefaultCompletionString);\n\t\t\t});\n\t\t}\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 473686 - Constants are not included in code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug473686 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nclass ATest\n{\n\tconst int TESTCONST = 0;\n\n\tstatic void Test()\n\t{\n\t\t$$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"TESTCONST\"), \"constant 'TESTCONST' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 473849 - Classes with no visible constructor shouldn't appear in \"new\" completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug473849 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass TestB\n{\n\tprotected TestB()\n\t{\n\t}\n}\n\nclass TestC : TestB\n{\n\tinternal TestC ()\n\t{\n\t}\n}\n\nclass TestD : TestB\n{\n\tpublic TestD ()\n\t{\n\t}\n}\n\nclass TestE : TestD\n{\n\tprotected TestE ()\n\t{\n\t}\n}\n\nclass Test : TestB\n{\n\tvoid TestMethod ()\n\t{\n\t\t$TestB test = new $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNull (provider.Find (\"TestE\"), \"class 'TestE' found, but shouldn't.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestD\"), \"class 'TestD' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestC\"), \"class 'TestC' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestB\"), \"class 'TestB' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"class 'Test' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 474199 - Code completion not working for a nested class\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug474199A ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class InnerTest\n{\n\tpublic class Inner\n\t{\n\t\tpublic void Test()\n\t\t{\n\t\t}\n\t}\n}\n\npublic class ExtInner : InnerTest\n{\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tvar inner = new ExtInner.Inner ();\n\t\t$inner.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3438 - [New Resolver] Local var missing in code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test3438 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nusing System;\nusing System.Text;\n\nclass C\n{\n\tvoid GetElementXml (int indent)\n\t{\n\t\tStringBuilder sb = new StringBuilder ();\n\t\tif (indent == 0)\n\t\t\tsb.Append (\"\" xmlns:android=\\\"\"http://schemas.android.com/apk/res/android\\\"\"\"\");\n\t\t\n\t\tif (indent != 0) {\n\t\t\tstring data;\n\t\t\t$d$\n\t\t}\n\t}\t\n}\", provider => Assert.IsNotNull(provider.Find(\"data\"), \"'data' not found.\"));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3436 - [New Resolver] Type missing in return type completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test3436 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nnamespace A \n{\n\tpublic class SomeClass {}\n}\n\nnamespace Foo \n{\n\tpublic partial class Bar {}\n}\n\nnamespace Foo \n{\n\tusing A;\n\tpublic partial class Bar {\n\t\t$S$\n\t}\n}\n\", provider => Assert.IsNotNull(provider.Find(\"SomeClass\"), \"'SomeClass' not found.\"));\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 474199 - Code completion not working for a nested class\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug474199B ()\n\t\t{\n\t\t\tvar provider = ParameterCompletionTests.CreateProvider (\n@\"\npublic class InnerTest\n{\n\tpublic class Inner\n\t{\n\t\tpublic Inner(string test)\n\t\t{\n\t\t}\n\t}\n}\n\npublic class ExtInner : InnerTest\n{\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\t$new ExtInner.Inner ($\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.AreEqual (1, provider.Count, \"There should be one overload\");\n\t\t\tAssert.AreEqual (1, provider.GetParameterCount (0), \"Parameter 'test' should exist\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 350862 - Autocomplete bug with enums\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug350862 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic enum MyEnum {\n\tA,\n\tB,\n\tC\n}\n\npublic class Test\n{\n\tMyEnum item;\n\tpublic void Method (MyEnum val)\n\t{\n\t\t$item = $\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"val\"), \"parameter 'val' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 470954 - using System.Windows.Forms is not honored\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug470954 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class Control\n{\n\tpublic MouseButtons MouseButtons { get; set; }\n}\n\npublic enum MouseButtons {\n\tLeft, Right\n}\n\npublic class SomeControl : Control\n{\n\tpublic void Run ()\n\t{\n\t\t$MouseButtons m = MouseButtons.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"Left\"), \"enum 'Left' not found\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Right\"), \"enum 'Right' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 470954 - using System.Windows.Forms is not honored\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug470954_Bis ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class Control\n{\n\tpublic string MouseButtons { get; set; }\n}\n\npublic enum MouseButtons {\n\tLeft, Right\n}\n\npublic class SomeControl : Control\n{\n\tpublic void Run ()\n\t{\n\t\t$int m = MouseButtons.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNull (provider.Find (\"Left\"), \"enum 'Left' found\");\n\t\t\tAssert.IsNull (provider.Find (\"Right\"), \"enum 'Right' found\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 487228 - No intellisense for implicit arrays\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug487228 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class Test\n{\n\tpublic void Method ()\n\t{\n\t\tvar v = new [] { new Test () };\n\t\t$v[0].$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"Method\"), \"method 'Method' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 487218 - var does not work with arrays\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug487218 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class Test\n{\n\tpublic void Method ()\n\t{\n\t\tvar v = new Test[] { new Test () };\n\t\t$v[0].$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"Method\"), \"method 'Method' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 487206 - Intellisense not working\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug487206 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass CastByExample\n{\n\tstatic T Cast<T> (object obj, T type)\n\t{\n\t\treturn (T) obj;\n\t}\n\t\n\tstatic void Main ()\n\t{\n\t\tvar typed = Cast (o, new { Foo = 5 });\n\t\t$typed.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"property 'Foo' not found\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 487203 - Extension methods not working\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug487203 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\n\nclass Program \n{\n\tpublic void Foo ()\n\t{\n\t\tProgram[] prgs;\n\t\tforeach (var prg in (from Program p in prgs select p)) {\n\t\t\t$prg.$\n\t\t}\n\t}\n}\t\t\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 491020 - Wrong typeof intellisense\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug491020 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class EventClass<T>\n{\n\tpublic class Inner {}\n\tpublic delegate void HookDelegate (T del);\n\tpublic void Method ()\n\t{}\n}\n\npublic class Test\n{\n\tpublic static void Main ()\n\t{\n\t\t$EventClass<int>.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner\"), \"class 'Inner' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"HookDelegate\"), \"delegate 'HookDelegate' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Method\"), \"method 'Method' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 491020 - Wrong typeof intellisense\n\t\t/// It's a different case when the class is inside a namespace.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug491020B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\n\nnamespace A {\n\tpublic class EventClass<T>\n\t{\n\t\tpublic class Inner {}\n\t\tpublic delegate void HookDelegate (T del);\n\t\tpublic void Method ()\n\t\t{}\n\t}\n}\n\npublic class Test\n{\n\tpublic static void Main ()\n\t{\n\t\t$A.EventClass<int>.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Inner\"), \"class 'Inner' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"HookDelegate\"), \"delegate 'HookDelegate' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Method\"), \"method 'Method' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 491019 - No intellisense for recursive generics\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug491019 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic abstract class NonGenericBase\n{\n\tpublic abstract int this[int i] { get; }\n}\n\npublic abstract class GenericBase<T> : NonGenericBase where T : GenericBase<T>\n{\n\tT Instance { get { return default (T); } }\n\n\tpublic void Foo ()\n\t{\n\t\t$Instance.Instance.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Instance\"), \"property 'Instance' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"this\"), \"'this' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\n\t\t/// <summary>\n\t\t/// Bug 429034 - Class alias completion not working properly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug429034 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nusing Path = System.IO.Path;\n\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\t$$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Path\"), \"class 'Path' not found.\");\n\t\t}\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 429034 - Class alias completion not working properly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug429034B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nusing Path = System.IO.Path;\n\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\t$Path.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"DirectorySeparatorChar\"), \"method 'PathTest' not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInvalidCompletion ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass TestClass\n{\n\tpublic void TestMethod ()\n\t{\n\t}\n}\n\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tTestClass tc;\n\t\t$tc.garbage.$\n\t}\n}\n\");\n\t\t\tif (provider != null)\n\t\t\t\tAssert.IsNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 510919 - Code completion does not show interface method when not using a local var \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug510919 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class Foo : IFoo \n{\n\tpublic void Bar () { }\n}\n\npublic interface IFoo \n{\n\tvoid Bar ();\n}\n\npublic class Program\n{\n\tstatic IFoo GiveMeFoo () \n\t{\n\t\treturn new Foo ();\n\t}\n\n\tstatic void Main ()\n\t{\n\t\t$GiveMeFoo ().$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t/// <summary>\n\t\t/// Bug 538208 - Go to declaration not working over a generic method...\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug538208 ()\n\t\t{\n\t\t\t// We've to test 2 expressions for this bug. Since there are 2 ways of accessing\n\t\t\t// members.\n\t\t\t// First: the identifier expression\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nclass MyClass\n{\n\tpublic string Test { get; set; }\n\t\n\tT foo<T>(T arg)\n\t{\n\t\treturn arg;\n\t}\n\n\tpublic void Main(string[] args)\n\t{\n\t\tvar myObject = foo<MyClass>(new MyClass());\n\t\t$myObject.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"property 'Test' not found.\");\n\t\t\t\n\t\t\t// now the member reference expression \n\t\t\tprovider = CreateCtrlSpaceProvider (\n@\"\nclass MyClass2\n{\n\tpublic string Test { get; set; }\n\t\n\tT foo<T>(T arg)\n\t{\n\t\treturn arg;\n\t}\n\n\tpublic void Main(string[] args)\n\t{\n\t\tvar myObject = this.foo<MyClass2>(new MyClass2());\n\t\t$myObject.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"property 'Test' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 542976 resolution problem\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug542976 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass KeyValuePair<S, T>\n{\n\tpublic S Key { get; set;}\n\tpublic T Value { get; set;}\n}\n\nclass TestMe<T> : System.Collections.Generic.IEnumerable<T>\n{\n\tpublic System.Collections.Generic.IEnumerator<T> GetEnumerator ()\n\t{\n\t\tthrow new System.NotImplementedException();\n\t}\n\n\tSystem.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()\n\t{\n\t\tthrow new System.NotImplementedException();\n\t}\n}\n\nnamespace TestMe \n{\n\tclass Bar\n\t{\n\t\tpublic int Field;\n\t}\n\t\n\tclass Test\n\t{\n\t\tvoid Foo (TestMe<KeyValuePair<Bar, int>> things)\n\t\t{\n\t\t\tforeach (var thing in things) {\n\t\t\t\t$thing.Key.$\n\t\t\t}\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Field\"), \"field 'Field' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 545189 - C# resolver bug\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug545189A ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class A<T>\n{\n\tpublic class B\n\t{\n\t\tpublic T field;\n\t}\n}\n\npublic class Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tA<Foo>.B baz = new A<Foo>.B ();\n\t\t$baz.field.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 549864 - Intellisense does not work properly with expressions\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug549864 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\ndelegate T MyFunc<S, T> (S t);\n\nclass TestClass\n{\n\tpublic string Value {\n\t\tget;\n\t\tset;\n\t}\n\t\n\tpublic static object GetProperty<TType> (MyFunc<TType, object> expression)\n\t{\n\t\treturn null;\n\t}\n\tprivate static object ValueProperty = TestClass.GetProperty<TestClass> ($x => x.$);\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Value\"), \"property 'Value' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 550185 - Intellisence for extension methods\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug550185 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic interface IMyinterface<T> {\n\tT Foo ();\n}\n\npublic static class ExtMethods {\n\tpublic static int MyCountMethod(this IMyinterface<string> i)\n\t{\n\t\treturn 0;\n\t}\n}\n\nclass TestClass\n{\n\tvoid Test ()\n\t{\n\t\tIMyinterface<int> test;\n\t\t$test.$\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"MyCountMet2hod\"), \"method 'MyCountMethod' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t\t\n\t\t/// <summary>\n\t\t/// Bug 553101 – Enum completion does not use type aliases\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug553101 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nnamespace Some.Type \n{\n\tpublic enum Name { Foo, Bar }\n}\n\nnamespace Test\n{\n\tusing STN = Some.Type.Name;\n\t\n\tpublic class Main\n\t{\n\t\tpublic void TestMe ()\n\t\t{\n\t\t\t$STN foo = $\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t}\n\t\t\t\n\t\t/// <summary>\n\t\t/// Bug 555523 - C# code completion gets confused by extension methods with same names as properties\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug555523A ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass A\n{\n\tpublic int AA { get; set; }\n}\n\nclass B\n{\n\tpublic int BB { get; set; }\n}\n\nstatic class ExtMethod\n{\n\tpublic static A Extension (this MyClass myClass)\n\t{\n\t\treturn null;\n\t}\n}\n\nclass MyClass\n{\n\tpublic B Extension {\n\t\tget;\n\t\tset;\n\t}\n}\n\nclass MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tMyClass myClass;\n\t\t$myClass.Extension ().$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"AA\"), \"property 'AA' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 555523 - C# code completion gets confused by extension methods with same names as properties\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug555523B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass A\n{\n\tpublic int AA { get; set; }\n}\n\nclass B\n{\n\tpublic int BB { get; set; }\n}\n\nstatic class ExtMethod\n{\n\tpublic static A Extension (this MyClass myClass)\n\t{\n\t\treturn null;\n\t}\n}\n\nclass MyClass\n{\n\tpublic B Extension {\n\t\tget;\n\t\tset;\n\t}\n}\n\nclass MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tMyClass myClass;\n\t\t$myClass.Extension.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BB\"), \"property 'BB' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 561964 - Wrong type in tooltip when there are two properties with the same name\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug561964 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\ninterface A1 {\n\tint A { get; }\n}\ninterface A2 {\n\tint B { get; }\n}\n\ninterface IFoo {\n\tA1 Bar { get; }\n}\n\nclass Foo : IFoo\n{\n\tA1 IFoo.Bar { get { return null; } }\n\tpublic A2 Bar { get { return null; } }\n\n\tpublic static int Main (string[] args)\n\t{\n\t\t$new Foo().Bar.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"B\"), \"property 'B' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 568204 - Inconsistency in resolution\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug568204 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic class Style \n{\n\tpublic static Style TestMe ()\n\t{\n\t\treturn new Style ();\n\t}\n\t\n\tpublic void Print ()\n\t{\n\t\tSystem.Console.WriteLine (\"\"Hello World!\"\");\n\t}\n}\n\npublic class Foo\n{\n\tpublic Style Style { get; set;} \n\t\n\tpublic void Bar ()\n\t{\n\t\t$Style.TestMe ().$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Print\"), \"method 'Print' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 577225 - Inconsistent autocomplete on returned value of generic method.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug577225 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nusing Foo;\n\t\nnamespace Foo \n{\n\tpublic class FooBar\n\t{\n\t\tpublic void Bar ()\n\t\t{\n\t\t}\n\t}\n}\n\nnamespace Other \n{\n\tpublic class MainClass\n\t{\n\t\tpublic static T Test<T> ()\n\t\t{\n\t\t\treturn default (T);\n\t\t}\n\t\t\t\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\t$Test<FooBar> ().$\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 582017 - C# Generic Type Constraints\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug582017 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass Bar\n{\n\tpublic void MyMethod ()\n\t{\n\t}\n}\n\nclass Foo\n{\n\tpublic static void Test<T> (T theObject) where T : Bar\n\t{\n\t\t$theObject.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"MyMethod\"), \"method 'MyMethod' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 586304 - Intellisense does not show several linq extenion methods when using nested generic type\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug586304 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nusing System;\nusing System.Collections.Generic;\n\npublic static class ExtMethods\n{\n\tpublic static bool IsEmpty<T> (this IEnumerable<T> v)\n\t{\n\t\treturn !v.Any ();\n\t}\n}\n\npublic class Lazy<T> {}\n\npublic class IntelliSenseProblems\n{\n    public IEnumerable<Lazy<T>> GetLazies<T>()\n    {\n        return Enumerable.Empty<Lazy<T>>();\n    }\n}\n\npublic class Test\n{ \n   void test ()\n   {\n\t\tvar values = new IntelliSenseProblems ();\n\t\t$var x = values.GetLazies<string> ().$\n   }\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"IsEmpty\"), \"method 'IsEmpty' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 586304 - Intellisense does not show several linq extenion methods when using nested generic type\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug586304B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic delegate S Func<T, S> (T t);\n\npublic class Lazy<T> {\n\tpublic virtual bool IsLazy ()\n\t{\n\t\treturn true;\n\t}\n}\n\nstatic class ExtMethods\n{\n\tpublic static T Where<T>(this Lazy<T> t, Func<T, bool> pred)\n\t{\n\t\treturn default (T);\n\t}\n}\n\nclass MyClass\n{\n\tpublic void Test()\n\t{\n\t\tLazy<Lazy<MyClass>> c; \n\t\t$c.Where (x => x.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Test\"), \"method 'Test' found, but shouldn't.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"IsLazy\"), \"method 'IsLazy' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 587543 - Intellisense ignores interface constraints\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug587543 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\ninterface ITest\n{\n\tvoid Foo ();\n}\n\nclass C\n{\n\tvoid Test<T> (T t) where T : ITest\n\t{\n\t\t$t.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t}\n\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 587549 - Intellisense does not work with override constraints\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug587549 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\npublic interface ITest\n{\n\tvoid Bar();\n}\n\npublic class BaseClass\n{\n\tpublic void Foo ()\n\t{}\n}\n\npublic abstract class Printer\n{\n\tpublic abstract void Print<T, U> (object x) where T : BaseClass, U where U : ITest;\n}\n\npublic class PrinterImpl : Printer\n{\n\tpublic override void Print<A, B> (object x)\n\t{\n\t\tA a;\n\t\t$a.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 588223 - Intellisense does not recognize nested generics correctly.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug588223 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass Lazy<T> { public void Foo () {} }\nclass Lazy<T, S> { public void Bar () {} }\n\nclass Test\n{\n\tpublic object Get ()\n\t{\n\t\treturn null;\n\t}\n\t\n\tpublic Lazy<T> Get<T> ()\n\t{\n\t\treturn null;\n\t}\n\n\tpublic Lazy<T, TMetaDataView> Get<T, TMetaDataView> ()\n\t{\n\t\treturn null;\n\t}\n\t\n\tpublic Test ()\n\t{\n\t\tTest t = new Test ();\n\t\tvar bug = t.Get<string, string> ();\n\t\t$bug.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 592120 - Type resolver bug with this.Property[]\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug592120 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\n\ninterface IBar\n{\n\tvoid Test ();\n}\n\nclass Foo\n{\n\tpublic IBar[] X { get; set; }\n\n\tpublic void Bar ()\n\t{\n\t\tvar y = this.X;\n\t\t$y.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Test\"), \"method 'Test' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 576354 - Type inference failure\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug576354 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\ndelegate T Func<S, T> (S s);\n\nclass Foo\n{\n\tstring str;\n\t\n\tpublic Foo (string str)\n\t{\n\t\tthis.str = str;\n\t}\n\t\n\tpublic void Bar () \n\t{\n\t\tSystem.Console.WriteLine (str);\n\t}\n}\n\nclass MyTest\n{\n\tstatic T Test<T> (Func<string, T> myFunc)\n\t{\n\t\treturn myFunc (\"\"Hello World\"\");\n\t}\n\t\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar result = Test (str => new Foo (str));\n\t\t$result.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 534680 - LINQ keywords missing from Intellisense\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug534680 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$from str in args $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"select\"), \"keyword 'select' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 610006 - Intellisense gives members of return type of functions even when that function isn't invoked\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug610006 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nclass MainClass\n{\n\tpublic MainClass FooBar ()\n\t{\n\t}\n\t\n\tpublic void Test ()\n\t{\n\t\t$FooBar.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"FooBar\"), \"method 'FooBar' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 614045 - Types hidden by members are not formatted properly by ambience\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug614045 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"\nnamespace A\n{\n\tenum Foo\n\t{\n\t\tOne,\n\t\tTwo,\n\t\tThree\n\t}\n}\n\nnamespace B\n{\n\tusing A;\n\t\n\tpublic class Baz\n\t{\n\t\tpublic string Foo;\n\t\t\n\t\tvoid Test (Foo a)\n\t\t{\n\t\t\t$switch (a) {\n\t\t\tcase $\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"enum 'Foo' found, but shouldn't.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"A.Foo\"), \"enum 'A.Foo' not found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug614045_IndexerCase ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n\t\t\t\t@\"\nnamespace A\n{\n\tenum Foo\n\t{\n\t\tOne,\n\t\tTwo,\n\t\tThree\n\t}\n}\n\nnamespace B\n{\n\tusing A;\n\t\n\tpublic class Baz\n\t{\n\t\tpublic string Foo;\n\t\t\n\t\tint this[Foo b] {\n\t\t\tget {}\n\t\t\tset {\n\t\t\t\t$switch (b) {\n\t\t\t\tcase $\n\t\t\t}\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"enum 'Foo' found, but shouldn't.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"A.Foo\"), \"enum 'A.Foo' not found.\");\n\t\t}\n\t\t/// <summary>\n\t\t/// Bug 615992 - Intellisense broken when calling generic method.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug615992 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"public delegate void Act<T> (T t);\n\npublic class Foo\n{\n\tpublic void Bar ()\n\t{\n\t}\n}\n\nclass TestBase\n{\n\tprotected void Method<T> (Act<T> action)\n\t{\n\t}\n}\n\nclass Test : TestBase\n{\n\tpublic Test ()\n\t{\n\t\t$Method<Foo> (f => f.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"method 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 625064 - Internal classes aren't suggested for completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug625064 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"class Foo \n{\n\tclass Bar { }\n\t$List<$\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"class 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 631875 - No Intellisense for arrays\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug631875 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"class C\n{\n\tstatic void Main ()\n\t{\n\t\tvar objects = new[] { new { X = (object)null }};\n\t\t$objects[0].$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"X\"), \"property 'X' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 632228 - Wrong var inference\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug632228 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nclass C {\n\tpublic void FooBar () {}\n\tpublic static void Main ()\n\t{\n\t\tvar thingToTest = new[] { new C (), 22, new object(), string.Empty, null };\n\t\t$thingToTest[0].$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"FooBar\"), \"method 'FooBar' found, but shouldn't.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 632696 - No intellisense for constraints\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug632696 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nclass Program\n{\n\tvoid Foo ()\n\t{\n\t}\n\n\tstatic void Foo<T> () where T : Program\n\t{\n\t\tvar s = new[] { default(T) };\n\t\t$s[0].$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestCommentsWithWindowsEol ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\"class TestClass\\r\\n{\\r\\npublic static void Main (string[] args) {\\r\\n// TestComment\\r\\n$args.$\\r\\n}\\r\\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ToString\"), \"method 'ToString' not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestGhostEntryBug ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\nusing System.IO;\n\nclass TestClass\n{\n\tpublic Path Path {\n\t\tget;\n\t\tset;\n\t}\n\t\n\tvoid Test ()\n\t{\n\t\t$$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"System.IO.Path\"), \"'System.IO.Path' found but shouldn't.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Path\"), \"property 'Path' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 648562 – Abstract members are allowed by base call\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug648562 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\n\nabstract class A\n{\n    public abstract void Foo<T> (T type);\n}\n\nclass B : A\n{\n    public override void Foo<U> (U type)\n    {\n        $base.$\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"method 'Foo' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 633767 - Wrong intellisense for simple lambda\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug633767 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\n\npublic class E\n{\n\tpublic int Foo { get; set; }\n}\n\npublic class C\n{\n\tdelegate void D<T> (T t);\n\t\n\tstatic T M<T> (T t, D<T> a)\n\t{\n\t\treturn t;\n\t}\n\n\tstatic void MethodArg (object o)\n\t{\n\t}\n\n\tpublic static int Main ()\n\t{\n\t\tD<object> action = l => Console.WriteLine (l);\n\t\tvar b = M (new E (), action);\n\t\t$b.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"property 'Foo' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 616208 - Renaming a struct/class is renaming too much\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug616208 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\n\nnamespace System \n{\n\tpublic class Foo { public int Bar; };\n}\n\nnamespace test.Util\n{\n\tpublic class Foo { public string x; }\n}\n\nnamespace Test\n{\n\tpublic class A\n\t{\n\t\tpublic Foo X;\n\t\t\n\t\tpublic A ()\n\t\t{\n\t\t\t$X.$\n\t\t}\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"property 'Bar' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 668135 - Problems with \"new\" completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug668135a ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"public class A\n{\n\tpublic A ()\n\t{\n\t\tstring test;\n\t\t$Console.WriteLine (test = new $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"string\"), \"class 'string' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 668453 - var completion infers var type too eagerly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug668453 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"public class Test\n{\n\tprivate void FooBar ()\n\t{\n\t\t$var str = new $\n\t\tFooBar ();\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"FooBar\"), \"method 'FooBar' found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 669285 - Extension method on T[] shows up on T\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug669285 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"static class Ext\n{\n\tpublic static void Foo<T> (this T[] t)\n\t{\n\t}\n}\n\npublic class Test<T>\n{\n\tpublic void Foo ()\n\t{\n\t\tT t;\n\t\t$t.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Foo\"), \"method 'Foo' found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug669285B ()\n\t\t{\n\t\t\tvar provider = CreateCtrlSpaceProvider (\n@\"static class Ext\n{\n\tpublic static void Foo<T> (this T[] t)\n\t{\n\t}\n}\n\npublic class Test<T>\n{\n\tpublic void Foo ()\n\t{\n\t\tT[] t;\n\t\t$t.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 669818 - Autocomplete missing for new nested class\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug669818 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\npublic class Foo\n{\n    public class Bar\n    {\n    }\n\tpublic static void FooBar () {}\n}\nclass TestNested\n{\n    public static void Main (string[] args)\n    {\n        $new Foo.$\n    }\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Bar\"), \"class 'Bar' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"FooBar\"), \"method 'FooBar' found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 674514 - foreach value should not be in the completion list\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug674514 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$foreach (var arg in $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"args\"), \"parameter 'args' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"arg\"), \"variable 'arg' found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBug674514B ()\n\t\t{\n\t\t\tvar provider = CreateCtrlSpaceProvider (\n@\"using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$foreach (var arg in args) \n\t\t\tConsole.WriteLine ($\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"args\"), \"parameter 'args' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"arg\"), \"variable 'arg' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 675436 - Completion is trying to complete symbol names in declarations\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug675436_LocalVar ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"class Test\n{\n    public static void Main (string[] args)\n    {\n        $int test = $\n    }\n}\n\");\n\t\t\tAssert.IsNull (provider.Find (\"test\"), \"name 'test' found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 675956 - Completion in for loops is broken\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug675956 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"class Test\n{\n    public static void Main (string[] args)\n    {\n        $for (int i = 0; $\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"i\"), \"variable 'i' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 675956 - Completion in for loops is broken\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug675956Case2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class Test\n{\n    public static void Main (string[] args)\n    {\n        $for (int i = 0; i$\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"i\"), \"variable 'i' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 676311 - auto completion too few proposals in fluent API (Moq)\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug676311 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\nusing System.Linq;\nusing System.Linq.Expressions;\n\nnamespace Test\n{\n\tpublic interface IFoo<T>\n\t{\n\t\tvoid Foo1 ();\n\t}\n\n\tpublic interface IFoo<T, S>\n\t{\n\t\tvoid Foo2 ();\n\t}\n\t\n\tpublic class Test<T>\n\t{\n\t\tpublic IFoo<T> TestMe (Expression<Action<T>> act)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IFoo<T, S> TestMe<S> (Expression<Func<S, T>> func)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic string TestMethod (string str)\n\t\t{\n\t\t\treturn str;\n\t\t}\n\t}\n\t\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tvar t = new Test<string> ();\n\t\t\tvar s = t.TestMe (x => t.TestMethod (x));\n\t\t\t$s.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo1\"), \"method 'Foo1' not found.\");\n\t\t}\n\t\t/// <summary>\n\t\t/// Bug 676311 - auto completion too few proposals in fluent API (Moq)\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug676311B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\nusing System.Linq;\nusing System.Linq.Expressions;\n\nnamespace Test\n{\n\tpublic interface IFoo<T>\n\t{\n\t\tvoid Foo1 ();\n\t}\n\n\tpublic interface IFoo<T, S>\n\t{\n\t\tvoid Foo2 ();\n\t}\n\t\n\tpublic class Test<T>\n\t{\n\t\tpublic IFoo<T> TestMe (Expression<Action<T>> act)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IFoo<T, S> TestMe<S> (Expression<Func<S, T>> func)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic string TestMethod (string str)\n\t\t{\n\t\t\treturn str;\n\t\t}\n\t}\n\t\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tvar t = new Test<string> ();\n\t\t\tvar s = t.TestMe<string> (x => t.TestMethod (x));\n\t\t\t$s.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo2\"), \"method 'Foo2' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 676311 - auto completion too few proposals in fluent API (Moq)\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug676311_Case2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\nusing System.Linq.Expressions;\n\nnamespace Test\n{\n\tpublic interface IFoo<T>\n\t{\n\t\tvoid Foo1 ();\n\t}\n\n\tpublic interface IFoo<T, S>\n\t{\n\t\tvoid Foo2 ();\n\t}\n\t\n\tpublic class Test<T>\n\t{\n\t\tpublic IFoo<T> TestMe (Expression<Action<T>> act)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic IFoo<T, S> TestMe<S> (Expression<Func<S, T>> func)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tpublic void TestMethod (string str)\n\t\t{\n\t\t}\n\t}\n\t\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tvar t = new Test<string> ();\n\t\t\tvar s = t.TestMe (x => t.TestMethod (x));\n\t\t\t$s.$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo1\"), \"method 'Foo2' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 678340 - Cannot infer types from Dictionary&lt;K,V&gt;.Values;\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug678340 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System;\nusing System.Collections.Generic;\n\npublic class Test\n{\n\tpublic void SomeMethod ()\n\t{\n\t\tvar foo = new Dictionary<string,Test> ();\n\t\tforeach (var bar in foo.Values) {\n\t\t\t$bar.$\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"SomeMethod\"), \"method 'SomeMethod' not found.\");\n\t\t}\n\t\t/// <summary>\n\t\t/// Bug 678340 - Cannot infer types from Dictionary&lt;K,V&gt;.Values\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug678340_Case2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"public class Foo<T>\n{\n\tpublic class TestFoo\n\t{\n\t\tpublic T Return ()\n\t\t{\n\t\t\t\n\t\t}\n\t}\n\t\n\tpublic TestFoo Bar = new TestFoo ();\n}\n\npublic class Test\n{\n\tpublic void SomeMethod ()\n\t{\n\t\tFoo<Test> foo = new Foo<Test> ();\n\t\tvar f = foo.Bar;\n\t\t$f.Return ().$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"SomeMethod\"), \"method 'SomeMethod' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 679792 - MonoDevelop becomes unresponsive and leaks memory\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug679792 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"using System.Collections.Generic;\n\nclass TestClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tDictionary<string, Dictionary<string, TestClass>> cache;\n\t\t$cache[\"\"Hello\"\"] [\"\"World\"\"] = new $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestClass\"), \"class 'TestClass' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 679995 - Variable missing from completiom\n\t\t/// </summary>\n\t\t/// \n\t\t[Test]\n\t\tpublic void TestBug679995 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"class TestClass\n{\n\tpublic void Foo ()\n\t{\n\t\tusing (var testMe = new TestClass ()) {\n\t\t\t$$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"testMe\"), \"variable 'testMe' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 680264 - Lamba completion inference issues\n\t\t/// </summary>\n\t\t/// \n\t\t[Test]\n\t\tpublic void TestBug680264 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\npublic delegate S Func<T, S> (T t);\n\npublic static class Linq\n{\n\tpublic static bool Any<T> (this T[] t, Func<T, bool> func)\n\t{\n\t\treturn true;\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Foo ()\n\t{\n\t\tTestClass[] test;\n\t\t$test.Any (t => t.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 683037 - Missing autocompletion when 'using' directive references namespace by relative names\n\t\t/// </summary>\n\t\t/// \n\t\t[Test]\n\t\tpublic void TestBug683037 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"namespace N1.N2\n{\n\tpublic class C1\n\t{\n\t\tpublic void Foo () {\n\t\t\tSystem.Console.WriteLine (1);\n\t\t}\n\t}\n}\n\nnamespace N1\n{\n\tusing N2;\n\n\tpublic class C2\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tC1 x = new C1 ();\n\n\t\t\t$x.$\n\t\t}\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 690606 - Incomplete subclasses listing in code completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug690606 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateCtrlSpaceProvider (\n@\"\npublic abstract class Base {}\npublic abstract class MyBase<T> : Base {}\npublic class A : MyBase<string> {}\npublic class B : MyBase<int> {}\npublic class C : MyBase<bool> {}\n\npublic class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$Base x = new $\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"B\"), \"class 'B' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"C\"), \"class 'C' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 1744 - [New Resolver] Issues while typing a property\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test1744 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\npublic class Test\n{\n\t$public p$\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"void\"), \"class 'void' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"class 'Test' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"System\"), \"namespace 'System' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 1747 - [New Resolver] Code completion issues when declaring a generic dictionary\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test1747()\n\t\t{\n\t\t\tvar provider = CreateProvider(\n@\"using System.Collections.Generic;\npublic class Test\n{\n\t$Dictionary<int,string> field = new $\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"Dictionary<int, string>\"), \"type 'Dictionary<int, string>' not found.\");\n\t\t\tAssert.AreEqual (\"Dictionary<int, string>\", provider.DefaultCompletionString);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test1747Case2 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"public class Test\n{\n\t$Dictionary<int, string> d$\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider not empty.\");\n\t\t\t\n\t\t\tprovider = CreateCtrlSpaceProvider (\n@\"public class Test\n{\n\t$Dictionary<int, string> $\n}\n\");\n\t\t\tAssert.IsFalse (provider == null || provider.Count == 0, \"provider not found.\");\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestCompletionInTryCatch ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class Test { public void TM1 () {} public void TM2 () {} public int TF1; }\nclass CCTest {\nvoid TestMethod ()\n{\n\tTest t;\n\ttry {\n\t\t$t.$\n}\n}\n\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"TM1\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"TM2\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"TF1\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPartialCompletionData ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\npublic partial class TestMe\n{\n\tpartial void MyMethod ();\n\tpartial void Implemented ();\n}\n\npublic partial class TestMe\n{\n\t$partial $\n\n\tpartial void Implemented () { }\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"MyMethod\"), \"method 'MyMethod' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Implemented\"), \"method 'Implemented'  found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 224 - Code completion cannot handle lambdas properly. \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug224 ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nusing System;\n\npublic sealed class CrashEventArgs : EventArgs\n{\n\tpublic int ArgsNum { get; set; }\n\n\tpublic CrashEventArgs ()\n\t{\n\t\t\n\t}\n}\n\ninterface ICrashMonitor\n{\n\tevent EventHandler<CrashEventArgs> CrashDetected;\n\n\tvoid StartMonitoring ();\n\n\tvoid StopMonitoring ();\n}\n\nnamespace ConsoleProject\n{\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tICrashMonitor mon;\n\t\t\t$mon.CrashDetected += (sender, e) => e.$\n\t\t}\n\t}\n}\n\", provider => Assert.IsNotNull(provider.Find(\"ArgsNum\"), \"property 'ArgsNum' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestParameterContext ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\npublic class TestMe\n{\n\t$void TestMe (TestClassParameter t$\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider was not empty.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2123 - Completion kicks in after an array type is used in method parameters\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestParameterContextCase2FromBug2123 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class Program\n{\n\tpublic Program ($string[] a$)\n\t{\n\t}\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestParameterContextNameProposal ()\n\t\t{\n\t\t\tvar provider = CreateCtrlSpaceProvider (\n@\"\npublic class TestMe\n{\n\t$void TestMe (TestClassParameter t$\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"testClassParameter\"), \"'testClassParameter' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"classParameter\"), \"'classParameter' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"parameter\"), \"'parameter' not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestParameterTypeNameContext ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"class Program\n{\n\tpublic Program ($System.$)\n\t{\n\t}\n}\", provider => Assert.IsNotNull(provider.Find(\"Object\"), \"'Object' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMethodNameContext ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"using System;\nnamespace Test \n{\n\tclass Program\n\t{\n\t\tvoid SomeMethod ()\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t\t$public void T$\n\t}\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNamedParameters ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"class MyClass {\n    string Bar { get; set; }\n\n    void MethodOne(string foo=\"\"\"\", string bar=\"\"\"\")\n\t{\n    }\n\n    void MethodTwo() {\n        $MethodOne(b$\n    }\n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"bar:\"), \"'bar:' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"foo:\"), \"'foo:' not found.\");\n\t\t\t});\n\t\t}\n\t\t[Test]\n\t\tpublic void TestNamedParameters2 ()\n\t\t{\n\t\t\tvar provider = CreateCtrlSpaceProvider (\n@\"class MyClass {\n    string Bar { get; set; }\n\n    void MethodOne(string foo=\"\"\"\", string bar=\"\"\"\")\n\t{\n    }\n\n    void MethodTwo() {\n        MethodOne($$);\n    }\n}\");\n\t\t\tAssert.IsNotNull (provider.Find (\"bar:\"), \"'bar:' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"foo:\"), \"'foo:' not found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNamedParametersConstructorCase ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"class MyClass {\n    MyClass(string foo=\"\"\"\", string bar=\"\"\"\")\n\t{\n    }\n\n    void MethodTwo() {\n        $new MyClass(b$\n    }\n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"bar\"), \"'bar' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"foo\"), \"'foo' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConstructorThisBase ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"class Program\n{\n\tpublic Program () : $t$\n\t{\n\t}\n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"this\"), \"'this' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"base\"), \"'base' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAnonymousArguments ()\n\t\t{\n\t\t\tCombinedProviderTest (\n@\"\nusing System;\nclass Program\n{\n\tpublic static void Main ()\n\t{\n\t\tEventHandler f = delegate (object sender, EventArgs args) {\n\t\t\t$Console.WriteLine(s$\n\t\t};\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sender\"), \"'sender' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"args\"), \"'args' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestCodeCompletionCategorySorting ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"class CClass : BClass\n{\n\tpublic int C;\n}\n\nclass BClass : AClass\n{\n\tpublic int B;\n}\n\nclass AClass\n{\n\tpublic int A;\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tCClass a;\n\t\t$a.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tvar list = new List<CompletionCategory> ();\n\t\t\t\n\t\t\tfor (int i = 0; i < provider.Count; i++) {\n\t\t\t\tif (list.Contains (provider [i].CompletionCategory))\n\t\t\t\t\tcontinue;\n\t\t\t\tlist.Add (provider [i].CompletionCategory);\n\t\t\t}\t\n\t\t\tAssert.AreEqual (4, list.Count);\n\t\t\t\n\t\t\tlist.Sort ();\n\t\t\tAssert.AreEqual (\"CClass\", list [0].DisplayText);\n\t\t\tAssert.AreEqual (\"BClass\", list [1].DisplayText);\n\t\t\tAssert.AreEqual (\"AClass\", list [2].DisplayText);\n\t\t\tAssert.AreEqual (\"System.Object\", list [3].DisplayText);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAsExpressionContext ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"class CClass : BClass\n{\n\tpublic int C;\n}\n\nclass BClass : AClass\n{\n\tpublic int B;\n}\n\nclass AClass\n{\n\tpublic int A;\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tAClass a;\n\t\t$a as A$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"AClass\"), \"'AClass' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BClass\"), \"'BClass' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"CClass\"), \"'CClass' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"'Test' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"TestMethod\"), \"'TestMethod' found.\");\n\t\t\t\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2109 - [Regression] Incorrect autocompletion when declaring an enum \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2109B ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"namespace Foobar\n{\n    class MainClass\n    {\n        public enum Foo\n        {\n            Value1,\n            Value2\n        }\n\n        public class Test\n        {\n            Foo Foo {\n                get; set;\n            }\n\n            public static void Method (Foo foo)\n            {\n                $Foo.$\n            }\n        }\n    }\n}\n\");\n\t\t\tAssert.AreEqual (2, provider.Count); // 2 fields\n\t\t\tAssert.IsNotNull (provider.Find (\"Value1\"), \"field 'Value1' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Value2\"), \"field 'Value2' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3581 - [New Resolver] No code completion on Attributes\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3581 ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"using System;\n\nnamespace Foobar\n{\n\tclass Intent \n\t{\n\t\tpublic static int Foo = 0;\n\t\tpublic static int Bar = 1;\n\t}\n\t\n\tclass MyAttribute : Attribute\n\t{\n\t\tpublic int[] Categories;\n\t}\n\t\n\t[MyAttribute(Categories = new [] { $I$ })]\n\tclass MainClass\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tConsole.WriteLine (ddsd);\n\t\t}\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Intent\"), \"'Intent' not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestForConditionContext ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n@\"using System;\n\nclass MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$for (int i = 0; i < System.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Math\"), \"'Math' not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConditionalExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n\t\t\t\t@\"using System;\n\nclass MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint a;\n\t\t$a = true ? System.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Math\"), \"'Math' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3655 - Autocompletion does not work for the assembly attribute [assembly: System.Runtime.CompilerServices.InternalsVisibleTo(\"MyExternalAssembly\")] \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test3655 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$[a$\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"assembly\"), \"'assembly' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"System\"), \"'System' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test3655Case2 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$[assembly:System.R$\", provider => Assert.IsNotNull(provider.Find(\"Runtime\"), \"'Runtime' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test3655Case2Part2 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$[assembly:System.$\", provider => Assert.IsNotNull(provider.Find(\"Runtime\"), \"'Runtime' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test3655Case3 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$[assembly:System.Runtime.C$\", provider => Assert.IsNotNull(provider.Find(\"CompilerServices\"), \"'CompilerServices' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test3655Case3Part2 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$[assembly:System.Runtime.$\", provider => Assert.IsNotNull(provider.Find(\"CompilerServices\"), \"'CompilerServices' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test3655Case4 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$[assembly:System.Runtime.CompilerServices.I$\", provider => Assert.IsNotNull(provider.Find(\"InternalsVisibleTo\"), \"'InternalsVisibleTo' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test3655Case4Part2 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$[assembly:System.Runtime.CompilerServices.$\", provider => Assert.IsNotNull(provider.Find(\"InternalsVisibleTo\"), \"'InternalsVisibleTo' not found.\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUsingContext ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$using System.$\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"IO\"), \"'IO' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"Console\"), \"'Console' found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUsingContextCase2 ()\n\t\t{\n\t\t\tCombinedProviderTest (@\"$using System.U$\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"IO\"), \"'IO' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"Console\"), \"'Console' found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceReturnType()\n\t\t{\n\t\t\tvar provider = CreateProvider(\n@\"using System;\nusing System.Collections.Generic;\n\nclass MainClass\n{\n\tpublic IEnumerable<string> Test ()\n\t{\n\t\t$return new a$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull(provider.Find(\"string[]\"), \"'string[]' not found.\");\n\t\t\tAssert.IsNotNull(provider.Find(\"List<string>\"), \"'List<string>' not found.\");\n\t\t\tAssert.IsNull(provider.Find(\"IEnumerable\"), \"'IEnumerable' found.\");\n\t\t\tAssert.IsNull(provider.Find(\"IEnumerable<string>\"), \"'IEnumerable<string>' found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceReturnTypeCase2 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"using System;\nusing System.Collections.Generic;\n\nclass MainClass\n{\n\tpublic IEnumerable<string> Test ()\n\t{\n\t\t$return new System.Collections.Generic.a$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"List\"), \"'List' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"IEnumerable\"), \"'IEnumerable' found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceReturnTypeCase3 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"using System;\nusing System.Collections.Generic;\n\nclass MainClass\n{\n\tpublic IEnumerable<string> Test ()\n\t{\n\t\t$return new System.Collections.Generic.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"List\"), \"'List' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"IEnumerable\"), \"'IEnumerable' found.\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 3957 - [New Resolver]Override completion doesn't work well for overloaded methods\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3957 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"class A\n{\n    public virtual void Method()\n    {}\n    public virtual void Method(int i)\n    {}\n}\n\nclass B : A\n{\n\t$override $\n}\n\n\");\n\t\t\tAssert.AreEqual(2, provider.Data.Count(d => d.DisplayText == \"Method\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 3973 - code completion forgets context if text is deleted \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3973 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\nusing System;\n\nclass A\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.$W$\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"WriteLine\"), \"'WriteLine' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4017 - code completion in foreach does not work for local variables declared in the same block\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4017()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\nclass TestClass\n{\n    void Foo()\n    {\n        string[] args = null;\n        $foreach(string arg in a$\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"args\"), \"'args' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4020 - code completion handles explicit interface implementations improperly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4020 ()\n\t\t{\n\t\t\t// todo: maybe a better solution would be \n\t\t\t//       having an item to insert the proper cast on 'Dispose' ?\n\t\t\tvar provider = CreateProvider (\n@\"\nusing System;\nnamespace Test\n{\n    class TestClass : IDisposable\n    {\n        void IDisposable.Dispose ()\n        {\n        }\n        public void Foo()\n        {\n            $D$\n        }\n    }\n}\n\");\n\t\t\tAssert.IsNull (provider.Find (\"Dispose\"), \"'Dispose' found.\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 4085 - code completion problem with generic dictionary\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4085()\n\t\t{\n\t\t\t// Name proposal feature breaks here\n\t\t\tvar provider = CreateCtrlSpaceProvider(\n@\"using System.Collections.Generic;\nnamespace Test\n{\n\tclass TestClass\n\t{\n\t\tstatic void Main()\n\t\t{\n\t\t\t$IDictionary<string, TestClass> foo = new Dictionary<string, $\n\t\t}\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull(provider.Find(\"TestClass\"), \"'TestClass' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4283 - Newresolver: completing constructor parameters\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4283()\n\t\t{\n\t\t\tvar provider = CreateCtrlSpaceProvider(\n@\"class Program\n{\n\tpublic Program (int test) : base($)\n\t{\n\t}\n}\");\n\t\t\tAssert.IsNotNull(provider.Find(\"test\"), \"'test' not found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug4283ThisCase()\n\t\t{\n\t\t\tvar provider = CreateCtrlSpaceProvider(\n@\"class Program\n{\n\tpublic Program (int test) : this($)\n\t{\n\t}\n}\");\n\t\t\tAssert.IsNotNull(provider.Find(\"test\"), \"'test' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4290 - Parameter completion exception inserting method with arguments before other methods\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4290()\n\t\t{\n\t\t\t// just test for exception\n\t\t\tParameterCompletionTests.CreateProvider (\n@\"using System;\nnamespace Test\n{\n    class TestClass  \n    {\n        $public static void Foo(string bar,$\n        public static void Main(string[] args)\n        {\n        }\n    }\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4174 - Intellisense popup after #region (same line) \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4174()\n\t\t{\n\t\t\tvar provider = CreateProvider(\n@\"\nnamespace Test\n{\n\tclass TestClass  \n    {\n$#region S$\n    }\n}\");\n\t\t\tAssert.IsTrue(provider == null || provider.Count == 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4323 - Parameter completion exception while attempting to instantiate unknown class\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4323()\n\t\t{\n\t\t\t// just test for exception\n\t\t\tParameterCompletionTests.CreateProvider(\n@\"namespace Test\n{\n    class TestClass\n    {\n        public static void Main(string[] args)\n        {\n            $object foo = new Foo($\n        }\n    }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameterAttributeContext()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\nusing System.Runtime.InteropServices;\n\npublic class Test\n{\n\t$static extern IntPtr somefunction([MarshalAs(UnmanagedType.LPTStr)] string fileName, [MarshalAs(UnmanagedType.$\n}\n\", provider => Assert.IsNotNull(provider.Find(\"LPStr\"), \"'LPStr' not found.\"));\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 1051 - Code completion can't handle interface return types properly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug1051()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\n\npublic class Test\n{\n\tIEnumerable<string> TestFoo()\n\t{\n\t\t$return new $\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNull(provider.Find(\"IEnumerable<string>\"), \"'IEnumerable<string>' found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"List<string>\"), \"'List<string>' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"string[]\"), \"'string[]' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 2668 - No completion offered for enum keys of Dictionaries \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2668()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\n\npublic enum SomeEnum { One, Two }\n\npublic class Test\n{\n\tvoid TestFoo()\n\t{\n\t\tDictionary<SomeEnum,int> dict = new Dictionary<SomeEnum,int>();\n\t\t$dict[O$\n\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"SomeEnum\"), \"'SomeEnum' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"SomeEnum.One\"), \"'SomeEnum.One' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4487 - Filtering possible types for new expressions a bit too aggressively\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4487()\n\t\t{\n\t\t\t// note 'string bar = new Test ().ToString ()' would be valid.\n\t\t\tCombinedProviderTest(\n@\"public class Test\n{\n\tvoid TestFoo()\n\t{\n\t\t$string bar = new T$\n\t}\n}\n\", provider => Assert.IsNotNull(provider.Find(\"Test\"), \"'Test' not found.\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4525 - Unexpected code completion exception\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4525()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"public class Test\n{\n\t$public new s$\n}\n\", provider => Assert.IsNotNull(provider.Find(\"static\"), \"'static' not found.\"));\n\t\t}\n\t\t/// <summary>\n\t\t/// Bug 4604 - [Resolver] Attribute Properties are not offered valid autocomplete choices\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4604()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"\n\t\tpublic sealed class MyAttribute : System.Attribute\n\t\t{\n\t\t\tpublic bool SomeBool {\n\t\t\t\tget;\n\t\t\t\tset;\n\t\t\t}\n\t\t}\n$[MyAttribute(SomeBool=t$\npublic class Test\n{\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"true\"), \"'true' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"false\"), \"'false' not found.\");\n\t\t\t});\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 4624 - [AutoComplete] Attribute autocomplete inserts entire attribute class name. \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4624()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\n\nenum TestEnum\n{\n   $[E$\n   EnumMember\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"Obsolete\"), \"'Obsolete' not found.\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCatchContext()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\n\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\t$try { } catch (S$\n\t}\n}\n\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Exception\"), \"'Exception' not found.\");\n\t\t\t\tAssert.IsNull(provider.Find(\"String\"), \"'String' found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCatchContextFollowUp()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\n\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\t$try { } catch (System.$\n\t}\n}\n\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Exception\"), \"'Exception' not found.\");\n\t\t\t\tAssert.IsNull(provider.Find(\"String\"), \"'String' found.\");\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4688 - No code completion in nested using statements\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4688()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\n\npublic class TestFoo\n{\n\tvoid Bar ()\n\t{\n\t\t// Read the file from\n\t\t$using (S$\n\t}\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"String\"), \"'String'not found.\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4808 - Enums have an unknown 'split_char' member included in them.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4808()\n\t\t{\n\t\t\tvar provider = CreateProvider(\n@\"using System;\n\nenum Foo { A, B }\npublic class TestFoo\n{\n\tvoid Bar ()\n\t{\n\t\t$Foo.$\n\t}\n}\n\"\n\t\t\t);\n\t\t\tAssert.IsNotNull(provider.Find(\"A\"));\n\t\t\tAssert.IsNotNull(provider.Find(\"B\"));\n\t\t\tAssert.IsNull(provider.Find(\"split_char\"), \"'split_char' found.\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 4961 - Code completion for enumerations in static classes doesn't work.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4961()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\nusing System.Collections.Generic;\n\nnamespace EnumerationProblem\n{\n\tpublic enum Options\n\t{\n\t\tGiveCompletion,\n\t\tIwouldLoveIt,\n\t}\n\t\n\tstatic class Converter\n\t{\n\t\tprivate static Dictionary<Options, string> options = new Dictionary<Options, string> () \n\t\t{\n\t\t\t${ Options.$\n\t\t};\n\t}\n}\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"GiveCompletion\"));\n\t\t\t\tAssert.IsNotNull(provider.Find(\"IwouldLoveIt\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 5191 - Creating extension method problem when typing \"this\" \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug5191()\n\t\t{\n\t\t\tCombinedProviderTest(\n@\"using System;\n\nstatic class Ext\n{\n\t$public static void Foo(t$\n}\n\", provider => Assert.IsNotNull(provider.Find(\"this\"), \"'this' not found.\"));\n\n\t\t\tCombinedProviderTest(\n@\"using System;\n\nstatic class Ext\n{\n\t$public static void Foo(int foo, t$\n}\n\", provider => Assert.IsNull(provider.Find(\"this\"), \"'this' found.\"));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 5404 - Completion and highlighting for pointers \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug5404()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\n\nnamespace TestConsole\n{\nunsafe class MainClass\n{\npublic int i = 5, j =19;\n\npublic static void Main (string[] args)\n{\nMainClass*  mc;\n$mc->$\n}\n}\n}\n\", provider => Assert.IsNotNull(provider.Find(\"i\"), \"'i' not found.\"));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 6146 - No intellisense on value keyword in property set method\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug6146()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\npublic class FooBar\n{\n\tpublic FooBar Foo {\n\t\tset {\n\t\t\t$value.$\n\t\t}\n\t}\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"Foo\")));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestBug6146Case2()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\npublic class FooBar\n{\n\tpublic FooBar Foo {\n\t\tset {\n\t\t\t$value.Foo.F$\n\t\t}\n\t}\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"Foo\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCompletionInPreprocessorIf()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\npublic class FooBar\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t#if TEST\n\t\t$Console.$\n\t\t#endif\n\t}\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"WriteLine\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCompletionInUndefinedPreprocessorIf()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\npublic class FooBar\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t#if UNDEFINED\n\t\t$Console.$\n\t\t#endif\n\t}\n}\n\n\", provider => Assert.IsNull(provider.Find(\"WriteLine\")));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 7041 - No completion inside new[]\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug7041()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\n\n\t\tnamespace ConsoleApplication2\n\t\t{\n\t\t\tclass Test\n\t\t\t{\n\t\t\t\tpublic string[] Foo { get; set; }\n\t\t\t}\n\n\t\t\tclass Program\n\t\t\t{\n\t\t\t\tstatic void Main(string[] args)\n\t\t\t\t{\n\t\t\t\t\tvar a = new Test ()\n\t\t\t\t\t{\n\t\t\t\t\t\t$Foo = new [] { S$\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\", provider => Assert.IsNotNull(provider.Find(\"System\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGlobalPrimitiveTypes()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"$u$\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"using\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"ushort\"));\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGlobalPrimitiveTypesCase2()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"$delegate u$\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"ushort\"));\n\t\t\t\tAssert.IsNotNull(provider.Find(\"System\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"using\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 7207 - Missing inherited enum in completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug7207()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\n\nclass A\n{\n    protected enum MyEnum\n    {\n        A\n    }\n\t\n\tclass Hidden {}\n\n}\n\nclass C : A\n{\n\tclass NotHidden {}\n    public static void Main ()\n    {\n       $var a2 = M$\n    }\n}\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"MyEnum\"));\n\t\t\t\tAssert.IsNotNull(provider.Find(\"NotHidden\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"Hidden\"));\n\t\t\t});\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 7191 - code completion problem with generic interface using nested type\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug7191()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System.Collections.Generic;\nnamespace bug\n{\n    public class Outer\n    {\n        public class Nested\n        {\n        }\n    }\n    public class TestClass\n    {\n        void Bar()\n        {\n            $IList<Outer.Nested> foo = new $\n        }\n    }\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"List<Outer.Nested>\")));\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 6849 - Regression: Inaccesible types in completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug6849()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"\nnamespace bug\n{\n   public class TestClass\n    {\n        void Bar()\n        {\n            $new System.Collections.Generic.$\n        }\n    }\n}\n\n\", provider => {\n\t\t\t\t// it's likely to be mono specific.\n\t\t\t\tAssert.IsNull(provider.Find(\"RBTree\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"GenericComparer\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"InternalStringComparer\"));\n\t\t\t});\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestBug6849Case2()\n\t\t{\n\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"\nnamespace bug\n{\n   public class TestClass\n    {\n        void Bar()\n        {\n            $System.Collections.Generic.$\n        }\n    }\n}\n\n\", provider => {\n\t\t\t\t// it's likely to be mono specific.\n\t\t\t\tAssert.IsNull(provider.Find(\"RBTree\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"GenericComparer\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"InternalStringComparer\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 6237 - Code completion includes private code \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug6237 ()\n\t\t{\n\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"\nnamespace bug\n{\n   public class TestClass\n    {\n        void Bar()\n        {\n            $System.Xml.Linq.XElement.$\n        }\n    }\n}\n\n\", provider => {\n\t\t\t\tAssert.IsTrue (provider.Count > 0);\n\t\t\t\t// it's likely to be mono specific.\n\t\t\t\tforeach (var data in provider.Data) {\n\t\t\t\t\tAssert.IsFalse(data.DisplayText.StartsWith(\"<\", StringComparison.Ordinal), \"Data was:\" + data.DisplayText);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 7795 - Completion cannot handle nested types \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug7795 ()\n\t\t{\n\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"\nusing System;\nusing System.Linq;\nusing System.Collections;\n\nclass Foo\n{\n    public enum Selector\n    {\n        VV\n    }\n}\n\npublic class Bugged\n{\n    static void Test (Foo.Selector selector)\n    {\n\n    }\n\n    void Selector ()\n    {\n\n    }\n\n    public static void Main ()\n    {\n        Test ($S$);\n    }\n}\n\", provider => Assert.AreEqual(\"Foo.Selector\", provider.DefaultCompletionString));\n\t\t}\n\n\n\n\t\t/// <summary>\n\t\t/// Bug 8618 - Intellisense broken within compiler directives\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug8618 ()\n\t\t{\n\t\t\t\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"\npublic class TestClass\n{\nvoid Bar(object argument)\n{\nobject local;\n#if FOOBAR\n$a$\n#endif\n}\n}\n\n\", provider => {\n\t\t\t\tAssert.IsNull(provider.Find(\"argument\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"local\"));\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug8618Case2 ()\n\t\t{\n\t\t\t\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"#define FOOBAR\n\npublic class TestClass\n{\nvoid Bar(object argument)\n{\nobject local;\n#if FOOBAR\n$a$\n#endif\n}\n}\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"argument\"));\n\t\t\t\tAssert.IsNotNull(provider.Find(\"local\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 8655 - Completion for attribute properties not working\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug8655 ()\n\t\t{\n\t\t\t\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\n\nnamespace TestConsole\n{\n\t[AttributeUsage (AttributeTargets.Assembly, Inherited = true, AllowMultiple = true)]\n\tpublic sealed class MyAttribute : Attribute\n\t{\n\t\tpublic int NamedInt { get; set; }\n\t\tpublic int[] Categories { get; set; }\n\n\t\tpublic MyAttribute (string[] str) { }\n\t}\n\n\n\t$[MyAttribute(new[] {\"\"Foo\"\", \"\"Bar\"\"}, Categories = new[] {1,2,3}, n$\n\tclass MainClass\n\t{\n\t}\n}\n\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"NamedInt\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"delegate\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9026 - Completion shows inaccesible members \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9026 ()\n\t\t{\n\t\t\t\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\nclass Test { class Foo {} }\n\nclass MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$new Test.$\n\t}\n}\n\n\n\", provider => Assert.IsNull(provider.Find(\"Foo\")));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9115 - Code completion fumbles on named lambda parameters.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9115 ()\n\t\t{\n\t\t\t\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\n\nclass MainClass\n{\n\n\tstatic void Run(Action<int> act) { }\n\tpublic static void Main (string[] args)\n\t{\n\t\t$Run(act: i$\n\t}\n}\n\n\n\", provider => Assert.IsFalse(provider.AutoSelect));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9896 - Wrong dot completion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9896 ()\n\t\t{\n\t\t\t\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System; \n\npublic class Testing \n{ \n    public static void DoNothing() {} \n\n    public static void Main() \n    { \n        $DoNothing ().$\n    } \n}\n\n\", provider => Assert.IsTrue(provider == null || provider.Count == 0));\n\t\t}\n\n\t\t/// <summary>\n\t\t///Bug 9905 - Cannot type new() constraint \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9905 ()\n\t\t{\n\t\t\t\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System; \n\npublic class Testing \n{ \n    public static void DoNothing<T>() where T : class$, n$\n\t{\n\t} \n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"new()\")));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 10361 - No completion for optional attribute arguments\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10361 ()\n\t\t{\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\n\t\t\n\t\tnamespace test {\n\t\t\tclass RequestAttribute : Attribute {\n\t\t\t\tpublic int RequestId { get; set; }\n\t\t\t\tpublic bool RequireLogin { get; set; }\n\t\t\t\t\n\t\t\t\tpublic RequestAttribute (int requestId, bool requireLogin = false) {\n\t\t\t\t\tRequestId = requestId;\n\t\t\t\t\tRequireLogin = requireLogin;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tclass MainClass {\n\t\t\t\t[RequestAttribute(5$, r$)]\n\t\t\t\tpublic static void Main (string[] args) {\n\t\t\t\t\tConsole.WriteLine(\"\"Hello World!\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\", provider => Assert.IsNotNull(provider.Find(\"requireLogin:\")));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// NullReferenceException when inserting space after 'in' modifier\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestCrashContravariantTypeParameter ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n\t\t\t\t@\"public delegate void ModelCollectionChangedEventHandler<in$ $T>();\n\");\n\t\t\tAssert.AreEqual(0, provider.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchCase ()\n\t\t{\n\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\nclass Test\n{\n\tpublic void Test (ConsoleColor color)\n\t{\n\t\t$switch (c$\n\t}\n}\n\", provider => Assert.IsNotNull(provider.Find(\"color\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchCaseCase ()\n\t\t{\n\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\nclass Test\n{\n\tpublic void Test (ConsoleColor color)\n\t{\n\t\tswitch (color) {\n\t\t\t$case $\n\t\t}\n\t}\n}\n\", provider => Assert.IsNotNull(provider.Find(\"ConsoleColor\")));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 11906 - Intellisense choice injects full name on edit of existing name.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug11906()\n\t\t{\n\t\t\t// The bug was caused by completion popping up in the middle of a word.\n\t\t\tvar provider = CreateProvider(@\"using System;\nusing System.Threading.Tasks;\n\nenum Test_Struct {\n\tSome_Value1,\n\tSome_Value2,\n\tSome_Value3\n}\n\npublic class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tTest_Struct v1 = Test_Struct.Some_$V$Value2;\n\t}\n}\");\n\t\t\tAssert.IsTrue(provider == null || provider.Count == 0);\n\t\t}\n\n\t\t[Ignore(\"Parser bug\")]\n\t\t[Test]\n\t\tpublic void TestBugWithLambdaParameter()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System.Collections.Generic;\n\n\t\tclass C\n\t\t{\n\t\t\tpublic static void Main (string[] args)\n\t\t\t{\n\t\t\t\tList<string> list;\n\t\t\t\t$list.Find(l => l.Name == l.Name ? l$\n\t\t\t}\n\t\t}\", provider => Assert.IsNotNull(provider.Find(\"l\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLexerBug ()\n\t\t{\n\t\t\tCompletionDataList provider = CreateProvider (\n\t\t\t\t@\"\npublic class TestMe : System.Object\n{\n/*\n\n\t//*/\n\t$override $\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Equals\"), \"method 'Equals' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13366 - Task result cannot be resolved in incomplete task continution\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13366 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n\t\t\t\t@\"using System;\nusing System.Threading.Tasks;\n\npublic class TestMe\n{\n\t\n\tvoid Test ()\n\t{\n\t\t$Task.Factory.StartNew (() => 5).ContinueWith (t => t.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Result\"), \"property 'Result' not found.\");\n\t\t}\n\n\t\t[Ignore(\"Fixme\")]\n\t\t[Test]\n\t\tpublic void TestBug13366Case2 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n\t\t\t\t@\"using System;\n\nclass A { public void AMethod () {} }\nclass B { public void BMethod () {} }\n\npublic class TestMe\n{\n\tvoid Foo(Action<A> act) {}\n\tvoid Foo(Action<B> act) {}\n\t\n\tvoid Test ()\n\t{\n\t\t$Foo(a => a.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"AMethod\"), \"method 'AMethod' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"), \"method 'BMethod' not found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13746 - Not useful completion for async delegates \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13746 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n\t\t\t\t@\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n    public static void Main()\n    {\n        var c = new HttpClient ();\n        $Task.Run (a$\n        return;\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tforeach (var p in provider.Data)\n\t\t\t\tConsole.WriteLine(p.DisplayText);\n\t\t\tAssert.AreEqual(1, provider.Data.Count(cd => cd.DisplayText == \"async delegate\"));\n\t\t\tAssert.AreEqual(1, provider.Data.Count(cd => cd.DisplayText == \"delegate()\"));\n\t\t\tAssert.AreEqual(1, provider.Data.Count(cd => cd.DisplayText == \"async delegate()\"));\n\t\t}\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void TestBasicIntersectionProblem ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System;\n\nclass A { public int AInt { get { return 1; } } }\nclass B { public int BInt { get { return 0; } } }\n\nclass Testm\n{\n\tpublic void Foo (Action<A> a) {}\n\tpublic void Foo (Action<B> b) {}\n\n\tpublic void Bar ()\n\t{\n\t\t$Foo(x => x.$\n\t}\n}\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"AInt\"), \"property 'AInt' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"BInt\"), \"property 'BInt' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void TestComplexIntersectionTypeProblem ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System.Threading.Tasks;\nusing System.Linq;\n\nclass Foo\n{\n\tpublic void Bar ()\n\t{\n\t\t$Task.Factory.ContinueWhenAll (new[] { Task.Factory.StartNew (() => 5) }, t => t.Select (r => r.$\n\t}\n}\", provider => Assert.IsNotNull(provider.Find(\"Result\"), \"property 'Result' not found.\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 8795 - Completion shows namespace entry which in not usable\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug8795 ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"namespace A.B\n{\n    public class Foo\n    {\n    }\n}\nnamespace Foo\n{\n    using A.B;\n\n    class MainClass\n    {\n        public static void Main ()\n        {\n            $F$\n        }\n    }\n}\n\", provider => provider.Data.Single(d => d.DisplayText == \"Foo\"));\n\t\t}\n\t\n\t\t/// <summary>\n\t\t/// Bug 10228 - [AST] Incomplete linq statements missing \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10228 ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Program\n{\n\tpublic void Hello()\n\t{\n\t\tvar somelist = new List<object>();\n\t\t$var query = from item in somelist group i$\n\t}\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"item\"), \"'item' not found.\"));\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 15183 - New completion in params suggests array type \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15183 ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"class Foo\n{\n\tstatic void Bar (params Foo[] args)\n\t{\n\t\t$Bar (new $\n\t}\n}\n\", provider => Assert.IsNotNull(provider.Find(\"Foo\"), \"'Foo' not found.\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15387 - Broken completion for class inheritance at namespace level \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15387 ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System;\n$class Foo : $\n\", provider => Assert.IsNotNull(provider.Find(\"IDisposable\"), \"'IDisposable' not found.\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15550 - Inheritance completion \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15550 ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System;\n$class Foo : $\n\", provider => Assert.IsNull(provider.Find(\"Console\"), \"'Console' found (static class).\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug15550Case2 ()\n\t\t{\n\n\t\t\tCombinedProviderTest(@\"using System;\n$class Foo : IDisposable, F$\n\", provider => Assert.IsNull(provider.Find(\"Activator\"), \"'Activator' found (sealed class).\"));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestGotoCompletion ()\n\t\t{\n\t\t\tvar provider = CreateCtrlSpaceProvider(@\"using System;\n\nclass Program\n{\n\tpublic void Hello()\n\t{\n\t\t$goto i$\n\t}\n}\n\n\");\n\t\t\tAssert.IsTrue(provider == null || provider.Count == 0); \n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 17653 - Wrong completion entry in tuple factory method\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17653 ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System;\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$Tuple.Create(new $\n\t}\n}\n\", provider => Assert.IsNull(provider.Find(\"T1\"), \"'T1' found (type parameter).\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug17653_ValidTypeParameterCreation ()\n\t\t{\n\t\t\tCombinedProviderTest(@\"using System;\nclass Foo<T1> where T1 : new()\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$T1 t = new $\n\t}\n}\n\", provider => { \n\t\t\t\tAssert.IsNotNull(provider.Find(\"T1\"), \"'T1' found (type parameter).\");\n\t\t\t\tAssert.AreEqual(\"T1\", provider.DefaultCompletionString);\n\t\t\t});\n\t\t}\n\n\n\t\t/// <summary>\n\t\t///\tBug 21902 - Completion does not recognise new context for member access on parameter\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug21902 ()\n\t\t{\n\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\nusing System.Collections.Generic;\n\nclass C\n{\n    public List<int> Prop;\n}\n\nclass MainClass\n{\n    public static void Main ()\n    {\n    }\n\n    void Foo (C c)\n    {\n        $c.Prop = new $\n    }\n}\n\", provider => Assert.IsNotNull(provider.Find(\"List<int>\")));\n\t\t}\n\n\t\t/// <summary>\n\t\t///\tBug 23047 - Completion is not working for is statement \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug23047 ()\n\t\t{\n\n\t\t\tCombinedProviderTest(\n\t\t\t\t@\"using System;\n\nclass User\n{\n}\n\nclass MainClass\n{\n    public static int Main ()\n    {\n        object o = null;\n        $var v = o is $\n        return 0;\n    }\n}\n\n\", provider => Assert.IsNotNull(provider.Find(\"User\")));\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionCSharp3Tests.cs",
    "content": "﻿//\n// CodeCompletionCSharp3Tests.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture()]\n\tpublic class CodeCompletionCSharp3Tests\n\t{\n\t\t/* Currently fails but works in monodevelop. Seems to be a bug in the unit test somewhere.\n\t\t[Test()]\n\t\tpublic void TestExtensionMethods ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"using System;\n\npublic static class EMClass\n{\n\tpublic static int ToInt32Ext (this Program s)\n\t{\n\t\treturn Int32.Parse (s);\n\t}\n}\n\nclass Program\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tProgram s;\n\t\tint i = s.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ToInt32Ext\"), \"extension method 'ToInt32Ext' not found.\");\n\t\t}\n\t\t*/\n\t\t[Test()]\n\t\tpublic void TestVarLocalVariables ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"using System;\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t}\n}\n\nclass Program\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tvar t = new Test ();\n\t\t$t.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestVarLoopVariable ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"using System;\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t}\n}\n\nclass Program\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tvar t = new Test[] {};\n\t\tforeach (var loopVar in t) {\n\t\t\t$loopVar.$\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAnonymousType ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Program\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tvar t = new { TestInt = 6, TestChar='e', TestString =\"\"Test\"\"};\n\t\t$t.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestInt\"), \"property 'TestInt' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestChar\"), \"property 'TestChar' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestString\"), \"property 'TestString' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestQueryExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nusing System;\nusing System.Collections.Generic;\n\nstatic class Linq\n{\n\tpublic static IEnumerable<T> Select<S, T> (this IEnumerable<S> collection, Func<S, T> func)\n\t{\n\t}\n}\n\nclass Program\n{\n\tpublic void TestMethod ()\n\t{\n\t}\n\t\n\tstatic void Main (string[] args)\n\t{\n\t\tProgram[] numbers;\n\t\tforeach (var x in from n in numbers select n) {\n\t\t\t$x.$\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLambdaExpressionCase1 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nusing System;\nclass Test\n{\t\n\tpublic void Foo ()\n\t{\n\t\t$Func<Test,int> x = s => s.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Foo\"), \"method 'Foo' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLambdaExpressionCase2 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\n\nnamespace System {\n\tpublic class Array {\n\t\tpublic Test this[int i] {\n\t\t\tget {\n\t\t\t}\n\t\t\tset {\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic class ExtMethods\n{\n\tpublic static T Where<T>(this T[] t, Func<T, bool> pred)\n\t{\n\t\treturn t;\n\t}\n}\n\nclass Test\n{\n\tpublic void TestMethod ()\n\t{\n\t\tTest[] en = new Test[0];\n\t\tvar x = en.Where (t => t != null);\n\t\t$x.$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 487237 - Broken lambda intellisense \n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug487237 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\npublic interface IHelper\n{\n    void DoIt ();\n}\n\npublic class Program\n{\n\tdelegate T MyDelegate <T> (T t);\n    \n\tstatic int Main ()\n    {\n        $MyDelegate<IHelper> e = helper => helper.$\n        return 0;\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"DoIt\"), \"method 'DoIt' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 491016 - No intellisense for lambdas inside linq query\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug491016 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nusing System;\nusing System.Collections.Generic;\n\nnamespace System.Collections.Generic {\n\tpublic interface IEnumerable<T>\n\t{\n\t\n\t}\n}\nnamespace Foo\n{\n    class Data\n    {\n        public int Value = 5;\n    }\n\n    static class Ex\n    {\n        public static System.Collections.Generic.IEnumerable<TR> Foo<T, TR> (this System.Collections.Generic.IEnumerable<T> t, Func<T, TR> f)\n        {\n            yield return f (t.First ());\n        }\n    }\n\n    public class C\n    {\n        public static void Main ()\n        {\n            System.Collections.Generic.IEnumerable<Data> i = new Data [0];\n            $var prods = from pe in i.Foo (p2 => p2.$\n        }\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Value\"), \"field 'Value' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 491017 - No intellisense for static LINQ queries\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug491017 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nusing System.Linq;\nusing System.Linq.Expressions;\n\nclass Test\n{\n    $object e = from entity in \"\"olololcolc\"\" select entity.$\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"ToString\"), \"method 'ToString' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Length\"), \"property 'Length' found, but shouldn't (indicates wrong return type).\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestDefaultParameterBug ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nnamespace Foo\n{\n    class Data\n    {\n        public int Value = 5;\n    }\n\n    public class C\n    {\n        public void Foo (bool aBool = false)\n        {\n\t\t\tData data;\n            $data.$\n        }\n    }\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Value\"), \"field 'Value' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLinqWhere() {\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider(\n@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass A\n{\n\tpublic static void Method1()\n\t{\n    \tint[] enumerable =  new int[]{1,2,3};\n\t\t$IEnumerable<int> q = from i in enumerable where i.$\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull(provider); // <--- here 0 item in the completion list\n\t\t\tAssert.IsNotNull(provider.Find(\"ToString\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLinqSelectContext () \n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass A\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$from a in args select n$\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull(provider); // <--- here 0 item in the completion list\n\t\t\tAssert.IsNotNull(provider.Find(\"new\"), \"'new' not found\");\n\t\t\tAssert.IsNotNull(provider.Find(\"args\"), \"'args' not found\");\n\t\t\tAssert.IsNotNull(provider.Find(\"a\"), \"'a' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLinqAnonymousTypeContext () \n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass A\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tTest($from a in args select new { t$);\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull(provider);\n\t\t\tAssert.IsFalse (provider.AutoSelect );\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLinqAnonymousTypeContextCase2 () \n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass A\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$from a in args select new { test = a$\n\t}\n}\n\n\");\n\t\t\tAssert.IsNotNull(provider); // <--- here 0 item in the completion list\n\t\t\tAssert.IsTrue (provider.AutoSelect );\n\t\t\tAssert.IsNotNull(provider.Find(\"a\"), \"'a' not found\");\n\t\t\tAssert.IsNotNull(provider.Find(\"new\"), \"'new' not found\");\n\t\t\tAssert.IsNotNull(provider.Find(\"args\"), \"'args' not found\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLinqAnonymousTypeContextCase3 () \n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass A\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$from a in args select new { test = a }$\n\t}\n}\n\n\");\n\t\t\tAssert.IsTrue(provider == null || provider.Count == 0); // <--- here 0 item in the completion list\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLinqExpressionContext () \n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass A\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$from a in args where a !$\n\t}\n}\n\n\");\n\t\t\tAssert.IsTrue(provider == null || provider.Count == 0); // <--- here 0 item in the completion list\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionCSharpTests.cs",
    "content": "//\n// CodeCompletionCSharpTests.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing NUnit.Framework;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture()]\n\tpublic class CodeCompletionCSharpTests : TestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestUsingDeclaration ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"namespace Test {\n\tclass Class\n\t{\n\t}\n}\n\n$using $\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"namespace 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLocalVariableDeclaration ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class Test\n{\n\tvoid Test ()\n\t{\n\t\tTest t;\n\t\t$t.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestObjectCreationExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class Test\n{\n\tvoid Test ()\n\t{\n\t\t$new Test ().$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestCastExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class Test\n{\n\tvoid Test ()\n\t{\n\t\tobject o;\n\t\t$((Test)o).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestThisReferenceExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class Test\n{\n\tvoid Test ()\n\t{\n\t\t$this.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestBaseReferenceExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tpublic void Test ()\n\t{\n\t}\n}\n\nclass Test2 : Test\n{\n\tvoid Test2 ()\n\t{\n\t\t$base.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"Test2\"), \"method 'Test2' found but shouldn't.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestConditionalExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\tTest a, b;\n\t\t$(1 == 1 ? a : b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestIndexerExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\tTest[] a;\n\t\t$a[0].$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInvocationExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tstatic Test GetTest () {}\n\t\n\tvoid Test ()\n\t{\n\t\t$GetTest ().$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestParenthesizedExpression ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\t$(this).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestForeachLoopVariable ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\tforeach (Test t in new string[] {\"\"hello\"\"})\n\t\t\t$t.$;\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"method 'Test' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestMethodAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass AClass\n{\n\tpublic AClass TestMethod ()\n\t{\n\t}\n}\n\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\tAClass a;\n\t\t$a.TestMethod().$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestMethod\"), \"method 'TestMethod ' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestFieldAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass AClass\n{\n\tpublic AClass TestField;\n}\n\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\tAClass a;\n\t\t$a.TestField.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestField\"), \"field 'TestField' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestPropertyAccess ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass AClass\n{\n\tpublic AClass TestProperty { get { return null; } }\n}\n\nclass Test\n{\n\tvoid Test ()\n\t{\n\t\tAClass a;\n\t\t$a.TestProperty.$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"TestProperty\"), \"property 'TestProperty' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestAsCompletionContext ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass A\n{\n}\n\nclass B\n{\n}\n\nclass C : A\n{\n}\n\nclass Test\n{\n\tpublic void TestMethod (object test)\n\t{\n\t\t$A a = test as $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"A\"), \"class 'A' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"C\"), \"class 'C' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"B\"), \"class 'B' found, but shouldn't.\");\n\t\t\tAssert.IsNull (provider.Find (\"Test\"), \"class 'Test' found, but shouldn't.\");\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t[Test()]\n\t\tpublic void TestLocalVariableNameContext ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic class TestMyLongName\n{\n\tpublic void Method ()\n\t{\n\t\t$TestMyLongName $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"testMyLongName\"), \"name 'testMyLongName' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"myLongName\"), \"name 'myLongName' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"longName\"), \"name 'longName' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"name\"), \"name 'name' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestMethodCreationCompletionWithLambda ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass Test\n{\n\tpublic void TestMethod (string[] args)\n\t{\n\t\t$args.FirstOrDefault(d$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"delegate\"), \"completion item 'delegate' not found!\");\n\t\t\tAssert.IsNotNull (provider.Find (\"async delegate\"), \"completion item 'async delegate' not found!\");\n\t\t\tAssert.IsNotNull (provider.Find (\"(string arg)\"), \"completion item '(string arg)' not found!\");\n\t\t\tAssert.IsNotNull (provider.Find (\"HandleFunc\"), \"completion item 'HandleFuncpredicate' not found!\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionOperatorTests.cs",
    "content": "//\n// OperatorTests.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture()]\n\tpublic class CodeCompletionOperatorTests : TestBase\n\t{\n\n\t\t[Test()]\n\t\tpublic void TestAddOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator+(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a + b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestSubtractOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator-(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a - b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestMultiplyOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator*(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a * b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestDivideOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator/(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a / b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestModulusOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator%(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a % b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestBitwiseAndOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator&(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a & b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestBitwiseOrOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator|(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a | b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestExclusiveOrOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator^(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a ^ b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestShiftLeftOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator<<(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a << b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestShiftRightOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator>>(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a >> b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestGreaterThanOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator>(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a > b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestGreaterThanOrEqualOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator>=(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a >= b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEqualityOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator==(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a == b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestInEqualityOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator!=(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a != b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLessThanOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator<(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a < b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestLessThanOrEqualOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator<=(A left, A right)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\tA b = new A ();\n\t\t$(a <= b).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestUnaryPlusOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator+(A left)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B : A\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\t$(+a).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestUnaryMinusOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator-(A left)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B : A\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\t$(-a).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestUnaryNotOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator!(A left)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B : A\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\t$(!a).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestUnaryBitwiseNotOperator ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateProvider (\n@\"class A\n{\n\tpublic static B operator~(A left)\n\t{\n\t\treturn new B ();\n\t}\n}\n\nclass B : A\n{\n\tpublic void BMethod ()\n\t{\n\t}\n}\n\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\tA a = new A ();\n\t\t$(~a).$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.IsNotNull (provider.Find (\"BMethod\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CompletionDataList.cs",
    "content": "// \n// CompletionDataList.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Completion;\nusing System.Linq;\n\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\tpublic class CompletionDataList\n\t{\n\t\tpublic IEnumerable<ICompletionData> Data {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn Data.Count ();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic ICompletionData this[int i] {\n\t\t\tget {\n\t\t\t\treturn Data.ElementAt (i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic bool AutoCompleteEmptyMatch { get; set; }\n\t\t\n\t\tpublic bool AutoSelect { get; set; }\n\t\t\n\t\tpublic string DefaultCompletionString { get; set; }\n\t\t\n\t\tpublic ICompletionData Find (string name, bool includeImportData = false)\n\t\t{\n\t\t\treturn Data.FirstOrDefault (d => (!(d is CodeCompletionBugTests.TestFactory.ImportCompletionData) || includeImportData) && d.DisplayText == name);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/DelegateContextTests.cs",
    "content": "// \n// DelegateContextTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class DelegateContextTests : TestBase\n\t{\n\t\t/// <summary>\n\t\t/// Bug 4483 - Completion too aggressive for anonymous methods\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4483()\n\t\t{\n\t\t\t// note 'string bar = new Test ().ToString ()' would be valid.\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\n\npublic class Test\n{\n\tvoid TestFoo()\n\t{\n\t\t$Action act = a$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsFalse(provider.AutoSelect);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameterContext()\n\t\t{\n\t\t\t// note 'string bar = new Test ().ToString ()' would be valid.\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\n\npublic class Test\n{\n\tvoid TestFoo(Action act)\n\t{\n\t\t$TestFoo(a$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsFalse(provider.AutoSelect);\n\t\t\t\tAssert.IsNotNull(provider.Find(\"delegate\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 5207 - [regression] delegate completion like event completion \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug5207()\n\t\t{\n\t\t\t// note 'string bar = new Test ().ToString ()' would be valid.\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\n\npublic class Test\n{\n\tAction<int,int> foo;\n\n\tvoid TestFoo()\n\t{\n\t\t$foo = d$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsFalse(provider.AutoSelect);\n\t\t\t\tAssert.IsNotNull(provider.Find(\"(arg1, arg2)\"));\n\t\t\t});\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestRefOutParams()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"using System;\npublic delegate void FooBar (out int foo, ref int bar, params object[] additional);\n\npublic class Test\n{\n\tFooBar foo;\n\n\tvoid TestFoo()\n\t{\n\t\t$foo = d$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsFalse(provider.AutoSelect);\n\t\t\t\tAssert.IsNotNull(provider.Find(\"(out int foo, ref int bar, object[] additional)\"));\n\t\t\t\tAssert.IsNull(provider.Find(\"(foo, bar, additional)\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 11603 - Event completion includes entries which are invalid\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug11603()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n\t\t\t\t@\"using System;\nusing System.Threading.Tasks;\n\npublic class Test\n{\n\tpublic static event Action foo;\n\t\n\tpublic static void Main (string[] args)\n\t{\n\t\t$foo += $\n\t}\n\t\n\tstatic async Task TestAsync ()\n\t{\n\n\t}\n}\n\");\n\t\t\tAssert.IsNull(provider.Find(\".ctor\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestCrashOnEventHandlerCCWithoutIndentation()\n\t\t{\n\t\t\t// An off-by-one error in GetLineIndent() was causing an ArgumentOutOfRangeException\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\n\npublic class Test\n{\nvoid TestFoo()\n{\n$Action act = a$\n}\n}\n\", provider => {\n\t\t\t\tAssert.IsFalse(provider.AutoSelect);\n\t\t\t});\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/DocumentationContextTests.cs",
    "content": "//\n// DocumentationContextTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class DocumentationContextTests\n\t{\n\t\t[Test]\n\t\tpublic void TestClosingTag()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\n\npublic class Test\n{\n\t///<summary>Foo$<$\n\tvoid TestFoo()\n\t{\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"/summary>\"));\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClosingTagMultiLine()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"using System;\n\npublic class Test\n{\n\t///<summary>\n\t///Foo\n\t///$<$\n\tvoid TestFoo()\n\t{\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"/summary>\"));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9998 - Doc comments completion offers </para> as end tag for <param>\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9998()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"using System;\n\npublic class Test\n{\n\t\t/// <summary>\n\t\t/// </summary>\n\t\t/// <param name=\"\"args\"\"> $<$\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\n\t\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"/param>\"));\n\t\t\t});\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/EnumContextTests.cs",
    "content": "// \n// EnumContextTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture()]\n\tpublic class EnumContextTests : TestBase\n\t{\n\t\t/// <summary>\n\t\t/// Bug 2142 - Enum member list triggers completion\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void Test2142 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"enum Name {\n\t$p$\n}\n\", provider => {\n\t\t\t\tAssert.AreEqual (0, provider.Count);\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void Test2142Case2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"enum Name {\n\tFoo,\n\tBar,\n\t$p$\n}\n\", provider => {\n\t\t\t\tAssert.AreEqual (0, provider.Count);\n\t\t\t});\n\t\t}\n\n\n\t\t[Test()]\n\t\tpublic void TestEnumAssignment ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"enum Name {\n\tMember\n\t$, B = M$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Member\"), \"value 'Member' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Name\"), \"type 'Name' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEnumFlags ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\n[Flags]\nenum Name {\n\tFlag1,\n\tFlag2,\n\tCombined = Flag1 $| F$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Flag1\"), \"value 'Flag1' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Flag2\"), \"value 'Flag2' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Name\"), \"type 'Name' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t\n\t\t[Test()]\n\t\tpublic void TestEnumInitializerContinuation()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\n[Flags]\nenum Name {\n\tFlag1,\n\tFlag2,\n\tCombined $= Name.$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Flag1\"), \"value 'Flag1' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Flag2\"), \"value 'Flag2' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestEnumBaseTypes()\n\t\t{\n\t\t\tstring[] integralTypes = { \"byte\", \"sbyte\", \"short\", \"int\", \"long\", \"ushort\", \"uint\", \"ulong\" };\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nenum Name : $b$\n{\n\tFlag1\n}\n\", provider => {\n\t\t\t\tforeach (var type in integralTypes)\n\t\t\t\t\tAssert.IsNotNull(provider.Find(type), \"value '\" + type + \"' not found.\");\n\t\t\t\tAssert.IsNull(provider.Find(\"char\"), \"type 'char' found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestEnumBaseTypesAutoPopup()\n\t\t{\n\t\t\tstring[] integralTypes = { \"byte\", \"sbyte\", \"short\", \"int\", \"long\", \"ushort\", \"uint\", \"ulong\" };\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(\n@\"using System;\n$enum Name : $\n\");\n\t\t\tforeach (var type in integralTypes)\n\t\t\t\tAssert.IsNotNull(provider.Find(type), \"value '\" + type + \"' not found.\");\n\t\t\tAssert.IsNull(provider.Find(\"char\"), \"type 'char' found.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 5444 - Missing completion values when declaring enum \n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void Test5444 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"enum Foo\n{\n    Bar = 1 << 0,\n    Baz = 1 << 1,\n    BarBaz $= B$\n}\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Bar\"), \"value 'Bar' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Baz\"), \"value 'Baz' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void Test5444Case2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"enum Foo\n{\n    Bar = 1 << 0,\n    Baz = 1 << 1,\n    BarBaz = Bar$ | B$\n}\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Bar\"), \"value 'Bar' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"Baz\"), \"value 'Baz' not found.\");\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/FormatItemTests.cs",
    "content": "//\n// FormatItemTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class FormatItemTests : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestFormatItem ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\t$string.Format(\"\" {0:$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.Greater(provider.Count, 0); \n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestFalsePositive ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test ()\n\t{\n\t\t$Console.WriteLine (\"\"Hello :$\n\t}\n}\");\n\t\t\tAssert.IsTrue(provider == null || provider.Count == 0); \n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFormatItemRecognition ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test (Guid i)\n\t{\n\t\tstring.Format(\"\" ${0:$\"\", i);\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.AreEqual(4, provider.Count); \n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDontShowupCase ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test (string i)\n\t{\n\t\tstring.Format(\"\" ${1:$\"\", 12, i);\n\t}\n}\");\n\t\t\tAssert.IsTrue(provider == null || provider.Count == 0); \n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIntToString ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"\nclass TestClass\n{\n\tpublic void Test (int i)\n\t{\n\t\t$i.ToString(\"\"$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.Greater(provider.Count, 0); \n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestDateTimeToString ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test (DateTime i)\n\t{\n\t\t$i.ToString(\"\"$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.Greater(provider.Count, 0); \n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestGuidToString ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test (Guid i)\n\t{\n\t\t$i.ToString(\"\"$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.Greater(provider.Count, 0); \n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestTimeSpanToString ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test (TimeSpan i)\n\t{\n\t\t$i.ToString(\"\"$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.Greater(provider.Count, 0); \n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestEnumToString ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test (ConsoleKey i)\n\t{\n\t\t$i.ToString(\"\"$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider);\n\t\t\tAssert.Greater(provider.Count, 0); \n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/GetCurrentParameterIndexTests.cs",
    "content": "//\n// GetCurrentParameterIndexTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Completion;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class GetCurrentParameterIndexTests\n\t{\n\t\tstatic int GetIndex(string text)\n\t\t{\n\t\t\tvar editorText = new StringBuilder();\n\t\t\tint trigger = 0, end = 0;\n\t\t\tfor (int i = 0; i < text.Length; i++) {\n\t\t\t\tif (text[i] == '@') {\n\t\t\t\t\ttrigger = editorText.Length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (text[i] == '$') {\n\t\t\t\t\tend = editorText.Length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\teditorText.Append(text [i]);\n\t\t\t}\n\n\t\t\tvar doc = new ReadOnlyDocument(editorText.ToString ());\n\t\t\tvar pctx = new CSharpProjectContent();\n\t\t\tvar rctx = new CSharpTypeResolveContext(pctx.CreateCompilation().MainAssembly);\n\t\t\tvar ctxProvider = new DefaultCompletionContextProvider(doc, new CSharpUnresolvedFile());\n\t\t\tvar engine = new CSharpParameterCompletionEngine(doc, ctxProvider, new ParameterCompletionTests.TestFactory(pctx), pctx, rctx);\n\n\t\t\treturn engine.GetCurrentParameterIndex(trigger, end);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFirstParameterStart ()\n\t\t{\n\t\t\tvar index = GetIndex(\"@Test($\");\n\t\t\tAssert.AreEqual(0, index);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFirstParameter ()\n\t\t{\n\t\t\tvar index = GetIndex(\"@Test(foo$\");\n\t\t\tAssert.AreEqual(1, index);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSecondParameter ()\n\t\t{\n\t\t\tvar index = GetIndex(\"@Test(foo, $\");\n\t\t\tAssert.AreEqual(2, index);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestAfterMethod ()\n\t\t{\n\t\t\tvar index = GetIndex(\"@Test(foo) $\");\n\t\t\tAssert.AreEqual(-1, index);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJaggedMethod ()\n\t\t{\n\t\t\tvar index = GetIndex(\"@Foo(Test($\");\n\t\t\tAssert.AreEqual(-1, index);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ImportCompletionTests.cs",
    "content": "//\n// ImportCompletionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\n\nusing ICSharpCode.NRefactory.Completion;\nusing ICSharpCode.NRefactory.CSharp.Completion;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class ImportCompletionTests\n\t{\n\t\tpublic static CompletionDataList CreateProvider(string text, params IUnresolvedAssembly[] references)\n\t\t{\n\t\t\tint cursorPosition;\n\t\t\tvar engine = CodeCompletionBugTests.CreateEngine(text, out cursorPosition, references);\n\t\t\tvar data = engine.GetImportCompletionData (cursorPosition);\n\t\t\t\n\t\t\treturn new CompletionDataList () {\n\t\t\t\tData = data,\n\t\t\t\tAutoCompleteEmptyMatch = engine.AutoCompleteEmptyMatch,\n\t\t\t\tAutoSelect = engine.AutoSelect,\n\t\t\t\tDefaultCompletionString = engine.DefaultCompletionString\n\t\t\t};\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tvar provider = CreateProvider(@\"\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$\n\t}\n}\n\");\n\t\t\t\n\t\t\tvar data = provider.Find (\"AppDomain\", true) as CodeCompletionBugTests.TestFactory.ImportCompletionData;\n\t\t\tAssert.NotNull(data);\n\t\t\tAssert.AreEqual(\"System\", data.Type.Namespace);\n\t\t\tAssert.False(data.UseFullName);\n\n\t\t\tdata = provider.Find (\"File\", true) as CodeCompletionBugTests.TestFactory.ImportCompletionData;\n\t\t\tAssert.NotNull(data);\n\t\t\tAssert.AreEqual(\"System.IO\", data.Type.Namespace);\n\t\t\tAssert.False(data.UseFullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestHiding ()\n\t\t{\n\t\t\tvar provider = CreateProvider(@\"using System;\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$\n\t}\n}\n\");\n\t\t\t\n\t\t\tvar data = provider.Find (\"AppDomain\", true) as CodeCompletionBugTests.TestFactory.ImportCompletionData;\n\t\t\tAssert.IsNull(data);\n\t\t\t\n\t\t\tdata = provider.Find (\"File\", true) as CodeCompletionBugTests.TestFactory.ImportCompletionData;\n\t\t\tAssert.NotNull(data);\n\t\t\tAssert.AreEqual(\"System.IO\", data.Type.Namespace);\n\t\t\tAssert.False(data.UseFullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFullName ()\n\t\t{\n\t\t\tvar provider = CreateProvider(@\"using Foo;\n\nnamespace Foo {\n\tpublic class AppDomain {}\n}\n\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$\n\t}\n}\n\");\n\t\t\t\n\t\t\tvar data = provider.Find (\"AppDomain\", true) as CodeCompletionBugTests.TestFactory.ImportCompletionData;\n\t\t\tAssert.NotNull(data);\n\t\t\tAssert.True(data.UseFullName);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAutomaticImport ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$c$\n\t}\n}\");\n\t\t\tvar data = provider.Find (\"Console\", true) as CodeCompletionBugTests.TestFactory.ImportCompletionData;\n\t\t\tAssert.NotNull(data);\n\t\t\tAssert.False(data.UseFullName);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAutomaticImportClash1 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(@\"class Console {}\n\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$c$\n\t}\n}\");\n\t\t\tvar data = provider.Data.OfType<CodeCompletionBugTests.TestFactory.ImportCompletionData>().Single(d => d.DisplayText == \"Console\");\n\t\t\tAssert.NotNull(data);\n\t\t\tAssert.True(data.UseFullName);\n\n\t\t}\n\n\t\t[Ignore(\"Too slow atm :(\")]\n\t\t[Test]\n\t\tpublic void TestAutomaticImportLocalClash ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(@\"\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint Console = 12;\n\t\t$c$\n\t}\n}\");\n\t\t\tvar data = provider.Data.OfType<CodeCompletionBugTests.TestFactory.ImportCompletionData>().Single(d => d.DisplayText == \"Console\");\n\t\t\tAssert.NotNull(data);\n\t\t\tAssert.True(data.UseFullName);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAutomaticHiding ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider(@\"using System.Collections.Generic;\n\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$D$\n\t}\n}\");\n\t\t\tvar data = provider.Data.OfType<CodeCompletionBugTests.TestFactory.ImportCompletionData>().FirstOrDefault(d => d.DisplayText == \"Dictionary\");\n\t\t\tAssert.IsNull(data);\n\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/KeywordTests.cs",
    "content": "// \n// KeywordTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Parser;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture()]\n\tpublic class KeywordTests : TestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestTooManyOptions ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$public S$\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"class\"), \"keyword 'class' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"System\"), \"'System' found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void CaseKeywordTest ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Class\n{\n\tvoid Test (string t)\n\t{\n\t\tswitch (t) {\n\t\t\t$c$\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"case\"), \"keyword 'case' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void CatchKeywordTest ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Class\n{\n\tvoid Test (string t)\n\t{\n\t\t$try {} c$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"catch\"), \"keyword 'catch' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void CaseKeywordTestCase2 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Class\n{\n\tvoid Test (string t)\n\t{\n\t\t$c$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNull (provider.Find (\"case\"), \"keyword 'case' found.\");\n\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void CaseKeywordTestCase3 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass Class\n{\nvoid Test (string t)\n{\n\tswitch (t) {\n\t\tcase \"\"test\"\":\n\t\t$c$\n\t}\n}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"case\"), \"keyword 'case' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void ModifierKeywordTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"\n$p$\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"public\"), \"keyword 'public' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"namespace\"), \"keyword 'namespace' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void ModifierKeywordTestCase2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"\nclass Test \n{\n\t$p$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"public\"), \"keyword 'public' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"namespace\"), \"keyword 'namespace' found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void GetSetKeywordTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"class Test\n{\n\tpublic int MyProperty {\n\t\t$g$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"public\"), \"keyword 'public' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"get\"), \"keyword 'get' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"set\"), \"keyword 'set' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void GetSetKeywordIndexerCaseTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"class Test\n{\n\tpublic int this[int i] {\n\t\t$g$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"public\"), \"keyword 'public' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"get\"), \"keyword 'get' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"set\"), \"keyword 'set' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void GetSetKeywordTestAfterModifier ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"class Test\n{\n\tpublic int MyProperty {\n\t\tinternal $g$\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"get\"), \"keyword 'get' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"set\"), \"keyword 'set' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void AddRemoveKeywordTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic event EventHandler MyProperty {\n\t\t$g$\n}\n\", (provider) => {\n\t\t\t\tAssert.AreEqual (2, provider.Count);\n\t\t\t\tAssert.IsNotNull (provider.Find (\"add\"), \"keyword 'add' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"remove\"), \"keyword 'remove' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void IsAsKeywordTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic void Method ()\n\t{\n\t\tvoid TestMe (object o)\n\t\t{\n\t\t\tif (o $i$\n\t\t}\n\t}\n}\n\", (provider) => {\n\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\tAssert.IsNotNull (provider.Find (\"is\"), \"keyword 'is' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"as\"), \"keyword 'as' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void PublicClassContextTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"$c$\",\nprovider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"class\"), \"keyword 'class' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"static\"), \"keyword 'static' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sealed\"), \"keyword 'sealed' not found.\");\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void PublicClassContextTest2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"public $c$\",\nprovider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"class\"), \"keyword 'class' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"static\"), \"keyword 'static' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sealed\"), \"keyword 'sealed' not found.\");\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void PublicClassContextTestContinuation1 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"public static $c$\",\nprovider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"class\"), \"keyword 'class' not found.\");\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void PublicClassContextTestContinuation2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"public sealed $c$\",\nprovider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"class\"), \"keyword 'class' not found.\");\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void StatementKeywordTests ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic void MyMethod ()\n\t{\n\t\t$s$\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"bool\"), \"keyword 'bool' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"char\"), \"keyword 'char' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"byte\"), \"keyword 'byte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sbyte\"), \"keyword 'sbyte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"int\"), \"keyword 'int' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"uint\"), \"keyword 'uint' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"short\"), \"keyword 'short' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ushort\"), \"keyword 'ushort' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"long\"), \"keyword 'long' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ulong\"), \"keyword 'ulong' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"float\"), \"keyword 'float' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"double\"), \"keyword 'double' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"decimal\"), \"keyword 'decimal' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"const\"), \"keyword 'const' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"dynamic\"), \"keyword 'dynamic' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"var\"), \"keyword 'var' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"do\"), \"keyword 'do' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"while\"), \"keyword 'while' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"for\"), \"keyword 'for' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"foreach\"), \"keyword 'foreach' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"goto\"), \"keyword 'goto' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"break\"), \"keyword 'break' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"continue\"), \"keyword 'continue' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"return\"), \"keyword 'return' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"throw\"), \"keyword 'throw' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"fixed\"), \"keyword 'fixed' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"using\"), \"keyword 'using' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"lock\"), \"keyword 'lock' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"true\"), \"keyword 'true' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"false\"), \"keyword 'false' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"null\"), \"keyword 'null' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"typeof\"), \"keyword 'typeof' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sizeof\"), \"keyword 'sizeof' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"from\"), \"keyword 'from' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"yield\"), \"keyword 'yield' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"new\"), \"keyword 'new' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void VariableDeclarationTestForCase ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic void MyMethod ()\n\t{\n\t\t$for (s$\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"bool\"), \"keyword 'bool' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"char\"), \"keyword 'char' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"byte\"), \"keyword 'byte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sbyte\"), \"keyword 'sbyte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"int\"), \"keyword 'int' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"uint\"), \"keyword 'uint' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"short\"), \"keyword 'short' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ushort\"), \"keyword 'ushort' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"long\"), \"keyword 'long' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ulong\"), \"keyword 'ulong' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"float\"), \"keyword 'float' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"double\"), \"keyword 'double' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"decimal\"), \"keyword 'decimal' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"var\"), \"keyword 'var' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void VariableDeclarationTestForeachCase ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic void MyMethod ()\n\t{\n\t\t$foreach (s$\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"bool\"), \"keyword 'bool' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"char\"), \"keyword 'char' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"byte\"), \"keyword 'byte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sbyte\"), \"keyword 'sbyte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"int\"), \"keyword 'int' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"uint\"), \"keyword 'uint' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"short\"), \"keyword 'short' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ushort\"), \"keyword 'ushort' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"long\"), \"keyword 'long' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ulong\"), \"keyword 'ulong' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"float\"), \"keyword 'float' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"double\"), \"keyword 'double' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"decimal\"), \"keyword 'decimal' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"var\"), \"keyword 'var' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void VariableDeclarationTestUsingCase ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic void MyMethod ()\n\t{\n\t\t$foreach (s$\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"bool\"), \"keyword 'bool' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"char\"), \"keyword 'char' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"byte\"), \"keyword 'byte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sbyte\"), \"keyword 'sbyte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"int\"), \"keyword 'int' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"uint\"), \"keyword 'uint' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"short\"), \"keyword 'short' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ushort\"), \"keyword 'ushort' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"long\"), \"keyword 'long' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ulong\"), \"keyword 'ulong' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"float\"), \"keyword 'float' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"double\"), \"keyword 'double' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"decimal\"), \"keyword 'decimal' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"var\"), \"keyword 'var' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void RefOutParamsTest1 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\t$public void MyMethod (o$\n}\n\", (provider) => {\n\t\t\t\tConsole.WriteLine (provider.Count);\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ref\"), \"keyword 'ref' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"out\"), \"keyword 'out' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"params\"), \"keyword 'params' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void RefOutParamsTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic void MyMethod ()\n\t{\n\t\t$Call(i$\n\t}\n}\n\", (provider) => {\n\t\t\t\tConsole.WriteLine (provider.Count);\n\t\t\t\t\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ref\"), \"keyword 'ref' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"out\"), \"keyword 'out' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"params\"), \"keyword 'params' found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void VariableDeclarationTestMethodDeclarationCase ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\t$public void MyMethod (s$\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"bool\"), \"keyword 'bool' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"char\"), \"keyword 'char' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"byte\"), \"keyword 'byte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"sbyte\"), \"keyword 'sbyte' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"int\"), \"keyword 'int' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"uint\"), \"keyword 'uint' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"short\"), \"keyword 'short' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ushort\"), \"keyword 'ushort' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"long\"), \"keyword 'long' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"ulong\"), \"keyword 'ulong' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"float\"), \"keyword 'float' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"double\"), \"keyword 'double' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"decimal\"), \"keyword 'decimal' not found.\");\n\t\t\t\t\n\t\t\t\tAssert.IsNull (provider.Find (\"var\"), \"keyword 'var' found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void ForeachInKeywordTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\nclass Test\n{\n\tpublic void Method ()\n\t{\n\t\t$foreach (var o i$\n\t}\n}\n\", (provider) => {\n\t\t\t\t// Either empty list or in - both behaviours are ok.\n\t\t\t\tif (provider.Count > 0)\n\t\t\t\t\tAssert.IsNotNull (provider.Find (\"in\"), \"keyword 'in' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OverrideCompletionDeclarationBeginTest ()\n\t\t{\n\t\t\tvar start = @\"class A { public virtual void FooBar () {} }\nclass Test : A\n{\n\t\";\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (start + \"$override $\\n}\");\n\t\t\t\n\t\t\tvar data = provider.Find(\"FooBar\") as CodeCompletionBugTests.TestFactory.OverrideCompletionData;\n\t\t\tAssert.AreEqual(start.Length, data.DeclarationBegin);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PartialCompletionDeclarationBeginTest ()\n\t\t{\n\t\t\tvar start = @\"partial class A { partial void FooBar (); }\npartial class A\n{\n\t\";\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (start + \"$partial $\\n}\");\n\t\t\t\n\t\t\tvar data = provider.Find(\"FooBar\") as CodeCompletionBugTests.TestFactory.OverrideCompletionData;\n\t\t\tAssert.AreEqual(start.Length, data.DeclarationBegin);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IsTypeKeywordTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"using System;\nclass Test\n{\npublic void Method ()\n{\nvoid TestMe (object o)\n{\nif (o is $s$\n}\n}\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"string\"), \"keyword 'string' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AsTypeKeywordTest ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"using System;\nclass Test\n{\npublic void Method ()\n{\nvoid TestMe (object o)\n{\nif (o as $s$\n}\n}\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"string\"), \"keyword 'string' not found.\");\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ForeachInKeyword ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"using System;\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$foreach (var foo i$\n\t}\n}\n\", (provider) => {\n\t\t\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\t\tAssert.IsNotNull (provider.Find (\"in\"), \"keyword 'in' not found.\");\n\t\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ForeachInKeyword_NestedCase ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\t\t\t\t@\"using System;\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$foreach (var foo in args)\n\t\t\tforeach (var c i$\n\t}\n}\n\", (provider) => {\n\t\t\t\t\tAssert.IsNotNull (provider, \"provider == null\");\n\t\t\t\t\tAssert.IsNotNull (provider.Find (\"in\"), \"keyword 'in' not found.\");\n\t\t\t\t});\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/NameContextTests.cs",
    "content": "// \n// NameContextTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\n\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class NameContextTests : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestNamespaceName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$namespace n$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestNamespaceNameCase2 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$namespace $\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNamespaceNameCase3 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$namespace Foo.b$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNamespaceNameCase4 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$namespace Foo.$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$class n$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestStructName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$struct n$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInterfaceName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$interface n$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestEnumName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$enum n$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestDelegateName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$delegate void n$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestClassTypeParameter ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$class MyClass<T$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestFieldName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\t$int f$\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestParameterName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\t$void SomeMethod(int f$\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLocalVariableName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\tvoid Test() \n\t{\n\t\t$int f$\n\t}\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestForeachLocalVariableName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\tvoid Test() \n\t{\n\t\t$foreach (int f$\n\t}\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForLoopLocalVariableName ()\n\t\t{\n\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\tvoid Test() \n\t{\n\t\t$for (int f$\n\t}\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCatchExceptionName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\tvoid Test() \n\t{\n\t\t$try {\n\t\t} catch (Exception e$\n\t}\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t\t/// <summary>\n\t\t/// Bug 2198 - Typing generic argument to a class/method pops up type completion window\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug2198 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"$class Klass <T$\", provider => {\n\t\t\t\tAssert.AreEqual (0, provider.Count, \"provider needs to be empty\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBug2198Case2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"$class Klass { void Test<T$\", provider => {\n\t\t\t\tAssert.AreEqual (0, provider.Count, \"provider needs to be empty\");\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerParameterName ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\t$public int this [int f$\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t\tprovider = CodeCompletionBugTests.CreateProvider (@\"class MyClass {\n\t$public int this [int f, string x$\n}\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 11609 - Completion engine offers namespaces when user types anonymous method parameter name\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug11609 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"using System;\n\nnamespace MyApplication\n{\n   class MyClass\n   {\n        void MyMethod ()\n        {\n            $SomeMethod (configurator: (Type s$\n        }\n\n        void SomeMethod (Action <Type> configurator)\n        {}\n    }\n}\n\", provider => Assert.AreEqual(0, provider.Count, \"provider needs to be empty\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13365 - Suggestion context lost after ( in lambda args\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13365 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"using System;\nusing System.Threading.Tasks;\n\nnamespace MyApplication\n{\n   class MyClass\n   {\n        void MyMethod ()\n        {\n            $Task.Factory.StartNew ((a$\n        }\n    }\n}\n\", provider => {\n\n\t\t\t\tAssert.IsFalse (provider.AutoSelect);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambda ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"using System;\nusing System.IO;\n\nclass Foo\n{\n\tstatic void Foo (Action<File> act) {}\n\n\tpublic static void Main (string[] args)\n\t{\n\t\t$Foo((File f$\n\t}\n}\n\", provider => Assert.AreEqual(0, provider.Count, \"provider needs to be empty\"));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 16491 - Wrong completion on multiple parameter lambdas\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16491 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\nusing System.IO;\n\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$new Action<int, int> ((x, y$\n\t}\n}\n\", provider => Assert.AreEqual(0, provider.Count, \"provider needs to be empty\"));\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug16491Case2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"\nusing System;\nusing System.IO;\n\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tnew Action<int, int> ((x$, y$)\n\t}\n}\n\", provider => Assert.AreEqual(0, provider.Count, \"provider needs to be empty\"));\n\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ObjectInitializerTests.cs",
    "content": "// \n// ObjectInitializerTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\tpublic class ObjectInitializerTests : TestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestArrayInitializerStart ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new [] { M$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Tuple\"), \"class 'MyTest' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestArrayInitializerSimple ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new [] { Tuple.$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Create\"), \"method 'Create' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 432727 - No completion if no constructor\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestArrayInitializerParameterContext ()\n\t\t{\n\t\t\tvar provider = ParameterCompletionTests.CreateProvider (\n@\"using System;\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new [] { Tuple.Create($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.Greater (provider.Count, 1);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 487236 - Object initializer completion uses wrong type\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug487236 ()\n\t\t{\n\t\t\tCompletionDataList provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic class A\n{\n\tpublic string Name { get; set; }\n}\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new A () { $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNotNull (provider.Find (\"Name\"), \"property 'Name' not found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 487236 - Object initializer completion uses wrong type\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug487236B ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\npublic class A\n{\n\tpublic string Name { get; set; }\n}\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$A x = new NotExists () { $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\t\n\t\t\tAssert.IsNull (provider.Find (\"Name\"), \"property 'Name' found, but shouldn't'.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"\npublic class A\n{\n\tpublic int Test;\n}\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new A () { T$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"field 'Test' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestProperty ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"\npublic class A\n{\n\tpublic int Test { get; set; }\n}\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new A () { T$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Test\"), \"property 'Test' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\t\n/// <summary>\n\t\t/// Bug 526667 - wrong code completion in object initialisation (new O() {...};)\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug526667 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nusing System;\nusing System.Collections.Generic;\n\npublic class O\n{\n\tpublic string X {\n\t\tget;\n\t\tset;\n\t}\n\tpublic string Y {\n\t\tget;\n\t\tset;\n\t}\n\tpublic List<string> Z {\n\t\tget;\n\t\tset;\n\t}\n\n\tpublic static O A ()\n\t{\n\t\treturn new O {\n\t\t\tX = \"\"x\"\",\n\t\t\tZ = new List<string> (new string[] {\n\t\t\t\t\"\"abc\"\",\n\t\t\t\t\"\"def\"\"\n\t\t\t})\n\t\t\t$, $\n\t\t};\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Y\"), \"property 'Y' not found.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestObjectInitializer ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"class foo {\n\tpublic string bar { get; set; }\n\tpublic string baz { get; set; }\n}\n\nclass test {\n\tpublic void testcc ()\n\t{\n\t\tnew foo () {\n\t\t\t$b$\n\t\t};\n\t}\n}\n\", provider => {\n\t\t\tAssert.IsNotNull (provider.Find (\"bar\"), \"property 'bar' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"baz\"), \"property 'baz' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\n\t\t/// <summary>\n\t\t/// Bug 1745 - [New Resolver] Invalid completion in class initialization\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug1745 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n\n@\"class Test {\n\tpublic int TF1 { get; set; }\n}\n\nclass CCTest {\n\tvoid TestMethod ()\n\t{\n\t\t$new Test () { TF1 = T$\n\t}\n}\n\", provider => {\n\t\t\tAssert.IsNull (provider.Find (\"TF1\"));\n\t\t\tAssert.IsNotNull (provider.Find (\"Test\"));\n\t\t\t});\n\t\t}\t\n\t\t\n\t\t[Test()]\n\t\tpublic void TestBugAfterBracketContext ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"class Test {\n\tpublic int TF1 { get; set; }\n}\n\nclass CCTest {\n\tvoid TestMethod ()\n\t{\n\t\t$new Test () {$\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 487236 - Object initializer completion uses wrong type\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestObjectInitializerContinuation ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"\npublic class A\n{\n\tpublic string Name { get; set; }\n}\n\nclass MyTest\n{\n\tstatic string Str = \"\"hello\"\";\n\n\tpublic void Test ()\n\t{\n\t\t$var x = new A () { Name = MyTest.$\n\t}\n}\n\", provider => {\n\t\t\tAssert.IsNotNull (provider.Find (\"Str\"), \"field 'Str' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 2434 - Object-Initializer Intellisense broken when using constructor arguments\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug2434 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"\nclass User\n{\n  public User() {}\n  public User(int id) { }\n\n  public string Id { get; set; }\n  public string Name { get; set; }\n}\n\nclass MyTest\n{\n\tstatic string Str = \"\"hello\"\";\n\n\tpublic void Test ()\n\t{\n\t\t$new User(12) { \n\t\t\tN$\n\t}\n}\n\", provider => {\n\t\t\tAssert.IsNotNull (provider.Find (\"Id\"), \"Property 'Id' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"Name\"), \"Property 'Name' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestBug2434Case2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"\nclass User\n{\n  public User() {}\n  public User(int id) { }\n\n  public string Id { get; set; }\n  public string Name { get; set; }\n}\n\nclass MyTest\n{\n\tstatic string Str = \"\"hello\"\";\n\n\tpublic void Test ()\n\t{\n\t\tstring myString;\n\n\t\t$new User(12) { \n\t\t\tName = S$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNull (provider.Find (\"Id\"), \"Property 'Id' found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"Name\"), \"Property 'Name' found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"Str\"), \"Field 'Str' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"myString\"), \"Local 'myString' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestNewKeywordInInitializer ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (\n@\"using System;\n\nclass O\n{\n\tpublic int Int { get; set; }\n\tpublic object Obj { get; set; }\n}\n\nclass Test\n{\n\tpublic void Method ()\n\t{\n\t\t$var foo = new O() { Int = 5, Obj = n$\n\t}\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"new\"), \"keyword 'new' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestCollectionInitializer()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tpublic void Method ()\n\t{\n\t\tnew List<Test> () {\n\t\t\t$n$\n\t\t};\n\t}\n}\n\", (provider) => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"new\"), \"keyword 'new' not found.\");\n\t\t\t});\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 4284 - NewResolver does not offer completion for properties in constructor initialization (edit)\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug4284()\n\t\t{\n\t\t\t// only affects ctrl+space completion.\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider(\n@\"public class ClassName\n{\n\tpublic int Foo { get; set; }\n}\nclass MainClass\n{\n\tvoid Method ()\n\t{\n\t\tvar stuff = new ClassName  {\n\t\t\t$\n\t\t};\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull(provider.Find(\"Foo\"), \"'Foo' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestArrayInitializerObjectCreation()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\n\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new IEnumerable<string>[] { new L$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"List<string>\"), \"class 'List<string>' not found.\");\n\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestArrayInitializerObjectCreationNarrowing()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\nclass MyList : List<IEnumerable<string>> {}\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new MyList { new L$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"List<string>\"), \"class 'List<string>' not found.\");\n\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestObjectCreationEnumerable()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\nclass MyList : List<IEnumerable<string>> { public bool MyProp {get;set; } }\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new MyList { n$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"new\"), \"'new' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"MyProp\"), \"'MyProp' not found.\");\n\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestObjectCreationForbiddenInArrayInitializers()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\nclass MyList : List<IEnumerable<string>> { public bool MyProp {get;set; } }\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new MyList { new List<string> (), n$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"new\"), \"'new' not found.\");\n\t\t\t\tAssert.IsNull(provider.Find(\"MyProp\"), \"'MyProp' found.\");\n\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestArrayInitializersForbiddenInObjectCreation()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\nclass MyList : List<IEnumerable<string>> { public bool MyProp {get;set; }  public bool MyProp2 {get;set; }  }\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new MyList { MyProp = true, n$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNull(provider.Find(\"new\"), \"'new' found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"MyProp2\"), \"'MyProp2' not found.\");\n\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 5126 - Multiple projects including the same files don't update their typesystem properly\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug5126()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n@\"using System;\nusing System.Collections.Generic;\nclass MyList { public bool MyProp {get;set; }  public bool MyProp2 {get;set; }  }\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$new MyList { n$\n\t}\n}\n\", provider => {\n\t\t\t\tAssert.IsNull(provider.Find(\"new\"), \"'new' found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"MyProp\"), \"'MyProp' not found.\");\n\t\t\t\tAssert.IsNotNull(provider.Find(\"MyProp2\"), \"'MyProp2' not found.\");\n\t\t\t}\n\t\t\t);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 7383 - Object initializer completion inaccessible\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug7383()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider(\n\t\t\t\t@\"using System.Runtime.InteropServices;\n\nclass S\n{\n    public int Foo { get; protected set; }\n    public int Bar { get; set; }\n}\n\nclass C\n{\n    public static void Main ()\n    {\n        var s = new S () {\n            $Fo$\n        };\n    }\n}\n\n\");\n\t\t\tAssert.IsNull(provider.Find(\"Foo\"), \"'Foo' found.\");\n\t\t\tAssert.IsNotNull(provider.Find(\"Bar\"), \"'Bar' not found.\");\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestBug7383Case2()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider(\n\t\t\t\t@\"using System.Runtime.InteropServices;\n\nclass S\n{\n    public int Foo { get; protected set; }\n    public int Bar { get; set; }\n}\n\nclass C : S\n{\n    public static void Main ()\n    {\n        var s = new C () {\n            $Fo$\n        };\n    }\n}\n\n\");\n\t\t\tAssert.IsNotNull(provider.Find(\"Foo\"), \"'Foo' found.\");\n\t\t\tAssert.IsNotNull(provider.Find(\"Bar\"), \"'Bar' not found.\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 9910 - Completion not working in object initializer\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9910()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider(\n\t\t\t\t@\"class Test \n{\n    Test(int i) { }\n    Test(char c) { }\n\n    static Test foo(dynamic d)\n    {\n        return new Test(d) {\n            $f$\n        };\n    }\n\n    public static void Main(string [] args)\n    {\n    }\n\n    int fld;\n    int fld2;\n}\n\n\");\n\t\t\tAssert.IsNotNull(provider.Find(\"fld\"), \"'fld' found.\");\n\t\t\tAssert.IsNotNull(provider.Find(\"fld2\"), \"'fld2' not found.\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 9935 - MD shows decimal constants as fields which can be initalized\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9935()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider(\n\t\t\t\t@\"class Test \n{\n   \n    public static void Main(string [] args)\n    {\n\t\tvar mm = new decimal () {\n            $M$\n        };\n\n    }\n}\n\n\");\n\t\t\tAssert.IsNull(provider.Find(\"MaxValue\"), \"'MaxValue' found.\");\n\t\t\tAssert.IsNull(provider.Find(\"MinValue\"), \"'MinValue' found.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousTypes()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"class Test \n{\n   \n    public static void Main(string [] args)\n    {\n\t\tvar mm = new {\n            $b$\n        };\n\n    }\n}\n\n\", provider => {\n\t\t\t\tAssert.IsTrue(provider == null || provider.Count == 0);\n\t\t\t});\n\t\t\t\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousTypesCase2()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"class Test \n{\n   \n    public static void Main(string [] args)\n    {\n\t\tvar mm = new {\n            $bar = a$\n        };\n\n    }\n}\n\n\", provider => {\n\t\t\t\tAssert.IsNotNull(provider.Find(\"args\"), \"'args' not found.\");\n\t\t\t});\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnfinishedDictionaryInitializer()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"class Test\n{\n\tpublic static void Main(string [] args)\n\t{\n\t\tvar dict = new Dictionary<char, char> {\n\t\t\t{ a$\n\t\t}\n\t}\n}\n\",\n\t\t\t\tprovider => {\n\t\t\t\t\tAssert.IsNotNull(provider.Find(\"args\"), \"'args' not found.\");\n\t\t\t\t});\n\t\t}\t\n\n\t\t/// <summary>\n\t\t/// Bug 19908 - [Forms] Autocomplete doesn't work for the Children property of Forms layouts\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug19908()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"using System.Collections.Generic;\n\nclass Foo\n{\n\tpublic List<int> Children { get {} }\n}\n\nclass Test\n{\n\tpublic static void Main(string [] args)\n\t{\n\t\tvar dict = new Foo {\n\t\t\t$c$\n\t\t}\n\t}\n}\n\",\n\t\t\t\tprovider => Assert.IsNotNull(provider.Find(\"Children\"), \"'Children' not found.\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug19908_Case2()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"using System.Collections.Generic;\n\nclass Foo\n{\n\tpublic IList<int> Children { get {} }\n}\n\nclass Test\n{\n\tpublic static void Main(string [] args)\n\t{\n\t\tvar dict = new Foo {\n\t\t\t$c$\n\t\t}\n\t}\n}\n\",\n\t\t\t\tprovider => {\n\t\t\t\t\tAssert.IsNotNull(provider.Find(\"Children\"), \"'Children' not found.\");\n\t\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 20110 - [Forms] Autocomplete doesn't work for the Placeholder property \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug20110()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest(\n\t\t\t\t@\"\npublic class Entry\n{\n\tpublic string Placeholder { get; set; }\n}\n\nclass Test\n{\n\tpublic static void Main(string [] args)\n\t{\n\t\tvar dict = new Entry {\n\t\t\t$c$\n\t\t};\n\t}\n}\n\",\n\t\t\t\tprovider => Assert.IsNotNull(provider.Find(\"Placeholder\"), \"'Children' not found.\"));\n\t\t}\n\n\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs",
    "content": "﻿//\n// ParameterCompletionTests.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2008 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.Completion;\nusing ICSharpCode.NRefactory.CSharp.Completion;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic class ParameterCompletionTests : TestBase\n\t{\n\t\tinternal class TestFactory : IParameterCompletionDataFactory\n\t\t{\n//\t\t\tIProjectContent ctx;\n\t\t\t\n\t\t\tpublic TestFactory (IProjectContent ctx)\n\t\t\t{\n//\t\t\t\tthis.ctx = ctx;\n\t\t\t}\n\t\t\t\n\t\t\tinternal class Provider : IParameterDataProvider\n\t\t\t{\n\t\t\t\tpublic IEnumerable<IMethod> Data { get; set; }\n\t\t\t\t#region IParameterDataProvider implementation\n\t\t\t\tpublic int StartOffset { get { return 0; } }\n\t\t\t\t\n\t\t\t\tpublic string GetHeading (int overload, string[] parameterDescription, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetDescription (int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetParameterDescription (int overload, int paramIndex)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetParameterName(int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic int GetParameterCount (int overload)\n\t\t\t\t{\n\t\t\t\t\tvar method = Data.ElementAt (overload);\n\t\t\t\t\treturn method.Parameters.Count;\n\t\t\t\t}\n\n\t\t\t\tpublic bool AllowParameterList (int overload)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tpublic int Count {\n\t\t\t\t\tget {\n\t\t\t\t\t\treturn Data.Count ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endregion\n\t\t\t}\n\t\t\t\n\t\t\tclass IndexerProvider : IParameterDataProvider\n\t\t\t{\n\t\t\t\tpublic IEnumerable<IProperty> Data { get; set; }\n\t\t\t\t\n\t\t\t\t#region IParameterDataProvider implementation\n\t\t\t\tpublic int StartOffset { get { return 0; } }\n\n\t\t\t\tpublic string GetHeading (int overload, string[] parameterDescription, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetDescription (int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetParameterDescription (int overload, int paramIndex)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetParameterName(int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic int GetParameterCount (int overload)\n\t\t\t\t{\n\t\t\t\t\tvar method = Data.ElementAt (overload);\n\t\t\t\t\treturn method.Parameters.Count;\n\t\t\t\t}\n\n\t\t\t\tpublic bool AllowParameterList (int overload)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tpublic int Count {\n\t\t\t\t\tget {\n\t\t\t\t\t\treturn Data.Count ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endregion\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tclass ArrayProvider : IParameterDataProvider\n\t\t\t{\n\t\t\t\t#region IParameterDataProvider implementation\n\t\t\t\tpublic int StartOffset { get { return 0; } }\n\n\t\t\t\tpublic string GetHeading (int overload, string[] parameterDescription, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetDescription (int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic string GetParameterDescription (int overload, int paramIndex)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic int GetParameterCount (int overload)\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tpublic string GetParameterName(int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\n\t\t\t\tpublic bool AllowParameterList (int overload)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tpublic int Count {\n\t\t\t\t\tget {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endregion\n\t\t\t}\n\t\t\t\n\t\t\tclass TypeParameterDataProvider : IParameterDataProvider\n\t\t\t{\n\t\t\t\tpublic IEnumerable<IType> Data { get; set; }\n\t\t\t\t#region IParameterDataProvider implementation\n\t\t\t\tpublic int StartOffset { get { return 0; } }\n\t\t\t\t\n\t\t\t\tpublic string GetHeading (int overload, string[] parameterDescription, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic string GetDescription (int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic string GetParameterDescription (int overload, int paramIndex)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic string GetParameterName(int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic int GetParameterCount (int overload)\n\t\t\t\t{\n\t\t\t\t\tvar data = Data.ElementAt (overload);\n\t\t\t\t\treturn data.TypeParameterCount;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic bool AllowParameterList (int overload)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic int Count {\n\t\t\t\t\tget {\n\t\t\t\t\t\treturn Data.Count ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endregion\n\t\t\t}\n\n\t\t\tclass MethodTypeParameterDataProvider : IParameterDataProvider\n\t\t\t{\n\t\t\t\tpublic IEnumerable<IMethod> Data { get; set; }\n\t\t\t\t#region IParameterDataProvider implementation\n\t\t\t\tpublic int StartOffset { get { return 0; } }\n\t\t\t\t\n\t\t\t\tpublic string GetHeading (int overload, string[] parameterDescription, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic string GetDescription (int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic string GetParameterDescription (int overload, int paramIndex)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic string GetParameterName(int overload, int currentParameter)\n\t\t\t\t{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic int GetParameterCount (int overload)\n\t\t\t\t{\n\t\t\t\t\tvar data = Data.ElementAt (overload);\n\t\t\t\t\treturn data.TypeArguments.Count;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic bool AllowParameterList (int overload)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpublic int Count {\n\t\t\t\t\tget {\n\t\t\t\t\t\treturn Data.Count ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endregion\n\t\t\t}\n\t\t\t\n\t\t\t#region IParameterCompletionDataFactory implementation\n\t\t\tpublic IParameterDataProvider CreateConstructorProvider(int startOffset, IType type)\n\t\t\t{\n\t\t\t\tAssert.IsTrue(type.Kind != TypeKind.Unknown);\n\t\t\t\treturn new Provider {\n\t\t\t\t\tData = type.GetConstructors (m => m.Accessibility == Accessibility.Public)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tpublic IParameterDataProvider CreateConstructorProvider(int startOffset, IType type, AstNode skipNode)\n\t\t\t{\n\t\t\t\tAssert.IsTrue(type.Kind != TypeKind.Unknown);\n\t\t\t\treturn new Provider {\n\t\t\t\t\tData = type.GetConstructors (m => m.Accessibility == Accessibility.Public)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tpublic IParameterDataProvider CreateMethodDataProvider (int startOffset, IEnumerable<IMethod> methods)\n\t\t\t{\n\t\t\t\treturn new Provider {\n\t\t\t\t\tData = methods\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tpublic IParameterDataProvider CreateDelegateDataProvider(int startOffset, IType type)\n\t\t\t{\n\t\t\t\tAssert.IsTrue(type.Kind != TypeKind.Unknown);\n\t\t\t\treturn new Provider {\n\t\t\t\t\tData = new [] { type.GetDelegateInvokeMethod () }\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\tpublic IParameterDataProvider CreateIndexerParameterDataProvider(int startOffset, IType type, IEnumerable<IProperty> accessibleIndexers, AstNode resolvedNode)\n\t\t\t{\n\t\t\t\tAssert.IsTrue(type.Kind != TypeKind.Unknown);\n\t\t\t\tif (type.Kind == TypeKind.Array)\n\t\t\t\t\treturn new ArrayProvider ();\n\t\t\t\treturn new IndexerProvider {\n\t\t\t\t\tData = accessibleIndexers\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\tpublic IParameterDataProvider CreateTypeParameterDataProvider (int startOffset, IEnumerable<IType> types)\n\t\t\t{\n\t\t\t\treturn new TypeParameterDataProvider {\n\t\t\t\t\tData = types\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tpublic IParameterDataProvider CreateTypeParameterDataProvider (int startOffset, IEnumerable<IMethod> methods)\n\t\t\t{\n\t\t\t\treturn new MethodTypeParameterDataProvider {\n\t\t\t\t\tData = methods\n\t\t\t\t};\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t\t\n\t\tinternal static IParameterDataProvider CreateProvider(string text)\n\t\t{\n\t\t\tstring parsedText;\n\t\t\tstring editorText;\n\t\t\tint cursorPosition = text.IndexOf('$');\n\t\t\tint endPos = text.IndexOf('$', cursorPosition + 1);\n\t\t\tif (endPos == -1) {\n\t\t\t\tparsedText = editorText = text.Substring(0, cursorPosition) + text.Substring(cursorPosition + 1);\n\t\t\t} else {\n\t\t\t\tparsedText = text.Substring(0, cursorPosition) + new string(' ', endPos - cursorPosition) + text.Substring(endPos + 1);\n\t\t\t\teditorText = text.Substring(0, cursorPosition) + text.Substring(cursorPosition + 1, endPos - cursorPosition - 1) + text.Substring(endPos + 1);\n\t\t\t\tcursorPosition = endPos - 1; \n\t\t\t}\n\t\t\tvar doc = new ReadOnlyDocument(editorText);\n\n\t\t\tIProjectContent pctx = new CSharpProjectContent();\n\t\t\tpctx = pctx.AddAssemblyReferences(new [] { CecilLoaderTests.Mscorlib, CecilLoaderTests.SystemCore });\n\t\t\t\n\t\t\tvar syntaxTree = new CSharpParser().Parse(parsedText, \"program.cs\");\n\t\t\tsyntaxTree.Freeze();\n\t\t\t\n\t\t\tvar unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tpctx = pctx.AddOrUpdateFiles(unresolvedFile);\n\t\t\tvar cmp = pctx.CreateCompilation();\n\t\t\tvar loc = doc.GetLocation(cursorPosition);\n\t\t\t\n\t\t\t\n\t\t\tvar rctx = new CSharpTypeResolveContext(cmp.MainAssembly);\n\t\t\trctx = rctx.WithUsingScope(unresolvedFile.GetUsingScope(loc).Resolve(cmp));\n\t\t\tvar curDef = unresolvedFile.GetInnermostTypeDefinition(loc);\n\t\t\tif (curDef != null) {\n\t\t\t\trctx = rctx.WithCurrentTypeDefinition(curDef.Resolve(rctx).GetDefinition());\n\t\t\t\tvar curMember = unresolvedFile.GetMember(loc);\n\t\t\t\tif (curMember != null) {\n\t\t\t\t\trctx = rctx.WithCurrentMember(curMember.CreateResolved(rctx));\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar mb = new DefaultCompletionContextProvider(doc, unresolvedFile);\n\t\t\tvar engine = new CSharpParameterCompletionEngine (doc, mb, new TestFactory (pctx), pctx, rctx);\n\t\t\treturn engine.GetParameterDataProvider (cursorPosition, doc.GetCharAt (cursorPosition - 1));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 427448 - Code Completion: completion of constructor parameters not working\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug427448 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"class Test\n{\n\tpublic Test (int a)\n\t{\n\t}\n\t\n\tpublic Test (string b)\n\t{\n\t}\n\tprotected Test ()\n\t{\n\t}\n\tTest (double d, float m)\n\t{\n\t}\n}\n\nclass AClass\n{\n\tvoid A()\n\t{\n\t\t$Test t = new Test ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (2, provider.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 432437 - No completion when invoking delegates\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug432437 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"public delegate void MyDel (int value);\n\nclass Test\n{\n\tMyDel d;\n\n\tvoid A()\n\t{\n\t\t$d ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 432658 - Incorrect completion when calling an extension method from inside another extension method\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug432658 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"static class Extensions\n{\n\tpublic static void Ext1 (this int start)\n\t{\n\t}\n\tpublic static void Ext2 (this int end)\n\t{\n\t\t$Ext1($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count, \"There should be one overload\");\n\t\t\tAssert.AreEqual (1, provider.GetParameterCount(0), \"Parameter 'start' should exist\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 432727 - No completion if no constructor\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug432727 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"class A\n{\n\tvoid Method ()\n\t{\n\t\t$A aTest = new A ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 434705 - No autocomplete offered if not assigning result of 'new' to a variable\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug434705 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"class Test\n{\n\tpublic Test (int a)\n\t{\n\t}\n}\n\nclass AClass\n{\n\tTest A()\n\t{\n\t\t$return new Test ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 434705 - No autocomplete offered if not assigning result of 'new' to a variable\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug434705B ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"\nclass Test<T>\n{\n\tpublic Test (T t)\n\t{\n\t}\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t$Test<int> l = new Test<int> ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 434701 - No autocomplete in attributes\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug434701 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"namespace Test {\nclass TestAttribute : System.Attribute\n{\n\tpublic Test (int a)\n\t{\n\t}\n}\n\n$[Test ($\nclass AClass\n{\n}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 447985 - Exception display tip is inaccurate for derived (custom) exceptions\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug447985 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"\nnamespace System {\n\tpublic class Exception\n\t{\n\t\tpublic Exception () {}\n\t}\n}\n\nclass MyException : System.Exception\n{\n\tpublic MyException (int test)\n\t{}\n}\n\nclass AClass\n{\n\tpublic void Test ()\n\t{\n\t\t$throw new MyException($\n\t}\n\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t\tAssert.AreEqual (1, provider.GetParameterCount(0), \"Parameter 'test' should exist\");\n\t\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 1760 - [New Resolver] Parameter tooltip not shown for indexers \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void Test1760 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\nclass TestClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$args[$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestSecondIndexerParameter ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\nclass TestClass\n{\n\tpublic int this[int i, int j] { get { return 0; } } \n\tpublic void Test ()\n\t{\n\t\t$this[1,$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestSecondMethodParameter ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\nclass TestClass\n{\n\tpublic int TestMe (int i, int j) { return 0; } \n\tpublic void Test ()\n\t{\n\t\t$TestMe (1,$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodParameterWithSpacesTabsNewLines ()\n\t\t{\n\t\t\tvar provider = CreateProvider (@\"class TestClass\n{\n\tpublic int TestMe (int x) { return 0; } \n\tpublic void Test ()\n\t{\n\t\t$TestMe ( \t\t  \t  \n \t\n $\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n        \n\t\t[Test]\n\t\tpublic void TestMethodParameterNestedArray ()\n\t\t{\n\t\t    var provider = CreateProvider (@\"using System;\n\nclass TestClass\n{\n\tTestClass ()\n\t{\n\t\tvar str = new string[2,2];\n\t\t$Console.WriteLine ( str [1,$\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t\n\t\t/// Bug 599 - Regression: No intellisense over Func delegate\n\t\t[Test]\n\t\tpublic void TestBug599 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"using System;\nusing System.Core;\n\nclass TestClass\n{\n\tvoid A (Func<int, int> f)\n\t{\n\t\t$f ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t/// Bug 3307 - Chained linq methods do not work correctly\n\t\t[Test]\n\t\tpublic void TestBug3307 ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"using System;\nusing System.Linq;\n\nclass TestClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$args.Select ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.IsTrue (provider.Count > 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBug3307FollowUp ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"using System;\nusing System.Linq;\n\npublic class MainClass\n{\n\tstatic void TestMe (Action<int> act)\n\t{\n\t}\n\t\n\tpublic static void Main (string[] args)\n\t{\n\t\t$TestMe (x$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.IsFalse (provider.AutoSelect, \"auto select enabled !\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBug3307FollowUp2 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"using System;\nusing System.Linq;\n\npublic class MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$args.Select (x$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.IsFalse (provider.AutoSelect, \"auto select enabled !\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"class Foo { public Foo (int a) {} }\n\nclass A\n{\n\tvoid Method ()\n\t{\n\t\t$Bar = new Foo ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestConstructorCase2 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"\nnamespace Test \n{\n\tstruct TestMe \n\t{\n\t\tpublic TestMe (string a)\n\t\t{\n\t\t}\n\t}\n\t\n\tclass A\n\t{\n\t\tvoid Method ()\n\t\t{\n\t\t\t$new TestMe ($\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (2, provider.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestTypeParameter ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"using System;\n\nnamespace Test \n{\n\tclass A\n\t{\n\t\tvoid Method ()\n\t\t{\n\t\t\t$Action<$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (16, provider.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestSecondTypeParameter ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"using System;\n\nnamespace Test \n{\n\tclass A\n\t{\n\t\tvoid Method ()\n\t\t{\n\t\t\t$Action<string,$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (16, provider.Count);\n\t\t}\n\t\t\n\t\t[Ignore(\"TODO\")]\n\t\t[Test]\n\t\tpublic void TestMethodTypeParameter ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"using System;\n\nnamespace Test \n{\n\tclass A\n\t{\n\t\tvoid TestMethod<T, S>()\n\t\t{\n\t\t}\n\n\t\tvoid Method ()\n\t\t{\n\t\t\t$TestMethod<$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t[Ignore(\"TODO\")]\n\t\t[Test]\n\t\tpublic void TestSecondMethodTypeParameter ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"using System;\n\nnamespace Test \n{\n\tclass A\n\t{\n\t\tvoid TestMethod<T, S>()\n\t\t{\n\t\t}\n\n\t\tvoid Method ()\n\t\t{\n\t\t\t$TestMethod<string,$\n\t\t}\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\t\t\n\t\n\t\t[Test]\n\t\tpublic void TestArrayParameter ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\nclass TestClass\n{\n\tpublic void Method()\n\t{\n\t\tint[,,,] arr;\n\t\t$arr[$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestSecondArrayParameter ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n@\"\nclass TestClass\n{\n\tpublic void Method()\n\t{\n\t\tint[,,,] arr;\n\t\t$arr[5,$\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t[Ignore(\"TODO!\")]\n\t\t[Test]\n\t\tpublic void TestTypeParameterInBaseType ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"using System;\n\nnamespace Test \n{\n\t$class A : Tuple<$\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (16, provider.Count);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestBaseConstructorCall ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"class Base\n{\n\tpublic Base (int i)\n\t{\n\t\t\t\n\t}\n\tpublic Base (int i, string s)\n\t{\n\t\t\t\n\t}\n}\n\nnamespace Test \n{\n\tclass A : Base\n\t{\n\t\t$public A () : base($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (2, provider.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestThisConstructorCall ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"class Base\n{\n\tpublic Base (int i)\n\t{\n\t\t\t\n\t}\n\tpublic Base (int i, string s)\n\t{\n\t\t\t\n\t}\n}\n\nnamespace Test \n{\n\tclass A : Base\n\t{\n\t\tpublic A (int a, int b) : base(a) {}\n\n\t\t$public A () : this($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3645 - [New Resolver]Parameter completion shows all static and non-static overloads\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3645 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"class Main\n{\n\tpublic static void FooBar (string str)\n\t{\n\t}\n\t\n\tpublic void FooBar (int i)\n\t{\n\t\t\n\t}\n\t\n\tpublic static void Main (string[] args)\n\t{\n\t\t$FooBar ($\n\t}\n}\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 3991 - constructor argument completion not working for attributes applied to methods or parameters\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3991()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider(\n@\"using System;\nnamespace Test\n{\n\tclass TestClass\n\t{\n\t\t[Obsolete$($]\n\t\tTestClass()\n\t\t{\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull(provider, \"provider was not created.\");\n\t\t\tAssert.Greater(provider.Count, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4087 - code completion handles object and collection initializers (braces) incorrectly in method calls\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4087()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider(\n@\"using System;\nclass TestClass\n{\n\tTestClass()\n\t{\n\t\t$Console.WriteLine (new int[]{ 4, 5,$\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4927 - [New Resolver] Autocomplete shows non-static methods when using class name\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4927 ()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider (\n@\"\npublic class A\n{\n  // static method\n  public static void Method(string someParameter, object anotherParameter)\n  {\n  }\n\n  // instance method\n  public void Method()\n  {\n  }\n}\n\n\npublic class B\n{\n  public static void Main()\n  {\n    $A.Method($\n  }\n}\n\");\n\t\t\tAssert.IsNotNull (provider, \"provider was not created.\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestLambdaCase()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider(\n\t\t\t\t@\"using System;\nclass TestClass\n{    \n\tvoid F (Action i, int foo)\n\t{\n\t\t$F (()=> Something(),$\n\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider != null && provider.Count == 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJaggedArrayCreation()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider(\n\t\t\t\t@\"using System;\nclass TestClass\n{    \n\tvoid F (Action i, int foo)\n\t{\n\t\t$new foo[1,2][$\n\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJaggedArrayCreationCase2()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider(\n\t\t\t\t@\"using System;\nclass TestClass\n{    \n\tvoid F (Action i, int foo)\n\t{\n\t\t$new foo[1,2][1,$\n\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9301 - Inaccessible indexer overload in completion \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9301()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider(\n\t\t\t\t@\"using System;\n\npublic class A\n{\n\tpublic virtual int this [int i, string s] {\n\t\tget {\n\t\t\treturn 1;\n\t\t}\n\t}\n}\n\npublic class B : A\n{\n\tpublic new bool this [int i, string s2] {\n\t\tget {\n\t\t\treturn true;\n\t\t}\n\t}\n}\n\npublic class Test\n{\n\tpublic static int Main ()\n\t{\n\t\tB p = new B ();\n\t\t$p[$\n\t\treturn 0;\n\t}\n}\n\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug9301Case2()\n\t\t{\n\t\t\tIParameterDataProvider provider = CreateProvider(\n\t\t\t\t@\"using System;\n\npublic class A\n{\n\tpublic virtual int Test (int i, string s) {\n\t\treturn 1;\n\t}\n}\n\npublic class B : A\n{\n\tpublic new bool Test (int i, string s2) {\n\t\treturn true;\n\t}\n}\n\npublic class Test\n{\n\tpublic static int Main ()\n\t{\n\t\tB p = new B ();\n\t\t$p.Test($\n\t\treturn 0;\n\t}\n}\n\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExtensionMethod()\n\t\t{\n\t\t\tvar provider = CreateProvider(@\"static class Ext { public static void Foo(this object o, string str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$args.Foo($\n\t}\n}\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t\tAssert.AreEqual (1, provider.GetParameterCount (0));\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestExtensionMethodStaticInvocation()\n\t\t{\n\t\t\tvar provider = CreateProvider(@\"static class Ext { public static void Foo(this object o, string str) {} }\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t$Ext.Foo($\n\t}\n}\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t\tAssert.AreEqual (2, provider.GetParameterCount (0));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TypeArgumentsInIncompleteMethodCall ()\n\t\t{\n\t\t\tvar provider = CreateProvider (\n\t\t\t\t@\"using System.Collections.Generic;\nusing System.Linq;\nclass NUnitTestClass {\n    public ICollection<ITest> NestedTestCollection { get; set; }\n    public NUnitTestMethod FindTestMethodWithShortName(string name)\n    {\n        this.NestedTestCollection$.OfType<$.LastOrDefault(\n    }\n}\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12824 - Invalid argument intellisense inside lambda\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug12824 ()\n\t\t{\n\t\t\tvar provider = (TestFactory.Provider)CreateProvider (\n\t\t\t\t@\"using System.Threading.Tasks;\nusing System;\n\npublic class MyEventArgs \n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tTask.Factory.StartNew (() => {\n\t\t\t\t$throw new Exception ($\n\t\t});\n\t}\n}\");\n\t\t\tstring name = provider.Data.First().FullName;\n\t\t\tAssert.AreEqual (\"System.Exception..ctor\", name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterGreaterSign ()\n\t\t{\n\t\t\tvar provider = CreateProvider (@\"\nclass Test\n{\n\tstatic void Foo (int num) {}\n\tpublic static void Main (string[] args)\n\t{\n\t\tint i = 0;\n\t\tif (i > 0)\n\t\t\tFoo ($\n\t}\n}\");\n\t\t\tAssert.AreEqual (1, provider.Count);\n\t\t\tAssert.AreEqual (1, provider.GetParameterCount (0));\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/PreProcessorTests.cs",
    "content": "// \n// PreProcessorTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\tpublic class PreProcessorTests: TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestPreProcessorContext ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"$#$\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"if\"), \"directive 'if' not found.\");\n\t\t\t\tAssert.IsNotNull (provider.Find (\"region\"), \"directive 'region' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPreProcessorContext2 ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"// $#$\", provider => {\n\t\t\t\tAssert.IsNull (provider.Find (\"if\"), \"directive 'if' not found.\");\n\t\t\t\tAssert.IsNull (provider.Find (\"region\"), \"directive 'region' not found.\");\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestIfContext ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"$#if D$\", provider => {\n\t\t\t\tAssert.IsNotNull (provider.Find (\"DEBUG\"), \"define 'DEBUG' not found.\");\n\t\t\t});\n\t\t}\t\n\n\t\t[Test]\n\t\tpublic void TestIfInsideComment ()\n\t\t{\n\t\t\tCodeCompletionBugTests.CombinedProviderTest (@\"$// #if D$\", provider => {\n\t\t\t\tAssert.IsNull (provider.Find (\"DEBUG\"), \"define 'DEBUG' found.\");\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 10051 - Cannot type negate conditional\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10051 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$#if $\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0);\n\t\t\t\n\t\t\tprovider = CodeCompletionBugTests.CreateProvider (@\"$#if $\", true);\n\t\t\tAssert.IsNotNull (provider.Find (\"DEBUG\"), \"define 'DEBUG' not found.\");\n\t\t}\t\n\n\t\t/// <summary>\n\t\t///Bug 10079 - Cannot type && conditional\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10079 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$#if TRUE &$\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0);\n\t\t\t\n\t\t\tprovider = CodeCompletionBugTests.CreateProvider (@\"$#if TRUE && $\", true);\n\t\t\tAssert.IsNotNull (provider.Find (\"DEBUG\"), \"define 'DEBUG' not found.\");\n\t\t}\t\n\n\n\t\t/// <summary>\n\t\t/// Bug 10294 - Comments in preprocessor directives are not handler correctly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10294 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (@\"$#if TRUE // D$\",true);\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/TestBase.cs",
    "content": "﻿// \n// TestBase.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.CSharp.Completion;\nusing ICSharpCode.NRefactory.Completion;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Editor;\nusing System.Diagnostics;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\t[TestFixture]\n\tpublic abstract class TestBase \n\t{\n\t\tclass TestListener : TraceListener\n\t\t{\n\t\t\tpublic override void Fail (string message)\n\t\t\t{\n\t\t\t\tthrow new Exception (\"Assertion failed:\"+  message);\n\t\t\t}\n\t\t\tpublic override void Write (string o)\n\t\t\t{\n\t\t\t\tConsole.Write (o);\n\t\t\t}\n\t\t\tpublic override void WriteLine (string o)\n\t\t\t{\n\t\t\t\tConsole.WriteLine (o);\n\t\t\t}\n\t\t}\n\t\tTestListener listener = new TestListener ();\n\t\t\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp ()\n\t\t{\n\t\t\tSystem.Diagnostics.Debug.Listeners.Add (listener);\n\t\t}\n\t\t\n\t\t[TestFixtureTearDown]\n\t\tpublic void FixtureTearDown ()\n\t\t{\n\t\t\tSystem.Diagnostics.Debug.Listeners.Remove (listener);\n\t\t}\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/VariableDeclarationStatementTests.cs",
    "content": "// \n// VariableDeclarationStatementTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2011 Xamarin Inc.\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeCompletion\n{\n\tpublic class VariableDeclarationStatementTests : TestBase\n\t{\n\t\t[Test()]\n\t\tpublic void TestDefaultBehavior ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$var v$\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestDefaultBehaviorInForeach ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$foreach (var v$\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t\t\n\t\t[Test()]\n\t\tpublic void TestIntNameProposal ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$int $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"i\"), \"name proposal 'i' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"j\"), \"name proposal 'j' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"k\"), \"name proposal 'k' not found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNameProposal ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$MyTest $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"myTest\"), \"name proposal 'myTest' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"test\"), \"name proposal 'test' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"System\"), \"'System' found.\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNameProposalForeach ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateCtrlSpaceProvider (\n@\"\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\t$foreach (MyTest $\n\t}\n}\n\");\n\t\t\tAssert.IsNotNull (provider.Find (\"myTest\"), \"name proposal 'myTest' not found.\");\n\t\t\tAssert.IsNotNull (provider.Find (\"test\"), \"name proposal 'test' not found.\");\n\t\t\tAssert.IsNull (provider.Find (\"System\"), \"'System' found.\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 1799 - [New Resolver] Invalid code completion when typing name of variable\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug1799 ()\n\t\t{\n\t\t\tvar provider = CodeCompletionBugTests.CreateProvider (\n@\"\nclass MyTest\n{\n\tpublic void Test ()\n\t{\n\t\tfor (int n=0;n<10;n++) {\n\t\t\t$string d$\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.IsTrue (provider == null || provider.Count == 0, \"provider should be empty.\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeDomConvertVisitorTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.CodeDom;\nusing System.CodeDom.Compiler;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing Microsoft.CSharp;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t#if !__MonoCS__\n\t[TestFixture]\n\tpublic class CodeDomConvertVisitorTests : ResolverTestBase\n\t{\n\t\tCodeDomConvertVisitor convertVisitor;\n\t\tCSharpUnresolvedFile unresolvedFile;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tunresolvedFile = new CSharpUnresolvedFile();\n\t\t\tunresolvedFile.RootUsingScope.Usings.Add(MakeReference(\"System\"));\n\t\t\tunresolvedFile.RootUsingScope.Usings.Add(MakeReference(\"System.Collections.Generic\"));\n\t\t\tunresolvedFile.RootUsingScope.Usings.Add(MakeReference(\"System.Linq\"));\n\t\t\t\n\t\t\tconvertVisitor = new CodeDomConvertVisitor();\n\t\t\tconvertVisitor.AllowSnippetNodes = false;\n\t\t\tconvertVisitor.UseFullyQualifiedTypeNames = true;\n\t\t}\n\t\t\n\t\t#region Helper methods\n\t\tCodeObject ConvertInContext(string program)\n\t\t{\n\t\t\tvar p = PrepareResolver(program);\n\t\t\treturn convertVisitor.Convert(p.Item2, p.Item1);\n\t\t}\n\t\t\n\t\tstring ConvertHelper(AstNode node, Action<CSharpCodeProvider, CodeObject, TextWriter, CodeGeneratorOptions> action)\n\t\t{\n\t\t\tCSharpResolver resolver = new CSharpResolver(compilation);\n\t\t\tresolver = resolver.WithCurrentUsingScope(unresolvedFile.RootUsingScope.Resolve(compilation));\n\t\t\tresolver = resolver.WithCurrentTypeDefinition(compilation.FindType(KnownTypeCode.Object).GetDefinition());\n\t\t\tvar codeObj = convertVisitor.Convert(node, new CSharpAstResolver(resolver, node));\n\t\t\t\n\t\t\tStringWriter writer = new StringWriter();\n\t\t\twriter.NewLine = \" \";\n\t\t\taction(new CSharpCodeProvider(), codeObj, writer, new CodeGeneratorOptions { IndentString = \" \" });\n\t\t\treturn Regex.Replace(writer.ToString(), @\"\\s+\", \" \").Trim();\n\t\t}\n\t\t\n\t\tstring ConvertExpression(Expression expr)\n\t\t{\n\t\t\treturn ConvertHelper(expr, (p,obj,w,opt) => p.GenerateCodeFromExpression((CodeExpression)obj, w, opt));\n\t\t}\n\t\t\n\t\tstring ConvertExpression(string code)\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar expr = parser.ParseExpression(code);\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\treturn ConvertExpression(expr);\n\t\t}\n\t\t\n\t\tstring ConvertStatement(Statement statement)\n\t\t{\n\t\t\treturn ConvertHelper(statement, (p,obj,w,opt) => p.GenerateCodeFromStatement((CodeStatement)obj, w, opt));\n\t\t}\n\t\t\n\t\tstring ConvertStatement(string code)\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar expr = parser.ParseStatements(code).Single();\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\treturn ConvertStatement(expr);\n\t\t}\n\t\t\n\t\tstring ConvertMember(EntityDeclaration entity)\n\t\t{\n\t\t\treturn ConvertHelper(entity, (p,obj,w,opt) => p.GenerateCodeFromMember((CodeTypeMember)obj, w, opt));\n\t\t}\n\t\t\n\t\tstring ConvertMember(string code)\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar expr = parser.ParseTypeMembers(code).Single();\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\treturn ConvertMember(expr);\n\t\t}\n\t\t\n\t\tstring ConvertTypeDeclaration(EntityDeclaration decl)\n\t\t{\n\t\t\treturn ConvertHelper(decl, (p,obj,w,opt) => p.GenerateCodeFromType((CodeTypeDeclaration)obj, w, opt));\n\t\t}\n\t\t\n\t\tstring ConvertTypeDeclaration(string code)\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar syntaxTree = parser.Parse(code, \"program.cs\");\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\treturn ConvertTypeDeclaration((EntityDeclaration)syntaxTree.Children.Single());\n\t\t}\n\t\t\n\t\tstring ConvertSyntaxTree(SyntaxTree syntaxTree)\n\t\t{\n\t\t\treturn ConvertHelper(syntaxTree, (p,obj,w,opt) => p.GenerateCodeFromCompileUnit((CodeCompileUnit)obj, w, opt));\n\t\t}\n\t\t\n\t\tstring ConvertSyntaxTree(string code)\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar syntaxTree = parser.Parse(code, \"program.cs\");\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\tvar result = ConvertSyntaxTree(syntaxTree);\n\t\t\tvar idx = result.IndexOf(\"namespace\", StringComparison.Ordinal);\n\t\t\tif (idx > 0)\n\t\t\t\tresult = result.Substring (idx);\n\t\t\treturn result;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type References\n\t\t[Test]\n\t\tpublic void MultidimensionalArrayTypeReference()\n\t\t{\n\t\t\tAssert.AreEqual(\"default(int[,][])\", ConvertExpression(\"default(int[,][])\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedTypeInGenericType()\n\t\t{\n\t\t\tAssert.AreEqual(\"default(System.Collections.Generic.List<string>.Enumerator)\",\n\t\t\t                ConvertExpression(\"default(List<string>.Enumerator)\"));\n\t\t\tconvertVisitor.UseFullyQualifiedTypeNames = false;\n\t\t\tAssert.AreEqual(\"default(List<string>.Enumerator)\",\n\t\t\t                ConvertExpression(\"default(List<string>.Enumerator)\"));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Arrays\n\t\t[Test]\n\t\tpublic void CreateArray()\n\t\t{\n\t\t\tAssert.AreEqual(\"new int[10]\", ConvertExpression(\"new int[10]\"));\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(NotSupportedException))]\n\t\tpublic void CreateJaggedArray()\n\t\t{\n\t\t\tConvertExpression(\"new int[10][]\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(NotSupportedException))]\n\t\tpublic void Create2DArray()\n\t\t{\n\t\t\tConvertExpression(\"new int[10, 20]\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CreateImplicitlyTypedArray()\n\t\t{\n\t\t\t// implicitly-typed array not supported in CodeDom, so the conversion should infer the type\n\t\t\tAssert.AreEqual(\"new int[] { 1, 2, 3}\", ConvertExpression(\"new [] { 1, 2, 3 }\"));\n\t\t\tAssert.AreEqual(\"new System.Collections.Generic.List<string>[] { new System.Collections.Generic.List<string>()}\",\n\t\t\t                ConvertExpression(\"new [] { new List<string>() }\"));\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(NotSupportedException))]\n\t\tpublic void Create2DImplicitlyTypedArray()\n\t\t{\n\t\t\tConvertExpression(\"new [,] { { 1, 2 }, { 3, 4 }}\");\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Operators\n\t\t[Test]\n\t\tpublic void ArithmeticOperators()\n\t\t{\n\t\t\tAssert.AreEqual(\"(0 + 1)\", ConvertExpression(\"0 + 1\"));\n\t\t\tAssert.AreEqual(\"(0 - 1)\", ConvertExpression(\"0 - 1\"));\n\t\t\tAssert.AreEqual(\"(0 * 1)\", ConvertExpression(\"0 * 1\"));\n\t\t\tAssert.AreEqual(\"(0 / 1)\", ConvertExpression(\"0 / 1\"));\n\t\t\tAssert.AreEqual(\"(0 % 1)\", ConvertExpression(\"0 % 1\"));\n\t\t\tAssert.AreEqual(\"(0 & 1)\", ConvertExpression(\"0 & 1\"));\n\t\t\tAssert.AreEqual(\"(0 | 1)\", ConvertExpression(\"0 | 1\"));\n\t\t\tAssert.AreEqual(\"(0 < 1)\", ConvertExpression(\"0 < 1\"));\n\t\t\tAssert.AreEqual(\"(0 > 1)\", ConvertExpression(\"0 > 1\"));\n\t\t\tAssert.AreEqual(\"(0 <= 1)\", ConvertExpression(\"0 <= 1\"));\n\t\t\tAssert.AreEqual(\"(0 >= 1)\", ConvertExpression(\"0 >= 1\"));\n\t\t\tAssert.AreEqual(\"(true && false)\", ConvertExpression(\"true && false\"));\n\t\t\tAssert.AreEqual(\"(true || false)\", ConvertExpression(\"true || false\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EqualityOperator()\n\t\t{\n\t\t\tAssert.AreEqual(\"(0 == 1)\", ConvertExpression(\"0 == 1\"));\n\t\t\tAssert.AreEqual(\"(default(object) == null)\", ConvertExpression(\"default(object) == null\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InEqualityOperator()\n\t\t{\n\t\t\tAssert.AreEqual(\"((0 == 1) == false)\", ConvertExpression(\"0 != 1\"));\n\t\t\tAssert.AreEqual(\"(default(object) != null)\", ConvertExpression(\"default(object) != null\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnaryOperators()\n\t\t{\n\t\t\tAssert.AreEqual(\"(a == false)\", ConvertExpression(\"!a\"));\n\t\t\tAssert.AreEqual(\"(0 - a)\", ConvertExpression(\"-a\"));\n\t\t\tAssert.AreEqual(\"a\", ConvertExpression(\"+a\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Cast()\n\t\t{\n\t\t\tAssert.AreEqual(\"((double)(0))\", ConvertExpression(\"(double)0\"));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Member Access\n\t\t[Test]\n\t\tpublic void StaticProperty()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Environment.TickCount\", ConvertExpression(\"Environment.TickCount\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FullyQualifiedEnumFieldAccess()\n\t\t{\n\t\t\tstring program = \"class A { object x = $System.StringComparison.Ordinal$; }\";\n\t\t\tvar cfre = (CodeFieldReferenceExpression)ConvertInContext(program);\n\t\t\tAssert.AreEqual(\"Ordinal\", cfre.FieldName);\n\t\t\tvar ctre = ((CodeTypeReferenceExpression)cfre.TargetObject);\n\t\t\tAssert.AreEqual(\"System.StringComparison\", ctre.Type.BaseType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumFieldAccess()\n\t\t{\n\t\t\tstring program = \"using System; class A { object x = $StringComparison.Ordinal$; }\";\n\t\t\tvar cfre = (CodeFieldReferenceExpression)ConvertInContext(program);\n\t\t\tAssert.AreEqual(\"Ordinal\", cfre.FieldName);\n\t\t\tvar ctre = ((CodeTypeReferenceExpression)cfre.TargetObject);\n\t\t\tAssert.AreEqual(\"System.StringComparison\", ctre.Type.BaseType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InstanceMethodInvocation()\n\t\t{\n\t\t\tAssert.AreEqual(\"this.Equals(null)\", ConvertExpression(\"Equals(null)\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticMethodInvocation()\n\t\t{\n\t\t\tAssert.AreEqual(\"object.Equals(null, null)\", ConvertExpression(\"Equals(null, null)\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseMemberAccess()\n\t\t{\n\t\t\tAssert.AreEqual(\"base.X\", ConvertExpression(\"base.X\"));\n\t\t\tAssert.AreEqual(\"base[i]\", ConvertExpression(\"base[i]\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodReference()\n\t\t{\n\t\t\tAssert.AreEqual(\"this.Stuff<string>\", ConvertExpression(\"this.Stuff<string>\"));\n\t\t\tAssert.AreEqual(\"this.Stuff<string>\", ConvertExpression(\"Stuff<string>\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ByReferenceCall()\n\t\t{\n\t\t\tAssert.AreEqual(\"a.Call(ref x, out y, z)\", ConvertExpression(\"a.Call(ref x, out y, z)\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MemberAccessOnType()\n\t\t{\n\t\t\tAssert.AreEqual(\"string.Empty\", ConvertExpression(\"string.Empty\"));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Statements\n\t\t[Test]\n\t\tpublic void MethodInvocationStatement()\n\t\t{\n\t\t\tAssert.AreEqual(\"a.SomeMethod();\", ConvertStatement(\"a.SomeMethod();\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Assignment()\n\t\t{\n\t\t\tAssert.AreEqual(\"a = 1;\", ConvertStatement(\"a = 1;\"));\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(NotSupportedException))]\n\t\tpublic void AssignmentNotSupportedInExpression()\n\t\t{\n\t\t\tConvertStatement(\"a = b = 1;\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BlockStatement()\n\t\t{\n\t\t\tAssert.AreEqual(\"if (true) { a = 1; b = 2; }\",\n\t\t\t                ConvertStatement(\"{ a = 1; b = 2; }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompoundAssign()\n\t\t{\n\t\t\tAssert.AreEqual(\"a = (a + 1);\", ConvertStatement(\"a += 1;\"));\n\t\t\tAssert.AreEqual(\"a = (a - 1);\", ConvertStatement(\"a -= 1;\"));\n\t\t\tAssert.AreEqual(\"a = (a * 1);\", ConvertStatement(\"a *= 1;\"));\n\t\t\tAssert.AreEqual(\"a = (a / 1);\", ConvertStatement(\"a /= 1;\"));\n\t\t\tAssert.AreEqual(\"a = (a % 1);\", ConvertStatement(\"a %= 1;\"));\n\t\t\tAssert.AreEqual(\"a = (a & 1);\", ConvertStatement(\"a &= 1;\"));\n\t\t\tAssert.AreEqual(\"a = (a | 1);\", ConvertStatement(\"a |= 1;\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Increment()\n\t\t{\n\t\t\tAssert.AreEqual(\"a = (a + 1);\", ConvertStatement(\"a++;\"));\n\t\t\tAssert.AreEqual(\"a = (a + 1);\", ConvertStatement(\"++a;\"));\n\t\t\tAssert.AreEqual(\"a = (a - 1);\", ConvertStatement(\"a--;\"));\n\t\t\tAssert.AreEqual(\"a = (a - 1);\", ConvertStatement(\"--a;\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ForLoop()\n\t\t{\n\t\t\tAssert.AreEqual(\"for (int i = 0; (i < 10); i = (i + 1)) { }\",\n\t\t\t                ConvertStatement(\"for (int i = 0; i < 10; i++) {}\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void WhileLoop()\n\t\t{\n\t\t\tAssert.AreEqual(\"for (new object(); (i < 10); new object()) { }\",\n\t\t\t                ConvertStatement(\"while (i < 10);\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VariableDeclarationWithArrayInitializer()\n\t\t{\n\t\t\tAssert.AreEqual(\"int[] nums = new int[] { 1, 2};\",\n\t\t\t                ConvertStatement(\"int[] nums = { 1, 2 };\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TryCatch()\n\t\t{\n\t\t\tAssert.AreEqual(\"try { a = 1; } catch (System.Exception ex) { ex.ToString(); }\",\n\t\t\t                ConvertStatement(\"try { a = 1; } catch (Exception ex) { ex.ToString(); }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TryEmptyCatch()\n\t\t{\n\t\t\tAssert.AreEqual(\"try { a = 1; } catch (System.Exception ) { }\",\n\t\t\t                ConvertStatement(\"try { a = 1; } catch (Exception) { }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TryFinally()\n\t\t{\n\t\t\tAssert.AreEqual(\"try { a = 1; } finally { a = 0; }\",\n\t\t\t                ConvertStatement(\"try { a = 1; } finally { a = 0; }\"));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Type Members\n\t\t[Test]\n\t\tpublic void MethodParameterNamedValue()\n\t\t{\n\t\t\tAssert.AreEqual(\"void M(string value) { System.Console.WriteLine(value); }\",\n\t\t\t                ConvertMember(\"void M(string value) { Console.WriteLine(value); }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ValueInProperty()\n\t\t{\n\t\t\tAssert.AreEqual(\"string P { set { System.Console.WriteLine(value); } }\",\n\t\t\t                ConvertMember(\"string P { set { Console.WriteLine(value); } }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithAttribute()\n\t\t{\n\t\t\tAssert.AreEqual(\"[Test()] void MethodWithAttribute() { }\",\n\t\t\t                ConvertMember(\"[Test] void MethodWithAttribute() { }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PublicNonVirtualMethod()\n\t\t{\n\t\t\tAssert.AreEqual(\"public void Method() { }\",\n\t\t\t                ConvertMember(\"public void Method() { }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PublicVirtualMethod()\n\t\t{\n\t\t\tAssert.AreEqual(\"public virtual void Method() { }\",\n\t\t\t                ConvertMember(\"public virtual void Method() { }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedClass()\n\t\t{\n\t\t\tAssert.AreEqual(\"public class Outer { public class Inner { } }\",\n\t\t\t                ConvertTypeDeclaration(\"class Outer { class Inner { } }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Constructor()\n\t\t{\n\t\t\tstring code = \"public class Test : Base { public Test(string x) : base(x) { } }\";\n\t\t\tAssert.AreEqual(code, ConvertTypeDeclaration(code));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Enum()\n\t\t{\n\t\t\tstring code = \"public enum E { [Description(\\\"Text\\\")] None, B = 2, }\";\n\t\t\tAssert.AreEqual(code, ConvertTypeDeclaration(code));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Field()\n\t\t{\n\t\t\tAssert.AreEqual(\"public class X {\" +\n\t\t\t                \" int A;\" +\n\t\t\t                \" int B; }\",\n\t\t\t                ConvertMember(\"public class X { int A, B; }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Event()\n\t\t{\n\t\t\tAssert.AreEqual(\"public class X {\" +\n\t\t\t                \" protected event System.EventHandler A;\" +\n\t\t\t                \" protected event System.EventHandler B; }\",\n\t\t\t                ConvertMember(\"public class X { protected event EventHandler A, B; }\"));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region SyntaxTrees\n\t\t[Test]\n\t\tpublic void TestGlobalNamespaceFix ()\n\t\t{\n\t\t\tAssert.AreEqual(\"namespace A { using System; public class AClass { } } namespace B { using System.IO; using System; public class AClass { } }\",\n\t\t\t                ConvertSyntaxTree(\"using System; namespace A { public class AClass {} } namespace B { using System.IO; public class AClass {} }\"));\n\t\t}\n\t\t#endregion\n\t}\n#endif\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/AccessToDisposedClosureTests.cs",
    "content": "﻿// \n// AccessToDisposedClosureTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class AccessToDisposedClosureTests : InspectionActionTestBase\n\t{\n\t\tvoid Test (string input, int issueCount)\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new AccessToDisposedClosureIssue (), input, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsing ()\n\t\t{\n\t\t\tstring input = @\"\nusing System;\nclass TestClass : IDisposable\n{\n\tpublic void Dispose () { }\n}\nclass TestClass2\n{\n\tvoid TestMethod ()\n\t{\n\t\tusing (var x = new TestClass ()) {\n\t\t\tAction a = () => x.ToString ();\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsing2 ()\n\t\t{\n\t\t\tstring input = @\"\nusing System;\nclass TestClass : IDisposable\n{\n\tpublic void Dispose () { }\n}\nclass TestClass2\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass ();\n\t\tusing (x) {\n\t\t\tAction a = () => x.ToString ();\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDispose ()\n\t\t{\n\t\t\tstring input = @\"\nusing System;\nclass TestClass : IDisposable\n{\n\tpublic void Dispose () { }\n}\nclass TestClass2\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass ();\n\t\tAction a = () => x.ToString ();\n\t\tx.Dispose();\t\n\t}\n}\";\n\t\t\tTest (input, 1);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/AccessToModifiedClosureTests.cs",
    "content": "﻿// \n// AccessToModifiedClosureTests.cs\n//  \n// Author:\n//       Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class AccessToModifiedClosureTests : InspectionActionTestBase\n\t{\n\t\tstatic void Test(string input, int issueCount, string output = null, int fixIndex = -1)\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new AccessToModifiedClosureIssue (), input, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t\tif (issueCount > 0) {\n\t\t\t\tif (output != null) {\n\t\t\t\t\tif (fixIndex == -1)\n\t\t\t\t\t\tCheckFix (context, issues, output);\n\t\t\t\t\telse\n\t\t\t\t\t\tCheckFix (context, issues [fixIndex], output);\n\t\t\t\t} else {\n\t\t\t\t\tforeach (var issue in issues)\n\t\t\t\t\t\tAssert.AreEqual (0, issue.Actions.Count);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeachVariable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tSystem.Func<int, int> f;\n\t\tforeach (var i in a)\n\t\t\tf = new System.Func<int, int> (x => x + i);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tSystem.Func<int, int> f;\n\t\tforeach (var i in a) {\n\t\t\tvar i1 = i;\n\t\t\tf = new System.Func<int, int> (x => x + i1);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFor ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => x + i1);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestForInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int j)\n\t{\n\t\tint i;\n\t\tfor (i = 0; j < 10; j++) {\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForBody ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0; i < 10;) {\n\t\t\tvar f = new System.Func<int, int> (delegate (int x) { return x + i; });\n\t\t\ti++;\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0; i < 10;) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (delegate (int x) { return x + i1; });\n\t\t\ti++;\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestWhileBody ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\twhile (i < 10) {\n\t\t\ti++;\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\twhile (i < 10) {\n\t\t\ti++;\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => x + i1);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestWhileCondition ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\twhile (i++ < 10) {\n\t\t\tvar f = new System.Func<int, int> (delegate (int x) { return x + i; });\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\twhile (i++ < 10) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (delegate (int x) { return x + i1; });\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhileBody ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tdo {\n\t\t\ti += 1;\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t} while (i < 10);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tdo {\n\t\t\ti += 1;\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => x + i1);\n\t\t} while (i < 10);\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhileCondition ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\twhile (i++ < 10) {\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\twhile (i++ < 10) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => x + i1);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleLambdas ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t\tvar f2 = new System.Func<int, bool> (x => x + i > 10);\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => x + i1);\n\t\t\tvar i1 = i;\n\t\t\tvar f2 = new System.Func<int, bool> (x => x + i1 > 10);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 2, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixAllInLambda ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] array)\n\t{\n\t\tforeach (var i in array) {\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\tint a = i + 1;\n\t\t\t\tint b = i + 2;\n\t\t\t\treturn a + b + i;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] array)\n\t{\n\t\tforeach (var i in array) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\tint a = i1 + 1;\n\t\t\t\tint b = i1 + 2;\n\t\t\t\treturn a + b + i1;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 3, output, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestModifiedInLambda ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] array)\n\t{\n\t\tforeach (var i in array) {\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\ti = 0;\n\t\t\t\tint a = i + 1;\n\t\t\t\tint b = i + 2;\n\t\t\t\treturn a + b + i;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 0);\n\t\t\tinput = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] array)\n\t{\n\t\tforeach (var i in array) {\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\ti++;\n\t\t\t\tint a = i + 1;\n\t\t\t\ti = 3;\n\t\t\t\tint b = i + 2;\n\t\t\t\treturn a + b + i;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] array)\n\t{\n\t\tforeach (var i in array) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\ti1++;\n\t\t\t\tint a = i1 + 1;\n\t\t\t\ti1 = 3;\n\t\t\t\tint b = i1 + 2;\n\t\t\t\treturn a + b + i1;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNestedLambda ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\tvar f2 =  new System.Func<int, int> (y => y - i);\n\t\t\t\treturn f2 (x) + i;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tvar output1 = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tvar i1 = i;\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\tvar f2 =  new System.Func<int, int> (y => y - i1);\n\t\t\t\treturn f2 (x) + i1;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 2, output1, 1);\n\t\t\tvar output2 = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tvar f = new System.Func<int, int> (x => {\n\t\t\t\tvar i1 = i;\n\t\t\t\tvar f2 =  new System.Func<int, int> (y => y - i1);\n\t\t\t\treturn f2 (x) + i;\n\t\t\t});\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 2, output2, 0);\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestMultipleVariables ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tforeach (var j in a) {\n\t\t\t\tvar f = new System.Func<int, int> (x => x + i + j);\n\t\t\t}\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tforeach (var j in a) {\n\t\t\t\tvar i1 = i;\n\t\t\t\tvar j1 = j;\n\t\t\t\tvar f = new System.Func<int, int> (x => x + i1 + j1);\n\t\t\t}\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 2, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestModificationAfterLambdaDecl ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tSystem.Func<int, int> f = x => i + x;\n\t\ti += 1;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tvar i1 = i;\n\t\tSystem.Func<int, int> f = x => i1 + x;\n\t\ti += 1;\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestModificationBeforeLambdaDecl ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\ti += 1;\n\t\tSystem.Func<int, int> f = x => i + x;\n\t}\n}\";\n\t\t\tTest (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnreachable ()\n\t\t{\n\t\t\tvar returnCase = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tSystem.Func<int, int> f = x => i + x;\n\t\treturn;\n\t\ti += 1;\n\t}\n}\";\n\t\t\tvar ifCase = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tSystem.Func<int, int> f;\n\t\tif (i > 0)\n\t\t\tf = x => i + x;\n\t\telse\n\t\t\ti += 1;\n\t}\n}\";\n\t\t\tTest (returnCase, 0);\n\t\t\tTest (ifCase, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tSystem.Func<int, int> f = x => i + x;\n\t\ti += 1;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar i1 = i;\n\t\tSystem.Func<int, int> f = x => i1 + x;\n\t\ti += 1;\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestModificationInSameStatement ()\n\t\t{\n\t\t\tvar input1 = @\"\nclass TestClass\n{\n\tvoid TestMethod2 (int b, System.Func<int, int> a)\n\t{\n\t\tTestMethod2 (b++, c => c + b);\n\t}\n}\";\n\t\t\tvar input2 = @\"\nclass TestClass\n{\n\tvoid TestMethod3 (System.Func<int, int> a, int b)\n\t{\n\t\tTestMethod3 (c => c + b, b++);\n\t}\n}\";\n\t\t\tvar output2 = @\"\nclass TestClass\n{\n\tvoid TestMethod3 (System.Func<int, int> a, int b)\n\t{\n\t\tvar b1 = b;\n\t\tTestMethod3 (c => c + b1, b++);\n\t}\n}\";\n\t\t\tTest (input1, 0);\n\t\t\tTest (input2, 1, output2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInsertion ()\n\t\t{\n\t\t\tvar input1 = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tSystem.Func<int, int> f = null;\n\t\tif ((f = x => x + i) != null)\n\t\t\ti++;\n\t}\n}\";\n\t\t\tvar output1 = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tSystem.Func<int, int> f = null;\n\t\tvar i1 = i;\n\t\tif ((f = x => x + i1) != null)\n\t\t\ti++;\n\t}\n}\";\n\t\t\tTest (input1, 1, output1);\n\n\t\t\tvar input2 = @\"\nclass TestClass\n{\n\tvoid TestMethod (int k)\n\t{\n\t\tint i = 0;\n\t\tSystem.Func<int, int> f = null;\n\t\tswitch (k) {\n\t\tdefault:\n\t\t\tf = x => x + i;\n\t\t\tbreak;\n\t\t}\n\t\ti++;\n\t}\n}\";\n\t\t\tvar output2 = @\"\nclass TestClass\n{\n\tvoid TestMethod (int k)\n\t{\n\t\tint i = 0;\n\t\tSystem.Func<int, int> f = null;\n\t\tswitch (k) {\n\t\tdefault:\n\t\t\tvar i1 = i;\n\t\t\tf = x => x + i1;\n\t\t\tbreak;\n\t\t}\n\t\ti++;\n\t}\n}\";\n\t\t\tTest (input2, 1, output2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaInLoopCondition ()\n\t\t{\n\t\t\tvar forCase = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = null;\n\t\tfor (int i = 0; i < 10 && ((f = x => x + i) != null); i++) {\n\t\t}\n\t}\n}\";\n\t\t\tvar whileCase = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = null;\n\t\tint i = 0;\n\t\twhile (i < 10 && (f = x => x + i) != null) i++;\n\t}\n}\";\n\t\t\tvar doWhileCase = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = null;\n\t\tint i = 0;\n\t\tdo { i++; } while (i < 10 && (f = x => x + i) != null);\n\t}\n}\";\n\t\t\tTest (forCase, 1);\n\t\t\tTest (whileCase, 1);\n\t\t\tTest (doWhileCase, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaInForIterator ()\n\t\t{\n\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = null;\n\t\tfor (int i = 0; i < 10; i++, f = x => x + i) {\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExistingVariableName ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tint i1;\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tint i1;\n\t\t\tvar i2 = i;\n\t\t\tvar f = new System.Func<int, int> (x => x + i2);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic TestClass (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tint i1;\n\t\t\tvar f = new System.Func<int, int> (x => x + i);\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tpublic TestClass (int[] a)\n\t{\n\t\tforeach (var i in a) {\n\t\t\tint i1;\n\t\t\tvar i2 = i;\n\t\t\tvar f = new System.Func<int, int> (x => x + i2);\n\t\t}\n\t}\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tSystem.Action<int> a = i =>\n\t{\n\t\tSystem.Func<int> f = () => i + 1;\n\t\ti++;\n\t};\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tSystem.Action<int> a = i =>\n\t{\n\t\tvar i1 = i;\n\t\tSystem.Func<int> f = () => i1 + 1;\n\t\ti++;\n\t};\n}\";\n\t\t\tTest (input, 1, output);\n\t\t}\n\n\t\t\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/AccessToStaticMemberViaDerivedTypeIssueTests.cs",
    "content": "//\n// CallToStaticMemberViaDerivedType.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class AccessToStaticMemberViaDerivedTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void MemberInvocation()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic static void F() { }\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n\t\tB.F ();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tAssert.AreEqual(11, issues [0].Start.Line);\n\n\t\t\tCheckFix(context, issues [0], @\"\nclass A\n{\n\tpublic static void F() { }\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n\t\tA.F ();\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic static void F() { }\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n        // ReSharper disable once AccessToStaticMemberViaDerivedType\n\t\tB.F ();\n\t}\n}\";\n\t\t\tTestWrongContext<AccessToStaticMemberViaDerivedTypeIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PropertyAccess()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic static string Property { get; set; }\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n\t\tSystem.Console.WriteLine(B.Property);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tAssert.AreEqual(11, issues [0].Start.Line);\n\t\t\t\n\t\t\tCheckFix(context, issues [0], @\"\nclass A\n{\n\tpublic static string Property { get; set; }\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n\t\tSystem.Console.WriteLine(A.Property);\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FieldAccess()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic static string Property;\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n\t\tSystem.Console.WriteLine(B.Property);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tAssert.AreEqual(11, issues [0].Start.Line);\n\t\t\t\n\t\t\tCheckFix(context, issues [0], @\"\nclass A\n{\n\tpublic static string Property;\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n\t\tSystem.Console.WriteLine(A.Property);\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedClass()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic class B\n\t{\n\t\tpublic static void F() { }\n\t}\n\tpublic class C : B { }\n}\nclass D\n{\n\tvoid Main()\n\t{\n\t\tA.C.F ();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tAssert.AreEqual(14, issues [0].Start.Line);\n\t\t\t\n\t\t\tCheckFix(context, issues [0], @\"\nclass A\n{\n\tpublic class B\n\t{\n\t\tpublic static void F() { }\n\t}\n\tpublic class C : B { }\n}\nclass D\n{\n\tvoid Main()\n\t{\n\t\tA.B.F ();\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExpandsTypeWithNamespaceIfNeccessary()\n\t\t{\n\t\t\tvar input = @\"\nnamespace First\n{\n\tclass A\n\t{\n\t\tpublic static void F() { }\n\t}\n}\nnamespace Second\n{\n\tpublic class B : First.A { }\n\tclass C\n\t{\n\t\tvoid Main()\n\t\t{\n\t\t\tB.F ();\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tAssert.AreEqual(16, issues [0].Start.Line);\n\t\t\t\n\t\t\tCheckFix(context, issues [0], @\"\nnamespace First\n{\n\tclass A\n\t{\n\t\tpublic static void F() { }\n\t}\n}\nnamespace Second\n{\n\tpublic class B : First.A { }\n\tclass C\n\t{\n\t\tvoid Main()\n\t\t{\n\t\t\tFirst.A.F ();\n\t\t}\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresCorrectCalls()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic static void F() { }\n}\nclass B\n{\n\tvoid Main()\n\t{\n\t\tA.F();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresNonStaticCalls()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic void F() { }\n}\nclass B : A { }\nclass C\n{\n\tvoid Main()\n\t{\n\t\tB b = new B();\n\t\tb.F();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresOwnMemberFunctions()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tprotected static void F() { }\n}\nclass B : A\n{\n\tvoid Main()\n\t{\n\t\tF();\n\t\tthis.F();\n\t\tbase.F();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresCuriouslyRecurringTemplatePattern()\n\t\t{\n\t\t\tvar input = @\"\nclass Base<T>\n{\n\tpublic static void F() { }\n}\nclass Derived : Base<Derived> {}\nclass Test\n{\n\tvoid Main()\n\t{\n\t\tDerived.F();\n\t}\n}\";\n\t\t\t// do not suggest replacing 'Derived.F()' with 'Base<Derived>.F()'\n\t\t\tTestRefactoringContext context;\t\t\t\n\t\t\tvar issues = GetIssues(new AccessToStaticMemberViaDerivedTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/AdditionalOfTypeIssuesTests.cs",
    "content": "//\n// AdditionalOfTypeIssuesTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class AdditionalOfTypeIssuesTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAdditionalCase ()\n\t\t{\n\t\t\tTest<AdditionalOfTypeIssues>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Where(o => (o is Test));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid ()\n\t\t{\n\t\t\tTestWrongContext<AdditionalOfTypeIssues>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<IDisposable> ().Where(o => this is IDisposable);\n\t}\n}\");\n\t\t}\n\n\n\n\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ArrayCreationCanBeReplacedWithArrayInitializerIssueTests.cs",
    "content": "﻿// ArrayCreationCanBeReplacedWithArrayInitializerIssueTests.cs\n//\n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ArrayCreationCanBeReplacedWithArrayInitializerIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVariableDeclaration()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint[] foo = new int[] {1, 2, 3};\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint[] foo = {1, 2, 3};\n\t}\n}\";\n\t\t\tTest<ArrayCreationCanBeReplacedWithArrayInitializerIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldDeclaration()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic int[] filed = new [] {1,2,3};\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tpublic int[] filed = {1,2,3};\n}\";\n\t\t\tTest<ArrayCreationCanBeReplacedWithArrayInitializerIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem1()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar foo = new[] {1, 2, 3};\n\t}\n}\";\n\t\t\tTest<ArrayCreationCanBeReplacedWithArrayInitializerIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar foo = new int[] {1, 2, 3};\n\t}\n}\";\n\t\t\tTest<ArrayCreationCanBeReplacedWithArrayInitializerIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem3()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tVoid Foo(int[] a)\n\t{}\n\tvoid TestMethod ()\n\t{\n\t\tFoo(new int[]{1,2,3});\n\t}\n}\";\n\t\t\tTest<ArrayCreationCanBeReplacedWithArrayInitializerIssue>(input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/AutoAsyncTests.cs",
    "content": "﻿﻿// \n// AutoAsyncTests.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class AutoAsyncTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\ttcs.SetResult (1);\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIncorrectlyInitializedCompletionSource() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tTaskCompletionSource<int> GetCompletionSource ()\n\t{\n\t\treturn new TaskCompletionSource<int> ();\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = GetCompletionSource ();\n\t\ttcs.SetResult (1);\n\t\treturn tcs.Task;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTaskWithoutResult() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\ttcs.SetResult (1);\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic async Task TestMethod ()\n\t{\n\t\tint result = 1;\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAsyncContinueWith() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo () { return null; }\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (async (precedent) => {\n\t\t\tawait Foo();\n\t\t\ttcs.SetResult (1);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo () { return null; }\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tawait Foo ();\n\t\tawait Foo ();\n\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTaskWithoutResultExtraName() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tint result = 1;\n\t\ttcs.SetResult (1);\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic async Task TestMethod ()\n\t{\n\t\tint result = 1;\n\t\tint result1 = 1;\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicContinueWith() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\ttcs.SetResult (precedent.Result);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tint precedentResult = await Foo ();\n\t\treturn precedentResult;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTaskWithoutCompletionSource() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\treturn Foo ().ContinueWith (precedent => {\n\t\t\treturn 3;\n\t\t});\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tint precedentResult = await Foo ();\n\t\treturn 3;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContinueWithUsingPrecedent() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System;\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\tConsole.WriteLine (precedent.IsFaulted);\n\t\t\ttcs.SetResult (precedent.Result);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System;\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tTask<int> precedent1 = Foo ();\n\t\tint precedentResult = await precedent1;\n\t\tConsole.WriteLine (precedent1.IsFaulted);\n\t\treturn precedentResult;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContinueWithUsingPrecedentTaskWithNoParameters() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\tConsole.WriteLine (precedent.IsFaulted);\n\t\t\ttcs.SetResult (0);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tTask precedent1 = Foo ();\n\t\tawait precedent1;\n\t\tConsole.WriteLine (precedent1.IsFaulted);\n\t\treturn 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicContinueWithExtraName() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\tint precedentResult = precedent.Result;\n\t\t\ttcs.SetResult (precedentResult);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tint precedentResult1 = await Foo ();\n\t\tint precedentResult = precedentResult1;\n\t\treturn precedentResult;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalReturn() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod (int i)\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\tif (i == 0)\n\t\t\t\ttcs.SetResult (precedent.Result);\n\t\t\telse\n\t\t\t\ttcs.SetResult (i);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod (int i)\n\t{\n\t\tint precedentResult = await Foo ();\n\t\tif (i == 0)\n\t\t\treturn precedentResult;\n\t\telse\n\t\t\treturn i;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalContinueWith() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod (int i)\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tvar task1 = Foo ();\n\t\tvar task2 = Foo ();\n\t\tif (i == 0) {\n\t\t\ttask1.ContinueWith (precedent => {\n\t\t\t\ttcs.SetResult (1);\n\t\t\t});\n\t\t} else {\n\t\t\ttask2.ContinueWith (precedent => {\n\t\t\t\ttcs.SetResult (2);\n\t\t\t});\n\t\t}\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod (int i)\n\t{\n\t\tvar task1 = Foo ();\n\t\tvar task2 = Foo ();\n\t\tif (i == 0) {\n\t\t\tint precedentResult = await task1;\n\t\t\treturn 1;\n\t\t}\n\t\telse {\n\t\t\tint precedentResult1 = await task2;\n\t\t\treturn 2;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDelegate() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (delegate {\n\t\t\ttcs.SetResult (42);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tawait Foo ();\n\t\treturn 42;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTwoContinueWith() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\tFoo ().ContinueWith (precedent2 => {\n\t\t\t\ttcs.SetResult (precedent.Result + precedent2.Result);\n\t\t\t});\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tint precedentResult = await Foo ();\n\t\tint precedent2Result = await Foo ();\n\t\treturn precedentResult + precedent2Result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChainedContinueWith() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\tFoo ();\n\t\t}).ContinueWith (precedent => {\n\t\t\ttcs.SetResult (1);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task<int> Foo ()\n\t{\n\t\treturn null;\n\t}\n\tpublic async Task<int> TestMethod ()\n\t{\n\t\tint precedentResult = await Foo ();\n\t\tFoo ();\n\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantReturn() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\ttcs.SetResult (null);\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic async Task TestMethod ()\n\t{\n\t\tobject result = null;\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotInEnd() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo () {}\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\ttcs.SetResult (null);\n\t\t\tConsole.WriteLine(42);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidChainedMethodAfterContinueWith() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo () {}\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\ttcs.SetResult (null);\n\t\t}).Wait ();\n\t\treturn tcs.Task;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContinuationAfterSetResult() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo () {}\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\ttcs.SetResult (null);\n\t\t}).ContinueWith (precedent => {\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidInLambda() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System;\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\tSystem.Action action = () => { tcs.SetResult (null); };\n\t\treturn tcs.Task;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidContinue() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System;\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo() { return null; }\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\tFoo ().ContinueWith (precedent => 1).ContinueWith (precedent => {\n\t\t\tConsole.WriteLine (precedent.Result);\n\t\t\ttcs.SetResult (null);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System;\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo() { return null; }\n\tpublic async Task TestMethod ()\n\t{\n\t\tint precedentResult = await Foo ().ContinueWith (precedent => 1);\n\t\tConsole.WriteLine (precedentResult);\n\t\tobject result = null;\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLongInvalidContinue() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System;\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo() { return null; }\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\treturn 1;\n\t\t}).ContinueWith (precedent => {\n\t\t\tConsole.WriteLine (precedent.Result);\n\t\t\ttcs.SetResult (null);\n\t\t});\n\t\treturn tcs.Task;\n\t}\n}\", @\"\nusing System;\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task Foo() { return null; }\n\tpublic async Task TestMethod ()\n\t{\n\t\tint precedentResult = await Foo ().ContinueWith (precedent =>  {\n\t\t\treturn 1;\n\t\t});\n\t\tConsole.WriteLine (precedentResult);\n\t\tobject result = null;\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForBadReturn() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic Task $TestMethod ()\n\t{\n\t\tvar tcs = new TaskCompletionSource<object> ();\n\t\ttcs.SetResult (null);\n\t\treturn null;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForNoAction() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tpublic void $TestMethod ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidVoid() {\n\t\t\tTest<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tTask Foo() {}\n\tpublic void $TestMethod ()\n\t{\n\t\tFoo ().ContinueWith (precedent => {\n\t\t\tConsole.WriteLine (1);\n\t\t});\n\t}\n}\", @\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tTask Foo() {}\n\tpublic async void TestMethod ()\n\t{\n\t\tawait Foo ();\n\t\tConsole.WriteLine (1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForBadMultipleReturns() {\n\t\t\tTestWrongContext<AutoAsyncIssue>(@\"\nusing System.Threading.Tasks;\nclass TestClass\n{\n\tTask Foo() { return null; }\n\tpublic Task<int> $TestMethod ()\n\t{\n\t\tTaskCompletionSource<int> tcs = new TaskCompletionSource<int> ();\n\t\tFoo ().ContinueWith(precedent => { tcs.SetResult(1); })\n\t\t\t.ContinueWith(precedent => { tcs.SetResult(1); });\n\t\treturn tcs;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/BaseMemberHasParamsIssueTests.cs",
    "content": "//\n// BaseMemberHasParamsIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class BaseMemberHasParamsIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<BaseMemberHasParamsIssue>(@\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, params object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\tpublic override void Foo(string fmt, object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\", @\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, params object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\tpublic override void Foo(string fmt, params object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidCase ()\n\t\t{\n\t\t\tTestWrongContext<BaseMemberHasParamsIssue>(@\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, params object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\tpublic override void Foo(string fmt, params object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<BaseMemberHasParamsIssue>(@\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, params object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\t// ReSharper disable once BaseMemberHasParams\n\tpublic override void Foo(string fmt, object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/BaseMethodCallWithDefaultParameterIssueTests.cs",
    "content": "//\n// BaseMethodCallWithDefaultParameterIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class BaseMethodCallWithDefaultParameterIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTestRefactoringContext ctx;\n\t\t\tvar issues = GetIssues(new BaseMethodCallWithDefaultParameterIssue(), @\"\npublic class MyBase\n{\n\tpublic virtual void FooBar(int x = 12)\n\t{\n\t\tSystem.Console.WriteLine(\"\"Foo Bar\"\" + x);\n\t}\n}\n\npublic class MyClass : MyBase\n{\n\tpublic override void FooBar(int x = 12)\n\t{\n\t\tbase.FooBar();\n\t}\n}\n\", out ctx);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceCase ()\n\t\t{\n\t\t\tTestRefactoringContext ctx;\n\t\t\tvar issues = GetIssues(new BaseMethodCallWithDefaultParameterIssue(), @\"\npublic class MyBase\n{\n\tpublic virtual int this[int x, int y = 12] {\n\t\tget {\n\t\t\treturn 1;\n\t\t}\n\t}\n}\n\npublic class MyClass : MyBase\n{\n\tpublic override int this[int x, int y = 12] {\n\t\tget {\n\t\t\treturn base[x];\n\t\t}\n\t}\n}\n\", out ctx);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotWarnCase ()\n\t\t{\n\t\t\tTestWrongContext<BaseMethodCallWithDefaultParameterIssue>(@\"\npublic class MyBase\n{\n\tpublic virtual void FooBar(int x = 12)\n\t{\n\t\tSystem.Console.WriteLine(\"\"Foo Bar\"\" + x);\n\t}\n}\n\npublic class MyClass : MyBase\n{\n\tpublic override void FooBar(int x = 12)\n\t{\n\t\tbase.FooBar(11);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotWarnInParamsCase ()\n\t\t{\n\t\t\tTestWrongContext<BaseMethodCallWithDefaultParameterIssue>(@\"\npublic class MyBase\n{\n\tpublic virtual void FooBar(params int[] x)\n\t{\n\t\tSystem.Console.WriteLine(\"\"Foo Bar\"\" + x);\n\t}\n}\n\npublic class MyClass : MyBase\n{\n\tpublic override void FooBar(params int[] x)\n\t{\n\t\tbase.FooBar();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<BaseMethodCallWithDefaultParameterIssue> (@\"\npublic class MyBase\n{\n\tpublic virtual void FooBar(int x = 12)\n\t{\n\t\tSystem.Console.WriteLine(\"\"Foo Bar\"\" + x);\n\t}\n}\n\npublic class MyClass : MyBase\n{\n\tpublic override void FooBar(int x = 12)\n\t{\n\t\t// ReSharper disable once BaseMethodCallWithDefaultParameter\n\t\tbase.FooBar();\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/BaseMethodParameterNameMismatchIssueTests.cs",
    "content": "//\n// BaseMethodParameterNameMismatchIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class BaseMethodParameterNameMismatchIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestMethod ()\n\t\t{\n\t\t\tTest<BaseMethodParameterNameMismatchIssue>(@\"\nclass Foo\n{\n\tpublic virtual void FooBar (int bar) {}\n}\n\nclass Bar : Foo\n{\n\tpublic override void FooBar (int foo)\n\t{\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic virtual void FooBar (int bar) {}\n}\n\nclass Bar : Foo\n{\n\tpublic override void FooBar (int bar)\n\t{\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestIndexer ()\n\t\t{\n\t\t\tTest<BaseMethodParameterNameMismatchIssue>(@\"\nclass Foo\n{\n\tprotected virtual int this[int i, int j] { get { return 1; } }\n}\n\nclass Bar : Foo\n{\n\tprotected override int this[int i, int x] { get { return 1; } }\n}\n\", @\"\nclass Foo\n{\n\tprotected virtual int this[int i, int j] { get { return 1; } }\n}\n\nclass Bar : Foo\n{\n\tprotected override int this[int i, int j] { get { return 1; } }\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/BitwiseOperatorOnEnumWithoutFlagsIssueTests.cs",
    "content": "﻿// \n// BitwiseOperationOnNonFlagsEnumIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class BitwiseOperatorOnEnumWithoutFlagsIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestUnary ()\n\t\t{\n\t\t\tvar input = @\"\nenum TestEnum\n{\n\tItem1, Item2\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = ~TestEnum.Item1;\n\t}\n}\";\n\t\t\tTest<BitwiseOperatorOnEnumWithoutFlagsIssue> (input, 1);\n\t\t}\n\n\t\tpublic void TestAssignment (string op, bool bitwise = true)\n\t\t{\n\t\t\tvar input = @\"\nenum TestEnum\n{\n\tItem1, Item2\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = TestEnum.Item1;\n\t\tx \" + op + @\"= TestEnum.Item2;\n\t}\n}\";\n\t\t\tTest<BitwiseOperatorOnEnumWithoutFlagsIssue> (input, bitwise ? 1: 0);\n\t\t}\n\t\t[Test]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tTestAssignment (\"|\");\n\t\t\tTestAssignment (\"&\");\n\t\t\tTestAssignment (\"^\");\n\t\t\tTestAssignment (\"+\", false);\n\t\t}\n\n\t\tpublic void TestBinary (string op, bool bitwise = true)\n\t\t{\n\n\t\t\tvar input = @\"\nenum TestEnum\n{\n\tItem1, Item2\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x =  TestEnum.Item1 \" + op + @\" TestEnum.Item2;\n\t}\n}\";\n\t\t\tTest<BitwiseOperatorOnEnumWithoutFlagsIssue> (input, bitwise ? 1 : 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<BitwiseOperatorOnEnumWithoutFlagsIssue>(@\"\nenum TestEnum\n{\n    Item1, Item2\n}\nclass TestClass\n{\n    void TestMethod()\n    {\n\t    var x = TestEnum.Item1;\n        // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags\n        x = x ^ TestEnum.Item2;\n    }\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBinary()\n\t\t{\n\t\t\tTestBinary (\"&\");\n\t\t\tTestBinary (\"|\");\n\t\t\tTestBinary (\"^\");\n\t\t\tTestBinary (\"+\", false);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0029InvalidConversionIssueTests.cs",
    "content": "using System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0029InvalidConversionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestConversion()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\nenum Enum{ };\n\tvoid TestMethod (Enum i)\n\t{\n\t\tint x;\n\t\tx = i;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\nenum Enum{ };\n\tvoid TestMethod (Enum i)\n\t{\n\t\tint x;\n\t\tx = (int)i;\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConversionInInitializer()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\nenum Enum{ };\n\tvoid TestMethod (Enum i)\n\t{\n\t\tint x = i;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\nenum Enum{ };\n\tvoid TestMethod (Enum i)\n\t{\n\t\tint x = (int)i;\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestClassConversion()\n\t\t{\n\t\t\tvar input = @\"\nclass Base {}\nclass Test: Base {}\nclass TestClass\n{\n\tvoid TestMethod (Test i)\n\t{\n\t\tBase x;\n\t\tx = i;\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConversionDoubleFloat()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar () {\n\t\tdouble c = 3.5;\n\t\tfloat fc;\n\t\tfc = c;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass Foo\n{\n\tvoid Bar () {\n\t\tdouble c = 3.5;\n\t\tfloat fc;\n\t\tfc = (float)c;\n\t}\n}\";\n\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConversionEnumToInt()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tenum Enum { Zero }\n\tvoid Bar () {\n\t\tvar e = Enum.Zero;\n\t\tint val;\n\t\tval = e;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass Foo\n{\n\tenum Enum { Zero }\n\tvoid Bar () {\n\t\tvar e = Enum.Zero;\n\t\tint val;\n\t\tval = (int)e;\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConversionSameType()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint x =0;\n\t\tint y = 1;\n\t\t$x = i;\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUserDefinedAddition()\n\t\t{\n\t\t\tvar input = @\"\nstruct Vector {\n  public static explicit operator Point(Vector v) { return new Point(); }\n}\nstruct Point {\n  public static Point operator +(Point p, Vector v) { return new Point(); }\n}\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tPoint p = new Point();\n\t\t$p += new Vector();\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestImplicitOperator()\n\t\t{\n\t\t\tvar input = @\"\nstruct Vector {\n  public static implicit operator Point(Vector v) { return new Point(); }\n}\n\nstruct Point {\n\t\n}\n\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tPoint p;\n\t\tp = new Vector ();\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAssignZeroToEnum()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tStringComparison c = 0;\n\t\tc = 0;\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssignCustomClassToString()\n\t\t{\n\t\t\tTest<CS0029InvalidConversionIssue>(@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tstring x = this;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = this;\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12490 - Cast warnings with literals \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug12490()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tuint t;\n\t\tt = 6;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0029InvalidConversionIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestReturnInMethod()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tenum Enum{ };\n\tint TestMethod (Enum i)\n\t{\n\t\treturn i;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tenum Enum{ };\n\tint TestMethod (Enum i)\n\t{\n\t\treturn (int)i;\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturnInMethodChangeReturnType()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\treturn \"\"foo\"\";\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tstring TestMethod ()\n\t{\n\t\treturn \"\"foo\"\";\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestReturnInAnonymousMethod()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nclass TestClass\n{\n\tenum Enum{ };\n\tvoid TestMethod (Enum i)\n\t{\n\t\tFunc<int> foo = delegate {\n\t\t\treturn i;\n\t\t};\n\t}\n}\";\n\t\t\tvar output = @\"using System;\n\nclass TestClass\n{\n\tenum Enum{ };\n\tvoid TestMethod (Enum i)\n\t{\n\t\tFunc<int> foo = delegate {\n\t\t\treturn (int)i;\n\t\t};\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestReturnInProperty()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tenum Enum{ A };\n\tint Test {\n\t\tget {\n\t\t\treturn Enum.A;\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tenum Enum{ A };\n\tint Test {\n\t\tget {\n\t\t\treturn (int)Enum.A;\n\t\t}\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCall()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tenum Enum{ };\n\tvoid Foo(string s, int i) {}\n\tvoid TestMethod (Enum i)\n\t{\n\t\tFoo (\"\"Bar\"\", i);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tenum Enum{ };\n\tvoid Foo(string s, int i) {}\n\tvoid TestMethod (Enum i)\n\t{\n\t\tFoo (\"\"Bar\"\", (int)i);\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCallWithOverloads()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tenum Enum{ };\n\tvoid Foo(string s, object o) {}\n\tvoid Foo(string s, int i) {}\n\tvoid TestMethod (Enum i)\n\t{\n\t\tFoo (\"\"Bar\"\", i);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0029InvalidConversionIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCallWithOverloads2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tenum Enum{ };\n\tvoid Foo(string s, string o) {}\n\tvoid Foo(string s, int i) {}\n\tvoid TestMethod (Enum i)\n\t{\n\t\tFoo (\"\"Bar\"\", i);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0029InvalidConversionIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArrayInitializer()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tenum Enum{ A }\n\tpublic static void Main (string[] args)\n\t{\n\t\tSystem.Console.WriteLine (new int[] { Enum.A });\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tenum Enum{ A }\n\tpublic static void Main (string[] args)\n\t{\n\t\tSystem.Console.WriteLine (new int[] { (int)Enum.A });\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitConversionFromUnknownType()\n\t\t{\n\t\t\tstring input = @\"\nclass Test {\n\tvoid M(MissingInterface m) {\n\t\tthis.Project = (Project)m;\n\t}\n\tpublic Project Project { get; set; }\n}\nclass Project : MissingInterface {}\";\n\t\t\tTestWrongContext<CS0029InvalidConversionIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixedConversion()\n\t\t{\n\t\t\tvar input = @\"unsafe struct TestMe\n{\n\tfixed int textureID[8], fooBar[12];\n\n\tpublic void Randomize ()\n\t{\n\t\tfixed (int* buf = textureID) {\n\t\t\tbuf [0] = 1;\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0029InvalidConversionIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBinaryOperator()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\nenum Enum{ };\n\tvoid TestMethod (ulong i)\n\t{\n\t\tint x;\n\t\tx = i + i;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\nenum Enum{ };\n\tvoid TestMethod (ulong i)\n\t{\n\t\tint x;\n\t\tx = (int)(i + i);\n\t}\n}\";\n\t\t\tTest<CS0029InvalidConversionIssue>(input, output);\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestDeclarationFix ()\n\t\t{\n\t\t\tTest<CS0029InvalidConversionIssue>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tstring[] str = new List<string> ();\n}\", @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tList<string> str = new List<string> ();\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalDeclarationFix ()\n\t\t{\n\t\t\tTest<CS0029InvalidConversionIssue>(@\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tvoid Foo ()\n\t{\n\t\tstring[] str = new List<string> ();\n\t}\n}\", @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tvoid Foo ()\n\t{\n\t\tvar str = new List<string> ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void LinqQueryBug()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic static class FooExt\n{\n\tpublic static May<TOut> Select<TIn, TOut>(this May<TIn> value, Func<TIn, TOut> projection)\n\t{\n\t\treturn new May<TOut> ();\n\t}\n}\n\npublic class May<T>\n{\n\tpublic T Property { get; set; }\n}\n\npublic class EmptyClass\n{\n\tpublic May<EmptyClass> Foo ()\n\t{\n\t\treturn \n\t\t\tfrom foo in new May<EmptyClass> ()\n\t\t\tselect foo;\n\t}\n}\n\";\n\t\t\tTestWrongContext<CS0029InvalidConversionIssue> (input);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0126ReturnMustBeFollowedByAnyExpressionTestes.cs",
    "content": "//\n// CS0126ReturnMustBeFollowedByAnyExpressionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0126ReturnMustBeFollowedByAnyExpressionTests : InspectionActionTestBase\n\t{\n\t\tstatic void Test(string type, string defaultValue)\n\t\t{\n\t\t\tTest<CS0126ReturnMustBeFollowedByAnyExpression>(@\"class Foo\n{\n\t\" + type + @\" Bar (string str)\n\t{\n\t\treturn;\n\t}\n}\", @\"class Foo\n{\n\t\" + type + @\" Bar (string str)\n\t{\n\t\treturn \" + defaultValue + @\";\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest(\"int\", \"0\");\n\t\t\tTest(\"string\", \"\\\"\\\"\");\n\t\t\tTest(\"char\", \"' '\");\n\t\t\tTest(\"bool\", \"false\");\n\t\t\tTest(\"object\", \"null\");\n\t\t\tTest(\"System.DateTime\", \"default(System.DateTime)\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturnTypeFix ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tint Bar (string str)\n\t{\n\t\treturn;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\treturn;\n\t}\n}\", 1);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestProperty ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tstring Bar \n\t{\n\t\tget {\n\t\t\treturn;\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestPropertySetter ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tstring Bar \n\t{\n\t\tset {\n\t\t\treturn;\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIndexer ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tstring this [int idx]\n\t{\n\t\tget {\n\t\t\treturn;\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethod ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tSystem.Func<string> func = delegate {\n\t\t\treturn;\n\t\t};\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodReturnTypeFix ()\n\t\t{\n\t\t\tTest<CS0126ReturnMustBeFollowedByAnyExpression>(@\"\nusing System;\nclass Foo\n{\n\tint Bar (string str)\n\t{\n\t\tSystem.Func<string> func = delegate {\n\t\t\treturn;\n\t\t};\n\t}\n}\", @\"\nusing System;\nclass Foo\n{\n\tint Bar (string str)\n\t{\n\t\tSystem.Func<string> func = delegate {\n\t\t\treturn \"\"\"\";\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodReturningVoid ()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction func = delegate {\n\t\t\treturn;\n\t\t};\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestLambdaMethod ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tSystem.Func<string> func = () => {\n\t\t\treturn;\n\t\t};\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOperatorFalsePositives ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tpublic static bool operator == (Foo left, Foo right)\n\t{\n\t\treturn;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tFoo ()\n\t{\n\t\treturn;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDestructor ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\t~Foo ()\n\t{\n\t\treturn;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDontShowUpOnUndecidableCase ()\n\t\t{\n\t\t\tTestWrongContext<CS0126ReturnMustBeFollowedByAnyExpression>(@\"\nusing System;\n\nclass Test\n{\n\tvoid Foo (Func<int, int> func) {}\n\tvoid Foo (Action<int> func) {}\n\n\tvoid Bar (string str)\n\t{\n\t\tFoo(delegate {\n\t\t\treturn;\n\t\t});\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParallelForBug ()\n\t\t{\n\t\t\tTestWrongContext<CS0126ReturnMustBeFollowedByAnyExpression>(@\"\nusing System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tvoid FooBar(IEnumerable<string> str)\n\t{\n\t\tParallel.ForEach(str, p => {\n\t\t\treturn;\n\t\t});\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestConstructorInitializer ()\n\t\t{\n\t\t\tTestWrongContext<CS0126ReturnMustBeFollowedByAnyExpression>(@\"\nusing System;\n\nclass Test\n{\n\tTest (Func<int, int> func) {}\n\tTest (Action<int> func) {}\n\t\n\tTest () : this (delegate { return; }) \n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAsyncMethod_Void()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tpublic async void M()\n\t{\n\t\treturn;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAsyncMethod_Task()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tpublic async Task M()\n\t{\n\t\treturn;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAsyncMethod_TaskOfInt()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tpublic async Task<int> M()\n\t{\n\t\treturn;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0126ReturnMustBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0127ReturnMustNotBeFollowedByAnyExpressionTests.cs",
    "content": "﻿//\n// CS0127ReturnMustNotBeFollowedByAnyExpressionTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0127ReturnMustNotBeFollowedByAnyExpressionTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\treturn str;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestReturnTypeFix ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\treturn str;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tstring Bar (string str)\n\t{\n\t\treturn str;\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleInvalidCase ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tstring Bar (string str)\n\t{\n\t\treturn str;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestProperty ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tstring Bar \n\t{\n\t\tget {\n\t\t\treturn \"\"Hello World \"\";\n\t\t}\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexer ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tstring this [int idx]\n\t{\n\t\tget {\n\t\t\treturn \"\"Hello World \"\";\n\t\t}\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerSetter ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tstring this [int idx]\n\t{\n\t\tset {\n\t\t\treturn \"\"Hello World \"\";\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethod ()\n\t\t{\n\t\t\tTest<CS0127ReturnMustNotBeFollowedByAnyExpression>(@\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tSystem.Action func = delegate {\n\t\t\treturn str;\n\t\t};\n\t}\n}\", @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tSystem.Action func = delegate {\n\t\t\treturn;\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodReturningValue ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tSystem.Func<string> func = delegate {\n\t\t\treturn str;\n\t\t};\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLambdaMethod ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tSystem.Func<string> func = () => {\n\t\t\treturn str;\n\t\t};\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOperatorFalsePositives ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tpublic static bool operator == (Foo left, Foo right)\n\t{\n\t\treturn true;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tFoo ()\n\t{\n\t\treturn 1;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestDestructor ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\t~Foo ()\n\t{\n\t\treturn 1;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void TestDontShowUpOnUndecidableCase ()\n\t\t{\n\t\t\tTestWrongContext<CS0127ReturnMustNotBeFollowedByAnyExpression>(@\"\nusing System;\n\nclass Test\n{\n\tvoid Foo (Func<int, int> func) {}\n\tvoid Foo (Action<int> func) {}\n\n\tvoid Bar (string str)\n\t{\n\t\tFoo(delegate {\n\t\t\treturn str;\n\t\t});\n\t}\n}\");\n\t\t}\n\n\n\n\t\t/// <summary>\n\t\t/// Bug 14843 - CS0127ReturnMustNotBeFollowedByAnyExpression Code Issue false positive\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14843 ()\n\t\t{\n\t\t\tTestWrongContext<CS0127ReturnMustNotBeFollowedByAnyExpression>(@\"\nusing System;\n\nclass Foo {\n\tpublic Func<object, object> Func;\n}\nclass Bar\n{\n\tvoid Test ()\n\t{\n\t\tnew Foo {\n\t\t\tFunc = o => {\n\t\t\t\treturn o;\n\t\t\t}\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAsyncMethod_Void()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tpublic async void M()\n\t{\n\t\treturn 1;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAsyncMethod_Task()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tpublic async Task M()\n\t{\n\t\treturn 1;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAsyncMethod_TaskOfInt()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tpublic async Task<int> M()\n\t{\n\t\treturn 1;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new CS0127ReturnMustNotBeFollowedByAnyExpression (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0152DuplicateCaseLabelValueIssueTests.cs",
    "content": "//\n// DuplicateCaseLabelValueIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\n\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0152DuplicateCaseLabelValueIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestConstants()\n\t\t{\n\t\t\tTestIssue<CS0152DuplicateCaseLabelValueIssue>(@\"\nclass Test\n{\n\tconst int foo = 1;\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\t\tcase 1:\n\t\t\t\tSystem.Console.WriteLine();\n\t\t\t\tbreak;\n\t\t\tcase foo:\n\t\t\t\tSystem.Console.WriteLine();\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tdefault:\n\t\t\tcase 3:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\", 2);\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestInts()\n\t\t{\n\t\t\tTestIssue<CS0152DuplicateCaseLabelValueIssue>(@\"\nclass Test\n{\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\tcase 0:\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\tdefault:\n\t\tcase 0:\n\t\t\tbreak;\n\t\t}\n\t}\n}\", 3);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStrings()\n\t\t{\n\t\t\tTestIssue<CS0152DuplicateCaseLabelValueIssue>(@\"\nclass Test\n{\n\tvoid TestMethod (string i = 0)\n\t{\n\t\tswitch (i) {\n\t\tcase \"\"\t\"\":\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\tcase \"\"\\t\"\":\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\tdefault:\n\t\tcase @\"\"\t\"\":\n\t\t\tbreak;\n\t\t}\n\t}\n}\", 3);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue()\n\t\t{\n\t\t\tTestWrongContext<CS0152DuplicateCaseLabelValueIssue>(@\"\nclass Test\n{\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\tcase 1:\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\tcase 4:\n\t\tdefault:\n\t\tcase 3:\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0169FieldIsNeverUsedIssueTests.cs",
    "content": "﻿//\n// CS0169FieldIsNeverUsedIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0169FieldIsNeverUsedIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInitializedField ()\n\t\t{\n\t\t\tTestWrongContext<CS0169FieldIsNeverUsedIssue>(@\"class Test\n{\n\tobject fooBar = new object ();\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldAssignedInConstructor ()\n\t\t{\n\t\t\tTestWrongContext<CS0169FieldIsNeverUsedIssue>(@\"class Test\n{\n\tobject fooBar;\n\tpublic Test ()\n\t{\n\t\tfooBar = new object ();\n\t}\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestUnassignedField ()\n\t\t{\n\t\t\tTestIssue<CS0169FieldIsNeverUsedIssue>(@\"class Test\n{\n\tobject fooBar;\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestFieldOnlyUsed ()\n\t\t{\n\t\t\tTestIssue<CS0169FieldIsNeverUsedIssue>(@\"class Test\n{\n\tobject fooBar;\n\tpublic Test ()\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestReadonlyField ()\n\t\t{\n\t\t\tTestIssue<CS0169FieldIsNeverUsedIssue>(@\"class Test\n{\n\treadonly object fooBar;\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestPragmaDisable ()\n\t\t{\n\t\t\tTestWrongContext<CS0169FieldIsNeverUsedIssue>(@\"class Test\n{\n#pragma warning disable 169\n\tobject fooBar;\n#pragma warning restore 169\n\tpublic Test ()\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0183ExpressionIsAlwaysOfProvidedTypeIssueTests.cs",
    "content": "﻿// \n// ExpressionIsAlwaysOfProvidedTypeIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n \nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0183ExpressionIsAlwaysOfProvidedTypeIssueTests : InspectionActionTestBase\n\t{\n\t\tpublic void Test (string variableType, string providedType)\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (\" + variableType + @\" x)\n\t{\n\t\tif (x is \" + providedType + @\")\n\t\t\t;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (\" + variableType + @\" x)\n\t{\n\t\tif (x != null)\n\t\t\t;\n\t}\n}\";\n\t\t\tTest<CS0183ExpressionIsAlwaysOfProvidedTypeIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSameType ()\n\t\t{\n\t\t\tTest (\"int\", \"int\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBaseType ()\n\t\t{\n\t\t\tTest (\"int\", \"object\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod<T> (T x) where T : TestClass\n\t{\n\t\tif (x is TestClass)\n\t\t\t;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod<T> (T x) where T : TestClass\n\t{\n\t\tif (x != null)\n\t\t\t;\n\t}\n}\";\n\t\t\tTest<CS0183ExpressionIsAlwaysOfProvidedTypeIssue> (input, 1, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntIsNotDouble ()\n\t\t{\n\t\t\tvar input = @\"\nsealed class TestClass\n{\n\tvoid TestMethod (int x)\n\t{\n\t\tif (x is double) ;\n\t}\n}\";\n\t\t\tTest<CS0183ExpressionIsAlwaysOfProvidedTypeIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MissingTypes ()\n\t\t{\n\t\t\tvar input = @\"\nsealed class TestClass\n{\n\tvoid TestMethod (object x)\n\t{\n\t\tif (x.MissingMethod() is MissingClass) ;\n\t}\n}\";\n\t\t\tTest<CS0183ExpressionIsAlwaysOfProvidedTypeIssue> (input, 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<CS0183ExpressionIsAlwaysOfProvidedTypeIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (TestClass x)\n\t{\n\t\t// ReSharper disable once CSharpWarnings::CS0183\n\t\tif (x is TestClass)\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPragmaDisable()\n\t\t{\n\t\t\tTestWrongContext<CS0183ExpressionIsAlwaysOfProvidedTypeIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (TestClass x)\n\t{\n#pragma warning disable 183\n\t\tif (x is TestClass)\n#pragma warning restore 183\n\t\t\t;\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0618UsageOfObsoleteMemberIssueTests.cs",
    "content": "﻿//\n// CS0618UsageOfObsoleteMemberIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0618UsageOfObsoleteMemberIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestObsoleteMethodUsage()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete (\"\"Use NewBar\"\")]\n\tpublic static void OldBar ()\n\t{\n\t}\n\n\tpublic static void NewBar ()\n\t{\n\t}\n}\n\nclass MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tFoo.OldBar ();\n\t}\n}\n\";\n\t\t\tTestIssue<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObsoleteProperty()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete ()]\n\tpublic int Bar { get; set; }\n}\n\nclass MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tnew Foo().Bar = 5;\n\t}\n}\n\";\n\t\t\tTestIssue<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObsoleteIndexer()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete ()]\n\tpublic int this[int i] {\n\t\tget {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\nclass MyClass\n{\n\n\tpublic static void Main ()\n\t{\n\t\tvar f = new Foo ();\n\t\tConsole.WriteLine (f[0]);\n\t}\n}\n\";\n\t\t\tTestIssue<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObsoleteEvent()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete ()]\n\tpublic event EventHandler A;\n}\n\nclass MyClass\n{\n\n\tpublic static void Main ()\n\t{\n\t\tvar f = new Foo ();\n\t\tf.A += delegate {\n\n\t\t};\n\t}\n}\n\";\n\t\t\tTestIssue<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObsoleteField()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete]\n\tpublic int A;\n}\n\nclass MyClass\n{\n\n\tpublic static void Main ()\n\t{\n\t\tvar f = new Foo ();\n\t\tConsole.WriteLine (f.A);\n\t}\n}\n\";\n\t\t\tTestIssue<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObsoleteBinaryOperator()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete]\n\tpublic static Foo operator+(Foo l, Foo r)\n\t{\n\t\treturn l;\n\t}\n}\n\nclass MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tvar f = new Foo ();\n\t\tConsole.WriteLine (f + f);\n\t}\n}\n\";\n\t\t\tTestIssue<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestPragmaDisable()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete ()]\n\tpublic int Bar { get; set; }\n}\n\nclass MyClass\n{\n\tpublic static void Main ()\n\t{\n#pragma warning disable 618\n\t\tnew Foo().Bar = 5;\n#pragma warning restore 618\n\t}\n}\n\";\n\t\t\tTestWrongContext<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 17859 - Source analysis should not warn when obsolete member is used by obsolete member\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17859()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Foo\n{\n\t[Obsolete]\n\tpublic static void OldBar ()\n\t{\n\t}\n\n\t[Obsolete]\n\tpublic static void OldBar2 ()\n\t{\n\t\tOldBar ();\n\t}\n}\n\";\n\t\t\tTestWrongContext<CS0618UsageOfObsoleteMemberIssue>(input);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0659OverrideEqualsWithoutGetHashCodeTests.cs",
    "content": "//\n// CS0659OverrideEqualsWithoutGetHashCodeTests.cs\n//\n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n//\n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeIssues;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0659OverrideEqualsWithoutGetHashCodeTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void WithoutGetHashCode()\n\t\t{\n\t\t\tvar input = @\"\nnamespace application\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic override bool Equals(object o)\n\t\t{\n\t\t\treturn base.Equals(o);\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nnamespace application\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic override bool Equals(object o)\n\t\t{\n\t\t\treturn base.Equals(o);\n\t\t}\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn base.GetHashCode ();\n\t\t}\n\t}\n}\";\n\t\t\tTest<CS0659ClassOverrideEqualsWithoutGetHashCode>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WithoutEquals()\n\t\t{\n\t\t\tvar input = @\"\n\nnamespace application\n{\n\tpublic class Program\n\t{\n\t\tpublic bool Equals(Program o)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n}\";\n\t\t\tTest<CS0659ClassOverrideEqualsWithoutGetHashCode>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PatialClass()\n\t\t{\n\t\t\tvar input = @\"\nnamespace application\n{\n\tpublic partial class BaseClass\n\t{\n\t\tpublic override bool Equals(object o)\n\t\t{\n\t\t\treturn base.Equals(o);\n\t\t}\n\t}\n\tpublic partial class BaseClass\n\t{\n\t\tpublic override int GetHashCode ()\n\t\t{\n\t\t\treturn base.GetHashCode ();\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<CS0659ClassOverrideEqualsWithoutGetHashCode>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WithGetHashCode()\n\t\t{\n\t\t\tvar input = @\"\nnamespace application\n{\n\tpublic class Program\n\t{\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\tpublic override bool Equals(Object o)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n}\";\n\t\t\tTest<CS0659ClassOverrideEqualsWithoutGetHashCode>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ResharperDisable()\n\t\t{\n\t\t\tvar input = @\"\nnamespace application\n{\n\tpublic class Program\n\t{\n//Resharper disable CSharpWarnings::CS0659\n\t\tpublic override bool Equals(Object o)\n\t\t{\n\t\t\treturn false;\n\t\t}\n//Resharper restore CSharpWarnings::CS0659\n\t}\n}\";\n\t\t\tTest<CS0659ClassOverrideEqualsWithoutGetHashCode>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPragmaSuppression()\n\t\t{\n\t\t\tvar input = @\"\nnamespace application\n{\n\tpublic class Program\n\t{\n#pragma warning disable 0659\n\t\tpublic override bool Equals(Object o)\n\t\t{\n\t\t\treturn false;\n\t\t}\n#pragma warning restore 0659\n\t}\n}\";\n\t\t\tTest<CS0659ClassOverrideEqualsWithoutGetHashCode>(input, 0);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS0759RedundantPartialMethodIssueTests.cs",
    "content": "﻿// \n// RedundantPartialMethodTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS0759RedundantPartialMethodIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestRedundantModifier()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass\n{\n\tpartial void TestMethod ()\n\t{\n\t\tint i = 1;\n\t}\n}\";\n\t\t\tvar output = @\"\npartial class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 1;\n\t}\n}\";\n\t\t\tTest<CS0759RedundantPartialMethodIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodWithNoBody()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass\n{\n\tpartial void TestMethod ();\n}\";\n\t\t\tTest<CS0759RedundantPartialMethodIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNecessaryModifier()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass\n{\n\tpartial void TestMethod ();\n}\npartial class TestClass\n{\n\tpartial void TestMethod ()\n\t{\n\t\tint i = 1;\n\t}\n}\";\n\t\t\tTest<CS0759RedundantPartialMethodIssue>(input, 0);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS1573ParameterHasNoMatchingParamTagIssueTests.cs",
    "content": "//\n// CS1573ParameterHasNoMatchingParamTagIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS1573ParameterHasNoMatchingParamTagIssueTests: InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestMethodMissesParameter()\n\t\t{\n\t\t\tTest<CS1573ParameterHasNoMatchingParamTagIssue>(@\"\nclass Foo {\n\t/// <summary/>\n\t/// <param name = \"\"y\"\"></param>\n\t/// <param name = \"\"z\"\"></param>\n\tpublic void FooBar(int x, int y, int z)\n\t{\n\t}\n}\n\", @\"\nclass Foo {\n\t/// <summary/>\n\t/// <param name = \"\"x\"\"></param>\n\t/// <param name = \"\"y\"\"></param>\n\t/// <param name = \"\"z\"\"></param>\n\tpublic void FooBar(int x, int y, int z)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoParamDocs()\n\t\t{\n\t\t\tTestWrongContext<CS1573ParameterHasNoMatchingParamTagIssue>(@\"\nclass Foo {\n\t/// <summary/>\n\tpublic void FooBar(int x, int y, int z)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<CS1573ParameterHasNoMatchingParamTagIssue>(@\"\nclass Foo {\n\t/// <summary/>\n\t/// <param name = \"\"y\"\"></param>\n\t/// <param name = \"\"z\"\"></param>\n// ReSharper disable once CSharpWarnings::CS1573\n\tpublic void FooBar(int x, int y, int z)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPragmaDisable()\n\t\t{\n\t\t\tTestWrongContext<CS1573ParameterHasNoMatchingParamTagIssue>(@\"\nclass Foo {\n\t/// <summary/>\n\t/// <param name = \"\"y\"\"></param>\n\t/// <param name = \"\"z\"\"></param>\n#pragma warning disable 1573\n\tpublic void FooBar(int x, int y, int z)\n#pragma warning restore 1573\n\t{\n\t}\n}\n\");\n\t\t}\n\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS1717AssignmentMadeToSameVariableIssueTests.cs",
    "content": "﻿// \n// CS1717AssignmentMadeToSameVariableIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS1717AssignmentMadeToSameVariableIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVariable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a = 0;\n\t\ta = a;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a = 0;\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 1, output);\n\t\t}\n\n        [Ignore(\"Parser/AST generation error - WarningList is empty\")]\n        [Test]\n        public void TestPragmaSuppression()\n        {\n            var input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n        int a = 0;\n#pragma warning disable 1717\n        a = a;\n#pragma warning restore 1717\n\t}\n}\";\n            TestWrongContext<CS1717AssignmentMadeToSameVariableIssue>(input);\n        }\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n        int a = 0;\n// ReSharper disable once CSharpWarnings::CS1717\n        a = a;\n\t}\n}\";\n            TestWrongContext<CS1717AssignmentMadeToSameVariableIssue>(input);\n        }\n\n\n\n\t\t[Test]\n\t\tpublic void TestParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\ta = a;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint a;\n\tvoid TestMethod ()\n\t{\n\t\ta = a;\n\t\tthis.a = this.a;\n\t\tthis.a = a;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint a;\n\tvoid TestMethod ()\n\t{\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 3, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFix ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Test (int i) { }\n\tvoid TestMethod ()\n\t{\n\t\tint a = 0;\n\t\ta = a;\n\t\tTest (a = a);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid Test (int i) { }\n\tvoid TestMethod ()\n\t{\n\t\tint a = 0;\n\t\tTest (a);\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 2, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint a;\n\tint b;\n\n\tpublic int Prop { get; set; }\n\n\tvoid TestMethod (int a)\n\t{\n\t\ta = b;\n\t\tthis.a = b;\n\t\tthis.a = a;\n\t\tProp = Prop;\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresAssignmentWithDifferentRootObjects ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint a;\n\n\tvoid TestMethod (TestClass tc)\n\t{\n\t\ta = tc.a;\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedFieldAccess ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint a;\n\n\tTestClass nested;\n\n\tvoid TestMethod ()\n\t{\n\t\tnested.nested.a = nested.nested.a;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint a;\n\n\tTestClass nested;\n\n\tvoid TestMethod ()\n\t{\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 1, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedPropertyAccess ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint a;\n\n\tTestClass nested { get; set; }\n\n\tvoid TestMethod ()\n\t{\n\t\tnested.nested.a = nested.nested.a;\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNoIssueWithCompoundOperator ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\ta += a;\n\t}\n}\";\n\t\t\tTest<CS1717AssignmentMadeToSameVariableIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CS1729TypeHasNoConstructorWithNArgumentsIssueTests.cs",
    "content": "//\n// CS1729TypeHasNoConstructorWithNArgumentsIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeIssues;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CS1729TypeHasNoConstructorWithNArgumentsIssueTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void ShouldReturnIssueIfBaseConstructorNotInvoked()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tpublic BaseClass(string input) {}\n}\n\nclass ChildClass : BaseClass\n{\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueIfBaseClassHasDefaultConstructor()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n}\n\nclass ChildClass : BaseClass\n{\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueIfBaseConstructorIsInvoked()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tpublic BaseClass(string input) {}\n}\n\nclass ChildClass : BaseClass\n{\n\tpublic ChildClass() : base(\"\"test\"\") {}\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldIgnoreInterfaces()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class TestClass : System.Collections.IList\n{\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldMakeSureAllConstructorsInvokeBaseConstructor()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tpublic BaseClass(string test) {}\n}\n\nclass ChildClass : BaseClass\n{\n\tpublic ChildClass() : base(\"\"test\"\") {}\n\tpublic ChildClass(string test) {}\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldOnlyLookAtDirectBaseClasses()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class TopLevelClass\n{\n\tpublic TopLevelClass(string test) {}\n}\n\nclass BaseClass : TopLevelClass\n{\n\tpublic BaseClass() : base(\"\"hello\"\") {}\n}\n\nclass ChildClass : BaseClass\n{\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnAnIssueIfBaseConstructorIsPrivate()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tprivate BaseClass() {}\n}\n\nclass ChildClass : BaseClass\n{\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnAnIssueIfBaseConstructorIsPrivate_ExplicitInitializer()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tprivate BaseClass() {}\n}\n\nclass ChildClass : BaseClass\n{\n\tpublic ChildClass() : base() {}\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldReturnIssuesForNestedTypes()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\n\t\t\tvar testInput =\n\t\t\t\t@\"class B {\n\tpublic B(string test) {}\n}\n\nclass D {\n\tpublic D(string test) {}\n}\n\nclass A : B {\n\tclass C : D {}\n\tpublic A() {}\n}\";\n\n\t\t\tvar issues = GetIssues(new CS1729TypeHasNoConstructorWithNArgumentsIssue(), testInput, out context, false);\n\n\t\t\tAssert.AreEqual(\"CS1729: The type 'B' does not contain a constructor that takes '0' arguments\", issues.ElementAt(1).Description);\n\t\t\tAssert.AreEqual(\"CS1729: The type 'D' does not contain a constructor that takes '0' arguments\", issues.ElementAt(0).Description);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueIfBaseClassCtorHasOptionalParameters()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tpublic BaseClass(int i = 0)\n\t{\n\t}\n}\n\nclass ChildClass : BaseClass\n{\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueIfBaseClassCtorHasVariadicParameters()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tpublic BaseClass(params string[] str)\n\t{\n\t}\n}\n\nclass ChildClass : BaseClass\n{\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShouldNotReturnIssueForStaticConstructor()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class BaseClass\n{\n\tpublic BaseClass(string text)\n\t{\n\t}\n}\n\nclass ChildClass : BaseClass\n{\n\tpublic ChildClass() : base(\"\"text\"\") {}\n\t\n\tstatic ChildClass() {}\n}\";\n\n\t\t\tTest<CS1729TypeHasNoConstructorWithNArgumentsIssue>(testInput, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ShowIssueForObjectCreateExpression()\n\t\t{\n\t\t\tvar testInput =\n\t\t\t\t@\"class Test {\n\tpublic void M() {\n\t\tnew Test(1);\n\t}\n}\n\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new CS1729TypeHasNoConstructorWithNArgumentsIssue(), testInput, out context);\n\n\t\t\tAssert.AreEqual(\"CS1729: The type 'Test' does not contain a constructor that takes '1' arguments\", issues.Single().Description);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CallToObjectEqualsViaBaseTests.cs",
    "content": "//\n// CallToObjectEqualsViaBaseTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CallToObjectEqualsViaBaseTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tFoo()\n\t{\n\t\tbool b = base.Equals (\"\"blah\"\");\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new CallToObjectEqualsViaBaseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\tCheckFix(context, issues, @\"\nclass Foo\n{\n\tFoo()\n\t{\n\t\tbool b = object.ReferenceEquals (this, \"\"blah\"\");\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonObjectBase()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n}\nclass Bar : Foo\n{\n\tvoid Baz ()\n\t{\n\t\tbool b = base.Equals (\"\"blah\"\");\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new CallToObjectEqualsViaBaseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, @\"\nclass Foo\n{\n}\nclass Bar : Foo\n{\n\tvoid Baz ()\n\t{\n\t\tbool b = object.ReferenceEquals (this, \"\"blah\"\");\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresCallsToOtherObjects()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n}\nclass Bar : Foo\n{\n\tvoid Baz ()\n\t{\n\t\tvar foo1 = new Foo();\n\t\tvar foo2 = new Foo();\n\t\tbool b = foo1.Equals(foo2);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new CallToObjectEqualsViaBaseIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CanBeReplacedWithTryCastAndCheckForNullIssueTests.cs",
    "content": "//\n// CanBeReplacedWithTryCastAndCheckForNullIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CanBeReplacedWithTryCastAndCheckForNullIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tTestIssue<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo is Bar) {\n\t\t\tBaz ((Bar)foo);\n\t\t\treturn (Bar)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ComplexCase()\n\t\t{\n\t\t\tTestIssue<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic IDisposable Baz (object foo)\n\t{\n\t\tif (((foo) is Bar)) {\n\t\t\tBaz ((Bar)foo);\n\t\t\tBaz (foo as Bar);\n\t\t\tBaz (((foo) as Bar));\n\t\t\tBaz ((Bar)(foo));\n\t\t\treturn (IDisposable)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IfElseCase()\n\t\t{\n\t\t\tTestIssue<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo is Bar) {\n\t\t\tBaz ((Bar)foo);\n\t\t\treturn (Bar)foo;\n\t\t} else {\n\t\t\tConsole.WriteLine (\"\"Hello World \"\");\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvalidIfNoTypeCast()\n\t\t{\n\t\t\tTestWrongContext<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo is Bar) {\n\t\t\tConsole.WriteLine (\"\"Hello World \"\");\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedIf()\n\t\t{\n\t\t\tTestIssue<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (foo is string) {\n\t\t} else if (foo is Bar) {\n\t\t\tBaz ((Bar)foo);\n\t\t\treturn (Bar)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegatedCaseWithReturn()\n\t\t{\n\t\t\tTestIssue<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tif (!(foo is Bar))\n\t\t\treturn null;\n\t\tBaz ((Bar)foo);\n\t\treturn (Bar)foo;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegatedCaseWithBreak()\n\t\t{\n\t\t\tTestIssue<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (!(foo is Bar))\n\t\t\t\tbreak;\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn (Bar)foo;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseWithContinue()\n\t\t{\n\t\t\tTestIssue<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (!(foo is Bar)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tfoo = new Bar ();\n\t\t\t}\n\t\t\tBaz ((Bar)foo);\n\t\t}\n\t\treturn (Bar)foo;\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic Bar Baz (object foo)\n\t{\n\t\t// ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull\n\t\tif (foo is Bar) {\n\t\t\tBaz ((Bar)foo);\n\t\t\treturn (Bar)foo;\n\t\t}\n\t\treturn null;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvaludValueType()\n\t\t{\n\t\t\tTestWrongContext<CanBeReplacedWithTryCastAndCheckForNullIssue>(@\"\nclass Bar\n{\n\tpublic int Baz (object foo)\n\t{\n\t\tif (foo is int) {\n\t\t\tBaz ((int)foo);\n\t\t\treturn (int)foo;\n\t\t}\n\t\treturn 0;\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CastExpressionOfIncompatibleTypeIssueTests.cs",
    "content": "﻿// \n// CastExpressionOfIncompatibleTypeIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CastExpressionOfIncompatibleTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar x = (string)i;\n\t\tvar y = i as string;\n\t}\n}\";\n\t\t\tTest<CastExpressionOfIncompatibleTypeIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCompatibleTypes ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x1 = (int)123;\n\t\tvar x2 = (short)123;\n\t\tvar x3 = (int)System.ConsoleKey.A;\n\t}\n}\";\n\t\t\tTest<CastExpressionOfIncompatibleTypeIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownIdentifierDoesNotCauseIncompatibleCastIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x1 = unknown as string;\n\t\tvar x2 = (string)unknown;\n\t}\n}\";\n\n\t\t\tTest<CastExpressionOfIncompatibleTypeIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownTargetTypeDoesNotCauseIncompatibleCastIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int p)\n\t{\n\t\tvar x1 = (unknown)p;\n\t\tvar x2 = p as unknown;\n\t}\n}\";\n\n\t\t\tTest<CastExpressionOfIncompatibleTypeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CheckTemplates ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod<T> (TestClass t)\n\t{\n\t\tvar o = t as T;\n\t}\n}\";\n\n\t\t\tTest<CastExpressionOfIncompatibleTypeIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CheckNamespaceIssueTests.cs",
    "content": "//\n// CheckNamespaceIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CheckNamespaceIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestWrongNamespace ()\n\t\t{\n\t\t\tTestIssue<CheckNamespaceIssue>(@\"namespace Foo {}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSubstring ()\n\t\t{\n\t\t\tTestIssue<CheckNamespaceIssue>(@\"namespace TestFoo {}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestGlobalClass ()\n\t\t{\n\t\t\tTestIssue<CheckNamespaceIssue>(@\"class Foo {}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void CheckValidNamespace ()\n\t\t{\n\t\t\tTestWrongContext<CheckNamespaceIssue>(@\"namespace Test {}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<CheckNamespaceIssue>(@\"\n// ReSharper disable once CheckNamespace\nnamespace Foo {}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CompareNonConstrainedGenericWithNullIssueTests.cs",
    "content": "//\n// CompareNonConstrainedGenericWithNullIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CompareNonConstrainedGenericWithNullIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestLocal ()\n\t\t{\n\t\t\tTest<CompareNonConstrainedGenericWithNullIssue>(@\"public class Bar\n{\n\tpublic void Foo<T> (T t)\n\t{\n\t\tif (t == null) {\n\t\t}\n\t}\n}\", @\"public class Bar\n{\n\tpublic void Foo<T> (T t)\n\t{\n\t\tif (t == default(T)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tTest<CompareNonConstrainedGenericWithNullIssue>(@\"public class Bar<T>\n{\n\tT t;\n\tpublic void Foo ()\n\t{\n\t\tif (t == null) {\n\t\t}\n\t}\n}\", @\"public class Bar<T>\n{\n\tT t;\n\tpublic void Foo ()\n\t{\n\t\tif (t == default(T)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid ()\n\t\t{\n\t\t\tTestWrongContext<CompareNonConstrainedGenericWithNullIssue>(@\"public class Bar\n{\n\tpublic void Foo<T> (T t) where T : class\n\t{\n\t\tif (t == null) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<CompareNonConstrainedGenericWithNullIssue>(@\"public class Bar\n{\n\tpublic void Foo<T> (T t)\n\t{\n\t\t// ReSharper disable once CompareNonConstrainedGenericWithNull\n\t\tif (t == null) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/CompareOfFloatsByEqualityOperatorIssueTests.cs",
    "content": "// \n// CompareFloatWithEqualityOperatorIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class CompareOfFloatsByEqualityOperatorIssueTests : InspectionActionTestBase\n\t{\n\t\tstatic void Test (string inputOp, string outputOp)\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tdouble x = 0.1;\n\t\tbool test = x \" + inputOp + @\" 0.1;\n\t\tbool test2 = x \" + inputOp + @\" 1ul;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tdouble x = 0.1;\n\t\tbool test = System.Math.Abs (x - 0.1) \" + outputOp + @\" EPSILON;\n\t\tbool test2 = System.Math.Abs (x - 1ul) \" + outputOp + @\" EPSILON;\n\t}\n}\";\n\t\t\tTest<CompareOfFloatsByEqualityOperatorIssue> (input, 2, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEquality ()\n\t\t{\n\t\t\tTest (\"==\", \"<\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInequality ()\n\t\t{\n\t\t\tTest (\"!=\", \">\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestZero ()\n\t\t{\n\t\t\tTest<CompareOfFloatsByEqualityOperatorIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = x == 0;\n\t\tbool test2 = 0.0e10 != x;\n\t\tbool test3 = 0L == y;\n\t\tbool test4 = y != 0.0000;\n\t}\n}\", 4, @\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = System.Math.Abs (x) < EPSILON;\n\t\tbool test2 = System.Math.Abs (x) > EPSILON;\n\t\tbool test3 = System.Math.Abs (y) < EPSILON;\n\t\tbool test4 = System.Math.Abs (y) > EPSILON;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNaN ()\n\t\t{\n\t\t\tTest<CompareOfFloatsByEqualityOperatorIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = x == System.Double.NaN;\n\t\tbool test2 = x != double.NaN;\n\t\tbool test3 = y == float.NaN;\n\t\tbool test4 = x != float.NaN;\n\t}\n}\", 4, @\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = double.IsNaN (x);\n\t\tbool test2 = !double.IsNaN (x);\n\t\tbool test3 = float.IsNaN (y);\n\t\tbool test4 = !double.IsNaN (x);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestPositiveInfinity ()\n\t\t{\n\n\t\t\tTest<CompareOfFloatsByEqualityOperatorIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = x == System.Double.PositiveInfinity;\n\t\tbool test2 = x != double.PositiveInfinity;\n\t\tbool test3 = y == float.PositiveInfinity;\n\t\tbool test4 = x != float.PositiveInfinity;\n\t}\n}\", 4, @\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = double.IsPositiveInfinity (x);\n\t\tbool test2 = !double.IsPositiveInfinity (x);\n\t\tbool test3 = float.IsPositiveInfinity (y);\n\t\tbool test4 = !double.IsPositiveInfinity (x);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNegativeInfinity ()\n\t\t{\n\t\t\tTest<CompareOfFloatsByEqualityOperatorIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = x == System.Double.NegativeInfinity;\n\t\tbool test2 = x != double.NegativeInfinity;\n\t\tbool test3 = y == float.NegativeInfinity;\n\t\tbool test4 = x != float.NegativeInfinity;\n\t}\n}\", 4, @\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\tbool test = double.IsNegativeInfinity (x);\n\t\tbool test2 = !double.IsNegativeInfinity (x);\n\t\tbool test3 = float.IsNegativeInfinity (y);\n\t\tbool test4 = !double.IsNegativeInfinity (x);\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<CompareOfFloatsByEqualityOperatorIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (double x, float y)\n\t{\n\t\t// ReSharper disable once CompareOfFloatsByEqualityOperator\n\t\tif (x == y)\n\t\t\tSystem.Console.WriteLine (x);\n\t}\n}\");\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConditionIsAlwaysTrueOrFalseIssueTests.cs",
    "content": "//\n// ConditionIsAlwaysTrueOrFalseIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConditionIsAlwaysTrueOrFalseIssueTests: InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestComparsionWithNull ()\n\t\t{\n\t\t\tTest<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tif (i == null) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tif (false) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestComparsionWithNullCase2 ()\n\t\t{\n\t\t\tTest<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nenum Bar { A, B }\nclass Test\n{\n\tvoid Foo(Bar i)\n\t{\n\t\tif (i != null) {\n\t\t}\n\t}\n}\n\", @\"\nenum Bar { A, B }\nclass Test\n{\n\tvoid Foo(Bar i)\n\t{\n\t\tif (true) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestComparison ()\n\t\t{\n\t\t\tTest<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tif (1 > 2) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tif (false) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnary ()\n\t\t{\n\t\t\tTest<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tif (!true) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tif (false) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\t// ReSharper disable once ConditionIsAlwaysTrueOrFalse\n\t\tif (i == null) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void CompareWithNullable ()\n\t\t{\n\t\t\tTestWrongContext<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nclass Bar\n{\n\tpublic void Test(int? a)\n\t{\n\t\tif (a != null) {\n\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedOperatorsNoReferences()\n\t\t{\n\t\t\tTestIssue<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nstruct Foo \n{\n\tpublic static bool operator ==(Foo value, Foo o)\n\t{\n\t\treturn false;\n\t}\n\n\tpublic static bool operator !=(Foo value, Foo o)\n\t{\n\t\treturn false;\n\t}\n}\n\nclass Bar\n{\n\tpublic void Test(Foo a)\n\t{\n\t\tif (a != null) {\n\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedOperators()\n\t\t{\n\t\t\tTestWrongContext<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nstruct Foo \n{\n\tpublic static bool operator ==(Foo value, object o)\n\t{\n\t\treturn false;\n\t}\n\n\tpublic static bool operator !=(Foo value, object o)\n\t{\n\t\treturn false;\n\t}\n}\n\nclass Bar\n{\n\tpublic void Test(Foo a)\n\t{\n\t\tif (a != null) {\n\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 15099 - Wrong always true context\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15099()\n\t\t{\n\t\t\tTestWrongContext<ConditionIsAlwaysTrueOrFalseIssue>(@\"\nstruct Foo \n{\n\tstring name;\n\n\tpublic Foo (string name)\n\t{\n\t\tthis.name = name;\n\t}\n\n\tpublic static bool operator ==(Foo value, Foo o)\n\t{\n\t\treturn value.name == o.name;\n\t}\n\n\tpublic static bool operator !=(Foo value, Foo o)\n\t{\n\t\treturn !(value == o);\n\t}\n\n\tpublic static implicit operator Foo (string name)\n\t{\n\t\treturn new Foo (name);\n\t}\n}\n\nclass Bar\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar foo = new Foo (null);\n\t\tSystem.Console.WriteLine (foo == null);\n\t}\n}\");\n\t\t}\n\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConditionalTernaryEqualBranchTests.cs",
    "content": "//\n// ConditionalTernaryEqualBranchTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConditionalTernaryEqualBranchTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str != null ? \"\"default\"\" : \"\"default\"\";\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConditionalTernaryEqualBranchIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\n\t\t\tCheckFix (context, issues [0], @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = \"\"default\"\";\n\t}\n}\");\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMoreComplexBranch ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tvar c = str != null ? 3 + (3 * 4) - 12 * str.Length : 3 + (3 * 4) - 12 * str.Length;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConditionalTernaryEqualBranchIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\n\t\t\tCheckFix (context, issues [0], @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tvar c = 3 + (3 * 4) - 12 * str.Length;\n\t}\n}\");\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotEqualBranches ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str != null ? \"\"default\"\" : \"\"default2\"\";\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConditionalTernaryEqualBranchIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperSuppression ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n// ReSharper disable once ConditionalTernaryEqualBranch\n\t\tstring c = str != null ? \"\"default\"\" : \"\"default\"\";\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n            var issues = GetIssues(new ConditionalTernaryEqualBranchIssue(), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\n\t\t}\n\n        [Test]\n        public void Test()\n        {\n            var input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar a = i > 0 ? 1 + 1 : 1 + 1;\n\t\tvar b = i > 1 ? 1 : 2;\n\t}\n}\";\n            var output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar a = 1 + 1;\n\t\tvar b = i > 1 ? 1 : 2;\n\t}\n}\";\n            Test<ConditionalTernaryEqualBranchIssue>(input, 1, output);\n        }\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConstantConditionIssueTests.cs",
    "content": "﻿// \n// ConstantConditionIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConstantConditionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestConditionalExpression ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = 1 > 0 ? 1 : 0;\n\t\tvar b = 1 < 0 ? 1 : 0;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = 1;\n\t\tvar b = 0;\n\t}\n}\";\n\t\t\tTest<ConstantConditionIssue> (input, 2, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIf ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i;\n\t\tif (1 > 0)\n\t\t\ti = 1;\n\t\tif (1 > 0) {\n\t\t\ti = 1;\n\t\t}\n\t\tif (1 < 0)\n\t\t\ti = 1;\n\t\tif (1 == 0) {\n\t\t\ti = 1;\n\t\t} else {\n\t\t\ti = 0;\n\t\t}\n\t\tif (1 == 0) {\n\t\t\ti = 1;\n\t\t} else\n\t\t\ti = 0;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i;\n\t\ti = 1;\n\t\ti = 1;\n\t\ti = 0;\n\t\ti = 0;\n\t}\n}\";\n\t\t\tTest<ConstantConditionIssue> (input, 5, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFor ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0; 1 > 0; i++) ;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0; true; i++)\n\t\t\t;\n\t}\n}\";\n\t\t\tTest<ConstantConditionIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhile ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\twhile (1 > 0)\n\t\t\t;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\twhile (true)\n\t\t\t;\n\t}\n}\";\n\t\t\tTest<ConstantConditionIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhile ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tdo {\n\t\t} while (1 < 0);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tdo {\n\t\t} while (false);\n\t}\n}\";\n\t\t\tTest<ConstantConditionIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int x = true)\n\t{\n\t\twhile (true) ;\n\t\tif (false) ;\n\t\tif (x) ;\n\t}\n}\";\n\t\t\tTest<ConstantConditionIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConstantNullCoalescingConditionIssueTests.cs",
    "content": "﻿// \n// RedundantNullCoalescingExpressionTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeCompletion;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConstantNullCoalescingConditionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestNullRightSide()\n\t\t{\n\t\t\tTest<ConstantNullCoalescingConditionIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = new object () ?? null;\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = new object ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullLeftSide()\n\t\t{\n\t\t\tTest<ConstantNullCoalescingConditionIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = null ?? new object ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = new object ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEqualExpressions()\n\t\t{\n\t\t\tTest<ConstantNullCoalescingConditionIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = new object () ?? new object ();\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = new object ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSmartUsage()\n\t\t{\n\t\t\t//Previously, this was a \"TestWrongContext\".\n\t\t\t//However, since smart null coallescing was introduced, this can now be\n\t\t\t//detected as redundant\n\t\t\tTest<ConstantNullCoalescingConditionIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = new object () ?? \"\"\"\";\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tobject o = new object ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSmartUsageInParam()\n\t\t{\n\t\t\tTestWrongContext<ConstantNullCoalescingConditionIssue>(@\"\nclass TestClass\n{\n\tvoid Foo(object o)\n\t{\n\t\tobject p = o ?? \"\"\"\";\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"enable again\")]\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<ConstantNullCoalescingConditionIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\t// ReSharper disable once ConstantNullCoalescingCondition\n\t\tobject o = new object () ?? null;\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertClosureToMethodGroupIssueTests.cs",
    "content": "//\n// SimplifyAnonymousMethodToDelegateIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertClosureToMethodGroupIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleVoidLambda ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction<int, int> action = $(foo, bar) => MyMethod (foo, bar);\n\t}\n\tvoid MyMethod(int foo, int bar) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction<int, int> action = MyMethod;\n\t}\n\tvoid MyMethod(int foo, int bar) {}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestSimpleBoolLambda ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tFunc<int, int, bool> action = $(foo, bar) => MyMethod (foo, bar);\n\t}\n\tbool MyMethod(int foo, int bar) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tFunc<int, int, bool> action = MyMethod;\n\t}\n\tbool MyMethod(int foo, int bar) {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaWithBody ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction<int, int> action = $(foo, bar) => { return MyMethod (foo, bar); };\n\t}\n\tvoid MyMethod(int foo, int bar) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction<int, int> action = MyMethod;\n\t}\n\tvoid MyMethod(int foo, int bar) {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Lambda_SwapParameterOrder ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction<int, int> action = $(foo, bar) => MyMethod (bar, foo);\n\t}\n\tvoid MyMethod(int foo, int bar) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleAnonymousMethod ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tint MyMethod (int x, int y) { return x * y; }\n\n\tvoid Bar (string str)\n\t{\n\t\tFunc<int, int, int> action = $delegate(int foo, int bar) { return MyMethod (foo, bar); };\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"using System;\nclass Foo\n{\n\tint MyMethod (int x, int y) { return x * y; }\n\n\tvoid Bar (string str)\n\t{\n\t\tFunc<int, int, int> action = MyMethod;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexCase ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Linq;\n\nclass Foo\n{\n\tint MyMethod (int x, int y) { return x * y; }\n\n\tvoid Bar (string str)\n\t{\n\t\tFunc<char[]> action = $() => str.Where (c => c != 'a').ToArray ();\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CallInvolvesOptionalParameter ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tint MyMethod (int x, int y = 1) { return x * y; }\n\n\tvoid Bar (string str)\n\t{\n\t\tFunc<int, int> action = $foo => MyMethod (foo);\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CallExpandsParams ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tint MyMethod (params object[] args) { return 0; }\n\n\tvoid Bar (string str)\n\t{\n\t\tFunc<string, int> action = $foo => MyMethod (foo);\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12184 - Expression can be reduced to delegate fix can create ambiguity\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug12184 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Threading.Tasks;\n\nclass C\n{\n\tpublic static C GetResponse () { return null; }\n\n\tpublic static void Foo ()\n\t{\n\t\tTask.Factory.StartNew (() => GetResponse());\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n/*\t\t\tCheckFix (context, issues, @\"using System;\nusing System.Threading.Tasks;\n\nclass C\n{\n\tpublic static C GetResponse () { return null; }\n\n\tpublic static void Foo ()\n\t{\n\t\tTask.Factory.StartNew ((Func<C>)GetResponse);\n\t}\n}\");*/\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Return_ReferenceConversion ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tFunc<int, object> action = $foo => MyMethod(foo);\n\t}\n\tstring MyMethod(int foo) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Return_BoxingConversion ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tFunc<int, object> action = $foo => MyMethod(foo);\n\t}\n\tbool MyMethod(int foo) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Parameter_ReferenceConversion ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction<string> action = $foo => MyMethod(foo);\n\t}\n\tvoid MyMethod(object foo) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Parameter_BoxingConversion ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tAction<int> action = $foo => MyMethod(foo);\n\t}\n\tvoid MyMethod(object foo) {}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertClosureToMethodGroupIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 14759 - Lambda expression can be simplified to method group issue\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14759 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertClosureToMethodGroupIssue>(@\"using System;\nusing System.Collections.Generic;\n\nclass C\n{\n\tstatic bool DoStuff (int i)\n\t{\n\t\treturn true;\n\t}\n \n\tpublic static void Main(string[] args)\n\t{\n\t\tList<int> list = new List<int> (2);\n\t\tlist.Add (1);\n\t\tlist.Add (3);\n\t\tlist.ForEach (u => DoStuff (u));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTargetCollision ()\n\t\t{\n\t\t\tTestWrongContext<ConvertClosureToMethodGroupIssue>(@\"\nusing System;\n\nclass Program\n{\n\tpublic void Foo(Action act) {}\n\tpublic void Foo(Action<int> act) {}\n\n\tvoid Test ()\n\t{\n\t\tFoo (i => Console.WriteLine (i));\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15868 - Wrong context for Anonymous method can be simplified to method group\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15868 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertClosureToMethodGroupIssue>(@\"\nusing System;\n\ndelegate bool FooBar ();\n\npublic class MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tFooBar bar = () => true;\n\t\tFunc<bool> b = () => bar ();\n\t\tConsole.WriteLine (b());\n\t}\n}\n\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestBug15868Case2 ()\n\t\t{\n\t\t\tTest<ConvertClosureToMethodGroupIssue>(@\"\nusing System;\n\ndelegate bool FooBar ();\n\npublic class MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tFooBar bar = () => true;\n\t\tFooBar b = () => bar ();\n\t\tConsole.WriteLine (b());\n\t}\n}\n\", @\"\nusing System;\n\ndelegate bool FooBar ();\n\npublic class MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tFooBar bar = () => true;\n\t\tFooBar b = bar;\n\t\tConsole.WriteLine (b());\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertConditionalTernaryToNullCoalescingIssueTests.cs",
    "content": "﻿// \n// ConvertConditionalTernaryToNullCoalescingIssueTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertConditionalTernaryToNullCoalescingIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str != null ? str : \"\"default\"\";\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertConditionalTernaryToNullCoalescingIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\n\t\t\tCheckFix (context, issues [0], @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str ?? \"\"default\"\";\n\t}\n}\");\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = null != str ? str : \"\"default\"\";\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertConditionalTernaryToNullCoalescingIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\t\n\t\t\tCheckFix (context, issues [0], @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str ?? \"\"default\"\";\n\t}\n}\");\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase3 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = null == str ? \"\"default\"\" : str;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertConditionalTernaryToNullCoalescingIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\t\n\t\t\tCheckFix (context, issues [0], @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str ?? \"\"default\"\";\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase4 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str == null ? \"\"default\"\" : str;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ConvertConditionalTernaryToNullCoalescingIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\t\n\t\t\tCheckFix (context, issues [0], @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring c = str ?? \"\"default\"\";\n\t}\n}\");\n\t\t}\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n// ReSharper disable once ConvertConditionalTernaryToNullCoalescing\n\t\tstring c = str != null ? str : \"\"default\"\";\n\t}\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ConvertConditionalTernaryToNullCoalescingIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n\t\n\t\t[Test]\n\t\tpublic void TestCastCase ()\n\t\t{\n\t\t\tTest<ConvertConditionalTernaryToNullCoalescingIssue>(@\"class Foo\n{\n\tvoid Bar (Foo o, Bar b)\n\t{\n\t\tIDisposable c = o != null ? (IDisposable)o : b;\n\t}\n}\", @\"class Foo\n{\n\tvoid Bar (Foo o, Bar b)\n\t{\n\t\tIDisposable c = (IDisposable)o ?? b;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCastCase2 ()\n\t\t{\n\t\t\tTest<ConvertConditionalTernaryToNullCoalescingIssue>(@\"class Foo\n{\n\tvoid Bar (Foo o, Bar b)\n\t{\n\t\tIDisposable c = o == null ? (IDisposable)b : o;\n\t}\n}\", @\"class Foo\n{\n\tvoid Bar (Foo o, Bar b)\n\t{\n\t\tIDisposable c = (IDisposable)o ?? b;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertIfDoToWhileIssueTests.cs",
    "content": "//\n// ConvertIfDoToWhileIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertIfDoToWhileIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<ConvertIfDoToWhileIssue>(@\"class FooBar\n{\n\tpublic void FooFoo (int x)\n\t{\n\t\tif (x < 10) {\n\t\t\tdo {\n\t\t\t\tConsole.WriteLine (x++);\n\t\t\t} while (x < 10);\n\t\t}\n\t}\n}\", @\"class FooBar\n{\n\tpublic void FooFoo (int x)\n\t{\n\t\twhile (x < 10) {\n\t\t\tConsole.WriteLine (x++);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithoutBlocks ()\n\t\t{\n\t\t\tTest<ConvertIfDoToWhileIssue>(@\"class FooBar\n{\n\tpublic void FooFoo (int x)\n\t{\n\t\tif (x < 10)\n\t\t\tdo \n\t\t\t\tConsole.WriteLine (x++);\n\t\t\twhile (x < 10);\n\t}\n}\", @\"class FooBar\n{\n\tpublic void FooFoo (int x)\n\t{\n\t\twhile (x < 10)\n\t\t\tConsole.WriteLine (x++);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfDoToWhileIssue>(@\"class FooBar\n{\n\tpublic void FooFoo (int x)\n\t{\n\t\tif (x < 10) {\n\t\t\tdo {\n\t\t\t\tConsole.WriteLine (x++);\n\t\t\t} while (x < 11);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfDoToWhileIssue>(@\"class FooBar\n{\n\tpublic void FooFoo (int x)\n\t{\n\t\t// ReSharper disable once ConvertIfDoToWhile\n\t\tif (x < 10) {\n\t\t\tdo {\n\t\t\t\tConsole.WriteLine (x++);\n\t\t\t} while (x < 10);\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertIfStatementToConditionalTernaryExpressionIssueTests.cs",
    "content": "//\n// ConvertIfStatementToConditionalTernaryExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertIfStatementToConditionalTernaryExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestIfElse ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tint result;\n\t\tif (x > 10)\n\t\t\tresult = 10;\n\t\telse\n\t\t\tresult = 20;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexCondition ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tint result;\n\t\tif (x > 10 ||\n\t\t    x < -10)\n\t\t\tresult = 10;\n\t\telse\n\t\t\tresult = 20;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipIfElseIf ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tint result;\n\t\tif (x < 10)\n\t\t\tresult = -10;\n\t\telse if (x > 10)\n\t\t\tresult = 10;\n\t\telse\n\t\t\tresult = 20;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexTrueExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tint result;\n\t\tif (x > 10)\n\t\t\tresult = 10 +\n\t\t\t\t\t 12;\n\t\telse\n\t\t\tresult = 20;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexFalseExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tint result;\n\t\tif (x > 10)\n\t\t\tresult = 10;\n\t\telse\n\t\t\tresult = 20 +\n\n12;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tint result;\n\t\t// ReSharper disable once ConvertIfStatementToConditionalTernaryExpression\n\t\tif (x > 10)\n\t\t\tresult = 10;\n\t\telse\n\t\t\tresult = 20;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipAnnoyingCase1 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tint Bar(string example)\n\t{\n\t\tif (!string.IsNullOrEmpty (example)) {\n\t\t\ttext = Environment.NewLine != \"\"\\n\"\" ? example.Replace (\"\"\\n\"\", Environment.NewLine) : example;\n\t\t} else {\n\t\t\ttext = \"\"\"\";\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertIfStatementToNullCoalescingExpressionIssueTests.cs",
    "content": "//\n// ConvertIfStatementToNullCoalescingExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertIfStatementToNullCoalescingExpressionIssueTests: InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToNullCoalescingExpressionIssue>(@\"class Foo\n{\n\tint Bar(object o)\n\t{\n\t\tvar ob = o;\n\t\tif (ob == null)\n\t\t\tob = this;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToNullCoalescingExpressionIssue>(@\"class Foo\n{\n\tint Bar(object o)\n\t{\n\t\tvar ob = o;\n\t\tif (ob == null)\n\t\t\tob = this +\n12;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexAssignment ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToNullCoalescingExpressionIssue>(@\"class Foo\n{\n\tint Bar(object o)\n\t{\n\t\tvar ob = o  +\n\n12;\n\t\tif (ob == null)\n\t\t\tob = this;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToNullCoalescingExpressionIssue>(@\"class Foo\n{\n\tint Bar(object o)\n\t{\n\t\t// ReSharper disable once ConvertIfStatementToNullCoalescingExpression\n\t\tvar ob = o;\n\t\tif (ob == null)\n\t\t\tob = this;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertIfStatementToSwitchStatementIssueTests.cs",
    "content": "//\n// ConvertIfStatementToSwitchStatementIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertIfStatementToSwitchStatementIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBreak ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a == 0) {\n\t\t\tint b = 1;\n\t\t\treturn b + 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\treturn 2;\n\t\t} else if (a == 13) {\n\t\t\treturn 12;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConstantExpression ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tint TestMethod (int? a)\n\t{\n\t\tif (a == (1 == 1 ? 11 : 12)) {\n\t\t\treturn 1;\n\t\t} else if (a == (2 * 3) + 1 || a == 6 / 2) {\n\t\t\treturn 2;\n\t\t} else if (a == null || a == (int)(10L + 2) || a == default(int) || a == sizeof(int)) {\n\t\t\treturn 3;\t\t\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\n\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tconst int b = 0;\n\tint TestMethod (int a)\n\t{\n\t\tconst int c = 1;\n\t\t$if (a == b) {\n\t\t\treturn 1;\n\t\t} else if (a == b + c) {\n\t\t\treturn 0;\n\t\t} else if (a ==  c) {\n\t\t\treturn 2;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNestedOr ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tint TestMethod (int a)\n\t{\n\t\t$if (a == 0) {\n\t\t\treturn 1;\n\t\t} else if ((a == 2 || a == 4) || (a == 3 || a == 5)) {\n\t\t\treturn 2;\n\t\t} else if (a == 12) {\n\t\t\treturn 23;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexSwitchExpression ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tint TestMethod (int a, int b)\n\t{\n\t\t$if (a + b == 0) {\n\t\t\treturn 1;\n\t\t} else if (1 == a + b) {\n\t\t\treturn 0;\n\t\t} else if (2 == a + b) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonConstantExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int c)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == c) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int c)\n\t{\n\t\tint b;\n\t\t$if (a == c) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int c)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == c) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNonEqualityComparison ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a > 4) {\n\t\t\tb = 1;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidType ()\n\t\t{\n\t\t\t// enum\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nenum TestEnum\n{\n\tFirst,\n\tSecond,\n\tThird\n}\nclass TestClass\n{\n\tint TestMethod (TestEnum a)\n\t{\n\t\t$if (a == TestEnum.First) {\n\t\t\treturn 1;\n\t\t} else if (a == TestEnum.Second) {\n\t\t\treturn -1;\n\t\t} else if (a == TestEnum.Third) {\n\t\t\treturn 3;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\");\n\n\t\t\t// string, bool, char, integral, nullable\n\t\t\tTestValidType (\"string\", \"\\\"test\\\"\");\n\t\t\tTestValidType (\"bool\", \"true\");\n\t\t\tTestValidType (\"char\", \"'a'\");\n\t\t\tTestValidType (\"byte\", \"0\");\n\t\t\tTestValidType (\"sbyte\", \"0\");\n\t\t\tTestValidType (\"short\", \"0\");\n\t\t\tTestValidType (\"long\", \"0\");\n\t\t\tTestValidType (\"ushort\", \"0\");\n\t\t\tTestValidType (\"uint\", \"0\");\n\t\t\tTestValidType (\"ulong\", \"0\");\n\t\t\tTestValidType (\"bool?\", \"null\");\n\t\t}\n\n\t\tvoid TestValidType (string type, string caseValue)\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tint TestMethod (\" + type + @\" a)\n\t{\n\t\t$if (a == \" + caseValue + @\") {\n\t\t\treturn 1;\n\t\t} else if (a == default(\"  + type +  @\")) {\n\t\t\treturn -1;\n\t\t} else if (a == null) {\n\t\t\treturn -1;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidType ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (double a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoElse()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else if (a == 2) {\n\t\t\tb = 1;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestNestedIf ()\n\t\t{\n\t\t\tTestIssue<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tif (b == 0)\n\t\t\t\treturn;\n\t\t} else if (a == 2 || a == 3) {\n\t\t\tb = 2;\n\t\t} else if (a == 12) {\n\t\t\tb = 3;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestτooSimpleCase1()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestτooSimpleCase2()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToSwitchStatementIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{\n\t\tint b;\n\t\t$if (a == 0) {\n\t\t\tb = 0;\n\t\t} else if (a == 1) {\n\t\t\tb = 1;\n\t\t} else {\n\t\t\tb = 1;\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertIfToAndExpressionIssueTests.cs",
    "content": "//\n// ConvertIfToAndExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertIfToAndExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVariableDeclarationCase ()\n\t\t{\n\t\t\tTest<ConvertIfToAndExpressionIssue>(@\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10;\n\t\tif (o < 10)\n\t\t\tb = false;\n\t}\n}\", @\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10 && o >= 10;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexVariableDeclarationCase ()\n\t\t{\n\t\t\tTest<ConvertIfToAndExpressionIssue>(@\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10 || o < 10;\n\t\tif (o < 10)\n\t\t\tb = false;\n\t}\n}\", @\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = (o > 10 || o < 10) && o >= 10;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConversionBug ()\n\t\t{\n\t\t\tTest<ConvertIfToAndExpressionIssue>(@\"class Foo\n{\n\tpublic override void VisitComposedType (ComposedType composedType)\n\t{\n\t\tif (composedType.PointerRank > 0)\n\t\t\tunsafeStateStack.Peek ().UseUnsafeConstructs = false;\n\t}\n}\", @\"class Foo\n{\n\tpublic override void VisitComposedType (ComposedType composedType)\n\t{\n\t\tunsafeStateStack.Peek ().UseUnsafeConstructs &= composedType.PointerRank <= 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCommonCase ()\n\t\t{\n\t\t\tTest<ConvertIfToAndExpressionIssue>(@\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10;\n\t\tConsole.WriteLine ();\n\t\tif (o < 10)\n\t\t\tb = false;\n\t}\n}\", @\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10;\n\t\tConsole.WriteLine ();\n\t\tb &= o >= 10;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertIfToOrExpressionIssueTests.cs",
    "content": "//\n// ConvertIfToOrExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertIfToOrExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVariableDeclarationCase ()\n\t\t{\n\t\t\tTest<ConvertIfToOrExpressionIssue>(@\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10;\n\t\tif (o < 10)\n\t\t\tb = true;\n\t}\n}\", @\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10 || o < 10;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCommonCase ()\n\t\t{\n\t\t\tTest<ConvertIfToOrExpressionIssue>(@\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10;\n\t\tConsole.WriteLine ();\n\t\tif (o < 10)\n\t\t\tb = true;\n\t}\n}\", @\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10;\n\t\tConsole.WriteLine ();\n\t\tb |= o < 10;\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestConversionBug ()\n\t\t{\n\t\t\tTest<ConvertIfToOrExpressionIssue>(@\"class Foo\n{\n\tpublic override void VisitComposedType (ComposedType composedType)\n\t{\n\t\tif (composedType.PointerRank > 0)\n\t\t\tunsafeStateStack.Peek ().UseUnsafeConstructs = true;\n\t}\n}\", @\"class Foo\n{\n\tpublic override void VisitComposedType (ComposedType composedType)\n\t{\n\t\tunsafeStateStack.Peek ().UseUnsafeConstructs |= composedType.PointerRank > 0;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfToOrExpressionIssue>(@\"class Foo\n{\n\tint Bar(int o)\n\t{\n\t\tbool b = o > 10;\n\t\t// ReSharper disable once ConvertIfToOrExpression\n\t\tif (o < 10)\n\t\t\tb = true;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCheckBug ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfToOrExpressionIssue>(@\"class Foo\n{\n\tpublic bool Enabled { get; set; }\n\n\tint Bar(Foo fileChangeWatcher)\n\t{\n\t\tif (fileChangeWatcher != null)\n\t\t\tfileChangeWatcher.Enabled = true;\n\t}\n}\");\n\t\t}\n\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertNullableToShortFormIssueTests.cs",
    "content": "//\n// ConvertNullableToShortFormIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertNullableToShortFormIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<ConvertNullableToShortFormIssue>(@\"using System;\n\nclass Foo\n{\n\tNullable<int> Bar ()\n\t{\n\t\treturn 5;\n\t}\n}\", @\"using System;\n\nclass Foo\n{\n\tint? Bar ()\n\t{\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFullyQualifiedNameCase ()\n\t\t{\n\t\t\tTest<ConvertNullableToShortFormIssue>(@\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tSystem.Nullable<int> a;\n\t}\n}\", @\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tint? a;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAlreadyShort ()\n\t\t{\n\t\t\tTestWrongContext<ConvertNullableToShortFormIssue>(@\"class Foo\n{\n\tint? Bar (int o)\n\t{\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid ()\n\t\t{\n\t\t\tTestWrongContext<ConvertNullableToShortFormIssue>(@\"using System;\nnamespace NN {\n\tclass Nullable<T> {}\n\tclass Foo\n\t{\n\t\tvoid Bar ()\n\t\t{\n\t\t\tNullable<int> a;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidTypeOf ()\n\t\t{\n\t\t\tTestWrongContext<ConvertNullableToShortFormIssue>(@\"using System;\nclass Foo\n{\n\tbool Bar (object o)\n\t{\n\t\treturn o.GetType() == typeof (Nullable<>);\n\t}\n\tbool Bar2 (object o)\n\t{\n\t\treturn o.GetType() == typeof (System.Nullable<>);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertNullableToShortFormIssue>(@\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\t// ReSharper disable once ConvertNullableToShortForm\n\t\tSystem.Nullable<int> a;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertTailRecursiveCallToLoopIssueTests.cs",
    "content": "//\n// ConvertTailRecursiveCallToLoopIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[Ignore]\n\t[TestFixture]\n\tpublic class ConvertTailRecursiveCallToLoopIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<ConvertTailRecursiveCallToLoopIssue>(@\"\npublic class FooBar\n{\n\tpublic static void Foo(int i)\n\t{\n\t\tif (i == 0)\n\t\t\treturn;\n\t\tFoo(i - 1);\n\t}\n}\n\", @\"\npublic class FooBar\n{\n\tpublic static void Foo(int i)\n\t{\n\t\twhile (true) {\n\t\t\tif (i == 0)\n\t\t\t\treturn;\n\t\t\ti = i - 1;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionCase ()\n\t\t{\n\t\t\tTest<ConvertTailRecursiveCallToLoopIssue>(@\"\npublic class FooBar\n{\n\tpublic static void Foo(int i)\n\t{\n\t\tConsole.WriteLine(i);\n\t\tif (i > 0)\n\t\t\tFoo(i - 1);\n\t}\n}\n\", @\"\npublic class FooBar\n{\n\tpublic static void Foo(int i)\n\t{\n\t\twhile (true) {\n\t\t\tConsole.WriteLine(i);\n\t\t\tif (i > 0) {\n\t\t\t\ti = i - 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertToAutoPropertyIssueTests.cs",
    "content": "//\n// ConvertToAutoPropertyIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertToAutoPropertyIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTestIssue<ConvertToAutoPropertyIssue>(@\"\nclass FooBar\n{\n\tint foo;\n\tpublic int Foo {\n\t\tget { return foo; }\n\t\tset { foo = value; }\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestThisSyntaxCase ()\n\t\t{\n\t\t\tTestIssue<ConvertToAutoPropertyIssue>(@\"\nclass FooBar\n{\n\tint foo;\n\tpublic int Foo {\n\t\tget { return this.foo; }\n\t\tset { this.foo = value; }\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToAutoPropertyIssue>(@\"\nclass FooBar\n{\n\tint foo;\n\n\t// ReSharper disable once ConvertToAutoProperty\n\tpublic int Foo {\n\t\tget { return foo; }\n\t\tset { foo = value; }\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestArrayBug ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToAutoPropertyIssue>(@\"\nclass Bar {\n\tpublic int foo;\n}\nclass FooBar\n{\n\tBar bar;\n\n\tpublic int Foo {\n\t\tget { return bar.foo; }\n\t\tset { bar.foo = value; }\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 16108 - Convert to autoproperty issues\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16108Case1 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToAutoPropertyIssue>(@\"\nclass MyClass\n{\n    [DebuggerHiddenAttribute]\n    int a;\n    int A {\n        get { return a; }\n        set { a = value; }\n    }\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 16108 - Convert to autoproperty issues\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16108Case2 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToAutoPropertyIssue>(@\"\nclass MyClass\n{\n    int a = 4;\n    int A {\n        get { return a; }\n        set { a = value; }\n    }\n}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 16448 - Refactor incorrectly suggesting \"Convert to Auto Property\" on property containing custom logic\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16448()\n\t\t{\n\t\t\tTestWrongContext<ConvertToAutoPropertyIssue>(@\"\nusing System;\n\npublic class Foo\n{\n\tint _bpm;\n\n\tpublic int BPM\n\t{\n\t\tget { return _bpm; }\n\t\tset\n\t\t{\n\t\t\t_bpm = Math.Min(Math.Max(60, value), 180);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 17107 - Source Analysis ignores volatile keyword\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17107()\n\t\t{\n\t\t\tTestWrongContext<ConvertToAutoPropertyIssue>(@\"\nusing System;\n\npublic class Foo\n{\n\tvolatile Boolean willUpdate;\n\n\tBoolean WillUpdate {\n\t\tget { return willUpdate; }\n\t\tset { willUpdate = value; }\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertToConstantIssueTests.cs",
    "content": "//\n// ConvertToConstantIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertToConstantIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint fooBar = 12;\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tconst int fooBar = 12;\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestWrongLocalType ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tobject fooBar = 12;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChangingVariableCase1 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint fooBar = 12;\n\t\tConsole.WriteLine (fooBar++);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestChangingVariableCase2 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint fooBar = 12;\n\t\tSomething (out fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChangingVariableCase3 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint fooBar = 12;\n\t\tif (args.Length == 10)\n\t\t\tfooBar = 20;\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChangingVariableCase4 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint fooBar = 12;\n\t\tswitch (args[0]) {\n\t\t\tcase \"\"Hello\"\":\n\t\t\t\tfooBar = 20;\n\t\t\t\tbreak;\n\t\t}\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestChangingVariableCase5 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint fooBar = 12;\n\t\tfooBar += 1;\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestChangingVariableCase6 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tint fooBar = 12;\n\t\tTestMe (ref fooBar);\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t// ReSharper disable once ConvertToConstant.Local\n\t\tint fooBar = 12;\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tTest<ConvertToConstantIssue>(@\"class Test\n{\n\tint fooBar = 12;\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\tconst int fooBar = 12;\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReadonlyField ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\treadonly int fooBar = 12;\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestStaticField ()\n\t\t{\n\t\t\tTest<ConvertToConstantIssue>(@\"class Test\n{\n\tstatic int fooBar = 12;\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\tconst int fooBar = 12;\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestChangingField ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic Test ()\n\t{\n\t\tfooBar = 2323;\n\t}\n\tint fooBar = 12;\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestWrongFieldType ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tobject fooBar = 12;\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChangingFieldCase2 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tint fooBar = 12;\n\tpublic Test ()\n\t{\n\t\tthis.fooBar = 12;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChangingFieldCase3 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tint fooBar = 12;\n\tpublic Test ()\n\t{\n\t\t++this.fooBar;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestShadowedField ()\n\t\t{\n\t\t\tTest<ConvertToConstantIssue>(@\"class Test\n{\n\tint fooBar = 12;\n\n\tpublic Test (int fooBar)\n\t{\n\t\tfooBar = 2323;\n\t}\n\n\tpublic void Bar ()\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\tconst int fooBar = 12;\n\n\tpublic Test (int fooBar)\n\t{\n\t\tfooBar = 2323;\n\t}\n\n\tpublic void Bar ()\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestShadowedFieldCase2 ()\n\t\t{\n\t\t\tTest<ConvertToConstantIssue>(@\"class Test\n{\n\tint fooBar = 12;\n\n\tpublic Test ()\n\t{\n\t\tint fooBar;\n\t\tfooBar = 2323;\n\t}\n\n\tpublic void Bar ()\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\tconst int fooBar = 12;\n\n\tpublic Test ()\n\t{\n\t\tint fooBar;\n\t\tfooBar = 2323;\n\t}\n\n\tpublic void Bar ()\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNeverSuggestForControlVariable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tfor (int i = 0; i < 10;) {\n\t\t\tConsole.WriteLine(i);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestVarCase ()\n\t\t{\n\t\t\tTest<ConvertToConstantIssue>(@\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar fooBar = 12;\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tconst int fooBar = 12;\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestArbitraryStructCase ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"\nstruct Bar {\n\tpublic int A;\n}\n\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar fooBar = default(Bar);\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArbitraryStructCase2 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToConstantIssue>(@\"\nstruct Bar {\n\tpublic int A;\n}\n\nclass Test\n{\n\tconst Bar foo = new Bar();\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar fooBar = foo;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestComplexCase ()\n\t\t{\n\t\t\tTest<ConvertToConstantIssue>(@\"\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tvar pi2 = System.Math.PI * 2;\n\t\tConsole.WriteLine (pi2);\n\t}\n}\", @\"\nclass Test\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tconst double pi2 = System.Math.PI * 2;\n\t\tConsole.WriteLine (pi2);\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertToLambdaExpressionIssueTests.cs",
    "content": "//\n// ConvertToLambdaExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertToLambdaExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tTest<ConvertToLambdaExpressionIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = i => {\n\t\t\treturn i + 1;\n\t\t};\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = i => i + 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExpressionStatement ()\n\t\t{\n\t\t\tTest<ConvertToLambdaExpressionIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> f = i => {\n\t\t\tSystem.Console.Write (i);\n\t\t};\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> f = i => System.Console.Write (i);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToLambdaExpressionIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t// ReSharper disable once ConvertToLambdaExpression\n\t\tSystem.Func<int, int> f = i => {\n\t\t\treturn i + 1;\n\t\t};\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAssignmentExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToLambdaExpressionIssue>(@\"\nusing System;\npublic class Test\n{\n\tvoid Foo ()\n\t{\n\t\tint i;\n\t\tAction<int> foo = x => {\n\t\t\ti = x + x;\n\t\t};\n\t\tfoo(5);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 14840 - Incorrect \"can be converted to expression\" suggestion\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14840 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToLambdaExpressionIssue>(@\"using System;\nusing System.Collections.Generic;\n\nclass C\n{\n\tvoid Foo (Action<int> a) {}\n\tvoid Foo (Func<int,int> a) {}\n\n\tvoid Test ()\n\t{\n\t\tint t = 0;\n\t\tFoo (c => { t = c; });\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethod ()\n\t\t{\n\t\t\tTest<ConvertToLambdaExpressionIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action a = delegate () {\n\t\t\tSystem.Console.WriteLine ();\n\t\t};\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action a = () => System.Console.WriteLine ();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAnonymousFunction ()\n\t\t{\n\t\t\tTest<ConvertToLambdaExpressionIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = delegate (int i) {\n\t\t\treturn i + 1;\n\t\t};\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = (int i) => i + 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodWithoutParameterList ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToLambdaExpressionIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Func<int, int> f = delegate {\n\t\t\treturn 123;\n\t\t};\n\t}\n}\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 22106 - Applying suggested fix causes error\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug22106 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertToLambdaExpressionIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\talert.SetPositiveButton(\"\"OK\"\", (sender, e) =>\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t});\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ConvertToStaticTypeTests.cs",
    "content": "// \n// ConvertToStaticTypeTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ConvertToStaticTypeTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\nnamespace Demo\n{\n\tpublic sealed class TestClass\n\t{\n\t\tstatic public int A;\n\t\tstatic public int ReturnAPlusOne()\n\t\t{\n\t\t\treturn A + 1;\n\t\t}\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ConvertToStaticTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\nnamespace Demo\n{\n\tpublic sealed class TestClass\n\t{\n\t\tpublic int B;\n\t\tstatic public int A;\n\t\tstatic public int ReturnAPlusOne()\n\t\t{\n\t\t\treturn A + 1;\n\t\t}\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ConvertToStaticTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\nnamespace Demo\n{\n\tpublic static class TestClass\n\t{\n\t\tstatic public int A;\n\t\tstatic public int ReturnAPlusOne()\n\t\t{\n\t\t\treturn A + 1;\n\t\t}\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ConvertToStaticTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase4()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\nnamespace Demo\n{\n\tpublic class TestClass\n\t{\n\t\tTestClass(){}\n\t\tstatic public int A;\n\t\tstatic public int ReturnAPlusOne()\n\t\t{\n\t\t\treturn A + 1;\n\t\t}\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ConvertToStaticTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestEntryPoint()\n\t\t{\n\t\t\tTestWrongContext<ConvertToStaticTypeIssue>(@\"\nusing System;\n\nnamespace Demo\n{\n\tpublic sealed class TestClass\n\t{\n\t\tstatic public int A;\n\t\tpublic static int Main()\n\t\t{\n\t\t\treturn A + 1;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAbstract()\n\t\t{\n\t\t\tTestWrongContext<ConvertToStaticTypeIssue>(@\"\nusing System;\n\nnamespace Demo\n{\n\tpublic abstract class TestClass\n\t{\n\t\tpublic static int Main()\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestResharperDisable()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nnamespace Demo\n{\n//Resharper disable ConvertToStaticType\n\tpublic class TestClass\n\t{\n\t\tTestClass(){}\n\t\tstatic public int A;\n\t\tstatic public int ReturnAPlusOne()\n\t\t{\n\t\t\treturn A + 1;\n\t\t}\n\t}\n//Resharper restore ConcertToStaticType\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ConvertToStaticTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 16844 - Convert class to static \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16844 ()\n\t\t{\n\t\t\tTestIssue<ConvertToStaticTypeIssue>(@\"\nclass ShouldBeStatic\n{\n    static void Func ()\n    {\n    }\n\n    class OtherNotStatic\n    {\n    }\n}\n\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DelegateSubtractionIssueTests.cs",
    "content": "//\n// DelegateSubtractionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class DelegateSubtractionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSubtraction()\n\t\t{\n\t\t\tTestIssue<DelegateSubtractionIssue>(@\"\nusing System;\nclass Foo\n{\n\tvoid Bar (Action a, Action b)\n\t{\n\t\t(a - b) ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentSubtraction()\n\t\t{\n\t\t\tTestIssue<DelegateSubtractionIssue>(@\"\nusing System;\nclass Foo\n{\n\tvoid Bar (Action a, Action b)\n\t{\n\t\ta -= b;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<DelegateSubtractionIssue>(@\"\nusing System;\nclass Foo\n{\n\tvoid Bar (Action a, Action b)\n\t{\n\t\t// ReSharper disable once DelegateSubtraction\n\t\t(a - b) ();\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 18061 - Incorrect \"delegate subtraction has unpredictable result\" warning\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug18061()\n\t\t{\n\t\t\tTestWrongContext<DelegateSubtractionIssue>(@\"\nusing System;\nclass Test\n{\n\tpublic event EventHandler Foo;\n\n\tvoid Bar (EventHandler bar)\n\t{\n\t\tFoo -= bar;\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DisposeMethodInNonIDisposableTypeTests.cs",
    "content": "// \n// DisposeMethodInNonIDisposableTypeTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis <luiscubal@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\tpublic class DisposeMethodInNonIDisposableTypeTests : InspectionActionTestBase\n\t{\n\t\tvoid Test (string input, int issueCount)\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new DisposeMethodInNonIDisposableTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t}\n\n\t\tvoid TestNoFix (string input, int issueCount)\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new DisposeMethodInNonIDisposableTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t\tCheckFix (context, issues, input);\n\t\t}\n\n\t\tvoid TestFix (string input, int issueCount, string output)\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new DisposeMethodInNonIDisposableTypeIssue (), input, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t\tCheckFix (context, issues, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoreNonDisposeMethodsTest()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t}\n}\n\";\n\n\t\t\tTest(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoreProperImplementationMethodsTest()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass : System.IDisposable\n{\n\tpublic void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tTest(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceDispose()\n\t\t{\n\t\t\tstring input = @\"\ninterface Foo\n{\n\tvoid Dispose ();\n}\nclass TestClass : Foo\n{\n\tvoid Foo.Dispose ()\n\t{\n\t}\n}\n\";\n\t\t\tTest<DisposeMethodInNonIDisposableTypeIssue>(input, 1, @\"\ninterface Foo : System.IDisposable\n{\n}\nclass TestClass : Foo\n{\n\tvoid System.IDisposable.Dispose ()\n\t{\n\t}\n}\n\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleInterfacesDispose()\n\t\t{\n\t\t\tstring input = @\"\nusing System;\ninterface Foo\n{\n\tvoid Dispose ();\n}\ninterface Bar\n{\n\tvoid Dispose ();\n}\nclass TestClass : Foo, Bar\n{\n\tvoid Foo.Dispose ()\n\t{\n\t}\n\tvoid Bar.Dispose ()\n\t{\n\t}\n}\n\";\n\t\t\tTest<DisposeMethodInNonIDisposableTypeIssue>(input, 2, @\"\nusing System;\ninterface Foo : IDisposable\n{\n}\ninterface Bar\n{\n\tvoid Dispose ();\n}\nclass TestClass : Foo, Bar\n{\n\tvoid IDisposable.Dispose ()\n\t{\n\t}\n\tvoid Bar.Dispose ()\n\t{\n\t}\n}\n\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestShortenedInterfaceDispose()\n\t\t{\n\t\t\tstring input = @\"\nusing System;\ninterface Foo\n{\n\tvoid Dispose ();\n}\nclass TestClass : Foo\n{\n\tvoid Foo.Dispose ()\n\t{\n\t}\n}\n\";\n\t\t\tTest<DisposeMethodInNonIDisposableTypeIssue>(input, 1, @\"\nusing System;\ninterface Foo : IDisposable\n{\n}\nclass TestClass : Foo\n{\n\tvoid IDisposable.Dispose ()\n\t{\n\t}\n}\n\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoreIndirectImplementationTest()\n\t\t{\n\t\t\tstring input = @\"\ninterface Bar : System.IDisposable {}\nclass TestClass : Bar\n{\n\tpublic void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tTest(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DisposeWithoutIDisposableTest()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tpublic void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nclass TestClass : System.IDisposable\n{\n\tpublic void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tTestFix(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DisposeWithUsingTest()\n\t\t{\n\t\t\tstring input = @\"\nusing System;\nclass TestClass\n{\n\tpublic void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System;\nclass TestClass : IDisposable\n{\n\tpublic void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tTestFix(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NonPublicDisposeTest()\n\t\t{\n\t\t\tstring input = @\"\nusing System;\nclass TestClass\n{\n\tprotected void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tstring output = @\"\nusing System;\nclass TestClass : IDisposable\n{\n\tpublic void Dispose ()\n\t{\n\t}\n}\n\";\n\n\t\t\tTestFix(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DisabledForStaticTest()\n\t\t{\n\t\t\tstring input = @\"\nclass TestType\n{\n\tpublic static void Dispose() {}\n}\n\";\n\n\t\t\tTest(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DisabledForArgumentsTest()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tpublic void Dispose (object arg)\n\t{\n\t}\n}\n\";\n\n\t\t\tTest(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DisabledForNonVoidTest()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tpublic int Dispose ()\n\t{\n\t\treturn 0;\n\t}\n}\n\";\n\n\t\t\tTest(input, 0);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DoNotCallOverridableMethodsInConstructorIssueTests.cs",
    "content": "//\n// DoNotCallOverridableMethodsInConstructorIssueTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class DoNotCallOverridableMethodsInConstructorIssueTests : InspectionActionTestBase\n\t{ \n\n\t\t[Test]\n\t\tpublic void CatchesBadCase()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tFoo()\n\t{\n\t\tBar();\n\t\tBar();\n\t}\n\n\tvirtual void Bar ()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n            var issues = GetIssues(new DoNotCallOverridableMethodsInConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n            var input = @\"class Foo\n{\n\tFoo()\n\t{\n// ReSharper disable once DoNotCallOverridableMethodsInConstructor\n\t\tBar();\n\t}\n\n\tvirtual void Bar ()\n\t{\n\t}\n}\";\n            TestWrongContext<DoNotCallOverridableMethodsInConstructorIssue>(input);\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void IgnoresGoodCase()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tFoo()\n\t{\n\t\tBar();\n\t\tBar();\n\t}\n\n\tvoid Bar ()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new DoNotCallOverridableMethodsInConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresSealedClasses()\n\t\t{\n\t\t\tvar input = @\"sealed class Foo\n{\n\tFoo()\n\t{\n\t\tBar();\n\t\tBar();\n\t}\n\n\tvirtual void Bar ()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new DoNotCallOverridableMethodsInConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresNonLocalCalls()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tFoo()\n\t{\n\t\tFoo f = new Foo();\n\t\tf.Bar();\n\t}\n\n\tvirtual void Bar ()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new DoNotCallOverridableMethodsInConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresEventHandlers()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tFoo()\n\t{\n\t\tSomeEvent += delegate { Bar(); };\n\t}\n\n\tvirtual void Bar ()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new DoNotCallOverridableMethodsInConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 14450 - False positive of \"Virtual member call in constructor\"\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14450()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Test {\n    public Test(Action action) {\n        action();\n    }\n}\n\";\t\t\n\t\t\tTestWrongContext<DoNotCallOverridableMethodsInConstructorIssue>(input);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SetVirtualProperty()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tFoo()\n\t{\n\t\tthis.AutoProperty = 1;\n\t}\n\n\tpublic virtual int AutoProperty { get; set; }\n}\";\n\t\t\tTestRefactoringContext context;\n            var issues = GetIssues(new DoNotCallOverridableMethodsInConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DontUseLinqWhenItsVerboseAndInefficientTests.cs",
    "content": "﻿// \n// DontUseLinqWhenItsVerboseAndInefficientTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class DontUseLinqWhenItsVerboseAndInefficientTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestStringLength()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tstring x = \"\"Hello\"\";\n\t\treturn x.Count ();\n\t}\n}\", @\"\nusing System.Linq;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tstring x = \"\"Hello\"\";\n\t\treturn x.Length;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArrayCount()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tint[] x = { 1, 2, 3 };\n\t\treturn x.Count ();\n\t}\n}\", @\"\nusing System.Linq;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tint[] x = { 1, 2, 3 };\n\t\treturn x.Length;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticMethod()\n\t\t{\n\t\t\tTestWrongContext<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tint[] x = { 1, 2, 3 };\n\t\treturn Enumerable.Count<int> (x);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestListCount()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\treturn x.Count ();\n\t}\n}\", @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\treturn x.Count;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestListFirst()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\treturn x.First ();\n\t}\n}\", @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\treturn x [0];\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestListElementAt()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\treturn x.ElementAt (1);\n\t}\n}\", @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\treturn x [1];\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestListLast()\n\t\t{\n\t\t\tTestWrongContext<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\treturn x.Last ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestListSkippedReversedLast()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tint[] x = new int [10];\n\t\treturn x.Skip (5).Reverse ().Last ();\n\t}\n}\", @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tint[] x = new int [10];\n\t\treturn x [5];\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestListSkippedLast()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tint[] x = new int [10];\n\t\treturn x.Skip (5).Reverse ().Skip (5).Reverse ().Last ();\n\t}\n}\", @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tint[] x = new int [10];\n\t\treturn x [x.Length - 1 - (5)];\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestListSkip()\n\t\t{\n\t\t\tTest<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\tint y = 5;\n\t\treturn x.Skip (y).First ();\n\t}\n}\", @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tIList<int> x = new List<int> ();\n\t\tint y = 5;\n\t\treturn x [y];\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForNoCount()\n\t\t{\n\t\t\tTestWrongContext<DontUseLinqWhenItsVerboseAndInefficientIssue>(@\"\nusing System.Linq;\nusing System.Collections;\nusing System.Collections.Generic;\nclass MyCollection : ICollection<int>\n{\n\tint ICollection<int>.Count { get { return 0; } }\n\tbool ICollection<int>.IsReadOnly { get { return true; } }\n\n\tpublic IEnumerator<int> GetEnumerator()\n\t{\n\t\treturn null;\n\t}\n\tIEnumerator IEnumerable.GetEnumerator()\n\t{\n\t\treturn GetEnumerator();\n\t}\n\n\tpublic void Add(int item) { }\n\tpublic bool Contains(int item) { return false; }\n\tpublic void CopyTo(int[] array, int arrayIndex) {}\n\tpublic bool Remove(int item) { return false; }\n}\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\tMyCollection x = new MyCollection ();\n\t\treturn x.Count ();\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DoubleNegationOperatorIssueTests.cs",
    "content": "﻿// \n// DoubleNegationOperatorIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class DoubleNegationOperatorIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tbool GetBool () { }\n\n\tvoid TestMethod ()\n\t{\n\t\tvar x = !!GetBool ();\n\t\tx = !(!(GetBool ()));\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tbool GetBool () { }\n\n\tvoid TestMethod ()\n\t{\n\t\tvar x = GetBool ();\n\t\tx = GetBool ();\n\t}\n}\";\n\t\t\tTest<DoubleNegationOperatorIssue> (input, 2, output);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DuplicateBodyMethodIssueTests.cs",
    "content": "//\n// DuplicateBodyMethodIssueTests.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[Ignore]\n\t[TestFixture]\n\tpublic class DuplicateBodyMethodIssueTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void Test()\n\t\t{\n\t\t\tTest<DuplicateBodyMethodIssue>(\n\t\t\t\t@\"class TestClass {\n\tvoid Test ()\n\t{\n\t\tint a = 2;\n\t}\n\tvoid $Test2 ()\n\t{\n\t\tint a = 2;\n\t}\n}\",\n\t\t\t\t@\"class TestClass {\n\tvoid Test ()\n\t{\n\t\tint a = 2;\n\t}\n\tvoid Test2 ()\n\t{\n\t\tTest ();\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n        public void TestNonVoid()\n\t\t{\n\t\t\tTest<DuplicateBodyMethodIssue>(\n\t\t\t\t@\"class TestClass {\n\tint Test ()\n\t{\n\t\tint a = 2;\n\t\treturn a;\n\t}\n\tint $Test2 ()\n\t{\n\t\tint a = 2;\n\t\treturn a;\n\t}\n}\",\n\t\t\t\t@\"class TestClass {\n\tint Test ()\n\t{\n\t\tint a = 2;\n\t\treturn a;\n\t}\n\tint Test2 ()\n\t{\n\t\treturn Test ();\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DuplicateExpressionsInConditionsIssueTests.cs",
    "content": "//\n// DuplicateExpressionsInConditionsIssueTests.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\t\n\t[TestFixture]\n\tpublic class DuplicateExpressionsInConditionsIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar a = (i > 0) && (i > 0);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar a = (i > 0);\n\t}\n}\";\n\t\t\tTest<DuplicateExpressionsInConditionsIssue> (input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar a = (i > 0) && (i % 2 == 0) && (i > 0);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tvar a = (i > 0) && (i % 2 == 0);\n\t}\n}\";\n\t\t\tTest<DuplicateExpressionsInConditionsIssue> (input, output);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DuplicateIfInIfChainIssueTests.cs",
    "content": "//\n// DuplicateIfInIfChainIssueTests.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class DuplicateIfInIfChainIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif(i > 0) {}else if (i > 0){}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif (i > 0) {\n\t\t} \n\t}\n}\";\n\t\t\tTest<DuplicateIfInIfChainIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Test()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif(i > 0) {\n\t\t} else \n\t\tif (i % 2 == 0){\n\t\t} else \n\t\tif (i > 0) {\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif(i > 0) {\n\t\t} else if (i % 2 == 0) {\n\t\t} \n\t}\n}\";\n\t\t\tTest<DuplicateIfInIfChainIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexWithMoreBranches()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif(i > 0) {\n\t\t} else \n\t\tif (i % 2 == 0){\n\t\t} else \n\t\tif (i > 0) {\n\t\t} else \n\t\tif (i > 1) {\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif(i > 0) {\n\t\t} else if (i % 2 == 0) {\n\t\t} else if (i > 1) {\n\t\t}\n\t}\n}\";\n\t\t\tTest<DuplicateIfInIfChainIssue>(input, output);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/DuplicatedLinqToListOrArrayTests.cs",
    "content": "﻿// \n// DuplicatedLinqToListOrArrayTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\tpublic class DuplicatedLinqToListOrArrayTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestDisabledForSingleUse()\n\t\t{\n\t\t\tTest<DuplicatedLinqToListOrArrayIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToList ();\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<DuplicatedLinqToListOrArrayIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToList ().ToList ();\n\t}\n}\", @\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToList ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestToArray()\n\t\t{\n\t\t\tTest<DuplicatedLinqToListOrArrayIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToArray ().ToArray ();\n\t}\n}\", @\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToArray ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMixed()\n\t\t{\n\t\t\tTest<DuplicatedLinqToListOrArrayIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToList ().ToArray ();\n\t}\n}\", @\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToArray ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParenthesis()\n\t\t{\n\t\t\tTest<DuplicatedLinqToListOrArrayIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = ((new int[0]).ToList ()).ToArray ();\n\t}\n}\", @\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = (new int[0]).ToArray ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTriple()\n\t\t{\n\t\t\tTest<DuplicatedLinqToListOrArrayIssue>(@\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToList ().ToArray ().ToArray ();\n\t}\n}\", @\"\nusing System.Linq;\nclass TestClass\n{\n\tpublic void TestMethod()\n\t{\n\t\tvar x = new int[0].ToArray ();\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EmptyConstructorIssueTests.cs",
    "content": "// \n// RedundantConstructorTest.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class EmptyConstructorIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;class Test {private int member; public Test(){}}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\tCheckFix(context, issues, @\"using System;class Test {private int member; }\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;class Test {private int member;public Test(){} static Test(){}}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, @\"using System;class Test {private int member; static Test(){}}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisable()\n\t\t{\n\t\t\tvar input = @\"using System;\n\t//Resharper disable EmptyConstructor\nclass Test {\n\tpublic Test(){\n\t}\n\t//Resharper restore EmptyConstructor\t\n\t}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNegateCase1()\n\t\t{\n\t\t\tvar input = @\"using System;class Test {public Test(){;}}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n        [Test]\n        public void TestNegateCase2()\n        {\n            var input = @\"using System;class Test {public Test(){;} private Test(){}}\";\n\n            TestRefactoringContext context;\n            var issues = GetIssues(new EmptyConstructorIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n\n        [Test]\n\t\tpublic void TestNegateCase3()\n\t\t{\n\t\t\tvar input = @\"using System;class Test {public Test() : base(4) {}}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyConstructorIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EmptyDestructorTests.cs",
    "content": "//\n// EmptyDestructorTests.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\tpublic class EmptyDestructorTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\t~Foo()\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyDestructorIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseWithNesting()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\t~Foo()\n\t{\n\t\t{}\n\t\t;\n\t\t{;}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyDestructorIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForNonEmpty()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\t~Foo()\n\t{\n\t\tSystem.Console.WriteLine();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyDestructorIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\t// ReSharper disable once EmptyDestructor\n\t~Foo()\n\t{\n\t}\n}\";\n\t\t\tTestWrongContext<EmptyDestructorIssue>(input);\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EmptyEmbeddedStatementIssueTests.cs",
    "content": "//\n// UseBlockInsteadColonIssueTests.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\t\n\t[TestFixture]\n\tpublic class EmptyEmbeddedStatementIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif (i > 0);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif (i > 0) {\n\t\t}\n\t}\n}\";\n\t\t\tTest<EmptyEmbeddedStatementIssue>(input, output);\n\t\t}\n\t\t[Test]\n\t\tpublic void TestForeach()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] list)\n\t{\n\t\tforeach (var i in list);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] list)\n\t{\n\t\tforeach (var i in list) {\n\t\t}\n\t}\n}\";\n\t\t\tTest<EmptyEmbeddedStatementIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n//ReSharper disable once EmptyEmbeddedStatement\n\t\tif (i > 0);\n\t}\n}\";\n\t\t\tTestWrongContext<EmptyEmbeddedStatementIssue>(input);\n\t\t}\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EmptyGeneralCatchClauseTests.cs",
    "content": "// \n// EmptyGeneralCatchClauseTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class EmptyGeneralCatchClauseTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;\n\tusing System.IO;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tF ();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyGeneralCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;\n\tusing System.IO;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tF ();\n\t\t\t\t}\n\t\t\t\tcatch\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyGeneralCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\n\tusing System.IO;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tF ();\n\t\t\t\t}\n//Resharper disable EmptyGeneralCatchClause\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n//Resharper restore EmptyGeneralCatchClause\n\t\t\t}\n\t\t}\n\t}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new EmptyGeneralCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EmptyNamespaceTests.cs",
    "content": "//\n// EmptyNamespaceTests.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\tpublic class EmptyNamespaceTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase()\n\t\t{\n\t\t\tvar input = @\"\nnamespace Foo\n{\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyNamespaceIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseWithRegions()\n\t\t{\n\t\t\tvar input = @\"\nnamespace Foo\n{\n\t#region Bar\n\t#endregion\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyNamespaceIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseWithUsing()\n\t\t{\n\t\t\tvar input = @\"\nnamespace Foo\n{\n\tusing System;\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyNamespaceIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseWithNesting()\n\t\t{\n\t\t\tvar input = @\"\nnamespace Foo\n{\n\tnamespace Bar\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyNamespaceIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nnamespace Foo\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForNonEmpty()\n\t\t{\n\t\t\tvar input = @\"\nnamespace Foo\n{\n\tclass Bar\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyNamespaceIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForRegionsWithClasses()\n\t\t{\n\t\t\tvar input = @\"\nnamespace Foo\n{\n\t#region Baz\n\t\tclass Bar\n\t\t{\n\t\t}\n\t#endregion\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EmptyNamespaceIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"// ReSharper disable once EmptyNamespace\nnamespace Foo\n{\n}\";\n\t\t\tTestWrongContext<EmptyNamespaceIssue>(input);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EmptyStatementIssueTests.cs",
    "content": "//\n// EmptyStatementIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class EmptyStatementIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase()\n\t\t{\n\t\t\tTest<EmptyStatementIssue>(@\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\t;\n\t}\n}\n\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<EmptyStatementIssue>(@\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\t// ReSharper disable once EmptyStatement\n\t\t;\n\t}\n}\n\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestEmbeddedStatements()\n\t\t{\n\t\t\tTestWrongContext<EmptyStatementIssue>(@\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tfor (;;) ;\n\t\tif (true) ; else ;\n\t\twhile (true) ;\n\t\tdo ; while (true);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase()\n\t\t{\n\t\t\tTestWrongContext<EmptyStatementIssue>(@\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tlabel:\n\t\t\t;\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EnumUnderlyingTypeIsIntTests.cs",
    "content": "﻿// \n// EnumUnderlyingTypeIsIntTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class EnumUnderlyingTypeIsIntTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCase()\n\t\t{\n\t\t\tTest<EnumUnderlyingTypeIsIntIssue>(@\"\npublic enum Foo : int\n{\n\tBar\n}\", @\"\npublic enum Foo\n{\n\tBar\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<EnumUnderlyingTypeIsIntIssue>(@\"\n// ReSharper disable once EnumUnderlyingTypeIsInt\npublic enum Foo : int\n{\n    Bar\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestNestedCase()\n\t\t{\n\t\t\tTest<EnumUnderlyingTypeIsIntIssue>(@\"\nclass Outer\n{\n\tpublic enum Foo : int\n\t{\n\t\tBar\n\t}\n}\", @\"\nclass Outer\n{\n\tpublic enum Foo\n\t{\n\t\tBar\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForNoUnderlyingType()\n\t\t{\n\t\t\tTest<EnumUnderlyingTypeIsIntIssue>(@\"\npublic enum Foo\n{\n\tBar\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForOtherTypes()\n\t\t{\n\t\t\tTest<EnumUnderlyingTypeIsIntIssue>(@\"\npublic enum Foo : byte\n{\n\tBar\n}\", 0);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EqualExpressionComparisonIssueTests.cs",
    "content": "//\n// EqualExpressionComparisonIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class EqualExpressionComparisonIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestEquality ()\n\t\t{\n\t\t\tTest<EqualExpressionComparisonIssue>(@\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (o == o) {\n\t\t}\n\t\treturn 5;\n\t}\n}\", @\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (true) {\n\t\t}\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInequality ()\n\t\t{\n\t\t\tTest<EqualExpressionComparisonIssue>(@\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (o != o) {\n\t\t}\n\t\treturn 5;\n\t}\n}\", @\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (false) {\n\t\t}\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestEquals ()\n\t\t{\n\t\t\tTest<EqualExpressionComparisonIssue>(@\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif ((1 + 2).Equals(1 + 2)) {\n\t\t}\n\t\treturn 5;\n\t}\n}\", @\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (true) {\n\t\t}\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotEquals ()\n\t\t{\n\t\t\tTest<EqualExpressionComparisonIssue>(@\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (!(1 + 2).Equals(1 + 2)) {\n\t\t}\n\t\treturn 5;\n\t}\n}\", @\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (false) {\n\t\t}\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticEquals ()\n\t\t{\n\t\t\tTest<EqualExpressionComparisonIssue>(@\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (Equals(o, o)) {\n\t\t}\n\t\treturn 5;\n\t}\n}\", @\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (true) {\n\t\t}\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotStaticEquals ()\n\t\t{\n\t\t\tTest<EqualExpressionComparisonIssue>(@\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (!Equals(o, o)) {\n\t\t}\n\t\treturn 5;\n\t}\n}\", @\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\tif (false) {\n\t\t}\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<EqualExpressionComparisonIssue>(@\"class Foo\n{\n\tstatic int Bar (object o)\n\t{\n\t\t// ReSharper disable once EqualExpressionComparison\n\t\tif (o == o) {\n\t\t}\n\t\treturn 5;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/EventUnsubscriptionViaAnonymousDelegateIssueTests.cs",
    "content": "//\n// EventUnsubscriptionViaAnonymousDelegateIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class EventUnsubscriptionViaAnonymousDelegateIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestDelegateCase ()\n\t\t{\n\t\t\tconst string usingSystemClassFooPublicEventEventHandlerFooVoidTestFooDelegate = @\"using System;\n\nclass Bar\n{\n\tpublic event EventHandler Foo;\n\n\tvoid Test ()\n\t{\n\t\tFoo -= delegate { };\n\t}\n}\";\n\t\t\tstring input = usingSystemClassFooPublicEventEventHandlerFooVoidTestFooDelegate;\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EventUnsubscriptionViaAnonymousDelegateIssue(), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaCase ()\n\t\t{\n\t\t\tstring input = @\"using System;\n\nclass Bar\n{\n\tpublic event EventHandler Foo;\n\n\tvoid Test ()\n\t{\n\t\tFoo -= (s ,e) => { };\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EventUnsubscriptionViaAnonymousDelegateIssue(), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tstring input = @\"using System;\n\nclass Bar\n{\n\tpublic event EventHandler Foo;\n\n\tvoid Test ()\n\t{\n\t\t// ReSharper disable once EventUnsubscriptionViaAnonymousDelegate\n\t\tFoo -= delegate { };\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new EventUnsubscriptionViaAnonymousDelegateIssue(), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ExceptionRethrowTests.cs",
    "content": "//\n// ExceptionRethrowIssue.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\tpublic class ExceptionRethrowTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void BasicCase ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\ttry {}\n\t\tcatch (Exception e) {\n\t\t\tthrow e;\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ExceptionRethrowIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\ttry {}\n\t\tcatch (Exception e) {\n\t\t\tthrow;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesSimpleWriteToVariable ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\ttry {}\n\t\tcatch (Exception e) {\n\t\t\te = new Exception(e);\n\t\t\tthrow e;\n\t\t}\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ExceptionRethrowIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ExplicitConversionInForEachIssueTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ExplicitConversionInForEachIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void NoWarningOnNonGenericCollection ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tvoid Bar (System.Collections.ArrayList c)\n\t{\n\t\tforeach (string element in c) { }\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ExplicitConversionInForEachIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoWarningOnImplicitConversion ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tvoid Bar (System.Collections.Generic.List<int> c)\n\t{\n\t\tforeach (double element in c) { }\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ExplicitConversionInForEachIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void WarningOnExplicitConversionBetweenInterfaces ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Collections.Generic;\nclass Foo {\n\tvoid Bar (IList<IList<IDisposable>> c)\n\t{\n\t\tforeach (IDisposable element in c) { }\n\t}\n}\";\n\t\t\tstring output = @\"using System;\nusing System.Collections.Generic;\nclass Foo {\n\tvoid Bar (IList<IList<IDisposable>> c)\n\t{\n\t\tforeach (IList<IDisposable> element in c) { }\n\t}\n}\";\n\t\t\t\n\t\t\tTest<ExplicitConversionInForEachIssue>(input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoWarningOnMissingUsing ()\n\t\t{\n\t\t\tvar input = @\"class Foo {\n\tvoid Bar (System.Collections.Generic.List<System.Text.StringBuilder> c)\n\t{\n\t\tforeach (StringBuilder b in c) { }\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ExplicitConversionInForEachIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ExpressionIsNeverOfProvidedTypeIssueTests.cs",
    "content": "﻿// \n// ExpressionIsNeverOfProvidedTypeIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ExpressionIsNeverOfProvidedTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestClass ()\n\t\t{\n\t\t\tvar input = @\"\nclass AnotherClass { }\nclass TestClass\n{\n\tvoid TestMethod (AnotherClass x)\n\t{\n\t\tif (x is TestClass) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest { }\nclass TestClass\n{\n\tvoid TestMethod (object x)\n\t{\n\t\tif (x is ITest) ;\n\t\tif (x is TestClass) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSealedClass ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest { }\nsealed class TestClass\n{\n\tvoid TestMethod (TestClass x)\n\t{\n\t\tif (x is ITest) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNull ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (null is object) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObjectToInt ()\n\t\t{\n\t\t\tvar input = @\"\nsealed class TestClass\n{\n\tvoid TestMethod (object x)\n\t{\n\t\tif (x is int) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassIsTypeParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass2 { }\nclass TestClass\n{\n\tvoid TestMethod<T, T2> (TestClass x) where T : TestClass2 where T2 : struct\n\t{\n\t\tif (x is T) ;\n\t\tif (x is T2) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassIsTypeParameter2 ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest { }\nclass TestBase { }\nclass TestClass2 : TestClass { }\nclass TestClass : TestBase\n{\n\tvoid TestMethod<T, T2, T3> (TestClass x) where T : TestBase where T2 : ITest where T3 : TestClass2\n\t{\n\t\tif (x is T3) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStructIsTypeParameter ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest { }\nstruct TestStruct : ITest { }\nclass TestClass\n{\n\tvoid TestMethod<T> (TestStruct x) where T : ITest\n\t{\n\t\tif (x is T) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStructIsTypeParameter2 ()\n\t\t{\n\t\t\tvar input = @\"\nstruct TestStruct { }\nclass TestClass\n{\n\tvoid TestMethod<T> (TestStruct x) where T : class\n\t{\n\t\tif (x is T) ;\n\t}\n}\";\n\t\t\t// this is possible with T==object\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass2 { }\nclass TestClass\n{\n\tvoid TestMethod<T> (T x) where T : TestClass2\n\t{\n\t\tif (x is TestClass) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameter2 ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod<T> (T x) where T : struct\n\t{\n\t\tif (x is TestClass) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameter3 ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest { }\nclass TestClass\n{\n\tvoid TestMethod<T> (T x) where T : ITest, new()\n\t{\n\t\tif (x is TestClass) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameter4 ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest { }\nsealed class TestClass\n{\n\tvoid TestMethod<T> (T x) where T : ITest\n\t{\n\t\tif (x is TestClass) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameterIsTypeParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass2 { }\nclass TestClass\n{\n\tvoid TestMethod<T, T2> (T x) where T : TestClass where T2 : TestClass2\n\t{\n\t\tif (x is T2) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameterIsTypeParameter2 ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest { }\nclass TestClass\n{\n\tvoid TestMethod<T, T2> (T x) where T : TestClass where T2 : ITest, new()\n\t{\n\t\tif (x is T2) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestObjectArrayToStringArray ()\n\t\t{\n\t\t\tvar input = @\"\nsealed class TestClass\n{\n\tvoid TestMethod (object[] x)\n\t{\n\t\tif (x is string[]) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownExpression()\n\t\t{\n\t\t\tvar input = @\"\nsealed class TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (unknown is string) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownType()\n\t\t{\n\t\t\tvar input = @\"\nsealed class TestClass\n{\n\tvoid TestMethod (int x)\n\t{\n\t\tif (x is unknown) ;\n\t}\n}\";\n\t\t\tTest<ExpressionIsNeverOfProvidedTypeIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/FieldCanBeMadeReadOnlyIssueTests.cs",
    "content": "//\n// FieldCanBeMadeReadOnlyIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class FieldCanBeMadeReadOnlyIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInitializedField ()\n\t\t{\n\t\t\tTest<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tobject fooBar = new object ();\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\treadonly object fooBar = new object ();\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldAssignedInConstructor ()\n\t\t{\n\t\t\tTest<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tobject fooBar;\n\tpublic Test ()\n\t{\n\t\tfooBar = new object ();\n\t}\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\", @\"class Test\n{\n\treadonly object fooBar;\n\tpublic Test ()\n\t{\n\t\tfooBar = new object ();\n\t}\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\t// ReSharper disable once FieldCanBeMadeReadOnly.Local\n\tobject fooBar = new object ();\n\tpublic static void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestFactoryMethod ()\n\t\t{\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tobject fooBar;\n\t\n\tpublic static Test Create ()\n\t{\n\t\tvar result = new Test ();\n\t\tresult.fooBar = new object ();\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFactoryMethodCase2 ()\n\t\t{\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tobject fooBar;\n\t\n\tpublic static Test Create ()\n\t{\n\t\tvar result = new Test {fooBar = new object () };\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestUninitalizedValueTypeField ()\n\t\t{\n\t\t\tTest<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tint fooBar;\n\tpublic Test ()\n\t{\n\t\tfooBar = 5;\n\t}\n}\", @\"class Test\n{\n\treadonly int fooBar;\n\tpublic Test ()\n\t{\n\t\tfooBar = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInitalizedValueTypeField ()\n\t\t{\n\t\t\t// Is handled by the 'to const' issue.\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tint fooBar = 12;\n\tpublic void FooBar ()\n\t{\n\t\tSystem.Console.WriteLine (fooBar);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSpecializedFieldBug ()\n\t\t{\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"\nusing System;\nclass Test<T> where T : IDisposable\n{\n\tobject fooBar = new object ();\n\tpublic void Foo ()\n\t{\n\t\tfooBar = null;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestFieldAssignedInConstructorLambda ()\n\t\t{\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"\nusing System;\n\nclass Test\n{\n\tobject fooBar;\n\tpublic Action<object> act;\n\tpublic Test ()\n\t{\n\t\tact = o => { fooBar = o; };\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MutableStruct ()\n\t\t{\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tMutableStruct m;\n\tpublic static void Main (string[] args)\n\t{\n\t\tm.Increment();\n\t}\n}\nstruct MutableStruct {\n\tint val;\n\tpublic void Increment() {\n\t\tval++;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnassignedField ()\n\t\t{\n\t\t\tTestWrongContext<FieldCanBeMadeReadOnlyIssue>(@\"class Test\n{\n\tobject fooBar;\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ForCanBeConvertedToForeachIssueTests.cs",
    "content": "//\n// ForCanBeConvertedToForeachIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ForCanBeConvertedToForeachIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestArrayCase ()\n\t\t{\n\t\t\tTest<ForCanBeConvertedToForeachIssue>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tfor (int i = 0; i < o.Length; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tforeach (var p in o) {\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIListCase ()\n\t\t{\n\t\t\tTest<ForCanBeConvertedToForeachIssue>(@\"\nusing System.Collections.Generic;\n\nclass Test\n{\n\tvoid Foo(IList<int> o)\n\t{\n\t\tfor (int i = 0; i < o.Count; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nusing System.Collections.Generic;\n\nclass Test\n{\n\tvoid Foo(IList<int> o)\n\t{\n\t\tforeach (var p in o) {\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid ()\n\t\t{\n\t\t\tTestWrongContext<ForCanBeConvertedToForeachIssue>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tfor (int i = 0; i < o.Length; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t\tSystem.Console.WriteLine (i++);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase2 ()\n\t\t{\n\t\t\tTestWrongContext<ForCanBeConvertedToForeachIssue>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tfor (int i = 0; i < o.Length; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t\tSystem.Console.WriteLine (i);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase3 ()\n\t\t{\n\t\t\tTestWrongContext<ForCanBeConvertedToForeachIssue>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\tfor (int i = 0; i < o.Length; i++) {\n\t\t\tvar p = o [i];\n\t\t\tp = o[0];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestComplexExpression ()\n\t\t{\n\t\t\tTest<ForCanBeConvertedToForeachIssue>(@\"\nusing System.Collections.Generic;\n\nclass Test\n{\n\tIList<int> Bar { get { return null; } }\n\n\tvoid Foo(object o)\n\t{\n\t\tfor (int i = 0; i < ((Test)o).Bar.Count; i++) {\n\t\t\tvar p = ((Test)o).Bar [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\", @\"\nusing System.Collections.Generic;\n\nclass Test\n{\n\tIList<int> Bar { get { return null; } }\n\n\tvoid Foo(object o)\n\t{\n\t\tforeach (var p in ((Test)o).Bar) {\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestOptimizedFor ()\n\t\t{\n\t\t\tTest<ForCanBeConvertedToForeachIssue>(@\"\nusing System.Collections.Generic;\n\nclass Test\n{\n\tIList<int> Bar { get { return null; } }\n\n\tvoid Foo(object o)\n\t{\n\t\tfor (var i = 0, maxBarCount = ((Test)o).Bar.Count; i < maxBarCount; ++i) {\n\t\t\tvar p = ((Test)o).Bar[i];\n\t\t\tSystem.Console.WriteLine(p);\n\t\t}\n\t}\n}\", @\"\nusing System.Collections.Generic;\n\nclass Test\n{\n\tIList<int> Bar { get { return null; } }\n\n\tvoid Foo(object o)\n\t{\n\t\tforeach (var p in ((Test)o).Bar) {\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ForCanBeConvertedToForeachIssue>(@\"\nclass Test\n{\n\tvoid Foo (object[] o)\n\t{\n\t\t// ReSharper disable once ForCanBeConvertedToForeach\n\t\tfor (int i = 0; i < o.Length; i++) {\n\t\t\tvar p = o [i];\n\t\t\tSystem.Console.WriteLine (p);\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ForControlVariableIsNeverModifiedIssueTests.cs",
    "content": "﻿// \n// ForControlVariableIsNeverModifiedIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ForControlVariableIsNeverModifiedIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBinaryOpConditionNotModified ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0, j = 0; i < 10; j++)\n\t\t{\n\t\t}\n\t}\n}\";\n\t\t\tTest<ForControlVariableIsNeverModifiedIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBinaryOpConditionModified ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0, j = 0; i < 10; i++)\n\t\t{\n\t\t}\n\t}\n}\";\n\t\t\tTest<ForControlVariableIsNeverModifiedIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnaryOpConditionNotModified ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (bool x = true; !x;)\n\t\t{\n\t\t}\n\t}\n}\";\n\t\t\tTest<ForControlVariableIsNeverModifiedIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnaryOpConditionModified()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (bool x = true; !x;)\n\t\t{\n\t\t\tx = false;\n\t\t}\n\t}\n}\";\n\t\t\tTest<ForControlVariableIsNeverModifiedIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIdentifierConditionNotModified ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (bool x = true; x;)\n\t\t{\n\t\t}\n\t}\n}\";\n\t\t\tTest<ForControlVariableIsNeverModifiedIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIdentifierConditionModified ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (bool x = false; x;)\n\t\t{\n\t\t\tx = true;\n\t\t}\n\t}\n}\";\n\t\t\tTest<ForControlVariableIsNeverModifiedIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ForStatementConditionIsTrueTests.cs",
    "content": "﻿// \n// ForStatementConditionIsTrueTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ForStatementConditionIsTrueTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tfor (; true ;)\n\t\t\t{}\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ForStatementConditionIsTrueIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tfor (;  ;)\n\t\t\t{}\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tfor (int a; true ; )\n\t\t\t{}\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ForStatementConditionIsTrueIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tfor (int a;  ; )\n\t\t\t{}\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n//Resharper disable ForStatementConditionIsTrue\n\t\t\tfor (; true ;)\n\t\t\t{}\n//Resharper restore ForStatementConditionIsTrue\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ForStatementConditionIsTrueIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/FormatStringProblemIssueTests.cs",
    "content": "//\n// FormatStringProblemIssueTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class FormatStringProblemIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TooFewArguments()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"{0}\"\");\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void SupportsFixedArguments()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tBar(\"\"{0}\"\", 1);\n\t}\n\n\tvoid Bar(string format, string arg0)\n\t{\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresCallWithUnknownNumberOfArguments()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tstring Bar(params object[] args)\n\t{\n\t\treturn string.Format(\"\"{1}\"\", args);\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FormatItemIndexOutOfRangeOfArguments()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"{1}\"\", 1);\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatItemIndexOutOfRangeOfArguments_ExplicitArrayCreation()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"{1}\"\", new object[] { 1 });\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatItemMissingEndBrace()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"Text text text {0 text text text\"\", 1);\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new FormatStringProblemIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\t\n\t\t[Test]\n\t\tpublic void UnescapedLeftBrace()\n\t\t{\n\t\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"a { a\"\", 1);\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresStringWithGoodArguments()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"{0}\"\", \"\"arg0\"\");\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresStringWithGoodArguments_ExplicitArrayCreation()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"{0} {1}\"\", new object[] { \"\"arg0\"\", \"\"arg1\"\" });\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresNonFormattingCall()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring lower = string.ToLower(\"\"{0}\"\");\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void HandlesCallsWithExtraArguments()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tFoo(1);\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new FormatStringProblemIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TooManyArguments()\n\t\t{\n\t\t\tTestIssue<FormatStringProblemIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"{0}\"\", 1, 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnreferencedArgument()\n\t\t{\n\t\t\tTestIssue<FormatStringProblemIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tstring.Format(\"\"{0} {2}\"\", 1, 2, 3);\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 14405 - Incorrect \"argument not used in string format\" warning\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14405()\n\t\t{\n\t\t\tTestWrongContext<FormatStringProblemIssue>(@\"\nusing System;\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tDateTime.ParseExact(\"\"expiresString\"\", \"\"s\"\", System.Globalization.CultureInfo.InvariantCulture);\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<FormatStringProblemIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\t// ReSharper disable once FormatStringProblem\n\t\tstring.Format(\"\"{0}\"\", 1, 2);\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15867 - Wrong Context for string formatting\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15867()\n\t\t{\n\t\t\tTestWrongContext<FormatStringProblemIssue>(@\"\nclass TestClass\n{\n\tvoid Foo()\n\t{\n\t\tdouble d = 1;\n\t\td.ToString(\"\"G29\"\", System.Globalization.CultureInfo.InvariantCulture);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/FunctionNeverReturnsIssueTests.cs",
    "content": "﻿// \n// MethodNeverReturnsIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class FunctionNeverReturnsIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestEnd ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod () \n\t{\n\t\tint i = 1;\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestThrow ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tthrow new System.NotImplementedException();\t\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNeverReturns ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\twhile (true) ;\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfWithoutElse ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tstring TestMethod (int x)\n\t{\n\t\tif (x <= 0) return \"\"Hi\"\";\n\t\treturn \"\"_\"\" + TestMethod(x - 1);\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRecursive ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tTestMethod ();\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonRecursive ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tTestMethod (0);\n\t}\n\tvoid TestMethod (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVirtualNonRecursive ()\n\t\t{\n\t\t\tvar input = @\"\nclass Base\n{\n\tpublic Base parent;\n\tpublic virtual string Result {\n\t\tget { return parent.Result; }\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonRecursiveProperty ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint foo;\n\tint Foo\n\t{\n\t\tget { return foo; }\n\t\tset\n\t\t{\n\t\t\tif (Foo != value)\n\t\t\t\tfoo = value;\n\t\t}\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestGetterNeverReturns ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestProperty\n\t{\n\t\tget {\n\t\t\twhile (true) ;\n\t\t}\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRecursiveGetter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestProperty\n\t{\n\t\tget {\n\t\t\treturn TestProperty;\n\t\t}\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRecursiveSetter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestProperty\n\t{\n\t\tset {\n\t\t\tTestProperty = value;\n\t\t}\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAutoProperty ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestProperty\n\t{\n\t\tget;\n\t\tset;\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodGroupNeverReturns ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod()\n\t{\n\t\treturn TestMethod();\n\t}\n\tint TestMethod(object o)\n\t{\n\t\treturn TestMethod();\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIncrementProperty()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestProperty\n\t{\n\t\tget { return TestProperty++; }\n\t\tset { TestProperty++; }\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaNeverReturns ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tSystem.Action action = () => { while (true) ; };\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDelegateNeverReturns ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tSystem.Action action = delegate() { while (true) ; };\n\t}\n}\";\n\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\t\t[Test]\n\t\tpublic void YieldBreak ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tSystem.Collections.Generic.IEnumerable<string> TestMethod ()\n\t{\n\t\tyield break;\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\t// ReSharper disable once FunctionNeverReturns\n\tvoid TestMethod ()\n\t{\n\t\twhile (true) ;\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug254 ()\n\t\t{\n\t\t\t//https://github.com/icsharpcode/NRefactory/issues/254\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint state = 0;\n\n\tbool Foo()\n\t{\n\t\treturn state < 10;\n\t}\n\n\tvoid TestMethod()\n\t{\n\t\tif (Foo()) {\n\t\t\t++state;\n\t\t\tTestMethod ();\t\n\t\t}\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitch ()\n\t\t{\n\t\t\t//https://github.com/icsharpcode/NRefactory/issues/254\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint foo;\n\tvoid TestMethod()\n\t{\n\t\tswitch (foo) {\n\t\t\tcase 0: TestMethod();\n\t\t}\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchWithDefault ()\n\t\t{\n\t\t\t//https://github.com/icsharpcode/NRefactory/issues/254\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint foo;\n\tvoid TestMethod()\n\t{\n\t\tswitch (foo) {\n\t\t\tcase 0: case 1: TestMethod();\n\t\t\tdefault: TestMethod();\n\t\t}\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchValue ()\n\t\t{\n\t\t\t//https://github.com/icsharpcode/NRefactory/issues/254\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint foo;\n\tint TestMethod()\n\t{\n\t\tswitch (TestMethod()) {\n\t\t\tcase 0: return 0;\n\t\t}\n\t\treturn 1;\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLinqFrom ()\n\t\t{\n\t\t\t//https://github.com/icsharpcode/NRefactory/issues/254\n\t\t\tvar input = @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tIEnumerable<int> TestMethod()\n\t{\n\t\treturn from y in TestMethod() select y;\n\t}\n}\";\n\t\t\tTest<FunctionNeverReturnsIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongLinqContexts ()\n\t\t{\n\t\t\t//https://github.com/icsharpcode/NRefactory/issues/254\n\t\t\tvar input = @\"\nusing System.Linq;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tIEnumerable<int> TestMethod()\n\t{\n\t\treturn from y in Enumerable.Empty<int>()\n\t\t       from z in TestMethod()\n\t\t       select y;\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeach ()\n\t\t{\n\t\t\t//https://bugzilla.xamarin.com/show_bug.cgi?id=14732\n\t\t\tvar input = @\"\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tforeach (var x in new int[0])\n\t\t\tTestMethod();\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoExecutionFor ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tfor (int i = 0; i < 0; ++i)\n\t\t\tTestMethod ();\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCoalescing ()\n\t\t{\n\t\t\t//https://bugzilla.xamarin.com/show_bug.cgi?id=14732\n\t\t\tvar input = @\"\nusing System.Linq;\nclass TestClass\n{\n\tTestClass parent;\n\tint? value;\n\tint TestMethod()\n\t{\n\t\treturn value ?? parent.TestMethod();\n\t}\n}\";\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyGetterInSetter ()\n\t\t{\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (@\"using System;\nclass TestClass\n{\n\tint a;\n\tint Foo {\n\t\tget { return 1; }\n\t\tset { a = Foo; }\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRecursiveFunctionBug ()\n\t\t{\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (@\"using System;\nclass TestClass\n{\n\tbool Foo (int i)\n\t{\n\t\treturn i < 0 || Foo (i - 1);\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 17769 - Incorrect \"method never returns\" warning\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17769 ()\n\t\t{\n\t\t\tTestWrongContext<FunctionNeverReturnsIssue> (@\"\nusing System.Linq;\nclass A\n{\n    A[] list = new A[0];\n\n    public bool Test ()\n    {\n        return list.Any (t => t.Test ());\n    }\n}\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/InconsistentNamingTests.cs",
    "content": "﻿// \n// InconsistentNamingTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class InconsistentNamingTests : InspectionActionTestBase\n\t{\n\t\tvoid CheckNaming (string input, string output, bool shouldBeEmpty = false)\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new InconsistentNamingIssue (), input, out context);\n\t\t\tif (shouldBeEmpty) {\n\t\t\t\tAssert.AreEqual (0, issues.Count ());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tAssert.Greater (issues.Count, 0);\n\t\t\tCheckFix (context, issues [0], output);\n\t\t}\n\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void TestUnderscoreFix ()\n\t\t{\n\t\t\tvar input = @\"namespace FIX_1 {}\";\n\t\t\tvar output = @\"namespace Fix1 {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void TestNamespaceName ()\n\t\t{\n\t\t\tvar input = @\"namespace anIssue {}\";\n\t\t\tvar output = @\"namespace AnIssue {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestClassName ()\n\t\t{\n\t\t\tvar input = @\"public class anIssue {}\";\n\t\t\tvar output = @\"public class AnIssue {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAttributeName ()\n\t\t{\n\t\t\tvar input = @\"public class test : System.Attribute {}\";\n\t\t\tvar output = @\"public class TestAttribute : System.Attribute {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestEventArgsName ()\n\t\t{\n\t\t\tvar input = @\"public class test : System.EventArgs {}\";\n\t\t\tvar output = @\"public class TestEventArgs : System.EventArgs {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEventArgsSuffixOptimizationName ()\n\t\t{\n\t\t\tvar input = @\"\t\t\tpublic class TestArgs : System.EventArgs {}\";\n\t\t\tvar output = @\"\t\t\tpublic class TestEventArgs : System.EventArgs {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestException ()\n\t\t{\n\t\t\tvar input = @\"class test : System.Exception {}\";\n\t\t\tvar output = @\"class TestException : System.Exception {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestStructName ()\n\t\t{\n\t\t\tvar input = @\"public struct anIssue {}\";\n\t\t\tvar output = @\"public struct AnIssue {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceName ()\n\t\t{\n\t\t\tvar input = @\"public interface anIssue {}\";\n\t\t\tvar output = @\"public interface IAnIssue {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumName ()\n\t\t{\n\t\t\tvar input = @\"public enum anIssue {}\";\n\t\t\tvar output = @\"public enum AnIssue {}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDelegateName ()\n\t\t{\n\t\t\tvar input = @\"public delegate void anIssue ();\";\n\t\t\tvar output = @\"public delegate void AnIssue ();\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n//\t\t[Test]\n//\t\tpublic void TestPrivateFieldName ()\n//\t\t{\n//\t\t\tvar input = @\"class AClass { int Field; }\";\n//\t\t\tvar output = @\"class AClass { int field; }\";\n//\t\t\tCheckNaming (input, output);\n//\t\t}\n\t\t\n//\t\t[Test]\n//\t\tpublic void TestUnderscoreFieldName ()\n//\t\t{\n//\t\t\tvar input = @\"class AClass { int _Field; }\";\n//\t\t\tvar output = @\"class AClass { int _field; }\";\n//\t\t\tCheckNaming (input, output);\n//\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPublicFieldName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { public int field; }\";\n\t\t\tvar output = @\"class AClass { public int Field; }\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\t\t\n//\t\t[Test]\n//\t\tpublic void TestPrivateConstantFieldName ()\n//\t\t{\n//\t\t\tvar input = @\"class AClass { const int field = 5; }\";\n//\t\t\tvar output = @\"class AClass { const int Field = 5; }\";\n//\t\t\tCheckNaming (input, output);\n//\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPublicReadOnlyFieldName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { public readonly int field; }\";\n\t\t\tvar output = @\"class AClass { public readonly int Field; }\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPrivateStaticReadOnlyFieldName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { static readonly int Field; }\";\n\t\t\tvar output = @\"class AClass { static readonly int Field; }\";\n\t\t\tCheckNaming (input, output, true);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPrivateStaticReadOnlyFieldNameCase2 ()\n\t\t{\n\t\t\tvar input = @\"class AClass { static readonly int field; }\";\n\t\t\tvar output = @\"class AClass { static readonly int field; }\";\n\t\t\tCheckNaming (input, output, true);\n\t\t}\n\n//\t\t[Test]\n//\t\tpublic void TestPrivateStaticFieldName ()\n//\t\t{\n//\t\t\tvar input = @\"class AClass { static int Field; }\";\n//\t\t\tvar output = @\"class AClass { static int field; }\";\n//\t\t\tCheckNaming (input, output);\n//\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPublicStaticReadOnlyFieldName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { public static readonly int field = 5; }\";\n\t\t\tvar output = @\"class AClass { public static readonly int Field = 5; }\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\t\t\n//\t\t[Test]\n//\t\tpublic void TestPrivateReadOnlyFieldName ()\n//\t\t{\n//\t\t\tvar input = @\"class AClass { readonly int Field; }\";\n//\t\t\tvar output = @\"class AClass { readonly int field; }\";\n//\t\t\tCheckNaming (input, output);\n//\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPublicConstantFieldName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { public const int field = 5; }\";\n\t\t\tvar output = @\"class AClass { public const int Field = 5; }\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMethodName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { public int method () {} }\";\n\t\t\tvar output = @\"class AClass { public int Method () {} }\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { public int property { get; set; } }\";\n\t\t\tvar output = @\"class AClass { public int Property { get; set; } }\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameterName ()\n\t\t{\n\t\t\tvar input = @\"class AClass { int Method (int Param) {} }\";\n\t\t\tvar output = @\"class AClass { int Method (int param) {} }\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameterName ()\n\t\t{\n\t\t\tvar input = @\"struct Str<K> { K k;}\";\n\t\t\tvar output = @\"struct Str<TK> { TK k;}\";\n\t\t\tCheckNaming (input, output);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestOverrideMembers ()\n\t\t{\n\t\t\tvar input = @\"\nclass Base { public virtual int method (int Param) {} }\nclass MyClass : Base { public override int method (int Param) {} }\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new InconsistentNamingIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOverrideMembersParameterNameCaseMismatch ()\n\t\t{\n\t\t\tvar input = @\"\nclass Base { public virtual int Method (int param) {} }\nclass MyClass : Base { public override int Method (int Param) {} }\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new InconsistentNamingIssue (), input, out context);\n\t\t\tforeach (var issue in issues)\n\t\t\t\tConsole.WriteLine(issue.Description);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t}\n\n\t[TestFixture]\n\tpublic class WordParserTests\n\t{\n\t\t[Test]\n\t\tpublic void TestPascalCaseWords ()\n\t\t{\n\t\t\tvar result = WordParser.BreakWords (\"SomeVeryLongName\");\n\t\t\tAssert.AreEqual (4, result.Count);\n\t\t\tAssert.AreEqual (\"Some\", result [0]);\n\t\t\tAssert.AreEqual (\"Very\", result [1]);\n\t\t\tAssert.AreEqual (\"Long\", result [2]);\n\t\t\tAssert.AreEqual (\"Name\", result [3]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCamelCaseWords ()\n\t\t{\n\t\t\tvar result = WordParser.BreakWords (\"someVeryLongName\");\n\t\t\tAssert.AreEqual (4, result.Count);\n\t\t\tAssert.AreEqual (\"some\", result [0]);\n\t\t\tAssert.AreEqual (\"Very\", result [1]);\n\t\t\tAssert.AreEqual (\"Long\", result [2]);\n\t\t\tAssert.AreEqual (\"Name\", result [3]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUpperCaseSubWord ()\n\t\t{\n\t\t\tvar result = WordParser.BreakWords (\"someVeryLongXMLName\");\n\t\t\tAssert.AreEqual (5, result.Count);\n\t\t\tAssert.AreEqual (\"some\", result [0]);\n\t\t\tAssert.AreEqual (\"Very\", result [1]);\n\t\t\tAssert.AreEqual (\"Long\", result [2]);\n\t\t\tAssert.AreEqual (\"XML\", result [3]);\n\t\t\tAssert.AreEqual (\"Name\", result [4]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnderscore ()\n\t\t{\n\t\t\tvar result = WordParser.BreakWords (\"some_Very_long_NAME\");\n\t\t\tAssert.AreEqual (4, result.Count);\n\t\t\tAssert.AreEqual (\"some\", result [0]);\n\t\t\tAssert.AreEqual (\"Very\", result [1]);\n\t\t\tAssert.AreEqual (\"long\", result [2]);\n\t\t\tAssert.AreEqual (\"NAME\", result [3]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnderscoreCase1 ()\n\t\t{\n\t\t\tvar result = WordParser.BreakWords (\"FIX_1\");\n\t\t\tAssert.AreEqual (2, result.Count);\n\t\t\tAssert.AreEqual (\"FIX\", result [0]);\n\t\t\tAssert.AreEqual (\"1\", result [1]);\n\t\t}\n\n\t}\n\n\t[TestFixture]\n\tpublic class NamingRuleTest\n\t{\n\t\t[Test]\n\t\tpublic void TestPascalCase()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.PascalCase;\n\t\t\tAssert.IsTrue(rule.IsValid(\"PascalCase\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"PascalCase_1_23\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"Pascal_Case\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCamelCase()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.CamelCase;\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camel_Case\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"camelCase\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"camelCase_10_11\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllUpper()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.AllUpper;\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"ALL_UPPER\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"ALLUPPER\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllLower()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.AllLower;\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"all_lower\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"alllower\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFirstUpper()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.FirstUpper;\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"First_upper\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"Firstupper\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnderscoreTolerantPascalCaseWithUpperStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.PascalCaseWithUpperLetterUnderscore;\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase_underscoreTolerant\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase__UnderscoreTolerant\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"_PascalCase_UnderscoreTolerant\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"PascalCase_UnderscoreTolerant\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"PascalCase_UnderscoreTolerant_12\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnderscoreTolerantPascalCaseWithLowStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.PascalCaseWithLowerLetterUnderscore;\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase_UnderscoreTolerant\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase__underscoreTolerant\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"_PascalCase_underscoreTolerant\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"PascalCase_underscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnderscoreTolerantCamelCaseWithLowStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.CamelCaseWithLowerLetterUnderscore;\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase_UnderscoreTolerant\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase__underscoreTolerant\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"camelCase_underscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnderscoreTolerantCamelCaseWithUpperStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.CamelCaseWithUpperLetterUnderscore;\n\t\t\tAssert.IsFalse(rule.IsValid(\"PascalCase\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase_underscoreTolerant\"));\n\t\t\tAssert.IsFalse(rule.IsValid(\"camelCase__UnderscoreTolerant\"));\n\t\t\tAssert.IsTrue(rule.IsValid(\"camelCase_UnderscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSuggestionForCamelCaseWithUpperStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.CamelCaseWithUpperLetterUnderscore;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"camelCase_underscoreTolerant\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"camelCase_UnderscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSuggestionForCamelCaseWithUpperStartWithUnderscoreStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.CamelCaseWithUpperLetterUnderscore;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"_camelCase_underscoreTolerant\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"camelCase_UnderscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSuggestionForCamelCaseWithLowerStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.CamelCaseWithLowerLetterUnderscore;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"camelCase_UnderscoreTolerant\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"camelCase_underscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSuggestionForCamelCaseWithLowerStartMultipleUnderscores()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.CamelCaseWithLowerLetterUnderscore;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"camelCase_____UnderscoreTolerant\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"camelCase_underscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSuggestionForPascalCaseWithUpperStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.PascalCaseWithUpperLetterUnderscore;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"PascalCase_underscoreTolerant\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"PascalCase_UnderscoreTolerant\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSuggestionForPascalCaseWithLowerStart()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.PascalCaseWithLowerLetterUnderscore;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"PascalCase_UnderscoreTolerant\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"PascalCase_underscoreTolerant\"));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSuggestionForPascalCase()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Class);\n\t\t\trule.NamingStyle = NamingStyle.PascalCase;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"pascalCase_12_____12323\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"PascalCase_12_12323\"));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug in Xamarin Studio \"Warning: no known errors\"\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestCase70925()\n\t\t{\n\t\t\tvar rule = new NamingRule(AffectedEntity.Field);\n\t\t\trule.NamingStyle = NamingStyle.PascalCase;\n\t\t\tSystem.Collections.Generic.IList<string> suggestedNames;\n\t\t\trule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), \"_taskStatus\", out suggestedNames); \n\t\t\tAssert.IsTrue(suggestedNames.Contains(\"TaskStatus\"));\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/IncorrectCallToGetHashCodeTests.cs",
    "content": "//\n// IncorrectCallToGetHashCodeTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class IncorrectCallToGetHashCodeTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tpublic override int GetHashCode()\n\t{\n\t\treturn base.GetHashCode();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new IncorrectCallToObjectGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonObjectBase()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n}\nclass Bar : Foo\n{\n\tpublic override int GetHashCode()\n\t{\n\t\treturn base.GetHashCode();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new IncorrectCallToObjectGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresCallsToOtherObjects()\n\t\t{\n\t\t\tvar input = @\"\ninterface IFoo\n{\n}\nclass Bar : IFoo\n{\n\tIFoo foo;\n\n\tpublic override int GetHashCode()\n\t{\n\t\treturn foo.GetHashCode();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new IncorrectCallToObjectGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotCheckOutsideOverriddenGetHashCode()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tpublic void Bar()\n\t{\n\t\treturn base.GetHashCode();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new IncorrectCallToObjectGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotWarnAboutCallsToOtherMethods()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tpublic override int GetHashCode()\n\t{\n\t\tvar type = GetType();\n\t\treturn 1;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new IncorrectCallToObjectGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/InspectionActionTestBase.cs",
    "content": "﻿// \n// InspectionActionTestBase.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\tpublic abstract class InspectionActionTestBase\n\t{\n\t\tprotected static List<CodeIssue> GetIssues (CodeIssueProvider action, string input, out TestRefactoringContext context, bool expectErrors = false, CSharpParser parser = null)\n\t\t{\n\t\t\tcontext = TestRefactoringContext.Create (input, expectErrors, parser);\n\t\t\t\n\t\t\treturn new List<CodeIssue> (action.GetIssues (context));\n\t\t}\n\n\t\tprotected static List<CodeIssue> GetIssuesWithSubIssue (CodeIssueProvider action, string input, string subIssue, out TestRefactoringContext context, bool expectErrors = false)\n\t\t{\n\t\t\tcontext = TestRefactoringContext.Create (input, expectErrors);\n\n\t\t\treturn new List<CodeIssue> (action.GetIssues (context, subIssue));\n\t\t}\n\n\t\tprotected static void CheckFix (TestRefactoringContext ctx, CodeIssue issue, string expectedOutput, int fixIndex = 0)\n\t\t{\n\t\t\tusing (var script = ctx.StartScript ())\n\t\t\t\tissue.Actions[fixIndex].Run (script);\n\t\t\tif (expectedOutput != ctx.Text) {\n\t\t\t\tConsole.WriteLine(\"expected:\");\n\t\t\t\tConsole.WriteLine(expectedOutput);\n\t\t\t\tConsole.WriteLine(\"got:\");\n\t\t\t\tConsole.WriteLine(ctx.Text);\n\t\t\t}\n\t\t\tAssert.AreEqual (expectedOutput, ctx.Text);\n\t\t}\n\n\t\tprotected static void CheckFix (TestRefactoringContext ctx, IEnumerable<CodeIssue> issues, string expectedOutput, int fixINdex = 0)\n\t\t{\n\t\t\tusing (var script = ctx.StartScript ()) {\n\t\t\t\tforeach (var issue in issues) {\n\t\t\t\t\tissue.Actions[fixINdex].Run (script);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbool pass = expectedOutput == ctx.Text;\n\t\t\tif (!pass) {\n\t\t\t\tConsole.WriteLine (\"expected:\");\n\t\t\t\tConsole.WriteLine (expectedOutput);\n\t\t\t\tConsole.WriteLine (\"got:\");\n\t\t\t\tConsole.WriteLine (ctx.Text);\n\t\t\t}\n\t\t\tAssert.AreEqual (expectedOutput, ctx.Text);\n\t\t}\n\n\t\tprotected static void CheckBatchFix (TestRefactoringContext ctx, IEnumerable<CodeIssue> issues, object siblingKey, string expectedOutput)\n\t\t{\n\t\t\tusing (var script = ctx.StartScript ()) {\n\t\t\t\tforeach (var issue in issues) {\n\t\t\t\t\tvar actions = issue.Actions.Where (a => a.SiblingKey == siblingKey).ToList ();\n\t\t\t\t\tAssert.IsTrue(actions.Count <= 1, \"At most a single action expected per sibling key and issue.\");\n\t\t\t\t\tactions.First (a => a.SiblingKey == siblingKey).Run (script);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbool pass = expectedOutput == ctx.Text;\n\t\t\tif (!pass) {\n\t\t\t\tConsole.WriteLine (\"expected:\");\n\t\t\t\tConsole.WriteLine (expectedOutput);\n\t\t\t\tConsole.WriteLine (\"got:\");\n\t\t\t\tConsole.WriteLine (ctx.Text);\n\t\t\t}\n\t\t\tAssert.AreEqual (expectedOutput, ctx.Text);\n\t\t}\n\n\t\tprotected static void Test<T> (string input, int issueCount, string output = null, int issueToFix = -1, int actionToRun = 0)\n\t\t\twhere T : CodeIssueProvider, new ()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new T (), input, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t\tif (issueCount == 0 || output == null) \n\t\t\t\treturn;\n\t\t\tif (issueToFix == -1)\n\t\t\t\tCheckFix (context, issues, output, actionToRun);\n\t\t\telse\n\t\t\t\tCheckFix (context, issues [issueToFix], output, actionToRun);\n\t\t}\n\n\t\tprotected static void TestIssue<T> (string input, int issueCount = 1)\n\t\t\twhere T : CodeIssueProvider, new ()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new T (), input, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t}\n\n\t\tprotected static void Test<T> (string input, string output, int fixIndex = 0)\n\t\t\twhere T : CodeIssueProvider, new ()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new T (), input, out context);\n\t\t\tif (issues.Count == 0)\n\t\t\t\tConsole.WriteLine(\"No issues in:\\n\" + input);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues[0], output, fixIndex);\n\t\t}\n\n\n\t\tprotected static void TestWithSubIssue<T> (string input,  string subIssue, int issueCount, string output = null, int issueToFix = -1)\n\t\t\twhere T : CodeIssueProvider, new ()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssuesWithSubIssue (new T (), input, subIssue, out context);\n\t\t\tAssert.AreEqual (issueCount, issues.Count);\n\t\t\tif (issueCount == 0 || output == null) \n\t\t\t\treturn;\n\t\t\tif (issueToFix == -1)\n\t\t\t\tCheckFix (context, issues, output);\n\t\t\telse\n\t\t\t\tCheckFix (context, issues [issueToFix], output);\n\t\t}\n\n\t\tprotected static void TestWithSubIssue<T> (string input, string output, string subIssue, int fixIndex = 0)\n\t\t\twhere T : CodeIssueProvider, new ()\n\t\t{\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssuesWithSubIssue (new T (), input, subIssue, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues[0], output, fixIndex);\n\t\t}\n\n\t\tprotected static void TestWrongContext<T> (string input)\n\t\t\twhere T : CodeIssueProvider, new ()\n\t\t{\n\t\t\tTest<T>(input, 0);\n\t\t}\n\n\t\tprotected static void TestWrongContextWithSubIssue<T> (string input, string subIssue)\n\t\t\twhere T : CodeIssueProvider, new ()\n\t\t{\n\t\t\tTestWithSubIssue<T>(input, subIssue, 0);\n\t\t}\n\t}\n\t\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/InvokeAsExtensionMethodIssueTests.cs",
    "content": "//\n// InvokeAsExtensionMethodIssueTests.cs\n//\n// Author:\n//   Simon Lindgren <simon.n.lindgren@gmail.com>\n//   Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StaticMethodInvocationToExtensionMethodInvocationTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void HandlesBasicCase()\n\t\t{\n\t\t\tTest<InvokeAsExtensionMethodIssue>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static bool Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\tB.$Ext (a, 1);\n\t}\n}\", @\"\nclass A { }\nstatic class B\n{\n\tpublic static bool Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\ta.Ext (1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesReturnValueUsage()\n\t\t{\n\t\t\tTest<InvokeAsExtensionMethodIssue>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\tif (B.$Ext (a, 1))\n\t\t\treturn;\n\t}\n}\", @\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\tif (a.Ext (1))\n\t\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresIfNullArgument()\n\t\t{\n\t\t\tTestWrongContext<InvokeAsExtensionMethodIssue>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (this A a);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tB.$Ext (null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresIfNotExtensionMethod()\n\t\t{\n\t\t\tTestWrongContext<InvokeAsExtensionMethodIssue>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (A a);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tB.$Ext (new A());\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresIfAlreadyExtensionMethodCallSyntax()\n\t\t{\n\t\t\tTestWrongContext<InvokeAsExtensionMethodIssue>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static void Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\ta.$Ext (1);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresPropertyInvocation()\n\t\t{\n\t\t\tTestWrongContext<InvokeAsExtensionMethodIssue>(@\"\nstatic class B\n{\n\tpublic static int Ext { get; set; }\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tB.$Ext();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<InvokeAsExtensionMethodIssue>(@\"\nclass A { }\nstatic class B\n{\n\tpublic static bool Ext (this A a, int i);\n}\nclass C\n{\n\tvoid F()\n\t{\n\t\tA a = new A();\n\t\t// ReSharper disable once InvokeAsExtensionMethod\n\t\tB.Ext (a, 1);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/LocalVariableHidesMemberIssueTests.cs",
    "content": "﻿// \n// LocalVariableHidesMemberIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class LocalVariableHidesMemberIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t    const string input = @\"\nclass TestClass\n{\n\tint i;\n\tvoid TestMethod ()\n\t{\n\t\tint i, j;\n\t}\n}\";\n\t\t    Test<LocalVariableHidesMemberIssue>(input, 1);\n\t\t}\n\n\t    public void TestDisable()\n\t    {\n\t        var input = @\"class TestClass\n{\n    int i;\n    void TestMethod()\n    {\n// ReSharper disable once LocalVariableHidesMember\n        int i, j;\n    }\n}\";\n            TestWrongContext<LocalVariableHidesMemberIssue>(input);\n\t    }\n\n\t\t[Test]\n\t\tpublic void TestMethod ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint TestMethod;\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeach ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i;\n\tvoid TestMethod ()\n\t{\n\t\tint[] array = new int [10];\n\t\tforeach (var i in array) ;\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStatic ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tstatic int i;\n\tstatic void TestMethod2 ()\n\t{\n\t\tint i;\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tstatic int i;\n\tint j;\n\tvoid TestMethod ()\n\t{\n\t\tint i;\n\t}\n\tstatic void TestMethod2 ()\n\t{\n\t\tint j;\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAccessiblePrivate ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i;\n\n\tvoid Method ()\n\t{\n\t\tint i = 0;\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAccessiblePrivateDueToTypeNesting ()\n\t\t{\n\t\t\tvar input = @\"\nclass RootClass\n{\n\tint i;\n\n\tclass NestedClass : RootClass\n\t{\n\t\t// Issue 1\n\t\tvoid Method ()\n\t\t{\n\t\t\tint i = 0;\n\t\t}\n\n\t\tclass NestedNestedClass : NestedClass\n\t\t{\n\t\t\t// Issue 2\n\t\t\tvoid OtherMethod ()\n\t\t\t{\n\t\t\t\tint i = 0;\n\t\t\t}\n\t\t}\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInternalAccessibility ()\n\t\t{\n\t\t\tvar input = @\"\nclass BaseClass\n{\n\tinternal int i;\n}\nclass TestClass : BaseClass\n{\n\tvoid Method ()\n\t{\n\t\tint i = 0;\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInaccessiblePrivate ()\n\t\t{\n\t\t\tvar input = @\"\nclass BaseClass\n{\n\tint i;\n}\nclass TestClass : BaseClass\n{\n\tvoid Method ()\n\t{\n\t\tint i = 0;\n\t}\n}\";\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SuppressIssueIfVariableInitializedFromField ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i;\n\t\n\tvoid Method ()\n\t{\n\t\tint i = this.i;\n\t}\n}\";\n\t\t\t// Given the initializer, member hiding is obviously intended in this case;\n\t\t\t// so we suppress the warning.\n\t\t\tTest<LocalVariableHidesMemberIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/LocalVariableNotUsedIssueTests.cs",
    "content": "﻿// \n// LocalVariableNotUsedIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class LocalVariableNotUsedIssueTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void TestUnusedVariable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tint i;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t}\n}\";\n\t\t\tTest<LocalVariableNotUsedIssue> (input, 1, output);\n\t\t\tvar input2 = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tint i, j;\n\t\tj = 1;\n\t}\n}\";\n\t\t\tvar output2 = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tint j;\n\t\tj = 1;\n\t}\n}\";\n\t\t\tTest<LocalVariableNotUsedIssue> (input2, 1, output2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsedVariable ()\n\t\t{\n\t\t\tvar input1 = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t}\n}\";\n\t\t\tvar input2 = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tint i;\n\t\ti = 0;\n\t}\n}\";\n\t\t\tTest<LocalVariableNotUsedIssue> (input1, 0);\n\t\t\tTest<LocalVariableNotUsedIssue> (input2, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnusedForeachVariable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tvar array = new int[10];\n\t\tforeach (var i in array) {\n\t\t}\n\t}\n}\";\n\t\t\tTest<LocalVariableNotUsedIssue> (input, 1);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsedForeachVariable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tvar array = new int[10];\n\t\tint j = 0;\n\t\tforeach (var i in array) {\n\t\t\tj += i;\n\t\t}\n\t}\n}\";\n\t\t\tTest<LocalVariableNotUsedIssue> (input, 0);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/LockThisTests.cs",
    "content": "// LockThisTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis <luiscubal@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class LockThisTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestLockThisInMethod ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tlock (this) {\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tvoid TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockThisInGetter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint MyProperty {\n\t\tget {\n\t\t\tlock (this) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tint MyProperty {\n\t\tget {\n\t\t\tlock (locker) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockThisInSetter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint MyProperty {\n\t\tset {\n\t\t\tlock (this) {\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tint MyProperty {\n\t\tset {\n\t\t\tlock (locker) {\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockThisInConstructor ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tTestClass()\n\t{\n\t\tlock (this) {\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tTestClass()\n\t{\n\t\tlock (locker) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockThisInDelegate ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tTestClass()\n\t{\n\t\tAction lockThis = delegate ()\n\t\t{\n\t\t\tlock (this) {\n\t\t\t}\n\t\t};\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tTestClass()\n\t{\n\t\tAction lockThis = delegate ()\n\t\t{\n\t\t\tlock (locker) {\n\t\t\t}\n\t\t};\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockThisInLambda ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tTestClass()\n\t{\n\t\tAction lockThis = () =>\n\t\t{\n\t\t\tlock (this) {\n\t\t\t}\n\t\t};\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tTestClass()\n\t{\n\t\tAction lockThis = () =>\n\t\t{\n\t\t\tlock (locker) {\n\t\t\t}\n\t\t};\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockParenthesizedThis ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tlock ((this)) {\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tvoid TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixMultipleLockThis ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tlock (this) {\n\t\t}\n\t}\n\n\tvoid TestMethod2 ()\n\t{\n\t\tlock (this) {\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tvoid TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t}\n\t}\n\n\tvoid TestMethod2 ()\n\t{\n\t\tlock (locker) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 2, output, 0);\n\t\t}\n\t\t[Test]\n\t\tpublic void TestFixMixedLocks ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tlock (this) {\n\t\t}\n\t}\n\n\tobject locker2 = new object ();\n\tvoid TestMethod2 ()\n\t{\n\t\tlock (locker2) {\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\tvoid TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t}\n\t}\n\n\tobject locker2 = new object ();\n\tvoid TestMethod2 ()\n\t{\n\t\tlock (locker2) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockNonThis ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tobject locker = new object ();\n\n\tTestClass()\n\t{\n\t\tlock (locker) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNestedTypeLock ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tclass Nested\n\t{\n\t\tNested()\n\t\t{\n\t\t\tlock (this) {\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tclass Nested\n\t{\n\t\tobject locker = new object ();\n\t\tNested()\n\t\t{\n\t\t\tlock (locker) {\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodSynchronized ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Console.WriteLine (\"\"Foo\"\");\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tobject locker = new object ();\n\tvoid TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tSystem.Console.WriteLine (\"\"Foo\"\");\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodWithSynchronizedValue ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\t[MethodImpl (Value = MethodImplOptions.Synchronized)]\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Console.WriteLine (\"\"Foo\"\");\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tobject locker = new object ();\n\tvoid TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tSystem.Console.WriteLine (\"\"Foo\"\");\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodHasSynchronized ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized | MethodImplOptions.NoInlining)]\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Console.WriteLine (\"\"Foo\"\");\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tobject locker = new object ();\n\t[MethodImpl (MethodImplOptions.NoInlining)]\n\tvoid TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tSystem.Console.WriteLine (\"\"Foo\"\");\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodNotSynchronized ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\t[MethodImpl (MethodImplOptions.NoInlining)]\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Console.WriteLine (\"\"Foo\"\");\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAbstractSynchronized ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic abstract void TestMethod ();\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\tpublic abstract void TestMethod ();\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoubleLocking ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic void TestMethod ()\n\t{\n\t\tlock (this) {\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\tobject locker = new object ();\n\tpublic void TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tlock (locker) {\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 2, output, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDelegateLocking ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic void TestMethod ()\n\t{\n\t\tAction action = delegate {\n\t\t\tlock (this) {\n\t\t\t}\n\t\t};\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\tobject locker = new object ();\n\tpublic void TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tAction action = delegate {\n\t\t\t\tlock (locker) {\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 2, output, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaLocking ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic void TestMethod ()\n\t{\n\t\tAction action = () => {\n\t\t\tlock (this) {\n\t\t\t}\n\t\t};\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nabstract class TestClass\n{\n\tobject locker = new object ();\n\tpublic void TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tAction action = () => {\n\t\t\t\tlock (locker) {\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 2, output, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticMethod()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic static void TestMethod ()\n\t{\n\t\tConsole.WriteLine ();\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tstatic object locker = new object ();\n\tpublic static void TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tConsole.WriteLine ();\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticProperty()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tpublic static int TestProperty\n\t{\n\t\t[MethodImpl (MethodImplOptions.Synchronized)]\n\t\tset {\n\t\t\tConsole.WriteLine (value);\n\t\t}\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tstatic object locker = new object ();\n\tpublic static int TestProperty\n\t{\n\t\tset {\n\t\t\tlock (locker) {\n\t\t\t\tConsole.WriteLine (value);\n\t\t\t}\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMixedStaticMethod()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic void TestMethod ()\n\t{\n\t\tConsole.WriteLine ();\n\t}\n\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic static void TestStaticMethod ()\n\t{\n\t\tConsole.WriteLine ();\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tobject locker = new object ();\n\tpublic void TestMethod ()\n\t{\n\t\tlock (locker) {\n\t\t\tConsole.WriteLine ();\n\t\t}\n\t}\n\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic static void TestStaticMethod ()\n\t{\n\t\tConsole.WriteLine ();\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 2, output, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNewNameLock()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tint locker;\n\t[MethodImpl (MethodImplOptions.Synchronized)]\n\tpublic void TestMethod ()\n\t{\n\t\tConsole.WriteLine ();\n\t}\n}\";\n\n\t\t\tvar output = @\"\nusing System.Runtime.CompilerServices;\nclass TestClass\n{\n\tint locker;\n\tobject locker1 = new object ();\n\tpublic void TestMethod ()\n\t{\n\t\tlock (locker1) {\n\t\t\tConsole.WriteLine ();\n\t\t}\n\t}\n}\";\n\n\t\t\tTest<LockThisIssue> (input, 1, output);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/LongLiteralEndingLowerLIssueTests.cs",
    "content": "// \n// LowercaseLongLiteralSuffixTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class LongLiteralEndingLowerLIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestNormal()\n\t\t{\n\t\t\tTest<LongLiteralEndingLowerLIssue>(@\"\nclass Test\n{\n\tpublic long x = 3l;\n}\", @\"\nclass Test\n{\n\tpublic long x = 3L;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForUnsignedFirst()\n\t\t{\n\t\t\tTest<LongLiteralEndingLowerLIssue>(@\"\nclass Test\n{\n\tpublic ulong x = 3ul;\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnsigned()\n\t\t{\n\t\t\tTest<LongLiteralEndingLowerLIssue>(@\"\nclass Test\n{\n\tpublic ulong x = 3lu;\n}\", @\"\nclass Test\n{\n\tpublic ulong x = 3LU;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForUppercase()\n\t\t{\n\t\t\tTest<LongLiteralEndingLowerLIssue>(@\"\nclass Test\n{\n\tpublic long x = 3L;\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForString()\n\t\t{\n\t\t\tTest<LongLiteralEndingLowerLIssue>(@\"\nclass Test\n{\n\tpublic string x = \"\"l\"\";\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<LongLiteralEndingLowerLIssue>(@\"\nclass Test\n{\n\t// ReSharper disable once LongLiteralEndingLowerL\n\tpublic long x = 3l;\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/LoopCanBeConvertedToQueryIssueTests.cs",
    "content": "//\n// LoopCanBeConvertedToQueryIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[Ignore]\n\t[TestFixture]\n\tpublic class LoopCanBeConvertedToQueryIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCount()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint count = 0;\n\t\tforeach (var x in i)\n\t\t\tcount++;\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint sum = i.Count ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCountCase2()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint count = 1;\n\t\tforeach (var x in i)\n\t\t\tcount = count + 1;\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint sum = 1 + i.Count ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCountPredicate()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint count = 0;\n\t\tforeach (var x in i)\n\t\t\tif (x < 10)\n\t\t\t\tcount++;\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint sum = 1 + i.Count (x => x < 10);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeachSum()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint sum = 0;\n\t\tforeach (var j in i) {\n\t\t\tsum += j;\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint sum = i.Sum ();\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestForSum()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint sum = 0;\n\t\tfor (int j = 0; j < i.Length; j++)\n\t\t\tsum += i [j];\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint sum = i.Sum ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForBinaryExpression()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint mult = 1;\n\t\tfor (int j = 0; j < i.Length; j++) {\n\t\t\tmult = mult * i[j];\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint mult = i.Aggregate (1, (current, t) => current*t);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMaxCase1()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = 0;\n\t\tforeach (var x in i) {\n\t\t\tmax = Math.Max (max, x);\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = i.Concat (new[] {0}).Max ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMaxCase2()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = 0;\n\t\tforeach (var x in i) {\n\t\t\tmax = Math.Max (x, max);\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = i.Concat (new[] {0}).Max ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMaxCase3()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = 0;\n\t\tforeach (var x in i) {\n\t\t\tmax = x > max ? x : max;\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = i.Concat (new[] {0}).Max ();\n\t}\n}\n\");\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = 0;\n\t\tforeach (var x in i) {\n\t\t\tmax = x >= max ? x : max;\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = i.Concat (new[] {0}).Max ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMaxCase4()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = 0;\n\t\tforeach (var x in i) {\n\t\t\tmax = x < max ? max : x;\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = i.Concat (new[] {0}).Max ();\n\t}\n}\n\");\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = 0;\n\t\tforeach (var x in i) {\n\t\t\tmax = x <= max ? max : x;\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = i.Concat (new[] {0}).Max ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMinCase1()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = 0;\n\t\tforeach (var x in i) {\n\t\t\tmax = Math.Min (max, x);\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tint max = i.Concat (new[] {0}).Min ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCastMatch()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tList<Bar> list = new List<Bar>();\n\t\tforeach (var x in i) {\n\t\t\tlist.Add((Bar)x);\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tList<Bar> list = i.Cast<Bar> ().ToList ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOfTypeMatch()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tList<Bar> list = new List<Bar>();\n\t\tforeach (var x in i) {\n\t\t\tif (x is Bar)\n\t\t\t\tlist.Add((Bar)x);\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tList<Bar> list = i.OfType<Bar> ().ToList ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFirstOrDefault()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tobject first = null;\n\t\tforeach (var x in i){\n\t\t\tfirst = x;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tobject first = i.FirstOrDefault ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLastOrDefault()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tobject last = null;\n\t\tforeach (var x in i){\n\t\t\tlast = x;\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (object[] i)\n\t{\n\t\tobject last = i.LastOrDefault ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo(int[] i)\n\t{\n\t\tint sum = 0;\n\t\t// ReSharper disable once LoopCanBeConvertedToQuery\n\t\tforeach (var j in i) {\n\t\t\tsum += j;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/MemberCanBeMadeStaticIssueTests.cs",
    "content": "//\n// ConvertToStaticMethodIssue.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class MemberCanBeMadeStaticIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestPrivateMethod()\n\t\t{\n\t\t\tTestWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"class TestClass\n{\n\tvoid $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tstatic void Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\", CommonSubIssues.PrivateMember\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPrivateMethodPublicSkip()\n\t\t{\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"class TestClass\n{\n\tvoid $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\", CommonSubIssues.NonPrivateMember\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPublicMethod()\n\t\t{\n\t\t\tTestWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"class TestClass\n{\n\tpublic void $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tpublic static void Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\", CommonSubIssues.NonPrivateMember\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPublicMethodSkip()\n\t\t{\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"class TestClass\n{\n\tpublic void $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\", CommonSubIssues.PrivateMember\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodThatCallsInstanceMethodOnParameter()\n\t\t{\n\t\t\tTestWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"class TestClass\n{\n\tstring $Test (string txt)\n\t{\n\t\treturn txt.Trim ();\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tstatic string Test (string txt)\n\t{\n\t\treturn txt.Trim ();\n\t}\n}\", CommonSubIssues.PrivateMember\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithVirtualFunction()\n\t\t{\n\t\t\t\n\t\t\tvar input = @\"class TestClass\n{\n\tpublic virtual void $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.PrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithInterfaceImplementation()\n\t\t{\n\t\t\tvar input = @\"interface IBase {\n    void Test();\n}\nclass TestClass : IBase\n{\n\tpublic void $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.NonPrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithStaticFunction()\n\t\t{\n\n\t\t\tvar input = @\"class TestClass\n{\n\tstatic void $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.PrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotWarnOnAttributes()\n\t\t{\n\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\t[Obsolete]\n\tpublic void $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.NonPrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotWarnOnEmptyMethod()\n\t\t{\n\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\tpublic void $Test ()\n\t{\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.NonPrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotWarnOnInterfaceMethod()\n\t\t{\n\n\t\t\tvar input = @\"using System;\ninterface ITestInterface\n{\n\tvoid $Test ();\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.PrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotWarnOnNotImplementedMethod()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\tpublic void $Test ()\n\t{\n\t\tthrow new NotImplementedExceptionIssue();\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.NonPrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyAccess()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\tpublic int Foo { get; set; }\n\tpublic void $Test ()\n\t{\n\t\tSystem.Console.WriteLine (Foo);\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.NonPrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoNotWarnOnMarshalByRefObject()\n\t\t{\n\t\t\t\n\t\t\tvar input = @\"class TestClass : System.MarshalByRefObject\n{\n\tpublic void $Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(input, CommonSubIssues.NonPrivateMember);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestProperty()\n\t\t{\n\t\t\tTestWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"class TestClass\n{\n\tint Test {\n\t\tget {\n\t\t\treturn 2;\n\t\t}\n\t}\n}\",\n\t\t\t\t@\"class TestClass\n{\n\tstatic int Test {\n\t\tget {\n\t\t\treturn 2;\n\t\t}\n\t}\n}\", CommonSubIssues.PrivateMember\n\t\t\t);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCustomEvent()\n\t\t{\n\t\t\tTestWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"using System;\n\nclass TestClass\n{\n\tstatic event EventHandler Foo;\n\n\tevent EventHandler Bar {\n\t\tadd { Foo += value; }\n\t\tremove { Foo -= value; }\n\t}\n}\",\n\t\t\t\t@\"using System;\n\nclass TestClass\n{\n\tstatic event EventHandler Foo;\n\n\tstatic event EventHandler Bar {\n\t\tadd { Foo += value; }\n\t\tremove { Foo -= value; }\n\t}\n}\", CommonSubIssues.PrivateMember\n\t\t\t\t);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestCustomEventOnNotImplemented()\n\t\t{\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"using System;\n\nclass TestClass\n{\n\tstatic event EventHandler Foo;\n\n\tevent EventHandler Bar {\n\t\tadd { throw new NotImplementedException (); }\n\t\tremove { throw new NotImplementedException (); }\n\t}\n}\", CommonSubIssues.PrivateMember\n\t\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContextWithSubIssue<MemberCanBeMadeStaticIssue>(\n\t\t\t\t@\"class TestClass\n{\n// ReSharper disable once MemberCanBeMadeStatic.Local\n\tvoid Test ()\n\t{\n\t\tint a = 2;\n\t}\n}\", CommonSubIssues.PrivateMember);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/MemberHidesStaticFromOuterClassIssueTests.cs",
    "content": "//\n// MemberHidesStaticFromOuterClassIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class MemberHidesStaticFromOuterClassIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTestIssue<MemberHidesStaticFromOuterClassIssue>(@\"\npublic class Foo\n{\n\tpublic class Bar\n\t{\n\t\tpublic string Test { get; set; }\n\t}\n\n\tpublic static string Test { get; set; }\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<MemberHidesStaticFromOuterClassIssue>(@\"\npublic class Foo\n{\n\tpublic class Bar\n\t{\n\t\t// ReSharper disable once MemberHidesStaticFromOuterClass\n\t\tpublic string Test { get; set; }\n\t}\n\n\tpublic static string Test { get; set; }\n}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/MethodOverloadWithOptionalParameterIssueTests.cs",
    "content": "//\n// MethodOverloadWithOptionalParameterIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class MethodOverloadWithOptionalParameterIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSingleMethod ()\n\t\t{\n\t\t\tTestIssue<MethodOverloadWithOptionalParameterIssue>(@\"\nusing System;\n\npublic class FooBar\n{\n\tpublic void Print(string message)\n\t{\n\t\tConsole.WriteLine(message);\n\t}\n\n\tprivate void Print(string message, string messageDelimiter = \"\"===\"\")\n\t{\n\t\tConsole.WriteLine(message + messageDelimiter);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTwoParameters ()\n\t\t{\n\t\t\tTestIssue<MethodOverloadWithOptionalParameterIssue>(@\"\nusing System;\n\npublic class FooBar\n{\n    public void Print(string message)\n    {\n        Console.WriteLine(message);\n    }\n\n    public void Print(string message, string str2)\n    {\n        Console.WriteLine(message);\n    }\n\n    private void Print(string message, string messageDelimiter = \"\"===\"\", string secondmessage = \"\"===\"\")\n\t{\n\t\tConsole.WriteLine(message + messageDelimiter);\n\t}\n}\", 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexer ()\n\t\t{\n\t\t\tTestIssue<MethodOverloadWithOptionalParameterIssue>(@\"\nusing System;\n\npublic class FooBar\n{\n\tpublic string this[string message]\n\t{\n\t\tget { return message; }\n\t}\n\n\tprivate string this[string message, string messageDelimiter = \"\"===\"\"]\n\t{\n\t\tget { return message + messageDelimiter; }\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<MethodOverloadWithOptionalParameterIssue>(@\"\nusing System;\n\npublic class FooBar\n{\n\tpublic void Print(string message)\n\t{\n\t\tConsole.WriteLine(message);\n\t}\n\n\t// ReSharper disable once MethodOverloadWithOptionalParameter\n\tprivate void Print(string message, string messageDelimiter = \"\"===\"\")\n\t{\n\t\tConsole.WriteLine(message + messageDelimiter);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int a)\n\t{ }\n\tvoid TestMethod (int a, int b = 1)\n\t{ }\n}\";\n\t\t\tTest<MethodOverloadWithOptionalParameterIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Test2 ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int b)\n\t{ }\n\tvoid TestMethod (int a, int b = 1, int c = 1)\n\t{ }\n}\";\n\t\t\tTest<MethodOverloadWithOptionalParameterIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int a, int b = 1, int c = 1)\n\t{ }\n}\";\n\t\t\tTest<MethodOverloadWithOptionalParameterIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue_Generics ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (object obj) { }\n\tvoid TestMethod<T> (object obj, int arg = 0) { }\n}\";\n\t\t\tTest<MethodOverloadWithOptionalParameterIssue> (input, 0);\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/MissingInterfaceMemberImplementationIssueTests.cs",
    "content": "//\n// MissingInterfaceMemberImplementationIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class MissingInterfaceMemberImplementationIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestUnimplementedInterface ()\n\t\t{\n\t\t\tTestIssue<MissingInterfaceMemberImplementationIssue>(@\"\ninterface IF\n{\n\tvoid Foo();\n}\n\nclass Test : IF\n{\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPartiallyImplementedInterface ()\n\t\t{\n\t\t\tTestIssue<MissingInterfaceMemberImplementationIssue>(@\"\ninterface IF\n{\n\tvoid Foo();\n\tvoid Foo2();\n}\n\nclass Test : IF\n{\n\tpublic void Foo()\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiple ()\n\t\t{\n\t\t\tTestIssue<MissingInterfaceMemberImplementationIssue>(@\"\ninterface IF\n{\n\tvoid Foo();\n}\n\ninterface IB\n{\n\tvoid Bar();\n\tvoid Bar2();\n}\n\n\nclass Test : IF, IB\n{\n\tpublic void Bar()\n\t{\n\t}\n}\n\", 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestImplementedInterface ()\n\t\t{\n\t\t\tTestWrongContext<MissingInterfaceMemberImplementationIssue>(@\"\ninterface IF\n{\n\tvoid Foo();\n}\n\nclass Test : IF\n{\n\tpublic void Foo()\n\t{\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInterfaceInheritance ()\n\t\t{\n\t\t\tTestWrongContext<MissingInterfaceMemberImplementationIssue>(@\"\n\tpublic interface IService\n\t{\n\t\tstring ServiceName { get; }\n\t}\n\n\tpublic interface IExtensionService : IService\n\t{\n\t\tvoid Initialize ();\n\t}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 14944 - Incorrect issue context for Interface not implemented \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14944 ()\n\t\t{\n\t\t\tTestWrongContext<MissingInterfaceMemberImplementationIssue>(@\"\nusing System.Collections;\nusing System.Collections.Generic;\nusing System;\n\nabstract class Test<T> : IEnumerable, IEnumerable<T>\n{\n\t#region IEnumerable implementation\n\n\tpublic IEnumerator<T> GetEnumerator ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\n\t#endregion\n\n\t#region IEnumerable implementation\n\n\tIEnumerator IEnumerable.GetEnumerator ()\n\t{\n\t\tthrow new NotImplementedException ();\n\t}\n\t#endregion\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAlreadyImplementedByInheritance ()\n\t\t{\n\t\t\tTestWrongContext<MissingInterfaceMemberImplementationIssue>(@\"\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\n\npublic abstract class FooBase<T> : IEnumerable, IEnumerable<T>\n{\n\tpublic IEnumerator<T> GetEnumerator ()\n\t{\n\t\treturn null;\n\t}\n\n\tIEnumerator IEnumerable.GetEnumerator ()\n\t{\n\t\treturn null;\n\t}\n}\n\npublic class Foo<T> : FooBase<T>, IEnumerable, IEnumerable<T>\n{\n}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/NegativeRelationalExpressionIssueTests.cs",
    "content": "﻿// \n// NegativeRelationalExpressionIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class NegativeRelationalExpressionIssueTests : InspectionActionTestBase\n\t{\n\n\t\tpublic void Test (string op, string negatedOp)\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = !(1 \" + op + @\" 2);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = 1 \" + negatedOp + @\" 2;\n\t}\n}\";\n\t\t\tTest<NegativeRelationalExpressionIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEquality ()\n\t\t{\n\t\t\tTest (\"==\", \"!=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInEquality ()\n\t\t{\n\t\t\tTest (\"!=\", \"==\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGreaterThan ()\n\t\t{\n\t\t\tTest (\">\", \"<=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGreaterThanOrEqual ()\n\t\t{\n\t\t\tTest (\">=\", \"<\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLessThan ()\n\t\t{\n\t\t\tTest (\"<\", \">=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLessThanOrEqual ()\n\t\t{\n\t\t\tTest (\"<=\", \">\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFloatingPoint ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (double d)\n\t{\n\t\tvar x = !(d > 0.1);\n\t}\n}\";\n\t\t\tTest<NegativeRelationalExpressionIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestFloatingPointEquality ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (double d)\n\t{\n\t\tvar x = !(d == 0.1);\n\t}\n}\";\n\t\t\tTest<NegativeRelationalExpressionIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUserDefinedOperator ()\n\t\t{\n\t\t\tvar input = @\"\nstruct LineChangeInfo\n{\n\tpublic static bool operator ==(LineChangeInfo lhs, LineChangeInfo rhs)\n\t{\n\t\treturn lhs.Equals(rhs);\n\t}\n\t\n\tpublic static bool operator !=(LineChangeInfo lhs, LineChangeInfo rhs)\n\t{\n\t\treturn !(lhs == rhs);\n\t}\n}\";\n\t\t\tTest<NegativeRelationalExpressionIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (bool a, bool b)\n\t{\n\t\tvar x = !(a || b);\n\t}\n}\";\n\t\t\tTestWrongContext<NegativeRelationalExpressionIssue> (input);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/NonPublicMethodWithTestAttributeIssueTests.cs",
    "content": "//\n// NonPublicMethodWithTestAttributeIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class NonPublicMethodWithTestAttributeIssueTests : InspectionActionTestBase\n\t{\n\t\tconst string NUnitClasses = @\"using System;\nusing NUnit.Framework;\n\nnamespace NUnit.Framework {\n\tpublic class TestFixtureAttribute : System.Attribute {}\n\tpublic class TestAttribute : System.Attribute {}\n}\";\n\n\t\t[Test]\n\t\tpublic void TestImplicitPrivate()\n\t\t{\n\t\t\tvar input = NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t[Test]\n\tvoid NonPublicMethod ()\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new NonPublicMethodWithTestAttributeIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix(context, issues, NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t[Test]\n\tpublic void NonPublicMethod ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExplictPrivate()\n\t\t{\n\t\t\tvar input = NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t[Test]\n\tprivate void NonPublicMethod ()\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new NonPublicMethodWithTestAttributeIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix(context, issues, NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t[Test]\n\tpublic void NonPublicMethod ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExplictProtected()\n\t\t{\n\t\t\tvar input = NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t[Test]\n\tprotected void NonPublicMethod ()\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new NonPublicMethodWithTestAttributeIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix(context, issues, NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t[Test]\n\tpublic void NonPublicMethod ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t// ReSharper disable once NUnit.NonPublicMethodWithTestAttribute\n\t[Test]\n\tvoid NonPublicMethod ()\n\t{\n\t}\n}\n\";\n\t\t\tTestWrongContext<NonPublicMethodWithTestAttributeIssue>(input);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisableAll()\n\t\t{\n\t\t\tvar input = NUnitClasses + \n\t\t\t\t@\"\n[TextFixture]\nclass Tests \n{\n\t// ReSharper disable All\n\t[Test]\n\tvoid NonPublicMethod ()\n\t{\n\t}\n\t// ReSharper restore All\n}\n\";\n\t\t\tTestWrongContext<NonPublicMethodWithTestAttributeIssue>(input);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/NonReadonlyReferencedInGetHashCodeTests.cs",
    "content": "// \n// NonReadonlyReferencedInGetHashCodeTetsts.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class NonReadonlyReferencedInGetHashCodeTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;\npublic class TestClass1\n{\n\tpublic int a = 1;\n}\n\npublic class TestClass2\n{\n\tpublic override int GetHashCode()\n\t{\n\t\tTestClass1 c = new TestClass1();\n\t\tint b = 1;\n\t\tb++;\n\t\treturn c.a;\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;\npublic class TestClass1\n{\n\tpublic int a = 1;\n}\n\npublic class TestClass2\n{\n\tprivate int b;\n\tpublic override int GetHashCode()\n\t{\n\t\tTestClass1 c = new TestClass1();\n\t\tb++;\n\t\treturn c.a;\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"using System;\npublic class TestClass1\n{\n\tpublic int a = 1;\n}\n\npublic class TestClass2\n{\n\tpublic override int GetHashCode()\n\t{\n\t\tTestClass1 c = new TestClass1();\n\t\tint b = 1;\n\t\tb++;\n\t\treturn c.GetHashCode();\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase4()\n\t\t{\n\t\t\tvar input = @\"public class Test1\n{\n\tpublic int a = 1;\n}\n\npublic class Test2\n{\n\tprivate int q;\n\tpublic Test1 r;\n\tpublic override int GetHashCode()\n\t{\n\t\tTest1 c = new Test1();\n\t\tq = 1 + q + r.a;\n\t\treturn c.a;\n\t}\n}\n\n\npublic class Test3\n{\n\tprivate int q;\n\tpublic Test2 r;\n\tpublic override int GetHashCode()\n\t{\n\t\tTest1 c = new Test1();\n\t\tc.GetHashCode();\n\t\tq = 1 + q + r.r.a;\n\t\treturn c.a;\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(11, issues.Count);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace resharper_test\n{\n\tclass Foo\n\t{\n\t\tprivate readonly int fooval;\n\t\tprivate int tmpval;\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tint a = 6;\n//Resharper disable NonReadonlyReferencedInGetHashCode\n\t\t\ttmpval = a + 3;\n//Resharper restore NonReadonlyReferencedInGetHashCode\n\t\t\ta = tmpval + 5;\n\t\t\treturn fooval;\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestConst()\n\t\t{\n\t\t\tTestWrongContext<NonReadonlyReferencedInGetHashCodeIssue>(@\"using System;\npublic class TestClass1\n{\n\tpublic const int a = 1;\n\t\n\tpublic override int GetHashCode()\n\t{\n\t\treturn a;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReadOnly()\n\t\t{\n\t\t\tTestWrongContext<NonReadonlyReferencedInGetHashCodeIssue>(@\"using System;\npublic class TestClass1\n{\n\tpublic readonly int a = 1;\n\t\n\tpublic override int GetHashCode()\n\t{\n\t\treturn a;\n\t}\n}\n\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/NonReadonlyReferencedInGetHashCodeTetsts.cs",
    "content": "// \n// NonReadonlyReferencedInGetHashCodeTetsts.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class NonReadonlyReferencedInGetHashCodeTetsts : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;\npublic class TestClass1\n{\n\tpublic int a = 1;\n}\n\npublic class TestClass2\n{\n\tpublic override int GetHashCode()\n\t{\n\t\tTestClass1 c = new TestClass1();\n\t\tint b = 1;\n\t\tb++;\n\t\treturn c.a;\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;\npublic class TestClass1\n{\n\tpublic int a = 1;\n}\n\npublic class TestClass2\n{\n\tprivate int b;\n\tpublic override int GetHashCode()\n\t{\n\t\tTestClass1 c = new TestClass1();\n\t\tb++;\n\t\treturn c.a;\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"using System;\npublic class TestClass1\n{\n\tpublic int a = 1;\n}\n\npublic class TestClass2\n{\n\tpublic override int GetHashCode()\n\t{\n\t\tTestClass1 c = new TestClass1();\n\t\tint b = 1;\n\t\tb++;\n\t\treturn c.GetHashCode();\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase4()\n\t\t{\n\t\t\tvar input = @\"public class Test1\n{\n\tpublic int a = 1;\n}\n\npublic class Test2\n{\n\tprivate int q;\n\tpublic Test1 r;\n\tpublic override int GetHashCode()\n\t{\n\t\tTest1 c = new Test1();\n\t\tq = 1 + q + r.a;\n\t\treturn c.a;\n\t}\n}\n\n\npublic class Test3\n{\n\tprivate int q;\n\tpublic Test2 r;\n\tpublic override int GetHashCode()\n\t{\n\t\tTest1 c = new Test1();\n\t\tc.GetHashCode();\n\t\tq = 1 + q + r.r.a;\n\t\treturn c.a;\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(11, issues.Count);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace resharper_test\n{\n\tclass Foo\n\t{\n\t\tprivate readonly int fooval;\n\t\tprivate int tmpval;\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tint a = 6;\n//Resharper disable NonReadonlyReferencedInGetHashCode\n\t\t\ttmpval = a + 3;\n//Resharper restore NonReadonlyReferencedInGetHashCode\n\t\t\ta = tmpval + 5;\n\t\t\treturn fooval;\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new NonReadonlyReferencedInGetHashCodeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/NotImplementedExceptionInspectorTests.cs",
    "content": "// \n// NotImplementedExceptionInspectorTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class NotImplementedExceptionInspectorTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tthrow new System.NotImplementedException ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new NotImplementedExceptionIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/NotResolvedInTextIssueTests.cs",
    "content": "//\n// IncorrectExceptionParametersOrderingTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class NotResolvedInTextIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBadExamples()\n\t\t{\n\t\t\tTestIssue<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F()\n\t{\n\t\tthrow new ArgumentNullException (\"\"The parameter 'blah' can not be null\"\", \"\"blah\"\");\n\t\tthrow new ArgumentException (\"\"blah\"\", \"\"The parameter 'blah' can not be null\"\");\n\t\tthrow new ArgumentOutOfRangeException (\"\"The parameter 'blah' can not be null\"\", \"\"blah\"\");\n\t\tthrow new DuplicateWaitObjectException (\"\"The parameter 'blah' can not be null\"\", \"\"blah\"\");\n\t}\n}\", 4);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentNullExceptionSwap()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentNullException (\"\"bar\"\", \"\"foo\"\");\n\t}\n}\", 2, @\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentNullException (\"\"foo\"\", \"\"bar\"\");\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentExceptionSwap()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentException (\"\"foo\"\", \"\"bar\"\");\n\t}\n}\", 2, @\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentException (\"\"bar\"\", \"\"foo\"\");\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentOutOfRangeExceptionSwap()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentOutOfRangeException (\"\"bar\"\", \"\"foo\"\");\n\t}\n}\", 2, @\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentOutOfRangeException (\"\"foo\"\", \"\"bar\"\");\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentOutOfRangeExceptionSwapCase2()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentOutOfRangeException (\"\"bar\"\", 3, \"\"foo\"\");\n\t}\n}\", 2, @\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new ArgumentOutOfRangeException (\"\"foo\"\", 3, \"\"bar\"\");\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDuplicateWaitObjectExceptionSwap()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new DuplicateWaitObjectException (\"\"bar\"\", \"\"foo\"\");\n\t}\n}\", 2, @\"\nusing System;\nclass A\n{\n\tvoid F(int foo)\n\t{\n\t\tthrow new DuplicateWaitObjectException (\"\"foo\"\", \"\"bar\"\");\n\t}\n}\", 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInvalidArgumentException()\n\t\t{\n\t\t\tTestWrongContext<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentException (\"\"bar\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentExceptionGuessing()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentException (\"\"bar\"\", \"\"bar\"\");\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentException (\"\"bar\"\", \"\"foo\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentExceptionGuessingCase2()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentException (\"\"bar\"\", \"\"bar\"\", new Exception ());\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentException (\"\"bar\"\", \"\"foo\"\", new Exception ());\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentNullGuessing()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentNullException (\"\"bar\"\");\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentNullException (\"\"foo\"\");\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentNullGuessingResolve2()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentNullException (\"\"bar\"\");\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentNullException (\"\"foo\"\", \"\"bar\"\");\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentNullGuessingCase2()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentNullException (\"\"bar\"\", \"\"test\"\");\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentNullException (\"\"foo\"\", \"\"test\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentOutOfRangeExceptionGuessing()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (int foo, int bar)\n\t{\n\t\tif (foo < 0 || foo > 10)\n\t\t\tthrow new ArgumentOutOfRangeException (\"\"foobar\"\", \"\"foobar\"\");\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tvoid F (int foo, int bar)\n\t{\n\t\tif (foo < 0 || foo > 10)\n\t\t\tthrow new ArgumentOutOfRangeException (\"\"foo\"\", \"\"foobar\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArgumentOutOfRangeExceptionGuessingCase2()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentOutOfRangeException (\"\"bar\"\", null, \"\"bar\"\");\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tvoid F (object foo)\n\t{\n\t\tif (foo != null)\n\t\t\tthrow new ArgumentOutOfRangeException (\"\"foo\"\", null, \"\"bar\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorValidCase()\n\t\t{\n\t\t\tTestWrongContext<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tpublic A(BaseRefactoringContext context, Statement rootStatement, IEnumerable<ParameterDeclaration> parameters, CancellationToken cancellationToken)\n\t{\n\t\tif (rootStatement == null)\n\t\t\tthrow new ArgumentNullException(\"\"rootStatement\"\");\n\t\tif (context == null)\n\t\t\tthrow new ArgumentNullException(\"\"context\"\");\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15039 - source analysis can't resolve 'value' in property setter \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15039()\n\t\t{\n\t\t\tTestWrongContext<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tpublic string Foo {\n\t\tget {}\n\t\tset {\n\t\t\tif (value == null)\n\t\t\t\tthrow new ArgumentNullException(\"\"value\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValue()\n\t\t{\n\t\t\tTest<NotResolvedInTextIssue>(@\"\nusing System;\nclass A\n{\n\tpublic string Foo {\n\t\tget {}\n\t\tset {\n\t\t\tif (value == null)\n\t\t\t\tthrow new ArgumentNullException (\"\"val\"\");\n\t\t}\n\t}\n}\", @\"\nusing System;\nclass A\n{\n\tpublic string Foo {\n\t\tget {}\n\t\tset {\n\t\t\tif (value == null)\n\t\t\t\tthrow new ArgumentNullException (\"\"value\"\");\n\t\t}\n\t}\n}\", 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ObjectCreationAsStatementIssueTests.cs",
    "content": "//\n// ObjectCreationAsStatementIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ObjectCreationAsStatementIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTestIssue<ObjectCreationAsStatementIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tnew Foo ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tTestWrongContext<ObjectCreationAsStatementIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tSystem.Console.WriteLine (new Foo ());\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ObjectCreationAsStatementIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\t// ReSharper disable once ObjectCreationAsStatement\n\t\tnew Foo ();\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/OperatorIsCanBeUsedIssueTests.cs",
    "content": "// \n// ReplaceWithIsOperatorTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class OperatorIsCanBeUsedIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tint a = 1;\n\t\t\tif (typeof (int) == a.GetType()){}}}}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new OperatorIsCanBeUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\t\n\t\t\tCheckFix(context, issues, @\"\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tint a = 1;\n\t\t\tif (a is int) {\n\t\t\t}}}}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tint a = 1;\n\t\t\tif (a.GetType() == typeof (int)){}}}}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new OperatorIsCanBeUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\tCheckFix(context, issues, @\"\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tint a = 1;\n\t\t\tif (a is int) {\n\t\t\t}}}}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tstatic public int a;\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\tif (BaseClass.a.GetType() == typeof (int)){}}}}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new OperatorIsCanBeUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\t\n\t\t\tCheckFix(context, issues, @\"\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tstatic public int a;\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tif (BaseClass.a is int) {\n\t\t\t}}}}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase4()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic sealed class TestClass\n\t{\n\t}\n\tpublic class BaseClass \n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tBaseClass b = new BaseClass();if (typeof (TestClass) == b.GetType()){}}}}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new OperatorIsCanBeUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\tCheckFix(context, issues, @\"\nusing System;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic sealed class TestClass\n\t{\n\t}\n\tpublic class BaseClass \n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tBaseClass b = new BaseClass();\n\t\t\tif (b is TestClass) {\n\t\t\t}}}}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase5()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class TestClass\n\t{\n\t}\n\tpublic class BaseClass : TestClass\n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tBaseClass b = new BaseClass();\n\t\t\tif ((typeof (TestClass) == b.GetType()))\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new OperatorIsCanBeUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisable()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic static void main(string[] args)\n\t\t{\n\t\t\tint a = 1;\n//Resharper disable OperatorIsCanBeUsed\n\t\t\tif ((typeof (int) == a.GetType()))\n\t\t\t{\n\n\t\t\t}\n//Resharper restore OperatorIsCanBeUsed\n\t\t}\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new OperatorIsCanBeUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/OptionalParameterHierarchyMismatchIssueTests.cs",
    "content": "﻿// \n// OptionalParameterValueMismatchTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class OptionalParameterHierarchyMismatchIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\nclass Base\n{\n\tpublic virtual void TestMethod(int value = 1) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(int value = 2) {}\n}\", @\"\nclass Base\n{\n\tpublic virtual void TestMethod(int value = 1) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(int value = 1) {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCase ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\nclass Base\n{\n\tpublic virtual void TestMethod(object value = null) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(object value = null) {}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterface ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\ninterface IBase\n{\n\tvoid TestMethod(int value = 1);\n}\nclass Derived : IBase\n{\n\tpublic void TestMethod(int value = 2) {}\n}\", @\"\ninterface IBase\n{\n\tvoid TestMethod(int value = 1);\n}\nclass Derived : IBase\n{\n\tpublic void TestMethod(int value = 1) {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexer ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\ninterface IBase\n{\n\tint this[int x = 1]\n\t{\n\t\tget;\n\t}\n}\nclass Derived : IBase\n{\n\tpublic int this[int x = 2]\n\t{\n\t\tget;\n\t}\n}\", @\"\ninterface IBase\n{\n\tint this[int x = 1]\n\t{\n\t\tget;\n\t}\n}\nclass Derived : IBase\n{\n\tpublic int this[int x = 1]\n\t{\n\t\tget;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForCorrect ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\ninterface IBase\n{\n\tvoid TestMethod(int value = 1);\n}\nclass Derived : IBase\n{\n\tpublic void TestMethod(int value = 1) {}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddOptional ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\nclass Base\n{\n\tpublic virtual void TestMethod(int value) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(int value = 2) {}\n}\", @\"\nclass Base\n{\n\tpublic virtual void TestMethod(int value) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(int value) {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveOptional ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\nclass Base\n{\n\tpublic virtual void TestMethod(int value = 1) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(int value) {}\n}\", @\"\nclass Base\n{\n\tpublic virtual void TestMethod(int value = 1) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(int value = 1) {}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestTakeDeclarationValue()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\nclass A\n{\n\tpublic virtual void Foo(int a = 1)\n\t{\n\n\t}\n}\n\nclass B : A\n{\n\tpublic override void Foo(int a = 2)\n\t{\n\n\t}\n}\n\nclass C : B\n{\n\tpublic override void Foo(int a = 3)\n\t{\n\n\t}\n}\", 2, @\"\nclass A\n{\n\tpublic virtual void Foo(int a = 1)\n\t{\n\n\t}\n}\n\nclass B : A\n{\n\tpublic override void Foo(int a = 2)\n\t{\n\n\t}\n}\n\nclass C : B\n{\n\tpublic override void Foo(int a = 1)\n\t{\n\n\t}\n}\", 1);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisableForInterfaceMismatch ()\n\t\t{\n\t\t\tTestWrongContext<OptionalParameterHierarchyMismatchIssue>(@\"class A\n{\n    public virtual void Foo(int a = 1)\n    {\n\n    }\n}\n\ninterface IA\n{\n    void Foo(int a = 2);\n}\n\n\nclass B : A, IA\n{\n    public override void Foo(int a = 1)\n    {\n\n    }\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<OptionalParameterHierarchyMismatchIssue>(@\"\nclass Base\n{\n\tpublic virtual void TestMethod(int value = 1) {}\n}\nclass Derived : Base\n{\n\t// ReSharper disable once OptionalParameterHierarchyMismatch\n\tpublic override void TestMethod(int value = 2) {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumValue ()\n\t\t{\n\t\t\tTest<OptionalParameterHierarchyMismatchIssue>(@\"\nenum FooBar { Foo, Bar }\nclass Base\n{\n\tpublic virtual void TestMethod(FooBar value = FooBar.Foo) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(FooBar value) {}\n}\", @\"\nenum FooBar { Foo, Bar }\nclass Base\n{\n\tpublic virtual void TestMethod(FooBar value = FooBar.Foo) {}\n}\nclass Derived : Base\n{\n\tpublic override void TestMethod(FooBar value = FooBar.Foo) {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisableForExplicitInterfaceImplementation ()\n\t\t{\n\t\t\tTestWrongContext<OptionalParameterHierarchyMismatchIssue>(@\"\ninterface IA\n{\n    void Foo(int a = 1);\n}\n\n\nclass B : IA\n{\n    void IA.Foo(int a)\n    {\n    }\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/OptionalParameterRefOutIssueTests.cs",
    "content": "//\n// OptionalParameterRefOutIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class OptionalParameterRefOutIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestRef ()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Runtime.InteropServices;\nclass Bar\n{\n\tpublic void Foo([Optional] ref int test)\n\t{\n\t}\n}\n\";\n\t\t\tICSharpCode.NRefactory.CSharp.CodeActions.TestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new OptionalParameterRefOutIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOut ()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Runtime.InteropServices;\nclass Bar\n{\n\tpublic void Foo([Optional] out int test)\n\t{\n\t}\n}\n\";\n\t\t\tICSharpCode.NRefactory.CSharp.CodeActions.TestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new OptionalParameterRefOutIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<OptionalParameterRefOutIssue>(@\"\nusing System.Runtime.InteropServices;\nclass Bar\n{\n\t// ReSharper disable once OptionalParameterRefOut\n\tpublic void Foo([Optional] ref int test)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ParameterCanBeDemotedIssue/IsTypeCriterionTests.cs",
    "content": "//\n// IsTypeCriterionTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class IsTypeCriterionTests\n\t{\n\t\t[Test]\n\t\tpublic void SameType()\n\t\t{\n\t\t\tIType type = new MockType();\n\t\t\t\n\t\t\tvar criterion = new IsTypeCriterion(type);\n\t\t\tAssert.IsTrue(criterion.SatisfiedBy(type));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InheritedType()\n\t\t{\n\t\t\tIType baseType = new MockType();\n\t\t\tvar type = new MockType() {\n\t\t\t\tBaseTypes = { baseType }\n\t\t\t};\n\t\t\t\n\t\t\tvar criterion = new IsTypeCriterion(baseType);\n\t\t\tAssert.IsTrue(criterion.SatisfiedBy(type));\n\t\t}\n\t}\n\n\tclass MockType : AbstractType\n\t{\n\t\tstring name;\n\n\t\tbool? isReferenceType;\n\n\t\tTypeKind kind;\n\n\t\tpublic MockType(string name = \"\", bool? isReferenceType = false, TypeKind kind = TypeKind.Class)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tthis.isReferenceType = isReferenceType;\n\t\t\tthis.kind = kind;\n\t\t\tBaseTypes = new List<IType>();\n\t\t}\n\n\t\t#region implemented abstract members of ICSharpCode.NRefactory.TypeSystem.Implementation.AbstractType\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool? IsReferenceType {\n\t\t\tget {\n\t\t\t\treturn isReferenceType;\n\t\t\t}\n\t\t}\n\n\t\tpublic override TypeKind Kind {\n\t\t\tget {\n\t\t\t\treturn kind;\n\t\t\t}\n\t\t}\n\n\t\tpublic override ITypeReference ToTypeReference ()\n\t\t{\n\t\t\tthrow new System.NotImplementedException ();\n\t\t}\n\t\t#endregion\n\n\t\t#region convenience overrides\n\n\t\tpublic override IEnumerable<IType> DirectBaseTypes {\n\t\t\tget {\n\t\t\t\treturn BaseTypes;\n\t\t\t}\n\t\t}\n\n\t\tpublic IList<IType> BaseTypes {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t#endregion\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ParameterCanBeDemotedIssue/ParameterCanBeDeclaredWithBaseTypeIssueTests.cs",
    "content": "//\n// ParameterCouldBeDeclaredWithBaseTypeTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ParameterCanBeDeclaredWithBaseTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void BasicTest()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic virtual void Foo() {}\n}\nclass B : A\n{\n\tpublic virtual void Bar() {}\n}\nclass C\n{\n\tvoid F(B b)\n\t{\n\t\tb.Foo();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues [0];\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\n\t\t\tCheckFix(context, issues [0], @\"\nclass A\n{\n\tpublic virtual void Foo() {}\n}\nclass B : A\n{\n\tpublic virtual void Bar() {}\n}\nclass C\n{\n\tvoid F(A b)\n\t{\n\t\tb.Foo();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresUnusedParameters()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tvoid F(A a1)\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresDirectionalParameters()\n\t\t{\n\t\t\tvar input = @\"\ninterface IA\n{\n}\nclass A : IA\n{\n\tvoid F(out A a1)\n\t{\n\t\tobject.Equals(a1, null);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresOverrides()\n\t\t{\n\t\t\tvar input = @\"\ninterface IA\n{\n\tvoid Foo();\n}\nclass B : IA\n{\n\tpublic virtual void Foo() {}\n\tpublic virtual void Bar() {}\n}\nclass TestBase\n{\n\tpublic void F(B b) {\n\t\tb.Foo();\n\t\tb.Bar();\n\t}\n}\nclass TestClass : TestBase\n{\n\tpublic override void F(B b)\n\t{\n\t\tb.Foo();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresOverridables()\n\t\t{\n\t\t\tvar input = @\"\ninterface IA\n{\n\tvoid Foo();\n}\nclass B : IA\n{\n\tpublic virtual void Foo() {}\n\tpublic virtual void Bar() {}\n}\nclass TestClass\n{\n\tpublic virtual void F(B b)\n\t{\n\t\tb.Foo();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void HandlesNeededProperties()\n\t\t{\n\t\t\tvar input = @\"\ninterface IA\n{\n\tvoid Foo(string s);\n}\nclass B : IA\n{\n\tpublic virtual void Foo(string s) {}\n\tpublic string Property { get; }\n}\nclass TestClass\n{\n\tpublic void F(B b)\n\t{\n\t\tb.Foo(b.Property);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InterfaceTest()\n\t\t{\n\t\t\tvar input = @\"\ninterface IA\n{\n\tvoid Foo();\n}\nclass B : IA\n{\n\tpublic virtual void Foo() {}\n\tpublic virtual void Bar() {}\n}\nclass C\n{\n\tvoid F(B b)\n\t{\n\t\tb.Foo();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues [0];\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues [0], @\"\ninterface IA\n{\n\tvoid Foo();\n}\nclass B : IA\n{\n\tpublic virtual void Foo() {}\n\tpublic virtual void Bar() {}\n}\nclass C\n{\n\tvoid F(IA b)\n\t{\n\t\tb.Foo();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void RespectsExpectedTypeInIfStatement()\n\t\t{\n\t\t\tvar input = @\"\nclass C\n{\n\tvoid F (bool b, bool c)\n\t{\n\t\tif (b && c)\n\t\t\treturn;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleInterfaceTest()\n\t\t{\n\t\t\tvar input = @\"\ninterface IA1\n{\n\tvoid Foo();\n}\ninterface IA2\n{\n\tvoid Bar();\n}\nclass B : IA1, IA2\n{\n\tpublic virtual void Foo() {}\n\tpublic virtual void Bar() {}\n}\nclass C : B {}\nclass Test\n{\n\tvoid F(C c)\n\t{\n\t\tc.Foo();\n\t\tc.Bar();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues [0];\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\n\t\t\tCheckFix(context, issues [0], @\"\ninterface IA1\n{\n\tvoid Foo();\n}\ninterface IA2\n{\n\tvoid Bar();\n}\nclass B : IA1, IA2\n{\n\tpublic virtual void Foo() {}\n\tpublic virtual void Bar() {}\n}\nclass C : B {}\nclass Test\n{\n\tvoid F(B c)\n\t{\n\t\tc.Foo();\n\t\tc.Bar();\n\t}\n}\");\n\t\t}\n\n\t\tstring baseInput = @\"\ninterface IA\n{\n\tvoid Foo();\n}\ninterface IB : IA\n{\n\tvoid Bar();\n}\ninterface IC : IA\n{\n\tnew void Foo();\n\tvoid Baz();\n}\nclass D : IB\n{\n\tpublic void Foo() {}\n\tpublic void Bar() {}\n}\nclass E : D, IC\n{\n\tpublic void Baz() {}\n\tvoid IC.Foo() {}\n}\";\n\t\t\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void FindsTopInterface()\n\t\t{\n\t\t\tvar input = baseInput + @\"\nclass Test\n{\n\tvoid F(E e)\n\t{\n\t\te.Foo();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues [0];\n\t\t\tAssert.AreEqual(4, issue.Actions.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues [0], baseInput + @\"\nclass Test\n{\n\tvoid F(IA e)\n\t{\n\t\te.Foo();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotChangeOverload()\n\t\t{\n\t\t\tvar input = baseInput + @\"\nclass Test\n{\n\tvoid F(IB b)\n\t{\n\t\tBar (b);\n\t}\n\t\n\tvoid Bar (IA a)\n\t{\n\t}\n\n\tvoid Bar (IB b)\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssignmentToExplicitlyTypedVariable()\n\t\t{\n\t\t\tvar input = baseInput + @\"\nclass Test\n{\n\tvoid F(IB b)\n\t{\n\t\tIB b2;\n\t\tb2 = b;\n\t\tobject.Equals(b, b2);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethod()\n\t\t{\n\t\t\tvar input = baseInput + @\"\nclass Test\n{\n\tvoid F(IB b)\n\t{\n\t\tGeneric (b);\n\t}\n\n\tvoid Generic<T> (T arg) where T : IA\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void VariableDeclarationWithTypeInference()\n\t\t{\n\t\t\tvar input = baseInput + @\"\nclass Test\n{\n\tvoid Foo (IB b)\n\t{\n\t\tvar b2 = b;\n\t\tFoo (b2);\n\t}\n\n\tvoid Foo (IA a)\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RespectsOutgoingCallsTypeRestrictions()\n\t\t{\n\t\t\tvar input = baseInput + @\"\nclass Test\n{\n\tvoid F(E e)\n\t{\n\t\te.Foo();\n\t\tDemandType(e);\n\t}\n\n\tvoid DemandType(D d)\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues [0];\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues [0], baseInput + @\"\nclass Test\n{\n\tvoid F(D e)\n\t{\n\t\te.Foo();\n\t\tDemandType(e);\n\t}\n\n\tvoid DemandType(D d)\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AccountsForNonInvocationMethodGroupUsageInMethodCall()\n\t\t{\n\t\t\tvar input = @\"\ndelegate void FooDelegate (string s);\ninterface IBase\n{\n\tvoid Bar();\n}\ninterface IDerived : IBase\n{\n\tvoid Foo(string s);\n}\nclass TestClass\n{\n\tpublic void Bar (IDerived derived)\n\t{\n\t\tderived.Bar();\n\t\tBaz (derived.Foo);\n\t}\n\n\tvoid Baz (FooDelegate fd)\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AccountsForNonInvocationMethodGroupUsageInVariableDeclaration()\n\t\t{\n\t\t\tvar input = @\"\ndelegate void FooDelegate (string s);\ninterface IBase\n{\n\tvoid Bar();\n}\ninterface IDerived : IBase\n{\n\tvoid Foo(string s);\n}\nclass TestClass\n{\n\tpublic void Bar (IDerived derived)\n\t{\n\t\tderived.Bar();\n\t\tFooDelegate d = derived.Foo;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AccountsForNonInvocationMethodGroupUsageInAssignmentExpression()\n\t\t{\n\t\t\tvar input = @\"\ndelegate void FooDelegate (string s);\ninterface IBase\n{\n\tvoid Bar();\n}\ninterface IDerived : IBase\n{\n\tvoid Foo(string s);\n}\nclass TestClass\n{\n\tpublic void Bar (IDerived derived)\n\t{\n\t\tderived.Bar();\n\t\tFooDelegate d;\n\t\td = derived.Foo;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void AccountsForIndexers()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Write(string[] s)\n\t{\n\t\tobject.Equals(s, s);\n\t\tvar element = s[1];\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues[0];\n\t\t\t// Suggested types: IList<T> and IReadOnlyList<T>\n\t\t\tAssert.AreEqual(2, issue.Actions.Count);\n\n\t\t\tCheckFix(context, issues [0], @\"\nclass TestClass\n{\n\tvoid Write(System.Collections.Generic.IList<string> s)\n\t{\n\t\tobject.Equals(s, s);\n\t\tvar element = s[1];\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AccountsForArrays()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Write(string[] s)\n\t{\n\t\tvar i = s.Length;\n\t\tSetValue (out s[1]);\n\t}\n\n\tvoid SetValue (out string s)\n\t{\n\t} \n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LimitsParamsParametersToArrays()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Write(params string[] s)\n\t{\n\t\tSystem.Console.WriteLine (s);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestProgramEntryPointChanges()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tif (args.Length > 2) {\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresImplicitInterfaceImplementations()\n\t\t{\n\t\t\tvar input = @\"\ninterface IHasFoo\n{\n\tvoid Foo (string s);\n}\nclass TestClass : IHasFoo\n{\n\tpublic void Foo(string s)\n\t{\n\t\tobject o = s;\n\t} \n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresEnumParameters()\n\t\t{\n\t\t\tvar input = @\"\nenum ApplicableValues\n{\n\tNone,\n\tSome\n}\nclass TestClass\n{\n\tpublic void Foo(ApplicableValues av)\n\t{\n\t\tobject o = av;\n\t} \n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CallToOverriddenMember()\n\t\t{\n\t\t\tvar input = @\"\nclass TestBase\n{\n\tpublic virtual void Foo()\n\t{\n\t}\n}\nclass Test : TestBase\n{\n\tvoid F (Test t)\n\t{\n\t\tt.Foo();\n\t}\n\t\n\tpublic override void Foo()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues[0];\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\t\t\t\n\t\t\tCheckFix(context, issue, @\"\nclass TestBase\n{\n\tpublic virtual void Foo()\n\t{\n\t}\n}\nclass Test : TestBase\n{\n\tvoid F (TestBase t)\n\t{\n\t\tt.Foo();\n\t}\n\t\n\tpublic override void Foo()\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CallToShadowingMember()\n\t\t{\n\t\t\tvar input = @\"\nclass TestBase\n{\n\tpublic virtual void Foo()\n\t{\n\t}\n}\nclass Test : TestBase\n{\n\tvoid F (Test t)\n\t{\n\t\tt.Foo();\n\t}\n\t\n\tpublic new void Foo()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CallToShadowingMember2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestBaseBase\n{\n\tpublic virtual void Foo()\n\t{\n\t}\n}\nclass TestBase : TestBaseBase\n{\n\tprotected virtual new void Foo()\n\t{\n\t}\n}\nclass Test : TestBase\n{\n\tvoid F (Test t)\n\t{\n\t\tt.Foo();\n\t}\n\t\n\tpublic override void Foo()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues[0];\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\t\t\t\n\t\t\tCheckFix(context, issue, @\"\nclass TestBaseBase\n{\n\tpublic virtual void Foo()\n\t{\n\t}\n}\nclass TestBase : TestBaseBase\n{\n\tprotected virtual new void Foo()\n\t{\n\t}\n}\nclass Test : TestBase\n{\n\tvoid F (TestBase t)\n\t{\n\t\tt.Foo();\n\t}\n\t\n\tpublic override void Foo()\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CallToShadowingMemberWithBaseInterface()\n\t\t{\n\t\t\tvar input = @\"\ninterface IFoo\n{\n\tvoid Foo();\n}\nclass TestBaseBase : IFoo\n{\n\tpublic virtual void Foo()\n\t{\n\t}\n}\nclass TestBase : TestBaseBase\n{\n\tprotected virtual new void Foo()\n\t{\n\t}\n}\nclass Test : TestBase\n{\n\tvoid F (Test t)\n\t{\n\t\tt.Foo();\n\t}\n\t\n\tprotected override void Foo()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(false), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues[0];\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\t\t\t\n\t\t\tCheckFix(context, issue, @\"\ninterface IFoo\n{\n\tvoid Foo();\n}\nclass TestBaseBase : IFoo\n{\n\tpublic virtual void Foo()\n\t{\n\t}\n}\nclass TestBase : TestBaseBase\n{\n\tprotected virtual new void Foo()\n\t{\n\t}\n}\nclass Test : TestBase\n{\n\tvoid F (TestBase t)\n\t{\n\t\tt.Foo();\n\t}\n\t\n\tprotected override void Foo()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9617 - Incorrect \"parameter can be demoted to base class\" warning for arrays\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9617()\n\t\t{\n\t\t\tTest<ParameterCanBeDeclaredWithBaseTypeIssue>(@\"class Test\n{\n\tobject Foo (object[] arr)\n\t{\n\t    return arr [0];\n\t}\n}\", 1, @\"class Test\n{\n\tobject Foo (System.Collections.IList arr)\n\t{\n\t    return arr [0];\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug9617Case2()\n\t\t{\n\t\t\tTest<ParameterCanBeDeclaredWithBaseTypeIssue>(@\"class Test\n{\n\tint Foo (int[] arr)\n\t{\n\t    return arr [0];\n\t}\n}\", 1, @\"class Test\n{\n\tint Foo (System.Collections.Generic.IList<int> arr)\n\t{\n\t    return arr [0];\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoNotDemoteStringComparisonToReferenceComparison_WithinLambda()\n\t\t{\n\t\t\tTest<ParameterCanBeDeclaredWithBaseTypeIssue>(@\"using System; using System.Linq; using System.Collections.Generic;\nclass Test\n{\n\tIEnumerable<User> users;\n\tUser GetUser (String id)\n\t{\n\t\treturn users.Where(u => u.Name == id).SingleOrDefault();\n\t}\n}\nclass User {\n\tpublic string Name;\n}\n\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMicrosoftSuppressMessage()\n\t\t{\n\t\t\tvar input = @\"\nclass A\n{\n\tpublic virtual void Foo() {}\n}\nclass B : A\n{\n\tpublic virtual void Bar() {}\n}\nclass C\n{\n\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"\"Microsoft.Design\"\", \"\"CA1011:ConsiderPassingBaseTypesAsParameters\"\")]\n\tvoid F(B b)\n\t{\n\t\tb.Foo();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisableAll()\n\t\t{\n\t\t\tvar input = @\"// ReSharper disable All\n\nclass A\n{\n\tpublic virtual void Foo() {}\n}\nclass B : A\n{\n\tpublic virtual void Bar() {}\n}\nclass C\n{\n\tvoid F(B b)\n\t{\n\t\tb.Foo();\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 14099 - Do not suggest demoting Exception to _Exception\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14099()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\npublic class Test\n{\n\tpublic void Foo (Exception ex)\n\t{\n\t\tSystem.Console.WriteLine (ex.HelpLink);\n\t}\n}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeDeclaredWithBaseTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestPreferGenerics()\n\t\t{\n\t\t\tTestWrongContext<ParameterCanBeDeclaredWithBaseTypeIssue>(@\"using System.Collections.Generic;\n\nclass Test\n{\n\tint Foo (ICollection<object> arr)\n\t{\n\t\treturn arr.Count;\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ParameterCanBeDemotedIssue/ParameterCanBeIEnumerableTests.cs",
    "content": "//\n// ParameterCanBeIEnumerableTests.cs\n//\n// Author:\n//       Ciprian Khlud <ciprian.mustiata@yahoo.com>\n//\n// Copyright (c) 2013 Ciprian Khlud\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ParameterCanBeIEnumerableTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void CheckIEnumerable()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tvoid Write(string[] texts)\n\t{\n\t\tforeach(var item in texts) { }\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ParameterCanBeIEnumerableIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tvar issue = issues[0];\n\t\t\t// Suggested types: IList<T> and IReadOnlyList<T>\n\t\t\tAssert.AreEqual(1, issue.Actions.Count);\n\n            CheckFix(context, issues[0], @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tvoid Write(IEnumerable<string> texts)\n\t{\n\t\tforeach(var item in texts) { }\n\t}\n}\");\n\t\t}\n        [Test]\n        public void CheckIList()\n        {\n            var input = @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tvoid Write(List<string> texts)\n\t{\n        if(texts.Count == 0)return;\n\t\tforeach(var item in texts) { }\n\t}\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ParameterCanBeIEnumerableIssue(), input, out context);\n            Assert.AreEqual(1, issues.Count);\n            var issue = issues[0];\n            // Suggested types: IList<T> and IReadOnlyList<T>\n            Assert.AreEqual(1, issue.Actions.Count);\n\n            CheckFix(context, issues[0], @\"\nusing System.Collections.Generic;\nclass TestClass\n{\n\tvoid Write(ICollection<string> texts)\n\t{\n        if(texts.Count == 0)return;\n\t\tforeach(var item in texts) { }\n\t}\n}\");\n        }\n\n\t\t[Ignore(\"Bug\")]\n\t\t[Test]\n\t\tpublic void TestBug()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nclass TestClass\n{\n\tvoid Write(int x = 34)\n\t{\n\t\tx = 5;\n\t\tConsole.WriteLine (x);\n\t}\n}\";\n\t\t\tTestWrongContext <ParameterCanBeIEnumerableIssue> (input);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ParameterCanBeDemotedIssue/SupportsIndexingCriterionTests.cs",
    "content": "//\n// SupportsIndexingCriterionTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class SupportsIndexingCriterionTests\n\t{\n\t\tITypeResolveContext typeResolveContext;\n\n\t\tIType intType;\n\n\t\tICompilation compilation;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tcompilation = TestRefactoringContext.Create(\"\").Compilation;\n\t\t\ttypeResolveContext = compilation.TypeResolveContext;\n\t\t\tintType = GetIType<int>();\n\t\t}\n\n\t\tIType GetIType<T>()\n\t\t{\n\t\t\treturn typeof(T).ToTypeReference().Resolve(typeResolveContext);\n\t\t}\n\t\t\n\t\tvoid AssertMatches(IType candidateType, IType elementType, bool isWriteAccess, params IType[] indexTypes)\n\t\t{\n\t\t\tvar criterion = new SupportsIndexingCriterion(elementType, indexTypes, CSharpConversions.Get(compilation), isWriteAccess);\n\t\t\tAssert.IsTrue(criterion.SatisfiedBy(candidateType));\n\t\t}\n\t\t\n\t\tvoid AssertDoesNotMatch(IType candidateType, IType elementType, bool isWriteAccess, params IType[] indexTypes)\n\t\t{\n\t\t\tvar criterion = new SupportsIndexingCriterion(elementType, indexTypes, CSharpConversions.Get(compilation), isWriteAccess);\n\t\t\tAssert.IsFalse(criterion.SatisfiedBy(candidateType));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ListWithOneIntegerIndex()\n\t\t{\n\t\t\tvar intListType = GetIType<IList<int>>();\n\t\t\tAssertMatches(intListType, intType, false, intType);\n\t\t\tAssertMatches(intListType, intType, true, intType);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ListWithTwoIntegerIndexes()\n\t\t{\n\t\t\tvar intListType = GetIType<IList<int>>();\n\t\t\tAssertDoesNotMatch(intListType, intType, false, intType, intType);\n\t\t\tAssertDoesNotMatch(intListType, intType, true, intType, intType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ObjectCandidate()\n\t\t{\n\t\t\tAssertDoesNotMatch(GetIType<object>(), intType, false, intType);\n\t\t\tAssertDoesNotMatch(GetIType<object>(), intType, true, intType);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ParameterHidesMemberIssueTests.cs",
    "content": "﻿// \n// ParameterHidesMemberIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ParameterHidesMemberIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i;\n\tvoid TestMethod (int i, int j)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 1);\n\t\t}\n\n        [Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i;\n// ReSharper disable once ParameterHidesMember\n\tvoid TestMethod (int i, int j)\n\t{\n\t}\n}\";\n\t\t\tTestWrongContext<ParameterHidesMemberIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethod ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod2 ()\n\t{ }\n\tvoid TestMethod (int TestMethod2)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i;\n\tpublic TestClass(int i)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStatic ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tstatic int i;\n\tstatic void TestMethod2 (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestStaticNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tstatic int i;\n\tint j;\n\tvoid TestMethod (int i)\n\t{\n\t}\n\tstatic void TestMethod2 (int j)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAccessiblePrivate ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i;\n\n\tvoid Method (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAccessiblePrivateDueToTypeNesting ()\n\t\t{\n\t\t\tvar input = @\"\nclass RootClass\n{\n\tint i;\n\n\tclass NestedClass : RootClass\n\t{\n\t\t// Issue 1\n\t\tvoid Method (int i) {}\n\n\t\tclass NestedNestedClass : NestedClass\n\t\t{\n\t\t\t// Issue 2\n\t\t\tvoid OtherMethod (int i) {}\n\t\t}\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInternalAccessibility ()\n\t\t{\n\t\t\tvar input = @\"\nclass BaseClass\n{\n\tinternal int i;\n}\nclass TestClass : BaseClass\n{\n\tvoid Method (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInaccessiblePrivate ()\n\t\t{\n\t\t\tvar input = @\"\nclass BaseClass\n{\n\tprivate int i;\n}\nclass TestClass : BaseClass\n{\n\tvoid Method (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIgnorePublicMethods ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tprivate int i;\n\n\tpublic void SetI (int i) { this.i = i; }\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIgnoreAbstractMethods ()\n\t\t{\n\t\t\tvar input = @\"\nabstract class TestClass\n{\n\tprivate int i;\n\n\tpublic abstract void Method (int i);\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIgnoreOverridenMethods ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tprivate int i;\n\n\tprotected override void Method (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIgnoreInterfaceImplementations ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITest {\n\tvoid Method (int i);\n}\n\nclass TestClass : ITest \n{\n\tprivate int i;\n\n\tvoid ITest.Method (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<ParameterHidesMemberIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ParameterOnlyAssignedIssueTests.cs",
    "content": "﻿// \n// ParameterOnlyAssignedIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ParameterOnlyAssignedIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestUnusedValue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod(int i)\n\t{\n\t\ti = 1;\n\t}\n}\";\n\t\t\tTest<ParameterOnlyAssignedIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsedValue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod(int i)\n\t{\n\t\ti = 1;\n\t\treturn i;\n\t}\n}\";\n\t\t\tTest<ParameterOnlyAssignedIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOutParametr ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod(out int i)\n\t{\n\t\ti = 1;\n\t}\n}\";\n\t\t\tTest<ParameterOnlyAssignedIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRefParametr ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod(ref int i)\n\t{\n\t\ti = 1;\n\t}\n}\";\n\t\t\tTest<ParameterOnlyAssignedIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PartOfBodyCanBeConvertedToQueryIssueTests.cs",
    "content": "//\n// PartOfBodyCanBeConvertedToQueryIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[Ignore]\n\t[TestFixture]\n\tpublic class PartOfBodyCanBeConvertedToQueryIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestWhere()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tforeach (var x in i) {\n\t\t\tif (x < 10) {\n\t\t\t\tConsole.WriteLine(x);\n\t\t\t}\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo (int[] i)\n\t{\n\t\tforeach (var x in i.Where (x => x < 10)) {\n\t\t\tConsole.WriteLine(x);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOfType()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo(object[] i)\n\t{\n\t\tforeach (var x in i) {\n\t\t\tif (x is int) {\n\t\t\t\tConsole.WriteLine(x);\n\t\t\t}\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo(object[] i)\n\t{\n\t\tforeach (var x in i.OfType<int> ()) {\n\t\t\tConsole.WriteLine(x);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOfTypeTakeWhile()\n\t\t{\n\t\t\tTest<LoopCanBeConvertedToQueryIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void Foo(object[] i)\n\t{\n\t\tforeach (var x in i) {\n\t\t\tif (x is int) {\n\t\t\t\tif ((int)x < 10)\n\t\t\t\t\tbreak;\n\t\t\t\tConsole.WriteLine(x);\n\t\t\t}\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\npublic class Bar\n{\n\tpublic void Foo(object[] i)\n\t{\n\t\tforeach (var x in i.OfType<int> ().TakeWhile (x => x >= 10)) {\n\t\t\tConsole.WriteLine(x);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PartialMethodParameterNameMismatchIssueTests.cs",
    "content": "//\n// PartialMethodParameterNameMismatchIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class PartialMethodParameterNameMismatchIssueTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void SimpleCaseFix ()\n\t\t{\n\t\t\tTest<PartialMethodParameterNameMismatchIssue>(@\"\npartial class Test\n{\n\tpartial void FooBar(int bar);\n}\n\npartial class Test\n{\n\tpartial void FooBar(int foo)\n\t{\n\t}\n}\n\", @\"\npartial class Test\n{\n\tpartial void FooBar(int bar);\n}\n\npartial class Test\n{\n\tpartial void FooBar(int bar)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<PartialMethodParameterNameMismatchIssue>(@\"\n// ReSharper disable PartialMethodParameterNameMismatch\npartial class Test\n{\n    partial void FooBar(int bar);\n}\n\npartial class Test\n{\n    partial void FooBar(int foo)\n    {\n    }\n}\n// ReSharper restore PartialMethodParameterNameMismatch\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PartialTypeWithSinglePartIssueTests.cs",
    "content": "﻿// \n// RedundantPartialTypeTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class PartialTypeWithSinglePartIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestRedundantModifier()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass\n{\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n}\";\n\t\t\tTest<PartialTypeWithSinglePartIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNecessaryModifier()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass\n{\n}\npartial class TestClass\n{\n}\";\n\t\t\tTest<PartialTypeWithSinglePartIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"\n// ReSharper disable once PartialTypeWithSinglePart\npartial class TestClass\n{\n}\";\n\t\t\tTestWrongContext<PartialTypeWithSinglePartIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantNestedPartial()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass\n{\n\tpartial class Nested\n\t{\n\t}\n}\npartial class TestClass\n{\n}\";\n\t\t\tvar output = @\"\npartial class TestClass\n{\n\tclass Nested\n\t{\n\t}\n}\npartial class TestClass\n{\n}\";\n\t\t\tTest<PartialTypeWithSinglePartIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantNestedPartialInNonPartialOuterClass()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpartial class Nested\n\t{\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tclass Nested\n\t{\n\t}\n}\";\n\t\t\tTest<PartialTypeWithSinglePartIssue>(input, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantNestedPartialDisable()\n\t\t{\n\t\t\tvar input = @\"\n// ReSharper disable PartialTypeWithSinglePart\npartial class TestClass\n// ReSharper restore PartialTypeWithSinglePart\n{\n\tpartial class Nested\n\t{\n\t}\n}\n\";\n\t\t\tvar output = @\"\n// ReSharper disable PartialTypeWithSinglePart\npartial class TestClass\n// ReSharper restore PartialTypeWithSinglePart\n{\n\tclass Nested\n\t{\n\t}\n}\n\";\n\t\t\tTest<PartialTypeWithSinglePartIssue>(input, output);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestNeededNestedPartial()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass\n{\n\tpartial class Nested\n\t{\n\t}\n}\npartial class TestClass\n{\n\tpartial class Nested\n\t{\n\t}\n}\";\n\t\t\tTest<PartialTypeWithSinglePartIssue>(input, 0);\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PolymorphicFieldLikeEventInvocationIssueTests.cs",
    "content": "//\n// PolymorphicFieldLikeEventInvocationIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing System;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\n\t[TestFixture]\n\tpublic class PolymorphicFieldLikeEventInvocationIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTestIssue<PolymorphicFieldLikeEventInvocationIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic virtual event EventHandler FooBarEvent;\n}\n\npublic class Foo : Bar\n{\n\tpublic override event EventHandler FooBarEvent;\n\n\tpublic void FooBar()\n\t{\n\t\tFooBarEvent(this, EventArgs.Empty);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCustomEvent()\n\t\t{\n\t\t\t// Should be marked as error\n\t\t\tTestIssue<PolymorphicFieldLikeEventInvocationIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic virtual event EventHandler FooBarEvent;\n}\n\npublic class Foo : Bar\n{\n\tpublic override event EventHandler FooBarEvent {\n\t\tadd {}\n\t\tremove {}\n\t}\n\n\tpublic void FooBar()\n\t{\n\t\tFooBarEvent(this, EventArgs.Empty);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<PolymorphicFieldLikeEventInvocationIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic virtual event EventHandler FooBarEvent;\n}\n\npublic class Foo : Bar\n{\n\tpublic override event EventHandler FooBarEvent;\n\n\tpublic void FooBar()\n\t{\n\t\t// ReSharper disable once PolymorphicFieldLikeEventInvocation\n\t\tFooBarEvent(this, EventArgs.Empty);\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PossibleAssignmentToReadonlyFieldIssueTests.cs",
    "content": "//\n// PossibleAssignmentToReadonlyFieldIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class PossibleAssignmentToReadonlyFieldIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestTypeParameter()\n\t\t{\n\t\t\tTestIssue<PossibleAssignmentToReadonlyFieldIssue>(@\"\ninterface IFoo\n{\n\tint Property { get; set; }\n}\n\nclass FooBar<T> where T : IFoo\n{\n\treadonly T field;\n\n\tvoid Test ()\n\t{\n\t\tfield.Property = 7;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassTypeParameter()\n\t\t{\n\t\t\tTestWrongContext<PossibleAssignmentToReadonlyFieldIssue>(@\"\ninterface IFoo\n{\n\tint Property { get; set; }\n}\n\nclass FooBar<T> where T : class, IFoo\n{\n\treadonly T field;\n\n\tvoid Test ()\n\t{\n\t\tfield.Property = 7;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValueType()\n\t\t{\n\t\t\tTestIssue<PossibleAssignmentToReadonlyFieldIssue>(@\"\nstruct Bar\n{\n\tpublic int P;\n}\n\nclass FooBar\n{\n\treadonly Bar field;\n\n\tpublic static void Foo()\n\t{\n\t\tvar a = new FooBar();\n\t\ta.field.P = 7;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructor ()\n\t\t{\n\t\t\tTestWrongContext<PossibleAssignmentToReadonlyFieldIssue>(@\"\ninterface IFoo\n{\n\tint Property { get; set; }\n}\n\nclass FooBar<T> where T : IFoo\n{\n\treadonly T field;\n\n\tpublic FooBar (T t)\n\t{\n\t\tthis.field = t;\n\t\tthis.field.Property = 5;\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15038 - readonly member property is incorrectly underlined in the .ctor when initialized \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15038 ()\n\t\t{\n\t\t\tTestWrongContext<PossibleAssignmentToReadonlyFieldIssue>(@\"\nusing System;\nusing System.Collections.Generic;\n\npublic class Multipart\n{\n\treadonly List<MimeEntity> children;\n\t\n\tinternal Multipart ()\n\t{\n\t\tchildren = new List<MimeEntity> ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<PossibleAssignmentToReadonlyFieldIssue>(@\"\ninterface IFoo\n{\n\tint Property { get; set; }\n}\n\nstruct Bar : IFoo\n{\n\tpublic int Property { get; set; }\n}\n\nclass FooBar<T> where T : IFoo\n{\n\treadonly T field;\n\n\tpublic static void Foo()\n\t{\n\t\tvar a = new FooBar<Bar>();\n\t\t// ReSharper disable once PossibleAssignmentToReadonlyField\n\t\ta.field.Property = 7;\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15109 - Incorrect \"Readonly field cannot be used as assignment target\" error\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15109()\n\t\t{\n\t\t\tTestWrongContext<PossibleAssignmentToReadonlyFieldIssue>(@\"\nnamespace TestProject \n{\n\tclass FileInfo {\n\t\tpublic int Foo { get; set; } \n\t}\n\tclass Program\n\t{\n\t\treadonly FileInfo f = new FileInfo ();\n\n\t\tvoid Test ()\n\t\t{\n\t\t\tf.Foo = 12;\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t}\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PossibleMistakenCallToGetTypeIssueTests.cs",
    "content": "//\n// PossibleMistakenCallToGetTypeIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class PossibleMistakenCallToGetTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestGetTypeCase ()\n\t\t{\n\t\t\tTest<PossibleMistakenCallToGetTypeIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void FooBar (Type a)\n\t{\n\t\tConsole.WriteLine (a.GetType ());\n\t}\n}\n\", @\"\nusing System;\n\npublic class Bar\n{\n\tpublic void FooBar (Type a)\n\t{\n\t\tConsole.WriteLine (a);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStaticCall ()\n\t\t{\n\t\t\tTestWrongContext<PossibleMistakenCallToGetTypeIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tpublic void FooBar(Type a)\n\t{\n\t\tstring abc = \"\"def\"\";\n\t\tType.GetType (abc, true);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<PossibleMistakenCallToGetTypeIssue>(@\"\npublic class Bar\n{\n\tpublic void FooBar(Type a)\n\t{\n\t\t// ReSharper disable once PossibleMistakenCallToGetType\n\t\tConsole.WriteLine(a.GetType());\n\t}\n}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PossibleMultipleEnumerationIssueTests.cs",
    "content": "﻿// \n// MultipleEnumerationIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class PossibleMultipleEnumerationIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVariableInvocation ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e = null;\n\t\tvar type = e.GetType();\n\t\tvar x = e.First ();\n\t\tvar y = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (\n\t\t\t\tinput,\n\t\t\t\t2,\n\t\t\t\t@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e = null;\n\t\tvar type = e.GetType();\n\t\tvar enumerable = e as object[] ?? e.ToArray ();\n\t\tvar x = enumerable.First ();\n\t\tvar y = enumerable.Count ();\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test] \n\t\tpublic void TestVariableForeach ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e = null;\n\t\tforeach (var x in e) ;\n\t\tforeach (var y in e) ;\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (\n\t\t\t\tinput, \n\t\t\t\t2,\n\t\t\t\t@\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e = null;\n\t\tvar enumerable = e as IList<object> ?? e.ToList ();\n\t\tforeach (var x in enumerable) ;\n\t\tforeach (var y in enumerable) ;\n\t}\n}\", 1, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVariableMixed ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e = null;\n\t\tforeach (var x in e) ;\n\t\tvar y = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameter ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (IEnumerable<object> e)\n\t{\n\t\tforeach (var x in e) ;\n\t\tvar y = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObjectMethodInvocation ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tvar a = e.GetType ();\n\t\tvar b = e.ToString ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIf ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tif (i > 0) {\n\t\t\tvar a = e.Count ();\n\t\t} else {\n\t\t\tvar b = e.First ();\n\t\t\tvar c = e.Count ();\n\t\t}\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIf2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tif (i > 0) {\n\t\t\tvar a = e.Count ();\n\t\t} else {\n\t\t\tvar b = e.First ();\n\t\t}\n\t\tvar c = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 3);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIf3 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tif (i > 0) {\n\t\t\tvar a = e.Count ();\n\t\t} else {\n\t\t\tvar b = e.First ();\n\t\t}\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFor ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tvar a = e.Count ();\n\t\t}\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhile ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tint i;\n\t\twhile (i > 1) {\n\t\t\tvar a = e.Count ();\n\t\t}\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhile2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tint i;\n\t\twhile (i > e.Count ()) {\n\t\t}\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhile3 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tint i;\n\t\tobject x;\n\t\twhile (true) {\n\t\t\tif (i > 1) {\n\t\t\t\tx = e.First ();\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhile4 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tIEnumerable<object> GetEnum () { }\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e = GetEnum ();\n\t\tvar a1 = e.First ();\n\t\twhile ((e = GetEnum ()) != null) {\n\t\t\tvar a2 = e.First ();\n\t\t}\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDo ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tIEnumerable<object> GetEnum () { }\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e = GetEnum ();\n\t\tvar a1 = e.First ();\n\t\tdo {\n\t\t\tvar a2 = e.First ();\n\t\t} while ((e = GetEnum ()) != null);\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDo2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tIEnumerable<object> GetEnum () { }\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e = GetEnum ();\n\t\tdo {\n\t\t\tvar a2 = e.First ();\n\t\t} while ((e = GetEnum ()) != null);\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambda ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tAction a = () => {\n\t\t\tvar x = e.Count ();\n\t\t\tvar y = e.Count ();\n\t\t};\n\t\tvar z = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambda2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid Test (object a, object b) { }\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tAction a = () => Test(e.First (), e.Count ());\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambda3 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid Test (object a, Action b) { }\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tTest(e.First (), () => e.Count ());\n\t\te = null;\n\t\tvar x = e.First ();\n\t\tAction a = () => e.Count();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambda4 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid Test (object a, object b) { }\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e;\n\t\tAction a = () => Test(e.ToString (), e.ToString ());\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalExpression ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tvar a = i > 0 ? e.First () : e.FirstOrDefault ();\n\t\tAction b = () => i > 0 ? e.First () : e.FirstOrDefault ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\t\t[Test]\n\t\tpublic void TestConditionalExpression2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tvar a = i > 0 ? e.First () : new object ();\n\t\tvar b = e.First ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstantConditionalExpression ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tvar a = 1 > 2 ? e.First () : new object ();\n\t\tvar b = e.First ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentInConditionalExpression ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tIEnumerable<object> GetEnum () { }\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tvar x1 = e.First ();\n\t\tvar a = i > 0 ? e = GetEnum () : GetEnum ();\n\t\tvar x2 = e.First ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentInConditionalExpression2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tIEnumerable<object> GetEnum () { }\n\tvoid TestMethod (int i)\n\t{\n\t\tIEnumerable<object> e;\n\t\tvar x1 = e.First ();\n\t\tvar a = i > 0 ? e = GetEnum () : e = GetEnum ();\n\t\tvar x2 = e.First ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignment ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (IEnumerable<object> e)\n\t{\n\t\tforeach (var x in e) ;\n\t\te = null;\n\t\tvar y = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignment2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (IEnumerable<object> e)\n\t{\n\t\tforeach (var x in e) ;\n\t\te = null;\n\t\tvar y = e.Count ();\n\t\te = null;\n\t\tvar a = e.First ();\n\t\tvar b = e.First ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod (IEnumerable<object> e)\n\t{\n\t\tforeach (var x in e) ;\n\t\tIEnumerable<object> e2;\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExpression ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tint Test (params object[] args) { }\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e = null;\n\t\tvar type = e.GetType();\n\t\tvar x = Test (e.First (), e.Count ());\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExpression2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tint Test (params object[] args) { }\n\tvoid TestMethod ()\n\t{\n\t\tIEnumerable<object> e = null;\n\t\tvar type = e.GetType();\n\t\tvar x = Test (e.First (), e = new objct[0], e.Count ());\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOutArgument ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid Test (out IEnumerable<object> e)\n\t{\n\t\te = null;\n\t}\n\n\tvoid TestMethod (IEnumerable<object> e)\n\t{\n\t\tforeach (var x in e) ;\n\t\tTest (out e);\n\t\tvar y = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOutArgument2 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid Test (out IEnumerable<object> e)\n\t{\n\t\te = null;\n\t}\n\n\tvoid TestMethod (IEnumerable<object> e)\n\t{\n\t\tforeach (var x in e) ;\n\t\tTest (out e);\n\t\tvar y = e.Count ();\n\t\tvar z = e.Count ();\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOutArgument3 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid Test (object arg1, out IEnumerable<object> e, object arg2)\n\t{\n\t\te = null;\n\t}\n\n\tvoid TestMethod (IEnumerable<object> e)\n\t{\n\t\tTest (e.First (), out e, e.First ());\n\t}\n}\";\n\t\t\tTest<PossibleMultipleEnumerationIssue> (input, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tvar input = @\"\nusing System.Collections.Generic;\nusing System.Linq;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t// ReSharper disable PossibleMultipleEnumeration\n\t\tIEnumerable<object> e = null;\n\t\tvar type = e.GetType();\n\t\tvar x = e.First ();\n\t\tvar y = e.Count ();\n\t\t// ReSharper restore PossibleMultipleEnumeration\n\t}\n}\";\n\t\t\tTestWrongContext<PossibleMultipleEnumerationIssue> (input);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ProhibitedModifiersIssueTests.cs",
    "content": "//\n// ProhibitedModifiersIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ProhibitedModifiersIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestNonStaticMembersInStaticClass ()\n\t\t{\n\t\t\tTest<ProhibitedModifiersIssue>(@\"\nstatic class Foo\n{\n\tpublic void Bar () \n\t{\n\t}\n}\n\", @\"\nstatic class Foo\n{\n\tpublic static void Bar () \n\t{\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestValidStaticClass ()\n\t\t{\n\t\t\tTestWrongContext<ProhibitedModifiersIssue>(@\"\nstatic class Foo\n{\n\tpublic const int f = 1;\n\tstatic Foo () {}\n\n\tpublic static void Bar () \n\t{\n\t}\n}\n\");\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void TestNonStaticFieldsInStaticClass ()\n\t\t{\n\t\t\tTest<ProhibitedModifiersIssue>(@\"\nstatic class Foo\n{\n\tint a, b, c;\n}\n\", 3, @\"\nstatic class Foo\n{\n\tstatic int a, b, c;\n}\n\", 1);\n\t\t}\n\n\t\t[Ignore(\"Code issues don't run with errors atm.\")]\n\t\t[Test]\n\t\tpublic void TestStaticConstructorWithPublicModifier()\n\t\t{\n\t\t\tTest<ProhibitedModifiersIssue>(@\"\nclass Test\n{\n\tstatic int a;\n\n\tpublic static Test ()\n\t{\n\t\ta = 100;\n\t}\n}\", @\"\nclass Test\n{\n\tstatic int a;\n\n\tstatic Test ()\n\t{\n\t\ta = 100;\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestVirtualMemberInSealedClass ()\n\t\t{\n\t\t\tTest<ProhibitedModifiersIssue>(@\"\nsealed class Test\n{\n\tpublic virtual void FooBar ()\n\t{\n\t}\n}\", @\"\nsealed class Test\n{\n\tpublic void FooBar ()\n\t{\n\t}\n}\");\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void TestPrivateVirtualMembers ()\n\t\t{\n\t\t\tTestIssue<ProhibitedModifiersIssue>(@\"\nclass Foo\n{\n\tvirtual void Bar () \n\t{\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSealed ()\n\t\t{\n\t\t\tTest<ProhibitedModifiersIssue>(@\"\nclass Foo\n{\n\tpublic sealed void Bar () \n\t{\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic void Bar () \n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidSealed ()\n\t\t{\n\t\t\tTestWrongContext<ProhibitedModifiersIssue>(@\"\nclass Foo\n{\n\tpublic override sealed void Bar () \n\t{\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestExtensionMethodInNonStaticClass ()\n\t\t{\n\t\t\tTest<ProhibitedModifiersIssue>(@\"\nclass Foo\n{\n\tpublic static void Bar (this int i) \n\t{\n\t}\n}\n\", @\"\nstatic class Foo\n{\n\tpublic static void Bar (this int i) \n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExtensionMethodInNonStaticClassFix2 ()\n\t\t{\n\t\t\tTest<ProhibitedModifiersIssue>(@\"\nclass Foo\n{\n\tpublic static void Bar (this int i) \n\t{\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic static void Bar (int i) \n\t{\n\t}\n}\n\", 1);\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/PublicConstructorInAbstractClassIssueTest.cs",
    "content": "// \n// PublicConstructorInAbstractionClassIssueTests.cs\n// \n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun \n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class PublicConstructorInAbstractClassIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"\nabstract class TestClass\n{\n\tpublic TestClass ()\n\t{\n\t}\n}\";\n\t\t\tvar output = @\"\nabstract class TestClass\n{\n\tprotected TestClass ()\n\t{\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new PublicConstructorInAbstractClassIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"\nabstract class TestClass\n{\n\tstatic TestClass ()\n\t{\n\t}\n\tvoid TestMethod ()\n\t{\n\t\tvar i = 1;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new PublicConstructorInAbstractClassIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"\nabstract class TestClass\n{\n\tpublic TestClass ()\n\t{\n\t}\n\n\tprivate TestClass ()\n\t{\n\t}\n\t\n\tpublic TestClass (string str)\n\t{\n\t\tConsole.WriteLine(str);\n\t}\n}\";\n\t\t\tvar output = @\"\nabstract class TestClass\n{\n\tprotected TestClass ()\n\t{\n\t}\n\n\tprivate TestClass ()\n\t{\n\t}\n\t\n\tprotected TestClass (string str)\n\t{\n\t\tConsole.WriteLine(str);\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new PublicConstructorInAbstractClassIssue(), input, out context);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisable()\n\t\t{\n\t\t\tvar input = @\"\n//Resharper disable PublicConstructorInAbstractClass\nabstract class TestClass\n{\n\tpublic TestClass ()\n\t{\n\t}\n//Resharper restore PublicConstructorInAbstractClass\n}\n\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new PublicConstructorInAbstractClassIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantAnonymousTypePropertyNameIssueTests.cs",
    "content": "//\n// RedundantAnonymousTypePropertyNameIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantAnonymousTypePropertyNameIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<RedundantAnonymousTypePropertyNameIssue>(@\"\nclass FooBar\n{\n\tpublic int Foo;\n\tpublic int Bar;\n}\nclass TestClass\n{\n\tpublic void Test(FooBar f)\n\t{\n\t\tvar n = new { Foo = f.Foo, b = 12 };\n\t}\n}\", @\"\nclass FooBar\n{\n\tpublic int Foo;\n\tpublic int Bar;\n}\nclass TestClass\n{\n\tpublic void Test(FooBar f)\n\t{\n\t\tvar n = new { f.Foo, b = 12 };\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantAnonymousTypePropertyNameIssue>(@\"\nclass FooBar\n{\n\tpublic int Foo;\n\tpublic int Bar;\n}\nclass TestClass\n{\n\tpublic void Test(FooBar f)\n\t{\n\t\t// ReSharper disable once RedundantAnonymousTypePropertyName\n\t\tvar n = new { Foo = f.Foo, b = 12 };\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantArgumentDefaultValueIssueTests.cs",
    "content": "//\n// RedundantArgumentDefaultValueIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantArgumentDefaultValueIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22)\n\t{\n\t\tconst int s = 22;\n\t\tBar (s);\n\t}\n}\n\", @\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22)\n\t{\n\t\tconst int s = 22;\n\t\tBar ();\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestNamedArgument()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22)\n\t{\n\t\tBar(foo: 22);\n\t}\n}\n\", @\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22)\n\t{\n\t\tBar ();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleRemoveFirst()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22, int test = 3)\n\t{\n\t\tconst int s = 22;\n\t\tBar (s, 3);\n\t}\n}\n\", 2, @\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22, int test = 3)\n\t{\n\t\tconst int s = 22;\n\t\tBar ();\n\t}\n}\n\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleRemoveSecond()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22, int test = 3)\n\t{\n\t\tconst int s = 22;\n\t\tBar (s, 3);\n\t}\n}\n\", 2, @\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22, int test = 3)\n\t{\n\t\tconst int s = 22;\n\t\tBar (s);\n\t}\n}\n\", 1);\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22)\n\t{\n\t\tBar (21);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase2()\n\t\t{\n\t\t\tTestWrongContext<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22, int bar = 3)\n\t{\n\t\tBar (22, 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic void Bar (int foo = 22)\n\t{\n\t\tconst int s = 22;\n\t\t// ReSharper disable once RedundantArgumentDefaultValue\n\t\tBar (s);\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestConstructor()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic Test (int a, int b, int c = 4711)\n\t{\n\t\tnew Test (1, 2, 4711);\n\t}\n}\n\", @\"\nclass Test\n{ \n\tpublic Test (int a, int b, int c = 4711)\n\t{\n\t\tnew Test (1, 2);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexer()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass Test\n{ \n\tpublic int this [int a, int b = 2] {\n\t\tget {\n\t\t\treturn this [a, 2];\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{ \n\tpublic int this [int a, int b = 2] {\n\t\tget {\n\t\t\treturn this [a];\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (\"\"a1\"\");\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ChecksConstructors()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass TestClass\n{\n\tpublic TestClass(string a1 = \"\"a1\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tvar foo = new TestClass (\"\"a1\"\");\n\t}\n}\", @\"\nclass TestClass\n{\n\tpublic TestClass(string a1 = \"\"a1\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tvar foo = new TestClass ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresAllParametersPreceedingANeededOne()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", string a3 = \"\"a3\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (\"\"a1\"\", \"\"Another string\"\", \"\"a3\"\");\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", string a3 = \"\"a3\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (\"\"a1\"\", \"\"Another string\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ChecksParametersIfParamsAreUnused()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", string a3 = \"\"a3\"\", params string[] extraStrings)\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (\"\"a1\"\", \"\"a2\"\", \"\"a3\"\");\n\t}\n}\", 3, @\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", string a3 = \"\"a3\"\", params string[] extraStrings)\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo ();\n\t}\n}\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresIfParamsAreUsed()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", string a3 = \"\"a3\"\", params string[] extraStrings)\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (\"\"a1\"\", \"\"a2\"\", \"\"a3\"\", \"\"extraString\"\");\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantArgumentDefaultValueIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Ignore(\"Fixme\")]\n\t\t[Test]\n\t\tpublic void NamedArgument()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (a2: \"\"a2\"\");\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo ();\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme\")]\n\t\t[Test]\n\t\tpublic void DoesNotStopAtDifferingNamedParameters()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", string a3 = \"\"a3\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (\"\"a1\"\", \"\"a2\"\", a3: \"\"non-default\"\");\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", string a3 = \"\"a3\"\")\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (a3: \"\"non-default\"\");\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme\")]\n\t\t[Test]\n\t\tpublic void DoesNotStopAtNamedParamsArray()\n\t\t{\n\t\t\tTest<RedundantArgumentDefaultValueIssue>(@\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", params string[] extras)\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (\"\"a1\"\", \"\"a2\"\", extras: new [] { \"\"extra1\"\" });\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid Foo(string a1 = \"\"a1\"\", string a2 = \"\"a2\"\", params string[] extras)\n\t{\n\t}\n\n\tvoid Bar()\n\t{\n\t\tFoo (extras: new[] {\n\t\"\"extra1\"\"\n});\n\t}\n}\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantArgumentNameTests.cs",
    "content": "﻿// RedundantArgumentNameTests.cs\n//\n// Author:\n//      Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantArgumentNameTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void MethodInvocation1()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, double c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo(1,b: 2);\n\t}\n}\n\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, double c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo (1, 2);\n\t}\n}\n\";\n\t\t\tTest<RedundantArgumentNameIssue>(input, 1, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodInvocation2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, double c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo(a: 1, b: 2, c: 0.2);\n\t}\n}\n\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, double c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo (1, b: 2, c: 0.2);\n\t}\n}\n\";\n\t\t\tTest<RedundantArgumentNameIssue>(input, 3, output, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodInvocation3()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, double c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo (a: 1, b: 2, c: 0.2);\n\t}\n}\n\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tpublic void Foo(int a, int b, double c = 0.1){}\n\tpublic void F()\n\t{\n\t\tFoo (1, 2, c: 0.2);\n\t}\n}\n\";\n\t\t\tTest<RedundantArgumentNameIssue>(input, 3, output, 1);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void MethodInvocation4()\n\t\t{\n\t\t\tTest<RedundantArgumentNameIssue>(@\"\nclass TestClass\n{\n\tpublic void Foo (int a = 2, int b = 3, int c = 4, int d = 5, int e = 5)\n\t{\n\t}\n\n\tpublic void F ()\n\t{\n\t\tFoo (1, b: 2, d: 2, c: 3, e:19);\n\t}\n}\n\", 1, @\"\nclass TestClass\n{\n\tpublic void Foo (int a = 2, int b = 3, int c = 4, int d = 5, int e = 5)\n\t{\n\t}\n\n\tpublic void F ()\n\t{\n\t\tFoo (1, 2, d: 2, c: 3, e: 19);\n\t}\n}\n\");\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void IndexerExpression() \n\t\t{\n\t\t\tvar input = @\"\npublic class TestClass\n{\n\tpublic int this[int i, int j]\n\t{\n\t\tset { }\n\t\tget { return 0; }\n\t}\n}\ninternal class Test\n{\n\tprivate void Foo()\n\t{\n\t\tvar TestBases = new TestClass();\n\t\tint a = TestBases[i: 1, j: 2];\n\t}\n}\n\";\n\t\t\tvar output = @\"\npublic class TestClass\n{\n\tpublic int this[int i, int j]\n\t{\n\t\tset { }\n\t\tget { return 0; }\n\t}\n}\ninternal class Test\n{\n\tprivate void Foo()\n\t{\n\t\tvar TestBases = new TestClass();\n\t\tint a = TestBases [1, j: 2];\n\t}\n}\n\";\n\t\t\tTest<RedundantArgumentNameIssue>(input, 2, output, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAttributes()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass MyAttribute : Attribute\n{\n\tpublic MyAttribute(int x, int y) {}\n}\n\n\n[MyAttribute(x: 1, y: 2)]\nclass TestClass\n{\n}\n\";\n\t\t\tvar output = @\"using System;\nclass MyAttribute : Attribute\n{\n\tpublic MyAttribute(int x, int y) {}\n}\n\n\n[MyAttribute(1, 2)]\nclass TestClass\n{\n}\n\";\n\t\t\tTest<RedundantArgumentNameIssue>(input, 2, output, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestObjectCreation()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic TestClass (int x, int y)\n\t{\n\t}\n\n\tpublic void Foo ()\n\t{\n\t\tnew TestClass (0, y:1);\n\t}\n}\n\"\n\t\t\t\t;\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tpublic TestClass (int x, int y)\n\t{\n\t}\n\n\tpublic void Foo ()\n\t{\n\t\tnew TestClass (0, 1);\n\t}\n}\n\";\n\t\t\tTest<RedundantArgumentNameIssue>(input, 1, output);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void Invalid()\n\t\t{\n\t\t\tvar input = @\"\npublic class TestClass\n{\n\tpublic int this[int i, int j , int k]\n\t{\n\t\tset { }\n\t\tget { return 0; }\n\t}\n}\ninternal class Test\n{\n\tprivate void Foo()\n\t{\n\t\tvar TestBases = new TestClass();\n\t\tint a = TestBases[ j: 1, i: 2, k: 3];\n\t}\n}\n\";\n\t\t\tTest<RedundantArgumentNameIssue>(input, 0);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantAssignmentIssueTests.cs",
    "content": "﻿// \n// RedundantAssignmentIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantAssignmentIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVariableInitializerNotUsed()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 1;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVariableInitializerNotUsedVar()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar i = 1;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVariableAssignmentNotUsed()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint i = 1;\n\t\tint j = i;\n\t\ti = 2;\n\t\treturn j;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint i = 1;\n\t\tint j = i;\n\t\treturn j;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParameterAssignmentNotUsed()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tint j = i;\n\t\ti = 2;\n\t\treturn j;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tint j = i;\n\t\treturn j;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentInExpression()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tint j = i = 2;\n\t\treturn j;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tint j = 2;\n\t\treturn j;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOutArgument()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Test (out int i)\n\t{\n\t\ti = 0;\n\t}\n\tint TestMethod ()\n\t{\n\t\tint i = 2;\n\t\tTest (out i);\n\t\treturn i;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid Test (out int i)\n\t{\n\t\ti = 0;\n\t}\n\tint TestMethod ()\n\t{\n\t\tint i;\n\t\tTest (out i);\n\t\treturn i;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOutArgument2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Test (out int i)\n\t{\n\t\ti = 0;\n\t}\n\tint TestMethod ()\n\t{\n\t\tint i;\n\t\tTest (out i);\n\t\ti = 2;\n\t\treturn i;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRefArgument()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Test (ref int i)\n\t{\n\t\ti = 0;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentOperator()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint i = 1;\n\t\ti += 2;\n\t\treturn i;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIf()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int j)\n\t{\n\t\tint i = 1;\n\t\tif (j > 0) {\n\t\t\ti += 2;\n\t\t} else {\n\t\t}\n\t\treturn i;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalExpression()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int j)\n\t{\n\t\tint i = 1;\n\t\treturn j > 0 ? i : 0;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLoop()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = 0;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i > 5) {\n\t\t\t\tx++;\n\t\t\t} else {\n\t\t\t\tx = 2;\n\t\t\t}\n\t\t}\n\t\tif (x > 1) ;\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeach()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int[] array)\n\t{\n\t\tforeach (int j in array) {\n\t\t\tbool x = false;\n\t\t\tforeach (int k in array)\n\t\t\t\tforeach (int i in array)\n\t\t\t\t\tif (i > 5) x = true;\n\t\t\tif (x) break;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentInTryCatch()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new TestClass ();\n\t\ttry {\n\t\t\ta = null;\n\t\t} catch (Exception) {\n\t\t\tif (a != null) {\n\t\t\t\ta.TestMethod ();\n\t\t\t}\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentInTryCatchFinally()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new TestClass ();\n\t\ttry {\n\t\t\ta = null;\n\t\t} finally {\n\t\t\tif (a != null) {\n\t\t\t\ta.TestMethod ();\n\t\t\t}\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentInCatch()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n    void Test(TestClass a) { }\n\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new TestClass ();\n\t\ttry {\n\t\t} catch (Exception) {\n\t\t\ta = null;\n\t\t}\n        Test (a);\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentBeforeTry()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n    void Test(TestClass a) { }\n\n\tvoid TestMethod ()\n\t{\n\t\tvar a = null;\n\t\ttry {\n\t\t\ta = new TestClass ();\n\t\t} catch (Exception) {\n\t\t}\n        Test (a);\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentInUsing()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tusing (var tc = new TestClass ()) {\n\t\t\t// nothing\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssignmentWithFunction()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass\n{\n\tTestClass  Func () { return null; }\n\tvoid TestMethod ()\n\t{\n\t\tvar a = Func ();\n\t}\n}\";\n\t\t\tvar output = @\"using System;\nclass TestClass\n{\n\tTestClass  Func () { return null; }\n\tvoid TestMethod ()\n\t{\n\t\tFunc ();\n\t}\n}\";\n\t\t\tTest<RedundantAssignmentIssue>(input, output);\n\t\t}\n\n        [Test]\n        public void TestAssignmentWithFunctionUsedLater()\n        {\n            var input = @\"using System;\nclass TestClass\n{\n\tTestClass  Func () { return null; }\n\tvoid TestMethod ()\n\t{\n\t\tvar a = Func ();\n        a = 2;\n\t}\n}\";\n            var output = @\"using System;\nclass TestClass\n{\n\tTestClass  Func () { return null; }\n\tvoid TestMethod ()\n\t{\n\t\tTestClass a;\n\t\tFunc ();\n        a = 2;\n\t}\n}\";\n            Test<RedundantAssignmentIssue>(input, 2, output, 0);\n        }\n\n\n\t\t/// <summary>\n\t\t/// Bug 11795 - Use of regex in linq statement not being recognized. \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug11795 ()\n\t\t{\n\t\t\tTestWrongContext<RedundantAssignmentIssue>(@\"\nusing System;\nusing System.Text.RegularExpressions;\nusing System.IO;\nusing System.Linq;\n\npublic class Test\n{\n\tpublic void Demo ()\n\t{\n\t\tRegex pattern = new Regex (@\"\"^.*\\.(jpg|png)$\"\", RegexOptions.IgnoreCase);\n\t\tstring path = Path.Combine (\"\"/\"\", \"\"speakers\"\");\n\n\t\tConsole.WriteLine (\n\t\t\tfrom file in Directory.GetFiles (path)\n\t\t\twhere pattern.IsMatch (file)\n\t\t\tselect file\n\t\t\t);\n\t}\n\n}\");\n\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 14929 - Assignment greyed out (meaning \"redundant\") when it should not be\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14929 ()\n\t\t{\n\t\t\tTestWrongContext<RedundantAssignmentIssue>(@\"\nusing system;\n\npublic class Test\n{\n\tpublic void Demo ()\n\t{\n\t\tbool save = true;\n\t\ttry {\n\t\t\tthrow new Exception ();\n\t\t} catch (Exception) {\n\t\t\tsave = false;\n\t\t\tthrow;\n\t\t} finally {\n\t\t\tSystem.Console.WriteLine (save);\n\t\t}\n\t}\n\n}\");\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleVariableInitializers()\n\t\t{\n\t\t\tTest<RedundantAssignmentIssue>(@\"using System;\npublic class MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tstring outputFile = null, inputFile = null;\n\t\tConsole.WriteLine (outputFile);\n\t}\n}\n\", 1, @\"using System;\npublic class MyClass\n{\n\tpublic static void Main ()\n\t{\n\t\tstring outputFile = null, inputFile;\n\t\tConsole.WriteLine (outputFile);\n\t}\n}\n\", 0);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantAttributeParenthesesIssueTests.cs",
    "content": "﻿// \n// RedundantAttributeParenthesesIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantAttributeParenthesesIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\n[Test ()]\nclass TestClass { }\";\n\t\t\tvar output = @\"\n[Test]\nclass TestClass { }\";\n\t\t\tTest<RedundantAttributeParenthesesIssue> (input, 1, output);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tvar input = @\"\n// Resharper disable once RedundantAttributeParentheses\n[Test ()]\nclass TestClass { }\";\n\t\t\tTest<RedundantAttributeParenthesesIssue> (input, 0);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantBaseConstructorIssueTests.cs",
    "content": "// \n// RedundantBaseConstructorIssueTests.cs\n// \n// Author:\n//      Ciprian Khlud <ciprian.mustiata@yahoo.com>\n// \n// Copyright (c) 2013 Ciprian Khlud <ciprian.mustiata@yahoo.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\n\t[TestFixture]\n\tpublic class RedundantBaseConstructorIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass BaseClass\n{\n    public BaseClass()\n    {\n    }\n}\nclass TestClass : BaseClass\n{\n    public TestClass(int data) : base() { }\n}\n\";\n\t\t\tvar output = @\"\nclass BaseClass\n{\n    public BaseClass()\n    {\n    }\n}\nclass TestClass : BaseClass\n{\n    public TestClass(int data)\n\t{ }\n}\n\";\n\t\t\tTest<RedundantBaseConstructorCallIssue> (input, 1, output);\n\t\t}\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"\nclass BaseClass\n{\n    public BaseClass()\n    {\n    }\n}\nclass TestClass : BaseClass\n{\n// ReSharper disable once RedundantBaseConstructorCall\n    public TestClass(int data) : base() { }\n}\n\";\n            TestWrongContext<RedundantBaseConstructorCallIssue>(input);\n        }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantBaseQualifierTests.cs",
    "content": "// \n// RedundantBaseQualifierTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantBaseQualifierTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic int a;\n\t\t\tpublic virtual void method()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t\tpublic void method1()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t}\n\n\t\tclass Program : BaseClass\n\t\t{\n\t\t\tpublic void method2(int a)\n\t\t\t{\n\t\t\t\tbase.a = 1;\n\t\t\t}\n\t\t\tpublic override void method()\n\t\t\t{\n\t\t\t\tbase.method1();\n\t\t\t}\n\t\t}\n\t}\n\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantBaseQualifierIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic int a;\n\t\t\tpublic virtual void method()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t\tpublic void method1()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t}\n\n\t\tclass Program : BaseClass\n\t\t{\n\t\t\tpublic void method2(int a)\n\t\t\t{\n\t\t\t\tbase.a = 1;\n\t\t\t}\n\t\t\tpublic override void method()\n\t\t\t{\n\t\t\t\tmethod1 ();\n\t\t\t}\n\t\t}\n\t}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic int a;\n\t\t\tpublic int b;\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t\tpublic virtual void method1()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t}\n\n\t\tclass Program : BaseClass\n\t\t{\n\t\t\tpublic new void method(int b)\n\t\t\t{\n\t\t\t\tbase.a = 1;\n\t\t\t\tbase.b = 2;\n\t\t\t}\n\t\t\tpublic void method2()\n\t\t\t{\n\t\t\t\tbase.method ();\n\t\t\t}\n\t\t\tpublic new int a;\n\t\t}\n\t}\n\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantBaseQualifierIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ComplexTests ()\n\t\t{\n\t\t\tTestWrongContext<RedundantBaseQualifierIssue>(@\"\n\nclass Base {\n\tpublic int a;\n}\n\nclass Foo : Base\n{\n\tvoid Bar ()\n\t{\n\t\t{\n\t\t\tint a = 343;\n\t\t}\n\t\tbase.a = 2;\n\t\t\n\t}\n\n\tvoid FooBar ()\n\t{\n\t\tint a = base.a;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic int a;\n\t\t\tpublic virtual void print()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t\tpublic void print1()\n\t\t\t{\n\t\t\t\tConsole.Write(Environment.NewLine);\n\t\t\t}\n\t\t}\n\n\t\tclass Program : BaseClass\n\t\t{\n\t\t\tpublic void print2()\n\t\t\t{\n//Resharper disable RedundantBaseQualifier\n\t\t\t\tbase.a = 1;\n//Resharper restore RedundantBaseQualifier\n\t\t\t\tbase.a = 1;\n\t\t\t}\n\t\t\tpublic override void print()\n\t\t\t{\n\t\t\t\tbase.print1();\n\t\t\t}\n\t\t}\n\t}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantBaseQualifierIssue(), input, out context);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidUseOfBaseInFieldInitializer()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tint a = base.a;\n}\";\n\t\t\tTestWrongContext<RedundantBaseQualifierIssue>(input);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantBlockInDifferentBranchesTests.cs",
    "content": "﻿// \n// RedundantBlockInDifferentBranchesTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantBlockInDifferentBranchesTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestConditionalExpression1()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif (foo > 5)\n\t\t{\n\t\t\tfoo = foo +  1;\n\t\t\tfoo = foo + foo;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfoo = foo + 1;\n\t\t\tfoo = foo + foo;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantBlockInDifferentBranchesIssue>(input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConditionalExpression2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif (foo > 5)\n\t\t\tfoo = foo + 1;\n\t\telse\n\t\t\tfoo = foo + 1;\n\t}\n}\";\n\t\t\tTest<RedundantBlockInDifferentBranchesIssue>(input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConditionalExpression3()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint foo;\n\t\tif (foo > 5)\n\t\t\tfoo = foo + 1;\n\t\telse\n\t\t{\n\t\t\tfoo = foo + 1;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantBlockInDifferentBranchesIssue>(input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConditionalExpression4()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif (foo > 5)\n\t\t{\n\t\t}\n\t\telse\n\t\t{}\n\t}\n}\";\n\t\t\tTest<RedundantBlockInDifferentBranchesIssue>(input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem1()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int foo)\n\t{\n\t\tif (foo > 5)\n\t\t{\n\t\t\tfoo = foo + 1;\n\t\t\treturn 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfoo = foo + 1;\n\t\t\treturn 2;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantBlockInDifferentBranchesIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int foo)\n\t{\n\t\tif (foo > 5)\n\t\t{\n\t\t\tfoo = foo + 1;\n\t\t\treturn 2;\n\t\t}\n\t\telse\n\t\t\treturn 5;\n\t}\n}\";\n\t\t\tTest<RedundantBlockInDifferentBranchesIssue>(input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int foo)\n\t{\n//Resharper disable RedundantBlockInDifferentBranches\n\t\tif (foo > 5)\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 5;\n//Resharper restore RedundantBlockInDifferentBranches\n\t}\n}\";\n\t\t\tTest<RedundantBlockInDifferentBranchesIssue>(input, 0);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantBoolCompareIssueTests.cs",
    "content": "﻿// \n// CompareBooleanWithTrueOrFalseIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantBoolCompareIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (bool x)\n\t{\n\t\tbool y;\n\t\ty = x == true;\n\t\ty = x == false;\n\t\ty = x != false;\n\t\ty = x != true;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (bool x)\n\t{\n\t\tbool y;\n\t\ty = x;\n\t\ty = !x;\n\t\ty = x;\n\t\ty = !x;\n\t}\n}\";\n\t\t\tTest<RedundantBoolCompareIssue> (input, 4, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInsertParentheses ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tbool y = 2 > 1 == false;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tbool y = !(2 > 1);\n\t}\n}\";\n\t\t\tTest<RedundantBoolCompareIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid ()\n\t\t{\n\t\t\tTestWrongContext<RedundantBoolCompareIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (bool? x)\n\t{\n\t\tbool y;\n\t\ty = x == true;\n\t\ty = x == false;\n\t\ty = x != false;\n\t\ty = x != true;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (bool? x)\n\t{\n\t\tvar y = x == false;\n\t}\n}\";\n\t\t\tTest<RedundantBoolCompareIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantCaseLabelIssueTests.cs",
    "content": "﻿// \n// RedundantCaseLabelIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantCaseLabelIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tswitch (i) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tswitch (i) {\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantCaseLabelIssue> (input, 2, output);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestLabelAfterDefault ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tswitch (i) {\n\t\t\tdefault:\n\t\t\tcase 1:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tswitch (i) {\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantCaseLabelIssue> (input, 1, output);\n\t\t}\n\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tswitch (i) {\n// ReSharper disable once RedundantCaseLabel\n\t\t\tcase 1:\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\";\n            TestWrongContext<RedundantCaseLabelIssue>(input);\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantCastIssueTests.cs",
    "content": "﻿// \n// RedundantCastIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantCastIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSameType ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tvar i2 = ((int)i);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint i = 0;\n\t\tvar i2 = i;\n\t}\n}\";\n\t\t\tTest<RedundantCastIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvocation ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Test (object obj)\n\t{\n\t}\n\tvoid TestMethod (object obj)\n\t{\n\t\tTest ((int)obj);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid Test (object obj)\n\t{\n\t}\n\tvoid TestMethod (object obj)\n\t{\n\t\tTest (obj);\n\t}\n}\";\n\t\t\tTest<RedundantCastIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaInvocation ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (object obj)\n\t{\n\t\tSystem.Action<object> a;\n\t\ta ((int)obj);\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (object obj)\n\t{\n\t\tSystem.Action<object> a;\n\t\ta (obj);\n\t}\n}\";\n\t\t\tTest<RedundantCastIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMember ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (object obj)\n\t{\n\t\tvar str = (obj as TestClass).ToString ();\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (object obj)\n\t{\n\t\tvar str = obj.ToString ();\n\t}\n}\";\n\t\t\tTest<RedundantCastIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid Test (int k) { }\n\tvoid TestMethod (object obj)\n\t{\n\t\tint i = (int)obj + 1;\n\t\tTest ((long) obj);\n\t\t(obj as TestClass).Test (0);\n\t}\n}\";\n\t\t\tTest<RedundantCastIssue> (input, 0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 7065 - \"remove redundant type cast\" false positive for explicit interface implementation\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug7065 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\npublic class TestClass : IDisposable\n{\n\tvoid IDisposable.Dispose()\n\t{\n\t}\n\n\tvoid Foo()\n\t{\n\t    ((IDisposable)this).Dispose();\n\t}\n}\n\";\n\t\t\tTest<RedundantCastIssue> (input, 0);\n\t\t}\n\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 14081 - Incorrect redundant cast analysis with explicitly implemented interface member\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14081 ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\nusing System.Collections.Generic;\npublic class TestClass\n{\n\tpublic IEnumerator<int> GetEnumerator ()\n\t{\n\t\treturn ((IEnumerable<int>)new[] { 5 }).GetEnumerator ();\n\t}\n}\n\";\n\t\t\tTest<RedundantCastIssue> (input, 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestConditionalOperator ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"class A {} class B : A {} class C : A {}\nclass TestClass\n{\n\tvoid TestMethod (object obj)\n\t{\t\n\t\tvar a = obj != null ? (A)new A () : new B ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantConditionalOperator ()\n\t\t{\n\t\t\tTest<RedundantCastIssue> (@\"class A {} class B : A {} class C : A {}\nclass TestClass\n{\n\tvoid TestMethod (object obj)\n\t{\t\n\t\tvar a = obj != null ? (A)new A () : new A ();\n\t}\n}\", @\"class A {} class B : A {} class C : A {}\nclass TestClass\n{\n\tvoid TestMethod (object obj)\n\t{\t\n\t\tvar a = obj != null ? new A () : new A ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullCoalesingOperator ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"class A {} class B : A {} class C : A {}\nclass TestClass\n{\n\tvoid TestMethod (A obj)\n\t{\t\n\t\tvar a = (A)obj ?? new B ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantNullCoalesingOperatior ()\n\t\t{\n\t\t\tTest<RedundantCastIssue> (@\"class A {} class B : A {} class C : A {}\nclass TestClass\n{\n\tvoid TestMethod (A obj)\n\t{\t\n\t\tvar a = (A)obj ?? new A ();\n\t}\n}\", @\"class A {} class B : A {} class C : A {}\nclass TestClass\n{\n\tvoid TestMethod (A obj)\n\t{\t\n\t\tvar a = obj ?? new A ();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestNonRedundantDoubleCast ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\t\n\t\tfloat f = 5.6f;\n\t\tdouble d = 5.6f;\n\t\tint i = d + (int)f;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonRedundantFloatCast ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\t\n\t\tfloat f = 5.6f;\n\t\tConsole.WriteLine (\"\"foo \"\" + (int)f);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonRedundantFloatCastCase2 ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"\nusing System;\n\nclass Foo\n{\n\tvoid Bar ()\n\t{\t\n\t\tfloat f = 5.6f;\n\t\tConsole.WriteLine (\"\"foo {0}\"\", (int)f);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"https://github.com/icsharpcode/NRefactory/issues/118\")]\n\t\tpublic void TestNonRedundantCastDueToOverloading ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"\nclass Foo\n{\n\tvoid F(string a) {}\n\tvoid F(object a) {}\n\n\tvoid Bar ()\n\t{\t\n\t\tF((object)string.Empty);\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 17945 - Bad 'unnecessary cast' warning\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17945 ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"\nnamespace Bug\n{\n    public class C\n    {\n        public C (object o)\n        {\n        }\n \n        public C (string o)\n            : this (o as object)\n        {\n        }\n    }\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOverloadSelector ()\n\t\t{\n\t\t\tTestWrongContext<RedundantCastIssue> (@\"\npublic class Foo\n{\n\tpublic void Bar (object o)\n\t{\n\t}\n\n\tpublic void Bar (string o)\n\t    \n\t{\n \t\tBar ((object)o);\n\t}\n}\n\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantCatchClauseIssueTests.cs",
    "content": "//\n// RedundantCatchIssueTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantCatchClauseIssueTests : InspectionActionTestBase\n\t{\n\t\tconst string BaseInput = @\"\nusing System;\nclass A\n{\n\tvoid F()\n\t{\";\n\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = BaseInput + @\"\n// ReSharper disable once RedundantCatchClause\n\t\ttry {\n\t\t\tF ();\n\t\t} catch {\n\t\t\tthrow;\n\t\t} finally {\n\t\t\tConsole.WriteLine (\"\"Inside finally\"\");\n\t\t}\n\t}\n}\";\n            TestWrongContext<RedundantCatchClauseIssue>(input);\n        }\n\n\t\t[Test]\n\t\tpublic void TestEmptyCatch()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t} catch (ArgumentOutOfRangeException aoore) {\n\t\t\tConsole.WriteLine (aoore);\n\t\t} catch (ArgumentException) {\n\t\t\tthrow;\n\t\t} catch {\n\t\t\tthrow;\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n            var issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t} catch (ArgumentOutOfRangeException aoore) {\n\t\t\tConsole.WriteLine (aoore);\n\t\t}  \n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOnlyRedundantCatches()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t\tConsole.WriteLine (\"\"Inside try\"\");\n\t\t} catch {\n\t\t\tthrow;\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, BaseInput + @\"\n\t\tF ();\n\t\tConsole.WriteLine (\"\"Inside try\"\");\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddsBlockIfNeccessary()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\tif (true)\n\t\t\ttry {\n\t\t\t\tF ();\n\t\t\t\tConsole.WriteLine (\"\"Inside try\"\");\n\t\t\t} catch {\n\t\t\t\tthrow;\n\t\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, BaseInput + @\"\n\t\tif (true) {\n\t\t\tF ();\n\t\t\tConsole.WriteLine (\"\"Inside try\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void AddsBlockIfNeccessaryOnEmptyTryBlock()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\tif (true)\n\t\t\ttry {\n\t\t\t} catch {\n\t\t\t\tthrow;\n\t\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, BaseInput + @\"\n\t\tif (true) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EmptyTryCatchSkeleton()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\ttry {\n\t\t} catch {\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotAddBlockIfUnneccessary()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\tif (true)\n\t\t\ttry {\n\t\t\t\tF ();\n\t\t\t} catch {\n\t\t\t\tthrow;\n\t\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, BaseInput + @\"\n\t\tif (true)\n\t\t\tF ();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoIssuesWhenMissingCatch()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context, true);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmptyCatchWithFinally()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t} catch {\n\t\t\tthrow;\n\t\t} finally {\n\t\t\tConsole.WriteLine (\"\"Inside finally\"\");\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues, BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t}  finally {\n\t\t\tConsole.WriteLine (\"\"Inside finally\"\");\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12273 - Incorrect redundant catch warning\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug12273()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t} catch (ArgumentOutOfRangeException) {\n\t\t\tthrow;\n\t\t} catch (Exception e) {\n\t\t\tConsole.WriteLine (e);\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\n\t\t\tinput = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t} catch (ArgumentOutOfRangeException) {\n\t\t\tthrow;\n\t\t} catch (Exception e) {\n\t\t\tthrow;\n\t\t}\n\t}\n}\";\n\t\t\tissues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, BaseInput + @\"\n\t\tF ();\n\t}\n}\");\n\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12273 - Incorrect redundant catch warning\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug12273Case2()\n\t\t{\n\t\t\tvar input = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t} catch (ArgumentOutOfRangeException) {\n\t\t\tthrow;\n\t\t} catch {\n\t\t\tConsole.WriteLine (\"\"hello world\"\");\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\n\t\t\tinput = BaseInput + @\"\n\t\ttry {\n\t\t\tF ();\n\t\t} catch (ArgumentOutOfRangeException) {\n\t\t\tthrow;\n\t\t} catch {\n\t\t\tthrow;\n\t\t}\n\t}\n}\";\n\t\t\tissues = GetIssues(new RedundantCatchClauseIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\n\t\t/// <summary>\n\t\t/// Bug 14451 - False positive of \"Redundant catch clause\" \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBugBug14451()\n\t\t{\n\t\t\tTestWrongContext<RedundantCatchClauseIssue>(@\"\nusing System;\npublic class Test {\n    public void Foo() {\n        try {\n            Foo();\n        }\n        catch (Exception ex) {\n            throw new Exception(\"\"Some additional information: \"\" + ex.Message, ex);\n        }\n    }\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantCheckBeforeAssignmentTests.cs",
    "content": "﻿// \n// RedundantCheckBeforeAssignmentTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantCheckBeforeAssignmentTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tTest<RedundantCheckBeforeAssignmentIssue>(@\"using System;\nclass baseClass\n{\n\tpublic void method()\n\t{\n\t\tint q = 1;\n\t\tif (q != 1) {\n\t\t\tq = 1;\n\t\t}\n\t}\n}\n\", @\"using System;\nclass baseClass\n{\n\tpublic void method()\n\t{\n\t\tint q = 1;\n\t\tq = 1;\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tint q = 1;\n\t\t\tif (q != 1)\n\t\t\t\tq = 1;\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCheckBeforeAssignmentIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tint q = 1;\n\t\t\tif (1+0 != q)\n\t\t\t{\n\t\t\t\tq = 1 + 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{}\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCheckBeforeAssignmentIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase4()\n\t\t{\n\t\t\tvar input = @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tint q = 1;\n\t\t\tif (1+0 != q)\n\t\t\t{\n\t\t\t\tq = 1 + 0;\n\t\t\t}\n\t\t\telse if(true)\n\t\t\t{}\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCheckBeforeAssignmentIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\nnamespace resharper_test\n{\n\tpublic class baseClass\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tint q = 1;\n//Resharper disable RedundantCheckBeforeAssignment\n\t\t\tif (q != 1)\n\t\t\t{\n\t\t\t\tq = 1;\n\t\t\t}\n//Resharper restore RedundantCheckBeforeAssignment\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantCheckBeforeAssignmentIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantCommaInArrayInitializerIssueTests.cs",
    "content": "﻿// \n// RedundantCommaInArrayInitializerIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantCommaInArrayInitializerIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new int[] { 1, 2, };\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new int[] { 1, 2 };\n\t}\n}\";\n\t\t\tTest<RedundantCommaInArrayInitializerIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArrayInitializerDescription ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new int[] { 1, 2, };\n\t}\n}\";\n\t\t\tTestRefactoringContext ctx;\n\t\t\tvar issues = GetIssues (new RedundantCommaInArrayInitializerIssue (), input, out ctx);\n\t\t\tAssert.AreEqual (issues.Count, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObjectInitializerDescription ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint Prop { get; set; }\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new TestClass { Prop = 1, };\n\t}\n}\";\n\t\t\tTestRefactoringContext ctx;\n\t\t\tvar issues = GetIssues (new RedundantCommaInArrayInitializerIssue (), input, out ctx);\n\t\t\tAssert.AreEqual (issues.Count, 1);\n\t\t}\n\n        [Test]\n        public void TestCollectionInitializerDescrition()\n        {\n            var input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar a = new TestClass { 1, };\n\t}\n}\";\n            TestRefactoringContext ctx;\n            var issues = GetIssues(new RedundantCommaInArrayInitializerIssue(), input, out ctx);\n            Assert.AreEqual(issues.Count, 1);\n        }\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{            \n// ReSharper disable once RedundantCommaInArrayInitializer\n\t\tvar a = new TestClass { 1, };\n\t}\n}\";\n            TestWrongContext<RedundantCommaInArrayInitializerIssue>(input);\n        }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantComparisonWithNullIssueTests.cs",
    "content": "// \n// RedundantComparisonWithNullIssueTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantComparisonWithNullIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;class Test {public void test(){int a = 0;if(a is int && a != null){a = 1;}}}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantComparisonWithNullIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\t\n\t\t\tCheckFix(context, issues, @\"using System;class Test {public void test(){int a = 0;\n\t\tif (a is int) {\n\t\t\ta = 1;\n\t\t}}}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisable()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Test {\n\tpublic void test(){\n\tint a = 0;\n\t//Resharper disable RedundantComparisonWithNull\n\tif(a is int && a != null)\n\t{a = 1;}\n\t//Resharper restore RedundantComparisonWithNull\n\t}\t\n\t}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantComparisonWithNullIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;class Test {public void test(){int a = 0;while(a != null && a is int){a = 1;}}}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantComparisonWithNullIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;class Test {public void test(){int a = 0;\n\t\twhile (a is int) {\n\t\t\ta = 1;\n\t\t}}}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseWithFullParens()\n\t\t{\n\t\t\tvar input = \n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test(object o)\n\t{\n\t\tif (!((o is int) && (o != null))) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantComparisonWithNullIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;\nclass TestClass\n{\n\tpublic void Test(object o)\n\t{\n\t\tif (!(o is int)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n        [Test]\n        public void TestDisable()\n        {\n            var input =\n                @\"using System;\nclass TestClass\n{\n\tpublic void Test(object o)\n\t{\n// ReSharper disable once RedundantComparisonWithNull\n\t\tif (!((o is int) && (o != null))) {\n\t\t}\n\t}\n}\";\n\n            TestRefactoringContext context;\n            var issues = GetIssues(new RedundantComparisonWithNullIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n\n\n\t\t[Ignore(\"Extended version\")]\n\t\t[Test]\n\t\tpublic void TestNegatedCase()\n\t\t{\n\t\t\tvar input = \n\t\t\t\t@\"using System;\nclass TestClass\n{\n\tpublic void Test(object o)\n\t{\n\t\tif (null == o || !(o is int)) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantComparisonWithNullIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;\nclass TestClass\n{\n\tpublic void Test(object o)\n\t{\n\t\tif (!(o is int)) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantDefaultFieldInitializerIssueTests.cs",
    "content": "﻿// \n// RedundantDefaultFieldInitializerIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantDefaultFieldInitializerIssueTests : InspectionActionTestBase\n\t{\n\n\t    [Test]\n\t\tpublic void TestRedundantIntInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint i = 0;\n\tlong l = 0L;\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint i;\n\tlong l;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 2, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantFloatInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tdouble d = 0;\n\tdouble d2 = 0.0;\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tdouble d;\n\tdouble d2;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 2, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantBooleanInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tbool x = false;\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tbool x;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantCharInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tchar ch = '\\0';\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tchar ch;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantReferenceTypeInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tstring str = null;\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tstring str;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantDynamicInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tdynamic x = null, y = null;\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tdynamic x, y;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 2, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantStructInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nstruct TestStruct\n{\n}\nclass TestClass\n{\n\tTestStruct x = new TestStruct ();\n}\";\n\t\t\tvar output = @\"\nstruct TestStruct\n{\n}\nclass TestClass\n{\n\tTestStruct x;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 1, output);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRedundantNullableInitializer ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint? i = null;\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint? i;\n}\";\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (input, 1, output);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestRedundantConstantBug ()\n\t\t{\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (@\"class Test { const int foo = 0;  }\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantReadOnlyBug ()\n\t\t{\n\t\t\tTest<RedundantDefaultFieldInitializerIssue> (@\"struct Test { static readonly Test foo = new Test ();  }\", 0);\n\t\t}\n\n\t\t[Test]\n        public void TestDisable()\n        {\n            var input = @\"\nclass TestClass\n{\n    // ReSharper disable once RedundantDefaultFieldInitializer\n\tint i = 0;\n}\";\n            TestWrongContext<RedundantDefaultFieldInitializerIssue>(input);\n        }\n\n\n\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantDelegateCreationIssueTests.cs",
    "content": "//\n// RedundantDelegateCreationIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantDelegateCreationIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAdd ()\n\t\t{\n\t\t\tTest<RedundantDelegateCreationIssue>(@\"\nusing System;\n\npublic class FooBase\n{\n\tpublic event EventHandler<EventArgs> Changed;\n\n\tFooBase()\n\t{\n\t\tChanged += new EventHandler<EventArgs>(HandleChanged);\n\t}\n\n\tvoid HandleChanged(object sender, EventArgs e)\n\t{\n\t}\n}\", @\"\nusing System;\n\npublic class FooBase\n{\n\tpublic event EventHandler<EventArgs> Changed;\n\n\tFooBase()\n\t{\n\t\tChanged += HandleChanged;\n\t}\n\n\tvoid HandleChanged(object sender, EventArgs e)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemove ()\n\t\t{\n\t\t\tTest<RedundantDelegateCreationIssue>(@\"\nusing System;\n\npublic class FooBase\n{\n\tpublic event EventHandler<EventArgs> Changed;\n\n\tFooBase()\n\t{\n\t\tChanged -= new EventHandler<EventArgs>(HandleChanged);\n\t}\n\n\tvoid HandleChanged(object sender, EventArgs e)\n\t{\n\t}\n}\", @\"\nusing System;\n\npublic class FooBase\n{\n\tpublic event EventHandler<EventArgs> Changed;\n\n\tFooBase()\n\t{\n\t\tChanged -= HandleChanged;\n\t}\n\n\tvoid HandleChanged(object sender, EventArgs e)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RedundantDelegateCreationIssue>(@\"\nusing System;\n\npublic class FooBase\n{\n\tpublic event EventHandler<EventArgs> Changed;\n\n\tFooBase()\n\t{\n\t\t// ReSharper disable once RedundantDelegateCreation\n\t\tChanged += new EventHandler<EventArgs>(HandleChanged);\n\t}\n\n\tvoid HandleChanged(object sender, EventArgs e)\n\t{\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantEmptyDefaultSwitchBranchIssueTests.cs",
    "content": "//\n// RedundantEmptyDefaultSwitchBranchIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantEmptyDefaultSwitchBranchIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestDefaultRedundantCase ()\n\t\t{\n\t\t\tTest<RedundantEmptyDefaultSwitchBranchIssue>(@\"\nclass Test\n{\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\tcase 0:\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\tcase 0:\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMinimal ()\n\t\t{\n\t\t\tTest<RedundantEmptyDefaultSwitchBranchIssue>(@\"\nclass Test\n{\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RedundantEmptyDefaultSwitchBranchIssue>(@\"\nclass Test\n{\n\tvoid TestMethod (int i = 0)\n\t{\n\t\tswitch (i) {\n\t\tcase 0:\n\t\t\tSystem.Console.WriteLine();\n\t\t\tbreak;\n\t\t// ReSharper disable once RedundantEmptyDefaultSwitchBranch\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantEmptyFinallyBlockIssueTests.cs",
    "content": "//\n// RedundantEmptyFinallyBlockIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantEmptyFinallyBlockIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestRedundantTry()\n\t\t{\n\t\t\tTest<RedundantEmptyFinallyBlockIssue>(@\"\nusing System;\nclass Test\n{\n\tstatic void Main (string[] args)\n\t{\n\t\ttry {\n\t\t\tConsole.WriteLine (\"\"1\"\");\n\t\t\tConsole.WriteLine (\"\"2\"\");\n\t\t} finally {\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nclass Test\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tConsole.WriteLine (\"\"1\"\");\n\t\tConsole.WriteLine (\"\"2\"\");\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<RedundantEmptyFinallyBlockIssue>(@\"\nusing System;\nclass Test\n{\n\tstatic void Main (string[] args)\n\t{\n\t\ttry {\n\t\t\tConsole.WriteLine (\"\"1\"\");\n\t\t\tConsole.WriteLine (\"\"2\"\");\n\t\t} catch (Exception) {\n\t\t} finally {\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nclass Test\n{\n\tstatic void Main (string[] args)\n\t{\n\t\ttry {\n\t\t\tConsole.WriteLine (\"\"1\"\");\n\t\t\tConsole.WriteLine (\"\"2\"\");\n\t\t} catch (Exception) {\n\t\t}  \n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<RedundantEmptyFinallyBlockIssue>(@\"\nusing System;\nclass Test\n{\n\tstatic void Main(string[] args)\n\t{\n\t\ttry {\n\t\t\tConsole.WriteLine(\"\"1\"\");\n\t\t} finally {\n\t\t\tConsole.WriteLine(\"\"2\"\");\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantEmptyFinallyBlockIssue>(@\"\nusing System;\nclass Test\n{\n\tstatic void Main(string[] args)\n\t{\n\t\ttry {\n\t\t\tConsole.WriteLine(\"\"1\"\");\n\t\t\tConsole.WriteLine(\"\"2\"\");\n\t\t}\n\t\t// ReSharper disable once RedundantEmptyFinallyBlock\n \t\tfinally {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantEnumerableCastCallIssueTests.cs",
    "content": "//\n// RedundantEnumerableCastCallIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantEnumerableCastCallIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestRedundantCast()\n\t\t{\n\t\t\tTest<RedundantEnumerableCastCallIssue>(@\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\tvar a = args.Cast<string> ();\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\tvar a = args;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantCastCase2()\n\t\t{\n\t\t\tTest<RedundantEnumerableCastCallIssue>(@\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tvar a = args.Cast<string> ();\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (string[] args)\n\t{\n\t\tvar a = args;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantOfType()\n\t\t{\n\t\t\tTest<RedundantEnumerableCastCallIssue>(@\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\tvar a = args.OfType<string> ();\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\tvar a = args.Where (i => i != null);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantOfTypeResolution2()\n\t\t{\n\t\t\tTest<RedundantEnumerableCastCallIssue>(@\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\tvar a = args.OfType<string> ();\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\tvar a = args;\n\t}\n}\n\", 1);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<RedundantEnumerableCastCallIssue>(@\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\tvar a = args.Cast<object> ();\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantEnumerableCastCallIssue>(@\"\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Test\n{\n\tstatic void Main (IEnumerable<string> args)\n\t{\n\t\t// ReSharper disable once RedundantEnumerableCastCall\n\t\tvar a = args.Cast<string> ();\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantExplicitArrayCreationIssueTests.cs",
    "content": "//\n// RedundantExplicitArrayCreationIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantExplicitArrayCreationIssueTests: InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<RedundantExplicitArrayCreationIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tnew int[] { 1, 2, 3 };\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tnew [] { 1, 2, 3 };\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitArrayCreationIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tnew [] { 1, 2, 3 };\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase2()\n\t\t{\n\n\t\t\tTestWrongContext<RedundantExplicitArrayCreationIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tnew long[] { 0, 1u, (byte)34 };\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitArrayCreationIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\t// ReSharper disable once RedundantExplicitArrayCreation\n\t\tnew int[] { 1, 2, 3 };\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantExplicitArraySizeIssueTests.cs",
    "content": "//\n// RedundantExplicitArraySizeIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantExplicitArraySizeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<RedundantExplicitArraySizeIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tvar foo = new int[3] { 1, 2, 3 };\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tvar foo = new int[] { 1, 2, 3 };\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase1()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitArraySizeIssue>(@\"\nclass Test\n{\n\tvoid Foo (int i)\n\t{\n\t\tvar foo = new int[i] { 1, 2, 3 };\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase2()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitArraySizeIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tvar foo = new int[10];\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase3()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitArraySizeIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tvar foo = new int[0];\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitArraySizeIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\t// ReSharper disable once RedundantExplicitArraySize\n\t\tvar foo = new int[3] { 1, 2, 3 };\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantExplicitNullableCreationIssueTests.cs",
    "content": "//\n// RedundantExplicitNullableCreationIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantExplicitNullableCreationIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestVariableCreation()\n\t\t{\n\t\t\tTest<RedundantExplicitNullableCreationIssue>(@\"\nclass FooBar\n{\n\tvoid Test()\n\t{\n\t\tint? i = new int?(5);\n\t}\n}\n\", @\"\nclass FooBar\n{\n\tvoid Test()\n\t{\n\t\tint? i = 5;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLongForm()\n\t\t{\n\t\t\tTest<RedundantExplicitNullableCreationIssue>(@\"\nclass FooBar\n{\n\tvoid Test()\n\t{\n\t\tint? i = new System.Nullable<int>(5);\n\t}\n}\n\", @\"\nclass FooBar\n{\n\tvoid Test()\n\t{\n\t\tint? i = 5;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitNullableCreationIssue>(@\"\nclass FooBar\n{\n\tvoid Test()\n\t{\n\t\tvar i = new int?(5);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantExplicitNullableCreationIssue>(@\"\nclass FooBar\n{\n\tvoid Test()\n\t{\n\t\t// ReSharper disable once RedundantExplicitNullableCreation\n\t\tint? i = new int?(5);\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantExtendsListEntryIssueTests.cs",
    "content": "﻿// \n// RedundantBaseTypeTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantExtendsListEntryIssueTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nnamespace resharper_test\n{\n\tpublic interface interf\n\t{\n\t\tvoid method();\n\t}\n\n\tpublic class baseClass:interf\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t}\n\n\tpublic partial class Foo: baseClass,interf\n\t{\n\t}\n\tpublic partial class Foo \n\t{\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantExtendsListEntryIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;\n\nnamespace resharper_test\n{\n\tpublic interface interf\n\t{\n\t\tvoid method();\n\t}\n\n\tpublic class baseClass:interf\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t}\n\n\tpublic partial class Foo: baseClass\n\t{\n\t}\n\tpublic partial class Foo \n\t{\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nnamespace resharper_test\n{\n\tpublic interface interf\n\t{\n\t\tvoid method();\n\t}\n\n\tpublic class baseClass:interf\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t}\n\n\tpublic partial class Foo: baseClass\n\t{\n\t}\n\tpublic partial class Foo: baseClass\n\t{\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantExtendsListEntryIssue(), input, out context);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System;\n\nnamespace resharper_test\n{\n\tpublic interface interf\n\t{\n\t\tvoid method();\n\t}\n\n\tpublic class baseClass:interf\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t}\n\n\tpublic partial class Foo \n\t{\n\t}\n\tpublic partial class Foo \n\t{\n\t}\n}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nnamespace resharper_test\n{\n\tpublic interface interf\n\t{\n\t\tvoid method();\n\t}\n\n\tpublic class baseClass:interf\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t}\n\n\tpublic class Foo: baseClass, interf\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t}\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantExtendsListEntryIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nnamespace resharper_test\n{\n\tpublic interface interf\n\t{\n\t\tvoid method();\n\t}\n\n\tpublic class baseClass:interf\n\t{\n\t\tpublic void method()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t}\n//Resharper disable RedundantExtendsListEntry\n\tpublic class Foo: baseClass, interf\n\t{\n\t}\n//Resharer restore RedundantExtendsListEntry\n}\n\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantExtendsListEntryIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantIfElseBlockIssueTests.cs",
    "content": "﻿// \n// RedundantIfElseBlockIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantIfElseBlockIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestReturn()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tif (i > 0)\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tif (i > 0)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tif (i > 0)\n\t\t\treturn 1;\n// ReSharper disable once RedundantIfElseBlock\n\t\telse\n\t\t\treturn 0;\n\t}\n}\";\n\t\t\tTestWrongContext<RedundantIfElseBlockIssue>(input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBreakLoop()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint k = 0;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i > 5)\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\t\tk++;\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint k = 0;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i > 5)\n\t\t\t\tbreak;\n\t\t\tk++;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContinueLoop()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint k = 0;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i > 5)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\tk++;\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint k = 0;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i > 5)\n\t\t\t\tcontinue;\n\t\t\tk++;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlockStatement()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tif (i > 0) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tint TestMethod (int i)\n\t{\n\t\tif (i > 0) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmptyFalseBlock()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tif (i > 0)\n\t\t\ta = 1;\n\t\telse { }\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tif (i > 0)\n\t\t\ta = 1;\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNecessaryElse()\n\t\t{\n\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\tif (i > 0)\n\t\t\ta = 1;\n\t\telse\n\t\t\ta = 0;\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNecessaryElseCase2()\n\t\t{\n\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tint a;\n\t\twhile (true) {\n\t\t\tif (i > 0) {\n\t\t\t\ta = 1;\n\t\t\t} else if (i < 0) {\n\t\t\t\ta = 0;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\n\t\tpublic void TestNecessaryElseBecauseOfVarDeclaration()\n\t\t{\n\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\tif (i > 0) {\n\t\t\tint a = 1;\n\t\t\treturn;\n\t\t} else {\n\t\t\tint a = 2;\n\t\t\treturn;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNecessaryElseBecauseOfVarDeclarationInDifferentStatement()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod (int i)\n\t{\n\t\t{\n\t\t\tint a = 1;\n\t\t}\n\t\tif (i > 0) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tint a = 2;\n\t\t\treturn;\n\t\t}\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturn2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tbool? EvaluateCondition (Expression expr)\n\t{\n\t\tResolveResult rr = EvaluateConstant (expr);\n\t\tif (rr != null && rr.IsCompileTimeConstant)\n\t\t\treturn rr.ConstantValue as bool?;\n\t\telse\n\t\t\treturn null;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tbool? EvaluateCondition (Expression expr)\n\t{\n\t\tResolveResult rr = EvaluateConstant (expr);\n\t\tif (rr != null && rr.IsCompileTimeConstant)\n\t\t\treturn rr.ConstantValue as bool?;\n\t\treturn null;\n\t}\n}\";\n\t\t\tTest<RedundantIfElseBlockIssue>(input, 1, output);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantInternalInspectorTests.cs",
    "content": "// \n// RedundantInternalInspectorTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantInternalInspectorTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"namespace Test {\n\tinternal class Foo\n\t{\n\t\tinternal void Bar (string str)\n\t\t{\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantInternalIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\n\t\t\tCheckFix (context, issues [0], @\"namespace Test {\n\tclass Foo\n\t{\n\t\tinternal void Bar (string str)\n\t\t{\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestNestedClass ()\n\t\t{\n\t\t\tTestWrongContext<RedundantInternalIssue>(@\"class Foo\n{\n\tinternal class Nested\n\t{\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantLambdaParameterTypeTests.cs",
    "content": "// \n// RedundantLambdaParameterTypeTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantLambdaParameterTypeTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tTest<RedundantLambdaParameterTypeIssue>(@\"\nclass Program\n{\n\tpublic delegate int IncreaseByANumber(int j);\n\n\tpublic static void ExecuteCSharp3_0()\n\t{\n\t\tIncreaseByANumber increase = (int j) => (j * 42);\n\t}\n}\n\", @\"\nclass Program\n{\n\tpublic delegate int IncreaseByANumber(int j);\n\n\tpublic static void ExecuteCSharp3_0()\n\t{\n\t\tIncreaseByANumber increase = j => (j * 42);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MultipleCases()\n\t\t{\n\t\t\tTest<RedundantLambdaParameterTypeIssue>(@\"\nclass Program\n{\n\tpublic delegate int MultipleIncreaseByANumber(int i, string j, int l);\n\n\tpublic static void ExecuteCSharp3_0()\n\t{\n\t\tMultipleIncreaseByANumber multiple = (int j, string k, int l) => ((j * 42) / k) % l;\n\t}\n}\n\", 3, @\"\nclass Program\n{\n\tpublic delegate int MultipleIncreaseByANumber(int i, string j, int l);\n\n\tpublic static void ExecuteCSharp3_0()\n\t{\n\t\tMultipleIncreaseByANumber multiple = (j, k, l) => ((j * 42) / k) % l;\n\t}\n}\n\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tTest<RedundantLambdaParameterTypeIssue>(@\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace application\n{\n\tinternal class Program\n\t{\n\t\tpublic void Foo(Action<int, string> act) {}\n\t\tpublic void Foo(Action<int> act) {}\n\n\t\tvoid Test ()\n\t\t{\n\t\t\tFoo((int i) => Console.WriteLine (i));\n\t\t}\n\t}\n}\", @\"\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace application\n{\n\tinternal class Program\n\t{\n\t\tpublic void Foo(Action<int, string> act) {}\n\t\tpublic void Foo(Action<int> act) {}\n\n\t\tvoid Test ()\n\t\t{\n\t\t\tFoo(i => Console.WriteLine (i));\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace application\n{\n\tinternal class Program\n\t{\n\t\tpublic void Foo(Action<int> act, Action<int> act1) { }\n\t\tpublic void Foo(Action<string> act, Action<int> act1) { }\n\n\t\tvoid Test()\n\t\t{\n\t\t\tFoo(((int i) => Console.WriteLine(i)), (i => Console.WriteLine(i)));\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantLambdaParameterTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInvalidContext()\n\t\t{\n\t\t\tvar input = @\"using System;\n\t\tusing System.Collections.Generic;\n\t\tusing System.Linq;\n\nnamespace application\n{\n\tinternal class Program\n\t{\n\t\tpublic void Foo(Action<int> act) {}\n\t\tpublic void Foo(Action<string> act) {}\n\n\t\tvoid Test ()\n\t\t{\n\t\t\tFoo((int i) => Console.WriteLine (i));\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantLambdaParameterTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"using System;\n\t\tusing System.Collections.Generic;\n\t\tusing System.Linq;\n\nnamespace application\n{\n\tinternal class Program\n\t{\n\t\tpublic delegate int IncreaseByANumber(int j);\n\n\t\tpublic delegate int MultipleIncreaseByANumber(int i, int j, int l);\n\n\t\tpublic static void ExecuteCSharp3_0()\n\t\t{\n\t\t\t// declare the lambda expression\n\t\t\t//Resharper disable RedundantLambdaParameterType\n\t\t\tIncreaseByANumber increase = (int j) => (j * 42);\n\t\t\t//Resharper restore RedundantLambdaParameterType\n\t\t\t// invoke the method and print 420 to the console\n\t\t\tConsole.WriteLine(increase(10));\n\n\t\t\tMultipleIncreaseByANumber multiple = (j, k, l) => ((j * 42) / k) % l;\n\t\t\tConsole.WriteLine(multiple(10, 11, 12));\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantLambdaParameterTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantLambdaSignatureParenthesesIssueTests.cs",
    "content": "//\n// RedundantLambdaSignatureParenthesesIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantLambdaSignatureParenthesesIssueTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void SimpleCase()\n\t\t{\n\t\t\tTest<RedundantLambdaSignatureParenthesesIssue>(@\"\nclass Program\n{\n\tpublic delegate int MyDel(int j);\n\n\tpublic static void Foo()\n\t{\n\t\tMyDel increase = (j) => (j * 42);\n\t}\n}\n\", 2, @\"\nclass Program\n{\n\tpublic delegate int MyDel(int j);\n\n\tpublic static void Foo()\n\t{\n\t\tMyDel increase = j => (j * 42);\n\t}\n}\n\", 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvalidCase1()\n\t\t{\n\t\t\tTestWrongContext<RedundantLambdaSignatureParenthesesIssue>(@\"\nclass Program\n{\n\tpublic delegate int MyDel(int j);\n\n\tpublic static void Foo()\n\t{\n\t\tMyDel increase = (int j) => (j * 42);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvalidCase2()\n\t\t{\n\t\t\tTestWrongContext<RedundantLambdaSignatureParenthesesIssue>(@\"\nusing System;\n\nclass Program\n{\n\tpublic static void Foo()\n\t{\n\t\tAction<int, int> act = (i, j) => (j * j);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<RedundantLambdaSignatureParenthesesIssue>(@\"\nclass Program\n{\n\tpublic delegate int MyDel(int j);\n\n\tpublic static void Foo()\n\t{\n\t\tMyDel increase = j => (j * 42);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantLambdaSignatureParenthesesIssue>(@\"\nclass Program\n{\n\tpublic delegate int MyDel(int j);\n\n\tpublic static void Foo()\n\t{\n// ReSharper disable RedundantLambdaSignatureParentheses\n\t\tMyDel increase = (j) => (j * 42);\n// ReSharper restore RedundantLambdaSignatureParentheses\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantLogicalConditionalExpressionOperandIssueTests.cs",
    "content": "//\n// RedundantLogicalConditionalExpressionOperandIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantLogicalConditionalExpressionOperandIssueTests: InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestTrue()\n\t\t{\n\t\t\tTest<RedundantLogicalConditionalExpressionOperandIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (true || b) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTrueCase2()\n\t\t{\n\t\t\tTest<RedundantLogicalConditionalExpressionOperandIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (b || (((true)))) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFalse()\n\t\t{\n\t\t\tTest<RedundantLogicalConditionalExpressionOperandIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (false && b) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFalseCase2()\n\t\t{\n\t\t\tTest<RedundantLogicalConditionalExpressionOperandIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (b && (((false)))) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<RedundantLogicalConditionalExpressionOperandIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (false || b) {\n\t\t}\n\t\tif (true && b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<RedundantLogicalConditionalExpressionOperandIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\t// ReSharper disable once RedundantLogicalConditionalExpressionOperand\n\t\tif (true || b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantNameQualifierIssueTests.cs",
    "content": "﻿// \n// RedundantNameQualifierIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantNameQualifierIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tSystem.Console.WriteLine ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantNameQualifierIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tConsole.WriteLine ();\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2 ()\n\t\t{\n\t\t\tvar input = @\"using System.Text;\nclass Foo\n{\n\tvoid Bar (System.Text.StringBuilder b)\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantNameQualifierIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"using System.Text;\nclass Foo\n{\n\tvoid Bar (StringBuilder b)\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UsingAlias()\n\t\t{\n\t\t\tvar input = @\"using IEnumerable = System.Collections.IEnumerable;\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantNameQualifierIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"using System;\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n// ReSharper disable RedundantNameQualifier\n            System.Console.WriteLine();\n// ReSharper restore RedundantNameQualifier\n\t}\n}\";\n\n            TestRefactoringContext context;\n            var issues = GetIssues(new RedundantNameQualifierIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantNotNullAttributeInNonNullableTypeTests.cs",
    "content": "// \n// RedundantNotNullAttributeInNonNullableTypeTests.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantNotNullAttributeTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestValidReturn() {\n\t\t\tTestWrongContext<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tobject NotNull() {\n\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantReturn() {\n\t\t\tTest<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tint NotNull() {\n\t\treturn 1;\n\t}\n}\", @\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Method)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tint NotNull() {\n\t\treturn 1;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidField() {\n\t\t\tTestWrongContext<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Field)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tobject NotNullField;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidNullable() {\n\t\t\tTestWrongContext<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Field)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tint? NotNullField;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantField() {\n\t\t\tTest<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Field)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tint NotNullField;\n}\", @\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Field)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tint NotNullField;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantFixedField() {\n\t\t\tTest<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Field)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nunsafe struct TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tfixed object NotNullField[1024];\n}\", @\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Field)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nunsafe struct TestClass\n{\n\tfixed object NotNullField[1024];\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantProperty() {\n\t\t\tTest<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Property)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\t[JetBrains.Annotations.NotNull]\n\tint NotNullField { get; set; }\n}\", @\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Property)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tint NotNullField { get; set; }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantParameter() {\n\t\t\tTest<RedundantNotNullAttributeInNonNullableTypeIssue>(@\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tvoid Foo([JetBrains.Annotations.NotNull]int x) {}\n}\", @\"namespace JetBrains.Annotations\n{\n\t[System.AttributeUsage(System.AttributeTargets.Parameter)]\n\tclass NotNullAttribute : System.Attribute\n\t{\n\t}\n}\nclass TestClass\n{\n\tvoid Foo(int x) {}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantObjectCreationArgumentListIssueTests.cs",
    "content": "﻿// \n// RedundantObjectCreationArgumentListIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantObjectCreationArgumentListIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic int Prop { get; set; }\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass () {\n\t\t\tProp = 1\n\t\t};\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tpublic int Prop { get; set; }\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass {\n\t\t\tProp = 1\n\t\t};\n\t}\n}\";\n\t\t\tTest<RedundantObjectCreationArgumentListIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic TestClass () { }\n\tpublic TestClass (int i) { }\n\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass { };\n\t\tvar y = new TestClass (1) { };\n\t}\n}\";\n\t\t\tTest<RedundantObjectCreationArgumentListIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic int Prop { get; set; }\n\tvoid TestMethod ()\n\t{\n\t\t// ReSharper disable once RedundantEmptyObjectCreationArgumentList\n\t\tvar x = new TestClass () {\n\t\t\tProp = 1\n\t\t};\n\t}\n}\";\n\t\t\tTest<RedundantObjectCreationArgumentListIssue> (input, 0);\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantObjectOrCollectionInitializerIssueTests.cs",
    "content": "﻿// \n// RedundantObjectOrCollectionInitializerIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n   \n\t[TestFixture]\n\tpublic class RedundantObjectOrCollectionInitializerIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void Test ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass () { };\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass ();\n\t}\n}\";\n            Test<RedundantObjectOrCollectionInitializerIssue>(input, 1, output);\n\t\t}\n\n        [Test]\n\t    public void TestDisable()\n\t    {\n            TestWrongContext<RedundantObjectOrCollectionInitializerIssue>(@\" class TestClass\n    {\n        void TestMethod()\n        {\n// ReSharper disable once RedundantEmptyObjectOrCollectionInitializer\n            var x = new TestClass() { };\n        }\n    }\");\n\t    }\n\n\t\t[Test]\n\t\tpublic void TestNoArgumentList ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass { };\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass ();\n\t}\n}\";\n\t\t\tTest<RedundantObjectOrCollectionInitializerIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tpublic int Prop { get; set; }\n\tvoid TestMethod ()\n\t{\n\t\tvar x = new TestClass ();\n\t\tvar y = new TestClass () { Prop = 1 };\n\t}\n}\";\n\t\t\tTest<RedundantObjectOrCollectionInitializerIssue> (input, 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantOverridenMemberTests.cs",
    "content": "// \n// RedundantOverridenMemberTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun<jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantOverridenMemberTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tvar input = @\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tvirtual public void run()\n\t\t{\n\t\t\tint a = 1+1;\n\t\t}\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t\toverride public void run()\n\t\t{\n\t\t\tbase.run();\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\t\n\t\t\tCheckFix(context, issues, @\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tvirtual public void run()\n\t\t{\n\t\t\tint a = 1+1;\n\t\t}\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisable()\n\t\t{\n\t\t\tvar input = @\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tvirtual public void run()\n\t\t{\n\t\t\tint a = 1+1;\n\t\t}\n\t}\n\t//Resharper disable RedundantOverridenMember\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t\toverride public void run()\n\t\t{\n\t\t\tbase.run();\n\t\t}\n\t}\n\t//Resharper restore RedundantOverridenMember\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tvar input = @\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tvirtual public void run()\n\t\t{\n\t\t\tint a = 1+1;\n\t\t}\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t\toverride public void run()\n\t\t{\n\t\t\tint b = 1+1;\n\t\t\tbase.run();\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTestInspectorCase3()\n\t\t{\n\t\t\tvar input = \n\t\t\t\t@\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tvirtual public void run()\n\t\t{\n\t\t\tint a = 1+1;\n\t\t}\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t\tpublic void run1()\n\t\t{\n\t\t\tbase.run();\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTestInspectorCase4()\n\t\t{\n\t\t\tvar input = \n\t\t\t\t@\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tprivate int a;\n\t\tvirtual public int A\n\t\t{\n\t\t\tget{ return a; }\n\t\t\tset{ a = value; }\n\t\t}\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t\tpublic override int A\n\t\t{\n\t\t\tget{ return base.A; }\n\t\t\tset{ base.A = value; }\n\t\t}\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\t\t\tCheckFix(context, issues,\n@\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tprivate int a;\n\t\tvirtual public int A\n\t\t{\n\t\t\tget{ return a; }\n\t\t\tset{ a = value; }\n\t\t}\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTestInspectorCase5()\n\t\t{\n\t\t\tvar input = \n\t\t\t\t@\"namespace Application\n{\n\tpublic class SampleCollection<T>\n\t{ \n\t\tprivate T[] arr = new T[100];\n\t\tpublic virtual T this[int i]\n\t\t{\n\t\t\tget{ return arr[i];}\n\t\t\tset{ arr[i] = value;}\n\t\t}\n\t}\n\n\tclass Class2<T> : SampleCollection<T>\n\t{\n\t\tpublic override T this[int i]\n\t\t{\n\t\t\tget { return base[i];}\n\t\t\tset { base[i] = value; }\n\t\t}\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues,\n\t\t\t@\"namespace Application\n{\n\tpublic class SampleCollection<T>\n\t{ \n\t\tprivate T[] arr = new T[100];\n\t\tpublic virtual T this[int i]\n\t\t{\n\t\t\tget{ return arr[i];}\n\t\t\tset{ arr[i] = value;}\n\t\t}\n\t}\n\n\tclass Class2<T> : SampleCollection<T>\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTestInspectorCase6()\n\t\t{\n\t\t\tvar input = \n\t\t\t\t@\"using System;\nusing System.IO;\n\npartial class A\n{\n\tpublic virtual int AProperty\n\t{\n\t\tget;\n\t\tset;\n\t}\n\n\tpublic virtual int this[int i]\n\t{\n\t\tget { return i; }\n\t\tset { Console.WriteLine(value); }\n\t}\n}\n\nclass B : A\n{\n\tpublic override int AProperty\n\t{\n\t\tset\n\t\t{\n\t\t\tbase.AProperty = value;\n\t\t}\n\t}\n\tpublic override int this[int i]\n\t{\n\t\tget\n\t\t{\n\t\t\treturn base[i];\n\t\t}\n\t}\n\tpublic override string ToString()\n\t{\n\t\treturn base.ToString();\n\t}\n}\n\nclass C : A\n{\n\tpublic override int AProperty\n\t{\n\t\tget\n\t\t{\n\t\t\treturn base.AProperty;\n\t\t}\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(4, issues.Count);\n\t\t\t\n\t\t\tCheckFix(context, issues,\n\t\t\t@\"using System;\nusing System.IO;\n\npartial class A\n{\n\tpublic virtual int AProperty\n\t{\n\t\tget;\n\t\tset;\n\t}\n\n\tpublic virtual int this[int i]\n\t{\n\t\tget { return i; }\n\t\tset { Console.WriteLine(value); }\n\t}\n}\n\nclass B : A\n{\n}\n\nclass C : A\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantEvent()\n\t\t{\n\t\t\tvar input = @\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic virtual event EventHandler FooBar { add {} remove {} }\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t\tpublic override event EventHandler FooBar { add { base.FooBar += value; } remove { base.FooBar -= value; } }\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new RedundantOverridenMemberIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\n\n\t\t\tCheckFix(context, issues, @\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic virtual event EventHandler FooBar { add {} remove {} }\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestNonRedundantEvent()\n\t\t{\n\t\t\tvar input = @\"namespace Demo\n{\n\tpublic class BaseClass\n\t{\n\t\tpublic virtual event EventHandler FooBar { add {} remove {} }\n\t\tpublic virtual event EventHandler FooBar2 { add {} remove {} }\n\t}\n\tpublic class CSharpDemo:BaseClass\n\t{\n\t\tpublic override event EventHandler FooBar { add { base.FooBar += value; } remove { base.FooBar2 -= value; } }\n\t}\n}\";\n\t\t\tTestWrongContext<RedundantOverridenMemberIssue>(input);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestGetHashCode()\n\t\t{\n\t\t\tTestWrongContext<RedundantOverridenMemberIssue>(@\"\nclass Bar\n{\n\tpublic override bool Equals (object obj)\n\t{\n\t\treturn false;\n\t}\n\n\tpublic override int GetHashCode ()\n\t{\n\t\treturn base.GetHashCode ();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestRedundantGetHashCode()\n\t\t{\n\t\t\tTestIssue<RedundantOverridenMemberIssue>(@\"\nclass Bar\n{\n\tpublic override int GetHashCode ()\n\t{\n\t\treturn base.GetHashCode ();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestPropertyBug()\n\t\t{\n\t\t\tTestWrongContext<RedundantOverridenMemberIssue>(@\"\nclass BaseFoo\n{\n\tpublic virtual int Foo { get; set; }\n}\n\nclass Bar : BaseFoo\n{\n\tint bar;\n\tpublic override int Foo {\n\t\tget {\n\t\t\treturn base.Foo;\n\t\t}\n\t\tset {\n\t\t\tbase.Foo = bar = value;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantParamsIssueTests.cs",
    "content": "//\n// RedundantParamsIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantParamsIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<RedundantParamsIssue>(@\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\tpublic override void Foo(string fmt, params object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\", @\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\tpublic override void Foo(string fmt, object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidCase ()\n\t\t{\n\t\t\tTestWrongContext<RedundantParamsIssue>(@\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\tpublic override void Foo(string fmt, object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RedundantParamsIssue>(@\"class FooBar\n{\n\tpublic virtual void Foo(string fmt, object[] args)\n\t{\n\t}\n}\n\nclass FooBar2 : FooBar\n{\n\t// ReSharper disable once RedundantParams\n\tpublic override void Foo(string fmt, params object[] args)\n\t{\n\t\tSystem.Console.WriteLine(fmt, args);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantPrivateInspectorTests.cs",
    "content": "// \n// RedundantPrivateInspectorTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantPrivateInspectorTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tstatic private int foo;\n\tprivate void Bar (string str)\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantPrivateIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\n\t\t\t\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tstatic int foo;\n\tvoid Bar (string str)\n\t{\n\t}\n}\");\n\t\t}\n\t\n\t\n\t\t[Test]\n\t\tpublic void TestNestedClass ()\n\t\t{\n\t\t\tTest<RedundantPrivateIssue>(@\"class Foo\n{\n\tprivate class Nested\n\t{\n\t}\n}\", @\"class Foo\n{\n\tclass Nested\n\t{\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantStringToCharArrayCallIssueTests.cs",
    "content": "//\n// RedundantStringToCharArrayCallIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantStringToCharArrayCallIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleForeachCase ()\n\t\t{\n\t\t\tTest<RedundantStringToCharArrayCallIssue>(@\"\nusing System;\nclass FooBar\n{\n\tpublic void Test (string str)\n\t{\n\t\tforeach (char c in str.ToCharArray ()) {\n\t\t\tConsole.WriteLine (c);\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nclass FooBar\n{\n\tpublic void Test (string str)\n\t{\n\t\tforeach (char c in str) {\n\t\t\tConsole.WriteLine (c);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVarForeachCase ()\n\t\t{\n\t\t\tTest<RedundantStringToCharArrayCallIssue>(@\"\nusing System;\nclass FooBar\n{\n\tpublic void Test (string str)\n\t{\n\t\tforeach (var c in str.ToCharArray ()) {\n\t\t\tConsole.WriteLine (c);\n\t\t}\n\t}\n}\n\", @\"\nusing System;\nclass FooBar\n{\n\tpublic void Test (string str)\n\t{\n\t\tforeach (var c in str) {\n\t\t\tConsole.WriteLine (c);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerCase ()\n\t\t{\n\t\t\tTest<RedundantStringToCharArrayCallIssue>(@\"\nusing System;\nclass FooBar\n{\n\tpublic void Test (string str)\n\t{\n\t\tConsole.WriteLine ((str.ToCharArray ())[5]);\n\t}\n}\n\", @\"\nusing System;\nclass FooBar\n{\n\tpublic void Test (string str)\n\t{\n\t\tConsole.WriteLine (str [5]);\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RedundantStringToCharArrayCallIssue>(@\"\nusing System;\nclass FooBar\n{\n\tpublic void Test (string str)\n\t{\n\t\t// ReSharper disable once RedundantStringToCharArrayCall\n\t\tforeach (char c in str.ToCharArray ()) {\n\t\t\tConsole.WriteLine (c);\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantTernaryExpressionIssueTests.cs",
    "content": "//\n// RedundantTernaryExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantTernaryExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestTrueFalseCase ()\n\t\t{\n\t\t\tTest<RedundantTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar a = 1 < 2 ? true : false;\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar a = 1 < 2;\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RedundantTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\t// ReSharper disable once RedundantTernaryExpression\n\t\tvar a = 1 < 2 ? true : false;\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantThisQualifierIssueTests.cs",
    "content": "﻿// \n// RedundantThisQualifierIssueTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantThisQualifierIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tthis.Bar (str);\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssuesWithSubIssue (new RedundantThisQualifierIssue (), input, RedundantThisQualifierIssue.EverywhereElse, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tBar (str);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestSkipConstructors ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tpublic Foo ()\n\t{\n\t\tthis.Bar (str);\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<RedundantThisQualifierIssue>(input, RedundantThisQualifierIssue.EverywhereElse);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInsideConstructors ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tpublic Foo ()\n\t{\n\t\tthis.Bar (str);\n\t}\n\tvoid Bar (string str)\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssuesWithSubIssue (new RedundantThisQualifierIssue (), input, RedundantThisQualifierIssue.InsideConstructors, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tpublic Foo ()\n\t{\n\t\tBar (str);\n\t}\n\tvoid Bar (string str)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInsideConstructorsSkipMembers ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tthis.Bar (str);\n\t}\n}\";\n\t\t\tTestWrongContextWithSubIssue<RedundantThisQualifierIssue>(input, RedundantThisQualifierIssue.InsideConstructors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisInAssignmentFromFieldToLocal ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tvar a = this.a;\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisInAssignmentFromDelegateToLocal ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tAction a = () => {\n\t\t\tConsole.WriteLine (this.a);\n\t\t};\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRedundantThisInAssignmentFromFieldToLocal ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tvar b = this.a;\n\t}\n}\", @\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tvar b = a;\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRedundantThisInAssignmentFromDelegateToLocal ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tAction b = () => {\n\t\t\tConsole.WriteLine (this.a);\n\t\t};\n\t}\n}\", @\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tAction b = () => {\n\t\t\tConsole.WriteLine (a);\n\t\t};\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisInExtensionMethodCall ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"static class Extensions\n{\n\tpublic static void Ext (this Foo foo)\n\t{\n\t}\n}\n\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tthis.Ext ();\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0135 ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\t{\n\t\t\tint a = 0;\n\t\t}\n\t\tthis.a = 2;\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0844 ()\n\t\t{\n\t\t\tTest<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\t{\n\t\t\tthis.a = 0;\n\t\t}\n\t\tvar a = 2;\n\t}\n}\", 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0135WithLambda ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tAction<int> action = (int a) => a.ToString();\n\t\tthis.a = 2;\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0135WithDelegate ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tAction<int> action = delegate (int a) { a.ToString(); };\n\t\tthis.a = 2;\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0135WithForeach ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tthis.a = 2;\n\t\tforeach (var a in \"\"abc\"\")\n\t\t\tSystem.Console.WriteLine (a);\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0135WithFor ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tthis.a = 2;\n\t\tfor (int a = 0; a < 2; a++)\n\t\t\tSystem.Console.WriteLine (a);\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0135WithUsing ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Foo\n{\n\tint a;\n\tvoid Bar ()\n\t{\n\t\tthis.a = 2;\n\t\tusing (var a = new System.IO.MemoryStream())\n\t\t\ta.Flush();\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestRequiredThisToAvoidCS0135WithFixed ()\n\t\t{\n\t\t\tTestWithSubIssue<RedundantThisQualifierIssue>(@\"class Baz\n{\n\tpublic int c;\n}\nclass Foo\n{\n\tint a;\n\tunsafe void Bar ()\n\t{\n\t\tthis.a = 2;\n\t\tvar b = new Baz();\n\t\tfixed (int* a = &b.c)\n\t\t\tConsole.WriteLine(a == null);\n\t}\n}\", RedundantThisQualifierIssue.EverywhereElse, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\t// ReSharper disable RedundantThisQualifier\n\t\tthis.Bar (str);\n\t\t// ReSharper restore RedundantThisQualifier\n\t\tthis.Bar (str);\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssuesWithSubIssue (new RedundantThisQualifierIssue (), input, RedundantThisQualifierIssue.EverywhereElse, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBatchFix ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tthis.Bar (str);\n\t\tthis.Bar (str);\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssuesWithSubIssue (new RedundantThisQualifierIssue (), input, RedundantThisQualifierIssue.EverywhereElse, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckBatchFix (context, issues, issues[0].Actions.First().SiblingKey, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tBar (str);\n\t\tBar (str);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidUseOfThisInFieldInitializer()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tint a = this.a;\n}\";\n\t\t\tTestWrongContextWithSubIssue<RedundantThisQualifierIssue>(input, RedundantThisQualifierIssue.EverywhereElse);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantToStringCallForValueTypesIssue.cs",
    "content": "//\n// RedundantToStringCallForValueTypesForValueTypesIssue.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantToStringCallForValueTypesIssueTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void ConcatenationOperator ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = \"\"\"\" + i.ToString() + \"\"\"\" + i.ToString();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = \"\"\"\" + i + \"\"\"\" + i;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReferenceTypes ()\n\t\t{\n\t\t\tTestWrongContext<RedundantToStringCallForValueTypesIssue>(@\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = \"\"\"\" + i.ToString() + \"\"\"\" + i.ToString();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConcatenationOperatorWithToStringAsOnlyString ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = i.ToString() + i + i + i + 1.3;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresCallsToIFormattableToString ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (System.DateTime dt)\n\t{\n\t\tstring s = dt.ToString(\"\"\"\", CultureInfo.InvariantCulture) + string.Empty;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FormatStringTests ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = string.Format(\"\"{0}\"\", i.ToString());\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = string.Format (\"\"{0}\"\", i);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesNonLiteralFormatParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring format = \"\"{0}\"\";\n\t\tstring s = string.Format(format, i.ToString());\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring format = \"\"{0}\"\";\n\t\tstring s = string.Format (format, i);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FormatStringWithNonObjectParameterTests ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = FakeFormat(\"\"{0} {1}\"\", i.ToString(), i.ToString());\n\t}\n\n\tvoid FakeFormat(string format, string arg0, object arg1)\n\t{\n\t}\n\tvoid FakeFormat(string format, params object[] args)\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = FakeFormat (\"\"{0} {1}\"\", i.ToString (), i);\n\t}\n\n\tvoid FakeFormat(string format, string arg0, object arg1)\n\t{\n\t}\n\tvoid FakeFormat(string format, params object[] args)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FormatMethodWithObjectParamsArray ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = FakeFormat(\"\"{0} {1}\"\", i.ToString(), i.ToString());\n\t}\n\n\tvoid FakeFormat(string format, params object[] args)\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = FakeFormat (\"\"{0} {1}\"\", i, i);\n\t}\n\n\tvoid FakeFormat(string format, params object[] args)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DetectsBlacklistedCalls ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tvar w = new System.IO.StringWriter ();\n\t\tw.Write (i.ToString());\n\t\tw.WriteLine (i.ToString());\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallForValueTypesIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tvar w = new System.IO.StringWriter ();\n\t\tw.Write (i);\n\t\tw.WriteLine (i);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantToStringCallIssueTests.cs",
    "content": "//\n// RedundantToStringCallIssueTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantToStringCallIssueTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void ConcatenationOperator ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = \"\"\"\" + i.ToString() + \"\"\"\" + i.ToString();\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = \"\"\"\" + i + \"\"\"\" + i;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValueTypes ()\n\t\t{\n\t\t\tTestWrongContext<RedundantToStringCallIssue>(@\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = \"\"\"\" + i.ToString() + \"\"\"\" + i.ToString();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void ConcatenationOperatorWithToStringAsOnlyString ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tstring s = i.ToString() + i + i + i + 1.3;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresCallsToIFormattableToString ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (System.DateTime dt)\n\t{\n\t\tstring s = dt.ToString(\"\"\"\", CultureInfo.InvariantCulture) + string.Empty;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StringTarget ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring s = str.ToString();\n\t\tstring inOperator = \"\"\"\" + str.ToString();\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tstring s = str;\n\t\tstring inOperator = \"\"\"\" + str;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatStringTests ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = string.Format(\"\"{0}\"\", i.ToString());\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = string.Format (\"\"{0}\"\", i);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void HandlesNonLiteralFormatParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring format = \"\"{0}\"\";\n\t\tstring s = string.Format(format, i.ToString());\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring format = \"\"{0}\"\";\n\t\tstring s = string.Format (format, i);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatStringWithNonObjectParameterTests ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = FakeFormat(\"\"{0} {1}\"\", i.ToString(), i.ToString());\n\t}\n\n\tvoid FakeFormat(string format, string arg0, object arg1)\n\t{\n\t}\n\tvoid FakeFormat(string format, params object[] arg1)\n\t{\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = FakeFormat (\"\"{0} {1}\"\", i.ToString (), i);\n\t}\n\n\tvoid FakeFormat(string format, string arg0, object arg1)\n\t{\n\t}\n\tvoid FakeFormat(string format, params object[] arg1)\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatMethodWithObjectParamsArray ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = FakeFormat(\"\"{0} {1}\"\", i.ToString(), i.ToString());\n\t}\n\n\tvoid FakeFormat(string format, params object[] args)\n\t{\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tstring s = FakeFormat (\"\"{0} {1}\"\", i, i);\n\t}\n\n\tvoid FakeFormat(string format, params object[] args)\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"broken\")]\n\t\tpublic void DetectsBlacklistedCalls ()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tvar w = new System.IO.StringWriter ();\n\t\tw.Write (i.ToString());\n\t\tw.WriteLine (i.ToString());\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantToStringCallIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (object i)\n\t{\n\t\tvar w = new System.IO.StringWriter ();\n\t\tw.Write (i);\n\t\tw.WriteLine (i);\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantTypeArgumentsOfMethodIssueTests.cs",
    "content": "//\n// RedundantTypeArgumentsOfMethodIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[Ignore]\n\t[TestFixture]\n\tpublic class RedundantTypeArgumentsOfMethodIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase ()\n\t\t{\n\t\t\tTest<RedundantTypeArgumentsOfMethodIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tvoid Foo<T> (T t)\n\t{\n\t\tConsole.WriteLine (t);\n\t}\n\n\tpublic void FooBar ()\n\t{\n\t\tFoo<int> (5);\n\t}\n}\n\", @\"\nusing System;\n\npublic class Bar\n{\n\tvoid Foo<T> (T t)\n\t{\n\t\tConsole.WriteLine (t);\n\t}\n\n\tpublic void FooBar ()\n\t{\n\t\tFoo (5);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RedundantTypeArgumentsOfMethodIssue>(@\"\nusing System;\n\npublic class Bar\n{\n\tvoid Foo<T> (T t)\n\t{\n\t\tConsole.WriteLine (t);\n\t}\n\n\tpublic void FooBar ()\n\t{\n\t\t// ReSharper disable once RedundantTypeArgumentsOfMethod\n\t\tFoo<int> (5);\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantUnsafeContextIssueTests.cs",
    "content": "//\n// RedundantUnsafeContextIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantUnsafeContextIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestUnsafeClass ()\n\t\t{\n\t\t\tTest<RedundantUnsafeContextIssue>(@\"\nunsafe class Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tSystem.Console.WriteLine (\"\"Hello World!\"\");\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tSystem.Console.WriteLine (\"\"Hello World!\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnsafeStatement ()\n\t\t{\n\t\t\tTest<RedundantUnsafeContextIssue>(@\"\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tunsafe {\n\t\t\tSystem.Console.WriteLine (\"\"Hello World1!\"\");\n\t\t\tSystem.Console.WriteLine (\"\"Hello World2!\"\");\n\t\t}\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tSystem.Console.WriteLine (\"\"Hello World1!\"\");\n\t\tSystem.Console.WriteLine (\"\"Hello World2!\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNestedUnsafeStatement ()\n\t\t{\n\t\t\tTest<RedundantUnsafeContextIssue>(@\"\nunsafe class Program\n{\n\tstatic void Main(string str)\n\t{\n\t\tunsafe {\n\t\t\tfixed (char* charPtr = &str) {\n\t\t\t\t*charPtr = 'A';\n\t\t\t}\n\t\t}\n\t}\n}\n\", @\"\nunsafe class Program\n{\n\tstatic void Main(string str)\n\t{\n\t\tfixed (char* charPtr = &str) {\n\t\t\t*charPtr = 'A';\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidFixedPointer ()\n\t\t{\n\t\t\tTestWrongContext<RedundantUnsafeContextIssue>(@\"\nunsafe struct Foo {\n\tpublic fixed char fixedBuffer[128];\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RedundantUnsafeContextIssue>(@\"\nunsafe class Foo\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\t// ReSharper disable once RedundantUnsafeContext\n\t\tSystem.Console.WriteLine (\"\"Hello World!\"\");\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSizeOf ()\n\t\t{\n\t\t\tTestWrongContext<RedundantUnsafeContextIssue>(@\"\npublic static class TestClass\n{\n\tstruct TestStruct {\n\t}\n\tpublic static void Main(String[] args)\n\t{\n\t\tunsafe {\n\t\t\tint a = sizeof(TestStruct);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixed ()\n\t\t{\n\t\t\tTestWrongContext<RedundantUnsafeContextIssue>(@\"\nclass Foo\n{\n\tunsafe struct TestStruct\n\t{\n\t\tpublic fixed byte TestVar[32];\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantUsingDirectiveIssueTests.cs",
    "content": "﻿// \n// RedundantUsingDirectiveIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RedundantUsingDirectiveIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantUsingDirectiveIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2 ()\n\t\t{\n\t\t\tvar input = @\"using System;\n\nclass Foo\n{\n\tvoid Bar (string str)\n\t{\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issueProvider = new RedundantUsingDirectiveIssue ();\n\t\t\tissueProvider.NamespacesToKeep.Add(\"System\");\n\t\t\tvar issues = GetIssues (issueProvider, input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase3 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Collections.Generic;\n\nnamespace Foo\n{\n\tclass Bar\n\t{\n\t\tList<String> list;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantUsingDirectiveIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Linq1 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass Bar\n{\n\tpublic object M(List<String> list)\n\t{\n\t\treturn list.Where(t => !String.IsNullOrEmpty(t));\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantUsingDirectiveIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Linq2 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nclass Bar\n{\n\tpublic object M(List<String> list)\n\t{\n\t\treturn from t in list where !String.IsNullOrEmpty(t) select t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantUsingDirectiveIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore ()\n\t\t{\n\t\t\tvar input = @\"// ReSharper disable RedundantUsingDirective\nusing System;\n// ReSharper restore RedundantUsingDirective\nusing System.IO;\n\nclass Foo\n{\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantUsingDirectiveIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisableOnce ()\n\t\t{\n\t\t\tvar input = @\"using System;\n// ReSharper disable once RedundantUsingDirective\nusing System.IO;\nusing System.Text;\n\nclass Foo\n{\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new RedundantUsingDirectiveIssue (), input, out context);\n\t\t\tAssert.AreEqual (2, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSubnamespace ()\n\t\t{\n\t\t\tTest<RedundantUsingDirectiveIssue>(@\"namespace Foo\n{\n\tusing System;\n\tusing System.Collections.Generic;\n\n\tclass Bar\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tConsole.WriteLine ();\n\t\t}\n\t}\n}\", @\"namespace Foo\n{\n\tusing System;\n\n\tclass Bar\n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tConsole.WriteLine ();\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSubnamespaceCase1 ()\n\t\t{\n\t\t\tTest<RedundantUsingDirectiveIssue>(@\"namespace Foo\n{\n\tusing System;\n\tnamespace Sub {\n\t\tusing System;\n\t}\n\t\n\tnamespace Sub2 {\n\t\tclass Bar\n\t\t{\n\t\t\tpublic static void Main (string[] args)\n\t\t\t{\n\t\t\t\tConsole.WriteLine ();\n\t\t\t}\n\t\t}\n\t}\n}\", @\"namespace Foo\n{\n\tusing System;\n\tnamespace Sub {\n\t}\n\t\n\tnamespace Sub2 {\n\t\tclass Bar\n\t\t{\n\t\t\tpublic static void Main (string[] args)\n\t\t\t{\n\t\t\t\tConsole.WriteLine ();\n\t\t\t}\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSubnamespaceCase3 ()\n\t\t{\n\t\t\tTest<RedundantUsingDirectiveIssue>(@\"namespace Foo\n{\n\tusing System;\n\t\n\tnamespace Sub2 {\n\t\tusing System;\n\t\tclass Bar\n\t\t{\n\t\t\tpublic static void Main (string[] args)\n\t\t\t{\n\t\t\t\tConsole.WriteLine ();\n\t\t\t}\n\t\t}\n\t}\n}\", @\"namespace Foo\n{\n\t\n\tnamespace Sub2 {\n\t\tusing System;\n\t\tclass Bar\n\t\t{\n\t\t\tpublic static void Main (string[] args)\n\t\t\t{\n\t\t\t\tConsole.WriteLine ();\n\t\t\t}\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestKeywordsInNamespace ()\n\t\t{\n\t\t\tTestWrongContext<RedundantUsingDirectiveIssue>(@\"\n\nnamespace org.eclipse.jgit.@internal.storage.file\n{\n\tpublic class File {}\n}\n\nnamespace Foo\n{\n\tusing org.eclipse.jgit.@internal.storage.file;\n\t\n\tclass Bar \n\t{\n\t\tpublic static void Main (string[] args)\n\t\t{\n\t\t\tFile file;\n\t\t}\n\t}\n}\n\n\n\");\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RedundantWhereWithPredicateIssueTests.cs",
    "content": "// \n// ReplaceWithSingleCallToAnyIssueTests.cs\n//\n// Author:\n//       Mike Krger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n    public class ReplaceWithSingleCallToAnyIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestWhereAnyCase1 ()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).Any ();\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithSingleCallToAnyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Any (x => x < 4);\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestWhereAnyWrongWhere1 ()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where ((x, i) => x + i < 4).Any ();\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithSingleCallToAnyIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestWhereAnyWrongWhere2 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Linq;\npublic class X\n{\n\tX Where (Func<int,int> f) { return null; }\n\tbool Any () { return false; }\n\tpublic void Bla () {\n\t\tX ex = null;\n\t\tvar bla = ex.Where (x => x + 1).Any ();\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithSingleCallToAnyIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n        // ReSharper disable once ReplaceWithSingleCallToAny\n\t\tvar bla = arr.Where (x => x < 4).Any ();\n\t}\n}\";\n\n            TestRefactoringContext context;\n            var issues = GetIssues(new ReplaceWithSingleCallToAnyIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReferenceEqualsWithValueTypeIssueTests.cs",
    "content": "﻿// \n// ReferenceEqualsCalledWithValueTypeIssueTest.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReferenceEqualsWithValueTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestValueTypeCase1 ()\n\t\t{\n\t\t\tTest<ReferenceEqualsWithValueTypeIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i, int j)\n\t{\n\t\tvar x = object.ReferenceEquals (i, j);\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i, int j)\n\t{\n\t\tvar x = false;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestValueTypeCase2 ()\n\t\t{\n\t\t\tTest<ReferenceEqualsWithValueTypeIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i, int j)\n\t{\n\t\tvar x2 = ReferenceEquals (i, j);\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod (int i, int j)\n\t{\n\t\tvar x2 = object.Equals (i, j);\n\t}\n}\", 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod<T> (object i, T j)\n\t{\n\t\tvar x = object.ReferenceEquals (i, i);\n\t\tvar x2 = object.ReferenceEquals (j, j);\n\t}\n}\";\n\t\t\tTest<ReferenceEqualsWithValueTypeIssue> (input, 0);\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReferenceEqualsWithValueTypeIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod (int i, int j)\n\t{\n\t\t// ReSharper disable once ReferenceEqualsWithValueType\n\t\tvar x2 = ReferenceEquals (i, j);\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RemoveRedundantOrStatementIssueTests.cs",
    "content": "//\n// RemoveRedundantOrStatementIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RemoveRedundantOrStatementIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestOrCase ()\n\t\t{\n\t\t\tTest<RemoveRedundantOrStatementIssue>(@\"\nclass MainClass\n{\n\tstatic bool bb { get; set; }\n\tpublic static void Main(string[] args)\n\t{\n\t\tMainClass.bb |= false;\n\t}\n}\n\", @\"\nclass MainClass\n{\n\tstatic bool bb { get; set; }\n\tpublic static void Main(string[] args)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAndCase ()\n\t\t{\n\t\t\tTest<RemoveRedundantOrStatementIssue>(@\"\nclass MainClass\n{\n\tstatic bool bb { get; set; }\n\tpublic static void Main(string[] args)\n\t{\n\t\tMainClass.bb &= true;\n\t}\n}\n\", @\"\nclass MainClass\n{\n\tstatic bool bb { get; set; }\n\tpublic static void Main(string[] args)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<RemoveRedundantOrStatementIssue>(@\"\nclass MainClass\n{\n\tstatic bool bb { get; set; }\n\tpublic static void Main(string[] args)\n\t{\n\t\t// ReSharper disable once RemoveRedundantOrStatement\n\t\tMainClass.bb |= false;\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithFirstOrDefaultIssueTests.cs",
    "content": "//\n// ReplaceWithFirstOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithFirstOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<ReplaceWithFirstOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\tvar first = args.Any () ? args.First () : null;\n\t}\n}\", @\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\tvar first = args.FirstOrDefault ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicCaseWithExpression ()\n\t\t{\n\t\t\tTest<ReplaceWithFirstOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\targs.Any (a => a != null) ? args.First (a => a != null) : null;\n\t}\n}\", @\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\targs.FirstOrDefault (a => a != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicCaseWithDefault ()\n\t\t{\n\t\t\tTest<ReplaceWithFirstOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar<T>(T[] args)\n\t{\n\t\tvar first = args.Any () ? args.First () : default(T);\n\t}\n}\", @\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar<T>(T[] args)\n\t{\n\t\tvar first = args.FirstOrDefault ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithFirstOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\t// ReSharper disable once ReplaceWithFirstOrDefault\n\t\tvar first = args.Any () ? args.First () : null;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithLastOrDefaultIssueTests.cs",
    "content": "//\n// ReplaceWithLastOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithLastOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<ReplaceWithLastOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\tvar first = args.Any () ? args.Last () : null;\n\t}\n}\", @\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\tvar first = args.LastOrDefault ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicCaseWithExpression ()\n\t\t{\n\t\t\tTest<ReplaceWithLastOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\targs.Any (a => a != null) ? args.Last (a => a != null) : null;\n\t}\n}\", @\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\targs.LastOrDefault (a => a != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicCaseWithDefault ()\n\t\t{\n\t\t\tTest<ReplaceWithLastOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar<T>(T[] args)\n\t{\n\t\tvar first = args.Any () ? args.Last () : default(T);\n\t}\n}\", @\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar<T>(T[] args)\n\t{\n\t\tvar first = args.LastOrDefault ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithLastOrDefaultIssue>(@\"using System.Linq;\nclass Bar\n{\n\tpublic void FooBar(string[] args)\n\t{\n\t\t// ReSharper disable once ReplaceWithLastOrDefault\n\t\tvar first = args.Any () ? args.Last () : null;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeAnyIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeAnyIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeAnyIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeAnyIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Any (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Any ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeAnyIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Any (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Any (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeAnyIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.Any\n\t\tobj.Select (q => q as Test).Any (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeAnyIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).Any (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeAnyIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Any (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeCountIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeCountIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeCountIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Count (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Count ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Count (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Count (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.Count\n\t\tobj.Select (q => q as Test).Count (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).Count (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Count (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeFirstIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeFirstIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeFirstIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeFirstIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).First (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().First ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeFirstIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).First (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().First (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeFirstIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.First\n\t\tobj.Select (q => q as Test).First (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeFirstIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).First (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeFirstIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).First (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeFirstOrDefaultIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeFirstOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeFirstOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeFirstOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).FirstOrDefault (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().FirstOrDefault ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeFirstOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).FirstOrDefault (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().FirstOrDefault (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeFirstOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.FirstOrDefault\n\t\tobj.Select (q => q as Test).FirstOrDefault (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeFirstOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).FirstOrDefault (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeFirstOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).FirstOrDefault (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseSelectNotNull ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.SelectNotNull((object o) => o as Test);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.SelectNotNull(o => o as Test);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseSelectNotNullWithParentheses ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.SelectNotNull(o => ((o as Test)));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.SelectNotNull(o => o as Test);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCaseSelectWhereCase1 ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Where(o => o is Test).Select (o => o as Test);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.SelectNotNull(o => o as Test);\n\t}\n}\",@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseSelectWhereGabage ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Where(o => o is Test).Select (x => o as Test);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.SelectNotNull(o => null as Test);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCaseSelectWhereCase2WithParens ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Where(o => (o is Test)).Select (o => ((Test)(o)));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t\tTest<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.SelectNotNull(o => o as Test);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ();\n\t}\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType\n\t\tobj.SelectNotNull((object o) => o as Test);\n\t}\n}\");\n\t\t}\n\n\n\n\t}\n\t\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeLastIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeLastIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeLastIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeLastIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Last (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Last ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeLastIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Last (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Last (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeLastIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.Last\n\t\tobj.Select (q => q as Test).Last (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeLastIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).Last (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeLastIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Last (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeLastOrDefaultIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeLastOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeLastOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeLastOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).LastOrDefault (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().LastOrDefault ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeLastOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).LastOrDefault (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().LastOrDefault (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeLastOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.LastOrDefault\n\t\tobj.Select (q => q as Test).LastOrDefault (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeLastOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).LastOrDefault (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeLastOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).LastOrDefault (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeLongCountIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeLongCountIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeLongCountIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeLongCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).LongCount (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().LongCount ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeLongCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).LongCount (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().LongCount (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeLongCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.LongCount\n\t\tobj.Select (q => q as Test).LongCount (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeLongCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).LongCount (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeLongCountIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).LongCount (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeSingleIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeSingleIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeSingleIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeSingleIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Single (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Single ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeSingleIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Single (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Single (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeSingleIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.Single\n\t\tobj.Select (q => q as Test).Single (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeSingleIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).Single (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeSingleIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Single (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeSingleOrDefaultIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeSingleOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeSingleOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasic ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeSingleOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).SingleOrDefault (q => q != null);\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().SingleOrDefault ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeSingleOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).SingleOrDefault (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().SingleOrDefault (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeSingleOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.SingleOrDefault\n\t\tobj.Select (q => q as Test).SingleOrDefault (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeSingleOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).SingleOrDefault (q => q != null);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeSingleOrDefaultIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).SingleOrDefault (q => 1 != null);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithOfTypeWhereIssueTests.cs",
    "content": "//\n// ReplaceWithOfTypeWhereIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithOfTypeWhereIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCaseBasicWithFollowUpExpresison ()\n\t\t{\n\t\t\tTest<ReplaceWithOfTypeWhereIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Where (q => q != null && Foo (q));\n\t}\n}\", @\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.OfType<Test> ().Where (q => Foo (q));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeWhereIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\t// ReSharper disable once ReplaceWithOfType.Where\n\t\tobj.Select (q => q as Test).Where (q => q != null);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJunk ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithOfTypeWhereIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (x => q as Test).Where (q => q != null && true);\n\t}\n}\");\n\t\t\tTestWrongContext<ReplaceWithOfTypeWhereIssue>(@\"using System.Linq;\nclass Test\n{\n\tpublic void Foo(object[] obj)\n\t{\n\t\tobj.Select (q => q as Test).Where (q => 1 != null && true);\n\t}\n}\");\n\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSimpleAssignmentIssueTests.cs",
    "content": "//\n// ReplaceWithSimpleAssignmentIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSimpleAssignmentIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestOrCase ()\n\t\t{\n\t\t\tTest<ReplaceWithSimpleAssignmentIssue>(@\"\nclass Test\n{\n\tvoid Foo (bool b)\n\t{\n\t\tb |= true;\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool b)\n\t{\n\t\tb = true;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAndCase ()\n\t\t{\n\t\t\tTest<ReplaceWithSimpleAssignmentIssue >(@\"\nclass Test\n{\n\tvoid Foo (bool b)\n\t{\n\t\tb |= true;\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo (bool b)\n\t{\n\t\tb = true;\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<ReplaceWithSimpleAssignmentIssue>(@\"\nclass Test\n{\n\tvoid Foo (bool b)\n\t{\n\t\t// ReSharper disable once ReplaceWithSimpleAssignment\n\t\tb |= true;\n\t}\n}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToAverageIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToAverageTests.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToAverageIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Select (x => x * 2).Average ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToAverageIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Average (x => x * 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToAverage\n\t\tvar bla = arr.Select (x => x * 2).Average ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToAverageIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToCountIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToCountIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToCountIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).Count ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToCountIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Count (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToCount\n\t\tvar bla = arr.Where (x => x < 4).Count ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToCountIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToFirstIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToFirstIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToFirstIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).First ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToFirstIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.First (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToFirst\n\t\tvar bla = arr.Where (x => x < 4).First ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToFirstIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToFirstOrDefaultIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToFirstOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToFirstOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).FirstOrDefault ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToFirstOrDefaultIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.FirstOrDefault (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToFirstOrDefault\n\t\tvar bla = arr.Where (x => x < 4).FirstOrDefault ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToFirstOrDefaultIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToLastIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToLastIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToLastIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).Last ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToLastIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Last (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToLast\n\t\tvar bla = arr.Where (x => x < 4).Last ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToLastIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToLastOrDefaultIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToLastOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToLastOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).LastOrDefault ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToLastOrDefaultIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.LastOrDefault (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToLastOrDefault\n\t\tvar bla = arr.Where (x => x < 4).LastOrDefault ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToLastOrDefaultIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToLongCountIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToLongCountIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToLongCountIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).LongCount ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToLongCountIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.LongCount (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToLongCount\n\t\tvar bla = arr.Where (x => x < 4).LongCount ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToLongCountIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToMaxIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToMaxTests.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToMaxIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Select (x => x * 2).Max ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToMaxIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Max (x => x * 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToMax\n\t\tvar bla = arr.Select (x => x * 2).Max ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToMaxIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToMinIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToMinTests.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToMinIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Select (x => x * 2).Min ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToMinIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Min (x => x * 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToMin\n\t\tvar bla = arr.Select (x => x * 2).Min ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToMinIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToSingleIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToSingleIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToSingleIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).Single ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToSingleIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Single (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToSingle\n\t\tvar bla = arr.Where (x => x < 4).Single ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToSingleIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToSingleOrDefaultIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToSingleOrDefaultIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2013 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToSingleOrDefaultIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Where (x => x < 4).SingleOrDefault ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToSingleOrDefaultIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.SingleOrDefault (x => x < 4);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToSingleOrDefault\n\t\tvar bla = arr.Where (x => x < 4).SingleOrDefault ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToSingleOrDefaultIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithSingleCallToSumIssueTests.cs",
    "content": "﻿// \n// ReplaceWithSingleCallToSumTests.cs\n//\n// Author:\n//       Marius Ungureanu <marius.ungureanu@xamarin.com>\n// \n// Copyright (c) 2014 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithSingleCallToSumIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Select (x => x * 2).Sum ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToSumIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t\tCheckFix(context, issues, @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n\t\tvar bla = arr.Sum (x => x * 2);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tvar input = @\"using System.Linq;\npublic class CSharpDemo {\n\tpublic void Bla () {\n\t\tint[] arr;\n// ReSharper disable ReplaceWithSingleCallToSum\n\t\tvar bla = arr.Select (x => x * 2).Sum ();\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ReplaceWithSingleCallToSumIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ReplaceWithStringIsNullOrEmptyIssueTests.cs",
    "content": "﻿// \n// ReplaceWithStringIsNullOrEmptyIssueTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ReplaceWithStringIsNullOrEmptyIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str != null && str != \"\"\"\")\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS2 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (null != str && str != \"\"\"\")\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorNegatedStringEmpty ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (null != str && str != string.Empty)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorStringEmpty ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (null == str || str == string.Empty)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS3 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (null != str && \"\"\"\" != str)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS4 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str != null && str != \"\"\"\")\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str != \"\"\"\" && str != null)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN2 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (\"\"\"\" != str && str != null)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN3 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (\"\"\"\" != str && null != str)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN4 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str != \"\"\"\" && null != str)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS5 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str == null || str == \"\"\"\")\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS6 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (null == str || str == \"\"\"\")\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS7 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (null == str || \"\"\"\" == str)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS8 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str == null || \"\"\"\" == str)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN5 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str == \"\"\"\" || str == null)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN6 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (\"\"\"\" == str || str == null)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN7 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (\"\"\"\" == str || null == str)\n\t\t\t;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCaseSN8 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (str == \"\"\"\" || null == str)\n\t\t\t;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\t\t\n\t\t[TestCase(\"str == null || str.Length == 0\")]\n\t\t[TestCase(\"str == null || 0 == str.Length\")]\n\t\t[TestCase(\"null == str || str.Length == 0\")]\n\t\t[TestCase(\"null == str || 0 == str.Length\")]\n\t\tpublic void TestInspectorCaseNL (string expression)\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (\" + expression + @\")\n\t\t\t;\n\t}\n}\";\n\t\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\t\n\t\t[TestCase(\"str != null && str.Length != 0\")]\n\t\t[TestCase(\"str != null && 0 != str.Length\")]\n\t\t[TestCase(\"str != null && str.Length > 0\")]\n\t\t[TestCase(\"null != str && str.Length != 0\")]\n\t\t[TestCase(\"null != str && 0 != str.Length\")]\n\t\t[TestCase(\"null != str && str.Length > 0\")]\n\t\tpublic void TestInspectorCaseLN (string expression)\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (\" + expression + @\")\n\t\t\t;\n\t}\n}\";\n\t\t\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tCheckFix (context, issues, @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArrays ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tint[] foo = new int[10];\n\t\tif (foo == null || foo.Length == 0) {\n\t\t}\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ReplaceWithStringIsNullOrEmptyIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCaseNS1WithParentheses ()\n\t\t{\n\t\t\tTest<ReplaceWithStringIsNullOrEmptyIssue>(@\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif ((str != null) && (str) != \"\"\"\")\n\t\t\t;\n\t}\n}\", @\"class Foo\n{\n\tvoid Bar (string str)\n\t{\n\t\tif (!string.IsNullOrEmpty (str))\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/RewriteIfReturnToReturnIssueTests.cs",
    "content": "//\n// RewriteIfReturnToReturnIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class RewriteIfReturnToReturnIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestIfElse ()\n\t\t{\n\t\t\tTestIssue<RewriteIfReturnToReturnIssue>(@\"class Foo\n{\n\tbool Bar (string str)\n\t{\n\t\tif (str.Length > 10)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfReturn ()\n\t\t{\n\t\t\tTestIssue<RewriteIfReturnToReturnIssue>(@\"class Foo\n{\n\tbool Bar (string str)\n\t{\n\t\tif (str.Length > 10)\n\t\t\treturn true;\n\t\treturn false;\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestSkipIfElseIf ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tif (x < 10)\n\t\t\treturn -10;\n\t\telse if (x > 10)\n\t\t\treturn 10;\n\t\telse\n\t\t\treturn 20;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexTrueExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tif (x > 10)\n\t\t\treturn 10 +\n\t\t\t\t\t 12;\n\t\telse\n\t\t\treturn 20;\n\t\treturn result;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSkipComplexFalseExpression ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tstatic int Bar (int x)\n\t{\n\t\tif (x > 10)\n\t\t\treturn 10;\n\t\telse\n\t\t\treturn 20 +\n\n12;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSkipAnnoyingSuggestionCase1 ()\n\t\t{\n\t\t\tTestWrongContext<ConvertIfStatementToConditionalTernaryExpressionIssue>(@\"class Foo\n{\n\tint Bar (int a, int b)\n\t{\n\t\tif (a < 1 && a > 2 && b < a) {\n\t\t\treturn a;\n\t\t}\n\t\treturn b;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/SameGuardConditionExpressionInIfElseBranchesTests.cs",
    "content": "﻿//\n// SameGuardConditionExpressionInIfElseBranchesTests.cs\n//\n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n//\n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class SameGuardConditionExpressionInIfElseBranchesTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestConditionalExpression()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif (foo > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if(foo > 5)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestConditionalExpression2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif (foo > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if(foo < 5)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\telse if (foo>5)\n\t\t{\n\t\t\treturn 6;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNoProblem()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int foo)\n\t{\n\t\tif (foo > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if (foo > 5)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem2()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif (foo > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if (foo > 6)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem3()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif (foo-- > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if (foo-- > 5)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem4()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod ()\n\t{\n\t\tint foo = 1;\n\t\tif ((foo=3) > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if ((foo=3) > 5)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoProblem5()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tprivate int foo;\n\tint TestMethod ()\n\t{\n\t\tif (foo > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if (foo > 5)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tint TestMethod (int foo)\n\t{\n//Resharper disable SameGuardConditionExpressionInIfelseBranches\n\t\tif (foo > 5)\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t\telse if (foo > 5)\n\t\t{\n\t\t\treturn 5;\n\t\t}\n//Resharper restore SameGuardConditionExpressionInIfelseBranches\n\t\treturn 0;\n\t}\n}\";\n\t\t\tTest<SameGuardConditionExpressionInIfelseBranchesIssue>(input, 0);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/SealedMemberInSealedClassIssueTests.cs",
    "content": "//\n// SealedMemberInSealedClassIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class SealedMemberInSealedClassIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicCase ()\n\t\t{\n\t\t\tTest<SealedMemberInSealedClassIssue>(@\"\nsealed class Foo\n{\n\tpublic sealed override string ToString()\n\t{\n\t\treturn \"\"''\"\";\n\t}\n}\n\", @\"\nsealed class Foo\n{\n\tpublic override string ToString()\n\t{\n\t\treturn \"\"''\"\";\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValid ()\n\t\t{\n\t\t\tTestWrongContext<SealedMemberInSealedClassIssue>(@\"\nclass Foo\n{\n\tpublic sealed override string ToString()\n\t{\n\t\treturn \"\"''\"\";\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<SealedMemberInSealedClassIssue>(@\"\nsealed class Foo\n{\n\t// ReSharper disable once SealedMemberInSealedClass\n\tpublic sealed override string ToString()\n\t{\n\t\treturn \"\"''\"\";\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/SimplifyConditionalTernaryExpressionIssueTests.cs",
    "content": "//\n// SimplifyConditionalTernaryExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class SimplifyConditionalTernaryExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestFalseTrueCase ()\n\t\t{\n\t\t\tTest<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar a = 1 < 2 ? false : true;\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar a = 1 >= 2;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFalseTrueCase2 ()\n\t\t{\n\t\t\tTest<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar a = obj is foo ? false : true;\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar a = !(obj is foo);\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestFalseExprCase ()\n\t\t{\n\t\t\tTest<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a < b ? false : c);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a >= b && c);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTrueExprCase ()\n\t\t{\n\t\t\tTest<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a < b ? true : c);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a < b || c);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExprFalseCase ()\n\t\t{\n\t\t\tTest<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a < b ? c : false);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a < b && c);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExprTrueCase ()\n\t\t{\n\t\t\tTest<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a < b ? c : true);\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c)\n\t{\n\t\tConsole.WriteLine (a >= b || c);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase ()\n\t\t{\n\t\t\tTestWrongContext<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid FooBar (int a, int b, bool c, boold d)\n\t{\n\t\tConsole.WriteLine (a < b ? c : d);\n\t}\n}\");\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\t// ReSharper disable once SimplifyConditionalTernaryExpression\n\t\tvar a = 1 < 2 ? false : true;\n\t}\n}\n\");\n\t\t}\n\t\n\n\t\t[Test]\n\t\tpublic void TestSkipRedundantCase ()\n\t\t{\n\t\t\tTestWrongContext<SimplifyConditionalTernaryExpressionIssue>(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tvar a = 1 < 2 ? true : false;\n\t}\n}\n\");\n\t\t}\n\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/SimplifyLinqExpressionIssueTests.cs",
    "content": "//\n// SimplifyLinqExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class SimplifyLinqExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestNotAny ()\n\t\t{\n\t\t\tTest<SimplifyLinqExpressionIssue>(@\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (!args.Any (d => d.Length == 0));\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (args.All (d => d.Length != 0));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotAll ()\n\t\t{\n\t\t\tTest<SimplifyLinqExpressionIssue>(@\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (!args.All (d => d.Length == 0));\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (args.Any (d => d.Length != 0));\n\t}\n}\n\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestLambdaBlockNotAny ()\n\t\t{\n\t\t\tTest<SimplifyLinqExpressionIssue>(@\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (!args.Any (d => {\n\t\t\treturn d.Length == 0;\n\t\t}));\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (args.All (d => {\n\t\t\treturn d.Length != 0;\n\t\t}));\n\t}\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodBlockNotAny ()\n\t\t{\n\t\t\tTest<SimplifyLinqExpressionIssue>(@\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (!args.Any (delegate (string d) {\n\t\t\treturn d.Length == 0;\n\t\t}));\n\t}\n}\n\", @\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\tConsole.WriteLine (args.All (delegate (string d) {\n\t\t\treturn d.Length != 0;\n\t\t}));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoSimplifiction ()\n\t\t{\n\t\t\tTestWrongContext<SimplifyLinqExpressionIssue>(@\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (object[] args)\n\t{\n\t\tConsole.WriteLine (!args.Any (d => d is FooBar));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<SimplifyLinqExpressionIssue>(@\"\nusing System;\nusing System.Linq;\n\nclass FooBar\n{\n\tvoid Test (string[] args)\n\t{\n\t\t// ReSharper disable once SimplifyLinqExpression\n\t\tConsole.WriteLine (!args.Any (d => d.Length == 0));\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StaticConstructorParameterIssueTests.cs",
    "content": "//\n// StaticConstructorParameterIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StaticConstructorParameterIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<StaticConstructorParameterIssue>(@\"\nclass Foo\n{\n\tstatic Foo (int bar)\n\t{\n\t}\n}\n\", @\"\nclass Foo\n{\n\tstatic Foo ()\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue()\n\t\t{\n\t\t\tTestWrongContext<StaticConstructorParameterIssue>(@\"\nclass Foo\n{\n\tstatic Foo ()\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StaticEventSubscriptionIssueTests.cs",
    "content": "﻿//\n// StaticEventSubscriptionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StaticEventSubscriptionIssueTests: InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodSubscription()\n\t\t{\n\t\t\tTestIssue<StaticEventSubscriptionIssue>(@\"\nusing System;\n\nclass Foo\n{\n\tpublic static event EventHandler FooBar;\n\t\n\tpublic void Test ()\n\t{\n\t\tFooBar += delegate { \n\t\t\tConsole.WriteLine (\"\"Hello World!\"\");\n\t\t};\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodSubscription_ValidCase()\n\t\t{\n\t\t\tTestWrongContext<StaticEventSubscriptionIssue>(@\"\nusing System;\n\nclass Foo\n{\n\tpublic static event EventHandler FooBar;\n\t\n\tpublic static void Test ()\n\t{\n\t\tFooBar += delegate { \n\t\t\tConsole.WriteLine (\"\"Hello World!\"\");\n\t\t};\n\t}\n}\n\");\n\t\t}\n\t\n\t\n\t\t[Test]\n\t\tpublic void TestIssue()\n\t\t{\n\t\t\tTestIssue<StaticEventSubscriptionIssue>(@\"\nusing System;\n\nclass Foo\n{\n\tpublic static event EventHandler FooBar;\n\t\n\tpublic void Test ()\n\t{\n\t\tFooBar += MyMethod;\n\t}\n\tvoid MyMethod (object sender, EventArgs args)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIssue()\n\t\t{\n\t\t\tTestWrongContext<StaticEventSubscriptionIssue>(@\"\nusing System;\n\nclass Foo\n{\n\tpublic static event EventHandler FooBar;\n\t\n\tpublic void Test ()\n\t{\n\t\tFooBar += MyMethod;\n\t}\n\t\n\tpublic void Unsubscribe ()\n\t{\n\t\tFooBar -= MyMethod;\n\t}\n\tvoid MyMethod (object sender, EventArgs args)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonStatic()\n\t\t{\n\t\t\tTestWrongContext<StaticEventSubscriptionIssue>(@\"\nusing System;\n\nclass Foo\n{\n\tpublic event EventHandler FooBar;\n\n\tpublic void Test ()\n\t{\n\t\tFooBar += MyMethod;\n\t}\n\n\tvoid MyMethod (object sender, EventArgs args)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullAssignment()\n\t\t{\n\t\t\tTestWrongContext<StaticEventSubscriptionIssue>(@\"\nusing System;\n\nclass Foo\n{\n\tpublic static event EventHandler FooBar;\n\t\n\tpublic void Test ()\n\t{\n\t\tFooBar += MyMethod;\n\t}\n\t\n\tpublic void Unsubscribe ()\n\t{\n\t\tFooBar = null;\n\t}\n\tvoid MyMethod (object sender, EventArgs args)\n\t{\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StaticFieldInGenericTypeTests.cs",
    "content": "//\n// StaticFieldInGenericTypeTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\n\t[TestFixture]\n\tpublic class StaticFieldInGenericTypeTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void GenericClass()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo<T>\n{\n\tstatic string Data;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericClassWithGenericField()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo<T>\n{\n\tstatic System.Collections.Generic.IList<T> Cache;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericClassWithMultipleGenericFields()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo<T1, T2>\n{\n\tstatic System.Collections.Generic.IList<T1> Cache;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedGenericClassWithGenericField()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo<T1>\n{\n\tclass Bar<T2>\n\t{\n\t\tstatic System.Collections.Generic.IList<T1> Cache;\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonGenericClass()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo\n{\n\tstatic string Data;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonStaticField()\n\t\t{\n\t\t\tvar input = @\"\nclass Foo<T>\n{\n\tstring Data;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMicrosoftSuppressMessage()\n\t\t{\n\t\t\tvar input = @\"using System.Diagnostics.CodeAnalysis;\n\nclass Foo<T>\n{\n\t[SuppressMessage(\"\"Microsoft.Design\"\", \"\"CA1000:DoNotDeclareStaticMembersOnGenericTypes\"\")]\n\tstatic string Data;\n\n\tstatic string OtherData;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAssemblyMicrosoftSuppressMessage()\n\t\t{\n\t\t\tvar input = @\"using System.Diagnostics.CodeAnalysis;\n\n[assembly:SuppressMessage(\"\"Microsoft.Design\"\", \"\"CA1000:DoNotDeclareStaticMembersOnGenericTypes\"\")]\n\nclass Foo<T>\n{\n\tstatic string Data;\n\n\tstatic string OtherData;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new StaticFieldInGenericTypeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"using System.Diagnostics.CodeAnalysis;\n\nclass Foo<T>\n{\n    // ReSharper disable once StaticFieldInGenericType\n\tstatic string Data;\n}\";\n            TestWrongContext<StaticFieldInGenericTypeIssue>(input);\n        }\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StringCompareIsCultureSpecificIssueTests.cs",
    "content": "//\n// StringCompareIsCultureSpecificIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StringCompareIsCultureSpecificIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestCase1()\n\t\t{\n\t\t\tTest<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\"));\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\", System.StringComparison.Ordinal));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase1()\n\t\t{\n\t\t\tTestWrongContext<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\", System.StringComparison.Ordinal));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCase2()\n\t\t{\n\t\t\tTest<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (System.String.Compare (\"\"Foo\"\", \"\"Bar\"\", true));\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (System.String.Compare (\"\"Foo\"\", \"\"Bar\"\", System.StringComparison.OrdinalIgnoreCase));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase2()\n\t\t{\n\t\t\tTestWrongContext<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\", System.StringComparison.OrdinalIgnoreCase));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCase3()\n\t\t{\n\t\t\tTest<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\", false));\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\", System.StringComparison.Ordinal));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCase4()\n\t\t{\n\t\t\tTest<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", 0, \"\"Bar\"\", 1, 1));\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", 0, \"\"Bar\"\", 1, 1, System.StringComparison.Ordinal));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase4()\n\t\t{\n\t\t\tTestWrongContext<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", 0, \"\"Bar\"\", 1, 1, System.StringComparison.Ordinal));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCase5()\n\t\t{\n\t\t\tTest<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", 0, \"\"Bar\"\", 1, 1, true));\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", 0, \"\"Bar\"\", 1, 1, System.StringComparison.OrdinalIgnoreCase));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCase6()\n\t\t{\n\t\t\tTest<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", 0, \"\"Bar\"\", 1, 1, false));\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", 0, \"\"Bar\"\", 1, 1, System.StringComparison.Ordinal));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalid()\n\t\t{\n\t\t\tTestWrongContext<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tConsole.WriteLine (string.Compare(\"\"a\"\", \"\"b\"\", true, System.Globalization.CultureInfo.CurrentCulture));\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplex()\n\t\t{\n\t\t\tTest<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo (bool b)\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\", b));\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Foo (bool b)\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", \"\"Bar\"\", b ? System.StringComparison.OrdinalIgnoreCase : System.StringComparison.Ordinal));\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<StringCompareIsCultureSpecificIssue>(@\"\nclass Test\n{\n\tvoid Foo()\n\t{\n\t\t// ReSharper disable once StringCompareIsCultureSpecific\n\t\tConsole.WriteLine(string.Compare(\"\"Foo\"\", \"\"Bar\"\"));\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StringCompareToIsCultureSpecificIssueTests.cs",
    "content": "//\n// StringCompareToIsCultureSpecificIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StringCompareToIsCultureSpecificIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleCase()\n\t\t{\n\t\t\tTest<StringCompareToIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tvoid Foo (string b)\n\t{\n\t\tConsole.WriteLine (\"\"Foo\"\".CompareTo(b));\n\t}\n}\n\", @\"\npublic class Test\n{\n\tvoid Foo (string b)\n\t{\n\t\tConsole.WriteLine (string.Compare (\"\"Foo\"\", b, System.StringComparison.Ordinal));\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase()\n\t\t{\n\t\t\tTestWrongContext<StringCompareToIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tvoid Foo (object b)\n\t{\n\t\tConsole.WriteLine (\"\"Foo\"\".CompareTo(b));\n\t}\n}\n\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<StringCompareToIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tvoid Foo (string b)\n\t{\n\t\t// ReSharper disable once StringCompareToIsCultureSpecific\n\t\tConsole.WriteLine (\"\"Foo\"\".CompareTo(b));\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StringEndsWithIsCultureSpecificIssueTest.cs",
    "content": "//\n// StringEndsWithIsCultureSpecificIssueTest.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StringEndsWithIsCultureSpecificIssueTest : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestEndsWith()\n\t\t{\n\t\t\tTest<StringEndsWithIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\tbar.EndsWith (\"\".com\"\");\n\t}\n}\n\", @\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\tbar.EndsWith (\"\".com\"\", System.StringComparison.Ordinal);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<StringEndsWithIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\t// ReSharper disable once StringEndsWithIsCultureSpecific\n\t\tbar.EndsWith (\"\".com\"\");\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StringIndexOfIsCultureSpecificIssueTest.cs",
    "content": "//\n// Author:\n//       Daniel Grunwald <daniel@danielgrunwald.de>\n//\n// Copyright (c) 2012 Daniel Grunwald\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StringIndexOfIsCultureSpecificIssueTest : InspectionActionTestBase\n\t{\n\t\tconst string stringIndexOfStringCalls = @\"using System;\nusing System.Collections.Generic;\nclass Test {\n\tpublic void StringIndexOfStringCalls(List<string> list)\n\t{\n\t\tlist[0].IndexOf(\"\".com\"\");\n\t\tlist[0].IndexOf(\"\".com\"\", 0);\n\t\tlist[0].IndexOf(\"\".com\"\", 0, 5);\n\t\tlist[0].IndexOf(list[1], 0, 10);\n\t}\n}\";\n\t\tconst string stringIndexOfStringCallsWithComparison = @\"using System;\nusing System.Collections.Generic;\nclass Test {\n\tpublic void StringIndexOfStringCalls(List<string> list)\n\t{\n\t\tlist [0].IndexOf (\"\".com\"\", StringComparison.Ordinal);\n\t\tlist [0].IndexOf (\"\".com\"\", 0, StringComparison.Ordinal);\n\t\tlist [0].IndexOf (\"\".com\"\", 0, 5, StringComparison.Ordinal);\n\t\tlist [0].IndexOf (list [1], 0, 10, StringComparison.Ordinal);\n\t}\n}\";\n\t\t\n\t\t[Test]\n\t\tpublic void IndexOfStringCalls()\n\t\t{\n\t\t\tTest<StringIndexOfIsCultureSpecificIssue>(stringIndexOfStringCalls, 4, stringIndexOfStringCallsWithComparison);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexOfStringCallsAlreadyWithComparison()\n\t\t{\n\t\t\tTest<StringIndexOfIsCultureSpecificIssue>(stringIndexOfStringCallsWithComparison, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StringIndexOfChar()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tvoid M(string text) {\n\t\ttext.IndexOf('.');\n\t}\n}\";\n\t\t\tTest<StringIndexOfIsCultureSpecificIssue>(program, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ListIndexOf()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass Test {\n\tvoid M(List<string> list) {\n\t\tlist.IndexOf(\"\".com\"\");\n\t}\n}\";\n\t\t\tTest<StringIndexOfIsCultureSpecificIssue>(program, 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<StringIndexOfIsCultureSpecificIssue>(@\"using System;\nusing System.Collections.Generic;\nclass Test {\n\tpublic void StringIndexOfStringCalls(List<string> list)\n\t{\n\t\t// ReSharper disable once StringIndexOfIsCultureSpecific\n\t\tlist[0].IndexOf(\"\".com\"\");\n\t}\n}\");\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StringLastIndexOfIsCultureSpecificIssueTest.cs",
    "content": "//\n// StringLastIndexOfIsCultureSpecificIssueTest.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StringLastIndexOfIsCultureSpecificIssueTest : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestLastIndexOf()\n\t\t{\n\t\t\tTest<StringLastIndexOfIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\tbar.LastIndexOf (\"\".com\"\");\n\t}\n}\n\", @\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\tbar.LastIndexOf (\"\".com\"\", System.StringComparison.Ordinal);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<StringLastIndexOfIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\t// ReSharper disable once StringLastIndexOfIsCultureSpecific\n\t\tbar.LastIndexOf (\"\".com\"\");\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/StringStartsWithIsCultureSpecificIssueTest.cs",
    "content": "//\n// StringStartsWithIsCultureSpecificIssueTest.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class StringStartsWithIsCultureSpecificIssueTest : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestStartsWith()\n\t\t{\n\t\t\tTest<StringStartsWithIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\tbar.StartsWith (\"\".com\"\");\n\t}\n}\n\", @\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\tbar.StartsWith (\"\".com\"\", System.StringComparison.Ordinal);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable()\n\t\t{\n\t\t\tTestWrongContext<StringStartsWithIsCultureSpecificIssue>(@\"\npublic class Test\n{\n\tpublic void Foo (string bar)\n\t{\n\t\t// ReSharper disable once StringStartsWithIsCultureSpecific\n\t\tbar.StartsWith (\"\".com\"\");\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/SuggestUseVarKeywordEvidentTests.cs",
    "content": "﻿// \n// SuggestUseVarKeywordEvidentTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class SuggestUseVarKeywordEvidentTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (object o)\n\t{\n\t\tFoo foo = (Foo)o;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new SuggestUseVarKeywordEvidentIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\t// Fix is done by code action.\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestV2 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\tvoid Bar (object o)\n\t{\n\t\tFoo foo = (Foo)o;\n\t}\n}\";\n\n\t\t\tTestRefactoringContext context;\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tparser.CompilerSettings.LanguageVersion = new Version(2, 0, 0);\n\t\t\tvar issues = GetIssues (new SuggestUseVarKeywordEvidentIssue (), input, out context, false, parser);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ThreadStaticAtInstanceFieldTests.cs",
    "content": "//\n// ThreadStaticAtInstanceFieldTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class ThreadStaticAtInstanceFieldTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInspectorCase1 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\t[ThreadStatic]\n\tint bar;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\n\t\t\tCheckFix (context, issues [0], @\"using System;\nclass Foo\n{\n\tint bar;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase2 ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n\t[Serializable, ThreadStatic]\n\tint bar;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\n\t\t\tCheckFix (context, issues [0], @\"using System;\nclass Foo\n{\n\t[Serializable]\n\tint bar;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase3 ()\n\t\t{\n\t\t\tvar input = @\"class Foo\n{\n\t[System.ThreadStatic, System.Serializable]\n\tint bar;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\n\t\t\tCheckFix (context, issues [0], @\"class Foo\n{\n\t[System.Serializable]\n\tint bar;\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestResharperSuppression ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass Foo\n{\n// ReSharper disable once ThreadStaticAtInstanceField\n\t[ThreadStatic]\n\tint bar;\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new ThreadStaticAtInstanceFieldIssue (), input, out context);\n\t\t\tAssert.AreEqual (0, issues.Count);\n\n\t\t}\n\n\n        [Test]\n        public void InstanceField()\n        {\n            var input = @\"\nusing System;\nclass TestClass\n{\n\t[ThreadStatic]\n\tstring field;\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ThreadStaticAtInstanceFieldIssue(), input, out context);\n            Assert.AreEqual(1, issues.Count);\n            var issue = issues[0];\n            Assert.AreEqual(2, issue.Actions.Count);\n\n            CheckFix(context, issues[0], @\"\nusing System;\nclass TestClass\n{\n\tstring field;\n}\");\n        }\n\n        [Test]\n        public void InstanceFieldWithMultiAttributeSection()\n        {\n            var input = @\"\nusing System;\nclass TestClass\n{\n\t[field: ThreadStatic, ContextStatic]\n\tstring field;\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ThreadStaticAtInstanceFieldIssue(), input, out context);\n            Assert.AreEqual(1, issues.Count);\n            var issue = issues[0];\n            Assert.AreEqual(2, issue.Actions.Count);\n\n            CheckFix(context, issues[0], @\"\nusing System;\nclass TestClass\n{\n\t[field: ContextStatic]\n\tstring field;\n}\");\n        }\n\n        [Test]\n        public void StaticField()\n        {\n            var input = @\"\nusing System;\nclass TestClass\n{\n\t[ThreadStatic]\n\tstatic string field;\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ThreadStaticAtInstanceFieldIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UnassignedReadonlyFieldIssueTests.cs",
    "content": "//\n// UnassignedReadonlyFieldIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UnassignedReadonlyFieldIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestField ()\n\t\t{\n\t\t\tTest<UnassignedReadonlyFieldIssue>(@\"class Test\n{\n\treadonly object fooBar;\n}\", @\"class Test\n{\n\tpublic Test (object fooBar)\n\t{\n\t\tthis.fooBar = fooBar;\n\t}\n\treadonly object fooBar;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValueTypeField ()\n\t\t{\n\t\t\tTest<UnassignedReadonlyFieldIssue>(@\"class Test\n{\n\treadonly int fooBar;\n}\", @\"class Test\n{\n\tpublic Test (int fooBar)\n\t{\n\t\tthis.fooBar = fooBar;\n\t}\n\treadonly int fooBar;\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<UnassignedReadonlyFieldIssue>(@\"class Test\n{\n\t// ReSharper disable once UnassignedReadonlyField.Compiler\n\treadonly object fooBar;\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestPragmaDisable ()\n\t\t{\n\t\t\tTestWrongContext<UnassignedReadonlyFieldIssue>(@\"class Test\n{\n\t#pragma warning disable 649\n\treadonly int test;\n\t#pragma warning restore 649\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAlreadyInitalized ()\n\t\t{\n\t\t\tTestWrongContext<UnassignedReadonlyFieldIssue>(@\"class Test\n{\n\tpublic Test (object fooBar)\n\t{\n\t\tthis.fooBar = fooBar;\n\t}\n\treadonly object fooBar;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAlreadyInitalizedCase2 ()\n\t\t{\n\t\t\tTestWrongContext<UnassignedReadonlyFieldIssue>(@\"\nusing System;\npublic class FooBar\n{\n\tsealed class Bar\n\t{\n\t\tpublic int foo;\n\t}\n\n\treadonly string foo;\n\t\n\tpublic FooBar()\n\t{\n\t\tthis.foo = \"\"\"\";\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UnmatchedSizeSpeicificationInArrayCreationTests.cs",
    "content": "// \n// UnmatchedSizeSpeicificationInArrayCreationTests.cs\n//  \n// Author:\n//       Ji Kun <jikun.nus@gmail.com>\n// \n// Copyright (c) 2013 Ji Kun <jikun.nus@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UnmatchedSizeSpeicificationInArrayCreationTests : InspectionActionTestBase\n\t{\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase1()\n\t\t{\n\t\t\tTest<UnmatchedSizeSpecificationInArrayCreationIssue>(@\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\tint[] array = new int[4]{1,2,3,4,5};\n\t\t\t}\n\t\t}\n\t}\n\", @\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\tint[] array = new int[5]{ 1, 2, 3, 4, 5 };\n\t\t\t}\n\t\t}\n\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInspectorCase2()\n\t\t{\n\t\t\tTestWrongContext<UnmatchedSizeSpecificationInArrayCreationIssue>(@\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\tint[] array = new int[]{1,2,3,4,5};\n\t\t\t\tint[] array1= new int[5]{1,2,3,4,5};\n\t\t\t\tint[] array2 = new int[0x05]{1,2,3,4,5};\n\t\t\t}\n\t\t}\n\t}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInspectorCase3()\n\t\t{\n\t\t\tTest<UnmatchedSizeSpecificationInArrayCreationIssue>(@\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\tint[] array = new int[0x01]{1,2,3,4,5};\n\t\t\t}\n\t\t}\n\t}\n\", @\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n\t\t\t\tint[] array = new int[5]{ 1, 2, 3, 4, 5 };\n\t\t\t}\n\t\t}\n\t}\n\");\n\t\t}\n\n\t\t[Ignore(\"Issue was disabled.\")]\n\t\t[Test]\n\t\tpublic void TestResharperDisableRestore()\n\t\t{\n\t\t\tTestWrongContext<UnmatchedSizeSpecificationInArrayCreationIssue>(@\"using System;\n\tnamespace Application\n\t{\n\t\tpublic class BaseClass\n\t\t{\n\t\t\tpublic void method()\n\t\t\t{\n//Resharper disable UnmatchedSizeSpecificationInArrayCreation\n\t\t\t\tint[] array = new int[4]{1,2,3,4,5};\n//Resharper restore UnmatchedSizeSpecificationInArrayCreation\n\t\t\t}\n\t\t}\n\t}\n\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UnreachableCodeIssueTests.cs",
    "content": "﻿// \n// UnreachableCodeIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UnreachableCodeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestReturn ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t\tint a = 1;\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBreak ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\twhile (true) {\n\t\t\tbreak;\n\t\t\tint a = 1;\n\t\t}\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRedundantGoto ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tgoto Foo; Foo:\n\t\tint a = 1;\n\t}\n}\";\n\t\t\tTestWrongContext<UnreachableCodeIssue> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGotoUnreachableBlock ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint x = 1;\n\t\tgoto Foo;\n\t\t{\n\t\t\tx = 2;\n\t\t\tFoo:\n\t\t\tx = 3;\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues (new UnreachableCodeIssue (), input, out context);\n\t\t\tAssert.AreEqual (1, issues.Count);\n\t\t\tvar issue = issues [0];\n\t\t\tAssert.AreEqual(9, issue.Start.Line);\n\t\t\tAssert.AreEqual(9, issue.End.Line);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContinue ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\twhile (true) {\n\t\t\tcontinue;\n\t\t\tbreak;\n\t\t}\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFor ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tbreak;\n\t\t}\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstantCondition ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\treturn;\n\t\t}\n\t\tint a = 1;\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalExpression ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a = true ? 1 : 0;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tint a = 1;\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1, output);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInsideLambda ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action action = () => {\n\t\t\treturn;\n\t\t\tint a = 1;\n\t\t};\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInsideAnonymousMethod ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action action = delegate () {\n\t\t\treturn;\n\t\t\tint a = 1;\n\t\t};\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIgnoreLambdaBody ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t\tSystem.Action action = () => {\n\t\t\treturn;\n\t\t\tint a = 1;\n\t\t};\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIgnoreAnonymousMethodBody ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t\tSystem.Action action = delegate() {\n\t\t\treturn;\n\t\t\tint a = 1;\n\t\t};\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGroupMultipleStatements ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t\tint a = 1;\n\t\ta++;\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveCode ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t\tint a = 1;\n\t\ta++;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, output, 0);\n\t\t}\n\n\t//\t[Ignore(\"Got broken due ast new line nodes\")]\n\t\t[Test]\n\t\tpublic void TestCommentCode ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n\t\tint a = 1;\n\t\ta++;\n\t}\n}\";\n\t\t\tvar output = @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\treturn;\n/*\n\t\tint a = 1;\n\t\ta++;\n*/\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, output, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDefaultParameter ()\n\t\t{\n\t\t\tvar input = @\"\nusing System;\n\nnamespace TestProjectForBug\n{\n\tclass MainClass\n\t{\n\t\tpublic static void CondMethod (bool cond = false)\n\t\t{\n\t\t\tConsole.WriteLine (cond ? \"\"true\"\" : \"\"false\"\");\n\t\t}\n\t}\n}\";\n\t\t\tTest<UnreachableCodeIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfTrueBranch ()\n\t\t{\n\t\t\tTest<UnreachableCodeIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\tSystem.Console.WriteLine (1);\n\t\t} else {\n\t\t\tSystem.Console.WriteLine (2);\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\tSystem.Console.WriteLine (1);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfFalseBranch ()\n\t\t{\n\t\t\tTest<UnreachableCodeIssue> (@\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (false) {\n\t\t\tSystem.Console.WriteLine (1);\n\t\t} else {\n\t\t\tSystem.Console.WriteLine (2);\n\t\t}\n\t}\n}\", @\"\nclass TestClass\n{\n\tvoid TestMethod ()\n\t{\n\t\t{\n\t\t\tSystem.Console.WriteLine (2);\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UnusedAnonymousMethodSignatureIssueTests.cs",
    "content": "// \n// DelegateParametersAreUnusedTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UnusedAnonymousMethodSignatureIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimpleUsage ()\n\t\t{\n\t\t\tTest<UnusedAnonymousMethodSignatureIssue>(@\"\nusing System;\n\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tAction<int> x = delegate (int p) {};\n\t}\n}\", @\"\nusing System;\n\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tAction<int> x = delegate {};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNecessaryParameter ()\n\t\t{\n\t\t\tTestWrongContext<UnusedAnonymousMethodSignatureIssue>(@\"\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\t//Even if just one is used, it's still necessary\n\t\tAction<int> x = delegate(int p, int q) { Console.WriteLine(p); };\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVisitChild ()\n\t\t{\n\t\t\tTest<UnusedAnonymousMethodSignatureIssue>(@\"\nusing System;\n\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tAction<int> x = delegate(int p) {\n\t\t\tConsole.WriteLine(p);\n\t\t\tAction<int> y = delegate(int q) {};\n\t\t};\n\t}\n}\", @\"\nusing System;\n\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tAction<int> x = delegate(int p) {\n\t\t\tConsole.WriteLine(p);\n\t\t\tAction<int> y = delegate {};\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAmbiguousCase ()\n\t\t{\n\t\t\tTestWrongContext<UnusedAnonymousMethodSignatureIssue>(@\"\nusing System;\nclass TestClass\n{\n\tvoid Foo(Action<int> action) {}\n\tvoid Foo(Action<string> action) {}\n\tvoid TestMethod()\n\t{\n\t\tFoo(delegate(int p) {});\n\t}\n}\n\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15058 - Wrong context for unused parameter list \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15058 ()\n\t\t{\n\t\t\tTestWrongContext<UnusedAnonymousMethodSignatureIssue>(@\"\nusing System;\nusing System.Threading;\n\nclass TestClass\n{\n\tvoid TestMethod()\n\t{\n\t\tvar myThing = new Thread (delegate () { doStuff (); });\n\t}\n}\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UnusedLabelIssueTests.cs",
    "content": "//\n// UnusedLabelIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UnusedLabelIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestUnusedLabelInMethod ()\n\t\t{\n\t\t\tTest<UnusedLabelIssue>(@\"\nclass Foo\n{\n\tvoid Test()\n\t{\n\t\tbar: ;\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Test()\n\t{\n\t\t;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInvalidCase ()\n\t\t{\n\t\t\tTestWrongContext<UnusedLabelIssue>(@\"\nclass Foo\n{\n\tvoid Test()\n\t{\n\t\tbar:\n\t\tgoto bar;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<UnusedLabelIssue>(@\"\nclass Foo\n{\n\tvoid Test()\n\t{\n\t\t// ReSharper disable once UnusedLabel\n\t\tbar: ;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPragmaDisable ()\n\t\t{\n\t\t\tTestWrongContext<UnusedLabelIssue>(@\"\nclass Foo\n{\n\tvoid Test()\n\t{\n#pragma warning disable 164\n\t\tbar: ;\n#pragma warning restore 164\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UnusedParameterIssueTests.cs",
    "content": "﻿// \n// ParameterNotUsedIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UnusedParameterIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestUnusedParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnusedParameterMethodGetsCalled ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod (int i)\n\t{\n\t\tTestMethod(0);\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInterfaceImplementation ()\n\t\t{\n\t\t\tvar input = @\"\ninterface ITestClass {\n\tvoid TestMethod (int i);\n}\nclass TestClass : ITestClass {\n\tpublic void TestMethod (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAbstractMethodImplementation ()\n\t\t{\n\t\t\tvar input = @\"\nabstract class TestBase {\n\tpublic abstract void TestMethod (int i);\n}\nclass TestClass : TestBase {\n\tpublic override void TestMethod (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsedParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod (int i)\n\t{\n\t\ti = 1;\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambda ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = i => {\n\t\t};\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethod ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod ()\n\t{\n\t\tSystem.Action<int> a = delegate (int i) {\n\t\t};\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestMethodUsedAsDelegateMethod ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass {\n\tpublic event EventHandler FooEvt;\n\tvoid TestMethod ()\n\t{\n\t\tFooEvt += FooBar;\n\t}\n\tvoid FooBar (object sender, EventArgs e) {}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMethodLooksLikeEventHandlerButNotUsedAsSuch ()\n\t\t{\n\t\t\tvar input = @\"using System;\nclass TestClass {\n\tvoid FooBar (object sender, EventArgs e) {}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMethodUsedAsDelegateInOtherPart ()\n\t\t{\n\t\t\t// This test doesn't add the second part;\n\t\t\t// but the issue doesn't look at other files after all;\n\t\t\t// we just rely on heuristics if the class is partial\n\t\t\tvar input = @\"using System;\npartial class TestClass {\n\tvoid FooBar (object sender, EventArgs e) {}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnusedParameterInConstructor()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tpublic TestClass(int i)\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnusedParameterInVirtualMethod ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tpublic virtual void TestMethod (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnusedParameterInShadowedMethod ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tpublic new void TestMethod (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnusedParameterInPartialMethod ()\n\t\t{\n\t\t\tvar input = @\"\npartial class TestClass {\n\tpartial void TestMethod (int i)\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedParameterIssue> (input, 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SerializationConstructor ()\n\t\t{\n\t\t\tvar input = @\"using System;\nusing System.Runtime.Serialization;\nclass TestClass : ISerializable {\n\tstring text;\n\tprotected TestClass(SerializationInfo info, StreamingContext context)\n\t{\n\t\tthis.text = info.GetString(\"\"Text\"\");\n\t}\n}\";\n\t\t\tTestWrongContext<UnusedParameterIssue> (input);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UnusedTypeParameterIssueTests.cs",
    "content": "﻿// \n// UnusedTypeParameterIssueTests.cs\n// \n// Author:\n//      Mansheng Yang <lightyang0@gmail.com>\n// \n// Copyright (c) 2012 Mansheng Yang <lightyang0@gmail.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UnusedTypeParameterIssueTests : InspectionActionTestBase\n\t{\n\n\t\t[Test]\n\t\tpublic void TestUnusedTypeParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod<T> ()\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedTypeParameterIssue> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsedTypeParameter ()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass {\n\tvoid TestMethod<T> (T i)\n\t{\n\t}\n}\";\n\t\t\tvar input2 = @\"\nclass TestClass {\n\tT TestMethod<T> ()\n\t{\n\t}\n}\";\n\t\t\tTest<UnusedTypeParameterIssue> (input, 0);\n\t\t\tTest<UnusedTypeParameterIssue> (input2, 0);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UseArrayCreationExpressionIssueTests.cs",
    "content": "//\n// UseArrayCreationExpressionIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UseArrayCreationExpressionIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestTypeOfIsAssignableFrom ()\n\t\t{\n\t\t\tTest<UseArrayCreationExpressionIssue> (@\"\nclass Test\n{\n\tvoid Foo()\n\t{\n\t\tSystem.Array.CreateInstance(typeof(int), 10);\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo()\n\t{\n\t\tnew int[10];\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MultiDim ()\n\t\t{\n\t\t\tTest<UseArrayCreationExpressionIssue> (@\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tSystem.Array.CreateInstance(typeof(int), 10, 20, i);\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo(int i)\n\t{\n\t\tnew int[10, 20, i];\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<UseArrayCreationExpressionIssue> (@\"\nclass Test\n{\n\tvoid Foo()\n\t{\n\t\t// ReSharper disable once UseArrayCreationExpression\n\t\tSystem.Array.CreateInstance(typeof(int), 10);\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UseIsOperatorIssueTests.cs",
    "content": "//\n// UseIsOperatorIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UseIsOperatorIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestTypeOfIsAssignableFrom ()\n\t\t{\n\t\t\tTest<UseIsOperatorIssue> (@\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\tif (typeof(FooBar).IsAssignableFrom (this.GetType ())) {\n\t\t}\n\t}\n}\n\", @\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\tif (this is FooBar) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeOfIsInstanceOfType ()\n\t\t{\n\t\t\tTest<UseIsOperatorIssue> (@\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\tif (typeof(FooBar).IsInstanceOfType (1 + 2)) {\n\t\t}\n\t}\n}\n\", @\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\tif ((1 + 2) is FooBar) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<UseIsOperatorIssue> (@\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\t// ReSharper disable once UseIsOperator\n\t\tif (typeof(FooBar).IsAssignableFrom (this.GetType ())) {\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UseMethodAnyIssueTests.cs",
    "content": "//\n// UseMethodAnyIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UseMethodAnyIssueTests: InspectionActionTestBase\n\t{\n\t\tstatic string ConstructExpression(string expr)\n\t\t{\n\t\t\treturn @\"\nusing System;\nusing System.Linq;\nclass Bar\n{\n\tpublic void Foo (string[] args)\n\t{\n\t\tif (\" + expr + @\")\n\t\t\tConsole.WriteLine ();\n\t}\n}\n\";\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnyNotEqual ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"args.Count () != 0\"), ConstructExpression(\"args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnyGreater ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"args.Count () > 0\"), ConstructExpression(\"args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnyLower ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"0 < args.Count ()\"), ConstructExpression(\"args.Any ()\"));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAnyGreaterEqual ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"args.Count () >= 1\"), ConstructExpression(\"args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAnyLessEqual ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"1 <= args.Count ()\"), ConstructExpression(\"args.Any ()\"));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestNotAnyEqual ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"args.Count () == 0\"), ConstructExpression(\"!args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotAnyLess ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"args.Count () < 1\"), ConstructExpression(\"!args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotAnyGreater ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"1 > args.Count ()\"), ConstructExpression(\"!args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotAnyLessEqual ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"args.Count () <= 0\"), ConstructExpression(\"!args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNotAnyGreaterEqual ()\n\t\t{\n\t\t\tTest<UseMethodAnyIssue>(ConstructExpression(\"0 >= args.Count ()\"), ConstructExpression(\"!args.Any ()\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<UseMethodAnyIssue>(@\"\nusing System;\nusing System.Linq;\nclass Bar\n{\n\tpublic void Foo (string[] args)\n\t{\n\t\t// ReSharper disable once UseMethodAny\n\t\tif (args.Count () > 0)\n\t\t\tConsole.WriteLine();\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongMethod ()\n\t\t{\n\t\t\tTestWrongContext<UseMethodAnyIssue>(@\"\nusing System;\nusing System.Linq;\nclass Bar\n{\n\tpublic int Count () { return 5; }\n\n\tpublic void Foo (Bar args)\n\t{\n\t\tif (args.Count () > 0)\n\t\t\tConsole.WriteLine();\n\t}\n}\n\");\n\t\t}\n\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UseMethodIsInstanceOfTypeIssueTests.cs",
    "content": "//\n// UseMethodIsInstanceOfTypeIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UseMethodIsInstanceOfTypeIssueTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicUsage ()\n\t\t{\n\t\t\tTest<UseMethodIsInstanceOfTypeIssue> (@\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\tType t;\n\t\tif (t.IsAssignableFrom (this.GetType ())) {\n\t\t}\n\t}\n}\n\", @\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\tType t;\n\t\tif (t.IsInstanceOfType (this)) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisable ()\n\t\t{\n\t\t\tTestWrongContext<UseMethodIsInstanceOfTypeIssue> (@\"using System;\nclass FooBar\n{\n\tvoid Foo()\n\t{\n\t\tType t;\n\t\t// ReSharper disable once UseMethodIsInstanceOfType\n\t\tif (t.IsAssignableFrom (this.GetType ())) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/UseOfMemberOfNullReferenceTests.cs",
    "content": "﻿// \n// UseOfMemberOfNullReferenceTests.cs\n// \n// Author:\n//      Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class UseOfMemberOfNullReferenceTests : InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestSimple ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod() {\n\t\tstring x = null;\n\t\treturn x.Length;\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForNonNull ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod() {\n\t\tstring x = \"\"\"\";\n\t\treturn x.Length;\n\t}\n}\";\n\t\t\tTestWrongContext<UseOfMemberOfNullReference> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForHasValue ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tbool TestMethod() {\n\t\tint? x = null;\n\t\treturn x.HasValue;\n\t}\n}\";\n\t\t\tTestWrongContext<UseOfMemberOfNullReference> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodGroup ()\n\t\t{\n\t\t\tstring input = @\"\nstatic class X {\n\tstatic void Clone(this string x, int i) {}\n}\nclass TestClass\n{\n\tobject TestMethod() {\n\t\tstring x = null;\n\t\treturn x.Clone();\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDisabledForExtensionMethods ()\n\t\t{\n\t\t\tstring input = @\"\nstatic class X\n{\n\tstatic void Foo(this string x) {}\n}\nclass TestClass\n{\n\tvoid TestMethod() {\n\t\tstring x = \"\"\"\";\n\t\tx.Foo();\n\t}\n}\";\n\t\t\tTestWrongContext<UseOfMemberOfNullReference> (input);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAs ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod(object x) {\n\t\treturn (x as string).Length;\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAsCase2 ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod(object x) {\n\t\treturn (this as TestClass).TestMethod(null);\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 0);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIfBranch ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod(object x, object y) \n\t{\n\t\tif (y != null)\n\t\t\tx = null;\n\t\treturn x.GetHashCode ();\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchBranch ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod(object x, int y) \n\t{\n\t\tswitch (y) {\n\t\tcase 1:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tx = null;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tx = new object ();\n\t\t\tbreak;\n\t\t}\n\t\treturn x.GetHashCode ();\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhile ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod(object x, int y) \n\t{\n\t\twhile (y++ < 10) {\n\t\t\tx = null;\n\t\t}\n\t\treturn x.GetHashCode ();\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullExpression ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod() {\n\t\treturn default(string).Length;\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullExpressionCase2 ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod() {\n\t\treturn (default(string) ?? default(string)).Length;\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullExpressionCase3 ()\n\t\t{\n\t\t\tstring input = @\"\nclass TestClass\n{\n\tint TestMethod() {\n\t\treturn (1 == 1 ? default(string) : \"\"\"\").Length;\n\t}\n}\";\n\t\t\tTest<UseOfMemberOfNullReference> (input, 1);\n\t\t}\n\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestParameter ()\n\t\t{\n\t\t\tTestWrongContext<UseOfMemberOfNullReference> (@\"\nclass TestClass\n{\n\tvoid TestMethod(TestClass test) \n\t{\n\t\ttest.TestMethod(this);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhile()\n\t\t{\n\t\t\tTestWrongContext<UseOfMemberOfNullReference> (@\"\npublic class TestClass {\n\tstatic string GetElement ()\n\t{\n\t\tstring x = \"\"\"\";\n\t\tdo {\n\t\t\tbreak;\n\t\t} while ((x = null) == null);\n\t\tx.ToString();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDefaultStruct ()\n\t\t{\n\t\t\tTestWrongContext<UseOfMemberOfNullReference> (@\"\nstruct Foo { public int Length { get { return 0; } } } \nclass TestClass\n{\n\tint TestMethod() \n\t{\n\t\tvar foo = default(Foo);\n\t\treturn foo.Length;\n\t}\n}\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/ValueParameterNotUsedIssueTests.cs",
    "content": "//\n// SetterDoesNotUseValueParameterTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing Mono.CSharp;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n \n\tpublic class ValueParameterNotUsedIssueTests : InspectionActionTestBase\n\t{\n       \n        [Test]\n        public void TestPropertySetter()\n        {\n            var input = @\"class A\n{\n\tint Property1\n\t{\n\t\tset {\n\t\t\tint val = value;\n\t\t}\n\t}\n\tint Property2\n\t{\n\t\tset {\n\t\t}\n\t}\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n            Assert.AreEqual(1, issues.Count);\n        }\n\n\n        [Test]\n        public void TestDisable()\n        {\n            var input = @\"class A\n{\n    int Property1\n    {\n        set\n        {\n            int val = value;\n        }\n    }\n    int Property2\n    {\n// ReSharper disable once ValueParameterNotUsed\n        set\n        {\n        }\n    }\n}\";\n            TestWrongContext<ValueParameterNotUsedIssue>(input);\n        }\n\n\t\t[Test]\n\t\tpublic void TestMatchingIndexerSetter()\n\t\t{\n\t\t\tvar input = @\"class A\n{\n\tA this[int index]\n\t{\n\t\tset {\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMatchingEventAdder()\n\t\t{\n\t\t\tvar input = @\"class A\t\n{\n\tdelegate void TestEventHandler ();\n\tTestEventHandler eventTested;\n\tevent TestEventHandler EventTested\n\t{\n\t\tadd {\n\t\t\teventTested += value;\n\t\t}\n\t\tremove {\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNonMatchingIndexerSetter()\n\t\t{\n\t\t\tvar input = @\"class A\n{\n\tA this[int index]\n\t{\n\t\tset {\n\t\t\tA a = value;\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresAutoSetter()\n\t\t{\n\t\t\tvar input = @\"class A\n{\n\tstring  Property { set; }\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoreReadOnlyProperty()\n\t\t{\n\t\t\tvar input = @\"class A\n{\n\tstring  Property { get; }\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotCrashOnNullIndexerAccessorBody()\n\t\t{\n\t\t\tvar input = @\"abstract class A\n{\n\tpublic abstract string this[int i] { get; set; }\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotWarnOnExceptionThrowingAccessor()\n\t\t{\n\t\t\tvar input = @\"abstract class A\n{\n\tpublic string Property\n\t{\n\t\tset {\n\t\t\tthrow new Exception();\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n        [Test]\n        public void DoesNotWarnOnEmptyCustomEvent()\n        {\n            // Empty custom events are often used when the event can never be raised\n            // by a class (but the event is required e.g. due to an interface).\n            var input = @\"class A\t\n{\n\tdelegate void TestEventHandler ();\n\tevent TestEventHandler EventTested\n\t{\n\t\tadd { }\n\t\tremove { }\n\t}\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n        \n        [Test]\n        public void DoesNotWarnOnNotImplementedCustomEvent()\n        {\n            var input = @\"class A\t\n{\n\tdelegate void TestEventHandler ();\n\tevent TestEventHandler EventTested\n\t{\n\t\tadd { throw new System.NotImplementedException(); }\n\t\tremove { throw new System.NotImplementedException(); }\n\t}\n}\";\n            TestRefactoringContext context;\n            var issues = GetIssues(new ValueParameterNotUsedIssue(), input, out context);\n            Assert.AreEqual(0, issues.Count);\n        }\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/VariableDeclaredInWideScopeTests.cs",
    "content": "//\n// SetterDoesNotUseValueParameterTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\tpublic class VariableDeclaredInWideScopeTests : InspectionActionTestBase\n\t{\n\t\tstatic void TestStatements (string statements, int expectedIssueCount = 0, string fixedStatements = null)\n\t\t{\t\n\t\t\tvar skeleton = @\"\nusing System;\nclass A\n{\n\tint GetValue () { return 0; }\n\tint SetValue (int i) { }\n\n\tvoid F (int a, int b)\n\t{\";\n\n\t\t\tvar input = skeleton + statements + @\"\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new VariableDeclaredInWideScopeIssue(), input, out context);\n\t\t\tAssert.AreEqual(expectedIssueCount, issues.Count);\n\n\t\t\tif (expectedIssueCount == 0)\n\t\t\t\treturn;\n\n\t\t\tCheckFix(context, issues [0], skeleton + fixedStatements + @\"\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIf()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\tif (true) {\n\t\t\tSystem.Console.WriteLine(val);\n\t\t}\n\", 1, @\"\n\t\tif (true) {\n\t\t\tint val = 2;\n\t\t\tSystem.Console.WriteLine(val);\n\t\t}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfWithMultipleVariables()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\tint val2;\n\t\tif (true) {\n\t\t\tval2 = 2;\n\t\t} else {\n\t\t\tval2 = 3;\n\t\t\tSystem.Console.WriteLine(val);\n\t\t}\n\", 1, @\"\n\t\tint val2;\n\t\tif (true) {\n\t\t\tval2 = 2;\n\t\t} else {\n\t\t\tval2 = 3;\n\t\t\tint val = 2;\n\t\t\tSystem.Console.WriteLine(val);\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLoopNestedInIf()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\tif (true) {\n\t\t\twhile (true) {\n\t\t\t\tval = 2;\n\t\t\t}\n\t\t}\n\", 1, @\"\n\t\tif (true) {\n\t\t\tint val = 2;\n\t\t\twhile (true) {\n\t\t\t\tval = 2;\n\t\t\t}\n\t\t}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IgnoresMultiBranchIf()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\tif (true) {\n\t\t\tSystem.Console.WriteLine(val);\n\t\t} else {\n\t\t\tSystem.Console.WriteLine(val);\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresMultiVariableDeclaration()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2, val2 = 3;\n\t\tif (true) {\n\t\t\tSystem.Console.WriteLine(val);\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresUnusedVariables()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IgnoresVariablesOnlyUsedInOneScope()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tvar sb = new System.Text.StringBuilder();\n\t\tsb.Append (\"\"\"\");\n\t\tsb.Append (\"\"\"\");\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingIntoLoop()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\twhile (true) {\n\t\t\tval = 3;\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingPastDependentCondition()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\tif (val == 2 || val == 1) {\n\t\t\tval = 3;\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IfElseIf()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 12;\n\t\tif (condition) {\n\t\t\tint val2 = GetValue ();\n\t\t\tConsole.WriteLine(val2);\n\t\t} else if (!condition) {\n\t\t\tConsole.WriteLine(val);\n\t\t}\n\", 1, @\"\n\t\tif (condition) {\n\t\t\tint val2 = GetValue ();\n\t\t\tConsole.WriteLine(val2);\n\t\t} else if (!condition) {\n\t\t\tint val = 12;\n\t\t\tConsole.WriteLine(val);\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingIntoTryCatch()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\ttry {\n\t\t\tSystem.Console.WriteLine(val);\n\t\t} catch {\n\t\t\tthrow;\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingIntoBodyOfUsing()\n\t\t{\t\n\t\t\tvar input = @\"\nusing System.IO;\nclass A\n{\n\tvoid F()\n\t{\n\t\tusing (FileStream fs = new FileStream(\"\"\"\", FileMode.Open, FileAccess.Read, FileShare.Read)) {\n\t\t\tfs.Read(null, 0, 0);\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new VariableDeclaredInWideScopeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingIntoClosure ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tint val1 = 2;\n\t\tAction a1 = () => Console.WriteLine(val1);\n\n\t\tint val2 = 2;\n\t\tAction a2 = () => { Console.WriteLine(val2); };\n\n\t\tint val3 = 2;\n\t\tAction a3 = delegate() { Console.WriteLine(val3); };\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingIntoLockStatement ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tint i = 1;\n\t\tlock (this) {\n\t\t\tConsole.WriteLine(i);\n\t\t}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmbeddedNonBlockStatement ()\n\t\t{\n\t\t\tTestStatements(@\"\n\t\tint val = 2;\n\t\tif (true)\n\t\t\tSystem.Console.WriteLine (val);\n\", 1, @\"\n\t\tif (true) {\n\t\t\tint val = 2;\n\t\t\tSystem.Console.WriteLine (val);\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingPastChangeOfInitializingExpression1 ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tint i = 1;\n\t\tint j = i;\n\t\ti = 2;\n\t\tif (true)\n\t\t\tConsole.WriteLine(j);\n\t\tConsole.WriteLine(i);\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingPastChangeOfInitializingExpression2 ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tint j = GetValue();\n\t\tSetValue(2);\n\t\tif (true)\n\t\t\tConsole.WriteLine(j);\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CommonParentStatement ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tint k = 12;\n\t\t{\n\t\t\tSetValue (k);\n\t\t\tSetValue (k);\n\t\t}\n\", 1, @\"\n\t\t{\n\t\t\tint k = 12;\n\t\t\tSetValue (k);\n\t\t\tSetValue (k);\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CaseTarget ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tint j = 12;\n\t\tswitch (a) {\n\t\tcase 2:\n\t\t\tSetValue (j + 1);\n\t\t\tbreak;\n\t\t}\n\", 1, @\"\n\t\tswitch (a) {\n\t\tcase 2:\n\t\t\tint j = 12;\n\t\t\tSetValue (j + 1);\n\t\t\tbreak;\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotExpandElseClause ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tstring o = \"\"Hello World !\"\";\n\t\tif (false) {\n\t\t} else if (!o.Contains (\"\"Foo\"\")) {\n\t\t}\n\", 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotExpandForStatement ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tvar val = 12;\n\t\tif (false) {\n\t\t\tfor (var i = GetValue (); ; i++)\n\t\t\t\tSystem.Console.WriteLine (val);\n\t\t}\n\", 1, @\"\n\t\tif (false) {\n\t\t\tvar val = 12;\n\t\t\tfor (var i = GetValue (); ; i++)\n\t\t\t\tSystem.Console.WriteLine (val);\n\t\t}\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotInsertBlockStatementInResourceAquisition ()\n\t\t{\t\n\t\t\tTestStatements(@\"\n\t\tstring o = \"\"Hello World !\"\";\n\t\tusing (var file = File.Open(o, FileMode.Open))\n\t\t\treturn;\n\", 0);\n\t\t}\n\n\t\t[Ignore(\"FIXME\")]\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingIntoBodyAfterMethodCall()\n\t\t{\t\n\t\t\tvar input = @\"\nusing System.IO;\n\nclass FooBar\n{\n\tpublic int foo = 5;\n\tpublic void ChangeFoo ()\n\t{\n\t\tfoo = 10;\n\t}\n}\n\nclass A\n{\n\tFooBar foo = new FooBar();\n\n\tpublic void F()\n\t{\n\t\tint length = foo.foo;\n\t\tfoo.ChangeFoo ();\n\t\tif (true) {\n\t\t\tSystem.Console.WriteLine (length);\n\t\t}\n\t}\n}\";\n\t\t\tTestRefactoringContext context;\n\t\t\tvar issues = GetIssues(new VariableDeclaredInWideScopeIssue(), input, out context);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void DoesNotSuggestMovingMethodCallInitializer()\n\t\t{\n\t\t\t// Method calls can have side effects therefore it's generally not possible to move them.\n\t\t\tTestStatements(@\"\n\t\tint val = GetValue ();\n\t\tif (true) {\n\t\t\tSystem.Console.WriteLine(val);\n\t\t}\n\");\n\t\t}\n\n\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/XmlDocIssueIssueTests.cs",
    "content": "//\n// InvalidXmlTypeReferenceIssueTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\n\nnamespace ICSharpCode.NRefactory.CSharp.CodeIssues\n{\n\t[TestFixture]\n\tpublic class XmlDocIssueTests: InspectionActionTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBeforeNamespace()\n\t\t{\n\t\t\tTest<XmlDocIssue>(@\"\n/// foo\nnamespace Foo {}\n\", @\"\nnamespace Foo {}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeUsing()\n\t\t{\n\t\t\tTest<XmlDocIssue>(@\"\n/// foo\nusing System;\n\", @\"\nusing System;\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeUsingAlias()\n\t\t{\n\t\t\tTest<XmlDocIssue>(@\"\n/// foo\nusing A = System;\n\", @\"\nusing A = System;\n\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBeforeExternAlias()\n\t\t{\n\t\t\tTest<XmlDocIssue>(@\"\n/// foo\nextern alias System;\n\", @\"\nextern alias System;\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeParameter()\n\t\t{\n\t\t\tTestRefactoringContext ctx;\n\t\t\tvar issues = GetIssues(new XmlDocIssue(), @\"\n/// <typeparam name=\"\"Undefined\"\"></typeparam>\nclass Foo {}\n\n/// <typeparam name=\"\"T\"\"></typeparam>\nclass Foo2<T> {}\n\", out ctx);\n\t\t\tAssert.AreEqual(1, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWrongMethodParameter()\n\t\t{\n\t\t\tTestRefactoringContext ctx;\n\t\t\tvar issues = GetIssues(new XmlDocIssue(), @\"\nclass Foo {\n\t/// <param name=\"\"undefined\"\"></param>\n\t/// <param name=\"\"y\"\"></param>\n\t/// <param name=\"\"z\"\"></param>\n\tpublic void FooBar(int x, int y, int z)\n\t{\n\t}\n\n\t/// <param name=\"\"x1\"\"></param>\n\t/// <param name=\"\"y\"\"></param>\n\tint this[int x, int y] { get { return 1;  } }\n}\n\", out ctx);\n\t\t\tAssert.AreEqual(2, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSeeCref()\n\t\t{\n\t\t\tTestRefactoringContext ctx;\n\t\t\tvar issues = GetIssues(new XmlDocIssue(), @\"\n/// <summary>\n/// </summary>\n/// <see cref=\"\"Undefined\"\"/>\nclass Foo {\n\tpublic void Undefined () {}\n}\n\n/// <summary>\n/// <seealso cref=\"\"Foo\"\"/>\n/// </summary>\n/// <see cref=\"\"Foo2\"\"/>\nclass Foo2 {}\n\", out ctx);\n\t\t\tAssert.AreEqual(0, issues.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestValidCref()\n\t\t{\n\t\t\tTestWrongContext<XmlDocIssue>(@\"\nusing System;\n\nnamespace Foo {\n\t/// <summary>\n\t/// </summary>\n\t/// <see cref=\"\"IDisposable\"\"/>\n\tclass Foo {\n\t\tpublic void Undefined () {}\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 17729 - Incorrect XML-docs warning about 'value' paramref \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17729 ()\n\t\t{\n\t\t\tTestWrongContext<XmlDocIssue>(@\"\nusing System;\n\nclass Foo {\n\t/// <summary>\n\t/// If <paramref name=\"\"value\"\"/> is 0 ...\n\t/// </summary>\n\tpublic int Bar { get; set; }\n}\n\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSeeCRefMember ()\n\t\t{\n\t\t\tTestWrongContext<XmlDocIssue>(@\"\nusing System;\n\nnamespace Foo\n{\n\tpublic interface IGroupingProvider\n\t{\n\t\tIGroupingProvider Next { get; set; }\n\t\t\n\t\t/// <summary>\n\t\t/// Occurs when <see cref=\"\"Next\"\"/> changes.\n\t\t/// </summary>\n\t\tevent EventHandler<EventArgs> NextChanged;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEventComment ()\n\t\t{\n\t\t\tTestIssue<XmlDocIssue>(@\"\nusing System;\n\nnamespace Foo\n{\n\tpublic interface IGroupingProvider\n\t{\n\t\t/// <summa\n\t\tevent EventHandler<EventArgs> NextChanged;\n\t}\n}\n\", 1);\n\t\t}\n\t}\n\n\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/DepthFirstVisitorTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[TestFixture]\n\tpublic class DepthFirstVisitorTests\n\t{\n\t\tsealed class CollectNodesVisitor : DepthFirstAstVisitor\n\t\t{\n\t\t\tinternal List<AstNode> nodes = new List<AstNode>();\n\t\t\t\n\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t{\n\t\t\t\tnodes.Add(node);\n\t\t\t\tbase.VisitChildren(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestCollectNodes()\n\t\t{\n\t\t\tvar cu = new CSharpParser().Parse(\"using System;\\nclass Test {\\n  int field; // comment\\n}\");\n\t\t\tCollectNodesVisitor v = new CollectNodesVisitor();\n\t\t\tcu.AcceptVisitor(v);\n\t\t\tAssert.AreEqual(cu.DescendantsAndSelf.ToList(), v.nodes);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/InsertMissingTokensDecoratorTests.cs",
    "content": "﻿// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.Editor;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Parser;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t/// Description of InsertMissingTokensDecoratorTests.\n\t/// </summary>\n\t[TestFixture]\n\tpublic class InsertMissingTokensDecoratorTests\n\t{\n\t\tstring[] fileNames;\n\t\t\n\t\t[TestFixtureSetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tstring path = Path.GetFullPath (Path.Combine (\"..\", \"..\"));\n\t\t\tif (!File.Exists(Path.Combine(path, \"NRefactory.sln\")))\n\t\t\t\tthrow new InvalidOperationException(\"Test cannot find the NRefactory source code in \" + path);\n\t\t\tfileNames = Directory.GetFiles(path, \"*.cs\", SearchOption.AllDirectories);\n\t\t}\n\t\t\n\t\tstatic void RemoveTokens(AstNode node)\n\t\t{\n\t\t\tforeach (var child in node.Descendants) {\n\t\t\t\tif (child is CSharpTokenNode && !(child is CSharpModifierToken))\n\t\t\t\t\tchild.Remove();\n\t\t\t\telse if (child.NodeType == NodeType.Whitespace)\n\t\t\t\t\tchild.Remove();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid AssertOutput(AstNode node)\n\t\t{\n\t\t\tRemoveTokens(node);\n\t\t\tStringWriter w = new StringWriter();\n\t\t\tw.NewLine = \"\\n\";\n\t\t\tnode.AcceptVisitor(new CSharpOutputVisitor(TokenWriter.CreateWriterThatSetsLocationsInAST(w), FormattingOptionsFactory.CreateSharpDevelop()));\n\t\t\tvar doc = new ReadOnlyDocument(w.ToString());\n\t\t\tConsistencyChecker.CheckMissingTokens(node, \"test.cs\", doc);\n\t\t\tConsistencyChecker.CheckPositionConsistency(node, \"test.cs\", doc);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleClass()\n\t\t{\n\t\t\tvar code = @\"class Test\n{\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tAssertOutput(unit);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleMethod()\n\t\t{\n\t\t\tvar code = @\"class Test\n{\n\tvoid A ()\n\t{\n\t}\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tAssertOutput(unit);\n\t\t}\n\t\t\n\t\t[Test, Ignore]\n\t\tpublic void SelfTest()\n\t\t{\n\t\t\tforeach (var file in fileNames) {\n\t\t\t\tConsole.WriteLine(\"processing {0}...\", file);\n\t\t\t\tvar node = SyntaxTree.Parse(File.ReadAllText(file), file);\n\t\t\t\tAssertOutput(node);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t[TestFixture]\n\tpublic class InsertParenthesesVisitorTests\n\t{\n\t\tCSharpFormattingOptions policy;\n\t\t\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tpolicy = FormattingOptionsFactory.CreateMono ();\n\t\t}\n\t\t\n\t\tstring InsertReadable(Expression expr)\n\t\t{\n\t\t\texpr = expr.Clone();\n\t\t\texpr.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true });\n\t\t\tStringWriter w = new StringWriter();\n\t\t\tw.NewLine = \" \";\n\t\t\texpr.AcceptVisitor(new CSharpOutputVisitor(new TextWriterTokenWriter(w) { IndentationString = \"\" }, policy));\n\t\t\treturn w.ToString();\n\t\t}\n\t\t\n\t\tstring InsertRequired(Expression expr)\n\t\t{\n\t\t\texpr = expr.Clone();\n\t\t\texpr.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = false });\n\t\t\tStringWriter w = new StringWriter();\n\t\t\tw.NewLine = \" \";\n\t\t\texpr.AcceptVisitor(new CSharpOutputVisitor(new TextWriterTokenWriter(w) { IndentationString = \"\" }, policy));\n\t\t\treturn w.ToString();\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EqualityInAssignment()\n\t\t{\n\t\t\tExpression expr = new AssignmentExpression(\n\t\t\t\tnew IdentifierExpression(\"cond\"),\n\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\tnew IdentifierExpression(\"a\"),\n\t\t\t\t\tBinaryOperatorType.Equality,\n\t\t\t\t\tnew IdentifierExpression(\"b\")\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"cond = a == b\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"cond = (a == b)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TrickyCast1()\n\t\t{\n\t\t\tExpression expr = new UnaryOperatorExpression(\n\t\t\t\tUnaryOperatorType.Minus, new IdentifierExpression(\"a\")\n\t\t\t).CastTo(new PrimitiveType(\"int\"));\n\t\t\t\n\t\t\tAssert.AreEqual(\"(int)-a\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(int)(-a)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TrickyCast2()\n\t\t{\n\t\t\tExpression expr = new UnaryOperatorExpression(\n\t\t\t\tUnaryOperatorType.Minus, new IdentifierExpression(\"a\")\n\t\t\t).CastTo(new SimpleType(\"MyType\"));\n\t\t\t\n\t\t\tAssert.AreEqual(\"(MyType)(-a)\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(MyType)(-a)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TrickyCast3()\n\t\t{\n\t\t\tExpression expr = new UnaryOperatorExpression(\n\t\t\t\tUnaryOperatorType.Not, new IdentifierExpression(\"a\")\n\t\t\t).CastTo(new SimpleType(\"MyType\"));\n\t\t\t\n\t\t\tAssert.AreEqual(\"(MyType)!a\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(MyType)(!a)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TrickyCast4()\n\t\t{\n\t\t\tExpression expr = new PrimitiveExpression(int.MinValue).CastTo(new SimpleType(\"MyType\"));\n\t\t\t\n\t\t\tAssert.AreEqual(\"(MyType)(-2147483648)\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(MyType)(-2147483648)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TrickyCast5()\n\t\t{\n\t\t\tExpression expr = new PrimitiveExpression(-1.0).CastTo(new SimpleType(\"MyType\"));\n\t\t\t\n\t\t\tAssert.AreEqual(\"(MyType)(-1.0)\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(MyType)(-1.0)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TrickyCast6()\n\t\t{\n\t\t\tExpression expr = new PrimitiveExpression(int.MinValue).CastTo(new PrimitiveType(\"double\"));\n\t\t\t\n\t\t\tAssert.AreEqual(\"(double)-2147483648\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(double)-2147483648\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CastAndInvoke()\n\t\t{\n\t\t\tExpression expr = new IdentifierExpression(\"a\")\n\t\t\t\t.CastTo(new PrimitiveType(\"string\"))\n\t\t\t\t.Member(\"Length\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"((string)a).Length\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"((string)a).Length\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoubleNegation()\n\t\t{\n\t\t\tExpression expr = new UnaryOperatorExpression(\n\t\t\t\tUnaryOperatorType.Minus,\n\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.Minus, new IdentifierExpression(\"a\"))\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"- -a\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"-(-a)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AdditionWithConditional()\n\t\t{\n\t\t\tExpression expr = new BinaryOperatorExpression {\n\t\t\t\tLeft = new IdentifierExpression(\"a\"),\n\t\t\t\tOperator = BinaryOperatorType.Add,\n\t\t\t\tRight = new ConditionalExpression {\n\t\t\t\t\tCondition = new BinaryOperatorExpression {\n\t\t\t\t\t\tLeft = new IdentifierExpression(\"b\"),\n\t\t\t\t\t\tOperator = BinaryOperatorType.Equality,\n\t\t\t\t\t\tRight = new PrimitiveExpression(null)\n\t\t\t\t\t},\n\t\t\t\t\tTrueExpression = new IdentifierExpression(\"c\"),\n\t\t\t\t\tFalseExpression = new IdentifierExpression(\"d\")\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tAssert.AreEqual(\"a + (b == null ? c : d)\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"a + ((b == null) ? c : d)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeTestInConditional()\n\t\t{\n\t\t\tExpression expr = new ConditionalExpression {\n\t\t\t\tCondition = new IdentifierExpression(\"a\").IsType(\n\t\t\t\t\tnew ComposedType {\n\t\t\t\t\t\tBaseType = new PrimitiveType(\"int\"),\n\t\t\t\t\t\tHasNullableSpecifier = true\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t\tTrueExpression = new IdentifierExpression(\"b\"),\n\t\t\t\tFalseExpression = new IdentifierExpression(\"c\")\n\t\t\t};\n\t\t\t\n\t\t\tAssert.AreEqual(\"a is int? ? b : c\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(a is int?) ? b : c\", InsertReadable(expr));\n\t\t\t\n\t\t\tpolicy.SpaceBeforeConditionalOperatorCondition = false;\n\t\t\tpolicy.SpaceAfterConditionalOperatorCondition = false;\n\t\t\tpolicy.SpaceBeforeConditionalOperatorSeparator = false;\n\t\t\tpolicy.SpaceAfterConditionalOperatorSeparator = false;\n\t\t\t\n\t\t\tAssert.AreEqual(\"a is int? ?b:c\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(a is int?)?b:c\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodCallOnQueryExpression()\n\t\t{\n\t\t\tExpression expr = new QueryExpression {\n\t\t\t\tClauses = {\n\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t},\n\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\tExpression = new IdentifierExpression(\"a\").Invoke(\"c\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}.Invoke(\"ToArray\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"(from a in b select a.c ()).ToArray ()\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(from a in b select a.c ()).ToArray ()\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SumOfQueries()\n\t\t{\n\t\t\tQueryExpression query = new QueryExpression {\n\t\t\t\tClauses = {\n\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t},\n\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\tExpression = new IdentifierExpression(\"a\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tExpression expr = new BinaryOperatorExpression(\n\t\t\t\tquery,\n\t\t\t\tBinaryOperatorType.Add,\n\t\t\t\tquery.Clone()\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"(from a in b select a) + \" +\n\t\t\t                \"from a in b select a\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(from a in b select a) + \" +\n\t\t\t                \"(from a in b select a)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QueryInTypeTest()\n\t\t{\n\t\t\tExpression expr = new QueryExpression {\n\t\t\t\tClauses = {\n\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t},\n\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\tExpression = new IdentifierExpression(\"a\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}.IsType(new PrimitiveType(\"int\"));\n\t\t\t\n\t\t\tAssert.AreEqual(\"(from a in b select a) is int\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(from a in b select a) is int\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PrePost()\n\t\t{\n\t\t\tExpression expr = new UnaryOperatorExpression(\n\t\t\t\tUnaryOperatorType.Increment,\n\t\t\t\tnew UnaryOperatorExpression(\n\t\t\t\t\tUnaryOperatorType.PostIncrement,\n\t\t\t\t\tnew IdentifierExpression(\"a\")\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"++a++\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"++(a++)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PostPre()\n\t\t{\n\t\t\tExpression expr = new UnaryOperatorExpression(\n\t\t\t\tUnaryOperatorType.PostIncrement,\n\t\t\t\tnew UnaryOperatorExpression(\n\t\t\t\t\tUnaryOperatorType.Increment,\n\t\t\t\t\tnew IdentifierExpression(\"a\")\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"(++a)++\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(++a)++\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Logical1()\n\t\t{\n\t\t\tExpression expr = new BinaryOperatorExpression(\n\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\tnew IdentifierExpression(\"a\"),\n\t\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\t\tnew IdentifierExpression(\"b\")\n\t\t\t\t),\n\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\tnew IdentifierExpression(\"c\")\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"a && b && c\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"a && b && c\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Logical2()\n\t\t{\n\t\t\tExpression expr = new BinaryOperatorExpression(\n\t\t\t\tnew IdentifierExpression(\"a\"),\n\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\tnew IdentifierExpression(\"b\"),\n\t\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\t\tnew IdentifierExpression(\"c\")\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"a && (b && c)\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"a && (b && c)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Logical3()\n\t\t{\n\t\t\tExpression expr = new BinaryOperatorExpression(\n\t\t\t\tnew IdentifierExpression(\"a\"),\n\t\t\t\tBinaryOperatorType.ConditionalOr,\n\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\tnew IdentifierExpression(\"b\"),\n\t\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\t\tnew IdentifierExpression(\"c\")\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"a || b && c\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"a || (b && c)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Logical4()\n\t\t{\n\t\t\tExpression expr = new BinaryOperatorExpression(\n\t\t\t\tnew IdentifierExpression(\"a\"),\n\t\t\t\tBinaryOperatorType.ConditionalAnd,\n\t\t\t\tnew BinaryOperatorExpression(\n\t\t\t\t\tnew IdentifierExpression(\"b\"),\n\t\t\t\t\tBinaryOperatorType.ConditionalOr,\n\t\t\t\t\tnew IdentifierExpression(\"c\")\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tAssert.AreEqual(\"a && (b || c)\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"a && (b || c)\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayCreationInIndexer()\n\t\t{\n\t\t\tExpression expr = new IndexerExpression {\n\t\t\t\tTarget = new ArrayCreateExpression {\n\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\tArguments = { new PrimitiveExpression(1) }\n\t\t\t\t},\n\t\t\t\tArguments = { new PrimitiveExpression(0) }\n\t\t\t};\n\t\t\t\n\t\t\tAssert.AreEqual(\"(new int[1]) [0]\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(new int[1]) [0]\", InsertReadable(expr));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayCreationWithInitializerInIndexer()\n\t\t{\n\t\t\tExpression expr = new IndexerExpression {\n\t\t\t\tTarget = new ArrayCreateExpression {\n\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\tArguments = { new PrimitiveExpression(1) },\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = { new PrimitiveExpression(42) }\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tArguments = { new PrimitiveExpression(0) }\n\t\t\t};\n\t\t\t\n\t\t\tAssert.AreEqual(\"new int[1] { 42 } [0]\", InsertRequired(expr));\n\t\t\tAssert.AreEqual(\"(new int[1] { 42 }) [0]\", InsertReadable(expr));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Inspector/InconsistentNamingIssueTests.cs",
    "content": "// \n// InconsistentNamingIssueTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin <http://xamarin.com>\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\n\nnamespace ICSharpCode.NRefactory\n{\n\tpublic class InconsistentNamingIssueTests\n\t{\n\t\tpublic InconsistentNamingIssueTests ()\n\t\t{\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Bugs/ParserBugTests.cs",
    "content": "﻿// \n// ParserBugTests.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\nusing System.Linq;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Bugs\n{\n\t[TestFixture]\n\tpublic class ParserBugTests\n\t{\n\t\t/// <summary>\n\t\t/// Bug 4252 - override bug in mcs ast\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4252()\n\t\t{\n\t\t\tstring code = @\"\nclass Foo\n{\n\n    class Bar\n    {\n          override foo\n    }\n\n    public Foo () \n    {\n    }\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar constructor = type.Members.Skip(1).First() as ConstructorDeclaration;\n\t\t\tvar passed = !constructor.HasModifier(Modifiers.Override);\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 4059 - Return statement without semicolon missing in the AST\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4059()\n\t\t{\n\t\t\tstring code = @\"\nclass Stub\n{\n    Test A ()\n    {\n        return new Test ()\n    }\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tbool passed = method.Body.Statements.FirstOrDefault() is ReturnStatement;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 4058 - Unattached parameter attributes should be included in the AST\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4058()\n\t\t{\n\t\t\tstring code = @\"\nclass TestClass\n{\n  TestClass([attr])\n  {\n  }\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar constructor = type.Members.First() as ConstructorDeclaration;\n\t\t\tbool passed = constructor.GetNodeAt<AttributeSection>(constructor.LParToken.StartLocation.Line, constructor.LParToken.StartLocation.Column + 1) != null;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3952 - Syntax errors that causes AST not inserted \n\t\t/// </summary>\n\t\t[Ignore(\"Still open 03/2013\")]\n\t\t[Test]\n\t\tpublic void TestBug3952()\n\t\t{\n\t\t\tstring code = @\"\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tTest(new Foo (\n\t}\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tbool passed = !method.Body.IsNull;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3578 - For condition not in the AST.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3578()\n\t\t{\n\t\t\tstring code = \n@\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tfor (int i = 0; i < foo.bar)\n\t}\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tbool passed = @\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tfor (int i = 0; i < foo.bar;)\n\t}\n}\" == unit.ToString().Trim ();\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3517 - Incomplete conditional operator in the AST request.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3517()\n\t\t{\n\t\t\tstring code = \n@\"class Test\n{\n\tvoid Foo ()\n\t{\n\t\ta = cond ? expr\n\t}\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tvar exprStmt = method.Body.Statements.FirstOrDefault() as ExpressionStatement;\n\t\t\tvar expr = exprStmt.Expression as AssignmentExpression;\n\t\t\tbool passed = expr != null && expr.Right is ConditionalExpression;\n\t\t\t\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBug3517Case2()\n\t\t{\n\t\t\tstring code = \n@\"class Test\n{\n\tvoid Foo ()\n\t{\n\t\ta = cond ? expr :\n\t}\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tvar exprStmt = method.Body.Statements.FirstOrDefault() as ExpressionStatement;\n\t\t\tvar expr = exprStmt.Expression as AssignmentExpression;\n\t\t\tbool passed = expr != null && expr.Right is ConditionalExpression;\n\t\t\t\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3468 - Local variable declarations are not inserted in ast & break declaring member locations.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3468()\n\t\t{\n\t\t\tstring code = \n@\"class C\n{\n    public static void Main (string[] args)\n    {\n        string str = \n    }\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tbool passed = !method.Body.IsNull;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3288 - Try ... catch not added to the ast if catch block is missing\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3288()\n\t\t{\n\t\t\tstring code = \n@\"class Test\n{\n\tpublic void Main(string[] args)\n\t{\n\t\ttry {\n\t\t} catch (Exception name)\n\t}\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tbool passed = method.Body.Statements.FirstOrDefault() is TryCatchStatement;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3155 - Anonymous methods in variable declarations don't produce an ast, if the ';' is missing.\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3155()\n\t\t{\n\t\t\tstring code = \n@\"using System;\n\nclass Test\n{\n    void Foo ()\n    {\n        Action<int> act = delegate (int testMe) {\n\n        }\n    }\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tbool passed = unit.ToString().Trim() == @\"using System;\n\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tAction<int> act = delegate (int testMe) {\n\t\t};\n\t}\n}\";\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 4556 - AST broken for unclosed invocation\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug4556()\n\t\t{\n\t\t\tstring code = \n@\"using System;\n\nclass Foo\n{\n    public static void Main (string[] args)\n    {\n        Console.WriteLine (\"\"foo\"\", \n    }\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tvar type = unit.Members.First(m => m is TypeDeclaration) as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tbool passed = !method.Body.IsNull;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 5064 - Autocomplete doesn't include object initializer properties in yield return \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug5064()\n\t\t{\n\t\t\tstring code = \n@\"public class Bar\n{\n    public IEnumerable<Foo> GetFoos()\n    {\n        yield return new Foo { }\n    }\n}\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tstring text = unit.ToString().Trim();\n\t\t\tstring expected = @\"public class Bar\n{\n\tpublic IEnumerable<Foo> GetFoos()\n\t{\n\t\tyield return new Foo { };\n\t}\n}\";\n\t\t\tint i = 0, j = 0;\n\t\t\twhile (i < text.Length && j < expected.Length) {\n\t\t\t\tif (char.IsWhiteSpace (text[i])) {\n\t\t\t\t\ti++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (char.IsWhiteSpace (expected[j])) {\n\t\t\t\t\tj++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (text [i] != expected [j]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;j++;\n\t\t\t}\n\t\t\tbool passed = i == text.Length && j == expected.Length;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + expected);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 5389 - Code completion does not work well inside a dictionary initializer\n\t\t/// </summary>\n\t\t[Test()]\n\t\tpublic void TestBug5389()\n\t\t{\n\t\t\tstring code = \n\t\t\t\t@\"class Foo\n{\n\tstatic Dictionary<Tuple<Type, string>, string> CreatePropertyMap ()\n\t{\n\t\treturn new Dictionary<Tuple<Type, string>, string> {\n\t\t\t{ Tuple.Create (typeof (MainClass), \"\"Prop1\"\"), \"\"Prop2\"\" },\n\t\t\t{ Tuple.C }\n\t\t}\n\t}\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\t\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tvar stmt = method.Body.Statements.First () as ReturnStatement;\n\t\t\tbool passed = stmt.Expression is ObjectCreateExpression;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void TestIncompleteParameter()\n\t\t{\n\t\t\tstring code = \n\t\t\t\t@\"class Foo\n{\n\tvoid Bar (params System.A) {}\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar method = type.Members.First() as MethodDeclaration;\n\t\t\tbool passed = method.Parameters.Count == 1;\n\t\t\tif (!passed) {\n\t\t\t\tConsole.WriteLine(\"Expected:\" + code);\n\t\t\t\tConsole.WriteLine(\"Was:\" + unit);\n\t\t\t}\n\t\t\tAssert.IsTrue(passed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultipleNestedPartialClassesInSameFile ()\n\t\t{\n\t\t\tstring code = @\"public partial class PartialClassInSameFile\n\t{\n\t\tpublic partial class NestedPartial\n\t\t{\n\t\t\tvoid Foo ()\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic partial class PartialClassInSameFile\n\t{\n\t\tpublic partial class NestedPartial \n\t\t{\n\t\t\tvoid FooBar ()\n\t\t\t{\n\n\t\t\t}\n\t\t}\n\t}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tConsole.WriteLine(unit);\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tAssert.IsTrue(type.Members.FirstOrDefault() is TypeDeclaration, \"1st nested partial not found.\"); \n\n\t\t\ttype = unit.Members.Skip (1).First() as TypeDeclaration;\n\t\t\tAssert.IsTrue(type.Members.FirstOrDefault() is TypeDeclaration, \"2nd nested partial not found.\"); \n\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 12383 - [AST] Non existing namespaces generated\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug12383()\n\t\t{\n\t\t\tstring code = @\"using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing Kajabity.Tools.Java;\nusing Xamarin.Installer.Core;\n\nnamespace Xamarin.Installer.Core.Components.Android\n{\n\tpublic class AndroidComponentSystemImage : AndroidComponentBase\n\t{\n\t\tpublic string Abi { get; private set; }\n\n\t\tpublic uint ApiLevel { get; private set; }\n\n\t\tpublic override string Name {\n\t\t\tget { return String.Format (SYSTEM_IMAGE_NAME_FORMAT, ApiLevel); }\n\t\t}\n\n\t\tpublic override string UserFriendlyName {\n\t\t\tget { return String.Format (\"\"{0} System Image for API {1} ({2})\"\", LicenseVendor, ApiLevel, Abi); }\n\t\t}\n\n\t\tpublic override string LicenseTitle {\n\t\t\tget { return String.Format (\"\"{0} System Image\"\", LicenseVendor); }\n\t\t}\n\n\t\tstring LicenseVendor {\n\t\t\tget {\n\t\t\t\tstring ul = Info.UsesLicense;\n\t\t\t\tif (String.IsNullOrWhiteSpace (ul))\n\t\t\t\t\treturn \"\"Android\"\";\n\t\t\t\tif (ul.IndexOf (\"\"intel\"\", StringComparison.OrdinalIgnoreCase) >= 0)\n\t\t\t\t\treturn \"\"Intel\"\";\n\t\t\t\telse if (ul.IndexOf (\"\"mips\"\", StringComparison.OrdinalIgnoreCase) >= 0)\n\t\t\t\t\treturn \"\"MIPS\"\";\n\t\t\t\telse\n\t\t\t\t\treturn \"\"Android\"\";\n\t\t\t\n\t\t}\n\n\t\tpublic override bool Init (AndroidComponentInfoBase componentInfo, AndroidSDKComponentInfo sdkInfo)\n\t\t{\n\t\t\tif (!base.Init (componentInfo, sdkInfo))\n\t\t\t\treturn false;\n\n\t\t\tvar info = componentInfo as AndroidComponentSystemImageInfo;\n\t\t\tif (info == null) {\n\t\t\t\tLogUnexpectedComponentInfoType (componentInfo);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tApiLevel = info.ApiLevel;\n\t\t\tAbi = info.Abi;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool Install (DownloadedItem item, AndroidSdkInstance sdk)\n\t\t{\n\t\t\tif (item == null)\n\t\t\t\tthrow new ArgumentNullException (\"\"item\"\");\n\t\t\tif (sdk == null)\n\t\t\t\tthrow new ArgumentNullException (\"\"sdk\"\");\n\n\t\t\tbool success = true;\n\t\t\tstring message = \"\"Android SDK Platform API level {0}, ABI {1} system image failed to install.\"\";\n\n\t\t\tLog.Debug (\"\"Installing system image for Android SDK Platform API {0}, ABI {1}.\"\", ApiLevel, Abi);\n\t\t\ttry {\n\t\t\t\tif (!DoInstall (item.FilePath, sdk.Path, \"\"system-images\"\", \"\"android-\"\" + ApiLevel, Abi)) {\n\t\t\t\t\tLog.Warning (message, ApiLevel, Abi);\n\t\t\t\t\tsuccess = false;\n\t\t\t\t} else\n\t\t\t\t\tUpdateSourceProperties (sdk.Path);\n\t\t\t} catch (Exception ex) {\n\t\t\t\tLog.Warning (message, ex, ApiLevel, Abi);\n\t\t\t\tsuccess = false;\n\t\t\t}\n\n\t\t\treturn success;\n\t\t}\n\n\t\tpublic override bool IsInstallationNeeded (AndroidSdkInstance instance, AndroidPlatformSpecificToolNames toolNames)\n\t\t{\n\t\t\tInstalled = false;\n\t\t\tif (instance == null)\n\t\t\t\tthrow new ArgumentNullException (\"\"instance\"\");\n\n\t\t\tstring systemImagePath = Path.Combine (instance.Path, \"\"system-images\"\", \"\"android-\"\" + ApiLevel, Abi);\n\t\t\tAndroidDownloadsCharter charter = instance.DownloadCharter;\n\t\t\tJavaProperties props;\n\n\t\t\tif (!Directory.Exists (systemImagePath)) {\n\t\t\t\tcharter.DownloadSystemImages = true;\n\t\t\t\tinstance.AddUpdateReason (\"\"System image {0}/{1} directory does not exist\"\", ApiLevel, Abi);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (!ReadJavaProperties (Path.Combine (systemImagePath, \"\"source.properties\"\"), out props) || props == null) {\n\t\t\t\tcharter.DownloadSystemImages = true;\n\t\t\t\tinstance.AddUpdateReason (\"\"Unable to read System Image {0}/{1} properties, assuming it's outdated\"\", ApiLevel, Abi);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tInstalled = true;\n\t\t\tstring rev;\n\t\t\tVersion instv;\n\t\t\tif (!props.GetPkgRevision (out rev, out instv)) {\n\t\t\t\tcharter.DownloadSystemImages = true;\n\t\t\t\tinstance.AddUpdateReason (\"\"Unable to read System Image {0}/{1} revision, assuming it's outdated\"\", ApiLevel, Abi);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tstring value;\n\t\t\tif (!props.GetProperty<string> (\"\"SystemImage.Abi\"\", out value) || String.IsNullOrEmpty (value)) {\n\t\t\t\tcharter.DownloadSystemImages = true;\n\t\t\t\tinstance.AddUpdateReason (\"\"Unable to read System Image {0}/{1} ABI, assuming it's outdated\"\", ApiLevel, Abi);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (String.Compare (value, Abi, StringComparison.OrdinalIgnoreCase) != 0) {\n\t\t\t\tcharter.DownloadSystemImages = true;\n\t\t\t\tinstance.AddUpdateReason (\"\"Installed System Image {0} ABI ({1}) is different ({2}), assuming it's outdated\"\", ApiLevel, Abi, value);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (Revision.AndroidTryParse (true) > instv) {\n\t\t\t\tcharter.DownloadSystemImages = true;\n\t\t\t\tinstance.AddUpdateReason (\"\"Installed System Image {0}/{1} revision {2} is older than the required one ({3})\"\", ApiLevel, Abi, instv, Revision);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tbool needsDownload = false;\n\t\t\tif (!File.Exists (Path.Combine (systemImagePath, \"\"system.img\"\"))) {\n\t\t\t\tif (!File.Exists (Path.Combine (systemImagePath, \"\"images\"\", Abi, \"\"system.img\"\"))) {\n\t\t\t\t\tneedsDownload = true;\n\t\t\t\t\tcharter.DownloadSystemImages = true;\n\t\t\t\t\tinstance.AddUpdateReason (\"\"system.img not found for API {0}, ABI {1}\"\", ApiLevel, Abi);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn needsDownload;\n\t\t}\n\n\t\tprotected override void UpdateSourceProperties (string targetBasePath)\n\t\t{\n\t\t\tvar props = new JavaProperties ();\n\n\t\t\tprops.SetProperty (\"\"Pkg.Desc\"\", Description);\n\t\t\tprops.SetProperty (\"\"Archive.Os\"\", OS.ToUpperInvariant ());\n\t\t\tprops.SetProperty (\"\"Archive.Arch\"\", Arch.ToUpperInvariant ());\n\t\t\tprops.SetProperty (\"\"AndroidVersion.ApiLevel\"\", ApiLevel.ToString ());\n\t\t\tprops.SetProperty (\"\"Pkg.Revision\"\", Revision.ToString ());\n\t\t\tprops.SetProperty (\"\"SystemImage.Abi\"\", Abi);\n\t\t\tprops.SetProperty (\"\"Pkg.SourceUrl\"\", SDKInfo.RepositoryUrl);\n\n\t\t\tSaveProperties (props, targetBasePath, \"\"system-images\"\", \"\"android-\"\" + ApiLevel, Abi);\n\t\t}\n\t}\n}\n\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tAssert.AreEqual(1, unit.DescendantNodesAndSelf().OfType<NamespaceDeclaration>().Count());\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmptyCollectionParsing()\n\t\t{\n\t\t\tstring code = @\"\nclass FooBar\n{\n\tDictionary<byte, string> foo = new Dictionary<byte, string>{\n\t\t{},\n\t\t{}\n\t};\n}\n\";\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\n\t\t\tvar type = unit.Members.First() as TypeDeclaration;\n\t\t\tvar member = type.Members.First() as FieldDeclaration;\n\t\t\tvar init = member.Variables.First().Initializer as ObjectCreateExpression;\n\t\t\tAssert.AreEqual(2, init.Initializer.Elements.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AsyncAfterEnum() {\n\t\t\tstring code = @\"\nusing System.Threading.Tasks;\nclass C\n{\n\tenum E {}\n\tasync Task M() {\n\t}\n}\";\n\n\t\t\tvar unit = SyntaxTree.Parse(code);\n\t\t\tvar type = unit.Members.OfType<TypeDeclaration>().Single();\n\t\t\tvar member = type.Members.OfType<MethodDeclaration>().SingleOrDefault(m => m.Name == \"M\");\n\t\t\tAssert.IsNotNull(member, \"M() not found.\"); \n\t\t\tAssert.That(member.Modifiers, Is.EqualTo(Modifiers.Async));\n\t\t}\n\t\t\n\n\t\t[Test]\n\t\tpublic void TestParseTypeReferenceBug()\n\t\t{\n\t\t\tvar s = \"global::Thing<int>.Done<string>\";\n\t\t\tvar type = new CSharpParser().ParseTypeReference(s);\n\n\t\t\tAssert.AreEqual(s, type.ToString());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParseExpressionBug()\n\t\t{\n\t\t\tvar s = \"global::Thing<int>.Done<string>\";\n\t\t\tvar expr = new CSharpParser().ParseExpression(s);\n\n\t\t\tAssert.AreEqual(s, expr.ToString());\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ConsistencyChecker.cs",
    "content": "﻿// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing ICSharpCode.NRefactory.Editor;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser\n{\n\t/// <summary>\n\t/// Provides utilities to check whether positions and/or tokens in an AST are valid.\n\t/// </summary>\n\tpublic static class ConsistencyChecker\n\t{\n\t\tstatic void PrintNode (AstNode node)\n\t\t{\n\t\t\tConsole.WriteLine (\"Parent:\" + node.GetType ());\n\t\t\tConsole.WriteLine (\"Children:\");\n\t\t\tforeach (var c in node.Children)\n\t\t\t\tConsole.WriteLine (c.GetType () +\" at:\"+ c.StartLocation +\"-\"+ c.EndLocation + \" Role: \"+ c.Role);\n\t\t\tConsole.WriteLine (\"----\");\n\t\t}\n\t\t\n\t\tpublic static void CheckPositionConsistency (AstNode node, string currentFileName, IDocument currentDocument = null)\n\t\t{\n\t\t\tif (currentDocument == null)\n\t\t\t\tcurrentDocument = new ReadOnlyDocument(File.ReadAllText(currentFileName));\n\t\t\tstring comment = \"(\" + node.GetType ().Name + \" at \" + node.StartLocation + \" in \" + currentFileName + \")\";\n\t\t\tvar pred = node.StartLocation <= node.EndLocation;\n\t\t\tif (!pred)\n\t\t\t\tPrintNode (node);\n\t\t\tAssert.IsTrue(pred, \"StartLocation must be before EndLocation \" + comment);\n\t\t\tvar prevNodeEnd = node.StartLocation;\n\t\t\tvar prevNode = node;\n\t\t\tfor (AstNode child = node.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\tbool assertion = child.StartLocation >= prevNodeEnd;\n\t\t\t\tif (!assertion) {\n\t\t\t\t\tPrintNode (prevNode);\n\t\t\t\t\tPrintNode (node);\n\t\t\t\t}\n\t\t\t\tAssert.IsTrue(assertion, currentFileName + \": Child \" + child.GetType () +\" (\" + child.StartLocation  + \")\" +\" must start after previous sibling \" + prevNode.GetType () + \"(\" + prevNode.StartLocation + \")\");\n\t\t\t\tCheckPositionConsistency(child, currentFileName, currentDocument);\n\t\t\t\tprevNodeEnd = child.EndLocation;\n\t\t\t\tprevNode = child;\n\t\t\t}\n\t\t\tAssert.IsTrue(prevNodeEnd <= node.EndLocation, \"Last child must end before parent node ends \" + comment);\n\t\t}\n\t\t\n\t\tpublic static void CheckMissingTokens(AstNode node, string currentFileName, IDocument currentDocument = null)\n\t\t{\n\t\t\tif (currentDocument == null)\n\t\t\t\tcurrentDocument = new ReadOnlyDocument(File.ReadAllText(currentFileName));\n\t\t\tif (IsLeafNode(node)) {\n\t\t\t\tAssert.IsNull(node.FirstChild, \"Token nodes should not have children\");\n\t\t\t} else {\n\t\t\t\tvar prevNodeEnd = node.StartLocation;\n\t\t\t\tvar prevNode = node;\n\t\t\t\tfor (AstNode child = node.FirstChild; child != null; child = child.NextSibling) {\n\t\t\t\t\tCheckWhitespace(prevNode, prevNodeEnd, child, child.StartLocation, currentFileName, currentDocument);\n\t\t\t\t\tCheckMissingTokens(child, currentFileName, currentDocument);\n\t\t\t\t\tprevNode = child;\n\t\t\t\t\tprevNodeEnd = child.EndLocation;\n\t\t\t\t}\n\t\t\t\tCheckWhitespace(prevNode, prevNodeEnd, node, node.EndLocation, currentFileName, currentDocument);\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic bool IsLeafNode(AstNode node)\n\t\t{\n\n\t\t\tif (node.NodeType == NodeType.Token)\n\t\t\t\treturn true;\n\t\t\tif (node.NodeType == NodeType.Whitespace)\n\t\t\t\treturn !(node is PragmaWarningPreprocessorDirective);\n\t\t\treturn node is PrimitiveType || node is PrimitiveExpression || node is NullReferenceExpression;\n\t\t}\n\t\t\n\t\tstatic void CheckWhitespace(AstNode startNode, TextLocation whitespaceStart, AstNode endNode, TextLocation whitespaceEnd, string currentFileName, IDocument currentDocument)\n\t\t{\n\t\t\tif (whitespaceStart == whitespaceEnd || startNode == endNode)\n\t\t\t\treturn;\n\t\t\tAssert.Greater(whitespaceStart.Line, 0);\n\t\t\tAssert.Greater(whitespaceStart.Column, 0);\n\t\t\tAssert.Greater(whitespaceEnd.Line, 0);\n\t\t\tAssert.Greater(whitespaceEnd.Column, 0);\n\t\t\tAssert.IsTrue(whitespaceEnd >= whitespaceStart, endNode.GetType().Name + \".StartLocation < \" + startNode.GetType().Name + \".EndLocation: \" + whitespaceEnd + \" < \" + whitespaceStart);\n\t\t\tint start = currentDocument.GetOffset(whitespaceStart.Line, whitespaceStart.Column);\n\t\t\tint end = currentDocument.GetOffset(whitespaceEnd.Line, whitespaceEnd.Column);\n\t\t\tstring text = currentDocument.GetText(start, end - start);\n\t\t\tbool assertion = string.IsNullOrWhiteSpace(text);\n\t\t\tif (!assertion) {\n\t\t\t\tif (startNode.Parent != endNode.Parent)\n\t\t\t\t\tPrintNode (startNode.Parent);\n\t\t\t\tPrintNode (endNode.Parent);\n\t\t\t}\n\t\t\tAssert.IsTrue(assertion, \"Expected whitespace between \" + startNode.GetType () +\":\" + whitespaceStart + \" and \" + endNode.GetType () + \":\" + whitespaceEnd\n\t\t\t              + \", but got '\" + text + \"' (in \" + currentFileName + \" parent:\" + startNode.Parent.GetType () +\")\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousMethodExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class AnonymousMethodExpressionTests\n\t{\n\t\tAnonymousMethodExpression Parse(string expression)\n\t\t{\n\t\t\treturn ParseUtilCSharp.ParseExpression<AnonymousMethodExpression>(expression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AnonymousMethodWithoutParameterList()\n\t\t{\n\t\t\tAnonymousMethodExpression ame = Parse(\"delegate {}\");\n\t\t\tAssert.AreEqual(0, ame.Parameters.Count());\n\t\t\tAssert.AreEqual(0, ame.Body.Statements.Count());\n\t\t\tAssert.IsFalse(ame.IsAsync);\n\t\t\tAssert.IsFalse(ame.HasParameterList);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AnonymousMethodAfterCast()\n\t\t{\n\t\t\tCastExpression c = ParseUtilCSharp.ParseExpression<CastExpression>(\"(ThreadStart)delegate {}\");\n\t\t\tAnonymousMethodExpression ame = (AnonymousMethodExpression)c.Expression;\n\t\t\tAssert.AreEqual(0, ame.Parameters.Count());\n\t\t\tAssert.AreEqual(0, ame.Body.Statements.Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EmptyAnonymousMethod()\n\t\t{\n\t\t\tAnonymousMethodExpression ame = Parse(\"delegate() {}\");\n\t\t\tAssert.AreEqual(0, ame.Parameters.Count());\n\t\t\tAssert.AreEqual(0, ame.Body.Statements.Count());\n\t\t\tAssert.IsTrue(ame.HasParameterList);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleAnonymousMethod()\n\t\t{\n\t\t\tAnonymousMethodExpression ame = Parse(\"delegate(int a, int b) { return a + b; }\");\n\t\t\tAssert.IsTrue(ame.HasParameterList);\n\t\t\tAssert.AreEqual(2, ame.Parameters.Count());\n\t\t\tAssert.AreEqual(1, ame.Body.Statements.Count());\n\t\t\tAssert.IsTrue(ame.Body.Statements.First() is ReturnStatement);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AsyncAnonymousMethod()\n\t\t{\n\t\t\tAnonymousMethodExpression ame = Parse(\"async delegate {}\");\n\t\t\tAssert.AreEqual(0, ame.Parameters.Count());\n\t\t\tAssert.AreEqual(0, ame.Body.Statements.Count());\n\t\t\tAssert.IsTrue(ame.IsAsync);\n\t\t\tAssert.IsFalse(ame.HasParameterList);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousTypeCreateExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class AnonymousTypeCreateExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void Simple()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new { Name = \\\"Test\\\", Price, Something.Property }\",\n\t\t\t\tnew AnonymousTypeCreateExpression {\n\t\t\t\t\tInitializers = {\n\t\t\t\t\t\tnew NamedExpression(\"Name\", new PrimitiveExpression(\"Test\")),\n\t\t\t\t\t\tnew IdentifierExpression(\"Price\"),\n\t\t\t\t\t\tnew IdentifierExpression(\"Something\").Member(\"Property\")\n\t\t\t\t\t}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/ArrayCreateExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class ArrayCreateExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void ArrayCreateExpressionTest1()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new int[5]\",\n\t\t\t\tnew ArrayCreateExpression {\n\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\tArguments = { new PrimitiveExpression(5) }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultidimensionalNestedArray()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new int[5,2][,,][]\",\n\t\t\t\tnew ArrayCreateExpression {\n\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\tArguments = { new PrimitiveExpression(5), new PrimitiveExpression(2) },\n\t\t\t\t\tAdditionalArraySpecifiers = {\n\t\t\t\t\t\tnew ArraySpecifier(3),\n\t\t\t\t\t\tnew ArraySpecifier(1)\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayWithImplicitSize()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new int[] { 1 }\",\n\t\t\t\tnew ArrayCreateExpression {\n\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\tAdditionalArraySpecifiers = {\n\t\t\t\t\t\tnew ArraySpecifier(0)\n\t\t\t\t\t},\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = { new PrimitiveExpression(1) }\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayWithImplicitSize2D()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new int[,] { { 1 } }\",\n\t\t\t\tnew ArrayCreateExpression {\n\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\tAdditionalArraySpecifiers = { new ArraySpecifier (2) },\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = { new PrimitiveExpression(1) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitlyTypedArrayCreateExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new[] { 1, 10, 100, 1000 }\",\n\t\t\t\tnew ArrayCreateExpression {\n\t\t\t\t\tAdditionalArraySpecifiers = {\n\t\t\t\t\t\tnew ArraySpecifier(0)\n\t\t\t\t\t},\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew PrimitiveExpression(1),\n\t\t\t\t\t\t\tnew PrimitiveExpression(10),\n\t\t\t\t\t\t\tnew PrimitiveExpression(100),\n\t\t\t\t\t\t\tnew PrimitiveExpression(1000)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitlyTypedArrayCreateExpression2D()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new [,] { { 1, 10 }, { 100, 1000 } }\",\n\t\t\t\tnew ArrayCreateExpression {\n\t\t\t\t\tAdditionalArraySpecifiers = {\n\t\t\t\t\t\tnew ArraySpecifier(2),\n\t\t\t\t\t},\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(1),\n\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(10)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(100),\n\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(1000)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssignmentInArrayInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new [] { a = 10 }\",\n\t\t\t\tnew ArrayCreateExpression {\n\t\t\t\t\tAdditionalArraySpecifiers = {\n\t\t\t\t\t\tnew ArraySpecifier(0)\n\t\t\t\t\t},\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"a\"), new PrimitiveExpression(10))\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EmptyArrayCreation()\n\t\t{\n\t\t\tvar ace = ParseUtilCSharp.ParseExpression<ArrayCreateExpression>(\"new [] { }\");\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.LBrace,\n\t\t\t                \tRoles.RBrace\n\t\t\t                }, ace.Initializer.Children.Select(c => c.Role).ToArray());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ArrayInitializerWithCommaAtEnd()\n\t\t{\n\t\t\tvar ace = ParseUtilCSharp.ParseExpression<ArrayCreateExpression>(\"new [] { 1, }\");\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.LBrace,\n\t\t\t                \tRoles.Expression,\n\t\t\t                \tRoles.Comma,\n\t\t\t                \tRoles.RBrace\n\t\t\t                }, ace.Initializer.Children.Select(c => c.Role).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IncompleteExpressionInArrayCreateExpression()\n\t\t{\n\t\t\t// test that the parser doesn't crash\n\t\t\tParseUtilCSharp.ParseExpression<ArrayCreateExpression>(\"new int[sections.]\", expectErrors: true);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AssignmentExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class AssignmentExpressionTests\n\t{\n\t\tvoid TestAssignmentExpression(string program, AssignmentOperatorType op)\n\t\t{\n\t\t\tAssignmentExpression ae = ParseUtilCSharp.ParseExpression<AssignmentExpression>(program);\n\t\t\t\n\t\t\tAssert.AreEqual(op, ae.Operator);\n\t\t\t\n\t\t\tAssert.IsTrue(ae.Left is IdentifierExpression);\n\t\t\tAssert.IsTrue(ae.Right is IdentifierExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssignTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a = b\", AssignmentOperatorType.Assign);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a += b\", AssignmentOperatorType.Add);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SubtractTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a -= b\", AssignmentOperatorType.Subtract);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultiplyTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a *= b\", AssignmentOperatorType.Multiply);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DivideTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a /= b\", AssignmentOperatorType.Divide);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ModulusTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a %= b\", AssignmentOperatorType.Modulus);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShiftLeftTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a <<= b\", AssignmentOperatorType.ShiftLeft);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShiftRightTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a >>= b\", AssignmentOperatorType.ShiftRight);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitwiseAndTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a &= b\", AssignmentOperatorType.BitwiseAnd);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitwiseOrTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a |= b\", AssignmentOperatorType.BitwiseOr);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExclusiveOrTest()\n\t\t{\n\t\t\tTestAssignmentExpression(\"a ^= b\", AssignmentOperatorType.ExclusiveOr);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedAssignment()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"a = b = c\",\n\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\tnew IdentifierExpression(\"a\"),\n\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"b\"), new IdentifierExpression(\"c\"))));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/BaseReferenceExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class BaseReferenceExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void BaseReferenceExpressionTest1()\n\t\t{\n\t\t\tMemberReferenceExpression fre = ParseUtilCSharp.ParseExpression<MemberReferenceExpression>(\"base.myField\");\n\t\t\tAssert.IsTrue(fre.Target is BaseReferenceExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/BinaryOperatorExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class BinaryOperatorExpressionTests\n\t{\n\t\t#region Precedence Tests\n\t\tvoid OperatorPrecedenceTest(string strongOperator, BinaryOperatorType strongOperatorType,\n\t\t                            string weakOperator, BinaryOperatorType weakOperatorType, bool vb)\n\t\t{\n\t\t\tstring program = \"a \" + weakOperator + \" b \" + strongOperator + \" c\";\n\t\t\tBinaryOperatorExpression boe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(program);\n\t\t\tAssert.AreEqual(weakOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Left is IdentifierExpression);\n\t\t\tboe = (BinaryOperatorExpression)boe.Right;\n\t\t\tAssert.AreEqual(strongOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Left is IdentifierExpression);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t\t\n\t\t\tprogram = \"a \" + strongOperator + \" b \" + weakOperator + \" c\";\n\t\t\t\n\t\t\tboe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(program);\n\t\t\tAssert.AreEqual(weakOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t\tboe = (BinaryOperatorExpression)boe.Left;\n\t\t\tAssert.AreEqual(strongOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Left is IdentifierExpression);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t}\n\t\t\n\t\tvoid SameOperatorPrecedenceTest(string firstOperator, BinaryOperatorType firstOperatorType,\n\t\t                                string secondOperator, BinaryOperatorType secondOperatorType, bool vb)\n\t\t{\n\t\t\tstring program = \"a \" + secondOperator + \" b \" + firstOperator + \" c\";\n\t\t\tBinaryOperatorExpression boe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(program);\n\t\t\tAssert.AreEqual(firstOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t\tboe = (BinaryOperatorExpression)boe.Left;\n\t\t\tAssert.AreEqual(secondOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Left is IdentifierExpression);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t\t\n\t\t\tprogram = \"a \" + firstOperator + \" b \" + secondOperator + \" c\";\n\t\t\tboe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(program);\n\t\t\tAssert.AreEqual(secondOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t\tboe = (BinaryOperatorExpression)boe.Left;\n\t\t\tAssert.AreEqual(firstOperatorType, boe.Operator);\n\t\t\tAssert.IsTrue(boe.Left is IdentifierExpression);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OperatorPrecedenceTest()\n\t\t{\n\t\t\tSameOperatorPrecedenceTest(\"*\", BinaryOperatorType.Multiply, \"/\", BinaryOperatorType.Divide, false);\n\t\t\tSameOperatorPrecedenceTest(\"*\", BinaryOperatorType.Multiply, \"%\", BinaryOperatorType.Modulus, false);\n\t\t\tOperatorPrecedenceTest(\"*\", BinaryOperatorType.Multiply, \"+\", BinaryOperatorType.Add, false);\n\t\t\tSameOperatorPrecedenceTest(\"-\", BinaryOperatorType.Subtract, \"+\", BinaryOperatorType.Add, false);\n\t\t\tOperatorPrecedenceTest(\"+\", BinaryOperatorType.Add, \"<<\", BinaryOperatorType.ShiftLeft, false);\n\t\t\tSameOperatorPrecedenceTest(\">>\", BinaryOperatorType.ShiftRight, \"<<\", BinaryOperatorType.ShiftLeft, false);\n\t\t\tOperatorPrecedenceTest(\"<<\", BinaryOperatorType.ShiftLeft, \"==\", BinaryOperatorType.Equality, false);\n\t\t\tSameOperatorPrecedenceTest(\"!=\", BinaryOperatorType.InEquality, \"==\", BinaryOperatorType.Equality, false);\n\t\t\tOperatorPrecedenceTest(\"==\", BinaryOperatorType.Equality, \"&\", BinaryOperatorType.BitwiseAnd, false);\n\t\t\tOperatorPrecedenceTest(\"&\", BinaryOperatorType.BitwiseAnd, \"^\", BinaryOperatorType.ExclusiveOr, false);\n\t\t\tOperatorPrecedenceTest(\"^\", BinaryOperatorType.ExclusiveOr, \"|\", BinaryOperatorType.BitwiseOr, false);\n\t\t\tOperatorPrecedenceTest(\"|\", BinaryOperatorType.BitwiseOr, \"&&\", BinaryOperatorType.ConditionalAnd, false);\n\t\t\tOperatorPrecedenceTest(\"&&\", BinaryOperatorType.ConditionalAnd, \"||\", BinaryOperatorType.ConditionalOr, false);\n\t\t\tOperatorPrecedenceTest(\"||\", BinaryOperatorType.ConditionalOr, \"??\", BinaryOperatorType.NullCoalescing, false);\n\t\t}\n\t\t#endregion\n\t\t\n\t\tvoid TestBinaryOperatorExpressionTest(string program, BinaryOperatorType op)\n\t\t{\n\t\t\tBinaryOperatorExpression boe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(program);\n\t\t\tAssert.AreEqual(op, boe.Operator);\n\t\t\t\n\t\t\tAssert.IsTrue(boe.Left is IdentifierExpression);\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SubtractionLeftToRight()\n\t\t{\n\t\t\tBinaryOperatorExpression boe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(\"a - b - c\");\n\t\t\tAssert.IsTrue(boe.Right is IdentifierExpression);\n\t\t\tAssert.IsTrue(boe.Left is BinaryOperatorExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullCoalescingRightToLeft()\n\t\t{\n\t\t\tBinaryOperatorExpression boe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(\"a ?? b ?? c\");\n\t\t\tAssert.IsTrue(boe.Left is IdentifierExpression);\n\t\t\tAssert.IsTrue(boe.Right is BinaryOperatorExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitwiseAndTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a & b\", BinaryOperatorType.BitwiseAnd);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitwiseOrTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a | b\", BinaryOperatorType.BitwiseOr);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LogicalAndTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a && b\", BinaryOperatorType.ConditionalAnd);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LogicalOrTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a || b\", BinaryOperatorType.ConditionalOr);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExclusiveOrTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a ^ b\", BinaryOperatorType.ExclusiveOr);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void GreaterThanTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a > b\", BinaryOperatorType.GreaterThan);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GreaterThanOrEqualTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a >= b\", BinaryOperatorType.GreaterThanOrEqual);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EqualityTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a == b\", BinaryOperatorType.Equality);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InEqualityTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a != b\", BinaryOperatorType.InEquality);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LessThanTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a < b\", BinaryOperatorType.LessThan);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LessThanOrEqualTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a <= b\", BinaryOperatorType.LessThanOrEqual);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a + b\", BinaryOperatorType.Add);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SubtractTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a - b\", BinaryOperatorType.Subtract);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultiplyTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a * b\", BinaryOperatorType.Multiply);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DivideTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a / b\", BinaryOperatorType.Divide);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ModulusTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a % b\", BinaryOperatorType.Modulus);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShiftLeftTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a << b\", BinaryOperatorType.ShiftLeft);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShiftRightTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a >> b\", BinaryOperatorType.ShiftRight);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullCoalescingTest()\n\t\t{\n\t\t\tTestBinaryOperatorExpressionTest(\"a ?? b\", BinaryOperatorType.NullCoalescing);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LessThanOrGreaterTest()\n\t\t{\n\t\t\tconst string expr = \"i1 < 0 || i1 > (Count - 1)\";\n\t\t\tBinaryOperatorExpression boe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(expr);\n\t\t\tAssert.AreEqual(BinaryOperatorType.ConditionalOr, boe.Operator);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/CastExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class CastExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(MyObject)o\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new SimpleType(\"MyObject\"),\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(MyType[])o\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new SimpleType(\"MyType\").MakeArrayType(1),\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullablePrimitiveCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(int?)o\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new ComposedType { BaseType = new PrimitiveType(\"int\"), HasNullableSpecifier = true },\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(MyType?)o\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new ComposedType { BaseType = new SimpleType(\"MyType\"), HasNullableSpecifier = true },\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableTryCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"o as int?\",\n\t\t\t\tnew AsExpression {\n\t\t\t\t\tType = new ComposedType { BaseType = new PrimitiveType(\"int\"), HasNullableSpecifier = true },\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(List<string>)o\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new SimpleType(\"List\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericArrayCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(List<string>[])o\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new ComposedType {\n\t\t\t\t\t\tBaseType = new SimpleType(\"List\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\t\tArraySpecifiers = { new ArraySpecifier(1) }\n\t\t\t\t\t},\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericArrayAsCastExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"o as List<string>[]\",\n\t\t\t\tnew AsExpression {\n\t\t\t\t\tType = new ComposedType {\n\t\t\t\t\t\tBaseType = new SimpleType(\"List\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\t\tArraySpecifiers = { new ArraySpecifier(1) }\n\t\t\t\t\t},\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CastMemberReferenceOnParenthesizedExpression()\n\t\t{\n\t\t\t// yes, we really want to evaluate .Member on expr and THEN cast the result to MyType\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(MyType)(expr).Member\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new SimpleType(\"MyType\"),\n\t\t\t\t\tExpression = new ParenthesizedExpression { Expression = new IdentifierExpression(\"expr\") }.Member(\"Member\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TryCastParenthesizedExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(o) as string\",\n\t\t\t\tnew AsExpression {\n\t\t\t\t\tExpression = new ParenthesizedExpression { Expression = new IdentifierExpression(\"o\") },\n\t\t\t\t\tType = new PrimitiveType(\"string\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CastNegation()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(uint)-negativeValue\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new PrimitiveType(\"uint\"),\n\t\t\t\t\tExpression = new UnaryOperatorExpression(\n\t\t\t\t\t\tUnaryOperatorType.Minus,\n\t\t\t\t\t\tnew IdentifierExpression(\"negativeValue\")\n\t\t\t\t\t)});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SubtractionIsNotCast()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(BigInt)-negativeValue\",\n\t\t\t\tnew BinaryOperatorExpression {\n\t\t\t\t\tLeft = new ParenthesizedExpression { Expression = new IdentifierExpression(\"BigInt\") },\n\t\t\t\t\tOperator = BinaryOperatorType.Subtract,\n\t\t\t\t\tRight = new IdentifierExpression(\"negativeValue\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntMaxValueToBigInt()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(BigInt)int.MaxValue\",\n\t\t\t\tnew CastExpression {\n\t\t\t\t\tType = new SimpleType(\"BigInt\"),\n\t\t\t\t\tExpression = new PrimitiveType(\"int\").Member(\"MaxValue\")\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/CheckedExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class CheckedExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void CheckedExpressionTest()\n\t\t{\n\t\t\tCheckedExpression ce = ParseUtilCSharp.ParseExpression<CheckedExpression>(\"checked(a)\");\n\t\t\tAssert.IsTrue(ce.Expression is IdentifierExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UncheckedExpressionTest()\n\t\t{\n\t\t\tUncheckedExpression ce = ParseUtilCSharp.ParseExpression<UncheckedExpression>(\"unchecked(a)\");\n\t\t\tAssert.IsTrue(ce.Expression is IdentifierExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/ConditionalExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class ConditionalExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void ConditionalExpressionTest()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a == b ? a() : a.B\");\n\t\t\t\n\t\t\tAssert.IsTrue(ce.Condition is BinaryOperatorExpression);\n\t\t\tAssert.IsTrue(ce.TrueExpression is InvocationExpression);\n\t\t\tAssert.IsTrue(ce.FalseExpression is MemberReferenceExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalIsExpressionTest()\n\t\t{\n\t\t\t// (as is b?) ERROR (conflict with nullables, SD-419)\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a is b ? a() : a.B\");\n\t\t\t\n\t\t\tAssert.IsTrue(ce.Condition is IsExpression);\n\t\t\tAssert.IsTrue(ce.TrueExpression is InvocationExpression);\n\t\t\tAssert.IsTrue(ce.FalseExpression is MemberReferenceExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalIsWithNullableExpressionTest()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a is b? ? a() : a.B\");\n\t\t\t\n\t\t\tAssert.IsTrue(ce.Condition is IsExpression);\n\t\t\tAssert.IsTrue(ce.TrueExpression is InvocationExpression);\n\t\t\tAssert.IsTrue(ce.FalseExpression is MemberReferenceExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalIsExpressionTest2()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a is b ? (a()) : a.B\");\n\t\t\t\n\t\t\tAssert.IsTrue(ce.Condition is IsExpression);\n\t\t\tAssert.IsTrue(ce.TrueExpression is ParenthesizedExpression);\n\t\t\tAssert.IsTrue(ce.FalseExpression is MemberReferenceExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalExpressionNegativeValue()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"isNegative ? -1 : 1\");\n\t\t\t\n\t\t\tAssert.IsTrue(ce.Condition is IdentifierExpression);\n\t\t\tAssert.IsTrue(ce.TrueExpression is UnaryOperatorExpression);\n\t\t\tAssert.IsTrue(ce.FalseExpression is PrimitiveExpression);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalIsWithNegativeValue()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a is b ? -1 : 1\");\n\t\t\t\n\t\t\tAssert.IsTrue(ce.Condition is IsExpression);\n\t\t\tAssert.IsTrue(ce.TrueExpression is UnaryOperatorExpression);\n\t\t\tAssert.IsTrue(ce.FalseExpression is PrimitiveExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConditionalIsWithExplicitPositiveValue()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a is b ? +1 : 1\");\n\t\t\t\n\t\t\tAssert.IsTrue(ce.Condition is IsExpression);\n\t\t\tAssert.IsTrue(ce.TrueExpression is UnaryOperatorExpression);\n\t\t\tAssert.IsTrue(ce.FalseExpression is PrimitiveExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void RepeatedConditionalExpr()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a ? b : c ? d : e\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"a\", ((IdentifierExpression)ce.Condition).Identifier);\n\t\t\tAssert.AreEqual(\"b\", ((IdentifierExpression)ce.TrueExpression).Identifier);\n\t\t\tAssert.IsTrue(ce.FalseExpression is ConditionalExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedConditionalExpr()\n\t\t{\n\t\t\tConditionalExpression ce = ParseUtilCSharp.ParseExpression<ConditionalExpression>(\"a ? b ? c : d : e\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"a\", ((IdentifierExpression)ce.Condition).Identifier);\n\t\t\tAssert.AreEqual(\"e\", ((IdentifierExpression)ce.FalseExpression).Identifier);\n\t\t\tAssert.IsTrue(ce.TrueExpression is ConditionalExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/DefaultValueExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class DefaultValueExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleDefaultValue()\n\t\t{\n\t\t\tDefaultValueExpression toe = ParseUtilCSharp.ParseExpression<DefaultValueExpression>(\"default(T)\");\n\t\t\tAssert.AreEqual(\"T\", ((SimpleType)toe.Type).Identifier);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FullQualifiedDefaultValue()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"default(global::MyNamespace.N1.MyType)\",\n\t\t\t\tnew DefaultValueExpression {\n\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\t\tTarget = new SimpleType(\"global\"),\n\t\t\t\t\t\t\t\tIsDoubleColon = true,\n\t\t\t\t\t\t\t\tMemberName = \"MyNamespace\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tMemberName = \"N1\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMemberName = \"MyType\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericDefaultValue()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"default(MyNamespace.N1.MyType<string>)\",\n\t\t\t\tnew DefaultValueExpression {\n\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"MyNamespace\"),\n\t\t\t\t\t\t\tMemberName = \"N1\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMemberName = \"MyType\",\n\t\t\t\t\t\tTypeArguments = { new PrimitiveType(\"string\") }\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefaultValueAsIntializer()\n\t\t{\n\t\t\t// This test was problematic (in old NRefactory) because we need a resolver for the \"default:\" / \"default(\" conflict.\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"T a = default(T);\",\n\t\t\t\tnew VariableDeclarationStatement {\n\t\t\t\t\tType = new SimpleType(\"T\"),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer(\"a\", new DefaultValueExpression { Type = new SimpleType(\"T\") })\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefaultValueInReturnStatement()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"return default(T);\",\n\t\t\t\tnew ReturnStatement {\n\t\t\t\t\tExpression = new DefaultValueExpression { Type = new SimpleType(\"T\") }\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/IdentifierExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class IdentifierExpressionTests\n\t{\n\t\tvoid CheckIdentifier(string sourceCode, string identifier)\n\t\t{\n\t\t\tIdentifierExpression ident = ParseUtilCSharp.ParseExpression<IdentifierExpression>(sourceCode);\n\t\t\tAssert.AreEqual(identifier, ident.Identifier);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestIdentifier()\n\t\t{\n\t\t\tCheckIdentifier(\"a_Bc05\", \"a_Bc05\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestIdentifierStartingWithUnderscore()\n\t\t{\n\t\t\tCheckIdentifier(\"_Bc05\", \"_Bc05\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestIdentifierStartingWithEscapeSequence()\n\t\t{\n\t\t\tCheckIdentifier(@\"\\u006cexer\", \"lexer\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestIdentifierContainingEscapeSequence()\n\t\t{\n\t\t\tCheckIdentifier(@\"l\\U00000065xer\", \"lexer\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestKeyWordAsIdentifier()\n\t\t{\n\t\t\tCheckIdentifier(\"@int\", \"int\");\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"Mono parser bug?\")]\n\t\tpublic void TestKeywordWithEscapeSequenceIsIdentifier()\n\t\t{\n\t\t\tCheckIdentifier(@\"i\\u006et\", \"int\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestKeyWordAsIdentifierStartingWithUnderscore()\n\t\t{\n\t\t\tCheckIdentifier(\"@_int\", \"_int\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodReference()\n\t\t{\n\t\t\tIdentifierExpression ident = ParseUtilCSharp.ParseExpression<IdentifierExpression>(\"M<int>\");\n\t\t\tAssert.IsTrue(\n\t\t\t\tnew IdentifierExpression {\n\t\t\t\t\tIdentifier = \"M\" ,\n\t\t\t\t\tTypeArguments = {\n\t\t\t\t\t\tnew PrimitiveType(\"int\")\n\t\t\t\t\t}\n\t\t\t\t}.IsMatch(ident));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodReference2()\n\t\t{\n\t\t\tIdentifierExpression ident = ParseUtilCSharp.ParseExpression<IdentifierExpression>(\"TargetMethod<string>\");\n\t\t\tAssert.IsTrue(\n\t\t\t\tnew IdentifierExpression {\n\t\t\t\t\tIdentifier = \"TargetMethod\" ,\n\t\t\t\t\tTypeArguments = {\n\t\t\t\t\t\tnew PrimitiveType(\"string\")\n\t\t\t\t\t}\n\t\t\t\t}.IsMatch(ident));\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestVerbatimIdentifier()\n\t\t{\n\t\t\tvar tree = SyntaxTree.Parse (\"class @foo {}\");\n\t\t\tvar ident = tree.GetNodeAt<Identifier> (1, 8);\n\t\t\tAssert.IsNotNull (ident);\n\t\t\tAssert.IsTrue (ident.IsVerbatim);\n\t\t\tAssert.AreEqual (new TextLocation (1, 7), ident.StartLocation);\n\t\t\tAssert.AreEqual (new TextLocation (1, 11), ident.EndLocation);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/IndexerExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class IndexerExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void IndexerExpressionTest()\n\t\t{\n\t\t\tIndexerExpression ie = ParseUtilCSharp.ParseExpression<IndexerExpression>(\"field[1, \\\"Hello\\\", 'a']\");\n\t\t\tAssert.IsTrue(ie.Target is IdentifierExpression);\n\t\t\t\n\t\t\tAssert.AreEqual(3, ie.Arguments.Count());\n\t\t\t\n\t\t\tAssert.IsTrue(ie.Arguments.ElementAt(0) is PrimitiveExpression);\n\t\t\tAssert.AreEqual(1, (int)((PrimitiveExpression)ie.Arguments.ElementAt(0)).Value);\n\t\t\tAssert.IsTrue(ie.Arguments.ElementAt(1) is PrimitiveExpression);\n\t\t\tAssert.AreEqual(\"Hello\", (string)((PrimitiveExpression)ie.Arguments.ElementAt(1)).Value);\n\t\t\tAssert.IsTrue(ie.Arguments.ElementAt(2) is PrimitiveExpression);\n\t\t\tAssert.AreEqual('a', (char)((PrimitiveExpression)ie.Arguments.ElementAt(2)).Value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/InvocationExpressionTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class InvocationExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleInvocationExpressionTest()\n\t\t{\n\t\t\tvar ie = ParseUtilCSharp.ParseExpression<InvocationExpression>(\"myMethod()\");\n\t\t\tAssert.AreEqual(0, ie.Arguments.Count());\n\t\t\tAssert.IsTrue(ie.Target is IdentifierExpression);\n\t\t\tAssert.AreEqual(\"myMethod\", ((IdentifierExpression)ie.Target).Identifier);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericInvocationExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"myMethod<char>('a')\",\n\t\t\t\tnew InvocationExpression {\n\t\t\t\t\tTarget = new IdentifierExpression {\n\t\t\t\t\t\tIdentifier = \"myMethod\",\n\t\t\t\t\t\tTypeArguments = { new PrimitiveType(\"char\") }\n\t\t\t\t\t},\n\t\t\t\t\tArguments = { new PrimitiveExpression('a') }\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericInvocation2ExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"myMethod<T,bool>()\",\n\t\t\t\tnew InvocationExpression {\n\t\t\t\t\tTarget = new IdentifierExpression {\n\t\t\t\t\t\tIdentifier = \"myMethod\",\n\t\t\t\t\t\tTypeArguments = {\n\t\t\t\t\t\t\tnew SimpleType(\"T\"),\n\t\t\t\t\t\t\tnew PrimitiveType(\"bool\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AmbiguousGrammarGenericMethodCall()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"F(G<A,B>(7))\",\n\t\t\t\tnew InvocationExpression {\n\t\t\t\t\tTarget = new IdentifierExpression(\"F\"),\n\t\t\t\t\tArguments = {\n\t\t\t\t\t\tnew InvocationExpression {\n\t\t\t\t\t\t\tTarget = new IdentifierExpression {\n\t\t\t\t\t\t\t\tIdentifier = \"G\",\n\t\t\t\t\t\t\t\tTypeArguments = { new SimpleType(\"A\"), new SimpleType(\"B\") }\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tArguments = { new PrimitiveExpression(7) }\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"Mono Parser Bug???\")]\n\t\tpublic void AmbiguousGrammarNotAGenericMethodCall()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"F<A>+y\",\n\t\t\t\tnew BinaryOperatorExpression {\n\t\t\t\t\tLeft = new BinaryOperatorExpression {\n\t\t\t\t\t\tLeft = new IdentifierExpression(\"F\"),\n\t\t\t\t\t\tOperator = BinaryOperatorType.LessThan,\n\t\t\t\t\t\tRight = new IdentifierExpression(\"A\")\n\t\t\t\t\t},\n\t\t\t\t\tOperator = BinaryOperatorType.GreaterThan,\n\t\t\t\t\tRight = new UnaryOperatorExpression {\n\t\t\t\t\t\tOperator = UnaryOperatorType.Plus,\n\t\t\t\t\t\tExpression = new IdentifierExpression(\"y\")\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidNestedInvocationExpressionTest()\n\t\t{\n\t\t\t// this test was written because this bug caused the AbstractASTVisitor to crash\n\t\t\t\n\t\t\tInvocationExpression expr = ParseUtilCSharp.ParseExpression<InvocationExpression>(\"WriteLine(myMethod(,))\", true);\n\t\t\tAssert.IsTrue(expr.Target is IdentifierExpression);\n\t\t\tAssert.AreEqual(\"WriteLine\", ((IdentifierExpression)expr.Target).Identifier);\n\t\t\t\n\t\t\tAssert.AreEqual(1, expr.Arguments.Count); // here a second null parameter was added incorrectly\n\t\t\t\n\t\t\tAssert.IsTrue(expr.Arguments.Single() is InvocationExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedInvocationPositions()\n\t\t{\n\t\t\tInvocationExpression expr = ParseUtilCSharp.ParseExpression<InvocationExpression>(\"a.B().C(args)\");\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), expr.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 14), expr.EndLocation);\n\t\t\tMemberReferenceExpression mre = (MemberReferenceExpression)expr.Target;\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), mre.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 8), mre.EndLocation);\n\t\t\t\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), mre.Target.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 6), mre.Target.EndLocation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvocationOnGenericType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"A<T>.Foo()\",\n\t\t\t\tnew IdentifierExpression {\n\t\t\t\t\tIdentifier = \"A\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"T\") }\n\t\t\t\t}.Invoke(\"Foo\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvocationOnInnerClassInGenericType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"A<T>.B.Foo()\",\n\t\t\t\tnew IdentifierExpression {\n\t\t\t\t\tIdentifier = \"A\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"T\") }\n\t\t\t\t}.Member(\"B\").Invoke(\"Foo\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvocationOnGenericInnerClassInGenericType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"A<T>.B.C<U>.Foo()\",\n\t\t\t\tnew MemberReferenceExpression {\n\t\t\t\t\tTarget = new IdentifierExpression {\n\t\t\t\t\t\tIdentifier = \"A\",\n\t\t\t\t\t\tTypeArguments = { new SimpleType(\"T\") }\n\t\t\t\t\t}.Member(\"B\"),\n\t\t\t\t\tMemberName = \"C\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"U\") }\n\t\t\t\t}.Invoke(\"Foo\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvocationWithNamedArgument()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"a(arg: ref v)\",\n\t\t\t\tnew InvocationExpression {\n\t\t\t\t\tTarget = new IdentifierExpression(\"a\"),\n\t\t\t\t\tArguments = {\n\t\t\t\t\t\tnew NamedArgumentExpression {\n\t\t\t\t\t\t\tName = \"arg\",\n\t\t\t\t\t\t\tExpression = new DirectionExpression {\n\t\t\t\t\t\t\t\tFieldDirection = FieldDirection.Ref,\n\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"v\")\n\t\t\t\t\t\t\t}}}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/IsExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class IsExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void GenericArrayIsExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"o is List<string>[]\",\n\t\t\t\tnew IsExpression {\n\t\t\t\t\tExpression = new IdentifierExpression(\"o\"),\n\t\t\t\t\tType = new SimpleType(\"List\") { TypeArguments = { new PrimitiveType(\"string\") } }.MakeArrayType(1)\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableIsExpression()\n\t\t{\n\t\t\tIsExpression ce = ParseUtilCSharp.ParseExpression<IsExpression>(\"o is int?\");\n\t\t\tComposedType type = (ComposedType)ce.Type;\n\t\t\tAssert.IsTrue(type.HasNullableSpecifier);\n\t\t\tAssert.AreEqual(\"int\", ((PrimitiveType)type.BaseType).Keyword);\n\t\t\tAssert.IsTrue(ce.Expression is IdentifierExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableIsExpressionInBinaryOperatorExpression()\n\t\t{\n\t\t\tBinaryOperatorExpression boe;\n\t\t\tboe = ParseUtilCSharp.ParseExpression<BinaryOperatorExpression>(\"o is int? == true\");\n\t\t\tIsExpression ce = (IsExpression)boe.Left;\n\t\t\tComposedType type = (ComposedType)ce.Type;\n\t\t\tAssert.IsTrue(type.HasNullableSpecifier);\n\t\t\tAssert.AreEqual(\"int\", ((PrimitiveType)type.BaseType).Keyword);\n\t\t\tAssert.IsTrue(ce.Expression is IdentifierExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/LambdaExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class LambdaExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void ImplicitlyTypedExpressionBody()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(x) => x + 1\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"x\" } },\n\t\t\t\t\tBody = new BinaryOperatorExpression(new IdentifierExpression(\"x\"), BinaryOperatorType.Add, new PrimitiveExpression(1))\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitlyTypedExpressionBodyWithoutParenthesis()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"x => x + 1\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"x\" } },\n\t\t\t\t\tBody = new BinaryOperatorExpression(new IdentifierExpression(\"x\"), BinaryOperatorType.Add, new PrimitiveExpression(1))\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitlyTypedStatementBody()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(x) => { return x + 1; }\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"x\" } },\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew ReturnStatement {\n\t\t\t\t\t\t\tExpression = new BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew IdentifierExpression(\"x\"), BinaryOperatorType.Add, new PrimitiveExpression(1))\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitlyTypedStatementBodyWithoutParenthesis()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"x => { return x + 1; }\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"x\" } },\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew ReturnStatement {\n\t\t\t\t\t\t\tExpression = new BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew IdentifierExpression(\"x\"), BinaryOperatorType.Add, new PrimitiveExpression(1))\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitlyTypedStatementBody()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(int x) => { return x + 1; }\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { new ParameterDeclaration { Type = new PrimitiveType(\"int\"), Name = \"x\" } },\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew ReturnStatement {\n\t\t\t\t\t\t\tExpression = new BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew IdentifierExpression(\"x\"), BinaryOperatorType.Add, new PrimitiveExpression(1))\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitlyTypedWithRefParameter()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"(ref int i) => i = 1\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration {\n\t\t\t\t\t\t\tParameterModifier = ParameterModifier.Ref,\n\t\t\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\t\t\tName = \"i\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tBody = new AssignmentExpression(new IdentifierExpression(\"i\"), new PrimitiveExpression(1))\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionContainingConditionalExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"rr => rr != null ? rr.ResolvedType : null\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"rr\" } },\n\t\t\t\t\tBody = new ConditionalExpression {\n\t\t\t\t\t\tCondition = new BinaryOperatorExpression(\n\t\t\t\t\t\t\tnew IdentifierExpression(\"rr\"), BinaryOperatorType.InEquality, new NullReferenceExpression()),\n\t\t\t\t\t\tTrueExpression = new IdentifierExpression(\"rr\").Member(\"ResolvedType\"),\n\t\t\t\t\t\tFalseExpression = new NullReferenceExpression()\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AsyncLambdaExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"async x => x + 1\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tIsAsync = true,\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"x\" } },\n\t\t\t\t\tBody = new BinaryOperatorExpression(new IdentifierExpression(\"x\"), BinaryOperatorType.Add, new PrimitiveExpression(1))\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AsyncLambdaExpressionWithMultipleParameters()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"async (x,y) => x + 1\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tIsAsync = true,\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"x\" }, new ParameterDeclaration { Name = \"y\" } },\n\t\t\t\t\tBody = new BinaryOperatorExpression(new IdentifierExpression(\"x\"), BinaryOperatorType.Add, new PrimitiveExpression(1))\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/MemberReferenceExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class MemberReferenceExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleFieldReferenceExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"myTargetObject.myField\",\n\t\t\t\tnew IdentifierExpression(\"myTargetObject\").Member(\"myField\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShortMaxValueTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"short.MaxValue\",\n\t\t\t\tnew PrimitiveType(\"short\").Member(\"MaxValue\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IdentShortMaxValueTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"@short.MaxValue\",\n\t\t\t\tnew IdentifierExpression(\"short\").Member(\"MaxValue\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericFieldReferenceExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"SomeClass<string>.myField\",\n\t\t\t\tnew IdentifierExpression(\"SomeClass\") { TypeArguments = { new PrimitiveType(\"string\") } }.Member(\"myField\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FullNamespaceGenericFieldReferenceExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"Namespace.Subnamespace.SomeClass<string>.myField\",\n\t\t\t\tnew MemberReferenceExpression {\n\t\t\t\t\tTarget = new IdentifierExpression(\"Namespace\").Member(\"Subnamespace\"),\n\t\t\t\t\tMemberName = \"SomeClass\",\n\t\t\t\t\tTypeArguments = { new PrimitiveType(\"string\") }\n\t\t\t\t}.Member(\"myField\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GlobalFullNamespaceGenericFieldReferenceExpressionTest()\n\t\t{\n\t\t\tvar target = new MemberType {\n\t\t\t\t\t\tTarget = new SimpleType(\"global\"),\n\t\t\t\t\t\tIsDoubleColon = true,\n\t\t\t\t\t\tMemberName = \"Namespace\"\n\t\t\t\t\t}.Member(\"Subnamespace\").Member (\"SomeClass\");\n\t\t\t\n\t\t\ttarget.AddChild (new PrimitiveType(\"string\"), Roles.TypeArgument);\n\t\t\t\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"global::Namespace.Subnamespace.SomeClass<string>.myField\",\n\t\t\t\tnew MemberReferenceExpression {\n\t\t\t\t\tTarget = target,\n\t\t\t\t\tMemberName = \"myField\"\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedGenericFieldReferenceExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"MyType<string>.InnerClass<int>.myField\",\n\t\t\t\tnew MemberReferenceExpression {\n\t\t\t\t\tTarget = new IdentifierExpression(\"MyType\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\tMemberName = \"InnerClass\",\n\t\t\t\t\tTypeArguments = { new PrimitiveType(\"int\") }\n\t\t\t\t}.Member(\"myField\")\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasedNamespace()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"a::b.c\",\n\t\t\t\tnew MemberReferenceExpression {\n\t\t\t\t\tTarget = new TypeReferenceExpression {\n\t\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"a\"),\n\t\t\t\t\t\t\tIsDoubleColon = true,\n\t\t\t\t\t\t\tMemberName = \"b\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tMemberName = \"c\"\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/ObjectCreateExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class ObjectCreateExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void Simple()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new MyObject(1, 2, 3)\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"MyObject\"),\n\t\t\t\t\tArguments = {\n\t\t\t\t\t\tnew PrimitiveExpression(1),\n\t\t\t\t\t\tnew PrimitiveExpression(2),\n\t\t\t\t\t\tnew PrimitiveExpression(3)\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Nullable()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new IntPtr?(1)\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"IntPtr\").MakeNullableType(),\n\t\t\t\t\tArguments = { new PrimitiveExpression(1) }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ObjectInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new Point() { X = 0, Y = 1 }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"Point\"),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew NamedExpression(\"X\", new PrimitiveExpression(0)),\n\t\t\t\t\t\t\tnew NamedExpression(\"Y\", new PrimitiveExpression(1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ObjectInitializerWithoutParenthesis()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new Point { X = 0, Y = 1 }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"Point\"),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew NamedExpression(\"X\", new PrimitiveExpression(0)),\n\t\t\t\t\t\t\tnew NamedExpression(\"Y\", new PrimitiveExpression(1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ObjectInitializerWithTrailingComma()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new Point() { X = 0, Y = 1, }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"Point\"),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew NamedExpression(\"X\", new PrimitiveExpression(0)),\n\t\t\t\t\t\t\tnew NamedExpression(\"Y\", new PrimitiveExpression(1))\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedObjectInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new Rectangle { P1 = new Point { X = 0, Y = 1 }, P2 = new Point { X = 2, Y = 3 } }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"Rectangle\"),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew NamedExpression(\n\t\t\t\t\t\t\t\t\"P1\",\n\t\t\t\t\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\t\t\t\t\tType = new SimpleType(\"Point\"),\n\t\t\t\t\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"X\", new PrimitiveExpression(0)),\n\t\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"Y\", new PrimitiveExpression(1))\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}),\n\t\t\t\t\t\t\tnew NamedExpression(\n\t\t\t\t\t\t\t\t\"P2\",\n\t\t\t\t\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\t\t\t\t\tType = new SimpleType(\"Point\"),\n\t\t\t\t\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"X\", new PrimitiveExpression(2)),\n\t\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"Y\", new PrimitiveExpression(3))\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}})\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedObjectInitializerForPreinitializedProperty()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new Rectangle { P1 = { X = 0, Y = 1 }, P2 = { X = 2, Y = 3 } }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"Rectangle\"),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew NamedExpression(\n\t\t\t\t\t\t\t\t\"P1\",\n\t\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"X\", new PrimitiveExpression(0)),\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"Y\", new PrimitiveExpression(1))\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tnew NamedExpression(\n\t\t\t\t\t\t\t\t\"P2\",\n\t\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"X\", new PrimitiveExpression(2)),\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"Y\", new PrimitiveExpression(3))\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CollectionInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new List<int> { 0, 1, 2 }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"List\", new PrimitiveType(\"int\")),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew ArrayInitializerExpression(new PrimitiveExpression(0)),\n\t\t\t\t\t\t\tnew ArrayInitializerExpression(new PrimitiveExpression(1)),\n\t\t\t\t\t\t\tnew ArrayInitializerExpression(new PrimitiveExpression(2))\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void DictionaryInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"new Dictionary<string, int> { { \\\"a\\\", 0 }, { \\\"b\\\", 1 } }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"Dictionary\", new PrimitiveType(\"string\"), new PrimitiveType(\"int\")),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = { new PrimitiveExpression(\"a\"), new PrimitiveExpression(0) }\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = { new PrimitiveExpression(\"b\"), new PrimitiveExpression(1) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComplexCollectionInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t@\"new List<Contact> {\n\t\t\t\t\tnew Contact {\n\t\t\t\t\t\tName = \"\"Chris\"\",\n\t\t\t\t\t\tPhoneNumbers = { \"\"206-555-0101\"\" }\n\t\t\t\t\t},\n\t\t\t\t\tnew Contact(additionalParameter) {\n\t\t\t\t\t\tName = \"\"Bob\"\",\n\t\t\t\t\t\tPhoneNumbers = { \"\"650-555-0199\"\", \"\"425-882-8080\"\" }\n\t\t\t\t\t}\n\t\t\t\t}\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"List\", new SimpleType(\"Contact\")),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression(\n\t\t\t\t\t\tnew ArrayInitializerExpression(\n\t\t\t\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\t\t\t\tType = new SimpleType(\"Contact\"),\n\t\t\t\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"Name\", new PrimitiveExpression(\"Chris\")),\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"PhoneNumbers\", new ArrayInitializerExpression () {\n\t\t\t\t\t\t\t\t\t\t\tElements = { new ArrayInitializerExpression(new PrimitiveExpression(\"206-555-0101\")) }\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t}}}),\n\t\t\t\t\t\tnew ArrayInitializerExpression(\n\t\t\t\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\t\t\t\tType = new SimpleType(\"Contact\"),\n\t\t\t\t\t\t\t\tArguments = { new IdentifierExpression(\"additionalParameter\") },\n\t\t\t\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"Name\", new PrimitiveExpression(\"Bob\")),\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"PhoneNumbers\", new ArrayInitializerExpression () {\n\t\t\t\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\t\t\t\tnew ArrayInitializerExpression(new PrimitiveExpression(\"650-555-0199\")),\n\t\t\t\t\t\t\t\t\t\t\t\tnew ArrayInitializerExpression(new PrimitiveExpression(\"425-882-8080\"))\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t}}})\n\t\t\t\t\t\t)});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssignmentInCollectionInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t@\"new List<int> { { a = 1 } }\",\n\t\t\t\tnew ObjectCreateExpression {\n\t\t\t\t\tType = new SimpleType(\"List\", new PrimitiveType(\"int\")),\n\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\tnew ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\tnew AssignmentExpression(new IdentifierExpression(\"a\"), new PrimitiveExpression(1))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/ParenthesizedExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class ParenthesizedExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void PrimitiveParenthesizedExpression()\n\t\t{\n\t\t\tParenthesizedExpression p = ParseUtilCSharp.ParseExpression<ParenthesizedExpression>(\"((1))\");\n\t\t\tAssert.IsTrue(p.Expression is ParenthesizedExpression);\n\t\t\tp = (ParenthesizedExpression)p.Expression;\n\t\t\tAssert.IsTrue(p.Expression is PrimitiveExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/PointerReferenceExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class PointerReferenceExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void PointerReferenceExpressionTest()\n\t\t{\n\t\t\tPointerReferenceExpression pre = ParseUtilCSharp.ParseExpression<PointerReferenceExpression>(\"myObj.field->b\");\n\t\t\tAssert.IsTrue(pre.Target is MemberReferenceExpression);\n\t\t\tAssert.AreEqual(\"b\", pre.MemberName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PointerReferenceGenericMethodTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"ptr->M<string>();\",\n\t\t\t\tnew InvocationExpression {\n\t\t\t\t\tTarget = new PointerReferenceExpression {\n\t\t\t\t\t\tTarget = new IdentifierExpression(\"ptr\"),\n\t\t\t\t\t\tMemberName = \"M\",\n\t\t\t\t\t\tTypeArguments = { new PrimitiveType(\"string\") }\n\t\t\t\t\t}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/PrimitiveExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Text;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class PrimitiveExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void HexIntegerTest1()\n\t\t{\n\t\t\tInvocationExpression invExpr = ParseUtilCSharp.ParseExpression<InvocationExpression>(\"0xAFFE.ToString()\");\n\t\t\tAssert.AreEqual(0, invExpr.Arguments.Count());\n\t\t\tAssert.IsTrue(invExpr.Target is MemberReferenceExpression);\n\t\t\tMemberReferenceExpression fre = invExpr.Target as MemberReferenceExpression;\n\t\t\tAssert.AreEqual(\"ToString\", fre.MemberName);\n\t\t\t\n\t\t\tAssert.IsTrue(fre.Target is PrimitiveExpression);\n\t\t\tPrimitiveExpression pe = fre.Target as PrimitiveExpression;\n\t\t\t\n\t\t\tAssert.AreEqual(0xAFFE, (int)pe.Value);\n\t\t\t\n\t\t}\n\t\t\n\t\tvoid CheckLiteral(string code, object value)\n\t\t{\n\t\t\tPrimitiveExpression pe = ParseUtilCSharp.ParseExpression<PrimitiveExpression>(code);\n\t\t\tAssert.AreEqual(value.GetType(), pe.Value.GetType());\n\t\t\tAssert.AreEqual(value, pe.Value);\n\t\t\tAssert.AreEqual(code, pe.LiteralValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoubleWithLeadingDot()\n\t\t{\n\t\t\tCheckLiteral(\".5e-06\", .5e-06);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FloatWithLeadingDot()\n\t\t{\n\t\t\tCheckLiteral(\".5e-06f\", .5e-06f);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CharTest1()\n\t\t{\n\t\t\tCheckLiteral(\"'\\\\u0356'\", '\\u0356');\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntMinValueTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"-2147483648\",\n\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.Minus, new PrimitiveExpression(2147483648)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntMaxValueTest()\n\t\t{\n\t\t\tCheckLiteral(\"2147483647\", 2147483647); // int\n\t\t\tCheckLiteral(\"2147483648\", 2147483648); // uint\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LongMinValueTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"-9223372036854775808\",\n\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.Minus, new PrimitiveExpression(9223372036854775808)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LongMaxValueTest()\n\t\t{\n\t\t\tCheckLiteral(\"9223372036854775807\", 9223372036854775807); // long\n\t\t\tCheckLiteral(\"9223372036854775808\", 9223372036854775808); // ulong\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StringTest1()\n\t\t{\n\t\t\tCheckLiteral(\"\\\"\\\\n\\\\t\\\\u0005 Hello World !!!\\\"\", \"\\n\\t\\u0005 Hello World !!!\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestSingleDigit()\n\t\t{\n\t\t\tCheckLiteral(\"5\", 5);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestZero()\n\t\t{\n\t\t\tCheckLiteral(\"0\", 0);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInteger()\n\t\t{\n\t\t\tCheckLiteral(\"66\", 66);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestNonOctalInteger()\n\t\t{\n\t\t\t// C# does not have octal integers, so 077 should parse to 77\n\t\t\tAssert.IsTrue(077 == 77);\n\t\t\t\n\t\t\tCheckLiteral(\"077\", 077);\n\t\t\tCheckLiteral(\"056\", 056);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestHexadecimalInteger()\n\t\t{\n\t\t\tCheckLiteral(\"0x99F\", 0x99F);\n\t\t\tCheckLiteral(\"0xAB1f\", 0xAB1f);\n\t\t\tCheckLiteral(\"0xffffffff\", 0xffffffff);\n\t\t\tCheckLiteral(\"0xffffffffL\", 0xffffffffL);\n\t\t\tCheckLiteral(\"0xffffffffuL\", 0xffffffffuL);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidHexadecimalInteger()\n\t\t{\n\t\t\t// don't check result, just make sure there is no exception\n\t\t\tParseUtilCSharp.ParseExpression<ICSharpCode.NRefactory.CSharp.Expression>(\"0x2GF\", expectErrors: true);\n\t\t\tParseUtilCSharp.ParseExpression<ICSharpCode.NRefactory.CSharp.Expression>(\"0xG2F\", expectErrors: true);\n\t\t\tParseUtilCSharp.ParseExpression<ICSharpCode.NRefactory.CSharp.Expression>(\"0x\", expectErrors: true); // SD-457\n\t\t\t// hexadecimal integer >ulong.MaxValue\n\t\t\tParseUtilCSharp.ParseExpression<PrimitiveExpression>(\"0xfedcba98765432100\", expectErrors: true);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLongHexadecimalInteger()\n\t\t{\n\t\t\tCheckLiteral(\"0x4244636f446c6d58\", 0x4244636f446c6d58);\n\t\t\tCheckLiteral(\"0xf244636f446c6d58\", 0xf244636f446c6d58);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLongInteger()\n\t\t{\n\t\t\tCheckLiteral(\"9223372036854775807\", 9223372036854775807); // long.MaxValue\n\t\t\tCheckLiteral(\"9223372036854775808\", 9223372036854775808); // long.MaxValue+1\n\t\t\tCheckLiteral(\"18446744073709551615\", 18446744073709551615); // ulong.MaxValue\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestTooLongInteger()\n\t\t{\n\t\t\t// ulong.MaxValue+1\n\t\t\tParseUtilCSharp.ParseExpression<PrimitiveExpression>(\"18446744073709551616\", expectErrors: true);\n\t\t\t\n\t\t\tCheckLiteral(\"18446744073709551616f\", 18446744073709551616f); // ulong.MaxValue+1 as float\n\t\t\tCheckLiteral(\"18446744073709551616d\", 18446744073709551616d); // ulong.MaxValue+1 as double\n\t\t\tCheckLiteral(\"18446744073709551616m\", 18446744073709551616m); // ulong.MaxValue+1 as decimal\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestDouble()\n\t\t{\n\t\t\tCheckLiteral(\"1.0\", 1.0);\n\t\t\tCheckLiteral(\"1.1\", 1.1);\n\t\t\tCheckLiteral(\"1.1e-2\", 1.1e-2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestFloat()\n\t\t{\n\t\t\tCheckLiteral(\"1f\", 1f);\n\t\t\tCheckLiteral(\"1.0f\", 1.0f);\n\t\t\tCheckLiteral(\"1.1f\", 1.1f);\n\t\t\tCheckLiteral(\"1.1e-2f\", 1.1e-2f);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestDecimal()\n\t\t{\n\t\t\tCheckLiteral(\"1m\", 1m);\n\t\t\tCheckLiteral(\"1.0m\", 1.0m);\n\t\t\tCheckLiteral(\"1.1m\", 1.1m);\n\t\t\tCheckLiteral(\"1.1e-2m\", 1.1e-2m);\n\t\t\tCheckLiteral(\"2.0e-5m\", 2.0e-5m);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestString()\n\t\t{\n\t\t\tCheckLiteral(@\"@\"\"-->\"\"\"\"<--\"\"\", @\"-->\"\"<--\");\n\t\t\tCheckLiteral(@\"\"\"-->\\\"\"<--\"\"\", \"-->\\\"<--\");\n\t\t\t\n\t\t\tCheckLiteral(@\"\"\"\\U00000041\"\"\", \"\\U00000041\");\n\t\t\tCheckLiteral(@\"\"\"\\U00010041\"\"\", \"\\U00010041\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestCharLiteral()\n\t\t{\n\t\t\tCheckLiteral(@\"'a'\", 'a');\n\t\t\tCheckLiteral(@\"'\\u0041'\", '\\u0041');\n\t\t\tCheckLiteral(@\"'\\x41'\", '\\x41');\n\t\t\tCheckLiteral(@\"'\\x041'\", '\\x041');\n\t\t\tCheckLiteral(@\"'\\x0041'\", '\\x0041');\n\t\t\tCheckLiteral(@\"'\\U00000041'\", '\\U00000041');\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestPositionOfIntegerAtEndOfLine()\n\t\t{\n\t\t\tvar pe = ParseUtilCSharp.ParseExpression<PrimitiveExpression>(\"0\\r\\n\");\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), pe.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 2), pe.EndLocation);\n\t\t\tAssert.AreEqual(\"0\", pe.LiteralValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidUnicodeEscapeSequence()\n\t\t{\n\t\t\tstring code = @\"\"\"\\u{0}\"\"\";\n\t\t\tvar pe = ParseUtilCSharp.ParseExpression<PrimitiveExpression>(code, expectErrors: true);\n\t\t\tAssert.AreEqual(code, pe.LiteralValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void LargeVerbatimString()\n\t\t{\n\t\t\tStringBuilder b = new StringBuilder();\n\t\t\tfor (int i = 0; i < 10000; i++) {\n\t\t\t\tb.Append(i.ToString());\n\t\t\t\tb.Append(\"\\r\\n\");\n\t\t\t}\n\t\t\tstring literal = b.ToString();\n\t\t\tvar pe = ParseUtilCSharp.ParseExpression<PrimitiveExpression>(\"@\\\"\" + literal + \"\\\"\");\n\t\t\tAssert.AreEqual(literal, pe.Value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/QueryExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class QueryExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from c in customers where c.City == \\\"London\\\" select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryWhereClause {\n\t\t\t\t\t\t\tCondition = new BinaryOperatorExpression {\n\t\t\t\t\t\t\t\tLeft = new IdentifierExpression(\"c\").Member(\"City\"),\n\t\t\t\t\t\t\t\tOperator = BinaryOperatorType.Equality,\n\t\t\t\t\t\t\t\tRight = new PrimitiveExpression(\"London\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExpressionWithType1()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from Customer c in customers select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tType = new SimpleType(\"Customer\"),\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExpressionWithType2()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from int c in customers select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void ExpressionWithType3()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from S<int[]>? c in customers select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tType = new ComposedType {\n\t\t\t\t\t\t\t\tBaseType = new SimpleType {\n\t\t\t\t\t\t\t\t\tIdentifier = \"S\",\n\t\t\t\t\t\t\t\t\tTypeArguments = {\n\t\t\t\t\t\t\t\t\t\tnew PrimitiveType(\"int\").MakeArrayType()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tHasNullableSpecifier = true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleGenerators()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t@\"\nfrom c in customers\nwhere c.City == \"\"London\"\"\nfrom o in c.Orders\nwhere o.OrderDate.Year == 2005\nselect new { c.Name, o.OrderID, o.Total }\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryWhereClause {\n\t\t\t\t\t\t\tCondition = new BinaryOperatorExpression {\n\t\t\t\t\t\t\t\tLeft = new IdentifierExpression(\"c\").Member(\"City\"),\n\t\t\t\t\t\t\t\tOperator = BinaryOperatorType.Equality,\n\t\t\t\t\t\t\t\tRight = new PrimitiveExpression(\"London\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"o\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Orders\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryWhereClause {\n\t\t\t\t\t\t\tCondition = new BinaryOperatorExpression {\n\t\t\t\t\t\t\t\tLeft = new IdentifierExpression(\"o\").Member(\"OrderDate\").Member(\"Year\"),\n\t\t\t\t\t\t\t\tOperator = BinaryOperatorType.Equality,\n\t\t\t\t\t\t\t\tRight = new PrimitiveExpression(2005)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new AnonymousTypeCreateExpression {\n\t\t\t\t\t\t\t\tInitializers = {\n\t\t\t\t\t\t\t\t\tnew IdentifierExpression(\"c\").Member(\"Name\"),\n\t\t\t\t\t\t\t\t\tnew IdentifierExpression(\"o\").Member(\"OrderID\"),\n\t\t\t\t\t\t\t\t\tnew IdentifierExpression(\"o\").Member(\"Total\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExpressionWithOrderBy()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from c in customers orderby c.Name select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Name\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExpressionWithOrderByWithTwoOrderings()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from c in customers orderby c.Name, c.Address select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Name\")\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Address\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExpressionWithOrderByWithTwoOrderBys()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from c in customers orderby c.Name orderby c.Address select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Name\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Address\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExpressionWithOrderByWithTwoOrderingsDescending()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from c in customers orderby c.Name descending, c.Address descending select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Name\"),\n\t\t\t\t\t\t\t\t\tDirection = QueryOrderingDirection.Descending\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Address\"),\n\t\t\t\t\t\t\t\t\tDirection = QueryOrderingDirection.Descending\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExpressionWithOrderByWithTwoOrderByDecendings()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from c in customers orderby c.Name descending orderby c.Address descending select c\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Name\"),\n\t\t\t\t\t\t\t\t\tDirection = QueryOrderingDirection.Descending\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Address\"),\n\t\t\t\t\t\t\t\t\tDirection = QueryOrderingDirection.Descending\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void LocationOfWhere()\n\t\t{\n\t\t\tvar expr = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from c in customers where c.City == \\\"London\\\" select c\");\n\t\t\tvar where = expr.Clauses.ElementAt(1);\n\t\t\tAssert.That(where.StartLocation, Is.EqualTo(new TextLocation(1, 21)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void LocationOfOrderBy()\n\t\t{\n\t\t\tvar expr = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from c in customers orderby c.City select c\");\n\t\t\tvar where = expr.Clauses.ElementAt(1);\n\t\t\tAssert.That(where.StartLocation, Is.EqualTo(new TextLocation(1, 21)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExpressionWithOrderByAndLet()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from c in customers orderby c.Name descending let x = c select x\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"customers\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryOrderClause {\n\t\t\t\t\t\t\tOrderings = {\n\t\t\t\t\t\t\t\tnew QueryOrdering {\n\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\").Member(\"Name\"),\n\t\t\t\t\t\t\t\t\tDirection = QueryOrderingDirection.Descending\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryLetClause {\n\t\t\t\t\t\t\tIdentifier = \"x\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"c\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"x\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QueryContinuation()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from a in b select c into d select e\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryContinuationClause {\n\t\t\t\t\t\t\tPrecedingQuery = new QueryExpression {\n\t\t\t\t\t\t\t\tClauses = {\n\t\t\t\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnew QuerySelectClause { Expression = new IdentifierExpression(\"c\") }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tIdentifier = \"d\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause { Expression = new IdentifierExpression(\"e\") }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void QueryContinuationWithMultipleFrom()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from a in b from c in d select e into f select g\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryContinuationClause {\n\t\t\t\t\t\t\tPrecedingQuery = new QueryExpression {\n\t\t\t\t\t\t\t\tClauses = {\n\t\t\t\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\t\t\t\tIdentifier = \"c\",\n\t\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"d\")\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnew QuerySelectClause { Expression = new IdentifierExpression(\"e\") }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tIdentifier = \"f\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause { Expression = new IdentifierExpression(\"g\") }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleQueryContinuation()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from a in b select c into d select e into f select g\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryContinuationClause {\n\t\t\t\t\t\t\tPrecedingQuery = new QueryExpression {\n\t\t\t\t\t\t\t\tClauses = {\n\t\t\t\t\t\t\t\t\tnew QueryContinuationClause {\n\t\t\t\t\t\t\t\t\t\tPrecedingQuery = new QueryExpression {\n\t\t\t\t\t\t\t\t\t\t\tClauses = {\n\t\t\t\t\t\t\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\t\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\tnew QuerySelectClause { Expression = new IdentifierExpression(\"c\") }\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tIdentifier = \"d\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnew QuerySelectClause { Expression = new IdentifierExpression(\"e\") }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tIdentifier = \"f\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause { Expression = new IdentifierExpression(\"g\") }\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QueryWithGroupBy()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from a in b group c by d\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryGroupClause {\n\t\t\t\t\t\t\tProjection = new IdentifierExpression(\"c\"),\n\t\t\t\t\t\t\tKey = new IdentifierExpression(\"d\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QueryWithJoin()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from a in b join c in d on e equals f select g\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryJoinClause {\n\t\t\t\t\t\t\tJoinIdentifier = \"c\",\n\t\t\t\t\t\t\tInExpression = new IdentifierExpression(\"d\"),\n\t\t\t\t\t\t\tOnExpression = new IdentifierExpression(\"e\"),\n\t\t\t\t\t\t\tEqualsExpression = new IdentifierExpression(\"f\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"g\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QueryWithGroupJoin()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from a in b join c in d on e equals f into g select h\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"a\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"b\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryJoinClause {\n\t\t\t\t\t\t\tJoinIdentifier = \"c\",\n\t\t\t\t\t\t\tInExpression = new IdentifierExpression(\"d\"),\n\t\t\t\t\t\t\tOnExpression = new IdentifierExpression(\"e\"),\n\t\t\t\t\t\t\tEqualsExpression = new IdentifierExpression(\"f\"),\n\t\t\t\t\t\t\tIntoIdentifier = \"g\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"h\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void fSelect()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"from arg in args where float.Parse(arg) == 1.0fselect arg\",\n\t\t\t\tnew QueryExpression {\n\t\t\t\t\tClauses = {\n\t\t\t\t\t\tnew QueryFromClause {\n\t\t\t\t\t\t\tIdentifier = \"arg\",\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"args\")\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QueryWhereClause {\n\t\t\t\t\t\t\tCondition = new BinaryOperatorExpression(\n\t\t\t\t\t\t\t\tnew PrimitiveType(\"float\").Invoke(\"Parse\", new IdentifierExpression(\"arg\")),\n\t\t\t\t\t\t\t\tBinaryOperatorType.Equality,\n\t\t\t\t\t\t\t\tnew PrimitiveExpression(1.0f)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew QuerySelectClause {\n\t\t\t\t\t\t\tExpression = new IdentifierExpression(\"arg\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/SizeOfExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class SizeOfExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void SizeOfExpressionTest()\n\t\t{\n\t\t\tSizeOfExpression soe = ParseUtilCSharp.ParseExpression<SizeOfExpression>(\"sizeof(MyType)\");\n\t\t\tAssert.AreEqual(\"MyType\", ((SimpleType)soe.Type).Identifier);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/StackAllocExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class StackAllocExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void StackAllocExpressionTest()\n\t\t{\n\t\t\tvar vd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"int* a = stackalloc int[100];\");\n\t\t\tStackAllocExpression sae = (StackAllocExpression)vd.Variables.Single().Initializer;\n\t\t\tAssert.AreEqual(\"int\", ((PrimitiveType)sae.Type).Keyword);\n\t\t\tAssert.AreEqual(100, ((PrimitiveExpression)sae.CountExpression).Value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/ThisReferenceExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class ThisReferenceExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void TestMethod()\n\t\t{\n\t\t\tParseUtilCSharp.ParseExpression<ThisReferenceExpression>(\"this\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/TypeOfExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class TypeOfExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleTypeOfExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(MyNamespace.N1.MyType)\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"MyNamespace\"),\n\t\t\t\t\t\t\tMemberName = \"N1\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMemberName = \"MyType\"\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GlobalTypeOfExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(global::System.Console)\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"global\"),\n\t\t\t\t\t\t\tIsDoubleColon = true,\n\t\t\t\t\t\t\tMemberName = \"System\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMemberName = \"Console\"\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PrimitiveTypeOfExpressionTest()\n\t\t{\n\t\t\tTypeOfExpression toe = ParseUtilCSharp.ParseExpression<TypeOfExpression>(\"typeof(int)\");\n\t\t\tAssert.AreEqual(\"int\", ((PrimitiveType)toe.Type).Keyword);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidTypeOfExpressionTest()\n\t\t{\n\t\t\tTypeOfExpression toe = ParseUtilCSharp.ParseExpression<TypeOfExpression>(\"typeof(void)\");\n\t\t\tAssert.AreEqual(\"void\", ((PrimitiveType)toe.Type).Keyword);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayTypeOfExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(MyType[])\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = new SimpleType(\"MyType\").MakeArrayType()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericTypeOfExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(MyNamespace.N1.MyType<string>)\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"MyNamespace\"),\n\t\t\t\t\t\t\tMemberName = \"N1\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMemberName = \"MyType\",\n\t\t\t\t\t\tTypeArguments = { new PrimitiveType(\"string\") }\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedGenericTypeOfExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(MyType<string>.InnerClass<int>.InnerInnerClass)\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"MyType\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\t\t\tMemberName = \"InnerClass\",\n\t\t\t\t\t\t\tTypeArguments = { new PrimitiveType(\"int\") }\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMemberName = \"InnerInnerClass\"\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableTypeOfExpressionTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(MyStruct?)\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = new ComposedType {\n\t\t\t\t\t\tBaseType = new SimpleType(\"MyStruct\"),\n\t\t\t\t\t\tHasNullableSpecifier = true\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnboundTypeOfExpressionTest()\n\t\t{\n\t\t\tvar type = new SimpleType(\"MyType\");\n\t\t\ttype.AddChild (new SimpleType (), Roles.TypeArgument);\n\t\t\ttype.AddChild (new SimpleType (), Roles.TypeArgument);\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(MyType<,>)\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = type\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedArraysTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"typeof(int[,][])\",\n\t\t\t\tnew TypeOfExpression {\n\t\t\t\t\tType = new ComposedType {\n\t\t\t\t\t\tBaseType = new PrimitiveType(\"int\"),\n\t\t\t\t\t\tArraySpecifiers = {\n\t\t\t\t\t\t\tnew ArraySpecifier(2),\n\t\t\t\t\t\t\tnew ArraySpecifier(1)\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/TypeReferenceExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class TypeReferenceExpressionTests\n\t{\n\t\t[Test]\n\t\tpublic void GlobalTypeReferenceExpression()\n\t\t{\n\t\t\tTypeReferenceExpression tr = ParseUtilCSharp.ParseExpression<TypeReferenceExpression>(\"global::System\");\n\t\t\tAssert.IsTrue (tr.IsMatch (new TypeReferenceExpression () {\n\t\t\t\tType = new MemberType () {\n\t\t\t\t\tTarget = new SimpleType (\"global\"),\n\t\t\t\t\tIsDoubleColon = true,\n\t\t\t\t\tMemberName = \"System\"\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntReferenceExpression()\n\t\t{\n\t\t\tMemberReferenceExpression fre = ParseUtilCSharp.ParseExpression<MemberReferenceExpression>(\"int.MaxValue\");\n\t\t\tAssert.IsTrue (fre.IsMatch (new MemberReferenceExpression () {\n\t\t\t\tTarget = new TypeReferenceExpression () {\n\t\t\t\t\tType = new PrimitiveType(\"int\")\n\t\t\t\t},\n\t\t\t\tMemberName = \"MaxValue\"\n\t\t\t}));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Bool_TrueString()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\"bool.TrueString\", new PrimitiveType(\"bool\").Member(\"TrueString\"));\n\t\t}\n\t\t\n\t/*\t[Test]\n\t\tpublic void StandaloneIntReferenceExpression()\n\t\t{\n\t\t// doesn't work because a = int; gives a compiler error.\n\t\t// But how do we handle this case for code completion?\n\t\t\tTypeReferenceExpression tre = ParseUtilCSharp.ParseExpression<TypeReferenceExpression>(\"int\");\n\t\t\tAssert.IsNotNull (tre.Match (new TypeReferenceExpression () {\n\t\t\t\tType = new SimpleType (\"int\")\n\t\t\t}));\n\t\t}*/\n\t\t\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/UnaryOperatorExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class UnaryOperatorExpressionTests\n\t{\n\t\tvoid TestUnaryOperatorExpressionTest(string program, UnaryOperatorType op)\n\t\t{\n\t\t\tUnaryOperatorExpression uoe = ParseUtilCSharp.ParseExpression<UnaryOperatorExpression>(program);\n\t\t\tAssert.AreEqual(op, uoe.Operator);\n\t\t\t\n\t\t\tAssert.IsTrue(uoe.Expression is IdentifierExpression);\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), uoe.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, program.Length + 1), uoe.EndLocation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NotTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"!a\", UnaryOperatorType.Not);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitNotTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"~a\", UnaryOperatorType.BitNot);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MinusTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"-a\", UnaryOperatorType.Minus);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PlusTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"+a\", UnaryOperatorType.Plus);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IncrementTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"++a\", UnaryOperatorType.Increment);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DecrementTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"--a\", UnaryOperatorType.Decrement);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PostIncrementTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"a++\", UnaryOperatorType.PostIncrement);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PostDecrementTest()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"a--\", UnaryOperatorType.PostDecrement);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Dereference()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"*a\", UnaryOperatorType.Dereference);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddressOf()\n\t\t{\n\t\t\tTestUnaryOperatorExpressionTest(\"&a\", UnaryOperatorType.AddressOf);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Await()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"async a => await a\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tIsAsync = true,\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"a\" } },\n\t\t\t\t\tBody = new UnaryOperatorExpression(UnaryOperatorType.Await, new IdentifierExpression(\"a\"))\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AwaitAwait()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"async a => await await a\",\n\t\t\t\tnew LambdaExpression {\n\t\t\t\t\tIsAsync = true,\n\t\t\t\t\tParameters = { new ParameterDeclaration { Name = \"a\" } },\n\t\t\t\t\tBody = new UnaryOperatorExpression(\n\t\t\t\t\t\tUnaryOperatorType.Await,\n\t\t\t\t\t\tnew UnaryOperatorExpression(UnaryOperatorType.Await, new IdentifierExpression(\"a\")))\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DereferenceAfterCast()\n\t\t{\n\t\t\tUnaryOperatorExpression uoe = ParseUtilCSharp.ParseExpression<UnaryOperatorExpression>(\"*((SomeType*) &w)\");\n\t\t\tAssert.AreEqual(UnaryOperatorType.Dereference, uoe.Operator);\n\t\t\tParenthesizedExpression pe = (ParenthesizedExpression)uoe.Expression;\n\t\t\tCastExpression ce = (CastExpression)pe.Expression;\n\t\t\tComposedType type = (ComposedType)ce.Type;\n\t\t\tAssert.AreEqual(\"SomeType\", ((SimpleType)type.BaseType).Identifier);\n\t\t\tAssert.AreEqual(1, type.PointerRank);\n\t\t\t\n\t\t\tUnaryOperatorExpression adrOf = (UnaryOperatorExpression)ce.Expression;\n\t\t\tAssert.AreEqual(UnaryOperatorType.AddressOf, adrOf.Operator);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AwaitStaticMethodCall()\n\t\t{\n\t\t\tvar uoe = ParseUtilCSharp.ParseExpression<UnaryOperatorExpression>(\"await Task.WhenAll(a, b)\");\n\t\t\tAssert.AreEqual(UnaryOperatorType.Await, uoe.Operator);\n\t\t\tAssert.IsInstanceOf<InvocationExpression>(uoe.Expression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AwaitStaticMethodCallStatement()\n\t\t{\n\t\t\tvar es = ParseUtilCSharp.ParseStatement<ExpressionStatement>(\"await Task.WhenAll(a, b);\");\n\t\t\tUnaryOperatorExpression uoe = (UnaryOperatorExpression)es.Expression;\n\t\t\tAssert.AreEqual(UnaryOperatorType.Await, uoe.Operator);\n\t\t\tAssert.IsInstanceOf<InvocationExpression>(uoe.Expression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/UndocumentedExpressionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Expression\n{\n\t[TestFixture]\n\tpublic class UndocumentedExpressionTests\n\t{\n\t\t[Test, Ignore(\"Name on ParameterDeclaration is missing\")]\n\t\tpublic void ArglistAccess()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t@\"public static int GetArgCount(__arglist)\n\t\t\t\t{\n\t\t\t\t\tArgIterator argIterator = new ArgIterator(__arglist);\n\t\t\t\t\treturn argIterator.GetRemainingCount();\n\t\t\t\t}\",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Public | Modifiers.Static,\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tName = \"GetArgCount\",\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration(AstType.Null, \"__arglist\")\n\t\t\t\t\t},\n\t\t\t\t\tBody = new BlockStatement {\n\t\t\t\t\t\tnew VariableDeclarationStatement(\n\t\t\t\t\t\t\tnew SimpleType(\"ArgIterator\"),\n\t\t\t\t\t\t\t\"argIterator\",\n\t\t\t\t\t\t\tnew ObjectCreateExpression(\n\t\t\t\t\t\t\t\tnew SimpleType(\"ArgIterator\"),\n\t\t\t\t\t\t\t\tnew UndocumentedExpression {\n\t\t\t\t\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.ArgListAccess\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew ReturnStatement(new IdentifierExpression(\"argIterator\").Invoke(\"GetRemainingCount\"))\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArglistCall()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"GetArgCount(__arglist(a, b, c))\",\n\t\t\t\tnew IdentifierExpression(\"GetArgCount\").Invoke(\n\t\t\t\t\tnew UndocumentedExpression {\n\t\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.ArgList,\n\t\t\t\t\t\tArguments = {\n\t\t\t\t\t\t\tnew IdentifierExpression(\"a\"),\n\t\t\t\t\t\t\tnew IdentifierExpression(\"b\"),\n\t\t\t\t\t\t\tnew IdentifierExpression(\"c\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MakeTypedRef()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"TypedReference tr = __makeref(o);\",\n\t\t\t\tnew VariableDeclarationStatement(\n\t\t\t\t\tnew SimpleType(\"TypedReference\"),\n\t\t\t\t\t\"tr\",\n\t\t\t\t\tnew UndocumentedExpression {\n\t\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.MakeRef,\n\t\t\t\t\t\tArguments = { new IdentifierExpression(\"o\") }\n\t\t\t\t\t}));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void RefType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"t = __reftype(tr)\",\n\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\tnew IdentifierExpression(\"t\"),\n\t\t\t\t\tnew UndocumentedExpression {\n\t\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.RefType,\n\t\t\t\t\t\tArguments = { new IdentifierExpression(\"tr\") }\n\t\t\t\t\t}));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetRefValue()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"o = __refvalue(tr, object)\",\n\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\tnew IdentifierExpression(\"o\"),\n\t\t\t\t\tnew UndocumentedExpression {\n\t\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.RefValue,\n\t\t\t\t\t\tArguments = {\n\t\t\t\t\t\t\tnew IdentifierExpression(\"tr\"),\n\t\t\t\t\t\t\tnew TypeReferenceExpression(new PrimitiveType(\"object\"))\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SetRefValue()\n\t\t{\n\t\t\tParseUtilCSharp.AssertExpression(\n\t\t\t\t\"__refvalue(tr, object) = o\",\n\t\t\t\tnew AssignmentExpression(\n\t\t\t\t\tnew UndocumentedExpression {\n\t\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.RefValue,\n\t\t\t\t\t\tArguments = {\n\t\t\t\t\t\t\tnew IdentifierExpression(\"tr\"),\n\t\t\t\t\t\t\tnew TypeReferenceExpression(new PrimitiveType(\"object\"))\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew IdentifierExpression(\"o\")));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/AttributeSectionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.GeneralScope\n{\n\t[TestFixture]\n\tpublic class AttributeSectionTests\n\t{\n\t\t[Test]\n\t\tpublic void AttributesUsingNamespaceAlias()\n\t\t{\n\t\t\tstring program = @\"[global::Microsoft.VisualBasic.CompilerServices.DesignerGenerated()]\n[someprefix::DesignerGenerated()]\npublic class Form1 {\n}\";\n\t\t\t\n\t\t\tTypeDeclaration decl = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tAssert.AreEqual(2, decl.Attributes.Count);\n\t\t\tAssert.AreEqual(\"global::Microsoft.VisualBasic.CompilerServices.DesignerGenerated\",\n\t\t\t                decl.Attributes.First().Attributes.Single().Type.ToString());\n\t\t\tAssert.AreEqual(\"someprefix::DesignerGenerated\", decl.Attributes.Last().Attributes.Single().Type.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssemblyAttribute()\n\t\t{\n\t\t\tstring program = @\"[assembly: System.Attribute()]\";\n\t\t\tAttributeSection decl = ParseUtilCSharp.ParseGlobal<AttributeSection>(program);\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), decl.StartLocation);\n\t\t\tAssert.AreEqual(\"assembly\", decl.AttributeTarget);\n\t\t\tAssert.AreEqual(SyntaxTree.MemberRole, decl.Role);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ModuleAttribute()\n\t\t{\n\t\t\tstring program = @\"[module: System.Attribute()]\";\n\t\t\tAttributeSection decl = ParseUtilCSharp.ParseGlobal<AttributeSection>(program);\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), decl.StartLocation);\n\t\t\tAssert.AreEqual(\"module\", decl.AttributeTarget);\n\t\t\tAssert.AreEqual(SyntaxTree.MemberRole, decl.Role);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeAttribute()\n\t\t{\n\t\t\tstring program = @\"[type: System.Attribute()] class Test {}\";\n\t\t\tTypeDeclaration type = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tAttributeSection decl = type.Attributes.Single();\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), decl.StartLocation);\n\t\t\tAssert.AreEqual(\"type\", decl.AttributeTarget);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeWithoutParenthesis()\n\t\t{\n\t\t\tstring program = @\"[Attr] class Test {}\";\n\t\t\tTypeDeclaration type = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tvar attr = type.Attributes.Single().Attributes.Single();\n\t\t\tAssert.IsTrue(attr.GetChildByRole(Roles.LPar).IsNull);\n\t\t\tAssert.IsTrue(attr.GetChildByRole(Roles.RPar).IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeWithEmptyParenthesis()\n\t\t{\n\t\t\tstring program = @\"[Attr()] class Test {}\";\n\t\t\tTypeDeclaration type = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tvar attr = type.Attributes.Single().Attributes.Single();\n\t\t\tAssert.IsFalse(attr.GetChildByRole(Roles.LPar).IsNull);\n\t\t\tAssert.IsFalse(attr.GetChildByRole(Roles.RPar).IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TwoAttributesInSameSection()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t@\"[A, B] class Test {}\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Class,\n\t\t\t\t\tName = \"Test\",\n\t\t\t\t\tAttributes = {\n\t\t\t\t\t\tnew AttributeSection {\n\t\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\t\tnew Attribute { Type = new SimpleType(\"A\") },\n\t\t\t\t\t\t\t\tnew Attribute { Type = new SimpleType(\"B\") }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}});\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TwoAttributesInSameSectionLocations()\n\t\t{\n\t\t\tstring program = @\"[A, B] class Test {}\";\n\t\t\tTypeDeclaration type = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tvar attributeSection = type.Attributes.Single();\n\t\t\t\n\t\t\tvar firstAttribute = attributeSection.Attributes.First();\n\t\t\tAssert.AreEqual(2, firstAttribute.StartLocation.Column);\n\t\t\tAssert.AreEqual(3, firstAttribute.EndLocation.Column); \n\t\t\t\n\t\t\tvar lastAttribute = attributeSection.Attributes.Last();\n\t\t\tAssert.AreEqual(5, lastAttribute.StartLocation.Column);\n\t\t\tAssert.AreEqual(6, lastAttribute.EndLocation.Column);\n\t\t\t\n\t\t\tAssert.AreEqual(1, attributeSection.StartLocation.Column);\n\t\t\tAssert.AreEqual(7, attributeSection.EndLocation.Column);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TwoAttributesWithOptionalCommaInSameSectionLocations()\n\t\t{\n\t\t\tstring program = @\"[A, B,] class Test {}\";\n\t\t\tTypeDeclaration type = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tvar attributeSection = type.Attributes.Single();\n\t\t\t\n\t\t\tvar firstAttribute = attributeSection.Attributes.First();\n\t\t\tAssert.AreEqual(2, firstAttribute.StartLocation.Column);\n\t\t\tAssert.AreEqual(3, firstAttribute.EndLocation.Column); \n\t\t\t\n\t\t\tvar lastAttribute = attributeSection.Attributes.Last();\n\t\t\tAssert.AreEqual(5, lastAttribute.StartLocation.Column);\n\t\t\tAssert.AreEqual(6, lastAttribute.EndLocation.Column);\n\t\t\t\n\t\t\tAssert.AreEqual(1, attributeSection.StartLocation.Column);\n\t\t\tAssert.AreEqual(8, attributeSection.EndLocation.Column);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributesOnTypeParameter()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t\"class Test<[A,B]C> {}\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Class,\n\t\t\t\t\tName = \"Test\",\n\t\t\t\t\tTypeParameters = {\n\t\t\t\t\t\tnew TypeParameterDeclaration {\n\t\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\t\tnew AttributeSection {\n\t\t\t\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\t\t\t\tnew Attribute { Type = new SimpleType(\"A\") },\n\t\t\t\t\t\t\t\t\t\tnew Attribute { Type = new SimpleType(\"B\") }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tName = \"C\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeOnMethodParameter()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"void M([In] int p);\",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tName = \"M\",\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration {\n\t\t\t\t\t\t\tAttributes = { new AttributeSection(new Attribute { Type = new SimpleType(\"In\") }) },\n\t\t\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\t\t\tName = \"p\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeOnSetterValue()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"int P { get; [param: In] set; }\",\n\t\t\t\tnew PropertyDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tName = \"P\",\n\t\t\t\t\tGetter = new Accessor(),\n\t\t\t\t\tSetter = new Accessor {\n\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\tnew AttributeSection {\n\t\t\t\t\t\t\t\tAttributeTarget = \"param\",\n\t\t\t\t\t\t\t\tAttributes = { new Attribute { Type = new SimpleType(\"In\") } },\n\t\t\t\t\t\t\t} },\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t// TODO: Tests for other contexts where attributes can appear\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeWithNamedArguments ()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember (\n\t\t\t\t@\"[A(0, a:1, b=2)] class Test {}\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Class,\n\t\t\t\t\tName = \"Test\",\n\t\t\t\t\tAttributes = {\n\t\t\t\t\t\tnew AttributeSection {\n\t\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\t\tnew Attribute {\n\t\t\t\t\t\t\t\t\tType = new SimpleType(\"A\"),\n\t\t\t\t\t\t\t\t\tArguments = {\n\t\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(0),\n\t\t\t\t\t\t\t\t\t\tnew NamedArgumentExpression(\"a\", new PrimitiveExpression(1)),\n\t\t\t\t\t\t\t\t\t\tnew NamedExpression(\"b\", new PrimitiveExpression(2))\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssemblyAttributeBeforeNamespace()\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse(\"using System; [assembly: Attr] namespace X {}\");\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Type[] {\n\t\t\t\t\ttypeof(UsingDeclaration),\n\t\t\t\t\ttypeof(AttributeSection),\n\t\t\t\t\ttypeof(NamespaceDeclaration)\n\t\t\t\t}, syntaxTree.Children.Select(c => c.GetType()).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssemblyAttributeBeforeClass()\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse(\"using System; [assembly: Attr] class X {}\");\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Type[] {\n\t\t\t\t\ttypeof(UsingDeclaration),\n\t\t\t\t\ttypeof(AttributeSection),\n\t\t\t\t\ttypeof(TypeDeclaration)\n\t\t\t\t}, syntaxTree.Children.Select(c => c.GetType()).ToArray());\n\t\t\tAssert.That(((TypeDeclaration)syntaxTree.LastChild).Attributes, Is.Empty);\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"parser bug; see https://github.com/icsharpcode/NRefactory/pull/73\")]\n\t\tpublic void AssemblyAndModuleAttributeBeforeClass()\n\t\t{\n\t\t\t// See also: TypeSystemConvertVisitorTests.AssemblyAndModuleAttributesDoNotAppearOnTypes\n\t\t\tvar syntaxTree = SyntaxTree.Parse(\"[assembly: My1][module: My2][My3]class C {}\");\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Type[] {\n\t\t\t\t\ttypeof(AttributeSection),\n\t\t\t\t\ttypeof(AttributeSection),\n\t\t\t\t\ttypeof(TypeDeclaration)\n\t\t\t\t}, syntaxTree.Children.Select(c => c.GetType()).ToArray());\n\t\t\tvar td = (TypeDeclaration)syntaxTree.LastChild;\n\t\t\tAssert.AreEqual(1, td.Attributes.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/CommentTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.GeneralScope\n{\n\t[TestFixture]\n\tpublic class CommentTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleComment()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t// Comment\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tvar c = ns.GetChildrenByRole(Roles.Comment).Single();\n\t\t\tAssert.AreEqual(CommentType.SingleLine, c.CommentType);\n\t\t\tAssert.AreEqual(\" Comment\", c.Content);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CStyleComment()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t/* Comment */\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tvar c = ns.GetChildrenByRole(Roles.Comment).Single();\n\t\t\tAssert.AreEqual(CommentType.MultiLine, c.CommentType);\n\t\t\tAssert.AreEqual(\" Comment \", c.Content);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DocumentationComment()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t/// Comment\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tvar c = ns.GetChildrenByRole(Roles.Comment).Single();\n\t\t\tAssert.AreEqual(CommentType.Documentation, c.CommentType);\n\t\t\tAssert.AreEqual(\" Comment\", c.Content);\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"Parser bug\")]\n\t\tpublic void SimpleCommentWith4Slashes()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t//// Comment\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tvar c = ns.GetChildrenByRole(Roles.Comment).Single();\n\t\t\tAssert.AreEqual(CommentType.SingleLine, c.CommentType);\n\t\t\tAssert.AreEqual(\"// Comment\", c.Content);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultilineDocumentationComment()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t/** Comment */\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tvar c = ns.GetChildrenByRole(Roles.Comment).Single();\n\t\t\tAssert.AreEqual(CommentType.MultiLineDocumentation, c.CommentType);\n\t\t\tAssert.AreEqual(\" Comment \", c.Content);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EmptyMultilineCommnet()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t/**/\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tvar c = ns.GetChildrenByRole(Roles.Comment).Single();\n\t\t\tAssert.AreEqual(CommentType.MultiLine, c.CommentType);\n\t\t\tAssert.AreEqual(\"\", c.Content);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MultilineCommentWith3Stars()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t/*** Comment */\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tvar c = ns.GetChildrenByRole(Roles.Comment).Single();\n\t\t\tAssert.AreEqual(CommentType.MultiLine, c.CommentType);\n\t\t\tAssert.AreEqual(\"** Comment \", c.Content);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoEmptyComments()\n\t\t{\n\t\t\tstring program = @\"#if foo\n#undef a\n#endif\";\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar syntaxTree = parser.Parse(program);\n\t\t\tAssert.IsFalse(parser.HasErrors, string.Join(Environment.NewLine, parser.Errors.Select(e => string.Format(\"{0}: {1}\", e.Region.BeginLine, e.Message))));\n\t\t\tvar roles = syntaxTree.Children.Select(c => c.Role).ToArray();\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\tRoles.PreProcessorDirective\n\t\t\t}, roles);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/DelegateDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.GeneralScope\n{\n\t[TestFixture]\n\tpublic class DelegateDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleCSharpDelegateDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t\"public delegate void MyDelegate(int a, int secondParam, MyObj lastParam);\",\n\t\t\t\tnew DelegateDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tName = \"MyDelegate\",\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration(new PrimitiveType(\"int\"), \"a\"),\n\t\t\t\t\t\tnew ParameterDeclaration(new PrimitiveType(\"int\"), \"secondParam\"),\n\t\t\t\t\t\tnew ParameterDeclaration(new SimpleType(\"MyObj\"), \"lastParam\")\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericDelegateDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t\"public delegate T CreateObject<T>() where T : ICloneable;\",\n\t\t\t\tnew DelegateDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tReturnType = new SimpleType(\"T\"),\n\t\t\t\t\tName = \"CreateObject\",\n\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } },\n\t\t\t\t\tConstraints = {\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"T\"),\n\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"ICloneable\") }\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DelegateDeclarationInNamespace()\n\t\t{\n\t\t\tstring program = \"namespace N { delegate void MyDelegate(); }\";\n\t\t\tNamespaceDeclaration nd = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tAssert.AreEqual(\"MyDelegate\", ((DelegateDeclaration)nd.Members.Single()).Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DelegateDeclarationInClass()\n\t\t{\n\t\t\tstring program = \"class Outer { delegate void Inner(); }\";\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tAssert.AreEqual(\"Inner\", ((DelegateDeclaration)td.Members.Single()).Name);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/NamespaceDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.GeneralScope\n{\n\t[TestFixture]\n\tpublic class NamespaceDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleNamespaceTest()\n\t\t{\n\t\t\tstring program = \"namespace TestNamespace {\\n\" +\n\t\t\t\t\"}\\n\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tAssert.AreEqual(\"TestNamespace\", ns.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedNamespaceTest()\n\t\t{\n\t\t\tstring program = \"namespace N1 {//TestNamespace\\n\" +\n\t\t\t\t\"    namespace N2 {// Declares a namespace named N2 within N1.\\n\" +\n\t\t\t\t\"    }\\n\" +\n\t\t\t\t\"}\\n\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\t\n\t\t\tAssert.AreEqual(\"N1\", ns.Name);\n\t\t\t\n\t\t\tAssert.AreEqual(\"N2\", ns.Children.OfType<NamespaceDeclaration>().Single().Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExternAliasTest()\n\t\t{\n\t\t\tstring program = \"extern alias X; extern alias Y; using X::System; namespace TestNamespace { extern alias Z; using Y::System; }\";\n\t\t\tvar syntaxTree = new CSharpParser().Parse(program, \"code.cs\");\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Type[] {\n\t\t\t\t\ttypeof(ExternAliasDeclaration),\n\t\t\t\t\ttypeof(ExternAliasDeclaration),\n\t\t\t\t\ttypeof(UsingDeclaration),\n\t\t\t\t\ttypeof(NamespaceDeclaration)\n\t\t\t\t}, syntaxTree.Children.Select(c => c.GetType()).ToArray());\n\t\t\tvar namespaceMembers = ((NamespaceDeclaration)syntaxTree.LastChild).Members;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Type[] {\n\t\t\t\t\ttypeof(ExternAliasDeclaration),\n\t\t\t\t\ttypeof(UsingDeclaration)\n\t\t\t\t}, namespaceMembers.Select(c => c.GetType()).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/PreprocessorDirectiveTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.GeneralScope\n{\n\t[TestFixture]\n\tpublic class PreprocessorDirectiveTests\n\t{\n\t\t[Test]\n\t\tpublic void InactiveIf()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t#if SOMETHING\n\tclass A {}\n\t#endif\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tAssert.AreEqual(0, ns.Members.Count);\n\t\t\t\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.NamespaceKeyword,\n\t\t\t                \tNamespaceDeclaration.NamespaceNameRole,\n\t\t\t                \tRoles.LBrace,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.RBrace\n\t\t\t\t\t\t\t}, ns.Children.Where (c => c.Role != Roles.NewLine).Select(c => c.Role).ToArray());\n\t\t\t\n\t\t\tvar pp = ns.GetChildrenByRole(Roles.PreProcessorDirective);\n\t\t\t\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.If, pp.First().Type);\n\t\t\tAssert.IsFalse(pp.First().Take);\n\t\t\tAssert.AreEqual(\"SOMETHING\", pp.First().Argument);\n\t\t\tAssert.AreEqual(new TextLocation(2, 2), pp.First().StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(2, 15), pp.First().EndLocation);\n\t\t\t\n\t\t\tvar comment = ns.GetChildByRole(Roles.Comment);\n\t\t\tAssert.AreEqual(CommentType.InactiveCode, comment.CommentType);\n\t\t\tAssert.AreEqual(new TextLocation(3, 1), comment.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(4, 2), comment.EndLocation);\n\t\t\tAssert.AreEqual(\"\\tclass A {}\\n\\t\", comment.Content.Replace(\"\\r\", \"\"));\n\t\t\t\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Endif, pp.Last().Type);\n\t\t\tAssert.AreEqual(string.Empty, pp.Last().Argument);\n\t\t\tAssert.AreEqual(new TextLocation(4, 2), pp.Last().StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(4, 8), pp.Last().EndLocation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedInactiveIf()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t#if SOMETHING\n\tclass A {\n\t\t#if B\n\t\tvoid M() {}\n\t\t#endif\n\t}\n\t#endif\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tAssert.AreEqual(0, ns.Members.Count);\n\t\t\t\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.NamespaceKeyword,\n\t\t\t                \tNamespaceDeclaration.NamespaceNameRole,\n\t\t\t                \tRoles.LBrace,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.RBrace\n\t\t\t}, ns.Children.Where (c => !(c is NewLineNode)).Select(c => c.Role).ToArray());\n\t\t}\n\t\t\n\t\t[Ignore(\"Fixme!\")]\n\t\t[Test]\n\t\tpublic void CommentOnEndOfIfDirective()\n\t\t{\n\t\t\tstring program = @\"namespace NS {\n\t#if SOMETHING // comment\n\tclass A { }\n\t#endif\n}\";\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(program);\n\t\t\tAssert.AreEqual(0, ns.Members.Count);\n\t\t\t\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.NamespaceKeyword,\n\t\t\t                \tRoles.Identifier,\n\t\t\t                \tRoles.LBrace,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.RBrace\n\t\t\t}, ns.Children.Where (c => !(c is NewLineNode)).Select(c => c.Role).ToArray());\n\t\t\tAssert.AreEqual(CommentType.SingleLine, ns.GetChildrenByRole(Roles.Comment).First().CommentType);\n\t\t\tAssert.AreEqual(CommentType.InactiveCode, ns.GetChildrenByRole(Roles.Comment).Last().CommentType);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PragmaWarning()\n\t\t{\n\t\t\tstring program = \"#pragma warning disable 809\";\n\t\t\tvar ppd = ParseUtilCSharp.ParseGlobal<PragmaWarningPreprocessorDirective>(program);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Pragma, ppd.Type);\n\t\t\tAssert.IsTrue(ppd.Disable);\n\t\t\tAssert.IsTrue(ppd.IsDefined (809));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PragmaWarningLocations()\n\t\t{\n\t\t\tstring program = \"#pragma warning disable 809\";\n\t\t\tvar ppd = ParseUtilCSharp.ParseGlobal<PragmaWarningPreprocessorDirective>(program);\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), ppd.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), ppd.PragmaToken.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 8), ppd.PragmaToken.EndLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 9), ppd.WarningToken.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 16), ppd.WarningToken.EndLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 17), ppd.DisableToken.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 24), ppd.DisableToken.EndLocation);\n\t\t\tvar id = ppd.Warnings.Single();\n\t\t\tAssert.AreEqual(new TextLocation(1, 25), id.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 28), id.EndLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 28), ppd.EndLocation);\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"mcs crashes because it tries to compute the full path to file.cs\")]\n\t\tpublic void PragmaChecksum()\n\t\t{\n\t\t\tstring program = \"#pragma checksum \\\"file.cs\\\" \\\"{3673e4ca-6098-4ec1-890f-8fceb2a794a2}\\\" \\\"{012345678AB}\\\"\";\n\t\t\tvar ppd = ParseUtilCSharp.ParseGlobal<PreProcessorDirective>(program);\n\t\t\tAssert.IsFalse(ppd is PragmaWarningPreprocessorDirective);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Pragma, ppd.Type);\n\t\t\tAssert.AreEqual(\"checksum \\\"file.cs\\\" \\\"{3673e4ca-6098-4ec1-890f-8fceb2a794a2}\\\" \\\"{012345678AB}\\\"\", ppd.Argument);\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"mcs crashes because it tries to compute the full path to file.cs\")]\n\t\tpublic void LineWithFileName()\n\t\t{\n\t\t\tstring program = \"#line 200 \\\"otherfile.cs\\\"\\nclass Test {}\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(program, \"/a.cs\");\n\t\t\tAssert.IsFalse(parser.HasErrors, string.Join(Environment.NewLine, parser.Errors.Select(e => e.Message)));\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.NewLine,\n\t\t\t                \tSyntaxTree.MemberRole\n\t\t\t}, syntaxTree.Children.Select(c => c.Role).ToArray());\n\t\t\tAssert.AreEqual(new TextLocation(2, 1), syntaxTree.Members.Single().StartLocation);\n\n\t\t\tvar ppd = (LinePreprocessorDirective)syntaxTree.FirstChild;\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Line, ppd.Type);\n\t\t\tAssert.AreEqual(200, ppd.LineNumber);\n\t\t\tAssert.AreEqual(\"otherfile.cs\", ppd.FileName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Line()\n\t\t{\n\t\t\tstring program = \"#line 200\\nclass Test {}\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(program);\n\t\t\tAssert.IsFalse(parser.HasErrors, string.Join(Environment.NewLine, parser.Errors.Select(e => e.Message)));\n\t\t\tvar roles = syntaxTree.Children.Select(c => c.Role).ToArray();\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\tNamespaceDeclaration.MemberRole\n\t\t\t}, roles);\n\t\t\tAssert.AreEqual(new TextLocation(2, 1), syntaxTree.Members.Single().StartLocation);\n\t\t\tvar ppd = (LinePreprocessorDirective)syntaxTree.FirstChild;\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Line, ppd.Type);\n\t\t\tAssert.AreEqual(200, ppd.LineNumber);\n\t\t}\n\t\t\n\t\tconst string elifProgram = @\"\n#if AAA\nclass A { }\n#elif BBB\nclass B { }\n#endif\";\n\t\t\n\t\t[Test]\n\t\tpublic void ElifBothFalse()\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar syntaxTree = parser.Parse(elifProgram, \"elif.cs\");\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective\n\t\t\t}, syntaxTree.Children.Where (c => !(c is NewLineNode)).Select(c => c.Role).ToArray());\n\t\t\tvar aaa = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(0);\n\t\t\tAssert.IsFalse(aaa.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.If, aaa.Type);\n\t\t\tAssert.AreEqual(\"AAA\", aaa.Argument);\n\t\t\t\n\t\t\tvar bbb = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(1);\n\t\t\tAssert.IsFalse(bbb.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Elif, bbb.Type);\n\t\t\tAssert.AreEqual(\"BBB\", bbb.Argument);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ElifBothTrue()\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tparser.CompilerSettings.ConditionalSymbols.Add(\"AAA\");\n\t\t\tvar syntaxTree = parser.Parse(elifProgram, \"elif.cs\");\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\t\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tNamespaceDeclaration.MemberRole,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective\n\t\t\t}, syntaxTree.Children.Where (c => !(c is NewLineNode)).Select(c => c.Role).ToArray());\n\t\t\tvar aaa = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(0);\n\t\t\tAssert.IsTrue(aaa.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.If, aaa.Type);\n\t\t\tAssert.AreEqual(\"AAA\", aaa.Argument);\n\t\t\t\n\t\t\tvar bbb = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(1);\n\t\t\tAssert.IsFalse(bbb.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Elif, bbb.Type);\n\t\t\tAssert.AreEqual(\"BBB\", bbb.Argument);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ElifFirstTaken()\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tparser.CompilerSettings.ConditionalSymbols.Add(\"AAA\");\n\t\t\tvar syntaxTree = parser.Parse(elifProgram, \"elif.cs\");\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\t\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tNamespaceDeclaration.MemberRole,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective\n\t\t\t}, syntaxTree.Children.Where (c => !(c is NewLineNode)).Select(c => c.Role).ToArray());\n\t\t\tvar aaa = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(0);\n\t\t\tAssert.IsTrue(aaa.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.If, aaa.Type);\n\t\t\tAssert.AreEqual(\"AAA\", aaa.Argument);\n\t\t\t\n\t\t\tvar bbb = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(1);\n\t\t\tAssert.IsFalse(bbb.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Elif, bbb.Type);\n\t\t\tAssert.AreEqual(\"BBB\", bbb.Argument);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ElifSecondTaken()\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tparser.CompilerSettings.ConditionalSymbols.Add(\"BBB\");\n\t\t\tvar syntaxTree = parser.Parse(elifProgram, \"elif.cs\");\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\t\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tRoles.Comment,\n\t\t\t                \tRoles.PreProcessorDirective,\n\t\t\t                \tNamespaceDeclaration.MemberRole,\n\t\t\t                \tRoles.PreProcessorDirective\n\t\t\t\t\t\t\t}, syntaxTree.Children.Where (c => c.Role != Roles.NewLine).Select(c => c.Role).ToArray());\n\t\t\tvar aaa = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(0);\n\t\t\tAssert.IsFalse(aaa.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.If, aaa.Type);\n\t\t\tAssert.AreEqual(\"AAA\", aaa.Argument);\n\t\t\t\n\t\t\tvar bbb = syntaxTree.GetChildrenByRole(Roles.PreProcessorDirective).ElementAt(1);\n\t\t\tAssert.IsTrue(bbb.Take);\n\t\t\tAssert.AreEqual(PreProcessorDirectiveType.Elif, bbb.Type);\n\t\t\tAssert.AreEqual(\"BBB\", bbb.Argument);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NewLinesAfterPreprocessorDirectives()\n\t\t{\n\t\t\tstring program = @\"#define FOO\n#undef FOO\n#define FOO\n#region Blah\n#if FOO\nclass Test {}\n#elif FOO\nclass Test {}\n#else\nclass Test {}\n#endif\n#endregion\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(program);\n\t\t\tAssert.IsFalse(parser.HasErrors, string.Join(Environment.NewLine, parser.Errors.Select(e => string.Format(\"{0}: {1}\", e.Region.BeginLine, e.Message))));\n\t\t\tvar roles = syntaxTree.Children.Select(c => c.Role).ToArray();\n\t\t\tAssert.AreEqual(new Role[] {\n\t\t\t\t// #define FOO\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// #undef FOO\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// #define FOO\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// #region Blah\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// #if FOO\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// class Test {}\n\t\t\t\tNamespaceDeclaration.MemberRole,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// #elif FOO\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// class Test {}\n\t\t\t\tRoles.Comment,\n\t\t\t\t// #else\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// class Test {}\n\t\t\t\tRoles.Comment,\n\t\t\t\t// #endif\n\t\t\t\tRoles.PreProcessorDirective,\n\t\t\t\tRoles.NewLine,\n\t\t\t\t// #endregion\n\t\t\t\tRoles.PreProcessorDirective\n\t\t\t}, roles);\n\t\t}\n\t\t\t\t\n\t\t[Test]\n\t\tpublic void ConditionalSymbolTest()\n\t\t{\n\t\t\tconst string program = @\"// Test\n#if AAA\n#undef AAA\n#define CCC\n#else\n#define DDD\n#endif\nclass C {}\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tparser.CompilerSettings.ConditionalSymbols.Add(\"AAA\");\n\t\t\tparser.CompilerSettings.ConditionalSymbols.Add(\"BBB\");\n\t\t\tvar syntaxTree = parser.Parse(program, \"elif.cs\");\n\t\t\tAssert.AreEqual(new[] { \"BBB\", \"CCC\" }, syntaxTree.ConditionalSymbols);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/TypeDeclarationTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.GeneralScope\n{\n\t[TestFixture]\n\tpublic class TypeDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleClassTypeDeclarationTest()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"class MyClass  : My.Base.Class  { }\");\n\t\t\t\n\t\t\tAssert.AreEqual(ClassType.Class, td.ClassType);\n\t\t\tAssert.AreEqual(\"MyClass\", td.Name);\n\t\t\tAssert.AreEqual(\"My.Base.Class\", td.BaseTypes.First ().ToString ());\n\t\t\tAssert.AreEqual(Modifiers.None, td.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleClassRegionTest()\n\t\t{\n\t\t\tconst string program = \"class MyClass\\n{\\n}\\n\";\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(program);\n\t\t\tAssert.AreEqual(1, td.StartLocation.Line, \"StartLocation.Y\");\n\t\t\tAssert.AreEqual(1, td.StartLocation.Column, \"StartLocation.X\");\n\t\t\tTextLocation bodyStartLocation = td.NameToken.EndLocation;\n\t\t\tAssert.AreEqual(1, bodyStartLocation.Line, \"BodyStartLocation.Y\");\n\t\t\tAssert.AreEqual(14, bodyStartLocation.Column, \"BodyStartLocation.X\");\n\t\t\tAssert.AreEqual(3, td.EndLocation.Line, \"EndLocation.Y\");\n\t\t\tAssert.AreEqual(2, td.EndLocation.Column, \"EndLocation.Y\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimplePartialClassTypeDeclarationTest()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"partial class MyClass { }\");\n\t\t\tAssert.IsFalse(td.IsNull);\n\t\t\tAssert.AreEqual(ClassType.Class, td.ClassType);\n\t\t\tAssert.AreEqual(\"MyClass\", td.Name);\n\t\t\tAssert.AreEqual(Modifiers.Partial, td.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedClassesTest()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"class MyClass { partial class P1 {} public partial class P2 {} static class P3 {} internal static class P4 {} }\");\n\t\t\tAssert.IsFalse(td.IsNull);\n\t\t\tAssert.AreEqual(ClassType.Class, td.ClassType);\n\t\t\tAssert.AreEqual(\"MyClass\", td.Name);\n\t\t\tAssert.AreEqual(Modifiers.Partial, ((TypeDeclaration)td.Members.ElementAt(0)).Modifiers);\n\t\t\tAssert.AreEqual(Modifiers.Partial | Modifiers.Public, ((TypeDeclaration)td.Members.ElementAt(1)).Modifiers);\n\t\t\tAssert.AreEqual(Modifiers.Static, ((TypeDeclaration)td.Members.ElementAt(2)).Modifiers);\n\t\t\tAssert.AreEqual(Modifiers.Static | Modifiers.Internal, ((TypeDeclaration)td.Members.ElementAt(3)).Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleStaticClassTypeDeclarationTest()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"static class MyClass { }\");\n\t\t\tAssert.IsFalse(td.IsNull);\n\t\t\tAssert.AreEqual(ClassType.Class, td.ClassType);\n\t\t\tAssert.AreEqual(\"MyClass\", td.Name);\n\t\t\tAssert.AreEqual(Modifiers.Static, td.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericClassTypeDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t\"public class G<T> {}\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Class,\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tName = \"G\",\n\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericClassWithWhere()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t@\"public class Test<T> where T : IMyInterface { }\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Class,\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tName = \"Test\",\n\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } },\n\t\t\t\t\tConstraints = {\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"T\"),\n\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"IMyInterface\") }\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComplexGenericInterfaceTypeDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t\"public interface Generic<in T, out S> : System.IComparable where S : G<T[]>, new() where  T : MyNamespace.IMyInterface {}\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Interface,\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tName = \"Generic\",\n\t\t\t\t\tTypeParameters = {\n\t\t\t\t\t\tnew TypeParameterDeclaration { Variance = VarianceModifier.Contravariant, Name = \"T\" },\n\t\t\t\t\t\tnew TypeParameterDeclaration { Variance = VarianceModifier.Covariant, Name = \"S\" }\n\t\t\t\t\t},\n\t\t\t\t\tBaseTypes = {\n\t\t\t\t\t\tnew MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"System\"),\n\t\t\t\t\t\t\tMemberName = \"IComparable\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tConstraints = {\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"S\"),\n\t\t\t\t\t\t\tBaseTypes = {\n\t\t\t\t\t\t\t\tnew SimpleType {\n\t\t\t\t\t\t\t\t\tIdentifier = \"G\",\n\t\t\t\t\t\t\t\t\tTypeArguments = { new SimpleType(\"T\").MakeArrayType() }\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnew PrimitiveType(\"new\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"T\"),\n\t\t\t\t\t\t\tBaseTypes = {\n\t\t\t\t\t\t\t\tnew MemberType {\n\t\t\t\t\t\t\t\t\tTarget = new SimpleType(\"MyNamespace\"),\n\t\t\t\t\t\t\t\t\tMemberName = \"IMyInterface\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComplexClassTypeDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t@\"\n[MyAttr()]\npublic abstract class MyClass : MyBase, Interface1, My.Test.Interface2\n{\n}\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Class,\n\t\t\t\t\tAttributes = {\n\t\t\t\t\t\tnew AttributeSection {\n\t\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\t\tnew Attribute { Type = new SimpleType(\"MyAttr\") }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tModifiers = Modifiers.Public | Modifiers.Abstract,\n\t\t\t\t\tName = \"MyClass\",\n\t\t\t\t\tBaseTypes = {\n\t\t\t\t\t\tnew SimpleType(\"MyBase\"),\n\t\t\t\t\t\tnew SimpleType(\"Interface1\"),\n\t\t\t\t\t\tnew MemberType {\n\t\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\t\tTarget = new SimpleType(\"My\"),\n\t\t\t\t\t\t\t\tMemberName = \"Test\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tMemberName = \"Interface2\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleStructTypeDeclarationTest()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"struct MyStruct {}\");\n\t\t\t\n\t\t\tAssert.AreEqual(ClassType.Struct, td.ClassType);\n\t\t\tAssert.AreEqual(\"MyStruct\", td.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleInterfaceTypeDeclarationTest()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"interface MyInterface {}\");\n\t\t\t\n\t\t\tAssert.AreEqual(ClassType.Interface, td.ClassType);\n\t\t\tAssert.AreEqual(\"MyInterface\", td.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleEnumTypeDeclarationTest()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"enum MyEnum {}\");\n\t\t\t\n\t\t\tAssert.AreEqual(ClassType.Enum, td.ClassType);\n\t\t\tAssert.AreEqual(\"MyEnum\", td.Name);\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"Mono parser bug?\")]\n\t\tpublic void ContextSensitiveKeywordTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t\"partial class partial<[partial: where] where> where where : partial<where> { }\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Class,\n\t\t\t\t\tModifiers = Modifiers.Partial,\n\t\t\t\t\tName = \"partial\",\n\t\t\t\t\tTypeParameters = {\n\t\t\t\t\t\tnew TypeParameterDeclaration {\n\t\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\t\tnew AttributeSection {\n\t\t\t\t\t\t\t\t\tAttributeTarget = \"partial\",\n\t\t\t\t\t\t\t\t\tAttributes = { new Attribute { Type = new SimpleType(\"where\") } }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tName = \"where\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tConstraints = {\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"where\"),\n\t\t\t\t\t\t\tBaseTypes = {\n\t\t\t\t\t\t\t\tnew SimpleType {\n\t\t\t\t\t\t\t\t\tIdentifier = \"partial\",\n\t\t\t\t\t\t\t\t\tTypeArguments = { new SimpleType(\"where\") }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeInNamespaceTest()\n\t\t{\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(\"namespace N { class MyClass { } }\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"N\", ns.Name);\n\t\t\tAssert.AreEqual(\"MyClass\", ((TypeDeclaration)ns.Members.Single()).Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StructInNamespaceTest()\n\t\t{\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(\"namespace N { struct MyClass { } }\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"N\", ns.Name);\n\t\t\tAssert.AreEqual(\"MyClass\", ((TypeDeclaration)ns.Members.Single()).Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumInNamespaceTest()\n\t\t{\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(\"namespace N { enum MyClass { } }\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"N\", ns.Name);\n\t\t\tAssert.AreEqual(\"MyClass\", ((TypeDeclaration)ns.Members.Single()).Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InterfaceInNamespaceTest()\n\t\t{\n\t\t\tNamespaceDeclaration ns = ParseUtilCSharp.ParseGlobal<NamespaceDeclaration>(\"namespace N { interface MyClass { } }\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"N\", ns.Name);\n\t\t\tAssert.AreEqual(\"MyClass\", ((TypeDeclaration)ns.Members.Single()).Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumWithInitializer()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"enum MyEnum { Val1 = 10 }\");\n\t\t\tEnumMemberDeclaration member = (EnumMemberDeclaration)td.Members.Single();\n\t\t\tAssert.AreEqual(\"Val1\", member.Name);\n\t\t\tAssert.AreEqual(10, ((PrimitiveExpression)member.Initializer).Value);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumWithBaseType()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"enum MyEnum : short { }\");\n\t\t\tAssert.AreEqual(\"MyEnum\", td.Name);\n\t\t\tAssert.AreEqual(\"short\", ((PrimitiveType)td.BaseTypes.Single()).Keyword);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumWithIncorrectNewlineAfterIntegerLiteral ()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal (\n\t\t\t\t\"enum DisplayFlags { D = 4\\r\\r\\n}\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Enum,\n\t\t\t\t\tName = \"DisplayFlags\",\n\t\t\t\t\tMembers = {\n\t\t\t\t\t\tnew EnumMemberDeclaration {\n\t\t\t\t\t\t\tName = \"D\",\n\t\t\t\t\t\t\tInitializer = new PrimitiveExpression(4)\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumWithCommaAtEnd()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"enum MyEnum { A, }\");\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Role[] {\n\t\t\t\t\tRoles.EnumKeyword,\n\t\t\t\t\tRoles.Identifier,\n\t\t\t\t\tRoles.LBrace,\n\t\t\t\t\tRoles.TypeMemberRole,\n\t\t\t\t\tRoles.Comma,\n\t\t\t\t\tRoles.RBrace\n\t\t\t\t}, td.Children.Select(c => c.Role).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumWithCommaAndSemicolonAtEnd()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"enum MyEnum { A, };\");\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Role[] {\n\t\t\t\t\tRoles.EnumKeyword,\n\t\t\t\t\tRoles.Identifier,\n\t\t\t\t\tRoles.LBrace,\n\t\t\t\t\tRoles.TypeMemberRole,\n\t\t\t\t\tRoles.Comma,\n\t\t\t\t\tRoles.RBrace,\n\t\t\t\t\tRoles.Semicolon\n\t\t\t\t}, td.Children.Select(c => c.Role).ToArray());\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"Parser bug (incorrectly creates a comma at the end of the enum)\")]\n\t\tpublic void EnumWithSemicolonAtEnd()\n\t\t{\n\t\t\tTypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>(\"enum MyEnum { A };\");\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Role[] {\n\t\t\t\t\tRoles.EnumKeyword,\n\t\t\t\t\tRoles.Identifier,\n\t\t\t\t\tRoles.LBrace,\n\t\t\t\t\tRoles.TypeMemberRole,\n\t\t\t\t\tRoles.RBrace,\n\t\t\t\t\tRoles.Semicolon\n\t\t\t\t}, td.Children.Select(c => c.Role).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/UsingDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.GeneralScope\n{\n\t[TestFixture]\n\tpublic class UsingDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void WrongUsingTest()\n\t\t{\n\t\t\tstring program = \"using\\n\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\t//SyntaxTree syntaxTree = \n\t\t\tparser.Parse (program);\n//\t\t\tAssert.AreEqual(0, syntaxTree.Children.Count());\n\t\t\tAssert.IsTrue(parser.HasErrors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DeclarationTest()\n\t\t{\n\t\t\tstring program = \"using System;\\n\" +\n\t\t\t\t\"using My.Name.Space;\\n\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(program);\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\t\n\t\t\tAssert.IsTrue(2 <= syntaxTree.Children.Count());\n\t\t\tAssert.IsTrue(syntaxTree.Children.ElementAt(0) is UsingDeclaration);\n\t\t\tAssert.IsFalse(syntaxTree.Children.ElementAt(0) is UsingAliasDeclaration);\n\t\t\tUsingDeclaration ud = (UsingDeclaration)syntaxTree.Children.ElementAt(0);\n\t\t\tAssert.AreEqual(\"System\", ud.Namespace);\n\t\t\t\n\t\t\tAssert.IsTrue(syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(1) is UsingDeclaration);\n\t\t\tAssert.IsFalse(syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(1) is UsingAliasDeclaration);\n\t\t\tud = (UsingDeclaration)syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(1);\n\t\t\tAssert.AreEqual(\"My.Name.Space\", ud.Namespace);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UsingAliasDeclarationTest()\n\t\t{\n\t\t\tstring program = \"using TESTME=System;\\n\" +\n\t\t\t\t\"using myAlias=My.Name.Space;\\n\" +\n\t\t\t\t\"using StringCollection = System.Collections.Generic.List<string>;\\n\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(program);\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\t\n\t\t\tAssert.IsTrue(3 <= syntaxTree.Children.Count());\n\t\t\t\n\t\t\tAssert.IsTrue(syntaxTree.Children.ElementAt(0) is UsingAliasDeclaration);\n\t\t\tUsingAliasDeclaration ud = (UsingAliasDeclaration)syntaxTree.Children.ElementAt(0);\n\t\t\tAssert.AreEqual(\"TESTME\", ud.Alias);\n\t\t\tAssert.AreEqual(\"System\", ud.Import.ToString());\n\t\t\t\n\t\t\tAssert.IsTrue(syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(1) is UsingAliasDeclaration);\n\t\t\tud = (UsingAliasDeclaration)syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(1);\n\t\t\tAssert.AreEqual(\"myAlias\", ud.Alias);\n\t\t\tAssert.AreEqual(\"My.Name.Space\", ud.Import.ToString());\n\t\t\t\n\t\t\tAssert.IsTrue(syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(2) is UsingAliasDeclaration);\n\t\t\tud = (UsingAliasDeclaration)syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(2);\n\t\t\tAssert.AreEqual(\"StringCollection\", ud.Alias);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List<string>\", ud.Import.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UsingWithAliasing()\n\t\t{\n\t\t\tstring program = \"using global::System;\\n\" +\n\t\t\t\t\"using myAlias=global::My.Name.Space;\\n\" +\n\t\t\t\t\"using a::b.c;\\n\";\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(program);\n\t\t\tAssert.IsFalse(parser.HasErrors);\n\t\t\t\n\t\t\tAssert.IsTrue(3 <= syntaxTree.Children.Count());\n\t\t\t\n\t\t\tAssert.IsTrue(syntaxTree.Children.ElementAt(0) is UsingDeclaration);\n\t\t\tAssert.IsFalse(syntaxTree.Children.ElementAt(0) is UsingAliasDeclaration);\n\t\t\tUsingDeclaration ud = (UsingDeclaration)syntaxTree.Children.ElementAt(0);\n\t\t\tAssert.AreEqual(\"global::System\", ud.Namespace);\n\t\t\t\n\t\t\tAssert.IsTrue(syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(1) is UsingAliasDeclaration);\n\t\t\tUsingAliasDeclaration uad = (UsingAliasDeclaration)syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(1);\n\t\t\tAssert.AreEqual(\"myAlias\", uad.Alias);\n\t\t\tAssert.AreEqual(\"global::My.Name.Space\", uad.Import.ToString());\n\t\t\t\n\t\t\tAssert.IsTrue(syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(2) is UsingDeclaration);\n\t\t\tAssert.IsFalse(syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(2) is UsingAliasDeclaration);\n\t\t\tud = (UsingDeclaration)syntaxTree.Children.Where (c => c.Role != Roles.NewLine).ElementAt(2);\n\t\t\tAssert.AreEqual(\"a::b.c\", ud.Namespace);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseSelfTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser\n{\n\t/// <summary>\n\t/// Test fixture that parses NRefactory itself,\n\t/// ensures that there are no parser crashes while doing so,\n\t/// and that the returned positions are consistent.\n\t/// </summary>\n\t[TestFixture]\n\tpublic class ParseSelfTests\n\t{\n\t\tstring[] fileNames;\n\t\t\n\t\t[TestFixtureSetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tstring path = Path.GetFullPath (Path.Combine (\"..\", \"..\"));\n\t\t\tif (!File.Exists(Path.Combine(path, \"NRefactory.sln\")))\n\t\t\t\tthrow new InvalidOperationException(\"Test cannot find the NRefactory source code in \" + path);\n\t\t\tfileNames = Directory.GetFiles(path, \"*.cs\", SearchOption.AllDirectories);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenerateTypeSystem()\n\t\t{\n\t\t\tIProjectContent pc = new CSharpProjectContent();\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tparser.GenerateTypeSystemMode = true;\n\t\t\tforeach (string fileName in fileNames) {\n\t\t\t\tSyntaxTree syntaxTree;\n\t\t\t\tusing (var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.SequentialScan)) {\n\t\t\t\t\tsyntaxTree = parser.Parse(fs, fileName);\n\t\t\t\t}\n\t\t\t\tvar unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\t\tforeach (var td in unresolvedFile.GetAllTypeDefinitions()) {\n\t\t\t\t\tAssert.AreSame(unresolvedFile, td.UnresolvedFile);\n\t\t\t\t\tforeach (var member in td.Members) {\n\t\t\t\t\t\tAssert.AreSame(unresolvedFile, member.UnresolvedFile);\n\t\t\t\t\t\tAssert.AreSame(td, member.DeclaringTypeDefinition);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpc = pc.AddOrUpdateFiles(unresolvedFile);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#region ParseAndCheckPositions\n\t\t\n\t\t[Test, Ignore(\"Positions still are incorrect in several cases\")]\n\t\tpublic void ParseAndCheckPositions()\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tforeach (string fileName in fileNames) {\n\t\t\t\tvar currentDocument = new ReadOnlyDocument(File.ReadAllText(fileName));\n\t\t\t\tSyntaxTree syntaxTree = parser.Parse(currentDocument, fileName);\n\t\t\t\tif (parser.HasErrors)\n\t\t\t\t\tcontinue;\n\t\t\t\tConsistencyChecker.CheckPositionConsistency(syntaxTree, fileName, currentDocument);\n\t\t\t\tConsistencyChecker.CheckMissingTokens(syntaxTree, fileName, currentDocument);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseUtil.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\n\nusing System.Text;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser\n{\n\t/// <summary>\n\t/// Helper methods for parser unit tests.\n\t/// </summary>\n\tpublic static class ParseUtilCSharp\n\t{\n\t\tpublic static T ParseGlobal<T>(string code, bool expectErrors = false) where T : AstNode\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(code);\n\t\t\t\n\t\t\tStringBuilder errorOutput = new StringBuilder();\n\t\t\tforeach (var error in parser.Errors)\n\t\t\t\terrorOutput.AppendLine (error.Message);\n\t\t\tAssert.AreEqual(expectErrors, parser.HasErrors, errorOutput.ToString());\n\t\t\t\n\t\t\tAstNode node = syntaxTree.Children.Single(c => c.Role != Roles.NewLine);\n\t\t\tType type = typeof(T);\n\t\t\tAssert.IsTrue(type.IsAssignableFrom(node.GetType()), String.Format(\"Parsed node was {0} instead of {1} ({2})\", node.GetType(), type, node));\n\t\t\treturn (T)node;\n\t\t}\n\t\t\n\t\tpublic static void AssertGlobal(string code, AstNode expectedNode)\n\t\t{\n\t\t\tvar node = ParseGlobal<AstNode>(code);\n\t\t\tif (!expectedNode.IsMatch(node)) {\n\t\t\t\tAssert.Fail(\"Expected '{0}' but was '{1}'\", ToCSharp(expectedNode), ToCSharp(node));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static T ParseStatement<T>(string stmt, bool expectErrors = false) where T : AstNode\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar statements = parser.ParseStatements(stmt);\n\t\t\t\n\t\t\tStringBuilder errorOutput = new StringBuilder();\n\t\t\tforeach (var error in parser.Errors)\n\t\t\t\terrorOutput.AppendLine (error.Message);\n\t\t\tAssert.AreEqual(expectErrors, parser.HasErrors, errorOutput.ToString());\n\t\t\t\n\t\t\tAstNode statement = statements.Single();\n\t\t\tType type = typeof(T);\n\t\t\tAssert.IsTrue(type.IsAssignableFrom(statement.GetType()), String.Format(\"Parsed statement was {0} instead of {1} ({2})\", statement.GetType(), type, statement));\n\t\t\treturn (T)statement;\n\t\t}\n\t\t\n\t\tpublic static void AssertStatement(string code, CSharp.Statement expectedStmt)\n\t\t{\n\t\t\tvar stmt = ParseStatement<CSharp.Statement>(code);\n\t\t\tif (!expectedStmt.IsMatch(stmt)) {\n\t\t\t\tAssert.Fail(\"Expected '{0}' but was '{1}'\", ToCSharp(expectedStmt), ToCSharp(stmt));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static T ParseExpression<T>(string expr, bool expectErrors = false) where T : AstNode\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tAstNode parsedExpression = parser.ParseExpression(expr);\n\t\t\t\n\t\t\tStringBuilder errorOutput = new StringBuilder();\n\t\t\tforeach (var error in parser.Errors)\n\t\t\t\terrorOutput.AppendLine (error.Message);\n\t\t\tAssert.AreEqual(expectErrors, parser.HasErrors, errorOutput.ToString());\n\t\t\t\n\t\t\tif (expectErrors && parsedExpression == null)\n\t\t\t\treturn default (T);\n\t\t\tType type = typeof(T);\n\t\t\tAssert.IsTrue(type.IsAssignableFrom(parsedExpression.GetType()), String.Format(\"Parsed expression was {0} instead of {1} ({2})\", parsedExpression.GetType(), type, parsedExpression));\n\t\t\treturn (T)parsedExpression;\n\t\t}\n\t\t\n\t\tpublic static void AssertExpression(string code, CSharp.Expression expectedExpr)\n\t\t{\n\t\t\tvar expr = ParseExpression<CSharp.Expression>(code);\n\t\t\tif (!expectedExpr.IsMatch(expr)) {\n\t\t\t\tAssert.Fail(\"Expected '{0}' but was '{1}'\", ToCSharp(expectedExpr), ToCSharp(expr));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static T ParseTypeMember<T>(string expr, bool expectErrors = false) where T : EntityDeclaration\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar members = parser.ParseTypeMembers(expr);\n\n\t\t\tStringBuilder errorOutput = new StringBuilder();\n\t\t\tforeach (var error in parser.Errors)\n\t\t\t\terrorOutput.AppendLine (error.Message);\n\t\t\tAssert.AreEqual(expectErrors, parser.HasErrors, errorOutput.ToString());\n\t\t\t\n\t\t\tEntityDeclaration m = members.Single();\n\t\t\tType type = typeof(T);\n\t\t\tAssert.IsTrue(type.IsAssignableFrom(m.GetType()), String.Format(\"Parsed member was {0} instead of {1} ({2})\", m.GetType(), type, m));\n\t\t\treturn (T)m;\n\t\t}\n\t\t\n\t\tpublic static void AssertTypeMember(string code, CSharp.EntityDeclaration expectedMember)\n\t\t{\n\t\t\tvar member = ParseTypeMember<CSharp.EntityDeclaration>(code);\n\t\t\tif (!expectedMember.IsMatch(member)) {\n\t\t\t\tAssert.Fail(\"Expected '{0}' but was '{1}'\", ToCSharp(expectedMember), ToCSharp(member));\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic static DocumentationReference ParseDocumentationReference(string cref, bool expectErrors = false)\n\t\t{\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tvar parsedExpression = parser.ParseDocumentationReference(cref);\n\t\t\t\n\t\t\tStringBuilder errorOutput = new StringBuilder();\n\t\t\tforeach (var error in parser.Errors)\n\t\t\t\terrorOutput.AppendLine (error.Message);\n\t\t\tAssert.AreEqual(expectErrors, parser.HasErrors, errorOutput.ToString());\n\t\t\t\n\t\t\tif (expectErrors && parsedExpression == null)\n\t\t\t\treturn null;\n\t\t\treturn parsedExpression;\n\t\t}\n\t\t\n\t\tpublic static void AssertDocumentationReference(string cref, CSharp.DocumentationReference expectedExpr)\n\t\t{\n\t\t\tvar expr = ParseDocumentationReference(cref);\n\t\t\tif (!expectedExpr.IsMatch(expr)) {\n\t\t\t\tAssert.Fail(\"Expected '{0}' but was '{1}'\", ToCSharp(expectedExpr), ToCSharp(expr));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic string ToCSharp(AstNode node)\n\t\t{\n\t\t\treturn node.ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/BlockStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class BlockStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void BlockStatementTest()\n\t\t{\n\t\t\tBlockStatement blockStmt = ParseUtilCSharp.ParseStatement<BlockStatement>(\"{}\");\n\t\t\tAssert.AreEqual(0, blockStmt.Statements.Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComplexBlockStatementPositionTest()\n\t\t{\n\t\t\tstring code = @\"{\n\tWebClient wc = new WebClient();\n\twc.Test();\n\twc.UploadStringCompleted += delegate {\n\t\toutput.BeginInvoke((MethodInvoker)delegate {\n\t\t                   \toutput.Text += newText;\n\t\t                   });\n\t};\n}\";\n\t\t\tBlockStatement blockStmt = ParseUtilCSharp.ParseStatement<BlockStatement>(code);\n// start column gets moved by ParseStatement\n//\t\t\tAssert.AreEqual(1, blockStmt.StartLocation.Column);\n\t\t\tAssert.AreEqual(1, blockStmt.StartLocation.Line);\n\t\t\tAssert.AreEqual(2, blockStmt.EndLocation.Column);\n\t\t\tAssert.AreEqual(9, blockStmt.EndLocation.Line);\n\t\t\t\n\t\t\tAssert.AreEqual(3, blockStmt.Statements.Count());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/CheckedStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class CheckedStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void CheckedStatementTest()\n\t\t{\n\t\t\tCheckedStatement checkedStatement = ParseUtilCSharp.ParseStatement<CheckedStatement>(\"checked { }\");\n\t\t\tAssert.IsFalse(checkedStatement.Body.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CheckedStatementAndExpressionTest()\n\t\t{\n\t\t\tCheckedStatement checkedStatement = ParseUtilCSharp.ParseStatement<CheckedStatement>(\"checked { checked(++i).ToString(); }\");\n\t\t\tExpressionStatement es = (ExpressionStatement)checkedStatement.Body.Statements.Single();\n\t\t\tCheckedExpression ce = (CheckedExpression)((MemberReferenceExpression)((InvocationExpression)es.Expression).Target).Target;\n\t\t\tAssert.IsTrue(ce.Expression is UnaryOperatorExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UncheckedStatementTest()\n\t\t{\n\t\t\tUncheckedStatement uncheckedStatement = ParseUtilCSharp.ParseStatement<UncheckedStatement>(\"unchecked { }\");\n\t\t\tAssert.IsFalse(uncheckedStatement.Body.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UncheckedStatementAndExpressionTest()\n\t\t{\n\t\t\tUncheckedStatement uncheckedStatement = ParseUtilCSharp.ParseStatement<UncheckedStatement>(\"unchecked { unchecked(++i).ToString(); }\");\n\t\t\tExpressionStatement es = (ExpressionStatement)uncheckedStatement.Body.Statements.Single();\n\t\t\tUncheckedExpression ce = (UncheckedExpression)((MemberReferenceExpression)((InvocationExpression)es.Expression).Target).Target;\n\t\t\tAssert.IsTrue(ce.Expression is UnaryOperatorExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/EmptyStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class EmptyStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void EmptyStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.ParseStatement<EmptyStatement>(\";\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/ExpressionStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class ExpressionStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void StatementExpressionTest()\n\t\t{\n\t\t\tExpressionStatement stmtExprStmt = ParseUtilCSharp.ParseStatement<ExpressionStatement>(\"a = my.Obj.PropCall;\");\n\t\t\tAssert.IsTrue(stmtExprStmt.Expression is AssignmentExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StatementExpressionTest1()\n\t\t{\n\t\t\tExpressionStatement stmtExprStmt = ParseUtilCSharp.ParseStatement<ExpressionStatement>(\"yield.yield();\");\n\t\t\tAssert.IsTrue(stmtExprStmt.Expression is InvocationExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/FixedStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class FixedStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void FixedStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"fixed (int* ptr = myIntArr) { }\",\n\t\t\t\tnew FixedStatement {\n\t\t\t\t\tType = new PrimitiveType(\"int\").MakePointerType(),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = \"ptr\",\n\t\t\t\t\t\t\tInitializer = new IdentifierExpression(\"myIntArr\")\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tEmbeddedStatement = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FixedStatementWithMultipleVariables()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"fixed (int* ptr1 = &myIntArr[1], ptr2 = myIntArr) { }\",\n\t\t\t\tnew FixedStatement {\n\t\t\t\t\tType = new PrimitiveType(\"int\").MakePointerType(),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = \"ptr1\",\n\t\t\t\t\t\t\tInitializer = new UnaryOperatorExpression(\n\t\t\t\t\t\t\t\tUnaryOperatorType.AddressOf, \n\t\t\t\t\t\t\t\tnew IndexerExpression { Target = new IdentifierExpression(\"myIntArr\"), Arguments = { new PrimitiveExpression(1) } })\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = \"ptr2\",\n\t\t\t\t\t\t\tInitializer = new IdentifierExpression(\"myIntArr\")\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tEmbeddedStatement = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/ForStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class ForStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void ForeachStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"foreach (int i in myColl) {} \",\n\t\t\t\tnew ForeachStatement {\n\t\t\t\t\tVariableType = new PrimitiveType(\"int\"),\n\t\t\t\t\tVariableName = \"i\",\n\t\t\t\t\tInExpression = new IdentifierExpression(\"myColl\"),\n\t\t\t\t\tEmbeddedStatement = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EmptyForStatementTest()\n\t\t{\n\t\t\tForStatement forStmt = ParseUtilCSharp.ParseStatement<ForStatement>(\"for (;;) ;\");\n\t\t\tAssert.AreEqual(0, forStmt.Initializers.Count());\n\t\t\tAssert.AreEqual(0, forStmt.Iterators.Count());\n\t\t\tAssert.IsTrue(forStmt.Condition.IsNull);\n\t\t\tAssert.IsTrue(forStmt.EmbeddedStatement is EmptyStatement);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ForStatementTest()\n\t\t{\n\t\t\tForStatement forStmt = ParseUtilCSharp.ParseStatement<ForStatement>(\"for (int i = 5; i < 6; ++i) {} \");\n\t\t\tvar init = (VariableDeclarationStatement)forStmt.Initializers.Single();\n\t\t\tAssert.AreEqual(\"i\", init.Variables.Single().Name);\n\t\t\t\n\t\t\tAssert.IsTrue(forStmt.Condition is BinaryOperatorExpression);\n\t\t\t\n\t\t\tvar inc = (ExpressionStatement)forStmt.Iterators.Single();\n\t\t\tAssert.IsTrue(inc.Expression is UnaryOperatorExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ForStatementTestMultipleInitializers()\n\t\t{\n\t\t\tForStatement forStmt = ParseUtilCSharp.ParseStatement<ForStatement>(\"for (i = 0, j = 1; i < 6; ++i) {} \");\n\t\t\tAssert.AreEqual(2, forStmt.Initializers.Count());\n\t\t\tAssert.IsTrue(forStmt.Iterators.All(i => i is ExpressionStatement));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ForStatementTestMultipleIterators()\n\t\t{\n\t\t\tForStatement forStmt = ParseUtilCSharp.ParseStatement<ForStatement>(\"for (int i = 5, j = 10; i < 6; ++i, j--) {} \");\n\t\t\tAssert.AreEqual(1, forStmt.Initializers.Count());\n\t\t\tAssert.AreEqual(2, ((VariableDeclarationStatement)forStmt.Initializers.Single()).Variables.Count());\n\t\t\tAssert.AreEqual(2, forStmt.Iterators.Count());\n\t\t\tAssert.IsTrue(forStmt.Iterators.All(i => i is ExpressionStatement));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/GotoStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class GotoStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void GotoStatementTest()\n\t\t{\n\t\t\tvar gotoStmt = ParseUtilCSharp.ParseStatement<GotoStatement>(\"goto myLabel;\");\n\t\t\tAssert.AreEqual(\"myLabel\", gotoStmt.Label);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GotoDefaultStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.ParseStatement<GotoDefaultStatement>(\"goto default;\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GotoCaseStatementTest()\n\t\t{\n\t\t\tvar gotoCaseStmt = ParseUtilCSharp.ParseStatement<GotoCaseStatement>(\"goto case 6;\");\n\t\t\tAssert.IsTrue(gotoCaseStmt.LabelExpression is PrimitiveExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BreakStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.ParseStatement<BreakStatement>(\"break;\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ContinueStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.ParseStatement<ContinueStatement>(\"continue;\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/IfElseStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class IfElseStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleIfStatementTest()\n\t\t{\n\t\t\tIfElseStatement ifElseStatement = ParseUtilCSharp.ParseStatement<IfElseStatement>(\"if (true) { }\");\n\t\t\tAssert.IsTrue(ifElseStatement.Condition is PrimitiveExpression);\n\t\t\tAssert.IsTrue(ifElseStatement.TrueStatement is BlockStatement);\n\t\t\tAssert.IsTrue(ifElseStatement.FalseStatement.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleIfElseStatementTest()\n\t\t{\n\t\t\tIfElseStatement ifElseStatement = ParseUtilCSharp.ParseStatement<IfElseStatement>(\"if (true) { } else { }\");\n\t\t\tAssert.IsTrue(ifElseStatement.Condition is PrimitiveExpression);\n\t\t\tAssert.IsTrue(ifElseStatement.TrueStatement is BlockStatement);\n\t\t\tAssert.IsTrue(ifElseStatement.FalseStatement is BlockStatement);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IfElseIfStatementTest()\n\t\t{\n\t\t\tIfElseStatement ifElseStatement = ParseUtilCSharp.ParseStatement<IfElseStatement>(\"if (1) { } else if (2) { } else if (3) { } else { }\");\n\t\t\tAssert.IsTrue(ifElseStatement.Condition is PrimitiveExpression);\n\t\t\tAssert.IsTrue(ifElseStatement.TrueStatement is BlockStatement);\n\t\t\tAssert.IsTrue(ifElseStatement.FalseStatement is IfElseStatement);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/InvalidStatementsTests.cs",
    "content": "//\n// InvalidStatementTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Parser;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class InvalidStatementsTests\n\t{\n\n\t\t[Test]\n\t\tpublic void AsExpressionStatementPositions()\n\t\t{\n\t\t\tExpressionStatement expr = ParseUtilCSharp.ParseStatement<ExpressionStatement>(\"\\t\\t\\\"\\\" as IEnumerable<char>;\", false);\n\t\t\tAssert.AreEqual(new TextLocation(1, 3), expr.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(1, 27), expr.EndLocation);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/LabelStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class LabelStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void LabelStatementTest()\n\t\t{\n\t\t\tBlockStatement block = ParseUtilCSharp.ParseStatement<BlockStatement>(\"{ myLabel: ; }\");\n\t\t\tLabelStatement labelStmt = (LabelStatement)block.Statements.First();\n\t\t\tAssert.AreEqual(\"myLabel\", labelStmt.Label);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Label2StatementTest()\n\t\t{\n\t\t\tBlockStatement block = ParseUtilCSharp.ParseStatement<BlockStatement>(\"{ yield: ; }\");\n\t\t\tLabelStatement labelStmt = (LabelStatement)block.Statements.First();\n\t\t\tAssert.AreEqual(\"yield\", labelStmt.Label);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/LockStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class LockStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void LockStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.ParseStatement<LockStatement>(\"lock (myObj) {}\");\n\t\t\t// TODO : Extend test.\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/ReturnStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class ReturnStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void EmptyReturnStatementTest()\n\t\t{\n\t\t\tReturnStatement returnStatement = ParseUtilCSharp.ParseStatement<ReturnStatement>(\"return;\");\n\t\t\tAssert.IsTrue(returnStatement.Expression.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ReturnStatementTest()\n\t\t{\n\t\t\tReturnStatement returnStatement = ParseUtilCSharp.ParseStatement<ReturnStatement>(\"return 5;\");\n\t\t\tAssert.IsTrue(returnStatement.Expression is PrimitiveExpression);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ReturnStatementTest1()\n\t\t{\n\t\t\tReturnStatement returnStatement = ParseUtilCSharp.ParseStatement<ReturnStatement>(\"return yield;\");\n\t\t\tAssert.IsTrue(returnStatement.Expression is IdentifierExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/SwitchStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class SwitchStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void SwitchStatementTest()\n\t\t{\n\t\t\tSwitchStatement switchStmt = ParseUtilCSharp.ParseStatement<SwitchStatement>(\"switch (a) { case 4: case 5: break; case 6: break; default: break; }\");\n\t\t\tAssert.AreEqual(\"a\", ((IdentifierExpression)switchStmt.Expression).Identifier);\n\t\t\t// TODO: Extend test\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/ThrowStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class ThrowStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void EmptyThrowStatementTest()\n\t\t{\n\t\t\tThrowStatement throwStmt = ParseUtilCSharp.ParseStatement<ThrowStatement>(\"throw;\");\n\t\t\tAssert.IsTrue(throwStmt.Expression.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ThrowStatementTest()\n\t\t{\n\t\t\tThrowStatement throwStmt = ParseUtilCSharp.ParseStatement<ThrowStatement>(\"throw new Exception();\");\n\t\t\tAssert.IsTrue(throwStmt.Expression is ObjectCreateExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/TryCatchStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class TryCatchStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleTryCatchStatementTest()\n\t\t{\n\t\t\tTryCatchStatement tryCatchStatement = ParseUtilCSharp.ParseStatement<TryCatchStatement>(\"try { } catch { } \");\n\t\t\tAssert.IsTrue(tryCatchStatement.FinallyBlock.IsNull);\n\t\t\tAssert.AreEqual(1, tryCatchStatement.CatchClauses.Count());\n\t\t\tAssert.IsTrue(tryCatchStatement.CatchClauses.Single().Type.IsNull);\n\t\t\tAssert.AreEqual(string.Empty, tryCatchStatement.CatchClauses.Single().VariableName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleTryCatchStatementTest2()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"try { } catch (Exception e) { } \",\n\t\t\t\tnew TryCatchStatement {\n\t\t\t\t\tTryBlock = new BlockStatement(),\n\t\t\t\t\tCatchClauses = {\n\t\t\t\t\t\tnew CatchClause {\n\t\t\t\t\t\t\tType = new SimpleType(\"Exception\"),\n\t\t\t\t\t\t\tVariableName = \"e\",\n\t\t\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleTryCatchFinallyStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"try { } catch (Exception) { } catch { } finally { } \",\n\t\t\t\tnew TryCatchStatement {\n\t\t\t\t\tTryBlock = new BlockStatement(),\n\t\t\t\t\tCatchClauses = {\n\t\t\t\t\t\tnew CatchClause {\n\t\t\t\t\t\t\tType = new SimpleType(\"Exception\"),\n\t\t\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew CatchClause { Body = new BlockStatement() }\n\t\t\t\t\t},\n\t\t\t\t\tFinallyBlock = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestEmptyFinallyDoesNotMatchNullFinally()\n\t\t{\n\t\t\tTryCatchStatement c1 = new TryCatchStatement {\n\t\t\t\tTryBlock = new BlockStatement(),\n\t\t\t\tCatchClauses = { new CatchClause { Body = new BlockStatement() } }\n\t\t\t};\n\t\t\tTryCatchStatement c2 = new TryCatchStatement {\n\t\t\t\tTryBlock = new BlockStatement(),\n\t\t\t\tCatchClauses = { new CatchClause { Body = new BlockStatement() } },\n\t\t\t\tFinallyBlock = new BlockStatement()\n\t\t\t};\n\t\t\tAssert.IsFalse(c1.IsMatch(c2));\n\t\t\tAssert.IsFalse(c2.IsMatch(c1)); // and vice versa\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CommentBeforeTryCatchFinally()\n\t\t{\n\t\t\tvar stmt = ParseUtilCSharp.ParseStatement<BlockStatement>(\n@\"{\n\t//Comment before\n\ttry { } catch { } finally { }\n\t//Comment after\n}\");\n\t\t\tvar children = stmt.Children.Where (c => c.Role != Roles.NewLine).ToList();\n\t\t\tAssert.That(children.Count, Is.EqualTo(5));\n\t\t\tAssert.That(children[0].Role, Is.EqualTo(Roles.LBrace));\n\t\t\tAssert.That(children[1].Role, Is.EqualTo(Roles.Comment));\n\t\t\tAssert.That(children[2].Role, Is.EqualTo(BlockStatement.StatementRole));\n\t\t\tAssert.That(children[3].Role, Is.EqualTo(Roles.Comment));\n\t\t\tAssert.That(children[4].Role, Is.EqualTo(Roles.RBrace));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/UnsafeStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class UnsafeStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void UnsafeStatementTest()\n\t\t{\n\t\t\tUnsafeStatement unsafeStatement = ParseUtilCSharp.ParseStatement<UnsafeStatement>(\"unsafe { }\");\n\t\t\tAssert.IsFalse(unsafeStatement.Body.IsNull);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/UsingStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class UsingStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void UsingStatementWithVariableDeclaration()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"using (MyVar var = new MyVar()) { }\",\n\t\t\t\tnew UsingStatement {\n\t\t\t\t\tResourceAcquisition = new VariableDeclarationStatement(\n\t\t\t\t\t\tnew SimpleType(\"MyVar\"),\n\t\t\t\t\t\t\"var\",\n\t\t\t\t\t\tnew ObjectCreateExpression(new SimpleType(\"MyVar\"))),\n\t\t\t\t\tEmbeddedStatement = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UsingStatementWithMultipleVariableDeclaration()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"using (MyVar a = new MyVar(), b = null);\",\n\t\t\t\tnew UsingStatement {\n\t\t\t\t\tResourceAcquisition = new VariableDeclarationStatement {\n\t\t\t\t\t\tType = new SimpleType(\"MyVar\"),\n\t\t\t\t\t\tVariables = {\n\t\t\t\t\t\t\tnew VariableInitializer(\"a\", new ObjectCreateExpression(new SimpleType(\"MyVar\"))),\n\t\t\t\t\t\t\tnew VariableInitializer(\"b\", new NullReferenceExpression())\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tEmbeddedStatement = new EmptyStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\tpublic void UsingStatementWithExpression()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"using (MyVar var = new MyVar()) { }\",\n\t\t\t\tnew UsingStatement {\n\t\t\t\t\tResourceAcquisition = new ObjectCreateExpression(new SimpleType(\"MyVar\")),\n\t\t\t\t\tEmbeddedStatement = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/VariableDeclarationStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.PatternMatching;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class VariableDeclarationStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void VariableDeclarationStatementTest()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"int a = 5;\");\n\t\t\tAssert.AreEqual(1, lvd.Variables.Count());\n\t\t\tAssert.AreEqual(\"a\", lvd.Variables.First ().Name);\n\t\t\tvar type = lvd.Type;\n\t\t\tAssert.AreEqual(\"int\", type.ToString ());\n\t\t\tAssert.AreEqual(5, ((PrimitiveExpression)lvd.Variables.First ().Initializer).Value);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidPointerVariableDeclarationTest()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"void *a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new PrimitiveType(\"void\").MakePointerType(), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComplexGenericVariableDeclarationStatementTest()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"Generic<Namespace.Printable, G<Printable[]> > where = new Generic<Namespace.Printable, G<Printable[]>>();\");\n\t\t\tAstType type = new SimpleType(\"Generic\") {\n\t\t\t\tTypeArguments = {\n\t\t\t\t\tnew MemberType { Target = new SimpleType(\"Namespace\"), MemberName = \"Printable\" },\n\t\t\t\t\tnew SimpleType(\"G\") { TypeArguments = { new SimpleType(\"Printable\").MakeArrayType() } }\n\t\t\t\t}};\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"where\", new ObjectCreateExpression { Type = type.Clone() }).IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedGenericVariableDeclarationStatementTest()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"MyType<string>.InnerClass<int>.InnerInnerClass a;\");\n\t\t\tAstType type = new MemberType {\n\t\t\t\tTarget = new MemberType {\n\t\t\t\t\tTarget = new SimpleType(\"MyType\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\tMemberName = \"InnerClass\",\n\t\t\t\t\tTypeArguments = { new PrimitiveType(\"int\") }\n\t\t\t\t},\n\t\t\t\tMemberName = \"InnerInnerClass\"\n\t\t\t};\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericWithArrayVariableDeclarationStatementTest1()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"G<int>[] a;\");\n\t\t\tAstType type = new SimpleType(\"G\") {\n\t\t\t\tTypeArguments = { new PrimitiveType(\"int\") }\n\t\t\t}.MakeArrayType();\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericWithArrayVariableDeclarationStatementTest2()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"G<int[]> a;\");\n\t\t\tAstType type = new SimpleType(\"G\") {\n\t\t\t\tTypeArguments = { new PrimitiveType(\"int\").MakeArrayType() }\n\t\t\t};\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericVariableDeclarationStatementTest2()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"G<G<int> > a;\");\n\t\t\tAstType type = new SimpleType(\"G\") {\n\t\t\t\tTypeArguments = {\n\t\t\t\t\tnew SimpleType(\"G\") { TypeArguments = { new PrimitiveType(\"int\") } }\n\t\t\t\t}\n\t\t\t};\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericVariableDeclarationStatementTest2WithoutSpace()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"G<G<int>> a;\");\n\t\t\tAstType type = new SimpleType(\"G\") {\n\t\t\t\tTypeArguments = {\n\t\t\t\t\tnew SimpleType(\"G\") { TypeArguments = { new PrimitiveType(\"int\") } }\n\t\t\t\t}\n\t\t\t};\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericVariableDeclarationStatementTest()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"G<int> a;\");\n\t\t\tAstType type = new SimpleType(\"G\") {\n\t\t\t\tTypeArguments = { new PrimitiveType(\"int\") }\n\t\t\t};\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleVariableDeclarationStatementTest()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"MyVar var = new MyVar();\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"MyVar\"), \"var\", new ObjectCreateExpression { Type = new SimpleType(\"MyVar\") }).IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleVariableDeclarationStatementTest1()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"yield yield = new yield();\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"yield\"), \"yield\", new ObjectCreateExpression { Type = new SimpleType(\"yield\") }).IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableVariableDeclarationStatementTest1()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"int? a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new PrimitiveType(\"int\").MakeNullableType(), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableVariableDeclarationStatementTest2()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"DateTime? a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"DateTime\").MakeNullableType(), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"The parser creates nested ComposedTypes while MakeArrayType() adds the specifier to the existing ComposedType\")]\n\t\tpublic void NullableVariableDeclarationStatementTest3()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"DateTime?[] a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"DateTime\").MakeNullableType().MakeArrayType(), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableVariableDeclarationStatementTest4()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"SomeStruct<int?>? a;\");\n\t\t\tAstType type = new SimpleType(\"SomeStruct\") {\n\t\t\t\tTypeArguments = { new PrimitiveType(\"int\").MakeNullableType() }\n\t\t\t}.MakeNullableType();\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(type, \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PositionTestWithoutModifier()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"\\ndouble w = 7;\");\n\t\t\tAssert.AreEqual(2, lvd.StartLocation.Line);\n\t\t\tAssert.AreEqual(1, lvd.StartLocation.Column);\n\t\t\tAssert.AreEqual(2, lvd.EndLocation.Line);\n\t\t\tAssert.AreEqual(14, lvd.EndLocation.Column);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PositionTestWithModifier()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"\\nconst double w = 7;\");\n\t\t\tAssert.AreEqual(Modifiers.Const, lvd.Modifiers);\n\t\t\tAssert.AreEqual(2, lvd.StartLocation.Line);\n\t\t\tAssert.AreEqual(1, lvd.StartLocation.Column);\n\t\t\tAssert.AreEqual(2, lvd.EndLocation.Line);\n\t\t\tAssert.AreEqual(20, lvd.EndLocation.Column);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedArray()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"DateTime[,][] a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"DateTime\").MakeArrayType(1).MakeArrayType(2), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedPointers()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"DateTime*** a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"DateTime\").MakePointerType().MakePointerType().MakePointerType(), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"The parser creates nested ComposedTypes while MakeArrayType() adds the specifier to the existing ComposedType\")]\n\t\tpublic void ArrayOfPointers()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"DateTime*[] a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"DateTime\").MakePointerType().MakeArrayType(), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"The parser creates nested ComposedTypes while MakeArrayType() adds the specifier to the existing ComposedType\")]\n\t\tpublic void ArrayOfNullables()\n\t\t{\n\t\t\tVariableDeclarationStatement lvd = ParseUtilCSharp.ParseStatement<VariableDeclarationStatement>(\"DateTime?[] a;\");\n\t\t\tAssert.IsTrue(new VariableDeclarationStatement(new SimpleType(\"DateTime\").MakeNullableType().MakeArrayType(), \"a\").IsMatch(lvd));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Global()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"global::System.String a;\",\n\t\t\t\tnew VariableDeclarationStatement {\n\t\t\t\t\tType = new MemberType {\n\t\t\t\t\t\tTarget = new MemberType {\n\t\t\t\t\t\t\tTarget = new SimpleType(\"global\"),\n\t\t\t\t\t\t\tIsDoubleColon = true,\n\t\t\t\t\t\t\tMemberName = \"System\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tIsDoubleColon = false,\n\t\t\t\t\t\tMemberName = \"String\",\n\t\t\t\t\t},\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer(\"a\")\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayDeclarationWithInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertStatement(\n\t\t\t\t\"int[] a = { 0 };\",\n\t\t\t\tnew VariableDeclarationStatement {\n\t\t\t\t\tType = new PrimitiveType(\"int\").MakeArrayType(),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = \"a\",\n\t\t\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = { new PrimitiveExpression(0) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/WhileStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class WhileStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void WhileStatementTest()\n\t\t{\n\t\t\tWhileStatement loopStmt = ParseUtilCSharp.ParseStatement<WhileStatement>(\"while (true) { }\");\n\t\t\tAssert.IsTrue(loopStmt.Condition is PrimitiveExpression);\n\t\t\tAssert.IsTrue(loopStmt.EmbeddedStatement is BlockStatement);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoWhileStatementTest()\n\t\t{\n\t\t\tDoWhileStatement loopStmt = ParseUtilCSharp.ParseStatement<DoWhileStatement>(\"do { } while (true);\");\n\t\t\tAssert.IsTrue(loopStmt.Condition is PrimitiveExpression);\n\t\t\tAssert.IsTrue(loopStmt.EmbeddedStatement is BlockStatement);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/YieldStatementTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.Statements\n{\n\t[TestFixture]\n\tpublic class YieldStatementTests\n\t{\n\t\t[Test]\n\t\tpublic void YieldReturnStatementTest()\n\t\t{\n\t\t\tYieldReturnStatement yieldStmt = ParseUtilCSharp.ParseStatement<YieldReturnStatement>(\"yield return \\\"Foo\\\";\");\n\t\t\tPrimitiveExpression expr =  (PrimitiveExpression)yieldStmt.Expression;\n\t\t\tAssert.AreEqual(\"Foo\", expr.Value);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void YieldBreakStatementTest()\n\t\t{\n\t\t\tParseUtilCSharp.ParseStatement<YieldBreakStatement>(\"yield break;\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void YieldAsVariableTest()\n\t\t{\n\t\t\tExpressionStatement se = ParseUtilCSharp.ParseStatement<ExpressionStatement>(\"yield = 3;\");\n\t\t\tAssignmentExpression ae = se.Expression as AssignmentExpression;\n\t\t\t\n\t\t\tAssert.AreEqual(AssignmentOperatorType.Assign, ae.Operator);\n\t\t\t\n\t\t\tAssert.IsTrue(ae.Left is IdentifierExpression);\n\t\t\tAssert.AreEqual(\"yield\", ((IdentifierExpression)ae.Left).Identifier);\n\t\t\tAssert.IsTrue(ae.Right is PrimitiveExpression);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/ConstructorDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class ConstructorDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void ConstructorDeclarationTest1()\n\t\t{\n\t\t\tConstructorDeclaration cd = ParseUtilCSharp.ParseTypeMember<ConstructorDeclaration>(\"MyClass() {}\");\n\t\t\tAssert.IsTrue(cd.Initializer.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstructorDeclarationTest2()\n\t\t{\n\t\t\tConstructorDeclaration cd = ParseUtilCSharp.ParseTypeMember<ConstructorDeclaration>(\"MyClass() : this(5) {}\");\n\t\t\tAssert.AreEqual(ConstructorInitializerType.This, cd.Initializer.ConstructorInitializerType);\n\t\t\tAssert.AreEqual(1, cd.Initializer.Arguments.Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstructorDeclarationTest3()\n\t\t{\n\t\t\tConstructorDeclaration cd = ParseUtilCSharp.ParseTypeMember<ConstructorDeclaration>(\"MyClass() : base(1, 2, 3) {}\");\n\t\t\tAssert.AreEqual(ConstructorInitializerType.Base, cd.Initializer.ConstructorInitializerType);\n\t\t\tAssert.AreEqual(3, cd.Initializer.Arguments.Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticConstructorDeclarationTest1()\n\t\t{\n\t\t\tConstructorDeclaration cd = ParseUtilCSharp.ParseTypeMember<ConstructorDeclaration>(\"static MyClass() {}\");\n\t\t\tAssert.IsTrue(cd.Initializer.IsNull);\n\t\t\tAssert.AreEqual(Modifiers.Static, cd.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExternStaticConstructorDeclarationTest()\n\t\t{\n\t\t\tConstructorDeclaration cd = ParseUtilCSharp.ParseTypeMember<ConstructorDeclaration>(\"extern static MyClass();\");\n\t\t\tAssert.IsTrue(cd.Initializer.IsNull);\n\t\t\tAssert.AreEqual(Modifiers.Static | Modifiers.Extern, cd.Modifiers);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/DestructorDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class DestructorDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void DestructorDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.ParseTypeMember<DestructorDeclaration>(\"~MyClass() {}\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExternDestructorDeclarationTest()\n\t\t{\n\t\t\tDestructorDeclaration dd = ParseUtilCSharp.ParseTypeMember<DestructorDeclaration>(\"extern ~MyClass();\");\n\t\t\tAssert.AreEqual(Modifiers.Extern, dd.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnsafeDestructorDeclarationTest()\n\t\t{\n\t\t\tDestructorDeclaration dd = ParseUtilCSharp.ParseTypeMember<DestructorDeclaration>(\"unsafe ~MyClass() {}\");\n\t\t\tAssert.AreEqual(Modifiers.Unsafe, dd.Modifiers);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/EventDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class EventDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleEventDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"event EventHandler MyEvent;\",\n\t\t\t\tnew EventDeclaration {\n\t\t\t\t\tReturnType = new SimpleType(\"EventHandler\"),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = \"MyEvent\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleEventDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"public event EventHandler A = null, B = delegate {};\",\n\t\t\t\tnew EventDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\tReturnType = new SimpleType(\"EventHandler\"),\n\t\t\t\tVariables = {\n\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\tName = \"A\",\n\t\t\t\t\t\tInitializer = new NullReferenceExpression()\n\t\t\t\t\t},\n\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\tName = \"B\",\n\t\t\t\t\t\tInitializer = new AnonymousMethodExpression() { Body = new BlockStatement ()}\n\t\t\t\t\t}\n\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddRemoveEventDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"public event System.EventHandler MyEvent { add { } remove { } }\",\n\t\t\t\tnew CustomEventDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tReturnType = new MemberType {\n\t\t\t\t\t\tTarget = new SimpleType(\"System\"),\n\t\t\t\t\t\tMemberName = \"EventHandler\"\n\t\t\t\t\t},\n\t\t\t\t\tName = \"MyEvent\",\n\t\t\t\tAddAccessor = new Accessor { Body = new BlockStatement() },\n\t\t\t\tRemoveAccessor = new Accessor { Body = new BlockStatement() }\n\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EventImplementingGenericInterfaceDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"event EventHandler MyInterface<string>.MyEvent { add { } [Attr] remove {} }\",\n\t\t\t\tnew CustomEventDeclaration {\n\t\t\t\t\tReturnType = new SimpleType(\"EventHandler\"),\n\t\t\t\t\tPrivateImplementationType = new SimpleType{\n\t\t\t\t\t\tIdentifier = \"MyInterface\",\n\t\t\t\t\t\tTypeArguments = { new PrimitiveType(\"string\") }\n\t\t\t\t\t},\n\t\t\t\t\tName = \"MyEvent\",\n\t\t\t\t\tAddAccessor = new Accessor { Body = new BlockStatement() },\n\t\t\t\t\tRemoveAccessor = new Accessor {\n\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\tnew AttributeSection {\n\t\t\t\t\t\t\t\tAttributes = {\n\t\t\t\t\t\t\t\t\tnew Attribute { Type = new SimpleType(\"Attr\") }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/FieldDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class FieldDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleFieldDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"int[,,,] myField;\",\n\t\t\t\tnew FieldDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\").MakeArrayType(4),\n\t\t\t\t\tVariables = { new VariableInitializer(\"myField\") }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleFieldDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"int a = 1, b = 2;\",\n\t\t\t\tnew FieldDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer(\"a\", new PrimitiveExpression(1)),\n\t\t\t\t\t\tnew VariableInitializer(\"b\", new PrimitiveExpression(2)),\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FieldWithArrayInitializer()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"public static readonly int[] arr = { 1, 2, 3 };\",\n\t\t\t\tnew FieldDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Public | Modifiers.Static | Modifiers.Readonly,\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\").MakeArrayType(),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew VariableInitializer {\n\t\t\t\t\t\t\tName = \"arr\",\n\t\t\t\t\t\t\tInitializer = new ArrayInitializerExpression {\n\t\t\t\t\t\t\t\tElements = {\n\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(1),\n\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(2),\n\t\t\t\t\t\t\t\t\tnew PrimitiveExpression(3)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FieldWithFixedSize()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"public unsafe fixed int Field[100];\",\n\t\t\t\tnew FixedFieldDeclaration() {\n\t\t\t\t\tModifiers =  Modifiers.Public | Modifiers.Unsafe,\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tVariables = {\n\t\t\t\t\t\tnew FixedVariableInitializer {\n\t\t\t\t\t\t\tName = \"Field\",\n\t\t\t\t\t\t\tCountExpression = new PrimitiveExpression(100)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/IndexerDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class IndexerDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void IndexerDeclarationTest()\n\t\t{\n\t\t\tIndexerDeclaration id = ParseUtilCSharp.ParseTypeMember<IndexerDeclaration>(\"public int this[int a, string b] { get { } protected set { } }\");\n\t\t\tAssert.AreEqual(2, id.Parameters.Count());\n\t\t\tAssert.IsNotNull(id.Getter, \"No get region found!\");\n\t\t\tAssert.IsNotNull(id.Setter, \"No set region found!\");\n\t\t\tAssert.AreEqual(Modifiers.Public, id.Modifiers);\n\t\t\tAssert.AreEqual(Modifiers.None, id.Getter.Modifiers);\n\t\t\tAssert.AreEqual(Modifiers.Protected, id.Setter.Modifiers);\n\t\t\tAssert.AreEqual(\"Item\", id.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ThisTokenPosition()\n\t\t{\n\t\t\tIndexerDeclaration id = ParseUtilCSharp.ParseTypeMember<IndexerDeclaration>(\"public int this[int a] { get { } protected set { } }\");\n\t\t\tCSharpTokenNode thisKeyword = id.GetChildByRole(IndexerDeclaration.ThisKeywordRole);\n\t\t\tAssert.AreEqual(12, thisKeyword.StartLocation.Column);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexerImplementingInterfaceTest()\n\t\t{\n\t\t\tIndexerDeclaration id = ParseUtilCSharp.ParseTypeMember<IndexerDeclaration>(\"int MyInterface.this[int a, string b] { get { } set { } }\");\n\t\t\tAssert.AreEqual(2, id.Parameters.Count());\n\t\t\tAssert.IsNotNull(id.Getter, \"No get region found!\");\n\t\t\tAssert.IsNotNull(id.Setter, \"No set region found!\");\n\t\t\t\n\t\t\tAssert.AreEqual(\"MyInterface\", ((SimpleType)id.PrivateImplementationType).Identifier);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexerImplementingGenericInterfaceTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"int MyInterface<string>.this[int a, string b] { get { } [Attr] set { } }\",\n\t\t\t\tnew IndexerDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tPrivateImplementationType = new SimpleType {\n\t\t\t\t\t\tIdentifier = \"MyInterface\",\n\t\t\t\t\t\tTypeArguments = { new PrimitiveType(\"string\") }\n\t\t\t\t\t},\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration(new PrimitiveType(\"int\"), \"a\"),\n\t\t\t\t\t\tnew ParameterDeclaration(new PrimitiveType(\"string\"), \"b\")\n\t\t\t\t\t},\n\t\t\t\t\tGetter = new Accessor { Body = new BlockStatement() },\n\t\t\t\t\tSetter = new Accessor {\n\t\t\t\t\t\tAttributes = { new AttributeSection(new Attribute { Type = new SimpleType(\"Attr\") }) },\n\t\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t\t}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/MethodDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class MethodDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleMethodDeclarationTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\"void MyMethod() {} \");\n\t\t\tAssert.AreEqual(\"void\", ((PrimitiveType)md.ReturnType).Keyword);\n\t\t\tAssert.AreEqual(0, md.Parameters.Count());\n\t\t\tAssert.IsFalse(md.IsExtensionMethod);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AbstractMethodDeclarationTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\"abstract void MyMethod();\");\n\t\t\tAssert.AreEqual(\"void\", ((PrimitiveType)md.ReturnType).Keyword);\n\t\t\tAssert.AreEqual(0, md.Parameters.Count());\n\t\t\tAssert.IsFalse(md.IsExtensionMethod);\n\t\t\tAssert.IsTrue(md.Body.IsNull);\n\t\t\tAssert.AreEqual(Modifiers.Abstract, md.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefiningPartialMethodDeclarationTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\"partial void MyMethod();\");\n\t\t\tAssert.AreEqual(\"void\", ((PrimitiveType)md.ReturnType).Keyword);\n\t\t\tAssert.AreEqual(0, md.Parameters.Count());\n\t\t\tAssert.IsFalse(md.IsExtensionMethod);\n\t\t\tAssert.IsTrue(md.Body.IsNull);\n\t\t\tAssert.AreEqual(Modifiers.Partial, md.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplementingPartialMethodDeclarationTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\"partial void MyMethod() { }\");\n\t\t\tAssert.AreEqual(\"void\", ((PrimitiveType)md.ReturnType).Keyword);\n\t\t\tAssert.AreEqual(0, md.Parameters.Count());\n\t\t\tAssert.IsFalse(md.IsExtensionMethod);\n\t\t\tAssert.IsFalse(md.Body.IsNull);\n\t\t\tAssert.AreEqual(Modifiers.Partial, md.Modifiers);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleMethodRegionTest()\n\t\t{\n\t\t\tconst string program = @\"\n\t\tvoid MyMethod()\n\t\t{\n\t\t\tOtherMethod();\n\t\t}\n\";\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(program);\n\t\t\tAssert.AreEqual(2, md.StartLocation.Line, \"StartLocation.Y\");\n\t\t\tAssert.AreEqual(5, md.EndLocation.Line, \"EndLocation.Y\");\n\t\t\tAssert.AreEqual(3, md.StartLocation.Column, \"StartLocation.X\");\n\t\t\tAssert.AreEqual(4, md.EndLocation.Column, \"EndLocation.X\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithModifiersRegionTest()\n\t\t{\n\t\t\tconst string program = @\"\n\t\tpublic static void MyMethod()\n\t\t{\n\t\t\tOtherMethod();\n\t\t}\n\";\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(program);\n\t\t\tAssert.AreEqual(2, md.StartLocation.Line, \"StartLocation.Y\");\n\t\t\tAssert.AreEqual(5, md.EndLocation.Line, \"EndLocation.Y\");\n\t\t\tAssert.AreEqual(3, md.StartLocation.Column, \"StartLocation.X\");\n\t\t\tAssert.AreEqual(4, md.EndLocation.Column, \"EndLocation.X\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithUnnamedParameterDeclarationTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\"void MyMethod(int) {} \", true);\n\t\t\tAssert.AreEqual(\"void\", md.ReturnType.ToString ());\n\t\t\tAssert.AreEqual(1, md.Parameters.Count());\n\t\t\tAssert.AreEqual(\"int\", ((PrimitiveType)md.Parameters.Single().Type).Keyword);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericVoidMethodDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"void MyMethod<T>(T a) {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } },\n\t\t\t\t\tParameters = { new ParameterDeclaration(new SimpleType(\"T\"), \"a\") },\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodDeclarationTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"T MyMethod<T>(T a) {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new SimpleType(\"T\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } },\n\t\t\t\t\tParameters = { new ParameterDeclaration(new SimpleType(\"T\"), \"a\") },\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodDeclarationWithConstraintTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"T MyMethod<T>(T a) where T : ISomeInterface {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new SimpleType(\"T\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } },\n\t\t\t\t\tParameters = { new ParameterDeclaration(new SimpleType(\"T\"), \"a\") },\n\t\t\t\t\tConstraints = {\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"T\"),\n\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"ISomeInterface\") }\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodWithTwoConstraints()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"void MyMethod<A, B>() where A : IA where B : IB {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tTypeParameters = {\n\t\t\t\t\t\tnew TypeParameterDeclaration { Name = \"A\" },\n\t\t\t\t\t\tnew TypeParameterDeclaration { Name = \"B\" }\n\t\t\t\t\t},\n\t\t\t\t\tConstraints = {\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType(\"A\"),\n\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"IA\") }\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType(\"B\"),\n\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"IB\") }\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodDeclarationWithThreeConstraintsTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"A MyMethod<A, B, C>() where B : BB where A : BA, IA where C : class {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new SimpleType(\"A\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tTypeParameters = {\n\t\t\t\t\t\tnew TypeParameterDeclaration { Name = \"A\" },\n\t\t\t\t\t\tnew TypeParameterDeclaration { Name = \"B\" },\n\t\t\t\t\t\tnew TypeParameterDeclaration { Name = \"C\" }\n\t\t\t\t\t},\n\t\t\t\t\tConstraints = {\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"B\"),\n\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"BB\") }\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"A\"),\n\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"BA\"), new SimpleType(\"IA\") }\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"C\"),\n\t\t\t\t\t\t\tBaseTypes = { new PrimitiveType(\"class\") }\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodInInterface()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t@\"interface MyInterface {\n\tT MyMethod<T>(T a) where T : ISomeInterface;\n}\n\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Interface,\n\t\t\t\t\tName = \"MyInterface\",\n\t\t\t\t\tMembers = {\n\t\t\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\t\t\tReturnType = new SimpleType(\"T\"),\n\t\t\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } },\n\t\t\t\t\t\t\tParameters = { new ParameterDeclaration(new SimpleType(\"T\"), \"a\") },\n\t\t\t\t\t\t\tConstraints = {\n\t\t\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"T\"),\n\t\t\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"ISomeInterface\") }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericVoidMethodInInterface()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal(\n\t\t\t\t@\"interface MyInterface {\n\tvoid MyMethod<T>(T a) where T : ISomeInterface;\n}\n\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Interface,\n\t\t\t\t\tName = \"MyInterface\",\n\t\t\t\t\tMembers = {\n\t\t\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\t\t\tTypeParameters = { new TypeParameterDeclaration { Name = \"T\" } },\n\t\t\t\t\t\t\tParameters = { new ParameterDeclaration(new SimpleType(\"T\"), \"a\") },\n\t\t\t\t\t\t\tConstraints = {\n\t\t\t\t\t\t\t\tnew Constraint {\n\t\t\t\t\t\t\t\t\tTypeParameter = new SimpleType (\"T\"),\n\t\t\t\t\t\t\t\t\tBaseTypes = { new SimpleType(\"ISomeInterface\") }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShadowingMethodInInterface ()\n\t\t{\n\t\t\tParseUtilCSharp.AssertGlobal (\n\t\t\t\t@\"interface MyInterface : IDisposable {\n\tnew void Dispose();\n}\n\",\n\t\t\t\tnew TypeDeclaration {\n\t\t\t\t\tClassType = ClassType.Interface,\n\t\t\t\t\tName = \"MyInterface\",\n\t\t\t\t\tBaseTypes = { new SimpleType(\"IDisposable\") },\n\t\t\t\t\tMembers = {\n\t\t\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\t\t\tModifiers = Modifiers.New,\n\t\t\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\t\t\tName = \"Dispose\"\n\t\t\t\t\t\t}}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodImplementingInterfaceTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"int MyInterface.MyMethod() {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tPrivateImplementationType = new SimpleType(\"MyInterface\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodImplementingGenericInterfaceTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"int MyInterface<string>.MyMethod() {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tPrivateImplementationType = new SimpleType(\"MyInterface\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidMethodImplementingInterfaceTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember (\n\t\t\t\t\"void MyInterface.MyMethod() {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tPrivateImplementationType = new SimpleType(\"MyInterface\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidMethodImplementingGenericInterfaceTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember (\n\t\t\t\t\"void MyInterface<string>.MyMethod() {} \",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tPrivateImplementationType = new SimpleType(\"MyInterface\") { TypeArguments = { new PrimitiveType(\"string\") } },\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IncompleteConstraintsTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\n\t\t\t\t\"void a<T>() where T { }\", true // expect errors\n\t\t\t);\n\t\t\tAssert.AreEqual(\"a\", md.Name);\n\t\t\tAssert.AreEqual(1, md.TypeParameters.Count);\n\t\t\tAssert.AreEqual(\"T\", md.TypeParameters.Single().Name);\n\t\t\tAssert.AreEqual(1, md.Constraints.Count());\n\t\t\tAssert.AreEqual(0, md.Constraints.First ().BaseTypes.Count());\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExtensionMethodTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\n\t\t\t\t\"public static int ToInt32(this string s) { return int.Parse(s); }\"\n\t\t\t);\n\t\t\tAssert.AreEqual(\"ToInt32\", md.Name);\n\t\t\tAssert.AreEqual(\"s\", md.Parameters.First().Name);\n\t\t\tAssert.AreEqual(ParameterModifier.This, md.Parameters.First().ParameterModifier);\n\t\t\tAssert.AreEqual(\"string\", ((PrimitiveType)md.Parameters.First().Type).Keyword);\n\t\t\tAssert.IsTrue(md.IsExtensionMethod);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExtensionMethodWithAttributeTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\n\t\t\t\t\"public static int ToInt32([Attr] this string s) { return int.Parse(s); }\"\n\t\t\t);\n\t\t\tAssert.AreEqual(\"ToInt32\", md.Name);\n\t\t\tAssert.IsTrue(md.IsExtensionMethod);\n\t\t\tAssert.AreEqual(\"s\", md.Parameters.Single().Name);\n\t\t\tAssert.AreEqual(KnownTypeCode.String, ((PrimitiveType)md.Parameters.Single().Type).KnownTypeCode);\n\t\t\tAssert.AreEqual(1, md.Parameters.Single().Attributes.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidExtensionMethodTest()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\n\t\t\t\t\"public static void Print(this string s) { Console.WriteLine(s); }\"\n\t\t\t);\n\t\t\tAssert.AreEqual(\"Print\", md.Name);\n\t\t\tAssert.AreEqual(\"s\", md.Parameters.First().Name);\n\t\t\tAssert.AreEqual(ParameterModifier.This, md.Parameters.First().ParameterModifier);\n\t\t\tAssert.AreEqual(\"string\", ((PrimitiveType)md.Parameters.First().Type).Keyword);\n\t\t\tAssert.IsTrue(md.IsExtensionMethod);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithEmptyAssignmentErrorInBody()\n\t\t{\n\t\t\tMethodDeclaration md = ParseUtilCSharp.ParseTypeMember<MethodDeclaration>(\n\t\t\t\t\"void A ()\\n\" +\n\t\t\t\t\"{\\n\" +\n\t\t\t\t\"int a = 3;\\n\" +\n\t\t\t\t\" = 4;\\n\" +\n\t\t\t\t\"}\", true // expect errors\n\t\t\t);\n\t\t\tAssert.AreEqual(\"A\", md.Name);\n\t\t\tAssert.AreEqual(new TextLocation(2, 1), md.Body.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(5, 2), md.Body.EndLocation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OptionalParameterTest()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"public void Foo(string bar = null, int baz = 0) { }\",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Public,\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tName = \"Foo\",\n\t\t\t\t\tBody = new BlockStatement(),\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration {\n\t\t\t\t\t\t\tType = new PrimitiveType(\"string\"),\n\t\t\t\t\t\t\tName = \"bar\",\n\t\t\t\t\t\t\tDefaultExpression = new NullReferenceExpression()\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew ParameterDeclaration {\n\t\t\t\t\t\t\tType = new PrimitiveType(\"int\"),\n\t\t\t\t\t\t\tName = \"baz\",\n\t\t\t\t\t\t\tDefaultExpression = new PrimitiveExpression(0)\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AsyncMethod()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"async void MyMethod() {}\",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Async,\n\t\t\t\t\tReturnType = new PrimitiveType(\"void\"),\n\t\t\t\t\tName = \"MyMethod\",\n\t\t\t\t\tBody = new BlockStatement()\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"parser bug, reported upstream.\")]\n\t\tpublic void AsyncAsyncAsync()\n\t\t{\n\t\t\tParseUtilCSharp.AssertTypeMember(\n\t\t\t\t\"async async async(async async) {}\",\n\t\t\t\tnew MethodDeclaration {\n\t\t\t\t\tModifiers = Modifiers.Async,\n\t\t\t\t\tReturnType = new SimpleType(\"async\"),\n\t\t\t\t\tName = \"async\",\n\t\t\t\t\tBody = new BlockStatement(),\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration(new SimpleType(\"async\"), \"async\")\n\t\t\t\t\t}});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/OperatorDeclarationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class OperatorDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void ImplictOperatorDeclarationTest()\n\t\t{\n\t\t\tOperatorDeclaration od = ParseUtilCSharp.ParseTypeMember<OperatorDeclaration>(\"public static implicit operator double(MyObject f)  { return 0.5d; }\");\n\t\t\tAssert.AreEqual(OperatorType.Implicit, od.OperatorType);\n\t\t\tAssert.AreEqual(1, od.Parameters.Count());\n\t\t\tAssert.AreEqual(\"double\", ((PrimitiveType)od.ReturnType).Keyword);\n\t\t\tAssert.AreEqual(\"op_Implicit\", od.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitOperatorDeclarationTest()\n\t\t{\n\t\t\tOperatorDeclaration od = ParseUtilCSharp.ParseTypeMember<OperatorDeclaration>(\"public static explicit operator double(MyObject f)  { return 0.5d; }\");\n\t\t\tAssert.AreEqual(OperatorType.Explicit, od.OperatorType);\n\t\t\tAssert.AreEqual(1, od.Parameters.Count());\n\t\t\tAssert.AreEqual(\"double\", ((PrimitiveType)od.ReturnType).Keyword);\n\t\t\tAssert.AreEqual(\"op_Explicit\", od.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BinaryPlusOperatorDeclarationTest()\n\t\t{\n\t\t\tOperatorDeclaration od = ParseUtilCSharp.ParseTypeMember<OperatorDeclaration>(\"public static MyObject operator +(MyObject a, MyObject b)  {}\");\n\t\t\tAssert.AreEqual(OperatorType.Addition, od.OperatorType);\n\t\t\tAssert.AreEqual(2, od.Parameters.Count());\n\t\t\tAssert.AreEqual(\"MyObject\", ((SimpleType)od.ReturnType).Identifier);\n\t\t\tAssert.AreEqual(\"op_Addition\", od.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnaryPlusOperatorDeclarationTest()\n\t\t{\n\t\t\tOperatorDeclaration od = ParseUtilCSharp.ParseTypeMember<OperatorDeclaration>(\"public static MyObject operator +(MyObject a)  {}\");\n\t\t\tAssert.AreEqual(OperatorType.UnaryPlus, od.OperatorType);\n\t\t\tAssert.AreEqual(1, od.Parameters.Count());\n\t\t\tAssert.AreEqual(\"MyObject\", ((SimpleType)od.ReturnType).Identifier);\n\t\t\tAssert.AreEqual(\"op_UnaryPlus\", od.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidOperatorTrueDeclaration()\n\t\t{\n\t\t\tParseUtilCSharp.ParseTypeMember<OperatorDeclaration>(\"public static implicit operator true(MyBool b) {}\", expectErrors: true);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/PropertyDeclarationTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.PatternMatching;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers\n{\n\t[TestFixture]\n\tpublic class PropertyDeclarationTests\n\t{\n\t\t[Test]\n\t\tpublic void SimpleGetSetPropertyDeclarationTest()\n\t\t{\n\t\t\tPropertyDeclaration pd = ParseUtilCSharp.ParseTypeMember<PropertyDeclaration>(\"int MyProperty { get {} set {} } \");\n\t\t\tAssert.AreEqual(\"MyProperty\", pd.Name);\n\t\t\tAssert.IsFalse(pd.Getter.IsNull);\n\t\t\tAssert.IsFalse(pd.Setter.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetSetPropertyDeclarationWithAccessorModifiers()\n\t\t{\n\t\t\tPropertyDeclaration pd = ParseUtilCSharp.ParseTypeMember<PropertyDeclaration>(\"int MyProperty { private get {} protected internal set {} } \");\n\t\t\tAssert.AreEqual(\"MyProperty\", pd.Name);\n\t\t\tAssert.IsFalse(pd.Getter.IsNull);\n\t\t\tAssert.IsFalse(pd.Setter.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleGetPropertyDeclarationTest()\n\t\t{\n\t\t\tPropertyDeclaration pd = ParseUtilCSharp.ParseTypeMember<PropertyDeclaration>(\"int MyProperty { get {} } \");\n\t\t\tAssert.AreEqual(\"MyProperty\", pd.Name);\n\t\t\tAssert.IsFalse(pd.Getter.IsNull);\n\t\t\tAssert.IsTrue(pd.Setter.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleSetPropertyDeclarationTest()\n\t\t{\n\t\t\tPropertyDeclaration pd = ParseUtilCSharp.ParseTypeMember<PropertyDeclaration>(\"int MyProperty { set {} } \");\n\t\t\tAssert.AreEqual(\"MyProperty\", pd.Name);\n\t\t\tAssert.IsTrue(pd.Getter.IsNull);\n\t\t\tAssert.IsFalse(pd.Setter.IsNull);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyRegionTest()\n\t\t{\n\t\t\tconst string code = \"class T {\\n\\tint Prop {\\n\\t\\tget { return f; }\\n\\t\\tset { f = value; }\\n\\t}\\n}\\n\";\n\t\t\tint line2Pos = code.IndexOf(\"\\tint Prop\");\n\t\t\tint line3Pos = code.IndexOf(\"\\t\\tget\");\n\t\t\tint line4Pos = code.IndexOf(\"\\t\\tset\");\n\t\t\t\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree = parser.Parse(code);\n\t\t\tPropertyDeclaration pd = (PropertyDeclaration)syntaxTree.Children.Single(c => c.Role != Roles.NewLine).GetChildByRole(Roles.TypeMemberRole);\n\t\t\tAssert.AreEqual(new TextLocation(2, code.IndexOf(\"{\\n\\t\\tget\") - line2Pos + 1), pd.GetChildByRole(Roles.LBrace).StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(5, 3), pd.EndLocation);\n\t\t\tAssert.AreEqual(new TextLocation(3, code.IndexOf(\"{ return\") - line3Pos + 1), pd.Getter.Body.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(3, code.IndexOf(\"}\\n\\t\\tset\") + 1 - line3Pos + 1), pd.Getter.Body.EndLocation);\n\t\t\tAssert.AreEqual(new TextLocation(4, code.IndexOf(\"{ f =\") - line4Pos + 1), pd.Setter.Body.StartLocation);\n\t\t\tAssert.AreEqual(new TextLocation(4, code.IndexOf(\"}\\n\\t}\") + 1 - line4Pos + 1), pd.Setter.Body.EndLocation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyImplementingInterfaceTest()\n\t\t{\n\t\t\tPropertyDeclaration pd = ParseUtilCSharp.ParseTypeMember<PropertyDeclaration>(\"int MyInterface.MyProperty { get {} } \");\n\t\t\tAssert.AreEqual(\"MyProperty\", pd.Name);\n\t\t\tAssert.IsFalse(pd.Getter.IsNull);\n\t\t\tAssert.IsTrue(pd.Setter.IsNull);\n\t\t\t\n\t\t\tAssert.AreEqual(\"MyInterface\", ((SimpleType)pd.PrivateImplementationType).Identifier);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyImplementingGenericInterfaceTest()\n\t\t{\n\t\t\tPropertyDeclaration pd = ParseUtilCSharp.ParseTypeMember<PropertyDeclaration>(\"int MyInterface<string>.MyProperty { get {} } \");\n\t\t\tAssert.AreEqual(\"MyProperty\", pd.Name);\n\t\t\tAssert.IsFalse(pd.Getter.IsNull);\n\t\t\tAssert.IsTrue(pd.Setter.IsNull);\n\t\t\t\n\t\t\tAssert.IsTrue(new SimpleType { Identifier = \"MyInterface\", TypeArguments = { new PrimitiveType(\"string\") } }.IsMatch(pd.PrivateImplementationType));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeSystemConvertVisitorTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.TypeSystem.TestCase;\nusing ICSharpCode.NRefactory.Utils;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Parser\n{\n\t[TestFixture]\n\tpublic class TypeSystemConvertVisitorTests : TypeSystemTests\n\t{\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp()\n\t\t{\n\t\t\tcompilation = ParseTestCase().CreateCompilation();\n\t\t}\n\n\t\tstatic IProjectContent CreateContent (IUnresolvedFile unresolvedFile)\n\t\t{\n\t\t\treturn new CSharpProjectContent()\n\t\t\t\t.AddOrUpdateFiles(unresolvedFile)\n\t\t\t\t.AddAssemblyReferences(new[] {\n\t\t\t\t\tCecilLoaderTests.Mscorlib\n\t\t\t\t})\n\t\t\t\t.SetAssemblyName(typeof(TypeSystemTests).Assembly.GetName().Name);\n\t\t}\n\t\t\n\t\tinternal static IProjectContent ParseTestCase()\n\t\t{\n\t\t\tconst string fileName = \"TypeSystemTests.TestCase.cs\";\n\t\t\t\n\t\t\tCSharpParser parser = new CSharpParser();\n\t\t\tSyntaxTree syntaxTree;\n\t\t\tusing (Stream s = typeof(TypeSystemTests).Assembly.GetManifestResourceStream(typeof(TypeSystemTests), fileName)) {\n\t\t\t\tsyntaxTree = parser.Parse(s, fileName);\n\t\t\t}\n\t\t\t\n\t\t\treturn CreateContent(syntaxTree.ToTypeSystem());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConvertStandaloneTypeReference()\n\t\t{\n\t\t\tvar typeRef = new MemberType(new SimpleType(\"System\"), \"Array\").ToTypeReference();\n\t\t\tAssert.AreEqual(compilation.FindType(KnownTypeCode.Array), typeRef.Resolve(compilation.TypeResolveContext));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PartialMethodWithImplementation()\n\t\t{\n\t\t\tvar t = compilation.FindType(typeof(PartialClass));\n\t\t\tvar methods = t.GetMethods(m => m.Name == \"PartialMethodWithImplementation\").ToList();\n\t\t\tAssert.AreEqual(2, methods.Count);\n\t\t\tvar method1 = methods.Single(m => m.Parameters[0].Type.FullName == \"System.Int32\");\n\t\t\tvar method2 = methods.Single(m => m.Parameters[0].Type.FullName == \"System.String\");\n\t\t\tAssert.AreEqual(2, method1.Parts.Count);\n\t\t\tAssert.AreEqual(2, method2.Parts.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PartialMethodWithoutImplementation()\n\t\t{\n\t\t\tvar t = compilation.FindType(typeof(PartialClass));\n\t\t\tvar method = t.GetMethods(m => m.Name == \"PartialMethodWithoutImplementation\").Single();\n\t\t\tAssert.AreEqual(1, method.Parts.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CyclicConstants()\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse (\"class Test { const int foo = foo; }\");\n\t\t\tsyntaxTree.FileName = \"a.cs\";\n\t\t\tvar content = CreateContent (syntaxTree.ToTypeSystem());\n\t\t\tvar testType = content.CreateCompilation ().MainAssembly.GetTypeDefinition (\"\", \"Test\");\n\t\t\tAssert.NotNull (testType);\n\t\t\tvar field = testType.Fields.First ();\n\t\t\tAssert.IsTrue (field.IsConst);\n\t\t\tAssert.IsNull (field.ConstantValue);\n\t\t}\n\n\t\t[Test, Ignore(\"mcs bug #12204\")]\n\t\tpublic void AssemblyAndModuleAttributesDoNotAppearOnTypes() \n\t\t{\n\t\t\tvar parser = new CSharpParser();\n\t\t\tvar cu = parser.Parse(\"[assembly: My1][module: My2][My3]class C {} public class My1Attribute : System.Attribute {} public class My2Attribute : System.Attribute {} public class My3Attribute : System.Attribute {}\", \"File.cs\");\n\n\t\t\tvar ts = cu.ToTypeSystem();\n\t\t\tvar compilation = new CSharpProjectContent()\n\t\t\t\t.AddOrUpdateFiles(ts)\n\t\t\t\t.AddAssemblyReferences(new[] { CecilLoaderTests.Mscorlib })\n\t\t\t\t.CreateCompilation();\n\t\t\tvar type = ReflectionHelper.ParseReflectionName(\"C\").Resolve(compilation).GetDefinition();\n\t\t\tAssert.That(type.Attributes.Select(a => a.AttributeType.FullName).ToList(), Is.EqualTo(new[] { \"My3Attribute\" }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PartialClassWithSinglePart()\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse(\"partial class Test {}\");\n\t\t\tsyntaxTree.FileName = \"a.cs\";\n\t\t\tvar content = CreateContent(syntaxTree.ToTypeSystem());\n\t\t\tvar typeDef = content.CreateCompilation().MainAssembly.GetTypeDefinition(\"\", \"Test\");\n\t\t\tAssert.AreEqual(1, typeDef.Parts.Count);\n\t\t\tvar part = typeDef.Parts.Single();\n\t\t\tAssert.IsTrue(part.IsPartial);\n\t\t\tAssert.IsTrue(typeDef.IsPartial);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PartialClassWithTwoPartsWithoutPartialModifier()\n\t\t{\n\t\t\tvar syntaxTree = SyntaxTree.Parse(\"class Test {} class Test {}\");\n\t\t\tsyntaxTree.FileName = \"a.cs\";\n\t\t\tvar content = CreateContent(syntaxTree.ToTypeSystem());\n\t\t\tvar typeDef = content.CreateCompilation().MainAssembly.GetTypeDefinition(\"\", \"Test\");\n\t\t\tAssert.AreEqual(2, typeDef.Parts.Count);\n\t\t\tAssert.IsTrue(typeDef.IsPartial);\n\t\t}\n\t}\n\t\n\t[TestFixture]\n\tpublic class SerializedTypeSystemConvertVisitorTests : TypeSystemTests\n\t{\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp()\n\t\t{\n\t\t\tFastSerializer serializer = new FastSerializer();\n\t\t\tusing (MemoryStream ms = new MemoryStream()) {\n\t\t\t\tserializer.Serialize(ms, TypeSystemConvertVisitorTests.ParseTestCase());\n\t\t\t\tms.Position = 0;\n\t\t\t\tvar pc = (IProjectContent)serializer.Deserialize(ms);\n\t\t\t\tcompilation = pc.CreateCompilation();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/QueryExpressionExpanderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing ICSharpCode.NRefactory.CSharp.Parser;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp {\n\t[TestFixture]\n\tpublic class QueryExpressionExpanderTests {\n\t\tprivate dynamic ElementAt(dynamic d, int index) {\n\t\t\tint i = 0;\n\t\t\tforeach (var o in d) {\n\t\t\t\tif (i++ == index)\n\t\t\t\t\treturn o;\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tprivate void AssertCorrect(AstNode actual, string expected) {\n\t\t\tAssert.That(Regex.Replace(actual.ToString(), @\"\\s+\", \"\").Replace(\"<>\", \"\"), Is.EqualTo(Regex.Replace(expected, @\"\\s+\", \"\")));\n\t\t}\n\n\t\tprivate void AssertLookupCorrect<T, U>(IEnumerable<KeyValuePair<T, U>> actual, IList<Tuple<TextLocation, AstNode>> expected) where T : AstNode where U : AstNode {\n\t\t\tvar actualList = actual.OrderBy(x => x.Key.StartLocation).ThenBy(x => x.Key.GetType().ToString()).ToList();\n\t\t\tAssert.That(actualList.Select(x => x.Key.StartLocation).ToList(), Is.EqualTo(expected.Select(x => x.Item1).ToList()));\n\t\t\tfor (int i = 0; i < actualList.Count; i++) {\n\t\t\t\tAssert.That(actualList[i].Value, Is.Not.SameAs(actualList[i].Key));\n\t\t\t\tAssert.That(actualList[i].Value, Is.SameAs(expected[i].Item2));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void QueryExpressionWithFromAndSelectWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from a in args select int.Parse(a)\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"args.Select(a => int.Parse(a))\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] { Tuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)) });\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] { Tuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target), Tuple.Create(new TextLocation(1, 16), actual.AstNode) });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void QueryExpressionWithSingleFromAndExplicitTypeWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from object a in args select int.Parse(a)\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"args.Cast<object>().Select(a => int.Parse(a))\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] { Tuple.Create(new TextLocation(1, 13), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)) });\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] { Tuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target), Tuple.Create(new TextLocation(1, 23), actual.AstNode) });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void QueryExpressionWithLetWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from a in args let b = int.Parse(a) select a + b.ToString()\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"args.Select(a => new { a, b = int.Parse(a) }).Select(x0 => x0.a + x0.b.ToString())\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 20), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 37), actual.AstNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void QueryExpressionWithTwoLetsWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from a in args let b = int.Parse(a) let c = b + 1 select a + b.ToString() + c.ToString()\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"args.Select(a => new { a, b = int.Parse(a) }).Select(x0 => new { x0, c = x0.b + 1 }).Select(x1 => x1.x0.a + x1.x0.b.ToString() + x1.c.ToString())\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 20), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t\tTuple.Create(new TextLocation(1, 41), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 37), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 51), actual.AstNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TwoFromClausesFollowedBySelectWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 from j in arr2 select i + j\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.SelectMany(i => arr2, (i, j) => i + j)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Arguments, 1).Parameters, 1)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), actual.AstNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 31), actual.AstNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SelectManyFollowedBySelectWorksWhenTheTargetIsTransparentAndTheCollectionsAreCorrelated() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in outer let j = F(i) from k in j.Result select i + j + k\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"outer.Select(i => new { i, j = F(i) }).SelectMany(x0 => x0.j.Result, (x1, k) => x1.i + x1.j + k)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t\tTuple.Create(new TextLocation(1, 35), (AstNode)ElementAt(ElementAt(astNode.Arguments, 1).Parameters, 1)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 17), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 30), actual.AstNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 49), actual.AstNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SelectManyFollowedByLetWorksWhenTheTargetIsTransparentAndTheCollectionsAreCorrelated() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in outer let j = F(i) from k in j.Result let l = i + j + k select i + j + k + l\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"outer.Select(i => new { i, j = F(i) }).SelectMany(x0 => x0.j.Result, (x1, k) => new { x1, k }).Select(x2 => new { x2, l = x2.x1.i + x2.x1.j + x2.k }).Select(x3 => x3.x2.x1.i + x3.x2.x1.j + x3.x2.k + x3.l)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t\tTuple.Create(new TextLocation(1, 35), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 1).Parameters, 1)),\n\t\t\t\tTuple.Create(new TextLocation(1, 53), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 17), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 30), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 49), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 67), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TwoFromClausesFollowedByLetWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 from j in arr2 let k = i + j select i + j + k\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.SelectMany(i => arr2, (i, j) => new { i, j }).Select(x0 => new { x0, k = x0.i + x0.j }).Select(x1 => x1.x0.i + x1.x0.j + x1.k)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 1).Parameters, 1)),\n\t\t\t\tTuple.Create(new TextLocation(1, 35), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 31), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 45), actual.AstNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ThreeFromClausesFollowedBySelectWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 from j in arr2 from k in arr3 select i + j + k\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.SelectMany(i => arr2, (i, j) => new { i, j }).SelectMany(x0 => arr3, (x1, k) => x1.i + x1.j + k)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 1).Parameters, 1)),\n\t\t\t\tTuple.Create(new TextLocation(1, 36), (AstNode)ElementAt(ElementAt(astNode.Arguments, 1).Parameters, 1)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 31), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 46), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GroupByWithSimpleValue() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr group i by i.field\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr.GroupBy(i => i.field)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 15), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GroupByWithProjectedValue() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr group i.something by i.field\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr.GroupBy(i => i.field, i => i.something)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 15), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GroupByWhenThereIsATransparentIdentifer() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr let j = F(i) group i by i.field\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr.Select(i => new { i, j = F(i) }).GroupBy(x0 => x0.i.field, x1 => x1.i)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 19), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 15), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 28), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void JoinFollowedBySelect() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 join j in arr2 on i.keyi equals j.keyj select i + j\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Join(arr2, i => i.keyi, j => j.keyj, (i, j) => i + j)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 1).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Arguments, 2).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 55), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void JoinWithCast() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 join CJ j in arr2 on i.keyi equals j.keyj select i.valuei + j.valuej\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Join(arr2.Cast<CJ>(),i=>i.keyi,j=>j.keyj,(i,j)=>i.valuei+j.valuej)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 1).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 24), (AstNode)ElementAt(ElementAt(astNode.Arguments, 2).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 58), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void JoinFollowedByLet() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 join j in arr2 on i.keyi equals j.keyj let k = i + j select i + j + k\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Join(arr2, i => i.keyi, j => j.keyj, (i, j) => new { i, j }).Select(x0 => new { x0, k = x0.i + x0.j }).Select(x1 => x1.x0.i + x1.x0.j + x1.k)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 1).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 2).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 59), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 55), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 69), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void JoinFollowedBySelectWhenThereIsATransparentIdentifier() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 let j = F(i) join k in arr2 on j.keyj equals k.keyk select i + j + k\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Select(i => new { i, j = F(i) }).Join(arr2, x0 => x0.j.keyj, k => k.keyk, (x1, k) => x1.i + x1.j + k)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 20), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t\tTuple.Create(new TextLocation(1, 34), (AstNode)ElementAt(ElementAt(astNode.Arguments, 2).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 29), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 68), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GroupJoinFollowedBySelect() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 join j in arr2 on i.keyi equals j.keyj into g select F(i, g)\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.GroupJoin(arr2, i => i.keyi, j => j.keyj, (i, g) => F(i, g))\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 1).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 60), (AstNode)ElementAt(ElementAt(astNode.Arguments, 3).Parameters, 1)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 62), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GroupJoinFollowedByLet() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 join j in arr2 on i.keyi equals j.keyj into g let k = i + g select i + g + k\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.GroupJoin(arr2, i => i.keyi, j => j.keyj, (i, g) => new { i, g }).Select(x0 => new { x0, k = x0.i + x0.g }).Select(x1 => x1.x0.i + x1.x0.g + x1.k)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 1).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 60), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 3).Parameters, 1)),\n\t\t\t\tTuple.Create(new TextLocation(1, 66), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 62), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 76), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GroupJoinFollowedBySelectWhenThereIsATransparentIdentifier() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 let j = F(i) join k in arr2 on j.keyj equals k.keyk into g select F(i, j, g)\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Select(i => new { i, j = F(i) }).GroupJoin(arr2, x0 => x0.j.keyj, k => k.keyk, (x1, g) => F(x1.i, x1.j, g))\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 20), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t\tTuple.Create(new TextLocation(1, 73), (AstNode)ElementAt(ElementAt(astNode.Arguments, 3).Parameters, 1)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 29), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 75), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WhereWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 where i > 5 select i + 1\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Where(i => i > 5).Select(i => i + 1)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 28), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WhereWorksWhenThereIsATransparentIdentifier() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 let j = i + 1 where i > j select i + j\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Select(i => new { i, j = i + 1 }).Where(x0 => x0.i > x0.j).Select(x1 => x1.i + x1.j)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 20), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 30), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 42), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TrivialSelectIsEliminatedAfterWhere() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 where i > 5 select i\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Where(i => i > 5)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 28), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TrivialSelectIsEliminatedAfterWhereEvenWhenParenthesized() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 where i > 5 select (i)\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Where(i => i > 5)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 28), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TrivialSelectIsNotEliminatingWhenTheOnlyOperation() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 select i\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Select(i => i)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OrderingWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 orderby i.field1 select i\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.OrderBy(i => i.field1)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 24), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 33), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OrderingWorksWhenThereIsATransparentIdentifier() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 let j = i + 1 orderby i + j select i\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.Select(i => new { i, j = i + 1 }).OrderBy(x0 => x0.i + x0.j).Select(x1 => x1.i)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 20), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Body.Initializers, 1).NameToken),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 30), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 38), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 44), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ThenByWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 orderby i.field1, i.field2 select i\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.OrderBy(i => i.field1).ThenBy(i => i.field2)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode),\t// This should be the orderby at location 16, but a parser bug causes 24 to be returned. change this to 16 after fixing the parser bug.\n\t\t\t\tTuple.Create(new TextLocation(1, 24), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 34), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 43), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OrderingDescendingWorks() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 orderby i.field1 descending, i.field2 descending select i\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.OrderByDescending(i => i.field1).ThenByDescending(i => i.field2)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 24), (AstNode)astNode),\t// This should be the orderby at location 16, but a parser bug causes 24 to be returned. change this to 16 after fixing the parser bug.\n\t\t\t\tTuple.Create(new TextLocation(1, 24), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 45), (AstNode)astNode),\n\t\t\t\tTuple.Create(new TextLocation(1, 65), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void QueryContinuation() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 from j in arr2 select i + j into a where a > 5 select a + 1\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.SelectMany(i => arr2, (i, j) => i + j).Where(a => a > 5).Select(a => a + 1)\");\n\t\t\tdynamic astNode = actual.AstNode;\n\t\t\tAssertLookupCorrect(actual.RangeVariables, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 6), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t\tTuple.Create(new TextLocation(1, 21), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Target.Target.Arguments, 1).Parameters, 1)),\n\t\t\t\tTuple.Create(new TextLocation(1, 49), (AstNode)ElementAt(ElementAt(astNode.Target.Target.Arguments, 0).Parameters, 0)),\n\t\t\t});\n\t\t\tAssertLookupCorrect(actual.Expressions, new[] {\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 1), (AstNode)astNode.Target.Target.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 16), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 31), (AstNode)astNode.Target.Target.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 51), (AstNode)astNode.Target.Target),\n\t\t\t\tTuple.Create(new TextLocation(1, 63), (AstNode)astNode),\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedQueries() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 from j in arr2 let l = new { i, j } group l by l.i into g select new { g.Key, a = from q in g select new { q.i, q.j } }\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.SelectMany(i => arr2, (i, j) => new { i, j }).Select(x0 => new { x0, l = new { x0.i, x0.j } }).GroupBy(x1 => x1.l.i, x2 => x2.l).Select(g => new { g.Key, a = g.Select(q => new { q.i, q.j }) })\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedQueryUsingRangeVariableFromOuter() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from i in arr1 from j in arr2 let k = new[] { i, j } select (from l in k let m = l + 1 select l + m + i)\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"arr1.SelectMany(i => arr2, (i, j) => new { i, j }).Select(x0 => new { x0, k = new[] { x0.i, x0.j } }).Select(x1 => (x1.k.Select(l => new { l, m = l + 1 }).Select(x2 => x2.l + x2.m + x1.x0.i)))\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RangeVariablesAreNotInScopeInJoinEquals() {\n\t\t\tvar node = ParseUtilCSharp.ParseExpression<QueryExpression>(\"from a in args let a2 = a select (from b in args let b2 = b join c in args on b[0] equals b + a into g select g)\");\n\t\t\tvar actual = new QueryExpressionExpander().ExpandQueryExpressions(node);\n\t\t\tAssertCorrect(actual.AstNode, \"args.Select(a => new { a, a2 = a }).Select(x0 => (args.Select(b => new { b, b2 = b }).GroupJoin(args, x1 => x1.b[0], c => b + x0.a, (x2, g) => g)))\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/LambdaHelperTests.cs",
    "content": "//\n// LambdaHelperTests.cs\n//\n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n//\n// Copyright (c) 2013 Luís Reis\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[TestFixture]\n\tpublic class LambdaHelperTests\n\t{\n\t\tRefactoringContext MakeContext(string input, bool expectErrors = false)\n\t\t{\n\t\t\tvar context = TestRefactoringContext.Create(input, expectErrors);\n\t\t\treturn context;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExtensionMethod()\n\t\t{\n\t\t\tstring input = @\"\nusing System.Linq;\nclass Test\n{\n\tvoid Method() {\n\t\tSystem.Linq.Enumerable.Empty<int> ().Where(<-i => i > 0->);\n\t}\n}\n\";\n\n\t\t\tvar context = MakeContext(input);\n\t\t\tvar lambda = context.GetSelectedNodes().OfType<LambdaExpression>().First();\n\t\t\tvar type = LambdaHelper.GetLambdaReturnType(context, lambda);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.Boolean\", type.ReflectionName);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/NamingHelperTests.cs",
    "content": "//\n// BaseRefactoringContextTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\nusing ICSharpCode.NRefactory.CSharp.CodeActions;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t\t[TestFixture]\n\t\tpublic class NamingHelperTests\n\t\t{\n\t\t\t\tRefactoringContext MakeContext(string input, bool expectErrors = false)\n\t\t\t\t{\n\t\t\t\t\t\tvar context = TestRefactoringContext.Create(input, expectErrors);\n\t\t\t\t\t\treturn context;\n\t\t\t\t}\n\t\t\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameTest()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{ $ }\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.AreEqual(\"i\", name);\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameIgnoresNamesUsedPreviouslyInScope()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\tint i;\n\t\t$\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.IsFalse(name == \"i\", \"i was already used and should not be proposed.\");\n\t\t\t\t}\n\t\t\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameBasedOnCustomBaseName()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{ $ }\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"), \"integer\");\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.AreEqual(\"integer\", name);\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameIgnoresNamesUsedLaterInScope()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\t$\n\t\tint i;\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.IsFalse(name == \"i\", \"i was already used and should not be proposed.\");\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameIgnoresNamesUsedInNestedScope()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\t$\n\t\tfor (int i; i < 0; i++);\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.IsFalse(name == \"i\", \"i was already used and should not be proposed.\");\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameInForIgnoresIterator()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\tfor (int i; i < 0; i++)\n\t\t\t$\n\t}\n}\", true);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.IsFalse(name == \"i\", \"i was already used and should not be proposed.\");\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameInMethodIgnoresParameters()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F(int i)\n\t{\n\t\t$\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.IsFalse(name == \"i\", \"i was already used and should not be proposed.\");\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameInForInitializerList()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F(int i)\n\t{\n\t\tfor($ ; i < 0; i++);\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.IsFalse(name == \"i\", \"i was already used and should not be proposed.\");\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameWithNumberedVariableInParentBlock()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\tint i2;\n\t\t{\n\t\t\tint i, j, k;\n\t\t\t$\n\t\t}\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.AreEqual(\"i3\", name);\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameShouldNotIgnoreBasedOnMethodCallIdentifiers()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass B\n{\n\tvoid i()\n\t{\n\t}\n}\nclass A\n{\n\tvoid F()\n\t{\n\t\t\n\t\tfor($ ;;)\n\t\t\tB.i();\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.IsTrue(name == \"i\");\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameIgnoresLinqIdentifiers()\n\t\t\t\t{\n\t\t\t\t\t\t// Snippet tests that identifiers from in, into and let clauses are found\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\t$\n\t\tvar ints = from i in new int [] {} group i by i % 2 into j let k = 2 select j.Count() + k;\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.AreEqual(\"i2\", name);\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameIgnoresFixedVariables()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tunsafe void F()\n\t{\n\t\t$\n\t\tfixed (int i = 13) {}\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.AreEqual(\"j\", name);\n\t\t\t\t}\n\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameFallsBackToNumbering()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\tint i, j, k;\n\t\t$\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.AreEqual(\"i2\", name);\n\t\t\t\t}\n\t\t\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameForCustomType()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\t$\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar name = new NamingHelper(context).GenerateVariableName(new SimpleType() { Identifier = \"VariableNameGenerationTester\" });\n\t\t\t\t\t\tAssert.NotNull(name);\n\t\t\t\t\t\tAssert.AreEqual(\"variableNameGenerationTester\", name);\n\t\t\t\t}\n\t\t\n\t\t\t\t[Test]\n\t\t\t\tpublic void GenerateVariableNameDoesNotRepeatNames()\n\t\t\t\t{\n\t\t\t\t\t\tvar context = MakeContext(@\"\nclass A\n{\n\tvoid F()\n\t{\n\t\t$\n\t}\n}\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\tvar namingHelper = new NamingHelper(context);\n\t\t\t\t\t\tvar name1 = namingHelper.GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tvar name2 = namingHelper.GenerateVariableName(new PrimitiveType(\"int\"));\n\t\t\t\t\t\tAssert.NotNull(name1);\n\t\t\t\t\t\tAssert.NotNull(name2);\n\t\t\t\t\t\tAssert.AreNotEqual(name1, name2, \"The generated names should not repeat.\");\n\t\t\t\t}\n\t\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/RefactoringStructureTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Reflection;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[TestFixture]\n\tpublic class RefactoringStructureTests\n\t{\n\t\t[Test]\n\t\tpublic void GatherVisitorBaseClass()\n\t\t{\n\t\t\tAssembly NR_CSharp = typeof(InconsistentNamingIssue).Assembly;\n\t\t\tbool foundGatherVisitor = false;\n\t\t\tforeach (var topLevelType in NR_CSharp.GetTypes()) {\n\t\t\t\tforeach (var nestedType in topLevelType.GetNestedTypes(BindingFlags.NonPublic | BindingFlags.Public)) {\n\t\t\t\t\tif (nestedType.Name != \"GatherVisitor\")\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tfoundGatherVisitor = true;\n\t\t\t\t\tbool foundGatherVisitorBase = false;\n\t\t\t\t\tfor (Type baseType = nestedType.BaseType; baseType != null; baseType = baseType.BaseType) {\n\t\t\t\t\t\tif (baseType.Name == \"GatherVisitorBase`1\") {\n\t\t\t\t\t\t\tfoundGatherVisitorBase = true;\n\t\t\t\t\t\t\tAssert.AreEqual(new[] { topLevelType }, baseType.GetGenericArguments(), \"Invalid base type of \" + nestedType.FullName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tAssert.IsTrue(foundGatherVisitorBase, nestedType.FullName + \" should derive from GatherVisitorBase\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tAssert.IsTrue(foundGatherVisitor, \"where are the gather visitors?\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/ScriptTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.Editor;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n    [TestFixture]\n    public class ScriptTests\n    {\n        [Test]\n        public void InsertAfterStatementIndentsLikeStatement()\n        {\n            var input =@\"\npublic class Test\n{\n\t\tvoid DoublyIndented()\n\t\t{\n\t\t\tSystem.Console.WriteLine(\"\"hello\"\");\n\t\t}\n}\";\n            var expected = @\"\npublic class Test\n{\n\t\tvoid DoublyIndented()\n\t\t{\n\t\t\tSystem.Console.WriteLine(\"\"hello\"\");\n\t\t\treturn;\n\t\t}\n}\";\n\n            DoInsertAfterTest(input, expected, (syntaxTree, script) =>\n            {\n                var nodeToInsert = new ReturnStatement();\n                var nodeToInsertAfter = syntaxTree.DescendantsAndSelf.OfType<ExpressionStatement>().Single();\n                script.InsertAfter(nodeToInsertAfter,nodeToInsert);\n            });\n        }\n\n        [Test]\n        public void InsertParameterDeclarationDoesNotIndent()\n        {\n            var input =@\"\npublic class Test\n{\n\tvoid Test(int a)\n\t{\n\t}\n}\";\n            var expected = @\"\npublic class Test\n{\n\tvoid Test(int a, int b)\n\t{\n\t}\n}\";\n            DoInsertAfterTest(input, expected, (syntaxTree, script) =>\n            {\n                var nodeToInsert = new ParameterDeclaration(new PrimitiveType(\"int\"),\"b\");\n                var nodeToInsertAfter = syntaxTree.DescendantsAndSelf.OfType<ParameterDeclaration>().Single();\n                script.InsertAfter(nodeToInsertAfter,nodeToInsert);\n            });\n        }\n\n        [Test]\n        public void InsertFirstParameterDeclarationIntoMethod()\n        {\n            var input =@\"\npublic class Test\n{\n\tvoid Test()\n\t{\n\t}\n}\";\n            var expected = @\"\npublic class Test\n{\n\tvoid Test(int a)\n\t{\n\t}\n}\";\n            DoInsertAfterTest(input, expected, (syntaxTree, script) =>\n            {\n                var nodeToInsert = new ParameterDeclaration(new PrimitiveType(\"int\"),\"a\");\n                var nodeToInsertAfter = syntaxTree.DescendantsAndSelf.OfType<MethodDeclaration>().Single().LParToken;\n                script.InsertAfter(nodeToInsertAfter,nodeToInsert);\n            });\n        }\n\n        private static void DoInsertAfterTest(string s, string expected, Action<SyntaxTree, DocumentScript> doInsertion)\n        {\n            var script = new DocumentScript(new StringBuilderDocument(s), FormattingOptionsFactory.CreateEmpty(), new TextEditorOptions());\n            doInsertion(new CSharpParser().Parse(s), script);\n            Assert.AreEqual(expected, script.CurrentDocument.Text);\n        }\n    }\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Refactoring/TypeSystemAstBuilderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Refactoring\n{\n\t[TestFixture]\n\tpublic class TypeSystemAstBuilderTests\n\t{\n\t\tconst string mainProgram = @\"\nusing System;\nusing System.Collections.Generic;\nusing OtherNS;\n\nclass Base<T> {\n\tpublic class Nested<X> { }\n\tpublic class Sibling { }\n}\nclass Derived<T, S> : Base<S> { }\n\nnamespace NS {\n\tusing R = global::System.Reflection;\n\tusing L = List<char>;\n\t\n\tclass System { }\n}\nnamespace OtherNS {\n\tclass Array { }\n}\n\";\n\t\t\n\t\tIProjectContent pc;\n\t\tICompilation compilation;\n\t\tITypeDefinition baseClass, derivedClass, nestedClass, siblingClass, systemClass;\n\t\tCSharpUnresolvedFile unresolvedFile;\n\t\t\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tInit(mainProgram);\n\t\t\t\n\t\t\tbaseClass = compilation.RootNamespace.GetTypeDefinition(\"Base\", 1);\n\t\t\tnestedClass = baseClass.NestedTypes.Single(t => t.Name == \"Nested\");\n\t\t\tsiblingClass = baseClass.NestedTypes.Single(t => t.Name == \"Sibling\");\n\t\t\tderivedClass = compilation.RootNamespace.GetTypeDefinition(\"Derived\", 2);\n\t\t\tsystemClass = compilation.RootNamespace.GetChildNamespace(\"NS\").GetTypeDefinition(\"System\", 0);\n\t\t}\n\t\t\n\t\tvoid Init(string program)\n\t\t{\n\t\t\tpc = new CSharpProjectContent();\n\t\t\tpc = pc.SetAssemblyName(\"MyAssembly\");\n\t\t\tunresolvedFile = SyntaxTree.Parse(program, \"program.cs\").ToTypeSystem();\n\t\t\tpc = pc.AddOrUpdateFiles(unresolvedFile);\n\t\t\tpc = pc.AddAssemblyReferences(new [] { CecilLoaderTests.Mscorlib });\n\t\t\t\n\t\t\tcompilation = pc.CreateCompilation();\n\t\t}\n\t\t\n\t\tTypeSystemAstBuilder CreateBuilder(ITypeDefinition currentTypeDef = null)\n\t\t{\n\t\t\tUsingScope usingScope = currentTypeDef != null ? unresolvedFile.GetUsingScope(currentTypeDef.Region.Begin) : unresolvedFile.RootUsingScope;\n\t\t\treturn new TypeSystemAstBuilder(new CSharpResolver(\n\t\t\t\tnew CSharpTypeResolveContext(compilation.MainAssembly, usingScope.Resolve(compilation), currentTypeDef)));\n\t\t}\n\t\t\n\t\tstring TypeToString(IType type, ITypeDefinition currentTypeDef = null, Action<TypeSystemAstBuilder> builderAction = null)\n\t\t{\n\t\t\tvar builder = CreateBuilder(currentTypeDef);\n\t\t\tif (builderAction != null)\n\t\t\t\tbuilderAction (builder);\n\t\t\tAstType node = builder.ConvertType(type);\n\t\t\treturn node.ToString();\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PrimitiveTypeNames()\n\t\t{\n\t\t\tAssert.AreEqual(\"void\", TypeToString(compilation.FindType(KnownTypeCode.Void)));\n\t\t\tAssert.AreEqual(\"int\", TypeToString(compilation.FindType(KnownTypeCode.Int32)));\n\t\t\tAssert.AreEqual(\"decimal\", TypeToString(compilation.FindType(KnownTypeCode.Decimal)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SystemType()\n\t\t{\n\t\t\tAssert.AreEqual(\"Type\", TypeToString(compilation.FindType(KnownTypeCode.Type)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ListOfNSSystem()\n\t\t{\n\t\t\tvar type = new ParameterizedType(compilation.FindType(typeof(List<>)).GetDefinition(), new[] { systemClass });\n\t\t\tAssert.AreEqual(\"List<NS.System>\", TypeToString(type));\n\t\t\tAssert.AreEqual(\"List<System>\", TypeToString(type, systemClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonGenericIEnumerable()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Collections.IEnumerable\", TypeToString(compilation.FindType(typeof(IEnumerable))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonGenericIEnumerableWithSystemNamespaceCollision()\n\t\t{\n\t\t\tAssert.AreEqual(\"global::System.Collections.IEnumerable\", TypeToString(compilation.FindType(typeof(IEnumerable)), systemClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasedNamespace()\n\t\t{\n\t\t\tvar type = compilation.FindType(typeof(System.Reflection.Assembly));\n\t\t\tAssert.AreEqual(\"R.Assembly\", TypeToString(type, systemClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasedType()\n\t\t{\n\t\t\tvar type = new ParameterizedType(compilation.FindType(typeof(List<>)).GetDefinition(), new[] { compilation.FindType(KnownTypeCode.Char) });\n\t\t\tAssert.AreEqual(\"List<char>\", TypeToString(type));\n\t\t\tAssert.AreEqual(\"L\", TypeToString(type, systemClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasedTypeWrongTypeArgument()\n\t\t{\n\t\t\tvar type = new ParameterizedType(compilation.FindType(typeof(List<>)).GetDefinition(), new[] { compilation.FindType(KnownTypeCode.Int32) });\n\t\t\tAssert.AreEqual(\"List<int>\", TypeToString(type, systemClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnboundType()\n\t\t{\n\t\t\tAssert.AreEqual(\"Base<>\", TypeToString(baseClass));\n\t\t\tAssert.AreEqual(\"Base<>.Nested<>\", TypeToString(nestedClass));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnboundTypeConvertUnboundTypeArgumentsOption()\n\t\t{\n\t\t\tAssert.AreEqual(\"Base<T>\", TypeToString(baseClass, null, builder => builder.ConvertUnboundTypeArguments = true));\n\t\t\tAssert.AreEqual(\"Base<T>.Nested<X>\", TypeToString(nestedClass, null, builder => builder.ConvertUnboundTypeArguments = true));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedType()\n\t\t{\n\t\t\tvar type = new ParameterizedType(nestedClass, new[] { compilation.FindType(KnownTypeCode.Char), compilation.FindType(KnownTypeCode.String) });\n\t\t\tAssert.AreEqual(\"Base<char>.Nested<string>\", TypeToString(type));\n\t\t\t// The short form \"Nested<string>\" refers to \"Base<T>.Nested<string>\",\n\t\t\t// so we need to use the long form to specify that T=char.\n\t\t\tAssert.AreEqual(\"Base<char>.Nested<string>\", TypeToString(type, baseClass));\n\t\t\tAssert.AreEqual(\"Base<char>.Nested<string>\", TypeToString(type, nestedClass));\n\t\t\tAssert.AreEqual(\"Base<char>.Nested<string>\", TypeToString(type, derivedClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedTypeInCurrentClass()\n\t\t{\n\t\t\tvar type = new ParameterizedType(nestedClass, new[] { baseClass.TypeParameters[0], compilation.FindType(KnownTypeCode.String) });\n\t\t\tAssert.AreEqual(\"Nested<string>\", TypeToString(type, baseClass));\n\t\t\tAssert.AreEqual(\"Nested<string>\", TypeToString(type, nestedClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedTypeInDerivedClass()\n\t\t{\n\t\t\tvar type1 = new ParameterizedType(nestedClass, new[] { derivedClass.TypeParameters[0], compilation.FindType(KnownTypeCode.String) });\n\t\t\t// short form \"Nested<string>\" cannot be used as it would refer to \"Base<S>.Nested<string>\"\n\t\t\tAssert.AreEqual(\"Base<T>.Nested<string>\", TypeToString(type1, derivedClass));\n\t\t\t\n\t\t\tvar type2 = new ParameterizedType(nestedClass, new[] { derivedClass.TypeParameters[1], compilation.FindType(KnownTypeCode.String) });\n\t\t\tAssert.AreEqual(\"Nested<string>\", TypeToString(type2, derivedClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SiblingClass()\n\t\t{\n\t\t\tvar type = new ParameterizedType(siblingClass, new[] { baseClass.TypeParameters[0] });\n\t\t\tAssert.AreEqual(\"Sibling\", TypeToString(type, nestedClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericClass()\n\t\t{\n\t\t\tvar type = new ParameterizedType(nestedClass, new[] { baseClass.TypeParameters[0], compilation.FindType(KnownTypeCode.String) });\n\t\t\tAssert.AreEqual(\"Nested<string>\", TypeToString(type, siblingClass));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultidimensionalArray()\n\t\t{\n\t\t\tAssert.AreEqual(\"byte[][,]\", TypeToString(compilation.FindType(typeof(byte[][,]))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Pointer()\n\t\t{\n\t\t\tAssert.AreEqual(\"long*\", TypeToString(compilation.FindType(typeof(long*))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableType()\n\t\t{\n\t\t\tAssert.AreEqual(\"ulong?\", TypeToString(compilation.FindType(typeof(ulong?))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AmbiguousType()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Array\", TypeToString(compilation.FindType(typeof(Array))));\n\t\t\tAssert.AreEqual(\"OtherNS.Array\", TypeToString(compilation.MainAssembly.GetTypeDefinition(new TopLevelTypeName(\"OtherNS\", \"Array\"))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedFooCollidingWithProperty_SameType()\n\t\t{\n\t\t\tstring program = @\"class MainClass {\n        public enum Foo { Value1, Value2 }\n\n        public class Test {\n            Foo Foo { get; set; }\n        }\n    }\";\n\t\t\tInit(program);\n\t\t\tvar foo = compilation.MainAssembly.GetTypeDefinition(new FullTypeName(\"MainClass+Foo\"));\n\t\t\tvar test = compilation.MainAssembly.GetTypeDefinition(new FullTypeName(\"MainClass+Test\"));\n\t\t\tAssert.AreEqual(\"Foo\", TypeToString(foo, test));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedFooCollidingWithProperty_DifferentType()\n\t\t{\n\t\t\tstring program = @\"class MainClass {\n        public enum Foo { Value1, Value2 }\n\n        public class Test {\n            int Foo { get; set; }\n        }\n    }\";\n\t\t\tInit(program);\n\t\t\tvar foo = compilation.MainAssembly.GetTypeDefinition(new FullTypeName(\"MainClass+Foo\"));\n\t\t\tvar test = compilation.MainAssembly.GetTypeDefinition(new FullTypeName(\"MainClass+Test\"));\n\t\t\tAssert.AreEqual(\"MainClass.Foo\", TypeToString(foo, test));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/AnonymousTypeTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class AnonymousTypeTests : ResolverTestBase\n\t{\n\t\tconst string programStart = @\"using System;\nusing System.Collections.Generic;\nusing System.Linq;\nclass Test {\n\tvoid M(IEnumerable<string> list1, IEnumerable<int> list2) {\n\t\t\";\n\t\tconst string programEnd = \" } }\";\n\t\t\n\t\t[Test]\n\t\tpublic void Zip()\n\t\t{\n\t\t\tstring program = programStart + \"$var$ q = list1.Zip(list2, (a,b) => new { a, b });\" + programEnd;\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable\", rr.Type.FullName);\n\t\t\tvar type = (AnonymousType)((ParameterizedType)rr.Type).TypeArguments.Single();\n\t\t\tAssert.AreEqual(TypeKind.Anonymous, type.Kind);\n\t\t\tAssert.AreEqual(2, type.Properties.Count);\n\t\t\tAssert.AreEqual(\"a\", type.Properties[0].Name);\n\t\t\tAssert.AreEqual(\"b\", type.Properties[1].Name);\n\t\t\tAssert.AreEqual(\"System.String\", type.Properties[0].ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Int32\", type.Properties[1].ReturnType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ZipItem1()\n\t\t{\n\t\t\tstring program = programStart + \"var q = list1.Zip(list2, (a,b) => new { $Item1 = a$, Item2 = b });\" + programEnd;\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(TypeKind.Anonymous, rr.Member.DeclaringType.Kind);\n\t\t\tAssert.AreEqual(\"Item1\", rr.Member.Name);\n\t\t\tAssert.AreEqual(SymbolKind.Property, rr.Member.SymbolKind);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Member.ReturnType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ZipAnonymousType()\n\t\t{\n\t\t\tstring program = programStart + \"var q = list1.Zip(list2, (a,b) => $new { a, b }$);\" + programEnd;\n\t\t\tvar rr = Resolve<InvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(TypeKind.Anonymous, rr.Type.Kind);\n\t\t\tAssert.AreEqual(SymbolKind.Constructor, rr.Member.SymbolKind);\n\t\t\tAssert.AreEqual(rr.Type, rr.Member.DeclaringType);\n\t\t\tAssert.AreEqual(0, rr.Arguments.Count);\n\t\t\tAssert.AreEqual(2, rr.InitializerStatements.Count);\n\t\t\tvar init1 = (OperatorResolveResult)rr.InitializerStatements[0];\n\t\t\tAssert.AreEqual(ExpressionType.Assign, init1.OperatorType);\n\t\t\tAssert.IsInstanceOf<MemberResolveResult>(init1.Operands[0]);\n\t\t\tAssert.IsInstanceOf<LocalResolveResult>(init1.Operands[1]);\n\t\t\t\n\t\t\tResolveResult target = ((MemberResolveResult)init1.Operands[0]).TargetResult;\n\t\t\tAssert.IsInstanceOf<InitializedObjectResolveResult>(target);\n\t\t\tAssert.AreEqual(rr.Type, target.Type);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestingAnonymousTypesShouldWork()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tvar o = $new { a = 0, b = 1, c = new { d = 2, e = 3, f = 4 } }$;\n\t}\n}\";\n\t\t\t\n\t\t\tvar result = Resolve<InvocationResolveResult>(program);\n\t\t\tAssert.That(result.Type.GetProperties().Select(p => p.Name), Is.EquivalentTo(new[] { \"a\", \"b\", \"c\" }));\n\t\t\tAssert.That(result.Type.GetProperties().Single(p => p.Name == \"c\").ReturnType.GetProperties().Select(p => p.Name), Is.EquivalentTo(new[] { \"d\", \"e\", \"f\" }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DeclaringTypeIsSetCorrectlyForMembersOfAnonymousType()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tvar o = $new { Prop = 0 }$;\n\t}\n}\";\n\t\t\tvar result = Resolve<InvocationResolveResult>(program);\n\t\t\tvar prop = result.Type.GetProperties().Single();\n\t\t\tAssert.That(prop.DeclaringType, Is.EqualTo(result.Type));\n\t\t\tAssert.That(prop.Getter.DeclaringType, Is.EqualTo(result.Type));\n\t\t\tAssert.That(prop.Getter.IsAccessor, Is.True);\n\t\t\tAssert.That(prop.Getter.AccessorOwner, Is.EqualTo(prop));\n\t\t\tAssert.That(prop.Setter, Is.Null);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CanRoundtripAnonymousTypeThroughTypeReference()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tvar o = $new { Prop = 0 }$;\n\t}\n}\";\n\t\t\tvar result = Resolve<InvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(TypeKind.Anonymous, result.Type.Kind);\n\t\t\tIType typeAfterRoundtrip = result.Type.ToTypeReference().Resolve(result.Member.Compilation);\n\t\t\tAssert.AreEqual(result.Type, typeAfterRoundtrip);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CanRoundtripAnonymousTypePropertyThroughMemberReference()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tvar o = $new { Prop = 0 }$;\n\t}\n}\";\n\t\t\tvar result = Resolve<InvocationResolveResult>(program);\n\t\t\tIProperty prop = result.Type.GetProperties().Single();\n\t\t\tIProperty propAfterRoundtrip = (IProperty)prop.ToReference().Resolve(result.Member.Compilation.TypeResolveContext);\n\t\t\tAssert.AreEqual(prop, propAfterRoundtrip);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CanRoundtripAnonymousTypeGetterThroughMemberReference()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tvar o = $new { Prop = 0 }$;\n\t}\n}\";\n\t\t\tvar result = Resolve<InvocationResolveResult>(program);\n\t\t\tIMethod getter = result.Type.GetProperties().Single().Getter;\n\t\t\tIMethod getterAfterRoundtrip = (IMethod)getter.ToReference().Resolve(result.Member.Compilation.TypeResolveContext);\n\t\t\tAssert.AreEqual(getter, getterAfterRoundtrip);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AnonymousTypeToString() {\n\t\t\tstring program = @\"\nclass TestClass {\n\tvoid F() {\n\t\tvar s = $new { Prop = 0 }.ToString()$;\n\t}\n}\";\n\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(result.IsError, Is.False);\n\t\t\tAssert.That(result.TargetResult.Type.Kind == TypeKind.Anonymous);\n\t\t\tAssert.That(result.Member.Name, Is.EqualTo(\"ToString\"));\n\t\t\tAssert.That(result.Member.DeclaringType.Name, Is.EqualTo(\"Object\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ArrayCreateTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class ArrayCreateTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void SimpleArrayCreation()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic void Main() {\n\t\tvar a = $new int[] { 42 }$;\n\t}\n}\n\";\n\t\t\tvar result = Resolve(program);\n\t\t\tAssert.AreEqual(\"System.Int32[]\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedArrayCreation()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic void Main() {\n\t\tvar a = $new int[2][,][,,]$;\n\t}\n}\n\";\n\t\t\tvar result = Resolve(program);\n\t\t\t// a one-dimensional array of two-dimensional arrays of three-dimensional arrays\n\t\t\tArrayType a1 = (ArrayType)result.Type;\n\t\t\tAssert.AreEqual(1, a1.Dimensions);\n\t\t\tArrayType a2 = (ArrayType)a1.ElementType;\n\t\t\tAssert.AreEqual(2, a2.Dimensions);\n\t\t\tArrayType a3 = (ArrayType)a2.ElementType;\n\t\t\tAssert.AreEqual(3, a3.Dimensions);\n\t\t\tAssert.AreEqual(\"System.Int32\", a3.ElementType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InferredType()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic void Main() {\n\t\tvar a = $new [] { 1, 1L }$;\n\t}\n}\n\";\n\t\t\tvar result = Resolve(program);\n\t\t\tAssert.AreEqual(\"System.Int64[]\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InferredType2D()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic void Main() {\n\t\tvar a = $new [,] { { 1 }, { 1L } }$;\n\t}\n}\n\";\n\t\t\tvar result = Resolve(program);\n\t\t\tAssert.AreEqual(\"System.Int64[,]\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayInitializerExpression()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tint[] a = ${ 1 }$;\n}\n\";\n\t\t\tvar result = Resolve(program);\n\t\t\tAssert.AreEqual(\"System.Int32[]\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayInitializerExpression2D()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tint[,] a = ${ { 1 }, { 2 } }$;\n}\n\";\n\t\t\tvar result = Resolve(program);\n\t\t\tAssert.AreEqual(\"System.Int32[,]\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SizeArguments2x3()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tint[,] a = ${ { 1, 2, 3 }, { 4, 5, 6 } }$;\n}\n\";\n\t\t\tvar result = Resolve<ArrayCreateResolveResult>(program);\n\t\t\tAssert.AreEqual(6, result.InitializerElements.Count);\n\t\t\tAssert.AreEqual(2, result.SizeArguments.Count);\n\t\t\tAssert.AreEqual(2, result.SizeArguments[0].ConstantValue);\n\t\t\tAssert.AreEqual(3, result.SizeArguments[1].ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SizeArguments3x2()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tint[,] a = $new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 } }$;\n}\n\";\n\t\t\tvar result = Resolve<ArrayCreateResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32[,]\", result.Type.ReflectionName);\n\t\t\tAssert.AreEqual(6, result.InitializerElements.Count);\n\t\t\tAssert.AreEqual(2, result.SizeArguments.Count);\n\t\t\tAssert.AreEqual(3, result.SizeArguments[0].ConstantValue);\n\t\t\tAssert.AreEqual(2, result.SizeArguments[1].ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SizeArguments2xInvalid()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tint[,] a = ${ { 1, 2, 3 }, { 4, 5 } }$;\n}\n\";\n\t\t\tvar result = Resolve<ArrayCreateResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32[,]\", result.Type.ReflectionName);\n\t\t\tAssert.AreEqual(5, result.InitializerElements.Count);\n\t\t\tAssert.AreEqual(2, result.SizeArguments.Count);\n\t\t\tAssert.AreEqual(2, result.SizeArguments[0].ConstantValue);\n\t\t\tAssert.IsTrue(result.SizeArguments[1].IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SizeArgumentsExplicitSizeInconsistentWithActualSize()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tint[,] a = $new int[5,6] { { 1, 2, 3 }, { 4, 5, 6 } }$;\n}\n\";\n\t\t\tvar result = Resolve<ArrayCreateResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32[,]\", result.Type.ReflectionName);\n\t\t\tAssert.AreEqual(6, result.InitializerElements.Count);\n\t\t\tAssert.AreEqual(2, result.SizeArguments.Count);\n\t\t\tAssert.AreEqual(5, result.SizeArguments[0].ConstantValue);\n\t\t\tAssert.AreEqual(6, result.SizeArguments[1].ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArraySizeArgumentConversion()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic byte b = 5;\n\tint[] a = new int[$b$];\n}\n\";\n\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayInitializerConversion()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic byte b = 5;\n\tint[] a = new int[] { $b$ };\n}\n\";\n\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayInitializerConversion2()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic byte b = 5;\n\tint[] a = { $b$ };\n}\n\";\n\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, GetConversion(program));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/AttributeTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class AttributeTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void NamespaceInAttributeContext()\n\t\t{\n\t\t\tstring program = \"using System; [$System.Runtime$.CompilerServices.IndexerName(\\\"bla\\\")] class Test { }\";\n\t\t\tNamespaceResolveResult result = Resolve<NamespaceResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Runtime\", result.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeWithShortName()\n\t\t{\n\t\t\tstring program = \"using System; [$Obsolete$()] class Test {}\";\n\t\t\t\n\t\t\tTypeResolveResult result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.ObsoleteAttribute\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QualifiedAttributeWithShortName()\n\t\t{\n\t\t\tstring program = \"using System; [$System.Obsolete$()] class Test {}\";\n\t\t\t\n\t\t\tTypeResolveResult result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.ObsoleteAttribute\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeConstructor1()\n\t\t{\n\t\t\tstring program = \"using System; [$LoaderOptimization(3)$] class Test { }\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.LoaderOptimizationAttribute..ctor\", mrr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Byte\", mrr.Member.Parameters[0].Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeConstructor2()\n\t\t{\n\t\t\tstring program = \"using System; [$LoaderOptimization(LoaderOptimization.NotSpecified)$] class Test { }\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.LoaderOptimizationAttribute..ctor\", mrr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.LoaderOptimization\", mrr.Member.Parameters[0].Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeWithoutArgumentListRefersToConstructor()\n\t\t{\n\t\t\tstring program = \"using System; [$Obsolete$] class Test {}\";\n\t\t\t\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.ObsoleteAttribute..ctor\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeArgumentInClassContext1()\n\t\t{\n\t\t\tstring program = @\"using System;\n[AttributeUsage($XXX$)] class MyAttribute : Attribute {\n\tpublic const AttributeTargets XXX = AttributeTargets.All;\n}\n\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"MyAttribute.XXX\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AttributeArgumentInClassContext2()\n\t\t{\n\t\t\tstring program = @\"using System; namespace MyNamespace {\n[SomeAttribute($E.A$)] class Test { }\nenum E { A, B }\n}\n\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"MyNamespace.E.A\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SD_1384()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Flags {\n\t$[Flags]\n\tenum Test { }$\n}\";\n\t\t\tTypeResolveResult result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Flags.Test\", result.Type.FullName);\n\t\t\t\n\t\t\tvar rt = result.Type.GetDefinition().Attributes[0].AttributeType;\n\t\t\tAssert.AreEqual(\"System.FlagsAttribute\", rt.FullName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/BinaryOperatorTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t// assign short name to the fake reflection type\n\tusing dynamic = ICSharpCode.NRefactory.TypeSystem.ReflectionHelper.Dynamic;\n\t\n\t[TestFixture]\n\tpublic unsafe class BinaryOperatorTests : ResolverTestBase\n\t{\n\t\tCSharpResolver resolver;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tresolver = new CSharpResolver(compilation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Multiplication()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(int)), BinaryOperatorType.Multiply, MakeResult(typeof(int)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(int));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int)), BinaryOperatorType.Multiply, MakeConstant(0.0f),\n\t\t\t             Conversion.ImplicitNumericConversion, Conversion.IdentityConversion, typeof(float));\n\t\t\t\n\t\t\tAssertConstant(3.0f, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Multiply, MakeConstant(1.5f), MakeConstant(2)));\n\t\t\t\n\t\t\tAssertConstant(6, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Multiply, MakeConstant((byte)2), MakeConstant((byte)3)));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(uint?)), BinaryOperatorType.Multiply, MakeResult(typeof(int?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.ImplicitNullableConversion, typeof(long?));\n\t\t\t\n\t\t\tAssertError(typeof(decimal), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Multiply, MakeResult(typeof(float)), MakeResult(typeof(decimal))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Addition()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(short)), BinaryOperatorType.Add, MakeResult(typeof(byte?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t\t\n\t\t\tAssertConstant(3.0, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant(1.0f), MakeConstant(2.0)));\n\t\t\t\n\t\t\tAssertConstant(\"Text\", resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant(\"Te\"), MakeConstant(\"xt\")));\n\t\t\t\n\t\t\tAssertConstant(\"\", resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant(null), resolver.ResolveCast(ResolveType(typeof(string)), MakeConstant(null))));\n\t\t\t\n\t\t\tAssertError(typeof(ReflectionHelper.Null), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant(null), MakeConstant(null)));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int?)), BinaryOperatorType.Add, MakeResult(typeof(uint?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.ImplicitNullableConversion, typeof(long?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(ushort?)), BinaryOperatorType.Add, MakeResult(typeof(ushort?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t\t\n\t\t\tTestOperator(MakeConstant(1), BinaryOperatorType.Add, MakeConstant(null),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.NullLiteralConversion, typeof(int?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StringPlusNull()\n\t\t{\n\t\t\tResolveResult left = MakeResult(typeof(string));\n\t\t\tvar rr = (OperatorResolveResult)resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, left, MakeConstant(null));\n\t\t\tAssertType(typeof(string), rr);\n\t\t\tAssert.AreSame(left, rr.Operands[0]);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Operands[1].Type.FullName);\n\t\t\tAssert.IsTrue(rr.Operands[1].IsCompileTimeConstant);\n\t\t\tAssert.IsNull(rr.Operands[1].ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DelegateAddition()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(Action)), BinaryOperatorType.Add, MakeResult(typeof(Action)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(Action));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(Action<object>)), BinaryOperatorType.Add, MakeResult(typeof(Action<string>)),\n\t\t\t             Conversion.ImplicitReferenceConversion, Conversion.IdentityConversion, typeof(Action<string>));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(Action<string>)), BinaryOperatorType.Add, MakeResult(typeof(Action<object>)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitReferenceConversion, typeof(Action<string>));\n\t\t\t\n\t\t\tAssert.IsTrue(resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeResult(typeof(Action<int>)), MakeResult(typeof(Action<long>))).IsError);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void EnumAddition()\n\t\t{\n\t\t\tAssertConstant(StringComparison.Ordinal, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant(StringComparison.InvariantCulture), MakeConstant(2)));\n\t\t\t\n\t\t\tAssertConstant(StringComparison.OrdinalIgnoreCase, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant((short)3), MakeConstant(StringComparison.InvariantCulture)));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(StringComparison?)), BinaryOperatorType.Add, MakeResult(typeof(int)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNullableConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(StringComparison)), BinaryOperatorType.Add, MakeResult(typeof(int?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.IdentityConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(StringComparison?)), BinaryOperatorType.Add, MakeResult(typeof(int?)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int)), BinaryOperatorType.Add, MakeResult(typeof(StringComparison?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.IdentityConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int?)), BinaryOperatorType.Add, MakeResult(typeof(StringComparison?)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(StringComparison?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PointerAddition()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(int*)), BinaryOperatorType.Add, MakeConstant(1),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(int*));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(long)), BinaryOperatorType.Add, MakeResult(typeof(byte*)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(byte*));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AdditionWithOverflow()\n\t\t{\n\t\t\tAssertConstant(int.MinValue, resolver.WithCheckForOverflow(false).ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant(int.MaxValue), MakeConstant(1)));\n\t\t\t\n\t\t\tAssertError(typeof(int), resolver.WithCheckForOverflow(true).ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Add, MakeConstant(int.MaxValue), MakeConstant(1)));\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void Subtraction()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(short)), BinaryOperatorType.Subtract, MakeResult(typeof(byte?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(float)), BinaryOperatorType.Subtract, MakeResult(typeof(long)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNumericConversion, typeof(float));\n\t\t\t\n\t\t\tAssertConstant(-1.0, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeConstant(1.0f), MakeConstant(2.0)));\n\t\t\t\n\t\t\tAssert.IsTrue(resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeConstant(\"Te\"), MakeConstant(\"xt\")).IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumSubtraction()\n\t\t{\n\t\t\tAssertConstant(StringComparison.InvariantCulture, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeConstant(StringComparison.Ordinal), MakeConstant(2)));\n\t\t\t\n\t\t\tAssertConstant(3, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeConstant(StringComparison.OrdinalIgnoreCase), MakeConstant(StringComparison.InvariantCulture)));\n\t\t\t\n\t\t\tAssertConstant(StringComparison.InvariantCulture, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeConstant(StringComparison.InvariantCulture), MakeConstant(0)));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(StringComparison?)), BinaryOperatorType.Subtract, MakeResult(typeof(int)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNullableConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(StringComparison?)), BinaryOperatorType.Subtract, MakeResult(typeof(StringComparison)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int?)), BinaryOperatorType.Subtract, MakeResult(typeof(StringComparison)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNullableConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int)), BinaryOperatorType.Subtract, MakeResult(typeof(StringComparison?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.IdentityConversion, typeof(StringComparison?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DelegateSubtraction()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(Action)), BinaryOperatorType.Subtract, MakeResult(typeof(Action)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(Action));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(Action<object>)), BinaryOperatorType.Subtract, MakeResult(typeof(Action<string>)),\n\t\t\t             Conversion.ImplicitReferenceConversion, Conversion.IdentityConversion, typeof(Action<string>));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(Action<string>)), BinaryOperatorType.Subtract, MakeResult(typeof(Action<object>)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitReferenceConversion, typeof(Action<string>));\n\t\t\t\n\t\t\tAssert.IsTrue(resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeResult(typeof(Action<int>)), MakeResult(typeof(Action<long>))).IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PointerSubtraction()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(int*)), BinaryOperatorType.Subtract, MakeConstant(1),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(int*));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(byte*)), BinaryOperatorType.Subtract, MakeResult(typeof(uint)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(byte*));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(byte*)), BinaryOperatorType.Subtract, MakeResult(typeof(short)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNumericConversion, typeof(byte*));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(byte*)), BinaryOperatorType.Subtract, MakeResult(typeof(byte*)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(long));\n\t\t\t\n\t\t\tAssertError(typeof(long), resolver.ResolveBinaryOperator(BinaryOperatorType.Subtract, MakeResult(typeof(byte*)), MakeResult(typeof(int*))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShiftTest()\n\t\t{\n\t\t\tAssertConstant(6, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ShiftLeft, MakeConstant(3), MakeConstant(1)));\n\t\t\t\n\t\t\tAssertConstant(ulong.MaxValue >> 2, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ShiftRight, MakeConstant(ulong.MaxValue), MakeConstant(2)));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(ushort?)), BinaryOperatorType.ShiftLeft, MakeConstant(1),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t\t\n\t\t\tTestOperator(MakeConstant(null), BinaryOperatorType.ShiftLeft, MakeConstant(1),\n\t\t\t             Conversion.NullLiteralConversion, Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(long)), BinaryOperatorType.ShiftLeft, MakeConstant(null),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.NullLiteralConversion, typeof(long?));\n\t\t\t\n\t\t\tTestOperator(MakeConstant(null), BinaryOperatorType.ShiftLeft,  MakeConstant(null),\n\t\t\t             Conversion.NullLiteralConversion, Conversion.NullLiteralConversion, typeof(int?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstantEquality()\n\t\t{\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(3), MakeConstant(3)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(3), MakeConstant(3.0)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(2.9), MakeConstant(3)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(double.NaN), MakeConstant(double.NaN)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(float.NaN), MakeConstant(float.NaN)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(\"A\"), MakeConstant(\"B\")));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(\"A\"), MakeConstant(\"A\")));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(\"\"), MakeConstant(null)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(null), MakeConstant(null)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(1), MakeConstant(null)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(null), MakeConstant('a')));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Equality()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(int*)), BinaryOperatorType.Equality, MakeResult(typeof(uint*)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(bool));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int)), BinaryOperatorType.Equality, MakeResult(typeof(int?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.IdentityConversion, typeof(bool));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int)), BinaryOperatorType.Equality, MakeResult(typeof(float)),\n\t\t\t             Conversion.ImplicitNumericConversion, Conversion.IdentityConversion, typeof(bool));\n\t\t\t\n\t\t\tAssertType(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeResult(typeof(int)), MakeConstant(null)));\n\t\t\t\n\t\t\tAssertError(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeResult(typeof(int)), MakeResult(typeof(string))));\n\t\t\t\n\t\t\tAssertError(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeResult(typeof(int)), MakeResult(typeof(object))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Inequality()\n\t\t{\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(3), MakeConstant(3)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(3), MakeConstant(3.0)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(2.9), MakeConstant(3)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(double.NaN), MakeConstant(double.NaN)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(float.NaN), MakeConstant(double.NaN)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(float.NaN), MakeConstant(float.NaN)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(\"A\"), MakeConstant(\"B\")));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(\"A\"), MakeConstant(\"A\")));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(\"\"), MakeConstant(null)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(null), MakeConstant(null)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(1), MakeConstant(null)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeConstant(null), MakeConstant('a')));\n\t\t\t\n\t\t\tAssertType(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeResult(typeof(int*)), MakeResult(typeof(uint*))));\n\t\t\t\n\t\t\tAssertType(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.InEquality, MakeResult(typeof(bool?)), MakeConstant(null)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EqualityEnum()\n\t\t{\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(0), MakeConstant(StringComparison.Ordinal)));\n\t\t\t\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(0), MakeConstant(StringComparison.CurrentCulture)));\n\t\t\t\n\t\t\tAssert.IsFalse(resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Equality, MakeConstant(StringComparison.Ordinal), MakeConstant(1)).IsCompileTimeConstant);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void RelationalOperators()\n\t\t{\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.LessThan, MakeConstant(0), MakeConstant(0)));\n\t\t\t\n\t\t\tAssertType(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.LessThan, MakeResult(typeof(int*)), MakeResult(typeof(uint*))));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(int?)), BinaryOperatorType.LessThan, MakeResult(typeof(int)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNullableConversion, typeof(bool));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void RelationalEnum()\n\t\t{\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.LessThan, MakeConstant(0), MakeConstant(StringComparison.Ordinal)));\n\t\t\t\n\t\t\tAssertError(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.LessThanOrEqual, MakeConstant(1), MakeConstant(StringComparison.Ordinal)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.GreaterThan, MakeConstant(StringComparison.CurrentCultureIgnoreCase), MakeConstant(StringComparison.Ordinal)));\n\t\t\t\n\t\t\tAssertType(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.GreaterThan, MakeResult(typeof(StringComparison?)), MakeResult(typeof(StringComparison?))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitAnd()\n\t\t{\n\t\t\tAssertConstant(5, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeConstant(7), MakeConstant(13)));\n\t\t\t\n\t\t\tAssertType(typeof(int?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeConstant(null), MakeConstant((short)13)));\n\t\t\t\n\t\t\tAssertType(typeof(long?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeResult(typeof(uint?)), MakeConstant((short)13)));\n\t\t\t\n\t\t\tAssertType(typeof(uint?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeResult(typeof(uint?)), MakeConstant((int)13)));\n\t\t\t\n\t\t\tAssertType(typeof(ulong?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeResult(typeof(ulong?)), MakeConstant((long)13)));\n\t\t\t\n\t\t\tAssert.IsTrue(resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeResult(typeof(ulong?)), MakeConstant((short)13)).IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitXor()\n\t\t{\n\t\t\tAssertConstant(6L ^ 3, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ExclusiveOr, MakeConstant(6L), MakeConstant(3)));\n\t\t\t\n\t\t\tAssertConstant(6UL ^ 3L, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ExclusiveOr, MakeConstant(6UL), MakeConstant(3L)));\n\t\t\t\n\t\t\tAssertError(typeof(ulong), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ExclusiveOr, MakeConstant(6UL), MakeConstant(-3L)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BitwiseEnum()\n\t\t{\n\t\t\tAssertConstant(AttributeTargets.Field | AttributeTargets.Property, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseOr, MakeConstant(AttributeTargets.Field), MakeConstant(AttributeTargets.Property)));\n\t\t\t\n\t\t\tAssertConstant(AttributeTargets.Field & AttributeTargets.All, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeConstant(AttributeTargets.Field), MakeConstant(AttributeTargets.All)));\n\t\t\t\n\t\t\tAssertConstant(AttributeTargets.Field & 0, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseAnd, MakeConstant(AttributeTargets.Field), MakeConstant(0)));\n\t\t\t\n\t\t\tAssertConstant(0 | AttributeTargets.Field, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.BitwiseOr, MakeConstant(0), MakeConstant(AttributeTargets.Field)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableBitwiseEnum()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(StringComparison?)), BinaryOperatorType.BitwiseAnd, MakeResult(typeof(StringComparison?)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(StringComparison)), BinaryOperatorType.BitwiseAnd, MakeResult(typeof(StringComparison?)),\n\t\t\t             Conversion.ImplicitNullableConversion, Conversion.IdentityConversion, typeof(StringComparison?));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(StringComparison?)), BinaryOperatorType.BitwiseAnd, MakeResult(typeof(StringComparison)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNullableConversion, typeof(StringComparison?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LogicalAnd()\n\t\t{\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ConditionalAnd, MakeConstant(true), MakeConstant(true)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ConditionalAnd, MakeConstant(false), MakeConstant(true)));\n\t\t\t\n\t\t\tAssertError(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ConditionalAnd, MakeConstant(false), MakeResult(typeof(bool?))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LogicalOr()\n\t\t{\n\t\t\tAssertConstant(true, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ConditionalOr, MakeConstant(false), MakeConstant(true)));\n\t\t\t\n\t\t\tAssertConstant(false, resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ConditionalOr, MakeConstant(false), MakeConstant(false)));\n\t\t\t\n\t\t\tAssertError(typeof(bool), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.ConditionalOr, MakeConstant(false), MakeResult(typeof(bool?))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullCoalescing()\n\t\t{\n\t\t\tAssertType(typeof(int), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.NullCoalescing, MakeResult(typeof(int?)), MakeResult(typeof(short))));\n\t\t\t\n\t\t\tAssertType(typeof(int?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.NullCoalescing, MakeResult(typeof(int?)), MakeResult(typeof(short?))));\n\t\t\t\n\t\t\tAssertType(typeof(object), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.NullCoalescing, MakeResult(typeof(string)), MakeResult(typeof(object))));\n\t\t\t\n\t\t\tAssertError(typeof(string), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.NullCoalescing, MakeResult(typeof(string)), MakeResult(typeof(int))));\n\t\t\t\n\t\t\tAssertType(typeof(dynamic), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.NullCoalescing, MakeResult(typeof(dynamic)), MakeResult(typeof(string))));\n\t\t\t\n\t\t\tAssertType(typeof(dynamic), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.NullCoalescing, MakeResult(typeof(string)), MakeResult(typeof(dynamic))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LiftedUserDefined()\n\t\t{\n\t\t\tAssertType(typeof(TimeSpan), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeResult(typeof(DateTime)), MakeResult(typeof(DateTime))));\n\t\t\tAssertType(typeof(TimeSpan?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeResult(typeof(DateTime?)), MakeResult(typeof(DateTime))));\n\t\t\tAssertType(typeof(TimeSpan?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeResult(typeof(DateTime)), MakeResult(typeof(DateTime?))));\n\t\t\tAssertType(typeof(TimeSpan?), resolver.ResolveBinaryOperator(\n\t\t\t\tBinaryOperatorType.Subtract, MakeResult(typeof(DateTime?)), MakeResult(typeof(DateTime?))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ByteEnumSubtraction()\n\t\t{\n\t\t\tstring program = @\"enum E : byte {\n  A = 1,\n  B = 2\n}\nclass Test {\n\tconst int $j = E.A - E.B$;\n}\n\";\n\t\t\t// result is 255 in C# 2.0 and later (was -1 in C# 1.x)\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(255, rr.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedNeedsLiftingDueToImplicitConversion()\n\t\t{\n\t\t\tstring program = @\"struct S {}\nstruct A {\n\tpublic static implicit operator S?(A a) { return null; }\n\t\n\tpublic static S operator +(A a, S s) { return s; }\n}\nclass Test {\n\tvoid M(A a) {\n\t\tvar s = $a + a$;\n\t}\n}\n\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.IsTrue(irr.IsLiftedOperator);\n\t\t\tAssert.IsTrue(irr.UserDefinedOperatorMethod is OverloadResolution.ILiftedOperator);\n\t\t\tAssert.AreEqual(\"A.op_Addition\", irr.UserDefinedOperatorMethod.FullName);\n\t\t\tAssert.AreEqual(\"System.Nullable`1[[S]]\", irr.Type.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Nullable`1[[S]]\", irr.UserDefinedOperatorMethod.ReturnType.ReflectionName);\n\t\t\t\n\t\t\tConversion lhsConv = ((ConversionResolveResult)irr.Operands[0]).Conversion;\n\t\t\tConversion rhsConv = ((ConversionResolveResult)irr.Operands[1]).Conversion;\n\t\t\tAssert.AreEqual(Conversion.ImplicitNullableConversion, lhsConv);\n\t\t\tAssert.IsTrue(rhsConv.IsUserDefined);\n\t\t\tAssert.AreEqual(\"A.op_Implicit\", rhsConv.Method.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ThereAreNoLiftedOperatorsForClasses()\n\t\t{\n\t\t\tstring program = @\"struct S {}\nclass A {\n\tpublic static implicit operator S?(A a) { return null; }\n\t\n\tpublic static S operator +(A a, S s) { return s; }\n}\nclass Test {\n\tvoid M(A a) {\n\t\tvar s = $a + a$;\n\t}\n}\n\";\n\t\t\tvar irr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsTrue(irr.IsError); // cannot convert from A to S\n\t\t\tAssert.AreEqual(\"A.op_Addition\", irr.Member.FullName);\n\t\t\tAssert.AreEqual(\"S\", irr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompoundAssign_String_Char()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tstring text;\n\tvoid Append(char c) {\n\t\t$text += c$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.AreEqual(System.Linq.Expressions.ExpressionType.AddAssign, irr.OperatorType);\n\t\t\tAssert.IsNull(irr.UserDefinedOperatorMethod);\n\t\t\tAssert.AreEqual(\"System.String\", irr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompoundAssign_Byte_Literal1()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tbyte c;\n\tvoid Inc() {\n\t\t$c += 1$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.AreEqual(System.Linq.Expressions.ExpressionType.AddAssign, irr.OperatorType);\n\t\t\tAssert.IsNull(irr.UserDefinedOperatorMethod);\n\t\t\tAssert.AreEqual(\"System.Byte\", irr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompareDateTimeWithNullLiteral()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tstatic void Inc(DateTime x) {\n\t\tvar c = $x == null$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.IsTrue(irr.IsLiftedOperator);\n\t\t\tAssert.IsNotNull(irr.UserDefinedOperatorMethod);\n\t\t\tAssert.AreEqual(compilation.FindType(KnownTypeCode.Boolean), irr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompareStructWithNullLiteral()\n\t\t{\n\t\t\tstring program = @\"\nstruct X { }\nclass Test {\n\tstatic void Inc(X x) {\n\t\tvar c = $x == null$;\n\t}\n}\";\n\t\t\tvar irr = Resolve(program);\n\t\t\tAssert.IsTrue(irr.IsError);\n\t\t\tAssert.AreEqual(compilation.FindType(KnownTypeCode.Boolean), irr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompareNullableStructWithNullLiteral()\n\t\t{\n\t\t\tstring program = @\"\nstruct X { }\nclass Test {\n\tstatic void Inc(X? x) {\n\t\tvar c = $x == null$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.AreEqual(compilation.FindType(KnownTypeCode.Boolean), irr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompareUnrestrictedTypeParameterWithNullLiteral()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tstatic void Inc<X>(X x) {\n\t\tvar c = $x == null$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.AreEqual(compilation.FindType(KnownTypeCode.Boolean), irr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LiftedEqualityOperator()\n\t\t{\n\t\t\tstring program = @\"\nstruct X {\n\tpublic static bool operator ==(X a, X b) {}\n}\nclass Test {\n\tstatic void Inc(X? x) {\n\t\tvar c = $x == x$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.AreEqual(compilation.FindType(KnownTypeCode.Boolean), irr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IsLiftedProperty()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n    static void Inc() {\n        int? a = 0, b = 0;\n        int? c = $a + b$;\n    }\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.IsTrue(irr.IsLiftedOperator);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IsLiftedProperty2()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n    static void Inc() {\n        int? a = 0, b = 0;\n        $b += a$;\n    }\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.IsTrue(irr.IsLiftedOperator);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLiftedOperatorBug()\n\t\t{\n\t\t\tstring program = @\"\nusing System;\n\nstruct C<T>\n{\n\tpublic static C<T> operator+(C<T> u, T u2)\n\t{\n\t\treturn u;\n\t}\n\n\tpublic C ()\n\t{\n\t\tint? foo = 4;\n\t\tvar a = $new C<int> () + foo$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.IsTrue(irr.IsLiftedOperator);\n\t\t\tAssert.AreEqual(\"System.Nullable`1[[C`1[[System.Int32]]]]\", irr.Type.ReflectionName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12717 - Wrong type resolved for enum substraction\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestIntEnumSubstraction()\n\t\t{\n\t\t\tstring program = @\"using System;\n\nenum E\n{\n    V\n}\n\nclass Test\n{\n    public static void Main ()\n    {\n\n        E e = 0;\n        var res = $1 - e$;\n    }\n}\";\n\t\t\tvar rr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.AreEqual(\"E\", rr.Type.FullName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12689 - Wrong type of bitwise operation with enums\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestEnumBitwiseAndOperatorOverloading()\n\t\t{\n\t\t\tstring program = @\"using System;\n\nstruct S\n{\n    public static implicit operator E? (S s)\n    {\n        return 0;\n    }\n}\n\n\npublic enum E\n{\n\n}\n\nclass C\n{\n    public static void Main ()\n    {\n        E e = 0;\n        S s;\n        var res = $e & s$; // INVALID type of res XS shows int but should be E?\n    }\n}\";\n\t\t\tvar rr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Nullable`1[[E]]\", rr.Type.ReflectionName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12677 - Wrong result of constant binary result\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestEnumSubstractionWithNull()\n\t\t{\n\t\t\tstring program = @\"using System;\n\npublic enum E\n{\n}\n\nclass C\n{\n    public static void Main ()\n    {\n        E? e = null;\n        var res = $(e - null).Value$; // Value is E but should be int\n    }\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.ReflectionName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 12670 - Wrong type resolution for enums\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestEnumBitwiseAndOperatorWithNull()\n\t\t{\n\t\t\tstring program = @\"public enum E {}\n\nclass C\n{\n    public static void Main ()\n    {\n        E f = 0;\n        var res = $f & null$; // XS sees Value as type uint instead of E\n    }\n}\";\n\t\t\tvar rr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Nullable`1[[E]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumSubtractionWithImplicitOperators()\n\t\t{\n\t\t\tstring program = @\"using System;\npublic enum E {}\nstruct S {\n    public static implicit operator E (S s) { return 0; }\n    public static implicit operator int (S s) { return 0; }\n}\n\nclass C\n{\n    public void Test(E e, S s)\n    {\n        var res = $e - s$; // C# uses the conversion to E, so result will be int\n    }\n}\";\n\t\t\tvar rr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.ReflectionName);\n\t\t\tvar c = ((ConversionResolveResult)rr.Operands[1]).Conversion;\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"E\", c.Method.ReturnType.ReflectionName);\n\t\t}\n\t\t\n\t\tITypeDefinition enumWithMissingBaseType = TypeSystemHelper.CreateCompilationWithoutCorlibAndResolve(\n\t\t\tnew DefaultUnresolvedTypeDefinition(\"MyEnum\") {\n\t\t\t\tKind = TypeKind.Enum,\n\t\t\t\tBaseTypes = { KnownTypeReference.Int32 }\n\t\t\t}\n\t\t);\n\t\t\n\t\t[Test]\n\t\tpublic void EnumBitwiseOrWithMissingBaseType()\n\t\t{\n\t\t\tvar resolver = new CSharpResolver(enumWithMissingBaseType.Compilation);\n\t\t\tvar lhs = new ConstantResolveResult(enumWithMissingBaseType, 1);\n\t\t\tvar rhs = new ConstantResolveResult(enumWithMissingBaseType, 2);\n\t\t\tvar rr = (ConstantResolveResult)resolver.ResolveBinaryOperator(BinaryOperatorType.BitwiseOr, lhs, rhs);\n\t\t\tAssert.AreEqual(enumWithMissingBaseType, rr.Type);\n\t\t\tAssert.AreEqual(3, rr.ConstantValue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/CastTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t// assign short name to the fake reflection type\n\tusing dynamic = ICSharpCode.NRefactory.TypeSystem.ReflectionHelper.Dynamic;\n\t\n\t[TestFixture]\n\tpublic class CastTests : ResolverTestBase\n\t{\n\t\tCSharpResolver resolver;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tresolver = new CSharpResolver(compilation);\n\t\t}\n\t\t\n\t\tvoid TestCast(Type targetType, ResolveResult input, Conversion expectedConversion)\n\t\t{\n\t\t\tIType type = compilation.FindType(targetType);\n\t\t\tResolveResult rr = resolver.ResolveCast(type, input);\n\t\t\tAssertType(targetType, rr);\n\t\t\tAssert.AreEqual(typeof(ConversionResolveResult), rr.GetType());\n\t\t\tvar crr = (ConversionResolveResult)rr;\n\t\t\tAssert.AreEqual(expectedConversion, crr.Conversion, \"ConversionResolveResult.Conversion\");\n\t\t\tAssert.AreSame(input, crr.Input, \"ConversionResolveResult.Input\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleCast()\n\t\t{\n\t\t\tTestCast(typeof(int), MakeResult(typeof(float)), Conversion.ExplicitNumericConversion);\n\t\t\tTestCast(typeof(string), MakeResult(typeof(object)), Conversion.ExplicitReferenceConversion);\n\t\t\tTestCast(typeof(byte), MakeResult(typeof(dynamic)), Conversion.ExplicitDynamicConversion);\n\t\t\tTestCast(typeof(dynamic), MakeResult(typeof(double)), Conversion.BoxingConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableCasts()\n\t\t{\n\t\t\tTestCast(typeof(int), MakeResult(typeof(int?)), Conversion.ExplicitNullableConversion);\n\t\t\tTestCast(typeof(int?), MakeResult(typeof(int)), Conversion.ImplicitNullableConversion);\n\t\t\t\n\t\t\tTestCast(typeof(int?), MakeResult(typeof(long?)), Conversion.ExplicitLiftedNumericConversion);\n\t\t\tTestCast(typeof(long?), MakeResult(typeof(int?)), Conversion.ImplicitLiftedNumericConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstantValueCast()\n\t\t{\n\t\t\tAssertConstant(\"Hello\", resolver.ResolveCast(ResolveType(typeof(string)), MakeConstant(\"Hello\")));\n\t\t\tAssertConstant((byte)1L, resolver.ResolveCast(ResolveType(typeof(byte)), MakeConstant(1L)));\n\t\t\tAssertConstant(3, resolver.ResolveCast(ResolveType(typeof(int)), MakeConstant(3.1415)));\n\t\t\tAssertConstant(3, resolver.ResolveCast(ResolveType(typeof(int)), MakeConstant(3.99)));\n\t\t\tAssertConstant((short)-3, resolver.ResolveCast(ResolveType(typeof(short)), MakeConstant(-3.99f)));\n\t\t\tAssertConstant(-3L, resolver.ResolveCast(ResolveType(typeof(long)), MakeConstant(-3.5)));\n\t\t}\n\n#if __MonoCS__\n\t\t[Ignore(\"Broken on mcs/mac os x\")]\n#endif\n\t\t[Test]\n\t\tpublic void OverflowingCast()\n\t\t{\n\t\t\tAssertConstant(uint.MaxValue, resolver.WithCheckForOverflow(false).ResolveCast(ResolveType(typeof(uint)), MakeConstant(-1.6)));\n\t\t\tAssertError(typeof(uint), resolver.WithCheckForOverflow(true).ResolveCast(ResolveType(typeof(uint)), MakeConstant(-1.6)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FailingStringCast()\n\t\t{\n\t\t\tAssertError(typeof(string), resolver.ResolveCast(ResolveType(typeof(string)), MakeConstant(1)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OverflowingCastToEnum()\n\t\t{\n\t\t\tAssertError(typeof(StringComparison), resolver.WithCheckForOverflow(true).ResolveCast(ResolveType(typeof(StringComparison)), MakeConstant(long.MaxValue)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitCastInConstant()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tconst int $MAXSIZE = ushort.MaxValue;\n}\";\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(program);\n\t\t\tIField field = (IField)rr.Member;\n\t\t\tAssert.IsTrue(field.IsConst);\n\t\t\tAssert.AreEqual(\"System.Int32\", field.Type.FullName);\n\t\t\tAssert.AreEqual(typeof(int), field.ConstantValue.GetType());\n\t\t\tAssert.AreEqual(ushort.MaxValue, (int)field.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitCastInLocalConstant()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tvoid M() {\n\t\tconst int $MAXSIZE = ushort.MaxValue;\n\t}\n}\";\n\t\t\tvar rr = ResolveAtLocation<LocalResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Variable.IsConst);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Variable.Type.FullName);\n\t\t\tAssert.AreEqual(typeof(int), rr.Variable.ConstantValue.GetType());\n\t\t\tAssert.AreEqual(ushort.MaxValue, (int)rr.Variable.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitConversion_In_Assignment()\n\t\t{\n\t\t\tstring input = @\"\nclass Test {\n\tvoid M(int i) {\n\t\tlong l;\n\t\tl = $(long)i$;\n\t}\n}\";\n\t\t\tvar crr = Resolve<ConversionResolveResult>(input);\n\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, crr.Conversion);\n\t\t\tAssert.AreEqual(Conversion.IdentityConversion, GetConversion(input));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitConversion_In_Assignment_Followed_By_ImplicitConversion()\n\t\t{\n\t\t\tstring input = @\"\nclass Test {\n\tvoid M(short i) {\n\t\tlong l;\n\t\tl = $(int)i$;\n\t}\n}\";\n\t\t\tvar crr = Resolve<ConversionResolveResult>(input);\n\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, crr.Conversion);\n\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, GetConversion(input));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitConversion_In_BinaryOperator()\n\t\t{\n\t\t\tstring input = @\"\nclass Test {\n\tvoid M(int i) {\n\t\tlong n;\n\t\tn = n + $(long)i$;\n\t}\n}\";\n\t\t\tvar crr = Resolve<ConversionResolveResult>(input);\n\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, crr.Conversion);\n\t\t\tAssert.AreEqual(Conversion.IdentityConversion, GetConversion(input));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitConversion_In_BinaryOperator_Navigator()\n\t\t{\n\t\t\tstring input = @\"\nclass Test {\n\tvoid M(int i) {\n\t\tlong n;\n\t\tn = n + $(long)i$;\n\t}\n}\";\n\t\t\tvar tuple = PrepareResolver(input);\n\t\t\tvar astResolver = tuple.Item1;\n\t\t\tvar castExpression = (CastExpression)tuple.Item2;\n\t\t\tvar navigator = new ExplicitConversion_In_BinaryOperator_NavigatorImpl(castExpression);\n\t\t\tastResolver.ApplyNavigator(navigator);\n\t\t\tAssert.AreEqual(1, navigator.CallCount);\n\t\t}\n\t\t\n\t\tclass ExplicitConversion_In_BinaryOperator_NavigatorImpl : IResolveVisitorNavigator\n\t\t{\n\t\t\tCastExpression castExpression;\n\t\t\tpublic int CallCount;\n\t\t\t\n\t\t\tpublic ExplicitConversion_In_BinaryOperator_NavigatorImpl(CastExpression castExpression)\n\t\t\t{\n\t\t\t\tthis.castExpression = castExpression;\n\t\t\t}\n\t\t\t\n\t\t\tpublic ResolveVisitorNavigationMode Scan(AstNode node)\n\t\t\t{\n\t\t\t\treturn ResolveVisitorNavigationMode.Resolve;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Resolved(AstNode node, ResolveResult result)\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tpublic void ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)\n\t\t\t{\n\t\t\t\tCallCount++;\n\t\t\t\tAssert.AreEqual(Conversion.ImplicitNumericConversion, conversion);\n\t\t\t\tAssert.AreSame(castExpression.Expression, expression);\n\t\t\t\tAssert.IsInstanceOf<LocalResolveResult>(result);\n\t\t\t\tAssert.AreEqual(\"System.Int32\", result.Type.ReflectionName);\n\t\t\t\tAssert.AreEqual(\"System.Int64\", targetType.ReflectionName);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ComTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class ComTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void NewCoClass()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Runtime.InteropServices;\n\n[ComImport, Guid(\"\"698D8281-3890-41A6-8A2F-DBC29CBAB8BC\"\"), CoClass(typeof(Test))]\npublic interface Dummy { }\n\npublic class Test : Dummy {\n\tpublic Test(int x = 1) {}\n\t\n\tstatic void Main() {\n\t\t$\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"var x = $new Dummy()$;\"));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"Dummy\", rr.Type.ReflectionName);\n\t\t\tAssert.AreEqual(1, rr.Member.Parameters.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CyclicCoClass()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Runtime.InteropServices;\n\n[ComImport, Guid(\"\"698D8281-3890-41A6-8A2F-DBC29CBAB8BC\"\"), CoClass(typeof(Dummy))]\npublic interface $Dummy { }\";\n\t\t\t\n\t\t\tvar trr = ResolveAtLocation<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(0, trr.Type.GetConstructors().Count());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConditionalOperatorTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t// assign short name to the fake reflection type\n\tusing dynamic = ICSharpCode.NRefactory.TypeSystem.ReflectionHelper.Dynamic;\n\t\n\t[TestFixture]\n\tpublic class ConditionalOperatorTests : ResolverTestBase\n\t{\n\t\tCSharpResolver resolver;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tresolver = new CSharpResolver(compilation);\n\t\t}\n\t\t\n\t\tvoid TestOperator(ResolveResult condition, ResolveResult trueExpr, ResolveResult falseExpr,\n\t\t                  Conversion conditionConv, Conversion trueConv, Conversion falseConv,\n\t\t                  Type expectedResultType)\n\t\t{\n\t\t\tvar corr = (OperatorResolveResult)resolver.ResolveConditional(condition, trueExpr, falseExpr);\n\t\t\tAssertType(expectedResultType, corr);\n\t\t\tAssertConversion(corr.Operands[0], condition, conditionConv, \"Condition Conversion\");\n\t\t\tAssertConversion(corr.Operands[1], trueExpr, trueConv, \"True Conversion\");\n\t\t\tAssertConversion(corr.Operands[2], falseExpr, falseConv, \"False Conversion\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PickMoreGeneralOfTheTypes()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(bool)), MakeResult(typeof(string)), MakeResult(typeof(object)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitReferenceConversion, Conversion.IdentityConversion,\n\t\t\t             typeof(object));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(bool)), MakeResult(typeof(int)), MakeResult(typeof(long)),\n\t\t\t             Conversion.IdentityConversion, Conversion.ImplicitNumericConversion, Conversion.IdentityConversion,\n\t\t\t             typeof(long));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StringAndNull()\n\t\t{\n\t\t\tResolveResult condition = MakeResult(typeof(bool));\n\t\t\tResolveResult trueExpr = MakeResult(typeof(string));\n\t\t\tvar result = (OperatorResolveResult)resolver.ResolveConditional(\n\t\t\t\tcondition, trueExpr, MakeConstant(null));\n\t\t\tAssertType(typeof(string), result);\n\t\t\tAssertConversion(result.Operands[0], condition, Conversion.IdentityConversion, \"Condition Conversion\");\n\t\t\tAssertConversion(result.Operands[1], trueExpr, Conversion.IdentityConversion, \"True Conversion\");\n\t\t\tAssert.IsTrue(result.Operands[2].IsCompileTimeConstant);\n\t\t\tAssert.IsNull(result.Operands[2].ConstantValue);\n\t\t\tAssert.AreEqual(\"System.String\", result.Operands[2].Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullAndString()\n\t\t{\n\t\t\tResolveResult condition = MakeResult(typeof(bool));\n\t\t\tResolveResult falseExpr = MakeResult(typeof(string));\n\t\t\tvar result = (OperatorResolveResult)resolver.ResolveConditional(\n\t\t\t\tcondition, MakeConstant(null), falseExpr);\n\t\t\tAssertType(typeof(string), result);\n\t\t\tAssertConversion(result.Operands[0], condition, Conversion.IdentityConversion, \"Condition Conversion\");\n\t\t\tAssert.IsTrue(result.Operands[1].IsCompileTimeConstant);\n\t\t\tAssert.IsNull(result.Operands[1].ConstantValue);\n\t\t\tAssert.AreEqual(\"System.String\", result.Operands[1].Type.FullName);\n\t\t\tAssertConversion(result.Operands[2], falseExpr, Conversion.IdentityConversion, \"False Conversion\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DynamicInArguments()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(bool)), MakeResult(typeof(dynamic)), MakeResult(typeof(double)),\n\t\t\t             Conversion.IdentityConversion, Conversion.IdentityConversion, Conversion.BoxingConversion,\n\t\t\t             typeof(dynamic));\n\t\t\t\n\t\t\tTestOperator(MakeResult(typeof(bool)), MakeResult(typeof(double)), MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, Conversion.BoxingConversion, Conversion.IdentityConversion,\n\t\t\t             typeof(dynamic));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DynamicInCondition()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(dynamic)), MakeResult(typeof(float)), MakeResult(typeof(double)),\n\t\t\t             Conversion.ImplicitDynamicConversion, Conversion.ImplicitNumericConversion, Conversion.IdentityConversion,\n\t\t\t             typeof(double));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AllDynamic()\n\t\t{\n\t\t\tTestOperator(MakeResult(typeof(dynamic)), MakeResult(typeof(dynamic)), MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.ImplicitDynamicConversion, Conversion.IdentityConversion, Conversion.IdentityConversion,\n\t\t\t             typeof(dynamic));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ListOfDynamicAndListOfObject()\n\t\t{\n\t\t\tAssertError(typeof(List<object>), resolver.ResolveConditional(\n\t\t\t\tMakeResult(typeof(bool)), MakeResult(typeof(List<object>)), MakeResult(typeof(List<dynamic>))));\n\t\t\t\n\t\t\tAssertError(typeof(List<dynamic>), resolver.ResolveConditional(\n\t\t\t\tMakeResult(typeof(bool)), MakeResult(typeof(List<dynamic>)), MakeResult(typeof(List<object>))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Constant()\n\t\t{\n\t\t\tAssertConstant(1L, resolver.ResolveConditional(\n\t\t\t\tMakeConstant(true), MakeConstant(1), MakeConstant(2L)));\n\t\t\t\n\t\t\tAssertConstant(2L, resolver.ResolveConditional(\n\t\t\t\tMakeConstant(false), MakeConstant(1), MakeConstant(2L)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NotConstantIfFalsePortionNotConstant()\n\t\t{\n\t\t\tAssertType(typeof(long), resolver.ResolveConditional(\n\t\t\t\tMakeConstant(true), MakeConstant(1), MakeResult(typeof(long))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ByteAndZeroLiteral()\n\t\t{\n\t\t\tAssertType(typeof(int), resolver.ResolveConditional(\n\t\t\t\tMakeResult(typeof(bool)), MakeResult(typeof(byte)), MakeConstant(0)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ByteAndUShort()\n\t\t{\n\t\t\tAssertType(typeof(ushort), resolver.ResolveConditional(\n\t\t\t\tMakeResult(typeof(bool)), MakeResult(typeof(byte)), MakeResult(typeof(ushort))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumAndZeroLiteral()\n\t\t{\n\t\t\tAssertType(typeof(StringComparison), resolver.ResolveConditional(\n\t\t\t\tMakeResult(typeof(bool)), MakeResult(typeof(StringComparison)), MakeConstant(0)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeWithImplicitConversionToBool()\n\t\t{\n\t\t\tstring program = @\"struct MyBool {\n\tpublic static implicit operator bool(MyBool b) {}\n\tvoid Test() {\n\t\tvar x = $this$ ? 1 : 0;\n\t}\n}\";\n\t\t\tAssert.AreEqual(\"System.Boolean\", GetExpectedType(program).ReflectionName);\n\t\t\tConversion c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"op_Implicit\", c.Method.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeWithOperatorTrue()\n\t\t{\n\t\t\tstring program = @\"struct MyBool {\n\tpublic static bool operator true(MyBool b) {}\n\tvoid Test() {\n\t\tvar x = $this$ ? 1 : 0;\n\t}\n}\";\n\t\t\tAssert.AreEqual(\"System.Boolean\", GetExpectedType(program).ReflectionName);\n\t\t\tConversion c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"op_True\", c.Method.Name);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t// assign short names to the fake reflection types\n\tusing Null = ICSharpCode.NRefactory.TypeSystem.ReflectionHelper.Null;\n\tusing dynamic = ICSharpCode.NRefactory.TypeSystem.ReflectionHelper.Dynamic;\n\tusing C = Conversion;\n\t\n\t[TestFixture]\n\tpublic unsafe class ConversionsTest : ResolverTestBase\n\t{\n\t\tCSharpConversions conversions;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tconversions = new CSharpConversions(compilation);\n\t\t}\n\t\t\n\t\tConversion ImplicitConversion(Type from, Type to)\n\t\t{\n\t\t\tIType from2 = compilation.FindType(from);\n\t\t\tIType to2 = compilation.FindType(to);\n\t\t\treturn conversions.ImplicitConversion(from2, to2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IdentityConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(char), typeof(char)));\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(string), typeof(string)));\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(object), typeof(object)));\n\t\t\tAssert.AreEqual(C.None,               ImplicitConversion(typeof(bool), typeof(char)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.IdentityConversion, conversions.ImplicitConversion(SpecialType.Dynamic, SpecialType.Dynamic));\n\t\t\tAssert.AreEqual(C.IdentityConversion, conversions.ImplicitConversion(SpecialType.UnknownType, SpecialType.UnknownType));\n\t\t\tAssert.AreEqual(C.IdentityConversion, conversions.ImplicitConversion(SpecialType.NullType, SpecialType.NullType));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DynamicIdentityConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(object), typeof(dynamic)));\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(dynamic), typeof(object)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComplexDynamicIdentityConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(List<object>), typeof(List<dynamic>)));\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(List<dynamic>), typeof(List<object>)));\n\t\t\tAssert.AreEqual(C.None,               ImplicitConversion(typeof(List<string>), typeof(List<dynamic>)));\n\t\t\tAssert.AreEqual(C.None,               ImplicitConversion(typeof(List<dynamic>), typeof(List<string>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(List<List<dynamic>[]>), typeof(List<List<object>[]>)));\n\t\t\tAssert.AreEqual(C.IdentityConversion, ImplicitConversion(typeof(List<List<object>[]>), typeof(List<List<dynamic>[]>)));\n\t\t\tAssert.AreEqual(C.None,               ImplicitConversion(typeof(List<List<object>[,]>), typeof(List<List<dynamic>[]>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PrimitiveConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ImplicitConversion(typeof(char), typeof(ushort)));\n\t\t\tAssert.AreEqual(C.None,                      ImplicitConversion(typeof(byte), typeof(char)));\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ImplicitConversion(typeof(int), typeof(long)));\n\t\t\tAssert.AreEqual(C.None,                      ImplicitConversion(typeof(long), typeof(int)));\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ImplicitConversion(typeof(int), typeof(float)));\n\t\t\tAssert.AreEqual(C.None,                      ImplicitConversion(typeof(bool), typeof(float)));\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ImplicitConversion(typeof(float), typeof(double)));\n\t\t\tAssert.AreEqual(C.None,                      ImplicitConversion(typeof(float), typeof(decimal)));\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ImplicitConversion(typeof(char), typeof(long)));\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ImplicitConversion(typeof(uint), typeof(long)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumerationConversion()\n\t\t{\n\t\t\tResolveResult zero = new ConstantResolveResult(compilation.FindType(KnownTypeCode.Int32), 0);\n\t\t\tResolveResult one = new ConstantResolveResult(compilation.FindType(KnownTypeCode.Int32), 1);\n\t\t\tC implicitEnumerationConversion = C.EnumerationConversion(true, false);\n\t\t\tAssert.AreEqual(implicitEnumerationConversion, conversions.ImplicitConversion(zero, compilation.FindType(typeof(StringComparison))));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(one, compilation.FindType(typeof(StringComparison))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(char), typeof(ushort?)));\n\t\t\tAssert.AreEqual(C.None,                            ImplicitConversion(typeof(byte), typeof(char?)));\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(int), typeof(long?)));\n\t\t\tAssert.AreEqual(C.None,                            ImplicitConversion(typeof(long), typeof(int?)));\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(int), typeof(float?)));\n\t\t\tAssert.AreEqual(C.None                           , ImplicitConversion(typeof(bool), typeof(float?)));\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(float), typeof(double?)));\n\t\t\tAssert.AreEqual(C.None,                            ImplicitConversion(typeof(float), typeof(decimal?)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableConversions2()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(char?), typeof(ushort?)));\n\t\t\tAssert.AreEqual(C.None,                            ImplicitConversion(typeof(byte?), typeof(char?)));\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(int?), typeof(long?)));\n\t\t\tAssert.AreEqual(C.None,                            ImplicitConversion(typeof(long?), typeof(int?)));\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(int?), typeof(float?)));\n\t\t\tAssert.AreEqual(C.None,                            ImplicitConversion(typeof(bool?), typeof(float?)));\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ImplicitConversion(typeof(float?), typeof(double?)));\n\t\t\tAssert.AreEqual(C.None,                            ImplicitConversion(typeof(float?), typeof(decimal?)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullLiteralConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.NullLiteralConversion, ImplicitConversion(typeof(Null), typeof(int?)));\n\t\t\tAssert.AreEqual(C.NullLiteralConversion, ImplicitConversion(typeof(Null), typeof(char?)));\n\t\t\tAssert.AreEqual(C.None,                  ImplicitConversion(typeof(Null), typeof(int)));\n\t\t\tAssert.AreEqual(C.NullLiteralConversion, ImplicitConversion(typeof(Null), typeof(object)));\n\t\t\tAssert.AreEqual(C.NullLiteralConversion, ImplicitConversion(typeof(Null), typeof(dynamic)));\n\t\t\tAssert.AreEqual(C.NullLiteralConversion, ImplicitConversion(typeof(Null), typeof(string)));\n\t\t\tAssert.AreEqual(C.NullLiteralConversion, ImplicitConversion(typeof(Null), typeof(int[])));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleReferenceConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string), typeof(object)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(BitArray), typeof(ICollection)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(IList), typeof(IEnumerable)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(object), typeof(string)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(ICollection), typeof(BitArray)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(IEnumerable), typeof(IList)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConversionToDynamic()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string),  typeof(dynamic)));\n\t\t\tAssert.AreEqual(C.BoxingConversion,            ImplicitConversion(typeof(int),     typeof(dynamic)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConversionFromDynamic()\n\t\t{\n\t\t\t// There is no conversion from the type 'dynamic' to other types (except the identity conversion to object).\n\t\t\t// Such conversions only exists from dynamic expression.\n\t\t\t// This is an important distinction for type inference (see TypeInferenceTests.IEnumerableCovarianceWithDynamic)\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(dynamic), typeof(string)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(dynamic), typeof(int)));\n\t\t\t\n\t\t\tvar dynamicRR = new ResolveResult(SpecialType.Dynamic);\n\t\t\tAssert.AreEqual(C.ImplicitDynamicConversion, conversions.ImplicitConversion(dynamicRR, compilation.FindType(typeof(string))));\n\t\t\tAssert.AreEqual(C.ImplicitDynamicConversion, conversions.ImplicitConversion(dynamicRR, compilation.FindType(typeof(int))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParameterizedTypeConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(List<string>), typeof(ICollection<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(IList<string>), typeof(ICollection<string>)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(List<string>), typeof(ICollection<object>)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(IList<string>), typeof(ICollection<object>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string[]), typeof(object[])));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string[,]), typeof(object[,])));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(string[]), typeof(object[,])));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(object[]), typeof(string[])));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string[]), typeof(IList<string>)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(string[,]), typeof(IList<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string[]), typeof(IList<object>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string[]), typeof(Array)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ImplicitConversion(typeof(string[]), typeof(ICloneable)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(Array), typeof(string[])));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(object), typeof(object[])));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VarianceConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                ImplicitConversion(typeof(List<string>), typeof(IEnumerable<object>)));\n\t\t\tAssert.AreEqual(C.None,\n\t\t\t                ImplicitConversion(typeof(List<object>), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                ImplicitConversion(typeof(IEnumerable<string>), typeof(IEnumerable<object>)));\n\t\t\tAssert.AreEqual(C.None,\n\t\t\t                ImplicitConversion(typeof(ICollection<string>), typeof(ICollection<object>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                ImplicitConversion(typeof(Comparer<object>), typeof(IComparer<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                ImplicitConversion(typeof(Comparer<object>), typeof(IComparer<Array>)));\n\t\t\tAssert.AreEqual(C.None,\n\t\t\t                ImplicitConversion(typeof(Comparer<object>), typeof(Comparer<string>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.None,\n\t\t\t                ImplicitConversion(typeof(List<object>), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                ImplicitConversion(typeof(IEnumerable<string>), typeof(IEnumerable<object>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                ImplicitConversion(typeof(Func<ICollection, ICollection>), typeof(Func<IList, IEnumerable>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                ImplicitConversion(typeof(Func<IEnumerable, IList>), typeof(Func<ICollection, ICollection>)));\n\t\t\tAssert.AreEqual(C.None,\n\t\t\t                ImplicitConversion(typeof(Func<ICollection, ICollection>), typeof(Func<IEnumerable, IList>)));\n\t\t\tAssert.AreEqual(C.None,\n\t\t\t                ImplicitConversion(typeof(Func<IList, IEnumerable>), typeof(Func<ICollection, ICollection>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitPointerConversion()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitPointerConversion, ImplicitConversion(typeof(Null), typeof(int*)));\n\t\t\tAssert.AreEqual(C.ImplicitPointerConversion, ImplicitConversion(typeof(int*), typeof(void*)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoConversionFromPointerTypeToObject()\n\t\t{\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(int*), typeof(object)));\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(int*), typeof(dynamic)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnconstrainedTypeParameter()\n\t\t{\n\t\t\tITypeParameter t = new DefaultTypeParameter(compilation, SymbolKind.TypeDefinition, 0, \"T\");\n\t\t\tITypeParameter t2 = new DefaultTypeParameter(compilation, SymbolKind.TypeDefinition, 1, \"T2\");\n\t\t\tITypeParameter tm = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"TM\");\n\t\t\t\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(SpecialType.NullType, t));\n\t\t\tAssert.AreEqual(C.BoxingConversion, conversions.ImplicitConversion(t, compilation.FindType(KnownTypeCode.Object)));\n\t\t\tAssert.AreEqual(C.BoxingConversion, conversions.ImplicitConversion(t, SpecialType.Dynamic));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t, compilation.FindType(typeof(ValueType))));\n\t\t\t\n\t\t\tAssert.AreEqual(C.IdentityConversion, conversions.ImplicitConversion(t, t));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t2, t));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t, t2));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t, tm));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(tm, t));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterWithReferenceTypeConstraint()\n\t\t{\n\t\t\tITypeParameter t = new DefaultTypeParameter(compilation, SymbolKind.TypeDefinition, 0, \"T\", hasReferenceTypeConstraint: true);\n\t\t\t\n\t\t\tAssert.AreEqual(C.NullLiteralConversion, conversions.ImplicitConversion(SpecialType.NullType, t));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, conversions.ImplicitConversion(t, compilation.FindType(KnownTypeCode.Object)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, conversions.ImplicitConversion(t, SpecialType.Dynamic));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t, compilation.FindType(typeof(ValueType))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterWithValueTypeConstraint()\n\t\t{\n\t\t\tITypeParameter t = new DefaultTypeParameter(compilation, SymbolKind.TypeDefinition, 0, \"T\", hasValueTypeConstraint: true);\n\t\t\t\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(SpecialType.NullType, t));\n\t\t\tAssert.AreEqual(C.BoxingConversion, conversions.ImplicitConversion(t, compilation.FindType(KnownTypeCode.Object)));\n\t\t\tAssert.AreEqual(C.BoxingConversion, conversions.ImplicitConversion(t, SpecialType.Dynamic));\n\t\t\tAssert.AreEqual(C.BoxingConversion, conversions.ImplicitConversion(t, compilation.FindType(typeof(ValueType))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterWithClassConstraint()\n\t\t{\n\t\t\tITypeParameter t = new DefaultTypeParameter(compilation, SymbolKind.TypeDefinition, 0, \"T\",\n\t\t\t                                            constraints: new[] { compilation.FindType(typeof(StringComparer)) });\n\t\t\t\n\t\t\tAssert.AreEqual(C.NullLiteralConversion,\n\t\t\t                conversions.ImplicitConversion(SpecialType.NullType, t));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                conversions.ImplicitConversion(t, compilation.FindType(KnownTypeCode.Object)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                conversions.ImplicitConversion(t, SpecialType.Dynamic));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t, compilation.FindType(typeof(ValueType))));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                conversions.ImplicitConversion(t, compilation.FindType(typeof(StringComparer))));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                conversions.ImplicitConversion(t, compilation.FindType(typeof(IComparer))));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t, compilation.FindType(typeof(IComparer<int>))));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion,\n\t\t\t                conversions.ImplicitConversion(t, compilation.FindType(typeof(IComparer<string>))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterWithInterfaceConstraint()\n\t\t{\n\t\t\tITypeParameter t = new DefaultTypeParameter(compilation, SymbolKind.TypeDefinition, 0, \"T\",\n\t\t\t                                            constraints: new [] { compilation.FindType(typeof(IList)) });\n\t\t\t\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(SpecialType.NullType, t));\n\t\t\tAssert.AreEqual(C.BoxingConversion,\n\t\t\t                conversions.ImplicitConversion(t, compilation.FindType(KnownTypeCode.Object)));\n\t\t\tAssert.AreEqual(C.BoxingConversion,\n\t\t\t                conversions.ImplicitConversion(t, SpecialType.Dynamic));\n\t\t\tAssert.AreEqual(C.None, conversions.ImplicitConversion(t, compilation.FindType(typeof(ValueType))));\n\t\t\tAssert.AreEqual(C.BoxingConversion,\n\t\t\t                conversions.ImplicitConversion(t, compilation.FindType(typeof(IList))));\n\t\t\tAssert.AreEqual(C.BoxingConversion,\n\t\t\t                conversions.ImplicitConversion(t, compilation.FindType(typeof(IEnumerable))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion()\n\t\t{\n\t\t\tConversion c = ImplicitConversion(typeof(DateTime), typeof(DateTimeOffset));\n\t\t\tAssert.IsTrue(c.IsImplicit && c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"System.DateTimeOffset.op_Implicit\", c.Method.FullName);\n\t\t\t\n\t\t\tAssert.AreEqual(C.None, ImplicitConversion(typeof(DateTimeOffset), typeof(DateTime)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitNullableConversion()\n\t\t{\n\t\t\t// User-defined conversion followed by nullable conversion\n\t\t\tConversion c = ImplicitConversion(typeof(DateTime), typeof(DateTimeOffset?));\n\t\t\tAssert.IsTrue(c.IsValid && c.IsUserDefined);\n\t\t\tAssert.IsFalse(c.IsLifted);\n\t\t\t// Lifted user-defined conversion\n\t\t\tc = ImplicitConversion(typeof(DateTime?), typeof(DateTimeOffset?));\n\t\t\tAssert.IsTrue(c.IsValid && c.IsUserDefined && c.IsLifted);\n\t\t\t// User-defined conversion doesn't drop the nullability\n\t\t\tc = ImplicitConversion(typeof(DateTime?), typeof(DateTimeOffset));\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\t\t\n\t\tbool IntegerLiteralConversion(object value, Type to)\n\t\t{\n\t\t\tIType fromType = compilation.FindType(value.GetType());\n\t\t\tConstantResolveResult crr = new ConstantResolveResult(fromType, value);\n\t\t\tIType to2 = compilation.FindType(to);\n\t\t\treturn conversions.ImplicitConversion(crr, to2).IsValid;\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntegerLiteralToEnumConversions()\n\t\t{\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(LoaderOptimization)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0L, typeof(LoaderOptimization)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(LoaderOptimization?)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(0, typeof(string)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(1, typeof(LoaderOptimization)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitConstantExpressionConversion()\n\t\t{\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(int)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(ushort)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(sbyte)));\n\t\t\t\n\t\t\tAssert.IsTrue (IntegerLiteralConversion(-1, typeof(int)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(-1, typeof(ushort)));\n\t\t\tAssert.IsTrue (IntegerLiteralConversion(-1, typeof(sbyte)));\n\t\t\t\n\t\t\tAssert.IsTrue (IntegerLiteralConversion(200, typeof(int)));\n\t\t\tAssert.IsTrue (IntegerLiteralConversion(200, typeof(ushort)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(200, typeof(sbyte)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitLongConstantExpressionConversion()\n\t\t{\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(0L, typeof(int)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(0L, typeof(short)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0L, typeof(long)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0L, typeof(ulong)));\n\t\t\t\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(-1L, typeof(long)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(-1L, typeof(ulong)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitConstantExpressionConversionToNullable()\n\t\t{\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(uint?)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(short?)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(byte?)));\n\t\t\t\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(-1, typeof(uint?)));\n\t\t\tAssert.IsTrue (IntegerLiteralConversion(-1, typeof(short?)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(-1, typeof(byte?)));\n\t\t\t\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(200, typeof(uint?)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(200, typeof(short?)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(200, typeof(byte?)));\n\t\t\t\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(0L, typeof(uint?)));\n\t\t\tAssert.IsTrue (IntegerLiteralConversion(0L, typeof(long?)));\n\t\t\tAssert.IsTrue (IntegerLiteralConversion(0L, typeof(ulong?)));\n\t\t\t\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(-1L, typeof(long?)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(-1L, typeof(ulong?)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitConstantExpressionConversionNumberInterfaces()\n\t\t{\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(IFormattable)));\n\t\t\tAssert.IsTrue(IntegerLiteralConversion(0, typeof(IComparable<int>)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(0, typeof(IComparable<short>)));\n\t\t\tAssert.IsFalse(IntegerLiteralConversion(0, typeof(IComparable<long>)));\n\t\t}\n\t\t\n\t\tint BetterConversion(Type s, Type t1, Type t2)\n\t\t{\n\t\t\tIType sType = compilation.FindType(s);\n\t\t\tIType t1Type = compilation.FindType(t1);\n\t\t\tIType t2Type = compilation.FindType(t2);\n\t\t\treturn conversions.BetterConversion(sType, t1Type, t2Type);\n\t\t}\n\t\t\n\t\tint BetterConversion(object value, Type t1, Type t2)\n\t\t{\n\t\t\tIType fromType = compilation.FindType(value.GetType());\n\t\t\tConstantResolveResult crr = new ConstantResolveResult(fromType, value);\n\t\t\tIType t1Type = compilation.FindType(t1);\n\t\t\tIType t2Type = compilation.FindType(t2);\n\t\t\treturn conversions.BetterConversion(crr, t1Type, t2Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BetterConversion()\n\t\t{\n\t\t\tAssert.AreEqual(1, BetterConversion(typeof(string), typeof(string), typeof(object)));\n\t\t\tAssert.AreEqual(2, BetterConversion(typeof(string), typeof(object), typeof(IComparable<string>)));\n\t\t\tAssert.AreEqual(0, BetterConversion(typeof(string), typeof(IEnumerable<char>), typeof(IComparable<string>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BetterPrimitiveConversion()\n\t\t{\n\t\t\tAssert.AreEqual(1, BetterConversion(typeof(short), typeof(int), typeof(long)));\n\t\t\tAssert.AreEqual(1, BetterConversion(typeof(short), typeof(int), typeof(uint)));\n\t\t\tAssert.AreEqual(2, BetterConversion(typeof(ushort), typeof(uint), typeof(int)));\n\t\t\tAssert.AreEqual(1, BetterConversion(typeof(char), typeof(short), typeof(int)));\n\t\t\tAssert.AreEqual(1, BetterConversion(typeof(char), typeof(ushort), typeof(int)));\n\t\t\tAssert.AreEqual(1, BetterConversion(typeof(sbyte), typeof(long), typeof(ulong)));\n\t\t\tAssert.AreEqual(2, BetterConversion(typeof(byte), typeof(ushort), typeof(short)));\n\t\t\t\n\t\t\tAssert.AreEqual(1, BetterConversion(1, typeof(sbyte), typeof(byte)));\n\t\t\tAssert.AreEqual(2, BetterConversion(1, typeof(ushort), typeof(sbyte)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BetterNullableConversion()\n\t\t{\n\t\t\tAssert.AreEqual(0, BetterConversion(typeof(byte), typeof(int), typeof(uint?)));\n\t\t\tAssert.AreEqual(0, BetterConversion(typeof(byte?), typeof(int?), typeof(uint?)));\n\t\t\tAssert.AreEqual(1, BetterConversion(typeof(byte), typeof(ushort?), typeof(uint?)));\n\t\t\tAssert.AreEqual(2, BetterConversion(typeof(byte?), typeof(ulong?), typeof(uint?)));\n\t\t\tAssert.AreEqual(0, BetterConversion(typeof(byte), typeof(ushort?), typeof(uint)));\n\t\t\tAssert.AreEqual(0, BetterConversion(typeof(byte), typeof(ushort?), typeof(int)));\n\t\t\tAssert.AreEqual(2, BetterConversion(typeof(byte), typeof(ulong?), typeof(uint)));\n\t\t\tAssert.AreEqual(0, BetterConversion(typeof(byte), typeof(ulong?), typeof(int)));\n\t\t\tAssert.AreEqual(2, BetterConversion(typeof(ushort?), typeof(long?), typeof(int?)));\n\t\t\tAssert.AreEqual(0, BetterConversion(typeof(sbyte), typeof(int?), typeof(uint?)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExpansiveInheritance()\n\t\t{\n\t\t\tvar a = new DefaultUnresolvedTypeDefinition(string.Empty, \"A\");\n\t\t\tvar b = new DefaultUnresolvedTypeDefinition(string.Empty, \"B\");\n\t\t\t// interface A<in U>\n\t\t\ta.Kind = TypeKind.Interface;\n\t\t\ta.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"U\") { Variance = VarianceModifier.Contravariant });\n\t\t\t// interface B<X> : A<A<B<X>>> { }\n\t\t\tb.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"X\"));\n\t\t\tb.BaseTypes.Add(new ParameterizedTypeReference(\n\t\t\t\ta, new[] { new ParameterizedTypeReference(\n\t\t\t\t\ta, new [] { new ParameterizedTypeReference(\n\t\t\t\t\t\tb, new [] { new TypeParameterReference(SymbolKind.TypeDefinition, 0) }\n\t\t\t\t\t) } ) }));\n\t\t\t\n\t\t\tICompilation compilation = TypeSystemHelper.CreateCompilation(a, b);\n\t\t\tITypeDefinition resolvedA = compilation.MainAssembly.GetTypeDefinition(a.FullTypeName);\n\t\t\tITypeDefinition resolvedB = compilation.MainAssembly.GetTypeDefinition(b.FullTypeName);\n\t\t\t\n\t\t\tIType type1 = new ParameterizedType(resolvedB, new [] { compilation.FindType(KnownTypeCode.Double) });\n\t\t\tIType type2 = new ParameterizedType(resolvedA, new [] { new ParameterizedType(resolvedB, new[] { compilation.FindType(KnownTypeCode.String) }) });\n\t\t\tAssert.IsFalse(conversions.ImplicitConversion(type1, type2).IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where T : U {\n\t\tU u = $t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.BoxingConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidImplicitTypeParameterConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where U : T {\n\t\tU u = $t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.None, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterArrayConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T[] t) where T : U {\n\t\tU[] u = $t$;\n\t}\n}\";\n\t\t\t// invalid, e.g. T=int[], U=object[]\n\t\t\tAssert.AreEqual(C.None, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterConversionWithClassConstraint()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where T : class, U where U : class {\n\t\tU u = $t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterArrayConversionWithClassConstraint()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T[] t) where T : class, U where U : class {\n\t\tU[] u = $t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterConversionWithClassConstraintOnlyOnT()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where T : class, U {\n\t\tU u = $t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterArrayConversionWithClassConstraintOnlyOnT()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T[] t) where T : class, U {\n\t\tU[] u = $t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_Void()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D();\nclass Test {\n\tD d = $M$;\n\tpublic static void M() {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.IsFalse(c.DelegateCapturesFirstArgument);\n\t\t\tAssert.IsNotNull(c.Method);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_Void_InstanceMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D();\nclass Test {\n\tD d;\n\tpublic void M() {\n\t\td = $M$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.IsTrue(c.DelegateCapturesFirstArgument);\n\t\t\tAssert.IsNotNull(c.Method);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_MatchingSignature()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate object D(int argument);\nclass Test {\n\tD d = $M$;\n\tpublic static object M(int argument) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_InvalidReturnType()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate object D(int argument);\nclass Test {\n\tD d = $M$;\n\tpublic static int M(int argument) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_CovariantReturnType()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate object D(int argument);\nclass Test {\n\tD d = $M$;\n\tpublic static string M(int argument) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_RefArgumentTypesEqual()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(ref object o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(ref object o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_RefArgumentObjectVsDynamic()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(ref object o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(ref dynamic o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_RefVsOut()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(ref object o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(out object o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_RefVsNormal()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(ref object o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(object o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_NormalVsOut()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(object o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(out object o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_MatchingNormalParameter()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(object o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(object o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_IdentityConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(object o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(dynamic o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_Contravariance()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(string o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(object o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"Not sure if this conversion should be valid or not... NR and mcs both accept it as valid, csc treats it as invalid\")]\n\t\tpublic void MethodGroupConversion_NoContravarianceDynamic()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(string o);\nclass Test {\n\tD d = $M$;\n\tpublic static void M(dynamic o) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\t//Assert.IsFrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_ExactMatchIsBetter()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tdelegate void D(string a);\n\tD d = $M$;\n\tstatic void M(object x) {}\n\tstatic void M(string x = null) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.AreEqual(\"System.String\", c.Method.Parameters.Single().Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_CannotLeaveOutOptionalParameters()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tdelegate void D(string a);\n\tD d = $M$;\n\tstatic void M(object x) {}\n\tstatic void M(string x, string y = null) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.AreEqual(\"System.Object\", c.Method.Parameters.Single().Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_CannotUseExpandedParams()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tdelegate void D(string a);\n\tD d = $M$;\n\tstatic void M(object x) {}\n\tstatic void M(params string[] x) {}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.AreEqual(\"System.Object\", c.Method.Parameters.Single().Type.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_ExtensionMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class Ext {\n\tpublic static void M(this string s, int x) {}\n}\nclass Test {\n\tdelegate void D(int a);\n\tvoid F() {\n\t\tstring s = \"\"\"\";\n\t\tD d = $s.M$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.IsTrue(c.DelegateCapturesFirstArgument);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_ExtensionMethodUsedAsStaticMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class Ext {\n\tpublic static void M(this string s, int x) {}\n}\nclass Test {\n\tdelegate void D(string s, int a);\n\tvoid F() {\n\t\tD d = $Ext.M$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.IsFalse(c.DelegateCapturesFirstArgument);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_ObjectToDynamic() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void F(object o) {}\n\tpublic void M() {\n\t\tAction<dynamic> x = $F$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_ObjectToDynamicGenericArgument() {\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass Test {\n\tpublic void F(List<object> l) {}\n\tpublic void M() {\n\t\tAction<List<dynamic>> x = $F$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_ObjectToDynamicReturnValue() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic object F() {}\n\tpublic void M() {\n\t\tFunc<dynamic> x = $F$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_DynamicToObject() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void F(dynamic o) {}\n\tpublic void M() {\n\t\tAction<object> x = $F$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_DynamicToObjectGenericArgument() {\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass Test {\n\tpublic void F(List<dynamic> l) {}\n\tpublic void M() {\n\t\tAction<List<object>> x = $F$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodGroupConversion_DynamicToObjectReturnValue() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic dynamic F() {}\n\tpublic void M() {\n\t\tFunc<object> x = $F$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefined_IntLiteral_ViaUInt_ToCustomStruct()\n\t\t{\n\t\t\tstring program = @\"using System;\nstruct T {\n\tpublic static implicit operator T(uint a) { return new T(); }\n}\nclass Test {\n\tstatic void M() {\n\t\tT t = $1$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefined_NullLiteral_ViaString_ToCustomStruct()\n\t\t{\n\t\t\tstring program = @\"using System;\nstruct T {\n\tpublic static implicit operator T(string a) { return new T(); }\n\n}\nclass Test {\n\tstatic void M() {\n\t\tT t = $null$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefined_CanUseLiftedEvenIfReturnTypeAlreadyNullable()\n\t\t{\n\t\t\tstring program = @\"using System;\nstruct S {\n\tpublic static implicit operator short?(S s) { return 0; }\n}\n\nclass Test {\n\tstatic void M(S? s) {\n\t\tint? i = $s$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.IsTrue(c.IsLifted);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_PicksExactSourceTypeIfPossible() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator Convertible(int i) {return new Convertible(); }\n\tpublic static implicit operator Convertible(short s) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible a = $33$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"i\", c.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_PicksMostEncompassedSourceType() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator Convertible(long l) {return new Convertible(); }\n\tpublic static implicit operator Convertible(uint ui) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible a = $(ushort)33$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ui\", c.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_NoMostEncompassedSourceTypeIsInvalid() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator Convertible(ulong l) {return new Convertible(); }\n\tpublic static implicit operator Convertible(int ui) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible a = $(ushort)33$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_PicksExactTargetTypeIfPossible() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator int(Convertible i) {return 0; }\n\tpublic static implicit operator short(Convertible s) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tint a = $new Convertible()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"i\", c.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_PicksMostEncompassingTargetType() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator int(Convertible i) {return 0; }\n\tpublic static implicit operator ushort(Convertible us) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tulong a = $new Convertible()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"us\", c.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_NoMostEncompassingTargetTypeIsInvalid() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator uint(Convertible i) {return 0; }\n\tpublic static implicit operator short(Convertible us) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tlong a = $new Convertible()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_AmbiguousIsInvalid() {\n\t\t\tstring program = @\"using System;\nclass Convertible1 {\n\tpublic static implicit operator Convertible2(Convertible1 c) {return 0; }\n}\nclass Convertible2 {\n\tpublic static implicit operator Convertible2(Convertible1 c) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible2 a = $new Convertible1()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_DefinedNullableTakesPrecedenceOverLifted() {\n\t\t\tstring program = @\"using System;\nstruct Convertible {\n\tpublic static implicit operator Convertible(int i) {return new Convertible(); }\n\tpublic static implicit operator Convertible?(int? ni) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible? a = $(int?)33$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.IsFalse(c.IsLifted);\n\t\t\tAssert.AreEqual(\"ni\", c.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_UIntConstant() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator Convertible(long l) {return new Convertible(); }\n\tpublic static implicit operator Convertible(uint ui) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible a = $33$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ui\", c.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_NullableUIntConstant() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator Convertible(long? l) {return new Convertible(); }\n\tpublic static implicit operator Convertible(uint? ui) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible a = $33$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ui\", c.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_UseShortResult_BecauseNullableCannotBeUnpacked()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static implicit operator int?(Test i) { return 0; }\n\tpublic static implicit operator short(Test s) { return 0; }\n}\nclass Program {\n\tpublic static void Main(string[] args)\n\t{\n\t\tint x = $new Test()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"System.Int16\", c.Method.ReturnType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_Short_Or_NullableByte_Target()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static implicit operator short(Test s) { return 0; }\n\tpublic static implicit operator byte?(Test b) { return 0; }\n}\nclass Program {\n\tpublic static void Main(string[] args)\n\t{\n\t\tint? x = $new Test()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"System.Int16\", c.Method.ReturnType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_Byte_Or_NullableShort_Target()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static implicit operator byte(Test b) { return 0; }\n\tpublic static implicit operator short?(Test s) { return 0; }\n}\nclass Program {\n\tpublic static void Main(string[] args)\n\t{\n\t\tint? x = $new Test()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"s\", c.Method.Parameters[0].Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_Int_Or_NullableLong_Source()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static implicit operator Test(int i) { return new Test(); }\n\tpublic static implicit operator Test(long? l) { return new Test(); }\n}\nclass Program {\n\tstatic void Main() {\n\t\tshort s = 0;\n\t\tTest t = $s$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"i\", c.Method.Parameters[0].Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_NullableInt_Or_Long_Source()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static implicit operator Test(int? i) { return new Test(); }\n\tpublic static implicit operator Test(long l) { return new Test(); }\n}\nclass Program {\n\tstatic void Main() {\n\t\tshort s = 0;\n\t\tTest t = $s$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_NullableInt_Or_Long_Constant_Source() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static implicit operator Test(int? i) { return new Test(); }\n\tpublic static implicit operator Test(long l) { return new Test(); }\n}\nclass Program {\n\tstatic void Main() {\n\t\tTest t = $1$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_NullableInt_Or_NullableLong_Source()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static implicit operator Test(int? i) { return new Test(); }\n\tpublic static implicit operator Test(long? l) { return new Test(); }\n}\nclass Program {\n\tstatic void Main() {\n\t\tshort s = 0;\n\t\tTest t = $s$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.AreEqual(\"i\", c.Method.Parameters[0].Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PreferUserDefinedConversionOverReferenceConversion()\n\t\t{\n\t\t\t// actually this is not because user-defined conversions are better;\n\t\t\t// but because string is a better conversion target\n\t\t\tstring program = @\"\nclass AA {\n\tpublic static implicit operator string(AA a) { return null; }\n}\nclass Test {\n\tstatic void M(object obj) {}\n\tstatic void M(string str) {}\n\t\n\tstatic void Main() {\n\t\t$M(new AA())$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"str\", rr.Member.Parameters[0].Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PreferAmbiguousConversionOverReferenceConversion()\n\t\t{\n\t\t\t// Ambiguous conversions are a compiler error; but they are not\n\t\t\t// preventing the overload from being chosen.\n\t\t\t\n\t\t\t// The user-defined conversion wins because BB is a better conversion target than object.\n\t\t\tstring program = @\"\nclass AA {\n\tpublic static implicit operator BB(AA a) { return null; }\n}\nclass BB {\n\tpublic static implicit operator BB(AA a) { return null; }\n}\n\nclass Test {\n\tstatic void M(BB b) {}\n\tstatic void M(object o) {}\n\t\n\tstatic void Main() {\n\t\tM($new AA()$);\n\t}\n}\";\n\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsUserDefined);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_ConversionBeforeUserDefinedOperatorIsCorrect() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator Convertible(long l) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tint i = 33;\n\t\tConvertible a = $i$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.ConversionBeforeUserDefinedOperator.IsImplicit);\n\t\t\tAssert.IsTrue(c.ConversionBeforeUserDefinedOperator.IsNumericConversion);\n\t\t\tAssert.IsTrue(c.ConversionBeforeUserDefinedOperator.IsValid);\n\t\t\tAssert.IsTrue(c.ConversionAfterUserDefinedOperator.IsIdentityConversion);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_ConversionAfterUserDefinedOperatorIsCorrect() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator int(Convertible i) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tlong a = $new Convertible()$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.ConversionBeforeUserDefinedOperator.IsIdentityConversion);\n\t\t\tAssert.IsTrue(c.ConversionAfterUserDefinedOperator.IsImplicit);\n\t\t\tAssert.IsTrue(c.ConversionAfterUserDefinedOperator.IsNumericConversion);\n\t\t\tAssert.IsTrue(c.ConversionAfterUserDefinedOperator.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedImplicitConversion_IsImplicit()\n\t\t{\n\t\t\t// Bug icsharpcode/NRefactory#183: conversions from constant expressions were incorrectly marked as explicit\n\t\t\tstring program = @\"using System;\n\tclass Test {\n\t\tvoid Hello(JsNumber3 x) {\n\t\t\tHello($7$);\n\t\t}\n\t}\n\tpublic class JsNumber3 {\n\t\tpublic static implicit operator JsNumber3(int d) {\n\t\t\treturn null;\n\t\t}\n\t}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsImplicit);\n\t\t\tAssert.IsFalse(c.IsExplicit);\n\t\t\tAssert.AreEqual(Conversion.IdentityConversion, c.ConversionBeforeUserDefinedOperator);\n\t\t\tAssert.AreEqual(Conversion.IdentityConversion, c.ConversionAfterUserDefinedOperator);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/DynamicTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Text;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver {\n\t[TestFixture]\n\tpublic class DynamicTests : ResolverTestBase {\n\t\tprivate void AssertNamedArgument<T>(ResolveResult rr, string parameterName, Func<T, bool> verifier) where T : ResolveResult {\n\t\t\tvar narr = rr as NamedArgumentResolveResult;\n\t\t\tAssert.That(narr, Is.Not.Null);\n\t\t\tAssert.That(narr.ParameterName, Is.EqualTo(parameterName));\n\t\t\tAssert.That(narr.Argument, Is.InstanceOf<T>());\n\t\t\tAssert.That(verifier((T)narr.Argument), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AccessToDynamicMember() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\t$obj.SomeProperty$ = 10;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicMemberResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.Target is LocalResolveResult && ((LocalResolveResult)rr.Target).Variable.Name == \"obj\");\n\t\t\tAssert.That(rr.Member, Is.EqualTo(\"SomeProperty\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DynamicInvocation() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint a = 0;\n\t\tstring b = null;\n\t\t$obj.SomeMethod(a, b)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\t\t\tAssert.That(rr.Target, Is.InstanceOf<DynamicMemberResolveResult>());\n\t\t\tvar dynamicMember = (DynamicMemberResolveResult)rr.Target;\n\t\t\tAssert.That(dynamicMember.Target is LocalResolveResult && ((LocalResolveResult)dynamicMember.Target).Variable.Name == \"obj\");\n\t\t\tAssert.That(dynamicMember.Member, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"a\");\n\t\t\tAssert.That(rr.Arguments[1] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[1]).Variable.Name == \"b\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DynamicInvocationWithNamedArguments() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint a = 0, x = 0;\n\t\tstring b = null;\n\t\t$obj.SomeMethod(x, param1: a, param2: b)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\t\t\tAssert.That(rr.Target, Is.InstanceOf<DynamicMemberResolveResult>());\n\t\t\tvar dynamicMember = (DynamicMemberResolveResult)rr.Target;\n\t\t\tAssert.That(dynamicMember.Target is LocalResolveResult && ((LocalResolveResult)dynamicMember.Target).Variable.Name == \"obj\");\n\t\t\tAssert.That(dynamicMember.Member, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(3));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"x\");\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[1], \"param1\", lrr => lrr.Variable.Name == \"a\");\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[2], \"param2\", lrr => lrr.Variable.Name == \"b\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TwoDynamicInvocationsInARow() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint a = 0, b = 0;\n\t\t$obj.SomeMethod(a)(b)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\t\t\tAssert.That(rr.Target, Is.InstanceOf<DynamicInvocationResolveResult>());\n\t\t\tvar innerInvocation = (DynamicInvocationResolveResult)rr.Target;\n\t\t\tAssert.That(innerInvocation.Target, Is.InstanceOf<DynamicMemberResolveResult>());\n\t\t\tvar dynamicMember = (DynamicMemberResolveResult)innerInvocation.Target;\n\t\t\tAssert.That(dynamicMember.Target is LocalResolveResult && ((LocalResolveResult)dynamicMember.Target).Variable.Name == \"obj\");\n\t\t\tAssert.That(dynamicMember.Member, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\t\t\tAssert.That(innerInvocation.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(innerInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)innerInvocation.Arguments[0]).Variable.Name == \"a\");\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"b\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWithOneApplicableMethod() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic int SomeMethod(int a) {}\n\tpublic int SomeMethod(int a, string b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this.SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr, Is.Not.Null);\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(rr.Type.Kind == TypeKind.Dynamic);\n\t\t\tAssert.That(((IParameterizedMember)rr.Member).Parameters.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Conversion.IsImplicit, Is.True);\n\t\t\tAssert.That(cr.Conversion.IsDynamicConversion, Is.True);\n\t\t\tAssert.That(cr.Input is LocalResolveResult && ((LocalResolveResult)cr.Input).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWithOneApplicableMethodReturningVoid() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic void SomeMethod(int a) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this.SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.IsError, Is.False);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(rr.Member.Parameters.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Conversion.IsImplicit, Is.True);\n\t\t\tAssert.That(cr.Conversion.IsDynamicConversion, Is.True);\n\t\t\tAssert.That(cr.Input is LocalResolveResult && ((LocalResolveResult)cr.Input).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWhenBothAnOwnAndABaseMethodAreApplicable() {\n\t\t\tstring program = @\"using System;\nclass TestBase {\n\tpublic void SomeMethod(int a) {}\n}\n\nclass TestClass : TestBase {\n\tpublic void SomeMethod(string a) {}\n\tpublic void SomeMethod(string a, int b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this.SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.InstanceOf<ThisResolveResult>());\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(mg.Methods.Count(), Is.EqualTo(2));\n\t\t\tAssert.That(mg.Methods.Any(m => m.Parameters.Count == 1 && m.DeclaringType.Name == \"TestBase\" && m.Name == \"SomeMethod\" && m.Parameters[0].Type.Name == \"Int32\"));\n\t\t\tAssert.That(mg.Methods.Any(m => m.Parameters.Count == 1 && m.DeclaringType.Name == \"TestClass\" && m.Name == \"SomeMethod\" && m.Parameters[0].Type.Name == \"String\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test, Ignore(\"Fails\")]\n\t\tpublic void InvocationWithDynamicArgumentWhenABaseMethodIsShadowed() {\n\t\t\tstring program = @\"using System;\nclass TestBase {\n\tpublic void SomeMethod(int a) {}\n}\n\nclass TestClass : TestBase {\n\tpublic void SomeMethod(int a) {}\n\tpublic void SomeMethod(string a, int b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this.SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(rr.Member.DeclaringType.Name, Is.EqualTo(\"TestClass\"));\n\t\t\tAssert.That(((IParameterizedMember)rr.Member).Parameters.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Conversion.IsImplicit, Is.True);\n\t\t\tAssert.That(cr.Conversion.IsDynamicConversion, Is.True);\n\t\t\tAssert.That(cr.Input is LocalResolveResult && ((LocalResolveResult)cr.Input).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWithTwoApplicableMethods() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic void SomeMethod(int a) {}\n\tpublic void SomeMethod(string a) {}\n\tpublic void SomeMethod(int a, string b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.InstanceOf<ThisResolveResult>());\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 1));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \"SomeMethod\" && m.DeclaringType.Name == \"TestClass\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWithTwoApplicableStaticMethods() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic static void SomeMethod(int a) {}\n\tpublic static void SomeMethod(string a) {}\n\tpublic static void SomeMethod(int a, string b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.InstanceOf<TypeResolveResult>());\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 1));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \"SomeMethod\" && m.DeclaringType.Name == \"TestClass\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWithApplicableStaticAndNonStaticMethodsFavorTheNonStaticOne() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic static void SomeMethod(int a) {}\n\tpublic void SomeMethod(string a) {}\n\tpublic static void SomeMethod(int a, string b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.InstanceOf<ThisResolveResult>());\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 1));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \"SomeMethod\" && m.DeclaringType.Name == \"TestClass\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWhenTheOnlyApplicableMethodIsAnExtensionMethod() {\n\t\t\tstring program = @\"using System;\nstatic class OtherClass {\n\tpublic void SomeMethod(this TestClass x, int a) {}\n\tpublic void SomeMethod(this TestClass x, string a) {}\n\tpublic void SomeMethod(this TestClass x, int a, string b) {}\n}\nclass TestClass {\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this.SomeMethod(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.IsError, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InvocationWithDynamicArgumentWithTwoApplicableMethodsAndNamedArguments() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic void SomeMethod(int a, int i) {}\n\tpublic void SomeMethod(string a, int i) {}\n\tpublic void SomeMethod(int a, string b, int i) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint idx = 0;\n\t\tvar x = $this.SomeMethod(a: obj, i: idx)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Invocation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.InstanceOf<ThisResolveResult>());\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\"SomeMethod\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 2) && mg.Methods.All(m => m.Parameters[1].Type.Name == \"Int32\"));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \"SomeMethod\" && m.DeclaringType.Name == \"TestClass\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[0], \"a\", lrr => lrr.Variable.Name == \"obj\");\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[1], \"i\", lrr => lrr.Variable.Name == \"idx\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexingDynamicObjectWithUnnamedArguments() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint a = 0, b = 0;\n\t\tobject o = $obj[a]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Indexing));\n\t\t\tAssert.That(rr.Target is LocalResolveResult && ((LocalResolveResult)rr.Target).Variable.Name == \"obj\");\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"a\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexingDynamicObjectWithNamedArguments() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint a = 0, b = 0;\n\t\t$obj[arg1: a, arg2: b]$ = 1;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Indexing));\n\t\t\tAssert.That(rr.Target is LocalResolveResult && ((LocalResolveResult)rr.Target).Variable.Name == \"obj\");\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[0], \"arg1\", lrr => lrr.Variable.Name == \"a\");\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[1], \"arg2\", lrr => lrr.Variable.Name == \"b\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexingWithDynamicArgumentWithOneApplicableIndexer() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic int this[int a] { get { return 0; } }\n\tpublic int this[int a, string b] { get { return 0; } }\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this[obj]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\"Item\"));\n\t\t\tAssert.That(((IParameterizedMember)rr.Member).Parameters.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Conversion.IsImplicit, Is.True);\n\t\t\tAssert.That(cr.Conversion.IsDynamicConversion, Is.True);\n\t\t\tAssert.That(cr.Input is LocalResolveResult && ((LocalResolveResult)cr.Input).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexingWithDynamicArgumentWithTwoApplicableIndexersAndUnnamedArguments() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic int this[int a] { get { return 0; } }\n\tpublic int this[string a] { get { return 0; } }\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this[obj]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Indexing));\n\t\t\tAssert.That(rr.Target, Is.InstanceOf<ThisResolveResult>());\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexingWithDynamicArgumentWithAnApplicableBaseIndexer() {\n\t\t\tstring program = @\"using System;\nclass TestBase {\n\tpublic int this[int a] { get { return 0; } }\n}\n\nclass TestClass : TestBase {\n\tpublic int this[string a] { get { return 0; } }\n\tpublic int this[string a, int b] { get { return 0; } }\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this[obj]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Indexing));\n\t\t\tAssert.That(rr.Target, Is.InstanceOf<ThisResolveResult>());\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test, Ignore(\"Fails\")]\n\t\tpublic void IndexingWithDynamicArgumentWithTheOnlyApplicableIndexerShadowingABaseIndexer() {\n\t\t\tstring program = @\"using System;\nclass TestBase {\n\tpublic int this[int a] { get { return 0; } }\n}\n\nclass TestClass : TestBase {\n\tpublic new int this[int a] { get { return 0; } }\n\tpublic int this[int a, string b] { get { return 0; } }\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $this[obj]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\"Item\"));\n\t\t\tAssert.That(((IParameterizedMember)rr.Member).Parameters.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Conversion.IsImplicit, Is.True);\n\t\t\tAssert.That(cr.Conversion.IsDynamicConversion, Is.True);\n\t\t\tAssert.That(cr.Input is LocalResolveResult && ((LocalResolveResult)cr.Input).Variable.Name == \"obj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexingWithDynamicArgumentWithTwoApplicableIndexersAndNamedArguments() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic int this[int a, int i] { get { return 0; } }\n\tpublic int this[string a, int i] { get { return 0; } }\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint idx = 0;\n\t\tvar x = $this[a: obj, i: idx]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Type.Kind, Is.EqualTo(TypeKind.Dynamic));\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.Indexing));\n\t\t\tAssert.That(rr.Target, Is.InstanceOf<ThisResolveResult>());\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[0], \"a\", lrr => lrr.Variable.Name == \"obj\");\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[1], \"i\", lrr => lrr.Variable.Name == \"idx\");\n\t\t}\n\n  \t\t[Test]\n\t\tpublic void ConstructingObjectWithDynamicArgumentWithOneApplicableConstructor() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic TestClass(int a) {}\n\tpublic void TestClass(int a, string b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tvar x = $new TestClass(obj)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\".ctor\"));\n\t\t\tAssert.That(rr.TargetResult, Is.Null);\n\t\t\tAssert.That(((IParameterizedMember)rr.Member).Parameters.Count, Is.EqualTo(1));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(1));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Input is LocalResolveResult && ((LocalResolveResult)cr.Input).Variable.Name == \"obj\");\n\t\t}\n\n \t\t[Test]\n\t\tpublic void ConstructingObjectWithDynamicArgumentWithTwoApplicableConstructors() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic TestClass(int a, int b) {}\n\tpublic TestClass(string a, int b) {}\n\tpublic void TestClass(int a, string b) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint i = 0;\n\t\tvar x = $new TestClass(obj, i)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.ObjectCreation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.Null);\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\".ctor\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 2 && m.Parameters[1].Type.Name == \"Int32\"));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \".ctor\" && m.DeclaringType.Name == \"TestClass\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Arguments[0] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[0]).Variable.Name == \"obj\");\n\t\t\tAssert.That(rr.Arguments[1] is LocalResolveResult && ((LocalResolveResult)rr.Arguments[1]).Variable.Name == \"i\");\n\t\t}\n\n \t\t[Test]\n\t\tpublic void ConstructingObjectWithDynamicArgumentWithTwoApplicableConstructorsAndNamedArguments() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic TestClass(int arg1, int arg2) {}\n\tpublic TestClass(string arg1, int arg2) {}\n\tpublic void TestClass(int a) {}\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint i = 0;\n\t\tvar x = $new TestClass(arg1: obj, arg2: i)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.ObjectCreation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.Null);\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\".ctor\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 2 && m.Parameters[1].Type.Name == \"Int32\"));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \".ctor\" && m.DeclaringType.Name == \"TestClass\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[0], \"arg1\", lrr => lrr.Variable.Name == \"obj\");\n\t\t\tAssertNamedArgument<LocalResolveResult>(rr.Arguments[1], \"arg2\", lrr => lrr.Variable.Name == \"i\");\n\t\t}\n\n \t\t[Test]\n\t\tpublic void ConstructingObjectWithDynamicArgumentWithTwoApplicableConstructorsAndInitializerStatements() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpublic TestClass(int a, int b) {}\n\tpublic TestClass(string a, int b) {}\n\n\tpublic int A { get; set; }\n\n\tvoid F() {\n\t\tdynamic obj = null;\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tvar x = $new TestClass(obj, i) { A = j }$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.ObjectCreation));\n\t\t\t\n\t\t\tAssert.That(rr.InitializerStatements.Count, Is.EqualTo(1));\n\t\t\tvar or = rr.InitializerStatements[0] as OperatorResolveResult;\n\t\t\tAssert.That(or, Is.Not.Null);\n\t\t\tAssert.That(or.OperatorType, Is.EqualTo(ExpressionType.Assign));\n\t\t\tvar mrr = or.Operands[0] as MemberResolveResult;\n\t\t\tAssert.That(mrr, Is.Not.Null);\n\t\t\tAssert.That(mrr.TargetResult, Is.InstanceOf<InitializedObjectResolveResult>());\n\t\t\tAssert.That(mrr.Member.Name, Is.EqualTo(\"A\"));\n\t\t\tAssert.That(or.Operands[1], Is.InstanceOf<LocalResolveResult>());\n\t\t\tAssert.That(((LocalResolveResult)or.Operands[1]).Variable.Name, Is.EqualTo(\"j\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InitializingBaseWithDynamicArgumentAndOneApplicableConstructor() {\n\t\t\tstring program = @\"using System;\nclass TestBase {\n\tpublic TestBase(int a, int b) {}\n\tpublic TestBase(string a) {}\n}\n\nclass TestClass : TestBase {\n\tprivate static dynamic d;\n\tprivate static int i;\n\n\tpublic TestClass() : $base(d, i)$ {}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\".ctor\"));\n\t\t\tAssert.That(rr.TargetResult, Is.Null);\n\t\t\tAssert.That(((IParameterizedMember)rr.Member).Parameters.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Member.DeclaringType.Name, Is.EqualTo(\"TestBase\"));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Input is MemberResolveResult && ((MemberResolveResult)cr.Input).Member.Name == \"d\");\n\t\t\tAssert.That(rr.Arguments[1] is MemberResolveResult && ((MemberResolveResult)rr.Arguments[1]).Member.Name == \"i\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InitializingBaseWithDynamicArgumentAndTwoApplicableConstructors() {\n\t\t\tstring program = @\"using System;\nclass TestBase {\n\tpublic TestBase(int a, int b) {}\n\tpublic TestBase(string a, int b) {}\n\tpublic TestBase(string a) {}\n}\n\nclass TestClass : TestBase {\n\tprivate static dynamic d;\n\tprivate static int i;\n\n\tpublic TestClass() : $base(d, i)$ {}\n}\";\n\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.ObjectCreation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.Null);\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\".ctor\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 2 && m.Parameters[1].Type.Name == \"Int32\"));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \".ctor\" && m.DeclaringType.Name == \"TestBase\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Arguments[0] is MemberResolveResult && ((MemberResolveResult)rr.Arguments[0]).Member.Name == \"d\");\n\t\t\tAssert.That(rr.Arguments[1] is MemberResolveResult && ((MemberResolveResult)rr.Arguments[1]).Member.Name == \"i\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConstructorChainingWithDynamicArgumentAndOneApplicableConstructor() {\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tprivate static dynamic d;\n\tprivate static int i;\n\n\tpublic TestClass(int a, int b) {}\n\tpublic TestClass(string a) {}\n\n\tpublic TestClass() : $this(d, i)$ {}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\n\t\t\tAssert.That(rr.Member.Name, Is.EqualTo(\".ctor\"));\n\t\t\tAssert.That(rr.TargetResult, Is.Null);\n\t\t\tAssert.That(((IParameterizedMember)rr.Member).Parameters.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Member.DeclaringType.Name, Is.EqualTo(\"TestClass\"));\n\t\t\tvar cr = rr.Arguments[0] as ConversionResolveResult;\n\t\t\tAssert.That(cr, Is.Not.Null);\n\t\t\tAssert.That(cr.Input is MemberResolveResult && ((MemberResolveResult)cr.Input).Member.Name == \"d\");\n\t\t\tAssert.That(rr.Arguments[1] is MemberResolveResult && ((MemberResolveResult)rr.Arguments[1]).Member.Name == \"i\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConstructorChainingWithDynamicArgumentAndTwoApplicableConstructors() {\n\t\t\tstring program = @\"using System;\nclass TestBase {\n}\n\nclass TestClass {\n\tprivate static dynamic d;\n\tprivate static int i;\n\n\tpublic TestClass(int a, int b) {}\n\tpublic TestClass(string a, int b) {}\n\tpublic TestClass(string a) {}\n\n\tpublic TestClass() : $this(d, i)$ {}\n}\";\n\n\t\t\tvar rr = Resolve<DynamicInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.InvocationType, Is.EqualTo(DynamicInvocationType.ObjectCreation));\n\n\t\t\tvar mg = rr.Target as MethodGroupResolveResult;\n\t\t\tAssert.That(mg, Is.Not.Null, \"Expected a MethodGroup\");\n\t\t\tAssert.That(mg.TargetResult, Is.Null);\n\t\t\tAssert.That(mg.MethodName, Is.EqualTo(\".ctor\"));\n\t\t\tAssert.That(mg.Methods.All(m => m.Parameters.Count == 2 && m.Parameters[1].Type.Name == \"Int32\"));\n\t\t\tAssert.That(mg.Methods.Select(m => m.Parameters[0].Type.Name), Is.EquivalentTo(new[] { \"Int32\", \"String\" }));\n\t\t\tAssert.That(mg.Methods.All(m => m.Name == \".ctor\" && m.DeclaringType.Name == \"TestClass\"));\n\n\t\t\tAssert.That(rr.Arguments.Count, Is.EqualTo(2));\n\t\t\tAssert.That(rr.Arguments[0] is MemberResolveResult && ((MemberResolveResult)rr.Arguments[0]).Member.Name == \"d\");\n\t\t\tAssert.That(rr.Arguments[1] is MemberResolveResult && ((MemberResolveResult)rr.Arguments[1]).Member.Name == \"i\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ExplicitConversionsTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\tusing dynamic = ICSharpCode.NRefactory.TypeSystem.ReflectionHelper.Dynamic;\n\tusing C = Conversion;\n\t\n\t[TestFixture]\n\tpublic class ExplicitConversionsTest : ResolverTestBase\n\t{\n\t\tCSharpConversions conversions;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tconversions = new CSharpConversions(compilation);\n\t\t}\n\t\t\n\t\tConversion ExplicitConversion(Type from, Type to)\n\t\t{\n\t\t\tIType from2 = compilation.FindType(from);\n\t\t\tIType to2 = compilation.FindType(to);\n\t\t\treturn conversions.ExplicitConversion(from2, to2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PointerConversion()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitPointerConversion, ExplicitConversion(typeof(int*), typeof(short)));\n\t\t\tAssert.AreEqual(C.ExplicitPointerConversion, ExplicitConversion(typeof(short), typeof(void*)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ExplicitPointerConversion, ExplicitConversion(typeof(void*), typeof(int*)));\n\t\t\tAssert.AreEqual(C.ExplicitPointerConversion, ExplicitConversion(typeof(long*), typeof(byte*)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConversionFromDynamic()\n\t\t{\n\t\t\t// Explicit dynamic conversion is for resolve results only;\n\t\t\t// otherwise it's an explicit reference / unboxing conversion\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(dynamic), typeof(string)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(dynamic), typeof(int)));\n\t\t\t\n\t\t\tvar dynamicRR = new ResolveResult(SpecialType.Dynamic);\n\t\t\tAssert.AreEqual(C.ExplicitDynamicConversion, conversions.ExplicitConversion(dynamicRR, compilation.FindType(typeof(string))));\n\t\t\tAssert.AreEqual(C.ExplicitDynamicConversion, conversions.ExplicitConversion(dynamicRR, compilation.FindType(typeof(int))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NumericConversions()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitNumericConversion, ExplicitConversion(typeof(sbyte), typeof(uint)));\n\t\t\tAssert.AreEqual(C.ExplicitNumericConversion, ExplicitConversion(typeof(sbyte), typeof(char)));\n\t\t\tAssert.AreEqual(C.ExplicitNumericConversion, ExplicitConversion(typeof(byte), typeof(char)));\n\t\t\tAssert.AreEqual(C.ExplicitNumericConversion, ExplicitConversion(typeof(byte), typeof(sbyte)));\n\t\t\t// if an implicit conversion exists, ExplicitConversion() should return that\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ExplicitConversion(typeof(byte), typeof(int)));\n\t\t\tAssert.AreEqual(C.ExplicitNumericConversion, ExplicitConversion(typeof(double), typeof(float)));\n\t\t\tAssert.AreEqual(C.ExplicitNumericConversion, ExplicitConversion(typeof(double), typeof(decimal)));\n\t\t\tAssert.AreEqual(C.ExplicitNumericConversion, ExplicitConversion(typeof(decimal), typeof(double)));\n\t\t\tAssert.AreEqual(C.ImplicitNumericConversion, ExplicitConversion(typeof(int), typeof(decimal)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(bool), typeof(int)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(int), typeof(bool)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumerationConversions()\n\t\t{\n\t\t\tvar explicitEnumerationConversion = C.EnumerationConversion(false, false);\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(sbyte), typeof(StringComparison)));\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(char), typeof(StringComparison)));\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(int), typeof(StringComparison)));\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(decimal), typeof(StringComparison)));\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(StringComparison), typeof(char)));\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(StringComparison), typeof(int)));\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(StringComparison), typeof(decimal)));\n\t\t\tAssert.AreEqual(explicitEnumerationConversion, ExplicitConversion(typeof(StringComparison), typeof(StringSplitOptions)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableConversion_BasedOnIdentityConversion()\n\t\t{\n\t\t\tAssert.AreEqual(C.IdentityConversion, ExplicitConversion(typeof(ArraySegment<dynamic>?), typeof(ArraySegment<object>?)));\n\t\t\tAssert.AreEqual(C.ImplicitNullableConversion, ExplicitConversion(typeof(ArraySegment<dynamic>), typeof(ArraySegment<object>?)));\n\t\t\tAssert.AreEqual(C.ExplicitNullableConversion, ExplicitConversion(typeof(ArraySegment<dynamic>?), typeof(ArraySegment<object>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableConversion_BasedOnImplicitNumericConversion()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ExplicitConversion(typeof(int?), typeof(long?)));\n\t\t\tAssert.AreEqual(C.ImplicitLiftedNumericConversion, ExplicitConversion(typeof(int), typeof(long?)));\n\t\t\tAssert.AreEqual(C.ExplicitLiftedNumericConversion, ExplicitConversion(typeof(int?), typeof(long)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableConversion_BasedOnImplicitEnumerationConversion()\n\t\t{\n\t\t\tResolveResult zero = new ConstantResolveResult(compilation.FindType(KnownTypeCode.Int32), 0);\n\t\t\tResolveResult one = new ConstantResolveResult(compilation.FindType(KnownTypeCode.Int32), 1);\n\t\t\tAssert.AreEqual(C.EnumerationConversion(true, true), conversions.ExplicitConversion(zero, compilation.FindType(typeof(StringComparison?))));\n\t\t\tAssert.AreEqual(C.EnumerationConversion(false, true), conversions.ExplicitConversion(one, compilation.FindType(typeof(StringComparison?))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableConversion_BasedOnExplicitNumericConversion()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitLiftedNumericConversion, ExplicitConversion(typeof(int?), typeof(short?)));\n\t\t\tAssert.AreEqual(C.ExplicitLiftedNumericConversion, ExplicitConversion(typeof(int), typeof(short?)));\n\t\t\tAssert.AreEqual(C.ExplicitLiftedNumericConversion, ExplicitConversion(typeof(int?), typeof(short)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableConversion_BasedOnExplicitEnumerationConversion()\n\t\t{\n\t\t\tC c = C.EnumerationConversion(false, true); // c = explicit lifted enumeration conversion\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(int?), typeof(StringComparison?)));\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(int), typeof(StringComparison?)));\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(int?), typeof(StringComparison)));\n\t\t\t\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(StringComparison?), typeof(int?)));\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(StringComparison), typeof(int?)));\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(StringComparison?), typeof(int)));\n\t\t\t\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(StringComparison?), typeof(StringSplitOptions?)));\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(StringComparison), typeof(StringSplitOptions?)));\n\t\t\tAssert.AreEqual(c, ExplicitConversion(typeof(StringComparison?), typeof(StringSplitOptions)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_SealedClass()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(object), typeof(string)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<char>), typeof(string)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(IEnumerable<int>), typeof(string)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(IEnumerable<object>), typeof(string)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(string), typeof(IEnumerable<char>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(string), typeof(IEnumerable<int>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(string), typeof(IEnumerable<object>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_NonSealedClass()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(object), typeof(List<string>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<object>), typeof(List<string>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<string>), typeof(List<string>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<int>), typeof(List<string>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(List<string>), typeof(IEnumerable<object>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(List<string>), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(List<string>), typeof(IEnumerable<int>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(List<string>), typeof(List<object>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(List<string>), typeof(List<int>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_Interfaces()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<string>), typeof(IEnumerable<object>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<int>), typeof(IEnumerable<object>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<object>), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<object>), typeof(IEnumerable<int>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<object>), typeof(IConvertible)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_Arrays()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(object[]), typeof(string[])));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(dynamic[]), typeof(string[])));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(object[]), typeof(object[,])));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(object[]), typeof(int[])));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(short[]), typeof(int[])));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(Array), typeof(int[])));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_InterfaceToArray()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(ICloneable), typeof(int[])));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<string>), typeof(string[])));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<object>), typeof(string[])));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<string>), typeof(object[])));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<string>), typeof(dynamic[])));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(IEnumerable<int>), typeof(int[])));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(IEnumerable<string>), typeof(object[,])));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(IEnumerable<short>), typeof(object[])));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_ArrayToInterface()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(int[]), typeof(ICloneable)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(string[]), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(string[]), typeof(IEnumerable<object>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(object[]), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(dynamic[]), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(int[]), typeof(IEnumerable<int>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(object[,]), typeof(IEnumerable<string>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(object[]), typeof(IEnumerable<short>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_Delegates()\n\t\t{\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(MulticastDelegate), typeof(Action)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(Delegate), typeof(Action)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(ICloneable), typeof(Action)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(System.Threading.ThreadStart), typeof(Action)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversion_GenericDelegates()\n\t\t{\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(Action<object>), typeof(Action<string>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(Action<string>), typeof(Action<object>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(Func<object>), typeof(Func<string>)));\n\t\t\tAssert.AreEqual(C.ImplicitReferenceConversion, ExplicitConversion(typeof(Func<string>), typeof(Func<object>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(Action<IFormattable>), typeof(Action<IConvertible>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(Action<IFormattable>), typeof(Action<int>)));\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(Action<string>), typeof(Action<IEnumerable<int>>)));\n\t\t\t\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ExplicitConversion(typeof(Func<IFormattable>), typeof(Func<IConvertible>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(Func<IFormattable>), typeof(Func<int>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(Func<string>), typeof(Func<IEnumerable<int>>)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(Func<string>), typeof(Func<IEnumerable<int>>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnboxingConversion()\n\t\t{\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(object), typeof(int)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(object), typeof(decimal)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(ValueType), typeof(int)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(IFormattable), typeof(int)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(IEnumerable<object>), typeof(int)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(Enum), typeof(StringComparison)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(Enum), typeof(int)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LiftedUnboxingConversion()\n\t\t{\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(object), typeof(int?)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(object), typeof(decimal?)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(ValueType), typeof(int?)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(IFormattable), typeof(int?)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(IEnumerable<object>), typeof(int?)));\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ExplicitConversion(typeof(Enum), typeof(StringComparison?)));\n\t\t\tAssert.AreEqual(C.None, ExplicitConversion(typeof(Enum), typeof(int?)));\n\t\t}\n\t\tConversion ResolveCast(string program)\n\t\t{\n\t\t\treturn Resolve<ConversionResolveResult>(program).Conversion;\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ObjectToTypeParameter()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T>(object o) {\n\t\tT t = $(T)o$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnrelatedClassToTypeParameter()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T>(string o) {\n\t\tT t = $(T)o$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.None, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntefaceToTypeParameter()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T>(IDisposable o) {\n\t\tT t = $(T)o$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterToInterface()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T>(T t) {\n\t\tIDisposable d = $(IDisposable)t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.BoxingConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ValueTypeToTypeParameter()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T>(ValueType o) where T : struct {\n\t\tT t = $(T)o$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidTypeParameterConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) {\n\t\tU u = $(U)t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.None, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterConversion1()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where T : U {\n\t\tU u = $(U)t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.BoxingConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterConversion1Array()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T[] t) where T : U {\n\t\tU[] u = $(U[])t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.None, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterConversion2()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where U : T {\n\t\tU u = $(U)t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.UnboxingConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterConversion2Array()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T[] t) where U : T {\n\t\tU[] u = $(U[])t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.None, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterConversionWithClassConstraint()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where T : class where U : class, T {\n\t\tU u = $(U)t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterArrayConversionWithClassConstraint()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T[] t) where T : class where U : class, T {\n\t\tU[] u = $(U[])t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterConversionWithClassConstraintOnlyOnT()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T t) where U : class, T {\n\t\tU u = $(U)t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitTypeParameterArrayConversionWithClassConstraintOnlyOnT()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M<T, U>(T[] t) where U : class, T {\n\t\tU[] u = $(U[])t$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(C.ExplicitReferenceConversion, ResolveCast(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleUserDefinedConversion()\n\t\t{\n\t\t\tvar rr = Resolve<ConversionResolveResult>(@\"\nclass C1 {}\nclass C2 {\n\tpublic static explicit operator C1(C2 c2) {\n\t\treturn null;\n\t}\n}\nclass C {\n\tpublic void M() {\n\t\tvar c2 = new C2();\n\t\tC1 c1 = $(C1)c2$;\n\t}\n}\");\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"op_Explicit\", rr.Conversion.Method.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitReferenceConversionFollowedByUserDefinedConversion()\n\t\t{\n\t\t\tvar rr = Resolve<ConversionResolveResult>(@\"\n\t\tclass B {}\n\t\tclass S : B {}\n\t\tclass T {\n\t\t\tpublic static explicit operator T(S s) { return null; }\n\t\t}\n\t\tclass Test {\n\t\t\tvoid Run(B b) {\n\t\t\t\tT t = $(T)b$;\n\t\t\t}\n\t\t}\");\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"B\", rr.Input.Type.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitUserDefinedConversionFollowedByExplicitNumericConversion()\n\t\t{\n\t\t\tvar rr = Resolve<ConversionResolveResult>(@\"\n\t\tstruct T {\n\t\t\tpublic static implicit operator float(T t) { return 0; }\n\t\t}\n\t\tclass Test {\n\t\t\tvoid Run(T t) {\n\t\t\t\tint x = $(int)t$;\n\t\t\t}\n\t\t}\");\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\t// even though the user-defined conversion is implicit, the combined conversion is explicit\n\t\t\tAssert.IsTrue(rr.Conversion.IsExplicit);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BothDirectConversionAndBaseClassConversionAvailable()\n\t\t{\n\t\t\tvar rr = Resolve<ConversionResolveResult>(@\"\n\t\tclass B {}\n\t\tclass S : B {}\n\t\tclass T {\n\t\t\tpublic static explicit operator T(S s) { return null; }\n\t\t\tpublic static explicit operator T(B b) { return null; }\n\t\t}\n\t\tclass Test {\n\t\t\tvoid Run(B b) {\n\t\t\t\tT t = $(T)b$;\n\t\t\t}\n\t\t}\");\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"b\", rr.Conversion.Method.Parameters.Single().Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_PicksExactSourceTypeIfPossible() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator Convertible(int i) {return new Convertible(); }\n\tpublic static explicit operator Convertible(short s) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(Convertible)33$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"i\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_PicksMostEncompassedSourceTypeIfPossible() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator Convertible(long l) {return new Convertible(); }\n\tpublic static explicit operator Convertible(uint ui) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(Convertible)(ushort)33$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ui\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_PicksMostEncompassingSourceType() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator Convertible(int i) {return new Convertible(); }\n\tpublic static explicit operator Convertible(ushort us) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(Convertible)(long)33$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"i\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_NoMostEncompassingSourceTypeIsInvalid() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator Convertible(uint i) {return new Convertible(); }\n\tpublic static explicit operator Convertible(short us) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(Convertible)(long)33$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.Conversion.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_PicksExactTargetTypeIfPossible() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator int(Convertible i) {return 0; }\n\tpublic static explicit operator short(Convertible s) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(int)new Convertible()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"i\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_PicksMostEncompassingTargetTypeIfPossible() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator int(Convertible i) {return 0; }\n\tpublic static explicit operator ushort(Convertible us) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(ulong)new Convertible()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"us\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_PicksMostEncompassedTargetType() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator long(Convertible l) { return 0; }\n\tpublic static explicit operator uint(Convertible ui) { return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(ushort)new Convertible()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ui\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_NoMostEncompassedTargetTypeIsInvalid() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator ulong(Convertible l) { return 0; }\n\tpublic static explicit operator int(Convertible ui) { return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(ushort)new Convertible()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.Conversion.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_AmbiguousIsInvalid() {\n\t\t\tstring program = @\"using System;\nclass Convertible1 {\n\tpublic static explicit operator Convertible2(Convertible1 c) {return 0; }\n}\nclass Convertible2 {\n\tpublic static explicit operator Convertible2(Convertible1 c) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(Convertible2)new Convertible1()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.Conversion.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_Lifted() {\n\t\t\tstring program = @\"using System;\nstruct Convertible {\n\tpublic static explicit operator Convertible(int i) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M(int? i) {\n\t\t a = $(Convertible?)i$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.IsTrue(rr.Conversion.IsLifted);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversionFollowedByImplicitNullableConversion() {\n\t\t\tstring program = @\"using System;\nstruct Convertible {\n\tpublic static explicit operator Convertible(int i) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M(int i) {\n\t\t a = $(Convertible?)i$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.IsFalse(rr.Conversion.IsLifted);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_ExplicitNullable_ThenUserDefined() {\n\t\t\tstring program = @\"using System;\nstruct Convertible {\n\tpublic static explicit operator Convertible(int i) {return new Convertible(); }\n\tpublic static explicit operator Convertible?(int? ni) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M(int? i) {\n\t\t a = $(Convertible)i$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.IsFalse(rr.Conversion.IsLifted);\n\t\t\tAssert.AreEqual(\"i\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_DefinedNullableTakesPrecedenceOverLifted() {\n\t\t\tstring program = @\"using System;\nstruct Convertible {\n\tpublic static explicit operator Convertible(int i) {return new Convertible(); }\n\tpublic static explicit operator Convertible?(int? ni) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\t a = $(Convertible?)(int?)33$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.IsFalse(rr.Conversion.IsLifted);\n\t\t\tAssert.AreEqual(\"ni\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_UIntConstant() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator Convertible(long l) {return new Convertible(); }\n\tpublic static explicit operator Convertible(uint ui) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tvar a = $(Convertible)33$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ui\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_NullableUIntConstant() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static explicit operator Convertible(long? l) {return new Convertible(); }\n\tpublic static explicit operator Convertible(uint? ui) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tConvertible a = $(Convertible)33$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ui\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UseDefinedExplicitConversion_Lifted() {\n\t\t\tstring program = @\"\nstruct Convertible {\n    public static explicit operator Convertible(int i) { return new Convertible(); }\n}\nclass Test {\n    public void M(int? i) {\n         a = $(Convertible?)i$;\n    }\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.IsTrue(rr.Conversion.IsLifted);\n\t\t\tAssert.IsTrue(rr.Input is LocalResolveResult);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_Short_Or_NullableByte_Target()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static explicit operator short(Test s) { return 0; }\n\tpublic static explicit operator byte?(Test b) { return 0; }\n}\nclass Program {\n\tpublic static void Main(string[] args)\n\t{\n\t\tint? x = $(int?)new Test()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"System.Int16\", rr.Conversion.Method.ReturnType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_Byte_Or_NullableShort_Target()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static explicit operator byte(Test b) { return 0; }\n\tpublic static explicit operator short?(Test s) { return 0; }\n}\nclass Program {\n\tpublic static void Main(string[] args)\n\t{\n\t\tint? x = $(int?)new Test()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"s\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExplicitConversionOperatorsCanOverrideApplicableImplicitOnes()\n\t\t{\n\t\t\tstring program = @\"\nstruct Convertible {\n    public static explicit operator int(Convertible ci) {return 0; }\n    public static implicit operator short(Convertible cs) {return 0; }\n}\nclass Test {\n    static void Main() {\n        int i = $(int)new Convertible()$; // csc uses the explicit conversion operator\n    }\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.IsUserDefined);\n\t\t\tAssert.AreEqual(\"ci\", rr.Conversion.Method.Parameters[0].Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_ConversionBeforeUserDefinedOperatorIsCorrect() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator Convertible(int l) {return new Convertible(); }\n}\nclass Test {\n\tpublic void M() {\n\t\tlong i = 33;\n\t\tConvertible a = $(Convertible)i$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionBeforeUserDefinedOperator.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionBeforeUserDefinedOperator.IsExplicit);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionBeforeUserDefinedOperator.IsNumericConversion);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionAfterUserDefinedOperator.IsIdentityConversion);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UserDefinedExplicitConversion_ConversionAfterUserDefinedOperatorIsCorrect() {\n\t\t\tstring program = @\"using System;\nclass Convertible {\n\tpublic static implicit operator long(Convertible i) {return 0; }\n}\nclass Test {\n\tpublic void M() {\n\t\tint a = $(int)new Convertible()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionBeforeUserDefinedOperator.IsIdentityConversion);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionAfterUserDefinedOperator.IsValid);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionAfterUserDefinedOperator.IsExplicit);\n\t\t\tAssert.IsTrue(rr.Conversion.ConversionAfterUserDefinedOperator.IsNumericConversion);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ExtensionMethodTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class ExtensionMethodTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void ExtensionMethodsTest()\n\t\t{\n\t\t\tstring program = @\"using XN;\nclass TestClass {\n\tstatic void Test(A a, B b, C c) {\n\t\t$;\n\t}\n}\nclass A { }\nclass B {\n\tpublic void F(int i) { }\n}\nclass C {\n\tpublic void F(object obj) { }\n}\nnamespace XN {\n\tpublic static class XC {\n\t\tpublic static void F(this object obj, int i) { }\n\t\tpublic static void F(this object obj, string s) { }\n\t}\n}\n\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$a.F(1)$\"));\n\t\t\tvar member = mrr.ReducedMethod;\n\t\t\tAssert.AreEqual(\"XN.XC.F\", member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", member.Parameters [0].Type.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$a.F(\\\"text\\\")$\"));\n\t\t\tmember = mrr.ReducedMethod;\n\t\t\tAssert.AreEqual(\"XN.XC.F\", member.FullName);\n\t\t\tAssert.AreEqual(\"System.String\", member.Parameters[0].Type.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$b.F(1)$\"));\n\t\t\tAssert.AreEqual(\"B.F\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$b.F(\\\"text\\\")$\"));\n\t\t\tmember = mrr.ReducedMethod;\n\t\t\tAssert.AreEqual(\"XN.XC.F\", member.FullName);\n\t\t\tAssert.AreEqual(\"System.String\", member.Parameters[0].Type.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$c.F(1)$\"));\n\t\t\tAssert.AreEqual(\"C.F\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$c.F(\\\"text\\\")$\"));\n\t\t\tAssert.AreEqual(\"C.F\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExtensionMethodsTest2()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Collections.Generic;\nclass TestClass {\n\tstatic void Test(string[] args) {\n\t\t$;\n\t}\n}\npublic static class XC {\n\tpublic static int ToInt32(this string s) { return int.Parse(s); }\n\tpublic static T[] Slice<T>(this T[] source, int index, int count) { throw new NotImplementedException(); }\n\tpublic static IEnumerable<T> Filter<T>(this IEnumerable<T> source, Predicate<T> predicate) { throw new NotImplementedException(); }\n}\n\";\n\t\t\tCSharpInvocationResolveResult mrr;\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$\\\"text\\\".ToInt32()$\"));\n\t\t\tAssert.AreEqual(\"XC.ToInt32\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$args.Slice(1, 2)$\"));\n\t\t\tAssert.AreEqual(\"XC.Slice\", mrr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.String[]\", mrr.Type.ReflectionName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$args.Filter(delegate { return true; })$\"));\n\t\t\tAssert.AreEqual(\"XC.Filter\", mrr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.String]]\", mrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FirstIsEligibleExtensionMethod()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Collections.Generic;\npublic static class XC {\n\t$public static TSource First<TSource>(this IEnumerable<TSource> source) {}$\n}\n\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tvar targetType = compilation.FindType(typeof(string[]));\n\t\t\tIType[] inferredTypes;\n\t\t\tbool isEligible = CSharpResolver.IsEligibleExtensionMethod(targetType, (IMethod)mrr.Member, true, out inferredTypes);\n\t\t\tAssert.IsTrue(isEligible);\n\t\t\tAssert.AreEqual(1, inferredTypes.Length);\n\t\t\tAssert.AreEqual(\"System.String\", inferredTypes[0].ReflectionName);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void InferTypeFromOverwrittenMethodArguments()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\n\t\tusing System.Linq;\n\t\t\n\t\tpublic class A { }\n\t\t\n\t\tpublic class B : A { }\n\t\t\n\t\tclass Program\n\t\t{\n\t\t\tstatic void Main(string[] args)\n\t\t\t{\n\t\t\t\tIEnumerable<B> list = new List<B>();\n\t\t\t\tvar arr = $list.ToArray<A>()$;\n\t\t\t}\n\t\t}\n\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A[]\", rr.Type.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Linq.Enumerable.ToArray\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(\"A\", ((IMethod)rr.Member).TypeArguments.Single().ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeInferenceBasedOnTargetTypeAndArgumentType()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\n\t\tusing System.Linq;\n\t\t\n\t\tpublic class A { }\n\t\tpublic class B : A { }\n\t\t\n\t\tstatic class Program\n\t\t{\n\t\t\tstatic void Main(A a, B b)\n\t\t\t{\n\t\t\t\tvar x = $b.Choose(a)$;\n\t\t\t}\n\t\t\t\n\t\t\tpublic static T Choose<T>(this T a, T b) { }\n\t\t}\n\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PartiallySpecializedMethod()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\n\t\tusing System.Linq;\n\t\t\n\t\tpublic class A { }\n\t\tpublic class B : A { }\n\t\t\n\t\tstatic class Program\n\t\t{\n\t\t\tstatic void Main(A a, B b)\n\t\t\t{\n\t\t\t\tvar x = $b.Choose$(a);\n\t\t\t}\n\t\t\t\n\t\t\tpublic static T Choose<T>(this T a, T b) { }\n\t\t}\n\";\n\t\t\tvar rr = Resolve<MethodGroupResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.Methods.Any());\n\t\t\t// We deliberately do not specialize the method unless partial specialization is requested explicitly.\n\t\t\t// This is because the actual type (when considering the whole invocation, not just the method group)\n\t\t\t// is actually A.\n\t\t\tAssert.AreEqual(\"``0\", rr.GetExtensionMethods().Single().Single().ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"``0\", rr.GetEligibleExtensionMethods(false).Single().Single().ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"B\", rr.GetEligibleExtensionMethods(true).Single().Single().ReturnType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CreateDelegateFromExtensionMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\n\tstatic class Program\n\t{\n\t\tstatic void Main() {\n\t\t\tFunc<string> f = $\"\"\"\".id$;\n\t\t}\n\t\tstatic string id(this string x) { return x; }\n\t}\n\";\n\t\t\tConversion c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsMethodGroupConversion);\n\t\t\tAssert.AreEqual(\"Program.id\", c.Method.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InferDelegateTypeFromExtensionMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\n\tstatic class Program\n\t{\n\t\tstatic void Main() {\n\t\t\t$call(\"\"\"\".id)$;\n\t\t}\n\t\t\n\t\tstatic string id(this string x) { return x; }\n\t\tstatic T call<T>(Func<T> f) { }\n\t}\n\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Type.FullName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/FindReferencesTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.Analysis;\nusing System.Text;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class FindReferencesTest\n\t{\n\t\tSyntaxTree syntaxTree;\n\t\tCSharpUnresolvedFile unresolvedFile;\n\t\tICompilation compilation;\n\t\tFindReferences findReferences;\n\t\t\n\t\tvoid Init(string code)\n\t\t{\n\t\t\tsyntaxTree = SyntaxTree.Parse(code, \"test.cs\");\n\t\t\tunresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tcompilation = TypeSystemHelper.CreateCompilation(unresolvedFile);\n\t\t\tfindReferences = new FindReferences();\n\t\t}\n\t\t\n\t\tAstNode[] FindReferences(ISymbol entity)\n\t\t{\n\t\t\tvar result = new List<AstNode>();\n\t\t\tvar searchScopes = findReferences.GetSearchScopes(entity);\n\t\t\tfindReferences.FindReferencesInFile(searchScopes, unresolvedFile, syntaxTree, compilation,\n\t\t\t                                    (node, rr) => result.Add(node), CancellationToken.None);\n\t\t\treturn result.OrderBy(n => n.StartLocation).ToArray();\n\t\t}\n\n\t\tAstNode[] FindReferences(INamespace ns)\n\t\t{\n\t\t\tvar result = new List<AstNode>();\n\t\t\tvar searchScopes = findReferences.GetSearchScopes(ns);\n\t\t\tfindReferences.FindReferencesInFile(searchScopes, unresolvedFile, syntaxTree, compilation,\n\t\t\t                                    (node, rr) => result.Add(node), CancellationToken.None);\n\t\t\treturn result.OrderBy(n => n.StartLocation).ToArray();\n\t\t}\n\n\t\t#region Parameters\n\t\t[Test]\n\t\tpublic void FindParameterReferences()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Test {\n\tvoid M(string par) {\n\t\tConsole.WriteLine (par);\n\t}\n\n\tvoid Other()\n\t{\n\t\tM(par:null);\n\t}\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single();\n\t\t\tvar method = test.Methods.Single(m => m.Name == \"M\");\n\t\t\tAssert.AreEqual(new int[] { 3, 4, 9 }, FindReferences(method.Parameters[0]).Select(n => n.StartLocation.Line).ToArray());\n\t\t}\n\t\t#endregion\n\n\n\t\t#region Method Group\n\t\t[Test]\n\t\tpublic void FindMethodGroupReference()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Test {\n  Action<int> x = M;\n  Action<string> y = M;\n  static void M(int a) {}\n  static void M(string a) {}\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single();\n\t\t\tvar m_int = test.Methods.Single(m => m.Name == \"M\" && m.Parameters.Single().Type.Name == \"Int32\");\n\t\t\tvar m_string = test.Methods.Single(m => m.Name == \"M\" && m.Parameters.Single().Type.Name == \"String\");\n\t\t\tAssert.AreEqual(new int[] { 3, 5 }, FindReferences(m_int).Select(n => n.StartLocation.Line).ToArray());\n\t\t\tAssert.AreEqual(new int[] { 4, 6 }, FindReferences(m_string).Select(n => n.StartLocation.Line).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindMethodGroupReferenceInOtherMethodCall()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Test {\n static void T(Action<int> a, Action<string> b) {\n  this.T(M, M);\n }\n static void M(int a) {}\n static void M(string a) {}\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single();\n\t\t\tvar m_int = test.Methods.Single(m => m.Name == \"M\" && m.Parameters.Single().Type.Name == \"Int32\");\n\t\t\tvar m_string = test.Methods.Single(m => m.Name == \"M\" && m.Parameters.Single().Type.Name == \"String\");\n\t\t\tAssert.AreEqual(new [] { new TextLocation(4, 10), new TextLocation(6, 2) },\n\t\t\t                FindReferences(m_int).Select(n => n.StartLocation).ToArray());\n\t\t\tAssert.AreEqual(new [] { new TextLocation(4, 13), new TextLocation(7, 2) },\n\t\t\t                FindReferences(m_string).Select(n => n.StartLocation).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindMethodGroupReferenceInExplicitDelegateCreation()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Test {\n static void T(Action<int> a, Action<string> b) {\n  this.T(new Action<int>(M), new Action<string>(M));\n }\n static void M(int a) {}\n static void M(string a) {}\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single();\n\t\t\tvar m_int = test.Methods.Single(m => m.Name == \"M\" && m.Parameters.Single().Type.Name == \"Int32\");\n\t\t\tvar m_string = test.Methods.Single(m => m.Name == \"M\" && m.Parameters.Single().Type.Name == \"String\");\n\t\t\tAssert.AreEqual(new [] { new TextLocation(4, 26), new TextLocation(6, 2) },\n\t\t\t                FindReferences(m_int).Select(n => n.StartLocation).ToArray());\n\t\t\tAssert.AreEqual(new [] { new TextLocation(4, 49), new TextLocation(7, 2) },\n\t\t\t                FindReferences(m_string).Select(n => n.StartLocation).ToArray());\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region GetEnumerator\n\t\t[Test]\n\t\tpublic void FindReferenceToGetEnumeratorUsedImplicitlyInForeach()\n\t\t{\n\t\t\tInit(@\"using System;\nclass MyEnumerable {\n public System.Collections.IEnumerator GetEnumerator();\n}\nclass Test {\n static void T() {\n  var x = new MyEnumerable();\n  foreach (var y in x) {\n  }\n }\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"MyEnumerable\");\n\t\t\tvar getEnumerator = test.Methods.Single(m => m.Name == \"GetEnumerator\");\n\t\t\tvar actual = FindReferences(getEnumerator).ToList();\n\t\t\tAssert.AreEqual(2, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 3 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 8 && r is ForeachStatement));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Op_Implicit\n\t\t[Test]\n\t\tpublic void FindReferencesForOpImplicitInLocalVariableInitialization()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Test {\n static void T() {\n  int x = new Test();\n }\n public static implicit operator int(Test x) { return 0; }\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"Test\");\n\t\t\tvar opImplicit = test.Methods.Single(m => m.Name == \"op_Implicit\");\n\t\t\tvar actual = FindReferences(opImplicit).ToList();\n\t\t\tAssert.AreEqual(2, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 4 && r is ObjectCreateExpression));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 6 && r is OperatorDeclaration));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindReferencesForOpImplicitInLocalVariableInitialization_ExplicitCast()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Test {\n static void T() {\n  int x = (int)new Test();\n }\n public static implicit operator int(Test x) { return 0; }\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"Test\");\n\t\t\tvar opImplicit = test.Methods.Single(m => m.Name == \"op_Implicit\");\n\t\t\tvar actual = FindReferences(opImplicit).ToList();\n\t\t\tAssert.AreEqual(2, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 4 && r is ObjectCreateExpression));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 6 && r is OperatorDeclaration));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindReferencesForOpImplicitInAssignment_ExplicitCast()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Test {\n static void T() {\n  int x;\n  x = (int)new Test();\n }\n public static implicit operator int(Test x) { return 0; }\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"Test\");\n\t\t\tvar opImplicit = test.Methods.Single(m => m.Name == \"op_Implicit\");\n\t\t\tvar actual = FindReferences(opImplicit).ToList();\n\t\t\tAssert.AreEqual(2, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 5 && r is ObjectCreateExpression));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 7 && r is OperatorDeclaration));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Inheritance\n\t\tconst string inheritanceTest = @\"using System;\nclass A { public virtual void M() {} }\nclass B : A { public override void M() {} }\nclass C : A { public override void M() {} }\nclass Calls {\n\tvoid Test(A a, B b, C c) {\n\t\ta.M();\n\t\tb.M();\n\t\tc.M();\n\t}\n}\";\n\t\t\n\t\t[Test]\n\t\tpublic void InheritanceTest1()\n\t\t{\n\t\t\tInit(inheritanceTest);\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"B\");\n\t\t\tvar BM = test.Methods.Single(m => m.Name == \"M\");\n\t\t\tvar actual = FindReferences(BM).ToList();\n\t\t\tAssert.AreEqual(2, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 3 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 8 && r is InvocationExpression));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InheritanceTest2()\n\t\t{\n\t\t\tInit(inheritanceTest);\n\t\t\tfindReferences.FindCallsThroughVirtualBaseMethod = true;\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"B\");\n\t\t\tvar BM = test.Methods.Single(m => m.Name == \"M\");\n\t\t\tvar actual = FindReferences(BM).ToList();\n\t\t\tAssert.AreEqual(3, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 3 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 7 && r is InvocationExpression));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 8 && r is InvocationExpression));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InheritanceTest3()\n\t\t{\n\t\t\tInit(inheritanceTest);\n\t\t\tfindReferences.WholeVirtualSlot = true;\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"B\");\n\t\t\tvar BM = test.Methods.Single(m => m.Name == \"M\");\n\t\t\tvar actual = FindReferences(BM).ToList();\n\t\t\tAssert.AreEqual(6, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 2 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 3 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 4 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 7 && r is InvocationExpression));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 8 && r is InvocationExpression));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 9 && r is InvocationExpression));\n\t\t}\n\t\t#endregion\n\n\t\t#region Await\n\n\t\t#if NET_4_5\n\n\t\tconst string awaitTest = @\"using System;\nclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic int GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter GetAwaiter() { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = await x;\n\t}\n}\";\n\n\t\t[Test]\n\t\tpublic void GetAwaiterReferenceInAwaitExpressionIsFound() {\n\t\t\tInit(awaitTest);\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"MyAwaitable\");\n\t\t\tvar method = test.Methods.Single(m => m.Name == \"GetAwaiter\");\n\t\t\tvar actual = FindReferences(method).ToList();\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 8 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetResultReferenceInAwaitExpressionIsFound() {\n\t\t\tInit(awaitTest);\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"MyAwaiter\");\n\t\t\tvar method = test.Methods.Single(m => m.Name == \"GetResult\");\n\t\t\tvar actual = FindReferences(method).ToList();\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 5 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnCompletedReferenceInAwaitExpressionIsFound() {\n\t\t\tInit(awaitTest);\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"MyAwaiter\");\n\t\t\tvar method = test.Methods.Single(m => m.Name == \"OnCompleted\");\n\t\t\tvar actual = FindReferences(method).ToList();\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 4 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IsCompletedReferenceInAwaitExpressionIsFound() {\n\t\t\tInit(awaitTest);\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"MyAwaiter\");\n\t\t\tvar property = test.Properties.Single(m => m.Name == \"IsCompleted\");\n\t\t\tvar actual = FindReferences(property).ToList();\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 3 && r is PropertyDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 13 && r is UnaryOperatorExpression));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnsafeOnCompletedReferenceInAwaitExpressionIsFound() {\n\t\t\tInit(@\"using System;\nclass MyAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic void UnsafeOnCompleted(Action continuation) {}\n\tpublic int GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter GetAwaiter() { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = await x;\n\t}\n}\");\n\t\t\tvar test = compilation.MainAssembly.TopLevelTypeDefinitions.Single(t => t.Name == \"MyAwaiter\");\n\t\t\tvar method = test.Methods.Single(m => m.Name == \"UnsafeOnCompleted\");\n\t\t\tvar actual = FindReferences(method).ToList();\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 5 && r is MethodDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 14 && r is UnaryOperatorExpression));\n\t\t}\n\n\t\t#endif // NET_4_5\n\n\t\t#endregion\n\t\t\n\t\t#region Namespaces\n\t\t[Test]\n\t\tpublic void FindNamespaceTest()\n\t\t{\n\t\t\tInit(@\"using System;\nusing Foo.Bar;\n\nnamespace Foo.Bar {\n\tclass MyTest { }\n}\n\nnamespace Other.Bar {\n\tclass OtherTest {}\n}\n\nnamespace Foo\n{\n\tclass Test\n\t{\n\t\tstatic void T()\n\t\t{\n\t\t\tBar.MyTest test;\n\t\t\tOther.Bar.OtherTest test2;\n\t\t}\n\t}\n}\n\nnamespace B\n{\n\tusing f = Foo.Bar;\n\tclass Test2\n\t{\n\t\tFoo.Bar.MyTest a;\n\t}\n}\n\");\n\t\t\tvar test = compilation.MainAssembly.RootNamespace.GetChildNamespace(\"Foo\").GetChildNamespace (\"Bar\");\n\t\t\tvar actual = FindReferences(test).ToList();\n\t\t\tAssert.AreEqual(5, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 2 && r is MemberType));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 4 && r is NamespaceDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 18 && r is SimpleType));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 26 && r is MemberType));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 29 && r is MemberType));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FindSub()\n\t\t{\n\t\t\tInit(@\"using System;\nusing Foo.Bar;\n\nnamespace Foo.Bar {\n\tclass MyTest { }\n}\n\nnamespace Foo\n{\n\tclass Test\n\t{\n\t\tFoo.Bar.MyTest t;\n\t}\n}\n\");\n\t\t\tvar test = compilation.MainAssembly.RootNamespace.GetChildNamespace(\"Foo\");\n\t\t\tvar actual = FindReferences(test).ToList();\n\t\t\tAssert.AreEqual(4, actual.Count);\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 2 && r is SimpleType));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 4 && r is NamespaceDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 8 && r is NamespaceDeclaration));\n\t\t\tAssert.IsTrue(actual.Any(r => r.StartLocation.Line == 12 && r is SimpleType));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Rename\n\n\t\tinternal static ISymbol GetSymbol (ICompilation compilation, string reflectionName)\n\t\t{\n\t\t\tStack<ITypeDefinition> typeStack = new Stack<ITypeDefinition>(compilation.MainAssembly.TopLevelTypeDefinitions);\n\t\t\twhile (typeStack.Count > 0) {\n\t\t\t\tvar cur = typeStack.Pop();\n\t\t\t\tif (cur.ReflectionName == reflectionName)\n\t\t\t\t\treturn cur;\n\t\t\t\tforeach (var member in cur.Members)\n\t\t\t\t\tif (member.ReflectionName == reflectionName)\n\t\t\t\t\t\treturn member;\n\t\t\t\tforeach (var nested in cur.NestedTypes) {\n\t\t\t\t\ttypeStack.Push(nested);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tIList<AstNode> Rename(string fullyQualifiedName, string newName, bool includeOverloads)\n\t\t{\n\t\t\tvar sym = GetSymbol(compilation, fullyQualifiedName);\n\t\t\tAssert.NotNull(sym);\n\t\t\tvar graph = new Lazy<TypeGraph>(() => new TypeGraph(compilation.Assemblies));\n\t\t\tvar col = new SymbolCollector();\n\t\t\tcol.IncludeOverloads = includeOverloads;\n\t\t\tcol.GroupForRenaming = true;\n\t\t\tvar scopes = findReferences.GetSearchScopes(col.GetRelatedSymbols(graph, sym));\n\t\t\tList<AstNode> result = new List<AstNode>();\n\n\t\t\tfindReferences.RenameReferencesInFile(\n\t\t\t\tscopes,\n\t\t\t\tnewName,\n\t\t\t\tnew CSharpAstResolver(compilation, syntaxTree, unresolvedFile),\n\t\t\t\tdelegate(RenameCallbackArguments obj) {\n\t\t\t\t\tresult.Add (obj.NodeToReplace);\n\t\t\t\t},\n\t\t\t\tdelegate(Error obj) {\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\treturn result;\n\t\t}\n\n\t\tvoid TestRename(string code, string symbolName)\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tList<int> offsets = new List<int>();\n\t\t\tforeach (var ch in code) {\n\t\t\t\tif (ch == '$') {\n\t\t\t\t\toffsets.Add(sb.Length);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append(ch);\n\t\t\t}\n\t\t\tInit(sb.ToString ());\n\t\t\tfindReferences.WholeVirtualSlot = true;\n\t\t\tvar doc = new ReadOnlyDocument(sb.ToString ());\n\t\t\tvar result = Rename(symbolName, \"x\", false);\n\t\t\tAssert.AreEqual(offsets.Count, result.Count);\n\n\t\t\tresult.Select(r => doc.GetOffset (r.StartLocation)).SequenceEqual(offsets);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleRename ()\n\t\t{\n\t\t\tTestRename (@\"using System;\nclass $Test {\n\t$Test test;\n}\", \"Test\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestOverride ()\n\t\t{\n\t\t\tTestRename(@\"using System;\nclass Test {\n\tpublic virtual int $Foo { get; set; }\n}\n\nclass Test2 : Test {\n\tpublic override int $Foo { get; set; }\n}\n\nclass Test3 : Test {\n\tpublic override int $Foo { get; set; }\n\tpublic FindReferencesTest ()\n\t{\n\t\t$Foo = 4;\n\t}\n}\n\", \"Test.Foo\");\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/InvocationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class InvocationTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void MethodCallTest()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t$TargetMethod()$;\n\t}\n\t\n\tint TargetMethod() {\n\t\treturn 3;\n\t}\n}\n\";\n\t\t\tInvocationResolveResult result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.TargetMethod\", result.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidMethodCall()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method(string b) {\n\t\t$b.ThisMethodDoesNotExistOnString(b)$;\n\t}\n}\n\";\n\t\t\tUnknownMethodResolveResult result = Resolve<UnknownMethodResolveResult>(program);\n\t\t\tAssert.AreEqual(\"ThisMethodDoesNotExistOnString\", result.MemberName);\n\t\t\tAssert.AreEqual(\"System.String\", result.TargetType.FullName);\n\t\t\tAssert.AreEqual(1, result.Parameters.Count);\n\t\t\tAssert.AreEqual(\"b\", result.Parameters[0].Name);\n\t\t\tAssert.AreEqual(\"System.String\", result.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tAssert.AreSame(SpecialType.UnknownType, result.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OverriddenMethodCall()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t$new B().GetRandomNumber()$;\n\t}\n\t\n\tpublic abstract int GetRandomNumber();\n}\nclass B : A {\n\tpublic override int GetRandomNumber() {\n\t\treturn 4; // chosen by fair dice roll.\n\t\t          // guaranteed to be random\n\t}\n}\n\";\n\t\t\tInvocationResolveResult result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"B.GetRandomNumber\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OverriddenMethodCall2()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t$new B().GetRandomNumber(\"\"x\"\", this)$;\n\t}\n\t\n\tpublic abstract int GetRandomNumber(string a, A b);\n}\nclass B : A {\n\tpublic override int GetRandomNumber(string b, A a) {\n\t\treturn 4;\n\t}\n}\n\";\n\t\t\tInvocationResolveResult result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"B.GetRandomNumber\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ThisMethodCallTest()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t$this.TargetMethod()$;\n\t}\n\t\n\tint TargetMethod() {\n\t\treturn 3;\n\t}\n}\n\";\n\t\t\tInvocationResolveResult result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.TargetMethod\", result.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A {\n\tvoid TestMethod() {\n\t\t$TestMethod()$;\n\t}\n}\n\";\n\t\t\tAssert.AreEqual(\"System.Void\", Resolve(program).Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EventCallTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A {\n\tvoid Method() {\n\t\t$TestEvent(this, EventArgs.Empty)$;\n\t}\n\t\n\tpublic event EventHandler TestEvent;\n}\n\";\n\t\t\tAssert.AreEqual(\"System.Void\", Resolve(program).Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DelegateCallTest()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Reflection;\nclass A {\n\tvoid Method(ModuleResolveEventHandler eh) {\n\t\t$eh(this, new ResolveEventArgs())$;\n\t}\n}\n\";\n\t\t\tAssert.AreEqual(\"System.Reflection.Module\", Resolve(program).Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DelegateReturnedFromMethodCallTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A {\n\tvoid Method() {\n\t\t$GetHandler()(abc)$;\n\t}\n\tabstract Predicate<string> GetHandler();\n}\n\";\n\t\t\tAssert.AreEqual(\"System.Boolean\", Resolve(program).Type.ReflectionName);\n\t\t}\n\t\t\n\t\t/* TODO\n\t\t[Test]\n\t\tpublic void MethodGroupResolveTest()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t\n\t}\n\t\n\tvoid TargetMethod(int a) { }\n\tvoid TargetMethod<T>(T a) { }\n}\n\";\n\t\t\tMethodGroupResolveResult result = Resolve<MethodGroupResolveResult>(program, \"TargetMethod\", 3);\n\t\t\tAssert.AreEqual(\"TargetMethod\", result.Name);\n\t\t\tAssert.AreEqual(2, result.Methods.Count);\n\t\t\t\n\t\t\tresult = Resolve<MethodGroupResolveResult>(program, \"TargetMethod<string>\", 3);\n\t\t\tAssert.AreEqual(\"TargetMethod\", result.Name);\n\t\t\tAssert.AreEqual(1, result.Methods[0].Count);\n\t\t\tAssert.AreEqual(\"System.String\", result.GetMethodIfSingleOverload().Parameters[0].ReturnType.FullyQualifiedName);\n\t\t}\n\t\t */\n\t\t\n\t\t[Test]\n\t\tpublic void TestOverloadingByRef()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Program {\n\tpublic static void Main() {\n\t\tint a = 42;\n\t\tT(a);\n\t\tT(ref a);\n\t}\n\tstatic void T(int x) {}\n\tstatic void T(ref int y) {}\n}\";\n\t\t\t\n\t\t\tInvocationResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"T(a)\", \"$T(a)$\"));\n\t\t\tAssert.IsFalse(mrr.Member.Parameters[0].IsRef);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"T(ref a)\", \"$T(ref a)$\"));\n\t\t\tAssert.IsTrue(mrr.Member.Parameters[0].IsRef);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverload()\n\t\t{\n\t\t\tstring program = @\"class BaseClass {\n\tstatic void Main(DerivedClass d) {\n\t\t$d.Test(3)$;\n\t}\n\tpublic void Test(int a) { }\n}\nclass DerivedClass : BaseClass {\n\tpublic void Test(object a) { }\n}\";\n\t\t\tInvocationResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverloadOnInterface()\n\t\t{\n\t\t\tstring program = @\"\ninterface IBase { void Method(int a); }\ninterface IDerived { void Method(object a); }\nclass Test {\n\tstatic void Main(IDerived d) {\n\t\t$d.Method(3)$;\n\t}\n}\";\n\t\t\tInvocationResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"IDerived.Method\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedNonApplicableOverload()\n\t\t{\n\t\t\tstring program = @\"class BaseClass {\n\tstatic void Main(DerivedClass d) {\n\t\t$d.Test(3)$;\n\t}\n\tpublic void Test(int a) { }\n}\nclass DerivedClass : BaseClass {\n\tpublic void Test(string a) { }\n}\";\n\t\t\tInvocationResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"BaseClass.Test\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"(3)\", \"(\\\"3\\\")\"));\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OverrideShadowed()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass BaseClass {\n\tstatic void Main() {\n\t\t$new DerivedClass().Test(3)$;\n\t}\n\tpublic virtual void Test(int a) { }\n}\nclass MiddleClass : BaseClass {\n\tpublic void Test(object a) { }\n}\nclass DerivedClass : MiddleClass {\n\tpublic override void Test(int a) { }\n}\";\n\t\t\t\n\t\t\tInvocationResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"MiddleClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SubstituteClassAndMethodTypeParametersAtOnce()\n\t\t{\n\t\t\tstring program = @\"class C<X> { static void M<T>(X a, T b) { $C<T>.M(b, a)$; } }\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\t\n\t\t\tvar m = (IMethod)rr.Member;\n\t\t\tAssert.AreEqual(\"X\", m.TypeArguments.Single().Name);\n\t\t\tAssert.AreEqual(\"T\", m.Parameters[0].Type.Name);\n\t\t\tAssert.AreEqual(\"X\", m.Parameters[1].Type.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MemberHiddenOnOneAccessPath()\n\t\t{\n\t\t\t// If a member is hidden in any access path, it is hidden in all access paths\n\t\t\tstring program = @\"\ninterface IBase { int F { get; } }\ninterface ILeft: IBase { new int F { get; } }\ninterface IRight: IBase { void G(); }\ninterface IDerived: ILeft, IRight {}\nclass A {\n   void Test(IDerived d) { var a = $d.F$; }\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"ILeft.F\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyClashesWithMethod()\n\t\t{\n\t\t\tstring program = @\"\ninterface IList { int Count { get; set; } }\ninterface ICounter { void Count(int i); }\ninterface IListCounter: IList, ICounter {}\nclass A {\n \tvoid Test(IListCounter x) { var a = $x.Count$; }\n}\";\n\t\t\tvar rr = Resolve<MethodGroupResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"ICounter.Count\", rr.Methods.Single().FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OverloadAmbiguousWithMethodInTwoInterfaces()\n\t\t{\n\t\t\tstring program = @\"\ninterface ILeft { void Method(); }\ninterface IRight { void Method(); }\ninterface IBoth : ILeft, IRight {}\nclass A {\n \tvoid Test(IBoth x) { $x.Method()$; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.AmbiguousMatch, rr.OverloadResolutionErrors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverloadInOneInterfaceAndBetterOverloadInOtherInterface1()\n\t\t{\n\t\t\tstring program = @\"\ninterface IBase { void Method(int x); }\ninterface ILeft : IBase { void Method(object x); }\ninterface IRight { void Method(int x); }\ninterface IBoth : ILeft, IRight {}\nclass A {\n \tvoid Test(IBoth x) { $x.Method(1)$; }\n}\";\n\t\t\t// IBase.Method is \"hidden\" because ILeft.Method is also applicable,\n\t\t\t// so IRight.Method is unambiguously the chosen overload.\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"IRight.Method\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverloadInOneInterfaceAndBetterOverloadInOtherInterface2()\n\t\t{\n\t\t\t// repeat the above test with Left/Right swapped to make sure we aren't order-sensitive\n\t\t\tstring program = @\"\ninterface IBase { void Method(int x); }\ninterface ILeft : IBase { void Method(object x); }\ninterface IRight { void Method(int x); }\ninterface IBoth : IRight, ILeft {}\nclass A {\n \tvoid Test(IBoth x) { $x.Method(1)$; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"IRight.Method\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverloadHidesCommonBaseMethod_Generic1()\n\t\t{\n\t\t\tstring program = @\"\ninterface IBase<T> {\n\tvoid Method(int x);\n}\ninterface ILeft : IBase<int> { void Method(object x); }\ninterface IRight : IBase<int> { }\ninterface IBoth : ILeft, IRight {}\nclass A {\n\tvoid Test(IBoth x) { $x.Method(1)$; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"ILeft.Method\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverloadHidesCommonBaseMethod_Generic2()\n\t\t{\n\t\t\tstring program = @\"\ninterface IBase<T> {\n\tvoid Method(int x);\n}\ninterface ILeft : IBase<int> { void Method(object x); }\ninterface IRight : IBase<int> { }\ninterface IBoth : ILeft, IRight {}\nclass A {\n\tvoid Test(IBoth x) { $x.Method(1)$; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"ILeft.Method\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverloadDoesNotHideCommonBaseMethodWithDifferentTypeArgument1()\n\t\t{\n\t\t\tstring program = @\"\ninterface IBase<T> {\n\tvoid Method(int x);\n}\ninterface ILeft : IBase<int> { void Method(object x); }\ninterface IRight : IBase<long> { }\ninterface IBoth : IRight, ILeft {}\nclass A {\n\tvoid Test(IBoth x) { $x.Method(1)$; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"IBase`1[[System.Int64]]\", rr.Member.DeclaringType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AddedOverloadDoesNotHideCommonBaseMethodWithDifferentTypeArgument2()\n\t\t{\n\t\t\tstring program = @\"\ninterface IBase<T> {\n\tvoid Method(int x);\n}\ninterface ILeft : IBase<int> { void Method(object x); }\ninterface IRight : IBase<long> { }\ninterface IBoth : IRight, ILeft {}\nclass A {\n\tvoid Test(IBoth x) { $x.Method(1)$; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"IBase`1[[System.Int64]]\", rr.Member.DeclaringType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AmbiguityBetweenMemberAndMethodIsNotAnError()\n\t\t{\n\t\t\tstring program = @\"\ninterface ILeft { void Method(object x); }\ninterface IRight { Action<object> Method { get; } }\ninterface IBoth : ILeft, IRight {}\nclass A {\n\tvoid Test(IBoth x) { $x.Method(null)$; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"ILeft.Method\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AcceptVisitor()\n\t\t{\n\t\t\tstring program = @\"\ninterface IVisitor<in T, out S> { }\nclass Test : IVisitor<object, object> {\n\tvoid M() {\n\t\t$Accept(this, null)$;\n\t}\n\tS Accept<T, S>(IVisitor<T, S> v, T input) { }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tvar typeArguments = ((IMethod)rr.Member).TypeArguments;\n\t\t\tAssert.AreEqual(\"System.Object\", typeArguments[0].ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Object\", typeArguments[1].ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FirstParameterToExtensionMethod()\n\t\t{\n\t\t\tstring program = @\"\npublic class X {}\npublic static class Ex {\n\tpublic static void F(this X x, int y, int z) {}\n}\nclass C {\n\tpublic void M() {\n\t\tX a = null;\n\t\tint b = 0, c = 0;\n\t\t$a.F(b, c)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.That(rr.IsExtensionMethodInvocation, Is.True);\n\t\t\tAssert.That(rr.Arguments[0], Is.InstanceOf<LocalResolveResult>());\n\t\t\tAssert.That(((LocalResolveResult)rr.Arguments[0]).Variable.Name, Is.EqualTo(\"a\"));\n\t\t\tAssert.That(rr.Arguments[1], Is.InstanceOf<LocalResolveResult>());\n\t\t\tAssert.That(((LocalResolveResult)rr.Arguments[1]).Variable.Name, Is.EqualTo(\"b\"));\n\t\t\tAssert.That(rr.Arguments[2], Is.InstanceOf<LocalResolveResult>());\n\t\t\tAssert.That(((LocalResolveResult)rr.Arguments[2]).Variable.Name, Is.EqualTo(\"c\"));\n\t\t\t\n\t\t\tAssert.That(rr.TargetResult, Is.InstanceOf<TypeResolveResult>());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseInvocation()\n\t\t{\n\t\t\tstring program = @\"\nclass B {\n\tpublic virtual void F(int x, int y) {}\n}\nclass D : B {\n\tpublic override void F(int x, int y) {}\n\tpublic void M() {\n\t\t$base.F(0, 1)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsFalse(rr.IsVirtualCall);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NamedArgument()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tpublic void F(int x) {}\n\tpublic void Test() {\n\t\tF($x: 0$);\n\t}\n}\";\n\t\t\tvar narr = Resolve<NamedArgumentResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConstantResolveResult>(narr.Argument);\n\t\t\tAssert.AreEqual(\"x\", narr.ParameterName);\n\t\t\tAssert.AreEqual(\"Test.F\", narr.Member.FullName);\n\t\t\tAssert.AreSame(narr.Member.Parameters.Single(), narr.Parameter);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NamedArgumentInInvocation()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tpublic void F(int x) {}\n\tpublic void Test() {\n\t\t$F(x: 0)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<NamedArgumentResolveResult>(rr.Arguments.Single());\n\t\t\tvar narr = (NamedArgumentResolveResult)rr.Arguments.Single();\n\t\t\tAssert.IsInstanceOf<ConstantResolveResult>(narr.Argument);\n\t\t\tAssert.AreEqual(\"x\", narr.ParameterName);\n\t\t\tAssert.AreEqual(\"Test.F\", narr.Member.FullName);\n\t\t\tAssert.AreSame(narr.Member.Parameters.Single(), narr.Parameter);\n\t\t\t\n\t\t\t// but GetArgumentsForCall() should directly return the constant:\n\t\t\tAssert.IsInstanceOf<ConstantResolveResult>(rr.GetArgumentsForCall().Single());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownNamedArgument()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tpublic void F(int x) {}\n\tpublic void Test() {\n\t\tF($y: 0$);\n\t}\n}\";\n\t\t\tvar narr = Resolve<NamedArgumentResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConstantResolveResult>(narr.Argument);\n\t\t\tAssert.AreEqual(\"y\", narr.ParameterName);\n\t\t\tAssert.IsNull(narr.Parameter);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NamedArgumentInMissingMethod()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tpublic void Test() {\n\t\tMissing($x: 0$);\n\t}\n}\";\n\t\t\tvar narr = Resolve<NamedArgumentResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConstantResolveResult>(narr.Argument);\n\t\t\tAssert.AreEqual(\"x\", narr.ParameterName);\n\t\t\tAssert.IsNull(narr.Parameter);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodInvocationWithConstraintMismatch()\n\t\t{\n\t\t\tstring program = @\"\ninterface IA\n{\n}\nclass Test\n{\n    void F()\n    {\n        string o = null;\n        $M(o)$;\n    }\n\n    void M<T>(T arg) where T : IA\n    {\n    }\n    void M(object arg) {\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.MethodConstraintsNotSatisfied, rr.OverloadResolutionErrors);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodCanBeInvokedWithNullableTypeArgument1() {\n\t\t\tstring program = @\"\npublic class C {\n\tstatic T F<T>() {\n\t\treturn default(T);\n\t}\n\n\tvoid M() {\n\t\t$F<int?>()$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodCanBeInvokedWithNullableTypeArgument2() {\n\t\t\tstring program = @\"\npublic class C {\n\tstatic T F<T>(T t) {\n\t\treturn default(T);\n\t}\n\n\tvoid M() {\n\t\t$F((int?)null)$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodCanBeInvokedWithNullableTypeArgument3() {\n\t\t\tstring program = @\"\npublic class C {\n\tstatic T F<T, U>() where T : U {\n\t\treturn default(T);\n\t}\n\n\tvoid M() {\n\t\t$F<int?, object>()$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithStructContraintCanBeInvokedWithValueType() {\n\t\t\tstring program = @\"\npublic class C {\n\tstatic T F<T>() where T : struct {\n\t\treturn default(T);\n\t}\n\n\tvoid M() {\n\t\t$F<int>()$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithStructContraintCannotBeInvokedWithNullableValueType() {\n\t\t\tstring program = @\"\npublic class C {\n\tstatic T F<T>() where T : struct {\n\t\treturn default(T);\n\t}\n\n\tvoid M() {\n\t\t$F<int?>()$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.MethodConstraintsNotSatisfied, rr.OverloadResolutionErrors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CanConstructGenericTypeWithNullableTypeArgument() {\n\t\t\tstring program = @\"\npublic class X<T> {}\npublic class C {\n\tvoid M() {\n\t\t$new X<int?>()$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OverloadResolutionIsAmbiguousEvenIfNotDelegateCompatible() {\n\t\t\tstring program = @\"\nclass Test {\n\tstatic void M(Func<int> o) {}\n\tstatic void M(Action o) {}\n\t\n\tstatic int K() { return 0; }\n\t\n\tstatic void Main() {\n\t\t$M(K)$;\n\t}\n}\";\n\t\t\t// K is only delegate-compatible with one of the overloads; yet we get an invalid match.\n\t\t\t// This is because the conversion exists even though it is invalid.\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.AmbiguousMatch, rr.OverloadResolutionErrors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexerWithMoreSpecificParameterTypesIsPreferred()\n\t\t{\n\t\t\tstring program = @\"\nclass A {\n\tpublic static void Test(B<object> b) {\n\t\tx = $b[4]$;\n\t}\n}\npublic class B<T> {\n\tpublic string this[T key] {\n\t\tget { return \"\"1\"\"; }\n\t}\n\tpublic int this[object key] {\n\t\tget { return 2; }\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Member.ReturnType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithMoreSpecificParameterTypesIsPreferred()\n\t\t{\n\t\t\tstring program = @\"\nclass A {\n\tpublic static void Test(B<object> b) {\n\t\t$b.M(4)$;\n\t}\n}\npublic class B<T> {\n\tpublic string M(T key) {\n\t\treturn \"\"1\"\";\n\t}\n\tpublic int M(object key) {\n\t\treturn 2;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Member.ReturnType.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GenericInvocationWithTypeArgumentAsICollection() {\n\t\t\tstring program = @\"\nusing System;\nusing System.Collections.Generic;\n\nstatic class C1 {\n\tpublic static void G<TC, TI>(TC items) where TC : ICollection<TI> {}\n\n\tpublic static void M<TI>(TI[] items) {\n\t\t$G<TI[], TI>(items)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstraintBetweenTwoInferredTypeArguments() {\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass Program\n{\n\tstatic T[] ToArray<T, V>(List<V> list, T[] empty) where V : T {}\n\t\n\tpublic static void Test(List<Type> interfaces, Type[] emptyTypes)\n\t{\n\t\treturn $ToArray(interfaces, emptyTypes)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OverloadResolutionWithDerivedTypesAndLambdas() {\n\t\t\tstring program = @\"using System;\npublic class C {\n\tclass B {}\n\tclass D : B {}\n\n\tstatic void F(B a, Func<B, object> f) {}\n\tstatic void F(D a, Func<D, object> f) {}\n\n\tpublic static void M(object obj) {\n\t\t$F(new D(), n => 0)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.IsError, Is.False);\n\t\t\tAssert.That(rr.Member.Parameters[0].Type.Name == \"D\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OverloadResolutionBetweenArrayTypes() {\n\t\t\tstring program = @\"using System;\npublic class C {\n\tstatic void F(object[] a, Func<object, object> f) {}\n\tstatic void F(string[] a, Func<string, object> f) {}\n\n\tpublic static void M() {\n\t\t$F(new string[0], n => 0)$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.IsError, Is.False);\n\t\t\tAssert.That(rr.Member.Parameters[0].Type.Kind == TypeKind.Array && ((ArrayType)rr.Member.Parameters[0].Type).ElementType.Name == \"String\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OverloadResolutionBetweenArrayAndArrayType() {\n\t\t\tstring program = @\"using System;\npublic class C {\n\tstatic void F(Array a, Func<object, object> f) {}\n\tstatic void F(string[] a, Func<string, object> f) {}\n\n\tpublic static void M() {\n\t\t$F(new string[0], n => 0)$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.IsError, Is.False);\n\t\t\tAssert.That(rr.Member.Parameters[0].Type.Kind == TypeKind.Array);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OverloadResolutionBetweenArrayAndArrayTypeGeneric() {\n\t\t\tstring program = @\"using System;\npublic class C {\n\tstatic void F(Array a, Func<object, object> f) {}\n\tstatic void F<T>(T[] a, Func<T, object> f) {}\n\n\tpublic static void M() {\n\t\t$F(new string[0], n => 0)$;\n\t}\n}\";\n\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.That(rr.IsError, Is.False);\n\t\t\tAssert.That(rr.Member, Is.InstanceOf<SpecializedMember>());\n\t\t\tAssert.That(rr.Member.Parameters[0].Type.Kind == TypeKind.Array);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PrivateExtensionMethodIsNotUsableFromOtherClass()\n\t\t{\n\t\t\tstring program = @\"\nusing System.Collections.Generic;\nnamespace Foo {\n\tpublic static class FooExtensions {\n\t\tstatic T Extension<T>(this object value) { return default(T); }\n\t}\n}\nnamespace Bar {\n\tpublic static class BarExtensions {\n\t\tpublic static IEnumerable<T> Extension<T>(this object value) { return new T[0]; }\n\t}\n}\n\nnamespace Bazz {\n\tusing Foo;\n\tusing Bar;\n\tpublic class Client {\n\t\tpublic void Method() {\n\t\t\tvar x = $new object().Extension<int>()$;\n\t\t}\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(rr.Type.FullName, \"System.Collections.Generic.IEnumerable\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PrivateExtensionMethodIsUsableFromSameClass()\n\t\t{\n\t\t\tstring program = @\"\nusing System.Collections.Generic;\nnamespace Foo {\n\tpublic static class FooExtensions {\n\t\tstatic T Extension<T>(this object value) { return default(T); }\n\t\t\n\t\tstatic void Method() {\n\t\t\tvar x = $new object().Extension<int>()$;\n\t\t}\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(rr.Type.FullName, \"System.Int32\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/LambdaTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class LambdaTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void SimpleLambdaTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tTest(i => Console.WriteLine(i));\n\t}\n\tpublic void Test(Action<int> ac) { ac(42); }\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program.Replace(\"(i)\", \"($i$)\"));\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t\t\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"i =>\", \"$i$ =>\"));\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInConstructorTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tTestClass t = new TestClass(i => Console.WriteLine($i$));\n\t}\n\tpublic TestClass(Action<int> ac) { ac(42); }\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInGenericConstructorTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tvar t = new SomeClass<string>(i => Console.WriteLine($i$));\n\t}\n}\nclass SomeClass<T> {\n\tpublic SomeClass(Action<T> ac) { }\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t#region Lambda In Array Initializer\n\t\t[Test]\n\t\tpublic void LambdaInArrayInitializer1()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tConverter<int, string>[] arr = {\n\t\t\ti => $i$.ToString()\n\t\t};\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInArrayInitializer2()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\ta = new Converter<int, string>[] {\n\t\t\ti => $i$.ToString()\n\t\t};\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInArrayInitializer3()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tConverter<int, string>[] field = new Converter<int, string>[] {\n\t\ti => $i$.ToString()\n\t};\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInArrayInitializer4()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tConverter<int, string>[] field = {\n\t\ti => $i$.ToString()\n\t};\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaIn2DArrayInitializer()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tConverter<int, string>[,] arr = {\n\t\t\t{ i => $i$.ToString() }\n\t\t};\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInInferred2DArrayInitializer()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tvar c = new [,] { { null, (Converter<int, string>)null }, { a => $a$.ToString(), b => b.ToString() }};\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Lambda In Collection Initializer\n\t\t[Test]\n\t\tpublic void LambdaInCollectionInitializer1()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Collections.Generic;\nclass TestClass {\n\tstatic void Main() {\n\t\ta = new List<Converter<int, string>> {\n\t\t\ti => $i$.ToString()\n\t\t};\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInCollectionInitializer2()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Collections.Generic;\nclass TestClass {\n\tstatic void Main() {\n\t\ta = new Dictionary<Func<char, string>, Converter<int, string>> {\n\t\t\t{ i => $i$.ToString(), i => i.ToString() }\n\t\t};\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Char\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInCollectionInitializer3()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Collections.Generic;\nclass TestClass {\n\tstatic void Main() {\n\t\ta = new Dictionary<Func<char, string>, Converter<int, string>> {\n\t\t\t{ i => i.ToString(), $i$ => i.ToString() }\n\t\t};\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInObjectInitializerTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass X {\n\tvoid SomeMethod() {\n\t\tHelper h = new Helper {\n\t\t\tF = i => $i$.ToString()\n\t\t};\n\t}\n}\nclass Helper {\n\tpublic Converter<int, string> F;\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionInCastExpression()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic void Main(string[] args) {\n\t\tvar f = (Func<int, string>) ( i => $i$ );\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionInDelegateCreateExpression()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic void Main(string[] args) {\n\t\tvar f = new Func<int, string>( i => $i$ );\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionInReturnStatement()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic Converter<int, string> GetToString() {\n\t\treturn i => $i$.ToString();\n\t}\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionInReturnStatementInStatementLambda()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic void SomeMethod() {\n\t\tFunc<Func<string, string>> getStringTransformer = () => {\n\t\t\treturn s => $s$.ToUpper();\n\t\t};\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n\tpublic delegate R Func<R>();\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionInReturnStatementInAnonymousMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic void SomeMethod() {\n\t\tFunc<Func<string, string>> getStringTransformer = delegate {\n\t\t\treturn s => $s$.ToUpper();\n\t\t};\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n\tpublic delegate R Func<R>();\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CurriedLambdaExpressionInCastExpression()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic void Main(string[] args) {\n\t\tvar f = (Func<char, Func<string, int>>) ( a => b => 0 );\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program.Replace(\"a =>\", \"$a$ =>\"));\n\t\t\tAssert.AreEqual(\"System.Char\", lrr.Type.ReflectionName);\n\t\t\t\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"b =>\", \"$b$ =>\"));\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionInVariableInitializer()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic void Main() {\n\t\tFunc<int, string> f = $i$ => i.ToString();\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaExpressionInVariableAssignment()\n\t\t{\n\t\t\tstring program = @\"using System;\nstatic class TestClass {\n\tstatic void Main() {\n\t\tFunc<int, string> f;\n \t\tf = $i$ => i.ToString();\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInDelegateCall()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tFunc<Func<int, string>, char> f;\n\t\tf($i$ => i.ToString());\n\t}\n\tpublic delegate R Func<T, R>(T arg);\n}\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConvertAllInGenericMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Method<T>(System.Collections.Generic.List<T> list) {\n\t\t$list.ConvertAll(x => (int)(object)x)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tvar m = (IMethod)rr.Member;\n\t\t\tAssert.AreEqual(\"System.Int32\", m.TypeArguments[0].ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Converter`2[[``0],[System.Int32]]\", m.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tvar crr = (ConversionResolveResult)rr.Arguments[0];\n\t\t\tAssert.IsTrue(crr.Conversion.IsAnonymousFunctionConversion);\n\t\t\tAssert.AreEqual(\"System.Converter`2[[``0],[System.Int32]]\", crr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AnonymousMethodWithoutParameterList()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tevent EventHandler Ev = $delegate {}$;\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsFalse(rr.HasParameterList);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonVoidMethodInActionLambdaIsValidConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid Run(Action a) { }\n\tint M() {\n\t\tRun(() => $M()$);\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonVoidMethodInImplicitlyTypedActionLambdaIsValidConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid Run(Action<string> a) { }\n\tint M() {\n\t\tRun(x => $M()$);\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitLambdaInNewFunc()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tstatic bool b;\n\tobject x = new Func<int, string>(a => $a$.ToString());\n}\";\n\t\t\tvar r = Resolve(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", r.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaInNewAction()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tstatic bool b;\n\tobject x = new Action(() => $b = true$);\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AnonymousMethodInNewEventHandler()\n\t\t{\n\t\t\t// The switch statement causes the control flow analysis to ask the resolver if it's a constant,\n\t\t\t// which caused a bug.\n\t\t\tstring program = @\"using System;\nclass Test {\n\tstatic bool b;\n\tobject x = new EventHandler<AssemblyLoadEventArgs>($delegate (object sender, AssemblyLoadEventArgs e) { switch (e.Action) {} }$);\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ThrowingAnonymousMethodIsConvertibleToFunc()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tFunc<string, int> x = $delegate { throw new NotImplementedException(); }$;\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EmptyAnonymousMethodIsNotConvertibleToFunc()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tFunc<string, int> x = $delegate { }$;\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void RaisePropertyChanged_WithExpressionLambda()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Linq.Expressions;\nclass Test {\n\tvoid RaisePropertyChanged<T>(Expression<Func<T>> propertyExpression) {}\n\tvoid RaisePropertyChanged(string propertyName) {}\n\tstring MyProperty { get {} }\n\tvoid Test() {\n\t\t$RaisePropertyChanged(() => MyProperty)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"propertyExpression\", rr.Member.Parameters.Single().Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParenthesizedExpressionIsNotValidExpressionStatement()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A {\n    static void Foo(string x, Action<Action> y) { Console.WriteLine(1); }\n    static void Foo(object x, Func<Func<int>, int> y) { Console.WriteLine(2); }\n\n    static void Main()\n    { \";\n\t\t\tvar rr = ResolveAtLocation<CSharpInvocationResolveResult>(program + \"$Foo(null, x => x()); // Prints 1\\n}}\");\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Member.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\trr = ResolveAtLocation<CSharpInvocationResolveResult>(program + \"$Foo(null, x => (x())); // Prints 2\\n}}\");\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.Object\", rr.Member.Parameters[0].Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaWithComparisonToString()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n    static void Foo(Func<int, bool> f) {}\n    static void Foo(Func<string, bool> f) {}\n    static void Main() { $Foo(x => x == \"\"text\"\")$; } }\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tvar invoke = rr.Member.Parameters.Single().Type.GetDelegateInvokeMethod();\n\t\t\tAssert.AreEqual(\"System.String\", invoke.Parameters.Single().Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaWithComparisonToInt()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n    static void Foo(Func<int, bool> f) {}\n    static void Foo(Func<string, bool> f) {}\n    static void Main() { $Foo(x => x == 42)$; } }\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tvar invoke = rr.Member.Parameters.Single().Type.GetDelegateInvokeMethod();\n\t\t\tAssert.AreEqual(\"System.Int32\", invoke.Parameters.Single().Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StartNewTask()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tint Calculate() {}\n    static void Main() {\n    \t$System.Threading.Tasks.Task.Factory.StartNew(() => Calculate())$;\n\t}}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.Threading.Tasks.Task`1[[System.Int32]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LambdaParameterIdentity()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\tvoid F() {\n\t\tFunc<int, int> f = $i => i + 1$;\n\t}\n}\";\n\t\t\t\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tvar lambda = (LambdaExpression)prep.Item2;\n\t\t\tvar identifierInLambdaBody = ((BinaryOperatorExpression)lambda.Body).Left;\n\t\t\tvar resolver = prep.Item1;\n\t\t\t\n\t\t\tvar resolvedParameter = ((LocalResolveResult)resolver.Resolve(lambda.Parameters.Single())).Variable;\n\t\t\tvar parameterInResolveResult = ((LambdaResolveResult)resolver.Resolve(lambda)).Parameters[0];\n\t\t\tvar referencedParameter = ((LocalResolveResult)resolver.Resolve(identifierInLambdaBody)).Variable;\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.Int32\" ,resolvedParameter.Type.ReflectionName);\n\t\t\tAssert.AreSame(resolvedParameter, parameterInResolveResult);\n\t\t\tAssert.AreSame(resolvedParameter, referencedParameter);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleOverloadsWithImplicitLambda()\n\t\t{\n\t\t\tstring program = @\"class MainClass {\n\tvoid Main() {\n\t\t$M(x=>x.ToUpper())$;\n\t}\n\tdelegate R Func<T, R>(T arg);\n\tint M(Func<int, int> f){ }\n\tstring M(Func<string, string> f){ }\n}\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t\tAssert.AreEqual(\"System.String\", mrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleOverloadsWithImplicitLambda2()\n\t\t{\n\t\t\tstring program = @\"class MainClass {\n\tvoid Main() {\n\t\t$M(x=>x.Length)$;\n\t}\n\tdelegate R Func<T, R>(T arg);\n\tint M(Func<int, int> f){ }\n\tstring M(Func<string, int> f){ }\n}\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t\tAssert.AreEqual(\"System.String\", mrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleOverloadsWithImplicitLambda3()\n\t\t{\n\t\t\tstring program = @\"class MainClass {\n\tvoid Main() {\n\t\t$M(x=>x+x)$;\n\t}\n\tdelegate R Func<T, R>(T arg);\n\tstring M(Func<string, int> f){ }\n\tint M(Func<int, int> f){ }\n}\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t\tAssert.AreEqual(\"System.Int32\", mrr.Type.ReflectionName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AsyncLambdaWithAwait()\n\t\t{\n\t\t\tstring program = @\"\nusing System;\nusing System.Threading.Tasks;\n\nclass A\n{\n\tpublic Task OpenAsync ()\n\t{\n\t\treturn null;\n\t}\n}\n\nclass C\n{\n\tasync void Foo ()\n\t{\n\t\t\tawait $Test (async () => { await new A().OpenAsync (); })$;\n\t}\n\t\n\tT Test<T> (Func<T> func)\n\t{\n\t\treturn default (T);\n\t}\n}\n\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t\tAssert.AreEqual(\"System.Threading.Tasks.Task\", mrr.Type.ReflectionName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConversionInExplicitlyTypedLambdaBody() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic object M() {\n\t\tSystem.Func<int, string> f = $(int i) => null$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConversionResolveResult>(rr.Body);\n\t\t\tAssert.That(((ConversionResolveResult)rr.Body).Conversion.IsNullLiteralConversion);\n\t\t\tAssert.AreEqual(\"System.String\", rr.ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Body.Type.ReflectionName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConversionInImplicitlyTypedLambdaBody() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic object M() {\n\t\tSystem.Func<int, string> f = $i => null$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConversionResolveResult>(rr.Body);\n\t\t\tAssert.That(((ConversionResolveResult)rr.Body).Conversion.IsNullLiteralConversion);\n\t\t\tAssert.AreEqual(\"System.String\", rr.ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Body.Type.ReflectionName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoConversionInVoidExplicitlyTypedLambdaBody() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic object M() {\n\t\tSystem.Action<int> f = $(int i) => i++$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<OperatorResolveResult>(rr.Body);\n\t\t\tAssert.AreEqual(\"System.Void\", rr.ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Body.Type.ReflectionName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoConversionInVoidImplicitlyTypedLambdaBody() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic object M() {\n\t\tSystem.Action<int> f = $i => i++$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<OperatorResolveResult>(rr.Body);\n\t\t\tAssert.AreEqual(\"System.Void\", rr.ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Body.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NumericConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M() {\n\t\tFunc<int, double> f = $i => i + 1$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConversionResolveResult>(rr.Body);\n\t\t\tvar bodyConv = ((ConversionResolveResult)rr.Body).Conversion;\n\t\t\tAssert.IsTrue(bodyConv.IsValid);\n\t\t\tAssert.IsTrue(bodyConv.IsNumericConversion);\n\t\t\t\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsAnonymousFunctionConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidNumericConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M() {\n\t\tFunc<double, int> f = $i => i + 1$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConversionResolveResult>(rr.Body);\n\t\t\tvar bodyConv = ((ConversionResolveResult)rr.Body).Conversion;\n\t\t\tAssert.IsFalse(bodyConv.IsValid);\n\t\t\t\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsFalse(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsAnonymousFunctionConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitAsyncLambda()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Threading.Tasks;\nclass Test {\n\tpublic void M() {\n\t\tFunc<int, Task<int>> f = $async i => i + 1$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<OperatorResolveResult>(rr.Body);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Body.Type.FullName);\n\t\t\t\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsAnonymousFunctionConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitAsyncLambdaWithNumericConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Threading.Tasks;\nclass Test {\n\tpublic void M() {\n\t\tFunc<int, Task<double>> f = $async i => i + 1$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConversionResolveResult>(rr.Body);\n\t\t\tAssert.AreEqual(\"System.Double\", rr.Body.Type.FullName);\n\t\t\t\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsAnonymousFunctionConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitAsyncLambda()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Threading.Tasks;\nclass Test {\n\tpublic void M() {\n\t\tFunc<int, Task<int>> f = $async (int i) => i + 1$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<OperatorResolveResult>(rr.Body);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Body.Type.FullName);\n\t\t\t\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsAnonymousFunctionConversion);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitAsyncLambdaWithNumericConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Threading.Tasks;\nclass Test {\n\tpublic void M() {\n\t\tFunc<int, Task<double>> f = $async (int i) => i + 1$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<LambdaResolveResult>(program);\n\t\t\tAssert.IsInstanceOf<ConversionResolveResult>(rr.Body);\n\t\t\tAssert.AreEqual(\"System.Double\", rr.Body.Type.FullName);\n\t\t\t\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t\tAssert.IsTrue(c.IsAnonymousFunctionConversion);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AnonymousMethodConversionObjectToDynamic() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M() {\n\t\tAction<dynamic> x = $delegate(object z) { z = null; }$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AnonymousMethodConversionObjectToDynamicGenericArgument() {\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass Test {\n\tpublic void M() {\n\t\tAction<List<dynamic>> x = $delegate(List<object> z) { z = null; }$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AnonymousMethodConversionDynamicToObject() {\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic void M() {\n\t\tAction<object> x = $delegate(dynamic z) { z = null; }$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AnonymousMethodConversionDynamicToObjectGenericArgument() {\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass Test {\n\tpublic void M() {\n\t\tAction<List<object>> x = $delegate(List<dynamic> z) { z = null; }$;\n\t}\n}\";\n\t\t\tvar c = GetConversion(program);\n\t\t\tAssert.IsTrue(c.IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidConversionToVoid_ImplicitStatementLambda()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tAction a = () => {\n\t\t\treturn $1$;\n\t\t};\n\t}\n}\";\n\t\t\tAssert.AreEqual(TypeKind.Void, GetExpectedType(program).Kind);\n\t\t\tAssert.IsFalse(GetConversion(program).IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidConversionToVoid_AnonymousMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tAction a = delegate {\n\t\t\treturn $1$;\n\t\t};\n\t}\n}\";\n\t\t\tAssert.AreEqual(TypeKind.Void, GetExpectedType(program).Kind);\n\t\t\tAssert.IsFalse(GetConversion(program).IsValid);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidLamda_Uses_Identity_Conversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic int GetInt() { return 4; }\n\tstatic void Main() {\n\t\tAction a = () => $GetInt()$;\n\t}\n}\";\n\t\t\tAssert.AreEqual(\"System.Int32\", GetExpectedType(program).FullName);\n\t\t\tAssert.IsTrue(GetConversion(program).IsValid);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/LinqTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class LinqTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void SimpleLinq()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\tvar r = from e in input\n\t\t\twhere e.StartsWith(\"\"/\"\")\n\t\t\tselect e.Trim();\n\t\tr.ToString();\n\t}\n}\n\";\n\t\t\tLocalResolveResult lrr = Resolve<LocalResolveResult>(program.Replace(\"where e\", \"where $e$\"));\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"select e\", \"select $e$\"));\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"from e\", \"from $e$\"));\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t\t\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"r.ToString\", \"$r$.ToString\"));\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable\", lrr.Type.FullName);\n\t\t\tAssert.AreEqual(\"System.String\", ((ParameterizedType)lrr.Type).TypeArguments[0].FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Group()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\tvar r = from e in input\n\t\t\tgroup e.ToUpper() by e.Length;\n\t\t$r$.ToString();\n\t}\n}\n\";\n\t\t\tLocalResolveResult lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable\", lrr.Type.FullName);\n\t\t\tParameterizedType rt = (ParameterizedType)((ParameterizedType)lrr.Type).TypeArguments[0];\n\t\t\tAssert.AreEqual(\"System.Linq.IGrouping\", rt.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", rt.TypeArguments[0].FullName);\n\t\t\tAssert.AreEqual(\"System.String\", rt.TypeArguments[1].FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void QueryableGroup()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(IQueryable<string> input) {\n\t\tvar r = from e in input\n\t\t\tgroup e.ToUpper() by e.Length;\n\t\t$r$.ToString();\n\t}\n}\n\";\n\t\t\tLocalResolveResult lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Linq.IQueryable\", lrr.Type.FullName);\n\t\t\tParameterizedType rt = (ParameterizedType)((ParameterizedType)lrr.Type).TypeArguments[0];\n\t\t\tAssert.AreEqual(\"System.Linq.IGrouping\", rt.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", rt.TypeArguments[0].FullName);\n\t\t\tAssert.AreEqual(\"System.String\", rt.TypeArguments[1].FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Parenthesized()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$(from e in input select e.Length)$.ToArray();\n\t}\n}\n\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Conversion.IsIdentityConversion);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable\", rr.Type.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", ((ParameterizedType)rr.Type).TypeArguments[0].FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SelectReturnType()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass { static void M() {\n\t(from a in new XYZ() $select a.ToUpper()$).ToString();\n}}\nclass XYZ {\n\tpublic int Select<U>(Func<string, U> f) { return 42; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"XYZ.Select\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Continuation()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\tvar r = from x in input\n\t\t\tselect x.GetHashCode() into x\n\t\t\twhere x == 42\n\t\t\tselect x * x;\n\t\tr.ToString();\n\t}\n}\n\";\n\t\t\tLocalResolveResult lrr = Resolve<LocalResolveResult>(program.Replace(\"from x\", \"from $x$\"));\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"select x.G\", \"select $x$.G\"));\n\t\t\tAssert.AreEqual(\"System.String\", lrr.Type.ReflectionName);\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"into x\", \"into $x$\"));\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"where x\", \"where $x$\"));\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"select x * x\", \"select x * $x$\"));\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.ReflectionName);\n\t\t\t\n\t\t\tlrr = Resolve<LocalResolveResult>(program.Replace(\"r.ToString\", \"$r$.ToString\"));\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.Int32]]\", lrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OrderingWithSelectCall()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$var$ r = from x in input\n\t\t\torderby x.Length\n\t\t\tselect x + x;\n\t}\n}\n\";\n\t\t\tTypeResolveResult rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.String]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OrderingWithoutSelectCall()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$var$ r = from x in input\n\t\t\torderby x.Length\n\t\t\tselect x;\n\t}\n}\n\";\n\t\t\tTypeResolveResult rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Linq.IOrderedEnumerable`1[[System.String]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OrderingWithSelectCallDueToSecondRangeVariable1()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$var$ r = from x in input\n\t\t\tfrom y in input\n\t\t\torderby x.Length\n\t\t\tselect x;\n\t}\n}\n\";\n\t\t\tTypeResolveResult rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.String]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OrderingWithSelectCallDueToSecondRangeVariable2()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$var$ r = from x in input\n\t\t\tjoin y in input on x equals y\n\t\t\torderby x.Length\n\t\t\tselect x;\n\t}\n}\n\";\n\t\t\tTypeResolveResult rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.String]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OrderingWithSelectCallDueToSecondRangeVariable3()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$var$ r = from x in input\n\t\t\tjoin y in input on x equals y into g\n\t\t\torderby x.Length\n\t\t\tselect x;\n\t}\n}\n\";\n\t\t\tTypeResolveResult rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.String]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OrderingWithSelectCallDueToSecondRangeVariable4()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$var$ r = from x in input\n\t\t\tlet y = x\n\t\t\torderby x.Length\n\t\t\tselect x;\n\t}\n}\n\";\n\t\t\tTypeResolveResult rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.String]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DegenerateQuery()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tvoid Test(string[] input) {\n\t\t$var$ r = from x in input select x;\n\t}\n}\n\";\n\t\t\tTypeResolveResult rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IEnumerable`1[[System.String]]\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GroupJoinWithCustomMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass { static void M(long [] args) {\n\tvar q = (from a in new XYZ() join b in args on a equals b into g select g);\n}}\nclass XYZ {\n\tpublic XYZ GroupJoin<T, R>(IEnumerable<T> f, Func<string, object> key1, Func<T, object> key2, Func<string, decimal, R> s) { return this; }\n\tpublic int Select<U>(Func<string, U> f) { return 42; }\n}\";\n\t\t\tvar local = Resolve<LocalResolveResult>(program.Replace(\"into g\", \"into $g$\"));\n\t\t\tAssert.AreEqual(\"System.Decimal\", local.Type.FullName);\n\t\t\t\n\t\t\tlocal = Resolve<LocalResolveResult>(program.Replace(\"select g\", \"select $g$\"));\n\t\t\tAssert.AreEqual(\"System.Decimal\", local.Type.FullName);\n\t\t\t\n\t\t\tvar trr = Resolve<TypeResolveResult>(program.Replace(\"var\", \"$var$\"));\n\t\t\tAssert.AreEqual(\"XYZ\", trr.Type.FullName); // because 'Select' is done as part of GroupJoin()\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GroupJoinWithOverloadedCustomMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass\n{\n\tstatic void M(string[] args)\n\t{\n\t\tvar q = (from a in new XYZ() $join b in args on a equals b into g$ select g.ToUpper());\n\t}\n}\nclass XYZ\n{\n\tpublic int GroupJoin(IEnumerable<string> f, Func<string, object> key1, Func<string, object> key2, Func<string, int, int> s) { return 0; }\n\tpublic decimal GroupJoin(IEnumerable<string> f, Func<string, object> key1, Func<string, object> key2, Func<string, string, string> s) { return 0; }\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"GroupJoin\", rr.Member.Name);\n\t\t\tAssert.AreEqual(\"System.Decimal\", rr.Type.FullName);\n\t\t\t\n\t\t\trr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"g.ToUpper()\", \"g.CompareTo(42)\"));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"GroupJoin\", rr.Member.Name);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GroupWithQueryContinuation()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass\n{\n\tstatic void M(string[] args)\n\t{\n\t\tvar query =\n\t\tfrom w in \"\"one to three\"\".Split()\n\t\t\tgroup w by w.Length into g\n\t\t\torderby g.Key descending\n\t\t\tselect new { g.Key, Count = g.Count(), Avg = g.Average ($w$ => w.Length) };\n\t}\n}\";\n\t\t\tvar rr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SelectManyInvocation()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass\n{\n\tstatic void M(string[] args)\n\t{\n\t\tvar query = from w in args $from c in w$ select c - '0';\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tvar member = (IMethod)rr.Member;\n\t\t\tAssert.AreEqual(\"SelectMany\", member.Name);\n\t\t\tAssert.AreEqual(3, member.Parameters.Count);\n\t\t\tvar typeArguments = member.TypeArguments;\n\t\t\tAssert.AreEqual(3, typeArguments.Count);\n\t\t\tAssert.AreEqual(\"System.String\", typeArguments[0].ReflectionName, \"TSource\");\n\t\t\tAssert.AreEqual(\"System.Char\", typeArguments[1].ReflectionName, \"TCollection\");\n\t\t\tAssert.AreEqual(\"System.Int32\", typeArguments[2].ReflectionName, \"TResult\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SelectManyInvocationWithTransparentIdentifier()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass\n{\n\tstatic void M(string[] args)\n\t{\n\t\tvar query = from w in args $from c in w$ orderby c select c - '0';\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tvar member = (IMethod)rr.Member;\n\t\t\tAssert.AreEqual(\"SelectMany\", member.Name);\n\t\t\tAssert.AreEqual(3, member.Parameters.Count);\n\t\t\tvar typeArguments = member.TypeArguments;\n\t\t\tAssert.AreEqual(3, typeArguments.Count);\n\t\t\tAssert.AreEqual(\"System.String\", typeArguments[0].ReflectionName, \"TSource\");\n\t\t\tAssert.AreEqual(\"System.Char\", typeArguments[1].ReflectionName, \"TCollection\");\n\t\t\tAssert.AreEqual(TypeKind.Anonymous, typeArguments[2].Kind, \"TResult\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FromClauseDoesNotResolveToSourceVariable()\n\t\t{\n\t\t\tstring program = @\"using System; using System.Linq;\nclass TestClass {\n\tstatic void M(string[] args) {\n\t\tvar query = $from w in args$ select int.Parse(w);\n\t}}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String[]\", rr.Type.ReflectionName);\n\t\t\tAssert.AreEqual(Conversion.IdentityConversion, rr.Conversion);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/LocalTypeInferenceTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class LocalTypeInferenceTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void TypeInferenceTest()\n\t\t{\n\t\t\tstring program = @\"class TestClass {\n\tstatic void Test() {\n\t\tvar a = 3;\n\t\t$a$.ToString();\n\t}\n}\n\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeInferenceCycleTest()\n\t\t{\n\t\t\tstring program = @\"class TestClass {\n\tstatic void Test() {\n\t\tvar a = a;\n\t\t$a$.ToString();\n\t}\n}\n\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreSame(SpecialType.UnknownType, lrr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidAnonymousTypeDeclaration()\n\t\t{\n\t\t\t// see SD-1393\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main() {\n\t\tvar contact = {id = 54321};\n\t\t$contact$.ToString();\n\t} }\";\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(SpecialType.UnknownType, lrr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromArrayType()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Method(int[] arr) {\n\t\tforeach ($var$ x in arr) {}\n\t} }\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromDynamic()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Method(dynamic c) {\n\t\tforeach ($var$ x in c) {}\n\t} }\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(TypeKind.Dynamic, rr.Type.Kind);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromListOfInt()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass {\n\tstatic void Method(List<int> c) {\n\t\tforeach ($var$ x in c) {}\n\t} }\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromICollectionOfInt()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass {\n\tstatic void Method(ICollection<int> c) {\n\t\tforeach ($var$ x in c) {}\n\t} }\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromCustomCollection_WithoutIEnumerable()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass {\n\tstatic void Method(CustomCollection c) {\n\t\tforeach ($var$ x in c) {}\n\t}\n}\nclass CustomCollection {\n\tpublic MyEnumerator GetEnumerator() {}\n\tpublic struct MyEnumerator {\n\t\tpublic string Current { get { return null; } }\n\t\tpublic bool MoveNext() { return false; }\n\t}\n}\n\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromCustomCollection_WithIEnumerableAndPublicGetEnumerator()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass {\n\tstatic void Method(CustomCollection c) {\n\t\tforeach ($var$ x in c) {}\n\t}\n}\nclass CustomCollection : IEnumerable<int> {\n\tpublic MyEnumerator GetEnumerator() {}\n\tpublic struct MyEnumerator {\n\t\tpublic string Current { get { return null; } }\n\t\tpublic bool MoveNext() { return false; }\n\t}\n}\n\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromCustomCollection_WithIEnumerableAndInternalGetEnumerator()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass {\n\tstatic void Method(CustomCollection c) {\n\t\tforeach ($var$ x in c) {}\n\t}\n}\nclass CustomCollection : IEnumerable<int> {\n\tinternal MyEnumerator GetEnumerator() {}\n\tpublic struct MyEnumerator {\n\t\tpublic string Current { get { return null; } }\n\t\tpublic bool MoveNext() { return false; }\n\t}\n}\n\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Foreach_InferFromCustomCollection_WithIEnumerableAndGetEnumeratorExtensionMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nclass TestClass {\n\tstatic void Method(CustomCollection c) {\n\t\tforeach ($var$ x in c) {}\n\t}\n}\nclass CustomCollection : IEnumerable<int> {\n\tpublic struct MyEnumerator {\n\t\tpublic string Current { get { return null; } }\n\t\tpublic bool MoveNext() { return false; }\n\t}\n}\nstatic class ExtMethods {\n\tpublic static CustomCollection.MyEnumerator GetEnumerator(this CustomCollection c) {\n\t\tthrow new NotImplementedException();\n\t}\n}\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.ReflectionName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/MemberLookupTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class MemberLookupTests : ResolverTestBase\n\t{\n\t\tMemberLookup lookup;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tlookup = new MemberLookup(null, compilation.MainAssembly);\n\t\t}\n\t\t\n\t\tCSharpUnresolvedFile Parse(string program)\n\t\t{\n\t\t\tSyntaxTree syntaxTree = SyntaxTree.Parse(program, \"test.cs\");\n\t\t\tCSharpUnresolvedFile unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tproject = project.AddOrUpdateFiles(unresolvedFile);\n\t\t\tcompilation = project.CreateCompilation();\n\t\t\tlookup = new MemberLookup(null, compilation.MainAssembly);\n\t\t\treturn unresolvedFile;\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GroupMethodsByDeclaringType()\n\t\t{\n\t\t\tstring program = @\"\nclass Base {\n\tpublic virtual void Method() {}\n}\nclass Middle : Base {\n\tpublic void Method(int p) {}\n}\nclass Derived : Middle {\n\tpublic override void Method() {}\n}\";\n\t\t\tParse(program);\n\t\t\tITypeDefinition derived = compilation.MainAssembly.GetTypeDefinition(new TopLevelTypeName(\"Derived\"));\n\t\t\tvar rr = lookup.Lookup(new ResolveResult(derived), \"Method\", EmptyList<IType>.Instance, true) as MethodGroupResolveResult;\n\t\t\tAssert.AreEqual(2, rr.MethodsGroupedByDeclaringType.Count());\n\t\t\t\n\t\t\tvar baseGroup = rr.MethodsGroupedByDeclaringType.ElementAt(0);\n\t\t\tAssert.AreEqual(\"Base\", baseGroup.DeclaringType.ReflectionName);\n\t\t\tAssert.AreEqual(1, baseGroup.Count);\n\t\t\tAssert.AreEqual(\"Derived.Method\", baseGroup[0].FullName);\n\t\t\t\n\t\t\tvar middleGroup = rr.MethodsGroupedByDeclaringType.ElementAt(1);\n\t\t\tAssert.AreEqual(\"Middle\", middleGroup.DeclaringType.ReflectionName);\n\t\t\tAssert.AreEqual(1, middleGroup.Count);\n\t\t\tAssert.AreEqual(\"Middle.Method\", middleGroup[0].FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodInGenericClassOverriddenByConcreteMethod()\n\t\t{\n\t\t\tstring program = @\"\nclass Base<T> {\n\tpublic virtual void Method(T a) {}\n}\nclass Derived : Base<int> {\n\tpublic override void Method(int a) {}\n\tpublic override void Method(string a) {}\n}\";\n\t\t\tParse(program);\n\t\t\tITypeDefinition derived = compilation.MainAssembly.GetTypeDefinition(new TopLevelTypeName(\"Derived\"));\n\t\t\tvar rr = lookup.Lookup(new ResolveResult(derived), \"Method\", EmptyList<IType>.Instance, true) as MethodGroupResolveResult;\n\t\t\tAssert.AreEqual(2, rr.MethodsGroupedByDeclaringType.Count());\n\t\t\t\n\t\t\tvar baseGroup = rr.MethodsGroupedByDeclaringType.ElementAt(0);\n\t\t\tAssert.AreEqual(\"Base`1[[System.Int32]]\", baseGroup.DeclaringType.ReflectionName);\n\t\t\tAssert.AreEqual(1, baseGroup.Count);\n\t\t\tAssert.AreEqual(\"Derived.Method\", baseGroup[0].FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", baseGroup[0].Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tvar derivedGroup = rr.MethodsGroupedByDeclaringType.ElementAt(1);\n\t\t\tAssert.AreEqual(\"Derived\", derivedGroup.DeclaringType.ReflectionName);\n\t\t\tAssert.AreEqual(1, derivedGroup.Count);\n\t\t\tAssert.AreEqual(\"Derived.Method\", derivedGroup[0].FullName);\n\t\t\tAssert.AreEqual(\"System.String\", derivedGroup[0].Parameters[0].Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethod()\n\t\t{\n\t\t\tstring program = @\"\nclass Base {\n\tpublic virtual void Method<T>(T a) {}\n}\nclass Derived : Base {\n\tpublic override void Method<S>(S a) {}\n}\";\n\t\t\tParse(program);\n\t\t\tITypeDefinition derived = compilation.MainAssembly.GetTypeDefinition(new TopLevelTypeName(\"Derived\"));\n\t\t\tvar rr = lookup.Lookup(new ResolveResult(derived), \"Method\", EmptyList<IType>.Instance, true) as MethodGroupResolveResult;\n\t\t\tAssert.AreEqual(1, rr.MethodsGroupedByDeclaringType.Count());\n\t\t\t\n\t\t\tvar baseGroup = rr.MethodsGroupedByDeclaringType.ElementAt(0);\n\t\t\tAssert.AreEqual(\"Base\", baseGroup.DeclaringType.ReflectionName);\n\t\t\tAssert.AreEqual(1, baseGroup.Count);\n\t\t\tAssert.AreEqual(\"Derived.Method\", baseGroup[0].FullName);\n\t\t\tAssert.AreEqual(\"``0\", baseGroup[0].Parameters[0].Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InstanceFieldImplicitThis()\n\t\t{\n\t\t\tstring program = @\"class Test {\n\tpublic int Field;\n\tint M() { return $Field$; }\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Field\", rr.Member.FullName);\n\t\t\tAssert.IsTrue(rr.TargetResult is ThisResolveResult);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InstanceFieldExplicitThis()\n\t\t{\n\t\t\tstring program = @\"class Test {\n\tpublic int Field;\n\tint M() { return $this.Field$; }\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Field\", rr.Member.FullName);\n\t\t\tAssert.IsTrue(rr.TargetResult is ThisResolveResult);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticField()\n\t\t{\n\t\t\tstring program = @\"class Test {\n\tpublic static int Field;\n\tint M() { return $Field$; }\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Field\", rr.Member.FullName);\n\t\t\tAssert.IsTrue(rr.TargetResult is TypeResolveResult);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InstanceMethodImplicitThis()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tvoid F() {}\n\tpublic void M() {\n\t\t$F()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.F\", rr.Member.FullName);\n\t\t\tAssert.IsInstanceOf<ThisResolveResult>(rr.TargetResult);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InstanceMethodExplicitThis()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tvoid F() {}\n\tpublic void M() {\n\t\t$this.F()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.F\", rr.Member.FullName);\n\t\t\tAssert.IsInstanceOf<ThisResolveResult>(rr.TargetResult);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tstatic void F() {}\n\tpublic void M() {\n\t\t$F()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.F\", rr.Member.FullName);\n\t\t\tAssert.IsInstanceOf<TypeResolveResult>(rr.TargetResult);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOuterTemplateParameter()\n\t\t{\n\t\t\tstring program = @\"public class A<T>\n{\n\tpublic class B\n\t{\n\t\tpublic T field;\n\t}\n}\n\npublic class Foo\n{\n\tpublic void Bar ()\n\t{\n\t\tA<int>.B baz = new A<int>.B ();\n\t\t$baz.field$.ToString ();\n\t}\n}\";\n\t\t\tvar lrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOuterTemplateParameterInDerivedClass()\n\t\t{\n\t\t\tstring program = @\"public class A<T>\n{\n\tpublic class B\n\t{\n\t\tpublic T field;\n\t}\n}\n\npublic class Foo : A<int>.B\n{\n\tpublic void Bar ()\n\t{\n\t\t$field$.ToString ();\n\t}\n}\";\n\t\t\tvar lrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestOuterTemplateParameterInDerivedClass2()\n\t\t{\n\t\t\tstring program = @\"public class A<T>\n{\n\tpublic class B\n\t{\n\t\tpublic T field;\n\t}\n}\n\npublic class Foo : A<int>\n{\n\tpublic void Bar (B v)\n\t{\n\t\t$v.field$.ToString ();\n\t}\n}\";\n\t\t\tvar lrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", lrr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MemberInGenericClassReferringToInnerClass()\n\t\t{\n\t\t\tstring program = @\"public class Foo<T> {\n\tpublic class TestFoo { }\n\tpublic TestFoo Bar = new TestFoo ();\n}\npublic class Test {\n\tpublic void SomeMethod (Foo<Test> foo) {\n\t\tvar f = $foo.Bar$;\n\t}\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Foo`1+TestFoo[[Test]]\", mrr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ProtectedBaseMethodCall()\n\t\t{\n\t\t\tstring program = @\"using System;\npublic class Base {\n\tprotected virtual void M() {}\n}\npublic class Test : Base {\n\tprotected override void M() {\n\t\t$base.M()$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"Base.M\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ProtectedBaseFieldAccess()\n\t\t{\n\t\t\tstring program = @\"using System;\npublic class Base {\n\tprotected int Field;\n}\npublic class Test : Base {\n\tpublic new int Field;\n\tprotected override void M() {\n\t\t$base.Field$ = 1;\n\t}\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"Base.Field\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ProtectedBaseIndexer()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass X {\n\tprotected int this[int index] { get; }\n}\nclass Y : X {\n\tint M() {\n\t\treturn $base[0]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, rr.OverloadResolutionErrors);\n\t\t\tAssert.AreEqual(\"X.Item\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ProtectedBaseIndexerError()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass X {\n\tprotected int this[int index] { get; }\n}\nclass Y : X {\n\tint M(X x) {\n\t\treturn $x[0]$;\n\t}\n}\";\n\t\t\tvar rr = Resolve(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ThisHasSameTypeAsFieldInGenericClass()\n\t\t{\n\t\t\tstring program = @\"using System;\npublic struct C<T> {\n\tpublic C(C<T> other) {\n\t\t$M(this, other)$;\n\t}\n\tstatic void M<T>(T a, T b) {}\n}\n\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"C`1[[`0]]\", rr.Arguments[0].Type.ReflectionName);\n\t\t\tAssert.AreEqual(\"C`1[[`0]]\", rr.Arguments[1].Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ProtectedFieldInOuterClass()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Base {\n  protected int X;\n}\nclass Derived : Base {\n  class Inner {\n     public int M(Derived d) { return $d.X$; }\n}}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"Base.X\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ProtectedMemberViaTypeParameter()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Base\n{\n\tprotected void Test() {}\n\tpublic void Test(int a = 0) {}\n}\nclass Derived<T> : Base where T : Derived<T>\n{\n\tvoid M(Derived<T> a, Base b, T c) {\n\t\ta.Test(); // calls Test()\n\t\tb.Test(); // calls Test(int)\n\t\tc.Test(); // calls Test()\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"a.Test()\", \"$a.Test()$\"));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(0, rr.Member.Parameters.Count);\n\t\t\t\n\t\t\trr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"b.Test()\", \"$b.Test()$\"));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(1, rr.Member.Parameters.Count);\n\t\t\t\n\t\t\trr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"c.Test()\", \"$c.Test()$\"));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(0, rr.Member.Parameters.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodGroupConversionForGenericMethodHasSpecializedMethod()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid F<T>(T x) {}\n\tpublic void M() {\n\t\tSystem.Action<int> f;\n\t\tf = $F$;\n\t}\n}\";\n\t\t\tvar conversion = GetConversion(program);\n\t\t\tAssert.IsTrue(conversion.IsValid);\n\t\t\tAssert.IsTrue(conversion.IsMethodGroupConversion);\n\t\t\tAssert.IsTrue(conversion.Method.IsParameterized);\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew[] { \"System.Int32\" },\n\t\t\t\tconversion.Method.TypeArguments.Select(t => t.ReflectionName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PartialMethod_WithoutImplementation()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\t$partial void M();$\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"TestClass.M\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PartialMethod_Declaration()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\t$partial void M();$\n\t\n\tpartial void M() {}\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"TestClass.M\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PartialMethod_Implementation()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tpartial void M();\n\t\n\t$partial void M() {}$\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"TestClass.M\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MembersWithoutWhitespace()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid A();$void B();$void C();\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"TestClass.B\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericClassDoesNotHideField()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A { public int F; }\nclass B : A { public class F<T> {} }\nclass C : B {\n\tpublic void M()\n\t{\n\t\t$F$ = 1;\n\t}\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.F\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonGenericClassHidesField_WithExplicitThisAccess()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A { public int F; }\nclass B : A { public class F {} }\nclass C : B {\n\tpublic void M()\n\t{\n\t\t$this.F$ = 1;\n\t}\n}\";\n\t\t\tvar trr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"B+F\", trr.Type.ReflectionName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9604 - Completion problem with indexers\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9604()\n\t\t{\n\t\t\tstring program = @\"class Item\n{\n    public static int Foo = 42;\n\n    public class Builder\n    {\n        public int Foo\n        {\n            get { return $Item.Foo$; }\n        }\n\n        public object this[int field, int i]\n        {\n            get { return null; }\n        }\n    }\n}\n\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Item.Foo\", result.Member.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Test9604OperatorCase()\n\t\t{\n\t\t\tstring program = @\"class op_Addition\n{\n    public static int Foo = 42;\n\n    public class Builder\n    {\n        public int Foo\n        {\n            get { return $op_Addition.Foo$; }\n        }\n\n        public static int operator + (Builder a, Builder b) \n\t\t{\n\t\t\treturn 0;\n\t\t}\n    }\n}\n\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"op_Addition.Foo\", result.Member.FullName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 10201 - Wrong generics expansion for base recursive types\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug10201()\n\t\t{\n\t\t\tstring program = @\"public interface IA<T>\n{\n}\npublic class G<U, V> : IA<$G<V, string>$> \n{}\n\";\n\t\t\tvar rr = Resolve<TypeResolveResult>(program);\n\t\t\tvar baseType = rr.Type.DirectBaseTypes.First().TypeArguments.First () as ParameterizedType;\n\t\t\tAssert.AreEqual(\"G\", baseType.Name);\n\t\t\t\n\t\t\tAssert.AreEqual(2, baseType.TypeParameterCount);\n\t\t\tAssert.AreEqual(\"System.String\", baseType.TypeArguments [0].FullName);\n\t\t\tAssert.AreEqual(\"System.String\", baseType.TypeArguments [1].FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FixedFieldTest()\n\t\t{\n\t\t\tstring program = @\"unsafe struct Test {\n\tfixed int Field[8];\n\tint* M() { return $Field$; }\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Field\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32*\", rr.Type.ToString());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FixedFieldTest2()\n\t\t{\n\t\t\tstring program = @\"unsafe struct Test {\n\tfixed int Field[8];\n\tint* M() { return $this.Field$; }\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Field\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32*\", rr.Type.ToString());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FixedFieldDeclarationTest()\n\t\t{\n\t\t\tstring program = @\"unsafe struct Test {\n\tfixed int $Field[8]$;\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Field\", rr.Member.FullName);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void FixedFieldDeclarationTestCase2()\n\t\t{\n\t\t\tstring program = @\"unsafe struct Test {\n\tfixed int foo[12], $Field[8]$;\n}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Field\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CrossTypeParametersInheritance()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass BaseClass<A,B> {\n\tpublic A a;\n\tpublic B b;\n}\nclass DerivedClass<A,B> : BaseClass<B,A> {\n\tobject Test() { return $; }\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$a$\"));\n\t\t\tAssert.AreEqual(\"B\", mrr.Type.Name);\n\t\t\t\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$b$\"));\n\t\t\tAssert.AreEqual(\"A\", mrr.Type.Name);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/MethodTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class MethodTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void MethodDeclarationWithAttribute()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\t$[Obsolete(\"\"test\"\")]\n\tpublic void M() {\n\t}$\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(code);\n\t\t\tAssert.AreEqual(\"TestClass.M\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParameterIdentityInNormalMethod()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\t$int F(int i, int j) {\n\t\treturn i + j;\n\t}$\n}\";\n\t\t\t\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tvar md = (MethodDeclaration)prep.Item2;\n\n\t\t\tvar resolver = prep.Item1;\n\t\t\tvar method = (IMethod)((MemberResolveResult)resolver.Resolve(md)).Member;\n\t\t\tIVariable i1 = method.Parameters.Single(p => p.Name == \"i\");\n//\t\t\tIVariable j1 = method.Parameters.Single(p => p.Name == \"j\");\n\n\t\t\tvar returnExpr = (BinaryOperatorExpression)md.Body.Children.OfType<ReturnStatement>().Single().Expression;\n\t\t\tvar returnRR = (OperatorResolveResult)resolver.Resolve(returnExpr);\n\n\t\t\tIVariable i2 = ((LocalResolveResult)returnRR.Operands[0]).Variable;\n//\t\t\tIVariable j2 = ((LocalResolveResult)returnRR.Operands[1]).Variable;\n\n\t\t\tAssert.IsTrue(ReferenceEquals(i1, i2));\n\t\t\tAssert.IsTrue(ReferenceEquals(i1, i2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParameterIdentityInPropertySetter()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\tint myField;\n\t$int Prop {\n\t\tget { return myField; }\n\t\tset { myField = value; }\n\t}$\n}\";\n\t\t\t\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tvar pd = (PropertyDeclaration)prep.Item2;\n\n\t\t\tvar resolver = prep.Item1;\n\t\t\tvar property = (IProperty)((MemberResolveResult)resolver.Resolve(pd)).Member;\n\t\t\tIVariable value1 = property.Setter.Parameters.Single(p => p.Name == \"value\");\n\n\t\t\tvar assignExpr = (AssignmentExpression)pd.Setter.Body.Children.OfType<ExpressionStatement>().Single().Expression;\n\t\t\tvar assignRR = (OperatorResolveResult)resolver.Resolve(assignExpr);\n\n\t\t\tIVariable value2 = ((LocalResolveResult)assignRR.Operands[1]).Variable;\n\n\t\t\tAssert.IsTrue(ReferenceEquals(value1, value2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParameterIdentityInIndexerGetter()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\tint[,] myField;\n\t$int this[int i, int j] {\n\t\tget { return myField[i, j]; }\n\t\tset { myField[i, j] = value; }\n\t}$\n}\";\n\t\t\t\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tvar id = (IndexerDeclaration)prep.Item2;\n\n\t\t\tvar resolver = prep.Item1;\n\t\t\tvar property = (IProperty)((MemberResolveResult)resolver.Resolve(id)).Member;\n\t\t\tIVariable i1 = property.Getter.Parameters.Single(p => p.Name == \"i\");\n\t\t\tIVariable j1 = property.Getter.Parameters.Single(p => p.Name == \"j\");\n\n\t\t\tvar accessExpr = (IndexerExpression)id.Getter.Body.Children.OfType<ReturnStatement>().Single().Expression;\n\t\t\tvar accessRR = (ArrayAccessResolveResult)resolver.Resolve(accessExpr);\n\t\t\tIVariable i2 = ((LocalResolveResult)accessRR.Indexes[0]).Variable;\n\t\t\tIVariable j2 = ((LocalResolveResult)accessRR.Indexes[1]).Variable;\n\n\t\t\tAssert.IsTrue(ReferenceEquals(i1, i2));\n\t\t\tAssert.IsTrue(ReferenceEquals(j1, j2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParameterIdentityInIndexerSetter()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\tint[,] myField;\n\t$int this[int i, int j] {\n\t\tget { return myField[i, j]; }\n\t\tset { myField[i, j] = value; }\n\t}$\n}\";\n\t\t\t\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tvar id = (IndexerDeclaration)prep.Item2;\n\n\t\t\tvar resolver = prep.Item1;\n\t\t\tvar property = (IProperty)((MemberResolveResult)resolver.Resolve(id)).Member;\n\t\t\tIVariable i1 = property.Setter.Parameters.Single(p => p.Name == \"i\");\n\t\t\tIVariable j1 = property.Setter.Parameters.Single(p => p.Name == \"j\");\n\t\t\tIVariable value1 = property.Setter.Parameters.Single(p => p.Name == \"value\");\n\n\t\t\tvar assignExpr = (AssignmentExpression)id.Setter.Body.Children.OfType<ExpressionStatement>().Single().Expression;\n\t\t\tvar assignRR = (OperatorResolveResult)resolver.Resolve(assignExpr);\n\t\t\tvar accessRR = (ArrayAccessResolveResult)assignRR.Operands[0];\n\t\t\tIVariable i2 = ((LocalResolveResult)accessRR.Indexes[0]).Variable;\n\t\t\tIVariable j2 = ((LocalResolveResult)accessRR.Indexes[1]).Variable;\n\t\t\tIVariable value2 = ((LocalResolveResult)assignRR.Operands[1]).Variable;\n\n\t\t\tAssert.IsTrue(ReferenceEquals(i1, i2));\n\t\t\tAssert.IsTrue(ReferenceEquals(j1, j2));\n\t\t\tAssert.IsTrue(ReferenceEquals(value1, value2));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ResolveParameterDeclarationInIndexer()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\tint[,] myField;\n\tint this[$int i$, int j] {\n\t\tget { return myField[i, j]; }\n\t\tset { myField[i, j] = value; }\n\t}\n}\";\n\t\t\tvar rr = Resolve<LocalResolveResult>(code);\n\t\t\tAssert.IsTrue(rr.IsParameter);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParameterIdentityInEventAdder()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\tEventHandler myField;\n\t$event EventHandler Evt {\n\t\tadd { myField += value; }\n\t\tremove { myField -= value; }\n\t}$\n}\";\n\t\t\t\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tvar ed = (CustomEventDeclaration)prep.Item2;\n\n\t\t\tvar resolver = prep.Item1;\n\t\t\tvar evt = (IEvent)((MemberResolveResult)resolver.Resolve(ed)).Member;\n\t\t\tIVariable value1 = evt.AddAccessor.Parameters.Single(p => p.Name == \"value\");\n\n\t\t\tvar assignExpr = (AssignmentExpression)ed.AddAccessor.Body.Children.OfType<ExpressionStatement>().Single().Expression;\n\t\t\tvar assignRR = (OperatorResolveResult)resolver.Resolve(assignExpr);\n\n\t\t\tIVariable value2 = ((LocalResolveResult)assignRR.Operands[1]).Variable;\n\n\t\t\tAssert.IsTrue(ReferenceEquals(value1, value2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParameterIdentityInEventRemover()\n\t\t{\n\t\t\tstring code = @\"using System;\nclass TestClass {\n\tEventHandler myField;\n\t$event EventHandler Evt {\n\t\tadd { myField += value; }\n\t\tremove { myField -= value; }\n\t}$\n}\";\n\t\t\t\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tvar ed = (CustomEventDeclaration)prep.Item2;\n\n\t\t\tvar resolver = prep.Item1;\n\t\t\tvar evt = (IEvent)((MemberResolveResult)resolver.Resolve(ed)).Member;\n\t\t\tIVariable value1 = evt.RemoveAccessor.Parameters.Single(p => p.Name == \"value\");\n\n\t\t\tvar assignExpr = (AssignmentExpression)ed.RemoveAccessor.Body.Children.OfType<ExpressionStatement>().Single().Expression;\n\t\t\tvar assignRR = (OperatorResolveResult)resolver.Resolve(assignExpr);\n\n\t\t\tIVariable value2 = ((LocalResolveResult)assignRR.Operands[1]).Variable;\n\n\t\t\tAssert.IsTrue(ReferenceEquals(value1, value2));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithInvalidCastInDefaultValue()\n\t\t{\n\t\t\tvar input = @\"\nclass TestClass\n{\n\tvoid TestMethod ($int x = true$)\n\t{\n\t}\n}\";\n\t\t\tvar rr = Resolve<LocalResolveResult>(input);\n\t\t\tIParameter p = (IParameter)rr.Variable;\n\t\t\tAssert.IsTrue(p.IsOptional);\n\t\t\tAssert.IsNull(p.ConstantValue);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class NameLookupTests : ResolverTestBase\n\t{\n\t\tCSharpResolver resolver;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tresolver = new CSharpResolver(compilation).WithCurrentUsingScope(MakeUsingScope(string.Empty));\n\t\t}\n\t\t\n\t\tResolvedUsingScope MakeUsingScope(string namespaceName = \"\", string[] usings = null, KeyValuePair<string, string>[] usingAliases = null)\n\t\t{\n\t\t\tUsingScope usingScope = new UsingScope();\n\t\t\tif (!string.IsNullOrEmpty(namespaceName)) {\n\t\t\t\tforeach (string element in namespaceName.Split('.')) {\n\t\t\t\t\tusingScope = new UsingScope(usingScope, string.IsNullOrEmpty(usingScope.NamespaceName) ? element : usingScope.NamespaceName + \".\" + element);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (usings != null) {\n\t\t\t\tforeach (string u in usings)\n\t\t\t\t\tusingScope.Usings.Add(MakeReference(u));\n\t\t\t}\n\t\t\tif (usingAliases != null) {\n\t\t\t\tforeach (var pair in usingAliases)\n\t\t\t\t\tusingScope.UsingAliases.Add(new KeyValuePair<string, TypeOrNamespaceReference>(pair.Key, MakeReference(pair.Value)));\n\t\t\t}\n\t\t\treturn usingScope.Resolve(compilation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleNameLookupWithoutContext()\n\t\t{\n\t\t\t// without any using scope, we still want to find elements of the global namespace:\n\t\t\tvar nrr = (NamespaceResolveResult)resolver.WithCurrentUsingScope(null).ResolveSimpleName(\"System\", new IType[0]);\n\t\t\tAssert.AreEqual(\"System\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleNamespaceLookup()\n\t\t{\n\t\t\tNamespaceResolveResult nrr = (NamespaceResolveResult)resolver.ResolveSimpleName(\"System\", new IType[0]);\n\t\t\tAssert.AreEqual(\"System\", nrr.NamespaceName);\n\t\t\tAssert.AreSame(SpecialType.UnknownType, nrr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NamespaceInParentNamespaceLookup()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(\"System.Collections.Generic\"));\n\t\t\tNamespaceResolveResult nrr = (NamespaceResolveResult)resolverWithUsing.ResolveSimpleName(\"Text\", new IType[0]);\n\t\t\tAssert.AreEqual(\"System.Text\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NamespacesAreNotImported()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(usings: new [] { \"System\" }));\n\t\t\tAssert.IsTrue(resolverWithUsing.ResolveSimpleName(\"Collections\", new IType[0]).IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImportedType()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(usings: new [] { \"System\" }));\n\t\t\tTypeResolveResult trr = (TypeResolveResult)resolverWithUsing.ResolveSimpleName(\"String\", new IType[0]);\n\t\t\tAssert.AreEqual(\"System.String\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownIdentifierTest()\n\t\t{\n\t\t\tUnknownIdentifierResolveResult uirr = (UnknownIdentifierResolveResult)resolver.ResolveSimpleName(\"xyz\", new IType[0]);\n\t\t\tAssert.IsTrue(uirr.IsError);\n\t\t\tAssert.AreEqual(\"xyz\", uirr.Identifier);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GlobalIsUnknownIdentifier()\n\t\t{\n\t\t\tAssert.IsTrue(resolver.ResolveSimpleName(\"global\", new IType[0]).IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GlobalIsAlias()\n\t\t{\n\t\t\tNamespaceResolveResult nrr = (NamespaceResolveResult)resolver.ResolveAlias(\"global\");\n\t\t\tAssert.AreEqual(\"\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasToImportedType()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(usings: new [] { \"System\" }, usingAliases: new [] { new KeyValuePair<string, string>( \"x\", \"String\" )}));\n\t\t\tUnknownIdentifierResolveResult rr = (UnknownIdentifierResolveResult)resolverWithUsing.ResolveSimpleName(\"x\", new IType[0]);\n\t\t\t// Unknown identifier (as String isn't looked up in System)\n\t\t\tAssert.AreEqual(\"String\", rr.Identifier);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasToImportedType2()\n\t\t{\n\t\t\tUsingScope mainUsingScope = new UsingScope();\n\t\t\tmainUsingScope.Usings.Add(MakeReference(\"System\"));\n\t\t\tUsingScope nestedUsingScope = new UsingScope(mainUsingScope, \"SomeNamespace\");\n\t\t\tnestedUsingScope.UsingAliases.Add(new KeyValuePair<string, TypeOrNamespaceReference>(\"x\", MakeReference(\"String\")));\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(nestedUsingScope.Resolve(compilation));\n\t\t\t\n\t\t\tTypeResolveResult trr = (TypeResolveResult)resolverWithUsing.ResolveSimpleName(\"x\", new IType[0]);\n\t\t\tAssert.AreEqual(\"System.String\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasOperatorOnTypeAlias()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(usingAliases: new [] { new KeyValuePair<string, string>( \"x\", \"System.String\" )}));\n\t\t\tAssert.IsTrue(resolverWithUsing.ResolveAlias(\"x\").IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasOperatorOnNamespaceAlias()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(usingAliases: new [] { new KeyValuePair<string, string>( \"x\", \"System.Collections.Generic\" )}));\n\t\t\tNamespaceResolveResult nrr = (NamespaceResolveResult)resolverWithUsing.ResolveAlias(\"x\");\n\t\t\tAssert.AreEqual(\"System.Collections.Generic\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AliasOperatorOnNamespace()\n\t\t{\n\t\t\tAssert.IsTrue(resolver.ResolveAlias(\"System\").IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindClassInCurrentNamespace()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(\"System.Collections\"));\n\t\t\tTypeResolveResult trr = (TypeResolveResult)resolverWithUsing.ResolveSimpleName(\"String\", new IType[0]);\n\t\t\tAssert.AreEqual(\"System.String\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindNeighborNamespace()\n\t\t{\n\t\t\tvar resolverWithUsing = resolver.WithCurrentUsingScope(MakeUsingScope(\"System.Collections\"));\n\t\t\tNamespaceResolveResult nrr = (NamespaceResolveResult)resolverWithUsing.ResolveSimpleName(\"Text\", new IType[0]);\n\t\t\tAssert.AreEqual(\"System.Text\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindTypeParameters()\n\t\t{\n\t\t\tvar listOfT = compilation.FindType(typeof(List<>)).GetDefinition();\n\t\t\tvar resolverWithContext = resolver\n\t\t\t\t.WithCurrentUsingScope(MakeUsingScope(\"System.Collections.Generic\"))\n\t\t\t\t.WithCurrentTypeDefinition(listOfT)\n\t\t\t\t.WithCurrentMember(listOfT.Methods.Single(m => m.Name == \"ConvertAll\"));\n\t\t\t\n\t\t\tTypeResolveResult trr;\n\t\t\ttrr = (TypeResolveResult)resolverWithContext.ResolveSimpleName(\"TOutput\", new IType[0]);\n\t\t\tAssert.AreSame(((IMethod)resolverWithContext.CurrentMember).TypeParameters[0], trr.Type);\n\t\t\t\n\t\t\ttrr = (TypeResolveResult)resolverWithContext.ResolveSimpleName(\"T\", new IType[0]);\n\t\t\tAssert.AreSame(resolverWithContext.CurrentTypeDefinition.TypeParameters[0], trr.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleParameter()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method(string a) {\n\t\tstring b = $a$;\n\t}\n}\n\";\n\t\t\tLocalResolveResult result = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"a\", result.Variable.Name);\n\t\t\tAssert.IsTrue(result.IsParameter);\n\t\t\tAssert.AreEqual(\"System.String\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleLocalVariable()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\tstring a;\n\t\tstring b = $a$;\n\t}\n}\n\";\n\t\t\tLocalResolveResult result = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"a\", result.Variable.Name);\n\t\t\tAssert.IsFalse(result.IsParameter);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.String\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnknownTypeTest()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method($StringBuilder$ b) {\n\t}\n}\n\";\n\t\t\tUnknownIdentifierResolveResult result = Resolve<UnknownIdentifierResolveResult>(program);\n\t\t\tAssert.AreEqual(\"StringBuilder\", result.Identifier);\n\t\t\t\n\t\t\tAssert.AreSame(SpecialType.UnknownType, result.Type);\n\t\t}\n\t\t\n\t\tconst string propertyNameAmbiguousWithTypeNameProgram = @\"class A {\n\tpublic Color Color { get; set; }\n\t\n\tvoid Method() {\n\t\t$\n\t}\n}\nclass Color {\n\tpublic static readonly Color Empty = null;\n\tpublic static int M() { }\n\tpublic int M(int a) { }\n}\n\";\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyNameAmbiguousWithTypeName()\n\t\t{\n\t\t\tstring program = propertyNameAmbiguousWithTypeNameProgram;\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program.Replace(\"$\", \"$Color$ c;\"));\n\t\t\tAssert.AreEqual(\"Color\", trr.Type.Name);\n\t\t\t\n\t\t\tMemberResolveResult mrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"x = $Color$;\"));\n\t\t\tAssert.AreEqual(\"Color\", mrr.Member.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyNameAmbiguousWithTypeName_MemberAccessOnAmbiguousIdentifier()\n\t\t{\n\t\t\tstring program = propertyNameAmbiguousWithTypeNameProgram;\n\t\t\tResolve<MemberResolveResult>(program.Replace(\"$\", \"$Color$ = Color.Empty;\"));\n\t\t\tResolve<TypeResolveResult>(program.Replace(\"$\", \"Color = $Color$.Empty;\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyNameAmbiguousWithTypeName_MethodInvocationOnAmbiguousIdentifier()\n\t\t{\n\t\t\tstring program = propertyNameAmbiguousWithTypeNameProgram;\n\t\t\tResolve<MemberResolveResult>(program.Replace(\"$\", \"x = $Color$.M(1);\"));\n\t\t\tResolve<TypeResolveResult>(program.Replace(\"$\", \"x = $Color$.M();\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ValueInsideSetterTest()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tpublic string Property {\n\t\tset {\n\t\t\tvar a = $value$;\n\t\t}\n\t}\n}\n\";\n\t\t\tLocalResolveResult result = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", result.Type.FullName);\n\t\t\tAssert.AreEqual(\"value\", result.Variable.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ValueInsideEventTest()\n\t\t{\n\t\t\tstring program = @\"using System; class A {\n\tpublic event EventHandler Ev {\n\t\tadd {\n\t\t\tvar a = $value$;\n\t\t}\n\t\tremove {}\n\t}\n}\n\";\n\t\t\tLocalResolveResult result = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.EventHandler\", result.Type.FullName);\n\t\t\tAssert.AreEqual(\"value\", result.Variable.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ValueInsideIndexerSetterTest()\n\t\t{\n\t\t\tstring program = @\"using System; class A {\n\tpublic string this[int arg] {\n\t\tset {\n\t\t\tvar a = $value$;\n\t\t}\n\t}\n}\n\";\n\t\t\tLocalResolveResult result = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", result.Type.FullName);\n\t\t\tAssert.AreEqual(\"value\", result.Variable.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AnonymousMethodParameters()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A {\n\tvoid Method() {\n\t\tSomeEvent += delegate(object sender, EventArgs e) {\n\t\t\t$e$.ToString();\n\t\t};\n\t} }\n\";\n\t\t\tLocalResolveResult result = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.EventArgs\", result.Type.FullName);\n\t\t\tAssert.AreEqual(\"e\", result.Variable.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefaultTypeCSharp()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t$int$ a;\n\t} }\n\";\n\t\t\tTypeResolveResult result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int32\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LoopVariableScopeTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tvoid Test() {\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\t$1$.ToString();\n\t\t}\n\t\tfor (long i = 0; i < 10; i++) {\n\t\t\t$2$.ToString();\n\t\t}\n\t}\n}\n\";\n\t\t\tLocalResolveResult lr = Resolve<LocalResolveResult>(program.Replace(\"$1$\", \"$i$\").Replace(\"$2$\", \"i\"));\n\t\t\tAssert.AreEqual(\"System.Int32\", lr.Type.ReflectionName);\n\t\t\t\n\t\t\tlr = Resolve<LocalResolveResult>(program.Replace(\"$1$\", \"i\").Replace(\"$2$\", \"$i$\"));\n\t\t\tAssert.AreEqual(\"System.Int64\", lr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NamespacePreferenceTest()\n\t\t{\n\t\t\t// Classes in the current namespace are preferred over classes from\n\t\t\t// imported namespaces\n\t\t\tstring program = @\"using System;\nnamespace Testnamespace {\nclass A {\n\t$Activator$ a;\n}\n\nclass Activator {\n\t\n}\n}\n\";\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Testnamespace.Activator\", result.Type.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NamespaceDefinitionOverwritesTypeName ()\n\t\t{\n\t\t\t// Classes in the current namespace are preferred over classes from\n\t\t\t// imported namespaces\n\t\t\tstring program = @\"using System;\nnamespace $Auto.Test$ {\n\tclass Auto\n \t{\n\t}\n}\n\";\n\t\t\tvar result = Resolve<NamespaceResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Auto.Test\", result.NamespaceName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParentNamespaceTypeLookup()\n\t\t{\n\t\t\tstring program = @\"using System;\nnamespace Root {\n  class Alpha {}\n}\nnamespace Root.Child {\n  class Beta {\n    $Alpha$ a;\n  }\n}\n\";\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Root.Alpha\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImportAliasTest()\n\t\t{\n\t\t\tstring program = @\"using COL = System.Collections;\nclass TestClass {\n\tCOL.ArrayList ff;\n}\n\";\n\t\t\tTypeResolveResult type = Resolve<TypeResolveResult>(program.Replace(\"COL.ArrayList\", \"$COL.ArrayList$\"));\n\t\t\tAssert.IsNotNull(type, \"COL.ArrayList should resolve to a type\");\n\t\t\tAssert.AreEqual(\"System.Collections.ArrayList\", type.Type.FullName, \"TypeResolveResult\");\n\t\t\t\n\t\t\tMemberResolveResult member = Resolve<MemberResolveResult>(program.Replace(\"ff\", \"$ff$\"));\n\t\t\tAssert.AreEqual(\"System.Collections.ArrayList\", member.Type.FullName, \"the full type should be resolved\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImportAliasNamespaceResolveTest()\n\t\t{\n\t\t\tNamespaceResolveResult ns;\n\t\t\tstring program = \"using COL = System.Collections;\\r\\nclass A {\\r\\n$.ArrayList a;\\r\\n}\\r\\n\";\n\t\t\tns = Resolve<AliasNamespaceResolveResult>(program.Replace(\"$\", \"$COL$\"));\n\t\t\tAssert.AreEqual(\"System.Collections\", ns.NamespaceName, \"COL\");\n\t\t\tns = Resolve<NamespaceResolveResult>(program.Replace(\"$\", \"$COL.Generic$\"));\n\t\t\tAssert.AreEqual(\"System.Collections.Generic\", ns.NamespaceName, \"COL.Generic\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImportAliasClassResolveTest()\n\t\t{\n\t\t\tstring program = @\"using COL = System.Collections.ArrayList;\nclass TestClass {\n\tvoid Test() {\n\t\tCOL a = new COL();\n\t\t\n\t}\n}\n\";\n\t\t\tTypeResolveResult trr = Resolve<AliasTypeResolveResult>(program.Replace(\"COL a\", \"$COL$ a\"));\n\t\t\tAssert.AreEqual(\"System.Collections.ArrayList\", trr.Type.FullName, \"COL\");\n\t\t\tResolveResult rr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"new COL()\", \"$new COL()$\"));\n\t\t\tAssert.AreEqual(\"System.Collections.ArrayList\", rr.Type.FullName, \"a\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImportSubnamespaceWithAliasTest()\n\t\t{\n\t\t\tstring program = @\"namespace PC\n{\n\t// Define an alias for the nested namespace.\n\tusing Project = PC.MyCompany.Project;\n\tclass A\n\t{\n\t\tProject.MyClass M()\n\t\t{\n\t\t\t// Use the alias\n\t\t\t$Project.MyClass$ mc = new Project.MyClass();\n\t\t\treturn mc;\n\t\t}\n\t}\n\tnamespace MyCompany\n\t{\n\t\tnamespace Project\n\t\t{\n\t\t\tpublic class MyClass { }\n\t\t}\n\t}\n}\n\";\n\t\t\tvar mrr = Resolve(program);\n\t\t\tAssert.AreEqual(\"PC.MyCompany.Project.MyClass\", mrr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ResolveNamespaceSD_863()\n\t\t{\n\t\t\tstring program = @\"using System;\nnamespace A.C { class D {} }\nnamespace A.B.C { class D {} }\nnamespace A.B {\n\tclass TestClass {\n\t\tvoid Test() {\n\t\t\tC.D x;\n\t\t}\n\t}\n}\n\";\n\t\t\tNamespaceResolveResult nrr = Resolve<NamespaceResolveResult>(program.Replace(\"C.D\", \"$C$.D\"));\n\t\t\tAssert.AreEqual(\"A.B.C\", nrr.NamespaceName, \"nrr.Name\");\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program.Replace(\"C.D\", \"$C.D$\"));\n\t\t\tAssert.AreEqual(\"A.B.C.D\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ResolveTypeSD_863()\n\t\t{\n\t\t\tstring program = @\"using System;\nnamespace A { class C {} }\nnamespace A.B {\n\tclass C {}\n\tclass TestClass {\n\t\tvoid Test() {\n\t\t\t$C$ a;\n\t\t}\n\t}\n}\n\";\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.B.C\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void InnerTypeResolve1 ()\n\t\t{\n\t\t\tstring program = @\"public class C<T> { public class Inner { } }\nclass TestClass {\n\tvoid Test() {\n\t\t$C<string>.Inner$ a;\n\t}\n}\n\";\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"C.Inner\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerTypeResolve2 ()\n\t\t{\n\t\t\tstring program = @\"public class C<T> { public class D<S,U> { public class Inner { } }}\nclass TestClass {\n\tvoid Test() {\n\t\t$C<string>.D<int,TestClass>.Inner$ a;\n\t}\n}\n\";\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"C.D.Inner\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShortMaxValueTest()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tobject a = $short.MaxValue$;\n}\n\";\n\t\t\tMemberResolveResult rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int16\", rr.Type.FullName);\n\t\t\tAssert.AreEqual(\"System.Int16.MaxValue\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(short.MaxValue, rr.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassWithSameNameAsNamespace()\n\t\t{\n\t\t\tstring program = @\"using System; namespace XX {\n\tclass Test {\n\t\tstatic void X() {\n\t\t\ta = $;\n\t\t}\n\t}\n\tclass XX {\n\t\tpublic static void Test() {}\n\t} }\";\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program.Replace(\"$\", \"$XX$\"));\n\t\t\tAssert.AreEqual(\"XX.XX\", trr.Type.FullName);\n\t\t\t\n\t\t\tNamespaceResolveResult nrr = Resolve<NamespaceResolveResult>(program.Replace(\"$\", \"$global::XX$.T\"));\n\t\t\tAssert.AreEqual(\"XX\", nrr.NamespaceName);\n\t\t\t\n\t\t\ttrr = Resolve<TypeResolveResult>(program.Replace(\"$\", \"$global::XX.XX$\"));\n\t\t\tAssert.AreEqual(\"XX.XX\", trr.Type.FullName);\n\t\t\t\n\t\t\tInvocationResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$XX.Test()$\"));\n\t\t\tAssert.AreEqual(\"XX.XX.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassNameLookup1()\n\t\t{\n\t\t\tstring program = @\"namespace MainNamespace {\n\tusing Test.Subnamespace;\n\tclass Program {\n\t\tstatic void M($Test.TheClass$ c) {}\n\t}\n}\n\nnamespace Test { public class TheClass { } }\nnamespace Test.Subnamespace {\n\tpublic class Test { public class TheClass { } }\n}\n\";\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Subnamespace.Test.TheClass\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassNameLookup2()\n\t\t{\n\t\t\tstring program = @\"using Test.Subnamespace;\nnamespace MainNamespace {\n\tclass Program {\n\t\tstatic void M($Test.TheClass$ c) {}\n\t}\n}\n\nnamespace Test { public class TheClass { } }\nnamespace Test.Subnamespace {\n\tpublic class Test { public class TheClass { } }\n}\n\";\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.TheClass\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassNameLookup3()\n\t\t{\n\t\t\tstring program = @\"namespace MainNamespace {\n\tusing Test.Subnamespace;\n\tclass Program {\n\t\tstatic void M($Test$ c) {}\n\t}\n}\n\nnamespace Test { public class TheClass { } }\nnamespace Test.Subnamespace {\n\tpublic class Test { public class TheClass { } }\n}\n\";\n\t\t\tTypeResolveResult trr = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Subnamespace.Test\", trr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassNameLookup4()\n\t\t{\n\t\t\tstring program = @\"using Test.Subnamespace;\nnamespace MainNamespace {\n\tclass Program {\n\t\tstatic void M($Test$ c) {}\n\t}\n}\n\nnamespace Test { public class TheClass { } }\nnamespace Test.Subnamespace {\n\tpublic class Test { public class TheClass { } }\n}\n\";\n\t\t\tNamespaceResolveResult nrr = Resolve<NamespaceResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassNameLookup5()\n\t\t{\n\t\t\tstring program = @\"namespace MainNamespace {\n\tusing A;\n\t\n\tclass M {\n\t\tvoid X($Test$ a) {}\n\t}\n\tnamespace Test { class B {} }\n}\n\nnamespace A {\n\tclass Test {}\n}\";\n\t\t\tNamespaceResolveResult nrr = Resolve<NamespaceResolveResult>(program);\n\t\t\tAssert.AreEqual(\"MainNamespace.Test\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvocableRule()\n\t\t{\n\t\t\tstring program = @\"using System;\n\tclass DerivedClass : BaseClass {\n\t\tstatic void X() {\n\t\t\ta = $;\n\t\t}\n\t\tprivate static new int Test;\n\t}\n\tclass BaseClass {\n\t\tpublic static string Test() {}\n\t}\";\n\t\t\tMemberResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$BaseClass.Test()$\"));\n\t\t\tAssert.AreEqual(\"BaseClass.Test\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$Test$\"));\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$DerivedClass.Test$\"));\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t\t\n\t\t\t// returns BaseClass.Test because DerivedClass.Test is not invocable\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$DerivedClass.Test()$\"));\n\t\t\tAssert.AreEqual(\"BaseClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvocableRule2()\n\t\t{\n\t\t\tstring program = @\"using System;\n\tclass DerivedClass : BaseClass {\n\t\tstatic void X() {\n\t\t\ta = $;\n\t\t}\n\t\tprivate static new int Test;\n\t}\n\tdelegate string SomeDelegate();\n\tclass BaseClass {\n\t\tpublic static SomeDelegate Test;\n\t}\";\n\t\t\tMemberResolveResult mrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$BaseClass.Test$()\"));\n\t\t\tAssert.AreEqual(\"BaseClass.Test\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$Test$\"));\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$DerivedClass.Test$\"));\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t\t\n\t\t\t// returns BaseClass.Test because DerivedClass.Test is not invocable\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$DerivedClass.Test$()\"));\n\t\t\tAssert.AreEqual(\"BaseClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AccessibleRule()\n\t\t{\n\t\t\tstring program = @\"using System;\n\tclass BaseClass {\n\t\tstatic void X() {\n\t\t\ta = $DerivedClass.Test$;\n\t\t}\n\t\tpublic static int Test;\n\t}\n\tclass DerivedClass : BaseClass {\n\t\tprivate static new int Test;\n\t}\n\t\";\n\t\t\t// returns BaseClass.Test because DerivedClass.Test is not accessible\n\t\t\tMemberResolveResult mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"BaseClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FieldHidingProperty()\n\t\t{\n\t\t\tstring program = @\"using System;\n\tclass DerivedClass : BaseClass {\n\t\tstatic void X() {\n\t\t\ta = $Test$;\n\t\t}\n\t\tpublic static new int Test;\n\t}\n\tclass BaseClass {\n\t\tpublic static int Test { get { return 0; } }\n\t}\n\t\";\n\t\t\tMemberResolveResult mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyHidingField()\n\t\t{\n\t\t\tstring program = @\"using System;\n\tclass DerivedClass : BaseClass {\n\t\tstatic void X() {\n\t\t\ta = $Test$;\n\t\t}\n\t\tpublic static new int Test { get { return 0; } }\n\t}\n\tclass BaseClass {\n\t\tpublic static int Test;\n\t}\n\t\";\n\t\t\tMemberResolveResult mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"DerivedClass.Test\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SD_1487()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass C2 : C1 {\n\tpublic static void M() {\n\t\ta = $;\n\t}\n}\nclass C1 {\n\tprotected static int Field;\n}\";\n\t\t\tMemberResolveResult mrr;\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$Field$\"));\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t\tAssert.AreEqual(\"C1.Field\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$C1.Field$\"));\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t\tAssert.AreEqual(\"C1.Field\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<MemberResolveResult>(program.Replace(\"$\", \"$C2.Field$\"));\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t\tAssert.AreEqual(\"C1.Field\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableValue()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test {\n\tpublic static void M(int? a) {\n\t\t$a.Value$.ToString();\n\t}\n}\";\n\t\t\tMemberResolveResult rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Nullable.Value\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Member.ReturnType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodHidesEvent()\n\t\t{\n\t\t\t// see SD-1542\n\t\t\tstring program = @\"using System;\nclass Test : Form {\n\tpublic Test() {\n\t\ta = $base.KeyDown$;\n\t}\n\tvoid KeyDown(object sender, EventArgs e) {}\n}\nclass Form {\n\tpublic event EventHandler KeyDown;\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Form.KeyDown\", mrr.Member.FullName);\n\t\t\t\n\t\t\tvar mgrr = Resolve<MethodGroupResolveResult>(program.Replace(\"base\", \"this\"));\n\t\t\tAssert.AreEqual(\"Test.KeyDown\", mgrr.Methods.Single().FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ProtectedMemberVisibleWhenBaseTypeReferenceIsInOtherPart()\n\t\t{\n\t\t\tstring program = @\"using System;\npartial class A {\n\tvoid M1() {\n\t\t$x$ = 0;\n\t}\n}\npartial class A : B { }\nclass B\n{\n\tprotected int x;\n}\";\n\t\t\tvar mrr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"B.x\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SubstituteClassAndMethodTypeParametersAtOnce()\n\t\t{\n\t\t\tstring program = @\"class C<X> { static void M<T>(X a, T b) { $C<T>.M<X>$(b, a); } }\";\n\t\t\tvar rr = Resolve<MethodGroupResolveResult>(program);\n\t\t\tAssert.AreEqual(\"X\", rr.TypeArguments.Single().Name);\n\t\t\t\n\t\t\tvar m = rr.Methods.Single();\n\t\t\tAssert.AreSame(rr.TypeArguments.Single(), m.TypeArguments.Single());\n\t\t\tAssert.AreEqual(\"T\", m.Parameters[0].Type.Name);\n\t\t\tAssert.AreEqual(\"X\", m.Parameters[1].Type.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InheritingInnerClassShouldNotCauseStackOverflow()\n\t\t{\n\t\t\tstring program = @\"class Test : $Test.Base$, Test.ITest { public class Base {} interface ITest {} }\";\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Test.Base\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerClassInheritingFromProtectedBaseInnerClassShouldNotCauseStackOverflow()\n\t\t{\n\t\t\tstring program = @\"class Base {\n  protected class NestedBase {}\n}\nclass Derived : Base {\n  class NestedDerived : $NestedBase$ { }\n}\";\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Base.NestedBase\", result.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumMembersHaveUnderlyingTypeWithinInitializers_MemberFromSameEnum()\n\t\t{\n\t\t\tstring program = @\"enum E { A = 0, B = $A$ + 1 }\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"E.A\", result.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", result.Type.ReflectionName);\n\t\t\tAssert.AreEqual(\"E\", result.Member.ReturnType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumMembersHaveUnderlyingTypeWithinInitializers_MemberFromOtherEnum()\n\t\t{\n\t\t\tstring program = @\"enum A : ushort { X = 1 } enum B { Y = $A.X$ }\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.X\", result.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.UInt16\", result.Type.ReflectionName);\n\t\t\tAssert.AreEqual(\"A\", result.Member.ReturnType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumMembersHaveUnderlyingTypeWithinInitializers_RuleDoesNotApplyToAttributes()\n\t\t{\n\t\t\tstring program = @\"enum A { X = 1, [SomeAttribute($X$)] Y }\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.X\", result.Member.FullName);\n\t\t\tAssert.AreEqual(\"A\", result.Type.ReflectionName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InheritFromProtectedInnerClassTest()\n\t\t{\n\t\t\tstring program = @\"\nclass Test\n{\n\tprotected class Foo\n\t{\n\t\tpublic int Bar = 0;\n\t}\n}\n\nclass MainClass : Test\n{\n\tclass Foo2 : Test.Foo\n\t{\n\t\tpublic Foo2 ()\n\t\t{\n\t\t\tConsole.WriteLine ($Bar$);\n\t\t}\n\t}\n}\n\";\n\t\t\tvar result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.IsFalse(result.IsError);\n\t\t\tAssert.AreEqual(\"Test.Foo.Bar\", result.Member.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void LocalInsideUnsafeBlock()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\tunsafe {\n\t\t\tstring a;\n\t\t\tstring b = $a$;\n\t\t}\n\t}\n}\n\";\n\t\t\tLocalResolveResult result = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"a\", result.Variable.Name);\n\t\t\tAssert.IsFalse(result.IsParameter);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.String\", result.Type.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DuplicateUsingDirective() {\n\t\t\tstring program = @\"\nusing foo;\nusing foo;\nnamespace bar {\n\tusing foo;\n\tusing foo;\n\n    public class Bar {\n        public void M() {\n            new $Foo$();\n        }\n    }\n}\nnamespace foo {\n    public class Foo {\n    }\n}\";\n\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.IsFalse(result.IsError);\n\t\t\tAssert.AreEqual(\"foo.Foo\", result.Type.FullName);\n\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseTypeReference_refers_to_outer_type()\n\t\t{\n\t\t\tstring program = @\"class B {}\n    class A : $B$ {\n        class B {}\n    }\";\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.IsFalse(result.IsError);\n\t\t\tAssert.AreEqual(\"B\", result.Type.FullName);\n\t\t\t\n\t\t\t// also check if the reference in the type system is correct\n\t\t\tvar a = ((ITypeDefinition)result.Type).Compilation.RootNamespace.GetTypeDefinition(\"A\", 0);\n\t\t\tAssert.AreEqual(\"B\", a.DirectBaseTypes.Single().FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Class_constraint_refers_to_outer_type()\n\t\t{\n\t\t\tstring program = @\"class B {}\n    class A<T> where T : $B$ {\n        class B {}\n    }\";\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.IsFalse(result.IsError);\n\t\t\tAssert.AreEqual(\"B\", result.Type.FullName);\n\t\t\t\n\t\t\t// also check if the reference in the type system is correct\n\t\t\tvar a = ((ITypeDefinition)result.Type).Compilation.RootNamespace.GetTypeDefinition(\"A\", 1);\n\t\t\tAssert.AreEqual(\"B\", a.TypeParameters.Single().DirectBaseTypes.Single().FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Method_constraint_refers_to_inner_type()\n\t\t{\n\t\t\tstring program = @\"class B {}\n    class A {\n    \tvoid M<T>() where T : $B$ {}\n        class B {}\n    }\";\n\t\t\tvar result = Resolve<TypeResolveResult>(program);\n\t\t\tAssert.IsFalse(result.IsError);\n\t\t\tAssert.AreEqual(\"A.B\", result.Type.FullName);\n\t\t\t\n\t\t\t// also check if the reference in the type system is correct\n\t\t\tvar a = ((ITypeDefinition)result.Type).Compilation.RootNamespace.GetTypeDefinition(\"A\", 0);\n\t\t\tvar method = a.Methods.Single(m => m.Name == \"M\");\n\t\t\tAssert.AreEqual(\"A.B\", method.TypeParameters.Single().DirectBaseTypes.Single().FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EmptyNamespaces()\n\t\t{\n\t\t\t// should maybe a typesystem test - but empty namespaces don't make sense in cecil.\n\t\t\tstring program = @\"namespace A.B.C.D\n{\n\n}\n\nnamespace Test\n{\n    using $A.B.C.D$;\n\n    public class C\n    {\n        public static void Main ()\n        {\n\n        }\n    }\n}\n\n\t\";\n\t\t\tvar nrr = Resolve<NamespaceResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.B.C.D\", nrr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CuriouslyRecurringInnerClass()\n\t\t{\n\t\t\tstring program = @\"\n\tabstract class Table<T>\n\t{\n\t\tinternal T[] records = {};\n\t}\n\t\n\tsealed class ConcreteTable : Table<ConcreteTable.Record>\n\t{\n\t\tinternal struct Record\n\t\t{\n\t\t\tpublic int Value;\n\t\t}\n\t\t\n\t\tint First()\n\t\t{\n\t\t\treturn $records[0].Value$;\n\t\t}\n\t}\";\n\t\t\tvar rr = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"ConcreteTable+Record.Value\", rr.Member.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UsingStatementReferringToMissingNestedType()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing $A.B$;\n\nclass A { }\";\n\t\t\tvar rr = Resolve<UnknownMemberResolveResult>(program);\n\t\t\t\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ObjectCreationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class ObjectCreationTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void GenericObjectCreation()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A {\n\tstatic void Main() {\n\t\tvar a = $new List<string>()$;\n\t}\n}\n\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List..ctor\", result.Member.FullName);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List`1[[System.String]]\", result.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonExistingClass ()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\tvar a = $new ThisClassDoesNotExist()$;\n\t}\n}\n\";\n\t\t\tResolveResult result = Resolve (program);\n\t\t\tAssert.IsTrue (result.IsError);\n\t\t\tAssert.AreSame(SpecialType.UnknownType, result.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonExistingClassTypeName()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\tvar a = new $ThisClassDoesNotExist$();\n\t}\n}\n\";\n\t\t\tUnknownIdentifierResolveResult result = Resolve<UnknownIdentifierResolveResult>(program);\n\t\t\tAssert.AreEqual(\"ThisClassDoesNotExist\", result.Identifier);\n\t\t\tAssert.AreSame(SpecialType.UnknownType, result.Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CTorOverloadLookupTest()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t$;\n\t}\n\t\n\tstatic A() {}\n\tA() {}\n\tA(int intVal) {}\n\tA(double dblVal) {}\n}\n\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$new A()$\"));\n\t\t\tAssert.IsFalse(result.Member.IsStatic, \"new A() is static\");\n\t\t\tAssert.AreEqual(0, result.Member.Parameters.Count, \"new A() parameter count\");\n\t\t\tAssert.AreEqual(\"A\", result.Type.FullName);\n\t\t\t\n\t\t\tresult = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$new A(10)$\"));\n\t\t\tAssert.AreEqual(1, result.Member.Parameters.Count, \"new A(10) parameter count\");\n\t\t\tAssert.AreEqual(\"intVal\", result.Member.Parameters[0].Name, \"new A(10) parameter\");\n\t\t\t\n\t\t\tresult = Resolve<CSharpInvocationResolveResult>(program.Replace(\"$\", \"$new A(11.1)$\"));\n\t\t\tAssert.AreEqual(1, result.Member.Parameters.Count, \"new A(11.1) parameter count\");\n\t\t\tAssert.AreEqual(\"dblVal\", result.Member.Parameters[0].Name, \"new A(11.1) parameter\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefaultCTorOverloadLookupTest()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tvoid Method() {\n\t\t$new A()$;\n\t}\n}\n\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A\", result.Type.ReflectionName);\n\t\t\tAssert.AreEqual(0, result.Member.Parameters.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ChainedConstructorCall()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass A {\n\tpublic A(int a) {}\n}\nclass B : A {\n\tpublic B(int b)\n\t\t: base(b)\n \t{}\n}\nclass C : B {\n\tpublic C(int c)\n\t\t: base(c)\n \t{}\n \t\n \tpublic C()\n\t\t: this(0)\n \t{}\n}\n\";\n\t\t\tInvocationResolveResult mrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"base(b)\", \"$base(b)$\"));\n\t\t\tAssert.AreEqual(\"A..ctor\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"base(c)\", \"$base(c)$\"));\n\t\t\tAssert.AreEqual(\"B..ctor\", mrr.Member.FullName);\n\t\t\t\n\t\t\tmrr = Resolve<CSharpInvocationResolveResult>(program.Replace(\"this(0)\", \"$this(0)$\"));\n\t\t\tAssert.AreEqual(\"C..ctor\", mrr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FieldReferenceInObjectInitializer()\n\t\t{\n\t\t\tstring program = @\"class A {\n\tpublic int Property;\n}\nclass B {\n\tvoid Method() {\n\t\tvar x = new A() { $Property = 0$ };\n\t}\n}\";\n\t\t\tMemberResolveResult result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"A.Property\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FieldReferenceInNestedObjectInitializer()\n\t\t{\n\t\t\tstring program = @\"class Point { public float X, Y; }\nclass Rect { public Point TopLeft, BottomRight; }\nclass B {\n\tvoid Method() {\n\t\tvar x = new Rect() { TopLeft = { $X = 1$ } };\n\t}\n}\";\n\t\t\tMemberResolveResult result = Resolve<MemberResolveResult>(program);\n\t\t\tAssert.AreEqual(\"Point.X\", result.Member.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CollectionInitializerTest()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass B {\n\tvoid Method() {\n\t\tvar x = new List<int>() { ${ 0 }$ };\n\t}\n}\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List.Add\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DictionaryInitializerTest()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass B {\n\tvoid Method() {\n\t\tvar x = new Dictionary<char, int>() { ${ 'a', 0 }$ };\n\t}\n}\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.Dictionary.Add\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CanCallProtectedBaseConstructorInCtorInitializer()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A { protected A(int x) {} }\nclass B : A { public B(int y) : $base(y)$ { } }\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(result.IsError);\n\t\t\tAssert.AreEqual(\"A..ctor\", result.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CannotCallProtectedBaseConstructorAsNewObject()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A { protected A(int x) {} }\nclass B : A { public B(int y) { $new A(y)$; } }\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsTrue(result.IsError);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.Inaccessible, result.OverloadResolutionErrors);\n\t\t\tAssert.AreEqual(\"A..ctor\", result.Member.FullName); // should still find member even if it's not accessible\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CannotCallProtectedDerivedConstructorAsNewObject()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\nclass A { protected A(int x) { $new B(x)$; } }\nclass B : A { protected B(int y) {} }\";\n\t\t\tvar result = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsTrue(result.IsError);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.Inaccessible, result.OverloadResolutionErrors);\n\t\t\tAssert.AreEqual(\"B..ctor\", result.Member.FullName); // should still find member even if it's not accessible\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComplexObjectInitializer()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\nstruct Point { public int X, Y; }\nclass Test {\n\tpublic Point Pos;\n\tpublic List<string> List = new List<string>();\n\tpublic Dictionary<string, int> Dict = new Dictionary<string, int>();\n\t\n\tstatic object M() {\n\t\treturn $new Test {\n\t\t\tPos = { X = 1, Y = 2 },\n\t\t\tList = { \"\"Hello\"\", \"\"World\"\" },\n\t\t\tDict = { { \"\"A\"\", 1 } }\n\t\t}$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"Test..ctor\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(\"Test\", rr.Type.ReflectionName);\n\t\t\tAssert.AreEqual(5, rr.InitializerStatements.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CreateGeneric()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Test<T> where T : new() {\n\tobject x = $new T()$;\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(TypeKind.TypeParameter, rr.Type.Kind);\n\t\t\tAssert.AreEqual(TypeKind.TypeParameter, rr.Member.DeclaringType.Kind);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CreateDelegateFromMethodGroup()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D(int i);\nclass C {\n\tvoid M(int y) {\n\t\tD d = $new D(M)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Conversion.IsMethodGroupConversion);\n\t\t\t\n\t\t\tAssert.AreEqual(\"C.M\", rr.Conversion.Method.FullName);\n\t\t\tvar mgrr = (MethodGroupResolveResult)rr.Input;\n\t\t\tAssert.IsInstanceOf<ThisResolveResult>(mgrr.TargetResult);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CreateDelegateFromDelegate()\n\t\t{\n\t\t\tstring program = @\"using System;\ndelegate void D1(int i);\ndelegate void D2(int i);\nclass C {\n\tvoid M(D1 d1) {\n\t\tD2 d2 = $new D2(d1)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConversionResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Conversion.IsMethodGroupConversion);\n\t\t\tAssert.AreEqual(\"D1.Invoke\", rr.Conversion.Method.FullName);\n\t\t\tvar mgrr = (MethodGroupResolveResult)rr.Input;\n\t\t\tAssert.IsInstanceOf<LocalResolveResult>(mgrr.TargetResult);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/OverloadResolutionTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\n\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class OverloadResolutionTests : ResolverTestBase\n\t{\n\t\tResolveResult[] MakeArgumentList(params Type[] argumentTypes)\n\t\t{\n\t\t\treturn argumentTypes.Select(t => new ResolveResult(compilation.FindType(t))).ToArray();\n\t\t}\n\t\t\n\t\tIMethod MakeMethod(params object[] parameterTypesOrDefaultValues)\n\t\t{\n\t\t\tvar context = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\treturn (IMethod)MakeUnresolvedMethod(parameterTypesOrDefaultValues).CreateResolved(context);\n\t\t}\n\t\t\n\t\tDefaultUnresolvedMethod MakeUnresolvedMethod(params object[] parameterTypesOrDefaultValues)\n\t\t{\n\t\t\tvar m = new DefaultUnresolvedMethod();\n\t\t\tm.Name = \"Method\";\n\t\t\tforeach (var typeOrDefaultValue in parameterTypesOrDefaultValues) {\n\t\t\t\tType type = typeOrDefaultValue as Type;\n\t\t\t\tif (type != null)\n\t\t\t\t\tm.Parameters.Add(new DefaultUnresolvedParameter(type.ToTypeReference(), string.Empty));\n\t\t\t\telse if (Type.GetTypeCode(typeOrDefaultValue.GetType()) > TypeCode.Object)\n\t\t\t\t\tm.Parameters.Add(new DefaultUnresolvedParameter(typeOrDefaultValue.GetType().ToTypeReference(), string.Empty) {\n\t\t\t\t\t                 \tDefaultValue = new SimpleConstantValue(typeOrDefaultValue.GetType().ToTypeReference(), typeOrDefaultValue)\n\t\t\t\t\t                 });\n\t\t\t\telse\n\t\t\t\t\tthrow new ArgumentException(typeOrDefaultValue.ToString());\n\t\t\t}\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\tIMethod MakeParamsMethod(params object[] parameterTypesOrDefaultValues)\n\t\t{\n\t\t\tvar m = MakeUnresolvedMethod(parameterTypesOrDefaultValues);\n\t\t\t((DefaultUnresolvedParameter)m.Parameters.Last()).IsParams = true;\n\t\t\tvar context = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\treturn (IMethod)m.CreateResolved(context);\n\t\t}\n\t\t\n\t\tIUnresolvedParameter MakeOptionalParameter(ITypeReference type, string name)\n\t\t{\n\t\t\treturn new DefaultUnresolvedParameter(type, name) {\n\t\t\t\tDefaultValue = new SimpleConstantValue(type, null)\n\t\t\t};\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PreferIntOverUInt()\n\t\t{\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList(typeof(ushort)));\n\t\t\tvar c1 = MakeMethod(typeof(int));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(c1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeMethod(typeof(uint))));\n\t\t\tAssert.IsFalse(r.IsAmbiguous);\n\t\t\tAssert.AreSame(c1, r.BestCandidate);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PreferUIntOverLong_FromIntLiteral()\n\t\t{\n\t\t\tResolveResult[] args = { new ConstantResolveResult(compilation.FindType(KnownTypeCode.Int32), 1) };\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, args);\n\t\t\tvar c1 = MakeMethod(typeof(uint));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(c1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeMethod(typeof(long))));\n\t\t\tAssert.IsFalse(r.IsAmbiguous);\n\t\t\tAssert.AreSame(c1, r.BestCandidate);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NullableIntAndNullableUIntIsAmbiguous()\n\t\t{\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList(typeof(ushort?)));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeMethod(typeof(int?))));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeMethod(typeof(uint?))));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.AmbiguousMatch, r.BestCandidateErrors);\n\t\t\t\n\t\t\t// then adding a matching overload solves the ambiguity:\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeMethod(typeof(ushort?))));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.BestCandidateErrors);\n\t\t\tAssert.IsNull(r.BestCandidateAmbiguousWith);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsMethodMatchesEmptyArgumentList()\n\t\t{\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList());\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeParamsMethod(typeof(int[]))));\n\t\t\tAssert.IsTrue(r.BestCandidateIsExpandedForm);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsMethodMatchesOneArgumentInExpandedForm()\n\t\t{\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList(typeof(int)));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeParamsMethod(typeof(int[]))));\n\t\t\tAssert.IsTrue(r.BestCandidateIsExpandedForm);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsMethodMatchesInUnexpandedForm()\n\t\t{\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList(typeof(int[])));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeParamsMethod(typeof(int[]))));\n\t\t\tAssert.IsFalse(r.BestCandidateIsExpandedForm);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LessArgumentsPassedToParamsIsBetter()\n\t\t{\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList(typeof(int), typeof(int), typeof(int)));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeParamsMethod(typeof(int[]))));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(MakeParamsMethod(typeof(int), typeof(int[]))));\n\t\t\tAssert.IsFalse(r.IsAmbiguous);\n\t\t\tAssert.AreEqual(2, r.BestCandidate.Parameters.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CallInvalidParamsDeclaration()\n\t\t{\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList(typeof(int[,])));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.ArgumentTypeMismatch, r.AddCandidate(MakeParamsMethod(typeof(int))));\n\t\t\tAssert.IsFalse(r.BestCandidateIsExpandedForm);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PreferMethodWithoutOptionalParameters()\n\t\t{\n\t\t\tvar m1 = MakeMethod();\n\t\t\tvar m2 = MakeMethod(1);\n\t\t\t\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, MakeArgumentList());\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m2));\n\t\t\tAssert.IsFalse(r.IsAmbiguous);\n\t\t\tAssert.AreSame(m1, r.BestCandidate);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SkeetEvilOverloadResolution()\n\t\t{\n\t\t\t// http://msmvps.com/blogs/jon_skeet/archive/2010/11/02/evil-code-overload-resolution-workaround.aspx\n\t\t\t\n\t\t\t// static void Foo<T>(T? ignored = default(T?)) where T : struct\n\t\t\tvar m1 = MakeUnresolvedMethod();\n\t\t\tm1.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.Method, 0, \"T\") { HasValueTypeConstraint = true });\n\t\t\tm1.Parameters.Add(MakeOptionalParameter(\n\t\t\t\tNullableType.Create(new TypeParameterReference(SymbolKind.Method, 0)),\n\t\t\t\t\"ignored\"\n\t\t\t));\n\t\t\t\n\t\t\t// class ClassConstraint<T> where T : class {}\n\t\t\tvar classConstraint = new DefaultUnresolvedTypeDefinition(string.Empty, \"ClassConstraint\");\n\t\t\tclassConstraint.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"T\") { HasReferenceTypeConstraint = true });\n\t\t\t\n\t\t\t// static void Foo<T>(ClassConstraint<T> ignored = default(ClassConstraint<T>))\n\t\t\t// where T : class\n\t\t\tvar m2 = MakeUnresolvedMethod();\n\t\t\tm2.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.Method, 0, \"T\") { HasReferenceTypeConstraint = true });\n\t\t\tm2.Parameters.Add(MakeOptionalParameter(\n\t\t\t\tnew ParameterizedTypeReference(classConstraint, new[] { new TypeParameterReference(SymbolKind.Method, 0) }),\n\t\t\t\t\"ignored\"\n\t\t\t));\n\t\t\t\n\t\t\t// static void Foo<T>()\n\t\t\tvar m3 = MakeUnresolvedMethod();\n\t\t\tm3.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.Method, 0, \"T\"));\n\t\t\t\n\t\t\tICompilation compilation = TypeSystemHelper.CreateCompilation(classConstraint);\n\t\t\tvar context = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\tIMethod resolvedM1 = (IMethod)m1.CreateResolved(context);\n\t\t\tIMethod resolvedM2 = (IMethod)m2.CreateResolved(context);\n\t\t\tIMethod resolvedM3 = (IMethod)m3.CreateResolved(context);\n\t\t\t\n\t\t\t// Call: Foo<int>();\n\t\t\tOverloadResolution o;\n\t\t\to = new OverloadResolution(compilation, new ResolveResult[0], typeArguments: new[] { compilation.FindType(typeof(int)) });\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, o.AddCandidate(resolvedM1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.ConstructedTypeDoesNotSatisfyConstraint, o.AddCandidate(resolvedM2));\n\t\t\tAssert.AreSame(resolvedM1, o.BestCandidate);\n\t\t\t\n\t\t\t// Call: Foo<string>();\n\t\t\to = new OverloadResolution(compilation, new ResolveResult[0], typeArguments: new[] { compilation.FindType(typeof(string)) });\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.ConstructedTypeDoesNotSatisfyConstraint, o.AddCandidate(resolvedM1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, o.AddCandidate(resolvedM2));\n\t\t\tAssert.AreSame(resolvedM2, o.BestCandidate);\n\t\t\t\n\t\t\t// Call: Foo<int?>();\n\t\t\to = new OverloadResolution(compilation, new ResolveResult[0], typeArguments: new[] { compilation.FindType(typeof(int?)) });\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.ConstructedTypeDoesNotSatisfyConstraint, o.AddCandidate(resolvedM1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.ConstructedTypeDoesNotSatisfyConstraint, o.AddCandidate(resolvedM2));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, o.AddCandidate(resolvedM3));\n\t\t\tAssert.AreSame(resolvedM3, o.BestCandidate);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// A lambda of the form \"() => default(returnType)\"\n\t\t/// </summary>\n\t\tclass MockLambda : LambdaResolveResult\n\t\t{\n\t\t\tIType inferredReturnType;\n\t\t\tList<IParameter> parameters = new List<IParameter>();\n\t\t\t\n\t\t\tpublic MockLambda(IType returnType)\n\t\t\t{\n\t\t\t\tthis.inferredReturnType = returnType;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IList<IParameter> Parameters {\n\t\t\t\tget { return parameters; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Conversion IsValid(IType[] parameterTypes, IType returnType, CSharpConversions conversions)\n\t\t\t{\n\t\t\t\treturn conversions.ImplicitConversion(inferredReturnType, returnType);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicitlyTyped {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAnonymousMethod {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasParameterList {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAsync {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ResolveResult Body {\n\t\t\t\tget { throw new NotImplementedException(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType ReturnType {\n\t\t\t\tget { throw new NotImplementedException(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType GetInferredReturnType(IType[] parameterTypes)\n\t\t\t{\n\t\t\t\treturn inferredReturnType;\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BetterConversionByLambdaReturnValue()\n\t\t{\n\t\t\tvar m1 = MakeMethod(typeof(Func<long>));\n\t\t\tvar m2 = MakeMethod(typeof(Func<int>));\n\t\t\t\n\t\t\t// M(() => default(byte));\n\t\t\tResolveResult[] args = {\n\t\t\t\tnew MockLambda(compilation.FindType(KnownTypeCode.Byte))\n\t\t\t};\n\t\t\t\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, args);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m2));\n\t\t\tAssert.AreSame(m2, r.BestCandidate);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.BestCandidateErrors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BetterConversionByLambdaReturnValue_ExpressionTree()\n\t\t{\n\t\t\tvar m1 = MakeMethod(typeof(Func<long>));\n\t\t\tvar m2 = MakeMethod(typeof(Expression<Func<int>>));\n\t\t\t\n\t\t\t// M(() => default(byte));\n\t\t\tResolveResult[] args = {\n\t\t\t\tnew MockLambda(compilation.FindType(KnownTypeCode.Byte))\n\t\t\t};\n\t\t\t\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, args);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m2));\n\t\t\tAssert.AreSame(m2, r.BestCandidate);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.BestCandidateErrors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Lambda_DelegateAndExpressionTreeOverloadsAreAmbiguous()\n\t\t{\n\t\t\tvar m1 = MakeMethod(typeof(Func<int>));\n\t\t\tvar m2 = MakeMethod(typeof(Expression<Func<int>>));\n\t\t\t\n\t\t\t// M(() => default(int));\n\t\t\tResolveResult[] args = {\n\t\t\t\tnew MockLambda(compilation.FindType(KnownTypeCode.Int32))\n\t\t\t};\n\t\t\t\n\t\t\tOverloadResolution r = new OverloadResolution(compilation, args);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m1));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.None, r.AddCandidate(m2));\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.AmbiguousMatch, r.BestCandidateErrors);\n\t\t}\n\t\t\n\t\t[Test, Ignore(\"Overload Resolution bug\")]\n\t\tpublic void BetterFunctionMemberIsNotTransitive()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass Program\n{\n\tstatic void Method(Action<string> a) {}\n\tstatic void Method<T>(Func<string, T> a) {}\n\tstatic void Method(Action<object> a) {}\n\tstatic void Method<T>(Func<object, T> a) {}\n\t\n\tpublic static void Main(string[] args)\n\t{\n\t        $Method(a => a.ToString())$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(OverloadResolutionErrors.AmbiguousMatch, rr.OverloadResolutionErrors);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ResolveAtLocationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class ResolveAtLocationTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void UsingDeclaration()\n\t\t{\n\t\t\tAssert.IsNull(ResolveAtLocation(\"usi$ng System;\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InsideClassBody()\n\t\t{\n\t\t\tAssert.IsNull(ResolveAtLocation(\"class Test { $ }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UsingDeclarationNamespace()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<NamespaceResolveResult>(\"using $System;\");\n\t\t\tAssert.AreEqual(\"System\", rr.NamespaceName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CatchClauseVariable()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<LocalResolveResult>(\"using System; public class A { void M() { try { } catch (Exception e$x) { } } }\");\n\t\t\tAssert.AreEqual(\"ex\", rr.Variable.Name);\n\t\t\tAssert.AreEqual(\"System.Exception\", rr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodInvocation()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<CSharpInvocationResolveResult>(@\"using System;\nclass A { void M() {\n\tConsole.W$riteLine(1);\n}}\");\n\t\t\tAssert.AreEqual(\"System.Console.WriteLine\", rr.Member.FullName);\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Member.Parameters[0].Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitlyTypedVariable()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<TypeResolveResult>(@\"using System;\nclass A { void M() {\n\tv$ar x = Environment.TickCount;\n}}\");\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseCtorCall()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<CSharpInvocationResolveResult>(@\"using System;\nclass A { public A() : ba$se() {} }\");\n\t\t\tAssert.AreEqual(\"System.Object..ctor\", rr.Member.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Field()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\"public class A { int te$st; }\");\n\t\t\tAssert.AreEqual(\"test\", rr.Member.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Field1InLineWithTwoFields()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\"public class A { int te$st, test2; }\");\n\t\t\tAssert.AreEqual(\"test\", rr.Member.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Field2InLineWithTwoFields()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\"public class A { int test, te$st2; }\");\n\t\t\tAssert.AreEqual(\"test2\", rr.Member.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Event()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\"public class A { event EventHandler Te$st; }\");\n\t\t\tAssert.AreEqual(\"Test\", rr.Member.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Event1InLineWithTwoEvents()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\"public class A { event EventHandler Te$st, Test2; }\");\n\t\t\tAssert.AreEqual(\"Test\", rr.Member.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Event2InLineWithTwoEvents()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\"public class A { event EventHandler Test, Te$st2; }\");\n\t\t\tAssert.AreEqual(\"Test2\", rr.Member.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Indexer()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<CSharpInvocationResolveResult>(\n\t\t\t\t\"using System.Collections.Generic;\" +\n\t\t\t\t\"public class A { int M(List<int> a) { return a$[1]; } }\");\n\t\t\tAssert.AreEqual(SymbolKind.Indexer, rr.Member.SymbolKind);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug5114()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\n\t\t\t\t@\"using System;\n\nnamespace Bug5114 \n{\n\tclass Test\n\t{\n\t\tTest oLongPressRecognizer;\n\n\t\tpublic void AddTarget (Action target)\n\t\t{}\n\n\t\tpublic void HandleLongPressGesture ()\n\t\t{\n\t\t}\n\n\t\tpublic Test ()\n\t\t{\n\t\t\tthis.oLongPressRecognizer.AddTarget (this.$HandleLongPressGesture);\n\t\t}\n\t}\n}\n\");\n\t\t\tAssert.AreEqual(\"HandleLongPressGesture\", rr.Member.Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ArrayInitializer()\n\t\t{\n\t\t\tAssert.IsNull(ResolveAtLocation(\n@\"using System.Collections.Generic;\nclass Foo { \n\tvoid Bar() \n\t{\n\t\tvar o = new Dictionary<int,int> () { \n\t\t\t{1$, 2 },\n\t\t\t{1, 2 },\n\t\t\t{1, 2 },\n\t\t\t{1, 2 }\n\t\t}; \n\t} \n}\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug6758()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<TypeResolveResult>(\n\t\t\t\t@\"using System;                                                                   \n\nnamespace TestCrash                                                             \n{                                                                               \n        class A                                                                 \n        {                                                                       \n\n        }                                                                       \n\n        class B<T> : T where T: $A                                               \n        {                                                                       \n\n        }                                                                       \n}\n\");\n\t\t\tAssert.AreEqual(\"A\", rr.Type.Name);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void CreateDelegateFromOverloadedMethod()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\n\t\t\t\t@\"using System;                                                                   \nclass Test {\n\tpublic void Method() {}\n\tpublic void Method(int a) {}\n\t\n\tpublic Test() {\n\t\tAction a = Meth$od;\n\t}\n}\n\");\n\t\t\tAssert.AreEqual(\"Method\", rr.Member.Name);\n\t\t\tAssert.AreEqual(0, ((IMethod)rr.Member).Parameters.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitlyCreateDelegateFromOverloadedMethod()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\n\t\t\t\t@\"using System;                                                                   \nclass Test {\n\tpublic void Method() {}\n\tpublic void Method(int a) {}\n\t\n\tpublic Test() {\n\t\tAction a = new Action(Meth$od);\n\t}\n}\n\");\n\t\t\tAssert.AreEqual(\"Method\", rr.Member.Name);\n\t\t\tAssert.AreEqual(0, ((IMethod)rr.Member).Parameters.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MemberTypeTarget()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<TypeResolveResult>(\n\t\t\t\t@\"using System;                                                                   \nclass Test {\n\tE$nvironment.SpecialFolder folder;\n}\n\");\n\t\t\tAssert.AreEqual(\"System.Environment\", rr.Type.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexer()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<MemberResolveResult>(\n\t\t\t\t@\"using System;\nclass Test {\n\tpublic int $this[int index] { get { return 1; } }\n}\n\");\n\t\t\tAssert.AreEqual(\"Test.Item\", rr.Member.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUserDefinedOperator()\n\t\t{\n\t\t\tvar rr = ResolveAtLocation<OperatorResolveResult>(\n\t\t\t\t@\"class Foo \n{\n\tpublic static Foo operator+(Foo a, Foo b)\n\t{\n\t\treturn a;\n\t}\n}\n\nclass MainClass\n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tFoo f = new Foo () $+ new Foo ();\n\t}\n}\n\");\n\t\t\tAssert.AreEqual(\"Foo.op_Addition\", rr.UserDefinedOperatorMethod.FullName);\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void PragmaWarningID()\n\t\t{\n\t\t\tResolveAtLocation(@\"#pragma warning disable 1$0\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ResolverTestBase.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp.Parser;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t/// <summary>\n\t/// Base class with helper functions for resolver unit tests.\n\t/// </summary>\n\tpublic abstract class ResolverTestBase\n\t{\n\t\tprotected readonly IUnresolvedAssembly mscorlib = CecilLoaderTests.Mscorlib;\n\t\tprotected IProjectContent project;\n\t\tprotected ICompilation compilation;\n\t\t\n\t\t[SetUp]\n\t\tpublic virtual void SetUp()\n\t\t{\n\t\t\tproject = new CSharpProjectContent().AddAssemblyReferences(new [] { mscorlib, CecilLoaderTests.SystemCore });\n\t\t\tcompilation = project.CreateCompilation();\n\t\t}\n\t\t\n\t\tprotected IType ResolveType(Type type)\n\t\t{\n\t\t\tIType t = compilation.FindType(type);\n\t\t\tif (t.Kind == TypeKind.Unknown)\n\t\t\t\tthrow new InvalidOperationException(\"Could not resolve type\");\n\t\t\treturn t;\n\t\t}\n\t\t\n\t\tprotected ConstantResolveResult MakeConstant(object value)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\treturn new ConstantResolveResult(SpecialType.NullType, null);\n\t\t\tIType type = ResolveType(value.GetType());\n\t\t\tif (type.Kind == TypeKind.Enum)\n\t\t\t\tvalue = Convert.ChangeType(value, Enum.GetUnderlyingType(value.GetType()));\n\t\t\treturn new ConstantResolveResult(type, value);\n\t\t}\n\t\t\n\t\tprotected ResolveResult MakeResult(Type type)\n\t\t{\n\t\t\treturn new ResolveResult(ResolveType(type));\n\t\t}\n\t\t\n\t\tprotected static TypeOrNamespaceReference MakeReference(string namespaceName)\n\t\t{\n\t\t\tstring[] nameParts = namespaceName.Split('.');\n\t\t\tTypeOrNamespaceReference r = new SimpleTypeOrNamespaceReference(nameParts[0], new ITypeReference[0], NameLookupMode.TypeInUsingDeclaration);\n\t\t\tfor (int i = 1; i < nameParts.Length; i++) {\n\t\t\t\tr = new MemberTypeOrNamespaceReference(r, nameParts[i], new ITypeReference[0]);\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\t\t\n\t\tprotected void AssertConstant(object expectedValue, ResolveResult rr)\n\t\t{\n\t\t\tAssert.IsFalse(rr.IsError, rr.ToString() + \" is an error\");\n\t\t\tAssert.IsTrue(rr.IsCompileTimeConstant, rr.ToString() + \" is not a compile-time constant\");\n\t\t\tType expectedType = expectedValue.GetType();\n\t\t\tAssert.AreEqual(ResolveType(expectedType), rr.Type, \"ResolveResult.Type is wrong\");\n\t\t\tif (expectedType.IsEnum) {\n\t\t\t\tAssert.AreEqual(Enum.GetUnderlyingType(expectedType), rr.ConstantValue.GetType(), \"ResolveResult.ConstantValue has wrong Type\");\n\t\t\t\tAssert.AreEqual(Convert.ChangeType(expectedValue, Enum.GetUnderlyingType(expectedType)), rr.ConstantValue);\n\t\t\t} else {\n\t\t\t\tAssert.AreEqual(expectedType, rr.ConstantValue.GetType(), \"ResolveResult.ConstantValue has wrong Type\");\n\t\t\t\tAssert.AreEqual(expectedValue, rr.ConstantValue);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected void AssertType(Type expectedType, ResolveResult rr)\n\t\t{\n\t\t\tAssert.IsFalse(rr.IsError, rr.ToString() + \" is an error\");\n\t\t\tAssert.IsFalse(rr.IsCompileTimeConstant, rr.ToString() + \" is a compile-time constant\");\n\t\t\tAssert.AreEqual(compilation.FindType(expectedType), rr.Type);\n\t\t}\n\t\t\n\t\tprotected void AssertError(Type expectedType, ResolveResult rr)\n\t\t{\n\t\t\tAssert.IsTrue(rr.IsError, rr.ToString() + \" is not an error, but an error was expected\");\n\t\t\tAssert.IsFalse(rr.IsCompileTimeConstant, rr.ToString() + \" is a compile-time constant\");\n\t\t\tAssert.AreEqual(compilation.FindType(expectedType), rr.Type);\n\t\t}\n\t\t\n\t\tprotected void TestOperator(UnaryOperatorType op, ResolveResult input,\n\t\t                            Conversion expectedConversion, Type expectedResultType)\n\t\t{\n\t\t\tCSharpResolver resolver = new CSharpResolver(compilation);\n\t\t\tvar rr = resolver.ResolveUnaryOperator(op, input);\n\t\t\tAssertType(expectedResultType, rr);\n\t\t\tAssert.AreEqual(typeof(OperatorResolveResult), rr.GetType());\n\t\t\tvar uorr = (OperatorResolveResult)rr;\n\t\t\tAssertConversion(uorr.Operands[0], input, expectedConversion, \"Conversion\");\n\t\t}\n\t\t\n\t\tprotected void TestOperator(ResolveResult lhs, BinaryOperatorType op, ResolveResult rhs,\n\t\t                            Conversion expectedLeftConversion, Conversion expectedRightConversion, Type expectedResultType)\n\t\t{\n\t\t\tCSharpResolver resolver = new CSharpResolver(compilation);\n\t\t\tvar rr = resolver.ResolveBinaryOperator(op, lhs, rhs);\n\t\t\tAssertType(expectedResultType, rr);\n\t\t\tAssert.AreEqual(typeof(OperatorResolveResult), rr.GetType());\n\t\t\tvar borr = (OperatorResolveResult)rr;\n\t\t\tAssertConversion(borr.Operands[0], lhs, expectedLeftConversion, \"Left conversion\");\n\t\t\tAssertConversion(borr.Operands[1], rhs, expectedRightConversion, \"Right conversion\");\n\t\t}\n\t\t\n\t\tprotected void AssertConversion(ResolveResult conversionResult, ResolveResult expectedRR, Conversion expectedConversion, string text)\n\t\t{\n\t\t\tif (expectedConversion == Conversion.IdentityConversion) {\n\t\t\t\tAssert.AreSame(expectedRR, conversionResult, \"Expected no \" + text);\n\t\t\t} else {\n\t\t\t\tConversionResolveResult crr = conversionResult as ConversionResolveResult;\n\t\t\t\tAssert.IsNotNull(crr, \"Could not find ConversionResolveResult for \" + text);\n\t\t\t\tAssert.AreEqual(expectedConversion, crr.Conversion, text);\n\t\t\t\tAssert.AreSame(expectedRR, crr.Input, \"Input of \" + text);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected IEnumerable<TextLocation> FindDollarSigns(string code)\n\t\t{\n\t\t\tint line = 1;\n\t\t\tint col = 1;\n\t\t\tforeach (char c in code) {\n\t\t\t\tif (c == '$') {\n\t\t\t\t\tyield return new TextLocation(line, col);\n\t\t\t\t} else if (c == '\\n') {\n\t\t\t\t\tline++;\n\t\t\t\t\tcol = 1;\n\t\t\t\t} else {\n\t\t\t\t\tcol++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected Tuple<CSharpAstResolver, AstNode> PrepareResolver(string code)\n\t\t{\n\t\t\tSyntaxTree syntaxTree = new CSharpParser().Parse(code.Replace(\"$\", \"\"), \"code.cs\");\n\t\t\t\n\t\t\tTextLocation[] dollars = FindDollarSigns(code).ToArray();\n\t\t\tAssert.AreEqual(2, dollars.Length, \"Expected 2 dollar signs marking start+end of desired node\");\n\t\t\t\n\t\t\tSetUp();\n\t\t\t\n\t\t\tCSharpUnresolvedFile unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tproject = project.AddOrUpdateFiles(unresolvedFile);\n\t\t\tcompilation = project.CreateCompilation();\n\t\t\t\n\t\t\tCSharpAstResolver resolver = new CSharpAstResolver(compilation, syntaxTree, unresolvedFile);\n\t\t\treturn Tuple.Create(resolver, FindNode(syntaxTree, dollars[0], dollars[1]));\n\t\t}\n\t\t\n\t\tprotected ResolveResult Resolve(string code)\n\t\t{\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\tDebug.WriteLine(new string('=', 70));\n\t\t\tDebug.WriteLine(\"Starting new resolver for \" + prep.Item2);\n\t\t\t\n\t\t\tResolveResult rr = prep.Item1.Resolve(prep.Item2);\n\t\t\tAssert.IsNotNull(rr, \"ResolveResult is null - did something go wrong while navigating to the target node?\");\n\t\t\tDebug.WriteLine(\"ResolveResult is \" + rr);\n\t\t\treturn rr;\n\t\t}\n\t\t\n\t\tprotected Conversion GetConversion(string code)\n\t\t{\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\treturn prep.Item1.GetConversion((Expression)prep.Item2);\n\t\t}\n\t\t\n\t\tprotected IType GetExpectedType(string code)\n\t\t{\n\t\t\tvar prep = PrepareResolver(code);\n\t\t\treturn prep.Item1.GetExpectedType((Expression)prep.Item2);\n\t\t}\n\t\t\n\t\tprotected T Resolve<T>(string code) where T : ResolveResult\n\t\t{\n\t\t\tResolveResult rr = Resolve(code);\n\t\t\tAssert.IsNotNull(rr);\n\t\t\t// Find most specific public type:\n\t\t\tType rrType = rr.GetType();\n\t\t\twhile (!rrType.IsPublic)\n\t\t\t\trrType = rrType.BaseType;\n\t\t\t\n\t\t\tAssert.IsTrue(rrType == typeof(T), \"Resolve should be \" + typeof(T).Name + \", but was \" + rr.GetType().Name);\n\t\t\treturn (T)rr;\n\t\t}\n\t\t\n\t\tprotected AstNode FindNode(SyntaxTree syntaxTree, TextLocation start, TextLocation end)\n\t\t{\n\t\t\tFindNodeVisitor fnv = new FindNodeVisitor(start, end);\n\t\t\tsyntaxTree.AcceptVisitor(fnv);\n\t\t\tAssert.IsNotNull(fnv.ResultNode, \"Did not find DOM node at the specified location\");\n\t\t\treturn fnv.ResultNode;\n\t\t}\n\t\t\n\t\tsealed class FindNodeVisitor : DepthFirstAstVisitor\n\t\t{\n\t\t\treadonly TextLocation start;\n\t\t\treadonly TextLocation end;\n\t\t\tpublic AstNode ResultNode;\n\t\t\t\n\t\t\tpublic FindNodeVisitor(TextLocation start, TextLocation end)\n\t\t\t{\n\t\t\t\tthis.start = start;\n\t\t\t\tthis.end = end;\n\t\t\t}\n\t\t\t\n\t\t\tprotected override void VisitChildren(AstNode node)\n\t\t\t{\n\t\t\t\tif (node.StartLocation == start && node.EndLocation == end) {\n\t\t\t\t\tif (ResultNode != null)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"found multiple nodes with same start+end\");\n\t\t\t\t\tResultNode = node;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbase.VisitChildren(node);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected ResolveResult ResolveAtLocation(string code)\n\t\t{\n\t\t\tSyntaxTree syntaxTree = SyntaxTree.Parse(code.Replace(\"$\", \"\"), \"test.cs\");\n\t\t\t\n\t\t\tTextLocation[] dollars = FindDollarSigns(code).ToArray();\n\t\t\tAssert.AreEqual(1, dollars.Length, \"Expected 1 dollar signs marking the location\");\n\t\t\t\n\t\t\tSetUp();\n\t\t\t\n\t\t\tCSharpUnresolvedFile unresolvedFile = syntaxTree.ToTypeSystem();\n\t\t\tproject = project.AddOrUpdateFiles(unresolvedFile);\n\t\t\tcompilation = project.CreateCompilation();\n\t\t\t\n\t\t\tResolveResult rr = Resolver.ResolveAtLocation.Resolve(compilation, unresolvedFile, syntaxTree, dollars[0]);\n\t\t\treturn rr;\n\t\t}\n\t\t\n\t\tprotected T ResolveAtLocation<T>(string code) where T : ResolveResult\n\t\t{\n\t\t\tResolveResult rr = ResolveAtLocation(code);\n\t\t\tAssert.IsNotNull(rr);\n\t\t\tAssert.IsTrue(rr.GetType() == typeof(T), \"Resolve should be \" + typeof(T).Name + \", but was \" + rr.GetType().Name);\n\t\t\treturn (T)rr;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/SizeOfTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class SizeOfTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void SizeOfPrimitiveTypes()\n\t\t{\n\t\t\tforeach (var t in new[] { new { t = \"sbyte\", n = 1 },\n\t\t\t                          new { t = \"byte\", n = 1 },\n\t\t\t                          new { t = \"short\", n = 2 },\n\t\t\t                          new { t = \"ushort\", n = 2 },\n\t\t\t                          new { t = \"int\", n = 4 },\n\t\t\t                          new { t = \"uint\", n = 4 },\n\t\t\t                          new { t = \"long\", n = 8 },\n\t\t\t                          new { t = \"ulong\", n = 8 },\n\t\t\t                          new { t = \"char\", n = 2 },\n\t\t\t                          new { t = \"float\", n = 4 },\n\t\t\t                          new { t = \"double\", n = 8 },\n\t\t\t                          new { t = \"bool\", n = 1 }\n\t\t\t        }) {\n\t\t\t\tstring program = @\"using System;\n\t\t\t\t\tclass TestClass {\n\t\t\t\t\t\tstatic void Main() {\n\t\t\t\t\t\t\tpublic int s = $sizeof(\" + t.t + @\")$;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\";\n\t\t\t\tvar rr = Resolve<SizeOfResolveResult>(program);\n\t\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\t\tAssert.AreEqual(t.n, rr.ConstantValue);\n\t\t\t\tAssert.IsTrue(Type.GetType(rr.ReferencedType.FullName).IsPrimitive);\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SizeOfEnum()\n\t\t{\n\t\t\tstring program = @\"\nenum TestEnum {}\nclass TestClass {\n\tstatic void Main() {\n\t\tint s = $sizeof(TestEnum)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<SizeOfResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(4, rr.ConstantValue);\n\t\t\tAssert.AreEqual(\"TestEnum\", rr.ReferencedType.Name);\n\n\t\t\tprogram = @\"\nenum TestEnum2 : short {}\nclass TestClass {\n\tstatic void Main() {\n\t\tint s = $sizeof(TestEnum2)$;\n\t}\n}\";\n\t\t\trr = Resolve<SizeOfResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(2, rr.ConstantValue);\n\t\t\tAssert.AreEqual(\"TestEnum2\", rr.ReferencedType.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SizeOfStructIsNotAConstant()\n\t\t{\n\t\t\tstring program = @\"\nstruct MyStruct {}\nclass TestClass {\n\tstatic void Main() {\n\t\tint s = $sizeof(MyStruct)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<SizeOfResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsNull(rr.ConstantValue);\n\t\t\tAssert.AreEqual(\"MyStruct\", rr.ReferencedType.Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SizeOfReferenceTypeIsAnError() {\n\t\t\tstring program = @\"\nclass MyClass {}\nclass TestClass {\n\tstatic void Main() {\n\t\tint s = $sizeof(MyClass)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<SizeOfResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.IsNull(rr.ConstantValue);\n\t\t\tAssert.AreEqual(\"MyClass\", rr.ReferencedType.Name);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/TypeInferenceTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class TypeInferenceTests : ResolverTestBase\n\t{\n\t\tTypeInference ti;\n\t\t\n\t\t[SetUp]\n\t\tpublic void Setup()\n\t\t{\n\t\t\tti = new TypeInference(compilation);\n\t\t}\n\t\t\n\t\t#region Type Inference\n\t\tIType[] Resolve(params Type[] types)\n\t\t{\n\t\t\tIType[] r = new IType[types.Length];\n\t\t\tfor (int i = 0; i < types.Length; i++) {\n\t\t\t\tr[i] = compilation.FindType(types[i]);\n\t\t\t\tAssert.AreNotSame(r[i], SpecialType.UnknownType);\n\t\t\t}\n\t\t\tArray.Sort(r, (a,b)=>a.ReflectionName.CompareTo(b.ReflectionName));\n\t\t\treturn r;\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayToEnumerable()\n\t\t{\n\t\t\tITypeParameter tp = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"T\");\n\t\t\tIType stringType = compilation.FindType(KnownTypeCode.String);\n\t\t\tITypeDefinition enumerableType = compilation.FindType(KnownTypeCode.IEnumerableOfT).GetDefinition();\n\t\t\t\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { stringType },\n\t\t\t\tti.InferTypeArguments(new [] { tp },\n\t\t\t\t                      new [] { new ResolveResult(new ArrayType(compilation, stringType)) },\n\t\t\t\t                      new [] { new ParameterizedType(enumerableType, new [] { tp }) },\n\t\t\t\t                      out success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayToReadOnlyList()\n\t\t{\n\t\t\tITypeParameter tp = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"T\");\n\t\t\tIType stringType = compilation.FindType(KnownTypeCode.String);\n\t\t\tITypeDefinition readOnlyListType = compilation.FindType(KnownTypeCode.IReadOnlyListOfT).GetDefinition();\n\t\t\tif (readOnlyListType == null)\n\t\t\t\tAssert.Ignore(\".NET 4.5 IReadOnlyList not available\");\n\t\t\t\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { stringType },\n\t\t\t\tti.InferTypeArguments(new [] { tp },\n\t\t\t\t                      new [] { new ResolveResult(new ArrayType(compilation, stringType)) },\n\t\t\t\t                      new [] { new ParameterizedType(readOnlyListType, new [] { tp }) },\n\t\t\t\t                      out success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumerableToArrayInContravariantType()\n\t\t{\n\t\t\tITypeParameter tp = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"T\");\n\t\t\tIType stringType = compilation.FindType(KnownTypeCode.String);\n\t\t\tITypeDefinition enumerableType = compilation.FindType(typeof(IEnumerable<>)).GetDefinition();\n\t\t\tITypeDefinition comparerType = compilation.FindType(typeof(IComparer<>)).GetDefinition();\n\t\t\t\n\t\t\tvar comparerOfIEnumerableOfString = new ParameterizedType(comparerType, new [] { new ParameterizedType(enumerableType, new [] { stringType } ) });\n\t\t\tvar comparerOfTpArray = new ParameterizedType(comparerType, new [] { new ArrayType(compilation, tp) });\n\t\t\t\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { stringType },\n\t\t\t\tti.InferTypeArguments(new [] { tp },\n\t\t\t\t                      new [] { new ResolveResult(comparerOfIEnumerableOfString) },\n\t\t\t\t                      new [] { comparerOfTpArray },\n\t\t\t\t                      out success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InferFromObjectAndFromNullLiteral()\n\t\t{\n\t\t\t// M<T>(T a, T b);\n\t\t\tITypeParameter tp = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"T\");\n\t\t\t\n\t\t\t// M(new object(), null);\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { compilation.FindType(KnownTypeCode.Object) },\n\t\t\t\tti.InferTypeArguments(new [] { tp },\n\t\t\t\t                      new [] { new ResolveResult(compilation.FindType(KnownTypeCode.Object)), new ResolveResult(SpecialType.NullType) },\n\t\t\t\t                      new [] { tp, tp },\n\t\t\t\t                      out success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayToListWithArrayCovariance()\n\t\t{\n\t\t\tITypeParameter tp = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"T\");\n\t\t\tIType objectType = compilation.FindType(KnownTypeCode.Object);\n\t\t\tIType stringType = compilation.FindType(KnownTypeCode.String);\n\t\t\tITypeDefinition listType = compilation.FindType(KnownTypeCode.IListOfT).GetDefinition();\n\t\t\t\n\t\t\t// void M<T>(IList<T> a, T b);\n\t\t\t// M(new string[0], new object());\n\t\t\t\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { objectType },\n\t\t\t\tti.InferTypeArguments(\n\t\t\t\t\tnew [] { tp },\n\t\t\t\t\tnew [] { new ResolveResult(new ArrayType(compilation, stringType)), new ResolveResult(objectType) },\n\t\t\t\t\tnew [] { new ParameterizedType(listType, new [] { tp }), (IType)tp },\n\t\t\t\t\tout success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IEnumerableCovarianceWithDynamic()\n\t\t{\n\t\t\tITypeParameter tp = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"T\");\n\t\t\tvar ienumerableOfT = new ParameterizedType(compilation.FindType(typeof(IEnumerable<>)).GetDefinition(), new[] { tp });\n\t\t\tvar ienumerableOfString = compilation.FindType(typeof(IEnumerable<string>));\n\t\t\tvar ienumerableOfDynamic = compilation.FindType(typeof(IEnumerable<ReflectionHelper.Dynamic>));\n\t\t\t\n\t\t\t// static T M<T>(IEnumerable<T> x, IEnumerable<T> y) {}\n\t\t\t// M(IEnumerable<dynamic>, IEnumerable<string>); -> should infer T=dynamic, no ambiguity\n\t\t\t// See http://blogs.msdn.com/b/cburrows/archive/2010/04/01/errata-dynamic-conversions-and-overload-resolution.aspx\n\t\t\t// for details.\n\t\t\t\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { SpecialType.Dynamic },\n\t\t\t\tti.InferTypeArguments(\n\t\t\t\t\tnew [] { tp },\n\t\t\t\t\tnew [] { new ResolveResult(ienumerableOfDynamic), new ResolveResult(ienumerableOfString) },\n\t\t\t\t\tnew [] { ienumerableOfT, ienumerableOfT },\n\t\t\t\t\tout success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Inference with Method Groups\n\t\t[Test]\n\t\tpublic void CannotInferFromMethodParameterTypes()\n\t\t{\n\t\t\t// static void M<A, B>(Func<A, B> f) {}\n\t\t\t// M(int.Parse); // type inference fails\n\t\t\tvar A = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"A\");\n\t\t\tvar B = new DefaultTypeParameter(compilation, SymbolKind.Method, 1, \"B\");\n\t\t\t\n\t\t\tIType declType = compilation.FindType(typeof(int));\n\t\t\tvar methods = new MethodListWithDeclaringType(declType, declType.GetMethods(m => m.Name == \"Parse\"));\n\t\t\tvar argument = new MethodGroupResolveResult(new TypeResolveResult(declType), \"Parse\", new[] { methods }, new IType[0]);\n\t\t\t\n\t\t\tbool success;\n\t\t\tti.InferTypeArguments(new [] { A, B }, new [] { argument },\n\t\t\t                      new [] { new ParameterizedType(compilation.FindType(typeof(Func<,>)).GetDefinition(), new[] { A, B }) },\n\t\t\t                      out success);\n\t\t\tAssert.IsFalse(success);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InferFromMethodReturnType()\n\t\t{\n\t\t\t// static void M<T>(Func<T> f) {}\n\t\t\t// M(Console.ReadKey); // type inference produces ConsoleKeyInfo\n\t\t\t\n\t\t\tvar T = new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"T\");\n\t\t\t\n\t\t\tIType declType = compilation.FindType(typeof(Console));\n\t\t\tvar methods = new MethodListWithDeclaringType(declType, declType.GetMethods(m => m.Name == \"ReadKey\"));\n\t\t\tvar argument = new MethodGroupResolveResult(new TypeResolveResult(declType), \"ReadKey\", new[] { methods }, new IType[0]);\n\t\t\t\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { compilation.FindType(typeof(ConsoleKeyInfo)) },\n\t\t\t\tti.InferTypeArguments(new [] { T }, new [] { argument },\n\t\t\t\t                      new [] { new ParameterizedType(compilation.FindType(typeof(Func<>)).GetDefinition(), new[] { T }) },\n\t\t\t\t                      out success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Inference with Lambda\n\t\t#region MockImplicitLambda\n\t\tsealed class MockImplicitLambda : LambdaResolveResult\n\t\t{\n\t\t\tIType[] expectedParameterTypes;\n\t\t\tIType inferredReturnType;\n\t\t\tIParameter[] parameters;\n\t\t\t\n\t\t\tpublic MockImplicitLambda(IType[] expectedParameterTypes, IType inferredReturnType)\n\t\t\t{\n\t\t\t\tthis.expectedParameterTypes = expectedParameterTypes;\n\t\t\t\tthis.inferredReturnType = inferredReturnType;\n\t\t\t\tthis.parameters = new IParameter[expectedParameterTypes.Length];\n\t\t\t\tfor (int i = 0; i < parameters.Length; i++) {\n\t\t\t\t\t// UnknownType because this lambda is implicitly typed\n\t\t\t\t\tparameters[i] = new DefaultParameter(SpecialType.UnknownType, \"X\" + i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IList<IParameter> Parameters {\n\t\t\t\tget { return parameters; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override Conversion IsValid(IType[] parameterTypes, IType returnType, CSharpConversions conversions)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(expectedParameterTypes, parameterTypes);\n\t\t\t\treturn conversions.ImplicitConversion(inferredReturnType, returnType);\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsImplicitlyTyped {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAnonymousMethod {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool HasParameterList {\n\t\t\t\tget { return true; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool IsAsync {\n\t\t\t\tget { return false; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override ResolveResult Body {\n\t\t\t\tget { throw new NotImplementedException(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType ReturnType {\n\t\t\t\tget { throw new NotImplementedException(); }\n\t\t\t}\n\t\t\t\n\t\t\tpublic override IType GetInferredReturnType(IType[] parameterTypes)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(expectedParameterTypes, parameterTypes, \"Parameters types passed to \" + this);\n\t\t\t\treturn inferredReturnType;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn \"[MockImplicitLambda (\" + string.Join<IType>(\", \", expectedParameterTypes) + \") => \" + inferredReturnType + \"]\";\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t[Test]\n\t\tpublic void TestLambdaInference()\n\t\t{\n\t\t\tITypeParameter[] typeParameters = {\n\t\t\t\tnew DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"X\"),\n\t\t\t\tnew DefaultTypeParameter(compilation, SymbolKind.Method, 1, \"Y\"),\n\t\t\t\tnew DefaultTypeParameter(compilation, SymbolKind.Method, 2, \"Z\")\n\t\t\t};\n\t\t\tIType[] parameterTypes = {\n\t\t\t\ttypeParameters[0],\n\t\t\t\tnew ParameterizedType(compilation.FindType(typeof(Func<,>)).GetDefinition(), new[] { typeParameters[0], typeParameters[1] }),\n\t\t\t\tnew ParameterizedType(compilation.FindType(typeof(Func<,>)).GetDefinition(), new[] { typeParameters[1], typeParameters[2] })\n\t\t\t};\n\t\t\t// Signature:  M<X,Y,Z>(X x, Func<X,Y> y, Func<Y,Z> z) {}\n\t\t\t// Invocation: M(default(string), s => default(int), t => default(float));\n\t\t\tResolveResult[] arguments = {\n\t\t\t\tnew ResolveResult(compilation.FindType(KnownTypeCode.String)),\n\t\t\t\tnew MockImplicitLambda(new[] { compilation.FindType(KnownTypeCode.String) }, compilation.FindType(KnownTypeCode.Int32)),\n\t\t\t\tnew MockImplicitLambda(new[] { compilation.FindType(KnownTypeCode.Int32) }, compilation.FindType(KnownTypeCode.Single))\n\t\t\t};\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] {\n\t\t\t\t\tcompilation.FindType(KnownTypeCode.String),\n\t\t\t\t\tcompilation.FindType(KnownTypeCode.Int32),\n\t\t\t\t\tcompilation.FindType(KnownTypeCode.Single)\n\t\t\t\t},\n\t\t\t\tti.InferTypeArguments(typeParameters, arguments, parameterTypes, out success));\n\t\t\tAssert.IsTrue(success);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConvertAllLambdaInference()\n\t\t{\n\t\t\tITypeParameter[] classTypeParameters  = { new DefaultTypeParameter(compilation, SymbolKind.TypeDefinition, 0, \"T\") };\n\t\t\tITypeParameter[] methodTypeParameters = { new DefaultTypeParameter(compilation, SymbolKind.Method, 0, \"R\") };\n\t\t\t\n\t\t\tIType[] parameterTypes = {\n\t\t\t\tnew ParameterizedType(compilation.FindType(typeof(Converter<,>)).GetDefinition(),\n\t\t\t\t                      new[] { classTypeParameters[0], methodTypeParameters[0] })\n\t\t\t};\n\t\t\t\n\t\t\t// Signature:  List<T>.ConvertAll<R>(Converter<T, R> converter);\n\t\t\t// Invocation: listOfString.ConvertAll(s => default(int));\n\t\t\tResolveResult[] arguments = {\n\t\t\t\tnew MockImplicitLambda(new[] { compilation.FindType(KnownTypeCode.String) }, compilation.FindType(KnownTypeCode.Int32))\n\t\t\t};\n\t\t\tIType[] classTypeArguments = {\n\t\t\t\tcompilation.FindType(KnownTypeCode.String)\n\t\t\t};\n\t\t\t\n\t\t\tbool success;\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] { compilation.FindType(KnownTypeCode.Int32) },\n\t\t\t\tti.InferTypeArguments(methodTypeParameters, arguments, parameterTypes, out success, classTypeArguments));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InferFromImplicitAsyncLambda()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tstatic T M<T>(Func<int, Task<T>> f)\n\t{\n\t\treturn f(0);\n\t}\n\tpublic static void Test()\n\t{\n\t\t$M(async x => x + 1)$;\n\t}\n}\n\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.Int32\", ((IMethod)rr.Member).TypeArguments[0].FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InferFromExplicitAsyncLambda()\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Threading.Tasks;\n\nclass Test\n{\n\tstatic T M<T>(Func<int, Task<T>> f)\n\t{\n\t\treturn f(0);\n\t}\n\tpublic static void Test()\n\t{\n\t\t$M(async (int x) => x + 1)$;\n\t}\n}\n\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(\"System.Int32\", ((IMethod)rr.Member).TypeArguments[0].FullName);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region FindTypeInBounds\n\t\tIType[] FindAllTypesInBounds(IList<IType> lowerBounds, IList<IType> upperBounds = null)\n\t\t{\n\t\t\tti.Algorithm = TypeInferenceAlgorithm.ImprovedReturnAllResults;\n\t\t\tIType type = ti.FindTypeInBounds(lowerBounds, upperBounds ?? new IType[0]);\n\t\t\treturn ExpandIntersections(type).OrderBy(t => t.ReflectionName).ToArray();\n\t\t}\n\t\t\n\t\tstatic IEnumerable<IType> ExpandIntersections(IType type)\n\t\t{\n\t\t\tIntersectionType it = type as IntersectionType;\n\t\t\tif (it != null) {\n\t\t\t\treturn it.Types.SelectMany(t => ExpandIntersections(t));\n\t\t\t}\n\t\t\tParameterizedType pt = type as ParameterizedType;\n\t\t\tif (pt != null) {\n\t\t\t\tIType[][] typeArguments = new IType[pt.TypeArguments.Count][];\n\t\t\t\tfor (int i = 0; i < typeArguments.Length; i++) {\n\t\t\t\t\ttypeArguments[i] = ExpandIntersections(pt.TypeArguments[i]).ToArray();\n\t\t\t\t}\n\t\t\t\treturn AllCombinations(typeArguments).Select(ta => new ParameterizedType(pt.GetDefinition(), ta));\n\t\t\t}\n\t\t\treturn new [] { type };\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Performs the combinatorial explosion.\n\t\t/// </summary>\n\t\tstatic IEnumerable<IType[]> AllCombinations(IType[][] typeArguments)\n\t\t{\n\t\t\tint[] index = new int[typeArguments.Length];\n\t\t\tindex[typeArguments.Length - 1] = -1;\n\t\t\twhile (true) {\n\t\t\t\tint i;\n\t\t\t\tfor (i = index.Length - 1; i >= 0; i--) {\n\t\t\t\t\tif (++index[i] == typeArguments[i].Length)\n\t\t\t\t\t\tindex[i] = 0;\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (i < 0)\n\t\t\t\t\tbreak;\n\t\t\t\tIType[] r = new IType[typeArguments.Length];\n\t\t\t\tfor (i = 0; i < r.Length; i++) {\n\t\t\t\t\tr[i] = typeArguments[i][index[i]];\n\t\t\t\t}\n\t\t\t\tyield return r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ListOfShortAndInt()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(IList)),\n\t\t\t\tFindAllTypesInBounds(Resolve(typeof(List<short>), typeof(List<int>))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"Produces different results in .NET 4.5 due to new read-only interfaces\")]\n\t\tpublic void ListOfStringAndObject()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(IList), typeof(IEnumerable<object>)),\n\t\t\t\tFindAllTypesInBounds(Resolve(typeof(List<string>), typeof(List<object>))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"Produces different results in .NET 4.5 due to new read-only interfaces\")]\n\t\tpublic void ListOfListOfStringAndObject()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(IList), typeof(IEnumerable<IList>), typeof(IEnumerable<IEnumerable<object>>)),\n\t\t\t\tFindAllTypesInBounds(Resolve(typeof(List<List<string>>), typeof(List<List<object>>))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ShortAndInt()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(int)),\n\t\t\t\tFindAllTypesInBounds(Resolve(typeof(short), typeof(int))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StringAndVersion()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(ICloneable), typeof(IComparable)),\n\t\t\t\tFindAllTypesInBounds(Resolve(typeof(string), typeof(Version))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CommonSubTypeClonableComparable()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(string), typeof(Version)),\n\t\t\t\tFindAllTypesInBounds(Resolve(), Resolve(typeof(ICloneable), typeof(IComparable))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumerableOfStringAndVersion()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(IEnumerable<ICloneable>), typeof(IEnumerable<IComparable>)),\n\t\t\t\tFindAllTypesInBounds(Resolve(typeof(IList<string>), typeof(IList<Version>))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CommonSubTypeIEnumerableClonableIEnumerableComparable()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(IEnumerable<string>), typeof(IEnumerable<Version>)),\n\t\t\t\tFindAllTypesInBounds(Resolve(), Resolve(typeof(IEnumerable<ICloneable>), typeof(IEnumerable<IComparable>))));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CommonSubTypeIEnumerableClonableIEnumerableComparableList()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tResolve(typeof(List<string>), typeof(List<Version>), typeof(Collection<string>), typeof(Collection<Version>),\n\t\t\t\t        typeof(ReadOnlyCollectionBuilder<string>), typeof(ReadOnlyCollectionBuilder<Version>),\n\t\t\t\t        typeof(ReadOnlyCollection<string>), typeof(ReadOnlyCollection<Version>)),\n\t\t\t\tFindAllTypesInBounds(Resolve(), Resolve(typeof(IEnumerable<ICloneable>), typeof(IEnumerable<IComparable>), typeof(IList))));\n\t\t}\n\t\t#endregion\n\n\t\t[Test]\n\t\tpublic void NullablePick()\n\t\t{\n\t\t\t\tstring program = @\"\ninterface ICo<out T> {}\ninterface IContra<in T> {}\nclass Test\n{\n\tstatic T Pick<T> (T? a, T? b)\n\t{\n\t\treturn a;\n\t}\n\tpublic static void Test(int? i, long? l)\n\t{\n\t\t$Pick(i, l)$;\n\t}\n}\n\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Int64\", mrr.Type.FullName);\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CoContraPick()\n\t\t{\n\t\t\tstring program = @\"\ninterface ICo<out T> {}\ninterface IContra<in T> {}\nclass Test\n{\n\tstatic T Pick<T> (ICo<T> a, IContra<T> b)\n\t{\n\t\treturn a;\n\t}\n\tpublic static void Test(ICo<string> i, IContra<object> l)\n\t{\n\t\t$Pick(i, l)$;\n\t}\n}\n\";\n\t\t\t// String and Object are both valid choices; and csc ends up picking object,\n\t\t\t// even though the C# specification says it should pick string:\n\t\t\t// 7.5.2.11 Fixing - both string and object are in the candidate set;\n\t\t\t// string has a conversion to object (the other candidate),\n\t\t\t// object doesn't have that; so string should be chosen as the result.\n\t\t\t\n\t\t\t// We follow the csc behavior.\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Object\", mrr.Type.FullName);\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 9300 - Unknown Resolve Error\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9300()\n\t\t{\n\t\t\tstring program = @\"struct S\n{\n\tpublic static implicit operator string (S s)\n\t{\n\t\treturn \"\"a\"\";\n\t}\n}\n\ninterface I<in T>\n{\n}\n\nclass C : I<string>\n{\n\tstatic T Foo<T> (T a, I<T> b)\n\t{\n\t\treturn a;\n\t}\n\t\n\tpublic static void Main ()\n\t{\n\t\tS s = new S ();\n\t\tI<string> i = new C ();\n\t\tvar result = $Foo (s, i)$;\n\t}\n}\n\";\n\t\t\tvar mrr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.String\", mrr.Type.FullName);\n\t\t\tAssert.IsFalse(mrr.IsError);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GenericArgumentImplicitlyConvertibleToAndFromAnotherTypeList() {\n\t\t\tstring program = @\"\nusing System.Collections.Generic;\npublic class MyConvertible {\n\tpublic static implicit operator MyConvertible(int number) { return null; }\n\tpublic static implicit operator int(MyConvertible obj) { return 0; }\n}\n\nclass C {\n\tpublic static void F<K>(IList<K> a, K b) {\n\t}\n\tvoid M() {\n\t\t$F(new List<MyConvertible>(), 1)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.That(rr.Member, Is.InstanceOf<SpecializedMethod>());\n\t\t\tAssert.That(((SpecializedMethod)rr.Member).TypeArguments.Select(ta => ta.FullName), Is.EqualTo(new[] { \"MyConvertible\" }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GenericArgumentImplicitlyConvertibleToAndFromAnotherTypeIEnumerable() {\n\t\t\tstring program = @\"\nusing System.Collections.Generic;\npublic class MyConvertible {\n\tpublic static implicit operator MyConvertible(int number) { return null; }\n\tpublic static implicit operator int(MyConvertible obj) { return 0; }\n}\n\nclass C {\n\tpublic static void F<K>(IEnumerable<K> a, K b) {\n\t}\n\tvoid M() {\n\t\t$F(new List<MyConvertible>(), 1)$;\n\t}\n}\";\n\t\t\tvar rr = Resolve<CSharpInvocationResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/UnaryOperatorTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t// assign short name to the fake reflection type\n\tusing dynamic = ICSharpCode.NRefactory.TypeSystem.ReflectionHelper.Dynamic;\n\t\n\t[TestFixture]\n\tpublic unsafe class UnaryOperatorTests : ResolverTestBase\n\t{\n\t\tCSharpResolver resolver;\n\t\t\n\t\tpublic override void SetUp()\n\t\t{\n\t\t\tbase.SetUp();\n\t\t\tresolver = new CSharpResolver(compilation);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestAddressOf()\n\t\t{\n\t\t\tTestOperator(UnaryOperatorType.AddressOf, MakeResult(typeof(int)),\n\t\t\t             Conversion.IdentityConversion, typeof(int*));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.AddressOf, MakeResult(typeof(byte*)),\n\t\t\t             Conversion.IdentityConversion, typeof(byte**));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.AddressOf, MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, typeof(dynamic));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestDereference()\n\t\t{\n\t\t\tTestOperator(UnaryOperatorType.Dereference, MakeResult(typeof(int*)),\n\t\t\t             Conversion.IdentityConversion, typeof(int));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Dereference, MakeResult(typeof(long**)),\n\t\t\t             Conversion.IdentityConversion, typeof(long*));\n\t\t\t\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Dereference, MakeResult(typeof(int))).IsError);\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Dereference, MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, typeof(dynamic));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestIncrementDecrement()\n\t\t{\n\t\t\tTestOperator(UnaryOperatorType.Increment, MakeResult(typeof(byte)),\n\t\t\t             Conversion.IdentityConversion, typeof(byte));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostIncrement, MakeResult(typeof(char)),\n\t\t\t             Conversion.IdentityConversion, typeof(char));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostIncrement, MakeResult(typeof(float)),\n\t\t\t             Conversion.IdentityConversion, typeof(float));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostIncrement, MakeResult(typeof(decimal)),\n\t\t\t             Conversion.IdentityConversion, typeof(decimal));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Decrement, MakeResult(typeof(ulong)),\n\t\t\t             Conversion.IdentityConversion, typeof(ulong));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostDecrement, MakeResult(typeof(short?)),\n\t\t\t             Conversion.IdentityConversion, typeof(short?));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostIncrement, MakeResult(typeof(TypeCode)),\n\t\t\t             Conversion.IdentityConversion, typeof(TypeCode));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostIncrement, MakeResult(typeof(TypeCode?)),\n\t\t\t             Conversion.IdentityConversion, typeof(TypeCode?));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostIncrement, MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, typeof(dynamic));\n\t\t\t\n\t\t\tAssertError(typeof(object), resolver.ResolveUnaryOperator(UnaryOperatorType.Increment, MakeResult(typeof(object))));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Increment, MakeResult(typeof(int*)),\n\t\t\t             Conversion.IdentityConversion, typeof(int*));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.PostDecrement, MakeResult(typeof(uint*)),\n\t\t\t             Conversion.IdentityConversion, typeof(uint*));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnaryPlus()\n\t\t{\n\t\t\tAssertConstant(1, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant((sbyte)1)));\n\t\t\tAssertConstant(1, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant((byte)1)));\n\t\t\tAssertConstant(1, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant((short)1)));\n\t\t\tAssertConstant(1, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant((ushort)1)));\n\t\t\tAssertConstant(65, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant('A')));\n\t\t\tAssertConstant(1, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant(1)));\n\t\t\tAssertConstant((uint)1, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant((uint)1)));\n\t\t\tAssertConstant(1L, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant((long)1)));\n\t\t\tAssertConstant((ulong)1, resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant((ulong)1)));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Plus, MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, typeof(dynamic));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Plus, MakeResult(typeof(ushort?)),\n\t\t\t             Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnaryMinus()\n\t\t{\n\t\t\tAssertConstant(-1, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(1)));\n\t\t\tAssertConstant(-1L, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant((uint)1)));\n\t\t\tAssertConstant(-2147483648L, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(2147483648)));\n\t\t\tAssertConstant(-1.0f, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(1.0f)));\n\t\t\tAssertConstant(-1.0, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(1.0)));\n\t\t\tAssertConstant(1m, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(-1m)));\n\t\t\tAssertConstant(-65, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant('A')));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Minus, MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, typeof(dynamic));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Minus, MakeResult(typeof(uint?)),\n\t\t\t             Conversion.ImplicitNullableConversion, typeof(long?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnaryMinusUncheckedOverflow()\n\t\t{\n\t\t\tAssertConstant(-2147483648, resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(-2147483648)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestUnaryMinusCheckedOverflow()\n\t\t{\n\t\t\tAssertError(typeof(int), resolver.WithCheckForOverflow(true).ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(-2147483648)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBitwiseNot()\n\t\t{\n\t\t\tAssertConstant(1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant(-2)));\n\t\t\tAssertConstant(~'A', resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant('A')));\n\t\t\tAssertConstant(~(sbyte)1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant((sbyte)1)));\n\t\t\tAssertConstant(~(byte)1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant((byte)1)));\n\t\t\tAssertConstant(~(short)1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant((short)1)));\n\t\t\tAssertConstant(~(ushort)1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant((ushort)1)));\n\t\t\tAssertConstant(~(uint)1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant((uint)1)));\n\t\t\tAssertConstant(~(long)1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant((long)1)));\n\t\t\tAssertConstant(~(ulong)1, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant((ulong)1)));\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant(1.0)).IsError);\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.BitNot, MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, typeof(dynamic));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.BitNot, MakeResult(typeof(uint)),\n\t\t\t             Conversion.IdentityConversion, typeof(uint));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.BitNot, MakeResult(typeof(sbyte)),\n\t\t\t             Conversion.ImplicitNumericConversion, typeof(int));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.BitNot, MakeResult(typeof(ushort?)),\n\t\t\t             Conversion.ImplicitNullableConversion, typeof(int?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLogicalNot()\n\t\t{\n\t\t\tAssertConstant(true, resolver.ResolveUnaryOperator(UnaryOperatorType.Not, MakeConstant(false)));\n\t\t\tAssertConstant(false, resolver.ResolveUnaryOperator(UnaryOperatorType.Not, MakeConstant(true)));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Not, MakeResult(typeof(dynamic)),\n\t\t\t             Conversion.IdentityConversion, typeof(dynamic));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Not, MakeResult(typeof(bool)),\n\t\t\t             Conversion.IdentityConversion, typeof(bool));\n\t\t\t\n\t\t\tTestOperator(UnaryOperatorType.Not, MakeResult(typeof(bool?)),\n\t\t\t             Conversion.IdentityConversion, typeof(bool?));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestInvalidUnaryOperatorsOnEnum()\n\t\t{\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Not, MakeConstant(StringComparison.Ordinal)).IsError);\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeConstant(StringComparison.Ordinal)).IsError);\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeConstant(StringComparison.Ordinal)).IsError);\n\t\t\t\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Not, MakeResult(typeof(StringComparison))).IsError);\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeResult(typeof(StringComparison))).IsError);\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeResult(typeof(StringComparison))).IsError);\n\t\t\t\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Not, MakeResult(typeof(StringComparison?))).IsError);\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Plus, MakeResult(typeof(StringComparison?))).IsError);\n\t\t\tAssert.IsTrue(resolver.ResolveUnaryOperator(UnaryOperatorType.Minus, MakeResult(typeof(StringComparison?))).IsError);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestBitwiseNotOnEnum()\n\t\t{\n\t\t\tAssertConstant(~StringComparison.Ordinal, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant(StringComparison.Ordinal)));\n\t\t\tAssertConstant(~StringComparison.CurrentCultureIgnoreCase, resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeConstant(StringComparison.CurrentCultureIgnoreCase)));\n\t\t\tAssertType(typeof(StringComparison), resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeResult(typeof(StringComparison))));\n\t\t\tAssertType(typeof(StringComparison?), resolver.ResolveUnaryOperator(UnaryOperatorType.BitNot, MakeResult(typeof(StringComparison?))));\n\t\t}\n\t\t\n#if __MonoCS__\n\t\t[Ignore(\"Broken on mcs\")]\n#endif\n\t\t[Test]\n\t\tpublic void IntMinValue()\n\t\t{\n\t\t\t// int:\n\t\t\tAssertConstant(-2147483648, Resolve(\"class A { object x = $-2147483648$; }\"));\n\t\t\tAssertConstant(-/**/2147483648, Resolve(\"class A { object x = $-/**/2147483648$; }\"));\n\t\t\t// long:\n\t\t\tAssertConstant(-2147483648L, Resolve(\"class A { object x = $-2147483648L$; }\"));\n\t\t\tAssertConstant(-(2147483648), Resolve(\"class A { object x = $-(2147483648)$; }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void LongMinValue()\n\t\t{\n\t\t\t// long:\n\t\t\tAssertConstant(-9223372036854775808, Resolve(\"class A { object x = $-9223372036854775808$; }\"));\n\t\t\t// compiler error:\n\t\t\tAssertError(typeof(ulong), Resolve(\"class A { object x = $-(9223372036854775808)$; }\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IsLiftedProperty()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tstatic void Inc() {\n\t\tint? a = 0;\n\t\ta = $-a$;\n\t}\n}\";\n\t\t\tvar irr = Resolve<OperatorResolveResult>(program);\n\t\t\tAssert.IsFalse(irr.IsError);\n\t\t\tAssert.IsTrue(irr.IsLiftedOperator);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UShortEnumNegation()\n\t\t{\n\t\t\tstring program = @\"\nclass Test {\n\tenum UShortEnum : ushort { Three = 3 }\n\tstatic void Inc() {\n\t\tchecked { // even in checked context, the implicit cast back to enum is unchecked\n\t\t\tvar a = $~UShortEnum.Three$;\n\t\t}\n\t}\n}\";\n\t\t\tvar rr = Resolve<ConstantResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(unchecked( (ushort)~3 ), rr.ConstantValue);\n\t\t}\n\n#if NET_4_5\n\t\t[Test]\n\t\tpublic void Await() {\n\t\t\tstring program = @\"\nusing System;\nclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic int GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter GetAwaiter() { return null; }\n\tpublic MyAwaiter GetAwaiter(int i) { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"MyAwaitable.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Member.Parameters.Count);\n\n\t\t\tAssert.AreEqual(\"MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.GetResult\", rr.GetResultMethod.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaitWithGenericAwaiterType() {\n\t\t\tstring program = @\"\nusing System;\nclass MyAwaiter<T> : System.Runtime.CompilerServices.INotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic T GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter<int> GetAwaiter() { return null; }\n\tpublic MyAwaiter<int> GetAwaiter(int i) { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"MyAwaitable.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Member.Parameters.Count);\n\n\t\t\tAssert.AreEqual(\"MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.GetResult\", rr.GetResultMethod.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaitWithCriticalGenericAwaiterType() {\n\t\t\tstring program = @\"\nusing System;\nclass MyAwaiter<T> : System.Runtime.CompilerServices.ICriticalNotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic void UnsafeOnCompleted(Action continuation) {}\n\tpublic T GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter<int> GetAwaiter() { return null; }\n\tpublic MyAwaiter<int> GetAwaiter(int i) { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"MyAwaitable.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Member.Parameters.Count);\n\n\t\t\tAssert.AreEqual(\"MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.UnsafeOnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.GetResult\", rr.GetResultMethod.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaitWhenGetAwaiterIsAnExtensionMethod() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic bool IsCompleted { get { return false; } }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.GetResult\", rr.GetResultMethod.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetAwaiterMethodWithDefaultArgumentCannotBeUsed() {\n\t\t\tstring program = @\"\nusing System;\nclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic int GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter GetAwaiter(int i = 0) { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.IsTrue(rr.GetAwaiterInvocation.IsError);\n\t\t}\n\n\t\t[Test, Ignore(\"TODO: MS C# refuses to use an extension method GetAwaiter() when there is an instance GetAwaiter() with only optional arguments. I do not know, however, if this is by design, and I could not find a simple, nice way to do the implementation\")]\n\t\tpublic void GetAwaiterMethodWithDefaultArgumentHidesExtensionMethodAndResultsInError() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic bool IsCompleted { get { return false; } }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic MyAwaiter GetAwaiter(int i = 0) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.AreEqual(SpecialType.UnknownType, rr.Type);\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tAssert.IsTrue(rr.GetAwaiterInvocation.IsError);\n\n\t\t\tAssert.AreEqual(rr.AwaiterType, SpecialType.UnknownType);\n\n\t\t\tAssert.IsNull(rr.IsCompletedProperty);\n\t\t\tAssert.IsNull(rr.OnCompletedMethod);\n\t\t\tAssert.IsNull(rr.GetResultMethod);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetAwaiterMethodWithArgumentDoesNotHideExtensionMethod() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic bool IsCompleted { get { return false; } }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic static MyAwaiter GetAwaiter(int i) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.GetResult\", rr.GetResultMethod.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GenericGetAwaiterResultsInError() {\n\t\t\tstring program = @\"\nusing System;\nclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic int GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter GetAwaiter<T>() { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterWithNoSuitableGetResult() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic bool IsCompleted { get { return false; } }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult(int i) { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic static MyAwaiter GetAwaiter(int i) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.AreEqual(SpecialType.UnknownType, rr.Type);\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNull(rr.GetResultMethod);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterWithInaccessibleGetResult() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic bool IsCompleted { get { return false; } }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tprivate int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic static MyAwaiter GetAwaiter(int i) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.AreEqual(SpecialType.UnknownType, rr.Type);\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNull(rr.GetResultMethod);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterWithNoIsCompletedProperty() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic bool IsCompleted() { return false; }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic static MyAwaiter GetAwaiter(int i) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNull(rr.IsCompletedProperty);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterWithIsCompletedPropertyThatIsNotBoolean() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic string IsCompleted { get { return false; } }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic static MyAwaiter GetAwaiter(int i) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNull(rr.IsCompletedProperty);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterWithIsCompletedPropertyThatIsNotReadable() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tpublic bool IsCompleted { set {} }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic static MyAwaiter GetAwaiter(int i) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNull(rr.IsCompletedProperty);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterWithIsCompletedPropertyThatIsNotAccessible() {\n\t\t\tstring program = @\"\nusing System;\nnamespace N {\n\tclass MyAwaiter : System.Runtime.CompilerServices.INotifyCompletion {\n\t\tprivate bool IsCompleted { get; set; }\n\t\tpublic void OnCompleted(Action continuation) {}\n\t\tpublic int GetResult() { return 0; }\n\t}\n\tclass MyAwaitable {\n\t\tpublic static MyAwaiter GetAwaiter(int i) { return null; }\n\t}\n\tstatic class MyAwaitableExtensions {\n\t\tpublic static MyAwaiter GetAwaiter(this MyAwaitable x) { return null; }\n\t}\n\tpublic class C {\n\t\tpublic async void M() {\n\t\t\tMyAwaitable x = null;\n\t\t\tint i = $await x$;\n\t\t}\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"N.MyAwaitableExtensions.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(1, getAwaiterInvocation.Member.Parameters.Count);\n\t\t\tAssert.IsTrue(getAwaiterInvocation.Arguments[0] is LocalResolveResult && ((LocalResolveResult)getAwaiterInvocation.Arguments[0]).Variable.Name == \"x\");\n\n\t\t\tAssert.AreEqual(\"N.MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNull(rr.IsCompletedProperty);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"N.MyAwaiter.OnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterThatDoesNotImplementINotifyCompletion() {\n\t\t\tstring program = @\"\nusing System;\nclass MyAwaiter {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic int GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter GetAwaiter() { return null; }\n\tpublic MyAwaiter GetAwaiter(int i) { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsTrue(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"MyAwaitable.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Member.Parameters.Count);\n\n\t\t\tAssert.AreEqual(\"MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNull(rr.OnCompletedMethod);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.GetResult\", rr.GetResultMethod.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaiterThatImplementsICriticalNotifyCompletion() {\n\t\t\tstring program = @\"\nusing System;\nclass MyAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion {\n\tpublic bool IsCompleted { get { return false; } }\n\tpublic void OnCompleted(Action continuation) {}\n\tpublic void UnsafeOnCompleted(Action continuation) {}\n\tpublic int GetResult() { return 0; }\n}\nclass MyAwaitable {\n\tpublic MyAwaiter GetAwaiter() { return null; }\n\tpublic MyAwaiter GetAwaiter(int i) { return null; }\n}\npublic class C {\n\tpublic async void M() {\n\t\tMyAwaitable x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.IsTrue(rr.Type.IsKnownType(KnownTypeCode.Int32));\n\t\t\tAssert.IsInstanceOf<CSharpInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (CSharpInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.AreEqual(\"MyAwaitable.GetAwaiter\", getAwaiterInvocation.Member.FullName);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Member.Parameters.Count);\n\n\t\t\tAssert.AreEqual(\"MyAwaiter\", rr.AwaiterType.FullName);\n\n\t\t\tAssert.IsNotNull(rr.IsCompletedProperty);\n\t\t\tAssert.AreEqual(\"MyAwaiter.IsCompleted\", rr.IsCompletedProperty.FullName);\n\n\t\t\tAssert.IsNotNull(rr.OnCompletedMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.UnsafeOnCompleted\", rr.OnCompletedMethod.FullName);\n\n\t\t\tAssert.IsNotNull(rr.GetResultMethod);\n\t\t\tAssert.AreEqual(\"MyAwaiter.GetResult\", rr.GetResultMethod.FullName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AwaitDynamic() {\n\t\t\tstring program = @\"\npublic class C {\n\tpublic async void M() {\n\t\tdynamic x = null;\n\t\tint i = $await x$;\n\t}\n}\";\n\t\t\n\t\t\tvar rr = Resolve<AwaitResolveResult>(program);\n\t\t\tAssert.IsFalse(rr.IsError);\n\t\t\tAssert.AreEqual(SpecialType.Dynamic, rr.Type);\n\t\t\tAssert.IsInstanceOf<DynamicInvocationResolveResult>(rr.GetAwaiterInvocation);\n\t\t\tvar getAwaiterInvocation = (DynamicInvocationResolveResult)rr.GetAwaiterInvocation;\n\t\t\tAssert.IsFalse(rr.GetAwaiterInvocation.IsError);\n\t\t\tAssert.AreEqual(DynamicInvocationType.Invocation, getAwaiterInvocation.InvocationType);\n\t\t\tAssert.AreEqual(0, getAwaiterInvocation.Arguments.Count);\n\t\t\tAssert.IsInstanceOf<DynamicMemberResolveResult>(getAwaiterInvocation.Target);\n\t\t\tvar target = (DynamicMemberResolveResult)getAwaiterInvocation.Target;\n\t\t\tAssert.IsInstanceOf<LocalResolveResult>(target.Target);\n\t\t\tAssert.AreEqual(\"GetAwaiter\", target.Member);\n\n\t\t\tAssert.AreEqual(SpecialType.Dynamic, rr.AwaiterType);\n\n\t\t\tAssert.IsNull(rr.IsCompletedProperty);\n\t\t\tAssert.IsNull(rr.OnCompletedMethod);\n\t\t\tAssert.IsNull(rr.GetResultMethod);\n\t\t}\n#endif // NET_4_5\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/UnsafeCodeTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Semantics;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.CSharp.Resolver\n{\n\t[TestFixture]\n\tpublic class UnsafeCodeTests : ResolverTestBase\n\t{\n\t\t[Test]\n\t\tpublic void FixedStatement()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main(byte[] a) {\n\t\tfixed (byte* p = a) {\n\t\t\ta = $p$;\n\t\t} } }\";\n\t\t\t\n\t\t\tvar lrr = Resolve<LocalResolveResult>(program);\n\t\t\tAssert.AreEqual(\"System.Byte*\", lrr.Type.ReflectionName);\n\t\t\t\n\t\t\tvar rr = Resolve<OperatorResolveResult>(program.Replace(\"$p$\", \"$*p$\"));\n\t\t\tAssert.AreEqual(\"System.Byte\", rr.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FixedStatementArrayPointerConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main(byte[] a) {\n\t\tfixed (byte* p = $a$) {\n\t\t} } }\";\n\t\t\tAssert.AreEqual(\"System.Byte*\", GetExpectedType(program).ReflectionName);\n\t\t\tAssert.AreEqual(Conversion.ImplicitPointerConversion, GetConversion(program));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FixedStatementStringPointerConversion()\n\t\t{\n\t\t\tstring program = @\"using System;\nclass TestClass {\n\tstatic void Main(string a) {\n\t\tfixed (char* p = $a$) {\n\t\t} } }\";\n\t\t\tAssert.AreEqual(\"System.Char*\", GetExpectedType(program).ReflectionName);\n\t\t\tAssert.AreEqual(Conversion.ImplicitPointerConversion, GetConversion(program));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Documentation/CSharpCrefLookupTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t[TestFixture]\n\tpublic class CSharpCrefLookupTests\n\t{\n\t\tIEntity Lookup(string cref)\n\t\t{\n\t\t\tstring program = @\"using System;\nusing System.Collections.Generic;\n/// <summary/>\nclass Test {\n\tint @int;\n\tvoid M(int a) {}\n\t\n\tvoid Overloaded(int a) {}\n\tvoid Overloaded(string a) {}\n\tvoid Overloaded(ref int a) {}\n\t\n\tpublic int this[int index] { get { return 0; } }\n\t\n\tpublic static int operator +(Test a, int b) { return 0; }\n\tpublic static implicit operator Test(int a) { return 0; }\n\tpublic static implicit operator int(Test a) { return 0; }\n}\ninterface IGeneric<A, B> {\n\tvoid Test<T>(ref T[,] a);\n}\nclass Impl<T> : IGeneric<List<string>[,], T> {\n\tvoid IGeneric<List<string>[,], T>.Test<X>(ref X[,] a) {}\n}\";\n\t\t\t\n\t\t\tvar pc = new CSharpProjectContent().AddAssemblyReferences(new[] { CecilLoaderTests.Mscorlib });\n\t\t\tvar syntaxTree = SyntaxTree.Parse(program, \"program.cs\");\n\t\t\tvar compilation = pc.AddOrUpdateFiles(syntaxTree.ToTypeSystem()).CreateCompilation();\n\t\t\tvar typeDefinition = compilation.MainAssembly.TopLevelTypeDefinitions.First();\n\t\t\tIEntity entity = typeDefinition.Documentation.ResolveCref(cref);\n\t\t\tAssert.IsNotNull(entity, \"ResolveCref() returned null.\");\n\t\t\treturn entity;\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void String()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.String\",\n\t\t\t                Lookup(\"string\").ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntParse()\n\t\t{\n\t\t\tAssert.AreEqual(\"M:System.Int32.Parse(System.String)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"int.Parse(string)\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntField()\n\t\t{\n\t\t\tAssert.AreEqual(\"Test.int\",\n\t\t\t                Lookup(\"@int\").ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ListOfT()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List`1\",\n\t\t\t                Lookup(\"List{T}\").ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ListOfTEnumerator()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List`1+Enumerator\",\n\t\t\t                Lookup(\"List{T}.Enumerator\").ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IDString()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List`1+Enumerator\",\n\t\t\t                Lookup(\"T:System.Collections.Generic.List`1.Enumerator\").ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void M()\n\t\t{\n\t\t\tAssert.AreEqual(\"M:Test.M(System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"M\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CurrentType()\n\t\t{\n\t\t\tAssert.AreEqual(\"T:Test\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Test\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Constructor()\n\t\t{\n\t\t\tAssert.AreEqual(\"M:Test.#ctor\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Test()\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Overloaded()\n\t\t{\n\t\t\tAssert.AreEqual(\"M:Test.Overloaded(System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Overloaded(int)\")));\n\t\t\tAssert.AreEqual(\"M:Test.Overloaded(System.String)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Overloaded(string)\")));\n\t\t\tAssert.AreEqual(\"M:Test.Overloaded(System.Int32@)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Overloaded(ref int)\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodInGenericInterface()\n\t\t{\n\t\t\tAssert.AreEqual(\"M:IGeneric`2.Test``1(``0[0:,0:]@)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"IGeneric{X, Y}.Test\")));\n\t\t\tAssert.AreEqual(\"M:IGeneric`2.Test``1(``0[0:,0:]@)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"IGeneric{X, Y}.Test{Z}\")));\n\t\t\tAssert.AreEqual(\"M:IGeneric`2.Test``1(``0[0:,0:]@)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"IGeneric{X, Y}.Test{Z}(ref Z[,])\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"Fails due to mcs parser bug (see CSharpCrefParserTests.This)\")]\n\t\tpublic void IndexerWithoutDeclaringType()\n\t\t{\n\t\t\tAssert.AreEqual(\"P:Test.Item(System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"this\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexerWithDeclaringType()\n\t\t{\n\t\t\tAssert.AreEqual(\"P:Test.Item(System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Test.this\")));\n\t\t\tAssert.AreEqual(\"P:Test.Item(System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Test.this[int]\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"mcs bug, see CSharpCrefParserTests.OperatorPlusWithDeclaringType\")]\n\t\tpublic void OperatorPlus()\n\t\t{\n\t\t\tAssert.AreEqual(\"M:Test.op_Addition(Test,System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"operator +\")));\n\t\t\tAssert.AreEqual(\"M:Test.op_Addition(Test,System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"operator +(Test, int)\")));\n\t\t\tAssert.AreEqual(\"M:Test.op_Addition(Test,System.Int32)\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Test.operator +(Test, int)\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"mcs bug, see CSharpCrefParserTests.OperatorPlusWithDeclaringType\")]\n\t\tpublic void ImplicitOperator()\n\t\t{\n\t\t\tAssert.AreEqual(\"M:Test.op_Implicit(Test)~System.Int32\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"implicit operator int(Test)\")));\n\t\t\tAssert.AreEqual(\"M:Test.op_Implicit(System.Int32)~Test\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"implicit operator Test(int)\")));\n\t\t\tAssert.AreEqual(\"M:Test.op_Implicit(System.Int32)~Test\",\n\t\t\t                IdStringProvider.GetIdString(Lookup(\"Test.implicit operator Test(int)\")));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Documentation/CSharpCrefParserTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.Parser;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t[TestFixture]\n\tpublic class CSharpCrefParserTests\n\t{\n\t\t[Test]\n\t\tpublic void M()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"M\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tMemberName = \"M\"\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"mcs bug\")]\n\t\tpublic void This()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"this\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Indexer\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"mcs bug (Unexpected symbol `this', expecting `explicit', `implicit', `operator', or `type')\")]\n\t\tpublic void ThisWithParameter()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"this[int]\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Indexer,\n\t\t\t\t\tHasParameterList = true,\n\t\t\t\t\tParameters = { new ParameterDeclaration { Type = new PrimitiveType(\"int\") } }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ThisWithDeclaringType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"List{T}.this\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Indexer,\n\t\t\t\t\tDeclaringType = new SimpleType(\"List\", new SimpleType(\"T\"))\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedTypeInGenericType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"List{T}.Enumerator\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tDeclaringType = new SimpleType(\"List\", new SimpleType(\"T\")),\n\t\t\t\t\tMemberName = \"Enumerator\"\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericTypeWithFullNamespace()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"System.Collections.Generic.List{T}\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tDeclaringType = new SimpleType(\"System\").MemberType(\"Collections\").MemberType(\"Generic\"),\n\t\t\t\t\tMemberName = \"List\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"T\") }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PrimitiveType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"int\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.TypeDefinition,\n\t\t\t\t\tDeclaringType = new PrimitiveType(\"int\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VerbatimIdentifier()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"@int\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tMemberName = \"int\"\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntParse()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"int.Parse(string)\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tDeclaringType = new PrimitiveType(\"int\"),\n\t\t\t\t\tMemberName = \"Parse\",\n\t\t\t\t\tHasParameterList = true,\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration { Type = new PrimitiveType(\"string\") }\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Generic()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"IGeneric{X, Y}\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tMemberName = \"IGeneric\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"X\"), new SimpleType(\"Y\") }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MixedGeneric()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"IGeneric<X, Y}\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tMemberName = \"IGeneric\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"X\"), new SimpleType(\"Y\") }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodInGeneric()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"IGeneric{X, Y}.Test\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tDeclaringType = new SimpleType(\"IGeneric\", new SimpleType(\"X\"), new SimpleType(\"Y\")),\n\t\t\t\t\tMemberName = \"Test\"\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodInGeneric()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"IGeneric{X, Y}.Test{Z}\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tDeclaringType = new SimpleType(\"IGeneric\", new SimpleType(\"X\"), new SimpleType(\"Y\")),\n\t\t\t\t\tMemberName = \"Test\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"Z\") }\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericMethodInGenericWithParameterList()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"IGeneric{X, Y}.Test{Z}(ref Z[,])\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tDeclaringType = new SimpleType(\"IGeneric\", new SimpleType(\"X\"), new SimpleType(\"Y\")),\n\t\t\t\t\tMemberName = \"Test\",\n\t\t\t\t\tTypeArguments = { new SimpleType(\"Z\") },\n\t\t\t\t\tHasParameterList = true,\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration {\n\t\t\t\t\t\t\tParameterModifier = ParameterModifier.Ref,\n\t\t\t\t\t\t\tType = new SimpleType(\"Z\").MakeArrayType(2)\n\t\t\t\t\t\t}\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EmptyParameterList()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"Window1()\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tMemberName = \"Window1\",\n\t\t\t\t\tHasParameterList = true\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OperatorPlus()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"operator +\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Operator,\n\t\t\t\t\tOperatorType = OperatorType.Addition\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"mcs bug (Unexpected symbol `operator', expecting `identifier' or `this')\")]\n\t\tpublic void OperatorPlusWithDeclaringType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"Test.operator +\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tDeclaringType = new SimpleType(\"Test\"),\n\t\t\t\t\tSymbolKind = SymbolKind.Operator,\n\t\t\t\t\tOperatorType = OperatorType.Addition\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void OperatorPlusWithParameterList()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"operator +(Test, int)\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Operator,\n\t\t\t\t\tOperatorType = OperatorType.Addition,\n\t\t\t\t\tHasParameterList = true,\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration { Type = new SimpleType(\"Test\") },\n\t\t\t\t\t\tnew ParameterDeclaration { Type = new PrimitiveType(\"int\") }\n\t\t\t\t\t}});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitOperator()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"implicit operator int\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Operator,\n\t\t\t\t\tOperatorType = OperatorType.Implicit,\n\t\t\t\t\tConversionOperatorReturnType = new PrimitiveType(\"int\")\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitOperatorWithParameterList()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"explicit operator int(Test)\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Operator,\n\t\t\t\t\tOperatorType = OperatorType.Explicit,\n\t\t\t\t\tConversionOperatorReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tHasParameterList = true,\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration { Type = new SimpleType(\"Test\") },\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"mcs bug (Unexpected symbol `explicit', expecting `identifier' or `this')\")]\n\t\tpublic void ExplicitOperatorWithParameterListAndDeclaringType()\n\t\t{\n\t\t\tParseUtilCSharp.AssertDocumentationReference(\n\t\t\t\t\"Test.explicit operator int(Test)\",\n\t\t\t\tnew DocumentationReference {\n\t\t\t\t\tSymbolKind = SymbolKind.Operator,\n\t\t\t\t\tOperatorType = OperatorType.Explicit,\n\t\t\t\t\tDeclaringType = new SimpleType(\"Test\"),\n\t\t\t\t\tConversionOperatorReturnType = new PrimitiveType(\"int\"),\n\t\t\t\t\tHasParameterList = true,\n\t\t\t\t\tParameters = {\n\t\t\t\t\t\tnew ParameterDeclaration { Type = new SimpleType(\"Test\") },\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestParseTypeName()\n\t\t{\n\t\t\tvar result = IdStringProvider.ParseTypeName(\"T:System.Collections.Generic.List{T}\");\n\t\t\tAssert.IsNotNull(result);\n\t\t\tvar pc = new CSharpProjectContent().AddAssemblyReferences(new[] { CecilLoaderTests.Mscorlib });\n\n\t\t\tvar type = result.Resolve(pc.CreateCompilation());\n\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List\", type.FullName);\n\t\t\tAssert.AreEqual(1, type.TypeParameterCount);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Documentation/CSharpDocumentationTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Xml;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t[TestFixture]\n\tpublic class CSharpDocumentationTests\n\t{\n\t\tICompilation compilation;\n\t\tITypeDefinition typeDefinition;\n\t\t\n\t\tvoid Init(string program)\n\t\t{\n\t\t\tvar pc = new CSharpProjectContent().AddAssemblyReferences(new[] { CecilLoaderTests.Mscorlib });\n\t\t\tvar syntaxTree = SyntaxTree.Parse(program, \"program.cs\");\n\t\t\tcompilation = pc.AddOrUpdateFiles(syntaxTree.ToTypeSystem()).CreateCompilation();\n\t\t\ttypeDefinition = compilation.MainAssembly.TopLevelTypeDefinitions.FirstOrDefault();\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeDocumentationLookup()\n\t\t{\n\t\t\tInit(@\"using System;\n/// <summary/>\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary/>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeDocumentationLookup2()\n\t\t{\n\t\t\tInit(@\"using System;\n/// <summary>\n/// Documentation\n/// </summary>\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary>\" + Environment.NewLine + \"Documentation\" + Environment.NewLine + \"</summary>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeDocumentationLookupWithIndentation()\n\t\t{\n\t\t\tInit(@\"using System;\n/// <summary>\n///   Documentation\n/// </summary>\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary>\" + Environment.NewLine + \"  Documentation\" + Environment.NewLine + \"</summary>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultilineDocumentation()\n\t\t{\n\t\t\tInit(@\"using System;\n/** <summary>Documentation</summary> */\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary>Documentation</summary> \", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultilineDocumentation2()\n\t\t{\n\t\t\tInit(@\"using System;\n/**\n<summary>\n  Documentation\n</summary>\n*/\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary>\" + Environment.NewLine + \"  Documentation\" + Environment.NewLine + \"</summary>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultilineDocumentationCommonPattern()\n\t\t{\n\t\t\tInit(@\"using System;\n/**\n * <summary>\n *   Documentation\n * </summary>*/\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary>\" + Environment.NewLine + \"  Documentation\" + Environment.NewLine + \"</summary>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultilineDocumentationNoCommonPattern()\n\t\t{\n\t\t\tInit(@\"using System;\n/**\n   <summary>\n *   Documentation\n */\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"   <summary>\" + Environment.NewLine + \" *   Documentation\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InheritedDocumentation()\n\t\t{\n\t\t\tInit(@\"using System;\nclass Derived : Base {\n\t/// <summary>Overridden summary</summary><inheritdoc/>\n\tpublic override void Method();\n}\nclass Base {\n\t/// <summary>Base summary</summary><remarks>Base remarks</remarks>\n\tpublic virtual void Method();\n}\n\");\n\t\t\tvar element = XmlDocumentationElement.Get(typeDefinition.Methods.Single(m => m.Name == \"Method\"));\n\t\t\tAssert.AreEqual(2, element.Children.Count());\n\t\t\tAssert.AreEqual(\"summary\", element.Children[0].Name);\n\t\t\tAssert.AreEqual(\"remarks\", element.Children[1].Name);\n\t\t\tAssert.AreEqual(\"Overridden summary\", element.Children[0].TextContent);\n\t\t\tAssert.AreEqual(\"Base remarks\", element.Children[1].TextContent);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DocumentationAboveAttribute()\n\t\t{\n\t\t\tInit(@\"using System;\n/// <summary/>\n[SomeAttribute]\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary/>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DocumentationAboveAttribute2()\n\t\t{\n\t\t\tInit(@\"using System;\n/// <summary/>\n[SomeAttribute] // a comment on the attribute\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary/>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DocumentationAboveAttributeInRegion()\n\t\t{\n\t\t\tInit(@\"using System;\n/// <summary/>\n#region R\n[SomeAttribute]\n#endregion\nclass Test { }\");\n\t\t\tAssert.AreEqual(\"<summary/>\", typeDefinition.Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CDATAInDocumentation()\n\t\t{\n\t\t\tInit(@\"using System;\n/// <summary>before<![CDATA[<xml/>]]>after</summary>\nclass Test { }\n\");\n\t\t\tvar element = XmlDocumentationElement.Get(typeDefinition);\n\t\t\tAssert.AreEqual(1, element.Children.Count());\n\t\t\tAssert.AreEqual(\"summary\", element.Children[0].Name);\n\t\t\tAssert.AreEqual(\"before<xml/>after\", element.Children[0].TextContent);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Documentation/IDStringTests.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.Documentation\n{\n\t[TestFixture]\n\tpublic class IDStringTests\n\t{\n\t\tclass IDStringTestProjectContent : DefaultUnresolvedAssembly, IDocumentationProvider\n\t\t{\n\t\t\tpublic IDStringTestProjectContent() : base(\"Test\") {}\n\t\t\t\n\t\t\tpublic DocumentationComment GetDocumentation(IEntity entity)\n\t\t\t{\n\t\t\t\t// Note: there's no mscorlib in the context.\n\t\t\t\t// These tests only use primitive types from mscorlib, so the full name is known\n\t\t\t\t// without resolving them.\n\t\t\t\treturn new DocumentationComment(IdStringProvider.GetIdString(entity), new SimpleTypeResolveContext(entity));\n\t\t\t}\n\t\t}\n\t\t\n\t\tIDStringTestProjectContent pc;\n\t\tICompilation compilation;\n\t\t\n\t\tvoid Init(string program)\n\t\t{\n\t\t\tpc = new IDStringTestProjectContent();\n\t\t\t\n\t\t\tvar syntaxTree = SyntaxTree.Parse(program, \"program.cs\");\n\t\t\tforeach (var type in syntaxTree.ToTypeSystem().TopLevelTypeDefinitions) {\n\t\t\t\tpc.AddTypeDefinition(type);\n\t\t\t}\n\t\t\tcompilation = new SimpleCompilation(pc, CecilLoaderTests.Mscorlib);\n\t\t}\n\t\t\n\t\tITypeDefinition GetTypeDefinition(string nameSpace, string name, int typeParameterCount = 0)\n\t\t{\n\t\t\treturn compilation.MainAssembly.GetTypeDefinition(new TopLevelTypeName(nameSpace, name, typeParameterCount));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeDefinitions()\n\t\t{\n\t\t\tstring program = @\"\nenum Color { Red, Blue, Green }\nnamespace Acme\n{\n\tinterface IProcess {}\n\tstruct ValueType {}\n\tclass Widget: IProcess\n\t{\n\t\tpublic class NestedClass {}\n\t\t\n\t\tpublic interface IMenuItem {}\n\t\t\n\t\tpublic delegate void Del(int i);\n\t\t\n\t\tpublic enum Direction { North, South, East, West }\n\t}\n\tclass MyList<T>\n\t{\n\t\tclass Helper<U,V> {}\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tAssert.AreEqual(\"T:Color\", GetTypeDefinition(string.Empty, \"Color\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.IProcess\", GetTypeDefinition(\"Acme\", \"IProcess\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.ValueType\", GetTypeDefinition(\"Acme\", \"ValueType\").Documentation.ToString());\n\t\t\t\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"T:Acme.Widget\", widget.Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.Widget.NestedClass\", widget.NestedTypes.Single(t => t.Name == \"NestedClass\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.Widget.IMenuItem\", widget.NestedTypes.Single(t => t.Name == \"IMenuItem\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.Widget.Del\", widget.NestedTypes.Single(t => t.Name == \"Del\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.Widget.Direction\", widget.NestedTypes.Single(t => t.Name == \"Direction\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.MyList`1\", GetTypeDefinition(\"Acme\", \"MyList\", 1).Documentation.ToString());\n\t\t\tAssert.AreEqual(\"T:Acme.MyList`1.Helper`2\", GetTypeDefinition(\"Acme\", \"MyList\", 1).NestedTypes.Single().Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Fields()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget : IProcess\n\t{\n\t\tpublic class NestedClass\n\t\t{\n\t\t\tprivate int value;\n\t\t}\n\t\t\n\t\tprivate string message;\n\t\tprivate const double PI = 3.14159;\n\t\tprivate unsafe float **ppValues;\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"F:Acme.Widget.NestedClass.value\", widget.NestedTypes.Single().Fields.Single().Documentation.ToString());\n\t\t\tAssert.AreEqual(\"F:Acme.Widget.message\", widget.Fields.Single(f => f.Name == \"message\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"F:Acme.Widget.PI\", widget.Fields.Single(f => f.Name == \"PI\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"F:Acme.Widget.ppValues\", widget.Fields.Single(f => f.Name == \"ppValues\").Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Constructors()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget: IProcess\n\t{\n\t\tstatic Widget() {}\n\t\tpublic Widget() {}\n\t\tpublic Widget(string s) {}\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.#cctor\", widget.Methods.Single(m => m.IsStatic).Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.#ctor\", widget.Methods.Single(m => !m.IsStatic && m.Parameters.Count == 0).Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.#ctor(System.String)\", widget.Methods.Single(m => m.Parameters.Count == 1).Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Destructor()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget: IProcess\n\t{\n\t\t~Widget() { }\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.Finalize\", widget.Methods.Single(m => m.SymbolKind == SymbolKind.Destructor).Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Methods()\n\t\t{\n\t\t\tstring program = @\"\nenum Color {}\nnamespace Acme\n{\n\tstruct ValueType { }\n\tclass Widget: IProcess\n\t{\n\t\tpublic class NestedClass\n\t\t{\n\t\t\tpublic void M(int i) {}\n\t\t}\n\t\t\n\t\tpublic static void M0() {...}\n\t\tpublic void M1(char c, out float f, ref ValueType v) {...}\n\t\tpublic void M2(short[] x1, int[,] x2, long[][] x3) {...}\n\t\tpublic void M3(long[][] x3, Widget[][,,] x4) {...}\n\t\tpublic unsafe void M4(char *pc, Color **pf) {...}\n\t\tpublic unsafe void M5(void *pv, double *[][,] pd) {...}\n\t\tpublic void M6(int? i, params object[] args) {...}\n\t}\n\t\n\tclass MyList<T>\n\t{\n\t\tpublic void Test(T t) { }\n\t}\n\t\n\tclass UseList\n\t{\n\t\tpublic void Process(MyList<Color> list) { }\n\t\tpublic MyList<T> GetValues<T>(T inputValue) { return null; }\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.NestedClass.M(System.Int32)\", widget.NestedTypes.Single().Methods.Single(m => m.SymbolKind == SymbolKind.Method).Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.M0\", widget.Methods.Single(m => m.Name == \"M0\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.M1(System.Char,System.Single@,Acme.ValueType@)\",\n\t\t\t                widget.Methods.Single(m => m.Name == \"M1\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.M2(System.Int16[],System.Int32[0:,0:],System.Int64[][])\",\n\t\t\t                widget.Methods.Single(m => m.Name == \"M2\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.M3(System.Int64[][],Acme.Widget[0:,0:,0:][])\",\n\t\t\t                widget.Methods.Single(m => m.Name == \"M3\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.M4(System.Char*,Color**)\",\n\t\t\t                widget.Methods.Single(m => m.Name == \"M4\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.M5(System.Void*,System.Double*[0:,0:][])\",\n\t\t\t                widget.Methods.Single(m => m.Name == \"M5\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.M6(System.Nullable{System.Int32},System.Object[])\",\n\t\t\t                widget.Methods.Single(m => m.Name == \"M6\").Documentation.ToString());\n\t\t\t\n\t\t\tAssert.AreEqual(\"M:Acme.MyList`1.Test(`0)\",\n\t\t\t                GetTypeDefinition(\"Acme\", \"MyList\", 1).Methods.Single(m => m.Name == \"Test\").Documentation.ToString());\n\t\t\t\n\t\t\tAssert.AreEqual(\"M:Acme.UseList.Process(Acme.MyList{Color})\",\n\t\t\t                GetTypeDefinition(\"Acme\", \"UseList\").Methods.Single(m => m.Name == \"Process\").Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.UseList.GetValues``1(``0)\",\n\t\t\t                GetTypeDefinition(\"Acme\", \"UseList\").Methods.Single(m => m.Name == \"GetValues\").Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedGenerics()\n\t\t{\n\t\t\tInit(\"class A<X> { class B<Y> { void M(A<Y>.B<X> a) { } } }\");\n\t\t\tITypeDefinition b = GetTypeDefinition(\"\", \"A\", 1).NestedTypes.Single();\n\t\t\tAssert.AreEqual(\"T:A`1.B`1\", b.Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:A`1.B`1.M(A{`1}.B{`0})\", b.Methods.Single(m => m.SymbolKind == SymbolKind.Method).Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Properties()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget: IProcess\n\t{\n\t\tpublic int Width { get {...} set {...} }\n\t\tpublic int this[int i] { get {...} set {...} }\n\t\tpublic int this[string s, int i] { get {...} set {...} }\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"P:Acme.Widget.Width\", widget.Properties.Single(p => p.Parameters.Count == 0).Documentation.ToString());\n\t\t\tAssert.AreEqual(\"P:Acme.Widget.Item(System.Int32)\",\n\t\t\t                widget.Properties.Single(p => p.Parameters.Count == 1).Documentation.ToString());\n\t\t\tAssert.AreEqual(\"P:Acme.Widget.Item(System.String,System.Int32)\",\n\t\t\t                widget.Properties.Single(p => p.Parameters.Count == 2).Documentation.ToString());\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Event()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget: IProcess\n\t{\n\t\tpublic event Del AnEvent;\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"E:Acme.Widget.AnEvent\", widget.Events.Single().Documentation.ToString());\n\t\t\t\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnaryOperator()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget: IProcess\n\t{\n\t\tpublic static Widget operator+(Widget x) { }\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.op_UnaryPlus(Acme.Widget)\", widget.Methods.Single(m => m.SymbolKind == SymbolKind.Operator).Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BinaryOperator()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget: IProcess\n\t{\n\t\tpublic static Widget operator+(Widget x1, Widget x2) { }\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.op_Addition(Acme.Widget,Acme.Widget)\", widget.Methods.Single(m => m.SymbolKind == SymbolKind.Operator).Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConversionOperator()\n\t\t{\n\t\t\tstring program = @\"\nnamespace Acme\n{\n\tclass Widget: IProcess\n\t{\n\t\tpublic static explicit operator int(Widget x) { }\n\t\tpublic static implicit operator long(Widget x) { }\n\t}\n}\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition widget = GetTypeDefinition(\"Acme\", \"Widget\");\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.op_Explicit(Acme.Widget)~System.Int32\", widget.Methods.First(m => m.SymbolKind == SymbolKind.Operator).Documentation.ToString());\n\t\t\tAssert.AreEqual(\"M:Acme.Widget.op_Implicit(Acme.Widget)~System.Int64\", widget.Methods.Last(m => m.SymbolKind == SymbolKind.Operator).Documentation.ToString());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CorlibIDStrings()\n\t\t{\n\t\t\tvar list = new SimpleCompilation(CecilLoaderTests.Mscorlib).FindType(typeof(List<>)).GetDefinition();\n\t\t\tAssert.AreEqual(\"T:System.Collections.Generic.List`1\",\n\t\t\t                IdStringProvider.GetIdString(list));\n\t\t\tAssert.AreEqual(\"M:System.Collections.Generic.List`1.Add(`0)\",\n\t\t\t                IdStringProvider.GetIdString(list.Methods.Single(m => m.Name == \"Add\")));\n\t\t\tAssert.AreEqual(\"M:System.Collections.Generic.List`1.AddRange(System.Collections.Generic.IEnumerable{`0})\",\n\t\t\t                IdStringProvider.GetIdString(list.Methods.Single(m => m.Name == \"AddRange\")));\n\t\t\tAssert.AreEqual(\"M:System.Collections.Generic.List`1.ConvertAll``1(System.Converter{`0,``0})\",\n\t\t\t                IdStringProvider.GetIdString(list.Methods.Single(m => m.Name == \"ConvertAll\")));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitGenericInterfaceImplementation_IDString()\n\t\t{\n\t\t\tstring program = @\"\nnamespace xxx {\ninterface IGeneric<A, B> { void Test<T>(ref T a); }\nclass Impl<T> : IGeneric<string[,], T> {\n\tvoid IGeneric<string[,], T>.Test<X>(ref X a);\n} }\n\";\n\t\t\tInit(program);\n\t\t\tITypeDefinition impl = GetTypeDefinition(\"xxx\", \"Impl\", 1);\n\t\t\tIMethod method = impl.Methods.Single(m => m.Name == \"Test\");\n\t\t\t\n\t\t\tAssert.AreEqual(\n\t\t\t\t\"M:xxx.Impl`1.xxx#IGeneric{System#String[@]@T}#Test``1(``0@)\",\n\t\t\t\tIdStringProvider.GetIdString(method));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Editor/ReadOnlyDocumentTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.Editor\n{\n\t[TestFixture]\n\tpublic class ReadOnlyDocumentTests\n\t{\n\t\t[Test]\n\t\tpublic void EmptyReadOnlyDocument()\n\t\t{\n\t\t\tIDocument document = new ReadOnlyDocument(string.Empty);\n\t\t\tAssert.AreEqual(string.Empty, document.Text);\n\t\t\tAssert.AreEqual(0, document.TextLength);\n\t\t\tAssert.AreEqual(1, document.LineCount);\n\t\t\tAssert.AreEqual(0, document.GetOffset(1, 1));\n\t\t\tAssert.AreEqual(new TextLocation(1, 1), document.GetLocation(0));\n\t\t\t\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(1).Offset);\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(1).EndOffset);\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(1).Length);\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(1).TotalLength);\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(1).DelimiterLength);\n\t\t\tAssert.AreEqual(1, document.GetLineByNumber(1).LineNumber);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimpleDocument()\n\t\t{\n\t\t\tstring text = \"Hello\\nWorld!\\r\\n\";\n\t\t\tIDocument document = new ReadOnlyDocument(text);\n\t\t\tAssert.AreEqual(text, document.Text);\n\t\t\tAssert.AreEqual(3, document.LineCount);\n\t\t\t\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(1).Offset);\n\t\t\tAssert.AreEqual(5, document.GetLineByNumber(1).EndOffset);\n\t\t\tAssert.AreEqual(5, document.GetLineByNumber(1).Length);\n\t\t\tAssert.AreEqual(6, document.GetLineByNumber(1).TotalLength);\n\t\t\tAssert.AreEqual(1, document.GetLineByNumber(1).DelimiterLength);\n\t\t\tAssert.AreEqual(1, document.GetLineByNumber(1).LineNumber);\n\t\t\t\n\t\t\tAssert.AreEqual(6, document.GetLineByNumber(2).Offset);\n\t\t\tAssert.AreEqual(12, document.GetLineByNumber(2).EndOffset);\n\t\t\tAssert.AreEqual(6, document.GetLineByNumber(2).Length);\n\t\t\tAssert.AreEqual(8, document.GetLineByNumber(2).TotalLength);\n\t\t\tAssert.AreEqual(2, document.GetLineByNumber(2).DelimiterLength);\n\t\t\tAssert.AreEqual(2, document.GetLineByNumber(2).LineNumber);\n\n\t\t\tAssert.AreEqual(14, document.GetLineByNumber(3).Offset);\n\t\t\tAssert.AreEqual(14, document.GetLineByNumber(3).EndOffset);\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(3).Length);\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(3).TotalLength);\n\t\t\tAssert.AreEqual(0, document.GetLineByNumber(3).DelimiterLength);\n\t\t\tAssert.AreEqual(3, document.GetLineByNumber(3).LineNumber);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/ConstructFixerTests.cs",
    "content": "﻿//\n// ConstructFixerTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture]\n\tpublic class ConstructFixerTests\n\t{\n\t\tstatic void Test (string input, string expectedOutput)\n\t\t{\n\t\t\tinput = input.Replace(\"\\r\\n\", \"\\n\");\n\t\t\texpectedOutput = expectedOutput.Replace(\"\\r\\n\", \"\\n\");\n\t\t\tint caretPositon = input.IndexOf('$');\n\t\t\tif (caretPositon > 0)\n\t\t\t\tinput = input.Substring(0, caretPositon) + input.Substring(caretPositon + 1);\n\n\t\t\tvar document1 = new StringBuilderDocument(input);\n\n\t\t\tint expectedCaretPosition = expectedOutput.IndexOf('$');\n\t\t\tif (expectedCaretPosition > 0)\n\t\t\t\texpectedOutput = expectedOutput.Substring(0, expectedCaretPosition) + expectedOutput.Substring(expectedCaretPosition + 1);\n\n\t\t\tvar fixer = new ConstructFixer(FormattingOptionsFactory.CreateMono (), new TextEditorOptions { EolMarker = \"\\n\" });\n\t\t\tint newCaretPosition;\n\t\t\tAssert.IsTrue(fixer.TryFix(document1, caretPositon, out newCaretPosition));   \n\t\t\tvar isEqual = expectedOutput == document1.Text.Replace(\"\\r\\n\", \"\\n\");\n\t\t\tif (!isEqual) {\n\t\t\t\tSystem.Console.WriteLine(\"expected:\");\n\t\t\t\tSystem.Console.WriteLine(expectedOutput);\n\t\t\t\tSystem.Console.WriteLine(\"was:\");\n\t\t\t\tSystem.Console.WriteLine(document1.Text);\n\t\t\t}\n\t\t\tAssert.IsTrue(isEqual); \n\t\t\tAssert.AreEqual(expectedCaretPosition, newCaretPosition); \n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallCase1()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tBar (42$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tBar (42);$\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallCase2()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tBar$ (;\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tBar ();$\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallCase3()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tBar ($)\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tBar ();$\n\t}\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestClassDeclaration()\n\t\t{\n\t\t\tTest(@\"class Foo$\", @\"class Foo\n{\n\t$\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestClassDeclaration_TestErrorRecovery()\n\t\t{\n\t\t\tTest(@\"class Foo$\n// Foo\n\", @\"class Foo\n{\n\t$\n}\n\n// Foo\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestDelegateDeclaration()\n\t\t{\n\t\t\tTest(\n@\"delegate void FooHandler (object foo$\", \n@\"delegate void FooHandler (object foo);\n$\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestMethodDeclaration()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar (int i$\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\t$\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestFieldDeclaration()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tint f$\n}\", @\"\nclass Foo\n{\n\tinf f;\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIfStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tif (true$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tif (true) {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestFixedStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nunsafe class Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tfixed (int* ptr = &i$\n\t}\n}\", @\"\nunsafe class Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tfixed (int* ptr = &i) {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestUsingStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tusing (var foo = new Foo()$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tusing (var foo = new Foo()) {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tlock (foo$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tlock (foo) {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestForeachStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar (string s)\n\t{\n\t\tforeach (var c in s$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar (string s)\n\t{\n\t\tforeach (var c in s) {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhileStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\twhile (true$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\twhile (true) {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSwitch()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tswitch (i$\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tswitch (i) {\n\t\t\t$\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestCase()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tswitch (i) {\n\t\t\tcase 1$\n\t\t}\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Bar (int i)\n\t{\n\t\tswitch (i) {\n\t\t\tcase 1:\n\t\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestBreakStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tbreak$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tbreak;\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestGotoStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tgoto foo$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tgoto foo;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturnStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\treturn 5$\n\t}\n}\", @\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\treturn 5;$\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestYieldBreakStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\tyield break$\n\t}\n}\", @\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\tyield break;$\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestYieldReturnStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\tyield return 5$\n\t}\n}\", @\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\tyield return 5;$\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestThrowStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\tthrow new Exception()$\n\t}\n}\", @\"\nclass Foo\n{\n\tint Bar ()\n\t{\n\t\tthrow new Exception();$\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCheckedStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tchecked$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tchecked {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUncheckedStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tunchecked$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tunchecked {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestUnsafeStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tunsafe$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tunsafe {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestContinueStatement()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tcontinue$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tcontinue;\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDoWhile()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tdo {\n\t\t} while (true$\n\t}\n}\", @\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tdo {\n\t\t} while (true);$\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"Fixme - parser error\")]\n\t\t[Test]\n\t\tpublic void TestComplexCase()\n\t\t{\n\t\t\tTest(\n\t\t\t\t@\"\nclass Foo\n{\n\tbool Bar (int i)\n\t{\n\t\tif$ (Bar (1\n\t}\n}\", @\"\nclass Foo\n{\n\tbool Bar (int i)\n\t{\n\t\tif (Bar ((((Bar((1))))))) {\n\t\t\t$\n\t\t}\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs",
    "content": "// \n// TastBlankLineFormatting.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture()]\n\tpublic class TestBlankLineFormatting : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBlankLinesAfterUsings ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesAfterUsings = 2;\n\t\t\t\n\t\t\tvar adapter = Test (policy, @\"using System;\nusing System.Text;\nnamespace Test\n{\n}\",\n@\"using System;\nusing System.Text;\n\n\nnamespace Test\n{\n}\", FormattingMode.Intrusive);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesBeforeUsings ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesAfterUsings = 0;\n\t\t\tpolicy.MinimumBlankLinesBeforeUsings = 2;\n\t\t\t\n\t\t\tvar adapter = Test (policy, @\"using System;\nusing System.Text;\nnamespace Test\n{\n}\",\n@\"\n\nusing System;\nusing System.Text;\nnamespace Test\n{\n}\", FormattingMode.Intrusive);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesBeforeFirstDeclaration ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesBeforeFirstDeclaration = 2;\n\t\t\t\n\t\t\tvar adapter = Test (policy, @\"namespace Test\n{\n\tclass Test\n\t{\n\t}\n}\",\n@\"namespace Test\n{\n\n\n\tclass Test\n\t{\n\t}\n}\", FormattingMode.Intrusive);\n\t\t\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesBetweenTypes ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesBetweenTypes = 1;\n\t\t\t\n\t\t\tvar adapter = Test (policy, @\"namespace Test\n{\n\tclass Test1\n\t{\n\t}\n\tclass Test2\n\t{\n\t}\n\tclass Test3\n\t{\n\t}\n}\",\n@\"namespace Test\n{\n\tclass Test1\n\t{\n\t}\n\n\tclass Test2\n\t{\n\t}\n\n\tclass Test3\n\t{\n\t}\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesBetweenFields ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesBetweenFields = 1;\n\t\t\t\n\t\t\tvar adapter = Test (policy, @\"class Test\n{\n\tint a;\n\tint b;\n\tint c;\n}\",\n@\"class Test\n{\n\tint a;\n\n\tint b;\n\n\tint c;\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesBetweenEventFields ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesBetweenEventFields = 1;\n\t\t\t\n\t\t\tvar adapter = Test (policy, @\"class Test\n{\n\tpublic event EventHandler a;\n\tpublic event EventHandler b;\n\tpublic event EventHandler c;\n}\",\n@\"class Test\n{\n\tpublic event EventHandler a;\n\n\tpublic event EventHandler b;\n\n\tpublic event EventHandler c;\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesBetweenMembers ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesBetweenMembers = 1;\n\n\t\t\tvar adapter = Test (policy, @\"class Test\n{\n\tvoid AMethod ()\n\t{\n\t}\n\tvoid BMethod ()\n\t{\n\t}\n\tvoid CMethod ()\n\t{\n\t}\n}\", @\"class Test\n{\n\tvoid AMethod ()\n\t{\n\t}\n\n\tvoid BMethod ()\n\t{\n\t}\n\n\tvoid CMethod ()\n\t{\n\t}\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesAroundRegion ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesAroundRegion = 2;\n\n\t\t\tvar adapter = Test (policy, @\"class Test\n{\n\t#region FooBar\n\t\n\tvoid AMethod ()\n\t{\n\t}\n\t\n\t#endregion\n\tvoid BMethod ()\n\t{\n\t}\n}\", @\"class Test\n{\n\t#region FooBar\n\n\tvoid AMethod ()\n\t{\n\t}\n\n\t#endregion\n\n\n\tvoid BMethod ()\n\t{\n\t}\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlankLinesInsideRegion ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesInsideRegion = 2;\n\t\t\tvar adapter = Test (policy, @\"class Test\n{\n\t#region FooBar\n\tvoid AMethod ()\n\t{\n\t}\n\t#endregion\n}\", @\"class Test\n{\n\t#region FooBar\n\n\n\tvoid AMethod ()\n\t{\n\t}\n\n\n\t#endregion\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13373 - XS adding linefeeds within #ifs\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13373_Global ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tTest (policy, @\"\n#if false\nclass Test2\n{\n}\n#endif\n\",\n\t\t\t                    @\"\n#if false\nclass Test2\n{\n}\n#endif\n\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug13373_TypeLevel ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tTest (policy, \n@\"class Foo\n{\n\t#if false\n\tclass Test2\n\t{\n\t}\n\t#endif\n}\n\",\n@\"class Foo\n{\n\t#if false\n\tclass Test2\n\t{\n\t}\n\t#endif\n}\n\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBug13373_StatementLevel ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tTest (policy, \n\t\t\t                    @\"class Foo\n{\n\tvoid Test ()\n\t{\n\t\t#if false\n\t\tclass Test2\n\t\t{\n\t\t}\n\t\t#endif\n\t}\n}\",\n@\"class Foo\n{\n\tvoid Test ()\n\t{\n\t\t#if false\n\t\tclass Test2\n\t\t{\n\t\t}\n\t\t#endif\n\t}\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddIndentOnBlankLines ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.EmptyLineFormatting = EmptyLineFormatting.Indent;\n\n\t\t\tTest (policy, @\"class Foo\n{\n\tvoid Test ()\n\t{\n\t}\n\tvoid Test2 ()\n\t{\n\t}\n}\", @\"class Foo\n{\n\tvoid Test ()\n\t{\n\t}\n\t\n\tvoid Test2 ()\n\t{\n\t}\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveIndentOnBlankLines ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.EmptyLineFormatting = EmptyLineFormatting.DoNotIndent;\n\n\t\t\tTest (policy, @\"class Foo\n{\n\tvoid Test ()\n\t{\n\t}\n\t\n\tvoid Test2 ()\n\t{\n\t}\n}\", @\"class Foo\n{\n\tvoid Test ()\n\t{\n\t}\n\n\tvoid Test2 ()\n\t{\n\t}\n}\", FormattingMode.Intrusive);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotChangeIndentOnBlankLines ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.EmptyLineFormatting = EmptyLineFormatting.DoNotChange;\n\n\t\t\tvar indented = @\"class Foo\n{\n\tvoid Test ()\n\t{\n\t}\n\t\n\tvoid Test2 ()\n\t{\n\t}\n}\";\n\t\t\tvar nonIndented = @\"class Foo\n{\n\tvoid Test ()\n\t{\n\t}\n\n\tvoid Test2 ()\n\t{\n\t}\n}\";\n\t\t\tTest(policy, indented, indented, FormattingMode.Intrusive);\n\t\t\tTest(policy, nonIndented, nonIndented, FormattingMode.Intrusive);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs",
    "content": "// \n// TestBraceStyle.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture()]\n\tpublic class TestBraceStyle : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestNamespaceBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.NamespaceBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\t\t\t\n\t\t\tvar adapter = Test (policy, @\"namespace A\n{\nnamespace B {\n\tclass Test {}\n}\n}\",\n@\"namespace A {\n\tnamespace B {\n\t\tclass Test {}\n\t}\n}\");\n\t\t\t\n\t\t\tpolicy.NamespaceBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tContinue (policy, adapter,\n@\"namespace A\n\t{\n\tnamespace B\n\t\t{\n\t\tclass Test {}\n\t\t}\n\t}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.AnonymousMethodBraceStyle = BraceStyle.EndOfLine;\n\n\t\t\tTest (policy,\n@\"class Test\n{\n\tvoid Foo ()\n\t{\n\t\tEventHandler handler = delegate(object sender, EventArgs e){foo ();};\n\t}\n}\",\n@\"class Test\n{\n\tvoid Foo ()\n\t{\n\t\tEventHandler handler = delegate(object sender, EventArgs e) {\n\t\t\tfoo ();\n\t\t};\n\t}\n}\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestClassBraceStlye ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest (policy,\n@\"class Test {}\",\n@\"class Test {\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStructBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.StructBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy,\n@\"struct Test {}\",\n@\"struct Test\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInterfaceBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.InterfaceBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy,\n@\"interface Test {}\",\n@\"interface Test\n{\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEnumBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.EnumBraceStyle = BraceStyle.NextLineShifted;\n\t\t\t\n\t\t\tTest (policy, @\"enum Test {\n\tA\n}\",\n@\"enum Test\n\t{\n\tA\n\t}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodBraceStlye ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MethodBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tTest MyMethod() {}\n}\",\n@\"class Test\n{\n\tTest MyMethod ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ConstructorBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tTest() {}\n}\",\n@\"class Test\n{\n\tTest ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDestructorBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.DestructorBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\t~Test() {}\n}\",\n@\"class Test\n{\n\t~Test ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.PropertyBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tTest A {\n\t\tget;\n\t\tset;\n\t}\n}\",\n@\"class Test\n{\n\tTest A\n\t{\n\t\tget;\n\t\tset;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyGetBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.PropertyGetBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tTest A {\n\t\tget {\n\t\t\treturn null;\n\t\t}\n\t\tset;\n\t}\n}\",\n@\"class Test\n{\n\tTest A {\n\t\tget\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tset;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllowPropertyGetBlockInline ()\n\t\t{\n\t\t\t\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.PropertyBraceStyle = BraceStyle.DoNotChange;\n\t\t\tpolicy.SimpleGetBlockFormatting = PropertyFormatting.AllowOneLine;\n\t\t\tpolicy.SimpleSetBlockFormatting = PropertyFormatting.ForceNewLine;\n\n\t\t\tvar adapter = Test (policy, @\"class Test\n{\n\tTest A {\n\t\tget { return null;}\n\t\tset { ; }\n\t}\n}\",\n@\"class Test\n{\n\tTest A {\n\t\tget { return null; }\n\t\tset {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.SimpleGetBlockFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tpolicy.SimpleSetBlockFormatting = PropertyFormatting.ForceOneLine;\n\t\t\tContinue (policy, adapter,\n@\"class Test\n{\n\tTest A {\n\t\tget {\n\t\t\treturn null;\n\t\t}\n\t\tset { ; }\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyForceOneLine ()\n\t\t{\n\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceOneLine;\n\n\t\t\tTest (policy, @\"class Test\n{\n\tTest A {\n\t\tget { return null; }\n\t\tset { ; }\n\t}\n}\",\n\t\t\t                    @\"class Test\n{\n\tTest A { get { return null; } set { ; } }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllowPropertySetBlockInline ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.PropertyBraceStyle = BraceStyle.DoNotChange;\n\t\t\tpolicy.SimpleGetBlockFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tpolicy.SimpleSetBlockFormatting = PropertyFormatting.ForceOneLine;\n\n\t\t\tvar adapter = Test (policy, @\"class Test\n{\n\tTest A {\n\t\tget { return null; }\n\t\tset { ; }\n\t}\n}\",\n@\"class Test\n{\n\tTest A {\n\t\tget {\n\t\t\treturn null;\n\t\t}\n\t\tset { ; }\n\t}\n}\");\n\t\t\t\n\t\t\tpolicy.SimpleSetBlockFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tContinue (policy, adapter,\n@\"class Test\n{\n\tTest A {\n\t\tget {\n\t\t\treturn null;\n\t\t}\n\t\tset {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertySetBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.PropertySetBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tTest A {\n\t\tget;\n\t\tset {\n\t\t\t;\n\t\t}\n\t}\n}\",\n@\"class Test\n{\n\tTest A {\n\t\tget;\n\t\tset\n\t\t{\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEventBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.EventBraceStyle = BraceStyle.NextLine;\n\t\t\tpolicy.EventAddBraceStyle = BraceStyle.NextLine;\n\t\t\tpolicy.EventRemoveBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tpublic event EventHandler Handler {\n\t\tadd {\n}\n\t\tremove {\n}\n\t}\n}\",\n@\"class Test\n{\n\tpublic event EventHandler Handler\n\t{\n\t\tadd\n\t\t{\n\t\t}\n\t\tremove\n\t\t{\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllowEventAddBlockInline ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.AllowEventAddBlockInline = true;\n\t\t\tpolicy.AllowEventRemoveBlockInline = false;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tpublic event EventHandler Handler {\n\t\tadd { ; }\n\t\tremove { ; }\n\t}\n}\",\n@\"class Test\n{\n\tpublic event EventHandler Handler {\n\t\tadd { ; }\n\t\tremove {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllowEventRemoveBlockInline ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.AllowEventAddBlockInline = false;\n\t\t\tpolicy.AllowEventRemoveBlockInline = true;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tpublic event EventHandler Handler {\n\t\tadd { ; }\n\t\tremove { ; }\n\t}\n}\",\n@\"class Test\n{\n\tpublic event EventHandler Handler {\n\t\tadd {\n\t\t\t;\n\t\t}\n\t\tremove { ; }\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore(\"FixMe\")]\n\t\t[Test]\n\t\tpublic void TestTryCatchWithBannerStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.BannerStyle;\n\t\t\tTest (policy, @\"class Test\n{\n\tvoid Foo ()\n\t{\n\t\t\t\t\ttry  {\n\t\t\tFoo (); } catch (Exception) { } catch (Exception) { } finally { Foo ();}\n\t}\n}\",\n@\"class Test\n{\n\tvoid Foo ()\n\t{\n\t\ttry {\n\t\t\tFoo ();\n\t\t\t} catch (Exception) {\n\t\t\t} catch (Exception) {\n\t\t\t} finally {\n\t\t\tFoo ();\n\t\t\t}\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIndentBlocksInsideExpressions ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman ();\n\t\t\tTest (policy,\n\t\t\t\t@\"class Test\n{\n\tvoid Foo()\n\t{\n\t\tFooBar(delegate{Foo();});\n\t}\n}\",\n\t\t\t\t@\"class Test\n{\n\tvoid Foo()\n\t{\n\t\tFooBar(delegate\n\t\t\t{\n\t\t\t\tFoo();\n\t\t\t});\n\t}\n}\");\n\t\t}\n\t\n\t\t/// <summary>\n\t\t/// Bug 18254 - Allow customization of indentation for anonymous methods\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug18254 ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman ();\n\t\t\tTest (policy,\n\t\t\t\t@\"class Test\n{\n\tvoid Foo()\n\t{\n\t\tUIView.Animate(duration, () =>\n{\n    view.Alpha = 0;\n}, null);\n\n\t}\n}\",\n\t\t\t\t@\"class Test\n{\n\tvoid Foo()\n\t{\n\t\tUIView.Animate(duration, () =>\n\t\t\t{\n\t\t\t\tview.Alpha = 0;\n\t\t\t}, null);\n\n\t}\n}\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestExpressionFormatting.cs",
    "content": "//\n// TestExpressionFormatting.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture]\n\tpublic class TestExpressionFormatting : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestPointerType ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"unsafe class Test\n{\n\tbyte *foo;\n\n\tTest TestMethod ()\n\t{\n\t\tTest *  *bar;\n\t}\n}\", @\"unsafe class Test\n{\n\tbyte* foo;\n\n\tTest TestMethod ()\n\t{\n\t\tTest** bar;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullableType ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"unsafe class Test\n{\n\tbyte ?foo;\n\n\tTest TestMethod ()\n\t{\n\t\tint ? bar;\n\t}\n}\", @\"unsafe class Test\n{\n\tbyte? foo;\n\n\tTest TestMethod ()\n\t{\n\t\tint? bar;\n\t}\n}\");\n\t\t}\n\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestArrayInitializer ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"using System.Collections.Generic;\n\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tvar list = new List<int> {\n1, 2,\n                 3            , 4\n\t\t};\n\t}\n}\", @\"using System.Collections.Generic;\n\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tvar list = new List<int> {\n\t\t\t1, 2,\n\t\t\t3, 4\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoUneccessaryChangesToImplicitArrayInitializer ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tconst string input = @\"using System.Collections.Generic;\n\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tvar list = { 1, 2 };\n\t}\n}\";\n\n\t\t\tTestNoUnnecessaryChanges(policy, input);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAllowOneLinedArrayInitialziers ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.AllowOneLinedArrayInitialziers = true;\n\t\t\tTest (policy, @\"using System.Collections.Generic;\n\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tvar list = new List<int> {1, 2, 3            , 4 };\n\t}\n}\", @\"using System.Collections.Generic;\n\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tvar list = new List<int> { 1, 2, 3, 4 };\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMemberReferenceFormatting ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tSystem.   Console     .WriteLine ();\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tSystem.Console.WriteLine ();\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void AnonymousBlocksAsParameter ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tTest (policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tFooBar (\n\t\t\tfoo,\n\t\t\tdelegate {\nBar ();\n}, \ntest\n);\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tFooBar (\n\t\t\tfoo,\n\t\t\tdelegate {\n\t\t\t\tBar ();\n\t\t\t}, \n\t\t\ttest\n\t\t);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestAnonymousMethodBlocks ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tpolicy.AnonymousMethodBraceStyle = BraceStyle.NextLine;\n\n\t\t\tTest (policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tAction act = delegate{};\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tAction act = delegate\n\t\t{\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLambdaBraceStyle ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tpolicy.AnonymousMethodBraceStyle = BraceStyle.NextLine;\n\n\t\t\tTest (policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tAction act = () => {};\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tAction act = () =>\n\t\t{\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBinaryExpressionsInInitializer ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"class Test\n{\n\tprivate void Foo ()\n\t{\n\t\tint x =    5+ \n23 - \n43*12 - 44*\n5;\n\t}\n}\n\", @\"class Test\n{\n\tprivate void Foo ()\n\t{\n\t\tint x = 5 +\n\t\t        23 -\n\t\t        43 * 12 - 44 *\n\t\t        5;\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBinaryExpressionsInInitializerBreakAfterAssign ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"class Test\n{\n\tprivate void Foo ()\n\t{\n\t\tint x =\n 5+ \n23 \n- 43\n*12 \n - \n44*\n5;\n\t}\n}\n\", @\"class Test\n{\n\tprivate void Foo ()\n\t{\n\t\tint x =\n\t\t\t5 +\n\t\t\t23\n\t\t\t- 43\n\t\t\t* 12\n\t\t\t-\n\t\t\t44 *\n\t\t\t5;\n\t}\n}\n\");\n\t\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBinaryExpressionsInInitializerWithParenthesizedExpr ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"class Test\n{\n\tprivate void Foo ()\n\t{\n\t\tint x = 5\n\t\t+ (2343 *  12)            - (\n\t\t44 * 5\n\t\t);\n\t}\n}\n\", @\"class Test\n{\n\tprivate void Foo ()\n\t{\n\t\tint x = 5\n\t\t        + (2343 * 12) - (\n\t\t            44 * 5\n\t\t        );\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestArrayInitializerFormattingBugSimple ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateSharpDevelop ();\n\t\t\tTest (policy, @\"class Test\n{\n\tstatic readonly AstNode forPattern =\n\t\tnew Choice {\n\t\t\tnew BinaryOperatorExpression(\n\t\t\t\tPatternHelper.OptionalParentheses(\n\t\t\t\t\tnew AnyNode(\"\"upperBound\"\")\n\t\t\t\t)\n\t\t\t)\n\t\t};\n}\n\", @\"class Test\n{\n\tstatic readonly AstNode forPattern =\n\t\tnew Choice {\n\t\t\tnew BinaryOperatorExpression(\n\t\t\t\tPatternHelper.OptionalParentheses(\n\t\t\t\t\tnew AnyNode(\"\"upperBound\"\")\n\t\t\t\t)\n\t\t\t)\n\t\t};\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs",
    "content": "// \n// TestFormattingBugs.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture()]\n\tpublic class TestFormattingBugs : TestBase\n\t{\n\t\t/// <summary>\n\t\t/// Bug 325187 - Bug in smart indent\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug325187()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ElseNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\t\n\t\t\tTestStatementFormatting (policy,\n@\"foreach (int i in myints)\nif (i == 6)\nConsole.WriteLine (\"\"Yeah\"\");\nelse\nConsole.WriteLine (\"\"Bad indent\"\");\",\n@\"foreach (int i in myints)\n\tif (i == 6)\n\t\tConsole.WriteLine (\"\"Yeah\"\");\n\telse\n\t\tConsole.WriteLine (\"\"Bad indent\"\");\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 415469 - return ternary in a switch is not tabbed properly\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug415469 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\t\n\t\t\tTestStatementFormatting (policy,\n@\"switch (condition) {\ncase CONDITION1:\nreturn foo != null ? foo.Bar : null;\ncase CONDITION2:\nstring goo = foo != null ? foo.Bar : null;\nreturn \"\"Should be indented like this\"\";\n}\", @\"switch (condition) {\ncase CONDITION1:\n\treturn foo != null ? foo.Bar : null;\ncase CONDITION2:\n\tstring goo = foo != null ? foo.Bar : null;\n\treturn \"\"Should be indented like this\"\";\n}\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 540043 - Format option for alignment of using-statements\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug540043 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\t\n\t\t\tTestStatementFormatting (policy,\n@\"using (IDisposable a = null)\n   using (IDisposable b = null) {\n\t\t\tint c;\n   }\n\", @\"using (IDisposable a = null)\nusing (IDisposable b = null) {\n\tint c;\n}\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 655635 - Auto format document doesn't indent comments as well\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug655635 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\t\n\t\t\tTestStatementFormatting (policy,\n@\"try {\n // Comment 1\n\tmyObject.x = Run ();\n} catch (InvalidOperationException e) {\n\tConsole.WriteLine (e.Message);\n}\", @\"try {\n\t// Comment 1\n\tmyObject.x = Run ();\n} catch (InvalidOperationException e) {\n\tConsole.WriteLine (e.Message);\n}\");\n\t\t}\n\n\t\tvoid TestStatementFormatting (CSharpFormattingOptions policy, string input, string expectedOutput)\n\t\t{\n\t\t\tvar result = GetResult (policy, @\"class Test\n{\n\tMyType TestMethod ()\n\t{\n\t\t\" + input + @\"\n\t}\n}\");\n\t\t\tint start = result.GetOffset (5, 1);\n\t\t\tint end = result.GetOffset (result.LineCount - 1, 1);\n\t\t\tstring text = result.GetText (start, end - start).Trim ();\n\t\t\texpectedOutput = NormalizeNewlines(expectedOutput).Replace (\"\\n\", \"\\n\\t\\t\");\n\t\t\tif (expectedOutput != text)\n\t\t\t\tConsole.WriteLine (text);\n\t\t\tAssert.AreEqual (expectedOutput, text);\n\t\t}\n\n\t\t/// <summary>\n\t\t///  Bug 659675 - on-the-fly code formatting breaks @-prefixed identifiers\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug659675 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTestStatementFormatting (policy, \"@string=@int;\", \"@string = @int;\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 670213 - Document formatter deletes valid text!\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug670213 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MethodBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tTest MyMethod() // Comment\n\t{\n\t}\n}\",\n\t\t\t      @\"class Test\n{\n\tTest MyMethod () { // Comment\n\t}\n}\");\n\t\tTest (policy, @\"class Test\n{\n\tTest MyMethod() // Comment\n\t{\n\t\tFoo ();\n\t}\n}\",\n\t\t      @\"class Test\n{\n\tTest MyMethod () { // Comment\n\t\tFoo ();\n\t}\n}\");\n\t}\n\t\t\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 677261 - Format Document with constructor with over-indented opening curly brace\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug677261 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ConstructorBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\tTest ()\n\t   {\n\t}\n}\",\n@\"class Test\n{\n\tTest () {\n\t}\n}\");\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Bug 3586 -Format code is removing try { code blocks\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug3586 ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ConstructorBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest (policy, @\"public class A\n{\n\tpublic object GetValue ()\n        {\n            try\n            {\nfoo ();\n            }\n            catch\n            {\n            }\n        }\n}\",\n@\"public class A\n{\n\tpublic object GetValue ()\n\t{\n\t\ttry {\n\t\t\tfoo ();\n\t\t} catch {\n\t\t}\n\t}\n}\");\n\t\t}\n\n        /// <summary>\n        /// Bug GH35 - Formatter issues with if/else statements and // comments\n        /// </summary>\n        [Ignore]\n        public void TestBugGH35()\n        {\n            var policy = FormattingOptionsFactory.CreateMono ();\n            policy.ConstructorBraceStyle = BraceStyle.EndOfLine;\n\n            Test(policy, @\"public class A : B\n{\n    public void Test()\n    {\n        // Comment before\n        if (conditionA) {\n            DoSomething();\n        }\n        // Comment before else ends up incorporating it\n        else if (conditionB) {\n            DoSomethingElse();\n        }\n    }\n}\",\n@\"public class A : B\n{\n\tpublic void Test()\n\t{\n\t\t// Comment before\n\t\tif (conditionA) {\n\t\t\tDoSomething();\n\t\t}\n\t\t// Comment before else ends up incorporating it\n\t\telse if (conditionB) {\n\t\t\tDoSomethingElse();\n\t\t}\n\t}\n}\");\n        }\n\n        /// <summary>\n        /// Bug GH35a - Formatter issues with if/else statements and // comments else variant\n        /// </summary>\n        [Ignore]\n        public void TestBugGH35a()\n        {\n            var policy = FormattingOptionsFactory.CreateMono ();\n            policy.ConstructorBraceStyle = BraceStyle.EndOfLine;\n\n            Test(policy, @\"public class A : B\n{\n    public void Test()\n    {\n        // Comment before\n        if (conditionA) {\n            DoSomething();\n        }\n        // Comment before else ends up incorporating it\n        else (conditionB) {\n            DoSomethingElse();\n        }\n    }\n}\",\n@\"public class A : B\n{\n\tpublic void Test()\n\t{\n\t\t// Comment before\n\t\tif (conditionA) {\n\t\t\tDoSomething();\n\t\t}\n\t\t// Comment before else ends up incorporating it\n\t\telse (conditionB) {\n\t\t\tDoSomethingElse();\n\t\t}\n\t}\n}\");\n        }\n\n\n\t\t/// <summary>\n\t\t/// Bug 11601 - Formatting document moves \"{\" into the #endif line \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug11601 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MethodBraceStyle = BraceStyle.EndOfLine;\n\n\t\t\tTest (policy, @\"class Test\n{\n\t#if true\n\tTest MyMethod () \n\t#else\n\tTest MyMethod2 () \n\t#endif\t\n\t{\n\t}\n}\",\n@\"class Test\n{\n\t#if true\n\tTest MyMethod () \n\t#else\n\tTest MyMethod2 () \n\t#endif\t\n\t{\n\t}\n}\");\n\t\t}\n\t\n\n\t\t/// <summary>\n\t\t/// Bug 12270 - Code formatter breaks new() constraints\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug12270()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy,\n@\"class C\n{\n\tpublic void Test<T> () where T : new  ()\n\t{\n\t}\n}\",\n@\"class C\n{\n\tpublic void Test<T> () where T : new()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 14324 - System.ArgumentOutOfRangeException while formatting C# code\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14324()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy,\n\t\t\t     @\"class C\n{\n\tpublic void Test ()\n\t{\n\t\tif\n(true ||\nfalse) {\n}\n\t}\n}\",\n\t\t\t     @\"class C\n{\n\tpublic void Test ()\n\t{\n\t\tif (true ||\n\t\tfalse) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\n\t\t/// <summary>\n\t\t/// Bug 14957 - System.InvalidOperationException: Sequence contains no elements\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug14957()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceOneLine;\n\t\t\tTest(policy,\n\t\t\t\t@\"class X\n{\n\tpublic int Foo { get {\n\t} }\n}\", @\"class X\n{\n\tpublic int Foo { get { } }\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 15218 - Saving causing a crash\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug15218()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceOneLine;\n\t\t\tTest(policy,\n\t\t\t\t@\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tfoo += delegate(object s, EventArgs a)\n\t\t{\n\t\t\tvar myDelegate = delegate()\n\t\t\t{\n\t\t\t\t\t\n\t\t\t};\n\t\t};  \n\t}\n}\n\", @\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tfoo += delegate(object s, EventArgs a) {\n\t\t\tvar myDelegate = delegate() {\n\t\t\t\t\t\n\t\t\t};\n\t\t};  \n\t}\n}\n\");\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 17047 - Smart indent failure\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug17047()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ChainedMethodCallWrapping = Wrapping.WrapAlways;\n\t\t\tTest(policy,\n\t\t\t\t@\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tObservable.Merge (shotStats, touchStats)\n\t\t\t.GroupBy (e => e.Type)\n\t\t\t.Subscribe (statGroup => {\n\t\t\t\tStats.Add (new StatItemViewModel (statGroup));\n\t\t\t});\n\t}\n}\n\", @\"class Foo\n{\n\tvoid Bar ()\n\t{\n\t\tObservable.Merge (shotStats, touchStats)\n\t\t\t.GroupBy (e => e.Type)\n\t\t\t.Subscribe (statGroup => {\n\t\t\t\tStats.Add (new StatItemViewModel (statGroup));\n\t\t\t});\n\t}\n}\n\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestGlobalLevelFormatting.cs",
    "content": "//\n// TestGlobalLevelFormatting.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture]\n\tpublic class TestGlobalLevelFormatting : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestGlobalAttributes ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy,\n\t\t\t      @\"[assembly: AssemblyDescription   (\"\"\"\"  )   ]\",\n\t\t\t      @\"[assembly: AssemblyDescription (\"\"\"\")]\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13361 - Format Document partially removes pragmas (#pragma\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13361()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, \n\t\t\t     @\"#pragma warning disable 0219\n\nclass Foo\n{\n\t#pragma warning disable 123\n\tvoid Foo ()\n\t{\n\t\t#pragma warning disable 123\n\t}\n}\", @\"#pragma warning disable 0219\n\nclass Foo\n{\n\t#pragma warning disable 123\n\tvoid Foo ()\n\t{\n\t\t#pragma warning disable 123\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 13413 - Formatter inserts new line between #undef statements in an #if block on every reformat \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug13413()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, \n\t\t\t     @\"#if foo\n#undef a\n#undef b\n#undef c\n#undef d\n#endif\n\", @\"#if foo\n#undef a\n#undef b\n#undef c\n#undef d\n#endif\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingBlankLines ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MinimumBlankLinesBeforeUsings = 2;\n\t\t\tTest(policy,\n\t\t\t      @\"//\nusing System;\",\n\t\t\t      @\"//\n\n\nusing System;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingBlankLinesCase2 ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MinimumBlankLinesBeforeUsings = 2;\n\t\t\tTest(policy,\n\t\t\t       @\"//\n\n\nusing System;\",\n\t\t\t       @\"//\n\n\nusing System;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingBlankLinesCase3 ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MinimumBlankLinesBeforeUsings = 2;\n\t\t\tTest(policy,\n\t\t\t      @\"\n\nusing System;\",\n\t\t\t      @\"\n\nusing System;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingBlankLinesCase4 ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MinimumBlankLinesBeforeUsings = 2;\n\t\t\tTest (policy,\n\t\t\t      @\"using System;\",\n\t\t\t      @\"\n\nusing System;\");\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestKeepReformattingRules.cs",
    "content": "// \n// TestKeepReformattingRules.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture()]\n\tpublic class TestKeepReformattingRules : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestKeepCommentsAtFirstColumnTrue()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.KeepCommentsAtFirstColumn = true;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n// comment\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n// comment\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestKeepCommentsAtFirstColumnFalse()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.KeepCommentsAtFirstColumn = false;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n// comment\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\t// comment\n\t}\n}\");\n\n\t\t\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestKeepCommentsAfterStatement()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.KeepCommentsAtFirstColumn = true;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBar (); // comment\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBar (); // comment\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestLinq.cs",
    "content": "// TestLinq.cs\n//  \n// Author:\n//       Luís Reis <luiscubal@gmail.com>\n// \n// Copyright (c) 2013 Luís Reis\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture]\n\tpublic class TestLinq : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestBasicQuery ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar ax = from y in z\nselect y;\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar ax = from y in z\n\t\t         select y;\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void TestFormatWhole ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x =from y in z\nselect y;\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z\n\t\t        select y;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFormatParenthesized ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = (from y in z\nselect y);\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = (from y in z\n\t\t         select y);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFormatInExpression ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = 1 + (from y in new int[1]\nselect y).First();\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = 1 + (from y in new int[1]\n\t\t             select y).First ();\n\t}\n}\");\n\t\t}\n\n\t\t[Ignore]\n\t\t[Test]\n\t\tpublic void TestFormatMultiple ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in\nfrom w in k\nselect w\nselect y;\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in\n\t\t            from w in k\n\t\t            select w\n\t\t        select y;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestExpression ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z\nselect\n3;\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z\n\t\t        select\n\t\t            3;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicQueryNoLines ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.NewLineBeforeNewQueryClause = NewLinePlacement.SameLine;\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z\nselect y;\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z select y;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicQueryAlwaysChangeLines ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.NewLineBeforeNewQueryClause = NewLinePlacement.NewLine;\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z\nselect y;\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z\n\t\t        select y;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBasicQueryAddLine ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.NewLineBeforeNewQueryClause = NewLinePlacement.NewLine;\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z select y;\n\t}\n}\", @\"\nclass Test\n{\n\tpublic void Foo ()\n\t{\n\t\tvar x = from y in z\n\t\t        select y;\n\t}\n}\");\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs",
    "content": "// \n// TestFormattingVisitor.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture]\n\tpublic class TestSpacingVisitor : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestFieldSpacesBeforeComma1()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.SpaceBeforeFieldDeclarationComma = false;\n\t\t\tpolicy.SpaceAfterFieldDeclarationComma = false;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tint a           ,                   b,          c;\n}\",\n@\"class Test {\n\tint a,b,c;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldSpacesBeforeComma2 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.SpaceBeforeFieldDeclarationComma = true;\n\t\t\tpolicy.SpaceAfterFieldDeclarationComma = true;\n\t\t\t\n\t\t\tTest (policy, @\"class Test {\n\tint a           ,                   b,          c;\n}\",\n@\"class Test {\n\tint a , b , c;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixedFieldSpacesBeforeComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.SpaceAfterFieldDeclarationComma = true;\n\t\t\tpolicy.SpaceBeforeFieldDeclarationComma = true;\n\t\t\t\n\t\t\tTest (policy, @\"class Test {\n\tfixed int a[10]           ,                   b[10],          c[10];\n}\",\n\t@\"class Test {\n\tfixed int a[10] , b[10] , c[10];\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstFieldSpacesBeforeComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.SpaceAfterFieldDeclarationComma = false;\n\t\t\tpolicy.SpaceBeforeFieldDeclarationComma = false;\n\t\t\t\n\t\t\tTest (policy, @\"class Test {\n\tconst int a = 1           ,                   b = 2,          c = 3;\n}\",\n@\"class Test {\n\tconst int a = 1,b = 2,c = 3;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeMethodDeclarationParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeMethodDeclarationParentheses = true;\n\t\t\t\n\t\t\tTest (policy, @\"public abstract class Test\n{\n\tpublic abstract Test TestMethod();\n}\",\n@\"public abstract class Test\n{\n\tpublic abstract Test TestMethod ();\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeConstructorDeclarationParenthesesDestructorCase ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeConstructorDeclarationParentheses = true;\n\t\t\t\n\t\t\tTest (policy, @\"class Test\n{\n\t~Test()\n\t{\n\t}\n}\",\n@\"class Test\n{\n\t~Test ()\n\t{\n\t}\n}\");\n\t\t}\n\n\t\tstatic void TestBinaryOperator (CSharpFormattingOptions policy, string op)\n\t\t{\n\t\t\tvar result = GetResult (policy, \"class Test { void TestMe () { result = left\" + op + \"right; } }\");\n\t\t\t\n\t\t\tint i1 = result.Text.IndexOf(\"left\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\"right\", System.StringComparison.Ordinal) + \"right\".Length;\n\t\t\tif (i1 < 0 || i2 < 0)\n\t\t\t\tAssert.Fail (\"text invalid:\" + result.Text);\n\t\t\tAssert.AreEqual (\"left \" + op + \" right\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAroundMultiplicativeOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundMultiplicativeOperator = true;\n\t\t\t\n\t\t\tTestBinaryOperator (policy, \"*\");\n\t\t\tTestBinaryOperator (policy, \"/\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAroundShiftOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundShiftOperator = true;\n\t\t\tTestBinaryOperator (policy, \"<<\");\n\t\t\tTestBinaryOperator (policy, \">>\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceAroundNullCoalescingOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundNullCoalescingOperator = true;\n\t\t\tTestBinaryOperator (policy, \"??\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSpacesAroundAdditiveOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundAdditiveOperator = true;\n\t\t\t\n\t\t\tTestBinaryOperator (policy, \"+\");\n\t\t\tTestBinaryOperator (policy, \"-\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAroundBitwiseOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundBitwiseOperator = true;\n\t\t\t\n\t\t\tTestBinaryOperator (policy, \"&\");\n\t\t\tTestBinaryOperator (policy, \"|\");\n\t\t\tTestBinaryOperator (policy, \"^\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAroundRelationalOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundRelationalOperator = true;\n\t\t\t\n\t\t\tTestBinaryOperator (policy, \"<\");\n\t\t\tTestBinaryOperator (policy, \"<=\");\n\t\t\tTestBinaryOperator (policy, \">\");\n\t\t\tTestBinaryOperator (policy, \">=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAroundEqualityOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundEqualityOperator = true;\n\t\t\t\n\t\t\tTestBinaryOperator (policy, \"==\");\n\t\t\tTestBinaryOperator (policy, \"!=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAroundLogicalOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundLogicalOperator = true;\n\t\t\t\n\t\t\tTestBinaryOperator (policy, \"&&\");\n\t\t\tTestBinaryOperator (policy, \"||\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConditionalOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeConditionalOperatorCondition = true;\n\t\t\tpolicy.SpaceAfterConditionalOperatorCondition = true;\n\t\t\tpolicy.SpaceBeforeConditionalOperatorSeparator = true;\n\t\t\tpolicy.SpaceAfterConditionalOperatorSeparator = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tresult = condition?trueexpr:falseexpr;\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"condition\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\"falseexpr\", System.StringComparison.Ordinal) + \"falseexpr\".Length;\n\t\t\tAssert.AreEqual (@\"condition ? trueexpr : falseexpr\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\t\n\t\t\tpolicy.SpaceBeforeConditionalOperatorCondition = false;\n\t\t\tpolicy.SpaceAfterConditionalOperatorCondition = false;\n\t\t\tpolicy.SpaceBeforeConditionalOperatorSeparator = false;\n\t\t\tpolicy.SpaceAfterConditionalOperatorSeparator = false;\n\t\t\t\n\t\t\tresult = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tresult = true ? trueexpr : falseexpr;\n\t}\n}\");\n\t\t\ti1 = result.Text.IndexOf(\"true\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.IndexOf(\"falseexpr\", System.StringComparison.Ordinal) + \"falseexpr\".Length;\n\t\t\tAssert.AreEqual (@\"true?trueexpr:falseexpr\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeMethodCallParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeMethodCallParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tMethodCall();\n\t}\n}\");\n\t\t\t\n\t\t\tint i1 = result.Text.IndexOf(\"MethodCall\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"MethodCall ();\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\t\n\t\t\tresult = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tMethodCall                         \t\t\t\t();\n\t}\n}\");\n\t\t\tpolicy.SpaceBeforeMethodCallParentheses = false;\n\t\t\t\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.IndexOf(\"MethodCall\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.IndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"MethodCall();\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinMethodCallParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceWithinMethodCallParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tMethodCall(true);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( true )\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\t\n\t\t\tpolicy.SpaceWithinMethodCallParentheses = false;\n\t\t\tresult = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tMethodCall( true );\n\t}\n}\");\n\t\t\t\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(true)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeIfParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeIfParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tif(true);\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"if\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"if (true)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinIfParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinIfParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tif (true);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( true )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeWhileParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeWhileParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\twhile(true);\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"while\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"while (true)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinWhileParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinWhileParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\twhile (true);\n\t}\n}\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( true )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinWhileParenthesesSpaceDoWhile ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinWhileParentheses = true;\n\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tdo {} while (true);\n\t}\n}\");\n\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( true )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestBeforeForParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeForParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tfor(;;);\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"for\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal) + \"(\".Length;\n\t\t\tAssert.AreEqual (@\"for (\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinForParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinForParentheses = true;\n\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tfor(;;);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( ;; )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeForeachParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeForeachParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tforeach(var o in list);\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"foreach\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"foreach (var o in list)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinForeachParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinForeachParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tforeach(var o in list);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( var o in list )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeCatchParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeCatchParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n  try {} catch(Exception) {}\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"catch\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"catch (Exception)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinCatchParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinCatchParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ttry {} catch(Exception) {}\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( Exception )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeLockParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeLockParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tlock(this) {}\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"lock\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"lock (this)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinLockParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinLockParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tlock(this) {}\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( this )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAfterForSemicolon ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAfterForSemicolon = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tfor (int i;true;i++) ;\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"for\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\t\n\t\t\tAssert.AreEqual (@\"for (int i; true; i++)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesBeforeForSemicolon ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeForSemicolon = true;\n\t\t\tpolicy.SpaceAfterForSemicolon = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tfor (int i;true;i++) ;\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"for\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\t\n\t\t\tAssert.AreEqual (@\"for (int i ;true ;i++)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesAfterTypecast ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAfterTypecast = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tTest TestMe ()\n\t{\nreturn (Test)null;\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"return\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"null\", System.StringComparison.Ordinal) + \"null\".Length;\n\t\t\t\n\t\t\tAssert.AreEqual (@\"return (Test) null\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeUsingParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeUsingParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tusing(a) {}\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"using\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal) + \"(\".Length;\n\t\t\tAssert.AreEqual (@\"using (\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinUsingParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinUsingParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tusing(a) {}\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( a )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\tstatic void TestAssignmentOperator (CSharpFormattingOptions policy, string op)\n\t\t{\n\t\t\tvar result = GetResult (policy, \"class Test { void TestMe () { left\" + op + \"right; } }\");\n\n\t\t\tint i1 = result.Text.IndexOf(\"left\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\"right\", System.StringComparison.Ordinal) + \"right\".Length;\n\t\t\tif (i1 < 0 || i2 < 0)\n\t\t\t\tAssert.Fail (\"text invalid:\" + result.Text);\n\t\t\tAssert.AreEqual (\"left \" + op + \" right\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAroundAssignmentSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundAssignment = true;\n\t\t\t\n\t\t\tTestAssignmentOperator (policy, \"=\");\n\t\t\tTestAssignmentOperator (policy, \"*=\");\n\t\t\tTestAssignmentOperator (policy, \"/=\");\n\t\t\tTestAssignmentOperator (policy, \"+=\");\n\t\t\tTestAssignmentOperator (policy, \"%=\");\n\t\t\tTestAssignmentOperator (policy, \"-=\");\n\t\t\tTestAssignmentOperator (policy, \"<<=\");\n\t\t\tTestAssignmentOperator (policy, \">>=\");\n\t\t\tTestAssignmentOperator (policy, \"&=\");\n\t\t\tTestAssignmentOperator (policy, \"|=\");\n\t\t\tTestAssignmentOperator (policy, \"^=\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAroundAssignmentSpaceInDeclarations ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundAssignment = true;\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tint left=right;\n\t}\n}\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"left\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"right\", System.StringComparison.Ordinal) + \"right\".Length;\n\t\t\tAssert.AreEqual (@\"left = right\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeSwitchParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeSwitchParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tswitch (test) { default: break; }\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"switch\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal) + \"(\".Length;\n\t\t\tAssert.AreEqual (@\"switch (\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinSwitchParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinSwitchParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tswitch (test) { default: break; }\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( test )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tc = (test);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( test )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinMethodDeclarationParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceWithinMethodDeclarationParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe (int a)\n\t{\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( int a )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinCastParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinCastParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ta = (int)b;\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( int )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinSizeOfParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinSizeOfParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ta = sizeof(int);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( int )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeSizeOfParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeSizeOfParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ta = sizeof(int);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"sizeof\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal) + \"(\".Length;\n\t\t\tAssert.AreEqual (@\"sizeof (\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinTypeOfParenthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinTypeOfParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ta = typeof(int);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( int )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeTypeOfParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeTypeOfParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ta = typeof(int);\n\t}\n}\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"typeof\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal) + \"(\".Length;\n\t\t\tAssert.AreEqual (@\"typeof (\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinCheckedExpressionParanthesesSpace ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinCheckedExpressionParantheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ta = checked(a + b);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( a + b )\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tresult = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\ta = unchecked(a + b);\n\t}\n}\");\n\t\t\t\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( a + b )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceBeforeNewParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeNewParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tnew Test();\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"new\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"new Test ();\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinNewParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinNewParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tnew Test (1);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"new\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"new Test ( 1 );\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBetweenEmptyNewParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesBetweenEmptyNewParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tnew Test ();\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"new\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"new Test ( );\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeNewParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeNewParameterComma = true;\n\t\t\tpolicy.SpaceAfterNewParameterComma = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tnew Test (1,2);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"new\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"new Test (1 ,2);\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterNewParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAfterNewParameterComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tnew Test (1,2);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"new\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"new Test (1, 2);\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFieldDeclarationComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeFieldDeclarationComma = false;\n\t\t\tpolicy.SpaceAfterFieldDeclarationComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tint a,b,c;\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"int\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"int a, b, c;\", result.GetText (i1, i2 - i1));\n\t\t\tpolicy.SpaceBeforeFieldDeclarationComma = true;\n\t\t\t\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"int\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"int a , b , c;\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceBeforeFieldDeclarationComma = false;\n\t\t\tpolicy.SpaceAfterFieldDeclarationComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"int\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"int a,b,c;\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeMethodDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeMethodDeclarationParameterComma = true;\n\t\t\tpolicy.SpaceAfterMethodDeclarationParameterComma = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tpublic void Foo (int a,int b,int c) {}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a ,int b ,int c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceBeforeMethodDeclarationParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a,int b,int c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterMethodDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeMethodDeclarationParameterComma = false;\n\t\t\tpolicy.SpaceAfterMethodDeclarationParameterComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tpublic void Foo (int a,int b,int c) {}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a, int b, int c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceAfterMethodDeclarationParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a,int b,int c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesInLambdaExpression ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinWhileParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tvar v = x=>x!=null;\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"x\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"null\", System.StringComparison.Ordinal) + \"null\".Length;\n\t\t\tAssert.AreEqual (@\"x => x != null\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeLocalVariableDeclarationComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeLocalVariableDeclarationComma = true;\n\t\t\tpolicy.SpaceAfterLocalVariableDeclarationComma = false;\n\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tint a,b,c;\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"int\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"int a ,b ,c;\", result.GetText (i1, i2 - i1));\n\n\t\t\tresult = GetResult (policy, result.Text);\n\n\t\t\tpolicy.SpaceBeforeLocalVariableDeclarationComma = false;\n\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.IndexOf(\"int\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.IndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"int a,b,c;\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLocalVariableDeclarationComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeLocalVariableDeclarationComma = true;\n\t\t\tpolicy.SpaceAfterLocalVariableDeclarationComma = true;\n\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tint a = 5,b = 6,c;\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"int\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"int a = 5 , b = 6 , c;\", result.GetText (i1, i2 - i1));\n\n\t\t\tresult = GetResult (policy, result.Text);\n\n\t\t\tpolicy.SpaceBeforeLocalVariableDeclarationComma = false;\n\t\t\tpolicy.SpaceAfterLocalVariableDeclarationComma = false;\n\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.IndexOf(\"int\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.IndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"int a = 5,b = 6,c;\", result.GetText (i1, i2 - i1));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestLocalVariableWithGenerics ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeLocalVariableDeclarationComma = true;\n\t\t\tpolicy.SpaceAfterLocalVariableDeclarationComma = true;\n\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tList<Test> a;\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"List\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"List<Test> a;\", result.GetText (i1, i2 - i1));\n\n\t\t}\n\n\t\t#region Constructors\n\t\t\n\t\t[Test]\n\t\tpublic void TestBeforeConstructorDeclarationParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeConstructorDeclarationParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test\n{\n\tTest()\n\t{\n\t}\n}\");\n\t\t\t\n\t\t\tAssert.AreEqual (NormalizeNewlines(@\"class Test\n{\n\tTest ()\n\t{\n\t}\n}\"), result.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeConstructorDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeConstructorDeclarationParameterComma = true;\n\t\t\tpolicy.SpaceAfterConstructorDeclarationParameterComma = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tpublic Test (int a,int b,int c) {}\n}\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a ,int b ,int c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceBeforeConstructorDeclarationParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\t\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a,int b,int c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterConstructorDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeConstructorDeclarationParameterComma = false;\n\t\t\tpolicy.SpaceAfterConstructorDeclarationParameterComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tpublic Test (int a,int b,int c) {}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a, int b, int c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceAfterConstructorDeclarationParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a,int b,int c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinConstructorDeclarationParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceWithinConstructorDeclarationParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tTest (int a)\n\t{\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( int a )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBetweenEmptyConstructorDeclarationParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBetweenEmptyConstructorDeclarationParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tTest ()\n\t{\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region Delegates\n\t\t[Test]\n\t\tpublic void TestBeforeDelegateDeclarationParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeDelegateDeclarationParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"delegate void Test();\");\n\t\t\t\n\t\t\tAssert.AreEqual (@\"delegate void Test ();\", result.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeDelegateDeclarationParenthesesComplex ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeDelegateDeclarationParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, \"delegate void TestDelegate\\t\\t\\t();\");\n\t\t\t\n\t\t\tAssert.AreEqual (@\"delegate void TestDelegate ();\", result.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeDelegateDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeDelegateDeclarationParameterComma = true;\n\t\t\tpolicy.SpaceAfterDelegateDeclarationParameterComma = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"delegate void Test (int a,int b,int c);\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a ,int b ,int c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceBeforeDelegateDeclarationParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a,int b,int c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterDelegateDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeDelegateDeclarationParameterComma = false;\n\t\t\tpolicy.SpaceAfterDelegateDeclarationParameterComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"delegate void Test (int a,int b,int c);\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a, int b, int c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceAfterDelegateDeclarationParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(int a,int b,int c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinDelegateDeclarationParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceWithinDelegateDeclarationParentheses = true;\n\t\t\tvar result = GetResult (policy, @\"delegate void Test (int a);\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( int a )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBetweenEmptyDelegateDeclarationParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBetweenEmptyDelegateDeclarationParentheses = true;\n\t\t\tvar result = GetResult (policy, @\"delegate void Test();\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region Method invocations\n\t\t[Test]\n\t\tpublic void TestBeforeMethodCallParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeMethodCallParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic void Foo ()\n\t{\n\t\tTest();\n\t}\n}\");\n\t\t\t\n\t\t\tAssert.AreEqual (NormalizeNewlines(@\"class FooBar\n{\n\tpublic void Foo ()\n\t{\n\t\tTest ();\n\t}\n}\"), result.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeMethodCallParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeMethodCallParameterComma = true;\n\t\t\tpolicy.SpaceAfterMethodCallParameterComma = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic void Foo ()\n\t{\n\t\tTest(a,b,c);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(a ,b ,c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceBeforeMethodCallParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(a,b,c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterMethodCallParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeMethodCallParameterComma = false;\n\t\t\tpolicy.SpaceAfterMethodCallParameterComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic void Foo ()\n\t{\n\t\tTest(a,b,c);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(a, b, c)\", result.GetText (i1, i2 - i1));\n\t\t\t\n\t\t\tpolicy.SpaceAfterMethodCallParameterComma = false;\n\t\t\tresult = GetResult (policy, result.Text);\n\t\t\ti1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\ti2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"(a,b,c)\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinMethodCallParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceWithinMethodCallParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic void Foo ()\n\t{\n\t\tTest(a);\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( a )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBetweenEmptyMethodCallParentheses ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBetweenEmptyMethodCallParentheses = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic void Foo ()\n\t{\n\t\tTest();\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"(\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\")\", System.StringComparison.Ordinal) + \")\".Length;\n\t\t\tAssert.AreEqual (@\"( )\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t#region Indexer declarations\n\t\t[Test]\n\t\tpublic void TestBeforeIndexerDeclarationBracket ()\n\t\t{\n\t\t\t\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeIndexerDeclarationBracket = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic int this[int a, int b] {\n\t\tget {\n\t\t\treturn a + b;\t\n\t\t}\n\t}\n}\");\n\t\t\tAssert.AreEqual (NormalizeNewlines(@\"class FooBar\n{\n\tpublic int this [int a, int b] {\n\t\tget {\n\t\t\treturn a + b;\t\n\t\t}\n\t}\n}\"), result.Text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeIndexerDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeIndexerDeclarationParameterComma = true;\n\t\t\tpolicy.SpaceAfterIndexerDeclarationParameterComma = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic int this[int a,int b] {\n\t\tget {\n\t\t\treturn a + b;\t\n\t\t}\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"[\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"]\", System.StringComparison.Ordinal) + \"]\".Length;\n\t\t\tAssert.AreEqual (@\"[int a ,int b]\", result.GetText (i1, i2 - i1));\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterIndexerDeclarationParameterComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAfterIndexerDeclarationParameterComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic int this[int a,int b] {\n\t\tget {\n\t\t\treturn a + b;\t\n\t\t}\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"[\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"]\", System.StringComparison.Ordinal) + \"]\".Length;\n\t\t\tAssert.AreEqual (@\"[int a, int b]\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWithinIndexerDeclarationBracket ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceWithinIndexerDeclarationBracket = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class FooBar\n{\n\tpublic int this[int a, int b] {\n\t\tget {\n\t\t\treturn a + b;\t\n\t\t}\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"[\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"]\", System.StringComparison.Ordinal) + \"]\".Length;\n\t\t\tAssert.AreEqual (@\"[ int a, int b ]\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Brackets\n\t\t\n\t\t[Test]\n\t\tpublic void TestSpacesWithinBrackets ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesWithinBrackets = true;\n\t\t\tpolicy.SpacesBeforeBrackets = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tthis[0] = 5;\n\t}\n}\");\n\t\t\tAssert.AreEqual (NormalizeNewlines(@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tthis[ 0 ] = 5;\n\t}\n}\"), result.Text);\n\t\t\t\n\t\t\t\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpacesBeforeBrackets ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpacesBeforeBrackets = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tthis[0] = 5;\n\t}\n}\");\n\t\t\tAssert.AreEqual (NormalizeNewlines(@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tthis [0] = 5;\n\t}\n}\"), result.Text);\n\t\t\t\n\t\t\t\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBeforeBracketComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeBracketComma = true;\n\t\t\tpolicy.SpaceAfterBracketComma = false;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tthis[1,2,3] = 5;\n\t}\n}\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"[\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"]\", System.StringComparison.Ordinal) + \"]\".Length;\n\t\t\tAssert.AreEqual (@\"[1 ,2 ,3]\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAfterBracketComma ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAfterBracketComma = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tthis[1,2,3] = 5;\n\t}\n}\");\n\t\t\t\n\t\t\tint i1 = result.Text.LastIndexOf(\"[\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"]\", System.StringComparison.Ordinal) + \"]\".Length;\n\t\t\tAssert.AreEqual (@\"[1, 2, 3]\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t#endregion\n\t\t\n\t\t[Test]\n\t\tpublic void TestSpacesBeforeArrayDeclarationBrackets ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceBeforeArrayDeclarationBrackets = true;\n\t\t\t\n\t\t\tvar result = GetResult (policy, @\"class Test\n{\n\tint[] a;\n\tint[][] b;\n}\");\n\t\t\t\n\t\t\tAssert.AreEqual (NormalizeNewlines(@\"class Test\n{\n\tint [] a;\n\tint [][] b;\n}\"), result.Text);\n\t\t\t\n\t\t\t\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestRemoveWhitespacesBeforeSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tvar result = GetResult(policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tFoo ()        ;\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"Foo\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual(@\"Foo ();\", result.GetText(i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceInNamedArgumentAfterDoubleColon()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceInNamedArgumentAfterDoubleColon = true;\n\t\t\tvar result = GetResult(policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tFoo (bar:expr);\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"Foo\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual(@\"Foo (bar: expr);\", result.GetText(i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceInNamedArgumentAfterDoubleColon2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceInNamedArgumentAfterDoubleColon = false;\n\t\t\tvar result = GetResult(policy, @\"class Test {\n\tvoid TestMe ()\n\t{\n\t\tFoo (bar:                      expr);\n\t}\n}\");\n\t\t\tint i1 = result.Text.IndexOf(\"Foo\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual(@\"Foo (bar:expr);\", result.GetText(i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceAroundOptionalArgumentAssignment ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tvar result = GetResult (policy, \"class Test { void TestMe (int x=0) {  } }\");\n\n\t\t\tint i1 = result.Text.IndexOf(\"x\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\"0\", System.StringComparison.Ordinal) + \"0\".Length;\n\t\t\tif (i1 < 0 || i2 < 0)\n\t\t\t\tAssert.Fail (\"text invalid:\" + result.Text);\n\t\t\tAssert.AreEqual (\"x = 0\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceAroundUsingAliasAssignment ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tvar result = GetResult (policy, \"using foo=bar;\");\n\n\t\t\tint i1 = result.Text.IndexOf(\"foo\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\"bar\", System.StringComparison.Ordinal) + \"bar\".Length;\n\t\t\tif (i1 < 0 || i2 < 0)\n\t\t\t\tAssert.Fail (\"text invalid:\" + result.Text);\n\t\t\tAssert.AreEqual (\"foo = bar\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceAroundNamedExpressionAssignment ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tvar result = GetResult (policy, \"[MyAttr(foo=0)] class A{ }\");\n\n\t\t\tint i1 = result.Text.IndexOf(\"foo\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\"0\", System.StringComparison.Ordinal) + \"0\".Length;\n\t\t\tif (i1 < 0 || i2 < 0)\n\t\t\t\tAssert.Fail (\"text invalid:\" + result.Text);\n\t\t\tAssert.AreEqual (\"foo = 0\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceAroundObjectInitializerAssignment ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tvar result = GetResult (policy, \"class A{ void Test () { new B { foo=bar }; } }\");\n\n\t\t\tint i1 = result.Text.IndexOf(\"foo\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.IndexOf(\"bar\", System.StringComparison.Ordinal) + \"bar\".Length;\n\t\t\tif (i1 < 0 || i2 < 0)\n\t\t\t\tAssert.Fail (\"text invalid:\" + result.Text);\n\t\t\tAssert.AreEqual (\"foo = bar\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestSpaceAfterUnsafeAddressOfOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAfterUnsafeAddressOfOperator = true;\n\n\t\t\tvar result = GetResult (policy, @\"unsafe class Test {\n\tvoid TestMe ()\n\t{\n\t\tint* a = &x;\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"&\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"x\", System.StringComparison.Ordinal) + \"x\".Length;\n\t\t\tAssert.AreEqual (@\"& x\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceAfterUnsafeAsteriskOfOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAfterUnsafeAsteriskOfOperator = true;\n\n\t\t\tvar result = GetResult (policy, @\"unsafe class Test {\n\tvoid TestMe ()\n\t{\n\t\tint a = *x;\n\t}\n}\");\n\t\t\tint i1 = result.Text.LastIndexOf(\"*\", System.StringComparison.Ordinal);\n\t\t\tint i2 = result.Text.LastIndexOf(\"x\", System.StringComparison.Ordinal) + \"x\".Length;\n\t\t\tAssert.AreEqual (@\"* x\", result.GetText (i1, i2 - i1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceAroundUnsafeArrowOperator ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.SpaceAroundUnsafeArrowOperator = true;\n\n\t\t\tvar result = GetResult (policy, @\"unsafe class Test {\n\tvoid TestMe ()\n\t{\n\t\tx->Foo ();\n\t}\n}\");\n\t\t\tvar txt = result.Text;\n\t\t\tint i1 = txt.LastIndexOf(\"x\", System.StringComparison.Ordinal);\n\t\t\tint i2 = txt.LastIndexOf(\";\", System.StringComparison.Ordinal) + \";\".Length;\n\t\t\tAssert.AreEqual (@\"x -> Foo ();\", txt.Substring (i1, i2 - i1));\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs",
    "content": "//\n// TestStatementIndentation.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture()]\n\tpublic class TestStatements : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInvocationIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\nthis.TestMethod ();\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tthis.TestMethod ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentBlocks()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentBlocks = true;\n\t\t\t\n\t\t\tvar adapter = Test(policy,\n\t\t\t                   @\"class Test {\n\tTest TestMethod ()\n\t{\n{\n{}\n}\n\t}\n}\",\n\t\t\t                   @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\t{\n\t\t\t{}\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.IndentBlocks = false;\n\t\t\tContinue(policy, adapter, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\t{\n\t\t{}\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentBlocksCase2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentBlocks = true;\n\t\t\t\n\t\t\tvar adapter = Test(policy,\n\t\t\t                   @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\tSomething ();\n\t\t}\n\t}\n}\",\n\t\t\t                   @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\tSomething ();\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.IndentBlocks = false;\n\t\t\tContinue(policy, adapter, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\tSomething ();\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBreakIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, \n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n                              break;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tbreak;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBreakSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, \n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tbreak     ;\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tbreak;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCheckedIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nchecked {\n}\n\t}\n}\", @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tchecked {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBaseIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\n                              base.FooBar();\n\t}\n}\", @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tbase.FooBar ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUncheckedIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nunchecked {\n}\n\t}\n}\", \n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tunchecked {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContinueIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\ncontinue;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tcontinue;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestContinueSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tcontinue ;\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tcontinue;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmptyStatementIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\n;\n\t}\n}\", @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixedStatementIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nfixed (object* obj = &obj)\n;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tfixed (object* obj = &obj)\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeachIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\nforeach (var obj in col) {\n}\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tforeach (var obj in col) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nfor (;;) {\n}\n\t}\n}\", @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tfor (;;) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForInitializerIteratorConditionFormatting ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tfor (int i     =        12; i <           10; i               ++) {\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tfor (int i = 12; i < 10; i++) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestGotoIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\ngoto label;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tgoto label;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGotoSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tgoto label\n;\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tgoto label;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturnIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\treturn;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestReturnSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\treturn ;\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\treturn;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nlock (this) {\n}\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tlock (this) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestThrowIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nthrow new NotSupportedException ();\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tthrow new NotSupportedException ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestThrowSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tthrow new NotSupportedException () \t ;\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tthrow new NotSupportedException ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnsafeIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nunsafe {\n}\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tunsafe {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nusing (var o = new MyObj ()) {\n}\n\t}\n}\", @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tusing (var o = new MyObj ()) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignEmbeddedStatements = true;\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tvar adapter = Test(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nusing (var p = new MyObj ())\nusing (var o = new MyObj ()) {\n}\n\t}\n}\",\n\t\t\t                   @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tusing (var p = new MyObj ())\n\t\tusing (var o = new MyObj ()) {\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.AlignEmbeddedStatements = false;\n\t\t\tContinue(policy, adapter, @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tusing (var p = new MyObj ())\n\t\t\tusing (var o = new MyObj ()) {\n\t\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingExpressionFormatting ()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tTest (policy, @\"\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tusing (var o = new object(              )) {\n\t\t}\n\t}\n}\", @\"\nclass Test\n{\n\tvoid Init ()\n\t{\n\t\tusing (var o = new object ()) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestVariableDeclarationIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nTest a;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tTest a;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstantVariableDeclarationIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nconst int a = 5;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tconst int a = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestYieldReturnIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nyield return null;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tyield return null;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestYieldReturnSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tyield return null     ;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tyield return null;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestYieldBreakIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nyield break;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tyield break;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestYieldBreakSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tyield break      ;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tyield break;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhileIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nwhile (true)\n;\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\twhile (true)\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhileIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\tTest(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\ndo {\n} while (true);\n\t}\n}\",\n\t\t\t     @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tdo {\n\t\t} while (true);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhileWithoutBrackets()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\ndo FooBar(); while (true);\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tdo\n\t\t\tFooBar ();\n\t\twhile (true);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeachBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tforeach (var obj in col) {}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tforeach (var obj in col) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForeachBracketPlacement2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.NextLineShifted2;\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tforeach (var obj in col) {;}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tforeach (var obj in col)\n\t\t\t{\n\t\t\t\t;\n\t\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllowIfBlockInline()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.AllowIfBlockInline = true;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {}\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {}\n\t}\n}\");\n\t\t\t\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) { Foo (); }\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) { Foo (); }\n\t}\n}\");\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true)\n\t\t\tFoo ();\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true)\n\t\t\tFoo ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfElseBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {} else {}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t} else {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignEmbeddedStatements = true;\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tvar adapter = Test(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nif (a)\nif (b) {\n}\n\t}\n}\",\n\t\t\t                   @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tif (a)\n\t\tif (b) {\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.AlignEmbeddedStatements = false;\n\t\t\tContinue(policy, adapter, @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tif (a)\n\t\t\tif (b) {\n\t\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignEmbeddedStatements = true;\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.EndOfLine;\n\n\t\t\tvar adapter = Test(policy, @\"class Test {\n\tTest TestMethod ()\n\t{\nlock (a)\nlock (b) {\n}\n\t}\n}\",\n\t\t\t\t@\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tlock (a)\n\t\tlock (b) {\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.AlignEmbeddedStatements = false;\n\t\t\tContinue(policy, adapter, @\"class Test {\n\tTest TestMethod ()\n\t{\n\t\tlock (a)\n\t\t\tlock (b) {\n\t\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestElseWithPreprocessorDirective()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (true) {\n\t\t}\n\t\t#if true\n\t\telse\n\t\t\tConsole.WriteLine ();\n\t\t\t\t#endif\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (true) {\n\t\t}\n\t\t#if true\n\t\telse\n\t\t\tConsole.WriteLine ();\n\t\t#endif\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestElseOnNewLine()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ElseNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\t;\n\t\t} else if (false) {\n\t\t\t;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\t;\n\t\t}\n\t\telse if (false) {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestElseIfOnNewLine()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ElseIfNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\t;\n\t\t} else if (false) {\n\t\t\t;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\t;\n\t\t} else\n\t\tif (false) {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestElseOnNewLineOff()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ElseNewLinePlacement = NewLinePlacement.SameLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\t;\n\t\t}\n\t\telse if (false) {\n\t\t\t;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tif (true) {\n\t\t\t;\n\t\t} else if (false) {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimpleIfElseComment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.ElseIfNewLinePlacement = NewLinePlacement.SameLine; // for simple statements it must be new line.\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (true) Call (); else Call ();\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMethod ()\n\t{\n\t\tif (true)\n\t\t\tCall ();\n\t\telse\n\t\t\tCall ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfElseIfCorrection()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateKRStyle();\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMethod()\n\t{\n\t\tint i = 0;\n\t\tif (i == 0) {\n\t\t} else\n\t\t\tif (i == 1) {\n\t\t} else\nif (i == 2) {\n\t\t} else                     if (i == 2)\t\n\t\tFoo();\n\t\telse {\n\t\t}\n\t}\n}\", @\"class Test\n{\n\tvoid TestMethod()\n\t{\n\t\tint i = 0;\n\t\tif (i == 0) {\n\t\t} else if (i == 1) {\n\t\t} else if (i == 2) {\n\t\t} else if (i == 2)\n\t\t\tFoo();\n\t\telse {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfElseNewLine()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateKRStyle();\n\t\t\tpolicy.ElseIfNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMethod()\n\t{\n\t\tint i = 0;\n\t\tif (i == 0) {\n\t\t} else\n\t\t\tif (i == 1) {\n\t\t} else\nif (i == 2) {\n\t\t} else                     if (i == 2)\t\n\t\tFoo();\n\t\telse {\n\t\t}\n\t}\n}\", @\"class Test\n{\n\tvoid TestMethod()\n\t{\n\t\tint i = 0;\n\t\tif (i == 0) {\n\t\t} else\n\t\tif (i == 1) {\n\t\t} else\n\t\tif (i == 2) {\n\t\t} else\n\t\tif (i == 2)\n\t\t\tFoo();\n\t\telse {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIfElseDoNotCare()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateKRStyle();\n\t\t\tpolicy.ElseIfNewLinePlacement = NewLinePlacement.DoNotCare;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMethod()\n\t{\n\t\tint i = 0;\n\t\tif (i == 0) {\n\t\t} else\n\t\t\tif (i == 1) {\n\t\t} else\nif (i == 2) {\n\t\t} else                     if (i == 2)\t\n\t\tFoo();\n\t\telse {\n\t\t}\n\t}\n}\", @\"class Test\n{\n\tvoid TestMethod()\n\t{\n\t\tint i = 0;\n\t\tif (i == 0) {\n\t\t} else\n\t\tif (i == 1) {\n\t\t} else\n\t\tif (i == 2) {\n\t\t} else if (i == 2)\n\t\t\tFoo();\n\t\telse {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFixedBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.NextLineShifted;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tfixed (object* obj = &obj){\n\n;}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tfixed (object* obj = &obj)\n\t\t\t{\n\n\t\t\t;\n\t\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestForBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLineWithoutSpace;\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tfor (;;) {;}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tfor (;;){\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestCheckedBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLineWithoutSpace;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tchecked {;}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tchecked{\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUncheckedBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLineWithoutSpace;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tunchecked {;}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tunchecked{\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLockBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tlock (this)\n\t\t{\n\t\t\t;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tlock (this) {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUnsafeBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tunsafe\n\t\t{\n\t\t\t;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tunsafe {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tusing (var e = new E ())\n\t\t{\n\t\t\t;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tusing (var e = new E ()) {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWhileBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\twhile (true)\n\t\t{\n\t\t\t;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\twhile (true) {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoWhileBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tdo\n\t\t{\n\t\t\t;\n\t\t} while (true);\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tdo {\n\t\t\t;\n\t\t} while (true);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchFormatting1()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.IndentSwitchBody = true;\n\t\t\tpolicy.IndentCaseBody = true;\n\t\t\tpolicy.IndentBreakStatements = true;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) { case 1: case 2: DoSomething(); break; default: Foo (); break;}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\t\tDoSomething ();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tFoo ();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchFormatting2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.IndentSwitchBody = false;\n\t\t\tpolicy.IndentCaseBody = false;\n\t\t\tpolicy.IndentBreakStatements = false;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) { case 1: case 2: DoSomething(); break; default: Foo (); break;}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) {\n\t\tcase 1:\n\t\tcase 2:\n\t\tDoSomething ();\n\t\tbreak;\n\t\tdefault:\n\t\tFoo ();\n\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSwitchIndentBreak()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.IndentSwitchBody = true;\n\t\t\tpolicy.IndentBreakStatements = true;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tDoSomething ();\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tFoo ();\n\t\t\tbreak;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\t\tDoSomething ();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tFoo ();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.IndentSwitchBody = true;\n\t\t\tpolicy.IndentBreakStatements = false;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tDoSomething ();\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tFoo ();\n\t\t\tbreak;\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tswitch (a) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\t\tDoSomething ();\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tFoo ();\n\t\t\tbreak;\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTryCatchBracketPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.EndOfLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\ttry { ; } catch (Exception e) { } finally { }\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\ttry {\n\t\t\t;\n\t\t} catch (Exception e) {\n\t\t} finally {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPlaceCatchOnNewLine()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.CatchNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\ttry {\n\t\t\t;\n\t\t} catch (Exception e) {\n\t\t} finally {\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\ttry {\n\t\t\t;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t} finally {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPlaceFinallyOnNewLine()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.FinallyNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\ttry {\n\t\t\t;\n\t\t} catch (Exception e) {\n\t\t} finally {\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\ttry {\n\t\t\t;\n\t\t} catch (Exception e) {\n\t\t}\n\t\tfinally {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPlaceWhileOnNewLine()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tpolicy.WhileNewLinePlacement = NewLinePlacement.NewLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tdo {\n\t\t\t;\n\t\t} while (true);\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\tdo {\n\t\t\t;\n\t\t}\n\t\twhile (true);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlockStatementWithComments()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n{\n //CMT1\n;\n /* cmt 2 */\n}\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\t{\n\t\t\t//CMT1\n\t\t\t;\n\t\t\t/* cmt 2 */\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBlockStatementWithPreProcessorDirective()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMethod ()\n\t{\n{\n\" + @\" #if true\n;\n\" + @\" #endif\n}\n\t}\n}\", @\"class Test\n{\n\tTest TestMethod ()\n\t{\n\t\t{\n\" + @\"\t\t\t#if true\n\t\t\t;\n\" + @\"\t\t\t#endif\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingInsideNamespace()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.UsingPlacement = UsingPlacement.InsideNamespace;\n\n\t\t\tTest(policy, @\"namespace TestNamespace\n{\nusing System;\n\n\tclass Test\n\t{\n\t}\n}\", @\"namespace TestNamespace\n{\n\tusing System;\n\n\tclass Test\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEmbeddedStatementPlacement()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.EmbeddedStatementPlacement = NewLinePlacement.SameLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid MyTest ()\n\t{\n\t\tif (true)                 ;\n\t}\n}\", @\"class Test\n{\n\tvoid MyTest ()\n\t{\n\t\tif (true) ;\n\t}\n}\");\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid MyTest ()\n\t{\n\t\tif (true)\n\t\t\t;\n\t}\n}\", @\"class Test\n{\n\tvoid MyTest ()\n\t{\n\t\tif (true) ;\n\t}\n}\");\n\t\t\tpolicy.EmbeddedStatementPlacement = NewLinePlacement.NewLine;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid MyTest ()\n\t{\n\t\tif (true) ;\n\t}\n}\", @\"class Test\n{\n\tvoid MyTest ()\n\t{\n\t\tif (true)\n\t\t\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlignmentTest_DoWhile()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tdo {\n\t\t} while(a <\nb);\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tdo {\n\t\t} while(a <\n\t\t        b);\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlignmentTest_IfElse()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (a \n> b) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\tif (a\n\t\t    > b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlignmentTest_While()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"\nclass Test\n{\n\tvoid Foo()\n\t{\n\t\twhile (a \n> b) {\n\t\t}\n\t}\n}\n\", @\"\nclass Test\n{\n\tvoid Foo ()\n\t{\n\t\twhile (a\n\t\t       > b) {\n\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Ignore(\"fixme\")]\n\t\t[Test]\n\t\tpublic void AlignmentTest_StackedIfElse_ElseIf()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"\nclass Foo\n{\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tFooBar ();\n\t\telse\n\t\tif (true) {\n\t\t}\n\t}\n}\n\", @\"\nclass Foo\n{\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tFooBar ();\n\t\telse \n\t\t\tif (true) {\n\t\t\t}\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSpaceBeforeSemicolon()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SpaceBeforeSemicolon = true;\n\t\t\tTest(policy, @\"using System;\n\nclass Test\n{\n\tint field;\n\n\tevent EventHandler foo;\n\n\tvoid Foo ()\n\t{\n\t\tint a = 2 + 3;\n\t\tFoo ();\n\t\tbreak;\n\t\tcontinue;\n\t\tgoto foo;\n\t\treturn;\n\t\tthrow new Exception ();\n\t\tyield break;\n\t\tyield return 5;\n\t\t\n\t}\n}\n\", @\"using System ;\n\nclass Test\n{\n\tint field ;\n\n\tevent EventHandler foo ;\n\n\tvoid Foo ()\n\t{\n\t\tint a = 2 + 3 ;\n\t\tFoo () ;\n\t\tbreak ;\n\t\tcontinue ;\n\t\tgoto foo ;\n\t\treturn ;\n\t\tthrow new Exception () ;\n\t\tyield break ;\n\t\tyield return 5 ;\n\t\t\n\t}\n}\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs",
    "content": "// \n// TestTypeLevelIndentation.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2010 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture()]\n\tpublic class TestTypeLevelIndentation : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestUsingDeclarations()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"\t\tusing Foo;\", @\"using Foo;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingDeclarationsWithHeader()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, @\"// THE SOFTWARE.\n\nusing    Foo   ;\", @\"// THE SOFTWARE.\n\nusing Foo;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestUsingAliasDeclarations()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\n\t\t\tTest(policy, @\"\t\tusing Foo = Bar;\", @\"using Foo = Bar;\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessorIndenting()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\n\t\t\tTest(policy,\n\t\t\t      @\"\nclass Test {\n    #region FooBar\n\n    #endregion\n}\",\n\t\t\t      @\"\nclass Test {\n\t#region FooBar\n\n\t#endregion\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestTypeWithAttributeIndenging()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\n\t\t\tTest(policy,\n\t\t\t     @\"\n\t[Attr]\n\tclass Test {\n}\",\n\t\t\t     @\"\n[Attr]\nclass Test {\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\n\t\t\tTest(policy,\n\t\t\t     @\"\t\t\tclass Test {\n}\",\n\t\t\t     @\"class Test {\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassIndentationWithDocComment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\n\t\t\tTest(policy,\n\t\t\t     @\"/// <summary>\n\t\t/// olwcowcolwc\n\t\t/// </summary>\n\t\t\tclass Test {\n}\",\n\t\t\t     @\"/// <summary>\n/// olwcowcolwc\n/// </summary>\nclass Test {\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAttributeIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"\t\t\t\t\t[Attribute1]\n\t\t[Attribute2()]\n          class Test {\n}\",\n\t\t\t      @\"[Attribute1]\n[Attribute2 ()]\nclass Test {\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassIndentationInNamespaces()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.NamespaceBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"namespace A { class Test {\n} }\",\n\t\t\t      @\"namespace A {\n\tclass Test {\n}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoIndentationInNamespaces()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.NamespaceBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\t\t\tpolicy.IndentNamespaceBody = false;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"namespace A { class Test {\n} }\",\n\t\t\t      @\"namespace A {\nclass Test {\n}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestClassIndentationInNamespacesCase2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.NamespaceBraceStyle = BraceStyle.NextLine;\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.NextLine;\n\t\t\tpolicy.ConstructorBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"using System;\n\nnamespace MonoDevelop.CSharp.Formatting {\n\tpublic class FormattingProfileService {\n\t\tpublic FormattingProfileService () {\n\t\t}\n\t}\n}\",\n\t\t\t      @\"using System;\n\nnamespace MonoDevelop.CSharp.Formatting\n{\n\tpublic class FormattingProfileService\n\t{\n\t\tpublic FormattingProfileService ()\n\t\t{\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentClassBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentClassBody = true;\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\n\t\t\t\tTest a;\n}\", @\"class Test\n{\n\tTest a;\n}\");\n\t\t\t\n\t\t\tpolicy.IndentClassBody = false;\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\n\tTest a;\n}\",\n\t\t\t      @\"class Test\n{\nTest a;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDocCommentIndenting()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy,\n\t\t\t     @\"class Test\n{\n\t\t/// <summary>\n   /// Test\n              /// </summary>\n\tTest a;\n}\", @\"class Test\n{\n\t/// <summary>\n\t/// Test\n\t/// </summary>\n\tTest a;\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentInterfaceBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentInterfaceBody = true;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"interface Test\n{\n\t\t\t\tTest Foo ();\n}\", @\"interface Test\n{\n\tTest Foo ();\n}\");\n\t\t\tpolicy.IndentInterfaceBody = false;\n\t\t\tTest(policy,\n\t\t\t      @\"interface Test\n{\n\tTest Foo ();\n}\", @\"interface Test\n{\nTest Foo ();\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentStructBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentStructBody = true;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"struct Test\n{\n\t\t\t\tTest Foo ();\n}\", @\"struct Test\n{\n\tTest Foo ();\n}\");\n\t\t\tpolicy.IndentStructBody = false;\n\t\t\tTest(policy,\n\t\t\t      @\"struct Test\n{\n\tTest Foo ();\n}\", @\"struct Test\n{\nTest Foo ();\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentEnumBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentEnumBody = true;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"enum Test\n{\n\t\t\t\tA\n}\", @\"enum Test\n{\n\tA\n}\");\n\t\t\tpolicy.IndentEnumBody = false;\n\t\t\tTest(policy,\n\t\t\t      @\"enum Test\n{\n\tA\n}\", @\"enum Test\n{\nA\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentEnumBodyCase2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentEnumBody = true;\n\n\t\t\tTest(policy,\n\t\t\t     @\"enum Test\n{\n\t\t\t\tA , \n\tB, \nC\n}\", @\"enum Test\n{\n\tA,\n\tB,\n\tC\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentEnumBodyCase3()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentEnumBody = true;\n\n\t\t\tTest(policy,\n\t\t\t     @\"enum Test\n{\n\t\t\t\tA = 3  + 5, \n\tB=5  , \nC=5 <<       12\n}\", @\"enum Test\n{\n\tA = 3 + 5,\n\tB = 5,\n\tC = 5 << 12\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentMethodBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentMethodBody = true;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\n\tTest Foo ()\n\t{\n;\n\t\t\t\t\t\t\t\t;\n\t}\n}\",\n\t\t\t      @\"class Test\n{\n\tTest Foo ()\n\t{\n\t\t;\n\t\t;\n\t}\n}\");\n\t\t\tpolicy.IndentMethodBody = false;\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\n\tTest Foo ()\n\t{\n\t\t;\n\t\t;\n\t}\n}\",\n\t\t\t      @\"class Test\n{\n\tTest Foo ()\n\t{\n\t;\n\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentMethodBodyOperatorCase()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentMethodBody = true;\n\n\t\t\tvar adapter = Test(policy,\n\t\t\t                    @\"class Test\n{\n\tstatic Test operator+(Test left, Test right)\n\t{\n;\n\t\t\t\t\t\t\t\t;\n\t}\n}\",\n\t\t\t                    @\"class Test\n{\n\tstatic Test operator+ (Test left, Test right)\n\t{\n\t\t;\n\t\t;\n\t}\n}\");\n\t\t\tpolicy.IndentMethodBody = false;\n\t\t\tContinue(policy, adapter, @\"class Test\n{\n\tstatic Test operator+ (Test left, Test right)\n\t{\n\t;\n\t;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentPropertyBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentPropertyBody = true;\n\t\t\t\n\t\t\tvar adapter = Test(policy,\n\t\t\t                    @\"class Test\n{\n\tTest TestMe {\n\t\t\tget;\nset;\n\t}\n}\",\n\t\t\t                    @\"class Test\n{\n\tTest TestMe {\n\t\tget;\n\t\tset;\n\t}\n}\");\n\t\t\tpolicy.IndentPropertyBody = false;\n\t\t\t\n\t\t\tContinue(policy, adapter,\n\t\t\t          @\"class Test\n{\n\tTest TestMe {\n\tget;\n\tset;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentPropertyOneLine()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.AllowOneLine;\n\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\n\tTest TestMe {      get;set;                  }\n}\",\n\t\t\t      @\"class Test\n{\n\tTest TestMe { get; set; }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentPropertyOneLineCase2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.AllowOneLine;\n\t\t\tpolicy.SimpleGetBlockFormatting = PropertyFormatting.AllowOneLine;\n\t\t\tpolicy.SimpleSetBlockFormatting = PropertyFormatting.AllowOneLine;\n\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\n\tTest TestMe {      get { ; }set{;}                  }\n}\",\n\t\t\t      @\"class Test\n{\n\tTest TestMe { get { ; } set { ; } }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentPropertyBodyIndexerCase()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentPropertyBody = true;\n\t\t\t\n\t\t\tvar adapter = Test(policy,\n\t\t\t                    @\"class Test\n{\n\tTest this[int a] {\n\t\t\tget {\n\treturn null;\n}\nset {\n\t;\n}\n\t}\n}\",\n\t\t\t                    @\"class Test\n{\n\tTest this [int a] {\n\t\tget {\n\t\t\treturn null;\n\t\t}\n\t\tset {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.IndentPropertyBody = false;\n\t\t\tContinue(policy, adapter,\n\t\t\t          @\"class Test\n{\n\tTest this [int a] {\n\tget {\n\t\treturn null;\n\t}\n\tset {\n\t\t;\n\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAutoPropertyAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AutoPropertyFormatting = PropertyFormatting.AllowOneLine;\n\t\t\tvar adapter = Test(policy,\n\t\t\t                    @\"class Test\n{\n\tTest TestMe { get; set; }\n}\",\n\t\t\t                    @\"class Test\n{\n\tTest TestMe { get; set; }\n}\");\n\t\t\tpolicy.AutoPropertyFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tContinue(policy, adapter,\n\t\t\t          @\"class Test\n{\n\tTest TestMe {\n\t\tget;\n\t\tset;\n\t}\n}\");\n\t\t\tpolicy.AutoPropertyFormatting = PropertyFormatting.ForceOneLine;\n\t\t\t\n\t\t\tContinue(policy, adapter,\n\t\t\t          @\"class Test\n{\n\tTest TestMe { get; set; }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimplePropertyAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.AllowOneLine;\n\t\t\tvar adapter = Test(policy,\n\t\t\t                   @\"class Test\n{\n\tTest TestMe { get { ; } set { ; } }\n}\",\n\t\t\t                   @\"class Test\n{\n\tTest TestMe { get { ; } set { ; } }\n}\");\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tContinue(policy, adapter,\n\t\t\t         @\"class Test\n{\n\tTest TestMe {\n\t\tget { ; }\n\t\tset { ; }\n\t}\n}\");\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceOneLine;\n\n\t\t\tContinue(policy, adapter,\n\t\t\t         @\"class Test\n{\n\tTest TestMe { get { ; } set { ; } }\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestClashingPropertyAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceOneLine;\n\t\t\tpolicy.SimpleGetBlockFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tTest(policy, @\"class Test\n{\n\tTest TestMe {\n\t\tget { FooBar (); }\n\t}\n}\", @\"class Test\n{\n\tTest TestMe { get { FooBar (); } }\n}\");\n\t\t}\n\n\n\n\t\t[Test]\n\t\tpublic void TestIndentNamespaceBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.DoNotChange;\n\t\t\tpolicy.NamespaceBraceStyle = BraceStyle.EndOfLine;\n\t\t\tpolicy.IndentNamespaceBody = true;\n\t\t\tvar adapter = Test(policy,\n\t\t\t                    @\"\t\t\tnamespace Test {\nclass FooBar {\n}\n\t\t}\",\n\t\t\t                    @\"namespace Test {\n\tclass FooBar {\n}\n}\");\n\t\t\t\n\t\t\tpolicy.IndentNamespaceBody = false;\n\t\t\tContinue(policy, adapter,\n\t\t\t          @\"namespace Test {\nclass FooBar {\n}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodBraceStyle = BraceStyle.DoNotChange;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\nMyType TestMethod () {}\n}\",\n\t\t\t      @\"class Test\n{\n\tMyType TestMethod () {}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyIndentation()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.PropertyBraceStyle = BraceStyle.DoNotChange;\n\t\t\t\n\t\t\tTest(policy, \n\t\t\t      @\"class Test\n{\n\t\t\t\tpublic int Prop { get; set; }\n}\", @\"class Test\n{\n\tpublic int Prop { get; set; }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyIndentationCase2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\t\n\t\t\tTest(policy, \n\t\t\t      @\"class Test\n{\n\t\t\t\tpublic int Prop {\n get;\nset;\n}\n}\",\n\t\t\t      @\"class Test\n{\n\tpublic int Prop {\n\t\tget;\n\t\tset;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyIndentationClosingBracketCorrection()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, \n\t\t\t      @\"class Test\n{\n\t\t\t\tpublic int Prop { get;\n\t\t\t\t}\n}\", @\"class Test\n{\n\tpublic int Prop { get; }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyIndentationClosingBracketCorrection2()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, \n\t\t\t      @\"class Test\n{\n\t\t\t\tpublic int Prop {\n\t\t\t\t\tget;}\n}\", @\"class Test\n{\n\tpublic int Prop {\n\t\tget;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAutoPropertyCorrection()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AutoPropertyFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tTest(policy, \n\t\t\t     @\"class Test\n{\n\t\t\t\tpublic int Prop { get;          private set; }\n}\", @\"class Test\n{\n\tpublic int Prop {\n\t\tget;\n\t\tprivate set;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimplePropertyCorrection()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tTest(policy, \n\t\t\t     @\"class Test\n{\n\t\t\t\tpublic int Prop { get { ; }         private set {; } }\n}\", @\"class Test\n{\n\tpublic int Prop {\n\t\tget { ; }\n\t\tprivate set { ; }\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEventField()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, \n@\"class Test\n{\n\tpublic   event \n\n EventHandler    TestMe           ;\n}\",\n@\"class Test\n{\n\tpublic event EventHandler TestMe;\n}\");\n\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIndentEventBody()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentEventBody = true;\n\t\t\t\n\t\t\tvar adapter = Test(policy, \n\t\t\t                    @\"class Test\n{\n\tpublic event EventHandler TestMe {\n\t\t\t\t\t\t\t\tadd {\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\t}\nremove {\n\t;\n}\n\t}\n}\",\n\t\t\t                    @\"class Test\n{\n\tpublic event EventHandler TestMe {\n\t\tadd {\n\t\t\t;\n\t\t}\n\t\tremove {\n\t\t\t;\n\t\t}\n\t}\n}\");\n\t\t\tpolicy.IndentEventBody = false;\n\t\t\tContinue(policy, adapter,\n\t\t\t          @\"class Test\n{\n\tpublic event EventHandler TestMe {\n\tadd {\n\t\t;\n\t}\n\tremove {\n\t\t;\n\t}\n\t}\n}\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 9990 - Formatting a document on save splits event into 'e vent'\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug9990()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.SimplePropertyFormatting = PropertyFormatting.ForceNewLine;\n\t\t\tTest(policy, \n\t\t\t     @\"class Test\n{\n\t\tpublic event EventHandler UpdateStarted = delegate { }; public event EventHandler<UpdateFinishedEventArgs> UpdateFinished = delegate { };\n}\", @\"class Test\n{\n\tpublic event EventHandler UpdateStarted = delegate { };\n\tpublic event EventHandler<UpdateFinishedEventArgs> UpdateFinished = delegate { };\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPropertyOneLineCorrection()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy,\n\t\t\t      @\"class Test\n{\n\tint test { get { return test;}\nset { test = value; } }\n}\",\n\t\t\t      @\"class Test\n{\n\tint test { get { return test; } set { test = value; } }\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorInitializer()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"\nclass Foo\n{\n\tpublic Foo ():         base         (0)\n\t{\n\t}\n}\n\", @\"\nclass Foo\n{\n\tpublic Foo () : base (0)\n\t{\n\t}\n}\n\");\n\t\t}\n\t\t[Test]\n\t\tpublic void TestConstructorInitializerCase2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"\nclass Foo\n{\npublic Foo ()         :\nbase         (0)\n{\n}\n}\n\", @\"\nclass Foo\n{\n\tpublic Foo () :\n\t\tbase (0)\n\t{\n\t}\n}\n\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorInitializerColonDontCare()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.NewLineAfterConstructorInitializerColon = NewLinePlacement.DoNotCare;\n\t\t\tpolicy.NewLineBeforeConstructorInitializerColon = NewLinePlacement.DoNotCare;\n\t\t\tTest(policy, @\"class A\n{\n\tpublic A ()\t\t:\t\t\tbase ()\n\t{\n\n\t}\n\n\tpublic A ()\t\t\t: \t\t\t\n\t\t\t\t\t\tbase ()\n\t{\n\n\t}\n\n\tpublic A ()\n\t\t\t\t\t\t: \t\t\t\t\tbase ()\n\t{\n\n\t}\n\n\tpublic A ()\t\t\t\t\n\t\t     : \t\t\t\t\t\n\t\t\t\t\t\tbase ()\n\t{\n\n\t}\n}\",\n\t\t\t\t@\"class A\n{\n\tpublic A () : base ()\n\t{\n\n\t}\n\n\tpublic A () :\n\t\tbase ()\n\t{\n\n\t}\n\n\tpublic A ()\n\t\t: base ()\n\t{\n\n\t}\n\n\tpublic A ()\n\t\t:\n\t\tbase ()\n\t{\n\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorInitializerColonNewLineBeforeSameLineAfter()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.NewLineBeforeConstructorInitializerColon = NewLinePlacement.NewLine;\n\t\t\tpolicy.NewLineAfterConstructorInitializerColon = NewLinePlacement.SameLine;\n\n\t\t\tTest(policy, @\"class A\n{\n\tpublic A ()\t\t:\t\t\tbase ()\n\t{\n\n\t}\n\n\tpublic A ()\t\t\t: \t\t\t\n\t\t\t\t\t\tbase ()\n\t{\n\n\t}\n\n\tpublic A ()\n\t\t\t\t\t\t: \t\t\t\t\tbase ()\n\t{\n\n\t}\n\n\tpublic A ()\t\t\t\t\n\t\t     : \t\t\t\t\t\n\t\t\t\t\t\tbase ()\n\t{\n\n\t}\n}\",\n\t\t\t\t@\"class A\n{\n\tpublic A ()\n\t\t: base ()\n\t{\n\n\t}\n\n\tpublic A ()\n\t\t: base ()\n\t{\n\n\t}\n\n\tpublic A ()\n\t\t: base ()\n\t{\n\n\t}\n\n\tpublic A ()\n\t\t: base ()\n\t{\n\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndentPreprocessorStatementsAdd()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentPreprocessorDirectives = true;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t     @\"class Test\n{\n#region DEBUG\n#endregion\n}\", @\"class Test\n{\n\t#region DEBUG\n\n\t#endregion\n}\");\n\t\t}\n\t\n\t\t[Test]\n\t\tpublic void TestIndentPreprocessorStatementsRemove()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentPreprocessorDirectives = false;\n\t\t\t\n\t\t\tTest(policy,\n\t\t\t     @\"class Test\n{\n\t#region DEBUG\n\n\t#endregion\n}\", @\"class Test\n{\n#region DEBUG\n\n#endregion\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestCollectionFieldInitializer ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tTest(policy, \n@\"using System.Collections.Generic;\n\nclass Foo\n{\nnew Dictionary<int,int> o = new Dictionary<int,int> () { \n\t\t{1, 2 },\n\t{1, 2 },\n\t\t\t\t{1, 2 },\n\t\t{1, 2 }\n\t\t\t\t}; \n}\n\", \n@\"using System.Collections.Generic;\n\nclass Foo\n{\n\tnew Dictionary<int,int> o = new Dictionary<int,int> () { \n\t\t{ 1, 2 },\n\t\t{ 1, 2 },\n\t\t{ 1, 2 },\n\t\t{ 1, 2 }\n\t};\n}\n\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestWrapping.cs",
    "content": "// \n// TestWrapping.cs\n//  \n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n// \n// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\t[TestFixture()]\n\tpublic class TestWrapping : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void TestInitializerWrapAlways()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ArrayInitializerWrapping = Wrapping.WrapAlways;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tvar foo = new [] { 1, 2, 3 };\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tvar foo = new [] {\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInitializerDoNotWrap()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ArrayInitializerWrapping = Wrapping.DoNotWrap;\n\n\t\t\tTest(policy,\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tvar foo = new [] {\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t};\n\t}\n}\", @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tvar foo = new [] { 1, 2, 3 };\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestInitializerBraceStyle()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ArrayInitializerWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.ArrayInitializerBraceStyle = BraceStyle.NextLine;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tvar foo = new [] {\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t};\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tvar foo = new []\n\t\t{\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t};\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChainedMethodCallWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ChainedMethodCallWrapping = Wrapping.WrapAlways;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo ().Bar ().             Zoom();\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo ()\n\t\t\t.Bar ()\n\t\t\t.Zoom ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChainedMethodCallDoNotWrapWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ChainedMethodCallWrapping = Wrapping.DoNotWrap;\n\t\t\t\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo ()\n\t\t\t.Bar ()\n\t\t\t.Zoom ();\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo ().Bar ().Zoom ();\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallArgumentWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (1, 2, 3);\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallArgumentNoNewLineWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.SameLine;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.SameLine;\n\t\t\tpolicy.AlignToFirstMethodCallArgument = true;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBar (1, 2, 3);\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBar (1,\n\t\t        2,\n\t\t        3);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestMethodCallArgumentDoNotWrapWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.DoNotWrap;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (\n\t\t\t1, \n\t\t\t2, \n\t\t\t3\n\t\t);\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (1, 2, 3);\n\t}\n}\");\n\t\t}\n\n\t\t\n\t\t[Test]\n\t\tpublic void TestIndexerCallArgumentNoNewLineWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndexerArgumentWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferIndexerOpenBracket = NewLinePlacement.NewLine;\n\t\t\tpolicy.IndexerClosingBracketOnNewLine = NewLinePlacement.NewLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBar [1, 2, 3] = 5;\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBar [\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t] = 5;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestObjectCreationArgumentNoNewLineWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tnew FooBar (1, 2, 3);\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tnew FooBar (\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationParameterNewLineWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferMethodDeclarationOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodDeclarationClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe (int i, int j, int k)\n\t{\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe (\n\t\tint i,\n\t\tint j,\n\t\tint k\n\t)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationParameterDoNotChangeCase1()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.DoNotChange;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe (\n\t\tint i,\n\t\tint j,\n\t\tint k\n\t\t\t)\n\t{\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe (\n\t\tint i,\n\t\tint j,\n\t\tint k\n\t)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationParameterDoNotChangeCase2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.DoNotChange;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe (\n\t\tint i,\n\t\tint j,\n\t\tint k\t\t\t\t\t\t)\n\t{\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe (\n\t\tint i,\n\t\tint j,\n\t\tint k)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationParameterDoNotChangeCase3()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.DoNotChange;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe (int i,\n\t             int j,\n\t             int k\t\t\t\t\t\t)\n\t{\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe (int i,\n\t             int j,\n\t             int k)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestOperatorDeclarationParameterNewLineWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferMethodDeclarationOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodDeclarationClosingParenthesesOnNewLine = NewLinePlacement.SameLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tpublic static Test operator + (Test a, Test b)\n\t{\n\t\treturn null;\n\t}\n}\",\n@\"class Test\n{\n\tpublic static Test operator + (\n\t\tTest a,\n\t\tTest b)\n\t{\n\t\treturn null;\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestConstructorDeclarationParameterNewLineWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferMethodDeclarationOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodDeclarationClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tTest (int i, int j, int k)\n\t{\n\t}\n}\",\n@\"class Test\n{\n\tTest (\n\t\tint i,\n\t\tint j,\n\t\tint k\n\t)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerDeclarationParameterNewLineWrapping()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndexerDeclarationParameterWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.NewLineAferIndexerDeclarationOpenBracket = NewLinePlacement.NewLine;\n\t\t\tpolicy.IndexerDeclarationClosingBracketOnNewLine = NewLinePlacement.NewLine;\n\t\t\tTest(policy, @\"class Test\n{\n\tint this [int i, int j, int k] {\n\t\tget {\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tint this [\n\t\tint i,\n\t\tint j,\n\t\tint k\n\t] {\n\t\tget {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerDeclarationAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstIndexerDeclarationParameter = true;\n\t\t\tTest(policy, @\"class Test\n{\n\tint this [int i,\nint j,\n int k] {\n\t\tget {\n\t\t}\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tint this [int i,\n\t          int j,\n\t          int k] {\n\t\tget {\n\t\t}\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallArgumentWrappingDoNotChangeCase1()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.DoNotChange;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t);\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallArgumentWrappingDoNotChangeCase2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.DoNotChange;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\t\t\tpolicy.AlignToFirstMethodCallArgument = true;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (1,\n\t\t     2,\n\t\t     3\n\t\t\t\t\t);\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (1,\n\t\t     2,\n\t\t     3\n\t\t);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallArgumentWrappingDoNotChangeCase3()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.DoNotChange;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.NewLine;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.NewLine;\n\t\t\tpolicy.AlignToFirstMethodCallArgument = true;\n\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (1,\n\t\t     2,\n\t\t     3           );\n\t}\n}\",\n@\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFoo (1,\n\t\t     2,\n\t\t     3);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDoNotTouchMethodDeclarationCase1 ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\n\t\t\tTest (policy, @\"class Test\n{\n\tint Foo (int i, double d, Action a)\n\t{\n\t\ta ();\n\t}\n}\",\n\t\t\t                    @\"class Test\n{\n\tint Foo (int i, double d, Action a)\n\t{\n\t\ta ();\n\t}\n}\", FormattingMode.Intrusive);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNoBlankLinesBetweenEndBraceAndEndParenthesis ()\n\t\t{\n\t\t\tCSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono ();\n\t\t\tpolicy.MinimumBlankLinesBetweenMembers = 1;\n\n\t\t\tTest (policy, @\"class Test\n{\n\tint Foo (int i, double d, Action a)\n\t{\n\t\ta ();\n\t}\n\n\tvoid Bar ()\n\t{\n\t\tFoo (1, 2, () => {\n\t\t});\n\t}\n}\",\n\t\t\t                    @\"class Test\n{\n\tint Foo (int i, double d, Action a)\n\t{\n\t\ta ();\n\t}\n\n\tvoid Bar ()\n\t{\n\t\tFoo (1, 2, () => {\n\t\t});\n\t}\n}\", FormattingMode.Intrusive);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodCallDoNotWrapCorrectionNoAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.DoNotChange;\n\t\t\tpolicy.NewLineAferMethodCallOpenParentheses = NewLinePlacement.DoNotCare;\n\t\t\tpolicy.MethodCallClosingParenthesesOnNewLine = NewLinePlacement.DoNotCare;\n\t\t\tpolicy.AlignToFirstMethodCallArgument = false;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBarLongMethod (1,\n\t2,\n3\n\t\t\t\t);\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBarLongMethod (1,\n\t\t\t2,\n\t\t\t3\n\t\t);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestMethodCallNoAlignmentHasNoEffectInNewLineCase()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.DoNotChange;\n\t\t\tpolicy.AlignToFirstMethodCallArgument = true;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBarLongMethod (\n1,\n\t2,\n3\n\t\t\t\t);\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tFooBarLongMethod (\n\t\t\t1,\n\t\t\t2,\n\t\t\t3\n\t\t);\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationNoAlignmentHasNoEffectInNewLineCase()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodCallArgumentWrapping = Wrapping.DoNotChange;\n\t\t\tpolicy.AlignToFirstMethodDeclarationParameter = true;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe (\nint test,\nstring fooo)\n\t{\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMe (\n\t\tint test,\n\t\tstring fooo)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodDeclarationParameter = true;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe (int test,\nstring fooo)\n\t{\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMe (int test,\n\t             string fooo)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationNoAlignmentHasNoEffectInNewLine2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.WrapAlways;\n\t\t\tpolicy.AlignToFirstMethodDeclarationParameter = false;\n\t\t\tTest(policy, @\"class Test\n{\n\tpublic void LongMethodCallInMultiple (\nint test,string foo,double bar)\n\t{\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tpublic void LongMethodCallInMultiple (\n\t\tint test,\n\t\tstring foo,\n\t\tdouble bar)\n\t{\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodDeclarationDoNotWrapCorrectionNoAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.MethodDeclarationParameterWrapping = Wrapping.DoNotChange;\n\t\t\tpolicy.NewLineAferMethodDeclarationOpenParentheses = NewLinePlacement.DoNotCare;\n\t\t\tpolicy.MethodDeclarationClosingParenthesesOnNewLine = NewLinePlacement.DoNotCare;\n\t\t\tpolicy.AlignToFirstMethodDeclarationParameter = false;\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe (int bar,\nint test,\nint foo)\n\t{\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMe (int bar,\n\t\tint test,\n\t\tint foo)\n\t{\n\t}\n}\");\n\t\t}\n\t\t[Ignore(\"FIXME\")]\n\t\t[Test]\n\t\tpublic void TestWrappingBug()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tVantageErrorLog.Throw(Title: \"\"DexterHelper: WriteToDexter (WebEx)\"\",\n\t                                  Method: \"\"WriteToDexter\"\", \n                                \t  Location: \"\"DX001\"\", \n                                  Code: \"\"DX001\"\", \n                            \t      Message: string.Format(\"\"DexterHelper: WriteToDexter{0}{1}{0}{2}\"\", \n                                   VantageConstants.CRLF, \n                        \t           webex.Message,\n                    \t               responseString), \n                                  ex: new Exception(string.Format(\"\"DexterHelper: WriteToDexter{0}{1}{0}{2}\"\", \n                                            VantageConstants.CRLF, \n                \t                            webex.Message,\n                                            responseString)), \n                                  TellUser: false, \n                                  WriteToDatabase: true, \n        \t                          TellVantageSupport: true, \n            \t                      Rethrow: false);\n\t}\n}\",\n\t\t\t     @\"class Test\n{\n\tvoid TestMe ()\n\t{\n\t\tVantageErrorLog.Throw (Title: \"\"DexterHelper: WriteToDexter (WebEx)\"\",\n\t\t                       Method: \"\"WriteToDexter\"\", \n\t\t                       Location: \"\"DX001\"\", \n\t\t                       Code: \"\"DX001\"\", \n\t\t                       Message: string.Format (\"\"DexterHelper: WriteToDexter{0}{1}{0}{2}\"\", \n\t\t                                               VantageConstants.CRLF, \n\t\t                                               webex.Message,\n\t\t                                               responseString), \n\t\t                       ex: new Exception (string.Format (\"\"DexterHelper: WriteToDexter{0}{1}{0}{2}\"\", \n\t\t                                                         VantageConstants.CRLF, \n\t\t                                                         webex.Message,\n\t\t                                                         responseString)), \n\t\t                       TellUser: false, \n\t\t                       WriteToDatabase: true, \n\t\t                       TellVantageSupport: true, \n\t\t                       Rethrow: false);\n\t}\n}\");\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestWrappingWithSpaceIndent()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = true;\n\n\t\t\tTextEditorOptions options = new TextEditorOptions();\n\t\t\toptions.IndentSize = options.TabSize = 2;\n\t\t\toptions.TabsToSpaces = true;\n\t\t\toptions.EolMarker = \"\\n\";\n\n\t\t\tTest(policy, @\"class Test\n{\n  void TestMe ()\n  {\n    Foo (1, \n    2,\n    3);\n  }\n}\",\n\t\t\t     @\"class Test\n{\n  void TestMe ()\n  {\n    Foo (1, \n         2,\n         3);\n  }\n}\", FormattingMode.Intrusive, options);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIndexerCase1()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstIndexerDeclarationParameter = true;\n\t\t\tpolicy.IndexerDeclarationParameterWrapping = Wrapping.WrapAlways;\n\t\t\tTest(policy, @\"class ClassDeclaration\n{ \n\tpublic int this [\nint test,\nstring foo,\ndouble bar]\n\t{\n\t\tget {}\n\t}\n}\",\n\t\t\t\t@\"class ClassDeclaration\n{\n\tpublic int this [\n\t\tint test,\n\t\tstring foo,\n\t\tdouble bar] {\n\t\tget { }\n\t}\n}\");\n\t\t}\n\t\t\t\n\t\t[Test]\n\t\tpublic void TestIndexerCase2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstIndexerDeclarationParameter = true;\n\t\t\tpolicy.IndexerDeclarationParameterWrapping = Wrapping.WrapAlways;\n\t\t\tTest(policy, @\"class ClassDeclaration\n{ \n\tpublic int this [int test,\nstring foo,\ndouble bar]\n\t{\n\t\tget {}\n\t}\n}\",\n\t\t\t\t@\"class ClassDeclaration\n{\n\tpublic int this [int test,\n\t                 string foo,\n\t                 double bar] {\n\t\tget { }\n\t}\n}\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIndexerCase3()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tTest(policy, @\"class ClassDeclaration { \n\tpublic int this [int test, string foo, double bar]\n\t{\n\t\tget {}\n\t}\n\tpublic int this [\nint test,\nstring foo,\ndouble bar]\n\t{\n\t\tget {}\n\t}\n\tpublic int this [int test,\nstring foo,\ndouble bar]\n\t{\n\t\tget {}\n\t}\n}\",\n\t\t\t\t@\"class ClassDeclaration\n{\n\tpublic int this [int test, string foo, double bar] {\n\t\tget { }\n\t}\n\n\tpublic int this [\n\t\tint test,\n\t\tstring foo,\n\t\tdouble bar] {\n\t\tget { }\n\t}\n\n\tpublic int this [int test,\n\t                 string foo,\n\t                 double bar] {\n\t\tget { }\n\t}\n}\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ICSharpCode.NRefactory.CSharp;\nusing System.IO;\nusing ICSharpCode.NRefactory.Editor;\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp.Refactoring;\n\nnamespace ICSharpCode.NRefactory.CSharp.FormattingTests\n{\n\tpublic abstract class TestBase\n\t{\n\n\t\t/*public static string ApplyChanges (string text, List<TextReplaceAction> changes)\n\t\t{\n\t\t\tchanges.Sort ((x, y) => y.Offset.CompareTo (x.Offset));\n\t\t\tStringBuilder b = new StringBuilder(text);\n\t\t\tforeach (var change in changes) {\n\t\t\t\t//Console.WriteLine (\"---- apply:\" + change);\n//\t\t\t\tConsole.WriteLine (adapter.Text);\n\t\t\t\tif (change.Offset > b.Length)\n\t\t\t\t\tcontinue;\n\t\t\t\tb.Remove(change.Offset, change.RemovedChars);\n\t\t\t\tb.Insert(change.Offset, change.InsertedText);\n\t\t\t}\n//\t\t\tConsole.WriteLine (\"---result:\");\n//\t\t\tConsole.WriteLine (adapter.Text);\n\t\t\treturn b.ToString();\n\t\t}*/\n\t\t\n\t\tstatic TextEditorOptions GetActualOptions(TextEditorOptions options)\n\t\t{\n\t\t\tif (options == null) {\n\t\t\t\toptions = new TextEditorOptions();\n\t\t\t\toptions.EolMarker = \"\\n\";\n\t\t\t\toptions.WrapLineLength = 80;\n\t\t\t}\n\t\t\treturn options;\n\t\t}\n\n\t\tprotected static FormattingChanges GetChanges(CSharpFormattingOptions policy, string input, out StringBuilderDocument document, FormattingMode mode = FormattingMode.Intrusive, TextEditorOptions options = null)\n\t\t{\n\t\t\toptions = GetActualOptions(options);\n\t\t\tinput = NormalizeNewlines(input);\n\n\t\t\tdocument = new StringBuilderDocument(input);\n\t\t\tvar visitor = new CSharpFormatter(policy, options);\n\t\t\tvisitor.FormattingMode = mode;\n\t\t\tvar syntaxTree = new CSharpParser().Parse(document, \"test.cs\");\n\n\t\t\treturn visitor.AnalyzeFormatting(document, syntaxTree);\n\t\t}\n\n\t\tprotected static IDocument GetResult(CSharpFormattingOptions policy, string input, FormattingMode mode = FormattingMode.Intrusive, TextEditorOptions options = null)\n\t\t{\n\t\t\tStringBuilderDocument document;\n\t\t\tvar changes = GetChanges(policy, input, out document, mode, options);\n\t\t\t\n\t\t\tchanges.ApplyChanges();\n\t\t\treturn document;\n\t\t}\n\n\t\tprotected static FormattingChanges GetChanges(CSharpFormattingOptions policy, string input, FormattingMode mode = FormattingMode.Intrusive, TextEditorOptions options = null)\n\t\t{\n\t\t\tStringBuilderDocument document;\n\t\t\treturn GetChanges(policy, input, out document, mode, options);\n\t\t}\n\n\t\tprotected static void TestNoUnnecessaryChanges(CSharpFormattingOptions policy, string input, FormattingMode mode = FormattingMode.Intrusive, TextEditorOptions options = null)\n\t\t{\n\t\t\tvar formatted = GetResult(policy, input, mode, options).Text;\n\t\t\tvar changes = GetChanges(policy, formatted, mode, options);\n\t\t\tAssert.AreEqual(0, changes.Count, \"Wrong amount of changes\");\n\t\t}\n\t\t\n\t\tprotected static IDocument Test (CSharpFormattingOptions policy, string input, string expectedOutput, FormattingMode mode = FormattingMode.Intrusive, TextEditorOptions options = null)\n\t\t{\n\t\t\texpectedOutput = NormalizeNewlines(expectedOutput);\n\n\t\t\tIDocument doc = GetResult(policy, input, mode, options);\n\t\t\tif (expectedOutput != doc.Text) {\n\t\t\t\tConsole.WriteLine (\"expected:\");\n\t\t\t\tConsole.WriteLine (expectedOutput);\n\t\t\t\tConsole.WriteLine (\"got:\");\n\t\t\t\tConsole.WriteLine (doc.Text);\n\t\t\t\tfor (int i = 0; i < expectedOutput.Length && i < doc.TextLength; i++) {\n\t\t\t\t\tif (expectedOutput [i] != doc.GetCharAt(i)) {\n\t\t\t\t\t\tConsole.WriteLine (\n\t\t\t\t\t\t\t\"i:\"+i+\" differ:\"+ \n\t\t\t\t\t\t\texpectedOutput[i].ToString ().Replace (\"\\n\", \"\\\\n\").Replace (\"\\r\", \"\\\\r\").Replace (\"\\t\", \"\\\\t\") +\n\t\t\t\t\t\t\t\" !=\" + \n\t\t\t\t\t\t\tdoc.GetCharAt(i).ToString ().Replace (\"\\n\", \"\\\\n\").Replace (\"\\r\", \"\\\\r\").Replace (\"\\t\", \"\\\\t\")\n\t\t\t\t\t\t);\n\t\t\t\t\t\tConsole.WriteLine(\">\"+expectedOutput.Substring (i).Replace (\"\\n\", \"\\\\n\").Replace (\"\\r\", \"\\\\r\").Replace (\"\\t\", \"\\\\t\"));\n\t\t\t\t\t\tConsole.WriteLine(\">\"+doc.Text.Substring (i).Replace (\"\\n\", \"\\\\n\").Replace (\"\\r\", \"\\\\r\").Replace (\"\\t\", \"\\\\t\"));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tAssert.AreEqual (expectedOutput, doc.Text);\n\t\t\treturn doc;\n\t\t}\n\t\t\n\t\tprotected static string NormalizeNewlines(string input)\n\t\t{\n\t\t\treturn input.Replace(\"\\r\\n\", \"\\n\");\n\t\t}\n\n\t\tprotected static void Continue (CSharpFormattingOptions policy, IDocument document, string expectedOutput, FormattingMode formattingMode = FormattingMode.OnTheFly)\n\t\t{\n\t\t\texpectedOutput = NormalizeNewlines (expectedOutput);\n\t\t\tvar options = new TextEditorOptions ();\n\t\t\toptions.EolMarker = \"\\n\";\n\t\t\tvar formatter = new CSharpFormatter (policy, options);\n\t\t\tformatter.FormattingMode = formattingMode;\n\t\t\tstring newText = formatter.Format (document);\n\t\t\tif (expectedOutput != newText) {\n\t\t\t\tConsole.WriteLine(\"expected:\");\n\t\t\t\tConsole.WriteLine(expectedOutput);\n\t\t\t\tConsole.WriteLine(\"got:\");\n\t\t\t\tConsole.WriteLine(newText);\n\t\t\t}\n\t\t\tAssert.AreEqual (expectedOutput, newText);\n\t\t}\n\n\t\t\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" DefaultTargets=\"Build\">\r\n  <PropertyGroup>\r\n    <ProjectGuid>{63D3B27A-D966-4902-90B3-30290E1692F1}</ProjectGuid>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.Tests</AssemblyName>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <ProductVersion>8.0.30703</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <NoStdLib>False</NoStdLib>\r\n    <WarningLevel>4</WarningLevel>\r\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r\n    <OutputPath>..\\bin\\$(Configuration)\\</OutputPath>\r\n    <UseMSBuildEngine>False</UseMSBuildEngine>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <DebugType>Full</DebugType>\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <DebugSymbols>true</DebugSymbols>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <RegisterForComInterop>False</RegisterForComInterop>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <BaseAddress>4194304</BaseAddress>\r\n    <FileAlignment>4096</FileAlignment>\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'x86' \">\r\n    <RegisterForComInterop>False</RegisterForComInterop>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <BaseAddress>4194304</BaseAddress>\r\n    <FileAlignment>4096</FileAlignment>\r\n    <PlatformTarget>x86</PlatformTarget>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <DebugType>Full</DebugType>\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <DebugSymbols>true</DebugSymbols>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Release' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <DebugSymbols>false</DebugSymbols>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\r\n    <DebugType>none</DebugType>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|x86' \">\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|x86' \">\r\n    <DebugType>none</DebugType>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"Microsoft.CSharp\" />\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\" />\r\n    <Reference Include=\"System.Xml\" />\r\n    <Reference Include=\"System.Xml.Linq\" />\r\n    <Reference Include=\"nunit.framework\">\r\n      <HintPath>..\\..\\cecil\\Test\\libs\\nunit-2.5.10\\nunit.framework.dll</HintPath>\r\n    </Reference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"Analysis\\AbiComparerTests.cs\" />\r\n    <Compile Include=\"CSharp\\Analysis\\DefiniteAssignmentTests.cs\" />\r\n    <Compile Include=\"CSharp\\AstStructureTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddUsing\\AddUsingActionAlphabeticalTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddUsing\\AddUsingActionInsideNamespaceTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddUsing\\AddUsingRunActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddUsing\\AddUsingActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertAsToCastTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertCastToAsTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertExplicitToImplicitImplementationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertImplicitToExplicittImplementationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertLambdaBodyExpressionToStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertLambdaBodyStatementToExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertSwitchToIfTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateCustomEventImplementationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateOverloadWithoutParameterTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ExtractAnonymousMethodTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\JoinDeclarationAndAssignmentTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\JoinStringTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\MergeNestedIfTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\NegateRelationalExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\PutInsideUsingTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\SplitDeclarationListTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\UseStringFormatTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\AccessToDisposedClosureTests.cs\">\r\n      <DependentUpon>AccessToModifiedClosureTests.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"CSharp\\CodeIssues\\AccessToModifiedClosureTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS1717AssignmentMadeToSameVariableIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CastExpressionOfIncompatibleTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConstantConditionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DoubleNegationOperatorIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ExplicitConversionInForEachIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ExpressionIsNeverOfProvidedTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ForControlVariableIsNeverModifiedIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\LocalVariableHidesMemberIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\LocalVariableNotUsedIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\NegativeRelationalExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ParameterHidesMemberIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ParameterOnlyAssignedIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantCommaInArrayInitializerIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantAssignmentIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantAttributeParenthesesIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantCaseLabelIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantIfElseBlockIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantDefaultFieldInitializerIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantObjectCreationArgumentListIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantObjectOrCollectionInitializerIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantCastIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToCountIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToFirstIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToFirstOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToLastIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToLastOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToLongCountIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToSingleIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToSingleOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UnusedTypeParameterIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UnreachableCodeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CSharpAmbienceTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeDomConvertVisitorTests.cs\" />\r\n    <Compile Include=\"CSharp\\DepthFirstVisitorTests.cs\" />\r\n    <Compile Include=\"CSharp\\InsertMissingTokensDecoratorTests.cs\" />\r\n    <Compile Include=\"CSharp\\InsertParenthesesVisitorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CSharpOutputVisitorTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\ConsistencyChecker.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\AnonymousTypeCreateExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\ObjectCreateExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\UndocumentedExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\GeneralScope\\CommentTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\GeneralScope\\DelegateDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\GeneralScope\\NamespaceDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\GeneralScope\\PreprocessorDirectiveTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\GeneralScope\\TypeDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\GeneralScope\\UsingDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\ParseSelfTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\BlockStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\CheckedStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\EmptyStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\ExpressionStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\FixedStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\ForStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\GotoStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\IfElseStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\LabelStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\LockStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\ReturnStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\SwitchStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\ThrowStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\TryCatchStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\UnsafeStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\UsingStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\VariableDeclarationStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\WhileStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\YieldStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\ConstructorDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\DestructorDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\EventDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\FieldDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\IndexerDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\MethodDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\OperatorDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeMembers\\PropertyDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\TypeSystemConvertVisitorTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\AnonymousMethodExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\ArrayCreateExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\AssignmentExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\BaseReferenceExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\BinaryOperatorExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\CastExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\CheckedExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\ConditionalExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\DefaultValueExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\IdentifierExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\IndexerExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\InvocationExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\IsExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\LambdaExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\MemberReferenceExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\ParenthesizedExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\PointerReferenceExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\PrimitiveExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\QueryExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\SizeOfExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\StackAllocExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\ThisReferenceExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\TypeOfExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\TypeReferenceExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Expression\\UnaryOperatorExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\GeneralScope\\AttributeSectionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\ParseUtil.cs\" />\r\n    <Compile Include=\"CSharp\\QueryExpressionExpanderTests.cs\" />\r\n    <Compile Include=\"CSharp\\Refactoring\\LambdaHelperTests.cs\" />\r\n    <Compile Include=\"CSharp\\Refactoring\\RefactoringStructureTests.cs\" />\r\n    <Compile Include=\"CSharp\\Refactoring\\TypeSystemAstBuilderTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\AnonymousTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ArrayCreateTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\AttributeTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\BinaryOperatorTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\CastTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ComTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ConditionalOperatorTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\SizeOfTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\DynamicTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ExplicitConversionsTest.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ExtensionMethodTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\FindReferencesTest.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\InvocationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\LambdaTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\LinqTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\LocalTypeInferenceTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\MemberLookupTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\MethodTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\NameLookupTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ObjectCreationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ResolveAtLocationTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\TypeInferenceTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ConversionsTest.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\OverloadResolutionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\ResolverTestBase.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\UnaryOperatorTests.cs\" />\r\n    <Compile Include=\"CSharp\\Resolver\\UnsafeCodeTests.cs\" />\r\n    <Compile Include=\"Documentation\\CSharpCrefLookupTests.cs\" />\r\n    <Compile Include=\"Documentation\\CSharpCrefParserTests.cs\" />\r\n    <Compile Include=\"Documentation\\CSharpDocumentationTests.cs\" />\r\n    <Compile Include=\"Documentation\\IDStringTests.cs\" />\r\n    <Compile Include=\"Editor\\ReadOnlyDocumentTests.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestBraceStlye.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestFormattingBugs.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestSpacingVisitor.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestStatementIndentation.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestTypeLevelIndentation.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"TypeSystem\\BinaryLoaderTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\BlobLoaderTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\CecilLoaderTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\CyclicProjectDependency.cs\" />\r\n    <Compile Include=\"TypeSystem\\GetAllBaseTypesTest.cs\" />\r\n    <Compile Include=\"TypeSystem\\GetMembersTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\IkvmLoaderTests.cs\" Condition=\"Exists('..\\..\\ikvm\\reflect\\IKVM.Reflection.csproj')\" />\r\n    <Compile Include=\"TypeSystem\\InheritanceHelperTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\LazyLoadedCecilLoaderTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\ReflectionHelperTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\SerializedCecilLoaderTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\SerializedIkvmLoaderTests.cs\" Condition=\"Exists('..\\..\\ikvm\\reflect\\IKVM.Reflection.csproj')\" />\r\n    <Compile Include=\"TypeSystem\\StructureTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\TestInterningProvider.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeParameterTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeSystemHelper.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeSystemTests.cs\" />\r\n    <Compile Include=\"TypeSystem\\TypeSystemTests.TestCase.cs\" />\r\n    <EmbeddedResource Include=\"TypeSystem\\TypeSystemTests.TestCase.cs\" />\r\n    <Compile Include=\"Utils\\CSharpPrimitiveCastTests.cs\" />\r\n    <Compile Include=\"Utils\\TreeTraversalTests.cs\" />\r\n    <Compile Include=\"FormattingTests\\TextEditorTestAdapter.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestBlankLineFormatting.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\CodeCompletionAccessibleTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\CodeCompletionBugTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\CodeCompletionCSharp3Tests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\CodeCompletionCSharpTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\CompletionDataList.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\EnumContextTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\KeywordTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\ObjectInitializerTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\ParameterCompletionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\PreProcessorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\TestBase.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\VariableDeclarationStatementTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\NameContextTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertConditionalTernaryToNullCoalescingIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\InspectionActionTestBase.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\NotImplementedExceptionInspectorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantInternalInspectorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantNameQualifierIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantPrivateInspectorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantThisQualifierIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantUsingDirectiveIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithStringIsNullOrEmptyIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\SuggestUseVarKeywordEvidentTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\UseVarKeywordTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\TestRefactoringContext.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ContextActionTestBase.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\UseExplicitTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\SplitDeclarationAndAssignmentTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\SplitStringTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ReplaceEmptyStringTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\RemoveBracesTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\RemoveBackingStoreTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\InvertIfTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\IntroduceFormatItemTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\InsertAnonymousMethodSignatureTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\GenerateSwitchLabelsTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\GenerateGetterTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\FlipOperatorArgumentsTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertHexToDecTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertDecToHexTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CheckIfParameterIsNullTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertForeachToForTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddAnotherAccessorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\RemoveRegionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\GeneratePropertyTests.cs\" />\r\n    <Compile Include=\"CSharp\\Inspector\\InconsistentNamingIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\InconsistentNamingTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateLocalVariableTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateFieldTests.cs\">\r\n      <DependentUpon>CreateEventInvocatorTests.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"CSharp\\CodeActions\\CreatePropertyTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateMethodDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateIndexerTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\InlineLocalVariableTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\DeclareLocalVariableTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateClassDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateConstructorDeclarationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateDelegateTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\IntroduceConstantTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ExtractMethodTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Bugs\\ParserBugTests.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestKeepReformattingRules.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestWrapping.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\DelegateContextTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ImplementInterfaceTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ImplementInterfaceExplicitTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ImplementAbstractMembersTest.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\RemoveRedundantCatchTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddCatchTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DoNotCallOverridableMethodsInConstructorIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ExtensionMethodInvocationToStaticMethodInvocationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\IterateViaForeachTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ExtractFieldTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ValueParameterNotUsedIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\Parser\\Statements\\InvalidStatementsTests.cs\" />\r\n    <Compile Include=\"CSharp\\Refactoring\\NamingHelperTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertToInitializer\\ConvertToInitializerTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\MoveToOuterScopeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\VariableDeclaredInWideScopeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\DocumentationContextTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\AccessToStaticMemberViaDerivedTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ParameterCanBeDemotedIssue\\IsTypeCriterionTests.cs\" />\r\n    <Compile Include=\"Utils\\CompositeFormatStringParser\\CompositeFormatStringParserTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantToStringCallIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CallToObjectEqualsViaBaseTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\IncorrectCallToGetHashCodeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertToInitializer\\ConvertInitializerToExplicitIntializationsTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\BrowsableAttributeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ExceptionRethrowTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StaticFieldInGenericTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertAnonymousDelegateToLambdaTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertLamdaToAnonymousDelegateTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ParameterCanBeDemotedIssue\\SupportsIndexingCriterionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateBackingStoreTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantWhereWithPredicateIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\SortUsingsTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateEventInvocatorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\ImportCompletionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateEnumValueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\GetCurrentParameterIndexTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0127ReturnMustNotBeFollowedByAnyExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Analysis\\SemanticHighlightingTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CreateChangedEventTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\SimplifyIfFlowTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\SimplifyIfFlowInLoopsTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS1729TypeHasNoConstructorWithNArgumentsIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\InvertIfAndSimplifyTests.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestExpressionFormatting.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantComparisonWithNullIssueTests.cs\">\r\n    </Compile>\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantBaseConstructorIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EmptyConstructorIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PublicConstructorInAbstractClassIssueTest.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0029InvalidConversionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ParameterCanBeDemotedIssue\\ParameterCanBeIEnumerableTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DuplicateBodyMethodIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DuplicateExpressionsInConditionsIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DuplicateIfInIfChainIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\AstTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\LockThisTests.cs\" />\r\n    <Compile Include=\"Analysis\\SymbolCollectorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ImplementNotImplementedPropertyTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AutoLinqSumTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DisposeMethodInNonIDisposableTypeTests.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestGlobalLevelFormatting.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConditionalTernaryEqualBranchTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ThreadStaticAtInstanceFieldTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\MetaTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\FormatItemTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\LinqFluentToQueryTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\LinqQueryToFluentTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantExtendsListEntryIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CopyCommentsFromBaseTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CopyCommentsFromIntefaceTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CS1520MethodMustHaveAReturnTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EmptyDestructorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EmptyNamespaceTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantBaseQualifierTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0759RedundantPartialMethodIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantBoolCompareIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertClosureToMethodGroupIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EmptyEmbeddedStatementIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PartialTypeWithSinglePartIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantOverridenMemberTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EnumUnderlyingTypeIsIntTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EmptyGeneralCatchClauseTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\NonPublicMethodWithTestAttributeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\MemberCanBeMadeStaticIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantLambdaParameterTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\OptionalParameterHierarchyMismatchIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\FunctionNeverReturnsIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\BitwiseOperatorOnEnumWithoutFlagsIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeAnyIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeCountIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeFirstIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeFirstOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeLastIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeLastOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeLongCountIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeSingleIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeSingleOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithOfTypeWhereIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\LongLiteralEndingLowerLIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0659OverrideEqualsWithoutGetHashCodeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConstantNullCoalescingConditionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\Analysis\\NullValueAnalysisTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DuplicatedLinqToListOrArrayTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\InvertLogicalExpressionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ChangeAccessModifierTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AbstractAndVirtualConversionActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantToStringCallForValueTypesIssue.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UseOfMemberOfNullReferenceTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertToConstantIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\FieldCanBeMadeReadOnlyIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UnassignedReadonlyFieldIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UseMethodIsInstanceOfTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertWhileToDoWhileLoopTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UseIsOperatorIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RewriteIfReturnToReturnIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertIfStatementToConditionalTernaryExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertIfStatementToNullCoalescingExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertDoWhileToWhileLoopTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EqualExpressionComparisonIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertIfToOrExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertIfToAndExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EventUnsubscriptionViaAnonymousDelegateIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\BaseMemberHasParamsIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertIfDoToWhileIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertNullableToShortFormIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertEqualityOperatorToEqualsActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertEqualsToEqualityOperatorActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\FlipEqualsTargetAndArgumentActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CanBeReplacedWithTryCastAndCheckForNullIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\OptionalParameterRefOutIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithFirstOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithLastOrDefaultIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UseMethodAnyIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\InvokeAsExtensionMethodIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddArgumentNameTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StringIndexOfIsCultureSpecificIssueTest.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StringLastIndexOfIsCultureSpecificIssueTest.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StringStartsWithIsCultureSpecificIssueTest.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StringEndsWithIsCultureSpecificIssueTest.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\InvertConditionalOperatorActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CompareOfFloatsByEqualityOperatorIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantTernaryExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\SimplifyConditionalTernaryExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\BaseMethodCallWithDefaultParameterIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\NegateIsExpressionActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\Analysis\\DeclarationSpace\\LocalDeclarationSpaceTests.cs\" />\r\n    <Compile Include=\"CSharp\\Analysis\\DeclarationSpace\\LocalDeclarationSpaceVisitorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\XmlDocIssueIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS1573ParameterHasNoMatchingParamTagIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0126ReturnMustBeFollowedByAnyExpressionTestes.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertMethodGroupToLambdaActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertMethodGroupToAnonymousMethodActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddExceptionDescriptionActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DontUseLinqWhenItsVerboseAndInefficientTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertIfStatementToConditionalTernaryExpressionActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertIfStatementToReturnStatementActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertIfStatementToNullCoalescingExpressionActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertIfStatementToSwitchStatementActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertIfStatementToSwitchStatementIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantParamsIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertNullCoalescingToConditionalExpressionActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertReturnStatementToIfActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertAssignmentToIfActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ForCanBeConvertedToForeachIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\UseAsAndNullCheckActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertForToWhileActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddBracesActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantEmptyDefaultSwitchBranchIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0152DuplicateCaseLabelValueIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\SealedMemberInSealedClassIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UnusedAnonymousMethodSignatureIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\EmptyStatementIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantArgumentDefaultValueIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantEmptyFinallyBlockIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PartialMethodParameterNameMismatchIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSimpleAssignmentIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StringCompareToIsCultureSpecificIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StringCompareIsCultureSpecificIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UseArrayCreationExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UnusedLabelIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\BaseMethodParameterNameMismatchIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantExplicitArraySizeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantUnsafeContextIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ProhibitedModifiersIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RemoveRedundantOrStatementIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ExtractWhileConditionToInternalIfStatementActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ReverseDirectionForForLoopTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantArgumentNameTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\AutoAsyncTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\AdditionalOfTypeIssuesTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantLambdaSignatureParenthesesIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantCheckBeforeAssignmentTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertToLambdaExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\AddOptionalParameterToInvocationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ComputeConstantValueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertShiftToMultiplyActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertMultiplyToShiftActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ForStatementConditionIsTrueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\SplitIfActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantLogicalConditionalExpressionOperandIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertToStaticTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ReplaceAssignmentWithPostfixExpressionActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ReplacePostfixExpressionWithAssignmentActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ReplaceWithOperatorAssignmentActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ReplaceOperatorAssignmentWithAssignmentActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\OperatorIsCanBeUsedIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\FormatStringProblemIssueTests.cs\" />\r\n    <Compile Include=\"IndentationTests\\AllInOneTests.cs\" />\r\n    <Compile Include=\"IndentationTests\\BlockTest.cs\" />\r\n    <Compile Include=\"IndentationTests\\CommentTests.cs\" />\r\n    <Compile Include=\"IndentationTests\\Helper.cs\" />\r\n    <Compile Include=\"IndentationTests\\PreProcessorTests.cs\" />\r\n    <Compile Include=\"IndentationTests\\StringTests.cs\" />\r\n    <Compile Include=\"IndentationTests\\TextPasteIndentEngineTests.cs\" />\r\n    <Compile Include=\"IndentationTests\\AlignmentTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantCatchClauseIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeCompletion\\CodeCompletionOperatorTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CheckNamespaceIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PossibleMultipleEnumerationIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConditionIsAlwaysTrueOrFalseIssueTests.cs\" />\r\n    <Compile Include=\"IndentationTests\\GeneralTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\MemberHidesStaticFromOuterClassIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\MethodOverloadWithOptionalParameterIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReferenceEqualsWithValueTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CompareNonConstrainedGenericWithNullIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantDelegateCreationIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantEnumerableCastCallIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\MissingInterfaceMemberImplementationIssueTests.cs\" />\r\n    <Compile Include=\"FormattingTests\\TestLinq.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantBlockInDifferentBranchesTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ParameterCanBeDemotedIssue\\ParameterCanBeDeclaredWithBaseTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\NonReadonlyReferencedInGetHashCodeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\SameGuardConditionExpressionInIfElseBranchesTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertBitwiseFlagComparisonToHasFlagsActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\ConvertHasFlagsToBitwiseFlagComparisonActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantExplicitArrayCreationIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ArrayCreationCanBeReplacedWithArrayInitializerIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantAnonymousTypePropertyNameIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PossibleAssignmentToReadonlyFieldIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ObjectCreationAsStatementIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\NotResolvedInTextIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\DelegateSubtractionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UnusedParameterIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\SimplifyLinqExpressionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantExplicitNullableCreationIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantStringToCharArrayCallIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertToAutoPropertyIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StaticConstructorParameterIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0183ExpressionIsAlwaysOfProvidedTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PolymorphicFieldLikeEventInvocationIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ConvertTailRecursiveCallToLoopIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\LoopCanBeConvertedToQueryIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PartOfBodyCanBeConvertedToQueryIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantTypeArgumentsOfMethodIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\PossibleMistakenCallToGetTypeIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\RedundantNotNullAttributeInNonNullableTypeTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0618UsageOfObsoleteMemberIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\CS0169FieldIsNeverUsedIssueTests.cs\" />\r\n    <Compile Include=\"FormattingTests\\ConstructFixerTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\StaticEventSubscriptionIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeActions\\CS1105ExtensionMethodMustBeDeclaredStaticActionTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\UnmatchedSizeSpeicificationInArrayCreationTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToMaxIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToMinIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToSumIssueTests.cs\" />\r\n    <Compile Include=\"CSharp\\CodeIssues\\ReplaceWithSingleCallToAverageIssueTests.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\..\\cecil\\Mono.Cecil.csproj\">\r\n      <Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>\r\n      <Name>Mono.Cecil</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.CSharp\\ICSharpCode.NRefactory.CSharp.csproj\">\r\n      <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>\r\n      <Name>ICSharpCode.NRefactory.CSharp</Name>\r\n      <Private>False</Private>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.Xml\\ICSharpCode.NRefactory.Xml.csproj\">\r\n      <Project>{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}</Project>\r\n      <Name>ICSharpCode.NRefactory.Xml</Name>\r\n      <Private>False</Private>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n      <Private>False</Private>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.Cecil\\ICSharpCode.NRefactory.Cecil.csproj\">\r\n      <Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>\r\n      <Name>ICSharpCode.NRefactory.Cecil</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.IKVM\\ICSharpCode.NRefactory.IKVM.csproj\" Condition=\"Exists('..\\..\\ikvm\\reflect\\IKVM.Reflection.csproj')\">\r\n      <Project>{A727169F-D94F-443F-B305-B057D7F3B420}</Project>\r\n      <Name>ICSharpCode.NRefactory.IKVM</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory.CSharp.Refactoring\\ICSharpCode.NRefactory.CSharp.Refactoring.csproj\">\r\n      <Project>{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}</Project>\r\n      <Name>ICSharpCode.NRefactory.CSharp.Refactoring</Name>\r\n      <Private>False</Private>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\r\n  <ProjectExtensions>\r\n    <MonoDevelop>\r\n      <Properties>\r\n        <Policies>\r\n          <TextStylePolicy TabsToSpaces=\"False\" EolMarker=\"Unix\" inheritsSet=\"VisualStudio\" inheritsScope=\"text/plain\" scope=\"text/plain\" />\r\n          <TextStylePolicy FileWidth=\"120\" TabsToSpaces=\"False\" EolMarker=\"Unix\" inheritsSet=\"VisualStudio\" inheritsScope=\"text/plain\" scope=\"text/x-csharp\" />\r\n          <CSharpFormattingPolicy IndentSwitchBody=\"True\" BeforeMethodDeclarationParentheses=\"False\" BeforeMethodCallParentheses=\"False\" BeforeConstructorDeclarationParentheses=\"False\" BeforeDelegateDeclarationParentheses=\"False\" NewParentheses=\"False\" inheritsSet=\"Mono\" inheritsScope=\"text/x-csharp\" scope=\"text/x-csharp\" />\r\n        </Policies>\r\n      </Properties>\r\n    </MonoDevelop>\r\n  </ProjectExtensions>\r\n  <ItemGroup>\r\n    <Folder Include=\"IndentationTests\\\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"IndentationTests\\TestFiles\\Comments.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\IndentEngine.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\IndentState.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\PreProcessorDirectives.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\Simple.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\Strings.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\SwitchCase.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\CSharpParser.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\TextArea.cs\" />\r\n    <None Include=\"IndentationTests\\TestFiles\\InheritStatements.cs\" />\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/AlignmentTests.cs",
    "content": "//\n// AlignmentTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class AlignmentTests\n\t{\n\t\t[Test]\n\t\tpublic void MethodCallAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tCall(A,$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IndexerAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstIndexerArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\nvoid Test ()\n{\nCall[A,$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BinaryExpressionAlignment()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstIndexerArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tpublic static bool IsComplexExpression(AstNode expr)\n\t\t{\n\t\t\treturn expr.StartLocation.Line != expr.EndLocation.Line ||\n\t\t\t\texpr is ConditionalExpression ||$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodContinuation()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar a = Call(A)\n\t\t\t.Foo ()$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodContinuationDeep()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar a = Call(A)\n\t\t\t.Foo ()\n\t\t\t.Foo ()\n\t\t\t.Foo ()$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodContinuation_AlignToMemberReferenceDot()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tfmt.AlignToMemberReferenceDot = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar a = Call(A).Foo ()\n\t\t               .Foo ()\n\t\t               .Foo ()$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t               \", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlignEmbeddedIfStatements()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tif (true)\n\t\tif (true)\n\t\tif (true) $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnalignEmbeddedIfStatements()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tif (true)\n\t\t\tif (true)\n\t\t\t\tif (true) $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlignEmbeddedUsingStatements()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test (IDisposable a, IDisposable b)\n\t{\n\t\tusing (a)\n\t\tusing (a)\n\t\tusing (b) $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlignEmbeddedLockStatements()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test (IDisposable a, IDisposable b)\n\t{\n\t\tlock (a)\n\t\tlock (a)\n\t\tlock (b) $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\t\t[Test]\n\t\tpublic void UnalignEmbeddedUsingStatements()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test (IDisposable a, IDisposable b)\n\t{\n\t\tusing (a)\n\t\t\tusing (a)\n\t\t\t\tusing (b) $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AlignNamedAttributeArgument()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\n[Attr (1,\n       Foo = 2,$\n       Bar = 3\", fmt);\n\t\t\tAssert.AreEqual(\"       \", indent.ThisLineIndent, \"this line indent doesn't match\");\n\t\t\tAssert.AreEqual(\"       \", indent.NextLineIndent, \"next line indent doesn't match\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnalignNamedAttributeArguments()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\n[Attr (1,\n\tFoo = 2,$\n\tBar = 3\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent, \"this line indent doesn't match\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent, \"next line indent doesn't match\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestFormatFirstLineKeepFalse()\n\t\t{\n\t\t\tvar fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.KeepCommentsAtFirstColumn = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n // Hello World$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Ignore (\"Should not be respected\")]\n\t\t[Test]\n\t\tpublic void TestFormatFirstLineKeepTrue()\n\t\t{\n\t\t\tvar fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.KeepCommentsAtFirstColumn = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n// Hello World$\", fmt);\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLongBinaryExpressionAlignmentBug()\n\t\t{\n\t\t\tvar fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.KeepCommentsAtFirstColumn = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tbool ISupportsInterning.EqualsForInterning(ISupportsInterning other)\n\t{\n\t\treturn p != null && type == p.type && name == p.name &&\n\t\t\tdefaultValue == p.defaultValue && region == p.region && (flags & ~1) == (p.flags & ~1) && ListEquals(attributes, p.attributes);$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_MethodNamedArgs()\n\t\t{\n\t\t\tvar fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tBar (Named = $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_MethodNamedArgs2()\n\t\t{\n\t\t\tvar fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tBar (Named = $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_MethodNamedArgs3()\n\t\t{\n\t\t\tvar fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tBar (Named = 1 +\n\t\t     2, $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_RelationalOperator()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\treturn x == 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_RelationalOperator2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\treturn x >= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_RelationalOperator3()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\treturn x <= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_RelationalOperator4()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\treturn x != 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx += 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx -= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator3()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx *= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator4()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx /= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator5()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx %= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator6()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx &= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator7()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx |= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator8()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx ^= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"fixme\")]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator9()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx >>= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"fixme\")]\n\t\tpublic void TestIsRightHandExpression_ShortHandOperator10()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx <<= 1 $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_Statement()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tif (1 == 1)\n\t\t\tx = \n\t\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_Statement2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tif (1 == 1)\n\t\t\tx = \n\t\t\t\t1; $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_Statement3()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tif (1 == 1)\n\t\t\tx = 1 +\n\t\t\t\t2; $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_MultipleAssignments()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx = y = z = \n\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIsRightHandExpression_MultipleAssignments2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tx = y = z = 1 +\n\t\t\t2; $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BasicMethodContinuation()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tCall(A)\n\t\t\t.Foo ()$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DeepMethodContinuation()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tCall(A)\n\t\t\t.Foo ()\n\t\t\t.Foo ()\n\t\t\t.Foo ()$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DeepMethodContinuationStatement()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tif (true)\n\t\t\tCall(A)\n\t\t\t\t.Foo ()\n\t\t\t\t.Foo ()\n\t\t\t\t.Foo (); $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DeepMethodContinuationStatement_AlignToMemberReferenceDot()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignToMemberReferenceDot = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tif (true)\n\t\t\tCall(A).Foo ()\n\t\t\t       .Foo ()\n\t\t\t       .Foo (); $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t       \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodContinuation()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tobj\n\t\t\t.Foo (); $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodContinuationCase2()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tvoid Test ()\n\t{\n\t\tvar foo = obj\n\t\t\t.Foo (); $\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodContinuationCase3a()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tint Test ()\n\t{\n\t\treturn obj\n\t\t\t.Foo ()$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMethodContinuationCase3b()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo\n{\n\tint Test ()\n\t{\n\t\treturn \n\t\t\tobj\n\t\t\t\t.Foo ()$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/AllInOneTests.cs",
    "content": "﻿//\n// AllInOneTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp;\nusing NUnit.Framework;\nusing System;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class AllInOneTests\n\t{\n\t\tconst string ProjectDir = \"../../\";\n\t\tconst string TestFilesPath = \"ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles\";\n\n\t\tpublic void BeginFileTest(string fileName, CSharpFormattingOptions policy = null, TextEditorOptions options = null)\n\t\t{\n\t\t\tHelper.ReadAndTest(System.IO.Path.Combine(ProjectDir, TestFilesPath, fileName), policy, options);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_Simple()\n\t\t{\n\t\t\tBeginFileTest(\"Simple.cs\");   \n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_PreProcessorDirectives()\n\t\t{\n\t\t\tBeginFileTest(\"PreProcessorDirectives.cs\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_Comments()\n\t\t{\n\t\t\tBeginFileTest(\"Comments.cs\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_Strings()\n\t\t{\n\t\t\tBeginFileTest(\"Strings.cs\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_IndentEngine()\n\t\t{\n\t\t\tBeginFileTest(\"IndentEngine.cs\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_CSharpParser()\n\t\t{\n\t\t\tBeginFileTest(\"CSharpParser.cs\", FormattingOptionsFactory.CreateSharpDevelop());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_TextArea()\n\t\t{\n\t\t\tBeginFileTest(\"TextArea.cs\");\n\t\t}\n\n//\t\t[Test]\n//\t\tpublic void TestAll()\n//\t\t{\n//\t\t\tforeach (var file in System.IO.Directory.EnumerateFiles(\"/home/mkrueger/work/monodevelop\", \"*.cs\", System.IO.SearchOption.AllDirectories)) {\n//\t\t\t\tHelper.ReadAndTest(file, null, null);\n//\t\t\t}\n//\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_IndentState()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentSwitchBody = true;\n\t\t\tpolicy.IndentCaseBody = true;\n\t\t\tpolicy.IndentBreakStatements = true;\n\t\t\tpolicy.AlignToFirstIndexerArgument = policy.AlignToFirstMethodCallArgument = true;\n\t\t\tBeginFileTest(\"IndentState.cs\", policy);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_SwitchCase()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentSwitchBody = true;\n\t\t\tpolicy.IndentCaseBody = true;\n\t\t\tpolicy.IndentBreakStatements = false;\n\n\t\t\tBeginFileTest(\"SwitchCase.cs\", policy);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAllInOne_InheritStatements()\n\t\t{\n\t\t\tBeginFileTest(\"InheritStatements.cs\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/BlockTest.cs",
    "content": "﻿//\n// BlockTest.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class BracketsTest\n\t{\n\t\t[Test]\n\t\tpublic void TestBrackets_Simple()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_PreProcessor_If()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if NOTTHERE\n\t{\n#endif\n\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_PreProcessor_If2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if NOTTHERE || true\n\t\t{\n#endif\n\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_If()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tif (true)$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_While()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\twhile (true)$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_For()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tfor (;;)$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Foreach()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tforeach (var v in V)$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Do()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo\n\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Do2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo\n\t\t\t;\n$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NestedDo()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo do\n\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NestedDo2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo do\n\t\t\t\t;\n$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NestedDoContinuationSetBack()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo do do\n\t\t\tfoo();\n$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NestedDoContinuationSetBack2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo \n\t\t\tdo\n\t\t\t\tdo\n\t\t\t\t\tfoo();\n$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NestedDoContinuation_ExpressionEnded()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo do do foo(); $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NestedDoContinuation_ExpressionNotEnded()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo do do foo() $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NestedDoContinuation_ExpressionNotEnded2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tdo do do \n\t\t\tfoo() $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_ThisLineIndentAfterCurlyBrace()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t}$\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_ThisLineIndentAfterCurlyBrace2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ }$\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Parameters()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tFoo(true,$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t    \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Parameters2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tFoo($\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Parenthesis()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tFoooo(a, b, c, // ) \n\t\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t      \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t      \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Parenthesis2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tFoooo(a, b, c, // ) \n\t\t\t\td) $\");\n\t\t\tAssert.AreEqual(\"\\t\\t      \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_SquareBrackets()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = [a, b, c, // ] \n\t\t\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t         \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t         \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_SquareBrackets2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = [a, b, c, // ]\n\t\t\t\t\td]; $\");\n\t\t\tAssert.AreEqual(\"\\t\\t         \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_AngleBrackets()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tFunc<a, b, c, // > \n\t\t\t\t$\");\n\t\t\tAssert.Inconclusive(\"Not implemented.\");\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_AngleBrackets2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tFunc<a, b, c, // >\n\t\t\t\td> $\");\n\t\t\tAssert.Inconclusive(\"Not implemented.\");\n\t\t\tAssert.AreEqual(\"\\t\\t     \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_Nested()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tFoo(a, b, bar(c, d[T,  // T\n\t\t                   G], // G\n\t\t              e), $    // e\n\t\t\tf);\");\n\t\t\tAssert.AreEqual(\"\\t\\t              \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t    \", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NotLineStart()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n\t\tvoid Test(int i,\n\t\t          double d) { $\");\n\t\t\tAssert.AreEqual(\"\\t\\t          \", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_RightHandExpression()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = from i in I\n\t\t\t\twhere i == ';'\n\t\t\t\tselect i; $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_DotExpression()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = I.Where(i => i == ';')\n\t\t\t.Select(i => i); $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_LambdaExpression()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = () => { $\n\t\t};\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_LambdaExpression2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = () => {\n\t\t}; $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_EqualContinuation()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = \n\t\t\t0; $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_EqualExtraSpaces()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tvar v = 1 + $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_NamespaceIndentingOff()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.IndentNamespaceBody = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Bar {\nclass Foo {\nvoid Test ()\n{\n\t$\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ThisLineIndentInCollectionInitializer()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tpublic static CSharpFormattingOptions CreateMono()\n\t\t{\n\t\t\treturn new CSharpFormattingOptions {\n\t\t\t\tIndentNamespaceBody = true,\n\t\t\t\tIndentClassBody = true,\n\t\t\t\t$\n\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_AnonymousMethodAsParameter()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tFoo (\n\t\t\ta,\n\t\t\tdelegate {\n\t\t\t\tevlel();\n\t\t\t\t$\n\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_AnonymousMethodAsParameterCase2()\n\t\t{\n\t\t\tvar opt = FormattingOptionsFactory.CreateMono();\n\t\t\topt.AlignToFirstMethodCallArgument = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tFoo (a,\n\t\t\tb,\n\t\t\tdelegate {\n\t\t\t\tevlel();\n\t\t\t\t$\n\", opt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElse_AlignElseToCorrectIf()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tfmt.AlignElseInIfStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tif (true)\n\t\t\t{ }\n\t\t\telse $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElse_AlignElseToCorrectIf2()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tfmt.AlignElseInIfStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tlock (this)\n\t\t\t\tif (true)\n\t\t\t\t\tif (false)\n\t\t\t\t\t{ }\n\t\t\t\t\telse\n\t\t\t\t\t\t;\n\t\t\t\telse $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElse_BreakNestedStatementsOnSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tlock (this)\n\t\t\t\tif (true)\n\t\t\t\t\tif (false)\n\t\t\t\t\t\t;\n\t\t; // this should break the nested statements\n\t\telse $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElse_ElseIf()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tfmt.AlignElseInIfStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\t;\n\t\telse if (false)\n\t\t\tlock (this)\n\t\t\t\tif (true)\n\t\t\t\t\t;\n\t\t\t\telse if (false)\n\t\t\t\t{ }\n\t\t\t\telse $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElse_BreakNestedStatementsOnIf()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\tif (true)\n\t\t\tlock (this)\n\t\t\t\tif (true)\n\t\t\t\t\tlock(this)\n\t\t\t\t\t\tif (true)\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\telse if (false)\n\t\t\t\t\t\t{ }\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t;\n\t\tif (true) // this if should break the nested statements\n\t\t\t;\n\t\telse \n\t\t\t;\n\t\telse $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElse_BreakNestedStatementsOnAnyStatement()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\tif (true)\n\t\t\tlock (this)\n\t\t\t\tif (true)\n\t\t\t\t\tlock(this)\n\t\t\t\t\t\tif (true)\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\telse if (false)\n\t\t\t\t\t\t{ }\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t;\n\t\tlock (this) // any statement should break the nested statements\n\t\t\t;\n\t\telse $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElse_BreakNestedStatementsOnAnonymousBlock()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tlock (this)\n\t\t\t\tif (true)\n\t\t\t\t\tif (false)\n\t\t\t\t\t\t;\n\t\t{ } // this should break the nested statements\n\t\telse $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_StackedIfElseIf_IfInNewLine()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tFooBar ();\n\t\telse\n\t\t\tif (true) {\n\t\t\t\t$\n\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_RemoveStatementContinuationWhenNoSemicolon()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{ \n\t\tif (true)\n\t\t\tusing (this)\n\t\t\t\tif (true)\n\t\t\t\t{\n\t\t\t\t\t// ...\n\t\t\t\t} $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_CustomIndent()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\t// ...\n\t\t\tif (true)\n\t\t\t{\n\t\t\t\t$ \n\t\t\t}\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_CustomIndent2()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\t\t\tif (true)\n\t\t\t\t{\n\t\t\t\t\t// ...\n\t\t\t\t} $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_CustomIndent3()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tusing (this)\n\t\t\t\t\tif (true)\n\t\t\t\t\t{ } $ \", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_CustomIndent4()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\t\tusing (this)\n\t\t\t{\n\t\t\t\t\tif (true)\n\t\t\t\t\t{ } $ \n\t\t\t}\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_CustomIndent5()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tusing (this)\nif (true)\n{ } $ \", fmt);\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_CustomIndent6()\n\t\t{\n\t\t\tCSharpFormattingOptions fmt = FormattingOptionsFactory.CreateMono();\n\t\t\tfmt.AlignEmbeddedStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tvoid Test ()\n\t{\n\t\tusing (this)\n\t\t\tif (true)\n\t{\n\t\t\t\t$\t\n\t}\", fmt);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_AnonymousMethodAsFirstParameterWithoutAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = false;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\tFoo (delegate {\n\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_AnonymousMethodOpenBracketAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tFoo (delegate\n\t\t{$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_AnonymousMethodCloseingBracketAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tFoo (delegate\n\t\t{\n\t\t}$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tFoo (delegate\n\t\t\t{$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_ClosingBracket()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tFoo (delegate\n\t\t\t{\n\t\t\t}$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_AfterBlockAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tFoo (delegate\n\t\t{\n\t\t},\n\t\t\t42,$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_OpenBracketOnNonEmptyLine()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tFoo (delegate {\n\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_OpenBracketOnNonEmptyLine_ClosingBracket()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tFoo (delegate {\n\t\t\t//\n\t\t},$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_RightHandExpression()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tvar foo = delegate\n\t\t\t{$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_RightHandExpression_ClosingBracket()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tvar foo = delegate\n\t\t\t{\n\t\t\t}$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_RightHandExpression_OpenBracketOnNonEmptyLine()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tvar foo = delegate {$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_RightHandExpression_OpenBracketOnNonEmptyLine_ClosingBracket()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tpolicy.IndentBlocksInsideExpressions = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{\n\t\tvar foo = delegate {\n\t\t}$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_ArrayCreationAsFirstParameterWithoutAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = false;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\tFoo (new int[] {\n\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_ObjectCreationAsFirstParameterWithoutAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = false;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\tFoo (new MyOBject {\n\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_ArrayCreationAsFirstIndexerParameterWithoutAlignment()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = false;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\tFoo [new int[] {\n\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 16231 - smart indent broken in 4.2.0\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16231()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\tswitch (foo) {\n\t\t}\n\t\tif (true) {\n\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexIfElseElsePlacement_AlignmentOff()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignElseInIfStatements = false;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\tif (1 > 0)\n\t\t\ta = 1;\n\t\telse\n\t\t\tif (2 < 10)\n\t\t\t\ta = 2;\n\t\t\telse$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestComplexIfElseElsePlacement_AlignmentOn()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignElseInIfStatements = true;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\tif (1 > 0)\n\t\t\ta = 1;\n\t\telse\n\t\t\tif (2 < 10)\n\t\t\t\ta = 2;\n\t\telse$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestNextLineShifted_OpeningBrace()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNextLineShifted_ClosingBrace()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n\t{\n\t}$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNextLineShifted2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.NextLineShifted2;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBanner_ClosingBrace()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.ClassBraceStyle = BraceStyle.BannerStyle;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\t}$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNextLineShifted_IfStatement()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tpublic static void Main (string[] args)\n\t{\n\t\tif (true)\n\t\t{$\n\t}\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreprocessorIndenting_Case1()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nusing System;\n\nclass X\n{\n\tstatic void Foo (int arg)\n\t{\n\t\t#if !DEBUG\n\t\tif (arg > 0) {\n\t\t#else$\n\t\tif (arg < 0) {\n\t\t#endif\n\t\t\t\n\t\t}\n\t}\n\n\tpublic static void Main ()\n\t{\n\t}\n}\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreprocessorIndenting_Case2()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nusing System;\n\nclass X\n{\n\tstatic void Foo (int arg)\n\t{\n\t\t#if !DEBUG\n\t\tif (arg > 0) {\n\t\t#else\n\t\tif (arg < 0) {$\n\t\t#endif\n\t\t\t\n\t\t}\n\t}\n\n\tpublic static void Main ()\n\t{\n\t}\n}\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreprocessorIndenting_Case3()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.StatementBraceStyle = BraceStyle.NextLineShifted;\n\t\t\tvar indent = Helper.CreateEngine(@\"\nusing System;\n\nclass X\n{\n\tstatic void Foo (int arg)\n\t{\n\t\t#if !DEBUG\n\t\tif (arg > 0) {\n\t\t#else\n\t\tif (arg < 0) {\n\t\t#endif\n\t\t\t$\n\t\t}\n\t}\n\n\tpublic static void Main ()\n\t{\n\t}\n}\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressionsOpenBrace()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tFoo (new MyOBject\n\t\t\t{$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_IndentBlocksInsideExpressions_Allman()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test()\n\t{ \n\t\tFoo (new MyOBject\n\t\t\t{\n\t\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Bug 18463 - Indentation does not work when typed statement does not require semicolon\n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug18463()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace FooBar\n{\n\tpublic class TestProject\n\t{\n\t\tpublic static int Main ()\n\t\t{\n\t\t\tswitch (current_token) {\n\t\t\t\tcase Token.CLOSE_PARENS:\n\t\t\t\tcase Token.TRUE:\n\t\t\t\tcase Token.FALSE:\n\t\t\t\tcase Token.NULL:\n\t\t\t\tcase Token.LITERAL:\n\t\t\t\t\treturn Token.INTERR;\n\t\t\t}\n\t\t\tif (true) {\n\t\t\t\t$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestIssue389()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateAllman();\n\t\t\tvar indent = Helper.CreateEngine(@\"\npublic class Test\n{\n\tpublic void FooBar()\n\t{\n\t\tif (true)\n\t\t{$\n\t\t\t\n\t\t}\n\t}\n}\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/CommentTests.cs",
    "content": "﻿//\n// CommentTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class CommentTests\n\t{\n\t\t[Test]\n\t\tpublic void TestLineComment_Simple()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(\"// comment $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLineComment_PreProcessor()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\n#if NOTTHERE\n\t// comment $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLineComment_Class()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\t// comment $\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLineComment_For()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tfor (;;)\n\t\t// comment \n\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLineComment_For2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tfor (;;)\n\t\t// comment \n\t\tTest();\n\t$\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestLineComment_For3()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\tfor (;;) ;\n\t// comment $\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiLineComment_Simple()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"/* comment */$\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiLineComment_ExtraSpaces()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"/* comment $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiLineComment_MultiLines()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo {\n\t/* line 1 \n\tline 2\n\t*/$\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Ignore (\"Should not be respected\")]\n\t\t[Test]\n\t\tpublic void TestCommentBug()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace FooBar\n{\n//\n// $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/GeneralTests.cs",
    "content": "//\n// GeneralTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class GeneralTests\n\t{\n\t\t[Test]\n\t\tpublic void UsingDeclarationTests()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(\"using NUnit.Framework;\\n$\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedUsingDeclarationTest()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tnamespace Bar {\n\t\tusing NUnit.Framework;$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMixedLineEndingPosition()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(\"\\n\\r\\n$\");\n\t\t\tAssert.AreEqual(new TextLocation(3, 1), indent.Location);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/Helper.cs",
    "content": "﻿//\n// Helper.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Editor;\nusing NUnit.Framework;\nusing System.IO;\nusing System.Text;\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\tinternal static class Helper\n\t{\n\t\tpublic static IDocumentIndentEngine CreateEngine(string text, CSharpFormattingOptions formatOptions = null, IEnumerable<string> symbols = null)\n\t\t{\n\t\t\tvar policy = formatOptions;\n\t\t\tif ( policy == null) {\n\t\t\t\tpolicy = FormattingOptionsFactory.CreateMono();\n\t\t\t\tpolicy.IndentPreprocessorDirectives = false;\n\t\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = true;\n\n\t\t\t}\n\n\t\t\tvar sb = new StringBuilder();\n\t\t\tint offset = 0;\n\t\t\tfor (int i = 0; i < text.Length; i++)\n\t\t\t{\n\t\t\t\tvar ch = text[i];\n\t\t\t\tif (ch == '$')\n\t\t\t\t{\n\t\t\t\t\toffset = i;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append(ch);\n\t\t\t}\n\n\t\t\tvar document = new ReadOnlyDocument(sb.ToString());\n\t\t\tvar options = new TextEditorOptions();\n\n\t\t\tvar csi = new CSharpIndentEngine(document, options, policy) {\n\t\t\t\tEnableCustomIndentLevels = true\n\t\t\t};\n\t\t\tif (symbols != null) {\n\t\t\t\tforeach (var sym in symbols) {\n\t\t\t\t\tcsi.DefineSymbol(sym);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar result = new CacheIndentEngine(csi);\n\t\t\tresult.Update(offset);\n\t\t\treturn result;\n\t\t}\n\n\n\t\tpublic static void RandomTests(string filePath, int count, CSharpFormattingOptions policy = null, TextEditorOptions options = null)\n\t\t{\n\t\t\tif (File.Exists(filePath))\n\t\t\t{\n\t\t\t\tvar code = File.ReadAllText(filePath);\n\t\t\t\tvar document = new ReadOnlyDocument(code);\n\t\t\t\tpolicy = policy ?? FormattingOptionsFactory.CreateMono();\n\t\t\t\toptions = options ?? new TextEditorOptions { IndentBlankLines = false };\n\n\t\t\t\tvar engine = new CacheIndentEngine(new CSharpIndentEngine(document, options, policy) { EnableCustomIndentLevels = true });\n\t\t\t\tRandom rnd = new Random();\n\n\t\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\t\tint offset = rnd.Next(document.TextLength);\n\t\t\t\t\tengine.Update(offset);\n\t\t\t\t\tif (engine.CurrentIndent.Length == 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAssert.Fail(\"File \" + filePath + \" doesn't exist.\");\n\t\t\t}\n\t\t}\n\n\n\t\tpublic static void ReadAndTest(string filePath, CSharpFormattingOptions policy = null, TextEditorOptions options = null)\n\t\t{\n\t\t\tif (File.Exists(filePath))\n\t\t\t{\n\t\t\t\tfilePath = Path.GetFullPath(filePath);\n\t\t\t\tvar code = File.ReadAllText(filePath);\n\t\t\t\tvar document = new ReadOnlyDocument(code);\n\t\t\t\tif (policy == null) {\n\t\t\t\t\tpolicy = FormattingOptionsFactory.CreateMono();\n\t\t\t\t\tpolicy.AlignToFirstIndexerArgument = policy.AlignToFirstMethodCallArgument = true;\n\t\t\t\t}\n\t\t\t\toptions = options ?? new TextEditorOptions { IndentBlankLines = false, EolMarker = \"\\n\" };\n\n\t\t\t\tvar engine = new CacheIndentEngine(new CSharpIndentEngine(document, options, policy) { EnableCustomIndentLevels = true });\n\t\t\t\tint errors = 0;\n\n\t\t\t\tforeach (var ch in code)\n\t\t\t\t{\n\t\t\t\t\tif (options.EolMarker[0] == ch)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!(engine.LineBeganInsideMultiLineComment || engine.LineBeganInsideVerbatimString)) {\n\t\t\t\t\t\t\tif (engine.CurrentIndent.Length > 0) {\n\t\t\t\t\t\t\t\tif (engine.NeedsReindent) {\n\t\t\t\t\t\t\t\t\terrors++;\n\t\t\t\t\t\t\t\t\tConsole.WriteLine(string.Format(\"Indent: {2}, Current indent: {3} in {0}:{1}\", filePath, engine.Location.Line, engine.ThisLineIndent.Length, engine.CurrentIndent.Length));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tengine.Push(ch);\n\t\t\t\t}\n\t\t\t\tAssert.AreEqual(0, errors);\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAssert.Fail(\"File \" + filePath + \" doesn't exist.\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/PreProcessorTests.cs",
    "content": "﻿//\n// PreProcessorTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing ICSharpCode.NRefactory.CSharp;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class PreProcessorTests\n\t{\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Simple()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(\"#if MONO\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_If()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\n#if false\n{ $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_If2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\n#if true\n{ $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessorComment_NestedBlocks()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if false\n\t\t{ $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessorStatement_NestedBlocks()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if true\n\t\t{ $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Elif()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if true\n\t\t{\n#elif false\n\t\t} \n#endif\n\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Elif2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if false\n\t\t{\n#elif true\n\t}\n#endif\n\t$\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Else()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if false\n\t\t{\n#else\n\t}\n#endif\n\t$\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Else2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#if true\n\t\t{\n#else\n\t\t} \n#endif\n\t\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t#region Single-line directives\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Region()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n\t\t#region Foo $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Endegion()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n\t\t#region\n\t\tvoid Test() { }\n\t\t#endregion $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Pragma()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#pragma Foo 42 $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Warning()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#warning Foo $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Error()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#error Foo $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Line()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#line 42 $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Define()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#define Foo 42 $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_Undef()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n#undef Foo $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t#endregion\n\n\t\t[Test]\n\t\tpublic void TestBrackets_PreProcessor_If_DefineDirective()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\n#define NOTTHERE\nnamespace Foo {\n\tclass Foo {\n#if NOTTHERE\n\t\t{\n#endif\n\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBrackets_PreProcessor_If_UndefDirective()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\n#define NOTTHERE\nnamespace Foo {\n\tclass Foo {\n#undef NOTTHERE\n#if NOTTHERE\n\t\t{\n#endif\n\t\t$\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPreProcessor_IndentPreprocessor()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.IndentPreprocessorDirectives = true;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo {\n\t\t#if true $ \", policy);\n\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStateAfterDoublePreprocessorIf()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = false;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\t#if true\n\t\t#if true\n\t\tif (true)\n\t\t\treturn;$\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestComplexIfElse()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = false;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\t#if false\n\t\t#elif true\n\t\t#if false\n\t\t#endif\n\t\tif (true)\n\t\t\treturn;$\n\t\t#endif\n\", policy);\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TestDefinedSymbol()\n\t\t{\n\t\t\tvar policy = FormattingOptionsFactory.CreateMono();\n\t\t\tpolicy.AlignToFirstMethodCallArgument = policy.AlignToFirstIndexerArgument = false;\n\n\t\t\tvar indent = Helper.CreateEngine(@\"\nclass Foo \n{\n\tvoid Test ()\n\t{ \n\t\t#if DEBUG\n\t\tif (true)\n\t\t\treturn;$\n\", policy, new [] { \"DEBUG\"});\n\t\t\tAssert.AreEqual(\"\\t\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/StringTests.cs",
    "content": "﻿//\n// StringTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class StringTests\n\t{\n\t\t[Test]\n\t\tpublic void TestString_Simple()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\"\"some string\"\"$\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestString_Escaped()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\"\"some escaped \\\"\" string \"\" { $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestString_NotEscaped()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\"\"some not escaped \"\" string \"\" { $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestString_NotEnded()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\t\"\"some string {\n#if true $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChar_Simple()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"'X'$\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChar_Escaped()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"'\\'' { $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChar_NotEscaped()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"''' { $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestChar_NotEnded()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\t' { \n#if true $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim_Simple()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"@\"\" verbatim string \"\" $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim_MultiLine()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo \n\t{\n\t\t@\"\" verbatim string $\");\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim_MultiLine2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\tclass Foo \n\t{\n\t\t@\"\" verbatim string \n{ $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim_Escaped()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"@\"\" some \"\"\"\"string { \"\"\"\" in a verbatim string \"\" $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim_NotEscaped()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"@\"\" some \"\"string { \"\" in a verbatim string \"\" $\");\n\t\t\tAssert.AreEqual(\"\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim_EscapedMultiLine()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\t@\"\" some verbatim string \"\"\"\" { $\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestVerbatim_EscapedMultiLine2()\n\t\t{\n\t\t\tvar indent = Helper.CreateEngine(@\"\nnamespace Foo {\n\t@\"\" some verbatim string \"\"\"\"\"\" { $\");\n\t\t\tAssert.AreEqual(\"\\t\", indent.ThisLineIndent);\n\t\t\tAssert.AreEqual(\"\\t\\t\", indent.NextLineIndent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestStringLiteralPasteStrategyUnicodeDecode()\n\t\t{\n\t\t\tvar s = ICSharpCode.NRefactory.CSharp.TextPasteUtils.StringLiteralPasteStrategy.Instance.Decode(@\"\\u0066\");\n\t\t\tAssert.AreEqual(\"\\u0066\", s);\n\n\t\t\ts = ICSharpCode.NRefactory.CSharp.TextPasteUtils.StringLiteralPasteStrategy.Instance.Decode(@\"\\U00000066\");\n\t\t\tAssert.AreEqual(\"\\U00000066\", s);\n\n\t\t\ts = ICSharpCode.NRefactory.CSharp.TextPasteUtils.StringLiteralPasteStrategy.Instance.Decode(@\"\\xAFFE\");\n\t\t\tAssert.AreEqual(\"\\xAFFE\", s);\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/CSharpParser.cs",
    "content": "// \n// CSharpParser.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@novell.com>\n// \n// Copyright (c) 2009 Novell, Inc (http://www.novell.com)\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.IO;\nusing ICSharpCode.NRefactory.Editor;\nusing Mono.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\tpublic class CSharpParser\n\t{\n\t\tCompilerSettings compilerSettings;\n\n\t\tclass ConversionVisitor : StructuralVisitor\n\t\t{\n\t\t\tSyntaxTree unit = new SyntaxTree();\n\t\t\tinternal bool convertTypeSystemMode;\n\n\t\t\tpublic SyntaxTree Unit {\n\t\t\t\tget {\n\t\t\t\t\treturn unit;\n\t\t\t\t}\n\t\t\t\tset {\n\t\t\t\t\tunit = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic LocationsBag LocationsBag {\n\t\t\t\tget;\n\t\t\t\tprivate set;\n\t\t\t}\n\n\t\t\tpublic ConversionVisitor(bool convertTypeSystemMode, LocationsBag locationsBag)\n\t\t\t{\n\t\t\t\tthis.convertTypeSystemMode = convertTypeSystemMode;\n\t\t\t\tthis.LocationsBag = locationsBag;\n\t\t\t}\n\n\t\t\tpublic static TextLocation Convert(Location loc)\n\t\t\t{\n\t\t\t\treturn new TextLocation(loc.Row, loc.Column);\n\t\t\t}\n\n\t\t\tpublic override void Visit(ModuleContainer mc)\n\t\t\t{\n\t\t\t\tbool first = true;\n\t\t\t\tforeach (var container in mc.Containers) {\n\t\t\t\t\tvar nspace = container as NamespaceContainer;\n\t\t\t\t\tif (nspace == null) {\n\t\t\t\t\t\tcontainer.Accept(this);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tNamespaceDeclaration nDecl = null;\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(nspace);\n\t\t\t\t\t\n\t\t\t\t\tif (nspace.NS != null && !string.IsNullOrEmpty(nspace.NS.Name)) {\n\t\t\t\t\t\tnDecl = new NamespaceDeclaration();\n\t\t\t\t\t\tif (loc != null) {\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.NamespaceKeyword), Roles.NamespaceKeyword);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnDecl.AddChild(ConvertNamespaceName(nspace.RealMemberName), NamespaceDeclaration.NamespaceNameRole);\n\t\t\t\t\t\tif (loc != null && loc.Count > 1) {\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tAddToNamespace(nDecl);\n\t\t\t\t\t\tnamespaceStack.Push(nDecl);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (nspace.Usings != null) {\n\t\t\t\t\t\tforeach (var us in nspace.Usings) {\n\t\t\t\t\t\t\tus.Accept(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (first) {\n\t\t\t\t\t\tfirst = false;\n\t\t\t\t\t\tif (mc.OptAttributes != null) {\n\t\t\t\t\t\t\tforeach (var attr in mc.OptAttributes.Sections) {\n\t\t\t\t\t\t\t\tvar section = ConvertAttributeSection(attr);\n\t\t\t\t\t\t\t\tif (section !=\tnull)\n\t\t\t\t\t\t\t\t\tunit.AddChild(section, SyntaxTree.MemberRole);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (nspace.Containers != null) {\n\t\t\t\t\t\tforeach (var subContainer in nspace.Containers) {\n\t\t\t\t\t\t\tsubContainer.Accept(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nDecl != null) {\n\t\t\t\t\t\tAddAttributeSection(nDecl, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\t\t\tif (loc != null && loc.Count > 2)\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [2]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t\tif (loc != null && loc.Count > 3)\n\t\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnamespaceStack.Pop();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAddAttributeSection(unit, nspace.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tAddAttributeSection(unit, mc.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t}\n\n\t\t\t#region Global\n\n\t\t\treadonly Stack<NamespaceDeclaration> namespaceStack = new Stack<NamespaceDeclaration>();\n\n\t\t\tvoid AddTypeArguments(ATypeNameExpression texpr, AstType result)\n\t\t\t{\n\t\t\t\tif (texpr.TypeArguments == null || texpr.TypeArguments.Args == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar loc = LocationsBag.GetLocations(texpr.TypeArguments);\n\t\t\t\tif (loc != null && loc.Count >= 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [loc.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (var arg in texpr.TypeArguments.Args) {\n\t\t\t\t\tresult.AddChild(ConvertToType(arg), Roles.TypeArgument);\n\t\t\t\t\tif (loc != null && i < loc.Count - 2)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [i++]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\tif (loc != null && loc.Count >= 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [loc.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tstatic AstType ConvertToType(TypeParameter spec)\n\t\t\t{\n\t\t\t\tAstType result;\n\t\t\t\tresult = new SimpleType { IdentifierToken = Identifier.Create(spec.Name, Convert(spec.Location)) };\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tAstType ConvertToType(MemberName memberName)\n\t\t\t{\n\t\t\t\tAstType result;\n\t\t\t\tif (memberName.Left != null) {\n\t\t\t\t\tresult = new MemberType();\n\t\t\t\t\tresult.AddChild(ConvertToType(memberName.Left), MemberType.TargetRole);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(memberName);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\t\t\t\t\tresult.AddChild(Identifier.Create(memberName.Name, Convert(memberName.Location)), Roles.Identifier);\n\t\t\t\t} else {\n\t\t\t\t\tresult = new SimpleType { IdentifierToken = Identifier.Create(memberName.Name, Convert(memberName.Location)) };\n\t\t\t\t}\n\t\t\t\tif (memberName.TypeParameters != null) {\n\t\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeParameters);\n\t\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\t\tfor (int i = 0; i < memberName.TypeParameters.Count; i++) {\n\t\t\t\t\t\tvar param = memberName.TypeParameters [i];\n\t\t\t\t\t\tresult.AddChild(new SimpleType(Identifier.Create(param.Name, Convert(param.Location))), Roles.TypeArgument);\n\t\t\t\t\t\tif (chevronLocs != null && i < chevronLocs.Count - 2)\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(chevronLocs [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tAstType ConvertToType(Mono.CSharp.Expression typeName)\n\t\t\t{\n\t\t\t\tif (typeName == null) // may happen in typeof(Generic<,,,,>)\n\t\t\t\t\treturn new SimpleType();\n\t\t\t\t\n\t\t\t\tvar typeExpr = typeName as TypeExpression;\n\t\t\t\tif (typeExpr != null) {\n\t\t\t\t\treturn new PrimitiveType(typeExpr.GetSignatureForError(), Convert(typeExpr.Location));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar qam = typeName as QualifiedAliasMember;\n\t\t\t\tif (qam != null) {\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(typeName);\n\t\t\t\t\tvar memberType = new MemberType();\n\t\t\t\t\tmemberType.Target = new SimpleType(qam.alias, Convert(qam.Location));\n\t\t\t\t\tmemberType.IsDoubleColon = true;\n\n\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\tmemberType.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.DoubleColon), Roles.DoubleColon);\n\n\t\t\t\t\tmemberType.MemberNameToken = Identifier.Create(qam.Name, loc != null ? Convert(loc [1]) : TextLocation.Empty);\n\t\t\t\t\treturn memberType;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar ma = typeName as MemberAccess;\n\t\t\t\tif (ma != null) {\n\t\t\t\t\tvar memberType = new MemberType();\n\t\t\t\t\tmemberType.AddChild(ConvertToType(ma.LeftExpression), MemberType.TargetRole);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(ma);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tmemberType.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\n\t\t\t\t\tmemberType.MemberNameToken = Identifier.Create(ma.Name, Convert(ma.Location));\n\t\t\t\t\t\n\t\t\t\t\tAddTypeArguments(ma, memberType);\n\t\t\t\t\treturn memberType;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar sn = typeName as SimpleName;\n\t\t\t\tif (sn != null) {\n\t\t\t\t\tvar result = new SimpleType(sn.Name, Convert(sn.Location));\n\t\t\t\t\tAddTypeArguments(sn, result);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar cc = typeName as ComposedCast;\n\t\t\t\tif (cc != null) {\n\t\t\t\t\tvar baseType = ConvertToType(cc.Left);\n\t\t\t\t\tvar result = new ComposedType { BaseType = baseType };\n\t\t\t\t\tvar ccSpec = cc.Spec;\n\t\t\t\t\twhile (ccSpec != null) {\n\t\t\t\t\t\tif (ccSpec.IsNullable) {\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ccSpec.Location), ComposedType.NullableRole), ComposedType.NullableRole);\n\t\t\t\t\t\t} else if (ccSpec.IsPointer) {\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ccSpec.Location), ComposedType.PointerRole), ComposedType.PointerRole);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar location = LocationsBag.GetLocations(ccSpec);\n\t\t\t\t\t\t\tvar spec = new ArraySpecifier { Dimensions = ccSpec.Dimension };\n\t\t\t\t\t\t\tspec.AddChild(new CSharpTokenNode(Convert(ccSpec.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tspec.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tresult.ArraySpecifiers.Add(spec);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tccSpec = ccSpec.Next;\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar sce = typeName as SpecialContraintExpr;\n\t\t\t\tif (sce != null) {\n\t\t\t\t\tswitch (sce.Constraint) {\n\t\t\t\t\t\tcase SpecialConstraint.Class:\n\t\t\t\t\t\t\treturn new PrimitiveType(\"class\", Convert(sce.Location));\n\t\t\t\t\t\tcase SpecialConstraint.Struct:\n\t\t\t\t\t\t\treturn new PrimitiveType(\"struct\", Convert(sce.Location));\n\t\t\t\t\t\tcase SpecialConstraint.Constructor:\n\t\t\t\t\t\t\treturn new PrimitiveType(\"new\", Convert(sce.Location));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn new SimpleType(\"unknown\");\n\t\t\t}\n\n\t\t\tIEnumerable<Attribute> GetAttributes(IEnumerable<Mono.CSharp.Attribute> optAttributes)\n\t\t\t{\n\t\t\t\tif (optAttributes == null)\n\t\t\t\t\tyield break;\n\t\t\t\tforeach (var attr in optAttributes) {\n\t\t\t\t\tvar result = new Attribute();\n\t\t\t\t\tresult.Type = ConvertToType(attr.TypeNameExpression);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(attr);\n\t\t\t\t\tresult.HasArgumentList = loc != null;\n\t\t\t\t\tint pos = 0;\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\n\t\t\t\t\tif (attr.PositionalArguments != null) {\n\t\t\t\t\t\tforeach (var arg in attr.PositionalArguments) {\n\t\t\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tvar na = arg as NamedArgument;\n\t\t\t\t\t\t\tif (na != null) {\n\t\t\t\t\t\t\t\tvar newArg = new NamedArgumentExpression();\n\t\t\t\t\t\t\t\tnewArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar argLoc = LocationsBag.GetLocations(na);\n\t\t\t\t\t\t\t\tif (argLoc != null)\n\t\t\t\t\t\t\t\t\tnewArg.AddChild(new CSharpTokenNode(Convert(argLoc [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\t\t\tif (na.Expr != null)\n\t\t\t\t\t\t\t\t\tnewArg.AddChild((Expression)na.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t\tresult.AddChild(newArg, Roles.Argument);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (arg.Expr != null)\n\t\t\t\t\t\t\t\t\tresult.AddChild((Expression)arg.Expr.Accept(this), Roles.Argument);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (loc != null && pos + 1 < loc.Count)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (attr.NamedArguments != null) {\n\t\t\t\t\t\tforeach (var arg in attr.NamedArguments) {\n\t\t\t\t\t\t\tvar na = (NamedArgument)arg;\n\t\t\t\t\t\t\tvar newArg = new NamedExpression();\n\t\t\t\t\t\t\tnewArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar argLoc = LocationsBag.GetLocations(na);\n\t\t\t\t\t\t\tif (argLoc != null)\n\t\t\t\t\t\t\t\tnewArg.AddChild(new CSharpTokenNode(Convert(argLoc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tif (na.Expr != null)\n\t\t\t\t\t\t\t\tnewArg.AddChild((Expression)na.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\tresult.AddChild(newArg, Roles.Argument);\n\t\t\t\t\t\t\tif (loc != null && pos + 1 < loc.Count)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (loc != null && pos < loc.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\n\t\t\t\t\tyield return result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAttributeSection ConvertAttributeSection(IEnumerable<Mono.CSharp.Attribute> optAttributes)\n\t\t\t{\n\t\t\t\tif (optAttributes == null)\n\t\t\t\t\treturn null;\n\t\t\t\tvar result = new AttributeSection();\n\t\t\t\tvar loc = LocationsBag.GetLocations(optAttributes);\n\t\t\t\tint pos = 0;\n\t\t\t\tif (loc != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.LBracket), Roles.LBracket);\n\t\t\t\tvar first = optAttributes.FirstOrDefault();\n\t\t\t\tstring target = first != null ? first.ExplicitTarget : null;\n\t\t\t\t\n\t\t\t\tif (!string.IsNullOrEmpty(target)) {\n\t\t\t\t\tif (loc != null && pos < loc.Count - 1) {\n\t\t\t\t\t\tresult.AddChild(Identifier.Create(target, Convert(loc [pos++])), Roles.Identifier);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.AddChild(Identifier.Create(target), Roles.Identifier);\n\t\t\t\t\t}\n\t\t\t\t\tif (loc != null && pos < loc.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Colon), Roles.Colon);\n\t\t\t\t}\n\n\t\t\t\tint attributeCount = 0;\n\t\t\t\tforeach (var attr in GetAttributes (optAttributes)) {\n\t\t\t\t\tresult.AddChild(attr, Roles.Attribute);\n\t\t\t\t\tif (loc != null && pos + 1 < loc.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\n\t\t\t\t\tattributeCount++;\n\t\t\t\t}\n\t\t\t\tif (attributeCount == 0)\n\t\t\t\t\treturn null;\n\t\t\t\t// Left and right bracket + commas between the attributes\n\t\t\t\tint locCount = 2 + attributeCount - 1;\n\t\t\t\t// optional comma\n\t\t\t\tif (loc != null && pos < loc.Count - 1 && loc.Count == locCount + 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.Comma), Roles.Comma);\n\t\t\t\tif (loc != null && pos < loc.Count)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [pos++]), Roles.RBracket), Roles.RBracket);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override void Visit(NamespaceContainer ns)\n\t\t\t{\n\t\t\t\tNamespaceDeclaration nDecl = null;\n\t\t\t\tvar loc = LocationsBag.GetLocations(ns);\n\t\t\t\t\n\t\t\t\tif (ns.NS != null && !string.IsNullOrEmpty(ns.NS.Name)) {\n\t\t\t\t\tnDecl = new NamespaceDeclaration();\n\t\t\t\t\tif (loc != null) {\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.NamespaceKeyword), Roles.NamespaceKeyword);\n\t\t\t\t\t}\n\t\t\t\t\tnDecl.AddChild(ConvertNamespaceName(ns.RealMemberName), NamespaceDeclaration.NamespaceNameRole);\n\t\t\t\t\tif (loc != null && loc.Count > 1) {\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\t}\n\n\t\t\t\t\tAddToNamespace(nDecl);\n\t\t\t\t\tnamespaceStack.Push(nDecl);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ns.Usings != null) {\n\t\t\t\t\tforeach (var us in ns.Usings) {\n\t\t\t\t\t\tus.Accept(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ns.Containers != null) {\n\t\t\t\t\tforeach (var container in ns.Containers) {\n\t\t\t\t\t\tcontainer.Accept(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (nDecl != null) {\n\t\t\t\t\tAddAttributeSection(nDecl, ns.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\t\tif (loc != null && loc.Count > 2)\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [2]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (loc != null && loc.Count > 3)\n\t\t\t\t\t\tnDecl.AddChild(new CSharpTokenNode(Convert(loc [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t\n\t\t\t\t\tnamespaceStack.Pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//\t\t\tpublic override void Visit (UsingsBag.Namespace nspace)\n\t\t\t//\t\t\t{\n\t\t\t//\n\t\t\t//\n\t\t\t//\t\t\t\tVisitNamespaceUsings (nspace);\n\t\t\t//\t\t\t\tVisitNamespaceBody (nspace);\n\t\t\t//\n\t\t\t//\t\t\t}\n\t\t\t//\n\t\t\tAstType ConvertNamespaceName(MemberName memberName)\n\t\t\t{\n\t\t\t\t// HACK for a parser 'bug' - sometimes it generates \"<invalid>\" identifiers in namespace names (on certain bugs in the input file)\n\t\t\t\tif (memberName.Name == \"<invalid>\")\n\t\t\t\t\treturn AstType.Null;\n\t\t\t\treturn ConvertToType(memberName);\n\t\t\t}\n\n\t\t\tpublic override void Visit(UsingNamespace un)\n\t\t\t{\n\t\t\t\tvar ud = new UsingDeclaration();\n\t\t\t\tvar loc = LocationsBag.GetLocations(un);\n\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(un.Location), UsingDeclaration.UsingKeywordRole), UsingDeclaration.UsingKeywordRole);\n\t\t\t\tif (un.NamespaceExpression != null)\n\t\t\t\t\tud.AddChild(ConvertToType(un.NamespaceExpression), UsingDeclaration.ImportRole);\n\t\t\t\tif (loc != null)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tAddToNamespace(ud);\n\t\t\t}\n\n\t\t\tpublic override void Visit(UsingAliasNamespace uan)\n\t\t\t{\n\t\t\t\tvar ud = new UsingAliasDeclaration();\n\t\t\t\tvar loc = LocationsBag.GetLocations(uan);\n\t\t\t\t\n\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(uan.Location), UsingAliasDeclaration.UsingKeywordRole), UsingAliasDeclaration.UsingKeywordRole);\n\t\t\t\tud.AddChild(Identifier.Create(uan.Alias.Value, Convert(uan.Alias.Location)), UsingAliasDeclaration.AliasRole);\n\t\t\t\tif (loc != null)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\tif (uan.NamespaceExpression != null)\n\t\t\t\t\tud.AddChild(ConvertToType(uan.NamespaceExpression), UsingAliasDeclaration.ImportRole);\n\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tAddToNamespace(ud);\n\t\t\t}\n\n\t\t\tpublic override void Visit(UsingExternAlias uea)\n\t\t\t{\n\t\t\t\tvar ud = new ExternAliasDeclaration();\n\t\t\t\tvar loc = LocationsBag.GetLocations(uea);\n\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(uea.Location), Roles.ExternKeyword), Roles.ExternKeyword);\n\t\t\t\tif (loc != null)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.AliasKeyword), Roles.AliasKeyword);\n\t\t\t\tud.AddChild(Identifier.Create(uea.Alias.Value, Convert(uea.Alias.Location)), Roles.Identifier);\n\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\tud.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tAddToNamespace(ud);\n\t\t\t}\n\n\t\t\tAstType ConvertImport(MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName.Left != null) {\n\t\t\t\t\t// left.name\n\t\t\t\t\tvar t = new MemberType();\n//\t\t\t\t\tt.IsDoubleColon = memberName.IsDoubleColon;\n\t\t\t\t\tt.AddChild(ConvertImport(memberName.Left), MemberType.TargetRole);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(memberName);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tt.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\t\t\t\t\t\n\t\t\t\t\tt.AddChild(Identifier.Create(memberName.Name, Convert(memberName.Location)), Roles.Identifier);\n\t\t\t\t\tAddTypeArguments(t, memberName);\n\t\t\t\t\treturn t;\n\t\t\t\t} else {\n\t\t\t\t\tvar t = new SimpleType();\n\t\t\t\t\tt.AddChild(Identifier.Create(memberName.Name, Convert(memberName.Location)), Roles.Identifier);\n\t\t\t\t\tAddTypeArguments(t, memberName);\n\t\t\t\t\treturn t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Visit(MemberCore member)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Unknown member:\");\n\t\t\t\tConsole.WriteLine(member.GetType() + \"-> Member {0}\", member.GetSignatureForError());\n\t\t\t}\n\n\t\t\treadonly Stack<TypeDeclaration> typeStack = new Stack<TypeDeclaration>();\n\n\t\t\tpublic override void Visit(Class c)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Class;\n\t\t\t\tAddAttributeSection(newType, c);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(c);\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.ClassKeyword), Roles.ClassKeyword);\n\t\t\t\t\n\t\t\t\tnewType.AddChild(Identifier.Create(c.MemberName.Name, Convert(c.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newType, c.MemberName);\n\t\t\t\t\n\t\t\t\tif (c.TypeBaseExpressions != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(c.TypeBaseExpressions);\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var baseTypes in c.TypeBaseExpressions) {\n\t\t\t\t\t\tnewType.AddChild(ConvertToType(baseTypes), Roles.BaseType);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAddConstraints(newType, c.CurrentTypeParameters);\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\tbase.Visit(c);\n\t\t\t\tAddAttributeSection(newType, c.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\n\t\t\t\tif (location != null && curLoc < location.Count) {\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Struct s)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Struct;\n\t\t\t\tAddAttributeSection(newType, s);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(s);\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.StructKeyword), Roles.StructKeyword);\n\t\t\t\tnewType.AddChild(Identifier.Create(s.MemberName.Name, Convert(s.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newType, s.MemberName);\n\t\t\t\t\n\t\t\t\tif (s.TypeBaseExpressions != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(s.TypeBaseExpressions);\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tforeach (var baseTypes in s.TypeBaseExpressions) {\n\t\t\t\t\t\tnewType.AddChild(ConvertToType(baseTypes), Roles.BaseType);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAddConstraints(newType, s.CurrentTypeParameters);\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\tbase.Visit(s);\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Interface i)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Interface;\n\t\t\t\tAddAttributeSection(newType, i);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(i);\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.InterfaceKeyword), Roles.InterfaceKeyword);\n\t\t\t\tnewType.AddChild(Identifier.Create(i.MemberName.Name, Convert(i.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newType, i.MemberName);\n\t\t\t\t\n\t\t\t\tif (i.TypeBaseExpressions != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(i.TypeBaseExpressions);\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tforeach (var baseTypes in i.TypeBaseExpressions) {\n\t\t\t\t\t\tnewType.AddChild(ConvertToType(baseTypes), Roles.BaseType);\n\t\t\t\t\t\tif (commaLocations != null && j < commaLocations.Count) {\n\t\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(commaLocations [j]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAddConstraints(newType, i.CurrentTypeParameters);\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\tbase.Visit(i);\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Mono.CSharp.Delegate d)\n\t\t\t{\n\t\t\t\tvar newDelegate = new DelegateDeclaration();\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(d);\n\t\t\t\tAddAttributeSection(newDelegate, d);\n\t\t\t\tAddModifiers(newDelegate, location);\n\t\t\t\tif (location != null && location.Count > 0) {\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.DelegateKeyword), Roles.DelegateKeyword);\n\t\t\t\t}\n\t\t\t\tif (d.ReturnType != null)\n\t\t\t\t\tnewDelegate.AddChild(ConvertToType(d.ReturnType), Roles.Type);\n\t\t\t\tnewDelegate.AddChild(Identifier.Create(d.MemberName.Name, Convert(d.MemberName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeParameters(newDelegate, d.MemberName);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddParameter(newDelegate, d.Parameters);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t}\n\t\t\t\tAddConstraints(newDelegate, d.CurrentTypeParameters);\n\t\t\t\tif (location != null && location.Count > 3) {\n\t\t\t\t\tnewDelegate.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\tAddType(newDelegate);\n\t\t\t}\n\n\t\t\tvoid AddType(EntityDeclaration child)\n\t\t\t{\n\t\t\t\tif (typeStack.Count > 0) {\n\t\t\t\t\ttypeStack.Peek().AddChild(child, Roles.TypeMemberRole);\n\t\t\t\t} else {\n\t\t\t\t\tAddToNamespace(child);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddToNamespace(AstNode child)\n\t\t\t{\n\t\t\t\tif (namespaceStack.Count > 0) {\n\t\t\t\t\tnamespaceStack.Peek().AddChild(child, NamespaceDeclaration.MemberRole);\n\t\t\t\t} else {\n\t\t\t\t\tunit.AddChild(child, SyntaxTree.MemberRole);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Visit(Mono.CSharp.Enum e)\n\t\t\t{\n\t\t\t\tvar newType = new TypeDeclaration();\n\t\t\t\tnewType.ClassType = ClassType.Enum;\n\t\t\t\tAddAttributeSection(newType, e);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(e);\n\t\t\t\t\n\t\t\t\tAddModifiers(newType, location);\n\t\t\t\tint curLoc = 0;\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.EnumKeyword), Roles.EnumKeyword);\n\t\t\t\tnewType.AddChild(Identifier.Create(e.MemberName.Name, Convert(e.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (e.BaseTypeExpression != null) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tnewType.AddChild(ConvertToType(e.BaseTypeExpression), Roles.BaseType);\n\t\t\t\t}\n\n\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.LBrace), Roles.LBrace);\n\t\t\t\ttypeStack.Push(newType);\n\t\t\t\t\n\t\t\t\tforeach (var m in e.Members) {\n\t\t\t\t\tvar member = m as EnumMember;\n\t\t\t\t\tif (member == null) {\n\t\t\t\t\t\tConsole.WriteLine(\"WARNING - ENUM MEMBER: \" + m);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tVisit(member);\n\t\t\t\t\tif (location != null && curLoc < location.Count - 1) //last one is closing brace\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\tif (location != null && curLoc < location.Count)\n\t\t\t\t\t\tnewType.AddChild(new CSharpTokenNode(Convert(location [curLoc++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewType.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\n\t\t\t\tAddAttributeSection(newType, e.UnattachedAttributes, EntityDeclaration.UnattachedAttributeRole);\n\t\t\t\ttypeStack.Pop();\n\t\t\t\tAddType(newType);\n\t\t\t}\n\n\t\t\tpublic override void Visit(EnumMember em)\n\t\t\t{\n\t\t\t\tvar newField = new EnumMemberDeclaration();\n\t\t\t\tAddAttributeSection(newField, em);\n\t\t\t\tnewField.AddChild(Identifier.Create(em.Name, Convert(em.Location)), Roles.Identifier);\n\t\t\t\tif (em.Initializer != null) {\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(em.Initializer.Location), Roles.Assign), Roles.Assign);\n\t\t\t\t\tnewField.AddChild((Expression)em.Initializer.Accept(this), EnumMemberDeclaration.InitializerRole);\n\t\t\t\t}\n\t\t\t\t//Console.WriteLine (newField.StartLocation +\"-\" + newField.EndLocation);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Type members\n\n\t\t\tpublic override void Visit(FixedField f)\n\t\t\t{\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(f);\n\t\t\t\tint locationIdx = 0;\n\t\t\t\t\n\t\t\t\tvar newField = new FixedFieldDeclaration();\n\t\t\t\tAddAttributeSection(newField, f);\n\t\t\t\tAddModifiers(newField, location);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), FixedFieldDeclaration.FixedKeywordRole), FixedFieldDeclaration.FixedKeywordRole);\n\n\t\t\t\tif (f.TypeExpression != null)\n\t\t\t\t\tnewField.AddChild(ConvertToType(f.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new FixedVariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(f.MemberName.Name, Convert(f.MemberName.Location)), Roles.Identifier);\n\t\t\t\tif (f.Initializer != null && !f.Initializer.IsNull) {\n\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(f.Initializer.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\n\t\t\t\t\tvariable.AddChild((Expression)f.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\tvar bracketLocations = LocationsBag.GetLocations(f.Initializer);\n\t\t\t\t\tif (bracketLocations != null)\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t}\n\t\t\t\tnewField.AddChild(variable, FixedFieldDeclaration.VariableRole);\n\t\t\t\t\n\t\t\t\tif (f.Declarators != null) {\n\t\t\t\t\tforeach (var decl in f.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new FixedVariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(decl.Initializer.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\tvar bracketLocations = LocationsBag.GetLocations(decl.Initializer);\n\t\t\t\t\t\tif (bracketLocations != null)\n\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);\n\n\t\t\t\t\t\tnewField.AddChild(variable, FixedFieldDeclaration.VariableRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > locationIdx)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [locationIdx]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\t\t\t\t\n\t\t\t}\n\n\t\t\tpublic override void Visit(Field f)\n\t\t\t{\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(f);\n\t\t\t\t\n\t\t\t\tvar newField = new FieldDeclaration();\n\t\t\t\tAddAttributeSection(newField, f);\n\t\t\t\tAddModifiers(newField, location);\n\t\t\t\tnewField.AddChild(ConvertToType(f.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new VariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(f.MemberName.Name, Convert(f.MemberName.Location)), Roles.Identifier);\n\t\t\t\tint locationIdx = 0;\n\t\t\t\tif (f.Initializer != null) {\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvariable.AddChild((Expression)f.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\tif (f.Declarators != null) {\n\t\t\t\t\tforeach (var decl in f.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new VariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(declLoc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > locationIdx)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), Roles.Semicolon), Roles.Semicolon);\n\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Const c)\n\t\t\t{\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(c);\n\t\t\t\t\n\t\t\t\tvar newField = new FieldDeclaration();\n\t\t\t\tAddAttributeSection(newField, c);\n\t\t\t\tAddModifiers(newField, location);\n\t\t\t\tif (location != null)\n\t\t\t\t\tnewField.AddChild(new CSharpModifierToken(Convert(location [0]), Modifiers.Const), EntityDeclaration.ModifierRole);\n\t\t\t\tnewField.AddChild(ConvertToType(c.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new VariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(c.MemberName.Name, Convert(c.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (c.Initializer != null) {\n\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(c.Initializer.Location), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvariable.AddChild((Expression)c.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\tif (c.Declarators != null) {\n\t\t\t\t\tforeach (var decl in c.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new VariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(decl.Initializer.Location), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewField.AddChild(variable, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null)\n\t\t\t\t\tnewField.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newField, Roles.TypeMemberRole);\n\n\t\t\t\t\n\t\t\t}\n\n\t\t\tpublic override void Visit(Operator o)\n\t\t\t{\n\t\t\t\tvar newOperator = new OperatorDeclaration();\n\t\t\t\tnewOperator.OperatorType = (OperatorType)o.OperatorType;\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(o);\n\t\t\t\tAddAttributeSection(newOperator, o);\n\t\t\t\tAddModifiers(newOperator, location);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (o.OperatorType == Operator.OpType.Implicit) {\n\t\t\t\t\tif (location != null && location.Count > 0) {\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [0]), OperatorDeclaration.ImplicitRole), OperatorDeclaration.ImplicitRole);\n\t\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [1]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole);\n\t\t\t\t\t}\n\t\t\t\t\tnewOperator.AddChild(ConvertToType(o.TypeExpression), Roles.Type);\n\t\t\t\t} else if (o.OperatorType == Operator.OpType.Explicit) {\n\t\t\t\t\tif (location != null && location.Count > 0) {\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [0]), OperatorDeclaration.ExplicitRole), OperatorDeclaration.ExplicitRole);\n\t\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [1]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole);\n\t\t\t\t\t}\n\t\t\t\t\tnewOperator.AddChild(ConvertToType(o.TypeExpression), Roles.Type);\n\t\t\t\t} else {\n\t\t\t\t\tnewOperator.AddChild(ConvertToType(o.TypeExpression), Roles.Type);\n\n\t\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [0]), OperatorDeclaration.OperatorKeywordRole), OperatorDeclaration.OperatorKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (location != null && location.Count > 1) {\n\t\t\t\t\t\tvar r = OperatorDeclaration.GetRole(newOperator.OperatorType);\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [1]), r), r);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddParameter(newOperator, o.ParameterInfo);\n\t\t\t\tif (location != null && location.Count > 3)\n\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (o.Block != null) {\n\t\t\t\t\tnewOperator.AddChild((BlockStatement)o.Block.Accept(this), Roles.Body);\n\t\t\t\t} else {\n\t\t\t\t\tif (location != null && location.Count >= 5)\n\t\t\t\t\t\tnewOperator.AddChild(new CSharpTokenNode(Convert(location [4]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\ttypeStack.Peek().AddChild(newOperator, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic void AddAttributeSection(AstNode parent, Attributable a)\n\t\t\t{\n\t\t\t\tif (a == null || a.OptAttributes == null)\n\t\t\t\t\treturn;\n\t\t\t\tAddAttributeSection(parent, a.OptAttributes);\n\t\t\t}\n\n\t\t\tpublic void AddAttributeSection(AstNode parent, Attributes attrs, Role<AttributeSection> role)\n\t\t\t{\n\t\t\t\tif (attrs == null)\n\t\t\t\t\treturn;\n\t\t\t\tforeach (var attr in attrs.Sections) {\n\t\t\t\t\tvar section = ConvertAttributeSection(attr);\n\t\t\t\t\tif (section == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tparent.AddChild(section, role);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void AddAttributeSection(AstNode parent, Attributes attrs)\n\t\t\t{\n\t\t\t\tAddAttributeSection(parent, attrs, EntityDeclaration.AttributeRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Indexer i)\n\t\t\t{\n\t\t\t\tvar newIndexer = new IndexerDeclaration();\n\t\t\t\tAddAttributeSection(newIndexer, i);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(i);\n\t\t\t\tAddModifiers(newIndexer, location);\n\t\t\t\tnewIndexer.AddChild(ConvertToType(i.TypeExpression), Roles.Type);\n\t\t\t\tAddExplicitInterface(newIndexer, i.MemberName);\n\t\t\t\tvar name = i.MemberName;\n\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(name.Location), IndexerDeclaration.ThisKeywordRole), IndexerDeclaration.ThisKeywordRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBracket), Roles.LBracket);\n\t\t\t\tAddParameter(newIndexer, i.ParameterInfo);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.LBrace), Roles.LBrace);\n\t\t\t\tif (i.Get != null) {\n\t\t\t\t\tvar getAccessor = new Accessor();\n\t\t\t\t\tvar getLocation = LocationsBag.GetMemberLocation(i.Get);\n\t\t\t\t\tAddAttributeSection(getAccessor, i.Get);\n\t\t\t\t\tAddModifiers(getAccessor, getLocation);\n\t\t\t\t\tif (getLocation != null)\n\t\t\t\t\t\tgetAccessor.AddChild(new CSharpTokenNode(Convert(i.Get.Location), PropertyDeclaration.GetKeywordRole), PropertyDeclaration.GetKeywordRole);\n\t\t\t\t\tif (i.Get.Block != null) {\n\t\t\t\t\t\tgetAccessor.AddChild((BlockStatement)i.Get.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (getLocation != null && getLocation.Count > 0)\n\t\t\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(getLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t\tnewIndexer.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (i.Set != null) {\n\t\t\t\t\tvar setAccessor = new Accessor();\n\t\t\t\t\tvar setLocation = LocationsBag.GetMemberLocation(i.Set);\n\t\t\t\t\tAddAttributeSection(setAccessor, i.Set);\n\t\t\t\t\tAddModifiers(setAccessor, setLocation);\n\t\t\t\t\tif (setLocation != null)\n\t\t\t\t\t\tsetAccessor.AddChild(new CSharpTokenNode(Convert(i.Set.Location), PropertyDeclaration.SetKeywordRole), PropertyDeclaration.SetKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (i.Set.Block != null) {\n\t\t\t\t\t\tsetAccessor.AddChild((BlockStatement)i.Set.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (setLocation != null && setLocation.Count > 0)\n\t\t\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(setLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t\tnewIndexer.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null) {\n\t\t\t\t\tif (location.Count > 3)\n\t\t\t\t\t\tnewIndexer.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewIndexer.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\ttypeStack.Peek().AddChild(newIndexer, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Method m)\n\t\t\t{\n\t\t\t\tvar newMethod = new MethodDeclaration();\n\t\t\t\tAddAttributeSection(newMethod, m);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(m);\n\t\t\t\tAddModifiers(newMethod, location);\n\t\t\t\tnewMethod.AddChild(ConvertToType(m.TypeExpression), Roles.Type);\n\t\t\t\tAddExplicitInterface(newMethod, m.MethodName);\n\t\t\t\tnewMethod.AddChild(Identifier.Create(m.MethodName.Name, Convert(m.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tAddTypeParameters(newMethod, m.MemberName);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewMethod.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddParameter(newMethod, m.ParameterInfo);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewMethod.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tAddConstraints(newMethod, m.CurrentTypeParameters);\n\t\t\t\t\n\t\t\t\tif (m.Block != null) {\n\t\t\t\t\tvar bodyBlock = (BlockStatement)m.Block.Accept(this);\n//\t\t\t\t\tif (m.Block is ToplevelBlock) {\n//\t\t\t\t\t\tnewMethod.AddChild (bodyBlock.FirstChild.NextSibling, Roles.Body);\n//\t\t\t\t\t} else {\n\t\t\t\t\tnewMethod.AddChild(bodyBlock, Roles.Body);\n//\t\t\t\t\t}\n\t\t\t\t} else if (location != null) {\n\t\t\t\t\tif (location.Count < 3) {\n\t\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\t\tnewMethod.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewMethod.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttypeStack.Peek().AddChild(newMethod, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tstatic readonly Dictionary<Mono.CSharp.Modifiers, Modifiers> modifierTable = new Dictionary<Mono.CSharp.Modifiers, Modifiers>();\n\t\t\tstatic readonly string[] keywordTable;\n\n\t\t\tstatic ConversionVisitor()\n\t\t\t{\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.NEW] = Modifiers.New;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PUBLIC] = Modifiers.Public;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PROTECTED] = Modifiers.Protected;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PRIVATE] = Modifiers.Private;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.INTERNAL] = Modifiers.Internal;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.ABSTRACT] = Modifiers.Abstract;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.VIRTUAL] = Modifiers.Virtual;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.SEALED] = Modifiers.Sealed;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.STATIC] = Modifiers.Static;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.OVERRIDE] = Modifiers.Override;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.READONLY] = Modifiers.Readonly;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.PARTIAL] = Modifiers.Partial;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.EXTERN] = Modifiers.Extern;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.VOLATILE] = Modifiers.Volatile;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.UNSAFE] = Modifiers.Unsafe;\n\t\t\t\tmodifierTable [Mono.CSharp.Modifiers.ASYNC] = Modifiers.Async;\n\t\t\t\t\n\t\t\t\tkeywordTable = new string[255];\n\t\t\t\tfor (int i = 0; i < keywordTable.Length; i++)\n\t\t\t\t\tkeywordTable [i] = \"unknown\";\n\t\t\t\t\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Other] = \"void\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.String] = \"string\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Int] = \"int\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Object] = \"object\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Float] = \"float\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Double] = \"double\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Long] = \"long\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Byte] = \"byte\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.UInt] = \"uint\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.ULong] = \"ulong\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Short] = \"short\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.UShort] = \"ushort\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.SByte] = \"sbyte\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Decimal] = \"decimal\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Char] = \"char\";\n\t\t\t\tkeywordTable [(int)BuiltinTypeSpec.Type.Bool] = \"bool\";\n\t\t\t}\n\n\t\t\tstatic void AddModifiers(EntityDeclaration parent, LocationsBag.MemberLocations location)\n\t\t\t{\n\t\t\t\tif (location == null || location.Modifiers == null)\n\t\t\t\t\treturn;\n\t\t\t\tforeach (var modifier in location.Modifiers) {\n\t\t\t\t\tModifiers mod;\n\t\t\t\t\tif (!modifierTable.TryGetValue(modifier.Item1, out mod)) {\n\t\t\t\t\t\tConsole.WriteLine(\"modifier \" + modifier.Item1 + \" can't be converted,\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tparent.AddChild(new CSharpModifierToken(Convert(modifier.Item2), mod), EntityDeclaration.ModifierRole);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Visit(Property p)\n\t\t\t{\n\t\t\t\tvar newProperty = new PropertyDeclaration();\n\t\t\t\tAddAttributeSection(newProperty, p);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(p);\n\t\t\t\tAddModifiers(newProperty, location);\n\t\t\t\tnewProperty.AddChild(ConvertToType(p.TypeExpression), Roles.Type);\n\t\t\t\tAddExplicitInterface(newProperty, p.MemberName);\n\t\t\t\tnewProperty.AddChild(Identifier.Create(p.MemberName.Name, Convert(p.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewProperty.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\n\t\t\t\tAccessor getAccessor = null;\n\t\t\t\tif (p.Get != null) {\n\t\t\t\t\tgetAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(getAccessor, p.Get);\n\t\t\t\t\tvar getLocation = LocationsBag.GetMemberLocation(p.Get);\n\t\t\t\t\tAddModifiers(getAccessor, getLocation);\n\t\t\t\t\tgetAccessor.AddChild(new CSharpTokenNode(Convert(p.Get.Location), PropertyDeclaration.GetKeywordRole), PropertyDeclaration.GetKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (p.Get.Block != null) {\n\t\t\t\t\t\tgetAccessor.AddChild((BlockStatement)p.Get.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (getLocation != null && getLocation.Count > 0)\n\t\t\t\t\t\t\tgetAccessor.AddChild(new CSharpTokenNode(Convert(getLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tAccessor setAccessor = null;\n\t\t\t\tif (p.Set != null) {\n\t\t\t\t\tsetAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(setAccessor, p.Set);\n\t\t\t\t\tvar setLocation = LocationsBag.GetMemberLocation(p.Set);\n\t\t\t\t\tAddModifiers(setAccessor, setLocation);\n\t\t\t\t\tsetAccessor.AddChild(new CSharpTokenNode(Convert(p.Set.Location), PropertyDeclaration.SetKeywordRole), PropertyDeclaration.SetKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (p.Set.Block != null) {\n\t\t\t\t\t\tsetAccessor.AddChild((BlockStatement)p.Set.Block.Accept(this), Roles.Body);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (setLocation != null && setLocation.Count > 0)\n\t\t\t\t\t\t\tsetAccessor.AddChild(new CSharpTokenNode(Convert(setLocation [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (getAccessor != null && setAccessor != null) {\n\t\t\t\t\tif (getAccessor.StartLocation < setAccessor.StartLocation) {\n\t\t\t\t\t\tnewProperty.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t\t\tnewProperty.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewProperty.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t\t\tnewProperty.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (getAccessor != null)\n\t\t\t\t\t\tnewProperty.AddChild(getAccessor, PropertyDeclaration.GetterRole);\n\t\t\t\t\tif (setAccessor != null)\n\t\t\t\t\t\tnewProperty.AddChild(setAccessor, PropertyDeclaration.SetterRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1) {\n\t\t\t\t\tnewProperty.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewProperty.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newProperty, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Constructor c)\n\t\t\t{\n\t\t\t\tvar newConstructor = new ConstructorDeclaration();\n\t\t\t\tAddAttributeSection(newConstructor, c);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(c);\n\t\t\t\tAddModifiers(newConstructor, location);\n\t\t\t\tnewConstructor.AddChild(Identifier.Create(c.MemberName.Name, Convert(c.MemberName.Location)), Roles.Identifier);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewConstructor.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tAddParameter(newConstructor, c.ParameterInfo);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tnewConstructor.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (c.Initializer != null) {\n\t\t\t\t\tvar initializer = new ConstructorInitializer();\n\t\t\t\t\tinitializer.ConstructorInitializerType = c.Initializer is ConstructorBaseInitializer ? ConstructorInitializerType.Base : ConstructorInitializerType.This;\n\t\t\t\t\tvar initializerLocation = LocationsBag.GetLocations(c.Initializer);\n\t\t\t\t\t\n\t\t\t\t\tif (initializerLocation != null)\n\t\t\t\t\t\tnewConstructor.AddChild(new CSharpTokenNode(Convert(initializerLocation [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\n\t\t\t\t\tif (initializerLocation != null && initializerLocation.Count > 1) {\n\t\t\t\t\t\t// this and base has the same length\n\t\t\t\t\t\tvar r = initializer.ConstructorInitializerType == ConstructorInitializerType.This ? ConstructorInitializer.ThisKeywordRole : ConstructorInitializer.BaseKeywordRole;\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(c.Initializer.Location), r), r);\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initializerLocation [1]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\tAddArguments(initializer, c.Initializer.Arguments);\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initializerLocation [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\tnewConstructor.AddChild(initializer, ConstructorDeclaration.InitializerRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (c.Block != null)\n\t\t\t\t\tnewConstructor.AddChild((BlockStatement)c.Block.Accept(this), Roles.Body);\n\t\t\t\ttypeStack.Peek().AddChild(newConstructor, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(Destructor d)\n\t\t\t{\n\t\t\t\tvar newDestructor = new DestructorDeclaration();\n\t\t\t\tAddAttributeSection(newDestructor, d);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(d);\n\t\t\t\tAddModifiers(newDestructor, location);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewDestructor.AddChild(new CSharpTokenNode(Convert(location [0]), DestructorDeclaration.TildeRole), DestructorDeclaration.TildeRole);\n\t\t\t\tnewDestructor.AddChild(Identifier.Create(d.Identifier, Convert(d.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1) {\n\t\t\t\t\tnewDestructor.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\n\t\t\t\t\tif (location.Count > 2)\n\t\t\t\t\t\tnewDestructor.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (d.Block != null)\n\t\t\t\t\tnewDestructor.AddChild((BlockStatement)d.Block.Accept(this), Roles.Body);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newDestructor, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tpublic override void Visit(EventField e)\n\t\t\t{\n\t\t\t\tvar newEvent = new EventDeclaration();\n\t\t\t\tAddAttributeSection(newEvent, e);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(e);\n\t\t\t\tint l = 0;\n\t\t\t\tAddModifiers(newEvent, location);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [l++]), EventDeclaration.EventKeywordRole), EventDeclaration.EventKeywordRole);\n\t\t\t\tnewEvent.AddChild(ConvertToType(e.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar variable = new VariableInitializer();\n\t\t\t\tvariable.AddChild(Identifier.Create(e.MemberName.Name, Convert(e.MemberName.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (e.Initializer != null) {\n\t\t\t\t\tif (location != null && location.Count > l)\n\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvariable.AddChild((Expression)e.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\tnewEvent.AddChild(variable, Roles.Variable);\n\t\t\t\tif (e.Declarators != null) {\n\t\t\t\t\tforeach (var decl in e.Declarators) {\n\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvariable = new VariableInitializer();\n\t\t\t\t\t\tvariable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);\n\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (declLoc != null)\n\t\t\t\t\t\t\t\tvariable.AddChild(new CSharpTokenNode(Convert(declLoc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tvariable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewEvent.AddChild(variable, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > l)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newEvent, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\tvoid AddExplicitInterface(AstNode parent, MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || memberName.ExplicitInterface == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tparent.AddChild(ConvertToType(memberName.ExplicitInterface), EntityDeclaration.PrivateImplementationTypeRole);\n\t\t\t\tvar privateImplTypeLoc = LocationsBag.GetLocations(memberName.ExplicitInterface);\n\t\t\t\tif (privateImplTypeLoc != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(privateImplTypeLoc [0]), Roles.Dot), Roles.Dot);\n\t\t\t}\n\n\t\t\tpublic override void Visit(EventProperty ep)\n\t\t\t{\n\t\t\t\tvar newEvent = new CustomEventDeclaration();\n\t\t\t\tAddAttributeSection(newEvent, ep);\n\t\t\t\tvar location = LocationsBag.GetMemberLocation(ep);\n\t\t\t\tAddModifiers(newEvent, location);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [0]), CustomEventDeclaration.EventKeywordRole), CustomEventDeclaration.EventKeywordRole);\n\t\t\t\tnewEvent.AddChild(ConvertToType(ep.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tAddExplicitInterface(newEvent, ep.MemberName);\n\t\t\t\t\n\t\t\t\tnewEvent.AddChild(Identifier.Create(ep.MemberName.Name, Convert(ep.Location)), Roles.Identifier);\n\n\t\t\t\tif (location != null && location.Count >= 2)\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\n\t\t\t\tif (ep.Add != null) {\n\t\t\t\t\tvar addAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(addAccessor, ep.Add);\n\t\t\t\t\tvar addLocation = LocationsBag.GetMemberLocation(ep.Add);\n\t\t\t\t\tAddModifiers(addAccessor, addLocation);\n\t\t\t\t\taddAccessor.AddChild(new CSharpTokenNode(Convert(ep.Add.Location), CustomEventDeclaration.AddKeywordRole), CustomEventDeclaration.AddKeywordRole);\n\t\t\t\t\tif (ep.Add.Block != null)\n\t\t\t\t\t\taddAccessor.AddChild((BlockStatement)ep.Add.Block.Accept(this), Roles.Body);\n\t\t\t\t\tnewEvent.AddChild(addAccessor, CustomEventDeclaration.AddAccessorRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ep.Remove != null) {\n\t\t\t\t\tvar removeAccessor = new Accessor();\n\t\t\t\t\tAddAttributeSection(removeAccessor, ep.Remove);\n\t\t\t\t\tvar removeLocation = LocationsBag.GetMemberLocation(ep.Remove);\n\t\t\t\t\tAddModifiers(removeAccessor, removeLocation);\n\t\t\t\t\tremoveAccessor.AddChild(new CSharpTokenNode(Convert(ep.Remove.Location), CustomEventDeclaration.RemoveKeywordRole), CustomEventDeclaration.RemoveKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (ep.Remove.Block != null)\n\t\t\t\t\t\tremoveAccessor.AddChild((BlockStatement)ep.Remove.Block.Accept(this), Roles.Body);\n\t\t\t\t\tnewEvent.AddChild(removeAccessor, CustomEventDeclaration.RemoveAccessorRole);\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count >= 3) {\n\t\t\t\t\tnewEvent.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tnewEvent.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttypeStack.Peek().AddChild(newEvent, Roles.TypeMemberRole);\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Statements\n\n\t\t\tpublic override object Visit(Mono.CSharp.Statement stmt)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"unknown statement:\" + stmt);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BlockVariable blockVariableDeclaration)\n\t\t\t{\n\t\t\t\tvar result = new VariableDeclarationStatement();\n\t\t\t\tresult.AddChild(ConvertToType(blockVariableDeclaration.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar varInit = new VariableInitializer();\n\t\t\t\tvar location = LocationsBag.GetLocations(blockVariableDeclaration);\n\t\t\t\tvarInit.AddChild(Identifier.Create(blockVariableDeclaration.Variable.Name, Convert(blockVariableDeclaration.Variable.Location)), Roles.Identifier);\n\t\t\t\tif (blockVariableDeclaration.Initializer != null) {\n\t\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\t\tvarInit.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvarInit.AddChild((Expression)blockVariableDeclaration.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult.AddChild(varInit, Roles.Variable);\n\t\t\t\t\n\t\t\t\tif (blockVariableDeclaration.Declarators != null) {\n\t\t\t\t\tforeach (var decl in blockVariableDeclaration.Declarators) {\n\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult.AddChild(init, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && (blockVariableDeclaration.Initializer == null || location.Count > 1))\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [location.Count - 1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BlockConstant blockConstantDeclaration)\n\t\t\t{\n\t\t\t\tvar result = new VariableDeclarationStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(blockConstantDeclaration);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tresult.AddChild(new CSharpModifierToken(Convert(location [0]), Modifiers.Const), VariableDeclarationStatement.ModifierRole);\n\t\t\t\t\n\t\t\t\tresult.AddChild(ConvertToType(blockConstantDeclaration.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar varInit = new VariableInitializer();\n\t\t\t\tvarInit.AddChild(Identifier.Create(blockConstantDeclaration.Variable.Name, Convert(blockConstantDeclaration.Variable.Location)), Roles.Identifier);\n\t\t\t\tif (blockConstantDeclaration.Initializer != null) {\n\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\tvarInit.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\tvarInit.AddChild((Expression)blockConstantDeclaration.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult.AddChild(varInit, Roles.Variable);\n\t\t\t\t\n\t\t\t\tif (blockConstantDeclaration.Declarators != null) {\n\t\t\t\t\tforeach (var decl in blockConstantDeclaration.Declarators) {\n\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult.AddChild(init, Roles.Variable);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [location.Count - 1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tresult.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.EmptyStatement emptyStatement)\n\t\t\t{\n\t\t\t\tvar result = new EmptyStatement();\n\t\t\t\tresult.Location = Convert(emptyStatement.loc);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.ErrorExpression errorExpression)\n\t\t\t{\n\t\t\t\treturn new ErrorExpression(Convert(errorExpression.Location));\n\t\t\t}\n\n\t\t\tpublic override object Visit(EmptyExpressionStatement emptyExpressionStatement)\n\t\t\t{\n\t\t\t\t// Should never happen.\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\n\t\t\tpublic override object Visit(If ifStatement)\n\t\t\t{\n\t\t\t\tvar result = new IfElseStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(ifStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ifStatement.loc), IfElseStatement.IfKeywordRole), IfElseStatement.IfKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (ifStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)ifStatement.Expr.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (ifStatement.TrueStatement != null)\n\t\t\t\t\tresult.AddChild((Statement)ifStatement.TrueStatement.Accept(this), IfElseStatement.TrueRole);\n\t\t\t\t\n\t\t\t\tif (ifStatement.FalseStatement != null) {\n\t\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), IfElseStatement.ElseKeywordRole), IfElseStatement.ElseKeywordRole);\n\t\t\t\t\tresult.AddChild((Statement)ifStatement.FalseStatement.Accept(this), IfElseStatement.FalseRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Do doStatement)\n\t\t\t{\n\t\t\t\tvar result = new DoWhileStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(doStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(doStatement.loc), DoWhileStatement.DoKeywordRole), DoWhileStatement.DoKeywordRole);\n\t\t\t\tif (doStatement.EmbeddedStatement != null)\n\t\t\t\t\tresult.AddChild((Statement)doStatement.EmbeddedStatement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), DoWhileStatement.WhileKeywordRole), DoWhileStatement.WhileKeywordRole);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (doStatement.expr != null)\n\t\t\t\t\tresult.AddChild((Expression)doStatement.expr.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count > 2) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t\tif (location.Count > 3)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(While whileStatement)\n\t\t\t{\n\t\t\t\tvar result = new WhileStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(whileStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(whileStatement.loc), WhileStatement.WhileKeywordRole), WhileStatement.WhileKeywordRole);\n\t\t\t\t\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (whileStatement.expr != null)\n\t\t\t\t\tresult.AddChild((Expression)whileStatement.expr.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (whileStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)whileStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvoid AddStatementOrList(ForStatement forStatement, Mono.CSharp.Statement init, Role<Statement> role)\n\t\t\t{\n\t\t\t\tif (init == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar stmtList = init as StatementList;\n\t\t\t\tif (stmtList != null) {\n\t\t\t\t\tforeach (var stmt in stmtList.Statements) {\n\t\t\t\t\t\tforStatement.AddChild((Statement)stmt.Accept(this), role);\n\t\t\t\t\t}\n\t\t\t\t} else if (init is Mono.CSharp.EmptyStatement) {\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tforStatement.AddChild((Statement)init.Accept(this), role);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(For forStatement)\n\t\t\t{\n\t\t\t\tvar result = new ForStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(forStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(forStatement.loc), ForStatement.ForKeywordRole), ForStatement.ForKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tAddStatementOrList(result, forStatement.Initializer, ForStatement.InitializerRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\tif (forStatement.Condition != null)\n\t\t\t\t\tresult.AddChild((Expression)forStatement.Condition.Accept(this), Roles.Condition);\n\t\t\t\tif (location != null && location.Count >= 3)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\tAddStatementOrList(result, forStatement.Iterator, ForStatement.IteratorRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count >= 4)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (forStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)forStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(StatementExpression statementExpression)\n\t\t\t{\n\t\t\t\tvar result = new ExpressionStatement();\n\t\t\t\tvar expr = statementExpression.Expr.Accept(this) as Expression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\tresult.AddChild(expr, Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(statementExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(StatementErrorExpression errorStatement)\n\t\t\t{\n\t\t\t\tvar result = new ExpressionStatement();\n\t\t\t\tvar expr = errorStatement.Expr.Accept(this) as Expression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\tresult.AddChild(expr, Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(errorStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(InvalidStatementExpression invalidStatementExpression)\n\t\t\t{\n\t\t\t\tvar result = new ExpressionStatement();\n\t\t\t\tif (invalidStatementExpression.Expression == null)\n\t\t\t\t\treturn result;\n\t\t\t\tvar expr = invalidStatementExpression.Expression.Accept(this) as Expression;\n\t\t\t\tif (expr != null)\n\t\t\t\t\tresult.AddChild(expr, Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(invalidStatementExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Return returnStatement)\n\t\t\t{\n\t\t\t\tvar result = new ReturnStatement();\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(returnStatement.loc), ReturnStatement.ReturnKeywordRole), ReturnStatement.ReturnKeywordRole);\n\t\t\t\tif (returnStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)returnStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(returnStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Goto gotoStatement)\n\t\t\t{\n\t\t\t\tvar result = new GotoStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(gotoStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(gotoStatement.loc), GotoStatement.GotoKeywordRole), GotoStatement.GotoKeywordRole);\n\t\t\t\tvar loc = location != null ? Convert(location [0]) : TextLocation.Empty;\n\t\t\t\tresult.AddChild(Identifier.Create(gotoStatement.Target, loc), Roles.Identifier);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(LabeledStatement labeledStatement)\n\t\t\t{\n\t\t\t\tvar result = new LabelStatement();\n\t\t\t\tresult.AddChild(Identifier.Create(labeledStatement.Name, Convert(labeledStatement.loc)), Roles.Identifier);\n\t\t\t\tvar location = LocationsBag.GetLocations(labeledStatement);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Colon), Roles.Colon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(GotoDefault gotoDefault)\n\t\t\t{\n\t\t\t\tvar result = new GotoDefaultStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(gotoDefault.loc), GotoDefaultStatement.GotoKeywordRole), GotoDefaultStatement.GotoKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(gotoDefault);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), GotoDefaultStatement.DefaultKeywordRole), GotoDefaultStatement.DefaultKeywordRole);\n\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(GotoCase gotoCase)\n\t\t\t{\n\t\t\t\tvar result = new GotoCaseStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(gotoCase.loc), GotoCaseStatement.GotoKeywordRole), GotoCaseStatement.GotoKeywordRole);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(gotoCase);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), GotoCaseStatement.CaseKeywordRole), GotoCaseStatement.CaseKeywordRole);\n\t\t\t\tif (gotoCase.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)gotoCase.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Throw throwStatement)\n\t\t\t{\n\t\t\t\tvar result = new ThrowStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(throwStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(throwStatement.loc), ThrowStatement.ThrowKeywordRole), ThrowStatement.ThrowKeywordRole);\n\t\t\t\tif (throwStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)throwStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Break breakStatement)\n\t\t\t{\n\t\t\t\tvar result = new BreakStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(breakStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(breakStatement.loc), BreakStatement.BreakKeywordRole), BreakStatement.BreakKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Continue continueStatement)\n\t\t\t{\n\t\t\t\tvar result = new ContinueStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(continueStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(continueStatement.loc), ContinueStatement.ContinueKeywordRole), ContinueStatement.ContinueKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic static bool IsLower(Location left, Location right)\n\t\t\t{\n\t\t\t\treturn left.Row < right.Row || left.Row == right.Row && left.Column < right.Column;\n\t\t\t}\n\n\t\t\tpublic UsingStatement CreateUsingStatement(Block blockStatement)\n\t\t\t{\n\t\t\t\tvar usingResult = new UsingStatement();\n\t\t\t\tMono.CSharp.Statement cur = blockStatement.Statements [0];\n\t\t\t\tvar u = cur as Using;\n\t\t\t\tif (u != null) {\n\t\t\t\t\tusingResult.AddChild(new CSharpTokenNode(Convert(u.loc), UsingStatement.UsingKeywordRole), UsingStatement.UsingKeywordRole);\n\t\t\t\t\tusingResult.AddChild(new CSharpTokenNode(Convert(blockStatement.StartLocation), Roles.LPar), Roles.LPar);\n\t\t\t\t\tif (u.Variables != null) {\n\t\t\t\t\t\tvar initializer = new VariableInitializer {\n\t\t\t\t\t\t\tNameToken = Identifier.Create(u.Variables.Variable.Name, Convert(u.Variables.Variable.Location)),\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(u.Variables);\n\t\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\tif (u.Variables.Initializer != null)\n\t\t\t\t\t\t\tinitializer.Initializer = u.Variables.Initializer.Accept(this) as Expression;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar varDec = new VariableDeclarationStatement {\n\t\t\t\t\t\t\tType = ConvertToType(u.Variables.TypeExpression),\n\t\t\t\t\t\t\tVariables = { initializer }\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (u.Variables.Declarators != null) {\n\t\t\t\t\t\t\tforeach (var decl in u.Variables.Declarators) {\n\t\t\t\t\t\t\t\tvar declLoc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\t\t\tif (declLoc != null && declLoc.Count > 0)\n\t\t\t\t\t\t\t\t\tvarDec.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\t\t\tif (declLoc != null && declLoc.Count > 1)\n\t\t\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(declLoc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvarDec.AddChild(init, Roles.Variable);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusingResult.AddChild(varDec, UsingStatement.ResourceAcquisitionRole);\n\t\t\t\t\t}\n\t\t\t\t\tcur = u.Statement;\n\t\t\t\t\tusingResult.AddChild(new CSharpTokenNode(Convert(blockStatement.EndLocation), Roles.RPar), Roles.RPar);\n\t\t\t\t\tif (cur != null)\n\t\t\t\t\t\tusingResult.AddChild((Statement)cur.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t}\n\t\t\t\treturn usingResult;\n\t\t\t}\n\n\t\t\tvoid AddBlockChildren(BlockStatement result, Block blockStatement, ref int curLocal)\n\t\t\t{\n\t\t\t\tif (convertTypeSystemMode) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tforeach (Mono.CSharp.Statement stmt in blockStatement.Statements) {\n\t\t\t\t\tif (stmt == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t/*\t\t\t\t\tif (curLocal < localVariables.Count && IsLower (localVariables[curLocal].Location, stmt.loc)) {\n\t\t\t\t\t\tresult.AddChild (CreateVariableDeclaration (localVariables[curLocal]), Roles.Statement);\n\t\t\t\t\t\tcurLocal++;\n\t\t\t\t\t}*/\n\t\t\t\t\tif (stmt is Block && !(stmt is ToplevelBlock || stmt is ExplicitBlock)) {\n\t\t\t\t\t\tAddBlockChildren(result, (Block)stmt, ref curLocal);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.AddChild((Statement)stmt.Accept(this), BlockStatement.StatementRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(Block blockStatement)\n\t\t\t{\n\t\t\t\tif (blockStatement.IsCompilerGenerated && blockStatement.Statements.Any()) {\n\t\t\t\t\tif (blockStatement.Statements.First() is Using)\n\t\t\t\t\t\treturn CreateUsingStatement(blockStatement);\n\t\t\t\t\treturn blockStatement.Statements.Last().Accept(this);\n\t\t\t\t}\n\t\t\t\tvar result = new BlockStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(blockStatement.StartLocation), Roles.LBrace), Roles.LBrace);\n\t\t\t\tint curLocal = 0;\n\t\t\t\tAddBlockChildren(result, blockStatement, ref curLocal);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(blockStatement.EndLocation), Roles.RBrace), Roles.RBrace);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Switch switchStatement)\n\t\t\t{\n\t\t\t\tvar result = new SwitchStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(switchStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(switchStatement.loc), SwitchStatement.SwitchKeywordRole), SwitchStatement.SwitchKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (switchStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)switchStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.LBrace), Roles.LBrace);\n\t\t\t\tSwitchSection newSection = null;\n\t\t\t\tbool lastWasCase = false, added = true;\n\t\t\t\tif (switchStatement.Block != null) {\n\t\t\t\t\tforeach (var child in switchStatement.Block.Statements) {\n\t\t\t\t\t\tvar statement = child.Accept(this);\n\t\t\t\t\t\tvar caseLabel = statement as CaseLabel;\n\t\t\t\t\t\tif (caseLabel != null) {\n\t\t\t\t\t\t\tif (!lastWasCase) {\n\t\t\t\t\t\t\t\tnewSection = new SwitchSection();\n\t\t\t\t\t\t\t\tadded = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewSection.AddChild(caseLabel, SwitchSection.CaseLabelRole);\n\t\t\t\t\t\t\tlastWasCase = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (lastWasCase) {\n\t\t\t\t\t\t\t\tresult.AddChild(newSection, SwitchStatement.SwitchSectionRole);\n\t\t\t\t\t\t\t\tlastWasCase = false;\n\t\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnewSection.AddChild((Statement)statement, Roles.EmbeddedStatement);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!added)\n\t\t\t\t\tresult.AddChild(newSection, SwitchStatement.SwitchSectionRole);\n\n\t\t\t\tif (location != null && location.Count > 3) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t} else {\n\t\t\t\t\t// parser error, set end node to max value.\n\t\t\t\t\tresult.AddChild(new ErrorNode(), Roles.Error);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SwitchLabel switchLabel)\n\t\t\t{\n\t\t\t\tvar newLabel = new CaseLabel();\n\t\t\t\tif (!switchLabel.IsDefault) {\n\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(Convert(switchLabel.Location), CaseLabel.CaseKeywordRole), CaseLabel.CaseKeywordRole);\n\t\t\t\t\tif (switchLabel.Label != null)\n\t\t\t\t\t\tnewLabel.AddChild((Expression)switchLabel.Label.Accept(this), Roles.Expression);\n\t\t\t\t\tvar colonLocation = LocationsBag.GetLocations(switchLabel);\n\t\t\t\t\tif (colonLocation != null)\n\t\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(Convert(colonLocation [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t} else {\n\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(Convert(switchLabel.Location), CaseLabel.DefaultKeywordRole), CaseLabel.DefaultKeywordRole);\n\t\t\t\t\tnewLabel.AddChild(new CSharpTokenNode(new TextLocation(switchLabel.Location.Row, switchLabel.Location.Column + \"default\".Length), Roles.Colon), Roles.Colon);\n\t\t\t\t}\n\t\t\t\treturn newLabel;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Lock lockStatement)\n\t\t\t{\n\t\t\t\tvar result = new LockStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(lockStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(lockStatement.loc), LockStatement.LockKeywordRole), LockStatement.LockKeywordRole);\n\t\t\t\t\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (lockStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)lockStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (lockStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)lockStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Unchecked uncheckedStatement)\n\t\t\t{\n\t\t\t\tvar result = new UncheckedStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(uncheckedStatement.loc), UncheckedStatement.UncheckedKeywordRole), UncheckedStatement.UncheckedKeywordRole);\n\t\t\t\tif (uncheckedStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)uncheckedStatement.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Checked checkedStatement)\n\t\t\t{\n\t\t\t\tvar result = new CheckedStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(checkedStatement.loc), CheckedStatement.CheckedKeywordRole), CheckedStatement.CheckedKeywordRole);\n\t\t\t\tif (checkedStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)checkedStatement.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Unsafe unsafeStatement)\n\t\t\t{\n\t\t\t\tvar result = new UnsafeStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unsafeStatement.loc), UnsafeStatement.UnsafeKeywordRole), UnsafeStatement.UnsafeKeywordRole);\n\t\t\t\tif (unsafeStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)unsafeStatement.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Fixed fixedStatement)\n\t\t\t{\n\t\t\t\tvar result = new FixedStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(fixedStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(fixedStatement.loc), FixedStatement.FixedKeywordRole), FixedStatement.FixedKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tif (fixedStatement.Variables != null) {\n\t\t\t\t\tvar blockVariableDeclaration = fixedStatement.Variables;\n\t\t\t\t\tresult.AddChild(ConvertToType(blockVariableDeclaration.TypeExpression), Roles.Type);\n\t\t\t\t\tvar varInit = new VariableInitializer();\n\t\t\t\t\tvar initLocation = LocationsBag.GetLocations(blockVariableDeclaration);\n\t\t\t\t\tvarInit.AddChild(Identifier.Create(blockVariableDeclaration.Variable.Name, Convert(blockVariableDeclaration.Variable.Location)), Roles.Identifier);\n\t\t\t\t\tif (blockVariableDeclaration.Initializer != null) {\n\t\t\t\t\t\tif (initLocation != null)\n\t\t\t\t\t\t\tvarInit.AddChild(new CSharpTokenNode(Convert(initLocation [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\tvarInit.AddChild((Expression)blockVariableDeclaration.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tresult.AddChild(varInit, Roles.Variable);\n\t\t\t\t\t\n\t\t\t\t\tif (blockVariableDeclaration.Declarators != null) {\n\t\t\t\t\t\tforeach (var decl in blockVariableDeclaration.Declarators) {\n\t\t\t\t\t\t\tvar loc = LocationsBag.GetLocations(decl);\n\t\t\t\t\t\t\tvar init = new VariableInitializer();\n\t\t\t\t\t\t\tif (loc != null && loc.Count > 0)\n\t\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t\tinit.AddChild(Identifier.Create(decl.Variable.Name, Convert(decl.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\t\tif (decl.Initializer != null) {\n\t\t\t\t\t\t\t\tif (loc != null && loc.Count > 1)\n\t\t\t\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(loc [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\t\tinit.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresult.AddChild(init, Roles.Variable);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (fixedStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)fixedStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(TryFinally tryFinallyStatement)\n\t\t\t{\n\t\t\t\tTryCatchStatement result;\n\t\t\t\tvar location = LocationsBag.GetLocations(tryFinallyStatement);\n\t\t\t\t\n\t\t\t\tif (tryFinallyStatement.Stmt is TryCatch) {\n\t\t\t\t\tresult = (TryCatchStatement)tryFinallyStatement.Stmt.Accept(this);\n\t\t\t\t} else {\n\t\t\t\t\tresult = new TryCatchStatement();\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(tryFinallyStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole);\n\t\t\t\t\tif (tryFinallyStatement.Stmt != null)\n\t\t\t\t\t\tresult.AddChild((BlockStatement)tryFinallyStatement.Stmt.Accept(this), TryCatchStatement.TryBlockRole);\n\t\t\t\t}\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), TryCatchStatement.FinallyKeywordRole), TryCatchStatement.FinallyKeywordRole);\n\t\t\t\tif (tryFinallyStatement.Fini != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)tryFinallyStatement.Fini.Accept(this), TryCatchStatement.FinallyBlockRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tCatchClause ConvertCatch(Catch ctch)\n\t\t\t{\n\t\t\t\tvar result = new CatchClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(ctch);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ctch.loc), CatchClause.CatchKeywordRole), CatchClause.CatchKeywordRole);\n\t\t\t\tif (ctch.TypeExpression != null) {\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\n\t\t\t\t\tif (ctch.TypeExpression != null)\n\t\t\t\t\t\tresult.AddChild(ConvertToType(ctch.TypeExpression), Roles.Type);\n\t\t\t\t\tif (ctch.Variable != null && !string.IsNullOrEmpty(ctch.Variable.Name))\n\t\t\t\t\t\tresult.AddChild(Identifier.Create(ctch.Variable.Name, Convert(ctch.Variable.Location)), Roles.Identifier);\n\t\t\t\t\t\n\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t}\n\n\t\t\t\tif (ctch.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)ctch.Block.Accept(this), Roles.Body);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(TryCatch tryCatchStatement)\n\t\t\t{\n\t\t\t\tvar result = new TryCatchStatement();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(tryCatchStatement.loc), TryCatchStatement.TryKeywordRole), TryCatchStatement.TryKeywordRole);\n\t\t\t\tif (tryCatchStatement.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)tryCatchStatement.Block.Accept(this), TryCatchStatement.TryBlockRole);\n\t\t\t\tif (tryCatchStatement.Clauses != null) {\n\t\t\t\t\tforeach (var ctch in tryCatchStatement.Clauses) {\n\t\t\t\t\t\tresult.AddChild(ConvertCatch(ctch), TryCatchStatement.CatchClauseRole);\n\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\tif (tryCatchStatement.General != null)\n//\t\t\t\t\tresult.AddChild (ConvertCatch (tryCatchStatement.General), TryCatchStatement.CatchClauseRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Using usingStatement)\n\t\t\t{\n\t\t\t\tvar result = new UsingStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(usingStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(usingStatement.loc), UsingStatement.UsingKeywordRole), UsingStatement.UsingKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (usingStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((AstNode)usingStatement.Expr.Accept(this), UsingStatement.ResourceAcquisitionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (usingStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)usingStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Foreach foreachStatement)\n\t\t\t{\n\t\t\t\tvar result = new ForeachStatement();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(foreachStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(foreachStatement.loc), ForeachStatement.ForeachKeywordRole), ForeachStatement.ForeachKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(foreachStatement.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.Variable != null)\n\t\t\t\t\tresult.AddChild(Identifier.Create(foreachStatement.Variable.Name, Convert(foreachStatement.Variable.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), ForeachStatement.InKeywordRole), ForeachStatement.InKeywordRole);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)foreachStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tif (foreachStatement.Statement != null)\n\t\t\t\t\tresult.AddChild((Statement)foreachStatement.Statement.Accept(this), Roles.EmbeddedStatement);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Yield yieldStatement)\n\t\t\t{\n\t\t\t\tvar result = new YieldReturnStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(yieldStatement);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(yieldStatement.loc), YieldReturnStatement.YieldKeywordRole), YieldReturnStatement.YieldKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), YieldReturnStatement.ReturnKeywordRole), YieldReturnStatement.ReturnKeywordRole);\n\t\t\t\tif (yieldStatement.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)yieldStatement.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(YieldBreak yieldBreakStatement)\n\t\t\t{\n\t\t\t\tvar result = new YieldBreakStatement();\n\t\t\t\tvar location = LocationsBag.GetLocations(yieldBreakStatement);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(yieldBreakStatement.loc), YieldBreakStatement.YieldKeywordRole), YieldBreakStatement.YieldKeywordRole);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), YieldBreakStatement.BreakKeywordRole), YieldBreakStatement.BreakKeywordRole);\n\t\t\t\t\tif (location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Expression\n\n\t\t\tpublic override object Visit(Mono.CSharp.Expression expression)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Visit unknown expression:\" + expression);\n\t\t\t\tConsole.WriteLine(Environment.StackTrace);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(DefaultParameterValueExpression defaultParameterValueExpression)\n\t\t\t{\n\t\t\t\treturn defaultParameterValueExpression.Child.Accept(this);\n\t\t\t}\n\n\t\t\tpublic override object Visit(TypeExpression typeExpression)\n\t\t\t{\n\t\t\t\treturn new TypeReferenceExpression(new PrimitiveType(keywordTable [(int)typeExpression.Type.BuiltinType], Convert(typeExpression.Location)));\n\t\t\t}\n\n\t\t\tpublic override object Visit(LocalVariableReference localVariableReference)\n\t\t\t{\n\t\t\t\treturn Identifier.Create(localVariableReference.Name, Convert(localVariableReference.Location));\n\t\t\t}\n\n\t\t\tpublic override object Visit(MemberAccess memberAccess)\n\t\t\t{\n\t\t\t\tExpression result;\n\t\t\t\tvar ind = memberAccess.LeftExpression as Indirection;\n\t\t\t\tif (ind != null) {\n\t\t\t\t\tresult = new PointerReferenceExpression();\n\t\t\t\t\tresult.AddChild((Expression)ind.Expr.Accept(this), Roles.TargetExpression);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(ind.Location), PointerReferenceExpression.ArrowRole), PointerReferenceExpression.ArrowRole);\n\t\t\t\t} else {\n\t\t\t\t\tresult = new MemberReferenceExpression();\n\t\t\t\t\tif (memberAccess.LeftExpression != null) {\n\t\t\t\t\t\tvar leftExpr = memberAccess.LeftExpression.Accept(this);\n\t\t\t\t\t\tresult.AddChild((Expression)leftExpr, Roles.TargetExpression);\n\t\t\t\t\t}\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(memberAccess);\n\n\t\t\t\t\tif (loc != null) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Dot), Roles.Dot);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult.AddChild(Identifier.Create(memberAccess.Name, Convert(memberAccess.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tAddTypeArguments(result, memberAccess);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(QualifiedAliasMember qualifiedAliasMember)\n\t\t\t{\n\t\t\t\tvar result = new MemberType();\n\t\t\t\tresult.Target = new SimpleType(qualifiedAliasMember.alias, Convert(qualifiedAliasMember.Location));\n\t\t\t\tresult.IsDoubleColon = true;\n\t\t\t\tvar location = LocationsBag.GetLocations(qualifiedAliasMember);\n\t\t\t\tif (location != null && location.Count > 0)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.DoubleColon), Roles.DoubleColon);\n\n\t\t\t\tresult.AddChild(Identifier.Create(qualifiedAliasMember.Name, location != null && location.Count > 1 ? Convert(location [1]) : TextLocation.Empty), Roles.Identifier);\n\t\t\t\treturn  new TypeReferenceExpression { Type = result };\n\t\t\t}\n\n\t\t\tpublic override object Visit(Constant constant)\n\t\t\t{\n\t\t\t\tif (constant.GetValue() == null)\n\t\t\t\t\treturn new NullReferenceExpression(Convert(constant.Location));\n\t\t\t\tstring literalValue;\n\t\t\t\tvar literalConstant = constant as ILiteralConstant;\n\t\t\t\tliteralValue = literalConstant != null ? new string(literalConstant.ParsedValue) : constant.GetValueAsLiteral();\n\t\t\t\tobject val = constant.GetValue();\n\t\t\t\tif (val is bool)\n\t\t\t\t\tliteralValue = (bool)val ? \"true\" : \"false\";\n\t\t\t\tvar result = new PrimitiveExpression(val, Convert(constant.Location), literalValue);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SimpleName simpleName)\n\t\t\t{\n\t\t\t\tvar result = new IdentifierExpression();\n\t\t\t\tresult.AddChild(Identifier.Create(simpleName.Name, Convert(simpleName.Location)), Roles.Identifier);\n\t\t\t\tAddTypeArguments(result, simpleName);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BooleanExpression booleanExpression)\n\t\t\t{\n\t\t\t\treturn booleanExpression.Expr.Accept(this);\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.ParenthesizedExpression parenthesizedExpression)\n\t\t\t{\n\t\t\t\tvar result = new ParenthesizedExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(parenthesizedExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (parenthesizedExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)parenthesizedExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Unary unaryExpression)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tswitch (unaryExpression.Oper) {\n\t\t\t\t\tcase Unary.Operator.UnaryPlus:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Plus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.UnaryNegation:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Minus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.LogicalNot:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Not;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.OnesComplement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.BitNot;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Unary.Operator.AddressOf:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.AddressOf;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar r = UnaryOperatorExpression.GetOperatorRole(result.Operator);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryExpression.Location), r), r);\n\t\t\t\tif (unaryExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)unaryExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(UnaryMutator unaryMutatorExpression)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tif (unaryMutatorExpression.Expr == null)\n\t\t\t\t\treturn result;\n\t\t\t\tvar expression = (Expression)unaryMutatorExpression.Expr.Accept(this);\n\t\t\t\tswitch (unaryMutatorExpression.UnaryMutatorMode) {\n\t\t\t\t\tcase UnaryMutator.Mode.PostDecrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.PostDecrement;\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.DecrementRole), UnaryOperatorExpression.DecrementRole);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase UnaryMutator.Mode.PostIncrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.PostIncrement;\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.IncrementRole), UnaryOperatorExpression.IncrementRole);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase UnaryMutator.Mode.PreIncrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Increment;\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.IncrementRole), UnaryOperatorExpression.IncrementRole);\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase UnaryMutator.Mode.PreDecrement:\n\t\t\t\t\t\tresult.Operator = UnaryOperatorType.Decrement;\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(unaryMutatorExpression.Location), UnaryOperatorExpression.DecrementRole), UnaryOperatorExpression.DecrementRole);\n\t\t\t\t\t\tresult.AddChild(expression, Roles.Expression);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Indirection indirectionExpression)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tresult.Operator = UnaryOperatorType.Dereference;\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(indirectionExpression.Location), UnaryOperatorExpression.DereferenceRole), UnaryOperatorExpression.DereferenceRole);\n\t\t\t\tif (indirectionExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)indirectionExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Is isExpression)\n\t\t\t{\n\t\t\t\tvar result = new IsExpression();\n\t\t\t\tif (isExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)isExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(isExpression.Location), IsExpression.IsKeywordRole), IsExpression.IsKeywordRole);\n\t\t\t\t\n\t\t\t\tif (isExpression.ProbeType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(isExpression.ProbeType), Roles.Type);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(As asExpression)\n\t\t\t{\n\t\t\t\tvar result = new AsExpression();\n\t\t\t\tif (asExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)asExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(asExpression.Location), AsExpression.AsKeywordRole), AsExpression.AsKeywordRole);\n\t\t\t\tif (asExpression.ProbeType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(asExpression.ProbeType), Roles.Type);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Cast castExpression)\n\t\t\t{\n\t\t\t\tvar result = new CastExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(castExpression);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(castExpression.Location), Roles.LPar), Roles.LPar);\n\t\t\t\tif (castExpression.TargetType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(castExpression.TargetType), Roles.Type);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.RPar), Roles.RPar);\n\t\t\t\tif (castExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)castExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ComposedCast composedCast)\n\t\t\t{\n\t\t\t\tvar result = new ComposedType();\n\t\t\t\tresult.AddChild(ConvertToType(composedCast.Left), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar spec = composedCast.Spec;\n\t\t\t\twhile (spec != null) {\n\t\t\t\t\tif (spec.IsNullable) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(spec.Location), ComposedType.NullableRole), ComposedType.NullableRole);\n\t\t\t\t\t} else if (spec.IsPointer) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(spec.Location), ComposedType.PointerRole), ComposedType.PointerRole);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar aSpec = new ArraySpecifier();\n\t\t\t\t\t\taSpec.AddChild(new CSharpTokenNode(Convert(spec.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\tvar location = LocationsBag.GetLocations(spec);\n\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\taSpec.AddChild(new CSharpTokenNode(Convert(spec.Location), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\t\tresult.AddChild(aSpec, ComposedType.ArraySpecifierRole);\n\t\t\t\t\t}\n\t\t\t\t\tspec = spec.Next;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.DefaultValueExpression defaultValueExpression)\n\t\t\t{\n\t\t\t\tvar result = new DefaultValueExpression();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(defaultValueExpression.Location), DefaultValueExpression.DefaultKeywordRole), DefaultValueExpression.DefaultKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(defaultValueExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tresult.AddChild(ConvertToType(defaultValueExpression.Expr), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Binary binaryExpression)\n\t\t\t{\n\t\t\t\tvar result = new BinaryOperatorExpression();\n\t\t\t\tswitch (binaryExpression.Oper) {\n\t\t\t\t\tcase Binary.Operator.Multiply:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Multiply;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Division:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Divide;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Modulus:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Modulus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Addition:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Add;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Subtraction:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Subtract;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LeftShift:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ShiftLeft;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.RightShift:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ShiftRight;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LessThan:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.LessThan;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.GreaterThan:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.GreaterThan;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LessThanOrEqual:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.LessThanOrEqual;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.GreaterThanOrEqual:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.GreaterThanOrEqual;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Equality:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.Equality;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Inequality:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.InEquality;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseAnd:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.BitwiseAnd;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.ExclusiveOr:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ExclusiveOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseOr:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.BitwiseOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LogicalAnd:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ConditionalAnd;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LogicalOr:\n\t\t\t\t\t\tresult.Operator = BinaryOperatorType.ConditionalOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (binaryExpression.Left != null)\n\t\t\t\t\tresult.AddChild((Expression)binaryExpression.Left.Accept(this), BinaryOperatorExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(binaryExpression);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tvar r = BinaryOperatorExpression.GetOperatorRole(result.Operator);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), r), r);\n\t\t\t\t}\n\t\t\t\tif (binaryExpression.Right != null)\n\t\t\t\t\tresult.AddChild((Expression)binaryExpression.Right.Accept(this), BinaryOperatorExpression.RightRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Nullable.NullCoalescingOperator nullCoalescingOperator)\n\t\t\t{\n\t\t\t\tvar result = new BinaryOperatorExpression();\n\t\t\t\tresult.Operator = BinaryOperatorType.NullCoalescing;\n\t\t\t\tif (nullCoalescingOperator.LeftExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)nullCoalescingOperator.LeftExpression.Accept(this), BinaryOperatorExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(nullCoalescingOperator);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), BinaryOperatorExpression.NullCoalescingRole), BinaryOperatorExpression.NullCoalescingRole);\n\t\t\t\tif (nullCoalescingOperator.RightExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)nullCoalescingOperator.RightExpression.Accept(this), BinaryOperatorExpression.RightRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Conditional conditionalExpression)\n\t\t\t{\n\t\t\t\tvar result = new ConditionalExpression();\n\t\t\t\t\n\t\t\t\tif (conditionalExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)conditionalExpression.Expr.Accept(this), Roles.Condition);\n\t\t\t\tvar location = LocationsBag.GetLocations(conditionalExpression);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(conditionalExpression.Location), ConditionalExpression.QuestionMarkRole), ConditionalExpression.QuestionMarkRole);\n\t\t\t\tif (conditionalExpression.TrueExpr != null)\n\t\t\t\t\tresult.AddChild((Expression)conditionalExpression.TrueExpr.Accept(this), ConditionalExpression.TrueRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), ConditionalExpression.ColonRole), ConditionalExpression.ColonRole);\n\t\t\t\tif (conditionalExpression.FalseExpr != null)\n\t\t\t\t\tresult.AddChild((Expression)conditionalExpression.FalseExpr.Accept(this), ConditionalExpression.FalseRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvoid AddParameter(AstNode parent, AParametersCollection parameters)\n\t\t\t{\n\t\t\t\tif (parameters == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar paramLocation = LocationsBag.GetLocations(parameters);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < parameters.Count; i++) {\n\t\t\t\t\tvar p = (Parameter)parameters.FixedParameters [i];\n\t\t\t\t\tif (p == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar location = LocationsBag.GetLocations(p);\n\t\t\t\t\tvar parameterDeclarationExpression = new ParameterDeclaration();\n\t\t\t\t\tAddAttributeSection(parameterDeclarationExpression, p);\n\t\t\t\t\tswitch (p.ModFlags) {\n\t\t\t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.Out;\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.OutModifierRole), ParameterDeclaration.OutModifierRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.Ref;\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.RefModifierRole), ParameterDeclaration.RefModifierRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Parameter.Modifier.PARAMS:\n\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.Params;\n\t\t\t\t\t\t\tif (location != null)\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.ParamsModifierRole), ParameterDeclaration.ParamsModifierRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (p.HasExtensionMethodModifier) {\n\t\t\t\t\t\t\t\tparameterDeclarationExpression.ParameterModifier = ParameterModifier.This;\n\t\t\t\t\t\t\t\tif (location != null) {\n\t\t\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [0]), ParameterDeclaration.ThisModifierRole), ParameterDeclaration.ThisModifierRole);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (p.TypeExpression != null) // lambdas may have no types (a, b) => ...\n\t\t\t\t\t\tparameterDeclarationExpression.AddChild(ConvertToType(p.TypeExpression), Roles.Type);\n\t\t\t\t\tif (p.Name != null)\n\t\t\t\t\t\tparameterDeclarationExpression.AddChild(Identifier.Create(p.Name, Convert(p.Location)), Roles.Identifier);\n\t\t\t\t\tif (p.HasDefaultValue) {\n\t\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\t\tparameterDeclarationExpression.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\tparameterDeclarationExpression.AddChild((Expression)p.DefaultValue.Accept(this), Roles.Expression);\n\t\t\t\t\t}\n\t\t\t\t\tparent.AddChild(parameterDeclarationExpression, Roles.Parameter);\n\t\t\t\t\tif (paramLocation != null && i < paramLocation.Count) {\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(paramLocation [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid AddTypeParameters(AstNode parent, MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || memberName.TypeParameters == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeParameters);\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\tfor (int i = 0; i < memberName.TypeParameters.Count; i++) {\n\t\t\t\t\tif (chevronLocs != null && i > 0 && i - 1 < chevronLocs.Count)\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [i - 1]), Roles.Comma), Roles.Comma);\n\t\t\t\t\tvar arg = memberName.TypeParameters [i];\n\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar tp = new TypeParameterDeclaration();\n\t\t\t\t\t\n\t\t\t\t\tList<Location> varianceLocation;\n\t\t\t\t\tswitch (arg.Variance) {\n\t\t\t\t\t\tcase Variance.Contravariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Contravariant;\n\t\t\t\t\t\t\tvarianceLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\t\t\tif (varianceLocation != null)\n\t\t\t\t\t\t\t\ttp.AddChild(new CSharpTokenNode(Convert(varianceLocation [0]), TypeParameterDeclaration.InVarianceKeywordRole), TypeParameterDeclaration.InVarianceKeywordRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Variance.Covariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Covariant;\n\t\t\t\t\t\t\tvarianceLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\t\t\tif (varianceLocation != null)\n\t\t\t\t\t\t\t\ttp.AddChild(new CSharpTokenNode(Convert(varianceLocation [0]), TypeParameterDeclaration.OutVarianceKeywordRole), TypeParameterDeclaration.OutVarianceKeywordRole);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Invariant;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tAddAttributeSection(tp, arg.OptAttributes);\n\n\t\t\t\t\tswitch (arg.Variance) {\n\t\t\t\t\t\tcase Variance.Covariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Covariant;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase Variance.Contravariant:\n\t\t\t\t\t\t\ttp.Variance = VarianceModifier.Contravariant;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ttp.AddChild(Identifier.Create(arg.Name, Convert(arg.Location)), Roles.Identifier);\n\t\t\t\t\tparent.AddChild(tp, Roles.TypeParameter);\n\t\t\t\t}\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tvoid AddTypeArguments(AstNode parent, MemberName memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || memberName.TypeParameters == null)\n\t\t\t\t\treturn;\n\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeParameters);\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < memberName.TypeParameters.Count; i++) {\n\t\t\t\t\tvar arg = memberName.TypeParameters [i];\n\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tparent.AddChild(ConvertToType(arg), Roles.TypeArgument);\n\t\t\t\t\tif (chevronLocs != null && i < chevronLocs.Count - 2)\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tvoid AddTypeArguments(AstNode parent, ATypeNameExpression memberName)\n\t\t\t{\n\t\t\t\tif (memberName == null || !memberName.HasTypeArguments)\n\t\t\t\t\treturn;\n\t\t\t\tvar chevronLocs = LocationsBag.GetLocations(memberName.TypeArguments);\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 2]), Roles.LChevron), Roles.LChevron);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < memberName.TypeArguments.Count; i++) {\n\t\t\t\t\tvar arg = memberName.TypeArguments.Args [i];\n\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tparent.AddChild(ConvertToType(arg), Roles.TypeArgument);\n\t\t\t\t\tif (chevronLocs != null && i < chevronLocs.Count - 2)\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (chevronLocs != null)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(chevronLocs [chevronLocs.Count - 1]), Roles.RChevron), Roles.RChevron);\n\t\t\t}\n\n\t\t\tvoid AddConstraints(AstNode parent, TypeParameters d)\n\t\t\t{\n\t\t\t\tif (d == null)\n\t\t\t\t\treturn;\n\t\t\t\tfor (int i = 0; i < d.Count; i++) {\n\t\t\t\t\tvar typeParameter = d [i];\n\t\t\t\t\tif (typeParameter == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar c = typeParameter.Constraints;\n\t\t\t\t\tif (c == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar location = LocationsBag.GetLocations(c);\n\t\t\t\t\tvar constraint = new Constraint();\n\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(c.Location), Roles.WhereKeyword), Roles.WhereKeyword);\n\t\t\t\t\tconstraint.AddChild(new SimpleType(Identifier.Create(c.TypeParameter.Value, Convert(c.TypeParameter.Location))), Roles.ConstraintTypeParameter);\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\tvar commaLocs = LocationsBag.GetLocations(c.ConstraintExpressions);\n\t\t\t\t\tint curComma = 0;\n\t\t\t\t\tif (c.ConstraintExpressions != null) {\n\t\t\t\t\t\tforeach (var expr in c.ConstraintExpressions) {\n\t\t\t\t\t\t\tconstraint.AddChild(ConvertToType(expr), Roles.BaseType);\n\t\t\t\t\t\t\tvar sce = expr as SpecialContraintExpr;\n\t\t\t\t\t\t\tif (sce != null) {\n\t\t\t\t\t\t\t\tswitch (sce.Constraint) {\n\t\t\t\t\t\t\t\t\tcase SpecialConstraint.Class:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase SpecialConstraint.Struct:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase SpecialConstraint.Constructor:\n\t\t\t\t\t\t\t\t\t\tvar bl = LocationsBag.GetLocations(expr);\n\t\t\t\t\t\t\t\t\t\tif (bl != null) {\n\t\t\t\t\t\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(bl [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(bl [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (commaLocs != null && curComma < commaLocs.Count)\n\t\t\t\t\t\t\t\tconstraint.AddChild(new CSharpTokenNode(Convert(commaLocs [curComma++]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// We need to sort the constraints by position; as they might be in a different order than the type parameters\n\t\t\t\t\tAstNode prevSibling = parent.LastChild;\n\t\t\t\t\twhile (prevSibling.StartLocation > constraint.StartLocation && prevSibling.PrevSibling != null)\n\t\t\t\t\t\tprevSibling = prevSibling.PrevSibling;\n\t\t\t\t\tparent.InsertChildAfter(prevSibling, constraint, Roles.Constraint);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tExpression ConvertArgument(Argument arg)\n\t\t\t{\n\t\t\t\tvar na = arg as NamedArgument;\n\t\t\t\tif (na != null) {\n\t\t\t\t\tvar newArg = new NamedArgumentExpression();\n\t\t\t\t\tnewArg.AddChild(Identifier.Create(na.Name, Convert(na.Location)), Roles.Identifier);\n\t\t\t\t\t\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(na);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tnewArg.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Colon), Roles.Colon);\n\t\t\t\t\t\n\t\t\t\t\tif (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) {\n\t\t\t\t\t\tvar direction = new DirectionExpression();\n\t\t\t\t\t\tdirection.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref;\n\t\t\t\t\t\tvar argLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\t\tif (argLocation != null) {\n\t\t\t\t\t\t\tvar r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole;\n\t\t\t\t\t\t\tdirection.AddChild(new CSharpTokenNode(Convert(argLocation [0]), r), r);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdirection.AddChild((Expression)arg.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\tnewArg.AddChild(direction, Roles.Expression);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewArg.AddChild(na.Expr != null ? (Expression)na.Expr.Accept(this) : new ErrorExpression(\"Named argument expression parse error\"), Roles.Expression);\n\t\t\t\t\t}\n\t\t\t\t\treturn newArg;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) {\n\t\t\t\t\tvar direction = new DirectionExpression();\n\t\t\t\t\tdirection.FieldDirection = arg.ArgType == Argument.AType.Out ? FieldDirection.Out : FieldDirection.Ref;\n\t\t\t\t\tvar argLocation = LocationsBag.GetLocations(arg);\n\t\t\t\t\tif (argLocation != null) {\n\t\t\t\t\t\tvar r = arg.ArgType == Argument.AType.Out ? DirectionExpression.OutKeywordRole : DirectionExpression.RefKeywordRole;\n\t\t\t\t\t\tdirection.AddChild(new CSharpTokenNode(Convert(argLocation [0]), r), r);\n\t\t\t\t\t}\n\t\t\t\t\tdirection.AddChild((Expression)arg.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\treturn direction;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn (Expression)arg.Expr.Accept(this);\n\t\t\t}\n\n\t\t\tvoid AddArguments(AstNode parent, Arguments args)\n\t\t\t{\n\t\t\t\tif (args == null)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tvar commaLocations = LocationsBag.GetLocations(args);\n\t\t\t\tfor (int i = 0; i < args.Count; i++) {\n\t\t\t\t\tparent.AddChild(ConvertArgument(args [i]), Roles.Argument);\n\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (commaLocations != null && commaLocations.Count > args.Count)\n\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(commaLocations [args.Count]), Roles.Comma), Roles.Comma);\n\t\t\t}\n\n\t\t\tpublic override object Visit(Invocation invocationExpression)\n\t\t\t{\n\t\t\t\tvar result = new InvocationExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(invocationExpression);\n\t\t\t\tif (invocationExpression.Exp != null)\n\t\t\t\t\tresult.AddChild((Expression)invocationExpression.Exp.Accept(this), Roles.TargetExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddArguments(result, invocationExpression.Arguments);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(New newExpression)\n\t\t\t{\n\t\t\t\tvar result = new ObjectCreateExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(newExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(newExpression.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole);\n\t\t\t\t\n\t\t\t\tif (newExpression.TypeRequested != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(newExpression.TypeRequested), Roles.Type);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddArguments(result, newExpression.Arguments);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(NewAnonymousType newAnonymousType)\n\t\t\t{\n\t\t\t\tvar result = new AnonymousTypeCreateExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(newAnonymousType);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(newAnonymousType.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBrace), Roles.LBrace);\n\t\t\t\tif (newAnonymousType.Parameters != null) {\n\t\t\t\t\tforeach (var par in newAnonymousType.Parameters) {\n\t\t\t\t\t\tif (par == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tvar parLocation = LocationsBag.GetLocations(par);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (parLocation == null) {\n\t\t\t\t\t\t\tif (par.Expr != null)\n\t\t\t\t\t\t\t\tresult.AddChild((Expression)par.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar namedExpression = new NamedExpression();\n\t\t\t\t\t\t\tnamedExpression.AddChild(Identifier.Create(par.Name, Convert(par.Location)), Roles.Identifier);\n\t\t\t\t\t\t\tnamedExpression.AddChild(new CSharpTokenNode(Convert(parLocation [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tif (par.Expr != null)\n\t\t\t\t\t\t\t\tnamedExpression.AddChild((Expression)par.Expr.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\tresult.AddChild(namedExpression, Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tArrayInitializerExpression ConvertCollectionOrObjectInitializers(CollectionOrObjectInitializers minit)\n\t\t\t{\n\t\t\t\tif (minit == null)\n\t\t\t\t\treturn null;\n\t\t\t\tvar init = new ArrayInitializerExpression();\n\t\t\t\tAddConvertCollectionOrObjectInitializers(init, minit);\n\t\t\t\treturn init;\n\t\t\t}\n\n\t\t\tvoid AddConvertCollectionOrObjectInitializers(Expression init, CollectionOrObjectInitializers minit)\n\t\t\t{\n\t\t\t\tvar initLoc = LocationsBag.GetLocations(minit);\n\t\t\t\tvar commaLoc = LocationsBag.GetLocations(minit.Initializers);\n\t\t\t\tint curComma = 0;\n\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(minit.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\tforeach (var expr in minit.Initializers) {\n\t\t\t\t\tvar collectionInit = expr as CollectionElementInitializer;\n\t\t\t\t\tif (collectionInit != null) {\n\t\t\t\t\t\tAstNode parent;\n\t\t\t\t\t\t// For ease of use purposes in the resolver the ast representation\n\t\t\t\t\t\t// of { a, b, c }  is { {a}, {b}, {c} } - but the generated ArrayInitializerExpression\n\t\t\t\t\t\t// can be identified by expr.IsSingleElement.\n\t\t\t\t\t\tif (!collectionInit.IsSingle) {\n\t\t\t\t\t\t\tparent = new ArrayInitializerExpression();\n\t\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(collectionInit.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tparent = ArrayInitializerExpression.CreateSingleElementInitializer();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (collectionInit.Arguments != null) {\n\t\t\t\t\t\t\tfor (int i = 0; i < collectionInit.Arguments.Count; i++) {\n\t\t\t\t\t\t\t\tvar arg = collectionInit.Arguments [i] as CollectionElementInitializer.ElementInitializerArgument;\n\t\t\t\t\t\t\t\tif (arg == null)\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\tparent.AddChild(\n\t\t\t\t\t\t\t\t\t(Expression)arg.Expr.Accept(this),\n\t\t\t\t\t\t\t\t\tRoles.Expression\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!collectionInit.IsSingle) {\n\t\t\t\t\t\t\tvar braceLocs = LocationsBag.GetLocations(expr);\n\t\t\t\t\t\t\tif (braceLocs != null)\n\t\t\t\t\t\t\t\tparent.AddChild(new CSharpTokenNode(Convert(braceLocs [0]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinit.AddChild((ArrayInitializerExpression)parent, Roles.Expression);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar eleInit = expr as ElementInitializer;\n\t\t\t\t\t\tif (eleInit != null) {\n\t\t\t\t\t\t\tvar nexpr = new NamedExpression();\n\t\t\t\t\t\t\tnexpr.AddChild(\n\t\t\t\t\t\t\t\tIdentifier.Create(eleInit.Name, Convert(eleInit.Location)),\n\t\t\t\t\t\t\t\tRoles.Identifier\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tvar assignLoc = LocationsBag.GetLocations(eleInit);\n\t\t\t\t\t\t\tif (assignLoc != null)\n\t\t\t\t\t\t\t\tnexpr.AddChild(new CSharpTokenNode(Convert(assignLoc [0]), Roles.Assign), Roles.Assign);\n\t\t\t\t\t\t\tif (eleInit.Source != null) {\n\t\t\t\t\t\t\t\tvar colInit = eleInit.Source as CollectionOrObjectInitializers;\n\t\t\t\t\t\t\t\tif (colInit != null) {\n\t\t\t\t\t\t\t\t\tvar arrInit = new ArrayInitializerExpression();\n\t\t\t\t\t\t\t\t\tAddConvertCollectionOrObjectInitializers(\n\t\t\t\t\t\t\t\t\t\tarrInit,\n\t\t\t\t\t\t\t\t\t\tcolInit\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tnexpr.AddChild(arrInit, Roles.Expression);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnexpr.AddChild((Expression)eleInit.Source.Accept(this), Roles.Expression);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tinit.AddChild(nexpr, Roles.Expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (commaLoc != null && curComma < commaLoc.Count)\n\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(commaLoc [curComma++]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\n\t\t\t\tif (initLoc != null) {\n\t\t\t\t\tif (initLoc.Count == 2) // optional comma\n\t\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(initLoc [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\tinit.AddChild(new CSharpTokenNode(Convert(initLoc [initLoc.Count - 1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(NewInitialize newInitializeExpression)\n\t\t\t{\n\t\t\t\tvar result = new ObjectCreateExpression();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(newInitializeExpression.Location), ObjectCreateExpression.NewKeywordRole), ObjectCreateExpression.NewKeywordRole);\n\t\t\t\t\n\t\t\t\tif (newInitializeExpression.TypeRequested != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(newInitializeExpression.TypeRequested), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(newInitializeExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tAddArguments(result, newInitializeExpression.Arguments);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\t\n\t\t\t\tvar init = ConvertCollectionOrObjectInitializers(newInitializeExpression.Initializers);\n\t\t\t\tif (init != null)\n\t\t\t\t\tresult.AddChild(init, ObjectCreateExpression.InitializerRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ArrayCreation arrayCreationExpression)\n\t\t\t{\n\t\t\t\tvar result = new ArrayCreateExpression();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(arrayCreationExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(arrayCreationExpression.Location), ArrayCreateExpression.NewKeywordRole), ArrayCreateExpression.NewKeywordRole);\n\t\t\t\tif (arrayCreationExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(arrayCreationExpression.TypeExpression), Roles.Type);\n\t\t\t\t\n\t\t\t\tvar next = arrayCreationExpression.Rank;\n\t\t\t\tif (arrayCreationExpression.Arguments != null) {\n\t\t\t\t\t// skip first array rank.\n\t\t\t\t\tnext = next.Next;\n\t\t\t\t\t\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\t\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(arrayCreationExpression.Arguments);\n\t\t\t\t\tfor (int i = 0; i < arrayCreationExpression.Arguments.Count; i++) {\n\t\t\t\t\t\tvar arg = arrayCreationExpression.Arguments [i];\n\t\t\t\t\t\tif (arg != null)\n\t\t\t\t\t\t\tresult.AddChild((Expression)arg.Accept(this), Roles.Argument);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count)\n\t\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t}\n\t\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twhile (next != null) {\n\t\t\t\t\tvar spec = new ArraySpecifier(next.Dimension);\n\t\t\t\t\tvar loc = LocationsBag.GetLocations(next);\n\t\t\t\t\tspec.AddChild(new CSharpTokenNode(Convert(next.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\t\tresult.AddChild(spec, ArrayCreateExpression.AdditionalArraySpecifierRole);\n\t\t\t\t\tif (loc != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\t\tnext = next.Next;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (arrayCreationExpression.Initializers != null) {\n\t\t\t\t\tvar initLocation = LocationsBag.GetLocations(arrayCreationExpression.Initializers);\n\t\t\t\t\tvar initializer = new ArrayInitializerExpression();\n\t\t\t\t\t\n\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(arrayCreationExpression.Initializers.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\t\tvar commaLocations = LocationsBag.GetLocations(arrayCreationExpression.Initializers.Elements);\n\t\t\t\t\tfor (int i = 0; i < arrayCreationExpression.Initializers.Count; i++) {\n\t\t\t\t\t\tvar init = arrayCreationExpression.Initializers [i];\n\t\t\t\t\t\tif (init == null)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tinitializer.AddChild((Expression)init.Accept(this), Roles.Expression);\n\t\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count) {\n\t\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (initLocation != null) {\n\t\t\t\t\t\tif (initLocation.Count == 2) // optional comma\n\t\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initLocation [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\t\tinitializer.AddChild(new CSharpTokenNode(Convert(initLocation [initLocation.Count - 1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t\t}\n\t\t\t\t\tresult.AddChild(initializer, ArrayCreateExpression.InitializerRole);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(This thisExpression)\n\t\t\t{\n\t\t\t\tvar result = new ThisReferenceExpression();\n\t\t\t\tresult.Location = Convert(thisExpression.Location);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ArglistAccess argListAccessExpression)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression {\n\t\t\t\t\tUndocumentedExpressionType = UndocumentedExpressionType.ArgListAccess\n\t\t\t\t};\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(argListAccessExpression.Location), UndocumentedExpression.ArglistKeywordRole), UndocumentedExpression.ArglistKeywordRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#region Undocumented expressions\n\n\t\t\tpublic override object Visit(Arglist argListExpression)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.ArgList };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(argListExpression.Location), UndocumentedExpression.ArglistKeywordRole), UndocumentedExpression.ArglistKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(argListExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tAddArguments(result, argListExpression.Arguments);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(MakeRefExpr makeRefExpr)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.MakeRef };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(makeRefExpr.Location), UndocumentedExpression.MakerefKeywordRole), UndocumentedExpression.MakerefKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(makeRefExpr);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (makeRefExpr.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)makeRefExpr.Expr.Accept(this), Roles.Argument);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(RefTypeExpr refTypeExpr)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.RefType };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(refTypeExpr.Location), UndocumentedExpression.ReftypeKeywordRole), UndocumentedExpression.ReftypeKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(refTypeExpr);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\tif (refTypeExpr.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)refTypeExpr.Expr.Accept(this), Roles.Argument);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(RefValueExpr refValueExpr)\n\t\t\t{\n\t\t\t\tvar result = new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.RefValue };\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(refValueExpr.Location), UndocumentedExpression.RefvalueKeywordRole), UndocumentedExpression.RefvalueKeywordRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(refValueExpr);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (refValueExpr.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)refValueExpr.Expr.Accept(this), Roles.Argument);\n\n\t\t\t\tif (refValueExpr.FullNamedExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)refValueExpr.FullNamedExpression.Accept(this), Roles.Argument);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\tpublic override object Visit(TypeOf typeOfExpression)\n\t\t\t{\n\t\t\t\tvar result = new TypeOfExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(typeOfExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(typeOfExpression.Location), TypeOfExpression.TypeofKeywordRole), TypeOfExpression.TypeofKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (typeOfExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(typeOfExpression.TypeExpression), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SizeOf sizeOfExpression)\n\t\t\t{\n\t\t\t\tvar result = new SizeOfExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(sizeOfExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(sizeOfExpression.Location), SizeOfExpression.SizeofKeywordRole), SizeOfExpression.SizeofKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (sizeOfExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(sizeOfExpression.TypeExpression), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(CheckedExpr checkedExpression)\n\t\t\t{\n\t\t\t\tvar result = new CheckedExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(checkedExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(checkedExpression.Location), CheckedExpression.CheckedKeywordRole), CheckedExpression.CheckedKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (checkedExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)checkedExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(UnCheckedExpr uncheckedExpression)\n\t\t\t{\n\t\t\t\tvar result = new UncheckedExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(uncheckedExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(uncheckedExpression.Location), UncheckedExpression.UncheckedKeywordRole), UncheckedExpression.UncheckedKeywordRole);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);\n\t\t\t\tif (uncheckedExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)uncheckedExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ElementAccess elementAccessExpression)\n\t\t\t{\n\t\t\t\tvar result = new IndexerExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(elementAccessExpression);\n\t\t\t\t\n\t\t\t\tif (elementAccessExpression.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)elementAccessExpression.Expr.Accept(this), Roles.TargetExpression);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(elementAccessExpression.Location), Roles.LBracket), Roles.LBracket);\n\t\t\t\tAddArguments(result, elementAccessExpression.Arguments);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.RBracket), Roles.RBracket);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(BaseThis baseAccessExpression)\n\t\t\t{\n\t\t\t\tvar result = new BaseReferenceExpression();\n\t\t\t\tresult.Location = Convert(baseAccessExpression.Location);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(StackAlloc stackAllocExpression)\n\t\t\t{\n\t\t\t\tvar result = new StackAllocExpression();\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(stackAllocExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), StackAllocExpression.StackallocKeywordRole), StackAllocExpression.StackallocKeywordRole);\n\t\t\t\tif (stackAllocExpression.TypeExpression != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(stackAllocExpression.TypeExpression), Roles.Type);\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.LBracket), Roles.LBracket);\n\t\t\t\tif (stackAllocExpression.CountExpression != null)\n\t\t\t\t\tresult.AddChild((Expression)stackAllocExpression.CountExpression.Accept(this), Roles.Expression);\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), Roles.RBracket), Roles.RBracket);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(SimpleAssign simpleAssign)\n\t\t\t{\n\t\t\t\tvar result = new AssignmentExpression();\n\t\t\t\t\n\t\t\t\tresult.Operator = AssignmentOperatorType.Assign;\n\t\t\t\tif (simpleAssign.Target != null)\n\t\t\t\t\tresult.AddChild((Expression)simpleAssign.Target.Accept(this), AssignmentExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(simpleAssign);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), AssignmentExpression.AssignRole), AssignmentExpression.AssignRole);\n\t\t\t\tif (simpleAssign.Source != null) {\n\t\t\t\t\tresult.AddChild((Expression)simpleAssign.Source.Accept(this), AssignmentExpression.RightRole);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(CompoundAssign compoundAssign)\n\t\t\t{\n\t\t\t\tvar result = new AssignmentExpression();\n\t\t\t\tswitch (compoundAssign.Op) {\n\t\t\t\t\tcase Binary.Operator.Multiply:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Multiply;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Division:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Divide;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Modulus:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Modulus;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Addition:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Add;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.Subtraction:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.Subtract;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.LeftShift:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.ShiftLeft;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.RightShift:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.ShiftRight;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseAnd:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.BitwiseAnd;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.BitwiseOr:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.BitwiseOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Binary.Operator.ExclusiveOr:\n\t\t\t\t\t\tresult.Operator = AssignmentOperatorType.ExclusiveOr;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (compoundAssign.Target != null)\n\t\t\t\t\tresult.AddChild((Expression)compoundAssign.Target.Accept(this), AssignmentExpression.LeftRole);\n\t\t\t\tvar location = LocationsBag.GetLocations(compoundAssign);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tvar r = AssignmentExpression.GetOperatorRole(result.Operator);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), r), r);\n\t\t\t\t}\n\t\t\t\tif (compoundAssign.Source != null)\n\t\t\t\t\tresult.AddChild((Expression)compoundAssign.Source.Accept(this), AssignmentExpression.RightRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.AnonymousMethodExpression anonymousMethodExpression)\n\t\t\t{\n\t\t\t\tvar result = new AnonymousMethodExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(anonymousMethodExpression);\n\t\t\t\tint l = 0;\n\t\t\t\tif (anonymousMethodExpression.IsAsync) {\n\t\t\t\t\tresult.IsAsync = true;\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), AnonymousMethodExpression.AsyncModifierRole), AnonymousMethodExpression.AsyncModifierRole);\n\t\t\t\t}\n\t\t\t\tif (location != null) {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), AnonymousMethodExpression.DelegateKeywordRole), AnonymousMethodExpression.DelegateKeywordRole);\n\t\t\t\t\t\n\t\t\t\t\tif (location.Count > l) {\n\t\t\t\t\t\tresult.HasParameterList = true;\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.LPar), Roles.LPar);\n\t\t\t\t\t\tAddParameter(result, anonymousMethodExpression.Parameters);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (anonymousMethodExpression.Block != null)\n\t\t\t\t\tresult.AddChild((BlockStatement)anonymousMethodExpression.Block.Accept(this), Roles.Body);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.LambdaExpression lambdaExpression)\n\t\t\t{\n\t\t\t\tvar result = new LambdaExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(lambdaExpression);\n\t\t\t\tint l = 0;\n\t\t\t\tif (lambdaExpression.IsAsync) {\n\t\t\t\t\tresult.IsAsync = true;\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), LambdaExpression.AsyncModifierRole), LambdaExpression.AsyncModifierRole);\n\t\t\t\t}\n\t\t\t\tif (location == null || location.Count == l + 1) {\n\t\t\t\t\tif (lambdaExpression.Block != null)\n\t\t\t\t\t\tAddParameter(result, lambdaExpression.Parameters);\n\t\t\t\t\tif (location != null)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), LambdaExpression.ArrowRole), LambdaExpression.ArrowRole);\n\t\t\t\t} else {\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.LPar), Roles.LPar);\n\t\t\t\t\tif (lambdaExpression.Block != null)\n\t\t\t\t\t\tAddParameter(result, lambdaExpression.Parameters);\n\t\t\t\t\tif (location != null) {\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), Roles.RPar), Roles.RPar);\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [l++]), LambdaExpression.ArrowRole), LambdaExpression.ArrowRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lambdaExpression.Block != null) {\n\t\t\t\t\tif (lambdaExpression.Block.IsCompilerGenerated) {\n\t\t\t\t\t\tvar generatedReturn = (ContextualReturn)lambdaExpression.Block.Statements [0];\n\t\t\t\t\t\tresult.AddChild((AstNode)generatedReturn.Expr.Accept(this), LambdaExpression.BodyRole);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.AddChild((AstNode)lambdaExpression.Block.Accept(this), LambdaExpression.BodyRole);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(ConstInitializer constInitializer)\n\t\t\t{\n\t\t\t\treturn constInitializer.Expr.Accept(this);\n\t\t\t}\n\n\t\t\tpublic override object Visit(ArrayInitializer arrayInitializer)\n\t\t\t{\n\t\t\t\tvar result = new ArrayInitializerExpression();\n\t\t\t\tvar location = LocationsBag.GetLocations(arrayInitializer);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(arrayInitializer.Location), Roles.LBrace), Roles.LBrace);\n\t\t\t\tvar commaLocations = LocationsBag.GetLocations(arrayInitializer.Elements);\n\t\t\t\tfor (int i = 0; i < arrayInitializer.Count; i++) {\n\t\t\t\t\tvar init = arrayInitializer [i];\n\t\t\t\t\tif (init == null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tresult.AddChild((Expression)init.Accept(this), Roles.Expression);\n\t\t\t\t\tif (commaLocations != null && i < commaLocations.Count)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(commaLocations [i]), Roles.Comma), Roles.Comma);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (location != null) {\n\t\t\t\t\tif (location.Count == 2) // optional comma\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Comma), Roles.Comma);\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [location.Count - 1]), Roles.RBrace), Roles.RBrace);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region LINQ expressions\n\n\t\t\tQueryOrderClause currentQueryOrderClause;\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.QueryExpression queryExpression)\n\t\t\t{\n\t\t\t\tvar oldQueryOrderClause = currentQueryOrderClause;\n\t\t\t\ttry {\n\t\t\t\t\tcurrentQueryOrderClause = null;\n\t\t\t\t\tvar result = new QueryExpression();\n\t\t\t\t\t\n\t\t\t\t\tvar currentClause = queryExpression.next;\n\t\t\t\t\t\n\t\t\t\t\twhile (currentClause != null) {\n\t\t\t\t\t\tvar clause = (QueryClause)currentClause.Accept(this);\n\t\t\t\t\t\tif (clause is QueryContinuationClause) {\n\t\t\t\t\t\t\t// insert preceding query at beginning of QueryContinuationClause\n\t\t\t\t\t\t\tclause.InsertChildAfter(null, result, QueryContinuationClause.PrecedingQueryRole);\n\t\t\t\t\t\t\t// create a new QueryExpression for the remaining query\n\t\t\t\t\t\t\tresult = new QueryExpression();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (clause != null) {\n\t\t\t\t\t\t\tresult.AddChild(clause, QueryExpression.ClauseRole);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentClause = currentClause.next;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn result;\n\t\t\t\t} finally {\n\t\t\t\t\tcurrentQueryOrderClause = oldQueryOrderClause;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.QueryStartClause queryExpression)\n\t\t\t{\n\t\t\t\tif (queryExpression.Expr == null) {\n\t\t\t\t\tvar intoClause = new QueryContinuationClause();\n\t\t\t\t\tintoClause.AddChild(new CSharpTokenNode(Convert(queryExpression.Location), QueryContinuationClause.IntoKeywordRole), QueryContinuationClause.IntoKeywordRole);\n\t\t\t\t\tintoClause.AddChild(Identifier.Create(queryExpression.IntoVariable.Name, Convert(queryExpression.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\t\treturn intoClause;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar fromClause = new QueryFromClause();\n\n\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(queryExpression.Location), QueryFromClause.FromKeywordRole), QueryFromClause.FromKeywordRole);\n\t\t\t\t\n\t\t\t\tif (queryExpression.IdentifierType != null)\n\t\t\t\t\tfromClause.AddChild(ConvertToType(queryExpression.IdentifierType), Roles.Type);\n\t\t\t\t\n\t\t\t\tfromClause.AddChild(Identifier.Create(queryExpression.IntoVariable.Name, Convert(queryExpression.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(queryExpression);\n\t\t\t\tif (location != null)\n\t\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(location [0]), QueryFromClause.InKeywordRole), QueryFromClause.InKeywordRole);\n\n\t\t\t\tif (queryExpression.Expr != null)\n\t\t\t\t\tfromClause.AddChild((Expression)queryExpression.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn fromClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.SelectMany selectMany)\n\t\t\t{\n\t\t\t\tvar fromClause = new QueryFromClause();\n\n\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(selectMany.Location), QueryFromClause.FromKeywordRole), QueryFromClause.FromKeywordRole);\n\t\t\t\t\n\t\t\t\tif (selectMany.IdentifierType != null)\n\t\t\t\t\tfromClause.AddChild(ConvertToType(selectMany.IdentifierType), Roles.Type);\n\t\t\t\t\n\t\t\t\tfromClause.AddChild(Identifier.Create(selectMany.IntoVariable.Name, Convert(selectMany.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\t\n\t\t\t\tvar location = LocationsBag.GetLocations(selectMany);\n\t\t\t\tif (location != null)\n\t\t\t\t\tfromClause.AddChild(new CSharpTokenNode(Convert(location [0]), QueryFromClause.InKeywordRole), QueryFromClause.InKeywordRole);\n\n\t\t\t\tif (selectMany.Expr != null)\n\t\t\t\t\tfromClause.AddChild((Expression)selectMany.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn fromClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Select select)\n\t\t\t{\n\t\t\t\tvar result = new QuerySelectClause();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(select.Location), QuerySelectClause.SelectKeywordRole), QuerySelectClause.SelectKeywordRole);\n\t\t\t\tif (select.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)select.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.GroupBy groupBy)\n\t\t\t{\n\t\t\t\tvar result = new QueryGroupClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(groupBy);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(groupBy.Location), QueryGroupClause.GroupKeywordRole), QueryGroupClause.GroupKeywordRole);\n\t\t\t\tif (groupBy.ElementSelector != null)\n\t\t\t\t\tresult.AddChild((Expression)groupBy.ElementSelector.Accept(this), QueryGroupClause.ProjectionRole);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tvar byLoc = Convert(location[0]);\n\t\t\t\t\tif (byLoc.Line > 1 || byLoc.Column > 1)\n\t\t\t\t\t\tresult.AddChild(new CSharpTokenNode(byLoc, QueryGroupClause.ByKeywordRole), QueryGroupClause.ByKeywordRole);\n\t\t\t\t}\n\t\t\t\tif (groupBy.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)groupBy.Expr.Accept(this), QueryGroupClause.KeyRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Let let)\n\t\t\t{\n\t\t\t\tvar result = new QueryLetClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(let);\n\t\t\t\t\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(let.Location), QueryLetClause.LetKeywordRole), QueryLetClause.LetKeywordRole);\n\t\t\t\tresult.AddChild(Identifier.Create(let.IntoVariable.Name, Convert(let.IntoVariable.Location)), Roles.Identifier);\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.Assign), Roles.Assign);\n\t\t\t\tif (let.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)let.Expr.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Where where)\n\t\t\t{\n\t\t\t\tvar result = new QueryWhereClause();\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(where.Location), QueryWhereClause.WhereKeywordRole), QueryWhereClause.WhereKeywordRole);\n\t\t\t\tif (where.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)where.Expr.Accept(this), Roles.Condition);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.Join join)\n\t\t\t{\n\t\t\t\tvar result = new QueryJoinClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(join);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(join.Location), QueryJoinClause.JoinKeywordRole), QueryJoinClause.JoinKeywordRole);\n\n\t\t\t\tif (join.IdentifierType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(join.IdentifierType), QueryJoinClause.TypeRole);\n\n\t\t\t\tresult.AddChild(Identifier.Create(join.JoinVariable.Name, Convert(join.JoinVariable.Location)), QueryJoinClause.JoinIdentifierRole);\n\n\t\t\t\tif (join.IdentifierType != null)\n\t\t\t\t\tresult.AddChild(ConvertToType(join.IdentifierType), QueryJoinClause.TypeRole);\n\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), QueryJoinClause.InKeywordRole), QueryJoinClause.InKeywordRole);\n\n\t\t\t\tif (join.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)join.Expr.Accept(this), QueryJoinClause.InExpressionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), QueryJoinClause.OnKeywordRole), QueryJoinClause.OnKeywordRole);\n\t\t\t\t\n\t\t\t\tvar outer = join.OuterSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (outer != null)\n\t\t\t\t\tresult.AddChild((Expression)outer.Expr.Accept(this), QueryJoinClause.OnExpressionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), QueryJoinClause.EqualsKeywordRole), QueryJoinClause.EqualsKeywordRole);\n\t\t\t\t\n\t\t\t\tvar inner = join.InnerSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (inner != null)\n\t\t\t\t\tresult.AddChild((Expression)inner.Expr.Accept(this), QueryJoinClause.EqualsExpressionRole);\n\t\t\t\t\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.GroupJoin groupJoin)\n\t\t\t{\n\t\t\t\tvar result = new QueryJoinClause();\n\t\t\t\tvar location = LocationsBag.GetLocations(groupJoin);\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(groupJoin.Location), QueryJoinClause.JoinKeywordRole), QueryJoinClause.JoinKeywordRole);\n\t\t\t\t\n\t\t\t\t// mcs seems to have swapped IntoVariable with JoinVariable, so we'll swap it back here\n\t\t\t\tresult.AddChild(Identifier.Create(groupJoin.IntoVariable.Name, Convert(groupJoin.IntoVariable.Location)), QueryJoinClause.JoinIdentifierRole);\n\t\t\t\t\n\t\t\t\tif (location != null)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [0]), QueryJoinClause.InKeywordRole), QueryJoinClause.InKeywordRole);\n\n\t\t\t\tif (groupJoin.Expr != null)\n\t\t\t\t\tresult.AddChild((Expression)groupJoin.Expr.Accept(this), QueryJoinClause.InExpressionRole);\n\n\t\t\t\tif (location != null && location.Count > 1)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [1]), QueryJoinClause.OnKeywordRole), QueryJoinClause.OnKeywordRole);\n\n\t\t\t\tvar outer = groupJoin.OuterSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (outer != null)\n\t\t\t\t\tresult.AddChild((Expression)outer.Expr.Accept(this), QueryJoinClause.OnExpressionRole);\n\t\t\t\t\n\n\t\t\t\tif (location != null && location.Count > 2)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [2]), QueryJoinClause.EqualsKeywordRole), QueryJoinClause.EqualsKeywordRole);\n\t\t\t\tvar inner = groupJoin.InnerSelector.Statements.FirstOrDefault() as ContextualReturn;\n\t\t\t\tif (inner != null)\n\t\t\t\t\tresult.AddChild((Expression)inner.Expr.Accept(this), QueryJoinClause.EqualsExpressionRole);\n\t\t\t\t\n\t\t\t\tif (location != null && location.Count > 3)\n\t\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(location [3]), QueryJoinClause.IntoKeywordRole), QueryJoinClause.IntoKeywordRole);\n\t\t\t\t\n\t\t\t\tresult.AddChild(Identifier.Create(groupJoin.JoinVariable.Name, Convert(groupJoin.JoinVariable.Location)), QueryJoinClause.IntoIdentifierRole);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.OrderByAscending orderByAscending)\n\t\t\t{\n\t\t\t\tcurrentQueryOrderClause = new QueryOrderClause();\n\t\t\t\tvar location2 = LocationsBag.GetLocations(orderByAscending.block);\n\t\t\t\tif (location2 != null)\n\t\t\t\t\tcurrentQueryOrderClause.AddChild(new CSharpTokenNode(Convert(location2 [0]), QueryOrderClause.OrderbyKeywordRole), QueryOrderClause.OrderbyKeywordRole);\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (orderByAscending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)orderByAscending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(orderByAscending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Ascending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.AscendingKeywordRole), QueryOrdering.AscendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn currentQueryOrderClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.OrderByDescending orderByDescending)\n\t\t\t{\n\t\t\t\tcurrentQueryOrderClause = new QueryOrderClause();\n\t\t\t\t\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (orderByDescending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)orderByDescending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(orderByDescending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Descending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn currentQueryOrderClause;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.ThenByAscending thenByAscending)\n\t\t\t{\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (thenByAscending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)thenByAscending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(thenByAscending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Ascending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.AscendingKeywordRole), QueryOrdering.AscendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Mono.CSharp.Linq.ThenByDescending thenByDescending)\n\t\t\t{\n\t\t\t\tvar ordering = new QueryOrdering();\n\t\t\t\tif (thenByDescending.Expr != null)\n\t\t\t\t\tordering.AddChild((Expression)thenByDescending.Expr.Accept(this), Roles.Expression);\n\t\t\t\tvar location = LocationsBag.GetLocations(thenByDescending);\n\t\t\t\tif (location != null) {\n\t\t\t\t\tordering.Direction = QueryOrderingDirection.Descending;\n\t\t\t\t\tordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole);\n\t\t\t\t}\n\t\t\t\tcurrentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override object Visit(Await awaitExpr)\n\t\t\t{\n\t\t\t\tvar result = new UnaryOperatorExpression();\n\t\t\t\tresult.Operator = UnaryOperatorType.Await;\n\t\t\t\tresult.AddChild(new CSharpTokenNode(Convert(awaitExpr.Location), UnaryOperatorExpression.AwaitRole), UnaryOperatorExpression.AwaitRole);\n\t\t\t\tif (awaitExpr.Expression != null)\n\t\t\t\t\tresult.AddChild((Expression)awaitExpr.Expression.Accept(this), Roles.Expression);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region XmlDoc\n\n\t\t\tpublic DocumentationReference ConvertXmlDoc(DocumentationBuilder doc)\n\t\t\t{\n\t\t\t\tvar result = new DocumentationReference();\n\t\t\t\tif (doc.ParsedName != null) {\n\t\t\t\t\tif (doc.ParsedName.Name == \"<this>\") {\n\t\t\t\t\t\tresult.SymbolKind = SymbolKind.Indexer;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.MemberName = doc.ParsedName.Name;\n\t\t\t\t\t}\n\t\t\t\t\tif (doc.ParsedName.Left != null) {\n\t\t\t\t\t\tresult.DeclaringType = ConvertToType(doc.ParsedName.Left);\n\t\t\t\t\t} else if (doc.ParsedBuiltinType != null) {\n\t\t\t\t\t\tresult.DeclaringType = ConvertToType(doc.ParsedBuiltinType);\n\t\t\t\t\t}\n\t\t\t\t\tif (doc.ParsedName.TypeParameters != null) {\n\t\t\t\t\t\tfor (int i = 0; i < doc.ParsedName.TypeParameters.Count; i++) {\n\t\t\t\t\t\t\tresult.TypeArguments.Add(ConvertToType(doc.ParsedName.TypeParameters [i]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (doc.ParsedBuiltinType != null) {\n\t\t\t\t\tresult.SymbolKind = SymbolKind.TypeDefinition;\n\t\t\t\t\tresult.DeclaringType = ConvertToType(doc.ParsedBuiltinType);\n\t\t\t\t}\n\t\t\t\tif (doc.ParsedParameters != null) {\n\t\t\t\t\tresult.HasParameterList = true;\n\t\t\t\t\tresult.Parameters.AddRange(doc.ParsedParameters.Select(ConvertXmlDocParameter));\n\t\t\t\t}\n\t\t\t\tif (doc.ParsedOperator != null) {\n\t\t\t\t\tresult.SymbolKind = SymbolKind.Operator;\n\t\t\t\t\tresult.OperatorType = (OperatorType)doc.ParsedOperator;\n\t\t\t\t\tif (result.OperatorType == OperatorType.Implicit || result.OperatorType == OperatorType.Explicit) {\n\t\t\t\t\t\tvar returnTypeParam = result.Parameters.LastOrNullObject();\n\t\t\t\t\t\treturnTypeParam.Remove(); // detach from parameter list\n\t\t\t\t\t\tvar returnType = returnTypeParam.Type;\n\t\t\t\t\t\treturnType.Remove();\n\t\t\t\t\t\tresult.ConversionOperatorReturnType = returnType;\n\t\t\t\t\t}\n\t\t\t\t\tif (result.Parameters.Count == 0) {\n\t\t\t\t\t\t// reset HasParameterList if necessary\n\t\t\t\t\t\tresult.HasParameterList = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tParameterDeclaration ConvertXmlDocParameter(DocumentationParameter p)\n\t\t\t{\n\t\t\t\tvar result = new ParameterDeclaration();\n\t\t\t\tswitch (p.Modifier) {\n\t\t\t\t\tcase Parameter.Modifier.OUT:\n\t\t\t\t\t\tresult.ParameterModifier = ParameterModifier.Out;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Parameter.Modifier.REF:\n\t\t\t\t\t\tresult.ParameterModifier = ParameterModifier.Ref;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Parameter.Modifier.PARAMS:\n\t\t\t\t\t\tresult.ParameterModifier = ParameterModifier.Params;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (p.Type != null) {\n\t\t\t\t\tresult.Type = ConvertToType(p.Type);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t}\n\n\t\tpublic CSharpParser()\n\t\t{\n\t\t\tcompilerSettings = new CompilerSettings();\n\t\t}\n\n\t\tpublic CSharpParser(CompilerSettings args)\n\t\t{\n\t\t\tcompilerSettings = args ?? new CompilerSettings();\n\t\t}\n\n\t\tvoid InsertComments(CompilerCompilationUnit top, ConversionVisitor conversionVisitor)\n\t\t{\n\t\t\tAstNode insertionPoint = conversionVisitor.Unit.FirstChild;\n\t\t\tforeach (var special in top.SpecialsBag.Specials) {\n\t\t\t\tAstNode newLeaf = null;\n\t\t\t\tRole role = null;\n\t\t\t\tbool isDocumentationComment = false;\n\t\t\t\tvar comment = special as SpecialsBag.Comment;\n\t\t\t\tif (comment != null) {\n\t\t\t\t\t// HACK: multiline documentation comment detection; better move this logic into the mcs tokenizer\n\t\t\t\t\tbool isMultilineDocumentationComment = (comment.CommentType == SpecialsBag.CommentType.Multi && comment.Content.StartsWith(\"*\", StringComparison.Ordinal) && !comment.Content.StartsWith(\"**\", StringComparison.Ordinal));\n\t\t\t\t\tisDocumentationComment = comment.CommentType == SpecialsBag.CommentType.Documentation || isMultilineDocumentationComment;\n\t\t\t\t\tif (conversionVisitor.convertTypeSystemMode && !isDocumentationComment)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvar type = isMultilineDocumentationComment ? CommentType.MultiLineDocumentation : (CommentType)comment.CommentType;\n\t\t\t\t\tvar start = new TextLocation(comment.Line, comment.Col);\n\t\t\t\t\tvar end = new TextLocation(comment.EndLine, comment.EndCol);\n\t\t\t\t\tnewLeaf = new Comment(type, start, end) {\n\t\t\t\t\t\tStartsLine = comment.StartsLine,\n\t\t\t\t\t\tContent = isMultilineDocumentationComment ? comment.Content.Substring(1) : comment.Content\n\t\t\t\t\t};\n\t\t\t\t\trole = Roles.Comment;\n\t\t\t\t} else if (!GenerateTypeSystemMode) {\n\t\t\t\t\tvar pragmaDirective = special as SpecialsBag.PragmaPreProcessorDirective;\n\t\t\t\t\tif (pragmaDirective != null) {\n\t\t\t\t\t\tvar pragma = new PragmaWarningPreprocessorDirective(new TextLocation(pragmaDirective.Line, pragmaDirective.Col), new TextLocation(pragmaDirective.EndLine, pragmaDirective.EndCol));\n\t\t\t\t\t\tpragma.AddChild(new CSharpTokenNode(new TextLocation(pragmaDirective.Line, pragmaDirective.Col), PragmaWarningPreprocessorDirective.PragmaKeywordRole), PragmaWarningPreprocessorDirective.PragmaKeywordRole);\n\t\t\t\t\t\tpragma.AddChild(new CSharpTokenNode(new TextLocation(pragmaDirective.Line, pragmaDirective.WarningColumn), PragmaWarningPreprocessorDirective.WarningKeywordRole), PragmaWarningPreprocessorDirective.WarningKeywordRole);\n\t\t\t\t\t\tvar pragmaRole = pragmaDirective.Disalbe ? PragmaWarningPreprocessorDirective.DisableKeywordRole : PragmaWarningPreprocessorDirective.RestoreKeywordRole;\n\t\t\t\t\t\tpragma.AddChild(new CSharpTokenNode(new TextLocation(pragmaDirective.Line, pragmaDirective.DisableRestoreColumn), pragmaRole), pragmaRole);\n\t\t\t\t\t\tforeach (var code in pragmaDirective.Codes) {\n\t\t\t\t\t\t\tpragma.AddChild((PrimitiveExpression)conversionVisitor.Visit(code), PragmaWarningPreprocessorDirective.WarningRole);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewLeaf = pragma;\n\t\t\t\t\t\trole = Roles.PreProcessorDirective;\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\t\tvar lineDirective = special as SpecialsBag.LineProcessorDirective;\n\t\t\t\t\tif (lineDirective != null) {\n\t\t\t\t\t\tvar pragma = new LinePreprocessorDirective(new TextLocation(lineDirective.Line, lineDirective.Col), new TextLocation(lineDirective.EndLine, lineDirective.EndCol));\n\t\t\t\t\t\tpragma.LineNumber = lineDirective.LineNumber;\n\t\t\t\t\t\tpragma.FileName = lineDirective.FileName;\n\t\t\t\t\t\tnewLeaf = pragma;\n\t\t\t\t\t\trole = Roles.PreProcessorDirective;\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\t\tvar directive = special as SpecialsBag.PreProcessorDirective;\n\t\t\t\t\tif (directive != null) {\n\t\t\t\t\t\tnewLeaf = new PreProcessorDirective((PreProcessorDirectiveType)((int)directive.Cmd & 0xF), new TextLocation(directive.Line, directive.Col), new TextLocation(directive.EndLine, directive.EndCol)) {\n\t\t\t\t\t\t\tArgument = directive.Arg,\n\t\t\t\t\t\t\tTake = directive.Take\n\t\t\t\t\t\t};\n\t\t\t\t\t\trole = Roles.PreProcessorDirective;\n\t\t\t\t\t}\n\t\t\t\t\tend:\n\t\t\t\t\t;\n\t\t\t\t}\n\t\t\t\tif (newLeaf != null) {\n\t\t\t\t\tInsertComment(ref insertionPoint, newLeaf, role, isDocumentationComment, conversionVisitor.Unit);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!GenerateTypeSystemMode) {\n\t\t\t\t// We cannot insert newlines in the same loop as comments/preprocessor directives\n\t\t\t\t// because they are not correctly ordered in the specials bag\n\t\t\t\tinsertionPoint = conversionVisitor.Unit.FirstChild;\n\t\t\t\tfor (int i = 0; i < top.SpecialsBag.Specials.Count; i++) {\n\t\t\t\t\tvar newLine = top.SpecialsBag.Specials [i] as SpecialsBag.NewLineToken;\n\t\t\t\t\tif (newLine != null) {\n\t\t\t\t\t\tvar newLeaf = new NewLineNode(new TextLocation(newLine.Line, newLine.Col + 1));\n\t\t\t\t\t\tnewLeaf.NewLineType = newLine.NewLine == SpecialsBag.NewLine.Unix ? UnicodeNewline.LF : UnicodeNewline.CRLF;\n\t\t\t\t\t\tInsertComment(ref insertionPoint, newLeaf, Roles.NewLine, false, conversionVisitor.Unit);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic void InsertComment(ref AstNode insertionPoint, AstNode newNode, Role role, bool isDocumentationComment, AstNode rootNode)\n\t\t{\n\t\t\tTextLocation insertAt = newNode.StartLocation;\n\t\t\t// Advance insertionPoint to the first node that has a start location >= insertAt\n\t\t\twhile (insertionPoint != null && insertionPoint.StartLocation < insertAt) {\n\t\t\t\t// Enter the current node if insertAt is within\n\t\t\t\twhile (insertAt < insertionPoint.EndLocation && insertionPoint.FirstChild != null) {\n\t\t\t\t\tinsertionPoint = insertionPoint.FirstChild;\n\t\t\t\t}\n\t\t\t\t// Go to next node (insertionPoint.NextSibling if it exists; otherwise the next sibling of the parent node etc.)\n\t\t\t\tinsertionPoint = insertionPoint.GetNextNode();\n\t\t\t}\n\t\t\t// As a special case, XmlDoc gets inserted at the beginning of the entity declaration\n\t\t\tif (isDocumentationComment && insertionPoint is EntityDeclaration && insertionPoint.FirstChild != null) {\n\t\t\t\tinsertionPoint = insertionPoint.FirstChild;\n\t\t\t}\n\t\t\tif (insertionPoint == null) {\n\t\t\t\t// we're at the end of the compilation unit\n\t\t\t\trootNode.AddChildUnsafe(newNode, role);\n\t\t\t} else {\n\t\t\t\tinsertionPoint.Parent.InsertChildBeforeUnsafe(insertionPoint, newNode, role);\n\t\t\t}\n\t\t}\n\n\t\tpublic class ErrorReportPrinter : ReportPrinter\n\t\t{\n\t\t\treadonly string fileName;\n\t\t\tpublic readonly List<Error> Errors = new List<Error>();\n\n\t\t\tpublic ErrorReportPrinter(string fileName)\n\t\t\t{\n\t\t\t\tthis.fileName = fileName;\n\t\t\t}\n\n\t\t\tpublic override void Print(AbstractMessage msg, bool showFullPath)\n\t\t\t{\n\t\t\t\tbase.Print(msg, showFullPath);\n\t\t\t\tvar newError = new Error(msg.IsWarning ? ErrorType.Warning : ErrorType.Error, msg.Text, new DomRegion(fileName, msg.Location.Row, msg.Location.Column));\n\t\t\t\tErrors.Add(newError);\n\t\t\t}\n\t\t}\n\n\t\tErrorReportPrinter errorReportPrinter = new ErrorReportPrinter(null);\n\n\t\t[Obsolete(\"Use the Errors/Warnings/ErrorsAndWarnings properties instead\")]\n\t\tpublic ErrorReportPrinter ErrorPrinter {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasErrors {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.ErrorsCount > 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasWarnings {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.WarningsCount > 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Error> Errors {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.Errors.Where(e => e.ErrorType == ErrorType.Error);\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Error> Warnings {\n\t\t\tget {\n\t\t\t\treturn errorReportPrinter.Errors.Where(e => e.ErrorType == ErrorType.Warning);\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<Error> ErrorsAndWarnings {\n\t\t\tget { return errorReportPrinter.Errors; }\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"program\">The source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(string program, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(new StringTextSource(program), fileName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"reader\">The text reader containing the source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(TextReader reader, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(new StringTextSource(reader.ReadToEnd()), fileName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Converts a Mono.CSharp syntax tree into an NRefactory syntax tree.\n\t\t/// </summary>\n\t\tpublic SyntaxTree Parse(CompilerCompilationUnit top, string fileName)\n\t\t{\n\t\t\tif (top == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tCSharpParser.ConversionVisitor conversionVisitor = new ConversionVisitor(GenerateTypeSystemMode, top.LocationsBag);\n\t\t\ttop.ModuleCompiled.Accept(conversionVisitor);\n\t\t\tInsertComments(top, conversionVisitor);\n\t\t\tif (CompilationUnitCallback != null) {\n\t\t\t\tCompilationUnitCallback(top);\n\t\t\t}\n\t\t\tvar expr = top.LastYYValue as Mono.CSharp.Expression;\n\t\t\tif (expr != null)\n\t\t\t\tconversionVisitor.Unit.TopExpression = expr.Accept(conversionVisitor) as AstNode;\n\n\t\t\tconversionVisitor.Unit.FileName = fileName;\n\t\t\tvar conditionals = new List<string>();\n\t\t\tforeach (var settings in compilerSettings.ConditionalSymbols) {\n\t\t\t\tif (top.Conditionals.ContainsKey(settings) && !top.Conditionals [settings])\n\t\t\t\t\tcontinue;\n\t\t\t\tconditionals.Add(settings);\n\t\t\t}\n\t\t\tforeach (var kv in top.Conditionals) {\n\t\t\t\tif (!kv.Value || compilerSettings.ConditionalSymbols.Contains(kv.Key))\n\t\t\t\t\tcontinue;\n\t\t\t\tconditionals.Add(kv.Key);\n\t\t\t}\n\t\t\tconversionVisitor.Unit.ConditionalSymbols = conditionals;\n\t\t\treturn conversionVisitor.Unit;\n\t\t}\n\n\t\tpublic CompilerSettings CompilerSettings {\n\t\t\tget { return compilerSettings; }\n\t\t\tset {\n\t\t\t\tif (value == null)\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\tcompilerSettings = value;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Callback that gets called with the Mono.CSharp syntax tree whenever some code is parsed.\n\t\t/// </summary>\n\t\tpublic Action<CompilerCompilationUnit> CompilationUnitCallback {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Specifies whether to run the parser in a special mode for generating the type system.\n\t\t/// If this property is true, the syntax tree will only contain nodes relevant for the\n\t\t/// <see cref=\"SyntaxTree.ToTypeSystem()\"/> call and might be missing other nodes (e.g. method bodies).\n\t\t/// The default is false.\n\t\t/// </summary>\n\t\tpublic bool GenerateTypeSystemMode {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tTextLocation initialLocation = new TextLocation(1, 1);\n\n\t\t/// <summary>\n\t\t/// Specifies the text location where parsing starts.\n\t\t/// This property can be used when parsing a part of a file to make the locations of the AstNodes\n\t\t/// refer to the position in the whole file.\n\t\t/// The default is (1,1).\n\t\t/// </summary>\n\t\tpublic TextLocation InitialLocation {\n\t\t\tget { return initialLocation; }\n\t\t\tset { initialLocation = value; }\n\t\t}\n\n\t\tinternal static object parseLock = new object();\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"stream\">The stream containing the source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(Stream stream, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(new StreamReader(stream), fileName);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Parses a C# code file.\n\t\t/// </summary>\n\t\t/// <param name=\"program\">The source code to parse.</param>\n\t\t/// <param name=\"fileName\">The file name. Used to identify the file (e.g. when building a type system).\n\t\t/// This can be an arbitrary identifier, NRefactory never tries to access the file on disk.</param>\n\t\t/// <returns>Returns the syntax tree.</returns>\n\t\tpublic SyntaxTree Parse(ITextSource program, string fileName = \"\")\n\t\t{\n\t\t\treturn Parse(program, fileName, initialLocation.Line, initialLocation.Column);\n\t\t}\n\n\t\tSyntaxTree Parse(ITextSource program, string fileName, int initialLine, int initialColumn)\n\t\t{\n\t\t\tlock (parseLock) {\n\t\t\t\terrorReportPrinter = new ErrorReportPrinter(\"\");\n\t\t\t\tvar ctx = new CompilerContext(compilerSettings.ToMono(), errorReportPrinter);\n\t\t\t\tctx.Settings.TabSize = 1;\n\t\t\t\tvar reader = new SeekableStreamReader(program);\n\t\t\t\tvar file = new SourceFile(fileName, fileName, 0);\n\t\t\t\tLocation.Initialize(new List<SourceFile>(new [] { file }));\n\t\t\t\tvar module = new ModuleContainer(ctx);\n\t\t\t\tvar session = new ParserSession();\n\t\t\t\tsession.LocationsBag = new LocationsBag();\n\t\t\t\tvar report = new Report(ctx, errorReportPrinter);\n\t\t\t\tvar parser = Driver.Parse(reader, file, module, session, report, initialLine - 1, initialColumn - 1);\n\t\t\t\tvar top = new CompilerCompilationUnit {\n\t\t\t\t\tModuleCompiled = module,\n\t\t\t\t\tLocationsBag = session.LocationsBag,\n\t\t\t\t\tSpecialsBag = parser.Lexer.sbag,\n\t\t\t\t\tConditionals = parser.Lexer.SourceFile.Conditionals\n\t\t\t\t};\n\t\t\t\tvar unit = Parse(top, fileName);\n\t\t\t\tunit.Errors.AddRange(errorReportPrinter.Errors);\n\t\t\t\tCompilerCallableEntryPoint.Reset();\n\t\t\t\treturn unit;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<EntityDeclaration> ParseTypeMembers(string code)\n\t\t{\n\t\t\treturn ParseTypeMembers(code, initialLocation.Line, initialLocation.Column);\n\t\t}\n\n\t\tIEnumerable<EntityDeclaration> ParseTypeMembers(string code, int initialLine, int initialColumn)\n\t\t{\n\t\t\tconst string prefix = \"unsafe partial class MyClass { \";\n\t\t\tvar syntaxTree = Parse(new StringTextSource(prefix + code + \"}\"), \"parsed.cs\", initialLine, initialColumn - prefix.Length);\n\t\t\tif (syntaxTree == null)\n\t\t\t\treturn Enumerable.Empty<EntityDeclaration>();\n\t\t\tvar td = syntaxTree.FirstChild as TypeDeclaration;\n\t\t\tif (td != null) {\n\t\t\t\tvar members = td.Members.ToArray();\n\t\t\t\t// detach members from parent\n\t\t\t\tforeach (var m in members)\n\t\t\t\t\tm.Remove();\n\t\t\t\treturn members;\n\t\t\t}\n\t\t\treturn Enumerable.Empty<EntityDeclaration>();\n\t\t}\n\n\t\tpublic IEnumerable<Statement> ParseStatements(string code)\n\t\t{\n\t\t\treturn ParseStatements(code, initialLocation.Line, initialLocation.Column);\n\t\t}\n\n\t\tIEnumerable<Statement> ParseStatements(string code, int initialLine, int initialColumn)\n\t\t{\n\t\t\t// the dummy method is async so that 'await' expressions are parsed as expected\n\t\t\tconst string prefix = \"async void M() { \";\n\t\t\tvar members = ParseTypeMembers(prefix + code + \"}\", initialLine, initialColumn - prefix.Length);\n\t\t\tvar method = members.FirstOrDefault() as MethodDeclaration;\n\t\t\tif (method != null && method.Body != null) {\n\t\t\t\tvar statements = method.Body.Statements.ToArray();\n\t\t\t\t// detach statements from parent\n\t\t\t\tforeach (var st in statements)\n\t\t\t\t\tst.Remove();\n\t\t\t\treturn statements;\n\t\t\t}\n\t\t\treturn Enumerable.Empty<Statement>();\n\t\t}\n\n\t\tpublic AstType ParseTypeReference(string code)\n\t\t{\n\t\t\tvar members = ParseTypeMembers(code + \" a;\");\n\t\t\tvar field = members.FirstOrDefault() as FieldDeclaration;\n\t\t\tif (field != null) {\n\t\t\t\tAstType type = field.ReturnType;\n\t\t\t\ttype.Remove();\n\t\t\t\treturn type;\n\t\t\t}\n\t\t\treturn AstType.Null;\n\t\t}\n\n\t\tpublic Expression ParseExpression(string code)\n\t\t{\n\t\t\tconst string prefix = \"tmp = \";\n\t\t\tvar statements = ParseStatements(prefix + code + \";\", initialLocation.Line, initialLocation.Column - prefix.Length);\n\t\t\tvar es = statements.FirstOrDefault() as ExpressionStatement;\n\t\t\tif (es != null) {\n\t\t\t\tvar ae = es.Expression as AssignmentExpression;\n\t\t\t\tif (ae != null) {\n\t\t\t\t\tExpression expr = ae.Right;\n\t\t\t\t\texpr.Remove();\n\t\t\t\t\treturn expr;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Expression.Null;\n\t\t}\n\t\t/*\n\t\t/// <summary>\n\t\t/// Parses a file snippet; guessing what the code snippet represents (whole file, type members, block, type reference, expression).\n\t\t/// </summary>\n\t\tpublic AstNode ParseSnippet (string code)\n\t\t{\n\t\t\t// TODO: add support for parsing a part of a file\n\t\t\tthrow new NotImplementedException ();\n\t\t}\n\t\t*/\n\t\tpublic DocumentationReference ParseDocumentationReference(string cref)\n\t\t{\n\t\t\t// see Mono.CSharp.DocumentationBuilder.HandleXrefCommon\n\t\t\tif (cref == null)\n\t\t\t\tthrow new ArgumentNullException(\"cref\");\n\t\t\t\n\t\t\t// Additional symbols for < and > are allowed for easier XML typing\n\t\t\tcref = cref.Replace('{', '<').Replace('}', '>');\n\t\t\t\n\t\t\tlock (parseLock) {\n\t\t\t\terrorReportPrinter = new ErrorReportPrinter(\"\");\n\t\t\t\tvar ctx = new CompilerContext(compilerSettings.ToMono(), errorReportPrinter);\n\t\t\t\tctx.Settings.TabSize = 1;\n\t\t\t\tvar reader = new SeekableStreamReader(new StringTextSource(cref));\n\t\t\t\tvar file = new SourceFile(\"\", \"\", 0);\n\t\t\t\tLocation.Initialize(new List<SourceFile>(new [] { file }));\n\t\t\t\tvar module = new ModuleContainer(ctx);\n\t\t\t\tmodule.DocumentationBuilder = new DocumentationBuilder(module);\n\t\t\t\tvar source_file = new CompilationSourceFile(module);\n\t\t\t\tvar report = new Report(ctx, errorReportPrinter);\n\t\t\t\tvar session = new ParserSession();\n\t\t\t\tsession.LocationsBag = new LocationsBag();\n\t\t\t\tvar parser = new Mono.CSharp.CSharpParser(reader, source_file, report, session);\n\t\t\t\tparser.Lexer.Line += initialLocation.Line - 1;\n\t\t\t\tparser.Lexer.Column += initialLocation.Column - 1;\n\t\t\t\tparser.Lexer.putback_char = Tokenizer.DocumentationXref;\n\t\t\t\tparser.Lexer.parsing_generic_declaration_doc = true;\n\t\t\t\tparser.parse();\n\t\t\t\tif (report.Errors > 0) {\n//\t\t\t\t\tReport.Warning (1584, 1, mc.Location, \"XML comment on `{0}' has syntactically incorrect cref attribute `{1}'\",\n//\t\t\t\t\t                mc.GetSignatureForError (), cref);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar conversionVisitor = new ConversionVisitor(false, session.LocationsBag);\n\t\t\t\tvar docRef = conversionVisitor.ConvertXmlDoc(module.DocumentationBuilder);\n\t\t\t\tCompilerCallableEntryPoint.Reset();\n\t\t\t\treturn docRef;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/Comments.cs",
    "content": "﻿//\n// Comment.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n\nnamespace Comments\n{\n\t/// <summary>\n\t///     This is a test file for all types of comments.\n\t/// </summary>\n\tclass Comments\n\t{\n\t\t/// <summary>\n\t\t///     Comment method.\n\t\t/// </summary>\n\t\t/// <param name=\"id\">\n\t\t///     Id.\n\t\t/// </param>\n\t\tvoid Comment(int id,      // id\n\t\t             string text) // text\n\t\t{\n\t\t\tint i; // i\n\t\t\t\n\t\t\tfor (i = 0; i < 42 /* 42; */; i++) /*\n\t\t\t* Multi-line \n\t\t\t*/\n\t\t\t{\n\t\t\t\t// break\n\t\t\t\tbreak;\n\t\t\t} // for\n\t\t\t\n\t\t\t/////////*\n\t\t\t\n\t\t\twhile (true)\n\t\t\t\t// comments don't affect continuation\n\t\t\t\t;\n\t\t\t\n\t\t\t/********/ if (false) lock (this)\n\t\t\t\t// /*\n\t\t\t\t;\n\t\t\t\n\t\t\t{ /*/*/ }\n\t\t}\n\t\t/*/ still in comment } */\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/IndentEngine.cs",
    "content": "﻿//\n// IndentEngine.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing ICSharpCode.NRefactory.Editor;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t/// <summary>\n\t///     The indentation engine.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents the context for transitions between <see cref=\"IndentState\"/>.\n\t///     Delegates the responsibility for pushing a new char to the current \n\t///     state and changes between states depending on the pushed chars.\n\t/// </remarks>\n\tpublic class IndentEngine : ICloneable\n\t{\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t///     Document that's parsed by the engine.\n\t\t/// </summary>\n\t\tinternal readonly IDocument Document;\n\n\t\t/// <summary>\n\t\t///     Formatting options.\n\t\t/// </summary>\n\t\tinternal readonly CSharpFormattingOptions Options;\n\n\t\t/// <summary>\n\t\t///     Text editor options.\n\t\t/// </summary>\n\t\tinternal readonly TextEditorOptions TextEditorOptions;\n\n\t\t/// <summary>\n\t\t///     Represents the new line character.\n\t\t/// </summary>\n\t\tpublic char NewLineChar\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn TextEditorOptions.EolMarker.Last();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     The current indentation state.\n\t\t/// </summary>\n\t\tpublic IndentState CurrentState;\n\n\t\t/// <summary>\n\t\t///     The current location of the engine in <see cref=\"Document\"/>.\n\t\t/// </summary>\n\t\tpublic TextLocation Location\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new TextLocation(line, column);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     The current offset of the engine in <see cref=\"Document\"/>.\n\t\t/// </summary>\n\t\tpublic int Offset\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn offset;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     The indentation string of the current line.\n\t\t/// </summary>\n\t\tpublic string ThisLineIndent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn CurrentState.ThisLineIndent.IndentString;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     The indentation string of the next line.\n\t\t/// </summary>\n\t\tpublic string NewLineIndent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn CurrentState.NextLineIndent.IndentString;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     True if the current line needs to be reindented.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     This is set depending on the current <see cref=\"Location\"/> and\n\t\t///     can change its value until the <see cref=\"NewLineChar\"/> char is\n\t\t///     pushed. If this is true, that doesn't necessarily mean that the\n\t\t///     current line has an incorrect indent (this can be determined\n\t\t///     only at the end of the current line and the\n\t\t///     <see cref=\"OnThisLineIndentFinalized\"/> event will be raised.\n\t\t/// </remarks>\n\t\tpublic bool NeedsReindent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn !IsLineStart && (ThisLineIndent != CurrentIndent.ToString());\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Raised when the <see cref=\"NewLineChar\"/> is pushed to the engine\n\t\t///     and <see cref=\"ThisLineIndent\"/> will no longer change.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     This is the only way to correctly get the calculated indent\n\t\t///     since the <see cref=\"ThisLineIndent\"/> is immediately\n\t\t///     replaced with <see cref=\"NewLineIndent\"/> afterwards.\n\t\t/// </remarks>\n\t\tpublic event EventHandler OnThisLineIndentFinalized;\n\n\t\t/// <summary>\n\t\t///     Stores the current indent on the beginning of the current line.\n\t\t/// </summary>\n\t\tpublic StringBuilder CurrentIndent = new StringBuilder();\n\n\t\t/// <summary>\n\t\t///     Stores conditional symbols of the #define directives.\n\t\t/// </summary>\n\t\tpublic HashSet<string> ConditionalSymbols = new HashSet<string>();\n\n\t\t/// <summary>\n\t\t///     True if any of the preprocessor if/elif directives in the current\n\t\t///     block (between #if and #endif) were evaluated to true.\n\t\t/// </summary>\n\t\tpublic bool IfDirectiveEvalResult;\n\n\t\t#endregion\n\n\t\t#region Fields\n\n\t\tinternal int offset = 0;\n\t\tinternal int line = 1;\n\t\tinternal int column = 1;\n\n\t\tpublic bool IsLineStart = true;\n\t\tpublic char CurrentChar = '\\0';\n\t\tpublic char PreviousChar = '\\0';\n\n\t\t#endregion\n\n\t\t#region Constructors\n\n\t\tpublic IndentEngine(IDocument document, TextEditorOptions textEditorOptions, CSharpFormattingOptions formattingOptions)\n\t\t{\n\t\t\tthis.Document = document;\n\t\t\tthis.Options = formattingOptions;\n\t\t\tthis.TextEditorOptions = textEditorOptions;\n\t\t\tthis.CurrentState = IndentStateFactory.Default(this);\n\t\t}\n\n\t\tpublic IndentEngine(IndentEngine prototype)\n\t\t{\n\t\t\tthis.Document = prototype.Document;\n\t\t\tthis.Options = prototype.Options;\n\t\t\tthis.TextEditorOptions = prototype.TextEditorOptions;\n\n\t\t\tthis.CurrentState = prototype.CurrentState.Clone();\n\t\t\tthis.ConditionalSymbols = new HashSet<string>(prototype.ConditionalSymbols);\n\t\t\tthis.IfDirectiveEvalResult = prototype.IfDirectiveEvalResult;\n\t\t\tthis.CurrentIndent = new StringBuilder(prototype.CurrentIndent.ToString());\n\n\t\t\tthis.offset = prototype.offset;\n\t\t\tthis.line = prototype.line;\n\t\t\tthis.column = prototype.column;\n\t\t\tthis.IsLineStart = prototype.IsLineStart;\n\t\t\tthis.CurrentChar = prototype.CurrentChar;\n\t\t\tthis.PreviousChar = prototype.PreviousChar;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IClonable\n\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\tpublic IndentEngine Clone()\n\t\t{\n\t\t\treturn new IndentEngine(this);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Methods\n\n\t\t/// <summary>\n\t\t///     Resets the engine.\n\t\t/// </summary>\n\t\tpublic void Reset()\n\t\t{\n\t\t\tCurrentState = IndentStateFactory.Default(this);\n\t\t\tConditionalSymbols.Clear();\n\t\t\tIfDirectiveEvalResult = false;\n\t\t\tCurrentIndent.Length = 0;\n\n\t\t\toffset = 0;\n\t\t\tline = 1;\n\t\t\tcolumn = 1;\n\t\t\tIsLineStart = true;\n\t\t\tCurrentChar = '\\0';\n\t\t\tPreviousChar = '\\0';\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Calls the <see cref=\"OnThisLineIndentFinalized\"/> event.\n\t\t/// </summary>\n\t\tinternal void ThisLineIndentFinalized()\n\t\t{\n\t\t\tif (OnThisLineIndentFinalized != null)\n\t\t\t{\n\t\t\t\tOnThisLineIndentFinalized(this, EventArgs.Empty);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Pushes a new char into the current state which calculates the new\n\t\t///     indentation level.\n\t\t/// </summary>\n\t\t/// <param name=\"ch\">\n\t\t///     A new character.\n\t\t/// </param>\n\t\tpublic void Push(char ch)\n\t\t{\n\t\t\tCurrentState.Push(CurrentChar = ch);\n\n\t\t\tif (!TextEditorOptions.EolMarker.Contains(ch))\n\t\t\t{\n\t\t\t\tIsLineStart &= char.IsWhiteSpace(ch);\n\n\t\t\t\tif (IsLineStart)\n\t\t\t\t{\n\t\t\t\t\tCurrentIndent.Append(ch);\n\t\t\t\t}\n\n\t\t\t\tif (ch == '\\t')\n\t\t\t\t{\n\t\t\t\t\tvar nextTabStop = (column - 1 + TextEditorOptions.IndentSize) / TextEditorOptions.IndentSize;\n\t\t\t\t\tcolumn = 1 + nextTabStop * TextEditorOptions.IndentSize;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcolumn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (ch != NewLineChar)\n\t\t\t\t{\n\t\t\t\t\t// there can be more than one chars that determine the EOL,\n\t\t\t\t\t// the engine uses only one of them defined with NewLineChar\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tCurrentIndent.Length = 0;\n\t\t\t\tIsLineStart = true;\n\t\t\t\tcolumn = 1;\n\t\t\t\tline++;\n\t\t\t}\n\n\t\t\toffset++;\n\t\t\t// ignore whitespace and newline chars\n\t\t\tif (!char.IsWhiteSpace(CurrentChar) && !TextEditorOptions.EolMarker.Contains(CurrentChar))\n\t\t\t{\n\t\t\t\tPreviousChar = CurrentChar;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Parses the <see cref=\"Document\"/> from <see cref=\"offset\"/>\n\t\t///     to <paramref name=\"toOffset\"/>.\n\t\t/// </summary>\n\t\t/// <param name=\"toOffset\">\n\t\t///     End offset.\n\t\t/// </param>\n\t\tpublic void UpdateToOffset(int toOffset)\n\t\t{\n\t\t\tif (toOffset < offset)\n\t\t\t{\n\t\t\t\tReset();\n\t\t\t}\n\n\t\t\tfor (int i = offset; i < toOffset; i++)\n\t\t\t{\n\t\t\t\tPush(Document.GetCharAt(i));\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/IndentState.cs",
    "content": "﻿//\n// IndentState.cs\n//\n// Author:\n//       Matej Miklečić <matej.miklecic@gmail.com>\n//\n// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.CSharp\n{\n\t#region IndentState\n\n\t/// <summary>\n\t///     The base class for all indentation states. \n\t///     Each state defines the logic for indentation based on chars that\n\t///     are pushed to it.\n\t/// </summary>\n\tpublic abstract class IndentState : ICloneable\n\t{\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t///     The indentation engine using this state.\n\t\t/// </summary>\n\t\tpublic IndentEngine Engine;\n\n\t\t/// <summary>\n\t\t///     The parent state. \n\t\t///     This state can use the indentation levels of its parent.\n\t\t///     When this state exits, the engine returns to the parent.\n\t\t/// </summary>\n\t\tpublic IndentState Parent;\n\n\t\t/// <summary>\n\t\t///     The indentation of the current line.\n\t\t///     This is set when the state is created and will be changed to\n\t\t///     <see cref=\"NextLineIndent\"/> when the <see cref=\"IndentEngine.NewLineChar\"/> \n\t\t///     is pushed.\n\t\t/// </summary>\n\t\tpublic Indent ThisLineIndent;\n\n\t\t/// <summary>\n\t\t///     The indentation of the next line.\n\t\t///     This is set when the state is created and can change depending\n\t\t///     on the pushed chars.\n\t\t/// </summary>\n\t\tpublic Indent NextLineIndent;\n\n\t\t/// <summary>\n\t\t///     Stores the last sequence of characters that can form a\n\t\t///     valid keyword or variable name.\n\t\t/// </summary>\n\t\tpublic StringBuilder WordToken;\n\n\t\t#endregion\n\n\t\t#region Constructors\n\n\t\t/// <summary>\n\t\t///     Creates a new indentation state.\n\t\t/// </summary>\n\t\t/// <param name=\"engine\">\n\t\t///     The indentation engine that uses this state.\n\t\t/// </param>\n\t\t/// <param name=\"parent\">\n\t\t///     The parent state, or null if this state doesn't have one ->\n\t\t///         e.g. the state represents the global space.\n\t\t/// </param>\n\t\tprotected IndentState(IndentEngine engine, IndentState parent = null)\n\t\t{\n\t\t\tWordToken = new StringBuilder();\n\n\t\t\tParent = parent;\n\t\t\tEngine = engine;\n\n\t\t\tInitializeState();\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Creates a new indentation state that is a copy of the given\n\t\t///     prototype.\n\t\t/// </summary>\n\t\t/// <param name=\"prototype\">\n\t\t///     The prototype state.\n\t\t/// </param>\n\t\tprotected IndentState(IndentState prototype)\n\t\t{\n\t\t\tEngine = prototype.Engine;\n\t\t\tParent = prototype.Parent.Clone();\n\n\t\t\tWordToken = new StringBuilder(prototype.WordToken.ToString());\n\t\t\tThisLineIndent = prototype.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = prototype.NextLineIndent.Clone();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IClonable\n\n\t\tobject ICloneable.Clone()\n\t\t{\n\t\t\treturn Clone();\n\t\t}\n\n\t\tpublic abstract IndentState Clone();\n\n\t\t#endregion\n\n\t\t#region Methods\n\n\t\t/// <summary>\n\t\t///     Initializes the state:\n\t\t///       - sets the default indentation levels.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     Each state can override this method if it needs a different\n\t\t///     logic for setting up the default indentations.\n\t\t/// </remarks>\n\t\tpublic virtual void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = new Indent(Engine.TextEditorOptions);\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Actions performed when this state exits.\n\t\t/// </summary>\n\t\tpublic virtual void OnExit()\n\t\t{\n\t\t\t// if a state exits on the newline character, it has to push\n\t\t\t// it back to its parent (and so on recursively if the parent \n\t\t\t// state also exits). Otherwise, the parent state wouldn't\n\t\t\t// know that the engine isn't on the same line anymore.\n\t\t\tif (Engine.CurrentChar == Engine.NewLineChar)\n\t\t\t{\n\t\t\t\tParent.Push(Engine.NewLineChar);\n\t\t\t}\n\n\t\t\t// when a state exits the engine stays on the same line and this\n\t\t\t// state has to adjust the current indent of its parent so that \n\t\t\t// it's equal to this line indent.\n\t\t\tParent.ThisLineIndent = ThisLineIndent.Clone();\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Changes the current state of the <see cref=\"IndentEngine\"/> using the current\n\t\t///     state as the parent for the new one.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">\n\t\t///     The type of the new state. Must be assignable from <see cref=\"IndentState\"/>.\n\t\t/// </typeparam>\n\t\tpublic void ChangeState<T>()\n\t\t\twhere T : IndentState\n\t\t{\n\t\t\tEngine.CurrentState = IndentStateFactory.Create<T>(Engine.CurrentState);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Exits this state by setting the current state of the\n\t\t///     <see cref=\"IndentEngine\"/> to this state's parent.\n\t\t/// </summary>\n\t\tpublic void ExitState()\n\t\t{\n\t\t\tOnExit();\n\t\t\tEngine.CurrentState = Engine.CurrentState.Parent;\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Common logic behind the push method.\n\t\t///     Each state can override this method and implement its own logic.\n\t\t/// </summary>\n\t\t/// <param name=\"ch\">\n\t\t///     The current character that's being pushed.\n\t\t/// </param>\n\t\tpublic virtual void Push(char ch)\n\t\t{\n\t\t\t// append this char to the wordbuf if it can form a valid keyword, otherwise check\n\t\t\t// if the last sequence of chars form a valid keyword and reset the wordbuf.\n\t\t\tif ((WordToken.Length == 0 ? char.IsLetter(ch) : char.IsLetterOrDigit(ch)) || ch == '_')\n\t\t\t{\n\t\t\t\tWordToken.Append(ch);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tCheckKeyword(WordToken.ToString());\n\t\t\t\tWordToken.Length = 0;\n\t\t\t}\n\n\t\t\tif (ch == Engine.NewLineChar)\n\t\t\t{\n\t\t\t\tif (Engine.IsLineStart && !Engine.TextEditorOptions.IndentBlankLines)\n\t\t\t\t{\n\t\t\t\t\tThisLineIndent = new Indent(Engine.TextEditorOptions);\n\t\t\t\t}\n\n\t\t\t\tif (Engine.CurrentState == this)\n\t\t\t\t{\n\t\t\t\t\t// if we got this far, the current line indent becomes permanent,\n\t\t\t\t\t// it's replaced with the next line indent and we can raise an\n\t\t\t\t\t// event that can perform text-replace actions on the document.\n\t\t\t\t\t// NOTE: It's possible that multiple states will execute its push\n\t\t\t\t\t// methods on the same newline char, but only the current state of\n\t\t\t\t\t// the engine should raise this event. See the OnExit method for\n\t\t\t\t\t// an example when this will happen.\n\t\t\t\t\tEngine.ThisLineIndentFinalized();\n\t\t\t\t}\n\n\t\t\t\tThisLineIndent = NextLineIndent.Clone();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     When derived, checks if the given sequence of chars form\n\t\t///     a valid keyword or variable name, depending on the state.\n\t\t/// </summary>\n\t\t/// <param name=\"keyword\">\n\t\t///     A possible keyword.\n\t\t/// </param>\n\t\tpublic virtual void CheckKeyword(string keyword)\n\t\t{ }\n\n\t\t#endregion\n\t}\n\n\t#endregion\n\n\t#region IndentStateFactory\n\n\t/// <summary>\n\t///     Indentation state factory.\n\t/// </summary>\n\tpublic static class IndentStateFactory\n\t{\n\t\t/// <summary>\n\t\t///     Creates a new state.\n\t\t/// </summary>\n\t\t/// <param name=\"stateType\">\n\t\t///     Type of the state. Must be assignable from <see cref=\"IndentState\"/>.\n\t\t/// </param>\n\t\t/// <param name=\"engine\">\n\t\t///     Indentation engine for the state.\n\t\t/// </param>\n\t\t/// <param name=\"parent\">\n\t\t///     Parent state.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t///     A new state of type <paramref name=\"stateType\"/>.\n\t\t/// </returns>\n\t\tstatic IndentState Create(Type stateType, IndentEngine engine, IndentState parent = null)\n\t\t{\n\t\t\treturn (IndentState)Activator.CreateInstance(stateType, engine, parent);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Creates a new state.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">\n\t\t///     Type of the state. Must be assignable from <see cref=\"IndentState\"/>.\n\t\t/// </typeparam>\n\t\t/// <param name=\"engine\">\n\t\t///     Indentation engine for the state.\n\t\t/// </param>\n\t\t/// <param name=\"parent\">\n\t\t///     Parent state.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t///     A new state of type <typeparamref name=\"T\"/>.\n\t\t/// </returns>\n\t\tpublic static IndentState Create<T>(IndentEngine engine, IndentState parent = null)\n\t\t\twhere T : IndentState\n\t\t{\n\t\t\treturn Create(typeof(T), engine, parent);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Creates a new state.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"T\">\n\t\t///     Type of the state. Must be assignable from <see cref=\"IndentState\"/>.\n\t\t/// </typeparam>\n\t\t/// <param name=\"prototype\">\n\t\t///     Parent state. Also, the indentation engine of the prototype is\n\t\t///     used as the engine for the new state.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t///     A new state of type <typeparamref name=\"T\"/>.\n\t\t/// </returns>\n\t\tpublic static IndentState Create<T>(IndentState prototype)\n\t\t\twhere T : IndentState\n\t\t{\n\t\t\treturn Create(typeof(T), prototype.Engine, prototype);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     The default state, used for the global space.\n\t\t/// </summary>\n\t\tpublic static Func<IndentEngine, IndentState> Default = engine => Create<GlobalBodyState>(engine);\n\t}\n\n\t#endregion\n\n\t#region Null state\n\n\t/// <summary>\n\t///     Null state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Doesn't define any transitions to new states.\n\t/// </remarks>\n\tpublic class NullState : IndentState\n\t{\n\t\tpublic NullState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic NullState(NullState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{ }\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new NullState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Brackets body states\n\n\t#region Brackets body base\n\n\t/// <summary>\n\t///     The base for all brackets body states.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between a pair of brackets.\n\t/// </remarks>\n\tpublic abstract class BracketsBodyBaseState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     Defines transitions for all types of open brackets.\n\t\t/// </summary>\n\t\tpublic static Dictionary<char, Action<IndentState>> OpenBrackets =\n\t\t\tnew Dictionary<char, Action<IndentState>>\n\t\t{ \n\t\t\t{ '{', state => state.ChangeState<BracesBodyState>() }, \n\t\t\t{ '(', state => state.ChangeState<ParenthesesBodyState>() }, \n\t\t\t{ '[', state => state.ChangeState<SquareBracketsBodyState>() },\n\t\t\t// since the '<' char is also used as the 'less-than' operator,\n\t\t\t// until the logic for distinguishing this two cases is implemented\n\t\t\t// this state must not define this next transition.\n\t\t\t// { '<', state => state.ChangeState<AngleBracketsBody>() }\n\t\t};\n\n\t\t/// <summary>\n\t\t///     When derived in a concrete bracket body state, represents\n\t\t///     the closed bracket character pair.\n\t\t/// </summary>\n\t\tpublic abstract char ClosedBracket { get; }\n\n\t\tprotected BracketsBodyBaseState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tprotected BracketsBodyBaseState(BracketsBodyBaseState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == '#' && Engine.IsLineStart)\n\t\t\t{\n\t\t\t\tChangeState<PreProcessorState>();\n\t\t\t}\n\t\t\telse if (ch == '/' && Engine.PreviousChar == '/')\n\t\t\t{\n\t\t\t\tChangeState<LineCommentState>();\n\t\t\t}\n\t\t\telse if (ch == '*' && Engine.PreviousChar == '/')\n\t\t\t{\n\t\t\t\tChangeState<MultiLineCommentState>();\n\t\t\t}\n\t\t\telse if (ch == '\"')\n\t\t\t{\n\t\t\t\tif (Engine.PreviousChar == '@')\n\t\t\t\t{\n\t\t\t\t\tChangeState<VerbatimStringState>();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tChangeState<StringLiteralState>();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (ch == '\\'')\n\t\t\t{\n\t\t\t\tChangeState<CharacterState>();\n\t\t\t}\n\t\t\telse if (OpenBrackets.ContainsKey(ch))\n\t\t\t{\n\t\t\t\tOpenBrackets[ch](this);\n\t\t\t}\n\t\t\telse if (ch == ClosedBracket)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Global body state\n\n\t/// <summary>\n\t///     Global body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents the global space of the program.\n\t/// </remarks>\n\tpublic class GlobalBodyState : BracketsBodyBaseState\n\t{\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return '\\0'; }\n\t\t}\n\n\t\tpublic GlobalBodyState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic GlobalBodyState(GlobalBodyState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new GlobalBodyState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Braces body state\n\n\t/// <summary>\n\t///     Braces body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between { and }.\n\t/// </remarks>\n\tpublic class BracesBodyState : BracketsBodyBaseState\n\t{\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return '}'; }\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Type of the current block body.\n\t\t/// </summary>\n\t\tpublic Body CurrentBody;\n\n\t\t/// <summary>\n\t\t///     Type of the next block body.\n\t\t///     Same as <see cref=\"CurrentBody\"/> if none of the\n\t\t///     <see cref=\"Body\"/> keywords have been read.\n\t\t/// </summary>\n\t\tpublic Body NextBody;\n\n\t\t/// <summary>\n\t\t///     Type of the current statement.\n\t\t/// </summary>\n\t\tpublic Statement CurrentStatement;\n\n\t\t/// <summary>\n\t\t///     True if the '=' char has been pushed.\n\t\t/// </summary>\n\t\tpublic bool IsRightHandExpression;\n\n\t\tpublic BracesBodyState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{\n\t\t\tCurrentBody = NextBody = BracesBodyState.extractBody(Parent);\n\t\t\tCurrentStatement = Statement.None;\n\t\t}\n\n\t\tpublic BracesBodyState(BracesBodyState prototype)\n\t\t\t: base(prototype)\n\t\t{\n\t\t\tCurrentBody = prototype.CurrentBody;\n\t\t\tNextBody = prototype.NextBody;\n\t\t\tCurrentStatement = prototype.CurrentStatement;\n\t\t\tIsRightHandExpression = prototype.IsRightHandExpression;\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Extracts the <see cref=\"CurrentBody\"/> from the given state.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t///     The correct <see cref=\"Body\"/> type for this state.\n\t\t/// </returns>\n\t\tstatic Body extractBody(IndentState state)\n\t\t{\n\t\t\tif (state != null && state is BracesBodyState)\n\t\t\t{\n\t\t\t\treturn ((BracesBodyState)state).NextBody;\n\t\t\t}\n\n\t\t\treturn Body.None;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tif (ch == ':' && Engine.IsLineStart)\n\t\t\t{\n\t\t\t\tThisLineIndent.Push(IndentType.Continuation);\n\t\t\t}\n\n\t\t\tif (ch == ';' || ch == ':')\n\t\t\t{\n\t\t\t\twhile (NextLineIndent.Count > 0 && NextLineIndent.Peek() == IndentType.Continuation)\n\t\t\t\t{\n\t\t\t\t\tNextLineIndent.Pop();\n\t\t\t\t}\n\t\t\t\tNextLineIndent.ExtraSpaces = 0;\n\t\t\t\tIsRightHandExpression = false;\n\t\t\t}\n\t\t\telse if (ch == '=' && !IsRightHandExpression)\n\t\t\t{\n\t\t\t\tIsRightHandExpression = true;\n\t\t\t\tNextLineIndent.ExtraSpaces = Engine.column - NextLineIndent.CurIndent + 1;\n\t\t\t}\n\t\t\telse if (ch == '.' && IsRightHandExpression)\n\t\t\t{\n\t\t\t\tNextLineIndent.ExtraSpaces = Engine.column - NextLineIndent.CurIndent - 1;\n\t\t\t}\n\t\t\telse if (ch == Engine.NewLineChar && NextLineIndent.ExtraSpaces > 0 &&\n\t\t\t         (Engine.PreviousChar == '=' || Engine.PreviousChar == '.'))\n\t\t\t{\n\t\t\t\t// the last significant pushed char was '=' or '.' and we added\n\t\t\t\t// extra spaces to align the next line, but the newline char was\n\t\t\t\t// pushed afterwards so it's better to replace the extra spaces\n\t\t\t\t// with one continuation indent.\n\t\t\t\tNextLineIndent.ExtraSpaces = 0;\n\t\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t\t}\n\t\t\telse if (ch == ClosedBracket && Engine.IsLineStart)\n\t\t\t{\n\t\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\t}\n\n\t\t\tbase.Push(ch);\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\t// remove all continuations and extra spaces from the previous state\n\t\t\tParent.ThisLineIndent.ExtraSpaces = 0;\n\t\t\tParent.NextLineIndent.ExtraSpaces = 0;\n\t\t\tif (Parent.NextLineIndent.Count > 0 && Parent.NextLineIndent.Peek() == IndentType.Continuation)\n\t\t\t{\n\t\t\t\tParent.NextLineIndent.Pop();\n\t\t\t\tParent.ThisLineIndent = Parent.NextLineIndent.Clone();\n\t\t\t}\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\tAddIndentation(CurrentBody);\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new BracesBodyState(this);\n\t\t}\n\n\t\t#region Helpers\n\n\t\t/// <summary>\n\t\t///     Types of braces bodies.\n\t\t/// </summary>\n\t\tpublic enum Body\n\t\t{\n\t\t\tNone,\n\t\t\tNamespace,\n\t\t\tClass,\n\t\t\tStruct,\n\t\t\tInterface,\n\t\t\tEnum,\n\t\t\tSwitch,\n\t\t\tCase\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Types of statements.\n\t\t/// </summary>\n\t\tpublic enum Statement\n\t\t{\n\t\t\tNone,\n\t\t\tIf,\n\t\t\tElse,\n\t\t\tDo,\n\t\t\tWhile,\n\t\t\tFor,\n\t\t\tForeach,\n\t\t\tLock,\n\t\t\tUsing\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Checks if the given string is a keyword and sets the\n\t\t///     <see cref=\"NextBody\"/> and the <see cref=\"CurrentStatement\"/>\n\t\t///     variables appropriately.\n\t\t/// </summary>\n\t\t/// <param name=\"keyword\">\n\t\t///     A possible keyword.\n\t\t/// </param>\n\t\tpublic override void CheckKeyword(string keyword)\n\t\t{\n\t\t\tvar blocks = new Dictionary<string, Body>\n\t\t\t{\n\t\t\t\t{ \"namespace\", Body.Namespace },\n\t\t\t\t{ \"class\", Body.Class },\n\t\t\t\t{ \"struct\", Body.Struct },\n\t\t\t\t{ \"interface\", Body.Interface },\n\t\t\t\t{ \"enum\", Body.Enum },\n\t\t\t\t{ \"switch\", Body.Switch },\n\t\t\t};\n\n\t\t\tvar statements = new Dictionary<string, Statement>\n\t\t\t{\n\t\t\t\t{ \"if\", Statement.If },\n\t\t\t\t{ \"else\", Statement.Else },\n\t\t\t\t{ \"do\", Statement.Do },\n\t\t\t\t{ \"while\", Statement.While },\n\t\t\t\t{ \"for\", Statement.For },\n\t\t\t\t{ \"foreach\", Statement.Foreach },\n\t\t\t\t{ \"lock\", Statement.Lock },\n\t\t\t\t{ \"using\", Statement.Using },\n\t\t\t};\n\n\t\t\tif (blocks.ContainsKey(keyword))\n\t\t\t{\n\t\t\t\tNextBody = blocks[keyword];\n\t\t\t}\n\t\t\telse if (new string[] { \"case\", \"default\" }.Contains(keyword) && NextBody == Body.Switch)\n\t\t\t{\n\t\t\t\tChangeState<SwitchCaseState>();\n\t\t\t}\n\t\t\telse if (keyword == \"where\" && !IsRightHandExpression)\n\t\t\t{\n\t\t\t\tThisLineIndent.Push(IndentType.Continuation);\n\t\t\t}\n\t\t\telse if (statements.ContainsKey(keyword))\n\t\t\t{\n\t\t\t\t// only add continuation for 'else' in 'else if' statement.\n\t\t\t\tif (!(statements[keyword] == Statement.If && CurrentStatement == Statement.Else))\n\t\t\t\t{\n\t\t\t\t\tNextLineIndent.Push(IndentType.Continuation);\n\t\t\t\t}\n\t\t\t\tCurrentStatement = statements[keyword];\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Pushes a new level of indentation depending on the given\n\t\t///     <paramref name=\"braceStyle\"/>.\n\t\t/// </summary>\n\t\tvoid AddIndentation(BraceStyle braceStyle)\n\t\t{\n\t\t\tswitch (braceStyle)\n\t\t\t{\n\t\t\t\tcase BraceStyle.DoNotChange:\n\t\t\t\tcase BraceStyle.EndOfLine:\n\t\t\t\tcase BraceStyle.EndOfLineWithoutSpace:\n\t\t\t\tcase BraceStyle.NextLine:\n\t\t\t\tcase BraceStyle.NextLineShifted:\n\t\t\t\tcase BraceStyle.BannerStyle:\n\t\t\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t\t\t\tbreak;\n\t\t\t\tcase BraceStyle.NextLineShifted2:\n\t\t\t\t\tNextLineIndent.Push(IndentType.DoubleBlock);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Pushes a new level of indentation depending on the given\n\t\t///     <paramref name=\"body\"/>.\n\t\t/// </summary>\n\t\tvoid AddIndentation(Body body)\n\t\t{\n\t\t\tswitch (body)\n\t\t\t{\n\t\t\t\tcase Body.None:\n\t\t\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Body.Namespace:\n\t\t\t\t\tAddIndentation(Engine.Options.NamespaceBraceStyle);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Body.Class:\n\t\t\t\t\tAddIndentation(Engine.Options.ClassBraceStyle);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Body.Struct:\n\t\t\t\t\tAddIndentation(Engine.Options.StructBraceStyle);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Body.Interface:\n\t\t\t\t\tAddIndentation(Engine.Options.InterfaceBraceStyle);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Body.Enum:\n\t\t\t\t\tAddIndentation(Engine.Options.EnumBraceStyle);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Body.Switch:\n\t\t\t\t\tif (Engine.Options.IndentSwitchBody)\n\t\t\t\t\t\tNextLineIndent.Push(IndentType.Empty);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t#endregion\n\n\t#region Switch-case body state\n\n\t/// <summary>\n\t///     Switch-case statement state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents the block of code in one switch case (including default).\n\t/// </remarks>\n\tpublic class SwitchCaseState : BracesBodyState\n\t{\n\t\tpublic SwitchCaseState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic SwitchCaseState(SwitchCaseState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tif (ch == ClosedBracket)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\n\t\t\tbase.Push(ch);\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\n\t\t\t// remove all continuations and extra spaces from this line indent\n\t\t\tThisLineIndent.ExtraSpaces = 0;\n\t\t\tif (ThisLineIndent.Count > 0 && ThisLineIndent.Peek() == IndentType.Continuation)\n\t\t\t{\n\t\t\t\tThisLineIndent.Pop();\n\t\t\t}\n\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\tNextLineIndent.Push(IndentType.Block);\n\t\t}\n\n\t\tpublic override void CheckKeyword(string keyword)\n\t\t{\n\t\t\tif (new string[] { \"case\", \"default\" }.Contains(keyword))\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\n\t\t\tbase.CheckKeyword(keyword);\n\t\t}\n\n\t\tpublic override void OnExit()\n\t\t{ }\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new SwitchCaseState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Parentheses body state\n\n\t/// <summary>\n\t///     Parentheses body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between ( and ).\n\t/// </remarks>\n\tpublic class ParenthesesBodyState : BracketsBodyBaseState\n\t{\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return ')'; }\n\t\t}\n\n\t\tpublic ParenthesesBodyState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic ParenthesesBodyState(ParenthesesBodyState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t// align the next line at the beginning of the open bracket\n\t\t\tNextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent);\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new ParenthesesBodyState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Square brackets body state\n\n\t/// <summary>\n\t///     Square brackets body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between [ and ].\n\t/// </remarks>\n\tpublic class SquareBracketsBodyState : BracketsBodyBaseState\n\t{\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return ']'; }\n\t\t}\n\n\t\tpublic SquareBracketsBodyState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic SquareBracketsBodyState(SquareBracketsBodyState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t// align the next line at the beginning of the open bracket\n\t\t\tNextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent);\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new SquareBracketsBodyState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Angle brackets body state\n\n\t/// <summary>\n\t///     Angle brackets body state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Represents a block of code between < and >.\n\t/// </remarks>\n\tpublic class AngleBracketsBodyState : BracketsBodyBaseState\n\t{\n\t\tpublic override char ClosedBracket\n\t\t{\n\t\t\tget { return '>'; }\n\t\t}\n\n\t\tpublic AngleBracketsBodyState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic AngleBracketsBodyState(AngleBracketsBodyState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t// align the next line at the beginning of the open bracket\n\t\t\tNextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent);\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new AngleBracketsBodyState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#endregion\n\n\t#region PreProcessor state\n\n\t/// <summary>\n\t///     PreProcessor directive state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Activated when the '#' char is pushed and the \n\t///     <see cref=\"IndentEngine.IsLineStart\"/> is true.\n\t/// </remarks>\n\tpublic class PreProcessorState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     The type of the preprocessor directive.\n\t\t/// </summary>\n\t\tpublic PreProcessorDirective DirectiveType;\n\n\t\t/// <summary>\n\t\t///     If <see cref=\"DirectiveType\"/> is set (not equal to 'None'), this\n\t\t///     stores the expression of the directive.\n\t\t/// </summary>\n\t\tpublic StringBuilder DirectiveStatement;\n\n\t\tpublic PreProcessorState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{\n\t\t\tDirectiveType = PreProcessorDirective.None;\n\t\t\tDirectiveStatement = new StringBuilder();\n\t\t}\n\n\t\tpublic PreProcessorState(PreProcessorState prototype)\n\t\t\t: base(prototype)\n\t\t{\n\t\t\tDirectiveType = prototype.DirectiveType;\n\t\t\tDirectiveStatement = new StringBuilder(prototype.DirectiveStatement.ToString());\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (DirectiveType != PreProcessorDirective.None)\n\t\t\t{\n\t\t\t\tDirectiveStatement.Append(ch);\n\t\t\t}\n\n\t\t\tif (ch == Engine.NewLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\n\t\t\t\tswitch (DirectiveType)\n\t\t\t\t{\n\t\t\t\t\tcase PreProcessorDirective.If:\n\t\t\t\t\t\tif (!Engine.IfDirectiveEvalResult)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEngine.IfDirectiveEvalResult = eval(DirectiveStatement.ToString());\n\t\t\t\t\t\t\tif (Engine.IfDirectiveEvalResult)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// the if/elif directive is true -> continue with the previous state\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// the if/elif directive is false -> change to a state that will \n\t\t\t\t\t\t\t\t// ignore any chars until #endif or #elif\n\t\t\t\t\t\t\t\tChangeState<PreProcessorCommentState>();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// one of the if/elif directives in this block was true -> \n\t\t\t\t\t\t\t// change to a state that will ignore any chars until #endif\n\t\t\t\t\t\t\tChangeState<PreProcessorCommentState>();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Else:\n\t\t\t\t\t\tif (Engine.IfDirectiveEvalResult)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// some if/elif directive was true -> change to a state that will \n\t\t\t\t\t\t\t// ignore any chars until #endif\n\t\t\t\t\t\t\tChangeState<PreProcessorCommentState>();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// none if/elif directives were true -> continue with the previous state\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Define:\n\t\t\t\t\t\tvar defineSymbol = DirectiveStatement.ToString().Trim();\n\t\t\t\t\t\tif (!Engine.ConditionalSymbols.Contains(defineSymbol))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEngine.ConditionalSymbols.Add(defineSymbol);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Undef:\n\t\t\t\t\t\tvar undefineSymbol = DirectiveStatement.ToString().Trim();\n\t\t\t\t\t\tif (Engine.ConditionalSymbols.Contains(undefineSymbol))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEngine.ConditionalSymbols.Remove(undefineSymbol);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Endif:\n\t\t\t\t\t\t// marks the end of this block\n\t\t\t\t\t\tEngine.IfDirectiveEvalResult = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PreProcessorDirective.Region:\n\t\t\t\t\tcase PreProcessorDirective.Pragma:\n\t\t\t\t\tcase PreProcessorDirective.Warning:\n\t\t\t\t\tcase PreProcessorDirective.Error:\n\t\t\t\t\tcase PreProcessorDirective.Line:\n\t\t\t\t\t\t// continue with the previous state\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tif (Engine.Options.IndentPreprocessorStatements)\n\t\t\t{\n\t\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tThisLineIndent = new Indent(Engine.TextEditorOptions);\n\t\t\t}\n\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override void CheckKeyword(string keyword)\n\t\t{\n\t\t\tif (DirectiveType != PreProcessorDirective.None)\n\t\t\t{\n\t\t\t\t// the directive type has already been set\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar preProcessorDirectives = new Dictionary<string, PreProcessorDirective>\n\t\t\t{\n\t\t\t\t{ \"if\", PreProcessorDirective.If },\n\t\t\t\t{ \"elif\", PreProcessorDirective.If },\n\t\t\t\t{ \"else\", PreProcessorDirective.Else },\n\t\t\t\t{ \"endif\", PreProcessorDirective.Endif },\n\t\t\t\t{ \"region\", PreProcessorDirective.Region },\n\t\t\t\t{ \"endregion\", PreProcessorDirective.Region },\n\t\t\t\t{ \"pragma\", PreProcessorDirective.Pragma },\n\t\t\t\t{ \"warning\", PreProcessorDirective.Warning },\n\t\t\t\t{ \"error\", PreProcessorDirective.Error },\n\t\t\t\t{ \"line\", PreProcessorDirective.Line },\n\t\t\t\t{ \"define\", PreProcessorDirective.Define },\n\t\t\t\t{ \"undef\", PreProcessorDirective.Undef }\n\t\t\t};\n\n\t\t\tif (preProcessorDirectives.ContainsKey(keyword))\n\t\t\t{\n\t\t\t\tDirectiveType = preProcessorDirectives[keyword];\n\n\t\t\t\tif (DirectiveType == PreProcessorDirective.Region)\n\t\t\t\t{\n\t\t\t\t\t// adjust the indentation for the region/endregion directives\n\t\t\t\t\tThisLineIndent = Parent.NextLineIndent.Clone();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new PreProcessorState(this);\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Types of preprocessor directives.\n\t\t/// </summary>\n\t\tpublic enum PreProcessorDirective\n\t\t{\n\t\t\tNone,\n\t\t\tIf,\n\t\t\t// Elif, // use If instead\n\t\t\tElse,\n\t\t\tEndif,\n\t\t\tRegion,\n\t\t\t// EndRegion, // use Region instead\n\t\t\tPragma,\n\t\t\tWarning,\n\t\t\tError,\n\t\t\tLine,\n\t\t\tDefine,\n\t\t\tUndef\n\t\t}\n\n\t\t#region Pre processor evaluation (from cs-tokenizer.cs)\n\n\t\tstatic bool is_identifier_start_character(int c)\n\t\t{\n\t\t\treturn (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || Char.IsLetter((char)c);\n\t\t}\n\n\t\tstatic bool is_identifier_part_character(char c)\n\t\t{\n\t\t\tif (c >= 'a' && c <= 'z')\n\t\t\t\treturn true;\n\n\t\t\tif (c >= 'A' && c <= 'Z')\n\t\t\t\treturn true;\n\n\t\t\tif (c == '_' || (c >= '0' && c <= '9'))\n\t\t\t\treturn true;\n\n\t\t\tif (c < 0x80)\n\t\t\t\treturn false;\n\n\t\t\treturn Char.IsLetter(c) || Char.GetUnicodeCategory(c) == UnicodeCategory.ConnectorPunctuation;\n\t\t}\n\n\t\tbool eval_val(string s)\n\t\t{\n\t\t\tif (s == \"true\")\n\t\t\t\treturn true;\n\t\t\tif (s == \"false\")\n\t\t\t\treturn false;\n\n\t\t\treturn Engine.ConditionalSymbols != null && Engine.ConditionalSymbols.Contains(s);\n\t\t}\n\n\t\tbool pp_primary(ref string s)\n\t\t{\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tchar c = s[0];\n\n\t\t\t\tif (c == '(')\n\t\t\t\t{\n\t\t\t\t\ts = s.Substring(1);\n\t\t\t\t\tbool val = pp_expr(ref s, false);\n\t\t\t\t\tf (s.Length > 0 && s[0] == ')')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(1);\n\t\t\t\t\t\treturn val;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (is_identifier_start_character(c))\n\t\t\t\t{\n\t\t\t\t\tint j = 1;\n\n\t\t\t\t\twhile (j < len)\n\t\t\t\t\t{\n\t\t\t\t\t\tc = s[j];\n\n\t\t\t\t\t\tif (is_identifier_part_character(c))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbool v = eval_val(s.Substring(0, j));\n\t\t\t\t\t\ts = s.Substring(j);\n\t\t\t\t\t\treturn v;\n\t\t\t\t\t}\n\t\t\t\t\tbool vv = eval_val(s);\n\t\t\t\t\ts = \"\";\n\t\t\t\t\treturn vv;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tbool pp_unary(ref string s)\n\t\t{\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tif (s[0] == '!')\n\t\t\t\t{\n\t\t\t\t\tif (len > 1 && s[1] == '=')\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\ts = s.Substring(1);\n\t\t\t\t\treturn !pp_primary(ref s);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn pp_primary(ref s);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tbool pp_eq(ref string s)\n\t\t{\n\t\t\tbool va = pp_unary(ref s);\n\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tif (s[0] == '=')\n\t\t\t\t{\n\t\t\t\t\tif (len > 2 && s[1] == '=')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(2);\n\t\t\t\t\t\treturn va == pp_unary(ref s);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (s[0] == '!' && len > 1 && s[1] == '=')\n\t\t\t\t{\n\t\t\t\t\ts = s.Substring(2);\n\n\t\t\t\t\treturn va != pp_unary(ref s);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn va;\n\n\t\t}\n\n\t\tbool pp_and(ref string s)\n\t\t{\n\t\t\tbool va = pp_eq(ref s);\n\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tif (s[0] == '&')\n\t\t\t\t{\n\t\t\t\t\tif (len > 2 && s[1] == '&')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(2);\n\t\t\t\t\t\treturn (va & pp_and(ref s));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn va;\n\t\t}\n\n\t\t//\n\t\t// Evaluates an expression for `#if' or `#elif'\n\t\t//\n\t\tbool pp_expr(ref string s, bool isTerm)\n\t\t{\n\t\t\tbool va = pp_and(ref s);\n\t\t\ts = s.Trim();\n\t\t\tint len = s.Length;\n\t\t\tif (len > 0)\n\t\t\t{\n\t\t\t\tchar c = s[0];\n\n\t\t\t\tif (c == '|')\n\t\t\t\t{\n\t\t\t\t\tif (len > 2 && s[1] == '|')\n\t\t\t\t\t{\n\t\t\t\t\t\ts = s.Substring(2);\n\t\t\t\t\t\treturn va | pp_expr(ref s, isTerm);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isTerm)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn va;\n\t\t}\n\n\t\tbool eval(string s)\n\t\t{\n\t\t\tbool v = pp_expr(ref s, true);\n\t\t\ts = s.Trim();\n\t\t\tif (s.Length != 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn v;\n\t\t}\n\n\t\t#endregion\n\t}\n\n\t#endregion\n\n\t#region PreProcessorComment state\n\n\t/// <summary>\n\t///     PreProcessor comment state.\n\t/// </summary>\n\t/// <remarks>\n\t///     Activates when the #if or #elif directive is false and ignores\n\t///     all pushed chars until the next '#'.\n\t/// </remarks>\n\tpublic class PreProcessorCommentState : IndentState\n\t{\n\t\tpublic PreProcessorCommentState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic PreProcessorCommentState(PreProcessorCommentState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == '#' && Engine.IsLineStart)\n\t\t\t{\n\t\t\t\t// TODO: Return back only on #if/#elif/#else/#endif\n\t\t\t\t// Ignore any of the other directives (especially #define/#undef)\n\t\t\t\tExitState();\n\t\t\t\tChangeState<PreProcessorState>();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.NextLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new PreProcessorCommentState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region LineComment state\n\n\t/// <summary>\n\t///     Single-line comment state.\n\t/// </summary>\n\tpublic class LineCommentState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     It's possible that this should be the DocComment state ->\n\t\t///     Check if the first next pushed char is equal to '/'.\n\t\t/// </summary>\n\t\tpublic bool CheckForDocComment = true;\n\n\t\tpublic LineCommentState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic LineCommentState(LineCommentState prototype)\n\t\t\t: base(prototype)\n\t\t{\n\t\t\tCheckForDocComment = prototype.CheckForDocComment;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.NewLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\t\t\telse if (ch == '/' && CheckForDocComment)\n\t\t\t{\n\t\t\t\t// wrong state, should be DocComment.\n\t\t\t\tExitState();\n\t\t\t\tChangeState<DocCommentState>();\n\t\t\t}\n\n\t\t\tCheckForDocComment = false;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new LineCommentState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region DocComment state\n\n\t/// <summary>\n\t///     XML documentation comment state.\n\t/// </summary>\n\tpublic class DocCommentState : IndentState\n\t{\n\t\tpublic DocCommentState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic DocCommentState(DocCommentState prototype)\n\t\t\t: base(prototype)\n\t\t{ }\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.NewLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new DocCommentState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region MultiLineComment state\n\n\t/// <summary>\n\t///     Multi-line comment state.\n\t/// </summary>\n\tpublic class MultiLineCommentState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if any char has been pushed to this state.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t///     Needed to resolve an issue when the first pushed char is '/'.\n\t\t///     The state would falsely exit on this sequence of chars '/*/',\n\t\t///     since it only checks if the last two chars are '/' and '*'.\n\t\t/// </remarks>\n\t\tpublic bool IsAnyCharPushed;\n\n\t\tpublic MultiLineCommentState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic MultiLineCommentState(MultiLineCommentState prototype)\n\t\t\t: base(prototype)\n\t\t{\n\t\t\tIsAnyCharPushed = prototype.IsAnyCharPushed;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == '/' && Engine.PreviousChar == '*' && IsAnyCharPushed)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\n\t\t\tIsAnyCharPushed = true;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = ThisLineIndent.Clone();\n\t\t\t// add extra spaces so that the next line of the comment is align\n\t\t\t// to the first character in the first line of the comment\n\t\t\tNextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent + 1);\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new MultiLineCommentState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region StringLiteral state\n\n\t/// <summary>\n\t///     StringLiteral state.\n\t/// </summary>\n\tpublic class StringLiteralState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if the next char is escaped with '\\'.\n\t\t/// </summary>\n\t\tpublic bool IsEscaped;\n\n\t\tpublic StringLiteralState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic StringLiteralState(StringLiteralState prototype)\n\t\t\t: base(prototype)\n\t\t{\n\t\t\tIsEscaped = prototype.IsEscaped;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.NewLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\t\t\telse if (!IsEscaped && ch == '\"')\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\n\t\t\tIsEscaped = ch == '\\\\' && !IsEscaped;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new StringLiteralState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Verbatim string state\n\n\t/// <summary>\n\t///     Verbatim string state.\n\t/// </summary>\n\tpublic class VerbatimStringState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if there is an odd number of '\"' in a row.\n\t\t/// </summary>\n\t\tpublic bool IsEscaped;\n\n\t\tpublic VerbatimStringState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic VerbatimStringState(VerbatimStringState prototype)\n\t\t\t: base(prototype)\n\t\t{\n\t\t\tIsEscaped = prototype.IsEscaped;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (IsEscaped && ch != '\"')\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t\t// the char has been pushed to the wrong state, push it back\n\t\t\t\tEngine.CurrentState.Push(ch);\n\t\t\t}\n\n\t\t\tIsEscaped = ch == '\"' && !IsEscaped;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = new Indent(Engine.TextEditorOptions);\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new VerbatimStringState(this);\n\t\t}\n\t}\n\n\t#endregion\n\n\t#region Character state\n\n\t/// <summary>\n\t///     Character state.\n\t/// </summary>\n\tpublic class CharacterState : IndentState\n\t{\n\t\t/// <summary>\n\t\t///     True if the next char is escaped with '\\'.\n\t\t/// </summary>\n\t\tpublic bool IsEscaped;\n\n\t\tpublic CharacterState(IndentEngine engine, IndentState parent = null)\n\t\t\t: base(engine, parent)\n\t\t{ }\n\n\t\tpublic CharacterState(CharacterState prototype)\n\t\t\t: base(prototype)\n\t\t{\n\t\t\tIsEscaped = prototype.IsEscaped;\n\t\t}\n\n\t\tpublic override void Push(char ch)\n\t\t{\n\t\t\tbase.Push(ch);\n\n\t\t\tif (ch == Engine.NewLineChar)\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\t\t\telse if (!IsEscaped && ch == '\\'')\n\t\t\t{\n\t\t\t\tExitState();\n\t\t\t}\n\n\t\t\tIsEscaped = ch == '\\\\' && !IsEscaped;\n\t\t}\n\n\t\tpublic override void InitializeState()\n\t\t{\n\t\t\tThisLineIndent = Parent.ThisLineIndent.Clone();\n\t\t\tNextLineIndent = Parent.NextLineIndent.Clone();\n\t\t}\n\n\t\tpublic override IndentState Clone()\n\t\t{\n\t\t\treturn new CharacterState(this);\n\t\t}\n\t}\n\n\t#endregion\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/InheritStatements.cs",
    "content": "﻿namespace InheritStatements\n{\n\tclass A<T> : B where T : B\n\t{\n\t\tA() : base()\n\t\t{\n\t\t\tbase();\n\t\t}\n\t}\n\n\tclass C<T> \n\t\t: D where T \n\t\t: D\n\t{\n\t\tC()\n\t\t\t: this(this.ToString())\n\t\t{\n\t\t\tthrow this;\n\t\t}\n\n\t\tC(object c)\n\t\t\t: base()\n\t\t{\n\t\t\tbase();\n\t\t}\n\t}\n\n\tclass E<T> : \n\tF \n\t\twhere T : F\n\t{\n\t\tE() : \n\t\tbase()\n\t\t{\n\t\t\tbase();\n\t\t}\n\t}\n\n\tclass X\n\t{\n\t\tX()\n\t\t{\n\t\t\tvar t = this.ToString();\n\t\t\tvar b = t == \"X\"\n\t\t\t\t? true\n\t\t\t\t: false;\n\n\t\t\tif (b) goto x;\n\n\t\t\tswitch (t)\n\t\t\t{\n\t\t\tdefault:\n\t\t\t\ty: throw null;\n\t\t\t}\n\n\t\t\tx: ;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/PreProcessorDirectives.cs",
    "content": "﻿#if !DEBUG\n#define DEBUG\n#endif\n\n#if TRACE\n#undef TRACE\n#endif\n\nnamespace PreProcessorDirectives\n{\n\tclass PreProcessorDirectives\n\t{\n\t\tvoid IfDebug()\n\t\t{\n\t\t\t#region If/Elif Directives\n\t\t\t\n#if DEBUG\n\t\t\t{\n\t\t\t\t// This block should be correctly indented\n\t\t\t}\n#elif true\n\t\t\t{\n\t\t\t// This comment is not indented since the #if was true\n\t\t\t}\n#endif\n\t\t\t\n#if TRACE\n\t\t\t{\n\t\t\t// Not indented\n\t\t\t}\n#elif debug\n\t\t\t{\n\t\t\t// Also not indented\n\t\t\t}\n#else\n\t\t\t{\n\t\t\t\t// This should be indented\n\t\t\t}\n#endif\n\t\t\t\n\t\t\t#endregion \n\t\t}\n\t\t\n\t\t#region One-line directives\n\t\t\n\t\tvoid OneLiners\n\t\t{\n\t\t\t//\n#pragma warning disable 649\n\t\t\t//\n#warning 649\n\t\t\t//\n#line 649\n\t\t\t//\n#error 649\n\t\t\t//\n\t\t}\n\t\t\n\t\t#endregion \n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/Simple.cs",
    "content": "﻿using System;\n\nnamespace SimpleNamespace\n{\n\tclass SimpleClass\n\t{\n\t\tvoid SimpleMethod()\n\t\t{\n\t\t\t// simple comment\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/Strings.cs",
    "content": "﻿namespace Strings\n{\n\tclass Strings\n\t{\n\t\tvoid Strings(string s = \"\")\n\t\t{\n\t\t\ts = @\"\"\"\ncan't escape a verbatim string \\\";\n\t\t\ts = @\"\" \"not in verbatim anymore\n\t\t\t\t;\n\t\t\ts = \"\";\n\t\t\ts = \"\\\\\";\n\t\t\ts = \"\\\\\\\\\\\\\\\"\";\n\t\t\ts = \" // syntax error, but on the next line we start with the previous state\n\t\t\t\t;\n\t\t\ts = \"'c\\'\";\n\t\t\tstring concat = \"line 1\" +\n\t\t\t\t\"line 2\" +\n\t\t\t\t\"line 3\";\n\t\t\t\n\t\t\tvar c = '\\\\';\n\t\t\tc = '\\'';\n\t\t\tc = ' // syntax error, but on the next line we start with the previous state\n\t\t\t\t;\n\t\t\tc = ';';\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/SwitchCase.cs",
    "content": "﻿/// <summary>\n///     Switch case with CSharpFormattingOptions.IndentBreakStatements = false;\n/// </summary>\nclass SwitchCase\n{\n\tvoid Main(int param)\n\t{\n\t\tswitch (param)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t\tcontinue;\n\t\t\t\t\treturn;\n\t\t\t\t\tgoto case 2;\n\t\t\t\t\tgoto default;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t// ...\n\t\t\tcontinue;\n\t\t\tcase 3:\n\t\t\t\t// ...\n\t\t\treturn;\n\t\t\tcase 4:\n\t\t\t\t// ...\n\t\t\tgoto default;\n\t\t\tdefault:\n\t\t\t\t// ...\n\t\t\tgoto case 1;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TestFiles/TextArea.cs",
    "content": "//\n// TextEditor.cs\n//\n// Author:\n//   Mike Krüger <mkrueger@novell.com>\n//\n// Copyright (C) 2007 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\n//#define DEBUG_EXPOSE\n\nusing System;\nusing System.Linq;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\nusing Mono.TextEditor.Highlighting;\nusing Mono.TextEditor.PopupWindow;\nusing Mono.TextEditor.Theatrics;\nusing Gdk;\nusing Gtk;\n\nnamespace Mono.TextEditor\n{\n\tpublic class TextArea : Container, ITextEditorDataProvider\n\t{\n\t\tTextEditorData textEditorData;\n\t\tprotected IconMargin iconMargin;\n\t\tprotected ActionMargin actionMargin;\n\t\tprotected GutterMargin gutterMargin;\n\t\tprotected FoldMarkerMargin foldMarkerMargin;\n\t\tprotected TextViewMargin textViewMargin;\n\t\tDocumentLine longestLine = null;\n\t\tdouble longestLineWidth = -1;\n\t\tList<Margin> margins = new List<Margin> ();\n\t\tint oldRequest = -1;\n\t\tbool isDisposed = false;\n\t\tIMMulticontext imContext;\n\t\tGdk.EventKey lastIMEvent;\n\t\tGdk.Key lastIMEventMappedKey;\n\t\tuint lastIMEventMappedChar;\n\t\tGdk.ModifierType lastIMEventMappedModifier;\n\t\tbool sizeHasBeenAllocated;\n\t\tbool imContextNeedsReset;\n\t\tstring currentStyleName;\n\t\tdouble mx, my;\n\n\t\tpublic TextDocument Document {\n\t\t\tget {\n\t\t\t\treturn textEditorData.Document;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsDisposed {\n\t\t\tget {\n\t\t\t\treturn textEditorData.IsDisposed;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets or sets a value indicating whether this <see cref=\"Mono.TextEditor.TextEditor\"/> converts tabs to spaces.\n\t\t/// It is possible to overwrite the default options value for certain languages (like F#).\n\t\t/// </summary>\n\t\t/// <value>\n\t\t/// <c>true</c> if tabs to spaces should be converted; otherwise, <c>false</c>.\n\t\t/// </value>\n\t\tpublic bool TabsToSpaces {\n\t\t\tget {\n\t\t\t\treturn textEditorData.TabsToSpaces;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttextEditorData.TabsToSpaces = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Mono.TextEditor.Caret Caret {\n\t\t\tget {\n\t\t\t\treturn textEditorData.Caret;\n\t\t\t}\n\t\t}\n\n\t\tprotected internal IMMulticontext IMContext {\n\t\t\tget { return imContext; }\n\t\t}\n\n\t\tpublic MenuItem CreateInputMethodMenuItem (string label)\n\t\t{\n\t\t\tif (GtkWorkarounds.GtkMinorVersion >= 16) {\n\t\t\t\tbool showMenu = (bool)GtkWorkarounds.GetProperty (Settings, \"gtk-show-input-method-menu\").Val;\n\t\t\t\tif (!showMenu)\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\tMenuItem imContextMenuItem = new MenuItem (label);\n\t\t\tMenu imContextMenu = new Menu ();\n\t\t\timContextMenuItem.Submenu = imContextMenu;\n\t\t\tIMContext.AppendMenuitems (imContextMenu);\n\t\t\treturn imContextMenuItem;\n\t\t}\n\n\t\t[DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]\n\t\tstatic extern void gtk_im_multicontext_set_context_id (IntPtr context, string context_id);\n\n\t\t[DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]\n\t\tstatic extern string gtk_im_multicontext_get_context_id (IntPtr context);\n\n\t\t[GLib.Property (\"im-module\")]\n\t\tpublic string IMModule {\n\t\t\tget {\n\t\t\t\tif (GtkWorkarounds.GtkMinorVersion < 16 || imContext == null)\n\t\t\t\t\treturn null;\n\t\t\t\treturn gtk_im_multicontext_get_context_id (imContext.Handle);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (GtkWorkarounds.GtkMinorVersion < 16 || imContext == null)\n\t\t\t\t\treturn;\n\t\t\t\tgtk_im_multicontext_set_context_id (imContext.Handle, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic ITextEditorOptions Options {\n\t\t\tget {\n\t\t\t\treturn textEditorData.Options;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (textEditorData.Options != null)\n\t\t\t\t\ttextEditorData.Options.Changed -= OptionsChanged;\n\t\t\t\ttextEditorData.Options = value;\n\t\t\t\tif (textEditorData.Options != null) {\n\t\t\t\t\ttextEditorData.Options.Changed += OptionsChanged;\n\t\t\t\t\tOptionsChanged (null, null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic string FileName {\n\t\t\tget {\n\t\t\t\treturn Document.FileName;\n\t\t\t}\n\t\t}\n\n\t\tpublic string MimeType {\n\t\t\tget {\n\t\t\t\treturn Document.MimeType;\n\t\t\t}\n\t\t}\n\n\t\tvoid HandleTextEditorDataDocumentMarkerChange (object sender, TextMarkerEvent e)\n\t\t{\n\t\t\tif (e.TextMarker is IExtendingTextLineMarker) {\n\t\t\t\tint lineNumber = e.Line.LineNumber;\n\t\t\t\tif (lineNumber <= LineCount) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttextEditorData.HeightTree.SetLineHeight (lineNumber, GetLineHeight (e.Line));\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\tConsole.WriteLine (ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid HAdjustmentValueChanged (object sender, EventArgs args)\n\t\t{\n\t\t\tvar alloc = this.Allocation;\n\t\t\talloc.X = alloc.Y = 0;\n\n\t\t\tHAdjustmentValueChanged ();\n\t\t}\n\n\t\tprotected virtual void HAdjustmentValueChanged ()\n\t\t{\n\t\t\tHideTooltip (false);\n\t\t\tdouble value = this.textEditorData.HAdjustment.Value;\n\t\t\tif (value != System.Math.Round (value)) {\n\t\t\t\tthis.textEditorData.HAdjustment.Value = System.Math.Round (value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttextViewMargin.HideCodeSegmentPreviewWindow ();\n\t\t\tQueueDrawArea ((int)this.textViewMargin.XOffset, 0, this.Allocation.Width - (int)this.textViewMargin.XOffset, this.Allocation.Height);\n\t\t\tOnHScroll (EventArgs.Empty);\n\t\t\tSetChildrenPositions (Allocation);\n\t\t}\n\n\t\tvoid VAdjustmentValueChanged (object sender, EventArgs args)\n\t\t{\n\t\t\tvar alloc = this.Allocation;\n\t\t\talloc.X = alloc.Y = 0;\n\n\t\t\tVAdjustmentValueChanged ();\n\t\t\tSetChildrenPositions (alloc);\n\t\t}\n\n\t\tprotected virtual void VAdjustmentValueChanged ()\n\t\t{\n\t\t\tHideTooltip (false);\n\t\t\ttextViewMargin.HideCodeSegmentPreviewWindow ();\n\t\t\tdouble value = this.textEditorData.VAdjustment.Value;\n\t\t\tif (value != System.Math.Round (value)) {\n\t\t\t\tthis.textEditorData.VAdjustment.Value = System.Math.Round (value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (isMouseTrapped)\n\t\t\t\tFireMotionEvent (mx + textViewMargin.XOffset, my, lastState);\n\t\t\t\n\t\t\tdouble delta = value - this.oldVadjustment;\n\t\t\toldVadjustment = value;\n\t\t\tTextViewMargin.caretY -= delta;\n\t\t\t\n\t\t\tif (System.Math.Abs (delta) >= Allocation.Height - this.LineHeight * 2 || this.TextViewMargin.InSelectionDrag) {\n\t\t\t\tthis.QueueDraw ();\n\t\t\t\tOnVScroll (EventArgs.Empty);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (GdkWindow != null)\n\t\t\t\tGdkWindow.Scroll (0, (int)-delta);\n\n\t\t\tOnVScroll (EventArgs.Empty);\n\t\t}\n\n\t\tprotected virtual void OnVScroll (EventArgs e)\n\t\t{\n\t\t\tEventHandler handler = this.VScroll;\n\t\t\tif (handler != null)\n\t\t\t\thandler (this, e);\n\t\t}\n\n\t\tprotected virtual void OnHScroll (EventArgs e)\n\t\t{\n\t\t\tEventHandler handler = this.HScroll;\n\t\t\tif (handler != null)\n\t\t\t\thandler (this, e);\n\t\t}\n\n\t\tpublic event EventHandler VScroll;\n\t\tpublic event EventHandler HScroll;\n\n\t\tvoid UnregisterAdjustments ()\n\t\t{\n\t\t\tif (textEditorData.HAdjustment != null)\n\t\t\t\ttextEditorData.HAdjustment.ValueChanged -= HAdjustmentValueChanged;\n\t\t\tif (textEditorData.VAdjustment != null)\n\t\t\t\ttextEditorData.VAdjustment.ValueChanged -= VAdjustmentValueChanged;\n\t\t}\n\n\t\tinternal void SetTextEditorScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement)\n\t\t{\n\t\t\tif (textEditorData == null)\n\t\t\t\treturn;\n\t\t\tUnregisterAdjustments ();\n\t\t\t\n\t\t\tif (hAdjustement == null || vAdjustement == null)\n\t\t\t\treturn;\n\n\t\t\tthis.textEditorData.HAdjustment = hAdjustement;\n\t\t\tthis.textEditorData.VAdjustment = vAdjustement;\n\t\t\t\n\t\t\tthis.textEditorData.HAdjustment.ValueChanged += HAdjustmentValueChanged;\n\t\t\tthis.textEditorData.VAdjustment.ValueChanged += VAdjustmentValueChanged;\n\t\t}\n\n\t\tinternal TextArea (TextDocument doc, ITextEditorOptions options, EditMode initialMode)\n\t\t{\n\t\t\tGtkWorkarounds.FixContainerLeak (this);\n\t\t\tthis.Events = EventMask.PointerMotionMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.EnterNotifyMask | EventMask.LeaveNotifyMask | EventMask.VisibilityNotifyMask | EventMask.FocusChangeMask | EventMask.ScrollMask | EventMask.KeyPressMask | EventMask.KeyReleaseMask;\n\t\t\tbase.CanFocus = true;\n\n\t\t\t// This is required to properly handle resizing and rendering of children\n\t\t\tResizeMode = ResizeMode.Queue;\n\t\t}\n\n\t\tTextEditor editor;\n\n\t\tinternal void Initialize (TextEditor editor, TextDocument doc, ITextEditorOptions options, EditMode initialMode)\n\t\t{\n\t\t\tif (doc == null)\n\t\t\t\tthrow new ArgumentNullException (\"doc\");\n\t\t\tthis.editor = editor;\n\t\t\ttextEditorData = new TextEditorData (doc);\n\t\t\ttextEditorData.RecenterEditor += delegate {\n\t\t\t\tCenterToCaret ();\n\t\t\t\tStartCaretPulseAnimation ();\n\t\t\t};\n\t\t\ttextEditorData.Document.TextReplaced += OnDocumentStateChanged;\n\t\t\ttextEditorData.Document.TextSet += OnTextSet;\n\t\t\ttextEditorData.Document.LineChanged += UpdateLinesOnTextMarkerHeightChange; \n\t\t\ttextEditorData.Document.MarkerAdded += HandleTextEditorDataDocumentMarkerChange;\n\t\t\ttextEditorData.Document.MarkerRemoved += HandleTextEditorDataDocumentMarkerChange;\n\t\t\t\n\t\t\ttextEditorData.CurrentMode = initialMode;\n\t\t\t\n\t\t\tthis.textEditorData.Options = options ?? TextEditorOptions.DefaultOptions;\n\n\n\t\t\ttextEditorData.Parent = editor;\n\n\t\t\ticonMargin = new IconMargin (editor);\n\t\t\tgutterMargin = new GutterMargin (editor);\n\t\t\tactionMargin = new ActionMargin (editor);\n\t\t\tfoldMarkerMargin = new FoldMarkerMargin (editor);\n\t\t\ttextViewMargin = new TextViewMargin (editor);\n\n\t\t\tmargins.Add (iconMargin);\n\t\t\tmargins.Add (gutterMargin);\n\t\t\tmargins.Add (actionMargin);\n\t\t\tmargins.Add (foldMarkerMargin);\n\n\t\t\tmargins.Add (textViewMargin);\n\t\t\tthis.textEditorData.SelectionChanged += TextEditorDataSelectionChanged;\n\t\t\tthis.textEditorData.UpdateAdjustmentsRequested += TextEditorDatahandleUpdateAdjustmentsRequested;\n\t\t\tDocument.DocumentUpdated += DocumentUpdatedHandler;\n\t\t\t\n\t\t\tthis.textEditorData.Options.Changed += OptionsChanged;\n\t\t\t\n\t\t\t\n\t\t\tGtk.TargetList list = new Gtk.TargetList ();\n\t\t\tlist.AddTextTargets (ClipboardActions.CopyOperation.TextType);\n\t\t\tGtk.Drag.DestSet (this, DestDefaults.All, (TargetEntry[])list, DragAction.Move | DragAction.Copy);\n\t\t\t\n\t\t\timContext = new IMMulticontext ();\n\t\t\timContext.Commit += IMCommit;\n\t\t\t\n\t\t\timContext.UsePreedit = true;\n\t\t\timContext.PreeditChanged += PreeditStringChanged;\n\t\t\t\n\t\t\timContext.RetrieveSurrounding += delegate (object o, RetrieveSurroundingArgs args) {\n\t\t\t\t//use a single line of context, whole document would be very expensive\n\t\t\t\t//FIXME: UTF16 surrogates handling for caret offset? only matters for astral plane\n\t\t\t\timContext.SetSurrounding (Document.GetLineText (Caret.Line, false), Caret.Column);\n\t\t\t\targs.RetVal = true;\n\t\t\t};\n\t\t\t\n\t\t\timContext.SurroundingDeleted += delegate (object o, SurroundingDeletedArgs args) {\n\t\t\t\t//FIXME: UTF16 surrogates handling for offset and NChars? only matters for astral plane\n\t\t\t\tvar line = Document.GetLine (Caret.Line);\n\t\t\t\tDocument.Remove (line.Offset + args.Offset, args.NChars);\n\t\t\t\targs.RetVal = true;\n\t\t\t};\n\t\t\t\n\t\t\tusing (Pixmap inv = new Pixmap (null, 1, 1, 1)) {\n\t\t\t\tinvisibleCursor = new Cursor (inv, inv, Gdk.Color.Zero, Gdk.Color.Zero, 0, 0);\n\t\t\t}\n\t\t\t\n\t\t\tInitAnimations ();\n\t\t\tthis.Document.EndUndo += HandleDocumenthandleEndUndo;\n\t\t\tthis.textEditorData.HeightTree.LineUpdateFrom += delegate(object sender, HeightTree.HeightChangedEventArgs e) {\n\t\t\t\t//Console.WriteLine (\"redraw from :\" + e.Line);\n\t\t\t\tRedrawFromLine (e.Line);\n\t\t\t};\n#if ATK\n\t\t\tTextEditorAccessible.Factory.Init (this);\n#endif\n\n\t\t\tif (GtkGestures.IsSupported) {\n\t\t\t\tthis.AddGestureMagnifyHandler ((sender, args) => {\n\t\t\t\t\tOptions.Zoom += Options.Zoom * (args.Magnification / 4d);\n\t\t\t\t});\n\t\t\t}\n\t\t\tOptionsChanged (this, EventArgs.Empty);\n\t\t}\n\n\t\tpublic void RunAction (Action<TextEditorData> action)\n\t\t{\n\t\t\ttry {\n\t\t\t\taction (GetTextEditorData ());\n\t\t\t} catch (Exception e) {\n\t\t\t\tConsole.WriteLine (\"Error while executing \" + action + \" :\" + e);\n\t\t\t}\n\t\t}\n\n\t\tvoid HandleDocumenthandleEndUndo (object sender, TextDocument.UndoOperationEventArgs e)\n\t\t{\n\t\t\tif (this.Document.HeightChanged) {\n\t\t\t\tthis.Document.HeightChanged = false;\n\t\t\t\tSetAdjustments ();\n\t\t\t}\n\t\t}\n\n\t\tvoid TextEditorDatahandleUpdateAdjustmentsRequested (object sender, EventArgs e)\n\t\t{\n\t\t\tSetAdjustments ();\n\t\t}\n\n\t\tpublic void ShowListWindow<T> (ListWindow<T> window, DocumentLocation loc)\n\t\t{\n\t\t\tvar p = LocationToPoint (loc);\n\t\t\tint ox = 0, oy = 0;\n\t\t\tGdkWindow.GetOrigin (out ox, out oy);\n\t\n\t\t\twindow.Move (ox + p.X - window.TextOffset, oy + p.Y + (int)LineHeight);\n\t\t\twindow.ShowAll ();\n\t\t}\n\n\t\tinternal int preeditOffset = -1, preeditLine, preeditCursorCharIndex;\n\t\tinternal string preeditString;\n\t\tinternal Pango.AttrList preeditAttrs;\n\t\tinternal bool preeditHeightChange;\n\n\t\tinternal bool ContainsPreedit (int offset, int length)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty (preeditString))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\treturn offset <= preeditOffset && preeditOffset <= offset + length;\n\t\t}\n\n\t\tvoid PreeditStringChanged (object sender, EventArgs e)\n\t\t{\n\t\t\timContext.GetPreeditString (out preeditString, out preeditAttrs, out preeditCursorCharIndex);\n\t\t\tif (!string.IsNullOrEmpty (preeditString)) {\n\t\t\t\tif (preeditOffset < 0) {\n\t\t\t\t\tpreeditOffset = Caret.Offset;\n\t\t\t\t\tpreeditLine = Caret.Line;\n\t\t\t\t}\n\t\t\t\tif (UpdatePreeditLineHeight ())\n\t\t\t\t\tQueueDraw ();\n\t\t\t} else {\n\t\t\t\tpreeditOffset = -1;\n\t\t\t\tpreeditString = null;\n\t\t\t\tpreeditAttrs = null;\n\t\t\t\tpreeditCursorCharIndex = 0;\n\t\t\t\tif (UpdatePreeditLineHeight ())\n\t\t\t\t\tQueueDraw ();\n\t\t\t}\n\t\t\tthis.textViewMargin.ForceInvalidateLine (preeditLine);\n\t\t\tthis.textEditorData.Document.CommitLineUpdate (preeditLine);\n\t\t}\n\n\t\tinternal bool UpdatePreeditLineHeight ()\n\t\t{\n\t\t\tif (!string.IsNullOrEmpty (preeditString)) {\n\t\t\t\tusing (var preeditLayout = PangoUtil.CreateLayout (this)) {\n\t\t\t\t\tpreeditLayout.SetText (preeditString);\n\t\t\t\t\tpreeditLayout.Attributes = preeditAttrs;\n\t\t\t\t\tint w, h;\n\t\t\t\t\tpreeditLayout.GetSize (out w, out h);\n\t\t\t\t\tvar calcHeight = System.Math.Ceiling (h / Pango.Scale.PangoScale);\n\t\t\t\t\tif (LineHeight < calcHeight) {\n\t\t\t\t\t\ttextEditorData.HeightTree.SetLineHeight (preeditLine, calcHeight);\n\t\t\t\t\t\tpreeditHeightChange = true;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (preeditHeightChange) {\n\t\t\t\tpreeditHeightChange = false;\n\t\t\t\ttextEditorData.HeightTree.Rebuild ();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tvoid CaretPositionChanged (object sender, DocumentLocationEventArgs args)\n\t\t{\n\t\t\tHideTooltip ();\n\t\t\tResetIMContext ();\n\t\t\t\n\t\t\tif (Caret.AutoScrollToCaret && HasFocus)\n\t\t\t\tScrollToCaret ();\n\t\t\t\n//\t\t\tRectangle rectangle = textViewMargin.GetCaretRectangle (Caret.Mode);\n\t\t\tRequestResetCaretBlink ();\n\t\t\t\n\t\t\ttextEditorData.CurrentMode.InternalCaretPositionChanged (textEditorData.Parent, textEditorData);\n\t\t\t\n\t\t\tif (!IsSomethingSelected) {\n\t\t\t\tif (/*Options.HighlightCaretLine && */args.Location.Line != Caret.Line)\n\t\t\t\t\tRedrawMarginLine (TextViewMargin, args.Location.Line);\n\t\t\t\tRedrawMarginLine (TextViewMargin, Caret.Line);\n\t\t\t}\n\t\t}\n\n\t\tSelection oldSelection = Selection.Empty;\n\n\t\tvoid TextEditorDataSelectionChanged (object sender, EventArgs args)\n\t\t{\n\t\t\tif (IsSomethingSelected) {\n\t\t\t\tvar selectionRange = MainSelection.GetSelectionRange (textEditorData);\n\t\t\t\tif (selectionRange.Offset >= 0 && selectionRange.EndOffset < Document.TextLength) {\n\t\t\t\t\tClipboardActions.CopyToPrimary (this.textEditorData);\n\t\t\t\t} else {\n\t\t\t\t\tClipboardActions.ClearPrimary ();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tClipboardActions.ClearPrimary ();\n\t\t\t}\n\t\t\t// Handle redraw\n\t\t\tSelection selection = MainSelection;\n\t\t\tint startLine = !selection.IsEmpty ? selection.Anchor.Line : -1;\n\t\t\tint endLine = !selection.IsEmpty ? selection.Lead.Line : -1;\n\t\t\tint oldStartLine = !oldSelection.IsEmpty ? oldSelection.Anchor.Line : -1;\n\t\t\tint oldEndLine = !oldSelection.IsEmpty ? oldSelection.Lead.Line : -1;\n\t\t\tif (SelectionMode == SelectionMode.Block) {\n\t\t\t\tthis.RedrawMarginLines (this.textViewMargin, \n\t\t\t\t                        System.Math.Min (System.Math.Min (oldStartLine, oldEndLine), System.Math.Min (startLine, endLine)),\n\t\t\t\t                        System.Math.Max (System.Math.Max (oldStartLine, oldEndLine), System.Math.Max (startLine, endLine)));\n\t\t\t} else {\n\t\t\t\tif (endLine < 0 && startLine >= 0)\n\t\t\t\t\tendLine = Document.LineCount;\n\t\t\t\tif (oldEndLine < 0 && oldStartLine >= 0)\n\t\t\t\t\toldEndLine = Document.LineCount;\n\t\t\t\tint from = oldEndLine, to = endLine;\n\t\t\t\tif (!selection.IsEmpty && !oldSelection.IsEmpty) {\n\t\t\t\t\tif (startLine != oldStartLine && endLine != oldEndLine) {\n\t\t\t\t\t\tfrom = System.Math.Min (startLine, oldStartLine);\n\t\t\t\t\t\tto = System.Math.Max (endLine, oldEndLine);\n\t\t\t\t\t} else if (startLine != oldStartLine) {\n\t\t\t\t\t\tfrom = startLine;\n\t\t\t\t\t\tto = oldStartLine;\n\t\t\t\t\t} else if (endLine != oldEndLine) {\n\t\t\t\t\t\tfrom = endLine;\n\t\t\t\t\t\tto = oldEndLine;\n\t\t\t\t\t} else if (startLine == oldStartLine && endLine == oldEndLine) {\n\t\t\t\t\t\tif (selection.Anchor == oldSelection.Anchor) {\n\t\t\t\t\t\t\tthis.RedrawMarginLine (this.textViewMargin, endLine);\n\t\t\t\t\t\t} else if (selection.Lead == oldSelection.Lead) {\n\t\t\t\t\t\t\tthis.RedrawMarginLine (this.textViewMargin, startLine);\n\t\t\t\t\t\t} else { // 3rd case - may happen when changed programmatically\n\t\t\t\t\t\t\tthis.RedrawMarginLine (this.textViewMargin, endLine);\n\t\t\t\t\t\t\tthis.RedrawMarginLine (this.textViewMargin, startLine);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfrom = to = -1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (selection.IsEmpty) {\n\t\t\t\t\t\tfrom = oldStartLine;\n\t\t\t\t\t\tto = oldEndLine;\n\t\t\t\t\t} else if (oldSelection.IsEmpty) {\n\t\t\t\t\t\tfrom = startLine;\n\t\t\t\t\t\tto = endLine;\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (from >= 0 && to >= 0) {\n\t\t\t\t\tthis.RedrawMarginLines (this.textViewMargin, \n\t\t\t\t\t                        System.Math.Max (0, System.Math.Min (from, to) - 1),\n\t\t\t\t\t                        System.Math.Max (from, to));\n\t\t\t\t}\n\t\t\t}\n\t\t\toldSelection = selection;\n\t\t\tOnSelectionChanged (EventArgs.Empty);\n\t\t}\n\n\t\tinternal void ResetIMContext ()\n\t\t{\n\t\t\tif (imContextNeedsReset) {\n\t\t\t\timContext.Reset ();\n\t\t\t\timContextNeedsReset = false;\n\t\t\t}\n\t\t}\n\n\t\tvoid IMCommit (object sender, Gtk.CommitArgs ca)\n\t\t{\n\t\t\tif (!IsRealized || !IsFocus)\n\t\t\t\treturn;\n\t\t\t\n\t\t\t//this, if anywhere, is where we should handle UCS4 conversions\n\t\t\tfor (int i = 0; i < ca.Str.Length; i++) {\n\t\t\t\tint utf32Char;\n\t\t\t\tif (char.IsHighSurrogate (ca.Str, i)) {\n\t\t\t\t\tutf32Char = char.ConvertToUtf32 (ca.Str, i);\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\t\t\t\t\tutf32Char = (int)ca.Str [i];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//include the other pre-IM state *if* the post-IM char matches the pre-IM (key-mapped) one\n\t\t\t\tif (lastIMEventMappedChar == utf32Char && lastIMEventMappedChar == (uint)lastIMEventMappedKey) {\n\t\t\t\t\teditor.OnIMProcessedKeyPressEvent (lastIMEventMappedKey, lastIMEventMappedChar, lastIMEventMappedModifier);\n\t\t\t\t} else {\n\t\t\t\t\teditor.OnIMProcessedKeyPressEvent ((Gdk.Key)0, (uint)utf32Char, Gdk.ModifierType.None);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//the IME can commit while there's still a pre-edit string\n\t\t\t//since we cached the pre-edit offset when it started, need to update it\n\t\t\tif (preeditOffset > -1) {\n\t\t\t\tpreeditOffset = Caret.Offset;\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool OnFocusInEvent (EventFocus evnt)\n\t\t{\n\t\t\tvar result = base.OnFocusInEvent (evnt);\n\t\t\timContextNeedsReset = true;\n\t\t\tIMContext.FocusIn ();\n\t\t\tRequestResetCaretBlink ();\n\t\t\tDocument.CommitLineUpdate (Caret.Line);\n\t\t\treturn result;\n\t\t}\n\n\t\tuint focusOutTimerId = 0;\n\n\t\tvoid RemoveFocusOutTimerId ()\n\t\t{\n\t\t\tif (focusOutTimerId == 0)\n\t\t\t\treturn;\n\t\t\tGLib.Source.Remove (focusOutTimerId);\n\t\t\tfocusOutTimerId = 0;\n\t\t}\n\n\t\tprotected override bool OnFocusOutEvent (EventFocus evnt)\n\t\t{\n\t\t\tvar result = base.OnFocusOutEvent (evnt);\n\t\t\timContextNeedsReset = true;\n\t\t\timContext.FocusOut ();\n\t\t\tRemoveFocusOutTimerId ();\n\n\t\t\tif (tipWindow != null && currentTooltipProvider != null) {\n\t\t\t\tif (!currentTooltipProvider.IsInteractive (textEditorData.Parent, tipWindow))\n\t\t\t\t\tDelayedHideTooltip ();\n\t\t\t} else {\n\t\t\t\tHideTooltip ();\n\t\t\t}\n\n\t\t\tTextViewMargin.StopCaretThread ();\n\t\t\tDocument.CommitLineUpdate (Caret.Line);\n\t\t\treturn result;\n\t\t}\n\n\t\tprotected override void OnRealized ()\n\t\t{\n\t\t\tWidgetFlags |= WidgetFlags.Realized;\n\t\t\tWindowAttr attributes = new WindowAttr () {\n\t\t\t\tWindowType = Gdk.WindowType.Child,\n\t\t\t\tX = Allocation.X,\n\t\t\t\tY = Allocation.Y,\n\t\t\t\tWidth = Allocation.Width,\n\t\t\t\tHeight = Allocation.Height,\n\t\t\t\tWclass = WindowClass.InputOutput,\n\t\t\t\tVisual = this.Visual,\n\t\t\t\tColormap = this.Colormap,\n\t\t\t\tEventMask = (int)(this.Events | Gdk.EventMask.ExposureMask),\n\t\t\t\tMask = this.Events | Gdk.EventMask.ExposureMask,\n\t\t\t};\n\t\t\t\n\t\t\tWindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual;\n\t\t\tGdkWindow = new Gdk.Window (ParentWindow, attributes, mask);\n\t\t\tGdkWindow.UserData = Raw;\n\t\t\tGdkWindow.Background = Style.Background (StateType.Normal);\n\t\t\tStyle = Style.Attach (GdkWindow);\n\n\t\t\timContext.ClientWindow = this.GdkWindow;\n\t\t\tCaret.PositionChanged += CaretPositionChanged;\n\t\t}\n\n\t\tprotected override void OnUnrealized ()\n\t\t{\n\t\t\timContext.ClientWindow = null;\n\t\t\tCancelScheduledHide ();\n\t\t\tbase.OnUnrealized ();\n\t\t}\n\n\t\tvoid DocumentUpdatedHandler (object sender, EventArgs args)\n\t\t{\n\t\t\tforeach (DocumentUpdateRequest request in Document.UpdateRequests) {\n\t\t\t\trequest.Update (textEditorData.Parent);\n\t\t\t}\n\t\t}\n\n\t\tpublic event EventHandler EditorOptionsChanged;\n\n\t\tprotected virtual void OptionsChanged (object sender, EventArgs args)\n\t\t{\n\t\t\tif (Options == null)\n\t\t\t\treturn;\n\t\t\tif (currentStyleName != Options.ColorScheme) {\n\t\t\t\tcurrentStyleName = Options.ColorScheme;\n\t\t\t\tthis.textEditorData.ColorStyle = Options.GetColorStyle ();\n\t\t\t\tSetWidgetBgFromStyle ();\n\t\t\t}\n\t\t\t\n\t\t\ticonMargin.IsVisible = Options.ShowIconMargin;\n\t\t\tgutterMargin.IsVisible = Options.ShowLineNumberMargin;\n\t\t\tfoldMarkerMargin.IsVisible = Options.ShowFoldMargin || Options.EnableQuickDiff;\n//\t\t\tdashedLineMargin.IsVisible = foldMarkerMargin.IsVisible || gutterMargin.IsVisible;\n\t\t\t\n\t\t\tif (EditorOptionsChanged != null)\n\t\t\t\tEditorOptionsChanged (this, args);\n\t\t\t\n\t\t\ttextViewMargin.OptionsChanged ();\n\t\t\tforeach (Margin margin in this.margins) {\n\t\t\t\tif (margin == textViewMargin)\n\t\t\t\t\tcontinue;\n\t\t\t\tmargin.OptionsChanged ();\n\t\t\t}\n\t\t\tSetAdjustments (Allocation);\n\t\t\ttextEditorData.HeightTree.Rebuild ();\n\t\t\tthis.QueueResize ();\n\t\t}\n\n\t\tvoid SetWidgetBgFromStyle ()\n\t\t{\n\t\t\t// This is a hack around a problem with repainting the drag widget.\n\t\t\t// When this is not set a white square is drawn when the drag widget is moved\n\t\t\t// when the bg color is differs from the color style bg color (e.g. oblivion style)\n\t\t\tif (this.textEditorData.ColorStyle != null && GdkWindow != null) {\n\t\t\t\tsettingWidgetBg = true; //prevent infinite recusion\n\t\t\t\t\n\t\t\t\tthis.ModifyBg (StateType.Normal, (HslColor)this.textEditorData.ColorStyle.PlainText.Background);\n\t\t\t\tsettingWidgetBg = false;\n\t\t\t}\n\t\t}\n\n\t\tbool settingWidgetBg = false;\n\n\t\tprotected override void OnStyleSet (Gtk.Style previous_style)\n\t\t{\n\t\t\tbase.OnStyleSet (previous_style);\n\t\t\tif (!settingWidgetBg && textEditorData.ColorStyle != null) {\n//\t\t\t\ttextEditorData.ColorStyle.UpdateFromGtkStyle (this.Style);\n\t\t\t\tSetWidgetBgFromStyle ();\n\t\t\t}\n\t\t}\n\n\t\tprotected override bool OnVisibilityNotifyEvent (EventVisibility evnt)\n\t\t{\n\t\t\tif (evnt.State == VisibilityState.FullyObscured)\n\t\t\t\tHideTooltip ();\n\t\t\treturn base.OnVisibilityNotifyEvent (evnt);\n\t\t}\n\n\t\tprotected override void OnDestroyed ()\n\t\t{\n\t\t\tif (popupWindow != null)\n\t\t\t\tpopupWindow.Destroy ();\n\n\t\t\tHideTooltip ();\n\t\t\tDocument.EndUndo -= HandleDocumenthandleEndUndo;\n\t\t\tDocument.TextReplaced -= OnDocumentStateChanged;\n\t\t\tDocument.TextSet -= OnTextSet;\n\t\t\tDocument.LineChanged -= UpdateLinesOnTextMarkerHeightChange; \n\t\t\tDocument.MarkerAdded -= HandleTextEditorDataDocumentMarkerChange;\n\t\t\tDocument.MarkerRemoved -= HandleTextEditorDataDocumentMarkerChange;\n\n\t\t\tDisposeAnimations ();\n\t\t\t\n\t\t\tRemoveFocusOutTimerId ();\n\t\t\tRemoveScrollWindowTimer ();\n\t\t\tif (invisibleCursor != null)\n\t\t\t\tinvisibleCursor.Dispose ();\n\t\t\t\n\t\t\tCaret.PositionChanged -= CaretPositionChanged;\n\t\t\t\n\t\t\tDocument.DocumentUpdated -= DocumentUpdatedHandler;\n\t\t\tif (textEditorData.Options != null)\n\t\t\t\ttextEditorData.Options.Changed -= OptionsChanged;\n\t\t\t\n\t\t\tif (imContext != null) {\n\t\t\t\tResetIMContext ();\n\t\t\t\timContext = imContext.Kill (x => x.Commit -= IMCommit);\n\t\t\t}\n\n\t\t\tUnregisterAdjustments ();\n\n\t\t\tforeach (Margin margin in this.margins) {\n\t\t\t\tif (margin is IDisposable)\n\t\t\t\t\t((IDisposable)margin).Dispose ();\n\t\t\t}\n\t\t\ttextEditorData.ClearTooltipProviders ();\n\t\t\t\n\t\t\tthis.textEditorData.SelectionChanged -= TextEditorDataSelectionChanged;\n\t\t\tthis.textEditorData.Dispose (); \n\t\t\tlongestLine = null;\n\n\t\t\tbase.OnDestroyed ();\n\t\t}\n\n\t\t[Obsolete (\"This method has been moved to TextEditorData. Will be removed in future versions.\")]\n\t\tpublic void ClearTooltipProviders ()\n\t\t{\n\t\t\ttextEditorData.ClearTooltipProviders ();\n\t\t}\n\n\t\t[Obsolete (\"This method has been moved to TextEditorData. Will be removed in future versions.\")]\n\t\tpublic void AddTooltipProvider (TooltipProvider provider)\n\t\t{\n\t\t\ttextEditorData.AddTooltipProvider (provider);\n\t\t}\n\n\t\t[Obsolete (\"This method has been moved to TextEditorData. Will be removed in future versions.\")]\n\t\tpublic void RemoveTooltipProvider (TooltipProvider provider)\n\t\t{\n\t\t\ttextEditorData.RemoveTooltipProvider (provider);\n\t\t}\n\n\t\tpublic void RedrawMargin (Margin margin)\n\t\t{\n\t\t\tif (isDisposed)\n\t\t\t\treturn;\n\t\t\tQueueDrawArea ((int)margin.XOffset, 0, GetMarginWidth (margin), this.Allocation.Height);\n\t\t}\n\n\t\tpublic void RedrawMarginLine (Margin margin, int logicalLine)\n\t\t{\n\t\t\tif (isDisposed)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tdouble y = LineToY (logicalLine) - this.textEditorData.VAdjustment.Value;\n\t\t\tdouble h = GetLineHeight (logicalLine);\n\t\t\t\n\t\t\tif (y + h > 0)\n\t\t\t\tQueueDrawArea ((int)margin.XOffset, (int)y, (int)GetMarginWidth (margin), (int)h);\n\t\t}\n\n\t\tint GetMarginWidth (Margin margin)\n\t\t{\n\t\t\tif (margin.Width < 0)\n\t\t\t\treturn Allocation.Width - (int)margin.XOffset;\n\t\t\treturn (int)margin.Width;\n\t\t}\n\n\t\tinternal void RedrawLine (int logicalLine)\n\t\t{\n\t\t\tif (isDisposed || logicalLine > LineCount || logicalLine < DocumentLocation.MinLine)\n\t\t\t\treturn;\n\t\t\tdouble y = LineToY (logicalLine) - this.textEditorData.VAdjustment.Value;\n\t\t\tdouble h = GetLineHeight (logicalLine);\n\n\t\t\tif (y + h > 0)\n\t\t\t\tQueueDrawArea (0, (int)y, this.Allocation.Width, (int)h);\n\t\t}\n\n\t\tpublic new void QueueDrawArea (int x, int y, int w, int h)\n\t\t{\n\t\t\tif (GdkWindow != null) {\n\t\t\t\tGdkWindow.InvalidateRect (new Rectangle (x, y, w, h), false);\n#if DEBUG_EXPOSE\n\t\t\t\tConsole.WriteLine (\"invalidated {0},{1} {2}x{3}\", x, y, w, h);\n#endif\n\t\t\t}\n\t\t}\n\n\t\tpublic new void QueueDraw ()\n\t\t{\n\t\t\tbase.QueueDraw ();\n#if DEBUG_EXPOSE\n\t\t\tConsole.WriteLine (\"invalidated entire widget\");\n#endif\n\t\t}\n\n\t\tinternal void RedrawPosition (int logicalLine, int logicalColumn)\n\t\t{\n\t\t\tif (isDisposed)\n\t\t\t\treturn;\n//\t\t\t\tConsole.WriteLine (\"Redraw position: logicalLine={0}, logicalColumn={1}\", logicalLine, logicalColumn);\n\t\t\tRedrawLine (logicalLine);\n\t\t}\n\n\t\tpublic void RedrawMarginLines (Margin margin, int start, int end)\n\t\t{\n\t\t\tif (isDisposed)\n\t\t\t\treturn;\n\t\t\tif (start < 0)\n\t\t\t\tstart = 0;\n\t\t\tdouble visualStart = -this.textEditorData.VAdjustment.Value + LineToY (start);\n\t\t\tif (end < 0)\n\t\t\t\tend = Document.LineCount;\n\t\t\tdouble visualEnd = -this.textEditorData.VAdjustment.Value + LineToY (end) + GetLineHeight (end);\n\t\t\tQueueDrawArea ((int)margin.XOffset, (int)visualStart, GetMarginWidth (margin), (int)(visualEnd - visualStart));\n\t\t}\n\n\t\tinternal void RedrawLines (int start, int end)\n\t\t{\n//\t\t\tConsole.WriteLine (\"redraw lines: start={0}, end={1}\", start, end);\n\t\t\tif (isDisposed)\n\t\t\t\treturn;\n\t\t\tif (start < 0)\n\t\t\t\tstart = 0;\n\t\t\tdouble visualStart = -this.textEditorData.VAdjustment.Value + LineToY (start);\n\t\t\tif (end < 0)\n\t\t\t\tend = Document.LineCount;\n\t\t\tdouble visualEnd = -this.textEditorData.VAdjustment.Value + LineToY (end) + GetLineHeight (end);\n\t\t\tQueueDrawArea (0, (int)visualStart, this.Allocation.Width, (int)(visualEnd - visualStart));\n\t\t}\n\n\t\tpublic void RedrawFromLine (int logicalLine)\n\t\t{\n//\t\t\tConsole.WriteLine (\"Redraw from line: logicalLine={0}\", logicalLine);\n\t\t\tif (isDisposed)\n\t\t\t\treturn;\n\t\t\tint y = System.Math.Max (0, (int)(-this.textEditorData.VAdjustment.Value + LineToY (logicalLine)));\n\t\t\tQueueDrawArea (0, y,\n\t\t\t               this.Allocation.Width, this.Allocation.Height - y);\n\t\t}\n\n\t\t/// <summary>Handles key input after key mapping and input methods.</summary>\n\t\t/// <param name=\"key\">The mapped keycode.</param>\n\t\t/// <param name=\"unicodeChar\">A UCS4 character. If this is nonzero, it overrides the keycode.</param>\n\t\t/// <param name=\"modifier\">Keyboard modifier, excluding any consumed by key mapping or IM.</param>\n\t\tpublic void SimulateKeyPress (Gdk.Key key, uint unicodeChar, ModifierType modifier)\n\t\t{\n\t\t\tModifierType filteredModifiers = modifier & (ModifierType.ShiftMask | ModifierType.Mod1Mask |\n\t\t\t                                             ModifierType.ControlMask | ModifierType.MetaMask |\n\t\t\t                                             ModifierType.SuperMask);\n\t\t\tCurrentMode.InternalHandleKeypress (textEditorData.Parent, textEditorData, key, unicodeChar, filteredModifiers);\n\t\t\tRequestResetCaretBlink ();\n\t\t}\n\n\t\tbool IMFilterKeyPress (Gdk.EventKey evt, Gdk.Key mappedKey, uint mappedChar, Gdk.ModifierType mappedModifiers)\n\t\t{\n\t\t\tif (lastIMEvent == evt)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif (evt.Type == EventType.KeyPress) {\n\t\t\t\tlastIMEvent = evt;\n\t\t\t\tlastIMEventMappedChar = mappedChar;\n\t\t\t\tlastIMEventMappedKey = mappedKey;\n\t\t\t\tlastIMEventMappedModifier = mappedModifiers;\n\t\t\t}\n\t\t\t\n\t\t\tif (imContext.FilterKeypress (evt)) {\n\t\t\t\timContextNeedsReset = true;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tGdk.Cursor invisibleCursor;\n\n\t\tinternal void HideMouseCursor ()\n\t\t{\n\t\t\tif (GdkWindow != null)\n\t\t\t\tGdkWindow.Cursor = invisibleCursor;\n\t\t}\n\n\t\tprotected override bool OnKeyPressEvent (Gdk.EventKey evt)\n\t\t{\n\t\t\tGdk.Key key;\n\t\t\tGdk.ModifierType mod;\n\t\t\tKeyboardShortcut[] accels;\n\t\t\tGtkWorkarounds.MapKeys (evt, out key, out mod, out accels);\n\t\t\t//HACK: we never call base.OnKeyPressEvent, so implement the popup key manually\n\t\t\tif (key == Gdk.Key.Menu || (key == Gdk.Key.F10 && mod.HasFlag (ModifierType.ShiftMask))) {\n\t\t\t\tOnPopupMenu ();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tuint keyVal = (uint)key;\n\t\t\tCurrentMode.SelectValidShortcut (accels, out key, out mod);\n\t\t\tif (key == Gdk.Key.F1 && (mod & (ModifierType.ControlMask | ModifierType.ShiftMask)) == ModifierType.ControlMask) {\n\t\t\t\tvar p = LocationToPoint (Caret.Location);\n\t\t\t\tShowTooltip (Gdk.ModifierType.None, Caret.Offset, p.X, p.Y);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (key == Gdk.Key.F2 && textViewMargin.IsCodeSegmentPreviewWindowShown) {\n\t\t\t\ttextViewMargin.OpenCodeSegmentEditor ();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t//FIXME: why are we doing this?\n\t\t\tif ((key == Gdk.Key.space || key == Gdk.Key.parenleft || key == Gdk.Key.parenright) && (mod & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask)\n\t\t\t\tmod = Gdk.ModifierType.None;\n\t\t\t\n\t\t\tuint unicodeChar = Gdk.Keyval.ToUnicode (keyVal);\n\t\t\t\n\t\t\tif (CurrentMode.WantsToPreemptIM || CurrentMode.PreemptIM (key, unicodeChar, mod)) {\n\t\t\t\tResetIMContext ();\n\t\t\t\t//FIXME: should call base.OnKeyPressEvent when SimulateKeyPress didn't handle the event\n\t\t\t\tSimulateKeyPress (key, unicodeChar, mod);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tbool filter = IMFilterKeyPress (evt, key, unicodeChar, mod);\n\t\t\tif (filter)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t//FIXME: OnIMProcessedKeyPressEvent should return false when it didn't handle the event\n\t\t\tif (editor.OnIMProcessedKeyPressEvent (key, unicodeChar, mod))\n\t\t\t\treturn true;\n\t\t\t\n\t\t\treturn base.OnKeyPressEvent (evt);\n\t\t}\n\n\t\tprotected override bool OnKeyReleaseEvent (EventKey evnt)\n\t\t{\n\t\t\tif (IMFilterKeyPress (evnt, 0, 0, ModifierType.None)) {\n\t\t\t\timContextNeedsReset = true;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tuint mouseButtonPressed = 0;\n\t\tuint lastTime;\n\t\tdouble pressPositionX, pressPositionY;\n\n\t\tprotected override bool OnButtonPressEvent (Gdk.EventButton e)\n\t\t{\n\t\t\tif (overChildWidget)\n\t\t\t\treturn true;\n\n\t\t\tpressPositionX = e.X;\n\t\t\tpressPositionY = e.Y;\n\t\t\tbase.IsFocus = true;\n\t\t\t\n\n\t\t\tif (lastTime != e.Time) {// filter double clicks\n\t\t\t\tif (e.Type == EventType.TwoButtonPress) {\n\t\t\t\t\tlastTime = e.Time;\n\t\t\t\t} else {\n\t\t\t\t\tlastTime = 0;\n\t\t\t\t}\n\t\t\t\tmouseButtonPressed = e.Button;\n\t\t\t\tdouble startPos;\n\t\t\t\tMargin margin = GetMarginAtX (e.X, out startPos);\n\t\t\t\tif (margin == textViewMargin) {\n\t\t\t\t\t//main context menu\n\t\t\t\t\tif (DoPopupMenu != null && e.TriggersContextMenu ()) {\n\t\t\t\t\t\tDoClickedPopupMenu (e);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (margin != null)\n\t\t\t\t\tmargin.MousePressed (new MarginMouseEventArgs (textEditorData.Parent, e, e.Button, e.X - startPos, e.Y, e.State));\n\t\t\t}\n\t\t\treturn base.OnButtonPressEvent (e);\n\t\t}\n\n\t\tbool DoClickedPopupMenu (Gdk.EventButton e)\n\t\t{\n\t\t\tdouble tmOffset = e.X - textViewMargin.XOffset;\n\t\t\tif (tmOffset >= 0) {\n\t\t\t\tDocumentLocation loc;\n\t\t\t\tif (textViewMargin.CalculateClickLocation (tmOffset, e.Y, out loc)) {\n\t\t\t\t\tif (!this.IsSomethingSelected || !this.SelectionRange.Contains (Document.LocationToOffset (loc))) {\n\t\t\t\t\t\tCaret.Location = loc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tDoPopupMenu (e);\n\t\t\t\tthis.ResetMouseState ();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic Action<Gdk.EventButton> DoPopupMenu { get; set; }\n\n\t\tprotected override bool OnPopupMenu ()\n\t\t{\n\t\t\tif (DoPopupMenu != null) {\n\t\t\t\tDoPopupMenu (null);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn base.OnPopupMenu ();\n\t\t}\n\n\t\tpublic Margin LockedMargin {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tMargin GetMarginAtX (double x, out double startingPos)\n\t\t{\n\t\t\tdouble curX = 0;\n\t\t\tforeach (Margin margin in this.margins) {\n\t\t\t\tif (!margin.IsVisible)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (LockedMargin != null) {\n\t\t\t\t\tif (LockedMargin == margin) {\n\t\t\t\t\t\tstartingPos = curX;\n\t\t\t\t\t\treturn margin;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (curX <= x && (x <= curX + margin.Width || margin.Width < 0)) {\n\t\t\t\t\t\tstartingPos = curX;\n\t\t\t\t\t\treturn margin;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurX += margin.Width;\n\t\t\t}\n\t\t\tstartingPos = -1;\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override bool OnButtonReleaseEvent (EventButton e)\n\t\t{\n\t\t\tRemoveScrollWindowTimer ();\n\t\t\t\n\t\t\t//main context menu\n\t\t\tif (DoPopupMenu != null && e.IsContextMenuButton ()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tdouble startPos;\n\t\t\tMargin margin = GetMarginAtX (e.X, out startPos);\n\t\t\tif (margin != null)\n\t\t\t\tmargin.MouseReleased (new MarginMouseEventArgs (textEditorData.Parent, e, e.Button, e.X - startPos, e.Y, e.State));\n\t\t\tResetMouseState ();\n\t\t\treturn base.OnButtonReleaseEvent (e);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Use this method with care.\n\t\t/// </summary>\n\t\tpublic void ResetMouseState ()\n\t\t{\n\t\t\tmouseButtonPressed = 0;\n\t\t\ttextViewMargin.inDrag = false;\n\t\t\ttextViewMargin.InSelectionDrag = false;\n\t\t}\n\n\t\tbool dragOver = false;\n\t\tClipboardActions.CopyOperation dragContents = null;\n\t\tDocumentLocation defaultCaretPos, dragCaretPos;\n\t\tSelection selection = Selection.Empty;\n\n\t\tpublic bool IsInDrag {\n\t\t\tget {\n\t\t\t\treturn dragOver;\n\t\t\t}\n\t\t}\n\n\t\tpublic void CaretToDragCaretPosition ()\n\t\t{\n\t\t\tCaret.Location = defaultCaretPos = dragCaretPos;\n\t\t}\n\n\t\tprotected override void OnDragLeave (DragContext context, uint time_)\n\t\t{\n\t\t\tif (dragOver) {\n\t\t\t\tCaret.PreserveSelection = true;\n\t\t\t\tCaret.Location = defaultCaretPos;\n\t\t\t\tCaret.PreserveSelection = false;\n\t\t\t\tResetMouseState ();\n\t\t\t\tdragOver = false;\n\t\t\t}\n\t\t\tbase.OnDragLeave (context, time_);\n\t\t}\n\n\t\tprotected override void OnDragDataGet (DragContext context, SelectionData selection_data, uint info, uint time_)\n\t\t{\n\t\t\tif (this.dragContents != null) {\n\t\t\t\tthis.dragContents.SetData (selection_data, info);\n\t\t\t\tthis.dragContents = null;\n\t\t\t}\n\t\t\tbase.OnDragDataGet (context, selection_data, info, time_);\n\t\t}\n\n\t\tprotected override void OnDragDataReceived (DragContext context, int x, int y, SelectionData selection_data, uint info, uint time_)\n\t\t{\n\t\t\tvar undo = OpenUndoGroup ();\n\t\t\tint dragOffset = Document.LocationToOffset (dragCaretPos);\n\t\t\tif (context.Action == DragAction.Move) {\n\t\t\t\tif (CanEdit (Caret.Line) && !selection.IsEmpty) {\n\t\t\t\t\tvar selectionRange = selection.GetSelectionRange (textEditorData);\n\t\t\t\t\tif (selectionRange.Offset < dragOffset)\n\t\t\t\t\t\tdragOffset -= selectionRange.Length;\n\t\t\t\t\tCaret.PreserveSelection = true;\n\t\t\t\t\ttextEditorData.DeleteSelection (selection);\n\t\t\t\t\tCaret.PreserveSelection = false;\n\n\t\t\t\t\tselection = Selection.Empty;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selection_data.Length > 0 && selection_data.Format == 8) {\n\t\t\t\tCaret.Offset = dragOffset;\n\t\t\t\tif (CanEdit (dragCaretPos.Line)) {\n\t\t\t\t\tint offset = Caret.Offset;\n\t\t\t\t\tif (!selection.IsEmpty && selection.GetSelectionRange (textEditorData).Offset >= offset) {\n\t\t\t\t\t\tvar start = Document.OffsetToLocation (selection.GetSelectionRange (textEditorData).Offset + selection_data.Text.Length);\n\t\t\t\t\t\tvar end = Document.OffsetToLocation (selection.GetSelectionRange (textEditorData).Offset + selection_data.Text.Length + selection.GetSelectionRange (textEditorData).Length);\n\t\t\t\t\t\tselection = new Selection (start, end);\n\t\t\t\t\t}\n\t\t\t\t\ttextEditorData.PasteText (offset, selection_data.Text, null, ref undo);\n\t\t\t\t\tCaret.Offset = offset + selection_data.Text.Length;\n\t\t\t\t\tMainSelection = new Selection (Document.OffsetToLocation (offset), Document.OffsetToLocation (offset + selection_data.Text.Length));\n\t\t\t\t}\n\t\t\t\tdragOver = false;\n\t\t\t\tcontext = null;\n\t\t\t}\n\t\t\tmouseButtonPressed = 0;\n\t\t\tundo.Dispose ();\n\t\t\tbase.OnDragDataReceived (context, x, y, selection_data, info, time_);\n\t\t}\n\n\t\tprotected override bool OnDragMotion (DragContext context, int x, int y, uint time)\n\t\t{\n\t\t\tif (!this.HasFocus)\n\t\t\t\tthis.GrabFocus ();\n\t\t\tif (!dragOver) {\n\t\t\t\tdefaultCaretPos = Caret.Location;\n\t\t\t}\n\t\t\t\n\t\t\tDocumentLocation oldLocation = Caret.Location;\n\t\t\tdragOver = true;\n\t\t\tCaret.PreserveSelection = true;\n\t\t\tdragCaretPos = PointToLocation (x - textViewMargin.XOffset, y);\n\t\t\tint offset = Document.LocationToOffset (dragCaretPos);\n\t\t\tif (!selection.IsEmpty && offset >= this.selection.GetSelectionRange (textEditorData).Offset && offset < this.selection.GetSelectionRange (textEditorData).EndOffset) {\n\t\t\t\tGdk.Drag.Status (context, DragAction.Default, time);\n\t\t\t\tCaret.Location = defaultCaretPos;\n\t\t\t} else {\n\t\t\t\tGdk.Drag.Status (context, (context.Actions & DragAction.Move) == DragAction.Move ? DragAction.Move : DragAction.Copy, time);\n\t\t\t\tCaret.Location = dragCaretPos; \n\t\t\t}\n\t\t\tthis.RedrawLine (oldLocation.Line);\n\t\t\tif (oldLocation.Line != Caret.Line)\n\t\t\t\tthis.RedrawLine (Caret.Line);\n\t\t\tCaret.PreserveSelection = false;\n\t\t\treturn base.OnDragMotion (context, x, y, time);\n\t\t}\n\n\t\tMargin oldMargin = null;\n\t\tbool overChildWidget;\n\n\t\tpublic event EventHandler BeginHover;\n\n\t\tprotected virtual void OnBeginHover (EventArgs e)\n\t\t{\n\t\t\tvar handler = BeginHover;\n\t\t\tif (handler != null)\n\t\t\t\thandler (this, e);\n\t\t}\n\n\t\tprotected override bool OnMotionNotifyEvent (Gdk.EventMotion e)\n\t\t{\n\t\t\tOnBeginHover (EventArgs.Empty);\n\t\t\ttry {\n\t\t\t\t// The coordinates have to be properly adjusted to the origin since\n\t\t\t\t// the event may come from a child widget\n\t\t\t\tint rx, ry;\n\t\t\t\tGdkWindow.GetOrigin (out rx, out ry);\n\t\t\t\tdouble x = (int)e.XRoot - rx;\n\t\t\t\tdouble y = (int)e.YRoot - ry;\n\t\t\t\toverChildWidget = containerChildren.Any (w => w.Child.Allocation.Contains ((int)x, (int)y));\n\n\t\t\t\tRemoveScrollWindowTimer ();\n\t\t\t\tGdk.ModifierType mod = e.State;\n\t\t\t\tdouble startPos;\n\t\t\t\tMargin margin = GetMarginAtX (x, out startPos);\n\t\t\t\tif (textViewMargin.inDrag && margin == this.textViewMargin && Gtk.Drag.CheckThreshold (this, (int)pressPositionX, (int)pressPositionY, (int)x, (int)y)) {\n\t\t\t\t\tdragContents = new ClipboardActions.CopyOperation ();\n\t\t\t\t\tdragContents.CopyData (textEditorData);\n\t\t\t\t\tDragContext context = Gtk.Drag.Begin (this, ClipboardActions.CopyOperation.TargetList, DragAction.Move | DragAction.Copy, 1, e);\n\t\t\t\t\tif (!Platform.IsMac) {\n\t\t\t\t\t\tCodeSegmentPreviewWindow window = new CodeSegmentPreviewWindow (textEditorData.Parent, true, textEditorData.SelectionRange, 300, 300);\n\t\t\t\t\t\tGtk.Drag.SetIconWidget (context, window, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t\tselection = MainSelection;\n\t\t\t\t\ttextViewMargin.inDrag = false;\n\t\t\t\t} else {\n\t\t\t\t\tFireMotionEvent (x, y, mod);\n\t\t\t\t\tif (mouseButtonPressed != 0) {\n\t\t\t\t\t\tUpdateScrollWindowTimer (x, y, mod);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tGLib.ExceptionManager.RaiseUnhandledException (ex, false);\n\t\t\t}\n\t\t\treturn base.OnMotionNotifyEvent (e);\n\t\t}\n\n\t\tuint scrollWindowTimer = 0;\n\t\tdouble scrollWindowTimer_x;\n\t\tdouble scrollWindowTimer_y;\n\t\tGdk.ModifierType scrollWindowTimer_mod;\n\n\t\tvoid UpdateScrollWindowTimer (double x, double y, Gdk.ModifierType mod)\n\t\t{\n\t\t\tscrollWindowTimer_x = x;\n\t\t\tscrollWindowTimer_y = y;\n\t\t\tscrollWindowTimer_mod = mod;\n\t\t\tif (scrollWindowTimer == 0) {\n\t\t\t\tscrollWindowTimer = GLib.Timeout.Add (50, delegate {\n\t\t\t\t\tFireMotionEvent (scrollWindowTimer_x, scrollWindowTimer_y, scrollWindowTimer_mod);\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvoid RemoveScrollWindowTimer ()\n\t\t{\n\t\t\tif (scrollWindowTimer != 0) {\n\t\t\t\tGLib.Source.Remove (scrollWindowTimer);\n\t\t\t\t\n\t\t\t\tscrollWindowTimer = 0;\n\t\t\t}\n\t\t}\n\n\t\tGdk.ModifierType lastState = ModifierType.None;\n\n\t\tvoid FireMotionEvent (double x, double y, Gdk.ModifierType state)\n\t\t{\n\t\t\tlastState = state;\n\t\t\tmx = x - textViewMargin.XOffset;\n\t\t\tmy = y;\n\n\t\t\tShowTooltip (state);\n\n\t\t\tdouble startPos;\n\t\t\tMargin margin;\n\t\t\tif (textViewMargin.InSelectionDrag) {\n\t\t\t\tmargin = textViewMargin;\n\t\t\t\tstartPos = textViewMargin.XOffset;\n\t\t\t} else {\n\t\t\t\tmargin = GetMarginAtX (x, out startPos);\n\t\t\t\tif (margin != null && GdkWindow != null) {\n\t\t\t\t\tif (!overChildWidget)\n\t\t\t\t\t\tGdkWindow.Cursor = margin.MarginCursor;\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Set the default cursor when the mouse is over an embedded widget\n\t\t\t\t\t\tGdkWindow.Cursor = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (oldMargin != margin && oldMargin != null)\n\t\t\t\toldMargin.MouseLeft ();\n\t\t\t\n\t\t\tif (margin != null)\n\t\t\t\tmargin.MouseHover (new MarginMouseEventArgs (textEditorData.Parent, EventType.MotionNotify,\n\t\t\t\t                                             mouseButtonPressed, x - startPos, y, state));\n\t\t\toldMargin = margin;\n\t\t}\n\n\t\t#region CustomDrag (for getting dnd data from toolbox items for example)\n\n\t\tstring customText;\n\t\tGtk.Widget customSource;\n\n\t\tpublic void BeginDrag (string text, Gtk.Widget source, DragContext context)\n\t\t{\n\t\t\tcustomText = text;\n\t\t\tcustomSource = source;\n\t\t\tsource.DragDataGet += CustomDragDataGet;\n\t\t\tsource.DragEnd += CustomDragEnd;\n\t\t}\n\n\t\tvoid CustomDragDataGet (object sender, Gtk.DragDataGetArgs args)\n\t\t{\n\t\t\targs.SelectionData.Text = customText;\n\t\t}\n\n\t\tvoid CustomDragEnd (object sender, Gtk.DragEndArgs args)\n\t\t{\n\t\t\tcustomSource.DragDataGet -= CustomDragDataGet;\n\t\t\tcustomSource.DragEnd -= CustomDragEnd;\n\t\t\tcustomSource = null;\n\t\t\tcustomText = null;\n\t\t}\n\n\t\t#endregion\n\n\t\tbool isMouseTrapped = false;\n\n\t\tprotected override bool OnEnterNotifyEvent (EventCrossing evnt)\n\t\t{\n\t\t\tisMouseTrapped = true;\n\t\t\treturn base.OnEnterNotifyEvent (evnt);\n\t\t}\n\n\t\tprotected override bool OnLeaveNotifyEvent (Gdk.EventCrossing e)\n\t\t{\n\t\t\tisMouseTrapped = false;\n\t\t\tif (tipWindow != null && currentTooltipProvider != null) {\n\t\t\t\tif (!currentTooltipProvider.IsInteractive (textEditorData.Parent, tipWindow))\n\t\t\t\t\tDelayedHideTooltip ();\n\t\t\t} else {\n\t\t\t\tHideTooltip ();\n\t\t\t}\n\t\t\ttextViewMargin.HideCodeSegmentPreviewWindow ();\n\t\t\t\n\t\t\tif (GdkWindow != null)\n\t\t\t\tGdkWindow.Cursor = null;\n\t\t\tif (oldMargin != null)\n\t\t\t\toldMargin.MouseLeft ();\n\t\t\t\n\t\t\treturn base.OnLeaveNotifyEvent (e); \n\t\t}\n\n\t\tpublic double LineHeight {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.LineHeight;\n\t\t\t}\n\t\t\tinternal set {\n\t\t\t\tthis.textEditorData.LineHeight = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic TextViewMargin TextViewMargin {\n\t\t\tget {\n\t\t\t\treturn textViewMargin;\n\t\t\t}\n\t\t}\n\n\t\tpublic Margin IconMargin {\n\t\t\tget { return iconMargin; }\n\t\t}\n\n\t\tpublic ActionMargin ActionMargin {\n\t\t\tget { return actionMargin; }\n\t\t}\n\n\t\tpublic DocumentLocation LogicalToVisualLocation (DocumentLocation location)\n\t\t{\n\t\t\treturn textEditorData.LogicalToVisualLocation (location);\n\t\t}\n\n\t\tpublic DocumentLocation LogicalToVisualLocation (int line, int column)\n\t\t{\n\t\t\treturn textEditorData.LogicalToVisualLocation (line, column);\n\t\t}\n\n\t\tpublic void CenterToCaret ()\n\t\t{\n\t\t\tCenterTo (Caret.Location);\n\t\t}\n\n\t\tpublic void CenterTo (int offset)\n\t\t{\n\t\t\tCenterTo (Document.OffsetToLocation (offset));\n\t\t}\n\n\t\tpublic void CenterTo (int line, int column)\n\t\t{\n\t\t\tCenterTo (new DocumentLocation (line, column));\n\t\t}\n\n\t\tpublic void CenterTo (DocumentLocation p)\n\t\t{\n\t\t\tif (isDisposed || p.Line < 0 || p.Line > Document.LineCount)\n\t\t\t\treturn;\n\t\t\tSetAdjustments (this.Allocation);\n\t\t\t//\t\t\tAdjustment adj;\n\t\t\t//adj.Upper\n\t\t\tif (this.textEditorData.VAdjustment.Upper < Allocation.Height) {\n\t\t\t\tthis.textEditorData.VAdjustment.Value = 0;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t//\tint yMargin = 1 * this.LineHeight;\n\t\t\tdouble caretPosition = LineToY (p.Line);\n\t\t\tcaretPosition -= this.textEditorData.VAdjustment.PageSize / 2;\n\n\t\t\t// Make sure the caret position is inside the bounds. This avoids an unnecessary bump of the scrollview.\n\t\t\t// The adjustment does this check, but does it after assigning the value, so the value may be out of bounds for a while.\n\t\t\tif (caretPosition + this.textEditorData.VAdjustment.PageSize > this.textEditorData.VAdjustment.Upper)\n\t\t\t\tcaretPosition = this.textEditorData.VAdjustment.Upper - this.textEditorData.VAdjustment.PageSize;\n\n\t\t\tthis.textEditorData.VAdjustment.Value = caretPosition;\n\t\t\t\n\t\t\tif (this.textEditorData.HAdjustment.Upper < Allocation.Width) {\n\t\t\t\tthis.textEditorData.HAdjustment.Value = 0;\n\t\t\t} else {\n\t\t\t\tdouble caretX = ColumnToX (Document.GetLine (p.Line), p.Column);\n\t\t\t\tdouble textWith = Allocation.Width - textViewMargin.XOffset;\n\t\t\t\tif (this.textEditorData.HAdjustment.Value > caretX) {\n\t\t\t\t\tthis.textEditorData.HAdjustment.Value = caretX;\n\t\t\t\t} else if (this.textEditorData.HAdjustment.Value + textWith < caretX + TextViewMargin.CharWidth) {\n\t\t\t\t\tdouble adjustment = System.Math.Max (0, caretX - textWith + TextViewMargin.CharWidth);\n\t\t\t\t\tthis.textEditorData.HAdjustment.Value = adjustment;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void ScrollTo (int offset)\n\t\t{\n\t\t\tScrollTo (Document.OffsetToLocation (offset));\n\t\t}\n\n\t\tpublic void ScrollTo (int line, int column)\n\t\t{\n\t\t\tScrollTo (new DocumentLocation (line, column));\n\t\t}\n\t\t//\t\tclass ScrollingActor\n\t\t//\t\t{\n\t\t//\t\t\treadonly TextEditor editor;\n\t\t//\t\t\treadonly double targetValue;\n\t\t//\t\t\treadonly double initValue;\n\t\t//\n\t\t//\t\t\tpublic ScrollingActor (Mono.TextEditor.TextEditor editor, double targetValue)\n\t\t//\t\t\t{\n\t\t//\t\t\t\tthis.editor = editor;\n\t\t//\t\t\t\tthis.targetValue = targetValue;\n\t\t//\t\t\t\tthis.initValue = editor.VAdjustment.Value;\n\t\t//\t\t\t}\n\t\t//\n\t\t//\t\t\tpublic bool Step (Actor<ScrollingActor> actor)\n\t\t//\t\t\t{\n\t\t//\t\t\t\tif (actor.Expired) {\n\t\t//\t\t\t\t\teditor.VAdjustment.Value = targetValue;\n\t\t//\t\t\t\t\treturn false;\n\t\t//\t\t\t\t}\n\t\t//\t\t\t\tvar newValue = initValue + (targetValue - initValue) / 100   * actor.Percent;\n\t\t//\t\t\t\teditor.VAdjustment.Value = newValue;\n\t\t//\t\t\t\treturn true;\n\t\t//\t\t\t}\n\t\t//\t\t}\n\t\tinternal void SmoothScrollTo (double value)\n\t\t{\n\t\t\tthis.textEditorData.VAdjustment.Value = value;\n/*\t\t\tStage<ScrollingActor> scroll = new Stage<ScrollingActor> (50);\n\t\t\tscroll.UpdateFrequency = 10;\n\t\t\tvar scrollingActor = new ScrollingActor (this, value);\n\t\t\tscroll.Add (scrollingActor, 50);\n\n\t\t\tscroll.ActorStep += scrollingActor.Step;\n\t\t\tscroll.Play ();*/\n\t\t}\n\n\t\tpublic void ScrollTo (DocumentLocation p)\n\t\t{\n\t\t\tif (isDisposed || p.Line < 0 || p.Line > Document.LineCount || inCaretScroll)\n\t\t\t\treturn;\n\t\t\tinCaretScroll = true;\n\t\t\ttry {\n\t\t\t\tif (this.textEditorData.VAdjustment.Upper < Allocation.Height) {\n\t\t\t\t\tthis.textEditorData.VAdjustment.Value = 0;\n\t\t\t\t} else {\n\t\t\t\t\tdouble caretPosition = LineToY (p.Line);\n\t\t\t\t\tif (this.textEditorData.VAdjustment.Value > caretPosition) {\n\t\t\t\t\t\tthis.textEditorData.VAdjustment.Value = caretPosition;\n\t\t\t\t\t} else if (this.textEditorData.VAdjustment.Value + this.textEditorData.VAdjustment.PageSize - this.LineHeight < caretPosition) {\n\t\t\t\t\t\tthis.textEditorData.VAdjustment.Value = caretPosition - this.textEditorData.VAdjustment.PageSize + this.LineHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (this.textEditorData.HAdjustment.Upper < Allocation.Width) {\n\t\t\t\t\tthis.textEditorData.HAdjustment.Value = 0;\n\t\t\t\t} else {\n\t\t\t\t\tdouble caretX = ColumnToX (Document.GetLine (p.Line), p.Column);\n\t\t\t\t\tdouble textWith = Allocation.Width - textViewMargin.XOffset;\n\t\t\t\t\tif (this.textEditorData.HAdjustment.Value > caretX) {\n\t\t\t\t\t\tthis.textEditorData.HAdjustment.Value = caretX;\n\t\t\t\t\t} else if (this.textEditorData.HAdjustment.Value + textWith < caretX + TextViewMargin.CharWidth) {\n\t\t\t\t\t\tdouble adjustment = System.Math.Max (0, caretX - textWith + TextViewMargin.CharWidth);\n\t\t\t\t\t\tthis.textEditorData.HAdjustment.Value = adjustment;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tinCaretScroll = false;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Scrolls the editor as required for making the specified area visible \n\t\t/// </summary>\n\t\tpublic void ScrollTo (Gdk.Rectangle rect)\n\t\t{\n\t\t\tinCaretScroll = true;\n\t\t\ttry {\n\t\t\t\tvar vad = this.textEditorData.VAdjustment;\n\t\t\t\tif (vad.Upper < Allocation.Height) {\n\t\t\t\t\tvad.Value = 0;\n\t\t\t\t} else {\n\t\t\t\t\tif (vad.Value >= rect.Top) {\n\t\t\t\t\t\tvad.Value = rect.Top;\n\t\t\t\t\t} else if (vad.Value + vad.PageSize - rect.Height < rect.Top) {\n\t\t\t\t\t\tvad.Value = rect.Top - vad.PageSize + rect.Height;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar had = this.textEditorData.HAdjustment;\n\t\t\t\tif (had.Upper < Allocation.Width) {\n\t\t\t\t\thad.Value = 0;\n\t\t\t\t} else {\n\t\t\t\t\tif (had.Value >= rect.Left) {\n\t\t\t\t\t\thad.Value = rect.Left;\n\t\t\t\t\t} else if (had.Value + had.PageSize - rect.Width < rect.Left) {\n\t\t\t\t\t\thad.Value = rect.Left - had.PageSize + rect.Width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tinCaretScroll = false;\n\t\t\t}\n\t\t}\n\n\t\tbool inCaretScroll = false;\n\n\t\tpublic void ScrollToCaret ()\n\t\t{\n\t\t\tScrollTo (Caret.Location);\n\t\t}\n\n\t\tpublic void TryToResetHorizontalScrollPosition ()\n\t\t{\n\t\t\tint caretX = (int)ColumnToX (Document.GetLine (Caret.Line), Caret.Column);\n\t\t\tint textWith = Allocation.Width - (int)textViewMargin.XOffset;\n\t\t\tif (caretX < textWith - TextViewMargin.CharWidth)\n\t\t\t\tthis.textEditorData.HAdjustment.Value = 0;\n\t\t}\n\n\t\tprotected override void OnSizeAllocated (Gdk.Rectangle allocation)\n\t\t{\n\t\t\tbase.OnSizeAllocated (allocation);\n\t\t\tSetAdjustments (Allocation);\n\t\t\tsizeHasBeenAllocated = true;\n\t\t\tif (Options.WrapLines)\n\t\t\t\ttextViewMargin.PurgeLayoutCache ();\n\t\t\tSetChildrenPositions (allocation);\n\t\t}\n\n\t\tuint lastScrollTime;\n\n\t\tprotected override bool OnScrollEvent (EventScroll evnt)\n\t\t{\n\t\t\tvar modifier = !Platform.IsMac ? Gdk.ModifierType.ControlMask\n\t\t\t\t//Mac window manager already uses control-scroll, so use command\n\t\t\t\t//Command might be either meta or mod1, depending on GTK version\n\t\t\t\t: (Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask);\n\n\t\t\tvar hasZoomModifier = (evnt.State & modifier) != 0;\n\t\t\tif (hasZoomModifier && lastScrollTime != 0 && (evnt.Time - lastScrollTime) < 100)\n\t\t\t\thasZoomModifier = false;\n\n\t\t\tif (hasZoomModifier) {\n\t\t\t\tif (evnt.Direction == ScrollDirection.Up)\n\t\t\t\t\tOptions.ZoomIn ();\n\t\t\t\telse if (evnt.Direction == ScrollDirection.Down)\n\t\t\t\t\tOptions.ZoomOut ();\n\t\t\t\t\n\t\t\t\tthis.QueueDraw ();\n\t\t\t\tif (isMouseTrapped)\n\t\t\t\t\tFireMotionEvent (mx + textViewMargin.XOffset, my, lastState);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tlastScrollTime = evnt.Time;\n\t\t\treturn base.OnScrollEvent (evnt); \n\t\t}\n\n\t\tvoid SetHAdjustment ()\n\t\t{\n\t\t\ttextEditorData.HeightTree.Rebuild ();\n\t\t\t\n\t\t\tif (textEditorData.HAdjustment == null || Options == null)\n\t\t\t\treturn;\n\t\t\ttextEditorData.HAdjustment.ValueChanged -= HAdjustmentValueChanged;\n\t\t\tif (Options.WrapLines) {\n\t\t\t\tthis.textEditorData.HAdjustment.SetBounds (0, 0, 0, 0, 0);\n\t\t\t} else {\n\t\t\t\tif (longestLine != null && this.textEditorData.HAdjustment != null) {\n\t\t\t\t\tdouble maxX = longestLineWidth;\n\t\t\t\t\tif (maxX > Allocation.Width)\n\t\t\t\t\t\tmaxX += 2 * this.textViewMargin.CharWidth;\n\t\t\t\t\tdouble width = Allocation.Width - this.TextViewMargin.XOffset;\n\t\t\t\t\tvar realMaxX = System.Math.Max (maxX, this.textEditorData.HAdjustment.Value + width);\n\n\t\t\t\t\tforeach (var containerChild in editor.containerChildren.Concat (containerChildren)) {\n\t\t\t\t\t\tif (containerChild.Child == this)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\trealMaxX = System.Math.Max (realMaxX, containerChild.X + containerChild.Child.Allocation.Width);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.textEditorData.HAdjustment.SetBounds (\n\t\t\t\t\t\t0,\n\t\t\t\t\t\trealMaxX,\n\t\t\t\t\t\tthis.textViewMargin.CharWidth,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\twidth);\n\t\t\t\t\tif (realMaxX < width)\n\t\t\t\t\t\tthis.textEditorData.HAdjustment.Value = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttextEditorData.HAdjustment.ValueChanged += HAdjustmentValueChanged;\n\t\t}\n\n\t\tinternal void SetAdjustments ()\n\t\t{\n\t\t\tSetAdjustments (Allocation);\n\t\t}\n\n\t\tpublic const int EditorLineThreshold = 0;\n\n\t\tinternal void SetAdjustments (Gdk.Rectangle allocation)\n\t\t{\n\t\t\tSetHAdjustment ();\n\t\t\t\n\t\t\tif (this.textEditorData.VAdjustment != null) {\n\t\t\t\tdouble maxY = textEditorData.HeightTree.TotalHeight;\n\t\t\t\tif (maxY > allocation.Height)\n\t\t\t\t\tmaxY += EditorLineThreshold * this.LineHeight;\n\n\t\t\t\tforeach (var containerChild in editor.containerChildren.Concat (containerChildren)) {\n\t\t\t\t\tmaxY = System.Math.Max (maxY, containerChild.Y + containerChild.Child.SizeRequest ().Height);\n\t\t\t\t}\n\n\t\t\t\tif (VAdjustment.Value > maxY - allocation.Height) {\n\t\t\t\t\tVAdjustment.Value = System.Math.Max (0, maxY - allocation.Height);\n\t\t\t\t\tQueueDraw ();\n\t\t\t\t}\n\t\t\t\tthis.textEditorData.VAdjustment.SetBounds (0, \n\t\t\t\t                                           System.Math.Max (allocation.Height, maxY), \n\t\t\t\t                                           LineHeight,\n\t\t\t\t                                           allocation.Height,\n\t\t\t\t                                           allocation.Height);\n\t\t\t\tif (maxY < allocation.Height)\n\t\t\t\t\tthis.textEditorData.VAdjustment.Value = 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic int GetWidth (string text)\n\t\t{\n\t\t\treturn this.textViewMargin.GetWidth (text);\n\t\t}\n\n\t\tvoid UpdateMarginXOffsets ()\n\t\t{\n\t\t\tdouble curX = 0;\n\t\t\tforeach (Margin margin in this.margins) {\n\t\t\t\tif (!margin.IsVisible)\n\t\t\t\t\tcontinue;\n\t\t\t\tmargin.XOffset = curX;\n\t\t\t\tcurX += margin.Width;\n\t\t\t}\n\t\t}\n\n\t\tvoid RenderMargins (Cairo.Context cr, Cairo.Context textViewCr, Cairo.Rectangle cairoRectangle)\n\t\t{\n\t\t\tthis.TextViewMargin.rulerX = Options.RulerColumn * this.TextViewMargin.CharWidth - this.textEditorData.HAdjustment.Value;\n\t\t\tint startLine = YToLine (cairoRectangle.Y + this.textEditorData.VAdjustment.Value);\n\t\t\tdouble startY = LineToY (startLine);\n\t\t\tdouble curY = startY - this.textEditorData.VAdjustment.Value;\n\t\t\tbool setLongestLine = false;\n\t\t\tforeach (var margin in this.margins) {\n\t\t\t\tif (margin.BackgroundRenderer != null)\n\t\t\t\t\tmargin.BackgroundRenderer.Draw (cr, cairoRectangle);\n\t\t\t}\n\n\n\t\t\tfor (int visualLineNumber = textEditorData.LogicalToVisualLine (startLine);; visualLineNumber++) {\n\t\t\t\tint logicalLineNumber = textEditorData.VisualToLogicalLine (visualLineNumber);\n\t\t\t\tvar line = Document.GetLine (logicalLineNumber);\n\n\t\t\t\t// Ensure that the correct line height is set.\n\t\t\t\tif (line != null) {\n\t\t\t\t\tvar wrapper = textViewMargin.GetLayout (line);\n\t\t\t\t\tif (wrapper.IsUncached)\n\t\t\t\t\t\twrapper.Dispose ();\n\t\t\t\t}\n\n\t\t\t\tdouble lineHeight = GetLineHeight (line);\n\t\t\t\tforeach (var margin in this.margins) {\n\t\t\t\t\tif (!margin.IsVisible)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmargin.Draw (margin == textViewMargin ? textViewCr : cr, cairoRectangle, line, logicalLineNumber, margin.XOffset, curY, lineHeight);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.Console.WriteLine (e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// take the line real render width from the text view margin rendering (a line can consist of more than \n\t\t\t\t// one line and be longer (foldings!) ex. : someLine1[...]someLine2[...]someLine3)\n\t\t\t\tdouble lineWidth = textViewMargin.lastLineRenderWidth + HAdjustment.Value;\n\t\t\t\tif (longestLine == null || lineWidth > longestLineWidth) {\n\t\t\t\t\tlongestLine = line;\n\t\t\t\t\tlongestLineWidth = lineWidth;\n\t\t\t\t\tsetLongestLine = true;\n\t\t\t\t}\n\t\t\t\tcurY += lineHeight;\n\t\t\t\tif (curY > cairoRectangle.Y + cairoRectangle.Height)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tforeach (var margin in this.margins) {\n\t\t\t\tif (!margin.IsVisible)\n\t\t\t\t\tcontinue;\n\t\t\t\tforeach (var drawer in margin.MarginDrawer)\n\t\t\t\t\tdrawer.Draw (cr, cairoRectangle);\n\t\t\t}\n\t\t\t\n\t\t\tif (setLongestLine)\n\t\t\t\tSetHAdjustment ();\n\t\t}\n\t\t/*\n\t\tprotected override bool OnWidgetEvent (Event evnt)\n\t\t{\n\t\tSystem.Console.WriteLine(evnt);\n\t\treturn base.OnWidgetEvent (evnt);\n\t\t}*/\n\t\tdouble oldVadjustment = 0;\n\n\t\tvoid UpdateAdjustments ()\n\t\t{\n\t\t\tint lastVisibleLine = textEditorData.LogicalToVisualLine (Document.LineCount);\n\t\t\tif (oldRequest != lastVisibleLine) {\n\t\t\t\tSetAdjustments (this.Allocation);\n\t\t\t\toldRequest = lastVisibleLine;\n\t\t\t}\n\t\t}\n\t\t#if DEBUG_EXPOSE\n\t\tDateTime started = DateTime.Now;\n#endif\n\t\tprotected override bool OnExposeEvent (Gdk.EventExpose e)\n\t\t{\n\t\t\tif (this.isDisposed)\n\t\t\t\treturn false;\n\t\t\tUpdateAdjustments ();\n\n\n\t\t\tvar area = e.Region.Clipbox;\n\t\t\tvar cairoArea = new Cairo.Rectangle (area.X, area.Y, area.Width, area.Height);\n\t\t\tusing (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window))\n\t\t\tusing (Cairo.Context textViewCr = Gdk.CairoHelper.Create (e.Window)) {\n\t\t\t\tif (!Options.UseAntiAliasing) {\n\t\t\t\t\ttextViewCr.Antialias = Cairo.Antialias.None;\n\t\t\t\t\tcr.Antialias = Cairo.Antialias.None;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tUpdateMarginXOffsets ();\n\t\t\t\t\n\t\t\t\tcr.LineWidth = Options.Zoom;\n\t\t\t\ttextViewCr.LineWidth = Options.Zoom;\n\t\t\t\ttextViewCr.Rectangle (textViewMargin.XOffset, 0, Allocation.Width - textViewMargin.XOffset, Allocation.Height);\n\t\t\t\ttextViewCr.Clip ();\n\t\t\t\t\n\t\t\t\tRenderMargins (cr, textViewCr, cairoArea);\n\t\t\t\n#if DEBUG_EXPOSE\n\t\t\t\tConsole.WriteLine (\"{0} expose {1},{2} {3}x{4}\", (long)(DateTime.Now - started).TotalMilliseconds,\n\t\t\t\te.Area.X, e.Area.Y, e.Area.Width, e.Area.Height);\n#endif\n\t\t\t\tif (requestResetCaretBlink && HasFocus) {\n\t\t\t\t\ttextViewMargin.ResetCaretBlink (200);\n\t\t\t\t\trequestResetCaretBlink = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach (Animation animation in actors) {\n\t\t\t\t\tanimation.Drawer.Draw (cr);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (HasFocus)\n\t\t\t\t\ttextViewMargin.DrawCaret (e.Window, e.Area);\n\t\t\t\t\n\t\t\t\tOnPainted (new PaintEventArgs (cr, cairoArea));\n\t\t\t}\n\n\t\t\tif (Caret.IsVisible)\n\t\t\t\ttextViewMargin.DrawCaret (e.Window, Allocation);\n\n\t\t\treturn base.OnExposeEvent (e);\n\t\t}\n\n\t\tprotected virtual void OnPainted (PaintEventArgs e)\n\t\t{\n\t\t\tEventHandler<PaintEventArgs> handler = this.Painted;\n\t\t\tif (handler != null)\n\t\t\t\thandler (this, e);\n\t\t}\n\n\t\tpublic event EventHandler<PaintEventArgs> Painted;\n\n\t\t#region TextEditorData delegation\n\n\t\tpublic string EolMarker {\n\t\t\tget {\n\t\t\t\treturn textEditorData.EolMarker;\n\t\t\t}\n\t\t}\n\n\t\tpublic Mono.TextEditor.Highlighting.ColorScheme ColorStyle {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.ColorStyle;\n\t\t\t}\n\t\t}\n\n\t\tpublic EditMode CurrentMode {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.CurrentMode;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.textEditorData.CurrentMode = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsSomethingSelected {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.IsSomethingSelected;\n\t\t\t}\n\t\t}\n\n\t\tpublic Selection MainSelection {\n\t\t\tget {\n\t\t\t\treturn textEditorData.MainSelection;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttextEditorData.MainSelection = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic SelectionMode SelectionMode {\n\t\t\tget {\n\t\t\t\treturn textEditorData.SelectionMode;\n\t\t\t}\n\t\t\tset {\n\t\t\t\ttextEditorData.SelectionMode = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic TextSegment SelectionRange {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SelectionRange;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.textEditorData.SelectionRange = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic string SelectedText {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SelectedText;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.textEditorData.SelectedText = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int SelectionAnchor {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SelectionAnchor;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.textEditorData.SelectionAnchor = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<DocumentLine> SelectedLines {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SelectedLines;\n\t\t\t}\n\t\t}\n\n\t\tpublic Adjustment HAdjustment {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.HAdjustment;\n\t\t\t}\n\t\t}\n\n\t\tpublic Adjustment VAdjustment {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.VAdjustment;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Insert (int offset, string value)\n\t\t{\n\t\t\treturn textEditorData.Insert (offset, value);\n\t\t}\n\n\t\tpublic void Remove (DocumentRegion region)\n\t\t{\n\t\t\ttextEditorData.Remove (region);\n\t\t}\n\n\t\tpublic void Remove (TextSegment removeSegment)\n\t\t{\n\t\t\ttextEditorData.Remove (removeSegment);\n\t\t}\n\n\t\tpublic void Remove (int offset, int count)\n\t\t{\n\t\t\ttextEditorData.Remove (offset, count);\n\t\t}\n\n\t\tpublic int Replace (int offset, int count, string value)\n\t\t{\n\t\t\treturn textEditorData.Replace (offset, count, value);\n\t\t}\n\n\t\tpublic void ClearSelection ()\n\t\t{\n\t\t\tthis.textEditorData.ClearSelection ();\n\t\t}\n\n\t\tpublic void DeleteSelectedText ()\n\t\t{\n\t\t\tthis.textEditorData.DeleteSelectedText ();\n\t\t}\n\n\t\tpublic void DeleteSelectedText (bool clearSelection)\n\t\t{\n\t\t\tthis.textEditorData.DeleteSelectedText (clearSelection);\n\t\t}\n\n\t\tpublic void RunEditAction (Action<TextEditorData> action)\n\t\t{\n\t\t\taction (this.textEditorData);\n\t\t}\n\n\t\tpublic void SetSelection (int anchorOffset, int leadOffset)\n\t\t{\n\t\t\tthis.textEditorData.SetSelection (anchorOffset, leadOffset);\n\t\t}\n\n\t\tpublic void SetSelection (DocumentLocation anchor, DocumentLocation lead)\n\t\t{\n\t\t\tthis.textEditorData.SetSelection (anchor, lead);\n\t\t}\n\n\t\tpublic void SetSelection (int anchorLine, int anchorColumn, int leadLine, int leadColumn)\n\t\t{\n\t\t\tthis.textEditorData.SetSelection (anchorLine, anchorColumn, leadLine, leadColumn);\n\t\t}\n\n\t\tpublic void ExtendSelectionTo (DocumentLocation location)\n\t\t{\n\t\t\tthis.textEditorData.ExtendSelectionTo (location);\n\t\t}\n\n\t\tpublic void ExtendSelectionTo (int offset)\n\t\t{\n\t\t\tthis.textEditorData.ExtendSelectionTo (offset);\n\t\t}\n\n\t\tpublic void SetSelectLines (int from, int to)\n\t\t{\n\t\t\tthis.textEditorData.SetSelectLines (from, to);\n\t\t}\n\n\t\tpublic void InsertAtCaret (string text)\n\t\t{\n\t\t\ttextEditorData.InsertAtCaret (text);\n\t\t}\n\n\t\tpublic bool CanEdit (int line)\n\t\t{\n\t\t\treturn textEditorData.CanEdit (line);\n\t\t}\n\n\t\tpublic string GetLineText (int line)\n\t\t{\n\t\t\treturn textEditorData.GetLineText (line);\n\t\t}\n\n\t\tpublic string GetLineText (int line, bool includeDelimiter)\n\t\t{\n\t\t\treturn textEditorData.GetLineText (line, includeDelimiter);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Use with care.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A <see cref=\"TextEditorData\"/>\n\t\t/// </returns>\n\t\tpublic TextEditorData GetTextEditorData ()\n\t\t{\n\t\t\treturn this.textEditorData;\n\t\t}\n\n\t\tpublic event EventHandler SelectionChanged;\n\n\t\tprotected virtual void OnSelectionChanged (EventArgs args)\n\t\t{\n\t\t\tCurrentMode.InternalSelectionChanged (editor, textEditorData);\n\t\t\tif (SelectionChanged != null)\n\t\t\t\tSelectionChanged (this, args);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Document delegation\n\n\t\tpublic int Length {\n\t\t\tget {\n\t\t\t\treturn Document.TextLength;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Text {\n\t\t\tget {\n\t\t\t\treturn Document.Text;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tDocument.Text = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetTextBetween (int startOffset, int endOffset)\n\t\t{\n\t\t\treturn Document.GetTextBetween (startOffset, endOffset);\n\t\t}\n\n\t\tpublic string GetTextBetween (DocumentLocation start, DocumentLocation end)\n\t\t{\n\t\t\treturn Document.GetTextBetween (start, end);\n\t\t}\n\n\t\tpublic string GetTextBetween (int startLine, int startColumn, int endLine, int endColumn)\n\t\t{\n\t\t\treturn Document.GetTextBetween (startLine, startColumn, endLine, endColumn);\n\t\t}\n\n\t\tpublic string GetTextAt (int offset, int count)\n\t\t{\n\t\t\treturn Document.GetTextAt (offset, count);\n\t\t}\n\n\t\tpublic string GetTextAt (TextSegment segment)\n\t\t{\n\t\t\treturn Document.GetTextAt (segment);\n\t\t}\n\n\t\tpublic string GetTextAt (DocumentRegion region)\n\t\t{\n\t\t\treturn Document.GetTextAt (region);\n\t\t}\n\n\t\tpublic char GetCharAt (int offset)\n\t\t{\n\t\t\treturn Document.GetCharAt (offset);\n\t\t}\n\n\t\tpublic IEnumerable<DocumentLine> Lines {\n\t\t\tget {\n\t\t\t\treturn Document.Lines;\n\t\t\t}\n\t\t}\n\n\t\tpublic int LineCount {\n\t\t\tget {\n\t\t\t\treturn Document.LineCount;\n\t\t\t}\n\t\t}\n\n\t\tpublic int LocationToOffset (int line, int column)\n\t\t{\n\t\t\treturn Document.LocationToOffset (line, column);\n\t\t}\n\n\t\tpublic int LocationToOffset (DocumentLocation location)\n\t\t{\n\t\t\treturn Document.LocationToOffset (location);\n\t\t}\n\n\t\tpublic DocumentLocation OffsetToLocation (int offset)\n\t\t{\n\t\t\treturn Document.OffsetToLocation (offset);\n\t\t}\n\n\t\tpublic string GetLineIndent (int lineNumber)\n\t\t{\n\t\t\treturn Document.GetLineIndent (lineNumber);\n\t\t}\n\n\t\tpublic string GetLineIndent (DocumentLine segment)\n\t\t{\n\t\t\treturn Document.GetLineIndent (segment);\n\t\t}\n\n\t\tpublic DocumentLine GetLine (int lineNumber)\n\t\t{\n\t\t\treturn Document.GetLine (lineNumber);\n\t\t}\n\n\t\tpublic DocumentLine GetLineByOffset (int offset)\n\t\t{\n\t\t\treturn Document.GetLineByOffset (offset);\n\t\t}\n\n\t\tpublic int OffsetToLineNumber (int offset)\n\t\t{\n\t\t\treturn Document.OffsetToLineNumber (offset);\n\t\t}\n\n\t\tpublic IDisposable OpenUndoGroup ()\n\t\t{\n\t\t\treturn Document.OpenUndoGroup ();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Search & Replace\n\n\t\tbool highlightSearchPattern = false;\n\n\t\tpublic string SearchPattern {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SearchRequest.SearchPattern;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (this.textEditorData.SearchRequest.SearchPattern != value) {\n\t\t\t\t\tthis.textEditorData.SearchRequest.SearchPattern = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic ISearchEngine SearchEngine {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SearchEngine;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tDebug.Assert (value != null);\n\t\t\t\tthis.textEditorData.SearchEngine = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic event EventHandler HighlightSearchPatternChanged;\n\n\t\tpublic bool HighlightSearchPattern {\n\t\t\tget {\n\t\t\t\treturn highlightSearchPattern;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (highlightSearchPattern != value) {\n\t\t\t\t\tthis.highlightSearchPattern = value;\n\t\t\t\t\tif (HighlightSearchPatternChanged != null)\n\t\t\t\t\t\tHighlightSearchPatternChanged (this, EventArgs.Empty);\n\t\t\t\t\ttextViewMargin.DisposeLayoutDict ();\n\t\t\t\t\tthis.QueueDraw ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCaseSensitive {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SearchRequest.CaseSensitive;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.textEditorData.SearchRequest.CaseSensitive = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsWholeWordOnly {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SearchRequest.WholeWordOnly;\n\t\t\t}\n\t\t\t\n\t\t\tset {\n\t\t\t\tthis.textEditorData.SearchRequest.WholeWordOnly = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic TextSegment SearchRegion {\n\t\t\tget {\n\t\t\t\treturn this.textEditorData.SearchRequest.SearchRegion;\n\t\t\t}\n\t\t\t\n\t\t\tset {\n\t\t\t\tthis.textEditorData.SearchRequest.SearchRegion = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic SearchResult SearchForward (int fromOffset)\n\t\t{\n\t\t\treturn textEditorData.SearchForward (fromOffset);\n\t\t}\n\n\t\tpublic SearchResult SearchBackward (int fromOffset)\n\t\t{\n\t\t\treturn textEditorData.SearchBackward (fromOffset);\n\t\t}\n\n\t\tclass CaretPulseAnimation : IAnimationDrawer\n\t\t{\n\t\t\tTextEditor editor;\n\n\t\t\tpublic double Percent { get; set; }\n\n\t\t\tpublic Gdk.Rectangle AnimationBounds {\n\t\t\t\tget {\n\t\t\t\t\tdouble x = editor.TextViewMargin.caretX;\n\t\t\t\t\tdouble y = editor.TextViewMargin.caretY;\n\t\t\t\t\tdouble extend = 100 * 5;\n\t\t\t\t\tint width = (int)(editor.TextViewMargin.charWidth + 2 * extend * editor.Options.Zoom / 2);\n\t\t\t\t\treturn new Gdk.Rectangle ((int)(x - extend * editor.Options.Zoom / 2), \n\t\t\t\t\t                          (int)(y - extend * editor.Options.Zoom),\n\t\t\t\t\t                          width,\n\t\t\t\t\t                          (int)(editor.LineHeight + 2 * extend * editor.Options.Zoom));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic CaretPulseAnimation (TextEditor editor)\n\t\t\t{\n\t\t\t\tthis.editor = editor;\n\t\t\t}\n\n\t\t\tpublic void Draw (Cairo.Context cr)\n\t\t\t{\n\t\t\t\tdouble x = editor.TextViewMargin.caretX;\n\t\t\t\tdouble y = editor.TextViewMargin.caretY;\n\t\t\t\tif (editor.Caret.Mode != CaretMode.Block)\n\t\t\t\t\tx -= editor.TextViewMargin.charWidth / 2;\n\t\t\t\tcr.Rectangle (editor.TextViewMargin.XOffset, 0, editor.Allocation.Width - editor.TextViewMargin.XOffset, editor.Allocation.Height);\n\t\t\t\tcr.Clip ();\n\n\t\t\t\tdouble extend = Percent * 5;\n\t\t\t\tdouble width = editor.TextViewMargin.charWidth + 2 * extend * editor.Options.Zoom / 2;\n\t\t\t\tFoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, \n\t\t\t\t                                                    x - extend * editor.Options.Zoom / 2, \n\t\t\t\t                                                    y - extend * editor.Options.Zoom, \n\t\t\t\t                                                    System.Math.Min (editor.TextViewMargin.charWidth / 2, width), \n\t\t\t\t                                                    width,\n\t\t\t\t                                                    editor.LineHeight + 2 * extend * editor.Options.Zoom);\n\t\t\t\tCairo.Color color = editor.ColorStyle.PlainText.Foreground;\n\t\t\t\tcolor.A = 0.8;\n\t\t\t\tcr.LineWidth = editor.Options.Zoom;\n\t\t\t\tcr.SetSourceColor (color);\n\t\t\t\tcr.Stroke ();\n\t\t\t\tcr.ResetClip ();\n\t\t\t}\n\t\t}\n\n\t\tpublic enum PulseKind\n\t\t{\n\t\t\tIn,\n\t\t\tOut,\n\t\t\tBounce\n\t\t}\n\n\t\tpublic class RegionPulseAnimation : IAnimationDrawer\n\t\t{\n\t\t\tTextEditor editor;\n\n\t\t\tpublic PulseKind Kind { get; set; }\n\n\t\t\tpublic double Percent { get; set; }\n\n\t\t\tGdk.Rectangle region;\n\n\t\t\tpublic Gdk.Rectangle AnimationBounds {\n\t\t\t\tget {\n\t\t\t\t\tint x = region.X;\n\t\t\t\t\tint y = region.Y;\n\t\t\t\t\tint animationPosition = (int)(100 * 100);\n\t\t\t\t\tint width = (int)(region.Width + 2 * animationPosition * editor.Options.Zoom / 2);\n\t\t\t\t\t\n\t\t\t\t\treturn new Gdk.Rectangle ((int)(x - animationPosition * editor.Options.Zoom / 2), \n\t\t\t\t\t                          (int)(y - animationPosition * editor.Options.Zoom),\n\t\t\t\t\t                          width,\n\t\t\t\t\t                          (int)(region.Height + 2 * animationPosition * editor.Options.Zoom));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic RegionPulseAnimation (TextEditor editor, Gdk.Point position, Gdk.Size size)\n\t\t\t\t: this (editor, new Gdk.Rectangle (position, size))\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic RegionPulseAnimation (TextEditor editor, Gdk.Rectangle region)\n\t\t\t{\n\t\t\t\tif (region.X < 0 || region.Y < 0 || region.Width < 0 || region.Height < 0)\n\t\t\t\t\tthrow new ArgumentException (\"region is invalid\");\n\t\t\t\t\n\t\t\t\tthis.editor = editor;\n\t\t\t\tthis.region = region;\n\t\t\t}\n\n\t\t\tpublic void Draw (Cairo.Context cr)\n\t\t\t{\n\t\t\t\tint x = region.X;\n\t\t\t\tint y = region.Y;\n\t\t\t\tint animationPosition = (int)(Percent * 100);\n\t\t\t\t\n\t\t\t\tcr.Rectangle (editor.TextViewMargin.XOffset, 0, editor.Allocation.Width - editor.TextViewMargin.XOffset, editor.Allocation.Height);\n\t\t\t\tcr.Clip ();\n\n\t\t\t\tint width = (int)(region.Width + 2 * animationPosition * editor.Options.Zoom / 2);\n\t\t\t\tFoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, \n\t\t\t\t                                                    (int)(x - animationPosition * editor.Options.Zoom / 2), \n\t\t\t\t                                                    (int)(y - animationPosition * editor.Options.Zoom), \n\t\t\t\t                                                    System.Math.Min (editor.TextViewMargin.charWidth / 2, width), \n\t\t\t\t                                                    width,\n\t\t\t\t                                                    (int)(region.Height + 2 * animationPosition * editor.Options.Zoom));\n\t\t\t\tCairo.Color color = editor.ColorStyle.PlainText.Foreground;\n\t\t\t\tcolor.A = 0.8;\n\t\t\t\tcr.LineWidth = editor.Options.Zoom;\n\t\t\t\tcr.SetSourceColor (color);\n\t\t\t\tcr.Stroke ();\n\t\t\t\tcr.ResetClip ();\n\t\t\t}\n\t\t}\n\n\t\tGdk.Rectangle RangeToRectangle (DocumentLocation start, DocumentLocation end)\n\t\t{\n\t\t\tif (start.Column < 0 || start.Line < 0 || end.Column < 0 || end.Line < 0)\n\t\t\t\treturn Gdk.Rectangle.Zero;\n\t\t\t\n\t\t\tvar startPt = this.LocationToPoint (start);\n\t\t\tvar endPt = this.LocationToPoint (end);\n\t\t\tint width = endPt.X - startPt.X;\n\t\t\t\n\t\t\tif (startPt.Y != endPt.Y || startPt.X < 0 || startPt.Y < 0 || width < 0)\n\t\t\t\treturn Gdk.Rectangle.Zero;\n\t\t\t\n\t\t\treturn new Gdk.Rectangle (startPt.X, startPt.Y, width, (int)this.LineHeight);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Initiate a pulse at the specified document location\n\t\t/// </summary>\n\t\t/// <param name=\"pulseStart\">\n\t\t/// A <see cref=\"DocumentLocation\"/>\n\t\t/// </param>\n\t\tpublic void PulseCharacter (DocumentLocation pulseStart)\n\t\t{\n\t\t\tif (pulseStart.Column < 0 || pulseStart.Line < 0)\n\t\t\t\treturn;\n\t\t\tvar rect = RangeToRectangle (pulseStart, new DocumentLocation (pulseStart.Line, pulseStart.Column + 1));\n\t\t\tif (rect.X < 0 || rect.Y < 0 || System.Math.Max (rect.Width, rect.Height) <= 0)\n\t\t\t\treturn;\n\t\t\tStartAnimation (new RegionPulseAnimation (editor, rect) {\n\t\t\t\tKind = PulseKind.Bounce\n\t\t\t});\n\t\t}\n\n\t\tpublic SearchResult FindNext (bool setSelection)\n\t\t{\n\t\t\tSearchResult result = textEditorData.FindNext (setSelection);\n\t\t\tTryToResetHorizontalScrollPosition ();\n\t\t\tAnimateSearchResult (result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic void StartCaretPulseAnimation ()\n\t\t{\n\t\t\tStartAnimation (new CaretPulseAnimation (editor));\n\t\t}\n\n\t\tSearchHighlightPopupWindow popupWindow = null;\n\n\t\tpublic void StopSearchResultAnimation ()\n\t\t{\n\t\t\tif (popupWindow == null)\n\t\t\t\treturn;\n\t\t\tpopupWindow.StopPlaying ();\n\t\t}\n\n\t\tpublic void AnimateSearchResult (SearchResult result)\n\t\t{\n\t\t\tif (!IsComposited || !Options.EnableAnimations || result == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\t// Don't animate multi line search results\n\t\t\tif (OffsetToLineNumber (result.Segment.Offset) != OffsetToLineNumber (result.Segment.EndOffset))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tTextViewMargin.MainSearchResult = result.Segment;\n\t\t\tif (!TextViewMargin.MainSearchResult.IsInvalid) {\n\t\t\t\tif (popupWindow != null) {\n\t\t\t\t\tpopupWindow.StopPlaying ();\n\t\t\t\t\tpopupWindow.Destroy ();\n\t\t\t\t}\n\t\t\t\tpopupWindow = new SearchHighlightPopupWindow (editor);\n\t\t\t\tpopupWindow.Result = result;\n\t\t\t\tpopupWindow.Popup ();\n\t\t\t\tpopupWindow.Destroyed += delegate {\n\t\t\t\t\tpopupWindow = null;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tclass SearchHighlightPopupWindow : BounceFadePopupWidget\n\t\t{\n\t\t\tpublic SearchResult Result {\n\t\t\t\tget;\n\t\t\t\tset;\n\t\t\t}\n\n\t\t\tpublic SearchHighlightPopupWindow (TextEditor editor) : base (editor)\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override void Popup ()\n\t\t\t{\n\t\t\t\tExpandWidth = (uint)Editor.LineHeight;\n\t\t\t\tExpandHeight = (uint)Editor.LineHeight / 2;\n\t\t\t\tBounceEasing = Easing.Sine;\n\t\t\t\tDuration = 150;\n\t\t\t\tbase.Popup ();\n\t\t\t}\n\n\t\t\tprotected override void OnAnimationCompleted ()\n\t\t\t{\n\t\t\t\tbase.OnAnimationCompleted ();\n\t\t\t\tDestroy ();\n\t\t\t}\n\n\t\t\tprotected override void OnDestroyed ()\n\t\t\t{\n\t\t\t\tbase.OnDestroyed ();\n\t\t\t\tif (layout != null)\n\t\t\t\t\tlayout.Dispose ();\n\t\t\t}\n\n\t\t\tprotected override Cairo.Rectangle CalculateInitialBounds ()\n\t\t\t{\n\t\t\t\tDocumentLine line = Editor.Document.GetLineByOffset (Result.Offset);\n\t\t\t\tint lineNr = Editor.Document.OffsetToLineNumber (Result.Offset);\n\t\t\t\tISyntaxMode mode = Editor.Document.SyntaxMode != null && Editor.Options.EnableSyntaxHighlighting ? Editor.Document.SyntaxMode : new SyntaxMode (Editor.Document);\n\t\t\t\tint logicalRulerColumn = line.GetLogicalColumn (Editor.GetTextEditorData (), Editor.Options.RulerColumn);\n\t\t\t\tvar lineLayout = Editor.TextViewMargin.CreateLinePartLayout (mode, line, logicalRulerColumn, line.Offset, line.Length, -1, -1);\n\t\t\t\tif (lineLayout == null)\n\t\t\t\t\treturn new Cairo.Rectangle ();\n\t\t\t\t\n\t\t\t\tint l, x1, x2;\n\t\t\t\tint index = Result.Offset - line.Offset - 1;\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\tlineLayout.Layout.IndexToLineX (index, true, out l, out x1);\n\t\t\t\t} else {\n\t\t\t\t\tl = x1 = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tindex = Result.Offset - line.Offset - 1 + Result.Length;\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\tlineLayout.Layout.IndexToLineX (index, true, out l, out x2);\n\t\t\t\t} else {\n\t\t\t\t\tx2 = 0;\n\t\t\t\t\tConsole.WriteLine (\"Invalid end index :\" + index);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble y = Editor.LineToY (lineNr);\n\t\t\t\tdouble w = (x2 - x1) / Pango.Scale.PangoScale;\n\t\t\t\tdouble x = (x1 / Pango.Scale.PangoScale + Editor.TextViewMargin.XOffset + Editor.TextViewMargin.TextStartPosition);\n\t\t\t\tvar h = Editor.LineHeight;\n\n\t\t\t\t//adjust the width to match TextViewMargin\n\t\t\t\tw = System.Math.Ceiling (w + 1);\n\n\t\t\t\t//add space for the shadow\n\t\t\t\tw += shadowOffset;\n\t\t\t\th += shadowOffset;\n\n\t\t\t\treturn new Cairo.Rectangle (x, y, w, h);\n\t\t\t}\n\n\t\t\tconst int shadowOffset = 1;\n\t\t\tPango.Layout layout = null;\n\n\t\t\tprotected override void Draw (Cairo.Context cr, Cairo.Rectangle area)\n\t\t\t{\n\t\t\t\tif (!Editor.Options.UseAntiAliasing)\n\t\t\t\t\tcr.Antialias = Cairo.Antialias.None;\n\t\t\t\tcr.LineWidth = Editor.Options.Zoom;\n\n\t\t\t\tif (layout == null) {\n\t\t\t\t\tlayout = cr.CreateLayout ();\n\t\t\t\t\tlayout.FontDescription = Editor.Options.Font;\n\t\t\t\t\tstring markup = Editor.GetTextEditorData ().GetMarkup (Result.Offset, Result.Length, true);\n\t\t\t\t\tlayout.SetMarkup (markup);\n\t\t\t\t}\n\n\t\t\t\t// subtract off the shadow again\n\t\t\t\tvar width = area.Width - shadowOffset;\n\t\t\t\tvar height = area.Height - shadowOffset;\n\n\t\t\t\t//from TextViewMargin's actual highlighting\n\t\t\t\tdouble corner = System.Math.Min (4, width) * Editor.Options.Zoom;\n\n\t\t\t\t//fill in the highlight rect with solid white to prevent alpha blending artifacts on the corners\n\t\t\t\tFoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, 0, 0, corner, width, height);\n\t\t\t\tcr.SetSourceRGB (1, 1, 1);\n\t\t\t\tcr.Fill ();\n\n\t\t\t\t//draw the shadow\n\t\t\t\tFoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true,\n\t\t\t\t                                                    shadowOffset, shadowOffset, corner, width, height);\n\t\t\t\tvar color = TextViewMargin.DimColor (Editor.ColorStyle.SearchResultMain.Color, 0.3);\n\t\t\t\tcolor.A = 0.5 * opacity * opacity;\n\t\t\t\tcr.SetSourceColor (color);\n\t\t\t\tcr.Fill ();\n\n\t\t\t\t//draw the highlight rectangle\n\t\t\t\tFoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, 0, 0, corner, width, height);\n\t\t\t\tusing (var gradient = new Cairo.LinearGradient (0, 0, 0, height)) {\n\t\t\t\t\tcolor = ColorLerp (\n\t\t\t\t\t\tTextViewMargin.DimColor (Editor.ColorStyle.SearchResultMain.Color, 1.1),\n\t\t\t\t\t\tEditor.ColorStyle.SearchResultMain.Color,\n\t\t\t\t\t\t1 - opacity);\n\t\t\t\t\tgradient.AddColorStop (0, color);\n\t\t\t\t\tcolor = ColorLerp (\n\t\t\t\t\t\tTextViewMargin.DimColor (Editor.ColorStyle.SearchResultMain.Color, 0.9),\n\t\t\t\t\t\tEditor.ColorStyle.SearchResultMain.Color,\n\t\t\t\t\t\t1 - opacity);\n\t\t\t\t\tgradient.AddColorStop (1, color);\n\t\t\t\t\tcr.SetSource (gradient);\n\t\t\t\t\tcr.Fill ();\n\t\t\t\t}\n\n\t\t\t\t//and finally the text\n\t\t\t\tcr.Translate (area.X, area.Y);\n\t\t\t\tcr.SetSourceRGB (0, 0, 0);\n\t\t\t\tcr.ShowLayout (layout);\n\t\t\t}\n\n\t\t\tstatic Cairo.Color ColorLerp (Cairo.Color from, Cairo.Color to, double scale)\n\t\t\t{\n\t\t\t\treturn new Cairo.Color (\n\t\t\t\t\tLerp (from.R, to.R, scale),\n\t\t\t\t\tLerp (from.G, to.G, scale),\n\t\t\t\t\tLerp (from.B, to.B, scale),\n\t\t\t\t\tLerp (from.A, to.A, scale)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tstatic double Lerp (double from, double to, double scale)\n\t\t\t{\n\t\t\t\treturn from + scale * (to - from);\n\t\t\t}\n\t\t}\n\n\t\tpublic SearchResult FindPrevious (bool setSelection)\n\t\t{\n\t\t\tSearchResult result = textEditorData.FindPrevious (setSelection);\n\t\t\tTryToResetHorizontalScrollPosition ();\n\t\t\tAnimateSearchResult (result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic bool Replace (string withPattern)\n\t\t{\n\t\t\treturn textEditorData.SearchReplace (withPattern, true);\n\t\t}\n\n\t\tpublic int ReplaceAll (string withPattern)\n\t\t{\n\t\t\treturn textEditorData.SearchReplaceAll (withPattern);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Tooltips\n\n\t\t[Obsolete (\"This property has been moved to TextEditorData.  Will be removed in future versions.\")]\n\t\tpublic IEnumerable<TooltipProvider> TooltipProviders {\n\t\t\tget { return textEditorData.TooltipProviders; }\n\t\t}\n\t\t// Tooltip fields\n\t\tconst int TooltipTimeout = 650;\n\t\tTooltipItem tipItem;\n\t\tint tipX, tipY;\n\t\tuint tipHideTimeoutId = 0;\n\t\tuint tipShowTimeoutId = 0;\n\t\tstatic Gtk.Window tipWindow;\n\t\tstatic TooltipProvider currentTooltipProvider;\n\t\t// Data for the next tooltip to be shown\n\t\tint nextTipOffset = 0;\n\t\tint nextTipX = 0;\n\t\tint nextTipY = 0;\n\t\tGdk.ModifierType nextTipModifierState = ModifierType.None;\n\t\tDateTime nextTipScheduledTime;\n\t\t// Time at which we want the tooltip to show\n\t\tvoid ShowTooltip (Gdk.ModifierType modifierState)\n\t\t{\n\t\t\tif (mx < TextViewMargin.XOffset + TextViewMargin.TextStartPosition) {\n\t\t\t\tHideTooltip ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar loc = PointToLocation (mx, my, true);\n\t\t\tif (loc.IsEmpty) {\n\t\t\t\tHideTooltip ();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hide editor tooltips for text marker extended regions (message bubbles)\n\t\t\tdouble y = LineToY (loc.Line);\n\t\t\tif (y + LineHeight < my) {\n\t\t\t\tHideTooltip ();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tShowTooltip (modifierState, \n\t\t\t             Document.LocationToOffset (loc),\n\t\t\t             (int)mx,\n\t\t\t             (int)my);\n\t\t}\n\n\t\tvoid ShowTooltip (Gdk.ModifierType modifierState, int offset, int xloc, int yloc)\n\t\t{\n\t\t\tCancelScheduledShow ();\n\t\t\tif (textEditorData.SuppressTooltips)\n\t\t\t\treturn;\n\t\t\tif (tipWindow != null && currentTooltipProvider != null && currentTooltipProvider.IsInteractive (editor, tipWindow)) {\n\t\t\t\tint wx, ww, wh;\n\t\t\t\ttipWindow.GetSize (out ww, out wh);\n\t\t\t\twx = tipX - ww / 2;\n\t\t\t\tif (xloc >= wx && xloc < wx + ww && yloc >= tipY && yloc < tipY + 20 + wh)\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (tipItem != null && !tipItem.ItemSegment.IsInvalid && !tipItem.ItemSegment.Contains (offset))\n\t\t\t\tHideTooltip ();\n\t\t\tnextTipX = xloc;\n\t\t\tnextTipY = yloc;\n\t\t\tnextTipOffset = offset;\n\t\t\tnextTipModifierState = modifierState;\n\t\t\tnextTipScheduledTime = DateTime.Now + TimeSpan.FromMilliseconds (TooltipTimeout);\n\n\t\t\t// If a tooltip is already scheduled, there is no need to create a new timer.\n\t\t\tif (tipShowTimeoutId == 0)\n\t\t\t\ttipShowTimeoutId = GLib.Timeout.Add (TooltipTimeout, TooltipTimer);\n\t\t}\n\n\t\tbool TooltipTimer ()\n\t\t{\n\t\t\t// This timer can't be reused, so reset the var now\n\t\t\ttipShowTimeoutId = 0;\n\t\t\t\n\t\t\t// Cancelled?\n\t\t\tif (nextTipOffset == -1)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tint remainingMs = (int)(nextTipScheduledTime - DateTime.Now).TotalMilliseconds;\n\t\t\tif (remainingMs > 50) {\n\t\t\t\t// Still some significant time left. Re-schedule the timer\n\t\t\t\ttipShowTimeoutId = GLib.Timeout.Add ((uint)remainingMs, TooltipTimer);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Find a provider\n\t\t\tTooltipProvider provider = null;\n\t\t\tTooltipItem item = null;\n\t\t\t\n\t\t\tforeach (TooltipProvider tp in textEditorData.tooltipProviders) {\n\t\t\t\ttry {\n\t\t\t\t\titem = tp.GetItem (editor, nextTipOffset);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.Console.WriteLine (\"Exception in tooltip provider \" + tp + \" GetItem:\");\n\t\t\t\t\tSystem.Console.WriteLine (e);\n\t\t\t\t}\n\t\t\t\tif (item != null) {\n\t\t\t\t\tprovider = tp;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (item != null) {\n\t\t\t\t// Tip already being shown for this item?\n\t\t\t\tif (tipWindow != null && tipItem != null && tipItem.Equals (item)) {\n\t\t\t\t\tCancelScheduledHide ();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttipX = nextTipX;\n\t\t\t\ttipY = nextTipY;\n\t\t\t\ttipItem = item;\n\t\t\t\tGtk.Window tw = null;\n\t\t\t\ttry {\n\t\t\t\t\ttw = provider.ShowTooltipWindow (editor, nextTipOffset, nextTipModifierState, tipX + (int)TextViewMargin.XOffset, tipY, item);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tConsole.WriteLine (\"-------- Exception while creating tooltip:\");\n\t\t\t\t\tConsole.WriteLine (e);\n\t\t\t\t}\n\t\t\t\tif (tw == tipWindow)\n\t\t\t\t\treturn false;\n\t\t\t\tHideTooltip ();\n\t\t\t\tif (tw == null)\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\tCancelScheduledShow ();\n\n\t\t\t\ttipWindow = tw;\n\t\t\t\tcurrentTooltipProvider = provider;\n\t\t\t\t\n\t\t\t\ttipShowTimeoutId = 0;\n\t\t\t} else\n\t\t\t\tHideTooltip ();\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void HideTooltip (bool checkMouseOver = true)\n\t\t{\n\t\t\tCancelScheduledHide ();\n\t\t\tCancelScheduledShow ();\n\t\t\t\n\t\t\tif (tipWindow != null) {\n\t\t\t\tif (checkMouseOver && tipWindow.GdkWindow != null) {\n\t\t\t\t\t// Don't hide the tooltip window if the mouse pointer is inside it.\n\t\t\t\t\tint x, y, w, h;\n\t\t\t\t\tGdk.ModifierType m;\n\t\t\t\t\ttipWindow.GdkWindow.GetPointer (out x, out y, out m);\n\t\t\t\t\ttipWindow.GdkWindow.GetSize (out w, out h);\n\t\t\t\t\tif (x >= 0 && y >= 0 && x < w && y < h)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttipWindow.Destroy ();\n\t\t\t\ttipWindow = null;\n\t\t\t}\n\t\t}\n\n\t\tvoid DelayedHideTooltip ()\n\t\t{\n\t\t\tCancelScheduledHide ();\n\t\t\ttipHideTimeoutId = GLib.Timeout.Add (300, delegate {\n\t\t\t\tHideTooltip ();\n\t\t\t\ttipHideTimeoutId = 0;\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}\n\n\t\tvoid CancelScheduledHide ()\n\t\t{\n\t\t\tCancelScheduledShow ();\n\t\t\tif (tipHideTimeoutId != 0) {\n\t\t\t\tGLib.Source.Remove (tipHideTimeoutId);\n\t\t\t\ttipHideTimeoutId = 0;\n\t\t\t}\n\t\t}\n\n\t\tvoid CancelScheduledShow ()\n\t\t{\n\t\t\t// Don't remove the timeout handler since it may be reused\n\t\t\tnextTipOffset = -1;\n\t\t}\n\n\t\tvoid OnDocumentStateChanged (object s, EventArgs a)\n\t\t{\n\t\t\tHideTooltip ();\n\t\t}\n\n\t\tvoid OnTextSet (object sender, EventArgs e)\n\t\t{\n\t\t\tDocumentLine longest = longestLine;\n\t\t\tforeach (DocumentLine line in Document.Lines) {\n\t\t\t\tif (longest == null || line.Length > longest.Length)\n\t\t\t\t\tlongest = line;\n\t\t\t}\n\t\t\tif (longest != longestLine) {\n\t\t\t\tvar layoutWrapper = textViewMargin.GetLayout (longest);\n\t\t\t\tint width = (int)(layoutWrapper.Width);\n\t\t\t\tif (layoutWrapper.IsUncached)\n\t\t\t\t\tlayoutWrapper.Dispose ();\n\t\t\t\tif (width > this.longestLineWidth) {\n\t\t\t\t\tthis.longestLineWidth = width;\n\t\t\t\t\tthis.longestLine = longest;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Coordinate transformation\n\n\t\tpublic DocumentLocation PointToLocation (double xp, double yp, bool endAtEol = false)\n\t\t{\n\t\t\treturn TextViewMargin.PointToLocation (xp, yp, endAtEol);\n\t\t}\n\n\t\tpublic DocumentLocation PointToLocation (Cairo.Point p)\n\t\t{\n\t\t\treturn TextViewMargin.PointToLocation (p);\n\t\t}\n\n\t\tpublic DocumentLocation PointToLocation (Cairo.PointD p)\n\t\t{\n\t\t\treturn TextViewMargin.PointToLocation (p);\n\t\t}\n\n\t\tpublic Cairo.Point LocationToPoint (DocumentLocation loc)\n\t\t{\n\t\t\treturn TextViewMargin.LocationToPoint (loc);\n\t\t}\n\n\t\tpublic Cairo.Point LocationToPoint (int line, int column)\n\t\t{\n\t\t\treturn TextViewMargin.LocationToPoint (line, column);\n\t\t}\n\n\t\tpublic Cairo.Point LocationToPoint (int line, int column, bool useAbsoluteCoordinates)\n\t\t{\n\t\t\treturn TextViewMargin.LocationToPoint (line, column, useAbsoluteCoordinates);\n\t\t}\n\n\t\tpublic Cairo.Point LocationToPoint (DocumentLocation loc, bool useAbsoluteCoordinates)\n\t\t{\n\t\t\treturn TextViewMargin.LocationToPoint (loc, useAbsoluteCoordinates);\n\t\t}\n\n\t\tpublic double ColumnToX (DocumentLine line, int column)\n\t\t{\n\t\t\treturn TextViewMargin.ColumnToX (line, column);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Calculates the line number at line start (in one visual line could be several logical lines be displayed).\n\t\t/// </summary>\n\t\tpublic int YToLine (double yPos)\n\t\t{\n\t\t\treturn TextViewMargin.YToLine (yPos);\n\t\t}\n\n\t\tpublic double LineToY (int logicalLine)\n\t\t{\n\t\t\treturn TextViewMargin.LineToY (logicalLine);\n\t\t}\n\n\t\tpublic double GetLineHeight (DocumentLine line)\n\t\t{\n\t\t\treturn TextViewMargin.GetLineHeight (line);\n\t\t}\n\n\t\tpublic double GetLineHeight (int logicalLineNumber)\n\t\t{\n\t\t\treturn TextViewMargin.GetLineHeight (logicalLineNumber);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Animation\n\n\t\tStage<Animation> animationStage = new Stage<Animation> ();\n\t\tList<Animation> actors = new List<Animation> ();\n\n\t\tprotected void InitAnimations ()\n\t\t{\n\t\t\tanimationStage.ActorStep += OnAnimationActorStep;\n\t\t\tanimationStage.Iteration += OnAnimationIteration;\n\t\t}\n\n\t\tvoid DisposeAnimations ()\n\t\t{\n\t\t\tif (animationStage != null) {\n\t\t\t\tanimationStage.Playing = false;\n\t\t\t\tanimationStage.ActorStep -= OnAnimationActorStep;\n\t\t\t\tanimationStage.Iteration -= OnAnimationIteration;\n\t\t\t\tanimationStage = null;\n\t\t\t}\n\t\t\t\n\t\t\tif (actors != null) {\n\t\t\t\tforeach (Animation actor in actors) {\n\t\t\t\t\tif (actor is IDisposable)\n\t\t\t\t\t\t((IDisposable)actor).Dispose ();\n\t\t\t\t}\n\t\t\t\tactors.Clear ();\n\t\t\t\tactors = null;\n\t\t\t}\n\t\t}\n\n\t\tAnimation StartAnimation (IAnimationDrawer drawer)\n\t\t{\n\t\t\treturn StartAnimation (drawer, 300);\n\t\t}\n\n\t\tAnimation StartAnimation (IAnimationDrawer drawer, uint duration)\n\t\t{\n\t\t\treturn StartAnimation (drawer, duration, Easing.Linear);\n\t\t}\n\n\t\tAnimation StartAnimation (IAnimationDrawer drawer, uint duration, Easing easing)\n\t\t{\n\t\t\tif (!Options.EnableAnimations)\n\t\t\t\treturn null;\n\t\t\tAnimation animation = new Animation (drawer, duration, easing, Blocking.Upstage);\n\t\t\tanimationStage.Add (animation, duration);\n\t\t\tactors.Add (animation);\n\t\t\treturn animation;\n\t\t}\n\n\t\tbool OnAnimationActorStep (Actor<Animation> actor)\n\t\t{\n\t\t\tswitch (actor.Target.AnimationState) {\n\t\t\tcase AnimationState.Coming:\n\t\t\t\tactor.Target.Drawer.Percent = actor.Percent;\n\t\t\t\tif (actor.Expired) {\n\t\t\t\t\tactor.Target.AnimationState = AnimationState.Going;\n\t\t\t\t\tactor.Reset ();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AnimationState.Going:\n\t\t\t\tif (actor.Expired) {\n\t\t\t\t\tRemoveAnimation (actor.Target);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tactor.Target.Drawer.Percent = 1.0 - actor.Percent;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid RemoveAnimation (Animation animation)\n\t\t{\n\t\t\tif (animation == null)\n\t\t\t\treturn;\n\t\t\tRectangle bounds = animation.Drawer.AnimationBounds;\n\t\t\tactors.Remove (animation);\n\t\t\tif (animation is IDisposable)\n\t\t\t\t((IDisposable)animation).Dispose ();\n\t\t\tQueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height);\n\t\t}\n\n\t\tvoid OnAnimationIteration (object sender, EventArgs args)\n\t\t{\n\t\t\tforeach (Animation actor in actors) {\n\t\t\t\tRectangle bounds = actor.Drawer.AnimationBounds;\n\t\t\t\tQueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tinternal void FireLinkEvent (string link, uint button, ModifierType modifierState)\n\t\t{\n\t\t\tif (LinkRequest != null)\n\t\t\t\tLinkRequest (this, new LinkEventArgs (link, button, modifierState));\n\t\t}\n\n\t\tpublic event EventHandler<LinkEventArgs> LinkRequest;\n\n\t\t/// <summary>\n\t\t/// Inserts a margin at the specified list position\n\t\t/// </summary>\n\t\tpublic void InsertMargin (int index, Margin margin)\n\t\t{\n\t\t\tmargins.Insert (index, margin);\n\t\t\tRedrawFromLine (0);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Checks whether the editor has a margin of a given type\n\t\t/// </summary>\n\t\tpublic bool HasMargin (Type marginType)\n\t\t{\n\t\t\treturn margins.Exists ((margin) => {\n\t\t\t\treturn marginType.IsAssignableFrom (margin.GetType ());\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the first margin of a given type\n\t\t/// </summary>\n\t\tpublic Margin GetMargin (Type marginType)\n\t\t{\n\t\t\treturn margins.Find ((margin) => {\n\t\t\t\treturn marginType.IsAssignableFrom (margin.GetType ());\n\t\t\t});\n\t\t}\n\n\t\tbool requestResetCaretBlink = false;\n\n\t\tpublic void RequestResetCaretBlink ()\n\t\t{\n\t\t\tif (this.IsFocus)\n\t\t\t\trequestResetCaretBlink = true;\n\t\t}\n\n\t\tvoid UpdateLinesOnTextMarkerHeightChange (object sender, LineEventArgs e)\n\t\t{\n\t\t\tif (Document.CurrentAtomicUndoOperationType == OperationType.Format)\n\t\t\t\treturn;\n\t\t\tif (!e.Line.Markers.Any (m => m is IExtendingTextLineMarker))\n\t\t\t\treturn;\n\t\t\tvar line = e.Line.LineNumber;\n\t\t\ttextEditorData.HeightTree.SetLineHeight (line, GetLineHeight (e.Line));\n\t\t\tRedrawLine (line);\n\t\t}\n\n\t\tclass SetCaret\n\t\t{\n\t\t\tTextEditor view;\n\t\t\tint line, column;\n\t\t\tbool highlightCaretLine;\n\t\t\tbool centerCaret;\n\n\t\t\tpublic SetCaret (TextEditor view, int line, int column, bool highlightCaretLine, bool centerCaret)\n\t\t\t{\n\t\t\t\tthis.view = view;\n\t\t\t\tthis.line = line;\n\t\t\t\tthis.column = column;\n\t\t\t\tthis.highlightCaretLine = highlightCaretLine;\n\t\t\t\tthis.centerCaret = centerCaret;\n\t\t\t}\n\n\t\t\tpublic void Run (object sender, EventArgs e)\n\t\t\t{\n\t\t\t\tif (view.IsDisposed)\n\t\t\t\t\treturn;\n\t\t\t\tline = System.Math.Min (line, view.Document.LineCount);\n\t\t\t\tview.Caret.AutoScrollToCaret = false;\n\t\t\t\ttry {\n\t\t\t\t\tview.Caret.Location = new DocumentLocation (line, column);\n\t\t\t\t\tview.GrabFocus ();\n\t\t\t\t\tif (centerCaret)\n\t\t\t\t\t\tview.CenterToCaret ();\n\t\t\t\t\tif (view.TextViewMargin.XOffset == 0)\n\t\t\t\t\t\tview.HAdjustment.Value = 0;\n\t\t\t\t\tview.TextArea.SizeAllocated -= Run;\n\t\t\t\t} finally {\n\t\t\t\t\tview.Caret.AutoScrollToCaret = true;\n\t\t\t\t\tif (highlightCaretLine) {\n\t\t\t\t\t\tview.TextViewMargin.HighlightCaretLine = true;\n\t\t\t\t\t\tview.StartCaretPulseAnimation ();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetCaretTo (int line, int column)\n\t\t{\n\t\t\tSetCaretTo (line, column, true);\n\t\t}\n\n\t\tpublic void SetCaretTo (int line, int column, bool highlight)\n\t\t{\n\t\t\tSetCaretTo (line, column, highlight, true);\n\t\t}\n\n\t\tpublic void SetCaretTo (int line, int column, bool highlight, bool centerCaret)\n\t\t{\n\t\t\tif (line < DocumentLocation.MinLine)\n\t\t\t\tthrow new ArgumentException (\"line < MinLine\");\n\t\t\tif (column < DocumentLocation.MinColumn)\n\t\t\t\tthrow new ArgumentException (\"column < MinColumn\");\n\t\t\t\n\t\t\tif (!sizeHasBeenAllocated) {\n\t\t\t\tSetCaret setCaret = new SetCaret (editor, line, column, highlight, centerCaret);\n\t\t\t\tSizeAllocated += setCaret.Run;\n\t\t\t} else {\n\t\t\t\tnew SetCaret (editor, line, column, highlight, centerCaret).Run (null, null);\n\t\t\t}\n\t\t}\n\n\t\t#region Container\n\n\t\tpublic override ContainerChild this [Widget w] {\n\t\t\tget {\n\t\t\t\treturn containerChildren.FirstOrDefault (info => info.Child == w || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == w));\n\t\t\t}\n\t\t}\n\n\t\tpublic override GLib.GType ChildType ()\n\t\t{\n\t\t\treturn Gtk.Widget.GType;\n\t\t}\n\n\t\tinternal List<TextEditor.EditorContainerChild> containerChildren = new List<TextEditor.EditorContainerChild> ();\n\n\t\tpublic void AddTopLevelWidget (Gtk.Widget widget, int x, int y)\n\t\t{\n\t\t\twidget.Parent = this;\n\t\t\tTextEditor.EditorContainerChild info = new TextEditor.EditorContainerChild (this, widget);\n\t\t\tinfo.X = x;\n\t\t\tinfo.Y = y;\n\t\t\tcontainerChildren.Add (info);\n\t\t\tResizeChild (Allocation, info);\n\t\t\tSetAdjustments ();\n\t\t}\n\n\t\tpublic void MoveTopLevelWidget (Gtk.Widget widget, int x, int y)\n\t\t{\n\t\t\tforeach (var info in containerChildren.ToArray ()) {\n\t\t\t\tif (info.Child == widget || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == widget)) {\n\t\t\t\t\tif (info.X == x && info.Y == y)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tinfo.X = x;\n\t\t\t\t\tinfo.Y = y;\n\t\t\t\t\tif (widget.Visible)\n\t\t\t\t\t\tResizeChild (Allocation, info);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSetAdjustments ();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns the position of an embedded widget\n\t\t/// </summary>\n\t\tpublic void GetTopLevelWidgetPosition (Gtk.Widget widget, out int x, out int y)\n\t\t{\n\t\t\tforeach (var info in containerChildren.ToArray ()) {\n\t\t\t\tif (info.Child == widget || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == widget)) {\n\t\t\t\t\tx = info.X;\n\t\t\t\t\ty = info.Y;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tx = y = 0;\n\t\t}\n\n\t\tpublic void MoveToTop (Gtk.Widget widget)\n\t\t{\n\t\t\tvar editorContainerChild = containerChildren.FirstOrDefault (c => c.Child == widget);\n\t\t\tif (editorContainerChild == null)\n\t\t\t\tthrow new Exception (\"child \" + widget + \" not found.\");\n\t\t\tvar newChilds = containerChildren.Where (child => child != editorContainerChild).ToList ();\n\t\t\tnewChilds.Add (editorContainerChild);\n\t\t\tthis.containerChildren = newChilds;\n\t\t\twidget.GdkWindow.Raise ();\n\t\t}\n\n\t\tprotected override void OnAdded (Widget widget)\n\t\t{\n\t\t\tAddTopLevelWidget (widget, 0, 0);\n\t\t}\n\n\t\tprotected override void OnRemoved (Widget widget)\n\t\t{\n\t\t\tforeach (var info in containerChildren.ToArray ()) {\n\t\t\t\tif (info.Child == widget) {\n\t\t\t\t\twidget.Unparent ();\n\t\t\t\t\tcontainerChildren.Remove (info);\n\t\t\t\t\tSetAdjustments ();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override void ForAll (bool include_internals, Gtk.Callback callback)\n\t\t{\n\t\t\tcontainerChildren.ForEach (child => callback (child.Child));\n\t\t}\n\n\t\tprotected override void OnMapped ()\n\t\t{\n\t\t\tWidgetFlags |= WidgetFlags.Mapped;\n\t\t\t// Note: SourceEditorWidget.ShowAutoSaveWarning() might have set TextEditor.Visible to false,\n\t\t\t// in which case we want to not map it (would cause a gtk+ critical error).\n\t\t\tcontainerChildren.ForEach (child => {\n\t\t\t\tif (child.Child.Visible)\n\t\t\t\t\tchild.Child.Map ();\n\t\t\t});\n\t\t\tGdkWindow.Show ();\n\t\t}\n\n\t\tprotected override void OnUnmapped ()\n\t\t{\n\t\t\tWidgetFlags &= ~WidgetFlags.Mapped;\n\t\t\t\n\t\t\t// We hide the window first so that the user doesn't see widgets disappearing one by one.\n\t\t\tGdkWindow.Hide ();\n\t\t\t\n\t\t\tcontainerChildren.ForEach (child => child.Child.Unmap ());\n\t\t}\n\n\t\tvoid ResizeChild (Rectangle allocation, TextEditor.EditorContainerChild child)\n\t\t{\n\t\t\tRequisition req = child.Child.SizeRequest ();\n\t\t\tvar childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height);\n\t\t\tif (!child.FixedPosition) {\n//\t\t\t\tdouble zoom = Options.Zoom;\n\t\t\t\tchildRectangle.X = (int)(child.X /* * zoom */ - HAdjustment.Value);\n\t\t\t\tchildRectangle.Y = (int)(child.Y /* * zoom */ - VAdjustment.Value);\n\t\t\t}\n\t\t\t//\t\t\tchildRectangle.X += allocation.X;\n\t\t\t//\t\t\tchildRectangle.Y += allocation.Y;\n\t\t\tchild.Child.SizeAllocate (childRectangle);\n\t\t}\n\n\t\tvoid SetChildrenPositions (Rectangle allocation)\n\t\t{\n\t\t\tforeach (var child in containerChildren.ToArray ()) {\n\t\t\t\tResizeChild (allocation, child);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t}\n\n\tpublic interface ITextEditorDataProvider\n\t{\n\t\tTextEditorData GetTextEditorData ();\n\t}\n\n\t[Serializable]\n\tpublic sealed class PaintEventArgs : EventArgs\n\t{\n\t\tpublic Cairo.Context Context {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic Cairo.Rectangle Area {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic PaintEventArgs (Cairo.Context context, Cairo.Rectangle area)\n\t\t{\n\t\t\tthis.Context = context;\n\t\t\tthis.Area = area;\n\t\t}\n\t}\n}\n\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/IndentationTests/TextPasteIndentEngineTests.cs",
    "content": "﻿//\n// TextPasteIndentEngineTests.cs\n//\n// Author:\n//       Mike Krüger <mkrueger@xamarin.com>\n//\n// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.Editor;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.IndentationTests\n{\n\t[TestFixture]\n\tpublic class TextPasteIndentEngineTests\n\t{\n\t\tpublic static CacheIndentEngine CreateEngine(string text, CSharpFormattingOptions formatOptions = null, TextEditorOptions options = null)\n\t\t{\n\t\t\tif (formatOptions == null) {\n\t\t\t\tformatOptions = FormattingOptionsFactory.CreateMono();\n\t\t\t\tformatOptions.AlignToFirstIndexerArgument = formatOptions.AlignToFirstMethodCallArgument = true;\n\t\t\t}\n\t\t\t\n\t\t\tvar sb = new StringBuilder();\n\t\t\tint offset = 0;\n\t\t\tfor (int i = 0; i < text.Length; i++) {\n\t\t\t\tvar ch = text [i];\n\t\t\t\tif (ch == '$') {\n\t\t\t\t\toffset = i;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tsb.Append(ch);\n\t\t\t}\n\t\t\t\n\t\t\tvar document = new ReadOnlyDocument(sb.ToString());\n\t\t\toptions = options ?? new TextEditorOptions { EolMarker = \"\\n\" };\n\t\t\t\n\t\t\tvar result = new CacheIndentEngine(new CSharpIndentEngine(document, options, formatOptions));\n\t\t\tresult.Update(offset);\n\t\t\treturn result;\n\t\t}\n\n\t\tstatic TextEditorOptions CreateInvariantOptions()\n\t\t{\n\t\t\tvar options = new TextEditorOptions();\n\t\t\toptions.EolMarker = \"\\n\";\n\t\t\treturn options;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestSimplePaste()\n\t\t{\n\t\t\tvar indent = CreateEngine(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tSystem.Console.WriteLine ($);\n\t}\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"Foo\", null);\n\t\t\tAssert.AreEqual(\"Foo\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiLinePaste()\n\t\t{\n\t\t\tvar indent = CreateEngine(@\"\nnamespace FooBar\n{\n\tclass Foo\n\t{\n\t\tvoid Bar ()\n\t\t{\n\t\t\tSystem.Console.WriteLine ();\n\t\t}\n\t\t$\n\t}\n}\n\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, new TextEditorOptions { EolMarker = \"\\n\" }, FormattingOptionsFactory.CreateMono());\n\t\t\t\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"void Bar ()\\n{\\nSystem.Console.WriteLine ();\\n}\", null);\n\t\t\tAssert.AreEqual(\"void Bar ()\\n\\t\\t{\\n\\t\\t\\tSystem.Console.WriteLine ();\\n\\t\\t}\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestMultiplePastes()\n\t\t{\n\t\t\tvar indent = CreateEngine(@\"\nclass Foo\n{\n\tvoid Bar ()\n\t{\n\t\tSystem.Console.WriteLine ();\n\t}\n\t$\n}\n\n\n\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, new TextEditorOptions { EolMarker = \"\\n\" }, FormattingOptionsFactory.CreateMono());\n\t\t\t\n\t\t\tfor (int i = 0; i < 2; i++) {\n\t\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"void Bar ()\\n{\\nSystem.Console.WriteLine ();\\n}\", null);\n\t\t\t\tAssert.AreEqual(\"void Bar ()\\n\\t{\\n\\t\\tSystem.Console.WriteLine ();\\n\\t}\", text);\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t[Test]\n\t\tpublic void TestPasteNewLine()\n\t\t{\n\t\t\tvar indent = CreateEngine(@\"\nclass Foo\n{\n\t$void Bar ()\n\t{\n\t}\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, new TextEditorOptions { EolMarker = \"\\n\" }, FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"int i;\\n\", null);\n\t\t\tAssert.AreEqual(\"int i;\\n\\t\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPasteNewLineCase2()\n\t\t{\n\t\t\tvar indent = CreateEngine(@\"\nclass Foo\n{\n$\tvoid Bar ()\n\t{\n\t}\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, new TextEditorOptions { EolMarker = \"\\n\" }, FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"int i;\\n\", null);\n\t\t\tAssert.AreEqual(\"\\tint i;\\n\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteVerbatimString()\n\t\t{\n\t\t\tvar indent = CreateEngine(@\"\nclass Foo\n{\nvoid Bar ()\n{\n\t\n}\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, new TextEditorOptions { EolMarker = \"\\n\" }, FormattingOptionsFactory.CreateMono());\n\t\t\tvar str = \"string str = @\\\"\\n1\\n\\t2 \\n\\t\\t3\\n\\\";\";\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, str, null);\n\t\t\tAssert.AreEqual(str, text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWindowsLineEnding()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"\\r\\nclass Foo\\r\\n{\\r\\n\\tvoid Bar ()\\r\\n\\t{\\r\\n\\t\\t$\\r\\n\\t}\\r\\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"Foo();\\r\\nBar();\\r\\nTest();\", null);\n\t\t\tAssert.AreEqual(\"Foo();\\n\\t\\tBar();\\n\\t\\tTest();\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPasteBlankLines()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"class Foo\\n{\\n\\tvoid Bar ()\\n\\t{\\n\\t\\tSystem.Console.WriteLine ($);\\n\\t}\\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"\\n\\n\\n\", null);\n\t\t\tAssert.AreEqual(\"\\n\\n\\n\\t\\t\\t\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPasteBlankLinesAndIndent()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"class Foo\\n{\\n\\tvoid Bar ()\\n\\t{\\n\\t\\tSystem.Console.WriteLine ($);\\n\\t}\\n}\");\n\t\t\tvar options = FormattingOptionsFactory.CreateMono();\n\t\t\toptions.EmptyLineFormatting = EmptyLineFormatting.Indent;\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), options);\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"\\n\\n\\n\", null);\n\t\t\tAssert.AreEqual(\"\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\t\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestWindowsLineEndingCase2()\n\t\t{\n\t\t\tvar textEditorOptions = CreateInvariantOptions ();\n\t\t\ttextEditorOptions.EolMarker = \"\\r\\n\";\n\t\t\tvar indent = CreateEngine(\"\\r\\nclass Foo\\r\\n{\\r\\n\\tvoid Bar ()\\r\\n\\t{\\r\\n\\t\\t$\\r\\n\\t}\\r\\n}\", FormattingOptionsFactory.CreateMono(), textEditorOptions);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, textEditorOptions, FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"if (true)\\r\\nBar();\\r\\nTest();\", null);\n\t\t\tAssert.AreEqual(\"if (true)\\r\\n\\t\\t\\tBar();\\r\\n\\t\\tTest();\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteVerbatimStringBug1()\n\t\t{\n\t\t\tvar textEditorOptions = CreateInvariantOptions ();\n\t\t\ttextEditorOptions.EolMarker = \"\\r\\n\";\n\t\t\tvar indent = CreateEngine(\"\\r\\nclass Foo\\r\\n{\\r\\n\\tvoid Bar ()\\r\\n\\t{\\r\\n\\t\\t$\\r\\n\\t}\\r\\n}\", FormattingOptionsFactory.CreateMono(), textEditorOptions);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, textEditorOptions, FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"Console.WriteLine (@\\\"Hello World!\\\");\\n\", null);\n\t\t\tAssert.AreEqual(\"Console.WriteLine (@\\\"Hello World!\\\");\\r\\n\\t\\t\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteVerbatimStringBug2()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"\\nclass Foo\\n{\\n\\tvoid Bar ()\\n\\t{\\n\\t\\t$\\n\\t}\\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"if (true)\\nConsole.WriteLine (@\\\"Hello\\n World!\\\");\\n\", null);\n\t\t\tAssert.AreEqual(\"if (true)\\n\\t\\t\\tConsole.WriteLine (@\\\"Hello\\n World!\\\");\\n\\t\\t\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteVerbatimStringBug3()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"\\nclass Foo\\n{\\n\\tvoid Bar ()\\n\\t{\\n$\\n\\t}\\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"\\t\\tSystem.Console.WriteLine(@\\\"<evlevlle>\\\");\\n\", null);\n\t\t\tAssert.AreEqual(\"\\t\\tSystem.Console.WriteLine(@\\\"<evlevlle>\\\");\\n\\t\\t\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteVerbatimStringBug4()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"\\nclass Foo\\n{\\n\\tvoid Bar ()\\n\\t{\\n$\\n\\t}\\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"var str1 = \\n@\\\"hello\\\";\", null);\n\t\t\tAssert.AreEqual(\"\\t\\tvar str1 = \\n\\t\\t\\t@\\\"hello\\\";\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPasteComments()\n\t\t{\n\t\t\tvar indent = CreateEngine(@\"\nclass Foo\n{\n\t$\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"// Foo\\n\\t// Foo 2\\n\\t// Foo 3\", null);\n\t\t\tAssert.AreEqual(\"// Foo\\n\\t// Foo 2\\n\\t// Foo 3\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PastemultilineAtFirstColumnCorrection()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"class Foo\\n{\\n$\\n}\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"void Bar ()\\n{\\n\\tSystem.Console.WriteLine ();\\n}\", null);\n\t\t\tAssert.AreEqual(\"\\tvoid Bar ()\\n\\t{\\n\\t\\tSystem.Console.WriteLine ();\\n\\t}\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestPasteToWindowsEol()\n\t\t{\n\t\t\tvar indent = CreateEngine(\"$\");\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, new TextEditorOptions { EolMarker = \"\\r\\n\" }, FormattingOptionsFactory.CreateMono());\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"namespace Foo\\n{\\n\\tpublic static class FooExtensions\\n\\t{\\n\\t\\tpublic static int ObjectExtension (this object value)\\n\\t\\t{\\n\\t\\t\\treturn 0;\\n\\t\\t}\\n\\n\\t\\tpublic static int IntExtension (this int value)\\n\\t\\t{\\n\\t\\t\\treturn 0;\\n\\t\\t}\\n\\t}\\n\\n\\tpublic class Client\\n\\t{\\n\\t\\tpublic void Method ()\\n\\t\\t{\\n\\t\\t\\t0.ToString ();\\n\\t\\t}\\n\\t}\\n}\", null);\n\t\t\tAssert.AreEqual(\"namespace Foo\\r\\n{\\r\\n\\tpublic static class FooExtensions\\r\\n\\t{\\r\\n\\t\\tpublic static int ObjectExtension (this object value)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn 0;\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tpublic static int IntExtension (this int value)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn 0;\\r\\n\\t\\t}\\r\\n\\t}\\r\\n\\r\\n\\tpublic class Client\\r\\n\\t{\\r\\n\\t\\tpublic void Method ()\\r\\n\\t\\t{\\r\\n\\t\\t\\t0.ToString ();\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PastePreProcessorDirectivesNoIndent()\n\t\t{\n\t\t\tvar opt = FormattingOptionsFactory.CreateMono();\n\t\t\topt.IndentPreprocessorDirectives = false;\n\n\t\t\tvar indent = CreateEngine(@\"\nclass Foo\n{\n$\n}\", opt);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), opt);\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"#if DEBUG\\n\\tvoid Foo()\\n\\t{\\n\\t}\\n#endif\", null);\n\t\t\tAssert.AreEqual(\"#if DEBUG\\n\\tvoid Foo()\\n\\t{\\n\\t}\\n#endif\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteInUnterminatedString ()\n\t\t{\n\t\t\tvar opt = FormattingOptionsFactory.CreateMono();\n\t\t\topt.IndentPreprocessorDirectives = false;\n\n\t\t\tvar indent = CreateEngine(@\"\nvar foo = \"\"hello$\n\", opt);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), opt);\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"Hi \\\" + username;\", null);\n\t\t\tAssert.AreEqual(\"Hi \\\" + username;\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteInTerminatedString ()\n\t\t{\n\t\t\tvar opt = FormattingOptionsFactory.CreateMono();\n\t\t\topt.IndentPreprocessorDirectives = false;\n\n\t\t\tvar indent = CreateEngine(@\"\nvar foo = \"\"hello$\"\";\n\", opt);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), opt);\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"Hi \\\" + username;\", null);\n\t\t\tAssert.AreEqual(\"Hi \\\\\\\" + username;\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteInUnterminatedVerbatimString ()\n\t\t{\n\t\t\tvar opt = FormattingOptionsFactory.CreateMono();\n\t\t\topt.IndentPreprocessorDirectives = false;\n\n\t\t\tvar indent = CreateEngine(@\"\nvar foo = @\"\"hello$\n\", opt);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), opt);\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"Hi \\\" + username;\", null);\n\t\t\tAssert.AreEqual(\"Hi \\\" + username;\", text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PasteInTerminatedVerbatimString ()\n\t\t{\n\t\t\tvar opt = FormattingOptionsFactory.CreateMono();\n\t\t\topt.IndentPreprocessorDirectives = false;\n\n\t\t\tvar indent = CreateEngine(@\"\nvar foo = @\"\"hello$\"\";\n\", opt);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), opt);\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"Hi \\\" + username;\", null);\n\t\t\tAssert.AreEqual(\"Hi \\\"\\\" + username;\", text);\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Bug 16415 - Formatter - Copy paste comments \n\t\t/// </summary>\n\t\t[Test]\n\t\tpublic void TestBug16415 ()\n\t\t{\n\t\t\tvar opt = FormattingOptionsFactory.CreateMono();\n\t\t\tvar indent = CreateEngine(\"class Foo\\n{\\n\\tpublic static void Main (string[] args)\\n\\t{\\n\\t\\tConsole.WriteLine ();$\\n\\t}\\n}\\n\", opt);\n\t\t\tITextPasteHandler handler = new TextPasteIndentEngine(indent, CreateInvariantOptions (), opt);\n\t\t\tvar text = handler.FormatPlainText(indent.Offset, \"// Line 1\\n// Line 2\\n// Line 3\", null);\n\t\t\tAssert.AreEqual(\"// Line 1\\n\\t\\t// Line 2\\n\\t\\t// Line 3\", text);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Properties/AssemblyInfo.cs",
    "content": "﻿#region Using directives\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#endregion\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.Tests\")]\n[assembly: AssemblyDescription(\"NRefactory unit tests\")]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/BinaryLoaderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic abstract class BinaryLoaderTests : TypeSystemTests\n\t{\n\t\tpublic abstract IUnresolvedAssembly MscorlibInstance { get; }\n\t\tpublic abstract IUnresolvedAssembly SystemCoreInstance { get; }\n\n\t\t[Test]\n\t\tpublic void InheritanceTest()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(SystemException)).GetDefinition();\n\t\t\tITypeDefinition c2 = compilation.FindType(typeof(Exception)).GetDefinition();\n\t\t\tAssert.IsNotNull(c, \"c is null\");\n\t\t\tAssert.IsNotNull(c2, \"c2 is null\");\n\t\t\t//Assert.AreEqual(3, c.BaseTypes.Count); // Inherited interfaces are not reported by Cecil\n\t\t\t// which matches the behaviour of our C#/VB parsers\n\t\t\tAssert.AreEqual(\"System.Exception\", c.DirectBaseTypes.First().FullName);\n\t\t\tAssert.AreSame(c2, c.DirectBaseTypes.First());\n\t\t\t\n\t\t\tstring[] superTypes = c.GetAllBaseTypes().Select(t => t.ReflectionName).ToArray();\n\t\t\tAssert.AreEqual(new string[] {\n\t\t\t                \t\"System.Object\",\n\t\t\t                \t\"System.Runtime.Serialization.ISerializable\", \"System.Runtime.InteropServices._Exception\",\n\t\t\t                \t\"System.Exception\", \"System.SystemException\"\n\t\t\t                }, superTypes);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericPropertyTest()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(Comparer<>)).GetDefinition();\n\t\t\tIProperty def = c.Properties.Single(p => p.Name == \"Default\");\n\t\t\tParameterizedType pt = (ParameterizedType)def.ReturnType;\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.Comparer\", pt.FullName);\n\t\t\tAssert.AreEqual(c.TypeParameters[0], pt.TypeArguments[0]);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PointerTypeTest()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(IntPtr)).GetDefinition();\n\t\t\tIMethod toPointer = c.Methods.Single(p => p.Name == \"ToPointer\");\n\t\t\tAssert.AreEqual(\"System.Void*\", toPointer.ReturnType.ReflectionName);\n\t\t\tAssert.IsTrue (toPointer.ReturnType is PointerType);\n\t\t\tAssert.AreEqual(\"System.Void\", ((PointerType)toPointer.ReturnType).ElementType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DateTimeDefaultConstructor()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(DateTime)).GetDefinition();\n\t\t\tAssert.AreEqual(1, c.Methods.Count(m => m.IsConstructor && m.Parameters.Count == 0));\n\t\t\tAssert.AreEqual(1, c.GetConstructors().Count(m => m.Parameters.Count == 0));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoEncodingInfoDefaultConstructor()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(EncodingInfo)).GetDefinition();\n\t\t\t// EncodingInfo only has an internal constructor\n\t\t\tAssert.IsFalse(c.Methods.Any(m => m.IsConstructor));\n\t\t\t// and no implicit ctor should be added:\n\t\t\tAssert.AreEqual(0, c.GetConstructors().Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticModifierTest()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(Environment)).GetDefinition();\n\t\t\tAssert.IsNotNull(c, \"System.Environment not found\");\n\t\t\tAssert.IsTrue(c.IsAbstract, \"class should be abstract\");\n\t\t\tAssert.IsTrue(c.IsSealed, \"class should be sealed\");\n\t\t\tAssert.IsTrue(c.IsStatic, \"class should be static\");\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerClassReferenceTest()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(Environment)).GetDefinition();\n\t\t\tAssert.IsNotNull(c, \"System.Environment not found\");\n\t\t\tIType rt = c.Methods.First(m => m.Name == \"GetFolderPath\").Parameters[0].Type;\n\t\t\tAssert.AreSame(c.NestedTypes.Single(ic => ic.Name == \"SpecialFolder\"), rt);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedTypesTest()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(Environment.SpecialFolder)).GetDefinition();\n\t\t\tAssert.IsNotNull(c, \"c is null\");\n\t\t\tAssert.AreEqual(\"System.Environment.SpecialFolder\", c.FullName);\n\t\t\tAssert.AreEqual(\"System.Environment+SpecialFolder\", c.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void VoidHasNoMembers()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(void)).GetDefinition();\n\t\t\tAssert.IsNotNull(c, \"System.Void not found\");\n\t\t\tAssert.AreEqual(0, c.GetMethods().Count());\n\t\t\tAssert.AreEqual(0, c.GetProperties().Count());\n\t\t\tAssert.AreEqual(0, c.GetEvents().Count());\n\t\t\tAssert.AreEqual(0, c.GetFields().Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Void_SerializableAttribute()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(void)).GetDefinition();\n\t\t\tvar attr = c.Attributes.Single(a => a.AttributeType.FullName == \"System.SerializableAttribute\");\n\t\t\tAssert.AreEqual(0, attr.Constructor.Parameters.Count);\n\t\t\tAssert.AreEqual(0, attr.PositionalArguments.Count);\n\t\t\tAssert.AreEqual(0, attr.NamedArguments.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Void_StructLayoutAttribute()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(void)).GetDefinition();\n\t\t\tvar attr = c.Attributes.Single(a => a.AttributeType.FullName == \"System.Runtime.InteropServices.StructLayoutAttribute\");\n\t\t\tAssert.AreEqual(1, attr.Constructor.Parameters.Count);\n\t\t\tAssert.AreEqual(1, attr.PositionalArguments.Count);\n\t\t\tAssert.AreEqual(0, attr.PositionalArguments[0].ConstantValue);\n\t\t\tAssert.AreEqual(1, attr.NamedArguments.Count);\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.StructLayoutAttribute.Size\", attr.NamedArguments[0].Key.FullName);\n\t\t\tAssert.AreEqual(1, attr.NamedArguments[0].Value.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Void_ComVisibleAttribute()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(void)).GetDefinition();\n\t\t\tvar attr = c.Attributes.Single(a => a.AttributeType.FullName == \"System.Runtime.InteropServices.ComVisibleAttribute\");\n\t\t\tAssert.AreEqual(1, attr.Constructor.Parameters.Count);\n\t\t\tAssert.AreEqual(1, attr.PositionalArguments.Count);\n\t\t\tAssert.AreEqual(true, attr.PositionalArguments[0].ConstantValue);\n\t\t\tAssert.AreEqual(0, attr.NamedArguments.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NestedClassInGenericClassTest()\n\t\t{\n\t\t\tITypeDefinition dictionary = compilation.FindType(typeof(Dictionary<,>)).GetDefinition();\n\t\t\tAssert.IsNotNull(dictionary);\n\t\t\tITypeDefinition valueCollection = compilation.FindType(typeof(Dictionary<,>.ValueCollection)).GetDefinition();\n\t\t\tAssert.IsNotNull(valueCollection);\n\t\t\tvar dictionaryRT = new ParameterizedType(dictionary, new[] { compilation.FindType(typeof(string)).GetDefinition(), compilation.FindType(typeof(int)).GetDefinition() });\n\t\t\tIProperty valueProperty = dictionaryRT.GetProperties(p => p.Name == \"Values\").Single();\n\t\t\tIType parameterizedValueCollection = valueProperty.ReturnType;\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.Dictionary`2+ValueCollection[[System.String],[System.Int32]]\", parameterizedValueCollection.ReflectionName);\n\t\t\tAssert.AreSame(valueCollection, parameterizedValueCollection.GetDefinition());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ValueCollectionCountModifiers()\n\t\t{\n\t\t\tITypeDefinition valueCollection = compilation.FindType(typeof(Dictionary<,>.ValueCollection)).GetDefinition();\n\t\t\tAssert.AreEqual(Accessibility.Public, valueCollection.Accessibility);\n\t\t\tAssert.IsTrue(valueCollection.IsSealed);\n\t\t\tAssert.IsFalse(valueCollection.IsAbstract);\n\t\t\tAssert.IsFalse(valueCollection.IsStatic);\n\t\t\t\n\t\t\tIProperty count = valueCollection.Properties.Single(p => p.Name == \"Count\");\n\t\t\tAssert.AreEqual(Accessibility.Public, count.Accessibility);\n\t\t\t// It's sealed on the IL level; but in C# it's just a normal non-virtual method that happens to implement an interface\n\t\t\tAssert.IsFalse(count.IsSealed);\n\t\t\tAssert.IsFalse(count.IsVirtual);\n\t\t\tAssert.IsFalse(count.IsAbstract);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MathAcosModifiers()\n\t\t{\n\t\t\tITypeDefinition math = compilation.FindType(typeof(Math)).GetDefinition();\n\t\t\tAssert.AreEqual(Accessibility.Public, math.Accessibility);\n\t\t\tAssert.IsTrue(math.IsSealed);\n\t\t\tAssert.IsTrue(math.IsAbstract);\n\t\t\tAssert.IsTrue(math.IsStatic);\n\t\t\t\n\t\t\tIMethod acos = math.Methods.Single(p => p.Name == \"Acos\");\n\t\t\tAssert.AreEqual(Accessibility.Public, acos.Accessibility);\n\t\t\tAssert.IsTrue(acos.IsStatic);\n\t\t\tAssert.IsFalse(acos.IsAbstract);\n\t\t\tAssert.IsFalse(acos.IsSealed);\n\t\t\tAssert.IsFalse(acos.IsVirtual);\n\t\t\tAssert.IsFalse(acos.IsOverride);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EncodingModifiers()\n\t\t{\n\t\t\tITypeDefinition encoding = compilation.FindType(typeof(Encoding)).GetDefinition();\n\t\t\tAssert.AreEqual(Accessibility.Public, encoding.Accessibility);\n\t\t\tAssert.IsFalse(encoding.IsSealed);\n\t\t\tAssert.IsTrue(encoding.IsAbstract);\n\t\t\t\n\t\t\tIMethod getDecoder = encoding.Methods.Single(p => p.Name == \"GetDecoder\");\n\t\t\tAssert.AreEqual(Accessibility.Public, getDecoder.Accessibility);\n\t\t\tAssert.IsFalse(getDecoder.IsStatic);\n\t\t\tAssert.IsFalse(getDecoder.IsAbstract);\n\t\t\tAssert.IsFalse(getDecoder.IsSealed);\n\t\t\tAssert.IsTrue(getDecoder.IsVirtual);\n\t\t\tAssert.IsFalse(getDecoder.IsOverride);\n\t\t\t\n\t\t\tIMethod getMaxByteCount = encoding.Methods.Single(p => p.Name == \"GetMaxByteCount\");\n\t\t\tAssert.AreEqual(Accessibility.Public, getMaxByteCount.Accessibility);\n\t\t\tAssert.IsFalse(getMaxByteCount.IsStatic);\n\t\t\tAssert.IsTrue(getMaxByteCount.IsAbstract);\n\t\t\tAssert.IsFalse(getMaxByteCount.IsSealed);\n\t\t\tAssert.IsFalse(getMaxByteCount.IsVirtual);\n\t\t\tAssert.IsFalse(getMaxByteCount.IsOverride);\n\t\t\t\n\t\t\tIProperty encoderFallback = encoding.Properties.Single(p => p.Name == \"EncoderFallback\");\n\t\t\tAssert.AreEqual(Accessibility.Public, encoderFallback.Accessibility);\n\t\t\tAssert.IsFalse(encoderFallback.IsStatic);\n\t\t\tAssert.IsFalse(encoderFallback.IsAbstract);\n\t\t\tAssert.IsFalse(encoderFallback.IsSealed);\n\t\t\tAssert.IsFalse(encoderFallback.IsVirtual);\n\t\t\tAssert.IsFalse(encoderFallback.IsOverride);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnicodeEncodingModifiers()\n\t\t{\n\t\t\tITypeDefinition encoding = compilation.FindType(typeof(UnicodeEncoding)).GetDefinition();\n\t\t\tAssert.AreEqual(Accessibility.Public, encoding.Accessibility);\n\t\t\tAssert.IsFalse(encoding.IsSealed);\n\t\t\tAssert.IsFalse(encoding.IsAbstract);\n\t\t\t\n\t\t\tIMethod getDecoder = encoding.Methods.Single(p => p.Name == \"GetDecoder\");\n\t\t\tAssert.AreEqual(Accessibility.Public, getDecoder.Accessibility);\n\t\t\tAssert.IsFalse(getDecoder.IsStatic);\n\t\t\tAssert.IsFalse(getDecoder.IsAbstract);\n\t\t\tAssert.IsFalse(getDecoder.IsSealed);\n\t\t\tAssert.IsFalse(getDecoder.IsVirtual);\n\t\t\tAssert.IsTrue(getDecoder.IsOverride);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UTF32EncodingModifiers()\n\t\t{\n\t\t\tITypeDefinition encoding = compilation.FindType(typeof(UTF32Encoding)).GetDefinition();\n\t\t\tAssert.AreEqual(Accessibility.Public, encoding.Accessibility);\n\t\t\tAssert.IsTrue(encoding.IsSealed);\n\t\t\tAssert.IsFalse(encoding.IsAbstract);\n\t\t\t\n\t\t\tIMethod getDecoder = encoding.Methods.Single(p => p.Name == \"GetDecoder\");\n\t\t\tAssert.AreEqual(Accessibility.Public, getDecoder.Accessibility);\n\t\t\tAssert.IsFalse(getDecoder.IsStatic);\n\t\t\tAssert.IsFalse(getDecoder.IsAbstract);\n\t\t\tAssert.IsFalse(getDecoder.IsSealed);\n\t\t\tAssert.IsFalse(getDecoder.IsVirtual);\n\t\t\tAssert.IsTrue(getDecoder.IsOverride);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FindRedirectedType()\n\t\t{\n\t\t\tvar compilationWithSystemCore = new SimpleCompilation(SystemCoreInstance, MscorlibInstance);\n\t\t\t\n\t\t\tvar typeRef = ReflectionHelper.ParseReflectionName(\"System.Func`2, System.Core\");\n\t\t\tITypeDefinition c = typeRef.Resolve(compilationWithSystemCore.TypeResolveContext).GetDefinition();\n\t\t\tAssert.IsNotNull(c, \"System.Func<,> not found\");\n\t\t\tAssert.AreEqual(\"mscorlib\", c.ParentAssembly.AssemblyName);\n\t\t}\n\t\t\n\t\tpublic void DelegateIsClass()\n\t\t{\n\t\t\tvar @delegate = compilation.FindType(KnownTypeCode.Delegate).GetDefinition();\n\t\t\tAssert.AreEqual(TypeKind.Class, @delegate);\n\t\t\tAssert.IsFalse(@delegate.IsSealed);\n\t\t}\n\t\t\n\t\tpublic void MulticastDelegateIsClass()\n\t\t{\n\t\t\tvar multicastDelegate = compilation.FindType(KnownTypeCode.MulticastDelegate).GetDefinition();\n\t\t\tAssert.AreEqual(TypeKind.Class, multicastDelegate);\n\t\t\tAssert.IsFalse(multicastDelegate.IsSealed);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/BlobLoaderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing Mono.Cecil;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/* Commented out because the Mono.Cecil 0.9.5 release does not have the SecurityDeclaration ctor\n\t[TestFixture]\n\tpublic class BlobLoaderTests\n\t{\n\t\t[Test]\n\t\tpublic void GetCompressedStackSecDecl()\n\t\t{\n\t\t\t// Compressed Stack from mscorlib 2.0\n\t\t\t// [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode),\n\t\t\t//  StrongNameIdentityPermission(SecurityAction.LinkDemand, PublicKey = \"0x00000000000000000400000000000000\")]\n\t\t\tbyte[] blob = Convert.FromBase64String(@\"\nLgKAhFN5c3RlbS5TZWN1cml0eS5QZXJtaXNzaW9ucy5TZWN1cml0eVBlcm1pc3Npb25BdHRyaWJ1dGUs\nIG1zY29ybGliLCBWZXJzaW9uPTIuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49\nYjc3YTVjNTYxOTM0ZTA4OUABVFUyU3lzdGVtLlNlY3VyaXR5LlBlcm1pc3Npb25zLlNlY3VyaXR5UGVy\nbWlzc2lvbkZsYWcFRmxhZ3MCAAAAgI5TeXN0ZW0uU2VjdXJpdHkuUGVybWlzc2lvbnMuU3Ryb25nTmFt\nZUlkZW50aXR5UGVybWlzc2lvbkF0dHJpYnV0ZSwgbXNjb3JsaWIsIFZlcnNpb249Mi4wLjAuMCwgQ3Vs\ndHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5MAFUDglQdWJsaWNLZXki\nMHgwMDAwMDAwMDAwMDAwMDAwMDQwMDAwMDAwMDAwMDAwMA==\");\n\t\t\tvar attributes = new CecilLoader().ReadSecurityDeclaration(new SecurityDeclaration(SecurityAction.LinkDemand, blob));\n\t\t\tAssert.AreEqual(2, attributes.Count);\n\t\t\tvar compilation = new SimpleCompilation(CecilLoaderTests.Mscorlib);\n\t\t\tvar context = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\tvar permissionAttr = attributes[0].CreateResolvedAttribute(context);\n\t\t\tvar strongNameAttr = attributes[1].CreateResolvedAttribute(context);\n\t\t\tAssert.AreEqual(\"System.Security.Permissions.SecurityPermissionAttribute\", permissionAttr.AttributeType.FullName);\n\t\t\tAssert.AreEqual(\"System.Security.Permissions.StrongNameIdentityPermissionAttribute\", strongNameAttr.AttributeType.FullName);\n\t\t}\n\t}\n\t*/\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/CecilLoaderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class CecilLoaderTests : BinaryLoaderTests\n\t{\n\t\tstatic readonly Lazy<IUnresolvedAssembly> mscorlib = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\t\treturn new CecilLoader().LoadAssemblyFile(typeof(object).Assembly.Location);\n\t\t\t});\n\t\t\n\t\tstatic readonly Lazy<IUnresolvedAssembly> systemCore = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\treturn new CecilLoader().LoadAssemblyFile(typeof(System.Linq.Enumerable).Assembly.Location);\n\t\t});\n\n\t\tpublic static IUnresolvedAssembly Mscorlib { get { return mscorlib.Value; } }\n\t\tpublic static IUnresolvedAssembly SystemCore { get { return systemCore.Value; } }\n\n\t\tpublic override IUnresolvedAssembly MscorlibInstance { get { return mscorlib.Value; } }\n\t\tpublic override IUnresolvedAssembly SystemCoreInstance { get { return systemCore.Value; } }\n\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp()\n\t\t{\n\t\t\t// use \"IncludeInternalMembers\" so that Cecil results match C# parser results\n\t\t\tCecilLoader loader = new CecilLoader() { IncludeInternalMembers = true };\n\t\t\tIUnresolvedAssembly asm = loader.LoadAssemblyFile(typeof(TestCase.SimplePublicClass).Assembly.Location);\n\t\t\tcompilation = new SimpleCompilation(asm, Mscorlib);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/CyclicProjectDependency.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class CyclicProjectDependency\n\t{\n\t\tIProjectContent pc1;\n\t\tIProjectContent pc2;\n\t\tISolutionSnapshot solution;\n\t\t\n\t\t[SetUp]\n\t\tpublic void Setup()\n\t\t{\n\t\t\tpc1 = new CSharpProjectContent()\n\t\t\t\t.SetAssemblyName(\"PC1\")\n\t\t\t\t.SetProjectFileName(\"PC1.csproj\")\n\t\t\t\t.AddAssemblyReferences(new IAssemblyReference[] { CecilLoaderTests.Mscorlib, new ProjectReference(\"PC2.csproj\") });\n\n\t\t\tpc2 = new CSharpProjectContent()\n\t\t\t\t.SetAssemblyName(\"PC2\")\n\t\t\t\t.SetProjectFileName(\"PC2.csproj\")\n\t\t\t\t.AddAssemblyReferences(new IAssemblyReference[] { CecilLoaderTests.Mscorlib, new ProjectReference(\"PC1.csproj\") });\n\t\t\t\n\t\t\tsolution = new DefaultSolutionSnapshot(new[] { pc1, pc2 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CreateCompilation1()\n\t\t{\n\t\t\tICompilation c = solution.GetCompilation(pc1);\n\t\t\tAssert.AreEqual(new string[] { \"PC1\", \"mscorlib\", \"PC2\" }, c.Assemblies.Select(asm => asm.AssemblyName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CreateCompilation2()\n\t\t{\n\t\t\tICompilation c = solution.GetCompilation(pc2);\n\t\t\tAssert.AreEqual(new string[] { \"PC2\", \"mscorlib\", \"PC1\" }, c.Assemblies.Select(asm => asm.AssemblyName).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/GetAllBaseTypesTest.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.Serialization;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tusing Unbound = ReflectionHelper.UnboundTypeArgument;\n\t\n\t[TestFixture]\n\tpublic class GetAllBaseTypesTest\n\t{\n\t\tconst string corlib = @\"\nnamespace System {\n\tclass Object {}\n\tclass ValueType {}\n\tclass String : System.Collections.Generic.IEnumerable<char>, IComparable<string> {}\n\tclass Array : System.Collections.IList, ICloneable {}\n\t\n\tinterface ICloneable {}\n\tinterface IComparable<in T> {}\n\tstruct Int32 {}\n\tstruct Char {}\n}\nnamespace System.Collections {\n\tinterface IEnumerable {}\n\tinterface ICollection : IEnumerable {}\n\tinterface IList : ICollection {}\n\tinterface IDictionary : ICollection {}\n}\nnamespace System.Collections.Generic {\n\tinterface IEnumerable<out T> : IEnumerable {}\n\tinterface ICollection<T> : IEnumerable<T> {}\n\tinterface IList<T> : ICollection<T> {}\n\tinterface IDictionary<TKey, TValue> : ICollection<KeyValuePair<TKey, TValue>> {}\n\n\tclass List<T> : IList, IList<T> {}\n\tclass Dictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary {}\n\tstruct KeyValuePair<TKey, TValue> {}\n}\n\";\n\t\t\n\t\tICompilation compilation;\n\t\t\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tvar unresolvedFile = new CSharpParser().Parse(corlib, \"corlib.cs\").ToTypeSystem();\n\t\t\tcompilation = new CSharpProjectContent().SetAssemblyName(\"mscorlib\").AddOrUpdateFiles(unresolvedFile).CreateCompilation();\n\t\t}\n\t\t\n\t\tIType[] GetAllBaseTypes(Type type)\n\t\t{\n\t\t\treturn compilation.FindType(type).GetAllBaseTypes().OrderBy(t => t.ReflectionName).ToArray();\n\t\t}\n\t\t\n\t\tIType[] GetTypes(params Type[] types)\n\t\t{\n\t\t\treturn types.Select(t => compilation.FindType(t)).OrderBy(t => t.ReflectionName).ToArray();\n\t\t}\n\t\t\n\t\tITypeDefinition Resolve(IUnresolvedTypeDefinition typeDef)\n\t\t{\n\t\t\treturn typeDef.Resolve(new SimpleTypeResolveContext(compilation.MainAssembly)).GetDefinition();\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ObjectBaseTypes()\n\t\t{\n\t\t\tAssert.AreEqual(GetTypes(typeof(object)), GetAllBaseTypes(typeof(object)));\n\t\t\t\n\t\t\tAssert.That(compilation.FindType(KnownTypeCode.Object).DirectBaseTypes, Is.Empty);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StringBaseTypes()\n\t\t{\n\t\t\tAssert.AreEqual(GetTypes(typeof(string), typeof(object),\n\t\t\t                         typeof(IComparable<string>), typeof(IEnumerable<char>), typeof(IEnumerable)),\n\t\t\t                GetAllBaseTypes(typeof(string)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayOfString()\n\t\t{\n\t\t\tvar expectedTypes = GetTypes(\n\t\t\t\ttypeof(string[]), typeof(Array), typeof(object),\n\t\t\t\ttypeof(IList), typeof(ICollection), typeof(IEnumerable), typeof(ICloneable),\n\t\t\t\ttypeof(IList<string>), typeof(ICollection<string>), typeof(IEnumerable<string>));\n\t\t\tAssert.AreEqual(expectedTypes,\n\t\t\t                GetAllBaseTypes(typeof(string[])));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic unsafe void ArrayOfPointers()\n\t\t{\n\t\t\tAssert.AreEqual(GetTypes(typeof(int*[]), typeof(Array), typeof(object),\n\t\t\t                         typeof(IList), typeof(ICollection), typeof(IEnumerable), typeof(ICloneable)),\n\t\t\t                GetAllBaseTypes(typeof(int*[])));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultidimensionalArrayOfString()\n\t\t{\n\t\t\tAssert.AreEqual(GetTypes(typeof(string[,]), typeof(Array), typeof(object),\n\t\t\t                         typeof(IList), typeof(ICollection), typeof(IEnumerable), typeof(ICloneable)),\n\t\t\t                GetAllBaseTypes(typeof(string[,])));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassDerivingFromItself()\n\t\t{\n\t\t\t// class C : C {}\n\t\t\tvar c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.BaseTypes.Add(c);\n\t\t\tITypeDefinition resolvedC = TypeSystemHelper.CreateCompilationAndResolve(c);\n\t\t\tAssert.AreEqual(new [] { resolvedC }, resolvedC.GetAllBaseTypes().ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TwoClassesDerivingFromEachOther()\n\t\t{\n\t\t\t// class C1 : C2 {} class C2 : C1 {}\n\t\t\tvar c1 = new DefaultUnresolvedTypeDefinition(string.Empty, \"C1\");\n\t\t\tvar c2 = new DefaultUnresolvedTypeDefinition(string.Empty, \"C2\");\n\t\t\tc1.BaseTypes.Add(c2);\n\t\t\tc2.BaseTypes.Add(c1);\n\t\t\tcompilation = TypeSystemHelper.CreateCompilation(c1, c2);\n\t\t\tITypeDefinition resolvedC1 = Resolve(c1);\n\t\t\tITypeDefinition resolvedC2 = Resolve(c2);\n\t\t\tAssert.AreEqual(new [] { resolvedC2, resolvedC1 }, resolvedC1.GetAllBaseTypes().ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassDerivingFromParameterizedVersionOfItself()\n\t\t{\n\t\t\t// class C<X> : C<C<X>> {}\n\t\t\tvar c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"X\"));\n\t\t\tc.BaseTypes.Add(new ParameterizedTypeReference(c, new [] { new ParameterizedTypeReference(c, new [] { new TypeParameterReference(SymbolKind.TypeDefinition, 0) }) }));\n\t\t\tcompilation = TypeSystemHelper.CreateCompilation(c);\n\t\t\tITypeDefinition resolvedC = Resolve(c);\n\t\t\tAssert.AreEqual(new [] { resolvedC }, resolvedC.GetAllBaseTypes().ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ClassDerivingFromTwoInstanciationsOfIEnumerable()\n\t\t{\n\t\t\t// class C : IEnumerable<int>, IEnumerable<uint> {}\n\t\t\tvar c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.BaseTypes.Add(typeof(IEnumerable<int>).ToTypeReference());\n\t\t\tc.BaseTypes.Add(typeof(IEnumerable<uint>).ToTypeReference());\n\t\t\tcompilation = TypeSystemHelper.CreateCompilation(c);\n\t\t\tITypeDefinition resolvedC = Resolve(c);\n\t\t\tIType[] expected = {\n\t\t\t\tresolvedC,\n\t\t\t\tcompilation.FindType(typeof(IEnumerable<int>)),\n\t\t\t\tcompilation.FindType(typeof(IEnumerable<uint>)),\n\t\t\t\tcompilation.FindType(typeof(IEnumerable)),\n\t\t\t\tcompilation.FindType(typeof(object))\n\t\t\t};\n\t\t\tAssert.AreEqual(expected,\n\t\t\t                resolvedC.GetAllBaseTypes().OrderBy(t => t.ReflectionName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StructImplementingIEquatable()\n\t\t{\n\t\t\t// struct S : IEquatable<S> {}\n\t\t\t// don't use a Cecil-loaded struct for this test; we're testing the implicit addition of System.ValueType\n\t\t\tvar s = new DefaultUnresolvedTypeDefinition(string.Empty, \"S\");\n\t\t\ts.Kind = TypeKind.Struct;\n\t\t\ts.BaseTypes.Add(new ParameterizedTypeReference(typeof(IEquatable<>).ToTypeReference(), new[] { s }));\n\t\t\tcompilation = TypeSystemHelper.CreateCompilation(s);\n\t\t\tITypeDefinition resolvedS = Resolve(s);\n\t\t\tIType[] expected = {\n\t\t\t\tresolvedS,\n\t\t\t\ts.BaseTypes[0].Resolve(new SimpleTypeResolveContext(resolvedS)),\n\t\t\t\tcompilation.FindType(typeof(object)),\n\t\t\t\tcompilation.FindType(typeof(ValueType))\n\t\t\t};\n\t\t\tAssert.AreEqual(expected,\n\t\t\t                resolvedS.GetAllBaseTypes().OrderBy(t => t.ReflectionName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseTypesOfListOfString()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tGetTypes(typeof(List<string>), typeof(object),\n\t\t\t\t         typeof(IList), typeof(ICollection), typeof(IEnumerable),\n\t\t\t\t         typeof(IEnumerable<string>), typeof(ICollection<string>), typeof(IList<string>)),\n\t\t\t\tGetAllBaseTypes(typeof(List<string>)));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseTypesOfUnboundDictionary()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew [] {\n\t\t\t\t\ttypeof(Dictionary<,>).FullName,\n\t\t\t\t\ttypeof(ICollection<>).FullName + \"[[\" + typeof(KeyValuePair<,>).FullName + \"[[`0],[`1]]]]\",\n\t\t\t\t\ttypeof(IDictionary<,>).FullName + \"[[`0],[`1]]\",\n\t\t\t\t\ttypeof(IEnumerable<>).FullName + \"[[\" + typeof(KeyValuePair<,>).FullName + \"[[`0],[`1]]]]\",\n\t\t\t\t\ttypeof(ICollection).FullName,\n\t\t\t\t\ttypeof(IDictionary).FullName,\n\t\t\t\t\ttypeof(IEnumerable).FullName,\n\t\t\t\t\ttypeof(object).FullName\n\t\t\t\t},\n\t\t\t\tGetAllBaseTypes(typeof(Dictionary<,>)).Select(t => t.ReflectionName).OrderBy(n => n).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseTypeDefinitionsOfListOfString()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tGetTypes(typeof(List<>), typeof(object),\n\t\t\t\t         typeof(IList), typeof(ICollection), typeof(IEnumerable),\n\t\t\t\t         typeof(IEnumerable<>), typeof(ICollection<>), typeof(IList<>)),\n\t\t\t\tcompilation.FindType(typeof(List<string>)).GetAllBaseTypeDefinitions().OrderBy(t => t.ReflectionName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BaseTypeDefinitionsOfStringArray()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tGetTypes(typeof(Array), typeof(object), typeof(ICloneable),\n\t\t\t\t         typeof(IList), typeof(ICollection), typeof(IEnumerable),\n\t\t\t\t         typeof(IEnumerable<>), typeof(ICollection<>), typeof(IList<>)),\n\t\t\t\tcompilation.FindType(typeof(string[])).GetAllBaseTypeDefinitions().OrderBy(t => t.ReflectionName).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/GetMembersTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class GetMembersTests\n\t{\n\t\t[Test]\n\t\tpublic void EmptyClassHasToString()\n\t\t{\n\t\t\tDefaultUnresolvedTypeDefinition c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tvar resolvedC = TypeSystemHelper.CreateCompilationAndResolve(c);\n\t\t\tAssert.AreEqual(\"System.Object.ToString\", resolvedC.GetMethods(m => m.Name == \"ToString\").Single().FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleInheritanceTest()\n\t\t{\n\t\t\tDefaultUnresolvedTypeDefinition b1 = new DefaultUnresolvedTypeDefinition(string.Empty, \"B1\");\n\t\t\tb1.Kind = TypeKind.Interface;\n\t\t\tb1.Members.Add(new DefaultUnresolvedProperty(b1, \"P1\"));\n\t\t\t\n\t\t\tDefaultUnresolvedTypeDefinition b2 = new DefaultUnresolvedTypeDefinition(string.Empty, \"B2\");\n\t\t\tb2.Kind = TypeKind.Interface;\n\t\t\tb2.Members.Add(new DefaultUnresolvedProperty(b2, \"P2\"));\n\t\t\t\n\t\t\tDefaultUnresolvedTypeDefinition c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.Kind = TypeKind.Interface;\n\t\t\tc.BaseTypes.Add(b1);\n\t\t\tc.BaseTypes.Add(b2);\n\t\t\t\n\t\t\tvar compilation = TypeSystemHelper.CreateCompilation(b1, b2, c);\n\t\t\tITypeDefinition resolvedC = compilation.MainAssembly.GetTypeDefinition(c.FullTypeName);\n\t\t\tAssert.AreEqual(new[] { \"P1\", \"P2\" }, resolvedC.GetProperties().Select(p => p.Name).ToArray());\n\t\t\t// Test that there's only one copy of ToString():\n\t\t\tAssert.AreEqual(1, resolvedC.GetMethods(m => m.Name == \"ToString\").Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetNestedTypesOfUnboundGenericClass()\n\t\t{\n\t\t\tvar compilation = TypeSystemHelper.CreateCompilation();\n\t\t\tITypeDefinition dictionary = compilation.FindType(typeof(Dictionary<,>)).GetDefinition();\n\t\t\tIType keyCollection = dictionary.GetNestedTypes().Single(t => t.Name == \"KeyCollection\");\n\t\t\t// the type should be parameterized\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.Dictionary`2+KeyCollection[[`0],[`1]]\", keyCollection.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetNestedTypesOfBoundGenericClass()\n\t\t{\n\t\t\tvar compilation = TypeSystemHelper.CreateCompilation();\n\t\t\tIType dictionary = compilation.FindType(typeof(Dictionary<string, int>));\n\t\t\tIType keyCollection = dictionary.GetNestedTypes().Single(t => t.Name == \"KeyCollection\");\n\t\t\tAssert.AreEqual(compilation.FindType(typeof(Dictionary<string, int>.KeyCollection)), keyCollection);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetGenericNestedTypeOfBoundGenericClass()\n\t\t{\n\t\t\t// class A<X> { class B<Y> { } }\n\t\t\tDefaultUnresolvedTypeDefinition a = new DefaultUnresolvedTypeDefinition(string.Empty, \"A\");\n\t\t\ta.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"X\"));\n\t\t\t\n\t\t\tDefaultUnresolvedTypeDefinition b = new DefaultUnresolvedTypeDefinition(a, \"B\");\n\t\t\tb.TypeParameters.Add(a.TypeParameters[0]);\n\t\t\tb.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 1, \"Y\"));\n\t\t\t\n\t\t\ta.NestedTypes.Add(b);\n\t\t\t\n\t\t\tvar compilation = TypeSystemHelper.CreateCompilation(a, b);\n\t\t\tITypeDefinition resolvedA = compilation.MainAssembly.GetTypeDefinition(a.FullTypeName);\n//\t\t\tITypeDefinition resolvedB = compilation.MainAssembly.GetTypeDefinition(b.FullTypeName);\n\t\t\t\n\t\t\t// A<> gets self-parameterized, B<> stays unbound\n\t\t\tAssert.AreEqual(\"A`1+B`1[[`0],[]]\", resolvedA.GetNestedTypes().Single().ReflectionName);\n\t\t\t\n\t\t\tParameterizedType pt = new ParameterizedType(resolvedA, new [] { compilation.FindType(KnownTypeCode.String) });\n\t\t\tAssert.AreEqual(\"A`1+B`1[[System.String],[]]\", pt.GetNestedTypes().Single().ReflectionName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/IkvmLoaderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class IkvmLoaderTests : BinaryLoaderTests\n\t{\n\t\tstatic readonly Lazy<IUnresolvedAssembly> mscorlib = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\t\treturn new IkvmLoader().LoadAssemblyFile(typeof(object).Assembly.Location);\n\t\t\t});\n\t\t\n\t\tstatic readonly Lazy<IUnresolvedAssembly> systemCore = new Lazy<IUnresolvedAssembly>(\n\t\t\tdelegate {\n\t\t\treturn new IkvmLoader().LoadAssemblyFile(typeof(System.Linq.Enumerable).Assembly.Location);\n\t\t});\n\n\t\tpublic static IUnresolvedAssembly Mscorlib { get { return mscorlib.Value; } }\n\t\tpublic static IUnresolvedAssembly SystemCore { get { return systemCore.Value; } }\n\n\t\tpublic override IUnresolvedAssembly MscorlibInstance { get { return mscorlib.Value; } }\n\t\tpublic override IUnresolvedAssembly SystemCoreInstance { get { return systemCore.Value; } }\n\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp()\n\t\t{\n\t\t\ttry {\n\t\t\t\t// use \"IncludeInternalMembers\" so that Cecil results match C# parser results\n\t\t\t\tIkvmLoader loader = new IkvmLoader() { IncludeInternalMembers = true };\n\t\t\t\tIUnresolvedAssembly asm = loader.LoadAssemblyFile(typeof(TestCase.SimplePublicClass).Assembly.Location);\n\t\t\t\tcompilation = new SimpleCompilation(asm, IkvmLoaderTests.Mscorlib);\n\t\t\t} catch (Exception e) {\n\t\t\t\tConsole.WriteLine(e);\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/InheritanceHelperTests.cs",
    "content": "﻿//\n// BlobReader.cs\n//\n// Author:\n//       Erik Källen\n//\n// Copyright (c) 2010-2013\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing ICSharpCode.NRefactory.CSharp;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class InheritanceHelperTests\n\t{\n\t\t[Test]\n\t\tpublic void DynamicAndObjectShouldBeConsideredTheSameTypeWhenMatchingSignatures()\n\t\t{\n\t\t\tstring program = @\"using System.Collections.Generic;\npublic class Base {\n  public virtual void M1(object p) {}\n  public virtual void M2(List<object> p) {}\n  public virtual object M3() { return null; }\n  public virtual List<object> M4() { return null; }\n  public virtual void M5(dynamic p) {}\n  public virtual void M6(List<dynamic> p) {}\n  public virtual dynamic M7() { return null; }\n  public virtual List<dynamic> M8() { return null; }\n}\n\npublic class Derived : Base {\n  public override void M1(dynamic p) {}\n  public override void M2(List<dynamic> p) {}\n  public override dynamic M3() { return null; }\n  public override List<dynamic> M4() { return null; }\n  public override void M5(object p) {}\n  public override void M6(List<object> p) {}\n  public override object M7() { return null; }\n  public override List<object> M8() { return null; }\n}\";\n\n\t\t\tvar unresolvedFile = new CSharpParser().Parse(program, \"program.cs\").ToTypeSystem();\n\t\t\tvar compilation = new CSharpProjectContent().AddAssemblyReferences(CecilLoaderTests.Mscorlib).AddOrUpdateFiles(unresolvedFile).CreateCompilation();\n\n\t\t\tvar dtype = (ITypeDefinition)ReflectionHelper.ParseReflectionName(\"Derived\").Resolve(compilation);\n\t\t\tvar btype = (ITypeDefinition)ReflectionHelper.ParseReflectionName(\"Base\").Resolve(compilation);\n\n\t\t\tforeach (var name in new[] { \"M1\", \"M2\", \"M3\", \"M4\", \"M5\", \"M6\", \"M7\", \"M8\" }) {\n\t\t\t\tAssert.That(InheritanceHelper.GetBaseMember(dtype.Methods.Single(m => m.Name == name)), Is.EqualTo(btype.Methods.Single(m => m.Name == name)), name + \" does not match\");\n\t\t\t}\n\n\t\t\tforeach (var name in new[] { \"M1\", \"M2\", \"M3\", \"M4\", \"M5\", \"M6\", \"M7\", \"M8\" }) {\n\t\t\t\tAssert.That(InheritanceHelper.GetDerivedMember(btype.Methods.Single(m => m.Name == name), dtype), Is.EqualTo(dtype.Methods.Single(m => m.Name == name)), name + \" does not match\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/LazyLoadedCecilLoaderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class LazyLoadedCecilLoaderTests : TypeSystemTests\n\t{\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp()\n\t\t{\n\t\t\tCecilLoader loader = new CecilLoader() { IncludeInternalMembers = true, LazyLoad = true };\n\t\t\tIUnresolvedAssembly pc = loader.LoadAssemblyFile(typeof(TestCase.SimplePublicClass).Assembly.Location);\n\t\t\tbase.compilation = new SimpleCompilation(pc, CecilLoaderTests.Mscorlib);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/ReflectionHelperTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic unsafe class ReflectionHelperTests\n\t{\n\t\tICompilation compilation = new SimpleCompilation(CecilLoaderTests.Mscorlib);\n\t\t\n\t\tvoid TestFindType(Type type)\n\t\t{\n\t\t\tIType t = compilation.FindType(type);\n\t\t\tAssert.IsNotNull(t, type.FullName);\n\t\t\tAssert.AreEqual(type.FullName, t.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestGetInnerClass()\n\t\t{\n\t\t\tTestFindType(typeof(Environment.SpecialFolder));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestGetGenericClass1()\n\t\t{\n\t\t\tTestFindType(typeof(Action<>));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestGetGenericClass2()\n\t\t{\n\t\t\tTestFindType(typeof(Action<,>));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestGetInnerClassInGenericClass1()\n\t\t{\n\t\t\tTestFindType(typeof(Dictionary<,>.ValueCollection));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestGetInnerClassInGenericClass2()\n\t\t{\n\t\t\tTestFindType(typeof(Dictionary<,>.ValueCollection.Enumerator));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceInnerClass()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Environment+SpecialFolder\",\n\t\t\t                compilation.FindType(typeof(Environment.SpecialFolder)).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceUnboundGenericClass()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Action`1\",\n\t\t\t                compilation.FindType(typeof(Action<>)).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Action`2\",\n\t\t\t                compilation.FindType(typeof(Action<,>)).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceBoundGenericClass()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Action`1[[System.String]]\",\n\t\t\t                compilation.FindType(typeof(Action<string>)).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Action`2[[System.Int32],[System.Int16]]\",\n\t\t\t                compilation.FindType(typeof(Action<int, short>)).ReflectionName);\n\t\t}\n\t\t\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceNullableType()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Nullable`1[[System.Int32]]\",\n\t\t\t                compilation.FindType(typeof(int?)).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceInnerClassInUnboundGenericType()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.Dictionary`2+ValueCollection\",\n\t\t\t                compilation.FindType(typeof(Dictionary<,>.ValueCollection)).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceInnerClassInBoundGenericType()\n\t\t{\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.Dictionary`2+KeyCollection[[System.String],[System.Int32]]\",\n\t\t\t                compilation.FindType(typeof(Dictionary<string, int>.KeyCollection)).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceArrayType()\n\t\t{\n\t\t\tAssert.AreEqual(typeof(int[]).FullName,\n\t\t\t                compilation.FindType(typeof(int[])).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceMultidimensionalArrayType()\n\t\t{\n\t\t\tAssert.AreEqual(typeof(int[,]).FullName,\n\t\t\t                compilation.FindType(typeof(int[,])).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceJaggedMultidimensionalArrayType()\n\t\t{\n\t\t\tAssert.AreEqual(typeof(int[,][,,]).FullName,\n\t\t\t                compilation.FindType(typeof(int[,][,,])).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferencePointerType()\n\t\t{\n\t\t\tAssert.AreEqual(typeof(int*).FullName,\n\t\t\t                compilation.FindType(typeof(int*)).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceByReferenceType()\n\t\t{\n\t\t\tAssert.AreEqual(typeof(int).MakeByRefType().FullName,\n\t\t\t                compilation.FindType(typeof(int).MakeByRefType()).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestToTypeReferenceGenericType()\n\t\t{\n\t\t\tMethodInfo convertAllInfo = typeof(List<>).GetMethod(\"ConvertAll\");\n\t\t\tITypeReference parameterType = convertAllInfo.GetParameters()[0].ParameterType.ToTypeReference(); // Converter[[`0],[``0]]\n\t\t\t// cannot resolve generic types without knowing the parent entity:\n\t\t\tIType resolvedWithoutEntity = parameterType.Resolve(compilation.TypeResolveContext);\n\t\t\tAssert.AreEqual(\"System.Converter`2[[`0],[``0]]\", resolvedWithoutEntity.ReflectionName);\n\t\t\tAssert.IsNull(((ITypeParameter)((ParameterizedType)resolvedWithoutEntity).GetTypeArgument(0)).Owner);\n\t\t\t// now try with parent entity:\n\t\t\tIMethod convertAll = compilation.FindType(typeof(List<>)).GetMethods(m => m.Name == \"ConvertAll\").Single();\n\t\t\tIType resolvedWithEntity = parameterType.Resolve(new SimpleTypeResolveContext(convertAll));\n\t\t\tAssert.AreEqual(\"System.Converter`2[[`0],[``0]]\", resolvedWithEntity.ReflectionName);\n\t\t\tAssert.AreSame(convertAll.DeclaringTypeDefinition, ((ITypeParameter)((ParameterizedType)resolvedWithEntity).GetTypeArgument(0)).Owner);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParseReflectionName()\n\t\t{\n\t\t\tvar context = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\tAssert.AreEqual(\"System.Int32\", ReflectionHelper.ParseReflectionName(\"System.Int32\").Resolve(context).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Int32&\", ReflectionHelper.ParseReflectionName(\"System.Int32&\").Resolve(context).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Int32*&\", ReflectionHelper.ParseReflectionName(\"System.Int32*&\").Resolve(context).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Int32\", ReflectionHelper.ParseReflectionName(typeof(int).AssemblyQualifiedName).Resolve(context).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Action`1[[System.String]]\", ReflectionHelper.ParseReflectionName(\"System.Action`1[[System.String]]\").Resolve(context).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Action`1[[System.String]]\", ReflectionHelper.ParseReflectionName(\"System.Action`1[[System.String, mscorlib]]\").Resolve(context).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Int32[,,][,]\", ReflectionHelper.ParseReflectionName(typeof(int[,][,,]).AssemblyQualifiedName).Resolve(context).ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Environment+SpecialFolder\", ReflectionHelper.ParseReflectionName(\"System.Environment+SpecialFolder\").Resolve(context).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParseOpenGenericReflectionName()\n\t\t{\n\t\t\tITypeReference typeRef = ReflectionHelper.ParseReflectionName(\"System.Converter`2[[`0],[``0]]\");\n\t\t\tAssert.AreEqual(\"System.Converter`2[[`0],[``0]]\", typeRef.Resolve(new SimpleTypeResolveContext(compilation.MainAssembly)).ReflectionName);\n\t\t\tIMethod convertAll = compilation.FindType(typeof(List<>)).GetMethods(m => m.Name == \"ConvertAll\").Single();\n\t\t\tAssert.AreEqual(\"System.Converter`2[[`0],[``0]]\", typeRef.Resolve(new SimpleTypeResolveContext(convertAll)).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ArrayOfTypeParameter()\n\t\t{\n\t\t\tvar context = new SimpleTypeResolveContext(compilation.MainAssembly);\n\t\t\tAssert.AreEqual(\"`0[,]\", ReflectionHelper.ParseReflectionName(\"`0[,]\").Resolve(context).ReflectionName);\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ArgumentNullException))]\n\t\tpublic void ParseNullReflectionName()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(null);\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName1()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(string.Empty);\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName2()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"`\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName3()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"``\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName4()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Action`A\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName5()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Environment+\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName5b()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Environment+`\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName6()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Int32[\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName7()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Int32[`]\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName8()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Int32[,\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName9()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Int32]\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName10()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Int32*a\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName11()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Action`1[[]]\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName12()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Action`1[[System.Int32]a]\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName13()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Action`1[[System.Int32],]\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName14()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Action`1[[System.Int32]\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName15()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Action`1[[System.Int32\");\n\t\t}\n\t\t\n\t\t[Test, ExpectedException(typeof(ReflectionNameParseException))]\n\t\tpublic void ParseInvalidReflectionName16()\n\t\t{\n\t\t\tReflectionHelper.ParseReflectionName(\"System.Action`1[[System.Int32],[System.String\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/SerializedCecilLoaderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class SerializedCecilLoaderTests : TypeSystemTests\n\t{\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp()\n\t\t{\n\t\t\tCecilLoader loader = new CecilLoader() { IncludeInternalMembers = true };\n\t\t\tIUnresolvedAssembly pc = loader.LoadAssemblyFile(typeof(TestCase.SimplePublicClass).Assembly.Location);\n\t\t\tFastSerializer serializer = new FastSerializer();\n\t\t\tusing (MemoryStream ms = new MemoryStream()) {\n\t\t\t\tserializer.Serialize(ms, pc);\n\t\t\t\tms.Position = 0;\n\t\t\t\tvar asm = (IUnresolvedAssembly)serializer.Deserialize(ms);\n\t\t\t\tbase.compilation = new SimpleCompilation(asm, CecilLoaderTests.Mscorlib);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/SerializedIkvmLoaderTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.IO;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class SerializedIkvmLoaderTests : TypeSystemTests\n\t{\n\t\t[TestFixtureSetUp]\n\t\tpublic void FixtureSetUp()\n\t\t{\n\t\t\tIkvmLoader loader = new IkvmLoader() { IncludeInternalMembers = true };\n\t\t\tIUnresolvedAssembly pc = loader.LoadAssemblyFile(typeof(TestCase.SimplePublicClass).Assembly.Location);\n\t\t\tFastSerializer serializer = new FastSerializer();\n\t\t\tusing (MemoryStream ms = new MemoryStream()) {\n\t\t\t\tserializer.Serialize(ms, pc);\n\t\t\t\tms.Position = 0;\n\t\t\t\tvar asm = (IUnresolvedAssembly)serializer.Deserialize(ms);\n\t\t\t\tbase.compilation = new SimpleCompilation(asm, IkvmLoaderTests.Mscorlib);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/StructureTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Reflection;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class StructureTests\n\t{\n\t\t[Test]\n\t\tpublic void ClassesThatSupportInterningAreSealed()\n\t\t{\n\t\t\tforeach (Type type in typeof(ISupportsInterning).Assembly.GetTypes()) {\n\t\t\t\tif (typeof(ISupportsInterning).IsAssignableFrom(type) && !type.IsInterface) {\n\t\t\t\t\tAssert.IsTrue(type.IsSealed, type.FullName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void System_TypeCode_corresponds_with_KnownTypeCode()\n\t\t{\n\t\t\tforeach (TypeCode typeCode in Enum.GetValues(typeof(System.TypeCode))) {\n\t\t\t\tif (typeCode == TypeCode.Empty)\n\t\t\t\t\tAssert.AreEqual(\"None\", ((KnownTypeCode)typeCode).ToString());\n\t\t\t\telse\n\t\t\t\t\tAssert.AreEqual(typeCode.ToString(), ((KnownTypeCode)typeCode).ToString());\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void KnownTypeReference_Get_returns_correct_KnownType()\n\t\t{\n\t\t\tforeach (KnownTypeCode typeCode in Enum.GetValues(typeof(KnownTypeCode))) {\n\t\t\t\tif (typeCode == KnownTypeCode.None) {\n\t\t\t\t\tAssert.IsNull(KnownTypeReference.Get(KnownTypeCode.None));\n\t\t\t\t} else {\n\t\t\t\t\tAssert.AreEqual(typeCode, KnownTypeReference.Get(typeCode).KnownTypeCode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void KnownTypeReference_has_static_fields_for_KnownTypes()\n\t\t{\n\t\t\tforeach (KnownTypeCode typeCode in Enum.GetValues(typeof(KnownTypeCode))) {\n\t\t\t\tif (typeCode == KnownTypeCode.None)\n\t\t\t\t\tcontinue;\n\t\t\t\tFieldInfo field = typeof(KnownTypeReference).GetField(typeCode.ToString());\n\t\t\t\tAssert.IsNotNull(field, \"Missing field for \" + typeCode.ToString());\n\t\t\t\tKnownTypeReference ktr = (KnownTypeReference)field.GetValue(null);\n\t\t\t\tAssert.AreEqual(typeCode, ktr.KnownTypeCode);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TestInterningProvider.cs",
    "content": "// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Serialization;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.Utils;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/* Not a real unit test\n\t[TestFixture]\n\tpublic class TestInterningProvider\n\t{\n\t\tsealed class ReferenceComparer : IEqualityComparer<object>\n\t\t{\n\t\t\tpublic new bool Equals(object a, object b)\n\t\t\t{\n\t\t\t\treturn ReferenceEquals(a, b);\n\t\t\t}\n\t\t\t\n\t\t\tpublic int GetHashCode(object obj)\n\t\t\t{\n\t\t\t\treturn RuntimeHelpers.GetHashCode(obj);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class InterningComparer : IEqualityComparer<ISupportsInterning>\n\t\t{\n\t\t\tpublic bool Equals(ISupportsInterning x, ISupportsInterning y)\n\t\t\t{\n\t\t\t\treturn x.EqualsForInterning(y);\n\t\t\t}\n\t\t\t\n\t\t\tpublic int GetHashCode(ISupportsInterning obj)\n\t\t\t{\n\t\t\t\treturn obj.GetHashCodeForInterning();\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class ListComparer : IEqualityComparer<IEnumerable<object>>\n\t\t{\n\t\t\tpublic bool Equals(IEnumerable<object> a, IEnumerable<object> b)\n\t\t\t{\n\t\t\t\tif (a.GetType() != b.GetType())\n\t\t\t\t\treturn false;\n\t\t\t\treturn Enumerable.SequenceEqual(a, b, new ReferenceComparer());\n\t\t\t}\n\t\t\t\n\t\t\tpublic int GetHashCode(IEnumerable<object> obj)\n\t\t\t{\n\t\t\t\tint hashCode = obj.GetType().GetHashCode();\n\t\t\t\tunchecked {\n\t\t\t\t\tforeach (object o in obj) {\n\t\t\t\t\t\thashCode *= 27;\n\t\t\t\t\t\thashCode += RuntimeHelpers.GetHashCode(o);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tsealed class InterningProvider : IInterningProvider\n\t\t{\n\t\t\tinternal HashSet<object> uniqueObjectsPreIntern = new HashSet<object>(new ReferenceComparer());\n\t\t\tinternal HashSet<object> uniqueObjectsPostIntern = new HashSet<object>(new ReferenceComparer());\n\t\t\tinternal Dictionary<object, object> byValueDict = new Dictionary<object, object>();\n\t\t\tinternal Dictionary<ISupportsInterning, ISupportsInterning> supportsInternDict = new Dictionary<ISupportsInterning, ISupportsInterning>(new InterningComparer());\n\t\t\tinternal Dictionary<IEnumerable<object>, IEnumerable<object>> listDict = new Dictionary<IEnumerable<object>, IEnumerable<object>>(new ListComparer());\n\t\t\t\n\t\t\tpublic T Intern<T>(T obj) where T : class\n\t\t\t{\n\t\t\t\tif (obj == null)\n\t\t\t\t\treturn null;\n\t\t\t\tuniqueObjectsPreIntern.Add(obj);\n\t\t\t\tISupportsInterning s = obj as ISupportsInterning;\n\t\t\t\tif (s != null) {\n\t\t\t\t\tISupportsInterning output;\n\t\t\t\t\tif (supportsInternDict.TryGetValue(s, out output)) {\n\t\t\t\t\t\tobj = (T)output;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts.PrepareForInterning(this);\n\t\t\t\t\t\tif (supportsInternDict.TryGetValue(s, out output))\n\t\t\t\t\t\t\tobj = (T)output;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tsupportsInternDict.Add(s, s);\n\t\t\t\t\t}\n\t\t\t\t} else if (obj is IType || Type.GetTypeCode(obj.GetType()) >= TypeCode.Boolean) {\n\t\t\t\t\tobject output;\n\t\t\t\t\tif (byValueDict.TryGetValue(obj, out output))\n\t\t\t\t\t\tobj = (T)output;\n\t\t\t\t\telse\n\t\t\t\t\t\tbyValueDict.Add(obj, obj);\n\t\t\t\t}\n\t\t\t\tuniqueObjectsPostIntern.Add(obj);\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\t\n\t\t\tpublic IList<T> InternList<T>(IList<T> list) where T : class\n\t\t\t{\n\t\t\t\tif (list == null)\n\t\t\t\t\treturn null;\n\t\t\t\tuniqueObjectsPreIntern.Add(list);\n\t\t\t\tfor (int i = 0; i < list.Count; i++) {\n\t\t\t\t\tT oldItem = list[i];\n\t\t\t\t\tT newItem = Intern(oldItem);\n\t\t\t\t\tif (oldItem != newItem) {\n\t\t\t\t\t\tif (list.IsReadOnly)\n\t\t\t\t\t\t\tlist = new T[list.Count];\n\t\t\t\t\t\tlist[i] = newItem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!list.IsReadOnly)\n\t\t\t\t\tlist = new ReadOnlyCollection<T>(list);\n\t\t\t\tIEnumerable<object> output;\n\t\t\t\tif (listDict.TryGetValue(list, out output))\n\t\t\t\t\tlist = (IList<T>)output;\n\t\t\t\telse\n\t\t\t\t\tlistDict.Add(list, list);\n\t\t\t\tuniqueObjectsPostIntern.Add(list);\n\t\t\t\treturn list;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void InternProject(IProjectContent pc)\n\t\t\t{\n\t\t\t\tforeach (var c in TreeTraversal.PreOrder(pc.GetClasses(), c => c.NestedTypes)) {\n\t\t\t\t\tIntern(c.Namespace);\n\t\t\t\t\tIntern(c.Name);\n\t\t\t\t\tforeach (IMember m in c.Members) {\n\t\t\t\t\t\tIntern(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tIProjectContent[] LoadProjects(CecilLoader loader)\n\t\t{\n\t\t\tconst string dir = @\"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.0\\\";\n\t\t\treturn new IProjectContent[] {\n\t\t\t\tloader.LoadAssemblyFile(dir + \"mscorlib.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"System.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"System.Core.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"System.Xml.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"System.Xml.Linq.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"System.Data.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"System.Drawing.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"System.Windows.Forms.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"WindowsBase.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"PresentationCore.dll\"),\n\t\t\t\tloader.LoadAssemblyFile(dir + \"PresentationFramework.dll\")\n\t\t\t};\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PrintStatistics()\n\t\t{\n\t\t\tlong startMemory = GC.GetTotalMemory(true);\n\t\t\tIProjectContent[] pc = LoadProjects(new CecilLoader());\n\t\t\tlong memoryWithFullPC = GC.GetTotalMemory(true) - startMemory;\n\t\t\tInterningProvider p = new InterningProvider();\n\t\t\tCecilLoader loader = new CecilLoader();\n\t\t\tloader.InterningProvider = p;\n\t\t\tpc = LoadProjects(loader);\n\t\t\tPrintStatistics(p);\n\t\t\tloader = null;\n\t\t\tp = null;\n\t\t\tlong memoryWithInternedPC = GC.GetTotalMemory(true) - startMemory;\n\t\t\tGC.KeepAlive(pc);\n\t\t\tConsole.WriteLine(memoryWithInternedPC / 1024 + \" KB / \" + memoryWithFullPC / 1024 + \" KB\");\n\t\t}\n\t\t\n\t\tvoid PrintStatistics(InterningProvider p)\n\t\t{\n\t\t\tvar stats =\n\t\t\t\tfrom obj in p.uniqueObjectsPreIntern\n\t\t\t\tgroup 1 by obj.GetType() into g\n\t\t\t\tjoin g2 in (from obj in p.uniqueObjectsPostIntern group 1 by obj.GetType()) on g.Key equals g2.Key\n\t\t\t\torderby g.Key.FullName\n\t\t\t\tselect new { Type = g.Key, PreCount = g.Count(), PostCount = g2.Count() };\n\t\t\tforeach (var element in stats) {\n\t\t\t\tConsole.WriteLine(element.Type + \": \" + element.PostCount + \"/\" + element.PreCount);\n\t\t\t}\n\t\t}\n\t}//*/\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeParameterTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t[TestFixture]\n\tpublic class TypeParameterTests\n\t{\n\t\t[Test]\n\t\tpublic void TypeParameterDerivingFromOtherTypeParameterDoesNotInheritReferenceConstraint()\n\t\t{\n\t\t\t// class C<T, U> where T : class where U : T\n\t\t\tvar c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"T\") { HasReferenceTypeConstraint = true });\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 1, \"U\") {\n\t\t\t                     \tConstraints = { new TypeParameterReference(SymbolKind.TypeDefinition, 0) }\n\t\t\t                     });\n\t\t\t\n\t\t\tITypeDefinition resolvedC = TypeSystemHelper.CreateCompilationAndResolve(c);\n\t\t\t// At runtime, we might have T=System.ValueType and U=int, so C# can't inherit the 'class' constraint\n\t\t\t// from one type parameter to another.\n\t\t\tAssert.AreEqual(true, resolvedC.TypeParameters[0].IsReferenceType);\n\t\t\tAssert.IsNull(resolvedC.TypeParameters[1].IsReferenceType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ValueTypeParameterDerivingFromReferenceTypeParameter()\n\t\t{\n\t\t\t// class C<T, U> where T : class where U : struct, T\n\t\t\tvar c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"T\") { HasReferenceTypeConstraint = true });\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 1, \"U\") {\n\t\t\t                     \tHasValueTypeConstraint = true,\n\t\t\t                     \tConstraints = { new TypeParameterReference(SymbolKind.TypeDefinition, 0) }\n\t\t\t                     });\n\t\t\t\n\t\t\tITypeDefinition resolvedC = TypeSystemHelper.CreateCompilationAndResolve(c);\n\t\t\t// At runtime, we might have T=System.ValueType and U=int, so C# can't inherit the 'class' constraint\n\t\t\t// from one type parameter to another.\n\t\t\tAssert.AreEqual(true, resolvedC.TypeParameters[0].IsReferenceType);\n\t\t\tAssert.AreEqual(false, resolvedC.TypeParameters[1].IsReferenceType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeParameterDerivingFromOtherTypeParameterInheritsEffectiveBaseClass()\n\t\t{\n\t\t\t// class C<T, U> where T : List<string> where U : T\n\t\t\tvar c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"T\") {\n\t\t\t                     \tConstraints = { typeof(List<string>).ToTypeReference() }\n\t\t\t                     });\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 1, \"U\") {\n\t\t\t                     \tConstraints = { new TypeParameterReference(SymbolKind.TypeDefinition, 0) }\n\t\t\t                     });\n\t\t\t\n\t\t\tITypeDefinition resolvedC = TypeSystemHelper.CreateCompilationAndResolve(c);\n\t\t\tAssert.AreEqual(true, resolvedC.TypeParameters[0].IsReferenceType);\n\t\t\tAssert.AreEqual(true, resolvedC.TypeParameters[1].IsReferenceType);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List`1[[System.String]]\", resolvedC.TypeParameters[0].EffectiveBaseClass.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List`1[[System.String]]\", resolvedC.TypeParameters[1].EffectiveBaseClass.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImportOpenGenericType()\n\t\t{\n\t\t\t// class C<T, U> { void M<X>() {} }\n\t\t\t\n\t\t\tvar c = new DefaultUnresolvedTypeDefinition(string.Empty, \"C\");\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 0, \"T\"));\n\t\t\tc.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.TypeDefinition, 1, \"U\"));\n\t\t\tvar m = new DefaultUnresolvedMethod(c, \"M\");\n\t\t\tm.TypeParameters.Add(new DefaultUnresolvedTypeParameter(SymbolKind.Method, 0, \"X\"));\n\t\t\tc.Members.Add(m);\n\t\t\t\n\t\t\tvar resolvedC1 = TypeSystemHelper.CreateCompilationAndResolve(c);\n\t\t\tvar resolvedM1 = resolvedC1.Methods.Single(method => method.Name == \"M\");\n\t\t\t\n\t\t\tvar resolvedC2 = TypeSystemHelper.CreateCompilationAndResolve(c);\n\t\t\tvar resolvedM2 = resolvedC2.Methods.Single(method => method.Name == \"M\");\n\t\t\t\n\t\t\t// the types, methods and type parameters differ in the two compilations:\n\t\t\tAssert.AreNotEqual(resolvedC1, resolvedC2);\n\t\t\tAssert.AreNotEqual(resolvedM1, resolvedM2);\n\t\t\tAssert.AreNotEqual(resolvedC1.TypeParameters[1], resolvedC2.TypeParameters[1]);\n\t\t\tAssert.AreNotEqual(resolvedM1.TypeParameters[0], resolvedM2.TypeParameters[0]);\n\t\t\t\n\t\t\t// C<U, X>\n\t\t\tvar pt1 = new ParameterizedType(resolvedC1, new[] { resolvedC1.TypeParameters[1], resolvedM1.TypeParameters[0] });\n\t\t\tvar pt2 = (ParameterizedType)resolvedC2.Compilation.Import(pt1);\n\t\t\t\n\t\t\t// importing resulted in C<U, X> in the new compilation:\n\t\t\tAssert.AreEqual(resolvedC2, pt2.GetDefinition());\n\t\t\tAssert.AreEqual(resolvedC2.TypeParameters[1], pt2.TypeArguments[0]);\n\t\t\tAssert.AreEqual(resolvedM2.TypeParameters[0], pt2.TypeArguments[1]);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemHelper.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.NRefactory.CSharp;\nusing ICSharpCode.NRefactory.CSharp.TypeSystem;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\tpublic static class TypeSystemHelper\n\t{\n\t\tpublic static ICompilation CreateCompilation()\n\t\t{\n\t\t\treturn CreateCompilation(new IUnresolvedFile[0]);\n\t\t}\n\t\t\n\t\tpublic static ICompilation CreateCompilation(params IUnresolvedTypeDefinition[] unresolvedTypeDefinitions)\n\t\t{\n\t\t\tvar unresolvedFile = new CSharpUnresolvedFile();\n\t\t\tforeach (var typeDef in unresolvedTypeDefinitions)\n\t\t\t\tunresolvedFile.TopLevelTypeDefinitions.Add(typeDef);\n\t\t\treturn CreateCompilation(unresolvedFile);\n\t\t}\n\t\t\n\t\tpublic static ICompilation CreateCompilation(params IUnresolvedFile[] unresolvedFiles)\n\t\t{\n\t\t\tvar pc = new CSharpProjectContent().AddOrUpdateFiles(unresolvedFiles);\n\t\t\tpc = pc.AddAssemblyReferences(new [] { CecilLoaderTests.Mscorlib, CecilLoaderTests.SystemCore });\n\t\t\treturn pc.CreateCompilation();\n\t\t}\n\t\t\n\t\tpublic static ITypeDefinition CreateCompilationAndResolve(IUnresolvedTypeDefinition unresolvedTypeDefinition)\n\t\t{\n\t\t\tvar compilation = CreateCompilation(unresolvedTypeDefinition);\n\t\t\treturn compilation.MainAssembly.GetTypeDefinition(unresolvedTypeDefinition.FullTypeName);\n\t\t}\n\t\t\n\t\tpublic static ICompilation CreateCompilationWithoutCorlib(params IUnresolvedTypeDefinition[] unresolvedTypeDefinitions)\n\t\t{\n\t\t\tvar unresolvedFile = new CSharpUnresolvedFile();\n\t\t\tforeach (var typeDef in unresolvedTypeDefinitions)\n\t\t\t\tunresolvedFile.TopLevelTypeDefinitions.Add(typeDef);\n\t\t\treturn CreateCompilation(unresolvedFile);\n\t\t}\n\t\t\n\t\tpublic static ICompilation CreateCompilationWithoutCorlib(params IUnresolvedFile[] unresolvedFiles)\n\t\t{\n\t\t\tvar pc = new CSharpProjectContent().AddOrUpdateFiles(unresolvedFiles);\n\t\t\treturn pc.CreateCompilation();\n\t\t}\n\t\t\n\t\tpublic static ITypeDefinition CreateCompilationWithoutCorlibAndResolve(IUnresolvedTypeDefinition unresolvedTypeDefinition)\n\t\t{\n\t\t\tvar compilation = CreateCompilationWithoutCorlib(unresolvedTypeDefinition);\n\t\t\treturn compilation.MainAssembly.GetTypeDefinition(unresolvedTypeDefinition.FullTypeName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.TestCase.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Runtime.CompilerServices;\n\n[assembly: ICSharpCode.NRefactory.TypeSystem.TestCase.TypeTestAttribute(\n\t42, typeof(System.Action<>), typeof(IDictionary<string, IList<NUnit.Framework.TestAttribute>>))]\n\n[assembly: TypeForwardedTo(typeof(Func<,>))]\n\nnamespace ICSharpCode.NRefactory.TypeSystem.TestCase\n{\n\tpublic delegate S GenericDelegate<in T, out S>(T input) where T : S where S : class;\n\t\n\tpublic class SimplePublicClass\n\t{\n\t\tpublic void Method() {}\n\t}\n\t\n\tpublic class TypeTestAttribute : Attribute\n\t{\n\t\tpublic TypeTestAttribute(int a1, Type a2, Type a3) {}\n\t}\n\t\n\t[Params(1, StringComparison.CurrentCulture, null, 4.0, \"Test\")]\n\tpublic class ParamsAttribute : Attribute\n\t{\n\t\tpublic ParamsAttribute(params object[] x) {}\n\t\t\n\t\t[Params(Property = new string[] { \"a\", \"b\" })]\n\t\tpublic string[] Property { \n\t\t\t[return: Params(\"Attribute on return type of getter\")]\n\t\t\tget { return null; }\n\t\t\tset { }\n\t\t}\n\t}\n\t\n\t[Double(1)]\n\tpublic class DoubleAttribute : Attribute\n\t{\n\t\tpublic DoubleAttribute(double val) {}\n\t}\n\t\n\tpublic unsafe class DynamicTest\n\t{\n\t\tpublic dynamic SimpleProperty { get; set; }\n\t\t\n\t\tpublic List<dynamic> DynamicGenerics1(Action<object, dynamic[], object> param) { return null; }\n\t\tpublic void DynamicGenerics2(Action<object, dynamic, object> param) { }\n\t\tpublic void DynamicGenerics3(Action<int, dynamic, object> param) { }\n\t\tpublic void DynamicGenerics4(Action<int[], dynamic, object> param) { }\n\t\tpublic void DynamicGenerics5(Action<int*[], dynamic, object> param) { }\n\t\tpublic void DynamicGenerics6(ref Action<object, dynamic, object> param) { }\n\t\tpublic void DynamicGenerics7(Action<int[,][], dynamic, object> param) { }\n\t}\n\t\n\tpublic class GenericClass<A, B> where A : B\n\t{\n\t\tpublic void TestMethod<K, V>(string param) where V: K where K: IComparable<V> {}\n\t\tpublic void GetIndex<T>(T element) where T : IEquatable<T> {}\n\t\t\n\t\tpublic NestedEnum EnumField;\n\t\t\n\t\tpublic A Property { get; set; }\n\t\t\n\t\tpublic enum NestedEnum {\n\t\t\tEnumMember\n\t\t}\n\t}\n\t\n\tpublic class PropertyTest\n\t{\n\t\tpublic int PropertyWithProtectedSetter { get; protected set; }\n\t\t\n\t\tpublic object PropertyWithPrivateSetter { get; private set; }\n\n\t\tpublic object PropertyWithoutSetter { get { return null; } }\n\n\t\tpublic object PropertyWithPrivateGetter { private get; set; }\n\n\t\tpublic string this[int index] { get { return \"Test\"; } set {} }\n\t}\n\t\n\tpublic enum MyEnum : short\n\t{\n\t\tFirst,\n\t\tSecond,\n\t\tFlag1 = 0x10,\n\t\tFlag2 = 0x20,\n\t\tCombinedFlags = Flag1 | Flag2\n\t}\n\t\n\tpublic class Base<T>\n\t{\n\t\tpublic class Nested<X> {}\n\t\t\n\t\tpublic virtual void GenericMethodWithConstraints<X>(T a) where X : IComparer<T>, new() {}\n\t}\n\tpublic class Derived<A, B> : Base<B>\n\t{\n\t\tpublic override void GenericMethodWithConstraints<Y>(B a) { }\n\t}\n\t\n\tpublic struct MyStructWithCtor\n\t{\n\t\tpublic MyStructWithCtor(int a) {}\n\t}\n\t\n\tpublic class MyClassWithCtor\n\t{\n\t\tprivate MyClassWithCtor(int a) {}\n\t}\n\t\n\t[Serializable]\n\tpublic class NonCustomAttributes\n\t{\n\t\t[NonSerialized]\n\t\tpublic readonly int NonSerializedField;\n\t\t\n\t\t[DllImport(\"unmanaged.dll\", CharSet = CharSet.Unicode)]\n\t\t[return: MarshalAs(UnmanagedType.Bool)]\n\t\tpublic static extern bool DllMethod([In, Out] ref int p);\n\t}\n\t\n\t[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode, Pack = 8)]\n\tpublic struct ExplicitFieldLayoutStruct\n\t{\n\t\t[FieldOffset(0)]\n\t\tpublic int Field0;\n\t\t\n\t\t[FieldOffset(100)]\n\t\tpublic int Field100;\n\t}\n\t\n\tpublic class ParameterTests\n\t{\n\t\tpublic void MethodWithOutParameter(out int x) { x = 0; }\n\t\tpublic void MethodWithParamsArray(params object[] x) {}\n\t\tpublic void MethodWithOptionalParameter(int x = 4) {}\n\t\tpublic void MethodWithExplicitOptionalParameter([Optional] int x) {}\n\t\tpublic void MethodWithEnumOptionalParameter(StringComparison x = StringComparison.OrdinalIgnoreCase) {}\n\t\tpublic void MethodWithOptionalNullableParameter(int? x = null) {}\n\t\tpublic void MethodWithOptionalLongParameter(long x = 1) {}\n\t\tpublic void MethodWithOptionalNullableLongParameter(long? x = 1) {}\n\t}\n\t\n\t[ComImport(), Guid(\"21B8916C-F28E-11D2-A473-00C04F8EF448\"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]\n\tpublic interface IAssemblyEnum\n\t{\n\t\t[PreserveSig()]\n\t\tint GetNextAssembly(uint dwFlags);\n\t}\n\t\n\tpublic class OuterGeneric<X>\n\t{\n\t\tpublic class Inner {\n\t\t\tpublic OuterGeneric<X> referenceToOuter;\n\t\t\tpublic Inner(OuterGeneric<X> referenceToOuter) {}\n\t\t}\n\t\t\n\t\tpublic OuterGeneric<X>.Inner Field1;\n\t\tpublic Inner Field2;\n\t\tpublic OuterGeneric<OuterGeneric<X>.Inner>.Inner Field3;\n\t}\n\t\n\tpublic class ExplicitDisposableImplementation : IDisposable\n\t{\n\t\tvoid IDisposable.Dispose() {}\n\t}\n\t\n\tpublic interface IGenericInterface<T>\n\t{\n\t\tvoid Test<S>(T a, S b) where S : T;\n\t\tvoid Test<S>(T a, ref S b);\n\t}\n\t\n\tpublic class ExplicitGenericInterfaceImplementation : IGenericInterface<string>\n\t{\n\t\tvoid IGenericInterface<string>.Test<T>(string a, T b) {}\n\t\tvoid IGenericInterface<string>.Test<T>(string a, ref T b) {}\n\t}\n\t\n\tpublic interface IGenericInterfaceWithUnifiableMethods<T, S>\n\t{\n\t\tvoid Test(T a);\n\t\tvoid Test(S a);\n\t}\n\t\n\tpublic class ImplementationOfUnifiedMethods : IGenericInterfaceWithUnifiableMethods<int, int>\n\t{\n\t\tpublic void Test(int a) {}\n\t}\n\t\n\tpublic class ExplicitGenericInterfaceImplementationWithUnifiableMethods<T, S> : IGenericInterfaceWithUnifiableMethods<T, S>\n\t{\n\t\tvoid IGenericInterfaceWithUnifiableMethods<T, S>.Test(T a) {}\n\t\tvoid IGenericInterfaceWithUnifiableMethods<T, S>.Test(S a) {}\n\t}\n\t\n\tpublic partial class PartialClass\n\t{\n\t\tpartial void PartialMethodWithImplementation(int a);\n\t\t\n\t\tpartial void PartialMethodWithImplementation(System.Int32 a)\n\t\t{\n\t\t}\n\t\t\n\t\tpartial void PartialMethodWithImplementation(string a);\n\t\t\n\t\tpartial void PartialMethodWithImplementation(System.String a)\n\t\t{\n\t\t}\n\t\t\n\t\tpartial void PartialMethodWithoutImplementation();\n\t}\n\t\n\tpublic class ClassWithStaticAndNonStaticMembers\n\t{\n\t\tpublic static event System.EventHandler Event1 { add {} remove{} }\n\t\tpublic event System.EventHandler Event2 { add {} remove{} }\n\t\t#pragma warning disable 67\n\t\tpublic static event System.EventHandler Event3;\n\t\tpublic event System.EventHandler Event4;\n\n\t\tpublic static int Prop1 { get { return 0; } set {} }\n\t\tpublic int Prop2 { get { return 0; } set {} }\n\t\tpublic static int Prop3 { get; set; }\n\t\tpublic int Prop4 { get; set; }\n\t}\n\n\tpublic interface IInterfaceWithProperty {\n\t\tint Prop { get; set; }\n\t}\n\n\tpublic class ClassWithVirtualProperty {\n\t\tpublic virtual int Prop { get; set; }\n\t}\n\t\n\tpublic class ClassThatOverridesAndSealsVirtualProperty : ClassWithVirtualProperty {\n\t\tpublic sealed override int Prop { get; set; }\n\t}\n\n\tpublic class ClassThatImplementsProperty : IInterfaceWithProperty {\n\t\tpublic int Prop { get; set; }\n\t}\n\n\tpublic class ClassThatImplementsPropertyExplicitly : IInterfaceWithProperty {\n\t\tint IInterfaceWithProperty.Prop { get; set; }\n\t}\n\n\tpublic interface IInterfaceWithIndexers {\n\t\tint this[int x] { get; set; }\n\t\tint this[string x] { get; set; }\n\t\tint this[int x, int y] { get; set; }\n\t}\n\n\tpublic interface IGenericInterfaceWithIndexer<T> {\n\t\tint this[T x] { get; set; }\n\t}\n\n\tpublic class ClassThatImplementsIndexers : IInterfaceWithIndexers, IGenericInterfaceWithIndexer<int> {\n\t\tpublic int this[int x] { get { return 0; } set {} }\n\t\tpublic int this[string x] { get { return 0; } set {} }\n\t\tpublic int this[int x, int y] { get { return 0; } set {} }\n\t}\n\n\tpublic class ClassThatImplementsIndexersExplicitly : IInterfaceWithIndexers, IGenericInterfaceWithIndexer<int> {\n\t\tint IInterfaceWithIndexers.this[int x] { get { return 0; } set {} }\n\t\tint IGenericInterfaceWithIndexer<int>.this[int x] { get { return 0; } set {} }\n\t\tint IInterfaceWithIndexers.this[string x] { get { return 0; } set {} }\n\t\tint IInterfaceWithIndexers.this[int x, int y] { get { return 0; } set {} }\n\t}\n\n\tpublic interface IHasEvent {\n\t\tevent EventHandler Event;\n\t}\n\n\tpublic class ClassThatImplementsEvent : IHasEvent {\n\t\tpublic event EventHandler Event;\n\t}\n\n\tpublic class ClassThatImplementsEventWithCustomAccessors : IHasEvent {\n\t\tpublic event EventHandler Event { add {} remove {} }\n\t}\n\n\tpublic class ClassThatImplementsEventExplicitly : IHasEvent {\n\t\tevent EventHandler IHasEvent.Event { add {} remove {} }\n\t}\n\n\tpublic interface IShadowTestBase {\n\t\tvoid Method();\n\t\tint this[int i] { get; set; }\n\t\tint Prop { get; set; }\n\t\tevent EventHandler Evt;\n\t}\n\n\tpublic interface IShadowTestDerived : IShadowTestBase {\n\t\tnew void Method();\n\t\tnew int this[int i] { get; set; }\n\t\tnew int Prop { get; set; }\n\t\tnew event EventHandler Evt;\n\t}\n\t\n\tpublic static class StaticClass {}\n\tpublic abstract class AbstractClass {}\n\t\n\tpublic class IndexerNonDefaultName {\n\t\t[IndexerName(\"Foo\")]\n\t\tpublic int this[int index] {\n\t\t\tget { return 0; }\n\t\t}\n\t}\n\n\tpublic class ClassWithMethodThatHasNullableDefaultParameter {\n\t\tpublic void Foo (int? bar = 42) { }\n\t}\n\n\tpublic class AccessibilityTest\n\t{\n\t\tpublic void Public() {}\n\t\tinternal void Internal() {}\n\t\tprotected internal void ProtectedInternal() {}\n\t\tinternal protected void InternalProtected() {}\n\t\tprotected void Protected() {}\n\t\tprivate void Private() {}\n\t\tvoid None() {}\n\t}\n\n\tpublic class ConstantFieldTest\n\t{\n\t\tpublic const byte Cb = 42;\n\t\tpublic const sbyte Csb = 42;\n\t\tpublic const char Cc = '\\x42';\n\t\tpublic const short Cs = 42;\n\t\tpublic const ushort Cus = 42;\n\t\tpublic const int Ci = 42;\n\t\tpublic const uint Cui = 42;\n\t\tpublic const long Cl = 42;\n\t\tpublic const ulong Cul = 42;\n\t\tpublic const double Cd = 42;\n\t\tpublic const float Cf = 42;\n\t\tpublic const decimal Cm = 42;\n\t\tpublic const string S = \"hello, world\";\n\t\tpublic const string NullString = null;\n\t\t\n\t\tpublic const MyEnum EnumFromThisAssembly = MyEnum.Second;\n\t\tpublic const StringComparison EnumFromAnotherAssembly = StringComparison.OrdinalIgnoreCase;\n\t\tpublic const MyEnum DefaultOfEnum = default(MyEnum);\n\t\t\n\t\tpublic const int SOsb = sizeof(sbyte);\n\t\tpublic const int SOb  = sizeof(byte);\n\t\tpublic const int SOs  = sizeof(short);\n\t\tpublic const int SOus = sizeof(ushort);\n\t\tpublic const int SOi  = sizeof(int);\n\t\tpublic const int SOui = sizeof(uint);\n\t\tpublic const int SOl  = sizeof(long);\n\t\tpublic const int SOul = sizeof(ulong);\n\t\tpublic const int SOc  = sizeof(char);\n\t\tpublic const int SOf  = sizeof(float);\n\t\tpublic const int SOd  = sizeof(double);\n\t\tpublic const int SObl = sizeof(bool);\n\t\tpublic const int SOe = sizeof(MyEnum);\n\n\n\t\tpublic const byte CNewb = new byte();\n\t\tpublic const sbyte CNewsb = new sbyte();\n\t\tpublic const char CNewc = new char();\n\t\tpublic const short CNews = new short();\n\t\tpublic const ushort CNewus = new ushort();\n\t\tpublic const int CNewi = new int();\n\t\tpublic const uint CNewui = new uint();\n\t\tpublic const long CNewl = new long();\n\t\tpublic const ulong CNewul = new ulong();\n\t\tpublic const double CNewd = new double();\n\t\tpublic const float CNewf = new float();\n\t\tpublic const decimal CNewm = new decimal();\n\t}\n\n\tpublic interface IExplicitImplementationTests \n\t{\n\t\tvoid M(int a);\n\t\tint P { get; set; }\n\t\tevent Action E;\n\t\tint this[int x] { get; set; }\n\t}\n\n\tpublic class ExplicitImplementationTests : IExplicitImplementationTests \n\t{\n\t\tpublic void M(int a) {}\n\t\tpublic int P { get; set; }\n\t\tpublic event Action E;\n\t\tpublic int this[int x] { get { return 0; } set {} }\n\n\t\tvoid IExplicitImplementationTests.M(int a) {}\n\t\tint IExplicitImplementationTests.P { get; set; }\n\t\tevent Action IExplicitImplementationTests.E { add {} remove {} }\n\t\tint IExplicitImplementationTests.this[int x] { get { return 0; } set {} }\n\t}\n\n\t[TypeTest(C, typeof(Inner), typeof(int)), My]\n\tpublic class ClassWithAttributesUsingNestedMembers {\n\t\tsealed class MyAttribute : Attribute {}\n\n\t\tconst int C = 42;\n\t\tclass Inner {\n\t\t}\n\n\t\t[TypeTest(C, typeof(Inner), typeof(int)), My]\n\t\tpublic int P { get; set; }\n\n\t\t[TypeTest(C, typeof(Inner), typeof(int)), My]\n\t\tclass AttributedInner {\n\t\t}\n\n\t\t[TypeTest(C, typeof(Inner), typeof(int)), My]\n\t\tclass AttributedInner2 {\n\t\t\tsealed class MyAttribute : Attribute {}\n\n\t\t\tconst int C = 43;\n\t\t\tclass Inner {}\n\t\t}\n\t}\n\n\t[Guid (\"790C6E0B-9194-4cc9-9426-A48A63185696\"), InterfaceType (ComInterfaceType.InterfaceIsDual)]\n\t[ComImport]\n\tpublic interface IMarshalAsTests\n\t{\n\t\t[DispId (48)]\n\t\tvoid AliasComponent ([MarshalAs (UnmanagedType.BStr)] [In] string bstrSrcApplicationIDOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrCLSIDOrProgID, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDestApplicationIDOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrNewProgId, [MarshalAs (UnmanagedType.BStr)] [In] string bstrNewClsid);\n\n\t\t[DispId (33)]\n\t\t[return: MarshalAs (UnmanagedType.VariantBool)]\n\t\tbool AreApplicationInstancesPaused ([MarshalAs (UnmanagedType.LPStruct)] [In] object pVarApplicationInstanceID);\n\n\t\t[DispId (19)]\n\t\tvoid BackupREGDB ([MarshalAs (UnmanagedType.BStr)] [In] string bstrBackupFilePath);\n\n\t\t[DispId (2)]\n\t\t[return: MarshalAs (UnmanagedType.Interface)]\n\t\tobject Connect ([MarshalAs (UnmanagedType.BStr)] [In] string connectStr);\n\n\t\t[DispId (45)]\n\t\tvoid CopyApplications ([MarshalAs (UnmanagedType.BStr)] [In] string bstrSourcePartitionIDOrName, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarApplicationID, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDestinationPartitionIDOrName);\n\n\t\t[DispId (46)]\n\t\tvoid CopyComponents ([MarshalAs (UnmanagedType.BStr)] [In] string bstrSourceApplicationIDOrName, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarCLSIDOrProgID, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDestinationApplicationIDOrName);\n\n\t\t[DispId (36)]\n\t\tvoid CreateServiceForApplication ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationIDOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrServiceName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrStartType, [MarshalAs (UnmanagedType.BStr)] [In] string bstrErrorControl, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDependencies, [MarshalAs (UnmanagedType.BStr)] [In] string bstrRunAs, [MarshalAs (UnmanagedType.BStr)] [In] string bstrPassword, [MarshalAs (UnmanagedType.VariantBool)] [In] bool bDesktopOk);\n\n\t\t[DispId (40)]\n\t\tvoid CurrentPartition ([MarshalAs (UnmanagedType.BStr)] [In] string bstrPartitionIDOrName);\n\n\t\t[DispId (41)]\n\t\t[return: MarshalAs (UnmanagedType.BStr)]\n\t\tstring CurrentPartitionID ();\n\n\t\t[DispId (42)]\n\t\t[return: MarshalAs (UnmanagedType.BStr)]\n\t\tstring CurrentPartitionName ();\n\n\t\t[DispId (37)]\n\t\tvoid DeleteServiceForApplication ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationIDOrName);\n\n\t\t[DispId (34)]\n\t\t[return: MarshalAs (UnmanagedType.BStr)]\n\t\tstring DumpApplicationInstance ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationInstanceID, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDirectory, [MarshalAs (UnmanagedType.I4)] [In] int lMaxImages);\n\n\t\t[DispId (9)]\n\t\tvoid ExportApplication ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationFile, [In] int lOptions);\n\n\t\t[DispId (54)]\n\t\tvoid ExportPartition ([MarshalAs (UnmanagedType.BStr)] [In] string bstrPartitionIDOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrPartitionFileName, [MarshalAs (UnmanagedType.I4)] [In] int lOptions);\n\n\t\t[DispId (44)]\n\t\tvoid FlushPartitionCache ();\n\n\t\t[DispId (28)]\n\t\t[return: MarshalAs (UnmanagedType.BStr)]\n\t\tstring GetApplicationInstanceIDFromProcessID ([MarshalAs (UnmanagedType.I4)] [In] int lProcessID);\n\n\t\t[DispId (1)]\n\t\t[return: MarshalAs (UnmanagedType.Interface)]\n\t\tobject GetCollection ([MarshalAs (UnmanagedType.BStr)] [In] string bstrCollName);\n\n\t\t[DispId (5)]\n\t\t[return: MarshalAs (UnmanagedType.Interface)]\n\t\tobject GetCollectionByQuery ([MarshalAs (UnmanagedType.BStr)] [In] string collName, [MarshalAs (UnmanagedType.SafeArray)] [In] ref object[] aQuery);\n\n\t\t[DispId (27)]\n\t\t[return: MarshalAs (UnmanagedType.Interface)]\n\t\tobject GetCollectionByQuery2 ([MarshalAs (UnmanagedType.BStr)] [In] string bstrCollectionName, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarQueryStrings);\n\n\t\t[DispId (57)]\n\t\t[return: MarshalAs (UnmanagedType.I4)]\n\t\tint GetComponentVersionCount ([MarshalAs (UnmanagedType.BStr)] [In] string bstrCLSIDOrProgID);\n\n\t\t[DispId (26)]\n\t\tvoid GetEventClassesForIID ([In] string bstrIID, [MarshalAs (UnmanagedType.SafeArray)] [In] [Out] ref object[] varCLSIDS, [MarshalAs (UnmanagedType.SafeArray)] [In] [Out] ref object[] varProgIDs, [MarshalAs (UnmanagedType.SafeArray)] [In] [Out] ref object[] varDescriptions);\n\n\t\t[DispId (17)]\n\t\tvoid GetMultipleComponentsInfo ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName, [In] object varFileNames, [MarshalAs (UnmanagedType.SafeArray)] out object[] varCLSIDS, [MarshalAs (UnmanagedType.SafeArray)] out object[] varClassNames, [MarshalAs (UnmanagedType.SafeArray)] out object[] varFileFlags, [MarshalAs (UnmanagedType.SafeArray)] out object[] varComponentFlags);\n\n\t\t[DispId (38)]\n\t\t[return: MarshalAs (UnmanagedType.BStr)]\n\t\tstring GetPartitionID ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationIDOrName);\n\n\t\t[DispId (39)]\n\t\t[return: MarshalAs (UnmanagedType.BStr)]\n\t\tstring GetPartitionName ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationIDOrName);\n\n\t\t[DispId (43)]\n\t\t[return: MarshalAs (UnmanagedType.BStr)]\n\t\tstring GlobalPartitionID ();\n\n\t\t[DispId (6)]\n\t\tvoid ImportComponent ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrCLSIDOrProgId);\n\n\t\t[DispId (52)]\n\t\tvoid ImportComponents ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationIDOrName, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarCLSIDOrProgID, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarComponentType);\n\n\t\t[DispId (50)]\n\t\tvoid ImportUnconfiguredComponents ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationIDOrName, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarCLSIDOrProgID, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarComponentType);\n\n\t\t[DispId (10)]\n\t\tvoid InstallApplication ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationFile, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDestinationDirectory, [In] int lOptions, [MarshalAs (UnmanagedType.BStr)] [In] string bstrUserId, [MarshalAs (UnmanagedType.BStr)] [In] string bstrPassword, [MarshalAs (UnmanagedType.BStr)] [In] string bstrRSN);\n\n\t\t[DispId (7)]\n\t\tvoid InstallComponent ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDLL, [MarshalAs (UnmanagedType.BStr)] [In] string bstrTLB, [MarshalAs (UnmanagedType.BStr)] [In] string bstrPSDLL);\n\n\t\t[DispId (25)]\n\t\tvoid InstallEventClass ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDLL, [MarshalAs (UnmanagedType.BStr)] [In] string bstrTLB, [MarshalAs (UnmanagedType.BStr)] [In] string bstrPSDLL);\n\n\t\t[DispId (16)]\n\t\tvoid InstallMultipleComponents ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName, [MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] [In] ref object[] fileNames, [MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] [In] ref object[] CLSIDS);\n\n\t\t[DispId (24)]\n\t\tvoid InstallMultipleEventClasses ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName, [MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] [In] ref object[] fileNames, [MarshalAs (UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] [In] ref object[] CLSIDS);\n\n\t\t[DispId (55)]\n\t\tvoid InstallPartition ([MarshalAs (UnmanagedType.BStr)] [In] string bstrFileName, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDestDirectory, [MarshalAs (UnmanagedType.I4)] [In] int lOptions, [MarshalAs (UnmanagedType.BStr)] [In] string bstrUserID, [MarshalAs (UnmanagedType.BStr)] [In] string bstrPassword, [MarshalAs (UnmanagedType.BStr)] [In] string bstrRSN);\n\n\t\t[DispId (53)]\n\t\t[return: MarshalAs (UnmanagedType.VariantBool)]\n\t\tbool Is64BitCatalogServer ();\n\n\t\t[DispId (35)]\n\t\t[return: MarshalAs (UnmanagedType.VariantBool)]\n\t\tbool IsApplicationInstanceDumpSupported ();\n\n\t\t[DispId (49)]\n\t\t[return: MarshalAs (UnmanagedType.Interface)]\n\t\tobject IsSafeToDelete ([MarshalAs (UnmanagedType.BStr)] [In] string bstrDllName);\n\n\t\t[DispId (3)]\n\t\tint MajorVersion ();\n\n\t\t[DispId (4)]\n\t\tint MinorVersion ();\n\n\t\t[DispId (47)]\n\t\tvoid MoveComponents ([MarshalAs (UnmanagedType.BStr)] [In] string bstrSourceApplicationIDOrName, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarCLSIDOrProgID, [MarshalAs (UnmanagedType.BStr)] [In] string bstrDestinationApplicationIDOrName);\n\n\t\t[DispId (30)]\n\t\tvoid PauseApplicationInstances ([MarshalAs (UnmanagedType.LPStruct)] [In] object pVarApplicationInstanceID);\n\n\t\t[DispId (51)]\n\t\tvoid PromoteUnconfiguredComponents ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationIDOrName, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarCLSIDOrProgID, [MarshalAs (UnmanagedType.LPStruct)] [In] object pVarComponentType);\n\n\t\t[DispId (21)]\n\t\tvoid QueryApplicationFile ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationFile, [MarshalAs (UnmanagedType.BStr)] out string bstrApplicationName, [MarshalAs (UnmanagedType.BStr)] out string bstrApplicationDescription, [MarshalAs (UnmanagedType.VariantBool)] out bool bHasUsers, [MarshalAs (UnmanagedType.VariantBool)] out bool bIsProxy, [MarshalAs (UnmanagedType.SafeArray)] out object[] varFileNames);\n\n\t\t[DispId (56)]\n\t\t[return: MarshalAs (UnmanagedType.IDispatch)]\n\t\tobject QueryApplicationFile2 ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplicationFile);\n\n\t\t[DispId (32)]\n\t\tvoid RecycleApplicationInstances ([MarshalAs (UnmanagedType.LPStruct)] [In] object pVarApplicationInstanceID, [MarshalAs (UnmanagedType.I4)] [In] int lReasonCode);\n\n\t\t[DispId (18)]\n\t\tvoid RefreshComponents ();\n\n\t\t[DispId (12)]\n\t\tvoid RefreshRouter ();\n\n\t\t[DispId (14)]\n\t\tvoid Reserved1 ();\n\n\t\t[DispId (15)]\n\t\tvoid Reserved2 ();\n\n\t\t[DispId (20)]\n\t\tvoid RestoreREGDB ([MarshalAs (UnmanagedType.BStr)] [In] string bstrBackupFilePath);\n\n\t\t[DispId (31)]\n\t\tvoid ResumeApplicationInstances ([MarshalAs (UnmanagedType.LPStruct)] [In] object pVarApplicationInstanceID);\n\n\t\t[DispId (23)]\n\t\tint ServiceCheck ([In] int lService);\n\n\t\t[DispId (8)]\n\t\tvoid ShutdownApplication ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName);\n\n\t\t[DispId (29)]\n\t\tvoid ShutdownApplicationInstances ([MarshalAs (UnmanagedType.LPStruct)] [In] object pVarApplicationInstanceID);\n\n\t\t[DispId (22)]\n\t\tvoid StartApplication ([MarshalAs (UnmanagedType.BStr)] [In] string bstrApplIdOrName);\n\n\t\t[DispId (13)]\n\t\tvoid StartRouter ();\n\n\t\t[DispId (11)]\n\t\tvoid StopRouter ();\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\nusing ICSharpCode.NRefactory.CSharp.Resolver;\nusing ICSharpCode.NRefactory.Semantics;\nusing ICSharpCode.NRefactory.TypeSystem.Implementation;\nusing ICSharpCode.NRefactory.TypeSystem.TestCase;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.TypeSystem\n{\n\t/// <summary>\n\t/// Base class for the type system tests.\n\t/// Test fixtures for specific APIs (Cecil, C# Parser) derive from this class.\n\t/// </summary>\n\tpublic abstract class TypeSystemTests\n\t{\n\t\tprotected ICompilation compilation;\n\t\t\n\t\tprotected ITypeDefinition GetTypeDefinition(Type type)\n\t\t{\n\t\t\treturn compilation.FindType(type).GetDefinition();\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimplePublicClassTest()\n\t\t{\n\t\t\tITypeDefinition c = GetTypeDefinition(typeof(SimplePublicClass));\n\t\t\tAssert.AreEqual(typeof(SimplePublicClass).Name, c.Name);\n\t\t\tAssert.AreEqual(typeof(SimplePublicClass).FullName, c.FullName);\n\t\t\tAssert.AreEqual(typeof(SimplePublicClass).Namespace, c.Namespace);\n\t\t\tAssert.AreEqual(typeof(SimplePublicClass).FullName, c.ReflectionName);\n\t\t\t\n\t\t\tAssert.AreEqual(Accessibility.Public, c.Accessibility);\n\t\t\tAssert.IsFalse(c.IsAbstract);\n\t\t\tAssert.IsFalse(c.IsSealed);\n\t\t\tAssert.IsFalse(c.IsStatic);\n\t\t\tAssert.IsFalse(c.IsShadowing);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SimplePublicClassMethodTest()\n\t\t{\n\t\t\tITypeDefinition c = GetTypeDefinition(typeof(SimplePublicClass));\n\t\t\t\n\t\t\tIMethod method = c.Methods.Single(m => m.Name == \"Method\");\n\t\t\tAssert.AreEqual(typeof(SimplePublicClass).FullName + \".Method\", method.FullName);\n\t\t\tAssert.AreSame(c, method.DeclaringType);\n\t\t\tAssert.AreEqual(Accessibility.Public, method.Accessibility);\n\t\t\tAssert.AreEqual(SymbolKind.Method, method.SymbolKind);\n\t\t\tAssert.IsFalse(method.IsVirtual);\n\t\t\tAssert.IsFalse(method.IsStatic);\n\t\t\tAssert.AreEqual(0, method.Parameters.Count);\n\t\t\tAssert.AreEqual(0, method.Attributes.Count);\n\t\t\tAssert.IsTrue(method.HasBody);\n\t\t\tAssert.IsNull(method.AccessorOwner);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DynamicType()\n\t\t{\n\t\t\tITypeDefinition testClass = GetTypeDefinition(typeof(DynamicTest));\n\t\t\tAssert.AreEqual(SpecialType.Dynamic, testClass.Properties.Single().ReturnType);\n\t\t\tAssert.AreEqual(0, testClass.Properties.Single().Attributes.Count);\n\t\t}\n\t\t#if !__MonoCS__\n\n\t\t[Test]\n\t\tpublic void DynamicTypeInGenerics()\n\t\t{\n\t\t\tITypeDefinition testClass = GetTypeDefinition(typeof(DynamicTest));\n\t\t\t\n\t\t\tIMethod m1 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics1\");\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.List`1[[dynamic]]\", m1.ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(\"System.Action`3[[System.Object],[dynamic[]],[System.Object]]\", m1.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tIMethod m2 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics2\");\n\t\t\tAssert.AreEqual(\"System.Action`3[[System.Object],[dynamic],[System.Object]]\", m2.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tIMethod m3 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics3\");\n\t\t\tAssert.AreEqual(\"System.Action`3[[System.Int32],[dynamic],[System.Object]]\", m3.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tIMethod m4 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics4\");\n\t\t\tAssert.AreEqual(\"System.Action`3[[System.Int32[]],[dynamic],[System.Object]]\", m4.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tIMethod m5 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics5\");\n\t\t\tAssert.AreEqual(\"System.Action`3[[System.Int32*[]],[dynamic],[System.Object]]\", m5.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tIMethod m6 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics6\");\n\t\t\tAssert.AreEqual(\"System.Action`3[[System.Object],[dynamic],[System.Object]]&\", m6.Parameters[0].Type.ReflectionName);\n\t\t\t\n\t\t\tIMethod m7 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics7\");\n\t\t\tAssert.AreEqual(\"System.Action`3[[System.Int32[][,]],[dynamic],[System.Object]]\", m7.Parameters[0].Type.ReflectionName);\n\t\t}\n\t\t#endif\n\n\t\t[Test]\n\t\tpublic void DynamicParameterHasNoAttributes()\n\t\t{\n\t\t\tITypeDefinition testClass = GetTypeDefinition(typeof(DynamicTest));\n\t\t\tIMethod m1 = testClass.Methods.Single(me => me.Name == \"DynamicGenerics1\");\n\t\t\tAssert.AreEqual(0, m1.Parameters[0].Attributes.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AssemblyAttribute()\n\t\t{\n\t\t\tvar attributes = compilation.MainAssembly.AssemblyAttributes;\n\t\t\tvar typeTest = attributes.Single(a => a.AttributeType.FullName == typeof(TypeTestAttribute).FullName);\n\t\t\tAssert.AreEqual(3, typeTest.PositionalArguments.Count);\n\t\t\t// first argument is (int)42\n\t\t\tAssert.AreEqual(42, (int)typeTest.PositionalArguments[0].ConstantValue);\n\t\t\t// second argument is typeof(System.Action<>)\n\t\t\tTypeOfResolveResult rt = (TypeOfResolveResult)typeTest.PositionalArguments[1];\n\t\t\tAssert.IsFalse(rt.ReferencedType is ParameterizedType); // rt must not be constructed - it's just an unbound type\n\t\t\tAssert.AreEqual(\"System.Action\", rt.ReferencedType.FullName);\n\t\t\tAssert.AreEqual(1, rt.ReferencedType.TypeParameterCount);\n\t\t\t// third argument is typeof(IDictionary<string, IList<TestAttribute>>)\n\t\t\trt = (TypeOfResolveResult)typeTest.PositionalArguments[2];\n\t\t\tParameterizedType crt = (ParameterizedType)rt.ReferencedType;\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IDictionary\", crt.FullName);\n\t\t\tAssert.AreEqual(\"System.String\", crt.TypeArguments[0].FullName);\n\t\t\t// we know the name for TestAttribute, but not necessarily the namespace, as NUnit is not in the compilation\n\t\t\tAssert.AreEqual(\"System.Collections.Generic.IList\", crt.TypeArguments[1].FullName);\n\t\t\tvar testAttributeType = ((ParameterizedType)crt.TypeArguments[1]).TypeArguments.Single();\n\t\t\tAssert.AreEqual(\"TestAttribute\", testAttributeType.Name);\n\t\t\tAssert.AreEqual(TypeKind.Unknown, testAttributeType.Kind);\n\t\t\t// (more accurately, we know the namespace and reflection name if the type was loaded by cecil,\n\t\t\t// but not if we parsed it from C#)\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TypeForwardedTo_Attribute()\n\t\t{\n\t\t\tvar attributes = compilation.MainAssembly.AssemblyAttributes;\n\t\t\tvar forwardAttribute = attributes.Single(a => a.AttributeType.FullName == typeof(TypeForwardedToAttribute).FullName);\n\t\t\tAssert.AreEqual(1, forwardAttribute.PositionalArguments.Count);\n\t\t\tTypeOfResolveResult rt = (TypeOfResolveResult)forwardAttribute.PositionalArguments[0];\n\t\t\tAssert.AreEqual(\"System.Func`2\", rt.ReferencedType.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestClassTypeParameters()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(GenericClass<,>));\n\t\t\tAssert.AreEqual(SymbolKind.TypeDefinition, testClass.TypeParameters[0].OwnerType);\n\t\t\tAssert.AreEqual(SymbolKind.TypeDefinition, testClass.TypeParameters[1].OwnerType);\n\t\t\tAssert.AreSame(testClass.TypeParameters[1], testClass.TypeParameters[0].DirectBaseTypes.First());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void TestMethod()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(GenericClass<,>));\n\t\t\t\n\t\t\tIMethod m = testClass.Methods.Single(me => me.Name == \"TestMethod\");\n\t\t\tAssert.AreEqual(\"K\", m.TypeParameters[0].Name);\n\t\t\tAssert.AreEqual(\"V\", m.TypeParameters[1].Name);\n\t\t\tAssert.AreEqual(SymbolKind.Method, m.TypeParameters[0].OwnerType);\n\t\t\tAssert.AreEqual(SymbolKind.Method, m.TypeParameters[1].OwnerType);\n\t\t\t\n\t\t\tAssert.AreEqual(\"System.IComparable`1[[``1]]\", m.TypeParameters[0].DirectBaseTypes.First().ReflectionName);\n\t\t\tAssert.AreSame(m.TypeParameters[0], m.TypeParameters[1].DirectBaseTypes.First());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetIndex()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(GenericClass<,>));\n\t\t\t\n\t\t\tIMethod m = testClass.Methods.Single(me => me.Name == \"GetIndex\");\n\t\t\tAssert.AreEqual(\"T\", m.TypeParameters[0].Name);\n\t\t\tAssert.AreEqual(SymbolKind.Method, m.TypeParameters[0].OwnerType);\n\t\t\tAssert.AreSame(m, m.TypeParameters[0].Owner);\n\t\t\t\n\t\t\tParameterizedType constraint = (ParameterizedType)m.TypeParameters[0].DirectBaseTypes.First();\n\t\t\tAssert.AreEqual(\"IEquatable\", constraint.Name);\n\t\t\tAssert.AreEqual(1, constraint.TypeParameterCount);\n\t\t\tAssert.AreEqual(1, constraint.TypeArguments.Count);\n\t\t\tAssert.AreSame(m.TypeParameters[0], constraint.TypeArguments[0]);\n\t\t\tAssert.AreSame(m.TypeParameters[0], m.Parameters[0].Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetIndexSpecializedTypeParameter()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(GenericClass<,>));\n\t\t\tvar methodDef = testClass.Methods.Single(me => me.Name == \"GetIndex\");\n\t\t\tvar m = methodDef.Specialize(new TypeParameterSubstitution(\n\t\t\t\tnew[] { compilation.FindType(KnownTypeCode.Int16), compilation.FindType(KnownTypeCode.Int32) },\n\t\t\t\tnull\n\t\t\t));\n\t\t\t\n\t\t\tAssert.AreEqual(\"T\", m.TypeParameters[0].Name);\n\t\t\tAssert.AreEqual(SymbolKind.Method, m.TypeParameters[0].OwnerType);\n\t\t\tAssert.AreSame(m, m.TypeParameters[0].Owner);\n\t\t\t\n\t\t\tParameterizedType constraint = (ParameterizedType)m.TypeParameters[0].DirectBaseTypes.First();\n\t\t\tAssert.AreEqual(\"IEquatable\", constraint.Name);\n\t\t\tAssert.AreEqual(1, constraint.TypeParameterCount);\n\t\t\tAssert.AreEqual(1, constraint.TypeArguments.Count);\n\t\t\tAssert.AreSame(m.TypeParameters[0], constraint.TypeArguments[0]);\n\t\t\tAssert.AreSame(m.TypeParameters[0], m.Parameters[0].Type);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetIndexDoubleSpecialization()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(GenericClass<,>));\n\t\t\t// GenericClass<A, B>.GetIndex<T>\n\t\t\tvar methodDef = testClass.Methods.Single(me => me.Name == \"GetIndex\");\n\t\t\t\n\t\t\t// GenericClass<B, A>.GetIndex<A>\n\t\t\tvar m1 = methodDef.Specialize(new TypeParameterSubstitution(\n\t\t\t\tnew[] { testClass.TypeParameters[1], testClass.TypeParameters[0] },\n\t\t\t\tnew[] { testClass.TypeParameters[0] }\n\t\t\t));\n\t\t\t// GenericClass<string, int>.GetIndex<int>\n\t\t\tvar m2 = m1.Specialize(new TypeParameterSubstitution(\n\t\t\t\tnew[] { compilation.FindType(KnownTypeCode.Int32), compilation.FindType(KnownTypeCode.String) },\n\t\t\t\tnull\n\t\t\t));\n\t\t\t\n\t\t\t// GenericClass<string, int>.GetIndex<int>\n\t\t\tvar m12 = methodDef.Specialize(new TypeParameterSubstitution(\n\t\t\t\tnew[] { compilation.FindType(KnownTypeCode.String), compilation.FindType(KnownTypeCode.Int32) },\n\t\t\t\tnew[] { compilation.FindType(KnownTypeCode.Int32) }\n\t\t\t));\n\t\t\tAssert.AreEqual(m12, m2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SpecializedMethod_AccessorOwner()\n\t\t{\n\t\t\t// NRefactory bug #143 - Accessor Owner throws null reference exception in some cases now\n\t\t\tvar method = compilation.FindType(typeof(GenericClass<string, object>)).GetMethods(m => m.Name == \"GetIndex\").Single();\n\t\t\tAssert.IsNull(method.AccessorOwner);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Specialized_GetIndex_ToMemberReference()\n\t\t{\n\t\t\tvar method = compilation.FindType(typeof(GenericClass<string, object>)).GetMethods(m => m.Name == \"GetIndex\").Single();\n\t\t\tAssert.AreSame(method.TypeParameters[0], method.Parameters[0].Type);\n\t\t\tAssert.AreSame(method, method.TypeParameters[0].Owner);\n\t\t\tAssert.IsInstanceOf<SpecializedMethod>(method);\n\t\t\tAssert.IsFalse(method.IsParameterized); // the method itself is not specialized\n\t\t\tAssert.AreEqual(method.TypeParameters, method.TypeArguments);\n\t\t\tvar methodReference = method.ToReference();\n\t\t\tvar resolvedMethod = methodReference.Resolve(compilation.TypeResolveContext);\n\t\t\tAssert.AreEqual(method, resolvedMethod);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Specialized_GetIndex_SpecializeWithIdentityHasNoEffect()\n\t\t{\n\t\t\tvar genericClass = compilation.FindType(typeof(GenericClass<string, object>));\n\t\t\tIType[] methodTypeArguments = { DummyTypeParameter.GetMethodTypeParameter(0) };\n\t\t\tvar method = genericClass.GetMethods(methodTypeArguments, m => m.Name == \"GetIndex\").Single();\n\t\t\t// GenericClass<string,object>.GetIndex<!!0>()\n\t\t\tAssert.AreSame(method, method.TypeParameters[0].Owner);\n\t\t\tAssert.AreNotEqual(method.TypeParameters[0], method.TypeArguments[0]);\n\t\t\tAssert.IsNull(((ITypeParameter)method.TypeArguments[0]).Owner);\n\t\t\t// Now apply identity substitution:\n\t\t\tvar method2 = method.Specialize(TypeParameterSubstitution.Identity);\n\t\t\tAssert.AreSame(method2, method2.TypeParameters[0].Owner);\n\t\t\tAssert.AreNotEqual(method2.TypeParameters[0], method2.TypeArguments[0]);\n\t\t\tAssert.IsNull(((ITypeParameter)method2.TypeArguments[0]).Owner);\n\t\t\t\n\t\t\tAssert.AreEqual(method, method2);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericEnum()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(GenericClass<,>.NestedEnum));\n\t\t\tAssert.AreEqual(2, testClass.TypeParameterCount);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FieldInGenericClassWithNestedEnumType()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(GenericClass<,>));\n\t\t\tvar enumClass = GetTypeDefinition(typeof(GenericClass<,>.NestedEnum));\n\t\t\tvar field = testClass.Fields.Single(f => f.Name == \"EnumField\");\n\t\t\tAssert.AreEqual(new ParameterizedType(enumClass, testClass.TypeParameters), field.ReturnType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericEnumMemberReturnType()\n\t\t{\n\t\t\tvar enumClass = GetTypeDefinition(typeof(GenericClass<,>.NestedEnum));\n\t\t\tvar field = enumClass.Fields.Single(f => f.Name == \"EnumMember\");\n\t\t\tAssert.AreEqual(new ParameterizedType(enumClass, enumClass.TypeParameters), field.ReturnType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyWithProtectedSetter()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(PropertyTest));\n\t\t\tIProperty p = testClass.Properties.Single(pr => pr.Name == \"PropertyWithProtectedSetter\");\n\t\t\tAssert.IsTrue(p.CanGet);\n\t\t\tAssert.IsTrue(p.CanSet);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Getter.Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Protected, p.Setter.Accessibility);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyWithPrivateSetter()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(PropertyTest));\n\t\t\tIProperty p = testClass.Properties.Single(pr => pr.Name == \"PropertyWithPrivateSetter\");\n\t\t\tAssert.IsTrue(p.CanGet);\n\t\t\tAssert.IsTrue(p.CanSet);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Getter.Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Private, p.Setter.Accessibility);\n\t\t\tAssert.IsTrue(p.Getter.HasBody);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PropertyWithPrivateGetter()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(PropertyTest));\n\t\t\tIProperty p = testClass.Properties.Single(pr => pr.Name == \"PropertyWithPrivateGetter\");\n\t\t\tAssert.IsTrue(p.CanGet);\n\t\t\tAssert.IsTrue(p.CanSet);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Private, p.Getter.Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Setter.Accessibility);\n\t\t\tAssert.IsTrue(p.Getter.HasBody);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyWithoutSetter()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(PropertyTest));\n\t\t\tIProperty p = testClass.Properties.Single(pr => pr.Name == \"PropertyWithoutSetter\");\n\t\t\tAssert.IsTrue(p.CanGet);\n\t\t\tAssert.IsFalse(p.CanSet);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Getter.Accessibility);\n\t\t\tAssert.IsNull(p.Setter);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void Indexer()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(PropertyTest));\n\t\t\tIProperty p = testClass.Properties.Single(pr => pr.IsIndexer);\n\t\t\tAssert.AreEqual(\"Item\", p.Name);\n\t\t\tAssert.AreEqual(new[] { \"index\" }, p.Parameters.Select(x => x.Name).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexerGetter()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(PropertyTest));\n\t\t\tIProperty p = testClass.Properties.Single(pr => pr.IsIndexer);\n\t\t\tAssert.IsTrue(p.CanGet);\n\t\t\tAssert.AreEqual(SymbolKind.Accessor, p.Getter.SymbolKind);\n\t\t\tAssert.AreEqual(\"get_Item\", p.Getter.Name);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Getter.Accessibility);\n\t\t\tAssert.AreEqual(new[] { \"index\" }, p.Getter.Parameters.Select(x => x.Name).ToArray());\n\t\t\tAssert.AreEqual(\"System.String\", p.Getter.ReturnType.ReflectionName);\n\t\t\tAssert.AreEqual(p, p.Getter.AccessorOwner);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexerSetter()\n\t\t{\n\t\t\tvar testClass = GetTypeDefinition(typeof(PropertyTest));\n\t\t\tIProperty p = testClass.Properties.Single(pr => pr.IsIndexer);\n\t\t\tAssert.IsTrue(p.CanSet);\n\t\t\tAssert.AreEqual(SymbolKind.Accessor, p.Setter.SymbolKind);\n\t\t\tAssert.AreEqual(\"set_Item\", p.Setter.Name);\n\t\t\tAssert.AreEqual(Accessibility.Public, p.Setter.Accessibility);\n\t\t\tAssert.AreEqual(new[] { \"index\", \"value\" }, p.Setter.Parameters.Select(x => x.Name).ToArray());\n\t\t\tAssert.AreEqual(TypeKind.Void, p.Setter.ReturnType.Kind);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericPropertyGetter()\n\t\t{\n\t\t\tvar type = compilation.FindType(typeof(GenericClass<string, object>));\n\t\t\tvar prop = type.GetProperties(p => p.Name == \"Property\").Single();\n\t\t\tAssert.AreEqual(\"System.String\", prop.Getter.ReturnType.ReflectionName);\n\t\t\tAssert.IsTrue(prop.Getter.IsAccessor);\n\t\t\tAssert.AreEqual(prop, prop.Getter.AccessorOwner);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumTest()\n\t\t{\n\t\t\tvar e = GetTypeDefinition(typeof(MyEnum));\n\t\t\tAssert.AreEqual(TypeKind.Enum, e.Kind);\n\t\t\tAssert.AreEqual(false, e.IsReferenceType);\n\t\t\tAssert.AreEqual(\"System.Int16\", e.EnumUnderlyingType.ReflectionName);\n\t\t\tAssert.AreEqual(new[] { \"System.Enum\" }, e.DirectBaseTypes.Select(t => t.ReflectionName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EnumFieldsTest()\n\t\t{\n\t\t\tvar e = GetTypeDefinition(typeof(MyEnum));\n\t\t\tIField[] fields = e.Fields.ToArray();\n\t\t\tAssert.AreEqual(5, fields.Length);\n\t\t\t\n\t\t\tforeach (IField f in fields) {\n\t\t\t\tAssert.IsTrue(f.IsStatic);\n\t\t\t\tAssert.IsTrue(f.IsConst);\n\t\t\t\tAssert.AreEqual(Accessibility.Public, f.Accessibility);\n\t\t\t\tAssert.AreSame(e, f.Type);\n\t\t\t\tAssert.AreEqual(typeof(short), f.ConstantValue.GetType());\n\t\t\t}\n\t\t\t\n\t\t\tAssert.AreEqual(\"First\", fields[0].Name);\n\t\t\tAssert.AreEqual(0, fields[0].ConstantValue);\n\t\t\t\n\t\t\tAssert.AreEqual(\"Second\", fields[1].Name);\n\t\t\tAssert.AreSame(e, fields[1].Type);\n\t\t\tAssert.AreEqual(1, fields[1].ConstantValue);\n\t\t\t\n\t\t\tAssert.AreEqual(\"Flag1\", fields[2].Name);\n\t\t\tAssert.AreEqual(0x10, fields[2].ConstantValue);\n\n\t\t\tAssert.AreEqual(\"Flag2\", fields[3].Name);\n\t\t\tAssert.AreEqual(0x20, fields[3].ConstantValue);\n\t\t\t\n\t\t\tAssert.AreEqual(\"CombinedFlags\", fields[4].Name);\n\t\t\tAssert.AreEqual(0x30, fields[4].ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GetNestedTypesFromBaseClassTest()\n\t\t{\n\t\t\tITypeDefinition d = GetTypeDefinition(typeof(Derived<,>));\n\t\t\t\n\t\t\tIType pBase = d.DirectBaseTypes.Single();\n\t\t\tAssert.AreEqual(typeof(Base<>).FullName + \"[[`1]]\", pBase.ReflectionName);\n\t\t\t// Base[`1].GetNestedTypes() = { Base`1+Nested`1[`1, unbound] }\n\t\t\tAssert.AreEqual(new[] { typeof(Base<>.Nested<>).FullName + \"[[`1],[]]\" },\n\t\t\t                pBase.GetNestedTypes().Select(n => n.ReflectionName).ToArray());\n\t\t\t\n\t\t\t// Derived.GetNestedTypes() = { Base`1+Nested`1[`1, unbound] }\n\t\t\tAssert.AreEqual(new[] { typeof(Base<>.Nested<>).FullName + \"[[`1],[]]\" },\n\t\t\t                d.GetNestedTypes().Select(n => n.ReflectionName).ToArray());\n\t\t\t// This is 'leaking' the type parameter from B as is usual when retrieving any members from an unbound type.\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParameterizedTypeGetNestedTypesFromBaseClassTest()\n\t\t{\n\t\t\t// Derived[string,int].GetNestedTypes() = { Base`1+Nested`1[int, unbound] }\n\t\t\tvar d = compilation.FindType(typeof(Derived<string, int>));\n\t\t\tAssert.AreEqual(new[] { typeof(Base<>.Nested<>).FullName + \"[[System.Int32],[]]\" },\n\t\t\t                d.GetNestedTypes().Select(n => n.ReflectionName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstraintsOnOverrideAreInherited()\n\t\t{\n\t\t\tITypeDefinition d = GetTypeDefinition(typeof(Derived<,>));\n\t\t\tITypeParameter tp = d.Methods.Single(m => m.Name == \"GenericMethodWithConstraints\").TypeParameters.Single();\n\t\t\tAssert.AreEqual(\"Y\", tp.Name);\n\t\t\tAssert.IsFalse(tp.HasValueTypeConstraint);\n\t\t\tAssert.IsFalse(tp.HasReferenceTypeConstraint);\n\t\t\tAssert.IsTrue(tp.HasDefaultConstructorConstraint);\n\t\t\tAssert.AreEqual(new string[] { \"System.Collections.Generic.IComparer`1[[`1]]\", \"System.Object\" },\n\t\t\t                tp.DirectBaseTypes.Select(t => t.ReflectionName).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefaultConstructorAddedToStruct()\n\t\t{\n\t\t\tvar ctors = compilation.FindType(typeof(MyStructWithCtor)).GetConstructors();\n\t\t\tAssert.AreEqual(2, ctors.Count());\n\t\t\tAssert.IsFalse(ctors.Any(c => c.IsStatic));\n\t\t\tAssert.IsTrue(ctors.All(c => c.ReturnType.Kind == TypeKind.Void));\n\t\t\tAssert.IsTrue(ctors.All(c => c.Accessibility == Accessibility.Public));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoDefaultConstructorAddedToClass()\n\t\t{\n\t\t\tvar ctors = compilation.FindType(typeof(MyClassWithCtor)).GetConstructors();\n\t\t\tAssert.AreEqual(Accessibility.Private, ctors.Single().Accessibility);\n\t\t\tAssert.AreEqual(1, ctors.Single().Parameters.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefaultConstructorOnAbstractClassIsProtected()\n\t\t{\n\t\t\tvar ctors = compilation.FindType(typeof(AbstractClass)).GetConstructors();\n\t\t\tAssert.AreEqual(0, ctors.Single().Parameters.Count);\n\t\t\tAssert.AreEqual(Accessibility.Protected, ctors.Single().Accessibility);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SerializableAttribute()\n\t\t{\n\t\t\tIAttribute attr = GetTypeDefinition(typeof(NonCustomAttributes)).Attributes.Single();\n\t\t\tAssert.AreEqual(\"System.SerializableAttribute\", attr.AttributeType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NonSerializedAttribute()\n\t\t{\n\t\t\tIField field = GetTypeDefinition(typeof(NonCustomAttributes)).Fields.Single(f => f.Name == \"NonSerializedField\");\n\t\t\tAssert.AreEqual(\"System.NonSerializedAttribute\", field.Attributes.Single().AttributeType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitStructLayoutAttribute()\n\t\t{\n\t\t\tIAttribute attr = GetTypeDefinition(typeof(ExplicitFieldLayoutStruct)).Attributes.Single();\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.StructLayoutAttribute\", attr.AttributeType.FullName);\n\t\t\tResolveResult arg1 = attr.PositionalArguments.Single();\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.LayoutKind\", arg1.Type.FullName);\n\t\t\tAssert.AreEqual((int)LayoutKind.Explicit, arg1.ConstantValue);\n\t\t\t\n\t\t\tvar arg2 = attr.NamedArguments[0];\n\t\t\tAssert.AreEqual(\"CharSet\", arg2.Key.Name);\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.CharSet\", arg2.Value.Type.FullName);\n\t\t\tAssert.AreEqual((int)CharSet.Unicode, arg2.Value.ConstantValue);\n\t\t\t\n\t\t\tvar arg3 = attr.NamedArguments[1];\n\t\t\tAssert.AreEqual(\"Pack\", arg3.Key.Name);\n\t\t\tAssert.AreEqual(\"System.Int32\", arg3.Value.Type.FullName);\n\t\t\tAssert.AreEqual(8, arg3.Value.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FieldOffsetAttribute()\n\t\t{\n\t\t\tIField field = GetTypeDefinition(typeof(ExplicitFieldLayoutStruct)).Fields.Single(f => f.Name == \"Field0\");\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.FieldOffsetAttribute\", field.Attributes.Single().AttributeType.FullName);\n\t\t\tResolveResult arg = field.Attributes.Single().PositionalArguments.Single();\n\t\t\tAssert.AreEqual(\"System.Int32\", arg.Type.FullName);\n\t\t\tAssert.AreEqual(0, arg.ConstantValue);\n\t\t\t\n\t\t\tfield = GetTypeDefinition(typeof(ExplicitFieldLayoutStruct)).Fields.Single(f => f.Name == \"Field100\");\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.FieldOffsetAttribute\", field.Attributes.Single().AttributeType.FullName);\n\t\t\targ = field.Attributes.Single().PositionalArguments.Single();\n\t\t\tAssert.AreEqual(\"System.Int32\", arg.Type.FullName);\n\t\t\tAssert.AreEqual(100, arg.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DllImportAttribute()\n\t\t{\n\t\t\tIMethod method = GetTypeDefinition(typeof(NonCustomAttributes)).Methods.Single(m => m.Name == \"DllMethod\");\n\t\t\tIAttribute dllImport = method.Attributes.Single();\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.DllImportAttribute\", dllImport.AttributeType.FullName);\n\t\t\tAssert.AreEqual(\"unmanaged.dll\", dllImport.PositionalArguments[0].ConstantValue);\n\t\t\tAssert.AreEqual((int)CharSet.Unicode, dllImport.NamedArguments.Single().Value.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InOutParametersOnRefMethod()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(NonCustomAttributes)).Methods.Single(m => m.Name == \"DllMethod\").Parameters.Single();\n\t\t\tAssert.IsTrue(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.AreEqual(2, p.Attributes.Count);\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.InAttribute\", p.Attributes[0].AttributeType.FullName);\n\t\t\tAssert.AreEqual(\"System.Runtime.InteropServices.OutAttribute\", p.Attributes[1].AttributeType.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MarshalAsAttributeOnMethod()\n\t\t{\n\t\t\tIMethod method = GetTypeDefinition(typeof(NonCustomAttributes)).Methods.Single(m => m.Name == \"DllMethod\");\n\t\t\tIAttribute marshalAs = method.ReturnTypeAttributes.Single();\n\t\t\tAssert.AreEqual((int)UnmanagedType.Bool, marshalAs.PositionalArguments.Single().ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithOutParameter()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithOutParameter\").Parameters.Single();\n\t\t\tAssert.IsFalse(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsTrue(p.IsOut);\n\t\t\tAssert.AreEqual(0, p.Attributes.Count);\n\t\t\tAssert.IsTrue(p.Type.Kind == TypeKind.ByReference);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithParamsArray()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithParamsArray\").Parameters.Single();\n\t\t\tAssert.IsFalse(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.IsTrue(p.IsParams);\n\t\t\tAssert.AreEqual(0, p.Attributes.Count);\n\t\t\tAssert.IsTrue(p.Type.Kind == TypeKind.Array);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithOptionalParameter()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithOptionalParameter\").Parameters.Single();\n\t\t\tAssert.IsTrue(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.IsFalse(p.IsParams);\n\t\t\tAssert.AreEqual(0, p.Attributes.Count);\n\t\t\tAssert.AreEqual(4, p.ConstantValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodWithExplicitOptionalParameter()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithExplicitOptionalParameter\").Parameters.Single();\n\t\t\tAssert.IsTrue(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.IsFalse(p.IsParams);\n\t\t\t// explicit optional parameter appears in type system if it's read from C#, but not when read from IL\n\t\t\t//Assert.AreEqual(1, p.Attributes.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithEnumOptionalParameter()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithEnumOptionalParameter\").Parameters.Single();\n\t\t\tAssert.IsTrue(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.IsFalse(p.IsParams);\n\t\t\tAssert.AreEqual(0, p.Attributes.Count);\n\t\t\tAssert.AreEqual((int)StringComparison.OrdinalIgnoreCase, p.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithOptionalNullableParameter()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithOptionalNullableParameter\").Parameters.Single();\n\t\t\tAssert.IsTrue(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.IsFalse(p.IsParams);\n\t\t\tAssert.AreEqual(0, p.Attributes.Count);\n\t\t\tAssert.IsNull(p.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithOptionalLongParameter()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithOptionalLongParameter\").Parameters.Single();\n\t\t\tAssert.IsTrue(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.IsFalse(p.IsParams);\n\t\t\tAssert.AreEqual(1L, p.ConstantValue);\n\t\t\tAssert.AreEqual(typeof(long), p.ConstantValue.GetType());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MethodWithOptionalNullableLongParameter()\n\t\t{\n\t\t\tIParameter p = GetTypeDefinition(typeof(ParameterTests)).Methods.Single(m => m.Name == \"MethodWithOptionalNullableLongParameter\").Parameters.Single();\n\t\t\tAssert.IsTrue(p.IsOptional);\n\t\t\tAssert.IsFalse(p.IsRef);\n\t\t\tAssert.IsFalse(p.IsOut);\n\t\t\tAssert.IsFalse(p.IsParams);\n\t\t\tAssert.AreEqual(1L, p.ConstantValue);\n\t\t\tAssert.AreEqual(typeof(long), p.ConstantValue.GetType());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericDelegate_Variance()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(GenericDelegate<,>));\n\t\t\tAssert.AreEqual(VarianceModifier.Contravariant, type.TypeParameters[0].Variance);\n\t\t\tAssert.AreEqual(VarianceModifier.Covariant, type.TypeParameters[1].Variance);\n\t\t\t\n\t\t\tAssert.AreSame(type.TypeParameters[1], type.TypeParameters[0].DirectBaseTypes.FirstOrDefault());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericDelegate_ReferenceTypeConstraints()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(GenericDelegate<,>));\n\t\t\tAssert.IsFalse(type.TypeParameters[0].HasReferenceTypeConstraint);\n\t\t\tAssert.IsTrue(type.TypeParameters[1].HasReferenceTypeConstraint);\n\t\t\t\n\t\t\tAssert.IsNull(type.TypeParameters[0].IsReferenceType);\n\t\t\tAssert.AreEqual(true, type.TypeParameters[1].IsReferenceType);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void GenericDelegate_GetInvokeMethod()\n\t\t{\n\t\t\tIType type = compilation.FindType(typeof(GenericDelegate<string, object>));\n\t\t\tIMethod m = type.GetDelegateInvokeMethod();\n\t\t\tAssert.AreEqual(\"Invoke\", m.Name);\n\t\t\tAssert.AreEqual(\"System.Object\", m.ReturnType.FullName);\n\t\t\tAssert.AreEqual(\"System.String\", m.Parameters[0].Type.FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ComInterfaceTest()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(IAssemblyEnum));\n\t\t\t// [ComImport]\n\t\t\tAssert.AreEqual(1, type.Attributes.Count(a => a.AttributeType.FullName == typeof(ComImportAttribute).FullName));\n\t\t\t\n\t\t\tIMethod m = type.Methods.Single();\n\t\t\tAssert.AreEqual(\"GetNextAssembly\", m.Name);\n\t\t\tAssert.AreEqual(Accessibility.Public, m.Accessibility);\n\t\t\tAssert.IsTrue(m.IsAbstract);\n\t\t\tAssert.IsFalse(m.IsVirtual);\n\t\t\tAssert.IsFalse(m.IsSealed);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerClassInGenericClassIsReferencedUsingParameterizedType()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(OuterGeneric<>));\n\t\t\tIField field1 = type.Fields.Single(f => f.Name == \"Field1\");\n\t\t\tIField field2 = type.Fields.Single(f => f.Name == \"Field2\");\n\t\t\tIField field3 = type.Fields.Single(f => f.Name == \"Field3\");\n\t\t\t\n\t\t\t// types must be self-parameterized\n\t\t\tAssert.AreEqual(\"ICSharpCode.NRefactory.TypeSystem.TestCase.OuterGeneric`1+Inner[[`0]]\", field1.Type.ReflectionName);\n\t\t\tAssert.AreEqual(\"ICSharpCode.NRefactory.TypeSystem.TestCase.OuterGeneric`1+Inner[[`0]]\", field2.Type.ReflectionName);\n\t\t\tAssert.AreEqual(\"ICSharpCode.NRefactory.TypeSystem.TestCase.OuterGeneric`1+Inner[[ICSharpCode.NRefactory.TypeSystem.TestCase.OuterGeneric`1+Inner[[`0]]]]\", field3.Type.ReflectionName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FlagsOnInterfaceMembersAreCorrect() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(IInterfaceWithProperty));\n\t\t\tvar p = type.Properties.Single();\n\t\t\tAssert.AreEqual(false, p.IsIndexer);\n\t\t\tAssert.AreEqual(true, p.IsAbstract);\n\t\t\tAssert.AreEqual(true, p.IsOverridable);\n\t\t\tAssert.AreEqual(false, p.IsOverride);\n\t\t\tAssert.AreEqual(true, p.IsPublic);\n\t\t\tAssert.AreEqual(true, p.Getter.IsAbstract);\n\t\t\tAssert.AreEqual(true, p.Getter.IsOverridable);\n\t\t\tAssert.AreEqual(false, p.Getter.IsOverride);\n\t\t\tAssert.AreEqual(true, p.Getter.IsPublic);\n\t\t\tAssert.AreEqual(false, p.Getter.HasBody);\n\t\t\tAssert.AreEqual(true, p.Setter.IsAbstract);\n\t\t\tAssert.AreEqual(true, p.Setter.IsOverridable);\n\t\t\tAssert.AreEqual(false, p.Setter.IsOverride);\n\t\t\tAssert.AreEqual(true, p.Setter.IsPublic);\n\t\t\tAssert.AreEqual(false, p.Setter.HasBody);\n\n\t\t\ttype = GetTypeDefinition(typeof(IInterfaceWithIndexers));\n\t\t\tp = type.Properties.Single(x => x.Parameters.Count == 2);\n\t\t\tAssert.AreEqual(true, p.IsIndexer);\n\t\t\tAssert.AreEqual(true, p.IsAbstract);\n\t\t\tAssert.AreEqual(true, p.IsOverridable);\n\t\t\tAssert.AreEqual(false, p.IsOverride);\n\t\t\tAssert.AreEqual(true, p.IsPublic);\n\t\t\tAssert.AreEqual(true, p.Getter.IsAbstract);\n\t\t\tAssert.AreEqual(true, p.Getter.IsOverridable);\n\t\t\tAssert.AreEqual(false, p.Getter.IsOverride);\n\t\t\tAssert.AreEqual(true, p.Getter.IsPublic);\n\t\t\tAssert.AreEqual(true, p.Setter.IsAbstract);\n\t\t\tAssert.AreEqual(true, p.Setter.IsOverridable);\n\t\t\tAssert.AreEqual(false, p.Setter.IsOverride);\n\t\t\tAssert.AreEqual(true, p.Setter.IsPublic);\n\n\t\t\ttype = GetTypeDefinition(typeof(IHasEvent));\n\t\t\tvar e = type.Events.Single();\n\t\t\tAssert.AreEqual(true, e.IsAbstract);\n\t\t\tAssert.AreEqual(true, e.IsOverridable);\n\t\t\tAssert.AreEqual(false, e.IsOverride);\n\t\t\tAssert.AreEqual(true, e.IsPublic);\n\t\t\tAssert.AreEqual(true, e.AddAccessor.IsAbstract);\n\t\t\tAssert.AreEqual(true, e.AddAccessor.IsOverridable);\n\t\t\tAssert.AreEqual(false, e.AddAccessor.IsOverride);\n\t\t\tAssert.AreEqual(true, e.AddAccessor.IsPublic);\n\t\t\tAssert.AreEqual(true, e.RemoveAccessor.IsAbstract);\n\t\t\tAssert.AreEqual(true, e.RemoveAccessor.IsOverridable);\n\t\t\tAssert.AreEqual(false, e.RemoveAccessor.IsOverride);\n\t\t\tAssert.AreEqual(true, e.RemoveAccessor.IsPublic);\n\n\t\t\ttype = GetTypeDefinition(typeof(IDisposable));\n\t\t\tvar m = type.Methods.Single();\n\t\t\tAssert.AreEqual(true, m.IsAbstract);\n\t\t\tAssert.AreEqual(true, m.IsOverridable);\n\t\t\tAssert.AreEqual(false, m.IsOverride);\n\t\t\tAssert.AreEqual(true, m.IsPublic);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerClassInGenericClass_TypeParameterOwner()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(OuterGeneric<>.Inner));\n\t\t\tAssert.AreSame(type.DeclaringTypeDefinition.TypeParameters[0], type.TypeParameters[0]);\n\t\t\tAssert.AreSame(type.DeclaringTypeDefinition, type.TypeParameters[0].Owner);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerClassInGenericClass_ReferencesTheOuterClass_Field()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(OuterGeneric<>.Inner));\n\t\t\tIField f = type.Fields.Single();\n\t\t\tAssert.AreEqual(\"ICSharpCode.NRefactory.TypeSystem.TestCase.OuterGeneric`1[[`0]]\", f.Type.ReflectionName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InnerClassInGenericClass_ReferencesTheOuterClass_Parameter()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(OuterGeneric<>.Inner));\n\t\t\tIParameter p = type.Methods.Single(m => m.IsConstructor).Parameters.Single();\n\t\t\tAssert.AreEqual(\"ICSharpCode.NRefactory.TypeSystem.TestCase.OuterGeneric`1[[`0]]\", p.Type.ReflectionName);\n\t\t}\n\t\t\n\t\tResolveResult GetParamsAttributeArgument(int index)\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ParamsAttribute));\n\t\t\tvar arr = (ArrayCreateResolveResult)type.Attributes.Single().PositionalArguments.Single();\n\t\t\tAssert.AreEqual(5, arr.InitializerElements.Count);\n\t\t\tAssert.AreEqual(1, arr.SizeArguments.Count);\n\t\t\tAssert.AreEqual(5, arr.SizeArguments[0].ConstantValue);\n\t\t\treturn arr.InitializerElements[index];\n\t\t}\n\t\t\n\t\tResolveResult Unbox(ResolveResult resolveResult)\n\t\t{\n\t\t\tConversionResolveResult crr = (ConversionResolveResult)resolveResult;\n\t\t\tAssert.AreEqual(TypeKind.Class, crr.Type.Kind);\n\t\t\tAssert.AreEqual(\"System.Object\", crr.Type.FullName);\n\t\t\tAssert.AreEqual(Conversion.BoxingConversion, crr.Conversion);\n\t\t\treturn crr.Input;\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsAttribute_Integer()\n\t\t{\n\t\t\tResolveResult rr = Unbox(GetParamsAttributeArgument(0));\n\t\t\tAssert.AreEqual(\"System.Int32\", rr.Type.FullName);\n\t\t\tAssert.AreEqual(1, rr.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsAttribute_Enum()\n\t\t{\n\t\t\tResolveResult rr = Unbox(GetParamsAttributeArgument(1));\n\t\t\tAssert.AreEqual(\"System.StringComparison\", rr.Type.FullName);\n\t\t\tAssert.AreEqual((int)StringComparison.CurrentCulture, rr.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsAttribute_NullReference()\n\t\t{\n\t\t\tResolveResult rr = GetParamsAttributeArgument(2);\n\t\t\tAssert.AreEqual(\"System.Object\", rr.Type.FullName);\n\t\t\tAssert.IsTrue(rr.IsCompileTimeConstant);\n\t\t\tAssert.IsNull(rr.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsAttribute_Double()\n\t\t{\n\t\t\tResolveResult rr = Unbox(GetParamsAttributeArgument(3));\n\t\t\tAssert.AreEqual(\"System.Double\", rr.Type.FullName);\n\t\t\tAssert.AreEqual(4.0, rr.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsAttribute_String()\n\t\t{\n\t\t\tConversionResolveResult rr = (ConversionResolveResult)GetParamsAttributeArgument(4);\n\t\t\tAssert.AreEqual(\"System.Object\", rr.Type.FullName);\n\t\t\tAssert.AreEqual(\"System.String\", rr.Input.Type.FullName);\n\t\t\tAssert.AreEqual(\"Test\", rr.Input.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsAttribute_Property()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ParamsAttribute));\n\t\t\tIProperty prop = type.Properties.Single(p => p.Name == \"Property\");\n\t\t\tvar attr = prop.Attributes.Single();\n\t\t\tAssert.AreEqual(type, attr.AttributeType);\n\t\t\t\n\t\t\tvar normalArguments = ((ArrayCreateResolveResult)attr.PositionalArguments.Single()).InitializerElements;\n\t\t\tAssert.AreEqual(0, normalArguments.Count);\n\t\t\t\n\t\t\tvar namedArg = attr.NamedArguments.Single();\n\t\t\tAssert.AreEqual(prop, namedArg.Key);\n\t\t\tvar arrayElements = ((ArrayCreateResolveResult)namedArg.Value).InitializerElements;\n\t\t\tAssert.AreEqual(2, arrayElements.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ParamsAttribute_Getter_ReturnType()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ParamsAttribute));\n\t\t\tIProperty prop = type.Properties.Single(p => p.Name == \"Property\");\n\t\t\tAssert.AreEqual(0, prop.Getter.Attributes.Count);\n\t\t\tAssert.AreEqual(1, prop.Getter.ReturnTypeAttributes.Count);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoubleAttribute_ImplicitNumericConversion()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(DoubleAttribute));\n\t\t\tvar arg = type.Attributes.Single().PositionalArguments.ElementAt(0);\n\t\t\tAssert.AreEqual(\"System.Double\", arg.Type.ReflectionName);\n\t\t\tAssert.AreEqual(1.0, arg.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ImplicitImplementationOfUnifiedMethods()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ImplementationOfUnifiedMethods));\n\t\t\tIMethod test = type.Methods.Single(m => m.Name == \"Test\");\n\t\t\tAssert.AreEqual(2, test.ImplementedInterfaceMembers.Count);\n\t\t\tAssert.AreEqual(\"Int32\", ((IMethod)test.ImplementedInterfaceMembers[0]).Parameters.Single().Type.Name);\n\t\t\tAssert.AreEqual(\"Int32\", ((IMethod)test.ImplementedInterfaceMembers[1]).Parameters.Single().Type.Name);\n\t\t\tAssert.AreEqual(\"T\", ((IMethod)test.ImplementedInterfaceMembers[0].MemberDefinition).Parameters.Single().Type.Name);\n\t\t\tAssert.AreEqual(\"S\", ((IMethod)test.ImplementedInterfaceMembers[1].MemberDefinition).Parameters.Single().Type.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticityOfEventAccessors()\n\t\t{\n\t\t\t// https://github.com/icsharpcode/NRefactory/issues/20\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassWithStaticAndNonStaticMembers));\n\t\t\tvar evt1 = type.Events.Single(e => e.Name == \"Event1\");\n\t\t\tAssert.IsTrue(evt1.IsStatic);\n\t\t\tAssert.IsTrue(evt1.AddAccessor.IsStatic);\n\t\t\tAssert.IsTrue(evt1.RemoveAccessor.IsStatic);\n\n\t\t\tvar evt2 = type.Events.Single(e => e.Name == \"Event2\");\n\t\t\tAssert.IsFalse(evt2.IsStatic);\n\t\t\tAssert.IsFalse(evt2.AddAccessor.IsStatic);\n\t\t\tAssert.IsFalse(evt2.RemoveAccessor.IsStatic);\n\n\t\t\tvar evt3 = type.Events.Single(e => e.Name == \"Event3\");\n\t\t\tAssert.IsTrue(evt3.IsStatic);\n\t\t\tAssert.IsTrue(evt3.AddAccessor.IsStatic);\n\t\t\tAssert.IsTrue(evt3.RemoveAccessor.IsStatic);\n\n\t\t\tvar evt4 = type.Events.Single(e => e.Name == \"Event4\");\n\t\t\tAssert.IsFalse(evt4.IsStatic);\n\t\t\tAssert.IsFalse(evt4.AddAccessor.IsStatic);\n\t\t\tAssert.IsFalse(evt4.RemoveAccessor.IsStatic);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticityOfPropertyAccessors()\n\t\t{\n\t\t\t// https://github.com/icsharpcode/NRefactory/issues/20\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassWithStaticAndNonStaticMembers));\n\t\t\tvar prop1 = type.Properties.Single(e => e.Name == \"Prop1\");\n\t\t\tAssert.IsTrue(prop1.IsStatic);\n\t\t\tAssert.IsTrue(prop1.Getter.IsStatic);\n\t\t\tAssert.IsTrue(prop1.Setter.IsStatic);\n\n\t\t\tvar prop2 = type.Properties.Single(e => e.Name == \"Prop2\");\n\t\t\tAssert.IsFalse(prop2.IsStatic);\n\t\t\tAssert.IsFalse(prop2.Getter.IsStatic);\n\t\t\tAssert.IsFalse(prop2.Setter.IsStatic);\n\n\t\t\tvar prop3 = type.Properties.Single(e => e.Name == \"Prop3\");\n\t\t\tAssert.IsTrue(prop3.IsStatic);\n\t\t\tAssert.IsTrue(prop3.Getter.IsStatic);\n\t\t\tAssert.IsTrue(prop3.Setter.IsStatic);\n\n\t\t\tvar prop4 = type.Properties.Single(e => e.Name == \"Prop4\");\n\t\t\tAssert.IsFalse(prop4.IsStatic);\n\t\t\tAssert.IsFalse(prop4.Getter.IsStatic);\n\t\t\tAssert.IsFalse(prop4.Setter.IsStatic);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyAccessorsHaveBody()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassWithStaticAndNonStaticMembers));\n\t\t\tforeach (var prop in type.Properties) {\n\t\t\t\tAssert.IsTrue(prop.Getter.HasBody, prop.Getter.Name);\n\t\t\t\tAssert.IsTrue(prop.Setter.HasBody, prop.Setter.Name);\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EventAccessorNames()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassWithStaticAndNonStaticMembers));\n\t\t\tvar customEvent = type.Events.Single(e => e.Name == \"Event1\");\n\t\t\tAssert.AreEqual(\"add_Event1\", customEvent.AddAccessor.Name);\n\t\t\tAssert.AreEqual(\"remove_Event1\", customEvent.RemoveAccessor.Name);\n\t\t\t\n\t\t\tvar normalEvent = type.Events.Single(e => e.Name == \"Event3\");\n\t\t\tAssert.AreEqual(\"add_Event3\", normalEvent.AddAccessor.Name);\n\t\t\tAssert.AreEqual(\"remove_Event3\", normalEvent.RemoveAccessor.Name);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EventAccessorHaveBody()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassWithStaticAndNonStaticMembers));\n\t\t\tforeach (var ev in type.Events) {\n\t\t\t\tAssert.IsTrue(ev.AddAccessor.HasBody, ev.AddAccessor.Name);\n\t\t\t\tAssert.IsTrue(ev.RemoveAccessor.HasBody, ev.RemoveAccessor.Name);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InterfacePropertyAccessorsShouldNotBeOverrides() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(IInterfaceWithProperty));\n\t\t\tvar prop = type.Properties.Single(p => p.Name == \"Prop\");\n\t\t\tAssert.That(prop.Getter.IsOverride, Is.False);\n\t\t\tAssert.That(prop.Getter.IsOverridable, Is.True);\n\t\t\tAssert.That(prop.Setter.IsOverride, Is.False);\n\t\t\tAssert.That(prop.Setter.IsOverridable, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void VirtualPropertyAccessorsShouldNotBeOverrides() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassWithVirtualProperty));\n\t\t\tvar prop = type.Properties.Single(p => p.Name == \"Prop\");\n\t\t\tAssert.That(prop.Getter.IsOverride, Is.False);\n\t\t\tAssert.That(prop.Getter.IsOverridable, Is.True);\n\t\t\tAssert.That(prop.Setter.IsOverride, Is.False);\n\t\t\tAssert.That(prop.Setter.IsOverridable, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PropertyAccessorsShouldBeReportedAsImplementingInterfaceAccessors() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsProperty));\n\t\t\tvar prop = type.Properties.Single(p => p.Name == \"Prop\");\n\t\t\tAssert.That(prop.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithProperty.Prop\" }));\n\t\t\tAssert.That(prop.Getter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithProperty.get_Prop\" }));\n\t\t\tAssert.That(prop.Setter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithProperty.set_Prop\" }));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyThatImplementsInterfaceIsNotVirtual()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsProperty));\n\t\t\tvar prop = type.Properties.Single(p => p.Name == \"Prop\");\n\t\t\tAssert.IsFalse(prop.IsVirtual);\n\t\t\tAssert.IsFalse(prop.IsOverridable);\n\t\t\tAssert.IsFalse(prop.IsSealed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Property_SealedOverride()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatOverridesAndSealsVirtualProperty));\n\t\t\tvar prop = type.Properties.Single(p => p.Name == \"Prop\");\n\t\t\tAssert.IsFalse(prop.IsVirtual);\n\t\t\tAssert.IsTrue(prop.IsOverride);\n\t\t\tAssert.IsTrue(prop.IsSealed);\n\t\t\tAssert.IsFalse(prop.IsOverridable);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PropertyAccessorsShouldSupportToMemberReference()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsProperty));\n\t\t\tvar prop = type.Properties.Single(p => p.Name == \"Prop\");\n\t\t\tvar mr = prop.Getter.ToReference();\n\t\t\tAssert.AreEqual(prop.Getter, mr.Resolve(compilation.TypeResolveContext));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IndexerAccessorsShouldBeReportedAsImplementingTheCorrectInterfaceAccessors() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsIndexers));\n\t\t\tvar ix1 = type.Properties.Single(p => p.Parameters.Count == 1 && p.Parameters[0].Type.GetDefinition().KnownTypeCode == KnownTypeCode.Int32);\n\t\t\tvar ix2 = type.Properties.Single(p => p.Parameters.Count == 1 && p.Parameters[0].Type.GetDefinition().KnownTypeCode == KnownTypeCode.String);\n\t\t\tvar ix3 = type.Properties.Single(p => p.Parameters.Count == 2);\n\n\t\t\tAssert.That(ix1.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EquivalentTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.Item\", \"ICSharpCode.NRefactory.TypeSystem.TestCase.IGenericInterfaceWithIndexer`1.Item\" }));\n\t\t\tAssert.That(ix1.ImplementedInterfaceMembers.All(p => ((IProperty)p).Parameters.Select(x => x.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.Int32 })));\n\t\t\tAssert.That(ix1.Getter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EquivalentTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.get_Item\", \"ICSharpCode.NRefactory.TypeSystem.TestCase.IGenericInterfaceWithIndexer`1.get_Item\" }));\n\t\t\tAssert.That(ix1.Getter.ImplementedInterfaceMembers.All(m => ((IMethod)m).Parameters.Select(p => p.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.Int32 })));\n\t\t\tAssert.That(ix1.Setter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EquivalentTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.set_Item\", \"ICSharpCode.NRefactory.TypeSystem.TestCase.IGenericInterfaceWithIndexer`1.set_Item\" }));\n\t\t\tAssert.That(ix1.Setter.ImplementedInterfaceMembers.All(m => ((IMethod)m).Parameters.Select(p => p.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.Int32, KnownTypeCode.Int32 })));\n\n\t\t\tAssert.That(ix2.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.Item\" }));\n\t\t\tAssert.That(ix2.ImplementedInterfaceMembers.All(p => ((IProperty)p).Parameters.Select(x => x.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.String })));\n\t\t\tAssert.That(ix2.Getter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.get_Item\" }));\n\t\t\tAssert.That(ix2.Getter.ImplementedInterfaceMembers.All(m => ((IMethod)m).Parameters.Select(p => p.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.String })));\n\t\t\tAssert.That(ix2.Setter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.set_Item\" }));\n\t\t\tAssert.That(ix2.Setter.ImplementedInterfaceMembers.All(m => ((IMethod)m).Parameters.Select(p => p.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.String, KnownTypeCode.Int32 })));\n\n\t\t\tAssert.That(ix3.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.Item\" }));\n\t\t\tAssert.That(ix3.ImplementedInterfaceMembers.All(p => ((IProperty)p).Parameters.Select(x => x.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.Int32, KnownTypeCode.Int32 })));\n\t\t\tAssert.That(ix3.Getter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.get_Item\" }));\n\t\t\tAssert.That(ix3.Getter.ImplementedInterfaceMembers.All(m => ((IMethod)m).Parameters.Select(p => p.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.Int32, KnownTypeCode.Int32 })));\n\t\t\tAssert.That(ix3.Setter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithIndexers.set_Item\" }));\n\t\t\tAssert.That(ix3.Setter.ImplementedInterfaceMembers.All(m => ((IMethod)m).Parameters.Select(p => p.Type.GetDefinition().KnownTypeCode).SequenceEqual(new[] { KnownTypeCode.Int32, KnownTypeCode.Int32, KnownTypeCode.Int32 })));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExplicitIndexerImplementationReturnsTheCorrectMembers() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsIndexersExplicitly));\n\n\t\t\tAssert.That(type.Properties.All(p => p.SymbolKind == SymbolKind.Indexer));\n\t\t\tAssert.That(type.Properties.All(p => p.ImplementedInterfaceMembers.Count == 1));\n\t\t\tAssert.That(type.Properties.All(p => p.Getter.ImplementedInterfaceMembers.Count == 1));\n\t\t\tAssert.That(type.Properties.All(p => p.Setter.ImplementedInterfaceMembers.Count == 1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExplicitlyImplementedPropertyAccessorsShouldSupportToMemberReference()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsPropertyExplicitly));\n\t\t\tvar prop = type.Properties.Single();\n\t\t\tvar mr = prop.Getter.ToReference();\n\t\t\tAssert.AreEqual(prop.Getter, mr.Resolve(compilation.TypeResolveContext));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitDisposableImplementation()\n\t\t{\n\t\t\tITypeDefinition disposable = GetTypeDefinition(typeof(NRefactory.TypeSystem.TestCase.ExplicitDisposableImplementation));\n\t\t\tIMethod method = disposable.Methods.Single(m => !m.IsConstructor);\n\t\t\tAssert.IsTrue(method.IsExplicitInterfaceImplementation);\n\t\t\tAssert.AreEqual(\"System.IDisposable.Dispose\", method.ImplementedInterfaceMembers.Single().FullName);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitImplementationOfUnifiedMethods()\n\t\t{\n\t\t\tIType type = compilation.FindType(typeof(ExplicitGenericInterfaceImplementationWithUnifiableMethods<int, int>));\n\t\t\tAssert.AreEqual(2, type.GetMethods(m => m.IsExplicitInterfaceImplementation).Count());\n\t\t\tforeach (IMethod method in type.GetMethods(m => m.IsExplicitInterfaceImplementation)) {\n\t\t\t\tAssert.AreEqual(1, method.ImplementedInterfaceMembers.Count, method.ToString());\n\t\t\t\tAssert.AreEqual(\"System.Int32\", method.Parameters.Single().Type.ReflectionName);\n\t\t\t\tIMethod interfaceMethod = (IMethod)method.ImplementedInterfaceMembers.Single();\n\t\t\t\tAssert.AreEqual(\"System.Int32\", interfaceMethod.Parameters.Single().Type.ReflectionName);\n\t\t\t\tvar genericParamType = ((IMethod)method.MemberDefinition).Parameters.Single().Type;\n\t\t\t\tvar interfaceGenericParamType = ((IMethod)interfaceMethod.MemberDefinition).Parameters.Single().Type;\n\t\t\t\tAssert.AreEqual(TypeKind.TypeParameter, genericParamType.Kind);\n\t\t\t\tAssert.AreEqual(TypeKind.TypeParameter, interfaceGenericParamType.Kind);\n\t\t\t\tAssert.AreEqual(genericParamType.ReflectionName, interfaceGenericParamType.ReflectionName);\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitImplementationOfUnifiedMethods_ToMemberReference()\n\t\t{\n\t\t\tIType type = compilation.FindType(typeof(ExplicitGenericInterfaceImplementationWithUnifiableMethods<int, int>));\n\t\t\tAssert.AreEqual(2, type.GetMethods(m => m.IsExplicitInterfaceImplementation).Count());\n\t\t\tforeach (IMethod method in type.GetMethods(m => m.IsExplicitInterfaceImplementation)) {\n\t\t\t\tIMethod resolvedMethod = (IMethod)method.ToReference().Resolve(compilation.TypeResolveContext);\n\t\t\t\tAssert.AreEqual(method, resolvedMethod);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExplicitGenericInterfaceImplementation()\n\t\t{\n\t\t\tITypeDefinition impl = GetTypeDefinition(typeof(ExplicitGenericInterfaceImplementation));\n\t\t\tIType genericInterfaceOfString = compilation.FindType(typeof(IGenericInterface<string>));\n\t\t\tIMethod implMethod1 = impl.Methods.Single(m => !m.IsConstructor && !m.Parameters[1].IsRef);\n\t\t\tIMethod implMethod2 = impl.Methods.Single(m => !m.IsConstructor && m.Parameters[1].IsRef);\n\t\t\tAssert.IsTrue(implMethod1.IsExplicitInterfaceImplementation);\n\t\t\tAssert.IsTrue(implMethod2.IsExplicitInterfaceImplementation);\n\t\t\t\n\t\t\tIMethod interfaceMethod1 = (IMethod)implMethod1.ImplementedInterfaceMembers.Single();\n\t\t\tAssert.AreEqual(genericInterfaceOfString, interfaceMethod1.DeclaringType);\n\t\t\tAssert.IsTrue(!interfaceMethod1.Parameters[1].IsRef);\n\t\t\t\n\t\t\tIMethod interfaceMethod2 = (IMethod)implMethod2.ImplementedInterfaceMembers.Single();\n\t\t\tAssert.AreEqual(genericInterfaceOfString, interfaceMethod2.DeclaringType);\n\t\t\tAssert.IsTrue(interfaceMethod2.Parameters[1].IsRef);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExplicitlyImplementedPropertiesShouldBeReportedAsBeingImplemented() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsPropertyExplicitly));\n\t\t\tvar prop = type.Properties.Single();\n\t\t\tAssert.That(prop.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithProperty.Prop\" }));\n\t\t\tAssert.That(prop.Getter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithProperty.get_Prop\" }));\n\t\t\tAssert.That(prop.Setter.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IInterfaceWithProperty.set_Prop\" }));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitlyImplementedPropertiesShouldHaveExplicitlyImplementedAccessors() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsPropertyExplicitly));\n\t\t\tvar prop = type.Properties.Single();\n\t\t\tAssert.IsTrue(prop.IsExplicitInterfaceImplementation);\n\t\t\tAssert.IsTrue(prop.Getter.IsExplicitInterfaceImplementation);\n\t\t\tAssert.IsTrue(prop.Setter.IsExplicitInterfaceImplementation);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EventAccessorsShouldBeReportedAsImplementingInterfaceAccessors() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsEvent));\n\t\t\tvar evt = type.Events.Single(p => p.Name == \"Event\");\n\t\t\tAssert.That(evt.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.Event\" }));\n\t\t\tAssert.That(evt.AddAccessor.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.add_Event\" }));\n\t\t\tAssert.That(evt.RemoveAccessor.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.remove_Event\" }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EventAccessorsShouldBeReportedAsImplementingInterfaceAccessorsWhenCustomAccessorMethodsAreUsed() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsEventWithCustomAccessors));\n\t\t\tvar evt = type.Events.Single(p => p.Name == \"Event\");\n\t\t\tAssert.That(evt.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.Event\" }));\n\t\t\tAssert.That(evt.AddAccessor.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.add_Event\" }));\n\t\t\tAssert.That(evt.RemoveAccessor.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.remove_Event\" }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExplicitlyImplementedEventsShouldBeReportedAsBeingImplemented()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassThatImplementsEventExplicitly));\n\t\t\tvar evt = type.Events.Single();\n\t\t\tAssert.That(evt.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.Event\" }));\n\t\t\tAssert.That(evt.AddAccessor.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.add_Event\" }));\n\t\t\tAssert.That(evt.RemoveAccessor.ImplementedInterfaceMembers.Select(p => p.ReflectionName).ToList(), Is.EqualTo(new[] { \"ICSharpCode.NRefactory.TypeSystem.TestCase.IHasEvent.remove_Event\" }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MembersDeclaredInDerivedInterfacesDoNotImplementBaseMembers() {\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(IShadowTestDerived));\n\t\t\tvar method = type.Methods.Single(m => m.Name == \"Method\");\n\t\t\tvar indexer = type.Properties.Single(p => p.IsIndexer);\n\t\t\tvar prop = type.Properties.Single(p => p.Name == \"Prop\");\n\t\t\tvar evt = type.Events.Single(e => e.Name == \"Evt\");\n\n\t\t\tAssert.That(method.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(indexer.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(indexer.Getter.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(indexer.Setter.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(prop.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(prop.Getter.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(prop.Setter.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(evt.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(evt.AddAccessor.ImplementedInterfaceMembers, Is.Empty);\n\t\t\tAssert.That(evt.RemoveAccessor.ImplementedInterfaceMembers, Is.Empty);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void StaticClassTest()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(StaticClass));\n\t\t\tAssert.IsTrue(type.IsAbstract);\n\t\t\tAssert.IsTrue(type.IsSealed);\n\t\t\tAssert.IsTrue(type.IsStatic);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NoDefaultConstructorOnStaticClassTest()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(StaticClass));\n\t\t\tAssert.AreEqual(0, type.GetConstructors().Count());\n\t\t}\n\t\t\n\t\t[Test]\n\t\t[Ignore(\"not yet implemented in C# TypeSystemConvertVisitor\")]\n\t\tpublic void IndexerNonDefaultName()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(IndexerNonDefaultName));\n\t\t\tvar indexer = type.GetProperties(p => p.IsIndexer).Single();\n\t\t\tAssert.AreEqual(\"Foo\", indexer.Name);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestNullableDefaultParameter()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ClassWithMethodThatHasNullableDefaultParameter));\n\t\t\tvar method = type.GetMethods ().Single (m => m.Name == \"Foo\");\n\t\t\tAssert.AreEqual(42, method.Parameters.Single ().ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AccessibilityTests()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(AccessibilityTest));\n\t\t\tAssert.AreEqual(Accessibility.Public, type.Methods.Single(m => m.Name == \"Public\").Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Internal, type.Methods.Single(m => m.Name == \"Internal\").Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.ProtectedOrInternal, type.Methods.Single(m => m.Name == \"ProtectedInternal\").Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.ProtectedOrInternal, type.Methods.Single(m => m.Name == \"InternalProtected\").Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Protected, type.Methods.Single(m => m.Name == \"Protected\").Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Private, type.Methods.Single(m => m.Name == \"Private\").Accessibility);\n\t\t\tAssert.AreEqual(Accessibility.Private, type.Methods.Single(m => m.Name == \"None\").Accessibility);\n\t\t}\n\n\t\tprivate void AssertConstantField<T>(ITypeDefinition type, string name, T expected) {\n\t\t\tvar f = type.GetFields().Single(x => x.Name == name);\n\t\t\tAssert.IsTrue(f.IsConst);\n\t\t\tAssert.AreEqual(expected, f.ConstantValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic unsafe void ConstantFieldsCreatedWithNew()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));\n\t\t\tAssertConstantField<byte>(type, \"CNewb\", new byte());\n\t\t\tAssertConstantField<sbyte>(type, \"CNewsb\", new sbyte());\n\t\t\tAssertConstantField<char>(type, \"CNewc\", new char());\n\t\t\tAssertConstantField<short>(type, \"CNews\", new short());\n\t\t\tAssertConstantField<ushort>(type, \"CNewus\", new ushort());\n\t\t\tAssertConstantField<int>(type, \"CNewi\", new int());\n\t\t\tAssertConstantField<uint>(type, \"CNewui\", new uint());\n\t\t\tAssertConstantField<long>(type, \"CNewl\", new long());\n\t\t\tAssertConstantField<ulong>(type, \"CNewul\", new ulong());\n\t\t\tAssertConstantField<double>(type, \"CNewd\", new double());\n\t\t\tAssertConstantField<float>(type, \"CNewf\", new float());\n\t\t\tAssertConstantField<decimal>(type, \"CNewm\", new decimal());\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void ConstantFieldsSizeOf()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));\n\t\t\tAssertConstantField<int>(type, \"SOsb\", sizeof(sbyte));\n\t\t\tAssertConstantField<int>(type, \"SOb\", sizeof(byte));\n\t\t\tAssertConstantField<int>(type, \"SOs\", sizeof(short));\n\t\t\tAssertConstantField<int>(type, \"SOus\", sizeof(ushort));\n\t\t\tAssertConstantField<int>(type, \"SOi\", sizeof(int));\n\t\t\tAssertConstantField<int>(type, \"SOui\", sizeof(uint));\n\t\t\tAssertConstantField<int>(type, \"SOl\", sizeof(long));\n\t\t\tAssertConstantField<int>(type, \"SOul\", sizeof(ulong));\n\t\t\tAssertConstantField<int>(type, \"SOc\", sizeof(char));\n\t\t\tAssertConstantField<int>(type, \"SOf\", sizeof(float));\n\t\t\tAssertConstantField<int>(type, \"SOd\", sizeof(double));\n\t\t\tAssertConstantField<int>(type, \"SObl\", sizeof(bool));\n\t\t\tAssertConstantField<int>(type, \"SOe\", sizeof(MyEnum));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstantEnumFromThisAssembly()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));\n\t\t\tIField field = type.Fields.Single(f => f.Name == \"EnumFromThisAssembly\");\n\t\t\tAssert.IsTrue(field.IsConst);\n\t\t\tAssert.AreEqual((short)MyEnum.Second, field.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ConstantEnumFromAnotherAssembly()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));\n\t\t\tIField field = type.Fields.Single(f => f.Name == \"EnumFromAnotherAssembly\");\n\t\t\tAssert.IsTrue(field.IsConst);\n\t\t\tAssert.AreEqual((int)StringComparison.OrdinalIgnoreCase, field.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DefaultOfEnum()\n\t\t{\n\t\t\tITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));\n\t\t\tIField field = type.Fields.Single(f => f.Name == \"DefaultOfEnum\");\n\t\t\tAssert.IsTrue(field.IsConst);\n\t\t\tAssert.AreEqual((short)default(MyEnum), field.ConstantValue);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void ExplicitImplementation()\n\t\t{\n\t\t\tvar type = GetTypeDefinition(typeof(ExplicitImplementationTests));\n\t\t\tvar itype = GetTypeDefinition(typeof(IExplicitImplementationTests));\n\n\t\t\tvar methods = type.GetMethods(m => m.Name == \"M\").ToList();\n\t\t\tvar imethod = itype.GetMethods(m => m.Name == \"M\").Single();\n\t\t\tAssert.That(methods.Select(m => m.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(methods.SelectMany(m => m.ImplementedInterfaceMembers).Single(), imethod);\n\n\t\t\tvar properties = type.GetProperties(p => p.Name == \"P\").ToList();\n\t\t\tvar iproperty  = itype.GetProperties(m => m.Name == \"P\").Single();\n\t\t\tAssert.That(properties.Select(p => p.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(properties.SelectMany(p => p.ImplementedInterfaceMembers).Single(), iproperty);\n\t\t\tAssert.That(properties.Select(p => p.Getter.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(properties.SelectMany(p => p.Getter.ImplementedInterfaceMembers).Single(), iproperty.Getter);\n\t\t\tAssert.That(properties.Select(p => p.Setter.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(properties.SelectMany(p => p.Setter.ImplementedInterfaceMembers).Single(), iproperty.Setter);\n\n\t\t\tvar indexers = type.GetProperties(p => p.Name == \"Item\").ToList();\n\t\t\tvar iindexer = itype.GetProperties(m => m.Name == \"Item\").Single();\n\t\t\tAssert.That(indexers.Select(p => p.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(indexers.SelectMany(p => p.ImplementedInterfaceMembers).Single(), iindexer);\n\t\t\tAssert.That(indexers.Select(p => p.Getter.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(indexers.SelectMany(p => p.Getter.ImplementedInterfaceMembers).Single(), iindexer.Getter);\n\t\t\tAssert.That(indexers.Select(p => p.Setter.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(indexers.SelectMany(p => p.Setter.ImplementedInterfaceMembers).Single(), iindexer.Setter);\n\n\t\t\tvar events = type.GetEvents(e => e.Name == \"E\").ToList();\n\t\t\tvar ievent = itype.GetEvents(m => m.Name == \"E\").Single();\n\t\t\tAssert.That(events.Select(e => e.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(events.SelectMany(e => e.ImplementedInterfaceMembers).Single(), ievent);\n\t\t\tAssert.That(events.Select(e => e.AddAccessor.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(events.SelectMany(e => e.AddAccessor.ImplementedInterfaceMembers).Single(), ievent.AddAccessor);\n\t\t\tAssert.That(events.Select(e => e.RemoveAccessor.ImplementedInterfaceMembers.Count).ToList(), Is.EquivalentTo(new[] { 0, 1 }));\n\t\t\tAssert.AreEqual(events.SelectMany(e => e.RemoveAccessor.ImplementedInterfaceMembers).Single(), ievent.RemoveAccessor);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void MarshalTests()\n\t\t{\n\t\t\tITypeDefinition c = compilation.FindType(typeof(IMarshalAsTests)).GetDefinition();\n\t\t\tAssert.AreEqual(1, c.GetMethods(m => m.Name == \"GetCollectionByQuery2\").Count());\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void AttributesUsingNestedMembers() {\n\t\t\tvar type = GetTypeDefinition(typeof(ClassWithAttributesUsingNestedMembers));\n\t\t\tvar inner = type.GetNestedTypes().Single(t => t.Name == \"Inner\");\n\t\t\tvar myAttribute = type.GetNestedTypes().Single(t => t.Name == \"MyAttribute\");\n\t\t\tvar typeTypeTestAttr = type.Attributes.Single(a => a.AttributeType.Name == \"TypeTestAttribute\");\n\t\t\tAssert.AreEqual(42, typeTypeTestAttr.PositionalArguments[0].ConstantValue);\n\t\t\tAssert.IsInstanceOf<TypeOfResolveResult>(typeTypeTestAttr.PositionalArguments[1]);\n\t\t\tAssert.AreEqual(inner, ((TypeOfResolveResult)typeTypeTestAttr.PositionalArguments[1]).ReferencedType);\n\t\t\tvar typeMyAttr = type.Attributes.Single(a => a.AttributeType.Name == \"MyAttribute\");\n\t\t\tAssert.AreEqual(myAttribute, typeMyAttr.AttributeType);\n\n\t\t\tvar prop = type.GetProperties().Single(p => p.Name == \"P\");\n\t\t\tvar propTypeTestAttr = prop.Attributes.Single(a => a.AttributeType.Name == \"TypeTestAttribute\");\n\t\t\tAssert.AreEqual(42, propTypeTestAttr.PositionalArguments[0].ConstantValue);\n\t\t\tAssert.IsInstanceOf<TypeOfResolveResult>(propTypeTestAttr.PositionalArguments[1]);\n\t\t\tAssert.AreEqual(inner, ((TypeOfResolveResult)propTypeTestAttr.PositionalArguments[1]).ReferencedType);\n\t\t\tvar propMyAttr = prop.Attributes.Single(a => a.AttributeType.Name == \"MyAttribute\");\n\t\t\tAssert.AreEqual(myAttribute, propMyAttr.AttributeType);\n\n\t\t\tvar attributedInner = (ITypeDefinition)type.GetNestedTypes().Single(t => t.Name == \"AttributedInner\");\n\t\t\tvar innerTypeTestAttr = attributedInner.Attributes.Single(a => a.AttributeType.Name == \"TypeTestAttribute\");\n\t\t\tAssert.AreEqual(42, innerTypeTestAttr.PositionalArguments[0].ConstantValue);\n\t\t\tAssert.IsInstanceOf<TypeOfResolveResult>(innerTypeTestAttr.PositionalArguments[1]);\n\t\t\tAssert.AreEqual(inner, ((TypeOfResolveResult)innerTypeTestAttr.PositionalArguments[1]).ReferencedType);\n\t\t\tvar innerMyAttr = attributedInner.Attributes.Single(a => a.AttributeType.Name == \"MyAttribute\");\n\t\t\tAssert.AreEqual(myAttribute, innerMyAttr.AttributeType);\n\n\t\t\tvar attributedInner2 = (ITypeDefinition)type.GetNestedTypes().Single(t => t.Name == \"AttributedInner2\");\n\t\t\tvar inner2 = attributedInner2.GetNestedTypes().Single(t => t.Name == \"Inner\");\n\t\t\tvar myAttribute2 = attributedInner2.GetNestedTypes().Single(t => t.Name == \"MyAttribute\");\n\t\t\tvar inner2TypeTestAttr = attributedInner2.Attributes.Single(a => a.AttributeType.Name == \"TypeTestAttribute\");\n\t\t\tAssert.AreEqual(43, inner2TypeTestAttr.PositionalArguments[0].ConstantValue);\n\t\t\tAssert.IsInstanceOf<TypeOfResolveResult>(inner2TypeTestAttr.PositionalArguments[1]);\n\t\t\tAssert.AreEqual(inner2, ((TypeOfResolveResult)inner2TypeTestAttr.PositionalArguments[1]).ReferencedType);\n\t\t\tvar inner2MyAttr = attributedInner2.Attributes.Single(a => a.AttributeType.Name == \"MyAttribute\");\n\t\t\tAssert.AreEqual(myAttribute2, inner2MyAttr.AttributeType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Utils/CSharpPrimitiveCastTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t[TestFixture]\n\tpublic class CSharpPrimitiveCastTests\n\t{\n\t\t// I know, these tests aren't really clever, more of a way to fake code coverage...\n\t\t// Well, at least they should ensure the 'tables' in CSharpPrimitiveCast don't contain any typos.\n\t\t\n\t\t[Test]\n\t\tpublic void FloatToInteger()\n\t\t{\n\t\t\tfor (int checkedMode = 0; checkedMode < 2; checkedMode++) {\n\t\t\t\tfor (TypeCode to = TypeCode.Char; to <= TypeCode.UInt64; to++) {\n\t\t\t\t\tobject val = CSharpPrimitiveCast.Cast(to, 3.9f, checkedMode == 1);\n\t\t\t\t\tAssert.AreEqual(to, Type.GetTypeCode(val.GetType()));\n\t\t\t\t\tAssert.AreEqual(3, Convert.ToInt64(val));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DoubleToInteger()\n\t\t{\n\t\t\tfor (int checkedMode = 0; checkedMode < 2; checkedMode++) {\n\t\t\t\tfor (TypeCode to = TypeCode.Char; to <= TypeCode.UInt64; to++) {\n\t\t\t\t\tobject val = CSharpPrimitiveCast.Cast(to, 3.9, checkedMode == 1);\n\t\t\t\t\tAssert.AreEqual(to, Type.GetTypeCode(val.GetType()));\n\t\t\t\t\tAssert.AreEqual(3, Convert.ToInt64(val));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void DecimalToInteger()\n\t\t{\n\t\t\tfor (int checkedMode = 0; checkedMode < 2; checkedMode++) {\n\t\t\t\tfor (TypeCode to = TypeCode.Char; to <= TypeCode.UInt64; to++) {\n\t\t\t\t\tobject val = CSharpPrimitiveCast.Cast(to, 3.9m, checkedMode == 1);\n\t\t\t\t\tAssert.AreEqual(to, Type.GetTypeCode(val.GetType()));\n\t\t\t\t\tAssert.AreEqual(3, Convert.ToInt64(val));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void IntegerToInteger()\n\t\t{\n\t\t\tfor (int checkedMode = 0; checkedMode < 2; checkedMode++) {\n\t\t\t\tfor (TypeCode to = TypeCode.Char; to <= TypeCode.UInt64; to++) {\n\t\t\t\t\tfor (TypeCode to2 = TypeCode.Char; to2 <= TypeCode.Decimal; to2++) {\n\t\t\t\t\t\tobject val = CSharpPrimitiveCast.Cast(to, 3, checkedMode == 1);\n\t\t\t\t\t\tAssert.AreEqual(to, Type.GetTypeCode(val.GetType()));\n\t\t\t\t\t\tAssert.AreEqual(3, Convert.ToInt64(val));\n\t\t\t\t\t\tobject val2 = CSharpPrimitiveCast.Cast(to2, val, checkedMode == 1);\n\t\t\t\t\t\tAssert.AreEqual(to2, Type.GetTypeCode(val2.GetType()));\n\t\t\t\t\t\tAssert.AreEqual(3, Convert.ToInt64(val2));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Utils/CompositeFormatStringParser/CompositeFormatStringParserTests.cs",
    "content": "//\n// CompositeFormatStringParserTests.cs\n//\n// Author:\n//       Simon Lindgren <simon.n.lindgren@gmail.com>\n//\n// Copyright (c) 2012 Simon Lindgren\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nusing NUnit.Framework;\nusing System.Linq;\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t[TestFixture]\n\tpublic class CompositeFormatStringParserTests\n\t{\n\n\t\tIList<IFormatStringSegment> ParseTest(string format, params IFormatStringSegment[] expectedFormatSegments)\n\t\t{\n\t\t\tvar parser = new CompositeFormatStringParser();\n\t\t\tvar formatStringParseResult = parser.Parse(format);\n\t\t\tvar actualFormatSegments = formatStringParseResult.Segments;\n\n\t\t\tConsole.WriteLine(\"Expected format segments:\");\n\t\t\tforeach (var item in expectedFormatSegments) {\n\t\t\t\tConsole.WriteLine(item);\n\t\t\t}\n\t\t\tConsole.WriteLine(\"Actual format segments:\");\n\t\t\tforeach (var item in actualFormatSegments) {\n\t\t\t\tConsole.WriteLine(item);\n\t\t\t\tforeach (var error in item.Errors) {\n\t\t\t\t\tConsole.WriteLine(\"\\t{0}\", error);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAssert.AreEqual(expectedFormatSegments, actualFormatSegments);\n\t\t\treturn actualFormatSegments;\n\t\t}\n\n\t\tstatic IList<IFormatStringError> SegmentTest(int count, IFormatStringSegment segment)\n\t\t{\n\t\t\tvar errors = segment.Errors.ToList();\n\t\t\tAssert.AreEqual(count, errors.Count, \"Too many or too few errors.\");\n\t\t\treturn errors;\n\t\t}\n\n\t\tstatic void ErrorTest(IFormatStringError error, string originalText, string replacementText, int startLocation, int endLocation)\n\t\t{\n\t\t\tAssert.AreEqual(originalText, error.OriginalText, \"OriginalText is incorrect.\");\n\t\t\tAssert.AreEqual(replacementText, error.SuggestedReplacementText, \"SuggestedReplacementText is incorrect.\");\n\t\t\tAssert.AreEqual(startLocation, error.StartLocation, \"StartLocation is incorrect.\");\n\t\t\tAssert.AreEqual(endLocation, error.EndLocation, \"EndLocation is incorrect.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Index()\n\t\t{\n\t\t\tParseTest(\"{0}\", new FormatItem(0) { StartLocation = 0, EndLocation = 3 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PositiveAlignment()\n\t\t{\n\t\t\tParseTest(\"{0,4}\", new FormatItem(0, 4) { StartLocation = 0, EndLocation = 5 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void NegativeAlignment()\n\t\t{\n\t\t\tParseTest(\"{0,-4}\", new FormatItem(0, -4) { StartLocation = 0, EndLocation = 6 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void AlignmentWhiteSpace()\n\t\t{\n\t\t\tParseTest(\"{0, -4}\", new FormatItem(0, -4) { StartLocation = 0, EndLocation = 7 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void SubFormatString()\n\t\t{\n\t\t\tParseTest(\"{0:aaaa}\", new FormatItem(0, null, \"aaaa\") { StartLocation = 0, EndLocation = 8 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CompleteFormatItem()\n\t\t{\n\t\t\tParseTest(\"{0, -45:aaaa}\", new FormatItem(0, -45, \"aaaa\") { StartLocation = 0, EndLocation = 13 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MultipleCompleteFormatItems()\n\t\t{\n\t\t\tParseTest(\"{0, -45:aaaa}{3, 67:bbbb}\",\n\t\t\t          new FormatItem(0, -45, \"aaaa\") { StartLocation = 0, EndLocation = 13 },\n\t\t\t          new FormatItem(3, 67, \"bbbb\") { StartLocation = 13, EndLocation = 25 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void BraceEscape()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{{}}\", new TextSegment(\"{}\"));\n\t\t\tAssert.IsFalse(segments.First().HasErrors);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CloseAndEscapeAfterIndex()\n\t\t{\n\t\t\tParseTest(\"{0}}}\",\n\t\t\t          new FormatItem(0) { StartLocation = 0, EndLocation = 3},\n\t\t\tnew TextSegment(\"}\") { StartLocation = 3, EndLocation = 5});\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void CloseAndEscapeAfterAlignment()\n\t\t{\n\t\t\tParseTest(\"{0,-15}}}\",\n\t\t\t          new FormatItem(0, -15) { StartLocation = 0, EndLocation = 7},\n\t\t\tnew TextSegment(\"}\") { StartLocation = 7, EndLocation = 9});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TextSegment()\n\t\t{\n\t\t\tParseTest(\"Some Text\", new TextSegment(\"Some Text\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SingleCharacterTextSegment()\n\t\t{\n\t\t\tParseTest(\"A\", new TextSegment(\"A\"));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatStringWithPrefixText()\n\t\t{\n\t\t\tParseTest(\"Some Text {0}\",\n\t\t\t          new TextSegment(\"Some Text \"),\n\t\t\t          new FormatItem(0) { StartLocation = 10, EndLocation = 13 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatStringWithPostfixText()\n\t\t{\n\t\t\tParseTest(\"{0} Some Text\",\n\t\t\t          new FormatItem(0)  { StartLocation = 0, EndLocation = 3 },\n\t\t\t\t\t  new TextSegment(\" Some Text\", 3));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void FormatStringWithEscapableBracesInSubFormatString()\n\t\t{\n\t\t\tParseTest(\"A weird string: {0:{{}}}\",\n\t\t\t          new TextSegment(\"A weird string: \"),\n\t\t\t          new FormatItem(0, null, \"{}\") { StartLocation = 16, EndLocation = 24 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EmptySubFormatString()\n\t\t{\n\t\t\tParseTest(\"{0:}\", new FormatItem(0, null, \"\") { StartLocation = 0, EndLocation = 4 });\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndsAfterOpenBrace()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{\", new TextSegment(\"{\"));\n\t\t\tvar errors = SegmentTest(1, segments.First());\n\t\t\tErrorTest(errors[0], \"{\", \"{{\", 0, 1);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnescapedOpenBracesInFixedText()\n\t\t{\n\t\t\tvar segments = ParseTest(\"a { { a\", new TextSegment(\"a { { a\"));\n\t\t\tvar errors = SegmentTest(2, segments.First());\n\t\t\tErrorTest(errors[0], \"{\", \"{{\", 2, 3);\n\t\t\tErrorTest(errors[1], \"{\", \"{{\", 4, 5);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void UnescapedLoneEndingBrace()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {\", new TextSegment(\"Some text {\"));\n\t\t\tvar errors = SegmentTest(1, segments.First());\n\t\t\tErrorTest(errors[0], \"{\", \"{{\", 10, 11);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndAfterIndex()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {0\",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0) { StartLocation = 10, EndLocation = 12 });\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"}\", 12, 12);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndAfterComma()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {0,\",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0, 0) { StartLocation = 10, EndLocation = 13 });\n\t\t\tvar errors = SegmentTest(2, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"0\", 13, 13);\n\t\t\tErrorTest(errors[1], \"\", \"}\", 13, 13);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndAfterCommaAndSpaces()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {0,   \",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0, 0) { StartLocation = 10, EndLocation = 16 });\n\t\t\tvar errors = SegmentTest(2, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"0\", 16, 16);\n\t\t\tErrorTest(errors[1], \"\", \"}\", 16, 16);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndAfterAlignment()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {0, -34\",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0, -34) { StartLocation = 10, EndLocation = 17 });\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"}\", 17, 17);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndAfterColon()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {0:\",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0, null, \"\") { StartLocation = 10, EndLocation = 13 });\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"}\", 13, 13);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndAfterSubFormatString()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {0: asdf\",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0, null, \" asdf\") { StartLocation = 10, EndLocation = 18 });\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"}\", 18, 18);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MissingIndex()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {}\",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0) { StartLocation = 10, EndLocation = 12 });\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"0\", 11, 11);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MissingAlignment()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Some text {0,}\",\n\t\t\t                         new TextSegment(\"Some text \"),\n\t\t\t                         new FormatItem(0, 0) { StartLocation = 10, EndLocation = 14 });\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"0\", 13, 13);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MissingEveryThing()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{,:\", new FormatItem(0, 0, \"\") { StartLocation = 0, EndLocation = 3 });\n\t\t\tvar errors = SegmentTest(3, segments.First());\n\t\t\tErrorTest(errors[0], \"\", \"0\", 1, 1);\n\t\t\tErrorTest(errors[1], \"\", \"0\", 2, 2);\n\t\t\tErrorTest(errors[2], \"\", \"}\", 3, 3);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidNumberFormatInIndex()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{0 and then some invalid text}\",\n\t\t\t                         new FormatItem(0) { StartLocation = 0, EndLocation = 30 });\n\t\t\tvar errors = SegmentTest(1, segments.First());\n\t\t\tErrorTest(errors[0], \"0 and then some invalid text\", \"0\", 1, 29);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidNumberFormatTextBeforeDigitsInIndex()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{Some text 55}\",\n\t\t\t                         new FormatItem(0) { StartLocation = 0, EndLocation = 14 });\n\t\t\tvar errors = SegmentTest(1, segments.First());\n\t\t\tErrorTest(errors[0], \"Some text 55\", \"0\", 1, 13);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidNumberFormatInAlignment()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{0, 100 and then some invalid text}\",\n\t\t\t                         new FormatItem(0, 100) { StartLocation = 0, EndLocation = 35 });\n\t\t\tvar errors = SegmentTest(1, segments.First());\n\t\t\tErrorTest(errors[0], \" 100 and then some invalid text\", \"100\", 3, 34);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void InvalidNumberFormatTextBeforeDigitsInAlignment()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{0, Some text 55}\",\n\t\t\t                         new FormatItem(0, 0) { StartLocation = 0, EndLocation = 17 });\n\t\t\tvar errors = SegmentTest(1, segments.First());\n\t\t\tErrorTest(errors[0], \" Some text 55\", \"0\", 3, 16);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MissingEndBraceInsideFixedText()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Text {0 Text\",\n\t\t\t                         new TextSegment(\"Text \"),\n\t\t\t                         new FormatItem(0) { StartLocation = 5, EndLocation = 7 },\n\t\t\t\t\t\t\t\t\t new TextSegment(\" Text\", 7));\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"}\", 7, 7);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void MissingEndBraceInsideFixedTextEndingInAnotherFormatItem()\n\t\t{\n\t\t\tvar segments = ParseTest(\"Text {0 Text {1}\",\n\t\t\t                         new TextSegment(\"Text \"),\n\t\t\t                         new FormatItem(0) { StartLocation = 5, EndLocation = 7 },\n\t\t\t                         new TextSegment(\" Text \", 7),\n\t\t\t                         new FormatItem(1) { StartLocation = 13, EndLocation = 16 });\n\t\t\tvar errors = SegmentTest(1, segments.Skip(1).First());\n\t\t\tErrorTest(errors[0], \"\", \"}\", 7, 7);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void EndWithEscapedBrace()\n\t\t{\n\t\t\tvar segments = ParseTest(\"{0:}}\", new FormatItem(0, null, \"}\") { StartLocation = 0, EndLocation = 5 });\n\t\t\tvar errors = SegmentTest(1, segments.First());\n\t\t\tErrorTest(errors[0], \"\", \"}\", 5, 5);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/Utils/TreeTraversalTests.cs",
    "content": "﻿// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace ICSharpCode.NRefactory.Utils\n{\n\t[TestFixture]\n\tpublic class TreeTraversalTests\n\t{\n\t\tsealed class Node\n\t\t{\n\t\t\tpublic int Data;\n\t\t\tpublic List<Node> Children = new List<Node>();\n\t\t}\n\t\t\n\t\tNode tree = new Node {\n\t\t\tData = 1,\n\t\t\tChildren = {\n\t\t\t\tnew Node { Data = 2 },\n\t\t\t\tnew Node { Data = 3,\n\t\t\t\t\tChildren = {\n\t\t\t\t\t\tnew Node { Data = 4 },\n\t\t\t\t\t\tnew Node { Data = 5 }\n\t\t\t\t\t} },\n\t\t\t\tnew Node { Data = 6, Children = null }\n\t\t\t}\n\t\t};\n\t\t\n\t\t[Test]\n\t\tpublic void PreOrder()\n\t\t{\n\t\t\tAssert.AreEqual(new int[] { 1, 2, 3, 4, 5, 6 },\n\t\t\t                TreeTraversal.PreOrder(tree, n => n.Children).Select(n => n.Data).ToArray());\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic void PostOrder()\n\t\t{\n\t\t\tAssert.AreEqual(new int[] { 2, 4, 5, 3, 6, 1 },\n\t\t\t                TreeTraversal.PostOrder(tree, n => n.Children).Select(n => n.Data).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlAttribute.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Name-value pair in a tag\n\t/// </summary>\n\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1711:IdentifiersShouldNotHaveIncorrectSuffix\")]\n\tpublic class AXmlAttribute : AXmlObject\n\t{\n\t\tinternal AXmlAttribute(AXmlObject parent, int startOffset, InternalAttribute internalObject)\n\t\t\t: base(parent, startOffset, internalObject)\n\t\t{\n\t\t}\n\t\t\n\t\tinternal InternalAttribute InternalAttribute {\n\t\t\tget { return (InternalAttribute)internalObject; }\n\t\t}\n\t\t\n\t\t/// <summary> Name with namespace prefix - exactly as in source file </summary>\n\t\tpublic string Name { get { return InternalAttribute.Name; } }\n\t\t\n\t\t/// <summary> Unquoted and dereferenced value of the attribute </summary>\n\t\tpublic string Value { get { return InternalAttribute.Value; } }\n\t\t\n\t\t/// <summary>Gets the segment for the attribute name</summary>\n\t\tpublic ISegment NameSegment {\n\t\t\tget { return new XmlSegment(startOffset, startOffset + Name.Length); }\n\t\t}\n\t\t\n\t\t/// <summary>Gets the segment for the attribute value, including the quotes</summary>\n\t\tpublic ISegment ValueSegment {\n\t\t\tget { return new XmlSegment(startOffset + Name.Length + InternalAttribute.EqualsSignLength, this.EndOffset); }\n\t\t}\n\t\t/// <summary> The element containing this attribute </summary>\n\t\t/// <returns> Null if orphaned </returns>\n\t\tpublic AXmlElement ParentElement {\n\t\t\tget {\n\t\t\t\tAXmlTag tag = this.Parent as AXmlTag;\n\t\t\t\tif (tag != null) {\n\t\t\t\t\treturn tag.Parent as AXmlElement;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> The part of name before \":\"</summary>\n\t\t/// <returns> Empty string if not found </returns>\n\t\tpublic string Prefix {\n\t\t\tget {\n\t\t\t\treturn GetNamespacePrefix(this.Name);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> The part of name after \":\" </summary>\n\t\t/// <returns> Whole name if \":\" not found </returns>\n\t\tpublic string LocalName {\n\t\t\tget {\n\t\t\t\treturn GetLocalName(this.Name);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Resolved namespace of the name.  Empty string if not found\n\t\t/// From the specification: \"The namespace name for an unprefixed attribute name always has no value.\"\n\t\t/// </summary>\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\tif (string.IsNullOrEmpty(this.Prefix)) return NoNamespace;\n\t\t\t\t\n\t\t\t\tAXmlElement elem = this.ParentElement;\n\t\t\t\tif (elem != null) {\n\t\t\t\t\treturn elem.LookupNamespace(this.Prefix) ?? NoNamespace;\n\t\t\t\t}\n\t\t\t\treturn NoNamespace; // Orphaned attribute\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> Attribute is declaring namespace (\"xmlns\" or \"xmlns:*\") </summary>\n\t\tpublic bool IsNamespaceDeclaration {\n\t\t\tget {\n\t\t\t\treturn this.Name == \"xmlns\" || this.Prefix == \"xmlns\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override void AcceptVisitor(AXmlVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitAttribute(this);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} '{1}={2}']\", base.ToString(), this.Name, this.Value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlDocument.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing System.Xml;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// The root object of the XML document\n\t/// </summary>\n\tpublic class AXmlDocument : AXmlObject\n\t{\n\t\tinternal AXmlDocument(AXmlObject parent, int startOffset, InternalDocument internalObject)\n\t\t\t: base(parent, startOffset, internalObject)\n\t\t{\n\t\t}\n\t\t\n\t\tinternal override ObjectIterator CreateIteratorForReader()\n\t\t{\n\t\t\treturn new ObjectIterator(internalObject.NestedObjects, startOffset);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override void AcceptVisitor(AXmlVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitDocument(this);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} Chld:{1}]\", base.ToString(), this.Children.Count);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Represents an empty document.\n\t\t/// </summary>\n\t\tpublic readonly static AXmlDocument Empty = new AXmlDocument(null, 0, new InternalDocument());\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlElement.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Xml;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// XML element.\n\t/// </summary>\n\tpublic class AXmlElement : AXmlObject, IXmlNamespaceResolver\n\t{\n\t\tinternal AXmlElement(AXmlObject parent, int startOffset, InternalElement internalObject)\n\t\t\t: base(parent, startOffset, internalObject)\n\t\t{\n\t\t\tLog.Assert(internalObject.NestedObjects[0] is InternalTag, \"First child of element must be start tag\");\n\t\t}\n\t\t\n\t\t/// <summary> No tags are missing anywhere within this element (recursive) </summary>\n\t\tpublic bool IsProperlyNested {\n\t\t\tget { return ((InternalElement)internalObject).IsPropertyNested; }\n\t\t}\n\t\t\n\t\t/// <summary>The start or empty-element tag for this element.</summary>\n\t\tpublic AXmlTag StartTag {\n\t\t\tget { return (AXmlTag)this.Children[0]; }\n\t\t}\n\t\t\n\t\t/// <summary>Name with namespace prefix - exactly as in source</summary>\n\t\tpublic string Name {\n\t\t\tget { return ((InternalTag)internalObject.NestedObjects[0]).Name; }\n\t\t}\n\t\t\n\t\t/// <summary>Gets whether an end tag exists for this node.</summary>\n\t\tpublic bool HasEndTag {\n\t\t\tget { return ((InternalElement)internalObject).HasEndTag; }\n\t\t}\n\t\t\n\t\t/// <summary> The end tag, if there is any. Returns null for empty elements \"&lt;Element/>\" and missing end tags in malformed XML.</summary>\n\t\tpublic AXmlTag EndTag {\n\t\t\tget {\n\t\t\t\tif (HasEndTag)\n\t\t\t\t\treturn (AXmlTag)this.Children[this.Children.Count - 1];\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attributes.\n\t\t/// </summary>\n\t\tpublic IEnumerable<AXmlAttribute> Attributes {\n\t\t\tget {\n\t\t\t\treturn ((AXmlTag)this.Children[0]).Children.OfType<AXmlAttribute>();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the content (all children except for the start and end tags)\n\t\t/// </summary>\n\t\tpublic IEnumerable<AXmlObject> Content {\n\t\t\tget {\n\t\t\t\tint end = this.Children.Count;\n\t\t\t\tif (HasEndTag)\n\t\t\t\t\tend--;\n\t\t\t\tfor (int i = 1; i < end; i++) {\n\t\t\t\t\tyield return this.Children[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> The part of name before \":\" </summary>\n\t\t/// <returns> Empty string if not found </returns>\n\t\tpublic string Prefix {\n\t\t\tget { return ((InternalElement)internalObject).Prefix; }\n\t\t}\n\t\t\n\t\t/// <summary> The part of name after \":\" </summary>\n\t\t/// <returns> Empty string if not found </returns>\n\t\tpublic string LocalName {\n\t\t\tget { return ((InternalElement)internalObject).LocalName; }\n\t\t}\n\t\t\n\t\t/// <summary> Resolved namespace of the name </summary>\n\t\t/// <returns> Empty string if prefix is not found </returns>\n\t\tpublic string Namespace {\n\t\t\tget {\n\t\t\t\tstring prefix = this.Prefix;\n\t\t\t\treturn LookupNamespace(prefix);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> Find the default namespace for this context </summary>\n\t\t[Obsolete(\"Use LookupNamespace(string.Empty) instead\")]\n\t\tpublic string FindDefaultNamespace()\n\t\t{\n\t\t\treturn LookupNamespace(string.Empty) ?? NoNamespace;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Recursively resolve given prefix in this context.  Prefix must have some value.\n\t\t/// </summary>\n\t\t/// <returns> Empty string if prefix is not found </returns>\n\t\t[Obsolete(\"Use LookupNamespace() instead\")]\n\t\tpublic string ResolvePrefix(string prefix)\n\t\t{\n\t\t\treturn LookupNamespace(prefix) ?? NoNamespace;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Recursively resolve given prefix in this context.\n\t\t/// </summary>\n\t\t/// <returns><c>null</c> if prefix is not found</returns>\n\t\tpublic string LookupNamespace(string prefix)\n\t\t{\n\t\t\tif (prefix == null)\n\t\t\t\tthrow new ArgumentNullException(\"prefix\");\n\t\t\t\n\t\t\t// Implicit namespaces\n\t\t\tif (prefix == \"xml\") return XmlNamespace;\n\t\t\tif (prefix == \"xmlns\") return XmlnsNamespace;\n\t\t\t\n\t\t\tstring lookFor = (prefix.Length > 0 ? \"xmlns:\" + prefix : \"xmlns\");\n\t\t\tfor (AXmlElement current = this; current != null; current = current.Parent as AXmlElement) {\n\t\t\t\tforeach (var attr in current.Attributes) {\n\t\t\t\t\tif (attr.Name == lookFor)\n\t\t\t\t\t\treturn attr.Value;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null; // Can not find prefix\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the prefix that is mapped to the specified namespace URI.\n\t\t/// </summary>\n\t\t/// <returns>The prefix that is mapped to the namespace URI; null if the namespace URI is not mapped to a prefix.</returns>\n\t\tpublic string LookupPrefix(string namespaceName)\n\t\t{\n\t\t\tif (namespaceName == null)\n\t\t\t\tthrow new ArgumentNullException(\"namespaceName\");\n\t\t\t\n\t\t\tif (namespaceName == XmlNamespace)\n\t\t\t\treturn \"xml\";\n\t\t\tif (namespaceName == XmlnsNamespace)\n\t\t\t\treturn \"xmlns\";\n\t\t\tfor (AXmlElement current = this; current != null; current = current.Parent as AXmlElement) {\n\t\t\t\tforeach (var attr in current.Attributes) {\n\t\t\t\t\tif (attr.Value == namespaceName) {\n\t\t\t\t\t\tif (attr.Name.StartsWith(\"xmlns:\", StringComparison.Ordinal))\n\t\t\t\t\t\t\treturn attr.LocalName;\n\t\t\t\t\t\telse if (attr.Name == \"xmlns\")\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null; // Can not find prefix\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a collection of defined prefix-namespace mappings that are currently in scope.\n\t\t/// </summary>\n\t\tpublic IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)\n\t\t{\n\t\t\tvar result = new Dictionary<string, string>();\n\t\t\tif (scope == XmlNamespaceScope.All) {\n\t\t\t\tresult[\"xml\"] = XmlNamespace;\n\t\t\t\t//result[\"xmlns\"] = XmlnsNamespace; xmlns should not be included in GetNamespacesInScope() results\n\t\t\t}\n\t\t\tfor (AXmlElement current = this; current != null; current = current.Parent as AXmlElement) {\n\t\t\t\tforeach (var attr in current.Attributes) {\n\t\t\t\t\tif (attr.Name.StartsWith(\"xmlns:\", StringComparison.Ordinal)) {\n\t\t\t\t\t\tstring prefix = attr.LocalName;\n\t\t\t\t\t\tif (!result.ContainsKey(prefix)) {\n\t\t\t\t\t\t\tresult.Add(prefix, attr.Value);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (attr.Name == \"xmlns\" && !result.ContainsKey(string.Empty)) {\n\t\t\t\t\t\tresult.Add(string.Empty, attr.Value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (scope == XmlNamespaceScope.Local)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Get unquoted value of attribute.\n\t\t/// It looks in the no namespace (empty string).\n\t\t/// </summary>\n\t\t/// <returns>Null if not found</returns>\n\t\tpublic string GetAttributeValue(string localName)\n\t\t{\n\t\t\treturn GetAttributeValue(string.Empty, localName);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Get unquoted value of attribute\n\t\t/// </summary>\n\t\t/// <param name=\"namespace\">Namespace.  Can be no namepace (empty string), which is the default for attributes.</param>\n\t\t/// <param name=\"localName\">Local name - text after \":\"</param>\n\t\t/// <returns>Null if not found</returns>\n\t\tpublic string GetAttributeValue(string @namespace, string localName)\n\t\t{\n\t\t\t@namespace = @namespace ?? string.Empty;\n\t\t\tforeach (AXmlAttribute attr in this.Attributes) {\n\t\t\t\tif (attr.LocalName == localName && attr.Namespace == @namespace)\n\t\t\t\t\treturn attr.Value;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override void AcceptVisitor(AXmlVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitElement(this);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} '{1}' Attr:{2} Chld:{3} Nest:{4}]\", base.ToString(), this.Name, this.StartTag.Children.Count, this.Children.Count, this.IsProperlyNested ? \"Ok\" : \"Bad\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlObject.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// XML object. Base class for all nodes in the XML document.\n\t/// </summary>\n\tpublic abstract class AXmlObject : ISegment\n\t{\n\t\t/// <summary> Empty string.  The namespace used if there is no \"xmlns\" specified </summary>\n\t\tinternal static readonly string NoNamespace = string.Empty;\n\t\t\n\t\t/// <summary> Namespace for \"xml:\" prefix: \"http://www.w3.org/XML/1998/namespace\" </summary>\n\t\tpublic static readonly string XmlNamespace = \"http://www.w3.org/XML/1998/namespace\";\n\t\t\n\t\t/// <summary> Namesapce for \"xmlns:\" prefix: \"http://www.w3.org/2000/xmlns/\" </summary>\n\t\tpublic static readonly string XmlnsNamespace = \"http://www.w3.org/2000/xmlns/\";\n\t\t\n\t\treadonly AXmlObject parent;\n\t\tinternal readonly int startOffset;\n\t\tinternal readonly InternalObject internalObject;\n\t\tIList<AXmlObject> children;\n\t\t\n\t\tinternal AXmlObject(AXmlObject parent, int startOffset, InternalObject internalObject)\n\t\t{\n\t\t\tthis.parent = parent;\n\t\t\tthis.startOffset = startOffset;\n\t\t\tthis.internalObject = internalObject;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an XML reader that reads from this document.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// The reader will ignore comments and processing instructions; and will not have line information.\n\t\t/// </remarks>\n\t\tpublic XmlReader CreateReader()\n\t\t{\n\t\t\treturn new AXmlReader(CreateIteratorForReader());\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an XML reader that reads from this document.\n\t\t/// </summary>\n\t\t/// <param name=\"settings\">Reader settings.\n\t\t/// Currently, only <c>IgnoreComments</c> is supported.</param>\n\t\t/// <remarks>\n\t\t/// The reader will not have line information.\n\t\t/// </remarks>\n\t\tpublic XmlReader CreateReader(XmlReaderSettings settings)\n\t\t{\n\t\t\treturn new AXmlReader(CreateIteratorForReader(), settings);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an XML reader that reads from this document.\n\t\t/// </summary>\n\t\t/// <param name=\"settings\">Reader settings.\n\t\t/// Currently, only <c>IgnoreComments</c> is supported.</param>\n\t\t/// <param name=\"document\">\n\t\t/// The document that was used to parse the XML. It is used to convert offsets to line information.\n\t\t/// </param>\n\t\tpublic XmlReader CreateReader(XmlReaderSettings settings, IDocument document)\n\t\t{\n\t\t\tif (document == null)\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\treturn new AXmlReader(CreateIteratorForReader(), settings, document.GetLocation);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates an XML reader that reads from this document.\n\t\t/// </summary>\n\t\t/// <param name=\"settings\">Reader settings.\n\t\t/// Currently, only <c>IgnoreComments</c> is supported.</param>\n\t\t/// <param name=\"offsetToTextLocation\">\n\t\t/// A function for converting offsets to line information.\n\t\t/// </param>\n\t\tpublic XmlReader CreateReader(XmlReaderSettings settings, Func<int, TextLocation> offsetToTextLocation)\n\t\t{\n\t\t\treturn new AXmlReader(CreateIteratorForReader(), settings, offsetToTextLocation);\n\t\t}\n\t\t\n\t\tinternal virtual ObjectIterator CreateIteratorForReader()\n\t\t{\n\t\t\treturn new ObjectIterator(new[] { internalObject }, startOffset);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the parent node.\n\t\t/// </summary>\n\t\tpublic AXmlObject Parent {\n\t\t\tget { return parent; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the list of child objects.\n\t\t/// </summary>\n\t\tpublic IList<AXmlObject> Children {\n\t\t\tget {\n\t\t\t\tvar result = LazyInit.VolatileRead(ref this.children);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\tif (internalObject.NestedObjects != null) {\n\t\t\t\t\t\tvar array = new AXmlObject[internalObject.NestedObjects.Length];\n\t\t\t\t\t\tfor (int i = 0; i < array.Length; i++) {\n\t\t\t\t\t\t\tarray[i] = internalObject.NestedObjects[i].CreatePublicObject(this, startOffset);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult = Array.AsReadOnly(array);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = EmptyList<AXmlObject>.Instance;\n\t\t\t\t\t}\n\t\t\t\t\treturn LazyInit.GetOrSet(ref this.children, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a child fully containg the given offset.\n\t\t/// Goes recursively down the tree.\n\t\t/// Special case if at the end of attribute or text\n\t\t/// </summary>\n\t\tpublic AXmlObject GetChildAtOffset(int offset)\n\t\t{\n\t\t\tforeach(AXmlObject child in this.Children) {\n\t\t\t\tif (offset == child.EndOffset && (child is AXmlAttribute || child is AXmlText))\n\t\t\t\t\treturn child;\n\t\t\t\tif (child.StartOffset < offset && offset < child.EndOffset) {\n\t\t\t\t\treturn child.GetChildAtOffset(offset);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this; // No children at offset\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The error that occured in the context of this node (excluding nested nodes)\n\t\t/// </summary>\n\t\tpublic IEnumerable<SyntaxError> MySyntaxErrors {\n\t\t\tget {\n\t\t\t\tif (internalObject.SyntaxErrors != null) {\n\t\t\t\t\treturn internalObject.SyntaxErrors.Select(e => new SyntaxError(startOffset + e.RelativeStart, startOffset + e.RelativeEnd, e.Description));\n\t\t\t\t} else {\n\t\t\t\t\treturn EmptyList<SyntaxError>.Instance;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// The error that occured in the context of this node and all nested nodes.\n\t\t/// It has O(n) cost.\n\t\t/// </summary>\n\t\tpublic IEnumerable<SyntaxError> SyntaxErrors {\n\t\t\tget {\n\t\t\t\treturn TreeTraversal.PreOrder(this, n => n.Children).SelectMany(obj => obj.MySyntaxErrors);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> Get all ancestors of this node </summary>\n\t\tpublic IEnumerable<AXmlObject> Ancestors {\n\t\t\tget {\n\t\t\t\tAXmlObject curr = this.Parent;\n\t\t\t\twhile(curr != null) {\n\t\t\t\t\tyield return curr;\n\t\t\t\t\tcurr = curr.Parent;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t#region Helper methods\n\t\t\n\t\t/// <summary> The part of name before \":\" </summary>\n\t\t/// <returns> Empty string if not found </returns>\n\t\tinternal static string GetNamespacePrefix(string name)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(name)) return string.Empty;\n\t\t\tint colonIndex = name.IndexOf(':');\n\t\t\tif (colonIndex != -1) {\n\t\t\t\treturn name.Substring(0, colonIndex);\n\t\t\t} else {\n\t\t\t\treturn string.Empty;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> The part of name after \":\" </summary>\n\t\t/// <returns> Whole name if \":\" not found </returns>\n\t\tinternal static string GetLocalName(string name)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(name)) return string.Empty;\n\t\t\tint colonIndex = name.IndexOf(':');\n\t\t\tif (colonIndex != -1) {\n\t\t\t\treturn name.Remove(0, colonIndex + 1);\n\t\t\t} else {\n\t\t\t\treturn name ?? string.Empty;\n\t\t\t}\n\t\t}\n\t\t\n\t\t#endregion\n\t\t\n\t\t/// <summary> Call appropriate visit method on the given visitor </summary>\n\t\tpublic abstract void AcceptVisitor(AXmlVisitor visitor);\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the start offset of the segment.\n\t\t/// </summary>\n\t\tpublic int StartOffset {\n\t\t\tget { return startOffset; }\n\t\t}\n\t\t\n\t\tint ISegment.Offset {\n\t\t\tget { return startOffset; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int Length {\n\t\t\tget { return internalObject.Length; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int EndOffset {\n\t\t\tget { return startOffset + internalObject.Length; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlParser.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// XML parser that is error tolerant.\n\t/// </summary>\n\tpublic class AXmlParser\n\t{\n\t\t/// <summary>\n\t\t/// Generate syntax error when seeing entity reference other then the built-in ones\n\t\t/// </summary>\n\t\tpublic bool UnknownEntityReferenceIsError { get; set; }\n\t\t\n\t\tIList<AXmlObject> CreatePublic(IList<InternalObject> internalObjects)\n\t\t{\n\t\t\tvar publicObjects = new AXmlObject[internalObjects.Count];\n\t\t\tint pos = 0;\n\t\t\tfor (int i = 0; i < internalObjects.Count; i++) {\n\t\t\t\tpublicObjects[i] = internalObjects[i].CreatePublicObject(null, pos);\n\t\t\t\tpos += internalObjects[i].Length;\n\t\t\t}\n\t\t\treturn Array.AsReadOnly(publicObjects);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Parses a document into a flat list of tags.\n\t\t/// </summary>\n\t\t/// <returns>Parsed tag soup.</returns>\n\t\tpublic IList<AXmlObject> ParseTagSoup(ITextSource textSource,\n\t\t                                      CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (textSource == null)\n\t\t\t\tthrow new ArgumentNullException(\"textSource\");\n\t\t\tvar reader = new TagReader(this, textSource, false);\n\t\t\tvar internalObjects = reader.ReadAllObjects(cancellationToken);\n\t\t\treturn CreatePublic(internalObjects);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Parses a document incrementally into a flat list of tags.\n\t\t/// </summary>\n\t\t/// <param name=\"oldParserState\">The parser state from a previous call to ParseIncremental(). Use null for the first call.</param>\n\t\t/// <param name=\"newTextSource\">The text source for the new document version.</param>\n\t\t/// <param name=\"newParserState\">Out: the new parser state, pass this to the next ParseIncremental() call.</param>\n\t\t/// <param name=\"cancellationToken\">Optional: cancellation token.</param>\n\t\t/// <returns>Parsed tag soup.</returns>\n\t\tpublic IList<AXmlObject> ParseTagSoupIncremental(\n\t\t\tIncrementalParserState oldParserState, ITextSource newTextSource, out IncrementalParserState newParserState,\n\t\t\tCancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (newTextSource == null)\n\t\t\t\tthrow new ArgumentNullException(\"newTextSource\");\n\t\t\tvar internalObjects = InternalParseIncremental(oldParserState, newTextSource, out newParserState, false, cancellationToken);\n\t\t\treturn CreatePublic(internalObjects);\n\t\t}\n\t\t\n\t\tList<InternalObject> InternalParseIncremental(\n\t\t\tIncrementalParserState oldParserState, ITextSource newTextSource, out IncrementalParserState newParserState,\n\t\t\tbool collapseProperlyNestedElements, CancellationToken cancellationToken)\n\t\t{\n\t\t\tvar reader = new TagReader(this, newTextSource, collapseProperlyNestedElements);\n\t\t\tITextSourceVersion newVersion = newTextSource.Version;\n\t\t\tvar reuseMap = oldParserState != null ? oldParserState.GetReuseMapTo(newVersion) : null;\n\t\t\t\n\t\t\tList<InternalObject> internalObjects;\n\t\t\tif (reuseMap != null)\n\t\t\t\tinternalObjects = reader.ReadAllObjectsIncremental(oldParserState.Objects, reuseMap, cancellationToken);\n\t\t\telse\n\t\t\t\tinternalObjects = reader.ReadAllObjects(cancellationToken);\n\t\t\t\n\t\t\tif (newVersion != null)\n\t\t\t\tnewParserState = new IncrementalParserState(newTextSource.TextLength, newVersion, internalObjects.ToArray());\n\t\t\telse\n\t\t\t\tnewParserState = null;\n\t\t\t\n\t\t\treturn internalObjects;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Parses a document.\n\t\t/// </summary>\n\t\tpublic AXmlDocument Parse(ITextSource textSource, CancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (textSource == null)\n\t\t\t\tthrow new ArgumentNullException(\"textSource\");\n\t\t\tvar reader = new TagReader(this, textSource, true);\n\t\t\tvar internalObjects = reader.ReadAllObjects(cancellationToken);\n\t\t\tvar heuristic = new TagMatchingHeuristics(textSource);\n\t\t\treturn new AXmlDocument(null, 0, heuristic.CreateDocument(internalObjects, cancellationToken));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Parses a document incrementally into a flat list of tags.\n\t\t/// </summary>\n\t\t/// <param name=\"oldParserState\">The parser state from a previous call to ParseIncremental(). Use null for the first call.</param>\n\t\t/// <param name=\"newTextSource\">The text source for the new document version.</param>\n\t\t/// <param name=\"newParserState\">Out: the new parser state, pass this to the next ParseIncremental() call.</param>\n\t\t/// <param name=\"cancellationToken\">Optional: cancellation token.</param>\n\t\t/// <returns>Parsed tag soup.</returns>\n\t\tpublic AXmlDocument ParseIncremental(\n\t\t\tIncrementalParserState oldParserState, ITextSource newTextSource, out IncrementalParserState newParserState,\n\t\t\tCancellationToken cancellationToken = default(CancellationToken))\n\t\t{\n\t\t\tif (newTextSource == null)\n\t\t\t\tthrow new ArgumentNullException(\"newTextSource\");\n\t\t\tvar internalObjects = InternalParseIncremental(oldParserState, newTextSource, out newParserState, true, cancellationToken);\n\t\t\tvar heuristic = new TagMatchingHeuristics(newTextSource);\n\t\t\treturn new AXmlDocument(null, 0, heuristic.CreateDocument(internalObjects, cancellationToken));\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Checks whether the given name is a valid XML name.\n\t\t/// </summary>\n\t\tpublic static bool IsValidXmlName(string name)\n\t\t{\n\t\t\tif (string.IsNullOrWhiteSpace(name))\n\t\t\t\tthrow new ArgumentException(\"The XML name cannot be null, empty or consist solely of white space\", \"name\");\n\t\t\treturn TagReader.IsValidName(name);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlReader.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Xml;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// XmlReader implementation that reads from an <see cref=\"AXmlDocument\"/>.\n\t/// </summary>\n\tsealed class AXmlReader : XmlReader, IXmlLineInfo\n\t{\n\t\treadonly ObjectIterator objectIterator;\n\t\treadonly XmlReaderSettings settings;\n\t\tFunc<int, TextLocation> offsetToTextLocation;\n\t\treadonly XmlNameTable nameTable;\n\t\treadonly XmlNamespaceManager nsManager;\n\t\tReadState readState = ReadState.Initial;\n\t\tXmlNodeType elementNodeType = XmlNodeType.None;\n\t\tIList<InternalAttribute> attributes;\n\t\tint attributeIndex = -1;\n\t\tbool inAttributeValue;\n\t\t\n\t\tinternal AXmlReader(ObjectIterator objectIterator, XmlReaderSettings settings = null, Func<int, TextLocation> offsetToTextLocation = null)\n\t\t{\n\t\t\tthis.objectIterator = objectIterator;\n\t\t\tthis.settings = settings ?? new XmlReaderSettings();\n\t\t\tthis.offsetToTextLocation = offsetToTextLocation;\n\t\t\tthis.nameTable = this.settings.NameTable ?? new NameTable();\n\t\t\tthis.nsManager = new XmlNamespaceManager(this.nameTable);\n\t\t\tobjectIterator.StopAtElementEnd = true;\n\t\t}\n\t\t\n\t\tpublic override void ResolveEntity()\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t\t\n\t\tpublic override ReadState ReadState {\n\t\t\tget { return readState; }\n\t\t}\n\t\t\n\t\tpublic override XmlReaderSettings Settings {\n\t\t\tget { return settings; }\n\t\t}\n\t\t\n\t\tpublic override bool ReadAttributeValue()\n\t\t{\n\t\t\tif (attributeIndex >= 0 && !inAttributeValue) {\n\t\t\t\tinAttributeValue = true;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic override bool Read()\n\t\t{\n\t\t\tswitch (readState) {\n\t\t\t\tcase ReadState.Initial:\n\t\t\t\t\treadState = ReadState.Interactive;\n\t\t\t\t\treturn ReadCurrentPosition();\n\t\t\t\tcase ReadState.Interactive:\n\t\t\t\t\tLeaveNode();\n\t\t\t\t\tobjectIterator.MoveInto();\n\t\t\t\t\treturn ReadCurrentPosition();\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool ReadCurrentPosition()\n\t\t{\n\t\t\tattributes = null;\n\t\t\tattributeIndex = -1;\n\t\t\tinAttributeValue = false;\n\t\t\twhile (true) {\n\t\t\t\tvar obj = objectIterator.CurrentObject;\n\t\t\t\tif (obj == null) {\n\t\t\t\t\treadState = ReadState.EndOfFile;\n\t\t\t\t\telementNodeType = XmlNodeType.None;\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (objectIterator.IsAtElementEnd) {\n\t\t\t\t\tif (IsEmptyElement) {\n\t\t\t\t\t\t// Don't report EndElement for empty elements\n\t\t\t\t\t\tnsManager.PopScope();\n\t\t\t\t\t} else {\n\t\t\t\t\t\telementNodeType = XmlNodeType.EndElement;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else if (obj is InternalElement) {\n\t\t\t\t\t// element start\n\t\t\t\t\telementNodeType = XmlNodeType.Element;\n\t\t\t\t\tInternalTag startTag = ((InternalTag)obj.NestedObjects[0]);\n\t\t\t\t\tnsManager.PushScope();\n\t\t\t\t\tif (startTag.NestedObjects != null) {\n\t\t\t\t\t\tattributes = startTag.NestedObjects.OfType<InternalAttribute>().ToList();\n\t\t\t\t\t\tfor (int i = 0; i < attributes.Count; i++) {\n\t\t\t\t\t\t\tvar attr = attributes[i];\n\t\t\t\t\t\t\tif (attr.Name.StartsWith(\"xmlns:\", StringComparison.Ordinal))\n\t\t\t\t\t\t\t\tnsManager.AddNamespace(AXmlObject.GetLocalName(attr.Name), attr.Value);\n\t\t\t\t\t\t\telse if (attr.Name == \"xmlns\")\n\t\t\t\t\t\t\t\tnsManager.AddNamespace(string.Empty, attr.Value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (obj is InternalText) {\n\t\t\t\t\tInternalText text = (InternalText)obj;\n\t\t\t\t\tif (text.ContainsOnlyWhitespace) {\n\t\t\t\t\t\telementNodeType = XmlNodeType.Whitespace;\n\t\t\t\t\t} else {\n\t\t\t\t\t\telementNodeType = XmlNodeType.Text;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (obj is InternalTag) {\n\t\t\t\t\tInternalTag tag = (InternalTag)obj;\n\t\t\t\t\tif (tag.IsStartOrEmptyTag || tag.IsEndTag) {\n\t\t\t\t\t\t// start/end tags can be skipped as the parent InternalElement already handles them\n\t\t\t\t\t} else if (tag.IsComment && !settings.IgnoreComments) {\n\t\t\t\t\t\telementNodeType = XmlNodeType.Comment;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (tag.IsProcessingInstruction && !settings.IgnoreProcessingInstructions) {\n\t\t\t\t\t\tif (tag.Name == \"xml\") {\n\t\t\t\t\t\t\telementNodeType = XmlNodeType.XmlDeclaration;\n\t\t\t\t\t\t\tattributes = tag.NestedObjects.OfType<InternalAttribute>().ToList();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telementNodeType = XmlNodeType.ProcessingInstruction;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else if (tag.IsCData) {\n\t\t\t\t\t\telementNodeType = XmlNodeType.CDATA;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// TODO all other tags\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new NotSupportedException();\n\t\t\t\t}\n\t\t\t\tobjectIterator.MoveInto();\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid LeaveNode()\n\t\t{\n\t\t\tif (elementNodeType == XmlNodeType.EndElement) {\n\t\t\t\tnsManager.PopScope();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void Skip()\n\t\t{\n\t\t\tif (readState == ReadState.Interactive) {\n\t\t\t\tMoveToElement();\n\t\t\t\tLeaveNode();\n\t\t\t\tobjectIterator.MoveNext();\n\t\t\t\tReadCurrentPosition();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string Prefix {\n\t\t\tget {\n\t\t\t\tif (readState != ReadState.Interactive)\n\t\t\t\t\treturn string.Empty;\n\t\t\t\tif (attributeIndex >= 0) {\n\t\t\t\t\tif (inAttributeValue)\n\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\treturn nameTable.Add(AXmlObject.GetNamespacePrefix(attributes[attributeIndex].Name));\n\t\t\t\t}\n\t\t\t\tInternalElement element = objectIterator.CurrentObject as InternalElement;\n\t\t\t\treturn element != null ? nameTable.Add(element.Prefix) : string.Empty;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string NamespaceURI {\n\t\t\tget {\n\t\t\t\tif (readState != ReadState.Interactive)\n\t\t\t\t\treturn string.Empty;\n\t\t\t\tif (attributeIndex >= 0 && !inAttributeValue && attributes[attributeIndex].Name == \"xmlns\")\n\t\t\t\t\treturn AXmlObject.XmlnsNamespace;\n\t\t\t\treturn LookupNamespace(this.Prefix) ?? string.Empty;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string LocalName {\n\t\t\tget {\n\t\t\t\tif (readState != ReadState.Interactive)\n\t\t\t\t\treturn string.Empty;\n\t\t\t\tif (attributeIndex >= 0) {\n\t\t\t\t\tif (inAttributeValue)\n\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\treturn nameTable.Add(AXmlObject.GetLocalName(attributes[attributeIndex].Name));\n\t\t\t\t}\n\t\t\t\tstring result;\n\t\t\t\tswitch (elementNodeType) {\n\t\t\t\t\tcase XmlNodeType.Element:\n\t\t\t\t\tcase XmlNodeType.EndElement:\n\t\t\t\t\t\tresult = ((InternalElement)objectIterator.CurrentObject).LocalName;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase XmlNodeType.XmlDeclaration:\n\t\t\t\t\t\tresult = \"xml\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t}\n\t\t\t\treturn nameTable.Add(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\tif (readState != ReadState.Interactive)\n\t\t\t\t\treturn string.Empty;\n\t\t\t\tif (attributeIndex >= 0) {\n\t\t\t\t\tif (inAttributeValue)\n\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\treturn nameTable.Add(attributes[attributeIndex].Name);\n\t\t\t\t}\n\t\t\t\tstring result;\n\t\t\t\tswitch (elementNodeType) {\n\t\t\t\t\tcase XmlNodeType.Element:\n\t\t\t\t\tcase XmlNodeType.EndElement:\n\t\t\t\t\t\tresult = ((InternalElement)objectIterator.CurrentObject).Name;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase XmlNodeType.XmlDeclaration:\n\t\t\t\t\t\tresult = \"xml\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t}\n\t\t\t\treturn nameTable.Add(result);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool IsEmptyElement {\n\t\t\tget {\n\t\t\t\tif (readState != ReadState.Interactive || attributeIndex >= 0)\n\t\t\t\t\treturn false;\n\t\t\t\tInternalElement element = objectIterator.CurrentObject as InternalElement;\n\t\t\t\treturn element != null && element.NestedObjects.Length == 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override string Value {\n\t\t\tget {\n\t\t\t\tif (readState != ReadState.Interactive)\n\t\t\t\t\treturn string.Empty;\n\t\t\t\tif (attributeIndex >= 0)\n\t\t\t\t\treturn attributes[attributeIndex].Value;\n\t\t\t\tswitch (elementNodeType) {\n\t\t\t\t\tcase XmlNodeType.Text:\n\t\t\t\t\tcase XmlNodeType.Whitespace:\n\t\t\t\t\t\treturn ((InternalText)objectIterator.CurrentObject).Value;\n\t\t\t\t\tcase XmlNodeType.Comment:\n\t\t\t\t\tcase XmlNodeType.CDATA:\n\t\t\t\t\t\tvar nestedObjects = objectIterator.CurrentObject.NestedObjects;\n\t\t\t\t\t\tif (nestedObjects.Length == 1)\n\t\t\t\t\t\t\treturn ((InternalText)nestedObjects[0]).Value;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t\tcase XmlNodeType.XmlDeclaration:\n\t\t\t\t\t\tStringBuilder b = new StringBuilder();\n\t\t\t\t\t\tforeach (var attr in objectIterator.CurrentObject.NestedObjects.OfType<InternalAttribute>()) {\n\t\t\t\t\t\t\tif (b.Length > 0)\n\t\t\t\t\t\t\t\tb.Append(' ');\n\t\t\t\t\t\t\tb.Append(attr.Name);\n\t\t\t\t\t\t\tb.Append('=');\n\t\t\t\t\t\t\tb.Append('\"');\n\t\t\t\t\t\t\tb.Append(attr.Value);\n\t\t\t\t\t\t\tb.Append('\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn b.ToString();\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn string.Empty;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override bool HasValue {\n\t\t\tget {\n\t\t\t\tif (readState != ReadState.Interactive)\n\t\t\t\t\treturn false;\n\t\t\t\tif (attributeIndex >= 0)\n\t\t\t\t\treturn true;\n\t\t\t\tswitch (elementNodeType) {\n\t\t\t\t\tcase XmlNodeType.Text:\n\t\t\t\t\tcase XmlNodeType.Whitespace:\n\t\t\t\t\tcase XmlNodeType.Comment:\n\t\t\t\t\tcase XmlNodeType.XmlDeclaration:\n\t\t\t\t\tcase XmlNodeType.CDATA:\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override XmlNodeType NodeType {\n\t\t\tget {\n\t\t\t\tif (attributeIndex >= 0)\n\t\t\t\t\treturn inAttributeValue ? XmlNodeType.Text : XmlNodeType.Attribute;\n\t\t\t\telse\n\t\t\t\t\treturn elementNodeType;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override XmlNameTable NameTable {\n\t\t\tget { return nameTable; }\n\t\t}\n\t\t\n\t\tpublic override bool MoveToFirstAttribute()\n\t\t{\n\t\t\treturn DoMoveToAttribute(0);\n\t\t}\n\t\t\n\t\tpublic override bool MoveToNextAttribute()\n\t\t{\n\t\t\treturn DoMoveToAttribute(attributeIndex + 1);\n\t\t}\n\t\t\n\t\tpublic override void MoveToAttribute(int i)\n\t\t{\n\t\t\tif (!DoMoveToAttribute(i))\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"i\");\n\t\t}\n\t\t\n\t\tbool DoMoveToAttribute(int i)\n\t\t{\n\t\t\tif (i >= 0 && i < this.AttributeCount) {\n\t\t\t\tattributeIndex = i;\n\t\t\t\tinAttributeValue = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tpublic override bool MoveToElement()\n\t\t{\n\t\t\tif (attributeIndex >= 0) {\n\t\t\t\tattributeIndex = -1;\n\t\t\t\tinAttributeValue = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tint GetAttributeIndex(string name)\n\t\t{\n\t\t\tif (attributes == null)\n\t\t\t\treturn -1;\n\t\t\tfor (int i = 0; i < attributes.Count; i++) {\n\t\t\t\tif (attributes[i].Name == name)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tint GetAttributeIndex(string name, string ns)\n\t\t{\n\t\t\tif (attributes == null)\n\t\t\t\treturn -1;\n\t\t\tfor (int i = 0; i < attributes.Count; i++) {\n\t\t\t\tif (AXmlObject.GetLocalName(attributes[i].Name) == name && (LookupNamespace(AXmlObject.GetNamespacePrefix(attributes[i].Name)) ?? string.Empty) == ns)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tpublic override bool MoveToAttribute(string name, string ns)\n\t\t{\n\t\t\treturn DoMoveToAttribute(GetAttributeIndex(name, ns));\n\t\t}\n\t\t\n\t\tpublic override bool MoveToAttribute(string name)\n\t\t{\n\t\t\treturn DoMoveToAttribute(GetAttributeIndex(name));\n\t\t}\n\t\t\n\t\tpublic override string LookupNamespace(string prefix)\n\t\t{\n\t\t\treturn nsManager.LookupNamespace(prefix);\n\t\t}\n\t\t\n\t\tpublic override string GetAttribute(int i)\n\t\t{\n\t\t\tif (attributes == null || i < 0 || i >= attributes.Count)\n\t\t\t\treturn null;\n\t\t\treturn attributes[i].Value;\n\t\t}\n\t\t\n\t\tpublic override string GetAttribute(string name, string namespaceURI)\n\t\t{\n\t\t\treturn GetAttribute(GetAttributeIndex(name, namespaceURI));\n\t\t}\n\t\t\n\t\tpublic override string GetAttribute(string name)\n\t\t{\n\t\t\treturn GetAttribute(GetAttributeIndex(name));\n\t\t}\n\t\t\n\t\tpublic override bool EOF {\n\t\t\tget { return readState == ReadState.EndOfFile; }\n\t\t}\n\t\t\n\t\tpublic override int Depth {\n\t\t\tget {\n\t\t\t\tif (attributeIndex < 0)\n\t\t\t\t\treturn objectIterator.Depth;\n\t\t\t\telse\n\t\t\t\t\treturn objectIterator.Depth + (inAttributeValue ? 2 : 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic override void Close()\n\t\t{\n\t\t\treadState = ReadState.Closed;\n\t\t\toffsetToTextLocation = null;\n\t\t}\n\t\t\n\t\tpublic override string BaseURI {\n\t\t\tget { return string.Empty; }\n\t\t}\n\t\t\n\t\tpublic override int AttributeCount {\n\t\t\tget { return attributes != null ? attributes.Count : 0; }\n\t\t}\n\t\t\n\t\tint CurrentPosition {\n\t\t\tget {\n\t\t\t\tif (attributeIndex < 0)\n\t\t\t\t\treturn objectIterator.CurrentPosition;\n\t\t\t\telse\n\t\t\t\t\treturn objectIterator.CurrentPosition + attributes[attributeIndex].StartRelativeToParent;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int LineNumber {\n\t\t\tget {\n\t\t\t\tif (offsetToTextLocation != null)\n\t\t\t\t\treturn offsetToTextLocation(CurrentPosition).Line;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic int LinePosition {\n\t\t\tget {\n\t\t\t\tif (offsetToTextLocation != null)\n\t\t\t\t\treturn offsetToTextLocation(CurrentPosition).Column - 1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\tbool IXmlLineInfo.HasLineInfo()\n\t\t{\n\t\t\treturn offsetToTextLocation != null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlTag.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.ObjectModel;\nusing System.Globalization;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Represents any markup starting with \"&lt;\" and (hopefully) ending with \">\"\n\t/// </summary>\n\tpublic class AXmlTag : AXmlObject\n\t{\n\t\t/// <summary> These identify the start of DTD elements </summary>\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Security\", \"CA2104:DoNotDeclareReadOnlyMutableReferenceTypes\", Justification=\"ReadOnlyCollection is immutable\")]\n\t\tpublic static readonly ReadOnlyCollection<string> DtdNames = new ReadOnlyCollection<string>(\n\t\t\tnew string[] {\"<!DOCTYPE\", \"<!NOTATION\", \"<!ELEMENT\", \"<!ATTLIST\", \"<!ENTITY\" } );\n\t\t\n\t\tnew readonly InternalTag internalObject;\n\t\t\n\t\tinternal AXmlTag(AXmlObject parent, int startOffset, InternalTag internalObject)\n\t\t\t: base(parent, startOffset, internalObject)\n\t\t{\n\t\t\tthis.internalObject = internalObject;\n\t\t}\n\t\t\n\t\t/// <summary> Opening bracket - usually \"&lt;\" </summary>\n\t\tpublic string OpeningBracket {\n\t\t\tget { return internalObject.OpeningBracket; }\n\t\t}\n\t\t\n\t\t/// <summary> Name following the opening bracket </summary>\n\t\tpublic string Name {\n\t\t\tget { return internalObject.Name; }\n\t\t}\n\t\t\n\t\t/// <summary> Gets the segment containing the tag name </summary>\n\t\tpublic ISegment NameSegment {\n\t\t\tget {\n\t\t\t\tint start = startOffset + internalObject.RelativeNameStart;\n\t\t\t\treturn new XmlSegment(start, start + internalObject.Name.Length);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> Closing bracket - usually \"&gt;\" </summary>\n\t\tpublic string ClosingBracket {\n\t\t\tget { return internalObject.ClosingBracket; }\n\t\t}\n\t\t\n\t\t/// <summary> True if tag starts with \"&lt;\" </summary>\n\t\tpublic bool IsStartOrEmptyTag       { get { return internalObject.IsStartOrEmptyTag; } }\n\t\t/// <summary> True if tag starts with \"&lt;\" and ends with \"&gt;\" </summary>\n\t\tpublic bool IsStartTag              { get { return internalObject.IsStartTag; } }\n\t\t/// <summary> True if tag starts with \"&lt;\" and does not end with \"&gt;\" </summary>\n\t\tpublic bool IsEmptyTag              { get { return internalObject.IsEmptyTag; } }\n\t\t/// <summary> True if tag starts with \"&lt;/\" </summary>\n\t\tpublic bool IsEndTag                { get { return internalObject.IsEndTag; } }\n\t\t/// <summary> True if tag starts with \"&lt;?\" </summary>\n\t\tpublic bool IsProcessingInstruction { get { return internalObject.IsProcessingInstruction; } }\n\t\t/// <summary> True if tag starts with \"&lt;!--\" </summary>\n\t\tpublic bool IsComment               { get { return internalObject.IsComment; } }\n\t\t/// <summary> True if tag starts with \"&lt;![CDATA[\" </summary>\n\t\tpublic bool IsCData                 { get { return internalObject.IsCData; } }\n\t\t/// <summary> True if tag starts with one of the DTD starts </summary>\n\t\tpublic bool IsDocumentType          { get { return internalObject.IsDocumentType; } }\n\t\t/// <summary> True if tag starts with \"&lt;!\" </summary>\n\t\tpublic bool IsUnknownBang           { get { return internalObject.IsUnknownBang; } }\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override void AcceptVisitor(AXmlVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitTag(this);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} '{1}{2}{3}' Attr:{4}]\", base.ToString(), this.OpeningBracket, this.Name, this.ClosingBracket, this.Children.Count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlText.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Whitespace or character data\n\t/// </summary>\n\tpublic class AXmlText : AXmlObject\n\t{\n\t\tinternal AXmlText(AXmlObject parent, int startOffset, InternalText internalObject)\n\t\t\t: base(parent, startOffset, internalObject)\n\t\t{\n\t\t}\n\t\t\n//\t\t/// <summary> The type of the text node </summary>\n//\t\tpublic TextType Type {\n//\t\t\tget { return ((InternalText)internalObject).Type; }\n//\t\t}\n\t\t\n\t\t/// <summary> The text with all entity references resloved </summary>\n\t\tpublic string Value {\n\t\t\tget { return ((InternalText)internalObject).Value; }\n\t\t}\n\t\t\n\t\t/// <summary> True if the text contains only whitespace characters </summary>\n\t\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Naming\", \"CA1702:CompoundWordsShouldBeCasedCorrectly\", MessageId = \"Whitespace\",\n\t\t                                                 Justification = \"System.Xml also uses 'Whitespace'\")]\n\t\tpublic bool ContainsOnlyWhitespace {\n\t\t\tget { return ((InternalText)internalObject).ContainsOnlyWhitespace; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override void AcceptVisitor(AXmlVisitor visitor)\n\t\t{\n\t\t\tvisitor.VisitText(this);\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(CultureInfo.InvariantCulture, \"[{0} Text.Length={1}]\", base.ToString(), this.Value.Length);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/AXmlVisitor.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Text;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Derive from this class to create visitor for the XML tree\n\t/// </summary>\n\tpublic abstract class AXmlVisitor\n\t{\n\t\t/// <summary> Visit AXmlDocument </summary>\n\t\tpublic virtual void VisitDocument(AXmlDocument document)\n\t\t{\n\t\t\tforeach (AXmlObject child in document.Children)\n\t\t\t\tchild.AcceptVisitor(this);\n\t\t}\n\t\t\n\t\t/// <summary> Visit AXmlElement </summary>\n\t\tpublic virtual void VisitElement(AXmlElement element)\n\t\t{\n\t\t\tforeach (AXmlObject child in element.Children)\n\t\t\t\tchild.AcceptVisitor(this);\n\t\t}\n\t\t\n\t\t/// <summary> Visit AXmlTag </summary>\n\t\tpublic virtual void VisitTag(AXmlTag tag)\n\t\t{\n\t\t\tforeach (AXmlObject child in tag.Children)\n\t\t\t\tchild.AcceptVisitor(this);\n\t\t}\n\t\t\n\t\t/// <summary> Visit AXmlAttribute </summary>\n\t\tpublic virtual void VisitAttribute(AXmlAttribute attribute)\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t\t/// <summary> Visit AXmlText </summary>\n\t\tpublic virtual void VisitText(AXmlText text)\n\t\t{\n\t\t\t\n\t\t}\n\t}\n}"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/DocumentationElement.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Documentation;\nusing ICSharpCode.NRefactory.TypeSystem;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Represents an element in the XML documentation.\n\t/// Any occurrences of \"&lt;inheritdoc/>\" are replaced with the inherited documentation.\n\t/// </summary>\n\tpublic class XmlDocumentationElement\n\t{\n\t\t/// <summary>\n\t\t/// Gets the XML documentation element for the specified entity.\n\t\t/// Returns null if no documentation is found.\n\t\t/// </summary>\n\t\tpublic static XmlDocumentationElement Get(IEntity entity, bool inheritDocIfMissing = true)\n\t\t{\n\t\t\tif (entity == null)\n\t\t\t\treturn null;\n\t\t\tvar documentationComment = entity.Documentation;\n\t\t\tif (documentationComment != null) {\n\t\t\t\treturn Create(documentationComment, entity);\n\t\t\t}\n\t\t\t\n\t\t\tIMember member = entity as IMember;\n\t\t\tif (inheritDocIfMissing && member != null) {\n\t\t\t\tif (member.SymbolKind == SymbolKind.Constructor) {\n\t\t\t\t\t// For constructors, the documentation of the base class ctor\n\t\t\t\t\t// isn't really suitable as constructors are not inherited.\n\t\t\t\t\t// We'll use the type's documentation instead:\n\t\t\t\t\treturn Get(entity.DeclaringTypeDefinition, inheritDocIfMissing);\n\t\t\t\t}\n\t\t\t\tforeach (IMember baseMember in InheritanceHelper.GetBaseMembers(member, includeImplementedInterfaces: true)) {\n\t\t\t\t\tdocumentationComment = baseMember.Documentation;\n\t\t\t\t\tif (documentationComment != null)\n\t\t\t\t\t\treturn Create(documentationComment, baseMember);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tstatic XmlDocumentationElement Create(DocumentationComment documentationComment, IEntity declaringEntity)\n\t\t{\n\t\t\tvar doc = new AXmlParser().Parse(documentationComment.Xml);\n\t\t\treturn new XmlDocumentationElement(doc, declaringEntity, documentationComment.ResolveCref);\n\t\t}\n\t\t\n\t\treadonly AXmlObject xmlObject;\n\t\treadonly AXmlElement element;\n\t\treadonly IEntity declaringEntity;\n\t\treadonly Func<string, IEntity> crefResolver;\n\t\tvolatile string textContent;\n\t\t\n\t\t/// <summary>\n\t\t/// Inheritance level; used to prevent cyclic doc inheritance.\n\t\t/// </summary>\n\t\tint nestingLevel;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new documentation element.\n\t\t/// </summary>\n\t\tpublic XmlDocumentationElement(AXmlElement element, IEntity declaringEntity, Func<string, IEntity> crefResolver)\n\t\t{\n\t\t\tif (element == null)\n\t\t\t\tthrow new ArgumentNullException(\"element\");\n\t\t\tthis.element = element;\n\t\t\tthis.xmlObject = element;\n\t\t\tthis.declaringEntity = declaringEntity;\n\t\t\tthis.crefResolver = crefResolver;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new documentation element.\n\t\t/// </summary>\n\t\tpublic XmlDocumentationElement(AXmlDocument document, IEntity declaringEntity, Func<string, IEntity> crefResolver)\n\t\t{\n\t\t\tif (document == null)\n\t\t\t\tthrow new ArgumentNullException(\"document\");\n\t\t\tthis.xmlObject = document;\n\t\t\tthis.declaringEntity = declaringEntity;\n\t\t\tthis.crefResolver = crefResolver;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new documentation element.\n\t\t/// </summary>\n\t\tpublic XmlDocumentationElement(string text, IEntity declaringEntity)\n\t\t{\n\t\t\tif (text == null)\n\t\t\t\tthrow new ArgumentNullException(\"text\");\n\t\t\tthis.declaringEntity = declaringEntity;\n\t\t\tthis.textContent = text;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the entity on which this documentation was originally declared.\n\t\t/// May return null.\n\t\t/// </summary>\n\t\tpublic IEntity DeclaringEntity {\n\t\t\tget { return declaringEntity; }\n\t\t}\n\t\t\n\t\tIEntity referencedEntity;\n\t\tvolatile bool referencedEntityInitialized;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the entity referenced by the 'cref' attribute.\n\t\t/// May return null.\n\t\t/// </summary>\n\t\tpublic IEntity ReferencedEntity {\n\t\t\tget {\n\t\t\t\tif (!referencedEntityInitialized) {\n\t\t\t\t\tstring cref = GetAttribute(\"cref\");\n\t\t\t\t\tif (cref != null && crefResolver != null)\n\t\t\t\t\t\treferencedEntity = crefResolver(cref);\n\t\t\t\t\treferencedEntityInitialized = true;\n\t\t\t\t}\n\t\t\t\treturn referencedEntity;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the element name.\n\t\t/// </summary>\n\t\tpublic string Name {\n\t\t\tget {\n\t\t\t\treturn element != null ? element.Name : string.Empty;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the attribute value.\n\t\t/// </summary>\n\t\tpublic string GetAttribute(string name)\n\t\t{\n\t\t\treturn element != null ? element.GetAttributeValue(name) : string.Empty;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets whether this is a pure text node.\n\t\t/// </summary>\n\t\tpublic bool IsTextNode {\n\t\t\tget { return xmlObject == null; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the text content.\n\t\t/// </summary>\n\t\tpublic string TextContent {\n\t\t\tget {\n\t\t\t\tif (textContent == null) {\n\t\t\t\t\tStringBuilder b = new StringBuilder();\n\t\t\t\t\tforeach (var child in this.Children)\n\t\t\t\t\t\tb.Append(child.TextContent);\n\t\t\t\t\ttextContent = b.ToString();\n\t\t\t\t}\n\t\t\t\treturn textContent;\n\t\t\t}\n\t\t}\n\t\t\n\t\tIList<XmlDocumentationElement> children;\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the child elements.\n\t\t/// </summary>\n\t\tpublic IList<XmlDocumentationElement> Children {\n\t\t\tget {\n\t\t\t\tif (xmlObject == null)\n\t\t\t\t\treturn EmptyList<XmlDocumentationElement>.Instance;\n\t\t\t\treturn LazyInitializer.EnsureInitialized(\n\t\t\t\t\tref this.children,\n\t\t\t\t\t() => CreateElements(xmlObject.Children, declaringEntity, crefResolver, nestingLevel));\n\t\t\t}\n\t\t}\n\t\t\n\t\tstatic readonly string[] doNotInheritIfAlreadyPresent = {\n\t\t\t\"example\", \"exclude\", \"filterpriority\", \"preliminary\", \"summary\",\n\t\t\t\"remarks\", \"returns\", \"threadsafety\", \"value\"\n\t\t};\n\t\t\n\t\tstatic List<XmlDocumentationElement> CreateElements(IEnumerable<AXmlObject> childObjects, IEntity declaringEntity, Func<string, IEntity> crefResolver, int nestingLevel)\n\t\t{\n\t\t\tList<XmlDocumentationElement> list = new List<XmlDocumentationElement>();\n\t\t\tforeach (var child in childObjects) {\n\t\t\t\tvar childText = child as AXmlText;\n\t\t\t\tvar childTag = child as AXmlTag;\n\t\t\t\tvar childElement = child as AXmlElement;\n\t\t\t\tif (childText != null) {\n\t\t\t\t\tlist.Add(new XmlDocumentationElement(childText.Value, declaringEntity));\n\t\t\t\t} else if (childTag != null && childTag.IsCData) {\n\t\t\t\t\tforeach (var text in childTag.Children.OfType<AXmlText>())\n\t\t\t\t\t\tlist.Add(new XmlDocumentationElement(text.Value, declaringEntity));\n\t\t\t\t} else if (childElement != null) {\n\t\t\t\t\tif (nestingLevel < 5 && childElement.Name == \"inheritdoc\") {\n\t\t\t\t\t\tstring cref = childElement.GetAttributeValue(\"cref\");\n\t\t\t\t\t\tIEntity inheritedFrom = null;\n\t\t\t\t\t\tDocumentationComment inheritedDocumentation = null;\n\t\t\t\t\t\tif (cref != null) {\n\t\t\t\t\t\t\tinheritedFrom = crefResolver(cref);\n\t\t\t\t\t\t\tif (inheritedFrom != null)\n\t\t\t\t\t\t\t\tinheritedDocumentation = inheritedFrom.Documentation;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tforeach (IMember baseMember in InheritanceHelper.GetBaseMembers((IMember)declaringEntity, includeImplementedInterfaces: true)) {\n\t\t\t\t\t\t\t\tinheritedDocumentation = baseMember.Documentation;\n\t\t\t\t\t\t\t\tif (inheritedDocumentation != null) {\n\t\t\t\t\t\t\t\t\tinheritedFrom = baseMember;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (inheritedDocumentation != null) {\n\t\t\t\t\t\t\tvar doc = new AXmlParser().Parse(inheritedDocumentation.Xml);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// XPath filter not yet implemented\n\t\t\t\t\t\t\tif (childElement.Parent is AXmlDocument && childElement.GetAttributeValue(\"select\") == null) {\n\t\t\t\t\t\t\t\t// Inheriting documentation at the root level\n\t\t\t\t\t\t\t\tList<string> doNotInherit = new List<string>();\n\t\t\t\t\t\t\t\tdoNotInherit.Add(\"overloads\");\n\t\t\t\t\t\t\t\tdoNotInherit.AddRange(childObjects.OfType<AXmlElement>().Select(e => e.Name).Intersect(\n\t\t\t\t\t\t\t\t\tdoNotInheritIfAlreadyPresent));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar inheritedChildren = doc.Children.Where(\n\t\t\t\t\t\t\t\t\tinheritedObject => {\n\t\t\t\t\t\t\t\t\t\tAXmlElement inheritedElement = inheritedObject as AXmlElement;\n\t\t\t\t\t\t\t\t\t\treturn !(inheritedElement != null && doNotInherit.Contains(inheritedElement.Name));\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tlist.AddRange(CreateElements(inheritedChildren, inheritedFrom, inheritedDocumentation.ResolveCref, nestingLevel + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist.Add(new XmlDocumentationElement(childElement, declaringEntity, crefResolver) { nestingLevel = nestingLevel });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (list.Count > 0 && list[0].IsTextNode) {\n\t\t\t\tif (string.IsNullOrWhiteSpace(list[0].textContent))\n\t\t\t\t\tlist.RemoveAt(0);\n\t\t\t\telse\n\t\t\t\t\tlist[0].textContent = list[0].textContent.TrimStart();\n\t\t\t}\n\t\t\tif (list.Count > 0 && list[list.Count - 1].IsTextNode) {\n\t\t\t\tif (string.IsNullOrWhiteSpace(list[list.Count - 1].textContent))\n\t\t\t\t\tlist.RemoveAt(list.Count - 1);\n\t\t\t\telse\n\t\t\t\t\tlist[list.Count - 1].textContent = list[list.Count - 1].textContent.TrimEnd();\n\t\t\t}\n\t\t\treturn list;\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (element != null)\n\t\t\t\treturn \"<\" + element.Name + \">\";\n\t\t\telse\n\t\t\t\treturn this.TextContent;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/ICSharpCode.NRefactory.Xml.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" DefaultTargets=\"Build\">\r\n  <PropertyGroup>\r\n    <ProjectGuid>{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}</ProjectGuid>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>ICSharpCode.NRefactory.Xml</RootNamespace>\r\n    <AssemblyName>ICSharpCode.NRefactory.Xml</AssemblyName>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>\r\n    <NoStdLib>False</NoStdLib>\r\n    <WarningLevel>4</WarningLevel>\r\n    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>\r\n    <SignAssembly>true</SignAssembly>\r\n    <AssemblyOriginatorKeyFile>..\\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>\r\n    <AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>\r\n    <ProductVersion>10.0.0</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <OutputPath>..\\bin\\$(Configuration)\\</OutputPath>\r\n    <DocumentationFile>..\\bin\\$(Configuration)\\ICSharpCode.NRefactory.Xml.xml</DocumentationFile>\r\n    <NoWin32Manifest>False</NoWin32Manifest>\r\n    <IntermediateOutputPath>obj\\$(Configuration)\\</IntermediateOutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Platform)' == 'AnyCPU' \">\r\n    <PlatformTarget>AnyCPU</PlatformTarget>\r\n    <RegisterForComInterop>False</RegisterForComInterop>\r\n    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>\r\n    <BaseAddress>4194304</BaseAddress>\r\n    <FileAlignment>4096</FileAlignment>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE;FULL_AST;NET_4_0</DefineConstants>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'Release' \">\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE;FULL_AST;NET_4_0</DefineConstants>\r\n    <BaseIntermediateOutputPath>obj\\</BaseIntermediateOutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>PdbOnly</DebugType>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <OutputPath>..\\bin\\Release\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <OutputPath>..\\bin\\Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Debug' \">\r\n    <Optimize>False</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>DEBUG;TRACE;FULL_AST;NET_4_0;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Debug|AnyCPU' \">\r\n    <DebugType>full</DebugType>\r\n    <DebugSymbols>True</DebugSymbols>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Debug\\</OutputPath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)' == 'net_4_5_Release' \">\r\n    <Optimize>True</Optimize>\r\n    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>\r\n    <DefineConstants>TRACE;FULL_AST;NET_4_0;NET_4_5</DefineConstants>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'net_4_5_Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>\r\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\r\n    <OutputPath>..\\bin\\net_4_5_Release\\</OutputPath>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\">\r\n    </Reference>\r\n    <Reference Include=\"System.Xml\" />\r\n    <Reference Include=\"System.Xml.Linq\">\r\n    </Reference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"..\\ICSharpCode.NRefactory\\Properties\\GlobalAssemblyInfo.cs\">\r\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\r\n    </Compile>\r\n    <Compile Include=\"AXmlAttribute.cs\" />\r\n    <Compile Include=\"AXmlDocument.cs\" />\r\n    <Compile Include=\"AXmlElement.cs\" />\r\n    <Compile Include=\"AXmlObject.cs\" />\r\n    <Compile Include=\"AXmlReader.cs\" />\r\n    <Compile Include=\"AXmlTag.cs\" />\r\n    <Compile Include=\"AXmlText.cs\" />\r\n    <Compile Include=\"AXmlVisitor.cs\" />\r\n    <Compile Include=\"DocumentationElement.cs\" />\r\n    <Compile Include=\"IncrementalParserState.cs\" />\r\n    <Compile Include=\"InternalDocument.cs\" />\r\n    <Compile Include=\"ObjectIterator.cs\" />\r\n    <Compile Include=\"ReuseEqualityComparer.cs\" />\r\n    <Compile Include=\"SyntaxError.cs\" />\r\n    <Compile Include=\"TagMatchingHeuristics.cs\" />\r\n    <Compile Include=\"TextType.cs\" />\r\n    <Compile Include=\"Log.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"TagReader.cs\" />\r\n    <Compile Include=\"AXmlParser.cs\" />\r\n    <Compile Include=\"TokenReader.cs\" />\r\n    <Compile Include=\"XmlSegment.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\">\r\n      <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>\r\n      <Name>ICSharpCode.NRefactory</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.Targets\" />\r\n</Project>"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/IncrementalParserState.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Encapsulates the state of the incremental tag soup parser.\n\t/// </summary>\n\tpublic class IncrementalParserState\n\t{\n\t\tinternal readonly int TextLength;\n\t\tinternal readonly ITextSourceVersion Version;\n\t\tinternal readonly InternalObject[] Objects;\n\t\t\n\t\tinternal IncrementalParserState(int textLength, ITextSourceVersion version, InternalObject[] objects)\n\t\t{\n\t\t\tthis.TextLength = textLength;\n\t\t\tthis.Version = version;\n\t\t\tthis.Objects = objects;\n\t\t}\n\t\t\n\t\tinternal List<UnchangedSegment> GetReuseMapTo(ITextSourceVersion newVersion)\n\t\t{\n\t\t\tITextSourceVersion oldVersion = this.Version;\n\t\t\tif (oldVersion == null || newVersion == null)\n\t\t\t\treturn null;\n\t\t\tif (!oldVersion.BelongsToSameDocumentAs(newVersion))\n\t\t\t\treturn null;\n\t\t\tList<UnchangedSegment> reuseMap = new List<UnchangedSegment>();\n\t\t\treuseMap.Add(new UnchangedSegment(0, 0, this.TextLength));\n\t\t\tforeach (var change in oldVersion.GetChangesTo(newVersion)) {\n\t\t\t\tbool needsSegmentRemoval = false;\n\t\t\t\tfor (int i = 0; i < reuseMap.Count; i++) {\n\t\t\t\t\tUnchangedSegment segment = reuseMap[i];\n\t\t\t\t\tif (segment.NewOffset + segment.Length <= change.Offset) {\n\t\t\t\t\t\t// change is completely after this segment\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (change.Offset + change.RemovalLength <= segment.NewOffset) {\n\t\t\t\t\t\t// change is completely before this segment\n\t\t\t\t\t\tsegment.NewOffset += change.InsertionLength - change.RemovalLength;\n\t\t\t\t\t\treuseMap[i] = segment;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Change is overlapping segment.\n\t\t\t\t\t// Split segment into two parts: the part before change, and the part after change.\n\t\t\t\t\tvar segmentBefore = new UnchangedSegment(segment.OldOffset, segment.NewOffset, change.Offset - segment.NewOffset);\n\t\t\t\t\tDebug.Assert(segmentBefore.Length < segment.Length);\n\t\t\t\t\t\n\t\t\t\t\tint lengthAtEnd = segment.NewOffset + segment.Length - (change.Offset + change.RemovalLength);\n\t\t\t\t\tvar segmentAfter = new UnchangedSegment(\n\t\t\t\t\t\tsegment.OldOffset + segment.Length - lengthAtEnd,\n\t\t\t\t\t\tchange.Offset + change.InsertionLength,\n\t\t\t\t\t\tlengthAtEnd);\n\t\t\t\t\tDebug.Assert(segmentAfter.Length < segment.Length);\n\t\t\t\t\tDebug.Assert(segmentBefore.Length + segmentAfter.Length <= segment.Length);\n\t\t\t\t\tDebug.Assert(segmentBefore.NewOffset + segmentBefore.Length <= segmentAfter.NewOffset);\n\t\t\t\t\tDebug.Assert(segmentBefore.OldOffset + segmentBefore.Length <= segmentAfter.OldOffset);\n\t\t\t\t\tif (segmentBefore.Length > 0 && segmentAfter.Length > 0) {\n\t\t\t\t\t\treuseMap[i] = segmentBefore;\n\t\t\t\t\t\treuseMap.Insert(++i, segmentAfter);\n\t\t\t\t\t} else if (segmentBefore.Length > 0) {\n\t\t\t\t\t\treuseMap[i] = segmentBefore;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treuseMap[i] = segmentAfter;\n\t\t\t\t\t\tif (segmentAfter.Length <= 0)\n\t\t\t\t\t\t\tneedsSegmentRemoval = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (needsSegmentRemoval)\n\t\t\t\t\treuseMap.RemoveAll(s => s.Length <= 0);\n\t\t\t}\n\t\t\treturn reuseMap;\n\t\t}\n\t}\n\t\n\tstruct UnchangedSegment\n\t{\n\t\tpublic int OldOffset;\n\t\tpublic int NewOffset;\n\t\tpublic int Length;\n\t\t\n\t\tpublic UnchangedSegment(int oldOffset, int newOffset, int length)\n\t\t{\n\t\t\tthis.OldOffset = oldOffset;\n\t\t\tthis.NewOffset = newOffset;\n\t\t\tthis.Length = length;\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"[UnchangedSegment OldOffset={0}, NewOffset={1}, Length={2}]\", OldOffset, NewOffset, Length);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/InternalDocument.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\tinternal abstract class InternalObject\n\t{\n\t\tpublic int StartRelativeToParent;\n\t\tpublic int Length;\n\t\t/// <summary>Length that was touched to parsed this object.</summary>\n\t\tpublic int LengthTouched;\n\t\tpublic InternalSyntaxError[] SyntaxErrors;\n\t\tpublic InternalObject[] NestedObjects;\n\t\t\n\t\tpublic InternalObject SetStartRelativeToParent(int newStartRelativeToParent)\n\t\t{\n\t\t\tif (newStartRelativeToParent == StartRelativeToParent)\n\t\t\t\treturn this;\n\t\t\tInternalObject obj = (InternalObject)MemberwiseClone();\n\t\t\tobj.StartRelativeToParent = newStartRelativeToParent;\n\t\t\treturn obj;\n\t\t}\n\t\t\n\t\tpublic abstract AXmlObject CreatePublicObject(AXmlObject parent, int parentStartOffset);\n\t}\n\t\n\tsealed class InternalDocument : InternalObject\n\t{\n\t\tpublic override AXmlObject CreatePublicObject(AXmlObject parent, int parentStartOffset)\n\t\t{\n\t\t\treturn new AXmlDocument(parent, (parent != null ? parentStartOffset + StartRelativeToParent : parentStartOffset), this);\n\t\t}\n\t}\n\t\n\tsealed class InternalText : InternalObject\n\t{\n\t\tpublic TextType Type;\n\t\tpublic bool ContainsOnlyWhitespace;\n\t\tpublic string Value;\n\t\t\n\t\tpublic override AXmlObject CreatePublicObject(AXmlObject parent, int parentStartOffset)\n\t\t{\n\t\t\treturn new AXmlText(parent, (parent != null ? parentStartOffset + StartRelativeToParent : parentStartOffset), this);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Text: \" + this.Value.Replace(\"\\n\", \"\\\\n\").Replace(\"\\r\", \"\\\\r\");\n\t\t}\n\t}\n\t\n\tsealed class InternalTag : InternalObject\n\t{\n\t\tpublic string OpeningBracket;\n\t\tpublic int RelativeNameStart;\n\t\tpublic string Name;\n\t\tpublic string ClosingBracket;\n\t\t\n\t\t/// <summary> True if tag starts with \"&lt;\" </summary>\n\t\tpublic bool IsStartOrEmptyTag       { get { return OpeningBracket == \"<\"; } }\n\t\t/// <summary> True if tag starts with \"&lt;\" and ends with \"&gt;\" </summary>\n\t\tpublic bool IsStartTag              { get { return OpeningBracket == \"<\" && ClosingBracket == \">\"; } }\n\t\t/// <summary> True if tag starts with \"&lt;\" and does not end with \"&gt;\" </summary>\n\t\tpublic bool IsEmptyTag              { get { return OpeningBracket == \"<\" && ClosingBracket != \">\" ; } }\n\t\t/// <summary> True if tag starts with \"&lt;/\" </summary>\n\t\tpublic bool IsEndTag                { get { return OpeningBracket == \"</\"; } }\n\t\t/// <summary> True if tag starts with \"&lt;?\" </summary>\n\t\tpublic bool IsProcessingInstruction { get { return OpeningBracket == \"<?\"; } }\n\t\t/// <summary> True if tag starts with \"&lt;!--\" </summary>\n\t\tpublic bool IsComment               { get { return OpeningBracket == \"<!--\"; } }\n\t\t/// <summary> True if tag starts with \"&lt;![CDATA[\" </summary>\n\t\tpublic bool IsCData                 { get { return OpeningBracket == \"<![CDATA[\"; } }\n\t\t/// <summary> True if tag starts with one of the DTD starts </summary>\n\t\tpublic bool IsDocumentType          { get { return AXmlTag.DtdNames.Contains(OpeningBracket); } }\n\t\t/// <summary> True if tag starts with \"&lt;!\" </summary>\n\t\tpublic bool IsUnknownBang           { get { return OpeningBracket == \"<!\"; } }\n\t\t\n\t\tpublic override AXmlObject CreatePublicObject(AXmlObject parent, int parentStartOffset)\n\t\t{\n\t\t\treturn new AXmlTag(parent, (parent != null ? parentStartOffset + StartRelativeToParent : parentStartOffset), this);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Tag: \" + OpeningBracket + Name + ClosingBracket;\n\t\t}\n\t\t\n\t\tpublic InternalTag AddSyntaxError(string description)\n\t\t{\n\t\t\tif (this.SyntaxErrors != null && this.SyntaxErrors.Length > 0)\n\t\t\t\treturn this; // don't add error if there already is one\n\t\t\tInternalTag tag = (InternalTag)MemberwiseClone();\n\t\t\ttag.SyntaxErrors = new InternalSyntaxError[] { new InternalSyntaxError(0, Length, description) };\n\t\t\treturn tag;\n\t\t}\n\t}\n\t\n\tstruct InternalSyntaxError\n\t{\n\t\tpublic readonly int RelativeStart;\n\t\tpublic readonly int RelativeEnd;\n\t\tpublic readonly string Description;\n\t\t\n\t\tpublic InternalSyntaxError(int relativeStart, int relativeEnd, string description)\n\t\t{\n\t\t\tthis.RelativeStart = relativeStart;\n\t\t\tthis.RelativeEnd = relativeEnd;\n\t\t\tthis.Description = description;\n\t\t}\n\t}\n\t\n\tsealed class InternalAttribute : InternalObject\n\t{\n\t\tpublic string Name;\n\t\tpublic int EqualsSignLength; // length of equals sign including the surrounding whitespace\n\t\tpublic string Value;\n\t\t\n\t\tpublic override AXmlObject CreatePublicObject(AXmlObject parent, int parentStartOffset)\n\t\t{\n\t\t\treturn new AXmlAttribute(parent, (parent != null ? parentStartOffset + StartRelativeToParent : parentStartOffset), this);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Attribute: \" + Name + \"='\" + Value + \"'\";\n\t\t}\n\t}\n\t\n\tsealed class InternalElement : InternalObject\n\t{\n\t\tpublic bool HasEndTag;\n\t\tpublic bool IsPropertyNested;\n\t\tpublic readonly string Name;\n\t\t\n\t\tpublic InternalElement(InternalTag tag)\n\t\t{\n\t\t\tthis.Name = tag.Name;\n\t\t}\n\t\t\n\t\tpublic string Prefix {\n\t\t\tget { return AXmlObject.GetNamespacePrefix(Name); }\n\t\t}\n\t\t\n\t\tpublic string LocalName {\n\t\t\tget { return AXmlObject.GetLocalName(Name); }\n\t\t}\n\t\t\n\t\tpublic override AXmlObject CreatePublicObject(AXmlObject parent, int parentStartOffset)\n\t\t{\n\t\t\treturn new AXmlElement(parent, (parent != null ? parentStartOffset + StartRelativeToParent : parentStartOffset), this);\n\t\t}\n\t\t\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Element: \" + NestedObjects[0].ToString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/Log.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Diagnostics;\nusing System.Runtime.Serialization;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\tstatic class Log\n\t{\n\t\t/// <summary> Throws exception if condition is false </summary>\n\t\tinternal static void Assert(bool condition, string message)\n\t\t{\n\t\t\tif (!condition) {\n\t\t\t\tthrow new InternalException(\"Assertion failed: \" + message);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary> Throws exception if condition is false </summary>\n\t\t[Conditional(\"DEBUG\")]\n\t\tinternal static void DebugAssert(bool condition, string message)\n\t\t{\n\t\t\tif (!condition) {\n\t\t\t\tthrow new InternalException(\"Assertion failed: \" + message);\n\t\t\t}\n\t\t}\n\n\t\t[Conditional(\"DEBUG\")]\n\t\tinternal static void WriteLine(string text, params object[] pars)\n\t\t{\n\t\t\t//System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, \"XML: \" + text, pars));\n\t\t}\n\t}\n\t\n\t\n\t/// <summary>\n\t/// Exception used for internal errors in XML parser.\n\t/// This exception indicates a bug in NRefactory.\n\t/// </summary>\n\t[Serializable]\n\t[System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Design\", \"CA1064:ExceptionsShouldBePublic\", Justification = \"This exception is not public because it is not supposed to be caught by user code - it indicates a bug in AvalonEdit.\")]\n\tclass InternalException : Exception\n\t{\n\t\t/// <summary>\n\t\t/// Creates a new InternalException instance.\n\t\t/// </summary>\n\t\tpublic InternalException() : base()\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new InternalException instance.\n\t\t/// </summary>\n\t\tpublic InternalException(string message) : base(message)\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new InternalException instance.\n\t\t/// </summary>\n\t\tpublic InternalException(string message, Exception innerException) : base(message, innerException)\n\t\t{\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new InternalException instance.\n\t\t/// </summary>\n\t\tprotected InternalException(SerializationInfo info, StreamingContext context) : base(info, context)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/ObjectIterator.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Iterates through an internal object tree.\n\t/// </summary>\n\tsealed class ObjectIterator\n\t{\n\t\tStack<InternalObject[]> listStack = new Stack<InternalObject[]>();\n\t\tStack<int> indexStack = new Stack<int>();\n\t\t\n\t\tInternalObject[] objects;\n\t\tint currentIndex;\n\t\tInternalObject currentObject;\n\t\tint currentPosition;\n\t\tinternal bool StopAtElementEnd;\n\t\tbool isAtElementEnd;\n\t\t\n\t\tpublic ObjectIterator(InternalObject[] objects, int startPosition = 0)\n\t\t{\n\t\t\tthis.currentPosition = startPosition;\n\t\t\tthis.objects = objects;\n\t\t\tif (objects.Length > 0)\n\t\t\t\tthis.currentObject = objects[0];\n\t\t}\n\t\t\n\t\tpublic InternalObject CurrentObject {\n\t\t\tget { return currentObject; }\n\t\t}\n\t\t\n\t\tpublic int CurrentPosition {\n\t\t\tget { return currentPosition; }\n\t\t}\n\t\t\n\t\tpublic bool IsAtElementEnd {\n\t\t\tget { return isAtElementEnd; }\n\t\t}\n\t\t\n\t\tpublic int Depth {\n\t\t\tget { return listStack.Count; }\n\t\t}\n\t\t\n\t\tpublic void MoveNext()\n\t\t{\n\t\t\tif (currentObject == null)\n\t\t\t\treturn;\n\t\t\tcurrentIndex++;\n\t\t\tcurrentPosition += currentObject.Length;\n\t\t\tisAtElementEnd = false;\n\t\t\twhile (currentIndex >= objects.Length && listStack.Count > 0) {\n\t\t\t\tobjects = listStack.Pop();\n\t\t\t\tcurrentIndex = indexStack.Pop();\n\t\t\t\tif (this.StopAtElementEnd) {\n\t\t\t\t\tisAtElementEnd = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentObject = (currentIndex < objects.Length ? objects[currentIndex] : null);\n\t\t}\n\t\t\n\t\tpublic void MoveInto()\n\t\t{\n\t\t\tif (isAtElementEnd || !(currentObject is InternalElement)) {\n\t\t\t\tMoveNext();\n\t\t\t} else {\n\t\t\t\tlistStack.Push(objects);\n\t\t\t\tindexStack.Push(currentIndex);\n\t\t\t\tobjects = currentObject.NestedObjects;\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tcurrentObject = objects[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Skips all nodes in front of 'position'\n\t\t/// </summary>\n\t\tpublic void SkipTo(int position)\n\t\t{\n\t\t\twhile (currentObject != null && currentPosition < position) {\n\t\t\t\tif (currentPosition + currentObject.Length <= position)\n\t\t\t\t\tMoveNext();\n\t\t\t\telse\n\t\t\t\t\tMoveInto();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/Properties/AssemblyInfo.cs",
    "content": "﻿#region Using directives\n\nusing System;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n#endregion\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ICSharpCode.NRefactory.Xml\")]\n[assembly: AssemblyDescription(\"Error-tolerant XML parser\")]\n\n[assembly: CLSCompliant(true)]\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/ReuseEqualityComparer.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// Determines whether two objects are identical (one is a reused version of the other).\n\t/// </summary>\n\tpublic class ReuseEqualityComparer : IEqualityComparer<AXmlObject>\n\t{\n\t\t/// <summary>\n\t\t/// Determines whether two objects are identical (one is a reused version of the other).\n\t\t/// </summary>\n\t\tpublic bool Equals(AXmlObject x, AXmlObject y)\n\t\t{\n\t\t\tif (x == y)\n\t\t\t\treturn true;\n\t\t\tif (x == null || y == null)\n\t\t\t\treturn false;\n\t\t\treturn x.internalObject == y.internalObject;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the object's hash code so that reused versions of an object have the same hash code.\n\t\t/// </summary>\n\t\tpublic int GetHashCode(AXmlObject obj)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\treturn 0;\n\t\t\telse\n\t\t\t\treturn obj.internalObject.GetHashCode();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/SyntaxError.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary>\n\t/// A syntax error.\n\t/// </summary>\n\tpublic class SyntaxError : ISegment\n\t{\n\t\treadonly int startOffset;\n\t\treadonly int endOffset;\n\t\treadonly string description;\n\t\t\n\t\t/// <summary>\n\t\t/// Creates a new syntax error.\n\t\t/// </summary>\n\t\tpublic SyntaxError(int startOffset, int endOffset, string description)\n\t\t{\n\t\t\tif (description == null)\n\t\t\t\tthrow new ArgumentNullException(\"description\");\n\t\t\tthis.startOffset = startOffset;\n\t\t\tthis.endOffset = endOffset;\n\t\t\tthis.description = description;\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets a description of the syntax error.\n\t\t/// </summary>\n\t\tpublic string Description {\n\t\t\tget { return description; }\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Gets the start offset of the segment.\n\t\t/// </summary>\n\t\tpublic int StartOffset {\n\t\t\tget { return startOffset; }\n\t\t}\n\t\t\n\t\tint ISegment.Offset {\n\t\t\tget { return startOffset; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int Length {\n\t\t\tget { return endOffset - startOffset; }\n\t\t}\n\t\t\n\t\t/// <inheritdoc/>\n\t\tpublic int EndOffset {\n\t\t\tget { return endOffset; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/TagMatchingHeuristics.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Utils;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\tclass TagMatchingHeuristics\n\t{\n\t\treadonly ITextSource textSource;\n\t\t\n\t\tconst int MaxConfigurationCount = 30;\n\t\t\n\t\tpublic TagMatchingHeuristics(ITextSource textSource)\n\t\t{\n\t\t\tthis.textSource = textSource;\n\t\t}\n\t\t\n\t\tpublic InternalDocument CreateDocument(List<InternalObject> tagSoup, CancellationToken cancellationToken)\n\t\t{\n\t\t\tvar stack = InsertPlaceholderTags(tagSoup, cancellationToken);\n\t\t\tInternalDocument doc = new InternalDocument();\n\t\t\tvar docElements = CreateElements(ref stack);\n\t\t\tdocElements.Reverse(); // reverse due to stack\n\t\t\tdoc.NestedObjects = new InternalObject[docElements.Count];\n\t\t\tint pos = 0;\n\t\t\tfor (int i = 0; i < docElements.Count; i++) {\n\t\t\t\tdoc.NestedObjects[i] = docElements[i].SetStartRelativeToParent(pos);\n\t\t\t\tpos += doc.NestedObjects[i].Length;\n\t\t\t}\n\t\t\tdoc.Length = pos;\n\t\t\treturn doc;\n\t\t}\n\t\t\n\t\t#region Heuristic implementation - Inserting place holders into object stream\n\t\t// Tags used to guide the element creation\n\t\tstatic readonly InternalTag StartTagPlaceholder = new InternalTag { OpeningBracket = \"<\", ClosingBracket = \">\" };\n\t\tstatic readonly InternalTag EndTagPlaceholder = new InternalTag { OpeningBracket = \"</\", ClosingBracket = \">\" };\n\t\t\n\t\tclass OpenTagStack\n\t\t{\n\t\t\treadonly OpenTagStack prev;\n\t\t\tpublic readonly string Name;\n\t\t\tpublic readonly int IndentationLevel;\n\t\t\treadonly int hashCode;\n\t\t\t\n\t\t\tpublic OpenTagStack()\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\tprivate OpenTagStack(OpenTagStack prev, string name, int indentationLevel)\n\t\t\t{\n\t\t\t\tthis.prev = prev;\n\t\t\t\tthis.Name = name;\n\t\t\t\tthis.IndentationLevel = indentationLevel;\n\t\t\t\tunchecked {\n\t\t\t\t\tthis.hashCode = prev.hashCode * 27 + (name.GetHashCode() ^ indentationLevel);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool IsEmpty {\n\t\t\t\tget { return prev == null; }\n\t\t\t}\n\t\t\t\n\t\t\tpublic OpenTagStack Push(string name, int indentationLevel)\n\t\t\t{\n\t\t\t\treturn new OpenTagStack(this, name, indentationLevel);\n\t\t\t}\n\t\t\t\n\t\t\tpublic OpenTagStack Pop()\n\t\t\t{\n\t\t\t\treturn prev;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t\t\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tOpenTagStack o = obj as OpenTagStack;\n\t\t\t\tif (o != null && hashCode == o.hashCode && IndentationLevel == o.IndentationLevel && Name == o.Name) {\n\t\t\t\t\tif (prev == o.prev)\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif (prev == null || o.prev == null)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn prev.Equals(o.prev);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstruct Configuration\n\t\t{\n\t\t\tpublic readonly OpenTagStack OpenTags;\n\t\t\tpublic readonly ImmutableStack<InternalObject> Document;\n\t\t\tpublic readonly uint Cost;\n\t\t\t\n\t\t\tpublic Configuration(OpenTagStack openTags, ImmutableStack<InternalObject> document, uint cost)\n\t\t\t{\n\t\t\t\tthis.OpenTags = openTags;\n\t\t\t\tthis.Document = document;\n\t\t\t\tthis.Cost = cost;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstruct ConfigurationList\n\t\t{\n\t\t\tinternal Configuration[] configurations;\n\t\t\tinternal int count;\n\t\t\t\n\t\t\tpublic static ConfigurationList Create()\n\t\t\t{\n\t\t\t\treturn new ConfigurationList {\n\t\t\t\t\tconfigurations = new Configuration[MaxConfigurationCount],\n\t\t\t\t\tcount = 0\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Clear()\n\t\t\t{\n\t\t\t\tthis.count = 0;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Add(OpenTagStack openTags, ImmutableStack<InternalObject> document, uint cost)\n\t\t\t{\n\t\t\t\tAdd(new Configuration(openTags, document, cost));\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Add(Configuration configuration)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\t\tif (configuration.OpenTags.Equals(configurations[i].OpenTags)) {\n\t\t\t\t\t\t// We found an existing configuration with the same state.\n\t\t\t\t\t\t// Either replace it, or drop this configurations --\n\t\t\t\t\t\t// we don't want to add multiple configurations with the same state.\n\t\t\t\t\t\tif (configuration.Cost < configurations[i].Cost)\n\t\t\t\t\t\t\tconfigurations[i] = configuration;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (count < configurations.Length) {\n\t\t\t\t\tconfigurations[count++] = configuration;\n\t\t\t\t} else {\n\t\t\t\t\tint index = 0;\n\t\t\t\t\tuint maxCost = configurations[0].Cost;\n\t\t\t\t\tfor (int i = 1; i < configurations.Length; i++) {\n\t\t\t\t\t\tif (configurations[i].Cost < maxCost) {\n\t\t\t\t\t\t\tmaxCost = configurations[i].Cost;\n\t\t\t\t\t\t\tindex = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconfigurations[index] = configuration;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tconst uint InfiniteCost = uint.MaxValue;\n\t\tconst uint MissingEndTagCost = 10;\n\t\tconst uint IgnoreEndTagCost = 10;\n\t\tconst uint MismatchedNameCost = 6;\n\t\t\n\t\tint GetIndentationBefore(int position)\n\t\t{\n\t\t\tint indentation = 0;\n\t\t\twhile (--position >= 0) {\n\t\t\t\tchar c = textSource.GetCharAt(position);\n\t\t\t\tswitch (c) {\n\t\t\t\t\tcase ' ':\n\t\t\t\t\t\tindentation++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\\t':\n\t\t\t\t\t\tindentation += 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\\n':\n\t\t\t\t\t\treturn indentation;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn indentation;\n\t\t}\n\t\t\n\t\tImmutableStack<InternalObject> InsertPlaceholderTags(List<InternalObject> objects, CancellationToken cancellationToken)\n\t\t{\n\t\t\t// Calculate indentation levels in front of the tags:\n\t\t\tint[] indentationBeforeTags = new int[objects.Count];\n\t\t\tint pos = 0;\n\t\t\tfor (int i = 0; i < objects.Count; i++) {\n\t\t\t\tif (objects[i] is InternalTag)\n\t\t\t\t\tindentationBeforeTags[i] = GetIndentationBefore(pos);\n\t\t\t\tpos += objects[i].Length;\n\t\t\t}\n\t\t\t\n\t\t\t// Create initial configuration:\n\t\t\tConfigurationList listA = ConfigurationList.Create();\n\t\t\tConfigurationList listB = ConfigurationList.Create();\n\t\t\tlistA.Add(new Configuration(new OpenTagStack(), ImmutableStack<InternalObject>.Empty, 0));\n\t\t\t\n\t\t\tfor (int i = 0; i < indentationBeforeTags.Length; i++) {\n\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\tProcessObject(objects[i], indentationBeforeTags[i], listA, ref listB);\n\t\t\t\tSwap(ref listA, ref listB);\n\t\t\t}\n\t\t\t\n\t\t\tConfiguration cheapestConfiguration = new Configuration(null, null, InfiniteCost);\n\t\t\tfor (int i = 0; i < listA.count; i++) {\n\t\t\t\tConfiguration c = listA.configurations[i];\n\t\t\t\tif (c.Cost < cheapestConfiguration.Cost) {\n\t\t\t\t\twhile (!c.OpenTags.IsEmpty) {\n\t\t\t\t\t\tc = new Configuration(c.OpenTags.Pop(), c.Document.Push(EndTagPlaceholder), c.Cost + MissingEndTagCost);\n\t\t\t\t\t}\n\t\t\t\t\tif (c.Cost < cheapestConfiguration.Cost)\n\t\t\t\t\t\tcheapestConfiguration = c;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog.WriteLine(\"Best configuration has cost {0}\", cheapestConfiguration.Cost);\n\t\t\treturn cheapestConfiguration.Document;\n\t\t}\n\t\t\n\t\tstatic void Swap(ref ConfigurationList a, ref ConfigurationList b)\n\t\t{\n\t\t\tConfigurationList tmp = a;\n\t\t\ta = b;\n\t\t\tb = tmp;\n\t\t}\n\t\t\n\t\tvoid ProcessObject(InternalObject obj, int indentationLevel, ConfigurationList oldConfigurations, ref ConfigurationList newConfigurations)\n\t\t{\n\t\t\tnewConfigurations.Clear();\n\t\t\tInternalTag tag = obj as InternalTag;\n\t\t\tfor (int i = 0; i < oldConfigurations.count; i++) {\n\t\t\t\tConfiguration c = oldConfigurations.configurations[i];\n\t\t\t\tif (c.Cost == InfiniteCost)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (tag != null && tag.IsStartTag) {\n\t\t\t\t\t// Push start tag\n\t\t\t\t\tnewConfigurations.Add(\n\t\t\t\t\t\tc.OpenTags.Push(tag.Name, indentationLevel),\n\t\t\t\t\t\tc.Document.Push(obj),\n\t\t\t\t\t\tc.Cost\n\t\t\t\t\t);\n\t\t\t\t} else if (tag != null && tag.IsEndTag) {\n\t\t\t\t\t// We can ignore this end tag\n\t\t\t\t\tnewConfigurations.Add(\n\t\t\t\t\t\tc.OpenTags,\n\t\t\t\t\t\tc.Document.Push(StartTagPlaceholder).Push(obj),\n\t\t\t\t\t\tc.Cost + IgnoreEndTagCost\n\t\t\t\t\t);\n\t\t\t\t\t// We can match this end tag with one of the currently open tags\n\t\t\t\t\tvar openTags = c.OpenTags;\n\t\t\t\t\tvar documentWithInsertedEndTags = c.Document;\n\t\t\t\t\tuint newCost = c.Cost;\n\t\t\t\t\twhile (!openTags.IsEmpty) {\n\t\t\t\t\t\tuint matchCost = 0;\n\t\t\t\t\t\tif (openTags.IndentationLevel >= 0 && indentationLevel >= 0)\n\t\t\t\t\t\t\tmatchCost += (uint)Math.Abs(openTags.IndentationLevel - indentationLevel);\n\t\t\t\t\t\tif (openTags.Name != tag.Name)\n\t\t\t\t\t\t\tmatchCost += MismatchedNameCost;\n\t\t\t\t\t\tnewConfigurations.Add(\n\t\t\t\t\t\t\topenTags.Pop(),\n\t\t\t\t\t\t\tdocumentWithInsertedEndTags.Push(obj),\n\t\t\t\t\t\t\tnewCost + matchCost\n\t\t\t\t\t\t);\n\t\t\t\t\t\tnewCost += MissingEndTagCost;\n\t\t\t\t\t\topenTags = openTags.Pop();\n\t\t\t\t\t\tdocumentWithInsertedEndTags = documentWithInsertedEndTags.Push(EndTagPlaceholder);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnewConfigurations.Add(\n\t\t\t\t\t\tc.OpenTags,\n\t\t\t\t\t\tc.Document.Push(obj),\n\t\t\t\t\t\tc.Cost\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Create Elements from stack with place holders\n\t\tList<InternalObject> CreateElements(ref ImmutableStack<InternalObject> inputObjects)\n\t\t{\n\t\t\tList<InternalObject> objects = new List<InternalObject>();\n\t\t\twhile (!inputObjects.IsEmpty) {\n\t\t\t\tvar obj = inputObjects.Peek();\n\t\t\t\tvar tag = obj as InternalTag;\n\t\t\t\tif (tag != null && tag.IsStartTag)\n\t\t\t\t\tbreak;\n\t\t\t\tinputObjects = inputObjects.Pop();\n\t\t\t\tif (tag != null && tag.IsEndTag) {\n\t\t\t\t\tif (inputObjects.Peek() == StartTagPlaceholder) {\n\t\t\t\t\t\tobjects.Add(tag.AddSyntaxError(\"Matching opening tag was not found\"));\n\t\t\t\t\t\tinputObjects = inputObjects.Pop();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar childElements = CreateElements(ref inputObjects);\n\t\t\t\t\t\tvar startTag = (InternalTag)inputObjects.Peek();\n\t\t\t\t\t\tinputObjects = inputObjects.Pop();\n\t\t\t\t\t\tchildElements.Add(startTag);\n\t\t\t\t\t\tchildElements.Reverse();\n\t\t\t\t\t\tif (tag != EndTagPlaceholder) {\n\t\t\t\t\t\t\t// add end tag\n\t\t\t\t\t\t\tif (startTag.Name != tag.Name) {\n\t\t\t\t\t\t\t\tchildElements.Add(tag.AddSyntaxError(\"Expected '</\" + startTag.Name + \">'. End tag must have same name as start tag.\"));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tchildElements.Add(tag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tInternalElement e = new InternalElement(startTag);\n\t\t\t\t\t\te.HasEndTag = (tag != EndTagPlaceholder);\n\t\t\t\t\t\te.NestedObjects = new InternalObject[childElements.Count];\n\t\t\t\t\t\tint pos = 0;\n\t\t\t\t\t\tfor (int i = 0; i < childElements.Count; i++) {\n\t\t\t\t\t\t\te.NestedObjects[i] = childElements[i].SetStartRelativeToParent(pos);\n\t\t\t\t\t\t\tpos += e.NestedObjects[i].Length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.Length = pos;\n\t\t\t\t\t\tif (tag == EndTagPlaceholder) {\n\t\t\t\t\t\t\te.SyntaxErrors = new [] { new InternalSyntaxError(pos, pos, \"Missing '</\" + startTag.Name + \">'\") };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobjects.Add(e);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tobjects.Add(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn objects;\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/TagReader.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\tclass TagReader : TokenReader\n\t{\n\t\treadonly AXmlParser tagSoupParser;\n\t\treadonly Stack<string> elementNameStack;\n\t\t\n\t\tpublic TagReader(AXmlParser tagSoupParser, ITextSource input, bool collapseProperlyNestedElements) : base(input)\n\t\t{\n\t\t\tthis.tagSoupParser = tagSoupParser;\n\t\t\tif (collapseProperlyNestedElements)\n\t\t\t\telementNameStack = new Stack<string>();\n\t\t}\n\t\t\n\t\tpublic List<InternalObject> ReadAllObjects(CancellationToken cancellationToken)\n\t\t{\n\t\t\twhile (HasMoreData()) {\n\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\tReadObject();\n\t\t\t}\n\t\t\treturn objects;\n\t\t}\n\t\t\n\t\tpublic List<InternalObject> ReadAllObjectsIncremental(InternalObject[] oldObjects, List<UnchangedSegment> reuseMap, CancellationToken cancellationToken)\n\t\t{\n\t\t\tObjectIterator oldObjectIterator = new ObjectIterator(oldObjects);\n\t\t\tint reuseMapIndex = 0;\n\t\t\twhile (reuseMapIndex < reuseMap.Count) {\n\t\t\t\tvar reuseEntry = reuseMap[reuseMapIndex];\n\t\t\t\twhile (this.CurrentLocation < reuseEntry.NewOffset) {\n\t\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\t\tReadObject();\n\t\t\t\t}\n\t\t\t\tif (this.CurrentLocation >= reuseEntry.NewOffset + reuseEntry.Length) {\n\t\t\t\t\treuseMapIndex++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tDebug.Assert(reuseEntry.NewOffset <= this.CurrentLocation && this.CurrentLocation < reuseEntry.NewOffset + reuseEntry.Length);\n\t\t\t\t// reuse the nodes within this reuseEntry starting at oldOffset:\n\t\t\t\tint oldOffset = this.CurrentLocation - reuseEntry.NewOffset + reuseEntry.OldOffset;\n\t\t\t\t// seek to oldOffset in the oldObjects array:\n\t\t\t\toldObjectIterator.SkipTo(oldOffset);\n\t\t\t\tif (oldObjectIterator.CurrentPosition == oldOffset) {\n\t\t\t\t\t// reuse old objects within this reuse entry:\n\t\t\t\t\tint reuseEnd = reuseEntry.OldOffset + reuseEntry.Length;\n\t\t\t\t\twhile (oldObjectIterator.CurrentObject != null && oldObjectIterator.CurrentPosition + oldObjectIterator.CurrentObject.LengthTouched < reuseEnd) {\n\t\t\t\t\t\tStoreObject(oldObjectIterator.CurrentObject);\n\t\t\t\t\t\tSkip(oldObjectIterator.CurrentObject.Length);\n\t\t\t\t\t\toldObjectIterator.MoveNext();\n\t\t\t\t\t}\n\t\t\t\t\treuseMapIndex++; // go to next re-use map\n\t\t\t\t} else {\n\t\t\t\t\t// We are in a region where old objects are available, but aren't aligned correctly.\n\t\t\t\t\t// Don't skip this reuse entry, and read a single object so that we can re-align\n\t\t\t\t\tReadObject();\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (HasMoreData()) {\n\t\t\t\tcancellationToken.ThrowIfCancellationRequested();\n\t\t\t\tReadObject();\n\t\t\t}\n\t\t\treturn objects;\n\t\t}\n\t\t\n\t\tvoid StoreObject(InternalObject obj)\n\t\t{\n\t\t\tobjects.Add(obj);\n\t\t\t\n\t\t\t// Now combine properly-nested elements:\n\t\t\tif (elementNameStack == null)\n\t\t\t\treturn; // parsing tag soup\n\t\t\tInternalTag tag = obj as InternalTag;\n\t\t\tif (tag == null)\n\t\t\t\treturn;\n\t\t\tif (tag.IsEmptyTag) {\n\t\t\t\t// the tag is its own element\n\t\t\t\tobjects[objects.Count - 1] = new InternalElement(tag) {\n\t\t\t\t\tLength = tag.Length,\n\t\t\t\t\tLengthTouched = tag.LengthTouched,\n\t\t\t\t\tIsPropertyNested = true,\n\t\t\t\t\tStartRelativeToParent = tag.StartRelativeToParent,\n\t\t\t\t\tNestedObjects = new [] { tag.SetStartRelativeToParent(0) }\n\t\t\t\t};\n\t\t\t} else if (tag.IsStartTag) {\n\t\t\t\telementNameStack.Push(tag.Name);\n\t\t\t} else if (tag.IsEndTag && elementNameStack.Count > 0) {\n\t\t\t\t// Now look for the start element:\n\t\t\t\tint startIndex = objects.Count - 2;\n\t\t\t\tbool ok = false;\n\t\t\t\tstring expectedName = elementNameStack.Pop();\n\t\t\t\tif (tag.Name == expectedName) {\n\t\t\t\t\twhile (startIndex > 0) {\n\t\t\t\t\t\tvar startTag = objects[startIndex] as InternalTag;\n\t\t\t\t\t\tif (startTag != null) {\n\t\t\t\t\t\t\tif (startTag.IsStartTag) {\n\t\t\t\t\t\t\t\tok = (startTag.Name == expectedName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else if (startTag.IsEndTag) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstartIndex--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\t// We found a correct nesting, let's create an element:\n\t\t\t\t\tInternalObject[] nestedObjects = new InternalObject[objects.Count - startIndex];\n\t\t\t\t\tint oldStartRelativeToParent = objects[startIndex].StartRelativeToParent;\n\t\t\t\t\tint pos = 0;\n\t\t\t\t\tint maxLengthTouched = 0;\n\t\t\t\t\tfor (int i = 0; i < nestedObjects.Length; i++) {\n\t\t\t\t\t\tnestedObjects[i] = objects[startIndex + i].SetStartRelativeToParent(pos);\n\t\t\t\t\t\tmaxLengthTouched = Math.Max(maxLengthTouched, pos + nestedObjects[i].LengthTouched);\n\t\t\t\t\t\tpos += nestedObjects[i].Length;\n\t\t\t\t\t}\n\t\t\t\t\tobjects.RemoveRange(startIndex, nestedObjects.Length);\n\t\t\t\t\tobjects.Add(\n\t\t\t\t\t\tnew InternalElement((InternalTag)nestedObjects[0]) {\n\t\t\t\t\t\t\tHasEndTag = true,\n\t\t\t\t\t\t\tIsPropertyNested = true,\n\t\t\t\t\t\t\tLength = pos,\n\t\t\t\t\t\t\tLengthTouched = maxLengthTouched,\n\t\t\t\t\t\t\tStartRelativeToParent = oldStartRelativeToParent,\n\t\t\t\t\t\t\tNestedObjects = nestedObjects\n\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Mismatched name - the nesting isn't properly;\n\t\t\t\t\t// clear the whole stack so that none of the currently open elements are closed as properly-nested.\n\t\t\t\t\telementNameStack.Clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Reads one or more objects.\n\t\t/// </summary>\n\t\tvoid ReadObject()\n\t\t{\n\t\t\tif (TryPeek('<')) {\n\t\t\t\tReadTag();\n\t\t\t} else {\n\t\t\t\tReadText(TextType.CharacterData);\n\t\t\t}\n\t\t}\n\t\t\n\t\t#region BeginInternalObject / EndInternalObject\n\t\tList<InternalObject> objects = new List<InternalObject>();\n\t\tint internalObjectStartPosition;\n\t\t\n\t\tint CurrentRelativeLocation {\n\t\t\tget { return CurrentLocation - internalObjectStartPosition; }\n\t\t}\n\t\t\n\t\tstruct InternalObjectFrame\n\t\t{\n\t\t\tpublic readonly InternalObject InternalObject;\n\t\t\tpublic readonly int ParentStartPosition;\n\t\t\t\n\t\t\tpublic InternalObjectFrame(InternalObject internalObject, int parentStartPosition)\n\t\t\t{\n\t\t\t\tthis.InternalObject = internalObject;\n\t\t\t\tthis.ParentStartPosition = parentStartPosition;\n\t\t\t}\n\t\t}\n\t\t\n\t\tInternalObjectFrame BeginInternalObject(InternalObject internalObject)\n\t\t{\n\t\t\treturn BeginInternalObject(internalObject, this.CurrentLocation);\n\t\t}\n\t\t\n\t\tInternalObjectFrame BeginInternalObject(InternalObject internalObject, int beginLocation)\n\t\t{\n\t\t\tinternalObject.StartRelativeToParent = beginLocation - internalObjectStartPosition;\n\t\t\t\n\t\t\tvar frame = new InternalObjectFrame(internalObject, internalObjectStartPosition);\n\t\t\t\n\t\t\tinternalObjectStartPosition = CurrentLocation;\n\t\t\treturn frame;\n\t\t}\n\t\t\n\t\tvoid EndInternalObject(InternalObjectFrame frame, bool storeNewObject = true)\n\t\t{\n\t\t\tframe.InternalObject.Length = this.CurrentLocation - internalObjectStartPosition;\n\t\t\tframe.InternalObject.LengthTouched = this.MaxTouchedLocation - internalObjectStartPosition;\n\t\t\tframe.InternalObject.SyntaxErrors = GetSyntaxErrors();\n\t\t\tif (storeNewObject)\n\t\t\t\tStoreObject(frame.InternalObject);\n\t\t\tinternalObjectStartPosition = frame.ParentStartPosition;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Tag\n\t\t/// <summary>\n\t\t/// Context: \"&lt;\"\n\t\t/// </summary>\n\t\tvoid ReadTag()\n\t\t{\n\t\t\tAssertHasMoreData();\n\t\t\t\n\t\t\tint tagStart = this.CurrentLocation;\n\t\t\tInternalTag tag = new InternalTag();\n\t\t\tvar frame = BeginInternalObject(tag);\n\t\t\t\n\t\t\t// Read the opening bracket\n\t\t\t// It identifies the type of tag and parsing behavior for the rest of it\n\t\t\ttag.OpeningBracket = ReadOpeningBracket();\n\t\t\t\n\t\t\tif (tag.IsUnknownBang && !TryPeekWhiteSpace())\n\t\t\t\tOnSyntaxError(tagStart, this.CurrentLocation, \"Unknown tag\");\n\t\t\t\n\t\t\tif (tag.IsStartOrEmptyTag || tag.IsEndTag || tag.IsProcessingInstruction) {\n\t\t\t\t// Read the name\n\t\t\t\tTryMoveToNonWhiteSpace();\n\t\t\t\ttag.RelativeNameStart = this.CurrentRelativeLocation;\n\t\t\t\tstring name;\n\t\t\t\tif (TryReadName(out name)) {\n\t\t\t\t\tif (!IsValidName(name)) {\n\t\t\t\t\t\tOnSyntaxError(this.CurrentLocation - name.Length, this.CurrentLocation, \"The name '{0}' is invalid\", name);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tOnSyntaxError(\"Element name expected\");\n\t\t\t\t}\n\t\t\t\ttag.Name = name;\n\t\t\t} else {\n\t\t\t\ttag.Name = string.Empty;\n\t\t\t}\n\t\t\t\n\t\t\tbool isXmlDeclr = tag.Name == \"xml\" && tag.IsProcessingInstruction;\n\t\t\tint oldObjectCount = objects.Count;\n\t\t\t\n\t\t\tif (tag.IsStartOrEmptyTag || tag.IsEndTag || isXmlDeclr) {\n\t\t\t\t// Read attributes for the tag\n\t\t\t\twhile (HasMoreData()) {\n\t\t\t\t\tif (!TryMoveToNonWhiteSpace())\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// Check for all forbiden 'name' characters first - see ReadName\n\t\t\t\t\tif (TryPeek('<')) break;\n\t\t\t\t\tstring endBr;\n\t\t\t\t\tint endBrStart = this.CurrentLocation; // Just peek\n\t\t\t\t\tif (TryReadClosingBracket(out endBr)) {  // End tag\n\t\t\t\t\t\tGoBack(endBrStart);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// We have \"=\\'\\\"\" or name - read attribute\n\t\t\t\t\tint attrStartOffset = this.CurrentLocation;\n\t\t\t\t\tReadAttribute();\n\t\t\t\t\tif (tag.IsEndTag)\n\t\t\t\t\t\tOnSyntaxError(attrStartOffset, this.CurrentLocation, \"Attribute not allowed in end tag.\");\n\t\t\t\t}\n\t\t\t} else if (tag.IsDocumentType) {\n\t\t\t\tReadContentOfDTD();\n\t\t\t} else {\n\t\t\t\tint start = this.CurrentLocation;\n\t\t\t\tif (tag.IsComment) {\n\t\t\t\t\tReadText(TextType.Comment);\n\t\t\t\t} else if (tag.IsCData) {\n\t\t\t\t\tReadText(TextType.CData);\n\t\t\t\t} else if (tag.IsProcessingInstruction) {\n\t\t\t\t\tReadText(TextType.ProcessingInstruction);\n\t\t\t\t} else if (tag.IsUnknownBang) {\n\t\t\t\t\tReadText(TextType.UnknownBang);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new InternalException(string.Format(CultureInfo.InvariantCulture, \"Unknown opening bracket '{0}'\", tag.OpeningBracket));\n\t\t\t\t}\n\t\t\t\t// Backtrack at complete start\n\t\t\t\tif (IsEndOfFile() || (tag.IsUnknownBang && TryPeek('<'))) {\n\t\t\t\t\tGoBack(start);\n\t\t\t\t\tobjects.RemoveRange(oldObjectCount, objects.Count - oldObjectCount);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Read closing bracket\n\t\t\tstring bracket;\n\t\t\tTryReadClosingBracket(out bracket);\n\t\t\ttag.ClosingBracket = bracket;\n\t\t\t\n\t\t\t// Error check\n\t\t\tint brStart = this.CurrentLocation - (tag.ClosingBracket ?? string.Empty).Length;\n\t\t\tint brEnd = this.CurrentLocation;\n\t\t\tif (tag.Name == null) {\n\t\t\t\t// One error was reported already\n\t\t\t} else if (tag.IsStartOrEmptyTag) {\n\t\t\t\tif (tag.ClosingBracket != \">\" && tag.ClosingBracket != \"/>\") OnSyntaxError(brStart, brEnd, \"'>' or '/>' expected\");\n\t\t\t} else if (tag.IsEndTag) {\n\t\t\t\tif (tag.ClosingBracket != \">\") OnSyntaxError(brStart, brEnd, \"'>' expected\");\n\t\t\t} else if (tag.IsComment) {\n\t\t\t\tif (tag.ClosingBracket != \"-->\") OnSyntaxError(brStart, brEnd, \"'-->' expected\");\n\t\t\t} else if (tag.IsCData) {\n\t\t\t\tif (tag.ClosingBracket != \"]]>\") OnSyntaxError(brStart, brEnd, \"']]>' expected\");\n\t\t\t} else if (tag.IsProcessingInstruction) {\n\t\t\t\tif (tag.ClosingBracket != \"?>\") OnSyntaxError(brStart, brEnd, \"'?>' expected\");\n\t\t\t} else if (tag.IsUnknownBang) {\n\t\t\t\tif (tag.ClosingBracket != \">\") OnSyntaxError(brStart, brEnd, \"'>' expected\");\n\t\t\t} else if (tag.IsDocumentType) {\n\t\t\t\tif (tag.ClosingBracket != \">\") OnSyntaxError(brStart, brEnd, \"'>' expected\");\n\t\t\t} else {\n\t\t\t\tthrow new InternalException(string.Format(CultureInfo.InvariantCulture, \"Unknown opening bracket '{0}'\", tag.OpeningBracket));\n\t\t\t}\n\t\t\t\n\t\t\t// Attribute name may not apper multiple times\n\t\t\tif (objects.Count > oldObjectCount) {\n\t\t\t\t// Move nested objects into tag.NestedObjects:\n\t\t\t\ttag.NestedObjects = new InternalObject[objects.Count - oldObjectCount];\n\t\t\t\tobjects.CopyTo(oldObjectCount, tag.NestedObjects, 0, tag.NestedObjects.Length);\n\t\t\t\tobjects.RemoveRange(oldObjectCount, objects.Count - oldObjectCount);\n\t\t\t\t\n\t\t\t\t// Look for duplicate attributes:\n\t\t\t\tHashSet<string> attributeNames = new HashSet<string>();\n\t\t\t\tforeach (var obj in tag.NestedObjects) {\n\t\t\t\t\tInternalAttribute attr = obj as InternalAttribute;\n\t\t\t\t\tif (attr != null && !attributeNames.Add(attr.Name)) {\n\t\t\t\t\t\tint attrStart = tagStart + attr.StartRelativeToParent;\n\t\t\t\t\t\tOnSyntaxError(attrStart, attrStart + attr.Name.Length, \"Attribute with name '{0}' already exists\", attr.Name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tEndInternalObject(frame);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read DTD\n\t\tvoid ReadContentOfDTD()\n\t\t{\n\t\t\tint start = this.CurrentLocation;\n\t\t\twhile (HasMoreData()) {\n\t\t\t\tTryMoveToNonWhiteSpace();            // Skip whitespace\n\t\t\t\tif (TryRead('\\'')) TryMoveTo('\\'');  // Skip single quoted string TODO: Bug\n\t\t\t\tif (TryRead('\\\"')) TryMoveTo('\\\"');  // Skip single quoted string\n\t\t\t\tif (TryRead('[')) {                  // Start of nested infoset\n\t\t\t\t\t// Reading infoset\n\t\t\t\t\twhile (HasMoreData()) {\n\t\t\t\t\t\tTryMoveToAnyOf('<', ']');\n\t\t\t\t\t\tif (TryPeek('<')) {\n\t\t\t\t\t\t\tif (start != this.CurrentLocation) {  // Two following tags\n\t\t\t\t\t\t\t\tMakeText(start, this.CurrentLocation);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tReadTag();\n\t\t\t\t\t\t\tstart = this.CurrentLocation;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (TryPeek(']')) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tTryRead(']');                        // End of nested infoset\n\t\t\t\tif (TryPeek('>')) break;             // Proper closing\n\t\t\t\tif (TryPeek('<')) break;             // Malformed XML\n\t\t\t\tTryMoveNext();                       // Skip anything else\n\t\t\t}\n\t\t\tif (start != this.CurrentLocation) {\n\t\t\t\tMakeText(start, this.CurrentLocation);\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid MakeText(int start, int end)\n\t\t{\n\t\t\tLog.DebugAssert(end > start, \"Empty text\");\n\t\t\tLog.DebugAssert(end == this.CurrentLocation, \"end == current location\");\n\t\t\t\n\t\t\tInternalText text = new InternalText();\n\t\t\tvar frame = BeginInternalObject(text, start);\n\t\t\ttext.Type = TextType.Other;\n\t\t\ttext.Value = GetText(start, end);\n\t\t\tEndInternalObject(frame);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Read Brackets\n\t\t/// <summary>\n\t\t/// Reads any of the know opening brackets.  (only full bracket)\n\t\t/// Context: \"&lt;\"\n\t\t/// </summary>\n\t\tstring ReadOpeningBracket()\n\t\t{\n\t\t\t// We are using a lot of string literals so that the memory instances are shared\n\t\t\t//int start = this.CurrentLocation;\n\t\t\tif (TryRead('<')) {\n\t\t\t\tif (TryRead('/')) {\n\t\t\t\t\treturn \"</\";\n\t\t\t\t} else if (TryRead('?')) {\n\t\t\t\t\treturn \"<?\";\n\t\t\t\t} else if (TryRead('!')) {\n\t\t\t\t\tif (TryRead(\"--\")) {\n\t\t\t\t\t\treturn \"<!--\";\n\t\t\t\t\t} else if (TryRead(\"[CDATA[\")) {\n\t\t\t\t\t\treturn \"<![CDATA[\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach (string dtdName in AXmlTag.DtdNames) {\n\t\t\t\t\t\t\t// the dtdName includes \"<!\"\n\t\t\t\t\t\t\tif (TryRead(dtdName.Remove(0, 2))) return dtdName;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"<!\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn \"<\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new InternalException(\"'<' expected\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Reads any of the know closing brackets.  (only full bracket)\n\t\t/// Context: any\n\t\t/// </summary>\n\t\tbool TryReadClosingBracket(out string bracket)\n\t\t{\n\t\t\t// We are using a lot of string literals so that the memory instances are shared\n\t\t\tif (TryRead('>')) {\n\t\t\t\tbracket = \">\";\n\t\t\t} else \tif (TryRead(\"/>\")) {\n\t\t\t\tbracket = \"/>\";\n\t\t\t} else \tif (TryRead(\"?>\")) {\n\t\t\t\tbracket = \"?>\";\n\t\t\t} else if (TryRead(\"-->\")) {\n\t\t\t\tbracket = \"-->\";\n\t\t\t} else if (TryRead(\"]]>\")) {\n\t\t\t\tbracket = \"]]>\";\n\t\t\t} else {\n\t\t\t\tbracket = string.Empty;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Attributes\n\t\t/// <summary>\n\t\t/// Context: name or \"=\\'\\\"\"\n\t\t/// </summary>\n\t\tvoid ReadAttribute()\n\t\t{\n\t\t\tAssertHasMoreData();\n\t\t\t\n\t\t\tInternalAttribute attr = new InternalAttribute();\n\t\t\tvar frame = BeginInternalObject(attr);\n\t\t\t\n\t\t\t// Read name\n\t\t\tstring name;\n\t\t\tif (TryReadName(out name)) {\n\t\t\t\tif (!IsValidName(name)) {\n\t\t\t\t\tOnSyntaxError(this.CurrentLocation - name.Length, this.CurrentLocation, \"The name '{0}' is invalid\", name);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tOnSyntaxError(\"Attribute name expected\");\n\t\t\t}\n\t\t\tattr.Name = name;\n\t\t\t\n\t\t\t// Read equals sign and surrounding whitespace\n\t\t\tint checkpoint = this.CurrentLocation;\n\t\t\tTryMoveToNonWhiteSpace();\n\t\t\tif (TryRead('=')) {\n\t\t\t\tint chk2 = this.CurrentLocation;\n\t\t\t\tTryMoveToNonWhiteSpace();\n\t\t\t\tif (!TryPeek('\"') && !TryPeek('\\'')) {\n\t\t\t\t\t// Do not read whitespace if quote does not follow\n\t\t\t\t\tGoBack(chk2);\n\t\t\t\t}\n\t\t\t\tattr.EqualsSignLength = this.CurrentLocation - checkpoint;\n\t\t\t} else {\n\t\t\t\tGoBack(checkpoint);\n\t\t\t\tOnSyntaxError(\"'=' expected\");\n\t\t\t\tattr.EqualsSignLength = 0;\n\t\t\t}\n\t\t\t\n\t\t\t// Read attribute value\n\t\t\tint start = this.CurrentLocation;\n\t\t\tchar quoteChar = TryPeek('\"') ? '\"' : '\\'';\n\t\t\tbool startsWithQuote;\n\t\t\tif (TryRead(quoteChar)) {\n\t\t\t\tstartsWithQuote = true;\n\t\t\t\tint valueStart = this.CurrentLocation;\n\t\t\t\tTryMoveToAnyOf(quoteChar, '<');\n\t\t\t\tif (TryRead(quoteChar)) {\n\t\t\t\t\tif (!TryPeekAnyOf(' ', '\\t', '\\n', '\\r', '/', '>', '?')) {\n\t\t\t\t\t\tif (TryPeekPrevious('=', 2) || (TryPeekPrevious('=', 3) && TryPeekPrevious(' ', 2))) {\n\t\t\t\t\t\t\t// This actually most likely means that we are in the next attribute value\n\t\t\t\t\t\t\tGoBack(valueStart);\n\t\t\t\t\t\t\tReadAttributeValue(quoteChar);\n\t\t\t\t\t\t\tif (TryRead(quoteChar)) {\n\t\t\t\t\t\t\t\tOnSyntaxError(\"White space or end of tag expected\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tOnSyntaxError(\"Quote {0} expected (or add whitespace after the following one)\", quoteChar);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tOnSyntaxError(\"White space or end of tag expected\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// '<' or end of file\n\t\t\t\t\tGoBack(valueStart);\n\t\t\t\t\tReadAttributeValue(quoteChar);\n\t\t\t\t\tOnSyntaxError(\"Quote {0} expected\", quoteChar);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstartsWithQuote = false;\n\t\t\t\tint valueStart = this.CurrentLocation;\n\t\t\t\tReadAttributeValue(null);\n\t\t\t\tTryRead('\\\"');\n\t\t\t\tTryRead('\\'');\n\t\t\t\tif (valueStart == this.CurrentLocation) {\n\t\t\t\t\tOnSyntaxError(\"Attribute value expected\");\n\t\t\t\t} else {\n\t\t\t\t\tOnSyntaxError(valueStart, this.CurrentLocation, \"Attribute value must be quoted\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tstring val = GetText(start, this.CurrentLocation);\n\t\t\tval = Unquote(val);\n\t\t\tattr.Value = Dereference(val, startsWithQuote ? start + 1 : start);\n\t\t\t\n\t\t\tEndInternalObject(frame);\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Read everything up to quote (excluding), opening/closing tag or attribute signature\n\t\t/// </summary>\n\t\tvoid ReadAttributeValue(char? quote)\n\t\t{\n\t\t\twhile (HasMoreData()) {\n\t\t\t\t// What is next?\n\t\t\t\tint start = this.CurrentLocation;\n\t\t\t\tTryMoveToNonWhiteSpace();  // Read white space (if any)\n\t\t\t\tif (quote.HasValue) {\n\t\t\t\t\tif (TryPeek(quote.Value)) return;\n\t\t\t\t} else {\n\t\t\t\t\tif (TryPeek('\"') || TryPeek('\\'')) return;\n\t\t\t\t}\n\t\t\t\t// Opening/closing tag\n\t\t\t\tstring endBr;\n\t\t\t\tif (TryPeek('<') || TryReadClosingBracket(out endBr)) {\n\t\t\t\t\tGoBack(start);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Try reading attribute signature\n\t\t\t\tif (TryReadName()) {\n\t\t\t\t\tint nameEnd = this.CurrentLocation;\n\t\t\t\t\tif (TryMoveToNonWhiteSpace() && TryRead(\"=\") &&\n\t\t\t\t\t    TryMoveToNonWhiteSpace() && TryPeekAnyOf('\"', '\\''))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Start of attribute.  Great\n\t\t\t\t\t\tGoBack(start);\n\t\t\t\t\t\treturn;  // Done\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Just some gargabe - make it part of the value\n\t\t\t\t\t\tGoBack(nameEnd);\n\t\t\t\t\t\tcontinue;  // Read more\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tTryMoveNext(); // Accept everyting else\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary> Remove quoting from the given string </summary>\n\t\tstatic string Unquote(string quoted)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(quoted)) return string.Empty;\n\t\t\tchar first = quoted[0];\n\t\t\tif (quoted.Length == 1) return (first == '\"' || first == '\\'') ? string.Empty : quoted;\n\t\t\tchar last  = quoted[quoted.Length - 1];\n\t\t\tif (first == '\"' || first == '\\'') {\n\t\t\t\tif (first == last) {\n\t\t\t\t\t// Remove both quotes\n\t\t\t\t\treturn quoted.Substring(1, quoted.Length - 2);\n\t\t\t\t} else {\n\t\t\t\t\t// Remove first quote\n\t\t\t\t\treturn quoted.Remove(0, 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (last == '\"' || last == '\\'') {\n\t\t\t\t\t// Remove last quote\n\t\t\t\t\treturn quoted.Substring(0, quoted.Length - 1);\n\t\t\t\t} else {\n\t\t\t\t\t// Keep whole string\n\t\t\t\t\treturn quoted;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Text\n\t\t/// <summary>\n\t\t/// Reads text.\n\t\t/// </summary>\n\t\tvoid ReadText(TextType type)\n\t\t{\n\t\t\tvar text = new InternalText();\n\t\t\tvar frame = BeginInternalObject(text);\n\t\t\ttext.Type = type;\n\t\t\t\n\t\t\tint start = this.CurrentLocation;\n\t\t\tint fragmentEnd = inputLength;\n\t\t\t\n\t\t\t// Whitespace would be skipped anyway by any operation\n\t\t\tTryMoveToNonWhiteSpace(fragmentEnd);\n\t\t\tint wsEnd = this.CurrentLocation;\n\t\t\t\n\t\t\t// Try move to the terminator given by the context\n\t\t\tif (type == TextType.WhiteSpace) {\n\t\t\t\tTryMoveToNonWhiteSpace(fragmentEnd);\n\t\t\t} else if (type == TextType.CharacterData) {\n\t\t\t\twhile(true) {\n\t\t\t\t\tif (!TryMoveToAnyOf(new char[] {'<', ']'}, fragmentEnd)) break; // End of fragment\n\t\t\t\t\tif (TryPeek('<')) break;\n\t\t\t\t\tif (TryPeek(']')) {\n\t\t\t\t\t\tif (TryPeek(\"]]>\")) {\n\t\t\t\t\t\t\tOnSyntaxError(this.CurrentLocation, this.CurrentLocation + 3, \"']]>' is not allowed in text\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tTryMoveNext();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new InternalException(\"Infinite loop\");\n\t\t\t\t}\n\t\t\t} else if (type == TextType.Comment) {\n\t\t\t\t// Do not report too many errors\n\t\t\t\tbool errorReported = false;\n\t\t\t\twhile(true) {\n\t\t\t\t\tif (!TryMoveTo('-', fragmentEnd)) break; // End of fragment\n\t\t\t\t\tif (TryPeek(\"-->\")) break;\n\t\t\t\t\tif (TryPeek(\"--\") && !errorReported) {\n\t\t\t\t\t\tOnSyntaxError(this.CurrentLocation, this.CurrentLocation + 2, \"'--' is not allowed in comment\");\n\t\t\t\t\t\terrorReported = true;\n\t\t\t\t\t}\n\t\t\t\t\tTryMoveNext();\n\t\t\t\t}\n\t\t\t} else if (type == TextType.CData) {\n\t\t\t\twhile(true) {\n\t\t\t\t\t// We can not use use TryMoveTo(\"]]>\", fragmentEnd) because it may incorectly accept \"]\" at the end of fragment\n\t\t\t\t\tif (!TryMoveTo(']', fragmentEnd)) break; // End of fragment\n\t\t\t\t\tif (TryPeek(\"]]>\")) break;\n\t\t\t\t\tTryMoveNext();\n\t\t\t\t}\n\t\t\t} else if (type == TextType.ProcessingInstruction) {\n\t\t\t\twhile(true) {\n\t\t\t\t\tif (!TryMoveTo('?', fragmentEnd)) break; // End of fragment\n\t\t\t\t\tif (TryPeek(\"?>\")) break;\n\t\t\t\t\tTryMoveNext();\n\t\t\t\t}\n\t\t\t} else if (type == TextType.UnknownBang) {\n\t\t\t\tTryMoveToAnyOf(new char[] {'<', '>'}, fragmentEnd);\n\t\t\t} else {\n\t\t\t\tthrow new InternalException(\"Unknown type \" + type);\n\t\t\t}\n\t\t\t\n\t\t\ttext.ContainsOnlyWhitespace = (wsEnd == this.CurrentLocation);\n\t\t\t\n\t\t\tstring escapedValue = GetText(start, this.CurrentLocation);\n\t\t\tif (type == TextType.CharacterData) {\n\t\t\t\ttext.Value = Dereference(escapedValue, start);\n\t\t\t} else {\n\t\t\t\ttext.Value = escapedValue;\n\t\t\t}\n\t\t\ttext.Value = GetCachedString(text.Value);\n\t\t\t\n\t\t\tEndInternalObject(frame, storeNewObject: this.CurrentLocation > start);\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Dereference\n\t\tconst int maxEntityLength = 16; // The longest built-in one is 10 (\"&#1114111;\")\n\t\t\n\t\tstring Dereference(string text, int textLocation)\n\t\t{\n\t\t\tStringBuilder sb = null;  // The dereferenced text so far (all up to 'curr')\n\t\t\tint curr = 0;\n\t\t\twhile(true) {\n\t\t\t\t// Reached end of input\n\t\t\t\tif (curr == text.Length) {\n\t\t\t\t\tif (sb != null) {\n\t\t\t\t\t\treturn sb.ToString();\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn text;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Try to find reference\n\t\t\t\tint start = text.IndexOf('&', curr);\n\t\t\t\t\n\t\t\t\t// No more references found\n\t\t\t\tif (start == -1) {\n\t\t\t\t\tif (sb != null) {\n\t\t\t\t\t\tsb.Append(text, curr, text.Length - curr); // Add rest\n\t\t\t\t\t\treturn sb.ToString();\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn text;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Append text before the enitiy reference\n\t\t\t\tif (sb == null) sb = new StringBuilder(text.Length);\n\t\t\t\tsb.Append(text, curr, start - curr);\n\t\t\t\tcurr = start;\n\t\t\t\t\n\t\t\t\t// Process the entity\n\t\t\t\tint errorLoc = textLocation + sb.Length;\n\t\t\t\t\n\t\t\t\t// Find entity name\n\t\t\t\tint end = text.IndexOfAny(new char[] {'&', ';'}, start + 1, Math.Min(maxEntityLength, text.Length - (start + 1)));\n\t\t\t\tif (end == -1 || text[end] == '&') {\n\t\t\t\t\t// Not found\n\t\t\t\t\tOnSyntaxError(errorLoc, errorLoc + 1, \"Entity reference must be terminated with ';'\");\n\t\t\t\t\t// Keep '&'\n\t\t\t\t\tsb.Append('&');\n\t\t\t\t\tcurr++;\n\t\t\t\t\tcontinue;  // Restart and next character location\n\t\t\t\t}\n\t\t\t\tstring name = text.Substring(start + 1, end - (start + 1));\n\t\t\t\t\n\t\t\t\t// Resolve the name\n\t\t\t\tstring replacement;\n\t\t\t\tif (name.Length == 0) {\n\t\t\t\t\treplacement = null;\n\t\t\t\t\tOnSyntaxError(errorLoc + 1, errorLoc + 1, \"Entity name expected\");\n\t\t\t\t} else if (name == \"amp\") {\n\t\t\t\t\treplacement = \"&\";\n\t\t\t\t} else if (name == \"lt\") {\n\t\t\t\t\treplacement = \"<\";\n\t\t\t\t} else if (name == \"gt\") {\n\t\t\t\t\treplacement = \">\";\n\t\t\t\t} else if (name == \"apos\") {\n\t\t\t\t\treplacement = \"'\";\n\t\t\t\t} else if (name == \"quot\") {\n\t\t\t\t\treplacement = \"\\\"\";\n\t\t\t\t} else if (name.Length > 0 && name[0] == '#') {\n\t\t\t\t\tint num;\n\t\t\t\t\tif (name.Length > 1 && name[1] == 'x') {\n\t\t\t\t\t\tif (!int.TryParse(name.Substring(2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture.NumberFormat, out num)) {\n\t\t\t\t\t\t\tnum = -1;\n\t\t\t\t\t\t\tOnSyntaxError(errorLoc + 3, errorLoc + 1 + name.Length, \"Hexadecimal code of unicode character expected\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!int.TryParse(name.Substring(1), NumberStyles.None, CultureInfo.InvariantCulture.NumberFormat, out num)) {\n\t\t\t\t\t\t\tnum = -1;\n\t\t\t\t\t\t\tOnSyntaxError(errorLoc + 2, errorLoc + 1 + name.Length, \"Numeric code of unicode character expected\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (num != -1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treplacement = char.ConvertFromUtf32(num);\n\t\t\t\t\t\t} catch (ArgumentOutOfRangeException) {\n\t\t\t\t\t\t\treplacement = null;\n\t\t\t\t\t\t\tOnSyntaxError(errorLoc + 2, errorLoc + 1 + name.Length, \"Invalid unicode character U+{0:X} ({0})\", num);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treplacement = null;\n\t\t\t\t\t}\n\t\t\t\t} else if (!IsValidName(name)) {\n\t\t\t\t\treplacement = null;\n\t\t\t\t\tOnSyntaxError(errorLoc + 1, errorLoc + 1, \"Invalid entity name\");\n\t\t\t\t} else {\n\t\t\t\t\treplacement = null;\n\t\t\t\t\tif (tagSoupParser.UnknownEntityReferenceIsError) {\n\t\t\t\t\t\tOnSyntaxError(errorLoc, errorLoc + 1 + name.Length + 1, \"Unknown entity reference '{0}'\", name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Append the replacement to output\n\t\t\t\tif (replacement != null) {\n\t\t\t\t\tsb.Append(replacement);\n\t\t\t\t} else {\n\t\t\t\t\tsb.Append('&');\n\t\t\t\t\tsb.Append(name);\n\t\t\t\t\tsb.Append(';');\n\t\t\t\t}\n\t\t\t\tcurr = end + 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Syntax Errors\n\t\tList<InternalSyntaxError> syntaxErrors = new List<InternalSyntaxError>();\n\t\t\n\t\tInternalSyntaxError[] GetSyntaxErrors()\n\t\t{\n\t\t\tif (syntaxErrors.Count > 0) {\n\t\t\t\tvar arr = syntaxErrors.ToArray();\n\t\t\t\tsyntaxErrors.Clear();\n\t\t\t\treturn arr;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tvoid OnSyntaxError(string message, params object[] args)\n\t\t{\n\t\t\tOnSyntaxError(this.CurrentLocation, this.CurrentLocation + 1, message, args);\n\t\t}\n\t\t\n\t\tvoid OnSyntaxError(int start, int end, string message, params object[] args)\n\t\t{\n\t\t\tif (end <= start) end = start + 1;\n\t\t\tstring formattedMessage = string.Format(CultureInfo.InvariantCulture, message, args);\n\t\t\tLog.WriteLine(\"Syntax error ({0}-{1}): {2}\", start, end, formattedMessage);\n\t\t\tsyntaxErrors.Add(new InternalSyntaxError(start - internalObjectStartPosition, end - internalObjectStartPosition, formattedMessage));\n\t\t}\n\t\t#endregion\n\t\t\n\t\t#region Helper functions\n\t\tinternal static bool IsValidName(string name)\n\t\t{\n\t\t\ttry {\n\t\t\t\tSystem.Xml.XmlConvert.VerifyName(name);\n\t\t\t\treturn true;\n\t\t\t} catch (System.Xml.XmlException) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/TextType.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\t/// <summary> Identifies the context in which the text occured </summary>\n\tenum TextType\n\t{\n\t\t/// <summary> Ends with non-whitespace </summary>\n\t\tWhiteSpace,\n\t\t\n\t\t/// <summary> Ends with \"&lt;\";  \"]]&gt;\" is error </summary>\n\t\tCharacterData,\n\t\t\n\t\t/// <summary> Ends with \"-->\";  \"--\" is error </summary>\n\t\tComment,\n\t\t\n\t\t/// <summary> Ends with \"]]&gt;\" </summary>\n\t\tCData,\n\t\t\n\t\t/// <summary> Ends with \"?>\" </summary>\n\t\tProcessingInstruction,\n\t\t\n\t\t/// <summary> Ends with \"&lt;\" or \">\" </summary>\n\t\tUnknownBang,\n\t\t\n\t\t/// <summary> Unknown </summary>\n\t\tOther\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/TokenReader.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\tclass TokenReader\n\t{\n\t\tprotected readonly ITextSource input;\n\t\tprotected readonly int inputLength;\n\t\tint currentLocation;\n\t\t\n\t\t// CurrentLocation is assumed to be touched and the fact does not\n\t\t//   have to be recorded in this variable.\n\t\t// This stores any value bigger than that if applicable.\n\t\t// Actual value is max(currentLocation, maxTouchedLocation).\n\t\tint maxTouchedLocation;\n\t\t\n\t\tpublic int InputLength {\n\t\t\tget { return inputLength; }\n\t\t}\n\t\t\n\t\tpublic int CurrentLocation {\n\t\t\tget { return currentLocation; }\n\t\t}\n\t\t\n\t\tpublic int MaxTouchedLocation {\n\t\t\t// add 1 to currentLocation because single-char-peek does not increment maxTouchedLocation\n\t\t\tget { return Math.Max(currentLocation + 1, maxTouchedLocation); }\n\t\t}\n\t\t\n\t\tpublic TokenReader(ITextSource input)\n\t\t{\n\t\t\tthis.input = input;\n\t\t\tthis.inputLength = input.TextLength;\n\t\t}\n\t\t\n\t\tprotected bool IsEndOfFile()\n\t\t{\n\t\t\treturn currentLocation == inputLength;\n\t\t}\n\t\t\n\t\tprotected bool HasMoreData()\n\t\t{\n\t\t\treturn currentLocation < inputLength;\n\t\t}\n\t\t\n\t\tprotected void AssertHasMoreData()\n\t\t{\n\t\t\tLog.Assert(HasMoreData(), \"Unexpected end of file\");\n\t\t}\n\t\t\n\t\tprotected bool TryMoveNext()\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\t\n\t\t\tcurrentLocation++;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tprotected void Skip(int count)\n\t\t{\n\t\t\tLog.Assert(currentLocation + count <= inputLength, \"Skipping after the end of file\");\n\t\t\tcurrentLocation += count;\n\t\t}\n\t\t\n\t\tprotected void GoBack(int oldLocation)\n\t\t{\n\t\t\tLog.Assert(oldLocation <= currentLocation, \"Trying to move forward\");\n\t\t\t// add 1 because single-char-peek does not increment maxTouchedLocation\n\t\t\tmaxTouchedLocation = Math.Max(maxTouchedLocation, currentLocation + 1);\n\t\t\tcurrentLocation = oldLocation;\n\t\t}\n\t\t\n\t\tprotected bool TryRead(char c)\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\t\n\t\t\tif (input.GetCharAt(currentLocation) == c) {\n\t\t\t\tcurrentLocation++;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected bool TryReadAnyOf(params char[] c)\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\t\n\t\t\tif (c.Contains(input.GetCharAt(currentLocation))) {\n\t\t\t\tcurrentLocation++;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected bool TryRead(string text)\n\t\t{\n\t\t\tif (TryPeek(text)) {\n\t\t\t\tcurrentLocation += text.Length;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected bool TryPeekPrevious(char c, int back)\n\t\t{\n\t\t\tif (currentLocation - back == inputLength) return false;\n\t\t\tif (currentLocation - back < 0 ) return false;\n\t\t\t\n\t\t\treturn input.GetCharAt(currentLocation - back) == c;\n\t\t}\n\t\t\n\t\tprotected bool TryPeek(char c)\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\t\n\t\t\treturn input.GetCharAt(currentLocation) == c;\n\t\t}\n\t\t\n\t\tprotected bool TryPeekAnyOf(params char[] chars)\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\t\n\t\t\treturn chars.Contains(input.GetCharAt(currentLocation));\n\t\t}\n\t\t\n\t\tprotected bool TryPeek(string text)\n\t\t{\n\t\t\tif (!TryPeek(text[0])) return false; // Early exit\n\t\t\t\n\t\t\tmaxTouchedLocation = Math.Max(maxTouchedLocation, currentLocation + text.Length);\n\t\t\t// The following comparison 'touches' the end of file - it does depend on the end being there\n\t\t\tif (currentLocation + text.Length > inputLength) return false;\n\t\t\t\n\t\t\treturn input.GetText(currentLocation, text.Length) == text;\n\t\t}\n\t\t\n\t\tprotected bool TryPeekWhiteSpace()\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\t\n\t\t\tchar c = input.GetCharAt(currentLocation);\n\t\t\treturn ((int)c <= 0x20) && (c == ' ' || c == '\\t' || c == '\\n' || c == '\\r');\n\t\t}\n\t\t\n\t\t// The move functions do not have to move if already at target\n\t\t// The move functions allow 'overriding' of the document length\n\t\t\n\t\tprotected bool TryMoveTo(char c)\n\t\t{\n\t\t\treturn TryMoveTo(c, inputLength);\n\t\t}\n\t\t\n\t\tprotected bool TryMoveTo(char c, int inputLength)\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\tint index = input.IndexOf(c, currentLocation, inputLength - currentLocation);\n\t\t\tif (index != -1) {\n\t\t\t\tcurrentLocation = index;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tcurrentLocation = inputLength;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected bool TryMoveToAnyOf(params char[] c)\n\t\t{\n\t\t\treturn TryMoveToAnyOf(c, inputLength);\n\t\t}\n\t\t\n\t\tprotected bool TryMoveToAnyOf(char[] c, int inputLength)\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\tint index = input.IndexOfAny(c, currentLocation, inputLength - currentLocation);\n\t\t\tif (index != -1) {\n\t\t\t\tcurrentLocation = index;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tcurrentLocation = inputLength;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected bool TryMoveTo(string text)\n\t\t{\n\t\t\treturn TryMoveTo(text, inputLength);\n\t\t}\n\t\t\n\t\tprotected bool TryMoveTo(string text, int inputLength)\n\t\t{\n\t\t\tif (currentLocation == inputLength) return false;\n\t\t\tint index = input.IndexOf(text, currentLocation, inputLength - currentLocation, StringComparison.Ordinal);\n\t\t\tif (index != -1) {\n\t\t\t\tmaxTouchedLocation = index + text.Length;\n\t\t\t\tcurrentLocation = index;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tcurrentLocation = inputLength;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected bool TryMoveToNonWhiteSpace()\n\t\t{\n\t\t\treturn TryMoveToNonWhiteSpace(inputLength);\n\t\t}\n\t\t\n\t\tprotected bool TryMoveToNonWhiteSpace(int inputLength)\n\t\t{\n\t\t\twhile(true) {\n\t\t\t\tif (currentLocation == inputLength) return false; // Reject end of file\n\t\t\t\tchar c = input.GetCharAt(currentLocation);\n\t\t\t\tif (((int)c <= 0x20) && (c == ' ' || c == '\\t' || c == '\\n' || c == '\\r')) {\n\t\t\t\t\tcurrentLocation++;                            // Accept white-space\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\treturn true;  // Found non-white-space\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/// <summary>\n\t\t/// Read a name token.\n\t\t/// The following characters are not allowed:\n\t\t///   \"\"         End of file\n\t\t///   \" \\n\\r\\t\"  Whitesapce\n\t\t///   \"=\\'\\\"\"    Attribute value\n\t\t///   \"&lt;>/?\"  Tags\n\t\t/// </summary>\n\t\t/// <returns>Returns the length of the name</returns>\n\t\tprotected bool TryReadName()\n\t\t{\n\t\t\tint start = currentLocation;\n\t\t\t// Keep reading up to invalid character\n\t\t\twhile (HasMoreData()) {\n\t\t\t\tchar c = input.GetCharAt(currentLocation);\n\t\t\t\tif (0x41 <= (int)c) {                                   // Accpet from 'A' onwards\n\t\t\t\t\tcurrentLocation++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (c == ' ' || c == '\\n' || c == '\\r' || c == '\\t' ||  // Reject whitesapce\n\t\t\t\t    c == '=' || c == '\\'' || c == '\"'  ||               // Reject attributes\n\t\t\t\t    c == '<' || c == '>'  || c == '/'  || c == '?') {   // Reject tags\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentLocation++;\n\t\t\t\t\tcontinue;                                            // Accept other character\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn currentLocation > start;\n\t\t}\n\t\t\n\t\tprotected bool TryReadName(out string name)\n\t\t{\n\t\t\tint start = currentLocation;\n\t\t\tif (TryReadName()) {\n\t\t\t\tname = GetCachedString(GetText(start, currentLocation));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tname = string.Empty;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected string GetText(int start, int end)\n\t\t{\n\t\t\tLog.Assert(end <= currentLocation, \"Reading ahead of current location\");\n\t\t\treturn input.GetText(start, end - start);\n\t\t}\n\t\t\n\t\tDictionary<string, string> stringCache = new Dictionary<string, string>();\n\t\t\n\t\t#if DEBUG\n\t\tint stringCacheRequestedCount;\n\t\tint stringCacheRequestedSize;\n\t\tint stringCacheStoredCount;\n\t\tint stringCacheStoredSize;\n\t\t#endif\n\t\t\n\t\tinternal void PrintStringCacheStats()\n\t\t{\n\t\t\t#if DEBUG\n\t\t\tLog.WriteLine(\"String cache: Requested {0} ({1} bytes);  Actaully stored {2} ({3} bytes); {4}% stored\", stringCacheRequestedCount, stringCacheRequestedSize, stringCacheStoredCount, stringCacheStoredSize, stringCacheRequestedSize == 0 ? 0 : stringCacheStoredSize * 100 / stringCacheRequestedSize);\n\t\t\t#endif\n\t\t}\n\t\t\n\t\t[Conditional(\"DEBUG\")]\n\t\tvoid AddToRequestedSize(string text)\n\t\t{\n\t\t\t#if DEBUG\n\t\t\tstringCacheRequestedCount += 1;\n\t\t\tstringCacheRequestedSize += 8 + 2 * text.Length;\n\t\t\t#endif\n\t\t}\n\t\t\n\t\t[Conditional(\"DEBUG\")]\n\t\tvoid AddToStoredSize(string text)\n\t\t{\n\t\t\t#if DEBUG\n\t\t\tstringCacheStoredCount += 1;\n\t\t\tstringCacheStoredSize += 8 + 2 * text.Length;\n\t\t\t#endif\n\t\t}\n\t\t\n\t\tprotected string GetCachedString(string cached)\n\t\t{\n\t\t\tAddToRequestedSize(cached);\n\t\t\t// Do not bother with long strings\n\t\t\tif (cached.Length > 32) {\n\t\t\t\tAddToStoredSize(cached);\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\tstring result;\n\t\t\tif (stringCache.TryGetValue(cached, out result)) {\n\t\t\t\t// Get the instance from the cache instead\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\t// Add to cache\n\t\t\t\tAddToStoredSize(cached);\n\t\t\t\tstringCache.Add(cached, cached);\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/ICSharpCode.NRefactory.Xml/XmlSegment.cs",
    "content": "﻿// Copyright (c) 2009-2013 AlphaSierraPapa for the SharpDevelop Team\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files (the \"Software\"), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify, merge,\n// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n// to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or\n// substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing ICSharpCode.NRefactory.Editor;\n\nnamespace ICSharpCode.NRefactory.Xml\n{\n\tsealed class XmlSegment : ISegment\n\t{\n\t\treadonly int startOffset, endOffset;\n\t\t\n\t\tpublic XmlSegment(int startOffset, int endOffset)\n\t\t{\n\t\t\tif (endOffset < startOffset)\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\tthis.startOffset = startOffset;\n\t\t\tthis.endOffset = endOffset;\n\t\t}\n\t\t\n\t\tint ISegment.Offset {\n\t\t\tget { return startOffset; }\n\t\t}\n\t\t\n\t\tint ISegment.Length {\n\t\t\tget { return endOffset - startOffset; }\n\t\t}\n\t\t\n\t\tint ISegment.EndOffset {\n\t\t\tget { return endOffset; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "3rdparty/NRefactory/NRefactory.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 11.00\r\n# Visual Studio 2010\r\n# SharpDevelop 5.0\r\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{DC98210E-1646-483B-819A-2BB8272461E4}\"\r\n\tProjectSection(SolutionItems) = preProject\r\n\t\tPackages\\ICSharpCode.NRefactory.nuspec = Packages\\ICSharpCode.NRefactory.nuspec\r\n\t\tICSharpCode.NRefactory.snk = ICSharpCode.NRefactory.snk\r\n\t\tREADME = README\r\n\t\tdoc\\TODO = doc\\TODO\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory\", \"ICSharpCode.NRefactory\\ICSharpCode.NRefactory.csproj\", \"{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.Tests\", \"ICSharpCode.NRefactory.Tests\\ICSharpCode.NRefactory.Tests.csproj\", \"{63D3B27A-D966-4902-90B3-30290E1692F1}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Mono.Cecil\", \"..\\cecil\\Mono.Cecil.csproj\", \"{D68133BD-1E63-496E-9EDE-4FBDBF77B486}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.CSharp\", \"ICSharpCode.NRefactory.CSharp\\ICSharpCode.NRefactory.CSharp.csproj\", \"{53DCA265-3C3C-42F9-B647-F72BA678122B}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.GtkDemo\", \"ICSharpCode.NRefactory.GtkDemo\\ICSharpCode.NRefactory.GtkDemo.csproj\", \"{A7EEF7F8-238F-459D-95A9-96467539641D}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.ConsistencyCheck\", \"ICSharpCode.NRefactory.ConsistencyCheck\\ICSharpCode.NRefactory.ConsistencyCheck.csproj\", \"{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.Xml\", \"ICSharpCode.NRefactory.Xml\\ICSharpCode.NRefactory.Xml.csproj\", \"{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.CSharp.AstVerifier\", \"ICSharpCode.NRefactory.CSharp.AstVerifier\\ICSharpCode.NRefactory.CSharp.AstVerifier.csproj\", \"{961DADFA-7CE6-429F-BC22-47630D6DB826}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.Demo\", \"ICSharpCode.NRefactory.Demo\\ICSharpCode.NRefactory.Demo.csproj\", \"{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"IKVM.Reflection\", \"..\\ikvm\\reflect\\IKVM.Reflection.csproj\", \"{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.IKVM\", \"ICSharpCode.NRefactory.IKVM\\ICSharpCode.NRefactory.IKVM.csproj\", \"{A727169F-D94F-443F-B305-B057D7F3B420}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.Cecil\", \"ICSharpCode.NRefactory.Cecil\\ICSharpCode.NRefactory.Cecil.csproj\", \"{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ICSharpCode.NRefactory.CSharp.Refactoring\", \"ICSharpCode.NRefactory.CSharp.Refactoring\\ICSharpCode.NRefactory.CSharp.Refactoring.csproj\", \"{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Any CPU = Debug|Any CPU\r\n\t\tDebug|x86 = Debug|x86\r\n\t\tRelease|Any CPU = Release|Any CPU\r\n\t\tRelease|x86 = Release|x86\r\n\t\tnet_4_5_Debug|Any CPU = net_4_5_Debug|Any CPU\r\n\t\tnet_4_5_Debug|x86 = net_4_5_Debug|x86\r\n\t\tnet_4_5_Release|Any CPU = net_4_5_Release|Any CPU\r\n\t\tnet_4_5_Release|x86 = net_4_5_Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Debug|x86.ActiveCfg = Debug|x86\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Debug|x86.Build.0 = Debug|x86\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Release|x86.ActiveCfg = Release|x86\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.Release|x86.Build.0 = Release|x86\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|x86\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|x86\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|x86\r\n\t\t{63D3B27A-D966-4902-90B3-30290E1692F1}.net_4_5_Release|x86.Build.0 = net_4_5_Release|x86\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.ActiveCfg = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.Build.0 = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.Build.0 = net_4_0_Release|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.ActiveCfg = net_4_0_Release|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.Build.0 = net_4_0_Release|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Debug|x86.ActiveCfg = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Debug|x86.Build.0 = net_4_0_Debug|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Release|x86.ActiveCfg = net_4_0_Release|Any CPU\r\n\t\t{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Release|x86.Build.0 = net_4_0_Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|x86.ActiveCfg = Debug|x86\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|x86.Build.0 = Debug|x86\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Release|x86.ActiveCfg = Release|x86\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Release|x86.Build.0 = Release|x86\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|x86\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|x86\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|x86\r\n\t\t{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.net_4_5_Release|x86.Build.0 = net_4_5_Release|x86\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{961DADFA-7CE6-429F-BC22-47630D6DB826}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Debug|x86.ActiveCfg = Debug|x86\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Debug|x86.Build.0 = Debug|x86\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Release|x86.ActiveCfg = Release|x86\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.Release|x86.Build.0 = Release|x86\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|x86\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|x86\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|x86\r\n\t\t{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}.net_4_5_Release|x86.Build.0 = net_4_5_Release|x86\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.net_4_5_Release|x86.Build.0 = Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{A727169F-D94F-443F-B305-B057D7F3B420}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Debug|x86.ActiveCfg = Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Debug|x86.Build.0 = Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Release|x86.ActiveCfg = Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.Release|x86.Build.0 = Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU\r\n\t\t{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(MonoDevelopProperties) = preSolution\r\n\t\tStartupItem = ICSharpCode.NRefactory.Demo\\ICSharpCode.NRefactory.Demo.csproj\r\n\t\tPolicies = $0\r\n\t\t$0.TextStylePolicy = $1\r\n\t\t$1.FileWidth = 120\r\n\t\t$1.TabsToSpaces = False\r\n\t\t$1.EolMarker = Unix\r\n\t\t$1.inheritsSet = VisualStudio\r\n\t\t$1.inheritsScope = text/plain\r\n\t\t$1.scope = text/plain\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "3rdparty/NRefactory/README",
    "content": "﻿Overview of the NRefactory library:\n\nIntroductory documentation:\n\t http://www.codeproject.com/Articles/408663/Using-NRefactory-for-analyzing-Csharp-code\n\nHow to download:\n\t- Binaries are provided as a NuGet package (http://nuget.org/packages/ICSharpCode.NRefactory)\n\t- Sourcecode is available on GitHub (https://github.com/icsharpcode/NRefactory)\n\nHow to compile:\n\t1. Get Mono.Cecil\n\t\tGet Cecil from https://github.com/jbevain/cecil ('git clone git://github.com/jbevain/cecil.git')\n\t\tor download Cecil from https://github.com/jbevain/cecil/ and unzip it into a directory named \"cecil\"\n\t\tnext to the directory containing NRefactory.\n\t2. If you need the IKVM binding get it from https://github.com/mono/ikvm-fork and put it next to the NRefactory directory\n\t\tlike Mono.Cecil - name it \"ikvm\".\n\t3. Open NRefactory.sln in your favorite .NET IDE and compile.\n\nFeatures:\n\t- C# Parser\n\t- Abstract Syntax Tree with pattern-matching support\n\t- Semantic Analysis for C# (supports C# 4.0 + async/await)\n\t- Code Completion for C#\n\t- Pretty Printer for C#\n\t- Lots of C# refactorings\n\t\nNon-Features:\n\t- VB support is not implemented yet.\n\t- NRefactory cannot generate IL code -- it's a compiler frontend, not a full compiler\n\nDependencies:\n\t.NET 4.0\n\tMono.Cecil 0.9.5\n\tNRefactory contains a modified copy of mcs (Mono's C# compiler) for the C# parser.\n\n\nNamespace overview:\n\nICSharpCode.NRefactory assembly\n\tICSharpCode.NRefactory.Editor:\n\t\tInterfaces that abstract from the text editor control used.\n\t\tMaybe future AvalonEdit versions will directly implement these interfaces, but you could also write adapters for other editors.\n\t\n\tICSharpCode.NRefactory.TypeSystem:\n\t\tContains a language-independent representation of the .NET type system.\n\t\tThe type system is divided into two portions: unresolved and resolved type systems.\n\t\n\tICSharpCode.NRefactory.TypeSystem.Implementation:\n\t\tContains default implementations for the type system interfaces.\n\t\n\tICSharpCode.NRefactory.Semantics:\n\t\tContains classes (ResolveResults) used to represent the semantics of a language element.\n\t\tResolveResults can have child results, thus forming semantic trees.\n\t\n\tICSharpCode.NRefactory.Documentation:\n\t\tClasses for working with .xml documentation files.\n\t\tSee \"doc/XML Documentation.html\" for details.\n\t\n\tICSharpCode.NRefactory.PatternMatching:\n\t\tProvides classes for pattern matching over the C# and VB ASTs.\n\t\tSee \"doc/Pattern Matching.html\" for details.\n\t\n\tICSharpCode.NRefactory.Util:\n\t\tVarious helper classes.\n\n\nICSharpCode.NRefactory.CSharp assembly\n\tICSharpCode.NRefactory.CSharp:\n\t\tAbstract Syntax Tree for C#\n\t\n\tICSharpCode.NRefactory.CSharp.Completion:\n\t\tCode completion (IntelliSense) for C#\n\t\n\tICSharpCode.NRefactory.CSharp.Resolver:\n\t\tSemantic analysis for C# (resolving the meaning of expressions)\n\t\n\tICSharpCode.NRefactory.CSharp.Analysis:\n\t\tSemantic analysis for C# (additional analysis functionality)\n\t\n\tICSharpCode.NRefactory.CSharp.TypeSystem:\n\t\tContains type system implementations specific to C#.\n\t\n\tICSharpCode.NRefactory.CSharp.Refactoring:\n\t\tInfrastructure for refactorings; and several built-in refactorings.\n\nICSharpCode.NRefactory.VB assembly\n\tICSharpCode.NRefactory.VB:\n\t\tAbstract Syntax Tree for VB\n\nICSharpCode.NRefactory.Xml assembly\n\tICSharpCode.NRefactory.Xml:\n\t\tError-tolerant XML parser. Supports incremental parsing.\n\t\tWhen tags don't match correctly, the parser uses a heuristic to guess the parse tree.\n\t\tThe heuristic tries to minimize the edit distance from the erroneous document to\n\t\tthe fixed document, and it also considers the indentation.\n\n\n\nNull-Object pattern:\n\tThe NRefactory library makes extensive use of the null object pattern.\n\tAs a result, NullReferenceExceptions should be very rare when working with this library.\n\tIn the type system, both ITypeReference and IType use SpecialType.UnknownType to represent\n\tunknown types.\n\tUnless the XML documentation says otherwise, no method or property returning a ITypeReference\n\tor IType will return null.\n\t\n\tNote that the null object pattern is not used for ITypeDefinition:\n\tIProjectContent.GetClass() returns null when a type is not found. Take care to abort your\n\toperation or substitute UnknownType instead of passing the null to code expecting an IType.\n\t\n\tThe pattern also extends to the C# resolver, which always produces a ResolveResult, even in\n\terror cases. Use ResolveResult.IsError to detect resolver errors.\n\tAlso note that many resolver errors still have a meaningful type attached, this allows code\n\tcompletion to work in the presence of minor semantic errors.\n\t\n\tThe C# AST makes use of special null nodes when accessing the getter of an AST property and no\n\tchild node with that role exists. Check the IsNull property to test whether a node is a null node.\n\tNull nodes are not considered to be part of the AST (e.g. they don't have a parent).\n\nFAQ:\nQ:  What is the difference between NRefactory and Roslyn?\n\t- NRefactory is ready and stable, Roslyn is only a CTP at this point of time.\n\t- NRefactory does not have VB support.\n\t- NRefactory cannot compile code to IL; it's not a full compiler, just a frontend.\n\t- NRefactory C# AST is mutable and supports pattern matching; Roslyn is immutable and does not have built-in pattern matching.\n\nQ:\tWhat is the difference between types and type definitions?\n\nA:\tBasically, a type (IType) is any type in the .NET type system:\n\t\t- an array (ArrayType)\n\t\t- a pointer (PointerType)\n\t\t- a managed reference (ByReferenceType)\n\t\t- a parameterized type (ParameterizedType, e.g. List<int>)\n\t\t- a type parameter (ITypeParameter, e.g. T)\n\t\t- or a type definition (ITypeDefiniton)\n\t\n\tType definitions are only classes, structs, enums and delegates.\n\tEvery type definition is a type, but not every type is a type definition.\n\tNRefactory's ITypeDefinition derives from IType, so you can directly use any type definition\n\tas a type.\n\tIn the other direction, you could try to cast a type to ITypeDefinition, or you can call the\n\tGetDefinition() method. The GetDefinition() method will also return the underlying\n\tITypeDefinition if given a parameterized type, so \"List<int>\".GetDefinition() is \"List<T>\".\n\n\nQ:\tWhat is the difference between types and type references?\n\tI've seen lots of duplicated classes (ArrayType vs. ArrayTypeReference, etc.)\n\t\nA:\tIf you've previously used the .NET Reflection API, the concept of type references will be new\n\tto you.\n\t\n\tNRefactory has the concept of the \"unresolved type system\": every assembly/project is stored\n\tin unresolved form.\n\tIt is possible to load some source code into a project which contains the type reference\n\t\"int[]\" without having to load mscorlib into NRefactory.\n\tSo inside the entities stored for the project, the array type is only referenced using an\n\tITypeReference.\n\tThis interface has a single method:\n\t    interface ITypeReference {\n\t       IType Resolve(ITypeResolutionContext context);\n\t    }\n\tBy calling the Resolve()-method, you will get back the actual ArrayType.\n\t\n\tNot only type references are split up this way; pretty much every class in the type system\n\tcomes in unresolved and resolved forms.\n\n\nQ:  What is a compilation (ICompilation)?\n\nA:\tA compilation serves as the root object of the resolved type system.\n\tIt consists of a main assembly and multiple referenced assemblies,\n\tand may also contain additional information like compiler options.\n\n\nQ:  What's in an ITypeResolveContext?\n\nA:  An ITypeResolveContext is an environment for looking up namespaces and types.\n\tIt consists of the current compilation, the current type definition,\n\tand language-specific implementations may add additional information (e.g. the list of usings).\n\t\n\tGenerally, you cannot resolve a type reference without knowing what kind of context is expected.\n\n\nQ:\tHow do I get the IType or ITypeReference for a primitive type such as string or int?\n\t\nA:\tTo get an IType for a primitive type, use:\n\t\tcompilation.FindType(KnownTypeCode.Int32)\n\t\n\tTo get an ITypeReference, use:\n\t\tKnownTypeReference.Int32\n\t\n\tIt is also possible to use a System.Type for retrieving a type:\n\t   compilation.FindType(typeof(int))\n\tor\n\t   typeof(int).ToTypeReference().\n\n\nQ:\tIs it thread-safe?\n\nA:\tThis question is a bit difficult to answer.\n\tNRefactory was designed to be usable in a multi-threaded IDE.\n\tBut of course, this does not mean that everything is thread-safe.\n\t\n\tFirst off, there's no hidden static state, so any two operations working on independent data\n\tcan be executed concurrently.\n\t[Actually, sometimes static state is used for caches, but those uses are thread-safe.]\n\tTODO: what about the C# parser? gmcs is full of static state...\n\t\t-> this is being worked on; for the time being, NRefactory uses a global lock during parsing;\n\t\t   so it's thread-safe but slow.\n\t\n\tSome instance methods may use hidden instance state, so it is not safe to e.g. use an instance\n\tof the CSharp.Resolver.TypeInference class concurrently.\n\tInstead, you need to create an instance on every thread.\n\t\n\tThe type system itself is thread-safe. Both the unresolved and the resolved type systems are\n\timmutable.\n\t\n\tWhen you add to an IProjectContent, the existing project content isn't modified,\n\tbut a new project content is created instead. All implementations of the type system interfaces\n\tare either immutable or freezable.\n\t\n\tAnd on the resolved type system side, ICompilation is immutable as well.\n\tInternally, the resolved type system will resolve elements only on demand, but this is done\n\tin a thread-safe manner.\n\n\nQ:\tWhat format do the .ToString() methods use?\n\nA:\tThey don't use any particular format. They're merely intended as a debugging aid.\n\tCurrently .ToString() usually matches .ReflectionName, but that may change in the future.\n"
  },
  {
    "path": "3rdparty/NRefactory/doc/Pattern Matching.html",
    "content": "<html>\n<head><title>NRefactory Pattern Matching</title></head>\n<body>\n    The pattern matching API for the C# AST is similar to how regular\n    expressions work in .NET, except that it's working with AstNodes\n    instead of characters.<br>\n    First you declare a pattern, for example: \"X a = new X(...);\".<br>\n    <span style=\"color: #000080; \">var</span>&nbsp;pattern =&nbsp;<span\n      style=\"color: #008b8b; font-weight: bold; \">new</span>&nbsp;VariableDeclarationStatement&nbsp;<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">{</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;Type =&nbsp;<span style=\"color: #008b8b; font-weight: bold; \">new</span>&nbsp;<span\n      style=\"color: #191970; font-weight: bold; \">AnyNode</span><span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">(</span><span\n      style=\"color: #0000ff; \">\"type\"</span><span style=\"color: #235100;\n      font-weight: normal; font-style: normal; \">),</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;Variables =&nbsp;<span style=\"color: #235100; font-weight: normal;\n      font-style: normal; \">{</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #008b8b; font-weight: bold; \">new</span>&nbsp;VariableInitializer&nbsp;<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">{</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name = Pattern<span style=\"color: #235100; font-weight:\n      normal; font-style: normal; \">.</span>AnyString<span style=\"color:\n      #235100; font-weight: normal; font-style: normal; \">,</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializer =&nbsp;<span style=\"color: #008b8b; font-weight:\n      bold; \">new</span>&nbsp;ObjectCreateExpression&nbsp;<span style=\"color:\n      #235100; font-weight: normal; font-style: normal; \">{</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type =&nbsp;<span style=\"color: #008b8b; font-weight:\n      bold; \">new</span>&nbsp;<span style=\"color: #191970; font-weight: bold;\n      \">Backreference</span><span style=\"color: #235100; font-weight:\n      normal; font-style: normal; \">(</span><span style=\"color: #0000ff;\n      \">\"type\"</span><span style=\"color: #235100; font-weight: normal;\n      font-style: normal; \">),</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Arguments =&nbsp;<span style=\"color: #235100;\n      font-weight: normal; font-style: normal; \">{</span>&nbsp;<span\n      style=\"color: #008b8b; font-weight: bold; \">new</span>&nbsp;<span\n      style=\"color: #191970; font-weight: bold; \">Repeat</span><span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">(</span><span\n      style=\"color: #008b8b; font-weight: bold; \">new</span>&nbsp;<span\n      style=\"color: #191970; font-weight: bold; \">AnyNode</span><span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">())</span>&nbsp;<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">}</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializer =&nbsp;<span style=\"color: #008b8b;\n      font-weight: bold; \">new</span>&nbsp;<span style=\"color: #191970;\n      font-weight: bold; \">OptionalNode</span><span style=\"color:\n      #235100; font-weight: normal; font-style: normal; \">(</span><span\n      style=\"color: #008b8b; font-weight: bold; \">new</span>&nbsp;<span\n      style=\"color: #191970; font-weight: bold; \">AnyNode</span><span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">())</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #235100; font-weight: normal;\n      font-style: normal; \">}</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #235100; font-weight: normal;\n      font-style: normal; \">}</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #235100; font-weight: normal; font-style:\n      normal; \">}};</span><br>\n    <br>\n    This is a <b>pattern AST</b> - it is a C# AST using the normal C#\n    AST classes, but also contains special <b>pattern nodes</b>\n    (AnyNode, Repeat, OptionalNode, Backreference, NamedNode, Choice,\n    ...).<br>\n    If you call<br>\n    &nbsp;Match m = pattern<span style=\"color: #235100; font-weight: normal;\n      font-style: normal; \">.</span><span style=\"color: #191970;\n      font-weight: bold; \">Match</span><span style=\"color: #235100;\n      font-weight: normal; font-style: normal; \">(</span>someNode<span\n      style=\"color: rgb(35, 81, 0); font-weight: normal; font-style:\n      normal;\">);<br>\n    </span>then m.Success will be true if someNode is a\n    VariableDeclarationStatement that declares a single variable, which\n    is initialized to a new object of the variable type.<br>\n    Basically, Match performs a comparison of the pattern AST with\n    someNode. If the pattern AST does not contain any pattern nodes, the\n    match will be successful if the ASTs are syntactically identical\n    (whitespace/comments are not compared).<br>\n    &nbsp; AnyNode will match any non-null node, and optionally store the\n    node it was matched against in a named <b>capture group</b>.<br>\n    &nbsp; Backreference will match any node that is syntactically identical\n    to the node that was previously stored in the named capture group.<br>\n    &nbsp; Repeat can be used only in AstNodeCollections and will try to\n    match its child pattern against any number of nodes - this is\n    equivalent to * (Kleene star) in regular expressions.<br>\n    &nbsp; OptionalNode will match null nodes, or will try to match its child\n    pattern against the node. OptionalNode can also be used in\n    AstNodeCollections, where it is equivalent to a Repeat with\n    MinCount=0 and MaxCount=1.<br>\n    <br>\n    The resulting match object can also be used to retrieve the nodes\n    stored in the capture groups:<br>\n    <span style=\"color: #0000ff; font-weight: bold; \">if</span>&nbsp;<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">(</span>m<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">.</span>Success<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">)</span>&nbsp;<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">{</span><br>\n    &nbsp;&nbsp;&nbsp;&nbsp;m<span style=\"color: #235100; font-weight: normal; font-style:\n      normal; \">.</span>Get<span style=\"color: #235100; font-weight:\n      normal; font-style: normal; \">&lt;</span>AstType<span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">&gt;(</span><span\n      style=\"color: #0000ff; \">\"type\"</span><span style=\"color: #235100;\n      font-weight: normal; font-style: normal; \">).</span><span\n      style=\"color: #191970; font-weight: bold; \">Single</span><span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">().</span><span\n      style=\"color: #191970; font-weight: bold; \">ReplaceWith</span><span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">(</span><span\n      style=\"color: #008b8b; font-weight: bold; \">new</span>&nbsp;<span\n      style=\"color: #191970; font-weight: bold; \">SimpleType</span><span\n      style=\"color: #235100; font-weight: normal; font-style: normal; \">(</span><span\n      style=\"color: #0000ff; \">\"var\"</span><span style=\"color: #235100;\n      font-weight: normal; font-style: normal; \">));</span><br>\n    <span style=\"color: #235100; font-weight: normal; font-style:\n      normal; \">}</span><br>\n    <br>\n    This feature was originally written for the decompiler in ILSpy, but\n    it is also very useful for refactorings. You can also implement\n    custom pattern nodes (derive from the Pattern base class) with\n    custom match logic - for example if you want to check the semantics\n    of a node.<br>\n</body></html>"
  },
  {
    "path": "3rdparty/NRefactory/doc/TODO",
    "content": "﻿\nParser:\n- put newlines into the AST\n- eliminate the global lock\n\nType System:\n- Reduce memory usage\n- Interface Implementation Map\n\nResolver:\n- Port all #D resolver unit tests to NR\n- Port all MD resolver unit tests to NR\n\n"
  },
  {
    "path": "3rdparty/NRefactory/doc/XML Documentation.html",
    "content": "﻿<html>\n<head><title>NRefactory - XML Documentation</title></head>\n<body>\n<h1>NRefactory - XML Documentation</h1>\n<h2>Providing documentation for the type system</h2>\n<p>\n\tWhen using CecilLoader, set the <code>CecilLoader.DocumentationProvider</code>\n\tproperty to provide documentation for the loaded assemblies.\n\tThe <code>XmlDocumentationProvider</code> class is an <code>IDocumentationProvider</code> implementation\n\tthat can be used to read documentation from an external .xml file in the format generated by\n\tMicrosoft's C# compiler.\n</p>\n<p>\n\tWhen parsing C# code, the <code>TypeSystemConvertVisitor</code> will load the documentation\n\tfrom the XML comments by default. (this can be disabled using the <code>SkipXmlDocumentation</code> property).\n</p>\n<p>\n\tInternally, the type system does not store XML documentation - instead, the documentation is\n\trequested from the provider whenever the <code>IEntity.Documentation</code>\n\tproperty is accessed.<br/>\n\tFor this purpose, the type system casts the parsed file to <code>IUnresolvedDocumentationProvider</code>\n\tand tries to get the documentation.\n\tThis way, the <code>CSharpUnresolvedFile</code> can provide the documentation from the XML comments.<br/>\n\tIf this fails, the type system casts the unresolved assembly/project content to <code>IDocumentationProvider</code>.\n\tThis is the way the request for documentation gets to the <code>CecilLoader</code>,\n\twhich in turn forwards it to the user-provided <code>IDocumentationProvider</code>.\n</p>\n<h2>cref</h2>\n<p>\n\tThe syntax taken by the <code>cref</code> attribute depends on the documentation source.\n\tFor example, C# XML comments may use \"<code>List{T}</code> if the appropriate <code>using</code> exists,\n\tbut .xml documentation files have to use the full ID string <code>T:System.Collections.Generics.List`1</code>.\n</p>\n<p>\n\tFor this reason, the <code>IEntity.Documentation</code> property returns a <code>DocumentationComment</code>\n\tobject that provides not only the XML text, but also a method that can be used to resolve <code>cref</code>\n\tattributes.\n</p>\n<p>\n\tInternally, the .xml file support uses the <code>IDStringProvider</code>;\n\twhereas C# has its own small <code>CSharpCrefParser</code>.\n</p>\n<h2>XmlDocumentationProvider implementation notes</h2>\n<p>\n\tThe <code>XmlDocumentationProvider</code> is designed to load large amounts\n\tof documentation while using up only little memory.\n</p>\n<p>\n\tWhen a new <code>XmlDocumentationProvider</code> is created, it will read the .xml file and\n\tcreate a small in-memory index (using only 8 bytes per member).\n\tWhen documentation is requested from the provider, it uses this index to find the correct\n\tposition in the .xml file, and parses only the interesting document fragment, not the whole file.\n</p>\n<p>\n\tThe <code>XmlDocumentationProvider</code> is serializable and will be included when serializing a Cecil-loaded\n\t<code>IUnresolvedAssembly</code>. This way, an IDE like SharpDevelop can completely avoid parsing\n\tthe .xml documentation file when the user opens a solution (except for the first time).\n</p>\n</body>\n</html>\n"
  },
  {
    "path": "3rdparty/NRefactory/doc/copyright.txt",
    "content": "Copyright 2002-2012 by\n\n  AlphaSierraPapa, Christoph Wille\n  Vordernberger Strasse 27/8\n  A-8700 Leoben\n  Austria\n\n  email: office@alphasierrapapa.com\n  court of jurisdiction: Landesgericht Leoben\n\n"
  },
  {
    "path": "3rdparty/NRefactory/doc/license.txt",
    "content": "Copyright (c) 2010-2014 AlphaSierraPapa, Xamarin\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\nwithout restriction, including without limitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\nto whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or\nsubstantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\nINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\nPURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\nFOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project\nand our community a harassment-free experience for everyone, regardless of\nage, body size, disability, ethnicity, gender identity and expression, level\nof experience, nationality, personal appearance, race, religion, or sexual\nidentity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention\n  or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n  address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n  professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of\nacceptable behavior and are expected to take appropriate and fair corrective\naction in response to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem\ninappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an\nappointed representative at an online or offline event. Representation of a\nproject may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at contact@fusetools.com.\nThe project team will review and investigate all complaints, and will\nrespond in a way that it deems appropriate to the circumstances. The project\nteam is obligated to maintain confidentiality with regard to the reporter\nof an incident. Further details of specific enforcement policies may be\nposted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the\n[Contributor Covenant][homepage], version 1.4,\navailable at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nIf you want to contribute to this repository, please first discuss the\nchanges you want to make with the repository's owners, for example via\nan issue or on [Slack](https://fusecommunity.slack.com).\n\nThis project has a [code of conduct](#code-of-conduct). Please follow\nit in all your interactions related to the project.\n\n## Pull Request Process\n\n1. Features should generally be pulled against the `master` branch.\n   Bug fixes, depending on the urgency and risk, go either against an active\n   release branch, or `master`.\n2. Make sure the code follows our [coding style](docs/coding-style.md).\n3. New features should have tests added, ensuring the feature does not\n   silently break. Bug fixes should generally have regression tests added\n   to ensure they're not reintroduced later.\n4. New features must be documented.\n5. If there are any functional changes, update CHANGELOG.md with a brief\n   explanation.\n6. Ensure that tests pass locally before sending a pull request.\n7. Make sure your pull request passes the required CI (continuous\n   integration). If there's a spurious error, retrigger the CI until your\n   pull request passes, and feel free to file a ticket about the spurious\n   test.\n8. Make sure you follow up on any feedback to get your pull request merged.\n9. If the pull request is against `master`, you may merge once the\n   pull request has been approved by a project member and passed CI, if\n   you have the permissions needed. Otherwise, ping the project member who\n   approved the pull request. Pull requests against release branches should\n   be done by the release manager (if you're unsure who this is, contact\n   the project team).\n\n## Code of Conduct\n\nPlease read and adhere to our [Code of Conduct](CODE_OF_CONDUCT.md)\n"
  },
  {
    "path": "CodeStyle.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeEditing/GenerateMemberBody/CopyXmlDocumentation/@EntryValue\">True</s:Boolean>\n\t<s:String x:Key=\"/Default/CodeEditing/GenerateMemberBody/MethodImplementationKind/@EntryValue\">ReturnDefaultValue</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=A37A7E14_002D0000_002D0000_002D0000_002D000000000000/@EntryIndexedValue\">ExplicitlyExcluded</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=A625BE88_002D0000_002D0000_002D0000_002D000000000000/@EntryIndexedValue\">ExplicitlyExcluded</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=A9AE40FF_002D1A21_002D414A_002D9FE7_002D3BE13644CC6D/@EntryIndexedValue\">ExplicitlyExcluded</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=D01B1D20_002D8F5B_002D4834_002D8E5C_002DC7EC6DD587D4/@EntryIndexedValue\">ExplicitlyExcluded</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=F731C641_002D3CBB_002D41B8_002DBB44_002DB3A72DADE5AE/@EntryIndexedValue\">ExplicitlyExcluded</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue\">VISIBLE_FILES</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeCleanup/Profiles/=Outracks/@EntryIndexedValue\">&lt;?xml version=\"1.0\" encoding=\"utf-16\"?&gt;&lt;Profile name=\"Outracks\"&gt;&lt;CSRemoveCodeRedundancies&gt;True&lt;/CSRemoveCodeRedundancies&gt;&lt;CSUseAutoProperty&gt;True&lt;/CSUseAutoProperty&gt;&lt;CSMakeFieldReadonly&gt;True&lt;/CSMakeFieldReadonly&gt;&lt;CSUseVar&gt;&lt;BehavourStyle&gt;CAN_CHANGE_TO_EXPLICIT&lt;/BehavourStyle&gt;&lt;LocalVariableStyle&gt;ALWAYS_IMPLICIT&lt;/LocalVariableStyle&gt;&lt;ForeachVariableStyle&gt;ALWAYS_IMPLICIT&lt;/ForeachVariableStyle&gt;&lt;/CSUseVar&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;EmbraceInRegion&gt;False&lt;/EmbraceInRegion&gt;&lt;RegionName&gt;&lt;/RegionName&gt;&lt;/CSOptimizeUsings&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;RemoveCodeRedundancies&gt;True&lt;/RemoveCodeRedundancies&gt;&lt;XMLReformatCode&gt;True&lt;/XMLReformatCode&gt;&lt;/Profile&gt;</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue\">Outracks</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue\">Outracks</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue\">Implicit</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue\">NEXT_LINE</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/EMPTY_BLOCK_STYLE/@EntryValue\">TOGETHER_SAME_LINE</s:String>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/EXPLICIT_PRIVATE_MODIFIER/@EntryValue\">False</s:Boolean>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FIXED_BRACES_STYLE/@EntryValue\">ONLY_FOR_MULTILINE</s:String>\n\t\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue\">ONLY_FOR_MULTILINE</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue\">ONLY_FOR_MULTILINE</s:String>\n\t\n\t\n\t<s:Int64 x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue\">1</s:Int64>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue\">NEVER</s:String>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue\">True</s:Boolean>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_ARGUMENTS_STYLE/@EntryValue\">CHOP_IF_LONG</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_PARAMETERS_STYLE/@EntryValue\">CHOP_IF_LONG</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CssFormatter/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/HtmlFormatter/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/ProtobufCodeFormatting/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/ResxFormatter/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/VBFormat/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/XmlDocFormatter/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/XmlFormatter/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t\n\t<s:String x:Key=\"/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GUI/@EntryIndexedValue\">GUI</s:String>\n\t<s:String x:Key=\"/Default/Environment/Editor/MatchingBraceHighlighting/Style/@EntryValue\">OUTLINE</s:String>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue\">True</s:Boolean>\n\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CommonFormatter/ALIGNMENT_TAB_FILL_STYLE/@EntryValue\">USE_TABS_ONLY</s:String>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_FIRST_ARG_BY_PAREN/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_LINQ_QUERY/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_ARGUMENT/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_EXPRESSION/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_FOR_STMT/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_PARAMETER/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTIPLE_DECLARATION/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_CONSTRAINS/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTLINE_TYPE_PARAMETER_LIST/@EntryValue\">False</s:Boolean>\n\t<s:Int64 x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/CONTINUOUS_INDENT_MULTIPLIER/@EntryValue\">1</s:Int64>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/EXPLICIT_INTERNAL_MODIFIER/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_INVOCATION_LPAR/@EntryValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=Outracks_002EUX_002EAnnotations/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EFormat_002ESettingsUpgrade_002EAlignmentTabFillStyleMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsParsFormattingSettingsUpgrader/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsWrapperSettingsUpgrader/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EXml_002ECodeStyle_002EFormatSettingsUpgrade_002EXmlMoveToCommonFormatterSettingsUpgrade/@EntryIndexedValue\">True</s:Boolean>\n</wpf:ResourceDictionary>\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "Copyright (C) 2020-2024 Build and Run AS\nCopyright (C) 2018-2020 Fuse Open\nCopyright (C) 2015-2018 Fusetools AS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and\nassociated documentation files (the \"Software\"), to deal in the Software without restriction,\nincluding without limitation the rights to use, copy, modify, merge, publish, distribute,\nsublicense, and/or sell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or\nsubstantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT\nNOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\nOF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "Makefile",
    "content": "default:\n\t@bash scripts/build.sh\nfast:\n\t@bash scripts/build.sh --fast\nall:\n\t@bash scripts/build.sh --install\nkill:\n\t@bash scripts/kill.sh\nrun:\n\t@npm run -s fuse\ndaemon:\n\t@npm run -s daemon\nclean:\n\t@npm run -s clean\nnuke:\n\t@npm run -s nuke\ninstall:\n\t@npm link -f\nuninstall:\n\t@bash setup/uninstall.sh\npack:\n\t@bash scripts/prepack.sh\n\t@npm pack\n\t@bash scripts/postpack.sh\nsetup:\n\t@bash setup/build.sh\nassets:\n\t@bash assets/sync.sh\napk:\n\t@npm run -s app:build-apk\naab:\n\t@npm run -s app:build-aab\n\n.PHONY: setup assets\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\"><picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/fuse-x/studio/raw/master/img/logo-darkmode.png\">\n  <img src=\"https://github.com/fuse-x/studio/raw/master/img/logo.png\" width=\"216\" alt=\"Fuse X\" />\n</picture></p>\n\n<p align=\"center\"><a href=\"https://ci.appveyor.com/project/fusetools/fuse-studio/branch/master\"><img src=\"https://img.shields.io/appveyor/ci/fusetools/fuse-studio/master.svg?logo=appveyor&logoColor=silver&style=flat-square\" alt=\"AppVeyor build status\"></a>\n<img src=\"https://img.shields.io/badge/target%20os-Android%20%7C%20iOS%20%7C%20macOS%20%7C%20Windows-7F5AB6?style=flat-square&amp;logo=android&amp;logoColor=silver\" alt=\"Target platforms\">\n<img src=\"https://img.shields.io/badge/host%20os-macOS%20%7C%20Windows-7F5AB6?logo=apple&amp;style=flat-square\" alt=\"Host platforms\">\n</p>\n\n<p align=\"center\"><a href=\"https://github.com/fuse-x/studio/releases\"><img src=\"https://img.shields.io/github/v/release/fuse-x/studio?include_prereleases&amp;logo=github&amp;label=latest&amp;sort=semver&amp;style=flat-square\" alt=\"Latest version\"></a>\n<a href=\"https://github.com/fuse-x/studio/releases\"><img src=\"https://img.shields.io/github/downloads/fuse-x/studio/total?logo=github&amp;color=blue&amp;style=flat-square\" alt=\"Downloads\"></a>\n<a href=\"LICENSE.txt\"><img src=\"https://img.shields.io/github/license/fuse-open/fuse-studio.svg?logo=github&amp;style=flat-square\" alt=\"License: MIT\"></a>\n<a href=\"https://fusecommunity.slack.com/\"><img src=\"https://img.shields.io/badge/chat-on%20slack-blue.svg?logo=slack&amp;style=flat-square\" alt=\"Slack\"></a>\n<a href=\"https://opencollective.com/fuse-open\"><img src=\"https://opencollective.com/fuse-open/all/badge.svg?label=financial+contributors&amp;style=flat-square\" alt=\"Financial Contributors on Open Collective\"></a></p>\n\n<p align=\"center\"><img src=\"https://github.com/fuse-x/studio/blob/master/img/screenshot.png?raw=true\" width=\"744\" alt=\"Fuse X\" /></p>\n\n> **Fuse X** is a visual desktop tool suite for working with the [**Fuse Open**](https://fuseopen.com/) framework, on **macOS** and **Windows**.\n\n## Releases\n\nOfficial Fuse X releases are published [here](https://github.com/fuse-x/studio).\n\n## Build instructions\n\n```\nnpm install\nnpm run build\nnpm run fuse\n```\n\n### Building on Windows\n\nThe prerequisites for building on Windows is\n\n* [Visual Studio 2019](https://www.visualstudio.com/downloads/) - Community Edition\n  * With .NET desktop development component installed\n* [Git for Windows](https://git-scm.com/download/win)\n* [Node.js](https://nodejs.org/)\n\nBuild by either running `npm run build` or from within Visual Studio using the `fuse-win.sln` solution.\n\nAfter building Fuse X can be started by running `npm run fuse` from the command line.\n\n> To run with debugging in Visual Studio set `fuse-studio` as the startup project and press <kbd>F5</kbd>.\n\n### Building on macOS\n\nThe prerequisites for building on macOS is\n\n* [Xcode](https://developer.apple.com/xcode/)\n  * Remember to open Xcode one time after installing to accept EULA\n* [Node.js](https://nodejs.org/)\n* [Mono](https://www.mono-project.com/download/stable/)\n\nBuild by either running `npm run build` or from within [Visual Studio for Mac](https://www.visualstudio.com/vs/mac/) using the `fuse-mac.sln` solution.\n\nAfter building Fuse X can be started by running `npm run fuse` from the command line.\n\n> To run with debugging in Visual Studio for Mac set `fuse X` as the startup project and press <kbd>⌘</kbd>+<kbd>⏎</kbd>.\n\n> Run `VSMAC=1 make` one time before launching from Visual Studio for Mac to prepare for debugging.\n\n> Make sure you have the latest versions of Visual Studio for Mac, Mono and Xamarin.Mac installed.\n\n## Running tests\n\n```\nnpm test\n```\n\n## Building installers\n\n```\nnpm run setup:build\n```\n\n## Using preview apps\n\nRun the following command to build Uno libraries needed by preview apps.\n\n```\nnpm run doctor\n```\n\nRun one of the following commands to start a preview app for your desired platform.\n\n```\nnpm run app:android\nnpm run app:android-emu\nnpm run app:ios\nnpm run app:ios-sim\nnpm run app:native\n```\n\n> Unfortunately the preview app cannot be opened in Fuse X.\n\nRun one of the following commands to build a distributable Android APK or AAB.\n\n```\nnpm run app:build-apk\nnpm run app:build-aab\n```\n\n## Upgrading Fuse Open components\n\nWe can use [npm-install](https://docs.npmjs.com/cli/install) to upgrade Uno and Fuselibs.\n\n```\nnpm install --save @fuse-open/uno\nnpm install --save @fuse-open/fuselibs\nnpm install --save @fuse-open/types\n```\n\nWe can see if any packages are outdated by running the following command.\n\n```\nnpm outdated\n```\n\n## Incrementing the version number\n\nWe can use [npm-version](https://docs.npmjs.com/cli/version) to set a new version number.\n\n```\nnpm version 1.2.3\n```\n\n> The first two major and minor parts of the version number should match the version numbers of Uno and Fuselibs.\n\nPlease add a suffix to the version number if making a pre-release.\n\n```\nnpm version 1.2.3-canary.0\n```\n\n## Log files\n\nLog files can be found at the following locations:\n\n* macOS: `~/.fuse/logs/`\n* Windows: `%LOCALAPPDATA%\\fuse X\\logs\\`\n\nInstaller logs can be found at the following locations:\n\n* macOS: `/tmp/`\n\n## Contributing\n\n> Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of\nconduct, and the process for submitting pull requests to us.\n\n### Reporting issues\n\nPlease report issues [here](https://github.com/fuse-open/fuse-studio/issues).\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]\n<a href=\"https://github.com/fuse-open/fuse-studio/graphs/contributors\"><img src=\"https://opencollective.com/fuse-open/contributors.svg?width=890&button=false\" /></a>\n\n### Financial Contributors\n\n Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/fuse-open/contribute)]\n\n#### Individuals\n\n<a href=\"https://opencollective.com/fuse-open\"><img src=\"https://opencollective.com/fuse-open/individuals.svg?width=890\"></a>\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/fuse-open/contribute)]\n\n<a href=\"https://opencollective.com/fuse-open/organization/0/website\"><img src=\"https://opencollective.com/fuse-open/organization/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/1/website\"><img src=\"https://opencollective.com/fuse-open/organization/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/2/website\"><img src=\"https://opencollective.com/fuse-open/organization/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/3/website\"><img src=\"https://opencollective.com/fuse-open/organization/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/4/website\"><img src=\"https://opencollective.com/fuse-open/organization/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/5/website\"><img src=\"https://opencollective.com/fuse-open/organization/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/6/website\"><img src=\"https://opencollective.com/fuse-open/organization/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/7/website\"><img src=\"https://opencollective.com/fuse-open/organization/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/8/website\"><img src=\"https://opencollective.com/fuse-open/organization/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/fuse-open/organization/9/website\"><img src=\"https://opencollective.com/fuse-open/organization/9/avatar.svg\"></a>\n"
  },
  {
    "path": "assets/README.md",
    "content": "To create an `.icns` file from the command line:\n\nMake a directory `<directory name>.iconset` containing the following icons:\n\n```\nicon_128x128.png\nicon_128x128@2x.png\nicon_16X16.png\nicon_16X16@2x.png\nicon_256x256.png\nicon_256x256@2x.png\nicon_32x32.png\nicon_32x32@2x.png\nicon_48x48.png\nicon_48x48@2x.png\nicon_512x512.png\nicon_512x512@2x.png\n```\n\nRun the following command:\n\n```\niconutil -c icns -o <file name>.icns <directory name>.iconset\n```\n"
  },
  {
    "path": "components/android/install.js",
    "content": "const path = require(\"path\");\nconst {spawnSync} = require(\"child_process\");\n\nconst NPM = path.sep == \"\\\\\" ? \"npm.cmd\" : \"npm\";\nconst PACKAGE = \"android-build-tools\"\n\nfunction exec(cmd, argsArray) {\n    const obj = spawnSync(cmd, argsArray, {stdio: 'inherit'});\n\n    if (obj.error)\n        throw obj.error;\n\n    return obj.status;\n}\n\nfunction get_lines(cmd, argsArray) {\n    const obj = spawnSync(cmd, argsArray);\n\n    if (obj.error)\n        throw obj.error;\n\n    const stdout = String(obj.stdout);\n    return stdout.split(/\\r?\\n/);\n}\n\nfunction install(name) {\n    return exec(NPM, [\"install\", \"-g\", \"-f\", name]);\n}\n\nfunction list() {\n    return get_lines(NPM, [\"list\", \"-g\", \"--depth\", \"0\"]);\n}\n\nfor (let arg of process.argv.splice(2)) {\n    switch (arg) {\n    case '-s':\n    case '--status':\n        for (item of list()) {\n            if (item.includes(PACKAGE)) {\n                console.log(\"Up to date.\");\n                process.exit(0);\n            }\n        }\n\n        process.exit(100);\n    }\n}\n\ninstall(PACKAGE);\n"
  },
  {
    "path": "components/sublime-plugin/install.js",
    "content": "const path = require(\"path\");\nconst fs = require('fs');\n\nconst PACKAGE = \"plugin.zip\";\n\nconst appdata_dir = path.sep == '\\\\'\n                    ? process.env.APPDATA\n                    : path.join(process.env.HOME, \"Library\", \"Application Support\");\nconst sublime_data_dir = path.join(appdata_dir, \"Sublime Text 3\");\nconst sublime_package_dir = path.join(sublime_data_dir, \"Installed Packages\");\nconst fuse_package_file = path.join(sublime_package_dir, \"Fuse.sublime-package\");\n\nfor (let arg of process.argv.splice(2)) {\n    switch (arg) {\n    case '-s':\n    case '--status':\n        if (fs.existsSync(fuse_package_file)) {\n            console.log(\"Up to date.\");\n            process.exit(0);\n        } else {\n            process.exit(100);\n        }\n    }\n}\n\nif (!fs.existsSync(sublime_package_dir))\n    fs.mkdirSync(sublime_package_dir, {recursive: true});\n\nfs.copyFileSync(path.join(__dirname, PACKAGE), fuse_package_file);\nconsole.log(\"Install completed.\");\n"
  },
  {
    "path": "components/vscode-extension/install.js",
    "content": "const path = require(\"path\");\nconst {spawnSync} = require(\"child_process\");\n\nconst CODE = path.sep == \"\\\\\" ? \"code.cmd\" : \"code\";\nconst EXTENSION = \"fuseopen.fuse-vscode\";\n\nfunction exec(cmd, argsArray) {\n    const obj = spawnSync(cmd, argsArray, {stdio: 'inherit'});\n\n    if (obj.error)\n        throw obj.error;\n\n    return obj.status;\n}\n\nfunction get_lines(cmd, argsArray) {\n    const obj = spawnSync(cmd, argsArray);\n\n    if (obj.error)\n        throw obj.error;\n\n    const stderr = String(obj.stderr);\n    const stdout = String(obj.stdout);\n\n    if (stderr && stderr.length)\n        console.error(stderr);\n\n    return stdout.split(/\\r?\\n/);\n}\n\nfunction get_extensions() {\n    return get_lines(CODE, [\"--list-extensions\"]);\n}\n\nfunction install(name) {\n    exec(CODE, [\"--install-extension\", name, \"--force\"]);\n}\n\nfunction uninstall(name) {\n    exec(CODE, [\"--uninstall-extension\", name]);\n}\n\nfor (let arg of process.argv.splice(2)) {\n    switch (arg) {\n    case '-s':\n    case '--status':\n        for (let name of get_extensions()) {\n            if (name == EXTENSION) {\n                console.log(\"Up to date.\");\n                process.exit(0);\n            }\n        }\n\n        process.exit(100);\n    }\n}\n\n// Uninstall legacy extensions.\nfor (let name of get_extensions()) {\n    switch (name) {\n    case 'iGN97.fuse-vscode':\n    case 'naumovs.vscode-fuse-syntax':\n        try {\n            uninstall(name);\n        } catch (e) {\n            console.error(\"W: \" + e);\n        }\n    }\n}\n\ninstall(EXTENSION);\n"
  },
  {
    "path": "docs/coding-style.md",
    "content": "# Coding Style\n\nPlease consider using an [EditorConfig](http://editorconfig.org/)-capable\ntext editor. Plug-ins exist for most popular text editors. This ensures\nthat our [configuration file](../.editorconfig) gets respected, which\nreduces needless commit-noise.\n\nGenerally, try to follow the local code style of the source file you're\nediting. It's much more disturbing to switch between multiple code styles\nwithin a source file, than between source files.\n\nThese guidelines apply only to code written and maintained as a part of\nthis project. Any code that gets imported from some upstream source\nshould keep the style from its upstream. This ensures it's as easy as\npossible to apply patches from the upstream source.\n\n## General\n\nWe generally try to write idiomatic code for each language we use. In\naddition, we have some language-specific guidelines (listed below).\n\nDo not commit commented-out code. Commented-out code is harder to\nmaintain, as it's not actively compiled, and usually turns out being\nnothing more than noise. If something is really important to keep around,\nconsider keeping it on a private branch, or as code that still gets\ncompiled, but not executed. Do note that dead code can easily get removed\nby someone else.\n\nAvoid needless whitespace changes. Unnecessary whitespace changes lead\nto hard to backport patches, and increase the chance of merge conflicts.\nPlease avoid them. They also make it harder to review a pull request. If\na file is whitespace broken, consider putting the whitespace cleanup in\na separate commit, so it's easier to omit it when reviewing.\n\n## Uno / C&#35;\n\nWe generally use [idiomatic C# code style](https://msdn.microsoft.com/en-us/library/ff926074.aspx),\nbut we also have a few additional guidelines:\n\n* Use one tab for indentation\n* Non-public members are prefixed with an underscore, like so:\n   ```csharp\n   class Foo\n   {\n   \tint _bar;\n   }\n   ```\n* *Do not* use Egyptian braces\n* Use spaces around operators and keywords, but not inside parentheses and\n  not around function calls. So, like this:\n  ```csharp\n  if (condition)\n        foo(bar + 1);\n  ```\n  ...and not like this:\n  ```csharp\n  if( condition )\n        foo( bar+1 );\n  ```\n"
  },
  {
    "path": "empty/MainView.ux",
    "content": "<App Background=\"#FFF\">\n</App>"
  },
  {
    "path": "empty/app.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}"
  },
  {
    "path": "example/Logic.ts",
    "content": "interface Item {\n    color: number[];\n    height: number;\n}\n\nexport default class Model {\n    items: Item[] = [];\n\n    addItem(): void {\n        this.items.push({\n            color: [Math.random(), Math.random(), Math.random(), 1],\n            height: (Math.random() + 1.0) * 80\n        });\n    }\n}\n"
  },
  {
    "path": "example/MainView.ux",
    "content": "<App>\n\t<ClientPanel>\n\t\t<Page ux:Class=\"PageWithTitle\" ux:Name=\"self\" HitTestMode=\"LocalBoundsAndChildren\">\n\t\t\t<DockLayout />\n\n\t\t\t<float4 ux:Property=\"HeaderColor\" />\n\t\t\t<float4 ux:Property=\"HeaderTextColor\" />\n\t\t\t<string ux:Property=\"Instructions\" />\n\n\t\t\t<StackPanel Dock=\"Top\">\n\t\t\t\t<Panel Color=\"{Property self.HeaderColor}\" Height=\"45\">\n\t\t\t\t\t<Text Value=\"{Property self.Title}\" FontSize=\"22\"\n\t\t\t\t\t\t  Alignment=\"Center\" TextColor=\"{Property self.HeaderTextColor}\"/>\n\t\t\t\t</Panel>\n\t\t\t</StackPanel>\n\n\t\t\t<Panel Height=\"10%\" Color=\"#0008\" Alignment=\"Bottom\">\n\t\t\t\t<WhileActive Invert=\"true\" Threshold=\"0.4\">\n\t\t\t\t\t<Move RelativeTo=\"Size\" Y=\"1\" Duration=\"0.4\" Easing=\"CircularInOut\"/>\n\t\t\t\t</WhileActive>\n\t\t\t\t<Text Value=\"{Property self.Instructions}\" Margin=\"20\" TextColor=\"#fff\" Alignment=\"Center\" />\n\t\t\t</Panel>\n\t\t</Page>\n\n\t\t<PageControl>\n\t\t\t<PageWithTitle Title=\"Basic animation\" HeaderColor=\"#595FFF\" HeaderTextColor=\"#fff\"\n\t\t\t\t\t\t   Color=\"#FEFDFC\" Instructions=\"Tap and hold the rectangle\">\n\t\t\t\t<Panel>\n\t\t\t\t\t<Rectangle ux:Name=\"myRectangle\" Color=\"#4894E5\" Width=\"80\" Height=\"80\" CornerRadius=\"0\">\n\t\t\t\t\t\t<WhilePressed>\n\t\t\t\t\t\t\t<Rotate Degrees=\"45\" Easing=\"CubicInOut\" Duration=\"0.5\" />\n\t\t\t\t\t\t\t<Scale  Factor=\"2\"   Easing=\"CubicInOut\" Duration=\"0.5\" />\n\t\t\t\t\t\t\t<Change myRectangle.Color=\"#FC5185\"      Duration=\"0.3\" />\n\t\t\t\t\t\t\t<Change myRectangle.CornerRadius=\"15\" \t Duration=\"0.3\" />\n\t\t\t\t\t\t</WhilePressed>\n\t\t\t\t\t</Rectangle>\n\t\t\t\t</Panel>\n\t\t\t</PageWithTitle>\n\n\t\t\t<PageWithTitle Title=\"Logic with TypeScript\" HeaderColor=\"#F68FD7\" HeaderTextColor=\"#FFF\" Color=\"#FFF\"\n\t\t\t\t\t\t   Instructions=\"Tap the screen to add items\" Model=\"Logic\">\n\t\t\t\t<Panel Tapped=\"{addItem}\">\n\t\t\t\t\t<ScrollView>\n\t\t\t\t\t\t<Panel>\n\t\t\t\t\t\t\t<ColumnLayout ColumnCount=\"3\"/>\n\t\t\t\t\t\t\t<Each Items=\"{items}\">\n\t\t\t\t\t\t\t\t<Rectangle ux:Name=\"item\" Color=\"{color}\" Height=\"{height}\" Margin=\"5\" CornerRadius=\"5\">\n\t\t\t\t\t\t\t\t\t<AddingAnimation>\n\t\t\t\t\t\t\t\t\t\t<Change item.Opacity=\"0\" Duration=\"0.3\" />\n\t\t\t\t\t\t\t\t\t</AddingAnimation>\n\t\t\t\t\t\t\t\t</Rectangle>\n\t\t\t\t\t\t\t</Each>\n\t\t\t\t\t\t</Panel>\n\t\t\t\t\t</ScrollView>\n\t\t\t\t</Panel>\n\t\t\t</PageWithTitle>\n\n\t\t\t<PageWithTitle Title=\"Realtime effects\" HeaderColor=\"#2CAE3F\" HeaderTextColor=\"#fff\"\n\t\t\t\t\t\t   Color=\"#FFF\" Instructions=\"Use the slider to blur the logo\">\n\t\t\t\t<Grid RowCount=\"2\">\n\t\t\t\t\t<Path Width=\"75%\" Data=\"M 432,1.7 H 404.3 L 377.5,42.8 350.8,1.7 h -27.7 l 40.6,62.3 -40.6,62.3 h 27.7 l 26.7,-41.1 26.8,41.1 H 432 L 391.4,64 Z M 203.5,80.9 c -4.7,-2.2 -9.9,-3.6 -14.9,-5.3 -3.7,-1.3 -7.7,-2 -11,-3.8 -1.9,-1 -3.8,-4 -3.6,-6 0.1,-2.2 2.1,-4.9 4,-6.4 1.7,-1.3 4.5,-1.4 6.8,-1.6 7.9,-0.6 15.1,1.9 21.8,6.8 L 214,50.9 c -9,-8.6 -27.3,-11.7 -41.4,-7.3 -11.6,3.6 -18,11.8 -18.2,23.1 -0.2,10.1 5,16.7 17,20.9 5.8,2 11.8,3.3 17.6,5.2 4.2,1.4 8.1,3.5 7.7,8.8 -0.4,5.5 -4.5,7.2 -9.2,8 -10.3,1.7 -19.5,-1.4 -28.2,-7.5 l -8.3,13.2 c 0.8,0.8 1.7,1.5 2.5,2.1 5.3,4.3 12,6.3 18.6,7.5 11.1,2 22.2,1.6 32.3,-4.3 8,-4.7 12.1,-11.9 11.9,-21.2 -0.1,-8.8 -5,-14.9 -12.8,-18.5 z M 30.1,7.1 c -11,5.2 -15.3,15 -16,26.6 -0.2,3.7 0,7.4 0,11.7 H 0 v 16.3 h 14.2 v 64.4 H 33.6 V 61.5 H 53.1 V 45.1 H 33.8 c 0,-5.2 -0.5,-9.7 0.1,-14 1.1,-7.4 6,-10.8 13.5,-9.9 2.3,0.5 4.6,1.1 6.9,1.8 L 62.5,9.1 c -11,-6.3 -21.7,-7 -32.4,-2 z m 90.8,42.2 c 0,14.2 0,28.3 0,42.5 0.1,2 -0.3,4 -1.1,5.9 -4.2,7.5 -14.1,11.6 -22,9.5 -6.8,-1.8 -10.7,-8 -11,-17.7 0,-1.4 0,-2.7 0,-4.1 0,-12.1 0,-29.8 0,-42 h -19 c 0.2,17.9 -0.3,37.6 0.6,55.4 0.6,11.3 5.8,21 17.3,25.1 2.9,1 5.9,1.7 9,2.1 4.8,0.5 9.6,-0.1 14.1,-1.7 2.3,-0.9 4.6,-2 6.6,-3.4 2.2,-1.5 4.2,-3.1 6.4,-4.6 0.3,2.3 0.5,4 0.7,5.6 0.1,1.1 0.2,2.6 1.1,2.6 h 16 v -81 h -18.7 v 5.8 z m 155.2,75.6 c 7.1,-1.8 13.8,-5.2 19.4,-10 0.7,-0.6 3.5,-2.5 3.5,-3.3 0,-0.5 -1,-1.1 -1.3,-1.4 -1.5,-1.3 -3,-2.6 -4.6,-3.8 -0.5,-0.4 -6.9,-5.9 -7.1,-5.7 -9.5,9.5 -20.3,11.5 -32.1,6.6 -7.2,-3 -9.8,-9.4 -10.3,-17.7 h 57 c 1.6,-10.8 -0.6,-23 -5.5,-31.3 -4.5,-8 -12.2,-13.7 -21.1,-15.7 -24.9,-5.9 -46.5,9.1 -49.6,35.3 -2,16.9 2.4,32 17.5,41.3 10.1,6.5 22.5,8.5 34.2,5.7 z M 263.2,56.8 c 11.2,-0.1 18.8,7.5 18.3,18.6 h -37.3 c -0.7,-10.5 7.6,-18.6 19,-18.6 z\" Color=\"Black\">\n\t\t\t\t\t\t<Blur ux:Name=\"myBlur\" Radius=\"0\"/>\n\t\t\t\t\t</Path>\n\t\t\t\t\t<Slider Margin=\"40,0\" Alignment=\"VerticalCenter\">\n\t\t\t\t\t\t<ProgressAnimation>\n\t\t\t\t\t\t\t<Change myBlur.Radius=\"10\" />\n\t\t\t\t\t\t</ProgressAnimation>\n\t\t\t\t\t</Slider>\n\t\t\t\t</Grid>\n\t\t\t</PageWithTitle>\n\t\t</PageControl>\n\t</ClientPanel>\n</App>\n\n"
  },
  {
    "path": "example/app.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}"
  },
  {
    "path": "fuse-mac-dev.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.1062\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"mac\", \"mac\", \"{C412FADC-70D7-43F6-BDEC-7312F697A390}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse X\", \"src\\mac\\studio\\fuse X.csproj\", \"{F431473B-DA4A-4335-BF9C-4841ED71E799}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse\", \"src\\fuse\\common\\Outracks.Fuse.csproj\", \"{AA6DFB99-345F-4214-9A79-076829C0F777}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-tray\", \"src\\fuse\\tray\\fuse-tray.csproj\", \"{A7F96918-8029-4EF4-A4EA-686A4B59FD61}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-studio\", \"src\\fuse\\studio\\fuse-studio.csproj\", \"{490EF7E5-46FF-4DF3-8342-530429CA65B5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Core\", \"src\\fusion\\core\\Outracks.Fusion.Core.csproj\", \"{8DFB02E0-ACBF-4432-8DD9-56712E206968}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Mac\", \"src\\fusion\\mac\\Outracks.Fusion.Mac.csproj\", \"{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse X (menu bar)\", \"src\\mac\\menu-bar\\fuse X (menu bar).csproj\", \"{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799} = {C412FADC-70D7-43F6-BDEC-7312F697A390}\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535} = {C412FADC-70D7-43F6-BDEC-7312F697A390}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {31FC2B0D-8AAC-4B8B-8D0F-693450BCE19F}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "fuse-mac.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.30002.166\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Core\", \"src\\common\\core\\Outracks.Core.csproj\", \"{196B010D-AD36-4947-95AA-14FC4A27BD18}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.NRefactoryInterop\", \"src\\ninja\\Outracks.CodeCompletion.NRefactoryInterop\\Outracks.CodeCompletion.NRefactoryInterop.csproj\", \"{5A43F127-3217-4BEA-93F0-13903B240B5A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Tests\", \"src\\common\\tests\\Outracks.Tests.csproj\", \"{1A7CF40D-C7A7-4C85-A092-73142BB90B93}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.TestProcess\", \"src\\common\\testproc\\Outracks.TestProcess.csproj\", \"{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Text\", \"src\\common\\text\\Outracks.Text.csproj\", \"{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Math\", \"src\\common\\math\\Outracks.Math.csproj\", \"{3C1C1047-8830-498E-882A-503C0956CBE3}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Simulator\", \"src\\simulator\\common\\Outracks.Simulator.csproj\", \"{3335BB78-0B8A-4D2F-919F-2E6F08883D51}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-lang\", \"src\\entrypoint\\code-assistance\\fuse-lang.csproj\", \"{338B4586-B3CC-4584-A026-E795B40D983A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Simulator.Main\", \"src\\simulator\\main\\Outracks.Simulator.Main.csproj\", \"{E8884270-5F2C-4076-86D0-456B831BE3E5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Fuse.Preview.Core\", \"src\\preview\\core\\Fuse.Preview.Core.csproj\", \"{41764897-B354-499D-A31A-6A1D3BB9E158}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-preview\", \"src\\preview\\service\\fuse-preview.csproj\", \"{59E1073A-9B45-41F3-AB94-958A9D18FB72}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Simulator.Tests\", \"src\\simulator\\tests\\Outracks.Simulator.Tests.csproj\", \"{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"ninja\", \"ninja\", \"{1124DA18-9DB9-4799-8482-3517C58570C7}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"common\", \"common\", \"{7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"fuse\", \"fuse\", \"{6452917D-20D9-4446-B2AA-3AE3061484B6}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"fusion\", \"fusion\", \"{8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"unohost\", \"unohost\", \"{D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"simulator\", \"simulator\", \"{BAB169B9-DE0C-4E29-8945-4978D964E408}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"preview\", \"preview\", \"{B8BE4F01-6C9C-4A75-9910-2077CF107531}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Fuse.Preview.Tests\", \"src\\preview\\tests\\Fuse.Preview.Tests.csproj\", \"{03CC1EEC-6596-40D6-B219-00168563ADD5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SketchConverter\", \"src\\sketch2fuse\\SketchConverter\\SketchConverter.csproj\", \"{B086E390-CE62-4C90-9214-9E828DE7AF33}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"mac\", \"mac\", \"{C412FADC-70D7-43F6-BDEC-7312F697A390}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse X\", \"src\\mac\\studio\\fuse X.csproj\", \"{F431473B-DA4A-4335-BF9C-4841ED71E799}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion\", \"src\\ninja\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\", \"{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.CodeNinja\", \"src\\ninja\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\", \"{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.CodeNinja.Tests\", \"src\\ninja\\Outracks.CodeCompletion.CodeNinja.Tests\\Outracks.CodeCompletion.CodeNinja.Tests.csproj\", \"{2615DA34-B3AC-4ADC-A005-E947851E201F}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja\\Outracks.CodeCompletion.UXNinja.csproj\", \"{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.Tests\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.Tests\\Outracks.CodeCompletion.UXNinja.Tests.csproj\", \"{A6525BC0-989C-407F-8B9B-51246D9E50B4}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.PerformanceTests\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.PerformanceTests\\Outracks.CodeCompletion.UXNinja.PerformanceTests.csproj\", \"{E40C711E-19CE-4885-A4F4-0D477E0F6852}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.TestsCommon\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.TestsCommon\\Outracks.CodeCompletion.UXNinja.TestsCommon.csproj\", \"{544ABBD9-1326-4184-B026-54EB4C9FAD33}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.PerformanceTests.Core\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.csproj\", \"{99FF164F-A691-4952-8EC8-577EB8C49F41}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.PerformanceTests.Client\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Client\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Client.csproj\", \"{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.UnoHost\", \"src\\unohost\\common\\Outracks.UnoHost.csproj\", \"{F2AEB321-51E5-40B8-9CF0-53C930E631F0}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Command\", \"src\\fuse\\command\\Outracks.Fuse.Command.csproj\", \"{8B6673C5-58B8-4E5A-8369-2E21507F4131}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse\", \"src\\fuse\\common\\Outracks.Fuse.csproj\", \"{AA6DFB99-345F-4214-9A79-076829C0F777}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Daemon\", \"src\\fuse\\daemon\\Outracks.Fuse.Daemon.csproj\", \"{47D48240-F996-4E64-B70D-6AB2290DA8D4}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-tray\", \"src\\fuse\\tray\\fuse-tray.csproj\", \"{A7F96918-8029-4EF4-A4EA-686A4B59FD61}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-studio\", \"src\\fuse\\studio\\fuse-studio.csproj\", \"{490EF7E5-46FF-4DF3-8342-530429CA65B5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"system-test\", \"src\\fuse\\system-test\\system-test.csproj\", \"{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Tests\", \"src\\fuse\\tests\\Outracks.Fuse.Tests.csproj\", \"{3921C434-B199-4A60-ADD2-192EB2AC4D76}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-sandbox\", \"src\\fuse\\sandbox\\fuse-sandbox.csproj\", \"{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Core\", \"src\\fusion\\core\\Outracks.Fusion.Core.csproj\", \"{8DFB02E0-ACBF-4432-8DD9-56712E206968}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"integration-tests\", \"src\\fusion\\integration-tests\\integration-tests.csproj\", \"{580BA299-ADAD-43C1-86A7-63E60F345F28}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Mac\", \"src\\fusion\\mac\\Outracks.Fusion.Mac.csproj\", \"{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Tests\", \"src\\fusion\\tests\\Outracks.Fusion.Tests.csproj\", \"{80455EED-7647-4BBF-9779-62413D846ACA}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Locale\", \"src\\fuse\\locale\\Outracks.Fuse.Locale.csproj\", \"{0E454646-B607-4FED-AB02-BECBC5620FA3}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.UnoHost.Tests\", \"src\\unohost\\tests\\Outracks.UnoHost.Tests.csproj\", \"{F506CC63-838F-4907-A573-BADD1C2D9CA1}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"entrypoint\", \"entrypoint\", \"{99006B5D-B268-4749-9E23-8210BCB22156}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse\", \"src\\entrypoint\\cli\\fuse.csproj\", \"{2FDE3363-73F5-433E-ADCF-1130658B5C52}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"UnoHost\", \"src\\unohost\\mac\\UnoHost.csproj\", \"{486BE0C3-2ED8-4AB4-9488-C004C247C719}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse X (menu bar)\", \"src\\mac\\menu-bar\\fuse X (menu bar).csproj\", \"{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{486BE0C3-2ED8-4AB4-9488-C004C247C719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{486BE0C3-2ED8-4AB4-9488-C004C247C719}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{486BE0C3-2ED8-4AB4-9488-C004C247C719}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{486BE0C3-2ED8-4AB4-9488-C004C247C719}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51} = {BAB169B9-DE0C-4E29-8945-4978D964E408}\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A} = {99006B5D-B268-4749-9E23-8210BCB22156}\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5} = {BAB169B9-DE0C-4E29-8945-4978D964E408}\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158} = {B8BE4F01-6C9C-4A75-9910-2077CF107531}\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72} = {B8BE4F01-6C9C-4A75-9910-2077CF107531}\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB} = {BAB169B9-DE0C-4E29-8945-4978D964E408}\n\t\t{B8BE4F01-6C9C-4A75-9910-2077CF107531} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5} = {B8BE4F01-6C9C-4A75-9910-2077CF107531}\n\t\t{F431473B-DA4A-4335-BF9C-4841ED71E799} = {C412FADC-70D7-43F6-BDEC-7312F697A390}\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0} = {D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1} = {D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52} = {99006B5D-B268-4749-9E23-8210BCB22156}\n\t\t{486BE0C3-2ED8-4AB4-9488-C004C247C719} = {D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\n\t\t{4264877D-5E9A-4FF7-9B70-5DE41D3E5535} = {C412FADC-70D7-43F6-BDEC-7312F697A390}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {31FC2B0D-8AAC-4B8B-8D0F-693450BCE19F}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "fuse-win-dev.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.30002.166\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-studio\", \"src\\fuse\\studio\\fuse-studio.csproj\", \"{490EF7E5-46FF-4DF3-8342-530429CA65B5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse\", \"src\\fuse\\common\\Outracks.Fuse.csproj\", \"{AA6DFB99-345F-4214-9A79-076829C0F777}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Locale\", \"src\\fuse\\locale\\Outracks.Fuse.Locale.csproj\", \"{0E454646-B607-4FED-AB02-BECBC5620FA3}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Windows\", \"src\\fusion\\win\\Outracks.Fusion.Windows.csproj\", \"{55C9979B-C90E-426F-8C75-DCCE6F193D23}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Core\", \"src\\fusion\\core\\Outracks.Fusion.Core.csproj\", \"{8DFB02E0-ACBF-4432-8DD9-56712E206968}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Mac\", \"src\\fusion\\mac\\Outracks.Fusion.Mac.csproj\", \"{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Command\", \"src\\fuse\\command\\Outracks.Fuse.Command.csproj\", \"{8B6673C5-58B8-4E5A-8369-2E21507F4131}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {3C18A79D-385D-462F-888D-A17500C93249}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "fuse-win.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.30002.166\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse\", \"src\\entrypoint\\cli\\fuse.csproj\", \"{2FDE3363-73F5-433E-ADCF-1130658B5C52}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse\", \"src\\fuse\\common\\Outracks.Fuse.csproj\", \"{AA6DFB99-345F-4214-9A79-076829C0F777}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Core\", \"src\\common\\core\\Outracks.Core.csproj\", \"{196B010D-AD36-4947-95AA-14FC4A27BD18}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Core\", \"src\\fusion\\core\\Outracks.Fusion.Core.csproj\", \"{8DFB02E0-ACBF-4432-8DD9-56712E206968}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion\", \"src\\ninja\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\", \"{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.NRefactoryInterop\", \"src\\ninja\\Outracks.CodeCompletion.NRefactoryInterop\\Outracks.CodeCompletion.NRefactoryInterop.csproj\", \"{5A43F127-3217-4BEA-93F0-13903B240B5A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Tests\", \"src\\fuse\\tests\\Outracks.Fuse.Tests.csproj\", \"{3921C434-B199-4A60-ADD2-192EB2AC4D76}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Tests\", \"src\\common\\tests\\Outracks.Tests.csproj\", \"{1A7CF40D-C7A7-4C85-A092-73142BB90B93}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.TestProcess\", \"src\\common\\testproc\\Outracks.TestProcess.csproj\", \"{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.CodeNinja\", \"src\\ninja\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\", \"{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.CodeNinja.Tests\", \"src\\ninja\\Outracks.CodeCompletion.CodeNinja.Tests\\Outracks.CodeCompletion.CodeNinja.Tests.csproj\", \"{2615DA34-B3AC-4ADC-A005-E947851E201F}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja\\Outracks.CodeCompletion.UXNinja.csproj\", \"{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.Tests\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.Tests\\Outracks.CodeCompletion.UXNinja.Tests.csproj\", \"{A6525BC0-989C-407F-8B9B-51246D9E50B4}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Command\", \"src\\fuse\\command\\Outracks.Fuse.Command.csproj\", \"{8B6673C5-58B8-4E5A-8369-2E21507F4131}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Windows\", \"src\\fusion\\win\\Outracks.Fusion.Windows.csproj\", \"{55C9979B-C90E-426F-8C75-DCCE6F193D23}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.UnoHost\", \"src\\unohost\\common\\Outracks.UnoHost.csproj\", \"{F2AEB321-51E5-40B8-9CF0-53C930E631F0}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Text\", \"src\\common\\text\\Outracks.Text.csproj\", \"{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Math\", \"src\\common\\math\\Outracks.Math.csproj\", \"{3C1C1047-8830-498E-882A-503C0956CBE3}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-tray\", \"src\\fuse\\tray\\fuse-tray.csproj\", \"{A7F96918-8029-4EF4-A4EA-686A4B59FD61}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Daemon\", \"src\\fuse\\daemon\\Outracks.Fuse.Daemon.csproj\", \"{47D48240-F996-4E64-B70D-6AB2290DA8D4}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Simulator\", \"src\\simulator\\common\\Outracks.Simulator.csproj\", \"{3335BB78-0B8A-4D2F-919F-2E6F08883D51}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-lang\", \"src\\entrypoint\\code-assistance\\fuse-lang.csproj\", \"{338B4586-B3CC-4584-A026-E795B40D983A}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.PerformanceTests\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.PerformanceTests\\Outracks.CodeCompletion.UXNinja.PerformanceTests.csproj\", \"{E40C711E-19CE-4885-A4F4-0D477E0F6852}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.TestsCommon\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.TestsCommon\\Outracks.CodeCompletion.UXNinja.TestsCommon.csproj\", \"{544ABBD9-1326-4184-B026-54EB4C9FAD33}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Simulator.Main\", \"src\\simulator\\main\\Outracks.Simulator.Main.csproj\", \"{E8884270-5F2C-4076-86D0-456B831BE3E5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.PerformanceTests.Core\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.csproj\", \"{99FF164F-A691-4952-8EC8-577EB8C49F41}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.CodeCompletion.UXNinja.PerformanceTests.Client\", \"src\\ninja\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Client\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Client.csproj\", \"{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Fuse.Preview.Core\", \"src\\preview\\core\\Fuse.Preview.Core.csproj\", \"{41764897-B354-499D-A31A-6A1D3BB9E158}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-preview\", \"src\\preview\\service\\fuse-preview.csproj\", \"{59E1073A-9B45-41F3-AB94-958A9D18FB72}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fusion.Tests\", \"src\\fusion\\tests\\Outracks.Fusion.Tests.csproj\", \"{80455EED-7647-4BBF-9779-62413D846ACA}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"unohost-win\", \"src\\unohost\\win\\unohost-win.csproj\", \"{DDA536E3-A637-4A6D-B0F6-EA0BAB92AFF7}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-studio\", \"src\\fuse\\studio\\fuse-studio.csproj\", \"{490EF7E5-46FF-4DF3-8342-530429CA65B5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Simulator.Tests\", \"src\\simulator\\tests\\Outracks.Simulator.Tests.csproj\", \"{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"ninja\", \"ninja\", \"{1124DA18-9DB9-4799-8482-3517C58570C7}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"common\", \"common\", \"{7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"fuse\", \"fuse\", \"{6452917D-20D9-4446-B2AA-3AE3061484B6}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"fusion\", \"fusion\", \"{8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"unohost\", \"unohost\", \"{D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"simulator\", \"simulator\", \"{BAB169B9-DE0C-4E29-8945-4978D964E408}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"preview\", \"preview\", \"{B8BE4F01-6C9C-4A75-9910-2077CF107531}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.UnoHost.Tests\", \"src\\unohost\\tests\\Outracks.UnoHost.Tests.csproj\", \"{F506CC63-838F-4907-A573-BADD1C2D9CA1}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-sandbox\", \"src\\fuse\\sandbox\\fuse-sandbox.csproj\", \"{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"integration-tests\", \"src\\fusion\\integration-tests\\integration-tests.csproj\", \"{580BA299-ADAD-43C1-86A7-63E60F345F28}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"system-test\", \"src\\fuse\\system-test\\system-test.csproj\", \"{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Fuse.Preview.Tests\", \"src\\preview\\tests\\Fuse.Preview.Tests.csproj\", \"{03CC1EEC-6596-40D6-B219-00168563ADD5}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SketchConverter\", \"src\\sketch2fuse\\SketchConverter\\SketchConverter.csproj\", \"{B086E390-CE62-4C90-9214-9E828DE7AF33}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Outracks.Fuse.Locale\", \"src\\fuse\\locale\\Outracks.Fuse.Locale.csproj\", \"{0E454646-B607-4FED-AB02-BECBC5620FA3}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"fuse-uri\", \"src\\entrypoint\\uri-handler\\fuse-uri.csproj\", \"{9E26C610-B4BE-4548-82B0-70CFF33267C9}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"entrypoint\", \"entrypoint\", \"{D29258A1-E93F-468A-8ACA-D24B04B42A1B}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{DDA536E3-A637-4A6D-B0F6-EA0BAB92AFF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DDA536E3-A637-4A6D-B0F6-EA0BAB92AFF7}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DDA536E3-A637-4A6D-B0F6-EA0BAB92AFF7}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DDA536E3-A637-4A6D-B0F6-EA0BAB92AFF7}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{9E26C610-B4BE-4548-82B0-70CFF33267C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{9E26C610-B4BE-4548-82B0-70CFF33267C9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{9E26C610-B4BE-4548-82B0-70CFF33267C9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{9E26C610-B4BE-4548-82B0-70CFF33267C9}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{2FDE3363-73F5-433E-ADCF-1130658B5C52} = {D29258A1-E93F-468A-8ACA-D24B04B42A1B}\n\t\t{AA6DFB99-345F-4214-9A79-076829C0F777} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{196B010D-AD36-4947-95AA-14FC4A27BD18} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{8DFB02E0-ACBF-4432-8DD9-56712E206968} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{5A43F127-3217-4BEA-93F0-13903B240B5A} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{3921C434-B199-4A60-ADD2-192EB2AC4D76} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{1A7CF40D-C7A7-4C85-A092-73142BB90B93} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{2615DA34-B3AC-4ADC-A005-E947851E201F} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{3C19F9AA-9C81-426F-A0EA-B046AAE755EE} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{A6525BC0-989C-407F-8B9B-51246D9E50B4} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{8B6673C5-58B8-4E5A-8369-2E21507F4131} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{55C9979B-C90E-426F-8C75-DCCE6F193D23} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{F2AEB321-51E5-40B8-9CF0-53C930E631F0} = {D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\n\t\t{D52BEC1D-D0B3-4C44-956F-9747233CD6CA} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{3C1C1047-8830-498E-882A-503C0956CBE3} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{A7F96918-8029-4EF4-A4EA-686A4B59FD61} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{47D48240-F996-4E64-B70D-6AB2290DA8D4} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{3335BB78-0B8A-4D2F-919F-2E6F08883D51} = {BAB169B9-DE0C-4E29-8945-4978D964E408}\n\t\t{338B4586-B3CC-4584-A026-E795B40D983A} = {D29258A1-E93F-468A-8ACA-D24B04B42A1B}\n\t\t{E40C711E-19CE-4885-A4F4-0D477E0F6852} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{544ABBD9-1326-4184-B026-54EB4C9FAD33} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{E8884270-5F2C-4076-86D0-456B831BE3E5} = {BAB169B9-DE0C-4E29-8945-4978D964E408}\n\t\t{99FF164F-A691-4952-8EC8-577EB8C49F41} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{BEB02E7E-2436-4D51-8688-27FEB4A72DBC} = {1124DA18-9DB9-4799-8482-3517C58570C7}\n\t\t{41764897-B354-499D-A31A-6A1D3BB9E158} = {B8BE4F01-6C9C-4A75-9910-2077CF107531}\n\t\t{59E1073A-9B45-41F3-AB94-958A9D18FB72} = {B8BE4F01-6C9C-4A75-9910-2077CF107531}\n\t\t{80455EED-7647-4BBF-9779-62413D846ACA} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{DDA536E3-A637-4A6D-B0F6-EA0BAB92AFF7} = {D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\n\t\t{490EF7E5-46FF-4DF3-8342-530429CA65B5} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{D1011D5C-56A1-4947-80FD-BF6FE8E955EB} = {BAB169B9-DE0C-4E29-8945-4978D964E408}\n\t\t{F506CC63-838F-4907-A573-BADD1C2D9CA1} = {D32389C5-3FF0-4BE4-8FFD-1A54C75672BE}\n\t\t{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{580BA299-ADAD-43C1-86A7-63E60F345F28} = {8BFA556B-6D8D-43EF-BDEE-194F5077F56E}\n\t\t{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E} = {6452917D-20D9-4446-B2AA-3AE3061484B6}\n\t\t{03CC1EEC-6596-40D6-B219-00168563ADD5} = {B8BE4F01-6C9C-4A75-9910-2077CF107531}\n\t\t{0E454646-B607-4FED-AB02-BECBC5620FA3} = {7F25EEC3-A139-4939-8E52-A9EE2CE92BE3}\n\t\t{9E26C610-B4BE-4548-82B0-70CFF33267C9} = {D29258A1-E93F-468A-8ACA-D24B04B42A1B}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {3C18A79D-385D-462F-888D-A17500C93249}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"@fuse-x/studio\",\n  \"version\": \"2.9.1\",\n  \"description\": \"fuse X is a visual desktop tool suite for working with the Fuse Open framework.\",\n  \"dependencies\": {\n    \"@fuse-open/fuselibs\": \"~2.9.1\",\n    \"@fuse-open/opentk\": \"~3.2.0\",\n    \"@fuse-open/tsconfig\": \"~2.7.0\",\n    \"@fuse-open/types\": \"~2.7.1\",\n    \"@fuse-open/uno\": \"~2.9.2\",\n    \"@fuse-open/xamarin-mac\": \"~9.3.0\"\n  },\n  \"devDependencies\": {\n    \"filecompare\": \"^1.0.4\",\n    \"fuse-barcodescanner\": \"^1.0.0\",\n    \"replace\": \"^1.2.2\",\n    \"rimraf\": \"^5.0.0\",\n    \"xbash\": \"^1.6.0\",\n    \"xml-reader\": \"^2.4.3\"\n  },\n  \"bin\": {\n    \"fuse\": \"bin/Debug/fuse.js\",\n    \"fuse-x\": \"bin/Debug/fuse.js\",\n    \"uno\": \"node_modules/@fuse-open/uno/bin/uno.js\"\n  },\n  \"bin-mac\": {\n    \"fuse\": \"bin/Release/fuse.js\",\n    \"fuse-x\": \"bin/Release/fuse.js\",\n    \"uno\": \"node_modules/@fuse-open/uno/bin/uno.js\"\n  },\n  \"bin-win\": {\n    \"fuse\": \"bin/Release/fuse.exe\",\n    \"fuse-x\": \"bin/Release/fuse.exe\",\n    \"uno\": \"node_modules/@fuse-open/uno/bin/uno.exe\"\n  },\n  \"scripts\": {\n    \"app:android\": \"bash src/preview/app/build.sh android --run\",\n    \"app:android-emu\": \"bash src/preview/app/build.sh android-emu --run\",\n    \"app:dotnet\": \"bash src/preview/app/build.sh dotnet --run\",\n    \"app:native\": \"bash src/preview/app/build.sh native --run\",\n    \"app:ios\": \"bash src/preview/app/build.sh ios -DCOCOAPODS --debug\",\n    \"app:ios-sim\": \"bash src/preview/app/build.sh ios-sim -DCOCOAPODS --run\",\n    \"build\": \"bash scripts/build.sh\",\n    \"app:build-apk\": \"bash src/preview/app/build.sh android --release -f && bash -c 'cp -Lfv src/preview/app/build/android/release/fuse-preview.apk fuse-x-preview-$npm_package_version-android.apk'\",\n    \"app:build-aab\": \"bash src/preview/app/build.sh android --release -f && bash -c 'cp -Lfv src/preview/app/build/android/release/fuse-preview.aab fuse-x-preview-$npm_package_version-android.aab'\",\n    \"setup:build\": \"bash setup/build.sh\",\n    \"setup:notarize\": \"bash setup/notarize.sh\",\n    \"setup:staple\": \"bash setup/staple.sh\",\n    \"texts-cs\": \"node scripts/texts-cs.js\",\n    \"clean\": \"rimraf bin/ packages/ src/**/.uno/ src/**/build/ src/**/bin/ src/**/obj/\",\n    \"daemon\": \"bash scripts/daemon.sh\",\n    \"doctor\": \"uno doctor src/simulator src/preview\",\n    \"fuse\": \"node bin/Debug/fuse.js\",\n    \"kill\": \"bash scripts/kill.sh\",\n    \"nuke\": \"yes n | git clean -dxf & npm run build\",\n    \"test\": \"bash scripts/test.sh\",\n    \"version\": \"bash scripts/version.sh\",\n    \"uninstall\": \"bash scripts/uninstall.sh\",\n    \"uno\": \"uno\"\n  },\n  \"scripts-mac\": {\n    \"postinstall\": \"node scripts/restore.js\"\n  },\n  \"scripts-win\": {\n    \"postinstall\": \"node scripts/restore.js\"\n  },\n  \"files\": [\n    \".unoconfig\",\n    \"bin/Release/**/*\",\n    \"components/**/*\",\n    \"empty/*.*\",\n    \"scripts/restore.js\",\n    \"setup/uninstall.sh\",\n    \"src/preview/build/**/*\",\n    \"src/simulator/build/**/*\",\n    \"src/simulator/main/obj/Fuse.Simulator.dll\",\n    \"templates/**/*\",\n    \"templates/**/.gitattributes\",\n    \"templates/**/.gitignore\"\n  ],\n  \"os-mac\": [\n    \"darwin\"\n  ],\n  \"os-win\": [\n    \"win32\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/fuse-x/studio.git\"\n  },\n  \"author\": \"Build & Run\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/fuse-x/studio/issues\"\n  },\n  \"homepage\": \"https://fuse-x.com\"\n}\n"
  },
  {
    "path": "projects/BananApp/BananApp.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}\n"
  },
  {
    "path": "projects/BananApp/MainView.ux",
    "content": "<App>\n    <Text Value=\"milkshkk\" Color=\"#442200\" Alignment=\"TopCenter\" Margin=\"0, 33, 0, 0\" FontSize=\"79\">\n        <Rotation Degrees=\"-173.95\" />\n    </Text>\n    <Circle Color=\"#994400FF\" Alignment=\"Top\" Width=\"300\" Height=\"300\" Margin=\"0, -80, 0, 0\" Opacity=\"1\" />\n    <Circle Color=\"#442200\" Alignment=\"Top\" Margin=\"0, -960, 0, 0\" Width=\"1200\" Height=\"1200\" Opacity=\"1\" />\n    <StackPanel Width=\"600\">\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\">\n            <Panel>\n                <Panel />\n                <Text Color=\"#442200\" Value=\"banana\" FontSize=\"89\" Margin=\"0, -40, 0, 0\" />\n                <Panel />\n                <Rotation Degrees=\"-62.017\" />\n            </Panel>\n        </Rectangle>\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\">\n            <Text Value=\"     flies\" FontSize=\"150\" Color=\"#ffee00FC\" Margin=\"42, 0, 0, 0\" />\n        </Rectangle>\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"4\" Color=\"#ffee00\" />\n        <Rectangle Height=\"4\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rectangle Height=\"6\" Color=\"#994400\" />\n        <Rectangle Height=\"6\" Color=\"#ffee00\" />\n        <Rotation Degrees=\"9.076\" />\n    </StackPanel>\n</App>"
  },
  {
    "path": "projects/CheckForUpdates/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n    <startup> \n        <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.6\" />\n    </startup>\n</configuration>"
  },
  {
    "path": "projects/CheckForUpdates/ConsoleApp1.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{B180C6F6-1E2B-4A35-A42E-17FC38A74AAB}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>ConsoleApp1</RootNamespace>\n    <AssemblyName>ConsoleApp1</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n    <Deterministic>true</Deterministic>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\node_modules\\@fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Net.Http\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"App.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n</Project>"
  },
  {
    "path": "projects/CheckForUpdates/Program.cs",
    "content": "﻿using Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace ConsoleApp1\n{\n\tclass Program\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tvar json = File.ReadAllText(\"../../releases.json\");\n\t\t\tvar releases = JsonConvert.DeserializeObject<List<JObject>>(json);\n\t\t\tConsole.WriteLine(IsUpdateAvailable(releases, \"2.0.0-beta.5\"));\n\t\t}\n\n\t\tstatic bool IsUpdateAvailable(List<JObject> releases, string currentVersion)\n\t\t{\n\t\t\tvar currentIsPrerelease = currentVersion.IndexOf('-') != -1;\n\t\t\tvar foundRelease = false;\n\n\t\t\tforeach (var release in releases)\n\t\t\t{\n\t\t\t\tvar assets = (JArray)release[\"assets\"];\n\t\t\t\tvar prerelease = (bool)release[\"prerelease\"];\n\t\t\t\tvar tag_name = (string)release[\"tag_name\"];\n\t\t\t\tvar version = tag_name.TrimStart('v');\n\n\t\t\t\tif (version == currentVersion)\n\t\t\t\t\treturn foundRelease;\n\n\t\t\t\tif (!ContainsCompatibleInstaller(assets))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (currentIsPrerelease || !prerelease)\n\t\t\t\t\tfoundRelease = true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic bool ContainsCompatibleInstaller(JArray assets)\n\t\t{\n\t\t\tforeach (var asset in assets)\n\t\t\t{\n\t\t\t\tvar name = (string)asset[\"name\"];\n\n\t\t\t\tif (Platform.IsMac && name.EndsWith(\".dmg\") ||\n\t\t\t\t\tPlatform.IsMac && name.EndsWith(\".pkg\") ||\n\t\t\t\t\tPlatform.IsWindows && name.EndsWith(\".exe\") ||\n\t\t\t\t\tPlatform.IsWindows && name.EndsWith(\".msi\"))\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tclass Platform\n\t{\n\t\tpublic static bool IsMac = true;\n\t\tpublic static bool IsWindows = false;\n\t}\n}\n"
  },
  {
    "path": "projects/CheckForUpdates/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ConsoleApp1\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"ConsoleApp1\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2020\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"b180c6f6-1e2b-4a35-a42e-17fc38a74aab\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "projects/CheckForUpdates/releases.json",
    "content": "[\n  {\n    \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/35054174\",\n    \"assets_url\": \"https://api.github.com/repos/fuse-x/studio/releases/35054174/assets\",\n    \"upload_url\": \"https://uploads.github.com/repos/fuse-x/studio/releases/35054174/assets{?name,label}\",\n    \"html_url\": \"https://github.com/fuse-x/studio/releases/tag/v2.0.0-beta.5\",\n    \"id\": 35054174,\n    \"author\": {\n      \"login\": \"mortend\",\n      \"id\": 247798,\n      \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n      \"gravatar_id\": \"\",\n      \"url\": \"https://api.github.com/users/mortend\",\n      \"html_url\": \"https://github.com/mortend\",\n      \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n      \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n      \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n      \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n      \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n      \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n      \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n      \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n      \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n      \"type\": \"User\",\n      \"site_admin\": false\n    },\n    \"node_id\": \"MDc6UmVsZWFzZTM1MDU0MTc0\",\n    \"tag_name\": \"v2.0.0-beta.5\",\n    \"target_commitish\": \"master\",\n    \"name\": \"fuse X 2.0.0-beta.5\",\n    \"draft\": false,\n    \"prerelease\": true,\n    \"created_at\": \"2020-12-07T11:09:12Z\",\n    \"published_at\": \"2020-12-10T14:27:33Z\",\n    \"assets\": [\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/29354261\",\n        \"id\": 29354261,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDI5MzU0MjYx\",\n        \"name\": \"fuse-x-2.0.0-beta.5-mac.pkg\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/octet-stream\",\n        \"state\": \"uploaded\",\n        \"size\": 10104241,\n        \"download_count\": 21,\n        \"created_at\": \"2020-12-09T16:44:52Z\",\n        \"updated_at\": \"2020-12-09T16:45:07Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.5/fuse-x-2.0.0-beta.5-mac.pkg\"\n      },\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/29379938\",\n        \"id\": 29379938,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDI5Mzc5OTM4\",\n        \"name\": \"fuse-x-2.0.0-beta.5-win.exe\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/x-msdownload\",\n        \"state\": \"uploaded\",\n        \"size\": 5258274,\n        \"download_count\": 45,\n        \"created_at\": \"2020-12-10T08:12:16Z\",\n        \"updated_at\": \"2020-12-10T08:12:31Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.5/fuse-x-2.0.0-beta.5-win.exe\"\n      },\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/29354279\",\n        \"id\": 29354279,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDI5MzU0Mjc5\",\n        \"name\": \"fuse-x-preview-2.0.0-beta.5-android.apk\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/vnd.android.package-archive\",\n        \"state\": \"uploaded\",\n        \"size\": 23691224,\n        \"download_count\": 14,\n        \"created_at\": \"2020-12-09T16:45:07Z\",\n        \"updated_at\": \"2020-12-09T16:45:13Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.5/fuse-x-preview-2.0.0-beta.5-android.apk\"\n      }\n    ],\n    \"tarball_url\": \"https://api.github.com/repos/fuse-x/studio/tarball/v2.0.0-beta.5\",\n    \"zipball_url\": \"https://api.github.com/repos/fuse-x/studio/zipball/v2.0.0-beta.5\",\n    \"body\": \"### Download links\\r\\n\\r\\n* [Android preview app (.apk)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.5/fuse-x-preview-2.0.0-beta.5-android.apk) - *22.6 MB*\\r\\n* [macOS installer (.pkg)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.5/fuse-x-2.0.0-beta.5-mac.pkg) - *9.6 MB*\\r\\n* [Windows installer (.exe)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.5/fuse-x-2.0.0-beta.5-win.exe) - *5.0 MB*\\r\\n\\r\\n### Changes since v2.0.0-beta.4\\r\\n\\r\\nThis release fixes a bunch of issues and should now be quite usable on macOS as well. Also, the companion preview app is back (Android only for now).\\r\\n\\r\\n#### Addresses macOS issues\\r\\n- \\\"fuse install android\\\" error ([#4](https://github.com/fuse-x/studio/issues/4))\\r\\n- Closing app causes high CPU usage ([#5](https://github.com/fuse-x/studio/issues/5))\\r\\n- Mac app does not start ([#6](https://github.com/fuse-x/studio/issues/6))\\r\\n- Project will not load on Mac ([#7](https://github.com/fuse-x/studio/issues/7))\\r\\n- Cannot build IOS app ([#8](https://github.com/fuse-x/studio/issues/8))\\r\\n- Fixed Fuse Daemon background process launching\\r\\n\\r\\n#### Other improvements\\r\\n- Fixes issue with \\\"Open in VSCode\\\" (Windows)\\r\\n- Installer distributables are now smaller in file size\\r\\n- New icons and visual improvements\\r\\n- Upgraded to latest Xamarin.Mac v7.0\\r\\n\\r\\n#### Preview app (Android)\\r\\n- Built on latest versions of Uno and Fuselibs\\r\\n- Includes new `Fuse.Auth` and `Fuse.Sensor` libraries\\r\\n- Now runs on Chinese ROMs (without google-play-services)\\r\\n- \\\"Dark mode\\\" theme\\r\\n    \\r\\n#### [Uno v2.0.0-beta.7](https://github.com/fuse-open/uno/compare/v2.0.0-beta.5...v2.0.0-beta.7)\\r\\n- Fixes issue with Android release builds ([#365](https://github.com/fuse-open/uno/pull/365))\\r\\n- Fixes issue with installing Android apps ([#368](https://github.com/fuse-open/uno/pull/368), [#370](https://github.com/fuse-open/uno/pull/370))\\r\\n- Fixes compile-time warnings on iOS ([#369](https://github.com/fuse-open/uno/pull/369))\\r\\n- Added support for adaptive icons on Android ([#363](https://github.com/fuse-open/uno/pull/363))\\r\\n- Upgraded various compiler dependencies ([#366](https://github.com/fuse-open/uno/pull/366))\\r\\n\\r\\n#### [Fuselibs v2.0.0-beta.3](https://github.com/fuse-open/fuselibs/compare/v2.0.0-beta.1...v2.0.0-beta.3)\\r\\n- Added `Style` property to DatePicker and TimePicker ([#1384](https://github.com/fuse-open/fuselibs/pull/1384))\\r\\n- Fixes rendering issue with DatePicker on iOS ([#1384](https://github.com/fuse-open/fuselibs/pull/1384))\\r\\n- Fixes issue with device orientations ([#1375](https://github.com/fuse-open/fuselibs/pull/1375))\\r\\n- Fixes compatibility issue with latest Xcode ([#1377](https://github.com/fuse-open/fuselibs/pull/1377))\\r\\n- Added JS Biometric module ([#1379](https://github.com/fuse-open/fuselibs/pull/1379))\\r\\n- Added support for shadow on NativeViewHost ([#1380](https://github.com/fuse-open/fuselibs/pull/1380))\\r\\n- Added Glass effect ([#1381](https://github.com/fuse-open/fuselibs/pull/1381))\\r\\n- Added length function (UX) ([#1382](https://github.com/fuse-open/fuselibs/pull/1382))\\r\\n- Added JS properties for accessing Uno project information ([#1383](https://github.com/fuse-open/fuselibs/pull/1383))\\r\\n\\r\\n#### [FuseJS transpiler v1.17.0](https://github.com/fuse-open/transpiler/compare/v1.16.1...v1.17.0)\\r\\n- Added support for [optional chaining](https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining) ([#11](https://github.com/fuse-open/transpiler/pull/11))\\r\\n\\r\\n> Special thanks to @AndrewEQ and @ichan-mb for helping out with this release! 👍 \\r\\n\\r\\n### Known issues\\r\\n\\r\\n* Code completion in VS Code not working yet on Windows\\r\\n    * (but code completion in Sublime Text 3 works well for now)\\r\\n\\r\\n> Please report issues [here](https://github.com/fuse-x/studio/issues).\"\n  },\n  {\n    \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/31370252\",\n    \"assets_url\": \"https://api.github.com/repos/fuse-x/studio/releases/31370252/assets\",\n    \"upload_url\": \"https://uploads.github.com/repos/fuse-x/studio/releases/31370252/assets{?name,label}\",\n    \"html_url\": \"https://github.com/fuse-x/studio/releases/tag/v2.0.0-beta.4\",\n    \"id\": 31370252,\n    \"author\": {\n      \"login\": \"mortend\",\n      \"id\": 247798,\n      \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n      \"gravatar_id\": \"\",\n      \"url\": \"https://api.github.com/users/mortend\",\n      \"html_url\": \"https://github.com/mortend\",\n      \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n      \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n      \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n      \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n      \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n      \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n      \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n      \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n      \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n      \"type\": \"User\",\n      \"site_admin\": false\n    },\n    \"node_id\": \"MDc6UmVsZWFzZTMxMzcwMjUy\",\n    \"tag_name\": \"v2.0.0-beta.4\",\n    \"target_commitish\": \"master\",\n    \"name\": \"fuse X 2.0.0-beta.4\",\n    \"draft\": false,\n    \"prerelease\": true,\n    \"created_at\": \"2020-07-28T21:49:12Z\",\n    \"published_at\": \"2020-09-16T04:58:14Z\",\n    \"assets\": [\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/25730158\",\n        \"id\": 25730158,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDI1NzMwMTU4\",\n        \"name\": \"fuse-x-2.0.0-beta.4-mac.pkg\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/octet-stream\",\n        \"state\": \"uploaded\",\n        \"size\": 20599257,\n        \"download_count\": 129,\n        \"created_at\": \"2020-09-16T04:57:12Z\",\n        \"updated_at\": \"2020-09-16T04:57:28Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.4/fuse-x-2.0.0-beta.4-mac.pkg\"\n      },\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/25727079\",\n        \"id\": 25727079,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDI1NzI3MDc5\",\n        \"name\": \"fuse-x-2.0.0-beta.4-win.exe\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/x-msdownload\",\n        \"state\": \"uploaded\",\n        \"size\": 6034845,\n        \"download_count\": 342,\n        \"created_at\": \"2020-09-16T03:40:49Z\",\n        \"updated_at\": \"2020-09-16T03:40:53Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.4/fuse-x-2.0.0-beta.4-win.exe\"\n      }\n    ],\n    \"tarball_url\": \"https://api.github.com/repos/fuse-x/studio/tarball/v2.0.0-beta.4\",\n    \"zipball_url\": \"https://api.github.com/repos/fuse-x/studio/zipball/v2.0.0-beta.4\",\n    \"body\": \"### Download links\\r\\n\\r\\n* [macOS installer (.pkg)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.4/fuse-x-2.0.0-beta.4-mac.pkg) - *19.6 MB*\\r\\n* [Windows installer (.exe)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.4/fuse-x-2.0.0-beta.4-win.exe) - *5.8 MB*\\r\\n\\r\\n> Please see [this page](https://fuse-x.com/activate) for activation instructions.\\r\\n\\r\\n### Changes since v2.0.0-beta.3\\r\\n\\r\\n- macOS installer improvements (#3)\\r\\n- Upgraded Uno to v2.0.0-beta.5\\r\\n- Upgraded Fuselibs to v2.0.0-beta.1\\r\\n\\r\\n### Known issues\\r\\n\\r\\n* On macOS, the URL Handler doesn't work yet because of an issue with signing, and clicking `fusestudio://` links don't do anything. Please use Terminal to activate your Fuse Studio installation while this is being fixed.\\r\\n\\r\\n* On macOS, you may have to do a full restart of Fuse Studio before a new license takes effect. `fuse kill-all ; fuse`.\\r\\n\\r\\n> Please report issues [here](https://github.com/fuse-x/studio/issues).\\r\\n\\r\\n### Troubleshooting\\r\\n\\r\\n* On macOS, please check that you have minimum Mono version 6.4 installed, or download the [latest version](https://www.mono-project.com/download/stable/).\\r\\n* On macOS, your `fuse` executable is installed in `/usr/local/bin`, so please check that this directory is added to your PATH.\"\n  },\n  {\n    \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/29747734\",\n    \"assets_url\": \"https://api.github.com/repos/fuse-x/studio/releases/29747734/assets\",\n    \"upload_url\": \"https://uploads.github.com/repos/fuse-x/studio/releases/29747734/assets{?name,label}\",\n    \"html_url\": \"https://github.com/fuse-x/studio/releases/tag/v2.0.0-beta.3\",\n    \"id\": 29747734,\n    \"author\": {\n      \"login\": \"mortend\",\n      \"id\": 247798,\n      \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n      \"gravatar_id\": \"\",\n      \"url\": \"https://api.github.com/users/mortend\",\n      \"html_url\": \"https://github.com/mortend\",\n      \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n      \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n      \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n      \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n      \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n      \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n      \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n      \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n      \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n      \"type\": \"User\",\n      \"site_admin\": false\n    },\n    \"node_id\": \"MDc6UmVsZWFzZTI5NzQ3NzM0\",\n    \"tag_name\": \"v2.0.0-beta.3\",\n    \"target_commitish\": \"master\",\n    \"name\": \"fuse X 2.0.0-beta.3\",\n    \"draft\": false,\n    \"prerelease\": true,\n    \"created_at\": \"2020-07-28T21:49:12Z\",\n    \"published_at\": \"2020-08-16T16:10:51Z\",\n    \"assets\": [\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/23981368\",\n        \"id\": 23981368,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDIzOTgxMzY4\",\n        \"name\": \"fuse-x-2.0.0-beta.3-mac.pkg\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/octet-stream\",\n        \"state\": \"uploaded\",\n        \"size\": 20603505,\n        \"download_count\": 12,\n        \"created_at\": \"2020-08-16T15:53:51Z\",\n        \"updated_at\": \"2020-08-16T15:54:08Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.3/fuse-x-2.0.0-beta.3-mac.pkg\"\n      },\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/23981582\",\n        \"id\": 23981582,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDIzOTgxNTgy\",\n        \"name\": \"fuse-x-2.0.0-beta.3-win.exe\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/x-msdownload\",\n        \"state\": \"uploaded\",\n        \"size\": 6038144,\n        \"download_count\": 26,\n        \"created_at\": \"2020-08-16T16:08:50Z\",\n        \"updated_at\": \"2020-08-16T16:09:05Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.3/fuse-x-2.0.0-beta.3-win.exe\"\n      }\n    ],\n    \"tarball_url\": \"https://api.github.com/repos/fuse-x/studio/tarball/v2.0.0-beta.3\",\n    \"zipball_url\": \"https://api.github.com/repos/fuse-x/studio/zipball/v2.0.0-beta.3\",\n    \"body\": \"### Download links\\r\\n\\r\\n* [macOS installer (.pkg)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.3/fuse-x-2.0.0-beta.3-mac.pkg) - *19.6 MB*\\r\\n* [Windows installer (.exe)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.3/fuse-x-2.0.0-beta.3-win.exe) - *5.8 MB*\\r\\n\\r\\n> Please see [this page](https://fuse-x.com/activate) for activation instructions.\\r\\n\\r\\n### Changes since v2.0.0-beta.2\\r\\n\\r\\n#### macOS installer\\r\\n\\r\\n- Always install in `/usr/local/`.\\r\\n- Make sure destinations are writeable (#3).\\r\\n- Improve system checks and error messages.\\r\\n\\r\\n#### Windows installer\\r\\n\\r\\n- Fix link to JDK installer.\\r\\n\\r\\n### Known issues\\r\\n\\r\\n* On macOS, the URL Handler doesn't work yet because of an issue with signing, and clicking `fusestudio://` links don't do anything. Please use Terminal to activate your Fuse Studio installation while this is being fixed.\\r\\n\\r\\n* On macOS, you may have to do a full restart of Fuse Studio before a new license takes effect. `fuse kill-all ; fuse`.\\r\\n\\r\\n> Please report issues [here](https://github.com/fuse-x/studio/issues).\\r\\n\\r\\n### Troubleshooting\\r\\n\\r\\n* On macOS, please check that you have minimum Mono version 6.4 installed, or download the [latest version](https://www.mono-project.com/download/stable/).\\r\\n* On macOS, your `fuse` executable is installed in `/usr/local/bin`, so please check that this directory is added to your PATH.\"\n  },\n  {\n    \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/28624263\",\n    \"assets_url\": \"https://api.github.com/repos/fuse-x/studio/releases/28624263/assets\",\n    \"upload_url\": \"https://uploads.github.com/repos/fuse-x/studio/releases/28624263/assets{?name,label}\",\n    \"html_url\": \"https://github.com/fuse-x/studio/releases/tag/v2.0.0-beta.2\",\n    \"id\": 28624263,\n    \"author\": {\n      \"login\": \"mortend\",\n      \"id\": 247798,\n      \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n      \"gravatar_id\": \"\",\n      \"url\": \"https://api.github.com/users/mortend\",\n      \"html_url\": \"https://github.com/mortend\",\n      \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n      \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n      \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n      \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n      \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n      \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n      \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n      \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n      \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n      \"type\": \"User\",\n      \"site_admin\": false\n    },\n    \"node_id\": \"MDc6UmVsZWFzZTI4NjI0MjYz\",\n    \"tag_name\": \"v2.0.0-beta.2\",\n    \"target_commitish\": \"master\",\n    \"name\": \"fuse X 2.0.0-beta.2\",\n    \"draft\": false,\n    \"prerelease\": true,\n    \"created_at\": \"2020-07-16T09:46:07Z\",\n    \"published_at\": \"2020-07-16T09:51:15Z\",\n    \"assets\": [\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/22930801\",\n        \"id\": 22930801,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDIyOTMwODAx\",\n        \"name\": \"fuse-x-2.0.0-beta.2-mac.pkg\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/octet-stream\",\n        \"state\": \"uploaded\",\n        \"size\": 20679493,\n        \"download_count\": 31,\n        \"created_at\": \"2020-07-16T09:56:03Z\",\n        \"updated_at\": \"2020-07-16T09:56:45Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.2/fuse-x-2.0.0-beta.2-mac.pkg\"\n      },\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/22930680\",\n        \"id\": 22930680,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDIyOTMwNjgw\",\n        \"name\": \"fuse-x-2.0.0-beta.2-win.exe\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/x-msdownload\",\n        \"state\": \"uploaded\",\n        \"size\": 6038218,\n        \"download_count\": 35,\n        \"created_at\": \"2020-07-16T09:49:56Z\",\n        \"updated_at\": \"2020-07-16T09:50:09Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.2/fuse-x-2.0.0-beta.2-win.exe\"\n      }\n    ],\n    \"tarball_url\": \"https://api.github.com/repos/fuse-x/studio/tarball/v2.0.0-beta.2\",\n    \"zipball_url\": \"https://api.github.com/repos/fuse-x/studio/zipball/v2.0.0-beta.2\",\n    \"body\": \"This is the first public beta version of Fuse Studio 2.0.\\r\\n\\r\\n### Download links\\r\\n\\r\\n* [macOS installer (.pkg)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.2/fuse-x-2.0.0-beta.2-mac.pkg) - *19.7 MB*\\r\\n* [Windows installer (.exe)](https://github.com/fuse-x/studio/releases/download/v2.0.0-beta.2/fuse-x-2.0.0-beta.2-win.exe) - *5.8 MB*\\r\\n\\r\\n> Please see [this page](https://fuse-x.com/activate) for activation instructions.\\r\\n\\r\\n### Known issues\\r\\n\\r\\n* On macOS, the URL Handler doesn't work yet because of an issue with signing, and clicking `fusestudio://` links don't do anything. Please use Terminal to activate your Fuse Studio installation while this is being fixed.\\r\\n\\r\\n* On macOS, you may have to do a full restart of Fuse Studio before a new license takes effect. `fuse kill-all ; fuse`.\\r\\n\\r\\n> Please report issues [here](https://github.com/fuse-x/studio/issues).\\r\\n\\r\\n### Troubleshooting\\r\\n\\r\\n* On macOS, please check that you have minimum Mono version 6.4 installed, or download the [latest version](https://www.mono-project.com/download/stable/).\\r\\n* On macOS, your `fuse` executable is installed in \\\"`npm prefix -g`/bin\\\", so please check that your global NPM bin-directory is added to PATH.\"\n  },\n  {\n    \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/28430500\",\n    \"assets_url\": \"https://api.github.com/repos/fuse-x/studio/releases/28430500/assets\",\n    \"upload_url\": \"https://uploads.github.com/repos/fuse-x/studio/releases/28430500/assets{?name,label}\",\n    \"html_url\": \"https://github.com/fuse-x/studio/releases/tag/v2.0.0-alpha.2\",\n    \"id\": 28430500,\n    \"author\": {\n      \"login\": \"mortend\",\n      \"id\": 247798,\n      \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n      \"gravatar_id\": \"\",\n      \"url\": \"https://api.github.com/users/mortend\",\n      \"html_url\": \"https://github.com/mortend\",\n      \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n      \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n      \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n      \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n      \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n      \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n      \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n      \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n      \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n      \"type\": \"User\",\n      \"site_admin\": false\n    },\n    \"node_id\": \"MDc6UmVsZWFzZTI4NDMwNTAw\",\n    \"tag_name\": \"v2.0.0-alpha.2\",\n    \"target_commitish\": \"master\",\n    \"name\": \"fuse X 2.0.0-alpha.2\",\n    \"draft\": false,\n    \"prerelease\": true,\n    \"created_at\": \"2020-07-10T07:18:35Z\",\n    \"published_at\": \"2020-07-10T07:20:37Z\",\n    \"assets\": [\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/22746683\",\n        \"id\": 22746683,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDIyNzQ2Njgz\",\n        \"name\": \"fuse-x-2.0.0-alpha.2-mac.pkg\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/octet-stream\",\n        \"state\": \"uploaded\",\n        \"size\": 19837671,\n        \"download_count\": 3,\n        \"created_at\": \"2020-07-10T07:54:32Z\",\n        \"updated_at\": \"2020-07-10T07:55:07Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-alpha.2/fuse-x-2.0.0-alpha.2-mac.pkg\"\n      },\n      {\n        \"url\": \"https://api.github.com/repos/fuse-x/studio/releases/assets/22745944\",\n        \"id\": 22745944,\n        \"node_id\": \"MDEyOlJlbGVhc2VBc3NldDIyNzQ1OTQ0\",\n        \"name\": \"fuse-x-2.0.0-alpha.2-win.exe\",\n        \"label\": null,\n        \"uploader\": {\n          \"login\": \"mortend\",\n          \"id\": 247798,\n          \"node_id\": \"MDQ6VXNlcjI0Nzc5OA==\",\n          \"avatar_url\": \"https://avatars0.githubusercontent.com/u/247798?v=4\",\n          \"gravatar_id\": \"\",\n          \"url\": \"https://api.github.com/users/mortend\",\n          \"html_url\": \"https://github.com/mortend\",\n          \"followers_url\": \"https://api.github.com/users/mortend/followers\",\n          \"following_url\": \"https://api.github.com/users/mortend/following{/other_user}\",\n          \"gists_url\": \"https://api.github.com/users/mortend/gists{/gist_id}\",\n          \"starred_url\": \"https://api.github.com/users/mortend/starred{/owner}{/repo}\",\n          \"subscriptions_url\": \"https://api.github.com/users/mortend/subscriptions\",\n          \"organizations_url\": \"https://api.github.com/users/mortend/orgs\",\n          \"repos_url\": \"https://api.github.com/users/mortend/repos\",\n          \"events_url\": \"https://api.github.com/users/mortend/events{/privacy}\",\n          \"received_events_url\": \"https://api.github.com/users/mortend/received_events\",\n          \"type\": \"User\",\n          \"site_admin\": false\n        },\n        \"content_type\": \"application/x-msdownload\",\n        \"state\": \"uploaded\",\n        \"size\": 6060736,\n        \"download_count\": 3,\n        \"created_at\": \"2020-07-10T07:20:28Z\",\n        \"updated_at\": \"2020-07-10T07:20:35Z\",\n        \"browser_download_url\": \"https://github.com/fuse-x/studio/releases/download/v2.0.0-alpha.2/fuse-x-2.0.0-alpha.2-win.exe\"\n      }\n    ],\n    \"tarball_url\": \"https://api.github.com/repos/fuse-x/studio/tarball/v2.0.0-alpha.2\",\n    \"zipball_url\": \"https://api.github.com/repos/fuse-x/studio/zipball/v2.0.0-alpha.2\",\n    \"body\": \"### Known issues\\r\\n\\r\\n* Still unstable on macOS.\"\n  }\n]\n"
  },
  {
    "path": "projects/JsErrors/.gitignore",
    "content": "build\n.cache\n*.swp\n"
  },
  {
    "path": "projects/JsErrors/ConstructorThrower.uno",
    "content": "using Uno;\nusing Fuse.Controls;\nusing Fuse.Gestures;\n\npublic class ConstructorThrower : Button\n{\n    public ConstructorThrower()\n    {\n        throw new Exception(\"Bye from Uno constructor\");\n    }\n}"
  },
  {
    "path": "projects/JsErrors/JsErrors.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}\n"
  },
  {
    "path": "projects/JsErrors/Logger.uno",
    "content": "using Uno;\nusing Fuse.Controls;\nusing Fuse.Gestures;\n\npublic class Logger : Button\n{\n    public Logger()\n    {\n        Fuse.Gestures.Clicked.AddHandler(this, ClickHandler);\n    }\n    public void ClickHandler(object _, object __)\n    {\n        debug_log(\"Hello from Uno\");\n    }\n\n}\n"
  },
  {
    "path": "projects/JsErrors/MainView.ux",
    "content": "<App ClearColor=\"#eeeeeeff\">\n\t<DockPanel>\n\t\t<StatusBarBackground DockPanel.Dock=\"Top\" />\n\t\t<JavaScript>\n\t\tvar Observable = require(\"FuseJS/Observable\");\n\t\tvar textThing = Observable(\"1\");\n\n\t\tfunction doer() {\n\t\t\tvar n = parseInt(textThing.value);\n\t\t\ttextThing.value = n+1;\n\t\t}\n\n\t\tfunction debuglogger() {\n\t\t\tdebug_log(\"Hello from JS\");\n\t\t}\n\n\t\tfunction thrower() {\n\t\t\tthrow new Error(\"Bye from JS\")\n\t\t}\n\t\tmodule.exports = {\n\t\t\tdoer: doer,\n\t\t\tdebuglogger: debuglogger,\n\t\t\tthrower: thrower,\n\t\t\ttextThing: textThing,\n\t\t};\n\t\t</JavaScript>\n\t\t<ScrollView ClipToBounds=\"true\">\n\t\t\t<StackPanel>\n\t\t\t\t<Text Value=\"{textThing}\" FontSize=\"50\" Alignment=\"Center\" />\n\t\t\t\t<Button Text=\"Increment\" Clicked=\"{doer}\" />\n\t\t\t\t<Button Text=\"Log from JS\" Clicked=\"{debuglogger}\" />\n\t\t\t\t<Button Text=\"Throw from JS\" Clicked=\"{thrower}\" />\n                <Each />\n                <Logger Text=\"Log from Uno\" />\n                <Thrower Text=\"Throw from Uno\" />\n                <PageControl />\n                <!-- <ConstructorThrower Text=\"Throw from Uno constructor\" /> -->\n\t\t\t</StackPanel>\n\t\t</ScrollView>\n\t</DockPanel>\n</App>"
  },
  {
    "path": "projects/JsErrors/Thrower.uno",
    "content": "using Uno;\nusing Fuse.Controls;\nusing Fuse.Gestures;\n\npublic class Thrower : Button\n{\n    public Thrower()\n    {\n        Fuse.Gestures.Clicked.AddHandler(this, ClickHandler);\n    }\n    public void ClickHandler(object _, object __)\n    {\n        throw new Exception(\"Bye from Uno\");\n    }\n\n}\n"
  },
  {
    "path": "projects/SketchImportApp/MainView.ux",
    "content": "<App>\n</App>\n"
  },
  {
    "path": "projects/SketchImportApp/SketchImportApp.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}\n\n"
  },
  {
    "path": "projects/SystemTest1/MainView.ux",
    "content": "<App>\n\t<JavaScript>\n\t\tvar FileSystem = require(\"FuseJS/FileSystem\");\n\t\tvar fileName = \"output1\";\n\t\tvar path = FileSystem.dataDirectory + \"/\" + fileName;\n\t\tFileSystem.writeTextToFile(path, \"\")\n\t\t\t.then(function() {\n\t\t\t\tconsole.log(\"Wrote to \" + path);\n\t\t\t})\n\t</JavaScript>\n</App>\n"
  },
  {
    "path": "projects/SystemTest1/SystemTest1.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}\n\n"
  },
  {
    "path": "projects/TextInput/MainView.ux",
    "content": "<App Background=\"#FFF\">\n    <Panel>\n        <Button Alignment=\"CenterRight\" Text=\"Clear\" Margin=\"5\">\n            <Clicked>\n                <Set text.Value=\"\" />\n            </Clicked>\n        </Button>\n        <TextInput ux:Name=\"text\" PlaceholderText=\"Text field\" PlaceholderColor=\"#ccc\" Height=\"50\" Padding=\"5\" >\n            <Rectangle Layer=\"Background\">\n                <Stroke Width=\"2\" Brush=\"#BBB\" />\n            </Rectangle>\n        </TextInput>\n    </Panel>\n</App>\n"
  },
  {
    "path": "projects/TextInput/app.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}"
  },
  {
    "path": "projects/models-manual-test/App.js",
    "content": "export default class App\n{\n    constructor() {\n        this.foo = \"Hello\";\n        this.color = \"#337799\";\n    }\n\n    change() {\n        this.foo = \"Goodbye\";\n        this.color = [1,0,0];\n    }\n}"
  },
  {
    "path": "projects/models-manual-test/MainView.ux",
    "content": "<App Model=\"App\">\n    <Grid Rows=\"1*,auto\">\n        <Text Alignment=\"Center\" Value=\"{foo}\" />\n\n        <Panel Height=\"200\" Color=\"{color}\" Clicked=\"{change}\">\n            <Text Color=\"#fff\" Alignment=\"Center\">Change</Text>\n        </Panel>\n    </Grid>\n</App>\n"
  },
  {
    "path": "projects/models-manual-test/models-manual-test.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\",\n    \"*.js:FuseJS\"\n  ]\n}\n\n"
  },
  {
    "path": "scripts/build.sh",
    "content": "#!/bin/bash\nSELF=`echo $0 | sed 's/\\\\\\\\/\\\\//g'`\ncd \"`dirname \"$SELF\"`/..\" || exit 1\nsource \"scripts/common.sh\"\n\nwhile [ $# -gt 0 ]; do\n    case \"$1\" in\n    -f|--fast)\n        shift\n        FAST=1\n        ;;\n    -i|--install)\n        shift\n        INSTALL=1\n        ;;\n    -r|--release)\n        shift\n        CONFIGURATION=\"Release\"\n        ;;\n    *)\n        break\n        ;;\n    esac\ndone\n\nif [ -z \"$CONFIGURATION\" ]; then\n    CONFIGURATION=\"Debug\"\nfi\n\nif [ \"$FAST\" = 1 ]; then\n    h1 \"Building fuse X (fast mode)\"\n\n    if [ \"$OSTYPE\" = msys ]; then\n        csharp-build fuse-win-dev.sln\n    else\n        csharp-build fuse-mac-dev.sln\n    fi\n\n    exit 0\nfi\n\nif [ ! -d node_modules/ ]; then\n    INSTALL=1\nelif [ ! -d packages/ ]; then\n    INSTALL=1\nfi\n\nif [ \"$INSTALL\" = 1 ]; then\n    h1 \"Installing dependencies\"\n    npm install\n\n    if [ \"$OSTYPE\" = msys ]; then\n        nuget restore fuse-win.sln -Verbosity quiet\n    else\n        nuget restore fuse-mac.sln -Verbosity quiet\n    fi\nfi\n\nh1 \"Building libs\"\n\nuno doctor --configuration=$CONFIGURATION \\\n    src/simulator src/preview\n\nh1 \"Building fuse X\"\n\nif [ \"$OSTYPE\" = msys ]; then\n    csharp-build fuse-win.sln\n    exit 0\nfi\n\n# Remove old app bundles when debugging in VS Mac\nif [ \"$VSMAC\" = 1 ]; then\n    rm -rf bin/$CONFIGURATION/*.app\nfi\n\ncsharp-build fuse-mac.sln\n\nfunction cp2 {\n    cp \"$@\" || exit $?\n}\n\nfunction assemble-app {\n    local app=bin/$CONFIGURATION/$1.app\n    local contents=$app/Contents\n    local exe=$contents/MacOS/$1\n    local monobundle=$contents/MonoBundle\n    local resources=$contents/Resources\n\n    mkdir -p \"`dirname \"$exe\"`\" \"$monobundle\" \"$resources\"\n    cp2 src/mac/monostub/fonts.conf \"`dirname \"$exe\"`\"\n    cp2 \"$2\"/Info.plist \"$contents\"\n    cp2 \"$2\"/Resources/*.icns \"$resources\"\n\n    # Skip the following steps when debugging in VS Mac\n    if [ \"$VSMAC\" = 1 ]; then\n        return\n    fi\n\n    # Replace executable\n    cp2 src/mac/monostub/monostub \"$exe\"\n\n    # Copy assemblies (since MMP is disabled in Xamarin.Mac.Common.targets)\n    cp2 bin/$CONFIGURATION/*.{dll,exe} \"$monobundle\"\n\n    # Remove system-installed Mono libraries from app bundle (#121)\n    IFS=$'\\n'\n    for dll in `ls -1 /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.6-api`; do\n        if [ \"$dll\" = ICSharpCode.SharpZipLib.dll ]; then\n            continue\n        elif [ \"$dll\" = Mono.Options.dll ]; then\n            continue\n        elif [ \"$dll\" = Mono.Posix.dll ]; then\n            continue\n        elif [ \"$dll\" = System.Reactive.Windows.Threading.dll ]; then\n            continue\n        fi\n        rm -rfv \"$monobundle/$dll\"\n    done\n    for dylib in `ls -1 /Library/Frameworks/Mono.framework/Versions/Current/lib`; do\n        rm -rfv \"$monobundle/$dylib\"\n    done\n\n    # Copy WPF and Xamarin.Mac\n    cp2 node_modules/@fuse-open/xamarin-mac/*.{dll,dylib} \"$monobundle\"\n    cp2 src/mac/wpf/*.dll \"$monobundle\"\n}\n\nfunction create-exe {\n    local dst=bin/$CONFIGURATION/$1\n    cp2 src/mac/monostub/fonts.conf \"`dirname \"$dst\"`\"\n    cp2 src/mac/monostub/monostub-console \"$dst\"\n}\n\n# Build monostub\npushd src/mac/monostub > /dev/null\nmake -s\npopd > /dev/null\n\n# Assemble app bundles\nassemble-app \"fuse X\" src/mac/studio\nassemble-app \"fuse X (menu bar)\" src/mac/menu-bar\nassemble-app UnoHost src/unohost/mac\n\n# Create native executables\ncreate-exe fuse\ncreate-exe fuse-lang\ncreate-exe \"fuse X.app/Contents/MonoBundle/fuse-preview\"\n\n# Copy UnoHost assemblies to main app (loaded using reflection)\ncp bin/$CONFIGURATION/UnoHost.app/Contents/MonoBundle/*.{dll,exe} \\\n    \"bin/$CONFIGURATION/fuse X.app/Contents/MonoBundle\"\n\n# Copy WPF assemblies (https://github.com/fuse-x/studio/issues/4)\ncp src/mac/wpf/*.dll bin/$CONFIGURATION\n"
  },
  {
    "path": "scripts/check-dependencies.js",
    "content": "const fs = require(\"fs\");\nconst path = require(\"path\");\n\nconst json = fs.readFileSync(path.join(__dirname, \"..\", \"package.json\"));\nconst package = JSON.parse(json);\n\n// https://stackoverflow.com/questions/175739/built-in-way-in-javascript-to-check-if-a-string-is-a-valid-number\nfunction isAllowed(version) {\n    return version.startsWith(\"~\") && version.indexOf(\"-\") === -1 ||\n            !isNaN(version[0]) ||\n            version.startsWith(\"https://\");\n}\n\nlet failed = 0;\n\nfor (let name in package.dependencies) {\n    if (!isAllowed(package.dependencies[name])) {\n        console.error(`package.json: The version number of ${name} must start with ` + (\n            package.dependencies[name].indexOf(\"-\") === -1\n                ? \"~ or a number\"\n                : \"a number (because it is a prerelease)\"\n        ));\n        failed++;\n    }\n}\n\nif (failed) {\n    console.log(\"\\nWe want to upgrade only patch versions of Uno, Fuselibs and other dependencies.\");\n    console.log(\"Minor version upgrades require a new fuse X release to be made.\");\n}\n\nprocess.exit(failed);\n"
  },
  {
    "path": "scripts/common.sh",
    "content": "#!/bin/bash\nset -e\n\nfunction find-msbuild {\n    powershell -ExecutionPolicy ByPass -File scripts/find-msbuild.ps1\n}\n\nfunction csharp-build {\n    if [ -z \"$CONFIGURATION\" ]; then\n        CONFIGURATION=\"Debug\"\n    fi\n\n    if [ \"$OSTYPE\" = msys ]; then\n        msbuild=`find-msbuild`\n        if [ $? != 0 ]; then\n            exit $?\n        fi\n        \"$msbuild\" //m //p:Configuration=$CONFIGURATION //v:minimal \"$@\"\n    else\n        msbuild /m /property:Configuration=$CONFIGURATION /verbosity:minimal \"$@\"\n    fi\n}\n\nfunction csharp-clean {\n    if [ \"$OSTYPE\" = msys ]; then\n        msbuild=`find-msbuild`\n        if [ $? != 0 ]; then\n            exit $?\n        fi\n        \"$msbuild\" //m //t:Clean //p:Configuration=Debug \"$@\"\n        \"$msbuild\" //m //t:Clean //p:Configuration=Release \"$@\"\n    else\n        msbuild /m /target:Clean /property:Configuration=Debug \"$@\"\n        msbuild /m /target:Clean /property:Configuration=Release \"$@\"\n    fi\n}\n\nfunction dotnet-run {\n    node_modules/.bin/dotnet-run \"$@\"\n}\n\nfunction uno {\n    node_modules/.bin/uno \"$@\"\n}\n\nfunction h1 {\n    str=\"$@\"\n    printf \"\\n\\e[92m$str\\n\"\n    for ((i=1; i<=${#str}; i++)); do \n        echo -n -\n    done\n    printf \"\\e[39m\\n\"\n}\n\nfunction p {\n    str=\"$@\"\n    printf \"\\e[90m$str\\e[39m\\n\"\n    cmd=$1\n    shift\n    $cmd \"$@\"\n}\n"
  },
  {
    "path": "scripts/daemon.sh",
    "content": "#!/bin/bash\n#\n# Launch the daemon based on a copy of fuse X assemblies (Windows).\n#\n# This avoids write-locking the assemblies and thus allowing us to work on\n# fuse X while the daemon is running.\n#\nset -e\nSRC=\"bin/Debug\"\nDST=\"$SRC-copy\"\n\n# Kill running daemons first, if any.\nbash scripts/kill.sh\n\nif [ \"$OSTYPE\" = msys ]; then\n    mkdir -p \"$DST\"\n    cp -fu \"$SRC\"/*.{dll,exe} \"$DST\"\n    $DST/fuse daemon \"$@\"\nelse\n    # No need to copy on other platforms.\n    node $SRC/fuse.js daemon \"$@\"\nfi\n"
  },
  {
    "path": "scripts/find-msbuild.ps1",
    "content": "$env:Path += \";${env:ProgramFiles}\\Microsoft Visual Studio\\Installer\"\n$env:Path += \";${env:ProgramFiles(x86)}\\Microsoft Visual Studio\\Installer\"\n\nIf (Get-Command \"vswhere.exe\" -ErrorAction SilentlyContinue)\n{\n    vswhere.exe | Out-String -Stream | Select-String -SimpleMatch \"installationPath:\" | ForEach {\n        $installationPath = $_ -Replace \"^installationPath: \", \"\"\n        $msbuild = \"$installationPath\\MSBuild\\Current\\bin\\msbuild.exe\"\n        If (Test-Path $msbuild)\n        {\n            Write-Output $msbuild\n            exit 0\n        }\n        $msbuild = \"$installationPath\\MSBuild\\15.0\\bin\\msbuild.exe\"\n        If (Test-Path $msbuild)\n        {\n            Write-Output $msbuild\n            exit 0\n        }\n    }\n}\n\n$msbuild1=\"${env:ProgramFiles}\\MSBuild\\14.0\\bin\\MSBuild.exe\"\n$msbuild2=\"${env:ProgramFiles(x86)}\\MSBuild\\14.0\\bin\\MSBuild.exe\"\nIf (Test-Path $msbuild1)\n{\n    Write-Output $msbuild1\n    exit 0\n}\nElseIf (Test-Path $msbuild2)\n{\n    Write-Output $msbuild2\n    exit 0\n}\n\nWrite-Error -Message @\"\nERROR: Microsoft Build Tools 2015+ not installed (C# 6/.NET 4.5 support)\n(not found) vswhere / Visual Studio 2019\n(not found) vswhere / Visual Studio 2017\n(not found) $msbuild1\"\n(not found) $msbuild2\"\n\"@\nexit 1\n"
  },
  {
    "path": "scripts/get-version.sh",
    "content": "cat package.json | \\\n    grep version | \\\n    head -1 | \\\n    awk -F: '{ print $2 }' | \\\n    sed 's/[\\\",]//g' | \\\n    tr -d '[[:space:]]'"
  },
  {
    "path": "scripts/kill.sh",
    "content": "if [ \"$OSTYPE\" = msys ]; then\n    taskkill //f //t //im unohost.exe || :\n    taskkill //f //t //im fuse-tray.exe || :\n    taskkill //f //t //im fuse-lang.exe || :\n    taskkill //f //t //im fuse-studio.exe || :\n    taskkill //f //t //im fuse-preview.exe || :\n    taskkill //f //t //im fuse.exe || :\nelse\n    killall UnoHost || :\n    killall \"fuse X (menu bar)\" || :\n    killall fuse-lang || :\n    killall \"fuse X\" || :\n    killall fuse-preview || :\n    killall fuse || :\nfi\n"
  },
  {
    "path": "scripts/postpack.sh",
    "content": "# Restore package.json.\nmv -f package.json-original package.json\n\n# Restore binaries.\nnode scripts/restore.js\n"
  },
  {
    "path": "scripts/prepack.sh",
    "content": "#!/bin/bash\nSELF=`echo $0 | sed 's/\\\\\\\\/\\\\//g'`\ncd \"`dirname \"$SELF\"`/..\" || exit 1\nsource \"scripts/common.sh\"\nshopt -s dotglob\n\nVERSION=`bash scripts/get-version.sh`\nCOMMIT=`git rev-parse HEAD`\nBIN=\"bin/Release\"\n\necho \"Version: $VERSION\"\necho \"Commit: $COMMIT\"\n\n# Validate package.json file.\nnode scripts/check-dependencies.js\n\n# Extract the X.Y.Z part of version, removing the suffix if any.\nVERSION_TRIPLET=`echo $VERSION | sed -n -e 's/\\([^-]*\\).*/\\1/p'`\n\n# We don't have a build-number.\nBUILD_NUMBER=0\n\n# Create GlobalAssemblyInfo.Override.cs.\nsed -e 's/\\(AssemblyVersion(\"\\)[^\"]*\\(\")\\)/\\1'$VERSION_TRIPLET.$BUILD_NUMBER'\\2/' \\\n    -e 's/\\(AssemblyFileVersion(\"\\)[^\"]*\\(\")\\)/\\1'$VERSION_TRIPLET.$BUILD_NUMBER'\\2/' \\\n    -e 's/\\(AssemblyInformationalVersion(\"\\)[^\"]*\\(\")\\)/\\1'$VERSION'\\2/' \\\n    -e 's/\\(AssemblyConfiguration(\"\\)[^\"]*\\(\")\\)/\\1'$COMMIT'\\2/' \\\n    src/GlobalAssemblyInfo.cs > src/GlobalAssemblyInfo.Override.cs\n\n# Sets default version number for Uno-libraries.\nexport npm_package_version=$VERSION\n\n# Build assemblies.\nif [ \"$BUILD\" = 0 ]; then\n    echo \"Skipping build because BUILD was set to 0.\"\nelse\n    rm -rf \"$BIN\" > /dev/null\n    bash scripts/build.sh --release --install\nfi\n\n# Remove GlobalAssemblyInfo.Override.cs.\nrm -f src/GlobalAssemblyInfo.Override.cs\n\nfunction find-all {\n    local root=\"$1\"\n    shift\n    while [ $# -gt 0 ]; do\n        bash -lc \"find \\\"$root\\\" -name \\\"$1\\\"\"\n        shift\n    done\n}\n\nfunction rm-all {\n    IFS=$'\\n'\n    for i in `find-all \"$@\"`; do\n        rm -rf \"$i\"\n    done\n}\n\nfunction rm-empty {\n    bash -lc \"find \\\"$1\\\" -type d -empty -delete\"\n}\n\nfunction filecompare {\n    node_modules/.bin/filecompare \"$i\" \"$file\" | grep true > /dev/null\n}\n\nfunction rm-identical {\n    local root=$1\n    shift\n    IFS=$'\\n'\n    for i in `find-all \"$@\"`; do\n        local file=\"$root/`basename $i`\"\n        [ -f \"$file\" ] || continue\n        filecompare \"$i\" \"$file\" || continue\n        echo \"stripping $file\"\n        rm -rf \"$file\"\n        # Add placeholder for restore.js\n        touch \"$file.restore\"\n    done\n}\n\nfunction rm-identical2 {\n    if [ \"$OSTYPE\" = msys ]; then\n        rm-identical \"$BIN\" \"$@\"\n    else\n        rm-identical \"$BIN\" \"$@\"\n        rm-identical \"$BIN/fuse X.app/Contents/MonoBundle\" \"$@\"\n        rm-identical \"$BIN/fuse X (menu bar).app/Contents/MonoBundle\" \"$@\"\n        rm-identical \"$BIN\"/UnoHost.app/Contents/MonoBundle \"$@\"\n    fi\n}\n\nfunction rm-identical3 {\n    if [ \"$OSTYPE\" = msys ]; then\n        return\n    fi\n\n    for dst in \\\n        \"$BIN\" \\\n        \"$BIN/fuse X (menu bar).app/Contents/MonoBundle\" \\\n        \"$BIN\"/UnoHost.app/Contents/MonoBundle\n    do\n        rm-identical \"$dst\" \"$BIN/fuse X.app/Contents/MonoBundle\" \"$@\"\n    done\n}\n\nfunction rm-identical4 {\n    if [ \"$OSTYPE\" = msys ]; then\n        return\n    fi\n\n    for dst in \\\n        \"$BIN/fuse X (menu bar).app/Contents/Resources\" \\\n        \"$BIN/fuse X (uri-handler).app/Contents/Resources\"\n    do\n        rm-identical \"$dst\" \"$BIN/fuse X.app/Contents/Resources\" \"$@\"\n    done\n}\n\nh1 \"Optimizing package\"\n\n# The following binaries will be added back by restore.js.\nif [ \"$OSTYPE\" = msys ]; then\n    rm-identical2 node_modules/@fuse-open/opentk *.dll\n    rm-identical2 node_modules/@fuse-open/xamarin-mac *.dll\n    rm-all \"$BIN\" *.dylib\nelse\n    rm-identical2 node_modules/@fuse-open/xamarin-mac *.dll *.dylib\nfi\n\nrm-identical2 node_modules/@fuse-open/uno/bin *.dll *.dylib *.exe\nrm-identical3 *.dll *.dylib *.exe\nrm-identical4 *.icns\n\n# Drop superfluous build artifacts.\nrm-all \"$BIN\" FSharp.Core.resources.dll\nrm-all \"$BIN\" *.config *.pdb *.xml\nrm-all \"$BIN\" *.mdb *.pkg\nrm-empty \"$BIN\"\n\n# Error handling.\nfunction error {\n    echo \"prepack failed.\"\n    mv -f package.json-original package.json\n    exit 1\n}\n\ntrap 'error' ERR\n\n# Update package.json file.\nfunction set-platform {\n    cp -f package.json package.json-original || exit 1\n    node scripts/update-json.js package.json \"$1\" || error\n}\n\ncase $OSTYPE in\ndarwin*)\n    set-platform mac\n\n    # Update version info.\n    IFS=$'\\n'\n    for plist in `find-all \"$BIN\" *.plist`; do\n        echo \"updating version info in $plist\"\n        node_modules/.bin/replace \"VERSION_NUMBER\" \"$VERSION\" \"$plist\" > /dev/null\n    done\n    ;;\n\nmsys*)\n    set-platform win\n\n    if [ -z \"$FUSE_CERTIFICATE_NAME\" ]; then\n        >&2 echo \"WARNING: Executables were not signed (FUSE_CERTIFICATE_NAME not set)\"\n    else\n        set --\n        IFS=$'\\n'\n        for exe in `find-all \"$BIN\" *.exe`; do\n            set -- \"$@\" \"$exe\"\n        done\n        \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\bin\\\\x64\\\\signtool.exe\" \\\n            sign //a //n \"$FUSE_CERTIFICATE_NAME\" \\\n            //t http://timestamp.comodoca.com/authenticode \\\n            //v \"$@\"\n    fi\n    ;;\nesac\n"
  },
  {
    "path": "scripts/restore.js",
    "content": "const fs = require(\"fs\");\nconst path = require(\"path\");\n\nfunction findup(suffix) {\n    for (let dir = __dirname, parent = undefined;;\n             dir = path.dirname(dir)) {\n\n        if (dir == parent)\n            throw Error(`${suffix} was not found`);\n\n        parent = dir;\n        const file = path.join(dir, suffix);\n\n        if (fs.existsSync(file))\n            return file;\n    }\n}\n\nfunction findNodeModule(name) {\n    const package = findup(`node_modules/${name}/package.json`);\n    return path.dirname(package);\n}\n\nfunction restoreFiles(src, dsts) {\n    for (file of fs.readdirSync(src)) {\n        const srcf = path.join(src, file);\n\n        for (dst2 of dsts) {\n            const dstf = path.join(dst2, file);\n            const placeholder = dstf + \".restore\";\n\n            if (!fs.existsSync(placeholder))\n                continue;\n\n            const relative = path.relative(process.cwd(), dstf);\n            console.log(`restoring ${relative}`);\n            fs.copyFileSync(srcf, dstf);\n            fs.unlinkSync(placeholder);\n        }\n    }\n}\n\nconst dst = path.join(__dirname, \"..\", \"bin\", \"Release\");\nconst dsts = [\n    path.join(dst, \"fuse X.app\", \"Contents\", \"MonoBundle\"),\n    path.join(dst, \"fuse X (menu bar).app\", \"Contents\", \"MonoBundle\"),\n    path.join(dst, \"UnoHost.app\", \"Contents\", \"MonoBundle\"),\n    dst\n];\n\n// Restore OpenTK (Windows only).\nif (path.sep == \"\\\\\") {\n    const opentk = findNodeModule(\"@fuse-open/opentk\");\n    restoreFiles(opentk, dsts);\n}\n\n// Restore Xamarin.Mac.\nconst xamarin = findNodeModule(\"@fuse-open/xamarin-mac\");\nrestoreFiles(xamarin, dsts);\n\n// Restore Uno binaries.\nconst uno = findNodeModule(\"@fuse-open/uno\");\nrestoreFiles(path.join(uno, \"bin\"), dsts);\n\nif (path.sep != \"\\\\\") {\n    restoreFiles(path.join(dst, \"fuse X.app\", \"Contents\", \"MonoBundle\"), dsts);\n\n    // Restore macOS icons.\n    restoreFiles(path.join(dst, \"fuse X.app\", \"Contents\", \"Resources\"), [\n        path.join(dst, \"fuse X (menu bar).app\", \"Contents\", \"Resources\")\n    ]);\n}\n\nfunction patchConfig(file) {\n    const config = fs.readFileSync(file).toString();\n    if (config.indexOf(\"IsRoot: false\") > 0)\n        return;\n\n    // Load parent config (fuse X).\n    const relative = path.relative(process.cwd(), file);\n    console.log(`patching ${relative}`);\n    fs.appendFileSync(file, \"\\n// Load parent config\");\n    fs.appendFileSync(file, \"\\nIsRoot: false\\n\");\n}\n\n// Patch Uno config.\npatchConfig(path.join(uno, \".unoconfig\"));\n\nfunction restoreGitignore(dir) {\n    try {\n        // Check .vscode subdirectory.\n        const vscode = path.join(dir, \".vscode\");\n        if (fs.existsSync(vscode))\n            restoreGitignore(vscode);\n\n        // Restore .gitignore-files (renamed by 'npm pack').\n        const gitignore = path.join(dir, \".gitignore\");\n        const npmignore = path.join(dir, \".npmignore\");\n\n        if (!fs.existsSync(gitignore) && \n                fs.existsSync(npmignore)) {\n            console.log(`restoring ${gitignore}`);\n            fs.renameSync(npmignore, gitignore);\n        }\n    } catch (e) {\n        console.error(e);\n    }\n}\n\n// FIXME: Programmatically enumerate all directories\n//        under templates/projects/.\nrestoreGitignore(\"templates/projects/app\");\nrestoreGitignore(\"templates/projects/example\");\n"
  },
  {
    "path": "scripts/system-test.sh",
    "content": "#!/bin/bash\nROOT=$(pwd)\"/\"$(dirname \"$0\")\"/..\"\n\nRUNNER=\"$ROOT/src/Fuse/SystemTest/bin/Debug/SystemTest.exe\"\nif [ \"$OS\" == \"Windows_NT\" ]; then\n    MONO=\"\"\n    FUSE=\"$ROOT/bin/Debug/fuse.exe\"\nelse\n    MONO=\"mono\"\n    FUSE=\"$ROOT/bin/Debug/fuse X.app/Contents/MacOS/fuse X\"\nfi\n\nfor arg in \"$@\"; do\n    case $arg in\n    --fuse=*)\n        FUSE=\"${arg#*=}\"\n        shift\n    ;;\n    --runner=*)\n        RUNNER=\"${arg#*=}\"\n        shift\n    ;;\n    --help|=h)\n        echo \"USAGE: $0 [--fuse=<fuse.exe>] [--runner=<SystemTest.exe>] [params]\"\n        echo\n        echo \"If no options are given, it uses\"\n        echo \"  --fuse=$FUSE\"\n        echo \"  --runner=$RUNNER\"\n        echo\n        echo \"[params] are passed to the runner. Example:\"\n        echo \"  --skip=auto-test-app\"\n        exit 0\n    ;;\nesac\n\ndone\n\n\n$MONO $RUNNER --fuse=\"$FUSE\" $@\n"
  },
  {
    "path": "scripts/test.sh",
    "content": "#!/bin/sh\nset -e\ncd \"`dirname \"$0\"`/..\"\n\nif [ -z \"$CONFIGURATION\" ]; then\n    CONFIGURATION=\"Debug\"\nfi\n\nhelp()\n{\n    echo \"This script executes Fuse tests locally. It doesn't automatically build Fuse, so remember to run 'build.sh' first!\"    \n    echo \"By default it runs all the tests, however a filter can be specified by providing '--where'. See https://github.com/nunit/docs/wiki/Test-Selection-Language for this syntax.\"\n    echo \n    echo \"All arguments are forwarded to NUnit3 Console, so see https://github.com/nunit/docs/wiki/Console-Command-Line for more help.\"\n    exit\n}\n\nif [ \"$1\" = \"-h\" ] || [ \"$1\" = \"--help\" ]; then\n    help\nfi\n\nNUNIT_VERSION=3.6.0\n\n# Install NUnit.Console\nnuget install NUnit.Console -version $NUNIT_VERSION -o packages\n\n# The tests may create temporary files that we don't want git to find\nscript_path=`pwd`\nmkdir -p bin/tests\npushd bin/tests > /dev/null\n\n# Run tests\ndotnet-run \"$script_path/packages/NUnit.ConsoleRunner.$NUNIT_VERSION/tools/nunit3-console.exe\" --noresult --timeout=60000 --skipnontestassemblies --process=separate $@ \\\n    \"$script_path/src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/bin/$CONFIGURATION/Outracks.CodeCompletion.CodeNinja.Tests.dll\" \\\n    \"$script_path/src/ninja/Outracks.CodeCompletion.UXNinja.Tests/bin/$CONFIGURATION/Outracks.CodeCompletion.UXNinja.Tests.dll\" \\\n    \"$script_path/src/common/Tests/bin/$CONFIGURATION/Outracks.Tests.dll\" \\\n    \"$script_path/src/fuse/Tests/bin/$CONFIGURATION/Outracks.Fuse.Protocol.Tests.dll\" \\\n    \"$script_path/src/fusion/IntegrationTests/bin/$CONFIGURATION/fusion-integrations.exe\" \\\n    \"$script_path/src/fusion/Tests/bin/$CONFIGURATION/Outracks.Fusion.Tests.dll\" \\\n    \"$script_path/src/preview/Tests/bin/$CONFIGURATION/Fuse.Preview.Tests.dll\" \\\n    \"$script_path/src/simulator/Tests/bin/$CONFIGURATION/Outracks.Simulator.Tests.dll\" \\\n    \"$script_path/src/unohost/Tests/bin/$CONFIGURATION/Outracks.UnoHost.Tests.dll\"\n\npopd > /dev/null\n"
  },
  {
    "path": "scripts/texts-cs.js",
    "content": "const fs = require(\"fs\")\nconst XmlReader = require(\"xml-reader\")\n\nconst xml = fs.readFileSync(\"src/fuse/locale/Strings.resx\").toString().replace(/<!--[\\s\\S]*?-->/g, \"\")\nconst reader = XmlReader.create()\n\nreader.on('done', data => {\n\n    const members = []\n    const statements = []\n\n    for (const child of data.children) {\n        if (child.name === \"data\") {\n            const name = child.attributes.name\n            const value = child.children[0]?.children[0]?.value\n\n            members.push(`        /** ${value} */`)\n            members.push(`        public static Text ${name} => _${name}.AsText();`)\n            members.push(`        static readonly BehaviorSubject<string> _${name} = new BehaviorSubject<string>(Strings.${name});`)\n            members.push(``)\n            statements.push(`            _${name}.OnNext(Strings.${name});`)\n        }\n    }\n\n    fs.writeFileSync(\"src/fuse/studio/Texts.cs\", `// Generated by texts-cs.js (DO NOT EDIT)\n\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fuse\n{\n    public static class Texts\n    {\n${members.join(\"\\n\")}\n\n        public static void Update()\n        {\n${statements.join(\"\\n\")}\n        }\n    }\n}\n`)\n})\n\nreader.parse(xml)\n"
  },
  {
    "path": "scripts/update-json.js",
    "content": "const fs = require(\"fs\");\nconst path = require(\"path\");\n\nconst filename = process.argv[2]\nconst platform = process.argv[3]\n\nif (!filename || !platform)\n    throw new Error(\"Please provide filename and platform arguments.\")\n\nconsole.log(\"updating \" + filename + \" (\" + platform + \")\")\n\nconst text = fs.readFileSync(filename, \"utf8\");\nconst json = JSON.parse(text);\n\njson.name = json.name + \"-\" + platform\njson.bin = json[\"bin-\" + platform]\njson.os = json[\"os-\" + platform]\njson.scripts = json[\"scripts-\" + platform]\n\ndelete json[\"bin-mac\"]\ndelete json[\"bin-win\"]\ndelete json[\"os-mac\"]\ndelete json[\"os-win\"]\ndelete json[\"scripts-mac\"]\ndelete json[\"scripts-win\"]\ndelete json.devDependencies\n\nfs.writeFileSync(filename, JSON.stringify(json, undefined, 2));\n"
  },
  {
    "path": "scripts/ux-fuzzer.py",
    "content": "#!/usr/bin/env python3\nimport sys\nimport random\nimport os\nimport time\n\nhelp_text = \"\"\"USAGE: __CMD__  <filename>\n\nWrites a random app to <filename> every five seconds.\nCan use ux:Classes or normal elements, by selecting which line to comment out\nin the while loop at the end of the script.\n\nIf you want to watch that file, do `brew install fswatch` and then watch it:\n\nfswatch <filename> | xargs -n1 cat\n\"\"\"\n\ndef help():\n    print(help_text.replace(\"__CMD__\", sys.argv[0]))\n\nif len(sys.argv) < 2:\n    help()\n    exit(1)\n\nif sys.argv[1] == \"-h\":\n    help()\n    exit(0)\n\nuxfilename=sys.argv[1]\n\ndef write_start(uxfile):\n    uxfile.truncate()\n    uxfile.write(\"<App>\\n\")\n    uxfile.write(\"  <ClientPanel>\\n\")\n    uxfile.write(\"    <StackPanel>\\n\")\n\ndef write_end(uxfile):\n    uxfile.write(\"    </StackPanel>\\n\")\n    uxfile.write(\"  </ClientPanel>\\n\")\n    uxfile.write(\"</App>\\n\")\n\ndef write_ux_classes(uxfile):\n    classes = []\n    for i in range(1, random.randint(1,20)):\n        classes.append(\"class\" + str(random.randint(1,10000)))\n    for c in classes:\n        uxfile.write(\"      <Text Value=\\\"\" + c + \"\\\" ux:Class=\\\"\" + c + \"\\\"/>\\n\")\n    for c in classes:\n        uxfile.write(\"      <\" + c + \"/>\\n\")\n\ndef write_simple_elements(uxfile):\n    for i in range(1, random.randint(1,20)):\n        uxfile.write(\"      <Text Value=\\\"element \" + str(random.randint(1,10000)) + \"\\\" />\\n\")\n\nwhile(True):\n    print(\"Writing\")\n    with open(uxfilename, \"w\") as uxfile:\n        write_start(uxfile)\n        # write_ux_classes(uxfile)\n        write_simple_elements(uxfile)\n        write_end(uxfile)\n    time.sleep(5)\n\n"
  },
  {
    "path": "scripts/version.sh",
    "content": "#!/bin/bash\nSELF=`echo $0 | sed 's/\\\\\\\\/\\\\//g'`\ncd \"`dirname \"$SELF\"`/..\" || exit 1\nset -e\n\n# Most of the following code was copied from pack.sh.\n#####################################################\n\n# Detect version info\nVERSION=`bash scripts/get-version.sh`-dev\nBUILD_NUMBER=\"0\"\n\n# Extract the X.Y.Z part of version, removing the suffix if any\nVERSION_TRIPLET=`echo $VERSION | sed -n -e 's/\\([^-]*\\).*/\\1/p'`\n\n# Create GlobalAssemblyInfo.Override.cs\nsed -e 's/\\(AssemblyVersion(\"\\)[^\"]*\\(\")\\)/\\1'$VERSION_TRIPLET.$BUILD_NUMBER'\\2/' \\\n    -e 's/\\(AssemblyFileVersion(\"\\)[^\"]*\\(\")\\)/\\1'$VERSION_TRIPLET.$BUILD_NUMBER'\\2/' \\\n    -e 's/\\(AssemblyInformationalVersion(\"\\)[^\"]*\\(\")\\)/\\1'$VERSION'\\2/' \\\n    src/GlobalAssemblyInfo.cs > src/GlobalAssemblyInfo.Override.cs\n\necho \"Updating GlobalAssemblyInfo to version $VERSION\"\ncat src/GlobalAssemblyInfo.Override.cs > src/GlobalAssemblyInfo.cs\nrm src/GlobalAssemblyInfo.Override.cs\n\n# Stage for commit.\ngit add src/GlobalAssemblyInfo.cs\n"
  },
  {
    "path": "setup/build.sh",
    "content": "#!/bin/bash\nSELF=`echo $0 | sed 's/\\\\\\\\/\\\\//g'`\ncd \"`dirname \"$SELF\"`/..\" || exit 1\nset -e\n\nexport VERSION=`bash scripts/get-version.sh`\n\n# Build NPM package\nif [ \"$PACK\" = 0 ]; then\n    echo \"Skipping 'npm pack' because PACK was set to 0.\"\nelse\n    bash scripts/prepack.sh\n    npm pack --silent\n    bash scripts/postpack.sh\n    echo \"\"\nfi\n\n# Build installer\ncase $OSTYPE in\ndarwin*)\n    rm -rf setup/pkg/root/tmp/*\n    mkdir -p setup/pkg/root/tmp\n\n    pushd setup/platypus > /dev/null\n    platypus -P \"fuse X.platypus\" \\\n        --app-version \"$VERSION\" \\\n        \"../pkg/root/tmp/fuse X.app\"\n    popd > /dev/null\n\n    if [ -z \"$FUSE_DEVELOPER_ID\" ]; then\n        >&2 echo \"WARNING: App was not signed (FUSE_DEVELOPER_ID not set)\"\n    else\n        codesign --force --deep --entitlements \"setup/entitlements.plist\" --options runtime \\\n            --timestamp --sign \"Developer ID Application: $FUSE_DEVELOPER_ID\" \\\n            \"setup/pkg/root/tmp/fuse X.app\"\n    fi\n\n    bash setup/codesign-tgz.sh fuse-x-studio-mac-$VERSION.tgz \\\n        setup/pkg/root/tmp/fuse-x-studio-mac.tar\n    bash setup/pkg/build.sh\n\n    UNSIGNED=\"setup/pkg/fuse-unsigned.pkg\"\n    INSTALLER=\"fuse-x-$VERSION-mac.pkg\"\n\n    if [ -z \"$FUSE_DEVELOPER_ID\" ]; then\n        >&2 echo \"WARNING: Installer was not signed (FUSE_DEVELOPER_ID not set)\"\n        mv $UNSIGNED $INSTALLER\n    else\n        productsign --sign \"Developer ID Installer: $FUSE_DEVELOPER_ID\" \\\n            $UNSIGNED $INSTALLER\n        echo -e \"\\nNOTICE: Remember to notarize & staple the installer before publishing!\"\n    fi\n\n    echo -e \"\\nBuilding DMG...\"\n    cp -f $INSTALLER \"setup/dmg/Install fuse X.pkg\"\n    bash setup/dmg/build.sh\n\n    UNSIGNED=\"setup/dmg/fuse-unsigned.dmg\"\n    INSTALLER=\"fuse-x-$VERSION-mac.dmg\"\n\n    if [ -z \"$FUSE_DEVELOPER_ID\" ]; then\n        >&2 echo \"WARNING: DMG was not signed (FUSE_DEVELOPER_ID not set)\"\n        mv \"$UNSIGNED\" \"$INSTALLER\"\n    else\n        mv \"$UNSIGNED\" \"$INSTALLER\"\n        codesign --sign \"Developer ID Application: $FUSE_DEVELOPER_ID\" \\\n            \"$INSTALLER\"\n        codesign \"$INSTALLER\" --display --verbose=2\n        echo -e \"\\nNOTICE: Remember to notarize & staple the DMG before publishing!\"\n    fi\n    ;;\n\nmsys*)\n    cp fuse-x-studio-win-$VERSION.tgz setup/nsis\n    setup/nsis/tools/makensis //DVERSION=$VERSION setup/nsis/fuse-setup.nsi\n    INSTALLER=\"fuse-x-$VERSION-win.exe\"\n    mv setup/nsis/$INSTALLER $INSTALLER\n\n    if [ -z \"$FUSE_CERTIFICATE_NAME\" ]; then\n        >&2 echo \"WARNING: Installer was not signed (FUSE_CERTIFICATE_NAME not set)\"\n    else\n        \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\bin\\\\x64\\\\signtool.exe\" \\\n            sign //a //n \"$FUSE_CERTIFICATE_NAME\" \\\n            //t http://timestamp.comodoca.com/authenticode \\\n            //v $INSTALLER\n    fi\n    ;;\nesac\n\n# Done\necho \"\"\necho \"Your installer:\"\necho \"$INSTALLER\"\necho \"`du -k \"$INSTALLER\" | cut -f1` KB\"\n"
  },
  {
    "path": "setup/codesign-tgz.sh",
    "content": "#!/bin/bash\n#\n# This scripts unpacks the TGZ, signs all binaries, and repacks as TAR.\n#\n# The reason we are doing this is that we get the error \"The signature of\n# the binary is invalid.\" if we sign binaries prior to creating the TGZ\n# using 'npm pack'. Apparently doing that results in corrupted signatures\n# that Apple's notarization service is not able to verify.\n#\nset -e\n\n# Arguments\nSRC=$1\nDST=$2\n\nif [[ -z \"$SRC\" || -z \"$DST\" ]]; then\n    >&2 echo \"ERROR: Missing arguments\"\n    exit 1\nfi\n\n# Script directory\nDIR=`pwd`/`dirname \"$0\"`\n\n# Unpack\nrm -rf temp\nmkdir -p temp\necho \"unpacking $SRC\"\ntar -xzf \"$SRC\" -C temp\npushd temp > /dev/null\n\nif [ -z \"$FUSE_DEVELOPER_ID\" ]; then\n    >&2 echo \"WARNING: Binaries were not signed (FUSE_DEVELOPER_ID not set)\"\nelse\n    # Sign executables\n    IFS=$'\\n'\n    for exe in \\\n            \"fuse\" \\\n            \"fuse-lang\" \\\n            \"fuse X.app/Contents/MonoBundle/fuse-preview\"; do\n        echo \"signing $exe\"\n        codesign --force --entitlements \"$DIR/entitlements.plist\" --options runtime \\\n            --timestamp --sign \"Developer ID Application: $FUSE_DEVELOPER_ID\" \\\n            \"package/bin/Release/$exe\"\n    done\n\n    # Sign app-bundles\n    IFS=$'\\n'\n    for app in \\\n            \"fuse X (menu bar).app\" \\\n            \"fuse X.app\" \\\n            \"UnoHost.app\"; do\n        echo \"signing $app\"\n        codesign --force --deep --entitlements \"$DIR/entitlements.plist\" --options runtime \\\n            --timestamp --sign \"Developer ID Application: $FUSE_DEVELOPER_ID\" \\\n            \"package/bin/Release/$app\"\n    done\nfi\n\n# Repack\necho \"creating $DST\"\ntar -cf package.tar package/\npopd > /dev/null\n\n# Done\nmv -f temp/package.tar \"$DST\"\nrm -rf temp\n"
  },
  {
    "path": "setup/dmg/.gitignore",
    "content": "*.pkg"
  },
  {
    "path": "setup/dmg/build.sh",
    "content": "#!/bin/bash\nset -e\ncd \"`dirname \"$0\"`\"\n\nrm -rf fuse-unsigned.dmg\nnpx appdmg dmg.json fuse-unsigned.dmg\n./seticon dmg.icns fuse-unsigned.dmg\n"
  },
  {
    "path": "setup/dmg/dmg.json",
    "content": "{\n\t\"title\": \"fuse X\",\n\t\"icon\": \"dmg.icns\",\n\t\"background\": \"dmg-background.png\",\n\t\"icon-size\": 160,\n\t\"format\": \"UDZO\",\n\t\"window\": {\n\t\t\"size\": {\n\t\t\t\"width\": 660,\n\t\t\t\"height\": 400\n\t\t}\n\t},\n\t\"contents\": [\n\t\t{\n\t\t\t\"x\": 165,\n\t\t\t\"y\": 170,\n\t\t\t\"type\": \"file\",\n\t\t\t\"path\": \"Install fuse X.pkg\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "setup/entitlements.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n    <key>com.apple.security.cs.allow-jit</key>\n    <true/>\n    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>\n    <true/>\n    <key>com.apple.security.cs.disable-executable-page-protection</key>\n    <true/>\n    <key>com.apple.security.cs.allow-dyld-environment-variables</key>\n    <true/>\n    <key>com.apple.security.cs.disable-library-validation</key>\n    <true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "setup/notarize.sh",
    "content": "#!/bin/bash\nSELF=`echo $0 | sed 's/\\\\\\\\/\\\\//g'`\ncd \"`dirname \"$SELF\"`/..\" || exit 1\nset -e\n\nexport VERSION=`bash scripts/get-version.sh`\n\nif [[ \"$OSTYPE\" != darwin* ]]; then\n    >&2 echo \"ERROR: This operation is only supported on macOS\"\n    exit 1\nfi\n\nif [[ -z \"$FUSE_APPLEID_USER\" || -z \"$FUSE_APPLEID_PASS\" || -z \"$FUSE_TEAM_ID\" ]]; then\n    >&2 echo \"ERROR: Please set FUSE_APPLEID_USER, FUSE_APPLEID_PASS and FUSE_TEAM_ID first\"\n    exit 1\nfi\n\nxcrun altool --notarize-app -f fuse-x-$VERSION-mac.pkg \\\n    -u \"$FUSE_APPLEID_USER\" -p \"$FUSE_APPLEID_PASS\" \\\n    --primary-bundle-id com.fuse-x.studio \\\n    --team-id \"$FUSE_TEAM_ID\"\n\nxcrun altool --notarize-app -f fuse-x-$VERSION-mac.dmg \\\n    -u \"$FUSE_APPLEID_USER\" -p \"$FUSE_APPLEID_PASS\" \\\n    --primary-bundle-id com.fuse-x.studio \\\n    --team-id \"$FUSE_TEAM_ID\"\n\necho \"Use the following command to check notarization status:\"\necho \"\"\necho \"    xcrun altool --notarization-info REQUEST_UUID --username \\\"\\$FUSE_APPLEID_USER\\\" --password \\\"\\$FUSE_APPLEID_PASS\\\" --team-id \\\"\\$FUSE_TEAM_ID\\\"\"\necho \"\"\necho \"Once OK, use the following command to staple the notarization status to our installer:\"\necho \"\"\necho \"    npm run setup:staple\"\necho \"\"\n"
  },
  {
    "path": "setup/nsis/.gitignore",
    "content": "*.exe\n*.tgz"
  },
  {
    "path": "setup/nsis/copy-unoconfig.js",
    "content": "const fs = require('fs');\nconst path = require('path');\nconst os = require('os');\n\n// Copy generated .unoconfig to %PROGRAMDATA% (#92).\nfunction copyUnoConfig() {\n\n    // We've seen %PROGRAMDATA% being empty on some systems.\n    const dir = process.env.PROGRAMDATA && process.env.PROGRAMDATA.length\n            ? path.join(process.env.PROGRAMDATA, 'fuse X')\n            : path.join(process.env.SYSTEMDRIVE, 'ProgramData', 'fuse X')\n\n    const src = path.join(os.homedir(), '.unoconfig');\n    const dst = path.join(dir, '.unoconfig');\n\n    if (fs.existsSync(src)) {\n        if (!fs.existsSync(dir))\n            fs.mkdirSync(dir, {recursive: true});\n\n        fs.copyFileSync(src, dst);\n        console.log(dst);\n    }\n}\n\ntry {\n    copyUnoConfig();\n} catch (e) {\n    console.error(e);\n    process.exit(1);\n}\n"
  },
  {
    "path": "setup/nsis/data/license.txt",
    "content": "fuse X License Agreement\n\nThis License Agreement is made between BUILD AND RUN AS (the \"Company\") and the person (\"you\") who completes the installation of this version of the fuse X product (the \"Software\"). By clicking \"I accept\" or by installing or using the Software, you agree to have read and understood this License Agreement and to be bound by its terms and conditions.\n\n1.\tLicense: Provided that you otherwise comply with this License Agreement, you are granted a personal, non-exclusive, royalty-free, non-transferrable license to install, run and use the Software for any purpose, whether commercial or non-commercial.\n\n2.\tLicense Restrictions: You may not (a) assign, sublicense, sell, rent or otherwise distribute the Software and/or this License Agreement to any third party; (b) allow others to use, run or otherwise access the Software; (c) modify or otherwise create derivative works based on the Software; (d) decompile, reverse engineer, disassemble or otherwise reduce the object code parts of the Software to a human-perceivable form; (e) remove this License Agreement from the Software.\n\n3.\tThird Party Software: The Software, or the output generated by your use of the Software, may be subject to third party software licenses. By accepting this License Agreement, you are also accepting the additional terms and conditions, if any, as set forth in such third party software license terms. \n\n4.\tUse of Output: Provided that you otherwise comply with this License Agreement, You are free to use, sublicense, sell, rent or otherwise distribute the object code output generated by your use of the Software for any purpose, whether commercial or non-commercial.\n\n5.\tIntellectual Property Rights: You become the owner and copyright holder to code and other input created by you in the course of your use of the Software. The Company retains all other rights, title and interest, including the intellectual property rights, in and to the Software, and nothing in this License Agreement shall be construed as an assignment of such intellectual property rights. \n\n6.\tUsage Information: Any feedback you provide relating to your use of the Software may be used by the Company for the improvement and modification of the Software. In addition to usage information that you provide the Company directly the Software may also collect data such as Application usage statistics (for instance, if and when you experienced errors, and how often you use different features), operating system information (such as service pack, drivers and support DLLs such as DirectX version), information about hardware types as well as CPU information, which can be used by the Company as it sees fit.\n\n7.\tNo Maintenance or Support: The Company is not obliged to provide maintenance or support for the Software, nor to notify about or grant license to bug fixes, patches or upgrades or updates to the Software (if any). If the Company at its sole discretion choses to make a Software bug fix, patch, upgrade or update available to you, and the Company does not require that your use thereof shall be subject to a separate license agreement, then your use of such bug fix, patch, upgrade or update shall be deemed incorporated into the Software and subject to this License Agreement. \n\n8.\tNo Warranty: The Software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose (including fitness for a particular operating system or particular configurations) and non-infringement. \n\n9.\tLimitation of Liability: In no event shall the Company be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from or in connection with the Software, including but not limited to any indirect and consequential damages (such as damages for the loss of profits, loss of data, breach of contract, and the inability to use equipment or other software). \n\n10.\tBreach of License Agreement: In the event that you fail to comply with the terms of this License Agreement, the license(s) granted hereunder shall immediately cease, and you must upon the Company's request destroy all copies of the Software. \n\n11.\tGoverning Law and Dispute Resolution: The License Agreement is governed by the laws of Norway. Any disputes arising in connection with this License Agreement shall be referred to the courts of Oslo, Norway."
  },
  {
    "path": "setup/nsis/fuse-setup.nsi",
    "content": "!define NAME \"fuse X\"\n;!define VERSION \"x.y.z\"\n\n!define NODE_VERSION \"16.20.0\"\n!define NODE_MSI \"node-v${NODE_VERSION}-x64.msi\"\n!define NODE_URL \"https://nodejs.org/dist/v${NODE_VERSION}/${NODE_MSI}\"\n!define NPM_DIR \"$APPDATA\\npm\"\n\n!define JDK_MSI \"OpenJDK11U-jdk_x64_windows_hotspot_11.0.16.1_1.msi\"\n!define JDK_URL \"https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.16.1%2B1/${JDK_MSI}\"\n!define JDK_SUFFIX \"Eclipse Adoptium\\jdk-11.0.16.101-hotspot\"\n\n!define FUSE_STUDIO_NAME \"${NAME} ${VERSION}\"\n!define FUSE_STUDIO_TGZ \"fuse-x-studio-win-${VERSION}.tgz\"\n!define FUSE_STUDIO_DIR \"${NPM_DIR}\\node_modules\\@fuse-x\\studio-win\"\n!define FUSE_STUDIO \"${FUSE_STUDIO_DIR}\\bin\\Release\\fuse-studio.exe\"\n!define FUSE \"${FUSE_STUDIO_DIR}\\bin\\Release\\fuse.exe\"\n!define UNO \"${FUSE_STUDIO_DIR}\\node_modules\\@fuse-open\\uno\\bin\\uno.exe\"\n\n!define REG_KEY \"Software\\Fuseapps\\${NAME}\\setup\"\n!define TEMP_DIR \"$TEMP\\fuse-setup\"\n!define WRAP \"${TEMP_DIR}\\wrap.cmd\"\n\n!define INSTALL_ANDROID     '\"${WRAP}\" npm install android-build-tools@1.x -g -f --prefix \"${NPM_DIR}\"'\n!define INSTALL_FUSE_STUDIO '\"${WRAP}\" npm install \"${TEMP_DIR}\\${FUSE_STUDIO_TGZ}\" -g -f --prefix \"${NPM_DIR}\"'\n\nUnicode True\nName \"${NAME}\"\nOutFile \"fuse-x-${VERSION}-win.exe\"\nInstallDirRegKey HKCU \"${REG_KEY}\" \"\"\nRequestExecutionLevel admin\nSetCompressor lzma\nSpaceTexts none\nTarget amd64-unicode\nBrandingText \" \"\n\n;--------------------------------\n; Interface Settings\n\n!define MUI_WELCOMEFINISHPAGE_BITMAP \"data\\modern-xl-install.bmp\"\n!define MUI_UNWELCOMEFINISHPAGE_BITMAP \"data\\modern-xl-uninstall.bmp\"\n!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH \"data\\modern-xl-install.bmp\"\n!define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH \"data\\modern-xl-uninstall.bmp\"\n\n!include \"ModernXL.nsh\"\n!include \"MUI2.nsh\"\n\n!define MUI_ICON \"data\\icon.ico\"\n!define MUI_UNICON \"data\\icon.ico\"\n\n!define MUI_ABORTWARNING\n!define MUI_UNABORTWARNING\n\n!define MUI_WELCOMEPAGE_TITLE_3LINES\n\n!define MUI_COMPONENTSPAGE_NODESC\n\n!define MUI_FINISHPAGE_NOAUTOCLOSE\n!define MUI_UNFINISHPAGE_NOAUTOCLOSE\n\n!define MUI_FINISHPAGE_TITLE_3LINES\n!define MUI_FINISHPAGE_RUN\n!define MUI_FINISHPAGE_RUN_FUNCTION \"LaunchFuseStudio\"\n!define MUI_FINISHPAGE_LINK \"Learn more at fuse-x.com\"\n!define MUI_FINISHPAGE_LINK_LOCATION \"https://fuse-x.com/docs/learn/\"\n\n;--------------------------------\n; Pages\n\n!insertmacro MUI_PAGE_WELCOME\n!insertmacro MUI_PAGE_LICENSE \"data\\license.txt\"\n!insertmacro MUI_PAGE_COMPONENTS\n;!insertmacro MUI_PAGE_DIRECTORY\n!insertmacro MUI_PAGE_INSTFILES\n!insertmacro MUI_PAGE_FINISH\n\n!insertmacro MUI_UNPAGE_WELCOME\n;!insertmacro MUI_UNPAGE_CONFIRM\n!insertmacro MUI_UNPAGE_INSTFILES\n;!insertmacro MUI_UNPAGE_FINISH\n\n;--------------------------------\n; Languages\n\n!insertmacro MUI_LANGUAGE \"English\"\n!insertmacro MUI_LANGUAGE \"French\"\n!insertmacro MUI_LANGUAGE \"Korean\"\n;!insertmacro MUI_LANGUAGE \"Norwegian\"\n\n;--------------------------------\n; Install types\n\nInstType \"Typical\"\nInstType \"Complete\"\nInstType \"Minimal\"\n\n;--------------------------------\n; Installer Sections\n\n!include \"LogicLib.nsh\"\n!include \"sections.nsh\"\n\nSection \"-wrap\"\n\n  SetOutPath \"${TEMP_DIR}\"\n  File \"copy-unoconfig.js\"\n  File \"wrap.cmd\"\n\nSectionEnd\n\nSectionGroup \"fuse X\"\n\nSection \"Node.js\" SEC_NODE\nSectionIn 1 2\n\n  ; Installed later.\n\nSectionEnd\n\nSection \"VC++ Redistributables\"\nSectionIn 1 2\n\n  ; https://stackoverflow.com/questions/12206314/detect-if-visual-c-redistributable-for-visual-studio-2012-is-installed\n\n  ReadRegStr $1 HKLM \"SOFTWARE\\Classes\\Installer\\Products\\1926E8D15D0BCE53481466615F760A7F\" \"NUL:\"\n  ${If} $0 != \"NUL:\"\n    DetailPrint \"vcredist 2010 (x64) is already installed\"\n    Goto installed_2010\n  ${EndIf}\n\n  DetailPrint \"Installing vcredist 2010 (x64)\"\n  NScurl::http GET https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe vcredist_2010_x64.exe /CANCEL /INSIST /Zone.Identifier /END\n  ExecWait \"${TEMP_DIR}\\vcredist_2010_x64.exe /q /norestart\"\n  Delete \"${TEMP_DIR}\\vcredist_2010_x64.exe\"\n\ninstalled_2010:\n  ReadRegStr $1 HKLM \"SOFTWARE\\Classes\\Installer\\Dependencies\\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}\" \"NUL:\"\n  ${If} $0 != \"NUL:\"\n    DetailPrint \"vcredist 2012 (x64) is already installed\"\n    Goto installed_2012\n  ${EndIf}\n\n  DetailPrint \"Installing vcredist 2012 (x64)\"\n  NScurl::http get https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe vcredist_2012_x64.exe /CANCEL /INSIST /Zone.Identifier /END\n  ExecWait \"${TEMP_DIR}\\vcredist_2012_x64.exe /q /norestart\"\n  Delete \"${TEMP_DIR}\\vcredist_2012_x64.exe\"\n\ninstalled_2012:\n  ReadRegStr $1 HKLM \"SOFTWARE\\Classes\\Installer\\Dependencies\\{050d4fc8-5d48-4b8f-8972-47c82c46020f}\" \"NUL:\"\n  ${If} $0 != \"NUL:\"\n    DetailPrint \"vcredist 2013 (x64) is already installed\"\n    Goto installed_2013\n  ${EndIf}\n\n  DetailPrint \"Installing vcredist 2013 (x64)\"\n  NScurl::http get https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe vcredist_2013_x64.exe /CANCEL /INSIST /Zone.Identifier /END\n  ExecWait \"${TEMP_DIR}\\vcredist_2013_x64.exe /install /quiet /norestart\"\n  Delete \"${TEMP_DIR}\\vcredist_2013_x64.exe\"\n\ninstalled_2013:\nSectionEnd\n\nSection \"fuse X\" SEC0000\nSectionIn 1 2 3 RO\n\n  ExecDos::exec 'cmd /c \"\"${WRAP}\" npm --version\"' ''\n  Pop $0\n\n  ${If} $0 == 0\n    DetailPrint \"Node.js is already installed\"\n    Goto install_fuse\n  ${ElseIf} ${SectionIsSelected} ${SEC_NODE}\n    Goto install_node\n  ${EndIf}\n\n  DetailPrint \"Please install Node.js and try again\"\n  MessageBox MB_ICONQUESTION|MB_YESNO \"Node.js is required, but could not be found.$\\r$\\n$\\r$\\nDo you want to install Node.js now?\" /SD IDNO IDYES install_node IDNO abort_install\n\ninstall_node:\n  DetailPrint \"Installing Node.js\"\n  NScurl::http get \"${NODE_URL}\" \"${TEMP_DIR}\\${NODE_MSI}\" /CANCEL /INSIST /Zone.Identifier /END\n  ExecWait 'msiexec.exe /i \"${TEMP_DIR}\\${NODE_MSI}\" /qn'\n  Delete \"${TEMP_DIR}\\${NODE_MSI}\"\n  Goto install_fuse\n\nabort_install:\n  Call Failed\n\ninstall_fuse:\n  File ${FUSE_STUDIO_TGZ}\n\n  ExecDos::exec 'taskkill /f /t /im unohost.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-tray.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-lang.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-studio.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-preview.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse.exe' ''\n\n  ;NPM should handle removal of old versions already.\n  ;RMDir /r /REBOOTOK \"${FUSE_STUDIO_DIR}\"\n\n  DetailPrint \"Installing ${FUSE_STUDIO_NAME}\"\n  ExecDos::exec /DETAILED 'cmd /c \"${INSTALL_FUSE_STUDIO}\"' ''\n  Pop $0\n\n  ${If} $0 != 0\n    ;Try one more time.\n    DetailPrint \"Reinstalling ${FUSE_STUDIO_NAME}\"\n    ExecDos::exec /DETAILED 'cmd /c \"${INSTALL_FUSE_STUDIO}\"' ''\n    Pop $0\n\n    ${If} $0 != 0\n      Delete \"${TEMP_DIR}\\${FUSE_STUDIO_TGZ}\"\n      Call Failed\n    ${EndIf}\n  ${EndIf}\n\n  Delete \"${TEMP_DIR}\\${FUSE_STUDIO_TGZ}\"\n\n  SetOutPath \"$INSTDIR\"\n  WriteRegStr HKCU \"${REG_KEY}\" \"\" $INSTDIR\n  WriteUninstaller \"$INSTDIR\\uninstall.exe\"\n\n  ; https://nsis.sourceforge.io/mediawiki/index.php?title=Add_uninstall_information_to_Add/Remove_Programs\n  WriteRegStr HKCU \\\n    \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \\\n    \"DisplayName\" \"${NAME}\"\n  WriteRegStr HKCU \\\n    \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \\\n    \"DisplayIcon\" \"${FUSE_STUDIO}\"\n  WriteRegStr HKCU \\\n    \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \\\n    \"DisplayVersion\" \"${VERSION}\"\n  WriteRegDWORD HKCU \\\n    \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \\\n    \"EstimatedSize\" 194560 ; ~190MB\n  WriteRegStr HKCU \\\n    \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \\\n    \"UninstallString\" \"$INSTDIR\\uninstall.exe\"\n\n  FileOpen $9 your-files.txt w\n  FileWrite $9 \"Your files are located at:$\\r$\\n\"\n  FileWrite $9 \"${FUSE_STUDIO_DIR}$\\r$\\n\"\n  FileClose $9\n\n  CreateDirectory \"$SMPROGRAMS\\${NAME}\"\n  CreateShortCut \"$SMPROGRAMS\\${NAME}\\${NAME}.lnk\" \"${FUSE_STUDIO}\" \"\" \"${FUSE_STUDIO}\"\n  CreateShortCut \"$SMPROGRAMS\\${NAME}\\Uninstall ${NAME}.lnk\" \"$INSTDIR\\uninstall.exe\" \"\" \"$INSTDIR\\uninstall.exe\"\n\nSectionEnd\n\nSection \"Warm-up\"\nSectionIn 1 2\n\n  DetailPrint \"Warming up\"\n  ExecDos::exec /DETAILED 'cmd /c \"\"${WRAP}\" \"${UNO}\" build dotnet \"${FUSE_STUDIO_DIR}\\empty\"\"' ''\n  Pop $0\n\n  ${If} $0 != 0\n    SetDetailsView show\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"Warm-up failed.\"\n  ${EndIf}\n\nSectionEnd\n\nSectionGroupEnd\nSectionGroup \"Android Support\"\n\nSection \"Java Development Kit\" SEC_JAVA\nSectionIn 1 2\n\n  ; Installed later.\n\nSectionEnd\n\nSection \"Android Build Tools\"\nSectionIn 1 2\n\n  ExecDos::exec 'cmd /c \"\"${WRAP}\" javac -version\"' ''\n  Pop $0\n\n  ${If} $0 == 0\n    DetailPrint \"JDK is already installed\"\n    Goto install_android\n  ${ElseIf} ${SectionIsSelected} ${SEC_JAVA}\n    Goto install_java\n  ${EndIf}\n\n  DetailPrint \"Please install Java Development Kit and try again\"\n  MessageBox MB_ICONQUESTION|MB_YESNO \"Java Development Kit is required, but could not be found.$\\r$\\n$\\r$\\nDo you want to install Java Development Kit now?\" /SD IDNO IDYES install_java IDNO install_android\n\ninstall_java:\n  DetailPrint \"Installing Java Development Kit\"\n  NScurl::http get \"${JDK_URL}\" \"${TEMP_DIR}\\${JDK_MSI}\" /CANCEL /INSIST /Zone.Identifier /END\n  ExecWait 'msiexec.exe /i \"${TEMP_DIR}\\${JDK_MSI}\" /qn'\n  Delete \"${TEMP_DIR}\\${JDK_MSI}\"\n\n  ; Use JDK installation in %PROGRAMW6432% (x64).\n  Var /GLOBAL JAVA_HOME\n  ExpandEnvStrings $JAVA_HOME \"%PROGRAMW6432%\\${JDK_SUFFIX}\"\n  System::Call 'Kernel32::SetEnvironmentVariable(t, t)i (\"JAVA_HOME\", \"$JAVA_HOME\").r0'\n  DetailPrint \"JAVA_HOME: $JAVA_HOME\"\n\ninstall_android:\n  DetailPrint \"Installing Android Build Tools\"\n  ExecDos::exec /DETAILED 'cmd /c \"${INSTALL_ANDROID}\"' ''\n  Pop $0\n\n  ${If} $0 != 0\n    SetDetailsView show\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"Android Build Tools failed to install.\"\n  ${EndIf}\n\n  ; Copy generated .unoconfig to %PROGRAMDATA% (#92).\n  ExecDos::exec /DETAILED 'cmd /c \"\"${WRAP}\" node \"${TEMP_DIR}\\copy-unoconfig.js\"\"' ''\n  Pop $0\n\n  ${If} $0 != 0\n    SetDetailsView show\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"Failed to copy unoconfig file.\"\n  ${EndIf}\n\nSectionEnd\n\nSectionGroupEnd\nSectionGroup /e \"Text Editor Plugins\"\n\nSection \"Visual Studio Code\"\nSectionIn 2\n\n  ExecDos::exec 'cmd /c \"\"${WRAP}\" code --version\"' ''\n  Pop $0\n\n  ${If} $0 == 0\n    DetailPrint \"Visual Studio Code is already installed\"\n    Goto install_extension\n  ${EndIf}\n\n  DetailPrint \"Please install Visual Studio Code\"\n  MessageBox MB_ICONQUESTION|MB_YESNO \"The 'code' command was not found on your computer.$\\r$\\n$\\r$\\nDo you want to install Visual Studio Code now?\" /SD IDNO IDYES install_code IDNO install_extension\n\ninstall_code:\n  ExecShell \"open\" \"https://code.visualstudio.com/download/\"\n  MessageBox MB_ICONINFORMATION|MB_OK \"Please follow instructions on https://code.visualstudio.com/download/ to install Visual Studio Code.\"\n\ninstall_extension:\n  DetailPrint \"Installing Visual Studio Code extension\"\n  ExecDos::exec /DETAILED 'cmd /c \"\"${WRAP}\" \"${FUSE}\" install vscode-extension\"' ''\n  Pop $0\n\n  ${If} $0 != 0\n    SetDetailsView show\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"The Visual Studio Code extension failed to install.$\\r$\\n$\\r$\\nYou can reinstall the extension later from the Tools menu in fuse X.\"\n  ${EndIf}\n\nSectionEnd\n\nSection \"Sublime Text 3\"\nSectionIn 2\n\n  IfFileExists \"$SMPROGRAMS\\Sublime Text 3.lnk\" 0 +2\n  Goto install_plugin\n\n  ExecDos::exec 'cmd /c \"\"${WRAP}\" subl --version\"' ''\n  Pop $0\n\n  ${If} $0 == 0\n    DetailPrint \"Sublime Text is already installed\"\n    Goto install_plugin\n  ${EndIf}\n\n  DetailPrint \"Please install Sublime Text\"\n  MessageBox MB_ICONQUESTION|MB_YESNO \"The 'subl' command was not found on your computer.$\\r$\\n$\\r$\\nDo you want to install Sublime Text now?\" /SD IDNO IDYES install_sublime IDNO install_plugin\n\ninstall_sublime:\n  ExecShell \"open\" \"https://www.sublimetext.com/3\"\n  MessageBox MB_ICONINFORMATION|MB_OK \"Please follow instructions on https://www.sublimetext.com/3 to install Sublime Text.\"\n\ninstall_plugin:\n  DetailPrint \"Installing Sublime Text plugin\"\n  ExecDos::exec /DETAILED 'cmd /c \"\"${WRAP}\" \"${FUSE}\" install sublime-plugin\"' ''\n  Pop $0\n\n  ${If} $0 != 0\n    SetDetailsView show\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"The Sublime Text plugin failed to install.$\\r$\\n$\\r$\\nYou can reinstall the plugin later from the Tools menu in fuse X.\"\n  ${EndIf}\n\nSectionEnd\n\nSection \"Atom\"\nSectionIn 2\n\n  DetailPrint \"Installing Atom plugin\"\n  ExecDos::exec /DETAILED 'cmd /c \"\"${WRAP}\" \"${FUSE}\" install atom-plugin\"' ''\n  Pop $0\n\n  ${If} $0 != 0\n    SetDetailsView show\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"The Atom plugin failed to install.$\\r$\\n$\\r$\\nYou can reinstall the plugin later from the Tools menu in fuse X.\"\n  ${EndIf}\n\nSectionEnd\n\nSectionGroupEnd\n\nSection \"-chmod\"\n\n  DetailPrint \"Setting permissions\"\n\n  ; Reset permissions to All Users (not Administrator).\n  AccessControl::GrantOnFile \"${FUSE_STUDIO_DIR}\" \"(S-1-5-32-545)\" \"FullAccess\"\n  Pop $0\n\n  ${If} $0 == \"error\"\n    SetDetailsView show\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"Failed to set permissions.\"\n  ${EndIf}\n\nSectionEnd\n\n;--------------------------------\n; Uninstaller Section\n\n  Var PROGRAMDATA\n\nSection \"Uninstall\"\n\n  ExecDos::exec 'taskkill /f /t /im unohost.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-tray.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-lang.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-studio.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse-preview.exe' ''\n  ExecDos::exec 'taskkill /f /t /im fuse.exe' ''\n\n  RMDir /r /REBOOTOK \"$INSTDIR\"\n  RMDir /r /REBOOTOK \"$SMPROGRAMS\\${NAME}\"\n  RMDir /r /REBOOTOK \"${FUSE_STUDIO_DIR}\"\n  RMDir /r /REBOOTOK \"${TEMP_DIR}\"\n\n  Delete /REBOOTOK \"${NPM_DIR}\\fuse\"\n  Delete /REBOOTOK \"${NPM_DIR}\\fuse.cmd\"\n  Delete /REBOOTOK \"${NPM_DIR}\\fuse.ps1\"\n  Delete /REBOOTOK \"${NPM_DIR}\\fuse-x\"\n  Delete /REBOOTOK \"${NPM_DIR}\\fuse-x.cmd\"\n  Delete /REBOOTOK \"${NPM_DIR}\\fuse-x.ps1\"\n  Delete /REBOOTOK \"${NPM_DIR}\\uno\"\n  Delete /REBOOTOK \"${NPM_DIR}\\uno.cmd\"\n  Delete /REBOOTOK \"${NPM_DIR}\\uno.ps1\"\n\n  DeleteRegKey HKCU \"${REG_KEY}\"\n  DeleteRegKey HKCU \"Software\\Classes\\fusestudio\" ; Legacy URL scheme.\n  DeleteRegKey HKCU \"Software\\Classes\\fuse-x\"\n  ; https://nsis.sourceforge.io/mediawiki/index.php?title=Add_uninstall_information_to_Add/Remove_Programs\n  DeleteRegKey HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\n\n  MessageBox MB_ICONQUESTION|MB_YESNO \"Do you want to delete your configuration and log files?\" /SD IDNO IDYES remove_userdata IDNO done\n\nremove_userdata:\n  RMDir /r /REBOOTOK \"$LOCALAPPDATA\\fuse X\"\n  RMDir /r /REBOOTOK \"$PROGRAMDATA\\fuse X\"\n\ndone:\nSectionEnd\n\n;--------------------------------\n; Installer Functions\n\nFunction .onInit\n  !insertmacro MUI_LANGDLL_DISPLAY\n  SectionSetFlags ${SEC0000} 17\n  ; Prefer installing in %PROGRAMW6432% (x64).\n  ExpandEnvStrings $INSTDIR \"%PROGRAMW6432%\\${NAME}\"\nFunctionEnd\n\nFunction .onGUIEnd\n  RMDir /r /REBOOTOK \"${TEMP_DIR}\"\nFunctionEnd\n\nFunction Failed\n  DetailPrint \"Install failed.\"\n  SetDetailsView show\n  Abort\nFunctionEnd\n\nFunction LaunchFuseStudio\n  ; http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html\n  Exec '\"$WINDIR\\explorer.exe\" \"${FUSE_STUDIO}\"'\nFunctionEnd\n\n;--------------------------------\n; Uninstaller Functions\n\nFunction un.onInit\n  !insertmacro MUI_LANGDLL_DISPLAY\n  ; https://nsis-dev.github.io/NSIS-Forums/html/t-354968.html\n  SetShellVarContext all\n  StrCpy $PROGRAMDATA \"$APPDATA\"\n  SetShellVarContext current\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/COPYING",
    "content": "COPYRIGHT\n---------\n\nCopyright (C) 1999-2022 Contributors\n\nMore detailed copyright information can be found in the individual source code files.\n\nAPPLICABLE LICENSES\n-------------------\n\n* All NSIS source code, plug-ins (with the exception of NScurl plugin), documentation, examples, header files and graphics, with the exception of the compression modules and where otherwise noted, are licensed under the zlib/libpng license.\n\n* The zlib compression module for NSIS is licensed under the zlib/libpng license.\n\n* The bzip2 compression module for NSIS is licensed under the bzip2 license.\n\n* The LZMA compression module for NSIS is licensed under the Common Public License version 1.0.\n\n* The NScurl plugin uses software libraries licensed as follows:\n\n      * The \"NScurl\" project is licensed under the 3-Clause BSD license.\n        https://github.com/negrutiu/nsis-nscurl/\n\n      * The \"libcurl-devel\" library is licensed under the Zero-clause BSD license.\n        https://github.com/negrutiu/libcurl-devel/\n\n      * The \"curl\" project is licensed under a MIT/X-inspired license.\n        https://curl.haxx.se/docs/copyright.html\n\n      * The \"OpenSSL\" toolkit is dual licensed.\n        https://www.openssl.org/source/license-openssl-ssleay.txt\n\n      * The \"nghttp2\" library is licensed under the MIT license.\n        https://nghttp2.org/documentation/package_README.html#license\n\n\nZLIB/LIBPNG LICENSE\n-------------------\n\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n      1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n\n      2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n\n      3. This notice may not be removed or altered from any source distribution.\n\nBZIP2 LICENSE\n-------------\n\nThis program, \"bzip2\" and associated library \"libbzip2\", are copyright (C) 1996-2000 Julian R Seward. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n      1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n    \n      2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n\n      3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n\n      4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nJulian Seward, Cambridge, UK.\n\njseward@acm.org\n\nCOMMON PUBLIC LICENSE VERSION 1.0\n---------------------------------\n\nTHE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\n\n1. DEFINITIONS\n\n\"Contribution\" means:\n\n      a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and\n      b) in the case of each subsequent Contributor:\n\n      i) changes to the Program, and\n\n      ii) additions to the Program;\n\n      where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. \n\n\"Contributor\" means any person or entity that distributes the Program.\n\n\"Licensed Patents \" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.\n\n\"Program\" means the Contributions distributed in accordance with this Agreement.\n\n\"Recipient\" means anyone who receives the Program under this Agreement, including all Contributors.\n\n2. GRANT OF RIGHTS\n\n      a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.\n\n      b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. \n\n      c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.\n\n      d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. \n\n3. REQUIREMENTS\n\nA Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:\n\n      a) it complies with the terms and conditions of this Agreement; and\n\n      b) its license agreement:\n\n      i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; \n\n      ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; \n\n      iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and\n\n      iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. \n\nWhen the Program is made available in source code form:\n\n      a) it must be made available under this Agreement; and \n\n      b) a copy of this Agreement must be included with each copy of the Program. \n\nContributors may not remove or alter any copyright notices contained within the Program.\n\nEach Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.\n\n4. COMMERCIAL DISTRIBUTION\n\nCommercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (\"Commercial Contributor\") hereby agrees to defend and indemnify every other Contributor (\"Indemnified Contributor\") against any losses, damages and costs (collectively \"Losses\") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.\n\nFor example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.\n\n5. NO WARRANTY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.\n\n6. DISCLAIMER OF LIABILITY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\n7. GENERAL\n\nIf any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.\n\nIf Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.\n\nAll Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.\n\nEveryone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.\n\nThis Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. \n\nSPECIAL EXCEPTION FOR LZMA COMPRESSION MODULE\n---------------------------------------------\n\nIgor Pavlov and Amir Szekely, the authors of the LZMA compression module for NSIS, expressly permit you to statically or dynamically link your code (or bind by name) to the files from the LZMA compression module for NSIS without subjecting your linked code to the terms of the Common Public license version 1.0. Any modifications or additions to files from the LZMA compression module for NSIS, however, are subject to the terms of the Common Public License version 1.0.\n\n\n\n---------------------------------------------\nThe BSD3 license for the \"NScurl\" plugin\nOfficial website: https://github.com/negrutiu/nsis-nscurl/\n---------------------------------------------\nCopyright (C) 2020 by Marius Negrutiu <marius.negrutiu@protonmail.com>, All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n---------------------------------------------\nThe BSD0 license for the libcurl-devel library\nOfficial website: https://github.com/negrutiu/libcurl-devel/\n---------------------------------------------\nCopyright (C) 2020 by Marius Negrutiu <marius.negrutiu@protonmail.com>\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n\n---------------------------------------------\nThe curl license\nOfficial website: https://curl.haxx.se/\n---------------------------------------------\n\nCOPYRIGHT AND PERMISSION NOTICE\n\nCopyright (c) 1996 - 2020, Daniel Stenberg, daniel@haxx.se, and many contributors, see the THANKS file.\n\nAll rights reserved.\n\nPermission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.\n\n\n---------------------------------------------\nThe OpenSSL dual license\nOfficial website: https://www.openssl.org/\n---------------------------------------------\n\n  LICENSE ISSUES\n  ==============\n\n  The OpenSSL toolkit stays under a double license, i.e. both the conditions of\n  the OpenSSL License and the original SSLeay license apply to the toolkit.\n  See below for the actual license texts.\n\n  OpenSSL License\n  ---------------\n\n/* ====================================================================\n * Copyright (c) 1998-2019 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n Original SSLeay License\n -----------------------\n\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n\n---------------------------------------------\nThe nghttp2 MIT license\nOfficial website: https://nghttp2.org/\n---------------------------------------------\n\nThe MIT License\n\nCopyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa\nCopyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/AccessControl.cpp",
    "content": "\n/* AccessControl plugin for NSIS\n * Copyright (C) 2003 Mathias Hasselmann <mathias@taschenorakel.de>\n *\n * This software is provided 'as-is', without any express or implied \n * warranty. In no event will the authors be held liable for any damages \n * arising from the use of this software. \n *\n * Permission is granted to anyone to use this software for any purpose, \n * including commercial applications, and to alter it and redistribute it \n * freely, subject to the following restrictions:\n *\n *   1. The origin of this software must not be misrepresented; you must not \n *      claim that you wrote the original software. If you use this software \n *      in a product, an acknowledgment in the product documentation would be\n *      appreciated but is not required.\n *\n *   2. Altered source versions must be plainly marked as such, and must not \n *      be misrepresented as being the original software.\n *\n *   3. This notice may not be removed or altered from any source \n *      distribution.\n */\n\n/* Modifications by Afrow UK, kichik and AndersK.\n * See Docs\\AccessControl\\Readme.txt for full modifications list.\n */\n\n#define WIN32_LEAN_AND_MEAN\n#ifdef _WIN64\n#define WINVER 0x502\n#else\n#define WINVER 0x400\n#endif\n\n#include <windows.h>\n#ifdef UNICODE\n#include \"nsis_unicode/pluginapi.h\"\n#else\n#include \"nsis_ansi/pluginapi.h\"\n#endif\n#include <aclapi.h>\n#include <sddl.h>\n\n/*****************************************************************************\n GLOBAL VARIABLES\n *****************************************************************************/\n\nHINSTANCE g_hInstance = NULL;\nint g_string_size = 1024;\nextra_parameters* g_extra = NULL;\n\n/*****************************************************************************\n TYPE DEFINITIONS\n *****************************************************************************/\n\ntypedef struct\n{\n  const TCHAR* name;\n  SE_OBJECT_TYPE type;\n  DWORD defaultInheritance;\n  const TCHAR** const permissionNames;\n  const DWORD* const permissionFlags;\n  const int permissionCount;\n}\nSchemeType;\n\ntypedef struct\n{\n  BOOL noInherit;\n  HKEY hRootKey;\n}\nOptions;\n\ntypedef enum\n{\n  ChangeMode_Owner,\n  ChangeMode_Group\n}\nChangeMode;\n\n/*****************************************************************************\n UTILITIES\n *****************************************************************************/\n\n#define SIZE_OF_ARRAY(Array) (sizeof((Array)) / sizeof(*(Array)))\n#define ARRAY_CONTAINS(Array, Index) (Index >= 0 && Index < SIZE_OF_ARRAY(Array))\n\nvoid* LocalAllocZero(size_t cb) { return LocalAlloc(LPTR, cb); }\ninline void* LocalAlloc(size_t cb) { return LocalAllocZero(cb); }\n\n/*****************************************************************************\n PLUG-IN HANDLING\n *****************************************************************************/\n\n#define PUBLIC_FUNCTION(Name) \\\nextern \"C\" void __declspec(dllexport) __cdecl Name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra) \\\n{ \\\n  EXDLL_INIT(); \\\n  g_string_size = string_size; \\\n  g_extra = extra;\n\n#define PUBLIC_FUNCTION_END \\\n}\n\nvoid showerror_s(const TCHAR* fmt, TCHAR* arg)\n{\n  TCHAR* msg = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n  if (msg)\n  {\n    wsprintf(msg, fmt, arg);\n    pushstring(msg);\n    LocalFree(msg);\n  }\n}\n\nvoid showerror_d(const TCHAR* fmt, DWORD arg)\n{\n  TCHAR* msg = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n  if (msg)\n  {\n    wsprintf(msg, fmt, arg);\n    pushstring(msg);\n    LocalFree(msg);\n  }\n}\n\n#define ERRSTR_OOM TEXT(\"OutOfMemory\")\n\n#define ABORT_s(x, y) \\\n    { showerror_s(TEXT(x), y); goto cleanup; }\n#define ABORT_d(x, y) \\\n    { showerror_d(TEXT(x), y); goto cleanup; }\n#define ABORT(x) \\\n    { pushstring(TEXT(x)); goto cleanup; }\n\n/*****************************************************************************\n COMPATIBILITY UTILITIES\n *****************************************************************************/\n\n#define BuildExplicitAccessWithNameA BuildExplicitAccessWithNameT\n#define BuildExplicitAccessWithNameW BuildExplicitAccessWithNameT\n#if WINVER < 0x500\n#define ConvertStringSidToSidA Compat_ConvertStringSidToSidT\n#define ConvertStringSidToSidW Compat_ConvertStringSidToSidT\n\nstatic FARPROC AdvApi32_GetProcAddress(LPCSTR Name)\n{\n  return GetProcAddress(LoadLibraryA(\"ADVAPI32\"), Name);\n}\n\nTCHAR* CharPos(TCHAR* szStr, int cchStrLen, TCHAR chFind)\n{\n  for (int i = 0; i < cchStrLen && NULL != *(szStr + i); i++)\n    if (*(szStr + i) == chFind)\n      return szStr + i;\n  return NULL;\n}\n\nBYTE FromHex(TCHAR* szHex)\n{\n  int a = 0;\n  int b = 0;\n\n  if (szHex[0] >= TEXT('0') && szHex[0] <= TEXT('9'))\n    a = szHex[0] - TEXT('0');\n  else if (szHex[0] >= TEXT('A') && szHex[0] <= TEXT('F'))\n    a = szHex[0] - TEXT('A') + 10;\n  else if (szHex[0] >= TEXT('a') && szHex[0] <= TEXT('f'))\n    a = szHex[0] - TEXT('a') + 10;\n\n  if (szHex[1] >= TEXT('0') && szHex[1] <= TEXT('9'))\n    b = szHex[1] - TEXT('0');\n  else if (szHex[1] >= TEXT('A') && szHex[1] <= TEXT('F'))\n    b = szHex[1] - TEXT('A') + 10;\n  else if (szHex[1] >= TEXT('a') && szHex[1] <= TEXT('f'))\n    b = szHex[1] - TEXT('a') + 10;\n\n  return a * 16 + b;\n}\n\nstatic void SetIdentifierAuthority(SID_IDENTIFIER_AUTHORITY&sia, DWORD val32)\n{\n  sia.Value[5] = (BYTE)((val32 & 0x000000FF) >> 0);\n  sia.Value[4] = (BYTE)((val32 & 0x0000FF00) >> 8);\n  sia.Value[3] = (BYTE)((val32 & 0x00FF0000) >> 16);\n  sia.Value[2] = (BYTE)((val32 & 0xFF000000) >> 24);\n  sia.Value[1] = sia.Value[0] = 0;\n}\n\n// Based on GetBinarySid function from http://www.codeguru.com/cpp/w-p/system/security/article.php/c5659.\nBOOL Compat_ConvertStringSidToSidT(LPTSTR szSid, PSID* ppSid)\n{  \n  // Try to call the real function on 2000+, \n  // this will enable support for more SID Strings (Those will not work on NT4 so script carefully)\n  FARPROC fp = AdvApi32_GetProcAddress(sizeof(TCHAR) > 1 ? \"ConvertStringSidToSidW\" : \"ConvertStringSidToSidA\");\n  bool ret = fp && ((BOOL(WINAPI*)(LPCTSTR,PSID*))fp)(szSid,ppSid);\n  if (ret) return ret;\n\n  *ppSid = NULL;\n  BYTE nByteAuthorityCount = 0;\n  PSID pSid = LocalAllocZero(8 + (sizeof(DWORD) * SID_MAX_SUB_AUTHORITIES));\n  if (!pSid) return false;\n\n  // Building a revision 1 SID in memory, the rest of the code assumes that pSid is zero filled!\n  ((char*)pSid)[0] = 1;\n  SID_IDENTIFIER_AUTHORITY &sidIA = *(SID_IDENTIFIER_AUTHORITY*) ((char*)pSid + 2);\n  DWORD *pSidSA = (DWORD*) ((char*)pSid + 8);\n\n  static const struct { char id0, id1; BYTE ia, sa0, sa1; } sidmap[] = {\n    {'A'|32,'N'|32, (5), (7) , 0}, // NT AUTHORITY\\ANONYMOUS LOGON\n    {'A'|32,'U'|32, (5), (11), 0}, // NT AUTHORITY\\Authenticated Users\n    {'B'|32,'A'|32, (5), (32), (544)-500}, // BUILTIN\\Administrators\n    {'B'|32,'U'|32, (5), (32), (545)-500}, // BUILTIN\\Users\n    {'I'|32,'U'|32, (5), (4) , 0}, // NT AUTHORITY\\INTERACTIVE\n    {'S'|32,'Y'|32, (5), (18), 0}, // NT AUTHORITY\\SYSTEM\n    {'W'|32,'D'|32, (1), (0) , 0}, // Everyone\n  };\n  // Try to lookup a SID string\n  for (int i = 0; i < SIZE_OF_ARRAY(sidmap); ++i)\n  {\n    if ((szSid[0]|32) != sidmap[i].id0 || (szSid[1]|32) != sidmap[i].id1 || szSid[2]) continue;\n    SetIdentifierAuthority(sidIA, sidmap[i].ia);\n    pSidSA[nByteAuthorityCount++] = sidmap[i].sa0;\n    if (sidmap[i].sa1) pSidSA[nByteAuthorityCount++] = (DWORD)sidmap[i].sa1 + 500;\n    goto done;\n  }\n\n  // S-SID_REVISION- + identifierauthority- + subauthorities + NULL\n\n  // Skip S\n  PTSTR ptr;\n  if (!(ptr = CharPos(szSid, lstrlen(szSid), TEXT('-'))))\n    return FALSE;\n  ptr++;\n\n  // Skip SID_REVISION\n  if (!(ptr = CharPos(ptr, lstrlen(ptr), TEXT('-'))))\n    return FALSE;\n  ptr++;\n\n  // Skip identifierauthority\n  PTSTR ptr1;\n  if (!(ptr1 = CharPos(ptr, lstrlen(ptr), TEXT('-'))))\n    return FALSE;\n  *ptr1 = 0;\n  \n  if ((*ptr == TEXT('0')) && (*(ptr+1) == TEXT('x')))\n  {\n    sidIA.Value[0] = FromHex(ptr);\n    sidIA.Value[1] = FromHex(ptr + 2);\n    sidIA.Value[2] = FromHex(ptr + 4);\n    sidIA.Value[3] = FromHex(ptr + 8);\n    sidIA.Value[4] = FromHex(ptr + 10);\n    sidIA.Value[5] = FromHex(ptr + 12);\n  }\n  else\n  {\n    SetIdentifierAuthority(sidIA, myatou(ptr));\n  }\n\n  // Skip -\n  *ptr1 = TEXT('-'), ptr = ptr1, ptr1++;\n\n  for (int i = 0; i < 8; i++)\n  {\n    // Get subauthority count.\n    if (!(ptr = CharPos(ptr, lstrlen(ptr), TEXT('-')))) break;\n    *ptr = 0, ptr++, nByteAuthorityCount++;\n  }\n\n  for (int i = 0; i < nByteAuthorityCount; i++)\n  {\n    // Get subauthority.\n    pSidSA[i] = myatou(ptr1);\n    ptr1 += lstrlen(ptr1) + 1;\n  }\n\ndone:\n  if (nByteAuthorityCount)\n  {\n    *ppSid = pSid, ((char*)pSid)[1] = nByteAuthorityCount;\n    return TRUE;\n  }\n  LocalFree(pSid);\n  return FALSE;\n}\n\n// Based on GetTextualSid function from http://www.codeguru.com/cpp/w-p/system/security/article.php/c5659.\nBOOL ConvertSidToStringSidNoAlloc(const PSID pSid, LPTSTR pszSid)\n{\n  // Validate the binary SID\n  if(!IsValidSid(pSid)) return FALSE;\n\n  // Get the identifier authority value from the SID\n  PSID_IDENTIFIER_AUTHORITY psia = GetSidIdentifierAuthority(pSid);\n\n  // Get the number of subauthorities in the SID.\n  DWORD dwSubAuthorities = *GetSidSubAuthorityCount(pSid);\n\n  // Compute the buffer length\n  // S-SID_REVISION- + IdentifierAuthority- + subauthorities- + NULL\n  DWORD dwSidSize = (15 + 12 + (12 * dwSubAuthorities) + 1) * sizeof(TCHAR);\n\n  // Add 'S' prefix and revision number to the string\n  dwSidSize = wsprintf(pszSid, TEXT(\"S-%lu-\"), SID_REVISION);\n\n  // Add SID identifier authority to the string.\n  if((psia->Value[0] != 0) || (psia->Value[1] != 0))\n  {\n    dwSidSize += wsprintf(pszSid + lstrlen(pszSid),\n        TEXT(\"0x%02hx%02hx%02hx%02hx%02hx%02hx\"),\n        (USHORT)psia->Value[0],\n        (USHORT)psia->Value[1],\n        (USHORT)psia->Value[2],\n        (USHORT)psia->Value[3],\n        (USHORT)psia->Value[4],\n        (USHORT)psia->Value[5]);\n  }\n  else\n  {\n    dwSidSize += wsprintf(pszSid + lstrlen(pszSid),\n        TEXT(\"%lu\"),\n        (ULONG)(psia->Value[5]) +\n        (ULONG)(psia->Value[4] << 8) +\n        (ULONG)(psia->Value[3] << 16) +\n        (ULONG)(psia->Value[2] << 24));\n  }\n\n  // Add SID subauthorities to the string\n  for(DWORD dwCounter = 0; dwCounter < dwSubAuthorities; dwCounter++)\n  {\n    dwSidSize += wsprintf(pszSid + dwSidSize, TEXT(\"-%lu\"),\n        *GetSidSubAuthority(pSid, dwCounter));\n  }\n\n  return TRUE;\n}\n\n#ifndef UNICODE\n#define GetNamedSecurityInfoA Delayload_GetNamedSecurityInfoA\n#define SetEntriesInAclA Delayload_SetEntriesInAclA\n#define SetNamedSecurityInfoA Delayload_SetNamedSecurityInfoA\n\nDWORD Delayload_GetNamedSecurityInfoA(LPSTR ON, SE_OBJECT_TYPE OT, SECURITY_INFORMATION SI, PSID*ppSO, PSID*ppSG, PACL*ppD, PACL*ppS, PSECURITY_DESCRIPTOR*ppSD)\n{\n  FARPROC fp = AdvApi32_GetProcAddress(\"GetNamedSecurityInfoA\");\n  if (!fp) return ERROR_NOT_SUPPORTED;\n  return ((DWORD(WINAPI*)(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,PSID*,PSID*,PACL*,PACL*,PSECURITY_DESCRIPTOR*))fp)(ON,OT,SI,ppSO,ppSG,ppD,ppS,ppSD);\n}\n\nDWORD Delayload_SetEntriesInAclA(ULONG c, PEXPLICIT_ACCESS_A pEA, PACL pOA, PACL*ppNA)\n{\n  FARPROC fp = AdvApi32_GetProcAddress(\"SetEntriesInAclA\");\n  if (!fp) return ERROR_NOT_SUPPORTED;\n  return ((DWORD(WINAPI*)(ULONG,PEXPLICIT_ACCESS_A,PACL,PACL*))fp)(c,pEA,pOA,ppNA);\n}\n\nDWORD Delayload_SetNamedSecurityInfoA(LPSTR ON, SE_OBJECT_TYPE OT, SECURITY_INFORMATION SI, PSID pSO, PSID pSG, PACL pD, PACL pS)\n{\n  FARPROC fp = AdvApi32_GetProcAddress(\"SetNamedSecurityInfoA\");\n  if (!fp) return ERROR_NOT_SUPPORTED;\n  return ((DWORD(WINAPI*)(LPSTR,SE_OBJECT_TYPE,SECURITY_INFORMATION,PSID,PSID,PACL,PACL))fp)(ON,OT,SI,pSO,pSG,pD,pS);\n}\n#endif // ~!UNICODE\n#else\nBOOL ConvertSidToStringSidNoAlloc(const PSID pSid, LPTSTR pszSid)\n{\n  LPTSTR tmp;\n  if (!ConvertSidToStringSid(pSid, &tmp)) return false;\n  lstrcpy(pszSid, tmp), LocalFree(tmp);\n  return true;\n}\n#endif // ~WINVER < 0x500\n\nstatic VOID BuildExplicitAccessWithNameT(PEXPLICIT_ACCESS pEA, LPTSTR TN, DWORD AP, ACCESS_MODE AM, DWORD Inheritance)\n{\n  TRUSTEE &t = pEA->Trustee;\n  t.pMultipleTrustee = NULL, t.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;\n  t.TrusteeForm = TRUSTEE_IS_NAME, t.TrusteeType = TRUSTEE_IS_UNKNOWN;\n  t.ptstrName = TN, pEA->grfInheritance = Inheritance;\n  pEA->grfAccessPermissions = AP, pEA->grfAccessMode = AM;\n}\n\n/*****************************************************************************\n STRING PARSERS\n *****************************************************************************/\n\n/** Converts a string into an enumeration index. If the enumeration\n ** contains the string the index of the string within the enumeration\n ** is return. On error you'll receive -1.\n **/\nstatic int ParseEnum(const TCHAR* keywords[], const TCHAR* str)\n{\n  const TCHAR** key;\n\n  for(key = keywords; *key; ++key)\n    if (!lstrcmpi(str, *key)) return (int)(key - keywords);\n\n  return -1;\n}\n\n/** Parses a trustee string. If enclosed in brackets the string contains\n ** a string SID. Otherwise it's assumed that the string contains a\n ** trustee name.\n **/\nstatic TCHAR* ParseTrustee(TCHAR* trustee, DWORD* trusteeForm)\n{\n  TCHAR* strend = trustee + lstrlen(trustee) - 1;\n\n  if (TEXT('(') == *trustee && TEXT(')') == *strend)\n  {\n    PSID pSid = NULL;\n\n    *strend = TEXT('\\0'); \n    trustee++;\n\n    if (!ConvertStringSidToSid(trustee, &pSid))\n      pSid = NULL;\n\n    *trusteeForm = TRUSTEE_IS_SID;\n    return (TCHAR*)pSid;\n  }\n\n  *trusteeForm = TRUSTEE_IS_NAME;\n  TCHAR* ret = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n  if (ret) lstrcpy(ret, trustee);\n  return ret;\n}\n\nstatic PSID ParseSid(TCHAR* trustee)\n{\n  PSID pSid = NULL;\n  TCHAR* strend = trustee + lstrlen(trustee) - 1;\n\n  if (TEXT('(') == *trustee && TEXT(')') == *strend)\n  {\n    *strend = TEXT('\\0'); \n    ++trustee;\n\n    if (!ConvertStringSidToSid(trustee, &pSid)) pSid = NULL;\n  }\n  else\n  {\n    DWORD sidLen = 0;\n    DWORD domLen = 0;\n    TCHAR* domain = NULL;\n    SID_NAME_USE use;\n\n    if ((LookupAccountName(NULL, trustee, \n       NULL, &sidLen, NULL, &domLen, &use) ||\n       ERROR_INSUFFICIENT_BUFFER == GetLastError()) &&\n        NULL != (domain = (TCHAR*)LocalAlloc(domLen*sizeof(TCHAR))) &&\n      NULL != (pSid = (PSID)LocalAlloc(sidLen)))\n    {\n      if (!LookupAccountName(NULL, trustee, \n        pSid, &sidLen, domain, &domLen, &use))\n      {\n        LocalFree(pSid);\n        pSid = NULL;\n      }\n    }\n\n    LocalFree(domain);\n  }\n\n  return pSid;\n}\n\n/* i know: this function is far to generious in accepting strings. \n * but hey: this all is about code size, isn't it? \n * so i can live with that pretty well.\n */\nstatic DWORD ParsePermissions(const SchemeType* scheme, TCHAR* str)\n{\n  DWORD perms = 0;\n  TCHAR* first, * last;\n\n  for(first = str; *first; first = last)\n  {\n    int token;\n\n    while(*first && *first <= TEXT(' ')) ++first;\n    for(last = first; *last && *last > TEXT(' ') && *last != TEXT('|') && \n      *last != TEXT('+'); ++last);\n    if (*last) *last++ = TEXT('\\0');\n\n    token = ParseEnum(scheme->permissionNames, first);\n    if (token >= 0 && token < scheme->permissionCount)\n      perms|= scheme->permissionFlags[token];\n  }\n\n  return perms;\n}\n\n/*****************************************************************************\n SYMBOL TABLES\n *****************************************************************************/\n\nstatic const TCHAR* g_filePermissionNames[] =\n{\n  TEXT(\"ReadData\"), TEXT(\"WriteData\"), TEXT(\"AppendData\"), \n  TEXT(\"ReadEA\"), TEXT(\"WriteEA\"), TEXT(\"Execute\"), TEXT(\"ReadAttributes\"), TEXT(\"WriteAttributes\"), \n  TEXT(\"Delete\"), TEXT(\"ReadControl\"), TEXT(\"WriteDAC\"), TEXT(\"WriteOwner\"), TEXT(\"Synchronize\"),\n  TEXT(\"FullAccess\"), TEXT(\"GenericRead\"), TEXT(\"GenericWrite\"), TEXT(\"GenericExecute\"), NULL\n};\n\nstatic const DWORD g_filePermissionFlags[] =\n{\n  FILE_READ_DATA, FILE_WRITE_DATA, FILE_APPEND_DATA,\n  FILE_READ_EA, FILE_WRITE_EA, FILE_EXECUTE, FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES,\n  DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE,\n  FILE_ALL_ACCESS, FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE\n};\n\nstatic const TCHAR* g_directoryPermissionNames[] =\n{\n  TEXT(\"ListDirectory\"), TEXT(\"AddFile\"), TEXT(\"AddSubdirectory\"), \n  TEXT(\"ReadEA\"), TEXT(\"WriteEA\"), TEXT(\"Traverse\"), TEXT(\"DeleteChild\"), \n  TEXT(\"ReadAttributes\"), TEXT(\"WriteAttributes\"), \n  TEXT(\"Delete\"), TEXT(\"ReadControl\"), TEXT(\"WriteDAC\"), TEXT(\"WriteOwner\"), TEXT(\"Synchronize\"),\n  TEXT(\"FullAccess\"), TEXT(\"GenericRead\"), TEXT(\"GenericWrite\"), TEXT(\"GenericExecute\"), NULL\n};\n\nstatic const DWORD g_directoryPermissionFlags[] =\n{\n  FILE_LIST_DIRECTORY, FILE_ADD_FILE, FILE_ADD_SUBDIRECTORY,\n  FILE_READ_EA, FILE_WRITE_EA, FILE_TRAVERSE, FILE_DELETE_CHILD,\n  FILE_READ_ATTRIBUTES, FILE_WRITE_ATTRIBUTES,\n  DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE,\n  FILE_ALL_ACCESS, FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE\n};\n\nstatic const TCHAR* g_registryPermissionNames[] =\n{\n  TEXT(\"QueryValue\"), TEXT(\"SetValue\"), TEXT(\"CreateSubKey\"), \n  TEXT(\"EnumerateSubKeys\"), TEXT(\"Notify\"), TEXT(\"CreateLink\"), \n  TEXT(\"Delete\"), TEXT(\"ReadControl\"), TEXT(\"WriteDAC\"), TEXT(\"WriteOwner\"), TEXT(\"Synchronize\"),\n  TEXT(\"GenericRead\"), TEXT(\"GenericWrite\"), TEXT(\"GenericExecute\"), TEXT(\"FullAccess\"), NULL\n};\n\nstatic const DWORD g_registryPermissionFlags[] =\n{\n  KEY_QUERY_VALUE, KEY_SET_VALUE, KEY_CREATE_SUB_KEY, \n  KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, KEY_CREATE_LINK, \n  DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE,\n  KEY_READ, KEY_WRITE, KEY_EXECUTE, KEY_ALL_ACCESS\n};\n\nstatic const SchemeType g_fileScheme[] =\n{\n  TEXT(\"file\"), SE_FILE_OBJECT,\n  OBJECT_INHERIT_ACE,\n  g_filePermissionNames, \n  g_filePermissionFlags,\n  SIZE_OF_ARRAY(g_filePermissionFlags)\n};\n\nstatic const SchemeType g_directoryScheme[] =\n{\n  TEXT(\"directory\"), SE_FILE_OBJECT,\n  OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE,\n  g_directoryPermissionNames, \n  g_directoryPermissionFlags,\n  SIZE_OF_ARRAY(g_directoryPermissionFlags)\n};\n\nstatic const SchemeType g_registryScheme[] =\n{ \n  TEXT(\"registry\"), SE_REGISTRY_KEY,\n  CONTAINER_INHERIT_ACE,\n  g_registryPermissionNames, \n  g_registryPermissionFlags,\n  SIZE_OF_ARRAY(g_registryPermissionFlags)\n};\n\nstatic const TCHAR* g_rootKeyNames[] =\n{\n  TEXT(\"HKCR\"), TEXT(\"HKCU\"), TEXT(\"HKLM\"), TEXT(\"HKU\"), NULL\n};\n\nstatic const HKEY g_rootKeyValues[] =\n{\n  HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, NULL\n};\n\nstatic const TCHAR* g_rootKeyPrefixes[] =\n{\n  TEXT(\"CLASSES_ROOT\\\\\"), TEXT(\"CURRENT_USER\\\\\"), TEXT(\"MACHINE\\\\\"), TEXT(\"USERS\\\\\")\n};\n\n/*****************************************************************************\n GENERIC ACL HANDLING\n *****************************************************************************/\n\nstatic DWORD MySetNamedSecurityInfo(const SchemeType* scheme, TCHAR* path, SECURITY_INFORMATION si, PSID psidOwner, PSID psidGroup, PACL pDacl, Options* options)\n{\n  DWORD ret;\n\n  if (scheme->type == SE_REGISTRY_KEY && (g_extra->exec_flags->alter_reg_view & KEY_WOW64_64KEY))\n  {\n    HKEY hKey = NULL;\n    if ((ret = RegOpenKeyEx(options->hRootKey, path, 0, (si & OWNER_SECURITY_INFORMATION || si & GROUP_SECURITY_INFORMATION ? WRITE_OWNER : 0)|(si & DACL_SECURITY_INFORMATION ? WRITE_DAC : 0)|KEY_WOW64_64KEY, &hKey)) == ERROR_SUCCESS)\n    {\n      SECURITY_DESCRIPTOR sd;\n      InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);\n      if (si & OWNER_SECURITY_INFORMATION)\n        SetSecurityDescriptorOwner(&sd, psidOwner, FALSE);\n      if (si & GROUP_SECURITY_INFORMATION)\n        SetSecurityDescriptorGroup(&sd, psidGroup, FALSE);\n      if (si & DACL_SECURITY_INFORMATION)\n        SetSecurityDescriptorDacl(&sd, TRUE, pDacl, FALSE);\n      ret = RegSetKeySecurity(hKey, si, &sd);\n      RegCloseKey(hKey);\n    }\n  }\n  else\n  {\n    ret = SetNamedSecurityInfo(path, scheme->type, si, psidOwner, psidGroup, pDacl, NULL);\n  }\n\n  return ret;\n}\n\nstatic DWORD MyGetNamedSecurityInfo(const SchemeType* scheme, TCHAR* path, SECURITY_INFORMATION si, PSECURITY_DESCRIPTOR* ppsd, Options* options)\n{\n  DWORD ret = 1;\n  \n  if (scheme->type == SE_REGISTRY_KEY && (g_extra->exec_flags->alter_reg_view & KEY_WOW64_64KEY))\n  {\n    HKEY hKey = NULL;\n    if ((ret = RegOpenKeyEx(options->hRootKey, path, 0, READ_CONTROL|KEY_WOW64_64KEY, &hKey)) == ERROR_SUCCESS)\n    {\n      DWORD dwSize = 0;\n      if ((ret = RegGetKeySecurity(hKey, si, NULL, &dwSize)) == ERROR_INSUFFICIENT_BUFFER)\n        if (NULL != (*ppsd = (PSECURITY_DESCRIPTOR)LocalAlloc(dwSize)))\n          ret = RegGetKeySecurity(hKey, si, *ppsd, &dwSize);\n      RegCloseKey(hKey);\n    }\n  }\n  else\n  {\n    ret = GetNamedSecurityInfo(path, scheme->type, si, NULL, NULL, NULL, NULL, ppsd);\n  }\n\n  return ret;\n}\n\nstatic DWORD ChangeDACL(const SchemeType* scheme, TCHAR* path, DWORD mode, Options* options, TCHAR* param)\n{\n  TCHAR* trusteeName = NULL;\n  PSECURITY_DESCRIPTOR psd = NULL;\n  PSID pSid = NULL;\n  DWORD trusteeForm = TRUSTEE_IS_NAME;\n  DWORD permissions = 0;\n  PACL pOldAcl = NULL;\n  PACL pNewAcl = NULL;\n  EXPLICIT_ACCESS access;\n  BOOL present = TRUE;\n  BOOL defaulted = FALSE;\n\n  DWORD ret = 1;\n\n  if (popstring(param))\n    ABORT(\"Trustee is missing\");\n\n  if (NULL == (trusteeName = ParseTrustee(param, &trusteeForm)))\n    ABORT_s(\"Bad trustee (%s)\", param);\n\n  if (popstring(param))\n    ABORT(\"Permission flags are missing\");\n\n  if (0 == (permissions = ParsePermissions(scheme, param)))\n    ABORT_s(\"Bad permission flags (%s)\", param);\n  \n  ret = MyGetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, &psd, options);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot read access control list. Error code: %d\", ret);\n\n  GetSecurityDescriptorDacl(psd, &present, &pOldAcl, &defaulted);\n\n  BuildExplicitAccessWithName(&access, TEXT(\"\"), permissions, (ACCESS_MODE)mode, scheme->defaultInheritance);\n\n  access.Trustee.TrusteeForm = (TRUSTEE_FORM)trusteeForm;\n  access.Trustee.ptstrName = trusteeName;\n  if (options->noInherit)\n    access.grfInheritance = NO_INHERITANCE;\n\n  ret = SetEntriesInAcl(1, &access, pOldAcl, &pNewAcl);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot build new access control list. Error code: %d\", ret);\n\n  ret = MySetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, NULL, NULL, pNewAcl, options);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot apply new access control list. Error code: %d\", ret);\n\ncleanup:\n  LocalFree(pNewAcl);\n  LocalFree(psd);\n  LocalFree(trusteeName);\n  return ret;\n}\n\nstatic DWORD ChangeInheritance(const SchemeType* scheme, TCHAR* path, Options* options)\n{\n  PSECURITY_DESCRIPTOR psd = NULL;\n  PACL pOldAcl = NULL;\n  BOOL present = TRUE;\n  BOOL defaulted = FALSE;\n\n  DWORD ret = MyGetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, &psd, options);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot read access control list. Error code: %d\", ret);\n\n  GetSecurityDescriptorDacl(psd, &present, &pOldAcl, &defaulted);\n  \n  ret = MySetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION | (!options->noInherit ? UNPROTECTED_DACL_SECURITY_INFORMATION : PROTECTED_DACL_SECURITY_INFORMATION), NULL, NULL, pOldAcl, options);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot change access control list inheritance. Error code: %d\", ret);\n\ncleanup:\n  LocalFree(psd);\n  return ret;\n}\n\nBOOL SetPrivilege(HANDLE hToken, LPCTSTR lpszPrivilege, BOOL bEnablePrivilege) \n{\n  TOKEN_PRIVILEGES tp;\n  LUID luid;\n\n  if (!LookupPrivilegeValue(NULL, lpszPrivilege, &luid))\n    return FALSE;\n\n  tp.PrivilegeCount = 1;\n  tp.Privileges[0].Luid = luid;\n  tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);\n\n  if (!AdjustTokenPrivileges(\n         hToken,\n         FALSE,\n         &tp,\n         sizeof(TOKEN_PRIVILEGES),\n         (PTOKEN_PRIVILEGES)NULL,\n         (PDWORD)NULL))\n    return FALSE;\n\n  if (GetLastError() == ERROR_NOT_ALL_ASSIGNED)\n    return FALSE;\n\n  return TRUE;\n}\n\nstatic DWORD ChangeOwner(const SchemeType* scheme, TCHAR* path, ChangeMode mode, Options* options, TCHAR* param)\n{\n  DWORD ret = 1;\n  PSID pSid = NULL, pSidOwner = NULL, pSidGroup = NULL;\n  SECURITY_INFORMATION what;\n  HANDLE hToken;\n\n  if (popstring(param))\n    ABORT(\"Trustee is missing\");\n\n  if (NULL == (pSid = ParseSid(param)))\n    ABORT_s(\"Bad trustee (%s)\", param);\n\n  switch(mode)\n  {\n  case ChangeMode_Owner:\n    what = OWNER_SECURITY_INFORMATION;\n    pSidOwner = pSid;\n    break;\n\n  case ChangeMode_Group:\n    what = GROUP_SECURITY_INFORMATION;\n    pSidGroup = pSid;\n    break;\n\n  default:\n    ABORT_d(\"Bug: Unsupported change mode: %d\", mode);\n  }\n\n  if (!OpenProcessToken(GetCurrentProcess(),\n    TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))\n    ABORT_d(\"Cannot open process token. Error code: %d\", GetLastError());\n\n  // You only need WRITE_OWNER to change the owner of the object to yourself\n  // blogs.msdn.com/b/oldnewthing/archive/2005/08/18/453054.aspx\n  BOOL privRe = SetPrivilege(hToken, SE_RESTORE_NAME, TRUE);\n  BOOL privTO = SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, TRUE);\n\n  ret = MySetNamedSecurityInfo(scheme, path, what, pSidOwner, pSidGroup, NULL, options);\n\n  if (privRe) SetPrivilege(hToken, SE_RESTORE_NAME, FALSE);\n  if (privTO) SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, FALSE);\n\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot apply new ownership. Error code: %d\", ret);\n\ncleanup:\n  LocalFree(pSid);\n  CloseHandle(hToken);\n  return ret;\n}\n\nstatic DWORD GetOwner(const SchemeType* scheme, TCHAR* path, ChangeMode mode, TCHAR* owner, TCHAR* domain, Options* options)\n{\n  SECURITY_INFORMATION what;\n  PSECURITY_DESCRIPTOR psd = NULL;\n  PSID pSid = NULL, pSidGroup = NULL, pSidOwner = NULL;\n  SID_NAME_USE eUse = SidTypeUnknown;\n  DWORD dwOwner = g_string_size, dwDomain = g_string_size;\n  BOOL defaulted = FALSE;\n  DWORD ret = 1;\n\n  switch(mode)\n  {\n  case ChangeMode_Owner:\n    what = OWNER_SECURITY_INFORMATION;\n    break;\n\n  case ChangeMode_Group:\n    what = GROUP_SECURITY_INFORMATION;\n    break;\n\n  default:\n    ABORT_d(\"Bug: Unsupported change mode: %d\", mode);\n  }\n  \n  ret = MyGetNamedSecurityInfo(scheme, path, what, &psd, options);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot get current ownership. Error code: %d\", ret);\n\n  if (mode == OWNER_SECURITY_INFORMATION)\n    GetSecurityDescriptorOwner(psd, &pSidOwner, &defaulted);\n  else\n    GetSecurityDescriptorGroup(psd, &pSidGroup, &defaulted);\n\n  if (!LookupAccountSid(NULL, (pSidOwner ? pSidOwner : pSidGroup),\n          owner, &dwOwner, domain, &dwDomain, &eUse))\n    ABORT_d(\"Cannot look up owner. Error code: %d\", GetLastError());\n\ncleanup:\n  LocalFree(psd);\n  return ret;\n}\n\nstatic DWORD ClearACL(const SchemeType* scheme, TCHAR* path, Options* options, TCHAR* param)\n{\n  TCHAR* trusteeName = NULL;\n  PSID pSid = NULL;\n  DWORD trusteeForm = TRUSTEE_IS_NAME;\n  DWORD permissions = 0;\n  PACL pNewAcl = NULL;\n  EXPLICIT_ACCESS access;\n\n  DWORD ret = 1;\n\n  if (popstring(param))\n    ABORT(\"Trustee is missing\");\n\n  if (NULL == (trusteeName = ParseTrustee(param, &trusteeForm)))\n    ABORT_s(\"Bad trustee (%s)\", param);\n\n  if (popstring(param))\n    ABORT(\"Permission flags are missing\");\n\n  if (0 == (permissions = ParsePermissions(scheme, param)))\n    ABORT_s(\"Bad permission flags (%s)\", param);\n\n  BuildExplicitAccessWithName(&access, TEXT(\"\"), permissions, SET_ACCESS, scheme->defaultInheritance);\n\n  access.Trustee.TrusteeForm = (TRUSTEE_FORM)trusteeForm;\n  access.Trustee.ptstrName = trusteeName;\n  if (options->noInherit)\n    access.grfInheritance = NO_INHERITANCE;\n\n  ret = SetEntriesInAcl(1, &access, NULL, &pNewAcl);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot build new access control list. Error code: %d\", ret);\n  \n  ret = MySetNamedSecurityInfo(scheme, path, DACL_SECURITY_INFORMATION, NULL, NULL, pNewAcl, options);\n  if (ret != ERROR_SUCCESS)\n    ABORT_d(\"Cannot change access control list inheritance. Error code: %d\", ret);\n\ncleanup:\n  LocalFree(pNewAcl);\n  LocalFree(trusteeName);\n  return ret;\n}\n\n/*****************************************************************************\n FILESYSTEM BASED ACL HANDLING\n *****************************************************************************/\n\nstatic const SchemeType* PopFileArgs(TCHAR* path, Options* options)\n{\n  if (popstring(path) == 0)\n  {\n    DWORD attr;\n    options->noInherit = FALSE;\n    if (lstrcmpi(path, TEXT(\"/noinherit\")) == 0)\n    {\n      options->noInherit = TRUE;\n      popstring(path);\n    }\n    attr = GetFileAttributes(path);\n\n    if (INVALID_FILE_ATTRIBUTES != attr)\n      return FILE_ATTRIBUTE_DIRECTORY & attr\n        ? g_directoryScheme\n        : g_fileScheme;\n    else\n      ABORT(\"Invalid filesystem path missing\");\n  }\n  else\n    ABORT(\"Filesystem path missing\");\n\ncleanup:\n  return NULL;\n}\n\nstatic void ChangeFileInheritance(BOOL inherit)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    const SchemeType* scheme;\n    Options options;\n\n    if (NULL != (scheme = PopFileArgs(path, &options)))\n    {\n        options.noInherit = !inherit;\n        if (0 == (ret = ChangeInheritance(scheme, path, &options)))\n          pushstring(TEXT(\"ok\"));\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\nstatic void ChangeFileDACL(DWORD mode)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n    if (param)\n    {\n      const SchemeType* scheme;\n      Options options;\n\n      if (NULL != (scheme = PopFileArgs(path, &options)))\n        if (0 == (ret = ChangeDACL(scheme, path, mode, &options, param)))\n          pushstring(TEXT(\"ok\"));\n\n      LocalFree(param);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\nstatic void ChangeFileOwner(ChangeMode mode)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n    if (param)\n    {\n      const SchemeType* scheme;\n      Options options;\n\n      if (NULL != (scheme = PopFileArgs(path, &options)))\n        if (0 == (ret = ChangeOwner(scheme, path, mode, &options, param)))\n          pushstring(TEXT(\"ok\"));\n    \n      LocalFree(param);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\nstatic void PushFileOwner(ChangeMode mode)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* owner = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n    if (owner)\n    {\n      TCHAR* domain = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n      if (domain)\n      {\n        const SchemeType* scheme;\n        Options options;\n\n        if (NULL != (scheme = PopFileArgs(path, &options)))\n        {\n          if (0 == (ret = GetOwner(scheme, path, mode, owner, domain, &options)))\n            pushstring(owner);\n        }\n      \n        LocalFree(domain);\n      }\n      \n      LocalFree(owner);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\n/*****************************************************************************\n REGISTRY BASED ACL HANDLING\n *****************************************************************************/\n\nstatic BOOL PopRegKeyArgs(TCHAR* path, Options* options, TCHAR* param)\n{\n  int iRootKey;\n  BOOL success = FALSE;\n\n  if (popstring(param) == 0)\n  {\n    options->noInherit = FALSE;\n    if (lstrcmpi(param, TEXT(\"/noinherit\")) == 0)\n    {\n      options->noInherit = TRUE;\n      popstring(param);\n    }\n  }\n  else\n    ABORT(\"Root key name missing\");\n\n  iRootKey = ParseEnum(g_rootKeyNames, param);\n  if (!ARRAY_CONTAINS(g_rootKeyPrefixes, iRootKey))\n    ABORT_s(\"Bad root key name (%s)\", param);\n\n  if (popstring(param) != 0)\n    ABORT(\"Registry key name missing\");\n\n  if (g_extra->exec_flags->alter_reg_view & KEY_WOW64_64KEY)\n  {\n    options->hRootKey = g_rootKeyValues[iRootKey];\n    lstrcpy(path, param);\n  }\n  else\n  {\n    lstrcpy(path, g_rootKeyPrefixes[iRootKey]);\n    lstrcat(path, param);\n  }\n\n  success = TRUE;\n\ncleanup:\n  return success;\n}\n\nstatic void ChangeRegKeyInheritance(BOOL inherit)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n    if (param)\n    {\n      Options options;\n\n      if (PopRegKeyArgs(path, &options, param))\n      {\n        options.noInherit = !inherit;\n        if (0 == (ret = ChangeInheritance(g_registryScheme, path, &options)))\n          pushstring(TEXT(\"ok\"));\n      }\n\n      LocalFree(param);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\nstatic void ChangeRegKeyDACL(DWORD mode)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n    if (param)\n    {\n      Options options;\n\n      if (PopRegKeyArgs(path, &options, param))\n        if (0 == (ret = ChangeDACL(g_registryScheme, path, mode, &options, param)))\n          pushstring(TEXT(\"ok\"));\n\n      LocalFree(param);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\nstatic void ChangeRegKeyOwner(ChangeMode mode)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* param = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n    if (param)\n    {\n      Options options;\n\n      if (PopRegKeyArgs(path, &options, param))\n        if (0 == (ret = ChangeOwner(g_registryScheme, path, mode, &options, param)))\n          pushstring(TEXT(\"ok\"));\n\n      LocalFree(param);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\nstatic void PushRegKeyOwner(ChangeMode mode)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* owner = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n    if (owner)\n    {\n      TCHAR* domain = (TCHAR*)LocalAlloc(g_string_size*sizeof(TCHAR));\n\n      if (domain)\n      {\n        Options options;\n\n        if (PopRegKeyArgs(path, &options, owner))\n          if (0 == (ret = GetOwner(g_registryScheme, path, mode, owner, domain, &options)))\n            pushstring(owner);\n\n        LocalFree(domain);\n      }\n\n      LocalFree(owner);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\n\n/*****************************************************************************\n PUBLIC FILE RELATED FUNCTIONS\n *****************************************************************************/\n\nPUBLIC_FUNCTION(EnableFileInheritance)\n  ChangeFileInheritance(TRUE);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(DisableFileInheritance)\n  ChangeFileInheritance(FALSE);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(GrantOnFile)\n  ChangeFileDACL(GRANT_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(SetOnFile)\n  ChangeFileDACL(SET_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(DenyOnFile)\n  ChangeFileDACL(DENY_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(RevokeOnFile)\n  ChangeFileDACL(REVOKE_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(SetFileOwner)\n  ChangeFileOwner(ChangeMode_Owner);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(SetFileGroup)\n  ChangeFileOwner(ChangeMode_Group);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(GetFileOwner)\n  PushFileOwner(ChangeMode_Owner);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(GetFileGroup)\n  PushFileOwner(ChangeMode_Group);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(ClearOnFile)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));\n    \n    if (param)\n    {\n      const SchemeType* scheme;\n      Options options;\n\n      if (NULL != (scheme = PopFileArgs(path, &options)))\n        if (0 == (ret = ClearACL(scheme, path, &options, param)))\n          pushstring(TEXT(\"ok\"));\n\n      LocalFree(param);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\nPUBLIC_FUNCTION_END\n\n/*****************************************************************************\n PUBLIC REGISTRY RELATED FUNCTIONS\n *****************************************************************************/\n\nPUBLIC_FUNCTION(EnableRegKeyInheritance)\n  ChangeRegKeyInheritance(TRUE);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(DisableRegKeyInheritance)\n  ChangeRegKeyInheritance(FALSE);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(GrantOnRegKey)\n  ChangeRegKeyDACL(GRANT_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(SetOnRegKey)\n  ChangeRegKeyDACL(SET_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(DenyOnRegKey)\n  ChangeRegKeyDACL(DENY_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(RevokeOnRegKey)\n  ChangeRegKeyDACL(REVOKE_ACCESS);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(SetRegKeyOwner)\n  ChangeRegKeyOwner(ChangeMode_Owner);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(SetRegKeyGroup)\n  ChangeRegKeyOwner(ChangeMode_Group);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(GetRegKeyOwner)\n  PushRegKeyOwner(ChangeMode_Owner);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(GetRegKeyGroup)\n  PushRegKeyOwner(ChangeMode_Group);\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(ClearOnRegKey)\n{\n  DWORD ret = 1;\n  TCHAR* path = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));\n\n  if (path)\n  {\n    TCHAR* param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));\n\n    if (param)\n    {\n      Options options;\n\n      if (PopRegKeyArgs(path, &options, param))\n        if (0 == (ret = ClearACL(g_registryScheme, path, &options, param)))\n          pushstring(TEXT(\"ok\"));\n\n      LocalFree(param);\n    }\n\n    LocalFree(path);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\nPUBLIC_FUNCTION_END\n\n/*****************************************************************************\n OTHER ACCOUNT RELATED FUNCTIONS\n *****************************************************************************/\n\nPUBLIC_FUNCTION(NameToSid)\n{\n  DWORD ret = 1;\n  TCHAR *param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR)), *retstr = ERRSTR_OOM;\n\n  if (param)\n  {\n    if (popstring(param) == 0)\n    {\n      DWORD dwSid = 0;\n      DWORD dwDomain = 0;\n      SID_NAME_USE eUse;\n      LookupAccountName(NULL, param, NULL, &dwSid, NULL, &dwDomain, &eUse);\n\n      if (dwSid > 0)\n      {\n        PSID pSid = (PSID)LocalAlloc(dwSid);\n        if (pSid)\n        {\n          TCHAR* domain = (TCHAR*)LocalAlloc(dwDomain*sizeof(TCHAR));\n          if (domain)\n          {\n            retstr = param;\n            if (!LookupAccountName(NULL, param, pSid, &dwSid, domain, &dwDomain, &eUse) || !ConvertSidToStringSidNoAlloc(pSid, param))\n              wsprintf(param, TEXT(\"Cannot look up name. Error code: %d\"), GetLastError());\n            else\n              ret = 0;\n            LocalFree(domain);\n          }\n          LocalFree(pSid);\n        }\n      }\n    }\n  }\n  pushstring(retstr);\n  LocalFree(param);\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(SidToName)\n{\n  DWORD ret = 1;\n  TCHAR *param = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR));\n\n  if (param)\n  {\n    DWORD dwName = string_size;\n    TCHAR* name = (TCHAR*)LocalAlloc(dwName*sizeof(TCHAR));\n\n    if (name)\n    {\n      DWORD dwDomain = string_size;\n      TCHAR* domain = (TCHAR*)LocalAlloc(dwDomain*sizeof(TCHAR));\n\n      if (domain)\n      {\n        if (popstring(param) == 0)\n        {\n          PSID pSid = NULL;\n          SID_NAME_USE eUse;\n          if (!ConvertStringSidToSid(param, &pSid) || !LookupAccountSid(NULL, pSid, name, &dwName, domain, &dwDomain, &eUse))\n          {\n            wsprintf(param, TEXT(\"Cannot look up SID. Error code: %d\"), GetLastError());\n            pushstring(param); // BUGBUG: What if LocalAlloc fails and we never get here?\n          }\n          else\n          {\n            pushstring(name);\n            pushstring(domain);\n            ret = 0;\n          }\n          LocalFree(pSid);\n        }\n        LocalFree(domain);\n      }\n      LocalFree(name);\n    }\n    LocalFree(param);\n  }\n\n  if (ret) pushstring(TEXT(\"error\"));\n}\nPUBLIC_FUNCTION_END\n\nPUBLIC_FUNCTION(GetCurrentUserName)\n{\n  TCHAR *name = (TCHAR*)LocalAlloc(string_size*sizeof(TCHAR)), *retstr = TEXT(\"error\");\n  DWORD dwName = string_size;\n  if (name && GetUserName(name, &dwName)) retstr = name;\n  pushstring(retstr);\n  LocalFree(name);\n}\nPUBLIC_FUNCTION_END\n\n#ifdef _VC_NODEFAULTLIB\n#define DllMain _DllMainCRTStartup\n#endif\nEXTERN_C BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)\n{\n  g_hInstance = (HINSTANCE)hInst;\n  return TRUE;\n}"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/AccessControl.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"AccessControl\", \"AccessControl.vcxproj\", \"{FA391322-C61F-4CC4-A421-432A0C3D5342}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tRelease Unicode|Win32 = Release Unicode|Win32\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{FA391322-C61F-4CC4-A421-432A0C3D5342}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{FA391322-C61F-4CC4-A421-432A0C3D5342}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32\n\t\t{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release Unicode|Win32.Build.0 = Release Unicode|Win32\n\t\t{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{FA391322-C61F-4CC4-A421-432A0C3D5342}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/AccessControl.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release Unicode|Win32\">\n      <Configuration>Release Unicode</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{FA391322-C61F-4CC4-A421-432A0C3D5342}</ProjectGuid>\n    <RootNamespace>AccessControl</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>MultiByte</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseOfMfc>false</UseOfMfc>\n    <CharacterSet>MultiByte</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\..\\Plugins\\</OutDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</LinkIncremental>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</GenerateManifest>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</GenerateManifest>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">$(SolutionDir)..\\..\\Unicode\\Plugins\\</OutDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">false</LinkIncremental>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">false</GenerateManifest>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\..\\Plugins\\</OutDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Midl>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <TargetEnvironment>Win32</TargetEnvironment>\n      <TypeLibraryName>.\\Debug/AccessControl.tlb</TypeLibraryName>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>_WIN32_WINNT=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <PrecompiledHeaderOutputFile>.\\Debug/AccessControl.pch</PrecompiledHeaderOutputFile>\n      <WarningLevel>Level3</WarningLevel>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <TargetMachine>MachineX86</TargetMachine>\n      <AdditionalDependencies>nsis_ansi/pluginapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <Optimization>MinSpace</Optimization>\n      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\n      <OmitFramePointers>false</OmitFramePointers>\n      <PreprocessorDefinitions>_WIN32_WINNT=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <StringPooling>true</StringPooling>\n      <ExceptionHandling>Sync</ExceptionHandling>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <DisableLanguageExtensions>false</DisableLanguageExtensions>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <PrecompiledHeaderOutputFile>.\\Release/AccessControl.pch</PrecompiledHeaderOutputFile>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>\n      </DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalDependencies>advapi32.lib;nsis_ansi/pluginapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <GenerateDebugInformation>false</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <OptimizeReferences>true</OptimizeReferences>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">\n    <ClCompile>\n      <Optimization>MinSpace</Optimization>\n      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n      <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>\n      <OmitFramePointers>false</OmitFramePointers>\n      <PreprocessorDefinitions>_WIN32_WINNT=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <StringPooling>true</StringPooling>\n      <ExceptionHandling>Sync</ExceptionHandling>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <DisableLanguageExtensions>false</DisableLanguageExtensions>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <PrecompiledHeaderOutputFile>.\\Release/AccessControl.pch</PrecompiledHeaderOutputFile>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>\n      </DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalDependencies>advapi32.lib;nsis_unicode/pluginapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <GenerateDebugInformation>false</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <OptimizeReferences>true</OptimizeReferences>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"AccessControl.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\ExDLL\\exdll.h\" />\n    <ClInclude Include=\"resource.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"AccessControl.rc\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/nsis_ansi/api.h",
    "content": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2009 Nullsoft and Contributors\n * \n * Licensed under the zlib/libpng license (the \"License\");\n * you may not use this file except in compliance with the License.\n * \n * Licence details can be found in the file COPYING.\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n */\n\n#ifndef _NSIS_EXEHEAD_API_H_\n#define _NSIS_EXEHEAD_API_H_\n\n// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version\n// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))\n// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}\n\n#define NSISPIAPIVER_1_0 0x00010000\n#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0\n\n// NSIS Plug-In Callback Messages\nenum NSPIM \n{\n\tNSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup\n\tNSPIM_GUIUNLOAD, // Called after .onGUIEnd\n};\n\n// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()\n// Return NULL for unknown messages\n// Should always be __cdecl for future expansion possibilities\ntypedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);\n\n// extra_parameters data structures containing other interesting stuff\n// but the stack, variables and HWND passed on to plug-ins.\ntypedef struct\n{\n  int autoclose;\n  int all_user_var;\n  int exec_error;\n  int abort;\n  int exec_reboot; // NSIS_SUPPORT_REBOOT\n  int reboot_called; // NSIS_SUPPORT_REBOOT\n  int XXX_cur_insttype; // depreacted\n  int plugin_api_version; // see NSISPIAPIVER_CURR\n                          // used to be XXX_insttype_changed\n  int silent; // NSIS_CONFIG_SILENT_SUPPORT\n  int instdir_error;\n  int rtl;\n  int errlvl;\n  int alter_reg_view;\n  int status_update;\n} exec_flags_t;\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\ntypedef struct {\n  exec_flags_t *exec_flags;\n  int (NSISCALL *ExecuteCodeSegment)(int, HWND);\n  void (NSISCALL *validate_filename)(char *);\n  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors\n} extra_parameters;\n\n// Definitions for page showing plug-ins\n// See Ui.c to understand better how they're used\n\n// sent to the outer window to tell it to go to the next inner window\n#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)\n\n// custom pages should send this message to let NSIS know they're ready\n#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)\n\n// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning\n#define NOTIFY_BYE_BYE 'x'\n\n#endif /* _PLUGIN_H_ */\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/nsis_ansi/pluginapi.h",
    "content": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\n#define EXDLL_INIT()           {  \\\n        g_stringsize=string_size; \\\n        g_stacktop=stacktop;      \\\n        g_variables=variables; }\n\ntypedef struct _stack_t {\n  struct _stack_t *next;\n  char text[1]; // this should be the length of string_size\n} stack_t;\n\nenum\n{\nINST_0,         // $0\nINST_1,         // $1\nINST_2,         // $2\nINST_3,         // $3\nINST_4,         // $4\nINST_5,         // $5\nINST_6,         // $6\nINST_7,         // $7\nINST_8,         // $8\nINST_9,         // $9\nINST_R0,        // $R0\nINST_R1,        // $R1\nINST_R2,        // $R2\nINST_R3,        // $R3\nINST_R4,        // $R4\nINST_R5,        // $R5\nINST_R6,        // $R6\nINST_R7,        // $R7\nINST_R8,        // $R8\nINST_R9,        // $R9\nINST_CMDLINE,   // $CMDLINE\nINST_INSTDIR,   // $INSTDIR\nINST_OUTDIR,    // $OUTDIR\nINST_EXEDIR,    // $EXEDIR\nINST_LANG,      // $LANGUAGE\n__INST_LAST\n};\n\nextern unsigned int g_stringsize;\nextern stack_t **g_stacktop;\nextern char *g_variables;\n\nint NSISCALL popstring(char *str); // 0 on success, 1 on empty stack\nint NSISCALL popstringn(char *str, int maxlen); // with length limit, pass 0 for g_stringsize\nint NSISCALL popint(); // pops an integer\nint NSISCALL popint_or(); // with support for or'ing (2|4|8)\nint NSISCALL myatoi(const char *s); // converts a string to an integer\nunsigned NSISCALL myatou(const char *s); // converts a string to an unsigned integer, decimal only\nint NSISCALL myatoi_or(const char *s); // with support for or'ing (2|4|8)\nvoid NSISCALL pushstring(const char *str);\nvoid NSISCALL pushint(int value);\nchar * NSISCALL getuservariable(const int varnum);\nvoid NSISCALL setuservariable(const int varnum, const char *var);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif//!___NSIS_PLUGIN__H___\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/nsis_unicode/api.h",
    "content": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2009 Nullsoft and Contributors\n * \n * Licensed under the zlib/libpng license (the \"License\");\n * you may not use this file except in compliance with the License.\n * \n * Licence details can be found in the file COPYING.\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n */\n\n#ifndef _NSIS_EXEHEAD_API_H_\n#define _NSIS_EXEHEAD_API_H_\n\n// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version\n// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))\n// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}\n\n#define NSISPIAPIVER_1_0 0x00010000\n#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0\n\n// NSIS Plug-In Callback Messages\nenum NSPIM \n{\n\tNSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup\n\tNSPIM_GUIUNLOAD, // Called after .onGUIEnd\n};\n\n// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()\n// Return NULL for unknown messages\n// Should always be __cdecl for future expansion possibilities\ntypedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);\n\n// extra_parameters data structures containing other interesting stuff\n// but the stack, variables and HWND passed on to plug-ins.\ntypedef struct\n{\n  int autoclose;\n  int all_user_var;\n  int exec_error;\n  int abort;\n  int exec_reboot; // NSIS_SUPPORT_REBOOT\n  int reboot_called; // NSIS_SUPPORT_REBOOT\n  int XXX_cur_insttype; // depreacted\n  int plugin_api_version; // see NSISPIAPIVER_CURR\n                          // used to be XXX_insttype_changed\n  int silent; // NSIS_CONFIG_SILENT_SUPPORT\n  int instdir_error;\n  int rtl;\n  int errlvl;\n  int alter_reg_view;\n  int status_update;\n} exec_flags_t;\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\ntypedef struct {\n  exec_flags_t *exec_flags;\n  int (NSISCALL *ExecuteCodeSegment)(int, HWND);\n  void (NSISCALL *validate_filename)(TCHAR *);\n  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors\n} extra_parameters;\n\n// Definitions for page showing plug-ins\n// See Ui.c to understand better how they're used\n\n// sent to the outer window to tell it to go to the next inner window\n#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)\n\n// custom pages should send this message to let NSIS know they're ready\n#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)\n\n// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning\n#define NOTIFY_BYE_BYE 'x'\n\n#endif /* _PLUGIN_H_ */\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/nsis_unicode/nsis_tchar.h",
    "content": "/*\n * nsis_tchar.h\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2007 Nullsoft and Contributors\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n *\n * For Unicode support by Jim Park -- 08/30/2007\n */\n\n// Jim Park: Only those we use are listed here.\n\n#pragma once\n\n#ifdef _UNICODE\n\n#ifndef _T\n#define __T(x)   L ## x\n#define _T(x)    __T(x)\n#define _TEXT(x) __T(x)\n#endif\ntypedef wchar_t TCHAR;\ntypedef wchar_t _TUCHAR;\n\n// program\n#define _tmain      wmain\n#define _tWinMain   wWinMain\n#define _tenviron   _wenviron\n#define __targv     __wargv\n\n// printfs\n#define _ftprintf   fwprintf\n#define _sntprintf  _snwprintf\n#define _stprintf   _swprintf\n#define _tprintf    wprintf\n#define _vftprintf  vfwprintf\n#define _vsntprintf _vsnwprintf\n#define _vstprintf  _vswprintf\n\n// scanfs\n#define _tscanf     wscanf\n#define _stscanf    swscanf\n\n// string manipulations\n#define _tcscat     wcscat\n#define _tcschr     wcschr\n#define _tcsclen    wcslen\n#define _tcscpy     wcscpy\n#define _tcsdup     _wcsdup\n#define _tcslen     wcslen\n#define _tcsnccpy   wcsncpy\n#define _tcsncpy    wcsncpy\n#define _tcsrchr    wcsrchr\n#define _tcsstr     wcsstr\n#define _tcstok     wcstok\n\n// string comparisons\n#define _tcscmp     wcscmp\n#define _tcsicmp    _wcsicmp\n#define _tcsncicmp  _wcsnicmp\n#define _tcsncmp    wcsncmp\n#define _tcsnicmp   _wcsnicmp\n\n// upper / lower\n#define _tcslwr     _wcslwr\n#define _tcsupr     _wcsupr\n#define _totlower   towlower\n#define _totupper   towupper\n\n// conversions to numbers\n#define _tcstoi64   _wcstoi64\n#define _tcstol     wcstol\n#define _tcstoul    wcstoul\n#define _tstof      _wtof\n#define _tstoi      _wtoi\n#define _tstoi64    _wtoi64\n#define _ttoi       _wtoi\n#define _ttoi64     _wtoi64\n#define _ttol       _wtol\n\n// conversion from numbers to strings\n#define _itot       _itow\n#define _ltot       _ltow\n#define _i64tot     _i64tow\n#define _ui64tot    _ui64tow\n\n// file manipulations\n#define _tfopen     _wfopen\n#define _topen      _wopen\n#define _tremove    _wremove\n#define _tunlink    _wunlink\n\n// reading and writing to i/o\n#define _fgettc     fgetwc\n#define _fgetts     fgetws\n#define _fputts     fputws\n#define _gettchar   getwchar\n\n// directory\n#define _tchdir     _wchdir\n\n// environment\n#define _tgetenv    _wgetenv\n#define _tsystem    _wsystem\n\n// time\n#define _tcsftime   wcsftime\n\n#else // ANSI\n\n#ifndef _T\n#define _T(x)    x\n#define _TEXT(x) x\n#endif\ntypedef char            TCHAR;\ntypedef unsigned char   _TUCHAR;\n\n// program\n#define _tmain      main\n#define _tWinMain   WinMain\n#define _tenviron   environ\n#define __targv     __argv\n\n// printfs\n#define _ftprintf   fprintf\n#define _sntprintf  _snprintf\n#define _stprintf   sprintf\n#define _tprintf    printf\n#define _vftprintf  vfprintf\n#define _vsntprintf _vsnprintf\n#define _vstprintf  vsprintf\n\n// scanfs\n#define _tscanf     scanf\n#define _stscanf    sscanf\n\n// string manipulations\n#define _tcscat     strcat\n#define _tcschr     strchr\n#define _tcsclen    strlen\n#define _tcscnlen   strnlen\n#define _tcscpy     strcpy\n#define _tcsdup     _strdup\n#define _tcslen     strlen\n#define _tcsnccpy   strncpy\n#define _tcsrchr    strrchr\n#define _tcsstr     strstr\n#define _tcstok     strtok\n\n// string comparisons\n#define _tcscmp     strcmp\n#define _tcsicmp    _stricmp\n#define _tcsncmp    strncmp\n#define _tcsncicmp  _strnicmp\n#define _tcsnicmp   _strnicmp\n\n// upper / lower\n#define _tcslwr     _strlwr\n#define _tcsupr     _strupr\n\n#define _totupper   toupper\n#define _totlower   tolower\n\n// conversions to numbers\n#define _tcstol     strtol\n#define _tcstoul    strtoul\n#define _tstof      atof\n#define _tstoi      atoi\n#define _tstoi64    _atoi64\n#define _tstoi64    _atoi64\n#define _ttoi       atoi\n#define _ttoi64     _atoi64\n#define _ttol       atol\n\n// conversion from numbers to strings\n#define _i64tot     _i64toa\n#define _itot       _itoa\n#define _ltot       _ltoa\n#define _ui64tot    _ui64toa\n\n// file manipulations\n#define _tfopen     fopen\n#define _topen      _open\n#define _tremove    remove\n#define _tunlink    _unlink\n\n// reading and writing to i/o\n#define _fgettc     fgetc\n#define _fgetts     fgets\n#define _fputts     fputs\n#define _gettchar   getchar\n\n// directory\n#define _tchdir     _chdir\n\n// environment\n#define _tgetenv    getenv\n#define _tsystem    system\n\n// time\n#define _tcsftime   strftime\n\n#endif\n\n// is functions (the same in Unicode / ANSI)\n#define _istgraph   isgraph\n#define _istascii   __isascii\n\n#define __TFILE__ _T(__FILE__)\n#define __TDATE__ _T(__DATE__)\n#define __TTIME__ _T(__TIME__)\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/nsis_unicode/pluginapi.h",
    "content": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n#include \"nsis_tchar.h\"\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\n#define EXDLL_INIT()           {  \\\n        g_stringsize=string_size; \\\n        g_stacktop=stacktop;      \\\n        g_variables=variables; }\n\ntypedef struct _stack_t {\n  struct _stack_t *next;\n  TCHAR text[1]; // this should be the length of string_size\n} stack_t;\n\nenum\n{\nINST_0,         // $0\nINST_1,         // $1\nINST_2,         // $2\nINST_3,         // $3\nINST_4,         // $4\nINST_5,         // $5\nINST_6,         // $6\nINST_7,         // $7\nINST_8,         // $8\nINST_9,         // $9\nINST_R0,        // $R0\nINST_R1,        // $R1\nINST_R2,        // $R2\nINST_R3,        // $R3\nINST_R4,        // $R4\nINST_R5,        // $R5\nINST_R6,        // $R6\nINST_R7,        // $R7\nINST_R8,        // $R8\nINST_R9,        // $R9\nINST_CMDLINE,   // $CMDLINE\nINST_INSTDIR,   // $INSTDIR\nINST_OUTDIR,    // $OUTDIR\nINST_EXEDIR,    // $EXEDIR\nINST_LANG,      // $LANGUAGE\n__INST_LAST\n};\n\nextern unsigned int g_stringsize;\nextern stack_t **g_stacktop;\nextern TCHAR *g_variables;\n\nint NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack\nint NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize\nint NSISCALL popint(); // pops an integer\nint NSISCALL popint_or(); // with support for or'ing (2|4|8)\nint NSISCALL myatoi(const TCHAR *s); // converts a string to an integer\nunsigned NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only\nint NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)\nvoid NSISCALL pushstring(const TCHAR *str);\nvoid NSISCALL pushint(int value);\nTCHAR * NSISCALL getuservariable(const int varnum);\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var);\n\n#ifdef _UNICODE\n#define PopStringW(x) popstring(x)\n#define PushStringW(x) pushstring(x)\n#define SetUserVariableW(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringA(char* ansiStr);\nvoid NSISCALL PushStringA(const char* ansiStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);\n\n#else\n// ANSI defs\n\n#define PopStringA(x) popstring(x)\n#define PushStringA(x) pushstring(x)\n#define SetUserVariableA(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringW(wchar_t* wideStr);\nvoid NSISCALL PushStringW(wchar_t* wideStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif//!___NSIS_PLUGIN__H___\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/AccessControl/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by AccessControl.rc\n\n// Next default values for new objects\n// \n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NEXT_RESOURCE_VALUE        101\n#define _APS_NEXT_COMMAND_VALUE         40001\n#define _APS_NEXT_CONTROL_VALUE         1001\n#define _APS_NEXT_SYMED_VALUE           101\n#endif\n#endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/ExecDos.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"ExecDos\", \"ExecDos.vcxproj\", \"{1A16311F-F8AB-96EA-1ACE-57B17A915730}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug Unicode|Win32 = Debug Unicode|Win32\n\t\tDebug Unicode|x64 = Debug Unicode|x64\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tRelease Unicode|Win32 = Release Unicode|Win32\n\t\tRelease Unicode|x64 = Release Unicode|x64\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug Unicode|x64.Build.0 = Debug Unicode|x64\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Debug|x64.Build.0 = Debug|x64\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|Win32.Build.0 = Release Unicode|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|x64.ActiveCfg = Release Unicode|x64\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release Unicode|x64.Build.0 = Release Unicode|x64\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|Win32.Build.0 = Release|Win32\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|x64.ActiveCfg = Release|x64\n\t\t{1A16311F-F8AB-96EA-1ACE-57B17A915730}.Release|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/ExecDos.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug Unicode|Win32\">\n      <Configuration>Debug Unicode</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug Unicode|x64\">\n      <Configuration>Debug Unicode</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release Unicode|Win32\">\n      <Configuration>Release Unicode</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release Unicode|x64\">\n      <Configuration>Release Unicode</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <SccProjectName />\n    <SccLocalPath />\n    <ProjectGuid>{1A16311F-F8AB-96EA-1ACE-57B17A915730}</ProjectGuid>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x86-ansi</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-ansi</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x86-unicode</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-unicode</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x86-ansi</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-ansi</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x86-unicode</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\">\n    <LinkIncremental>false</LinkIncremental>\n    <GenerateManifest>false</GenerateManifest>\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-unicode</OutDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n      <StringPooling>true</StringPooling>\n      <Optimization>MinSpace</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <TargetEnvironment>Win32</TargetEnvironment>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <SubSystem>Console</SubSystem>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n      <StringPooling>true</StringPooling>\n      <Optimization>MinSpace</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <SubSystem>Console</SubSystem>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n      <StringPooling>true</StringPooling>\n      <Optimization>MinSpace</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <TargetEnvironment>Win32</TargetEnvironment>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <SubSystem>Console</SubSystem>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\n      <StringPooling>true</StringPooling>\n      <Optimization>MinSpace</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <SubSystem>Console</SubSystem>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <AdditionalDependencies>kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <InlineFunctionExpansion>Default</InlineFunctionExpansion>\n      <FunctionLevelLinking>false</FunctionLevelLinking>\n      <Optimization>Disabled</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <MinimalRebuild>true</MinimalRebuild>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <BufferSecurityCheck>true</BufferSecurityCheck>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../Debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <TargetEnvironment>Win32</TargetEnvironment>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../Debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <GenerateDebugInformation>false</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <InlineFunctionExpansion>Default</InlineFunctionExpansion>\n      <FunctionLevelLinking>false</FunctionLevelLinking>\n      <Optimization>Disabled</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <BufferSecurityCheck>true</BufferSecurityCheck>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../Debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../Debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <GenerateDebugInformation>false</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <AdditionalDependencies>nsis_ansi\\pluginapi.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <InlineFunctionExpansion>Default</InlineFunctionExpansion>\n      <FunctionLevelLinking>false</FunctionLevelLinking>\n      <Optimization>Disabled</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <MinimalRebuild>true</MinimalRebuild>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <BufferSecurityCheck>true</BufferSecurityCheck>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../Debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <TargetEnvironment>Win32</TargetEnvironment>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../Debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <GenerateDebugInformation>false</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\">\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <InlineFunctionExpansion>Default</InlineFunctionExpansion>\n      <FunctionLevelLinking>false</FunctionLevelLinking>\n      <Optimization>Disabled</Optimization>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ExecDos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <BufferSecurityCheck>true</BufferSecurityCheck>\n    </ClCompile>\n    <Midl>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <TypeLibraryName>.\\../Debug\\ExecDos.tlb</TypeLibraryName>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n    </Midl>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Bscmake>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <OutputFile>.\\../Debug\\ExecDos.bsc</OutputFile>\n    </Bscmake>\n    <Link>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <LinkDLL>true</LinkDLL>\n      <GenerateDebugInformation>false</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <AdditionalDependencies>nsis_unicode\\pluginapi.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"execDos.c\" />\n    <ClCompile Include=\"pluginapi.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"api.h\" />\n    <ClInclude Include=\"nsis_tchar.h\" />\n    <ClInclude Include=\"pluginapi.h\" />\n    <ClInclude Include=\"resource.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"execDos.rc\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/ExecDos.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{e6ac57b0-521c-4d5a-b4e8-d04324cd751f}</UniqueIdentifier>\n      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{affd3ad4-c2c0-4025-80fc-5b2b7b4c6ffc}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{cee8647c-748e-4045-9a4c-08eb637ef52c}</UniqueIdentifier>\n      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"execDos.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"pluginapi.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"api.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"pluginapi.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"nsis_tchar.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"resource.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"execDos.rc\">\n      <Filter>Source Files</Filter>\n    </ResourceCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/api.h",
    "content": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2013 Nullsoft and Contributors\n * \n * Licensed under the zlib/libpng license (the \"License\");\n * you may not use this file except in compliance with the License.\n * \n * Licence details can be found in the file COPYING.\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n */\n\n#ifndef _NSIS_EXEHEAD_API_H_\n#define _NSIS_EXEHEAD_API_H_\n\n// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version\n// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))\n// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}\n\n#define NSISPIAPIVER_1_0 0x00010000\n#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0\n\n// NSIS Plug-In Callback Messages\nenum NSPIM \n{\n\tNSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup\n\tNSPIM_GUIUNLOAD, // Called after .onGUIEnd\n};\n\n// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()\n// Return NULL for unknown messages\n// Should always be __cdecl for future expansion possibilities\ntypedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);\n\n// extra_parameters data structures containing other interesting stuff\n// but the stack, variables and HWND passed on to plug-ins.\ntypedef struct\n{\n  int autoclose;\n  int all_user_var;\n  int exec_error;\n  int abort;\n  int exec_reboot; // NSIS_SUPPORT_REBOOT\n  int reboot_called; // NSIS_SUPPORT_REBOOT\n  int XXX_cur_insttype; // depreacted\n  int plugin_api_version; // see NSISPIAPIVER_CURR\n                          // used to be XXX_insttype_changed\n  int silent; // NSIS_CONFIG_SILENT_SUPPORT\n  int instdir_error;\n  int rtl;\n  int errlvl;\n  int alter_reg_view;\n  int status_update;\n} exec_flags_t;\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\ntypedef struct {\n  exec_flags_t *exec_flags;\n  int (NSISCALL *ExecuteCodeSegment)(int, HWND);\n  void (NSISCALL *validate_filename)(TCHAR *);\n  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors\n} extra_parameters;\n\n// Definitions for page showing plug-ins\n// See Ui.c to understand better how they're used\n\n// sent to the outer window to tell it to go to the next inner window\n#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)\n\n// custom pages should send this message to let NSIS know they're ready\n#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)\n\n// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning\n#define NOTIFY_BYE_BYE 'x'\n\n#endif /* _PLUGIN_H_ */\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/consApp.cpp",
    "content": "#include <windows.h>\n#include <stdio.h>\n\n#pragma comment(linker,\"/MERGE:.rdata=.text\")\n#pragma comment(linker,\"/FILEALIGN:512 /SECTION:.text,EWRX /IGNORE:4078\")\n#pragma comment(linker,\"/ENTRY:main\")\n#pragma comment(linker,\"/NODEFAULTLIB\")\n\nint main( int argc, char **argv)\n{\n   char b[1024] = \"\";\n   printf(\"This is test console application for execDos plugin\\n\");\n   printf(\"Written by Takhir Bedertdinov\\n\\n\");\n   fflush(NULL);\n   Sleep(500);\n   printf(\"Login: \");\n   fflush(NULL);\n   Sleep(500);\n//   fgets(b, sizeof(b), stdin);// generates error in msvcrt\n   gets(b);\n   printf(\"%s\\n\", b);\n/*MessageBox(NULL, \"Login received\", b, 0);*/\n   fflush(NULL);\n   Sleep(500);\n   printf(\"Passowrd: \");\n   fflush(NULL);\n   Sleep(500);\n   *b = 0;\n//   fgets(b, sizeof(b), stdin);\n   gets(b);\n   printf(\"%s\\n\", b);\n   fflush(NULL);\n   Sleep(500);\n/*MessageBox(NULL, \"Password received\", b, 0);*/\n   printf(\"\\nThanks\\nBla-bla-bla\\nBye\\n\");\n   fflush(NULL);\n   Sleep(500);\n\treturn 5;\n}\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/consApp.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"consApp\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=consApp - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE \n!MESSAGE NMAKE /f \"consApp.mak\".\n!MESSAGE \n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE \n!MESSAGE NMAKE /f \"consApp.mak\" CFG=\"consApp - Win32 Debug\"\n!MESSAGE \n!MESSAGE Possible choices for configuration are:\n!MESSAGE \n!MESSAGE \"consApp - Win32 Release\" (based on \"Win32 (x86) Console Application\")\n!MESSAGE \"consApp - Win32 Debug\" (based on \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"consApp - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"Release\"\n# PROP Intermediate_Dir \"Release\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\n# ADD CPP /nologo /W3 /GX /O1 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /FD /c\n# SUBTRACT CPP /YX\n# ADD BASE RSC /l 0x419 /d \"NDEBUG\"\n# ADD RSC /l 0x419 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib msvcrt.lib /nologo /subsystem:console /machine:I386 /opt:nowin98 /OPT:REF /OPT:ICF\n# SUBTRACT LINK32 /pdb:none /nodefaultlib\n\n!ELSEIF  \"$(CFG)\" == \"consApp - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"Debug\"\n# PROP BASE Intermediate_Dir \"Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"Debug\"\n# PROP Intermediate_Dir \"Debug\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ /c\n# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ /c\n# ADD BASE RSC /l 0x419 /d \"_DEBUG\"\n# ADD RSC /l 0x419 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\n\n!ENDIF \n\n# Begin Target\n\n# Name \"consApp - Win32 Release\"\n# Name \"consApp - Win32 Debug\"\n# Begin Source File\n\nSOURCE=.\\consApp.cpp\n# End Source File\n# End Target\n# End Project\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/execDos.c",
    "content": "/***************************************************\n* FILE NAME: execDos.c\n*\n* PURPOSE:\n*   NSIS plugin for DOS (console) applications.\n*   Creates child process with redirected I/O.\n*   Catches application's output and can put it to the\n*   log file. Returns process exit code or error code.\n*\n* CHANGE HISTORY\n*\n* $LOG$\n*\n* Author              Version  Date         Modifications\n* Takhir Bedertdinov           May 31 2004  Original\n*   --//--                     Oct 31 2004  Log output\n*   --//--                     Feb 10 2005  /TIMEOUT option\n*   --//--                     Jul 23 2005  /ASYNC option\n*   --//--                     Jul 25 2005  multithreading\n*   --//--                     Mar 10 2006  perf. improved\n*   --//--                     Jul 25 2006  to stack option\n*   --//--                     Dec 12 2006  detailed option\n* Stuart Welch                 Jul 27 2007  func options\n*   --//--                                  isdone func\n* Takhir Bedertdinov           Jul 28 2007  to window option\n* Stuart Welch                 Jan 18 2011  Unicode build\n*   --//--                                  NSIS plugin API update (no /NOUNLOAD)\n*   --//--                                  /DISABLEFSR option for WOW64\n*   --//--            1.0.1.2  Apr 13 2014  x64 build\n*   --//--                                  version info resource\n*   --//--            1.0.1.3  Dec 11 2014  incorrect Unicode GlobalAlloc size\n*                                           STDIN Unicode ANSI conversion\n*\n* Takhir Bedertdinov, Moscow, Russia, ineum@narod.ru\n* Stuart 'Afrow UK' Welch, afrowuk@afrowsoft.co.uk\n**************************************************/\n\n#include <windows.h>\n#include <fcntl.h>\n#include <stdio.h>\n#include <io.h>\n#include <sys\\stat.h>\n#include \"COMMCTRL.H\"\n#include \"pluginapi.h\"\n\n#define NSISFUNC(name) void __declspec(dllexport) name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra)\n\nenum ERROR_CODES {\n  ERR_DUPHANDLE = -16,\n  ERR_CREATEPIPE,\n  ERR_CREATEPROC,\n  ERR_CLOSEHANDLE,\n  ERR_WRITEPIPE,\n  ERR_GETEXITCODE,\n  ERR_LOGOPEN,\n  ERR_LOGWRITE,\n  ERR_TERMINATED,\n  ERR_CREATETHREAD\n};\n\nenum OUT_OPTIONS {\n  OUT_FILE,\n  OUT_STACK,\n  OUT_WINDOW,\n  OUT_FUNCTION\n};\n\n#define SLEEP_MS 10\n#define T_O        TEXT(\"/TIMEOUT\")\n#define N_W        TEXT(\"/ASYNC\")\n#define TOSTACK    TEXT(\"/TOSTACK\")\n#define DETAILED   TEXT(\"/DETAILED\")\n#define TOWINDOW   TEXT(\"/TOWINDOW\")\n#define TOFUNC     TEXT(\"/TOFUNC\")\n#define DISABLEFSR TEXT(\"/DISABLEFSR\")\n#define ENDFUNC    TEXT(\"/ENDFUNC\")\n\ntypedef struct _threadParams {\n  TCHAR *dosExec;\n  TCHAR *pipeWrite;\n  DWORD target;\n  BOOL disableFsR;\n  TCHAR *logFile;\n  DWORD timeout;\n  HWND hOut;\n  LONG lFuncAddress;\n  LONG lEndFuncAddress;\n} threadParams, *pthreadParams;\n\ntypedef BOOL (WINAPI* PWow64EnableWow64FsRedirection)(BOOL);\n\nextra_parameters* ep;\nHANDLE g_hInstance;\n\n/*****************************************************\n * FUNCTION NAME: my_strchr()\n * PURPOSE: \n *   libc/msvcrt replacements\n *****************************************************/\nTCHAR *my_strchr(TCHAR *s, TCHAR c)\n{\n  while(*s != 0)\n  {\n    if(*s == c)\n      return s;\n    s++;\n  }\n  return NULL;\n}\n\n/*****************************************************\n* FUNCTION NAME: redirect()\n* PURPOSE: \n*   Creates child process with redirected IO\n* SPECIAL CONSIDERATIONS:\n*\n*****************************************************/\nDWORD __stdcall redirect(void *pp)\n{\n  HANDLE hOutputReadTmp,hOutputRead,hOutputWrite;\n  HANDLE hInputWriteTmp,hInputRead,hInputWrite;\n  HANDLE hErrorWrite;\n  PROCESS_INFORMATION pi;\n  STARTUPINFO *psi = (STARTUPINFO*)GlobalAlloc(GPTR, sizeof(STARTUPINFO));\n  SECURITY_ATTRIBUTES sa;\n  HANDLE f = INVALID_HANDLE_VALUE;\n  DWORD rslt = 0,\n    waitTime = 0,\n    dwRead = 0;\n  char b[256];\n  TCHAR *szStack = NULL;\n  unsigned int iStack = 0, iPipeWrite;\n  pthreadParams ptp = (pthreadParams)pp;\n  LVITEM lvItem;\n  lvItem.mask = LVIF_TEXT;\n  lvItem.iItem = 0;\n  lvItem.iSubItem = 0;\n  lvItem.pszText = NULL;\n  lvItem.cchTextMax = 0;\n\n\tiPipeWrite = lstrlen(ptp->pipeWrite);\n  \n  /* creates child process with redirected IO */\n  sa.nLength= sizeof(SECURITY_ATTRIBUTES);\n  sa.lpSecurityDescriptor = NULL;\n  sa.bInheritHandle = TRUE;\n  if(ptp->target != OUT_FILE)\n  {\n    szStack = (TCHAR*)GlobalAlloc(GPTR, sizeof(TCHAR) * (g_stringsize + 2));\n    lvItem.pszText = szStack;\n  }\n\n  /* disable WOW64 file system redirection */\n  if (ptp->disableFsR)\n  {\n    HINSTANCE hDll = GetModuleHandle(TEXT(\"kernel32.dll\"));\n    PWow64EnableWow64FsRedirection Wow64EnableWow64FsRedirection = (PWow64EnableWow64FsRedirection)GetProcAddress(hDll, \"Wow64EnableWow64FsRedirection\");\n    if (Wow64EnableWow64FsRedirection != NULL)\n      Wow64EnableWow64FsRedirection(FALSE);\n  }\n  \n  while(1)\n  {\n    /* creating pipes for child process with redirected IO */\n    if(!CreatePipe(&hOutputReadTmp,&hOutputWrite,&sa,0) ||\n      !CreatePipe(&hInputRead,&hInputWriteTmp,&sa,0))\n    { rslt = ERR_CREATEPIPE; break; }\n    if(!DuplicateHandle(GetCurrentProcess(), hOutputWrite, GetCurrentProcess(),\n      \n      /* duplicates handles and makes them inheritable */\n      &hErrorWrite, 0, TRUE, DUPLICATE_SAME_ACCESS) ||\n      !DuplicateHandle(GetCurrentProcess(), hOutputReadTmp, GetCurrentProcess(),\n      &hOutputRead, 0, FALSE, DUPLICATE_SAME_ACCESS) ||\n      !DuplicateHandle(GetCurrentProcess(), hInputWriteTmp, GetCurrentProcess(),\n      &hInputWrite, 0, FALSE, DUPLICATE_SAME_ACCESS))\n    { rslt = ERR_DUPHANDLE; break; }\n    \n    /* run process and close unnecessary handles */\n    psi->cb = sizeof(STARTUPINFO);\n    psi->dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;\n    psi->hStdOutput = hOutputWrite;\n    psi->hStdInput  = hInputRead;\n    psi->hStdError  = hErrorWrite;\n    psi->wShowWindow = SW_HIDE; /* SW_NORMAL - for tests */\n    if(!CreateProcess(NULL, ptp->dosExec, NULL, NULL, TRUE, 0, NULL, NULL, psi, &pi))\n    { rslt = ERR_CREATEPROC; break; }\n    \n    /* closes temporary and unnesessery handles */\n    if(!CloseHandle(hOutputReadTmp) ||\n      !CloseHandle(hInputWriteTmp) ||\n      !CloseHandle(pi.hThread) ||\n      !CloseHandle(hOutputWrite) ||\n      !CloseHandle(hInputRead ) ||\n      !CloseHandle(hErrorWrite))\n    { rslt = ERR_CLOSEHANDLE; break; }\n    \n    /* write all to pipe - on tests it caches input strings correctly */\n    if(iPipeWrite > 0)\n    {\n#ifdef UNICODE\n\t\t\tint cbConverted = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ptp->pipeWrite, iPipeWrite, NULL, 0, NULL, NULL);\n\t\t\trslt = -1;\n\t\t\tif (cbConverted > 0)\n\t\t\t{\n\t\t\t\tPCHAR pszConverted = (PCHAR)GlobalAlloc(GPTR, cbConverted + 1);\n\t\t\t\tif (pszConverted)\n\t\t\t\t{\n\t\t\t\t\tif (WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ptp->pipeWrite, iPipeWrite, pszConverted, cbConverted, NULL, NULL) > 0)\n\t\t\t\t\t\tWriteFile(hInputWrite, pszConverted, cbConverted, &rslt, NULL);\n\t\t\t\t\tGlobalFree(pszConverted);\n\t\t\t\t}\n\t\t\t}\n      if(\n#else\n      if(WriteFile(hInputWrite, ptp->pipeWrite, iPipeWrite, &rslt, NULL) == 0 ||\n#endif\n        rslt != (unsigned)iPipeWrite)\n      { rslt = ERR_WRITEPIPE; break; }\n      FlushFileBuffers(hInputWrite);\n    }\n    \n    /* open log file if name is correct */\n    if(ptp->target == OUT_FILE &&\n      *(ptp->logFile) != 0 &&\n      (f = CreateFile(ptp->logFile, GENERIC_WRITE, FILE_SHARE_READ, NULL,\n      CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)\n    { rslt = ERR_LOGOPEN; break; }\n    \n    /* OK, this is main execution loop */\n    while(waitTime <= ptp->timeout &&\n      rslt != ERR_LOGWRITE &&\n      PeekNamedPipe(hOutputRead, 0, 0, 0, &dwRead, NULL) &&\n      GetExitCodeProcess(pi.hProcess, &rslt))\n    {\n      if(dwRead > 0)\n      {\n        if(ReadFile(hOutputRead, b, dwRead > sizeof(b) ? sizeof(b) : dwRead, &rslt, NULL) &&\n          rslt > 0)\n        {\n          if(ptp->target == OUT_FILE)\n          {\n            if(f != INVALID_HANDLE_VALUE &&\n              (WriteFile(f, b, rslt, &dwRead, NULL) == 0 || dwRead != rslt))\n            {\n              rslt = ERR_LOGWRITE;\n              break;\n            }\n          }\n          else\n          {\n            dwRead = 0;\n            while(dwRead < rslt)\n            {\n              if(b[dwRead] == TEXT('\\n'))\n              {\n                /* supress empty lines */\n                if(iStack > 0)\n                {\n                  szStack[iStack] = 0;\n                  if(ptp->target == OUT_STACK)\n                    pushstring(szStack);\n                  else if(ptp->target == OUT_FUNCTION)\n                  {\n                    pushstring(szStack);\n                    ep->ExecuteCodeSegment(ptp->lFuncAddress-1, 0);\n                  }\n                  else if(lstrcmpi(ptp->logFile, TEXT(\"SysListView32\")) == 0)\n                  {\n                    lvItem.iItem = (int)SendMessage(ptp->hOut, LVM_GETITEMCOUNT, 0, 0);\n                    lvItem.iItem = (int)SendMessage(ptp->hOut, LVM_INSERTITEM, 0,  (LPARAM)&lvItem);\n                    SendMessage(ptp->hOut, LVM_ENSUREVISIBLE, lvItem.iItem,  0);\n                  }\n                  else if(lstrcmpi(ptp->logFile, TEXT(\"Edit\")) == 0 || lstrcmpi(ptp->logFile, TEXT(\"RichEdit20A\")) == 0)\n                  {\n                    lstrcat(szStack, TEXT(\"\\r\\n\"));\n                    lvItem.iItem = (int)SendMessage(ptp->hOut, WM_GETTEXTLENGTH, 0, 0);\n                    SendMessage(ptp->hOut, EM_SETSEL, lvItem.iItem, lvItem.iItem);\n                    SendMessage(ptp->hOut, EM_REPLACESEL, 0,  (LPARAM)szStack);\n                  }\n                  else if(lstrcmpi(ptp->logFile, TEXT(\"ListBox\")) == 0)\n                  {\n                    lvItem.iItem = (int)SendMessage(ptp->hOut, LB_GETCOUNT, 0, 0);\n                    lvItem.iItem = (int)SendMessage(ptp->hOut, LB_INSERTSTRING, lvItem.iItem,  (LPARAM)szStack);\n                    //SendMessage(ptp->hOut, LVM_ENSUREVISIBLE, lvItem.iItem,  0);\n                  }\n                  iStack = 0;\n                }\n              }\n              else if(b[dwRead] != TEXT('\\r') && iStack < (g_stringsize-1))\n              {\n                szStack[iStack++] = b[dwRead];\n              }\n              dwRead++;\n            }\n          }\n        }\n        if(f != INVALID_HANDLE_VALUE)\n          FlushFileBuffers(f);\n      }\n      else if(rslt == STILL_ACTIVE)\n      {\n        Sleep(SLEEP_MS);\n        waitTime += SLEEP_MS;\n      }\n      else break;\n    }\n    if(iStack > 0)\n    {\n      szStack[iStack] = 0;\n      pushstring(szStack);\n    }\n    if(f != INVALID_HANDLE_VALUE) CloseHandle(f);\n    \n    if(GetExitCodeProcess(pi.hProcess, &rslt))\n    {\n      if(rslt == STILL_ACTIVE)\n      {\n        TerminateProcess(pi.hProcess, -1);\n        rslt = ERR_TERMINATED;\n      }\n    }\n    else rslt = ERR_GETEXITCODE;\n    CloseHandle(pi.hProcess);\n    CloseHandle(hOutputRead);\n    CloseHandle(hInputWrite);\n    break;\n  }\n  \n  GlobalFree(psi);\n  GlobalFree(ptp->dosExec);\n  GlobalFree(ptp->pipeWrite);\n  GlobalFree(ptp->logFile);\n  GlobalFree(ptp);\n  if(szStack) GlobalFree(szStack);\n\n  if (ptp->lEndFuncAddress != -1)\n    ep->ExecuteCodeSegment(ptp->lEndFuncAddress - 1, 0);\n\n  return (DWORD)rslt;\n}\n\n/*****************************************************\n * FUNCTION NAME: PluginCallback()\n * PURPOSE: \n *   for NSIS plugin API\n *****************************************************/\nstatic UINT_PTR PluginCallback(enum NSPIM msg)\n{\n  return 0;\n}\n\n/*****************************************************\n * FUNCTION NAME: wait()\n * PURPOSE: \n *   waits for thread exit and closes handle\n * SPECIAL CONSIDERATIONS:\n *   tested with my consApp.exe\n *****************************************************/\nNSISFUNC(wait)\n{\n  DWORD rslt = ERR_CREATETHREAD;\n  TCHAR exitCode[16];\n  HANDLE hThread;\n\n  popstring(exitCode);\n  hThread = (HANDLE)myatou(exitCode);\n/* push to stack application' exit code or -1 or \"still_running\" */\n  if(hThread != NULL)\n  {\n    WaitForSingleObject(hThread, INFINITE);\n    GetExitCodeThread(hThread, &rslt);\n    CloseHandle(hThread);\n    hThread = NULL;\n  }\n  wsprintf(exitCode, TEXT(\"%d\"), rslt);\n  pushstring(exitCode);\n}\n\n/*****************************************************\n * FUNCTION NAME: isdone()\n * PURPOSE: \n *   checks if the thread has completed\n * SPECIAL CONSIDERATIONS:\n *   \n *****************************************************/\nNSISFUNC(isdone)\n{\n  TCHAR s[16];\n  HANDLE hThread;\n\n// get thread handle from stack\n  popstring(s);\n  hThread = (HANDLE)myatou(s);\n// is it running? 1 == yes, 0 == exited, -1 == error \n  if(hThread != NULL)\n    pushstring(WaitForSingleObject(hThread, 0) == WAIT_TIMEOUT ? TEXT(\"0\") : TEXT(\"1\"));\n  else\n    pushstring(TEXT(\"-1\"));\n}\n\n/*****************************************************\n * FUNCTION NAME: exec()\n * PURPOSE: \n *   C dll entry point for hidden DOS process execution\n * SPECIAL CONSIDERATIONS:\n *\n *****************************************************/\nNSISFUNC(exec)\n{\n  DWORD dwThreadId;\n  HANDLE hThread;\n  BOOL fWait = TRUE;\n  pthreadParams ptp = (pthreadParams)GlobalAlloc(GPTR, sizeof(threadParams));\n  TCHAR s[16];\n  TCHAR *p;\n  HWND childwnd;\n\n  ep = extra;\n  EXDLL_INIT();\n\n  ptp->dosExec = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));\n  ptp->pipeWrite = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));\n  ptp->logFile = (TCHAR*)GlobalAlloc(GPTR, string_size * sizeof(TCHAR));\n  ptp->timeout = 0xffffff;\n  ptp->lEndFuncAddress = -1;\n  ptp->disableFsR = FALSE;\n\n  while(!popstring(ptp->dosExec) && *(ptp->dosExec) == TEXT('/'))\n  {\n    if(lstrcmpi(ptp->dosExec, N_W) == 0)\n    {\n      fWait = FALSE;\n    }\n    else if(lstrcmpi(ptp->dosExec, DISABLEFSR) == 0)\n    {\n      ptp->disableFsR = TRUE;\n    }\n    else if(lstrcmpi(ptp->dosExec, TOSTACK) == 0)\n    {\n      ptp->target = OUT_STACK;\n    }\n    else if(lstrcmpi(ptp->dosExec, TOWINDOW) == 0)\n    {\n      ptp->target = OUT_WINDOW;\n    }\n    else if(lstrcmpi(ptp->dosExec, TOFUNC) == 0)\n    {\n      ptp->target = OUT_FUNCTION;\n    }\n    else if(lstrcmpi(ptp->dosExec, DETAILED) == 0)\n    {\n// convert 'detailed' to 'window' option\n      ptp->target = OUT_WINDOW;\n      if(hWndParent &&\n        (childwnd = FindWindowEx(hWndParent, NULL, TEXT(\"#32770\"), NULL)) != NULL)\n        wsprintf(ptp->logFile, TEXT(\"%d\"), (int)GetDlgItem(childwnd, 0x3f8));\n    }\n    else if((p = my_strchr(ptp->dosExec, TEXT('='))) != NULL)\n    {\n      *p++ = 0;\n      if(lstrcmpi(ptp->dosExec, T_O) == 0)\n        ptp->timeout = myatou(p);\n      else if(lstrcmpi(ptp->dosExec, ENDFUNC) == 0)\n        ptp->lEndFuncAddress = myatou(p);\n    }\n    *(ptp->dosExec) = 0;\n  }\n\n// if stack is not empty and no /tostack or /detailed output option\n  if(popstring(ptp->pipeWrite) == 0 &&\n    *ptp->logFile == 0 && // may be in use by DETAILED window\n    ptp->target != OUT_STACK) // 2 param suposed only\n    popstring(ptp->logFile);\n// output window was kept in string. Let's handle it once\n  if(ptp->target == OUT_WINDOW)\n  {\n    ptp->hOut = (HWND)myatou(ptp->logFile);\n    GetClassName(ptp->hOut, ptp->logFile, string_size);\n  }\n  if(ptp->target == OUT_FUNCTION)\n  {\n    ptp->lFuncAddress = (LONG)myatou(ptp->logFile);\n  }\n\n  hThread = CreateThread(NULL, 0, redirect, ptp, 0, &dwThreadId);\n  wsprintf(s, TEXT(\"%u\"), hThread);\n  pushstring(s);\n\n  if(fWait)\n    wait(hWndParent, string_size, variables, stacktop, extra);\n  else\n    extra->RegisterPluginCallback((HMODULE)g_hInstance, PluginCallback);\n}\n\n/*****************************************************\n * FUNCTION NAME: DllMain()\n * PURPOSE: \n *   Dll main entry point\n * SPECIAL CONSIDERATIONS:\n *   \n *****************************************************/\nBOOL WINAPI DllMain(HANDLE hInst,\n              ULONG ul_reason_for_call,\n              LPVOID lpReserved)\n{\n  g_hInstance = hInst;\n  return TRUE;\n}"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/nsis_tchar.h",
    "content": "/*\n * nsis_tchar.h\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2013 Nullsoft and Contributors\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n *\n * For Unicode support by Jim Park -- 08/30/2007\n */\n\n// Jim Park: Only those we use are listed here.\n\n#pragma once\n\n#ifdef _UNICODE\n\n#ifndef _T\n#define __T(x)   L ## x\n#define _T(x)    __T(x)\n#define _TEXT(x) __T(x)\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\n#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)\ntypedef unsigned short TCHAR;\n#else\ntypedef wchar_t TCHAR;\n#endif\n#endif\n\n\n// program\n#define _tenviron   _wenviron\n#define __targv     __wargv\n\n// printfs\n#define _ftprintf   fwprintf\n#define _sntprintf  _snwprintf\n#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)\n#\tdefine _stprintf   swprintf\n#else\n#\tdefine _stprintf   _swprintf\n#endif\n#define _tprintf    wprintf\n#define _vftprintf  vfwprintf\n#define _vsntprintf _vsnwprintf\n#if defined(_MSC_VER) && (_MSC_VER<=1310)\n#\tdefine _vstprintf  vswprintf\n#else\n#\tdefine _vstprintf  _vswprintf\n#endif\n\n// scanfs\n#define _tscanf     wscanf\n#define _stscanf    swscanf\n\n// string manipulations\n#define _tcscat     wcscat\n#define _tcschr     wcschr\n#define _tcsclen    wcslen\n#define _tcscpy     wcscpy\n#define _tcsdup     _wcsdup\n#define _tcslen     wcslen\n#define _tcsnccpy   wcsncpy\n#define _tcsncpy    wcsncpy\n#define _tcsrchr    wcsrchr\n#define _tcsstr     wcsstr\n#define _tcstok     wcstok\n\n// string comparisons\n#define _tcscmp     wcscmp\n#define _tcsicmp    _wcsicmp\n#define _tcsncicmp  _wcsnicmp\n#define _tcsncmp    wcsncmp\n#define _tcsnicmp   _wcsnicmp\n\n// upper / lower\n#define _tcslwr     _wcslwr\n#define _tcsupr     _wcsupr\n#define _totlower   towlower\n#define _totupper   towupper\n\n// conversions to numbers\n#define _tcstoi64   _wcstoi64\n#define _tcstol     wcstol\n#define _tcstoul    wcstoul\n#define _tstof      _wtof\n#define _tstoi      _wtoi\n#define _tstoi64    _wtoi64\n#define _ttoi       _wtoi\n#define _ttoi64     _wtoi64\n#define _ttol       _wtol\n\n// conversion from numbers to strings\n#define _itot       _itow\n#define _ltot       _ltow\n#define _i64tot     _i64tow\n#define _ui64tot    _ui64tow\n\n// file manipulations\n#define _tfopen     _wfopen\n#define _topen      _wopen\n#define _tremove    _wremove\n#define _tunlink    _wunlink\n\n// reading and writing to i/o\n#define _fgettc     fgetwc\n#define _fgetts     fgetws\n#define _fputts     fputws\n#define _gettchar   getwchar\n\n// directory\n#define _tchdir     _wchdir\n\n// environment\n#define _tgetenv    _wgetenv\n#define _tsystem    _wsystem\n\n// time\n#define _tcsftime   wcsftime\n\n#else // ANSI\n\n#ifndef _T\n#define _T(x)    x\n#define _TEXT(x) x\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\ntypedef char TCHAR;\n#endif\n\n// program\n#define _tenviron   environ\n#define __targv     __argv\n\n// printfs\n#define _ftprintf   fprintf\n#define _sntprintf  _snprintf\n#define _stprintf   sprintf\n#define _tprintf    printf\n#define _vftprintf  vfprintf\n#define _vsntprintf _vsnprintf\n#define _vstprintf  vsprintf\n\n// scanfs\n#define _tscanf     scanf\n#define _stscanf    sscanf\n\n// string manipulations\n#define _tcscat     strcat\n#define _tcschr     strchr\n#define _tcsclen    strlen\n#define _tcscnlen   strnlen\n#define _tcscpy     strcpy\n#define _tcsdup     _strdup\n#define _tcslen     strlen\n#define _tcsnccpy   strncpy\n#define _tcsrchr    strrchr\n#define _tcsstr     strstr\n#define _tcstok     strtok\n\n// string comparisons\n#define _tcscmp     strcmp\n#define _tcsicmp    _stricmp\n#define _tcsncmp    strncmp\n#define _tcsncicmp  _strnicmp\n#define _tcsnicmp   _strnicmp\n\n// upper / lower\n#define _tcslwr     _strlwr\n#define _tcsupr     _strupr\n\n#define _totupper   toupper\n#define _totlower   tolower\n\n// conversions to numbers\n#define _tcstol     strtol\n#define _tcstoul    strtoul\n#define _tstof      atof\n#define _tstoi      atoi\n#define _tstoi64    _atoi64\n#define _tstoi64    _atoi64\n#define _ttoi       atoi\n#define _ttoi64     _atoi64\n#define _ttol       atol\n\n// conversion from numbers to strings\n#define _i64tot     _i64toa\n#define _itot       _itoa\n#define _ltot       _ltoa\n#define _ui64tot    _ui64toa\n\n// file manipulations\n#define _tfopen     fopen\n#define _topen      _open\n#define _tremove    remove\n#define _tunlink    _unlink\n\n// reading and writing to i/o\n#define _fgettc     fgetc\n#define _fgetts     fgets\n#define _fputts     fputs\n#define _gettchar   getchar\n\n// directory\n#define _tchdir     _chdir\n\n// environment\n#define _tgetenv    getenv\n#define _tsystem    system\n\n// time\n#define _tcsftime   strftime\n\n#endif\n\n// is functions (the same in Unicode / ANSI)\n#define _istgraph   isgraph\n#define _istascii   __isascii\n\n#define __TFILE__ _T(__FILE__)\n#define __TDATE__ _T(__DATE__)\n#define __TTIME__ _T(__TIME__)\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/pluginapi.c",
    "content": "#include <windows.h>\n\n#include \"pluginapi.h\"\n\n#ifdef _countof\n#define COUNTOF _countof\n#else\n#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))\n#endif\n\nunsigned int g_stringsize;\nstack_t **g_stacktop;\nTCHAR *g_variables;\n\n// utility functions (not required but often useful)\n\nint NSISCALL popstring(TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpy(str,th->text);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nint NSISCALL popstringn(TCHAR *str, int maxlen)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpyn(str,th->text,maxlen?maxlen:g_stringsize);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nvoid NSISCALL pushstring(const TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop) return;\n  th=(stack_t*)GlobalAlloc(GPTR,(sizeof(stack_t)+(g_stringsize)*sizeof(TCHAR)));\n  lstrcpyn(th->text,str,g_stringsize);\n  th->next=*g_stacktop;\n  *g_stacktop=th;\n}\n\nTCHAR* NSISCALL getuservariable(const int varnum)\n{\n  if (varnum < 0 || varnum >= __INST_LAST) return NULL;\n  return g_variables+varnum*g_stringsize;\n}\n\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var)\n{\n\tif (var != NULL && varnum >= 0 && varnum < __INST_LAST) \n\t\tlstrcpy(g_variables + varnum*g_stringsize, var);\n}\n\n#ifdef _UNICODE\nint NSISCALL PopStringA(char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   int rval = popstring(wideStr);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nint NSISCALL PopStringNA(char* ansiStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, realLen*sizeof(wchar_t));\n   int rval = popstringn(wideStr, realLen);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, realLen, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringA(const char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   pushstring(wideStr);\n   GlobalFree((HGLOBAL)wideStr);\n   return;\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   lstrcpyW(wideStr, getuservariable(varnum));\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   wchar_t* wideStr = getuservariable(varnum);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n}\n\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr)\n{\n   if (ansiStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      wchar_t* wideStr = g_variables + varnum * g_stringsize;\n      MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   }\n}\n\n#else\n// ANSI defs\nint NSISCALL PopStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   int rval = popstring(ansiStr);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nint NSISCALL PopStringNW(wchar_t* wideStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   char* ansiStr = (char*) GlobalAlloc(GPTR, realLen);\n   int rval = popstringn(ansiStr, realLen);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, realLen);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   pushstring(ansiStr);\n   GlobalFree((HGLOBAL)ansiStr);\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   char* ansiStr = getuservariable(varnum);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   lstrcpyA(ansiStr, getuservariable(varnum));\n}\n\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr)\n{\n   if (wideStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      char* ansiStr = g_variables + varnum * g_stringsize;\n      WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   }\n}\n#endif\n\n// playing with integers\n\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s)\n{\n  INT_PTR v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  return v;\n}\n\nunsigned int NSISCALL myatou(const TCHAR *s)\n{\n  unsigned int v=0;\n\n  for (;;)\n  {\n    unsigned int c=*s++;\n    if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n    else break;\n    v*=10;\n    v+=c;\n  }\n  return v;\n}\n\nint NSISCALL myatoi_or(const TCHAR *s)\n{\n  int v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  // Support for simple ORed expressions\n  if (*s == _T('|')) \n  {\n      v |= myatoi_or(s+1);\n  }\n\n  return v;\n}\n\nINT_PTR NSISCALL popintptr()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return nsishelper_str_to_ptr(buf);\n}\n\nint NSISCALL popint_or()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return myatoi_or(buf);\n}\n\nvoid NSISCALL pushintptr(INT_PTR value)\n{\n\tTCHAR buffer[30];\n\twsprintf(buffer, sizeof(void*) > 4 ? _T(\"%Id\") : _T(\"%d\"), value);\n\tpushstring(buffer);\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/pluginapi.h",
    "content": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n#include \"nsis_tchar.h\"\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\n#define EXDLL_INIT()           {  \\\n        g_stringsize=string_size; \\\n        g_stacktop=stacktop;      \\\n        g_variables=variables; }\n\ntypedef struct _stack_t {\n  struct _stack_t *next;\n  TCHAR text[1]; // this should be the length of string_size\n} stack_t;\n\nenum\n{\nINST_0,         // $0\nINST_1,         // $1\nINST_2,         // $2\nINST_3,         // $3\nINST_4,         // $4\nINST_5,         // $5\nINST_6,         // $6\nINST_7,         // $7\nINST_8,         // $8\nINST_9,         // $9\nINST_R0,        // $R0\nINST_R1,        // $R1\nINST_R2,        // $R2\nINST_R3,        // $R3\nINST_R4,        // $R4\nINST_R5,        // $R5\nINST_R6,        // $R6\nINST_R7,        // $R7\nINST_R8,        // $R8\nINST_R9,        // $R9\nINST_CMDLINE,   // $CMDLINE\nINST_INSTDIR,   // $INSTDIR\nINST_OUTDIR,    // $OUTDIR\nINST_EXEDIR,    // $EXEDIR\nINST_LANG,      // $LANGUAGE\n__INST_LAST\n};\n\nextern unsigned int g_stringsize;\nextern stack_t **g_stacktop;\nextern TCHAR *g_variables;\n\nvoid NSISCALL pushstring(const TCHAR *str);\nvoid NSISCALL pushintptr(INT_PTR value);\n#define pushint(v) pushintptr((INT_PTR)(v))\nint NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack\nint NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize\nINT_PTR NSISCALL popintptr();\n#define popint() ( (int) popintptr() )\nint NSISCALL popint_or(); // with support for or'ing (2|4|8)\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);\n#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer\nunsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only\nint NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)\nTCHAR* NSISCALL getuservariable(const int varnum);\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var);\n\n#ifdef _UNICODE\n#define PopStringW(x) popstring(x)\n#define PushStringW(x) pushstring(x)\n#define SetUserVariableW(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringA(char* ansiStr);\nvoid NSISCALL PushStringA(const char* ansiStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);\n\n#else\n// ANSI defs\n\n#define PopStringA(x) popstring(x)\n#define PushStringA(x) pushstring(x)\n#define SetUserVariableA(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringW(wchar_t* wideStr);\nvoid NSISCALL PushStringW(wchar_t* wideStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif//!___NSIS_PLUGIN__H___\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/ExecDos/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by execDos.rc\n\n// Next default values for new objects\n// \n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NEXT_RESOURCE_VALUE        101\n#define _APS_NEXT_COMMAND_VALUE         40001\n#define _APS_NEXT_CONTROL_VALUE         1001\n#define _APS_NEXT_SYMED_VALUE           101\n#endif\n#endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/Button.h",
    "content": "int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM lpData) {\n  if (uMsg == BFFM_INITIALIZED && lpData)\n    mySendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)lpData);\n\n  return 0;\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/CheckBox.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/ComboBox.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/DateTime.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/GroupBox.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/Image.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/IpAddress.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/Label.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/Link.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/ListBox.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/ListView.h",
    "content": "int iItemPlaceholder = -1;\n\nint WINAPI FIELD_LISTVIEW_IOLI_CountItems(LPTSTR str, int nFlags)\n{\n  //nFlags:\n  //0 = Items.\n  //1 = SubItems.\n\n  int nItems = 0;\n  int nItemsTemp = nItems;\n  int bSubItem = FALSE;\n\n  int nResult = 0;\n\n  TCHAR *pszEnd;\n  pszEnd = str;\n\n  while (*pszEnd)\n  {\n    if (*pszEnd == '\\x01')\n\t{\n\t  if(!bSubItem && nFlags == 0)\n        ++nItems;\n\t  if(bSubItem && nFlags == 1)\n        ++nItemsTemp;\n\t}\n    else if (*pszEnd == '\\x02')\n\t  bSubItem = TRUE;\n\telse if (*pszEnd == '\\x03')\n\t{\n\t  bSubItem = FALSE;\n\n\t  if(nFlags == 1)\n\t  {\n        ++nItemsTemp;\n\n\t    if(nItemsTemp > nItems)\n\t\t  nItems = nItemsTemp;\n\t    nItemsTemp = 0;\n\t  }\n\t}\n\n\tpszEnd = CharNext(pszEnd);\n  }\n\n  return nItems;\n}\n\nint WINAPI FIELD_LISTVIEW_IOLI_CountSubItems(LPTSTR str, LPTSTR pszHeaderItems)\n{\n  int nPart = 0;\n\n  int nItems = 0;\n  int nItemsTmp = 0;\n  int nItemsTemp = nItems;\n  int bSubItem = FALSE;\n\n  TCHAR *pszEnd;\n  pszEnd = str;\n\n  while(nPart < 2)\n  {\n    if(nPart == 0 && str)\n\t  pszEnd = str;\n    if(nPart == 1 && pszHeaderItems)\n\t  pszEnd = pszHeaderItems;\n\n    while (*pszEnd)\n\t{\n      if (*pszEnd == '\\x01')\n\t  {\n\t    if(!bSubItem && nPart != 0)\n          ++nItemsTmp;\n\t    if(bSubItem && nPart == 0)\n          ++nItemsTemp;\n\t  }\n      else if (*pszEnd == '\\x02')\n\t    bSubItem = TRUE;\n\t  else if (*pszEnd == '\\x03')\n\t  {\n\t    bSubItem = FALSE;\n\n\t    if(nPart == 0)\n\t\t{\n          ++nItemsTemp;\n\n\t      if(nItemsTemp > nItemsTmp)\n\t\t    nItemsTmp = nItemsTemp;\n\t      nItemsTemp = 0;\n\t\t}\n\t  }\n\n\t  pszEnd = CharNext(pszEnd);\n\t}\n\n    if(nItemsTmp > nItems)\n\t  nItems = nItemsTmp;\n\n\tnItemsTmp = 0;\n\n\tnPart++;\n  }\n\n  return nItems;\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/MonthCalendar.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/ProgressBar.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/RadioButton.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/RichText.h",
    "content": "#define _RICHEDIT_VER 0x0200\n#include <richedit.h>\n#undef _RICHEDIT_VER\n\nint nRichTextVersion;\nstatic DWORD dwRead;\n\nDWORD CALLBACK FIELD_RICHTEXT_StreamIn(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)\n{\n  strncpy((TCHAR*)pbBuff,(TCHAR*)dwCookie+dwRead,cb/sizeof(TCHAR));\n  *pcb=strlen((TCHAR*)pbBuff)*sizeof(TCHAR);\n  dwRead+=strlen((TCHAR*)pbBuff);\n  return 0;\n}\n\nDWORD CALLBACK FIELD_RICHTEXT_StreamOut(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)\n{\n  if(dwRead+1 > (UINT)g_nBufferSize)\n    return 1;\n\n  if(dwRead+cb+1 <= (UINT)g_nBufferSize)\n    strcpy((TCHAR*)dwCookie+dwRead,(TCHAR*)pbBuff);\n  else\n    strncpy((TCHAR*)dwCookie+dwRead,(TCHAR*)pbBuff, (UINT)g_nBufferSize - dwRead+1);\n  *pcb=strlen((TCHAR*)dwCookie);\n  dwRead+=*pcb;\n  return 0;\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/StatusBar.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/Text.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/ToolBar.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/TrackBar.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/TreeView.h",
    "content": "//================================================================\n// TreeView Special Flags\n//================================================================\n\n// TREEVIEW_UNCHECKED    = Unselected *Items*\n// TREEVIEW_CHECKED      = Selected *Items*\n// TREEVIEW_READONLY     = Read Only *Items*\n// TREEVIEW_NOCHECKBOX   = No CheckBox *All Items*\n// TREEVIEW_BOLD         = Bold *All*\n// TREEVIEW_EXPANDED     = Expand *Parent Items*\n// TREEVIEW_PART_UNCHECK = Swap between 3rd state to 1st *Parent Items* (Reserved)\n// TREEVIEW_PART_CHECK   = Swap between 3rd state to 2st *Parent Items* (Reserved)\n// TREEVIEW_PART_FIXED   = Stay on 3rd state *Parent Items* (Reserved)\n// TREEVIEW_AUTOCHECK    = Automatic Check (only for function FIELD_TREEVIEW_Check)\n\n#define TREEVIEW_UNCHECKED     0x00000000\n#define TREEVIEW_CHECKED       0x00000001\n#define TREEVIEW_READONLY      0x00000002\n#define TREEVIEW_NOCHECKBOX    0x00000004\n#define TREEVIEW_BOLD          0x00000008\n#define TREEVIEW_EXPANDED      0x00000010\n#define TREEVIEW_PART_UNCHECK  0x00000020\n#define TREEVIEW_PART_CHECK    0x00000040\n#define TREEVIEW_PART_FIXED    0x00000080\n#define TREEVIEW_AUTOCHECK     0xFFFFFFFF\n\nvoid WINAPI FIELD_TREEVIEW_Check(HWND hCtrl, HTREEITEM hItem, int nCheck, int nParam, bool bCalledFromParent)\n{\n\n// Step 1: Check/uncheck itself.\n//================================================================\n\n  // Get Item Information\n  //--------------------------------------------------------------\n  TVITEM tvItem;\n  tvItem.mask = TVIF_STATE | TVIF_PARAM | TVIF_CHILDREN;\n  tvItem.stateMask = TVIS_STATEIMAGEMASK;\n  tvItem.hItem = hItem;\n  TreeView_GetItem(hCtrl, &tvItem);\n\n  // \"3rd state\" checkboxes\n  //--------------------------------------------------------------\n  if(tvItem.lParam & TREEVIEW_PART_FIXED)\n  {\n    if((tvItem.state >> 12) >= 3 && !(tvItem.lParam & TREEVIEW_CHECKED)) // If item state is leaving the 3rd state\n\t{\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_CHECKED;\n\t  tvItem.lParam |= TREEVIEW_CHECKED;\n\t}\n    else\n\t{\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_UNCHECKED;\n\t  tvItem.lParam &= ~TREEVIEW_CHECKED;\n\t}\n\ttvItem.state = INDEXTOSTATEIMAGEMASK(3 - 1); // SPECIAL: Stays there\n  }\n  // \"3rd state <-> checked\" checkboxes\n  //--------------------------------------------------------------\n  else if(tvItem.lParam & TREEVIEW_PART_CHECK)\n  {\n    if((tvItem.state >> 12) >= 3) // If item state is leaving the 3rd state\n\t{\n\t  tvItem.state = INDEXTOSTATEIMAGEMASK((tvItem.state >> 12) - 2); // SPECIAL: Goes to checked state\n\t  tvItem.lParam |= TREEVIEW_CHECKED;\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_CHECKED;\n\t}\n    else\n\t{\n\t  tvItem.lParam &= ~TREEVIEW_CHECKED;\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_UNCHECKED;\n\t}\n  }\n  // \"3rd state <-> unchecked\" checkboxes\n  //--------------------------------------------------------------\n  else if (tvItem.lParam & TREEVIEW_PART_UNCHECK)\n  {\n\tif((tvItem.state >> 12) == 1) // If item state is leaving the unchecked state\n\t{\n\t  tvItem.state = INDEXTOSTATEIMAGEMASK((tvItem.state >> 12) + 1); // SPECIAL: Goes to 3rd state\n\t  tvItem.lParam |= TREEVIEW_CHECKED;\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_CHECKED;\n\t}\n\telse if ((tvItem.state >> 12) >= 3) // If item state is leaving the 3rd state\n\t{\n\t  tvItem.state = INDEXTOSTATEIMAGEMASK((tvItem.state >> 12) - 3); // SPECIAL: Goes to unchecked state\n\t  tvItem.lParam &= ~TREEVIEW_CHECKED;\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_UNCHECKED;\n\t}\n  }\n  // \"Read only\" checkboxes\n  //--------------------------------------------------------------\n  else if (tvItem.lParam & TREEVIEW_READONLY)\n  {\n    if(!bCalledFromParent) tvItem.state = INDEXTOSTATEIMAGEMASK((tvItem.state >> 12) - 1); // SPECIAL: Stays the same\n  }\n  // \"Normal\" checkboxes (Leaving from Checked state)\n  //--------------------------------------------------------------\n  else if (nParam == 0xFFFFFFFF)\n  {\n\tif ((tvItem.state >> 12) >= 3)\n\t{\n      tvItem.state = INDEXTOSTATEIMAGEMASK((tvItem.state >> 12) - 2); // SPECIAL: Goes to checked state\n\t  tvItem.lParam |= TREEVIEW_CHECKED;\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_CHECKED;\n\t}\n\telse\n\tif ((tvItem.state >> 12) == 2)\n\t{\n      tvItem.state = INDEXTOSTATEIMAGEMASK((tvItem.state >> 12) - 2); // SPECIAL: Goes to unchecked state\n\t  tvItem.lParam &= ~TREEVIEW_CHECKED;\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_UNCHECKED;\n\t}\n\telse\n\t{\n\t  tvItem.lParam |= TREEVIEW_CHECKED;\n      if(nCheck == TREEVIEW_AUTOCHECK) nCheck = TREEVIEW_CHECKED;\n\t  goto Step2;\n\t}\n  }\n  // Checkbox creation (used when creating the control)\n  //--------------------------------------------------------------\n  else\n  {\n    // No checkboxes (TREEVIEW_NOCHECKBOX)\n    //------------------------------------\n\tif(nParam & TREEVIEW_NOCHECKBOX)\n\t  tvItem.state = INDEXTOSTATEIMAGEMASK(0);\n\n    // Read-only checkboxes (TREEVIEW_READONLY)\n    //-----------------------------------------\n\telse\n\tif(nParam & TREEVIEW_READONLY)\n\t{\n\t  if(nParam & TREEVIEW_CHECKED)\n        // Read-only checked checkboxes (TREEVIEW_READONLY | TREEVIEW_CHECKED)\n\t\ttvItem.state = INDEXTOSTATEIMAGEMASK(5);\n\t  else\n        // Read-only unchecked checkboxes (TREEVIEW_READONLY)\n\t\ttvItem.state = INDEXTOSTATEIMAGEMASK(4);\n\t}\n\telse\n    // Checked checkboxes (TREEVIEW_CHECKED)\n    //-----------------------------------------\n\tif(nParam & TREEVIEW_CHECKED)\n\t  tvItem.state = INDEXTOSTATEIMAGEMASK(2);\n\n    // Bold items (TREEVIEW_BOLD)\n    //---------------------------\n\tif(nParam & TREEVIEW_BOLD)\n\t{\n\t  tvItem.state |= TVIS_BOLD;\n\t  tvItem.stateMask |= TVIS_BOLD;\n\t}\n    // Expanded items (TREEVIEW_EXPANDED)\n    //-----------------------------------\n\tif(nParam & TREEVIEW_EXPANDED)\n\t{\n\t  tvItem.state |= TVIS_EXPANDED;\n\t  tvItem.stateMask |= TVIS_EXPANDED;\n\t}\n\n    tvItem.lParam = nParam;\n\tnCheck = nParam;\n  }\n\n  TreeView_SetItem(hCtrl, &tvItem);\n\nStep2:\n\n// Step 2: Detect and check/uncheck all children items of \"hItem\".\n//================================================================\n  if(nParam == 0xFFFFFFFF)\n  {\n    TVITEM tvChildItem;\n    HTREEITEM hChildItem = TreeView_GetChild(hCtrl, hItem);\n    while(hChildItem)\n\t{\n\t  tvChildItem.mask = TVIF_CHILDREN | TVIF_STATE | TVIF_PARAM;\n      tvChildItem.stateMask = TVIS_STATEIMAGEMASK;\n      tvChildItem.hItem = hChildItem;\n      TreeView_GetItem(hCtrl, &tvChildItem);\n\n \t  tvChildItem.mask = TVIF_STATE;\n      tvChildItem.stateMask = TVIS_STATEIMAGEMASK;\n\n\t  if(tvChildItem.cChildren == 1)\n\t  {\n\t    FIELD_TREEVIEW_Check(hCtrl, hChildItem, nCheck, 0xFFFFFFFF, TRUE);\n\t  }\n\n      if(!(tvChildItem.lParam & TREEVIEW_NOCHECKBOX))\n\t  {\n        if(tvChildItem.lParam & TREEVIEW_PART_FIXED)\n\t\t{\n\t      tvChildItem.state = INDEXTOSTATEIMAGEMASK(3);\n          TreeView_SetItem(hCtrl, &tvChildItem);\n\t\t}\n        else if(tvChildItem.lParam & TREEVIEW_PART_CHECK)\n\t\t{\n\t      if(nCheck == TREEVIEW_CHECKED)\n\t\t  {\n\t\t    tvChildItem.state = INDEXTOSTATEIMAGEMASK(2);\n\t        tvChildItem.lParam |= TREEVIEW_CHECKED;\n\t\t  }\n\t      else\n\t\t  {\n\t\t    tvChildItem.state = INDEXTOSTATEIMAGEMASK(3);\n\t        tvChildItem.lParam &= ~TREEVIEW_CHECKED;\n\t\t  }\n          TreeView_SetItem(hCtrl, &tvChildItem);\n\t\t}\n\t    else if(tvChildItem.lParam & TREEVIEW_PART_UNCHECK)\n\t\t{\n\t      if(nCheck == TREEVIEW_CHECKED)\n\t\t  {\n\t        tvChildItem.state = INDEXTOSTATEIMAGEMASK(3);\n\t        tvChildItem.lParam |= TREEVIEW_CHECKED;\n\t\t  }\n\t      else\n\t\t  {\n\t\t    tvChildItem.state = INDEXTOSTATEIMAGEMASK(1);\n\t        tvChildItem.lParam &= ~TREEVIEW_CHECKED;\n\t\t  }\n          TreeView_SetItem(hCtrl, &tvChildItem);\n\t\t}\n\t    else if(!(tvChildItem.lParam & TREEVIEW_READONLY))\n\t\t{\n\t      if(nCheck == TREEVIEW_CHECKED)\n\t\t  {\n\t\t    tvChildItem.state = INDEXTOSTATEIMAGEMASK(2);\n\t        tvChildItem.lParam |= TREEVIEW_CHECKED;\n\t\t  }\n\t      else\n\t\t  {\n\t\t    tvChildItem.state = INDEXTOSTATEIMAGEMASK(1);\n\t        tvChildItem.lParam &= ~TREEVIEW_CHECKED;\n\t\t  }\n          TreeView_SetItem(hCtrl, &tvChildItem);\n\t\t}\n\t  }\n\n      hChildItem = TreeView_GetNextSibling(hCtrl, hChildItem);\n\t}\n  }\n\n// Step 3: Detect and check/uncheck parent items.\n//================================================================\n  if(!bCalledFromParent)\n  {\n    HTREEITEM hParentItem = TreeView_GetParent(hCtrl, hItem);\n    HTREEITEM hBackupParentItem = hParentItem;\n\twhile(hParentItem)\n    {\n      TVITEM tvParentItem;\n  \t  tvParentItem.mask = TVIF_STATE | TVIF_PARAM;\n      tvParentItem.stateMask = TVIS_STATEIMAGEMASK;\n      tvParentItem.hItem = hParentItem;\n      TreeView_GetItem(hCtrl, &tvParentItem);\n\n      if(tvParentItem.lParam & TREEVIEW_NOCHECKBOX)\n\t  {\n\t    hParentItem = TreeView_GetParent(hCtrl, hParentItem);\n\t\tcontinue;\n\t  }\n      else\n\t  {\n  \t    HTREEITEM hSiblingItem = TreeView_GetChild(hCtrl, hBackupParentItem);\n        bool bFirstSibling = TRUE;\n\n  \t    while(hSiblingItem != NULL)\n\t\t{\n  \t      TVITEM tvSiblingItem;\n  \t      tvSiblingItem.hItem = hSiblingItem;\n  \t      tvSiblingItem.mask = TVIF_STATE | TVIF_PARAM;\n          tvSiblingItem.stateMask = TVIS_STATEIMAGEMASK;\n  \t      TreeView_GetItem(hCtrl, &tvSiblingItem);\n\n          if(!(tvSiblingItem.lParam & TREEVIEW_NOCHECKBOX))\n\t\t  {\n            if(nParam == 0xFFFFFFFF && hItem == hSiblingItem)\n              tvSiblingItem.state = INDEXTOSTATEIMAGEMASK((tvSiblingItem.state >> 12) + 1);\n\n  \t        if(bFirstSibling == TRUE)\n\t\t\t{\n  \t\t      tvParentItem.state = tvSiblingItem.state;\n  \t\t      tvParentItem.lParam = tvSiblingItem.lParam;\n  \t\t      bFirstSibling = FALSE;\n\t\t\t}\n  \t        else\n\t\t\t{\n\t\t\t  if (((tvParentItem.lParam & TREEVIEW_PART_UNCHECK) && (tvSiblingItem.lParam & TREEVIEW_PART_CHECK)) ||\n\t\t\t\t  ((tvParentItem.lParam & TREEVIEW_PART_CHECK) && (tvSiblingItem.lParam & TREEVIEW_PART_UNCHECK)))\n\t\t\t  {\n\t\t\t    tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n                tvParentItem.lParam &= ~TREEVIEW_PART_UNCHECK;\n                tvParentItem.lParam &= ~TREEVIEW_PART_CHECK;\n                tvParentItem.lParam |= TREEVIEW_PART_FIXED;\n\t\t\t  }\n\t\t      else\n\t\t\t  if (tvSiblingItem.lParam & TREEVIEW_PART_UNCHECK)\n\t\t\t  {\n\t\t\t    tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n                tvParentItem.lParam |= TREEVIEW_PART_UNCHECK;\n\t\t\t  }\n\t\t      else\n\t\t\t  if (tvSiblingItem.lParam & TREEVIEW_PART_CHECK)\n\t\t\t  {\n\t\t\t    tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n                tvParentItem.lParam |= TREEVIEW_PART_CHECK;\n\t\t\t  }\n\t\t      else\n\t\t\t  if (tvSiblingItem.lParam & TREEVIEW_PART_FIXED)\n\t\t\t  {\n\t\t\t    tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n                tvParentItem.lParam |= TREEVIEW_PART_FIXED;\n\t\t\t  }\n\t\t      else\n\t\t\t  if (((tvParentItem.state >> 12) == 3) && ((tvSiblingItem.state >> 12) == 1))\n\t\t\t  {\n\t\t\t    tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n\t\t\t  }\n\t\t      else\n  \t          if((((tvParentItem.state >> 12) == 3) && ((tvSiblingItem.state >> 12) == 2)) ||\n\t\t\t     (((tvParentItem.state >> 12) == 2) && ((tvSiblingItem.state >> 12) == 3)))\n\t\t\t  {\n\t\t\t    tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n\t\t\t  }\n\t\t      else\n  \t          if((((tvParentItem.state >> 12) == 1) && ((tvSiblingItem.state >> 12) == 2)) ||\n\t\t\t     (((tvParentItem.state >> 12) == 2) && ((tvSiblingItem.state >> 12) == 1)))\n\t\t\t  {\n\t\t\t    tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n\t\t\t  }\n  \t\t      else\n  \t          if((((tvParentItem.state >> 12) == 4) && ((tvSiblingItem.state >> 12) == 1)) ||\n\t\t\t     (((tvParentItem.state >> 12) == 1) && ((tvSiblingItem.state >> 12) == 4)))\n\t\t\t  {\n  \t\t        tvParentItem.state = INDEXTOSTATEIMAGEMASK(1);\n                tvParentItem.lParam = TREEVIEW_PART_UNCHECK;\n\t\t\t  }\n  \t\t      else\n  \t          if((((tvParentItem.state >> 12) == 4) && ((tvSiblingItem.state >> 12) == 2)) ||\n\t\t\t     (((tvParentItem.state >> 12) == 2) && ((tvSiblingItem.state >> 12) == 4)))\n\t\t\t  {\n  \t\t        tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n                tvParentItem.lParam = TREEVIEW_PART_UNCHECK;\n\t\t\t  }\n  \t\t      else\n  \t          if((((tvParentItem.state >> 12) == 5) && ((tvSiblingItem.state >> 12) == 4)) ||\n\t\t\t     (((tvParentItem.state >> 12) == 4) && ((tvSiblingItem.state >> 12) == 5)))\n\t\t\t  {\n  \t\t        tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n\t\t\t  }\n  \t\t      else\n  \t          if((((tvParentItem.state >> 12) == 5) && ((tvSiblingItem.state >> 12) == 1)) ||\n\t\t\t     (((tvParentItem.state >> 12) == 1) && ((tvSiblingItem.state >> 12) == 5)))\n\t\t\t  {\n  \t\t        tvParentItem.state = INDEXTOSTATEIMAGEMASK(3);\n                tvParentItem.lParam = TREEVIEW_PART_CHECK;\n\t\t\t  }\n  \t\t      else\n  \t          if((((tvParentItem.state >> 12) == 5) && ((tvSiblingItem.state >> 12) == 2)) ||\n\t\t\t     (((tvParentItem.state >> 12) == 2) && ((tvSiblingItem.state >> 12) == 5)))\n\t\t\t  {\n  \t\t        tvParentItem.state = INDEXTOSTATEIMAGEMASK(2);\n                tvParentItem.lParam = TREEVIEW_PART_CHECK;\n\t\t\t  }\n\t\t\t}\n\t\t  }\n\n  \t      TreeView_SetItem(hCtrl, &tvParentItem);\n  \t      hSiblingItem = TreeView_GetNextSibling(hCtrl, hSiblingItem);\n\t\t}\n\t  }\n\t  hBackupParentItem = hParentItem = TreeView_GetParent(hCtrl, hParentItem);\n\t}\n  }\n\n  return;\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/Controls/UpDown.h",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/InstallerOptions.cpp",
    "content": "/*\no------------------------------------------------------------------------------------o\n|InstallOptionsEx 2.4.5 beta 3                                                       |\n|Based on InstallOptions 2.47 (Git version: d20b99c082a99304a542c2fa6cf4abd381ca263a)|\n(------------------------------------------------------------------------------------)\n| Main source code.                                     / A plug-in for NSIS 2 and 3 |\n|                                                      ------------------------------|\n| By deguix (see copyright notes on readme)                                          |\n| And by SuperPat since 2.4.5 beta 1                                                 |\n| And by Tallmaris (Leandro Tramma): Initial unicode compatibility                   |\no------------------------------------------------------------------------------------o\n*/\n\n#include \"InstallerOptions.h\"\n\n//Implementation\nextern \"C\" void main(){}\n\n//================================================================\n// DLLMain\n//================================================================\nextern \"C\" BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)\n{\n  m_hInstance=(HINSTANCE) hInst;\n  return TRUE;\n}\n\n//================================================================\n// External Functions\n//================================================================\n\n// TODO: Add another call for changing item properties.\n// TODO: Add another call for adding external controls.\n\n// TODO: Expand functions to only show a specific main window.\n\n// show Function\n//================================================================\nextern \"C\" void __declspec(dllexport) show(HWND hwndParent, int string_size,\n                                      TCHAR *variables, stack_t **stacktop)\n{\n  EXDLL_INIT();\n  if (!initCalled) {\n    pushstring(_T(\"error\"));\n    return;\n  }\n  initCalled--;\n  showCfgDlg();\n}\n\n\n// make_unicode Function\n//================================================================\n#ifdef _UNICODE\n// convert ini file to Unicode so that WritePrivateProfileString can write Unicode strings in it\nextern \"C\" void __declspec(dllexport) make_unicode(HWND hwndParent, int string_size,\n                                      TCHAR *variables, stack_t **stacktop)\n{\n  EXDLL_INIT();\n  TCHAR filename[MAX_PATH];\n  popstring(filename);\n  HANDLE hFile = CreateFile(filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);\n  if (hFile != INVALID_HANDLE_VALUE)\n  {\n    DWORD fSize = GetFileSize(hFile, NULL);\n    LPSTR lpBuffer = (LPSTR) MALLOC(fSize);\n    if (lpBuffer)\n    {\n        DWORD bytes;\n        ReadFile(hFile, lpBuffer, fSize, &bytes, NULL);\n        if ((bytes < 2) || (lpBuffer[0] != '\\xFF') || (lpBuffer[1] != '\\xFE')) // file is not already Unicode\n        {\n            LPWSTR lpWide = (LPWSTR) MALLOC((bytes+1)*2);\n            if (lpWide)\n            {\n                int cch = MultiByteToWideChar(CP_ACP, 0, lpBuffer, bytes, lpWide, bytes+1);\n                if (cch)\n                {\n                    SetFilePointer(hFile, 0, NULL, FILE_BEGIN);\n                    WriteFile(hFile, \"\\xFF\\xFE\", 2, &bytes, NULL); // write Unicode BOM\n                    WriteFile(hFile, lpWide, cch*2, &bytes, NULL);\n                    SetEndOfFile(hFile);\n                }\n                FREE(lpWide);\n            }\n        }\n        FREE(lpBuffer);\n    }\n    CloseHandle(hFile);\n  }\n}\n#endif\n\n// dialog Function\n//================================================================\nextern \"C\" void __declspec(dllexport) dialog(HWND hwndParent, int string_size,\n                                      TCHAR *variables, stack_t **stacktop)\n{\n  hMainWindow=hwndParent;\n  EXDLL_INIT();\n  if (initCalled) {\n    pushstring(_T(\"error\"));\n    return;\n  }\n  if (createCfgDlg())\n    return;\n  popstring(NULL);\n  showCfgDlg();\n}\n\n// initDialog Function\n//================================================================\n\n#ifndef LEGACY_PLUGIN\n  extern \"C\" void __declspec(dllexport) initDialog(HWND hwndParent, int string_size,\n                                        TCHAR *variables, stack_t **stacktop,\n                                        extra_parameters *extra)\n#else\n  extern \"C\" void __declspec(dllexport) initDialog(HWND hwndParent, int string_size,\n                                        TCHAR *variables, stack_t **stacktop)\n#endif\n{\n  printf(\"CIAO\");\n  hMainWindow=hwndParent;\n\n  EXDLL_INIT();\n\n#ifndef LEGACY_PLUGIN\n  extra->RegisterPluginCallback(m_hInstance, PluginCallback);\n#endif\n\n  if (initCalled) {\n    pushstring(_T(\"error\"));\n    return;\n  }\n  if (createCfgDlg())\n    return;\n  initCalled++;\n}\n\n//  setFocus Function\n//================================================================\n#ifndef LEGACY_PLUGIN\n  extern \"C\" void __declspec(dllexport) setFocus(HWND hwndParent, int string_size,\n                                        TCHAR *variables, stack_t **stacktop,\n                                        extra_parameters *extra)\n#else\n  extern \"C\" void __declspec(dllexport) setFocus(HWND hwndParent, int string_size,\n                                        TCHAR *variables, stack_t **stacktop)\n#endif\n{\n  EXDLL_INIT();\n\n#ifndef LEGACY_PLUGIN\n  extra->RegisterPluginCallback(m_hInstance, PluginCallback);\n#endif\n\n  // Get the HWND of the control\n  TCHAR szhwCtrl[10];\n  popstring(szhwCtrl);\n\n  // Convert the string into an HWND\n  HWND hwnd = 0;\n  _stscanf_s(szhwCtrl,_T(\"%d\"),&hwnd);\n\n  // Change Focus\n  mySetFocus(hwnd);\n}\n\n//  skipValidation Function\n//================================================================\n#ifndef LEGACY_PLUGIN\n  extern \"C\" void __declspec(dllexport) skipValidation(HWND hwndParent, int string_size,\n                                        TCHAR *variables, stack_t **stacktop,\n                                        extra_parameters *extra)\n#else\n  extern \"C\" void __declspec(dllexport) skipValidation(HWND hwndParent, int string_size,\n                                        TCHAR *variables, stack_t **stacktop)\n#endif\n{\n  EXDLL_INIT();\n\n#ifndef LEGACY_PLUGIN\n  extra->RegisterPluginCallback(m_hInstance, PluginCallback);\n#endif\n\n  g_is_cancel = true;\n}\n\n\n\n//================================================================\n// Post-Call Function Implementations\n//================================================================\n\n\n\n\n\n//----------------------------------------------------------------\n// Pre function part\n//================================================================\n\nBOOL MakeTransparentAreaFromBitmap(HWND hwCtrl, HBITMAP hBitmap)\n{\n    // based on AdvSplash's SetTransparentRegion\n    BITMAP bm;\n//    HBITMAP hBitmap = (HBITMAP) pField->hImage;\n\n    if (GetObject(hBitmap, sizeof(bm), &bm))\n    {\n      HDC dc;\n      int x, y;\n      HRGN region, cutrgn;\n      BITMAPINFO bmi;\n      int size = bm.bmWidth * bm.bmHeight * sizeof(int);\n      int *bmp = (int *) MALLOC(size);\n      if (bmp)\n      {\n        bmi.bmiHeader.biBitCount = 32;\n        bmi.bmiHeader.biCompression = BI_RGB;\n        bmi.bmiHeader.biHeight = bm.bmHeight;\n        bmi.bmiHeader.biPlanes = 1;\n        bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\n        bmi.bmiHeader.biWidth = bm.bmWidth;\n        bmi.bmiHeader.biClrUsed = 0;\n        bmi.bmiHeader.biClrImportant = 0;\n\n        dc = CreateCompatibleDC(NULL);\n        SelectObject(dc, hBitmap);\n\n        x = GetDIBits(dc, hBitmap, 0, bm.bmHeight, bmp, &bmi, DIB_RGB_COLORS);\n\n        region = CreateRectRgn(0, 0, bm.bmWidth, bm.bmHeight);\n\n        int keycolor = *bmp & 0xFFFFFF;\n\n        // Search for transparent pixels\n        for (y = bm.bmHeight - 1; y >= 0; y--) {\n            for (x = 0; x < bm.bmWidth;) {\n            if ((*bmp & 0xFFFFFF) == keycolor) {\n                int j = x;\n                while ((x < bm.bmWidth) && ((*bmp & 0xFFFFFF) == keycolor)) {\n                    bmp++, x++;\n                }\n\n                // Cut transparent pixels from the original region\n                cutrgn = CreateRectRgn(j, y, x, y + 1);\n                CombineRgn(region, region, cutrgn, RGN_XOR);\n                DeleteObject(cutrgn);\n            } else {\n                bmp++, x++;\n            }\n          }\n        }\n\n        // Set resulting region.\n        SetWindowRgn(hwCtrl, region, TRUE);\n        DeleteObject(region);\n        DeleteObject(dc);\n        FREE(bmp);\n        return TRUE;\n      }\n    }\n  //}\n  return FALSE;\n}\n\nint WINAPI createCfgDlg()\n{\n  // TODO: Make NSIS controls be handled by the plug-in as an option\n\n// Initialize Variables\n//================================================================\n  g_is_back=false;\n  g_is_cancel=false;\n  g_is_timeout=false;\n\n// Detect If A Main Window Exists\n//================================================================\n  HWND mainwnd = hMainWindow;\n  if (!mainwnd)\n  {\n    popstring(NULL);\n    pushstring(_T(\"error finding mainwnd\"));\n    return 1; // cannot be used in silent mode unfortunately.\n  }\n\n// Detect If Settings Were Loaded\n//================================================================\n  if (!g_stacktop || !*g_stacktop || !(pszFilename = (*g_stacktop)->text) || !pszFilename[0] || !ReadSettings())\n  {\n    popstring(NULL);\n    pushstring(_T(\"error finding config\"));\n    return 1;\n  }\n\n// Detect If Child Window Exists\n//================================================================\n  HWND childwnd=GetDlgItem(mainwnd,nRectId);\n  if (!childwnd)\n  {\n    popstring(NULL);\n    pushstring(_T(\"error finding childwnd\"));\n    return 1;\n  }\n\n// NSIS Main Buttons Configurations\n//================================================================\n  hCancelButton = GetDlgItem(mainwnd,IDCANCEL);\n  hNextButton = GetDlgItem(mainwnd,IDOK);\n  hBackButton = GetDlgItem(mainwnd,3);\n\n  mySetWindowText(hCancelButton,pszCancelButtonText);\n  mySetWindowText(hNextButton,pszNextButtonText);\n  mySetWindowText(hBackButton,pszBackButtonText);\n\n  if(bNextShow!=-1)\n    old_next_visible=ShowWindow(hNextButton,bNextShow?SW_SHOWNA:SW_HIDE);\n  else\n  {\n    old_next_visible=ShowWindow(hNextButton,SW_SHOWNA);\n    ShowWindow(hNextButton,old_next_visible?SW_SHOWNA:SW_HIDE);\n  }\n\n  if(bBackShow!=-1)\n    old_back_visible=ShowWindow(hBackButton,bBackShow?SW_SHOWNA:SW_HIDE);\n  else\n  {\n    old_back_visible=ShowWindow(hBackButton,SW_SHOWNA);\n    ShowWindow(hBackButton,old_back_visible?SW_SHOWNA:SW_HIDE);\n  }\n\n  if(bCancelShow==-1)\n    old_cancel_visible=ShowWindow(hCancelButton,bCancelShow?SW_SHOWNA:SW_HIDE);\n  else\n  {\n    old_cancel_visible=ShowWindow(hCancelButton,SW_SHOWNA);\n    ShowWindow(hCancelButton,old_cancel_visible?SW_SHOWNA:SW_HIDE);\n  }\n\n  old_next_enabled = IsWindowEnabled(hNextButton);\n  old_back_enabled = IsWindowEnabled(hBackButton);\n  old_cancel_enabled = IsWindowEnabled(hCancelButton);\n\n  if (bNextEnabled!=-1)\n    EnableWindow(hNextButton,bNextEnabled);\n  else\n    EnableWindow(hNextButton,old_next_enabled);\n\n  if (bNextShow!=-1)\n    ShowWindow(hNextButton,bNextShow?SW_SHOWNA:SW_HIDE);\n  else\n    ShowWindow(hNextButton,old_next_visible?SW_SHOWNA:SW_HIDE);\n\n\n  if (bBackEnabled!=-1)\n    EnableWindow(hBackButton,bBackEnabled);\n  else\n    EnableWindow(hBackButton,old_back_enabled);\n\n  if (bBackShow!=-1)\n    ShowWindow(hBackButton,bBackShow?SW_SHOWNA:SW_HIDE);\n  else\n    ShowWindow(hBackButton,old_back_visible?SW_SHOWNA:SW_HIDE);\n\n\n  if (bCancelEnabled!=-1)\n  {\n    EnableWindow(hCancelButton,bCancelEnabled);\n    if (bCancelEnabled)\n        EnableMenuItem(GetSystemMenu(mainwnd, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_ENABLED);\n    else\n        EnableMenuItem(GetSystemMenu(mainwnd, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);\n  }\n  else\n    EnableWindow(hCancelButton,old_cancel_enabled);\n\n  if (bCancelShow!=-1)\n    ShowWindow(hCancelButton,bCancelShow?SW_SHOWNA:SW_HIDE);\n  else\n    ShowWindow(hCancelButton,old_cancel_visible?SW_SHOWNA:SW_HIDE);\n\n// Create Window\n//================================================================\n  HFONT hFont = (HFONT)mySendMessage(mainwnd, WM_GETFONT, 0, 0);\n\n  // Prevent WM_COMMANDs from being processed while we are building\n  g_done = 1;\n\n  // TODO: Use RegisterClassEx to create true GUI windows (not dialogs - CreateDialog - like now)\n  //       http://www.functionx.com/win32/Lesson05.htm\n\n  // TODO: Make loops for each main window/dialog and each control to create.\n\n  int mainWndWidth, mainWndHeight;\n  hConfigWindow=CreateDialog(m_hInstance,MAKEINTRESOURCE(IDD_DIALOG1),mainwnd,DialogWindowProc);\n  if (!hConfigWindow)\n  {\n    popstring(NULL);\n    pushstring(_T(\"error creating dialog\"));\n    return 1;\n  }\n\n  RECT dialog_r;\n  GetWindowRect(childwnd,&dialog_r);\n  MapWindowPoints(0, mainwnd, (LPPOINT) &dialog_r, 2);\n  mainWndWidth = dialog_r.right - dialog_r.left;\n  mainWndHeight = dialog_r.bottom - dialog_r.top;\n  SetWindowPos(\n    hConfigWindow,\n    0,\n    dialog_r.left,\n    dialog_r.top,\n    mainWndWidth,\n    mainWndHeight,\n    SWP_NOZORDER|SWP_NOACTIVATE\n  );\n  // Sets the font of IO window to be the same as the main window\n  mySendMessage(hConfigWindow, WM_SETFONT, (WPARAM)hFont, TRUE);\n\n  BOOL fFocused = FALSE;\n  BOOL fFocusedByFlag = FALSE;\n\n// Identify Styles For Each Control Type\n//================================================================\n\n  for (int nIdx = 0; nIdx < nNumFields; nIdx++) {\n    IOExControlStorage *pField = pFields + nIdx;\n\n    static struct {\n      const TCHAR* pszClass;\n      DWORD dwStyle;\n      DWORD dwRTLStyle;\n      DWORD dwExStyle;\n      DWORD dwRTLExStyle;\n    } ClassTable[] = {\n    { _T(\"STATIC\"),           // FIELD_HLINE\n      DEFAULT_STYLES | SS_ETCHEDHORZ | SS_SUNKEN,\n      DEFAULT_STYLES | SS_ETCHEDHORZ | SS_SUNKEN,\n      WS_EX_TRANSPARENT,\n      WS_EX_TRANSPARENT | RTL_EX_STYLES },\n    { _T(\"STATIC\"),           // FIELD_VLINE\n      DEFAULT_STYLES | SS_ETCHEDVERT | SS_SUNKEN,\n      DEFAULT_STYLES | SS_ETCHEDVERT | SS_SUNKEN,\n      WS_EX_TRANSPARENT,\n      WS_EX_TRANSPARENT | RTL_EX_STYLES },\n    { _T(\"STATIC\"),           // FIELD_LABEL\n      DEFAULT_STYLES | SS_OWNERDRAW | SS_NOTIFY,\n      DEFAULT_STYLES | SS_OWNERDRAW | SS_NOTIFY,\n      WS_EX_TRANSPARENT,\n      WS_EX_TRANSPARENT | RTL_EX_STYLES },\n    { _T(\"BUTTON\"),           // FIELD_GROUPBOX\n      DEFAULT_STYLES | BS_GROUPBOX,\n      DEFAULT_STYLES | BS_GROUPBOX | BS_RIGHT,\n      WS_EX_TRANSPARENT,\n      WS_EX_TRANSPARENT | RTL_EX_STYLES },\n    { _T(\"IMAGE\"),            // FIELD_IMAGE // Representation for both \"Static\" and \"Animation\" controls.\n      DEFAULT_STYLES,\n      DEFAULT_STYLES,\n      0,\n      RTL_EX_STYLES },\n    { PROGRESS_CLASS,         // FIELD_PROGRESSBAR\n      DEFAULT_STYLES,\n      DEFAULT_STYLES,\n      0,\n      RTL_EX_STYLES },\n    { _T(\"BUTTON\"),           // FIELD_LINK\n      DEFAULT_STYLES | WS_TABSTOP | BS_OWNERDRAW | BS_NOTIFY,\n      DEFAULT_STYLES | WS_TABSTOP | BS_OWNERDRAW | BS_RIGHT | BS_NOTIFY,\n      0,\n      RTL_EX_STYLES },\n    { _T(\"BUTTON\"),           // FIELD_BUTTON\n      DEFAULT_STYLES | WS_TABSTOP | BS_MULTILINE | BS_NOTIFY,\n      DEFAULT_STYLES | WS_TABSTOP | BS_MULTILINE | BS_NOTIFY,\n      0,\n      RTL_EX_STYLES },\n    { UPDOWN_CLASS,           // FIELD_UPDOWN\n      DEFAULT_STYLES | WS_TABSTOP | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNRIGHT,\n      DEFAULT_STYLES | WS_TABSTOP | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_SETBUDDYINT | UDS_ALIGNLEFT,\n      0,\n      RTL_EX_STYLES },\n    { _T(\"BUTTON\"),           // FIELD_CHECKBOX\n      DEFAULT_STYLES | WS_TABSTOP | BS_TEXT | BS_VCENTER | BS_AUTOCHECKBOX | BS_MULTILINE | BS_NOTIFY,\n      DEFAULT_STYLES | WS_TABSTOP | BS_TEXT | BS_VCENTER | BS_AUTOCHECKBOX | BS_MULTILINE | BS_RIGHT | BS_LEFTTEXT | BS_NOTIFY,\n      0,\n      RTL_EX_STYLES },\n    { _T(\"BUTTON\"),           // FIELD_RADIOBUTTON\n      DEFAULT_STYLES | WS_TABSTOP | BS_TEXT | BS_VCENTER | BS_AUTORADIOBUTTON | BS_MULTILINE | BS_NOTIFY,\n      DEFAULT_STYLES | WS_TABSTOP | BS_TEXT | BS_VCENTER | BS_AUTORADIOBUTTON | BS_MULTILINE | BS_RIGHT | BS_LEFTTEXT | BS_NOTIFY,\n      0,\n      RTL_EX_STYLES },\n    { _T(\"EDIT\"),             // FIELD_TEXT\n      DEFAULT_STYLES | WS_TABSTOP | ES_AUTOHSCROLL,\n      DEFAULT_STYLES | WS_TABSTOP | ES_AUTOHSCROLL | ES_RIGHT,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | RTL_EX_STYLES | WS_EX_LEFTSCROLLBAR },\n    { WC_IPADDRESS,           // FIELD_IPADDRESS\n      WS_CHILD | WS_TABSTOP | WS_VISIBLE,\n      WS_CHILD | WS_TABSTOP | WS_VISIBLE,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | RTL_EX_STYLES },\n    { RICHEDIT_CLASS,         // FIELD_RICHTEXT // Representation for the actual class name (depends on version)\n      DEFAULT_STYLES | WS_TABSTOP | ES_AUTOHSCROLL,\n      DEFAULT_STYLES | WS_TABSTOP | ES_AUTOHSCROLL | ES_RIGHT,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | RTL_EX_STYLES | WS_EX_LEFTSCROLLBAR },\n    { _T(\"COMBOBOX\"),         // FIELD_COMBOBOX\n      DEFAULT_STYLES | WS_TABSTOP | WS_VSCROLL | WS_CLIPCHILDREN | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_AUTOHSCROLL,\n      DEFAULT_STYLES | WS_TABSTOP | WS_VSCROLL | WS_CLIPCHILDREN | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_AUTOHSCROLL,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_RIGHT | RTL_EX_STYLES | WS_EX_LEFTSCROLLBAR },\n    { DATETIMEPICK_CLASS,     // FIELD_DATETIME\n      DEFAULT_STYLES | WS_TABSTOP,\n      DEFAULT_STYLES | WS_TABSTOP | DTS_RIGHTALIGN,\n      0,\n      RTL_EX_STYLES | WS_EX_LEFTSCROLLBAR },\n    { _T(\"LISTBOX\"),          // FIELD_LISTBOX\n      DEFAULT_STYLES | WS_TABSTOP | WS_VSCROLL | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY,\n      DEFAULT_STYLES | WS_TABSTOP | WS_VSCROLL | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,\n      WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_RIGHT | RTL_EX_STYLES | WS_EX_LEFTSCROLLBAR },\n    { WC_LISTVIEW,            // FIELD_LISTVIEW\n      DEFAULT_STYLES | WS_TABSTOP | LVS_SHOWSELALWAYS | LVS_SINGLESEL,\n      DEFAULT_STYLES | WS_TABSTOP | LVS_SHOWSELALWAYS | LVS_SINGLESEL,\n      WS_EX_CLIENTEDGE,\n      WS_EX_CLIENTEDGE | RTL_EX_STYLES | WS_EX_LEFTSCROLLBAR },\n    { WC_TREEVIEW,            // FIELD_TREEVIEW\n      DEFAULT_STYLES | WS_TABSTOP | TVS_DISABLEDRAGDROP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS,\n      DEFAULT_STYLES | WS_TABSTOP | TVS_DISABLEDRAGDROP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS,\n      WS_EX_CLIENTEDGE,\n      WS_EX_CLIENTEDGE | RTL_EX_STYLES | WS_EX_LEFTSCROLLBAR },\n    { TRACKBAR_CLASS,         // FIELD_TRACKBAR\n      DEFAULT_STYLES | WS_TABSTOP | TBS_AUTOTICKS,\n      DEFAULT_STYLES | WS_TABSTOP | TBS_AUTOTICKS,\n      0,\n      RTL_EX_STYLES },\n    { MONTHCAL_CLASS,         // FIELD_MONTHCALENDAR\n      DEFAULT_STYLES | WS_TABSTOP,\n      DEFAULT_STYLES | WS_TABSTOP,\n      0,\n      RTL_EX_STYLES }\n    };\n\n    if (pField->nType < 1 || pField->nType > (int)(_countof(ClassTable)))\n      continue;\n\n    DWORD dwStyle, dwExStyle;\n    if (bRTL) {\n      dwStyle = ClassTable[pField->nType - 1].dwRTLStyle;\n      dwExStyle = ClassTable[pField->nType - 1].dwRTLExStyle;\n    }\n    else {\n      dwStyle = ClassTable[pField->nType - 1].dwStyle;\n      dwExStyle = ClassTable[pField->nType - 1].dwExStyle;\n    }\n\n    // Required because we want to change this for FIELD_IMAGE image types.\n    LPTSTR pszClass = (LPTSTR)MALLOC(64 * sizeof(TCHAR));\n    strcpy(pszClass, ClassTable[pField->nType - 1].pszClass);\n\n// Convert From User Defined Units\n//================================================================\n\n    pField->RectPx = pField->RectUDU;\n    // MapDialogRect uses the font used when a dialog is created, and ignores\n    // any subsequent WM_SETFONT messages (like we used above); so use the main\n    // NSIS window for the conversion, instead of this one.\n    if(!bMUnit)\n      MapDialogRect(mainwnd, &pField->RectPx);\n\n// Implement support for negative coordinates\n//================================================================\n\n    if (pField->RectUDU.left < 0)\n      pField->RectPx.left += mainWndWidth;\n    if (pField->RectUDU.right < 0)\n      pField->RectPx.right += mainWndWidth;\n    if (pField->RectUDU.top < 0)\n      pField->RectPx.top += mainWndHeight;\n    if (pField->RectUDU.bottom < 0)\n      pField->RectPx.bottom += mainWndHeight;\n\n// Implement support for RTL\n//================================================================\n\n    if (bRTL) {\n      int right = pField->RectPx.right;\n      pField->RectPx.right = mainWndWidth - pField->RectPx.left;\n      pField->RectPx.left = mainWndWidth - right;\n    }\n\n// Initialize Controls Before Showing Them Up\n//================================================================\n    switch(pField->nType)\n    {\n      case FIELD_IMAGE:\n      // Integrated control for icons, cursors, bitmaps and videos w/o sound.\n      {\n        // Videos cannot be handled here. Only one message suffices for this,\n        // and this message has to have a control already created to work.\n\n        int nHeight = pField->RectPx.bottom - pField->RectPx.top;\n        int nWidth = pField->RectPx.right - pField->RectPx.left;\n\n        // Step 1: Load from file or from resource\n        //--------------------------------------------------------\n        LPTSTR pFileExtension = PathFindExtension(pField->pszText);\n        int nImageType;\n\n        // Handle icons first from executables and dlls\n        if(PathFileExists(pField->pszText) && (stricmp(pFileExtension, _T(\".exe\")) == 0 || stricmp(pFileExtension, _T(\".dll\")) == 0))\n        {\n          nImageType = IMAGE_ICON;\n\n          if(myatoi(pField->pszState) < 0)\n            pField->pszState = _T(\"0\");\n\n          HICON hIcon = NULL;\n\n          ExtractIconEx(\n            pField->pszText,\n            (UINT) myatoi(pField->pszState),\n            nWidth >= 32 && nHeight >= 32 ? &hIcon : NULL,\n            (nWidth >= 16 && nWidth < 32) && (nHeight >= 16 && nHeight < 32) ? &hIcon : NULL, 1);\n          pField->hImage = (HBITMAP)hIcon;\n\n          if(pField->nFlags & FLAG_RESIZETOFIT)\n            pField->hImage = (HBITMAP)CopyImage(pField->hImage, nImageType, nWidth, nHeight, 0);\n        }\n        else if(PathFileExists(pField->pszText) && (stricmp(pFileExtension, _T(\".ico\")) == 0 || stricmp(pFileExtension, _T(\".cur\")) == 0 || stricmp(pFileExtension, _T(\".ani\")) == 0 || stricmp(pFileExtension, _T(\".bmp\")) == 0))\n        {\n          if(stricmp(pFileExtension, _T(\".ico\")) == 0)\n            nImageType = IMAGE_ICON;\n          else if(stricmp(pFileExtension, _T(\".cur\")) == 0 || stricmp(pFileExtension, _T(\".ani\")) == 0)\n            nImageType = IMAGE_CURSOR;\n          else if(stricmp(pFileExtension, _T(\".bmp\")) == 0)\n            nImageType = IMAGE_BITMAP;\n\n          pField->hImage = (HBITMAP)LoadImage(m_hInstance, pField->pszText, nImageType, (pField->nFlags & FLAG_RESIZETOFIT) ? nWidth : 0, (pField->nFlags & FLAG_RESIZETOFIT) ? nHeight : 0, LR_LOADFROMFILE);\n        }\n        else if(PathFileExists(pField->pszText) && stricmp(pFileExtension, _T(\".avi\")) == 0)\n          pField->nDataType = IMAGE_TYPE_ANIMATION;\n        else if(PathFileExists(pField->pszText) && (\n                 //Raster Images (OLE)\n                 stricmp(pFileExtension, _T(\".gif\")) == 0 ||\n                 stricmp(pFileExtension, _T(\".jpg\")) == 0 ||\n                 stricmp(pFileExtension, _T(\".jpeg\")) == 0))\n                 //Vector Images (OLE not supported yet)\n                 //stricmp(pFileExtension, _T(\".wmf\")) == 0\n        {\n          if(stricmp(pFileExtension, _T(\".gif\")) == 0 ||\n             stricmp(pFileExtension, _T(\".jpg\")) == 0 ||\n             stricmp(pFileExtension, _T(\".jpeg\")) == 0)\n          pField->nDataType = IMAGE_TYPE_OLE;\n\n          //if(pField->nDataType == IMAGE_TYPE_OLE)\n          //{\n            HANDLE hFile = CreateFile(pField->pszText, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);\n            \n            if (hFile == INVALID_HANDLE_VALUE)\n              break;\n\n            DWORD nFileSize = GetFileSize(hFile, 0);\n            HGLOBAL hFileGlobal = GlobalAlloc(GPTR, nFileSize);\n\n            if (!hFileGlobal)\n            {\n              CloseHandle(hFile);\n              break;\n            }\n\n            LPVOID lpFileLocked = GlobalLock(hFileGlobal);\n            if (!lpFileLocked)\n            {\n              CloseHandle(hFile);\n              GlobalFree(hFileGlobal);\n              break;\n            }\n\n            ReadFile(hFile, lpFileLocked, nFileSize, &nFileSize, 0);\n\n            GlobalUnlock(hFileGlobal);\n            CloseHandle(hFile);\n\n            LPSTREAM lpStream;\n            if (CreateStreamOnHGlobal(hFileGlobal, FALSE, &lpStream) != S_OK || !lpStream)\n            {\n              GlobalFree(hFileGlobal);\n              break;\n            }\n\n            if (OleLoadPicture(lpStream, 0, FALSE, IID_IPicture, (void **)&pField->nImageInterface) != S_OK)\n              pField->nImageInterface = NULL;\n\n            lpStream->Release();\n            GlobalFree(hFileGlobal);\n\n            if (!pField->nImageInterface)\n              break;\n\n            pField->nImageInterface->get_Handle((OLE_HANDLE *)&pField->hImage);\n\n            if (pField->hImage)\n              pField->hImage = (HBITMAP)CopyImage(pField->hImage, IMAGE_BITMAP, (pField->nFlags & FLAG_RESIZETOFIT) ? nWidth : 0, (pField->nFlags & FLAG_RESIZETOFIT) ? nHeight : 0, LR_COPYRETURNORG);\n\n            pField->nImageInterface->Release();\n          //}\n        }\n        else\n        {\n          struct TrioTableEntry {\n            int   nDataType;\n            const TCHAR *pszName;\n            int   nValue;\n          };\n\n          // Icon Flags\n          //-------------------------------\n          // These below are resource numbers. Needs to use MAKEINTRESOURCE later.\n          static TrioTableEntry IconTable[] =\n          {\n            // Icon Flags\n            { IMAGE_ICON, _T(\"APPLICATION\"), 32512 },\n            { IMAGE_ICON, _T(\"EXCLAMATION\"), 32515 },\n            { IMAGE_ICON, _T(\"INFORMATION\"), 32516 },\n            { IMAGE_ICON, _T(\"QUESTION\"),    32514 },\n            { IMAGE_ICON, _T(\"STOP\"),        32513 },\n            { IMAGE_ICON, _T(\"WINLOGO\"),     32517 },\n\n            // Cursor Flags\n            { IMAGE_CURSOR, _T(\"APPSTARTING\"), 32650 },\n            { IMAGE_CURSOR, _T(\"ARROW\"),       32512 },\n            { IMAGE_CURSOR, _T(\"CROSS\"),       32515 },\n            { IMAGE_CURSOR, _T(\"HAND\"),        32649 },\n            { IMAGE_CURSOR, _T(\"HELP\"),        32651 },\n            { IMAGE_CURSOR, _T(\"IBEAM\"),       32513 },\n            { IMAGE_CURSOR, _T(\"NO\"),          32648 },\n            { IMAGE_CURSOR, _T(\"SIZEALL\"),     32646 },\n            { IMAGE_CURSOR, _T(\"SIZENESW\"),    32643 },\n            { IMAGE_CURSOR, _T(\"SIZENS\"),      32645 },\n            { IMAGE_CURSOR, _T(\"SIZENWSE\"),    32642 },\n            { IMAGE_CURSOR, _T(\"SIZEWE\"),      32644 },\n            { IMAGE_CURSOR, _T(\"UPARROW\"),     32516 },\n            { IMAGE_CURSOR, _T(\"WAIT\"),        32514 },\n\n            // Bitmap Flags\n            { IMAGE_BITMAP, _T(\"BTNCORNERS\"),  32758 },\n            { IMAGE_BITMAP, _T(\"BTSIZE\"),      32761 },\n            { IMAGE_BITMAP, _T(\"CHECK\"),       32760 },\n            { IMAGE_BITMAP, _T(\"CHECKBOXES\"),  32759 },\n            { IMAGE_BITMAP, _T(\"CLOSE\"),       32754 },\n            { IMAGE_BITMAP, _T(\"COMBO\"),       32738 },\n            { IMAGE_BITMAP, _T(\"DNARROW\"),     32752 },\n            { IMAGE_BITMAP, _T(\"DNARROWD\"),    32742 },\n            { IMAGE_BITMAP, _T(\"DNARROWI\"),    32736 },\n            { IMAGE_BITMAP, _T(\"LFARROW\"),     32750 },\n            { IMAGE_BITMAP, _T(\"LFARROWD\"),    32740 },\n            { IMAGE_BITMAP, _T(\"LFARROWI\"),    32734 },\n            { IMAGE_BITMAP, _T(\"MNARROW\"),     32739 },\n            { IMAGE_BITMAP, _T(\"REDUCE\"),      32749 },\n            { IMAGE_BITMAP, _T(\"REDUCED\"),     32746 },\n            { IMAGE_BITMAP, _T(\"RESTORE\"),     32747 },\n            { IMAGE_BITMAP, _T(\"RESTORED\"),    32744 },\n            { IMAGE_BITMAP, _T(\"RGARROW\"),     32751 },\n            { IMAGE_BITMAP, _T(\"RGARROWD\"),    32741 },\n            { IMAGE_BITMAP, _T(\"RGARROWI\"),    32735 },\n            { IMAGE_BITMAP, _T(\"SIZE\"),        32766 },\n            { IMAGE_BITMAP, _T(\"UPARROW\"),     32753 },\n            { IMAGE_BITMAP, _T(\"UPARROWD\"),    32743 },\n            { IMAGE_BITMAP, _T(\"UPARROWI\"),    32737 },\n            { IMAGE_BITMAP, _T(\"ZOOM\"),        32748 },\n            { IMAGE_BITMAP, _T(\"ZOOMD\"),       32745 },\n\n            { IMAGE_ICON, NULL, 0 } //NSIS application icon.\n          };\n\n          WORD nIcon = 103;\n          nImageType = IMAGE_ICON;\n          HINSTANCE hInstance = NULL;\n\n          //LookupToken adapted to TrioTableEntry.\n          for (int i = 0; IconTable[i].pszName; i++)\n            if (!lstrcmpi(pField->pszState, IconTable[i].pszName))\n            {\n              nImageType = IconTable[i].nDataType;\n              nIcon = IconTable[i].nValue;\n            }\n\n          pField->hImage = (HBITMAP)LoadImage((nIcon == 103) ? GetModuleHandle(0) : NULL, MAKEINTRESOURCE(nIcon), nImageType, 0, 0, LR_SHARED);\n\n          if(pField->nFlags & FLAG_RESIZETOFIT)\n            pField->hImage = (HBITMAP)CopyImage(pField->hImage, nImageType, nWidth, nHeight, LR_COPYFROMRESOURCE);\n        }\n\n        if(nImageType == IMAGE_BITMAP)\n          pField->nDataType = IMAGE_TYPE_BITMAP;\n        else if(nImageType == IMAGE_ICON)\n          pField->nDataType = IMAGE_TYPE_ICON;\n        else if(nImageType == IMAGE_CURSOR)\n          pField->nDataType = IMAGE_TYPE_CURSOR;\n        //IMAGE_TYPE_ANIMATION and IMAGE_TYPE_OLE were already set at this point.\n\n        // Step 2: Transform into specific internal controls\n        //--------------------------------------------------------\n        switch(pField->nDataType)\n        {\n          case IMAGE_TYPE_BITMAP:\n          case IMAGE_TYPE_OLE:\n          case IMAGE_TYPE_GDIPLUS:\n          {\n            pszClass = _T(\"STATIC\");\n            dwStyle |= SS_BITMAP | SS_NOTIFY;\n            break;\n          }\n          case IMAGE_TYPE_ICON:\n          case IMAGE_TYPE_CURSOR:\n          {\n            pszClass = _T(\"STATIC\");\n            dwStyle |= SS_ICON | SS_NOTIFY;\n            break;\n          }\n          case IMAGE_TYPE_ANIMATION:\n          {\n            pszClass = ANIMATE_CLASS;\n            dwStyle |= ACS_TIMER | ACS_CENTER;\n            break;\n          }\n        }\n        break;\n      }\n      case FIELD_RICHTEXT:\n      {\n        // Load the dll for the RichText in the memory\n        //--------------------------------------------------------\n        if(!LoadLibrary(_T(\"riched20.dll\"))) //Version 2\n        {\n          LoadLibrary(_T(\"riched32.dll\")); //Version 1\n\n          pszClass = _T(\"RichEdit\");\n        }\n      }\n    }\n\n// Assign To Each Control Type Optional Flags\n//================================================================\n    TCHAR *title = pField->pszText;\n\n    switch (pField->nType) {\n      case FIELD_IMAGE:\n        title = NULL; // otherwise it is treated as the name of a resource\n        if(pField->nDataType == IMAGE_TYPE_ANIMATION)\n          if (pField->nFlags & FLAG_TRANSPARENT)\n            dwStyle |= ACS_TRANSPARENT;    \n        break;\n      case FIELD_LABEL:\n        if(!(pField->nNotify & NOTIFY_CONTROL_ONCLICK) && !(pField->nNotify & NOTIFY_CONTROL_ONDBLCLICK))\n          dwStyle &= ~SS_NOTIFY;\n\n        if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n          dwStyle &= ~SS_OWNERDRAW;\n        break;\n      case FIELD_CHECKBOX:\n        if (pField->nFlags & FLAG_READONLY)\n        {\n          dwStyle &= ~BS_AUTOCHECKBOX;\n          if (pField->nFlags & FLAG_3STATE)\n            dwStyle |= BS_3STATE;\n          else\n            dwStyle |= BS_CHECKBOX;\n        }\n        else\n        {\n          if (pField->nFlags & FLAG_3STATE)\n          {\n            dwStyle &= ~BS_AUTOCHECKBOX;\n            dwStyle |= BS_AUTO3STATE;\n          }\n        }\n        break;\n      case FIELD_RADIOBUTTON:\n        if (pField->nFlags & FLAG_READONLY)\n        {\n          dwStyle &= ~BS_AUTORADIOBUTTON;\n          dwStyle |= BS_RADIOBUTTON;\n        }\n        break;\n      case FIELD_TEXT:\n        title = pField->pszState;\n      case FIELD_RICHTEXT:\n        // Microsoft says that password style cannot be used with\n        // multiline style, but in use, these can be used together.\n        // (Thank you Microsoft.)\n        if (pField->nFlags & FLAG_PASSWORD)\n          dwStyle |= ES_PASSWORD;\n        if (pField->nFlags & FLAG_ONLYNUMBERS)\n          dwStyle |= ES_NUMBER;\n        if (pField->nFlags & FLAG_WANTRETURN)\n          dwStyle |= ES_WANTRETURN;\n        if (pField->nFlags & FLAG_READONLY)\n          dwStyle |= ES_READONLY;\n        if (pField->nFlags & FLAG_VSCROLL)\n          dwStyle |= WS_VSCROLL;\n        if (pField->nFlags & FLAG_MULTILINE)\n        {\n          dwStyle |= ES_MULTILINE | ES_AUTOVSCROLL;\n\n          // Enable word-wrap unless we have a horizontal scroll bar\n          // or it has been explicitly disallowed\n          if (!(pField->nFlags & (FLAG_HSCROLL | FLAG_NOWORDWRAP)))\n            dwStyle &= ~ES_AUTOHSCROLL;\n\n          ConvertNewLines(pField->pszState);\n\n          // If multiline-readonly then hold the text back until after the\n          // initial focus has been set. This is so the text is not initially\n          // selected - useful for License Page look-a-likes.\n          if (pField->nFlags & FLAG_READONLY)\n            title = NULL;\n        }\n        break;\n      case FIELD_COMBOBOX:\n        dwStyle |= (pField->nFlags & FLAG_DROPLIST) ? CBS_DROPDOWNLIST : CBS_DROPDOWN;\n        if (pField->nFlags & FLAG_VSCROLL)\n          dwStyle |= CBS_DISABLENOSCROLL;\n        title = pField->pszState;\n        if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n          dwStyle &= ~CBS_OWNERDRAWFIXED;\n        break;\n      case FIELD_LISTBOX:\n        if (pField->nFlags & FLAG_MULTISELECT)\n          dwStyle |= LBS_MULTIPLESEL;\n        if (pField->nFlags & FLAG_EXTENDEDSELECT)\n          dwStyle |= LBS_EXTENDEDSEL;\n        if (pField->nFlags & FLAG_VSCROLL)\n          dwStyle |= LBS_DISABLENOSCROLL;\n        if (pField->pszText)\n          if(myatoi(pField->pszText) > 0)\n            dwStyle |= LBS_MULTICOLUMN;\n        if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n          dwStyle &= ~LBS_OWNERDRAWFIXED;\n        break;\n      case FIELD_TREEVIEW:\n        if (pField->nFlags & FLAG_CHECKBOXES && FileExists(pField->pszStateImageList))\n          dwStyle |= TVS_CHECKBOXES;\n        else\n          pField->nFlags &= ~FLAG_CHECKBOXES;\n        if (pField->nFlags & FLAG_EDITLABELS)\n          dwStyle |= TVS_EDITLABELS;\n        break;\n      case FIELD_LISTVIEW:\n        if (pField->nFlags & FLAG_EDITLABELS)\n          dwStyle |= LVS_EDITLABELS;\n        if (pField->nFlags & FLAG_ICON_VIEW)\n          dwStyle |= LVS_ICON;\n        if (pField->nFlags & FLAG_LIST_VIEW)\n          dwStyle |= LVS_LIST;\n        if (pField->nFlags & FLAG_SMALLICON_VIEW)\n          dwStyle |= LVS_SMALLICON;\n        if (pField->nFlags & FLAG_REPORT_VIEW)\n          dwStyle |= LVS_REPORT;\n        if (pField->nFlags & FLAG_MULTISELECT)\n          dwStyle &= ~LVS_SINGLESEL;\n        break;\n      case FIELD_BUTTON:\n        if (pField->nFlags & FLAG_BITMAP)\n          dwStyle |= BS_BITMAP;\n        if (pField->nFlags & FLAG_ICON)\n          dwStyle |= BS_ICON;\n        break;\n      case FIELD_PROGRESSBAR:\n        if (pField->nFlags & FLAG_SMOOTH)\n          dwStyle |= PBS_SMOOTH;\n        if (pField->nFlags & FLAG_VSCROLL)\n          dwStyle |= PBS_VERTICAL;\n        break;\n      case FIELD_TRACKBAR:\n        if (pField->nFlags & FLAG_VSCROLL)\n          dwStyle |= TBS_VERT;\n        if (pField->nFlags & FLAG_NO_TICKS)\n          dwStyle |= TBS_NOTICKS;\n        break;\n      case FIELD_DATETIME:\n        if (pField->nFlags & FLAG_UPDOWN)\n          dwStyle |= DTS_TIMEFORMAT;\n        break;\n      case FIELD_MONTHCALENDAR:\n        if (pField->nFlags & FLAG_NOTODAY)\n          dwStyle |= MCS_NOTODAY | MCS_NOTODAYCIRCLE;\n        if (pField->nFlags & FLAG_WEEKNUMBERS)\n          dwStyle |= MCS_WEEKNUMBERS;\n        break;\n      case FIELD_UPDOWN:\n        if (pField->nFlags & FLAG_HSCROLL)\n          dwStyle |= UDS_HORZ;\n        if (pField->nFlags & FLAG_WRAP)\n          dwStyle |= UDS_WRAP;\n        break;\n    }\n    if (pField->nFlags & FLAG_GROUP) dwStyle |= WS_GROUP;\n    if (pField->nFlags & FLAG_HSCROLL && (pField->nType == FIELD_TEXT || pField->nType == FIELD_RICHTEXT)) dwStyle |= WS_HSCROLL;\n    if (pField->nFlags & FLAG_VSCROLL && (pField->nType == FIELD_TEXT || pField->nType == FIELD_LISTBOX || pField->nType == FIELD_COMBOBOX)) dwStyle |= WS_VSCROLL;\n    if (pField->nFlags & FLAG_DISABLED) dwStyle |= WS_DISABLED;\n    if (pField->nFlags & FLAG_NOTABSTOP) dwStyle &= ~WS_TABSTOP;\n\n// Assign To Each Control Type An Optional Align Flag\n//================================================================\n\n    switch (pField->nType) {\n      case FIELD_UPDOWN:\n        if (pField->nAlign == ALIGN_LEFT)\n        {\n          dwStyle &= ~UDS_ALIGNRIGHT;\n          dwStyle |= UDS_ALIGNLEFT;\n        }\n        else if (pField->nAlign == ALIGN_RIGHT)\n        {\n          dwStyle &= ~UDS_ALIGNLEFT;\n          dwStyle |= UDS_ALIGNRIGHT;\n        }\n        break;\n      case FIELD_CHECKBOX:\n        if (pField->nAlign == ALIGN_LEFT)\n          dwStyle &= ~BS_LEFTTEXT;\n        else if (pField->nAlign == ALIGN_RIGHT)\n          dwStyle |= BS_LEFTTEXT;\n        break;\n      case FIELD_DATETIME:\n        if (pField->nAlign == ALIGN_LEFT)\n          dwStyle &= ~DTS_RIGHTALIGN;\n        else if (pField->nAlign == ALIGN_RIGHT)\n          dwStyle |= DTS_RIGHTALIGN;\n        break;\n      case FIELD_TRACKBAR:\n        if (pField->nFlags & FLAG_VSCROLL)\n        {\n          if (pField->nAlign == ALIGN_LEFT)\n            dwStyle |= TBS_LEFT;\n          else if (pField->nAlign == ALIGN_CENTER)\n            dwStyle |= TBS_BOTH;\n          else if (pField->nAlign == ALIGN_RIGHT)\n            dwStyle |= TBS_RIGHT;\n        }\n        else\n        {\n          if (pField->nVAlign == VALIGN_TOP)\n            dwStyle |= TBS_TOP;\n          else if (pField->nVAlign == VALIGN_CENTER)\n            dwStyle |= TBS_BOTH;\n          else if (pField->nVAlign == VALIGN_BOTTOM)\n            dwStyle |= TBS_BOTTOM;\n        }\n        break;\n    }\n\n    switch (pField->nType) {\n      case FIELD_LABEL:\n        if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        {\n          if (pField->nTxtAlign == ALIGN_TEXT_LEFT)\n            dwStyle |= SS_LEFT;\n          else if (pField->nTxtAlign == ALIGN_TEXT_CENTER)\n            dwStyle |= SS_CENTER;\n          else if (pField->nTxtAlign == ALIGN_TEXT_RIGHT)\n            dwStyle |= SS_RIGHT;\n        }\n      case FIELD_BUTTON:\n        if (pField->nTxtVAlign == VALIGN_TEXT_TOP)\n          dwStyle |= BS_TOP;\n        else if (pField->nTxtVAlign == VALIGN_TEXT_CENTER)\n          dwStyle |= BS_VCENTER;\n        else if (pField->nTxtVAlign == VALIGN_TEXT_BOTTOM)\n          dwStyle |= BS_BOTTOM;\n      case FIELD_CHECKBOX:\n      case FIELD_RADIOBUTTON:\n      case FIELD_GROUPBOX:\n        if (pField->nTxtAlign == ALIGN_TEXT_LEFT)\n        {\n          dwStyle &= ~BS_CENTER;\n          dwStyle &= ~BS_RIGHT;\n          dwStyle |= BS_LEFT;\n        }\n        else if (pField->nTxtAlign == ALIGN_TEXT_CENTER)\n        {\n          dwStyle &= ~BS_LEFT;\n          dwStyle &= ~BS_RIGHT;\n          dwStyle |= BS_CENTER;\n        }\n        else if (pField->nTxtAlign == ALIGN_TEXT_RIGHT)\n        {\n          dwStyle &= ~BS_LEFT;\n          dwStyle &= ~BS_CENTER;\n          dwStyle |= BS_RIGHT;\n        }\n        break;\n      case FIELD_TEXT:\n        if (pField->nTxtAlign == ALIGN_LEFT)\n        {\n          dwStyle &= ~ES_CENTER;\n          dwStyle &= ~ES_RIGHT;\n          dwStyle |= ES_LEFT;\n        }\n        else if (pField->nTxtAlign == ALIGN_CENTER)\n        {\n          dwStyle &= ~ES_LEFT;\n          dwStyle &= ~ES_RIGHT;\n          dwStyle |= ES_CENTER;\n        }\n        else if (pField->nTxtAlign == ALIGN_RIGHT)\n        {\n          dwStyle &= ~ES_LEFT;\n          dwStyle &= ~ES_CENTER;\n          dwStyle |= ES_RIGHT;\n        }\n        break;\n    }\n\n// Create Control\n//================================================================\n    HWND hwCtrl = pField->hwnd = CreateWindowEx(\n      dwExStyle,\n      pszClass,\n      title,\n      dwStyle,\n      pField->RectPx.left,\n      pField->RectPx.top,\n      pField->RectPx.right - pField->RectPx.left,\n      pField->RectPx.bottom - pField->RectPx.top,\n      hConfigWindow,\n      (HMENU)pField->nControlID,\n      m_hInstance,\n      NULL\n    );\n\n    FREE(pszClass);\n\n// Create ToolTip\n//================================================================\n    if(pField->pszToolTipText) {\n\n      if(!bRTL)\n        dwExStyle = WS_EX_TOPMOST;\n      else\n        dwExStyle = WS_EX_TOPMOST | RTL_EX_STYLES;\n\n      pField->hwToolTip = CreateWindowEx(\n        dwExStyle,\n        TOOLTIPS_CLASS,\n        NULL,\n        pField->nToolTipFlags,\n        CW_USEDEFAULT,\n        CW_USEDEFAULT,\n        CW_USEDEFAULT,\n        CW_USEDEFAULT,\n        pField->hwnd,\n        NULL,\n        m_hInstance,\n        NULL\n        );\n\n      SetWindowPos(pField->hwToolTip,\n        HWND_TOPMOST,\n        0,\n        0,\n        0,\n        0,\n        SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);\n\n      TOOLINFO ti;\n\n      ti.cbSize = sizeof(TOOLINFO);\n      if(!bRTL)\n        ti.uFlags = TTF_TRANSPARENT | TTF_SUBCLASS | TTF_IDISHWND;\n      else\n        ti.uFlags = TTF_TRANSPARENT | TTF_SUBCLASS | TTF_IDISHWND | TTF_RTLREADING;\n      ti.uId = (int)pField->hwnd;\n      ti.lpszText = pField->pszToolTipText;\n\n      mySendMessage(pField->hwToolTip, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);\n\n      mySendMessage(pField->hwToolTip, TTM_SETMAXTIPWIDTH, 0, (LPARAM) (INT) pField->nToolTipMaxWidth);\n\n      if(pField->crToolTipTxtColor != 0xFFFFFFFF)\n        mySendMessage(pField->hwToolTip,TTM_SETTIPTEXTCOLOR, (WPARAM) (COLORREF) pField->crToolTipTxtColor, 0);\n      if(pField->crToolTipBgColor != 0xFFFFFFFF)\n        mySendMessage(pField->hwToolTip,TTM_SETTIPBKCOLOR, (WPARAM) (COLORREF) pField->crToolTipBgColor, 0);\n\n      if(pField->nToolTipFlags & TTS_BALLOON)\n        mySendMessage(pField->hwToolTip, TTM_SETTITLE, pField->nToolTipIcon, (LPARAM) (LPCTSTR) pField->pszToolTipTitle);\n    }\n\n    {\n      TCHAR szField[64];\n      TCHAR szHwnd[64];\n      wsprintf(szField, _T(\"Field %d\"), pField->nField);\n      wsprintf(szHwnd, _T(\"%d\"), hwCtrl);\n      WritePrivateProfileString(szField, _T(\"HWND\"), szHwnd, pszFilename);\n    }\n\n// Set Configurations For Each Control Type\n//================================================================\n    if (hwCtrl) {\n\n  // Font\n  //--------------------------------------------------------------\n      // Sets the font of IO window to be the same as the main window by default\n      mySendMessage(hwCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);\n\n      // Set new font based on control settings\n      {\n        LOGFONT lf;\n        HDC hDC = GetDC(hwCtrl);\n        HFONT OldFont;\n\n        // CreateFont now\n\n        GetObject(hFont, sizeof(lf), (LPVOID)&lf);\n\n        if(pField->pszFontName)\n          strncpy(lf.lfFaceName,pField->pszFontName, 32);\n        if(pField->nFontHeight)\n          lf.lfHeight = -MulDiv(pField->nFontHeight, GetDeviceCaps(hDC, LOGPIXELSY), 72);\n        if(pField->nFontWidth)\n          lf.lfWidth = pField->nFontWidth;\n        if(pField->nFontBold)\n          lf.lfWeight = 700;\n        if(pField->nFontItalic)\n          lf.lfItalic = TRUE;\n        if(pField->nFontUnderline)\n          lf.lfUnderline = TRUE;\n        if(pField->nFontStrikeOut)\n          lf.lfStrikeOut = TRUE;\n\n        OldFont = (HFONT)SelectObject(hDC, CreateFontIndirect(&lf));\n\n        mySendMessage(hwCtrl, WM_SETFONT, (WPARAM) CreateFontIndirect(&lf), TRUE);\n\n        DeleteObject(SelectObject(hDC, OldFont));\n        ReleaseDC(hwCtrl, hDC);\n      }\n\n  // Configurations for each control type\n  //--------------------------------------------------------------\n\n      // make sure we created the window, then set additional attributes\n      switch (pField->nType) {\n        case FIELD_IMAGE:\n        {\n          switch(pField->nDataType)\n          {\n            case IMAGE_TYPE_BITMAP:\n            case IMAGE_TYPE_OLE:\n            case IMAGE_TYPE_GDIPLUS:\n            {\n              if (pField->nFlags & FLAG_TRANSPARENT)\n              {\n                MakeTransparentAreaFromBitmap(hwCtrl, (HBITMAP) pField->hImage);\n              }\n \n              mySendMessage(hwCtrl,STM_SETIMAGE,IMAGE_BITMAP,(LPARAM)pField->hImage);\n\n              // Center the image in the requested space.\n              // Cannot use SS_CENTERIMAGE because it behaves differently on XP to\n              // everything else.  (Thank you Microsoft.)\n              RECT  bmp_rect;\n              GetClientRect(hwCtrl, &bmp_rect);\n              bmp_rect.left = (pField->RectPx.left + pField->RectPx.right - bmp_rect.right) / 2;\n              bmp_rect.top = (pField->RectPx.top + pField->RectPx.bottom - bmp_rect.bottom) / 2;\n              SetWindowPos(hwCtrl, NULL, bmp_rect.left, bmp_rect.top, 0, 0,SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);\n              break;\n            }\n            case IMAGE_TYPE_ICON:\n            {\n              if (pField->nFlags & FLAG_TRANSPARENT)\n              {\n                ICONINFO csII;\n                if(GetIconInfo((HICON)pField->hImage, &csII))\n                {\n                  MakeTransparentAreaFromBitmap(hwCtrl, csII.hbmColor);\n                }\n              }\n              mySendMessage(hwCtrl,STM_SETIMAGE,IMAGE_ICON,(LPARAM)pField->hImage);\n              break;\n            }\n            case IMAGE_TYPE_CURSOR:\n            {\n              mySendMessage(hwCtrl,STM_SETIMAGE,IMAGE_CURSOR,(LPARAM)pField->hImage);\n              break;\n            }\n            case IMAGE_TYPE_ANIMATION:\n            {\n              if (pField->pszText) {\n                mySendMessage(hwCtrl, ACM_OPEN, 0, (LPARAM) pField->pszText);\n                if(lstrcmp(pField->pszState,_T(\"\"))==0)\n                  mySendMessage(hwCtrl, ACM_PLAY, -1, MAKELONG(0, -1));\n                else\n                {\n                  UINT nTimes = myatoi(pField->pszState);\n\n                  if (nTimes != 0) {\n                    if((pField->nMaxLength == NULL)&&(pField->nMinLength == NULL))\n                      mySendMessage(hwCtrl, ACM_PLAY, nTimes, MAKELONG(0, -1));\n                    else if((pField->nMaxLength != NULL)&&(pField->nMinLength == NULL)&&(0 <= pField->nMaxLength))\n                      mySendMessage(hwCtrl, ACM_PLAY, nTimes, MAKELONG(0, pField->nMaxLength));\n                    else if((pField->nMaxLength == NULL)&&(pField->nMinLength != NULL)&&(pField->nMinLength <= 65536))\n                      mySendMessage(hwCtrl, ACM_PLAY, nTimes, MAKELONG(pField->nMinLength, -1));\n                    else if((pField->nMaxLength != NULL)&&(pField->nMinLength != NULL)&&(pField->nMinLength <= pField->nMaxLength))\n                      mySendMessage(hwCtrl, ACM_PLAY, nTimes, MAKELONG(pField->nMinLength, pField->nMaxLength));\n                    else\n                      pField->nMinLength = pField->nMaxLength = NULL;\n                  }\n                }\n              }\n              break;\n            }\n          }\n          break;\n        }\n        case FIELD_TEXT:\n          mySendMessage(hwCtrl, EM_LIMITTEXT, (WPARAM)pField->nMaxLength, (LPARAM)0);\n\n          if(pField->nFlags & FLAG_PASSWORD)\n          {\n            if(pField->pszText)\n            {\n              TCHAR* pszChar = (TCHAR*)MALLOC((1+1)*sizeof(TCHAR));\n              strncpy(pszChar, pField->pszText, 1+1);\n              mySendMessage(hwCtrl, EM_SETPASSWORDCHAR, (WPARAM) *pszChar, 0);\n            }\n            else\n              mySendMessage(hwCtrl, EM_SETPASSWORDCHAR, (WPARAM) '*', 0);\n          }\n          break;\n\n        case FIELD_UPDOWN:\n        {\n          if((pField->nMaxLength == NULL)&&(pField->nMinLength == NULL))\n            mySendMessage(hwCtrl, UDM_SETRANGE32, -0x7FFFFFFE, 0x7FFFFFFE);\n          else if((pField->nMaxLength != NULL)&&(pField->nMinLength == NULL)&&(-2147483646 <= pField->nMaxLength))\n            mySendMessage(hwCtrl, UDM_SETRANGE32, -0x7FFFFFFE, pField->nMaxLength);\n          else if((pField->nMaxLength == NULL)&&(pField->nMinLength != NULL)&&(pField->nMinLength <= 2147483646))\n            mySendMessage(hwCtrl, UDM_SETRANGE32, pField->nMinLength,0x7FFFFFFE);\n          else if((pField->nMaxLength != NULL)&&(pField->nMinLength != NULL)&&(pField->nMinLength <= pField->nMaxLength))\n             mySendMessage(hwCtrl, UDM_SETRANGE32, pField->nMinLength, pField->nMaxLength);\n          else\n            pField->nMinLength = pField->nMaxLength = NULL;\n\n          if (pField->pszState)\n            mySendMessage(hwCtrl, UDM_SETPOS32, 0, myatoi(pField->pszState));\n          break;\n        }\n        case FIELD_CHECKBOX:\n        case FIELD_RADIOBUTTON:\n          switch (pField->pszState[0])\n          {\n            case _T('1'):\n            {\n              mySendMessage(hwCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);\n              break;\n            }\n            case _T('2'):\n            {\n              if(pField->nFlags & FLAG_3STATE)\n                mySendMessage(hwCtrl, BM_SETCHECK, (WPARAM)BST_INDETERMINATE, 0);\n              break;\n            }\n          }\n          break;\n\n        case FIELD_COMBOBOX:\n        case FIELD_LISTBOX:\n          // if this is a listbox or combobox, we need to add the list items.\n          if (pField->pszListItems)\n          {\n            UINT nAddMsg, nFindMsg, nSetSelMsg;\n\n            switch(pField->nType)\n            {\n              case FIELD_COMBOBOX:\n              {\n                nAddMsg = CB_ADDSTRING;\n                nFindMsg = CB_FINDSTRINGEXACT;\n                nSetSelMsg = CB_SETCURSEL;\n\n                // Using the same limit for text controls because\n                // nobody will write 32KB of text in a single line.\n                mySendMessage(hwCtrl, CB_LIMITTEXT, 32766, 0);\n\n                break;\n              }\n              case FIELD_LISTBOX:\n              {\n                nAddMsg = LB_ADDSTRING;\n                nFindMsg = LB_FINDSTRINGEXACT;\n                nSetSelMsg = LB_SETCURSEL;\n\n                if(pField->pszText && myatoi(pField->pszText) > 0)\n                  mySendMessage(hwCtrl, LB_SETCOLUMNWIDTH, (WPARAM) myatoi(pField->pszText), 0);\n              }\n            }\n\n            int nResult = 0;\n\n            LPTSTR pszStart, pszEnd;\n            pszStart = pszEnd = pField->pszListItems;\n\n            while(nResult = IOLI_NextItem(pField->pszListItems, &pszStart, &pszEnd, 1))\n            {\n              if((nResult == 5 && lstrcmp(pszStart,_T(\"\")) == 0) || nResult == 6)\n                break;\n\n              mySendMessage(hwCtrl, nAddMsg, 0, (LPARAM) pszStart);\n\n              IOLI_RestoreItemStructure(pField->pszListItems, &pszStart, &pszEnd, nResult);\n            }\n            \n            if(pField->pszState)\n            {\n              if(pField->nType == FIELD_LISTBOX && pField->nFlags & (FLAG_MULTISELECT|FLAG_EXTENDEDSELECT))\n              {\n                mySendMessage(hwCtrl, LB_SETSEL, FALSE, (LPARAM)-1);\n\n                pszStart = pszEnd = pField->pszState;\n\n                while(nResult = IOLI_NextItem(pField->pszState, &pszStart, &pszEnd, 1))\n                {\n                  if((nResult == 5 && lstrcmp(pszStart,_T(\"\")) == 0) || nResult == 6)\n                    break;\n\n                  INT_PTR nItem = mySendMessage(hwCtrl, LB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pszStart);\n                  if (nItem != LB_ERR)\n                    mySendMessage(hwCtrl, LB_SETSEL, TRUE, nItem);\n\n                  IOLI_RestoreItemStructure(pField->pszState, &pszStart, &pszEnd, nResult);\n                }\n              }\n              else\n              {\n                INT_PTR nItem = mySendMessage(hwCtrl, nFindMsg, (WPARAM)-1, (LPARAM)pField->pszState);\n\n                if (nItem != CB_ERR) // CB_ERR == LB_ERR == -1\n                  mySendMessage(hwCtrl, nSetSelMsg, nItem, 0);\n                else\n                if(pField->nType == FIELD_COMBOBOX && !(pField->nFlags & FLAG_DROPLIST))\n                  mySendMessage(hwCtrl, WM_SETTEXT, 0, (LPARAM)pField->pszState);\n              }\n            }\n          }\n          break;\n\n        case FIELD_TREEVIEW:\n        {\n          // \"ListItems\" has to exist in order to continue\n          if (pField->pszListItems && lstrlen(pField->pszListItems))\n          {\n\n            // Step 1: Implement image list feature.\n            //----------------------------------------------------------------\n            if(pField->pszStateImageList && pField->nFlags & FLAG_CHECKBOXES)\n            {\n              if(FileExists(pField->pszStateImageList))\n              {\n                // Set the image list to the TreeView control\n                HBITMAP hBitmap = (HBITMAP)LoadImage(0, pField->pszStateImageList, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);\n                pField->hStateImageList = (HIMAGELIST)ImageList_Create(16, 16, ILC_COLOR32|ILC_MASK, 6, 0);\n                ImageList_AddMasked(pField->hStateImageList,hBitmap,RGB(255,0,255));\n                TreeView_SetImageList(hwCtrl, pField->hStateImageList, TVSIL_STATE);\n\n                DeleteObject((HBITMAP)hBitmap);\n              }\n            }\n\n            // Step 2: Include items to TreeView.\n            //----------------------------------------------------------------\n            HTREEITEM hItem = NULL;\n            HTREEITEM hParentItem = NULL;\n\n            int nResult = 0;\n\n            LPTSTR pszStart, pszEnd;\n\n            pszStart = pszEnd = pField->pszListItems;\n            while(nResult = IOLI_NextItem(pField->pszListItems, &pszStart, &pszEnd, 0))\n            {\n              if((nResult == 5 && lstrlen(pszStart)==0 )||nResult == 6)\n                break;\n\n              // When two sublevel are closed, it return an empty string... Then we go to the next item\n              if(lstrlen(pszStart)==0)\n              {\n                if(nResult == 2) hParentItem = hItem;\n                if(nResult == 3) hParentItem = TreeView_GetParent(hwCtrl, hParentItem);\n\n                IOLI_RestoreItemStructure(pField->pszListItems, &pszStart, &pszEnd, nResult);\n                continue;\n              }\n\n              // Provide information about the item\n              TVITEM tvi;\n\n              tvi.mask = TVIF_TEXT | TVIF_CHILDREN;\n              tvi.pszText = pszStart;\n              tvi.cchTextMax = lstrlen(pszStart);\n              tvi.cChildren = nResult == 2 ? 1 : 0;\n\n              // Insert the item to the TreeView control\n              TVINSERTSTRUCT tvins;\n              tvins.hParent = hParentItem;\n              tvins.item = tvi;\n\n              tvins.hInsertAfter = TVI_LAST;\n\n              tvi.hItem = hItem = TreeView_InsertItem(hwCtrl, &tvins);\n              TreeView_SetItem(hwCtrl, &tvi);\n              if(nResult == 2) hParentItem = hItem;\n              if(nResult == 3) hParentItem = TreeView_GetParent(hwCtrl, hParentItem);\n\n              IOLI_RestoreItemStructure(pField->pszListItems, &pszStart, &pszEnd, nResult);\n            }\n\n            hParentItem = NULL;\n\n            // Step 3: Set the state of each item.\n            //----------------------------------------------------------------\n            if(pField->pszState)\n            {\n              int nPrevResult = 0;\n              hItem = TreeView_GetRoot(hwCtrl);\n\n              pszStart = pszEnd = pField->pszState;\n\n              while(nResult = IOLI_NextItem(pField->pszState, &pszStart, &pszEnd, 0))\n              {\n                if((nResult == 5 && lstrcmp(pszStart,_T(\"\"))==0)||nResult == 6)\n                  break;\n\n                if(pField->pszStateImageList && pField->nFlags & FLAG_CHECKBOXES)\n                {\n                  if(*pszStart)\n                    FIELD_TREEVIEW_Check(hwCtrl, hItem, TREEVIEW_AUTOCHECK, myatoi(pszStart), FALSE);\n\n                  if(nResult == 2)\n                    hItem = TreeView_GetChild(hwCtrl, hItem);\n                  if(nResult == 1)\n                    hItem = TreeView_GetNextSibling(hwCtrl, hItem);\n                  if(nResult == 3)\n                  {\n                    hItem = TreeView_GetParent(hwCtrl, hItem);\n                    if(TreeView_GetNextSibling(hwCtrl, hItem) != NULL)\n                      hItem = TreeView_GetNextSibling(hwCtrl, hItem);\n                  }\n                }\n                else\n                {\n                  LPTSTR pszText = (LPTSTR)MALLOC(260+1);\n\n                  for(;;)\n                  {\n                    TVITEM tvi;\n                    tvi.mask = TVIF_TEXT | TVIF_CHILDREN;\n                    tvi.pszText = pszText;\n                    tvi.cchTextMax = 260;\n                    tvi.hItem = hItem;\n                    TreeView_GetItem(hwCtrl, &tvi);\n\n                    pszText = tvi.pszText;\n\n                    if(!hItem) goto AfterState;\n\n                    if(lstrcmp(pszText, pszStart) == 0)\n                    {\n                      if(nResult == 2)\n                      {\n                        hItem = TreeView_GetChild(hwCtrl, hItem);\n                        break;\n                      }\n                      else\n                      {\n                        TreeView_SelectItem(hwCtrl, hItem);\n                        goto AfterState;\n                      }\n                    }\n                    hItem = TreeView_GetNextSibling(hwCtrl, hItem);\n                  }\n\n                  FREE(pszText);\n                }\n\n                nPrevResult = nResult;\n\n                IOLI_RestoreItemStructure(pField->pszState, &pszStart, &pszEnd, nResult);\n              }\n              AfterState:;\n            }\n\n            if(pField->pszStateImageList && pField->nFlags & FLAG_CHECKBOXES)\n              SetWindowLong(hwCtrl, GWL_STYLE ,dwStyle | TVS_CHECKBOXES);\n          }\n\n          TreeView_SetTextColor(hwCtrl, pField->crTxtColor);\n          TreeView_SetBkColor(hwCtrl, pField->crBgColor);\n\n          TreeView_SetItemHeight(hwCtrl, pField->nListItemsHeight);\n\n          break;\n        }\n\n        case FIELD_LISTVIEW:\n        {\n          if (pField->nFlags & FLAG_CHECKBOXES && FileExists(pField->pszStateImageList))\n            ListView_SetExtendedListViewStyleEx(hwCtrl, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES); \n          else\n            pField->nFlags &= ~FLAG_CHECKBOXES;\n\n          // \"ListItems\" has to exist in order to continue\n          if (pField->pszListItems)\n          {\n            // Step 1: Implement image list feature.\n            //----------------------------------------------------------------\n            \n            // Step 1.1: Detect number of items.\n            INT_PTR nItems = FIELD_LISTVIEW_IOLI_CountItems(pField->pszListItems, 0);\n\n            // Step 1.2: State image list.\n            if(pField->nFlags & FLAG_CHECKBOXES)\n            {\n              if(FileExists(pField->pszStateImageList))\n              {\n                // Set the image list to the ListView control\n                HBITMAP hBitmap = (HBITMAP)LoadImage(0, pField->pszStateImageList, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);\n                HIMAGELIST hImageList = (HIMAGELIST)ImageList_Create(16, 16, ILC_COLOR32|ILC_MASK, 6, 0);\n                ImageList_AddMasked(hImageList,hBitmap,RGB(255,0,255));\n                ListView_SetImageList(hwCtrl, hImageList, LVSIL_STATE);\n\n                DeleteObject((HBITMAP)hBitmap);\n              }\n            }\n\n            // Step 1.3: Small items image list.\n            if(pField->pszSmallImageList)\n            {\n              if(FileExists(pField->pszSmallImageList))\n              {\n                // Set the image list to the ListView control\n                HBITMAP hBitmap = (HBITMAP)LoadImage(0, pField->pszSmallImageList, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);\n                HIMAGELIST hImageList = (HIMAGELIST)ImageList_Create(16, 16, ILC_COLOR32|ILC_MASK, nItems, 0);\n                ImageList_AddMasked(hImageList,hBitmap,RGB(255,0,255));\n                ListView_SetImageList(hwCtrl, hImageList, LVSIL_SMALL);\n\n                DeleteObject((HBITMAP)hBitmap);\n              }\n            }\n\n            // Step 1.4: Large items image list.\n            if(pField->pszLargeImageList)\n            {\n              if(FileExists(pField->pszLargeImageList))\n              {\n                // Set the image list to the ListView control\n                HBITMAP hBitmap = (HBITMAP)LoadImage(0, pField->pszLargeImageList, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);\n                HIMAGELIST hImageList = (HIMAGELIST)ImageList_Create(16, 16, ILC_COLOR32|ILC_MASK, nItems, 0);\n                ImageList_AddMasked(hImageList,hBitmap,RGB(255,0,255));\n                ListView_SetImageList(hwCtrl, hImageList, LVSIL_NORMAL);\n\n                DeleteObject((HBITMAP)hBitmap);\n              }\n            }\n\n            // Step 2: Create columns.\n            //----------------------------------------------------------------\n\n            // Step 2.1: Detect number of colums to add.\n            int nColumns = FIELD_LISTVIEW_IOLI_CountSubItems(pField->pszListItems, pField->pszHeaderItems) + 1; // Plus an item column.\n\n            // Step 2.2: Insert a fake column.\n            LVCOLUMN lvc;\n\n            int nSubItem = 0;\n\n            lvc.mask = LVCF_WIDTH;\n            lvc.cx = 0;\n\n            ListView_InsertColumn(hwCtrl, 0, &lvc);\n            \n            // Step 2.3: Create custom columns.\n            LPTSTR pszHeaderStart, pszHeaderEnd;\n            pszHeaderStart = pszHeaderEnd = pField->pszHeaderItems;\n\n            LPTSTR pszHeaderItemsWidthStart, pszHeaderItemsWidthEnd;\n            pszHeaderItemsWidthStart = pszHeaderItemsWidthEnd = pField->pszHeaderItemsWidth;\n\n            LPTSTR pszHeaderItemsAlignStart, pszHeaderItemsAlignEnd;\n            pszHeaderItemsAlignStart = pszHeaderItemsAlignEnd = pField->pszHeaderItemsAlign;\n\n            int nHeaderResult = 0;\n            int nHeaderItemsWidthResult = 0;\n            int nHeaderItemsAlignResult = 0;\n\n            // pField->pszHeaderItems has a trailing pipe\n            if(pField->pszHeaderItems)\n            {\n              pszHeaderStart = pszHeaderEnd = pField->pszHeaderItems;\n\n              while((nHeaderResult = IOLI_NextItem(pField->pszHeaderItems, &pszHeaderStart, &pszHeaderEnd, 1)) && nSubItem < nColumns)\n              {\n                lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;\n\n                lvc.cx = 100;\n                if(pField->pszHeaderItemsWidth)\n                {\n                  nHeaderItemsWidthResult = IOLI_NextItem(pField->pszHeaderItemsWidth, &pszHeaderItemsWidthStart, &pszHeaderItemsWidthEnd, 1);\n\n                  if (*pszHeaderItemsWidthStart)\n                    lvc.cx = myatoi(pszHeaderItemsWidthStart);\n\n                  IOLI_RestoreItemStructure(pField->pszHeaderItemsWidth, &pszHeaderItemsWidthStart, &pszHeaderItemsWidthEnd, nHeaderItemsWidthResult);\n                }\n\n                lvc.fmt = (bRTL ? LVCFMT_RIGHT : LVCFMT_LEFT);\n                // pField->pszHeaderItemsAlign has a trailing pipe\n                if(pField->pszHeaderItemsAlign)\n                {\n                  nHeaderItemsAlignResult = IOLI_NextItem(pField->pszHeaderItemsAlign, &pszHeaderItemsAlignStart, &pszHeaderItemsAlignEnd, 1);\n\n                  if (*pszHeaderItemsAlignStart)\n                  {\n                    if(lstrcmp(pszHeaderItemsAlignStart,_T(\"LEFT\"))==0)\n                      lvc.fmt = (bRTL ? LVCFMT_RIGHT : LVCFMT_LEFT);\n                    else if(lstrcmp(pszHeaderItemsAlignStart,_T(\"CENTER\"))==0)\n                      lvc.fmt = LVCFMT_CENTER;\n                    else if(lstrcmp(pszHeaderItemsAlignStart,_T(\"RIGHT\"))==0)\n                      lvc.fmt = (bRTL ? LVCFMT_LEFT : LVCFMT_RIGHT);\n                  }\n\n                  IOLI_RestoreItemStructure(pField->pszHeaderItemsAlign, &pszHeaderItemsAlignStart, &pszHeaderItemsAlignEnd, nHeaderItemsAlignResult);\n                }\n\n                lvc.pszText = pszHeaderStart;\n                lvc.iSubItem = nSubItem;\n                nSubItem++;\n\n                ListView_InsertColumn(hwCtrl, nSubItem, &lvc);\n\n                IOLI_RestoreItemStructure(pField->pszHeaderItems, &pszHeaderStart, &pszHeaderEnd, nHeaderResult);\n              }\n            }\n\n            ListView_DeleteColumn(hwCtrl, 0);\n\n            // Step 3: Include items to ListView.\n            //----------------------------------------------------------------\n\n            int nResult = 0;\n\n            if(pField->pszListItems)\n            {\n              LPTSTR pszStart, pszEnd;\n              pszStart = pszEnd = pField->pszListItems;\n\n              int nResult = 0;\n\n              int nLevel = 0;\n              INT_PTR nItem = -1;\n              nSubItem = 0;\n\n              while(nResult = IOLI_NextItem(pField->pszListItems, &pszStart, &pszEnd, 0))\n              {\n                if((nResult == 5 && lstrcmp(pszStart,_T(\"\"))==0)||nResult == 6)\n                  break;\n\n                nItem++;\n                // Provide information about the item\n                LVITEM lvi;\n\n                lvi.mask = LVIF_TEXT | LVIF_IMAGE;\n                lvi.pszText = pszStart;\n                lvi.cchTextMax = strlen(pszStart);\n                lvi.iItem = nItem;\n\n                if(nLevel <= 0)\n                {\n                  lvi.mask |= LVIF_STATE;\n                  lvi.iImage = nItem;\n                  lvi.state = 0;\n                  lvi.stateMask = 0;\n\n                  lvi.iSubItem = 0;\n                  // Insert the item to the ListView control\n                  ListView_InsertItem(hwCtrl, &lvi);\n                }\n                else\n                {\n                  nItem--;\n                  nSubItem++;\n\n                  lvi.iItem = nItem;\n                  lvi.iSubItem = nSubItem;\n                  // Set the information to the respective item\n                  ListView_SetItem(hwCtrl, &lvi);\n                }\n\n                switch (nResult)\n                {\n                  case 2: {nLevel++; break;}\n                  case 1: break;\n                  case 3: {nLevel--; nSubItem = 0; break;}\n                }\n\n                IOLI_RestoreItemStructure(pField->pszListItems, &pszStart, &pszEnd, nResult);\n              }\n            }\n\n            // Step 4: Select items.\n            //----------------------------------------------------------------\n\n            if(pField->pszState)\n            {\n              INT_PTR nItem = -1;\n\n              // Search the \"State\" string given by the user for ListView items\n\n              LPTSTR pszStart, pszEnd;\n              pszStart = pszEnd = pField->pszState;\n              while(nResult = IOLI_NextItem(pField->pszState, &pszStart, &pszEnd, 1))\n              {\n                if((nResult == 5 && lstrcmp(pszStart,_T(\"\"))==0)||nResult == 6)\n                  break;\n\n                if(pField->nFlags & FLAG_CHECKBOXES)\n                {\n                  nItem++;\n                  LVITEM lvi;\n\n                  lvi.mask = LVIF_STATE;\n                  lvi.iItem = nItem;\n                  lvi.iSubItem = 0;\n\n                  lvi.state = INDEXTOSTATEIMAGEMASK(2);\n                  lvi.stateMask = LVIS_STATEIMAGEMASK;\n\n                  int nState = myatoi(pszStart);\n                  int iState = INDEXTOSTATEIMAGEMASK(2);\n\n                  // No checkboxes (TREEVIEW_NOCHECKBOX)\n                  //------------------------------------\n                  if(nState & TREEVIEW_NOCHECKBOX)\n                    iState = INDEXTOSTATEIMAGEMASK(0);\n\n                  // Read-only checkboxes (TREEVIEW_READONLY)\n                  //-----------------------------------------\n                  else if(nState & TREEVIEW_READONLY)\n                  {\n                    if(nState & TREEVIEW_CHECKED)\n                      // Read-only checked checkboxes (TREEVIEW_READONLY | TREEVIEW_CHECKED)\n                      iState = INDEXTOSTATEIMAGEMASK(6);\n                    else\n                      // Read-only unchecked checkboxes (TREEVIEW_READONLY)\n                      iState = INDEXTOSTATEIMAGEMASK(5);\n                  }\n                 \n                  // Checked checkboxes (TREEVIEW_CHECKED)\n                  //-----------------------------------------\n                  else if(nState & TREEVIEW_CHECKED)\n                      iState = INDEXTOSTATEIMAGEMASK(3);\n\n                  ListView_SetItemState(hwCtrl, nItem, iState, LVIS_STATEIMAGEMASK);\n                }\n                else\n                {\n                  LPTSTR pszText = (LPTSTR)MALLOC(260+1);\n                  while(true)\n                  {\n                    nItem++;\n                    // Provide information about the item\n                    ListView_GetItemText(hwCtrl, nItem, 0, pszText, 260);\n                    if(lstrcmp(pszStart, pszText)==0)\n                    {\n                      ListView_SetItemState(hwCtrl, nItem, LVIS_SELECTED, LVIS_SELECTED);\n                      break;\n                    }\n                    if(ListView_GetNextItem(hwCtrl, nItem, 0) == -1)\n                      break;\n                  }\n                  FREE(pszText);\n                }\n\n                IOLI_RestoreItemStructure(pField->pszState, &pszStart, &pszEnd, nResult);\n              }\n            }\n          }\n\n          ListView_SetTextColor(hwCtrl, pField->crTxtColor);\n          ListView_SetBkColor(hwCtrl, pField->crBgColor);\n          ListView_SetTextBkColor(hwCtrl, pField->crBgColor);\n          break;\n        }\n\n        case FIELD_BUTTON:\n        {\n          if(FileExists(pField->pszText))\n          {\n            if (pField->nFlags & FLAG_BITMAP) {\n              HANDLE hImageButton = LoadImage(m_hInstance,pField->pszText,IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);\n              mySendMessage(hwCtrl, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hImageButton);\n            }\n            else if (pField->nFlags & FLAG_ICON) {\n              HANDLE hImageButton = LoadImage(m_hInstance,pField->pszText,IMAGE_ICON, 0, 0, LR_LOADFROMFILE);\n              mySendMessage(hwCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM) hImageButton);\n            }\n          }\n          break;\n        }\n\n        case FIELD_PROGRESSBAR:\n        {\n          if(pField->nMaxLength)\n            mySendMessage(hwCtrl, PBM_SETRANGE32, 0, pField->nMaxLength);\n          else\n            mySendMessage(hwCtrl, PBM_SETRANGE32, 0, 100);\n\n          int nState = myatoi(pField->pszState);\n\n          mySendMessage(hwCtrl, PBM_SETPOS, nState, NULL);\n\n          // Set Indicator and Background colors\n\n          mySendMessage(hwCtrl, PBM_SETBARCOLOR, 0, pField->crTxtColor);\n          if(pField->crBgColor != 0xFFFFFFFF)\n            mySendMessage(hwCtrl, PBM_SETBKCOLOR, 0, pField->crBgColor);\n\n          break;\n        }\n        case FIELD_TRACKBAR:\n        {\n          if(pField->nMaxLength)\n            mySendMessage(hwCtrl, TBM_SETRANGEMAX, TRUE, pField->nMaxLength - 1);\n          else\n            mySendMessage(hwCtrl, TBM_SETRANGEMAX, TRUE, 100 - 1);\n\n          mySendMessage(hwCtrl, TBM_SETTICFREQ, 1, NULL);\n          mySendMessage(hwCtrl, TBM_SETPOS, TRUE, myatoi(pField->pszState));\n          break;\n        }\n        case FIELD_IPADDRESS:\n        {\n          int nResult = strlen(pField->pszState);\n\n          pField->pszState[nResult] = '.';\n          pField->pszState[nResult + 1] = '\\0';\n\n          TCHAR *pszStart, *pszEnd, *pszList;\n          pszStart = pszEnd = pszList = STRDUP(pField->pszState);\n\n          int iItem = 0;\n          BYTE b0 = 0;\n          BYTE b1 = 0;\n          BYTE b2 = 0;\n          BYTE b3 = 0;\n\n          while (*pszEnd) {\n            if (*pszEnd == _T('.')) {\n              *pszEnd = _T('\\0');\n              iItem++;\n              if (*pszStart) {\n                switch(iItem)\n                {\n                  case 1:\n                    b0 = myatoi(pszStart);\n                    break;\n                  case 2:\n                    b1 = myatoi(pszStart);\n                    break;\n                  case 3:\n                    b2 = myatoi(pszStart);\n                    break;\n                  case 4:\n                    b3 = myatoi(pszStart);\n                    break;\n                  default:\n                    break;\n                }\n              }\n              pszStart = ++pszEnd;\n            }\n            else\n              pszEnd = CharNext(pszEnd);\n          }\n\n          LPARAM nIP = MAKEIPADDRESS(b0,b1,b2,b3);\n\n          mySendMessage(hwCtrl, IPM_SETADDRESS, NULL, nIP);\n\n          break;\n        }\n        case FIELD_DATETIME:\n        {\n          SYSTEMTIME SystemTime;\n\n          if(pField->pszState != NULL) {\n\n            int nResult = strlen(pField->pszState);\n\n            pField->pszState[nResult] = ' ';\n            pField->pszState[nResult + 1] = '\\0';\n\n            TCHAR *pszStart, *pszEnd, *pszList;\n            pszStart = pszEnd = pszList = STRDUP(pField->pszState);\n\n            int iItem = 0;\n\n            while (*pszEnd) {\n              if ((*pszEnd == '/')||(*pszEnd == '\\\\')||(*pszEnd == '-')||(*pszEnd == ':')||(*pszEnd == ' ')) {\n                *pszEnd = '\\0';\n                iItem++;\n                if (*pszStart) {\n                  switch(iItem)\n                  {\n                    case 1:\n                      SystemTime.wDay = myatoi(pszStart); //Day\n                      break;\n                    case 2:\n                      SystemTime.wMonth = myatoi(pszStart); //Month\n                      break;\n                    case 3:\n                      SystemTime.wYear = myatoi(pszStart); //Year\n                      break;\n                    case 4:\n                      SystemTime.wHour = myatoi(pszStart); //Hour\n                      break;\n                    case 5:\n                      SystemTime.wMinute = myatoi(pszStart); //Minute\n                      break;\n                    case 6:\n                      SystemTime.wSecond = myatoi(pszStart); //Second\n                      break;\n                    case 7:\n                      SystemTime.wDayOfWeek = myatoi(pszStart); //DayOfWeek\n                      break;\n                    default:\n                      break;\n                  }\n                }\n                pszStart = ++pszEnd;\n              }\n              else\n                pszEnd = CharNext(pszEnd);\n            }\n          }\n          else\n          {\n            GetSystemTime(&SystemTime);\n          }\n          mySendMessage(hwCtrl, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM) (LPSYSTEMTIME) &SystemTime);\n\n          if(pField->pszText)\n            mySendMessage(hwCtrl, DTM_SETFORMAT, 0, (LPARAM) (LPCTSTR) pField->pszText);\n\n          // Set colors\n          mySendMessage(hwCtrl, DTM_SETMCCOLOR, MCSC_TEXT, pField->crTxtColor);\n          mySendMessage(hwCtrl, DTM_SETMCCOLOR, MCSC_MONTHBK, pField->crBgColor);\n          mySendMessage(hwCtrl, DTM_SETMCCOLOR, MCSC_TITLETEXT, pField->crSelTxtColor);\n          mySendMessage(hwCtrl, DTM_SETMCCOLOR, MCSC_TITLEBK, pField->crSelBgColor);\n          mySendMessage(hwCtrl, DTM_SETMCCOLOR, MCSC_BACKGROUND, pField->crMonthOutColor);\n          mySendMessage(hwCtrl, DTM_SETMCCOLOR, MCSC_TRAILINGTEXT, pField->crMonthTrailingTxtColor);\n\n          break;\n        }\n        case FIELD_MONTHCALENDAR:\n        {\n          SYSTEMTIME SystemTime;\n\n          if(pField->pszState != NULL) {\n\n            int nResult = strlen(pField->pszState);\n\n            pField->pszState[nResult] = ' ';\n            pField->pszState[nResult + 1] = '\\0';\n\n            TCHAR *pszStart, *pszEnd, *pszList;\n            pszStart = pszEnd = pszList = STRDUP(pField->pszState);\n\n            int iItem = 0;\n\n            while (*pszEnd) {\n              if ((*pszEnd == '/')||(*pszEnd == '\\\\')||(*pszEnd == '-')||(*pszEnd == ' ')) {\n                *pszEnd = '\\0';\n                iItem++;\n                if (*pszStart) {\n                  switch(iItem)\n                  {\n                    case 1:\n                      SystemTime.wDay = myatoi(pszStart); //Day\n                      break;\n                    case 2:\n                      SystemTime.wMonth = myatoi(pszStart); //Month\n                      break;\n                    case 3:\n                      SystemTime.wYear = myatoi(pszStart); //Year\n                      break;\n                    default:\n                      break;\n                  }\n                }\n                pszStart = ++pszEnd;\n              }\n              else\n                pszEnd = CharNext(pszEnd);\n            }\n            mySendMessage(hwCtrl, MCM_SETCURSEL, 0, (LPARAM) (LPSYSTEMTIME) &SystemTime);\n          }\n          else\n          {\n            GetSystemTime(&SystemTime);\n            mySendMessage(hwCtrl, MCM_SETCURSEL, 0, (LPARAM) (LPSYSTEMTIME) &SystemTime);\n          }\n\n          // Set colors\n          mySendMessage(hwCtrl, MCM_SETCOLOR, MCSC_TEXT, pField->crTxtColor);\n          mySendMessage(hwCtrl, MCM_SETCOLOR, MCSC_MONTHBK, pField->crBgColor);\n          mySendMessage(hwCtrl, MCM_SETCOLOR, MCSC_TITLETEXT, pField->crSelTxtColor);\n          mySendMessage(hwCtrl, MCM_SETCOLOR, MCSC_TITLEBK, pField->crSelBgColor);\n          mySendMessage(hwCtrl, MCM_SETCOLOR, MCSC_BACKGROUND, pField->crMonthOutColor);\n          mySendMessage(hwCtrl, MCM_SETCOLOR, MCSC_TRAILINGTEXT, pField->crMonthTrailingTxtColor);\n\n          break;\n        }\n        case FIELD_RICHTEXT:\n        {\n          // Step 1: Set settings\n          mySendMessage(hwCtrl,EM_AUTOURLDETECT,TRUE,0);\n\n          LPARAM nEvents = ENM_LINK|ENM_KEYEVENTS;\n          if(pField->nNotify & NOTIFY_CONTROL_ONTEXTCHANGE)\n            nEvents |= ENM_CHANGE;\n          if(pField->nNotify & NOTIFY_CONTROL_ONTEXTUPDATE) //Ignored if RichEdit version => 2\n            nEvents |= ENM_UPDATE;\n          if(pField->nNotify & NOTIFY_CONTROL_ONTEXTSELCHANGE)\n            nEvents |= ENM_SELCHANGE;\n\n          mySendMessage(hwCtrl,EM_SETEVENTMASK,0,nEvents);\n          if(pField->nMaxLength)\n            mySendMessage(hwCtrl,EM_EXLIMITTEXT,0,(LPARAM)pField->nMaxLength);\n          else\n            mySendMessage(hwCtrl,EM_EXLIMITTEXT,0,0xFFFFFFFE);\n\n          if(pField->nFlags & FLAG_PASSWORD)\n          {\n            if(pField->pszText)\n            {\n              TCHAR* pszChar = (TCHAR*)MALLOC((1+1)*sizeof(TCHAR));\n              strncpy(pszChar, pField->pszText, 1+1);\n              mySendMessage(hwCtrl, EM_SETPASSWORDCHAR, (WPARAM) *pszChar, 0);\n            }\n            else\n              mySendMessage(hwCtrl, EM_SETPASSWORDCHAR, (WPARAM) '*', 0);\n          }\n\n          // Step 2: Open the user file\n          // escape the path name:  \\n => \\\\n but not \\ to \\\\\n          // I can't use IOtoa because \"c:\\\\fichier.rtf\" don't work on windows 9x\n          pField->pszState = IOtoaFolder(pField->pszState);\n\n          EDITSTREAM editStream = {0};\n          FILE * hFile;\n          if ( _tfopen_s(&hFile, pField->pszState, _T(\"rb\")) != 0)\n          {\n            //TODO: Add error handling\n            break;\n          }\n          fseek(hFile,0,SEEK_END);\n          UINT nDataLen=ftell(hFile);\n          if (nDataLen == -1)\n          {\n            //TODO: Add error handling\n            break;\n          }\n          rewind(hFile);\n          char *pszData = (char*)MALLOC(nDataLen+1);\n\n          if (fread(pszData,1,nDataLen,hFile) != nDataLen)\n          {\n            //TODO: Add error handling\n            fclose(hFile);\n            FREE(pszData);\n            break;\n          }\n          pszData[nDataLen]=0;\n          if (!strncmp(pszData,\"{\\\\rtf\",sizeof(\"{\\\\rtf\")-1))\n          pField->nDataType = SF_RTF;\n          else\n          pField->nDataType = SF_TEXT;\n          fclose(hFile);\n\n          dwRead=0;\n          editStream.pfnCallback = FIELD_RICHTEXT_StreamIn;\n          editStream.dwCookie = (DWORD_PTR)pszData;\n          mySendMessage(hwCtrl,EM_STREAMIN,(WPARAM)pField->nDataType,(LPARAM)&editStream);\n\n          FREE(pszData);\n          break;\n        }\n      }\n\n     pField->nParentIdx = (INT_PTR) SetWindowLongPtr(hwCtrl, GWLP_WNDPROC, (LONG_PTR)ControlWindowProc);\n\n      // Set initial focus to the first appropriate field ( with FOCUS flag)\n      if (!fFocusedByFlag && (dwStyle & (WS_TABSTOP | WS_DISABLED)) == WS_TABSTOP && pField->nType >= FIELD_SETFOCUS) {\n        if (pField->nFlags & FLAG_FOCUS) {\n            fFocusedByFlag = TRUE;\n        }\n        if (fFocusedByFlag) {\n            fFocused = TRUE;\n            mySetFocus(hwCtrl);\n        } else if (!fFocused) {\n          // If multiline-readonly don't initially select RichText controls.\n          // useful for License Page look-a-likes.\n          if (! (pField->nType == FIELD_RICHTEXT && (pField->nFlags & (FLAG_MULTILINE | FLAG_READONLY)) == (FLAG_MULTILINE | FLAG_READONLY)) ) {\n                fFocused = TRUE;\n                mySetFocus(hwCtrl);\n          }\n        }\n      }\n\n      // If multiline-readonly then hold the text back until after the\n      // initial focus has been set. This is so the text is not initially\n      // selected - useful for License Page look-a-likes.\n      if (pField->nType == FIELD_TEXT && (pField->nFlags & (FLAG_MULTILINE | FLAG_READONLY)) == (FLAG_MULTILINE | FLAG_READONLY))\n        mySetWindowText(hwCtrl, pField->pszState);\n    }\n  }\n\n// Special Control Configurations\n//================================================================\n  for (int nIdx2 = 0; nIdx2 < nNumFields; nIdx2++)\n  {\n    IOExControlStorage *pField = pFields + nIdx2;\n    if(pField->nType == FIELD_UPDOWN && pField->nRefFields) {\n      HWND hBuddy = GetDlgItem(hConfigWindow,1200+pField->nRefFields-1);\n      mySendMessage(pField->hwnd, UDM_SETBUDDY, (WPARAM) (HWND) hBuddy, 0);\n      myGetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), pField->pszState);\n      mySendMessage(pField->hwnd, UDM_SETPOS32, 0, myatoi(pField->pszState));\n    }\n  }\n\n// Set focus to the first control (depending on controls order)\n//================================================================\n  if (!fFocused)\n    mySetFocus(hNextButton);\n\n// \"Title\" (\"Settings\") Implementation\n//================================================================\n  mySetWindowText(mainwnd,pszTitle);\n\n// Pop filename and push the hConfigWindow handle to NSIS Stack\n//================================================================\n  *g_stacktop = (*g_stacktop)->next;\n\n  static TCHAR tmp[32];\n  wsprintf(tmp,_T(\"%d\"),hConfigWindow);\n  pushstring(tmp);\n\n// Return to original function\n//================================================================\n  return 0;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n///----------------------------------------------------------------\n// Show function part\n//================================================================\nvoid WINAPI showCfgDlg()\n{\n// Step 1: Show Page\n//================================================================\n\n  // Let the plugin handle dialog messages for now on\n  //--------------------------------------------------------------\n  lpWndProcOld = (WNDPROC) SetWindowLongPtr(hMainWindow,DWLP_DLGPROC,(LONG_PTR)ParentWndProc);\n\n  // Enable keyboard and mouse input and show back window\n  //--------------------------------------------------------------\n  mySendMessage(hMainWindow, WM_NOTIFY_CUSTOM_READY, (WPARAM)hConfigWindow, 0);\n  ShowWindow(hConfigWindow, SW_SHOWNA);\n\n  // Provide a way to leave the \"while\" below\n  //--------------------------------------------------------------\n  g_done = 0;\n\n  // Notification System Implementation\n  //--------------------------------------------------------------\n  g_aNotifyQueue = (NotifyQueue*)MALLOC(sizeof(NotifyQueue)*g_nNotifyQueueAmountMax);\n\n  g_aNotifyQueueTemp = (NotifyQueue*)MALLOC(sizeof(NotifyQueue));\n  g_aNotifyQueueTemp->iNotifyId = NOTIFY_NONE;\n  g_aNotifyQueueTemp->iField = 0;\n  g_aNotifyQueueTemp->bNotifyType = NOTIFY_TYPE_PAGE;\n\n  // Set the page timer (TimeOut Implementation)\n  //--------------------------------------------------------------\n  if(nTimeOutTemp != 0)\n  {\n    g_timer_cur_time = GetTickCount();\n    SetTimer(hConfigWindow,g_timer_id,nTimeOutTemp,NULL);\n  }\n\n  // Handle hConfigWindow messages (code execution pauses here)\n  //--------------------------------------------------------------\n  while (!g_done) {\n    GetMessage(&msg, NULL, 0, 0);\n\n    if (!IsDialogMessage(hConfigWindow,&msg) && !IsDialogMessage(hMainWindow,&msg))\n    {\n      TranslateMessage(&msg);\n      DispatchMessage(&msg);\n    }\n  }\n\n  //KillTimer(hConfigWindow, g_notification_timer_id);\n\n// Step 2: Destroy Page\n//================================================================\n\n  // Notification System Implementation\n  //--------------------------------------------------------------\n  \n  // we don't save settings on cancel since that means your installer will likely\n  // quit soon, which means the ini might get flushed late and cause delete issues?\n  if (!g_is_cancel) SaveSettings();\n\n  // Free buffers (g_aNotifyQueue)\n  FREE(g_aNotifyQueue);\n  FREE(g_aNotifyQueueTemp);\n  \n  // Let NSIS handle dialog messages for now on\n  //--------------------------------------------------------------\n  SetWindowLongPtr(hMainWindow,DWLP_DLGPROC,(LONG_PTR)lpWndProcOld);\n\n  // Destroy the window (w/ all the controls inside)\n  //--------------------------------------------------------------\n  DestroyWindow(hConfigWindow);\n\n  // Show installer buttons as they were before using plugin\n  //--------------------------------------------------------------\n  if (bNextShow!=-1) ShowWindow(hNextButton,old_next_visible?SW_SHOWNA:SW_HIDE);\n  if (bBackShow!=-1) ShowWindow(hBackButton,old_back_visible?SW_SHOWNA:SW_HIDE);\n  if (bCancelShow!=-1) ShowWindow(hCancelButton,old_cancel_visible?SW_SHOWNA:SW_HIDE);\n\n  if (bNextEnabled!=-1) EnableWindow(hNextButton,old_next_enabled);\n  if (bBackEnabled!=-1) EnableWindow(hBackButton,old_back_enabled);\n  if (bCancelEnabled!=-1) EnableWindow(hCancelButton,old_cancel_enabled);\n\n  // Free buffers (global) and handles\n  //--------------------------------------------------------------\n  FREE(pszTitle);\n  FREE(pszCancelButtonText);\n  FREE(pszNextButtonText);\n  FREE(pszBackButtonText);\n\n  // Kill the page timer (TimeOut Implementation)\n  //--------------------------------------------------------------\n  if(g_timer_id != 0)\n  {\n    KillTimer(hConfigWindow, g_timer_id);\n    g_timer_id = 0;\n    nTimeOut = nTimeOutTemp = 0;\n  }\n\n  // Free buffers (pField) and handles\n  //--------------------------------------------------------------\n  int i = nNumFields;\n  while (i--) {\n    IOExControlStorage *pField = pFields + i;\n\n    int j = FIELD_BUFFERS;\n    while (j--)\n      FREE(((TCHAR **) pField)[j]);\n\n    if (pField->nType == FIELD_IMAGE) {\n      switch(pField->nDataType)\n      {\n        case IMAGE_TYPE_BITMAP:\n        case IMAGE_TYPE_OLE:\n        case IMAGE_TYPE_GDIPLUS:\n        {\n          DeleteObject(pField->hImage);\n          break;\n        }\n        case IMAGE_TYPE_ICON:\n        {\n          DestroyIcon((HICON)pField->hImage);\n          break;\n        }\n        case IMAGE_TYPE_CURSOR:\n        {\n          DestroyCursor((HCURSOR)pField->hImage);\n          break;\n        }\n        case IMAGE_TYPE_ANIMATION:\n        {\n          Animate_Close((HWND)pField->hImage);\n          break;\n        }\n      }\n    }\n    if (pField->nType == FIELD_TREEVIEW && pField->pszStateImageList) {\n      // ListView controls automatically destroy image lists.\n      ImageList_Destroy((HIMAGELIST)pField->hStateImageList);\n    }\n  }\n  FREE(pFields);\n\n  // Push the page direction to NSIS Stack\n  //--------------------------------------------------------------\n  pushstring(g_is_cancel?_T(\"cancel\"):g_is_back?_T(\"back\"):_T(\"success\"));\n}\n\n\n\n\n\n\n\nINT_PTR CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\n{\n// Notification System Base Implementation (Depends on Conditions)\n//================================================================\n  INT_PTR bRes;\n  BOOL g_timer_notify = false;\n\n  if (message == WM_NOTIFY_OUTER_NEXT && wParam == 1)\n  {\n  // we don't save settings on cancel\n  if (!g_is_cancel)\n  {\n      // Don't call leave function if fields aren't valid\n      if (!g_aNotifyQueue[0].iField && !ValidateFields())\n        return 0;\n      // Get the settings ready for the leave function verification\n    SaveSettings();\n  }\n\n    // Make default notification as \"ONNEXT\" so to confirm that \"State\"\n    // and \"Notify\" INI value names were written under \"Settings\" INI\n    // section when the page itself notifies (not controls).\n    if (g_aNotifyQueue[0].bNotifyType == NOTIFY_TYPE_PAGE)\n    {\n      g_aNotifyQueue[0].iField = 0;\n      if(g_timer_activated)\n        g_aNotifyQueue[0].iNotifyId = NOTIFY_PAGE_ONTIMEOUT;\n      else\n        g_aNotifyQueue[0].iNotifyId = NOTIFY_PAGE_ONNEXT;\n\n      WritePrivateProfileString(_T(\"Settings\"), _T(\"State\"), _T(\"0\"), pszFilename);\n      WritePrivateProfileString(_T(\"Settings\"), _T(\"Notify\"), LookupTokenName(PageNotifyTable, g_aNotifyQueue[0].iNotifyId), pszFilename);\n    }\n\n    // Timer: Allow SetTimer to reset the timer again.\n    if(nTimeOut >= USER_TIMER_MINIMUM)\n      g_timer_notify = true;\n\n    // Reset the record of activated control and notification\n    RemoveNotifyQueueItem();\n  }\n\n// Call lpWndProcOld (-> DialogProc NSIS function - this also calls the leave function if necessary)\n//================================================================\n  bRes = CallWindowProc(lpWndProcOld,hwnd,message,wParam,lParam);\n\n// Start To Get Out Of This Page (Depends on Conditions)\n//================================================================\n  if (message == WM_NOTIFY_OUTER_NEXT && !bRes)\n  {\n    WritePrivateProfileString(_T(\"Settings\"), _T(\"State\"), _T(\"0\"), pszFilename);\n    // if leave function didn't abort (bRes != 0 in that case)\n    if (wParam == (WPARAM)-1)\n    {\n      WritePrivateProfileString(_T(\"Settings\"), _T(\"Notify\"), LookupTokenName(PageNotifyTable, NOTIFY_PAGE_ONBACK), pszFilename);\n      g_is_back = true;\n    }\n    else if (wParam == NOTIFY_BYE_BYE)\n    {\n      WritePrivateProfileString(_T(\"Settings\"), _T(\"Notify\"), LookupTokenName(PageNotifyTable, NOTIFY_PAGE_ONCANCEL), pszFilename);\n      g_is_cancel = true;\n    }\n    else\n    {\n      if (g_timer_activated)\n        WritePrivateProfileString(_T(\"Settings\"), _T(\"Notify\"), LookupTokenName(PageNotifyTable, NOTIFY_PAGE_ONTIMEOUT), pszFilename);\n      else\n        WritePrivateProfileString(_T(\"Settings\"), _T(\"Notify\"), LookupTokenName(PageNotifyTable, NOTIFY_PAGE_ONNEXT), pszFilename);\n    }\n\n    g_done++;\n    PostMessage(hConfigWindow,WM_CLOSE,0,0);\n  }\n  else if (message == WM_NOTIFY_OUTER_NEXT && bRes && g_timer_notify)\n  {\n    // Set the page timer if notified (TimeOut Implementation)\n    //--------------------------------------------------------------\n    g_timer_cur_time = GetTickCount();\n    SetTimer(hConfigWindow,g_timer_id,nTimeOut,NULL);\n    nTimeOut = nTimeOutTemp;\n  }\n\n  g_timer_activated = false;\n  return bRes;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//================================================================\n// Dialog Configuration Proc\n//================================================================\nBOOL CALLBACK DialogWindowProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n// Handle Advanced Notification Messages\n//================================================================\n\n  switch (uMsg)\n  {\n    case WM_TIMER:\n    {\n      if (wParam == g_timer_id)\n      {\n        KillTimer(hConfigWindow,g_timer_id);\n        g_timer_activated = true;\n        mySendMessage(hMainWindow, WM_NOTIFY_OUTER_NEXT, 1, 0);\n      }\n    }\n    case WM_COMMAND:\n    {\n      UINT nIdx = LOWORD((DWORD)wParam);\n      UINT nNotifyCode = HIWORD((DWORD)wParam);\n      HWND hCtrl = (HWND) lParam;\n\n      if (nIdx < 0)\n        break;\n      IOExControlStorage *pField = pFields + nIdx;\n\n      NotifyProc(hwndDlg, nIdx, hCtrl, nNotifyCode);\n      break;\n    }\n    case WM_NOTIFY:\n    {\n      LPNMHDR hdr = (LPNMHDR)lParam;\n\n      UINT nIdx = hdr->idFrom;\n      UINT nNotifyCode = hdr->code;\n      HWND hCtrl = GetDlgItem(hwndDlg, nIdx);\n\n      if (nIdx < 0)\n        break;\n      IOExControlStorage *pField = pFields + FindControlIdx(nIdx);\n\n      if(pField->nType == FIELD_TREEVIEW)\n      {\n        switch(nNotifyCode)\n        {\n          case NM_CLICK:\n          {\n            LPNMHDR hdr = (LPNMHDR)lParam;\n            TVHITTESTINFO ht;\n            GetCursorPos(&ht.pt);\n\n            ScreenToClient(hCtrl, &ht.pt);\n\n            HTREEITEM hItem = TreeView_HitTest(hCtrl, &ht);\n            if(!(ht.flags & TVHT_ONITEMSTATEICON)) break;\n            FIELD_TREEVIEW_Check(hCtrl, hItem, TREEVIEW_AUTOCHECK, 0xFFFFFFFF, FALSE);\n          }\n          case TVN_ITEMEXPANDED:\n          {\n            LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;\n            if (pnmtv->action == TVE_EXPAND)\n              pnmtv->itemNew.lParam |= TREEVIEW_EXPANDED;\n            else\n              pnmtv->itemNew.lParam &= ~TREEVIEW_EXPANDED;\n            TreeView_SetItem(hCtrl, &pnmtv->itemNew);\n          }\n          case TVN_BEGINLABELEDIT:\n          {\n            pField->hEditControl = TreeView_GetEditControl(hCtrl);\n            return 0;\n          }\n          case TVN_ENDLABELEDIT:\n          {\n            NMTVDISPINFO* nmtvdi = (NMTVDISPINFO*)lParam;\n\n            if((TCHAR)msg.wParam != VK_ESCAPE && nmtvdi->item.mask & LVIF_TEXT)\n            {\n              TVITEM tvItem;\n              tvItem.mask = TVIF_TEXT;\n              tvItem.pszText = nmtvdi->item.pszText;\n              tvItem.hItem = nmtvdi->item.hItem;\n              TreeView_SetItem(hCtrl, &tvItem);\n\n              return 1;\n            }\n            else\n              return 0;\n          }\n          case TVN_KEYDOWN:\n          {\n            LPNMTVKEYDOWN nmtvkd = (LPNMTVKEYDOWN)lParam;\n\n            if(pField->nFlags & FLAG_EDITLABELS && nmtvkd->wVKey == VK_F2)\n            {\n              HTREEITEM iSelectedItem = TreeView_GetNextItem(hCtrl, -1, TVGN_CARET);\n\n              if(!iSelectedItem)\n                break;\n\n              TreeView_EditLabel(hCtrl, iSelectedItem);\n              break;\n            }\n\n            if(pField->nFlags & FLAG_CHECKBOXES && nmtvkd->wVKey == VK_SPACE)\n            {\n              HTREEITEM hItem = TreeView_GetSelection(hCtrl);\n              FIELD_TREEVIEW_Check(hCtrl, hItem, TREEVIEW_AUTOCHECK, 0xFFFFFFFF, FALSE);\n            }\n            return 0;\n          }\n        }\n      }\n\n      else if(pField->nType == FIELD_LISTVIEW)\n      {\n        switch(nNotifyCode)\n        {\n          case NM_CLICK:\n          case NM_DBLCLK:\n          {\n            LPNMHDR hdr = (LPNMHDR)lParam;\n            LVHITTESTINFO ht;\n            GetCursorPos(&ht.pt);\n\n            ScreenToClient(hCtrl, &ht.pt);\n\n            int iItem = ListView_HitTest(hCtrl, &ht);\n            if(!(ht.flags & LVHT_ONITEMSTATEICON)) break;\n\n            // Get Item Information\n            //--------------------------------------------------------------\n            int iState = ListView_GetItemState(hCtrl, iItem, LVIS_STATEIMAGEMASK) >> 12;\n\n            // \"Normal\" checkboxes (Leaving from Checked state)\n            //--------------------------------------------------------------\n            if(iState == 3)\n              iState-= 2;\n            else if(iState >= 4 || iState == 1 || iState <= -1)\n              iState--;\n\n            ListView_SetItemState(hCtrl, iItem, INDEXTOSTATEIMAGEMASK(iState), LVIS_STATEIMAGEMASK);\n          }\n          case LVN_BEGINLABELEDIT:\n          {\n            pField->hEditControl = ListView_GetEditControl(hCtrl);\n            return 0;\n          }\n          case LVN_ENDLABELEDIT:\n          {\n            NMLVDISPINFO* nmlvdi = (NMLVDISPINFO*)lParam;\n\n            if((TCHAR)msg.wParam != VK_ESCAPE && nmlvdi->item.mask & LVIF_TEXT)\n            {\n              ListView_SetItemText(hCtrl, nmlvdi->item.iItem, 0, nmlvdi->item.pszText);\n              return 1;\n            }\n            else\n              return 0;\n          }\n          case LVN_KEYDOWN:\n          {\n            LPNMLVKEYDOWN nmlvkd = (LPNMLVKEYDOWN)lParam;\n\n            if(pField->nFlags & FLAG_EDITLABELS && nmlvkd->wVKey == VK_F2)\n            {\n              int iSelectedItem = ListView_GetNextItem(hCtrl, -1, LVNI_FOCUSED);\n\n              if(iSelectedItem == -1)\n                break;\n\n              ListView_EditLabel(hCtrl, iSelectedItem);\n              break;\n            }\n\n            if(pField->nFlags & FLAG_CHECKBOXES && nmlvkd->wVKey == VK_SPACE)\n            {\n              int iSelectedItem = -1;\n\n              while(true)\n              {\n                iSelectedItem = ListView_GetNextItem(hCtrl, iSelectedItem, LVNI_SELECTED);\n                if(iSelectedItem == -1)\n                  break;\n\n                int iSelectionState = ListView_GetItemState(hCtrl, iSelectedItem, LVIS_STATEIMAGEMASK|LVNI_SELECTED|LVNI_FOCUSED);\n                int iState = iSelectionState >> 12;\n\n                // \"Normal\" checkboxes (Leaving from Checked state)\n                //--------------------------------------------------------------\n                if(iState == 3)\n                {\n                  if(iSelectionState & LVNI_SELECTED && iSelectionState & LVNI_FOCUSED)\n                    iState -= 2;\n                  else\n                    iState--;\n                }\n                else if(iState == 2 && !(iSelectionState & LVNI_SELECTED && iSelectionState & LVNI_FOCUSED))\n\t\t\t\t{\n\t\t\t\t\tiState += 1;\n\t\t\t\t}\n\t\t\t\telse if(iState == 0 && (iSelectionState & LVNI_SELECTED && iSelectionState & LVNI_FOCUSED))\n                {\n                  iState;\n                }\n                else if((iState >= 4 || iState <= 1) && (iSelectionState & LVNI_SELECTED && iSelectionState & LVNI_FOCUSED))\n                {\n                  iState--;\n                }\n\n                ListView_SetItemState(hCtrl, iSelectedItem, INDEXTOSTATEIMAGEMASK(iState), LVIS_STATEIMAGEMASK);\n              }\n            }\n            return 0;\n          }\n        }\n      }\n\n      else if(pField->nType == FIELD_RICHTEXT)\n      {\n        switch(nNotifyCode)\n        {\n          case EN_LINK:\n          {\n            ENLINK * enlink = (ENLINK *)lParam;\n            LPTSTR ps_tmpbuf = (LPTSTR)MALLOC(g_nBufferSize);\n\n            if(pField->nNotify == NOTIFY_CONTROL_ONCLICK)\n            {\n              if (enlink->msg==WM_LBUTTONDOWN) {\n                TEXTRANGE tr = {\n                  {\n                    enlink->chrg.cpMin,\n                    enlink->chrg.cpMax,\n                  },\n                  ps_tmpbuf\n                };\n\n                if (tr.chrg.cpMax-tr.chrg.cpMin < g_nBufferSize) {\n                  SendMessage(hCtrl,EM_GETTEXTRANGE,0,(LPARAM)&tr);\n                  SetCursor(LoadCursor(0,IDC_WAIT));\n                  ShellExecute(hConfigWindow,_T(\"open\"),tr.lpstrText,NULL,NULL,SW_SHOWNORMAL);\n                  SetCursor(LoadCursor(0,IDC_ARROW));\n                }\n\n                // START: Parts of NotifyProc.\n                g_aNotifyQueueTemp->iField = nIdx + 1;\n                g_aNotifyQueueTemp->bNotifyType = NOTIFY_TYPE_CONTROL;\n\n                AddNotifyQueueItem(g_aNotifyQueueTemp);\n\n                // Kill the page timer if notified (TimeOut Implementation)\n                //================================================================\n                if(g_timer_id != 0)\n                {\n                  nTimeOut = nTimeOutTemp - (GetTickCount() - g_timer_cur_time);\n                  if (nTimeOut < USER_TIMER_MINIMUM)\n                    nTimeOut = 0;\n                  KillTimer(hConfigWindow, g_timer_id);\n                }\n\n                // Simulate \"Next\" Click So NSIS Can Call Its PageAfter Function\n                //================================================================\n                mySendMessage(hMainWindow, WM_NOTIFY_OUTER_NEXT, 1, 0);\n                // END: Part of NotifyProc.\n              }\n\n              return 0;\n            }\n          }\n          case EN_MSGFILTER:\n          {\n            MSGFILTER * msgfilter = (MSGFILTER *)lParam;\n            if (msgfilter->msg==WM_KEYDOWN)\n            {\n              if ((!IsWindowEnabled(hdr->hwndFrom) || pField->nFlags & FLAG_READONLY) && msgfilter->wParam==VK_RETURN)\n                SendMessage(hMainWindow, WM_COMMAND, IDOK, 0);\n              if (msgfilter->wParam==VK_ESCAPE)\n                SendMessage(hMainWindow, WM_CLOSE, 0, 0);\n              return 1;\n            }\n          }\n        }\n      }\n\n      NotifyProc(hwndDlg, nIdx, hCtrl, nNotifyCode);\n      break;\n    }\n\n    case WM_HSCROLL:\n    case WM_VSCROLL:\n    {\n      int nTempIdx = FindControlIdx(GetDlgCtrlID((HWND)lParam));\n      // Ignore if the dialog is in the process of being created\n      if (g_done || nTempIdx < 0)\n        break;\n      IOExControlStorage *pField = pFields + nTempIdx;\n\n      if(pField->nType == FIELD_TRACKBAR) {\n        UINT nIdx = GetDlgCtrlID((HWND)lParam);\n        UINT nNotifyCode = LOWORD(wParam);\n        HWND hCtrl = (HWND)lParam;\n        NotifyProc(hwndDlg, nIdx, hCtrl, nNotifyCode);\n      }\n      return 0;\n    }\n\n    case WM_MEASUREITEM:\n    {\n      LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam;\n\n      int nIdx = FindControlIdx(lpmis->CtlID);\n\n      if (nIdx < 0)\n        break;\n      IOExControlStorage *pField = pFields + nIdx;\n\n      switch(pField->nType)\n\n      case FIELD_LISTBOX:\n      case FIELD_COMBOBOX:\n\n        // Set the height of the items\n        lpmis->itemHeight = pField->nListItemsHeight;\n\n      return TRUE;\n    }\n\n    case WM_DRAWITEM:\n    {\n      DRAWITEMSTRUCT* lpdis = (DRAWITEMSTRUCT*)lParam;\n      int nIdx = FindControlIdx(lpdis->CtlID);\n\n      if (nIdx < 0)\n        break;\n      IOExControlStorage *pField = pFields + nIdx;\n\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP && pField->nType != FIELD_LINK)\n        return 0; //Return false so the default handling is used\n\n      // Set text and background colors now\n\n      if(pField->nType == FIELD_LABEL || pField->nType == FIELD_LINK || pField->nType == FIELD_BUTTON) {\n\n        // We need lpdis->rcItem later\n        RECT rc = lpdis->rcItem;\n\n        ++rc.left;\n           --rc.right;\n\n        if(pField->nType == FIELD_LINK)\n        {\n          ++rc.left;\n             --rc.right;\n        }\n\n        // Move rect to right if in RTL mode\n        if (bRTL)\n        {\n          rc.left += lpdis->rcItem.right - rc.right;\n          rc.right += lpdis->rcItem.right - rc.right;\n        }\n\n        if (lpdis->itemAction & ODA_DRAWENTIRE)\n        {\n          COLORREF crBgColor;\n          COLORREF crTxtColor;\n          COLORREF crTxtShwColor;\n\n          if(IsWindowEnabled(lpdis->hwndItem)) {\n            if (pField->crBgColor == 0xFFFFFFFF && GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA))\n              crBgColor = GetBkColor(lpdis->hDC);\n            else\n              crBgColor = pField->crBgColor;\n\n            if (pField->crTxtColor == 0xFFFFFFFF)\n            {\n              if (GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA))\n                crTxtColor = GetTextColor(lpdis->hDC);\n              else\n                crTxtColor = RGB(0,0,255);\n            }\n            else\n            {\n              crTxtColor = pField->crTxtColor;\n            }\n\n            if (pField->crTxtShwColor == 0xFFFFFFFF && GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA))\n              crTxtShwColor = GetBkColor(lpdis->hDC);\n            else\n              crTxtShwColor = pField->crTxtShwColor;\n          } else {\n            if (pField->crDisBgColor == 0xFFFFFFFF && GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA))\n              crBgColor = GetBkColor(lpdis->hDC);\n            else\n              crBgColor = pField->crDisBgColor;\n\n            if (pField->crDisTxtColor == 0xFFFFFFFF)\n            {\n              if(GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA))\n                crTxtColor = GetSysColor(COLOR_GRAYTEXT);\n              else\n                crTxtColor = RGB(0,0,100);\n            }\n            else\n              crTxtColor = pField->crDisTxtColor;\n\n            if (pField->crDisTxtShwColor == 0xFFFFFFFF)\n            {\n              if(GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA))\n                crTxtColor = GetSysColor(COLOR_WINDOW);\n              else\n                crTxtColor = RGB(255, 255, 255);\n            }\n            else\n              crTxtColor = pField->crDisTxtShwColor;\n          }\n\n          // Draw Background on the whole control\n          if(crBgColor != 0xFFFFFFFF && GetBkMode(lpdis->hDC) != TRANSPARENT) {\n\n            HBRUSH hBrush = CreateSolidBrush(crBgColor);\n\n            HGDIOBJ hOldSelObj = SelectObject(lpdis->hDC, hBrush);\n            if(GetDeviceCaps(lpdis->hDC, RASTERCAPS) & RC_BITBLT) {\n              int rcWidth = lpdis->rcItem.right - lpdis->rcItem.left;\n              int rcHeight = lpdis->rcItem.bottom - lpdis->rcItem.top;\n              PatBlt(lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top, rcWidth, rcHeight, PATCOPY);\n            }\n            SelectObject(lpdis->hDC, hOldSelObj);\n          }\n\n          int clrBackgroundMode = SetBkMode(lpdis->hDC, TRANSPARENT);\n\n          if(crTxtShwColor != 0xFFFFFFFF && GetBkMode(lpdis->hDC) != TRANSPARENT)\n          {\n            // Draw Shadow Text\n            ++rc.left;\n            ++rc.right;\n            ++rc.top;\n            ++rc.bottom;\n            SetTextColor(lpdis->hDC, crTxtShwColor);\n\n            DrawText(lpdis->hDC, pField->pszText, -1, &rc, DT_EXPANDTABS | DT_WORDBREAK | (pField->nTxtAlign == ALIGN_TEXT_LEFT ? DT_LEFT : 0) | (pField->nTxtAlign == ALIGN_TEXT_CENTER ? DT_CENTER : 0) | (pField->nTxtAlign == ALIGN_TEXT_RIGHT ? DT_RIGHT : 0));\n\n            // Draw Normal Text\n            --rc.left;\n            --rc.right;\n            --rc.top;\n            --rc.bottom;\n          }\n\n          // Set Text Color\n          SetTextColor(lpdis->hDC, crTxtColor);\n\n          DrawText(lpdis->hDC, pField->pszText, -1, &rc, DT_EXPANDTABS | DT_WORDBREAK | (pField->nTxtAlign == ALIGN_TEXT_LEFT ? DT_LEFT : 0) | (pField->nTxtAlign == ALIGN_TEXT_CENTER ? DT_CENTER : 0) | (pField->nTxtAlign == ALIGN_TEXT_RIGHT ? DT_RIGHT : 0));\n\n          SetBkMode(lpdis->hDC, clrBackgroundMode);\n        }\n\n        if(pField->nType == FIELD_LINK) {\n          // Draw the focus rect if needed\n          if (lpdis->itemState & ODS_FOCUS)\n          {\n            // NB: when not in DRAWENTIRE mode, this will actually toggle the focus\n            // rectangle since it's drawn in a XOR way\n            DrawFocusRect(lpdis->hDC, &lpdis->rcItem);\n          }\n        }\n        pField->RectPx = lpdis->rcItem;\n\n        if(pField->nType == FIELD_LINK && pField->nFlags & FLAG_CUSTOMDRAW_TEMP) {\n            return mySendMessage(hMainWindow, uMsg, wParam, lParam);\n        }\n      }\n      else\n      if(pField->nType == FIELD_LISTBOX || pField->nType == FIELD_COMBOBOX) {\n\n        // If there are no list box items, skip this drawing part\n\n        if (lpdis->itemID == -1)\n          break;\n\n        // We need lpdis->rcItem later\n        RECT rc = lpdis->rcItem;\n\n        switch (lpdis->itemAction)\n        {\n          case ODA_SELECT:\n          case ODA_DRAWENTIRE:\n          {\n\n            COLORREF clrBackground;\n            COLORREF clrForeground;\n\n            // Set the item selected background color\n\n            if(lpdis->itemState & ODS_SELECTED)\n            {\n              if(lpdis->itemState & ODS_DISABLED)\n              {\n                if (!GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA)) {\n                  clrForeground = SetTextColor(lpdis->hDC, pField->crDisSelTxtColor);\n                  if(pField->crBgColor != 0xFFFFFFFF)\n                    clrBackground = SetBkColor(lpdis->hDC, pField->crDisSelBgColor);\n                }\n              }\n              else\n              {\n                if (!GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA)) {\n                  clrForeground = SetTextColor(lpdis->hDC, pField->crSelTxtColor);\n                  if(pField->crBgColor != 0xFFFFFFFF)\n                    clrBackground = SetBkColor(lpdis->hDC, pField->crSelBgColor);\n                }\n              }\n            }\n            else\n            {\n              if(lpdis->itemState & ODS_DISABLED)\n              {\n                if (!GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA)) {\n                  clrForeground = SetTextColor(lpdis->hDC, pField->crDisTxtColor);\n                  if(pField->crBgColor != 0xFFFFFFFF)\n                    clrBackground = SetBkColor(lpdis->hDC, pField->crDisBgColor);\n                }\n              }\n              else\n              {\n                if (!GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA)) {\n                  clrForeground = SetTextColor(lpdis->hDC, pField->crTxtColor);\n                  if(pField->crBgColor != 0xFFFFFFFF)\n                    clrBackground = SetBkColor(lpdis->hDC, pField->crBgColor);\n                }\n              }\n            }\n\n            // Get text from the item specified by lpdis->itemID\n            LPTSTR pszItemText = (LPTSTR)MALLOC(g_nBufferSize);\n\n            if(pField->nType == FIELD_COMBOBOX)\n              SendMessage(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID, (LPARAM) pszItemText);\n            else\n              SendMessage(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, (LPARAM) pszItemText);\n\n            if (!GetWindowLongPtr(lpdis->hwndItem, GWLP_USERDATA)) {\n\n              COLORREF crBgColor;\n              COLORREF crTxtColor;\n              COLORREF crTxtShwColor;\n\n              if(lpdis->itemState & ODS_SELECTED) {\n                if(lpdis->itemState & ODS_DISABLED) {\n                  crBgColor = pField->crDisSelBgColor;\n                  crTxtColor = pField->crDisSelTxtColor;\n                  crTxtShwColor = pField->crDisSelTxtShwColor;\n                } else {\n                  crBgColor = pField->crSelBgColor;\n                  crTxtColor = pField->crSelTxtColor;\n                  crTxtShwColor = pField->crSelTxtShwColor;\n                }\n              } else {\n                if(lpdis->itemState & ODS_DISABLED) {\n                  crBgColor = pField->crDisBgColor;\n                  crTxtColor = pField->crDisTxtColor;\n                  crTxtShwColor = pField->crDisTxtShwColor;\n                } else {\n                  crBgColor = pField->crBgColor;\n                  crTxtColor = pField->crTxtColor;\n                  crTxtShwColor = pField->crTxtShwColor;\n                }\n              }\n\n              // Draw Background on the whole control\n              if(crBgColor != 0xFFFFFFFF) {\n\n                HBRUSH hBrush = CreateSolidBrush(crBgColor);\n\n                HGDIOBJ hOldSelObj = SelectObject(lpdis->hDC, hBrush);\n                if(GetDeviceCaps(lpdis->hDC, RASTERCAPS) & RC_BITBLT) {\n                  int rcWidth = lpdis->rcItem.right - lpdis->rcItem.left;\n                  int rcHeight = lpdis->rcItem.bottom - lpdis->rcItem.top;\n                  PatBlt(lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top, rcWidth, rcHeight, PATCOPY);\n                }\n                SelectObject(lpdis->hDC, hOldSelObj);\n              }\n\n              int clrBackgroundMode = SetBkMode(lpdis->hDC, TRANSPARENT);\n\n              // Make some more room so the focus rect won't cut letters off\n              rc.left += 2;\n              rc.right -= 2;\n\n              if(crTxtShwColor != 0xFFFFFFFF) {\n\n                // Draw Shadow Text\n                ++rc.left;\n                   ++rc.right;\n                ++rc.top;\n                ++rc.bottom;\n                SetTextColor(lpdis->hDC, crTxtShwColor);\n\n                DrawText(lpdis->hDC, pszItemText, -1, &rc, DT_EXPANDTABS | (pField->nTxtAlign == ALIGN_TEXT_LEFT ? DT_LEFT : 0) | (pField->nTxtAlign == ALIGN_TEXT_CENTER ? DT_CENTER : 0) | (pField->nTxtAlign == ALIGN_TEXT_RIGHT ? DT_RIGHT : 0));\n\n                // Draw Normal Text\n                --rc.left;\n                --rc.right;\n                --rc.top;\n                --rc.bottom;\n              }\n\n              // Set Text Color\n              SetTextColor(lpdis->hDC, crTxtColor);\n\n              DrawText(lpdis->hDC, pszItemText, -1, &rc, DT_EXPANDTABS | (pField->nTxtAlign == ALIGN_TEXT_LEFT ? DT_LEFT : 0) | (pField->nTxtAlign == ALIGN_TEXT_CENTER ? DT_CENTER : 0) | (pField->nTxtAlign == ALIGN_TEXT_RIGHT ? DT_RIGHT : 0));\n\n              SetBkMode(lpdis->hDC, clrBackgroundMode);\n\n              if(pField->nType == FIELD_LISTBOX) {\n                // Draw the focus rect if needed\n                if (lpdis->itemAction & ODA_FOCUS)\n                {\n                  // Return to the default rect size\n                  rc.left -= 2;\n                  rc.right += 2;\n                  // NB: when not in DRAWENTIRE mode, this will actually toggle the focus\n                  // rectangle since it's drawn in a XOR way\n                  DrawFocusRect(lpdis->hDC, &rc);\n                }\n              }\n\n              if(pField->nType == FIELD_COMBOBOX) {\n                // Draw the focus rect if needed\n                if (lpdis->itemState & ODS_SELECTED)\n                {\n                  // Return to the default rect size\n                  rc.left -= 2;\n                  rc.right += 2;\n                  // NB: when not in DRAWENTIRE mode, this will actually toggle the focus\n                  // rectangle since it's drawn in a XOR way\n                  DrawFocusRect(lpdis->hDC, &rc);\n                }\n              }\n            }\n          }\n        }\n      }\n      return 0;\n    }\n    case WM_CTLCOLORDLG:\n    {\n      // let the NSIS window handle colors, it knows best\n      return mySendMessage(hMainWindow, uMsg, wParam, lParam);\n    }\n    case WM_CTLCOLORSTATIC:\n    case WM_CTLCOLOREDIT:\n    case WM_CTLCOLORBTN:\n    case WM_CTLCOLORLISTBOX:\n    {\n      int nIdx = FindControlIdx(GetDlgCtrlID((HWND)lParam));\n\n      if (nIdx < 0)\n        break;\n      IOExControlStorage *pField = pFields + nIdx;\n\n      if(pField->nType == FIELD_TREEVIEW || (pField->nType == FIELD_IMAGE && pField->nDataType & IMAGE_TYPE_ANIMATION)) break;\n\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP || (\n            pField->nType == FIELD_CHECKBOX ||\n            pField->nType == FIELD_RADIOBUTTON ||\n            pField->nType == FIELD_BUTTON ||\n            pField->nType == FIELD_UPDOWN))\n        // let the NSIS window handle colors, it knows best\n        return mySendMessage(hMainWindow, uMsg, wParam, lParam);\n\n      // Set text and background colors now\n\n      if(pField->nType == FIELD_TEXT)\n      {\n        if(IsWindowEnabled((HWND)lParam) && !(GetWindowLong((HWND)lParam, GWL_STYLE) & ES_READONLY))\n        {\n          SetTextColor((HDC)wParam, pField->crTxtColor);\n          if(pField->crBgColor != 0xFFFFFFFF) {\n            SetBkColor((HDC)wParam, pField->crBgColor);\n\n            LOGBRUSH lb;\n\n            lb.lbStyle = BS_SOLID;\n            lb.lbColor = pField->crBgColor;\n\n            return (UINT)CreateBrushIndirect(&lb);\n          }\n          return 0;\n        }\n        else if(GetWindowLong((HWND)lParam, GWL_STYLE) & ES_READONLY)\n        {\n          SetTextColor((HDC)wParam, pField->crReadOnlyTxtColor);\n          if(pField->crReadOnlyBgColor != 0xFFFFFFFF) {\n            SetBkColor((HDC)wParam, pField->crReadOnlyBgColor);\n\n            LOGBRUSH lb;\n\n            lb.lbStyle = BS_SOLID;\n            lb.lbColor = pField->crReadOnlyBgColor;\n\n            return (UINT)CreateBrushIndirect(&lb);\n          }\n          return 0;\n        }\n      }\n      else\n      {\n        if(pField->crTxtColor != 0xFFFFFFFF)\n          SetTextColor((HDC)wParam, pField->crTxtColor);\n        if(pField->crBgColor != 0xFFFFFFFF)\n          SetBkColor((HDC)wParam, pField->crBgColor);\n      }\n\n      UpdateWindow(pField->hwnd);\n      break;\n    }\n  }\n  return 0;\n}\n\nint WINAPI ControlWindowProc(HWND hWin, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n  int iIdx = FindControlIdx(GetDlgCtrlID(hWin));\n  if (iIdx < 0)\n    return 0;\n  IOExControlStorage *pField = pFields + iIdx;\n\n  switch(uMsg)\n  {\n    //case WM_PAINT:\n  /*case WM_ERASEBKGND:\n  {\n    if(pField->nType == FIELD_IMAGE)\n    {\n      SetBkMode((HDC)wParam,TRANSPARENT);\n      Beep(1000,50);\n        return 1;\n    }\n    break;\n  }*/\n    case WM_KEYDOWN:\n    {\n      //BUG: Caused by Windows bug: the \"End\" key used for the navigation\n      //on ListView controls when the items have no icons and the view is LVS_ICON,\n      //it selects the first item on the last row of items, which differs from\n      //the usage everywhere else.\n\n      //SOLUTION: Workaround below. This handles the \"End\" key in a\n      //similar way than as done on the rest of ListView view modes,\n      //except that this sends a lot of messages, and has lots of if's.\n      \n      switch(pField->nType)\n      {\n        case FIELD_LISTVIEW:\n        {\n          if(\n             (pField->nFlags & FLAG_ICON_VIEW && !pField->pszLargeImageList) &&\n             (\n              (\n               (wParam == VK_SHIFT || HIWORD(GetKeyState(VK_SHIFT))) &&\n               (\n                (wParam != VK_LEFT && !HIWORD(GetKeyState(VK_LEFT))) &&\n                (wParam != VK_RIGHT && !HIWORD(GetKeyState(VK_RIGHT))) &&\n                (wParam != VK_UP && !HIWORD(GetKeyState(VK_UP))) &&\n                (wParam != VK_DOWN && !HIWORD(GetKeyState(VK_DOWN))) &&\n                (wParam != VK_HOME && !HIWORD(GetKeyState(VK_HOME))) &&\n                (wParam != VK_END && !HIWORD(GetKeyState(VK_END))) &&\n                (wParam != VK_PRIOR && !HIWORD(GetKeyState(VK_PRIOR))) &&\n                (wParam != VK_NEXT && !HIWORD(GetKeyState(VK_NEXT)))\n               )\n               ||\n               (wParam != VK_SHIFT && !HIWORD(GetKeyState(VK_SHIFT)) &&\n                (\n                 (wParam == VK_LEFT || HIWORD(GetKeyState(VK_LEFT))) ||\n                 (wParam == VK_RIGHT || HIWORD(GetKeyState(VK_RIGHT))) ||\n                 (wParam == VK_UP || HIWORD(GetKeyState(VK_UP))) ||\n                 (wParam == VK_DOWN || HIWORD(GetKeyState(VK_DOWN))) ||\n                 (wParam == VK_HOME || HIWORD(GetKeyState(VK_HOME))) ||\n                 (wParam == VK_END || HIWORD(GetKeyState(VK_END))) ||\n                 (wParam == VK_PRIOR || HIWORD(GetKeyState(VK_PRIOR))) ||\n                 (wParam == VK_NEXT || HIWORD(GetKeyState(VK_NEXT)))\n                )\n               )\n              )\n              &&\n              ListView_GetItemState(hWin, ListView_GetNextItem(hWin, -1, LVNI_FOCUSED), LVIS_SELECTED) & LVIS_SELECTED\n             )\n            )\n          {\n            iItemPlaceholder = ListView_GetNextItem(hWin, -1, LVNI_FOCUSED);\n          }\n\n          if(wParam == VK_END || HIWORD(GetKeyState(VK_END)))\n          {\n            if(HIWORD(GetKeyState(VK_SHIFT)))\n            {\n              int iItem = 0;\n\n              while(iItem < iItemPlaceholder && iItem != -1)\n              {\n                if(ListView_GetItemState(hWin, iItem, LVIS_SELECTED) & LVIS_SELECTED)\n                  ListView_SetItemState(hWin, iItem, 0, LVIS_FOCUSED|LVIS_SELECTED);\n                iItem = ListView_GetNextItem(hWin, iItem, LVNI_ALL);\n              }\n\n              while(iItem >= iItemPlaceholder)\n              {\n                if(ListView_GetNextItem(hWin, iItem, LVNI_ALL) == -1)\n                {\n                  if(ListView_GetItemState(hWin, iItem, LVIS_FOCUSED) | ~LVIS_FOCUSED)\n                    ListView_SetItemState(hWin, iItem, LVIS_FOCUSED, LVIS_FOCUSED);\n\n                  if(ListView_GetItemState(hWin, iItem, LVIS_SELECTED) | ~LVIS_SELECTED)\n                    ListView_SetItemState(hWin, iItem, LVIS_SELECTED, LVIS_SELECTED);\n\n                  POINT ptlvItem;\n                  ListView_GetItemPosition(hWin, iItem, &ptlvItem);\n                  ListView_Scroll(hWin, 0, ptlvItem.y);\n                  break;\n                }\n\n                if(ListView_GetItemState(hWin, iItem, LVIS_SELECTED) | ~LVIS_SELECTED)\n                  ListView_SetItemState(hWin, iItem, LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);\n\n                iItem = ListView_GetNextItem(hWin, iItem, LVNI_ALL);\n              }\n            }\n            else\n            {\n              int iItem = -1;\n\n              while(true)\n              {\n                iItem = ListView_GetNextItem(hWin, iItem, LVNI_SELECTED);\n                if(iItem == -1)\n                  break;\n\n                ListView_SetItemState(hWin, iItem, 0, LVIS_FOCUSED|LVIS_SELECTED);\n              }\n\n              iItem = -1;\n\n              while(ListView_GetNextItem(hWin, iItem, 0) != -1)\n                iItem = ListView_GetNextItem(hWin, iItem, LVNI_ALL);\n\n              ListView_SetItemState(hWin, iItem, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);\n              POINT ptlvItem;\n              ListView_GetItemPosition(hWin, iItem, &ptlvItem);\n              ListView_Scroll(hWin, 0, ptlvItem.y);\n            }\n            return 0;\n          }\n          break;\n        }\n      }\n      break;\n    }\n    case WM_GETDLGCODE:\n    {\n      if(pField->nType == FIELD_LINK)\n        // Pretend we are a normal button/default button as appropriate\n        return DLGC_BUTTON | ((pField->nFlags & FLAG_DRAW_TEMP) ? DLGC_DEFPUSHBUTTON : DLGC_UNDEFPUSHBUTTON);\n      break;\n    }\n    case BM_SETSTYLE:\n    {\n      if(pField->nType == FIELD_LINK)\n      {\n        // Detect when we are becoming the default button but don't lose the owner-draw style\n\n        // Microsoft implicitly says that BS_TYPEMASK was introduced\n        // on Win 2000. But really (maybe), it was introduced w/ Win 95.\n        // (Thank you Microsoft.)\n        if ((wParam & BS_TYPEMASK) == BS_DEFPUSHBUTTON)\n          pField->nFlags |= FLAG_DRAW_TEMP;  // Hijack this flag to indicate default button status\n        else\n          pField->nFlags &= ~FLAG_DRAW_TEMP;\n        wParam = (wParam & ~BS_TYPEMASK) | BS_OWNERDRAW;\n      }\n      break;\n    }\n    case WM_SETCURSOR:\n    {\n      if((HWND)wParam == hWin &&\n         ((pField->nType != FIELD_LINK && pField->nType != FIELD_RICHTEXT && pField->nNotify & NOTIFY_CONTROL_ONCLICK) ||\n          pField->nType == FIELD_LINK) &&\n         LOWORD(lParam) == HTCLIENT)\n      {\n        HCURSOR hCur = LoadCursor(NULL, MAKEINTRESOURCE(pField->nNotifyCursor));\n        if (hCur)\n        {\n          SetCursor(hCur);\n          return 1; // halt further processing\n        }\n      }\n      break;\n    }\n    case EM_SETPASSWORDCHAR:\n    {\n      if(pField->nType == FIELD_TEXT)\n      {\n        TCHAR* pszChar = (TCHAR*)wParam;\n        if(pField->nFlags == FLAG_PASSWORD)\n        {\n          if(lstrcmp(pszChar,_T(\"\"))==0)\n            pszChar = _T(\"*\");\n        }\n        else\n        {\n          pszChar = _T(\"\");\n        }\n        return 0;\n      }\n      break;\n    }\n    case EM_SETREADONLY:\n    {\n      if(wParam)\n        mySendMessage(pField->hwnd,EM_SETBKGNDCOLOR,0,pField->crReadOnlyBgColor);\n      else\n        mySendMessage(pField->hwnd,EM_SETBKGNDCOLOR,0,pField->crBgColor);\n    }\n  }\n  return CallWindowProc((WNDPROC)pField->nParentIdx, hWin, uMsg, wParam, lParam);\n}\n\nLRESULT WINAPI NotifyProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify) {\n\n// Initialize Variables\n//================================================================\n  TCHAR szBrowsePath[MAX_PATH];\n\n// Initialize pField\n//================================================================\n  int nIdx = FindControlIdx(id);\n  // Ignore if the dialog is in the process of being created\n  if (g_done || nIdx < 0)\n    return 0;\n  IOExControlStorage *pField = pFields + nIdx;\n\n// Detect Notifications\n//================================================================\n  bool isNotified = false;\n  bool dontSimulateNext = false;\n\n  switch(pField->nType)\n  {\n    case FIELD_RICHTEXT:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONTEXTSELCHANGE, EN_SELCHANGE);\n\t  }\n    case FIELD_TEXT:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONTEXTTRUNCATE, EN_MAXTEXT);\n\t\tNotification(NOTIFY_CONTROL_ONTEXTVSCROLL, EN_VSCROLL);\n\t\tNotification(NOTIFY_CONTROL_ONTEXTCHANGE, EN_CHANGE);\n\t\tNotification(NOTIFY_CONTROL_ONTEXTUPDATE, EN_UPDATE);\n\t\tNotification(NOTIFY_CONTROL_ONSETFOCUS, EN_SETFOCUS);\n\t\tNotification(NOTIFY_CONTROL_ONKILLFOCUS, EN_KILLFOCUS);\n\t\tbreak;\n\t  }\n\n    case FIELD_IPADDRESS:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONTEXTCHANGE, EN_CHANGE);\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, IPN_FIELDCHANGED);\n\t\tNotification(NOTIFY_CONTROL_ONSETFOCUS, EN_SETFOCUS);\n\t\tNotification(NOTIFY_CONTROL_ONKILLFOCUS, EN_KILLFOCUS);\n\t\tbreak;\n\t  }\n\n    case FIELD_COMBOBOX:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONTEXTCHANGE, CBN_EDITCHANGE);\n\t\tNotification(NOTIFY_CONTROL_ONTEXTUPDATE, CBN_EDITUPDATE);\n\t\tNotification(NOTIFY_CONTROL_ONLISTOPEN, CBN_DROPDOWN);\n\t\tNotification(NOTIFY_CONTROL_ONLISTCLOSE, CBN_CLOSEUP);\n\t  }\n    case FIELD_LISTBOX:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, CBN_SELCHANGE);\n\t\tNotification(NOTIFY_CONTROL_ONDBLCLICK, CBN_DBLCLK);\n\t\tNotification(NOTIFY_CONTROL_ONSETFOCUS, CBN_SETFOCUS);\n\t\tNotification(NOTIFY_CONTROL_ONKILLFOCUS, CBN_KILLFOCUS);\n\t\tbreak;\n\t  }\n\n    case FIELD_DATETIME:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, DTN_DATETIMECHANGE);\n\t\tNotification(NOTIFY_CONTROL_ONLISTOPEN, DTN_DROPDOWN);\n\t\tNotification(NOTIFY_CONTROL_ONLISTCLOSE, NOTIFY_CONTROL_ONLISTCLOSE);\n\t\tNotification(NOTIFY_CONTROL_ONSETFOCUS, NM_SETFOCUS);\n\t\tNotification(NOTIFY_CONTROL_ONKILLFOCUS, NM_KILLFOCUS);\n\t\tbreak;\n\t  }\n\n    case FIELD_MONTHCALENDAR:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, MCN_SELCHANGE);\n\t\tbreak;\n\t  }\n\n    case FIELD_UPDOWN:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, UDN_DELTAPOS);\n\t\tbreak;\n\t  }\n\n    case FIELD_TRACKBAR:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, TB_BOTTOM ||\n\t\t\t   codeNotify == TB_LINEDOWN ||\n\t\t\t   codeNotify == TB_LINEUP ||\n\t\t\t   codeNotify == TB_PAGEDOWN ||\n\t\t\t   codeNotify == TB_PAGEUP ||\n\t\t\t   codeNotify == TB_THUMBTRACK ||\n\t\t\t   codeNotify == TB_TOP);\n\t\tbreak;\n\t  }\n\n    case FIELD_LABEL:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONCLICK, STN_CLICKED);\n\t\tNotification(NOTIFY_CONTROL_ONDBLCLICK, STN_DBLCLK);\n\t\tbreak;\n\t  }\n\n    case FIELD_LINK:\n    case FIELD_BUTTON:\n\t  {\n\t\tif (codeNotify == BN_CLICKED || codeNotify == BN_DBLCLK)\n\t\t{\n\t\t\t  // If button or link with OPEN_FILEREQUEST, SAVE_FILEREQUEST, DIRREQUEST... flags\n\t\t\t  if ( (pField->nFlags & FLAG_OPEN_FILEREQUEST) || (pField->nFlags & FLAG_SAVE_FILEREQUEST) || (pField->nFlags & FLAG_DIRREQUEST) || (pField->nFlags & FLAG_COLORREQUEST) || (pField->nFlags & FLAG_FONTREQUEST) )\n\t\t\t  {\n\t\t\t\tdontSimulateNext = true;\n\t\t\t\tisNotified = true;\n\t\t\t  }\n\t\t\t  // If button or link with a not empty state link\n\t\t\t  else if (strlen(pField->pszState) > 0)\n\t\t\t  {\n\t\t\t\tdontSimulateNext = true;\n\t\t\t\tisNotified = true;\n\t\t\t  }\n\t\t}\n\t  }\n    case FIELD_CHECKBOX:\n    case FIELD_RADIOBUTTON:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONCLICK, BN_CLICKED);\n\t\tNotification(NOTIFY_CONTROL_ONDBLCLICK, BN_DBLCLK);\n\n\t\tbreak;\n\t  }\n\n    case FIELD_TREEVIEW:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, TVN_SELCHANGED);\n\t\tNotification(NOTIFY_CONTROL_ONCLICK, NM_CLICK);\n\t\tNotification(NOTIFY_CONTROL_ONDBLCLICK, NM_DBLCLK);\n\t\tNotification(NOTIFY_CONTROL_ONRCLICK, NM_RCLICK);\n\t\tNotification(NOTIFY_CONTROL_ONSETFOCUS, NM_SETFOCUS);\n\t\tNotification(NOTIFY_CONTROL_ONKILLFOCUS, NM_KILLFOCUS);\n\t\tbreak;\n\t  }\n\n    case FIELD_LISTVIEW:\n\t  {\n\t\tNotification(NOTIFY_CONTROL_ONSELCHANGE, LVN_ITEMCHANGED);\n\t\tNotification(NOTIFY_CONTROL_ONCLICK, NM_CLICK);\n\t\tNotification(NOTIFY_CONTROL_ONDBLCLICK, NM_DBLCLK);\n\t\tNotification(NOTIFY_CONTROL_ONRCLICK, NM_RCLICK);\n\t\tNotification(NOTIFY_CONTROL_ONRDBLCLICK, NM_RDBLCLK);\n\t\tNotification(NOTIFY_CONTROL_ONSETFOCUS, NM_SETFOCUS);\n\t\tNotification(NOTIFY_CONTROL_ONKILLFOCUS, NM_KILLFOCUS);\n\t\tbreak;\n\t  }\n\n    case FIELD_IMAGE:\n\t  {\n\t\tif(pField->nDataType == IMAGE_TYPE_ANIMATION)\n\t\t{\n\t\t  Notification(NOTIFY_CONTROL_ONSTART, ACN_START);\n\t\t  Notification(NOTIFY_CONTROL_ONSTOP, ACN_STOP);\n\t\t}\n\t\telse\n\t\t{\n\t\t  Notification(NOTIFY_CONTROL_ONCLICK, STN_CLICKED);\n\t\t  Notification(NOTIFY_CONTROL_ONDBLCLICK, STN_DBLCLK);\n\t\t}\n\t\tbreak;\n\t  }\n    default:\n      return 0;\n  }\n\n  if (!isNotified) \n  {\n    return 0;\n  }\n\n  g_aNotifyQueueTemp->iField = nIdx + 1;\n  g_aNotifyQueueTemp->bNotifyType = NOTIFY_TYPE_CONTROL;\n\n  AddNotifyQueueItem(g_aNotifyQueueTemp);\n\n\n// Associate Notifications With Actions (By Control Types)\n//================================================================\n\n  switch (pField->nType)\n  {\n\n  // Link, Button\n  //--------------------------------------------------------------\n    case FIELD_LINK:\n    case FIELD_BUTTON:\n    {\n    // State ShellExecute Implementation\n    //----------------------------------\n\n      // Allow the state to be empty - this might be useful in conjunction\n      // with the NOTIFY flag\n      if (lstrcmp(pField->pszState,_T(\"\"))!=0 && !(pField->nFlags & FLAG_OPEN_FILEREQUEST) && !(pField->nFlags & FLAG_SAVE_FILEREQUEST) && !(pField->nFlags & FLAG_DIRREQUEST) && !(pField->nFlags & FLAG_COLORREQUEST) && !(pField->nFlags & FLAG_FONTREQUEST))\n      {\n        ShellExecute(hMainWindow, NULL, pField->pszState, NULL, NULL, SW_SHOWDEFAULT);\n      }\n\n    // FileRequest Dialog Implementation\n    //----------------------------------\n      else if(pField->nFlags & FLAG_OPEN_FILEREQUEST || pField->nFlags & FLAG_SAVE_FILEREQUEST) {\n        OPENFILENAME ofn={0,};\n\n        ofn.lStructSize = sizeof(ofn);\n        ofn.hwndOwner = hConfigWindow;\n        ofn.lpstrFilter = pField->pszFilter;\n        ofn.lpstrFile = szBrowsePath;\n        ofn.nMaxFile  = _countof(szBrowsePath);\n\n        if(pField->nFlags & FLAG_WARN_IF_EXIST)\n          ofn.Flags |= OFN_OVERWRITEPROMPT;\n        if(pField->nFlags & FLAG_FILE_HIDEREADONLY)\n          ofn.Flags |= OFN_HIDEREADONLY;\n        if(pField->nFlags & FLAG_PATH_MUST_EXIST)\n          ofn.Flags |= OFN_PATHMUSTEXIST;\n        if(pField->nFlags & FLAG_FILE_MUST_EXIST)\n          ofn.Flags |= OFN_FILEMUSTEXIST;\n        if(pField->nFlags & FLAG_PROMPT_CREATE)\n          ofn.Flags |= OFN_CREATEPROMPT;\n        if(pField->nFlags & FLAG_FILE_EXPLORER)\n          ofn.Flags |= OFN_EXPLORER;\n        if(pField->nFlags & FLAG_MULTISELECT) {\n          ofn.Flags |= OFN_ALLOWMULTISELECT;\n          ofn.Flags |= OFN_EXPLORER;\n        }\n\n        if(pField->nRefFields)\n          GetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), szBrowsePath, _countof(szBrowsePath));\n        else\n          strcpy(szBrowsePath, pField->pszState);\n\n        tryagain:\n        GetCurrentDirectory(BUFFER_SIZE, szResult); // save working dir\n        if ((pField->nFlags & FLAG_SAVE_FILEREQUEST) ? GetSaveFileName(&ofn) : GetOpenFileName(&ofn)) {\n           lstrcpyn(pField->pszState,szBrowsePath,g_nBufferSize);\n          if(pField->nRefFields)\n            mySetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), szBrowsePath);\n\n          SetCurrentDirectory(szResult); // restore working dir\n                                           // OFN_NOCHANGEDIR doesn't always work (see MSDN)\n          break;\n        }\n        else if (szBrowsePath[0] && CommDlgExtendedError() == FNERR_INVALIDFILENAME) {\n          szBrowsePath[0] = _T('\\0');\n          goto tryagain;\n        }\n        break;\n      }\n\n    // DirRequest Dialog Implementation\n    //---------------------------------\n      else if(pField->nFlags & FLAG_DIRREQUEST) {\n\n        if(codeNotify == EN_CHANGE)\n          break;\n        BROWSEINFO bi;\n\n        LPTSTR szDisplayNameFolder = (LPTSTR)MALLOC(MAX_PATH);\n\n        bi.hwndOwner = hConfigWindow;\n        bi.pidlRoot = NULL;\n        bi.pszDisplayName = szDisplayNameFolder;\n        ConvertNewLines(pField->pszListItems);\n        bi.lpszTitle = pField->pszListItems;\n#ifndef BIF_NEWDIALOGSTYLE\n  #define BIF_NEWDIALOGSTYLE 0x0040\n#endif\n        bi.ulFlags = BIF_STATUSTEXT | BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;\n        bi.lpfn = BrowseCallbackProc;\n        bi.lParam = (LPARAM)szBrowsePath;\n        bi.iImage = 0;\n\n        if(pField->nRefFields)\n          GetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), szBrowsePath, _countof(szBrowsePath));\n        else\n          strcpy(szBrowsePath, pField->pszState);\n\n        lstrcpyn(szDisplayNameFolder, pField->pszState, g_nBufferSize > MAX_PATH ? MAX_PATH : g_nBufferSize);\n\n        if (pField->pszRoot) {\n          LPSHELLFOLDER sf;\n          ULONG eaten;\n          LPITEMIDLIST root;\n          SHGetDesktopFolder(&sf);\n#ifdef _UNICODE\n          sf->ParseDisplayName(hConfigWindow, NULL, pField->pszRoot, &eaten, &root, NULL);\n#else\n          int ccRoot = (lstrlen(pField->pszRoot) * 2) + 2;\n          LPWSTR pwszRoot = (LPWSTR) MALLOC(ccRoot);\n          MultiByteToWideChar(CP_ACP, 0, pField->pszRoot, -1, pwszRoot, ccRoot);\n          sf->ParseDisplayName(hConfigWindow, NULL, pwszRoot, &eaten, &root, NULL);\n          FREE(pwszRoot);\n#endif\n          bi.pidlRoot = root;\n          sf->Release();\n        }\n        \n        LPITEMIDLIST pResult = SHBrowseForFolder(&bi);\n        if (pResult)\n        {\n          if (SHGetPathFromIDList(pResult, szBrowsePath)) \n          {\n            lstrcpyn(pField->pszState,szBrowsePath,g_nBufferSize);\n            if(pField->nRefFields)\n              mySetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), szBrowsePath);\n          }\n        }\n\n        FREE(szDisplayNameFolder);\n\n        break;\n      }\n\n    // ColorRequest Dialog Implementation\n    //---------------------------------\n      else if (pField->nFlags & FLAG_COLORREQUEST)\n      {\n        CHOOSECOLOR cc;\n\n        cc.lStructSize = sizeof(cc);\n        cc.hwndOwner = pField->hwnd;\n        cc.Flags = CC_RGBINIT;\n\n        int i = 0;\n        COLORREF acrCustClr[16];\n\n        if(pField->pszListItems)\n        {\n          int nResult = 0;\n\n          LPTSTR pszStart, pszEnd;\n          pszStart = pszEnd = pField->pszListItems;\n\n          while(nResult = IOLI_NextItem(pField->pszListItems, &pszStart, &pszEnd, 0))\n          {\n            if((nResult == 5 && lstrcmp(pszStart,_T(\"\")) == 0) || nResult == 6)\n              break;\n\n            if(lstrcmp(pszStart,_T(\"\"))!=0)\n              acrCustClr[i] = (COLORREF)myatoi(pszStart);\n            else\n              acrCustClr[i] = (COLORREF)0xFFFFFF;\n\n            i++;\n\n            IOLI_RestoreItemStructure(pField->pszListItems, &pszStart, &pszEnd, nResult);\n          }\n        }\n        \n        for(;i < 16;i++)\n          acrCustClr[i] = RGB(255,255,255);\n\n        cc.lpCustColors = (LPDWORD)acrCustClr;\n\n        if(pField->nRefFields)\n          myGetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), pField->pszState);\n        \n        cc.rgbResult = (COLORREF)myatoi(pField->pszState);\n\n        if(ChooseColor(&cc))\n        {\n          mycrxtoa(pField->pszState, (int)cc.rgbResult);\n\n          if(pField->nRefFields)\n            mySetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), pField->pszState);\n\n          LPTSTR pszColorTemp = (LPTSTR)MALLOC(sizeof(COLORREF)+1);\n          LPTSTR pszResultTemp = (LPTSTR)MALLOC(g_nBufferSize);\n          LPTSTR pszResultTemp2 = (LPTSTR)MALLOC(g_nBufferSize);\n          for(i = 0;i < 16;i++)\n          {\n            mycrxtoa(pszColorTemp, acrCustClr[i]);\n            if(i==15)\n               wsprintf(pszResultTemp2,_T(\"%s%s\"),pszResultTemp,pszColorTemp);\n            else\n               wsprintf(pszResultTemp2,_T(\"%s%s\\x01\"),pszResultTemp,pszColorTemp);\n            strcpy(pszResultTemp, pszResultTemp2);\n          }\n\n          lstrcpy(pField->pszListItems, pszResultTemp);\n\n          FREE(pszColorTemp);\n          FREE(pszResultTemp);\n          FREE(pszResultTemp2);\n        }\n        break;\n      }\n\n    // FontRequest Dialog Implementation\n    //---------------------------------\n      else if (pField->nFlags & FLAG_FONTREQUEST)\n      {\n        CHOOSEFONT cf;\n        LOGFONT lf;\n        LPTSTR pszFontRequestList = (LPTSTR)MALLOC(96);\n\n        GetObject((HFONT)mySendMessage(hConfigWindow, WM_GETFONT, 0, 0), sizeof(lf), (LPVOID)&lf);\n\n        if(pField->nRefFields)\n        {\n          GetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), pField->pszState, 96);\n          pField->pszState[lstrlen(pField->pszState)-1] = '\\0';\n          LItoIOLI(pField->pszState, 96, 2, pField->nType);\n        }\n\n        lstrcpyn(pszFontRequestList, pField->pszState, 96);\n        \n        if(pszFontRequestList)\n        {\n          int i = 0;\n\n          int nResult = 0;\n\n          LPTSTR pszStart, pszEnd;\n          pszStart = pszEnd = pszFontRequestList;\n\n          while(nResult = IOLI_NextItem(pszFontRequestList, &pszStart, &pszEnd, 1))\n          {\n            if((nResult == 5 && lstrcmp(pszStart,_T(\"\")) == 0) || nResult == 6)\n              break;\n\n            switch(i)\n            {\n              case 0:\n              {\n                if(pszStart)\n                  strncpy(lf.lfFaceName,pszStart, 32);\n                break;\n              }\n              case 1:\n              {\n                if(pszStart)\n                {\n                  HDC hDC = GetDC(pField->hwnd);\n                  lf.lfHeight = -MulDiv(myatoi(pszStart), GetDeviceCaps(hDC, LOGPIXELSY), 72);\n                  ReleaseDC(pField->hwnd, hDC);\n                }\n                break;\n              }\n              case 2:\n              {\n                if(myatoi(pszStart))\n                  lf.lfWeight = 700;\n                break;\n              }\n              case 3:\n              {\n                if(myatoi(pszStart))\n                  lf.lfItalic = TRUE;\n                break;\n              }\n              case 4:\n              {\n                if(myatoi(pszStart))\n                  lf.lfUnderline = TRUE;\n                break;\n              }\n              case 5:\n              {\n                if(myatoi(pszStart))\n                  lf.lfStrikeOut = TRUE;\n                break;\n              }\n              case 6:\n              {\n                cf.rgbColors = (COLORREF)myatoi(pszStart);\n                break;\n              }\n              default:\n              { \n                break;\n              }\n            }\n            ++i;\n\n            IOLI_RestoreItemStructure(pszFontRequestList, &pszStart, &pszEnd, nResult);\n          }\n        }\n\n        cf.lStructSize = sizeof(cf);\n        cf.hwndOwner = pField->hwnd;\n        cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_INITTOLOGFONTSTRUCT | CF_NOSCRIPTSEL;\n        cf.lpLogFont = &lf;\n\n        if(ChooseFont(&cf))\n        {\n          lstrcpy(pszFontRequestList, _T(\"\"));\n          LPTSTR pszStrTemp = (LPTSTR)MALLOC(32);\n          for(int i = 0;i < 7;i++)\n          {\n            switch(i)\n            {\n              case 0:\n              {\n                strcpy(pszStrTemp,lf.lfFaceName);\n                break;\n              }\n              case 1:\n              {\n                HDC hDC = GetDC(pField->hwnd);\n                myitoa(pszStrTemp, -MulDiv(lf.lfHeight, 72, GetDeviceCaps(hDC, LOGPIXELSY)));\n                ReleaseDC(pField->hwnd, hDC);\n                break;\n              }\n              case 2:\n              {\n                if(lf.lfWeight == 700)\n                  myitoa(pszStrTemp,1);\n                else\n                  myitoa(pszStrTemp,0);\n                break;\n              }\n              case 3:\n              {\n                if(lf.lfItalic)\n                  myitoa(pszStrTemp,1);\n                else\n                  myitoa(pszStrTemp,0);\n                break;\n              }\n              case 4:\n              {\n                if(lf.lfUnderline)\n                  myitoa(pszStrTemp,1);\n                else\n                  myitoa(pszStrTemp,0);\n                break;\n              }\n              case 5:\n              {\n                if(lf.lfStrikeOut)\n                  myitoa(pszStrTemp,1);\n                else\n                  myitoa(pszStrTemp,0);\n                break;\n              }\n              case 6:\n              {\n                mycrxtoa(pszStrTemp, cf.rgbColors);\n                break;\n              }\n              default:\n                break;\n            }\n\n            if(i==6)\n              lstrcat(pszFontRequestList, pszStrTemp);\n            else\n            {\n              lstrcat(pszFontRequestList, pszStrTemp);\n              lstrcat(pszFontRequestList, _T(\"\\x01\"));\n            }\n          }\n\n          lstrcpyn(pField->pszState,pszFontRequestList, 96);\n\n          if(pField->nRefFields)\n          {\n            pszFontRequestList = IOLItoLI(pszFontRequestList, 96, pField->nType);\n            SetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), pszFontRequestList);\n          }\n          FREE(pszStrTemp);\n        }\n        //else\n        //if(!pField->nRefFields)\n        //  pField->pszState[lstrlen(pField->pszState)-1] = '\\0';\n        FREE(pszFontRequestList);\n      }\n      break;\n    }\n  }\n\n// Kill the page timer if notified (TimeOut Implementation)\n//================================================================\n  if(g_timer_id != 0)\n  {\n    nTimeOut = nTimeOutTemp - (GetTickCount() - g_timer_cur_time);\n    if (nTimeOut < USER_TIMER_MINIMUM)\n      nTimeOut = 0;\n    KillTimer(hConfigWindow, g_timer_id);\n  }\n\n// Simulate \"Next\" Click So NSIS Can Call Its PageAfter Function\n//================================================================\n  if (dontSimulateNext != true)\n    mySendMessage(hMainWindow, WM_NOTIFY_OUTER_NEXT, 1, 0);\n\n  return 0;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nint WINAPI ReadSettings() {\n\n// Initial Variables Definitions\n//================================================================\n  static TCHAR szField[25];\n  int nIdx, nCtrlIdx;\n\n// Get Window Settings\n//================================================================\n  pszAppName = _T(\"Settings\");\n\n  // Assign default values for buffer sizes:\n  g_nBufferSize = BUFFER_SIZE;\n  g_nNotifyQueueAmountMax = NOTIFY_QUEUE_AMOUNT_MAX;\n\n  // BufferSize\n  //--------------------------------------------------------------\n  LPTSTR pszTemp = (LPTSTR)MALLOC(16 * sizeof(TCHAR));\n\n  GetPrivateProfileString(pszAppName, _T(\"BufferSize\"), _T(\"\"), pszTemp, 16, pszFilename);\n  g_nBufferSize = myatoi(pszTemp);\n  FREE(pszTemp);\n\n  if(g_nBufferSize < 1)\n    g_nBufferSize = BUFFER_SIZE;\n\n  // Use this for normal \"szResult\" uses\n  szResult = (TCHAR*)MALLOC(g_nBufferSize);\n\n  // NotifyFlagsMax\n  //--------------------------------------------------------------\n  g_nNotifyQueueAmountMax = myGetProfileInt(_T(\"NotifyFlagsMax\"), NOTIFY_QUEUE_AMOUNT_MAX);\n\n  if(g_nNotifyQueueAmountMax <= 0)\n    g_nNotifyQueueAmountMax = NOTIFY_QUEUE_AMOUNT_MAX;\n\n  // Title\n  //--------------------------------------------------------------\n  pszTitle = myGetProfileStringDup(_T(\"Title\"));\n\n  // CancelButtonText\n  //--------------------------------------------------------------\n  pszCancelButtonText = myGetProfileStringDup(_T(\"CancelButtonText\"));\n\n  // NextButtonText\n  //--------------------------------------------------------------\n  pszNextButtonText = myGetProfileStringDup(_T(\"NextButtonText\"));\n\n  // BackButtonText\n  //--------------------------------------------------------------\n  pszBackButtonText = myGetProfileStringDup(_T(\"BackButtonText\"));\n\n  // Rect\n  //--------------------------------------------------------------\n  nRectId = myGetProfileInt(_T(\"Rect\"), DEFAULT_RECT);\n\n  // NextEnabled\n  //--------------------------------------------------------------\n  bNextEnabled = myGetProfileInt(_T(\"NextEnabled\"), -1);\n\n  // NextShow\n  //--------------------------------------------------------------\n  bNextShow = myGetProfileInt(_T(\"NextShow\"), -1);\n\n  // BackEnabled\n  //--------------------------------------------------------------\n  bBackEnabled = myGetProfileInt(_T(\"BackEnabled\"), -1);\n\n  // BackShow\n  //--------------------------------------------------------------\n  bBackShow = myGetProfileInt(_T(\"BackShow\"), -1);\n\n  // CancelEnabled\n  //--------------------------------------------------------------\n  bCancelEnabled = myGetProfileInt(_T(\"CancelEnabled\"), -1);\n\n  // CancelShow\n  //--------------------------------------------------------------\n  bCancelShow = myGetProfileInt(_T(\"CancelShow\"), -1);\n\n  // RTL\n  //--------------------------------------------------------------\n  bRTL = myGetProfileInt(_T(\"RTL\"), 0);\n\n  // MUnit\n  //--------------------------------------------------------------\n  bMUnit = myGetProfileInt(_T(\"MUnit\"), 0);\n\n  // TimeOut\n  //--------------------------------------------------------------\n  nTimeOut = myGetProfileInt(_T(\"TimeOut\"), 0);\n  if (nTimeOut < USER_TIMER_MINIMUM || nTimeOut > USER_TIMER_MAXIMUM)\n    nTimeOut = 0;\n  nTimeOutTemp = nTimeOut;\n\n  // NumFields\n  //--------------------------------------------------------------\n  nNumFields = myGetProfileInt(_T(\"NumFields\"), 0);\n  if(nNumFields <= 0)\n  {\n    nNumFields = 0;\n    while (nNumFields > -1) {\n      wsprintf(szField, _T(\"Field %d\"), nNumFields + 1);\n      pszAppName = szField;\n      if(myGetProfileString(_T(\"Type\")))\n        ++nNumFields;\n      else\n        break;\n    }\n  }\n\n  if (nNumFields > 0)\n    // the structure is small enough that this won't waste much memory.\n    // if the structure gets much larger, we should switch to a linked list.\n    pFields = (IOExControlStorage *)MALLOC(sizeof(IOExControlStorage)*nNumFields);\n\n// Detect Field Settings\n//================================================================\n  for (nIdx = 0, nCtrlIdx = 0; nCtrlIdx < nNumFields; nCtrlIdx++, nIdx++) {\n\n  // Type Flags\n  //-----------\n    static TableEntry TypeTable[] = {\n      { _T(\"Label\"),         FIELD_LABEL         },\n      { _T(\"GroupBox\"),      FIELD_GROUPBOX      },\n      { _T(\"Image\"),         FIELD_IMAGE         },\n      { _T(\"Icon\"),          FIELD_IMAGE         }, // For compatibility w/ IO\n      { _T(\"Bitmap\"),        FIELD_IMAGE         }, // For compatibility w/ IO\n      { _T(\"Animation\"),     FIELD_IMAGE         }, // For compatibility w/ IO\n      { _T(\"ProgressBar\"),   FIELD_PROGRESSBAR   },\n      { _T(\"Link\"),          FIELD_LINK          },\n      { _T(\"CheckBox\"),      FIELD_CHECKBOX      },\n      { _T(\"RadioButton\"),   FIELD_RADIOBUTTON   },\n      { _T(\"Button\"),        FIELD_BUTTON        },\n      { _T(\"UpDown\"),        FIELD_UPDOWN        },\n      { _T(\"Text\"),          FIELD_TEXT          },\n      { _T(\"Edit\"),          FIELD_TEXT          }, // Same as TEXT\n      { _T(\"Password\"),      FIELD_TEXT          },\n      { _T(\"IPAddress\"),     FIELD_IPADDRESS     },\n      { _T(\"RichText\"),      FIELD_RICHTEXT      },\n      { _T(\"RichEdit\"),      FIELD_RICHTEXT      }, // Same as RICHTEXT\n      { _T(\"DropList\"),      FIELD_COMBOBOX      },\n      { _T(\"ComboBox\"),      FIELD_COMBOBOX      },\n      { _T(\"DateTime\"),      FIELD_DATETIME      },\n      { _T(\"ListBox\"),       FIELD_LISTBOX       },\n      { _T(\"ListView\"),      FIELD_LISTVIEW      },\n      { _T(\"TreeView\"),      FIELD_TREEVIEW      },\n      { _T(\"TrackBar\"),      FIELD_TRACKBAR      },\n      { _T(\"MonthCalendar\"), FIELD_MONTHCALENDAR },\n      { _T(\"HLINE\"),         FIELD_HLINE         },\n      { _T(\"VLINE\"),         FIELD_VLINE         },\n      { NULL,            0                   }\n    };\n\n  // Control Flags\n  //--------------\n    static TableEntry FlagTable[] = {\n      // All\n      { _T(\"DISABLED\"),          FLAG_DISABLED          },\n      { _T(\"GROUP\"),             FLAG_GROUP             },\n      { _T(\"NOTABSTOP\"),         FLAG_NOTABSTOP         },\n\n      // Image\n      { _T(\"RESIZETOFIT\"),       FLAG_RESIZETOFIT       },\n      { _T(\"TRANSPARENT\"),       FLAG_TRANSPARENT       },\n\n      // ProgressBar\n      { _T(\"SMOOTH\"),             FLAG_SMOOTH            },\n      { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n\n      // CheckBox/RadioButton\n      { _T(\"READONLY\"),          FLAG_READONLY          },\n      { _T(\"3STATE\"),             FLAG_3STATE            }, // Except CheckBox\n\n      // Button\n      { _T(\"OPEN_FILEREQUEST\"),  FLAG_OPEN_FILEREQUEST  },\n      { _T(\"SAVE_FILEREQUEST\"),  FLAG_SAVE_FILEREQUEST  },\n      { _T(\"REQ_SAVE\"),          FLAG_SAVE_FILEREQUEST  },\n      { _T(\"DIRREQUEST\"),        FLAG_DIRREQUEST        },\n      { _T(\"COLORREQUEST\"),      FLAG_COLORREQUEST      },\n      { _T(\"FONTREQUEST\"),       FLAG_FONTREQUEST       },\n\n      { _T(\"FILE_MUST_EXIST\"),   FLAG_FILE_MUST_EXIST   },\n      { _T(\"FILE_EXPLORER\"),     FLAG_FILE_EXPLORER     },\n      { _T(\"FILE_HIDEREADONLY\"), FLAG_FILE_HIDEREADONLY },\n      { _T(\"WARN_IF_EXIST\"),     FLAG_WARN_IF_EXIST     },\n      { _T(\"PATH_MUST_EXIST\"),   FLAG_PATH_MUST_EXIST   },\n      { _T(\"PROMPT_CREATE\"),     FLAG_PROMPT_CREATE     },\n\n      { _T(\"BITMAP\"),            FLAG_BITMAP            },\n      { _T(\"ICON\"),              FLAG_ICON              },\n\n      // UpDown\n      { _T(\"HSCROLL\"),           FLAG_HSCROLL           },\n      { _T(\"WRAP\"),              FLAG_WRAP              },\n\n      // Text/Password/RichText\n      { _T(\"ONLY_NUMBERS\"),      FLAG_ONLYNUMBERS       },\n      { _T(\"MULTILINE\"),         FLAG_MULTILINE         },\n      { _T(\"WANTRETURN\"),        FLAG_WANTRETURN        },\n      { _T(\"NOWORDWRAP\"),        FLAG_NOWORDWRAP        },\n//    { _T(\"HSCROLL\"),           FLAG_HSCROLL           },\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n//    { _T(\"READONLY\"),          FLAG_READONLY          },\n      { _T(\"PASSWORD\"),          FLAG_PASSWORD          }, //Except Password\n      { _T(\"FOCUS\"),             FLAG_FOCUS             },\n\n      // DropList/ComboBox\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n      { _T(\"DROPLIST\"),          FLAG_DROPLIST          }, //Except DropList\n\n      // DateTime\n      { _T(\"UPDOWN\"),            FLAG_UPDOWN            },\n\n      // ListBox\n      { _T(\"MULTISELECT\"),       FLAG_MULTISELECT       },\n      { _T(\"EXTENDEDSELECT\"),    FLAG_EXTENDEDSELECT    },\n      { _T(\"EXTENDEDSELCT\"),     FLAG_EXTENDEDSELECT    },\n\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n\n      // ListView/TreeView\n      { _T(\"CHECKBOXES\"),        FLAG_CHECKBOXES        },\n      { _T(\"EDITLABELS\"),        FLAG_EDITLABELS        },\n//    { _T(\"MULTISELECT\"),       FLAG_MULTISELECT       },\n\n      { _T(\"LIST_VIEW\"),         FLAG_LIST_VIEW         },\n      { _T(\"ICON_VIEW\"),         FLAG_ICON_VIEW         },\n      { _T(\"SMALLICON_VIEW\"),    FLAG_SMALLICON_VIEW    },\n      { _T(\"REPORT_VIEW\"),       FLAG_REPORT_VIEW       },\n\n      // TrackBar\n      { _T(\"NO_TICKS\"),          FLAG_NO_TICKS          },\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n\n      // MonthCalendar\n      { _T(\"NOTODAY\"),           FLAG_NOTODAY           },\n      { _T(\"WEEKNUMBERS\"),       FLAG_WEEKNUMBERS       },\n\n      // Null\n      { NULL,                0                      }\n    };\n\n  // Control Alignation Flags\n  //-------------------------\n    static TableEntry AlignTable[] = {\n      { _T(\"LEFT\"),   ALIGN_LEFT    },\n      { _T(\"CENTER\"), ALIGN_CENTER  },\n      { _T(\"RIGHT\"),  ALIGN_RIGHT   },\n      { NULL,     0             }\n    };\n\n    static TableEntry VAlignTable[] = {\n      { _T(\"TOP\"),    VALIGN_TOP    },\n      { _T(\"CENTER\"), VALIGN_CENTER },\n      { _T(\"BOTTOM\"), VALIGN_BOTTOM },\n      { NULL,     0             }\n    };\n\n  // Text Alignation Flags\n  //-------------------------\n    static TableEntry TxtAlignTable[] = {\n      { _T(\"LEFT\"),    ALIGN_TEXT_LEFT    },\n      { _T(\"CENTER\"),  ALIGN_TEXT_CENTER  },\n      { _T(\"RIGHT\"),   ALIGN_TEXT_RIGHT   },\n      { _T(\"JUSTIFY\"), ALIGN_TEXT_JUSTIFY },\n      { NULL,      0                  }\n    };\n\n    static TableEntry TxtVAlignTable[] = {\n      { _T(\"TOP\"),     VALIGN_TEXT_TOP     },\n      { _T(\"CENTER\"),  VALIGN_TEXT_CENTER  },\n      { _T(\"BOTTOM\"),  VALIGN_TEXT_BOTTOM  },\n      { _T(\"JUSTIFY\"), VALIGN_TEXT_JUSTIFY },\n      { NULL,      0                   }\n    };\n\n  // ToolTip Flags\n  //--------------\n    static TableEntry ToolTipFlagTable[] = {\n      { _T(\"NOALWAYSTIP\"), TTS_ALWAYSTIP },\n      { _T(\"BALLOON\"),     TTS_BALLOON   },\n      { _T(\"NOANIMATE\"),   TTS_NOANIMATE },\n      { _T(\"NOFADE\"),      TTS_NOFADE    },\n      { _T(\"NOPREFIX\"),    TTS_NOPREFIX  },\n      { NULL,          0             }\n    };\n\n  // ToolTip Icon Flags\n  //-------------------\n    static TableEntry ToolTipIconTable[] = {\n      { _T(\"INFORMATION\"), 1 },\n      { _T(\"EXCLAMATION\"), 2 },\n      { _T(\"STOP\"),        3 },\n      { NULL,          0 }\n    };\n\n  // Notification Flag Cursor Flags\n  //-------------------------------\n  // These below are resource numbers. Needs to use MAKEINTRESOURCE later.\n    static TableEntry NotifyCursorTable[] = {\n      { _T(\"APPSTARTING\"), 32650 },\n      { _T(\"ARROW\"),       32512 },\n      { _T(\"CROSS\"),       32515 },\n      { _T(\"HAND\"),        32649 },\n      { _T(\"HELP\"),        32651 },\n      { _T(\"IBEAM\"),       32513 },\n      { _T(\"NO\"),          32648 },\n      { _T(\"SIZEALL\"),     32646 },\n      { _T(\"SIZENESW\"),    32643 },\n      { _T(\"SIZENS\"),      32645 },\n      { _T(\"SIZENWSE\"),    32642 },\n      { _T(\"SIZEWE\"),      32644 },\n      { _T(\"UPARROW\"),     32516 },\n      { _T(\"WAIT\"),        32514 },\n      { NULL,          0     }\n    };\n\n  // Initialize pField\n  //--------------------------------------------------------------\n    IOExControlStorage *pField = pFields + nIdx;\n\n    pField->nControlID = 1200 + nIdx;\n\n  // Initialize Field Settings\n  //--------------------------------------------------------------\n    pField->nField = nCtrlIdx + 1;\n    wsprintf(szField, _T(\"Field %d\"), nCtrlIdx + 1);\n    pszAppName = szField;\n\n  // Type\n  //--------------------------------------------------------------\n    myGetProfileString(_T(\"TYPE\"));\n    pField->nType = LookupToken(TypeTable, szResult);\n\n    if (pField->nType == FIELD_INVALID)\n      continue;\n\n  // Flags\n  //--------------------------------------------------------------\n    // This transforms the control type name to a flag, if the\n    // flag exists.\n    pField->nFlags = LookupToken(FlagTable, szResult);\n\n    myGetProfileString(_T(\"Flags\"));\n    pField->nFlags |= LookupTokens(FlagTable, szResult);\n\n    // Remove FLAG_CUSTOMDRAW_TEMP flag only when the user\n    // specifies any of the color commands.\n    switch(pField->nType)\n    {\n      case FIELD_LABEL:\n      case FIELD_LINK:\n      case FIELD_TEXT:\n      case FIELD_LISTBOX:\n      case FIELD_COMBOBOX:\n    case FIELD_GROUPBOX:\n      {\n        pField->nFlags |= FLAG_CUSTOMDRAW_TEMP;\n        break;\n      }\n    }\n\n  // Notify\n  //--------------------------------------------------------------\n    myGetProfileString(_T(\"Notify\"));\n    pField->nNotify |= LookupTokens(ControlNotifyTable, szResult);\n\n  // NotifyCursor\n  //--------------------------------------------------------------\n    myGetProfileString(_T(\"NotifyCursor\"));\n    pField->nNotifyCursor = LookupToken(NotifyCursorTable, szResult);\n    if(!pField->nNotifyCursor || pField->nNotifyCursor == 0)\n      if(pField->nType == FIELD_LINK)\n        pField->nNotifyCursor = 32649; //HAND\n      else\n        pField->nNotifyCursor = 32512; //ARROW\n\n  // Align\n  //--------------------------------------------------------------\n    myGetProfileString(_T(\"Align\"));\n    pField->nAlign = LookupToken(AlignTable, szResult);\n    if(bRTL)\n    {\n      if(pField->nAlign == ALIGN_LEFT)\n        pField->nAlign = ALIGN_RIGHT;\n      else\n      if(pField->nAlign == ALIGN_RIGHT)\n        pField->nAlign = ALIGN_LEFT;\n    }\n\n  // VAlign\n  //--------------------------------------------------------------\n    myGetProfileString(_T(\"VAlign\"));\n    pField->nVAlign = LookupToken(VAlignTable, szResult);\n\n  // TxtAlign\n  //--------------------------------------------------------------\n    myGetProfileString(_T(\"TxtAlign\"));\n    pField->nTxtAlign = LookupToken(TxtAlignTable, szResult);\n    if(bRTL)\n    {\n      if(pField->nTxtAlign == ALIGN_TEXT_LEFT)\n        pField->nTxtAlign = ALIGN_TEXT_RIGHT;\n      else\n      if(pField->nTxtAlign == ALIGN_TEXT_RIGHT)\n        pField->nTxtAlign = ALIGN_TEXT_LEFT;\n    }\n\n  // TxtVAlign\n  //--------------------------------------------------------------\n    myGetProfileString(_T(\"TxtVAlign\"));\n    pField->nTxtVAlign = LookupToken(TxtVAlignTable, szResult);\n\n  // RefFields\n  //--------------------------------------------------------------\n    pField->nRefFields = myGetProfileInt(_T(\"RefFields\"), 0);\n\n  // State\n  //--------------------------------------------------------------\n    // pszState must not be NULL!\n    if (pField->nType == FIELD_TREEVIEW || pField->nType == FIELD_LISTVIEW || (pField->nType == FIELD_BUTTON && pField->nFlags & FLAG_FONTREQUEST && !pField->nRefFields))\n    {\n      pField->pszState = myGetProfileListItemsDup(_T(\"State\"), 0, pField->nType);\n    }\n    else\n    {\n      myGetProfileString(_T(\"State\"));\n      if(!szResult && (pField->nType == FIELD_BUTTON || pField->nType == FIELD_LINK) && pField->nFlags & FLAG_COLORREQUEST)\n        myitoa(szResult, GetSysColor(COLOR_WINDOW));\n      pField->pszState = strdup(szResult); // uses STRDUP\n    }\n\n  // ListItems\n  //--------------------------------------------------------------\n    {\n      if ((pField->nType == FIELD_BUTTON || pField->nType == FIELD_LINK) && pField->nFlags & FLAG_DIRREQUEST)\n        pField->pszListItems = myGetProfileStringDup(_T(\"ListItems\"));\n      else\n      {\n        pField->pszListItems = myGetProfileListItemsDup(_T(\"ListItems\"), 0, pField->nType);\n      }\n    }\n\n  // Text\n  //--------------------------------------------------------------\n    // Label Text - convert newline\n    pField->pszText = myGetProfileStringDup(_T(\"TEXT\"));\n    if (pField->nType == FIELD_LABEL || pField->nType == FIELD_LINK)\n      ConvertNewLines(pField->pszText);\n\n  // Root\n  //--------------------------------------------------------------\n    // Dir request - root folder\n    pField->pszRoot = myGetProfileStringDup(_T(\"ROOT\"));\n\n  // ValidateText\n  //--------------------------------------------------------------\n    // ValidateText - convert newline\n    pField->pszValidateText = myGetProfileStringDup(_T(\"ValidateText\"));\n    ConvertNewLines(pField->pszValidateText);\n\n  // Filter\n  //--------------------------------------------------------------\n    pField->pszFilter = myGetProfileFilterItemsDup(_T(\"Filter\"));\n\n  // HeaderItems\n  //--------------------------------------------------------------\n    pField->pszHeaderItems = myGetProfileListItemsDup(_T(\"HeaderItems\"), 2, pField->nType);\n\n  // HeaderItemsWidth\n  //--------------------------------------------------------------\n    pField->pszHeaderItemsWidth = myGetProfileListItemsDup(_T(\"HeaderItemsWidth\"), 2, pField->nType);\n\n  // HeaderItemsAlign\n  //--------------------------------------------------------------\n    pField->pszHeaderItemsAlign = myGetProfileListItemsDup(_T(\"HeaderItemsAlign\"), 2, pField->nType);\n\n  // StateImageList\n  //--------------------------------------------------------------\n    pField->pszStateImageList = myGetProfileStringDup(_T(\"StateImageList\"));\n\n  // SmallImageList\n  //--------------------------------------------------------------\n    pField->pszSmallImageList = myGetProfileStringDup(_T(\"SmallImageList\"));\n\n  // LargeImageList\n  //--------------------------------------------------------------\n    pField->pszLargeImageList = myGetProfileStringDup(_T(\"LargeImageList\"));\n\n  // Left\n  //--------------------------------------------------------------\n    pField->RectUDU.left = myGetProfileInt(_T(\"Left\"), 0);\n\n  // Top\n  //--------------------------------------------------------------\n    pField->RectUDU.top = myGetProfileInt(_T(\"Top\"), 0);\n\n  // Width\n  //--------------------------------------------------------------\n    if(myGetProfileInt(_T(\"Width\"), 0))\n      pField->RectUDU.right = myGetProfileInt(_T(\"Width\"), 0) + pField->RectUDU.left;\n\n  // Height\n  //--------------------------------------------------------------\n    if(myGetProfileInt(_T(\"Height\"), 0))\n      pField->RectUDU.bottom = myGetProfileInt(_T(\"Height\"), 0) + pField->RectUDU.top;\n\n  // Right\n  //--------------------------------------------------------------\n    pField->RectUDU.right = myGetProfileInt(_T(\"Right\"), 0);\n\n  // Bottom\n  //--------------------------------------------------------------\n    pField->RectUDU.bottom = myGetProfileInt(_T(\"Bottom\"), 0);\n\n  // MinLen\n  //--------------------------------------------------------------\n    pField->nMinLength = myGetProfileInt(_T(\"MinLen\"), 0);\n\n  // MaxLen\n  //--------------------------------------------------------------\n    pField->nMaxLength = myGetProfileInt(_T(\"MaxLen\"), 0);\n\n  // FontName\n  //--------------------------------------------------------------\n    if(myGetProfileString(_T(\"FontName\")))\n      pField->pszFontName = myGetProfileStringDup(_T(\"FontName\"));\n\n  // FontHeight\n  //--------------------------------------------------------------\n    pField->nFontHeight = myGetProfileInt(_T(\"FontHeight\"), 0);\n\n  // FontWidth\n  //--------------------------------------------------------------\n    pField->nFontWidth = myGetProfileInt(_T(\"FontWidth\"), 0);\n\n  // FontBold\n  //--------------------------------------------------------------\n    if(myGetProfileInt(_T(\"FontBold\"), 0))\n      pField->nFontBold = TRUE;\n    else\n      pField->nFontBold = FALSE;\n\n  // FontItalic\n  //--------------------------------------------------------------\n    if(myGetProfileInt(_T(\"FontItalic\"), 0))\n      pField->nFontItalic = TRUE;\n    else\n      pField->nFontItalic = FALSE;\n\n  // FontUnderline\n  //--------------------------------------------------------------\n    if(myGetProfileInt(_T(\"FontUnderline\"), 0))\n      pField->nFontUnderline = TRUE;\n    else\n      pField->nFontUnderline = FALSE;\n\n  // FontStrikeOut\n  //--------------------------------------------------------------\n    if(myGetProfileInt(_T(\"FontStrikeOut\"), 0))\n      pField->nFontStrikeOut = TRUE;\n    else\n      pField->nFontStrikeOut = FALSE;\n\n  // ListItemsHeight\n  //--------------------------------------------------------------\n    pField->nListItemsHeight = myGetProfileInt(_T(\"ListItemsHeight\"), 15);\n\n  // TxtColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"TxtColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LABEL:\n        case FIELD_TEXT:\n        case FIELD_LISTBOX:\n        case FIELD_COMBOBOX:\n        case FIELD_TREEVIEW:\n        case FIELD_LISTVIEW:\n          pField->crTxtColor = GetSysColor(COLOR_WINDOWTEXT);\n          break;\n        case FIELD_MONTHCALENDAR:\n        case FIELD_DATETIME:\n          pField->crTxtColor = GetSysColor(COLOR_INFOTEXT);\n          break;\n//Retain 0xFFFFFFFF for later:\n//        case FIELD_LINK:\n//          pField->crTxtColor = RGB(0,0,255);\n//        break;\n        case FIELD_PROGRESSBAR:\n          pField->crTxtColor = GetSysColor(COLOR_MENUHILIGHT);\n          break;\n        default:\n          pField->crTxtColor = myGetProfileInt(_T(\"TxtColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crTxtColor = myGetProfileInt(_T(\"TxtColor\"), 0xFFFFFFFF);\n    }\n\n  // BgColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"BgColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_TEXT:\n        case FIELD_RICHTEXT:\n        case FIELD_LISTBOX:\n        case FIELD_COMBOBOX:\n        case FIELD_TREEVIEW:\n        case FIELD_LISTVIEW:\n          pField->crBgColor = GetSysColor(COLOR_WINDOW);\n          break;\n        case FIELD_DATETIME:\n        case FIELD_MONTHCALENDAR:\n          pField->crBgColor = GetSysColor(COLOR_INFOBK);\n          break;\n        default:\n          pField->crBgColor = myGetProfileInt(_T(\"BgColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crBgColor = myGetProfileInt(_T(\"BgColor\"), 0xFFFFFFFF);\n    }\n\n  // ReadOnlyTxtColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"ReadOnlyTxtColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_TEXT:\n          pField->crReadOnlyTxtColor = GetSysColor(COLOR_WINDOWTEXT);\n          break;\n        default:\n          pField->crReadOnlyTxtColor = myGetProfileInt(_T(\"ReadOnlyTxtColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n      pField->crReadOnlyTxtColor = myGetProfileInt(_T(\"ReadOnlyTxtColor\"), 0xFFFFFFFF);\n\n  // ReadOnlyBgColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"ReadOnlyBgColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_TEXT:\n        case FIELD_RICHTEXT:\n          pField->crReadOnlyBgColor = GetSysColor(COLOR_3DFACE);\n          break;\n        default:\n          pField->crReadOnlyBgColor = myGetProfileInt(_T(\"ReadOnlyBgColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n      pField->crReadOnlyBgColor = myGetProfileInt(_T(\"ReadOnlyBgColor\"), 0xFFFFFFFF);\n\n  // SelTxtColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"SelTxtColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LISTBOX:\n        case FIELD_COMBOBOX:\n        case FIELD_MONTHCALENDAR:\n        case FIELD_DATETIME:\n          pField->crSelTxtColor = GetSysColor(COLOR_HIGHLIGHTTEXT);\n          break;\n        default:\n          pField->crSelTxtColor = myGetProfileInt(_T(\"SelTxtColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crSelTxtColor = myGetProfileInt(_T(\"SelTxtColor\"), 0xFFFFFFFF);\n    }\n\n  // SelBgColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"SelBgColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LISTBOX:\n        case FIELD_COMBOBOX:\n        case FIELD_MONTHCALENDAR:\n        case FIELD_DATETIME:\n          pField->crSelBgColor = GetSysColor(COLOR_MENUHILIGHT);\n          break;\n        default:\n          pField->crSelBgColor = myGetProfileInt(_T(\"SelBgColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crSelBgColor = myGetProfileInt(_T(\"SelBgColor\"), 0xFFFFFFFF);\n    }\n\n  // DisTxtColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"DisTxtColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LABEL:\n        case FIELD_LISTBOX:\n        case FIELD_COMBOBOX:\n          pField->crDisTxtColor = GetSysColor(COLOR_GRAYTEXT);\n          break;\n//Retain 0xFFFFFFFF for later:\n//        case FIELD_LINK:\n//          pField->crDisTxtColor = RGB(0,0,100);\n//          break;\n        default:\n          pField->crDisTxtColor = myGetProfileInt(_T(\"DisTxtColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crDisTxtColor = myGetProfileInt(_T(\"DisTxtColor\"), 0xFFFFFFFF);\n    }\n\n  // DisBgColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"DisBgColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LISTBOX:\n          pField->crDisBgColor = GetSysColor(COLOR_WINDOW);\n          break;\n        default:\n          pField->crDisBgColor = myGetProfileInt(_T(\"DisBgColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crDisBgColor = myGetProfileInt(_T(\"DisBgColor\"), 0xFFFFFFFF);\n    }\n\n  // DisSelTxtColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"DisSelTxtColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LISTBOX:\n          pField->crDisSelTxtColor = RGB(255, 255, 255);\n          break;\n        default:\n          pField->crDisSelTxtColor = myGetProfileInt(_T(\"DisSelTxtColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crDisSelTxtColor = myGetProfileInt(_T(\"DisSelTxtColor\"), 0xFFFFFFFF);\n    }\n\n  // DisSelBgColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"DisSelBgColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LISTBOX:\n          pField->crDisSelBgColor = RGB(170, 170, 170);\n          break;\n        default:\n             pField->crDisSelBgColor = myGetProfileInt(_T(\"DisSelBgColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crDisSelBgColor = myGetProfileInt(_T(\"DisSelBgColor\"), 0xFFFFFFFF);\n    }\n\n  // TxtShwColor\n  //--------------------------------------------------------------\n    pField->crTxtShwColor = (COLORREF)myGetProfileInt(_T(\"TxtShwColor\"), 0xFFFFFFFF);\n    if (pField->crTxtShwColor != 0xFFFFFFFF)\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n\n\n  // SelTxtShwColor\n  //--------------------------------------------------------------\n    pField->crSelTxtShwColor = (COLORREF)myGetProfileInt(_T(\"SelTxtShwColor\"), 0xFFFFFFFF);\n    if (pField->crSelTxtShwColor != 0xFFFFFFFF)\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n\n  // DisTxtShwColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"DisTxtShwColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_LABEL:\n          pField->crDisTxtShwColor = GetSysColor(COLOR_WINDOW);\n          break;\n//Retain 0xFFFFFFFF for later:\n//        case FIELD_LINK:\n//          pField->crDisTxtShwColor = RGB(255, 255, 255);\n//          break;\n        default:\n          pField->crDisTxtShwColor = myGetProfileInt(_T(\"DisTxtShwColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crDisTxtShwColor = myGetProfileInt(_T(\"DisTxtShwColor\"), 0xFFFFFFFF);\n    }\n\n  // DisSelTxtShwColor\n  //--------------------------------------------------------------\n    pField->crDisSelTxtShwColor = (COLORREF)myGetProfileInt(_T(\"DisSelTxtShwColor\"), 0xFFFFFFFF);\n    if (pField->crDisSelTxtShwColor != 0xFFFFFFFF)\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n\n  // MonthOutColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"MonthOutColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_MONTHCALENDAR:\n          pField->crMonthOutColor = GetSysColor(COLOR_WINDOW);\n          break;\n        default:\n             pField->crMonthOutColor = (COLORREF)myGetProfileInt(_T(\"MonthOutColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crMonthOutColor = (COLORREF)myGetProfileInt(_T(\"MonthOutColor\"), 0xFFFFFFFF);\n    }\n\n  // MonthTrailingTxtColor\n  //--------------------------------------------------------------\n    if((COLORREF)myGetProfileInt(_T(\"MonthTrailingTxtColor\"), 0xFFFFFFFF) == 0xFFFFFFFF)\n      switch(pField->nType) {\n        case FIELD_MONTHCALENDAR:\n          pField->crMonthTrailingTxtColor = GetSysColor(COLOR_GRAYTEXT);\n          break;\n        default:\n             pField->crMonthTrailingTxtColor = (COLORREF)myGetProfileInt(_T(\"MonthTrailingTxtColor\"), 0xFFFFFFFF);\n          break;\n      }\n    else\n    {\n      if (pField->nFlags & FLAG_CUSTOMDRAW_TEMP)\n        pField->nFlags &= ~FLAG_CUSTOMDRAW_TEMP;\n      pField->crMonthTrailingTxtColor = (COLORREF)myGetProfileInt(_T(\"MonthTrailingTxtColor\"), 0xFFFFFFFF);\n    }\n\n  // ToolTipText\n  //--------------------------------------------------------------\n    pField->pszToolTipText = myGetProfileStringDup(_T(\"ToolTipText\"));\n\n    // \"ToolTipText\" has to exist in order to have a ToolTip\n    if(pField->pszToolTipText) {\n\n    // ToolTipFlags\n    //--------------------------------------------------------------\n      pField->nToolTipFlags = LookupToken(ToolTipFlagTable, szResult);\n      myGetProfileString(_T(\"ToolTipFlags\"));\n      pField->nToolTipFlags |= LookupTokens(ToolTipFlagTable, szResult);\n\n      if(pField->nToolTipFlags & TTS_BALLOON) {\n      // ToolTipIcon\n      //--------------------------------------------------------------\n        myGetProfileString(_T(\"ToolTipIcon\"));\n        pField->nToolTipIcon = LookupToken(ToolTipIconTable, szResult);\n\n      // ToolTipTitle\n      //--------------------------------------------------------------\n        pField->pszToolTipTitle = myGetProfileStringDup(_T(\"ToolTipTitle\"));\n      }\n    // ToolTipTxtColor\n    //--------------------------------------------------------------\n      pField->crToolTipTxtColor = (COLORREF)myGetProfileInt(_T(\"ToolTipTxtColor\"), GetSysColor(COLOR_INFOTEXT));\n\n    // ToolTipBgColor\n    //--------------------------------------------------------------\n      pField->crToolTipBgColor = (COLORREF)myGetProfileInt(_T(\"ToolTipBgColor\"), GetSysColor(COLOR_INFOBK));\n\n    // ToolTipMaxWidth\n    //--------------------------------------------------------------\n      pField->nToolTipMaxWidth = myGetProfileInt(_T(\"ToolTipMaxWidth\"), 300);\n    }\n  }\n\n  return nNumFields;\n}\n\n\n\n\n\n\n\n\n\n\n\nbool WINAPI SaveSettings(void) {\n\n// Initialize Variables\n//================================================================\n  static TCHAR szField[25];\n  int nBufLen = g_nBufferSize;\n  TCHAR *pszBuffer = (TCHAR*)MALLOC(nBufLen*sizeof(TCHAR));\n  if (!pszBuffer) return false;\n\n  int nIdx;\n  int CurrField;\n\n// Save Settings For Each Field Existant\n//================================================================\n  for (nIdx = 0, CurrField = 1; nIdx < nNumFields; nIdx++, CurrField++) {\n\n  // Define pField\n  //--------------------------------------------------------------\n    IOExControlStorage *pField = pFields + nIdx;\n    HWND hwnd = pField->hwnd;\n\n  // Save Settings (By Control Type)\n  //--------------------------------------------------------------\n    switch (pField->nType) {\n\n    // Invalid\n    //--------\n      default:\n        continue;\n\n    // CheckBox, RadioButton\n    //----------------------\n      case FIELD_CHECKBOX:\n      case FIELD_RADIOBUTTON:\n      {\n        myltoa(pszBuffer, mySendMessage(hwnd, BM_GETCHECK, 0, 0));\n        break;\n      }\n\n    // ListBox\n    //--------\n      case FIELD_LISTBOX:\n      {\n        // Ok, this one requires a bit of work.\n        // First, we allocate a buffer long enough to hold every item.\n        // Then, we loop through every item and if it's selected we add it to our buffer.\n        // If there is already an item in the list, then we prepend a | character before the new item.\n        // We could simplify for single-select boxes, but using one piece of code saves some space.\n        int nLength = strlen(pField->pszListItems) + 10;\n        if (nLength > nBufLen) {\n          FREE(pszBuffer);\n          nBufLen = nLength;\n          pszBuffer = (TCHAR*)MALLOC(nBufLen*sizeof(TCHAR));\n          if (!pszBuffer) return false;\n        }\n        TCHAR *pszItem = (TCHAR*)MALLOC(nBufLen*sizeof(TCHAR));\n        if (!pszItem) return false;\n\n        *pszBuffer = _T('\\0');\n        INT_PTR nNumItems = mySendMessage(hwnd, LB_GETCOUNT, 0, 0);\n        for (int nIdx2 = 0; nIdx2 < nNumItems; nIdx2++) {\n          if (mySendMessage(hwnd, LB_GETSEL, nIdx2, 0) > 0) {\n            if (*pszBuffer) lstrcat(pszBuffer, _T(\"|\"));\n            mySendMessage(hwnd, LB_GETTEXT, (WPARAM)nIdx2, (LPARAM)pszItem);\n            lstrcat(pszBuffer, pszItem);\n          }\n        }\n\n        FREE(pszItem);\n        break;\n      }\n\n    // Text, ComboBox\n    //---------------\n      case FIELD_TEXT:\n      case FIELD_COMBOBOX:\n      {\n        //we should only add the final '\\\"' after IOtoa is called.\n        GetWindowText(hwnd, pszBuffer, nBufLen);\n\n        //Re-allocate, truncate, and add '\\\"' to the string.\n        TCHAR* pszBuf2 = (TCHAR*)MALLOC((nBufLen+2)*sizeof(TCHAR));\n\n        *pszBuf2='\\\"';\n\n        if (pField->nType == FIELD_TEXT && (pField->nFlags & FLAG_MULTILINE))\n          strncpy(pszBuf2+1, IOtoa(pszBuffer), nBufLen);\n        else\n          strcpy(pszBuf2+1, pszBuffer);\n\n        FREE(pszBuffer);\n\n        int nLength = strlen(pszBuf2);\n        pszBuf2[nLength]=_T('\"');\n        pszBuf2[nLength+1]=_T('\\0');\n\n        pszBuffer=pszBuf2;\n        break;\n      }\n\n    // RichText\n    //---------\n      case FIELD_RICHTEXT:\n      {\n        // Only if not read only\n        if ( (pField->nFlags & FLAG_READONLY) == 0)\n        {\n            strcpy(pszBuffer, pField->pszState);\n\n            // Step 1: Open the user file\n            EDITSTREAM editStream;\n            TCHAR *pszData = (TCHAR*)MALLOC(g_nBufferSize);\n            if (!pszData)\n            {\n              //TODO: Add error handling\n              break;\n            }\n\n            dwRead=0;\n\n            editStream.pfnCallback = FIELD_RICHTEXT_StreamOut;\n            editStream.dwCookie = (DWORD)pszData;\n            mySendMessage(hwnd,EM_STREAMOUT,(WPARAM)pField->nDataType,(LPARAM)&editStream);\n\n            FILE * hFile;\n            if ( _tfopen_s(&hFile, pField->pszState, _T(\"wb\")) != 0)\n            {\n              //TODO: Add error handling\n              FREE(pszData);\n              break;\n            }\n\n            UINT nDataLen = (UINT)strlen(pszData);\n            fwrite(pszData,1,nDataLen,hFile);\n            fclose(hFile);\n            FREE(pszData);\n        }\n        break;\n      }\n\n    // TreeView\n    //---------\n      case FIELD_TREEVIEW:\n      {\n        LPTSTR pszBuf2 = (LPTSTR)MALLOC(260*2+1);\n        LPTSTR pszBuf3 = (LPTSTR)MALLOC(260*2+1);\n\n        if(pField->nFlags & FLAG_CHECKBOXES)\n        {\n          bool bFinishing = FALSE;\n          TVITEM tvItem;\n          HTREEITEM hItem = TreeView_GetRoot(hwnd);\n          while(hItem)\n          {\n            tvItem.mask = TVIF_PARAM;\n            tvItem.hItem = hItem;\n            TreeView_GetItem(hwnd, &tvItem);\n\n            if(!bFinishing)\n            {\n              myitoa(pszBuf2, tvItem.lParam);\n\n              if(TreeView_GetChild(hwnd, hItem))\n                lstrcat(pszBuf2, _T(\"{\"));\n              else if(TreeView_GetNextSibling(hwnd, hItem))\n                lstrcat(pszBuf2, _T(\"|\"));\n              else if(TreeView_GetParent(hwnd, hItem))\n                lstrcat(pszBuf2, _T(\"}\"));\n            }\n            else\n            {\n              if(TreeView_GetParent(hwnd, hItem))\n                strcpy(pszBuf2,_T(\"}\"));\n              else\n                strcpy(pszBuf2,_T(\"\"));\n            }\n\n            lstrcat(pszBuffer, pszBuf2);\n\n            if(TreeView_GetChild(hwnd, hItem) && bFinishing == FALSE)\n              hItem = TreeView_GetChild(hwnd, hItem);\n            else if(TreeView_GetNextSibling(hwnd, hItem) && bFinishing == FALSE)\n              hItem = TreeView_GetNextSibling(hwnd, hItem);\n            else if(TreeView_GetParent(hwnd, hItem))\n            {\n              bFinishing = FALSE;\n              hItem = TreeView_GetParent(hwnd, hItem);\n              if(TreeView_GetNextSibling(hwnd, hItem))\n                hItem = TreeView_GetNextSibling(hwnd, hItem);\n              else\n              {\n                bFinishing = TRUE;\n              }\n            }\n            else\n            {\n              bFinishing = FALSE;\n              break;\n            }\n          }\n        }\n        // No CHECKBOXES Flag\n        else\n        {\n          HTREEITEM hItem = TreeView_GetSelection(hwnd);\n          int i = 0;\n\n          TVITEM tvi;\n          tvi.mask = TVIF_TEXT;\n          tvi.pszText = pszBuf2;\n          tvi.cchTextMax = 260;\n\n          while(hItem)\n          {\n            ++i;\n            tvi.hItem = hItem;\n\n            TreeView_GetItem(hwnd, &tvi);\n\n            pszBuf2 = tvi.pszText;\n\n            pszBuf2 = IOLItoLI(pszBuf2, 260*2+1, pField->nType);\n            strcpy(pszBuf3, pszBuf2);\n\n            if(i!=1)\n            {\n              lstrcat(pszBuf3, _T(\"{\"));\n              lstrcat(pszBuf3, pszBuffer);\n              lstrcat(pszBuf3, _T(\"}\"));\n            }\n\n            strcpy(pszBuffer, pszBuf3);\n\n            hItem = TreeView_GetParent(hwnd, hItem);\n          }\n        }\n\n        // Return \"ListItems\"\n\n        if(pField->nFlags & FLAG_EDITLABELS)\n        {\n          strcpy(pszBuf3, _T(\"\"));\n          strcpy(pszBuf2, _T(\"\"));\n          strcpy(pField->pszListItems, _T(\"\"));\n          bool bFinishing = FALSE;\n          TVITEM tvItem;\n          HTREEITEM hItem = TreeView_GetRoot(hwnd);\n\n          while(hItem)\n          {\n            tvItem.mask = TVIF_TEXT;\n            tvItem.hItem = hItem;\n            tvItem.pszText = pszBuf2;\n            tvItem.cchTextMax = 260;\n            TreeView_GetItem(hwnd, &tvItem);\n\n            pszBuf3 = tvItem.pszText;\n\n            pszBuf2 = IOLItoLI(pszBuf2, 260*2+1, pField->nType);\n            strcpy(pszBuf3, pszBuf2);\n\n            if(!bFinishing)\n            {\n              if(TreeView_GetChild(hwnd, hItem))\n                lstrcat(pszBuf3, _T(\"{\"));\n              else if(TreeView_GetNextSibling(hwnd, hItem))\n                lstrcat(pszBuf3, _T(\"|\"));\n              else if(TreeView_GetParent(hwnd, hItem))\n                lstrcat(pszBuf3, _T(\"}\"));\n            }\n            else\n            {\n              if(TreeView_GetParent(hwnd, hItem))\n                strcpy(pszBuf3,_T(\"}\"));\n              else\n                strcpy(pszBuf3,_T(\"\"));\n            }\n\n            lstrcat(pField->pszListItems, pszBuf2);\n\n            if(TreeView_GetChild(hwnd, hItem) && bFinishing == FALSE)\n              hItem = TreeView_GetChild(hwnd, hItem);\n            else if(TreeView_GetNextSibling(hwnd, hItem) && bFinishing == FALSE)\n              hItem = TreeView_GetNextSibling(hwnd, hItem);\n            else if(TreeView_GetParent(hwnd, hItem))\n            {\n              bFinishing = FALSE;\n              hItem = TreeView_GetParent(hwnd, hItem);\n              if(TreeView_GetNextSibling(hwnd, hItem))\n                hItem = TreeView_GetNextSibling(hwnd, hItem);\n              else\n              {\n                bFinishing = TRUE;\n              }\n            }\n            else\n            {\n              bFinishing = FALSE;\n              break;\n            }\n          }\n\n          wsprintf(szField, _T(\"Field %d\"), CurrField);\n          WritePrivateProfileString(szField, _T(\"ListItems\"), pField->pszListItems, pszFilename);\n        }\n        FREE(pszBuf3);\n        FREE(pszBuf2);\n\n        break;\n      }\n\n    // ListView\n    //---------\n      case FIELD_LISTVIEW:\n      { \n        LPTSTR pszBuf2 = (LPTSTR)MALLOC(260*2+1);\n        LPTSTR pszBuf3 = (LPTSTR)MALLOC(260*2+1);\n\n        // Step 1: Detect number of subitems per item to retrieve.\n        int nColumns = FIELD_LISTVIEW_IOLI_CountSubItems(pField->pszListItems, pField->pszHeaderItems) + 1; // Plus an item column.\n\n        if(pField->nFlags & FLAG_CHECKBOXES)\n        {\n          int iItem = -1;\n          bool bFinishing = FALSE;\n\n          // Step 2: Create output data.\n          while(true)\n          {\n            iItem++;\n            // It's the same as:\n            // iItem = ListView_GetNextItem(hwnd, iItem, 0);\n\n            // Step 2.1: Return \"State\"\n            //-----------------------\n            int iState = (ListView_GetItemState(hwnd, iItem, LVIS_STATEIMAGEMASK)>>12);\n\n            myitoa(pszBuf2, TREEVIEW_UNCHECKED);\n\n            // No checkboxes (TREEVIEW_NOCHECKBOX)\n            //------------------------------------\n            if(iState == 0)\n              myitoa(pszBuf2, TREEVIEW_NOCHECKBOX);\n\n            // Read-only checkboxes (TREEVIEW_READONLY)\n            //-----------------------------------------\n            else if(iState == 6)\n              myitoa(pszBuf2, TREEVIEW_READONLY | TREEVIEW_CHECKED);\n            else if(iState == 5)\n              myitoa(pszBuf2, TREEVIEW_READONLY | TREEVIEW_UNCHECKED);\n            // Checked checkboxes (TREEVIEW_CHECKED)\n            //-----------------------------------------\n            else if(iState == 3)\n              myitoa(pszBuf2, TREEVIEW_CHECKED);\n            else if(iState == 2)\n              myitoa(pszBuf2, TREEVIEW_UNCHECKED);\n\n            if(ListView_GetNextItem(hwnd, iItem, 0)!=-1)\n              lstrcat(pszBuf2, _T(\"|\"));\n\n            lstrcat(pszBuffer, pszBuf2);\n\n            if(ListView_GetNextItem(hwnd, iItem, 0)==-1)\n              break;\n          }\n        }\n        else\n        {\n          int iSelectedItem = -1;\n          int i = 0;\n\n          while((iSelectedItem = ListView_GetNextItem(hwnd, iSelectedItem, LVNI_ALL | LVNI_SELECTED)) > -1)\n          {\n            int nSelected = ListView_GetItemState(hwnd, iSelectedItem, LVIS_SELECTED);\n            if (nSelected == LVIS_SELECTED)\n            {\n              ListView_GetItemText(hwnd, iSelectedItem, 0, pszBuf2, 260);\n              pszBuf2 = IOLItoLI(pszBuf2, 260*2+1, pField->nType);\n\n              if(i!=0)\n                lstrcat(pszBuffer, _T(\"|\"));\n              lstrcat(pszBuffer, pszBuf2);\n            }\n            i++;\n          }\n        }\n\n        // Return \"ListItems\"\n\n        if(pField->nFlags & FLAG_EDITLABELS)\n        {\n          strcpy(pszBuf2,_T(\"\"));\n          strcpy(pszBuf3,_T(\"\"));\n          strcpy(pField->pszListItems, _T(\"\"));\n\n          int iItem = -1;\n          while(true)\n          {\n            ++iItem;\n            ListView_GetItemText(hwnd, iItem, 0, pszBuf2, 260);\n\n            pszBuf2 = IOLItoLI(pszBuf2, 260*2+1, pField->nType);\n\n            lstrcat(pField->pszListItems, pszBuf2);\n\n            int iSubItem = 1;\n            int nStWritten = 0;\n            if(nColumns-1 > 0)\n            {\n              strcpy(pszBuf2, _T(\"\"));\n              strcpy(pszBuf3, _T(\"{\"));\n\n              while(true)\n              {\n                ListView_GetItemText(hwnd, iItem, iSubItem, pszBuf2, 260)\n                pszBuf2 = IOLItoLI(pszBuf2, 260*2+1, pField->nType);\n\n                if(lstrcmp(pszBuf2,_T(\"\"))==0)\n                {\n                  if(iSubItem > 1)\n                    lstrcat(pszBuf3, _T(\"|\"));\n                }\n                else\n                {\n                  nStWritten = 1;\n                  lstrcat(pField->pszListItems, pszBuf3);\n                  if(iSubItem > 1)\n                    lstrcat(pField->pszListItems, _T(\"|\"));\n                  lstrcat(pField->pszListItems, pszBuf2);\n                  strcpy(pszBuf3, _T(\"\"));\n                }\n\n                ++iSubItem;\n                if(iSubItem > nColumns)\n                {\n                  strcpy(pszBuf2, _T(\"\"));\n                  strcpy(pszBuf3, _T(\"\"));\n                  if(nStWritten)\n                    lstrcat(pField->pszListItems, _T(\"}\"));\n                  break;\n                }\n              }\n            }\n            if(ListView_GetNextItem(hwnd, iItem, 0)!=-1 && !nStWritten)\n              lstrcat(pField->pszListItems, _T(\"|\"));\n\n            if(ListView_GetNextItem(hwnd, iItem, 0)==-1)\n              break;\n          }\n          wsprintf(szField, _T(\"Field %d\"), CurrField);\n          WritePrivateProfileString(szField, _T(\"ListItems\"), pField->pszListItems, pszFilename);\n        }\n\n        FREE(pszBuf2);\n        FREE(pszBuf3);\n\n        break;\n      }\n\n    // ProgressBar\n    //------------\n      case FIELD_PROGRESSBAR:\n        {\n          int nProgressState = mySendMessage(hwnd, PBM_GETPOS, 0, 0);\n          myitoa(pszBuffer, nProgressState);\n          break;\n        }\n\n    // TrackBar\n    //---------\n      case FIELD_TRACKBAR:\n        {\n          int nTrackState = mySendMessage(hwnd, TBM_GETPOS, 0, 0);\n          myitoa(pszBuffer, nTrackState);\n          break;\n        }\n\n    // IPAddress\n    //----------\n      case FIELD_IPADDRESS:\n        {\n          DWORD nIPAddressState;\n\n          mySendMessage(hwnd, IPM_GETADDRESS, 0, (LPARAM) &nIPAddressState);\n          BYTE nField0 = (BYTE) FIRST_IPADDRESS(nIPAddressState);\n          BYTE nField1 = (BYTE) SECOND_IPADDRESS(nIPAddressState);\n          BYTE nField2 = (BYTE) THIRD_IPADDRESS(nIPAddressState);\n          BYTE nField3 = (BYTE) FOURTH_IPADDRESS(nIPAddressState);\n\n          wsprintf(pszBuffer, _T(\"%d.%d.%d.%d\"), nField0, nField1, nField2, nField3);\n          break;\n        }\n\n    // DateTime\n    //---------\n      case FIELD_DATETIME:\n        {\n          SYSTEMTIME lpSysTime;\n\n          mySendMessage(hwnd, DTM_GETSYSTEMTIME, 0, (LPARAM) &lpSysTime);\n          const SYSTEMTIME lpSysTime2 = lpSysTime;\n\n          TCHAR* pszDate = (TCHAR*)MALLOC((10+1)*sizeof(TCHAR));\n          TCHAR* pszDayOfWeek = (TCHAR*)MALLOC((3+1)*sizeof(TCHAR));\n          TCHAR* pszTime = (TCHAR*)MALLOC((8+1)*sizeof(TCHAR));\n\n          GetDateFormat(MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), NULL, &lpSysTime2, _T(\"dd/MM/yyyy\"), pszDate, 11);\n          GetDateFormat(MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), NULL, &lpSysTime2, _T(\"ddd\"), pszDayOfWeek, 4);\n          GetTimeFormat(MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), NULL, &lpSysTime2, _T(\"HH:mm:ss\"), pszTime, 9);\n\n          int nDayOfWeek = 6;\n\n          if(pszDayOfWeek == _T(\"Sun\"))\n            nDayOfWeek = 0;\n          else if(pszDayOfWeek == _T(\"Mon\"))\n            nDayOfWeek = 1;\n          else if(pszDayOfWeek == _T(\"Tue\"))\n            nDayOfWeek = 2;\n          else if(pszDayOfWeek == _T(\"Wed\"))\n            nDayOfWeek = 3;\n          else if(pszDayOfWeek == _T(\"Thu\"))\n            nDayOfWeek = 4;\n          else if(pszDayOfWeek == _T(\"Fri\"))\n            nDayOfWeek = 5;\n          else if(pszDayOfWeek == _T(\"Sat\"))\n            nDayOfWeek = 6;\n\n          wsprintf(pszBuffer, _T(\"%hs %hs %d\"), pszDate, pszTime, nDayOfWeek);\n\n          FREE(pszDate);\n          FREE(pszDayOfWeek);\n          FREE(pszTime);\n          break;\n        }\n\n    // MonthCalendar\n    //--------------\n      case FIELD_MONTHCALENDAR:\n        {\n          SYSTEMTIME lpSysTime;\n          mySendMessage(hwnd, MCM_GETCURSEL, 0, (LPARAM) &lpSysTime);\n          const SYSTEMTIME lpSysTime2 = lpSysTime;\n          GetDateFormat(LOCALE_USER_DEFAULT, NULL,&lpSysTime2, _T(\"dd/MM/yyyy\"), pszBuffer, 11);\n          break;\n        }\n\n    // UpDown\n    //-------\n      case FIELD_UPDOWN:\n        {\n          if(!pField->nRefFields)\n          {\n            int nUpDownState = mySendMessage(hwnd, UDM_GETPOS32, 0, 0);\n            wsprintf(pszBuffer, _T(\"%d\"), nUpDownState);\n          }\n          else\n            continue;\n          break;\n        }\n\n    // Link, Button\n    //-------------\n      case FIELD_LINK:\n      case FIELD_BUTTON:\n        {\n          // Copy the State of the refFields in the its State\n          if (lstrcmp(pField->pszState,_T(\"\"))==0 && pField->nRefFields != 0)\n          {\n            GetWindowText(GetDlgItem(hConfigWindow,1200+pField->nRefFields-1), pszBuffer, g_nBufferSize);\n          }\n          else if(lstrcmp(pField->pszState,_T(\"\"))!=0 && (pField->nFlags & FLAG_OPEN_FILEREQUEST || pField->nFlags & FLAG_SAVE_FILEREQUEST || pField->nFlags & FLAG_DIRREQUEST))\n          {\n            lstrcpyn(pszBuffer, (LPTSTR)pField->pszState, g_nBufferSize);\n          }\n          else if(lstrcmp(pField->pszState,_T(\"\"))!=0 && pField->nFlags & FLAG_FONTREQUEST)\n          {\n            lstrcpyn(pszBuffer, (LPTSTR)pField->pszState, g_nBufferSize);\n            pszBuffer = IOLItoLI(pszBuffer, lstrlen(pszBuffer)+1, pField->nType);\n          }\n          else if(pField->nFlags & FLAG_COLORREQUEST)\n          {\n            lstrcpyn(pszBuffer, (LPTSTR)pField->pszListItems, g_nBufferSize);\n            pszBuffer = IOLItoLI(pszBuffer, lstrlen(pszBuffer)+1, pField->nType);\n            wsprintf(szField, _T(\"Field %d\"), CurrField);\n            WritePrivateProfileString(szField, _T(\"ListItems\"), pszBuffer, pszFilename);\n\n            lstrcpyn(pszBuffer, (LPTSTR)pField->pszState, g_nBufferSize);\n          }\n          else\n            continue;\n          break;\n        }\n    }\n  // Write Back To INI File The Control State\n  //--------------------------------------------------------------\n    wsprintf(szField, _T(\"Field %d\"), CurrField);\n    WritePrivateProfileString(szField, _T(\"State\"), pszBuffer, pszFilename);\n  }\n\n// Write To INI File What Field and Notification Were Activated\n//================================================================\n  if(g_aNotifyQueue[0].iField > 0)\n  {\n    myitoa(pszBuffer, g_aNotifyQueue[0].iField);\n    WritePrivateProfileString(_T(\"Settings\"), _T(\"State\"), pszBuffer, pszFilename);\n  }\n  if(g_aNotifyQueue[0].iNotifyId != NOTIFY_NONE && g_aNotifyQueue[0].bNotifyType == NOTIFY_TYPE_CONTROL)\n    WritePrivateProfileString(_T(\"Settings\"), _T(\"Notify\"), LookupTokenName(ControlNotifyTable, g_aNotifyQueue[0].iNotifyId), pszFilename);\n\n  FREE(pszBuffer);\n  return true;\n}\n\n//Other Functions\nbool INLINE ValidateFields() {\n  int nIdx;\n  INT_PTR nLength;\n\n// \"MaxLen\" and \"MinLen\" Implementations (Only For Text)\n//================================================================\n  // In the unlikely event we can't allocate memory, go ahead and return true so we can get out of here.\n  // May cause problems for the install script, but no memory is problems for us.\n  for (nIdx = 0; nIdx < nNumFields; nIdx++) {\n    IOExControlStorage *pField = pFields + nIdx;\n\n  // Only check controls that are after FIELD_CHECKLEN\n  //--------------------------------------------------------------\n    // this if statement prevents a stupid bug where a min/max length is assigned to a label control\n    // where the user obviously has no way of changing what is displayed. (can you say, \"infinite loop\"?)\n    if (pField->nType >= FIELD_CHECKLEN) {\n      nLength = mySendMessage(pField->hwnd, WM_GETTEXTLENGTH, 0, 0);\n\n      if (((pField->nMaxLength > 0) && (nLength > pField->nMaxLength)) ||\n         ((pField->nMinLength > 0) && (nLength < pField->nMinLength))) {\n\n        // \"ValidateText\" Implementation\n        if (pField->pszValidateText) {\n          TCHAR szTitle[1024];\n          GetWindowText(hMainWindow, szTitle, _countof(szTitle));\n          MessageBox(hConfigWindow, pField->pszValidateText, szTitle, MB_OK|MB_ICONWARNING);\n        }\n        mySetFocus(pField->hwnd);\n        return false;\n      }\n    }\n  }\n  return true;\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/InstallerOptions.h",
    "content": "// NOTES:\n// - pFilenameStackEntry was removed. Not necessary.\n\n//================================================================\n// Header Implementation\n//================================================================\n\n// File Inclusions\n//================================================================\n#include <windows.h>\n#include <windowsx.h>\n#include <shlobj.h>\n#include <commdlg.h>\n#include <cderr.h>\n#include <shlwapi.h>\n#include <olectl.h>\n#include <stdio.h>\n#include <tchar.h>\n#include <shellapi.h>\n#include \"resource.h\"\n\n#include \"pluginapi.h\" // nsis plugin\n\n// Defines Based on File Inclusions\n//================================================================\n#ifndef IDC_HAND\n  #define IDC_HAND MAKEINTRESOURCE(32649)\n#endif\n\n#ifndef BS_TYPEMASK\n  #define BS_TYPEMASK 0x0000000FL\n#endif\n\n#ifndef USER_TIMER_MAXIMUM\n  #define USER_TIMER_MAXIMUM 0x7FFFFFFF\n#endif\n#ifndef USER_TIMER_MINIMUM\n  #define USER_TIMER_MINIMUM 0x0000000A\n#endif\n\n#ifndef COLOR_MENUHILIGHT\n  #define COLOR_MENUHILIGHT 29\n#endif\n\n// Compiler Options\n//================================================================\n\n// Force INLINE code\n//----------------------------------------------------------------\n// Use for functions only called from one place to possibly reduce some code\n// size.  Allows the source code to remain readable by leaving the function\n// intact.\n#ifdef _MSC_VER\n  #define INLINE __forceinline\n#else\n  #define INLINE inline\n#endif\n\n//================================================================\n// Classes Definitions\n//================================================================\n\n// NotifyQueue (Allows notification messages to have queue)\n//================================================================\nstruct NotifyQueue {\n  int iNotifyId;\n  bool bNotifyType; // 0 = page, 1 = control. Page notifications are hardcodedly handled by the plug-in.\n  int iField;\n};\n\n// TableEntry (Table used to convert strings to numbers)\n//================================================================\nstruct TableEntry {\n  TCHAR *pszName;\n  int   nValue;\n};\n\n// IOExWindowStorage (Storage structure for window information)\n//================================================================\n// all allocated buffers must be first in the struct\n// when adding more allocated buffers to IOExControlStorage, don't forget to change this define\n#define IOEX_WINDOW_BUFFERS 4\nstruct IOExWindowStorage {\n  LPTSTR pszTitle;\n  LPTSTR pszState;        //Window state.\n  LPTSTR pszNotify;       //Set which window notifications to use.\n  LPTSTR pszNotifyResult; //INI Files change: Notify->NotifyResult.\n                          //Idea: Maybe I should add another \"Notify\" key name so that it could\n                          //be used for selecting which page notification should be accepted, and\n                          //then use the NOTIFY_TIMEOUT (for example) so that the \"nTimeOut\" be activated.\n  int nRect;\n  int bRTL;\n  int iMUnit;\n  int nTimeOut;\n\n  int iDlgResource; //If used, then pszRect is used. Default is 105.\n\n  RECT RectUDU;\n  RECT RectPx;\n};\n\n// IOExControlStorage (Storage structure for control information)\n//================================================================\n// all allocated buffers must be first in the struct\n// when adding more allocated buffers to IOExControlStorage, don't forget to change this define\n#define FIELD_BUFFERS 15\nstruct IOExControlStorage {\n  TCHAR  *pszText;\n  TCHAR  *pszState;\n  TCHAR  *pszRoot;\n\n  TCHAR  *pszListItems;\n  TCHAR  *pszFilter;\n\n  TCHAR   *pszValidateText;\n\n  TCHAR  *pszFontName;\n\n  TCHAR  *pszToolTipText;\n  TCHAR  *pszToolTipTitle;\n\n  TCHAR *pszHeaderItems;\n  TCHAR *pszHeaderItemsWidth;\n  TCHAR *pszHeaderItemsAlign;\n\n  TCHAR *pszStateImageList;\n  TCHAR *pszSmallImageList;\n  TCHAR *pszLargeImageList;\n\n  int    nRefFields;\n\n  int    nMinLength;\n  int    nMaxLength;\n\n  int    nFontHeight;\n  int    nFontWidth;\n  bool   nFontBold;\n  bool   nFontItalic;\n  bool   nFontUnderline;\n  bool   nFontStrikeOut;\n\n  int    nListItemsHeight;\n\n  COLORREF crTxtColor;\n  COLORREF crBgColor;\n  COLORREF crSelTxtColor;\n  COLORREF crSelBgColor;\n\n  COLORREF crReadOnlyTxtColor;\n  COLORREF crReadOnlyBgColor;\n\n  COLORREF crDisTxtColor;\n  COLORREF crDisBgColor;\n  COLORREF crDisSelTxtColor;\n  COLORREF crDisSelBgColor;\n\n  COLORREF crTxtShwColor;\n  COLORREF crSelTxtShwColor;\n\n  COLORREF crDisTxtShwColor;\n  COLORREF crDisSelTxtShwColor;\n\n  COLORREF crMonthOutColor;\n  COLORREF crMonthTrailingTxtColor;\n\n  int  nType;\n  RECT RectUDU;\n  RECT RectPx;\n\n  int nFlags;\n  int nNotify;\n  int nNotifyCursor;\n  int nAlign;\n  int nVAlign;\n  int nTxtAlign;\n  int nTxtVAlign;\n\n  HWND hwnd;\n  UINT nControlID;\n\n  HWND      hwToolTip;\n  int       nToolTipFlags;\n  int       nToolTipIcon;\n  COLORREF  crToolTipTxtColor;\n  COLORREF  crToolTipBgColor;\n  int       nToolTipMaxWidth;\n\n  INT_PTR    nParentIdx;      // this is used to store original windowproc.\n  int        nDataType;       // used by FIELD_RICHTEXT and FIELD_IMAGE.\n  LPPICTURE  nImageInterface; // used by FIELD_IMAGE controls for gif, jpeg and wmf files.\n  HANDLE     hImage;          // this is used by image field to save the handle to the image.\n  HIMAGELIST hStateImageList; // handle to state image list.\n  //HIMAGELIST hSmallImageList;\n  //HIMAGELIST hLargeImageList;\n  HWND       hEditControl;    // handle to a temporary edit control for controls which use FLAG_EDITLABELS flag.\n\n  int    nField;\n\n  UINT nWindowID; //Connects with the the IOExWindowStorage structure.\n};\n\n//TODO: Remove 9 key names to disable, enable or change buttons text. Reason: This is\n//      located outside of the InstallOptionsEx window, so it shouldn't touch it.\n//      For compatibility purposes, a specific function should be created that does this.\n\n//TODO: Add Tooltip control feature custom positioning of the tooltip itself in the dialog.\n//TODO: Make Tooltip commands separate from the control individual and make them individual controls.\n\n//TODO: Add flags for Image control to determine image file types.\n\n//================================================================\n// Variables/Defines Definitions\n//================================================================\n\n// Plug-in\n//================================================================\n\n// General\n//----------------------------------------------------------------\nHINSTANCE m_hInstance = NULL;\n\nint initCalled; //If the page initialization was called before\n\n// Message Loop\n//----------------------------------------------------------------\n\n// Misc.\nMSG msg; //message previous than the current one\nint g_done; // specifies if the message loop should end\n\n// Notification Flags Queue\n#define NOTIFY_QUEUE_AMOUNT_MAX 2\n#define NOTIFY_TYPE_PAGE 0\n#define NOTIFY_TYPE_CONTROL 1\nint g_nNotifyQueueAmountMax;\nNotifyQueue *g_aNotifyQueue = NULL; // MaxItems = NOTIFY_QUEUE_AMOUNT_MAX\nNotifyQueue *g_aNotifyQueueTemp = NULL; // MaxItems = 1\n\n// Determine direction of page change\nbool g_is_cancel,g_is_back,g_is_timeout;\n\n// Config file\n//================================================================\nTCHAR *pszFilename = NULL; // File name\nTCHAR *szResult; // Key Name (Temporary)\nconst TCHAR *pszAppName; // Section Name (Temporary)\n\n// Dialog\n//================================================================\n\n// NSIS Window\n//----------------------------------------------------------------\n\n// Properties\n\n// / Window handles\nHWND hMainWindow      = NULL;\nHWND hConfigWindow    = NULL; //Dialog Window\n\n// / Main window button handles\nHWND hCancelButton    = NULL;\nHWND hNextButton      = NULL;\nHWND hBackButton      = NULL;\n\n// Settings\n\n// / Button texts\nTCHAR *pszCancelButtonText = NULL; // CancelButtonText\nTCHAR *pszNextButtonText   = NULL; // NextButtonText\nTCHAR *pszBackButtonText   = NULL; // BackButtonText\n\n// / Enable buttons?\nint bNextEnabled   = FALSE; // NextEnabled\nint bBackEnabled   = FALSE; // BackEnabled\nint bCancelEnabled = FALSE; // CancelEnabled\n\n// / Show buttons?\nint bNextShow      = FALSE; // NextShow\nint bBackShow      = FALSE; // BackShow\nint bCancelShow    = FALSE; // CancelShow\n\n// Temporary\n\n// Were buttons on previous page shown?\nint old_cancel_visible;\nint old_back_visible;\nint old_next_visible;\n\n// Were buttons on previous page enabled?\nint old_cancel_enabled;\nint old_back_enabled;\nint old_next_enabled;\n\n// Previous page callback\nstatic WNDPROC lpWndProcOld;\n\n// IOEx Window Related\n//----------------------------------------------------------------\n\n// Controls Storage\nIOExControlStorage *pFields = NULL;\n\n// Temporary Variables\n\n// / Control Field\nTCHAR *pszTitle = NULL; //temp variable - probably not needed w/ the new classes\n\n// / Timer\nint nTimeOutTemp;\nUINT_PTR g_timer_id = 14; // This can be any number except 0.\nDWORD g_timer_cur_time;\nbool g_timer_activated;\n\n// Variable Buffer Size\n// - Should be > MAX_PATH to prevent excessive growing.\n// - Includes last '\\0' character.\n// - Default supports most of controls needs.\n#define BUFFER_SIZE 8192 // 8KB\n\n// Default Rectangle Number\n#define DEFAULT_RECT 1018\n\n// Default Control Styles\n#define DEFAULT_STYLES (WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)\n#define RTL_EX_STYLES (WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR)\n\n// Page Settings\nint g_nBufferSize;  // BufferSize\nint bMUnit = 0;     // MUnit\nint bRTL = 0;       // RTL\nint nRectId = 0;    // RectId\nint nNumFields = 0; // NumFields (not sure if to continue compatibility)\nint nTimeOut;       // TimeOut\n\n// Control Settings\n\n// / Type Flags\n\n//================================================================\n// Field Types Definitions\n//================================================================\n// NB - the order of this list is important - see below\n\n#define FIELD_INVALID       (0)\n#define FIELD_HLINE         (1)\n#define FIELD_VLINE         (2)\n#define FIELD_LABEL         (3)\n#define FIELD_GROUPBOX      (4)\n#define FIELD_IMAGE         (5)\n#define FIELD_PROGRESSBAR   (6)\n#define FIELD_LINK          (7)\n#define FIELD_BUTTON        (8)\n#define FIELD_UPDOWN        (9)\n#define FIELD_CHECKBOX      (10)\n#define FIELD_RADIOBUTTON   (11)\n#define FIELD_TEXT          (12)\n#define FIELD_IPADDRESS     (13)\n#define FIELD_RICHTEXT      (14)\n#define FIELD_COMBOBOX      (15)\n#define FIELD_DATETIME      (16)\n#define FIELD_LISTBOX       (17)\n#define FIELD_LISTVIEW      (18)\n#define FIELD_TREEVIEW      (19)\n#define FIELD_TRACKBAR      (20)\n#define FIELD_MONTHCALENDAR (21)\n\n#define FIELD_SETFOCUS     FIELD_CHECKBOX // First field that qualifies for having the initial keyboard focus\n#define FIELD_CHECKLEN     FIELD_TEXT     // First field to have length of state value checked against MinLen/MaxLen\n\n// / / Control Types Table\n\n    static TableEntry TypeTable[] = {\n    { _T(\"Label\"),         FIELD_LABEL         },\n    { _T(\"GroupBox\"),      FIELD_GROUPBOX      },\n    { _T(\"Image\"),         FIELD_IMAGE         },\n    { _T(\"Icon\"),          FIELD_IMAGE         }, // For compatibility w/ IO\n    { _T(\"Bitmap\"),        FIELD_IMAGE         }, // For compatibility w/ IO\n    { _T(\"Animation\"),     FIELD_IMAGE         }, // For compatibility w/ IO\n    { _T(\"ProgressBar\"),   FIELD_PROGRESSBAR   },\n    { _T(\"Link\"),          FIELD_LINK          },\n    { _T(\"CheckBox\"),      FIELD_CHECKBOX      },\n    { _T(\"RadioButton\"),   FIELD_RADIOBUTTON   },\n    { _T(\"Button\"),        FIELD_BUTTON        },\n    { _T(\"UpDown\"),        FIELD_UPDOWN        },\n    { _T(\"Text\"),          FIELD_TEXT          },\n    { _T(\"Edit\"),          FIELD_TEXT          }, // Same as TEXT\n    { _T(\"Password\"),      FIELD_TEXT          },\n    { _T(\"IPAddress\"),     FIELD_IPADDRESS     },\n    { _T(\"RichText\"),      FIELD_RICHTEXT      },\n    { _T(\"RichEdit\"),      FIELD_RICHTEXT      }, // Same as RICHTEXT\n    { _T(\"DropList\"),      FIELD_COMBOBOX      },\n    { _T(\"ComboBox\"),      FIELD_COMBOBOX      },\n    { _T(\"DateTime\"),      FIELD_DATETIME      },\n    { _T(\"ListBox\"),       FIELD_LISTBOX       },\n    { _T(\"ListView\"),      FIELD_LISTVIEW      },\n    { _T(\"TreeView\"),      FIELD_TREEVIEW      },\n    { _T(\"TrackBar\"),      FIELD_TRACKBAR      },\n    { _T(\"MonthCalendar\"), FIELD_MONTHCALENDAR },\n    { _T(\"HLINE\"),         FIELD_HLINE         },\n    { _T(\"VLINE\"),         FIELD_VLINE         },\n    { NULL,                0                   }\n  };\n\n// / Flags\n\n// / / All controls\n#define FLAG_DISABLED          0x00000001\n#define FLAG_GROUP             0x00000002\n#define FLAG_NOTABSTOP         0x00000004\n#define FLAG_HSCROLL           0x00000008\n#define FLAG_VSCROLL           0x00000010\n#define FLAG_MULTISELECT       0x00000020\n#define FLAG_READONLY          0x00000040\n// / / Image controls\n#define FLAG_RESIZETOFIT       0x00000080\n#define FLAG_TRANSPARENT       0x00000100\n// / / ProgressBar controls\n#define FLAG_SMOOTH            0x00000080\n//      FLAG_VSCROLL           0x00000010\n// / / CheckBox/RadioButton controls\n//      FLAG_READONLY          0x00000040\n#define FLAG_3STATE            0x00000080 // CheckBox\n// / / Button controls\n#define FLAG_OPEN_FILEREQUEST  0x00000100\n#define FLAG_SAVE_FILEREQUEST  0x00000200\n#define FLAG_DIRREQUEST        0x00000400\n#define FLAG_COLORREQUEST      0x00000800\n#define FLAG_FONTREQUEST       0x00001000\n#define FLAG_FILE_MUST_EXIST   0x00002000\n#define FLAG_FILE_EXPLORER     0x00004000\n#define FLAG_FILE_HIDEREADONLY 0x00008000\n#define FLAG_WARN_IF_EXIST     0x00010000\n#define FLAG_PATH_MUST_EXIST   0x00020000\n#define FLAG_PROMPT_CREATE     0x00040000\n#define FLAG_BITMAP            0x00080000\n#define FLAG_ICON              0x00100000\n//      FLAG_MULTISELECT       0x00000020\n// / / UpDown controls\n//      FLAG_HSCROLL           0x00000008\n#define FLAG_WRAP              0x00000080\n// / / Text/Password/RichText controls\n#define FLAG_ONLYNUMBERS       0x00000080\n#define FLAG_MULTILINE         0x00000100\n#define FLAG_WANTRETURN        0x00000200\n#define FLAG_NOWORDWRAP        0x00000400\n#define FLAG_PASSWORD          0x00000800 // Text/RichText\n// / / DropList/ComboBox controls\n//      FLAG_VSCROLL           0x00000010\n#define FLAG_DROPLIST          0x00000080 // ComboBox\n// / / DateTime controls\n#define FLAG_UPDOWN            0x00000080\n// / / ListBox controls\n//      FLAG_MULTISELECT       0x00000020\n#define FLAG_EXTENDEDSELECT    0x00000080\n//      FLAG_VSCROLL           0x00000010\n// / / TreeView/ListView controls\n#define FLAG_CHECKBOXES        0x00000080\n#define FLAG_EDITLABELS        0x00000100\n#define FLAG_ICON_VIEW         0x00000200 // ListView\n#define FLAG_LIST_VIEW         0x00000400 // ListView\n#define FLAG_REPORT_VIEW       0x00000800 // ListView\n#define FLAG_SMALLICON_VIEW    0x00001000 // ListView\n// / / TrackBar controls\n#define FLAG_NO_TICKS          0x00000080\n//      FLAG_VSCROLL           0x00000010\n// / / MonthCalendar controls\n#define FLAG_NOTODAY           0x00000080\n#define FLAG_WEEKNUMBERS       0x00000100\n\n#define FLAG_FOCUS             0x10000000 // Controls that can receive focus\n#define FLAG_DRAW_TEMP         0x40000000 // Temporary flag for\n                                          // drawing process\n#define FLAG_CUSTOMDRAW_TEMP   0x80000000 // Temporary flag for\n                                          // custom drawing process\n\n// / - Control Flags Table\n    static TableEntry FlagTable[] = {\n    // All controls\n    { _T(\"DISABLED\"),          FLAG_DISABLED          },\n    { _T(\"GROUP\"),             FLAG_GROUP             },\n    { _T(\"NOTABSTOP\"),         FLAG_NOTABSTOP         },\n\n    // Image controls\n    { _T(\"RESIZETOFIT\"),       FLAG_RESIZETOFIT       },\n    { _T(\"TRANSPARENT\"),       FLAG_TRANSPARENT       },\n\n    // ProgressBar controls\n    { _T(\"SMOOTH\"),            FLAG_SMOOTH            },\n    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n\n    // CheckBox/RadioButton controls\n    { _T(\"READONLY\"),          FLAG_READONLY          },\n    { _T(\"3STATE\"),            FLAG_3STATE            }, // Except CheckBox\n\n    // Button controls\n    { _T(\"OPEN_FILEREQUEST\"),  FLAG_OPEN_FILEREQUEST  },\n    { _T(\"SAVE_FILEREQUEST\"),  FLAG_SAVE_FILEREQUEST  },\n    { _T(\"REQ_SAVE\"),          FLAG_SAVE_FILEREQUEST  },\n    { _T(\"DIRREQUEST\"),        FLAG_DIRREQUEST        },\n    { _T(\"COLORREQUEST\"),      FLAG_COLORREQUEST      },\n    { _T(\"FONTREQUEST\"),       FLAG_FONTREQUEST       },\n    { _T(\"FILE_MUST_EXIST\"),   FLAG_FILE_MUST_EXIST   },\n    { _T(\"FILE_EXPLORER\"),     FLAG_FILE_EXPLORER     },\n    { _T(\"FILE_HIDEREADONLY\"), FLAG_FILE_HIDEREADONLY },\n    { _T(\"WARN_IF_EXIST\"),     FLAG_WARN_IF_EXIST     },\n    { _T(\"PATH_MUST_EXIST\"),   FLAG_PATH_MUST_EXIST   },\n    { _T(\"PROMPT_CREATE\"),     FLAG_PROMPT_CREATE     },\n    { _T(\"BITMAP\"),            FLAG_BITMAP            },\n    { _T(\"ICON\"),              FLAG_ICON              },\n\n    // UpDown controls\n    { _T(\"HSCROLL\"),           FLAG_HSCROLL           },\n    { _T(\"WRAP\"),              FLAG_WRAP              },\n\n    // Text/Password/RichText controls\n    { _T(\"ONLY_NUMBERS\"),      FLAG_ONLYNUMBERS       },\n    { _T(\"MULTILINE\"),         FLAG_MULTILINE         },\n    { _T(\"WANTRETURN\"),        FLAG_WANTRETURN        },\n    { _T(\"NOWORDWRAP\"),        FLAG_NOWORDWRAP        },\n//    { _T(\"HSCROLL\"),           FLAG_HSCROLL           },\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n//    { _T(\"READONLY\"),          FLAG_READONLY          },\n    { _T(\"PASSWORD\"),          FLAG_PASSWORD          }, //Except Password\n\n    // DropList/ComboBox controls\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n    { _T(\"DROPLIST\"),          FLAG_DROPLIST          }, //Except DropList\n\n    // DateTime controls\n    { _T(\"UPDOWN\"),            FLAG_UPDOWN            },\n\n    // ListBox controls\n    { _T(\"MULTISELECT\"),       FLAG_MULTISELECT       },\n    { _T(\"EXTENDEDSELECT\"),    FLAG_EXTENDEDSELECT    },\n    { _T(\"EXTENDEDSELCT\"),     FLAG_EXTENDEDSELECT    },\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n\n    // ListView/TreeView controls\n    { _T(\"CHECKBOXES\"),        FLAG_CHECKBOXES        },\n    { _T(\"EDITLABELS\"),        FLAG_EDITLABELS        },\n//    { _T(\"MULTISELECT\"),       FLAG_MULTISELECT       },\n    { _T(\"LIST_VIEW\"),         FLAG_LIST_VIEW         },\n    { _T(\"ICON_VIEW\"),         FLAG_ICON_VIEW         },\n    { _T(\"SMALLICON_VIEW\"),    FLAG_SMALLICON_VIEW    },\n    { _T(\"REPORT_VIEW\"),       FLAG_REPORT_VIEW       },\n\n    // TrackBar controls\n    { _T(\"NO_TICKS\"),          FLAG_NO_TICKS          },\n//    { _T(\"VSCROLL\"),           FLAG_VSCROLL           },\n\n    // MonthCalendar controls\n    { _T(\"NOTODAY\"),           FLAG_NOTODAY           },\n    { _T(\"WEEKNUMBERS\"),       FLAG_WEEKNUMBERS       },\n\n      // Null\n    { NULL,                    0                      }\n  };\n\n// / Notification Flags\n\n#define NOTIFY_NONE                    0x00000000\n\n// / / Control Notification Flags\n\n// / / / Kill and set focus\n#define NOTIFY_CONTROL_ONSETFOCUS      0x00000001\n#define NOTIFY_CONTROL_ONKILLFOCUS     0x00000002\n// / / / Open or close drop lists\n#define NOTIFY_CONTROL_ONLISTOPEN      0x00000004\n#define NOTIFY_CONTROL_ONLISTCLOSE     0x00000008\n// / / / Change a control selection\n#define NOTIFY_CONTROL_ONSELCHANGE     0x00000010\n#define NOTIFY_CONTROL_ONTEXTCHANGE    0x00000020\n#define NOTIFY_CONTROL_ONTEXTUPDATE    0x00000040\n#define NOTIFY_CONTROL_ONTEXTSELCHANGE 0x00000080\n// / / / Mouse clicks\n#define NOTIFY_CONTROL_ONCLICK         0x00000100\n#define NOTIFY_CONTROL_ONDBLCLICK      0x00000200\n#define NOTIFY_CONTROL_ONRCLICK        0x00000400\n#define NOTIFY_CONTROL_ONRDBLCLICK     0x00000800\n// / / / Text being truncated\n#define NOTIFY_CONTROL_ONTEXTTRUNCATE  0x00001000\n// / / / Using text scrollbar\n#define NOTIFY_CONTROL_ONTEXTVSCROLL   0x00002000\n// / / / Image control of animation type start/end\n#define NOTIFY_CONTROL_ONSTART         0x00004000\n#define NOTIFY_CONTROL_ONSTOP          0x00008000\n\n// / / - Control Notification Flags Table\n  static TableEntry ControlNotifyTable[] = {\n    { _T(\"ONSETFOCUS\"),     NOTIFY_CONTROL_ONSETFOCUS     },\n    { _T(\"ONKILLFOCUS\"),    NOTIFY_CONTROL_ONKILLFOCUS    },\n    { _T(\"ONLISTOPEN\"),     NOTIFY_CONTROL_ONLISTOPEN     },\n    { _T(\"ONLISTCLOSE\"),    NOTIFY_CONTROL_ONLISTCLOSE    },\n    { _T(\"ONSELCHANGE\"),    NOTIFY_CONTROL_ONSELCHANGE    },\n    { _T(\"ONTEXTCHANGE\"),   NOTIFY_CONTROL_ONTEXTCHANGE   },\n    { _T(\"ONTEXTUPDATE\"),   NOTIFY_CONTROL_ONTEXTUPDATE   },\n    { _T(\"ONTEXTSELCHANGE\"),NOTIFY_CONTROL_ONTEXTSELCHANGE},\n    { _T(\"ONTEXTTRUNCATE\"), NOTIFY_CONTROL_ONTEXTTRUNCATE },\n    { _T(\"ONCLICK\"),        NOTIFY_CONTROL_ONCLICK        },\n    { _T(\"ONDBLCLICK\"),     NOTIFY_CONTROL_ONDBLCLICK     },\n    { _T(\"ONRCLICK\"),       NOTIFY_CONTROL_ONRCLICK       },\n    { _T(\"ONRDBLCLICK\"),    NOTIFY_CONTROL_ONRDBLCLICK    },\n    { _T(\"ONTEXTVSCROLL\"),  NOTIFY_CONTROL_ONTEXTVSCROLL  },\n    { _T(\"ONSTART\"),        NOTIFY_CONTROL_ONSTART        },\n    { _T(\"ONSTOP\"),         NOTIFY_CONTROL_ONSTOP         },\n    { NULL,                 0                             }\n  };\n\n// / / Page Notification Flags\n\n// / / / Page clicks\n#define NOTIFY_PAGE_ONNEXT          0x00000001\n#define NOTIFY_PAGE_ONBACK          0x00000002\n#define NOTIFY_PAGE_ONCANCEL        0x00000004\n// / / / Timeout feature\n#define NOTIFY_PAGE_ONTIMEOUT       0x00000008\n\n// / / - Page Notification Flags Table\n  static TableEntry PageNotifyTable[] = {\n    { _T(\"ONNEXT\"),         NOTIFY_PAGE_ONNEXT            },\n    { _T(\"ONBACK\"),         NOTIFY_PAGE_ONBACK            },\n    { _T(\"ONCANCEL\"),       NOTIFY_PAGE_ONCANCEL          },\n    { _T(\"ONTIMEOUT\"),      NOTIFY_PAGE_ONTIMEOUT         },\n    { NULL,                 0                             }\n  };\n\n// / Alignment Flags\n\n// / / Horizontal\n#define ALIGN_LEFT             0x00000001\n#define ALIGN_CENTER           0x00000002\n#define ALIGN_RIGHT            0x00000004\n\n// / / Vertical\n#define VALIGN_TOP             0x00000001\n#define VALIGN_CENTER          0x00000002\n#define VALIGN_BOTTOM          0x00000004\n\n// / Text Alignment Flags\n\n// / / Horizontal\n#define ALIGN_TEXT_LEFT        0x00000001\n#define ALIGN_TEXT_CENTER      0x00000002\n#define ALIGN_TEXT_RIGHT       0x00000004\n#define ALIGN_TEXT_JUSTIFY     0x00000008\n// / / Vertical\n#define VALIGN_TEXT_TOP        0x00000001\n#define VALIGN_TEXT_CENTER     0x00000002\n#define VALIGN_TEXT_BOTTOM     0x00000004\n#define VALIGN_TEXT_JUSTIFY    0x00000008\n\n// / Image Type Flags\n\n#define IMAGE_TYPE_BITMAP    0\n#define IMAGE_TYPE_ICON      1\n#define IMAGE_TYPE_CURSOR    2\n#define IMAGE_TYPE_ANIMATION 3\n#define IMAGE_TYPE_OLE       4\n#define IMAGE_TYPE_GDIPLUS   5\n\n//================================================================\n// Function Definitions\n//================================================================\n\n// Memory Functions (w/ Implementation)\n//================================================================\nvoid *WINAPI MALLOC(int len) { return (void*)GlobalAlloc(GPTR,len); }\nvoid WINAPI FREE(void *d) { if (d) GlobalFree((HGLOBAL)d); }\n\n// String Functions/Macros\n//================================================================\n\n// WARNING: lstrcpy(str, \"\") != ZeroMemory. lstrcpy assigns '\\0' to\n//          first character only. It also ignores extra '\\0'\n//          characters.\n\n#define strcpy(x,y) lstrcpy(x,y)\n#define strncpy(x,y,z) lstrcpyn(x,y,z)\n#define strlen(x) lstrlen(x)\n#define strdup(x) STRDUP(x)\n#define stricmp(x,y) lstrcmpi(x,y)\n//#define abs(x) ((x) < 0 ? -(x) : (x))\n\nTCHAR *WINAPI STRDUP(const TCHAR *c)\n{\n  TCHAR *t=(TCHAR*)MALLOC((strlen(c)+1)*sizeof(TCHAR));\n  return strcpy(t,c);\n}\n\n// Turn a pair of chars into a word\n// Turn four chars into a dword\n// NOTE: These codes are only when comparing WORD's and DWORD's.\n#ifdef __BIG_ENDIAN__ // Not very likely, but, still...\n  #define CHAR2_TO_WORD(a,b) (((WORD)(b))|((a)<<8))\n  #define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(c,d))|(CHAR2_TO_WORD(a,b)<<16))\n#else\n  #define CHAR2_TO_WORD(a,b) (((WORD)(a))|((b)<<8))\n  #define CHAR2_TO_DWORD(a,b) (((DWORD)(a))|((b)<<16))\n  #define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(a,b))|(CHAR2_TO_WORD(c,d)<<16))\n#endif\n\n// Integer Functions\n//================================================================\nvoid WINAPI myitoa(TCHAR *s, int d);\nvoid WINAPI mycrxtoa(TCHAR *s, int x);\nvoid WINAPI myltoa(TCHAR *s, long l);\n\n// Debug Functions\n//================================================================\nint WINAPI myMessageBox(TCHAR lpText);\nint WINAPI myMessageBoxI(int i);\n\n// Configuration File (.ini File) Functions\n//================================================================\n// TODO: Needs new header specially for configuration file reading\n//       for greater support to configuration files for other\n//       Operating Systems.\n\nDWORD WINAPI myGetProfileString(LPCTSTR lpKeyName);\nTCHAR * WINAPI myGetProfileStringDup(LPCTSTR lpKeyName);\nint WINAPI myGetProfileInt(LPCTSTR lpKeyName, INT nDefault);\nTCHAR * WINAPI myGetProfileListItemsDup(LPCTSTR lpKeyName, int nStrFlags);\nTCHAR * WINAPI myGetProfileFilterItemsDup(LPCTSTR lpKeyName);\n\nTCHAR* WINAPI IOtoa(TCHAR *str);\nTCHAR* WINAPI IOtoaFolder(TCHAR *str);\nvoid WINAPI ConvertNewLines(TCHAR *str);\n\n// Input Functions\n//================================================================\n// Convert a string to internal types\nvoid WINAPI ConvertVariables(TCHAR *str, int nMaxChars);\nvoid WINAPI LItoIOLI(LPTSTR str, int nMaxChars, int nStrFlags, int iControlType);\nvoid WINAPI LItoFI(LPTSTR str, int nMaxChars);\nTCHAR* WINAPI IOLItoLI(LPTSTR str, int nMaxChars, int iControlType);\nint WINAPI IOLI_NextItem(LPTSTR str, LPTSTR *strstart, LPTSTR *strend, int nStrFlags);\nvoid WINAPI IOLI_RestoreItemStructure(LPTSTR str, LPTSTR *strstart, LPTSTR *strend, int nFlags);\n\n// Convert a string to respective integer\nint WINAPI LookupToken(TableEntry*, TCHAR*);\nint WINAPI LookupTokens(TableEntry*, TCHAR*);\nTCHAR* WINAPI LookupTokenName(TableEntry*, int);\n\n// Find the index of a control\nint WINAPI FindControlIdx(UINT id);\n\n// Window Functions\n//================================================================\nLRESULT WINAPI mySendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\nvoid WINAPI mySetFocus(HWND hWnd);\nvoid WINAPI mySetWindowText(HWND hWnd, LPCTSTR pszText);\nvoid WINAPI myGetWindowText(HWND hWnd, LPTSTR pszText);\n\nbool ConvertDlgRect(HWND hWnd, RECT* pRect, int iFrom, int iTo);\n\n// Notification Queue Functions\n//================================================================\nint WINAPI AddNotifyQueueItem(NotifyQueue * nqItem);\nint WINAPI RemoveNotifyQueueItem();\n\n#define Notification(ID, code) \\\n  if ( (pField->nNotify & ID) == ID && codeNotify == code ) \\\n  { \\\n    g_aNotifyQueueTemp->iNotifyId = ID; \\\n    isNotified = true; \\\n    dontSimulateNext = false; \\\n  }\n\n// Other Functions\n//================================================================\nbool WINAPI FileExists(LPTSTR pszFile); // Alternative - needs testing to see performance.\n\n//================================================================\n// Function Implementations\n//================================================================\n\n#ifndef LEGACY_PLUGIN\n\n// Plugin callback function\n//================================================================\n  static UINT_PTR PluginCallback(enum NSPIM msg)\n  {\n     return 0;\n  }\n\n#endif\n\n// Integer Functions\n//================================================================\nvoid WINAPI myitoa(TCHAR *s, int d)\n{\n  wsprintf(s,_T(\"%d\"),d);\n}\n\nvoid WINAPI mycrxtoa(TCHAR *s, int x)\n{\n  wsprintf(s,_T(\"%#06x\"),x);\n}\n\nvoid WINAPI myltoa(TCHAR *s, long l)\n{\n  wsprintf(s,_T(\"%ld\"),l);\n}\n\n// Debug Functions\n//================================================================\nint WINAPI myMessageBox(LPCTSTR lpText)\n{\n  return MessageBox(0,lpText,0,MB_OK);\n}\n\nint WINAPI myMessageBoxI(int i)\n{\n  LPTSTR lpText = (LPTSTR)MALLOC(g_nBufferSize);\n  myitoa(lpText, i);\n  int nMsgBoxResult = MessageBox(0,lpText,0,MB_OK);\n  FREE(lpText);\n  return nMsgBoxResult;\n}\n\n// Configuration File (.ini) Functions\n//================================================================\nDWORD WINAPI myGetProfileString(LPCTSTR lpKeyName)\n{\n  *szResult = _T('\\0');\n  int nSize = GetPrivateProfileString(pszAppName, lpKeyName, _T(\"\"), szResult, g_nBufferSize, pszFilename);\n  if(nSize)\n    ConvertVariables(szResult, g_nBufferSize);\n  return nSize;\n}\n\nTCHAR * WINAPI myGetProfileStringDup(LPCTSTR lpKeyName)\n{\n  int nSize = myGetProfileString(lpKeyName);\n\n  if (nSize)\n    return strdup(szResult);  // uses STRDUP\n  else\n    return NULL;\n}\n\nint WINAPI myGetProfileInt(LPCTSTR lpKeyName, INT nDefault)\n{\n  LPTSTR str;\n  int num;\n\n  str = myGetProfileStringDup(lpKeyName);\n\n  if(str)\n  num = myatoi(str);\n  else\n    num = nDefault;\n\n  FREE(str);\n  return num;\n}\n\nTCHAR * WINAPI myGetProfileListItemsDup(LPCTSTR lpKeyName, int nStrFlags, int iControlType)\n{\n  int size;\n  LPTSTR str = (LPTSTR)MALLOC(g_nBufferSize*sizeof(TCHAR)); // + end list char\n\n  size = myGetProfileString(lpKeyName);\n\n  if(size)\n  {\n    LItoIOLI(szResult, g_nBufferSize, nStrFlags, iControlType);\n\n    size = lstrlen(szResult)+1;\n\n    lstrcpy(str, szResult);\n\n    str[size] = '\\1';\n    str[size+1] = '\\0';\n  }\n\n  return str;\n}\n\nTCHAR * WINAPI myGetProfileFilterItemsDup(LPCTSTR lpKeyName)\n{\n  int size;\n  LPTSTR str = (LPTSTR)MALLOC(g_nBufferSize); // + end list char\n\n  size = myGetProfileString(lpKeyName);\n\n  if(size)\n  {\n    size = lstrlen(szResult)+1;\n\n    lstrcpy(str, szResult);\n    LItoFI(str, g_nBufferSize);\n  }\n\n  return str;\n}\n\n\n/**\n * ConvertNewLines takes a string and turns escape sequences written\n * as separate chars e.g. \"\\\\t\" into the special char they represent\n * '\\t'.  The transformation is done in place.\n *\n * @param str [in/out] The string to convert.\n */\nvoid WINAPI ConvertNewLines(TCHAR *str) {\n  TCHAR *p1, *p2, *p3;\n  TCHAR tch0, tch1, nch;\n\n  if (!str)\n    return;\n\n  p1 = p2 = str;\n\n  while ((tch0 = *p1) != 0)\n  {\n    nch = 0;  // new translated char\n    if (tch0 == _T('\\\\'))\n    {\n      tch1 = *(p1+1);\n      \n      if      (tch1 == _T('t'))  nch = _T('\\t');\n      else if (tch1 == _T('n'))  nch = _T('\\n');\n      else if (tch1 == _T('r'))  nch = _T('\\r');\n      else if (tch1 == _T('\\\\')) nch = _T('\\\\');\n    }\n\n    // Was it a special char?\n    if (nch)\n    {\n      *p2++ = nch;\n      p1   += 2;\n    }\n    else\n    {\n      // For MBCS\n      p3 = CharNext(p1);\n      while (p1 < p3)\n        *p2++ = *p1++;\n    }\n  }\n\n  *p2 = 0;\n}\n\nTCHAR* WINAPI IOtoa(TCHAR *pszBuffer)\n{\n  if (!pszBuffer)\n    return pszBuffer;\n\n  TCHAR *pszBuf2 = (TCHAR*)MALLOC((strlen(pszBuffer)+1)*2*sizeof(TCHAR)); // double the size, consider the worst case, all chars are \\r\\n\n  TCHAR *p1, *p2;\n  for (p1 = pszBuffer, p2 = pszBuf2; *p1; p1 = CharNext(p1), p2 = CharNext(p2))\n  {\n    switch (*p1) {\n      case _T('\\t'):\n    *p2++ = _T('\\\\');\n    *p2   = _T('t');\n    break;\n      case _T('\\n'):\n        *p2++ = _T('\\\\');\n        *p2   = _T('n');\n        break;\n      case _T('\\r'):\n        *p2++ = _T('\\\\');\n        *p2   = _T('n');\n        break;\n      case _T('\\\\'):\n        *p2 = _T('\\\\');\n        // Jim Park: used to be p2++ but that's a bug that works because\n        // CharNext()'s behavior at terminating null char.  But still\n        // definitely, unsafe.\n      default:\n        lstrcpyn(p2, p1, CharNext(p1) - p1 + 1);\n        break;\n    }\n  }\n  *p2 = 0;\n\n  return pszBuf2;\n}\n\nTCHAR* WINAPI IOtoaFolder(TCHAR *pszBuffer)\n{\n  if (!pszBuffer)\n    return pszBuffer;\n\n  TCHAR *pszBuf2 = (TCHAR*)MALLOC((strlen(pszBuffer)+1)*2*sizeof(TCHAR)); // double the size, consider the worst case, all chars are \\r\\n\n  TCHAR *p1, *p2;\n  for (p1 = pszBuffer, p2 = pszBuf2; *p1; p1 = CharNext(p1), p2 = CharNext(p2))\n  {\n    switch (*p1) {\n      case _T('\\t'):\n    *p2++ = _T('\\\\');\n    *p2   = _T('t');\n    break;\n      case _T('\\n'):\n        *p2++ = _T('\\\\');\n        *p2   = _T('n');\n        break;\n      case _T('\\r'):\n        *p2++ = _T('\\\\');\n        *p2   = _T('n');\n        break;\n      case _T('\\\\'):\n        *p2 = _T('\\\\');\n        // Jim Park: used to be p2++ but that's a bug that works because\n        // CharNext()'s behavior at terminating null char.  But still\n        // definitely, unsafe.\n      default:\n        lstrcpyn(p2, p1, CharNext(p1) - p1 + 1);\n        break;\n    }\n  }\n  *p2 = 0;\n\n  return pszBuf2;\n}\n\n\n// Input Functions\n//================================================================\nvoid WINAPI ConvertVariables(TCHAR *str, int nMaxChars) {\n\n  if (!str)\n    return;\n\n  TCHAR *p1, *p2, *p3, *p4, *p5;\n\n  p1 = p2 = str;\n  p4 = p5 = (TCHAR*)MALLOC(nMaxChars*sizeof(TCHAR));\n\n  while (*p1 && lstrlen(p2) <= nMaxChars)\n  {\n  if(*(LPBYTE)p1 == '$')\n  {\n    p1++;\n\n    if(*(LPBYTE)p1 == '$')\n    {\n      p1++;\n\n      *p2 = '$';\n      p2++;\n    }\n    else if(*(LPBYTE)p1 >= '0' && *(LPBYTE)p1 <= '9')\n    {\n      p1++;\n\n      if(!(p4 = getuservariable(myatoi(p1))))\n        p4 = _T(\"\");\n\n      while (*p4 && lstrlen(p2) <= nMaxChars)\n      {\n        p5 = CharNext(p4);\n        while (p4 < p5 && lstrlen(p2) <= nMaxChars)\n        {\n          *p2++ = *p4++;\n        }\n      }\n    }\n    else if(*(LPBYTE)p1 == 'R')\n    {\n      p1++;\n\n      if(*(LPBYTE)p1 >= '0' && *(LPBYTE)p1 <= '9')\n      {\n        p1++;\n\n        if(!(p4 = getuservariable(myatoi(p1)+ 10)))\n          p4 = _T(\"\");\n\n        while (*p4 && lstrlen(p2) <= nMaxChars)\n        {\n          p5 = CharNext(p4);\n          while (p4 < p5 && lstrlen(p2) <= nMaxChars)\n          {\n            *p2++ = *p4++;\n          }\n        }\n      }\n      else\n      {\n        p1 -= 2;\n\n        p3 = CharNext(p1);\n        while (p1 < p3 && lstrlen(p2) <= nMaxChars)\n          *p2++ = *p1++;\n      }\n    }\n    else\n    {\n      p1--;\n\n      p3 = CharNext(p1);\n      while (p1 < p3 && lstrlen(p2) <= nMaxChars)\n        *p2++ = *p1++;\n    }\n  }\n  else\n  {\n      p3 = CharNext(p1);\n      while (p1 < p3 && lstrlen(p2) <= nMaxChars)\n        *p2++ = *p1++;\n  }\n  }\n\n  *p2 = 0;\n\n  FREE(p4);\n}\n\n// This function converts a list items (not necessarily from the user)\n// and converts characters to be used internally. It converts:\n// '|' -> '\\x01'\n// '{' -> '\\x02'\n// '}' -> '\\x03'\n// '\\\\|' -> '|'\n// '\\\\{' -> '{'\n// '\\\\}' -> '}'\n\n// This is done because it becomes easier to manipulate the search\n// for strings into a list of items.\n\n// A list of items could be somewhat called an array, except that\n// it doesn't hold the exact location of the items, but gives\n// enough reference to where the item starts or ends.\n\nvoid WINAPI LItoIOLI(TCHAR *str, int nMaxChars, int nStrFlags, int iControlType)\n{\n  //nStrFlags\n  // 0 = Accept '|', '{' and '}' characters.\n  // 1 = Except '|'.\n  // 2 = Except '{' and '}'.\n\n  if (!str)\n    return;\n\n  TCHAR *p1, *p2, *p3;\n\n  p1 = p2 = str;\n\n  while (*p1 && lstrlen(p2) <= nMaxChars)\n  {\n    if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', '\\\\'))\n  {\n    *p2 = '\\\\';\n    p1 += 2;\n    p2++;\n  }\n    else if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', 'r') && (iControlType == FIELD_COMBOBOX || iControlType == FIELD_LISTBOX))\n  {\n    *p2 = '\\r';\n    p1 += 2;\n    p2++;\n  }\n    else if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', 'n') && (iControlType == FIELD_COMBOBOX || iControlType == FIELD_LISTBOX))\n  {\n    *p2 = '\\n';\n    p1 += 2;\n    p2++;\n  }\n    else if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', 't') && (iControlType == FIELD_COMBOBOX || iControlType == FIELD_LISTBOX))\n  {\n    *p2 = '\\t';\n    p1 += 2;\n    p2++;\n  }\n    else if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', '|'))\n  {\n    *p2 = '|';\n    p1 += 2;\n    p2++;\n  }\n  else if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', '{'))\n  {\n    *p2 = '{';\n    p1 += 2;\n    p2++;\n  }\n  else if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', '}'))\n  {\n    *p2 = '}';\n    p1 += 2;\n    p2++;\n  }\n    else if (*(LPBYTE)p1 == '|' && nStrFlags != 1)\n  {\n    *p2 = '\\x01';\n    p1++;\n    p2++;\n  }\n  else if (*(LPBYTE)p1 == '{' && nStrFlags != 2)\n  {\n    *p2 = '\\x02';\n    p1++;\n    p2++;\n  }\n  else if (*(LPBYTE)p1 == '}' && nStrFlags != 2)\n  {\n    *p2 = '\\x03';\n    p1++;\n    p2++;\n  }\n    else\n  {\n      p3 = CharNext(p1);\n      while (p1 < p3)\n        *p2++ = *p1++;\n    }\n  }\n\n  *p2 = 0;\n}\n\n// This function is specially used by the \"Filter\" value name\n// to convert a list items (not necessarily from the user) to\n// the supported syntax for the filter of directories. It converts:\n// '|' -> '\\0'\n// '\\\\|' -> '|'\n// the ending '\\0' -> '\\0\\0'\n\nvoid WINAPI LItoFI(TCHAR *str, int nMaxChars)\n{\n  if (!str)\n    return;\n\n  TCHAR *p1, *p2, *p3;\n\n  p1 = p2 = str;\n\n  while (*p1 && lstrlen(p2) <= nMaxChars)\n  {\n    if (*(LPWORD)p1 == CHAR2_TO_WORD('\\\\', '|'))\n  {\n    *p2 = '|';\n    p1 += 2;\n    p2++;\n  }\n  else if (*(LPBYTE)p1 == '\\0')\n  {\n    *p2 = '\\0';\n    p1++;\n  }\n  else if (*(LPBYTE)p1 == '|')\n  {\n    *p2 = '\\0';\n    p1++;\n    p2++;\n  }\n    else\n  {\n      p3 = CharNext(p1);\n      while (p1 < p3)\n        *p2++ = *p1++;\n    }\n  }\n\n  *p2 = 0;\n}\n\n// This function converts a list items used internally to one\n// to be returned to the user. It converts:\n// '|' -> '\\\\|'\n// '{' -> '\\\\{'\n// '}' -> '\\\\}'\n// '\\x01' -> '|'\n// '\\x02' -> '{'\n// '\\x03' -> '}'\n\n// This is done because the user needs to get the string back to\n// be reused again on the next call to the plug-in.\n\nTCHAR* WINAPI IOLItoLI(TCHAR *str, int nMaxChars, int iControlType)\n{\n  if (!str)\n    return str;\n\n  TCHAR *newstr = (TCHAR*)MALLOC(lstrlen(str)*2+1);\n  TCHAR *p1, *p2;\n\n  for (p1 = str, p2 = newstr; *p1; p1 = CharNext(p1), p2 = CharNext(p2))\n  {\n    if (*(LPBYTE)p1 == '\\\\')\n  {\n        *(LPWORD)p2 = CHAR2_TO_WORD('\\\\', '\\\\');\n        p2++;\n    }\n  else if (*(LPBYTE)p1 == '\\r' && (iControlType == FIELD_LISTBOX || iControlType == FIELD_COMBOBOX))\n  {\n        *(LPWORD)p2 = CHAR2_TO_WORD('\\\\', 'r');\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '\\n' && (iControlType == FIELD_LISTBOX || iControlType == FIELD_COMBOBOX))\n  {\n        *(LPWORD)p2 = CHAR2_TO_WORD('\\\\', 'n');\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '\\t' && (iControlType == FIELD_LISTBOX || iControlType == FIELD_COMBOBOX))\n  {\n        *(LPWORD)p2 = CHAR2_TO_WORD('\\\\', 't');\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '|')\n  {\n        *(LPWORD)p2 = CHAR2_TO_WORD('\\\\', '|');\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '{')\n  {\n        *(LPWORD)p2 = CHAR2_TO_WORD('\\\\', '{');\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '}')\n  {\n        *(LPWORD)p2 = CHAR2_TO_WORD('\\\\', '}');\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '\\x01')\n  {\n        *(LPBYTE)p2 = '|';\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '\\x02')\n  {\n        *(LPBYTE)p2 = '{';\n        p2++;\n  }\n  else if (*(LPBYTE)p1 == '\\x03')\n  {\n        *(LPBYTE)p2 = '}';\n        p2++;\n  }\n  else\n  {\n        strncpy(p2, p1, CharNext(p1) - p1 + 1);\n    }\n  }\n  *p2 = 0;\n  return newstr;\n}\n\nint WINAPI IOLI_NextItem(LPTSTR str, TCHAR **strstart, TCHAR **strend, int nStrFlags)\n{\n  int nFlags = 0;\n  // nFlags\n  // 0 = The string is in format \"ListItems\". It's not an item.\n  // 1 = It's a normal item.\n  // 2 = Item ending w/ '\\x02' - '{'.\n  // 3 = Item ending w/ '\\x03' - '}'.\n  // 4 = End of string, but there is string.\n  // 5 = End of string + item starting w/ '\\x03' - '}'.\n  // 6 = End of string.\n\n  // nStrFlags\n  // 0 = Accept '|', '{' and '}' characters.\n  // 1 = Accept only '|'.\n  // 2 = Accept only '{' and '}'.\n\n  if (!str)\n    return nFlags;\n\n  //strend = current item in the list\n\n  if(*(LPBYTE)*strend == '\\x03')\n  nFlags = 5;\n  else\n  nFlags = 4;\n\n  if(*(LPBYTE)*strend == '\\0')\n  nFlags = 6;\n\n  while (*(LPBYTE)*strend)\n  {\n  if(*(LPBYTE)*strend == '\\x01')\n  {\n      if(nStrFlags == 2)\n    *(LPBYTE)*strend = '|';\n      else\n    {\n      *(LPBYTE)*strend = '\\0';\n    return 1;\n    }\n  }\n\n  if(*(LPBYTE)*strend == '\\x02')\n  {\n      if(nStrFlags == 1)\n    *(LPBYTE)*strend = '{';\n    else\n    {\n      *(LPBYTE)*strend = '\\0';\n    return 2;\n    }\n  }\n\n  if(*(LPBYTE)*strend == '\\x03')\n  {\n      if(nStrFlags == 1)\n    *(LPBYTE)*strend = '}';\n    else\n    {\n      *(LPBYTE)*strend = '\\0';\n    return 3;\n    }\n  }\n\n    *strend = CharNext(*strend);\n  }\n\n  return nFlags;\n}\n\nvoid WINAPI IOLI_RestoreItemStructure(LPTSTR str, LPTSTR *strstart, LPTSTR *strend, int nFlags)\n{\n  // nFlags\n  // 0 = The string is in format \"ListItems\". It's not an item.\n  // 1 = It's a normal item.\n  // 2 = Item ending w/ '\\x02' - '{'.\n  // 3 = Item ending w/ '\\x03' - '}'.\n  // 4 = End of string.\n\n  switch(nFlags)\n  {\n    case 1:\n  {\n    **strend = '\\x01';\n    *strstart = ++*strend;\n    break;\n  }\n    case 2:\n  {\n    **strend = '\\x02';\n    *strstart = ++*strend;\n    break;\n  }\n    case 3:\n  {\n    **strend = '\\x03';\n    *strstart = ++*strend;\n    break;\n  }\n  }\n\n  return;\n}\n\nTCHAR* WINAPI LookupTokenName(TableEntry* psTable_, int nValue)\n{\n  for (int i = 0; psTable_[i].nValue; i++)\n    if (nValue == psTable_[i].nValue)\n      return psTable_[i].pszName;\n  return 0;\n}\n\n/**\n * Looks up a single token in the psTable_ and returns its mapped numerical value.\n *\n * @param psTable_ The lookup table.\n * @param pszToken_ The token to lookup.\n * @return The integer value related to the token, otherwise 0.\n */\nint WINAPI LookupToken(TableEntry* psTable_, TCHAR* pszToken_)\n{\n  for (int i = 0; psTable_[i].pszName; i++)\n    if (!lstrcmpi(pszToken_, psTable_[i].pszName))\n      return psTable_[i].nValue;\n  return 0;\n}\n\n/**\n * In a string of tokens separated by vertical bars '|', look them up in the\n * Lookup Table psTable and return their logical OR of their subsequent\n * integer values.\n * \n * @param psTable_ The lookup table to search in.\n * @param pszToken String of tokens separated by '|' whose values are to be\n * ORed together.\n * @return The ORed value of the token values.  If no tokens were found, it\n * will return 0.\n */\nint WINAPI LookupTokens(TableEntry* psTable_, TCHAR* pszTokens_)\n{\n  int n = 0;\n  TCHAR *pszStart = pszTokens_;\n  TCHAR *pszEnd = pszTokens_;\n  for (;;) {\n    TCHAR c = *pszEnd;\n    if (c == _T('|') || c == _T('\\0')) {\n      *pszEnd = _T('\\0');\n      n |= LookupToken(psTable_, pszStart);\n      *pszEnd = c;\n      if (!c)\n        break;\n      pszStart = ++pszEnd;\n    }\n    else\n      pszEnd = CharNext(pszEnd);\n  }\n  return n;\n}\n\nint WINAPI FindControlIdx(UINT id)\n{\n  for (int nIdx = 0; nIdx < nNumFields; nIdx++)\n    if (id == pFields[nIdx].nControlID)\n      return nIdx;\n  return -1;\n}\n\n// Window Functions\n//================================================================\nLRESULT WINAPI mySendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)\n{\n  return SendMessage(hWnd, Msg, wParam, lParam);\n}\n\nvoid WINAPI mySetFocus(HWND hWnd)\n{\n  mySendMessage(hMainWindow, WM_NEXTDLGCTL, (WPARAM)hWnd, TRUE);\n}\n\nvoid WINAPI mySetWindowText(HWND hWnd, LPCTSTR pszText)\n{\n  if (pszText)\n    SetWindowText(hWnd, pszText);\n}\n\nvoid WINAPI myGetWindowText(HWND hWnd, LPTSTR pszText)\n{\n  GetWindowText(hWnd, pszText, GetWindowTextLength(hWnd)+1);\n}\n\nbool ConvertDlgRect(HWND hWnd, RECT* pRect, int iFrom, int iTo)\n{\n  // iFrom and iTo:\n  // 0x0 = Pixels\n  // 0x1 = Dialog units\n\n  if(iFrom == 0x0 && iTo == 0x1)\n  {\n    RECT pTempRect = {0, 0, 4, 8};\n\n    if(!MapDialogRect(hWnd, &pTempRect))\n    return 0;\n    int baseUnitY = pTempRect.bottom;\n    int baseUnitX = pTempRect.right;\n\n    pRect->left = (pRect->left * baseUnitX) / 4;\n    pRect->right = (pRect->right * baseUnitX) / 4;\n\n    pRect->top = (pRect->top * baseUnitX) / 8;\n    pRect->bottom = (pRect->bottom * baseUnitX) / 8;\n  }\n  else if(iFrom == 0x1 && iTo == 0x0)\n  {\n    if(!MapDialogRect(hWnd, pRect))\n      return 0;\n  }\n\n  return 1;\n}\n\n//================================================================\n// Notify Queue Functions Definitions\n//================================================================\nint WINAPI AddNotifyQueueItem(NotifyQueue * nqItem)\n{\n  int id = NOTIFY_QUEUE_AMOUNT_MAX - 1;\n\n  while(id >= 0 && g_aNotifyQueue[id].iNotifyId == NOTIFY_NONE)\n  {\n    --id;\n  }\n\n  ++id;\n\n  if(id > NOTIFY_QUEUE_AMOUNT_MAX - 1)\n    return -1;\n\n  g_aNotifyQueue[id].iNotifyId = nqItem[0].iNotifyId;\n  g_aNotifyQueue[id].iField = nqItem[0].iField;\n  g_aNotifyQueue[id].bNotifyType = nqItem[0].bNotifyType;\n\n  nqItem[0].iNotifyId = NOTIFY_NONE;\n  nqItem[0].iField = 0;\n  nqItem[0].bNotifyType = NOTIFY_TYPE_PAGE;\n\n  return 0;\n}\n\nint WINAPI RemoveNotifyQueueItem()\n{\n  int id = 0;\n\n  while(++id && id < NOTIFY_QUEUE_AMOUNT_MAX)\n  {\n    g_aNotifyQueue[id-1].iNotifyId = g_aNotifyQueue[id].iNotifyId;\n    g_aNotifyQueue[id-1].iField = g_aNotifyQueue[id].iField;\n    g_aNotifyQueue[id-1].bNotifyType = g_aNotifyQueue[id].bNotifyType;\n\n    g_aNotifyQueue[id].iNotifyId = NOTIFY_NONE;\n    g_aNotifyQueue[id].iField = 0;\n    g_aNotifyQueue[id].bNotifyType = NOTIFY_TYPE_PAGE;\n  }\n  return 0;\n}\n\n// Other Functions\n//================================================================\n\n// Alternative for \"PathFileExists\" from shlwapi.h.\nbool WINAPI FileExists(LPTSTR pszFile)\n{\n  HANDLE h;\n  static WIN32_FIND_DATA fd;\n  // Avoid a \"There is no disk in the drive\" error box on empty removable drives\n  SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);\n  h = FindFirstFile(pszFile,&fd);\n  SetErrorMode(0);\n  if (h != INVALID_HANDLE_VALUE)\n    return TRUE;\n  return FALSE;\n}\n\n//================================================================\n// Post-Call Functions (see InstallOptions.cpp)\n//================================================================\n\n//Pre function part\nint WINAPI createCfgDlg();\n\n//Show function part\nvoid WINAPI showCfgDlg();\n\nBOOL CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);\nBOOL CALLBACK DialogWindowProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);\nint WINAPI ControlWindowProc(HWND hWin, UINT uMsg, WPARAM wParam, LPARAM lParam);\nLRESULT WINAPI NotifyProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify);\n\n//Reading and writing operations\nint WINAPI ReadSettings();\nbool WINAPI SaveSettings(void);\n\n//Other main functions\nbool INLINE ValidateFields();\n\n//================================================================\n// Include Control Implementations\n//================================================================\n\n#include \"Controls\\Label.h\"          // FIELD_LABEL\n#include \"Controls\\GroupBox.h\"       // FIELD_GROUPBOX\n#include \"Controls\\Image.h\"          // FIELD_IMAGE\n#include \"Controls\\ProgressBar.h\"    // FIELD_PROGRESSBAR\n#include \"Controls\\Link.h\"           // FIELD_LINK\n#include \"Controls\\Button.h\"         // FIELD_BUTTON\n#include \"Controls\\UpDown.h\"         // FIELD_UPDOWN\n#include \"Controls\\CheckBox.h\"       // FIELD_CHECKBOX\n#include \"Controls\\RadioButton.h\"    // FIELD_RADIOBUTTON\n#include \"Controls\\Text.h\"           // FIELD_TEXT\n#include \"Controls\\IPAddress.h\"      // FIELD_IPADDRESS\n#include \"Controls\\RichText.h\"       // FIELD_RICHTEXT\n#include \"Controls\\ComboBox.h\"       // FIELD_COMBOBOX\n#include \"Controls\\DateTime.h\"       // FIELD_DATETIME\n#include \"Controls\\ListBox.h\"        // FIELD_LISTBOX\n#include \"Controls\\ListView.h\"       // FIELD_LISTVIEW\n#include \"Controls\\TreeView.h\"       // FIELD_TREEVIEW\n#include \"Controls\\TrackBar.h\"       // FIELD_TRACKBAR\n#include \"Controls\\MonthCalendar.h\"  // FIELD_MONTHCALENDAR\n\n#pragma message(\" \")\n#pragma message(\"----------------------------------------------------\")\n#ifndef LEGACY_PLUGIN\n\t#pragma message(\" Info: Compilation using the new NSIS plugin API\")\n#else\n\t#pragma message(\" Info: Compilation using the legacy NSIS plugin API\")\n#endif\n#pragma message(\"----------------------------------------------------\")\n#pragma message(\" \")\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/api.h",
    "content": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2016 Nullsoft and Contributors\n * \n * Licensed under the zlib/libpng license (the \"License\");\n * you may not use this file except in compliance with the License.\n * \n * Licence details can be found in the file COPYING.\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n */\n\n#ifndef _NSIS_EXEHEAD_API_H_\n#define _NSIS_EXEHEAD_API_H_\n\n// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version\n// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))\n// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}\n\n#define NSISPIAPIVER_1_0 0x00010000\n#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0\n\n// NSIS Plug-In Callback Messages\nenum NSPIM \n{\n  NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup\n  NSPIM_GUIUNLOAD, // Called after .onGUIEnd\n};\n\n// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()\n// Return NULL for unknown messages\n// Should always be __cdecl for future expansion possibilities\ntypedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);\n\n// extra_parameters data structures containing other interesting stuff\n// but the stack, variables and HWND passed on to plug-ins.\ntypedef struct\n{\n  int autoclose;\n  int all_user_var;\n  int exec_error;\n  int abort;\n  int exec_reboot; // NSIS_SUPPORT_REBOOT\n  int reboot_called; // NSIS_SUPPORT_REBOOT\n  int XXX_cur_insttype; // Deprecated\n  int plugin_api_version; // see NSISPIAPIVER_CURR\n                          // used to be XXX_insttype_changed\n  int silent; // NSIS_CONFIG_SILENT_SUPPORT\n  int instdir_error;\n  int rtl;\n  int errlvl;\n  int alter_reg_view;\n  int status_update;\n} exec_flags_t;\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n#if !defined(_WIN32) && !defined(LPTSTR)\n#  define LPTSTR TCHAR*\n#endif\n\ntypedef struct {\n  exec_flags_t *exec_flags;\n  int (NSISCALL *ExecuteCodeSegment)(int, HWND);\n  void (NSISCALL *validate_filename)(LPTSTR);\n  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors\n} extra_parameters;\n\n// Definitions for page showing plug-ins\n// See Ui.c to understand better how they're used\n\n// sent to the outer window to tell it to go to the next inner window\n#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)\n\n// custom pages should send this message to let NSIS know they're ready\n#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)\n\n// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning\n#define NOTIFY_BYE_BYE 'x'\n\n#endif /* _PLUGIN_H_ */\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/io.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 10.00\n# Visual C++ Express 2008\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"io\", \"io.vcproj\", \"{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug Ansi OldAPI|Win32 = Debug Ansi OldAPI|Win32\n\t\tDebug Ansi|Win32 = Debug Ansi|Win32\n\t\tDebug Unicode|Win32 = Debug Unicode|Win32\n\t\tRelease Ansi OldAPI|Win32 = Release Ansi OldAPI|Win32\n\t\tRelease Ansi|Win32 = Release Ansi|Win32\n\t\tRelease Unicode|Win32 = Release Unicode|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi OldAPI|Win32.ActiveCfg = Debug Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi OldAPI|Win32.Build.0 = Debug Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi|Win32.ActiveCfg = Debug Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi|Win32.Build.0 = Debug Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi OldAPI|Win32.ActiveCfg = Release Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi OldAPI|Win32.Build.0 = Release Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi|Win32.ActiveCfg = Release Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi|Win32.Build.0 = Release Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Unicode|Win32.Build.0 = Release Unicode|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/io.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"9,00\"\n\tName=\"io\"\n\tProjectGUID=\"{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}\"\n\tRootNamespace=\"io\"\n\tKeyword=\"Win32Proj\"\n\tTargetFrameworkVersion=\"131072\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug Ansi OldAPI|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfATL=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tAdditionalOptions=\"/D &quot;LEGACY_PLUGIN&quot;\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;io_EXPORTS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"comctl32.lib&#x0D;&#x0A;ShLwApi.Lib\"\n\t\t\t\tOutputFile=\"../../Plugins/InstallOptionsEx_oldAPI.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tProgramDatabaseFile=\"$(OutDir)/io.pdb\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/io.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Ansi OldAPI|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tAdditionalOptions=\"/D &quot;LEGACY_PLUGIN&quot;\"\n\t\t\t\tOptimization=\"1\"\n\t\t\t\tFavorSizeOrSpeed=\"2\"\n\t\t\t\tWholeProgramOptimization=\"true\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;io_EXPORTS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"comctl32.lib&#x0D;&#x0A;ShLwApi.Lib\"\n\t\t\t\tOutputFile=\"../../Plugins/InstallOptionsEx_oldAPI.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"false\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/io.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Ansi|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"1\"\n\t\t\t\tFavorSizeOrSpeed=\"2\"\n\t\t\t\tWholeProgramOptimization=\"true\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;io_EXPORTS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"comctl32.lib&#x0D;&#x0A;ShLwApi.Lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-ansi/InstallOptionsEx.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"false\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/io.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug Ansi|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfATL=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;io_EXPORTS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"comctl32.lib&#x0D;&#x0A;ShLwApi.Lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-ansi/InstallOptionsEx.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tProgramDatabaseFile=\"$(OutDir)/io.pdb\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/io.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Unicode|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"1\"\n\t\t\t\tFavorSizeOrSpeed=\"2\"\n\t\t\t\tWholeProgramOptimization=\"true\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;io_EXPORTS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"comctl32.lib&#x0D;&#x0A;ShLwApi.Lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-unicode/InstallOptionsEx.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"false\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/io.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug Unicode|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfATL=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;io_EXPORTS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"comctl32.lib&#x0D;&#x0A;ShLwApi.Lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-unicode/InstallOptionsEx.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tProgramDatabaseFile=\"$(OutDir)/io.pdb\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/io.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\InstallerOptions.cpp\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\pluginapi.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\api.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\Button.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\CheckBox.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\ComboBox.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\DateTime.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\GroupBox.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\Image.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\InstallerOptions.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\IpAddress.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\Label.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\Link.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\ListBox.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\ListView.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\MonthCalendar.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\nsis_tchar.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\pluginapi.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\ProgressBar.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\RadioButton.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\resource.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\RichText.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\StatusBar.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\Text.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\ToolBar.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\TrackBar.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\TreeView.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\Controls\\UpDown.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\ioptdll.rc\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/ioptdll.rc",
    "content": "//Microsoft Developer Studio generated resource script.\n//\n#include \"resource.h\"\n\n#define APSTUDIO_READONLY_SYMBOLS\n/////////////////////////////////////////////////////////////////////////////\n//\n// Generated from the TEXTINCLUDE 2 resource.\n//\n#include <winresrc.h>\n\n/////////////////////////////////////////////////////////////////////////////\n#undef APSTUDIO_READONLY_SYMBOLS\n\n/////////////////////////////////////////////////////////////////////////////\n// English (U.S.) resources\n\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\n#ifdef _WIN32\nLANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\n#pragma code_page(1252)\n#endif //_WIN32\n\n/////////////////////////////////////////////////////////////////////////////\n//\n// Dialog\n//\n\nIDD_DIALOG1 DIALOG DISCARDABLE  0, 0, 57, 41\nSTYLE DS_CONTROL | WS_CHILD\nFONT 8, \"MS Sans Serif\"\nBEGIN\nEND\n\n\n/////////////////////////////////////////////////////////////////////////////\n//\n// DESIGNINFO\n//\n\n#ifdef APSTUDIO_INVOKED\nGUIDELINES DESIGNINFO DISCARDABLE \nBEGIN\n    IDD_DIALOG1, DIALOG\n    BEGIN\n        LEFTMARGIN, 7\n        RIGHTMARGIN, 50\n        TOPMARGIN, 7\n        BOTTOMMARGIN, 34\n    END\nEND\n#endif    // APSTUDIO_INVOKED\n\n\n#ifdef APSTUDIO_INVOKED\n/////////////////////////////////////////////////////////////////////////////\n//\n// TEXTINCLUDE\n//\n\n1 TEXTINCLUDE DISCARDABLE \nBEGIN\n    \"resource.h\\0\"\nEND\n\n2 TEXTINCLUDE DISCARDABLE \nBEGIN\n    \"#include \"\"afxres.h\"\"\\r\\n\"\n    \"\\0\"\nEND\n\n3 TEXTINCLUDE DISCARDABLE \nBEGIN\n    \"\\r\\n\"\n    \"\\0\"\nEND\n\n#endif    // APSTUDIO_INVOKED\n\n#endif    // English (U.S.) resources\n/////////////////////////////////////////////////////////////////////////////\n\n\n\n#ifndef APSTUDIO_INVOKED\n/////////////////////////////////////////////////////////////////////////////\n//\n// Generated from the TEXTINCLUDE 3 resource.\n//\n\n\n/////////////////////////////////////////////////////////////////////////////\n#endif    // not APSTUDIO_INVOKED\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/nsis_tchar.h",
    "content": "/*\n * nsis_tchar.h\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2013 Nullsoft and Contributors\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n *\n * For Unicode support by Jim Park -- 08/30/2007\n */\n\n// Jim Park: Only those we use are listed here.\n\n#pragma once\n\n#ifdef _UNICODE\n\n#ifndef _T\n#define __T(x)   L ## x\n#define _T(x)    __T(x)\n#define _TEXT(x) __T(x)\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\n#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)\ntypedef unsigned short TCHAR;\n#else\ntypedef wchar_t TCHAR;\n#endif\n#endif\n\n\n// program\n#define _tenviron   _wenviron\n#define __targv     __wargv\n\n// printfs\n#define _ftprintf   fwprintf\n#define _sntprintf  _snwprintf\n#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)\n#\tdefine _stprintf   swprintf\n#else\n#\tdefine _stprintf   _swprintf\n#endif\n#define _tprintf    wprintf\n#define _vftprintf  vfwprintf\n#define _vsntprintf _vsnwprintf\n#if defined(_MSC_VER) && (_MSC_VER<=1310)\n#\tdefine _vstprintf  vswprintf\n#else\n#\tdefine _vstprintf  _vswprintf\n#endif\n\n// scanfs\n#define _tscanf     wscanf\n#define _stscanf    swscanf\n\n// string manipulations\n#define _tcscat     wcscat\n#define _tcschr     wcschr\n#define _tcsclen    wcslen\n#define _tcscpy     wcscpy\n#define _tcsdup     _wcsdup\n#define _tcslen     wcslen\n#define _tcsnccpy   wcsncpy\n#define _tcsncpy    wcsncpy\n#define _tcsrchr    wcsrchr\n#define _tcsstr     wcsstr\n#define _tcstok     wcstok\n\n// string comparisons\n#define _tcscmp     wcscmp\n#define _tcsicmp    _wcsicmp\n#define _tcsncicmp  _wcsnicmp\n#define _tcsncmp    wcsncmp\n#define _tcsnicmp   _wcsnicmp\n\n// upper / lower\n#define _tcslwr     _wcslwr\n#define _tcsupr     _wcsupr\n#define _totlower   towlower\n#define _totupper   towupper\n\n// conversions to numbers\n#define _tcstoi64   _wcstoi64\n#define _tcstol     wcstol\n#define _tcstoul    wcstoul\n#define _tstof      _wtof\n#define _tstoi      _wtoi\n#define _tstoi64    _wtoi64\n#define _ttoi       _wtoi\n#define _ttoi64     _wtoi64\n#define _ttol       _wtol\n\n// conversion from numbers to strings\n#define _itot       _itow\n#define _ltot       _ltow\n#define _i64tot     _i64tow\n#define _ui64tot    _ui64tow\n\n// file manipulations\n#define _tfopen     _wfopen\n#define _topen      _wopen\n#define _tremove    _wremove\n#define _tunlink    _wunlink\n\n// reading and writing to i/o\n#define _fgettc     fgetwc\n#define _fgetts     fgetws\n#define _fputts     fputws\n#define _gettchar   getwchar\n\n// directory\n#define _tchdir     _wchdir\n\n// environment\n#define _tgetenv    _wgetenv\n#define _tsystem    _wsystem\n\n// time\n#define _tcsftime   wcsftime\n\n#else // ANSI\n\n#ifndef _T\n#define _T(x)    x\n#define _TEXT(x) x\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\ntypedef char TCHAR;\n#endif\n\n// program\n#define _tenviron   environ\n#define __targv     __argv\n\n// printfs\n#define _ftprintf   fprintf\n#define _sntprintf  _snprintf\n#define _stprintf   sprintf\n#define _tprintf    printf\n#define _vftprintf  vfprintf\n#define _vsntprintf _vsnprintf\n#define _vstprintf  vsprintf\n\n// scanfs\n#define _tscanf     scanf\n#define _stscanf    sscanf\n\n// string manipulations\n#define _tcscat     strcat\n#define _tcschr     strchr\n#define _tcsclen    strlen\n#define _tcscnlen   strnlen\n#define _tcscpy     strcpy\n#define _tcsdup     _strdup\n#define _tcslen     strlen\n#define _tcsnccpy   strncpy\n#define _tcsrchr    strrchr\n#define _tcsstr     strstr\n#define _tcstok     strtok\n\n// string comparisons\n#define _tcscmp     strcmp\n#define _tcsicmp    _stricmp\n#define _tcsncmp    strncmp\n#define _tcsncicmp  _strnicmp\n#define _tcsnicmp   _strnicmp\n\n// upper / lower\n#define _tcslwr     _strlwr\n#define _tcsupr     _strupr\n\n#define _totupper   toupper\n#define _totlower   tolower\n\n// conversions to numbers\n#define _tcstol     strtol\n#define _tcstoul    strtoul\n#define _tstof      atof\n#define _tstoi      atoi\n#define _tstoi64    _atoi64\n#define _tstoi64    _atoi64\n#define _ttoi       atoi\n#define _ttoi64     _atoi64\n#define _ttol       atol\n\n// conversion from numbers to strings\n#define _i64tot     _i64toa\n#define _itot       _itoa\n#define _ltot       _ltoa\n#define _ui64tot    _ui64toa\n\n// file manipulations\n#define _tfopen     fopen\n#define _topen      _open\n#define _tremove    remove\n#define _tunlink    _unlink\n\n// reading and writing to i/o\n#define _fgettc     fgetc\n#define _fgetts     fgets\n#define _fputts     fputs\n#define _gettchar   getchar\n\n// directory\n#define _tchdir     _chdir\n\n// environment\n#define _tgetenv    getenv\n#define _tsystem    system\n\n// time\n#define _tcsftime   strftime\n\n#endif\n\n// is functions (the same in Unicode / ANSI)\n#define _istgraph   isgraph\n#define _istascii   __isascii\n\n#define __TFILE__ _T(__FILE__)\n#define __TDATE__ _T(__DATE__)\n#define __TTIME__ _T(__TIME__)\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/pluginapi.c",
    "content": "#include <windows.h>\n\n#include \"pluginapi.h\"\n\n#ifdef _countof\n#define COUNTOF _countof\n#else\n#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))\n#endif\n\nunsigned int g_stringsize;\nstack_t **g_stacktop;\nTCHAR *g_variables;\n\n// utility functions (not required but often useful)\n\nint NSISCALL popstring(TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpy(str,th->text);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nint NSISCALL popstringn(TCHAR *str, int maxlen)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpyn(str,th->text,maxlen?maxlen:g_stringsize);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nvoid NSISCALL pushstring(const TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop) return;\n  th=(stack_t*)GlobalAlloc(GPTR,(sizeof(stack_t)+(g_stringsize)*sizeof(TCHAR)));\n  lstrcpyn(th->text,str,g_stringsize);\n  th->next=*g_stacktop;\n  *g_stacktop=th;\n}\n\nTCHAR* NSISCALL getuservariable(const int varnum)\n{\n  if (varnum < 0 || varnum >= __INST_LAST) return NULL;\n  return g_variables+varnum*g_stringsize;\n}\n\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var)\n{\n\tif (var != NULL && varnum >= 0 && varnum < __INST_LAST) \n\t\tlstrcpy(g_variables + varnum*g_stringsize, var);\n}\n\n#ifdef _UNICODE\nint NSISCALL PopStringA(char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   int rval = popstring(wideStr);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nint NSISCALL PopStringNA(char* ansiStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, realLen*sizeof(wchar_t));\n   int rval = popstringn(wideStr, realLen);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, realLen, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringA(const char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   pushstring(wideStr);\n   GlobalFree((HGLOBAL)wideStr);\n   return;\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   lstrcpyW(wideStr, getuservariable(varnum));\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   wchar_t* wideStr = getuservariable(varnum);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n}\n\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr)\n{\n   if (ansiStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      wchar_t* wideStr = g_variables + varnum * g_stringsize;\n      MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   }\n}\n\n#else\n// ANSI defs\nint NSISCALL PopStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   int rval = popstring(ansiStr);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nint NSISCALL PopStringNW(wchar_t* wideStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   char* ansiStr = (char*) GlobalAlloc(GPTR, realLen);\n   int rval = popstringn(ansiStr, realLen);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, realLen);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   pushstring(ansiStr);\n   GlobalFree((HGLOBAL)ansiStr);\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   char* ansiStr = getuservariable(varnum);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   lstrcpyA(ansiStr, getuservariable(varnum));\n}\n\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr)\n{\n   if (wideStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      char* ansiStr = g_variables + varnum * g_stringsize;\n      WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   }\n}\n#endif\n\n// playing with integers\n\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s)\n{\n  INT_PTR v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  return v;\n}\n\nunsigned int NSISCALL myatou(const TCHAR *s)\n{\n  unsigned int v=0;\n\n  for (;;)\n  {\n    unsigned int c=*s++;\n    if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n    else break;\n    v*=10;\n    v+=c;\n  }\n  return v;\n}\n\nint NSISCALL myatoi_or(const TCHAR *s)\n{\n  int v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  // Support for simple ORed expressions\n  if (*s == _T('|')) \n  {\n      v |= myatoi_or(s+1);\n  }\n\n  return v;\n}\n\nINT_PTR NSISCALL popintptr()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return nsishelper_str_to_ptr(buf);\n}\n\nint NSISCALL popint_or()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return myatoi_or(buf);\n}\n\nvoid NSISCALL pushintptr(INT_PTR value)\n{\n\tTCHAR buffer[30];\n\twsprintf(buffer, sizeof(void*) > 4 ? _T(\"%Id\") : _T(\"%d\"), value);\n\tpushstring(buffer);\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/pluginapi.h",
    "content": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n#include \"nsis_tchar.h\"\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\n#define EXDLL_INIT()           {  \\\n        g_stringsize=string_size; \\\n        g_stacktop=stacktop;      \\\n        g_variables=variables; }\n\ntypedef struct _stack_t {\n  struct _stack_t *next;\n  TCHAR text[1]; // this should be the length of string_size\n} stack_t;\n\nenum\n{\nINST_0,         // $0\nINST_1,         // $1\nINST_2,         // $2\nINST_3,         // $3\nINST_4,         // $4\nINST_5,         // $5\nINST_6,         // $6\nINST_7,         // $7\nINST_8,         // $8\nINST_9,         // $9\nINST_R0,        // $R0\nINST_R1,        // $R1\nINST_R2,        // $R2\nINST_R3,        // $R3\nINST_R4,        // $R4\nINST_R5,        // $R5\nINST_R6,        // $R6\nINST_R7,        // $R7\nINST_R8,        // $R8\nINST_R9,        // $R9\nINST_CMDLINE,   // $CMDLINE\nINST_INSTDIR,   // $INSTDIR\nINST_OUTDIR,    // $OUTDIR\nINST_EXEDIR,    // $EXEDIR\nINST_LANG,      // $LANGUAGE\n__INST_LAST\n};\n\nextern unsigned int g_stringsize;\nextern stack_t **g_stacktop;\nextern TCHAR *g_variables;\n\nvoid NSISCALL pushstring(const TCHAR *str);\nvoid NSISCALL pushintptr(INT_PTR value);\n#define pushint(v) pushintptr((INT_PTR)(v))\nint NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack\nint NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize\nINT_PTR NSISCALL popintptr();\n#define popint() ( (int) popintptr() )\nint NSISCALL popint_or(); // with support for or'ing (2|4|8)\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);\n#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer\nunsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only\nint NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)\nTCHAR* NSISCALL getuservariable(const int varnum);\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var);\n\n#ifdef _UNICODE\n#define PopStringW(x) popstring(x)\n#define PushStringW(x) pushstring(x)\n#define SetUserVariableW(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringA(char* ansiStr);\nvoid NSISCALL PushStringA(const char* ansiStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);\n\n#else\n// ANSI defs\n\n#define PopStringA(x) popstring(x)\n#define PushStringA(x) pushstring(x)\n#define SetUserVariableA(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringW(wchar_t* wideStr);\nvoid NSISCALL PushStringW(wchar_t* wideStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif//!___NSIS_PLUGIN__H___\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/InstallOptionsEx/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Developer Studio generated include file.\n// Used by ioptdll.rc\n//\n#define IDD_DIALOG1                     101\n\n// Next default values for new objects\n// \n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NEXT_RESOURCE_VALUE        102\n#define _APS_NEXT_COMMAND_VALUE         40001\n#define _APS_NEXT_CONTROL_VALUE         1000\n#define _APS_NEXT_SYMED_VALUE           101\n#endif\n#endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Afrikaans.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1078\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Friedel Wolff\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Installasie\n# ^UninstallCaption\n$(^Name) Verwydering\n# ^LicenseSubCaption\n: Lisensie-ooreenkoms\n# ^ComponentsSubCaption\n: Installasiekeuses\n# ^DirSubCaption\n: Installasiegids\n# ^InstallingSubCaption\n: Installeer tans\n# ^CompletedSubCaption\n: Voltooid\n# ^UnComponentsSubCaption\n: Verwyderingkeuses\n# ^UnDirSubCaption\n: Verwyderinggids\n# ^ConfirmSubCaption\n: Bevestiging\n# ^UninstallingSubCaption\n: Verwyder tans\n# ^UnCompletedSubCaption\n: Voltooid\n# ^BackBtn\n< V&orige\n# ^NextBtn\n&Volgende >\n# ^AgreeBtn\n&Regso\n# ^AcceptBtn\nEk &aanvaar die ooreenkoms\n# ^DontAcceptBtn\nEk aan vaar &nie die ooreenkoms nie\n# ^InstallBtn\n&Installeer\n# ^UninstallBtn\n&Verwyder\n# ^CancelBtn\nKanselleer\n# ^CloseBtn\n&Sluit af\n# ^BrowseBtn\n&Blaai...\n# ^ShowDetailsBtn\n&Wys detail\n# ^ClickNext\nKlik op Volgende om verder te gaan.\n# ^ClickInstall\nKlik op Installeer om die installasie te begin.\n# ^ClickUninstall\nKlik op Verwyder om die verwydering te begin.\n# ^Name\nNaam\n# ^Completed\nVoltooid\n# ^LicenseText\nLees die lisensieooreenkoms voordat u $(^NameDA) installeer. Klik op Regso as u die ooreenkoms aanvaar.\n# ^LicenseTextCB\nLees die lisensieooreenkoms voordat u $(^NameDA) installeer. Merk die blokkie hieronder as u die ooreenkoms aanvaar. $_CLICK\n# ^LicenseTextRB\nLees die lisensieooreenkoms voordat u $(^NameDA) installeer. Kies die eerste keuse hieronder as u die ooreenkoms aanvaar. $_CLICK\n# ^UnLicenseText\nLees die lisensieooreenkoms voordat u $(^NameDA) verwyder. Klik op Regso als u die ooreenkoms aanvaar.\n# ^UnLicenseTextCB\nLees die lisensieooreenkoms voordat u $(^NameDA) verwyder. Merk die blokkie hieronder as u die ooreenkoms aanvaar. $_CLICK\n# ^UnLicenseTextRB\nLees die lisensieooreenkoms voordat u $(^NameDA) verwyder. KIes die eerste keuse hieronder as u die ooreenkoms aanvaar. $_CLICK\n# ^Custom\nAangepast\n# ^ComponentsText\nKies die komponente wat u wil installeer en deselekteer dié wat u nie wil installeer nie. $_CLICK\n# ^ComponentsSubText1\nKies die installasietipe:\n# ^ComponentsSubText2_NoInstTypes\nKies die komponente wat geïnstalleer moet word:\n# ^ComponentsSubText2\nOf kies die komponente wat geïnstalleer moet word:\n# ^UnComponentsText\nKies die komponente wat u wil verwyder en deselekteer dié wat u nie wil verwyder nie. $_CLICK\n# ^UnComponentsSubText1\nKies die verwyderingstipe:\n# ^UnComponentsSubText2_NoInstTypes\nKies die komponente wat verwyder moet word:\n# ^UnComponentsSubText2\nOf kies die komponente wat verwyder moet word:\n# ^DirText\n$(^NameDA) sal in die volgende gids geïnstalleer word. Om elders te installeer, klik op Blaai en kies 'n ander een. $_CLICK\n# ^DirSubText\nInstallasiegids\n# ^DirBrowseText\nKies die gids om $(^NameDA) in te installeer:\n# ^UnDirText\n$(^NameDA) gaan uit die volgende gids verwyder word. Om van elders af te verwyder, klik op Blaai en kies 'n ander gids. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nKies die gids om $(^NameDA) uit te verwyder:\n# ^SpaceAvailable\n\"Beskikbare spasie: \"\n# ^SpaceRequired\n\"Vereiste spasie: \"\n# ^UninstallingText\n$(^NameDA) sal uit die volgende gids verwyder word. $_CLICK\n# ^UninstallingSubText\nVerwydering uit:\n# ^FileError\nFout met skryf na lêer: \\r\\n\\r\\n$0\\r\\n\\r\\nKlik Staak om de installasie te stop,\\r\\nProbeer weer om weer te probeer of\\r\\nIgnoreer om dié lêer oor te slaan.\n# ^FileError_NoIgnore\nFout met skryf na lêer: \\r\\n\\r\\n$0\\r\\n\\r\\nKlik Probeer weer om op nuut te probeer, of \\r\\nKanselleer om die installasie te stop.\n# ^CantWrite\n\"Kon nie skyf nie: \"\n# ^CopyFailed\nKopiëring het misluk\n# ^CopyTo\n\"Kopieer na \"\n# ^Registering\n\"Registreer tans: \"\n# ^Unregistering\n\"Deregistreer tans: \"\n# ^SymbolNotFound\n\"Kon nie simbool vind nie: \"\n# ^CouldNotLoad\n\"Kon nie laai nie: \"\n# ^CreateFolder\n\"Skep gids: \"\n# ^CreateShortcut\n\"Maak kortpad: \"\n# ^CreatedUninstaller\n\"Verwyderingsprogram gemaak: \"\n# ^Delete\n\"Verwyder lêer: \"\n# ^DeleteOnReboot\n\"Verwyder na herbegin van rekenaar: \"\n# ^ErrorCreatingShortcut\n\"Fout met maak van kortpad: \"\n# ^ErrorCreating\n\"Fout met skep: \"\n# ^ErrorDecompressing\nFout met uitpak van data! Korrupte installasielêer?\n# ^ErrorRegistering\nFout met registrasie van DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Voer uit: \"\n# ^Extract\n\"Pak uit: \"\n# ^ErrorWriting\n\"Uitpak: fout met skryf na lêer \"\n# ^InvalidOpcode\nInstallasieprogram korrup: ongeldige opcode\n# ^NoOLE\n\"Geen OLE vir: \"\n# ^OutputFolder\n\"Afvoergids: \"\n# ^RemoveFolder\n\"Verwyder gids: \"\n# ^RenameOnReboot\n\"Hernoem na herbegin van rekenaar: \"\n# ^Rename\n\"Hernoem: \"\n# ^Skipped\n\"Oorgeslaan: \"\n# ^CopyDetails\nKopieer detail na knipbord\n# ^LogInstall\nBoekstaaf die installasieproses\n# ^Byte\nG\n# ^Kilo\n K\n# ^Mega\n M\n#  ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Afrikaans.nsh",
    "content": "﻿;Language: Afrikaans (1078)\n;By Friedel Wolff\n\n!insertmacro LANGFILE \"Afrikaans\" = \"Afrikaans\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Welkom by die $(^NameDA) Installasieslimmerd\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Hierdie slimmerd lei mens deur die installasie van $(^NameDA).$\\r$\\n$\\r$\\nDit word aanbeveel dat u alle ander programme afsluit voor die begin van die installasie. Dit maak dit moontlik om die relevante stelsellêers op te dateer sonder om die rekenaar te herlaai.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Welkom by die $(^NameDA) Verwyderingslimmerd\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Hierdie slimmerd lei mens deur die verwydering van $(^NameDA).$\\r$\\n$\\r$\\nVoor die verwydering begin word, maak seker dat $(^NameDA) nie loop nie.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lisensie-ooreenkoms\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Lees die lisensie-ooreenkoms voordat u $(^NameDA) installeer.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Klik op Regso om verder te gaan as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te installeer.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Merk die blokkie hier onder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te installeer. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Kies die eerste keuse hieronder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te installeer. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lisensie-ooreenkoms\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Lees die lisensie-ooreenkoms voordat u $(^NameDA) verwyder.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Klik op Regso om verder te gaan as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te verwyder.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Merk die kiesblokkie hieronder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te verwyder.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Kies die eerste keuse hieronder as u die ooreenkoms aanvaar. U moet die ooreenkoms aanvaar om $(^NameDA) te verwyder.\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Druk op Page Down om die res van die ooreenkoms te sien.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Kies komponente\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Kies watter komponente van $(^NameDA) geïnstalleer moet word.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Kies komponente\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Kies watter komponente van $(^NameDA) verwyder moet word.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beskrywing\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Beweeg die muis oor 'n komponent om sy beskrywing te sien.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Kies 'n komponent om sy beskrywing te sien.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Kies installasieplek\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Kies die gids waarin u $(^NameDA) wil installeer.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Kies verwyderinggids\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Kies die gids waaruit u $(^NameDA) wil verwyder.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installeer tans\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Wag asb. terwyl $(^NameDA) geïnstalleer word.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installasie voltooid\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Die installasie is suksesvol voltooi.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installasie gestaak\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Die installasie is nie suksesvol voltooi nie.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Verwyder tans\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Wag asb. terwyl $(^NameDA) van u rekenaar verwyder word.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Verwydering voltooi\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Verwydering is suksesvol voltooi.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Verwydering gestaak\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Verwydering is nie suksesvol voltooi nie.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Voltooi van die $(^NameDA) Installasieslimmerd\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) is geïnstalleer op uw rekenaar.$\\r$\\n$\\r$\\nKlik op Voltooi om hierdie slimmerd af te sluit.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Die rekenaar moet oorbegin word om die installasie van $(^NameDA) te voltooi. Wil u nou oorbegin?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Voltooi van die $(^NameDA) Verwyderingslimmerd\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) is van u rekenaar verwyder.$\\r$\\n$\\r$\\nKlik op Voltooi om hierdie slimmerd af te sluit.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Die rekenaar moet oorbegin word om die verwydering van $(^NameDA) te voltooi. Wil u nou oorbegin?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Begin nou oor\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ek wil later self oorbegin\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Laat loop $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Wys Leesmy-lêer\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Voltooi\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Kies gids in Begin-kieslys\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Kies 'n gids in die Begin-kieslys vir $(^NameDA) se kortpaaie.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Kies die gids in die Begin-kieslys waarin die program se kortpaaie geskep moet word. U kan ook 'n nuwe naam gee om 'n nuwe gids te skep.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Moenie kortpaaie maak nie\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Verwyder $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Verwyder $(^NameDA) van u rekenaar.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Wil u definitief die installasie van $(^Name) afsluit?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Wil u definitief die verwydering van $(^Name) afsluit?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Albanian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1052\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Përkthimi nga Besnik Bleta, besnik@programeshqip.org\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nRregullimi i $(^Name)\n# ^UninstallCaption\nÇinstalimi i $(^Name)\n# ^LicenseSubCaption\n: Marrëveshje Licence\n# ^ComponentsSubCaption\n: Mundësi Instalimi\n# ^DirSubCaption\n: Dosje Instalimi\n# ^InstallingSubCaption\n: Po instalohet\n# ^CompletedSubCaption\n: U plotësua\n# ^UnComponentsSubCaption\n: Mundësi Çinstalimi\n# ^UnDirSubCaption\n: Dosje Çinstalimi\n# ^ConfirmSubCaption\n: Ripohim\n# ^UninstallingSubCaption\n: Po çinstalohet\n# ^UnCompletedSubCaption\n: U plotësua\n# ^BackBtn\n< &Mbrapsht\n# ^NextBtn\n&Pasuesi >\n# ^AgreeBtn\n&Pajtohem\n# ^AcceptBtn\n&I pranoj kushtet e Marrëveshjes së Licencës\n# ^DontAcceptBtn\n&Nuk i pranoj kushtet e Marrëveshjes së Licencës\n# ^InstallBtn\n&Instaloje\n# ^UninstallBtn\n&Çinstaloje\n# ^CancelBtn\nAnuloje\n# ^CloseBtn\n&Mbylle\n# ^BrowseBtn\nSh&fletoni…\n# ^ShowDetailsBtn\nShfaq &hollësi\n# ^ClickNext\nQë të vazhdohet, klikoni Pasuesi.\n# ^ClickInstall\nQë të fillojë instalimi, klikoni Instaloje.\n# ^ClickUninstall\nQë të fillojë çinstalimi, klikoni Çinstaloje.\n# ^Name\nEmër\n# ^Completed\nU plotësua\n# ^LicenseText\nJu lutemi, para instalimit të $(^NameDA), shqyrtoni marrëveshjen e licencës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni Pajtohem.\n# ^LicenseTextCB\nJu lutemi, para instalimit të $(^NameDA), shqyrtoni marrëveshjen e licencës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni kutizën më poshtë. $_CLICK\n# ^LicenseTextRB\nJu lutemi, para instalimit të $(^NameDA), shqyrtoni marrëveshjen e licencës. Nëse i pranoni tërë kushtet e marrëveshjes, përzgjidhni mundësinë e parë më poshtë. $_CLICK\n# ^UnLicenseText\nJu lutemi, para çinstalimit të $(^NameDA), shqyrtoni marrëveshjen e licencës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni Pajtohem.\n# ^UnLicenseTextCB\nJu lutemi, para çinstalimit të $(^NameDA), shqyrtoni marrëveshjen e licencës. Nëse i pranoni tërë kushtet e marrëveshjes, klikoni kutizën më poshtë. $_CLICK\n# ^UnLicenseTextRB\nJu lutemi, para çinstalimit të $(^NameDA), shqyrtoni marrëveshjen e licencës. Nëse i pranoni tërë kushtet e marrëveshjes, përzgjidhni mundësinë e parë më poshtë. $_CLICK\n# ^Custom\nVetjake\n# ^ComponentsText\nU vini shenjë përbërësve që doni të instalohen dhe hiquani shenjën  përbërësve që s’doni të instalohen. $_CLICK\n# ^ComponentsSubText1\nPërzgjidhni llojin e instalimit:\n# ^ComponentsSubText2_NoInstTypes\nPërzgjidhni përbërësit për instalim:\n# ^ComponentsSubText2\nOse, përzgjidhni përbërësit e mundshëm që doni të instalohen:\n# ^UnComponentsText\nU vini shenjë përbërësve që doni të çinstalohen dhe hiquni shenjën përbërësve që s’doni të çinstalohen. $_CLICK\n# ^UnComponentsSubText1\nPërzgjidhni llojin e çinstalimit:\n# ^UnComponentsSubText2_NoInstTypes\nPërzgjidhni përbërësit për çinstalim:\n# ^UnComponentsSubText2\nOse, përzgjidhni përbërësit e mundshëm që doni të çinstalohen:\n# ^DirText\nRregullimi do ta instalojë $(^NameDA) në dosjen vijuese. Për instalim në një dosje tjetër, klikoni Shfletoni dhe përzgjidhni një tjetër dosje. $_CLICK\n# ^DirSubText\nDosje Vendmbërritje\n# ^DirBrowseText\nPërzgjidhni dosjen ku të instalohet $(^NameDA):\n# ^UnDirText\nRregullimi do të çinstalojë $(^NameDA) prej dosjes vijuese. Për çinstalim prej një dosjeje tjetër, klikoni Shfletoni dhe përzgjidhni një tjetër dosje. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nPërzgjidhni dosjen prej nga ku të çinstalohet $(^NameDA):\n# ^SpaceAvailable\n\"Hapësirë e mundshme: \"\n# ^SpaceRequired\n\"Hapësirë e nevojshme: \"\n# ^UninstallingText\n$(^NameDA) do të çinstalohet prej dosjes vijuese. $_CLICK\n# ^UninstallingSubText\nPo çinstalohet prej:\n# ^FileError\nGabim në hapje kartele për shkrim: \\r\\n\\r\\n$0\\r\\n\\r\\nKlikoni Ndërprite për të ndalur instalimin,\\r\\nRiprovo për të provuar sërish, ose\\r\\nShpërfille për të anashkaluar këtë kartelë.\n# ^FileError_NoIgnore\nGabim në hapje kartele për shkrim: \\r\\n\\r\\n$0\\r\\n\\r\\nKlikoni Riprovo për të provuar sërish, ose\\r\\nAnuloje për të ndalur instalimin.\n# ^CantWrite\n\"S’shkruhet dot: \"\n# ^CopyFailed\nKopjimi dështoi\n# ^CopyTo\n\"Kopjoje tek \"\n# ^Registering\n\"Regjistrim: \"\n# ^Unregistering\n\"Çregjistrim: \"\n# ^SymbolNotFound\n\"S’u gjet dot simbol: \"\n# ^CouldNotLoad\n\"S’u ngarkua dot: \"\n# ^CreateFolder\n\"Krijo dosje: \"\n# ^CreateShortcut\n\"Krijo shkurtore: \"\n# ^CreatedUninstaller\n\"Krijo çinstalues: \"\n# ^Delete\n\"Fshi kartelë: \"\n# ^DeleteOnReboot\n\"Fshi gjatë rinisjes: \"\n# ^ErrorCreatingShortcut\n\"Gabim në krijim shkurtoresh: \"\n# ^ErrorCreating\n\"Gabim në krijimin e: \"\n# ^ErrorDecompressing\nGabim në çngjeshje të dhënash! Instalues i dëmtuar?\n# ^ErrorRegistering\nGabim në regjistrim DLL-je\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Ekzekuto: \"\n# ^Extract\n\"Përfto: \"\n# ^ErrorWriting\n\"Përftim: gabim në shkrim te kartela \"\n# ^InvalidOpcode\nInstalues i dëmtuar: opcode i pavlefshëm\n# ^NoOLE\n\"Pa OLE për: \"\n# ^OutputFolder\n\"Dosje përfundimesh: \"\n# ^RemoveFolder\n\"Hiq dosjen: \"\n# ^RenameOnReboot\n\"Riemërtoje gjatë rinisjes: \"\n# ^Rename\n\"Riemërtoje: \"\n# ^Skipped\n\"U anashkalua: \"\n# ^CopyDetails\nKopjo Hollësira Te E Papastra\n# ^LogInstall\nRegjistroje procesin e instalimit\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Albanian.nsh",
    "content": "﻿;Language: Albanian (1052)\n;Translation Besnik Bleta, besnik@programeshqip.org\n\n!insertmacro LANGFILE \"Albanian\" = \"Shqip\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Mirë se vini te Rregullimi i $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Ky do t’ju udhëheqë gjatë instalimit të $(^NameDA).$\\r$\\n$\\r$\\nKëshillohet që të mbyllni tërë aplikacionet e tjera, para se të nisni Rregullimin. Kjo bën të mundur përditësimin e kartelave të rëndësishme të sistemit pa u dashur të riniset kompjuteri juaj.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Mirë se vini te Çinstalimi i $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ky do t’ju udhëheqë gjatë çinstalimit të $(^NameDA).$\\r$\\n$\\r$\\nPara nisjes së çinstalimit, sigurohuni se $(^NameDA) s’është duke xhiruar.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Marrëveshje Licence\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Ju lutemi, para se të instaloni $(^NameDA), shqyrtoni kushtet e licencës.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Nëse i pranoni kushtet e marrëveshjes, klikoni Pajtohem, që të vazhdohet. Që të instalohet $(^NameDA), duhet të pranoni marrëveshjen.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Nëse pranoni kushtet e marrëveshjes, klikoni kutizën më poshtë. Që të instalohet $(^NameDA), duhet të pranoni marrëveshjen. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Nëse pranoni kushtet e marrëveshjes, përzgjidhni më poshtë mundësinë e parë. Që të instalohet $(^NameDA), duhet të pranoni marrëveshjen. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Marrëveshje Licence\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Ju lutemi, para çinstalimit të $(^NameDA), shqyrtoni kushtet e licencës.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Nëse i pranoni kushtet e marrëveshjes, klikoni Pajtohem, që të vazhdohet. Që të çinstalohet $(^NameDA), duhet të pranoni marrëveshjen.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Nëse pranoni kushtet e marrëveshjes, klikoni kutizën më poshtë. Që të çinstalohet $(^NameDA), duhet të pranoni marrëveshjen. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Nëse pranoni kushtet e marrëveshjes, përzgjidhni mundësinë e parë më poshtë. Që të çinstalohet $(^NameDA), duhet të pranoni marrëveshjen. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Për të parë pjesën e mbetur të marrëveshjes, shtypni tastin Page Down.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Përzgjidhni Përbërës\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Zgjidhni cilat anë të $(^NameDA) doni të instalohen.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Zgjidhni Përbërës\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Zgjidhni cilat anë të $(^NameDA) doni të çinstalohen.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Përshkrim\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Për të parë përshkrimin e një përbërësi, vendosni kursorin përsipër tij.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Zgjidhni Vend Instalimi\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Zgjidhni dosjen tek e cila të instalohet $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Zgjidhni Vend Çinstalimi\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Zgjidhni dosjen prej së cilës të çinstalohet $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Po instalohet\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Ju lutemi, prisni, ndërkohë që $(^NameDA) instalohet.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalim i Plotësuar\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Rregullimi u plotësua me sukses.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalimi u Ndërpre\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Rregullimi s’u plotësua me sukses.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Çinstalim\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Ju lutemi, prisni, ndërsa $(^NameDA) çinstalohet.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Çinstalim i Plotë\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Çinstalimi u plotësua me sukses.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Çinstalimi u Ndërpre\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Çinstalimi s’u plotësua me sukses.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Po plotësohet Rregullimi i $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) u instalua në kompjuterin tuaj.$\\r$\\n$\\r$\\nPër mbylljen e procesit, klikoni Përfundoje.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Që të mund të plotësohet instalimi i $(^NameDA), kompjuteri juaj duhet të riniset. Doni të riniset tani?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Po plotësohet Çinstalimi i $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) u çinstalua prej kompjuterit tuaj.$\\r$\\n$\\r$\\nPër mbylljen e procesit, klikoni Përfundoje.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Kompjuteri juaj duhet të riniset, që të mund të plotësohet çinstalimi i $(^NameDA). Doni të riniset tani?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Rinise tani\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Dua ta rinis dorazi më vonë\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Nis $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Shfaq Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Përfundoje\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Zgjidhni Dosje Menuje Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Zgjidhni një dosje Menuje Start për shkurtore $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Përzgjidhni dosjen e Menusë Start në të cilën do të donit të krijohen shkurtoret për programin. Mundeni edhe të jepni një emër për të krijuar një dosje të re.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Mos krijo shkurtore\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Çinstalo $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Hiqeni $(^NameDA) prej kompjuterit tuaj.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Jeni i sigurt se doni të dilet nga Rregullimi i $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Jeni i sigurt se doni të dilet nga Çinstalimi i $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Zgjidhni Përdorues\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Zgjidhni për cilët përdorues doni të instalohet $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Përzgjidhni nëse doni të instalohet $(^NameDA) vetëm për veten tuaj apo për tërë përdoruesit e këtij kompjuteri. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instaloje për këdo në këtë kompjuter\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instaloje vetëm për mua\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Arabic.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1025\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1256\n# RTL - anything else than RTL means LTR\nRTL\n# Translation by asdfuae@msn.com, updated by Rami Kattan\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nتنصيب $(^Name)\n# ^UninstallCaption\nإزالة $(^Name)\n# ^LicenseSubCaption\nإتفاقية‏ الترخيص :\n# ^ComponentsSubCaption\nخيارات التنصيب :\n# ^DirSubCaption\nمجلد التنصيب :\n# ^InstallingSubCaption\nتنصيب :\n# ^CompletedSubCaption\nإنتهى :\n# ^UnComponentsSubCaption\nخيارات الإزالة :\n# ^UnDirSubCaption\nمجلد الإزالة :\n# ^ConfirmSubCaption\nتأكيد :\n# ^UninstallingSubCaption\nإزالة :\n# ^UnCompletedSubCaption\nإنتهى :\n# ^BackBtn\n< ال&سابق\n# ^NextBtn\nال&تالي >\n# ^AgreeBtn\nموافق&\n# ^AcceptBtn\n&أوافق على شروط اتفاقية الترخيص\n# ^DontAcceptBtn\n&لا أوافق على شروط اتفاقية الترخيص\n# ^InstallBtn\n&تنصيب\n# ^UninstallBtn\n&إزالة\n# ^CancelBtn\nإلغاء\n# ^CloseBtn\nإ&غلاق\n# ^BrowseBtn\n&عرض...\n# ^ShowDetailsBtn\nإ&ظهار التفاصيل\n# ^ClickNext\nإضغط على التالي للمتابعة.\n# ^ClickInstall\nإضغط على تنصيب لتشغيل التنصيب.\n# ^ClickUninstall\nإضغط على إزالة لتشغيل الإزالة.\n# ^Name\nالإسم\n# ^Completed\nإنتهى\n# ^LicenseText\nالرجاء مراجعة إتفاقية الترخيص قبل تنصيب $(^NameDA). عند الموافقة على جميع شروط الإتفاقية، إضغط موافق.\n# ^LicenseTextCB\nالرجاء مراجعة إتفاقية الترخيص قبل تنصيب $(^NameDA). عند الموافقة على جميع شروط الإتفاقية، إضغط على مربع المؤشر التالي. $_CLICK.\n# ^LicenseTextRB\nالرجاء مراجعة إتفاقية الترخيص قبل تنصيب $(^NameDA). عند الموافقة على جميع شروط الإتفاقية، إختر الخيار الأول التالي. $_CLICK\n# ^UnLicenseText\nالرجاء مراجعة إتفاقية الترخيص قبل إزالة $(^NameDA). عند الموافقة على جميع شروط الإتفاقية، إضغط موافق.\n# ^UnLicenseTextCB\nالرجاء مراجعة إتفاقية الترخيص قبل إزالة $(^NameDA). عند الموافقة على جميع شروط الإتفاقية، اضغط على مربع المؤشر التالي. $_CLICK\n# ^UnLicenseTextRB\nالرجاء مراجعة إتفاقية الترخيص قبل إزالة $(^NameDA). عند الموافقة على جميع شروط الإتفاقية، إختر الخيار الأول التالي. $_CLICK\n# ^Custom\nإختياري\n# ^ComponentsText\nعلّم المكونات المراد تنصيبها وإزل العلامة عن المكونات الغير مراد تنصيبها. $_CLICK\n# ^ComponentsSubText1\nإختر نوع التنصيب:\n# ^ComponentsSubText2_NoInstTypes\nإختر المكونات للتنصيب:\n# ^ComponentsSubText2\nأو، قم بإختيار المكونات الإختيارية المراد تنصيبها:\n# ^UnComponentsText\nعلّم المكونات المراد إزالتها وأزل العلامة عن المكونات الغير مراد إزالتها. $_CLICK\n# ^UnComponentsSubText1\nإختر نوع الإزالة:\n# ^UnComponentsSubText2_NoInstTypes\nإختر المكونات للإزالة:\n# ^UnComponentsSubText2\nأو، إختر المكونات الإختيارية المراد إزالتها:\n# ^DirText\nسيتم تنصيب $(^NameDA) في المجلد التالي. للتنصيب في مجلد آخر، إضغط عرض وإختر مجلد آخر. $_CLICK\n# ^DirSubText\nمجلد الهدف\n# ^DirBrowseText\nإختر المجلد لتنصيب $(^NameDA) فيه:\n# ^UnDirText\nسيتم إزالة $(^NameDA) من المجلد التالي. للإزالة من مجلد آخر، إضغط عرض وأختر مجلد آخر. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nإختر المجلد لإزالة $(^NameDA) منه:\n# ^SpaceAvailable\n\"المساحة المتوفرة: \"\n# ^SpaceRequired\n\"المساحة المطلوبة: \"\n# ^UninstallingText\nسيتم إزالة $(^NameDA) من المجلد التالي. $_CLICK\n# ^UninstallingSubText\nإزالة من:\n# ^FileError\nحدث خلل أثناء فتح ملف للكتابة: \\r\\n\\t\\\"$0\\\"\\r\\nإضغط إلغاء لإلغاء التنصيب،\\r\\nمحاولة لإعادة محاولة كتابة الملف،\\r\\n تجاهل لتخطي الملف\n# ^FileError_NoIgnore\nحدث خلل أثناء فتح ملف للكتابة: \\r\\n\\t\\\"$0\\\"\\r\\nإضغط محاولة لإعادة محاولة كتابة الملف، أو\\r\\nإلغاء لإلغاء التنصيب\n# ^CantWrite\n\"لا يستطيع الكتابة: \"\n# ^CopyFailed\nفشل النسخ\n# ^CopyTo\n\"نسخ إلى\"\n# ^Registering\n\"تسجيل: \"\n# ^Unregistering\n\"إلغاء تسجيل: \"\n# ^SymbolNotFound\n\"لم يتمكن من إيجاد الرمز :\"\n# ^CouldNotLoad\n\"لم يتمكن من تحميل :\"\n# ^CreateFolder\n\"إنشاء مجلد\"\n# ^CreateShortcut\n\"إنشاء إختصار: \"\n# ^CreatedUninstaller\n\"إنشاء مزيل: \"\n# ^Delete\n\"حذف ملف: \"\n# ^DeleteOnReboot\n\"حذف بعد إعادة التشغيل: \"\n# ^ErrorCreatingShortcut\n\"خلل أثناء إنشاء إختصار: \"\n# ^ErrorCreating\n\"خلل أثناء إنشاء :\"\n# ^ErrorDecompressing\nخلل أثناء فتح البيانات المضغوطة! منصب تالف؟\n# ^ErrorRegistering\nخلل أثناء تسجيل DLL\n# ^ExecShell\n\"تنفيذ ExecShell:\"\n# ^Exec\n\"تنفيذ: \"\n# ^Extract\n\"إستخراج: \"\n# ^ErrorWriting\n\"إستخراج: خلل أثناء الكتابة إلى ملف \"\n# ^InvalidOpcode\nالمنصّب تالف: شفرة غير صالحة\n# ^NoOLE\n\"لا توجد OLE لـِ: \"\n# ^OutputFolder\n\"مجلد الإخراج: \"\n# ^RemoveFolder\n\"إزالة مجلد: \"\n# ^RenameOnReboot\n\"إعادة تسمية بعد إعادة التشغيل: \"\n# ^Rename\n\"إعادة تسمية: \"\n# ^Skipped\n\"تخطى: \"\n# ^CopyDetails\nنسخ التفاصيل إلى الذاكرة\n# ^LogInstall\nسجّل عملية التنصيب\n# ^Byte\nبايت\n# ^Kilo\n كيلو\n# ^Mega\n ميغا\n# ^Giga\n جيغا\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Arabic.nsh",
    "content": "﻿;Language: Arabic (1025)\n;Translation by asdfuae@msn.com\n;updated by Rami Kattan\n\n!insertmacro LANGFILE \"Arabic\" = \"العربية\" \"Al-Arabiyyah\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"مرحبا بك في مرشد إعداد $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"سيساعدك هذا المرشد في تنصيب $(^NameDA).$\\r$\\n$\\r$\\nمن المفضل إغلاق جميع البرامج قبل التنصيب. سيساعد هذا في تجديد ملفات النظام دون الحاجة لإعادة تشغيل الجهاز.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"مرحبا بك في مرشد إزالة $(^NameDA) \"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"هذا المرشد سيدلّك أثناء إزالة $(^NameDA).$\\r$\\n$\\r$\\n قبل البدء بالإزالة، يرجى التأكد من أن $(^NameDA) غير شغّال.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"إتفاقية‏ الترخيص\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"الرجاء مراجعة إتفاقية‏ الترخيص قبل تنصيب $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"عند الموافقة على شروط الإتفاقية‏، إضغط أوافق للمتابعة. يجب الموافقة على الإتفاقية‏ لتنصيب $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"عند الموافقة على شروط الإتفاقية‏، علّم مربع العلامة التالي. يجب الموافقة على الإتفاقية‏ لتنصيب $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"عند الموافقة على شروط الإتفاقية، إختر الخيار الأول من التالي. يجب الموافقة على الإتفاقية لتنصيب $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"إتفاقية الترخيص\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"الرجاء مراجعة شروط الترخيص قبل إزالة $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"عند الموافقة على شروط الإتفاقية، إضغط على موافق. يجب الموافقة على الإتفاقية لإزالة $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"عند الموافقة على شروط الإتفاقية، علّم المربع العلامة التالي. يجب الموافقة على الإتفاقية لإزالة $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"عند الموافقة على شروط الإتفاقية، إختر الخيار الأول من التالي. يجب الموافقة على الإتفاقية لإزالة $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"إضعط مفتاح صفحة للأسفل لرؤية باقي الإتفاقية\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"إختر المكونات\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"إختر ميزات $(^NameDA) المراد تنصيبها.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"إختر المكونات\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"إختر ميزات $(^NameDA) المراد إزالتها.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"الوصف\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"أشر بالفأرة فوق أحد المكونات لرؤية الوصف\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"إختر موقع التنصيب\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"إختر المجلد المراد تنصيب $(^NameDA) فيه.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"إختر موقع المزيل\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"إختر المجلد الذي سيزال منه $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"تنصيب\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"الرجاء الإنتظار أثناء تنصيب $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"إنتهى التنصيب\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"إنتهت عملية التنصيب بنجاح.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"إلغاء التنصيب\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"لم ينتهي التنصيب بنجاح.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"إزالة\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"الرجاء الإنتظار أثناء إزالة $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"إنتهى\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"إنتهت عملية الإزالة بنجاح.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"إلغاء الإزالة\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"لم تنتهي الإزالة بنجاح.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"إنهاء مرشد إعداد $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"لقد تم تنصيب $(^NameDA) على الجهاز$\\r$\\n$\\r$\\nإضغط إنهاء لإغلاق مرشد الإعداد.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"يجب إعادة تشغيل الجهاز لإنهاء تنصيب $(^NameDA). هل تريد إعادة التشغيل الآن؟\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"إنهاء مرشد إزالة $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"لقد تم إزالة $(^NameDA) من الجهاز.$\\r$\\n$\\r$\\n إضغط إنهاء لإغلاق المرشد.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"يجب إعادة تشغيل الجهاز لإنهاء إزالة $(^NameDA). هل تريد إعادة التشغيل الآن؟\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"أعد التشغيل الآن\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"أرغب في إعادة تشغيل الجهاز في وقت لاحق\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&شغل $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"اعرض& أقرأني\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&إنهاء\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"إختر مجلد قائمة ابدأ\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"إختر مجلد قائمة ابدأ لإختصارات $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"إختر المجلد في قائمة ابدأ الذي ستنشأ فيه إختصارات البرنامج. يمكن أيضا كتابة إسم لإنشاء مجلد جديد.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"لا تنشئ إختصارات\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"إزالة $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"إزالة $(^NameDA) من الجهاز.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"هل أنت متأكد من إغلاق منصّب $(^Name)؟\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"هل أنت متأكد من أنك الخروج من مزيل $(^Name)؟\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"اختر المستخدمين\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"حدد لمن من المستخدمين تريد تركيب $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"حدد لمن تريد تركيب $(^NameDA) لنفسك فقط أم لجميع مستخدمي الحاسب. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"تركيب لجميع مستخدمي هذا الحاسب\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"تركيب لي فقط\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Armenian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1067\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1200\n# RTL - anything else than RTL means LTR\n-\n# Translation by Hrant Ohanyan (h.ohanyan@haysoft.org) \n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nՏեղակայել $(^Name)-ը\n# ^UninstallCaption\nՋնջել $(^Name)-ը\n# ^LicenseSubCaption\n: Արտոնագրային համաձայնություն\n# ^ComponentsSubCaption\n: Տեղակայելու ընտրանքները\n# ^DirSubCaption\n: Տեղակայելու թղթապանակը\n# ^InstallingSubCaption\n: Ֆայլերը պատճենվում են\n# ^CompletedSubCaption\n: Գործողությունը ավարտվեց\n# ^UnComponentsSubCaption\n: Տեղակայելու ընտրությունը\n# ^UnDirSubCaption\n: Ջնջվող թղթապանակը\n# ^ConfirmSubCaption\n: Հաստատեք\n# ^UninstallingSubCaption\n: Ֆայլերը ջնջվում են\n# ^UnCompletedSubCaption\n: Գործողությունը ավարտվեց\n# ^BackBtn\n« &Նախորդը\n# ^NextBtn\n&Հաջորդը »\n# ^AgreeBtn\nՀամաձայն& եմ\n# ^AcceptBtn\nԵս &ընդունում եմ համաձայնագրի պայմանները\n# ^DontAcceptBtn\nԵս &չեմ ընդունում համաձայնագրի պայմանները\n# ^InstallBtn\n&Տեղակայել\n# ^UninstallBtn\nՋն&ջել\n# ^CancelBtn\nՉեղարկել\n# ^CloseBtn\n&Փակել\n# ^BrowseBtn\nԴ&իտել ...\n# ^ShowDetailsBtn\n&Մանրամասն...\n# ^ClickNext\nՇարունակելու համար սեղմեք 'Առաջ'։\n# ^ClickInstall\nՏեղակայելու համար սեղմեք 'Տեղակայել'։\n# ^ClickUninstall\nԾրագիրը ջնջելու համար սեղմեք 'Ջնջել'։\n# ^Name\nԱնունը\n# ^Completed\nՊատրաստ է\n# ^LicenseText\n$(^NameDA)-ը տեղակայելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։ Եթե ընդունում եք այն՝ սեղմեք 'Համաձայն եմ'։\n# ^LicenseTextCB\n$(^NameDA)-ը տեղակայելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։ Եթե ընդունում եք այն՝ դրեք նիշը ներքևում։ $_CLICK\n# ^LicenseTextRB\n$(^NameDA)-ը տեղակայելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։ Եթե ընդունում եք այն՝ ընտրեք ներքոնշյալներից առաջինը։ $_CLICK\n# ^UnLicenseText\n$(^NameDA)-ը ջնջելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։ Եթե ընդունում եք այն՝ սեղմեք 'Համաձայն եմ'։\n# ^UnLicenseTextCB\n$(^NameDA)-ը ջնջելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։ Եթե ընդունում եք այն՝ դրեք նիշը ներքևում։ $_CLICK\n# ^UnLicenseTextRB\n$(^NameDA)-ը ջնջելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։ Եթե ընդունում եք այն՝ ընտրեք ներքոնշյալներից առաջինը։ $_CLICK\n# ^Custom\nՀարմարեցված\n# ^ComponentsText\nԸնտրեք այն բաղադրիչները, որոնք ցանկանում եք տեղակայել։ $_CLICK\n# ^ComponentsSubText1\nԸնտրեք տեղակայելու եղանակը.\n# ^ComponentsSubText2_NoInstTypes\nՏեղակայելու համար ընտրեք բաղադրիչները.\n# ^ComponentsSubText2\nկամ ընտրեք լրացուցիչ բաղադրիչներ.\n# ^UnComponentsText\nՋնջելու համար ընտրեք բաղադրիչները։ $_CLICK\n# ^UnComponentsSubText1\nԸնտրեք ջնջելու եղանակը.\n# ^UnComponentsSubText2_NoInstTypes\nԸնտրեք ջնջելու բաղադրիչները.\n# ^UnComponentsSubText2\nկամ ջնջելու համար ընտրեք լրացուցիչ բաղադրիչներ։\n# ^DirText\nԾրագիրը կտեղակայի $(^NameDA)-ը նշված թղթապանակում։ Այլ թղթապանակում տեղակայելու համար սեղմեք 'Ընտրել' և ընտրեք այն։ $_CLICK\n# ^DirSubText\nՏեղակայելու թղթապանկը\n# ^DirBrowseText\nՆշեք $(^NameDA)-ի տեղակայելու թղթապանակը.\n# ^UnDirText\nԾրագիրը կջնջի $(^NameDA)-ը նշված թղթապանակից։ Այլ թղթապանակից ջնջելու համար սեղմեք 'Ընտրել' և ընտրեք այն։ $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nԸնտրեք թղթապանակը, որից պետք է ջնջել $(^NameDA)-ը.\n# ^SpaceAvailable\n\"Հասանելի է. \"\n# ^SpaceRequired\n\"Պահանջվում է. \"\n# ^UninstallingText\n$(^NameDA) ծրագիրը կջնջվի Ձեր համակարգչից։ $_CLICK\n# ^UninstallingSubText\nՋնջվում է՝\n# ^FileError\nՀնարավոր չէ բացել ֆայլը՝ գրանցելու համար։ \\r\\n\\t\"$0\"\\r\\n'Դադարեցնել'՝ ընդհատել տեղակայումը,\\r\\n\"Կրկնել\"՝ կրկին փորձել,\\r\\n\"Բաց թողնել\"՝ բաց թողնել գործողությունը։\n# ^FileError_NoIgnore\nՀնարավոր չէ բացել ֆայլը՝ գրանցելու համար։ \\r\\n\\t\"$0\"\\r\\n'Կրկնել'՝ կրկին փորձել,\\r\\n'Դադարեցնել'՝ ընդհատել տեղակայումը։\n# ^CantWrite\n\"Հնարավոր չէ գրանցել \"\n# ^CopyFailed\nՍխալ՝ պատճենելու ժամանակ\n# ^CopyTo\n\"Պատճենել՝ \"\n# ^Registering\n\"Գրանցում. \"\n# ^Unregistering\n\"Վերագրանցում. \"\n# ^SymbolNotFound\n\"Հնարավոր չէ գտնել՝ \"\n# ^CouldNotLoad\n\"Հնարավոր չէ բացել. \"\n# ^CreateFolder\n\"Ստեղծվում է թղթապանակ \"\n# ^CreateShortcut\n\"Ստեղծվում են պիտակներ.\"\n# ^CreatedUninstaller\n\"Ստեղծվում ջնջման ծրագիրը. \"\n# ^Delete\n\"Ֆայլերի ջնջում. \"\n# ^DeleteOnReboot\n\"Կջնջվի վերագործարկելուց հետո. \"\n# ^ErrorCreatingShortcut\n\"Սխալ՝ պիտակը ստեղծելիս. \" \n# ^ErrorCreating\n\"Սխալ. \"\n# ^ErrorDecompressing\nՍխալ՝ տվյալները բացելու ժամանակ։\n# ^ErrorRegistering\nՀնարավոր չէ գրանցել գրադարանը(DLL)\n# ^ExecShell\n\"Ֆայլի կիրառում. \" \n# ^Exec\n\"Կատարվում է. \"\n# ^Extract\n\"Հանում է. \"\n# ^ErrorWriting\n\"Ֆայլերը գրելու սխալ. \"\n# ^InvalidOpcode\nՏեղակայիչը վնասված է.\n# ^NoOLE\n\"Չկա OLE՝\" \n# ^OutputFolder\n\"Տեղակայելու թղթապանակը. \"\n# ^RemoveFolder\n\"Թղթապանակի ջնջում. \"\n# ^RenameOnReboot\n\"Կանվանափոխվի վերագործարկելուց հետո. \"\n# ^Rename\n\"Անվանափոխում. \"\n# ^Skipped\n\"Բաց թողնած. \"\n# ^CopyDetails\nՊատճենել տվյալները \n# ^LogInstall\nՏեղակայման հաշվետվություն\n# byte\nբայթ\n# kilo\n Կ\n# mega\n Մ\n# giga\n Գ"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Armenian.nsh",
    "content": "﻿;Language: Armenian (1067)\n;Translation by Hrant Ohanyan (h.ohanyan@haysoft.org)\n\n!insertmacro LANGFILE \"Armenian\" = \"Հայերեն\" \"Hayeren\" \n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Ձեզ ողջունում է $(^NameDA) տեղակայիչը\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Այս ծրագիրը կտեղակայի $(^NameDA)-ը Ձեր համակարգչում։$\\r$\\n$\\r$\\nԽորհուրդ ենք տալիս փակել աշխատող բոլոր ծրագրերը։ Դա հնարավորություն կտա տեղակայելուց հետո խուսափել համակարգչը վերագործարկելուց։$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Ձեզ ողջունում է $(^NameDA)-ը հեռացնելու ծրագիրը\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Այս ծրագիրը կջնջի $(^NameDA)-ը Ձեր համակարգչից։$\\r$\\n$\\r$\\nՋնջելուց առաջ համոզվեք, որ $(^NameDA) ծրագիրը բացած չէ։$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Արտոնագրային համաձայնություն\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"$(^NameDA)-ը տեղակայելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Եթե ընդունում եք համաձայնագիրը, ապա սեղմեք $\\\"Համաձայն եմ$\\\"։ Ծրագիրը տեղակայելու համար պետք է ընդունեք։\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Եթե ընդունում եք համաձայնագիրը՝ դրեք նիշը ներքևում։ Ծրագիրը տեղակայելու համար պետք է ընդունեք: $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Եթե ընդունում եք համաձայնագիրը՝ ընտրեք ներքոնշյալներից առաջինը։ Ծրագիրը տեղակայելու համար պետք է ընդունեք: $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Արտոնագրային համաձայնություն\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"$(^NameDA)-ը ջնջելուց առաջ ծանոթացեք արտոնագրային համաձայնությանը։\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Եթե ընդունում եք համաձայնագիրը՝ սեղմեք $\\\"Համաձայն եմ$\\\" կոճակը։ Ջնջելու համար պետք է ընդունեք։ $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Եթե ընդունում եք համաձայնագիրը՝ դրեք նիշը ներքևում։ Ջնջելու համար պետք է ընդունեք։ $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Եթե ընդունում եք համաձայնագիրը՝ ընտրեք ներքոնշյալներից առաջինը։ Ջնջելու համար պետք է ընդունեք։  $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Տեքստը կարդալու համար օգտագործեք կոճակներ՝ $\\\"PageUp$\\\" և $\\\"PageDown$\\\"։\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Տեղակայվող ծրագրի բաղադրիչները\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Ընտրեք $(^NameDA)-ի բաղադրիչները, որոնք ցանկանում եք տեղակայել։\"\n\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Ծրագրի բաղադրիչները\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Ընտրեք $(^NameDA)-ի բաղադրիչները, որոնք ցանկանում եք ջնջել։\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Նկարագրությունը\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Մկնիկի սլաքը ուղղեք բաղադրիչի վրա՝ նկարագրությունը կարդալու համար։\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Մկնիկի սլաքը ուղղեք բաղադրիչի վրա՝ նկարագրությունը կարդալու համար։\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Տեղակայելու թղթապանակի ընտրություն\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Ընտրեք թղթապանակը, որտեղ պետք է տեղակայել $(^NameDA)-ը։\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Ջնջելու թղթապանակի ընտրություն\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Ընտրեք թղթապանակը, որտեղից պետք է ջնջել $(^NameDA)-ը։\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Ֆայլերը պատճենվում են\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Սպասեք, պատճենում է $(^NameDA)-ի ֆայլերը...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Տեղակայվեց\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Հաջողությամբ տեղակայվեց\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Տեղակայումը ընդհատվել է։\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Տեղակայումը չի ավարտվել։\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Ջնջում է\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Սպասեք, ջնջում է $(^NameDA)-ի ֆայլերը...\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Ջնջվեց\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Ծրագիրը հաջողությամբ ջնջվեց։\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Ջնջման գործողությունը ընդհատվել է։\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Ծրագիրը ամբողջությամբ չի ջնջվել։\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA)-ի տեղակայման աշխատանքի ավարտում\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA)-ը տեղակայվեց։$\\r$\\n$\\r$\\nՍեղմեք $\\\"Պատրաստ է$\\\" կոճակը՝ տեղակայիչը փակելու համար։\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA)-ի տեղակայումը ավարտելու համար պահանջվում է համակարգչի վերագործարկում: Վերագործարկե՞լ։\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA)-ի ջնջելու գործողության ամփոփում \"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) ծրագիրը ջնջվել է Ձեր համակարգչից։ $\\r$\\n$\\r$\\nՍեղմեք $\\\"Պատրաստ է $\\\" կոճակը՝ ծրագրից դուրս գալու համար։\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA)-ի ջնջումը ավարտելու համար պահանջվում է համակարգչի վերագործարկում: Վերագործարկե՞լ։\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Այո, վերագործարկել համակարգիչը։\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ոչ, ես վերագործարկեմ ավելի ուշ։\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Բացել$(^NameDA)-ը\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Ցուցադրել ReadMe ֆայլը\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Պատրաստ է\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Թղթապանակ՝ $\\\"Start$\\\" ընտրացանկում\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Ընտրեք $\\\"Start$\\\"-ի թղթապանակը՝ ծրագրի պիտակների համար\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Ընտրեք  $\\\"Start$\\\"-ի թղթապանակը, որտեղ կստեղծվեն ծրագրի պիտակները։\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Չստեղծել պիտակներ\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA)-ի ջնջում\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA)-ը ջնջվում է համակարգչից։\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ընդհատե՞լ $(^Name)-ի տեղակայումը։\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Կանգնեցնե՞լ $(^Name)-ի ջնջումը։\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Ընտրել օգտվողներին\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Ընտրեք, թե որ օգտվողների համար եք ցանկանում տեղակայել $(^NameDA)-ը:\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Ընտրեք, թե ինչպես եք ցանկանում տեղակայել $(^NameDA)-ը՝ միայն Ձեզ համար, թե բոլոր օգտվողների: $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Տեղակայել բոլոր օգտվողների համար\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Տեղակայել միայն ինձ համար\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Asturian.nlf",
    "content": "﻿# Header, don't edit ;Asturian - Asturies\nNLF v6\n# Language ID (none exists at the moment)\n9997\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Marcos (marcoscostales@gmail.com).\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalación de $(^Name)\n# ^UninstallCaption\nDesinstalación de $(^Name)\n# ^LicenseSubCaption\n: Alcuerdu de Llicencia\n# ^ComponentsSubCaption\n: Opciones d'Instalación\n# ^DirSubCaption\n: Direutoriu d'Instalación\n# ^InstallingSubCaption\n: Instalando\n# ^CompletedSubCaption\n: Completáu\n# ^UnComponentsSubCaption\n: Opciones de Desinstalación\n# ^UnDirSubCaption\n: Direutoriu de Desinstalación\n# ^ConfirmSubCaption\n: Confirmación\n# ^UninstallingSubCaption\n: Desinstalando\n# ^UnCompletedSubCaption\n: Completáu\n# ^BackBtn\n< &Atrás\n# ^NextBtn\n&Siguiente >\n# ^AgreeBtn\nA&ceuto\n# ^AcceptBtn\nA&ceuto los términos de la llicencia\n# ^DontAcceptBtn\n&Non aceuto los términos de la llicencia\n# ^InstallBtn\n&Instalar\n# ^UninstallBtn\n&Desinstalar\n# ^CancelBtn\nEncaboxar\n# ^CloseBtn\n&Zarrar\n# ^BrowseBtn\n&Restolar...\n# ^ShowDetailsBtn\nVer &detalles\n# ^ClickNext\nCalca Siguiente pa siguir.\n# ^ClickInstall\nCalca Instalar pa entamar la instalación.\n# ^ClickUninstall\nCalca Desinstalar pa entamar la desinstalación.\n# ^Name\nNome\n# ^Completed\nCompletáu\n# ^LicenseText\nPor favor, revisa l'acuerdu de llicencia enantes d'instalar $(^NameDA). Si aceutes tolos términos del alcuerdu, calca Aceuto.\n# ^LicenseTextCB\nPor favor, revisa l'alcuerdu de llicencia enantes d'instalar $(^NameDA). Si aceutes tolos términos del alcuerdu, marca embaxo la caxella. $_CLICK\n# ^LicenseTextRB\nPor favor, revisa l'alcuerdu de llicencia enantes d'instalar $(^NameDA). Si aceutes tolos términos del alcuerdu, seleiciona embaxo la primer opción. $_CLICK\n# ^UnLicenseText\nPor favor, revisa l'alcuerdu de llicencia enantes de desinstalar $(^NameDA). Si aceutes tolos términos del alcuerdu, calca Aceuto.\n# ^UnLicenseTextCB\nPor favor, revisa l'alcuerdu de llicencia enantes de desinstalar $(^NameDA). Si aceutes tolos términos del alcuerdu, marca embaxo la caxella. $_CLICK.\n# ^UnLicenseTextRB\nPor favor, revisa l'alcuerdu de llicencia enantes de desinstalar $(^NameDA). Si aceutes tolos términos del alcuerdu, seleiciona embaxo la primer opción. $_CLICK\n# ^Custom\nPersonalizada\n# ^ComponentsText\nConseña los componentes que deseyes instalar y desconseña los componentes que nun quies instalar. $_CLICK\n# ^ComponentsSubText1\nTipos d'instalación:\n# ^ComponentsSubText2_NoInstTypes\nSeleiciona los componentes a instalar:\n# ^ComponentsSubText2\nO selecciona los componentes opcionales que deseyes instalar:\n# ^UnComponentsText\nConseña los componentes que deseyes desinstalar y desconseña los componentes que nun quieras desinstalar. $_CLICK\n# ^UnComponentsSubText1\nTipos de desinstalación:\n# ^UnComponentsSubText2_NoInstTypes\nSeleiciona los componentes a desinstalar:\n# ^UnComponentsSubText2\nO seleiciona los componentes opcionales que deseyes desinstalar:\n# ^DirText\nEl programa d'instalación instalará $(^NameDA) nel siguiente direutoriu. Pa instalar nun direutoriu distintu, calca Restolar y seleiciona otru direutoriu. $_CLICK\n# ^DirSubText\nDireutoriu de Destín\n# ^DirBrowseText\nSeleiciona'l direutoriu nel qu'instalará $(^NameDA):\n# ^UnDirText\nEl programa d'instalación desinstalará $(^NameDA) del siguiente direutoriu. Pa desinstalar d'un direutoriu distintu, calca Restolar y seleiciona otru direutoriu. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSeleiciona'l direutoriu dende'l cual desinstalará $(^NameDA):\n# ^SpaceAvailable\nEspaciu disponible: \n# ^SpaceRequired\nEspaciu requeríu: \n# ^UninstallingText\n$(^NameDA) sedrá desinstaláu del siguiente direutoriu. $_CLICK\n# ^UninstallingSubText\nDesinstalando dende:\n# ^FileError\nError abriendo ficheru pa escritura: \\r\\n\\t\"$0\"\\r\\nCalca albortar p'anular la instalación,\\r\\nreintentar pa volver a intentar escribir el ficheru, u\\r\\nomitir pa inorar esti ficheru\n# ^FileError_NoIgnore\nError abriendo ficheru pa escritura: \\r\\n\\t\"$0\"\\r\\nCalca reintentar pa volver a intentar escribir el ficheru, o\\r\\nencaboxar p'anular la instalación\n# ^CantWrite\n\"Nun pudo escribise: \"\n# ^CopyFailed\nFalló la copia\n# ^CopyTo\n\"Copiar a \"\n# ^Registering\n\"Rexistrando: \"\n# ^Unregistering\n\"Desaniciando rexistru: \"\n# ^SymbolNotFound\n\"Nun pudo atopase símbolu: \"\n# ^CouldNotLoad\n\"Nun pudo cargase: \"\n# ^CreateFolder\n\"Criar direutoriu: \"\n# ^CreateShortcut\n\"Criar accesu direutu: \"\n# ^CreatedUninstaller\n\"Criar desinstalador: \"\n# ^Delete\n\"Desaniciar ficheru: \"\n# ^DeleteOnReboot\n\"Desaniciar al reaniciu: \"\n# ^ErrorCreatingShortcut\n\"Fallu criando accesu direutu: \"\n# ^ErrorCreating\n\"Fallu criando: \"\n# ^ErrorDecompressing\n¡Error descomprimiendo datos! ¿Instalador corruptu?\n# ^ErrorRegistering\nFallu rexistrando DLL\n# ^ExecShell\n\"Executar comandu: \"\n# ^Exec\n\"Executar: \"\n# ^Extract\n\"Estrayer: \"\n# ^ErrorWriting\n\"Extrayer: fallu escribiendo al ficheru \"\n# ^InvalidOpcode\nInstalador corruptu: códigu d'operación non válidu\n# ^NoOLE\n\"Ensin OLE pa: \"\n# ^OutputFolder\n\"Direutoriu de salida: \"\n# ^RemoveFolder\n\"Desaniciar direutoriu: \"\n# ^RenameOnReboot\n\"Renomar al reaniciu: \"\n# ^Rename\n\"Renomar: \"\n# ^Skipped\n\"Omitíu: \"\n# ^CopyDetails\nCopiar Detalles al Cartafueyu\n# ^LogInstall\nRexistrar procesu d'instalación \n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Asturian.nsh",
    "content": "﻿;Language: Asturian (1150)\n;By Marcos (marcoscostales@gmail.com).\n\n!insertmacro LANGFILE \"Asturian\" = \"Asturies\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bienveníu al Asistente d'Instalación de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Esti programa instalará $(^NameDA) nel to ordenador.$\\r$\\n$\\r$\\nEncamiéntase que zarres toles demás aplicaciones enantes d'aniciar la instalación. Esto faerá posible anovar ficheros rellacionaos col sistema ensin tener que reaniciar el to ordenador.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bienveníu al Asistente de Desinstalación de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Esti asistente guiaráte durante la desinstalación de $(^NameDA).$\\r$\\n$\\r$\\nEnantes d'aniciar la desinstalación, asegúrate de que $(^NameDA) nun se ta executando.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Alcuerdu de llicencia\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Por favor revisa los términos de la llicencia enantes d'instalar $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Si aceutes tolos términos del alcuerdu, seleiciona Aceuto pa siguir. Tienes d'aceutar l'alcuerdu pa instalar $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si aceutes los términos del alcuerdu, conseña embaxo la caxella. Tienes d'aceutar los términos pa instalar $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si aceutes los términos del alcuerdu, seleiciona embaxo la primer opción. Tienes d'aceutar los términos pa instalar $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Alcuerdu de llicencia\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Por favor revisa los términos de la llicencia enantes de desinstalar $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Si aceutes tolos términos del alcuerdu, seleiciona Aceuto pa siguir. Tienes d'aceutar l'alcuerdu pa desinstalar $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si aceutes los términos del alcuerdu, conseña embaxu la caxella. Tienes d'aceutar los términos pa desinstalar $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si aceutes los términos del alcuerdu, seleccione embaxu la primer opción. Tienes d'aceutar los términos pa desinstalar $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Calca Avanzar Páxina pa ver el restu del alcuerdu.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Seleición de componentes\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Seleicione qué carauterístiques de $(^NameDA) deseyes instalar.\"\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descripción\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Seleición de componentes\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Seleicione qué carauterístiques de $(^NameDA) quies desinstalar.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Allugue'l mur enriba d'un componente pa ver la so descripción.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Escoyer llugar d'instalación\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Escueye'l direutoriu pa instalar $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Escoyer llugar de desinstalación\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Escueye'l direutoriu dende'l cual se desinstalará $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalando\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Por favor espera mientres $(^NameDA) s'instala.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalación Completada\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"La instalación completóse correutamente.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalación Desaniciada\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"La instalación nun se completó correutamente.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Desinstalando\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Por favor espera mientres $(^NameDA) se desinstala.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Desinstalación Completada\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"La desinstalación completóse correutamente.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Desinstalación Desaniciada\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"La desinstalación nun se completó correutamente.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Completando l'Asistente d'Instalación de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) foi instaláu nel to sistema.$\\r$\\n$\\r$\\nCalca Finar pa zarrar esti asistente.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"El to sistema tien de reaniciase pa que pueda completase la instalación de $(^NameDA). ¿Quies reaniciar agora?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Completando l'Asistente de Desinstalación de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) foi desinstaláu del to sistema.$\\r$\\n$\\r$\\nCalca Finar pa zarrar esti asistente.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"El to ordenador tien que reaniciar pa finar la desinstalación de $(^NameDA). ¿Quies reiniciar agora?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reaniciar agora\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Deseo reaniciar manualmente más sero\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Executar $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Ver Lléame\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Finar\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Escoyer Carpeta del Menú Aniciu\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Escueye una Carpeta del Menú Aniciu pa los accesos direutos de $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Seleiciona una carpeta del Menú Aniciu na que quieras criar los accesos direutos del programa. Tamién puedes introducir un nome pa criar una nueva carpeta.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Non criar accesos direutos\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstalar $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Desaniciar $(^NameDA) del to sistema.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"¿De xuru que quies colar de la instalación de $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"¿De xuru que quies colar de la desinstalación de $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Escoyer Usuarios\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Escueye los usuarios pa los cuales quies instalar $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Seleiciona si quies instalar $(^NameDA) namái pa tí o pa tolos usuarios d'esti Ordenador.$(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instalación pa cualisquier usuariu d'esti ordenador\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instalación namái pa mí\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Basque.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1069\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Iñaki San Vicente\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) -ren Instalazioa\n# ^UninstallCaption\n$(^Name) -ren Ezabaketa\n# ^LicenseSubCaption\n: Lizentzia hitzarmen agiria\n# ^ComponentsSubCaption\n: Instalazio aukerak\n# ^DirSubCaption\n: Instalazio karpeta\n# ^InstallingSubCaption\n: Instalatzen\n# ^CompletedSubCaption\n: Instalazioa burututa\n# ^UnComponentsSubCaption\n: Ezabaketa aukerak\n# ^UnDirSubCaption\n: Ezabaketa direktorioa\n# ^ConfirmSubCaption\n: Berretsi ezabaketa\n# ^UninstallingSubCaption\n: Ezabatzen\n# ^UnCompletedSubCaption\n: Ezabaketa burututa\n# ^BackBtn\n< &Atzera\n# ^NextBtn\n&Aurrera >\n# ^AgreeBtn\nOnartu\n# ^AcceptBtn\nLizentzia hitzarmenaren baldintzak onartzen ditut.\n# ^DontAcceptBtn\nEz ditut lizentzia hitzarmenaren baldintzak onartzen.\n# ^InstallBtn\n&Instalatu\n# ^UninstallBtn\n&Ezabatu\n# ^CancelBtn\nEzeztatu\n# ^CloseBtn\n&Itxi\n# ^BrowseBtn\n&Arakatu...\n# ^ShowDetailsBtn\nIkusi &zehaztasunak\n# ^ClickNext\nSakatu Aurrera jarraitzeko.\n# ^ClickInstall\nSakatu Instalatu instalazioarekin hasteko.\n# ^ClickUninstall\nSakatu Ezabatu ezabaketarekin hasteko.\n# ^Name\nIzena\n# ^Completed\nOsatuta\n# ^LicenseText\nMesedez, aztertu lizentzia hitzarmena $(^NameDA) instalatu aurretik. Baldintza guztiak onartzen badituzu, sakatu Onartu.\n# ^LicenseTextCB\nMesedez, aztertu lizentzia hitzarmena $(^NameDA) instalatu aurretik. Baldintza guztiak onartzen badituzu, nabarmendu azpiko laukitxoa. $_CLICK\n# ^LicenseTextRB\nMesedez, aztertu lizentzia hitzarmena $(^NameDA) instalatu aurretik. Baldintza guztiak onartzen badituzu, hautatu azpian lehen aukera. $_CLICK\n# ^UnLicenseText\nMesedez, aztertu lizentzia hitzarmena $(^NameDA) ezabatu aurretik. Baldintza guztiak onartzen badituzu, sakatu Onartu.\n# ^UnLicenseTextCB\nMesedez, aztertu lizentzia hitzarmena $(^NameDA) ezabatu aurretik. Baldintza guztiak onartzen badituzu, nabarmendu azpiko laukitxoa. $_CLICK.\n# ^UnLicenseTextRB\nMesedez, aztertu lizentzia hitzarmena $(^NameDA) ezabatu aurretik. Baldintza guztiak onartzen badituzu, hautatu azpian lehen aukera. $_CLICK\n# ^Custom\nNorberaren nahien arabera\n# ^ComponentsText\nNabarmendu instalatu nahi diren osagaiak, eta utzi zuri instalatu nahi ez direnak. $_CLICK\n# ^ComponentsSubText1\nHautatu instalazio mota:\n# ^ComponentsSubText2_NoInstTypes\nHautatu instalatu beharreko osagaiak:\n# ^ComponentsSubText2\nEdo hautatu instalatu beharreko aukerazko osagaiak:\n# ^UnComponentsText\nNabarmendu ezabatu nahi diren osagaiak, eta utzi zuri ezabatu nahi ez direnak. $_CLICK\n# ^UnComponentsSubText1\nHautatu ezabaketa mota:\n# ^UnComponentsSubText2_NoInstTypes\nHautatu ezabatu beharreko osagaiak:\n# ^UnComponentsSubText2\nEdo hautatu ezabatu beharreko aukerazko osagaiak:\n# ^DirText\nInstalazio programak $(^NameDA) honako karpetan instalatuko du. Beste karpeta batean instalatzeko, sakatu Arakatu eta aukeratu beste bat. $_CLICK\n# ^DirSubText\nHelburu karpeta\n# ^DirBrowseText\nAukeratu $(^NameDA) instalatuko den karpeta:\n# ^UnDirText\nInstalazio programak $(^NameDA) honako karpetatik ezabatuko du. Beste karpeta batetik ezabatzeko, sakatu Arakatu eta aukeratu beste bat. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nAukeratu $(^NameDA) zein karpetatik ezabatuko den:\n# ^SpaceAvailable\nLeku erabilgarria:\n# ^SpaceRequired\nBehar den lekua:\n# ^UninstallingText\n$(^NameDA) ondorengo karpetan instalatuko da. $_CLICK\n# ^UninstallingSubTex\nEzabatzen honako karpetatik:\n# ^FileError\nHutsegitea idazteko fitxategia irekitzean: \\r\\n\\t\"$0\"\\r\\nSakatu Irten instalazioa ,\\r\\nsaiatu berriz fitxategi hau berriz idazten saiatzeko, u\\r\\njarraitu fitxategi hau alde batera utzita aurrera egiteko\n# ^FileError_NoIgnore\nHutsegitea idazteko fitxategia irekitzean: \\r\\n\\t\"$0\"\\r\\nsaiatu berriz fitxategi hau berriz idazten saiatzeko ,\\r\\nSakatu Irten instalazioa\n# ^CantWrite\n\"Ezin izan da idatzi: \"\n# ^CopyFailed\nKopiatzeak hutsegin du\n# ^CopyTo\n\"Kopiatu hona \"\n# ^Registering\n\"Erregistratzen: \"\n# ^Unregistering\n\"Erregistroa ezabatzen: \"\n# ^SymbolNotFound\n\"Ikurra ezin izan da aurkitu: \"\n# ^CouldNotLoad\n\"Ezin izan da kargatu: \"\n# ^CreateFolder\n\"Sortu karpeta: \"\n# ^CreateShortcut\n\"Sortu lasterbidea: \"\n# ^CreatedUninstaller\n\"Sortu ezabatzailea: \"\n# ^Delete\n\"Ezabatu fitxategia: \"\n# ^DeleteOnReboot\n\"Ezabatu berrabiarazitakoan: \"\n# ^ErrorCreatingShortcut\n\"Hutsegitea lasterbidea sortzerakoan: \"\n# ^ErrorCreating\n\"Hutsegitea sortzerakoan: \"\n# ^ErrorDecompressing\n¡Hutsegitea datuak deskomprimatzean! Instalatzailea okerra?\n# ^ErrorRegistering\nHutsegitea DLL erregistratzerakoan\n# ^ExecShell\n\"Exekutatu agindua: \"\n# ^Exec\n\"Exekutatu: \"\n# ^Extract\n\"Kanporatu: \"\n# ^ErrorWriting\n\"Kanporaketa: hutsegitea fitxategira idazterakoan \"\n# ^InvalidOpcode\nInstalatzailea okerra: ekintza kodea ez da baliozkoa\n# ^NoOLE\n\"OLE-rik ez honentzako: \"\n# ^OutputFolder\n\"Irteera karpeta: \"\n# ^RemoveFolder\n\"Ezabatu karpeta: \"\n# ^RenameOnReboot\n\"Berrizendatu berrabiarazitakoan: \"\n# ^Rename\n\"Berrizendatu: \"\n# ^Skipped\n\"Alde batera utzitakoa: \"\n# ^CopyDetails\nKopiatu xehetasunak arbelera\n# ^LogInstall\nInstalazio prozesuaren erregistroa gorde\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Basque.nsh",
    "content": "﻿;Language: Basque (1069)\n;By Iñaki San Vicente\n\n!insertmacro LANGFILE \"Basque\" = \"Euskera\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Ongi etorri $(^NameDA) -ren instalazio programara\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Programa honek $(^NameDA) zure ordenagailuan instalatuko du.$\\r$\\n$\\r$\\nAholkatzen da instalazioarekin hasi aurretik beste aplikazio guztiak ixtea. Honek sistemarekin erlazionatuta dauden fitxategien eguneratzea ahalbidetuko du, ordenagailua berrabiarazi beharrik izan gabe.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Ongi etorri $(^NameDA) -ren ezabaketa programara\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Laguntzaile honek $(^NameDA)-ren ezabaketa prozesuan zehar gidatuko zaitu.$\\r$\\n$\\r$\\nEzabaketa hasi aurretik, ziurtatu $(^NameDA) martxan ez dagoela .$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lizentzia hitzarmena\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Mesedez aztertu lizentziaren baldintzak $(^NameDA) instalatu aurretik.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Baldintzak onartzen badituzu, sakatu Onartu aurrera egiteko. Hitzarmena onartzea ezinbestekoa da $(^NameDA) instalatzeko.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Baldintzak onartzen badituzu, nabarmendu azpiko laukitxoa. Hitzarmena onartzea ezinbestekoa da $(^NameDA) instalatzeko. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Baldintzak onartzen badituzu, hautatu azpian lehen aukera. Hitzarmena onartzea ezinbestekoa da $(^NameDA) instalatzeko. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lizentzia hitzarmena\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Mesedez aztertu lizentziaren baldintzak $(^NameDA) ezabatu aurretik.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Baldintzak onartzen badituzu, sakatu Onartu aurrera egiteko. Hitzarmena onartzea ezinbestekoa da $(^NameDA) ezabatzeko.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Baldintzak onartzen badituzu, nabarmendu azpiko laukitxoa. Hitzarmena onartzea ezinbestekoa da $(^NameDA) ezabatzeko. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Baldintzak onartzen badituzu, hautatu azpian lehen aukera. Hitzarmena onartzea ezinbestekoa da $(^NameDA) ezabatzeko. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Sakatu Av Pág hitzarmenaren gainontzeko atalak ikusteko.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Osagaien hautatzea\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Hautatu $(^NameDA)-ren zein ezaugarri instalatu nahi duzun.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Osagaien hautatzea\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Hautatu $(^NameDA)-ren zein ezaugarri ezabatu nahi duzun.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Azalpena\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Jarri sagua osagai baten gainean dagokion azalpena ikusteko.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Hautatu osagai bat bere azalpena ikusteko.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Hautatu instalazioaren lekua\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Aukeratu $(^NameDA) instalatzeko karpeta.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Aukeratu ezabatuko den karpeta\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Aukeratu $(^NameDA) zein karpetatik ezabatuko den.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalatzen\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Mesedez itxoin $(^NameDA) instalatzen den bitartean.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalazioa burututa\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Instalazioa zuzen burutu da.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalazioa ezeztatua\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Instalazioa ez da zuzen burutu.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Ezabatzen\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Mesedez itxoin $(^NameDA) ezabatzen den bitartean.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Ezabatzea burututa\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Ezabatzea zuzen burutu da.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Ezabatzea ezeztatuta\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Ezabatzea ez da zuzen burutu.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA)-ren instalazio laguntzailea osatzen\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) zure sisteman instalatu da.$\\r$\\n$\\r$\\nSakatu Amaitu laguntzaile hau ixteko.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Zure sistema berrabiarazi behar duzu $(^NameDA)-ren instalazioa osatzeko. Orain Berrabiarazi nahi duzu?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA)-ren ezabaketa laguntzailea osatzen\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) zure sistematik ezabatu da.$\\r$\\n$\\r$\\nSakatu Amaitu laguntzaile hau ixteko.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Zure ordenagailuak berrabiarazia izan behar du $(^NameDA)-ren ezabaketa osatzeko. Orain Berrabiarazi nahi duzu?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Berrabiarazi orain\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Neuk berrabiarazi geroago\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Exekutatu $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Ikusi Readme.txt\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Amaitu\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Aukeratu Hasiera Menuko karpeta\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Aukeratu Hasiera Menuko karpeta bat $(^NameDA)-ren lasterbideentzako.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Aukeratu Hasiera Menuko karpeta bat, non programaren lasterbideak instalatu nahi dituzun. Karpeta berri bat sortzeko izen bat ere adierazi dezakezu.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ez sortu lasterbiderik\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Ezabatu $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) zure sistematik ezabatzen du.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ziur zaude $(^Name)-ren instalaziotik irten nahi duzula?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Ziur zaude $(^Name)-ren ezabaketa laguntzailetik irten nahi duzula?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Hautatu Erabiltzaileak\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Hautatu zein erabiltzailerentzat ezartzea nahi duzun $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Hautatu norentzat ezartzea nahi duzun $(^NameDA) zuretzat bakarrik edo ordenagailu honetako erabiltzaile guztientzat. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Ezarri ordenagailu hau erabiltzen duen edonorentzat\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Ezarri niretzat bakarrik\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Belarusian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1059\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by PrydesparBLR [ prydespar@outlook.com ]\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nУсталяванне $(^Name)\n# ^UninstallCaption\nВыдаленне $(^Name)\n# ^LicenseSubCaption\n: Ліцэнзійнае пагадненне\n# ^ComponentsSubCaption\n: Параметры ўсталявання\n# ^DirSubCaption\n: Папка ўсталявання\n# ^InstallingSubCaption\n: Капіяванне файлаў\n# ^CompletedSubCaption\n: Працэдура завершена\n# ^UnComponentsSubCaption\n: Параметры выдалення\n# ^UnDirSubCaption\n: Папка выдалення\n# ^ConfirmSubCaption\n: Пацвярджэнне\n# ^UninstallingSubCaption\n: Выдаленне файлаў\n# ^UnCompletedSubCaption\n: Працэдура завершана\n# ^BackBtn\n< &Назад\n# ^NextBtn\n&Далей >\n# ^AgreeBtn\n&Прыняць\n# ^AcceptBtn\nЯ &прымаю ўмовы Ліцэнзійнага пагаднення\n# ^DontAcceptBtn\nЯ н&е прымаю ўмовы Ліцэнзійнага пагаднення\n# ^InstallBtn\n&Усталяваць\n# ^UninstallBtn\nВыд&аліць\n# ^CancelBtn\nСкасаваць\n# ^CloseBtn\nЗа&крыць\n# ^BrowseBtn\nА&гляд ...\n# ^ShowDetailsBtn\nПадра&бязнасці...\n# ^ClickNext\nНацісніце кнопку \"Далей\", каб працягнуць усталяванне праграмы.\n# ^ClickInstall\nНацісніце кнопку \"Усталяваць\", каб пачаць працэс ўсталявання праграмы.\n# ^ClickUninstall\nНацісніце кнопку \"Выдаліць\", каб пачаць працэс выдалення праграмы.\n# ^Name\nІмя\n# ^Completed\nЗавершана\n# ^LicenseText\nКалі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад пачаткам усталявання $(^NameDA). Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, націсніце кнопку \"Прыняць\".\n# ^LicenseTextCB\nКалі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад пачаткам усталявання $(^NameDA). Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, націсніце на сцяжок ніжэй. $_CLICK\n# ^LicenseTextRB\nКалі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад пачаткам усталявання $(^NameDA). Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, выберыце першы варыянт з прапанаваных нiжэй. $_CLICK\n# ^UnLicenseText\nКалі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад пачаткам выдалення $(^NameDA). Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, нацiснiце кнопку \"Прыняць\".\n# ^UnLicenseTextCB\nКалі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад пачаткам выдалення $(^NameDA). Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, націсніце на сцяжок ніжэй. $_CLICK\n# ^UnLicenseTextRB\nКалі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад пачаткам выдалення $(^NameDA). Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, выберыце першы варыянт з прапанаваных нiжэй. $_CLICK\n# ^Custom\nВыбарачна\n# ^ComponentsText\nВыберыце кампаненты праграмы, якiя Вы жадаеце ўсталяваць. $_CLICK\n# ^ComponentsSubText1\nВыберыце тып усталявання:\n# ^ComponentsSubText2_NoInstTypes\nВыберыце кампаненты праграмы, каб усталяваць iх:\n# ^ComponentsSubText2\nабо выберыце кампаненты праграмы, каб усталяваць iх па свайму жаданню:\n# ^UnComponentsText\nВыберыце кампаненты, якiя Вы жадаеце выдалiць, i знiмiце сцяжкі, выбраныя для тых кампанентаў, якiя не трэба выдаляць. $_CLICK\n# ^UnComponentsSubText1\nВыберыце тып выдалення:\n# ^UnComponentsSubText2_NoInstTypes\nВыберыце кампаненты для выдалення:\n# ^UnComponentsSubText2\nабо выберыце кампаненты праграмы для выдалення:\n# ^DirText\nПраграма ўсталюе $(^NameDA) у выбраную папку. Каб усталяваць праграму ў iншай папкі, нацiснiце кнопку \"Агляд\" i выберыце патрэбную папку. $_CLICK\n# ^DirSubText\nПапка ўсталявання\n# ^DirBrowseText\nВыберыце папку для ўсталявання $(^NameDA):\n# ^UnDirText\nПраграма выдалiць $(^NameDA) з выбранай папкі. Каб выдаліць праграму з iншай папкі, нацiснiце кнопку \"Агляд\" i выберыце патрэбную папку. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nВыберыце папку, з якой Вы жадаеце выдалiць $(^NameDA):\n# ^SpaceAvailable\n\"Даступна на дыску: \"\n# ^SpaceRequired\n\"Патрэбна месца на дыску: \"\n# ^UninstallingText\nПраграма выдалiць $(^NameDA) з Вашага камп'ютара. $_CLICK\n# ^UninstallingSubText\nВыдаленне з:\n# ^FileError\nНемагчыма адкрыць файл для запiсу: \\r\\n\\r\\n$0\\r\\n\\r\\nНацiснiце кнопку \"Перапынiць\", каб перапынiць усталяванне;\\r\\n\"Паўтарыць\", каб паўтарыць спробу запiсу ў файл;\\r\\n\"Ігнараваць\", каб прапусцiць гэта дзеянне.\n# ^FileError_NoIgnore\nНемагчыма адкрыць файл для запiсу: \\r\\n\\r\\n$0\\r\\n\\r\\nНацiснiце кнопку \"Паўтарыць\", каб паўтарыць спробу запiсу ў файл;\\r\\n\"Скасаваць\", каб перапынiць усталяванне.\n# ^CantWrite\n\"Немагчыма запiсаць: \"\n# ^CopyFailed\nПамылка пры капіяванні\n# ^CopyTo\n\"Капіяванне ў \"\n# ^Registering\n\"Рэгiстрацыя: \"\n# ^Unregistering\n\"Выдаленне рэгiстрацыi: \"\n# ^SymbolNotFound\n\"Немагчыма знайсці сiмвал: \"\n# ^CouldNotLoad\n\"Немагчыма загрузiць: \"\n# ^CreateFolder\n\"Стварэнне папкі: \"\n# ^CreateShortcut\n\"Стварэнне ярлыка: \"\n# ^CreatedUninstaller\n\"Стварэнне праграмы выдалення: \"\n# ^Delete\n\"Выдаленне файла: \"\n# ^DeleteOnReboot\n\"Выдаленне пасля перазапуску камп'ютара: \"\n# ^ErrorCreatingShortcut\n\"Памылка стварэння ярлыка: \" \n# ^ErrorCreating\n\"Памылка стварэння: \"\n# ^ErrorDecompressing\nНемагчыма выцягнуць дадзеныя. Магчыма пашкоджаны дыстрыбутыў.\n# ^ErrorRegistering\nНемагчыма зарэгістраваць бібліятэку (DLL)\n# ^ExecShell\n\"Выкананне каманды абалонкі: \" \n# ^Exec\n\"Выкананне: \"\n# ^Extract\n\"Выманне: \"\n# ^ErrorWriting\n\"Выманне: памылка запiсу файла\"\n# ^InvalidOpcode\nдыстрыбутыў пашкоджаны: код памылкi\n# ^NoOLE\n\"Няма OLE для: \" \n# ^OutputFolder\n\"Папка усталявання: \"\n# ^RemoveFolder\n\"Выдаленне папкі: \"\n# ^RenameOnReboot\n\"Перайменаванне пасля перазапуску камп'ютара: \"\n# ^Rename\n\"Перайменаванне: \"\n# ^Skipped\n\"Прапушчана: \"\n# ^CopyDetails\nКапіяваць звесткi ў буфер абмена \n# ^LogInstall\nЗапiсваць у лог працэс усталявання\n# byte\nБ\n# kilo\n К\n# mega\n М\n# giga\n Г\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Belarusian.nsh",
    "content": "﻿;Language: Belarusian (1059)\n;Translated by PrydesparBLR [ prydespar@outlook.com.by ]\n\n!insertmacro LANGFILE \"Belarusian\" = \"Беларуская\" \"Bielaruskaja\" ; Biełaruskaja\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Вас вiтае ўсталёўшчык $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Гэта праграма ўсталюе $(^NameDA) на Ваш камп'ютар.$\\r$\\n$\\r$\\nПерад усталяваннем прапануем закрыць усе праграмы, якія выконваюцца на дадзены момант. Гэта дапаможа ўсталёўшчыку абнавіць сістэмныя файлы без перазапуску камп'ютара.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Вы вырашылі выдаліць $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Гэта праграма выдаліць $(^NameDA) з Вашага камп'ютара.$\\r$\\n$\\r$\\nПерад выдаленнем пераканайцеся ў тым, што праграма $(^NameDA) не запушчана.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Лiцензiйнае пагадненне\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Калі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад усталяваннем $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Калi Вы прымаеце ўмовы Лiцензiйнага пагаднення, націсніце кнопку $\\\"Прыняць$\\\". Гэта неабходна для ўсталявання праграмы.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Калi Вы прымаеце ўмовы Лiцензiйнага пагаднення, націсніце на сцяжок ніжэй. Гэта неабходна для ўсталявання праграмы. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Калi Вы прымаеце ўмовы Ліцэнзійнага пагаднення, выберыце першы варыянт з прапанаваных ніжэй. Гэта неабходна для ўсталявання праграмы. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Ліцэнзійнае пагадненне\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Калі ласка, прачытайце ўмовы Ліцэнзійнага пагаднення перад выдаленнем $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, націсніце кнопку $\\\"Прыняць$\\\". Гэта неабходна для выдалення праграмы. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, націсніце на сцяжок ніжэй. Гэта неабходна для выдалення праграмы. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Калі Вы прымаеце ўмовы Ліцэнзійнага пагаднення, выберыце першы варыянт з прапанаваных ніжэй. Гэта неабходна для выдалення праграмы. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Выкарыстоўвайце кнопкi $\\\"PageUp$\\\" i $\\\"PageDown$\\\" для перамяшчэння па тэксце.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Кампаненты праграмы, якая ўсталёўваецца\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Выберыце кампаненты $(^NameDA), якія Вы жадаеце ўсталяваць.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Кампаненты праграмы\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Выберыце кампаненты $(^NameDA), якія Вы жадаеце выдаліць.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Апісанне\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Перамясціце курсор мышы на назву кампанента, каб прачытаць яго апісанне.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Выберыце кампанент, каб прачытаць яго апісанне.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Выбар папкі для ўсталявання\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Выберыце папку, у якую патрэбна ўсталяваць $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Выбар папкі для выдалення\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Выберыце папку, з якой патрэбна выдаліць $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Капіяванне файлаў\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Пачакайце, калі ласка, выконваецца капіяванне файлаў $(^NameDA) на Ваш камп'ютар...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Усталяванне завершана\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Усталяванне паспяхова завершана.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Усталяванне перарвана\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Усталяванне не завершана.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Выдаленне\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Пачакайце, калі ласка, выконваецца выдаленне файлаў $(^NameDA) з Вашага камп'ютара...\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Выдаленне завершана\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Выдаленне праграмы паспяхова завершана.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Выдаленне перарвана\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Выдаленне выканана не поўнасцю.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Заканчэнне ўсталявання $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Усталяванне $(^NameDA) выканана.$\\r$\\n$\\r$\\nНацісніце кнопку $\\\"Гатова$\\\", каб выйсці.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Каб завершыць усталяванне $(^NameDA), неабходна перазапусціць камп'ютар. Ці жадаеце Вы зрабіць гэта зараз?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Заканчэнне выдалення $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Выдаленне $(^NameDA) з Вашага камп'ютара выканана.$\\r$\\n$\\r$\\nНацісніце кнопку $\\\"Гатова$\\\"каб выйсці.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Каб завершыць выдаленне  $(^NameDA), неабходна перазапусціць камп'ютар. Ці жадаеце Вы зрабіць гэта зараз?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Так, перазапусціць камп'ютар зараз\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Не, перазапусціць камп'ютар пазней\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Запусціць $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Паказаць інфармацыю аб праграме\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Гатова\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Папка ў меню $\\\"Пуск$\\\"\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Выберыце папку ў меню $\\\"Пуск$\\\" для размяшчэння ярлыкоў праграмы.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Выберыце папку ў меню $\\\"Пуск$\\\", куды будуць змешчаны ярлыкі праграмы. Вы таксама можаце ўвесці іншае імя папкі.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Не ствараць ярлыкі\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Выдаленне $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Выдаленне $(^NameDA) з Вашага камп'ютара.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Вы сапраўды жадаеце скасаваць усталяванне $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Вы сапраўды жадаеце скасаваць выдаленне $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Выбраць карыстальнікаў\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Выберыце, для якіх карыстальнікаў Вы хочаце усталяваць $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Выберыце, ўсталёўваць $(^NameDA) толькі для сябе або для ўсіх карыстальнікаў гэтага камп'ютара. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Усталяваць для ўсіх карыстальнікаў\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Усталяваць толькі для бягучага карыстальніка\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Bosnian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n5146\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Salih CAVKIC, cavkic@skynet.be\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Instalacija\n# ^UninstallCaption\n$(^Name) Uklanjanje\n# ^LicenseSubCaption\n: Licencno pravo korištenja\n# ^ComponentsSubCaption\n: Opcije instalacije\n# ^DirSubCaption\n: Izbor mape za instalaciju\n# ^InstallingSubCaption\n: Instaliranje\n# ^CompletedSubCaption\n: Završeno\n# ^UnComponentsSubCaption\n: Opcije uklanjanja\n# ^UnDirSubCaption\n: Mapa uklanjanja\n# ^ConfirmSubCaption\n: Potvrda\n# ^UninstallingSubCaption\n: Uklanjanje\n# ^UnCompletedSubCaption\n: Završeno uklanjanje\n# ^BackBtn\n< &Nazad\n# ^NextBtn\n&Dalje >\n# ^AgreeBtn\n&Prihvatam\n# ^AcceptBtn\n&Prihvatam uvjete licencnog ugovora\n# ^DontAcceptBtn\n&Ne prihvatam uvjete licencnog ugovora\n# ^InstallBtn\n&Instaliraj\n# ^UninstallBtn\n&Ukloni\n# ^CancelBtn\nOdustani\n# ^CloseBtn\n&Zatvori\n# ^BrowseBtn\n&Pregledaj...\n# ^ShowDetailsBtn\nPrikaži &detalje\n# ^ClickNext\nPritisnite dugme 'Dalje' za nastavak.\n# ^ClickInstall\nPritisnite dugme 'Instaliraj' za početak instalacije.\n# ^ClickUninstall\nPritisnite dugme 'Ukloni' za početak uklanjanja.\n# ^Name\nIme\n# ^Completed\nZavršeno\n# ^LicenseText\nMolim pročitajte licencu prije instaliranja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite 'Prihvatam'.\n# ^LicenseTextCB\nMolim pročitajte licencu prije instaliranja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, označite donji kvadratić. $_CLICK\n# ^LicenseTextRB\nMolim pročitajte licencu prije instaliranja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite prvu donju opciju. $_CLICK\n# ^UnLicenseText\nMolim pročitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite 'Prihvatam'.\n# ^UnLicenseTextCB\nMolim pročitajte licencu prije uklanjanja programa $(^NameDA). Ako prihvatate sve uvjete ugovora, obilježite donji kvadratić. $_CLICK\n# ^UnLicenseTextRB\nMolim pročitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvatate sve uvjete ugovora, odaberite prvu opciju ispod. $_CLICK\n# ^Custom\nPodešavanje\n# ^ComponentsText\nOznačite komponente koje želite instalirati. Instaliraju se samo označene komponente. Uklonite oznaku sa onih koje ne želite instalirati. $_CLICK\n# ^ComponentsSubText1\nIzaberite tip instalacije:\n# ^ComponentsSubText2_NoInstTypes\nOdaberite komponente za instalaciju:\n# ^ComponentsSubText2\nIli po izboru označite komponente koje želite instalirati:\n# ^UnComponentsText\nOznačite komponente koje želite ukloniti. Uklonite oznaku sa onih koje ne želite ukloniti. $_CLICK\n# ^UnComponentsSubText1\nIzaberite tip uklanjanja:\n# ^UnComponentsSubText2_NoInstTypes\nIzaberite komponente za uklanjanje:\n# ^UnComponentsSubText2\nIli po izboru odaberite komponente koje želite da uklonite:\n# ^DirText\nProgram $(^NameDA) će biti instaliran u sljedeću mapu. Za instalaciju na neku drugu mapu odaberite 'Pregledaj...' i odaberite drugu mapu. $_CLICK\n# ^DirSubText\nOdredišna mapa\n# ^DirBrowseText\nIzaberite mapu u koju želite instalirati program $(^NameDA):\n# ^UnDirText\nProgram $(^NameDA) će biti uklonjen iz navedene mape. Za uklanjanje iz druge mape odaberite 'Pregledaj...' i označite drugu mapu. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nIzaberite mapu iz koje ćete program $(^NameDA) ukloniti:\n# ^SpaceAvailable\n\"Slobodno prostora na disku: \"\n# ^SpaceRequired\n\"Potrebno prostora na disku: \"\n# ^UninstallingText\nProgram $(^NameDA) će biti uklonjen iz sljedeće mape. $_CLICK\n# ^UninstallingSubText\nUklanjanje iz:\n# ^FileError\nGreška prilikom otvaranja datoteke za upisivanje: \\r\\n\\t\"$0\"\\r\\n\\\"Odustani\\\" za prekid instalacije,\\r\\n\\\"Ponovi\\\" za ponovni pokušaj upisivanja, ili\\r\\n\\\"Ignoriši\\\" za zanemarenje te datoteke\n# ^FileError_NoIgnore\nGreška prilikom otvaranja datoteke za upisivanje: \\r\\n\\t\"$0\"\\r\\n\\\"Ponovi\\\" za ponovni pokušaj zapisivanja, ili\\r\\n\\\"Odustani\\\" za prekid instalacije\n# ^CantWrite\n\"Nemoguće upisati: \"\n# ^CopyFailed\nGreška prilikom kopiranja\n# ^CopyTo\n\"Kopiraj u \"\n# ^Registering\n\"Prijava: \"\n# ^Unregistering\n\"Odjava: \"\n# ^SymbolNotFound\n\"Nemoguće naći simbol: \"\n# ^CouldNotLoad\n\"Nemoguće učitavanje: \"\n# ^CreateFolder\n\"Napravi mapu: \"\n# ^CreateShortcut\n\"Napravi prečicu: \"\n# ^CreatedUninstaller\n\"Program za uklanjanje: \"\n# ^Delete\n\"Obriši datoteku: \"\n# ^DeleteOnReboot\n\"Obriši prilikom ponovnog pokretanja: \"\n# ^ErrorCreatingShortcut\n\"Greška prilikom kreiranja prečica: \"\n# ^ErrorCreating\n\"Greška prilikom kreiranja: \"\n# ^ErrorDecompressing\nGreška prilikom otpakivanja podataka! Oštećen instalacijski program?\n# ^ErrorRegistering\nGreška prilikom prijavljivanja DLLa\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Izvrši: \"\n# ^Extract\n\"Otpakuj: \"\n# ^ErrorWriting\n\"Otpakivanje: greška upisivanja u datoteku \"\n# ^InvalidOpcode\nOštećena instalacijska datoteka: neispravna opkoda\n# ^NoOLE\n\"Nema OLE za: \"\n# ^OutputFolder\n\"Izlazna mapa: \"\n# ^RemoveFolder\n\"Obriši mapu: \"\n# ^RenameOnReboot\n\"Preimenuj prilikom ponovnog startovanja: \"\n# ^Rename\n\"Preimenuj: \"\n# ^Skipped\n\"Preskočeno: \"\n# ^CopyDetails\nKopiraj detalje na Klembord\n# ^LogInstall\nLogiraj zapisnik procesa instalacije\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Bosnian.nsh",
    "content": "﻿;Language: Bosnian (5146)\n;By Salih Čavkić, cavkic@skynet.be\n\n!insertmacro LANGFILE \"Bosnian\" = \"Bosanski\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Dobrodošli u program za instalaciju $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Ovaj program će instalirati $(^NameDA) na Vaš sistem. $\\r$\\n$\\r$\\nPreporučujemo da neizostavno zatvorite sve druge otvorene programe prije nego što definitivno započnete sa instaliranjem. To će omogućiti bolju nadogradnju određenih sistemskih datoteka bez potrebe da Vaš računar ponovo startujete. Instaliranje programa možete prekinuti pritiskom na dugme 'Odustani'.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Dobrodošli u postupak uklanjanja programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ovaj će Vas vodič provesti kroz postupak uklanjanja programa $(^NameDA).$\\r$\\n$\\r$\\nPrije samog početka, molim zatvorite program $(^NameDA) ukoliko je slučajno otvoren.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licencni ugovor\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Molim pročitajte licencni ugovor $(^NameDA) prije instalacije programa.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ako prihvatate uslove licence, odaberite 'Prihvatam' za nastavak. Morate prihvatiti licencu za instalaciju programa $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ako prihvatate uslove licence, označite donji kvadratić. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ako prihvatate uslove licence, odaberite prvu donju opciju. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licencni ugovor o pravu korištenja\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Molim pročitajte licencu prije uklanjanja programa $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ako prihvatate uslove licence, odaberite 'Prihvatam' za nastavak. Morate prihvatiti licencu za uklanjanje programa $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ako prihvatate uslove licence, označite donji kvadratić. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ako prihvatate uslove licence, odaberite prvu donju opciju. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Pritisnite 'Page Down' na tastaturi za ostatak licence.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Izbor komponenti za instalaciju\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Izaberite komponente programa $(^NameDA) koje želite instalirati.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Izbor komponenti za uklanjanje\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Izaberite komponente programa $(^NameDA) koje želite ukloniti.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Opis\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Postavite kursor od miša iznad komponente da biste vidjeli njezin opis.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Selektirajte jednu komponentu da vidite njezin opis.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Odaberite odredište za instalaciju\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Odaberite mapu u koju želite instalirati program $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Izaberite polazište za uklanjanje\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Selektirajte mapu iz koje želite ukloniti program $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instaliranje\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Molim pričekajte na završetak instalacije programa $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Kraj instalacije\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Instalacija je u potpunosti uspješno završila.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalacija je prekinuta\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Instalacija nije završila uspješno.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Uklanjanje\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Molim Vas pričekajte da vodič završi uklanjanje $(^NameDA) programa.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Uklanjanje je završeno\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Uklanjanje je u potpunosti završilo uspješno.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Uklanjanje je prekinuto\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Uklanjanje nije završilo uspješno.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Dovršavanje instalacije programa $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Program $(^NameDA) je instaliran na Vaše računar.$\\r$\\n$\\r$\\nPritisnite dugme 'Kraj' za završetak.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Računar treba ponovno startovati za dovršavanje instalacije programa $(^NameDA). Želite li to učiniti sada?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Završetak uklanjanja programa $(^NameDA) sa Vašeg sistema.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Program $(^NameDA) je uklonjen sa Vašeg računara.$\\r$\\n$\\r$\\nPritisnite dugme 'Kraj' za zatvaranje ovog prozora.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Vaš računar trebate ponovno startovati da dovršite uklanjanje programa $(^NameDA). Želite li da odmah sad ponovo startujete računar?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Startuj računar odmah sad\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ponovno ću pokrenuti računar kasnije\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Pokreni program $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Prikaži datoteku &Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Kraj\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Izbor mape u Start meniju\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Izaberite ime za programsku mapu unutar Start menija.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Izaberite jednu mapu u Start meniju u kojoj želite da se kreiraju prečice programa. Možete također unijeti ime za novu mapu ili selektirati već postojeću.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nemojte praviti prečice\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Uklanjanje programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Program $(^NameDA) će biti uklonjen sa Vašeg računara.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Jeste li sigurni da želite prekinuti instalaciju programa $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Jeste li sigurni da želite prekinuti uklanjanje $(^Name) programa?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Breton.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1150\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by KAD-Korvigelloù an Drouizig (drouizig@drouizig.org)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nStaliañ ha kefluniañ $(^Name)\n# ^UninstallCaption\nDistaliañ $(^Name)\n# ^LicenseSubCaption\n: Aotre arverañ\n# ^ComponentsSubCaption\n: Dibaboù staliañ\n# ^DirSubCaption\n: Kavlec'h staliañ\n# ^InstallingSubCaption\n: O staliañ ar restroù\n# ^CompletedSubCaption\n: Echu eo\n# ^UnComponentsSubCaption\n: Dibaboù distaliañ\n# ^UnDirSubCaption\n: Kavlec'h distaliañ\n# ^ConfirmSubCaption\n: Kadarnañ\n# ^UninstallingSubCaption\n: O tistaliañ ar restroù\n# ^UnCompletedSubCaption\n: Echu eo\n# ^BackBtn\n< &Kent\n# ^NextBtn\n&War-lerc'h >\n# ^AgreeBtn\n&A-du emaon\n# ^AcceptBtn\n&Degemer holl dermoù al lañvaz emglev\n# ^DontAcceptBtn\n&Chom hep degemer termoù al lañvaz emglev\n# ^InstallBtn\n&Staliañ\n# ^UninstallBtn\n&Distaliañ\n# ^CancelBtn\nNullañ\n# ^CloseBtn\n&Serriñ\n# ^BrowseBtn\nF&urchal...\n# ^ShowDetailsBtn\nMuioc'h a &ditouroù\n# ^ClickNext\nKlikit war « War-lerc'h » evit mont war-raok.\n# ^ClickInstall\nKlikit war « Staliañ » evit kregiñ gant ar staliadur.\n# ^ClickUninstall\nKlikit war « Distaliañ » evit kregiñ gant an distaliadur.\n# ^Name\nAnv\n# ^Completed\nEchu eo\n# ^LicenseText\nBezit aketus en ur lenn an aotre arverañ a-raok staliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war « A-du emaon ».\n# ^LicenseTextCB\nBezit aketus en ur lenn an aotre arverañ a-raok staliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war al log a-zindan. $_CLICK\n# ^LicenseTextRB\nBezit aketus en ur lenn an aotre arverañ a-raok staliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, dizuzit an dibab kentañ a-zindan. $_CLICK\n# ^UnLicenseText\nBezit aketus en ur lenn an aotre arverañ a-raok distaliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war « A-du emaon ».\n# ^UnLicenseTextCB\nBezit aketus en ur lenn an aotre arverañ a-raok distaliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, klikit war al log a-zindan. $_CLICK\n# ^UnLicenseTextRB\nBezit aketus en ur lenn an aotre arverañ a-raok distaliañ $(^NameDA) mar plij. Mar degemerit pep term eus an aotre, diuzit an dibab kentañ a-zindan. $_CLICK\n# ^Custom\nDiouzh ho kiz\n# ^ComponentsText\nDibabit an elfennoù a fell deoc'h staliañ pe diziuzit an elfennoù a fell deoc'h leuskel a-gostez. $_CLICK\n# ^ComponentsSubText1\nDibabit pe seurt staliañ a vo :\n# ^ComponentsSubText2_NoInstTypes\nDibabit an elfennoù da staliañ :\n# ^ComponentsSubText2\nPe dibabit an elfennoù diret a fell deoc'h staliañ :\n# ^UnComponentsText\nDibabit an elfennoù a fell deoc'h distaliañ pe diziuzit an elfennoù a fell deoc'h mirout. $_CLICK\n# ^UnComponentsSubText1\nDibabit peseurt distaliañ a vo :\n# ^UnComponentsSubText2_NoInstTypes\nDibabit an elfennoù da zistaliañ :\n# ^UnComponentsSubText2\nPe dibabit an elfennoù diret a fell deoc'h distaliañ :\n# ^DirText\nStaliet e vo $(^NameDA) gant ar goulev-mañ er c'havlec'h da-heul. Mar fell deoc'h dibab ur c'havlec'h all, klikit war « Furchal » ha dibabit ur c'havlec'h all. $_CLICK\n# ^DirSubText\nKavlec'h bukenn\n# ^DirBrowseText\nDibabit ar c'havlec'h e vo diazezet $(^NameDA) ennañ :\n# ^UnDirText\nDistaliet e vo $(^NameDA) gant ar goulev-mañ adalek ar c'havlec'h da heul. Ma fell deoc'h distaliañ adalek ur c'havlec'h all, klikit war « Furchal » ha diuzit ur c'havlec'h all. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nDiuzit ar c'havlec'h evit distaliañ $(^NameDA) adalek :\n# ^SpaceAvailable\n\"Egor kantenn vak : \"\n# ^SpaceRequired\n\"Egor kantenn rekis : \"\n# ^UninstallingText\nDistaliet e vo $(^NameDA) adalek ar c'havelec'h da-heul. $_CLICK\n# ^UninstallingSubText\nDistaliañ adalek :\n# ^FileError\nFazi en ur zigeriñ ur restr evit skrivañ : \\r\\n\\r\\n$0\\r\\n\\r\\nKlikit war « Paouez » evit paouez gant ar staliañ,\\r\\n« Adober » evit eseañ en-dro, pe\\r\\n« Tremen » evit leuskel a-gostez ar restr-mañ.\n# ^FileError_NoIgnore\nFazi en ur zigeriñ ur restr a-benn skrivañ : \\r\\n\\r\\n$0\\r\\n\\r\\nKlikit war « Adober » evit esaeañ en-dro, pe\\r\\nwar « Nullañ » evit paouez gant ar staliañ.\n# ^CantWrite\n\"N'haller ket skrivañ : \"\n# ^CopyFailed\nKopiañ faziet\n# ^CopyTo\n\"Kopiañ da \"\n# ^Registering\n\"Oc'h enskrivañ : \"\n# ^Unregistering\n\"O tienskrivañ : \"\n# ^SymbolNotFound\n\"N'haller ket kavout ur simbolenn : \"\n# ^CouldNotLoad\n\"N'haller ket kargañ : \"\n# ^CreateFolder\n\"Krouiñ kavlec'h : \"\n# ^CreateShortcut\n\"Krouiñ berradenn : \"\n# ^CreatedUninstaller\n\"Skoazeller distaliañ krouet : \"\n# ^Delete\n\"Dilemel restr : \"\n# ^DeleteOnReboot\n\"Dilemel en ur adloc'hañ : \"\n# ^ErrorCreatingShortcut\n\"Fazi en ur grouiñ berradenn : \"\n# ^ErrorCreating\n\"Fazi en ur grouiñ : \"\n# ^ErrorDecompressing\nFazi en ur ziwaskañ stlenn ! Skoazeller staliañ gwastet ?\n# ^ErrorRegistering\nFazi en ur enskrivañ an DLL\n# ^ExecShell\n\"ExecShell : \"\n# ^Exec\n\"Lañsañ : \"\n# ^Extract\n\"Eztennañ : \"\n# ^ErrorWriting\n\"Eztennañ : fazi en ur skrivañ restr \"\n# ^InvalidOpcode\nSkoazeller staliañ gwastet : opcode direizh\n# ^NoOLE\n\"OLE ebet evit : \"\n# ^OutputFolder\n\"Kavlec'h ec'hank : \"\n# ^RemoveFolder\n\"Dilemel ar c'havlec'h : \"\n# ^RenameOnReboot\n\"Adenvel pa vez adloc'het : \"\n# ^Rename\n\"Adenvel : \"\n# ^Skipped\n\"Laosket a-gostez: \"\n# ^CopyDetails\nKopiañ ar munudoù er golver\n# ^LogInstall\nTresañ an argerzh staliañ\n# ^Byte\nE\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Breton.nsh",
    "content": "﻿;Language: Breton (1150)\n;By KAD-Korvigelloù An Drouizig\n\n!insertmacro LANGFILE \"Breton\" = \"Brezhoneg\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Degemer mat e skoazeller staliañ $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Sturiet e viot gant ar skoazeller-mañ evit staliañ $(^NameDA).$\\r$\\n$\\r$\\nGwelloc'h eo serriñ pep arload oberiant er reizhiad a-raok mont pelloc'h gant ar skoazeller-mañ. Evel-se e c'heller nevesaat ar restroù reizhiad hep rankout adloc'hañ hoc'h urzhiataer.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Degemer mat er skoazeller distaliañ $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Sturiet e viot gant ar skoazeller-mañ a-benn distaliañ $(^NameDA).$\\r$\\n$\\r$\\nEn em asurit n'eo ket lañset $(^NameDA) a-raok mont pelloc'h gant an distaliañ.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lañvaz emglev\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Bezit aketus en ur lenn pep term eus al lañvaz a-raok staliañ $(^NameDA), mar plij.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Mar degemerit pep term eus al lañvaz, klikit war « War-lerc'h ». Ret eo deoc'h degemer al lañvaz evit staliañ $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Mar degemerit pep term eus al lañvaz, klikit war al log a-zindan. Ret eo deoc'h degemer al lañvaz a-benn staliañ $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Mar degemerit pep term eus al lañvaz, diuzit an dibab kentañ a-zindan. Ret eo deoc'h degemer al lañvaz a-benn staliañ $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lañvaz emglev\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Trugarez da lenn al lañvaz a-raok distaliañ $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Mar degemerit pep term eus al lañvaz, klikit war « A-du emaon » evit kenderc'hel. Ret eo deoc'h degemer al lañvaz evit distaliañ $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Mar degemerit pep term eus al lañvaz, klikit war al log a-zindan. Ret eo deoc'h degemer al lañvaz evit distaliañ $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Mar degemerit pep term eus al lañvaz, dizuit an dibab kentañ a-zindan. Ret eo deoc'h degemer al lañvaz evit distaliañ $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Pouezit war « Pajenn a-raok » evit lenn ar pajennoù eus al lañvaz da-heul.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Dibab elfennoù\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Dibabit pe elfenn(où) $(^NameDA) a fell deoc'h staliañ.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Dibabit elfennoù\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Dibabit pe elfenn(où) $(^NameDA) a fell deoc'h distaliañ.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Deskrivadenn\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Lakait ho logodenn a-zioc'h an elfenn evit gwelout he deskrivadenn.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Diuzuit an elfenn evit gwelout he deskrivadenn.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Dibabit al lec'hiadur staliañ\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Dibabit ar c'havlec'h ma vo lakaet $(^NameDA) ennañ.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Dibabit al lec'hiadur distaliañ\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Dibabit ar c'havlec'h e vo dilamet $(^NameDA) dioutañ.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"O staliañ\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Gortozit mar plij, emañ $(^NameDA) o vezañ staliet.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Echu eo gant ar staliañ\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Kaset eo bet da benn mat ar staliañ.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Staliañ paouezet\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"N'eo ket bet kaset da benn mat ar staliañ.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"O tistaliañ\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Gortozit mar plij, emañ $(^NameDA) o vezañ distaliet.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Echu eo gant an distaliañ\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Gant berzh eo bet kaset da benn an distaliañ.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Distaliañ paouezet\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"N'eo ket bet kaset da benn mat an distaliañ.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Oc'h echuiñ staliañ $(^NameDA) gant ar skoazeller\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Staliet eo bet $(^NameDA) war hoc'h urzhiataer.$\\r$\\n$\\r$\\nKlikit war « Echuiñ » evit serriñ ar skoazeller-mañ.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Ret eo hoc'h urzhiataer bezañ adloc'het evit ma vez kaset da benn staliañ $(^NameDA). Ha fellout a ra deoc'h adloc'hañ diouzhtu ?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Oc'h echuiñ distaliañ $(^NameDA) gant ar skoazeller\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Distaliet eo bet $(^NameDA) diouzh hoc'h urzhiataer.$\\r$\\n$\\r$\\nKlikit war « Echuiñ » evit serriñ ar skoazeller-mañ.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Ret eo hoc'h urzhiataer bezañ adloc'het evit ma vez kaset da benn distaliañ $(^NameDA). Ha fellout a ra deoc'h adloc'hañ diouzhtu ?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Adloc'hañ diouzhtu\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Fellout a ra din adloc'hañ diwezatoc'h dre zorn\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Lañsañ $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Diskouez ar restr Malennit\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Echuiñ\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Diskouez kavlec'h al Lañser loc'hañ\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Dibabit ur c'havlec'h Lañser loc'hañ evit berradennoù $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Diuzit ar c'havlec'h Lañser loc'hañ e vo savet ennañ berradennoù ar goulevioù. Gallout a rit ingal reiñ un anv evit sevel ur c'havlec'h nevez.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Chom hep sevel berradennoù\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Distaliañ $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Dilemel $(^NameDA) adalek hoc'h urzhiataer.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ha sur oc'h e fell deoc'h kuitaat staliañ $(^Name) ?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Ha sur oc'h e fell deoc'h kuitaat distaliañ $(^Name) ?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Bulgarian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1026\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by Asparouh Kalyandjiev <acnapyx@computers.bg>\n# Updated v2 to v6 by Plamen Penkov <plamen71@hotmail.com>\n# Updated by Кирил Кирилов (DumpeR)<dumper@data.bg>\n# \n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nИнсталиране на $(^Name) \n# ^UninstallCaption\nИзтриване на $(^Name) \n#^LicenseSubCaption\n: Лицензионно споразумение\n#^ComponentsSubCaption\n: Опции за инсталиране\n# ^DirSubCaption\n: Инсталиране в папка\n#^InstallingSubCaption\n: Инсталиране\n#^CompletedSubCaption\n: Завършване\n# ^UnComponentsSubCaption\n: Опции за изтриване\n# ^UnDirSubCaption\n: Изтриване от папка\n# ^ConfirmSubCaption\n: Потвърждение\n#^UninstallingSubCaption\n: Изтриване\n#^UnCompletedSubCaption\n: Завършване\n# ^BackBtn\n< &Назад\n#^NextBtn\nН&апред >\n# ^AgreeBtn\n&Съгласен\n# ^AcceptBtn\n&Съгласен съм с условията на Лицензионното споразумение.\n# ^DontAcceptBtn\n&Не съм съгласен с условията на Лицензионното споразумение.\n# ^InstallBtn\n&Инсталирай\n#^UninstallBtn\n&Изтрий\n# ^CancelBtn\n&Отказ\n#^CloseBtn\n&Затвори\n#^BrowseBtn\nП&реглед...\n#^ShowDetailsBtn\n&Детайли\n# ^ClickNext\nНатиснете \"Напред\", за да продължите.\n# ^ClickInstall\nНатиснете \"Инсталирай\", за да започне инсталирането.\n# ^ClickUninstall\nНатиснете \"Изтрий\", за да започне изтриването.\n# ^Name\nИме\n#^Completed\nКрай\n# ^LicenseText\nМоля прочетете Лицензионното споразумение преди да инсталирате $(^NameDA). Ако приемате всички условия на споразумението, натиснете \"Съгласен\".\n# ^LicenseTextCB\nМоля прочетете Лицензионното споразумение преди да инсталирате $(^NameDA). Ако приемате всички условия на споразумението, сложете отметка в полето по-долу. $_CLICK\n# ^LicenseTextRB\nМоля прочетете Лицензионното споразумение преди да инсталирате $(^NameDA). Ако приемате всички условия на споразумението, изберете първата опция по-долу. $_CLICK\n# ^UnLicenseText\nМоля прочетете Лицензионното споразумение преди да изтриете $(^NameDA). Ако приемате всички условия на споразумението, натиснете \"Съгласен\".\n# ^UnLicenseTextCB\nМоля прочетете Лицензионното споразумение преди да изтриете $(^NameDA). Ако приемате всички условия на споразумението, сложете отметка в полето по-долу. $_CLICK\n# ^UnLicenseTextRB\nМоля прочетете Лицензионното споразумение преди да изтриете $(^NameDA). Ако приемате всички условия на споразумението, изберете първата опция по-долу. $_CLICK\n# ^Custom\nИнсталиране по избор\n#^ComponentsText\nИзберете компонентите, които искате да бъдат инсталирани. $_CLICK\n#^ComponentsSubText1\nИзберете тип инсталиране:\n#^ComponentsSubText2_NoInstTypes\nИзберете компоненти:\n#^ComponentsSubText2\nИли изберете компонентите, които искате да бъдат инсталирани:\n# ^UnComponentsText\nСложете отметка пред компонентите, които искате да изтриете, а тези които не искате да изтриете оставете без отметка. $_CLICK\n# ^UnComponentsSubText1\nИзберете типа на изтриване:\n# ^UnComponentsSubText2_NoInstTypes\nИзберете компонентите за изтриване:\n# ^UnComponentsSubText2\nИли, изберете допълнителни компоненти за изтриване:\n# ^DirText\nПрограмата ще инсталира $(^NameDA) в посочената папка. За да инсталирате в друга папка, натиснете \"Преглед\" и изберете друга папка. $_CLICK\n# ^DirSubText\nЦелева папка\n# ^DirBrowseText\nИзберете папка, в която да се инсталира $(^NameDA):\n# ^UnDirText\nПрограмата ще изтрие $(^NameDA) от следната папка. За да изтриете от друга папка, натиснете \"Преглед\" и изберете друга папка. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nИзберете папката от която да се изтрие $(^NameDA):\n# ^SpaceAvailable\n\"Свободно пространство: \"\n#^SpaceRequired\n\"Необходимо пространство: \"\n# ^UninstallingText\n$(^NameDA) ще бъде изтрита от следната папка. $_CLICK\n# ^UninstallingSubText\nИзтриване от:\n# ^FileError\nГрешка при отваряне на файла за запис: \\r\\n\\t\"$0\"\\r\\nНатиснете \"Прекрати\", за да прекратите инсталирането, \"Повтори\", за да опитате отново или \"Игнорирай\", за да пропуснете този файл\n# ^FileError_NoIgnore\nГрешка при отваряне на файла за запис: \\r\\n\\t\"$0\"\\r\\nНатиснете \"Повтори\", за да опитате отново или \"Прекрати\", за да прекратите инсталирането.\n# ^CantWrite\n\"Неуспешно записване на: \"\n#^CopyFailed\nКопирането неуспешно\n# ^CopyTo\n\"Копиране на \"\n# ^Registering\n\"Регистриране на: \"\n# ^Unregistering\n\"Дерегистриране на: \"\n#^SymbolNotFound\n\"Символът не е намерен: \"\n# ^CouldNotLoad\n\"Неуспешно зареждане на: \"\n# ^CreateFolder\n\"Създаване на папка: \"\n# ^CreateShortcut\n\"Създаване на пряк път: \"\n#^CreatedUninstaller\n\"Създаване на програма за изтриване: \"\n# ^Delete\n\"Изтриване на: \"\n#^DeleteOnReboot\n\"Изтриване след рестарт: \"\n#^ErrorCreatingShortcut\n\"Грешка при създаване на прекия път: \"\n#^ErrorCreating\n\"Грешка при създаване на: \"\n# ^ErrorDecompressing\nГрешка при декомпресиране на данните! Вероятно инсталационния пакет е повреден.\n# ^ErrorRegistering\nГрешка при регистриране на DLL\n#^ExecShell\n\"ExecShell: \"\n#^Exec\n\"Изпълнение на: \"\n#^Extract\n\"Извличане на: \"\n#^ErrorWriting\n\"Извличане на: грешка при запис във файл \"\n#^InvalidOpcode\nПакета е повреден: грешен код на операция\n# ^NoOLE\n\"Няма OLE за: \"\n#^OutputFolder\n\"Инсталиране в папка: \"\n#^RemoveFolder\n\"Изтриване на папка: \"\n#^RenameOnReboot\n\"Преименуване при рестарт: \"\n# ^Rename\n\"Преименуване на: \"\n#^Skipped\n\"Пропускане на: \"\n# ^CopyDetails\nКопиране на данните в буфера\n# ^LogInstall\nЗаписване на отчет за инсталирането\n# ^Byte\nБ\n# ^Kilo\n К\n# ^Mega\n М\n# ^Giga\n Г "
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Bulgarian.nsh",
    "content": "﻿;Language: Bulgarian (1026)\n;Translated by Asparouh Kalyandjiev [acnapyx@sbline.net]\n;Review and update from v1.63 to v1.68 by Plamen Penkov [plamen71@hotmail.com]\n;Updated by Кирил Кирилов (DumpeR) [dumper@data.bg]\n;\n\n!insertmacro LANGFILE \"Bulgarian\" = \"Български\" \"Balgarski\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Добре дошли в Съветника за инсталиране на $(^NameDA)!\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Той ще инсталира $(^NameDA) на вашия компютър.$\\r$\\n$\\r$\\nПрепоръчва се да затворите всички други приложения, преди да продължите. Това ще позволи на програмата да обнови някои системни файлове, без да се рестартира компютъра.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Добре дошли в Съветника за изтриване на $(^NameDA)!\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Той ще ви помогне да изтриете $(^NameDA) от вашия компютър.$\\r$\\n$\\r$\\nПреди да продължите, уверете се че $(^NameDA) не е стартирана в момента.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Лицензионно споразумение\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Моля запознайте се Лицензионното споразумение преди да продължите.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ако приемате условията на споразумението, натиснете $\\\"Съгласен$\\\", за да продължите. Трябва да приемете споразумението, за да инсталирате $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ако приемате условията на споразумението, сложете отметка в полето по-долу. Трябва да приемете споразумението, за да инсталирате $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ако приемате условията на споразумението, изберете първата опция по-долу. Трябва да приемете споразумението, за да инсталирате $(^NameDA) $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Лицензионно споразумение\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Моля запознайте се лицензионните условия преди да изтриете $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ако приемате условията на споразуменито, натиснете $\\\"Съгласен$\\\" за да продължите. Трябва да приемете споразумението, за да изтриете $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ако приемате условията на споразумението, сложете отметка в полето по-долу. Трябва да приемете споразумението, за да изтриете $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ако приемате условията на споразуменито, изберете първата опция по-долу. Трябва да приемете споразумението, за да изтриете $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Натиснете клавиша $\\\"Page Down$\\\", за да видите останалата част от споразумението.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Избор на компоненти\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Изберете кои компоненти на $(^NameDA) искате да инсталирате.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Избор на компоненти\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Изберете кои компоненти на $(^NameDA) искате да изтриете.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Описание\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Преминете с мишката над определен компонент, за да видите описанието му.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Изберете компонент, за да видите описанието му.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Избор на папка за инсталиране\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Изберете папката, в която да се инсталира $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Избор на папка за изтриване\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Изберете папката, от която да се изтрие $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Инсталиране\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Изчакайте, инсталират се файловете на $(^NameDA)...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Инсталирането завърши.\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Инсталирането завърши успешно.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Инсталирането прекратено.\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Инсталирането не завърши успешно.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Изтриване\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Изчакайте, изтриват се файловете на $(^NameDA)...\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Край\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Изтриването завърши успешно.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Изтриването прекратено.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Изтриването не завърши напълно.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Приключване на Съветника за инсталиране на $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Инсталирането на $(^NameDA) е завършено.$\\r$\\n$\\r$\\nНатиснете бутона $\\\"Край$\\\", за да затворите Съветника.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Компютърът трябва да бъде рестартиран, за да завърши инсталирането на $(^NameDA). Искате ли да рестартирате сега?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Приключване на Съветника за изтриване на $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Програмата $(^NameDA) беше изтрита от вашия компютър.$\\r$\\n$\\r$\\nНатиснете $\\\"Край$\\\" за да затворите този Съветник.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Компютърът ви трябва да се рестартира, за да приключи успешно изтриването на $(^NameDA). Искате ли да рестартирате сега?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Да, рестартирай сега\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Не, ще рестартирам по-късно\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Стартирай $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Покажи файла $\\\"ReadMe$\\\"\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Край\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Избор на папка в менюто $\\\"Старт$\\\"\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Изберете папка в менюто $\\\"Старт$\\\" за преки пътища към програмата.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Изберете папка в менюто $\\\"Старт$\\\", в която искате да създадете преки пътища към програмата. Можете също така да въведете име, за да създадете нова папка.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Не създавай преки пътища\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Изтриване на $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Изтриване на $(^NameDA) от вашия компютър.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Сигурни ли сте, че искате да прекратите инсталирането на $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Сигурни ли сте, че искате да прекратите изтриването на $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Catalan.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1027\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by falanko\n# Corrections by Toni Hermoso Pulido\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstal·lació de l'aplicació $(^Name)\n# ^UninstallCaption\nDesinstal·lació de l'aplicació $(^Name)\n# ^LicenseSubCaption\n: Acord de llicència\n# ^ComponentsSubCaption\n: Opcions d'instal·lació\n# ^DirSubCaption\n: Carpeta d'instal·lació\n# ^InstallingSubCaption\n: S'està instal·lant\n# ^CompletedSubCaption\n: S'ha acabat\n# ^UnComponentsSubCaption\n: Opcions de desinstal·lació\n# ^UnDirSubCaption\n: Carpeta de desinstal·lació\n# ^ConfirmSubCaption\n: Confirmació\n# ^UninstallingSubCaption\n: S'està desinstal·lant\n# ^UnCompletedSubCaption\n: No s'ha acabat\n# ^BackBtn\n< En&rere\n# ^NextBtn\nEn&davant >\n# ^AgreeBtn\nHi estic d'a&cord\n# ^AcceptBtn\n&Accepto els termes de l'acord de llicència\n# ^DontAcceptBtn\n&No accepto els termes de l'acord de llicència\n# ^InstallBtn\n&Instal·la\n# ^UninstallBtn\n&Desinstal·la\n# ^CancelBtn\n&Cancel·la\n# ^CloseBtn\n&Tanca\n# ^BrowseBtn\n&Navega...\n# ^ShowDetailsBtn\n&Mostra els detalls\n# ^ClickNext\nFeu clic a Endavant per a continuar.\n# ^ClickInstall\nFeu clic a Instal·la per a iniciar la instal·lació.\n# ^ClickUninstall\nFeu clic a Desinstal·la per a iniciar la desinstal·lació.\n# ^Name\nNom\n# ^Completed\nS'ha acabat\n# ^LicenseText\nReviseu l'acord de llicència abans d'instal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, feu clic a Hi estic d'acord.\n# ^LicenseTextCB\nReviseu l'acord de llicència abans d'instal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, activeu la casella de sota. $_CLICK\n# ^LicesnseTextRB\nReviseu l'acord de llicència abans d'instal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. $_CLICK\n# ^UnLicenseText\nReviseu l'acord de llicència abans de desinstal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, feu clic a Hi estic d'acord.\n# ^UnLicenseTextCB\nReviseu l'acord de llicència abans de desinstal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, activeu la la casella de sota. $_CLICK\n# ^UnLicesnseTextRB\nReviseu l'acord de llicència abans de desinstal·lar l'aplicació $(^NameDA). Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. $_CLICK\n# ^Custom\nPersonalitzada\n# ^ComponentsText\nActiveu els components que voleu instal·lar i desactiveu els que no. $_CLICK\n# ^ComponentsSubText1\nSeleccioneu el tipus d'instal·lació:\n# ^ComponentsSubText2_NoInstTypes\nSeleccioneu els components per instal·lar:\n# ^ComponentsSubText2\nO bé, seleccioneu els components opcionals que desitgéssiu instal·lar:\n# ^UnComponentsText\nActiveu els components que voleu desinstal·lar i desactiveu els que no. $_CLICK\n# ^UnComponentsSubText1\nSeleccioneu el tipus de desinstal·lació:\n# ^UnComponentsSubText2_NoInstTypes\nSeleccioneu els components per desinstal·lar:\n# ^UnComponentsSubText2\nO bé, seleccioneu els components opcionals per desinstal·lar:\n# ^DirText\nEl programa d'instal·lació instal·larà l'aplicació $(^NameDA) en la següent carpeta. Per a instal·lar-lo en una carpeta diferent, feu clic a Navega i seleccioneu-ne una altra. $_CLICK\n# ^DirSubText\nCarpeta de destinació\n# ^DirBrowseText\nSeleccioneu la carpeta on s'instal·larà l'aplicació $(^NameDA):\n# ^UnDirText\nEl programa d'instal·lació desinstal·larà l'aplicació $(^NameDA) de la següent carpeta. Per a desinstal·lar-lo d'una carpeta diferent, feu clic a Navega i seleccioneu-ne una altra. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSeleccioneu la carpeta des d'on es desinstal·larà l'aplicació $(^NameDA):\n# ^SpaceAvailable\n\"Espai lliure: \"\n# ^SpaceRequired\n\"Espai necessari: \"\n# ^UninstallingText\nEs desinstal·larà l'aplicació $(^NameDA) de la següent carpeta. $_CLICK\n# ^UninstallingSubTex\nS'està desinstal·lant de:\n# ^FileError\nS'ha produït un error en obrir el fitxer en mode d'escriptura: \\r\\n\\t\"$0\"\\r\\nFeu clic a Abandona per a aturar la instal·lació,\\r\\nReintenta per a tornar-ho a provar, o\\r\\Ignora per a ometre aquest fitxer.\n# ^FileError_NoIgnore\nS'ha produït un error en obrir el fitxer en mode d'escriptura: \\r\\n\\t\"$0\"\\r\\nFeu clic a Reintenta per a tornar-ho a provar, o\\r\\Cancel·la per a aturar la instal·lació.\n# ^CantWrite\n\"No s'ha pogut escriure: \"\n# ^CopyFailed\nHa fallat la còpia\n# ^CopyTo\n\"Copia a \"\n# ^Registering\n\"S'esta registrant:\"\n# ^Unregistering\n\"S'està suprimint el registre: \"\n# ^SymbolNotFound\n\"No s'ha trobat el símbol: \"\n# ^CouldNotLoad\n\"No s'ha pogut carregar: \"\n# ^CreateFolder\n\"Crea la carpeta: \"\n# ^CreateShortcut\n\"Crea la drecera: \"\n# ^CreatedUninstaller\n\"S'ha creat el desinstal·lador: \"\n# ^Delete\n\"S'ha suprimit el fitxer: \"\n# ^DeleteOnReboot\n\"Suprimeix en reiniciar: \"\n# ^ErrorCreatingShortcut\n\"S'ha produït un error en crear la drecera: \"\n# ^ErrorCreating\nS'ha produït un error en crear:\n# ^ErrorDecompressing\nS'ha produït un error en descomprimir les dades! L'instal·lador està corrupte?\n# ^ErrorRegistering\nS'ha produït un error en registrar una DLL\n# ^ExecShell\n\"Executa l'ordre: \"\n# ^Exec\n\"Executa:\"\n# ^Extract\n\"Extreu: \"\n# ^ErrorWriting\n\"Extreu: s'ha produït un error en escriure el fitxer \"\n# ^InvalidOpcode\nL'instal·lador està corrupte: el codi d'operació no és vàlid\n# ^NoOLE\n\"No hi ha OLE per a: \"\n# ^OutputFolder\n\"Carpeta de sortida: \"\n# ^RemoveFolder\n\"Suprimeix la carpeta: \"\n# ^RenameOnReboot\n\"Reanomena en reiniciar: \"\n# ^Rename\n\"Reanomena: \"\n# ^Skipped\n\"S'ha omès: \"\n# ^CopyDetails\nCopia els detalls al porta-retalls\n# ^LogInstall\nRegistra el procés d'instal·lació\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Catalan.nsh",
    "content": "﻿;Language: Catalan (1027)\n;By falanko, corrections by Toni Hermoso Pulido\n\n!insertmacro LANGFILE \"Catalan\" = \"Català\" \"Catala\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Benvinguts a l'auxiliar d'instal·lació de l'aplicació $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Aquest auxiliar us guiarà durant el procés d'instal·lació de l'aplicació $(^NameDA).$\\r$\\n$\\r$\\nEs recomana tancar la resta d'aplicacions abans de començar la instal·lació. Això permetrà al programa d'instal·ació actualitzar fitxers del sistema rellevants sense haver de reiniciar l'ordinador.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Benvinguts a l'auxiliar de desinstal·lació de l'aplicació $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Aquest auxiliar us guiarà a través de la desinstal·lació de l'aplicació $(^NameDA).$\\r$\\n\\rAbans de començar la desinstal·lació, assegureu-vos que l'aplicació $(^NameDA) no s'està executant.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Acord de Llicència\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Reviseu els termes de la llicència abans d'instal·lar l'aplicació $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Si accepteu tots els termes de l'acord, premeu Hi estic d'acord per a continuar. Heu d'acceptar l'acord per a poder instal·lar l'aplicació $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si accepteu tots els termes de l'acord, activeu la casella de sota. Heu d'acceptar l'acord per poder instal·lar l'aplicació $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. Heu d'acceptar l'acord per a poder instal·lar $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Acord de llicència\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Reviseu els termes de la llicència abans de desinstal·lar l'aplicació $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Si accepteu tots els termes de l'acord, premeu Hi estic d'Acord per a continuar. Heu d'acceptar l'acord per a poder desinstal·lar l'aplicació $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si accepteu tots els termes de l'acord, activeu la casella de sota. Heu d'acceptar l'acord per a poder desinstal·lar l'aplicació $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si accepteu tots els termes de l'acord, seleccioneu la primera opció de sota. Heu d'acceptar l'acord per a poder desinstal·lar l'aplicació $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Premeu AvPàg per a veure la resta de l'acord.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Selecció de components\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Seleccioneu quines característiques de l'aplicació $(^NameDA) desitgeu instal·lar.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Selecció de components\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Seleccioneu quines característiques de l'aplicació $(^NameDA) desitgeu desinstal·lar.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descripció\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Situeu el ratolí damunt d'un component per a veure'n la descripció.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Trieu una ubicació d'instal·lació\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Trieu la carpeta on instal·lar-hi l'aplicació $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Trieu la ubicació de desinstal·lació\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Trieu la carpeta d'on desinstal·lar l'aplicació $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"S'està instal·lant\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Si us plau, espereu mentre l'aplicació $(^NameDA) s'instal·la.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"S'ha acabat la instal·lació\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"La instal·lació ha acabat correctament.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"S'ha abandonat la instal·lació\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"La instal·lació no ha acabat correctament.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"S'està desinstal·lant\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Si us plau, espereu mentre l'aplicació $(^NameDA) es desinstal·la.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"S'ha acabat la desinstal·lació\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"La desinstal·lació s'ha realitzat correctament.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"S'ha abandonat la desinstal·lació\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"La desinstal·lació no ha acabat correctament.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"S'està acabant l'auxiliar d'instal·lació de l'aplicació $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"L'aplicació $(^NameDA) s'ha instal·lat a l'ordinador.$\\r$\\n$\\r$\\nFeu clic a Finalitza per a tancar aquest auxiliar.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Cal reiniciar l'ordinador perquè pugui acabar-se la instal·lació de l'aplicació $(^NameDA). Voleu reiniciar-lo ara?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"S'està acabant l'auxiliar de desinstal·lació de l'aplicació $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"L'aplicació $(^NameDA) s'ha desinstal·lat de l'ordinador.$\\r$\\n$\\r$\\nFeu clic a Finalitza per a tancar aquest auxiliar.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Cal reiniciar l'ordinador perquè pugui acabar-se la desinstal·lació de l'aplicació $(^NameDA). Voleu reiniciar-lo ara?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reinicia ara\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Reinicia més tard manualment\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Executa l'aplicació $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Mostra el Llegeix-me\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Finalitza\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Tria la carpeta del menú Inicia\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Tria una carpeta del menú Inicia per a les dreceres de l'aplicació $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Seleccioneu la carpeta del Menú Inicia en la que hi vulgueu crear les dreceres del programa. Podeu introduir-hi un altre nom si voleu crear una carpeta nova.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"No creïs les dreceres\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstal·la l'aplicació $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Suprimeix l'aplicació $(^NameDA) de l'ordinador.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Esteu segur que voleu sortir del programa d'instal·lació de l'aplicació $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Esteu segur que voleu sortir del programa de desinstal·lació de l'aplicació $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Corsican.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1155\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything other than RTL means LTR\n-\n# Translation by Patriccollu di Santa Maria è Sichè - <Patrick.Santa-Maria(AT)laposte.net>\n# Updated on August 9th, 2020 for version 3.06.1\n# Created on April 24th, 2016 for version 3.0rc1\n# Traduzzione corsa creata è mantinuta da Patriccollu di Santa Maria è Sichè\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nAssistente d’installazione di $(^Name)\n# ^UninstallCaption\nDisinstallazione di $(^Name)\n# ^LicenseSubCaption\n: Cuntrattu di licenza\n# ^ComponentsSubCaption\n: Ozzioni d’installazione\n# ^DirSubCaption\n: Cartulare d’installazione\n# ^InstallingSubCaption\n: Installazione in corsu\n# ^CompletedSubCaption\n: Installazione compia\n# ^UnComponentsSubCaption\n: Ozzioni di disinstallazione\n# ^UnDirSubCaption\n: Cartulare di disinstallazione\n# ^ConfirmSubCaption\n: Cunfirmazione\n# ^UninstallingSubCaption\n: Disinstallazione in corsu\n# ^UnCompletedSubCaption\n: Disinstallazione compia\n# ^BackBtn\n< &Precedente\n# ^NextBtn\n&Seguente >\n# ^AgreeBtn\n&Accunsentu\n# ^AcceptBtn\nSò d’&accunsentu cù i termini di u cuntrattu di licenza\n# ^DontAcceptBtn\nÙn sò &micca d’accunsentu cù i termini di u cuntrattu di licenza\n# ^InstallBtn\n&Installà\n# ^UninstallBtn\n&Disinstallà\n# ^CancelBtn\nAbbandunà\n# ^CloseBtn\n&Chjode\n# ^BrowseBtn\n&Sfuglià...\n# ^ShowDetailsBtn\nAffissà i &ditaglii\n# ^ClickNext\nSciglite Seguente per cuntinuà.\n# ^ClickInstall\nSciglite Installà per principià l’installazione.\n# ^ClickUninstall\nSciglite Disinstallà per principià a disinstallazione.\n# ^Name\nNome\n# ^Completed\nCompiu\n# ^LicenseText\nCi vole à leghje u cuntrattu di licenza nanzu d’installà $(^NameDA). S’è voi site d’accunsentu cù tutti i termini di u cuntrattu, sciglite Accunsentu.\n# ^LicenseTextCB\nCi vole à leghje u cuntrattu di licenza nanzu d’installà $(^NameDA). S’è voi site d’accunsentu cù tutti i termini di u cuntrattu, sciglite a casella inghjò. $_CLICK\n# ^LicenseTextRB\nCi vole à leghje u cuntrattu di licenza nanzu d’installà $(^NameDA). S’è voi site d’accunsentu cù tutti i termini di u cuntrattu, sciglite a prima ozzione inghjò. $_CLICK\n# ^UnLicenseText\nCi vole à leghje u cuntrattu di licenza nanzu di disinstallà $(^NameDA). S’è voi site d’accunsentu cù tutti i termini di u cuntrattu, sciglite Accunsentu.\n# ^UnLicenseTextCB\nCi vole à leghje u cuntrattu di licenza nanzu di disinstallà $(^NameDA). S’è voi site d’accunsentu cù tutti i termini di u cuntrattu, sciglite a casella inghjò. $_CLICK\n# ^UnLicenseTextRB\nCi vole à leghje u cuntrattu di licenza nanzu di disinstallà $(^NameDA). S’è voi site d’accunsentu cù tutti i termini di u cuntrattu, sciglite a prima ozzione inghjò. $_CLICK\n# ^Custom\nPersunalizata\n# ^ComponentsText\nSelezziunà i cumpunenti chì voi vulete installà è viutà a casella di quelli ch’ellu ùn ci vole micca à installà. $_CLICK\n# ^ComponentsSubText1\nSelezziunà u tipu d’installazione :\n# ^ComponentsSubText2_NoInstTypes\nSelezziunà i cumpunenti à installà :\n# ^ComponentsSubText2\nOsinnò, selezziunà i cumpunenti addizziunali chì voi vulete installà :\n# ^UnComponentsText\nSelezziunà i cumpunenti chì voi vulete disinstallà è viutà a casella di quelli ch’ellu ùn ci vole à disinstallà. $_CLICK\n# ^UnComponentsSubText1\nSelezziunà u tipu di disinstallazione :\n# ^UnComponentsSubText2_NoInstTypes\nSelezziunà i cumpunenti à disinstallà :\n# ^UnComponentsSubText2\nOsinnò, selezziunà i cumpunenti addizziunali chì voi vulete disinstallà :\n# ^DirText\nL’assistente hà da installà $(^NameDA) in quessu cartulare. Per installà in un altru cartulare, sciglite Sfuglià è selezziunà un altru cartulare. $_CLICK\n# ^DirSubText\nCartulare di destinazione\n# ^DirBrowseText\nSelezziunà u cartulare d’installazione di $(^NameDA) :\n# ^UnDirText\nL’assistente hà da disinstallà $(^NameDA) da quessu cartulare. Per disinstallà da un altru cartulare, sciglite Sfuglià è selezziunà un altru cartulare. $_CLICK\n# ^UnDirSubText\nCartulare d’installazione\n# ^UnDirBrowseText\nSelezziunà u cartulare di disinstallazione di $(^NameDA) :\n# ^SpaceAvailable\nSpaziu dispunibule :\n# ^SpaceRequired\nSpaziu richiestu :\n# ^UninstallingText\n$(^NameDA) serà disinstallatu da quessu cartulare. $_CLICK\n# ^UninstallingSubText\nDisinstallazione da :\n# ^FileError\nSbagliu durante l’accessu in scrittura di u schedariu : \\r\\n\\r\\n$0\\r\\n\\r\\nSciglite Interrompe per piantà l’installazione,\\r\\nTorna per pruvà torna, o\\r\\nIgnurà per ignurà stu schedariu.\n# ^FileError_NoIgnore\nSbagliu durante l’accessu in scrittura di u schedariu : \\r\\n\\r\\n$0\\r\\n\\r\\nSciglite Torna per pruvà torna, o\\r\\nAbbandunà per piantà l’installazione.\n# ^CantWrite\nÙn pò micca scrive :\n# ^CopyFailed\nFiascu di a copia\n# ^CopyTo\nCupià ver di\n# ^Registering\nArregistramentu :\n# ^Unregistering\nDisarregistramentu :\n# ^SymbolNotFound\nImpussibule di truvà un simbolu :\n# ^CouldNotLoad\nImpussibule di caricà :\n# ^CreateFolder\nCreazione di u cartulare :\n# ^CreateShortcut\nCreazione di l’accurtatoghju :\n# ^CreatedUninstaller\nCreazione di l’assistente di disinstallazione :\n# ^Delete\nSquassatura di schedariu :\n# ^DeleteOnReboot\nSquassatura à l’avviu di l’urdinatore :\n# ^ErrorCreatingShortcut\nSbagliu durante a creazione di l’accurtatoghju :\n# ^ErrorCreating\nSbagliu durante a creazione di :\n# ^ErrorDecompressing\nSbagliu durante a scumprezzione di i dati ! Stalladore alteratu ?\n# ^ErrorRegistering\nSbagliu durante l’arregistramentu di DLL\n# ^ExecShell\nExecShell :\n# ^Exec\nEseguisce :\n# ^Extract\nEstrazzione :\n# ^ErrorWriting\nEstrazzione : sbagliu di scrittura ver di u schedariu\n# ^InvalidOpcode\nStalladore alteratu : opcode micca accettevule\n# ^NoOLE\nAlcunu OLE per :\n# ^OutputFolder\nCartulare di destinazione :\n# ^RemoveFolder\nCacciatura di u cartulare :\n# ^RenameOnReboot\nRinumà à l’avviu di l’urdinatore :\n# ^Rename\nRinumà :\n# ^Skipped\nTralasciatu :\n# ^CopyDetails\nCupià i detaglii ver di u preme’papei\n# ^LogInstall\nArregistrà u ghjurnale d’installazione\n# ^Byte\no\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Corsican.nsh",
    "content": "﻿/*\n** Language: Corsican (1155)\n** Traduzzione corsa da Patriccollu di Santa Maria è Sichè - <Patrick.Santa-Maria(AT)laposte.net>\n** ISO 639-1: co\n** ISO 639-2: cos\n*/\n\n!insertmacro LANGFILE \"Corsican\" \"Corsican\" \"Corsu\" \"Corsu\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Benvenuta in l’assistente d’installazione di $(^NameDA)m\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"L’assistente d’installazione hà da aiutavvi à installà $(^NameDA).$\\r$\\n$\\r$\\nHè ricumandatu di chjode tutte l’altre appiecazioni nanzu di avvià st’assistente. Quessu permetterà di mudificà i schedarii di u sistema senza riavvià l’urdinatore.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Benvenuta in l’assistente di disinstallazione di $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"L’assistente hà da aiutavvi à disinstallà $(^NameDA).$\\r$\\n$\\r$\\nNanzu di principià a disinstallazione, ci vole à assicurassi chì $(^NameDA) ùn sia micca in funzione.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Cuntrattu di licenza\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Ci vole à leghje i termini di a licenza nanzu d’installà $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"S’è voi site d’accunsentu cù i termini di u cuntrattu, sciglite Accunsentu per cuntinuà. Ci vole à accettà u cuntrattu per installà $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"S’è voi site d’accunsentu cù i termini di u cuntrattu, sciglite a casella inghjò. Ci vole à accettà u cuntrattu per installà $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"S’è voi site d’accunsentu cù i termini di u cuntrattu, sciglite a prima ozzione inghjò. Ci vole à accettà u cuntrattu per installà $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Cuntrattu di licenza\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Ci vole à leghje i termini di a licenza nanzu di disinstallà $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"S’è voi site d’accunsentu cù i termini di u cuntrattu, sciglite Accunsentu per cuntinuà. Ci vole à accettà u cuntrattu per disinstallà $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"S’è voi site d’accunsentu cù i termini di u cuntrattu, sciglite a casella inghjò. Ci vole à accettà u cuntrattu per disinstallà $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"S’è voi site d’accunsentu cù i termini di u cuntrattu, sciglite a prima ozzione inghjò. Ci vole à accettà u cuntrattu per disinstallà $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Sciglite Pagina Seguente per fighjà a seguita di u ducumentu.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Sciglite i cumpunenti\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Sciglite e funzioni di $(^NameDA) chì voi vulete installà.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Sciglite i cumpunenti\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Sciglite e funzioni di $(^NameDA) chì voi vulete disinstallà.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Discrizzione\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Piazzà u topu nant’à un cumpunentu per fighjà a so discrizzione.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Selezziunà un cumpunentu per fighjà a so discrizzione.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Sciglite u cartulare d’installazione\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Sciglite u cartulare induve installà $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Sciglite u cartulare di disinstallazione\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Sciglite u cartulare di disinstallazione di $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installazione in corsu\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Aspettate per piacè chì $(^NameDA) sia installatu.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installazione compia\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"L’installazione hè compia bè.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installazione interrotta\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"L’installazione ùn hè micca compia bè.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Disinstallazione in corsu\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Aspettate per piacè chì $(^NameDA) sia disinstallatu.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Disinstallazione compia\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"A disinstallazione hè compia bè.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Disinstallazione interrotta\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"A disinstallazione ùn hè micca compia bè.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Fine d’installazione di $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) hè statu installatu nant’à l’urdinatore.$\\r$\\n$\\r$\\nSciglite Piantà per chjode l’assistente.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"L’urdinatore deve esse piantatu è rilanciatu per compie l’installazione di $(^NameDA). Vulete piantalu è rilancialu avà ?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Fine di disinstallazione di $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) hè statu disinstallatu da l’urdinatore.$\\r$\\n$\\r$\\nSciglite Piantà per chjode l’assistente.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"L’urdinatore deve esse piantatu è rilanciatu per compie a disinstallazione di $(^NameDA). Vulete piantalu è rilancialu avà ?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Rilancià subitu\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Vogliu fallu dopu dapermè\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Eseguisce $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Affissà u schedariu LisezMoi/Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Piantà\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Sciglite un cartulare in u listinu « Démarrer »\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Sciglite un cartulare in u listinu « Démarrer » per l’accurtatoghjii di $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Sciglite un cartulare in u listinu « Démarrer » induve l’accurtatoghjii di u prugramma seranu creati. Pudete dinù scrive un nome per creà un novu cartulare.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ùn creà micca d’accurtatoghji\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Disinstallà $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Caccià $(^NameDA) da l’urdinatore.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Site sicuru di vulè chità l’assistente d’installazione di $(^Name) ?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Site sicuru di vulè chità l’assistente di disinstallazione di $(^Name) ?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Scelta di l’utilizatori\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Sciglite l’utilizatori chì puderanu impiegà $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Selezziunà s’èllu ci vole à installà $(^NameDA) solu per voi o per tutti l’utilizatori di l’urdinatore. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installà per tutti l’utilizatori di l’urdinatore\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installà solu per mè\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Croatian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1050\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Igor Ostriz\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalacija programa $(^Name)\n# ^UninstallCaption\nUklanjanje programa $(^Name)\n# ^LicenseSubCaption\n: Uvjeti Ugovora o licenci\n# ^ComponentsSubCaption\n: Instalacijske opcije\n# ^DirSubCaption\n: Instalacijska mapa\n# ^InstallingSubCaption\n: Instaliranje\n# ^CompletedSubCaption\n: Završeno\n# ^UnComponentsSubCaption\n: Opcije uklanjanja\n# ^UnDirSubCaption\n: Mapa uklanjanja\n# ^ConfirmSubCaption\n: Potvrda\n# ^UninstallingSubCaption\n: Uklanjanje\n# ^UnCompletedSubCaption\n: Završeno\n# ^BackBtn\n< &Natrag\n# ^NextBtn\n&Dalje >\n# ^AgreeBtn\n&Prihvaćam\n# ^AcceptBtn\n&Prihvaćam uvjete Ugovora o licenci\n# ^DontAcceptBtn\n&Ne prihvaćam uvjete Ugovora o licenci\n# ^InstallBtn\n&Instaliraj\n# ^UninstallBtn\n&Ukloni\n# ^CancelBtn\nOdustani\n# ^CloseBtn\n&Zatvori\n# ^BrowseBtn\n&Pregledaj...\n# ^ShowDetailsBtn\nPrikaži &detalje\n# ^ClickNext\nZa nastavak odaberite 'Dalje'.\n# ^ClickInstall\nZa početak instalacije odaberite 'Instaliraj'.\n# ^ClickUninstall\nZa početak uklanjanja odaberite 'Ukloni'.\n# ^Name\nIme\n# ^Completed\nZavršeno\n# ^LicenseText\nPročitajte licencu prije instalacije programa $(^NameDA). Ukoliko prihvaćate sve uvjete ugovora, odaberite 'Prihvaćam'.\n# ^LicenseTextCB\nPročitajte licencu prije instalacije programa $(^NameDA). Ukoliko prihvaćate sve uvjete ugovora, označite donji kvadratić. $_CLICK\n# ^LicenseTextRB\nPročitajte licencu prije instalacije programa $(^NameDA). Ukoliko prihvaćate sve uvjete ugovora, odaberite prvu donju opciju. $_CLICK\n# ^UnLicenseText\nPročitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvaćate sve uvjete ugovora, odaberite 'Prihvaćam'.\n# ^UnLicenseTextCB\nPročitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvaćate sve uvjete ugovora, označite donji kvadratić. $_CLICK\n# ^UnLicenseTextRB\nPročitajte licencu prije uklanjanja programa $(^NameDA). Ukoliko prihvaćate sve uvjete ugovora, odaberite prvu donju opciju. $_CLICK\n# ^Custom\nPosebna\n# ^ComponentsText\nOznačite komponente koje želite instalirati i uklonite oznaku s onih koje ne želite instalirati. $_CLICK\n# ^ComponentsSubText1\nIzaberite tip instalacije:\n# ^ComponentsSubText2_NoInstTypes\nOdaberite komponente za instalaciju:\n# ^ComponentsSubText2\nIli po izboru označite komponente koje želite instalirati:\n# ^UnComponentsText\nOznačite komponente koje želite ukloniti i uklonite oznaku s onih koje ne želite ukloniti. $_CLICK\n# ^UnComponentsSubText1\nIzaberite tip uklanjanja:\n# ^UnComponentsSubText2_NoInstTypes\nOdaberite komponente za uklanjanje:\n# ^UnComponentsSubText2\nIli po izboru označite komponente koje želite ukloniti:\n# ^DirText\nProgram $(^NameDA) bit će instaliran u sljedeću mapu. Ako želite promijeniti odredište, pritisnite dugme za traženje mape i označite drugu mapu. $_CLICK\n# ^DirSubText\nOdredišna mapa\n# ^DirBrowseText\nOdaberite mapu u koju želite instalirati program $(^NameDA):\n# ^UnDirText\nProgram $(^NameDA) bit će uklonjen iz sljedeće mape. Za uklanjanje s drugog mjesta odaberite 'Pregledaj' i označite drugu mapu. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nMapa iz koje će program $(^NameDA) biti uklonjen:\n# ^SpaceAvailable\n\"Slobodno prostora na disku: \"\n# ^SpaceRequired\n\"Potrebno prostora na disku: \"\n# ^UninstallingText\nProgram $(^NameDA) bit će uklonjen iz sljedeće mape. $_CLICK\n# ^UninstallingSubText\nUklanjam iz:\n# ^FileError\nGreška prilikom otvaranja datoteke za zapisivanje: \\r\\n\\r\\n$0\\r\\n\\r\\nPritisnite \"Abort\" ako želite prekinuti instalaciju,\\r\\n\"Retry\" ako želite pokušati ponovno, ili\\r\\n\"Ignore\" ako želite zanemariti tu datoteku\n# ^FileError_NoIgnore\nGreška prilikom otvaranja datoteke za zapisivanje: \\r\\n\\r\\n$0\\r\\n\\r\\nPritisnite \"Retry\" za ponovni pokušaj zapisivanja, ili\\r\\n\"Cancel\" za prekid instalacije\n# ^CantWrite\n\"Ne mogu zapisati: \"\n# ^CopyFailed\nGreška prilikom kopiranja\n# ^CopyTo\n\"Kopiraj u \"\n# ^Registering\n\"Prijava: \"\n# ^Unregistering\n\"Odjava: \"\n# ^SymbolNotFound\n\"Ne mogu naći simbol: \"\n# ^CouldNotLoad\n\"Ne mogu učitati: \"\n# ^CreateFolder\n\"Stvori mapu: \"\n# ^CreateShortcut\n\"Stvori prečac: \"\n# ^CreatedUninstaller\n\"Program za uklanjanje: \"\n# ^Delete\n\"Izbriši datoteku: \"\n# ^DeleteOnReboot\n\"Izbriši prilikom ponovnog pokretanja: \"\n# ^ErrorCreatingShortcut\n\"Greška prilikom stvaranja prečaca: \"\n# ^ErrorCreating\n\"Greška prilikom stvaranja: \"\n# ^ErrorDecompressing\nGreška dekompresije podataka! Oštećena instalacijska datoteka?\n# ^ErrorRegistering\nGreška prilikom prijavljivanja DLL-a\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Izvrši: \"\n# ^Extract\n\"Otpakiraj: \"\n# ^ErrorWriting\n\"Otpakiranje: greška zapisivanja u datoteku \"\n# ^InvalidOpcode\nOštećena instalacijska datoteka: neispravan opkod\n# ^NoOLE\n\"Nema OLE za: \"\n# ^OutputFolder\n\"Izlazna mapa: \"\n# ^RemoveFolder\n\"Izbriši mapu: \"\n# ^RenameOnReboot\n\"Preimenuj prilikom ponovnog pokretanja: \"\n# ^Rename\n\"Preimenuj: \"\n# ^Skipped\n\"Preskočeno: \"\n# ^CopyDetails\nKopiraj detalje u međuspremnik\n# ^LogInstall\nLogiraj instalacijski proces\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Croatian.nsh",
    "content": "﻿;Language: Croatian (1050)\n;By Igor Ostriz\n\n!insertmacro LANGFILE \"Croatian\" = \"Hrvatski\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Dobrodošli u instalaciju programa $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Instalacija programa $(^NameDA) na Vaše računalo sastoji se od nekoliko jednostavnih koraka kroz koje će Vas provesti ovaj čarobnjak.$\\r$\\n$\\r$\\nPreporučamo zatvaranje svih ostalih aplikacija prije samog početka instalacije. To će omogućiti nadogradnju nekih sistemskih datoteka bez potrebe za ponovnim pokretanjem Vašeg računala. U svakom trenutku instalaciju možete prekinuti pritiskom na 'Odustani'.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Dobrodošli u postupak uklanjanja programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ovaj će Vas čarobnjak provesti kroz postupak uklanjanja programa $(^NameDA).$\\r$\\n$\\r$\\nPrije samog početka, molim zatvorite program $(^NameDA) ukoliko je slučajno otvoren.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Ugovor o licenci\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Pročitajte licencu prije instalacije programa $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ako prihvaćate uvjete licence, pritisnite 'Prihvaćam' za nastavak. Da biste instalirali program $(^NameDA), morate prihvatiti licencu.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ukoliko prihvaćate uvjete licence, označite donji kvadratić. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ukoliko prihvaćate uvjete licence, odaberite prvu donju opciju. Morate prihvatiti licencu za instalaciju programa $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Ugovor o licenci\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Pročitajte licencu prije uklanjanja programa $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ako prihvaćate uvjete licence, pritisnite 'Prihvaćam' za nastavak. Da biste instalirali program $(^NameDA), morate prihvatiti licencu.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ukoliko prihvaćate uvjete licence, označite donji kvadratić. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ukoliko prihvaćate uvjete licence, odaberite prvu donju opciju. Morate prihvatiti licencu za uklanjanje programa $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Služite se tipkom 'Page Down' da biste vidjeli ostatak licence.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Izbor komponenti\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Odaberite komponente programa $(^NameDA) koje želite instalirati.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Izbor komponenti\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Odaberite koje komponente programa $(^NameDA) želite ukloniti.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Opis\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Postavite pokazivač iznad komponente za njezin opis.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Označite komponentu za njezin opis.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Odaberite odredište za instalaciju\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Odaberite mapu u koju želite instalirati program $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Odaberite polazište za uklanjanje\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Odaberite mapu iz koje želite ukloniti program $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalacija u tijeku...\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Pričekajte završetak instalacije programa $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Kraj instalacije\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Instalacija je u potpunosti završila uspješno.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalacija je prekinuta\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Instalacija nije završila uspješno.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Uklanjanje u tijeku...\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Pričekajte završetak uklanjanja programa $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Uklanjanje završeno\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Uklanjanje je u potpunosti završilo uspješno.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Uklanjanje je prekinuto\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Uklanjanje nije završilo uspješno.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Dovršetak instalacije programa $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Program $(^NameDA) upravo je instaliran.$\\r$\\n$\\r$\\nOdaberite 'Kraj' za završetak.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Da bi se dovršila instalacija programa $(^NameDA), trebate ponovno pokrenuti računalo. Želite li to učiniti sada?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Završetak uklanjanja programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Program $(^NameDA) uklonjen je s Vašeg računala.$\\r$\\n$\\r$\\nOdaberite 'Kraj' za zatvaranje ovog čarobnjaka.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Da bi se dovršio postupka uklanjanja programa $(^NameDA), trebate ponovno pokrenuti računalo. Želite li to učiniti sada?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Ponovno pokreni računalo sada\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ponovno ću pokrenuti računalo kasnije\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Pokreni program $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Otvori datoteku '&Readme'\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Kraj\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Izbor mape u izborniku 'Start'\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Odaberite ime za programsku mapu unutar izbornika 'Start'.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Program će pripadati odabranoj programskoj mapi u izborniku 'Start'. Možete odrediti novo ime za mapu ili odabrati već postojeću.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nemoj napraviti prečace\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Uklanjanje programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Program $(^NameDA) bit će uklonjen s Vašeg računala.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Jeste li sigurni da želite prekinuti instalaciju programa $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Jeste li sigurni da želite prekinuti uklanjanje programa $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Czech.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1029\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Václav Pavlíček (v.pavlicek@centrum.cz), dříve SELiCE\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalace $(^Name)\n# ^UninstallCaption\nOdinstalace $(^Name)\n# ^LicenseSubCaption\n: Licenční smlouva\n# ^ComponentsSubCaption\n: Možnosti instalace\n# ^DirSubCaption\n: Instalační složka\n# ^InstallingSubCaption\n: Instalace\n# ^CompletedSubCaption\n: Dokončeno\n# ^UnComponentsSubCaption\n: Možnosti odinstalace\n# ^UnDirSubCaption\n: Odinstalační složka\n# ^ConfirmSubCaption\n: Potvrzení\n# ^UninstallingSubCaption\n: Odinstalace\n# ^UnCompletedSubCaption\n: Dokončeno\n# ^BackBtn\n< &Zpět\n# ^NextBtn\n&Další >\n# ^AgreeBtn\nSouhl&asím\n# ^AcceptBtn\nSouhl&asím s podmínkami licenční smlouvy\n# ^DontAcceptBtn\n&Nesouhlasím s podmínkami licenční smlouvy\n# ^InstallBtn\n&Instalovat\n# ^UninstallBtn\n&Odinstalovat\n# ^CancelBtn\nStorno\n# ^CloseBtn\n&Zavřít\n# ^BrowseBtn\nP&rocházet...\n# ^ShowDetailsBtn\n&Podrobnosti\n# ^ClickNext\nPokračujte kliknutím na tlačítko Další.\n# ^ClickInstall\nInstalaci spustíte kliknutím na tlačítko Instalovat.\n# ^ClickUninstall\nOdinstalaci spustíte kliknutím na tlačítko Odinstalovat.\n# ^Name\nNázev\n# ^Completed\nDokončeno\n# ^LicenseText\nPřed instalací programu $(^NameDA) si prosím přečtěte licenční smlouvu. Jestliže souhlasíte s podmínkami této smlouvy, klikněte na tlačítko Souhlasím.\n# ^LicenseTextCB\nPřed instalací programu $(^NameDA) si prosím přečtěte licenční smlouvu. Jestliže souhlasíte s podmínkami této smlouvy, zaškrtněte políčko níže. $_CLICK\n# ^LicenseTextRB\nPřed instalací programu $(^NameDA) si prosím přečtěte licenční smlouvu. Jestliže souhlasíte s podmínkami této smlouvy, vyberte níže první možnost. $_CLICK\n# ^UnLicenseText\nPřed odinstalací programu $(^NameDA) si prosím přečtěte licenční smlouvu. Jestliže souhlasíte s podmínkami této smlouvy, klikněte na tlačítko Souhlasím.\n# ^UnLicenseTextCB\nPřed odinstalací programu $(^NameDA) si prosím přečtěte licenční smlouvu. Jestliže souhlasíte s podmínkami této smlouvy, zaškrtněte políčko níže. $_CLICK\n# ^UnLicenseTextRB\nPřed odinstalací programu $(^NameDA) si prosím přečtěte licenční smlouvu. Jestliže souhlasíte s podmínkami této smlouvy, vyberte níže první možnost. $_CLICK\n# ^Custom\nVlastní\n# ^ComponentsText\nZaškrtněte součásti, které chcete nainstalovat a zrušte zaškrtnutí součástí, které nechcete nainstalovat. $_CLICK\n# ^ComponentsSubText1\nZvolte způsob instalace:\n# ^ComponentsSubText2_NoInstTypes\nVyberte součásti, které chcete nainstalovat.\n# ^ComponentsSubText2\nNebo vyberte volitelné součásti, které chcete nainstalovat.\n# ^UnComponentsText\nZaškrtněte součásti, které chcete odinstalovat a zrušte zaškrtnutí součástí, které nechcete odinstalovat. $_CLICK\n# ^UnComponentsSubText1\nZvolte způsob odinstalace:\n# ^UnComponentsSubText2_NoInstTypes\nVyberte součásti, které chcete odinstalovat.\n# ^UnComponentsSubText2\nNebo vyberte volitelné součásti, které chcete odinstalovat.\n# ^DirText\nInstalační program nainstaluje program $(^NameDA) do následující složky. Chcete-li instalovat do jiné složky, klikněte na tlačítko Procházet a vyberte jinou složku. $_CLICK\n# ^DirSubText\nCílová složka\n# ^DirBrowseText\nVýběr instalační složky programu $(^NameDA).\n# ^UnDirText\nOdinstalační program odinstaluje program $(^NameDA) z následující složky. Chcete-li odinstalovat z jiné složky, klikněte na tlačítko Procházet a vyberte jinou složku. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nVyberte odinstalační složku programu $(^NameDA):\n# ^SpaceAvailable\n\"Volné místo: \"\n# ^SpaceRequired\n\"Požadované místo: \"\n# ^UninstallingText\nProgram $(^NameDA) bude odinstalován z následující složky. $_CLICK\n# ^UninstallingSubText\nOdinstalovat z:\n# ^FileError\nSoubor nelze otevřít pro zápis: \\r\\n\\t\"$0\"\\r\\nKlikněte na tlačítko Přerušit k ukončení instalace,\\r\\nnebo na tlačítko Opakovat k zopakování akce, nebo\\r\\n na tlačítko Ignorovat k přeskočení souboru.\n# ^FileError_NoIgnore\nSoubor nelze otevřít pro zápis: \\r\\n\\t\"$0\"\\r\\nKlikněte na tlačítko Opakovat k zopakování akce, nebo\\r\\n na tlačítko Storno k ukončení instalace.\n# ^CantWrite\n\"Nelze zapsat: \"\n# ^CopyFailed\nKopírování se nezdařilo.\n# ^CopyTo\n\"Kopírování do \"\n# ^Registering\n\"Registrace: \"\n# ^Unregistering\n\"Rušení registrace: \"\n# ^SymbolNotFound\n\"Nelze najít symbol: \"\n# ^CouldNotLoad\n\"Nelze načíst: \"\n# ^CreateFolder\n\"Vytváření složky: \"\n# ^CreateShortcut\n\"Vytváření zástupce: \"\n# ^CreatedUninstaller\n\"Vytváření odinstalačního programu: \"\n# ^Delete\n\"Odstraňování souboru: \"\n# ^DeleteOnReboot\n\"Odstranit při restartování: \"\n# ^ErrorCreatingShortcut\n\"Při vytváření zástupce došlo k chybě: \"\n# ^ErrorCreating\n\"Při vytváření došlo k chybě: \"\n# ^ErrorDecompressing\nPři dekompresi dat došlo k chybě. Byl poškozen instalační program?\n# ^ErrorRegistering\nPři registraci souborů DLL došlo k chybě.\n# ^ExecShell\n\"Spouštění prostředí: \"\n# ^Exec\n\"Spouštění: \"\n# ^Extract\n\"Extrahování: \"\n# ^ErrorWriting\n\"Extrakce: Při zápisu souboru došlo k chybě \"\n# ^InvalidOpcode\nInstalační program byl poškozen: neplatný operační kód.\n# ^NoOLE\n\"Nedostupné OLE pro: \"\n# ^OutputFolder\n\"Výstupní složka: \"\n# ^RemoveFolder\n\"Odstraňování složky: \"\n# ^RenameOnReboot\n\"Přejmenovat při restartování: \"\n# ^Rename\n\"Přejmenováno: \"\n# ^Skipped\n\"Přeskočeno: \"\n# ^CopyDetails\nZkopírovat podrobnosti do schránky\n# ^LogInstall\nProtokolovat proces instalace\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Czech.nsh",
    "content": "﻿;Language: Czech (1029)\n;By Václav Pavlíček (v.pavlicek@centrum.cz), dříve SELiCE\n\n!insertmacro LANGFILE \"Czech\" = \"Čeština\" \"Cestina\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Vítejte v průvodci instalace programu $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Tento průvodce vás provede instalací programu $(^NameDA).$\\r$\\n$\\r$\\nPřed spuštěním instalačního programu je doporučeno ukončit všechny ostatní aplikace. Umožní to aktualizovat související systémové soubory bez restartování počítače.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Vítejte v průvodci odinstalace programu $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Tento průvodce vás provede odinstalací programu $(^NameDA).$\\r$\\n$\\r$\\nPřed spuštěním odinstalace se přesvědčte, zda program $(^NameDA) není spuštěn.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licenční smlouva\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Před instalací programu $(^NameDA) si prosím projděte licenční podmínky.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Jestliže souhlasíte s podmínkami smlouvy, klikněte na tlačítko Souhlasím. Chcete-li nainstalovat program $(^NameDA), je nutné s touto smlouvou souhlasit.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jestliže souhlasíte s podmínkami smlouvy, zaškrtněte políčko níže. Chcete-li nainstalovat program $(^NameDA), je nutné s touto smlouvou souhlasit. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jestliže souhlasíte s podmínkami smlouvy, vyberte níže první možnost. Chcete-li nainstalovat program $(^NameDA), je nutné s touto smlouvou souhlasit. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licenční smlouva\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Před odinstalací programu $(^NameDA) si prosím projděte licenční podmínky.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Jestliže souhlasíte s podmínkami smlouvy, klikněte na tlačítko Souhlasím. Chcete-li odinstalovat program $(^NameDA), je nutné s touto smlouvou souhlasit.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jestliže souhlasíte s podmínkami smlouvy, zaškrtněte políčko níže. Chcete-li odinstalovat program $(^NameDA), je nutné s touto smlouvou souhlasit. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jestliže souhlasíte s podmínkami smlouvy, vyberte níže první možnost. Chcete-li odinstalovat program $(^NameDA), je nutné s touto smlouvou souhlasit. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Zbytek textu zobrazíte stisknutím klávesy Page Down.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Volba součástí\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Výběr součástí programu $(^NameDA) pro instalaci.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Volba součástí\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Výběr součástí programu $(^NameDA) pro odinstalaci.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Popis\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Chcete-li zobrazit popis součásti, umístěte na ní ukazatel myši.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Chcete-li zobrazit popis součásti, vyberte ji.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Volba umístění instalace\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Výběr instalační složky programu $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Volba umístění odinstalace\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Výběr odinstalační složky programu $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalace\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Počkejte prosím na dokončení instalace programu $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalace dokončena\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Instalace byla úspěšně dokončena.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalace přerušena\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Instalace nebyla úspěšně dokončena.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Odinstalace\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Počkejte prosím na dokončení odinstalace programu $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Odinstalace dokončena\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Odinstalace byla úspěšně dokončena.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Odinstalace přerušena\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Odinstalace nebyla úspěšně dokončena.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Dokončení instalace programu $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Program $(^NameDA) byl nainstalován do počítače.$\\r$\\n$\\r$\\nKliknutím na tlačítko Dokončit ukončíte tohoto průvodce.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"K dokončení instalace programu $(^NameDA) je nutné restartovat počítač. Chcete jej restartovat nyní?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Dokončení odinstalace programu $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Program $(^NameDA) byl odinstalován z počítače.$\\r$\\n$\\r$\\nKliknutím na tlačítko Dokončit ukončíte tohoto průvodce.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"K dokončení odinstalace $(^NameDA) je nutné restartovat počítač. Chcete jej restartovat nyní?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Restartovat nyní\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Restartovat později ručně\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Spustit program $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Zobrazit soubor Readme (Čti mě)\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Dokončit\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Volba složky v Nabídce Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Výběr složky v Nabídce Start pro zástupce programu $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Vyberte složku v Nabídce Start, ve které chcete vytvořit zástupce programu. Chcete-li vytvořit novou složku, zadejte její název.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nevytvořit zástupce\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Odinstalace programu $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Odebere program $(^NameDA) z počítače.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Opravdu chcete instalaci programu $(^Name) ukončit?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Opravdu chcete odinstalaci programu $(^Name) ukončit?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Volba uživatelů\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Výběr uživatelů, kterým bude program $(^NameDA) nainstalován.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Vyberte, zda chcete program $(^NameDA) nainstalovat pouze pro sebe, nebo pro všechny uživatele počítače. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instalovat pro všechny uživatele počítače\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instalovat pouze pro sebe\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Danish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1030\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Claus Futtrup, scootergrisen\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Installation\n# ^UninstallCaption\n$(^Name) Afinstallation\n# ^LicenseSubCaption\n: Licensaftale\n# ^ComponentsSubCaption\n: Installationsvalgmuligheder\n# ^DirSubCaption\n: Installationsmappe\n# ^InstallingSubCaption\n: Installerer\n# ^CompletedSubCaption\n: Gennemført\n# ^UnComponentsSubCaption\n: Afinstallationsvalgmuligheder\n# ^UnDirSubCaption\n: Afinstallationsmappe\n# ^ConfirmSubCaption\n: Bekræft\n# ^UninstallingSubCaption\n: Afinstallerer\n# ^UnCompletedSubCaption\n: Gennemført\n# ^BackBtn\n< &Tilbage\n# ^NextBtn\n&Næste >\n# ^AgreeBtn\nJeg &accepterer\n# ^AcceptBtn\nJeg &accepterer vilkårene i licensaftalen\n# ^DontAcceptBtn\nJeg &accepterer ikke vilkårene i licensaftalen\n# ^InstallBtn\n&Installer\n# ^UninstallBtn\n&Afinstaller\n# ^CancelBtn\nAnnuller\n# ^CloseBtn\n&Luk\n# ^BrowseBtn\nG&ennemse...\n# ^ShowDetailsBtn\nVis &detaljer\n# ^ClickNext\nTryk på Næste for at fortsætte.\n# ^ClickInstall\nTryk på Installer for at starte installationen.\n# ^ClickUninstall\nTryk på Afinstaller for at starte afinstallationen.\n# ^Name\nNavn\n# ^Completed\nGennemført\n# ^LicenseText\nGennemlæs venligst licensaftalen før installationen af $(^NameDA). Hvis du accepterer alle vilkår i aftalen, skal du klikke på Jeg accepterer.\n# ^LicenseTextCB\nGennemlæs venligst licensaftalen før installationen af $(^NameDA). Hvis du accepterer alle vilkår i aftalen, skal du klikke på afkrydsningsfeltet nedenfor. $_CLICK\n# ^LicenseTextRB\nGennemlæs venligst licensaftalen før installationen af $(^NameDA). Hvis du accepterer alle vilkår i aftalen, skal du vælge den første valgmulighed nedenfor. $_CLICK\n# ^UnLicenseText\nGennemlæs venligst licensaftalen før afinstallationen af $(^NameDA). Hvis du accepterer alle vilkår i aftalen, skal du trykke på Jeg accepterer.\n# ^UnLicenseTextCB\nGennemlæs venligst licensaftalen før afinstallationen af $(^NameDA). Hvis du accepterer alle vilkår i aftalen, skal du klikke på afkrydsningsfeltet nedenfor. $_CLICK\n# ^UnLicenseTextRB\nGennemlæs venligst licensaftalen før afinstallationen af $(^NameDA). Hvis du accepterer alle vilkår i aftalen, skal du vælge den første valgmulighed nedenfor. $_CLICK\n# ^Custom\nBrugerdefineret\n# ^ComponentsText\nTilvælg de komponenter du vil installere, og fravælg de komponenter du ikke vil installere. $_CLICK\n# ^ComponentsSubText1\nVælg installationstype:\n# ^ComponentsSubText2_NoInstTypes\nVælg de komponenter der skal installeres:\n# ^ComponentsSubText2\nEller vælg de valgfrie komponenter du ønsker at installere:\n# ^UnComponentsText\nTilvælg de komponenter du vil afinstallere, og fravælg de komponenter du ikke vil afinstallere. $_CLICK\n# ^UnComponentsSubText1\nVælg afinstallationstype:\n# ^UnComponentsSubText2_NoInstTypes\nVælg de komponenter der skal afinstalleres:\n# ^UnComponentsSubText2\nEller vælg de valgfrie komponenter du ønsker at afinstallere:\n# ^DirText\nInstallationsguiden vil installere $(^NameDA) i følgende mappe. For at installere i en anden mappe, tryk på Gennemse og vælg en anden mappe. $_CLICK\n# ^DirSubText\nDestinationsmappe\n# ^DirBrowseText\nVælg den mappe hvori $(^NameDA) skal installeres:\n# ^UnDirText\nInstallationsguiden vil afinstallere $(^NameDA) fra følgende mappe. For at afinstallere fra en anden mappe, tryk på Gennemse og vælg en anden mappe. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nVælg den mappe hvorfra $(^NameDA) skal afinstalleres:\n# ^SpaceAvailable\n\"Ledig plads: \"\n# ^SpaceRequired\n\"Nødvendig plads: \"\n# ^UninstallingText\n$(^NameDA) vil blive afinstalleret fra følgende mappe. $_CLICK\n# ^UninstallingSubText\nAfinstallerer fra:\n# ^FileError\nFejl ved skrivning af fil til skrivning: \\r\\n\\r\\n$0\\r\\n\\r\\nTryk på Annuller for at stoppe installationen,\\r\\nPrøv igen for at prøve igen, eller\\r\\nIgnorer for at springe over denne fil.\n# ^FileError_NoIgnore\nFejl ved åbning af fil til skrivning: \\r\\n\\r\\n$0\\r\\n\\r\\nTryk på Prøv igen for at prøve igen, eller\\r\\nAnnuller for at stoppe installationen.\n# ^CantWrite\n\"Kan ikke skrive: \"\n# ^CopyFailed\nKopiering mislykkedes\n# ^CopyTo\n\"Kopier til \"\n# ^Registering\n\"Registrerer: \"\n# ^Unregistering\n\"Afregisterer: \"\n# ^SymbolNotFound\n\"Kunne ikke finde symbol: \"\n# ^CouldNotLoad\n\"Kunne ikke indlæse: \"\n# ^CreateFolder\n\"Opret mappe: \"\n# ^CreateShortcut\n\"Opret genvej: \"\n# ^CreatedUninstaller\n\"Afinstallationsguide oprettet: \"\n# ^Delete\n\"Slet fil: \"\n# ^DeleteOnReboot\n\"Slet ved genstart: \"\n# ^ErrorCreatingShortcut\n\"Fejl ved oprettelse af genvej: \"\n# ^ErrorCreating\n\"Fejl ved oprettelse: \"\n# ^ErrorDecompressing\nFejl ved udpakning af data! Beskadiget installationsguide?\n# ^ErrorRegistering\nFejl ved registrering af DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Kør: \"\n# ^Extract\n\"Udpak: \"\n# ^ErrorWriting\n\"Udpak: fejl ved skrivning til fil \"\n# ^InvalidOpcode\nBeskadiget installationsguide: ugyldig opcode\n# ^NoOLE\n\"Ingen OLE for: \"\n# ^OutputFolder\n\"Outputmappe: \"\n# ^RemoveFolder\n\"Slet mappe: \"\n# ^RenameOnReboot\n\"Omdøb ved genstart: \"\n# ^Rename\n\"Omdøb: \"\n# ^Skipped\n\"Sprunget over: \"\n# ^CopyDetails\nKopier detaljer til udklipsholderen\n# ^LogInstall\nLog installationsproces\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Danish.nsh",
    "content": "﻿;Language: Danish (1030)\n;By Claus Futtrup, scootergrisen\n\n!insertmacro LANGFILE \"Danish\" = \"Dansk\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Velkommen til installationsguiden for $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Denne guide hjælper dig gennem installationen af $(^NameDA).$\\r$\\n$\\r$\\nDet anbefales, at du lukker alle kørende programmer inden start af installationsguiden. Det gør det muligt at opdatere de nødvendige systemfiler uden at skulle genstarte din computer.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Velkommen til $(^NameDA) afinstallationsguiden\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Denne guide hjælper dig gennem afinstallationen af $(^NameDA).$\\r$\\n$\\r$\\nFør start af afinstallationen skal du være sikker på at $(^NameDA) ikke kører.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licensaftale\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Læs venligst licensaftalen før installationen af $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Hvis du accepterer vilkårene i aftalen, skal du klikke på Jeg accepterer for at fortsætte. Du skal acceptere aftalen for at installere $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Hvis du accepterer vilkårene i aftalen, skal du klikke på afkrydsningsfeltet nedenfor. Du skal acceptere aftalen for at installere $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Hvis du accepterer vilkårene i aftalen, skal du vælge den første valgmulighed nedenfor. Du skal acceptere aftalen for at installere $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licensaftale\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Læs venligst licensaftalen før afinstallationen af $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Hvis du accepterer vilkårene i aftalen, skal du klikke på Jeg accepterer for at fortsætte. Du skal acceptere aftalen for at afinstallere $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Hvis du accepterer vilkårene i aftalen, skal du klikke på afkrydsningsfeltet nedenfor. Du skal acceptere aftalen for at afinstallere $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Hvis du accepterer vilkårene i aftalen, skal du vælge den første valgmulighed nedenfor. Du skal acceptere aftalen for at afinstallere $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Tryk på Page Down for at se resten af aftalen.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Vælg komponenter\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Vælg hvilke faciliteter af $(^NameDA) du vil installere.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Vælg komponenter\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Vælg hvilke faciliteter af $(^NameDA) du vil afinstallere.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beskrivelse\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Placer musemarkøren over en komponent for at se dens beskrivelse.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Vælg en komponent for at se dens beskrivelse.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Vælg installationsmappe\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Vælg den mappe hvori du vil installere $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Vælg afinstallationsmappe\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Vælg den mappe hvorfra du vil afinstallere $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installerer\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Vent venligst mens $(^NameDA) bliver installeret.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installation gennemført\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Installationsguiden blev gennemført.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installation afbrudt\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Installationsguiden blev ikke gennemført.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Afinstallerer\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Vent venligst mens $(^NameDA) bliver afinstalleret.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Afinstallation gennemført\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Afinstallationen blev gennemført.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Afinstallation afbrudt\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Afinstallationen blev ikke gennemført.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Gennemfører $(^NameDA) installationsguiden\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) er blevet installeret på din computer.$\\r$\\n$\\r$\\nTryk på Afslut for at lukke installationsguiden.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Din computer skal genstartes for at gennemføre installationen af $(^NameDA). Vil du genstarte nu?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Gennemfører $(^NameDA) afinstallationsguiden\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) er blevet afinstalleret fra din computer.$\\r$\\n$\\r$\\nTryk på Afslut for at lukke installationsguiden.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Din computer skal genstartes for at gennemføre afinstallationen af $(^NameDA). Vil du genstarte nu?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Genstart nu\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Jeg genstarter selv på et senere tidspunkt\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Kør $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Vis Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Afslut\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Vælg mappe i menuen Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Vælg en mappe i menuen Start til programmets genveje.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Vælg mappe i menuen Start hvori du vil oprette programmets genveje. Du kan også skrive et navn for at oprette en ny mappe.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Opret ikke genveje\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Afinstaller $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Slet $(^NameDA) fra din computer.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Er du sikker på, at du vil afslutte installationen af $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Er du sikker på, at du vil afslutte afinstallationen af $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Vælg brugere\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Vælg de brugere som skal have installeret $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Vælg hvorvidt du vil installere $(^NameDA) kun for dig selv eller for alle brugere på denne computer. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installer for alle som bruger denne computer\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installer kun for mig\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Dutch.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1043\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Joost Verburg & Hendri Adireans, fixes by Milan Bast\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name)-installatie\n# ^UninstallCaption\n$(^Name)-deïnstallatie\n# ^LicenseSubCaption\n: Licentieovereenkomst\n# ^ComponentsSubCaption\n: Installatieopties\n# ^DirSubCaption\n: Installatiemap\n# ^InstallingSubCaption\n: Bezig met installeren\n# ^CompletedSubCaption\n: Voltooid\n# ^UnComponentsSubCaption\n: Verwijderingsopties\n# ^UnDirSubCaption\n: Te verwijderen map\n# ^ConfirmSubCaption\n: Bevestiging\n# ^UninstallingSubCaption\n: Bezig met verwijderen\n# ^UnCompletedSubCaption\n: Voltooid\n# ^BackBtn\n< V&orige\n# ^NextBtn\n&Volgende >\n# ^AgreeBtn\n&Akkoord\n# ^AcceptBtn\nIk &accepteer de overeenkomst\n# ^DontAcceptBtn\nIk accepteer de overeenkomst &niet\n# ^InstallBtn\n&Installeren\n# ^UninstallBtn\n&Verwijderen\n# ^CancelBtn\nAnnuleren\n# ^CloseBtn\n&Afsluiten\n# ^BrowseBtn\n&Bladeren...\n# ^ShowDetailsBtn\n&Details tonen\n# ^ClickNext\nKlik op Volgende om verder te gaan.\n# ^ClickInstall\nKlik op Installeren om de installatie te beginnen.\n# ^ClickUninstall\nKlik op Verwijderen om de deïnstallatie te beginnen.\n# ^Name\nNaam\n# ^Completed\nVoltooid\n# ^LicenseText\nLees de licentieovereenkomst voordat u $(^NameDA) installeert. Klik op Akkoord als u de overeenkomst accepteert.\n# ^LicenseTextCB\nLees de licentieovereenkomst voordat u $(^NameDA) installeert. Schakel het selectievakje hieronder in als u de overeenkomst accepteert. $_CLICK\n# ^LicenseTextRB\nLees de licentieovereenkomst voordat u $(^NameDA) installeert. Selecteer de eerste optie hieronder als u de overeenkomst accepteert. $_CLICK\n# ^UnLicenseText\nLees de licentieovereenkomst voordat u $(^NameDA) verwijdert. Klik op Akkoord als u de overeenkomst accepteert.\n# ^UnLicenseTextCB\nLees de licentieovereenkomst voordat u $(^NameDA) verwijdert. Schakel het selectievakje hieronder in als u de overeenkomst accepteert. $_CLICK\n# ^UnLicenseTextRB\nLees de licentieovereenkomst voordat u $(^NameDA) verwijdert. Selecteer de eerste optie hieronder als u de overeenkomst accepteert. $_CLICK\n# ^Custom\nAangepast\n# ^ComponentsText\nSelecteer de onderdelen die u wilt installeren en deselecteer welke u niet wilt installeren. $_CLICK\n# ^ComponentsSubText1\nSelecteer het installatietype:\n# ^ComponentsSubText2_NoInstTypes\nSelecteer de onderdelen die moeten worden geïnstalleerd:\n# ^ComponentsSubText2\nOf selecteer de optionele onderdelen die moeten worden geïnstalleerd:\n# ^UnComponentsText\nSelecteer de onderdelen die u wilt verwijderen en deselecteer welke u niet wilt verwijderen. $_CLICK\n# ^UnComponentsSubText1\nSelecteer het type verwijdering:\n# ^UnComponentsSubText2_NoInstTypes\nSelecteer de onderdelen die moeten worden verwijderd:\n# ^UnComponentsSubText2\nOf selecteer de optionele onderdelen die moeten worden verwijderd:\n# ^DirText\nSetup zal $(^NameDA) in de volgende map installeren. Klik op Bladeren als u $(^NameDA) in een andere map wilt installeren en selecteer deze. $_CLICK\n# ^DirSubText\nInstallatiemap\n# ^DirBrowseText\nSelecteer de map om $(^NameDA) in te installeren:\n# ^UnDirText\nSetup zal $(^NameDA) uit de volgende map verwijderen. Klik op Bladeren als u $(^NameDA) uit een andere map wilt verwijderen en selecteer deze. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSelecteer de map om $(^NameDA) uit te verwijderen:\n# ^SpaceAvailable\n\"Beschikbare ruimte: \"\n# ^SpaceRequired\n\"Vereiste ruimte: \"\n# ^UninstallingText\n$(^NameDA) zal uit de volgende map worden verwijderd. $_CLICK\n# ^UninstallingSubText\nVerwijderen uit:\n# ^FileError\nFout bij het schrijven naar bestand: \\r\\n\\r\\n$0\\r\\n\\r\\nKlik op Afbreken om de installatie te stoppen,\\r\\nOpnieuw om het opnieuw te proberen of\\r\\nNegeren om dit bestand over te slaan.\n# ^FileError_NoIgnore\nFout bij het schrijven naar bestand: \\r\\n\\r\\n$0\\r\\n\\r\\nKlik op Opnieuw om het opnieuw te proberen of \\r\\nAnnuleren om de installatie te stoppen.\n# ^CantWrite\n\"Kon niet schrijven: \"\n# ^CopyFailed\nKopiëren mislukt\n# ^CopyTo\n\"Kopiëren naar \"\n# ^Registering\n\"Registreren: \"\n# ^Unregistering\n\"Deregistreren: \"\n# ^SymbolNotFound\n\"Kon symbool niet vinden: \"\n# ^CouldNotLoad\n\"Kon niet laden: \"\n# ^CreateFolder\n\"Map maken: \"\n# ^CreateShortcut\n\"Snelkoppeling maken: \"\n# ^CreatedUninstaller\n\"Deïnstallatieprogramma gemaakt: \"\n# ^Delete\n\"Bestand verwijderen: \"\n# ^DeleteOnReboot\n\"Verwijderen na opnieuw opstarten: \"\n# ^ErrorCreatingShortcut\n\"Fout bij maken snelkoppeling: \"\n# ^ErrorCreating\n\"Fout bij maken: \"\n# ^ErrorDecompressing\nFout bij uitpakken van gegevens! Gegevens beschadigd?\n# ^ErrorRegistering\nFout bij registreren DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Uitvoeren: \"\n# ^Extract\n\"Uitpakken: \"\n# ^ErrorWriting\n\"Uitpakken: fout bij schrijven naar bestand \"\n# ^InvalidOpcode\nInstallatieprogramma beschadigd: ongeldige opcode\n# ^NoOLE\n\"Geen OLE voor: \"\n# ^OutputFolder\n\"Uitvoermap: \"\n# ^RemoveFolder\n\"Map verwijderen: \"\n# ^RenameOnReboot\n\"Hernoemen na opnieuw opstarten: \"\n# ^Rename\n\"Hernoemen: \"\n# ^Skipped\n\"Overgeslagen: \"\n# ^CopyDetails\nDetails kopiëren naar klembord\n# ^LogInstall\nGegevens over installatie bewaren\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Dutch.nsh",
    "content": "﻿;Language: Dutch (1043)\n;By Joost Verburg\n\n!insertmacro LANGFILE \"Dutch\" = \"Nederlands\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Welkom bij de $(^NameDA)-installatiewizard\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Deze wizard zal $(^NameDA) op uw systeem installeren.$\\r$\\n$\\r$\\nHet wordt aanbevolen alle overige toepassingen af te sluiten alvorens de installatie te starten. Dit maakt het mogelijk relevante systeembestanden bij te werken zonder uw systeem opnieuw op te moeten starten.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Welkom bij de $(^NameDA)-deïnstallatiewizard\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Deze wizard zal $(^NameDA) van uw syteem verwijderen.$\\r$\\n$\\r$\\nControleer voordat u begint met verwijderen of $(^NameDA) is afgesloten.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licentieovereenkomst\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Lees de licentieovereenkomst voordat u $(^NameDA) installeert.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Klik op Akkoord om verder te gaan als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te installeren.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Schakel het selectievakje hieronder in als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te installeren.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Selecteer de eerste optie hieronder als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te installeren.\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licentieovereenkomst\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Lees de licentieovereenkomst voordat u $(^NameDA) verwijdert.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Klik op Akkoord op verder te gaan als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te verwijderen.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Schakel het selectievakje hieronder in als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te verwijderen.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Selecteer de eerste optie hieronder als u de overeenkomst accepteert. U moet de overeenkomst accepteren om $(^NameDA) te verwijderen.\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Druk op Page Down om de rest van de overeenkomst te zien.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Onderdelen kiezen\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Kies de onderdelen die u wilt installeren.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Onderdelen kiezen\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Kies de onderdelen die u wilt verwijderen.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beschrijving\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Beweeg uw muis over een onderdeel om de beschrijving te zien.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Selecteer een onderdeel om de beschrijving te zien.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Installatielocatie kiezen\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Kies de map waarin u $(^NameDA) wilt installeren.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Locatie kiezen\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Kies de map waaruit u $(^NameDA) wilt verwijderen.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Bezig met installeren\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Een ogenblik geduld terwijl $(^NameDA) wordt geïnstalleerd.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installatie voltooid\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"De installatie is succesvol voltooid.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installatie afgebroken\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"De installatie is niet voltooid.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Bezig met verwijderen\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Een ogenblik geduld terwijl $(^NameDA) van uw systeem wordt verwijderd.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Verwijderen gereed\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"$(^NameDA) is van uw systeem verwijderd.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Verwijderen afgebroken\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"$(^NameDA) is niet volledig van uw systeem verwijderd.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Voltooien van de $(^NameDA)-installatiewizard\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) is geïnstalleerd op uw systeem.$\\r$\\n$\\r$\\nKlik op Voltooien om deze wizard te sluiten.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Uw systeem moet opnieuw worden opgestart om de installatie van $(^NameDA) te voltooien. Wilt u nu herstarten?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Voltooien van de $(^NameDA)-deïnstallatiewizard\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) is van uw systeem verwijderd.$\\r$\\n$\\r$\\nKlik op Voltooien om deze wizard te sluiten.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Uw systeem moet opnieuw worden opgestart om het verwijderen van $(^NameDA) te voltooien. Wilt u nu herstarten?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Nu herstarten\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ik wil later handmatig herstarten\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) &starten\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Leesmij weergeven\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Voltooien\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Startmenumap kiezen\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Kies een map in het menu Start voor de snelkoppelingen van $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Kies een map in het menu Start waarin de snelkoppelingen moeten worden aangemaakt. U kunt ook een naam invoeren om een nieuwe map te maken.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Geen snelkoppelingen aanmaken\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA) verwijderen\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) van uw systeem verwijderen.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Weet u zeker dat u de $(^Name)-installatie wilt afsluiten?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Weet u zeker dat u de $(^Name)-deïnstallatie wilt afsluiten?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Gebruikers kiezen\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Kies voor welke gebruikers u $(^NameDA) wilt installeren.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Selecteer of u $(^NameDA) alleen voor uzelf of voor alle gebruikers van deze computer wilt installeren. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installeer voor alle gebruikers van deze computer\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installeer alleen voor mijzelf\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/English.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1033\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n-\n# RTL - anything else than RTL means LTR\n-\n# Translation by ..... (any credits should go here)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Setup\n# ^UninstallCaption\n$(^Name) Uninstall\n# ^LicenseSubCaption\n: License Agreement\n# ^ComponentsSubCaption\n: Installation Options\n# ^DirSubCaption\n: Installation Folder\n# ^InstallingSubCaption\n: Installing\n# ^CompletedSubCaption\n: Completed\n# ^UnComponentsSubCaption\n: Uninstallation Options\n# ^UnDirSubCaption\n: Uninstallation Folder\n# ^ConfirmSubCaption\n: Confirmation\n# ^UninstallingSubCaption\n: Uninstalling\n# ^UnCompletedSubCaption\n: Completed\n# ^BackBtn\n< &Back\n# ^NextBtn\n&Next >\n# ^AgreeBtn\nI &Agree\n# ^AcceptBtn\nI &accept the terms of the License Agreement\n# ^DontAcceptBtn\nI &do not accept the terms of the License Agreement\n# ^InstallBtn\n&Install\n# ^UninstallBtn\n&Uninstall\n# ^CancelBtn\nCancel\n# ^CloseBtn\n&Close\n# ^BrowseBtn\nB&rowse...\n# ^ShowDetailsBtn\nShow &details\n# ^ClickNext\nClick Next to continue.\n# ^ClickInstall\nClick Install to start the installation.\n# ^ClickUninstall\nClick Uninstall to start the uninstallation.\n# ^Name\nName\n# ^Completed\nCompleted\n# ^LicenseText\nPlease review the license agreement before installing $(^NameDA). If you accept all terms of the agreement, click I Agree.\n# ^LicenseTextCB\nPlease review the license agreement before installing $(^NameDA). If you accept all terms of the agreement, click the check box below. $_CLICK\n# ^LicenseTextRB\nPlease review the license agreement before installing $(^NameDA). If you accept all terms of the agreement, select the first option below. $_CLICK\n# ^UnLicenseText\nPlease review the license agreement before uninstalling $(^NameDA). If you accept all terms of the agreement, click I Agree.\n# ^UnLicenseTextCB\nPlease review the license agreement before uninstalling $(^NameDA). If you accept all terms of the agreement, click the check box below. $_CLICK\n# ^UnLicenseTextRB\nPlease review the license agreement before uninstalling $(^NameDA). If you accept all terms of the agreement, select the first option below. $_CLICK\n# ^Custom\nCustom\n# ^ComponentsText\nCheck the components you want to install and uncheck the components you don't want to install. $_CLICK\n# ^ComponentsSubText1\nSelect the type of install:\n# ^ComponentsSubText2_NoInstTypes\nSelect components to install:\n# ^ComponentsSubText2\nOr, select the optional components you wish to install:\n# ^UnComponentsText\nCheck the components you want to uninstall and uncheck the components you don't want to uninstall. $_CLICK\n# ^UnComponentsSubText1\nSelect the type of uninstall:\n# ^UnComponentsSubText2_NoInstTypes\nSelect components to uninstall:\n# ^UnComponentsSubText2\nOr, select the optional components you wish to uninstall:\n# ^DirText\nSetup will install $(^NameDA) in the following folder. To install in a different folder, click Browse and select another folder. $_CLICK\n# ^DirSubText\nDestination Folder\n# ^DirBrowseText\nSelect the folder to install $(^NameDA) in:\n# ^UnDirText\nSetup will uninstall $(^NameDA) from the following folder. To uninstall from a different folder, click Browse and select another folder. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSelect the folder to uninstall $(^NameDA) from:\n# ^SpaceAvailable\n\"Space available: \"\n# ^SpaceRequired\n\"Space required: \"\n# ^UninstallingText\n$(^NameDA) will be uninstalled from the following folder. $_CLICK\n# ^UninstallingSubText\nUninstalling from:\n# ^FileError\nError opening file for writing: \\r\\n\\r\\n$0\\r\\n\\r\\nClick Abort to stop the installation,\\r\\nRetry to try again, or\\r\\nIgnore to skip this file.\n# ^FileError_NoIgnore\nError opening file for writing: \\r\\n\\r\\n$0\\r\\n\\r\\nClick Retry to try again, or\\r\\nCancel to stop the installation.\n# ^CantWrite\n\"Can't write: \"\n# ^CopyFailed\nCopy failed\n# ^CopyTo\n\"Copy to \"\n# ^Registering\n\"Registering: \"\n# ^Unregistering\n\"Unregistering: \"\n# ^SymbolNotFound\n\"Could not find symbol: \"\n# ^CouldNotLoad\n\"Could not load: \"\n# ^CreateFolder\n\"Create folder: \"\n# ^CreateShortcut\n\"Create shortcut: \"\n# ^CreatedUninstaller\n\"Created uninstaller: \"\n# ^Delete\n\"Delete file: \"\n# ^DeleteOnReboot\n\"Delete on reboot: \"\n# ^ErrorCreatingShortcut\n\"Error creating shortcut: \"\n# ^ErrorCreating\n\"Error creating: \"\n# ^ErrorDecompressing\nError decompressing data! Corrupted installer?\n# ^ErrorRegistering\nError registering DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Execute: \"\n# ^Extract\n\"Extract: \"\n# ^ErrorWriting\n\"Extract: error writing to file \"\n# ^InvalidOpcode\nInstaller corrupted: invalid opcode\n# ^NoOLE\n\"No OLE for: \"\n# ^OutputFolder\n\"Output folder: \"\n# ^RemoveFolder\n\"Remove folder: \"\n# ^RenameOnReboot\n\"Rename on reboot: \"\n# ^Rename\n\"Rename: \"\n# ^Skipped\n\"Skipped: \"\n# ^CopyDetails\nCopy Details To Clipboard\n# ^LogInstall\nLog install process\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/English.nsh",
    "content": "﻿;Language: English (1033)\n;By Joost Verburg\n\n!insertmacro LANGFILE \"English\" \"English\" \"English\" \"English\" ; See \\Include\\LangFile.nsh for a description of these parameters\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Welcome to $(^NameDA) Setup\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Setup will guide you through the installation of $(^NameDA).$\\r$\\n$\\r$\\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Welcome to $(^NameDA) Uninstall\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Setup will guide you through the uninstallation of $(^NameDA).$\\r$\\n$\\r$\\nBefore starting the uninstallation, make sure $(^NameDA) is not running.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"License Agreement\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Please review the license terms before installing $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to install $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"If you accept the terms of the agreement, click the check box below. You must accept the agreement to install $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"If you accept the terms of the agreement, select the first option below. You must accept the agreement to install $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"License Agreement\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Please review the license terms before uninstalling $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to uninstall $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"If you accept the terms of the agreement, click the check box below. You must accept the agreement to uninstall $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"If you accept the terms of the agreement, select the first option below. You must accept the agreement to uninstall $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Press Page Down to see the rest of the agreement.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Choose Components\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Choose which features of $(^NameDA) you want to install.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Choose Components\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Choose which features of $(^NameDA) you want to uninstall.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Description\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Position your mouse over a component to see its description.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Select a component to see its description.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Choose Install Location\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Choose the folder in which to install $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Choose Uninstall Location\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Choose the folder from which to uninstall $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installing\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Please wait while $(^NameDA) is being installed.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installation Complete\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Setup was completed successfully.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installation Aborted\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Setup was not completed successfully.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Uninstalling\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Please wait while $(^NameDA) is being uninstalled.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Uninstallation Complete\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Uninstall was completed successfully.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Uninstallation Aborted\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Uninstall was not completed successfully.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Completing $(^NameDA) Setup\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) has been installed on your computer.$\\r$\\n$\\r$\\nClick Finish to close Setup.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Your computer must be restarted in order to complete the installation of $(^NameDA). Do you want to reboot now?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Completing $(^NameDA) Uninstall\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) has been uninstalled from your computer.$\\r$\\n$\\r$\\nClick Finish to close Setup.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Your computer must be restarted in order to complete the uninstallation of $(^NameDA). Do you want to reboot now?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reboot now\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"I want to manually reboot later\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Run $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Show Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Finish\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Choose Start Menu Folder\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Choose a Start Menu folder for the $(^NameDA) shortcuts.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Select the Start Menu folder in which you would like to create the program's shortcuts. You can also enter a name to create a new folder.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Do not create shortcuts\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Uninstall $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Remove $(^NameDA) from your computer.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Are you sure you want to quit $(^Name) Setup?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Are you sure you want to quit $(^Name) Uninstall?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Choose Users\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Choose for which users you want to install $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Select whether you want to install $(^NameDA) only for yourself or for all users of this computer. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Install for anyone using this computer\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Install just for me\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Esperanto.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID (none exists for Esperanto at the moment)\n9998\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n-\n# RTL - anything else than RTL means LTR\n-\n# Translation v4.0.3 by Felipe Castro <fefcas@gmail.com>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalado de $(^Name)\n# ^UninstallCaption\nMalinstalado de $(^Name)\n# ^LicenseSubCaption\n: Permes-Kontrakto\n# ^ComponentsSubCaption\n: Instaladaj Opcioj\n# ^DirSubCaption\n: Instalada Dosierujo\n# ^InstallingSubCaption\n: Oni Instalas Dosierojn\n# ^CompletedSubCaption\n: Kompletite\n# ^UnComponentsSubCaption\n: Malinstaladaj Opcioj\n# ^UnDirSubCaption\n: Malinstalada Dosierujo\n# ^ConfirmSubCaption\n: Konfirmo\n# ^UninstallingSubCaption\n: Oni malinstalas\n# ^UnCompletedSubCaption\n: Kompletite\n# ^BackBtn\n< &Antauxe\n# ^NextBtn\n&Sekve >\n# ^AgreeBtn\n&Akceptite\n# ^AcceptBtn\nMi &akceptas la kondicxojn de la Permes-Kontrakto\n# ^DontAcceptBtn\nMi &ne akceptas la kondicxojn de la Permes-Kontrakto\n# ^InstallBtn\n&Instali\n# ^UninstallBtn\n&Malinstali\n# ^CancelBtn\nNuligi\n# ^CloseBtn\n&Fermi\n# ^BrowseBtn\n&Sercxi...\n# ^ShowDetailsBtn\nVidi &Detalojn\n# ^ClickNext\nMusklaku en 'Sekve' por dauxrigi.\n# ^ClickInstall\nMusklaku en 'Instali' por ekigi la instaladon.\n# ^ClickUninstall\nMusklaku en 'Malinstali' por ekigi la malinstaladon.\n# ^Name\nNomo\n# ^Completed\nKompletite\n# ^LicenseText\nBonvole revidu la permes-akordon antaux ol instali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en 'Akceptite'.\n# ^LicenseTextCB\nBonvole revidu la permes-akordon antaux ol instali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en la suba elekt-skatolo. $_CLICK\n# ^LicenseTextRB\nBonvole revidu la permes-akordon antaux ol instali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, elektu la unuan opcion sube. $_CLICK\n# ^UnLicenseText\nBonvole revidu la permes-akordon antaux ol malinstali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en 'Akceptite'.\n# ^UnLicenseTextCB\nBonvole revidu la permes-akordon antaux ol malinstali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, musklaku en la suba elekt-skatolo. $_CLICK\n# ^UnLicenseTextRB\nBonvole revidu la permes-akordon antaux ol malinstali $(^NameDA). Se vi konsentas kun cxiuj kondicxoj de la permeso, elektu la unuan opcion sube. $_CLICK\n# ^Custom\nPersonigite\n# ^ComponentsText\nMarku la konsisterojn, kiujn vi deziras instali kaj malmarku tiujn, kiujn vi ne deziras instali. $_CLICK\n# ^ComponentsSubText1\nElektu la tipon de instalado:\n# ^ComponentsSubText2_NoInstTypes\nElektu la konsisterojn por instali:\n# ^ComponentsSubText2\nAux, elektu la nedevigajn konsisterojn, kiujn vi deziras instali:\n# ^UnComponentsText\nMarku la konsisterojn, kiujn vi volas malinstali aux male. $_CLICK \n# ^UnComponentsSubText1\nElektu la tipon de malinstalado:\n# ^UnComponentsSubText2_NoInstTypes\nElektu la konsisterojn por malinstali:\n# ^UnComponentsSubText2\nAux, elektu la nedevigajn konsisterojn, kiujn vi deziras malinstali:\n# ^DirText\n$(^NameDA) estos instalita en la jena dosierujo. Por instali en alia dosierujo, musklaku en 'Sercxi...' kaj elektu gxin. $_CLICK\n# ^DirSubText\nCelota Dosierujo\n# ^DirBrowseText\nElektu dosierujon por instali $(^NameDA):\n# ^UnDirText\n$(^NameDA) estos malinstalita el la jena dosierujo. Por malinstali en alia dosierujo, musklaku en 'Sercxi...' kaj elektu gxin. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nElektu dosierujon el kie $(^NameDA) estos malinstalita:\n# ^SpaceAvailable\n\"Disponebla spaco: \"\n# ^SpaceRequired\n\"Postulata spaco: \"\n# ^UninstallingText\n$(^NameDA) estos malinstalita el la jena dosierujo. $_CLICK\n# ^UninstallingSubText\nMalinstalado el:\n# ^FileError\nEraro dum malfermo de dosiero por skribi: \\r\\n\\t\"$0\"\\r\\nMusklaku en Cxesigi por finigi la instaladon,\\r\\Ripeti por provi refoje skribi sur la dosiero, aux\\r\\nPreteratenti por preteratenti tiun cxi dosieron.\n# ^FileError_NoIgnore\nEraro dum malfermo de dosierujo por skribi: \\r\\n\\t\"$0\"\\r\\nMusklaku en Ripeti por provi refoje skribi sur la dosiero, aux\\r\\nNuligi por cxesigi la instaladon.\n# ^CantWrite\n\"Ne eblis skribi: \"\n# ^CopyFailed\nMalsukceso dum kopio\n# ^CopyTo\n\"Kopii al \"\n# ^Registering\n\"Oni registras: \"\n# ^Unregistering\n\"Oni malregistras: \"\n# ^SymbolNotFound\n\"Ne trovita simbolo: \"\n# ^CouldNotLoad\n\"Ne eblis sxargi: \"\n# ^CreateFolder\n\"Oni kreas subdosierujon: \"\n# ^CreateShortcut\n\"Oni kreas lancxilon: \"\n# ^CreatedUninstaller\n\"Oni kreas malinstalilon: \"\n# ^Delete\n\"Oni forigas dosieron: \"\n# ^DeleteOnReboot\n\"Forigi je restarto: \"\n# ^ErrorCreatingShortcut\n\"Eraro dum kreo de lancxilo: \"\n# ^ErrorCreating\n\"Eraro dum kreo: \"\n# ^ErrorDecompressing\nEraro dum malkompaktigo de datumaro! Cxu misrompita instalilo?\n# ^ErrorRegistering\nEraru dum registro de DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Lancxi: \"\n# ^Extract\n\"Eltiri: \"\n# ^ErrorWriting\n\"Eltirado: eraro dum skribo de dosiero \"\n# ^InvalidOpcode\nMisrompita instalilo: malvalida operaci-kodo\n# ^NoOLE\n\"Sen OLE por: \"\n# ^OutputFolder\n\"Celota dosierujo: \"\n# ^RemoveFolder\n\"Oni forigas la dosierujon: \"\n# ^RenameOnReboot\n\"Renomigi je restarto: \"\n# ^Rename\n\"Oni renomigas: \"\n# ^Skipped\n\"Preterpasita: \"\n# ^CopyDetails\nKopii detalojn al la tondejo\n# ^LogInstall\nRegistri instalad-procezo\n# ^Byte\nB\n# ^Kilo\n k\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Esperanto.nsh",
    "content": "﻿;Language: Esperanto (0)\n;By Felipe Castro <fefcas@gmail.com>\n\n!insertmacro LANGFILE \"Esperanto\" = \"Esperanto\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bonvenon al la Gvidilo por Instalado de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Tiu cxi gvidilo helpos vin dum la instalado de $(^NameDA).$\\r$\\n$\\r$\\nOni rekomendas fermi cxiujn aliajn aplikajxojn antaux ol ekigi la Instaladon. Tio cxi ebligos al la Instalilo gxisdatigi la koncernajn dosierojn de la sistemo sen bezono restartigi la komputilon.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bonvenon al la Gvidilo por Malinstalado de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Tiu cxi gvidilo helpos vin dum la malinstalado de $(^NameDA).$\\r$\\n$\\r$\\nAntaux ol ekigi la malinstalado, certigxu ke $(^NameDA) ne estas plenumata nun.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Permes-Kontrakto\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Bonvole, kontrolu la kondicxojn de la permesilo antaux ol instali la programon $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Se vi akceptas la kondicxojn, musklaku en 'Akceptite' por dauxrigi. Vi devos akcepti la kontrakton por instali la programon $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se vi akceptas la permes-kondicxojn, musklaku la suban elekt-skatolon. Vi devos akcepti la kontrakton por instali la programon $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se vi akceptas la permes-kondicxojn, elektu la unuan opcion sube. Vi devas akcepti la kontrakton por instali la programon $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Permes-Kontrakto\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Bonvole, kontrolu la kondicxojn de la permesilo antaux ol malinstali la programon $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Se vi akceptas la kondicxojn, musklaku en 'Akceptite' por dauxrigi. Vi devos akcepti la kontrakton por malinstali la programon $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se vi akceptas la permes-kondicxojn, musklaku la suban elekt-skatolon. Vi devos akcepti la kontrakton por malinstali la programon $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se vi akceptas la permes-kondicxojn, elektu la unuan opcion sube. Vi devas akcepti la kontrakton por malinstali la programon $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Premu 'Page Down' por rigardi la reston de la permeso.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Elekto de Konsisteroj\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Elektu kiujn funkciojn de $(^NameDA) vi deziras instali.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Elekto de Konsisteroj\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Elektu kiujn funkciojn de $(^NameDA) vi deziras malinstali.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Priskribo\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Poziciu la muson sur konsistero por rigardi ties priskribon.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Elekto de la Instalada Loko\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Elektu la dosierujon en kiun vi deziras instali la programon $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Elekto de la Malinstalada Loko\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Elektu la dosierujon el kiu vi deziras malinstali la programon $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Oni instalas\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Bonvole, atendu dum $(^NameDA) estas instalata.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalado Plenumite\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"La instalado sukcese plenumigxis.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalado Cxesigite\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"La instalado ne plenumigxis sukcese.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Oni malinstalas\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Bonvole, atendu dum $(^NameDA) estas malinstalata.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Malinstalado Plenumite\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"La malinstalado sukcese plenumigxis.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Malinstalado Cxesigxite\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"La malinstalado ne plenumigxis sukcese.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Oni finigas la Gvidilon por Instalado de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) estas instalita en via komputilo.$\\r$\\n$\\r$\\nMusklaku en Finigi por fermi tiun cxi gvidilon.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Via komputilo devas esti restartigita por kompletigi la instaladon de $(^NameDA). Cxu restartigi nun?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Oni finigas la Gvidilon por Malinstalado de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) estis forigita el via komputilo.$\\r$\\n$\\r$\\nMusklaku en Finigi por fermi tiun cxi gvidilon.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Via komputilo devas esti restartigita por kompletigi la malinstaladon de $(^NameDA). Cxu restartigi nun?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Restartigi Nun\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Mi volas restartigi permane poste\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Lancxi $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Montri Legumin\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Finigi\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Elektu Dosierujon de la Ek-Menuo\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Elektu dosierujon de la Ek-Menuo por la lancxiloj de la programo.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Elektu dosierujon de la Ek-Menuo en kiu vi deziras krei la lancxilojn de la programo. Vi povas ankaux tajpi nomon por krei novan ujon.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ne krei lancxilojn\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Malinstali $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Forigi $(^NameDA) el via komputilo.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Cxu vi certe deziras nuligi la instaladon de $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Cxu vi certe deziras nuligi la malinstaladon de $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Elekti Uzantojn\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Elekti por kiuj uzantoj vi deziras instali $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Elektu cxu vi volas instali $(^NameDA) por vi mem aux por cxiuj uzantoj de tiu cxi komputilo. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instali por iu ajn uzanto de tiu cxi komputilo\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instali nur por mi\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Estonian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1061\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1257\n# RTL - anything else than RTL means LTR\n-\n# Translation by izzo (izzo@hot.ee)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Paigaldamine\n# ^UninstallCaption\n$(^Name) Eemaldamine\n# ^LicenseSubCaption\n: Litsentsileping\n# ^ComponentsSubCaption\n: Paigaldusvalikud\n# ^DirSubCaption\n: Paigalduskaust\n# ^InstallingSubCaption\n: Paigaldan\t\t\t\n# ^CompletedSubCaption\n: Valmis\n# ^UnComponentsSubCaption\n: Eemaldusvalikud\n# ^UnDirSubCaption\n: Eemalduskaust\n# ^ConfirmSubCaption\n: Kinnitus\n# ^UninstallingSubCaption\n: Eemaldan\n# ^UnCompletedSubCaption\n: Valmis\n# ^BackBtn\n< Tagasi\n# ^NextBtn\nEdasi >\n# ^AgreeBtn\nNõustun\n# ^AcceptBtn\nNõustun litsentsilepingu tingimustega\n# ^DontAcceptBtn\nEi nõustu litsentsilepingu tingimustega\n# ^InstallBtn\nPaigalda\n# ^UninstallBtn\nEemalda\n# ^CancelBtn\nLoobu\n# ^CloseBtn\nSule\n# ^BrowseBtn\nSirvi...\n# ^ShowDetailsBtn\nDetailid\n# ^ClickNext\nJätkamiseks vajuta Edasi.\n# ^ClickInstall\nPaigaldamise alustamiseks vajuta Paigalda.\n# ^ClickUninstall\nEemaldamise alustamiseks vajuta Eemalda.\n# ^Name\nNimi\n# ^Completed\nValmis\n# ^LicenseText\nEnne $(^NameDA) paigaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vajuta Nõustun.\n# ^LicenseTextCB\nEnne $(^NameDA) paigaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vali allolev märkeruut. $_CLICK\n# ^LicenseTextRB\nEnne $(^NameDA) paigaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, märgi allpool esimene valik. $_CLICK\n# ^UnLicenseText\nEnne $(^NameDA) eemaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vajuta Nõustun.\n# ^UnLicenseTextCB\nEnne $(^NameDA) eemaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, vali allolev märkeruut. $_CLICK\n# ^UnLicenseTextRB\nEnne $(^NameDA) eemaldamist vaata palun litsentsileping üle. Kui sa nõustud kõigi lepingu tingimustega, märgi allpool esimene valik. $_CLICK\n# ^Custom\nKohandatud\n# ^ComponentsText\nMärgista komponendid mida soovid paigaldada ja eemalda märgistus neilt, mida ei soovi paigaldada. $_CLICK\n# ^ComponentsSubText1\nVali paigalduse tüüp:\n# ^ComponentsSubText2_NoInstTypes\nVali paigaldatavad komponendid:\n# ^ComponentsSubText2\nvõi vali lisakomponendid mida soovid paigaldada:\n# ^UnComponentsText\nMärgista komponendid mida soovid eemaldada ja eemalda märgistus neilt, mida ei soovi eemaldada. $_CLICK\n# ^UnComponentsSubText1\nVali eemalduse tüüp:\n# ^UnComponentsSubText2_NoInstTypes\nVali eemaldatavad komponendid:\n# ^UnComponentsSubText2\nvõi vali lisakomponendid mida soovid eemaldada:\n# ^DirText\n$(^NameDA) paigaldatakse järgmisse kausta. Et mujale paigaldada, vajuta sirvi ja vali teine kaust. $_CLICK\n# ^DirSubText\nSihtkaust\n# ^DirBrowseText\nVali kaust kuhu $(^NameDA) paigaldada:\n# ^UnDirText\n$(^NameDA) eemaldatakse järgmisest kaustast. Et mujalt eemaldada, vajuta sirvi ja vali teine kaust. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nVali kaust kust $(^NameDA) eemaldada:\n# ^SpaceAvailable\n\"Vaba ruum: \"\n# ^SpaceRequired\n\"Vajalik ruum: \"\n# ^UninstallingText\n$(^NameDA) eemaldatakse järgmisest kaustast. $_CLICK\n# ^UninstallingSubText\nEemaldan sealt:\n# ^FileError\nTõrge faili avamisel kirjutamiseks: \\r\\n\\t\"$0\"\\r\\nPaigalduse katkestamiseks vajuta Katkesta,\\r\\nvajuta Ürita uuesti, et faili kirjutamist uuesti proovida, või\\r\\nIgnoreeri, et see fail vahele jätta.\n# ^FileError_NoIgnore\nTõrge faili avamisel kirjutamiseks: \\r\\n\\t\"$0\"\\r\\nVajuta Ürita uuesti, et faili kirjutamist uuesti proovida, või\\r\\nLoobu, et paigaldamine katkestada\n# ^CantWrite\n\"Ei saa kirjutada: \"\n# ^CopyFailed\nKopeerimine ebaõnnestus\n# ^CopyTo\n\"Kopeeri sinna \"\n# ^Registering\n\"Registreerin: \"\n# ^Unregistering\n\"Deregistreerin: \"\n# ^SymbolNotFound\n\"Ei leidnud sümbolit: \"\n# ^CouldNotLoad\n\"Ei saanud laadida: \"\n# ^CreateFolder\n\"Loo kaust: \"\n# ^CreateShortcut\n\"Loo otsetee: \"\n# ^CreatedUninstaller\n\"Loodud eemaldaja: \"\n# ^Delete\n\"Kustuta fail: \"\n# ^DeleteOnReboot\n\"Kustuta taaskäivitamisel: \"\n# ^ErrorCreatingShortcut\n\"Tõrge otsetee loomisel: \"\n# ^ErrorCreating\n\"Tõrge loomisel: \"\n# ^ErrorDecompressing\nTõrge andmete lahtipakkimisel! Vigane paigaldaja?\n# ^ErrorRegistering\nTõrge DLL-i registreerimisel\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Käivita: \"\n# ^Extract\n\"Paki lahti: \"\n# ^ErrorWriting\n\"Paki lahti: viga faili kirjutamisel \"\n# ^InvalidOpcode\nPaigaldaja kõlbmatu: vigane opkood\n# ^NoOLE\n\"No OLE for: \"\n# ^OutputFolder\n\"Väljastatav kaust: \"\n# ^RemoveFolder\n\"Eemalda kaust: \"\n# ^RenameOnReboot\n\"Taaskäivitusel nimeta ümber: \"\n# ^Rename\n\"Nimeta ümber: \"\n# ^Skipped\n\"Vahele jäetud: \"\n# ^CopyDetails\nKopeeri detailid lõikelauale\n# ^LogInstall\nLogi paigaldusprotsess\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Estonian.nsh",
    "content": "﻿;Language: Estonian (1061)\n;Translated by johnny izzo (izzo@hot.ee)\n\n!insertmacro LANGFILE \"Estonian\" = \"Eesti keel\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) paigaldamine!\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"See abiline aitab paigaldada $(^NameDA).$\\r$\\n$\\r$\\nEnne paigaldamise alustamist on soovitatav kõik teised programmid sulgeda, see võimaldab teatud süsteemifaile uuendada ilma arvutit taaskäivitamata.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"$(^NameDA) eemaldamine!\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"See abiline aitab eemaldada $(^NameDA).$\\r$\\n$\\r$\\nEnne eemaldamist vaata, et $(^NameDA) oleks suletud.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Litsentsileping\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Enne $(^NameDA) paigaldamist vaata palun litsentsileping üle.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Kui sa oled lepingu tingimustega nõus, vali jätkamiseks Nõustun. $(^NameDA) paigaldamiseks pead sa lepinguga nõustuma.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Kui nõustud lepingu tingimustega, vali allolev märkeruut. $(^NameDA) paigaldamiseks pead lepinguga nõustuma. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Kui nõustud lepingu tingimustega, märgi allpool esimene valik. $(^NameDA) paigaldamiseks pead lepinguga nõustuma. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Litsentsileping\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Enne $(^NameDA) eemaldamist vaata palun litsentsileping üle.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Kui sa oled lepingu tingimustega nõus, vali jätkamiseks Nõustun. $(^NameDA) eemaldamiseks pead sa lepinguga nõustuma.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Kui nõustud lepingu tingimustega, vali allolev märkeruut. $(^NameDA) eemaldamiseks pead lepinguga nõustuma. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Kui nõustud lepingu tingimustega, märgi allpool esimene valik. $(^NameDA) eemaldamiseks pead lepinguga nõustuma. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Vajuta Page Down, et näha ülejäänud teksti.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Vali komponendid\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Vali millised $(^NameDA) osad sa soovid paigaldada.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Vali komponendid\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Vali millised $(^NameDA) osad sa soovid eemaldada.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Kirjeldus\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Nihuta hiir komponendile, et näha selle kirjeldust.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Vali komponent, et näha selle kirjeldust.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Vali asukoht\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Vali kaust kuhu paigaldada $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Vali asukoht\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Vali kaust kust $(^NameDA) eemaldada.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Paigaldan...\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Palun oota kuni $(^NameDA) on paigaldatud.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Programm paigaldatud\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Paigaldus edukalt sooritatud.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Paigaldus katkestatud\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Paigaldamine ebaõnnestus.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Eemaldan...\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Palun oota kuni $(^NameDA) on eemaldatud.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Eemaldamine lõpetatud\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Eemaldamine edukalt lõpule viidud.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Eemaldamine katkestatud\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Eemaldamine ebaõnestus.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) paigalduse lõpule viimine.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) on sinu arvutisse paigaldatud.$\\r$\\n$\\r$\\nAbilise sulgemiseks vajuta Lõpeta.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA) täielikuks paigaldamiseks tuleb arvuti taaskäivitada. Kas soovid arvuti kohe taaskäivitada ?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) eemaldamise lõpule viimine.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) on sinu arvutist eemaldatud.$\\r$\\n$\\r$\\nAbilise sulgemiseks vajuta Lõpeta.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) täielikuks eemaldamiseks tuleb arvuti taaskäivitada. Kas soovid arvuti kohe taaskäivitada ?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Taaskäivita kohe\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Taaskäivitan hiljem käsitsi\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Käivita $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Kuva Loemind\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"Lõpeta\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Vali Start-menüü kaust\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Vali $(^NameDA) otseteede jaoks Start-menüü kaust.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Vali Start-menüü kaust, kuhu soovid paigutada programmi otseteed. Võid ka sisestada nime, et luua uus kaust.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ära loo otseteid\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Eemalda $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Eemalda $(^NameDA) oma arvutist.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Oled sa kindel et soovid $(^Name) paigaldamise katkestada?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Oled sa kindel et soovid $(^Name) eemaldamise katkestada?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Farsi.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1065\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1256\n# RTL - anything else than RTL means LTR\nRTL\n# Translation By FzerorubigD - FzerorubigD@gmail.com - Thanx to all people help me in forum.persiantools.com, Elnaz Sarbar <elnaz@farsiweb.info>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nنصب $(^Name) \n# ^UninstallCaption\nحذف $(^Name) \n# ^LicenseSubCaption\n: مجوز نصب\n# ^ComponentsSubCaption\n: گزینه‌های نصب\n# ^DirSubCaption\n: پوشه نصب\n# ^InstallingSubCaption\n: در حال نصب\n# ^CompletedSubCaption\n: پایان یافت\n# ^UnComponentsSubCaption\n: گزینه‌های حذف\n# ^UnDirSubCaption\n: پوشه‌ی حذف\n# ^ConfirmSubCaption\n: تأیید\n# ^UninstallingSubCaption\n: در حال حذف\n# ^UnCompletedSubCaption\n: پایان یافت\n# ^BackBtn\n&قبل \n# ^NextBtn\n&بعد\n# ^AgreeBtn\n&موافقم\n# ^AcceptBtn\nمن همه‌ی بندهای مجوز را قبول &دارم\n# ^DontAcceptBtn\nمن بندهای مجوز را قبول &ندارم\n# ^InstallBtn\n&نصب\n# ^UninstallBtn\n&حذف\n# ^CancelBtn\nانصراف\n# ^CloseBtn\n&بستن\n# ^BrowseBtn\n&مرور...\n# ^ShowDetailsBtn\nنمایش جزئیات\n# ^ClickNext\nبرای ادامه روی دکمه‌ی بعد کلیک کنید.\n# ^ClickInstall\nبرای شروع نصب روی دکمه‌ی نصب کلیک کنید.\n# ^ClickUninstall\nبرای شروع حذف روی دکمه‌ی حذف کلیک کنید.\n# ^Name\nنام\n# ^Completed\nپایان یافت\n# ^LicenseText\nلطفاً قبل از نصب $(^NameDA) متن مجوز را بخوانید. اگر همه‌ی بندهای آن را قبول دارید روی دکمه‌ی موافقم کلیک کنید.\n# ^LicenseTextCB\nلطفاً قبل از نصب $(^NameDA) متن مجوز را بخوانید. اگر همه‌ی بندهای آن را قبول دارید روی جعبه نشانه‌زنی زیر کلیک کنید. $_CLICK\n# ^LicenseTextRB\nلطفاً قبل از نصب $(^NameDA) متن مجوز را بخوانید. اگر همه‌ی بندهای آن را قبول دارید گزینه‌ی اول را انتخاب کنید. $_CLICK\n# ^UnLicenseText\nلطفاً قبل از حذف $(^NameDA) متن مجوز را بخوانید. اگر همه‌ی بندهای آن را قبول دارید روی دکمه‌ی موافقم کلیک کنید.\n# ^UnLicenseTextCB\nلطفاً قبل از حذف $(^NameDA) متن مجوز را بخوانید. اگر همه‌ی بندهای آن را قبول دارید روی جعبه نشانه‌زنی زیر کلیک کنید. $_CLICK\n# ^UnLicenseTextRB\nلطفاً قبل از حذف $(^NameDA) متن مجوز را بخوانید. اگر همه‌ی بندهای آن را قبول دارید گزینه‌ی اول را انتخاب کنید. $_CLICK\n# ^Custom\nسفارشی\n# ^ComponentsText\nکنار بخش‌هایی که می‌خواهید نصب شوند نشانه بزنید و نشانه بخش‌هایی را که نمی‌خواهید نصب شوند بردارید. $_CLICK\n# ^ComponentsSubText1\nنوع نصب را مشخص کنید: \n# ^ComponentsSubText2_NoInstTypes\nبخش‌هایی را که می‌خواهید نصب شوند انتخاب کنید:\n# ^ComponentsSubText2\nیا، بخش‌های اختیاری را که می‌خواهید نصب شوند انتخاب کنید: \n# ^UnComponentsText\nکنار بخش‌هایی که می‌خواهید حذف شوند نشانه بزنید و نشانه بخش‌هایی را که نمی‌خواهید حذف شوند بردارید. $_CLICK\n# ^UnComponentsSubText1\nنوع حذف را انتخاب کنید: \n# ^UnComponentsSubText2_NoInstTypes\nبخش‌هایی را که می‌خواهید حذف شوند انتخاب کنید:\n# ^UnComponentsSubText2\nیا، بخش‌های اختیاری را که می‌خواهید حذف شوند انتخاب کنید: \n# ^DirText\nبرنامه نصب، $(^NameDA) را در پوشه‌ی زیر نصب خواهد کرد. برای نصب در پوشه‌ی دیگر روی دکمه مرور کلیک کنید و پوشه‌ی دیگری انتخاب کنید. $_CLICK\n# ^DirSubText\nپوشه‌ی مقصد\n# ^DirBrowseText\nانتخاب پوشه برای نصب $(^NameDA):\n# ^UnDirText\nبرنامه نصب، $(^NameDA) را از پوشه‌ی زیر حذف خواهد کرد. برای نصب در پوشه‌ی دیگر روی دکمه مرور کلیک کنید و پوشه‌ی دیگری انتخاب کنید. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nانتخاب پوشه برای حذف $(^NameDA):\n# ^SpaceAvailable\n\"فضای موجود: \"\n# ^SpaceRequired\n\"فضای مورد نیاز: \"\n# ^UninstallingText\n$(^NameDA) از پوشه‌ی زیر حذف خواهد شد. $_CLICK\n# ^UninstallingSubText\nحذف از: \n# ^FileError\nخطا هنگام باز کردن پرونده برای نوشتن: \\r\\n\\r\\n$0\\r\\n\\n برای توقف نصب روی Abort \\r\\n برای تلاش مجدد روی Retry \\r\\n و برای صرف‌نظر از این پرونده روی Ignore کلیک کنید.\n# ^FileError_NoIgnore\nخطا هنگام باز کردن پرونده برای نوشتن: \\r\\n\\r\\n$0\\r\\n\\nبرای تلاش مجدد روی Retry\\r\\nو برای انصراف روی Cancel کلیک کنید.\n# ^CantWrite\n\"نوشتن ممکن نیست: \"\n# ^CopyFailed\nنسخه‌برداری ناموفق بود.\n# ^CopyTo\n\"نسخه‌برداری در: \"\n# ^Registering\n\"در حال ثبت: \"\n# ^Unregistering\n\"در حال حذف ثبت: \"\n# ^SymbolNotFound\n\"علامت پیدا نشد: \"\n# ^CouldNotLoad\n\"بارگذاری ممکن نیست: \"\n# ^CreateFolder\n\"ایجاد پوشه: \"\n# ^CreateShortcut\n\"ایجاد میان‌بُر: \"\n# ^CreatedUninstaller\n\"حذف‌کننده ایجاد شد: \"\n# ^Delete\n\"حذف پرونده: \"\n# ^DeleteOnReboot\n\"حذف هنگام راه اندازی مجدد: \"\n# ^ErrorCreatingShortcut\n\"خطا هنگام ایجاد میان‌بُر: \"\n# ^ErrorCreating\n\"خطا هنگام ایجاد: \"\n# ^ErrorDecompressing\nخطا هنگام باز کردن اطلاعات! نصب‌کننده خراب است؟\n# ^ErrorRegistering\nخطا هنگام ثبت DLL\n# ^ExecShell\n\"پوسته اجرایی: \"\n# ^Exec\n\"اجرا: \"\n# ^Extract\n\"استخراج: \"\n# ^ErrorWriting\n\"استخراج: خطا هنگام نوشتن در پرونده\"\n# ^InvalidOpcode\nنصب‌کننده خراب است: کد عملیاتی نامعتبر.\n# ^NoOLE\n\"‏OLE وجود ندارد: \"\n# ^OutputFolder\n\"پوشه‌ی خروجی: \"\n# ^RemoveFolder\n\"حذف پوشه: \"\n# ^RenameOnReboot\n\"تغییر نام هنگام راه اندازی مجدد: \"\n# ^Rename\n\"تغییر نام: \"\n# ^Skipped\n\"چشم پوشی شد: \"\n# ^CopyDetails\nنسخه‌برداری جزئیات در کلیپ‌برد\n# ^LogInstall\nثبت روند نصب\n# ^Byte\n بایت\n# ^Kilo\n کیلو\n# ^Mega\n مگا\n# ^Giga\n گیگا\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Farsi.nsh",
    "content": "﻿;Language: Farsi (1065)\n;By FzerorubigD - FzerorubigD@gmail.com - Thanx to all people help me in forum.persiantools.com\n\n!insertmacro LANGFILE \"Farsi\" \"Persian\" \"فارسی\" \"Farsi\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"به برنامه نصب $(^NameDA) خوش آمدید.\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"این برنامه شما را در نصب $(^NameDA) یاری می‌کند.$\\r$\\n$\\r$\\nتوصیه می‌کنیم کلیه برنامه‌های در حال اجرا را ببندید. این به برنامه نصب اجازه می‌دهد که فایل‌های لازم را بدون نیاز به راه اندازی دوباره‌ی کامپیوتر شما به روز کند.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"به برنامه حذف $(^NameDA) خوش آمدید.\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \" این برنامه برای حذف $(^NameDA) به شما کمک می‌کند.$\\r$\\n$\\r$\\nقبل از حذف $(^NameDA) مطمئن شوید این برنامه در حال اجرا نباشد.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"توافقنامه نصب\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"لطفا پیش از نصب $(^NameDA) مفاد توافقنامه را مرور کنید.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"اگر کلیه بندهای توافقنامه را قبول دارید دکمه‌ی موافقم را بفشارید. برای نصب $(^NameDA) شما بایست این توافقنامه را قبول کنید.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"اگر کلیه بندهای توافقنامه را قبول دارید تیک زیر را انتخاب کنید. برای نصب $(^NameDA) شما بایست این توافقنامه را قبول کنید. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"اگر کلیه بندهای توافقنامه را قبول دارید گزینه اول را انتخاب کنید. برای نصب $(^NameDA) شما بایست این توافقنامه را قبول کنید. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"توافقنامه حذف\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"لطفا کلیه بندهای این توافقنامه را قبل ار حذف $(^NameDA) مرور کنید.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"اگر کلیه بندهای توافقنامه را قبول دارید دکمه‌ی موافقم را بفشارید. برای حذف $(^NameDA) شما بایست این توافقنامه را قبول کنید.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"اگر کلیه بندهای توافقنامه را قبول دارید تیک زیر را انتخاب کنید. برای حذف $(^NameDA) شما بایست این توافقنامه ر قبول کنید. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"اگر کلیه بندهای توافقنامه را قبول دارید گزینه اول را انتخاب کنید. برای حذف $(^NameDA) شما بایست این توافقنامه ر قبول کنید. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"برای دیدن متن به صورت کامل از کلید Page Down استفاده کنید.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"انتخاب اجزای برنامه \"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"اجزایی از $(^NameDA) که می‌خواهید نصب شوند را انتخاب کنید.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"انتخاب اجزای برنامه\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"اجزایی از $(^NameDA) را که می‌خواهید حذف کنید انتخاب کنید.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"توضیحات\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"نشانگر ماوس را بر روی اجزایی که می‌خواهید ببرید تا توضیحات آن را ببینید.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"يكي از گزينه هاي نصب را انتخاب كنيد تا توضيحات مربوط به آن را ببينيد.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"انتخاب پوشه نصب\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"پوشه‌ای که می‌خواهید $(^NameDA) در آن نصب شود را انتخاب کنید.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"پوشه حذف را انتخاب کنید\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"پوشه‌ای که می‌خواهید $(^NameDA) را از آن حذف کنید انتخاب کنید.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"نصب برنامه\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"لطفا مدت زمانی که $(^NameDA) در حال نصب است را صبر کنید.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"نصب پایان یافت\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"برنامه نصب با موفقیت پایان یافت.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"برنامه نصب لغو شد.\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"برنامه نصب به صورت نیمه تمام پایان یافت.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"حذف برنامه\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"لطفا مدت زمانی که $(^NameDA) در حال حذف است را صبر کنید.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"حذف پایان یافت\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"برنامه حذف با موفقیت پایان یافت.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"برنامه حذف لغو شد\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"برنامه حذف به صورت نیمه تمام پایان یافت\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"برنامه نصب $(^NameDA) پایان یافت\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) بر روی کامپیوتر شما نصب شد.$\\r$\\n$\\r$\\nبر روی دکمه‌ی پایان برای خروج از این برنامه کلیک کنید.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"کامپیوتر شما برای تکمیل نصب $(^NameDA) بایستی دوباره راه اندازی شود. آیا می‌خواهید این کار را الان انجام دهید؟\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"برنامه حذف $(^NameDA) پایان یافت\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) از روی کامپیوتر شما حذف شد.$\\r$\\n$\\r$\\nبر روی دکمه‌ی پایان برای خروج از این برنامه کلیک کنید.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"کامپیوتر شما برای تکمیل حذف$(^NameDA) بایست دوباره راه اندازی شود.آیا می‌خواهید این کار را الان انجام دهید؟\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"راه اندازی مجدد.\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"من خودم این کار را انجام خواهم داد.\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&اجرای $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&نمایش فایل توضیحات\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&پایان\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"انتخاب پوشه در منوی برنامه‌ها\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"پوشه‌ای که می‌خواهید میانبرهای $(^NameDA) در آن قرار بگیرند را انتخاب کنید.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"پوشه‌ای در منوی برنامه‌ها که می‌خواهید میانبرهای برنامه در آنجا ایجاد شوند را انتخاب کنید. برای ایجاد یک پوشه جدید میتوانید یک نام تایپ کنید.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"میانبری نساز\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"حذف $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"پاک کردن $(^NameDA) از روی کامپیوتر شما.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"آیا مطمئنید که می‌خواهید از برنامه نصب $(^Name) خارج شوید؟\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"آیا مطمئنید که می‌خواهید از برنامه حذف $(^Name) خارج شوید؟\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Finnish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1035\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Eclipser (Jonne Lehtinen) <Eclipser at pilvikaupunki dot net>\n# Corrections by the Mozilla.fi crew\n# Upd 11/08 by WTLib Team\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) -ohjelman asennus\n# ^UninstallCaption\n$(^Name) -ohjelman poisto\n# ^LicenseSubCaption\n: Lisenssisopimus\n# ^ComponentsSubCaption\n: Asennusvaihtoehdot\n# ^DirSubCaption\n: Asennuskansio\n# ^InstallingSubCaption\n: Asennetaan\n# ^CompletedSubCaption\n: Valmis\n# ^UnComponentsSubCaption\n: Poistovaihtoehdot\n# ^UnDirSubCaption\n: Poistokansio\n# ^ConfirmSubCaption\n: Varmistus\n# ^UninstallingSubCaption\n: Poistetaan\n# ^UnCompletedSubCaption\n: Valmis\n# ^BackBtn\n< &Takaisin\n# ^NextBtn\n&Seuraava >\n# ^AgreeBtn\n&Hyväksyn\n# ^AcceptBtn\nHyväksyn lisenssisopimuksen ehdot\n# ^DontAcceptBtn\nEn hyväksy sopimuksen ehtoja\n# ^InstallBtn\n&Asenna\n# ^UninstallBtn\n&Poista\n# ^CancelBtn\nPeruuta\n# ^CloseBtn\n&Sulje\n# ^BrowseBtn\nS&elaa...\n# ^ShowDetailsBtn\n&Näytä tiedot\n# ^ClickNext\nValitse Seuraava jatkaaksesi.\n# ^ClickInstall\nValitse Asenna aloittaaksesi asennuksen.\n# ^ClickUninstall\nValitse Poista poistaaksesi asennuksen.\n# ^Name\nNimi\n# ^Completed\nValmis\n# ^LicenseText\nLue lisenssisopimus ennen asentamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse Hyväksyn.\n# ^LicenseTextCB\nLue lisenssisopimus ennen asentamista. Jos hyväksyt sopimuksen kaikki ehdot, laita rasti ruutuun. $_CLICK\n# ^LicenseTextRB\nLue lisenssisopimus ennen asentamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse ensimmäinen vaihtoehto alapuolelta. $_CLICK\n# ^UnLicenseText\nLue lisenssisopimus ennen poistamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse Hyväksyn.\n# ^UnLicenseTextCB\nLue lisenssisopimus ennen poistamista. Jos hyväksyt sopimuksen kaikki ehdot, laita rasti ruutuun. $_CLICK\n# ^UnLicenseTextRB\nLue lisenssisopimus ennen poistamista. Jos hyväksyt sopimuksen kaikki ehdot, valitse ensimmäinen vaihtoehto alapuolelta. $_CLICK\n# ^Custom\nOma\n# ^ComponentsText\nValitse komponentit, jotka haluat asentaa, ja poista valinta komponenteista, joita et halua asentaa. $_CLICK\n# ^ComponentsSubText1\nValitse asennustyyppi:\n# ^ComponentsSubText2_NoInstTypes\nValitse asennettavat komponentit:\n# ^ComponentsSubText2\nTai, valitse valinnaiset komponentit, jotka haluat asentaa:\n# ^UnComponentsText\nValitse komponentit, jotka haluat poistaa, ja poista valinta komponenteista, joita et haluat poistaa. $_CLICK\n# ^UnComponentsSubText1\nValitse poistotyyppi:\n# ^UnComponentsSubText2_NoInstTypes\nValitse poistettavat komponentit:\n# ^UnComponentsSubText2\nTai, valitse valinnaiset komponentit, jotka haluat poistaa\n# ^DirText\n$(^NameDA) -ohjelma asennetaan seuraavaan kansioon. Jos haluat asentaa sen johonkin muuhun kansioon, valitse Selaa, ja valitse toinen kansio. $_CLICK\n# ^DirSubText\nKohdekansio\n# ^DirBrowseText\nValitse kansio, johon haluat asentaa ohjelman $(^NameDA):\n# ^UnDirText\nPoistetaan ohjelman $(^NameDA) seuraavasta kansiosta. Jos haluat poistaa sen jostakin muusta kansiosta, valitse Selaa, ja valitse toinen kansio. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nValitse kansio, josta haluat poistaa ohjelman $(^NameDA):\n# ^SpaceAvailable\n\"Tilaa vapaana: \"\n# ^SpaceRequired\n\"Tarvittava tila: \"\n# ^UninstallingText\nTämä ohjelma poistaa ohjelman $(^NameDA) tietokoneelta. $_CLICK\n# ^UninstallingSubText\nPoistetaan kansiosta:\n# ^FileError\nTiedostoon ei voitu kirjoittaa: \\r\\n\\t\"$0\"\\r\\nLopeta asennus valitsemalla Hylkää,\\r\\nyritä uudelleen valitsemalla Uudelleen, tai\\r\\nohita tiedosto valitsemalla Ohita\n# ^FileError_NoIgnore\nTiedostoon ei voitu kirjoittaa: \\r\\n\\t\"$0\"\\r\\nYritä uudelleen valitsemalla Uudelleen, tai\\r\\nlopeta asennus valitsemalla Hylkää\n# ^CantWrite\n\"Ei voi kirjoittaa: \"\n# ^CopyFailed\nKopiointi epäonnistui\n# ^CopyTo\n\"Kopioidaan kohteeseen \"\n# ^Registering\n\"Rekisteröidään: \"\n# ^Unregistering\n\"Poistetaan rekisteröinti: \"\n# ^SymbolNotFound\n\"Symbolia ei löytynyt: \"\n# ^CouldNotLoad\n\"Ei voitu ladata: \"\n# ^CreateFolder\n\"Luo kansio: \"\n# ^CreateShortcut\n\"Luo pikakuvake: \"\n# ^CreatedUninstaller\n\"Poisto-ohjelma luotiin: \"\n# ^Delete\n\"Poista: \"\n# ^DeleteOnReboot\n\"Poista käynnistyksen yhteydessä: \"\n# ^ErrorCreatingShortcut\n\"Virhe luotaessa pikakuvaketta: \"\n# ^ErrorCreating\n\"Virhe luotaessa: \"\n# ^ErrorDecompressing\nPakettia ei voitu purkaa. Korruptoitunut asennusohjelma?\n# ^ErrorRegistering\nVirhe rekisteröidessä DLL-tiedostoa\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Suorita: \"\n# ^Extract\n\"Pura: \"\n# ^ErrorWriting\n\"Pura: tiedostoon ei voitu kirjoittaa \"\n# ^InvalidOpcode\nAsennuspaketti on vioittunut: virheellinen opcode\n# ^NoOLE\n\"Ei OLEa: \"\n# ^OutputFolder\n\"Kansio: \"\n# ^RemoveFolder\n\"Poista kansio: \"\n# ^RenameOnReboot\n\"Muuta nimi uudelleenkäynnistyksen yhteydessä: \"\n# ^Rename\n\"Muuta nimi: \"\n# ^Skipped\n\"Ohitettiin: \"\n# ^CopyDetails\nKopioi tiedot leikepöydälle\n# ^LogInstall\nTallenna asennusloki\n# ^Byte\nt\n# ^Kilo\n k\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Finnish.nsh",
    "content": "﻿;Compatible with Modern UI 1.86\n;Language: Finnish (1035)\n;By Eclipser (Jonne Lehtinen) <Eclipser at pilvikaupunki dot com>\n;Updated by Puuhis (puuhis@puuhis.net)\n;Updated 11/08 by WTLib Team\n\n!insertmacro LANGFILE \"Finnish\" = \"Suomi\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Tervetuloa $(^NameDA) -ohjelman asennukseen\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Saat tarvittavia ohjeita sitä mukaa kuin $(^NameDA) -ohjelman asennus edistyy.$\\r$\\n$\\r$\\nOn suositeltavaa sulkea kaikki muut ohjelmat ennen asennuksen aloittamista, jotta asennus voi päivittää järjestelmätiedostoja käynnistämättä konetta uudelleen.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Tervetuloa $(^NameDA) -ohjelman poisto-ohjelmaan\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Saat tarvittavia ohjeita sitä mukaa kuin $(^NameDA) -ohjelman poisto edistyy.$\\r$\\n$\\r$\\nEnnen poiston aloittamista varmista, ettei $(^NameDA) ole käynnissä.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Käyttöoikeussopimus\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Lue käyttöehdot huolellisesti ennen $(^NameDA) -ohjelman asentamista.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Jos hyväksyt ehdot, valitse Hyväksyn. Ohjelman asentaminen edellyttää käyttöehtojen hyväksymistä.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jos hyväksyt ehdot, laita rasti alla olevaan ruutuun. Ohjelman asentaminen edellyttää käyttöehtojen hyväksymistä. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jos hyväksyt ehdot, valitse ensimmäinen vaihtoehto alapuolelta. Ohjelman asentaminen edellyttää käyttöehtojen hyväksymistä. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Käyttöoikeussopimus\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Lue käyttöehdot huolellisesti ennen $(^NameDA) -ohjelman poistoa.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Jos hyväksyt ehdot, valitse Hyväksyn. Ohjelman asentaminen edellyttää käyttöehtojen hyväksymistä.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jos hyväksyt ehdot, laita rasti alla olevaan ruutuun. Ohjelman asentaminen edellyttää käyttöehtojen hyväksymistä. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jos hyväksyt ehdot, valitse ensimmäinen vaihtoehto alapuolelta. Ohjelman asentaminen edellyttää käyttöehtojen hyväksymistä. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Paina Page Down -näppäintä nähdäksesi loput sopimuksesta.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Valitse komponentit\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Valitse toiminnot, jotka haluat asentaa ohjelmaan $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Valitse komponentit\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Valitse $(^NameDA) toiminnot, jotka haluat poistaa.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Selitys\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Siirrä hiiri komponentin nimen päälle nähdäksesi sen selityksen.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Valitse komponentti nähdäksesi sen selityksen.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Valitse asennuskansio\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Valitse kansio, johon haluat asentaa $(^NameDA) -ohjelman.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Valitse kansio, josta poistetaan\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Valitse kansio, josta $(^NameDA) poistetaan.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Asennetaan\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Odota... $(^NameDA) asennetaan...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Asennus valmis.\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Asennus onnistui.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Asennus keskeytyi.\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Asennus ei onnistunut.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Poistetaan\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Odota... $(^NameDA) poistetaan.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Poisto valmis.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Poisto onnistui.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Poisto keskeytyi.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Poisto epäonnistui.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) -ohjelman asennus on valmis\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) on asennettu tietokoneelle.$\\r$\\n$\\r$\\nValitse Valmis sulkeaksesi asennusohjelman.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA) -ohjelman asennuksen viimeisteleminen edellyttää tietokoneen uudelleenkäynnistämistä. Haluatko käynnistää tietokoneen uudelleen nyt?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) on poistettu\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) on poistettu tietokoneelta.$\\r$\\n$\\r$\\nValitse Lopeta sulkeaksesi poisto-ohjelman.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) -ohjelman poiston viimeisteleminen edellyttää tietokoneen uudelleenkäynnistämistä. Haluatko käynnistää tietokoneen uudelleen nyt?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Käynnistä uudelleen nyt\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Käynnistän uudelleen myöhemmin\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Käynnistä $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Näytä Lueminut-tiedosto\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Valmis\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Valitse Käynnistä-valikon kansio\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Valitse Käynnistä-valikon kansio, johon ohjelman pikakuvakkeet asennetaan.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Valitse Käynnistä-valikon kansio, johon haluat asentaa ohjelman pikakuvakkeet. Voit myös kirjoittaa uuden kansion nimen.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Älä luo pikakuvakkeita.\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Poista $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Poista $(^NameDA) tietokoneesta.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Haluatko varmasti keskeyttää $(^Name) -ohjelman asennuksen?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Haluatko varmasti keskeyttää $(^Name) -ohjelman poiston?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/French.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1036\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by the French NSIS team <veekee@winampfr.com> - http://www.winampfr.com/nsis.\n# Updated to v6 by Jerome Charaoui (lavamind@inetflex.com)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstallation de $(^Name)\n# ^UninstallCaption\nDésinstallation de $(^Name)\n# ^LicenseSubCaption\n: Licence\n# ^ComponentsSubCaption\n: Options d'installation\n# ^DirSubCaption\n: Dossier d'installation\n# ^InstallingSubCaption\n: Installation des fichiers\n# ^CompletedSubCaption\n: Terminé\n# ^UnComponentsSubCaption\n: Options de désinstallation\n# ^UnDirSubCaption\n: Dossier de désinstallation\n# ^ConfirmSubCaption\n: Confirmation\n# ^UninstallingSubCaption\n: Désinstallation des fichiers\n# ^UnCompletedSubCaption\n: Terminé\n# ^BackBtn\n< &Précédent\n# ^NextBtn\n&Suivant >\n# ^AgreeBtn\nJ'a&ccepte\n# ^AcceptBtn\nJ'a&ccepte les termes de la licence\n# ^DontAcceptBtn\nJe &n'accepte pas les termes de la licence\n# ^InstallBtn\n&Installer\n# ^UninstallBtn\n&Désinstaller\n# ^CancelBtn\nAnnuler\n# ^CloseBtn\n&Fermer\n# ^BrowseBtn\nP&arcourir...\n# ^ShowDetailsBtn\nP&lus d'infos\n# ^ClickNext\nCliquez sur Suivant pour continuer.\n# ^ClickInstall\nCliquez sur Installer pour démarrer l'installation.\n# ^ClickUninstall\nCliquez sur Désinstaller pour démarrer la désinstallation.\n# ^Name\nNom\n# ^Completed\nTerminé\n# ^LicenseText\nVeuillez examiner le contrat de licence avant d'installer $(^NameDA). Si vous acceptez tous les termes du contrat, cliquez sur J'accepte.\n# ^LicenseTextCB\nVeuillez examiner le contrat de licence avant d'installer $(^NameDA). Si vous acceptez tous les termes du contrat, cochez la boîte de contrôle ci-dessous. $_CLICK\n# ^LicesnseTextRB\nVeuillez examiner le contrat de licence avant d'installer $(^NameDA). Si vous acceptez tous les termes du contrat, sélectionnez la première option ci-dessous. $_CLICK\n# ^UnLicenseText\nVeuillez examiner le contrat de licence avant de désinstaller $(^NameDA). Si vous acceptez tous les termes du contrat, cliquez sur J'accepte.\n# ^UnLicenseTextCB\nVeuillez examiner le contrat de licence avant de désinstaller $(^NameDA). Si vous acceptez tous les termes du contrat, cochez la boîte de contrôle ci-dessous. $_CLICK\n# ^UnLicesnseTextRB\nVeuillez examiner le contrat de licence avant de désinstaller $(^NameDA). Si vous acceptez tous les termes du contrat, sélectionnez la première option ci-dessous. $_CLICK\n# ^Custom\nPersonnalisée\n# ^ComponentsText\nCochez les composants que vous désirez installer et décochez ceux que vous ne désirez pas installer. $_CLICK\n# ^ComponentsSubText1\nType d'installation :\n# ^ComponentsSubText2_NoInstTypes\nSélectionnez les composants à installer :\n# ^ComponentsSubText2\nOu, sélectionnez les composants optionnels que vous voulez installer :\n# ^UnComponentsText\nCochez les composants que vous désirez désinstaller et décochez ceux que vous ne désirez pas désinstaller. $_CLICK\n# ^UnComponentsSubText1\nSélectionnez le type de désinstallation :\n# ^UnComponentsSubText2_NoInstTypes\nSélectionnez les composants à désinstaller :\n# ^UnComponentsSubText2\nOu, sélectionnez les composants optionnels que vous voulez désinstaller :\n# ^DirText\nCeci installera $(^NameDA) dans le dossier suivant. Pour installer dans un autre dossier, cliquez sur Parcourir et choisissez un autre dossier. $_CLICK\n# ^DirSubText\nDossier d'installation\n# ^DirBrowseText\nSélectionnez le dossier d'installation pour $(^NameDA) :\n# ^UnDirText\nCeci désinstallera $(^NameDA) du dossier suivant. Pour désinstaller d'un autre dossier, cliquez sur Parcourir et choisissez un autre dossier. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSélectionnez le dossier de désinstallation pour $(^NameDA) :\n# ^SpaceAvailable\n\"Espace disponible : \"\n# ^SpaceRequired\n\"Espace requis : \"\n# ^UninstallingText\nCe programme désinstallera $(^NameDA) de votre ordinateur. $_CLICK\n# ^UninstallingSubText\nDésinstallation à partir de :\n# ^FileError\nErreur lors de l'ouverture du fichier en écriture : \\r\\n\\t\"$0\"\\r\\nAppuyez sur Abandonner pour annuler l'installation,\\r\\nRéessayer pour réessayer l'écriture du fichier, ou\\r\\nIgnorer pour passer ce fichier\n# ^FileError_NoIgnore\nErreur lors de l'ouverture du fichier en écriture : \\r\\n\\t\"$0\"\\r\\nAppuyez sur Réessayez pour re-écrire le fichier, ou\\r\\nAnnuler pour abandonner l'installation\n# ^CantWrite\n\"Impossible d'écrire : \"\n# ^CopyFailed\nÉchec de la copie\n# ^CopyTo\n\"Copier vers \"\n# ^Registering\n\"Enregistrement : \"\n# ^Unregistering\n\"Suppression de l'enregistrement : \"\n# ^SymbolNotFound\n\"Impossible de trouver un symbole : \"\n# ^CouldNotLoad\n\"Impossible de charger : \"\n# ^CreateFolder\n\"Création du dossier : \"\n# ^CreateShortcut\n\"Création du raccourci : \"\n# ^CreatedUninstaller\n\"Création de la désinstallation : \"\n# ^Delete\n\"Suppression : \"\n# ^DeleteOnReboot\n\"Suppression au redémarrage : \"\n# ^ErrorCreatingShortcut\n\"Erreur lors de la création du raccourci : \"\n# ^ErrorCreating\n\"Erreur de la création : \"\n# ^ErrorDecompressing\nErreur lors de la décompression des données ! Installation corrompue ?\n# ^ErrorRegistering\nErreur lors de l'enregistrement de la DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Exécution : \"\n# ^Extract\n\"Extraction : \"\n# ^ErrorWriting\n\"Extraction : erreur d'écriture du fichier \"\n# ^InvalidOpcode\nInstallation corrompue : opcode incorrect\n# ^NoOLE\n\"Pas de OLE pour : \"\n# ^OutputFolder\n\"Destination : \"\n# ^RemoveFolder\n\"Suppression du dossier : \"\n# ^RenameOnReboot\n\"Renommer au redémarrage : \"\n# ^Rename\n\"Renommer : \"\n# ^Skipped\n\"Passé : \"\n# ^CopyDetails\nCopier les Détails dans le Presse-papier\n# ^LogInstall\nEnregistrer le déroulement de l'installation\n# ^Byte\no\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/French.nsh",
    "content": "﻿;Language: French (1036)\n;By Sébastien Delahaye <seb@delahaye.net>\n\n!insertmacro LANGFILE \"French\" = \"Français\" \"Francais\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bienvenue dans le programme d'installation de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Vous êtes sur le point d'installer $(^NameDA) sur votre ordinateur.$\\r$\\n$\\r$\\nAvant de démarrer l'installation, il est recommandé de fermer toutes les autres applications. Cela permettra la mise à jour de certains fichiers système sans redémarrer votre ordinateur.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bienvenue dans le programme de désinstallation de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Vous êtes sur le point de désinstaller $(^NameDA) de votre ordinateur.$\\r$\\n$\\r$\\nAvant d'amorcer la désinstallation, assurez-vous que $(^NameDA) ne soit pas en cours d'exécution.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licence utilisateur\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Veuillez examiner les termes de la licence avant d'installer $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Si vous acceptez les conditions de la licence utilisateur, cliquez sur J'accepte pour continuer. Vous devez accepter la licence utilisateur afin d'installer $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si vous acceptez les conditions de la licence utilisateur, cochez la case ci-dessous. Vous devez accepter la licence utilisateur afin d'installer $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si vous acceptez les conditions de la licence utilisateur, sélectionnez le premier choix ci-dessous. Vous devez accepter la licence utilisateur afin d'installer $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licence utilisateur\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Veuillez examiner les conditions de la licence avant de désinstaller $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Si vous acceptez les conditions de la licence utilisateur, cliquez sur J'accepte pour continuer. Vous devez accepter la licence utilisateur afin de désinstaller $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si vous acceptez les conditions de la licence utilisateur, cochez la case ci-dessous. Vous devez accepter la licence utilisateur afin de désintaller $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si vous acceptez les conditions de la licence utilisateur, sélectionnez le premier choix ci-dessous. Vous devez accepter la licence utilisateur afin de désinstaller $(^NameDA).\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Appuyez sur Page Suivante pour lire le reste de la licence utilisateur.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Choisissez les composants\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Choisissez les composants de $(^NameDA) que vous souhaitez installer.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Choisissez les composants\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Cochez les composants de $(^NameDA) que vous souhaitez désinstaller.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Description\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Passez le curseur de votre souris sur un composant pour en voir la description.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Sélectionnez un composant pour en voir la description.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Choisissez le dossier d'installation\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Choisissez le dossier dans lequel installer $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Choisissez le dossier de désinstallation\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Choisissez le dossier à partir duquel vous voulez désinstaller $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installation en cours\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Veuillez patienter pendant l'installation de $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installation terminée\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"L'installation s'est terminée avec succès.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installation interrompue\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"L'installation n'a pas été terminée.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Désinstallation en cours\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Veuillez patienter pendant la désinstallation de $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Désinstallation terminée\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"La désinstallation s'est terminée avec succès.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Désinstallation interrompue\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"La désinstallation n'a pas été terminée.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Fin de l'installation de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) a été installé sur votre ordinateur.$\\r$\\n$\\r$\\nCliquez sur Fermer pour quitter le programme d'installation.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Votre ordinateur doit être redémarré afin de compléter l'installation de $(^NameDA). Souhaitez-vous redémarrer maintenant ?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Fin de la désinstallation de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) a été supprimé de votre ordinateur.$\\r$\\n$\\r$\\nCliquez sur Fermer pour quitter le programme d'installation.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Votre ordinateur doit être redémarré pour terminer la désinstallation de $(^NameDA). Souhaitez-vous redémarrer maintenant ?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Redémarrer maintenant\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Je souhaite redémarrer moi-même plus tard\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Lancer $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Afficher le fichier Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Fermer\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Choisissez un dossier dans le menu Démarrer\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Choisissez un dossier dans le menu Démarrer pour les raccourcis de l'application.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Choisissez le dossier du menu Démarrer dans lequel vous voulez placer les raccourcis du programme. Vous pouvez également entrer un nouveau nom pour créer un nouveau dossier.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ne pas créer de raccourcis\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Désinstaller $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Supprimer $(^NameDA) de votre ordinateur.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Êtes-vous sûr de vouloir quitter l'installation de $(^Name) ?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Êtes-vous sûr de vouloir quitter la désinstallation de $(^Name) ?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Choix des utilisateurs\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Sélection des utilisateurs désirant utiliser $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Choix entre installer $(^NameDA) seulement pour vous-même ou bien pour tous les utilisateurs du système. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installer pour tous les utilisateurs\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installer seulement pour moi\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Galician.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1110\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation v 1.0.0 by Ramon Flores <fa2ramon@usc.es>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalación de $(^Name)\n# ^UninstallCaption\nDesinstalación de $(^Name)\n# ^LicenseSubCaption\n: Contrato de licenza\n# ^ComponentsSubCaption\n: Opcións de instalación\n# ^DirSubCaption\n: Diretória de instalación\n# ^InstallingSubCaption\n: Instalando ficheiros\n# ^CompletedSubCaption\n: Concluído\n# ^UnComponentsSubCaption\n: Opcións de desinstalación\n# ^UnDirSubCaption\n: Cartafol de desinstalación\n# ^ConfirmSubCaption\n: Confirmación\n# ^UninstallingSubCaption\n: Desinstalando\n# ^UnCompletedSubCaption\n: Concluído\n# ^BackBtn\n< &Anterior\n# ^NextBtn\n&Seguinte >\n# ^AgreeBtn\n&Aceito\n# ^AcceptBtn\nEu &aceito os termos do Contrato de licenza\n# ^DontAcceptBtn\nEu &non aceito os termos do Contrato de licenza\n# ^InstallBtn\n&Instalar\n# ^UninstallBtn\n&Desinstalar\n# ^CancelBtn\nCancelar\n# ^CloseBtn\n&Fechar\n# ^BrowseBtn\n&Procurar...\n# ^ShowDetailsBtn\nVer &Detalles\n# ^ClickNext\nClique en 'Seguinte' para continuar.\n# ^ClickInstall\nClique en 'Instalar' para iniciar a instalación.\n# ^ClickUninstall\nClique en 'Desinstalar' para iniciar a desinstalación.\n# ^Name\nNome\n# ^Completed\nConcluído\n# ^LicenseText\nPor favor revexa o acordo de licenza antes de instalar $(^NameDA). Se concordar con todos os termos da licenza, clique em 'Aceito'.\n# ^LicenseTextCB\nPor favor reveja o acordo de licenza antes de instalar $(^NameDA). Se concordar con todos os termos da licenza, clique na caixa de selección abaixo. $_CLICK\n# ^LicenseTextRB\nPor favor revexa o acordo de licenza antes de instalar $(^NameDA). Se concordar con todos os termos da licenza, escolla a primeira opción abaixo. $_CLICK\n# ^UnLicenseText\nPor favor revexa o acordo de licenza antes de desinstalar $(^NameDA). Se concordar con todos os termos da licenza, clique em 'Aceito'.\n# ^UnLicenseTextCB\nPor favor reveja o acordo de licenza antes de desinstalar $(^NameDA). Se concordar con todos os termos da licenza, clique na caixa de selección abaixo. $_CLICK\n# ^UnLicenseTextRB\nPor favor revexa o acordo de licenza antes de desinstalar $(^NameDA). Se concordar con todos os termos da licenza, escolla a primeira opción abaixo. $_CLICK\n# ^Custom\nPersonalizado\n# ^ComponentsText\nMarque os componentes que desexa instalar e desmarque os componentes que non desexa instalar. $_CLICK\n# ^ComponentsSubText1\nEscolla o tipo de instalación:\n# ^ComponentsSubText2_NoInstTypes\nEscolla os componentes para instalar:\n# ^ComponentsSubText2\nOu, escolla os componentes opcionais que desexa instalar:\n# ^UnComponentsText\nMarque os componentes que queira desinstalar e vice versa. $_CLICK\n# ^UnComponentsSubText1\nEscolla o tipo de desinstalación:\n# ^UnComponentsSubText2_NoInstTypes\nEscolla os componentes para desinstalar:\n# ^UnComponentsSubText2\nOu, escolla os componentes opcionais que queira desinstalar:\n# ^DirText\nO $(^NameDA) será instalado na seguinte directória. Para instalar nunha directória diferente, clique en 'Procurar...' e escolla outra directória. $_CLICK\n# ^DirSubText\nDirectória de destino\n# ^DirBrowseText\nEscolla unha directória para instalar o $(^NameDA):\n# ^UnDirText\nO $(^NameDA) será desinstalado da seguinte directória. Para desinstalar dunha pasta diferente, clique en 'Procurar...' e escolla outra directória. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nEscolla a directória de onde vai ser desinstalado o $(^NameDA):\n# ^SpaceAvailable\n\"Espazo disponíbel: \"\n# ^SpaceRequired\n\"Espazo necesário: \"\n# ^UninstallingText\n$(^NameDA) vai ser desinstalado da seguinte directória. $_CLICK\n# ^UninstallingSubText\nDesinstalando de:\n# ^FileError\nErro ao abrir ficheiro para escrita: \\r\\n\\t\"$0\"\\r\\nClique en Abortar para abortar a instalación,\\r\\nRepetir para tentar novamente a escrita do ficheiro, ou\\r\\nIgnorar para ignorar este ficheiro.\n# ^FileError_NoIgnore\nErro ao abrir ficheiro para escrita: \\r\\n\\t\"$0\"\\r\\nClique en Repetir para tentar novamente a gravación do ficheiro, ou\\r\\nCancelar para abortar a instalación.\n# ^CantWrite\n\"Non foi posíbel escreber: \"\n# ^CopyFailed\nFalla ao copiar\n# ^CopyTo\n\"Copiar para \"\n# ^Registering\n\"Rexistando: \"\n# ^Unregistering\n\"Desrexistando: \"\n# ^SymbolNotFound\n\"Símbolo non achado: \"\n# ^CouldNotLoad\n\"Non foi posíbel carregar: \"\n# ^CreateFolder\n\"Criando diretória: \"\n# ^CreateShortcut\n\"Criando atallo: \"\n# ^CreatedUninstaller\n\"Criando desinstalador: \"\n# ^Delete\n\"Eliminando ficheiro: \"\n# ^DeleteOnReboot\n\"Eliminar ao reiniciar: \"\n# ^ErrorCreatingShortcut\n\"Erro ao criar atallo: \"\n# ^ErrorCreating\n\"Erro ao criar: \"\n# ^ErrorDecompressing\nErro ao descomprimir dados! Instalador corrompido?\n# ^ErrorRegistering\nErro ao rexistar DLL\n# ^ExecShell\n\"Executando polo Shell: \"\n# ^Exec\n\"Executando: \"\n# ^Extract\n\"Extraindo: \"\n# ^ErrorWriting\n\"Extraindo: erro ao escreber ficheiro \"\n# ^InvalidOpcode\nInstalador corrompido: código de operación inválido\n# ^NoOLE\n\"Sen OLE para: \"\n# ^OutputFolder\n\"Cartafol de destino: \"\n# ^RemoveFolder\n\"Removendo cartafol: \"\n# ^RenameOnReboot\n\"Renomear ao reiniciar: \"\n# ^Rename\n\"Renomeando: \"\n# ^Skipped\n\"Ignorado: \"\n# ^CopyDetails\nCopiar detalles para a Área de transférencia\n# ^LogInstall\nRexistar proceso de instalación\n# ^Byte\nB\n# kilo\n K\n# mega\n M\n# giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Galician.nsh",
    "content": "﻿;Language: Galician (1110)\n;Ramon Flores <fa2ramon@usc.es>\n\n!insertmacro LANGFILE \"Galician\" = \"Galego\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Benvindo ao Asistente de Instalación do $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Este asistente vai axudá-lo durante a instalación do $(^NameDA).$\\r$\\n$\\r$\\nRecomenda-se fechar todas as outras aplicacións antes de iniciar a instalación. Isto posibilita actualizar os ficheiros do sistema relevantes sen ter que reiniciar o computador.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Benvindo ao Asistente de desinstalación do $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Este asistente vai axudá-lo durante a desinstalación do $(^NameDA).$\\r$\\n$\\r$\\nAntes de iniciar a desinstalación, certifique-se de que o $(^NameDA) non está a executar-se.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Contrato de licenza\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Por favor, verifique os termos da licenza antes de instalar o $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Se aceitar os termos da licenza, clique en 'Aceito' para continuar. Cumpre aceitar o contrato para instalar o $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se aceitar os termos da licenza, clique na caixa de selección abaixo. Cumpre aceitar o contrato para instalar o $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se aceitar os termos da licenza, seleccione a primeira opción abaixo. Cumpre aceitar o contrato para instalar o $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Contrato de licenza\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Por favor, verifique os termos da licenza antes de desinstalar o $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Se aceitar os termos da licenza, clique en 'Aceito' para continuar. Cumpre aceitar o contrato para desinstalar o $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se aceitar os termos da licenza, clique na caixa de selección abaixo. Cumpre aceitar o contrato para desinstalar o $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se aceitar os termos da licenza, seleccione a primeira opción abaixo. Cumpre aceitar o contrato para desinstalar o $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Prema Page Down para ver o restante da licenza.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Escolla de componentes\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Escolla que características do $(^NameDA) que desexa instalar.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Escoller componentes\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Escolla que características do $(^NameDA) desexa desinstalar.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descrición\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Posicione o rato sobre un componente para ver a sua descrición.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Seleccione un componente para ver a sua descrición.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Escolla do local da instalación\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Escolla a directória na cal desexa instalar o $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Escolla o Local de desinstalación\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Escolla a directória de onde pretende desinstalar o $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalando\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Por favor, agarde entanto o $(^NameDA) está sendo instalado.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalación completa\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"A instalación concluiu con suceso.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalación Abortada\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"A instalación concluiu sen suceso.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Desinstalando\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Por favor, agarde entanto se desinstala o $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Desinstalación completa\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"A desinstalación concluiu con suceso.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Desinstalación abortada\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"A desinstalación non concluiu con suceso\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Concluindo o Asistente de instalación do $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Instalou-se o $(^NameDA) no seu computador.$\\r$\\n$\\r$\\nClique en Rematar para fechar este asistente.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Cumpre reiniciar o seu computador para concluír a instalación do $(^NameDA). Desexa reiniciar agora?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Concluíndo o asistente de desinstalación do $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Eliminou-se $(^NameDA) do seu computador.$\\r$\\n$\\r$\\nClique em Rematar para fechar este asistente.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Cumpre reiniciar o seu computador para concluír a desinstalación do $(^NameDA). Desexa reiniciá-lo agora?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reiniciar agora\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Prefiro reinicia-lo manualmente despois\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Executar $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Mostrar Leame\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Rematar\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Escolla un cartafol do Menu Iniciar\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Escolla un cartafol do Menu Iniciar para os atallos do programa.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Seleccione o cartafol do Menu Iniciar no que desexa criar os atallos do programa. Tamén é posíbel dixitar un nome para criar un novo cartafol. \"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Non criar atallos\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstalar $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Eliminar o $(^NameDA) do seu computador.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Realmente desexa cancelar a instalación do $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Realmente desexa cancelar a desinstalación do $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Georgian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1079\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1200\n# RTL - anything else than RTL means LTR\n-\n#Translation by David Huriev\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nჩატვირთვა $(^Name)\n# ^UninstallCaption\n$(^Name)–ის წაშლა\n# ^LicenseSubCaption\n: სალიცენზიო შეთანხმება\n# ^ComponentsSubCaption\n: ჩატვირთვის მონაცემები\n# ^DirSubCaption\n: საინსტალაციო ფოლდერი\n# ^InstallingSubCaption\n: ფაილების კოპირება\n# ^CompletedSubCaption\n: ოპერაცია დასრულებულია\n# ^UnComponentsSubCaption\n: წაშლის მონაცემები\n# ^UnDirSubCaption\n: წაშლის ფოულდერი\n# ^ConfirmSubCaption\n: თანხმობა\n# ^UninstallingSubCaption\n: ფაილების წაშლა\n# ^UnCompletedSubCaption\n: ოპერაცია დასრულებულია\n# ^BackBtn\n< &უკან\n# ^NextBtn\n&შემდეგ >\n# ^AgreeBtn\nვეთანხმე&ბი\n# ^AcceptBtn\n&ვეთანხმები სალიცენზიო პირობებს\n# ^DontAcceptBtn\n&არ ვეთანხმები სალიცენზიო პირობებს\n# ^InstallBtn\n&ჩატვირთვა\n# ^UninstallBtn\nწაშ&ლა\n# ^CancelBtn\nუარი\n# ^CloseBtn\n&დახურვა\n# ^BrowseBtn\nდათ&ვალიერება...\n# ^ShowDetailsBtn\n&დეტალები...\n# ^ClickNext\nგასაგრძელებლად დააწკაპუნეთ ღილაკზე 'შემდეგ'.\n# ^ClickInstall\nდააწკაპუნეთ ღილაკზე 'ჩატვირთვა', პროგრამის ჩასატვირთად.\n# ^ClickUninstall\nდააწკაპუნეთ ღილაკზე 'წაშლა', პროგრამის წასაშლელად.\n# ^Name\nსახელი\n# ^Completed\nჩაიტვირთა\n# ^LicenseText\nსანამ ჩაიტვირთება $(^NameDA) გაეცანით სალიცენზიო ხელშეკრულებას. თუ ეთანხმებით პირობებს დააწკაპუნეთ ღილაკზე 'თანხმობა'.\n# ^LicenseTextCB\nსანამ ჩაიტვირთება $(^NameDA) გაეცანით სალიცენზიო ხელშეკრულებას. თუ ეთანხმებით პირობებს მონიშნეთ ფანჯარა ქვემოთ. $_CLICK\n# ^LicenseTextRB\nსანამ ჩაიტვირთება $(^NameDA) გაეცანით სალიცენზიო ხელშეკრულებას. თუ ეთანხმებით პირობებს მონიშნეთ ქვემოთ მოცემული პირველი ვარიანტი. $_CLICK\n# ^UnLicenseText\nსანამ წაშლით $(^NameDA) გაეცანით სალიცენზიო ხელშეკრულებას. თუ ეთანხმებით პირობებს დააწკაპუნეთ ღილაკზე 'თანხმობა'.\n# ^UnLicenseTextCB\nსანამ წაშლით $(^NameDA) გაეცანით სალიცენზიო ხელშეკრულებას. თუ ეთანხმებით პირობებს მონიშნეთ ფანჯარა ქვემოთ. $_CLICK\n# ^UnLicenseTextRB\nსანამ წაშლით $(^NameDA) გაეცანით სალიცენზიო ხელშეკრულებას. თუ ეთანხმებით პირობებს მონიშნეთ ქვემოთ მოცემული პირველი ვარიანტი. $_CLICK\n# ^Custom\nსტანდარტული\n# ^ComponentsText\nაირჩიეთ ის კომპონენტები, რომლის ჩატვირთვაც გსურთ. $_CLICK\n# ^ComponentsSubText1\nაირჩიეთ ჩატვირთვის მეთოდი:\n# ^ComponentsSubText2_NoInstTypes\nჩასატვირთად აირჩიეთ პროგრამის კომპონენტები:\n# ^ComponentsSubText2\nან ჩასატვირთად აირჩიეთ პროგრამის დამატებითი კომპონენტები:\n# ^UnComponentsText\nაირჩიეთ ის კომპონენტები, რომლის წაშლაც გსურთ. $_CLICK\n# ^UnComponentsSubText1\nაირჩიეთ წაშლის მეთოდი:\n# ^UnComponentsSubText2_NoInstTypes\nწასაშლელად აირჩიეთ პროგრამის კომპონენტები:\n# ^UnComponentsSubText2\nან წასაშლელად აირჩიეთ პროგრამის დამატებითი კომპონენტები:\n# ^DirText\nპროგრამა ჩაგიტვირთავთ $(^NameDA)–ის მითითებულ ფოლდერში. სხვა ადგილზე ჩასატვირთად დააწკაპუნეთ ღილაკზე 'დათვალიერება' და მიუთითეთ ადგილი. $_CLICK\n# ^DirSubText\nჩატვირთვის ფოლდერი\n# ^DirBrowseText\nმითითეთ ფოლდერი სადაც უნდა ჩაიტვირთოს $(^NameDA):\n# ^UnDirText\nპროგრამა წაშლის $(^NameDA)–ის მითითებული ფოლდერიდან. სხვა ფოლდერიდან წასაშლელად დააწკაპუნეთ ღილაკზე 'დათვალიერება' და მიუთითეთ ადგილი. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nმიუთითეთ ფოლდერი საიდანაც უნდა წაიშალოს $(^NameDA):\n# ^SpaceAvailable\n\"Доступно на диске: \"\n# ^SpaceRequired\n\"Требуется на диске: \"\n# ^UninstallingText\nპროგრამა $(^NameDA) წაიშლება თქვენი კომპიუტერიდან. $_CLICK\n# ^UninstallingSubText\nწაშლა:\n# ^FileError\nარ იხსნება ფაილები ჩასაწერად: \\r\\n\\t\"$0\"\\r\\n'შეჩერება': შეჩერდეს ჩატვირთვა;\\r\\n\"გამეორება\": მცდელობის გამეორება;\\r\\n\"გამოტოვება\": ამ მოქმედების გამოტოვება.\n# ^FileError_NoIgnore\nარ იხსნება ფაილეი ჩასაწერად: \\r\\n\\t\"$0\"\\r\\n'გამეორება': მცდელობის გამეორება;\\r\\n'უარი': ჩატვირთვის პროცესის შეწყვეტა.\n# ^CantWrite\n\"არ იწერება: \"\n# ^CopyFailed\nშეცდომა ჩაწერის დროს\n# ^CopyTo\n\"კოპირება: \"\n# ^Registering\n\"რეგისტრირება: \"\n# ^Unregistering\n\"რეგისტრირებიდან მოხსნა: \"\n# ^SymbolNotFound\n\"ვერ მოიძებნა სიმბოლო: \"\n# ^CouldNotLoad\n\"ჩატვირთვა შეუძლებელია: \"\n# ^CreateFolder\n\"ფოლდერის შექმნა: \"\n# ^CreateShortcut\n\"იარლიყის შექმნა: \"\n# ^CreatedUninstaller\n\"წაშლის პროგრამის შექმნა: \"\n# ^Delete\n\"ფაილის წაშლა: \"\n# ^DeleteOnReboot\n\"წაიშლება კომპიუტერის გადატვირთვის დროს: \"\n# ^ErrorCreatingShortcut\n\"იარლიყის შექმნისას დაშვებულია შეცდომა: \" \n# ^ErrorCreating\n\"შექმნისას დაშვებულია შეცდომა: \"\n# ^ErrorDecompressing\nშეცდომა მონაცემების გახსნისას! შესაძლოა საინსტალაციო პროგრამაა დაზიანებული.\n# ^ErrorRegistering\nარ რეგისტრირდება (DLL)\n# ^ExecShell\n\"ExecShell: \" \n# ^Exec\n\"შესრულება: \"\n# ^Extract\n\"ამონაწერი: \"\n# ^ErrorWriting\n\"ამონაწერი: შეცდომაა დაშვებული ფაილის ჩაწერისას \"\n# ^InvalidOpcode\nსაინსტალაციო პროგრამა დაზიანებულია: კოდი არ არსებობს\n# ^NoOLE\n\"OLE არ არის: \" \n# ^OutputFolder\n\"ჩატვირთვის ფოლდერი: \"\n# ^RemoveFolder\n\"ფოლდერის წაშლა: \"\n# ^RenameOnReboot\n\"სახელის შეცვლა კომპიუტერის გადავირთვისას: \"\n# ^Rename\n\"სახელის შეცვლა: \"\n# ^Skipped\n\"გამოტოვა: \"\n# ^CopyDetails\nმონაცემების ბუფერში კოპირება \n# ^LogInstall\nჩატვირთვის აღწერა\n# byte\nB\n# kilo\n K\n# mega\n M\n# giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Georgian.nsh",
    "content": "﻿;Language: Georgian (1079)\n;Translation by David Huriev and format updated by Jim Park\n\n!insertmacro LANGFILE \"Georgian\" = \"ქართული\" \"Kartuli\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"მოგესალმებათ $(^NameDA)–ის საინსტალაციო პროგრამა\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"ეს პროგრამა ჩატვირთავს $(^NameDA)–ს თქვენს კომპიუტერში.$\\r$\\n$\\r$\\nჩატვირთვამდე რეკომენდირებულია ყველა პროგრამის დახურვა. ამ შემთხვევაში პროგრამა სისტემურ ფაილებს ისე შეცვლის, რომ კომპიუტერს გადატვირთვა არ დასჭირდება.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"მოგესალმებათ $(^NameDA)–ის დეინსტალაციის ფანჯარა\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"ეს პროგრამა წაშლის $(^NameDA)–ს კომპიუტერიდან.$\\r$\\n$\\r$\\nწაშლამდე დახურეთ პროგრამა $(^NameDA).$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"სალიცენზიო შეთანხმება\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"სანამ $(^NameDA)–ს ჩატვირთავთ გაეცანით სალიცენზიო შეთანხმებას.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"თუ ეთანხმებით პირობებს, დააწკაპუნეთ ღილაკზე $\\\"ვეთანხმები$\\\". პროგრამის ჩასატვირთად აუცილებელია დათანხმება.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"თუ ეთანხმებით პირობებს, მონიშნეთ ფანჯარა ქვემოთ. $(^NameDA)–ის ჩასატვირთად აუცილებელია პირობებზე დათანხმება. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"თუ ეთანხმებით პირობებს მონიშნეთ ქვემოთ მოცემული პირველი ვარიანტი. $(^NameDA)–ის ჩასატვირთად აუცილებელია პირობებზე დათანხმება. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"სალიცენზიო შეთანხმება\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"სანამ წაშლით $(^NameDA)–ს გაეცანით სალიცენზიო შეთანხმებას.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"თუ ეთანხმებით პირობებს დააწკაპუნეთ ღილაკზე $\\\"თანხმობა$\\\". $(^NameDA)–ის წასაშლელად საჭიროა პიროებებზე დათანხმება. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"თუ ეთანხმებით პირობებს მონიშნეთ ფანჯარა ქვემოთ. $(^NameDA)–ს წასაშლელად საჭიროა პიროებებზე დათანხმება. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"თუ ეთანხმებით პირობებს მონიშნეთ ქვემოთ მოცემული პირველი ვარიანტი. $(^NameDA)–ს წასაშლელად საჭიროა პიროებებზე დათანხმება. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"ტექსტის წასაკითხად გამოიყენეთ ღილაკები $\\\"PageUp$\\\" და $\\\"PageDown$\\\".\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"ჩასატვირთი პროგრამის კომპონენტები\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"აირჩიეთ $(^NameDA)–ის კომპონენტები, რომლის ჩატვირთაც გსურთ.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"პროგრამის კომპონენტები\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"აირჩიეთ $(^NameDA)–ის კომპონენტები, რომლის წაშლაც გსურთ.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"შემადგენლობა\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"მიიყვანეთ მაუსი კომპონენტის სახელწოდებასთან მის სრულად წასაკითხად.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"აირჩიეთ კომპონენტი, შემადგენლობის დასანახად.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"ჩასატვირთი ფოლდერის მონიშვნა\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"აირჩიეთ $(^NameDA)–ს ჩასატვირთი ფოლდერი.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"წასაშლელი ფოლდერის მონიშვნა\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"მიუთითეთ ფოლდერი, საიდანაც უნდა წაიშალოს $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"ჩატვირთვა\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"დაელოდეთ, მიმდინარეობს $(^NameDA)–ის ჩატვირთვა...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"ჩატვირთვა დასრულებულია\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"პროგრამა წარმატებით ჩაიტვირთა.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"ჩატვირთვა შეწყდა\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"ჩატვირთვა არ დასრულებულა.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"წაშლა\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"დაელოდეთ, მიმდინარეობს $(^NameDA)–ის წაშლა...\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"წაიშალა\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"პროგრამა სრულად წაიშალა.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"შეწყდა წაშლა\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"სრულად არ წაშლილა.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"დასრულდა $(^NameDA)–ის საინსტალაციო პროგრამა\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) ჩაიტვირთა კომპიუტერში.$\\r$\\n$\\r$\\nდააწკაპუნეთ ღილაკზე $\\\"მზადაა$\\\" საინსტალაციო პროგრამიდან გამოსასვლელად.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA)–ის ჩატვირთვის დასასრულებლად გადატვირთეთ კომპიუტერი. ახლავე გსურთ მისი გადატვირთვა?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA)–ის წაშლის პროგრამა\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) წაიშალა კომპიუტერიდან.$\\r$\\n$\\r$\\nდააწკაპუნეთ ღილაკზე $\\\"მზადაა$\\\" წაშლის პროგრამიდან გამოსასვლელად.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA)–ის სრულად წასაშლელად გადატვირთეთ კომპიუტერი. ახლავე გსურთ მისი გადატვირთვა?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"დიახ, ახლავე გადაიტვირთოს\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"არა, მოგვიანებით გადავტვირთავ კომპიუტერს\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA)–ის &ჩართვა\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"ReadMe &ფაილის ჩვენება\" #FIXME: BUGBUG \"ReadMe\"?\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&მზადაა\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"მენიუში არსებული ფოლდერი $\\\"სტარტი$\\\"\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"აირჩიეთ ფოლდერი მენიუში $\\\"სტარტი$\\\" $(^NameDA)–ის იარლიყების განსათავსებლად.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"აირჩიეთ ფოლდერი მენიუში $\\\"სტარტი$\\\", სადაც განთავსდება პროგრამის იარლიყები. თქვენ სხვა სახელიც შეგიძლიათ მიუთითოთ ახალი ფოლდერის შესაქმნელად.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"არ შეიქმნას იარლიყი\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA)–ის წაშლა\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA)–ის კომპიუტერიდან წაშლა.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"ნამდვილად გსურთ უარი თქვათ $(^Name)–ის ჩატვირთვაზე?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"ნამდვილად გსურთ უარი თქვათ $(^Name)–ის წაშლაზე?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/German.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1031\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by L.King, changes by R. Bisswanger, Tim Kosse, Frederik Schwarzer & Sebastian Stange\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstallation von $(^Name)\n# ^UninstallCaption\nDeinstallation von $(^Name)\n# ^LicenseSubCaption\n: Lizenzabkommen\n# ^ComponentsSubCaption\n: Installationsoptionen\n# ^DirSubCaption\n: Zielverzeichnis\n# ^InstallingSubCaption\n: Wird installiert\n# ^CompletedSubCaption\n: Fertig\n# ^UnComponentsSubCaption\n: Deinstallationsoptionen\n# ^UnDirSubCaption\n: Quellverzeichnis\n# ^ConfirmSubCaption\n: Bestätigung\n# ^UninstallingSubCaption\n: Wird entfernt\n# ^UnCompletedSubCaption\n: Fertig\n# ^BackBtn\n< &Zurück\n# ^NextBtn\n&Weiter >\n# ^AgreeBtn\n&Annehmen\n# ^AcceptBtn\nLizenzabkommen &akzeptieren\n# ^DontAcceptBtn\nLizenzabkommen ab&lehnen\n# ^InstallBtn\n&Installieren\n# ^UninstallBtn\n&Deinstallieren\n# ^CancelBtn\nAbbrechen\n# ^CloseBtn\n&Beenden\n# ^BrowseBtn\n&Durchsuchen ...\n# ^ShowDetailsBtn\n&Details anzeigen\n# ^ClickNext\nKlicken Sie auf Weiter, um fortzufahren.\n# ^ClickInstall\nKlicken Sie auf Installieren, um die Installation zu starten.\n# ^ClickUninstall\nKlicken Sie auf Deinstallieren, um die Deinstallation zu starten.\n# ^Name\nName\n# ^Completed\nFertig\n# ^LicenseText\nBitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) installieren. Wenn Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen.\n# ^LicenseTextCB\nBitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) installieren. Wenn Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kontrollkästchen. $_CLICK\n# ^LicenseTextRB\nBitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) installieren. Wenn Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie die entsprechende Option. $_CLICK\n# ^UnLicenseText\nBitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) entfernen. Wenn Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen.\n# ^UnLicenseTextCB\nBitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) entfernen. Wenn Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kontrollkästchen. $_CLICK\n# ^UnLicenseTextRB\nBitte lesen Sie das Lizenzabkommen, bevor Sie $(^NameDA) entfernen. Wenn Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie die entsprechende Option. $_CLICK\n# ^Custom\nBenutzerdefiniert\n# ^ComponentsText\nWählen Sie die Komponenten, welche Sie installieren wollen. $_CLICK\n# ^ComponentsSubText1\nInstallationstyp bestimmen:\n# ^ComponentsSubText2_NoInstTypes\nWählen Sie die zu installierenden Komponenten:\n# ^ComponentsSubText2\noder wählen Sie zusätzliche zu installierende Komponenten:\n# ^UnComponentsText\nWählen Sie die Komponenten, welche Sie entfernen wollen. $_CLICK\n# ^UnComponentsSubText1\nDeinstallationstyp bestimmen:\n# ^UnComponentsSubText2_NoInstTypes\nWählen Sie die zu entfernenden Komponenten:\n# ^UnComponentsSubText2\noder wählen Sie zusätzliche Komponenten, welche Sie entfernen möchten:\n# ^DirText\n$(^NameDA) wird in das unten angegebene Verzeichnis installiert. Falls Sie in ein anderes Verzeichnis installieren möchten, klicken Sie auf Durchsuchen und wählen Sie ein anderes Verzeichnis aus. $_CLICK\n# ^DirSubText\nZielverzeichnis\n# ^DirBrowseText\nWählen Sie das Verzeichnis aus, in das Sie $(^NameDA) installieren möchten:\n# ^UnDirText\n$(^NameDA) wird aus dem unten angegebenen Verzeichnis entfernt. Falls sich $(^NameDA) in einem anderen Verzeichnis befindet, klicken Sie auf Durchsuchen und wählen Sie das richtige Verzeichnis aus. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nWählen Sie das Verzeichnis aus, in dem sich $(^NameDA) befindet:\n# ^SpaceAvailable\n\"Verfügbarer Speicher: \"\n# ^SpaceRequired\n\"Benötigter Speicher: \"\n# ^UninstallingText\n$(^NameDA) wird aus dem unten angegebenen Verzeichnis entfernt. $_CLICK\n# ^UninstallingSubText\nWird entfernt aus:\n# ^FileError\nFehler beim Überschreiben der Datei: \\r\\n\\t\"$0\"\\r\\nKlicken Sie auf Abbrechen, um abzubrechen,\\r\\nauf Wiederholen, um den Schreibvorgang erneut zu versuchen,\\r\\noder auf Ignorieren, um diese Datei zu überspringen.\n# ^FileError_NoIgnore\nFehler beim Überschreiben der Datei: \\r\\n\\t\"$0\"\\r\\nKlicken Sie auf Wiederholen, um den Schreibvorgang erneut zu versuchen,\\r\\noder auf Abbrechen, um die Installation zu beenden.\n# ^CantWrite\n\"Fehler beim Schreiben: \"\n# ^CopyFailed\nKopieren fehlgeschlagen\n# ^CopyTo\n\"Wird kopiert nach \"\n# ^Registering\n\"Wird registriert: \"\n# ^Unregistering\n\"Wird deregistriert: \"\n# ^SymbolNotFound\n\"Symbol ist nicht vorhanden: \"\n# ^CouldNotLoad\n\"Fehler beim Laden von \"\n# ^CreateFolder\n\"Verzeichnis wird erstellt: \"\n# ^CreateShortcut\n\"Verknüpfung wird erstellt: \"\n# ^CreatedUninstaller\n\"Deinstallationsprogramm wird erstellt: \"\n# ^Delete\n\"Datei wird gelöscht: \"\n# ^DeleteOnReboot\n\"Datei wird nach Neustart gelöscht: \"\n# ^ErrorCreatingShortcut\n\"Fehler beim Erstellen der Verknüpfung: \"\n# ^ErrorCreating\n\"Fehler beim Erstellen: \"\n# ^ErrorDecompressing\nFehler beim Entpacken. Ist das Installationsprogramm beschädigt?\n# ^ErrorRegistering\nFehler beim Registrieren der DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Wird gestartet: \"\n# ^Extract\n\"Wird entpackt: \"\n# ^ErrorWriting\n\"Entpacken: Fehler beim Schreiben der Datei \"\n# ^InvalidOpcode\nBeschädigtes Installationsprogramm: ungültiger Befehlscode\n# ^NoOLE\n\"Kein OLE für: \"\n# ^OutputFolder\n\"Zielverzeichnis: \"\n# ^RemoveFolder\n\"Verzeichnis wird entfernt: \"\n# ^RenameOnReboot\n\"Umbenennen nach Neustart: \"\n# ^Rename\n\"Umbenennen: \"\n# ^Skipped\n\"Übersprungen: \"\n# ^CopyDetails\nDetails in die Zwischenablage kopieren\n# ^LogInstall\nInstallationsverlauf protokollieren\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/German.nsh",
    "content": "﻿;Language: German (1031)\n;By L.King, changes by K. Windszus, R. Bisswanger, M. Simmack, D. Weiß, Frederik Schwarzer & S. Stange\n\n!insertmacro LANGFILE \"German\" = \"Deutsch\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Willkommen zur Installation$\\r$\\nvon $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Dieser Assistent wird Sie durch die Installation von $(^NameDA) begleiten.$\\r$\\n$\\r$\\nEs wird empfohlen, vor der Installation alle anderen Programme zu schließen, damit bestimmte Systemdateien ohne Neustart ersetzt werden können.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Willkommen zur Deinstallation$\\r$\\nvon $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Dieser Assistent wird Sie durch die Deinstallation von $(^NameDA) begleiten.$\\r$\\n$\\r$\\nBitte beenden Sie $(^NameDA), bevor Sie mit der Deinstallation fortfahren.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lizenzabkommen\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Bitte lesen Sie die Lizenzbedingungen durch, bevor Sie mit der Installation fortfahren.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Falls Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) installieren zu können.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Falls Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kästchen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) installieren zu können. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Falls Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie unten die entsprechende Option. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) installieren zu können. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lizenzabkommen\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Bitte lesen Sie die Lizenzbedingungen durch, bevor Sie mit der Deinstallation von $(^NameDA) fortfahren.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Falls Sie alle Bedingungen des Abkommens akzeptieren, klicken Sie auf Annehmen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) deinstallieren zu können.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Falls Sie alle Bedingungen des Abkommens akzeptieren, aktivieren Sie das Kästchen. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) deinstallieren zu können. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Falls Sie alle Bedingungen des Abkommens akzeptieren, wählen Sie unten die entsprechende Option. Sie müssen die Lizenzvereinbarungen anerkennen, um $(^NameDA) deinstallieren zu können. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Drücken Sie die BILD-AB-Taste, um den Rest des Abkommens zu lesen.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Komponenten auswählen\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Wählen Sie die Komponenten aus, die Sie installieren möchten.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Komponenten auswählen\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Wählen Sie die Komponenten aus, die Sie entfernen möchten.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beschreibung\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Bewegen Sie den Mauszeiger über eine Komponente, um die Beschreibung zu lesen.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Wählen Sie eine Komponente, um die Beschreibung zu lesen.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Zielverzeichnis auswählen\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Wählen Sie das Verzeichnis aus, in das $(^NameDA) installiert werden soll.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Verzeichnis für Deinstallation auswählen\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Wählen Sie das Verzeichnis aus, aus dem $(^NameDA) entfernt werden soll.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Wird installiert ...\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Bitte warten Sie, während $(^NameDA) installiert wird.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Die Installation ist vollständig\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Die Installation wurde erfolgreich abgeschlossen.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Abbruch der Installation\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Die Installation wurde nicht vollständig abgeschlossen.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Wird deinstalliert ...\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Bitte warten Sie, während $(^NameDA) entfernt wird.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Die Deinstallation ist vollständig\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Die Deinstallation wurde erfolgreich abgeschlossen.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Abbruch der Deinstallation\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Die Deinstallation wurde nicht vollständig abgeschlossen.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Die Installation von $(^NameDA) wird abgeschlossen\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) wurde auf Ihrem Computer installiert.$\\r$\\n$\\r$\\nKlicken Sie auf Fertigstellen, um den Installationsassistenten zu schließen.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Windows muss neu gestartet werden, um die Installation von $(^NameDA) zu vervollständigen. Möchten Sie Windows jetzt neu starten?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Die Deinstallation von $(^NameDA) wird abgeschlossen\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) ist von Ihrem Computer entfernt worden.$\\r$\\n$\\r$\\nKlicken Sie auf Fertigstellen, um den Assistenten zu schließen.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Windows muss neu gestartet werden, um die Deinstallation von $(^NameDA) zu vervollständigen. Möchten Sie Windows jetzt neu starten?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Jetzt neu starten\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Windows später selbst neu starten\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) ausführen\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Liesmich-Datei anzeigen\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Fertigstellen\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Startmenü-Ordner bestimmen\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Bestimmen Sie einen Startmenü-Ordner für die Programmverknüpfungen.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Wählen Sie den Startmenü-Ordner für die Programmverknüpfungen aus. Falls Sie einen neuen Ordner erstellen möchten, geben Sie dessen Namen ein.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Keine Verknüpfungen erstellen\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Deinstallation von $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) wird von Ihrem Computer entfernt.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Sind Sie sicher, dass Sie die Installation von $(^Name) abbrechen möchten?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Sind Sie sicher, dass Sie die Deinstallation von $(^Name) abbrechen möchten?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Benutzer auswählen\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Wählen Sie die Benutzer aus, für die Sie $(^NameDA) installieren möchten.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Wählen Sie aus, ob Sie $(^NameDA) nur für den eigenen Gebrauch oder für die Nutzung durch alle Benutzer dieses Systems installieren möchten. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installation für alle Benutzer dieses Computers\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installation nur für mich\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Greek.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1032\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1253\n# RTL - anything else than RTL means LTR\n-\n# Translation by Makidis N. Michael - http://dias.aueb.gr/~p3010094/\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nΕγκατάσταση του '$(^Name)'\n# ^UninstallCaption\nΑπεγκατάσταση του '$(^Name)'\n# ^LicenseSubCaption\n: Συμφωνία Άδειας Χρήσης\n# ^ComponentsSubCaption\n: Επιλογές Εγκατάστασης\n# ^DirSubCaption\n: Φάκελος Εγκατάστασης\n# ^InstallingSubCaption\n: Εγκατάσταση σε εξέλιξη\n# ^CompletedSubCaption\n: Ολοκληρώθηκε\n# ^UnComponentsSubCaption\n: Επιλογές Απεγκατάστασης\n# ^UnDirSubCaption\n: Φάκελος Απεγκατάστασης\n# ^ConfirmSubCaption\n: Επιβεβαίωση\n# ^UninstallingSubCaption\n: Απεγκατάσταση σε εξέλιξη\n# ^UnCompletedSubCaption\n: Ολοκληρώθηκε\n# ^BackBtn\n< &Πίσω\n# ^NextBtn\n&Επόμενο >\n# ^AgreeBtn\n&Συμφωνώ\n# ^AcceptBtn\n&Αποδέχομαι τους όρους της άδειας χρήσης\n# ^DontAcceptBtn\n&Δεν αποδέχομαι τους όρους της άδειας χρήσης\n# ^InstallBtn\n&Εγκατάσταση\n# ^UninstallBtn\nΑπε&γκατάστ.\n# ^CancelBtn\nΆκυρο\n# ^CloseBtn\n&Κλείσιμο\n# ^BrowseBtn\nΑ&ναζήτηση...\n# ^ShowDetailsBtn\n&Λεπτομέρειες\n# ^ClickNext\nΚάντε κλικ στο Επόμενο για να συνεχίσετε.\n# ^ClickInstall\nΚάντε κλικ στο Εγκατάσταση για να αρχίσετε την εγκατάσταση.\n# ^ClickUninstall\nΚάντε κλικ στο Απεγκατάσταση για να αρχίσετε την απεγκατάσταση.\n# ^Name\nΌνομα\n# ^Completed\nΟλοκληρώθηκε\n# ^LicenseText\nΕλέγξτε την άδεια χρήσης πριν εγκαταστήσετε το '$(^NameDA)'. Εάν αποδέχεστε όλους τους όρους, κάντε κλικ στο Συμφωνώ.\n# ^LicenseTextCB\nΕλέγξτε την άδεια χρήσης πριν εγκαταστήσετε το '$(^NameDA)'. Εάν αποδέχεστε όλους τους όρους, κάντε κλικ στην επιλογή παρακάτω. $_CLICK\n# ^LicenseTextRB\nΕλέγξτε την άδεια χρήσης πριν εγκαταστήσετε το '$(^NameDA)'. Εάν αποδέχεστε όλους τους όρους, κάντε κλικ στην πρώτη επιλογή παρακάτω. $_CLICK\n# ^UnLicenseText\nΕλέγξτε την άδεια χρήσης πριν απεγκαταστήσετε το '$(^NameDA)'. Εάν αποδέχεστε όλους τους όρους, κάντε κλικ στο Συμφωνώ.\n# ^UnLicenseTextCB\nΕλέγξτε την άδεια χρήσης πριν απεγκαταστήσετε το '$(^NameDA)'. Εάν αποδέχεστε όλους τους όρους, κάντε κλικ στην επιλογή παρακάτω. $_CLICK\n# ^UnLicenseTextRB\nΕλέγξτε την άδεια χρήσης πριν απεγκαταστήσετε το '$(^NameDA)'. Εάν αποδέχεστε όλους τους όρους, κάντε κλικ στην πρώτη επιλογή παρακάτω. $_CLICK\n# ^Custom\nΠροσαρμοσμένη\n# ^ComponentsText\nΕπιλέξτε τα στοιχεία που θέλετε να εγκαταστήσετε και αποεπιλέξτε τα στοιχεία που δε θέλετε να εγκαταστήσετε. $_CLICK\n# ^ComponentsSubText1\nΕπιλέξτε τύπο εγκατάστασης:\n# ^ComponentsSubText2_NoInstTypes\nΕπιλέξτε τα στοιχεία που θέλετε να εγκαταστήσετε:\n# ^ComponentsSubText2\nΉ, επιλέξτε τα προαιρετικά στοιχεία που θέλετε να εγκαταστήσετε:\n# ^UnComponentsText\nΕπιλέξτε τα στοιχεία που θέλετε να απεγκαταστήσετε και αποεπιλέξτε τα στοιχεία που δε θέλετε να απεγκαταστήσετε. $_CLICK\n# ^UnComponentsSubText1\nΕπιλέξτε τύπο απεγκατάστασης:\n# ^UnComponentsSubText2_NoInstTypes\nΕπιλέξτε τα στοιχεία που θέλετε να απεγκαταστήσετε:\n# ^UnComponentsSubText2\nΉ, επιλέξτε τα προαιρετικά στοιχεία που θέλετε να απεγκαταστήσετε:\n# ^DirText\nΤο πρόγραμμα εγκατάστασης θα εγκαταστήσει το '$(^NameDA)' στον παρακάτω φάκελο. Για να το εγκαταστήσετε σε έναν άλλο φάκελο, κάντε κλικ στο Αναζήτηση και επιλέξτε κάποιον άλλο φάκελο. $_CLICK\n# ^DirSubText\nΦάκελος Εγκατάστασης\n# ^DirBrowseText\nΕπιλέξτε το φάκελο εγκατάστασης για το '$(^NameDA)':\n# ^UnDirText\nΤο πρόγραμμα εγκατάστασης θα απεγκαταστήσει το '$(^NameDA)' από τον παρακάτω φάκελο. Για να απεγκαταστήσετε από έναν άλλο φάκελο, κάντε κλικ στο Αναζήτηση και επιλέξτε κάποιον άλλο φάκελο. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nΕπιλέξτε το φάκελο απεγκατάστασης για το '$(^NameDA)':\n# ^SpaceAvailable\n\"Διαθέσιμος χώρος: \"\n# ^SpaceRequired\n\"Απαιτούμενος χώρος: \"\n# ^UninstallingText\nΤο '$(^NameDA)' θα απεγκατασταθεί από τον ακόλουθο φάκελο. $_CLICK\n# ^UninstallingSubText\nΑπεγκατάστ. από:\n# ^FileError\nΣφάλμα κατά το άνοιγμα αρχείου για εγγραφή: \\r\\n\\t\"$0\"\\r\\nΕπιλέξτε ματαίωση για να ματαιώσετε την εγκατάσταση,\\r\\nεπανάληψη για να δοκιμάσετε να γράψετε το αρχείο πάλι, ή\\r\\nπαράβλεψη για να παραλείψετε αυτό το αρχείο.\n# ^FileError_NoIgnore\nΣφάλμα κατά το άνοιγμα αρχείου για εγγραφή: \\r\\n\\t\"$0\"\\r\\nΕπιλέξτε επανάληψη για να δοκιμάσετε να γράψετε το αρχείο πάλι, ή\\r\\nματαίωση για να ματαιώσετε την εγκατάσταση.\n# ^CantWrite\n\"Αδυναμία εγγραφής: \"\n# ^CopyFailed\nΑντιγραφή απέτυχε\n# ^CopyTo\n\"Αντιγραφή στο \"\n# ^Registering\n\"Καταχώρηση: \"\n# ^Unregistering\n\"Κατάργηση καταχώρησης: \"\n# ^SymbolNotFound\n\"Αδυναμία εύρεσης συμβόλου: \"\n# ^CouldNotLoad\n\"Αδυναμία φόρτωσης: \"\n# ^CreateFolder\n\"Δημιουργία φακέλου: \"\n# ^CreateShortcut\n\"Δημιουργία συντόμευσης: \"\n# ^CreatedUninstaller\n\"Δημιουργία προγράμματος απεγκατάστασης: \"\n# ^Delete\n\"Διαγραφή αρχείου: \"\n# ^DeleteOnReboot\n\"Διαγραφή στην επανεκκίνηση: \"\n# ^ErrorCreatingShortcut\n\"Σφάλμα στη δημιουργία συντόμευσης: \"\n# ^ErrorCreating\n\"Σφάλμα στη δημιουργία: \"\n# ^ErrorDecompressing\nΣφάλμα στην αποσυμπίεση δεδομένων! Κατεστραμμένο πρόγραμμα εγκατάστασης;\n# ^ErrorRegistering\nΣφάλμα καταχώρησης του DLL\n# ^ExecShell\n\"Εκτέλεση (ExecShell): \"\n# ^Exec\n\"Εκτέλεση: \"\n# ^Extract\n\"Αποσυμπίεση: \"\n# ^ErrorWriting\n\"Αποσυμπίεση: σφάλμα εγγραφής στο αρχείο \"\n# ^InvalidOpcode\nΕγκατάσταση κατεστραμμένη: μη-έγκυρο opcode\n# ^NoOLE\n\"Όχι OLE για το: \"\n# ^OutputFolder\n\"Φάκελος εξόδου: \"\n# ^RemoveFolder\n\"Διαγραφή φακέλου: \"\n# ^RenameOnReboot\n\"Μετονομασία στην επανεκκίνηση: \"\n# ^Rename\n\"Μετονομασία: \"\n# ^Skipped\n\"Παραλείφθηκε: \"\n# ^CopyDetails\nΑντιγραφή λεπτομερειών στο Πρόχειρο\n# ^LogInstall\nΚαταγραφή διαδικασίας εγκατάστασης\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Greek.nsh",
    "content": "﻿;Language: Greek (1032)\n;By Makidis N. Michael - http://dias.aueb.gr/~p3010094/\n\n!insertmacro LANGFILE \"Greek\" = \"Ελληνικά\" \"Ellinika\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Καλώς ήλθατε στην Εγκατάσταση του '$(^NameDA)'\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Ο οδηγός αυτός θα σας καθοδηγήσει κατά τη διάρκεια της εγκατάστασης του '$(^NameDA)'.$\\r$\\n$\\r$\\nΣυνιστάται να κλείσετε όλες τις άλλες εφαρμογές πριν ξεκινήσετε την Εγκατάσταση. Αυτό θα επιτρέψει στην Εγκατάσταση να ενημερώσει τα σχετικά αρχεία συστήματος χωρίς την επανεκκίνηση του υπολογιστή σας.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Καλώς ήλθατε στον οδηγό απεγκατ. του '$(^NameDA)'\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ο οδηγός αυτός θα σας καθοδηγήσει κατά τη διάρκεια της απεγκατάστασης του '$(^NameDA)'.$\\r$\\n$\\r$\\nΠριν ξεκινήσετε την απεγκατάσταση, βεβαιωθείτε ότι το '$(^NameDA)' δεν τρέχει.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Συμφωνία Άδειας Χρήσης\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Ελέγξτε την άδεια χρήσης πριν εγκαταστήσετε το '$(^NameDA)'.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Εάν αποδέχεστε τους όρους της άδειας χρήσης, κάντε κλικ στο Συμφωνώ για να συνεχίσετε. Πρέπει να αποδεχθείτε τη συμφωνία για να εγκαταστήσετε το '$(^NameDA)'.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Εάν αποδέχεστε τους όρους της άδειας χρήσης, κάντε κλικ στην επιλογή παρακάτω. Πρέπει να αποδεχθείτε τη συμφωνία για να εγκαταστήσετε το '$(^NameDA)'. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Εάν αποδέχεστε τους όρους της άδειας χρήσης, κάντε κλικ στην πρώτη επιλογή παρακάτω. Πρέπει να αποδεχθείτε τη συμφωνία για να εγκαταστήσετε το '$(^NameDA)'. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Συμφωνία Άδειας Χρήσης\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Ελέγξτε την άδεια χρήσης πριν απεγκαταστήσετε το '$(^NameDA)'.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Εάν αποδέχεστε τους όρους της άδειας χρήσης, κάντε κλικ στο Συμφωνώ για να συνεχίσετε. Πρέπει να αποδεχθείτε τη συμφωνία για να απεγκαταστήσετε το '$(^NameDA)'.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Εάν αποδέχεστε τους όρους της άδειας χρήσης, κάντε κλικ στην επιλογή παρακάτω. Πρέπει να αποδεχθείτε τη συμφωνία για να απεγκαταστήσετε το '$(^NameDA)'. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Εάν αποδέχεστε τους όρους της άδειας χρήσης, κάντε κλικ στην πρώτη επιλογή παρακάτω. Πρέπει να αποδεχθείτε τη συμφωνία για να απεγκαταστήσετε το '$(^NameDA)'. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Πατήστε το Page Down για να δείτε το υπόλοιπο της άδειας χρήσης.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Επιλογή Στοιχείων\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Επιλέξτε τα στοιχεία του '$(^NameDA)' που θέλετε να εγκαταστήσετε.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Επιλογή Στοιχείων\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Επιλέξτε τα στοιχεία του '$(^NameDA)' που θέλετε να απεγκαταστήσετε.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Περιγραφή\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Περάστε το δείκτη του ποντικιού πάνω από ένα στοιχείο για να δείτε την περιγραφή του.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Επιλέξτε ένα στοιχείο για να δείτε την περιγραφή του.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Επιλογή Θέσης Εγκατάστασης\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Επιλέξτε το φάκελο μέσα στον οποίο θα εγκατασταθεί το '$(^NameDA)'.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Επιλογή Θέσης Απεγκατάστασης\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Επιλέξτε το φάκελο από τον οποίο θα απεγκατασταθεί το '$(^NameDA)'.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Εγκατάσταση Σε Εξέλιξη\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Παρακαλώ περιμένετε όσο το '$(^NameDA)' εγκαθίσταται.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Η Εγκατάσταση Ολοκληρώθηκε\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Η εγκατάσταση ολοκληρώθηκε επιτυχώς.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Η Εγκατάσταση Διακόπηκε\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Η εγκατάσταση δεν ολοκληρώθηκε επιτυχώς.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Απεγκατάσταση Σε Εξέλιξη\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Παρακαλώ περιμένετε όσο το '$(^NameDA)' απεγκαθίσταται.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Η Απεγκατάσταση Ολοκληρώθηκε\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Η απεγκατάσταση ολοκληρώθηκε επιτυχώς.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Η Απεγκατάσταση Διακόπηκε\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Η απεγκατάσταση δεν ολοκληρώθηκε επιτυχώς.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Ολοκλήρωση της Εγκατάστασης του '$(^NameDA)'\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Το '$(^NameDA)' εγκαταστάθηκε στον υπολογιστή σας.$\\r$\\n$\\r$\\nΚάντε κλικ στο Τέλος για να κλείσετε αυτόν τον οδηγό.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Πρέπει να γίνει επανεκκίνηση του υπολογιστή σας για να ολοκληρωθεί η εγκατάσταση του '$(^NameDA)'. Θέλετε να επανεκκινήσετε τον υπολογιστή σας τώρα;\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Ολοκλήρωση της Απεγκατάστασης του '$(^NameDA)'\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Το '$(^NameDA)' απεγκαταστάθηκε από τον υπολογιστή σας.$\\r$\\n$\\r$\\nΚάντε κλικ στο Τέλος για να κλείσετε αυτόν τον οδηγό.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Πρέπει να γίνει επανεκκίνηση του υπολογιστή σας για να ολοκληρωθεί η απεγκατάσταση του '$(^NameDA)'. Θέλετε να επανεκκινήσετε τον υπολογιστή σας τώρα;\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Να γίνει επανεκκίνηση τώρα\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Θα επανεκκινήσω τον υπολογιστή μου αργότερα\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Εκτέλεση του '$(^NameDA)'\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Εμφάνιση του &αρχείου Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Τέλος\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Επιλογή Φακέλου για το Μενού Έναρξη\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Επιλέξτε ένα φάκελο του μενού Έναρξη για τις συντομεύσεις του '$(^NameDA)'.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Επιλέξτε ένα φάκελο του μενού Έναρξη για τις συντομεύσεις του προγράμματος. Μπορείτε επίσης να εισάγετε ένα όνομα για να δημιουργήσετε ένα νέο φάκελο.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Να μη δημιουργηθούν συντομεύσεις\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Απεγκατάσταση του '$(^NameDA)'\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Αφαίρεση του '$(^NameDA)' από τον υπολογιστή σας.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Είστε σίγουροι πως θέλετε να τερματίσετε την εγκατάσταση του '$(^Name)';\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Είστε σίγουροι πως θέλετε να τερματίσετε την απεγκατάσταση του '$(^Name)';\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Hebrew.nlf",
    "content": "﻿# Hebrew NSIS language file\nNLF v6\n# Language ID\n1037\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1255\n# RTL - anything else than RTL means LTR\nRTL\n# Translation by Amir Szekely (aka KiCHiK), fixed by Yaron Shahrabani\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nהתקנת $(^Name)\n# ^UninstallCaption\nהסרת $(^Name)\n# ^LicenseSubCaption\n: הסכם רישוי\n# ^ComponentsSubCaption\n: אפשרויות התקנה\n# ^DirSubCaption\n: תיקיית התקנה\n# ^InstallingSubCaption\n: מתקין\n# ^CompletedSubCaption\n: ההתקנה הושלמה\n# ^UnComponentsSubCaption\n: אפשרויות הסרה\n# ^UnDirSubCaption\n: תיקייה להסרה\n# ^ConfirmSubCaption\n: אישור הסרה\n# ^UninstallingSubCaption\n: מסיר\n# ^UnCompletedSubCaption\n: ההסרה הושלמה\n# ^BackBtn\n< ה&קודם\n# ^NextBtn\nה&בא >\n# ^AgreeBtn\nאני &מסכים\n# ^AcceptBtn\nאני &מסכים לתנאי הסכם הרישוי\n# ^DontAcceptBtn\nאני &לא מסכים לתנאי הסכם הרישוי\n# ^InstallBtn\n&התקן\n# ^UninstallBtn\n&הסר\n# ^CancelBtn\nביטול\n# ^CloseBtn\nסגור&\n# ^BrowseBtn\n&עיין...\n# ^ShowDetailsBtn\nה&צג פרטים\n# ^ClickNext\nלחץ על הבא כדי להמשיך.\n# ^ClickInstall\nלחץ על התקן כדי להתחיל את ההתקנה.\n# ^ClickUninstall\nלחץ על הסר כדי להתחיל את ההסרה.\n# ^Name\nשם\n# ^Completed\nהפעולה הושלמה\n# ^LicenseText\nאנא סקור את הסכם הרישוי לפני התקנת $(^NameDA). אם הינך מקבל את כל תנאי ההסכם, לחץ 'אני מסכים'.\n# ^LicenseTextCB\nאנא סקור את הסכם הרישוי לפני התקנת $(^NameDA). אם הינך מקבל את כל תנאי ההסכם, סמן את תיבת הסימון שלהלן. $_CLICK\n# ^LicenseTextRB\nאנא סקור את הסכם הרישוי לפני התקנת $(^NameDA). אם הינך מקבל את כל תנאי ההסכם, בחר באפשרות הראשונה שלהלן. $_CLICK\n# ^UnLicenseText\nאנא סקור את הסכם הרישוי לפני הסרת $(^NameDA). אם הינך מסכים לכל תנאי ההסכם, לחץ 'אני מסכים'.\n# ^UnLicenseTextCB\nאנא סקור את הסכם הרישוי לפני הסרת $(^NameDA). אם הינך מסכים לכל תנאי ההסכם, סמן את תיבת הסימון שלהלן. $_CLICK\n# ^UnLicenseTextRB\nאנא סקור את הסכם הרישוי לפני הסרת $(^NameDA). אם הינך מסכים לכל תנאי ההסכם, בחר באפשרות הראשונה שלהלן. $_CLICK\n# ^Custom\nמותאם אישית\n# ^ComponentsText\nסמן את הרכיבים שברצונך להתקין ובטל את הסימון של רכיבים שאין ברצונך להתקין. $_CLICK\n# ^ComponentsSubText1\nבחר סוג התקנה:\n# ^ComponentsSubText2_NoInstTypes\nבחר רכיבים להתקנה:\n# ^ComponentsSubText2\nאו, בחר רכיבי רשות להתקנה:\n# ^UnComponentsText\nסמן את הרכיבים שברצונך להסיר ובטל את הסימון של רכיבים שאין ברצונך להסיר. $_CLICK\n# ^UnComponentsSubText1\nבחר סוג הסרה:\n# ^UnComponentsSubText2_NoInstTypes\nבחר רכיבים להסרה:\n# ^UnComponentsSubText2\nאו, בחר רכיבי רשות להסרה:\n# ^DirText\nתוכנית זו תתקין את $(^NameDA) לתיקייה שלהלן. כדי להתקין לתיקייה אחרת, לחץ על 'עיין' ובחר תיקייה אחרת. $_CLICK\n# ^DirSubText\nתיקיית יעד\n# ^DirBrowseText\nבחר תיקייה להתקנת $(^NameDA):\n# ^UnDirText\nתוכנית זו תסיר את $(^NameDA) מהתיקייה שלהלן. כדי להסיר מתיקייה אחרת, לחץ על 'עיין' ובחר תיקייה אחרת. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nבחר תיקייה ממנה תוסר $(^NameDA):\n# ^SpaceAvailable\n\"מקום פנוי: \"\n# ^SpaceRequired\n\"מקום דרוש: \"\n# ^UninstallingText\nהסרת $(^NameDA) תתבצע מהתיקייה שלהלן. $_CLICK\n# ^UninstallingSubText\nמסיר מ:\n# ^FileError\nארעה שגיאה בעת פתיחת קובץ לכתיבה:\\r\\n\\t\"$0\"\\r\\nלחץ על ביטול כדי לבטל את ההתקנה,\\r\\nנסה שנית כדי לנסות לפתוח את הקובץ שוב, או\\r\\nהתעלם כדי לדלג על הקובץ\n# ^FileError_NoIgnore\nארעה שגיאה בעת פתיחת קובץ לכתיבה:\\r\\n\\t\"$0\"\\r\\nלחץ על נסה שנית כדי לנסות לפתוח את הקובץ  שוב, או\\r\\nביטול כדי לבטל את התתקנה\n# ^CantWrite\n\"לא ניתן לכתוב: \"\n# ^CopyFailed\nההעתקה נכשלה\n# ^CopyTo\nהעתק ל-\n# ^Registering\n\"רושם: \"\n# ^Unregistering\n\"ביטול רישום: \"\n# ^SymbolNotFound\n\"סמל לא נמצא: \"\n# ^CouldNotLoad\n\"לא ניתן לטעון: \"\n# ^CreateFolder\n\"צור תיקייה: \"\n# ^CreateShortcut\n\"צור קיצור דרך: \"\n# ^CreatedUninstaller\n\"מסיר התקנה נוצר: \"\n# ^Delete\n\"מחק קובץ: \"\n# ^DeleteOnReboot\n\"מחק אחרי אתחול: \"\n# ^ErrorCreatingShortcut\n\"שגיאה בעת יצירת קיצור דרך: \"\n# ^ErrorCreating\n\"שגיאה בעת יצירת: \"\n# ^ErrorDecompressing\nשגיאה בעת פרישת מידע! התקנה פגומה?\n# ^ErrorRegistering\nשגיאה בעת רישום DLL\n# ^ExecShell\n\"בצע פעולת-קובץ: \"\n# ^Exec\n\"בצע: \"\n# ^Extract\n\"פרוש: \"\n# ^ErrorWriting\n\"פרוש: שגיאה בעת כתיבה לקובץ \"\n# ^InvalidOpcode\nהתקנה פגומה! פקודת ביצוע שגויה\n# ^NoOLE\n\"אין OLE ל: \"\n# ^OutputFolder\n\"תיקיית פלט: \"\n# ^RemoveFolder\n\"הסר תיקייה: \"\n# ^RenameOnReboot\n\"שנה שם לאחר אתחול: \"\n# ^Rename\n\"שנה שם: \"\n# ^Skipped\n\"דלג: \"\n# ^CopyDetails\nהעתק פרטים ללוח\n# ^LogInstall\nשמור רישום פעילויות ההתקנה\n# ^Byte\n\"ב\n# ^Kilo\n\" ק\"\n# ^Mega\n\" מ\"\n# ^Giga\n\" ג\""
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Hebrew.nsh",
    "content": "﻿;Language: Hebrew (1037)\n;By Yaron Shahrabani\n\n!insertmacro LANGFILE \"Hebrew\" = \"עברית\" \"Ivrit\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"ברוכים הבאים לאשף ההתקנה של $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"אשף זה ינחה אתכם במהלך ההתקנה של $(^NameDA).$\\r$\\n$\\r$\\nמומלץ לסגור כל תוכנית אחרת לפני התחלת ההתקנה. פעולה זו תאפשר לאשף לעדכן קבצי מערכת ללא איתחול המחשב.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"ברוכים הבאים לאשף ההסרה של $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"אשף זה ינחה אתכם במהלך ההסרה של $(^NameDA).$\\r$\\n$\\r$\\nמומלץ לסגור כל תוכנית אחרת לפני התחלת ההסרה. פעולה זו תאפשר לאשף לעדכן קבצי מערכת ללא איתחול המחשב.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"הסכם רישוי\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"נא עיין בתנאי הסכם הרישוי לפני התקנת $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"אם אתה מקבל את תנאי ההסכם, לחץ על 'אני מסכים' כדי להמשיך. אם לא תסכים לתנאי ההסכם לא תוכל להתקין את $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"אם אתה מקבל את תנאי ההסכם, סמן את תיבת הבחירה שלהלן. עלייך לקבל את תנאי ההסכם בכדי להתקין את $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"אם אתה מקבל את תנאי ההסכם, בחר באפשרות הראשונה שלהלן. עלייך לקבל את ההסכם כדי להתקין את $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"הסכם רישוי\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"נא עיין בתנאי הסכם הרישוי לפני הסרת $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"אם אתה מקבל את תנאי ההסכם, לחץ על 'אני מסכים' כדי להמשיך. אם לא תקבל את תנאי ההסכם לא תוכל להסיר את $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"אם אתה מקבל את תנאי ההסכם, סמן את תיבת הבחירה שלהלן. עלייך לקבל את תנאי ההסכם כדי להסיר את $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"אם אתה מקבל את תנאי ההסכם, בחר באפשרות הראשונה שלהלן. עלייך לקבל את ההסכם כדי להסיר את $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"כדי לצפות בשאר הסכם הרישוי לחץ על Page Down.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"בחר רכיבים\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"בחר אילו רכיבים של $(^NameDA) ברצונך להתקין.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"בחר רכיבים\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"בחר אילו תכונות של $(^NameDA) ברצונך להסיר.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"תיאור\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"העבר את העכבר מעל רכיב כלשהו בכדי לצפות בתיאורו.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"בחר רכיב כלשהו בכדי לצפות בתיאורו.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"בחר מיקום להתקנה\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"בחר את התיקייה בה אתה מעוניין להתקין את $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"בחר מיקום להסרה\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"בחר את התיקייה ממנה אתה מעוניין להסיר את $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"מתקין\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"אנא המתן בזמן ש-$(^NameDA) מותקן.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"ההתקנה הושלמה\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"ההתקנה הושלמה במלואה.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"ההתקנה בוטלה\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"ההתקנה לא הושלמה המלואה.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"מסיר\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"אנא המתן בזמן ש-$(^NameDA) מוסר מהמחשב.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"ההסרה הושלמה\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"ההסרה הושלמה במלואה.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"ההסרה בוטלה\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"ההסרה לא הושלמה במלואה.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"משלים את אשף ההתקנה של $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) הותקן בהצלחה.$\\r$\\n$\\r$\\nלחץ על סיום כדי לסגור את האשף.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"עלייך לאתחל את המחשב כדי לסיים את התקנת $(^NameDA). האם ברצונך לאתחל כעת?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"משלים את אשף ההסרה של $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) הוסר בהצלחה.$\\r$\\n$\\r$\\nלחץ על סיום כדי לסגור את האשף.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"עלייך לאתחל את המחשב כדי לסיים את הסרת $(^NameDA). האם ברצונך לאתחל כעת?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"אתחל כעת\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"ברצוני לאתחל ידנית מאוחר יותר\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&הרץ את $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&הצג מסמך 'קרא אותי'\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&סיים\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"בחר תיקייה בתפריט ההתחלה\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"בחר בתיקיית תפריט ההתחלה בה יווצרו קיצורי הדרך של התוכנית.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"בחר בתיקייה מתפריט ההתחלה בה ברצונך ליצור את קיצורי הדרך עבור התוכנית. באפשרותך גם להקליד את שם התיקייה כדי ליצור תיקייה חדשה.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"אל תיצור קיצורי דרך\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"הסר את $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"הסר את $(^NameDA) מהמחשב.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"האם אתה בטוח שברצונך לצאת מהתקנת $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"האם אתה בטוח שברצונך לצאת מהסרת $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"בחר משתמשים\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"בחר לאילו משתמשים להתקין את $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"בחר האם להתקין את $(^NameDA) לעצמך או לכל המשתמשים של המחשב. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"התקן לכל משתמשי המחשב\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"התקן רק למשתמש שלי\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Hindi.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1081\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1200\n# RTL - anything else than RTL means LTR\n-\n# Translation by Ryan Pretorius\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) सेटअप\n# ^UninstallCaption\n$(^Name) अनइनस्टॉल करें\n# ^LicenseSubCaption\n: लाइसेंस समझौता\n# ^ComponentsSubCaption\n: इंस्टालेशन के विकल्प\n# ^DirSubCaption\n: इंस्टालेशन फोल्डर\n# ^InstallingSubCaption\n: इनस्टॉल कर रहे हैं\n# ^CompletedSubCaption\n: संपन्न\n# ^UnComponentsSubCaption\n: अनइंस्टालेशन के विकल्प\n# ^UnDirSubCaption\n: अनइंस्टालेशन फोल्डर\n# ^ConfirmSubCaption\n: पुष्टिकरण\n# ^UninstallingSubCaption\n: अनइनस्टॉल कर रहे हैं\n# ^UnCompletedSubCaption\n: सम्पन्न\n# ^BackBtn\n< &पीछे\n# ^NextBtn\n&आगे >\n# ^AgreeBtn\nमैं &सहमत हूँ\n# ^AcceptBtn\nमैं लाइसेंस समझौते की शर्तें &स्वीकार करता हूँ\n# ^DontAcceptBtn\nमैं लाइसेंस समझौते की शर्तें स्वीकार नहीं &करता हूँ\n# ^InstallBtn\n&इनस्टॉल करें\n# ^UninstallBtn\n&अनइनस्टॉल करें\n# ^CancelBtn\nरद्द करें\n# ^CloseBtn\n&बंद करें\n# ^BrowseBtn\nब्रा&उज करें...\n# ^ShowDetailsBtn\n&विवरण दिखाएं\n# ^ClickNext\nजारी रखने के लिए आगे पर क्लिक करें।\n# ^ClickInstall\nइंस्टालेशन शुरू करने के लिए इनस्टॉल करें पर क्लिक करें।\n# ^ClickUninstall\nअनइंस्टालेशन शुरू करने के लिए अनइनस्टॉल करें पर क्लिक करें।\n# ^Name\nम\n# ^Completed\nसम्पन्न\n# ^LicenseText\n$(^NameDA) इनस्टॉल करने से पहले लाइसेंस समझौते की समीक्षा करें। यदि आप समझौते की सभी शर्तें स्वीकार करते हैं तो मैं सहमत हूँ पर क्लिक करें।\n# ^LicenseTextCB\n$(^NameDA) इनस्टॉल करने से पहले लाइसेंस समझौते की समीक्षा करें। यदि आप समझौते की सभी शर्तें स्वीकार करते हैं तो नीचे दिए गए चेक बॉक्स पर क्लिक करें। $_CLICK\n# ^LicenseTextRB\n$(^NameDA) इनस्टॉल करने से पहले लाइसेंस समझौते की समीक्षा करें। यदि आप समझौते की सभी शर्तें स्वीकार करते हैं तो नीचे दिए गए पहले विकल्प का चयन करें। $_CLICK\n# ^UnLicenseText\n$(^NameDA) अनइनस्टॉल करने से पहले लाइसेंस समझौते की समीक्षा करें। यदि आप समझौते की सभी शर्तें स्वीकार करते हैं तो मैं सहमत हूँ पर क्लिक करें।\n# ^UnLicenseTextCB\n$(^NameDA) अनइनस्टॉल करने से पहले लाइसेंस समझौते की समीक्षा करें। यदि आप समझौते की सभी शर्तें स्वीकार करते हैं तो नीचे दिए गए चेक बॉक्स पर क्लिक करें। $_CLICK\n# ^UnLicenseTextRB\n$(^NameDA) अनइनस्टॉल करने से पहले लाइसेंस समझौते की समीक्षा करें। यदि आप समझौते की सभी शर्तें स्वीकार करते हैं तो नीचे दिए गए पहले विकल्प का चयन करें। $_CLICK\n# ^Custom\nकस्टम\n# ^ComponentsText\nआप जो घटक इनस्टॉल करना चाहते हैं उन्हें चेक करें और आप जो घटक इनस्टॉल नहीं करना चाहते हैं उन्हें अनचेक करें। $_CLICK\n# ^ComponentsSubText1\nइनस्टॉल के प्रकार का चयन करें:\n# ^ComponentsSubText2_NoInstTypes\nइनस्टॉल करने के लिए घटकों का चयन करें:\n# ^ComponentsSubText2\nया उन वैकल्पिक घटकों का चयन करें जिन्हें आप इनस्टॉल करना चाहते हैं:\n# ^UnComponentsText\nआप जो घटक अनइनस्टॉल करना चाहते हैं उन्हें चेक करें और आप जो घटक अनइनस्टॉल नहीं करना चाहते हैं उन्हें अनचेक करें। $_CLICK\n# ^UnComponentsSubText1\nअनइनस्टॉल के प्रकार का चयन करें:\n# ^UnComponentsSubText2_NoInstTypes\nअनइनस्टॉल करने के लिए घटकों का चयन करें:\n# ^UnComponentsSubText2\nया उन वैकल्पिक घटकों का चयन करें जिन्हें आप अनइनस्टॉल करना चाहते हैं:\n# ^DirText\nसेटअप $(^NameDA) को निम्नलिखित फोल्डर में इनस्टॉल करेगा। किसी भिन्न फोल्डर में इनस्टॉल करने के लिए ब्राउज करें पर क्लिक करें और किसी अन्य फोल्डर का चयन करें। $_CLICK\n# ^DirSubText\nगंतव्य फोल्डर\n# ^DirBrowseText\n$(^NameDA) को जिस फोल्डर में इनस्टॉल करना है उसका चयन करें:\n# ^UnDirText\nसेटअप $(^NameDA) को निम्नलिखित फोल्डर से अनइनस्टॉल करेगा। किसी भिन्न फोल्डर से अनइनस्टॉल करने के लिए ब्राउज करें पर क्लिक करें और किसी अन्य फोल्डर का चयन करें। $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n$(^NameDA) को जिस फोल्डर से अनइनस्टॉल करना है उसका चयन करें:\n# ^SpaceAvailable\n\"उपलब्ध जगह: \"\n# ^SpaceRequired\n\"अपेक्षित जगह: \"\n# ^UninstallingText\n$(^NameDA) को निम्नलिखित फोल्डर से अनइनस्टॉल किया जाएगा। $_CLICK\n# ^UninstallingSubText\nइस से अनइनस्टॉल कर रहे हैं:\n# ^FileError\nलिखने के लिए फ़ाइल खोलने में त्रुटि: \\r\\n\\r\\n$0\\r\\n\\r\\nइंस्टालेशन रोकने के लिए निरस्त करें पर क्लिक करें,\\r\\nफिर से प्रयास करने के लिए पुनः प्रयास करें, या\\r\\nइस फाइल को छोड़ने के लिए नजरंदाज करें।\n# ^FileError_NoIgnore\nलिखने के लिए फ़ाइल खोलने में त्रुटि: \\r\\n\\r\\n$0\\r\\n\\r\\nफिर से प्रयास करने के लिए पुनः प्रयास करें पर क्लिक करें, या\\r\\nइंस्टालेशन रोकने के लिए रद्द करें।\n# ^CantWrite\n\"नहीं लिख सकते: \"\n# ^CopyFailed\"\nकॉपी करना विफल रहा\n# ^CopyTo\"\n\"में कॉपी करें \"\n# ^Registering\n\"पंजीकृत कर रहे हैं: \"\n# ^Unregistering\n\"पंजीकरण रद्द कर रहे हैं: \"\n# ^SymbolNotFound\n\"प्रतीक नहीं ढूंढ सके: \"\n# ^CouldNotLoad\n\"लोड नहीं कर सके: \"\n# ^CreateFolder\n\"फोल्डर बनाएं: \"\n# ^CreateShortcut\n\"शॉर्टकट बनाएं: \"\n# ^CreatedUninstaller\n\"अनइंस्टालर बनाया: \"\n# ^Delete\n\"फाइल हटाएं: \"\n# ^DeleteOnReboot\"\n\"रीबूट करने पर हटाएं: \"\n# ^ErrorCreatingShortcut\n\"शॉर्टकट बनाने में त्रुटि: \"\n# ^ErrorCreating\n\"बनाने में त्रुटि: \"\n# ^ErrorDecompressing\nडेटा असंपीड़ित करने पर त्रुटि! दूषित इंस्टालर?\n# ^ErrorRegistering\nDLL पंजीकृत करने पर त्रुटि\n# ^ExecShell\n\"शेल निष्पादित करें: \"\n# ^Exec\nनिष्पादित करें: \"\n# ^Extract\n\"निकालें: \"\n# ^ErrorWriting\n\"निकालें: फाइल में लिखते समय त्रुटि \"\n# ^InvalidOpcode\nइंस्टालर दूषित: अवैध ऑपकोड\n# ^NoOLE\n\"इसके लिए कोई OLE नहीं: \"\n# ^OutputFolder\n\"आउटपुट फोल्डर: \"\n# ^RemoveFolder\n\"फोल्डर निकालें: \"\n# ^RenameOnReboot\n\"रीबूट करने पर नाम बदलें: \"\n# ^Rename\n\"नाम बदलें: \"\n# ^Skipped\n\"छोड़ा गया: \"\n# ^CopyDetails\nक्लिपबोर्ड पर विवरण कॉपी करें\n# ^LogInstall\nलॉग इनस्टॉल प्रक्रिया\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Hindi.nsh",
    "content": "﻿;Language: Hindī (Devanagari script) (1081)\n;By Ryan Pretorius\n\n!insertmacro LANGFILE \"Hindi\" = \"हिन्दी\" \"Hindi\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) सेटअप में आपका स्वागत है\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"सेटअप $(^NameDA) के इंस्टालेशन के दौरान आपका मार्गदर्शन करेगा।$\\r$\\n$\\r$\\nयह सिफारिश की जाती है कि सेटअप शुरू करने से पहले आप अन्य सभी अनुप्रयोग बंद कर दें। इससे आपके कंप्यूटर को रीबूट किए बिना प्रासंगिक सिस्टम फ़ाइलों को अपडेट करना संभव हो जाएगा।$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"$(^NameDA) के अनइंस्टालेशन में आपका स्वागत है\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"सेटअप $(^NameDA) के अनइंस्टालेशन के दौरान आपका मार्गदर्शन करेगा।$\\r$\\n$\\r$\\nअनइंस्टालेशन शुरू करने से पहले सुनिश्चित करें कि $(^NameDA) चल न रहा हो।$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"लाइसेंस समझौता\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"$(^NameDA) इनस्टॉल करने से पहले लाइसेंस शर्तों की समीक्षा करें।\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"यदि आप समझौते की शर्ते स्वीकार करते हैं तो जारी रखने के लिए मैं सहमत हूँ पर क्लिक करें। आपको $(^NameDA) इनस्टॉल करने के लिए समझौते को स्वीकार करना होगा।\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"यदि आप समझौते की शर्ते स्वीकार करते हैं तो नीचे दिए गए चेक बॉक्स पर क्लिक करें। आपको $(^NameDA) इनस्टॉल करने के लिए समझौते को स्वीकार करना होगा। $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"यदि आप समझौते की शर्ते स्वीकार करते हैं तो नीचे दिए गए पहले विकल्प का चयन करें। आपको $(^NameDA) इनस्टॉल करने के लिए समझौते को स्वीकार करना होगा। $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"लाइसेंस समझौता\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"$(^NameDA) अनइनस्टॉल करने से पहले लाइसेंस शर्तों की समीक्षा करें।\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"यदि आप समझौते की शर्ते स्वीकार करते हैं तो जारी रखने के लिए मैं सहमत हूँ पर क्लिक करें। आपको $(^NameDA) अनइनस्टॉल करने के लिए समझौते को स्वीकार करना होगा।\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"यदि आप समझौते की शर्ते स्वीकार करते हैं तो नीचे दिए गए चेक बॉक्स पर क्लिक करें। आपको $(^NameDA) अनइनस्टॉल करने के लिए समझौते को स्वीकार करना होगा। $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"यदि आप समझौते की शर्ते स्वीकार करते हैं तो नीचे दिए गए पहले विकल्प का चयन करें। आपको $(^NameDA) अनइनस्टॉल करने के लिए समझौते को स्वीकार करना होगा। $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"शेष समझौता देखने के लिए पेज नीचे करें को दबाएं।\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"घटक चुनें\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"$(^NameDA) की वे विशेषताएं चुनें जो आप इनस्टॉल करना चाहते हैं।\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"घटक चुनें\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"$(^NameDA) की वे विशेषताएं चुनें जो आप अनइनस्टॉल करना चाहते हैं।\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"विवरण\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"उस घटक पर अपना माउस रखें जिसका आप विवरण देखना चाहते हैं।\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"उस घटक का चयन करें जिसका आप विवरण देखना चाहते हैं।\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"इनस्टॉल करने का स्थान चुनें\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"वह फोल्डर चुनें जिसमें $(^NameDA) को इनस्टॉल करना है।\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"अनइनस्टॉल करने का स्थान चुनें\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"वह फोल्डर चुनें जिससे $(^NameDA) को इनस्टॉल करना है।\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"इनस्टॉल कर रहे हैं\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"$(^NameDA) इनस्टॉल होने तक प्रतीक्षा करें।\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"इंस्टालेशन सम्पन्न\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"सेटअप सफलतापूर्वक पूर्ण हुआ।\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"इंस्टालेशन निरस्त किया गया\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"सेटअप सफलतापूर्वक पूर्ण नहीं हुआ।\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"अनइनस्टॉल कर रहे हैं\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"$(^NameDA) अनइनस्टॉल होने तक प्रतीक्षा करें।\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"अनइंस्टालेशन सम्पन्न\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"अनइंस्टालेशन सफलतापूर्वक पूर्ण हुआ।\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"अनइंस्टालेशन निरस्त किया गया\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"अनइंस्टालेशन सफलतापूर्वक पूर्ण नहीं हुआ।\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) का सेटअप पूरा कर रहे हैं\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"आपके कंप्यूटर पर $(^NameDA) को इनस्टॉल कर दिया गया है।$\\r$\\n$\\r$\\nसेटअप बंद करने के लिए समाप्त करें पर क्लिक करें।\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA) के इंस्टालेशन को पूरा करने के लिए आपके कंप्यूटर को फिर से शुरू करना होगा। क्या आप अभी रीबूट करना चाहते हैं?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) का अनइंस्टालेशन पूरा कर रहे हैं\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"आपके कंप्यूटर पर $(^NameDA) को अनइनस्टॉल कर दिया गया है।$\\r$\\n$\\r$\\nसेटअप बंद करने के लिए समाप्त करें पर क्लिक करें।\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) के अनइंस्टालेशन को पूरा करने के लिए आपके कंप्यूटर को फिर से शुरू करना होगा। क्या आप अभी रीबूट करना चाहते हैं?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"अभी रीबूट करें\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"मैं बाद में मैन्युअली रीबूट करना चाहता हूँ\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) &चलाएं\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"रीडमी &दिखाएं\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&समाप्त करें\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"स्टार्ट मेनू फोल्डर चुनें\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"$(^NameDA) के शॉर्टकट के लिए स्टार्ट मेनू फोल्डर चुनें।\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"उस स्टार्ट मेनू फोल्डर का चयन करें जिसमें आप प्रोग्राम के शॉर्टकट बनाना चाहते हैं। आप नया फोल्डर बनाने के लिए नाम भी प्रविष्ट कर सकते हैं।\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"शॉर्टकट न बनाएं\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA) अनइनस्टॉल करें\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"अपने कंप्यूटर से $(^NameDA) निकालें।\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"क्या आप वाकई $(^Name) का सेटअप छोड़ना चाहते हैं?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"क्या आप वाकई $(^Name) को अनइनस्टॉल करना छोड़ना चाहते हैं?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"उपयोगकर्ता चुनें\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"वे उपयोगकर्ता चुनें जिनके लिए आप $(^NameDA) इनस्टॉल करना चाहते हैं।\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"चयन करें कि क्या आप $(^NameDA) को केवल अपने लिए इनस्टॉल करना चाहते हैं या इस कंप्यूटर के सभी उपयोगकर्ताओं के लिए। $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"इस कंप्यूटर का उपयोग करने वाले किसी भी व्यक्ति के लिए इनस्टॉल करें\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"केवल मेरे लिए इनस्टॉल करें\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Hungarian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1038\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Soft-Trans Bt. (V2)\n# Translation by Orfanik Kft.   (V3-V6)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Telepítő\n# ^UninstallCaption\n$(^Name) Eltávolító\n# ^LicenseSubCaption\n: Licencszerződés\n# ^ComponentsSubCaption\n: Telepítési lehetőségek\n# ^DirSubCaption\n: Célmappa\n# ^InstallingSubCaption\n: Fájlok telepítése\n# ^CompletedSubCaption\n: Kész\n# ^UnComponentsSubCaption\n: Eltávolítási lehetőségek\n# ^UnDirSubCaption\n: Eltávolítás mappája\n# ^ConfirmSubCaption\n: Megerősítés\n# ^UninstallingSubCaption\n: Fájlok eltávolítása\n# ^UnCompletedSubCaption\n: Kész\n# ^BackBtn\n< &Vissza\n# ^NextBtn\n&Tovább >\n# ^AgreeBtn\n&Elfogadom\n# ^AcceptBtn\n&Elfogadom a Licencszerződés feltételeit\n# ^DontAcceptBtn\n&Nem fogadom el a Licencszerződés feltételeit\n# ^InstallBtn\n&Telepítés\n# ^UninstallBtn\n&Eltávolítás\n# ^CancelBtn\n&Mégse\n# ^CloseBtn\n&Bezárás\n# ^BrowseBtn\n&Tallózás...\n# ^ShowDetailsBtn\n&Részletek\n# ^ClickNext\nKattintson a Tovább-ra a folytatáshoz.\n# ^ClickInstall\nKattintson a Telepítésre a telepítéshez.\n# ^ClickUninstall\nKattintson az Eltávolításra az eltávolításhoz.\n# ^Name\nNév\n# ^Completed\nKész\n# ^LicenseText\nA(z) $(^NameDA) telepítése előtt tekintse át a szerződés feltételeit. Ha elfogadja a szerződés valamennyi feltételét, az Elfogadom gombbal folytathatja.\n# ^LicenseTextCB\nA(z) $(^NameDA) telepítése előtt tekintse át a szerződés feltételeit. Ha elfogadja a szerződés valamennyi feltételét, jelölje be a Jelölőnégyzeten. $_CLICK\n# ^LicenseTextRB\nA(z) $(^NameDA) telepítése előtt tekintse át a szerződés feltételeit. Ha elfogadja a szerződés valamennyi feltételét, válassza az első lehetőséget. $_CLICK\n# ^UnLicenseText\nA(z) $(^NameDA) eltávolítása előtt tekintse át a szerződés feltételeit. Ha elfogadja a szerződés valamennyi feltételét, az Elfogadom gombbal folytathatja.\n# ^UnLicenseTextCB\nA(z) $(^NameDA) eltávolítása előtt tekintse át a szerződés feltételeit. Ha elfogadja a szerződés valamennyi feltételét, jelölje be a Jelölőnégyzeten. $_CLICK\n# ^UnLicenseTextRB\nA(z) $(^NameDA) eltávolítása előtt tekintse át a szerződés feltételeit. Ha elfogadja a szerződés valamennyi feltételét, válassza az első lehetőséget. $_CLICK\n# ^Custom\nEgyéni\n# ^ComponentsText\nJelölje be azokat az összetevőket amelyeket telepíteni kíván és törölje a jelölést a nem kívánt összetevőknél. $_CLICK\n# ^ComponentsSubText1\nVálassza ki a telepítés típusát:\n# ^ComponentsSubText2_NoInstTypes\nVálassza ki a telepítendő összetevőket:\n# ^ComponentsSubText2\nvagy, jelölje ki a választható összetevők közül a telepíteni kívánta(ka)t:\n# ^UnComponentsText\nJelölje be azokat az összetevőket amelyeket el kíván távolítani és törölje a jelölést az eltávolítani nem kívánt összetevőknél. $_CLICK\n# ^UnComponentsSubText1\nVálassza ki az Eltávolítás típusát:\n# ^UnComponentsSubText2_NoInstTypes\nVálassza ki az eltávolítandó összetevőket:\n# ^UnComponentsSubText2\nvagy, jelölje ki a választható összetevők közül az eltávolítani kívánta(ka)t:\n# ^DirText\nA $(^NameDA) a következő mappába kerül. Másik mappa választásához kattintson a Tallózás gombra. $_CLICK\n# ^DirSubText\nTelepítés helye\n# ^DirBrowseText\nA(z) $(^NameDA) telepítési helyének kiválasztása:\n# ^UnDirText\nA(z) $(^NameDA) eltávolítása a következő mappából. Másik mappa választásához kattintson a Tallózás gombra. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nVálassza ki, hogy a $(^NameDA) melyik mappából kerüljön eltávolításra:\n# ^SpaceAvailable\n\"Szabad terület: \"\n# ^SpaceRequired\n\"Helyigény: \"\n# ^UninstallingText\nA(z) $(^NameDA) eltávolítása következik a számítógépről. $_CLICK\n# ^UninstallingSubText\nEltávolítás helye:\n# ^FileError\nHiba történt a fájl írásra történő megnyitásakor: \\r\\n\\t\"$0\"\\r\\nA Mégse gomb megnyomásával megszakíthatja a telepítést,\\r\\naz Ismét gombbal megismételheti a fájl írását,\\r\\na Kihagyás gombbal kihagyhatja ezt a fájlt.\n# ^FileError_NoIgnore\nHiba történt a fájl írásra történő megnyitásakor:  \\r\\n\\t\"$0\"\\r\\nAz Újra gomb megnyomásával megismételheti a műveletet, vagy \\r\\na Mégse gombbal megszakíthatja a telepítést.\n# ^CantWrite\n\"Nem írható: \"\n# ^CopyFailed\nA másolás megszakadt\n# ^CopyTo\n\"Másolás ide: \"\n# ^Registering\n\"Bejegyzés: \"\n# ^Unregistering\n\"Eltávolítás: \"\n# ^SymbolNotFound\n\"A következő szimbólum nem található: \"\n# ^CouldNotLoad\n\"Nem tölthető be: \"\n# ^CreateFolder\n\"Mappa létrehozás: \"\n# ^CreateShortcut\n\"Parancsikon létrehozása: \"\n# ^CreatedUninstaller\n\"Létrehozott eltávolító: \"\n# ^Delete\n\"Törölt fájl: \"\n# ^DeleteOnReboot\n\"Rendszerindításkor törlendő: \"\n# ^ErrorCreatingShortcut\n\"Hiba a parancsikon létrehozásakor: \"\n# ^ErrorCreating\n\"Hiba a létrehozáskor: \"\n# ^ErrorDecompressing\nHiba az adatok kibontásakor! Megsérült a Telepítő?\n# ^ErrorRegistering\nHiba a DLL regisztrálásakor\n# ^ExecShell\n\"Végrehajtás a hozzárendeléseken keresztül: \"\n# ^Exec\n\"Végrehajtás: \"\n# ^Extract\n\"Kibontás: \"\n# ^ErrorWriting\n\"Kibontás: Hiba a fájl írásakor \"\n# ^InvalidOpcode\nSérült a telepítő: hibás utasítás\n# ^NoOLE\n\"Nincs OLE: \"\n# ^OutputFolder\n\"Kimeneti mappa: \"\n# ^RemoveFolder\n\"Mappa eltávolítása: \"\n# ^RenameOnReboot\n\"Átnevezés rendszerindításkor: \"\n# ^Rename\n\"Átnevezés: \"\n# ^Skipped\n\"Kihagyott: \"\n# ^CopyDetails\nAdatok vágólapra másolása\n# ^LogInstall\nTelepítő ellenőrzőlista\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Hungarian.nsh",
    "content": "﻿;Language: Hungarian (1038)\n;Translation by Jozsef Tamas Herczeg ( - 1.61-ig),\n;               Lajos Molnar (Orfanik) <orfanik@axelero.hu> ( 1.62 - től)\n\n!insertmacro LANGFILE \"Hungarian\" = \"Magyar\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Üdvözli a(z) $(^NameDA) Telepítő Varázsló\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"A(z) $(^NameDA) telepítése következik a számítógépre.$\\r$\\n$\\r$\\nJavasoljuk, hogy indítás előtt zárja be a futó alkalmazásokat. Így a telepítő a rendszer újraindítása nélkül tudja frissíteni a szükséges rendszerfájlokat.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Üdvözli a(z) $(^NameDA) Eltávolító Varázsló\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ez a varázsló segíti a(z) $(^NameDA) eltávolításában.$\\r$\\n$\\r$\\nMielőtt elkezdi az eltávilítást győződjön meg arról, hogy a(z) $(^NameDA) nem fut.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licencszerződés\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"A(z) $(^NameDA) telepítése előtt tekintse át a szerződés feltételeit.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ha elfogadja a szerződés valamennyi feltételét, az Elfogadom gombbal folytathatja. El kell fogadnia a(z) $(^NameDA) telepítéséhez.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Amennyiben elfogadja a feltételeket, jelölje be a jelölőnényzeten. A(z) $(^NameDA) telepítéséhez el kell fogadnia a feltételeket. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Amennyiben elfogadja a feltételeket, válassza az első opciót. A(z) $(^NameDA) telepítéséhez el kell fogadnia a feltételeket. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licencszerződés\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"A(z) $(^NameDA) eltávolítása előtt tekintse át a szerződés feltételeit.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ha elfogadja a szerződés valamennyi feltételét, az Elfogadom gombbal folytathatja. El kell fogadnia a(z) $(^NameDA) eltávolításához.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Amennyiben elfogadja a feltételeket, jelölje be a jelölőnényzeten. A(z) $(^NameDA) eltávolításához el kell fogadnia a feltételeket. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Amennyiben elfogadja a feltételeket, válassza az első opciót. A(z) $(^NameDA) eltávolításához el kell fogadnia a feltételeket. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"A PageDown gombbal olvashatja el a szerződés folytatását.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Összetevők kiválasztása\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Válassza ki, hogy a(z) $(^NameDA) mely funkcióit kívánja telepíteni.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Összetevők kiválasztása\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Válassza ki, hogy a(z) $(^NameDA) mely funkcióit kívánja eltávolítani.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Leírás\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Vigye rá az egeret az összetevőre, hogy megtekinthesse a leírását.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Telepítési hely kiválasztása\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Válassza ki a(z) $(^NameDA) telepítésének mappáját.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Telepítési hely kiválasztása\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Válassza ki a(z) $(^NameDA) telepítésének mappáját.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Telepítési folyamat\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Kis türelmet a(z) $(^NameDA) telepítéséig.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Telepítés befejeződött\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"A telepítés sikeresen befejeződött.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"A telepítés megszakadt\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"A telepítés sikertelen volt.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Eltávolítási folyamat\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Kis türelmet a(z) $(^NameDA) eltávolításáig.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Az eltávolítás befejeződött\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Az eltávolítás sikeresen befejeződött.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Az eltávolítás megszakadt\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Az eltávolítás sikertelen volt.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"A(z) $(^NameDA) telepítése megtörtént.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"A(z) $(^NameDA) telepítése megtörtént.$\\r$\\n$\\r$\\nA Befejezés gomb megnyomásával zárja be a varázslót.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"A(z) $(^NameDA) telepítésének befejezéséhez újra kell indítani a rendszert. Most akarja újraindítani?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"A(z) $(^NameDA) eltávolítás varázslójának befejezése.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"A(z) $(^NameDA) eltávolítása sikeresen befejeződött.$\\r$\\n$\\r$\\nA Finish-re kattintva bezárul ez a varázsló.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"A számítógépet újra kell indítani, hogy a(z) $(^NameDA) eltávolítása teljes legyen. Akarja most újraindítani a rendszert?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Most indítom újra\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Később fogom újraindítani\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) futtatása\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"OlvassEl fájl megjelenítése\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Befejezés\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Start menü mappa kijelölése\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Start menü mappa kijelölése a program parancsikonjaihoz.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Jelöljön ki egy mappát a Start menüben, melybe a program parancsikonjait fogja elhelyezni. Beírhatja új mappa nevét is.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nincs parancsikon elhelyezés\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"A(z) $(^NameDA) Eltávolítása.\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"A(z) $(^NameDA) eltávolítása következik a számítógépről.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Biztos, hogy ki akar lépni a(z) $(^Name) Telepítőből?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Biztos, hogy ki akar lépni a(z) $(^Name) Eltávolítóból?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Icelandic.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1039\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Gretar Orri Kristinsson\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Uppsetning\n# ^UninstallCaption\n$(^Name) Fjarlæging\n# ^LicenseSubCaption\n: Notandaleyfissamningur\n# ^ComponentsSubCaption\n: Uppsetningarvalmöguleikar\n# ^DirSubCaption\n: Uppsetningarskráarsafn\n# ^InstallingSubCaption\n: Set upp\n# ^CompletedSubCaption\n: Lokið\n# ^UnComponentsSubCaption\n: Fjarlægingarvalmöguleikar\n# ^UnDirSubCaption\n: Fjarlægingarskráarsafn\n# ^ConfirmSubCaption\n: Staðfesting\n# ^UninstallingSubCaption\n: Fjarlægi\n# ^UnCompletedSubCaption\n: Lokið\n# ^BackBtn\n< &Til baka\n# ^NextBtn\n&Áfram >\n# ^AgreeBtn\nÉg &Samþykki\n# ^AcceptBtn\nÉg &samþykki skilmála leyfissamningsins\n# ^DontAcceptBtn\nÉg samþykki &ekki skilmála leyfissamningsins\n# ^InstallBtn\n&Setja upp\n# ^UninstallBtn\n&Fjarlægja\n# ^CancelBtn\nHætta við\n# ^CloseBtn\n&Loka\n# ^BrowseBtn\n&Vafra...\n# ^ShowDetailsBtn\nSýna &upplýsingar\n# ^ClickNext\nSmelltu á 'Áfram' til að halda áfram.\n# ^ClickInstall\nSmelltu á 'Setja upp' til þess að hefja uppsetninguna.\n# ^ClickUninstall\nSmelltu á 'Fjarlægja' til að hefja fjarlægingar ferlið.\n# ^Name\nNafn\n# ^Completed\nLokið\n# ^LicenseText\nVinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki'.\n# ^LicenseTextCB\nVinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. $_CLICK\n# ^LicenseTextRB\nVinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. $_CLICK\n# ^UnLicenseText\nVinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki'.\n# ^UnLicenseTextCB\nVinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. $_CLICK\n# ^UnLicenseTextRB\nVinsamlegast skoðaðu notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst. Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. $_CLICK\n# ^Custom\nSjálfval\n# ^ComponentsText\nHakaðu við þá íhluti sem þú vilt setja upp og taktu hakið af þeim íhlutum sem þú vilt ekki setja upp. $_CLICK\n# ^ComponentsSubText1\nVeldu tegund uppsetningar:\n# ^ComponentsSubText2_NoInstTypes\nVeldu þá íhluti sem á að setja upp:\n# ^ComponentsSubText2\nEða, veldu valfrjálsa íhluti á að setja upp:\n# ^UnComponentsText\nHakaðu við þá íhluti sem þú vilt fjarlægja og taktu hakið af þeim íhlutum sem þú vilt ekki fjarlægja. $_CLICK\n# ^UnComponentsSubText1\nVeldu tegund fjarlægingar:\n# ^UnComponentsSubText2_NoInstTypes\nVeldu íhluti sem á að fjarlægja:\n# ^UnComponentsSubText2\nEða, veldu valfrjálsa íhluti sem á að fjarlægja:\n# ^DirText\nUppsetningin mun setja $(^NameDA) upp í eftirfarandi skráarsafn. Til að setja forritið upp í annað skráarsafn, smelltu á 'Vafra...' og veldu annað skráarsafn. $_CLICK\n# ^DirSubText\nUppsetningarskráarsafn\n# ^DirBrowseText\nVeldu það skráarsafn sem þú vilt setja $(^NameDA) upp í:\n# ^UnDirText\nUppsetningin mun fjarlægja $(^NameDA) úr eftirfarandi skráarsafni. Til að fjarlægja forritið úr öðru skráarsafni, smelltu á 'Vafra...' og veldu annað skráarsafn. $_CLICK\n# ^UnDirSubText\n\"Fjarlægingarskráarsafn\"\n# ^UnDirBrowseText\nVeldu það skráarsafn sem þú vilt fjarlægja $(^NameDA) úr:\n# ^SpaceAvailable\n\"Tiltækt rými: \"\n# ^SpaceRequired\n\"Nauðsynlegt rými: \"\n# ^UninstallingText\n$(^NameDA) verður fjarlægt úr eftirfarandi skráarsafni. $_CLICK\n# ^UninstallingSubText\nFjarlægi úr:\n# ^FileError\nVilla við að skrifa í skrá: \\r\\n\\r\\n$0\\r\\n\\r\\nSmelltu á 'Hætta við' til að stoppa uppsetninguna,\\r\\n'Reyna aftur' til að gera aðra tilraun, eða\\r\\n'Hunsa' til sleppa þessari skrá.\n# ^FileError_NoIgnore\nVilla við að skrifa í skrá: \\r\\n\\r\\n$0\\r\\n\\r\\nSmelltu á 'Reyna aftur' til að gera aðra tilraun, eða\\r\\n'Hætta við' til að stoppa uppsetninguna.\n# ^CantWrite\n\"Get ei skrifað: \"\n# ^CopyFailed\nAfritun mistókst\n# ^CopyTo\n\"Afrita til \"\n# ^Registering\n\"Skrásetja: \"\n# ^Unregistering\n\"Afskrá: \"\n# ^SymbolNotFound\n\"Fann ekki tákn: \"\n# ^CouldNotLoad\n\"Gat ekki hlaðið inn: \"\n# ^CreateFolder\n\"Búa til skráarsafn: \"\n# ^CreateShortcut\n\"Búa til flýtileið: \"\n# ^CreatedUninstaller\n\"Bjó til fjarlægingarhjálp: \"\n# ^Delete\n\"Eyða skrá: \"\n# ^DeleteOnReboot\n\"Eyða við endurræsingu: \"\n# ^ErrorCreatingShortcut\n\"Villa við gerð flýtileiðar: \"\n# ^ErrorCreating\n\"Villa við gerð: \"\n# ^ErrorDecompressing\nVilla við afþjöppun gagna! Biluð uppsetningarhjálp?\n# ^ErrorRegistering\nVilla við skrásetningu DLL\n# ^ExecShell\n\"Keyrslugluggi: \"\n# ^Exec\n\"Keyra: \"\n# ^Extract\n\"Færa út: \"\n# ^ErrorWriting\n\"Færa út: villa við að skrifa í skrá \"\n# ^InvalidOpcode\nUppsetningarhjálp biluð: rangur stýrikóði\n# ^NoOLE\n\"Engin OLE fyrir: \"\n# ^OutputFolder\n\"Útskráarsafn: \"\n# ^RemoveFolder\n\"Fjarlægja skráarsafn: \"\n# ^RenameOnReboot\n\"Endurskíra við endurræsingu: \"\n# ^Rename\n\"Endurskíra: \"\n# ^Skipped\n\"Sleppt: \"\n# ^CopyDetails\nAfrita upplýsingar til skrifbrettis\n# ^LogInstall\nSkrá uppsetningarferli\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Icelandic.nsh",
    "content": "﻿;Language: Icelandic (15)\n;By Gretar Orri Kristinsson\n\n!insertmacro LANGFILE \"Icelandic\" = \"Íslenska\" \"Islenska\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Velkominn til $(^NameDA) uppsetningarhjálparinnar\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Þessi hjálp mun leiða þig í gegnum uppsetninguna á $(^NameDA).$\\r$\\n$\\r$\\nMælt er með því að þú lokir öllum öðrum forritum áður en uppsetningin hefst. Þetta mun gera uppsetningarforritinu kleyft að uppfæra kerfiskrár án þess að endurræsa tölvuna.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Velkomin(n) til $(^NameDA) fjarlægingarhjálparinnar\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Þessi hjálp mun leiða þig í gegnum fjarlæginguna á $(^NameDA).$\\r$\\n$\\r$\\nÁður en fjarlæging hefst skal ganga úr skugga um að $(^NameDA) sé ekki opið.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Notandaleyfissamningur\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Vinsamlegast skoðaðu Notandaleyfissamninginn vel áður en uppsetning á $(^NameDA) hefst.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki' til að halda áfram. Þú verður að samþykkja samninginn til þess að setja upp $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. Þú verður að samþykkja samninginn til þess að setja upp $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. Þú verður að samþykkja samninginn til þess að setja upp $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Leyfissamningur\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Vinsamlegast skoðaðu leyfissamninginn vel áður en fjarlæging á $(^NameDA) hefst.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ef þú samþykkir skilmála samningsins, smelltu þá á 'Ég samþykki' til að halda áfram. Þú verður að samþykkja samninginn til þess að fjarlægja $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ef þú samþykkir skilmála samningsins, hakaðu þá í kassann hér að neðan. Þú verður að samþykkja samninginn til þess að fjarlægja $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ef þú samþykkir skilmála samningsins, veldu þá fyrsta valmöguleikann hér að neðan. Þú verður að samþykkja samninginn til þess að fjarlægja $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Smelltu á 'PageDown' takkann á lyklaborðinu til að sjá afganginn af samningnum.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Velja íhluti\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Veldu hvaða $(^NameDA) íhluti þú vilt setja upp.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Velja íhluti\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Velja hvaða $(^NameDA) íhluti þú vilt fjarlægja.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Lýsing\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Færðu músina yfir íhlut til að fá lýsinguna á honum.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Veldu íhlut til þess að fá lýsinguna á honum.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Veldu uppsetningarskáarsafn\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Veldu það skráarsafn sem þú vilt setja $(^NameDA) upp í.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Velja fjarlægingarskáarsafn\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Veldu það skráarsafn sem þú vilt fjarlægja $(^NameDA) úr.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Set upp\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Vinsamlegast dokaðu við meðan $(^NameDA) er sett upp.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Uppsetningu lokið\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Uppsetning tókst.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Hætt við uppsetningu\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Uppsetningu lauk ekki sem skildi.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Fjarlægi\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Vinsamlegast dokaðu við á meðan $(^NameDA) er fjarlægt.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Fjarlægingu lokið\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Fjarlæging tókst.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Hætt við fjarlægingu\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Fjarlægingu lauk ekki sem skildi.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Ljúka $(^NameDA) uppsetningarhjálpinni\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) er nú upp sett á tölvunni þinni.$\\r$\\n$\\r$\\nSmelltu á 'Ljúka' til að loka þessari hjálp.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Til að ljúka uppsetningunni á $(^NameDA) verður að endurræsa tölvuna. Viltu endurræsa núna?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Ljúka $(^NameDA) fjarlægingarhjálpinni\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) hefur nú verið fjarlægt úr tölvunni.$\\r$\\n$\\r$\\nSmelltu á 'Ljúka' til að loka þessari hjálp.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Til að ljúka fjarlægingunni á $(^NameDA) verður að endurræsa tölvuna. Viltu endurræsa núna?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Endurræsa núna\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ég vil endurræsa seinna\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Keyra $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Skoða LestuMig\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Ljúka\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Velja skráarsafn 'Start' valmyndar\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Veldu skráarsafn $(^NameDA) flýtileiða fyrir 'Start' valmyndina.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Veldu skráarsafn flýtileiða forritsins fyrir 'Start' valmyndina. Þú getur einnig búið til nýtt skráarsafn með því að setja inn nýtt nafn.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ekki búa til flýtileiðir í 'Start' valmyndinni\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Fjarlægja $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Fjarlægja $(^NameDA) úr tölvunni.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ertu viss um að þú viljir loka $(^Name) uppsetningarhjálpinni?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Ertu viss um að þú viljir loka $(^Name) fjarlægingarhjálpinni?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Indonesian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1057\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Revision date: 2009 April\n# Translators:\n## Ariel <ariel825010106@yahoo.com>, <www.ariel106.cjb.net>\n## was.uthm@gmail.com\n#\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalasi Program $(^Name)\n# ^UninstallCaption\nPenghapusan Program $(^Name)\n# ^LicenseSubCaption\n: Perihal Lisensi\n# ^ComponentsSubCaption\n: Pilihan Instalasi\n# ^DirSubCaption\n: Lokasi Instalasi\n# ^InstallingSubCaption\n: Proses Instalasi\n# ^CompletedSubCaption\n: Selesai\n# ^UnComponentsSubCaption\n: Pilihan Penghapusan\n# ^UnDirSubCaption\n: Berkas Lokasi yang dihapus\n# ^ConfirmSubCaption\n: Konfirmasi\n# ^UninstallingSubCaption\n: Proses Penghapusan\n# ^UnCompletedSubCaption\n: Selesai\n# ^BackBtn\n< &Mundur\n# ^NextBtn\n&Lanjut >\n# ^AgreeBtn\nSaya &Setuju\n# ^AcceptBtn\nSaya s&etuju dengan Perihal Lisensi\n# ^DontAcceptBtn\nSaya &tidak setuju dengan Perihal Lisensi\n# ^InstallBtn\n&Instal\n# ^UninstallBtn\n&Hapus\n# ^CancelBtn\nBatalkan\n# ^CloseBtn\n&Tutup\n# ^BrowseBtn\nCa&ri...\n# ^ShowDetailsBtn\nLihat &perincian\n# ^ClickNext\nTekan tombol Lanjut untuk melanjutkan.\n# ^ClickInstall\nTekan tombol Instal untuk memulai instalasi.\n# ^ClickUninstall\nTekan tombol Hapus untuk memulai penghapusan.\n# ^Name\nNama\n# ^Completed\nSelesai\n# ^LicenseText\nSilahkan membaca lisensi berikut sebelum memulai instalasi $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, tekan tombol Saya Setuju.\n# ^LicenseTextCB\nSilahkan membaca lisensi berikut sebelum memulai instalasi $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, beri tanda centang. $_CLICK\n# ^LicenseTextRB\nSilahkan membaca lisensi berikut sebelum memulai instalasi $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. $_CLICK\n# ^UnLicenseText\nSilahkan membaca lisensi berikut sebelum mulai menghapus $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, tekan tombol Saya Setuju.\n# ^UnLicenseTextCB\nSilahkan membaca lisensi berikut sebelum mulai menghapus $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, beri tanda centang. $_CLICK\n# ^UnLicenseTextRB\nSilahkan membaca lisensi berikut sebelum mulai menghapus $(^NameDA). Jika anda menyetujui dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. $_CLICK\n# ^Custom\nTentukan Sendiri\n# ^ComponentsText\nBeri tanda centang pada komponen yang akan di instal and hilangkan tanda centang pada komponen yang tidak perlu di instal. $_CLICK\n# ^ComponentsSubText1\nPilih tipe instalasi:\n# ^ComponentsSubText2_NoInstTypes\nPilih komponen-komponen yang akan di instal:\n# ^ComponentsSubText2\nAtau, pilih komponen tambahan yang akan di instal:\n# ^UnComponentsText\nBeri tanda centang pada komponen yang akan dihapus and hilangkan tanda centang pada komponen yang tidak ingin dihapus. $_CLICK\n# ^UnComponentsSubText1\nPilih tipe penghapusan:\n# ^UnComponentsSubText2_NoInstTypes\nPilih komponen-komponen yang ingin dihapus:\n# ^UnComponentsSubText2\nAtau, pilih komponen tambahan yang ingin dihapus:\n# ^DirText\nProgram $(^NameDA) akan di instal pada lokasi berikut. Untuk memilih lokasi, tekan tombol Cari kemudian pilih lokasi yang anda kehendaki. $_CLICK\n# ^DirSubText\nLokasi instalasi\n# ^DirBrowseText\nPilih lokasi instalasi program $(^NameDA):\n# ^UnDirText\nProses penghapusan program $(^NameDA) dari lokasi instalasi berikut. Untuk memilih lokasi lainnya, tekan tombol Cari kemudian pilih lokasi yang anda kehendaki. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nPilih lokasi instalasi program $(^NameDA) yang akan dihapus:\n# ^SpaceAvailable\n\"Ruang yang tersedia:   \"\n# ^SpaceRequired\n\"Ruang yang dibutuhkan: \"\n# ^UninstallingText\n$(^NameDA) akan dihapus dari lokasi berikut. $_CLICK\n# ^UninstallingSubText\nProses penghapusan dari:\n# ^FileError\nTidak dapat membuka berkas untuk menulis: \\r\\n\\t\"$0\"\\r\\nTekan tombol Abort untuk membatalkan instalasi,\\r\\nRetry untuk mencoba lagi, atau\\r\\nIgnore untuk melewati file ini.\n# ^FileError_NoIgnore\nTidak dapat membuka berkas untuk menulis: \\r\\n\\t\"$0\"\\r\\nTekan tombol Retry untuk mencoba lagi, atau\\r\\nCancel untuk membatalkan instalasi.\n# ^CantWrite\n\"Tidak bisa menulis pada berkas: \"\n# ^CopyFailed\nGagal menyalin berkas\n# ^CopyTo\n\"Menyalin ke \"\n# ^Registering\n\"Memasukkan dalam daftar: \"\n# ^Unregistering\n\"Menghapus dari daftar: \"\n# ^SymbolNotFound\n\"Tidak dapat menemukan simbol: \"\n# ^CouldNotLoad\n\"Tidak dapat memuat: \"\n# ^CreateFolder\n\"Membuat tempat menyimpan berkas: \"\n# ^CreateShortcut\n\"Membuat shortcut: \"\n# ^CreatedUninstaller\n\"Program penghapusan yang dibuat: \"\n# ^Delete\n\"Menghapus berkas: \"\n# ^DeleteOnReboot\n\"Akan dihapus saat reboot: \"\n# ^ErrorCreatingShortcut\n\"Tidak dapat membuat shortcut: \"\n# ^ErrorCreating\n\"Ada kesalahan saat membuat: \"\n# ^ErrorDecompressing\nAda kesalahan saat membuka data! Program Instalasi tidak lengkap?\n# ^ErrorRegistering\nAda kesalahan ketika mendaftarkan modul DLL\n# ^ExecShell\n\"Perintah: \"\n# ^Exec\n\"Menjalankan: \"\n# ^Extract\n\"Proses ekstraksi berkas: \"\n# ^ErrorWriting\n\"Ekstraksi: ada kesalahan saat menulis ke berkas \"\n# ^InvalidOpcode\nProgram instalasi rusak: kode program tidak lengkap\n# ^NoOLE\n\"OLE tidak ditemukan: \"\n# ^OutputFolder\n\"Lokasi tujuan: \"\n# ^RemoveFolder\n\"Menghapus lokasi penyimpanan: \"\n# ^RenameOnReboot\n\"Memberi nama baru saat reboot: \"\n# ^Rename\n\"Memberi nama baru: \"\n# ^Skipped\n\"Dilewati: \"\n# ^CopyDetails\nSalin perincian ke Clipboard\n# ^LogInstall\nCatat proses instalasi\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Indonesian.nsh",
    "content": "﻿;Language: Indonesian (1057)\n;By Ariel825010106@yahoo.com modified by was.uthm@gmail.com in April 2009\n\n!insertmacro LANGFILE \"Indonesian\" = \"Bahasa Indonesia\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Selamat datang di program instalasi $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Program ini akan membantu anda dalam proses instalasi $(^NameDA).$\\r$\\n$\\r$\\nAnda sangat disarankan untuk menutup program lainnya sebelum memulai proses instalasi. Hal ini diperlukan agar berkas yang terkait dapat diperbarui tanpa harus booting ulang komputer anda.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Selamat datang di program penghapusan $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Program ini akan membantu anda pada proses penghapusan $(^NameDA).$\\r$\\n$\\r$\\nSebelum memulai proses penghapusan, pastikan dulu $(^NameDA) tidak sedang digunakan.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Perihal Lisensi\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Silahkan membaca perihal lisensi sebelum memulai proses instalasi $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Jika anda setuju dan menerima semua pernyataan, tekan tombol Saya Setuju untuk melanjutkan. Anda harus setuju untuk memulai instalasi $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jika anda setuju dan menerima semua pernyatan, beri tanda centang. Anda harus setuju untuk memulai instalasi $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jika anda setuju dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. Anda harus setuju untuk memulai instalasi $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Perihal Lisensi\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Silahkan membaca lisensi berikut sebelum melakukan penghapusan $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Jika anda setuju dan menerima semua pernyataan, tekan tombol Saya Setuju untuk melanjutkan. Anda harus setuju untuk memulai proses penghapusan $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jika anda setuju dan menerima semua pernyataan, beri tanda centang. Anda harus setuju untuk memulai proses penghapusan $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jika anda setuju dan menerima semua pernyataan, pilihlah salah satu item dibawah ini. Anda harus setuju untuk memulai proses penghapusan $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Tekan tombol Page Down untuk melihat pernyataan berikutnya.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Pilih Komponen\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Pilih komponen fitur tambahan dari $(^NameDA) yang ingin di instal.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Pilih Komponen\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Pilih komponen fitur tambahan dari $(^NameDA) yang ingin dihapus.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Deskripsi\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Tunjuk ke salah satu komponen untuk melihat deskripsi tentang komponen itu.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Pilih Lokasi Instalasi\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Pilih lokasi untuk instalasi program $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Pilih Lokasi berkas yang akan dihapus\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Pilih lokasi instalasi program $(^NameDA) yang akan dihapus.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Proses instalasi \"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Mohon tunggu sejenak, instalasi program $(^NameDA) sedang berlangsung.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalasi Selesai\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Seluruh proses instalasi sudah paripurna.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalasi Dibatalkan\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Proses instalasi tidak selesai dengan sempurna.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Proses penghapusan\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Mohon tunggu sejenak, penghapusan program $(^NameDA) sedang berlangsung.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Proses Penghapusan Selesai\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Seluruh proses penghapusan sudah paripurna.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Penghapusan Dibatalkan\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Proses penghapusa tidak selesai dengan sempurna.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Menutup Instalasi Program $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) sudah di instal di komputer anda.$\\r$\\n$\\r$\\nTekan tombol Selesai untuk menutup program.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Komputer anda memerlukan booting ulang untuk menyempurnakan proses instalasi $(^NameDA). Apakah anda akan melakukan booting ulang sekarang juga?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Menutup program penghapusan $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) sudah dihapus dari komputer anda.$\\r$\\n$\\r$\\nTekan tombol Selesai untuk menutup.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Komputer anda memerlukan booting untuk menyempurnakan proses penghapusan $(^NameDA). Apakah anda akan melakukan booting ulang sekarang juga?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Booting ulang sekarang\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Booting ulang nanti\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Jalankan $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Buka berkas Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Selesai\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Pilih lokasi dari Menu Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Pilih lokasi dari Menu Start untuk meletakkan shortcut $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Pilih lokasi dari Menu Start untuk meletakkan shortcut program ini. Anda bisa juga membuat lokasi baru dengan cara menulis nama lokasi yang dikehendaki.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Tidak perlu membuat shortcut\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Penghapusan $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Menghapus $(^NameDA) dari komputer anda.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Apakah anda yakin ingin menghentikan proses instalasi $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Apakah anda yakin ingin menghentikan proses penghapusan $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Pilihan Pemakai\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Pilihlah pemakai komputer yang akan menggunakan program $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Apakah anda akan melakukan instalasi $(^NameDA) untuk anda sendiri atau untuk semua pemakai komputer ini. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instalasi untuk semua pemakai komputer ini\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instalasi hanya untuk saya sendiri\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Irish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n2108\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Kevin P. Scannell < scannell at slu dot edu >\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nSocrú $(^Name)\n# ^UninstallCaption\nDíshuiteáil $(^Name)\n# ^LicenseSubCaption\n: Comhaontú um Cheadúnas\n# ^ComponentsSubCaption\n: Roghanna Suiteála\n# ^DirSubCaption\n: Fillteán Suiteála\n# ^InstallingSubCaption\n: Suiteáil\n# ^CompletedSubCaption\n: Críochnaithe\n# ^UnComponentsSubCaption\n: Roghanna Díshuiteála\n# ^UnDirSubCaption\n: Fillteán Díshuiteála\n# ^ConfirmSubCaption\n: Deimhniú\n# ^UninstallingSubCaption\n: Díshuiteáil\n# ^UnCompletedSubCaption\n: Críochnaithe\n# ^BackBtn\n< Ar Ai&s\n# ^NextBtn\nAr &Aghaidh >\n# ^AgreeBtn\nGl&acaim Leis\n# ^AcceptBtn\nTáim toilteanach &glacadh le coinníollacha an Chomhaontú um Cheadúnas\n# ^DontAcceptBtn\nNílim &toilteanach glacadh le coinníollacha an Chomhaontú um Cheadúnas\n# ^InstallBtn\n&Suiteáil\n# ^UninstallBtn\n&Díshuiteáil\n# ^CancelBtn\nCealaigh\n# ^CloseBtn\n&Dún\n# ^BrowseBtn\nB&rabhsáil...\n# ^ShowDetailsBtn\nTaispeáin &sonraí\n# ^ClickNext\nCliceáil \"Ar Aghaidh\" chun leanúint ar aghaidh.\n# ^ClickInstall\nCliceáil \"Suiteáil\" chun tosú.\n# ^ClickUninstall\nCliceáil \"Díshuiteáil\" chun tosú.\n# ^Name\nAinm\n# ^Completed\nCríochnaithe\n# ^LicenseText\nDéan iniúchadh ar an gComhaontú um Cheadúnas sula suiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil \"Glacaim Leis\".\n# ^LicenseTextCB\nDéan iniúchadh ar an gComhaontú um Cheadúnas sula suiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil an ticbhosca thíos. $_CLICK\n# ^LicenseTextRB\nDéan iniúchadh ar an gComhaontú um Cheadúnas sula suiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, roghnaigh an chéad rogha thíos. $_CLICK\n# ^UnLicenseText\nDéan iniúchadh ar an gComhaontú um Cheadúnas sula ndíshuiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil \"Glacaim Leis\".\n# ^UnLicenseTextCB\nDéan iniúchadh ar an gComhaontú um Cheadúnas sula ndíshuiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, cliceáil an ticbhosca thíos. $_CLICK\n# ^UnLicenseTextRB\nDéan iniúchadh ar an gComhaontú um Cheadúnas sula ndíshuiteálann tú $(^NameDA). Má ghlacann tú le gach coinníoll den chomhaontú, roghnaigh an chéad rogha thíos. $_CLICK\n# ^Custom\nSaincheaptha\n# ^ComponentsText\nRoghnaigh na comhpháirteanna is mian leat a shuiteáil, agus díroghnaigh na comhpháirteanna nach mian leat a shuiteáil. $_CLICK\n# ^ComponentsSubText1\nRoghnaigh cineál na suiteála:\n# ^ComponentsSubText2_NoInstTypes\nRoghnaigh na comhpháirteanna is mian leat a shuiteáil:\n# ^ComponentsSubText2\nNó, roghnaigh na comhpháirteanna roghnacha is mian leat a shuiteáil:\n# ^UnComponentsText\nRoghnaigh na comhpháirteanna is mian leat a dhíshuiteáil, agus díroghnaigh na comhpháirteanna nach mian leat a dhíshuiteáil. $_CLICK\n# ^UnComponentsSubText1\nRoghnaigh cineál na díshuiteála:\n# ^UnComponentsSubText2_NoInstTypes\nRoghnaigh comhpháirteanna le díshuiteáil:\n# ^UnComponentsSubText2\nNó, roghnaigh na comhpháirteanna roghnacha is mian leat a dhíshuiteáil:\n# ^DirText\nCuirfidh an Suiteálaí $(^NameDA) san fhillteán seo a leanas. Más mian leat suiteáil i bhfillteán difriúil, cliceáil \"Brabhsáil\" agus roghnaigh fillteán eile. $_CLICK\n# ^DirSubText\nSprioc-Fhillteán\n# ^DirBrowseText\nRoghnaigh an fillteán inar mian leat $(^NameDA) a shuiteáil:\n# ^UnDirText\nBainfidh an Suiteálaí $(^NameDA) amach as an bhfillteán seo a leanas. Más mian leat é a dhíshuiteáil ó fhillteán difriúil, cliceáil \"Brabhsáil\" agus roghnaigh fillteán eile. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nRoghnaigh an fillteán ar mian leat $(^NameDA) a dhíshuiteáil as:\n# ^SpaceAvailable\n\"Spás le fáil: \"\n# ^SpaceRequired\n\"Spás de dhíth: \"\n# ^UninstallingText\nDíshuiteálfar $(^NameDA) ón fhillteán seo a leanas. $_CLICK\n# ^UninstallingSubText\nÁ dhíshuiteáil ó:\n# ^FileError\nEarráid agus comhad á scríobh: \\r\\n\\r\\n$0\\r\\n\\r\\nCliceáil \"Abort\" chun an tsuiteáil a stopadh,\\r\\n\"Retry\" chun iarracht eile a dhéanamh, nó\\r\\n\"Ignore\" chun neamhaird a dhéanamh den chomhad seo.\n# ^FileError_NoIgnore\nEarráid agus comhad á scríobh: \\r\\n\\r\\n$0\\r\\n\\r\\nCliceáil \"Retry\" chun iarracht eile a dhéanamh, nó\\r\\n\"Cancel\" chun an tsuiteáil a stopadh.\n# ^CantWrite\n\"Ní féidir scríobh: \"\n# ^CopyFailed\nTheip ar an gcóipeáil\n# ^CopyTo\n\"Cóipeáil go \"\n# ^Registering\n\"Clárú: \"\n# ^Unregistering\n\"Díchlárú: \"\n# ^SymbolNotFound\n\"Níorbh fhéidir siombail a aimsiú: \"\n# ^CouldNotLoad\n\"Níorbh fhéidir luchtú: \"\n# ^CreateFolder\n\"Cruthaigh fillteán: \"\n# ^CreateShortcut\n\"Cruthaigh aicearra: \"\n# ^CreatedUninstaller\n\"Cruthaíodh díshuiteálaí: \"\n# ^Delete\n\"Scrios comhad: \"\n# ^DeleteOnReboot\n\"Scrios ag am atosaithe: \"\n# ^ErrorCreatingShortcut\n\"Earráid agus aicearra á chruthú: \"\n# ^ErrorCreating\n\"Earráid le linn cruthaithe: \"\n# ^ErrorDecompressing\nEarráid agus sonraí á ndíchomhbhrú! Suiteálaí truaillithe?\n# ^ErrorRegistering\nEarráid agus DLL á chlárú\n# ^ExecShell\n\"Blaosc: \"\n# ^Exec\n\"Rith: \"\n# ^Extract\n\"Bain Amach: \"\n# ^ErrorWriting\n\"Extract: earráid le linn scríofa \"\n# ^InvalidOpcode\nDíshuiteálaí truaillithe: cód neamhbhailí oibríochta\n# ^NoOLE\n\"Gan OLE le haghaidh: \"\n# ^OutputFolder\n\"Fillteán aschurtha: \"\n# ^RemoveFolder\n\"Bain fillteán: \"\n# ^RenameOnReboot\n\"Athainmnigh ag am atosaithe: \"\n# ^Rename\n\"Athainmnigh: \"\n# ^Skipped\n\"Neamhaird déanta de: \"\n# ^CopyDetails\nCóipeáil Sonraí go dtí an Ghearrthaisce\n# ^LogInstall\nLogáil an próiseas suiteála\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Irish.nsh",
    "content": "﻿;Language: Irish (2108)\n;By Kevin P. Scannell < scannell at slu dot edu >\n\n!insertmacro LANGFILE \"Irish\" = \"Gaeilge\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Fáilte go dtí Draoi Suiteála $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Déanfaidh an draoi seo treorú duit tríd an suiteáil de $(^NameDA).$\\r$\\n$\\r$\\nMoltar duit gach feidhmchlár eile a dhúnadh sula dtosaíonn tú an Suiteálaí. Cinnteoidh sé seo gur féidir na comhaid oiriúnacha a nuashonrú gan do ríomhaire a atosú.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Fáilte go dtí Draoi Díshuiteála $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Déanfaidh an draoi seo treorú duit tríd an díshuiteáil de $(^NameDA).$\\r$\\n$\\r$\\nBí cinnte nach bhfuil $(^NameDA) ag rith sula dtosaíonn tú an díshuiteáil.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Comhaontú um Cheadúnas\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Déan iniúchadh ar choinníollacha an cheadúnais sula suiteálann tú $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil $\\\"Glacaim Leis$\\\" chun leanúint ar aghaidh. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a shuiteáil.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil an ticbhosca thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a shuiteáil. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Má ghlacann tú le coinníollacha an chomhaontaithe, roghnaigh an chéad rogha thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Comhaontú um Cheadúnas\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Déan iniúchadh ar choinníollacha an cheadúnais sula ndíshuiteálann tú $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil $\\\"Glacaim Leis$\\\" chun leanúint ar aghaidh. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Má ghlacann tú le coinníollacha an chomhaontaithe, cliceáil an ticbhosca thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Má ghlacann tú le coinníollacha an chomhaontaithe, roghnaigh an chéad rogha thíos. Caithfidh tú glacadh leis an gcomhaontú chun $(^NameDA) a dhíshuiteáil. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Brúigh $\\\"Page Down$\\\" chun an chuid eile den cheadúnas a léamh.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Roghnaigh Comhpháirteanna\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Roghnaigh na gnéithe $(^NameDA) ba mhaith leat suiteáil.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Roghnaigh Comhpháirteanna\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Roghnaigh na gnéithe $(^NameDA) ba mhaith leat díshuiteáil.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Cur Síos\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Cuir do luch os cionn comhpháirte chun cur síos a fheiceáil.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Roghnaigh comhpháirt chun cur síos a fheiceáil.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Roghnaigh Suíomh na Suiteála\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Roghnaigh an fillteán inar mian leat $(^NameDA) a shuiteáil.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Roghnaigh Suíomh na Díshuiteála\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Roghnaigh an fillteán ar mian leat $(^NameDA) a dhíshuiteáil as.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Á Shuiteáil\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Fan go fóill; $(^NameDA) á shuiteáil.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Suiteáil Críochnaithe\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"D'éirigh leis an tsuiteáil.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Suiteáil Tobscortha\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Níor éirigh leis an tsuiteáil.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Á Dhíshuiteáil\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Fan go fóill; $(^NameDA) á dhíshuiteáil.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Díshuiteáil Críochnaithe\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"D'éirigh leis an díshuiteáil.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Díshuiteáil Tobscortha\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Níor éirigh leis an díshuiteáil.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Draoi Suiteála $(^NameDA) á Chríochnú\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Suiteáladh $(^NameDA) ar do ríomhaire.$\\r$\\n$\\r$\\nCliceáil $\\\"Críochnaigh$\\\" chun an draoi seo a dhúnadh.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Ní mór duit do ríomhaire a atosú chun suiteáil $(^NameDA) a chur i gcrích. Ar mhaith leat atosú anois?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Draoi Díshuiteála $(^NameDA) á Chríochnú\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Díshuiteáladh $(^NameDA) ó do ríomhaire.$\\r$\\n$\\r$\\nCliceáil $\\\"Críochnaigh$\\\" chun an draoi seo a dhúnadh.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Ní mór duit do ríomhaire a atosú chun díshuiteáil $(^NameDA) a chur i gcrích. Ar mhaith leat atosú anois?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Atosaigh anois\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Atosóidh mé de láimh níos déanaí\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Rith $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Tai&speáin comhad README\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Críochnaigh\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Roghnaigh Fillteán sa Roghchlár Tosaigh\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Roghnaigh fillteán sa Roghchlár Tosaigh a gcuirfear aicearraí $(^NameDA) ann.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Roghnaigh an fillteán sa Roghchlár Tosaigh inar mian leat aicearraí an chláir a chruthú. Is féidir freisin fillteán nua a chruthú trí ainm nua a iontráil.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ná cruthaigh aicearraí\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Díshuiteáil $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Bain $(^NameDA) ó do ríomhaire.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"An bhfuil tú cinnte gur mian leat Suiteálaí $(^Name) a scor?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"An bhfuil tú cinnte gur mian leat Díshuiteálaí $(^Name) a scor?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Italian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1040\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation orginally started by Orfanik - http://www.orfanik.hu\n# Updated v2 to v6 by Alessandro Staltari < staltari (a) geocities.com >\n# Revised by < mdalco@gmail.com > and bovirus < bovirus@gmail.com >\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstallazione di $(^Name)\n# ^UninstallCaption\nDisinstallazione di $(^Name)\n# ^LicenseSubCaption\n: Accordo di licenza\n# ^ComponentsSubCaption\n: Opzioni installazione\n# ^DirSubCaption\n: Cartella installazione\n# ^InstallingSubCaption\n: Installazione\n# ^CompletedSubCaption\n: Installazione completata\n# ^UnComponentsSubCaption\n: Opzioni disinstallazione\n# ^UnDirSubCaption\n: Cartella disinstallazione\n# ^ConfirmSubCaption\n: Conferma\n# ^UninstallingSubCaption\n: Disinstallazione\n# ^UnCompletedSubCaption\n: Disisntallazione completata\n# ^BackBtn\n< &Indietro\n# ^NextBtn\n&Avanti >\n# ^AgreeBtn\n&Accetto\n# ^AcceptBtn\n&Accetto le condizioni della licenza\n# ^DontAcceptBtn\n&Non accetto le condizioni della licenza\n# ^InstallBtn\nIns&talla\n# ^UninstallBtn\n&Disinstalla\n# ^CancelBtn\nAnnulla\n# ^CloseBtn\n&Fine\n# ^BrowseBtn\nS&foglia...\n# ^ShowDetailsBtn\nVisualizza &dettagli\n# ^ClickNext\nPer proseguire, seleziona 'Avanti'.\n# ^ClickInstall\nPer avviare l'installazione, seleziona 'Installa'.\n# ^ClickUninstall\nPer avviare la disinstallazione, seleziona 'Disinstalla'.\n# ^Name\nNome\n# ^Completed\nInstallazione completata\n# ^LicenseText\nLeggi la licenza prima di procedere con l'installazione di $(^NameDA). Se accetti le condizioni della licenza, seleziona 'Accetto'.\n# ^LicenseTextCB\nLeggi licenza prima di procedere con l'installazione di $(^NameDA). Se accetti tutte le condizioni della licenza, seleziona la casella sottostante. $_CLICK\n# ^LicesnseTextRB\nLeggi la licenza prima di procedere con l'installazione di $(^NameDA). Se accetti tutte le condizioni della licenza, seleziona la prima delle opzioni sottoindicate. $_CLICK\n# ^UnLicenseText\nLeggi la licenza prima di procedere con la disinstallazione di $(^NameDA). Se accetti tutte le condizioni della licenza, seleziona 'Accetto'. $_CLICK\n# ^UnLicenseTextCB\nLeggi la licenza prima di procedere con la disinstallazione di $(^NameDA). Se accetti tutte le condizioni della licenza, seleziona la casella sottostante. $_CLICK\n# ^UnLicesnseTextRB\nLeggi la licenza prima di procedere con la disinstallazione di $(^NameDA). Se accetti tutte le condizioni della licenza, seleziona la prima delle opzioni sottoindicate. $_CLICK\n# ^Custom\nPersonalizzata\n# ^ComponentsText\nSeleziona componenti da installare.\n# ^ComponentsSubText1\nSeleziona tipo installazione:\n# ^ComponentsSubText2_NoInstTypes\nSeleziona componenti da installare:\n# ^ComponentsSubText2\nOppure, seleziona componenti opzionali da installare:\n# ^UnComponentsText\nSeleziona componenti da disinstallare.\n# ^UnComponentsSubText1\nSeleziona tipo disinstallazione:\n# ^UnComponentsSubText2_NoInstTypes\nSeleziona componenti da disinstallare:\n# ^UnComponentsSubText2\nOppure, seleziona componenti opzionali da disinstallare :\n# ^DirText\nQuesta procedura installerà $(^NameDA) in questa cartella.\\r\\nPer installare in una cartella diversa, seleziona 'Sfoglia' e scegli un'altra cartella.\\r\\n$_CLICK\n# ^DirSubText\nCartella destinazione\n# ^DirBrowseText\nSeleziona la cartella dove installare $(^NameDA):\n# ^UnDirText\nQuesta procedura disinstallerà $(^NameDA) da questa cartella.\\r\\nPer disinstallare da una cartella diversa, seleziona 'Sfoglia' e scegli un'altra cartella.\\r\\n$_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSeleziona la cartella dalla quale disinstallare $(^NameDA):\n# ^SpaceAvailable\n\"Spazio disponibile: \"\n# ^SpaceRequired\n\"Spazio richiesto: \"\n# ^UninstallingText\n$(^NameDA) verrà disinstallato da questa cartella.\\r\\n$_CLICK\n# ^UninstallingSubText\nRimozione da:\n# ^FileError\nErrore nell'apertura del file per la scrittura: \\r\\n\\t\"$0\"\\r\\nSeleziona 'Termina' per interrompere l'installazione,\\r\\n'Riprova' per ritentare, oppure\\r\\n'Ignora' per saltare questo file.\n# ^FileError_NoIgnore\nErrore nell'apertura del file per la scrittura: \\r\\n\\t\"$0\"\\r\\nSeleziona 'Riprova' per ritentare, oppure\\r\\n'Termina' per interrompere l'installazione\n# ^CantWrite\n\"Impossibile scrivere: \"\n# ^CopyFailed\nCopia fallita\n# ^CopyTo\n\"Copia in \"\n# ^Registering\n\"Registrazione di: \"\n# ^Unregistering\n\"Deregistrazione di: \"\n# ^SymbolNotFound\n\"Impossibile trovare il simbolo: \"\n# ^CouldNotLoad\n\"Impossibile caricare: \"\n# ^CreateFolder\n\"Creazione cartella: \"\n# ^CreateShortcut\n\"Creazione collegamento: \"\n# ^CreatedUninstaller\n\"Creazione programma disinstallazione: \"\n# ^Delete\n\"Eliminazione file: \"\n# ^DeleteOnReboot\n\"Elimina al riavvio: \"\n# ^ErrorCreatingShortcut\n\"Errore nella creazione del collegamento: \"\n# ^ErrorCreating\n\"Errore nella creazione di: \"\n# ^ErrorDecompressing\nErrore nella decompressione dei dati! Probabile programma di installazione corrotto.\n# ^ErrorRegistering\nErrore nella registrazione della DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Esecuzione di: \"\n# ^Extract\n\"Estrazione di: \"\n# ^ErrorWriting\n\"Estrazione: errore nella scrittura nel file \"\n# ^InvalidOpcode\nProgramma di installazione corrotto: opcode non valido\n# ^NoOLE\n\"Nessuna OLE per: \"\n# ^OutputFolder \n\"Cartella destinazione: \"\n# ^RemoveFolder\n\"Rimozione cartella: \"\n# ^RenameOnReboot\n\"Al riavvio rinomina: \"\n# ^Rename\nRinomina \n# ^Skipped\n\"Saltato: \"\n# ^CopyDetails\nCopia i dettagli negli Appunti\n# ^LogInstall\nRegistro eventi processo installazione\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Italian.nsh",
    "content": "﻿;Language: Italian (1040)\n;By SANFACE Software <sanface@sanface.com> v1.67 accents\n;Review and update from v1.65 to v1.67 by Alessandro Staltari < staltari (a) geocities.com >\n;Review and update from v1.67 to v1.68 by Lorenzo Bevilacqua < meow811@libero.it >\n\n!insertmacro LANGFILE \"Italian\" = \"Italiano\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Installazione di $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Questo programma installerà $(^NameDA) nel computer.$\\r$\\n$\\r$\\nSi raccomanda di chiudere tutte le altre applicazioni prima di iniziare l'installazione. Questo permetterà al programma di installazione di aggiornare i file di sistema senza dover riavviare il computer.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Disinstallazione di $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Questa programma ti guiderà nella disinstallazione di $(^NameDA).$\\r$\\n$\\r$\\nPrima di iniziare la disinstallazione, assicurati che $(^Name) non sia in esecuzione.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Accordo di licenza\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Leggi le condizioni dell'accordo di licenza prima di installare $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Se accetti tutti i termini dell'accordo di licenza, seleziona 'Accetto' per continuare. Per installare $(^NameDA) è necessario accettare i termini dell'accordo di licenza.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se accetti i termini dell'accordo di licenza, seleziona la casella sottostante. Per installare $(^NameDA) è necessario accettare i termini dell'accordo di licenza. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se accetti i termini dell'accordo di licenza, seleziona la prima opzione sottostante. Per installare $(^NameDA) è necessario accettare i termini della licenza d'uso. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Accordo di licenza\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Leggi le condizioni dell'accordo di licenza prima di installare $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Se accetti tutti i termini dell'accordo di licenza, seleziona 'Accetto' per continuare. Per installare $(^NameDA) è necessario accettare i termini dell'accordo di licenza.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se accetti i termini dell'accordo di licenza, seleziona la casella sottostante. Per installare $(^NameDA) è necessario accettare i termini dell'accordo di licenza. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se accetti i termini dell'accordo di licenza, seleziona la prima opzione sottostante. Per installare $(^NameDA) è necessario accettare i termini della licenza d'uso. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Premi 'PagGiù' per visualizzare il resto dell'accordo di licenza.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Selezione componenti\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Seleziona i componenti di $(^NameDA) da installare.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Selezione componenti\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Seleziona i componenti di $(^NameDA) da disinstallare.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descrizione\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Posiziona il puntatore del mouse sul componente per visualizzare  la relativa descrizione.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Seleziona un componente per visualizzare la relativa descrizione.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Selezione cartella installazione\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Seleziona la cartella nella quale installare $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Selezione cartella da cui disinstallare\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Seleziona la cartella dalla quale disinstallare $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installazione\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Attendi il completamento dell'installazione di $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installazione completata\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"L'installazione è stata completata correttamente.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installazione interrotta\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"L'installazione non è stata completata correttamente.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Disinstallazione\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Attendi il completamento della disinstallazione di $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Disinstallazione completata\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"La disinstallazione è stata completata correttamente.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Disinstallazione interrotta\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"La disintallazione non è stata completata correttamente.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Installazione di $(^NameDA) completata.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) è stato installato.$\\r$\\n$\\r$\\nScegli 'Chiudi' per chiudere il programma di installazione.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Per completare l'installazione di $(^NameDA) il computer deve essere riavviato. Vuoi riavviarlo ora?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Disinstallazione di $(^NameDA) completata.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) è stato disinstallato.$\\r$\\n$\\r$\\nSeleziona 'Chiudi' per chiudere questa procedura.\"  \n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Per completare la disinstallazione di $(^NameDA) il computer deve essere riavviato. Vuoi riavviarlo ora?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Riavvia ora\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Preferisco riavviarlo manualmente più tardi\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Esegui $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Visualizza il file Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Chiudi\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Selezione cartella menu Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Seleziona la cartella del menu Start in cui creare i collegamenti del programma.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Seleziona la cartella del menu Start in cui verranno creati i collegamenti del programma. È possibile inserire un nome per creare una nuova cartella.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Non creare i collegamenti del programma.\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Disinstallazione\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Disinstalla il programma $(^NameDA).\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Sei sicuro di voler interrompere l'installazione di $(^Name) ?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Sei sicuro di voler interrompere la disinstallazione di $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Configurazione profilo utenti\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Seleziona per quali utenti vuoi installare $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Seleziona se vuoi installare $(^NameDA) solo per questo utente o per tutti gli utenti di questo sistema. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installazione per tutti gli utenti\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installazione per il singolo utente\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Japanese.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1041\n# Font and size - dash (-) means default\nＭＳ Ｐゴシック\n9\n# Codepage - dash (-) means ASCII code page\n932\n# RTL - anything else than RTL means LTR\n-\n# Translation by Dnanako(2002), Updated by Takahiro Yoshimura(2003) <takahiro_y@monolithworks.co.jp>, maboroshin(2020)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) セットアップ\n# ^UninstallCaption\n$(^Name) アンインストール\n# ^LicenseSubCaption\n:使用許諾契約\n# ^ComponentsSubCaption\n:インストール オプション\n# ^DirSubCaption\n:インストール フォルダ\n# ^InstallingSubCaption\n:インストール\n# ^CompletedSubCaption\n:完了\n# ^UnComponentsSubCaption\n: アンインストール オプション\n# ^UnDirSubCaption\n: アンインストール フォルダ\n# ^ComfirmSubCaption\n:確認\n# ^UninstallingSubCaption\n:アンインストール\n# ^UnCompletedSubCaption\n:完了\n# ^BackBtn\n< 戻る(&B)\n# ^NextBtn\n次へ(&N) >\n# ^AgreeBtn\n同意する(&A)\n# ^AcceptBtn\nこの使用許諾契約に同意する(&A)\n# ^DontAcceptBtn\nこの使用許諾契約に同意しません(&D)\n# ^InstallBtn\nインストール(&I)\n# ^UninstallBtn\nｱﾝｲﾝｽﾄｰﾙ(&U)\n# ^CancelBtn\nキャンセル\n# ^CloseBtn\n閉じる(&C)\n# ^BrowseBtn\n参照(&R)...\n# ^ShowDetailsBtn\n詳細を表示(&D)\n# ^ClickNext\n「次へ」をクリックし続行します。\n# ^ClickInstall\n「インストール」をクリックしインストールを開始します。\n# ^ClickUninstall\n「アンインストール」をクリックしアンインストールを開始します。\n# ^Name\nアプリケーション\n# ^Completed\n完了\n# ^LicenseText\n$(^NameDA) をインストールする前に、使用許諾契約を確認してください。契約のすべての条件に同意するなら、「同意する」をクリックしてください。\n# ^LicenseTextCB\n$(^NameDA) をインストールする前に、使用許諾契約を確認してください。契約のすべての条件に同意するなら、下のチェックボックスをクリックしてください。 $_CLICK\n# ^LicenseTextRB\n$(^NameDA) をインストールする前に、使用許諾契約を確認してください。契約のすべての条件に同意するなら、下の選択肢から最初のものを選択してください。 $_CLICK\n# ^UnLicenseText\n$(^NameDA) をアンインストールする前に、使用許諾契約を確認してください。契約のすべての条件に同意するなら、「同意する」をクリックしてください。\n# ^UnLicenseTextCB\n$(^NameDA) をアンインストールする前に、使用許諾契約を確認してください。契約のすべての条件に同意するなら、下のチェックボックスをクリックしてください。 $_CLICK\n# ^UnLicenseTextRB\n$(^NameDA) をアンインストールする前に、使用許諾契約を確認してください。契約のすべての条件に同意するなら、下の選択肢から最初のものを選択してください。 $_CLICK\n# ^Custom\nカスタム\n# ^ComponentsText\nインストールしたい構成要素にチェックしてください。不要なものはチェックを外してください。 $_CLICK\n# ^ComponentsSubText1\nインストールの種類を選択:\n# ^ComponentsSubText2_NoInstTypes\nインストールする構成要素を選択:\n# ^ComponentsSubText2\nまたはインストールしたい構成要素を選択:\n# ^UnComponentsText\nアンインストールしたい構成要素にチェックしてください。そうでないものはチェックを外してください。 $_CLICK\n# ^UnComponentsSubText1\nアンインストールの種類を選択:\n# ^UnComponentsSubText2_NoInstTypes\nアンインストールする構成要素を選択:\n# ^UnComponentsSubText2\nまたはアンインストールしたい構成要素を選択:\n# ^DirText\n$(^NameDA) を以下のフォルダにインストールします。別のフォルダにインストールするには、「参照」 を押しフォルダを選択してください。 $_CLICK\n# ^DirSubText\nインストール先のフォルダ\n# ^DirBrowseText\n$(^NameDA) をインストールするフォルダを選択:\n# ^UnDirText\n$(^NameDA) を以下のフォルダからアンインストールします。別のフォルダからアンインストールするには、「参照」 を押しフォルダを選択してください。 $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n$(^NameDA) をアンインストールするフォルダを選択:\n# ^SpaceAvailable\n空き容量: \n# ^SpaceRequired\n必要容量: \n# ^UninstallingText\n$(^NameDA) を以下のフォルダからアンインストールされます。 $_CLICK\n# ^UninstallingSubText\nアンインストール元:\n# ^FileError\n書き込みファイルオープンのエラー:\\r\\n\\t\"$0\"\\r\\nインストールを中止するには「中止」、\\r\\n再びこのファイルの作成を試みるには「再試行」、\\r\\nこのファイルをスキップして続けるには「無視」を押してください。\n# ^FileError_NoIgnore\n書き込みファイルオープンのエラー: \\r\\n\\t\"$0\"\\r\\n再びこのファイルの作成を試みるには「再試行」、\\r\\nインストールを中止するには「キャンセル」を押してください。\n# ^CantWrite\n書き込めません:\n# ^CopyFailed\nコピー失敗\n# ^CopyTo\nコピー\n# ^Registering\n登録中:\n# ^Unregistering\n登録解除中:\n# ^SymbolNotFound\nシンボルが見つかりません:\n# ^CouldNotLoad\n読み込みに失敗:\n# ^CreateFolder\nフォルダ作成:\n# ^CreateShortcut\nショートカット作成:\n# ^CreatedUninstaller\nアンインストーラ作成:\n# ^Delete\nファイル削除:\n# ^DeleteOnReboot\n再起動時に削除:\n# ^ErrorCreatingShortcut\nショートカット作成エラー:\n# ^ErrorCreating\n作成エラー:\n# ^ErrorDecompressing\nデータの展開エラー\\r\\n\\r\\nインストーラが破損していませんか？\n# ^ErrorRegistering\nDLL の登録エラー\n# ^ExecShell\n拡張子の関連付け実行: \n# ^Execute\n実行:\n# ^Extract\n展開:\n# ^ErrorWriting\n展開:ファイルへの書き込みエラー\n# ^InvalidOpcode\nインストーラーが壊れている:無効な opcode\n# ^NoOLE\nOLE がありません:\n# ^OutputFolder\n出力先フォルダ:\n# ^RemoveFolder\nフォルダ削除:\n# ^RenameOnReboot\n再起動時に名前の変更:\n# ^Rename\n名前の変更:\n# ^Skipped\n省略:\n# ^CopyDetails\nクリップボードへ詳細をコピー\n# ^LogInstall\nインストールの経過をログヘ記録\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Japanese.nsh",
    "content": "﻿;Language: Japanese (1041)\n; 1st translation by Dnanako Dnanako (2002, r1537), 2nd update by Takahiro Yoshimura (2003, r2489) <takahiro_y@monolithworks.co.jp>, 3rd update by maboroshin (July 2020)\n\n!insertmacro LANGFILE \"Japanese\" = \"日本語\" \"Nihongo\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) セットアップへようこそ\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"セットアップは、$(^NameDA) のインストールをご案内します。$\\r$\\n$\\r$\\nセットアップを開始する前に、他のすべてのアプリケーションを終了することを推奨します。これによってセットアップがコンピュータを再起動せずに、システム ファイルを更新することができるようになります。$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"$(^NameDA) アンインストールへようこそ\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"セットアップは、$(^NameDA) のアンインストールをご案内します。$\\r$\\n$\\r$\\nアンインストールを開始する前に、$(^NameDA) が起動していないことを確認して下さい。$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"使用許諾契約\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"$(^NameDA) をインストールする前に、ライセンス条件を確認してください。\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"契約のすべての条件に同意するなら、「同意する」 を選択しインストールを続行します。$(^NameDA) をインストールするには、契約に同意する必要があります。\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"契約のすべての条件に同意するなら、下のチェックボックスをクリックしてください。$(^NameDA) をインストールするには、契約に同意する必要があります。 $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"契約のすべての条件に同意するなら、下に表示されているオプションのうち、最初のものを選択してください。$(^NameDA) をインストールするには、契約に同意する必要があります。 $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"使用許諾契約\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"$(^NameDA) をアンインストールする前に、ライセンス条件を確認してください。\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"契約のすべての条件に同意するなら、「同意する」 を選択しアンインストールを続行します。$(^NameDA) をアンインストールするには、契約に同意する必要があります。\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"契約のすべての条件に同意するなら、下のチェックボックスをクリックしてください。$(^NameDA) をアンインストールするには、契約に同意する必要があります。 $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"契約のすべての条件に同意するなら、下の選択肢から最初のものを選択してください。$(^NameDA) をアンインストールするには、契約に同意する必要があります。 $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"[Page Down] を押し契約をすべてお読みください。\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"構成要素の選択\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"インストールしたい $(^NameDA) の機能を選択してください。\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"構成要素の選択\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"アンインストールしたい $(^NameDA) の機能を選択してください。\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"説明\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"構成要素にマウス カーソルを載せると、説明が表示されます。\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"構成要素を選択すると、説明が表示されます。\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"インストール先の選択\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"$(^NameDA) をインストールするフォルダを選択してください。\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"アンインストール元の選択\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"$(^NameDA) をアンインストールするフォルダを選択してください。\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"インストール\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"$(^NameDA) をインストール中です。お待ちください。\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"インストールの完了\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"インストールに成功しました。\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"インストールの中止\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"セットアップは正常に完了しませんでした。\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"アンインストール\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"$(^NameDA) をアンインストール中です。お待ちください。\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"アンインストールの完了\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"アンインストールに成功しました。\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"アンインストールの中止\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"アンインストールは正常に完了しませんでした。\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) セットアップの完了\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) は、このコンピュータにインストールされました。$\\r$\\n$\\r$\\n「完了」をクリックしセットアップを閉じます。\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA) のインストールを完了するには、このコンピュータを再起動する必要があります。今すぐ再起動しますか？\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) アンインストールの完了\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) は、このコンピュータからアンインストールされました。$\\r$\\n$\\r$\\n「完了」をクリックしセットアップを閉じます。\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) のアンインストールを完了するには、このコンピュータを再起動する必要があります。今すぐ再起動しますか？\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"今すぐ再起動\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"後で手動で再起動\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) を実行(&R)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Readme を表示(&S)\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"完了(&F)\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"スタートメニューのフォルダの選択\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"$(^NameDA) のショートカットを作成するスタートメニューのフォルダを選択してください。\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"このプログラムのショートカットを作成したいスタートメニューのフォルダを選択してください。また、新規フォルダの名前を入力することもできます。\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"ショートカットを作成しない\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA) のアンインストール\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) をこのコンピュータから削除します。\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"$(^Name) セットアップを中止しますか？\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"$(^Name) アンインストールを中止しますか？\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"ユーザーの選択\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"どのユーザーのために $(^NameDA) をインストールするか選択してください。\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"$(^NameDA) を自分自身のためだけにインストールするのか、このコンピューターのすべてのユーザーにインストールするのか選択してください。$(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"このコンピューターを使用する全員にインストール\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"自分にのみインストール\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Korean.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1042\n# Font and size - dash (-) means default\n굴림\n9\n# Codepage - dash (-) means ASCII code page\n949\n# RTL - anything else than RTL means LTR\n-\n# Translation by dTomoyo dtomoyo@empal.com ( ~V2.0 BETA2 ) / By hardkoder@gmail.com (V2.0 BETA3 ~ )\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) 설치\n# ^UninstallCaption\n$(^Name) 제거\n# ^LicenseSubCaption\n: 사용권 계약 동의\n# ^ComponentsSubCaption\n: 설치 옵션\n# ^DirSubCaption\n: 폴더 지정\n# ^InstallingSubCaption\n: 파일 설치중\n# ^CompletedSubCaption\n: 설치 완료\n# ^UnComponentsSubCaption\n: 제거 옵션\n# ^UnDirSubCaption\n: 제거 폴더\n# ^ConfirmSubCaption\n: 확인 \n# ^UninstallingSubCaption\n: 제거중\n# ^UnCompletedSubCaption\n: 제거 완료\n# ^BackBtn\n< 뒤로\n# ^NextBtn\n다음 >\n# ^AgreeBtn\n동의함\n# ^AcceptBtn\n위 사항에 동의합니다.\n# ^DontAcceptBtn\n동의하지 않습니다.\n# ^InstallBtn\n설치\n# ^UninstallBtn\n제거\n# ^CancelBtn\n취소\n# ^CloseBtn\n닫음\n# ^BrowseBtn\n찾아보기...\n# ^ShowDetailsBtn\n자세히 보기\n# ^ClickNext\n계속하시려면 '다음' 버튼을 눌러 주세요.\n# ^ClickInstall\n설치를 시작하시려면 '설치' 버튼을 눌러 주세요.\n# ^ClickUninstall\n'제거' 버튼을 누르면 제거가 시작됩니다.\n# ^Name\n이름\n# ^Completed\n완료\n# ^LicenseText\n$(^NameDA)(을)를 설치하기 전에 사용권 계약 내용을 살펴보시기 바랍니다. 내용에 동의하셨다면 '동의함'을 눌러 주세요.\n# ^LicenseTextCB\n$(^NameDA)(을)를 설치하기 전에 사용권 계약 내용을 살펴보시기 바랍니다. 내용에 동의하셨다면 아래 사항을 체크해 주세요. $_CLICK\n# ^LicesnseTextRB\n$(^NameDA)(을)를 설치하기 전에 사용권 계약 내용을 살펴보시기 바랍니다. 내용에 동의하셨다면 아래 옵션을 선택해 주세요. $_CLICK\n# ^UnLicenseText\n$(^NameDA)(을)를 제거하기 전에 사용권 계약 내용을 살펴보시기 바랍니다. 내용에 동의하셨다면 '동의함'을 눌러 주세요.\n# ^UnLicenseTextCB\n$(^NameDA)(을)를 제거하기 전에 사용권 계약 내용을 살펴보시기 바랍니다. 내용에 동의하셨다면 아래 사항을 체크해 주세요. $_CLICK\n# ^UnLicesnseTextRB\n$(^NameDA)(을)를 제거하기 전에 사용권 계약 내용을 살펴보시기 바랍니다. 내용에 동의하셨다면 아래 옵션을 선택해 주세요. $_CLICK\n# ^Custom\n사용자 정의\n# ^ComponentsText\n설치를 원하시는 구성 요소를 선택하여 주시기 바랍니다. $_CLICK\n# ^ComponentsSubText1\n설치 형태 선택:\n# ^ComponentsSubText2_NoInstTypes\n설치하려는 구성 요소 선택:\n# ^ComponentsSubText2\n구성요소 직접 선택:\n# ^UnComponentsText\n제거를 원하는 구성 요소를 체크해 주시기 바랍니다. $_CLICK\n# ^UnComponentsSubText1\n제거 형태 선택:\n# ^UnComponentsSubText2_NoInstTypes\n제거하려는 구성 요소 선택:\n# ^UnComponentsSubText2\n제거하려는 구성요소 직접 선택:\n# ^DirText\n$(^NameDA)(을)를 다음 폴더에 설치할 예정입니다. \\r\\n다른 폴더에 설치하고 싶으시면 '찾아보기' 버튼을 눌러서 다른 폴더를 선택해 주세요. $_CLICK\n# ^DirSubText\n설치 폴더\n# ^DirBrowseText\n$(^NameDA)(을)를 다음 폴더에 설치합니다:\n# ^UnDirText\n$(^NameDA)(을)를 다음 폴더에서 제거할 예정입니다. \\r\\n다른 폴더에서 제거하고 싶으시면 '찾아보기' 버튼을 눌러서 다른 폴더를 선택해 주세요. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n$(^NameDA)(을)를 다음 폴더에서 제거 합니다:\n# ^SpaceAvailable\n\"남은 디스크 공간: \"\n# ^SpaceRequired\n\"필요한 디스크 공간: \"\n# ^UninstallingText\n시스템에서 $(^NameDA)(을)를 제거 할 것입니다. $_CLICK\n# ^UninstallingText\n제거 대상:\n# ^FileError\n다음 파일을 열 수 없습니다.: \\r\\n\\t\"$0\"\\r\\n'중단'을 눌러 설치를 종료하거나,\\r'다시 시도'를 눌러 다시 시도해 보거나,\\r'무시'를 눌러 이 파일을 건너 뛰세요.\n# ^FileError_NoIgnore\n다음 파일을 열 수 없습니다.: \\r\\n\\t\"$0\"\\r\\n'다시 시도'를 눌러 다시 시도해 보거나,\\r'취소'를 눌러 설치를 종료하세요.\n# ^CantWrite\n\"기록할 수 없음: \"\n# ^CopyFailed\n복사 실패\n# ^CopyTo\n\"파일 복사 \"\n# ^Registering\n\"등록중: \"\n# ^Unregistering\n\"등록 해제중: \"\n# ^SymbolNotFound\n\"심볼을 찾을 수 없음: \"\n# ^CouldNotLoad\n\"불러올 수 없음: \"\n# ^CreateFolder\n\"폴더 생성: \"\n# ^CreateShortcut\n\"바로 가기 생성: \"\n# ^CreatedUninstaller\n\"언인스톨러 생성: \"\n# ^Delete\n\"파일 삭제: \"\n# ^DeleteOnReboot\n\"재부팅시 삭제: \"\n# ^ErrorCreatingShortcut\n\"바로 가기 생성 오류: \"\n# ^ErrorCreating\n\"생성 실패: \"\n# ^ErrorDecompressing\n압축 해제중 오류 발생! 설치 파일이 손상되었습니다.\n# ^ErrorRegistering\nDLL 등록 실패\n# ^ExecShell\n\"쉘 실행: \"\n# ^Exec\n\"실행: \"\n# ^Extract\n\"압축 해제: \"\n# ^ErrorWriting\n\"압축 해제: 파일을 기록하는 도중 오류 발생 \"\n# ^InvalidOpcode\n인스톨러 손상됨: 잘못된 실행코드\n# ^NoOLE\n\"OLE 정보 없음: \"\n# ^OutputFolder\n\"대상 폴더: \"\n# ^RemoveFolder\n\"폴더 삭제: \"\n# ^RenameOnReboot\n\"재부팅시 이름 변경: \"\n# ^Rename\n\"이름 변경: \"\n# ^Skipped\n\"건너뜀: \"\n# ^CopyDetails\n자세한 내용을 클립보드로 복사\n# ^LogInstall\n설치 로그 작성\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Korean.nsh",
    "content": "﻿;Language: Korean (1042)\n;By linak linak@korea.com ( ~ V2.0 BETA3 ) By kippler@gmail.com(www.kipple.pe.kr) ( V2.0 BETA3 ~ ) (last update:2007/09/05)\n\n!insertmacro LANGFILE \"Korean\" = \"한국어\" \"Hangugeo\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) 설치를 시작합니다.\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"이 프로그램은 당신의 컴퓨터에 $(^NameDA)(을)를 설치할 것입니다.$\\r$\\n$\\r$\\n설치를 시작하기 전 가능한 한 모든 프로그램을 종료하여 주시기 바랍니다. 이는 재부팅을 하지 않고서도 시스템 파일을 수정할 수 있게 해줍니다.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"$(^NameDA) 제거를 시작합니다.\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"이 프로그램은 당신의 컴퓨터에서 $(^NameDA)(을)를 제거할 것입니다.$\\r$\\n$\\r$\\n제거를 시작하기 전에 $(^NameDA)(을)를 종료하여 주시기 바랍니다.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"사용권 계약\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"$(^NameDA)(을)를 설치하시기 전에 사용권 계약 내용을 살펴보시기 바랍니다.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"내용에 동의하셨다면 '동의함'을 눌러 주세요. $(^NameDA)(을)를 설치하기 위해서는 반드시 내용에 동의하셔야 합니다.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"내용에 동의하셨다면 아래 사항을 선택해 주세요. $(^NameDA)(을)를 설치하기 위해서는 반드시 내용에 동의하셔야 합니다. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"내용에 동의하셨다면 첫 번째 사항을 선택해 주세요. $(^NameDA)(을)를 설치하기 위해서는 반드시 내용에 동의하셔야 합니다. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"사용권 계약 동의\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"$(^NameDA)(을)를 제거하시기 전에 사용권 계약 내용을 살펴보시기 바랍니다.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"내용에 동의하셨다면 '동의함'을 눌러 주세요. $(^NameDA)(을)를 제거하기 위해서는 반드시 내용에 동의하셔야 합니다.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"내용에 동의하셨다면 아래 사항을 선택해 주세요. $(^NameDA)(을)를 제거하기 위해서는 반드시 내용에 동의하셔야 합니다. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"내용에 동의하셨다면 첫 번째 사항을 선택해 주세요. $(^NameDA)(을)를 제거하기 위해서는 반드시 내용에 동의하셔야 합니다. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"사용권 계약 동의 사항의 나머지 부분을 보시려면 [Page Down] 키를 눌러 주세요.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"구성 요소 선택\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"설치하고자 하는 $(^NameDA)의 구성 요소를 선택해 주세요.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"구성 요소 선택\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"제거하고자 하는 $(^NameDA)의 구성 요소를 선택해 주세요.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"상세 설명\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"상세 설명을 보고 싶으신 부분에 마우스를 올려놓으세요.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"상세 설명을 보고 싶으신 부분을 선택하세요.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"설치 위치 선택\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"$(^NameDA)(을)를 설치할 폴더를 선택해 주세요.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"제거 위치 선택\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"$(^NameDA)(을)를 제거할 폴더를 선택해 주세요.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"설치중\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"$(^NameDA)(을)를 설치하는 동안 잠시 기다려 주세요.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"설치 완료\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"설치가 성공적으로 완료되었습니다.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"설치 취소\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"프로그램 설치가 취소되었습니다.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"제거중\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"$(^NameDA)(을)를 제거하는 동안 잠시 기다려 주시기 바랍니다.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"제거 마침\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"프로그램을 성공적으로 제거하였습니다.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"프로그램 제거 취소\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"프로그램 제거가 취소되었습니다.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) 설치 완료\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA)의 설치가 완료되었습니다.$\\r$\\n$\\r$\\n설치 프로그램을 마치려면 '마침' 버튼을 눌러 주세요.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA)의 설치를 완료하기 위해서는 시스템을 다시 시작해야 합니다. 지금 재부팅 하시겠습니까?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) 제거 완료\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA)의 제거가 완료 되었습니다.$\\r$\\n$\\r$\\n설치 프로그램을 마치려면 '마침' 버튼을 눌러 주세요.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA)의 제거를 완료하기 위해서는 시스템을 다시 시작해야 합니다. 지금 재부팅 하시겠습니까?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"지금 재부팅 하겠습니다.\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"나중에 재부팅 하겠습니다.\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) 실행하기(&R)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Readme 파일 보기(&S)\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"마침\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"시작 메뉴 폴더 선택\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"프로그램의 바로 가기 아이콘이 생성될 시작 메뉴 폴더 선택.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"프로그램의 바로 가기 아이콘이 생성될 시작 메뉴 폴더를 선택하세요. 새로운 폴더를 생성하려면 폴더 이름을 입력하세요.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"바로 가기 아이콘을 만들지 않겠습니다.\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA) 제거\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) 제거하기\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"$(^Name) 설치를 취소하시겠습니까?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"$(^Name) 제거를 취소하시겠습니까?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Kurdish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID (none exists for Kurdish at this time)\n9999\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1254\n# RTL - anything else than RTL means LTR\n-\n# Translation by Rêzan Tovjîn(chagy) (retovjin@hotmail.com.com)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Sazkirin\n# ^UninstallCaption\n$(^Name) Rakirin\n# ^LicenseSubCaption\n: Peymana Lîsansê\n# ^ComponentsSubCaption\n: Vebijêrkên Sazkirinê\n# ^DirSubCaption\n: Peldanka Sazkirinê\n# ^InstallingSubCaption\n: Tê Sazkirin\n# ^CompletedSubCaption\n: Qediya\n# ^UnComponentsSubCaption\n: Vebijêrkên Rakirinê\n# ^UnDirSubCaption\n: Peldanka Rakirinê\n# ^ConfirmSubCaption\n: Erêkirin\n# ^UninstallingSubCaption\n: Tê Rakirin\n# ^UnCompletedSubCaption\n: Qediya\n# ^BackBtn\n< &Vegere\n# ^NextBtn\n&Bidomîne >\n# ^AgreeBtn\n&Ez Dipejirînim\n# ^AcceptBtn\nŞertên Peymanê &Dipejirînim\n# ^DontAcceptBtn\nŞertên Peymanê Napejirînim\n# ^InstallBtn\n&Saz Bike\n# ^UninstallBtn\n&Rake\n# ^CancelBtn\nBetal\n# ^CloseBtn\n&Bigire\n# ^BrowseBtn\n&Çavlêgerîn...\n# ^ShowDetailsBtn\nHûragahiyan &Nîşan Bide\n# ^ClickNext\nJi bo berdewamê 'Bidomîne'yê bitikîne.\n# ^ClickInstall\nJi bo destpêka sazkirinê 'Saz Bike'yê bitikîne.\n# ^ClickUninstall\nJi bo destpêka rakirinê 'Rake' bitikîne.\n# ^Name\nnav\n# ^Completed\nQediya\n# ^LicenseText\nJi kerema xwe re berî tu bernameya $(^NameDA) saz bikî, çavekî li peymana lîsansê bigerîne. Heke tu hemû şertên peymanê dipejirînî, 'Ez Dipejirînim'ê bitikîne.\n# ^LicenseTextCB\nJi kerema xwe re berî tu bernameya $(^NameDA) saz bikî, çavekî li peymana lîsansê bigerîne. Heke tu hemû şertan dipejirînî, zeviya erêkirinê ya jêrîn dagire. $_CLICK\n# ^LicenseTextRB\nJi kerema xwe re berî tu bernameya $(^NameDA) saz bikî çavekî li peymana lîsansê bigerîne. Heke tu hemû şertên peymanê dipejirînî, zeviya vebijêrkê ya jêrîn dagire. $_CLICK\n# ^UnLicenseText\nJi kerema xwe re berî tu bernameya $(^NameDA) rakî, çavekî li peymana lîsansê bigerîne. Heke tu hemû şertên peymanê dipejirînî, 'Ez Dipejirînim'ê bitikîn.\n# ^UnLicenseTextCB\nJi kerema xwe re berî tu bernameya $(^NameDA) ji pergala xwe rakî, çavekî li peymana lîsansê bigerîne. Heke tu hemû şertên peymanê dipejirînî, zeviya jêrîn a erêkirinê dagire. $_CLICK\n# ^UnLicenseTextRB\nJi kerema xwe re berî tu bernameya $(^NameDA) ji pergala xwe rakî, çavekî li peymana lîsansê bigerîne. Heke tu hemû şertên peymanê dipejirînî, zeviya vebijêrkê ya jêrîn dagire. $_CLICK\n# ^Custom\nTaybet\n# ^ComponentsText\nBeşên tu dixwazî saz bikî hilbijêre û niqirên 'check' beşên tu naxwazî werin sazkirin rake. $_CLICK\n# ^ComponentsSubText1\nAwayê sazkirinê hilbijêre:\n# ^ComponentsSubText2_NoInstTypes\nBeşên dê werin sazkirin hilbijêre:\n# ^ComponentsSubText2\nan jî, beşên beşên tu dixwazî werin sazkirin hilbijêre:\n# ^UnComponentsText\nBeşên tu dixwazî rakî hilbijêre, an jî niqira 'check'a ber beşên tu daxwazî were rakirin, rake. $_CLICK\n# ^UnComponentsSubText1\nAwayê rakirinê hilbijêre:\n# ^UnComponentsSubText2_NoInstTypes\nBeşên dê werin rakirin hilbijêre:\n# ^UnComponentsSubText2\nan jî beşên tu dixwazî werin rakirin hilbijêre:\n# ^DirText\n$(^NameDA) dê ji aliyê sazkirinê ve li peldanka jêrîn were sazkirin. Ji bo tu li peldankeke din saz bikî 'Çavlêgerîn'ê bitikîne û peldankeke din hilbijêre. $_CLICK\n# ^DirSubText\nPeldanka Armanckirî\n# ^DirBrowseText\nPeldanka tu dixwazî bernameya $(^NameDA) lê were sazkirin hilbijêre:\n# ^UnDirText\n$(^NameDA) dê ji aliyê sazkirinê ve ji peldanka jêrîn were rakirin. Ji bo tu ji peldankeke cuda rakî 'Çavlêgerîn'ê bitikîne û peldankeke din hilbijêre. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nPeldanka tu dixwazî bernameya $(^NameDA) jê were rakirin hilbijêre:\n# ^SpaceAvailable\n\"Herêma vala ku dikare were bikaranîn: \"\n# ^SpaceRequired\n\"Herêma vala ya pêwist: \"\n# ^UninstallingText\nBernameya $(^NameDA) dê ji peldanka jêrîn were rakirin. $_CLICK\n# ^UninstallingSubText\ntê rakirin:\n# ^FileError\nDosya ji bo nivîsandinê venebû: \\r\\n\\t\"$0\"\\r\\nJi bo destjêberdana sazkirinê abort'ê bitikîne,\\r\\nji bo ceribandina ji nû ve  retry'ê , an jî\\r\\nji bo tu dosiyê tune bihesibînî û berdewam bikî ignore'yê bitikîne\n# ^FileError_NoIgnore\nDosya ji bo nivîsandinê vebenebû: \\r\\n\\t\"$0\"\\r\\nJi bo nivîsandina ji nû ve retry'yê, an jî\\r\\nJi bo destjêberdana sazkirinê abort'ê hilbijêre\n# ^CantWrite\n\"Nehate Nivîsandin: \"\n# ^CopyFailed\nÇewtiya Jibergirtinê\n# ^CopyTo\n\"Ji Ber Bigire \"\n# ^Registering\n\"Tê Tomarkirin: \"\n# ^Unregistering\n\"Tomarî Tê Jêbirin: \"\n# ^SymbolNotFound\n\"Dawêr Nehate Dîtin: \"\n# ^CouldNotLoad\n\"Nehate Barkirin: \"\n# ^CreateFolder\n\"Peldankê Çêke: \"\n# ^CreateShortcut\n\"Kineriyê Çêke: \"\n# ^CreatedUninstaller\n\"Sêrbazê Rakirinê Hate Çêkirin: \"\n# ^Delete\n\"Dosyayê Jê Bibe: \"\n# ^DeleteOnReboot\n\"Dema ji nû ve dest pê kir dosiyê jê bibe: \"\n# ^ErrorCreatingShortcut\n\"Dema çêkirina kineriyê çewtî derket: \"\n# ^ErrorCreating\n\"Çewtiya çêkirinê: \"\n# ^ErrorDecompressing\nDi dema vekirina daneyan de çewtî derket! Sazkirina Çewt?\n# ^ErrorRegistering\nÇewtiya tomariya DLL\n# ^ExecShell\n\"Qalikê Xebatê: \"\n# ^Exec\n\"Bixebitîne: \"\n# ^Extract\n\"Veke: \"\n# ^ErrorWriting\n\"Veke: Dema li dosiyê hate nivîsîn çewtiyek derket \"\n# ^InvalidOpcode\nSazkirina Xirabe: koda nerast pêkanînê\n# ^NoOLE\n\"OLE nehate dîtin: \"\n# ^OutputFolder\n\"Peldanka derketinê: \"\n# ^RemoveFolder\n\"Peldankê jê bibe: \"\n# ^RenameOnReboot\n\"Dema ji nû hate destpêkirin ji nû ve bi nav bike: \"\n# ^Rename\n\"Nav Biguhere: \"\n# ^Skipped\n\"Hate gavkirin: \"\n# ^CopyDetails\nHûragahiyan li Pano'yê binivîse\n# ^LogInstall\nPêkanîna sazkirinê li lênûska rewşê binivîse\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Kurdish.nsh",
    "content": "﻿;Language: Kurdish\n;By Rêzan Tovjîn\n;Updated by Erdal Ronahî (erdal.ronahi@gmail.com)\n\n!insertmacro LANGFILE \"Kurdish\" = \"Kurdî\" \"Kurdi\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) Tu bi xêr hatî sêrbaziya sazkirinê\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Ev sêrbaz dê di dema sazkirina $(^NameDA) de rêberiya te bike.$\\r$\\n$\\r$\\nBerî tu dest bi sazkirinê bikî, em pêşniyar dikin tu hemû bernameyên vekirî bigirî. Bi vî rengî beyî tu komputera ji nû ve vekî dê hinek dosiyên pergalê bêpirsgirêk werin sazkirin.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Tu bi xêr hatî sêrbaziya rakirina bernameya $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ev sêrbaz ji bo rakirina bernameya $(^NameDA) dê alîkariya te bike.$\\r$\\n$\\r$\\nBerî tu dest bi rakirina bernameyê bikî, bernameyên vekirî hemûyan bigire. Bi vî rengî dû re tu mecbûr namînî ku komputera xwe bigirî û ji nû ve veki.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Peymana Lîsansê\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Ji kerema xwe re berî tu bernameya $(^NameDA) saz bikî, peymana lîsansê bixwîne.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Heke tu şertên peymanê dipejirînî, 'Ez Dipejirînim'ê bitikîne. Ji bo sazkirina bernameya $(^NameDA) divê tu şertên peymanê bipejirînî.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Heke tu şertên peymanê dipejirînî, zeviya piştrastkirinê ya jêrîn dagire. Ji bo tu bikarî bernameya $(^NameDA) saz bikî divê tu şertên peymanê bipejirînî. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Heke tu şertên peymanê dipejirînî, bişkojka erêkirinê ya jêrîn bitikîne. Ji bo sazkirina bernameya $(^NameDA) divê tu şertên peymanê bipejirînî. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Peymana Lîsansê\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Berî tu bernameya $(^NameDA) ji pergala xwe rakî peymanê bixwîne.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Heke tu şertên peymanê dipejirînî, 'Dipejirînim'ê bitikîne. Ji bo rakirina bernameya  $(^NameDA) divê tu şertên peymanê bipejirînî.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Heke tu şertên peymanê dipejirînî, zeviya erêkirinê ya jêrîn dagire. Ji bo tu bernameya $(^NameDA) ji pergala xwe rakî divê tu peymanê bipejirînî. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Heke tu şertên peymanê dipejirînî, bişkojka erêkirinê ya jêrîn hilbijêre. Ji bo tu bernameya  $(^NameDA) ji pergala xwe rakî divê tu şertên peymanê bipejirînî. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Ji bo dûmahîka peymanê bişkojka 'page down' bitikîne.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Hilbijartina pareyan\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Ji bo sazkirina $(^NameDA) pareyên tu dixwazî hilbijêre.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Hilbijartina Pareyan\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Pareya bernameya $(^NameDA) ku tu dixwazî rakî hilbijêre.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Dazanîn\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Ji bo tu der barê pareyan de agahiyan bistînî nîşanekê bibe ser pareyekê.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Ji bo tu der barê pareyan de agahiyan bistînî pareyekê hilbijêre.\" \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Hilbijartina peldanka armanckirî\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Peldanka tu dixwazî bernameya $(^NameDA) tê de were sazkirin hilbijêre.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Hilbijartina Peldanka Dê Were Rakirin\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Peldanka bernameya $(^NameDA) ku tudixwazî rakî hilbijêre.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Tê sazkirin\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Ji kerema xwe re heta sazkirina $(^NameDA) biqede raweste.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Sazkirin Qediya\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Sazkirin bi serkeftinî qediya.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Sazkirin hate betalkirin\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Sazkirin be tevahî qediya.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Tê rakirin\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Heta bernameya $(^NameDA) ji pergala te were rakirin raweste.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Rakirina Bernameyê Biqedîne\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Rakirina bernameyê bi serkeftin pêk hat.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Rakirina bernameyê hate betalkirin\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Rakirina bernameyê neqediya.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Sêrbaziya sazkirina $(^NameDA) diqede.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) li komputera te hate barkirin.$\\r$\\n$\\r$\\n'Biqedîne'yê bitikîne û sazkirinê bi dawî bîne.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Ji bo bidawîkirina sazkirina $(^NameDA) divê tu komputerê ji nû ve vekî.Tu dixwazî komputerê ji nû ve vekî?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Sêrbaziya Rakirina Bernameya $(^NameDA) Tê Temamkirin\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Bernameya $(^NameDA) ji pergale hate rakirin.$\\r$\\n$\\r$\\nJi bo girtina sêrbaz 'biqedîne'yê bitikîne.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Ji bo rakirina bernameya $(^NameDA) biqede divê tu komputera xwe ji nû ve vekî. Tu dixwazî niha komputera te were girtin û ji nû ve dest pê bike?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Ji nû ve veke\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ezê paşê ji nû ve vekim.\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Bernameya $(^NameDA) bixebitîne\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Dosiya min bixwîne/readme &nîşan bide\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Biqedîne\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Hilbijartina Peldanka Pêşeka Destpêkê\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Peldanka pêşeka destpêkê ya ku dê kineriya $(^NameDA) tê de were bikaranîn hilbijêre.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Peldanka pêşeka destpêkê ya ku dê kineriya bernameyê tê de were bicihkirin hilbijêre.  Tu dikarî bi navekî nû peldankeke nû ava bikî.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Bêyî çêkirina kineriyê bidomîne\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Bernameya $(^NameDA) Rake\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Rakirina bernameya $(^NameDA) ji pergala te.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Tu bawer î ku dixwazî ji sazkirina $(^Name) derkevî?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Tu bawer î ku dixwazî dest ji rakirina bernameya $(^Name) berdî?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Latvian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1062\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1257\n# RTL - anything else than RTL means LTR\n-\n# Translation by Valdis Griķis (valmiera-9@inbox.lv)\n# Corrections by Kristaps Meņģelis / x-f (x-f 'AT' inbox.lv)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n'$(^Name)' Uzstādīšana\n# ^UninstallCaption\n'$(^Name)' Atinstalēšana\n# ^LicenseSubCaption\n: Licences līgums\n# ^ComponentsSubCaption\n: Uzstādīšanas opcijas\n# ^DirSubCaption\n: Uzstādīšanas mape\n# ^InstallingSubCaption\n: Notiek uzstādīšana\n# ^CompletedSubCaption\n: Uzstādīšana pabeigta.\n# ^UnComponentsSubCaption\n: Atinstalēšanas opcijas\n# ^UnDirSubCaption\n: Atinstalēšanas mape\n# ^ConfirmSubCaption\n: Apstiprināšana\n# ^UninstallingSubCaption\n: Notiek atinstalēšana\n# ^UnCompletedSubCaption\n: Atinstalēšana pabeigta\n# ^BackBtn\n< &Atpakaļ\n# ^NextBtn\n&Tālāk >\n# ^AgreeBtn\nEs &piekrītu\n# ^AcceptBtn\nEs &piekrītu licences līguma noteikumiem\n# ^DontAcceptBtn\nEs &nepiekrītu licences līguma noteikumiem\n# ^InstallBtn\n&Uzstādīt\n# ^UninstallBtn\n&Atinstalēt\n# ^CancelBtn\nAtcelt\n# ^CloseBtn\nAi&zvērt\n# ^BrowseBtn\nPā&rlūkot...\n# ^ShowDetailsBtn\nParādīt &detaļas\n# ^ClickNext\nSpiediet 'Tālāk', lai turpinātu.\n# ^ClickInstall\nSpiediet 'Uzstādīt', lai sāktu uzstādīšanas procesu.\n# ^ClickUninstall\nSpiediet 'Atinstalēt', lai sāktu atinstalēšanas procesu.\n# ^Name\nVārds\n# ^Completed\nUzstādīšana pabeigta\n# ^LicenseText\nLūdzu izlasiet licences līgumu pirms '$(^NameDA)' uzstādīšanas. Ja piekrītat licences līguma noteikumiem, tad spiediet 'Es piekrītu'.\n# ^LicenseTextCB\nLūdzu izlasiet licences līgumu pirms '$(^NameDA)' uzstādīšanas. Ja piekrītat licences līguma noteikumiem, tad atzīmējiet izvēles rūtiņu. $_CLICK\n# ^LicenseTextRB\nLūdzu izlasiet licences līgumu pirms '$(^NameDA)' uzstādīšanas. Ja piekrītat licences līguma noteikumiem, tad izvēlieties pirmo zemākesošo opciju. $_CLICK\n# ^UnLicenseText\nLūdzu izlasiet licences līgumu pirms '$(^NameDA)' atinstalēšanas. Ja piekrītat licences līguma noteikumiem, tad spiediet 'Es piekrītu'.\n# ^UnLicenseTextCB\nLūdzu izlasiet licences līgumu pirms '$(^NameDA)' atinstalēšanas. Ja piekrītat licences līguma noteikumiem, tad atzīmējiet izvēles rūtiņu. $_CLICK\n# ^UnLicenseTextRB\nLūdzu izlasiet licences līgumu pirms '$(^NameDA)' atinstalēšanas. Ja piekrītat licences līguma noteikumiem, tad izvēlieties zemākesošo opciju. $_CLICK\n# ^Custom\nPielāgots\n# ^ComponentsText\nIzvēlieties, kurus komponentus vēlaties uzstādīt un neiezīmējiet tos, kurus nevēlaties uzstādīt. $_CLICK\n# ^ComponentsSubText1\nIzvēlieties uzstādīšanas veidu:\n# ^ComponentsSubText2_NoInstTypes\nIzvēlieties uzstādāmos komponentus:\n# ^ComponentsSubText2\nVai arī – izvēlieties tikai nepieciešamos komponentus, kurus vēlaties uzstādīt:\n# ^UnComponentsText\nIzvēlieties, kurus komponentus atinstalēt un neiezīmējiet tos, kurus nevēlaties atinstalēt. $_CLICK\n# ^UnComponentsSubText1\nIzvēlieties atinstalēšanas veidu:\n# ^UnComponentsSubText2_NoInstTypes\nIzvēlieties atinstalējamos komponentus:\n# ^UnComponentsSubText2\nVai arī – izvēlieties tikai nepieciešamos komponentus, kurus vēlaties atinstalēt:\n# ^DirText\n'$(^NameDA)' tiks uzstādīta šajā mapē. Lai to uzstādītu citā mapē, nospiediet 'Pārlūkot' un izvēlieties citu mapi. $_CLICK\n# ^DirSubText\nUzstādīšanas mape\n# ^DirBrowseText\nIzvēlieties mapi, kurā uzstādīt '$(^NameDA)':\n# ^UnDirText\n'$(^NameDA)' tiks atinstalēta no šīs mapes. Lai to atinstalētu no citas mapes, nospiediet 'Pārlūkot' un izvēlieties citu mapi. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nIzvēlieties mapi, no kuras atinstalēt '$(^NameDA)':\n# ^SpaceAvailable\n\"Pieejamais diska apjoms: \"\n# ^SpaceRequired\n\"Nepieciešamais diska apjoms: \"\n# ^UninstallingText\n'$(^NameDA)' tiks atinstalēta no šīs mapes. $_CLICK\n# ^UninstallingSubText\nAtinstalēšana no:\n# ^FileError\nKļūda atverot failu rakstīšanai: \\r\\n\\t\"$0\"\\r\\nNospiediet 'Atcelt', lai atceltu uzstādīšanas procesu,\\r\\n'Mēģināt vēlreiz', lai atkārtoti mēģinātu rakstīt failā vai\\r\\n'Ignorēt', lai izlaistu šī faila uzstādīšanu\n# ^FileError_NoIgnore\nKļūda atverot failu rakstīšanai: \\r\\n\\t\"$0\"\\r\\nNospiediet 'Atcelt', lai pārtrauktu uzstādīšanas procesu\n# ^CantWrite\n\"Nevar ierakstīt: \"\n# ^CopyFailed\nKopēšana neizdevās\n# ^CopyTo\n\"Kopē uz \"\n# ^Registering\n\"Reģistrē: \"\n# ^Unregistering\n\"Atreģistrē: \"\n# ^SymbolNotFound\n\"Simbols nav atrasts: \"\n# ^CouldNotLoad\n\"Nav iespējams ielādēt: \"\n# ^CreateFolder\n\"Izveido mapi: \"\n# ^CreateShortcut\n\"Izveido saīsni: \"\n# ^CreatedUninstaller\n\"Izveidots atinstalētājs: \"\n# ^Delete\n\"Dzēš failu: \"\n# ^DeleteOnReboot\n\"Dzēst pēc pārstartēšanas: \"\n# ^ErrorCreatingShortcut\n\"Kļūda veidojot saīsni: \"\n# ^ErrorCreating\n\"Kļūda veidojot: \"\n# ^ErrorDecompressing\nKļūda atkompresējot datus! Bojāta instalācija?\n# ^ErrorRegistering\nKļūda reģistrējot DLL failu\n# ^ExecShell\n\"Izpilda čaulā: \"\n# ^Exec\n\"Izpilda: \"\n# ^Extract\n\"Atspiež: \"\n# ^ErrorWriting\n\"Atspiešana: kļūda rakstot failā \"\n# ^InvalidOpcode\nInstalācija bojāta: nederīgs CRC kods\n# ^NoOLE\n\"Nav OLE priekš: \"\n# ^OutputFolder\n\"Izvades mape: \"\n# ^RemoveFolder\n\"Dzēš mapi: \"\n# ^RenameOnReboot\n\"Pārsaukt pēc pārstartēšanas: \"\n# ^Rename\n\"Pārsaukt: \"\n# ^Skipped\n\"Izlaists: \"\n# ^CopyDetails\nIekopēt detaļas starpliktuvē\n# ^LogInstall\nIerakstīt žurnāla failā uzstādīšanas procesu\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Latvian.nsh",
    "content": "﻿;Language: Latviešu [Latvian] - (1062)\n;By Valdis Griķis\n;Corrections by Kristaps Meņģelis / x-f (x-f 'AT' inbox.lv)\n\n!insertmacro LANGFILE \"Latvian\" = \"Latviešu\" \"Latviesu\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Esiet sveicināti '$(^NameDA)' uzstādīšanas vednī\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Šis uzstādīšanas vednis jums palīdzēs veikt '$(^NameDA)' uzstādīšanu.$\\r$\\n$\\r$\\nĻoti ieteicams aizvērt citas programmas pirms šīs programmas uzstādīšanas veikšanas. Tas ļaus atjaunot svarīgus sistēmas failus bez datora pārstartēšanas.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Esiet sveicināti '$(^NameDA)' atinstalēšanas vednī\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Šis vednis jums palīdzēs veikt '$(^NameDA)' atinstalēšanu.$\\r$\\n$\\r$\\nPirms sākt atinstalēšanas procesu, pārliecinieties, vai '$(^NameDA)' pašlaik nedarbojas.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licences līgums\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Lūdzu izlasiet licences līgumu pirms '$(^NameDA)' uzstādīšanas.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ja piekrītat licences līguma noteikumiem, spiediet 'Piekrītu', lai turpinātu uzstādīšanu. Jums ir jāpiekrīt licences noteikumiem, lai uzstādītu '$(^NameDA)'.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ja piekrītat licences līguma noteikumiem, tad atzīmējiet izvēles rūtiņu. Jums ir jāpiekrīt licences noteikumiem, lai uzstādītu '$(^NameDA)'. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ja piekrītat licences līguma noteikumiem, tad izvēlieties pirmo zemākesošo opciju. Jums ir jāpiekrīt licences noteikumiem, lai uzstādītu '$(^NameDA)'. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licences līgums\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Lūdzu izlasiet licences līgumu pirms '$(^NameDA)' atinstalēšanas.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ja piekrītat licences noteikumiem, spiediet 'Piekrītu', lai turpinātu. Jums ir jāpiekrīt licences noteikumiem, lai atinstalētu '$(^NameDA)'.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ja piekrītat licences līguma noteikumiem, tad iezīmējiet izvēles rūtiņu. Jums ir jāpiekrīt licences noteikumiem, lai atinstalētu '$(^NameDA)'. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ja piekrītat licences līguma noteikumiem, tad izvēlieties pirmo zemākesošo opciju. Jums ir jāpiekrīt licences noteikumiem, lai atinstalētu '$(^NameDA)'. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Spiediet 'Page Down', lai aplūkotu visu līgumu.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Izvēlieties komponentus\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Izvēlieties nepieciešamās '$(^NameDA)' sastāvdaļas, kuras uzstādīt.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Izvēlieties komponentus\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Izvēlieties nepieciešamās '$(^NameDA)' sastāvdaļas, kuras atinstalēt.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Apraksts\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Novietojiet peles kursoru uz komponenta, lai tiktu parādīts tā apraksts.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Izvēlieties uzstādīšanas mapi\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Izvēlieties mapi, kurā uzstādīt '$(^NameDA)'.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Izvēlieties atinstalēšanas mapi\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Izvēlieties mapi, no kuras notiks '$(^NameDA)' atinstalēšana.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Notiek uzstādīšana\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Lūdzu uzgaidiet, kamēr notiek '$(^NameDA)' uzstādīšana.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Uzstādīšana pabeigta\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Uzstādīšana noritēja veiksmīgi.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Uzstādīšana atcelta\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Uzstādīšana nenoritēja veiksmīgi.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Notiek atinstalēšana\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Lūdzu uzgaidiet, kamēr '$(^NameDA)' tiek atinstalēta.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Atinstalēšana pabeigta\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Atinstalēšana noritēja veiksmīgi.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Atinstalēšana atcelta\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Atinstalēšana nenoritēja veiksmīgi.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Tiek pabeigta '$(^NameDA)' uzstādīšana\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"'$(^NameDA)' tika veiksmīgi uzstādīta jūsu datorā.$\\r$\\n$\\r$\\nNospiediet 'Pabeigt', lai aizvērtu vedni.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Jūsu datoru ir nepieciešams pārstartēt, lai pabeigtu '$(^NameDA)' uzstādīšanu. Vai vēlaties pārstartēt datoru tūlīt?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Tiek pabeigta '$(^NameDA)' atinstalācija\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"'$(^NameDA)' tika veiksmīgi izdzēsta no jūsu datora.$\\r$\\n$\\r$\\nNospiediet 'Pabeigt', lai aizvērtu vedni.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Jūsu datoru nepieciešams pārstartēt, lai pabeigtu '$(^NameDA)' atinstalēšanu. Vai vēlaties pārstartēt datoru tūlīt?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Pārstartēt tūlīt\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Es vēlos pārstartēt pats vēlāk\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"P&alaist '$(^NameDA)'\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Pa&rādīt LasiMani failu\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Pabeigt\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Izvēlieties 'Start Menu' folderi\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Izvēlieties 'Start Menu' mapi '$(^NameDA)' saīsnēm.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Izvēlieties 'Start Menu' mapi, kurā tiks izveidotas programmas saīsnes. Varat arī pats izveidot jaunu mapi.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Neveidot saīsnes\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"'$(^NameDA)' atinstalēšana\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Dzēst '$(^NameDA)' no jūsu datora.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Vai tiešām vēlaties pārtraukt '$(^Name)' uzstādīšanu?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Vai tiešām vēlaties pārtraukt '$(^Name)' atinstalēšanu?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Lithuanian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1063\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1257\n# RTL - anything else than RTL means LTR\n-\n# Translation by Vytautas Krivickas (Vytautas)\n# Updated by Danielius Scepanskis (Daan daniel@takas.lt) 2004.03.24\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Įdiegimas\n# ^UninstallCaption\n$(^Name) Šalinti\n# ^LicenseSubCaption\n: Naudojimo sutartis\n# ^ComponentsSubCaption\n: Įdiegimo nustatymai\n# ^DirSubCaption\n: Įdiegimo katalogas\n# ^InstallingSubCaption\n: Įdiegiama\n# ^CompletedSubCaption\n: Baigta\n# ^UnComponentsSubCaption\n: Ištrinimo nustatymai\n# ^UnDirSubCaption\n: Ištrinimo katalogas\n# ^ConfirmSubCaption\n: Patvirtinimas\n# ^UninstallingSubCaption\n: Panaikinama\n# ^UnCompletedSubCaption\n: Baigta\n# ^BackBtn\n< &Atgal\n# ^NextBtn\n&Toliau >\n# ^AgreeBtn\nAš &sutinku\n# ^AcceptBtn\nAš &sutinku su naudojimo sutarties sąlygomis\n# ^DontAcceptBtn\nAš &nesutinku su naudojimo sutarties sąlygomis\n# ^InstallBtn\n&Įdiegti\n# ^UninstallBtn\n&Panaikinti\n# ^CancelBtn\nNutraukti\n# ^CloseBtn\n&Uždaryti\n# ^BrowseBtn\nP&asirinkti...\n# ^ShowDetailsBtn\nParodyti &detales\n# ^ClickNext\nPaspauskite toliau\n# ^ClickInstall\nPaspauskite įdiegti\n# ^ClickUninstall\nPaspauskite ištrinti\n# ^Name\nVardas\n# ^Completed\nBaigta\n# ^LicenseText\nPrašome perskaityti sutartį prieš įdiegdami $(^NameDA). Jei jūs sutinkate su nurodytomis sąlygomis, spauskite Sutinku.\n# ^LicenseTextCB\nPrašome perskaityti sutartį prieš įdiegdami $(^NameDA). Jei jūs sutinkate su nurodytomis sąlygomis, padėkite varnelę tam skirtame laukelyje. $_CLICK\n# ^LicenseTextRB\nPrašome perskaityti sutartį prieš įdiegdami $(^NameDA). Jei jūs sutinkate su nurodytomis sąlygomis, pasirinkite pirmą pasirinkimą esantį žemiau. $_CLICK\n# ^UnLicenseText\nPrašome perskaityti sutartį prieš ištrinant $(^NameDA). Jei jūs sutinkate su nurodytomis sąlygomis, spauskite Sutinku.\n# ^UnLicenseTextCB\nPrašome perskaityti sutartį prieš ištrinant $(^NameDA). Jei jūs sutinkate su nurodytomis sąlygomis, padėkite varnelę tam skirtame laukelyje. $_CLICK\n# ^UnLicenseTextRB\nPrašome perskaityti sutartį prieš ištrinant $(^NameDA). Jei jūs sutinkate su nurodytomis sąlygomis, pasirinkite pirmą pasirinkimą esantį žemiau.  $_CLICK\n# ^Custom\nKitoks\n# ^ComponentsText\nPadėkite varneles laukeliuose komponentų kuriuos norite įdiegti ir nuimkite nuo kurių nenorite įdiegti. $_CLICK\n# ^ComponentsSubText1\nPasirinkite įdiegimo būdą:\n# ^ComponentsSubText2_NoInstTypes\nPasirinkite komponentus, kuriuos įdiegti:\n# ^ComponentsSubText2\nArba, pasirinkite neprivalomus komponentus, kuriuos jūs norite įdiegti:\n# ^UnComponentsText\nPadėkite varneles laukeliuose komponentų kuriuos norite pašalinti ir nuimkite nuo kurių nenorite pašalinti. $_CLICK\n# ^UnComponentsSubText1\nPasirinkite šalinimo būdą:\n# ^UnComponentsSubText2_NoInstTypes\nPasirinkite komponentus, kuriuos šalinti:\n# ^UnComponentsSubText2\nArba, pasirinkite neprivalomus komponentus, kuriuos jūs norite pašalinti:\n# ^DirText\nĮdiegimas dabar įdiegs $(^NameDA) šiame kataloge. Jeigu norite pakeisti šį katalogą, paspauskite Pasirinkti. $_CLICK\n# ^DirSubText\nĮdiegimo katalogas\n# ^DirBrowseText\nPasirinkite katalogą, kur įdiegti $(^NameDA):\n# ^UnDirText\nĮdiegimas dabar pašalins $(^NameDA) iš šio katalogo. Jeigu norite pakeisti šį katalogą paspauskite Pasirinkti. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nPasirinkite katalogą iš kurio pašalinti $(^NameDA):\n# ^SpaceAvailable\nYra vietos: \n# ^SpaceRequired\nReikia vietos: \n# ^UninstallingText\n$(^NameDA) dabar bus pašalintas iš šio katalogo. $_CLICK\n# ^UninstallingSubText\nTrinama iš:\n# ^FileError\nKlaida atidarant failą įrašymui: \\r\\n\\t\"$0\"\\r\\nPaspauskite Nutraukti, jei norite nutraukti įdiegimą,\\r\\nPakartoti, jei norite pabandyti dar kartą įrašyti failą, ar\\r\\nIgnoruoti, jei norite praleisti šį failą\n# ^FileError_NoIgnore\nKlaida atidarant failą įrašymui: \\r\\n\\t\"$0\"\\r\\nPaspauskite Pakartoti, jei norite pabandyti dar kartą įrašyti failą, ar\\r\\nNutraukti, jei norite nutraukti įdiegimą.\n# ^CantWrite\n\"Negalima įrašyti: \"\n# ^CopyFailed\nKopijavimas nepavyko\n# ^CopyTo\nKopijuoti į \n# ^Registering\n\"Užregistruojama: \"\n# ^Unregistering\n\"Išregistruojama: \"\n# ^SymbolNotFound\nNerastas simbolis: \n# ^CouldNotLoad\nNegaliu įkrauti: \n# ^CreateFolder\nSukurti katalogą: \n# ^CreateShortcut\nSukurti nuorodą: \n# ^CreatedUninstaller\nSukurti panaikinimo programą:\n# ^Delete\nIštrinti failą: \n# ^DeleteOnReboot\n\"Ištrinti perkraunant: \"\n# ^ErrorCreatingShortcut\n\"Klaida kuriant nuorodą: \"\n# ^ErrorCreating\n\"Klaida kuriant: \"\n# ^ErrorDecompressing\nKlaida išskleidžiant duomenis! Sugadintas įdiegimo failas?\n# ^ErrorRegistering\nKlaida užregistruojant DLL\n# ^ExecShell\n\"VykdytiShell: \"\n# ^Exec\n\"Vykdyti: \"\n# ^Extract\n\"Išskleisti: \"\n# ^ErrorWriting\nIšskleisti: klaida įrašant į failą\n# ^InvalidOpcode\nĮdiegimo failas sugadintas: neteisingas opkodas\n# ^NoOLE\n\"Nėra OLE dėl: \"\n# ^OutputFolder\n\"Paskirties katalogas: \"\n# ^RemoveFolder\n\"Panaikinti katalogą: \"\n# ^RenameOnReboot\n\"Pervardinti perkraunant: \"\n# ^Rename\n\"Pervardinti: \"\n# ^Skipped\n\"Praleista: \"\n# ^CopyDetails\nKopijuoti detales į atmintį\n# ^LogInstall\nĮrašyti įdiegimo detales\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Lithuanian.nsh",
    "content": "﻿;Language: Lithuanian (1063)\n;By Vytautas Krivickas (Vytautas). Updated by Danielius Scepanskis (Daan daniel@takas.lt) 2004.01.09\n\n!insertmacro LANGFILE \"Lithuanian\" = \"Lietuvių\" \"Lietuviu\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Sveiki atvykę į $(^NameDA) įdiegimo programą.\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Ši programa jums padės lengvai įdiegti $(^NameDA).$\\r$\\n$\\r$\\nRekomenduojama išjungti visas programas, prieš pradedant įdiegimą. Tai leis atnaujinti sistemos failus neperkraunat kompiuterio.$\\r$\\n$\\r$\\n\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Sveiki atvykę į $(^NameDA) pašalinimo programą.\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ši programa jums padės lengvai ištrinti $(^NameDA).$\\r$\\n$\\r$\\nPrieš pradedant pasitikrinkite kad $(^NameDA) yra išjungta.$\\r$\\n$\\r$\\n\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Naudojimo sutartis\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Prašome perskaityti sutartį prieš įdiegdami $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Jei jūs sutinkate su nurodytomis sąlygomis, spauskite Sutinku. Jūs privalote sutikti, jei norite įdiegti $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jei jūs sutinkate su nurodytomis sąlygomis, padėkite varnelę tam skirtame laukelyje. Jūs privalote sutikti, jei norite įdiegti $(^NameDA). \"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jei jūs sutinkate su nurodytomis sąlygomis, pasirinkite pirmą pasirinkimą esantį žemiau. Jūs privalote sutikti, jei norite įdiegti $(^NameDA). \"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Naudojimo sutartis\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Prašome perskaityti sutartį prieš $(^NameDA) pašalinimą.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Jei jūs sutinkate su nurodytomis sąlygomis, spauskite Sutinku. Jūs privalote sutikti, jei norite ištrinti $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"s, padėkite varnelę tam skirtame laukelyje. Jūs privalote sutikti, jei norite ištrinti $(^NameDA). \"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jei jūs sutinkate su nurodytomis sąlygomis, pasirinkite pirmą pasirinkimą esantį žemiau. Jūs privalote sutikti, jei norite ištrinti $(^NameDA).\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Paspauskite Page Down ir perskaitykite visą sutartį.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Pasirinkite\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Pasirinkite kokias $(^NameDA) galimybes jūs norite įdiegti.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Pasirinkite\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Pasirinkite kokias $(^NameDA) galimybes jūs norite pašalinti.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Paaiškinimas\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Užveskite pelės žymeklį ant komponento ir pamatysite jo aprašymą.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Pasirinkite komponentį ir pamatysite jo aprašymą.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Pasirinkite įdiegimo vietą\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Pasirinkite katalogą į kūri įdiegsite $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Pasirinkite ištrinimo vietą\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Pasirinkite katalogą iš kurio ištrinsite $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Diegiama\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Prašome palaukti, kol $(^NameDA) bus įdiegtas.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Įdiegimas baigtas\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Įdiegimas baigtas sekmingai.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Įdiegimas nutrauktas\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Įdiegimas nebuvo baigtas sekmingai.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Šalinama\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Prašome palaukti, kol $(^NameDA) bus pašalinta.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Programos pašalinimas baigtas\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Ištrynimas baigtas sekmingai.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Ištrynimas nutrauktas\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Ištrynimas nebuvo baigtas sekmingai.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Baigiu $(^NameDA) įdiegimo procesą\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) buvo įdiegtas į jūsų kompiuterį.$\\r$\\n$\\r$\\nPaspauskite Baigti.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Jūsų kompiuteris turi būti perkrautas, kad būtų baigtas $(^NameDA) įdiegimas. Ar jūs norite perkrauti dabar?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Baigiu $(^NameDA) pašalinimo programą.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) buvo ištrinta iš jūsų kompiuterio.$\\r$\\n$\\r$\\nPaspauskite Baigti.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Jūsų kompiuteris turi būti perkrautas, kad būtų baigtas $(^NameDA) pašalinimas. Ar jūs norite perkrauti dabar?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Perkrauti dabar\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Aš noriu perkrauti veliau pats\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Leisti $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Parodyti dokumentaciją\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Baigti\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Pasirinkite Start Menu katalogą\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Pasirinkite Start Menu katalogą, kuriame bus sukurtos programos nuorodos.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Pasirinkite Start Menu katalogą, kuriame bus sukurtos programos nuorodos. Jūs taip pat galite sukurti naują katalogą.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nekurti nuorodų\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Panaikinti $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Ištrinti $(^NameDA) iš jūsų kompiuterio.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ar jūs tikrai norite išjungti $(^Name) įdiegimo programą?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Ar jūs tikrai norite išjungti $(^Name) pašalinimo programą?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Luxembourgish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n4103\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Jo Hoeser\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Installatioun\n# ^UninstallCaption\n$(^Name) Desinstallatioun\n# ^LicenseSubCaption\n: Lizenzofkommes\n# ^ComponentsSubCaption\n: Installatiouns-Optiounen\n# ^DirSubCaption\n: Zielverzeechnis\n# ^InstallingSubCaption\n: Installéieren\n# ^CompletedSubCaption\n: Färdeg\n# ^UnComponentsSubCaption\n: Desinstallatiuons-Optiounen\n# ^UnDirSubCaption\n: Quellverzeechnes\n# ^ConfirmSubCaption\n: Bestätegung\n# ^UninstallingSubCaption\n: Läschen\n# ^UnCompletedSubCaption\n: Färdeg\n# ^BackBtn\n< &Zréck\n# ^NextBtn\n&Weider >\n# ^AgreeBtn\n&Unhuelen\n# ^AcceptBtn\nEch &huelen d'Lizenzofkommes un.\n# ^DontAcceptBtn\nEch &lehnen d'Lizenzofkommes of.\n# ^InstallBtn\n&Installéieren\n# ^UninstallBtn\n&Desinstalléieren\n# ^CancelBtn\nOfbriechen\n# ^CloseBtn\n&Zou maan\n# ^BrowseBtn\n&Duerchsichen...\n# ^ShowDetailsBtn\n&Details uweisen\n# ^ClickNext\nKlick op weider fir weiderzefueren\n# ^ClickInstall\nKlick op Installéieren, fir d'Installatioun unzefänken.\n# ^ClickUninstall\nKlick op Desinstalléieren, fir d'Desinstallatioun unzefänken.\n# ^Name\nNumm\n# ^Completed\nFärdeg\n# ^LicenseText\nW.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) installéiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, klick op Unhuelen.\n# ^LicenseTextCB\nW.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) installéiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, aktivéier d'Kontrollkeschtchen. $_CLICK\n# ^LicenseTextRB\nW.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) installéiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, wiel d'entsprichend Optioun. $_CLICK\n# ^UnLicenseText\nW.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) desinstalléiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, klick op Unhuelen.\n# ^UnLicenseTextCB\nW.e.g. d'Lizenzofkommes liesen, ierts de $(^NameDA) desinstalléiers. Wanns de all Bedengungen vum Ofkommes akzeptéiers, aktivéier d'Kontrollkeschtchen. $_CLICK\n# ^UnLicenseTextRB\nW.e.g. d'Lizenzoofkommes liesen, ierts de $(^NameDA) desinstalléiers. Wanns de all Bedengungen vum Oofkommes akzeptéiers, wiel d'entspriechend Optioun. $_CLICK\n# ^Custom\nBenutzerdefiniert\n# ^ComponentsText\nWiel d'Komponenten aus, déis de wëlls installéieren an wiel déijéineg of, déis de net installéieren wëlls. $_CLICK\n# ^ComponentsSubText1\nInstallatiouns-Typ bestëmmen:\n# ^ComponentsSubText2_NoInstTypes\nWiel d'Komponenten aus, déis de installéieren wëlls:\n# ^ComponentsSubText2\noder wiel zousätzlech Komponenten aus déis de installéieren wëlls:\n# ^UnComponentsText\nWiel d'Komponenten aus déis de desinstalléieren wëlls an wiel déijéineg of, déis de net desinstalléieren wëlls. $_CLICK\n# ^UnComponentsSubText1\nDeinstallatiouns-Typ bestëmmen:\n# ^UnComponentsSubText2_NoInstTypes\nWiel d'Komponenten aus, déis de desinstalléieren wëlls:\n# ^UnComponentsSubText2\noder wiel zusätzlech Komponenten aus, déis de desinstalléieren wëlls:\n# ^DirText\n$(^NameDA) gëtt an den Dossier installéiert deen fierginn gouf. Wanns de et an een aneren Dossier installéieren wëlls, klick op Duechsichen an wiel een aneren Dossier aus. $_CLICK\n# ^DirSubText\nZielverzeechnes\n# ^DirBrowseText\nWiel en Dossier aus wuers de $(^NameDA) installéieren wëlls:\n# ^UnDirText\n$(^NameDA) gëtt an deem Dossier desinstalléiert, deen uginn gouf. Wann $(^NameDA) an engem aneren Dossier ass, klick op Duechsichen an wiel een aneren Dossier aus. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nWiel den Dossier aus wou $(^NameDA) dran installéiert ass:\n# ^SpaceAvailable\n\"Verfügbaren Späicher: \"\n# ^SpaceRequired\n\"Gebrauchten Späicher: \"\n# ^UninstallingText\n$(^NameDA) gëtt aus dem ausgewielten Dossier desinstalléiert. $_CLICK\n# ^UninstallingSubText\nDesinstalléieren aus:\n# ^FileError\nFehler beim Iwwerschreiwen vun der Datei: \\r\\n\\t\"$0\"\\r\\nKlick op ofbriechen fir den Setup ze verloossen,\\r\\nop Widderhuelen fir den Setup nach eng Kéier duechzeféieren\\r\\n oder op Ignoréieren fir des Datei ze iwwersprengen an weiderzefueren.\n# ^FileError_NoIgnore\nFehler beim Iwwerschreiwen vun der Datei: \\r\\n\\t\"$0\"\\r\\nKlick op Widderhuelen fir den Setup nach eng Kéier duechzeféieren,\\r\\noder op ofbriechen fir den Setup ze verloossen.\n# ^CantWrite\n\"Fehler beim Schreiwen: \"\n# ^CopyFailed\nKopéieren fehlgeschloen\n# ^CopyTo\n\"Kopéiere an \"\n# ^Registering\n\"Registréieren: \"\n# ^Unregistering\n\"Deregistréieren: \"\n# ^SymbolNotFound\n\"Symbol ass net do: \"\n# ^CouldNotLoad\n\"Fehler beim Lueden vun: \"\n# ^CreateFolder\n\"Maan Dossier: \"\n# ^CreateShortcut\n\"Maan Oofkierzung: \"\n# ^CreatedUninstaller\n\"Man Desinstallatiouns-Programm: \"\n# ^Delete\n\"Läschen Datei: \"\n# ^DeleteOnReboot\n\"Läschen Datei no engem Neistart: \"\n# ^ErrorCreatingShortcut\n\"Fehler beim man vun enger Oofkierzung: \"\n# ^ErrorCreating\n\"Fehler beim maan: \"\n# ^ErrorDecompressing\nFehler beim Dekompriméieren. Installations-Programm beschiedegt?\n# ^ErrorRegistering\nFehler beim Registréieren vun der DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Starten: \"\n# ^Extract\n\"Dekompriméieren: \"\n# ^ErrorWriting\n\"Dekompriméierung: Fehler beim Schreiwen vun der Datei \"\n# ^InvalidOpcode\nInstallations-Programm Beschiedegt: net zoulässegen Befehlscode\n# ^NoOLE\n\"Keen OLE fier: \"\n# ^OutputFolder\n\"Zieldossier: \"\n# ^RemoveFolder\n\"Läschen Dossier: \"\n# ^RenameOnReboot\n\"Gett no Neistart embenannt: \"\n# ^Rename\n\"Embenennen: \"\n# ^Skipped\n\"Iwwersprongen: \"\n# ^CopyDetails\nDetailler an d'Zwëschenooflag kopéieren\n# ^LogInstall\nInstallatioun protokolléieren\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Luxembourgish.nsh",
    "content": "﻿;Language: Luxembourgish (1031)\n;By Snowloard, changes by Philo\n\n!insertmacro LANGFILE \"Luxembourgish\" = \"Lëtzebuergesch\" \"Letzebuergesch\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Wëllkomm beim Installatiouns-$\\r$\\nAssistent vun $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Dësen Assistent wärt dech duech d'Installatioun vun $(^NameDA) begleeden.$\\r$\\n$\\r$\\nEt gëtt ugeroden alleguer d'Programmer di am Moment lafen zouzemaan, datt bestëmmt Systemdateien ouni Neistart ersat kënne ginn.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Wëllkomm am Desinstallatiouns-$\\r$\\n\\Assistent fir $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Desen Assistent begleet dech duech d'Desinstallatioun vun $(^NameDA).$\\r$\\n$\\r$\\nW.e.g. maach $(^NameDA) zu, ierts de mat der Desinstallatioun ufänks.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lizenzofkommes\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"W.e.g. d'Lizenzoofkommes liesen, ierts de mat der Installatioun weiderfiers.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Wanns de alleguer d'Bedengungen vum Ofkommes akzeptéiers, klick op Unhuelen. Du muss alleguer d'Fuerderungen unerkennen, fir $(^NameDA) installéieren ze kënnen.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Wanns de alleguer d'Bedengungen vum Ofkommes akzeptéiers, aktivéier d'Këschtchen. Du muss alleguer d'Fuerderungen unerkennen, fir $(^NameDA) installéieren ze kënnen. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Wanns de alleguer d'Bedengungen vum Ofkommes akzeptéiers, wiel ënnen di entspriechend Äntwert aus. Du muss alleguer d'Fuerderungen unerkennen, fir $(^NameDA) installéieren ze kënnen. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lizenzofkommes\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"W.e.g. lies d'Lizenzofkommes duech ierts de mat der Desinstallatioun vun $(^NameDA) weiderfiers.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Wanns de d'Fuerderungen vum Ofkommes akzeptéiers, klick op unhuelen. Du muss d'Ofkommes akzeptéieren, fir $(^NameDA) kënnen ze desinstalléieren.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Wanns de d'Fuerderungen vum Ofkommes akzeptéiers, aktivéier d'Këschtchen. Du muss d'Ofkommes akzeptéieren, fir $(^NameDA) kënnen ze desinstalléieren. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Wanns de d'Fuerderungen vum Ofkommes akzeptéiers, wiel ënnen di entspriechend Optioun. Du muss d'Oofkommes akzeptéieren, fir $(^NameDA) kennen ze desinstalléieren. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Dréck d'PageDown-Tast fir den Rescht vum Ofkommes ze liesen.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Komponenten auswielen\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Wiel d'Komponenten aus, déis de wëlls installéieren.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Komponenten auswielen\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Wiel eng Komponent aus, déis de desinstalléieren wëlls.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beschreiwung\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Hal den Mausfeil iwwer eng Komponent, fir d'Beschreiwung dervun ze gesinn.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Zielverzeechnes auswielen\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Wiel den Dossier aus, an deen $(^NameDA) installéiert soll ginn.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Dossier fir d'Desinstallatioun wielen\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Wiel den Dossier aus, aus dem $(^NameDA) desinstalléiert soll ginn.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installéieren...\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Waard w.e.g während deem $(^NameDA) installéiert gëtt.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installatioun färdeg\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"D'Installatioun ass feelerfräi oofgeschloss ginn.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installatioun ofgebrach\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"D'Installatioun ass net komplett ofgeschloss ginn.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Desinstalléieren...\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"W.e.g. waard, während deems $(^NameDA) desinstalléiert gëtt.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Desinstallatioun ofgeschloss\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"D'Desinstallatioun ass erfollegräich ofgeschloss ginn.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Desinstallatioun oofbriechen\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Desinstallatioun ass net erfollegräich ofgeschloss ginn.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"D'Installatioun vun $(^NameDA) gëtt ofgeschloss.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) ass um Computer installéiert ginn.$\\r$\\n$\\r$\\nKlick op färdeg maan, fir den Installatiouns-Assistent zou ze maan..\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Den Windows muss nei gestart ginn, fir d'Installatioun vun $(^NameDA) ofzeschléissen. Wëlls de Windows lo néi starten?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Desinstallatioun vun $(^NameDA) gëtt ofgeschloss\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) ass vum Computer desinstalléiert ginn.$\\r$\\n$\\r$\\nKlick op Ofschléissen fir den Assistent zou ze maan.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Windows muss néi gestart gin, fir d'Desinstallatioun vun $(^NameDA) ze vervollstännegen. Wëlls de Windows lo néi starten?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Lo néi starten\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Spéider manuell néi starten\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) op maan\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Liesmech op maan\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Färdeg man\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Startmenü-Dossier bestëmmen\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Bestëmm een Startmanü-Dossier an deen d'Programmofkierzungen kommen.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Bestëmm een Startmanü-Dossier an deen d'Programmofkierzungen kommen. Wanns de een néien Dossier man wells, gëff deem säin zukünftegen Numm an.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Keng Ofkierzungen man\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstallatioun vun $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) gett vum Computer desinstalléiert.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Bass de sécher, dass de d'Installatioun vun $(^Name) ofbriechen wëlls?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Bass de sécher, dass de d'Desinstallatioun vun $(^Name) ofbriechen wëlls?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Macedonian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1071\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by Sasko Zdravkin [wingman2083@yahoo.com]\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nИнсталирање на $(^Name)\n# ^UninstallCaption\nДеинсталирање на $(^Name)\n# ^LicenseSubCaption\n: Лиценцен Договор\n# ^ComponentsSubCaption\n: Инсталациони Опции\n# ^DirSubCaption\n: Инсталационен Директориум\n# ^InstallingSubCaption\n: Инсталира\n# ^CompletedSubCaption\n: Завршено\n# ^UnComponentsSubCaption\n: Деинсталациони Опции\n# ^UnDirSubCaption\n: Деинсталационен Директориум\n# ^ConfirmSubCaption\n: Потврда\n# ^UninstallingSubCaption\n: Деинсталира\n# ^UnCompletedSubCaption\n: Завршено\n# ^BackBtn\n< &Назад\n# ^NextBtn\nН&апред >\n# ^AgreeBtn\n&Да\n# ^AcceptBtn\n&Ги прифаќам условите од Лиценцниот Договор\n# ^DontAcceptBtn\nН&е ги прифаќам условите од Лиценцниот Договор\n# ^InstallBtn\n&Инсталирај\n# ^UninstallBtn\n&Деинсталирај\n# ^CancelBtn\nОткажи\n# ^CloseBtn\n&Затвори\n# ^BrowseBtn\n&Пребарувај...\n# ^ShowDetailsBtn\nП&окажи Детали\n# ^ClickNext\nПритиснете 'Напред' за да продолжите.\n# ^ClickInstall\nПритиснете 'Инсталирај' за да се инсталира.\n# ^ClickUninstall\nПритиснете 'Деинсталирај' за да се деинсталира.\n# ^Name\nИме\n# ^Completed\nЗавршено\n# ^LicenseText\nВе молиме прочитајте го Лиценцниот Договор пред да се инсталира $(^NameDA). Ако ги прифаќате сите услови, притиснете 'Да'.\n# ^LicenseTextCB\nВе молиме прочитајте го Лиценцниот Договор пред да се инсталира $(^NameDA). Ако ги прифаќате сите услови, притиснете го Check box-от подоле. $_CLICK\n# ^LicenseTextRB\nВе молиме прочитајте го Лиценцниот Договор пред да се инсталира $(^NameDA). Ако ги прифаќате сите услови, одберете ја првата опција подоле. $_CLICK\n# ^UnLicenseText\nВе молиме прочитајте го Лиценцниот Договор пред да се деинсталира $(^NameDA). Ако ги прифаќате сите услови, притиснете 'Да'.\n# ^UnLicenseTextCB\nВе молиме прочитајте го Лиценцниот Договор пред да се деинсталира $(^NameDA). Ако ги прифаќате сите услови, притиснете го Check box-от подоле. $_CLICK\n# ^UnLicenseTextRB\nВе молиме прочитајте го Лиценцниот Договор пред да се деинсталира $(^NameDA). Ако ги прифаќате сите услови, одберете ја првата опција подоле. $_CLICK\n# ^Custom\nПодесено\n# ^ComponentsText\nЧекирајте ги компонентите што сакате да се инсталираат или дечекирајте ги тие што не сакате да се инсталираат. $_CLICK \n# ^ComponentsSubText1\nОдберете вид на инсталација:\n# ^ComponentsSubText2_NoInstTypes\nОдберете ги компонентите што ќе се инсталираат:\n# ^ComponentsSubText2\nили, одберете други компоненти што сакате да се инсталираат:\n# ^UnComponentsText\nЧекирајте ги компонентите што сакате да се деинсталираат или дечекирајте ги тие што не сакате да се деинсталираат. $_CLICK\n# ^UnComponentsSubText1\nОдберете го видот на деинсталацијата:\n# ^UnComponentsSubText2_NoInstTypes\nОдберете ги компонентите што ќе се деинсталираат:\n# ^UnComponentsSubText2\nили, одберете други компоненти што сакате да се деинсталираат:\n# ^DirText\nИнсталациониот програм ќе го инсталира $(^NameDA) во следниов директориум. За да инсталирате во друг, притиснете 'Пребарувај' и одберете друг директориум. $_CLICK\n# ^DirSubText\nДиректориум каде што ќе се инсталира\n# ^DirBrowseText\nОдберете директориум за инсталирање на $(^NameDA):\n# ^UnDirText\nИнсталациониот програм ќе го деинсталира $(^NameDA) од следниов директориум. За да деинсталирате од друг, притиснете 'Пребарувај' и одберете друг директориум. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nОдберете го директориумот за деинсталирање на $(^NameDA):\n# ^SpaceAvailable\n\"Слободен простор: \"\n# ^SpaceRequired\n\"Потребен простор: \"\n# ^UninstallingText\n$(^NameDA) ќе биде деинсталиран од следниов директориум. $_CLICK\n# ^UninstallingSubText\nДеинсталира од:\n# ^FileError\nГрешка при отварањето на датотеката за запишување: \\r\\n\\t\"$0\"\\r\\nПритиснете 'Откажи' за да ја откажете инсталацијата,\\r\\n'Пробај' за да проба да ја запише датотеката, или\\r\\n'Игнорирај' за да ја прерипа датотеката\n# ^FileError_NoIgnore\nГрешка при отварањето на датотеката за запишување: \\r\\n\\t\"$0\"\\r\\nПритиснете 'Пробај' за да проба да ја запише датотеката, или\\r\\n'Откажи' за да ја откаже инсталацијата\n# ^CantWrite\n\"Не може да запише: \"\n# ^CopyFailed\nКопирањето не успеа\n# ^CopyTo\n\"Копирај до \"\n# ^Registering\n\"Регистрира: \"\n# ^Unregistering\n\"Дерегистрира: \"\n# ^SymbolNotFound\n\"Не може да го најде симболот: \"\n# ^CouldNotLoad\n\"Не може да лоадира: \"\n# ^CreateFolder\n\"Создади директориум: \"\n# ^CreateShortcut\n\"Создади кратеница: \"\n# ^CreatedUninstaller\n\"Создаден деинсталатор: \"\n# ^Delete\n\"Избришана датотека: \"\n# ^DeleteOnReboot\n\"Избриши после рестартирање: \"\n# ^ErrorCreatingShortcut\n\"Грешка при создавањето на скратеницата: \"\n# ^ErrorCreating\n\"Грешка при создавањето: \"\n# ^ErrorDecompressing\nГрешка при отпакувањето на податоците! Расипан инсталационен програм?\n# ^ErrorRegistering\nГрешка при регистрирањето на DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Покрени: \"\n# ^Extract\n\"Отпакувано: \"\n# ^ErrorWriting\n\"Отпакувај: грешка при снимањето во датотеката \"\n# ^InvalidOpcode\nРасипан инсталационен програм: погрешен код\n# ^NoOLE\n\"Нема OLE за: \"\n# ^OutputFolder\n\"Инсталационен директориум: \"\n# ^RemoveFolder\n\"Избришан директориум: \"\n# ^RenameOnReboot\n\"Преименувај после рестартирање: \"\n# ^Rename\n\"Преименувај: \"\n# ^Skipped\n\"Прерипано: \"\n# ^CopyDetails\nКопирај ги Деталите во Clipboard-от\n# ^LogInstall\nСними лог за инсталационите процеси\n# ^Byte\nб\n# ^Kilo\n К\n# ^Mega\n М\n# ^Giga\n Г\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Macedonian.nsh",
    "content": "﻿;Language: Macedonian (1071)\n;By Sasko Zdravkin [wingman2083@yahoo.com]\n\n!insertmacro LANGFILE \"Macedonian\" = \"Македонски\" \"Makedonski\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Добро дојдовте во инсталацијата на $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Овој програм ќе ве води низ инсталацијата на $(^NameDA).$\\r$\\n$\\r$\\nПрепорачано е да ги затворите сите програми пред да инсталирате. Ова ќе дозволи инсталациониот програм да обнови некои системски датотеки без да го рестартира компјутерот.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Добро дојдовте во деинсталацијата на $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Овој програм ќе ве води низ деинсталацијата на $(^NameDA).$\\r$\\n$\\r$\\nПред да ја почнете деинсталацијата на $(^NameDA) проверете дали е исклучена програмата.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Лиценцен Договор\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Ве молиме проверете ги лиценцните услови пред да го инсталирате $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ако ги прифаќате условите од договорот, притиснете 'Да' за да продолжите. Мора да го прифатите договорот за да го инсталирате $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ако ги прифаќате условите од договорот, чекирајте го check box-от подоле. Мора да го прифатите договорот за го инсталирате $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ако ги прифаќате условите од договорот, одберете ја првата опција подоле. Мора да го прифатите договорот за го инсталирате $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Лиценцен Договор\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Ве молиме проверете ги лиценцните услови пред да го деинсталирате $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ако ги прифаќате условите од договорот, притиснете 'Да' за да продолжите. Мора да го прифатите договорот за да го деинсталирате $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ако ги прифаќате условите од договорот, чекирајте го check box-от подоле. Мора да го прифатите договорот за го деинсталирате $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ако ги прифаќате условите од договорот, одберете ја првата опција подоле. Мора да го прифатите договорот за го деинсталирате $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Притиснете 'Page Down' за да го видете останатиот дел од договорот.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Одберете Компоненти\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Одберете кои работи од $(^NameDA) сакате да се инсталираат.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Одберете Компоненти\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Одберете кои работи од $(^NameDA) сакате да се деинсталираат.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Објаснение\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Однесете го курсорот до компонентата за да го видете нејзиното објаснение.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Одберете ја компонентата за да го видете нејзиното објаснение.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Одберете ја локацијата за инсталирање\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Одберете го директориумот каде што сакате да се инсталира $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Одберете ја локацијата за деинсталирање\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Одберете го директориумот од кој сакате да се деинсталира $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Инсталира\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Ве молиме почекајте додека $(^NameDA) се инсталира.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Инсталацијата е завршена\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Инсталирањето беше успешно.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Инсталацијата е откажана\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Инсталирањето не беше успешно завршено.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Деинсталира\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Ве молиме почекајте додека $(^NameDA) се деинсталира.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Деинсталацијата е завршена\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Деинсталирањето беше успешно.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Деинсталацијата е откажана\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Деинсталирањето не беше успешно завршено.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Завршува инсталирањето на $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) е инсталиран на вашиот компјутер.$\\r$\\n$\\r$\\nПритиснете 'Крај' за да го затворите инсталациониот програм.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Вашиот компјутер мора да се рестартира за да заврши инсталацијата на $(^NameDA). Дали сакате да се рестартира сега?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Завршува деинсталирањето на $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) е деинсталиран од вашиот компјутер.$\\r$\\n$\\r$\\nПритиснете 'Крај' за да го затворите деинсталациониот програм.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Вашиот компјутер мора да се рестартира за да заврши деинсталацијата на $(^NameDA). Дали сакате да се рестартира сега?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Рестартирај сега\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Ако сакате да го рестартирате подоцна\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Пок&рени го $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Отвор&и 'Прочитај Ме'\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Крај\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Одберете директориум за Старт Менито\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Одберете директориум во Старт Менито за креирање скратеница на $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Одберете го директориумот во Старт Менито во кој сакате да се креира скратеница за програмата. Исто така можете да внесете друго име за да се креира нов директориум.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Не креирај скратеница\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Деинсталирај го $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Одстранете го $(^NameDA) од вашиот компјутер.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Сигурни ли сте дека сакате да се откажете од инсталацијата на $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Сигурни ли сте дека сакате да се откажете од деинсталацијата на $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Malay.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1086\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation muhammadazwa@yahoo.com\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nSetup $(^Name)\n# ^UninstallCaption\nUninstall $(^Name)\n# ^LicenseSubCaption\n: Perlesenan\n# ^ComponentsSubCaption\n: Pilihan kemasukan\n# ^DirSubCaption\n: Folder kemasukan\n# ^InstallingSubCaption\n: Memasang\n# ^CompletedSubCaption\n: Selesai\n# ^UnComponentsSubCaption\n: Pilihan membuang\n# ^UnDirSubCaption\n: Folder Uninstal\n# ^ConfirmSubCaption\n: Kepastian\n# ^UninstallingSubCaption\n: Membuang\n# ^UnCompletedSubCaption\n: Tidak Selesai\n# ^BackBtn\n< &Ke Belakang\n# ^NextBtn\n&Ke Depan >\n# ^AgreeBtn\nSaya &setuju\n# ^AcceptBtn\nSaya s&etuju dengan Perlesenan\n# ^DontAcceptBtn\nSaya &tidak setuju dengan Perlesenan\n# ^InstallBtn\n&Masukkan\n# ^UninstallBtn\n&Buang\n# ^CancelBtn\nBatal\n# ^CloseBtn\n&Tutup\n# ^BrowseBtn\nS&elusur...\n# ^ShowDetailsBtn\nBuka &lagi\n# ^ClickNext\nKlik Ke Depan untuk teruskan.\n# ^ClickInstall\nKlik Masukkan untuk kemasukkan.\n# ^ClickUninstall\nKlik Uninstall untuk membuang.\n# ^Name\nNama\n# ^Completed\nSelesai\n# ^LicenseText\nSila baca lesen sebelum memasukkan $(^NameDA). Jika anda terima perlesenan, klik Saya setuju.\n# ^LicenseTextCB\nSila baca lesen sebelum memasukkan $(^NameDA). Jika terima, beri tanda dicheckbox. $_CLICK\n# ^LicenseTextRB\nSila baca lesen sebelum sebelum membuang $(^NameDA). Jika anda terima perlesenan, pilihlah salah satu item dibawah ini. $_CLICK\n# ^UnLicenseText\nSila baca lesen sebelum sebelum membuang $(^NameDA). Jika anda terima perlesenan, klik Saya setuju.\n# ^UnLicenseTextCB\nSila baca lesen sebelum memasukkan $(^NameDA). Jika terima, beri tanda dicheckbox. $_CLICK\n# ^UnLicenseTextRB\nSila baca lesen sebelum sebelum membuang $(^NameDA).Jika anda terima perlesenan, pilihlah salah satu item dibawah ini. $_CLICK\n# ^Custom\nCustom\n# ^ComponentsText\nBeri tanda dicheckbox pada komponen yang ingin dimasukkan and hilangkan tanda pada komponen yang tidak perlu dimasukkan. $_CLICK\n# ^ComponentsSubText1\nPilih kemasukan:\n# ^ComponentsSubText2_NoInstTypes\nPilih komponen-komponen untuk dimasukkan:\n# ^ComponentsSubText2\nAtau, pilih komponen berikut untuk dimasukkan:\n# ^UnComponentsText\nBeri tanda dicheckbox pada komponen yang ingin dimasukkan and hilangkan tanda pada komponen yang tidak perlu dimasukkan. $_CLICK\n# ^UnComponentsSubText1\nPilih tipe un-kemasukan:\n# ^UnComponentsSubText2_NoInstTypes\nPilih komponen-komponen untuk di buang:\n# ^UnComponentsSubText2\nAtau, pilih komponen berikut untuk di buang:\n# ^DirText\nSetup akan memasukkan $(^NameDA) pada folder berikut. Untuk memilih folder lainnya, klik Selusur dan pilih folder pilihan anda. $_CLICK\n# ^DirSubText\nFolder tujuan\n# ^DirBrowseText\nPilih folder untuk memasukkan $(^NameDA):\n# ^UnDirText\nSetup akan membuang $(^NameDA) dari folder berikut. Untuk memilih folder lainnya, klik Selusur dan pilih folder pilihan anda. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nPilih folder untuk dibuang $(^NameDA):\n# ^SpaceAvailable\n\"Ruang cakera keras yang ada: \"\n# ^SpaceRequired\n\"Ruang cakera keras yang diperlukan: \"\n# ^UninstallingText\n$(^NameDA) akan buang dari folder berikut. $_CLICK\n# ^UninstallingSubText\nMembuang:\n# ^FileError\nTidak dapat menulis pada fail: \\r\\n\\t\"$0\"\\r\\nKlik abort untuk membatalkan kemasukan,\\r\\nretry untuk cuba lagi, atau\\r\\nignore untuk abaikan fail ini.\n# ^FileError_NoIgnore\nTidak dapat menulis pada fail: \\r\\n\\t\"$0\"\\r\\nKlik retry untuk cuba lagi, atau\\r\\ncancel untuk batalkan kemasukan\n# ^CantWrite\n\"Gagal menulis pada: \"\n# ^CopyFailed\nGagal menyalin\n# ^CopyTo\n\"Menyalin ke \"\n# ^Registering\n\"Mendaftarkan modul: \"\n# ^Unregistering\n\"Melepaskan modul: \"\n# ^SymbolNotFound\n\"Symbol tidak jumpa : \"\n# ^CouldNotLoad\n\"Tidak dapat membuka: \"\n# ^CreateFolder\n\"Membuat folder: \"\n# ^CreateShortcut\n\"Membuat pintasan: \"\n# ^CreatedUninstaller\n\"Membuat program unistall: \"\n# ^Delete\n\"Memadam fail: \"\n# ^DeleteOnReboot\n\"Akan dipadam ketika reboot: \"\n# ^ErrorCreatingShortcut\n\"Tidak dapat membuat pintasan: \"\n# ^ErrorCreating\n\"Ralat penciptaan: \"\n# ^ErrorDecompressing\nRalat ketika membuka data! Program Installer rosak\n# ^ErrorRegistering\nRalat mendaftarkan modul DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Menjalankan: \"\n# ^Extract\n\"Mengekstrak: \"\n# ^ErrorWriting\n\"Ekstrak: ralat ketika menulis ke fail \"\n# ^InvalidOpcode\nInstaller rosak: opcode tidak lengkap\n# ^NoOLE\n\"OLE tidak ditemukan: \"\n# ^OutputFolder\n\"Folder tujuan: \"\n# ^RemoveFolder\n\"Menghapuskan folder: \"\n# ^RenameOnReboot\n\"Menamakan semula pada reboot: \"\n# ^Rename\n\"Menamakan semula: \"\n# ^Skipped\n\"Diabaikan: \"\n# ^CopyDetails\nSalin terperinci ke clipboard\n# ^LogInstall\nCatat proses kemasukan\n# ^Byte\nBait\n# ^Kilo\n Kilo\n# ^Mega\n Mega\n# ^Giga\n Giga\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Malay.nsh",
    "content": "﻿;Language: Malay (1086)\n;By muhammadazwa@yahoo.com\n\n!insertmacro LANGFILE \"Malay\" = \"Bahasa Melayu\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Assalamualaikum, Selamat datang ke $(^NameDA) Setup Wizard\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Setup Wizard akan membantu anda untuk memasukkan $(^NameDA).$\\r$\\n$\\r$\\nSila tutup program aplikasi yang lain sebelum Setup ini dimulakan. Ini supaya tiada proses reboot komputer diperlukan.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Selamat datang ke $(^NameDA) Uninstall Wizard\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Uninstall Wizard akan membantu anda pada proses membuang $(^NameDA).$\\r$\\n$\\r$\\nSebelum membuang, pastikan dulu $(^NameDA) dimatikan.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Perlesenan\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Sila baca teks lesen berikut sebelum memasukkan $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Jika anda bersetuju, klik Saya setuju untuk teruskan. Anda mesti setuju untuk sebelum aplikasi dapat dimasukkan $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jika anda bersetuju dengan syarat-syarat lesen, sila tanda dicheckbox. Anda mesti setuju sebelum memasukkan $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jika anda terima semua yang ada di lesen, pilihlah salah satu item dibawah ini. Anda mesti setuju sebelum memasukkan $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Tentang Lesen\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Sila baca teks lesen sebelum membuang $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Jika anda menerima lesen, klik Saya setuju untuk teruskan. Anda mesti setuju untuk dapat membuang $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jika anda menerima semua yang ada di lesen, beri tanda dicheckbox. Anda mesti setuju untuk dapat membuang $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jika anda menerima semua yang ada di lesen, pilihlah salah satu item dibawah ini. Anda mesti setuju untuk dapat membuang $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Tekan Page Down untuk melihat teks selebihnya.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Pilih Komponen\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Pilih fungsi-fungsi dari $(^NameDA) yang ingin dimasukkan.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Pilih Komponen\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Pilih fungsi-fungsi $(^NameDA) yang ingin dibuang.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Penerangan\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Alihkan tetikus ke komponen untuk mengetahui penerangannya.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Pilih komponen untuk mengetahui penerangannya.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Pilih Lokasi Kemasukan\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Pilih folder untuk memasukkan $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Pilih Lokasi Uninstall\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Pilih folder untuk meng-uninstall $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Pemasangan\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Sila tunggu ketika $(^NameDA) sedang dimasukkan.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Proses Selesai\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Setup sudah selesai.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Proses Dibatalkan\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Setup terbatal.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Uninstall\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Sila tunggu ketika $(^NameDA) sedang di-buang.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Proses Uninstall Selesai\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Uninstall sudah selesai.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Proses Uninstall Dibatalkan\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Uninstall belum selesai secara sempurna.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Menyelesaikan $(^NameDA) Setup Wizard\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) sudah dimasukkan di komputer anda.$\\r$\\n$\\r$\\nKlik Selesai untuk menutup Setup Wizard.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Komputer anda harus direboot untuk menyelesaikan proses memasukkan $(^NameDA). Apakah anda hendak reboot sekarang juga?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Menyelesaikan $(^NameDA) Uninstall Wizard\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) sudah dibuang dari komputer anda.$\\r$\\n$\\r$\\nKlik Selesai untuk menutup Setup Wizard.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Komputer anda harus di reboot untuk menyelesaikan proses membuang $(^NameDA). Reboot sekarang?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reboot sekarang\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Reboot nanti\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Jalankan $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Buka fail Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Selesai\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Pilih Folder Start Menu\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Pilih folder Start Menu untuk meletakkan pintasan $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Pilih folder Start Menu untuk perletakkan pintasan aplikasi ini. Boleh cipta nama folder anda sendiri.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Tidak perlu pintasan\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Buang $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Padam $(^NameDA) dari komputer anda.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Adakan anda yakin ingin membatalkan Setup $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Adakan anda yakin ingin membatalkan proses buang $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Mongolian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1104\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by Bayarsaikhan Enkhtaivan. ebayaraa@gmail.com\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Суулгац\n# ^UninstallCaption\n$(^Name) Суулгасныг устгах\n# ^LicenseSubCaption\n: Лицензийн зөвшөөрөл\n# ^ComponentsSubCaption\n: Суулгах сонголт\n# ^DirSubCaption\n: Суулгах Хавтас\n# ^InstallingSubCaption\n:Суулгаж байна\n# ^CompletedSubCaption\n: Дууслаа\n# ^UnComponentsSubCaption\n: Суулгасныг устгахын Сонголт\n# ^UnDirSubCaption\n: Суулгасныг устгах Хавтас\n# ^ConfirmSubCaption\n: Батламж\n# ^UninstallingSubCaption\n: Суулгасныг устгаж байна\n# ^UnCompletedSubCaption\n: Дууслаа\n# ^BackBtn\n< &Буцах\n# ^NextBtn\n&Цааш>\n# ^AgreeBtn\n&Зөвшөөрлөө\n# ^AcceptBtn\nБи Лицензийн Зөвшөөрлийн зүйлүүдийг  &зөвшөөрч байна\n# ^DontAcceptBtn\nБи Лицензийн Зөвшөөрлийн зүйлүүдийг  &зөвшөөрөхгүй байна\n# ^InstallBtn\n&Суулга\n# ^UninstallBtn\n&Устга\n# ^CancelBtn\nБолих\n# ^CloseBtn\n&Xaax\n# ^BrowseBtn\nХ&өтлөх...\n# ^ShowDetailsBtn\n&Дэлгэрэнгүй\n# ^ClickNext\nЦааш дээр дарвал үргэлжилнэ.\n# ^ClickInstall\nСуулга дээр дарвал суулгац эхэлнэ.\n# ^ClickUninstall\nУстга дээр дарвал суулгацын устгалт эхэлнэ.\n# ^Name\nНэр\n# ^Completed\nДууслаа\n# ^LicenseText\n$(^NameDA)-г суулгахын өмнө Лицензийн Зөвшөөрлийг уншина уу. Хэрэв та зөвшилцлийн зүйлүүдийг зөвшөөрч байвал, Зөвшөөрлөө-г дарна уу.\n# ^LicenseTextCB\n$(^NameDA)-г суулгахын өмнө Лицензийн Зөвшөөрлийг уншина уу. Хэрэв та зөвшилцлийн зүйлүүдийг зөвшөөрч байвал, доорх нүдийг чагтална уу. $_CLICK\n# ^LicenseTextRB\n$(^NameDA)-г суулгахын өмнө Лицензийн Зөвшөөрлийг уншина уу. Хэрэв та зөвшилцлийн зүйлүүдийг зөвшөөрч байвал, доорх эхний сонголтыг сонгоно уу. $_CLICK\n# ^UnLicenseText\n$(^NameDA)-г суулгахын өмнө Лицензийн Зөвшөөрлийг уншина уу. Хэрэв та зөвшилцлийн зүйлүүдийг зөвшөөрч байвал, Зөвшөөрлөө-г дарна уу.\n# ^UnLicenseTextCB\n$(^NameDA)-г суулгахын өмнө Лицензийн Зөвшөөрлийг уншина уу. Хэрэв та зөвшилцлийн зүйлүүдийг зөвшөөрч байвал, доорх нүдийг чагтална уу. $_CLICK\n# ^UnLicenseTextRB\n$(^NameDA)-г суулгахын өмнө Лицензийн Зөвшөөрлийг уншина уу. Хэрэв та зөвшилцлийн зүйлүүдийг зөвшөөрч байвал, доорх эхний сонголтыг сонгоно уу. $_CLICK\n# ^Custom\nБусад\n# ^ComponentsText\nСуулгахыг хүссэн нэгдлээ чагтлаад, суулгахыг хүсэхгүй буйгаа бүү чагтлаарай. $_CLICK\n# ^ComponentsSubText1\nСуулгах төрлийг сонгоно уу:\n# ^ComponentsSubText2_NoInstTypes\nСуулгах нэгдлийг сонгоно уу:\n# ^ComponentsSubText2\nЭсвэл, заавал суулгахгүй байх нэгдлүүдийг сонго:\n# ^UnComponentsText\nУстгахыг хүссэн нэгдлээ чагтлаад, устгахыг хүсэхгүй байгаагаа бүү чагтлаарай. $_CLICK\n# ^UnComponentsSubText1\nУстгах төрлийг сонгоно уу:\n# ^UnComponentsSubText2_NoInstTypes\nУстгах нэгдлүүдийг сонгоно ууl:\n# ^UnComponentsSubText2\nЭсвэл, заавал устгахгүй байх нэгдлүүдийг сонго:\n# ^DirText\n$(^NameDA) нь дараах хавтсанд сууна. Өөр газар суулгахыг хүсвэл Хөтлөх товч дээр даран өөр хавтас сонгоно уу. $_CLICK\n# ^DirSubText\nЗорилтот Хавтас\n# ^DirBrowseText\n$(^NameDA)-ыг суулгах хавтсыг сонгох:\n# ^UnDirText\n$(^NameDA)-г уг хавтаснаас устгана. Өөр газраас устгахыг хүсвэл Хөтлөх товч дээр даран өөр хавтас сонгоно уу. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n$(^NameDA)-г устгах хавтсыг сонгох:\n# ^SpaceAvailable\n\"Боломжит зай: \"\n# ^SpaceRequired\n\"Шаардагдах зай: \"\n# ^UninstallingText\n$(^NameDA) нь уг хавтаснаас устгагдлаа. $_CLICK\n# ^UninstallingSubText\nУстгагдах газар:\n# ^FileError\nФайл бичихээр нээхэд алдлаа: \\r\\n\\t\"$0\"\\r\\nТаслах дарвал суулгалт таслагдана,\\r\\nДахья дарвал файлыг бичихээр дахин оролдоно,\\r\\nэсвэл Үл тоох дарвал уг файлыг алгасна\n# ^FileError_NoIgnore\nФайл бичихээр нээхэд алдлаа: \\r\\n\\t\"$0\"\\r\\nДахия дарвал файлыг бичихээр дахин оролдоно, \\r\\nэсвэл болих дарвал суулгалт таслагдана\n# ^CantWrite\n\"Бичиж чадсангүй: \"\n# ^CopyFailed\nХуулалт бүтсэнгүй\n# ^CopyTo\n\"Хуулах нь \"\n# ^Registering\n\"Бүртгэж байна: \"\n# ^Unregistering\n\"Бүртгэлийг арилгаж байна: \"\n# ^SymbolNotFound\n\"Тэмдэг хайгдсангүй: \"\n# ^CouldNotLoad\n\"Дуудагдсангүй: \"\n# ^CreateFolder\n\"Үүсгэх хавтас: \"\n# ^CreateShortcut\n\"Үүсгэх shortcut: \"\n# ^CreatedUninstaller\n\"Үүссэн uninstaller: \"\n# ^Delete\n\"Файл устгах: \"\n# ^DeleteOnReboot\n\"Д.ачаалахад устгах: \"\n# ^ErrorCreatingShortcut\n\"Shortcut үүсгэхэд алдлаа: \"\n# ^ErrorCreating\n\"Үүсгэх алдаа: \"\n# ^ErrorDecompressing\nӨгөгдөл задлахад алдлаа! Суулгац эвдэрчээ?\n# ^ErrorRegistering\nDLL бүртгүүлэхэд алдлаа\n# ^ExecShell\n\"Ажиллуулах команд(ExecShell): \"\n# ^Exec\n\"Ажиллуулах: \"\n# ^Extract\n\"Задлах: \"\n# ^ErrorWriting\n\"Задлалт:файл руу бичихэд алдаа \"\n# ^InvalidOpcode\nСуулгац эвдэрчээ: задлах код буруу\n# ^NoOLE\n\"OLE байхгүй: \"\n# ^OutputFolder\n\"Гаргах хавтас: \"\n# ^RemoveFolder\n\"Устгах хавтас: \"\n# ^RenameOnReboot\n\"Д.ачаалахад дахин нэрлэх: \"\n# ^Rename\n\"Дахин нэрлэх: \"\n# ^Skipped\n\"Алгассан: \"\n# ^CopyDetails\nДэлгэрэнгүйг Clipboard руу хуулах\n# ^LogInstall\nСуулгах явцын баримт\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Mongolian.nsh",
    "content": "﻿;Language: Mongolian (1104)\n;By Bayarsaikhan Enkhtaivan\n\n!insertmacro LANGFILE \"Mongolian\" \"Mongolian (Cyrillic)\" \"Монгол Кирилл\" \"Mongol kirill\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) Суулгацад тавтай морил\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"$(^NameDA) суулгацын илбэчинг та шууд ашиглаж болно.$\\r$\\n$\\r$\\nҮүнийг суулгахын өмнө бусад бүх програмуудаа хаахыг зөвлөж байна. Системийн файлуудыг шинэчилбэл компьютерээ дахин ачаалахгүй байх боломжтой.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"$(^NameDA) Суулгацыг устгах илбэчинд тавтай морил\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"$(^NameDA) устгацын илбэчинг та шууд ашиглаж болно.$\\r$\\n$\\r$\\nУстгахын өмнө $(^NameDA) нь ажиллаагүй эсэхийг шалга.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Лицензийн зөвшөөрөл\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"$(^NameDA)-ыг суулгахынхаа өмнө зөвшилцлийн зүйлүүдийг уншина уу.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Хэрэв зөвшилцлийн зүйлсийг зөвшөөрч байвал, Зөвшөөрлөө товчийг даран үргэлжлүүлнэ үү. $(^NameDA)-ыг суулгахын тулд заавал зөвшөөрөх шаардлагатай.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Хэрэв зөвшилцлийн зүйлсийг зөвшөөрч байвал, Зөвлөх хайрцгийг даран үргэлжлүүлнэ үү. $(^NameDA)-ыг суулгахын тулд заавал зөвшөөрөх шаардлагатай. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Хэрэв зөвшилцлийн зүйлсийг зөвшөөрч байвал, доорхоос эхнийг нь сонгон үргэлжлүүлнэ үү. $(^NameDA)-ыг суулгахын тулд заавал зөвшөөрөх шаардлагатай. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Лицензийн зөвшөөрөл\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"$(^NameDA) устгахын өмнө зөвшилцлийн зүйлсийг уншина уу.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Хэрэв зөвшилцлийн зүйлсийг зөвшөөрч байвал, Зөвшөөрлөө товчийг даран үргэлжлүүлнэ үү. $(^NameDA)-ыг устгахын тулд заавал зөвшөөрөх шаардлагатай.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Хэрэв зөвшилцлийн зүйлсийг зөвшөөрч байвал, Зөвлөх хайрцгийг даран үргэлжлүүлнэ үү. $(^NameDA)-ыг устгахын тулд заавал зөвшөөрөх шаардлагатай. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Хэрэв зөвшилцлийн зүйлсийг зөвшөөрч байвал, доорхоос эхнийг нь сонгон үргэлжлүүлнэ үү. $(^NameDA)-ыг устгахын тулд заавал зөвшөөрөх шаардлагатай. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Page Down товчийг даран зөвшилцлийг доош гүйлгэнэ үү.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Нэгдлийг сонгох\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"$(^NameDA)-ыг суулгахад шаардагдах хэсгийг сонгоно уу.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Нэгдлийг сонгох\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"$(^NameDA)-ын устгах шаардлагатай нэгдлийг сонгох.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Тайлбар\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Та хулганаараа нэгдлийн дээр очиход түүний тайлбарыг харуулна.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Нэгдлийг сонговол түүний тайлбарыг харна.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Суулгах байрлалыг сонгох\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"$(^NameDA) суулгацын суулгах замыг сонго.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Устгацын байрлалыг сонгох\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"$(^NameDA)-ыг устгах хавтсыг сонгох.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Суулгаж байна\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"$(^NameDA)-ыг суулгаж дуустал түр хүлээнэ үү.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Суулгаж дууслаа\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Суулгац амжилттай болов.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Суулгалт таслагдлаа\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Суулгалт амжилтгүй болов.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Устгаж байна\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"$(^NameDA) -ыг зайлуулж дуустал түр хүлээнэ үү.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Устгаж дууслаа\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Устгалт амжилттай дууслаа.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Устгац таслагдлаа\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Устгалт амжилтгүй боллоо.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) Суулгацын илбэчин дууслаа\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) нь таны компьютерт суулаа.$\\r$\\n$\\r$\\nТөгсгөл дээр дарвал хаана.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA)-ын суулгацын дараалалд та компьютерээ дахин ачаалснаар дуусна. Та дахин ачаалахыг хүсэж байна уу?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) Устгацын илбэчин дууслаа\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) нь таны компьютерээс зайлуулагдлаа.$\\r$\\n$\\r$\\nТөгсгөл дээр дарвал хаана.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) Устгацын дараалалд та компьютерээ дахин ачаалснаар дуусна. Та д.ачаалмаар байна уу?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Д.Ачаал\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Би дараа д.ачаалахыг хүсэж байна.\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) ажиллуулах\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Readme харуулах\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Төгсгөл\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Start цэсний хавтсыг сонго\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Start цэс дэх $(^NameDA) shortcut-ын хавтсыг сонго.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Start цэсэнд програмын shortcut үүсгэх хавтсыг сонго. Эсвэл та шинэ нэрээр үүсгэж болно.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Shortcut үүсгэхгүй\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA)--ын Устгац\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) -ыг таны компьютерээс зайлуулах.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"$(^Name) -ын суулгацаас гармаар байна уу?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"$(^Name) Устгацаас гармаар байна уу?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Хэрэглэгч сонгох\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"$(^NameDA)-ыг аль хэрэглэгчид зориулж суулгах вэ.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"$(^NameDA)-ыг зөвхөн өөртөө эсвэл энэ компьютер дээрх бүх хэрэглэгчдэд зориулж суулгахыг сонго. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Энэ компьютер дээрх бүх хэрэглэчдэд суулгах\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Зөвхөн өөртөө суулгах\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Norwegian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1044\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Jonas Lindstrøm (jonasc_88@hotmail.com). Reviewed and fixed by Jan Ivar Beddari <d0der at online.no>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) installasjon\n# ^UninstallCaption\n$(^Name) avinstallasjon\n# ^LicenseSubCaption\n: Lisensavtale\n# ^ComponentsSubCaption\n: Installasjonsvalg\n# ^DirSubCaption\n: Installasjonsmappe\n# ^InstallingSubCaption\n: Installerer\n# ^CompletedSubCaption\n: Ferdig\n# ^UnComponentsSubCaption\n: Avinstallasjonsvalg\n# ^UnDirSubCaption\n: Avinstallasjonsmappe\n# ^ConfirmSubCaption\n: Bekreft\n# ^UninstallingSubCaption\n: Avinstallerer\n# ^UnCompletedSubCaption\n: Ferdig\n# ^BackBtn\n< &Tilbake\n# ^NextBtn\n&Neste >\n# ^AgreeBtn\n&Godta\n# ^AcceptBtn\nJeg &godtar vilkårene i lisensavtalen\n# ^DontAcceptBtn\nJeg godtar &ikke vilkårene i lisensavtalen\n# ^InstallBtn\n&Installer\n# ^UninstallBtn\n&Avinstaller\n# ^CancelBtn\nAvbryt\n# ^CloseBtn\n&Lukk\n# ^BrowseBtn\nBla &gjennom...\n# ^ShowDetailsBtn\nVis &detaljer\n# ^ClickNext\nTrykk Neste for å fortsette.\n# ^ClickInstall\nTrykk Installer for å starte installasjonen.\n# ^ClickUninstall\nTrykk Avinstaller for å starte avinstallasjonen.\n# ^Name\nNavn\n# ^Completed\nFerdig\n# ^LicenseText\nVennligst les gjennom lisensavtalen før du installerer $(^Name). Hvis du godtar vilkårene i avtalen, trykk på Godta.\n# ^LicenseTextCB\nVennligst les gjennom lisensavtalen før du installerer $(^Name). Hvis du godtar vilkårene i avtalen, merk av under. $_CLICK\n# ^LicenseTextRB\nVennligst les gjennom lisensavtalen før du installerer $(^Name). Hvis du godtar vilkårene i avtalen, velg det første alternativet. $_CLICK\n# ^UnLicenseText\nVennligst les gjennom lisensavtalen før du avinstallerer $(^Name). Hvis du godtar vilkårene i avtalen, trykk på Godta.\n# ^UnLicenseTextCB\nVennligst les gjennom lisensavtalen før du avinstallerer $(^Name). Hvis du godtar vilkårene i avtalen, merk av under. $_CLICK\n# ^UnLicenseTextRB\nVennligst les gjennom lisensavtalen før du avinstallerer $(^Name). Hvis du godtar vilkårene i avtalen, velg det første alternativet. $_CLICK\n# ^Custom\nEgendefinert\n# ^ComponentsText\nMerk komponentene du vil installere og fjern merkingen for de du ikke vil installere. $_CLICK\n# ^ComponentsSubText1\nVelg hvilken måte du vil installere på:\n# ^ComponentsSubText2_NoInstTypes\nMerk komponenter du vil installere:\n# ^ComponentsSubText2\nEller merk de valgfrie komponentene du ønsker å installere:\n# ^UnComponentsText\nMerk komponentene du vil avinstallere og fjern merkingen for de du vil beholde. $_CLICK\n# ^UnComponentsSubText1\nVelg hvilken måte du vil avinstallere på:\n# ^UnComponentsSubText2_NoInstTypes\nMerk komponenter du vil avinstallere:\n# ^UnComponentsSubText2\nEller merk de valgfrie komponentene du ønsker å avinstallere:\n# ^DirText\n$(^Name) vil bli installert i følgende mappe. For å velge en annen mappe, trykk Bla gjennom. $_CLICK\n# ^DirSubText\nMålmappe\n# ^DirBrowseText\nVelg mappe du vil installere $(^Name) i:\n# ^UnDirText\n$(^Name) i følgende mappe vil bli avinstallert. For å velge en annen mappe, trykk Bla gjennom. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nVelg mappe du vil avinstallere $(^Name) fra:\n# ^SpaceAvailable\n\"Ledig plass: \"\n# ^SpaceRequired\n\"Nødvendig plass: \"\n# ^UninstallingText\nDenne veiviseren vil avinstallere $(^Name) fra din datamaskin. $_CLICK\n# ^UninstallingSubText\nAvinstallerer fra:\n# ^FileError\nFeil under åpning av fil for skriving: \\r\\n\\t\\\"$0\\\"\\r\\nTrykk Avbryt for å avbryte installasjonen,\\r\\nPrøv igjen for å prøve igjen, eller\\r\\nIgnorer for å hoppe over denne filen\n# ^FileError_NoIgnore\nFeil under åpning av fil for skriving: \\r\\n\\t\\\"$0\\\"\\r\\nTrykk Prøv igjen for å prøve igjen, or\\r\\neller Avbryt for å avbryte installasjonen\n# ^CantWrite\n\"Kan ikke skrive: \"\n# ^CopyFailed\nKopiering mislyktes\n# ^CopyTo\n\"Kopier til \"\n# ^Registering\n\"Registrerer: \"\n# ^Unregistering\n\"\"Avregistrerer: \"\n# ^SymbolNotFound\n\"Kunne ikke finne symbol: \"\n# ^CouldNotLoad\n\"Kunne ikke laste: \"\n# ^CreateFolder\n\"Lag mappe: \"\n# ^CreateShortcut\n\"Lag snarvei: \"\n# ^CreatedUninstaller\n\"Avinstallasjon laget: \"\n# ^Delete\n\"Slett fil: \"\n# ^DeleteOnReboot\n\"Slett ved omstart: \"\n# ^ErrorCreatingShortcut\n\"Feil under opprettelse av snarvei: \"\n# ^ErrorCreating\n\"Feil under opprettelse av: \"\n# ^ErrorDecompressing\nFeil under utpakking av data! Installasjonsprogrammet kan være skadet.\n# ^ErrorRegistering\nFeil under registrering av DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Kjøre: \"\n# ^Extract\n\"Pakk ut: \"\n# ^ErrorWriting\n\"Pakk ut: Feil under skriving til fil \"\n# ^InvalidOpcode\nInstallasjonsprogrammet er skadet: ukjent kode\n# ^NoOLE\n\"Ingen OLE for: \"\n# ^OutputFolder\n\"Ut-mappe: \"\n# ^RemoveFolder\n\"Fjern mappe: \"\n# ^RenameOnReboot\n\"Gi nytt navn ved omstart: \"\n# ^Rename\n\"Gi nytt navn: \"\n# ^Skipped\n\"Hoppet over: \"\n# ^CopyDetails\nKopier detaljer til utklippstavlen\n# ^LogInstall\nLoggfør installasjonsprosessen\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Norwegian.nsh",
    "content": "﻿;Language: Norwegian (2068)\n;By Jonas Lindsrøm (jonasc_88@hotmail.com) Reviewed and fixed by Jan Ivar Beddari, d0der at online.no\n\n!insertmacro LANGFILE \"Norwegian\" = \"Norsk\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Velkommen til veiviseren for installasjon av $(^NameDA) \"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Denne veiviseren vil lede deg gjennom installasjonen av $(^NameDA).$\\r$\\n$\\r$\\nDet anbefales at du avslutter alle andre programmer før du fortsetter. Dette vil la installasjonsprogrammet forandre på systemfiler uten at du må starte datamaskinen på nytt.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Velkommen til veiviseren for avinstallasjon av $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Denne veiviseren vil lede deg gjennom avinstallasjonen av $(^NameDA).$\\r$\\n$\\r$\\nFør du fortsetter må du forsikre deg om at $(^NameDA) ikke kjører.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lisensavtale\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Vennligst les gjennom lisensavtalen før du starter installasjonen av $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Hvis du godtar lisensavtalen trykk Godta for å fortsette. Du må godta lisensavtalen for å installere $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Hvis du godtar lisensavtalen, kryss av på merket under. Du må godta lisensavtalen for å installere $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Hvis du godtar lisensavtalen, velg det første alternativet ovenfor. Du må godta lisensavtalen for å installere $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lisensavtale\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Vennligst les gjennom lisensavtalen før du avinstallerer $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Hvis du godtar lisensavtalen trykk Godta for å fortsette.  Du må godta lisensavtalen for å avintallere $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Hvis du godtar lisensavtalen, kryss av på merket under. Du må godta lisensavtalen for å avinstallere $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Hvis du godtar lisensavtalen, velg det første alternativet ovenfor. Du må godta lisensavtalen for å avinstallere $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Trykk Page Down knappen for å se resten av lisensavtalen.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Velg komponenter\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Velg hvilke deler av $(^NameDA) du ønsker å installere.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Velg komponenter\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Velg hvilke deler av $(^NameDA) du ønsker å avinstallere.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beskrivelse\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Beveg musen over komponentene for å se beskrivelsen.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Velg en komponent for å se beskrivelsen.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Velg installasjonsmappe\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Velg hvilken mappe du vil installere $(^NameDA) i.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Velg mappe for avinstallasjon\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Velg mappen du vil avinstallere $(^NameDA) fra.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installasjonen pågår\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Vennligst vent mens $(^NameDA) blir installert.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installasjonen er ferdig\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Installasjonen ble fullført uten feil.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installasjonen er avbrutt\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Installasjonen ble ikke fullført riktig.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Avinstallasjon pågår\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Vennligst vent mens $(^NameDA) blir avinstallert.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Avinstallasjon ferdig\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Avinstallasjonen ble utført uten feil.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Avinstallasjon avbrutt\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Avinstallasjonen ble ikke utført riktig.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Avslutter $(^NameDA) installasjonsveiviser\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) er klart til bruk på din datamskin.$\\r$\\n$\\r$\\nTrykk Ferdig for å avslutte installasjonsprogrammet.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Du må starte datamaskinen på nytt for å fullføre installasjonen av $(^NameDA). Vil du starte datamaskinen på nytt nå?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Fullfører avinstallasjonen av $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) har blitt avinstallert fra din datamaskin.$\\r$\\n$\\r$\\nTrykk på ferdig for å avslutte denne veiviseren.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Datamaskinen må starte på nytt for å fullføre avinstallasjonen av $(^NameDA). Vil du starte datamaskinen på nytt nå?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Ja. Start datamaskinen på nytt nå\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Nei. Jeg vil starte datamaskinen på nytt senere\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Kjør $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Vis Readme filen\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Ferdig\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Velg plassering på startmenyen\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Velg hvilken mappe snarveiene til $(^NameDA) skal ligge i.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Velg mappe for snarveiene til programmet. Du kan også skrive inn et nytt navn for å lage en ny mappe.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ikke lag snarveier\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Avinstaller $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Fjern $(^NameDA) fra din datamaskin.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Er du sikker på at du vil avslutte installasjonen av $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Er du sikker på at du vil avbryte avinstallasjonen av $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Velg brukere\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Velg hvilke brukere du vil installere $(^NameDA) for.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Velg om du vil installere $(^NameDA) bare for deg selv, eller for alle som bruker denne maskinen. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installer for alle som bruker denne maskinen\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installer bare for meg\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/NorwegianNynorsk.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n2068\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Vebjørn Sture, vsture gmail com\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) installasjon\n# ^UninstallCaption\n$(^Name) avinstallasjon\n# ^LicenseSubCaption\n: Lisensavtale\n# ^ComponentsSubCaption\n: Installasjonsval\n# ^DirSubCaption\n: Installasjonsmappe\n# ^InstallingSubCaption\n: Installerer\n# ^CompletedSubCaption\n: Ferdig\n# ^UnComponentsSubCaption\n: Avinstallasjonsval\n# ^UnDirSubCaption\n: Avinstallasjonsmappe\n# ^ConfirmSubCaption\n: Stadfest\n# ^UninstallingSubCaption\n: Avinstallerer\n# ^UnCompletedSubCaption\n: Ferdig\n# ^BackBtn\n< &Attende\n# ^NextBtn\n&Neste >\n# ^AgreeBtn\n&Godta\n# ^AcceptBtn\nEg &godtek vilkåra i lisensavtalen\n# ^DontAcceptBtn\nEg godtek &ikkje vilkåra i lisensavtalen\n# ^InstallBtn\n&Installer\n# ^UninstallBtn\n&Avinstaller\n# ^CancelBtn\nAvbryt\n# ^CloseBtn\n&Lat att\n# ^BrowseBtn\nBla &gjennom ...\n# ^ShowDetailsBtn\nSyn &detaljar\n# ^ClickNext\nTrykk Neste for å halda fram.\n# ^ClickInstall\nTrykk Installer for å starta installasjonen.\n# ^ClickUninstall\nTrykk Avinstaller for å starta avinstallasjonen.\n# ^Name\nNamn\n# ^Completed\nFerdig\n# ^LicenseText\nVer grei og les gjennom lisensavtalen før du installerer $(^NameDA). Dersom du godtek vilkåra i avtalen, trykk på Godta.\n# ^LicenseTextCB\nVer grei og les gjennom lisensavtalen før du installerer $(^NameDA). Dersom du godtek vilkåra i avtalen, merk av under. $_CLICK\n# ^LicenseTextRB\nVer grei og les gjennom lisensavtalen før du installerer $(^NameDA). Dersom du godtek vilkåra i avtalen, vel det fyrste alternativet. $_CLICK\n# ^UnLicenseText\nVer grei og les gjennom lisensavtalen før du avinstallerer $(^NameDA). Dersom du godtek vilkåra i avtalen, trykk på Godta.\n# ^UnLicenseTextCB\nVer grei og les gjennom lisensavtalen før du avinstallerer $(^NameDA). Dersom du godtek vilkåra i avtalen, merk av under. $_CLICK\n# ^UnLicenseTextRB\nVer grei og les gjennom lisensavtalen før du avinstallerer $(^NameDA). Dersom du godtek vilkåra i avtalen, vel det fyrste alternativet. $_CLICK\n# ^Custom\nEigendefinert\n# ^ComponentsText\nMerk komponentane du vil installera og fjern merkinga for dei du ikkje vil installera. $_CLICK\n# ^ComponentsSubText1\nVel kva måte du vil installera på:\n# ^ComponentsSubText2_NoInstTypes\nMerk komponentar du vil installera:\n# ^ComponentsSubText2\nEller merk dei valfrie komponentane du ynskjer å installera:\n# ^UnComponentsText\nMerk komponentane du vil avinstallera og fjern merkinga for dei du vil ta vare på. $_CLICK\n# ^UnComponentsSubText1\nVel kva måte du vil avinstallera på:\n# ^UnComponentsSubText2_NoInstTypes\nMerk komponentar du vil avinstallera:\n# ^UnComponentsSubText2\nEller merk dei valfrie komponentane du ynskjer å avinstallera:\n# ^DirText\n$(^NameDA) vil verta installert i fylgjande mappe. For å velja ei anna mappe, trykk Bla gjennom. $_CLICK\n# ^DirSubText\nMålmappe\n# ^DirBrowseText\nVel mappe du vil installera $(^NameDA) i:\n# ^UnDirText\n$(^NameDA) i fylgjande mappe vil verta avinstallert. For å velja ei anna mappe, trykk Bla gjennom. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nVel mappe du vil avinstallera $(^NameDA) frå:\n# ^SpaceAvailable\n\"Ledig plass: \"\n# ^SpaceRequired\n\"Naudsynt plass: \"\n# ^UninstallingText\nDenne vegvisaren vil avinstallera $(^NameDA) frå din datamaskin. $_CLICK\n# ^UninstallingSubText\nAvinstallerer frå:\n# ^FileError\nFeil under opning av fil for skriving: \\r\\n\\t\\\"$0\\\"\\r\\nTrykk Avbryt for å avbryta installasjonen,\\r\\nPrøv igjen for å prøva igjen, eller\\r\\nIgnorer for å hoppa over denne fila\n# ^FileError_NoIgnore\nFeil under opning av fil for skriving: \\r\\n\\t\\\"$0\\\"\\r\\nTrykk Prøv igjen for å prøva igjen, or\\r\\neller Avbryt for å avbryta installasjonen\n# ^CantWrite\n\"Kan ikkje skriva: \"\n# ^CopyFailed\nKopiering mislukka\n# ^CopyTo\n\"Kopier til \"\n# ^Registering\n\"Registrerer: \"\n# ^Unregistering\n\"\"Avregistrerer: \"\n# ^SymbolNotFound\n\"Kunne ikkje finna symbol: \"\n# ^CouldNotLoad\n\"Kunne ikkje lasta: \"\n# ^CreateFolder\n\"Lag mappe: \"\n# ^CreateShortcut\n\"Lag snarveg: \"\n# ^CreatedUninstaller\n\"Avinstallasjon laga: \"\n# ^Delete\n\"Slett fil: \"\n# ^DeleteOnReboot\n\"Slett ved omstart: \"\n# ^ErrorCreatingShortcut\n\"Feil under oppretting av snarveg: \"\n# ^ErrorCreating\n\"Feil under oppretting av: \"\n# ^ErrorDecompressing\nFeil under utpakking av data! Installasjonsprogrammet kan vera skadd.\n# ^ErrorRegistering\nFeil under registrering av DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Køyra: \"\n# ^Extract\n\"Pakk ut: \"\n# ^ErrorWriting\n\"Pakk ut: Feil under skriving til fil \"\n# ^InvalidOpcode\nInstallasjonsprogrammet er skadd: ukjend kode\n# ^NoOLE\n\"Ingen OLE for: \"\n# ^OutputFolder\n\"Ut-mappe: \"\n# ^RemoveFolder\n\"Fjern mappe: \"\n# ^RenameOnReboot\n\"Gje nytt namn ved omstart: \"\n# ^Rename\n\"Gje nytt namn: \"\n# ^Skipped\n\"Hoppa over: \"\n# ^CopyDetails\nKopier detaljar til utklyppstavla\n# ^LogInstall\nLoggfør installasjonsprosessen\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/NorwegianNynorsk.nsh",
    "content": "﻿;Language: Norwegian nynorsk (2068)\n;By Vebjoern Sture and Håvard Mork (www.firefox.no)\n\n!insertmacro LANGFILE \"NorwegianNynorsk\" \"Norwegian (Nynorsk)\" \"Norsk (nynorsk)\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Velkommen til $(^NameDA) innstallasjonsvegvisar\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Denne vegvisaren vil leie deg gjennom installeringa av $(^NameDA).$\\n$\\nDet er tilrådd at du avsluttar alle andre program før du held fram. Dette vil la installeringsprogrammet oppdatera systemfiler utan at du må starta datamaskinen på nytt.$\\n$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Velkommen til avinstallering av $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Denne vegvisaren vil leie deg gjennom avinstalleringen av $(^NameDA).$\\n$\\nFør du fortsetter må du forsikre deg om at $(^NameDA) ikkje er opent.$\\n$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lisensavtale\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Les gjennom lisensavtalen før du startar installeringa av $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Trykk på «Godta» dersom du godtar betingelsane i avtala. Du må godta avtala for å installere $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Trykk på avkryssingsboksen nedanfor nedanfor dersom du godtar betingelsane i avtala. Du må godta avtala for å installere $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Vel det første alternativet nedanfor dersom du godtek vilkåra i avtala. Du må godta avtala for å installera $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lisensavtale\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Les gjennom lisensavtalen før du startar avinstalleringa av $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Trykk på «Godta» dersom du godtar betingelsane i avtala. Du må godta avtala for å avinstallera $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Trykk på avkryssingsboksen nedanfor nedanfor dersom du godtar betingelsane i avtala. Du må godta avtala for å avinstallera $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Vel det første alternativet nedanfor dersom du godtar betingelsane i avtala. Du må godta avtala for å avinstallera $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Trykk Page Down-knappen for å sjå resten av lisensavtala.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Vel komponentar\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Vel kva delar av $(^NameDA) du ynskjer å installera.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Vel funksjonar\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Vel kva for funksjonar du vil avinstallera i $(^NameDA).\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beskriving\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Beveg musa over komponentene for å sjå beskrivinga.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Vel ein komponent for å sjå beskrivinga.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Vel installasjonsmappe\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Vel kva mappe du vil installera $(^NameDA) i.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Vel avinstalleringplassering\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Vel mappa du vil avinstallere $(^NameDA) frå.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installerer\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Vent mens $(^NameDA) blir installert.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installeringa er fullført\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Installeringa vart fullført.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installeringa vart avbroten\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Installeringa vart ikkje fullført.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Avinstallerer\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Vent medan $(^NameDA) vert avinstallert.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Avinstallering ferdig\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Avinstallering ble utført uten feil.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Avinstallering broten\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Avinstallering ble ikkje utført riktig.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Installering fullført\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) er installert og klar til bruk.$\\n$\\nTrykk på «Fullfør» for å avslutte installeringa.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Du må starta datamaskinen på nytt for å fullføra installeringa av $(^NameDA). Vil du starta på nytt no?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Fullfører avinstalleringa av $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) er no avinstallert frå datamaskina di.$\\n$\\nTrykk på «Fullfør» for å avslutta denne vegvisaren.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Datamaskinen må starta på nytt for å fullføra avinstalleringa av $(^NameDA). Vil du starta datamaskina på nytt no?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Start på nytt no\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Eg vil starta på nytt seinare\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Køyr $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Syn lesmeg\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Fullfør\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Vel mappe på startmenyen\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Vel kva mappe snarvegane til $(^NameDA) skal liggja i.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Vel mappa du vil oppretta snarvegane til programmet i. Du kan òg skriva inn eit nytt namn for å laga ei ny mappe.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ikkje opprett snarvegar\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Avinstaller $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Slett $(^NameDA) frå datamaskinen.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Er du viss på at du vil avslutta installeringa av $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Er du viss på at du vil avbryta avinstalleringa av $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Vel brukarar\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Vel kva brukarar du vil installere $(^NameDA) for.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Vel om du vil installere $(^NameDA) berre for deg, eller for alle som nyttar denne maskina. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installer for alle som nyttar maskina\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installer berre for me\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Pashto.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1123\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1256\n# RTL - anything else than RTL means LTR\nRTL\n# Translation by Pakhtosoft (www.pakhtosoft.com)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nامسته $(^Name)\n# ^UninstallCaption\nنالګاو $(^Name)\n# ^LicenseSubCaption\n: منښتليک تړون\n# ^ComponentsSubCaption\n: لګاو غوراوي\n# ^DirSubCaption\n: لګاو پوښۍ\n# ^InstallingSubCaption\n: لګيږي\n# ^CompletedSubCaption\n: بشپړ\n# ^UnComponentsSubCaption\n: نالګاو غوراوي\n# ^UnDirSubCaption\n: نالګاو پوښۍ\n# ^ConfirmSubCaption\n: باورول\n# ^UninstallingSubCaption\n: نالګيږي\n# ^UnCompletedSubCaption\n: بشپړ\n# ^BackBtn\n< &وروسته\n# ^NextBtn\n&مخکښې >\n# ^AgreeBtn\nزه &منم\n# ^AcceptBtn\nزه &د منښتليک توکي منم\n# ^DontAcceptBtn\nزه &د منښتليک توکي نه منم\n# ^InstallBtn\n&لګول\n# ^UninstallBtn\n&نالګول\n# ^CancelBtn\nبندول\n# ^CloseBtn\n&بندول\n# ^BrowseBtn\n...چ&ڼل\n# ^ShowDetailsBtn\nخبرتياوې &ښودل\n# ^ClickNext\n.مخکښې تلو لپاره مخکښې ټک وهئ\n# ^ClickInstall\n.لګاو پېلولو لپاره لګول ټک وهئ\n# ^ClickUninstall\n.نالګاو پېلولو لپاره نالګول ټک وهئ\n# ^Name\nنوم\n# ^Completed\nبشپړ\n# ^LicenseText\n.د لګولو نه مخکښې منښتليک وګورئ. که چېرې تاسې د منښتليک ټول توکي منئ، زه منم ټک وهئ $(^NameDA) د\n# ^LicenseTextCB\n$_CLICK .د لګولو نه مخکښې منښتليک وګورئ. که چېرې تاسې د منښتليک ټول توکي منئ، لاندې خوښبکس ټک وهئ $(^NameDA) د\n# ^LicenseTextRB\n$_CLICK .د لګولو نه مخکښې منښتليک وګورئ. که چېرې تاسې د منښتليک ټول توکي منئ، لاندې لمړی غوراوی خوښ کړئ $(^NameDA) د\n# ^UnLicenseText\n.د نالګاو نه مخکښې منښتليک وګورئ. که چېرې تاسې د منښتليک ټول توکي منئ، زه منم ټک وهئ $(^NameDA) د\n# ^UnLicenseTextCB\n$_CLICK .د نالګاو نه مخکښې منښتليک وګورئ. که چېرې تاسې د منښتليک ټول توکي منئ، لاندې خوښبکس ټک وهئ $(^NameDA) د\n# ^UnLicenseTextRB\n$_CLICK .د نالګاو نه مخکښې منښتليک وګورئ. که چېرې تاسې د منښتليک ټول توکي منئ، لاندې لمړی غوراوي خوښ کړئ $(^NameDA) د\n# ^Custom\nدوديز\n# ^ComponentsText\n$_CLICK .کوم رغتوکي چې لګول غواړئ خوښ يې کړئ او کوم رغتوکي چې نه غواړئ ويې لګوئ مه يې خوښوئ\n# ^ComponentsSubText1\n:د لګاو ډول وټاکئ\n# ^ComponentsSubText2_NoInstTypes\n:د لګولو لپاره رغتوکي خوښ کړئ\n# ^ComponentsSubText2\n:يا، هغه غوراويز رغتوکي چې لګول يې غواړئ وټاکئ\n# ^UnComponentsText\n$_CLICK .کوم رغتوکي چې نالګول غواړئ خوښ يې کړئ او کوم رغتوکي چې نه غواړئ ويې نالګوئ مه يې خوښوئ\n# ^UnComponentsSubText1\n:د نالګاو ډول وټاکئ\n# ^UnComponentsSubText2_NoInstTypes\n:د نالګولو لپاره رغتوکي وټاکئ\n# ^UnComponentsSubText2\n:يا، هغه غوراويز رغتوکي چې نالګول يې غواړئ وټاکئ\n# ^DirText\n$_CLICK .په لاندې پوښۍ کښې ولګوي. په بلې پوښۍ کښې يې د لګولو لپاره، چڼل ټک وهئ او بله پوښۍ وټاکئ $(^NameDA) امسته به\n# ^DirSubText\nموخه پوښۍ\n# ^DirBrowseText\n:پکښې لګول غواړئ وټاکئ $(^NameDA) هغه پوښۍ چې\n# ^UnDirText\n$_CLICK .د لاندې پوښۍ نه ونالګوي. د بلې پوښۍ نې د نالګولو لپاره، چڼل ټک وهئ او بله پوښۍ وټاکئ $(^NameDA) امسته به\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n:ترې نالګول غواړئ وټاکئ $(^NameDA) هغه پوښۍ چې\n# ^SpaceAvailable\n\" :شته تشه\"\n# ^SpaceRequired\n\" :اړينه تشه\"\n# ^UninstallingText\n$_CLICK .به د لاندې پوښۍ نه ونالګول شي $(^NameDA)\n# ^UninstallingSubText\n:نالګيږي له\n# ^FileError\n:د ليکلو لپاره د دوتنې پرانيستلو کښې ستونزه \\r\\n\\r\\n$0\\r\\n\\r\\n،د لګاو د بندولو لپاره بندول ټک وهئ\\r\\nبياهڅه د بيا هڅې کولو لپاره، يا\\r\\n.پرېږده د دې دوتنې پرېښودلو لپاره\n# ^FileError_NoIgnore\n:د ليکلو لپاره د دوتنې پرانيستلو کښې ستونزه \\r\\n\\r\\n$0\\r\\n\\r\\nد بيا هڅې کولو لپاره بياهڅه ټک وهئ، يا\\r\\n.بندول د لګاو د بندولو لپاره\n# ^CantWrite\n\" :نشي ليکلی\"\n# ^CopyFailed\nلمېسلو پاتېينه\n# ^CopyTo\n\"ته لمېسل \"\n# ^Registering\n\" :نومکښليږي\"\n# ^Unregistering\n\" :نانومکښليږي\"\n# ^SymbolNotFound\n\" :پېلام نشي پېدا کولی\"\n# ^CouldNotLoad\n\" :نشي راوستلی\"\n# ^CreateFolder\n\" :پوښۍ جوړول\"\n# ^CreateShortcut\n\" :لنډلاری جوړول\"\n# ^CreatedUninstaller\n\" :جوړ شوی نالګاند\"\n# ^Delete\n\" :دوتنې ړنګول\"\n# ^DeleteOnReboot\n\" :پر بياپېلات ړنګول\"\n# ^ErrorCreatingShortcut\n\" :د لنډاري جوړولو ستونزه\"\n# ^ErrorCreating\n\" :جوړولو ستونزه\"\n# ^ErrorDecompressing\nاومتوک نازېرلو ستونزه! اندرغل لګاند؟\n# ^ErrorRegistering\nد ډلل نومکښلو ستونزه\n# ^ExecShell\n\" :اکزک شل\"\n# ^Exec\n\" :پېلول\"\n# ^Extract\n\" :وېستل\"\n# ^ErrorWriting\n\"وېستل: دوتنې کښې ليکلو ستونزه \"\n# ^InvalidOpcode\nاندرغل لګاند: ناسم اپکوډ\n# ^NoOLE\n\"No OLE for: \"\n# ^OutputFolder\n\" :وتنې پوښۍ\"\n# ^RemoveFolder\n\" :پوښې ړنګول\"\n# ^RenameOnReboot\n\" :پر بياپېلات بيانومول\"\n# ^Rename\n\" :بيانومول\"\n# ^Skipped\n\" :پرېښودلي\"\n# ^CopyDetails\nخبرتياوې ټوټې ډړې ته لمېسل\n# ^LogInstall\nد لګاو بهير خبرالول\n# ^Byte\nب\n# ^Kilo\n ک\n# ^Mega\n م\n# ^Giga\n ګ\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Pashto.nsh",
    "content": "﻿;Language: Pashto (1123)\n;By Pakhtosoft - www.pakhtosoft.com\n\n!insertmacro LANGFILE \"Pashto\" = \"پښتو\" \"Pashto\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"امسته اسانګر ته ښه راغلاست $(^NameDA) د \"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \".لګونې ته يوسي $(^NameDA) دا اسانګر به تاسې د$\\r$\\n$\\r$\\n.د امستې د پېلولو نه مخکښې د نورو ساوترو د بندولو سپارښتنه کوو. د دې کار په کولو سره به دا شونه شي چې پرته له کمپيوټر د بياپيلاته اړينې غونډال دوتنې اوسمهاله شي$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"نالګاو اسانګر ته ښه راغلاست $(^NameDA) د\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \".نالګونې ته يوسي $(^NameDA) دا اسانګر به تاسې د$\\r$\\n$\\r$\\n.نه وي پرانيستل شوی $(^NameDA) د نالګاو د پېلولو نه مخکښې، ځان ډاډمن کړﺉ چې$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"منښتليک تړون\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \".لګولو نه مخکښې منښتليک توکي وګورﺉ $(^NameDA) د\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \".د لګاونې لپاره د تړون منل اړين دي $(^NameDA) که چېرې تړون توکي منئ، زه منم ټک وهئ چې مخکښې ولاړ شئ. د\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \".لګولو لپاره د تړون منل اړين دي $(^NameDA) که چېرې د تړون توکي منئ، نو لاندې خوښبکس ټک وهئ. د $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \".لګولو لپاره د تړون منل اړين دي $(^NameDA) که چېرې د تړون توکي منئ، نو لاندې لمړی غوراوی ټک وهئ. د $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"منښتليک تړون\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \".نالګولو نه مخکښې د منښتليک توکي وګورﺉ $(^NameDA) د\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \".نالګولو لپاره د تړون منل اړين دي $(^NameDA) که چېرې د تړون توکي منئ، زه منم ټک وهئ چې مخکښې ولاړ شئ. د\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \".نالګولو لپاره د تړون منل اړين دي $(^NameDA) که چېرې د تړون توکي منئ، نو لاندې خوښبکس ټک وهئ. د $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \".نالګولو لپاره د تړون منل اړين دي $(^NameDA) که چېرې د تړون توکي منئ، نو لاندې لمړی غوراوی ټک وهئ. د $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \".د تړون د نورې برخې کتلو لپاره پېج ډاون کيلۍ ووهئ\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"رغتوکي خوښ کړﺉ\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \".کومې ځانګړتياوې چې لګول غواړﺉ، خوښ يې کړﺉ $(^NameDA) د\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"رغتوکي خوښ کړﺉ\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \".کومې ځانګړتياوې چې نالګول غواړﺉ، خوښ يې کړﺉ $(^NameDA) د\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"سپړاوي\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \".د رغتوکي سپړاوي کتلو لپاره موږک د هغې دپاسه ودروﺉ\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"لګاو ځای وټاکئ\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \".لګول غواړﺉ ويې ټاکئ $(^NameDA) په کومه پوښۍ کښې چې\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"نالګاو ځای وټاکئ\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \".نالګول غواړﺉ ويې ټاکئ $(^NameDA) د کومې پوښۍ نه چې\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"لګيږي\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \".په بشپړه توګه ولګول شي $(^NameDA) مهرباني وکړﺉ لږه تمه وکړﺉ ترڅو\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"لګونه بشپړه شوه\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \".امسته په برياليتوب سرته ورسېده\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"لګونه بنده شوه\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \".امسته په برياليتوب سرته ونه رسېده\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"نالګيږي\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \".په بشپړه توګه ونالګول شي $(^NameDA) مهرباني وکړﺉ لږه تمه وکړﺉ ترڅو\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"نالګونه بشپړه شوه\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \".نالګاو په برياليتوب سرته ورسېدو\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"نالګونه بنده شوه\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \".نالګاو په برياليتوب سرته ونه رسېدو\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"امسته اسانګر بشپړيږي $(^NameDA) د\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \".ستاسې په کمپيوټر کښې ولګول شو $(^NameDA)$\\r$\\n$\\r$\\nد دې اسانګر د بندولو لپاره پای ته ټک ورکړﺉ\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"لګاو بشپړولو لپاره ستاسې کمپيوټر بياپېلات ته اړتيا لري. ايا اوس بياپېلون کول غواړﺉ؟ $(^NameDA) د\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"نالګاو اسانګر بشپړيږي $(^NameDA) د\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \".ستاسې له کمپيوټر نه ونالګول شو $(^NameDA)$\\r$\\n$\\r$\\nد دې اسانګر د بندولو لپاره پای ته ټک ورکړﺉ\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \" نالګاو بشپړولو لپاره ستاسې کمپيوټر بياپېلات ته اړتيا لري. ايا اوس بياپېلون کول غواړﺉ؟ $(^NameDA) د\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"سمدستي بياپېلون\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"وروسته زه پخپله بياپېلون کول غواړم\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&پرانيستل $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&ماولوله ښودل\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&پای\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"پېل غورنۍ پوښۍ خوښه کړﺉ\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"د لنډلارو لپاره يو پېل غورنۍ پوښۍ خوښه کړﺉ $(^NameDA) د\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \".د پېل غورنۍ هغه پوښۍ چې د ساوتري لنډلاري پکښې جوړول غواړﺉ خوښه کړﺉ. نوې پوښۍ جوړولو لپاره نوم هم ليکلی شئ\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"لنډلاري مه جوړوه\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"نالګول $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \".د خپل کمپيوټر نه ړنګول $(^NameDA)\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"امسته بندول غواړﺉ؟ $(^Name) ايا په ډاډمنه توګه د\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"نالګاو بندول غواړﺉ؟ $(^Name) ايا په ډاډمنه توګه د\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Polish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1045\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Piotr Murawski & Rafał Lampe\n# Updated by cube and SYSTEMsoft Group\n# Corrected by Marek Stępień <mstepien@aviary.pl> - http://www.aviary.pl\n# Corrected by Mateusz Gola (aka Prozac) - http://www.avirecomp.com\n# Updated by Paweł Porwisz (http://www.pawelporwisz.pl)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalator $(^Name)\n# ^UninstallCaption\nDeinstalator $(^Name)\n# ^LicenseSubCaption\n: Umowa licencyjna\n# ^ComponentsSubCaption\n: Opcje instalacji\n# ^DirSubCaption\n: Folder instalacyjny\n# ^InstallingSubCaption\n: Instalowanie plików\n# ^CompletedSubCaption\n: Zakończono\n# ^UnComponentsSubCaption\n: Opcje deinstalacji\n# ^UnDirSubCaption\n: Folder deinstalacyjny\n# ^ConfirmSubCaption\n: Potwierdzenie\n# ^UnDirSubCaption\n: Deinstalowanie plików\n# ^UnCompletedSubCaption\n: Zakończono\n# ^BackBtn\n< &Wstecz\n# ^NextBtn\n&Dalej >\n# ^AgreeBtn\n&Zgadzam się\n# ^AcceptBtn\n&Akceptuję warunki umowy licencyjnej\n# ^DontAcceptBtn\n&Nie akceptuję warunków umowy licencyjnej\n# ^InstallBtn\n&Zainstaluj\n# ^UninstallBtn\n&Odinstaluj\n# ^CancelBtn\nAnuluj\n# ^CloseBtn\n&Zamknij\n# ^BrowseBtn\n&Przeglądaj...\n# ^ShowDetailsBtn\nPokaż &szczegóły\n# ^ClickNext\nKliknij przycisk 'Dalej', aby kontynuować.\n# ^ClickInstall\nKliknij przycisk 'Zainstaluj', aby rozpocząć instalację.\n# ^ClickUninstall\nKliknij przycisk 'Odinstaluj', aby rozpocząć deinstalację.\n# ^Name\nNazwa\n# ^Completed\nZakończono\n# ^LicenseText\nPrzed instalacją $(^NameDA) zapoznaj się z warunkami licencji. Jeśli akceptujesz wszystkie warunki umowy, kliknij przycisk 'Zgadzam się'.\n# ^LicenseTextCB\nPrzed instalacją $(^NameDA) zapoznaj się z warunkami licencji. Jeśli akceptujesz wszystkie warunki umowy, kliknij poniższe pole wyboru. $_CLICK.\n# ^LicenseTextRB\nPrzed instalacją $(^NameDA) zapoznaj się z warunkami licencji. Jeśli akceptujesz wszystkie warunki umowy, wybierz pierwszą z poniższych opcji. $_CLICK.\n# ^UnLicenseText\nPrzed deinstalacją $(^NameDA) zapoznaj się z warunkami licencji. Jeśli akceptujesz wszystkie warunki umowy, kliknij przycisk 'Zgadzam się'.\n# ^UnLicenseTextCB\nPrzed deinstalacją $(^NameDA) zapoznaj się z warunkami licencji. Jeśli akceptujesz wszystkie warunki umowy, kliknij poniższe pole wyboru. $_CLICK.\n# ^UnLicenseTextRB\nPrzed deinstalacją $(^NameDA) zapoznaj się z warunkami licencji. Jeśli akceptujesz wszystkie warunki umowy, wybierz pierwszą z poniższych opcji. $_CLICK.\n# ^Custom\nUżytkownika\n# ^ComponentsText\nZaznacz komponenty, które chcesz zainstalować i odznacz te, których nie chcesz instalować. $_CLICK\n# ^ComponentsSubText1\nWybierz typ instalacji:\n# ^ComponentsSubText2_NoInstTypes\nWybierz komponenty do zainstalowania:\n# ^ComponentsSubText2\nAlbo wybierz opcjonalne komponenty, które chcesz zainstalować:\n# ^UnComponentsText\nZaznacz komponenty, które chcesz odinstalować i odznacz te, które nie zostaną odinstalowane. $_CLICK\n# ^UnComponentsSubText1\nWybierz typ deinstalacji:\n# ^UnComponentsSubText2_NoInstTypes\nWybierz komponenty do odinstalowania:\n# ^UnComponentsSubText2\nAlbo wybierz opcjonalne komponenty, które chcesz odinstalować:\n# ^DirText\nInstalator zainstaluje $(^NameDA) w podanym poniżej folderze docelowym (możesz także kliknąć przycisk 'Przeglądaj...' i wybrać inny folder). $_CLICK\n# ^DirSubText\nFolder docelowy\n# ^DirBrowseText\nWybierz folder instalacyjny $(^NameDA):\n# ^UnDirText\nDeinstalator usunie $(^NameDA) z następującego folderu. Aby odinstalować z innego folderu, kliknij przycisk 'Przeglądaj...' i wybierz folder. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nWybierz folder, z którego zostanie odinstalowany $(^NameDA):\n# ^SpaceAvailable\n\"Dostępne miejsce: \"\n# ^SpaceRequired\n\"Wymagane miejsce: \"\n# ^UninstallingText\nTen kreator odinstaluje $(^NameDA) z Twojego komputera. $_CLICK\n# ^UninstallingSubText\nDeinstalacja z: \n# ^FileError\nBłąd otwarcia pliku do zapisu: \\r\\n\\r\\n$0\\r\\n\\r\\nWybierz 'Anuluj', aby przerwać instalację,\\r\\n'Ponów', aby ponowić zapis do pliku lub\\r\\n'Ignoruj', aby pominąć ten plik.\n# ^FileError_NoIgnore\nBłąd otwarcia pliku do zapisu: \\r\\n\\r\\n$0\\r\\n\\r\\nWybierz 'Ponów', aby ponowić zapis do pliku lub\\r\\n'Anuluj', aby przerwać instalację.\n# ^CantWrite\n\"Nie można zapisać: \"\n# ^CopyFailed\nBłąd kopiowania\n# ^CopyTo\n\"Kopiuj do \"\n# ^Registering \n\"Rejestrowanie: \"\n# ^Unregistering\n\"Wyrejestrowywanie: \"\n# ^SymbolNotFound\n\"Nie można odnaleźć symbolu: \"\n# ^CouldNotLoad\n\"Nie można wczytać: \"\n#^CreateFolder\n\"Utwórz folder: \"\n# ^CreateShortcut\n\"Utwórz skrót: \"\n# ^CreatedUninstaller\n\"Utworzono deinstalator: \"\n# ^Delete\n\"Usuń plik: \"\n# ^DeleteOnReboot\n\"Usuń przy ponownym uruchomieniu: \"\n# ^ErrorCreatingShortcut\n\"Błąd tworzenia skrótu: \"\n# ^ErrorCreating\n\"Błąd tworzenia: \"\n# ^ErrorDecompressing\nBłąd wyodrębniania danych! Uszkodzony instalator?\n# ^ErrorRegistering\nBłąd rejestracji pliku DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Uruchom: \"\n# ^Extract\n\"Wyodrębnij: \"\n# ^ErrorWriting\n\"Wyodrębnij: błąd zapisu do pliku \"\n# ^InvalidOpcode\nInstalator uszkodzony: nieprawidłowy kod operacji\n# ^NoOLE\n\"Brak OLE dla: \"\n# ^OutputFolder\n\"Folder wyjściowy: \"\n# ^RemoveFolder\n\"Usuń folder: \"\n# ^RenameOnReboot\n\"Zmień nazwę przy ponownym uruchomieniu: \"\n# ^Rename\n\"Zmień nazwę: \"\n# ^Skipped\n\"Pominięte: \"\n# ^CopyDetails\nKopiuj szczegóły do schowka\n# ^LogInstall\nRejestruj przebieg instalacji\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Polish.nsh",
    "content": "﻿;Language: Polish (1045)\n;By Piotr Murawski & Rafał Lampe\n;Updated by cube and SYSTEMsoft Group\n;Updated by Mateusz Gola (aka Prozac) - http://www.avirecomp.com\n;Updated by Paweł Porwisz (http://www.pawelporwisz.pl)\n\n!insertmacro LANGFILE \"Polish\" = \"Polski\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Witamy w kreatorze instalacji $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Kreator ten pomoże Ci zainstalować $(^NameDA).$\\r$\\n$\\r$\\nZalecane jest zamknięcie wszystkich uruchomionych programów przed rozpoczęciem instalacji. Pozwoli to na uaktualnienie niezbędnych plików systemowych bez konieczności ponownego uruchamiania komputera.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Witamy w kreatorze deinstalacji $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Kreator ten pomoże Ci odinstalować $(^NameDA).$\\r$\\n$\\r$\\nPrzed rozpoczęciem deinstalacji, upewnij się, że $(^NameDA) nie jest uruchomiony.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Umowa licencyjna\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Przed instalacją $(^NameDA) zapoznaj się z warunkami licencji.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Jeżeli akceptujesz warunki umowy, kliknij przycisk 'Zgadzam się', aby kontynuować. Musisz zaakceptować warunki umowy, aby zainstalować $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jeżeli akceptujesz warunki umowy, zaznacz poniższe pole wyboru, aby kontynuować. Musisz zaakceptować warunki umowy, aby zainstalować $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jeżeli akceptujesz warunki umowy, wybierz pierwszą z poniższych opcji, aby kontynuować. Musisz zaakceptować warunki umowy, aby zainstalować $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Umowa licencyjna\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Przed deinstalacją $(^NameDA) zapoznaj się z warunkami licencji.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Jeżeli akceptujesz warunki umowy, kliknij przycisk 'Zgadzam się', aby kontynuować. Musisz zaakceptować warunki umowy, aby odinstalować $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Jeżeli akceptujesz warunki umowy, zaznacz poniższe pole wyboru, aby kontynuować. Musisz zaakceptować warunki umowy, aby odinstalować $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Jeżeli akceptujesz warunki umowy, wybierz pierwszą z poniższych opcji, aby kontynuować. Musisz zaakceptować warunki umowy, aby odinstalować $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Naciśnij klawisz Page Down, aby zobaczyć dalszą część umowy.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Wybierz komponenty\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Wybierz komponenty $(^NameDA), które chcesz zainstalować.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Wybierz komponenty\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Wybierz, które elementy $(^NameDA) chcesz odinstalować.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Opis\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Przesuń kursor myszy nad komponent, aby zobaczyć jego opis.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Wybierz komponent, aby zobaczyć jego opis.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Wybierz lokalizację dla instalacji\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Wybierz folder, w którym chcesz zainstalować $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Wybierz lokalizację dla deinstalacji\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Wybierz folder, z którego chcesz odinstalować $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalacja\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Proszę czekać, trwa instalacja $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Zakończono instalację\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Instalacja zakończona pomyślnie.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalacja przerwana\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Instalacja nie została zakończona pomyślnie.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Deinstalacja\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Proszę czekać, trwa deinstalacja $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Zakończono deinstalację\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Odinstalowanie zakończone pomyślnie.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Deinstalacja przerwana\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Deinstalacja nie została zakończona pomyślnie.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Kończenie pracy kreatora instalacji $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) został pomyślnie zainstalowany na Twoim komputerze.$\\r$\\n$\\r$\\nKliknij przycisk 'Zakończ', aby zakończyć działanie instalatora.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Twój komputer musi zostać ponownie uruchomiony, aby zakończyć instalację $(^NameDA). Czy chcesz teraz ponownie uruchomić komputer?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Kończenie pracy kreatora deinstalacji $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) został odinstalowany z Twojego komputera.$\\r$\\n$\\r$\\nKliknij przycisk 'Zakończ', aby zakończyć działanie deinstalatora.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Twój komputer musi zostać ponownie uruchomiony w celu zakończenia deinstalacji $(^NameDA). Czy chcesz teraz ponownie uruchomić komputer?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Uruchom ponownie teraz\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Sam uruchomię ponownie komputer później\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Uruchom $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Pokaż plik ReadMe\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Zakończ\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Wybierz folder w menu Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Wybierz folder menu Start, w którym zostaną umieszczone skróty do $(^NameDA)\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Wybierz folder w menu Start, w którym chciałbyś umieścić skróty do programu. Możesz także utworzyć nowy folder wpisując jego nazwę.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nie twórz skrótów\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Odinstaluj $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Usuń $(^NameDA) z Twojego komputera.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Czy na pewno chcesz zakończyć działanie instalatora $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Czy na pewno chcesz przerwać proces deinstalacji $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Wybierz użytkowników\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Wybierz, dla których użytkowników chcesz zainstalować $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Wybierz, czy chcesz zainstalować $(^NameDA) tylko dla siebie, czy dla wszystkich użytkowników tego komputera. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Zainstaluj dla wszystkich użytkowników tego komputera\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Zainstaluj tylko dla mnie\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Portuguese.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n2070\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation v4.0.3 by DragonSoull <dragonsoull@madalien.tk> with help from Dre` - Updated by Ramon\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalação de $(^Name)\n# ^UninstallCaption\nDesinstalação de $(^Name)\n# ^LicenseSubCaption\n: Contrato de Licença\n# ^ComponentsSubCaption\n: Opções de instalação\n# ^DirSubCaption\n: Diretório de instalação\n# ^InstallingSubCaption\n: Instalando Ficheiros\n# ^CompletedSubCaption\n: Concluído\n# ^UnComponentsSubCaption\n: Opções de Desinstalação\n# ^UnDirSubCaption\n: Pasta de Desinstalação\n# ^ConfirmSubCaption\n: Confirmação\n# ^UninstallingSubCaption\n: Desinstalando\n# ^UnCompletedSubCaption\n: Concluído\n# ^BackBtn\n< &Anterior\n# ^NextBtn\n&Seguinte >\n# ^AgreeBtn\n&Aceito\n# ^AcceptBtn\nEu &aceito os termos do Contrato de Licença\n# ^DontAcceptBtn\nEu &não aceito os termos do Contrato de Licença\n# ^InstallBtn\n&Instalar\n# ^UninstallBtn\n&Desinstalar\n# ^CancelBtn\nCancelar\n# ^CloseBtn\n&Fechar\n# ^BrowseBtn\n&Procurar...\n# ^ShowDetailsBtn\nVer &Detalhes\n# ^ClickNext\nClique em 'Seguinte' para continuar.\n# ^ClickInstall\nClique em 'Instalar' para iniciar a instalação.\n# ^ClickUninstall\nClique em 'Desinstalar' para iniciar a desinstalação.\n# ^Name\nNome\n# ^Completed\nConcluído\n# ^LicenseText\nPor favor reveja o acordo de licença antes de instalar $(^NameDA). Se concorda com todos os termos da licença, clique em 'Aceito'.\n# ^LicenseTextCB\nPor favor reveja o acordo de licença antes de instalar $(^NameDA). Se concorda com todos os termos da licença, clique na caixa de seleção abaixo. $_CLICK\n# ^LicenseTextRB\nPor favor reveja o acordo de licença antes de instalar $(^NameDA). Se concorda com todos os termos da licença, escolha a primeira opção abaixo. $_CLICK\n# ^UnLicenseText\nPor favor reveja o acordo de licença antes de desinstalar $(^NameDA). Se concorda com todos os termos da licença, clique em 'Aceito'.\n# ^UnLicenseTextCB\nPor favor reveja o acordo de licença antes de desinstalar $(^NameDA). Se concorda com todos os termos da licença, clique na caixa de seleção abaixo. $_CLICK\n# ^UnLicenseTextRB\nPor favor reveja o acordo de licença antes de desinstalar $(^NameDA). Se concorda com todos os termos da licença, escolha a primeira opção abaixo. $_CLICK\n# ^Custom\nPersonalizado\n# ^ComponentsText\nMarque os componentes que deseja instalar e desmarque os componentes que não deseja instalar. $_CLICK\n# ^ComponentsSubText1\nEscolha o tipo de instalação:\n# ^ComponentsSubText2_NoInstTypes\nEscolha os componentes para instalar:\n# ^ComponentsSubText2\nOu, escolha os componentes opcionais que deseja instalar:\n# ^UnComponentsText\nMarque os componentes que queira desinstalar e vice versa. $_CLICK\n# ^UnComponentsSubText1\nEscolha o tipo de desinstalação: \n# ^UnComponentsSubText2_NoInstTypes\nEscolha os componentes para desinstalar:\n# ^UnComponentsSubText2\nOu, escolha os componentes opcionais que queira desinstalar:\n# ^DirText\nO $(^NameDA) será instalado na seguinte pasta. Para instalar numa pasta diferente, clique em 'Procurar...' e escolha outra pasta. $_CLICK\n# ^DirSubText\nPasta de Destino\n# ^DirBrowseText\nEscolha uma pasta para instalar o $(^NameDA):\n# ^UnDirText\nO $(^NameDA) será desinstalado da seguinte pasta. Para desinstalar de uma pasta diferente, clique em 'Procurar...' e escolha outra pasta. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nEscolha uma pasta de onde será desinstalado o $(^NameDA):\n# ^SpaceAvailable\n\"Espaço disponível: \"\n# ^SpaceRequired\n\"Espaço necessário: \"\n# ^UninstallingText\n$(^NameDA) será desinstalado da seguinte pasta. $_CLICK\n# ^UninstallingSubText\nDesinstalando de:\n# ^FileError\nErro ao abrir ficheiro para escrita: \\r\\n\\t\"$0\"\\r\\nClique em Abortar para abortar a instalação,\\r\\nRepetir para tentar novamente a escrita do ficheiro, ou\\r\\nIgnorar para ignorar este ficheiro.\n# ^FileError_NoIgnore\nErro ao abrir ficheiro para escrita: \\r\\n\\t\"$0\"\\r\\nClique em Repetir para tentar novamente a gravação do ficheiro, ou\\r\\nCancelar para abortar a instalação.\n# ^CantWrite\n\"Não foi possível escrever: \"\n# ^CopyFailed\nFalha ao copiar\n# ^CopyTo\n\"Copiar para \"\n# ^Registering\n\"Registando: \"\n# ^Unregistering\n\"Desregistando: \"\n# ^SymbolNotFound\n\"Símbolo não encontrado: \"\n# ^CouldNotLoad\n\"Não foi possível carregar: \"\n# ^CreateFolder\n\"Criando diretório: \"\n# ^CreateShortcut\n\"Criando atalho: \"\n# ^CreatedUninstaller\n\"Criando desinstalador: \"\n# ^Delete\n\"Apagando ficheiro: \"\n# ^DeleteOnReboot\n\"Apagar ao reiniciar: \"\n# ^ErrorCreatingShortcut\n\"Erro ao criar atalho: \"\n# ^ErrorCreating\n\"Erro ao criar: \"\n# ^ErrorDecompressing\nErro ao descomprimir dados! Instalador corrompido?\n# ^ErrorRegistering\nErro ao registar DLL\n# ^ExecShell\n\"Executando pelo Shell: \"\n# ^Exec\n\"Executando: \"\n# ^Extract\n\"Extraindo: \"\n# ^ErrorWriting\n\"Extraindo: erro ao escrever ficheiro \"\n# ^InvalidOpcode\nInstalador corrompido: código de operação inválido\n# ^NoOLE\n\"Sem OLE para: \"\n# ^OutputFolder\n\"Pasta de destino: \"\n# ^RemoveFolder\n\"Removendo pasta: \"\n# ^RenameOnReboot\n\"Renomear ao reiniciar: \"\n# ^Rename\n\"Renomeando: \"\n# ^Skipped\n\"Ignorado: \"\n# ^CopyDetails\nCopiar detalhes para a Área de Transfêrencia\n# ^LogInstall\nRegistar processo de instalação\n# ^Byte\nB\n# kilo\n K\n# mega\n M\n# giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Portuguese.nsh",
    "content": "﻿;Language: Portuguese (2070)\n;By Ramon <ramon@netcabo.pt>\n\n!insertmacro LANGFILE \"Portuguese\" = \"Português\" \"Portugues\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bem vindo ao Assistente de Instalação do $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Este assistente ajudá-lo-á durante a instalação do $(^NameDA).$\\r$\\n$\\r$\\nÉ recomendado que feche todas as outras aplicações antes de iniciar a Instalação. Isto permitirá que o Instalador actualize ficheiros relacionados com o sistema sem necessidade de reiniciar o computador.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bem vindo ao Assistente de desinstalação do $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Este assistente ajudá-lo-á durante a desinstalação do $(^NameDA).$\\r$\\n$\\r$\\nAntes de iniciar a desinstalação, certifique-se de que o $(^NameDA) não está em execução.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Contrato de Licença\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Por favor, verifique os termos da licença antes de instalar o $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Se aceitar os termos da licença, clique em 'Aceito' para continuar. Deverá aceitar o contrato para instalar o $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se aceitar os termos da licença, clique na caixa de seleção abaixo. Deverá aceitar o contrato para instalar o $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se aceitar os termos da licença, selecione a primeira opção abaixo. Você deve aceitar o contrato para instalar o $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Contrato de Licença\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Por favor, verifique os termos da licença antes de desinstalar o $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Se aceitar os termos da licença, clique em 'Aceito' para continuar. Deverá aceitar o contrato para desinstalar o $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se aceitar os termos da licença, clique na caixa de seleção abaixo. Deverá aceitar o contrato para desinstalar o $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se aceitar os termos da licença, selecione a primeira opção abaixo. Você deve aceitar o contrato para desinstalar o $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Tecle Page Down para ver o restante da licença.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Escolha de Componentes\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Escolha quais as características do $(^NameDA) que deseja instalar.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Escolher Componentes\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Escolha quais as características do $(^NameDA) que deseja desinstalar.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descrição\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Posicione o rato sobre um componente para ver a sua descrição.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Seleccione um componente para ver a sua descrição.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Escolha do Local da Instalação\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Escolha a pasta na qual deseja instalar o $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Escolha o Local de desinstalação\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Escolha a pasta de onde pretende desinstalar o $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalando\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Por favor, aguarde enquanto o $(^NameDA) está sendo instalado.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalação Completa\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"A instalação foi concluída com sucesso.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalação Abortada\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"A instalação não foi concluída com sucesso.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Desinstalando\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Por favor, aguarde enquanto o $(^NameDA) está sendo desinstalado.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Desinstalação Completa\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"A desinstalação foi concluída com sucesso.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Desinstalação Abortada\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"A desinstalação não foi concluída com sucesso\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Concluindo o Assistente de Instalação do $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) foi instalado no seu computador.$\\r$\\n$\\r$\\nClique em Terminar para fechar este assistente.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"O seu computador deve ser reiniciado para concluír a instalação do $(^NameDA). Deseja reiniciar agora?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Concluíndo o assistente de desisntalação do $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) foi removido do seu computador.$\\r$\\n$\\r$\\nClique em Terminar para fechar este assistente.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"O seu computador deve ser reiniciado para concluír a desinstalação do $(^NameDA). Deseja reiniciar agora?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reiniciar Agora\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Eu quero reiniciar manualmente depois\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Executar $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Mostrar Leiame\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Terminar\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Escolha uma Pasta do Menu Iniciar\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Escolha uma pasta do Menu Iniciar para os atalhos do programa.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Selecione uma pasta do Menu Iniciar em que deseja criar os atalhos do programa. Você pode também digitar um nome para criar uma nova pasta. \"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Não criar atalhos\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstalar $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Remover o $(^NameDA) do seu computador.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Deseja realmente cancelar a instalação do $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Deseja realmente cancelar a desinstalação do $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Escolha utilizadores\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Escolha para quais utilizadores deseja instalar o $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Escolha se deseja instalar o $(^NameDA) apenas para si ou para todos os utilizadores. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instalar para todos os utilizadores\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instalar apenas para si\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/PortugueseBR.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1046\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Diego Pedroso and Felipe, reviewed by Georger Araújo\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalação do $(^Name)\n# ^UninstallCaption\nDesinstalação do $(^Name)\n# ^LicenseSubCaption\n: Acordo de Licença\n# ^ComponentsSubCaption\n: Opções da Instalação\n# ^DirSubCaption\n: Pasta da Instalação\n# ^InstallingSubCaption\n: Instalando\n# ^CompletedSubCaption\n: Completado\n# ^UnComponentsSubCaption\n: Opções da Desinstalação\n# ^UnDirSubCaption\n: Pasta da Desinstalação\n# ^ConfirmSubCaption\n: Confirmação\n# ^UninstallingSubCaption\n: Desinstalando\n# ^UnCompletedSubCaption\n: Completado\n# ^BackBtn\n< &Voltar\n# ^NextBtn\n&Próximo >\n# ^AgreeBtn\nEu &Concordo\n# ^AcceptBtn\nEu &aceito os termos do Acordo de Licença\n# ^DontAcceptBtn\nEu &não aceito os termos do Acordo de Licença\n# ^InstallBtn\n&Instalar\n# ^UninstallBtn\n&Desinstalar\n# ^CancelBtn\nCancelar\n# ^CloseBtn\n&Fechar\n# ^BrowseBtn\nP&rocurar...\n# ^ShowDetailsBtn\nMostrar &detalhes\n# ^ClickNext\nClique em Próximo pra continuar.\n# ^ClickInstall\nClique em Instalar pra iniciar a instalação.\n# ^ClickUninstall\nClique em Desinstalar pra iniciar a desinstalação.\n# ^Name\nNome\n# ^Completed\nCompletado\n# ^LicenseText\nPor favor reveja o acordo de licença antes de instalar o $(^NameDA). Se você aceita todos os termos do acordo clique em Eu Concordo.\n# ^LicenseTextCB\nPor favor reveja o acordo de licença antes de instalar o $(^NameDA). Se você aceita todos os termos do acordo clique na caixa de seleção abaixo. $_CLICK\n# ^LicenseTextRB\nPor favor reveja o acordo de licença antes de instalar o $(^NameDA). Se você aceita todos os termos do acordo selecione a primeira opção abaixo. $_CLICK\n# ^UnLicenseText\nPor favor reveja o acordo de licença antes de desinstalar o $(^NameDA). Se você aceita todos os termos do acordo clique em Eu Concordo.\n# ^UnLicenseTextCB\nPor favor reveja o acordo de licença antes de desinstalar o $(^NameDA). Se você aceita todos os termos do acordo clique na caixa de seleção abaixo. $_CLICK\n# ^UnLicenseTextRB\nPor favor reveja o acordo de licença antes de desinstalar o $(^NameDA). Se você aceita todos os termos do acordo selecione a primeira opção abaixo. $_CLICK\n# ^Custom\nPersonalizar\n# ^ComponentsText\nMarque os componentes que você quer instalar e desmarque os componentes que você não quer instalar. $_CLICK\n# ^ComponentsSubText1\nSelecione o tipo de instalação:\n# ^ComponentsSubText2_NoInstTypes\nSelecione os componentes a instalar:\n# ^ComponentsSubText2\nOu selecione os componentes opcionais que você deseja instalar:\n# ^UnComponentsText\nMarque os componentes que você quer desinstalar e desmarque os componentes que você não quer desinstalar. $_CLICK\n# ^UnComponentsSubText1\nSelecione o tipo de desinstalação:\n# ^UnComponentsSubText2_NoInstTypes\nSelecione os componentes a desinstalar:\n# ^UnComponentsSubText2\nOu selecione os componentes opcionais que você deseja desinstalar:\n# ^DirText\nO Instalador instalará o $(^NameDA) na seguinte pasta. Pra instalar em uma pasta diferente clique em Procurar e selecione outra pasta. $_CLICK\n# ^DirSubText\nPasta Destino\n# ^DirBrowseText\nSelecione a pasta pra instalar o $(^NameDA):\n# ^UnDirText\nO Instalador desinstalará o $(^NameDA) da seguinte pasta. Pra desinstalar de uma pasta diferente clique em Procurar e selecione outra pasta. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSelecione a pasta pra desinstalar o $(^NameDA):\n# ^SpaceAvailable\n\"Espaço disponível: \"\n# ^SpaceRequired\n\"Espaço requerido: \"\n# ^UninstallingText\nO $(^NameDA) será desinstalado da seguinte pasta. $_CLICK\n# ^UninstallingSubText\nDesinstalando de:\n# ^FileError\nErro ao abrir o arquivo pra gravação: \\r\\n\\r\\n$0\\r\\n\\r\\nClique em Abortar pra parar a instalação,\\r\\nRepetir pra tentar de novo ou em\\r\\nIgnorar pra ignorar este arquivo.\n# ^FileError_NoIgnore\nErro ao abrir o arquivo pra gravação: \\r\\n\\r\\n$0\\r\\n\\r\\nClique em Repetir pra tentar de novo ou em\\r\\nCancelar pra parar a instalação.\n# ^CantWrite\n\"Não pôde gravar: \"\n# ^CopyFailed\nFalhou em copiar\n# ^CopyTo\n\"Copiar para \"\n# ^Registering\n\"Registrando: \"\n# ^Unregistering\n\"Desfazendo o registro: \"\n# ^SymbolNotFound\n\"Não pôde achar o símbolo: \"\n# ^CouldNotLoad\n\"Não pôde carregar: \"\n# ^CreateFolder\n\"Criar pasta: \"\n# ^CreateShortcut\n\"Criar atalho: \"\n# ^CreatedUninstaller\n\"Desinstalador criado: \"\n# ^Delete\n\"Apagar o arquivo: \"\n# ^DeleteOnReboot\n\"Apagar ao reiniciar: \"\n# ^ErrorCreatingShortcut\n\"Erro ao criar o atalho: \"\n# ^ErrorCreating\n\"Erro ao criar: \"\n# ^ErrorDecompressing\nErro ao descomprimir os dados! Instalador corrompido?\n# ^ErrorRegistering\nErro ao registar a DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Executar: \"\n# ^Extract\n\"Extrair: \"\n# ^ErrorWriting\n\"Extrair: erro ao gravar no arquivo \"\n# ^InvalidOpcode\nInstalador corrompido: opcode inválido\n# ^NoOLE\n\"Sem OLE para: \"\n# ^OutputFolder\n\"Pasta de saída: \"\n# ^RemoveFolder\n\"Remover a pasta: \"\n# ^RenameOnReboot\n\"Renomear ao reiniciar: \"\n# ^Rename\n\"Renomear: \"\n# ^Skipped\n\"Ignorado: \"\n# ^CopyDetails\nCopiar os Detalhes pra Área de Transferência\n# ^LogInstall\nGravar no log o processo de instalação\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/PortugueseBR.nsh",
    "content": "﻿;Language: Brazilian Portuguese (1046)\n;By Diego Pedroso and Felipe\n\n!insertmacro LANGFILE \"PortugueseBR\" \"Brazilian Portuguese\" \"Português Brasileiro\" \"Portugues Brasileiro\" ; Veja \\Include\\LangFile.nsh pra uma descriçaõ destes parâmetros\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bem-vindo ao Instalador do $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"O instalador guiará você através da instalação do $(^NameDA).$\\r$\\n$\\r$\\nÉ recomendado que você feche todos os outros aplicativos antes de iniciar o instalador. Isto tornará possível atualizar os arquivos de sistema relevantes sem ter que reiniciar seu computador.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bem-vindo ao Desinstalador do $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Este assistente guiará você através da desinstalação do $(^NameDA).$\\r$\\n$\\r$\\nAntes de iniciar a desinstalação tenha certeza de que o $(^NameDA) não está em execução.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Acordo de Licença\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Por favor reveja os termos da licença antes de instalar o $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Se você aceita os termos do acordo clique em Eu Concordo pra continuar. Você deve aceitar o acordo pra instalar o $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se você aceita os termos do acordo clique na caixa de seleção abaixo. Você deve aceitar o acordo pra instalar o $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se você aceita os termos do acordo selecione a primeira opção abaixo. Você deve aceitar o acordo pra instalar o $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Acordo de Licença\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Por favor reveja os termos da licença antes de desinstalar o $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Se você aceita os termos do acordo clique em Eu Concordo pra continuar. Você deve aceitar o acordo pra desinstalar o $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Se você aceita os termos do acordo clique na caixa de seleção abaixo. Você deve aceitar o acordo pra desinstalar o $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Se você aceita os termos do acordo selecione a primeira opção abaixo. Você deve aceitar o acordo pra desinstalar o $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Pressione Page Down pra ver o resto do acordo.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Escolher Componentes\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Escolha quais funções do $(^NameDA) você quer instalar.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Escolher Componentes\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Escolha quais funções do $(^NameDA) você quer desinstalar.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descrição\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Posicione seu mouse sobre um componente pra ver a descrição dele.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Selecione um componente pra ver a descrição dele.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Escolha o Local da Instalação\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Escolha a pasta na qual instalar o $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Escolha o Local da Desinstalação\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Escolha a pasta da qual desinstalar o $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalando\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Por favor espere enquanto o $(^NameDA) está sendo instalado.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalação Completa\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"A instalação foi completada com sucesso.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalação Abortada\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"A instalação não foi completada com sucesso.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Desinstalando\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Por favor espere enquanto o $(^NameDA) está sendo desinstalado.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Desinstalação Completa\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"A desinstalação foi completada com sucesso.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Desinstalação Abortada\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"A desinstalação não foi completada com sucesso.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Completando a instalação do $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"O $(^NameDA) foi instalado no seu computador.$\\r$\\n$\\r$\\nClique em Concluir pra fechar o instalador.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Seu computador deve ser reiniciado a fim de completar a instalação do $(^NameDA). Você quer reiniciar agora?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Completando a desinstalação do $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"O $(^NameDA) foi desinstalado do seu computador.$\\r$\\n$\\r$\\nClique em Concluir pra fechar o instalador.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Seu computador deve ser reiniciado a fim de completar a desinstalação do $(^NameDA). Você quer reiniciar agora?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reiniciar agora\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Eu quero reiniciar manualmente mais tarde\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Executar o $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Mostrar o Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Concluir\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Escolha a Pasta do Menu Iniciar\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Escolha uma pasta do Menu Iniciar para os atalhos do $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Selecione a pasta do Menu Iniciar na qual você gostaria de criar os atalhos do programa. Você pode também inserir um nome pra criar uma nova pasta.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Não criar atalhos\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstalar o $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Remover o $(^NameDA) do seu computador.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Você tem certeza que você quer sair da Instalação do $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Você tem certeza que você quer sair da Desinstalação do $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Escolher Usuários\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Escolha pra quais usuários você quer instalar o $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Selecione se você quer instalar o $(^NameDA) só pra si mesmo ou pra todos os usuários deste computador. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instalar pra qualquer um usando este computador\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instalar apenas pra mim\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Romanian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1048\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Cristian Pirvu (pcristip@yahoo.com) v6\n# Revision by Sorin Sbarnea (sorin@intersol.ro)      v5.1\n# and Sorin Sbarnea INTERSOL SRL (sorin@intersol.ro) v4\n# New revision by George Radu (georadu@hotmail.com)\n# New revision by Iulian Dogariu (iulian@jayomega.net)\n#   - Use Romanian letters ăâîşţ\n#   - Use imperative forms on buttons\n#   - Replace some neologisms\n# New revision by Vlad Rusu (vlad@bitattack.ro)\n#\t- \"Rasfoieşte\" replaced with \"Alege\" - more appropriate\n#\t- \"Elimină\" related terms replaced with more appropriate \"Dezinstalează\"\n#\t- Fixed: Wrong translation in ^FileError and ^FileError_NoIgnore -> no translation\n#\t  needed Abort/Retry/Ignore, as these are not translated into local language, OS related\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalare $(^Name)\n# ^UninstallCaption\nDezinstalare $(^Name)\n# ^LicenseSubCaption\n: Contract de licenţă\n# ^ComponentsSubCaption\n: Opţiuni instalare\n# ^DirSubCaption\n: Directorul destinaţie\n# ^InstallingSubCaption\n: În curs de instalare\n# ^CompletedSubCaption\n: Instalare terminată\n# ^UnComponentsSubCaption\n: Opţiuni dezinstalare\n# ^UnDirSubCaption\n: Directorul de dezinstalare\n# ^ConfirmSubCaption\n: Confirmă\n# ^UninstallingSubCaption\n: În curs de dezinstalare\n# ^UnCompletedSubCaption\n: Termină\n# ^BackBtn\n< Îna&poi\n# ^NextBtn\nÎna&inte >\n# ^AgreeBtn\n&De acord\n# ^AcceptBtn\n&Accept termenii contractului de licenţă\n# ^DontAcceptBtn\nNu accept termenii contractului de licenţă\n# ^InstallBtn\n&Instalează\n# ^UninstallBtn\n&Dezinstalează\n# ^CancelBtn\n&Renunţă\n# ^CloseBtn\nÎn&chide\n# ^BrowseBtn\n&Alege...\n# ^ShowDetailsBtn\nArată &detalii\n# ^ClickNext\nApăsaţi Înainte pentru a continua.\n# ^ClickInstall\nApăsaţi Instalează pentru a începe instalarea.\n# ^ClickUninstall\nApăsaţi Dezinstalează pentru a începe dezinstalarea.\n# ^Name\nNume\n# ^Completed\nTerminat\n# ^LicenseText\nCitiţi cu atenţie contractul de licenţă înainte de a instala $(^NameDA). Dacă acceptaţi termenii contractului de licenţă, apăsaţi butonul De acord.\n# ^LicenseTextCB\nCitiţi cu atenţie contractul de licenţă înainte de a instala $(^NameDA). Dacă acceptaţi termenii contractului de licenţă, bifaţi căsuţa de mai jos. $_CLICK\n# ^LicenseTextRB\nCitiţi cu atenţie contractul de licenţă înainte de a instala $(^NameDA). Dacă acceptaţi termenii contractului de licenţă, selectaţi prima opţiune de mai jos. $_CLICK\n# ^UnLicenseText\nCitiţi cu atenţie contractul de licenţă înainte de a dezinstala $(^NameDA). Dacă acceptaţi termenii contractului de licenţă, apăsaţi butonul De acord.\n# ^UnLicenseTextCB\nCitiţi cu atenţie contractul de licenţă înainte de a dezinstala $(^NameDA). Dacă acceptaţi termenii contractului de licenţă, bifaţi căsuţa de mai jos. $_CLICK\n# ^UnLicenseTextRB\nCitiţi cu atenţie contractul de licenţă înainte de a dezinstala $(^NameDA). Dacă acceptaţi termenii contractului de licenţă, selectaţi prima opţiune de mai jos. $_CLICK\n# ^Custom\nPersonalizată\n# ^ComponentsText\nAlegeţi componentele pe care doriţi să le instalaţi. $_CLICK\n# ^ComponentsSubText1\nAlegeţi tipul instalării:\n# ^ComponentsSubText2_NoInstTypes\nAlegeţi componentele ce urmează a fi instalate:\n# ^ComponentsSubText2\nSau, alegeţi componentele opţionale pe care doriţi să le instalaţi:\n# ^UnComponentsText\nAlegeţi componentele pe care doriţi să le dezinstalaţi. $_CLICK\n# ^UnComponentsSubText1\nAlegeţi tipul de dezinstalare:\n# ^UnComponentsSubText2_NoInstTypes\nAlegeţi componentele ce urmează a fi dezinstalate:\n# ^UnComponentsSubText2\nSau, alegeţi componentele opţionale pe care doriţi să le dezinstalaţi:\n# ^DirText\n$(^NameDA) se va instala în următorul director. Pentru a alege altă destinaţie, apăsaţi Alege şi alegeţi alt director. $_CLICK\n# ^DirSubText\nDirector destinaţie\n# ^DirBrowseText\nAlegeţi directorul în care doriţi să instalaţi $(^NameDA):\n# ^UnDirText\n$(^NameDA) se va dezinstala din următorul director. Pentru a dezinstala din alt director, apăsaţi Alege şi alegeţi alt director. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nAlegeţi directorul de dezinstalare al $(^NameDA):\n# ^SpaceAvailable\n\"Spaţiu disponibil: \"\n# ^SpaceRequired\n\"Spaţiu necesar: \"\n# ^UninstallingText\nAceastă aplicaţie va dezinstala $(^NameDA) din computerul Dv. $_CLICK\n# ^UninstallingSubText\nDezinstalare din:\n# ^FileError\nEroare la scrierea fişierului: \\r\\n\\t\"$0\"\\r\\nApăsaţi Abort pentru oprirea instalării,\\r\\nRetry pentru a mai încerca o dată scrierea fişierului, \\r\\nIgnore pentru a trece peste acest fişier.\n# ^FileError_NoIgnore\nEroare la scrierea fişierului: \\r\\n\\t\"$0\"\\r\\nApăsaţi Retry pentru a mai încerca o dată, sau\\r\\nAbort pentru oprirea instalării.\n# ^CantWrite\n\"Nu am putut scrie: \"\n# ^CopyFailed\nCopierea a eşuat\n# ^CopyTo\n\"Copiere în \"\n# ^Registering\n\"Se înregistrează: \"\n# ^Unregistering\n\"Se dezînregistrează din registru: \"\n# ^SymbolNotFound\n\"Simbolul nu a fost găsit: \"\n# ^CouldNotLoad\n\"Nu am putut încărca: \"\n# ^CreateFolder\n\"Creare director: \"\n# ^CreateShortcut\n\"Creare comandă rapidă: \"\n# ^CreatedUninstaller\n\"S-a creat aplicaţia de dezinstalare: \"\n# ^Delete\n\"Ştergere fişier: \"\n# ^DeleteOnReboot\n\"Ştergere la repornire: \"\n# ^ErrorCreatingShortcut\n\"Eroare la crearea comenzii rapide: \"\n# ^ErrorCreating\n\"Eroare la creare: \"\n# ^ErrorDecompressing\nEroare la dezarhivarea datelor! Aplicatia de instalare este defectă?\n# ^ErrorRegistering\nEroare la Înregistrarea DLL-ului\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Executare: \"\n# ^Extract\n\"Extragere: \"\n# ^ErrorWriting\n\"Extragere: eroare la scriere în fişier \"\n# ^InvalidOpcode\nAplicaţie de instalare defectă: opcode incorect\n# ^NoOLE\n\"Nu există OLE pentru: \"\n# ^OutputFolder\n\"Directorul destinaţie: \"\n# ^RemoveFolder\n\"Ştergere destinaţie: \"\n# ^RenameOnReboot\n\"Redenumire la repornirea computerului: \"\n# ^Rename\n\"Redenumire: \"\n# ^Skipped\n\"Sărite: \"\n# ^CopyDetails\nCopiere detalii în clipboard\n# ^LogInstall\nJurnal proces instalare\n# ^Byte\nO\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Romanian.nsh",
    "content": "﻿;Language: Romanian (1048)\n;Translated by Cristian Pirvu (pcristip@yahoo.com)\n;Updates by Sorin Sbarnea - INTERSOL SRL (sbarneasorin@intersol.ro) - ROBO Design (www.robodesign.ro)\n;New revision by George Radu (georadu@hotmail.com) http://mediatae.3x.ro\n;New revision by Vlad Rusu (vlad@bitattack.ro)\n;\t- Use Romanian letters ăâîşţ\n;\t- \".. produsului\" removed as unnecessary\n;\t- \"Elimină\" related terms replaced with more appropriate \"Dezinstalează\"\n;\t- Misc language tweaks\n\n!insertmacro LANGFILE \"Romanian\" = \"Română\" \"Romana\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bine aţi venit la instalarea $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Această aplicaţie va instala $(^NameDA).$\\r$\\n$\\r$\\nEste recomandat să închideţi toate aplicaţiile înainte de începerea procesului de instalare. Acest lucru vă poate asigura un proces de instalare fără erori sau situaţii neprevăzute.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bine aţi venit la dezinstalarea $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Această aplicaţie va dezinstala $(^NameDA).$\\r$\\n$\\r$\\nEste recomandat să închideţi toate aplicaţiile înainte de începerea procesului de dezinstalare. Acest lucru vă poate asigura un proces de dezinstalare fără erori sau situaţii neprevăzute.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Contract de licenţă\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Citiţi cu atenţie termenii contractului de licenţă înainte de a instala $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Dacă acceptaţi termenii contractului de licenţă, apăsati De Acord. Pentru a instala $(^NameDA) trebuie să acceptaţi termenii din contractul de licenţă.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Dacă acceptaţi termenii contractului de licenţă, bifaţi căsuţa de mai jos. Pentru a instala $(^NameDA) trebuie să acceptaţi termenii din contractul de licenţă. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Dacă acceptaţi termenii contractului de licenţă, selectaţi prima opţiune de mai jos. Pentru a instala $(^NameDA) trebuie să acceptaţi termenii din contractul de licenţă. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Contract de licenţă\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Citiţi cu atenţie termenii contractului de licenţă înainte de a dezinstala $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Dacă acceptaţi termenii contractului de licenţă, apăsati De Acord. Pentru a dezinstala $(^NameDA) trebuie să acceptaţi termenii din contractul de licenţă.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Dacă acceptaţi termenii contractului de licenţă, bifaţi căsuţa de mai jos. Pentru a dezinstala $(^NameDA) trebuie să acceptaţi termenii din contractul de licenţă. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Dacă acceptaţi termenii contractului de licenţă, selectaţi prima opţiune de mai jos. Pentru a dezinstala $(^NameDA) trebuie să acceptaţi termenii din contractul de licenţă. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Apăsaţi Page Down pentru a vizualiza restul contractului de licenţă.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Selectare componente\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Selectaţi componentele $(^NameDA) pe care doriţi să le instalaţi.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Selectare componente\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Selectaţi componentele $(^NameDA) pe care doriţi să le dezinstalaţi.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descriere\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Aşezaţi mouse-ul deasupra fiecărei componente pentru a vizualiza descrierea acesteia.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Selectare director destinaţie\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Selectaţi directorul în care doriţi să instalaţi $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Selectare director de dezinstalat\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Selectaţi directorul din care doriţi să dezinstalaţi $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"În curs de instalare\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Vă rugăm să aşteptaţi, $(^NameDA) se instalează.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalare terminată\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Instalarea s-a terminat cu succes.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalare anulată\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Instalarea a fost anulată de utilizator.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"În curs de dezinstalare\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Vă rugăm să aşteptaţi, $(^NameDA) se dezinstalează.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Dezinstalare terminată\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Dezinstalarea s-a terminat cu succes.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Dezinstalare anulată\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Dezinstalarea fost anulată de utilizator.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Terminare instalare $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) a fost instalat.$\\r$\\n$\\r$\\nApăsaţi Terminare pentru a încheia instalarea.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Trebuie să reporniţi calculatorul pentru a termina instalarea. Doriţi să-l reporniţi acum?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Terminare dezinstalare $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) a fost dezinstalat.$\\r$\\n$\\r$\\nApăsaţi Terminare pentru a încheia dezinstalarea.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Trebuie să reporniţi calculatorul pentru a termina dezinstalarea. Doriţi să-l reporniţi acum?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reporneşte acum\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Repornesc eu mai târziu\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Executare $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Afişare fişier readme (citeşte-mă).\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Terminare\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Selectare grup Meniul Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Selectaţi un grup in Meniul Start pentru a crea comenzi rapide pentru produs.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Selectaţi grupul din Meniul Start în care vor fi create comenzi rapide pentru produs. Puteţi de asemenea să creaţi un grup nou.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nu doresc comenzi rapide\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Dezinstalare $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Dezinstalare $(^NameDA) din calculatorul dumneavoastră.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Sunteţi sigur(ă) că doriţi să anulaţi instalarea $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Sunteţi sigur(ă) că doriţi să anulaţi dezinstalarea $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Russian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1049\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by Timon [ timon@front.ru ] + 20030919\n# Translation updated by Dmitry Yerokhin [erodim@mail.ru] (20050424)\n# Minor updates by Oleksandr Gavenko (20100514 - patch #226)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nУстановка $(^Name)\n# ^UninstallCaption\nУдаление $(^Name)\n# ^LicenseSubCaption\n: Лицензионное соглашение\n# ^ComponentsSubCaption\n: Параметры установки\n# ^DirSubCaption\n: Папка установки\n# ^InstallingSubCaption\n: Копирование файлов\n# ^CompletedSubCaption\n: Операция завершена\n# ^UnComponentsSubCaption\n: Параметры удаления\n# ^UnDirSubCaption\n: Папка удаления\n# ^ConfirmSubCaption\n: Подтверждение\n# ^UninstallingSubCaption\n: Удаление файлов\n# ^UnCompletedSubCaption\n: Операция завершена\n# ^BackBtn\n< &Назад\n# ^NextBtn\n&Далее >\n# ^AgreeBtn\nПринима&ю\n# ^AcceptBtn\nЯ &принимаю условия соглашения\n# ^DontAcceptBtn\nЯ &не принимаю условия соглашения\n# ^InstallBtn\n&Установить\n# ^UninstallBtn\nУд&алить\n# ^CancelBtn\nОтмена\n# ^CloseBtn\n&Закрыть\n# ^BrowseBtn\nО&бзор ...\n# ^ShowDetailsBtn\n&Детали...\n# ^ClickNext\nНажмите кнопку \"Далее\" для продолжения.\n# ^ClickInstall\nНажмите кнопку \"Установить\", чтобы установить программу.\n# ^ClickUninstall\nНажмите кнопку \"Удалить\", чтобы удалить программу.\n# ^Name\nИмя\n# ^Completed\nГотово\n# ^LicenseText\nПеред установкой $(^NameDA) ознакомьтесь с лицензионным соглашением. Если вы принимаете условия соглашения, нажмите кнопку \"Принимаю\".\n# ^LicenseTextCB\nПеред установкой $(^NameDA) ознакомьтесь с лицензионным соглашением. Если вы принимаете условия соглашения, установите флажок ниже. $_CLICK\n# ^LicenseTextRB\nПеред установкой $(^NameDA) ознакомьтесь с лицензионным соглашением. Если вы принимаете условия соглашения, выберите первый вариант из предложенных ниже. $_CLICK\n# ^UnLicenseText\nПеред установкой $(^NameDA) ознакомьтесь с лицензионным соглашением. Если вы принимаете условия соглашения, нажмите кнопку \"Принимаю\".\n# ^UnLicenseTextCB\nПеред установкой $(^NameDA) ознакомьтесь с лицензионным соглашением. Если вы принимаете условия соглашения, установите флажок ниже. $_CLICK\n# ^UnLicenseTextRB\nПеред установкой $(^NameDA) ознакомьтесь с лицензионным соглашением. Если вы принимаете условия соглашения, выберите первый вариант из предложенных ниже. $_CLICK\n# ^Custom\nПо выбору\n# ^ComponentsText\nВыберите компоненты программы, которые вы хотите установить. $_CLICK\n# ^ComponentsSubText1\nВыберите тип установки:\n# ^ComponentsSubText2_NoInstTypes\nВыберите компоненты программы для установки:\n# ^ComponentsSubText2\nили выберите дополнительные компоненты для установки:\n# ^UnComponentsText\nВыберите компоненты, которые вы хотите удалить. $_CLICK\n# ^UnComponentsSubText1\nВыберите тип удаления:\n# ^UnComponentsSubText2_NoInstTypes\nВыберите компоненты для удаления:\n# ^UnComponentsSubText2\nили выберите дополнительные компоненты для удаления:\n# ^DirText\nПрограмма установит $(^NameDA) в указанную папку. Чтобы установить приложение в другую папку, нажмите кнопку \"Обзор\" и укажите ее. $_CLICK\n# ^DirSubText\nПапка установки\n# ^DirBrowseText\nУкажите папку для установки $(^NameDA):\n# ^UnDirText\nПрограмма удалит $(^NameDA) из указанной папки. Чтобы выполнить удаление из другой папки, нажмите кнопку \"Обзор\" и укажите ее. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nУкажите папку, из которой нужно удалить $(^NameDA):\n# ^SpaceAvailable\n\"Доступно на диске: \"\n# ^SpaceRequired\n\"Требуется на диске: \"\n# ^UninstallingText\nПрограмма $(^NameDA) будет удалена из вашего ПК. $_CLICK\n# ^UninstallingSubText\nУдаление из:\n# ^FileError\nНевозможно открыть файл для записи: \\r\\n\\t\"$0\"\\r\\n\"Прервать\": остановить установку;\\r\\n\"Повтор\": повторить попытку;\\r\\n\"Пропуск\": пропустить это действие.\n# ^FileError_NoIgnore\nНевозможно открыть файл для записи: \\r\\n\\t\"$0\"\\r\\n\"Повтор\": повторить попытку;\\r\\n\"Отмена\": прервать процесс установки.\n# ^CantWrite\n\"Невозможно записать: \"\n# ^CopyFailed\nОшибка при копировании\n# ^CopyTo\n\"Копирование в \"\n# ^Registering\n\"Регистрация: \"\n# ^Unregistering\n\"Де-регистрация: \"\n# ^SymbolNotFound\n\"Невозможно найти символ: \"\n# ^CouldNotLoad\n\"Невозможно загрузить: \"\n# ^CreateFolder\n\"Создание папки: \"\n# ^CreateShortcut\n\"Создание ярлыка: \"\n# ^CreatedUninstaller\n\"Создание программы удаления: \"\n# ^Delete\n\"Удаление файла: \"\n# ^DeleteOnReboot\n\"Удаление при перезагрузке ПК: \"\n# ^ErrorCreatingShortcut\n\"Ошибка создания ярлыка: \"\n# ^ErrorCreating\n\"Ошибка создания: \"\n# ^ErrorDecompressing\nОшибка распаковки данных! Возможно, повреждён дистрибутив.\n# ^ErrorRegistering\nНевозможно зарегистрировать библиотеку (DLL)\n# ^ExecShell\n\"Выполнение команды оболочки: \"\n# ^Exec\n\"Выполнение: \"\n# ^Extract\n\"Извлечение: \"\n# ^ErrorWriting\n\"Извлечение: ошибка записи файла \"\n# ^InvalidOpcode\nДистрибутив поврежден: недопустимый код\n# ^NoOLE\n\"Нет OLE для: \"\n# ^OutputFolder\n\"Папка установки: \"\n# ^RemoveFolder\n\"Удаление папки: \"\n# ^RenameOnReboot\n\"Переименование при перезагрузке ПК: \"\n# ^Rename\n\"Переименование: \"\n# ^Skipped\n\"Пропуск: \"\n# ^CopyDetails\nКопировать сведения в буфер обмена\n# ^LogInstall\nВести отчет установки\n# byte\nбайт\n# kilo\n К\n# mega\n М\n# giga\n Г"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Russian.nsh",
    "content": "﻿;Language: Russian (1049)\n;Translation updated by Dmitry Yerokhin [erodim@mail.ru] (050424)\n\n!insertmacro LANGFILE \"Russian\" = \"Русский\" \"Russkij\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Вас приветствует мастер установки $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Эта программа установит $(^NameDA) на ваш компьютер.$\\r$\\n$\\r$\\nПеред началом установки рекомендуется закрыть все работающие приложения. Это позволит программе установки обновить системные файлы без перезагрузки компьютера.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Вас приветствует мастер удаления $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Эта программа удалит $(^NameDA) из вашего компьютера.$\\r$\\n$\\r$\\nПеред началом удаления убедитесь, что программа $(^NameDA) не запущена.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Лицензионное соглашение\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Перед установкой $(^NameDA) ознакомьтесь с лицензионным соглашением.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Если вы принимаете условия соглашения, нажмите кнопку $\\\"Принимаю$\\\". Чтобы установить программу, необходимо принять соглашение.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Если вы принимаете условия соглашения, установите флажок ниже. Чтобы установить программу, необходимо принять соглашение. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Если вы принимаете условия соглашения, выберите первый вариант из предложенных ниже. Чтобы установить программу, необходимо принять соглашение. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Лицензионное соглашение\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Перед удалением $(^NameDA) ознакомьтесь с лицензионным соглашением.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Если вы принимаете условия соглашения, нажмите кнопку $\\\"Принимаю$\\\". Для удаления необходимо принять соглашение. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Если вы принимаете условия соглашения, установите флажок ниже. Для удаления необходимо принять соглашение. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Если вы принимаете условия соглашения, выберите первый вариант из предложенных ниже. Для удаления необходимо принять соглашение. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Для перемещения по тексту используйте клавиши $\\\"PageUp$\\\" и $\\\"PageDown$\\\".\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Компоненты устанавливаемой программы\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Выберите компоненты $(^NameDA), которые вы хотите установить.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Компоненты программы\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Выберите компоненты $(^NameDA), которые вы хотите удалить.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Описание\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Наведите курсор мыши на название компонента, чтобы прочесть его описание.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Выберите компонент, чтобы увидеть его описание.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Выбор папки установки\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Выберите папку для установки $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Выбор папки для удаления\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Укажите папку, из которой нужно удалить $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Копирование файлов\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Подождите, идет копирование файлов $(^NameDA)...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Установка завершена\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Установка успешно завершена.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Установка прервана\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Установка не завершена.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Удаление\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Подождите, идет удаление файлов $(^NameDA)...\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Удаление завершено\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Удаление программы успешно завершено.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Удаление прервано\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Удаление произведено не полностью.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Завершение работы мастера установки $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Установка $(^NameDA) выполнена.$\\r$\\n$\\r$\\nНажмите кнопку $\\\"Готово$\\\" для выхода из программы установки.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Для завершения установки $(^NameDA) необходимо перезагрузить компьютер. Хотите сделать это сейчас?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Завершение работы мастера удаления $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Программа $(^NameDA) удалена из вашего компьютера.$\\r$\\n$\\r$\\nНажмите кнопку $\\\"Готово$\\\"для выхода из программы удаления.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Для завершения удаления $(^NameDA) нужно перезагрузить компьютер. Хотите сделать это сейчас?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Да, перезагрузить ПК сейчас\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Нет, я перезагружу ПК позже\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Запустить $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Показать файл ReadMe\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Готово\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Папка в меню $\\\"Пуск$\\\"\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Выберите папку в меню $\\\"Пуск$\\\" для размещения ярлыков программы.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Выберите папку в меню $\\\"Пуск$\\\", куда будут помещены ярлыки программы. Вы также можете ввести другое имя папки.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Не создавать ярлыки\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Удаление $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Удаление $(^NameDA) из компьютера.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Вы действительно хотите отменить установку $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Вы действительно хотите отменить удаление $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Режим установки\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Выберите, для каких пользователей вы хотите установить $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Выберите, будете ли вы устанавливать $(^NameDA) только для себя или для всех пользователей данного компьютера. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Установить для всех пользователей\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Установить только для текущего пользователя\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/ScotsGaelic.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1169\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by GunChleoc\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nA’ stàladh $(^Name)\n# ^UninstallCaption\nA’ dì-stàladh $(^Name)\n# ^LicenseSubCaption\n: Aonta ceadachais\n# ^ComponentsSubCaption\n: Roghainnean an stàlaidh\n# ^DirSubCaption\n: Pasgan an stàlaidh\n# ^InstallingSubCaption\n: ’Ga stàladh\n# ^CompletedSubCaption\n: Deiseil\n# ^UnComponentsSubCaption\n: Roghainnean an dì-stàlaidh\n# ^UnDirSubCaption\n: Pasgan an dì-stàlaidh\n# ^ConfirmSubCaption\n: Dearbhadh\n# ^UninstallingSubCaption\n: ’Ga dhì-stàladh\n# ^UnCompletedSubCaption\n: Deiseil\n# ^BackBtn\n< Air ai&s\n# ^NextBtn\nAir adha&rt >\n# ^AgreeBtn\n&Gabhaidh mi ris\n# ^AcceptBtn\n&Gabhaidh mi teirmichean an aonta cheadachais\n# ^DontAcceptBtn\n&Diùltaidh mi teirmichean an aonta ceadachais\n# ^InstallBtn\n&Stàlaich\n# ^UninstallBtn\n&Dì-stàlaich\n# ^CancelBtn\nSguir dheth\n# ^CloseBtn\n&Dùin\n# ^BrowseBtn\n&Rùraich…\n# ^ShowDetailsBtn\n&Mion-fhiosrachadh\n# ^ClickNext\nBriog air “Air adhart” gus leantainn air adhart.\n# ^ClickInstall\nBriog air “Stàlaich” gus tòiseachadh air an stàladh.\n# ^ClickUninstall\nBriog air “Dì-stàlaich” gus tòiseachadh air an dì-stàladh.\n# ^Name\nAinm\n# ^Completed\nCoileanta\n# ^LicenseText\nFeuch an doir thu sùil air an aonta cheadachais mus stàlaich thu $(^NameDA). Ma ghabhas tu ris a h-uile teirm san aonta, briog air “Gabhaidh mi ris”.\n# ^LicenseTextCB\nFeuch an doir thu sùil air an aonta cheadachais mus stàlaich thu $(^NameDA). Ma ghabhas tu ris a h-uile teirm san aonta, cuir cromag sa bhogsa gu h-ìosal. $_CLICK\n# ^LicenseTextRB\nFeuch an doir thu sùil air an aonta cheadachais mus stàlaich thu $(^NameDA). Ma ghabhas tu ris a h-uile teirm san aonta, tagh a’ chiad roghainn gu h-ìosal. $_CLICK\n# ^UnLicenseText\nFeuch an doir thu sùil air an aonta cheadachais mus dì-stàlaich thu $(^NameDA). Ma ghabhas tu ris a h-uile teirm san aonta, Briog air “Gabhaidh mi ris”.\n# ^UnLicenseTextCB\nFeuch an doir thu sùil air an aonta cheadachais mus dì-stàlaich thu $(^NameDA). Ma ghabhas tu ris a h-uile teirm san aonta, cuir cromag sa bhogsa gu h-ìosal. $_CLICK\n# ^UnLicenseTextRB\nFeuch an doir thu sùil air an aonta cheadachais mus dì-stàlaich thu $(^NameDA). Ma ghabhas tu ris a h-uile teirm san aonta, tagh a’ chiad roghainn gu h-ìosal. $_CLICK\n# ^Custom\nGnàthaichte\n# ^ComponentsText\nThoir cromag ann am bogsaichean nan co-phàirtean a tha thu airson stàladh is thoir air falbh i o bhogsaichean nan co-phàirtean nach eil thu ag iarraidh. $_CLICK\n# ^ComponentsSubText1\nTagh an seòrsa dhen stàladh:\n# ^ComponentsSubText2_NoInstTypes\nTagh na co-phàirtean a tha thu airson stàladh:\n# ^ComponentsSubText2\nNo tagh na co-phàirtean roghainneil a tha thu airson stàladh:\n# ^UnComponentsText\nThoir cromag ann am bogsaichean nan co-phàirtean a tha thu airson dì-stàladh is thoir air falbh i o bhogsaichean nan co-phàirtean a tha thu airson cumail. $_CLICK\n# ^UnComponentsSubText1\nTagh an seòrsa dhen dì-stàladh:\n# ^UnComponentsSubText2_NoInstTypes\nTagh na co-phàirtean a tha thu airson dì-stàladh:\n# ^UnComponentsSubText2\nNo tagh na co-phàirtean roghainneil a tha thu airson dì-stàladh:\n# ^DirText\nThèid $(^NameDA) a stàladh sa phasgan seo. Gus stàladh ann am pasgan eile, briog air “Rùraich” is tagh pasgan eile. $_CLICK\n# ^DirSubText\nPasgan-uidhe\n# ^DirBrowseText\nTagh am pasgan san dèid $(^NameDA) a stàladh:\n# ^UnDirText\nThèid $(^NameDA) a dhì-stàladh on phasgan seo. Gus dì-stàladh o phasgan eile, briog air “Rùraich” is tagh pasgan eile. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nTagh am pasgan on a tha thu airson $(^NameDA) a dhì-stàladh:\n# ^SpaceAvailable\n\"Àite ri fhaighinn: \"\n# ^SpaceRequired\n\"Àite air a bheil feum: \"\n# ^UninstallingText\nThèid $(^NameDA) a dhì-stàladh on phasgan seo. $_CLICK\n# ^UninstallingSubText\n’Ga dhì-stàladh o:\n# ^FileError\nThachair mearachd a’ fosgladh an fhaidhle a chum sgrìobhaidh: \\r\\n\\r\\n$0\\r\\n\\r\\nBriog air “Sguir dheth” gus sgur dhen stàladh, air\\r\\n“Feuch ris a-rithist” gus feuchainn ris a-rithist no air\\r\\n“Leig seachad” gus leum a ghearradh thairis air an fhaidhle seo.\n# ^FileError_NoIgnore\nThachair mearachd a’ fosgladh an fhaidhle seo a chum sgrìobhaidh: \\r\\n\\r\\n$0\\r\\n\\r\\nBriog air “Feuch ris a-rithist” gus feuchainn ris a-rithist no air\\r\\n“Sguir dheth” gus sgur dhen stàladh.\n# ^CantWrite\n\"Cha ghabh sgrìobhadh ann: \"\n# ^CopyFailed\nCha deach leinn lethbhreac dheth a dhèanamh\n# ^CopyTo\n\"Cuir lethbhreac gu \"\n# ^Registering\n\"A’ clàradh: \"\n# ^Unregistering\n\"A’ neo-chlàradh: \"\n# ^SymbolNotFound\n\"Cha deach an samhla a lorg: \"\n# ^CouldNotLoad\n\"Cha b’ urrainn dhuinn a luchdadh: \"\n# ^CreateFolder\n\"Cruthaich pasgan: \"\n# ^CreateShortcut\n\"Cruthaich ath-ghoirid: \"\n# ^CreatedUninstaller\n\"Dì-stàlaichear air a chruthachadh: \"\n# ^Delete\n\"Sguab às dhan fhaidhle: \"\n# ^DeleteOnReboot\n\"Sguab às leis an ath-thòiseachadh: \"\n# ^ErrorCreatingShortcut\n\"Mearachd le cruthachadh na h-ath-ghoirid: \"\n# ^ErrorCreating\n\"Mearachd le cruthachadh: \"\n# ^ErrorDecompressing\nThachair mearachd a’ dì-dhùmhlachadh an dàta! ’S dòcha gu bheil an t-inneal-stàlaidh coirbte.\n# ^ErrorRegistering\nMearachd le clàradh DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Cuir àithne an gnìomh: \"\n# ^Extract\n\"Dì-dhùmhlaich: \"\n# ^ErrorWriting\n\"Dì-dhùmhlachadh: mearachd a’ sgrìobhadh gu faidhle \"\n# ^InvalidOpcode\nStàlaichear coirbte: opcode mì-dhligheach\n# ^NoOLE\n\"Chan eil OLE ann airson: \"\n# ^OutputFolder\n\"Pasgan às-chuir: \"\n# ^RemoveFolder\n\"Thoir pasgan air falbh: \"\n# ^RenameOnReboot\n\"Cuir ainm ùr air leis an ath-thòiseachadh: \"\n# ^Rename\n\"Cuir ainm ùr air: \"\n# ^Skipped\n\"Air leum a ghearradh: \"\n# ^CopyDetails\nCuir lethbhreac dhen mhion-fhiosrachadh san stòr-bhòrd\n# ^LogInstall\nDèan loga dhen stàladh\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/ScotsGaelic.nsh",
    "content": "﻿;Language: Gàidhlig (1169)\n;Le GunChleoc\n\n!insertmacro LANGFILE \"ScotsGaelic\" \"Scottish Gaelic\" \"Gàidhlig\" \"Gaidhlig\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Fàilte gu stàladh $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Stiùiridh sinn tron stàladh aig $(^NameDA) thu.$\\r$\\n$\\r$\\nMholamaid gun dùin thu a h-uile aplacaid eile mus tòisich thu air an stàladh. Mar sin, ’s urrainn dhuinn faidhlichean iomchaidh an t-siostaim ùrachadh gun fheum air ath-thòiseachadh a’ choimpiutair agad.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Fàilte gun dì-stàladh aig $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Stiùiridh sinn tron dì-stàladh aig $(^NameDA) thu.$\\r$\\n$\\r$\\nMus tòisich thu air an dì-stàladh, dèan cinnteach nach eil $(^NameDA) a’ ruith.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Aonta ceadachais\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"An doir thu sùil air teirmichean a’ cheadachais mus stàlaich thu $(^NameDA)?\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ma ghabhas tu ri teirmichean an aonta, briog air “Gabhaidh mi ris” gus leantainn air adhart. Feumaidh tu gabhail ris an aonta mus urrainn dhut $(^NameDA) a stàladh.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ma ghabhas tu ri teirmichean an aonta, thoir cromag sa bhogsa gu h-ìosal. Feumaidh tu gabhail ris an aonta mus urrainn dhut $(^NameDA) a stàladh. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ma ghabhas tu ri teirmichean an aonta, tagh a’ chiad roghainn gu h-ìosal. Feumaidh tu gabhail ris an aonta mus urrainn dhut $(^NameDA) a stàladh. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Aonta ceadachais\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"An doir thu sùil air teirmichean a’ cheadachais mus dì-stàlaich thu $(^NameDA)?\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ma ghabhas tu ri teirmichean an aonta, briog air “Gabhaidh mi ris” gus leantainn air adhart. Feumaidh tu gabhail ris an aonta mus urrainn dhut $(^NameDA) a dhì-stàladh.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ma ghabhas tu ri teirmichean an aonta, cuir cromag sa bhogsa gu h-ìosal. Feumaidh tu gabhail ris an aonta mus urrainn dhut $(^NameDA) a dhì-stàladh. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ma ghabhas tu ri teirmichean an aonta, tagh a’ chiad roghainn gu h-ìosal. Feumaidh tu gabhail ris an aonta mus urrainn dhut $(^NameDA) a dhì-stàladh. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Brùth air Page Down gus an corr dhen aonta a shealltainn.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Tagh co-phàirtean\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Tagh na gleusan aig $(^NameDA) a tha thu airson stàladh.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Tagh co-phàirtean\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Tagh na gleusan aig $(^NameDA) a tha thu airson dì-stàladh.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Tuairisgeul\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Cuir an luchag agad air co-phàirt gus a tuairisgeul a shealltainn.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Tagh co-phàirt gus a tuairisgeul a shealltainn.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Tagh ionad an stàlaidh\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Tagh am pasgan san dèid $(^NameDA) a stàladh.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Tagh ionad an dì-stàlaidh\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Tagh am pasgan on a thèid $(^NameDA) a dhì-stàladh.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"’Ga stàladh\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Fuirich ort fhad ’s a tha $(^NameDA) ’ga stàladh.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Stàladh deiseil\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Tha an stàladh deiseil.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Chaidh sgur dhen stàladh\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Cha deach an stàladh a choileanadh.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"’Ga dhì-stàladh\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Fuirich ort fhad ’s a tha $(^NameDA) ’ga dhì-stàladh.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Dì-stàladh deiseil\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Chaidh a dhì-stàladh.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Chaidh sgur dhen dì-stàladh\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Cha deach an dì-stàladh a choileanadh.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"A’ coileanadh an stàlaidh aig $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Chaidh $(^NameDA) a stàladh air a’ choimpiutair agad.$\\r$\\n$\\r$\\nBriog air “Crìochnaich” gus an t-inneal-stàlaidh a dhùnadh.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Tha ath-thòiseachadh a dhìth air a’ choimpiutair agad gus an stàladh aig $(^NameDA) a choileanadh. A bheil thu airson ath-thòiseachadh an-dràsta?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"A’ coileanadh an dì-stàlaidh aig $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Chaidh $(^NameDA) a dhì-stàladh on choimpiutair agad.$\\r$\\n$\\r$\\nBriog air “Crìochnaich” gus an t-inneal-stàlaidh a dhùnadh.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Tha ath-thòiseachadh a dhìth air a’ choimpiutair agad gus an dì-stàladh aig $(^NameDA) a choileanadh. A bheil thu airson ath-thòiseachadh an-dràsta?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Ath-tòisich an-dràsta\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Nì mi fhìn ath-thòiseachadh a làimh uaireigin eile\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Ruith $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Seall am faidhle “Leughmi”\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Crìochnaich\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Tagh pasgan sa chlàr-taice tòiseachaidh\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Tagh pasgan sa chlàr-taice tòiseachaidh airson na h-ath-ghoiridean aig $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Tagh pasgan sa chlàr-taice tòiseachaidh sa bheil thu airson na h-ath-ghoiridean aig a’ phrògram a chruthachadh. ’S urrainn dhut cuideachd ainm a chur a-steach gus pasgan ùr a chruthachadh.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Na cruthaich ath-ghoiridean\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Dì-stàlaich $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Thoir $(^NameDA) air falbh on choimpiutair agad.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"A bheil thu cinnteach gu bheil thu airson an stàladh aig $(^Name) fhàgail?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"A bheil thu cinnteach gu bheil thu airson an dì-stàladh aig $(^Name) fhàgail?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Tagh cleachdaichean\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Tagh na cleachdaichean dhan a thèid $(^NameDA) a stàladh.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Tagh an stàlaich thu $(^NameDA) air do shon fhìn a-mhàin no airson a h-uile cleachdaiche air a’ choimpiutair seo. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Stàlaich airson duine sam bith a chleachdas an coimpiutair seo\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Na stàlaich ach air mo shon-sa\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Serbian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n3098\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by Срђан Обућина <obucina@srpskijezik.edu.yu>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Инсталација\n# ^UninstallCaption\n$(^Name) Деинсталација\n# ^LicenseSubCaption\n: Договор о праву коришћења\n# ^ComponentsSubCaption\n: Опције инсталације\n# ^DirSubCaption\n: Избор фолдера за инсталацију\n# ^InstallingSubCaption\n: Инсталација\n# ^CompletedSubCaption\n: Завршена инсталација\n# ^UnComponentsSubCaption\n: Опције деинсталације\n# ^UnDirSubCaption\n: Избор фолдера за деинсталацију\n# ^ConfirmSubCaption\n: Потврђивање\n# ^UninstallingSubCaption\n: Деинсталација\n# ^UnCompletedSubCaption\n: Завршена деинсталација\n# ^BackBtn\n< Назад\n# ^NextBtn\nНапред >\n# ^AgreeBtn\nПрихватам\n# ^AcceptBtn\nПрихватам услове договора о праву коришћења\n# ^DontAcceptBtn\nНе прихватам услове договора о праву коришћења\n# ^InstallBtn\nИнсталирај\n# ^UninstallBtn\nДеинсталирај\n# ^CancelBtn\nОдустани\n# ^CloseBtn\nЗатвори\n# ^BrowseBtn\nИзбор...\n# ^ShowDetailsBtn\nДетаљи\n# ^ClickNext\nПритисните дугме „Напред“ за наставак.\n# ^ClickInstall\nПритисните дугме „Инсталирај“ за почетак инсталације.\n# ^ClickUninstall\nПритисните дугме „Деинсталирај“ за почетак деинсталације.\n# ^Name\nИме\n# ^Completed\nЗавршено\n# ^LicenseText\nПажљиво прочитајте договор о праву коришћења пре инсталације програма $(^NameDA). Ако прихватате све услове договора, притисните дугме „Прихватам“.\n# ^LicenseTextCB\nПажљиво прочитајте договор о праву коришћења пре инсталације програма $(^NameDA). Ако прихватате све услове договора, обележите квадратић испод. $_CLICK\n# ^LicenseTextRB\nПажљиво прочитајте договор о праву коришћења пре инсталације програма $(^NameDA). Ако прихватате све услове договора, изаберите прву опцију испод. $_CLICK\n# ^UnLicenseText\nПажљиво прочитајте договор о праву коришћења пре деинсталације програма $(^NameDA). Ако прихватате све услове договора, притисните дугме „Прихватам“.\n# ^UnLicenseTextCB\nПажљиво прочитајте договор о праву коришћења пре деинсталације програма $(^NameDA). Ако прихватате све услове договора, обележите квадратић испод. $_CLICK\n# ^UnLicenseTextRB\nПажљиво прочитајте договор о праву коришћења пре деинсталације програма $(^NameDA). Ако прихватате све услове договора, изаберите прву опцију испод. $_CLICK\n# ^Custom\nПрилагођавање\n# ^ComponentsText\nИзаберите компоненте за инсталацију. Инсталирају се само означене компоненте. $_CLICK\n# ^ComponentsSubText1\nИзаберите тип инсталације:\n# ^ComponentsSubText2_NoInstTypes\nИзаберите компоненте за инсталацију: \n# ^ComponentsSubText2\nИли, изаберите опционе компоненте које желите да инсталирате: \n# ^UnComponentsText\nИзаберите компоненте за деинсталацију. Деинсталирају се само означене компоненте. $_CLICK\n# ^UnComponentsSubText1\nИзаберите тип деинсталације: \n# ^UnComponentsSubText2_NoInstTypes\nИзаберите компоненте за деинсталацију: \n# ^UnComponentsSubText2\nИли, изаберите опционе компоненте које желите да деинсталирате: \n# ^DirText\nПрограм $(^NameDA) ће бити инсталиран у наведени фолдер. За инсталацију у други фолдер притисните дугме „Избор...“ и изаберите фолдер. $_CLICK\n# ^DirSubText\nФолдер\n# ^DirBrowseText\nИзаберите фолдер у који ћете инсталирати програм $(^NameDA):\n# ^UnDirText\nПрограм $(^NameDA) ће бити деинсталиран из наведеног фолдера. За деинсталацију из другог фолдера притисните дугме „Избор...“ и изаберите фолдер. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nИзаберите фолдер из кога ћете деинсталирати програм $(^NameDA):\n# ^SpaceAvailable\n\"Слободан простор: \"\n# ^SpaceRequired\n\"Потребан простор: \"\n# ^UninstallingText\nПрограм $(^NameDA) ће бити деинсталиран из наведеног фолдера. $_CLICK\n# ^UninstallingSubText\nДеинсталација из: \n# ^FileError\nГрешка при отварању фајла за писање: \\r\\n\\t\"$0\"\\r\\nПритисните дугме „Одустани“ за прекид инсталације,\\r\\n„Понови“ за поновни покушај писања у фајл, или\\r\\n„Игнориши“ за прескакање овог фајла.\n# ^FileError_NoIgnore\nГрешка при отварању фајла за писање: \\r\\n\\t\"$0\"\\r\\nПритисните дугме „Понови“ за поновни покушај писања у фајл, или\\r\\n„Одустани“ за прекид инсталирања.\n# ^CantWrite\n\"Немогуће писање: \"\n# ^CopyFailed\nНеуспешно копирање\n# ^CopyTo\n\"Копирање у \"\n# ^Registering\n\"Регистровање: \"\n# ^Unregistering\n\"Дерегистровање: \"\n# ^SymbolNotFound\n\"Симбол није нађен: \"\n# ^CouldNotLoad\n\"Немогуће учитавање: \"\n# ^CreateFolder\n\"Креирање фолдера: \"\n# ^CreateShortcut\n\"Креирање пречице: \"\n# ^CreatedUninstaller\n\"Креирање деинсталера: \"\n# ^Delete\n\"Брисање фајла: \"\n# ^DeleteOnReboot\n\"Брисање при рестарту: \"\n# ^ErrorCreatingShortcut\n\"Грешка при креирању пречице: \"\n# ^ErrorCreating\n\"Грешка при креирању: \"\n# ^ErrorDecompressing\nГрешка при отпакивању података! Оштећен инсталациони програм?\n# ^ErrorRegistering\nГрешка при регистровању библиотеке\n# ^ExecShell\n\"Извршавање у окружењу: \"\n# ^Exec\n\"Извршавање: \"\n# ^Extract\n\"Отпакивање: \"\n# ^ErrorWriting\n\"Отпакивање: грешка при упису у фајл \"\n# ^InvalidOpcode\nОштећен инсталациони програм: неисправна команда \n# ^NoOLE\n\"Нема OLE подршке за: \"\n# ^OutputFolder\n\"Излазни фолдер: \"\n# ^RemoveFolder\n\"Брисање фолдера: \"\n# ^RenameOnReboot\n\"Преименовање при рестартовању: \"\n# ^Rename\n\"Преименован: \"\n# ^Skipped\n\"Прескочен: \"\n# ^CopyDetails\nКопирај детаље у клипборд\n# ^LogInstall\nВоди записник о процесу инсталације\n# ^Byte\nB\n# ^Kilo\n k\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Serbian.nsh",
    "content": "﻿;Language: Serbian (3098)\n;Translation by Срђан Обућина <obucina@srpskijezik.edu.yu>\n\n!insertmacro LANGFILE \"Serbian\" \"Serbian (Cyrillic)\" \"Српски\" \"Srpski (Cyrillic)\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Добродошли у водич за инсталацију програма $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Бићете вођени кроз процес инсталације програма $(^NameDA).$\\r$\\n$\\r$\\nПрепоручљиво је да искључите све друге програме пре почетка инсталације. Ово може омогућити ажурирање системских фајлова без потребе за поновним покретањем рачунара.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Добродошли у деинсталацију програма $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Бићете вођени кроз процес деинсталације програма $(^NameDA).$\\r$\\n$\\r$\\nПре почетка деинсталације, уверите се да је програм $(^NameDA) искључен. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Договор о праву коришћења\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Пажљиво прочитајте договор о праву коришћења пре инсталације програма $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ако прихватате све услове договора, притисните дугме „Прихватам“ за наставак. Морате прихватити договор да бисте инсталирали програм $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ако прихватате све услове договора, обележите квадратић испод. Морате прихватити договор да бисте инсталирали програм $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ако прихватате све услове договора, изаберите прву опцију испод. Морате прихватити договор да бисте инсталирали програм $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Договор о праву коришћења\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Пажљиво прочитајте договор о праву коришћења пре деинсталације програма $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ако прихватате све услове договора, притисните дугме „Прихватам“ за наставак. Морате прихватити договор да бисте деинсталирали програм $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ако прихватате све услове договора, обележите квадратић испод. Морате прихватити договор да бисте деинсталирали програм $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ако прихватате све услове договора, изаберите прву опцију испод. Морате прихватити договор да бисте деинсталирали програм $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Притисните Page Down да бисте видели остатак договора.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Избор компоненти за инсталацију\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Изаберите компоненте за инсталацију. Инсталирају се само означене компоненте.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Избор компоненти за деинсталацију\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Изаберите компоненте за деинсталацију. Деинсталирају се само означене компоненте.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Опис\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Пређите курсором миша преко имена компоненте да бисте видели њен опис.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Изаберите компоненту да бисте видели њен опис.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Избор фолдера за инсталацију\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Изаберите фолдер у који ћете инсталирати програм $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Избор фолдера за деинсталaцију\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Изаберите фолдер из кога ћете деинсталирати програм $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Инсталација\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Сачекајте док се програм $(^NameDA) инсталира.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Завршена инсталација\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Инсталација је успешно завршена.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Прекинута инсталација\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Инсталација је прекинута и није успешно завршена.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Деинсталација\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Сачекајте док се програм $(^NameDA) деинсталира.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Завршена деинсталација\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Деинсталација је успешно завршена.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Прекинута деинсталација\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Деинсталација је прекинута и није успешно завршена.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Завршена инсталација програма $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Програм $(^NameDA) је инсталиран на рачунар.$\\r$\\n$\\r$\\nПритисните дугме „Крај“ за затварање овог прозора.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Рачунар мора бити поново покренут да би се процес инсталације програма $(^NameDA) успешно завршио. Желите ли то одмах да урадите?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Завршена деинсталација програма $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Програм $(^NameDA) је деинсталиран са рачунара.$\\r$\\n$\\r$\\nПритисните дугме „Крај“ за затварање овог прозора.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Рачунар мора бити поново покренут да би се процес деинсталације програма $(^NameDA) успешно завршио. Желите ли то да урадите одмах?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Одмах поново покрени рачунар\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Без поновног покретања\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Покрени програм $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Прикажи ПрочитајМе фајл\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"Крај\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Избор фолдера у Старт менију\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Изаберите фолдер у Старт менију у коме ћете креирати пречице.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Изаберите фолдер у Старт менију у коме желите да буду креиране пречице програма. Можете уписати и име за креирање новог фолдера.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Без креирања пречица\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Деинсталација програма $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Деинсталација програма $(^NameDA) са рачунара.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Сигурно желите да прекинете инсталацију програма $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Сигурно желите да прекинете деинсталацију програма $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/SerbianLatin.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n2074\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Srđan Obućina <obucina@srpskijezik.edu.yu>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Instalacija\n# ^UninstallCaption\n$(^Name) Deinstalacija\n# ^LicenseSubCaption\n: Dogovor o pravu korišćenja\n# ^ComponentsSubCaption\n: Opcije instalacije\n# ^DirSubCaption\n: Izbor foldera za instalaciju\n# ^InstallingSubCaption\n: Instalacija\n# ^CompletedSubCaption\n: Završena instalacija\n# ^UnComponentsSubCaption\n: Opcije deinstalacije\n# ^UnDirSubCaption\n: Izbor foldera za deinstalaciju\n# ^ConfirmSubCaption\n: Potvrđivanje\n# ^UninstallingSubCaption\n: Deinstalacija\n# ^UnCompletedSubCaption\n: Završena deinstalacija\n# ^BackBtn\n< Nazad\n# ^NextBtn\nNapred >\n# ^AgreeBtn\nPrihvatam\n# ^AcceptBtn\nPrihvatam uslove dogovora o pravu korišćenja\n# ^DontAcceptBtn\nNe prihvatam uslove dogovora o pravu korišćenja\n# ^InstallBtn\nInstaliraj\n# ^UninstallBtn\nDeinstaliraj\n# ^CancelBtn\nOdustani\n# ^CloseBtn\nZatvori\n# ^BrowseBtn\nIzbor...\n# ^ShowDetailsBtn\nDetalji\n# ^ClickNext\nPritisnite dugme „Napred“ za nastavak.\n# ^ClickInstall\nPritisnite dugme „Instaliraj“ za početak instalacije.\n# ^ClickUninstall\nPritisnite dugme „Deinstaliraj“ za početak deinstalacije.\n# ^Name\nIme\n# ^Completed\nZavršeno\n# ^LicenseText\nPažlivo pročitajte dogovor o pravu korišćenja pre instalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“.\n# ^LicenseTextCB\nPažlivo pročitajte dogovor o pravu korišćenja pre instalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, obeležite kvadratić ispod. $_CLICK\n# ^LicenseTextRB\nPažlivo pročitajte dogovor o pravu korišćenja pre instalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. $_CLICK\n# ^UnLicenseText\nPažlivo pročitajte dogovor o pravu korišćenja pre deinstalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“.\n# ^UnLicenseTextCB\nPažlivo pročitajte dogovor o pravu korišćenja pre deinstalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, obeležite kvadratić ispod. $_CLICK\n# ^UnLicenseTextRB\nPažlivo pročitajte dogovor o pravu korišćenja pre deinstalacije programa $(^NameDA). Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. $_CLICK\n# ^Custom\nPrilagođavanje\n# ^ComponentsText\nIzaberite komponente za instalaciju. Instaliraju se samo označene komponente. $_CLICK\n# ^ComponentsSubText1\nIzaberite tip instalacije:\n# ^ComponentsSubText2_NoInstTypes\nIzaberite komponente za instalaciju: \n# ^ComponentsSubText2\nIli, izaberite opcione komponente koje želite da instalirate: \n# ^UnComponentsText\nIzaberite komponente za deinstalaciju. Deinstaliraju se samo označene komponente. $_CLICK\n# ^UnComponentsSubText1\nIzaberite tip deinstalacije: \n# ^UnComponentsSubText2_NoInstTypes\nIzaberite komponente za deinstalaciju: \n# ^UnComponentsSubText2\nIli, izaberite opcione komponente koje želite da deinstalirate: \n# ^DirText\nProgram $(^NameDA) će biti instaliran u navedeni folder. Za instalaciju u drugi folder pritisnite dugme „Izbor...“ i izaberite folder. $_CLICK\n# ^DirSubText\nFolder\n# ^DirBrowseText\nIzaberite folder u koji ćete instalirati program $(^NameDA):\n# ^UnDirText\nProgram $(^NameDA) će biti deinstaliran iz navedenog foldera. Za deinstalaciju iz drugog foldera pritisnite dugme „Izbor...“ i izaberite folder. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nIzaberite folder iz koga ćete deinstalirati program $(^NameDA):\n# ^SpaceAvailable\n\"Slobodan prostor: \"\n# ^SpaceRequired\n\"Potreban prostor: \"\n# ^UninstallingText\nProgram $(^NameDA) će biti deinstaliran iz navedenog foldera. $_CLICK\n# ^UninstallingSubText\nDeinstalacija iz: \n# ^FileError\nGreška pri otvaranju fajla za pisanje: \\r\\n\\t\"$0\"\\r\\nPritisnite dugme „Odustani“ za prekid instalacije,\\r\\n„Ponovi“ za ponovni pokušaj pisanja u fajl, ili\\r\\n„Ignoriši“ za preskakanje ovog fajla.\n# ^FileError_NoIgnore\nGreška pri otvaranju fajla za pisanje: \\r\\n\\t\"$0\"\\r\\nPritisnite dugme „Ponovi“ za ponovni pokušaj pisanja u fajl, ili\\r\\n„Odustani“ za prekid instaliranja.\n# ^CantWrite\n\"Nemoguće pisanje: \"\n# ^CopyFailed\nNeuspešno kopiranje\n# ^CopyTo\n\"Kopiranje u \"\n# ^Registering\n\"Registrovanje: \"\n# ^Unregistering\n\"Deregistrovanje: \"\n# ^SymbolNotFound\n\"Simbol nije nađen: \"\n# ^CouldNotLoad\n\"Nemoguće učitavanje: \"\n# ^CreateFolder\n\"Kreiranje foldera: \"\n# ^CreateShortcut\n\"Kreiranje prečice: \"\n# ^CreatedUninstaller\n\"Kreiranje deinstalera: \"\n# ^Delete\n\"Brisanje fajla: \"\n# ^DeleteOnReboot\n\"Brisanje pri restartu: \"\n# ^ErrorCreatingShortcut\n\"Greška pri kreiranju prečice: \"\n# ^ErrorCreating\n\"Greška pri kreiranju: \"\n# ^ErrorDecompressing\nGreška pri otpakivanju podataka! Oštećen instalacioni program?\n# ^ErrorRegistering\nGreška pri registrovanju biblioteke\n# ^ExecShell\n\"Izvršavanje u okruženju: \"\n# ^Exec\n\"Izvršavanje: \"\n# ^Extract\n\"Otpakivanje: \"\n# ^ErrorWriting\n\"Otpakivanje: greška pri upisu u fajl \"\n# ^InvalidOpcode\nOštećen instalacioni program: neispravna komanda \n# ^NoOLE\n\"Nema OLE podrške za: \"\n# ^OutputFolder\n\"Izlazni folder: \"\n# ^RemoveFolder\n\"Brisanje foldera: \"\n# ^RenameOnReboot\n\"Preimenovanje pri restartu: \"\n# ^Rename\n\"Preimenovan: \"\n# ^Skipped\n\"Preskočen: \"\n# ^CopyDetails\nKopiraj detalje u klipbord\n# ^LogInstall\nVodi zapisnik o procesu instalacije\n# ^Byte\nB\n# ^Kilo\n k\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/SerbianLatin.nsh",
    "content": "﻿;Language: Serbian Latin (2074)\n;Translation by Srđan Obućina <obucina@srpskijezik.edu.yu>\n\n!insertmacro LANGFILE \"SerbianLatin\" \"Serbian (Latin)\" \"Srpski\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Dobrodošli u vodič za instalaciju programa $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Bićete vođeni kroz proces instalacije programa $(^NameDA).$\\r$\\n$\\r$\\nPreporučljivo je da isključite sve druge programe pre početka instalacije. Ovo može omogućiti ažuriranje sistemskih fajlova bez potrebe za ponovnim pokretanjem računara.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Dobrodošli u deinstalaciju programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Bićete vođeni kroz proces deinstalacije programa $(^NameDA).$\\r$\\n$\\r$\\nPre početka deinstalacije, uverite se da je program $(^NameDA) isključen. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Dogovor o pravu korišćenja\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Pažljivo pročitajte dogovor o pravu korišćenja pre instalacije programa $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“ za nastavak. Morate prihvatiti dogovor da biste instalirali program $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ako prihvatate sve uslove dogovora, obeležite kvadratić ispod. Morate prihvatiti dogovor da biste instalirali program $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. Morate prihvatiti dogovor da biste instalirali program $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Dogovor o pravu korišćenja\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Pažlivo pročitajte dogovor o pravu korišćenja pre deinstalacije programa $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ako prihvatate sve uslove dogovora, pritisnite dugme „Prihvatam“ za nastavak. Morate prihvatiti dogovor da biste deinstalirali program $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ako prihvatate sve uslove dogovora, obeležite kvadratić ispod. Morate prihvatiti dogovor da biste deinstalirali program $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ako prihvatate sve uslove dogovora, izaberite prvu opciju ispod. Morate prihvatiti dogovor da biste deinstalirali program $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Pritisnite Page Down da biste videli ostatak dogovora.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Izbor komponenti za instalaciju\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Izaberite komponente za instalaciju. Instaliraju se samo označene komponente.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Izbor komponenti za deinstalaciju\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Izaberite komponente za deinstalaciju. Deinstaliraju se samo označene komponente.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Opis\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Pređite kursorom miša preko imena komponente da biste videli njen opis.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Izaberite komponentu da biste videli njen opis.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Izbor foldera za instalaciju\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Izaberite folder u koji ćete instalirati program $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Izbor foldera za deinstalaciju\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Izaberite folder iz koga ćete deinstalirati program $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalacija\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Sačekajte dok se program $(^NameDA) instalira.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Završena instalacija\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Instalacija je uspešno završena.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Prekinuta instalacija\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Instalacija je prekinuta i nije uspešno završena.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Deinstalacija\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Sačekajte dok se program $(^NameDA) deinstalira.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Završena deinstalacija\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Deinstalacija je uspešno završena.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Prekinuta deinstalacija\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Deinstalacija je prekinuta i nije uspešno završena.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Završena instalacija programa $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Program $(^NameDA) je instaliran na računar.$\\r$\\n$\\r$\\nPritisnite dugme „Kraj“ za zatvaranje ovog prozora.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Računar mora biti ponovo pokrenut da bi se proces instalacije programa $(^NameDA) uspešno završio. Želite li to odmah da uradite?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Završena deinstalacija programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Program $(^NameDA) je deinstaliran sa računara.$\\r$\\n$\\r$\\nPritisnite dugme „Kraj“ za zatvaranje ovog prozora.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Računar mora biti ponovo pokrenut da bi se proces deinstalacije programa $(^NameDA) uspešno završio. Želite li to da uradite odmah?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Odmah ponovo pokreni računar\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Bez ponovnog pokretanja\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"Pokreni program $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Prikaži PročitajMe fajl\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"Kraj\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Izbor foldera u Start meniju\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Izaberite folder u Start meniju u kome ćete kreirati prečice.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Izaberite folder u Start meniju u kome želite da budu kreirane prečice programa. Možete upisati i ime za kreiranje novog foldera.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Bez kreiranja prečica\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Deinstalacija programa $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Deinstalacija programa $(^NameDA) sa računara.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Sigurno želite da prekinete instalaciju programa $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Sigurno želite da prekinete deinstalaciju programa $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/SimpChinese.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n2052\n# Font and size - dash (-) means default 字体名称与大小\n宋体\n9\n# Codepage - dash (-) means ASCII code page ASCII 字码页\n936\n# RTL - anything else than RTL means LTR 由右至左书写\n-\n# Revision date: 2020-06-03\n# Translator: Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>, Tyson Tan <tysontan@tysontan.com>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) 安装\n# ^UninstallCaption\n$(^Name) 卸载\n# ^LicenseSubCaption\n: 许可证协议\n# ^ComponentsSubCaption\n: 安装选项\n# ^DirSubCaption\n: 安装目录\n# ^InstallingSubCaption\n: 正在安装\n# ^CompletedSubCaption\n: 已完成\n# ^UnComponentsSubCaption\n: 卸载选项\n# ^UnDirSubCaption\n: 卸载文件夹\n# ^ConfirmSubCaption\n: 确认\n# ^UninstallingSubCaption\n: 正在卸载\n# ^UnCompletedSubCaption\n: 完成\n# ^BackBtn\n< 上一步(&P)\n# ^NextBtn\n下一步(&N) >\n# ^AgreeBtn\n我接受(&I)\n# ^AcceptBtn\n我接受许可证协议中的条款(&A)\n# ^DontAcceptBtn\n我不接受许可证协议中的条款(&N)\n# ^InstallBtn\n安装(&I)\n# ^UninstallBtn\n卸载(&U)\n# ^CancelBtn\n取消(&C)\n# ^CloseBtn\n关闭(&L)\n# ^BrowseBtn\n浏览(&B)...\n# ^ShowDetailsBtn\n显示详情(&D)\n# ^ClickNext\n点击 [下一步(N)] 继续。\n# ^ClickInstall\n点击 [安装(I)] 开始安装。\n# ^ClickUninstall\n点击 [卸载(U)] 开始卸载。\n# ^Name\n名称\n# ^Completed\n已完成\n# ^LicenseText\n请在安装 $(^NameDA) 之前阅读许可证协议。如果你接受协议中所有条款，点击 [我同意(I)] 。\n# ^LicenseTextCB\n请在安装 $(^NameDA) 之前阅读许可证协议。如果你接受协议中所有条款，点击下方的选框。 $_CLICK\n# ^LicenseTextRB\n请在安装 $(^NameDA) 之前阅读许可证协议。如果你接受协议中所有条款，选择下方的第一个选项。 $_CLICK\n# ^UnLicenseText\n请在卸载 $(^NameDA) 之前阅读许可证协议。如果你接受协议中所有条款，点击 [我同意(I)] 。\n# ^UnLicenseTextCB\n请在卸载 $(^NameDA) 之前阅读许可证协议。如果你接受协议中所有条款，点击下方的选框。 $_CLICK\n# ^UnLicenseTextRB\n请在卸载 $(^NameDA) 之前阅读许可证协议。如果你接受协议中所有条款，选择下方的第一个选项。 $_CLICK\n# ^Custom\n自定义\n# ^ComponentsText\n请勾选你想安装的组件，并取消勾选你不想安装的组件。 $_CLICK\n# ^ComponentsSubText1\n选定的安装的类型: \n# ^ComponentsSubText2_NoInstTypes\n选定安装的组件: \n# ^ComponentsSubText2\n或者，自定义选定想安装的组件: \n# ^UnComponentsText\n请勾选你想卸载的组件，并取消勾选你不想卸载的组件。 $_CLICK\n# ^UnComponentsSubText1\n选择卸载的类型: \n# ^UnComponentsSubText2_NoInstTypes\n选择要卸载的组件: \n# ^UnComponentsSubText2\n或是，选择想要解除安装的可选项组件: \n# ^DirText\n安装程序将把 $(^NameDA) 安装到以下目录。要安装到另一个目录，请点击 [浏览(B)...] 并选择其他的文件夹。 $_CLICK\n# ^DirSubText\n安装目录\n# ^DirBrowseText\n选择安装此软件的 $(^NameDA) 的位置: \n# ^UnDirText\n安装程序将把 $(^NameDA) 从以下目录卸载。要从另一个目录卸载，点击 [浏览(B)...] 并选择其他目录。 $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n选择要卸载 $(^NameDA) 的目录: \n# ^SpaceAvailable\n\"可用空间: \"\n# ^SpaceRequired\n\"所需空间: \"\n# ^UninstallingText\n此向导将从本机卸载 $(^NameDA) 。 $_CLICK\n# ^UninstallingSubText\n卸载目录: \n# ^FileError\n无法打开要写入的文件: \\r\\n\\t\"$0\"\\r\\n点击 [Abort] 停止安装，\\r\\n [Retry] 重新尝试写入文件，或者\\r\\n [Ignore] 忽略这个文件。\n# ^FileError_NoIgnore\n无法打开要写入的文件: \\r\\n\\t\"$0\"\\r\\n点击 [Retry] 重新尝试写入文件，或者\\r\\n [Cancel] 停止安装。\n# ^CantWrite\n\"无法写入: \"\n# ^CopyFailed\n\"复制失败 \"\n# ^CopyTo\n\"复制到: \"\n# ^Registering\n\"正在注册: \"\n# ^Unregistering\n\"正在取消注册: \"\n# ^SymbolNotFound\n\"无法找到符号: \"\n# ^CouldNotLoad\n\"无法加载: \"\n# ^CreateFolder\n\"创建文件夹: \" \n# ^CreateShortcut\n\"创建快捷方式: \"\n# ^CreatedUninstaller\n\"创建卸载程序: \"\n# ^Delete\n\"删除文件: \"\n# ^DeleteOnReboot\n\"重新启动后删除: \"\n# ^ErrorCreatingShortcut\n\"创建快捷方式时发生错误: \"\n# ^ErrorCreating\n\"创建时发生错误: \"\n# ^ErrorDecompressing\n\"解压缩数据时发生错误！请检查安装程序是否损坏。\"\n# ^ErrorRegistering\n\"注册 DLL 时发生错误\"\n# ^ExecShell\n\"执行外壳程序: \"\n# ^Exec\n\"执行: \"\n# ^Extract\n\"解压缩: \"\n# ^ErrorWriting\n\"抽取: 无法写入文件 \"\n# ^InvalidOpcode\n\"安装程序损坏: 无效的操作代码 \"\n# ^NoOLE\n\"没有 OLE 用于: \"\n# ^OutputFolder\n\"输出目录: \"\n# ^RemoveFolder\n\"删除目录: \"\n# ^RenameOnReboot\n\"重新启动之后重命名: \"\n# ^Rename\n\"重命名: \"\n# ^Skipped\n\"已跳过: \"\n# ^CopyDetails\n\"复制详情到剪贴板 \"\n# ^LogInstall\n\"记录安装过程到日志\"\n# byte\nB\n# kilo\n K\n# mega\n M\n# giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/SimpChinese.nsh",
    "content": "﻿;Language: 'Chinese (Simplified)' (2052)\n;Translator: Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>, Tyson Tan <tysontan@tysontan.com>\n;Revision date: 2020-06-03\n\n!insertmacro LANGFILE \"SimpChinese\" \"Chinese (Simplified)\" \"中文(简体)\" \"Hanyu (Jiantizi)\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"欢迎使用 $(^NameDA) 安装程序\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"此程序将引导你完成 $(^NameDA) 的安装。$\\r$\\n$\\r$\\n在安装之前，请先关闭其他所有应用程序。这将确保安装程序能够更新所需的系统文件，从而避免在安装后重新启动计算机。$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"欢迎使用 $(^NameDA) 卸载程序\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"此程序将引导你完成 $(^NameDA) 的卸载。$\\r$\\n$\\r$\\n在卸载之前，请确认 $(^NameDA) 已经关闭。$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"许可证协议\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"在安装 $(^NameDA) 之前，请阅读许可证条款。\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"如果你接受许可证的条款，请点击 [我同意(I)] 继续安装。你必须在同意后才能安装 $(^NameDA) 。\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"如果你接受许可证的条款，请点击勾选下方的选框。你必须在同意后才能安装 $(^NameDA)。$_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"如果你接受许可证的条款，请选择下方第一个选项。你必须在同意后才能安装 $(^NameDA)。$_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"许可证协议\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"在卸载 $(^NameDA) 之前，请阅读许可证条款。\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"如果你接受许可证的条款，请点击 [我同意(I)] 继续卸载。如果你点击 [取消(C)] ，卸载程序将会关闭。你必须在同意后才能卸载 $(^NameDA) 。\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"如果你接受许可证的条款，点击勾选下方的选框。你必须在同意后才能卸载 $(^NameDA)。$_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"如果你接受许可证的条款，请选择下方第一个选项。你必须在同意后才能卸载 $(^NameDA)。$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"要阅读协议的其余部分，请按 [PgDn] 键向下翻页。\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"选择组件\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"选择你想安装的 $(^NameDA) 功能组件。\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"选择组件\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"选择你想卸载的 $(^NameDA) 功能组件。\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"组件描述\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"将光标悬停在组件名称之上，即可显示它的功能描述。\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"点击选中组件，即可显示它的功能描述。\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"选择安装位置\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"选择 $(^NameDA) 的安装文件夹。\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"选择卸载位置\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"选择 $(^NameDA) 的卸载文件夹。\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"正在安装\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"$(^NameDA) 正在安装，请稍候。\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"安装完成\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"安装程序成功完成安装。\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"安装中止\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"安装程序未能完成安装。\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"正在卸载\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"$(^NameDA) 正在卸载，请稍候。\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"卸载完成\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"卸载程序成功完成卸载。\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"卸载中止\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"卸载程序未能完成卸载。\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) 安装程序结束\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) 已经成功安装到本机。$\\r$\\n点击 [完成(F)] 关闭安装程序。\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"必须重新启动本机才能完成 $(^NameDA) 的安装。是否立即重新启动？\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) 卸载程序结束\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) 已经成功从本机卸载。$\\r$\\n$\\r$\\n点击 [完成] 关闭卸载程序。\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"必须重新启动本机才能完成 $(^NameDA) 的卸载。是否立即重新启动？\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"是，立即重新启动(&Y)\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"否，我会在之后重新启动(&N)\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"运行 $(^NameDA)(&R)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"显示自述文件(&M)\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"完成(&F)\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"选择开始菜单文件夹\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"选择开始菜单文件夹，用于创建程序的快捷方式。\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"选择开始菜单文件夹，用于创建程序的快捷方式。你也可以输入自定义名称，创建新文件夹。\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"不要创建快捷方式(&N)\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"卸载 $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"从本机卸载 $(^NameDA) 。\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"确定要退出 $(^Name) 安装程序吗？\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"确定要退出 $(^Name) 卸载程序吗？\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"选择用户\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"选择为哪些用户安装 $(^NameDA) 。\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"选择只为自己安装 $(^NameDA) ，还是为本机的所有用户安装。 $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"为本机所有用户安装(&A)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"只为我自己安装(&M)\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Slovak.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1051\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n#Translated by: Kypec (peter.dzugas@mahe.sk); edited by: Marián Hikaník (podnety@mojepreklady.net), Ivan Masár <helix84@centrum.sk>, 2008.\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInštalácia programu $(^Name)\n# ^UninstallCaption\nOdinštalovanie programu $(^Name)\n# ^LicenseSubCaption\n: Licenčná zmluva\n# ^ComponentsSubCaption\n: Možnosti inštalácie\n# ^DirSubCaption\n: Inštalačný priečinok\n# ^InstallingSubCaption\n: Prebieha inštalácia\n# ^CompletedSubCaption\n: Hotovo\n# ^UnComponentsSubCaption\n: Možnosti odinštalovania\n# ^UnDirSubCaption\n: Priečinok s informáciami pre odinštalovanie\n# ^ConfirmSubCaption\n: Potvrdenie\n# ^UninstallingSubCaption\n: Prebieha odinštalácia\n# ^UnCompletedSubCaption\n: Hotovo\n# ^BackBtn\n< &Späť\n# ^NextBtn\nĎ&alej >\n# ^AgreeBtn\n&Súhlasím\n# ^AcceptBtn\n&Súhlasím s podmienkami licenčnej zmluvy\n# ^DontAcceptBtn\nN&esúhlasím s podmienkami licenčnej zmluvy\n# ^InstallBtn\n&Nainštalovať\n# ^UninstallBtn\n&Odinštalovať\n# ^CancelBtn\nZrušiť\n# ^CloseBtn\n&Zatvoriť\n# ^BrowseBtn\n&Prehľadávať...\n# ^ShowDetailsBtn\n&Podrobnosti\n# ^ClickNext\nV inštalácii pokračujte kliknutím na tlačidlo Ďalej.\n# ^ClickInstall\nPre spustenie inštalácie kliknite na tlačidlo Nainštalovať.\n# ^ClickUninstall\nPre spustenie procesu odinštalovania kliknite na tlačidlo Odinštalovať.\n# ^Name\nNázov\n# ^Completed\nHotovo\n# ^LicenseText\nPred inštaláciou programu si prosím dôkladne prečítajte licenčnú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, kliknite na tlačidlo Súhlasím.\n# ^LicenseTextCB\nPred inštaláciou programu si prosím dôkladne prečítajte licenčnú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, zaškrtnite nasledujúce políčko. $_CLICK\n# ^LicenseTextRB\nPred inštaláciou programu si prosím dôkladne prečítajte licenčnú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, označte prvú z nasledujúcich možností. $_CLICK\n# ^UnLicenseText\nPred odinštalovaním programu si prosím dôkladne prečítajte licenčnú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, kliknite na tlačidlo Súhlasím.\n# ^UnLicenseTextCB\nPred odinštalovaním programu si prosím dôkladne prečítajte licenčnú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, zaškrtnite nasledujúce políčko. $_CLICK\n# ^UnLicenseTextRB\nPred odinštalovaním programu si prosím dôkladne prečítajte licenčnú zmluvu $(^NameDA). Ak súhlasíte so všetkými jej podmienkami, označte prvú z nasledujúcich možností. $_CLICK\n# ^Custom\nVoliteľná\n# ^ComponentsText\nOznačte súčasti programu, ktoré chcete nainštalovať a odznačte tie, ktoré nainštalovať nechcete. $_CLICK\n# ^ComponentsSubText1\nVyberte si typ inštalácie:\n# ^ComponentsSubText2_NoInstTypes\nVyberte si tie súčasti programu, ktoré chcete nainštalovať:\n# ^ComponentsSubText2\nAlebo označte voliteľné doplnky, ktoré chcete nainštalovať:\n# ^UnComponentsText\nOznačte súčasti programu, ktoré chcete odinštalovať a odznačte tie, ktoré chcete ponechať nainštalované. $_CLICK\n# ^UnComponentsSubText1\nZvoľte typ deinštalácie:\n# ^UnComponentsSubText2_NoInstTypes\nVyberte súčasti, ktoré chcete odinštalovať:\n# ^UnComponentsSubText2\nAlebo označte voliteľné súčasti, ktoré chcete odinštalovať:\n# ^DirText\n$(^NameDA) bude nainštalovaný do nasledujúceho priečinka. Inštalovať do iného priečinka môžete po kliknutí na tlačidlo Prehľadávať a vybraní iného priečinka. $_CLICK\n# ^DirSubText\nCieľový priečinok\n# ^DirBrowseText\nZvoľte priečinok, do ktorého sa nainštaluje program $(^NameDA):\n# ^UnDirText\nInštalátor odinštaluje program $(^NameDA) z nasledovného priečinka. Ak ho chcete odinštalovať z iného priečinka, kliknite na tlačidlo Prehľadávať a vyberte iný priečinok. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nZvoľte priečinok, z ktorého sa odinštaluje program $(^NameDA):\n# ^SpaceAvailable\n\"Voľné miesto na disku: \"\n# ^SpaceRequired\n\"Potrebné miesto na disku: \"\n# ^UninstallingText\nProgram $(^NameDA) sa odinštaluje z nasledovného priečinka. $_CLICK\n# ^UninstallingSubText\nPrebieha odinštalovanie z:\n# ^FileError\nChyba pri otváraní súboru na zápis: \\r\\n\\r\\n$0\\r\\n\\r\\n. Ak chcete inštaláciu ukončiť, kliknite na tlačidlo Ukončiť,\\r\\ ak chcete zápis súboru zopakovať, kliknite na tlačidlo Opakovať alebo kliknite na tlačidlo \\r\\nIgnorovať, ak chcete inštaláciu tohto súboru vynechať.\n# ^FileError_NoIgnore\nChyba pri otváraní súboru na zápis: \\r\\n\\r\\n$0\\r\\n\\r\\n. Ak chcete zopakovať zápis súboru, kliknite na tlačidlo Opakovať, alebo kliknite na tlačidlo \\r\\nZrušiť, v prípade, že chcete inštaláciu ukončiť.\n# ^CantWrite\n\"Nemožno zapísať súbor: \"\n# ^CopyFailed\nKopírovanie zlyhalo.\n# ^CopyTo\n\"Kopírovať do \"\n# ^Registering\n\"Registruje sa: \"\n# ^Unregistering\n\"Vymazáva sa z registra: \"\n# ^SymbolNotFound\n\"Nemožno nájsť symbol: \"\n# ^CouldNotLoad\n\"Nemožno načítať: \"\n# ^CreateFolder\n\"Vytvorený priečinok: \"\n# ^CreateShortcut\n\"Vytvorený odkaz: \"\n# ^CreatedUninstaller\n\"Program pre odinštalovanie: \"\n# ^Delete\n\"Vymazaný súbor: \"\n# ^DeleteOnReboot\n\"Vymazať po reštartovaní systému: \"\n# ^ErrorCreatingShortcut\n\"Chyba pri vytváraní odkazu: \"\n# ^ErrorCreating\n\"Chyba pri vytváraní: \"\n# ^ErrorDecompressing\nChyba pri dekomprimovaní dát! Inštalátor je pravdepodobne poškodený...\n# ^ErrorRegistering\nChyba pri registrácii súčasti\n# ^ExecShell\n\"Vykonať príkaz: \"\n# ^Exec\n\"Spustiť: \"\n# ^Extract\n\"Extrahuje sa: \"\n# ^ErrorWriting\n\"Chyba pri zápise do súboru \"\n# ^InvalidOpcode\nInštalátor je pravdepodobne poškodený, pretože obsahuje neplatný operačný kód.\n# ^NoOLE\n\"Žiadny zápis OLE pre: \"\n# ^OutputFolder\n\"Výstupný priečinok: \"\n# ^RemoveFolder\n\"Odstrániť priečinok: \"\n# ^RenameOnReboot\n\"Premenovať po reštartovaní systému: \"\n# ^Rename\n\"Premenovať: \"\n# ^Skipped\n\"Vynechané: \"\n# ^CopyDetails\nSkopírovať podrobnosti do schránky\n# ^LogInstall\nZaznamenať priebeh inštalácie\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Slovak.nsh",
    "content": "﻿;Language: Slovak (1051)\n;Translated by:\n;  Kypec (peter.dzugas@mahe.sk)\n;edited by:\n;  Marián Hikaník (podnety@mojepreklady.net)\n;  Ivan Masár <helix84@centrum.sk>, 2008.\n\n!insertmacro LANGFILE \"Slovak\" = \"Slovenčina\" \"Slovencina\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Vitajte v sprievodcovi inštaláciou programu $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Tento sprievodca vás prevedie inštaláciou $(^NameDA).$\\r$\\n$\\r$\\nPred začiatkom inštalácie sa odporúča ukončiť všetky ostatné programy. Tým umožníte aktualizovanie systémových súborov bez potreby reštartovania vášho počítača.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Vitajte v sprievodcovi odinštalovaním programu $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Tento sprievodca vás prevedie procesom odinštalovania programu $(^NameDA).$\\r$\\n$\\r$\\nPred spustením procesu odinštalovania sa uistite, že program $(^NameDA) nie je práve aktívny.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licenčná zmluva\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Pred inštaláciou $(^NameDA) si prosím preštudujte licenčné podmienky.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Ak súhlasíte s podmienkami zmluvy, kliknite na tlačidlo Súhlasím a môžete pokračovať v inštalácii. Ak chcete v inštalácii pokračovať, musíte odsúhlasiť podmienky licenčnej zmluvy $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ak súhlasíte s podmienkami zmluvy, zaškrtnite nižšie uvedené políčko. Ak chcete v inštalácii pokračovať, musíte odsúhlasiť podmienky licenčnej zmluvy $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ak súhlasíte s podmienkami zmluvy, označte prvú z nižšie uvedených možností. Ak chcete v inštalácii pokračovať, musíte odsúhlasiť podmienky licenčnej zmluvy $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licenčná zmluva\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Pred odinštalovaním programu $(^NameDA) si prosím prečítajte licenčné podmienky.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Ak súhlasíte s podmienkami zmluvy, zvoľte Súhlasím. Licenčnú zmluvu musíte odsúhlasiť, ak chcete v odinštalovaní programu $(^NameDA) pokračovať.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Ak súhlasíte s podmienkami zmluvy, zaškrtnite nižšie uvedené políčko. Licenčnú zmluvu musíte odsúhlasiť, ak chcete pokračovať v odinštalovaní programu $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Ak súhlasíte s podmienkami licenčnej zmluvy, označte prvú z nižšie uvedených možností. Licenčnú zmluvu musíte odsúhlasiť, ak chcete pokračovať v odinštalovaní programu $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Stlačením klávesu Page Down posuniete text licenčnej zmluvy.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Voľba súčastí programu\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Zvoľte si tie súčasti programu $(^NameDA), ktoré chcete nainštalovať.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Voľba súčastí\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Zvoľte súčasti programu $(^NameDA), ktoré chcete odinštalovať.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Popis\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Pri prejdení kurzorom myši nad názvom súčasti sa zobrazí jej popis.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Označte nejakú súčasť, ak chcete zobraziť jej podrobnejší popis.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Voľba umiestnenia programu\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Vyberte si priečinok, do ktorého chcete nainštalovať program $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Umiestenie programu pre odinštalovanie\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Vyberte si priečinok, z ktorého chcete odinštalovať program $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Inštalácia\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Počkajte prosím, kým prebehne inštalácia programu $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Ukončenie inštalácie\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Inštalácia bola dokončená úspešne.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Prerušenie inštalácie\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Inštaláciu sa nepodarilo dokončiť.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Odinštalovanie\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Čakajte prosím, kým prebehne odinštalovanie programu $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Ukončenie odinštalovania\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Odinštalovanie bolo úspešne dokončené.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Prerušenie odinštalovania\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Odinštalovanie sa neukončilo úspešne.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Dokončenie inštalácie programu $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Program $(^NameDA) bol nainštalovaný do vášho počítača.$\\r$\\nKliknite na tlačidlo Dokončiť a tento sprievodca sa ukončí.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Pre úplné dokončenie inštalácie programu $(^NameDA) je potrebné reštartovať váš počítač. Chcete ho reštartovať ihneď?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Dokončenie sprievodcu odinštalovaním\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Program $(^NameDA) bol odinštalovaný z vášho počítača.$\\r$\\n$\\r$\\nKliknite na tlačidlo Dokončiť a tento sprievodca sa ukončí.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Pre úplné dokončenie odinštalovania programu $(^NameDA) je nutné reštartovať váš počítač. Chcete ho reštartovať ihneď?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reštartovať teraz\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Reštartovať neskôr (manuálne)\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Spustiť program $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Zobraziť súbor s informáciami\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Dokončiť\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Voľba umiestnenia v ponuke Štart\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Vyberte si priečinok v ponuke Štart, kam sa umiestnia odkazy na program $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Vyberte si priečinok v ponuke Štart, v ktorom chcete vytvoriť odkazy na program. Takisto môžete napísať názov nového priečinka.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Nevytvárať odkazy\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Odinštalovanie programu $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Odstránenie programu $(^NameDA) z vášho počítača.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Naozaj chcete ukončiť inštaláciu programu $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Naozaj chcete ukončiť proces odinštalovania programu $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Vybrať používateľov\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Vyberte pre ktorých používateľov chcete nainštalovať $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Vyberte, či chcete nainštalovať program $(^NameDA) iba pre seba alebo pre všetkých používateľov tohto počítača. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Nainštalovať pre všetkých používateľov tohto počítača\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Nainštalovať iba pre mňa\"\n!endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Slovenian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1060\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1250\n# RTL - anything else than RTL means LTR\n-\n# Translation by Janez Dolinar, edited by Martin Srebotnjak - Lugos.si\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nNamestitev $(^Name)\n# ^UninstallCaption\nOdstranitev $(^Name)\n# ^LicenseSubCaption\n: Licenčna pogodba\n# ^ComponentsSubCaption\n: Možnosti namestitve\n# ^DirSubCaption\n: Mapa namestitve\n# ^InstallingSubCaption\n: Nameščanje poteka\n# ^CompletedSubCaption\n: Dokončano\n# ^UnComponentsSubCaption\n: Možnosti odstranitve\n# ^UnDirSubCaption\n: Mapa odstranitve\n# ^ConfirmSubCaption\n: Potrditev\n# ^UninstallingSubCaption\n: Odstranjevanje poteka\n# ^UnCompletedSubCaption\n: Dokončano\n# ^BackBtn\n< &Nazaj\n# ^NextBtn\nN&aprej >\n# ^AgreeBtn\nSe &strinjam\n# ^AcceptBtn\n&Sprejmem pogoje licenčne pogodbe\n# ^DontAcceptBtn\n&Ne sprejmem pogojev licenčne pogodbe\n# ^InstallBtn\n&Namesti\n# ^UninstallBtn\n&Odstrani\n# ^CancelBtn\nPrekliči\n# ^CloseBtn\n&Zapri\n# ^BrowseBtn\nPrebrsk&aj ...\n# ^ShowDetailsBtn\n&Podrobnosti\n# ^ClickNext\nKliknite Naprej za nadaljevanje.\n# ^ClickInstall\t\nKliknite Namesti za začetek namestitve.\n# ^ClickUninstall\t\nKliknite Odstrani za odstranitev.\n# ^NameIme\nIme\n# ^Completed\nDokončano\n# ^LicenseText\nProsimo, da pred namestitvijo $(^NameDA) pregledate licenčno pogodbo. Če se z njo strinjate, pritisnite Se strinjam.\n# ^LicenseTextCB\nProsimo, da pred namestitvijo $(^NameDA) pregledate licenčno pogodbo. Če sprejmete vse naštete pogoje, potrdite spodnje polje. $_CLICK\n# ^LicenseTextRB\nProsimo, da pred namestitvijo $(^NameDA) pregledate licenčno pogodbo. Če sprejmete vse naštete pogoje, izberite prvo spodaj podano možnost. $_CLICK\n# ^UnLicenseText\nProsimo, da pred odstranitvijo $(^NameDA) pregledate licenčno pogodbo. Če se z njo strinjate, pritisnite Se strinjam.\n# ^UnLicenseTextCB\nProsimo, da pred odstranitvijo $(^NameDA) pregledate licenčno pogodbo. Če sprejmete vse naštete pogoje, potrdite spodnje polje. $_CLICK\n# ^UnLicenseTextRB\nProsimo, da pred odstranitvijo $(^NameDA) pregledate licenčno pogodbo. Če sprejmete vse naštete pogoje, izberite prvo spodaj podano možnost. $_CLICK\n# ^Custom\nPo meri ...\n# ^ComponentsText\nOznačite komponente, ki jih želite namestiti, in pustite neoznačene tiste, katerih ne želite namestiti. $_CLICK\n# ^ComponentsSubText1\nIzberite vrsto namestitve:\n# ^ComponentsSubText2_NoInstTypes\nIzberite komponente namestitve:\n# ^ComponentsSubText2\nAli pa izberite komponente, ki jih želite namestiti:\n# ^UnComponentsText\nOznačite komponente, ki jih želite odstraniti, in pustite neoznačene tiste, ki jih ne želite odstraniti. $_CLICK\n# ^UnComponentsSubText1\nIzberite vrsto odstranitve:\n# ^UnComponentsSubText2_NoInstTypes\nIzberite komponente za odstranitev:\n# ^UnComponentsSubText2\nAli pa izberite komponente namestitve, ki jih želite odstraniti:\n# ^DirText\n$(^NameDA) boste namestili v sledečo mapo. Za izbiro druge mape kliknite tipko Prebrskaj in izberite drugo mapo. $_CLICK\n# ^DirSubText\nCiljna mapa\n# ^DirBrowseText\nIzberite mapo, kamor želite namestiti $(^NameDA):\n# ^UnDirText\nOdstranili boste $(^NameDA) iz sledeče mape. Za izbiro druge mape kliknite tipko Prebrskaj in izberite drugo mapo. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nIzberite mapo, od koder želite odstraniti $(^NameDA):\n# ^SpaceAvailable\n\"Prostor na disku: \"\n# ^SpaceRequired\n\"Potreben prostor: \"\n# ^UninstallingText\n$(^NameDA) bo odstranjen iz naslednje mape. $_CLICK\n# ^UninstallingSubText\nOdstranjevanje iz:\n# ^FileError\nNapaka pri odpiranju datoteke za pisanje: \\r\\n\\r\\n$0\\r\\n\\r\\nPritisnite Prekini za prekinitev namestitve,\\r\\nPonovi za ponoven poskus ali\\r\\nPrezri za izpust te datoteke.\n# ^FileError_NoIgnore\nNapaka pri odpiranju datoteke za pisanje: \\r\\n\\r\\n$0\\r\\n\\r\\nPritisnite Ponovi za ponoven poskus pisanja ali\\r\\Prekliči za prekinitev namestitve.\n# ^CantWrite\n\"Ni mogoče pisati: \"\n# ^CopyFailed\nKopiranje neuspešno\n# ^CopyTo\n\"Kopiranje v \"\n# ^Registering\n\"Registracija: \"\n# ^Unregistering\n\"Preklic registracije: \"\n# ^SymbolNotFound\n\"Ni mogoče najti simbola: \"\n# ^CouldNotLoad\n\"Ni mogoče naložiti: \"\n# ^CreateFolder\n\"Ustvarjanje mape: \"\n# ^CreateShortcut\n\"Ustvarjanje bližnjice: \"\n# ^CreatedUninstaller\n\"Ustvarjena odstranitev: \"\n# ^Delete\n\"Brisanje datoteke: \"\n# ^DeleteOnReboot\n\"Brisanje ob ponovnem zagonu: \"\n# ^ErrorCreatingShortcut\n\"Napaka ustvarjanja bližnjice: \"\n# ^ErrorCreating\n\"Napaka ustvarjanja: \"\n# ^ErrorDecompressing\nNapaka pri razširjanju podatkov! Je namestitvena datoteka okvarjena?\n# ^ErrorRegistering\nNapaka registracije DLL\n# ^ExecShell\n\"Izvajanje v lupini: \"\n# ^Exec\n\"Izvajanje: \"\n# ^Extract\n\"Razširjanje: \"\n# ^ErrorWriting\n\"Razširjanje: napaka pri pisanju v datoteko \"\n# ^InvalidOpcode\nNamestitev neveljavna: napačen ukaz\n# ^NoOLE\n\"Neobstoječi OLE za: \"\n# ^OutputFolder\n\"Ciljna mapa: \"\n# ^RemoveFolder\n\"Odstranjevanje mape: \"\n# ^RenameOnReboot\n\"Preimenovanje ob zagonu: \"\n# ^Rename\n\"Preimenovanje: \"\n# ^Skipped\n\"Izpuščeno: \"\n# ^CopyDetails\nKopiraj podrobnosti v odložišče\n# ^LogInstall\nShrani potek namestitve\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Slovenian.nsh",
    "content": "﻿;Language: Slovenian (1060)\n;By Janez Dolinar, edited by Martin Srebotnjak - Lugos.si\n\n# We use \"slovenski\", the other alternative is \"slovenščina\" (Note: \"slovenčina\" is the native name of Slovak)\n!insertmacro LANGFILE \"Slovenian\" = \"Slovenski\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Dobrodošli v čarovniku namestitve $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Ta čarovnik vas vodi skozi namestitev programa $(^NameDA).$\\r$\\n$\\r$\\nPred namestitvijo je priporočeno zapreti vsa ostala okna in programe. S tem omogočite nemoteno namestitev programa in potrebnih sistemskih datotek brez ponovnega zagona računalnika.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Dobrodošli v čarovniku za odstranitev $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Ta čarovnik vas bo vodil skozi odstranitev $(^NameDA).$\\r$\\n$\\r$\\nPreden pričnete z odstranitvijo, se prepričajte, da program $(^NameDA) ni zagnan.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licenčna pogodba\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Prosimo, da si ogledate pogoje licenčne pogodbe pred namestitvijo $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Če se strinjate s pogoji, pritisnite Se strinjam. Da bi lahko namestili $(^NameDA), se morate s pogodbo strinjati.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Če se strinjate z licenčnimi pogoji pogodbe, spodaj izberite ustrezno okence. Za namestitev $(^NameDA) se morate strinjati s pogoji pogodbe. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Če se strinjate z licenčnimi pogoji pogodbe, spodaj izberite prvo možnost. Za namestitev $(^NameDA) se morate strinjati s pogoji pogodbe. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licenčna pogodba\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Prosimo, da pred odstranitvijo $(^NameDA) pregledate pogoje licenčne pogodbe.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Če se strinjate s pogoji licenčne pogodbe, izberite Se strinjam. Za odstranitev $(^NameDA) se morate strinjati s pogoji.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Če se strinjate s pogoji licenčne pogodbe, kliknite na okence spodaj. Za odstranitev $(^NameDA) se morate strinjati s pogoji. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Če se strinjate s pogoji licenčne pogodbe, spodaj izberite prvo podano možnost. Za odstranitev $(^NameDA) se morate strinjati s pogoji. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Za preostali del pogodbe pritisnite tipko 'Page Down'.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Izbor komponent\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Izberite, katere komponente izdelka $(^NameDA) želite namestiti.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Izbor komponent\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Izberite komponente $(^NameDA), ki jih želite odstraniti.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Opis\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Povlecite miško nad komponento, da vidite njen opis.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Izberite komponento za prikaz njenega opisa.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Izberite pot namestive\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Izberite mapo, v katero želite namestiti $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Izbor mape\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Izberite mapo, iz katere želite odstraniti $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Nameščanje poteka\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Prosimo, počakajte, $(^NameDA) se namešča.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Dokončana namestitev\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Namestitev je uspešno zaključena.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Prekinjena namestitev\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Namestitev ni bila uspešno zaključena.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Odstranjevanje poteka\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Prosimo, počakajte, dokler se program $(^NameDA) odstranjuje.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Odstranitev končana\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Odstranitev je uspešno končana.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Odstranitev prekinjena\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Odstranitev ni bila končana uspešno.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Zaključevanje namestitve $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Program $(^NameDA) je bil nameščen na vaš računalnik.$\\r$\\n$\\r$\\nPritisnite Dokončaj za zaprtje čarovnika.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Za dokončanje namestitve $(^NameDA) morate ponovno zagnati računalnik. Želite zdaj ponovno zagnati računalnik?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Čarovnik za odstranitev $(^NameDA) se zaključuje\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Program $(^NameDA) je odstranjen z vašega računalnika.$\\r$\\n$\\r$\\nKliknite Dokončaj, da zaprete čarovnika.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Da bi se namestitev $(^NameDA) dokončala, morate ponovno zagnati računalnik. Želite zdaj znova zagnati računalnik?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Ponovni zagon\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Računalnik želim znova zagnati kasneje\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Zaženi $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Pokaži BeriMe\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"Do&končaj\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Izberite mapo menija Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Izberite mapo menija Start za bližnjice do $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Izberite mapo menija Start, kjer želite ustvariti bližnjico do programa. Če vpišete novo ime, boste ustvarili istoimensko mapo.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Ne ustvari bližnjic\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Odstranitev $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Odstrani $(^NameDA) z vašega računalnika.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ste prepričani, da želite prekiniti namestitev $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Ste prepričani, da želite zapustiti odstranitev $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Izberite uporabnike\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Izberite uporabnike, za katere želite namestiti $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Izberite, ali želite namestiti $(^NameDA) le zase ali za vse uporabnike tega računalnika. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Namesti za vse uporabnike tega računalnika\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Namesti le zame\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Spanish.nlf",
    "content": "﻿# Header, don't edit ;Español - España (Alfabetización Tradicional)\nNLF v6\n# Language ID\n1034\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by MoNKi & Joel\n# Review and minor corrections Darwin Rodrigo Toledo Cáceres (niwrad777@gmail.com) www.winamp-es.com\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalación de $(^Name)\n# ^UninstallCaption\nDesinstalación de $(^Name)\n# ^LicenseSubCaption\n: Acuerdo de Licencia\n# ^ComponentsSubCaption\n: Opciones de Instalación\n# ^DirSubCaption\n: Directorio de Instalación\n# ^InstallingSubCaption\n: Instalando\n# ^CompletedSubCaption\n: Completado\n# ^UnComponentsSubCaption\n: Opciones de Desinstalación\n# ^UnDirSubCaption\n: Directorio de Desinstalación\n# ^ConfirmSubCaption\n: Confirmación\n# ^UninstallingSubCaption\n: Desinstalando\n# ^UnCompletedSubCaption\n: Completado\n# ^BackBtn\n< &Atrás\n# ^NextBtn\n&Siguiente >\n# ^AgreeBtn\nA&cepto\n# ^AcceptBtn\nA&cepto los términos de la licencia\n# ^DontAcceptBtn\n&No acepto los términos de la licencia\n# ^InstallBtn\n&Instalar\n# ^UninstallBtn\n&Desinstalar\n# ^CancelBtn\nCancelar\n# ^CloseBtn\n&Cerrar\n# ^BrowseBtn\n&Examinar...\n# ^ShowDetailsBtn\nVer &detalles\n# ^ClickNext\nPresione Siguiente para continuar.\n# ^ClickInstall\nPresione Instalar para comenzar la instalación.\n# ^ClickUninstall\nPresione Desinstalar para comenzar la desinstalación.\n# ^Name\nNombre\n# ^Completed\nCompletado\n# ^LicenseText\nPor favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si acepta todos los términos del acuerdo, presione Acepto.\n# ^LicenseTextCB\nPor favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si acepta todos los términos del acuerdo, marque abajo la casilla. $_CLICK\n# ^LicenseTextRB\nPor favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si acepta todos los términos del acuerdo, seleccione abajo la primera opción. $_CLICK\n# ^UnLicenseText\nPor favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si acepta todos los términos del acuerdo, presione Acepto.\n# ^UnLicenseTextCB\nPor favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si acepta todos los términos del acuerdo, marque abajo la casilla. $_CLICK.\n# ^UnLicenseTextRB\nPor favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si acepta todos los términos del acuerdo, seleccione abajo la primera opción. $_CLICK\n# ^Custom\nPersonalizada\n# ^ComponentsText\nMarque los componentes que desee instalar y desmarque los componentes que no desee instalar. $_CLICK\n# ^ComponentsSubText1\nTipos de instalación:\n# ^ComponentsSubText2_NoInstTypes\nSeleccione los componentes a instalar:\n# ^ComponentsSubText2\nO seleccione los componentes opcionales que desee instalar:\n# ^UnComponentsText\nMarque los componentes que desee desinstalar y desmarque los componentes que no desee desinstalar. $_CLICK\n# ^UnComponentsSubText1\nTipos de desinstalación:\n# ^UnComponentsSubText2_NoInstTypes\nSeleccione los componentes a desinstalar:\n# ^UnComponentsSubText2\nO seleccione los componentes opcionales que desee desinstalar:\n# ^DirText\nEl programa de instalación instalará $(^NameDA) en el siguiente directorio. Para instalar en un directorio diferente, presione Examinar y seleccione otro directorio. $_CLICK\n# ^DirSubText\nDirectorio de Destino\n# ^DirBrowseText\nSeleccione el directorio en el que instalará $(^NameDA):\n# ^UnDirText\nEl programa de instalación desinstalará $(^NameDA) del siguiente directorio. Para desinstalar de un directorio diferente, presione Examinar y seleccione otro directorio. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSeleccione el directorio desde el cual desinstalará $(^NameDA):\n# ^SpaceAvailable\nEspacio disponible: \n# ^SpaceRequired\nEspacio requerido: \n# ^UninstallingText\n$(^NameDA) será desinstalado del siguiente directorio. $_CLICK\n# ^UninstallingSubText\nDesinstalando desde:\n# ^FileError\nError abriendo archivo para escritura: \\r\\n\\t\"$0\"\\r\\nPresione abortar para anular la instalación,\\r\\nreintentar para volver a intentar escribir el archivo, u\\r\\nomitir para ignorar este archivo\n# ^FileError_NoIgnore\nError abriendo archivo para escritura: \\r\\n\\t\"$0\"\\r\\nPresione reintentar para volver a intentar escribir el archivo, o\\r\\ncancelar para anular la instalación\n# ^CantWrite\n\"No pudo escribirse: \"\n# ^CopyFailed\nFalló la copia\n# ^CopyTo\n\"Copiar a \"\n# ^Registering\n\"Registrando: \"\n# ^Unregistering\n\"Eliminando registro: \"\n# ^SymbolNotFound\n\"No pudo encontrarse símbolo: \"\n# ^CouldNotLoad\n\"No pudo cargarse: \"\n# ^CreateFolder\n\"Creando directorio: \"\n# ^CreateShortcut\n\"Creando acceso directo: \"\n# ^CreatedUninstaller\n\"Creando desinstalador: \"\n# ^Delete\n\"Borrar archivo: \"\n# ^DeleteOnReboot\n\"Borrar al reinicio: \"\n# ^ErrorCreatingShortcut\n\"Error creando acceso directo: \"\n# ^ErrorCreating\n\"Error creando: \"\n# ^ErrorDecompressing\n¡Error descomprimiendo datos! ¿Instalador corrupto?\n# ^ErrorRegistering\nError registrando DLL\n# ^ExecShell\n\"Extrayendo  comando: \"\n# ^Exec\n\"Extrayendo : \"\n# ^Extract\n\"Extraer: \"\n# ^ErrorWriting\n\"Extraer: error escribiendo al archivo \"\n# ^InvalidOpcode\nInstalador corrupto: código de operación no válido\n# ^NoOLE\n\"Sin OLE para: \"\n# ^OutputFolder\n\"Directorio de salida: \"\n# ^RemoveFolder\n\"Eliminar directorio: \"\n# ^RenameOnReboot\n\"Renombrar al reinicio: \"\n# ^Rename\n\"Renombrar: \"\n# ^Skipped\n\"Omitido: \"\n# ^CopyDetails\nCopiar Detalles al Portapapeles\n# ^LogInstall\nRegistrar proceso de instalación \n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Spanish.nsh",
    "content": "﻿;Language: Spanish (1034)\n;By MoNKi & Joel\n;Updates & Review Darwin Rodrigo Toledo Cáceres - www.winamp-es.com - niwrad777@gmail.com\n\n!insertmacro LANGFILE \"Spanish\" = \"Español\" \"Espanol\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bienvenido al Asistente de Instalación de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Este programa instalará $(^NameDA) en su ordenador.$\\r$\\n$\\r$\\nSe recomienda que cierre todas las demás aplicaciones antes de iniciar la instalación. Esto hará posible actualizar archivos relacionados con el sistema sin tener que reiniciar su ordenador.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bienvenido al Asistente de Desinstalación de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Este asistente le guiará durante la desinstalación de $(^NameDA).$\\r$\\n$\\r$\\nAntes de comenzar la desinstalación, asegúrese de que $(^NameDA) no se está ejecutando.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Acuerdo de licencia\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Por favor revise los términos de la licencia antes de instalar $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Si acepta todos los términos del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para instalar $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si acepta los términos del acuerdo, marque abajo la casilla. Debe aceptar los términos para instalar $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si acepta los términos del acuerdo, seleccione abajo la primera opción. Debe aceptar los términos para instalar $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Acuerdo de licencia\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Por favor revise los términos de la licencia antes de desinstalar $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Si acepta todos los términos del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para desinstalar $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si acepta los términos del acuerdo, marque abajo la casilla. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si acepta los términos del acuerdo, seleccione abajo la primera opción. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Presione Avanzar Página para ver el resto del acuerdo.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Selección de componentes\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Seleccione qué características de $(^NameDA) desea instalar.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Selección de componentes\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Seleccione qué características de $(^NameDA) desea desinstalar.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descripción\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Sitúe el ratón encima de un componente para ver su descripción.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Seleccione un componente para ver su descripción.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Elegir lugar de instalación\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Elija el directorio para instalar $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Elegir lugar de desinstalación\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Elija el directorio desde el cual se desinstalará $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalando\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Por favor espere mientras $(^NameDA) se instala.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalación Completada\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"La instalación se ha completado correctamente.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalación Anulada\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"La instalación no se completó correctamente.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Desinstalando\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Por favor espere mientras $(^NameDA) se desinstala.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Desinstalación Completada\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"La desinstalación se ha completado correctamente.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Desinstalación Anulada\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"La desinstalación no se completó correctamente.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Completando el Asistente de Instalación de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) ha sido instalado en su sistema.$\\r$\\n$\\r$\\nPresione Terminar para cerrar este asistente.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Su sistema debe ser reiniciado para que pueda completarse la instalación de $(^NameDA). ¿Desea reiniciar ahora?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Completando el Asistente de Desinstalación de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) ha sido desinstalado de su sistema.$\\r$\\n$\\r$\\nPresione Terminar para cerrar este asistente.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Su ordenador debe ser reiniciado para completar la desinstalación de $(^NameDA). ¿Desea reiniciar ahora?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reiniciar ahora\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Deseo reiniciar manualmente más tarde\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Ejecutar $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Ver Léame\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Terminar\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Elegir Carpeta del Menú Inicio\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Elija una Carpeta del Menú Inicio para los accesos directos de $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Seleccione una carpeta del Menú Inicio en la que quiera crear los accesos directos del programa. También puede introducir un nombre para crear una nueva carpeta.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"No crear accesos directos\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstalar $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Elimina $(^NameDA) de su sistema.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"¿Está seguro de que desea salir de la instalación de $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"¿Está seguro de que desea salir de la desinstalación de $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Elegir Usuarios\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Elija los usuarios para los cuales Ud. desea instalar $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Seleccione si desea instalar $(^NameDA) sólo para Ud. o para todos los usuarios de este Ordenador.$(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instación para cualquier usuario de este ordenador\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instalación solo para mí\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/SpanishInternational.nlf",
    "content": "﻿# Header, don't edit ;Español (Alfabetización Internacional)\nNLF v6\n# Language ID\n3082\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Darwin Rodrigo Toledo Cáceres - www.winamp-es.com - nwrad777@gmail.com\n# Base traslation by MoNKi & Joel\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nInstalación de $(^Name)\n# ^UninstallCaption\nDesinstalación de $(^Name)\n# ^LicenseSubCaption\n: Acuerdo de Licencia\n# ^ComponentsSubCaption\n: Opciones de Instalación\n# ^DirSubCaption\n: Carpeta de Instalación\n# ^InstallingSubCaption\n: Instalando\n# ^CompletedSubCaption\n: Finalizado\n# ^UnComponentsSubCaption\n: Opciones de Desinstalación\n# ^UnDirSubCaption\n: Carpeta de Desinstalación\n# ^ConfirmSubCaption\n: Confirmación\n# ^UninstallingSubCaption\n: Desinstalando\n# ^UnCompletedSubCaption\n: Finalizado\n# ^BackBtn\n< &Atrás\n# ^NextBtn\n&Siguiente >\n# ^AgreeBtn\n&Acepto\n# ^AcceptBtn\n&Acepto las condiciones del Acuerdo de Licencia\n# ^DontAcceptBtn\nNo &acepto las condiciones del Acuerdo de Licencia\n# ^InstallBtn\n&Instalar\n# ^UninstallBtn\n&Desinstalar\n# ^CancelBtn\nCancelar\n# ^CloseBtn\n&Cerrar\n# ^BrowseBtn\n&Examinar...\n# ^ShowDetailsBtn\nMostrar &detalles\n# ^ClickNext\nPresione Siguiente para continuar.\n# ^ClickInstall\nPresione Instalar para iniciar la instalación.\n# ^ClickUninstall\nPresione Desinstalar para iniciar la desinstalación.\n# ^Name\nNombre\n# ^Completed\nFinalizado\n# ^LicenseText\nPor favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, presione Acepto.\n# ^LicenseTextCB\nPor favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, marque abajo la casilla. $_CLICK\n# ^LicenseTextRB\nPor favor, revise el acuerdo de licencia antes de instalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, seleccione abajo la primera opción. $_CLICK\n# ^UnLicenseText\nPor favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, presione Acepto.\n# ^UnLicenseTextCB\nPor favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, marque abajo la casilla. $_CLICK\n# ^UnLicenseTextRB\nPor favor, revise el acuerdo de licencia antes de desinstalar $(^NameDA). Si usted acepta todas las condiciones del acuerdo, seleccione abajo la primera opción. $_CLICK\n# ^Custom\nPersonalizada\n# ^ComponentsText\nMarque los componentes que desee instalar y desmarque los componentes que no desee instalar. $_CLICK\n# ^ComponentsSubText1\nSeleccione el tipo de instalación:\n# ^ComponentsSubText2_NoInstTypes\nSeleccione los componentes a instalar:\n# ^ComponentsSubText2\nO seleccione los componentes opcionales que desee instalar:\n# ^UnComponentsText\nMarque los componentes que desee desinstalar y desmarque los componentes que no desee desinstalar. $_CLICK\n# ^UnComponentsSubText1\nSeleccione el tipo de desinstalación:\n# ^UnComponentsSubText2_NoInstTypes\nSeleccione los componentes a desinstalar:\n# ^UnComponentsSubText2\nO seleccione los componentes opcionales que desee desinstalar:\n# ^DirText\nEl programa de instalación instalará $(^NameDA) en la siguiente carpeta. Para instalar en una carpeta diferente, presione Examinar y seleccione otra carpeta. $_CLICK\n# ^DirSubText\nCarpeta de Destino\n# ^DirBrowseText\nSeleccione la carpeta en la que instalará $(^NameDA):\n# ^UnDirText\nEl programa de instalación desinstalará $(^NameDA) de la siguiente carpeta. Para desinstalar de una carpeta diferente, presione Examinar y seleccione otra carpeta. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nSeleccione la carpeta desde la que desinstalará $(^NameDA):\n# ^SpaceAvailable\nEspacio disponible:\n# ^SpaceRequired\nEspacio requerido:\n# ^UninstallingText\n$(^NameDA) será desinstalado de la siguiente carpeta. $_CLICK\n# ^UninstallingSubText\nDesinstalando desde:\n# ^FileError\nError abriendo archivo para escribir: \\r\\n\\r\\n$0\\r\\n\\r\\nPresione Abortar para detener la instalación,\\r\\nReintentar para probar otra vez, o\\r\\nOmitir para ignorar este archivo.\n# ^FileError_NoIgnore\nError abriendo archivo para escribir: \\r\\n\\r\\n$0\\r\\n\\r\\nPresione Reintentar para probar otra vez, o\\r\\nCancelar para detener la instalación.\n# ^CantWrite\n\"No pudo escribirse: \"\n# ^CopyFailed\nCopia fallida\n# ^CopyTo\n\"Copiar a \"\n# ^Registering\n\"Registrando: \"\n# ^Unregistering\n\"Eliminando registro: \"\n# ^SymbolNotFound\n\"No se encontró simbolo: \"\n# ^CouldNotLoad\n\"No pudo cargarse: \"\n# ^CreateFolder\n\"Creando carpeta: \"\n# ^CreateShortcut\n\"Creando acceso directo: \"\n# ^CreatedUninstaller\n\"Creando desinstalador: \"\n# ^Delete\n\"Borrar archivo: \"\n# ^DeleteOnReboot\n\"Borrar al reinicio: \"\n# ^ErrorCreatingShortcut\n\"Error creando acceso directo: \"\n# ^ErrorCreating\n\"Error creando: \"\n# ^ErrorDecompressing\n¡Error descomprimiendo datos! ¿Instalador corrupto?\n# ^ErrorRegistering\nError registrando DLL\n# ^ExecShell\n\"Ejecutando comando: \"\n# ^Exec\n\"Ejecutando: \"\n# ^Extract\n\"Extrayendo: \"\n# ^ErrorWriting\n\"Extrayendo: error escribiendo al archivo \"\n# ^InvalidOpcode\nInstalador corrupto: código de operación no válido\n# ^NoOLE\n\"Sin OLE para: \"\n# ^OutputFolder\n\"Carpeta de salida: \"\n# ^RemoveFolder\n\"Eliminar carpeta: \"\n# ^RenameOnReboot\n\"Renombrar al reinicio: \"\n# ^Rename\n\"Renombrar: \"\n# ^Skipped\n\"Omitido: \"\n# ^CopyDetails\nCopiar Detalles al Portapapeles\n# ^LogInstall\nRegistrar proceso de instalación\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/SpanishInternational.nsh",
    "content": "﻿;Language: Spanish International (3082)\n;By Darwin Rodrigo Toledo Cáceres - www.winamp-es.com - niwrad777@gmail.com\n;Base by Monki y Joel\n\n!insertmacro LANGFILE \"SpanishInternational\" \"Spanish (International)\" \"Español (Alfabetización Internacional)\" \"Espanol (Alfabetizacion Internacional)\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Bienvenido al Asistente de Instalación de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Este asistente le guiará a través de la instalación de $(^NameDA).$\\r$\\n$\\r$\\nSe recomienda que cierre todas la demás aplicaciones antes de iniciar la instalación. Esto hará posible actualizar archivos de sistema sin tener que reiniciar su computadora.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Bienvenido al Asistente de Desinstalación de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Este asistente le guiará durante la desinstalación de $(^NameDA).$\\r$\\n$\\r$\\nAntes de iniciar la desinstalación, asegúrese de que $(^NameDA) no se está ejecutando.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Acuerdo de licencia\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Por favor revise el acuerdo de licencia antes de instalar $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Si acepta todas las condiciones del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para instalar $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si acepta las condiciones del acuerdo, marque abajo la casilla. Debe aceptar las condiciones para instalar $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si acepta las condiciones del acuerdo, seleccione abajo la primera opción. Debe aceptar las condiciones para instalar $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Acuerdo de licencia\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Por favor revise el acuerdo de licencia antes de desinstalar $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Si acepta todas las condiciones del acuerdo, seleccione Acepto para continuar. Debe aceptar el acuerdo para desinstalar $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Si acepta los términos del acuerdo, marque abajo la casilla. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Si acepta los términos del acuerdo, seleccione abajo la primera opción. Debe aceptar los términos para desinstalar $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Presione Avanzar Página para ver el resto del acuerdo.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Selección de componentes\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Seleccione qué características de $(^NameDA) desea instalar.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Selección de componentes\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Seleccione qué características de $(^NameDA) desea desinstalar.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Descripción\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Sitúe el ratón encima de un componente para ver su descripción.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Seleccione un componente para ver su descripción.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Elegir lugar de instalación\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Elija la carpeta para instalar $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Elegir lugar de desinstalación\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Elija la carpeta desde la cual desinstalará $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Instalando\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Por favor espere mientras $(^NameDA) se instala.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Instalación Finalizada\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"La instalación se ha finalizado correctamente.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Instalación Abortada\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"La instalación no se terminó correctamente.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Desinstalando\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Por favor espere mientras $(^NameDA) se desinstala.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Desinstalación Finalizada\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"La desinstalación se ha finalizado correctamente.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Desinstalación Abortada\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"La desinstalación no se terminó correctamente.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Finalizando el Asistente de Instalación de $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) ha sido instalado en su sistema.$\\r$\\n$\\r$\\nPresione Terminar para cerrar este asistente.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Su sistema debe ser reiniciado para poder finalizar la instalación de $(^NameDA). ¿Desea reiniciar ahora?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Completando el Asistente de Desinstalación de $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) ha sido desinstalado de su sistema.$\\r$\\n$\\r$\\nPresione Terminar para cerrar este asistente.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Su computadora debe ser reiniciada para finalizar la desinstalación de $(^NameDA). ¿Desea reiniciar ahora?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Reiniciar ahora\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Deseo reiniciar manualmente más tarde\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Ejecutar $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Mostrar Léame\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Terminar\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Elegir Carpeta del Menú Inicio\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Elija una Carpeta del Menú Inicio para los accesos directos de $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Seleccione una carpeta del Menú Inicio en la que quiera crear los accesos directos del programa. También puede introducir un nombre para crear una nueva carpeta.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"No crear accesos directos\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Desinstalar $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Elimina $(^NameDA) de su sistema.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"¿Está seguro de que desea salir de la instalación de $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"¿Está seguro de que desea salir de la desinstalación de $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Elegir Usuarios\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Elija los usuarios para los cuales Ud. desea instalar $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Elija una opción si desea instalar $(^NameDA) para sólo para Ud., o para todos los usuarios de esta computadora.$(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Instación para cualquier usuario de esta computadora\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Instalación solo para mí\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Swedish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1053\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Magnus Bonnevier (magnus.bonnevier@telia.com)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Installation\n# ^UninstallCaption\n$(^Name) Avinstallation\n# ^LicenseSubCaption\n: Licensavtal\n# ^ComponentsSubCaption\n: Installationsval\n# ^DirSubCaption\n: Installationskatalog\n# ^InstallingSubCaption\n: Installerar\n# ^CompletedSubCaption\n: Slutförd\n# ^UnComponentsSubCaption\n: Avinstallationsval\n# ^UnDirSubCaption\n: Avinstallationskatalog\n# ^ConfirmSubCaption\n: Bekräftelse\n# ^UninstallingSubCaption\n: Avinstallerar\n# ^UnCompletedSubCaption\n: Slutförd\n# ^BackBtn\n< &Tillbaka\n# ^NextBtn\n&Nästa >\n# ^AgreeBtn\nJag &Godkänner\n# ^AcceptBtn\nJag &Godkänner villkoren i licensavtalet\n# ^DontAcceptBtn\nJag &Godkänner inte villkoren i licensavtalet\n# ^InstallBtn\n&Installera\n# ^UninstallBtn\n&Avinstallera\n# ^CancelBtn\nAvbryt\n# ^CloseBtn\n&Stäng\n# ^BrowseBtn\nB&läddra...\n# ^ShowDetailsBtn\nVisa &detaljer\n# ^ClickNext\nKlicka på Nästa för att fortsätta.\n# ^ClickInstall\nKlicka på Installera för att starta installationen.\n# ^ClickUninstall\nKlicka på Avinstallera för att starta avinstallationen.\n# ^Name\nNamn\n# ^Completed\nSlutförd\n# ^LicenseText\nVar vänlig läs igenom licensvillkoren innan du installerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka Jag Godkänner.\n# ^LicenseTextCB\nVar vänlig läs igenom licensvillkoren innan du installerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. $_CLICK\n# ^LicenseTextRB\nVar vänlig läs igenom licensvillkoren innan du installerar $(^NameDA). Om du accepterar villkoren i avtalet, välj det första alternativet nedan. $_CLICK\n# ^UnLicenseText\nVar vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka Jag Godkänner.\n# ^UnLicenseTextCB\nVar vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA). Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. $_CLICK\n# ^UnLicenseTextRB\nVar vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA). Om du accepterar villkoren i avtalet, välj det första alternativet nedan. $_CLICK\n# ^Custom\nValfri\n# ^ComponentsText\nMarkera de komponenter du vill installera och avmarkera de komponenter du inte vill installera. $_CLICK\n# ^ComponentsSubText1\nVälj typ av installation:\n# ^ComponentsSubText2_NoInstTypes\nVälj komponenter att installera:\n# ^ComponentsSubText2\nEller, välj de alternativa komponenter du önskar installera:\n# ^UnComponentsText\nMarkera de komponenter du vill avinstallera och avmarkera de komponenter du inte vill avinstallera. $_CLICK\n# ^UnComponentsSubText1\nVälj typ av avinstallation:\n# ^UnComponentsSubText2_NoInstTypes\nVälj komponenter att avinstallera:\n# ^UnComponentsSubText2\nEller, välj de alternativa komponenter du önskar avinstallera:\n# ^DirText\nGuiden kommer att installera $(^NameDA) i följande katalog. För att installera i en annan katalog, klicka Bläddra och välj en alternativ katalog. $_CLICK\n# ^DirSubText\nMålkatalog\n# ^DirBrowseText\nVälj katalog att installera $(^NameDA) i:\n# ^UnDirText\nInstallationsguiden kommer att avinstallera $(^NameDA) från följande katalog. För att avinstallera från en annan katalog, klicka Bläddra och välj en annan katalog. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nVälj katalog att avinstallera $(^NameDA) från:\n# ^SpaceAvailable\n\"Utrymme tillgängligt: \"\n# ^SpaceRequired\n\"Utrymme som behövs: \"\n# ^UninstallingText\n$(^NameDA) kommer att avinstalleras från följande katalog. $_CLICK\n# ^UninstallingSubText\nAvinstallerar från:\n# ^FileError\nFel vid Öppning av fil för skrivning: \\r\\n\\t\"$0\"\\r\\nKlicka på avbryt för att avbryta installationen,\\r\\nförsök igen för att försöka skriva till filen igen, eller\\r\\nIgnorera för att skippa denna fil\n# ^FileError_NoIgnore\nFel vid Öppning av fil för skrivning: \\r\\n\\t\"$0\"\\r\\nKlicka på försök igen för att skriva till filen igen, eller\\r\\navbryt för att avbryta installationen\n# ^CantWrite\n\"Kan inte skriva: \"\n# ^CopyFailed\nKopiering misslyckades\n# ^CopyTo\n\"Kopiera till \"\n# ^Registering\n\"Registrerar: \"\n# ^Unregistering\n\"Avregistrerar: \"\n# ^SymbolNotFound\n\"Kunde inte hitta symbol: \"\n# ^CouldNotLoad\n\"Kunde inte ladda: \"\n# ^CreateFolder\n\"Skapa katalog: \"\n# ^CreateShortcut\n\"Skapa genväg: \"\n# ^CreatedUninstaller\n\"Skapade avinstallationsprogram: \"\n# ^Delete\n\"Radera fil: \"\n# ^DeleteOnReboot\n\"Radera vid omstart: \"\n# ^ErrorCreatingShortcut\n\"Fel vid skapande av genväg: \"\n# ^ErrorCreating\n\"Fel vid skapande: \"\n# ^ErrorDecompressing\nFel vid uppackning av data! Skadat installationspaket?\n# ^ErrorRegistering\nFel vid registrering av DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Kör: \"\n# ^Extract\n\"Extrahera: \"\n# ^ErrorWriting\n\"Extrahera: fel vid skrivning till fil \"\n# ^InvalidOpcode\nInstallationspaket skadat: ogiltig opcode\n# ^NoOLE\n\"Ingen OLE för: \"\n# ^OutputFolder\n\"Målkatalog: \"\n# ^RemoveFolder\n\"Ta bort katalog: \"\n# ^RenameOnReboot\n\"Döp om vid omstart: \"\n# ^Rename\n\"Döp om: \"\n# ^Skipped\n\"Ignorerad: \"\n# ^CopyDetails\nKopiera detaljinformation till klippbordet\n# ^LogInstall\nLogga installationsförfarandet\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Swedish.nsh",
    "content": "﻿;Compatible with Modern UI 1.72\n;Language: Swedish (1053)\n;By Magnus Bonnevier (magnus.bonnevier@telia.com), updated by Rickard Angbratt (r.angbratt@home.se), updated by Ulf Axelsson (ulf.axelsson@gmail.com)\n\n!insertmacro LANGFILE \"Swedish\" = \"Svenska\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Välkommen till installationsguiden för $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Denna guide tar dig igenom installationen av $(^NameDA).$\\r$\\n$\\r$\\nDet rekommenderas att du avslutar alla andra program innan du fortsätter installationen. Detta tillåter att installationen uppdaterar nödvändiga systemfiler utan att behöva starta om din dator.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Välkommen till avinstallationsguiden för $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Denna guide tar dig igenom avinstallationen av $(^NameDA).$\\r$\\n$\\r$\\nInnan du startar avinstallationen, försäkra dig om att $(^NameDA) inte körs.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Licensavtal\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Var vänlig läs igenom licensvillkoren innan du installerar $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Om du accepterar villkoren i avtalet, klicka Jag Godkänner för att fortsätta. Du måste acceptera avtalet för att installera $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. Du måste acceptera avtalet för att installera $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Om du accepterar villkoren i avtalet, välj det första alternativet nedan. Du måste acceptera avtalet för att installera $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Licensavtal\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Var vänlig läs igenom licensvillkoren innan du avinstallerar $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Om du accepterar villkoren i avtalet, klicka Jag Godkänner för att fortsätta. Du måste acceptera avtalet för att avinstallera $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Om du accepterar villkoren i avtalet, klicka i checkrutan nedan. Du måste acceptera avtalet för att avinstallera $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Om du accepterar villkoren i avtalet, välj det första alternativet nedan. Du måste acceptera avtalet för att avinstallera $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Tryck Page Down för att se resten av licensavtalet.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Välj komponenter\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Välj vilka alternativ av $(^NameDA) som du vill installera.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Välj komponenter\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Välj vilka alternativ av $(^NameDA) som du vill avinstallera.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Beskrivning\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Håll muspekaren över ett alternativ för att se dess beskrivning.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Välj ett alternativ för att se dess beskrivning.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Välj installationsväg\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Välj katalog att installera $(^NameDA) i.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Välj avinstallationsväg\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Välj katalog att avinstallera $(^NameDA) från.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Installerar\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Var vänlig vänta medan $(^NameDA) installeras.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Installationen är klar\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Guiden avslutades korrekt.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Installationen avbröts\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Guiden genomfördes inte korrekt.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Avinstallerar\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Var vänlig vänta medan $(^NameDA) avinstalleras.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Avinstallationen genomförd\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Avinstallationen genomfördes korrekt.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Avinstallationen avbruten\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Avinstallationen genomfördes inte korrekt.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Avslutar installationsguiden för $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) har installerats på din dator.$\\r$\\n$\\r$\\nKlicka på Slutför för att avsluta guiden.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Din dator måste startas om för att fullborda installationen av $(^NameDA). Vill du starta om nu?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Avslutar avinstallationsguiden för $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) komponenter har avinstallerats från din dator.$\\r$\\n$\\r$\\nKlicka på Slutför för att avsluta guiden.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Din dator måste startas om för att fullborda avinstallationen av $(^NameDA). Vill du starta om nu?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Starta om nu\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Jag vill starta om själv senare\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Kör $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Visa Readme-filen\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Slutför\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Välj Startmenykatalog\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Välj en Startmenykatalog för programmets genvägar.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Välj startmenykatalog i vilken du vill skapa programmets genvägar. Du kan ange ett eget namn för att skapa en ny katalog.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Skapa ej genvägar\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Avinstallera $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Ta bort $(^NameDA) från din dator.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Är du säker på att du vill avbryta installationen av $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Är du säker på att du vill avbryta avinstallationen av $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Välj användare\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Välj för vilka användare du vill installera $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Välj huruvida du vill installera $(^NameDA) enbart för dig själv eller för alla användare på denna dator. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Installera för alla som använder denna dator\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Installera bara för mig\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Tatar.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1092\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by Bulat Azat uly [ bulat_ibrahim@mail.ru ]\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nУрнаштыру $(^Name)\n# ^UninstallCaption\nБетерү $(^Name)\n# ^LicenseSubCaption\n: Лицензия килешүе\n# ^ComponentsSubCaption\n: Урнаштыру шартлары\n# ^DirSubCaption\n: Урнаштыру папкасы\n# ^InstallingSubCaption\n: Файлларны күчермәләү\n# ^CompletedSubCaption\n: Гамәл тәмамланды\n# ^UnComponentsSubCaption\n: Бетерү шартлары\n# ^UnDirSubCaption\n: Бетерү папкасы\n# ^ConfirmSubCaption\n: Раслау\n# ^UninstallingSubCaption\n: Файлларны бетерү\n# ^UnCompletedSubCaption\n: Гамәл тәмамланды\n# ^BackBtn\n< &Артка\n# ^NextBtn\n&Алга >\n# ^AgreeBtn\nКабул ит&әм\n# ^AcceptBtn\nМин &килешү шартларын кабул итәм\n# ^DontAcceptBtn\nМин &килешү шартларын кабул итими\n# ^InstallBtn\n&Урнаштырырга\n# ^UninstallBtn\nБе&терергә\n# ^CancelBtn\nБаш тарту\n# ^CloseBtn\n&Ябарга\n# ^BrowseBtn\nК&арарга...\n# ^ShowDetailsBtn\n&Тулырак...\n# ^ClickNext\nДәвам итү өчен 'Алга' төймәсенә басыгыз.\n# ^ClickInstall\nПрограмманы урнаштыру өчен 'Урнаштырырга' төймәсенә басыгыз.\n# ^ClickUninstall\nПрограмманы бетерү өчен 'Бетерергә' төймәсенә басыгыз.\n# ^Name\nИсем\n# ^Completed\nӘзер\n# ^LicenseText\n$(^NameDA) урнаштыру алдыннан лицензия килешүе белән танышыгыз. Килешү шартларын кабул итсәгез, 'Кабул итәм' төймәсенә басыгыз.\n# ^LicenseTextCB\n$(^NameDA) урнаштыру алдыннан лицензия килешүе белән танышыгыз. Килешү шартларын кабул итсәгез, түбәндә билге куегыз. $_CLICK\n# ^LicenseTextRB\n$(^NameDA) урнаштыру алдыннан лицензия килешүе белән танышыгыз. Килешү шартларын кабул итсәгез, түбәндәге вариантлардан беренчесен сайлагыз. $_CLICK\n# ^UnLicenseText\n$(^NameDA) урнаштыру алдыннан лицензия килешүе белән танышыгыз. Килешү шартларын кабул итсәгез, 'Кабул итәм' төймәсенә басыгыз.\n# ^UnLicenseTextCB\n$(^NameDA) урнаштыру алдыннан лицензия килешүе белән танышыгыз. Килешү шартларын кабул итсәгез, түбәндә билге куегыз. $_CLICK\n# ^UnLicenseTextRB\n$(^NameDA) урнаштыру алдыннан лицензия килешүе белән танышыгыз. Килешү шартларын кабул итсәгез, түбәндәге вариантлардан беренчесен сайлагыз. $_CLICK\n# ^Custom\nСайлап кына\n# ^ComponentsText\nПрограмманың урнаштырырга теләгән компонентларын сайлагыз. $_CLICK\n# ^ComponentsSubText1\nУрнаштыру төрен сайлагыз:\n# ^ComponentsSubText2_NoInstTypes\nУрнаштыру өчен программаның компонентларын сайлагыз:\n# ^ComponentsSubText2\nяки урнаштыру өчен өстәмә компонентлар сайлагыз:\n# ^UnComponentsText\nБетерергә теләгән компонентларны сайлагыз. $_CLICK\n# ^UnComponentsSubText1\nБетерү төрен сайлагыз:\n# ^UnComponentsSubText2_NoInstTypes\nБетерү өчен компонентларны сайлагыз:\n# ^UnComponentsSubText2\nяки бетерү өчен өстәмә компонентларны сайлагыз:\n# ^DirText\nПрограмма $(^NameDA) программасын күрсәтерлән папкага урнаштырачак. Башка папкага урнаштыру өчен, 'Карарга' төймәсенә басыгыз һәм урын күрсәтегез. $_CLICK\n# ^DirSubText\nУрнаштыру папкасы\n# ^DirBrowseText\n$(^NameDA) урнаштыру өчен папка сайлагыз:\n# ^UnDirText\nПрограмма $(^NameDA) программасын күрсәтелгән папкадан бетерәчәк. Башка папкадан бетерү өчен, 'Карарга' төймәсенә басыгыз һәм урын күрсәтегез. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n$(^NameDA) бетерергә кирәк булган папканы күрсәтегез:\n# ^SpaceAvailable\n\"Дискта буш урын: \"\n# ^SpaceRequired\n\"Дискта кирәк урын: \"\n# ^UninstallingText\n$(^NameDA) программасы санагыгыздан бетереләчәк. $_CLICK\n# ^UninstallingSubText\nМоннан бетерү:\n# ^FileError\nЯздыру өчен файлны ачып булмый: \\r\\n\\t\"$0\"\\r\\n'Туктату': урнаштыруны туктатырга;\\r\\n\"Кабатлау\": омтылышны кабатларга;\\r\\n\"Калдыру\": бу гамәлне төшереп калдырырга.\n# ^FileError_NoIgnore\nЯздыру өчен файлны ачып булмый: \\r\\n\\t\"$0\"\\r\\n'Кабатлау': омтылышны кабатларга;\\r\\n'Баш тарту': урнаштыру барышын туктатырга.\n# ^CantWrite\n\"Яздырып булмый: \"\n# ^CopyFailed\nКүчермә ясауда хата\n# ^CopyTo\n\"Монда күчермәләү: \"\n# ^Registering\n\"Теркәлү: \"\n# ^Unregistering\n\"Теркәүдән баш тарту: \"\n# ^SymbolNotFound\n\"Символны табып булмый: \"\n# ^CouldNotLoad\n\"Йөкләп булмый: \"\n# ^CreateFolder\n\"Папка ясау: \"\n# ^CreateShortcut\n\"Сылтама ясау: \"\n# ^CreatedUninstaller\n\"Бетерү программасын ясау: \"\n# ^Delete\n\"Файлны бетерү: \"\n# ^DeleteOnReboot\n\"Санак сүндереп кабызылганда бетерү: \"\n# ^ErrorCreatingShortcut\n\"Сылтама ясауда хата: \" \n# ^ErrorCreating\n\"Ясауда хата: \"\n# ^ErrorDecompressing\nМәгълүматларны чыгаруда хата! Урнаштыручы бозык булуы мөмкин.\n# ^ErrorRegistering\nDLL теркәүдә хата\n# ^ExecShell\n\"Тышча командасын башкару: \" \n# ^Exec\n\"Башкару: \"\n# ^Extract\n\"Чыгару: \"\n# ^ErrorWriting\n\"Чыгару: файл яздыруда хата \"\n# ^InvalidOpcode\nУрнаштыручы бозылган: мөмкин булмаган код\n# ^NoOLE\n\"OLE моның өчен юк: \" \n# ^OutputFolder\n\"Урнаштыру папкасы: \"\n# ^RemoveFolder\n\"Папканы бетерү: \"\n# ^RenameOnReboot\n\"Санак сүндереп кабызылганда исемен үзгәртү: \"\n# ^Rename\n\"Исемен үзгәртү: \"\n# ^Skipped\n\"Калдыру: \"\n# ^CopyDetails\nМәгълүматларны алмашыну буферына күчермәләргә\n# ^LogInstall\nУрнаштыру хисабын алып барырга\n# byte (байт)\nб\n# kilo\n К\n# mega\n М\n# giga\n Г"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Tatar.nsh",
    "content": "﻿;Language: Tatar (1092)\n;Translation by Bulat Azat uly [bulat_ibrahim@mail.ru]\n\n!insertmacro LANGFILE \"Tatar\" = \"Татарча\" \"Tatarcha\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) урнаштыручыга рәхим итегез\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Бу программа $(^NameDA) программасын санагыгызга урнаштырыр.$\\r$\\n$\\r$\\nУрнаштыру алдыннан бөтен ачык кушымталарны ябарга тәкъдим ителә. Бу урнаштыру программасына система файлларын санакны сүндереп кабызмыйча яңартырга мөмкинлек бирә.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"$(^NameDA) бетерүчегә рәхим итегез\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Бу программа $(^NameDA) программасын санагыгыздан бетерер.$\\r$\\n$\\r$\\nДәвам итү алдыннан $(^NameDA) җибәрелмәгәнлеген тикшерегез.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Лицензия килешүе\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"$(^NameDA) урнаштыру алдыннан лицензия килешүе белән танышыгыз.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Килешү шартларын кабул итсәгез, $\\\"Кабул итәм$\\\" төймәсенә басыгыз. $(^NameDA) урнаштыру өчен, килешүне кабул итәргә кирәк.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Килешү шартларын кабул итсәгез, түбәндә билге куегыз. $(^NameDA) урнаштыру өчен, килешүне кабул итәргә кирәк. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Килешү шартларын кабул итсәгез, түбәндәге вариантлардан беренчесен сайлагыз. $(^NameDA) урнаштыру өчен, килешүне кабул итәргә кирәк. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Лицензия килешүе\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"$(^NameDA) бетерү алдыннан лицензия килешүе белән танышыгыз.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Килешү шартларын кабул итсәгез, $\\\"Кабул итәм$\\\" төймәсенә басыгыз. $(^NameDA) бетерү өчен, килешүне кабул итәргә кирәк.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Килешү шартларын кабул итсәгез, түбәндә билге куегыз. $(^NameDA) бетерү өчен, килешүне кабул итәргә кирәк. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Килешү шартларын кабул итсәгез, түбәндәге вариантлардан беренчесен сайлагыз. $(^NameDA) бетерү өчен, килешүне кабул итәргә кирәк. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Текст буенча күчү өчен, $\\\"PageUp$\\\" һәм $\\\"PageDown$\\\" төймәләренә басыгыз.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Урнаштырылучы программаның компонентлары\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Урнаштырырга теләгән $(^NameDA) компонентларын сайлагыз.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Программа компонентлары\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Бетерергә теләгән $(^NameDA) компонентларын сайлагыз.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Тасвирлама\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Компонентның тасвирламасын уку өчен, аның исеменә тычкан курсорын китерегез.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Компонентның тасвирламасын уку өчен, аны билгеләгез.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Урнаштыру папкасын сайлау\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"$(^NameDA) урнаштыру өчен папка сайлагыз.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Бетерү папкасын сайлау\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"$(^NameDA) бетерергә кирәк булган папканы сайлагыз.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Файлларны күчермәләү\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"$(^NameDA) файллары күчермәләнә, көтегез...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Урнаштыру тәмамланды\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Урнаштыру уңышлы тәмамланды.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Урнаштыру туктатылды\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Урнаштыру уңышсыз тәмамланды.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Бетерү\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"$(^NameDA) файллары бетерелә, көтегез...\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Бетерү тәмамланды\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Программаны бетерү уңышлы тәмамланды.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Бетерү туктатылды\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Бетерү тулысынча башкарылмады.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) урнаштыручы эшен тәмамлау\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) санагыгызга урнаштырылды.$\\r$\\n$\\r$\\nУрнаштыру программасыннан чыгу өчен $\\\"Тәмам$\\\" төймәсенә басыгыз.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA) урнаштыруын тәмамлау өчен, санакны сүндереп кабызырга кирәк. Аны хәзер башкарыргамы?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) бетерүче эшен тәмамлау\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) санагыгыздан бетерелде.$\\r$\\n$\\r$\\nБетерү программасыннан чыгу өчен $\\\"Тәмам$\\\" төймәсенә басыгыз.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) бетерүен тәмамлау өчен, санакны сүндереп кабызырга кирәк. Аны хәзер башкарыргамы?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Әйе, санакны хәзер сүндереп кабызырга\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Юк, мин соңрак сүндереп кабызырмын\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) программасын җибәр&ергә\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&ReadMe файлын күрсәтергә\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Тәмам\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"$\\\"Башлау$\\\" менюсында папка\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"$\\\"Башлау$\\\" менюсында программа сылтамаларын урнаштыру өчен папка сайлагыз.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"$\\\"Башлау$\\\" менюсында программа сылтамалары урнаштырылачак папканы сайлагыз. Шулай ук папкага башка исем бирә аласыз.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Сылтамалар ясамаска\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA) бетерү\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Санактан $(^NameDA) бетерү.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Чыннан да $(^Name) урнаштыруын туктатыргамы?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Чыннан да $(^Name) бетерүен туктатыргамы?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Урнаштыру режимы\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Кайсы кулланучылар өчен $(^NameDA) урнаштырырга телисез, сайлагыз.\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"$(^NameDA) программасын үзегезгә генә яки бөтен кулланучылар өчен дә урнаштырачагыгызны сайлагыз. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Бөтен кулланучылар өчен урнаштырырга\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Минем өчен генә урнаштырырга\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Thai.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1054\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n874\n# RTL - anything else than RTL means LTR\n-\n# Translation by SoKoOLz, TuW@nNu (asdfuae)\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) ติดตั้ง\n# ^UninstallCaption\n$(^Name) ยกเลิกการติดตั้ง\n# ^LicenseSubCaption\n: ข้อตกลงเรื่องลิขสิทธิ์\n# ^ComponentsSubCaption\n: ตัวเลือกการติดตั้ง\n# ^DirSubCaption\n: แฟ้มที่ติดตั้ง\n# ^InstallingSubCaption\n: กำลังติดตั้ง\n# ^CompletedSubCaption\n: เสร็จสิ้น\n# ^UnComponentsSubCaption\n: ตัวเลือกยกเลิกการติดตั้ง\n# ^UnDirSubCaption\n: แฟ้มที่ยกเลิกการติดตั้ง\n# ^ConfirmSubCaption\n: ยืนยัน\n# ^UninstallingSubCaption\n: กำลังยกเลิกการติดตั้ง\n# ^UnCompletedSubCaption\n: เสร็จสิ้น\n# ^BackBtn\n< &กลับไป\n# ^NextBtn\n&ต่อไป >\n# ^AgreeBtn\n&ตกลง\n# ^AcceptBtn\n&ตกลงยอมรับข้อต่างๆในหัวข้อลิขสิทธิ์ \n# ^DontAcceptBtn\n&ไม่ยอมรับข้อต่างๆในหัวข้อลิขสิทธิ์\n# ^InstallBtn\n&ติดตั้ง\n# ^UninstallBtn\n&ยกเลิกการติดตั้ง\n# ^CancelBtn\nยกเลิก\n# ^CloseBtn\n&ปิด\n# ^BrowseBtn\nเ&รียกดู...\n# ^ShowDetailsBtn\n&รายละเอียด\n# ^ClickNext\nกด ต่อไป เพื่อเริ่มระบบอัติโนมัติ\n# ^ClickInstall\nกด  ติดตั้ง เพื่อทำการติดตั้ง\n# ^ClickUninstall\nกด  ยกเลิกการติดตั้ง เพื่อยกเลิกการติดตั้ง\n# ^Name\nชื่อ\n# ^Completed\nเสร็จสิ้นแล้ว\n# ^LicenseText\nโปรดอ่านทวนเรื่องการยอมรับในลิขสิทธิ์ก่อนที่คุณจะทำการติดตั้ง $(^NameDA). ถ้าคุณยอมรับข้อตกลงในทุกๆด้าน, กด ฉันยอมรับ\n# ^LicenseTextCB\nโปรดอ่านทวนเรื่องการยอมรับในลิขสิทธิ์ก่อนที่คุณจะทำการติดตั้ง $(^NameDA). ถ้าคุณยอมรับข้อตกลงในทุกๆด้าน, กดเลือกที่กล่องด้านล่าง. $_CLICK\n# ^LicenseTextRB\nโปรดอ่านทวนเรื่องการยอมรับในลิขสิทธิ์ก่อนที่คุณจะทำการติดตั้ง $(^NameDA). ถ้าคุณยอมรับข้อตกลงในทุกๆด้าน, เลือกตัวเลือกแรกข้างล่าง. $_CLICK\n# ^UnLicenseText\nโปรดอ่านทวนเรื่องการยอมรับในลิขสิทธิ์ก่อนที่คุณจะทำการยกเลิกติดตั้ง $(^NameDA). ถ้าคุณยอมรับข้อตกลงในทุกๆด้าน, กด ฉันยอมรับ\n# ^UnLicenseTextCB\nโปรดอ่านทวนเรื่องการยอมรับในลิขสิทธิ์ก่อนที่คุณจะทำการยกเลิกติดตั้ง $(^NameDA). ถ้าคุณยอมรับข้อตกลงในทุกๆด้าน, กดเลือกที่กล่องด้านล่าง. $_CLICK\n# ^UnLicenseTextRB\nโปรดอ่านทวนเรื่องการยอมรับในลิขสิทธิ์ก่อนที่คุณจะทำการยกเลิกติดตั้ง $(^NameDA). ถ้าคุณยอมรับข้อตกลงในทุกๆด้าน, เลือกตัวเลือกแรกข้างล่าง. $_CLICK\n# ^Custom\nกำหนดเอง\n# ^ComponentsText\nเลื่อกสิ่งที่คุณต้องการติดตั้งและไม่เลือกสิ่งที่คุณไม่ต้องการติดตั้ง $_CLICK\n# ^ComponentsSubText1\nเลือกวิธีการการติดตั้ง:\n# ^ComponentsSubText2_NoInstTypes\nเลือกสิ่งที่คุณต้องการติดตั้ง:\n# ^ComponentsSubText2\nหรือ, เลือกตัวเลือกที่คุณต้องการติดตั้ง:\n# ^UnComponentsText\nเลือกตัวเลือกที่คุณต้องการจะยกเลิกการติดตั้งและไม่เลือกสิ่งที่คุณไม่ต้องการจะยกเลิกการติดตั้ง $_CLICK\n# ^UnComponentsSubText1\nเลือกวิธีการยกเลิกการติดตั้ง:\n# ^UnComponentsSubText2_NoInstTypes\nเลือกตัวเลือกที่ต้องการจะยกเลิกการติดตั้ง:\n# ^UnComponentsSubText2\nหรือ, เลือกจากตัวเลือกอื่นๆที่คุณต้องการจะยกเลิกการติดตั้ง:\n# ^DirText\nตัวติดตั้งจะทำการติดตั้ง $(^NameDA) ลงในแฟ้มดังต่อไปนี้, ถ้าต้องการติดตั้งลงในแฟ้มอื่น, กด เรียกดูและเลือกแฟ้มอื่น $_CLICK\n# ^DirSubText\nแฟ้มที่ต้องการติดตั้ง\n# ^DirBrowseText\nเลือกแฟ้มที่ต้องการติดตั้ง $(^NameDA) ใน:\n# ^UnDirText\nตัวติดตั้งจะทำการยกเลิกการติดตั้ง $(^NameDA) จากแฟ้มดังต่อไปนี้, ถ้าต้องการยกเลิกการติดตั้งจากแฟ้มอื่น, กด เรียกดู และเลือกแฟ้มอื่น $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nเลือกแฟ้มที่ต้องการยกเลิกการติดตั้ง $(^NameDA) จาก:\n# ^SpaceAvailable\n\"มีพื้นที่เหลือ: \"\n# ^SpaceRequired\n\"ต้องการพื้นที่: \"\n# ^UninstallingText\n$(^NameDA) จะถูกยกเลิกการติดตั้งจากแฟ้มต่อไปนี้. $_CLICK\n# ^UninstallingSubText\nยกเลิกการติดตั้งจาก:\n# ^FileError\nไม่สามารถเปิดไฟล์สำหรับเขียนได้: \\r\\n\\r\\n$0\\r\\n\\r\\nกด ยกเลิก เพื่อหยุดการติดตั้ง,\\r\\nลองอีกครั้ง เพื่อลองอีกครั้ง, หรือ\\r\\nเพิกเฉย เพื่อข้ามไฟล์นี้.\n# ^FileError_NoIgnore\nไม่สามารถเปิดไฟล์สำหรับเขียนได้: \\r\\n\\r\\n$0\\r\\n\\r\\nกด ลองอีกครั้ง เพื่อลองอีกครั้ง, หรือ\\r\\nยกเลิกเพื่อหยุดการติดตั้ง\n# ^CantWrite\n\"ไม่สามารถเขียน: \"\n# ^CopyFailed\nคัดลอกผิดพลาด\n# ^CopyTo\n\"คัดลอกไปยัง \"\n# ^Registering\n\"กำลังลงทะเบียน: \"\n# ^Unregistering\n\"ยกเลิกการลงทะเบียน: \"\n# ^SymbolNotFound\n\"ไม่สามารถหาสัญลักษณ์ได้: \"\n# ^CouldNotLoad\n\"ไม่สามารถโหลดได้: \"\n# ^CreateFolder\n\"สร้างแฟ้ม: \"\n# ^CreateShortcut\n\"สร้างชอร์ตคัท: \"\n# ^CreatedUninstaller\n\"สร้างตัวยกเลิกการติดตั้ง: \"\n# ^Delete\n\"ลบไฟล์: \"\n# ^DeleteOnReboot\n\"ลบตอนรีบูท: \"\n# ^ErrorCreatingShortcut\n\"มีปัญหาสร้างไฟล์ชอร์ตคัท: \"\n# ^ErrorCreating\n\"มีปัญหาในการสร้างไฟล์: \"\n# ^ErrorDecompressing\nมีปัญหาในการคลายข้อมูล! เกิดข้อผิดพลาดจากตัวติดตั้ง?\n# ^ErrorRegistering\nมีปัญหาในการลงทะเบียน DLL\n# ^ExecShell\n\"รันเชลล์ไฟล์: \"\n# ^Exec\n\"รันไฟล์: \"\n# ^Extract\n\"แตกไฟล์: \"\n# ^ErrorWriting\n\"แตกไฟล์: เกิดปัญหาในการเขียนไฟล์\"\n# ^InvalidOpcode\nตัวติดตั้งมีปัญหา: รหัส opcode ผิดพลาด\n# ^NoOLE\n\"ไม่มี OLE สำหรับ: \"\n# ^OutputFolder\n\"แฟ้มทีติดตั้ง: \"\n# ^RemoveFolder\n\"ลบแฟ้ม: \"\n# ^RenameOnReboot\n\"เปลี่ยนชื่อตอนรีบูท: \"\n# ^Rename\n\"เปลี่ยนชื่อ: \"\n# ^Skipped\n\"ข้าม: \"\n# ^CopyDetails\nคัดลอกรายละเอียดลงคลิปบอร์ด\n# ^LogInstall\nบันทึกการติดตั้ง\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Thai.nsh",
    "content": "﻿;Language: Thai (1054)\n;By SoKoOLz, TuW@nNu (asdfuae)\n\n!insertmacro LANGFILE \"Thai\" = \"ไทย\" /* TODO: ISO 11940? */ \"Thai\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"ยินดีต้อนรับเข้าสู่การติดตั้งโปรแกรม $(^NameDA) \"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"ตัวติดตั้งอัติโนมัติจะนำคุณไปสู่การติดตั้งของ $(^NameDA).$\\r$\\n$\\r$\\nเราขอแนะนำให้ปิดโปรแกรมอื่นๆให้หมดก่อนที่จะเริ่มติดตั้ง, นี่จะเป็นการอัปเดทไฟล์ได้ง่ายขึ้นโดยคุณไม่จำเป็นต้องทำการรีบูทคอมพิวเตอร์ของคุณ$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"ยินดีต้อนรับสู่การยกเลิกการติดตั้งอัติโนมัติของ $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"ตัวติดตั้งอัติโนมัตินี้จะนำคุณไปสู่การยกเลิกการติดตั้งของ $(^NameDA).$\\r$\\n$\\r$\\nการจะเริ่มการยกเลิกการติดตั้งนี้, โปรดตรวจสอบว่า $(^NameDA) ไม่ได้ใช้อยู่$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"ข้อตกลงเรื่องลิขสิทธิ์\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"โปรดอ่านทวนลิขสิทธิ์ในหัวข้อต่างๆอีกครั้งก่อนที่คุณจะทำการติดตั้ง $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"ถ้าคุณยอมรับข้อตกลงเรื่องลิขสิทธิ์, กด ฉันยอมรับ เพื่อทำต่อไป, คุณต้องยอมรับในข้อตกลงลิขสิทธิ์เพื่อที่จะทำการติดตั้ง $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"ถ้าคุณยอมรับข้อตกลงเรื่องลิขสิทธ, กดเลือกในกล่องข้างล่างนี้  คุณต้องยอมรับในข้อตกลงลิขสิทธิ์เพื่อที่จะทำการติดตั้ง $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"ถ้าคุณยอมรับข้อตกลงเรื่องลิขสิทธ,  เลือกตัวเลือกแรกด้านล่างนี้ คุณต้องยอมรับในข้อตกลงลิขสิทธิ์เพื่อที่จะทำการติดตั้ง $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"ข้อตกลงเรื่องลิขสิทธิ์\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"กรุณาอ่านข้อตกลงด้านลิขสิทธิ์ก่อนติดตั้งโปรแกรม $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"ถ้าคุณยอมรับในข้อตกลงนี้ กรุณากดปุ่ม ฉันยอมรับ และคุณจะต้องตกลงก่อนที่จะเริ่มการยกเลิกติดตั้งโปรแกรม $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"ถ้าคุณยอมรับข้อตกลงเรื่องลิขสิทธิ์, กดเลือกในกล่องข้างล่างนี้ คุณต้องยอมรับในข้อตกลงลิขสิทธิ์เพื่อที่จะทำการติดตั้ง $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"ถ้าคุณยอมรับข้อตกลงเรื่องลิขสิทธิ์, เลือกตัวเลือกแรกด้านล่างนี้ คุณต้องยอมรับในข้อตกลงลิขสิทธิ์เพื่อที่จะทำการติดตั้ง $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"กด Page Down เพื่ออ่านข้อตกลงทั้งหมด\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"เลือกส่วนประกอบ\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"เลือกสิ่งที่คุณต้องการใช้งานจาก $(^NameDA) ที่คุณต้องการติดตั้ง\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"เลือกส่วนประกอบ\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"เลือกสิ่งที่คุณต้องการใช้งานจาก $(^NameDA) ที่คุณต้องยกเลิกการติดตั้ง\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"รายละเอียด\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"ขยับเมาส์ของคุณเหนือส่วนประกอบเพื่อดูรายละเอียด\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"เลือกส่วนประกอบที่คุณต้องการดูรายละเอียด\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"เลือกที่ที่ต้องการติดตั้ง\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"เลือกแผ้มที่ต้องการติดตั้ง $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"เลือกแฟ้มที่ต้องการยกเลิกการติดตั้ง\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"เลือกแฟ้มที่คุณต้องการยกเลิกการติดตั้งของ $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"กำลังติดตั้ง\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"โปรดรอในขณะที่ $(^NameDA) กำลังถูกติดตั้ง\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"การติดตั้งเสร็จสิ้น\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"การติดตั้งเสร็จสมบูรณ์\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"การติดตั้งถูกยกเลิก\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"การติดตั้งไม่เสร็จสมบูรณ์\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"กำลังยกเลิกการติดตั้ง\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"โปรดรอในขณะที่ $(^NameDA) กำลังถูกยกเลิกการติดตั้ง.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"การยกเลิกการติดตั้งเสร็จสิ้น\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"การยกเลิกการติดตั้งเสร็จสิ้นโดยสมบูรณ์\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"การยกเลิกการติดตั้งถูกยกเลิก\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"การยกเลิกการติดตั้งไม่สำเร็จ\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"การติดตั้งอัติโนมัติของ  $(^NameDA) กำลังเสร็จสิ้น\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) ได้ถูกติดตั้งลงในเครื่องคอมพิวเตอร์ของคุณแล้ว$\\r$\\n$\\r$\\nกด เสร็จสิ้นเพื่อปิดตัวติดตั้งอัติโนมัติ\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"เครื่องคอมพิวเตอร์ของคุณจำเป็นต้องรีสตารท์เพื่อการติดตั้งของ $(^NameDA) จะเรียบร้อย, คุณต้องการจะ รีบูท เดี๋ยวนี้ไหม?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"การยกเลิกการติดตั้งอัติโนมัติของ $(^NameDA) กำลังเสร็จสมบูรณ์\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) ได้ถูกยกเลิกออกจากเครื่องคอมพิวเตอร์ของคุณแล้ว $\\r$\\n$\\r$\\nกด เสร็จสิ้น เพื่อปิดหน้าจอติดตั้งอัติโนมัติ\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"เครื่องคอมพิวเตอร์ของคุณจำเป็นต้องรีสตาร์ทในการที่จะทำการยกเลิกการติดตั้งของ $(^NameDA) เสร็จสิ้น, คุณต้องการจะรีบูทเดี๋ยวนี้ไหม?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"รีบูท เดี๋ยวนี้\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"ฉันต้องการ รีบูทด้วยตนเอง ทีหลัง\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&รัน $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&แสดงรายละเอียด\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&เสร็จสิ้น\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"เลือกแฟ้ม Start Menu\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"เลือกแฟ้ม Start Menu เพื่อสร้างชอร์ตคัทของ $(^NameDA). \"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"เลือกแผ้ม Start Menu ที่คุณต้องการจะสร้างชอร์ตคัทของโปรแกรม, คุณยังสามารถกำหนดชื่อเพื่อสร้างแฟ้มใหม่ได้อีกด้วย\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"ไม่ต้องสร้าง ชอร์ตคัท\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"ยกเลิกการติดตั้ง $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"ยกเลิกการติดตั้ง $(^NameDA) จากเครื่องคอมพิวเตอร์ของคุณ\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"คุณแน่ใจหรือว่าคุณต้องการจะออกจากการติดตั้งของ $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"คุณแน่ใจหรือว่าคุณต้องการออกจากการยกเลิกการติดตั้งของ $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/TradChinese.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1028\n# Font and size - dash (-) means default 字型名稱與大小\n新細明體\n9\n# Codepage - dash (-) means ASCII code page ASCII 字碼頁\n950\n# RTL - anything else than RTL means LTR 由右至左書寫\n-\n# Revision date: 2017-03-17\n# Translators:\n## Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>\n## Walter Cheuk <wwycheuk@gamil.com>\n#\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) 安裝\n# ^UninstallCaption\n$(^Name) 解除安裝\n# ^LicenseSubCaption\n: 授權協議\n# ^ComponentsSubCaption\n: 安裝選項\n# ^DirSubCaption\n: 安裝資料夾\n# ^InstallingSubCaption\n: 正在安裝\n# ^CompletedSubCaption\n: 已完成\n# ^UnComponentsSubCaption\n: 解除安裝選項\n# ^UnDirSubCaption\n: 解除安裝資料夾\n# ^ConfirmSubCaption\n: 確認\n# ^UninstallingSubCaption\n: 正在解除安裝\n# ^UnCompletedSubCaption\n: 完成\n# ^BackBtn\n< 上一步(&B)\n# ^NextBtn\n下一步(&N) >\n# ^AgreeBtn\n我同意(&A)\n# ^AcceptBtn\n我接受「授權協議」的條款(&A)\n# ^DontAcceptBtn\n我不接受「授權協議」的條款(&D)\n# ^InstallBtn\n安裝(&I)\n# ^UninstallBtn\n解除安裝(&U)\n# ^CancelBtn\n取消\n# ^CloseBtn\n關閉(&C)\n# ^BrowseBtn\n瀏覽(&R)...\n# ^ShowDetailsBtn\n顯示細節(&D)\n# ^ClickNext\n按「下一步(N)」繼續。\n# ^ClickInstall\n按「安裝(I)」開始安裝。\n# ^ClickUninstall\n按「解除安裝(U)」開始解除安裝。\n# ^Name\n名稱\n# ^Completed\n已完成\n# ^LicenseText\n在安裝 $(^NameDA) 之前請檢閱授權協議。如果接受協議所有條款，按「我同意(A)」。\n# ^LicenseTextCB\n在安裝 $(^NameDA) 之前請檢閱授權協議。如果接受協議所有條款，按下方的勾選框。 $_CLICK\n# ^LicenseTextRB\n在安裝 $(^NameDA) 之前請檢閱授權協議。如果接受協議所有條款，選擇下方的第一個選項。 $_CLICK\n# ^UnLicenseText\n在解除安裝 $(^NameDA) 之前請檢閱授權協議。如果接受協議中所有條款，按「我同意(A)」。\n# ^UnLicenseTextCB\n在解除安裝 $(^NameDA) 之前請檢閱授權協議。如果接受協議中所有條款，按下方的勾選框。 $_CLICK\n# ^UnLicenseTextRB\n在解除安裝 $(^NameDA) 之前請檢閱授權協議。如果接受協議中所有條款，選擇的第一個選項。 $_CLICK\n# ^Custom\n自訂\n# ^ComponentsText\n勾選想要安裝的元件，並解除勾選不想安裝的元件。 $_CLICK\n# ^ComponentsSubText1\n選取安裝的類型: \n# ^ComponentsSubText2_NoInstTypes\n選取安裝的元件: \n# ^ComponentsSubText2\n又或者，自訂選取想安裝的元件: \n# ^UnComponentsText\n勾選想要解除安裝的元件，並解除勾選不想解除安裝的元件。 $_CLICK\n# ^UnComponentsSubText1\n選取解除安裝的類型: \n# ^UnComponentsSubText2_NoInstTypes\n選取要解除安裝的元件: \n# ^UnComponentsSubText2\n又或者，選擇想要解除安裝的可選項元件: \n# ^DirText\n安裝程式會將 $(^NameDA) 安裝在以下資料夾。要安裝到不同的資料夾，按「瀏覽(B)...」並選擇其他資料夾。 $_CLICK\n# ^DirSubText\n目標資料夾\n# ^DirBrowseText\n選取要安裝 $(^NameDA) 的資料夾: \n# ^UnDirText\n安裝程式會自以下資料夾解除安裝 $(^NameDA) 。要解除安裝不同的資料夾，按「瀏覽(B)...」並選擇其他資料夾。 $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n選取要解除安裝 $(^NameDA) 的資料夾: \n# ^SpaceAvailable\n\"可用空間: \"\n# ^SpaceRequired\n\"所需空間: \"\n# ^UninstallingText\n會自以下資料夾解除安裝 $(^NameDA) 。 $_CLICK\n# ^UninstallingSubText\n解除安裝目錄: \n# ^FileError\n無法開啟要寫入的檔案: \\r\\n\\t\"$0\"\\r\\n按「中止」停止安裝，\\r\\n「重試」重新嘗試寫入檔案，或\\r\\n「忽略」略過此檔案。\n# ^FileError_NoIgnore\n無法開啟要寫入的檔案: \\r\\n\\t\"$0\"\\r\\n按「重試」重新嘗試寫入檔案，或\\r\\n「取消」停止安裝。\n# ^CantWrite\n\"無法寫入: \"\n# ^CopyFailed\n\"複製失敗 \"\n# ^CopyTo\n\"複製到: \"\n# ^Registering\n\"正在註冊: \"\n# ^Unregistering\n\"正在解除註冊: \"\n# ^SymbolNotFound\n\"無法找到符號: \"\n# ^CouldNotLoad\n\"無法載入: \"\n# ^CreateFolder\n\"建立資料夾: \" \n# ^CreateShortcut\n\"建立捷徑: \"\n# ^CreatedUninstaller\n\"建立解除安裝程式: \"\n# ^Delete\n\"刪除檔案: \"\n# ^DeleteOnReboot\n\"重新開機後刪除: \"\n# ^ErrorCreatingShortcut\n\"建立捷徑時發生錯誤: \"\n# ^ErrorCreating\n\"建立時發生錯誤: \"\n# ^ErrorDecompressing\n\"解壓縮資料發生錯誤！安裝程式是否已損壞？\"\n# ^ErrorRegistering\n\"註冊 DLL 時發生錯誤\"\n# ^ExecShell\n\"執行殼層程式: \"\n# ^Exec\n\"執行: \"\n# ^Extract\n\"抽取: \"\n# ^ErrorWriting\n\"抽取: 無法寫入檔案 \"\n# ^InvalidOpcode\n\"安裝程式損毀: 無效的作業代碼 \"\n# ^NoOLE\n\"沒有 OLE 用於: \"\n# ^OutputFolder\n\"輸出資料夾: \"\n# ^RemoveFolder\n\"移除資料夾: \"\n# ^RenameOnReboot\n\"重新開機後重新命名: \"\n# ^Rename\n\"重新命名: \"\n# ^Skipped\n\"已略過: \"\n# ^CopyDetails\n\"複製細節到剪貼簿 \"\n# ^LogInstall\n\"將安裝進程記入日誌\"\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/TradChinese.nsh",
    "content": "﻿;Language: 'Chinese (Traditional)' (1028)\n;Translator: Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>\n;Translator: Walter Cheuk <wwycheuk@gmail.com>\n;Revision date: 2017-03-17\n\n!insertmacro LANGFILE \"TradChinese\" \"Chinese (Traditional)\" \"中文(繁體)\" \"Hanyu (Fantizi)\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"歡迎使用 $(^NameDA) 安裝精靈\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"本精靈會引導您完成安裝 $(^NameDA)。$\\r$\\n$\\r$\\n在開始安裝之前，建議先關閉其他所有應用程式。這將允許安裝程式更新相關的系統檔案，而不需要重新啟動電腦。$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"歡迎使用 $(^NameDA) 解除安裝精靈\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"本精靈會引導您解除安裝 $(^NameDA)。$\\r$\\n$\\r$\\n在開始解除安裝之前，請確認 $(^NameDA) 並未有執行。$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"授權協議\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"在安裝 $(^NameDA) 之前，請檢閱授權條款。\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"如果接受協議的條款，按 [我同意(A)] 繼續安裝。必須要接受協議才能安裝 $(^NameDA) 。\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"如果接受協議的條款，按下方的勾選框。必須要接受協議才能安裝 $(^NameDA)。$_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"如果接受協議中的條款，選擇下方第一個選項。必須要接受協議才能安裝 $(^NameDA)。$_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"授權協議\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"在解除安裝 $(^NameDA) 之前，請檢閱授權條款。\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"如果接受協議的條款，按 [我同意(A)] 繼續解除安裝。如果選取 [取消] ，安裝程式會關閉。必須要接受協議才能解除安裝 $(^NameDA) 。\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"如果接受協議的條款，按下方的勾選框。必須要接受協議才能解除安裝 $(^NameDA)。$_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"如果接受協議的條款，選擇下方第一個選項。必須要接受協議才能解除安裝 $(^NameDA)。$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"檢閱協議的其餘部分，按 [PgDn] 往下捲動頁面。\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"選擇元件\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"選擇想要安裝 $(^NameDA) 的功能。\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"選取元件\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"選取 $(^NameDA) 當中想要解除的功能。\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"說明\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"將滑鼠指標停懸到元件之上，即可見到其說明。\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"選取元件，即可見到其說明。\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"選取安裝位置\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"選取 $(^NameDA) 要安裝的資料夾。\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"選取解除安裝位置\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"選取 $(^NameDA) 要解除安裝的資料夾。\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"安裝\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"$(^NameDA) 正在安裝，請稍候。\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"完成安裝\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"安裝已完成。\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"已中止安裝\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"安裝並未完成。\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"解除安裝\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"$(^NameDA) 正在解除安裝，請稍候。\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"完成解除安裝\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"解除安裝已完成。\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"已中止解除安裝\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"解除安裝並未完成。\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"即將完成安裝 $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"已在電腦安裝 $(^NameDA) 。$\\r$\\n按 [完成(F)] 關閉安裝程式。\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"電腦需要重新開機，才能完成安裝 $(^NameDA) 。要馬上重新開機嗎？\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"即將完成解除安裝 $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"已自電腦解除安裝 $(^NameDA) 。$\\r$\\n$\\r$\\n按 [完成(F)] 關閉安裝程式。\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"電腦需要重新開機，才能完成解除安裝 $(^NameDA) 。要馬上重新開機嗎？\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"是，馬上重新開機(&Y)\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"否，我稍後再自行重新開機(&N)\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"執行 $(^NameDA)(&R)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"顯示「讀我檔案」(&S)\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"完成(&F)\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"選擇「開始功能表」資料夾\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"選擇「開始功能表」資料夾，用於程式的捷徑。\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"選擇「開始功能表」資料夾，以便建立程式的捷徑。你也可以輸入名稱，建立新資料夾。\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"不要建立捷徑(&N)\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"解除安裝 $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"自電腦解除安裝 $(^NameDA) 。\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"確定要結束 $(^Name) 的安裝程式嗎？\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"確定要結束 $(^Name) 的解除安裝程式嗎？\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"選擇使用者\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"選擇要將 $(^NameDA) 安裝給哪位使用者。\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"選擇僅將 $(^NameDA) 安裝給自己使用，還是此電腦的所有使用者皆可使用。 $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"安裝給此電腦的所有使用者\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"僅安裝給自己\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Turkish.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1055\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1254\n# RTL - anything else than RTL means LTR\n-\n# Translation by ?atay Dilsiz(chagy) (amigos_cagi@hotmail.com)\n# Corrections by Mozilla Türkiye Yerelleştirme Topluluğu tarafından çevrilmiştir. http://mozilla.org.tr\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Kurulumu\n# ^UninstallCaption\n$(^Name) Kaldırma\n# ^LicenseSubCaption\n: Lisans Sözleşmesi\n# ^ComponentsSubCaption\n: Kurulum Seçenekleri\n# ^DirSubCaption\n: Kurulum Dizini\n# ^InstallingSubCaption\n: Kuruluyor\n# ^CompletedSubCaption\n: Tamamlandı\n# ^UnComponentsSubCaption\n: Kaldırma Seçenekleri\n# ^UnDirSubCaption\n: Kaldırılacak Dizin\n# ^ConfirmSubCaption\n: Onay\n# ^UninstallingSubCaption\n: Kaldırılıyor\n# ^UnCompletedSubCaption\n: Tamamlandı\n# ^BackBtn\n< &Geri\n# ^NextBtn\nİ&leri >\n# ^AgreeBtn\n&Katılıyorum\n# ^AcceptBtn\nLisans Sözleşmesi'nin koşullarını &kabul ediyorum\n# ^DontAcceptBtn\nLisans Sözleşmesi'nin koşullarını kabul et&miyorum\n# ^InstallBtn\n&Kur\n# ^UninstallBtn\n&Kaldır\n# ^CancelBtn\nVazgeç\n# ^CloseBtn\n&Kapat\n# ^BrowseBtn\n&Gözat...\n# ^ShowDetailsBtn\n&Ayrıntıları göster\n# ^ClickNext\nDevam etmek için İleri düğmesine basın.\n# ^ClickInstall\nKurulumu başlatmak için Kur düğmesine basın.\n# ^ClickUninstall\nKaldırmayı başlatmak için Kaldır düğmesine basın.\n# ^Name\nAd\n# ^Completed\nTamamlandı\n# ^LicenseText\nLütfen $(^NameDA) uygulamasını kurmadan önce lisans sözleşmesini gözden geçirin. Sözleşmedeki bütün koşulları kabul ediyorsanız Kabul Ediyorum düğmesine basın.\n# ^LicenseTextCB\nLütfen $(^NameDA) uygulamasını kurmadan önce lisans sözleşmesini gözden geçirin. Sözleşmedeki bütün koşulları kabul ediyorsanız aşağıdaki kutuya işaret koyun. $_CLICK\n# ^LicenseTextRB\nLütfen $(^NameDA) uygulamasını kurmadan önce lisans sözleşmesini gözden geçirin. Sözleşmedeki bütün koşulları kabul ediyorsanız aşağıdaki ilk seçeneği seçin. $_CLICK\n# ^UnLicenseText\nLütfen $(^NameDA) uygulamasını kaldırmadan önce lisans sözleşmesini gözden geçirin. Sözleşmedeki bütün koşulları kabul ediyorsanız Kabul Ediyorum düğmesine basın.\n# ^UnLicenseTextCB\nLütfen $(^NameDA) uygulamasını kaldırmadan önce lisans sözleşmesini gözden geçirin. Sözleşmedeki bütün koşulları kabul ediyorsanız aşağıdaki kutuya işaret koyun. $_CLICK\n# ^UnLicenseTextRB\nLütfen $(^NameDA) uygulamasını kaldırmadan önce lisans sözleşmesini gözden geçirin. Sözleşmedeki bütün koşulları kabul ediyorsanız aşağıdaki ilk seçeneği seçin. $_CLICK\n# ^Custom\nÖzel\n# ^ComponentsText\nKurmak istediğiniz bileşenleri işaretleyip kurmak istemediklerinizi işaretlemeden bırakın. $_CLICK\n# ^ComponentsSubText1\nKurulum türünü seçin:\n# ^ComponentsSubText2_NoInstTypes\nKurulacak bileşenleri seçin:\n# ^ComponentsSubText2\nya da isteğe bağlı olarak kurmak istediğiniz bileşenleri seçin:\n# ^UnComponentsText\nKaldırmak istediğiniz bileşenleri işaretleyip kaldırmak istemediklerinizi işaretlemeden bırakın. $_CLICK\n# ^UnComponentsSubText1\nKaldırma türünü seçin:\n# ^UnComponentsSubText2_NoInstTypes\nKaldırılacak bileşenleri seçin:\n# ^UnComponentsSubText2\nya da isteğe bağlı olarak kaldırmak istediğiniz bileşenleri seçin:\n# ^DirText\n$(^NameDA) aşağıdaki dizinde kurulacak. Farklı bir dizinde kurmak için Gözat düğmesine basıp başka bir dizin seçin. $_CLICK\n# ^DirSubText\nHedef Dizin\n# ^DirBrowseText\n$(^NameDA) uygulamasının kurulacağı dizini seçin:\n# ^UnDirText\n$(^NameDA) aşağıdaki dizinden kaldırılacak. Farklı bir dizinden kaldırmak için Gözat düğmesine basıp başka bir dizin seçin. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n$(^NameDA) uygulamasının kaldırılacağı dizini seçin:\n# ^SpaceAvailable\n\"Kullanılabilir boş alan: \"\n# ^SpaceRequired\n\"Gereken boş alan: \"\n# ^UninstallingText\n$(^NameDA) aşağıdaki dizinden kaldırılacak. $_CLICK\n# ^UninstallingSubText\nKaldırılan yer:\n# ^FileError\nDosya yazmak için açılırken hata meydana geldi: \\r\\n\\r\\n$0\\r\\n\\r\\nKurulumu durdurmak için Dur düğmesine,\\r\\nyeniden denemek için Yeniden Dene düğmesine,\\r\\nbu dosyayı atlamak için Yoksay düğmesine basın.\n# ^FileError_NoIgnore\nDosya yazmak için açılırken hata meydana geldi: \\r\\n\\r\\n$0\\r\\n\\r\\nYeniden denemek için Yeniden Dene düğmesine,\\r\\nkurulumu durdurmak için Vazgeç düğmesine basın.\n# ^CantWrite\n\"Yazılamadı: \"\n# ^CopyFailed\nKopyalama başarısız oldu\n# ^CopyTo\n\"Kayıt: \"\n# ^Registering\n\"Kaydediliyor: \"\n# ^Unregistering\n\"Kayıt siliniyor: \"\n# ^SymbolNotFound\n\"Simge bulunamadı: \"\n# ^CouldNotLoad\n\"Yüklenemedi: \"\n# ^CreateFolder\n\"Dizin oluştur: \"\n# ^CreateShortcut\n\"Kısayol oluştur: \"\n# ^CreatedUninstaller\n\"Kaldırma uygulaması oluştur: \"\n# ^Delete\n\"Dosya sil: \"\n# ^DeleteOnReboot\n\"Açılışta sil: \"\n# ^ErrorCreatingShortcut\n\"Kısayol oluşturulurken hata meydana geldi: \"\n# ^ErrorCreating\n\"Oluşturma hatası: \"\n# ^ErrorDecompressing\nVeriyi açarken hata meydana geldi! Acaba kurulum uygulaması mı bozuk?\n# ^ErrorRegistering\nDLL kaydedilirken hata meydana geldi\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Çalıştır: \"\n# ^Extract\n\"Aç: \"\n# ^ErrorWriting\n\"Açma: Dosyaya yazarken hata meydana geldi \"\n# ^InvalidOpcode\nKurulum bozuk: Geçersiz kod\n# ^NoOLE\n\"OLE yok: \"\n# ^OutputFolder\n\"Çıktı dizini: \"\n# ^RemoveFolder\n\"Dizini sil: \"\n# ^RenameOnReboot\n\"Açılışta adını değiştir: \"\n# ^Rename\n\"Ad değiştir: \"\n# ^Skipped\n\"Atlandı: \"\n# ^CopyDetails\nAyrıntıları panoya kopyala\n# ^LogInstall\nKurulum sürecinin kaydını tut\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Turkish.nsh",
    "content": "﻿;Language: Turkish (1055)\n;By Çagatay Dilsiz(Chagy)\n;Updated by Fatih BOY (fatih_boy@yahoo.com)\n\n!insertmacro LANGFILE \"Turkish\" = \"Türkçe\" \"Turkce\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"$(^NameDA) Kurulum sihirbazına hoş geldiniz\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Bu sihirbaz size $(^NameDA) kurulumu boyunca rehberlik edecektir.$\\r$\\n$\\r$\\nKurulumu başlatmadan önce çalışan diğer programlari kapatmanızı öneririz. Böylece bilgisayarınızı yeniden başlatmadan bazı sistem dosyaları sorunsuz kurulabilir.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"$(^NameDA) Programını Kaldırma Sihirbazına Hoş Geldiniz\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Bu sihirbaz size $(^NameDA) programının kadırılımı boyunca rehberlik edecektir.$\\r$\\n$\\r$\\nKaldırım işlemeni başlatmadan önce çalışan diğer programlari kapatmanızı öneririz. Böylece bilgisayarınızı yeniden başlatmadan bazı sistem dosyaları sorunsuz kaldırılabilir.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lisans Sözleşmesi\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Lütfen $(^NameDA) programını kurmadan önce sözleşmeyi okuyunuz.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Sözleşme koşullarını kabul ediyorsanız, 'Kabul Ediyorum'a basınız. $(^NameDA) programını kurmak için sözleşme koşullarını kabul etmelisiniz.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Sözleşme koşullarını kabul ediyorsanız, aşağıdaki onay kutusunu doldurunuz. $(^NameDA) programını kurmak için sözleşme koşullarını kabul etmelisiniz. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Sözleşme koşullarını kabul ediyorsanız, asagidaki onay düğmesini seçiniz. $(^NameDA) programını kurmak için sözleşme koşullarını kabul etmelisiniz. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lisans Sözleşmesi\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Lütfen $(^NameDA) programını sisteminizden kaldırmadan önce sözleşmeyi okuyunuz.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Sözleşme koşullarını kabul ediyorsanız, 'Kabul Ediyorum'a basınız. $(^NameDA) programını sisteminizden kaldırmak için sözleşme koşullarını kabul etmelisiniz.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Sözleşme koşullarını kabul ediyorsanız, aşağıdaki onay kutusunu doldurunuz. $(^NameDA) programını sisteminizden kaldırmak için sözleşme koşullarını kabul etmelisiniz. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Sözleşme koşullarını kabul ediyorsanız, asagidaki onay düğmesini seçiniz. $(^NameDA) programını sisteminizden kaldırmak için sözleşme koşullarını kabul etmelisiniz. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Sözleşmenin geri kalanını okumak için 'page down' tuşuna basabilirsiniz.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Bileşen seçimi\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Lütfen $(^NameDA) için kurmak istediginiz bileşenleri seçiniz.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Bileşen Şeçimi\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Lütfen kaldırmak istediğiniz $(^NameDA) program bileşenini seçiniz.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Açıklama\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Bileşenlerin açıklamalarını görmek için imleci bileşen üzerine götürün.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Hedef dizini seçimi\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"$(^NameDA) programını kurmak istediğiniz dizini şeçiniz.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Kaldırılıcak Dizin Seçimi\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"$(^NameDA) programını kaldırmak istediginiz dizini seçiniz.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Kuruluyor\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Lütfen $(^NameDA) kurulurken bekleyiniz.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Kurulum Tamamlandı\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Kurulum başarıyla tamamlandı.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Kurulum İptal Edildi\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Kurulum tam olarak tamamlanmadı.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Kaldırılıyor\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Litfen $(^NameDA) programı sisteminizden kaldırılırken bekleyiniz.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Kaldırma İşlemi Tamamlandır\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Kaldırma işlemi başarıyla tamamlandı.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Kaldırma İşlemi İptal Edildi\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Kaldırma İşlemi tamamlanamadı.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA) Kurulum sihirbazı tamamlanıyor.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA)  bilgisayariniza yüklendi.$\\r$\\n$\\r$\\nLütfen 'Bitir'e basarak kurulumu sonlandırın.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA) kurulumunun tamamlanması için bilgisayarınızı yeniden başlatmanız gerekiyor.Bilgisayarınızı yeniden başlatmak istiyor musunuz?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA) Programı Kaldırma Sihirbazı Tamamlanıyor\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) programı sisteminizden kaldırıldı.$\\r$\\n$\\r$\\nSihirbazı kapatmak için 'bitir'e basınız.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) programını kaldırma işleminin tamamlanması için bilgisayarınızın yeniden başlatılması gerekiyor. Bilgisayarınızın şimdi yeniden başlatılmasını ister misiniz?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Yeniden başlat\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Bilgisayarımı daha sonra başlatacağım.\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) programını çalıştır\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"beni oku/readme dosyasını &göster\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Bitir\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Başlat Menüsü Klasör Seçimi\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"$(^NameDA) kısayollarının konulacagı başlat menüsü klasörünü seçiniz.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Programın kısayollarının konulacağı başlat menüsü klasörünü seçiniz. Farklı bir isim girerek yeni bir klasör yaratabilirsiniz.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Kısayolları oluşturmadan devam et\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA) Programını Kaldır\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA) programını sisteminizden kaldırma.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"$(^Name) kurulumundan çıkmak istediğinize emin misiniz?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"$(^Name) Programi Kaldırma işleminden çıkmak istediğinize emin misiniz?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Ukrainian.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1058\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1251\n# RTL - anything else than RTL means LTR\n-\n# Translation by Yuri Holubow, Nash-Soft.com <http://www.Nash-Soft.com>\n# Corrections by Dmitriy Kononchuk [http://gri3ly.kiev.ua]\n# New corrections by Osidach Vitaly\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\n$(^Name) Встановлення\n# ^UninstallCaption\n$(^Name) Видалення\n# ^LicenseSubCaption\n: Ліцензійна угода\n# ^ComponentsSubCaption\n: Опції встановлення\n# ^DirSubCaption\n: Тека встановлення\n# ^InstallingSubCaption\n: Копіювання файлів\n# ^CompletedSubCaption\n: Завершено\n# ^UnComponentsSubCaption\n: Опції видалення\n# ^UnDirSubCaption\n: Тека видалення\n# ^ConfirmSubCaption\n: Підтверждення\n# ^UninstallingSubCaption\n: Видалення файлів\n# ^UnCompletedSubCaption\n: Завершено\n# ^BackBtn\n< &Назад\n# ^NextBtn\n&Далі >\n# ^AgreeBtn\n&Згоден\n# ^AcceptBtn\nЯ &приймаю умови Ліцензійної угоди\n# ^DontAcceptBtn\nЯ &не приймаю умови Ліцензійної угоди\n# ^InstallBtn\n&Встановити\n# ^UninstallBtn\nВидалити\n# ^CancelBtn\nСкасувати\n# ^CloseBtn\n&Закрити\n# ^BrowseBtn\nО&гляд...\n# ^ShowDetailsBtn\nПодробиці\n# ^ClickNext\nНатисніть Далі щоб продовжити\n# ^ClickInstall\nНатисніть Встановити для початку процессу встановлення\n# ^ClickUninstall\nНатисніть Видалить для початку процессу видалення\n# ^Name\nІм'я\n# ^Completed\nЗавершено\n# ^LicenseText\nПрочитайте умови ліцензійної угоди перед встановленням $(^NameDA). Якщо Ви приймаєте умови угоди, натисніть на кнопку Згоден.\n# ^LicenseTextCB\nПрочитайте умови ліцензійної угоди перед встановленням $(^NameDA). Якщо Ви приймаєте умови угоди, встановіть відмітку у квадратику нижче. $_CLICK\n# ^LicenseTextRB\nПрочитайте умови ліцензійної угоди перед встановленням $(^NameDA). Якщо Ви приймаєте умови угоди, виберіть перший варіант. $_CLICK\n# ^UnLicenseText\nПрочитайте умови ліцензійної угоди перед встановленням $(^NameDA). Якщо Ви приймаєте умови ліцензійної угоди, натисніть на кнопку Згоден.\n# ^UnLicenseTextCB\nПрочитайте умови ліцензійної угоди перед встановленням $(^NameDA). Якщо Ви приймаєте умови угоди, встановіть відмітку у квадратику нижче. $_CLICK\n# ^UnLicenseTextRB\nПрочитайте умови ліцензійної угоди перед видаленням $(^NameDA). Якщо Ви приймаєте умови угоди, виберіть перший варіант. $_CLICK\n# ^Custom\nПо вибору\n# ^ComponentsText\nВиберіть які компоненти програми Ви бажаєте встановити. $_CLICK\n# ^ComponentsSubText1\nВиберіть тип встановлення:\n# ^ComponentsSubText2_NoInstTypes\nВиберіть компоненти для встановлення:\n# ^ComponentsSubText2\nЧи, виберіть вручну компоненти, які Ви хочете встановити:\n# ^UnComponentsText\nВиберіть які компоненти Ви бажаєте видалити. Відмітьте компоненти для видалення і зніміть відмітку з тих, які Ви видаляти не бажаєте. $_CLICK\n# ^UnComponentsSubText1\nВиберіть тип видалення:\n# ^UnComponentsSubText2_NoInstTypes\nВибір компонентів для видалення:\n# ^UnComponentsSubText2\nЧи виберіть компоненти програми для видалення по своєму бажанні:\n# ^DirText\nПрограмма встановить $(^NameDA) у вказану теку. Для того, щоб встановити программу в іншу теку, натисніть Огляд і вкажіть потрібну теку. $_CLICK\n# ^DirSubText\nКаталог призначення\n# ^DirBrowseText\nВиберіть теку для встановлення $(^NameDA):\n# ^UnDirText\nПрограмма встановлення видалить $(^NameDA) із вказанної теки. Для того, щоб провести видалення з іншої теки, натисніть Огляд і вкажіть потрібну теку. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nВиберіть теку, з якої Ви бажаєте видалити $(^NameDA):\n# ^SpaceAvailable\n\"Доступно місця: \"\n# ^SpaceRequired\n\"Необхідно місця: \"\n# ^UninstallingText\n$(^NameDA) буде видаленно з вказаного каталогу. $_CLICK\n# ^UninstallingSubText\nВидалення з:\n# ^FileError\nНеможливо відкрити файл для запису: \\r\\n\\t\"$0\"\\r\\nНатисніть Перервати для того, щоб перервати встановлення,\\r\\nПовторити для того, щоб повторити спробу запису у файл, чи\\r\\nІгнорувати для того, щоб пропустити цю дію\n# ^FileError_NoIgnore\nНеможливо відкрити файл для запису: \\r\\n\\t\"$0\"\\r\\nНатисніть Повторити для того, щоб повторити спробу запису у файл, чи\\r\\nСкасувати для того, щоб перервати встановлення\n# ^CantWrite\n\"Неможливо записати: \"\n# ^CopyFailed\nНе вдалося копіювати\n# ^CopyTo\n\"Копіювання в \"\n# ^Registering\n\"Реєстрація: \"\n# ^Unregistering\n\"Видалення реєстрації: \"\n# ^SymbolNotFound\n\"Неможливо знайти символ: \"\n# ^CouldNotLoad\n\"Неможливо завантажити: \"\n# ^CreateFolder\n\"Створення теки: \"\n# ^CreateShortcut\n\"Створення ярлика: \"\n# ^CreatedUninstaller\n\"Створення програми видалення: \"\n# ^Delete\n\"Видалення файлу: \"\n# ^DeleteOnReboot\n\"Видалення після перезавантаження: \"\n# ^ErrorCreatingShortcut\n\"Помилка створення ярлика: \"\n# ^ErrorCreating\n\"Помилка створення: \"\n# ^ErrorDecompressing\nНеможливо витягнути дані. Можливо пошкоджений дистрибутив.\n# ^ErrorRegistering\nНеможливо зареєструвати бібліотеку (DLL)\n# ^ExecShell\n\"Виконання команди оболонки: \"\n# ^Exec\n\"Виконання: \"\n# ^Extract\n\"Витягнення: \"\n# ^ErrorWriting\n\"Витягнення: помилка запису файла\"\n# ^InvalidOpcode\nДистрибутив пошкоджений: помилковий код відповіді\n# ^NoOLE\n\"Немає OLE для: \"\n# ^OutputFolder\n\"Тека призначення: \"\n# ^RemoveFolder\n\"Видалення теки: \"\n# ^RenameOnReboot\n\"Переіменування після перезаванаження: \"\n# ^Rename\n\"Перейменування: \"\n# ^Skipped\n\"Пропущено: \"\n# ^CopyDetails\nКопіювати деталі у буфер обміну\n# ^LogInstall\nЗаписувати в лог процес встновлення\n# byte\nб\n# kilo\n К\n# mega\n М\n# giga\n Г\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Ukrainian.nsh",
    "content": "﻿;Language: Ukrainian (1058)\n;By Yuri Holubow, http://www.Nash-Soft.com\n;Correct by Osidach Vitaly (Vit_Os2)\n\n!insertmacro LANGFILE \"Ukrainian\" = \"Українська\" \"Ukrayins'ka\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Ласкаво просимо до Майстра Встановлення $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Дана програма встановить $(^NameDA) на Ваш комп'ютер.$\\r$\\n$\\r$\\nРекомендовано закрити всі програми перед початком інсталяції. Це дозволить програмі встановлення оновити системні файли без перезавантаження системи.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Ласкаво просимо до Майстра Видалення $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Даний майстер допоможе видалити $(^NameDA).$\\r$\\n$\\r$\\nПеред початком видалення, перевірте, чи не запущено $(^NameDA).$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Ліцензійна Угода\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Перегляньте ліцензію перед встановленням $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Якщо Ви приймаєте всі умови Угоди, натисніть на кнопку Згоден. Ви повинні прийняти умови Угоди для встановлення $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Якщо Ви приймаєте всі умови Угоди, встановіть відмітку у квадратику нижче. Ви повинні прийняти умови Угоди для встановлення $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Якщо Ви приймаєте всі умови Угоди, виберіть перший варіант з тих що нижче. Ви повинні прийняти умови Угоди для встановлення $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Ліцензійна угода\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Прочитайте умови ліцензійної угоди перед видаленням $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Якщо Ви приймаєте всі умови Угоди, натисніть на кнопку Згоден. Ви повинні прийняти умови Угоди для видалення $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Якщо Ви приймаєте всі умови Угоди, встановіть відмітку у квадратику нижче. Ви повинні прийняти умови Угоди для видалення $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Якщо Ви приймаєте всі умови Угоди, виберіть перший варіант з тих, що нижче. Ви повинні прийняти умови Угоди для видалення $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Натисніть PageDown щоб переміститись вниз угоди.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Оберіть компоненти\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Оберіть компоненти $(^NameDA) які Ви бажаєте встановити.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Компоненти програми\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Оберіть які компоненти $(^NameDA) Ви бажаєте видалити.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Опис\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Підведіть вашу мишку до компонента, щоб побачити його опис.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Оберіть теку встановлення\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Оберіть теку для встановлення $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Вибір теки для видалення\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Оберіть теку, з якої Ви бажаєте видалити $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Копіювання файлів\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Зачекайте, доки програма встановлення скопіює всі необхідні файли $(^NameDA).\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Встановлення завершено\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Встановлення успішно завершено.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Встановлення перервана\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Встановлення не було успішно завершено.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Видалення\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Зачекайте, йде видалення файлів $(^NameDA).\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Видалення завершено\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Видалення програми було успішно завершено.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Видалення перервано\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Видалення не було виконано повністю.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Завершення майстра встановлення $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) встановлено на ваш комп'ютер.$\\r$\\n$\\r$\\nНатисніть Кінець для виходу.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Для того, щоб завершити встановлення $(^NameDA) Ваш комп'ютер повинен перезавантажитися. Зробити це зараз?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Завершення Майстра Видалення $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) видалений з вашого комп'ютера.$\\r$\\n$\\r$\\nНатисніть Вихід, щоб закрити Майстра.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Для того, щоб закінчити видалення $(^NameDA) ваш комп'ютер повинен перезавантажитися. Ви бажаєте зробити це зараз?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Перезавантажитися зараз\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Я хочу перезавантажитися власноруч пізніше\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Запустити $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Показати інформацію про програму\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Кінець\"\n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Тека в меню Пуск\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Оберіть теку в меню Пуск для ярликів програми.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Оберіть теку в меню Пуск в яку будуть поміщені ярлики для встановленої програми. Ви також можете ввести інше ім'я для створення нової теки.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Не створювати ярлики\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Видалення $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Видалення $(^NameDA) з вашого комп'ютера.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ви впевнені, що бажаєте покинути встановлення $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Ви впевнені що бажаєте покинути Майстер Видалення $(^Name)?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Виберіть користувачів\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Виберіть користувачів, для яких слід встановити $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Визначтеся, слід встановити $(^NameDA) лише для вашого користувача, чи для усіх користувачів цієї операційної системи. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Встановити для усіх у цій системі\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Встановити лише для вас\"\n!endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Uzbek.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Language ID\n1091\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Emil Garipov [emil.garipov@gmail.com]\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nO'rnatish $(^Name)\n# ^UninstallCaption\nO'chirish $(^Name)\n# ^LicenseSubCaption\n: Lisenzion kelishuv\n# ^ComponentsSubCaption\n: O'rnatish parametrlari \n# ^DirSubCaption\n: O'rnatish papkasi\n# ^InstallingSubCaption\n: Fayllarni kopiya qilish\n# ^CompletedSubCaption\n: Operatsiya yakunlandi\n# ^UnComponentsSubCaption\n: O'chirish parametrlari\n# ^UnDirSubCaption\n: O'chirsh papkasi\n# ^ConfirmSubCaption\n: Tasdiqlash\n# ^UninstallingSubCaption\n: Fayllarni o'chirish\n# ^UnCompletedSubCaption\n: Operatsiya yakunlandi\n# ^BackBtn\n< &Orqaga\n# ^NextBtn\n&Oldinga >\n# ^AgreeBtn\n&Qabul qilaman\n# ^AcceptBtn\nMen &kelishuv shartlarini qabul qilaman\n# ^DontAcceptBtn\nMen &kelishuv shartlarini qabul qilmayman\n# ^InstallBtn\n&O'rnatish\n# ^UninstallBtn\n&O'chirish\n# ^CancelBtn\nBekor qilish\n# ^CloseBtn\n&Yopish\n# ^BrowseBtn\n&Ko'rish ...\n# ^ShowDetailsBtn\n&Äåòàëè...\n# ^ClickNext\nDavom etish uchun 'Oldinga'tugmachasini bosing.\n# ^ClickInstall\nDasturni o'rnatish uchun'O'rnatish' tugmachasini bosing.\n# ^ClickUninstall\nDasturni o'chirish uchun 'O'chirsh' tugmachasini bosing.\n# ^Name\nIsm\n# ^Completed\nTayor\n# ^LicenseText\n$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz 'Qabul qilaman' tugmachasini bosing.\n# ^LicenseTextCB\n$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz bayroqchani joylashtiring. $_CLICK\n# ^LicenseTextRB\n$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz quyida taklif etilganlardan birinchi variantni tanlang. $_CLICK\n# ^UnLicenseText\n$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz 'Qabul qilaman' tugmachasini bosing.\n# ^UnLicenseTextCB\n$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz bayroqchani joylashtiring. $_CLICK\n# ^UnLicenseTextRB\n$(^NameDA)ni o'rnatishdan oldin lisenzion kelishuv bilan tanishib oling. Kelishuv shartlarini qabul qilsangiz quyida taklif etilganlardan birinchi variantni tanlang. $_CLICK\n# ^Custom\nTanlash bo'icha\n# ^ComponentsText\nO'rnatish ucun dastur komponentlarini tanlang. $_CLICK\n# ^ComponentsSubText1\nO'rnatish jarayonini tanlang:\n# ^ComponentsSubText2_NoInstTypes\nO'rnatish uchun dastur komponentlarini tanlang:\n# ^ComponentsSubText2\nYoki o'rnatish uchun qushimcha komponentlarini tanlang:\n# ^UnComponentsText\nO'chirish uchun dastur komponentlarini tanlang. $_CLICK\n# ^UnComponentsSubText1\nO'chirish jarayonini tanlang:\n# ^UnComponentsSubText2_NoInstTypes\nO'chirish uchun dastur komponentlarini tanlang:\n# ^UnComponentsSubText2\nYoki o'chirish uchun qushimcha komponentlarini tanlang:\n# ^DirText\nDastur $(^NameDA)ni ko'rsatilgan papkaga o'rnatadi. Boshqa papkaga o'rnatish uchun, 'Ko'rish'tugmachasini bosing va uni ko'rsatib bering. $_CLICK\n# ^DirSubText\nO'rnatish papkasi\n# ^DirBrowseText\nO'rnatish papkasini ko'rsating $(^NameDA):\n# ^UnDirText\nDastur $(^NameDA)ni ko'rsatilgan papkadan o'chiradi. Boshqa papkaga o'rnatish uchun, 'Ko'rish'tugmachasini bosing va uni ko'rsatib bering. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\n$(^NameDA)ni o'chirish uchun papkani ko'rsating:\n# ^SpaceAvailable\n\"Diskda joriy qilingan: \"\n# ^SpaceRequired\n\"Diskda talab qilinadigan: \"\n# ^UninstallingText\n$(^NameDA) dasturi kompyuterizdan uchiriladi. $_CLICK\n# ^UninstallingSubText\nO'chirilish:\n# ^FileError\nYozish uchun faylni ochish imkoniyati yuq: \\r\\n\\t\"$0\"\\r\\n'Tuxtashish': O'rnatishni tuxtatish;\\r\\n\"Takrorlash\":yana bir o'rinib ko'rish;\\r\\n\"Taylab ketish\": shu xarakatni taylab ketish.\n# ^FileError_NoIgnore\nYozish uchun faylni ochish imkoniyati yuq: \\r\\n\\t\"$0\"\\r\\n'Takrorlash': yana bir o'rinib ko'rish;\\r\\n'Bekor qilish': o'rnatish protsessini bekor qilish.\n# ^CantWrite\n\"Yozish uchun imkoniyat yuq: \"\n# ^CopyFailed\nKopiya qilganda xato bor\n# ^CopyTo\n\"Kopiya qilish \"\n# ^Registering\n\"Ro'yxatga olish: \"\n# ^Unregistering\n\"Ro'xatdan chiqish: \"\n# ^SymbolNotFound\n\"Simvolni topish imkoniyati yuq: \"\n# ^CouldNotLoad\n\"Zagruzka qilish imkoniyati yuq: \"\n# ^CreateFolder\n\"Papkani yaratish: \"\n# ^CreateShortcut\n\"Belgini yaratish: \"\n# ^CreatedUninstaller\n\"O'chirish dasturini yaratish: \"\n# ^Delete\n\"Faylni o'chirish: \"\n# ^DeleteOnReboot\n\"Kompyuter qayta yuklash jaraonida o'chirish: \"\n# ^ErrorCreatingShortcut\n\"Belgini yaratish jarayonida xato: \" \n# ^ErrorCreating\n\"Yaratish xatosi: \"\n# ^ErrorDecompressing\nMa'lumotlarni asilga qaytarish xatosi! Distributiv ziyonlangan bulishi mumkin.\n# ^ErrorRegistering\nKutubxonani ro'xatga olish imkoniyati yuq (DLL)\n# ^ExecShell\n\"Qoplang'ich komandasini bajarish: \" \n# ^Exec\n\"Bajarish: \"\n# ^Extract\n\"Ichidan olish: \"\n# ^ErrorWriting\n\"Ichidan olish: fayl yozish xatosi \"\n# ^InvalidOpcode\nDistributiv ziyonlangan: ruxsatlanmangan kod\n# ^NoOLE\n\"Quydagilarga OLE yuq: \" \n# ^OutputFolder\n\"Papkani o'rnatish: \"\n# ^RemoveFolder\n\"Papkani o'chirish: \"\n# ^RenameOnReboot\n\"Kompyuter qayta yuklanish jarayonida ismni qaita quyish: \"\n# ^Rename\n\"Ismni qayta quyish: \"\n# ^Skipped\n\"O'tkazib yuborish: \"\n# ^CopyDetails\nBufer obmenaga ma'lumotlarni kopiya qilish\n# ^LogInstall\nO'rnatish xisobotini chiqorish\n# byte\náàéò\n# kilo\n Ê\n# mega\n Ì\n# giga\n Ã"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Uzbek.nsh",
    "content": "﻿;Language: Uzbek (1091)\n;Translation updated by Emil Garipov [emil.garipov@gmail.com] \n\n!insertmacro LANGFILE \"Uzbek\" = \"O‘zbek\" \"O'zbek\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Sizni o'rnatish dastur tabriklaydi $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Bu dastur sizning komputeringizga $(^NameDA) dasturni o'rnatadi.$\\r$\\n$\\r$\\nO'rnatishdan oldin ishlayotgan barcha ilovalarni yopish tavsiya etiladi. Bu o'rnatuvchi dasturga kompyuterni qayta yuklamasdan sistemali fayllarni yangilash imkonini beradi.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Sizni $(^NameDA)ni o'chirish dasturi tabriklaydi\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Bu dastur $(^NameDA)ni sizning kompyuteringizdan o'chiradi.$\\r$\\n$\\r$\\nO'chirishdan oldin $(^NameDA) dasturni ishlamayotganligini aniqlang.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Lisenzion kelishuv\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"$(^NameDA) dasturini o'rnatishdan oldin lisenzion kelishuv bilan tanishib chiking.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Agar kelishuv shartlariga rozi bo'lsangiz $\\\"Qabul kilaman$\\\" tugmasini bosing.Dasturni o'rnatish uchun,kelishuv shartlarini qabul qilish kerak.\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Agar siz kelishuv shartlarini qabul kilsangiz,bayroqchani joylashtiring. Dasturni o'rnatish uchun kelisuv shartlarini qabul qilish kerak. $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Kelishuv shartlarini qabul qilsangiz quida taklif etilganlardan birinchi variantni tanlang. Dasturni o'rnatish uchun kelisuv shartlarini qabul qilish kerak. $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Lisenzion kelishuv\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"$(^NameDA)ni o'chirishdan oldin lesinzion kelishuv bilan tanishing.\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Agar siz kelishuv shartlariniqabul qilsangiz $\\\"Qabul qilaman$\\\" tugmasini bosing. O'chirish uchun kelishuv shartlarini qabul qilishingiz kerak. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Agar shartlarni qabul qilsangiz, bayroqchani o'rnating.O'chirish uchun kelishuv shartlarini qabul qilishingiz kerak. $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Kelishuv shartlarini qabul qilsangiz, taklif etilganlardan birinchi variantni tanlang.O'chirish uchun kelishuv shartlarini qabul qilishingiz kerak. $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Matn bo'icha silgish uchun $\\\"PageUp$\\\" va $\\\"PageDown$\\\" tugmasidan foydalaning.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"O'rnatilayotgan dastur komponentlari\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"$(^NameDA) dasturning o'zingizga kerak bo'lgan komponentasini tanlang.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Dastur komponentlari\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"$(^NameDA)ning o'chirish kerak bo'lgan komponentlarini tanlang.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Tasvir\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Sichqonchaning kursorini komponent tasvirini o'qish uchun ustiga quying.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Tasvirini o'qish o'chun, komponentni tanlang.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"O'rnatish papkasini tanlash\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"$(^NameDA)ni o'rnatish uchun papka tanlang.\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"O'chiriladigan papkani tanlash\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"$(^NameDA) o'chiriladigan papkasini ko'rsating.\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Fayllarni ko'chirish\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Biror kuting, $(^NameDA) fayllari ko'chirilmoqda...\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"O'rnatish jarayoni tugadi\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"O'rnatish jarayoni muvaffaqiyat bilan tugadi.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"O'rnatish jarayoni uzildi\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"O'rnatish jarayoni tugamadi.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"O'chirish\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Biror kutib turing, $(^NameDA) fayllarini o'chirish bajarilmoqda...\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"O'chirish tuganlandi\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Dasturni o'chirish muvaffaqiyatli yakunlandi.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"O'chirish jarayoni uzildi\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"O'chirish to'la bajarilmadi.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"$(^NameDA)ni o'rnatuvci dasturi o'z ishini tugatmoqda\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA)ni o'rnatish bajarildi.$\\r$\\n$\\r$\\nO'rnatuvchi dasturdan chiqish uchun $\\\"Tayor$\\\" tugmasini bosing.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"$(^NameDA) dasturini o'rnatish jarayonini tugatish uchun Kompyuterni qayta yuklash kerak.Shu ishni bajarishni xoziroq istaysizmi?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"$(^NameDA)ni o'chirish dasturi o'z ishini tugatdi.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) dasturi kompyuteringizdan o'chirildi.$\\r$\\n$\\r$\\nO'chirish dasturidan chiqish uchun $\\\"Tayor$\\\"tugmasini bosing.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"$(^NameDA) dasturini o'chirishni tugatish uchun kompyuterni qayta yuklash kerak.shu ishni xozir bajarasizmi?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Ha, kompyuter hozir qayta yuklansin\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Yo'q, bu ishni keyinroq bajaraman\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"$(^NameDA) &Ishga tushirilsin\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Readme fayli ko'rsatilsin\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Tayor\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Papka $\\\"Ïóñê$\\\" menyusida\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Dastur belgilarini joylashtirish uchun $\\\"Ïóñê$\\\" menyusidan papka tanlang.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"$\\\"Ïóñê$\\\" menyusidan dastur belgilari joylashadigan papka tanlang. Siz papkaning boshqa ismini kiritishingiz mumkin\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Belgilar yaratilmasin\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"$(^NameDA)ni o'chirish\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"$(^NameDA)ni kompyuterdan o'chirish.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Haqiqatdan ham siz $(^Name)ni o'rnatishni bekor qilmoqchimisiz?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"$(^Name)ni o'chirish jarayonini bekor qilmoqchisizmi?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Vietnamese.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1066\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1258\n# RTL - anything else than RTL means LTR\n-\n# Translation by NGUYỄN Mạnh Hùng <loveleeyoungae@yahoo.com>\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nCài đặt $(^Name)\n# ^UninstallCaption\nGỡ bỏ $(^Name)\n# ^LicenseSubCaption\n: Thỏa thuận Giấy phép\n# ^ComponentsSubCaption\n: Tùy chọn Cài đặt\n# ^DirSubCaption\n: Thư mục Cài đặt\n# ^InstallingSubCaption\n: Cài đặt\n# ^CompletedSubCaption\n: Hoàn thành\n# ^UnComponentsSubCaption\n: Tùy chọn Gỡ bỏ\n# ^UnDirSubCaption\n: Thư mục Gỡ bỏ\n# ^ConfirmSubCaption\n: Xác nhận\n# ^UninstallingSubCaption\n: Gỡ bỏ\n# ^UnCompletedSubCaption\n: Hoàn thành\n# ^BackBtn\n< &Lùi\n# ^NextBtn\n&Tiến >\n# ^AgreeBtn\nTô&i đồng ý\n# ^AcceptBtn\nTô&i chấp thuận các điều khoản của Thỏa thuận Giấy phép\n# ^DontAcceptBtn\nTôi &không chấp thuận các điều khoản của Thỏa thuận Giấy phép\n# ^InstallBtn\n&Cài đặt\n# ^UninstallBtn\n&Gỡ bỏ\n# ^CancelBtn\nHủy bỏ\n# ^CloseBtn\nĐón&g\n# ^BrowseBtn\nDu&yệt...\n# ^ShowDetailsBtn\n&Hiện chi tiết\n# ^ClickNext\nNhấn Tiến để tiếp tục.\n# ^ClickInstall\nNhấn “Cài đặt” để bắt đầu việc cài đặt.\n# ^ClickUninstall\nNhấn “Gỡ bỏ” để bắt đầu việc gỡ bỏ.\n# ^Name\nTên\n# ^Completed\nHoàn thành\n# ^LicenseText\nVui lòng xem xét thỏa thuận giấy phép trước khi cài đặt $(^NameDA). Nếu bạn chấp thuận tất cả các điều khoản của thỏa thuận, hãy nhấn “Tôi đồng ý”.\n# ^LicenseTextCB\nVui lòng xem xét thỏa thuận giấy phép trước khi cài đặt $(^NameDA). Nếu bạn chấp thuận tất cả các điều khoản của thỏa thuận, hãy nhấn ô bên dưới. $_CLICK\n# ^LicenseTextRB\nVui lòng xem xét thỏa thuận giấy phép trước khi cài đặt $(^NameDA). Nếu bạn chấp thuận tất cả các điều khoản của thỏa thuận, hãy chọn ô đầu tiên bên dưới. $_CLICK\n# ^UnLicenseText\nVui lòng xem xét thỏa thuận giấy phép trước khi gỡ bỏ $(^NameDA). Nếu bạn chấp thuận tất cả các điều khoản của thỏa thuận, hãy nhấn “Tôi đồng ý”.\n# ^UnLicenseTextCB\nVui lòng xem xét thỏa thuận giấy phép trước khi gỡ bỏ $(^NameDA). Nếu bạn chấp thuận tất cả các điều khoản của thỏa thuận, hãy nhấn ô bên dưới. $_CLICK\n# ^UnLicenseTextRB\nVui lòng xem xét thỏa thuận giấy phép trước khi gỡ bỏ $(^NameDA). Nếu bạn chấp thuận tất cả các điều khoản của thỏa thuận, hãy chọn ô đầu tiên bên dưới. $_CLICK\n# ^Custom\nTùy biến\n# ^ComponentsText\nChọn thành phần mà bạn muốn cài đặt và không chọn các thành phần mà bạn không muốn cài đặt. $_CLICK\n# ^ComponentsSubText1\nChọn kiểu cài đặt:\n# ^ComponentsSubText2_NoInstTypes\nChọn thành phần để cài đặt:\n# ^ComponentsSubText2\nHoặc, chọn thành phần phụ mà bạn muốn cài đặt:\n# ^UnComponentsText\nChọn thành phần mà bạn muốn gỡ bỏ và không chọn các thành phần mà bạn không muốn gỡ bỏ. $_CLICK\n# ^UnComponentsSubText1\nChọn kiểu gỡ bỏ:\n# ^UnComponentsSubText2_NoInstTypes\nChọn thành phần để gỡ bỏ:\n# ^UnComponentsSubText2\nHoặc, chọn thành phần phụ mà bạn muốn gỡ bỏ:\n# ^DirText\nTrình trợ lí sẽ cài đặt $(^NameDA) vào thư mục sau. Để cài đặt vào một thư mục khác, hãy nhấn Duyệt để chọn thư mục. $_CLICK\n# ^DirSubText\nThư mục đích\n# ^DirBrowseText\nChọn thư mục để cài đặt $(^NameDA):\n# ^UnDirText\nTrình trợ lí sẽ gỡ bỏ $(^NameDA) khỏi thư mục sau. Để gỡ bỏ khỏi một thư mục khác, hãy nhấn Duyệt để chọn thư mục. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nChọn thư mục để gỡ bỏ $(^NameDA):\n# ^SpaceAvailable\n\"Dung lượng hiện có: \"\n# ^SpaceRequired\n\"Dung lượng yêu cầu: \"\n# ^UninstallingText\n$(^NameDA) sẽ bị gỡ bỏ khỏi thư mục sau. $_CLICK\n# ^UninstallingSubText\nĐang gỡ bỏ khỏi:\n# ^FileError\nLỗi khi mở tập tin để ghi: \\r\\n\\r\\n$0\\r\\n\\r\\nNhấn “Hủy bỏ” để ngừng việc cài đặt,\\r\\n“Thử lại” để thử lần nữa, hoặc\\r\\n“Bỏ qua” để bỏ qua tập tin này.\n# ^FileError_NoIgnore\nLỗi khi mở tập tin để ghi: \\r\\n\\r\\n$0\\r\\n\\r\\nNhấn “Thử lại” để thử lần nữa, hoặc\\r\\n“Hủy bỏ” để ngừng việc cài đặt.\n# ^CantWrite\n\"Không thể ghi: \"\n# ^CopyFailed\nSao chép bị thất bại\n# ^CopyTo\n\"Sao chép vào \"\n# ^Registering\n\"Đang đăng kí: \"\n# ^Unregistering\n\"Đang hủy đăng kí: \"\n# ^SymbolNotFound\n\"Không thể tìm thấy biểu tượng: \"\n# ^CouldNotLoad\n\"Không thể nạp: \"\n# ^CreateFolder\n\"Tạo thư mục: \"\n# ^CreateShortcut\n\"Tạo lối tắt: \"\n# ^CreatedUninstaller\n\"Tạo trình gỡ bỏ: \"\n# ^Delete\n\"Xóa tập tin: \"\n# ^DeleteOnReboot\n\"Xóa khi khởi động lại: \"\n# ^ErrorCreatingShortcut\n\"Lỗi khi tạo lối tắt: \"\n# ^ErrorCreating\n\"Lỗi khi tạo: \"\n# ^ErrorDecompressing\nLỗi khi giải nén dữ liệu! Có thể trình cài đặt đã bị hỏng?\n# ^ErrorRegistering\nLỗi khi đăng kí DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Thực thi: \"\n# ^Extract\n\"Trích xuất: \"\n# ^ErrorWriting\n\"Trích xuất: lôi khi ghi vào tập tin \"\n# ^InvalidOpcode\nTrình cài đặt bị hỏng: mã tác vụ bất hợp lệ\n# ^NoOLE\n\"Không có OLE cho: \"\n# ^OutputFolder\n\"Thư mục đầu ra: \"\n# ^RemoveFolder\n\"Xóa thư mục: \"\n# ^RenameOnReboot\n\"Đổi tên khi khởi động lại: \"\n# ^Rename\n\"Đổi tên: \"\n# ^Skipped\n\"Đã bỏ qua: \"\n# ^CopyDetails\nSao chép Chi tiết vào Clipboard\n# ^LogInstall\nLưu kí quá trình cài đặt\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Vietnamese.nsh",
    "content": "﻿;Language: Vietnamese (1066)\n;By NGUYỄN Mạnh Hùng <loveleeyoungae@yahoo.com>\n\n!insertmacro LANGFILE \"Vietnamese\" = \"Tiếng Việt\" \"Tieng Viet\"\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Chào mừng đến với Trợ lí Cài đặt $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Trình trợ lí sẽ hướng dẫn bạn việc cài đặt $(^NameDA).$\\r$\\n$\\r$\\nBạn nên đóng tất cả các chương trình khác trước khi bắt đầu cài đặt. Điều này có thể giúp cập nhật các tập tin hệ thống mà không cần phải khởi động lại máy tính.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Chào mừng đến với Trợ lí Gỡ bỏ $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Trình trợ lí sẽ hướng dẫn bạn việc gỡ bỏ $(^NameDA).$\\r$\\n$\\r$\\nTrước khi bắt đầu gỡ bỏ, hãy chắc chắn rằng $(^NameDA) đang không chạy.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Thỏa thuận Giấy phép\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Vui lòng xem xét các điều khoản giấy phép trước khi cài đặt $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Nếu bạn chấp thuận các điều khoản của thỏa thuận, hãy nhấn “Tôi đồng ý” để tiếp tục. Bạn phải chấp thuận bản thỏa thuận để cài đặt $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Nếu bạn chấp thuận các điều khoản của thỏa thuận, hãy nhấn ô bên dưới. Bạn phải chấp thuận bản thỏa thuận để cài đặt $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Nếu bạn chấp thuận các điều khoản của thỏa thuận, hãy chọn ô đầu tiên bên dưới. Bạn phải chấp thuận bản thỏa thuận để cài đặt $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Thỏa thuận Giấy phép\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Vui lòng xem xét các điều khoản giấy phép trước khi gỡ bỏ $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Nếu bạn chấp thuận các điều khoản của thỏa thuận, hãy nhấn “Tôi đồng ý” để tiếp tục. Bạn phải chấp thuận bản thỏa thuận để gỡ bỏ $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Nếu bạn chấp thuận các điều khoản của thỏa thuận, hãy nhấn ô bên dưới. Bạn phải chấp thuận bản thỏa thuận để gỡ bỏ $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Nếu bạn chấp thuận các điều khoản của thỏa thuận, hãy chọn ô đầu tiên bên dưới. Bạn phải chấp thuận bản thỏa thuận để gỡ bỏ $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Ấn Page Down để xem phần còn lại của thỏa thuận.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Chọn thành phần\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Chọn các tính năng của $(^NameDA) mà bạn muốn cài đặt.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Chọn thành phần\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Chọn các tính năng của $(^NameDA) mà bạn muốn gỡ bỏ.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Mô tả\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Rê chuột lên trên một thành phần để thấy mô tả của nó.\"\n  !else\n    #FIXME:MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Chọn thư mục cài đặt\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Chọn thư mục để cài đặt $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Chọn thư mục gỡ bỏ\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Chọn thư mục để gỡ bỏ $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Cài đặt\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Vui lòng đợi trong khi $(^NameDA) đang được cài đặt.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Cài đặt hoàn tất\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Việc cài đặt đã hoàn tất thành công.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Cài đặt bị hủy\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Việc cài đặt không hoàn tất thành công.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Gỡ bỏ\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Vui lòng đợi trong khi $(^NameDA) đang được gỡ bỏ.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Gỡ bỏ hoàn tất\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Việc gỡ bỏ đã hoàn tất thành công.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Gỡ bỏ bị hủy\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Việc gỡ bỏ không hoàn tất thành công.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Hoàn tất Cài đặt $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"$(^NameDA) đã được cài đặt vào máy tính của bạn.$\\r$\\n$\\r$\\nNhấn “Hoàn thành” để đóng Trình trợ lí.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Máy tính của bạn phải được khởi động lại để hoàn tất việc cài đặt $(^NameDA). Bạn có muốn khởi động lại ngay không?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Hoàn tất Gỡ bỏ $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"$(^NameDA) đã được gỡ bỏ khỏi máy tính của bạn.$\\r$\\n$\\r$\\nNhấn “Hoàn thành” để đóng Trình trợ lí.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Máy tính của bạn phải được khởi động lại để hoàn tất việc gỡ bỏ $(^NameDA). Bạn có muốn khởi động lại ngay không?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Khởi động lại ngay\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Tôi muốn khởi động lại sau\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Chạy $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"Hiện &Readme\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Hoàn thành\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Chọn thư mục Trình đơn Start\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Chọn một thư mục trên Trình đơn Start để tạo lối tắt cho $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Chọn thư mục trên Trình đơn Start mà bạn muốn tạo lối tắt cho chương trình. Bạn cũng có thể nhập tên để tạo thư mục mới.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Không tạo lối tắt\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Gỡ bỏ $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Gỡ bỏ $(^NameDA) khỏi máy tính của bạn.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Bạn có thật sự muốn thoát trình Cài đặt $(^Name) không?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Bạn có thật sự muốn thoát trình Gỡ bỏ $(^Name) không?\"\n!endif\n\n!ifdef MULTIUSER_INSTALLMODEPAGE\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE \"Chọn người dùng\"\n  ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE \"Chọn người dùng mà bạn muốn cài đặt $(^NameDA).\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP \"Chọn giữa việc cài đặt $(^NameDA) cho riêng bạn hoặc cho tất cả người dùng của máy tính này. $(^ClickNext)\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS \"Cài đặt cho bất kì người nào sử dụng máy tính này\"\n  ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER \"Chỉ cài đặt cho riêng tôi\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Welsh.nlf",
    "content": "﻿# Header, don't edit\nNLF v6\n# Start editing here\n# Language ID\n1106\n# Font and size - dash (-) means default\n-\n-\n# Codepage - dash (-) means ASCII code page\n1252\n# RTL - anything else than RTL means LTR\n-\n# Translation by Rhoslyn Prys, Meddal.com\n# ^Branding\nNullsoft Install System %s\n# ^SetupCaption\nRhaglen Osod $(^Name)\n# ^UninstallCaption\nRhaglen Dadosod $(^Name)\n# ^LicenseSubCaption\n: Cytundeb Trwyddedu\n# ^ComponentsSubCaption\n: Dewisiadau Gosod\n# ^DirSubCaption\n: Ffolder Gosod\n# ^InstallingSubCaption\n: Gosod\n# ^CompletedSubCaption\n: Cwblhawyd\n# ^UnComponentsSubCaption\n: Dewisiadau Dadosod\n# ^UnDirSubCaption\n: Ffolder Dadosod\n# ^ConfirmSubCaption\n: Cadarnhad\n# ^UninstallingSubCaption\n: Dadosod\n# ^UnCompletedSubCaption\n: Cwblhawyd\n# ^BackBtn\n< &Nôl\n# ^NextBtn\n&Nesaf >\n# ^AgreeBtn\n&Cytuno\n# ^AcceptBtn\nRwy'n &derbyn Amodau'r Drwydded\n# ^DontAcceptBtn\nRwy'n &gwrthod Amodau'r Drwydded\n# ^InstallBtn\n&Gosod\n# ^UninstallBtn\n&Dadosod\n# ^CancelBtn\nDiddymu\n# ^CloseBtn\nC&au\n# ^BrowseBtn\n&Pori...\n# ^ShowDetailsBtn\n&Dangos manylion\n# ^ClickNext\nCliciwch Nesaf i barhau.\n# ^ClickInstall\nCliciwch Gosod i gychwyn gosod.\n# ^ClickUninstall\nCliciwch Dadosod i gychwyn dadosod.\n# ^Name\nEnw\n# ^Completed\nCwblhawyd\n# ^LicenseText\nDarllenwch y cytundeb trwyddedu cyn gosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch Cytuno.\n# ^LicenseTextCB\nDarllenwch y cytundeb trwyddedu cyn gosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch y blwch ticio isod. $_CLICK\n# ^LicenseTextRB\nDarllenwch y cytundeb trwyddedu cyn gosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, ticiwch y dewis cyntaf isod. $_CLICK\n# ^UnLicenseText\nDarllenwch y cytundeb trwyddedu cyn dadosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch Cytuno.\n# ^UnLicenseTextCB\nDarllenwch y cytundeb trwyddedu cyn dadosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, cliciwch y blwch ticio isod. $_CLICK\n# ^UnLicenseTextRB\nDarllenwch y cytundeb trwyddedu cyn dadosod $(^NameDA). Os ydych yn derbyn holl amodau'r cytundeb, ticiwch y dewis cyntaf isod. $_CLICK\n# ^Custom\nAddasu\n# ^ComponentsText\nTiciwch y cydrannau rydych am eu gosod a dad-dicio'r cydrannau nad ydych am eu gosod. $_CLICK\n# ^ComponentsSubText1\nDewis y math o osod:\n# ^ComponentsSubText2_NoInstTypes\nDewis cydrannau i'w gosod:\n# ^ComponentsSubText2\nNeu, ddewis y cydrannau ychwanegol i'w gosod:\n# ^UnComponentsText\nTiciwch y cydrannau rydych am eu dadosod a dad-dicio'r cydrannau nad ydych am eu dadosod. $_CLICK\n# ^UnComponentsSubText1\nDewis y math o ddadosod:\n# ^UnComponentsSubText2_NoInstTypes\nDewis cydrannau i'w dadosod:\n# ^UnComponentsSubText2\nNeu, ddewis y cydrannau ychwanegol i'w dadosod:\n# ^DirText\nBydd y Rhaglen Osod yn gosod $(^NameDA) yn y ffolder canlynol. I'w osod mewn ffolder gwahanol, cliciwch Pori a dewis ffolder arall. $_CLICK\n# ^DirSubText\nFfolder Cyrchfan\n# ^DirBrowseText\nDewis y ffolder i osod $(^NameDA) ynddo:\n# ^UnDirText\nBydd y Rhegen Osod yn dadosod $(^NameDA) o'r ffolder canlynol. I ddadosod o ffolder gwahanol, cliciwch Pori a dewis ffolder arall. $_CLICK\n# ^UnDirSubText\n\"\"\n# ^UnDirBrowseText\nDewis ffolder i ddadosod $(^NameDA) ohono:\n# ^SpaceAvailable\n\"Lle ar gael: \"\n# ^SpaceRequired\n\"Lle angenrheidiol: \"\n# ^UninstallingText\nBydd $(^NameDA) yn cael ei ddadosod o'r ffolder canlynol. $_CLICK\n# ^UninstallingSubText\nDadosod o:\n# ^FileError\nGwall agor ffeil i'w hysgrifennu: \\r\\n\\r\\n$0\\r\\n\\r\\nCliciwch Atal i atal y gosod,\\r\\nEto i geisio eto, neu\\r\\nAnwybyddu i hepgor y ffeil.\n# ^FileError_NoIgnore\nGwall agor ffeil i'w hysgrifennu: \\r\\n\\r\\n$0\\r\\n\\r\\nCliciwch Eto i geisio eto, neu\\r\\nDiddymu i atal y gosod.\n# ^CantWrite\n\"Methu ysgrifennu: \"\n# ^CopyFailed\nMethu Copïo\n# ^CopyTo\n\"Copïo i \"\n# ^Registering\n\"Cofrestru: \"\n# ^Unregistering\n\"Dadgofrestru: \"\n# ^SymbolNotFound\n\"Methu canfod symbol: \"\n# ^CouldNotLoad\n\"Methu llwytho: \"\n# ^CreateFolder\n\"Creu ffolder: \"\n# ^CreateShortcut\n\"Creu llwybr byr: \"\n# ^CreatedUninstaller\n\"Creu dadosodwr: \"\n# ^Delete\n\"Dileu ffeil: \"\n# ^DeleteOnReboot\n\"Dileu wrth ailgychwyn: \"\n# ^ErrorCreatingShortcut\n\"Gwall wrth greu llwybr byr: \"\n# ^ErrorCreating\n\"Gwall wrth greu: \"\n# ^ErrorDecompressing\nGwall wrth ddatgywasgu data! Gosodwr llwgr?\n# ^ErrorRegistering\nGwall cofrestru DLL\n# ^ExecShell\n\"ExecShell: \"\n# ^Exec\n\"Gweithredu: \"\n# ^Extract\n\"Echdynnu: \"\n# ^ErrorWriting\n\"Echdynnu: gwall ysgrifennu i ffeil \"\n# ^InvalidOpcode\nGosodwr llwgr: opcode annilys\n# ^NoOLE\n\"Dim OLE ar gyfer: \"\n# ^OutputFolder\n\"Ffolder allbwn: \"\n# ^RemoveFolder\n\"Tynnu ffolder: \"\n# ^RenameOnReboot\n\"Ailenwi wrth ailgychwyn: \"\n# ^Rename\n\"Ailenwi: \"\n# ^Skipped\n\"Hepgor: \"\n# ^CopyDetails\nCopïo Manylion i'r Clipfwrdd\n# ^LogInstall\nCofnodi'r brosed gosod\n# ^Byte\nB\n# ^Kilo\n K\n# ^Mega\n M\n# ^Giga\n G\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Language files/Welsh.nsh",
    "content": "﻿;Language: Welsh (1106)\n;By Rhoslyn Prys, Meddal.com\n\n!insertmacro LANGFILE \"Welsh\" = \"Cymraeg\" =\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE \"Croeso i Ddewin Gosod $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT \"Bydd y dewin yn eich arwain drwy osodiad $(^NameDA).$\\r$\\n$\\r$\\nCaewch pob rhaglen cyn cychwyn y rhaglen osod. Bydd hyn yn ei gwneud yn bosibl i ddiweddaru'r ffeiliau system berthnasol heb fod angen ailgychwyn eich cyfrifiadur.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_UNWELCOMEPAGE\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE \"Croeso i Ddewin Dadosod $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT \"Bydd y dewin yn eich arwain drwy ddadosod $(^NameDA).$\\r$\\n$\\r$\\nCyn cychwyn dadosod, gwnewch yn siwr nad yw $(^NameDA) yn rhedeg.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE\n  ${LangFileString} MUI_TEXT_LICENSE_TITLE \"Cytundeb Trwyddedu\"\n  ${LangFileString} MUI_TEXT_LICENSE_SUBTITLE \"Darllenwch amodau'r drwydded cyn gosod $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM \"Os ydych yn derbyn amodau'r cytundeb, cliciwch Cytuno i barhau. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn gosod $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Os ydych yn derbyn amodau'r cytundeb, cliciwch y blwch ticio isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn gosod $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Os ydych yn derbyn amodau'r cytundeb, cliciwch y dewis cyntaf isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn gosod $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_UNTEXT_LICENSE_TITLE \"Cytundeb Trwyddedu\"\n  ${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE \"Darllenwch amodau'r drwydded cyn dadosod $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM \"Os ydych yn derbyn amodau'r cytundeb, cliciwch Cytuno i barhau. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn dadosod  $(^NameDA).\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX \"Os ydych yn derbyn amodau'r cytundeb, cliciwch y blwch ticio isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn dadosod $(^NameDA). $_CLICK\"\n  ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS \"Os ydych yn derbyn amodau'r cytundeb, cliciwch y dewis cyntaf isod. Mae'n rhaid i chi dderbyn amodau'r cytundeb er mwyn dadosod $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE\n  ${LangFileString} MUI_INNERTEXT_LICENSE_TOP \"Pwyswch Page Down i ddarllen gweddill y cytundeb.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE\n  ${LangFileString} MUI_TEXT_COMPONENTS_TITLE \"Dewis Cydrannau\"\n  ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE \"Dewis pa nodweddion o $(^NameDA) rydych am eu gosod.\"\n!endif\n\n!ifdef MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE \"Dewis Cydrannau\"\n  ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE \"Dewis pa nodweddion o $(^NameDA) i'w dadoso.\"\n!endif\n\n!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE\n  ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE \"Disgrifiad\"\n  !ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Gosod eich llygoden dros gydran i weld ei ddisgrifiad.\"\n  !else\n    ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO \"Dewis cydran i weld ei ddisgrifiad.\"\n  !endif\n!endif\n\n!ifdef MUI_DIRECTORYPAGE\n  ${LangFileString} MUI_TEXT_DIRECTORY_TITLE \"Dewis Lleoliad Gosod\"\n  ${LangFileString} MUI_TEXT_DIRECTORY_SUBTITLE \"Dewis y ffolder i osod $(^NameDA).\"\n!endif\n\n!ifdef MUI_UNDIRECTORYPAGE\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_TITLE \"Dewis Lleoliad Dadosod\"\n  ${LangFileString} MUI_UNTEXT_DIRECTORY_SUBTITLE \"Dewis y ffolder i ddadosod $(^NameDA).\"\n!endif\n\n!ifdef MUI_INSTFILESPAGE\n  ${LangFileString} MUI_TEXT_INSTALLING_TITLE \"Gosod\"\n  ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE \"Arhoswch tra fo $(^NameDA) yn cael ei osod.\"\n  ${LangFileString} MUI_TEXT_FINISH_TITLE \"Cwblhawyd y Gosod\"\n  ${LangFileString} MUI_TEXT_FINISH_SUBTITLE \"Mae'r Gosod wedi ei gwblhau'n llwyddiannus.\"\n  ${LangFileString} MUI_TEXT_ABORT_TITLE \"Ataliwyd y Gosod\"\n  ${LangFileString} MUI_TEXT_ABORT_SUBTITLE \"Methwyd â chwblhau'r gosod yn llwyddiannus.\"\n!endif\n\n!ifdef MUI_UNINSTFILESPAGE\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE \"Dadosod\"\n  ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE \"Arhoswch tra bo $(^NameDA) yn cael ei ddadosod.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_TITLE \"Cwblhawyd y Dadosod\"\n  ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE \"Mae'r Dadosod wedi ei gwblhau'n llwyddiannus.\"\n  ${LangFileString} MUI_UNTEXT_ABORT_TITLE \"Ataliwyd y Dadosod\"\n  ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE \"Methwyd â chwblhau'r dadosod yn llwyddiannus.\"\n!endif\n\n!ifdef MUI_FINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE \"Cwblhau Dewin Gosod $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT \"Mae $(^NameDA) wedi cael ei osod ar eich cyfrifiadur.$\\r$\\n$\\r$\\nCliciwch Gorffen i gau'r dewin.\"\n  ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT \"Rhaid ailgychwyn eich cyfrifiadur i gwblhau gosod $(^NameDA). Hoffech chi ailgychwyn?\"\n!endif\n\n!ifdef MUI_UNFINISHPAGE\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE \"Cwblhau Dewin Dadosod $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT \"Mae $(^NameDA) wedi ei ddadosod oddi ar eich cyfrifiadur.$\\r$\\n$\\r$\\nCliciwch Gorffen i gau'r dewin.\"\n  ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT \"Rhaid ailgychwyn eich cyfrifiadur i gwblhau gosod $(^NameDA). Hoffech chi ailgychwyn?\"\n!endif\n\n!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW \"Ailgychwyn\"\n  ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER \"Rwyf am ailgychwyn yn hwyrach\"\n  ${LangFileString} MUI_TEXT_FINISH_RUN \"&Rhedeg $(^NameDA)\"\n  ${LangFileString} MUI_TEXT_FINISH_SHOWREADME \"&Dangos Darllenfi\"\n  ${LangFileString} MUI_BUTTONTEXT_FINISH \"&Gorffen\"  \n!endif\n\n!ifdef MUI_STARTMENUPAGE\n  ${LangFileString} MUI_TEXT_STARTMENU_TITLE \"Dewis Ffolder Dewislen Cychwyn\"\n  ${LangFileString} MUI_TEXT_STARTMENU_SUBTITLE \"Dewis ffolder Dewislen Cychwyn ar gyfer llwybrau byr $(^NameDA).\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_TOP \"Dewis ffolder Dewislen Cychwyn i greu llwybrau byr y rhaglen. Gallwch roi enw i greu ffolder newydd.\"\n  ${LangFileString} MUI_INNERTEXT_STARTMENU_CHECKBOX \"Peidio creu llwybrau byr\"\n!endif\n\n!ifdef MUI_UNCONFIRMPAGE\n  ${LangFileString} MUI_UNTEXT_CONFIRM_TITLE \"Dadosod $(^NameDA)\"\n  ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE \"Tynnu $(^NameDA) oddiar eich cyfrifiadur.\"\n!endif\n\n!ifdef MUI_ABORTWARNING\n  ${LangFileString} MUI_TEXT_ABORTWARNING \"Ydych chi'n si?r eich bod am adael Rhaglen Osod $(^Name)?\"\n!endif\n\n!ifdef MUI_UNABORTWARNING\n  ${LangFileString} MUI_UNTEXT_ABORTWARNING \"Ydych chi'n siwr eich bod am adael Rhaglen Dadosod $(^Name)?\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI/System.nsh",
    "content": "/*\n\nNSIS Modern User Interface - Version 1.81\nCopyright 2002-2022 Joost Verburg\n\n*/\n\n!ifndef MUI_INCLUDED\n!verbose push 3\n!define MUI_INCLUDED\n!define MUI_SYSVERSION \"1.81\"\n!verbose pop\n!echo \"NSIS Modern User Interface version ${MUI_SYSVERSION} - Copyright 2002-2022 Joost Verburg\"\n\n;--------------------------------\n!verbose push 3\n!define /IfNDef MUI_VERBOSE 3\n!verbose ${MUI_VERBOSE}\n\n;--------------------------------\n;HEADER FILES, DECLARATIONS\n\n!include InstallOptions.nsh\n!include LangFile.nsh\n!include WinMessages.nsh\n\nVar MUI_TEMP1\nVar MUI_TEMP2\n\n;--------------------------------\n;INSERT CODE\n\n!macro MUI_INSERT\n\n  !ifndef MUI_INSERT\n    !define MUI_INSERT\n\n    !ifdef MUI_PRODUCT | MUI_VERSION\n      !warning \"The MUI_PRODUCT and MUI_VERSION defines have been removed. Use a normal Name command now.\"\n    !endif\n\n    !insertmacro MUI_INTERFACE\n\n    !insertmacro MUI_FUNCTION_GUIINIT\n    !insertmacro MUI_FUNCTION_ABORTWARNING\n  \n    !ifdef MUI_IOCONVERT_USED\n      !insertmacro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT\n    !endif\n\n    !ifdef MUI_UNINSTALLER\n      !insertmacro MUI_UNFUNCTION_GUIINIT\n      !insertmacro MUI_FUNCTION_UNABORTWARNING\n    \n      !ifdef MUI_UNIOCONVERT_USED\n        !insertmacro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT\n      !endif\n    !endif\n\n  !endif\n\n!macroend\n\n;--------------------------------\n;GENERAL\n\n!macro MUI_DEFAULT SYMBOL CONTENT\n\n  !ifndef \"${SYMBOL}\"\n    !define \"${SYMBOL}\" \"${CONTENT}\"\n  !endif\n\n!macroend\n\n!macro MUI_DEFAULT_IOCONVERT SYMBOL CONTENT\n\n  !ifndef \"${SYMBOL}\"\n    !define \"${SYMBOL}\" \"${CONTENT}\"\n    !insertmacro MUI_SET \"${SYMBOL}_DEFAULTSET\"\n    !insertmacro MUI_SET \"MUI_${MUI_PAGE_UNINSTALLER_PREFIX}IOCONVERT_USED\"\n  !else\n    !insertmacro MUI_UNSET \"${SYMBOL}_DEFAULTSET\" \n  !endif\n\n!macroend\n\n!macro MUI_SET SYMBOL\n\n  !ifndef \"${SYMBOL}\"\n    !define \"${SYMBOL}\"\n  !endif\n\n!macroend\n\n!macro MUI_UNSET SYMBOL\n\n  !ifdef \"${SYMBOL}\"\n    !undef \"${SYMBOL}\"\n  !endif\n\n!macroend\n\n;--------------------------------\n;INTERFACE - COMPILE TIME SETTINGS\n\n!macro MUI_INTERFACE\n\n  !ifndef MUI_INTERFACE\n    !define MUI_INTERFACE\n\n    !ifdef MUI_INSERT_NSISCONF\n      !insertmacro MUI_NSISCONF\n    !endif\n\n    !insertmacro MUI_DEFAULT MUI_UI \"${NSISDIR}\\Contrib\\UIs\\modern.exe\"\n    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe\"\n    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE_RIGHT \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmpr.exe\"\n    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_SMALLDESC \"${NSISDIR}\\Contrib\\UIs\\modern_smalldesc.exe\"\n    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_NODESC \"${NSISDIR}\\Contrib\\UIs\\modern_nodesc.exe\"\n    !insertmacro MUI_DEFAULT MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-install.ico\"\n    !insertmacro MUI_DEFAULT MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-uninstall.ico\"\n    !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_CHECKBITMAP \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\"\n    !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BGCOLOR \"/windows\"\n    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_COLORS \"/windows\"\n    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_PROGRESSBAR \"smooth\"\n    !insertmacro MUI_DEFAULT MUI_BGCOLOR \"FFFFFF\"\n    !insertmacro MUI_DEFAULT MUI_TEXTCOLOR \"000000\"\n    !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_INI \"${NSISDIR}\\Contrib\\Modern UI\\ioSpecial.ini\"\n    !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_INI \"${NSISDIR}\\Contrib\\Modern UI\\ioSpecial.ini\"\n    !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n    !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n    !if \"${MUI_WELCOMEFINISHPAGE_BITMAP}\" == \"\"\n      !error \"Invalid MUI_WELCOMEFINISHPAGE_BITMAP\"\n    !endif\n    !if \"${MUI_UNWELCOMEFINISHPAGE_BITMAP}\" == \"\"\n      !error \"Invalid MUI_UNWELCOMEFINISHPAGE_BITMAP\"\n    !endif\n\n    !ifdef MUI_HEADERIMAGE\n\n      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp\"\n\n      !ifndef MUI_HEADERIMAGE_UNBITMAP\n        !define MUI_HEADERIMAGE_UNBITMAP \"${MUI_HEADERIMAGE_BITMAP}\"\n        !ifdef MUI_HEADERIMAGE_BITMAP_NOSTRETCH\n          !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH\n        !endif\n      !endif\n\n      !if \"${MUI_HEADERIMAGE_BITMAP}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_BITMAP\"\n      !endif\n      !if \"${MUI_HEADERIMAGE_UNBITMAP}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_UNBITMAP\"\n      !endif\n\n      !ifdef MUI_HEADERIMAGE_BITMAP_RTL\n        !ifndef MUI_HEADERIMAGE_UNBITMAP_RTL\n          !define MUI_HEADERIMAGE_UNBITMAP_RTL \"${MUI_HEADERIMAGE_BITMAP_RTL}\"\n          !ifdef MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH\n            !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH\n          !endif\n        !endif\n\n        !if \"${MUI_HEADERIMAGE_BITMAP_RTL}\" == \"\"\n          !error \"Invalid MUI_HEADERIMAGE_BITMAP_RTL\"\n        !endif\n        !if \"${MUI_HEADERIMAGE_UNBITMAP_RTL}\" == \"\"\n          !error \"Invalid MUI_HEADERIMAGE_UNBITMAP_RTL\"\n        !endif\n      !endif\n\n    !endif\n\n    XPStyle On\n\n    ChangeUI all \"${MUI_UI}\"\n    !ifdef MUI_HEADERIMAGE\n      !ifndef MUI_HEADERIMAGE_RIGHT\n        ChangeUI IDD_INST \"${MUI_UI_HEADERIMAGE}\"\n      !else\n        ChangeUI IDD_INST \"${MUI_UI_HEADERIMAGE_RIGHT}\"\n      !endif\n    !endif\n    !ifdef MUI_COMPONENTSPAGE_SMALLDESC\n      ChangeUI IDD_SELCOM \"${MUI_UI_COMPONENTSPAGE_SMALLDESC}\"\n    !else ifdef MUI_COMPONENTSPAGE_NODESC\n       ChangeUI IDD_SELCOM \"${MUI_UI_COMPONENTSPAGE_NODESC}\"\n    !endif\n\n    Icon \"${MUI_ICON}\"\n    UninstallIcon \"${MUI_UNICON}\"\n\n    CheckBitmap \"${MUI_COMPONENTSPAGE_CHECKBITMAP}\"\n    LicenseBkColor \"${MUI_LICENSEPAGE_BGCOLOR}\"\n    InstallColors ${MUI_INSTFILESPAGE_COLORS}\n    InstProgressFlags ${MUI_INSTFILESPAGE_PROGRESSBAR}\n\n    SubCaption 4 \" \"\n    UninstallSubCaption 2 \" \"\n\n    !insertmacro MUI_DEFAULT MUI_ABORTWARNING_TEXT \"$(MUI_TEXT_ABORTWARNING)\"\n    !insertmacro MUI_DEFAULT MUI_UNABORTWARNING_TEXT \"$(MUI_UNTEXT_ABORTWARNING)\"\n\n  !endif\n\n!macroend\n\n;--------------------------------\n;INTERFACE - RUN-TIME\n\n!macro MUI_INNERDIALOG_TEXT CONTROL TEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${CONTROL}\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_HEADER_TEXT_INTERNAL ID TEXT\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT \"${ID}\"\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n  !endif\n\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n    ShowWindow $MUI_TEMP1 ${SW_SHOWNA}\n\n  !endif\n\n!macroend\n\n!macro MUI_HEADER_TEXT TEXT SUBTEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n    LockWindow on\n\n  !endif\n\n  !insertmacro MUI_HEADER_TEXT_INTERNAL 1037 \"${TEXT}\"\n  !insertmacro MUI_HEADER_TEXT_INTERNAL 1038 \"${SUBTEXT}\"\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n    LockWindow off\n\n  !endif\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_HEADER_TEXT_PAGE TEXT SUBTEXT\n\n  !ifdef MUI_PAGE_HEADER_TEXT & MUI_PAGE_HEADER_SUBTEXT\n    !insertmacro MUI_HEADER_TEXT \"${MUI_PAGE_HEADER_TEXT}\" \"${MUI_PAGE_HEADER_SUBTEXT}\"\n  !else ifdef MUI_PAGE_HEADER_TEXT\n    !insertmacro MUI_HEADER_TEXT \"${MUI_PAGE_HEADER_TEXT}\" \"${SUBTEXT}\"\n  !else ifdef MUI_PAGE_HEADER_SUBTEXT\n    !insertmacro MUI_HEADER_TEXT \"${TEXT}\" \"${MUI_PAGE_HEADER_SUBTEXT}\"\n  !else\n    !insertmacro MUI_HEADER_TEXT \"${TEXT}\" \"${SUBTEXT}\"\n  !endif\n\n  !insertmacro MUI_UNSET MUI_PAGE_HEADER_TEXT\n  !insertmacro MUI_UNSET MUI_PAGE_HEADER_SUBTEXT\n\n!macroend\n\n!macro MUI_DESCRIPTION_BEGIN\n\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1043\n\n  StrCmp $0 -1 0 mui.description_begin_done\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:\"\n    EnableWindow $MUI_TEMP1 0\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:$MUI_TEXT\"\n    Goto mui.description_done\n  mui.description_begin_done:\n\n!macroend\n\n!macro MUI_DESCRIPTION_TEXT VAR TEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  StrCmp $0 ${VAR} 0 mui.description_${VAR}_done\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:\"\n    EnableWindow $MUI_TEMP1 1\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n    Goto mui.description_done\n  mui.description_${VAR}_done:\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  mui.description_done:\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_ENDHEADER\n\n  IfAbort mui.endheader_abort\n\n    !ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT & MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}\" \"${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}\"\n    !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)\"\n    !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)\" \"${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}\"\n    !else\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)\"\n    !endif\n\n  Goto mui.endheader_done\n\n  mui.endheader_abort:\n\n    !ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT & MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}\" \"${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}\"\n    !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)\"\n    !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)\" \"${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}\"\n    !else\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)\"\n    !endif\n\n  mui.endheader_done:\n\n!macroend\n\n!macro MUI_ABORTWARNING\n\n  !ifdef MUI_FINISHPAGE_ABORTWARNINGCHECK\n    StrCmp $MUI_NOABORTWARNING \"1\" mui.quit\n  !endif\n\n  !ifdef MUI_ABORTWARNING_CANCEL_DEFAULT\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 \"${MUI_ABORTWARNING_TEXT}\" IDYES mui.quit\n  !else\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION \"${MUI_ABORTWARNING_TEXT}\" IDYES mui.quit\n  !endif\n\n  Abort\n  mui.quit:\n\n!macroend\n\n!macro MUI_UNABORTWARNING\n\n  !ifdef MUI_UNABORTWARNING_CANCEL_DEFAULT\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 \"${MUI_UNABORTWARNING_TEXT}\" IDYES mui.quit\n  !else\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION \"${MUI_UNABORTWARNING_TEXT}\" IDYES mui.quit\n  !endif\n\n  Abort\n  mui.quit:\n\n!macroend\n\n!macro MUI_GUIINIT\n\n  !insertmacro MUI_WELCOMEFINISHPAGE_INIT \"\"\n  !insertmacro MUI_HEADERIMAGE_INIT \"\"\n\n  !insertmacro MUI_GUIINIT_BASIC\n\n!macroend\n\n!macro MUI_UNGUIINIT\n\n  !insertmacro MUI_WELCOMEFINISHPAGE_INIT \"UN\"\n  !insertmacro MUI_HEADERIMAGE_INIT \"UN\"\n\n  !insertmacro MUI_GUIINIT_BASIC\n\n  !ifdef MUI_UNFINISHPAGE\n    !ifndef MUI_UNFINISHPAGE_NOAUTOCLOSE\n      SetAutoClose true\n    !endif\n  !endif\n\n!macroend\n\n!macro MUI_GUIINIT_BASIC\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n  CreateFont $MUI_TEMP2 \"$(^Font)\" \"$(^FontSize)\" \"700\"\n  SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n\n  !ifndef MUI_HEADER_TRANSPARENT_TEXT\n\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n  !else\n\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"transparent\"\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"transparent\"\n\n  !endif\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1034 ; Header background\n  SetCtlColors $MUI_TEMP1 \"\" \"${MUI_BGCOLOR}\"\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039 ; Header image\n  SetCtlColors $MUI_TEMP1 \"\" \"${MUI_BGCOLOR}\"\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n  SetCtlColors $MUI_TEMP1 /BRANDING\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n  SetCtlColors $MUI_TEMP1 /BRANDING\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:$(^Branding) \"\n\n!macroend\n\n!macro MUI_WELCOMEFINISHPAGE_INIT UNINSTALLER\n\n  !ifdef MUI_${UNINSTALLER}WELCOMEPAGE | MUI_${UNINSTALLER}FINISHPAGE\n\n    !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${MUI_${UNINSTALLER}WELCOMEFINISHPAGE_INI}\" \"ioSpecial.ini\"\n    File \"/oname=$PLUGINSDIR\\modern-wizard.bmp\" \"${MUI_${UNINSTALLER}WELCOMEFINISHPAGE_BITMAP}\"\n    !pragma verifyloadimage \"${MUI_${UNINSTALLER}WELCOMEFINISHPAGE_BITMAP}\"\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 1\" \"Text\" \"$PLUGINSDIR\\modern-wizard.bmp\"\n\n    !ifdef MUI_${UNINSTALLER}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 1\" \"Flags\" \"\"\n    !endif\n\n  !endif\n\n!macroend\n\n!macro MUI_HEADERIMAGE_INIT UNINSTALLER\n\n  !ifdef MUI_HEADERIMAGE\n\n    InitPluginsDir\n\n    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL\n\n    StrCmp $(^RTL) 0 mui.headerimageinit_nortl\n\n        File \"/oname=$PLUGINSDIR\\modern-header.bmp\" \"${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL}\"\n        !pragma verifyloadimage \"${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL}\"\n\n        !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL_NOSTRETCH\n          SetBrandingImage /IMGID=1046 /RESIZETOFIT \"$PLUGINSDIR\\modern-header.bmp\"\n        !else\n          SetBrandingImage /IMGID=1046 \"$PLUGINSDIR\\modern-header.bmp\"\n        !endif\n\n        Goto mui.headerimageinit_done\n\n      mui.headerimageinit_nortl:\n\n    !endif\n\n        File \"/oname=$PLUGINSDIR\\modern-header.bmp\" \"${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP}\"\n        !pragma verifyloadimage \"${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP}\"\n\n        !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_NOSTRETCH\n          SetBrandingImage /IMGID=1046 /RESIZETOFIT \"$PLUGINSDIR\\modern-header.bmp\"\n        !else\n          SetBrandingImage /IMGID=1046 \"$PLUGINSDIR\\modern-header.bmp\"\n        !endif\n\n    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL\n\n    mui.headerimageinit_done:\n\n    !endif\n\n  !endif\n\n!macroend\n\n;--------------------------------\n;INTERFACE - FUNCTIONS\n\n!macro MUI_FUNCTION_GUIINIT\n\n  Function .onGUIInit\n\n    !insertmacro MUI_GUIINIT\n\n    !ifdef MUI_CUSTOMFUNCTION_GUIINIT\n      Call \"${MUI_CUSTOMFUNCTION_GUIINIT}\"\n    !endif\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_DESCRIPTION_BEGIN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifndef MUI_VAR_TEXT\n    Var MUI_TEXT\n    !define MUI_VAR_TEXT\n  !endif\n\n  Function .onMouseOverSection\n    !insertmacro MUI_DESCRIPTION_BEGIN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_FUNCTION_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n    !insertmacro MUI_DESCRIPTION_END\n    !ifdef MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION\n      Call \"${MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION}\"\n    !endif\n  FunctionEnd\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNFUNCTION_DESCRIPTION_BEGIN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Function un.onMouseOverSection\n    !insertmacro MUI_DESCRIPTION_BEGIN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNFUNCTION_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n    !insertmacro MUI_DESCRIPTION_END\n    !ifdef MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION\n      Call \"${MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION}\"\n    !endif\n  FunctionEnd\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_FUNCTION_ABORTWARNING\n\n  Function .onUserAbort\n    !ifdef MUI_ABORTWARNING\n      !insertmacro MUI_ABORTWARNING\n    !endif\n    !ifdef MUI_CUSTOMFUNCTION_ABORT\n      Call \"${MUI_CUSTOMFUNCTION_ABORT}\"\n    !endif\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_UNABORTWARNING\n\n  Function un.onUserAbort\n    !ifdef MUI_UNABORTWARNING\n      !insertmacro MUI_UNABORTWARNING\n    !endif\n    !ifdef MUI_CUSTOMFUNCTION_UNABORT\n      Call \"${MUI_CUSTOMFUNCTION_UNABORT}\"\n    !endif\n  FunctionEnd\n\n!macroend\n\n!macro MUI_UNFUNCTION_GUIINIT\n\n  Function un.onGUIInit\n\n  !insertmacro MUI_UNGUIINIT\n\n  !ifdef MUI_CUSTOMFUNCTION_UNGUIINIT\n    Call \"${MUI_CUSTOMFUNCTION_UNGUIINIT}\"\n  !endif\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTIONS_DESCRIPTION_BEGIN\n\n  ;1.65 compatibility\n\n  !warning \"Modern UI macro name has changed. Please change MUI_FUNCTIONS_DESCRIPTION_BEGIN to MUI_FUNCTION_DESCRIPTION_BEGIN.\"\n\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n\n!macroend\n\n!macro MUI_FUNCTIONS_DESCRIPTION_END\n\n  ;1.65 compatibility\n\n  !warning \"Modern UI macro name has changed. Please change MUI_FUNCTIONS_DESCRIPTION_END to MUI_FUNCTION_DESCRIPTION_END.\"\n\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n!macroend\n\n;--------------------------------\n;START MENU FOLDER\n\n!macro MUI_STARTMENU_GETFOLDER ID VAR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME\n\n    ReadRegStr $MUI_TEMP1 \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT}\" \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME}\"\n      StrCmp $MUI_TEMP1 \"\" +3\n        StrCpy \"${VAR}\" $MUI_TEMP1\n        Goto +2\n\n        StrCpy \"${VAR}\" \"${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}\"\n\n   !else\n\n     StrCpy \"${VAR}\" \"${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}\"\n\n   !endif\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_STARTMENU_WRITE_BEGIN ID\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !define MUI_STARTMENUPAGE_CURRENT_ID \"${ID}\"\n\n  StrCpy $MUI_TEMP1 \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\" 1\n  StrCmp $MUI_TEMP1 \">\" mui.startmenu_write_${MUI_STARTMENUPAGE_CURRENT_ID}_done\n\n  StrCmp \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\" \"\" 0 mui.startmenu_writebegin_${MUI_STARTMENUPAGE_CURRENT_ID}_notempty\n\n    !insertmacro MUI_STARTMENU_GETFOLDER \"${MUI_STARTMENUPAGE_CURRENT_ID}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\"\n\n  mui.startmenu_writebegin_${MUI_STARTMENUPAGE_CURRENT_ID}_notempty:\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_STARTMENU_WRITE_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME\n    WriteRegStr \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\"\n  !endif\n\n  mui.startmenu_write_${MUI_STARTMENUPAGE_CURRENT_ID}_done:\n\n  !undef MUI_STARTMENUPAGE_CURRENT_ID\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;PAGES\n\n!macro MUI_PAGE_INIT\n\n  !ifdef MUI_INSERT\n    !warning \"MUI_[UN]PAGE_* inserted after MUI_LANGUAGE\"\n  !endif\n\n  !insertmacro MUI_INTERFACE\n\n  !insertmacro MUI_DEFAULT MUI_PAGE_UNINSTALLER_PREFIX \"\"\n  !insertmacro MUI_DEFAULT MUI_PAGE_UNINSTALLER_FUNCPREFIX \"\"\n\n  !insertmacro MUI_UNSET MUI_UNIQUEID\n\n  !define MUI_UNIQUEID ${__LINE__}\n\n!macroend\n\n!macro MUI_UNPAGE_INIT\n\n  !ifndef MUI_UNINSTALLER\n    !define MUI_UNINSTALLER\n  !endif\n\n  !define MUI_PAGE_UNINSTALLER\n\n  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_PREFIX\n  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_FUNCPREFIX\n\n  !define MUI_PAGE_UNINSTALLER_PREFIX \"UN\"\n  !define MUI_PAGE_UNINSTALLER_FUNCPREFIX \"un.\"\n\n!macroend\n\n!macro MUI_UNPAGE_END\n\n  !undef MUI_PAGE_UNINSTALLER\n  !undef MUI_PAGE_UNINSTALLER_PREFIX\n  !undef MUI_PAGE_UNINSTALLER_FUNCPREFIX\n\n!macroend\n\n!macro MUI_PAGE_WELCOME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TITLE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT)\"\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_WELCOMEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_LICENSE LICENSEDATA\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}LICENSEPAGE\n\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_TEXT_TOP \"$(MUI_INNERTEXT_LICENSE_TOP)\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BUTTON \"\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_CHECKBOX_TEXT \"\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT \"\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE \"\"\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}license\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    LicenseData \"${LICENSEDATA}\"\n\n    !ifndef MUI_LICENSEPAGE_TEXT_BOTTOM\n      !ifndef MUI_LICENSEPAGE_CHECKBOX & MUI_LICENSEPAGE_RADIOBUTTONS\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !else ifdef MUI_LICENSEPAGE_CHECKBOX\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_CHECKBOX)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !else\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !endif\n    !else\n      LicenseText \"${MUI_LICENSEPAGE_TEXT_BOTTOM}\" \"${MUI_LICENSEPAGE_BUTTON}\"\n    !endif\n\n    !ifdef MUI_LICENSEPAGE_CHECKBOX\n      LicenseForceSelection checkbox \"${MUI_LICENSEPAGE_CHECKBOX_TEXT}\"\n    !else ifdef MUI_LICENSEPAGE_RADIOBUTTONS\n      LicenseForceSelection radiobuttons \"${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT}\" \"${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE}\"\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_LICENSEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_TOP\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_BOTTOM\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_BUTTON\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_RADIOBUTTONS\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_ACCEPT\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_DECLINE\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_COMPONENTS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}COMPONENTSPAGE\n\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_TOP \"\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_COMPLIST \"\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_INSTTYPE \"\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE \"$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE)\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO \"$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO)\"\n\n  !ifndef MUI_VAR_TEXT\n    Var MUI_TEXT\n    !define MUI_VAR_TEXT\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}components\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    ComponentText \"${MUI_COMPONENTSPAGE_TEXT_TOP}\" \"${MUI_COMPONENTSPAGE_TEXT_INSTTYPE}\" \"${MUI_COMPONENTSPAGE_TEXT_COMPLIST}\"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_COMPONENTSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}\n\n  !undef MUI_COMPONENTSPAGE_TEXT_TOP\n  !undef MUI_COMPONENTSPAGE_TEXT_COMPLIST\n  !undef MUI_COMPONENTSPAGE_TEXT_INSTTYPE\n  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE\n  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_DIRECTORY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}DIRECTORYPAGE\n\n  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_TOP \"\"\n  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_DESTINATION \"\"\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}directory\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    DirText \"${MUI_DIRECTORYPAGE_TEXT_TOP}\" \"${MUI_DIRECTORYPAGE_TEXT_DESTINATION}\"\n\n    !ifdef MUI_DIRECTORYPAGE_VARIABLE\n      DirVar \"${MUI_DIRECTORYPAGE_VARIABLE}\"\n    !endif\n\n    !ifdef MUI_DIRECTORYPAGE_VERIFYONLEAVE\n      DirVerify leave\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_DIRECTORYPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}\n\n  !undef MUI_DIRECTORYPAGE_TEXT_TOP\n  !undef MUI_DIRECTORYPAGE_TEXT_DESTINATION\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_BGCOLOR\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VARIABLE\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VERIFYONLEAVE\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_STARTMENU ID VAR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}STARTMENUPAGE\n\n  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_DEFAULTFOLDER \"$(^Name)\"\n  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_TOP \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_TOP)\"\n  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_CHECKBOX \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_CHECKBOX)\"\n\n  !define MUI_STARTMENUPAGE_VARIABLE \"${VAR}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_VARIABLE\" \"${MUI_STARTMENUPAGE_VARIABLE}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT\" \"${MUI_STARTMENUPAGE_REGISTRY_ROOT}\"\n  !endif\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_KEY\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY\" \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\"\n  !endif\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n  !endif\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_STARTMENUPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}\n\n  !undef MUI_STARTMENUPAGE_VARIABLE\n  !undef MUI_STARTMENUPAGE_TEXT_TOP\n  !undef MUI_STARTMENUPAGE_TEXT_CHECKBOX\n  !undef MUI_STARTMENUPAGE_DEFAULTFOLDER\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_NODISABLE\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_ROOT\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_KEY\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_BGCOLOR\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_INSTFILES\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTFILESPAGE\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}instfiles\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_INSTFILESPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_TEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_TEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_SUBTEXT\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_FINISH\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TITLE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_BUTTON \"$(MUI_BUTTONTEXT_FINISH)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_REBOOT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOTNOW \"$(MUI_TEXT_FINISH_REBOOTNOW)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOTLATER \"$(MUI_TEXT_FINISH_REBOOTLATER)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_RUN_TEXT \"$(MUI_TEXT_FINISH_RUN)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_SHOWREADME_TEXT \"$(MUI_TEXT_FINISH_SHOWREADME)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_LINK_COLOR \"000080\"\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  !ifndef MUI_PAGE_UNINSTALLER\n    !ifndef MUI_FINISHPAGE_NOAUTOCLOSE\n      AutoCloseWindow true\n    !endif\n  !endif\n\n  !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n    !ifndef MUI_VAR_NOABORTWARNING\n      !define MUI_VAR_NOABORTWARNING\n      Var MUI_NOABORTWARNING\n    !endif\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_FINISHPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE_3LINES\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_LARGE\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_BUTTON\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CANCEL_ENABLED\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTNOW\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTLATER\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTLATER_DEFAULT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_TEXT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_PARAMETERS\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_NOTCHECKED\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_FUNCTION\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_TEXT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_FUNCTION\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_LOCATION\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_COLOR\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_TOP\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_BOTTOM\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_WELCOME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_WELCOME\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_CONFIRM\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifndef MUI_UNINSTALLER\n    !define MUI_UNINSTALLER\n  !endif\n\n  !insertmacro MUI_PAGE_INIT\n\n  !insertmacro MUI_SET MUI_UNCONFIRMPAGE\n\n  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_TOP \"\"\n  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_LOCATION \"\"\n\n  PageEx un.uninstConfirm\n\n    PageCallbacks un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    UninstallText \"${MUI_UNCONFIRMPAGE_TEXT_TOP}\" \"${MUI_UNCONFIRMPAGE_TEXT_LOCATION}\"\n\n    !ifdef MUI_UNCONFIRMPAGE_VARIABLE\n      DirVar \"${MUI_UNCONFIRMPAGE_VARIABLE}\"\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_UNFUNCTION_CONFIRMPAGE un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_TOP\n  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_LOCATION\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_LICENSE LICENSEDATA\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_LICENSE \"${LICENSEDATA}\"\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_COMPONENTS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_COMPONENTS\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_DIRECTORY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_DIRECTORY\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_INSTFILES\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_INSTFILES\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_FINISH\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_FINISH\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;PAGE FUNCTIONS\n\n!macro MUI_PAGE_FUNCTION_CUSTOM TYPE\n\n  !ifdef MUI_PAGE_CUSTOMFUNCTION_${TYPE}\n    Call \"${MUI_PAGE_CUSTOMFUNCTION_${TYPE}}\"\n    !undef MUI_PAGE_CUSTOMFUNCTION_${TYPE}\n  !endif\n\n!macroend\n\n!macro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM\n\n  !ifdef MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT\n    Call \"${MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT}\"\n    !undef MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT\n  !endif\n\n!macroend\n\n!macro MUI_FUNCTION_WELCOMEPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"NumFields\" \"3\"\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"NextButtonText\" \"\"\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"CancelEnabled\" \"\"\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 2\" \"Text\" MUI_WELCOMEPAGE_TITLE\n\n    !ifndef MUI_WELCOMEPAGE_TITLE_3LINES\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 2\" \"Bottom\" \"38\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Top\" \"45\"\n    !else\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 2\" \"Bottom\" \"48\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Top\" \"55\"\n    !endif\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"185\"\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 3\" \"Text\" MUI_WELCOMEPAGE_TEXT\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    LockWindow on\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n    LockWindow off\n\n    !insertmacro INSTALLOPTIONS_INITDIALOG \"ioSpecial.ini\"\n    Pop $MUI_HWND\n    SetCtlColors $MUI_HWND \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1201\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    CreateFont $MUI_TEMP2 \"$(^Font)\" \"12\" \"700\"\n    SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1202\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_SHOW\n\n    LockWindow on\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    LockWindow off\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_LICENSEPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_SUBTITLE)\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro MUI_INNERDIALOG_TEXT 1040 \"${MUI_LICENSEPAGE_TEXT_TOP}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_COMPONENTSPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_SUBTITLE)\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro MUI_INNERDIALOG_TEXT 1042 \"${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE}\"\n\n    FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1043\n    EnableWindow $MUI_TEMP1 0\n\n    !insertmacro MUI_INNERDIALOG_TEXT 1043 \"${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}\"\n    StrCpy $MUI_TEXT \"${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_DIRECTORYPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_SUBTITLE)\n  FunctionEnd\n\n  Function \"${SHOW}\"\n    !ifdef MUI_DIRECTORYPAGE_BGCOLOR\n      !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXTCOLOR \"\"\n      FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n      GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1019\n      SetCtlColors $MUI_TEMP1 \"${MUI_DIRECTORYPAGE_TEXTCOLOR}\" \"${MUI_DIRECTORYPAGE_BGCOLOR}\"\n    !endif\n    \n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_STARTMENUPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n     !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY & MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n\n      StrCmp \"${MUI_STARTMENUPAGE_VARIABLE}\" \"\" 0 +4\n\n      ReadRegStr $MUI_TEMP1 \"${MUI_STARTMENUPAGE_REGISTRY_ROOT}\" \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n        StrCmp $MUI_TEMP1 \"\" +2\n          StrCpy \"${MUI_STARTMENUPAGE_VARIABLE}\" $MUI_TEMP1\n\n    !endif\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)\n\n    StrCmp $(^RTL) 0 mui.startmenu_nortl\n      !ifndef MUI_STARTMENUPAGE_NODISABLE\n        StartMenu::Init /rtl /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" /checknoshortcuts \"${MUI_STARTMENUPAGE_TEXT_CHECKBOX}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !else\n        StartMenu::Init /rtl /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !endif\n      Goto mui.startmenu_initdone\n    mui.startmenu_nortl:\n      !ifndef MUI_STARTMENUPAGE_NODISABLE\n        StartMenu::Init /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" /checknoshortcuts \"${MUI_STARTMENUPAGE_TEXT_CHECKBOX}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !else\n        StartMenu::Init /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !endif\n    mui.startmenu_initdone:\n\n  Pop $MUI_HWND\n\n  !ifdef MUI_STARTMENUPAGE_BGCOLOR\n    !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXTCOLOR \"\"\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1002\n    SetCtlColors $MUI_TEMP1 \"${MUI_STARTMENUPAGE_TEXTCOLOR}\" \"${MUI_STARTMENUPAGE_BGCOLOR}\"\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1004\n    SetCtlColors $MUI_TEMP1 \"${MUI_STARTMENUPAGE_TEXTCOLOR}\" \"${MUI_STARTMENUPAGE_BGCOLOR}\"\n  !endif\n\n  !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n  StartMenu::Show\n  !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED\n\n    Pop $MUI_TEMP1\n    StrCmp $MUI_TEMP1 \"success\" 0 +2\n      Pop \"${MUI_STARTMENUPAGE_VARIABLE}\"\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_INSTFILESPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_SUBTITLE)\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !insertmacro MUI_ENDHEADER\n    !insertmacro MUI_LANGDLL_SAVELANGUAGE\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_FINISHPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Settings\" \"NextButtonText\" MUI_FINISHPAGE_BUTTON\n\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"CancelEnabled\" \"1\"\n    !endif\n\n    !ifndef MUI_FINISHPAGE_TITLE_3LINES\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 2\" \"Bottom\" \"38\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Top\" \"45\"\n    !else\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 2\" \"Bottom\" \"48\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Top\" \"55\"\n    !endif\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 2\" \"Text\" MUI_FINISHPAGE_TITLE\n\n    !ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n      !ifndef MUI_FINISHPAGE_TITLE_3LINES\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"85\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"115\"\n        !endif\n      !else\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"95\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"125\"\n        !endif\n      !endif\n    !else\n      !ifndef MUI_FINISHPAGE_LINK\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"185\"\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"175\"\n      !endif\n    !endif\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      IfRebootFlag 0 mui.finish_noreboot_init\n\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"85\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"115\"\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"95\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 3\" \"Bottom\" \"125\"\n          !endif\n        !endif\n\n        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 3\" \"Text\" MUI_FINISHPAGE_TEXT_REBOOT\n\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"5\"\n\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Type\" \"RadioButton\"\n        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 4\" \"Text\" MUI_FINISHPAGE_TEXT_REBOOTNOW\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Left\" \"120\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Right\" \"321\"\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"90\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"100\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"120\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"130\"\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"100\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"110\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"130\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"140\"\n          !endif\n        !endif\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"Type\" \"RadioButton\"\n        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 5\" \"Text\" MUI_FINISHPAGE_TEXT_REBOOTLATER\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"Left\" \"120\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"Right\" \"321\"\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"Top\" \"110\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"Bottom\" \"120\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"Top\" \"110\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"Bottom\" \"120\"\n        !endif\n        !ifdef MUI_FINISHPAGE_REBOOTLATER_DEFAULT\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"State\" \"0\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"State\" \"1\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"State\" \"1\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 5\" \"State\" \"0\"\n        !endif\n\n        Goto mui.finish_load\n\n      mui.finish_noreboot_init:\n\n    !endif\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 3\" \"Text\" MUI_FINISHPAGE_TEXT\n\n    !ifdef MUI_FINISHPAGE_RUN\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Type\" \"CheckBox\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field 4\" \"Text\" MUI_FINISHPAGE_RUN_TEXT\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Left\" \"120\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Right\" \"315\"\n      !ifndef MUI_FINISHPAGE_TITLE_3LINES\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"90\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"100\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"120\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"130\"\n        !endif\n      !else\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"100\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"110\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Top\" \"130\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"Bottom\" \"140\"\n        !endif\n      !endif\n      !ifndef MUI_FINISHPAGE_RUN_NOTCHECKED\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 4\" \"State\" \"1\"\n      !endif\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n\n      !ifdef MUI_FINISHPAGE_CURFIELD_NO\n        !undef MUI_FINISHPAGE_CURFIELD_NO\n      !endif\n\n      !ifndef MUI_FINISHPAGE_RUN\n        !define MUI_FINISHPAGE_CURFIELD_NO 4\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !define MUI_FINISHPAGE_CURFIELD_TOP 90\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 100\n          !else\n            !define MUI_FINISHPAGE_CURFIELD_TOP 120\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 130\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !define MUI_FINISHPAGE_CURFIELD_TOP 100\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 110\n          !else\n            !define MUI_FINISHPAGE_CURFIELD_TOP 130\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 140\n          !endif\n        !endif\n      !else\n        !define MUI_FINISHPAGE_CURFIELD_NO 5\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !define MUI_FINISHPAGE_CURFIELD_TOP 110\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 120\n          !else\n            !define MUI_FINISHPAGE_CURFIELD_TOP 140\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 150\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !define MUI_FINISHPAGE_CURFIELD_TOP 120\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 130\n          !else\n            !define MUI_FINISHPAGE_CURFIELD_TOP 150\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 160\n          !endif\n        !endif\n      !endif\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Type\" \"CheckBox\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Text\" MUI_FINISHPAGE_SHOWREADME_TEXT\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Left\" \"120\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Right\" \"315\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Top\" ${MUI_FINISHPAGE_CURFIELD_TOP}\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Bottom\" ${MUI_FINISHPAGE_CURFIELD_BOTTOM}\n      !ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\n         !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"State\" \"1\"\n      !endif\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_LINK\n\n      !ifdef MUI_FINISHPAGE_CURFIELD_NO\n        !undef MUI_FINISHPAGE_CURFIELD_NO\n      !endif\n\n      !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n        !define MUI_FINISHPAGE_CURFIELD_NO 6\n      !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n        !define MUI_FINISHPAGE_CURFIELD_NO 5\n      !else\n        !define MUI_FINISHPAGE_CURFIELD_NO 4\n      !endif\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Type\" \"Link\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Text\" MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Left\" \"120\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Right\" \"315\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Top\" \"175\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Bottom\" \"185\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"State\" MUI_FINISHPAGE_LINK_LOCATION\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME & MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"6\"\n    !else ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"5\"\n    !else ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"5\"\n    !else ifdef MUI_FINISHPAGE_SHOWREADME & MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"5\"\n    !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME | MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"4\"\n    !endif\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n       mui.finish_load:\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    LockWindow on\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n    LockWindow off\n\n    !insertmacro INSTALLOPTIONS_INITDIALOG \"ioSpecial.ini\"\n    Pop $MUI_HWND\n    SetCtlColors $MUI_HWND \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1201\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    CreateFont $MUI_TEMP2 \"$(^Font)\" \"12\" \"700\"\n    SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1202\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      IfRebootFlag 0 mui.finish_noreboot_show\n\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203\n        SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204\n        SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n        Goto mui.finish_show\n\n      mui.finish_noreboot_show:\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_RUN\n      GetDlgItem $MUI_TEMP1 $MUI_HWND 1203\n      SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n    !endif\n\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n      !ifndef MUI_FINISHPAGE_RUN\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203\n      !else\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204\n      !endif\n      SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n    !endif\n\n    !ifdef MUI_FINISHPAGE_LINK\n      !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1205\n      !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204\n      !else\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203\n      !endif\n      SetCtlColors $MUI_TEMP1 \"${MUI_FINISHPAGE_LINK_COLOR}\" \"${MUI_BGCOLOR}\"\n    !endif\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n      mui.finish_show:\n    !endif\n\n    !ifndef MUI_FORCECLASSICCONTROLS\n    ${If} ${IsHighContrastModeActive}\n    !endif\n      ; SetCtlColors does not change the check/radio text color (bug #443)\n      !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203\n        System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204\n        System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n      !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1203\n        System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n        !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n        GetDlgItem $MUI_TEMP1 $MUI_HWND 1204\n        System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n        !endif\n      !endif\n    !ifndef MUI_FORCECLASSICCONTROLS\n    ${EndIf}\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      StrCpy $MUI_NOABORTWARNING \"1\"\n    !endif\n\n    !insertmacro INSTALLOPTIONS_SHOW\n\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      StrCpy $MUI_NOABORTWARNING \"\"\n    !endif\n\n    LockWindow on\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    LockWindow off\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      IfRebootFlag \"\" mui.finish_noreboot_end\n\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field 4\" \"State\"\n\n          StrCmp $MUI_TEMP1 \"1\" 0 +2\n            Reboot\n\n          Return\n\n      mui.finish_noreboot_end:\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_RUN\n\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field 4\" \"State\"\n\n      StrCmp $MUI_TEMP1 \"1\" 0 mui.finish_norun\n        !ifndef MUI_FINISHPAGE_RUN_FUNCTION\n          !ifndef MUI_FINISHPAGE_RUN_PARAMETERS\n            StrCpy $MUI_TEMP1 \"$\\\"${MUI_FINISHPAGE_RUN}$\\\"\"\n          !else\n            StrCpy $MUI_TEMP1 \"$\\\"${MUI_FINISHPAGE_RUN}$\\\" ${MUI_FINISHPAGE_RUN_PARAMETERS}\"\n          !endif\n          Exec \"$MUI_TEMP1\"\n        !else\n          Call \"${MUI_FINISHPAGE_RUN_FUNCTION}\"\n        !endif\n\n        mui.finish_norun:\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n\n      !ifndef MUI_FINISHPAGE_RUN\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field 4\" \"State\"\n      !else\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field 5\" \"State\"\n      !endif\n\n      StrCmp $MUI_TEMP1 \"1\" 0 mui.finish_noshowreadme\n        !ifndef MUI_FINISHPAGE_SHOWREADME_FUNCTION\n           ExecShell \"open\" \"${MUI_FINISHPAGE_SHOWREADME}\"\n        !else\n          Call \"${MUI_FINISHPAGE_SHOWREADME_FUNCTION}\"\n        !endif\n\n        mui.finish_noshowreadme:\n\n    !endif\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_UNFUNCTION_CONFIRMPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n   !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n   !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_UNTEXT_CONFIRM_TITLE) $(MUI_UNTEXT_CONFIRM_SUBTITLE)\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n;--------------------------------\n;INSTALL OPTIONS (CUSTOM PAGES)\n\n!macro MUI_INSTALLOPTIONS_EXTRACT FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_EXTRACT \"${FILE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_EXTRACT_AS FILE FILENAME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${FILE}\" \"${FILENAME}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_DISPLAY FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_DISPLAY \"${FILE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_DISPLAY_RETURN FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_DISPLAY_RETURN \"${FILE}\"\n  \n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_INITDIALOG FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_INITDIALOG \"${FILE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_SHOW\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_SHOW\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_SHOW_RETURN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_SHOW_RETURN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_READ VAR FILE SECTION KEY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_READ \"${VAR}\" \"${FILE}\" \"${SECTION}\" \"${KEY}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"${SECTION}\" \"${KEY}\" \"${VALUE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT FILE SECTION KEY SYMBOL\n\n  ;Converts default strings from language files to InstallOptions format\n  ;Only for use inside MUI\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifndef \"${SYMBOL}_DEFAULTSET\"\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"${SECTION}\" \"${KEY}\" \"${${SYMBOL}}\"\n  !else\n    Push \"${${SYMBOL}}\"\n    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}Nsis2Io\n    Pop $MUI_TEMP1\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"${SECTION}\" \"${KEY}\" $MUI_TEMP1\n  !endif\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;RESERVE FILES\n\n!macro MUI_RESERVEFILE_INSTALLOPTIONS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ReserveFile /plugin InstallOptions.dll\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_RESERVEFILE_LANGDLL\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ReserveFile /plugin LangDLL.dll\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;LANGUAGES\n\n!macro MUI_LANGUAGE NLFID\n\n  ;Include a language\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ; MUI_PAGE_UNINSTALLER_PREFIX is undefined by uninstaller pages so we check MUI_UNINSTALLER as well\n  !ifndef MUI_PAGE_UNINSTALLER_PREFIX && MUI_UNINSTALLER\n    !ifndef MUI_DISABLE_INSERT_LANGUAGE_AFTER_PAGES_WARNING ; Define this to avoid the warning if you only have custom pages\n      !warning \"MUI_LANGUAGE should be inserted after the MUI_[UN]PAGE_* macros\"\n    !endif\n  !endif\n\n  !insertmacro MUI_INSERT\n\n  LoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\${NLFID}.nlf\"\n\n  ;Include language file\n  !insertmacro LANGFILE_INCLUDE_WITHDEFAULT \\\n    \"${NSISDIR}\\Contrib\\Language files\\${NLFID}.nsh\" \"${NSISDIR}\\Contrib\\Language files\\English.nsh\"\n\n  ;Add language to list of languages for selection dialog\n  !define /ifndef MUI_LANGDLL_LANGUAGES \"\"\n  !define /redef MUI_LANGDLL_LANGUAGES \\\n    `\"${LANGFILE_${NLFID}_LANGDLL}\" \"${LANG_${NLFID}}\" ${MUI_LANGDLL_LANGUAGES}`\n  !define /ifndef MUI_LANGDLL_LANGUAGES_CP \"\"\n  !define /redef MUI_LANGDLL_LANGUAGES_CP \\\n    `\"${LANGFILE_${NLFID}_LANGDLL}\" \"${LANG_${NLFID}}\" \"${LANG_${NLFID}_CP}\" ${MUI_LANGDLL_LANGUAGES_CP}`\n  \n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;LANGUAGE SELECTION DIALOG\n\n!macro MUI_LANGDLL_DISPLAY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifndef MUI_LANGDLL_LANGUAGES\n    !warning \"MUI_LANGDLL_DISPLAY should only be used after inserting the MUI_LANGUAGE macro(s)\"\n  !endif\n\n  !insertmacro MUI_DEFAULT MUI_LANGDLL_WINDOWTITLE \"Installer Language\"\n  !insertmacro MUI_DEFAULT MUI_LANGDLL_INFO \"Please select a language.\"\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n\n    ReadRegStr $MUI_TEMP1 \"${MUI_LANGDLL_REGISTRY_ROOT}\" \"${MUI_LANGDLL_REGISTRY_KEY}\" \"${MUI_LANGDLL_REGISTRY_VALUENAME}\"\n    StrCmp $MUI_TEMP1 \"\" mui.langdll_show\n      StrCpy $LANGUAGE $MUI_TEMP1\n      !ifndef MUI_LANGDLL_ALWAYSSHOW\n        Goto mui.langdll_done\n      !endif\n    mui.langdll_show:\n\n  !endif\n  \n  !ifdef NSIS_CONFIG_SILENT_SUPPORT\n    IfSilent mui.langdll_done\n  !endif  \n\n  !ifdef MUI_LANGDLL_ALLLANGUAGES\n    LangDLL::LangDialog \"${MUI_LANGDLL_WINDOWTITLE}\" \"${MUI_LANGDLL_INFO}\" A ${MUI_LANGDLL_LANGUAGES} \"\"\n  !else\n    LangDLL::LangDialog \"${MUI_LANGDLL_WINDOWTITLE}\" \"${MUI_LANGDLL_INFO}\" AC ${MUI_LANGDLL_LANGUAGES_CP} \"\"\n  !endif\n\n  Pop $LANGUAGE\n  StrCmp $LANGUAGE \"cancel\" 0 +2\n    Abort\n\n  !ifdef NSIS_CONFIG_SILENT_SUPPORT\n    mui.langdll_done:\n  !else ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n    mui.langdll_done:\n  !endif\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_LANGDLL_SAVELANGUAGE\n\n  !ifndef MUI_PAGE_UNINSTALLER\n\n    IfAbort mui.langdllsavelanguage_abort\n\n    !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n      WriteRegStr \"${MUI_LANGDLL_REGISTRY_ROOT}\" \"${MUI_LANGDLL_REGISTRY_KEY}\" \"${MUI_LANGDLL_REGISTRY_VALUENAME}\" $LANGUAGE\n    !endif\n\n    mui.langdllsavelanguage_abort:\n\n  !endif\n\n!macroend\n\n!macro MUI_UNGETLANGUAGE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n\n    ReadRegStr $MUI_TEMP1 \"${MUI_LANGDLL_REGISTRY_ROOT}\" \"${MUI_LANGDLL_REGISTRY_KEY}\" \"${MUI_LANGDLL_REGISTRY_VALUENAME}\"\n    StrCmp $MUI_TEMP1 \"\" 0 mui.ungetlanguage_setlang\n\n  !endif\n\n  !insertmacro MUI_LANGDLL_DISPLAY\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n\n    Goto mui.ungetlanguage_done\n\n    mui.ungetlanguage_setlang:\n      StrCpy $LANGUAGE $MUI_TEMP1\n\n    mui.ungetlanguage_done:\n\n  !endif\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;END\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI/ioSpecial.ini",
    "content": "[Settings]\nRect=1044\nNumFields=3\n[Field 1]\nType=bitmap\nLeft=0\nRight=109\nTop=0\nBottom=193\nFlags=RESIZETOFIT\n[Field 2]\nType=label\nLeft=120\nRight=315\nTop=10\n[Field 3]\nType=label\nLeft=120\nRight=315"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Deprecated.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nDeprecated code - display warnings\n\n*/\n\n\n!macro MUI_LEGACY_MAP_NOSTRETCH NAME R\n  !if \"${R}\" != \"\"\n    !ifdef ${NAME}NOSTRETCH\n        !define /IfNDef ${NAME}STRETCH NoStretchNoCropNoAlign\n    !endif\n  !else\n    !insertmacro ${__MACRO__} ${NAME}BITMAP_ 1\n    !insertmacro ${__MACRO__} ${NAME}BITMAP_RTL_ 1\n    !insertmacro ${__MACRO__} ${NAME}UNBITMAP_ 1\n    !insertmacro ${__MACRO__} ${NAME}UNBITMAP_RTL_ 1\n  !endif\n!macroend\n\n\n;--------------------------------\n;InstallOptions\n\n!define INSTALLOPTIONS_ERROR \"MUI_INSTALLOPTIONS_* macros are no longer a part of MUI2. Include InstallOptions.nsh and use INSTALLOPTIONS_* macros instead. It is also recommended to upgrade to nsDialogs.\"\n\n!macro MUI_INSTALLOPTIONS_EXTRACT FILE\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_EXTRACT_AS FILE FILENAME\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_DISPLAY FILE\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_DISPLAY_RETURN FILE\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_INITDIALOG FILE\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_SHOW\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_SHOW_RETURN\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_READ VAR FILE SECTION KEY\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE\n\n  !error \"${INSTALLOPTIONS_ERROR}\"\n\n!macroend\n\n!macro MUI_RESERVEFILE_INSTALLOPTIONS\n\n  !error `MUI_RESERVEFILE_INSTALLOPTIONS is no longer supported as InstallOptions is no longer used by MUI2. Instead, use \"ReserveFile /plugin InstallOptions.dll\". It is also recommended to upgrade to nsDialogs.`\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Interface.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nInterface code for all pages\n\n*/\n\n;--------------------------------\n;Variables\n\nVar mui.Header.Text\nVar mui.Header.Text.Font\nVar mui.Header.SubText\nVar mui.Header.Background\nVar mui.Header.Image\n\nVar mui.Branding.Text\nVar mui.Branding.Background\n\nVar mui.Line.Standard\nVar mui.Line.FullWindow\n\nVar mui.Button.Next\nVar mui.Button.Cancel\nVar mui.Button.Back\n\n\n;--------------------------------\n;General interface settings\n\n!macro MUI_INTERFACE\n\n  !ifndef MUI_INTERFACE\n\n    !define MUI_INTERFACE\n\n    ;These values are set after the interface settings in the script,\n    ;so the script itself can override all values.\n\n    ;Default interface settings in nsisconf.nsh\n    !ifdef MUI_INSERT_NSISCONF\n      !insertmacro MUI_NSISCONF\n    !endif\n\n    ;Default interface settings\n    !insertmacro MUI_DEFAULT MUI_UI \"${NSISDIR}\\Contrib\\UIs\\modern.exe\"\n    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe\"\n    !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE_RIGHT \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmpr.exe\"\n    !insertmacro MUI_DEFAULT MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-install.ico\"\n    !insertmacro MUI_DEFAULT MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-uninstall.ico\"\n    !insertmacro MUI_DEFAULT MUI_BGCOLOR \"FFFFFF\"\n    !insertmacro MUI_DEFAULT MUI_TEXTCOLOR \"000000\"\n\n    ;Map *_NOSTRETCH legacy define to the correct *_STRETCH value\n    !verbose push 2\n    !insertmacro MUI_LEGACY_MAP_NOSTRETCH MUI_HEADERIMAGE_ \"\"\n    !insertmacro MUI_LEGACY_MAP_NOSTRETCH MUI_WELCOMEFINISHPAGE_ \"\"\n    !insertmacro MUI_LEGACY_MAP_NOSTRETCH MUI_UNWELCOMEFINISHPAGE_ \"\"\n    !verbose pop\n\n    ;Default header images\n    !ifdef MUI_HEADERIMAGE\n\n      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp\"\n      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP_STRETCH \"FitControl\"\n      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP_RTL_STRETCH ${MUI_HEADERIMAGE_BITMAP_STRETCH}\n\n      !ifndef MUI_HEADERIMAGE_UNBITMAP\n        !define MUI_HEADERIMAGE_UNBITMAP \"${MUI_HEADERIMAGE_BITMAP}\"\n        !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_STRETCH ${MUI_HEADERIMAGE_BITMAP_STRETCH}\n      !endif\n\n      !if \"${MUI_HEADERIMAGE_BITMAP}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_BITMAP\"\n      !endif\n      !if \"${MUI_HEADERIMAGE_UNBITMAP}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_UNBITMAP\"\n      !endif\n\n      !ifdef MUI_HEADERIMAGE_BITMAP_RTL\n        !ifndef MUI_HEADERIMAGE_UNBITMAP_RTL\n          !define MUI_HEADERIMAGE_UNBITMAP_RTL \"${MUI_HEADERIMAGE_BITMAP_RTL}\"\n          !insertmacro MUI_SET MUI_HEADERIMAGE_UNBITMAP_RTL_STRETCH ${MUI_HEADERIMAGE_BITMAP_RTL_STRETCH}\n        !endif\n\n        !if \"${MUI_HEADERIMAGE_BITMAP_RTL}\" == \"\"\n          !error \"Invalid MUI_HEADERIMAGE_BITMAP_RTL\"\n        !endif\n        !if \"${MUI_HEADERIMAGE_UNBITMAP_RTL}\" == \"\"\n          !error \"Invalid MUI_HEADERIMAGE_UNBITMAP_RTL\"\n        !endif\n      !endif\n\n      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_UNBITMAP_STRETCH ${MUI_HEADERIMAGE_BITMAP_STRETCH}\n      !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_UNBITMAP_RTL_STRETCH ${MUI_HEADERIMAGE_BITMAP_RTL_STRETCH}\n\n    !endif\n\n    ;Default texts\n    !insertmacro MUI_DEFAULT MUI_ABORTWARNING_TEXT \"$(MUI_TEXT_ABORTWARNING)\"\n    !insertmacro MUI_DEFAULT MUI_UNABORTWARNING_TEXT \"$(MUI_UNTEXT_ABORTWARNING)\"  \n\n    ;Apply settings\n\n    XPStyle On ;XP style setting in manifest resource\n\n    ;Dialog resources\n    ChangeUI all \"${MUI_UI}\" \n    !ifdef MUI_HEADERIMAGE\n      !ifndef MUI_HEADERIMAGE_RIGHT\n        ChangeUI IDD_INST \"${MUI_UI_HEADERIMAGE}\"\n      !else\n        ChangeUI IDD_INST \"${MUI_UI_HEADERIMAGE_RIGHT}\"\n      !endif\n    !endif\n\n    ;Icons\n    Icon \"${MUI_ICON}\"\n    UninstallIcon \"${MUI_UNICON}\"\n\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Abort warning message box\n\n!macro MUI_ABORTWARNING\n\n  !ifdef MUI_ABORTWARNING_CANCEL_DEFAULT\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 \"${MUI_ABORTWARNING_TEXT}\" IDYES mui.Quit\n  !else\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION \"${MUI_ABORTWARNING_TEXT}\" IDYES mui.Quit\n  !endif\n  \n  Abort\n  mui.Quit:\n\n!macroend\n\n!macro MUI_UNABORTWARNING\n\n  !ifdef MUI_UNABORTWARNING_CANCEL_DEFAULT\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 \"${MUI_UNABORTWARNING_TEXT}\" IDYES mui.Quit\n  !else\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION \"${MUI_UNABORTWARNING_TEXT}\" IDYES mui.Quit\n  !endif\n\n  Abort\n  mui.Quit:\n\n!macroend\n\n\n;--------------------------------\n;Initialization of GUI\n\n!macro MUI_HEADERIMAGE_INITHELPER_LOADIMAGEWITHMACRO MACRO\n\n  !ifdef MUI_HEADERIMAGE_RIGHT\n    !ifndef MUI_OPTIMIZE_ALWAYSLTR ; Undocumented\n      ${if} $(^RTL) == 1\n        !insertmacro ${MACRO} $mui.Header.Image \"${PATH}\" Left Leak\n      ${Else}\n        !insertmacro ${MACRO} $mui.Header.Image \"${PATH}\" Right Leak\n      ${EndIf}\n    !else\n      !insertmacro ${MACRO} $mui.Header.Image \"${PATH}\" Right Leak\n    !endif\n  !else\n    !insertmacro ${MACRO} $mui.Header.Image \"${PATH}\" Auto Leak\n  !endif\n\n!macroend\n!macro MUI_HEADERIMAGE_INITHELPER_LOADIMAGE UN RTL IMGRESID PATH\n\n  GetDlgItem $mui.Header.Image $HWNDPARENT ${IMGRESID} ; This variable is not used by every mode but we have to reference it to avoid a compiler warning.\n\n  !if \"${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}\" == \"NoStretchNoCropNoAlign\"\n\n    SetBrandingImage /IMGID=${IMGRESID} \"${PATH}\"\n\n  !else if \"${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}\" == \"NoStretchNoCrop\"\n\n    !insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGEWITHMACRO \\\n      MUI_LOADANDXALIGNIMAGE\n\n  !else if \"${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}\" == \"AspectFitHeight\"\n\n    !insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGEWITHMACRO \\\n      MUI_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT\n\n  !else\n\n    !if \"${MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH}\" != \"FitControl\"\n      !warning 'MUI_HEADERIMAGE_${UN}BITMAP${RTL}_STRETCH set to unknown value, defaulting to FitControl'\n    !endif\n    SetBrandingImage /IMGID=${IMGRESID} /RESIZETOFIT \"${PATH}\"\n\n  !endif\n\n!macroend\n\n!macro MUI_HEADERIMAGE_INIT UN IMGRESID\n\n  ;Load and display header image\n\n  !ifdef MUI_HEADERIMAGE\n\n    InitPluginsDir\n\n    !ifdef MUI_HEADERIMAGE_${UN}BITMAP_RTL\n      ${if} $(^RTL) == 1\n\n        File \"/oname=$PLUGINSDIR\\modern-header.bmp\" \"${MUI_HEADERIMAGE_${UN}BITMAP_RTL}\"\n        !pragma verifyloadimage \"${MUI_HEADERIMAGE_${UN}BITMAP_RTL}\"\n        !insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGE \"${UN}\" \"_RTL\" ${IMGRESID} \"$PLUGINSDIR\\modern-header.bmp\"\n\n      ${else}\n    !endif\n\n        File \"/oname=$PLUGINSDIR\\modern-header.bmp\" \"${MUI_HEADERIMAGE_${UN}BITMAP}\"\n        !pragma verifyloadimage \"${MUI_HEADERIMAGE_${UN}BITMAP}\"\n        !insertmacro MUI_HEADERIMAGE_INITHELPER_LOADIMAGE \"${UN}\" \"\" ${IMGRESID} \"$PLUGINSDIR\\modern-header.bmp\"\n\n    !ifdef MUI_HEADERIMAGE_${UN}BITMAP_RTL\n      ${endif}\n    !endif\n\n  !endif\n\n!macroend\n\n!macro MUI_GUIINIT_OUTERDIALOG UNINSTALLER\n\n  ;Initialize outer dialog (fonts & colors)\n\n  ;Header\n  GetDlgItem $mui.Header.Text $HWNDPARENT 1037\n  CreateFont $mui.Header.Text.Font \"$(^Font)\" \"$(^FontSize)\" \"700\"\n  SendMessage $mui.Header.Text ${WM_SETFONT} $mui.Header.Text.Font 0\n\n  GetDlgItem $mui.Header.SubText $HWNDPARENT 1038\n\n  !ifndef MUI_HEADER_TRANSPARENT_TEXT\n    SetCtlColors $mui.Header.Text \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n    SetCtlColors $mui.Header.SubText \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n  !else\n    SetCtlColors $mui.Header.Text \"${MUI_TEXTCOLOR}\" \"transparent\"\n    SetCtlColors $mui.Header.SubText \"${MUI_TEXTCOLOR}\" \"transparent\"\n  !endif\n\n  ;Header image\n  !insertmacro MUI_HEADERIMAGE_INIT \"${UNINSTALLER}\" 1046\n\n  ;Header background\n  GetDlgItem $mui.Header.Background $HWNDPARENT 1034\n  SetCtlColors $mui.Header.Background \"\" \"${MUI_BGCOLOR}\"\n\n  ;Header icon image background\n  !ifndef MUI_HEADERIMAGE\n    GetDlgItem $mui.Header.Image $HWNDPARENT 1039\n    SetCtlColors $mui.Header.Image \"\" \"${MUI_BGCOLOR}\"\n  !endif\n\n  ;Branding text\n  GetDlgItem $mui.Branding.Background $HWNDPARENT 1028\n  SetCtlColors $mui.Branding.Background /BRANDING\n  GetDlgItem $mui.Branding.Text $HWNDPARENT 1256\n  SetCtlColors $mui.Branding.Text /BRANDING\n  SendMessage $mui.Branding.Text ${WM_SETTEXT} 0 \"STR:$(^Branding) \"\n\n  ;Lines\n  GetDlgItem $mui.Line.Standard $HWNDPARENT 1035\n  GetDlgItem $mui.Line.FullWindow $HWNDPARENT 1045\n\n  ;Buttons\n  GetDlgItem $mui.Button.Next $HWNDPARENT 1\n  GetDlgItem $mui.Button.Cancel $HWNDPARENT 2\n  GetDlgItem $mui.Button.Back $HWNDPARENT 3\n\n!macroend\n\n\n;--------------------------------\n;Interface functions\n\n!macro MUI_FUNCTION_GUIINIT\n\n  Function .onGUIInit\n\n    !insertmacro MUI_GUIINIT_OUTERDIALOG \"\"\n\n    !ifdef MUI_PAGE_FUNCTION_GUIINIT\n      Call \"${MUI_PAGE_FUNCTION_GUIINIT}\"\n    !endif  \n\n    !ifdef MUI_CUSTOMFUNCTION_GUIINIT\n      Call \"${MUI_CUSTOMFUNCTION_GUIINIT}\"\n    !endif\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_UNFUNCTION_GUIINIT\n\n  Function un.onGUIInit  \n\n    !insertmacro MUI_GUIINIT_OUTERDIALOG UN\n    \n    !ifdef MUI_UNPAGE_FUNCTION_GUIINIT\n      Call \"${MUI_UNPAGE_FUNCTION_GUIINIT}\"\n    !endif    \n\n    !ifdef MUI_CUSTOMFUNCTION_UNGUIINIT\n      Call \"${MUI_CUSTOMFUNCTION_UNGUIINIT}\"\n    !endif\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_ABORTWARNING\n\n  Function .onUserAbort\n  \n    !ifdef MUI_PAGE_FUNCTION_ABORTWARNING\n      Call ${MUI_PAGE_FUNCTION_ABORTWARNING}\n    !endif\n  \n    !ifdef MUI_ABORTWARNING\n      !insertmacro MUI_ABORTWARNING\n    !endif\n    \n    !ifdef MUI_CUSTOMFUNCTION_ABORT\n      Call \"${MUI_CUSTOMFUNCTION_ABORT}\"\n    !endif\n    \n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_UNABORTWARNING\n\n  Function un.onUserAbort\n  \n    !ifdef MUI_UNPAGE_FUNCTION_ABORTWARNING\n      Call ${MUI_UNPAGE_FUNCTION_ABORTWARNING}\n    !endif  \n  \n    !ifdef MUI_UNABORTWARNING\n      !insertmacro MUI_UNABORTWARNING\n    !endif\n    \n    !ifdef MUI_CUSTOMFUNCTION_UNABORT\n      Call \"${MUI_CUSTOMFUNCTION_UNABORT}\"\n    !endif\n    \n  FunctionEnd\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Localization.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nLocalization\n\n*/\n\n;--------------------------------\n;Variables\n\n!macro MUI_LANGDLL_VARIABLES\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n    !ifndef MUI_LANGDLL_REGISTRY_VARIABLES\n      !define MUI_LANGDLL_REGISTRY_VARIABLES\n\n      ;/GLOBAL because the macros are included in a function\n      Var /GLOBAL mui.LangDLL.RegistryLanguage\n\n    !endif\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Include language files\n\n!macro MUI_LANGUAGEEX LangDir NLFID\n\n  !verbose push ${MUI_VERBOSE}\n\n  !ifndef MUI_PAGE_UNINSTALLER_PREFIX\n    !ifndef MUI_DISABLE_INSERT_LANGUAGE_AFTER_PAGES_WARNING ; Define this to avoid the warning if you only have custom pages\n      !warning \"MUI_LANGUAGE[EX] should be inserted after the MUI_[UN]PAGE_* macros\"\n    !endif\n  !endif\n\n  !insertmacro MUI_INSERT\n\n  ;Include a language\n  LoadLanguageFile \"${LangDir}\\${NLFID}.nlf\"\n\n  ;Include MUI language file\n  !insertmacro LANGFILE_INCLUDE_WITHDEFAULT \\\n    \"${LangDir}\\${NLFID}.nsh\" \"${NSISDIR}\\Contrib\\Language files\\English.nsh\"\n\n  ;Add language to list of languages for selection dialog\n  !define /ifndef MUI_LANGDLL_LANGUAGES \"\"\n  !define /redef MUI_LANGDLL_LANGUAGES \\\n    `\"${LANGFILE_${NLFID}_LANGDLL}\" \"${LANG_${NLFID}}\" ${MUI_LANGDLL_LANGUAGES}`\n  !define /ifndef MUI_LANGDLL_LANGUAGES_CP \"\"\n  !define /redef MUI_LANGDLL_LANGUAGES_CP \\\n    `\"${LANGFILE_${NLFID}_LANGDLL}\" \"${LANG_${NLFID}}\" \"${LANG_${NLFID}_CP}\" ${MUI_LANGDLL_LANGUAGES_CP}`\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_LANGUAGE NLFID\n\n  !verbose push ${MUI_VERBOSE}\n\n  !insertmacro MUI_LANGUAGEEX \"${NSISDIR}\\Contrib\\Language files\" \"${NLFID}\"\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Language selection\n\n!macro MUI_LANGDLL_DISPLAY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifndef MUI_LANGDLL_LANGUAGES\n    !warning \"MUI_LANGDLL_DISPLAY should only be used after inserting the MUI_LANGUAGE macro(s)\"\n  !endif\n\n  !insertmacro MUI_LANGDLL_VARIABLES\n\n  !insertmacro MUI_DEFAULT MUI_LANGDLL_WINDOWTITLE \"Installer Language\"\n  !insertmacro MUI_DEFAULT MUI_LANGDLL_INFO \"Please select a language.\"\n\n  !ifdef MUI_LANGDLL_REGISTRY_VARIABLES\n\n    ReadRegStr $mui.LangDLL.RegistryLanguage \"${MUI_LANGDLL_REGISTRY_ROOT}\" \"${MUI_LANGDLL_REGISTRY_KEY}\" \"${MUI_LANGDLL_REGISTRY_VALUENAME}\"\n    \n    ${if} $mui.LangDLL.RegistryLanguage != \"\"\n      ;Set default language to registry language\n      StrCpy $LANGUAGE $mui.LangDLL.RegistryLanguage\n    ${endif}\n\n  !endif\n\n  !ifdef NSIS_CONFIG_SILENT_SUPPORT\n    ${unless} ${Silent}\n  !endif\n\n  !ifndef MUI_LANGDLL_ALWAYSSHOW\n  !ifdef MUI_LANGDLL_REGISTRY_VARIABLES\n    ${if} $mui.LangDLL.RegistryLanguage == \"\"\n  !endif\n  !endif\n  \n  ;Show language selection dialog\n  !ifdef MUI_LANGDLL_ALLLANGUAGES\n    LangDLL::LangDialog \"${MUI_LANGDLL_WINDOWTITLE}\" \"${MUI_LANGDLL_INFO}\" A ${MUI_LANGDLL_LANGUAGES} \"\"\n  !else\n    LangDLL::LangDialog \"${MUI_LANGDLL_WINDOWTITLE}\" \"${MUI_LANGDLL_INFO}\" AC ${MUI_LANGDLL_LANGUAGES_CP} \"\"\n  !endif\n  \n    Pop $LANGUAGE\n    ${if} $LANGUAGE == \"cancel\"\n      Abort\n    ${endif}\n  \n  !ifndef MUI_LANGDLL_ALWAYSSHOW\n  !ifdef MUI_LANGDLL_REGISTRY_VARIABLES\n    ${endif}\n  !endif\n  !endif\n\n\n  !ifdef NSIS_CONFIG_SILENT_SUPPORT\n    ${endif}\n  !endif\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_LANGDLL_SAVELANGUAGE\n\n  ;Save language in registry\n\n  !ifndef MUI_PAGE_UNINSTALLER\n\n    IfAbort mui.langdllsavelanguage_abort\n\n    !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n      WriteRegStr \"${MUI_LANGDLL_REGISTRY_ROOT}\" \"${MUI_LANGDLL_REGISTRY_KEY}\" \"${MUI_LANGDLL_REGISTRY_VALUENAME}\" $LANGUAGE\n    !endif\n\n    mui.langdllsavelanguage_abort:\n\n  !endif\n\n!macroend\n\n!macro MUI_UNGETLANGUAGE\n\n  ;Get language from registry in uninstaller\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_LANGDLL_VARIABLES\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n\n    ReadRegStr $mui.LangDLL.RegistryLanguage \"${MUI_LANGDLL_REGISTRY_ROOT}\" \"${MUI_LANGDLL_REGISTRY_KEY}\" \"${MUI_LANGDLL_REGISTRY_VALUENAME}\"\n    \n    ${if} $mui.LangDLL.RegistryLanguage = \"\"\n\n  !endif\n\n  !insertmacro MUI_LANGDLL_DISPLAY\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME\n\n    ${else}\n      StrCpy $LANGUAGE $mui.LangDLL.RegistryLanguage\n    ${endif}\n\n  !endif\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Rerserve LangDLL file\n\n!macro MUI_RESERVEFILE_LANGDLL\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ReserveFile /plugin LangDLL.dll\n\n  !verbose pop\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/MUI2.nsh",
    "content": "/*\n\nNSIS Modern User Interface - Version 2.1\nCopyright 2002-2022 Joost Verburg\nContributors: Amir Szekely, Anders Kjersem\n\n*/\n\n!ifndef MUI_INCLUDED\n!verbose push 3\n!define MUI_INCLUDED\n!define MUI_SYSVERSION \"2.1\"\n!verbose pop\n!echo \"NSIS Modern User Interface version ${MUI_SYSVERSION} - Copyright 2002-2022 Joost Verburg\"\n\n;--------------------------------\n!verbose push 3\n!define /IfNDef MUI_VERBOSE 3\n!verbose ${MUI_VERBOSE}\n\n!addincludedir \"${NSISDIR}\\Contrib\\Modern UI 2\"\n\n;--------------------------------\n;Header files required by MUI\n\n!include WinMessages.nsh\n!include LogicLib.nsh\n!include nsDialogs.nsh\n!include LangFile.nsh\n\n\n;--------------------------------\n;Macros for compile-time defines\n\n!macro MUI_DEFAULT SYMBOL CONTENT\n\n  ;Define symbol if not yet defined\n  ;For setting default values\n\n  !ifndef \"${SYMBOL}\"\n    !define \"${SYMBOL}\" \"${CONTENT}\"\n  !endif\n\n!macroend\n\n!macro MUI_SET SYMBOL CONTENT\n\n  ;Define symbol and undefine if necessary\n  \n  !insertmacro MUI_UNSET \"${SYMBOL}\"\n  !define \"${SYMBOL}\" \"${CONTENT}\"\n\n!macroend\n\n!macro MUI_UNSET SYMBOL\n\n  ;Undefine symbol if defined\n\n  !ifdef \"${SYMBOL}\"\n    !undef \"${SYMBOL}\"\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;MUI interface\n\n!include \"Deprecated.nsh\"\n!include \"Interface.nsh\"\n!include \"Localization.nsh\"\n!include \"Pages.nsh\"\n\n\n;--------------------------------\n;Pages\n\n!include \"Pages\\Components.nsh\"\n!include \"Pages\\Directory.nsh\"\n!include \"Pages\\Finish.nsh\"\n!include \"Pages\\InstallFiles.nsh\"\n!include \"Pages\\License.nsh\"\n!include \"Pages\\StartMenu.nsh\"\n!include \"Pages\\UninstallConfirm.nsh\"\n!include \"Pages\\Welcome.nsh\"\n\n\n;--------------------------------\n;Insert MUI code in script\n\n!macro MUI_INSERT\n\n  !ifndef MUI_INSERT\n    !define MUI_INSERT\n\n    ;This macro is included when the first language file is included,\n    ;after the pages.\n\n    ;Interface settings\n    !insertmacro MUI_INTERFACE\n\n    ;Interface functions - Installer\n    !insertmacro MUI_FUNCTION_GUIINIT\n    !insertmacro MUI_FUNCTION_ABORTWARNING\n\n    ;Interface functions - Uninstaller\n    !ifdef MUI_UNINSTALLER\n      !insertmacro MUI_UNFUNCTION_GUIINIT\n      !insertmacro MUI_FUNCTION_UNABORTWARNING\n    !endif\n\n  !endif\n\n!macroend\n\n!verbose pop\n!endif ;~ MUI_INCLUDED\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/Components.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nComponents page\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_COMPONENTSPAGE_INTERFACE\n\n  !ifndef MUI_COMPONENTSPAGE_INTERFACE\n    !define MUI_COMPONENTSPAGE_INTERFACE\n    Var mui.ComponentsPage\n    \n    Var mui.ComponentsPage.Text\n    Var mui.ComponentsPage.InstTypesText\n    Var mui.ComponentsPage.ComponentsText \n\n    Var mui.ComponentsPage.InstTypes\n    Var mui.ComponentsPage.Components    \n    \n    Var mui.ComponentsPage.DescriptionTitle\n    Var mui.ComponentsPage.DescriptionText.Info\n    Var mui.ComponentsPage.DescriptionText\n    \n    Var mui.ComponentsPage.SpaceRequired\n    \n    !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_CHECKBITMAP \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\"\n    \n    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_SMALLDESC \"${NSISDIR}\\Contrib\\UIs\\modern_smalldesc.exe\"\n    !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_NODESC \"${NSISDIR}\\Contrib\\UIs\\modern_nodesc.exe\"\n    \n    ;Apply settings\n    \n    !ifdef MUI_COMPONENTSPAGE_SMALLDESC\n      ChangeUI IDD_SELCOM \"${MUI_UI_COMPONENTSPAGE_SMALLDESC}\"\n    !else ifdef MUI_COMPONENTSPAGE_NODESC\n      ChangeUI IDD_SELCOM \"${MUI_UI_COMPONENTSPAGE_NODESC}\"\n    !endif\n\n    CheckBitmap \"${MUI_COMPONENTSPAGE_CHECKBITMAP}\"    \n       \n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_COMPONENTS\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}COMPONENTSPAGE \"\"\n  !insertmacro MUI_COMPONENTSPAGE_INTERFACE\n\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_TOP \"\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_COMPLIST \"\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_INSTTYPE \"\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE \"$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE)\"\n  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO \"$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO)\"\n  \n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}components\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    ComponentText \"${MUI_COMPONENTSPAGE_TEXT_TOP}\" \"${MUI_COMPONENTSPAGE_TEXT_INSTTYPE}\" \"${MUI_COMPONENTSPAGE_TEXT_COMPLIST}\"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_COMPONENTSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}\n\n  !undef MUI_COMPONENTSPAGE_TEXT_TOP\n  !undef MUI_COMPONENTSPAGE_TEXT_COMPLIST\n  !undef MUI_COMPONENTSPAGE_TEXT_INSTTYPE\n  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE\n  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO\n\n!macroend\n\n!macro MUI_PAGE_COMPONENTS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_COMPONENTS\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_COMPONENTS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_COMPONENTS\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Page functions\n\n!macro MUI_FUNCTION_COMPONENTSPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_SUBTITLE)\n  FunctionEnd\n\n  Function \"${SHOW}\"\n  \n    ;Get control handles\n    FindWindow $mui.ComponentsPage \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $mui.ComponentsPage.Text             $mui.ComponentsPage 1006\n    GetDlgItem $mui.ComponentsPage.InstTypesText    $mui.ComponentsPage 1021\n    GetDlgItem $mui.ComponentsPage.ComponentsText   $mui.ComponentsPage 1022\n    GetDlgItem $mui.ComponentsPage.InstTypes        $mui.ComponentsPage 1017\n    GetDlgItem $mui.ComponentsPage.Components       $mui.ComponentsPage 1032\n    GetDlgItem $mui.ComponentsPage.DescriptionTitle $mui.ComponentsPage 1042\n    GetDlgItem $mui.ComponentsPage.DescriptionText  $mui.ComponentsPage 1043\n    GetDlgItem $mui.ComponentsPage.SpaceRequired    $mui.ComponentsPage 1023    \n\n    ;Default text in description textbox\n    SendMessage $mui.ComponentsPage.DescriptionTitle ${WM_SETTEXT} 0 \"STR:${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE}\"\n    EnableWindow $mui.ComponentsPage.DescriptionText 0\n    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 \"STR:${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}\"\n\n    StrCpy $mui.ComponentsPage.DescriptionText.Info \"${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}\" ;Text for current components page\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n\n;--------------------------------\n;Script functions for components descriptions\n\n!macro MUI_DESCRIPTION_BEGIN\n\n  ${if} $0 == -1\n    ;No mouse hover over component in list\n    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 \"STR:\"\n    EnableWindow $mui.ComponentsPage.DescriptionText 0\n    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 \"STR:$mui.ComponentsPage.DescriptionText.Info\"\n\n!macroend\n\n!macro MUI_DESCRIPTION_TEXT VAR TEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ${elseif} $0 == ${VAR}\n    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 \"STR:\"\n    EnableWindow $mui.ComponentsPage.DescriptionText 1\n    SendMessage $mui.ComponentsPage.DescriptionText ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ${endif}\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_FUNCTION_DESCRIPTION_BEGIN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Function .onMouseOverSection\n    !insertmacro MUI_DESCRIPTION_BEGIN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_FUNCTION_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n    !insertmacro MUI_DESCRIPTION_END\n    !ifdef MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION\n      Call \"${MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION}\"\n    !endif\n  FunctionEnd\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNFUNCTION_DESCRIPTION_BEGIN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Function un.onMouseOverSection\n    !insertmacro MUI_DESCRIPTION_BEGIN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNFUNCTION_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n    !insertmacro MUI_DESCRIPTION_END\n    !ifdef MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION\n      Call \"${MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION}\"\n    !endif\n  FunctionEnd\n\n  !verbose pop\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/Directory.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nDirectory page\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_DIRECTORYPAGE_INTERFACE\n\n  !ifndef MUI_DIRECTORYPAGE_INTERFACE\n    !define MUI_DIRECTORYPAGE_INTERFACE\n    Var mui.DirectoryPage\n    \n    Var mui.DirectoryPage.Text\n    \n    Var mui.DirectoryPage.DirectoryBox\n    Var mui.DirectoryPage.Directory\n    Var mui.DirectoryPage.BrowseButton\n    \n    Var mui.DirectoryPage.SpaceRequired\n    Var mui.DirectoryPage.SpaceAvailable\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_DIRECTORY\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}DIRECTORYPAGE \"\"\n  !insertmacro MUI_DIRECTORYPAGE_INTERFACE\n\n  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_TOP \"\"\n  !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXT_DESTINATION \"\"\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}directory\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    DirText \"${MUI_DIRECTORYPAGE_TEXT_TOP}\" \"${MUI_DIRECTORYPAGE_TEXT_DESTINATION}\"\n\n    !ifdef MUI_DIRECTORYPAGE_VARIABLE\n      DirVar \"${MUI_DIRECTORYPAGE_VARIABLE}\"\n    !endif\n\n    !ifdef MUI_DIRECTORYPAGE_VERIFYONLEAVE\n      DirVerify leave\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_DIRECTORYPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}\n\n  !undef MUI_DIRECTORYPAGE_TEXT_TOP\n  !undef MUI_DIRECTORYPAGE_TEXT_DESTINATION\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VARIABLE\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VERIFYONLEAVE\n\n!macroend\n\n!macro MUI_PAGE_DIRECTORY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_DIRECTORY\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_DIRECTORY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_DIRECTORY\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Page functions\n\n!macro MUI_FUNCTION_DIRECTORYPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_SUBTITLE)\n  FunctionEnd\n\n  Function \"${SHOW}\"\n  \n    ;Get control handles\n    FindWindow $mui.DirectoryPage \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $mui.DirectoryPage.Text $mui.DirectoryPage 1006\n    GetDlgItem $mui.DirectoryPage.DirectoryBox $mui.DirectoryPage 1020\n    GetDlgItem $mui.DirectoryPage.Directory $mui.DirectoryPage 1019\n    GetDlgItem $mui.DirectoryPage.BrowseButton $mui.DirectoryPage 1001\n    GetDlgItem $mui.DirectoryPage.SpaceRequired $mui.DirectoryPage 1023\n    GetDlgItem $mui.DirectoryPage.SpaceAvailable $mui.DirectoryPage 1024\n  \n    !ifdef MUI_DIRECTORYPAGE_BGCOLOR\n      !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXTCOLOR \"\"\n      SetCtlColors $mui.DirectoryPage.Directory \"${MUI_DIRECTORYPAGE_TEXTCOLOR}\" \"${MUI_DIRECTORYPAGE_BGCOLOR}\"\n    !endif\n    \n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n  FunctionEnd\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/Finish.nsh",
    "content": " /*\n\nNSIS Modern User Interface\nFinish page (implemented using nsDialogs)\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_FINISHPAGE_INTERFACE\n\n  !ifndef MUI_FINISHPAGE_INTERFACE\n    !define MUI_FINISHPAGE_INTERFACE\n    Var mui.FinishPage\n        \n    Var mui.FinishPage.Image\n    Var mui.FinishPage.Image.Bitmap\n    \n    Var mui.FinishPage.Title\n    Var mui.FinishPage.Title.Font\n    \n    Var mui.FinishPage.Text\n  !endif\n\n  !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n    !ifndef MUI_FINISHPAGE_RETURNVALUE_VARIABLES\n      !define MUI_FINISHPAGE_RETURNVALUE_VARIABLES\n      Var mui.FinishPage.ReturnValue\n    !endif\n  !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n    !ifndef MUI_FINISHPAGE_RETURNVALUE_VARIABLES\n      !define MUI_FINISHPAGE_RETURNVALUE_VARIABLES\n      Var mui.FinishPage.ReturnValue\n    !endif \n  !endif\n    \n  !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n    !ifndef MUI_FINISHPAGE_CANCEL_ENABLED_VARIABLES\n      !define MUI_FINISHPAGE_CANCEL_ENABLED_VARIABLES\n      Var mui.FinishPage.DisableAbortWarning\n    !endif  \n  !endif\n  \n  !ifdef MUI_FINISHPAGE_RUN\n    !ifndef MUI_FINISHPAGE_RUN_VARIABLES\n      !define MUI_FINISHPAGE_RUN_VARIABLES\n      Var mui.FinishPage.Run\n    !endif\n  !endif\n  \n  !ifdef MUI_FINISHPAGE_SHOWREADME\n    !ifndef MUI_FINISHPAGE_SHOWREADME_VARIABLES\n      !define MUI_FINISHPAGE_SHOWREADME_VARIABLES\n      Var mui.FinishPage.ShowReadme\n    !endif\n  !endif\n  \n  !ifdef MUI_FINISHPAGE_LINK\n    !ifndef MUI_FINISHPAGE_LINK_VARIABLES\n      !define MUI_FINISHPAGE_LINK_VARIABLES\n      Var mui.FinishPage.Link\n    !endif\n  !endif\n  \n  !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n    !ifndef MUI_FINISHPAGE_REBOOT_VARIABLES\n      !define MUI_FINISHPAGE_REBOOT_VARIABLES\n      Var mui.FinishPage.RebootNow\n      Var mui.FinishPage.RebootLater\n    !endif\n  !endif\n\n  !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n  !if \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}\" == \"\"\n    !error \"Invalid MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP\"\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Interface initialization\n\n!macro MUI_FINISHPAGE_GUIINIT\n\n  !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_GUINIT\n    !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_GUINIT\n\n    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.GUIInit\n  \n      InitPluginsDir  \n      File \"/oname=$PLUGINSDIR\\modern-wizard.bmp\" \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}\"\n      !pragma verifyloadimage \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}\"\n    \n      !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT\n        Call \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}\"\n      !endif\n      \n      !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE_NOAUTOCLOSE\n        SetAutoClose true\n      !endif\n    \n    FunctionEnd\n  \n    !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.GUIInit\n    \n  !endif    \n\n!macroend\n\n\n;--------------------------------\n;Abort warning\n\n!macro MUI_FINISHPAGE_ABORTWARNING\n\n  !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n  \n    !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE_ABORTWARNING\n      !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE_ABORTWARNING\n\n      Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.AbortWarning\n\n        ${if} $mui.FinishPage.DisableAbortWarning == \"1\"\n          Quit\n        ${endif}\n      \n        !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_ABORTWARNING\n          Call ${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_ABORTWARNING}\n        !endif\n  \n      FunctionEnd\n    \n      !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_ABORTWARNING ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.AbortWarning\n    \n    !endif\n  \n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_FINISH\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE \"\"\n  !insertmacro MUI_FINISHPAGE_INTERFACE\n  \n  !insertmacro MUI_FINISHPAGE_GUIINIT\n  !insertmacro MUI_FINISHPAGE_ABORTWARNING\n\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TITLE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TITLE)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TEXT)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_BUTTON \"$(MUI_BUTTONTEXT_FINISH)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT_REBOOT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_REBOOT)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT_REBOOTNOW \"$(MUI_TEXT_FINISH_REBOOTNOW)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_TEXT_REBOOTLATER \"$(MUI_TEXT_FINISH_REBOOTLATER)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_RUN_TEXT \"$(MUI_TEXT_FINISH_RUN)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_SHOWREADME_TEXT \"$(MUI_TEXT_FINISH_SHOWREADME)\"\n  !insertmacro MUI_DEFAULT MUI_FINISHPAGE_LINK_COLOR \"000080\"\n\n  !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Pre_${MUI_UNIQUEID} \\\n      ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Leave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_FINISHPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Pre_${MUI_UNIQUEID} \\\n    ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Leave_${MUI_UNIQUEID} \\\n    ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPage.Link_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE_3LINES\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_LARGE\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_BUTTON\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CANCEL_ENABLED\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTNOW\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTLATER\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTLATER_DEFAULT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_TEXT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_PARAMETERS\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_NOTCHECKED\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_FUNCTION\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_TEXT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_FUNCTION\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_LOCATION\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_COLOR\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_ABORTWARNINGCHECK\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_TOP\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_BOTTOM\n\n!macroend\n\n!macro MUI_PAGE_FINISH\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_FINISH\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_FINISH\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_FINISH\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Page functions\n\n!macro MUI_FUNCTION_FINISHPAGE PRE LEAVE LINK\n\n  !ifdef MUI_FINISHPAGE_LINK\n  \n  Function \"${LINK}\"\n  \n    ExecShell open \"${MUI_FINISHPAGE_LINK_LOCATION}\"\n  \n  FunctionEnd\n  \n  !endif\n  \n  Function \"${PRE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    ;Set text on Next button\n    SendMessage $mui.Button.Next ${WM_SETTEXT} 0 \"STR:${MUI_FINISHPAGE_BUTTON}\"\n    \n    ;Enable cancel button if set in script\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      EnableWindow $mui.Button.Cancel 1\n    !endif\n    \n    ;Create dialog\n    nsDialogs::Create 1044\n    Pop $mui.FinishPage\n    nsDialogs::SetRTL $(^RTL)\n    SetCtlColors $mui.FinishPage \"\" \"${MUI_BGCOLOR}\"\n\n    ;Image control\n    ${NSD_CreateBitmap} 0u 0u 109u 100% \"\"\n    Pop $mui.FinishPage.Image\n    !insertmacro MUI_INTERNAL_FULLWINDOW_LOADWIZARDIMAGE \"${MUI_PAGE_UNINSTALLER_PREFIX}\" $mui.FinishPage.Image $PLUGINSDIR\\modern-wizard.bmp $mui.FinishPage.Image.Bitmap\n    \n    ;Positiong of controls\n\n    ;Title    \n    !ifndef MUI_FINISHPAGE_TITLE_3LINES\n      !define MUI_FINISHPAGE_TITLE_HEIGHT 28\n    !else\n      !define MUI_FINISHPAGE_TITLE_HEIGHT 38\n    !endif\n    \n    ;Text\n    ;17 = 10 (top margin) + 7 (distance between texts)\n    !define /math MUI_FINISHPAGE_TEXT_TOP 17 + ${MUI_FINISHPAGE_TITLE_HEIGHT}\n    \n    ;Height if space required for radio buttons or check boxes\n    !ifndef MUI_FINISHPAGE_TEXT_LARGE\n      !define MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS 40\n    !else\n      !define MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS 60\n    !endif\n    \n    !define /math MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS ${MUI_FINISHPAGE_TEXT_TOP} + ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}\n    \n    ;Positioning of radio buttons to ask for a reboot\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n      !define /math MUI_FINISHPAGE_REBOOTNOW_TOP ${MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS} + 5 ;Distance between text and options\n      ;25 = 10 (height of first radio button) + 15 (distance between buttons)\n      !define /math MUI_FINISHPAGE_REBOOTLATER_TOP ${MUI_FINISHPAGE_REBOOTNOW_TOP} + 25\n    !endif\n    \n    ;Positioning of checkboxes\n    !ifdef MUI_FINISHPAGE_RUN\n      !define /math MUI_FINISHPAGE_RUN_TOP ${MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS} + 5 ;Distance between text and options \n    !endif\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n      !ifdef MUI_FINISHPAGE_RUN\n        ;25 = 10 (height of run checkbox) + 10 (distance between checkboxes)\n        !define /math MUI_FINISHPAGE_SHOWREADME_TOP ${MUI_FINISHPAGE_RUN_TOP} + 20\n      !else\n        !define /math MUI_FINISHPAGE_SHOWREADME_TOP ${MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS} + 5 ;Distance between text and options    \n      !endif\n    !endif\n\n    !ifndef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n      ;Height if full space is available for text and link\n      !ifndef MUI_FINISHPAGE_LINK\n        !define MUI_FINISHPAGE_TEXT_HEIGHT 130\n      !else\n        !define MUI_FINISHPAGE_TEXT_HEIGHT 120\n      !endif\n    !endif \n    \n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      ${if} ${RebootFlag}\n\n        ;Title text\n        ${NSD_CreateLabel} 120u 10u -130u ${MUI_FINISHPAGE_TITLE_HEIGHT}u \"${MUI_FINISHPAGE_TITLE}\"\n        Pop $mui.FinishPage.Title\n        SetCtlColors $mui.FinishPage.Title \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n        CreateFont $mui.FinishPage.Title.Font \"$(^Font)\" \"12\" \"700\"\n        SendMessage $mui.FinishPage.Title ${WM_SETFONT} $mui.FinishPage.Title.Font 0\n\n        ;Finish text\n        ${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u -130u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}u \"${MUI_FINISHPAGE_TEXT_REBOOT}\"\n        Pop $mui.FinishPage.Text\n        SetCtlColors $mui.FinishPage.Text \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n      \n        ;Radio buttons for reboot page\n        ${NSD_CreateRadioButton} 120u ${MUI_FINISHPAGE_REBOOTNOW_TOP}u -130u 10u \"${MUI_FINISHPAGE_TEXT_REBOOTNOW}\"\n        Pop $mui.FinishPage.RebootNow\n        SetCtlColors $mui.FinishPage.RebootNow \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"        \n        ${NSD_CreateRadioButton} 120u ${MUI_FINISHPAGE_REBOOTLATER_TOP}u -130u 10u \"${MUI_FINISHPAGE_TEXT_REBOOTLATER}\"\n        Pop $mui.FinishPage.RebootLater\n        SetCtlColors $mui.FinishPage.RebootLater \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n        !ifndef MUI_FINISHPAGE_REBOOTLATER_DEFAULT\n          SendMessage $mui.FinishPage.RebootNow ${BM_SETCHECK} ${BST_CHECKED} 0\n        !else\n          SendMessage $mui.FinishPage.RebootLater ${BM_SETCHECK} ${BST_CHECKED} 0\n        !endif\n        ${NSD_SetFocus} $mui.FinishPage.RebootNow\n\n      ${else}\n\n    !endif\n        \n        ;Title text\n        ${NSD_CreateLabel} 120u 10u -130u ${MUI_FINISHPAGE_TITLE_HEIGHT}u \"${MUI_FINISHPAGE_TITLE}\"\n        Pop $mui.FinishPage.Title\n        SetCtlColors $mui.FinishPage.Title \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n        CreateFont $mui.FinishPage.Title.Font \"$(^Font)\" \"12\" \"700\"\n        SendMessage $mui.FinishPage.Title ${WM_SETFONT} $mui.FinishPage.Title.Font 0\n\n        ;Finish text\n        !ifndef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n          ${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u -130u ${MUI_FINISHPAGE_TEXT_HEIGHT}u \"${MUI_FINISHPAGE_TEXT}\"\n        !else\n          ${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u -130u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}u \"${MUI_FINISHPAGE_TEXT}\"\n        !endif\n        Pop $mui.FinishPage.Text\n        SetCtlColors $mui.FinishPage.Text \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n    \n        ;Checkboxes\n        !ifdef MUI_FINISHPAGE_RUN\n          ${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_RUN_TOP}u -130u 10u \"${MUI_FINISHPAGE_RUN_TEXT}\"\n          Pop $mui.FinishPage.Run\n          SetCtlColors $mui.FinishPage.Run \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n          !ifndef MUI_FINISHPAGE_RUN_NOTCHECKED\n            SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} 0\n          !endif\n          ${NSD_SetFocus} $mui.FinishPage.Run\n        !endif\n        !ifdef MUI_FINISHPAGE_SHOWREADME\n          ${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_SHOWREADME_TOP}u -130u 10u \"${MUI_FINISHPAGE_SHOWREADME_TEXT}\"\n          Pop $mui.FinishPage.ShowReadme\n          SetCtlColors $mui.FinishPage.ShowReadme \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n          !ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\n            SendMessage $mui.FinishPage.ShowReadme ${BM_SETCHECK} ${BST_CHECKED} 0\n          !endif\n          !ifndef MUI_FINISHPAGE_RUN\n            ${NSD_SetFocus} $mui.FinishPage.ShowReadme\n          !endif\n        !endif\n    \n        ;Link\n        !ifdef MUI_FINISHPAGE_LINK\n          ${NSD_CreateLink} 120u 175u -130u 10u \"${MUI_FINISHPAGE_LINK}\"\n          Pop $mui.FinishPage.Link\n          SetCtlColors $mui.FinishPage.Link \"${MUI_FINISHPAGE_LINK_COLOR}\" \"${MUI_BGCOLOR}\"\n          ${NSD_OnClick} $mui.FinishPage.Link \"${LINK}\"\n        !endif\n        \n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT        \n      ${endif}\n    !endif\n\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      StrCpy $mui.FinishPage.DisableAbortWarning \"1\"\n    !endif\n\n    !ifndef MUI_FORCECLASSICCONTROLS\n    ${If} ${IsHighContrastModeActive}\n    !endif\n      ; SetCtlColors does not change the check/radio text color (bug #443)\n      !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n        System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.RebootNow,w\" \",w\" \")'\n        System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.RebootLater,w\" \",w\" \")'\n      !endif\n      !ifdef MUI_FINISHPAGE_RUN\n        System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.Run,w\" \",w\" \")'\n      !endif\n      !ifdef MUI_FINISHPAGE_SHOWREADME\n        System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.ShowReadme,w\" \",w\" \")'\n      !endif\n    !ifndef MUI_FORCECLASSICCONTROLS\n    ${EndIf}\n    !endif\n\n    ;Show page\n    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n    nsDialogs::Show\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED\n    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow \n    \n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      StrCpy $mui.FinishPage.DisableAbortWarning \"\"\n    !endif\n    \n    ;Delete image from memory\n    ${NSD_FreeImage} $mui.FinishPage.Image.Bitmap\n    \n    !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE_HEIGHT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_TOP\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_HEIGHT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_BOTTOM_BUTTONS\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTNOW_TOP\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTLATER_TOP\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_TOP\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_TOP\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      ;Check whether the user has chosen to reboot the computer\n      ${if} ${RebootFlag}\n        SendMessage $mui.FinishPage.RebootNow ${BM_GETCHECK} 0 0 $mui.FinishPage.ReturnValue\n        ${if} $mui.FinishPage.ReturnValue = ${BST_CHECKED}\n          Reboot\n        ${else}\n          Return\n        ${endif}\n      ${endif}\n\n    !endif\n\n    ;Run functions depending on checkbox state \n\n    !ifdef MUI_FINISHPAGE_RUN\n    \n      SendMessage $mui.FinishPage.Run ${BM_GETCHECK} 0 0 $mui.FinishPage.ReturnValue\n\n      ${if} $mui.FinishPage.ReturnValue = ${BST_CHECKED}\n        !ifndef MUI_FINISHPAGE_RUN_FUNCTION\n          !ifndef MUI_FINISHPAGE_RUN_PARAMETERS\n            Exec \"$\\\"${MUI_FINISHPAGE_RUN}$\\\"\"\n          !else\n            Exec \"$\\\"${MUI_FINISHPAGE_RUN}$\\\" ${MUI_FINISHPAGE_RUN_PARAMETERS}\"\n          !endif\n        !else\n          Call \"${MUI_FINISHPAGE_RUN_FUNCTION}\"\n        !endif\n      ${endif}\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n\n      SendMessage $mui.FinishPage.ShowReadme ${BM_GETCHECK} 0 0 $mui.FinishPage.ReturnValue\n\n      ${if} $mui.FinishPage.ReturnValue = ${BST_CHECKED}\n        !ifndef MUI_FINISHPAGE_SHOWREADME_FUNCTION\n          ExecShell open \"${MUI_FINISHPAGE_SHOWREADME}\"\n        !else\n          Call \"${MUI_FINISHPAGE_SHOWREADME_FUNCTION}\"\n        !endif\n      ${endif}\n\n    !endif\n\n  FunctionEnd\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/InstallFiles.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nInstallFiles page\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_INSTFILESPAGE_INTERFACE\n\n  !ifndef MUI_INSTFILESYPAGE_INTERFACE\n    !define MUI_INSTFILESYPAGE_INTERFACE\n    \n    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_COLORS \"/windows\"\n    !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_PROGRESSBAR \"smooth\"    \n    \n    Var mui.InstFilesPage\n    \n    Var mui.InstFilesPage.Text\n    Var mui.InstFilesPage.ProgressBar\n    Var mui.InstFilesPage.ShowLogButton\n    Var mui.InstFilesPage.Log\n    \n    ;Apply settings\n    InstallColors ${MUI_INSTFILESPAGE_COLORS}\n    InstProgressFlags ${MUI_INSTFILESPAGE_PROGRESSBAR}\n    SubCaption 4 \" \"\n    UninstallSubCaption 2 \" \"   \n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_INSTFILES\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTFILESPAGE \"\"\n  !insertmacro MUI_INSTFILESPAGE_INTERFACE\n  \n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}instfiles\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_INSTFILESPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_TEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_TEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_SUBTEXT\n\n!macroend\n\n!macro MUI_PAGE_INSTFILES\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_INSTFILES\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_INSTFILES\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_INSTFILES\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Page functions\n\n!macro MUI_FUNCTION_INSTFILESPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_SUBTITLE)\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    ;Get controls handles\n    FindWindow $mui.InstFilesPage \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $mui.InstFilesPage.Text $mui.InstFilesPage 1006\n    GetDlgItem $mui.InstFilesPage.ProgressBar $mui.InstFilesPage 1004\n    GetDlgItem $mui.InstFilesPage.ShowLogButton $mui.InstFilesPage 1027    \n    GetDlgItem $mui.InstFilesPage.Log $mui.InstFilesPage 1016\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    ;Set text on completed page header\n\n    IfAbort mui.endheader_abort\n\n      !ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT & MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n        !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}\" \"${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}\"\n      !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT\n        !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)\"\n      !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n        !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)\" \"${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}\"\n      !else\n        !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)\"\n      !endif\n\n    Goto mui.endheader_done\n\n    mui.endheader_abort:\n\n      !ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT & MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT\n        !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}\" \"${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}\"\n      !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT\n        !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)\"\n      !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT\n        !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)\" \"${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}\"\n      !else\n        !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)\"\n      !endif\n\n    mui.endheader_done:\n\n      !insertmacro MUI_LANGDLL_SAVELANGUAGE\n\n  FunctionEnd\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/License.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nLicense page\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_LICENSEPAGE_INTERFACE\n\n  !ifndef MUI_LICENSEPAGE_INTERFACE\n    !define MUI_LICENSEPAGE_INTERFACE\n    Var mui.LicensePage\n    \n    Var mui.Licensepage.TopText\n    Var mui.Licensepage.Text\n    Var mui.Licensepage.LicenseText\n    \n    !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BGCOLOR \"/windows\"\n    \n    ;Apply settings\n    LicenseBkColor \"${MUI_LICENSEPAGE_BGCOLOR}\"\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_LICENSE LICENSEDATA\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}LICENSEPAGE \"\"\n  !insertmacro MUI_LICENSEPAGE_INTERFACE  \n\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_TEXT_TOP \"$(MUI_INNERTEXT_LICENSE_TOP)\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BUTTON \"\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_CHECKBOX_TEXT \"\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT \"\"\n  !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE \"\"\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}license\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    LicenseData \"${LICENSEDATA}\"\n\n    !ifndef MUI_LICENSEPAGE_TEXT_BOTTOM\n      !ifndef MUI_LICENSEPAGE_CHECKBOX & MUI_LICENSEPAGE_RADIOBUTTONS\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !else ifdef MUI_LICENSEPAGE_CHECKBOX\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_CHECKBOX)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !else\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !endif\n    !else\n      LicenseText \"${MUI_LICENSEPAGE_TEXT_BOTTOM}\" \"${MUI_LICENSEPAGE_BUTTON}\"\n    !endif\n\n    !ifdef MUI_LICENSEPAGE_CHECKBOX\n      LicenseForceSelection checkbox \"${MUI_LICENSEPAGE_CHECKBOX_TEXT}\"\n    !else ifdef MUI_LICENSEPAGE_RADIOBUTTONS\n      LicenseForceSelection radiobuttons \"${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT}\" \"${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE}\"\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_LICENSEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_TOP\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_BOTTOM\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_BUTTON\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_RADIOBUTTONS\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_ACCEPT\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_DECLINE\n\n!macroend\n\n!macro MUI_PAGE_LICENSE LICENSEDATA\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_LICENSE \"${LICENSEDATA}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_LICENSE LICENSEDATA\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_LICENSE \"${LICENSEDATA}\"\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Page functions\n\n!macro MUI_FUNCTION_LICENSEPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_SUBTITLE)\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    ;Get control handles\n    FindWindow $mui.LicensePage \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $mui.LicensePage.TopText $mui.LicensePage 1040\n    GetDlgItem $mui.LicensePage.Text $mui.LicensePage 1006\n    GetDlgItem $mui.LicensePage.LicenseText $mui.LicensePage 1000\n    \n    ;Top text\n    SendMessage $mui.LicensePage.TopText ${WM_SETTEXT} 0 \"STR:${MUI_LICENSEPAGE_TEXT_TOP}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/StartMenu.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nStart Menu folder page\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_STARTMENUPAGE_INTERFACE\n\n  !ifndef MUI_STARTMENUPAGE_INTERFACE\n    !define MUI_STARTMENUPAGE_INTERFACE\n    Var mui.StartMenuPage\n    Var mui.StartMenuPage.Location\n    Var mui.StartMenuPage.FolderList\n\n    Var mui.StartMenuPage.Temp\n  !endif\n\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY & MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n    !ifndef MUI_STARTMENUPAGE_REGISTRY_VARIABLES\n      !define MUI_STARTMENUPAGE_REGISTRY_VARIABLES\n        Var mui.StartMenuPage.RegistryLocation\n    !endif\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_STARTMENU ID VAR\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}STARTMENUPAGE \"\"\n  !insertmacro MUI_STARTMENUPAGE_INTERFACE  \n\n  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_DEFAULTFOLDER \"$(^Name)\"\n  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_TOP \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_TOP)\"\n  !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_CHECKBOX \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_CHECKBOX)\"\n\n  !define MUI_STARTMENUPAGE_VARIABLE \"${VAR}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_VARIABLE\" \"${MUI_STARTMENUPAGE_VARIABLE}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT\" \"${MUI_STARTMENUPAGE_REGISTRY_ROOT}\"\n  !endif\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_KEY\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY\" \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\"\n  !endif\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_STARTMENUPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}\n\n  !undef MUI_STARTMENUPAGE_VARIABLE\n  !undef MUI_STARTMENUPAGE_TEXT_TOP\n  !undef MUI_STARTMENUPAGE_TEXT_CHECKBOX\n  !undef MUI_STARTMENUPAGE_DEFAULTFOLDER\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_NODISABLE\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_ROOT\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_KEY\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n\n!macroend\n\n!macro MUI_PAGE_STARTMENU ID VAR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_STARTMENU \"${ID}\" \"${VAR}\"\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;Page functions\n\n!macro MUI_FUNCTION_STARTMENUPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY & MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n      \n      ;Get Start Menu location from registry\n\n      ${if} \"${MUI_STARTMENUPAGE_VARIABLE}\" == \"\"\n\n        ReadRegStr $mui.StartMenuPage.RegistryLocation  \"${MUI_STARTMENUPAGE_REGISTRY_ROOT}\" \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n        ${if} $mui.StartMenuPage.RegistryLocation != \"\"\n          StrCpy \"${MUI_STARTMENUPAGE_VARIABLE}\" $mui.StartMenuPage.RegistryLocation\n        ${endif}\n\n        ClearErrors\n\n      ${endif}\n\n    !endif\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)\n\n    ${if} $(^RTL) == \"0\"\n       !ifndef MUI_STARTMENUPAGE_NODISABLE\n        StartMenu::Init /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" /checknoshortcuts \"${MUI_STARTMENUPAGE_TEXT_CHECKBOX}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !else\n        StartMenu::Init /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !endif\n    ${else}\n      !ifndef MUI_STARTMENUPAGE_NODISABLE\n        StartMenu::Init /rtl /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" /checknoshortcuts \"${MUI_STARTMENUPAGE_TEXT_CHECKBOX}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !else\n        StartMenu::Init /rtl /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !endif\n    ${endif}\n\n    Pop $mui.StartMenuPage\n\n    ;Get control handles\n    GetDlgItem $mui.StartMenuPage.Location $mui.StartMenuPage 1002\n    GetDlgItem $mui.StartMenuPage.FolderList $mui.StartMenuPage 1004\n\n    !ifdef MUI_STARTMENUPAGE_BGCOLOR\n      !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXTCOLOR \"\"\n      SetCtlColors $mui.StartMenuPage.Location \"${MUI_STARTMENUPAGE_TEXTCOLOR}\" \"${MUI_STARTMENUPAGE_BGCOLOR}\"\n      SetCtlColors $mui.StartMenuMenu.FolderList \"${MUI_STARTMENUPAGE_TEXTCOLOR}\" \"${MUI_STARTMENUPAGE_BGCOLOR}\"\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n    StartMenu::Show\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED\n\n    Pop $mui.StartMenuPage.Temp\n    ${if} $mui.StartMenuPage.Temp ==  \"success\"\n      Pop \"${MUI_STARTMENUPAGE_VARIABLE}\"\n    ${endif}\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n\n;--------------------------------\n;Script macros to get Start Menu folder\n\n!macro MUI_STARTMENU_GETFOLDER ID VAR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ;Get Start Menu folder from registry\n  ;Can be called from the script in the uninstaller\n\n  !ifdef MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME\n\n    ReadRegStr $mui.StartMenuPage.RegistryLocation \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT}\" \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME}\"\n    \n    ${if} $mui.StartMenuPage.RegistryLocation != \"\"\n      StrCpy \"${VAR}\" $mui.StartMenuPage.RegistryLocation\n    ${else}\n      StrCpy \"${VAR}\" \"${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}\"\n    ${endif}\n\n  !else\n\n    StrCpy \"${VAR}\" \"${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}\"\n\n  !endif\n   \n  !verbose pop   \n\n!macroend\n\n!macro MUI_STARTMENU_WRITE_BEGIN ID\n\n  ;The code in the script to write the shortcuts should be put between the\n  ;MUI_STARTMENU_WRITE_BEGIN and MUI_STARTMENU_WRITE_END macros\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !define MUI_STARTMENUPAGE_CURRENT_ID \"${ID}\"\n\n  StrCpy $mui.StartMenuPage.Temp \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\" 1\n  \n  ;If the folder start with >, the user has chosen not to create a shortcut\n  ${if} $mui.StartMenuPage.Temp != \">\"\n\n    ${if} \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\" == \"\"\n      ;Get folder from registry if the variable doesn't contain anything\n      !insertmacro MUI_STARTMENU_GETFOLDER \"${MUI_STARTMENUPAGE_CURRENT_ID}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\"\n    ${endif}\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_STARTMENU_WRITE_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n    !ifdef MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY & MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME\n      ;Write folder to registry\n      WriteRegStr \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_ROOT}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_REGISTRY_VALUENAME}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\"\n    !endif\n\n  ${endif}\n\n  !undef MUI_STARTMENUPAGE_CURRENT_ID\n\n  !verbose pop\n\n!macroend\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nUninstall confirmation page\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_UNCONFIRMPAGE_INTERFACE\n\n  !ifndef MUI_UNCONFIRMPAGE_INTERFACE\n    !define MUI_UNCONFIRMPAGE_INTERFACE\n    Var mui.UnConfirmPage\n    \n    Var mui.UnConfirmPage.Text\n    Var mui.UnConfirmPage.DirectoryText\n    Var mui.UnConfirmPage.Directory    \n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_CONFIRM\n\n  !insertmacro MUI_SET MUI_UNCONFIRMPAGE \"\"\n  !insertmacro MUI_UNCONFIRMPAGE_INTERFACE  \n\n  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_TOP \"\"\n  !insertmacro MUI_DEFAULT MUI_UNCONFIRMPAGE_TEXT_LOCATION \"\"\n\n  PageEx un.uninstConfirm\n\n    PageCallbacks un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    UninstallText \"${MUI_UNCONFIRMPAGE_TEXT_TOP}\" \"${MUI_UNCONFIRMPAGE_TEXT_LOCATION}\"\n\n    !ifdef MUI_UNCONFIRMPAGE_VARIABLE\n      DirVar \"${MUI_UNCONFIRMPAGE_VARIABLE}\"\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_UNFUNCTION_CONFIRMPAGE un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_TOP\n  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_LOCATION\n\n!macroend\n\n!macro MUI_UNPAGE_CONFIRM\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_CONFIRM\n  \n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Page functions\n\n!macro MUI_UNFUNCTION_CONFIRMPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n   !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n   !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_UNTEXT_CONFIRM_TITLE) $(MUI_UNTEXT_CONFIRM_SUBTITLE)\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    ;Get controls handles\n    FindWindow $mui.UnConfirmPage \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $mui.UnConfirmPage.Text $mui.UnConfirmPage 1006\n    GetDlgItem $mui.UnConfirmPage.DirectoryText $mui.UnConfirmPage 1029\n    GetDlgItem $mui.UnConfirmPage.Directory $mui.UnConfirmPage 1000\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages/Welcome.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nWelcome page (implemented using nsDialogs)\n\n*/\n\n;--------------------------------\n;Page interface settings and variables\n\n!macro MUI_WELCOMEPAGE_INTERFACE\n\n  !ifndef MUI_WELCOMEPAGE_INTERFACE\n    !define MUI_WELCOMEPAGE_INTERFACE\n    Var mui.WelcomePage\n        \n    Var mui.WelcomePage.Image\n    Var mui.WelcomePage.Image.Bitmap\n    \n    Var mui.WelcomePage.Title\n    Var mui.WelcomePage.Title.Font\n    \n    Var mui.WelcomePage.Text\n  !endif\n  \n  !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n  !if \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}\" == \"\"\n    !error \"Invalid MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP\"\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Interface initialization\n\n!macro MUI_WELCOMEPAGE_GUIINIT\n\n  !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEWELCOMEPAGE_GUINIT\n    !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEWELCOMEPAGE_GUINIT\n\n    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePage.GUIInit\n      \n      InitPluginsDir\n      File \"/oname=$PLUGINSDIR\\modern-wizard.bmp\" \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}\"\n      !pragma verifyloadimage \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}\"\n    \n      !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT\n        Call \"${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}\"\n      !endif   \n    \n    FunctionEnd\n  \n    !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePage.GUIInit\n\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Page declaration\n\n!macro MUI_PAGEDECLARATION_WELCOME\n\n  !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEPAGE \"\"\n  !insertmacro MUI_WELCOMEPAGE_INTERFACE\n  \n  !insertmacro MUI_WELCOMEPAGE_GUIINIT\n\n  !insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TITLE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE)\"\n  !insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT)\"\n  \n  !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_WELCOMEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT\n\n!macroend\n\n!macro MUI_PAGE_WELCOME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_WELCOME\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_WELCOME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n  !insertmacro MUI_PAGEDECLARATION_WELCOME\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Page functions\n\n!macro MUI_FUNCTION_WELCOMEPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n  \n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE  \n\n    ;Create dialog\n    nsDialogs::Create 1044\n    Pop $mui.WelcomePage\n    nsDialogs::SetRTL $(^RTL)\n    SetCtlColors $mui.WelcomePage \"\" \"${MUI_BGCOLOR}\"    \n\n    ;Image control\n    ${NSD_CreateBitmap} 0u 0u 109u 100% \"\"\n    Pop $mui.WelcomePage.Image\n    !insertmacro MUI_INTERNAL_FULLWINDOW_LOADWIZARDIMAGE \"${MUI_PAGE_UNINSTALLER_PREFIX}\" $mui.WelcomePage.Image $PLUGINSDIR\\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap\n\n    ;Positiong of controls\n\n    ;Title    \n    !ifndef MUI_WELCOMEPAGE_TITLE_3LINES\n      !define MUI_WELCOMEPAGE_TITLE_HEIGHT 28\n    !else\n      !define MUI_WELCOMEPAGE_TITLE_HEIGHT 38\n    !endif\n    \n    ;Text\n    ;17 = 10 (top margin) + 7 (distance between texts)\n    !define /math MUI_WELCOMEPAGE_TEXT_TOP 17 + ${MUI_WELCOMEPAGE_TITLE_HEIGHT}\n\n    ;Title\n    ${NSD_CreateLabel} 120u 10u -130u ${MUI_WELCOMEPAGE_TITLE_HEIGHT}u \"${MUI_WELCOMEPAGE_TITLE}\"\n    Pop $mui.WelcomePage.Title\n    SetCtlColors $mui.WelcomePage.Title \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"    \n    CreateFont $mui.WelcomePage.Title.Font \"$(^Font)\" \"12\" \"700\"\n    SendMessage $mui.WelcomePage.Title ${WM_SETFONT} $mui.WelcomePage.Title.Font 0\n\n    ;Welcome text\n    ${NSD_CreateLabel} 120u ${MUI_WELCOMEPAGE_TEXT_TOP}u -130u 130u \"${MUI_WELCOMEPAGE_TEXT}\"\n    Pop $mui.WelcomePage.Text\n    SetCtlColors $mui.WelcomePage.Text \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n    ;Show page\n    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n    nsDialogs::Show\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED\n    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow    \n\n    ;Delete image from memory\n    ${NSD_FreeImage} $mui.WelcomePage.Image.Bitmap\n\n    !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_HEIGHT\n    !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT_TOP\n    \n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/Modern UI 2/Pages.nsh",
    "content": "/*\n\nNSIS Modern User Interface\nSupport code for all pages\n\n*/\n\n;--------------------------------\n;Page initialization\n\n!macro MUI_PAGE_INIT\n\n  !ifdef MUI_INSERT\n    !warning \"MUI_PAGE_* inserted after MUI_LANGUAGE\"\n  !endif\n\n  ;Include interface settings if necessary\n  !insertmacro MUI_INTERFACE\n\n  ;Define settings for installer page\n  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER\n  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_PREFIX\n  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_FUNCPREFIX\n  \n  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_PREFIX \"\"\n  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_FUNCPREFIX \"\"\n\n  ;Generate unique ID\n  !insertmacro MUI_UNSET MUI_UNIQUEID\n  !define MUI_UNIQUEID ${__LINE__}\n\n!macroend\n\n!macro MUI_UNPAGE_INIT\n\n  !ifdef MUI_INSERT\n    !warning \"MUI_UNPAGE_* inserted after MUI_LANGUAGE\"\n  !endif\n\n  ;Include interface settings\n  !insertmacro MUI_INTERFACE\n\n  ;Define prefixes for uninstaller page\n  !insertmacro MUI_SET MUI_UNINSTALLER \"\"\n  \n  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER \"\"\n  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_PREFIX \"UN\"\n  !insertmacro MUI_SET MUI_PAGE_UNINSTALLER_FUNCPREFIX \"un.\"\n  \n  ;Generate unique ID\n  !insertmacro MUI_UNSET MUI_UNIQUEID\n  !define MUI_UNIQUEID ${__LINE__}\n\n!macroend\n\n\n;--------------------------------\n;Header text for standard MUI page\n\n!macro MUI_HEADER_TEXT_PAGE TEXT SUBTEXT\n\n  !ifdef MUI_PAGE_HEADER_TEXT & MUI_PAGE_HEADER_SUBTEXT\n    !insertmacro MUI_HEADER_TEXT \"${MUI_PAGE_HEADER_TEXT}\" \"${MUI_PAGE_HEADER_SUBTEXT}\"\n  !else ifdef MUI_PAGE_HEADER_TEXT\n    !insertmacro MUI_HEADER_TEXT \"${MUI_PAGE_HEADER_TEXT}\" \"${SUBTEXT}\"\n  !else ifdef MUI_PAGE_HEADER_SUBTEXT\n    !insertmacro MUI_HEADER_TEXT \"${TEXT}\" \"${MUI_PAGE_HEADER_SUBTEXT}\"\n  !else\n    !insertmacro MUI_HEADER_TEXT \"${TEXT}\" \"${SUBTEXT}\"\n  !endif\n\n  !insertmacro MUI_UNSET MUI_PAGE_HEADER_TEXT\n  !insertmacro MUI_UNSET MUI_PAGE_HEADER_SUBTEXT\n\n!macroend\n\n\n;--------------------------------\n;Header text for custom page\n\n!macro MUI_HEADER_TEXT TEXT SUBTEXT ;Called from script\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n    LockWindow on\n  !endif\n\n  SendMessage $mui.Header.Text ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n  SendMessage $mui.Header.SubText ${WM_SETTEXT} 0 \"STR:${SUBTEXT}\"\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n    LockWindow off\n  !endif\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;Custom page functions\n\n!macro MUI_PAGE_FUNCTION_CUSTOM TYPE\n\n  !ifdef MUI_PAGE_CUSTOMFUNCTION_${TYPE}\n    Call \"${MUI_PAGE_CUSTOMFUNCTION_${TYPE}}\"\n    !undef MUI_PAGE_CUSTOMFUNCTION_${TYPE}\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Support for full window pages (like welcome/finish page)\n\n!macro MUI_PAGE_FUNCTION_FULLWINDOW\n\n  !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_FULLWINDOW\n    !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_FULLWINDOW\n\n    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow\n    \n      LockWindow on\n      \n      ;The branding text needs to be hidden because the full windows page\n      ;overlaps with it.\n      ShowWindow $mui.Branding.Background ${SW_HIDE}\n      ShowWindow $mui.Branding.Text ${SW_HIDE}      \n      \n      ;The texts need to be hidden because otherwise they may show through\n      ;the page above when the Alt key is pressed.\n      ShowWindow $mui.Header.Text ${SW_HIDE}\n      ShowWindow $mui.Header.SubText ${SW_HIDE}\n      ShowWindow $mui.Header.Image ${SW_HIDE}\n\n      ;Show line below full width of page\n      ShowWindow $mui.Line.Standard ${SW_HIDE}\n      ShowWindow $mui.Line.FullWindow ${SW_NORMAL}\n      \n      LockWindow off\n      \n    FunctionEnd\n    \n    Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow\n    \n      ;Set everything back to normal again\n    \n      LockWindow on\n      \n      ShowWindow $mui.Branding.Background ${SW_NORMAL}\n      ShowWindow $mui.Branding.Text ${SW_NORMAL}\n      \n      ShowWindow $mui.Header.Text ${SW_NORMAL}\n      ShowWindow $mui.Header.SubText ${SW_NORMAL}\n      ShowWindow $mui.Header.Image ${SW_NORMAL}\n      \n      ShowWindow $mui.Line.Standard ${SW_NORMAL}\n      ShowWindow $mui.Line.FullWindow ${SW_HIDE}\n      \n      LockWindow off\n      \n    FunctionEnd    \n    \n  !endif\n\n!macroend\n\n!macro MUI_INTERNAL_FULLWINDOW_LOADWIZARDIMAGE _un _hwndImg _ImgPath _RetImgHandle\n\n  !ifdef MUI_${_un}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH\n    !insertmacro MUI_DEFAULT MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH NoStretchNoCropNoAlign ; Legacy compatibility\n  !endif\n  !insertmacro MUI_DEFAULT MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH FitControl\n\n  !if \"${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}\" == \"NoStretchNoCropNoAlign\"\n\n    ${NSD_SetImage} ${_hwndImg} \"${_ImgPath}\" \"${_RetImgHandle}\"\n\n  !else if \"${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}\" == \"NoStretchNoCrop\"\n\n    !insertmacro MUI_LOADANDXALIGNIMAGE ${_hwndImg} \"${_ImgPath}\" Auto \"${_RetImgHandle}\"\n\n  !else if \"${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}\" == \"AspectFitHeight\"\n\n    !insertmacro MUI_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT ${_hwndImg} \"${_ImgPath}\" Auto \"${_RetImgHandle}\"\n\n  !else\n\n    !if \"${MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH}\" != \"FitControl\"\n      !warning 'MUI_${_un}WELCOMEFINISHPAGE_BITMAP_STRETCH set to unknown value, defaulting to FitControl'\n    !endif\n    ${NSD_SetStretchedImage} ${_hwndImg} \"${_ImgPath}\" \"${_RetImgHandle}\"\n\n  !endif\n\n!macroend\n\n\n;--------------------------------\n;Helper macros\n\n!include Util.nsh\n\n!macro MUI_INTERNAL_LOADANDSIZEIMAGE _macro _hwndImg _ImgPath _XAlign _RetImgHandle\n  !if \"${_XAlign}\" == \"Auto\"\n    ${if} $(^RTL) == 1\n      Push \"*${_ImgPath}\"\n    ${Else}\n      Push \"${_ImgPath}\"\n    ${EndIf}\n  !else if \"${_XAlign}\" == \"Right\"\n    Push \"*${_ImgPath}\"\n  !else\n    Push \"${_ImgPath}\"\n  !endif\n  Push \"${_hwndImg}\"\n  ${CallArtificialFunction} ${_macro}\n  !if \"${_RetImgHandle}\" == \"Leak\"\n    !insertmacro _LOGICLIB_TEMP\n    Pop $_LOGICLIB_TEMP\n  !else if \"${_RetImgHandle}\" != \"Stack\"\n    Pop ${_RetImgHandle}\n  !endif\n!macroend\n\n!macro MUI_LOADANDXALIGNIMAGE _hwndImg _ImgPath _XAlign _RetImgHandle\n!insertmacro MUI_INTERNAL_LOADANDSIZEIMAGE \\\n  MUI_INTERNAL_LOADANDXALIGNIMAGE \"${_hwndImg}\" \"${_ImgPath}\" \"${_XAlign}\" \"${_RetImgHandle}\"\n!macroend\n!macro MUI_INTERNAL_LOADANDXALIGNIMAGE\n  System::Store \"S\"\n  System::Call 'USER32::GetWindowRect(psr0,@r1)'\n  System::Call 'USER32::MapWindowPoints(p0,p$hwndparent,pr1,i2)' ; Note: Assuming control is not in inner dialog\n  System::Call '*$1(i.r5,i.r6,i.r7,i.r8)'\n  IntOp $7 $7 - $5\n  IntOp $8 $8 - $6\n\n  Pop $1\n  StrCpy $3 $1 1\n  ${If} $3 == \"*\" ; Move control to the right?\n    StrCpy $1 $1 \"\" 1\n  ${Endif}\n  System::Call 'USER32::LoadImage(p0,tr1,i${IMAGE_BITMAP},i0,i0,i${LR_LOADFROMFILE})p.r2'\n  SendMessage $0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $2 $1\n  Push $2 ; Return value\n  System::Call 'GDI32::DeleteObject(pr1)' ; Note: Assuming the previous image (if any) was a bitmap\n  System::Call 'USER32::GetClientRect(pr0,@r1)'\n  System::Call '*$1(i,i,i.r1,i.r2)'\n\n  ${If} $3 == \"*\"\n  ${AndIf} $1 < $7 ; ImgW < CtlW\n    IntOp $3 $7 - $1\n    IntOp $5 $5 + $3\n    System::Call 'USER32::SetWindowPos(pr0,p0,ir5,ir6,i,i,i0x15)'\n  ${EndIf}\n\n  System::Store \"L\"\n!macroend\n\n!macro MUI_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT _hwndImg _ImgPath _XAlign _RetImgHandle\n!insertmacro MUI_INTERNAL_LOADANDSIZEIMAGE \\\n  MUI_INTERNAL_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT \"${_hwndImg}\" \"${_ImgPath}\" \"${_XAlign}\" \"${_RetImgHandle}\"\n!macroend\n!macro MUI_INTERNAL_LOADANDASPECTSTRETCHIMAGETOCONTROLHEIGHT\n  System::Store \"S\"\n  System::Call 'USER32::GetWindowRect(psr0,@r1)'\n  System::Call 'USER32::MapWindowPoints(p0,p$hwndparent,pr1,i2)' ; Note: Assuming control is not in inner dialog\n  System::Call '*$1(i.r5,i.r6,i.r7,i.r8)'\n  IntOp $7 $7 - $5\n  IntOp $8 $8 - $6\n\n  Pop $1\n  StrCpy $3 $1 1\n  ${If} $3 == \"*\" ; Move control to the right?\n    StrCpy $1 $1 \"\" 1\n  ${Endif}\n  System::Call 'USER32::LoadImage(p0,tr1,i${IMAGE_BITMAP},i0,i0,i${LR_LOADFROMFILE})p.r2'\n  SendMessage $0 ${STM_SETIMAGE} ${IMAGE_BITMAP} $2 $1\n  Push $2 ; Return value\n  System::Call 'GDI32::DeleteObject(pr1)' ; Note: Assuming the previous image (if any) was a bitmap\n  System::Call 'USER32::GetClientRect(pr0,@r1)'\n  System::Call '*$1(i,i,i.r1,i.r2)'\n\n  IntOp $R7 $7 * 10000\n  IntOp $R8 $8 * 10000\n  IntOp $R1 $1 * 10000\n  IntOp $R2 $2 * 10000\n  IntOp $R3 $R1 / $2\n  StrCpy $R4 10000\n  ${If} $R1 > $R2\n    StrCpy $R3 10000\n    IntOp $R4 $R2 / $1\n  ${EndIf}\n\n  ${DoWhile} $R2 > $R8 ; ImgH > CtlH\n    IntOp $R1 $R1 - $R3\n    IntOp $R2 $R2 - $R4\n  ${Loop}\n  ${DoWhile} $R2 < $R8 ; ImgH < CtlH\n    IntOp $R1 $R1 + $R3\n    IntOp $R2 $R2 + $R4\n  ${Loop}\n  IntOp $1 $R1 / 10000\n  IntOp $2 $R2 / 10000\n\n  ${If} $1 < $7\n  ${AndIf} $3 == \"*\"\n    IntOp $R3 $7 - $1\n    IntOp $5 $5 + $R3\n  ${EndIf}\n\n  ${DoWhile} $2 > $8 ; Non-aspect-maintained stretch to make it a pixel perfect match\n    IntOp $2 $2 - 1\n    IntOp $1 $1 - 1\n    ${IfThen} $3 == \"*\" ${|} IntOp $5 $5 + 1 ${|}\n  ${Loop}\n\n  System::Call 'USER32::SetWindowPos(pr0,p0,ir5,ir6,ir1,ir2,i0x14)'\n  System::Store \"L\"\n!macroend\n\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/SkinnedControls.c",
    "content": "/*\no--------------------------------------------------------------------------o\n|SkinnedControls 1.4                                                       |\n|Based on wansis, a Plug-in written by Saivert that skins NSIS like Winamp.|\n(--------------------------------------------------------------------------)\n| Main source code.                           / A plug-in for NSIS 2 and 3 |\n|                                            ------------------------------|\n| By SuperPat                                                              |\no--------------------------------------------------------------------------o\n*/\n\n#include \"SkinnedControls.h\"\n\n//Implementation\nvoid main(){}\n// makes a smaller DLL file\nBOOL WINAPI _DllMainCRTStartup(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)\n{\n\tg_hInstance = hModule;\n\treturn 1;\n}\n\nBOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)\n{\n\tg_hInstance = hInst;\n\treturn TRUE;\n}\n\n// This is really a window procedure\nLRESULT CALLBACK ChildDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n\tWNDPROC proc;\n\tLRESULT a, dlgresult;\n\n\tproc = (WNDPROC)(UIntToPtr(GetWindowLongPtr(hwnd, DWLP_USER)));\n\tdlgresult = CallWindowProc(proc, hwnd, uMsg, wParam, lParam);\n\n\tif (g_hbmb)\n\t{\n\t\tif (wascrollbars_handleMessages(hwnd, uMsg, wParam, lParam, &a))\n\t\t\treturn a;\n\t}\n\n\tif (g_hbma)\n\t{\n\t\tif (a = WADlg_handleDialogMsgs(hwnd, uMsg, wParam, lParam))\n\t\t{\n\t\t\tSetWindowLong(hwnd, DWL_MSGRESULT, (LONG)a);\n\t\t\treturn a;\n\t\t}\n\n\t\t/* fix for buttons unskinning itself after click under control */\n\t\tif (uMsg == WM_COMMAND) {\n\t\t\tFixMainControls();\n\t\t}\n\t}\n\n\treturn dlgresult;\n}\n\nLRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n\tif (g_hbma)\n\t{\n\t\tLRESULT a = WADlg_handleDialogMsgs(hwnd, uMsg, wParam, lParam);\n\t\tif (a)\n\t\t\treturn a;\n\t}\n\t// Little hack for proper redrawing buttons when MessageBox is shown\n\t// Use SendMessage $HWNDPARENT ${WM_MENUDRAG} 0 0 in your .nsi code to call this redraw\n\tif(uMsg == WM_MENUDRAG)\n\t{\n\t\tFixMainControls();\n\n\t\tInvalidateRect(hwnd, NULL, TRUE);\n\t\t{\t\t\n\t\t\tHWND dlg = FindWindowEx(hwnd, 0, _T(\"#32770\"), NULL);\n\t\t\tSetWindowLongPtr(dlg, GWLP_WNDPROC, GetWindowLongPtr(dlg, DWLP_USER));\n\n\t\t\tPostMessage(hwnd, WM_USER+0x9, 0, 0);\n\t\t}\n\t}\n\telse if (uMsg == WM_NOTIFY_OUTER_NEXT)\n\t{\n\t\tHWND dlg = FindWindowEx(hwnd, 0, _T(\"#32770\"), NULL);\n\t\tSetWindowLongPtr(dlg, GWLP_WNDPROC, GetWindowLongPtr(dlg, DWLP_USER));\n\n\t\tPostMessage(hwnd, WM_USER+0x9, 0, 0);\n\t}\n\telse if (uMsg == WM_USER+0x9)\n\t{\n\t\tLONG oldChildDlgProc, tempChildDlgProc;\n\t\tEnumChildWindows(hwnd, EnumChildProc, 0);\n\t\tif (!wParam)\n\t\t{\n\t\t\tHWND dlg = FindWindowEx(hwnd, 0, _T(\"#32770\"), NULL);\n\t\t\tif (dlg)\n\t\t\t{\n\t\t\t\tEnumChildWindows(dlg, EnumChildProc, 0);\n\t\t\t\ttempChildDlgProc=GetWindowLongPtr(dlg, GWLP_WNDPROC);\n\t\t\t\tif(PtrToInt(tempChildDlgProc)!=PtrToInt(ChildDlgProc))//don't replace DlgProc multiple times!\n\t\t\t\t{\n\t\t\t\t\toldChildDlgProc = SetWindowLongPtr(dlg, GWLP_WNDPROC, PtrToInt(ChildDlgProc));\n\t\t\t\t\tSetWindowLongPtr(dlg, DWLP_USER, (LONG) oldChildDlgProc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tInvalidateRect(hwnd, NULL, TRUE);\n\t\treturn 0;\n\t}\n\n\treturn CallWindowProc(oldProc, hwnd, uMsg, wParam, lParam);\n}\n\nLRESULT CALLBACK FrameWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n\tswitch (uMsg)\n\t{\n\t\tcase WM_DESTROY:\n\t\t{\n\t\t\tSetWindowLongPtr(g_hwndParent, GWLP_WNDPROC, PtrToInt(oldProc));\n\t\t\tSetWindowLong(g_hwndParent, GWL_STYLE, PtrToInt(g_oldnsiswndstyle));\n\t\t\tSetParent(g_hwndParent, g_oldnsisparentwnd);\n\t\t\tInvalidateRect(hwnd, NULL, TRUE);\n\t\t}\n\t\tbreak;\n\n\t\tcase WM_CLOSE:\n\t\t{\n\t\t\tSetWindowLongPtr(g_hwndParent, GWLP_WNDPROC, PtrToInt(oldProc));\n\t\t\tSetWindowLong(g_hwndParent, GWL_STYLE, PtrToInt(g_oldnsiswndstyle));\n\t\t\tSetParent(g_hwndParent, g_oldnsisparentwnd);\n\t\t\tInvalidateRect(hwnd, NULL, TRUE);\n\n\t\t\tPostMessage(g_hwndParent, WM_SYSCOMMAND, SC_CLOSE, 0);\n\t\t\treturn 0;\n\t\t}\n\t\tcase WM_PAINT:\n\t\t{\t\t\t\n\t\t\tPAINTSTRUCT ps;\n\n\t\t\tBeginPaint(hwnd, &ps);\n\t\t\tEndPaint(hwnd, &ps);\n\n\t\t\treturn 0;\n\t\t}\n\t\tcase WM_ERASEBKGND: // This didn't help my problem\n\t\t{\n\t\t\treturn 1; // Return 1 if this has been handled \n\t\t}\n\t\tcase WM_CTLCOLORBTN:\n\t\t{\n\t\t\tint i; // plain C...\n\t\t\t// Test to see if this button is our subclassed button\n\t\t\tfor (i = 0; i < 3; i++)\n\t\t\t{\n\t\t\t\tif ((HWND)lParam == GetDlgItem(g_hwndParent, 1 + i))\n\t\t\t\t\t// StockObject: doesn't have to be free'd, doesn't hurt if you do free\n\t\t\t\t\treturn (LRESULT)GetStockObject(HOLLOW_BRUSH);\n\t\t\t}\n\t\t} \n\t}\n\treturn CallWindowProc(DefWindowProc, hwnd, uMsg, wParam, lParam);\n}\n\n// re-skin the button when we click on \"Browse\" in the directory page\nvoid FixMainControls()\n{\n\tLONG style;\n\n#define MakeButtonOwnerdraw(hwnd) style = GetWindowLong(hwnd, GWL_STYLE);\\\n\tSetWindowLong(hwnd, GWL_STYLE, (style & ~BS_PUSHBUTTON) | BS_OWNERDRAW); \\\n\tSetProp(hwnd, _T(\"SCBtn\"), (HANDLE)1);\n\n\tMakeButtonOwnerdraw(GetDlgItem(g_hwndParent, 3));\t\t// Back button\n\tMakeButtonOwnerdraw(GetDlgItem(g_hwndParent, 2));\t\t// Cancel button\n\tMakeButtonOwnerdraw(GetDlgItem(g_hwndParent, 1));\t\t// Next button\n\tMakeButtonOwnerdraw(GetDlgItem(g_hwndParent, 1027));\t// Show Detail button\n\n#undef MakeButtonOwnerdraw\n}\n\nBOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)\n{\n\tTCHAR classname[256];\n\n\tGetClassName(hwnd, classname, 255);\n\n\tif (g_hbma)\n\t{\n\t\tif (!lstrcmpi(classname, _T(\"BUTTON\")))\n\t\t{\n\t\t\tLONG style = GetWindowLong(hwnd, GWL_STYLE);\n\n\t\t\tif ( ((style & BS_GROUPBOX) == 0) || (GetParent(hwnd) == g_hwndParent))\n\t\t\t{\n\t\t\t\tif ((style & BS_TYPEMASK) != BS_OWNERDRAW &&\n\t\t\t\t\t(style & BS_TYPEMASK) != BS_GROUPBOX &&\n\t\t\t\t\t(style & BS_TYPEMASK) != BS_AUTOCHECKBOX &&\n\t\t\t\t\t(style & BS_TYPEMASK) != BS_AUTORADIOBUTTON ) {\n\t\t\t\t\t\tSetProp(hwnd, _T(\"SCBtn\"), (HANDLE)1);\n\t\t\t\t}\n\t\t\t\tSetWindowLong(hwnd, GWL_STYLE, (style & ~BS_PUSHBUTTON) | BS_OWNERDRAW);\n\t\t\t}\n\t\t}\n\t\tFixMainControls();\n\t}\n\tif (g_hbmb)\n\t{\n\t\t// Special case for RichEdit controls\n\t\tif (!lstrcmpi(classname, _T(\"RICHEDIT20A\")) \n\t\t\t|| !lstrcmpi(classname, _T(\"RICHEDIT20W\")) \n\t\t\t|| !lstrcmpi(classname, _T(\"RICHEDIT32A\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"SYSLISTVIEW32\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"SYSTREEVIEW32\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"EDIT\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"LISTBOX\")))\n\t\t{\n\t\t\twascrollbars_init(hwnd);\n\t\t}\n\t}\n\tUpdateWindow(hwnd);\n\treturn TRUE;\n}\n\nBOOL CALLBACK EnumChildProc_ScrollBarUninit(HWND hwnd, LPARAM lParam)\n{\n\tTCHAR classname[256];\n\tif (g_hbmb)\n\t{\n\t\tGetClassName(hwnd, classname, 255);\n\t\tif (GetProp(hwnd, _T(\"SCBtn\")))\n\t\t\tRemoveProp(hwnd, _T(\"SCBtn\"));\n\n\t\t// Special case for RichEdit controls\n\t\tif (!lstrcmpi(classname, _T(\"RICHEDIT20A\")) \n\t\t\t|| !lstrcmpi(classname, _T(\"RICHEDIT20W\")) \n\t\t\t|| !lstrcmpi(classname, _T(\"RICHEDIT32A\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"SYSLISTVIEW32\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"SYSTREEVIEW32\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"EDIT\"))\n\t\t\t|| !lstrcmpi(classname, _T(\"LISTBOX\")))\n\t\t{\n\t\t\twascrollbars_uninit(hwnd);\n\t\t}\n\t\tUpdateWindow(hwnd);\n\t}\n\treturn TRUE;\n}\n\n#ifndef LEGACY_PLUGIN\nvoid __declspec(dllexport) skinit(HWND hwndParent, int string_size,\n\t\t\t\t\t\t\t\t  TCHAR *variables, stack_t **stacktop,\n\t\t\t\t\t\t\t\t  extra_parameters *extra)\n#else\nvoid __declspec(dllexport) skinit(HWND hwndParent, int string_size,\n\t\t\t\t\t\t\t\t  TCHAR *variables, stack_t **stacktop)\n#endif\n{\n\tEXDLL_INIT();\n\n#ifndef LEGACY_PLUGIN\n\textra->RegisterPluginCallback(g_hInstance, PluginCallback);\n#endif\n\n\tg_hwndParent = hwndParent;\n\tinternal_skin(0);\n\twascrollbars_initapp();\n}\n\n#ifndef LEGACY_PLUGIN\nvoid __declspec(dllexport) setskin(HWND hwndParent, int string_size,\n\t\t\t\t\t\t\t\t   TCHAR *variables, stack_t **stacktop,\n\t\t\t\t\t\t\t\t   extra_parameters *extra)\n#else\nvoid __declspec(dllexport) setskin(HWND hwndParent, int string_size,\n\t\t\t\t\t\t\t\t   TCHAR *variables, stack_t **stacktop)\n#endif\n{\n\tEXDLL_INIT();\n\n#ifndef LEGACY_PLUGIN\n\textra->RegisterPluginCallback(g_hInstance, PluginCallback);\n#endif\n\n\tg_hwndParent = hwndParent;\n\tinternal_skin(1);\n}\n\nvoid internal_skin(int isUpdating)\n{\n\tTCHAR fnb[MAX_PATH];\n\tTCHAR fna[MAX_PATH];\n\tTCHAR temp[MAX_PATH];\n\tTCHAR compstring[30];\n\tTCHAR *szLastErr;\n\n\tint textcolor = 0x00000000;\n\tint textscolor = 0x00000000;\n\tint textdcolor = 0x00808080;\n\tint setReturn = 0;\n\n\tTCHAR tcp[] = _T(\"/textcolor=\");\n\tTCHAR tscp[] = _T(\"/selectedtextcolor=\");\n\tTCHAR tdcp[] = _T(\"/disabledtextcolor=\");\n\tTCHAR bcp[] = _T(\"/button=\");\n\tTCHAR sbcp[] = _T(\"/scrollbar=\");\n\tTCHAR srcp[] = _T(\"/SetReturn\");\n\n\t// get parmaters\n\tint valid = 1;\n\n\tlstrcpy(fnb, _T(\"\"));\n\tlstrcpy(fna, _T(\"\"));\n\n\tdo\n\t{\n\t\tvalid = 1;\n\t\tlstrcpy(temp, _T(\"\"));\n\t\tpopstring(temp);\n\n\t\tlstrcpyn(compstring, temp, lstrlen(tdcp)+1);\n\t\tif (lstrcmpi(compstring, tdcp) == 0)\n\t\t{\n\t\t\ttextdcolor = myhtoi(&temp[lstrlen(tdcp)]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlstrcpyn(compstring, temp, lstrlen(tscp)+1);\n\t\t\tif (lstrcmpi(compstring, tscp) == 0)\n\t\t\t{\n\t\t\t\ttextscolor = myhtoi(&temp[lstrlen(tscp)]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlstrcpyn(compstring, temp, lstrlen(tcp)+1);\n\t\t\t\tif (lstrcmpi(compstring, tcp) == 0)\n\t\t\t\t{\n\t\t\t\t\ttextcolor = myhtoi(&temp[lstrlen(tcp)]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlstrcpyn(compstring, temp, lstrlen(bcp)+1);\n\t\t\t\t\tif (lstrcmpi(compstring, bcp) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlstrcpy(fna, &temp[lstrlen(bcp)]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlstrcpyn(compstring, temp, lstrlen(sbcp)+1);\n\t\t\t\t\t\tif (lstrcmpi(compstring, sbcp) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlstrcpy(fnb, &temp[lstrlen(sbcp)]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlstrcpyn(compstring, temp, lstrlen(srcp)+1);\n\t\t\t\t\t\t\tif (lstrcmpi(compstring, srcp) == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsetReturn = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalid = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\twhile (valid);\n\n\tlstrcpyn(compstring, temp, 2);\n\tif (lstrcmp(compstring, _T(\"/\")) == 0)\n\t{\n\t\tTCHAR szErr[255];\n\t\twsprintf(szErr, _T(\"SkinnedControls error: Bad parameter %s\"), (LPSTR)temp);\n\t\tif (setReturn == 0)\n\t\t\tMessageBox(0,szErr,0,MB_ICONEXCLAMATION|MB_OK);\n\t\telse\n\t\t\tpushstring(szErr);\n\t\treturn;\n\t}\n\n\tpushstring(temp);\n\n\ttextcolor = rgbtobgr(textcolor);\n\ttextscolor = rgbtobgr(textscolor);\n\ttextdcolor = rgbtobgr(textdcolor);\n\n\tif (lstrcmp(fnb, _T(\"\")) == 0 && lstrcmp(fna, _T(\"\")) == 0)\n\t{\n\t\tif (setReturn == 0)\n\t\t\tMessageBox(0,_T(\"SkinnedControls error: Missing parameters /button and /scrollbar\"),0,MB_ICONEXCLAMATION|MB_OK);\n\t\telse\n\t\t\tpushstring(_T(\"SkinnedControls error: Missing parameters /button and /scrollbar\"));\n\t\treturn;\n\t}\n\n\tif ((lstrcmp(fnb, _T(\"\")) != 0 && GetFileAttributes(fnb) == 0xFFFFFFFF) || (lstrcmp(fna, _T(\"\")) != 0 && GetFileAttributes(fna) == 0xFFFFFFFF))\n\t{\n\t\tTCHAR szErr[255];\n\t\tszLastErr = GetLastErrorStr();\n\t\twsprintf(szErr, _T(\"SkinnedControls error: %s\"), (LPSTR)szLastErr);\n\t\tLocalFree((HLOCAL)szLastErr);// Free the buffer.\n\t\tif (setReturn == 0)\n\t\t\tMessageBox(0,szErr,0,MB_ICONEXCLAMATION|MB_OK);\n\t\telse\n\t\t\tpushstring(szErr);\n\t\treturn;\n\t}\n\n\tif (isUpdating)\n\t{\n\t\tinternal_unskin();\n\t}\n\n\tg_hbma=LoadImage(NULL,fna,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION|LR_LOADFROMFILE);\n\tg_hbmb=LoadImage(NULL,fnb,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION|LR_LOADFROMFILE);\n\n\tif (!g_hbmb && !g_hbma) \n\t{\n\t\tTCHAR szErr[255];\n\t\tszLastErr = GetLastErrorStr();\n\t\twsprintf(szErr, _T(\"SkinnedControls error: %s\"), (LPSTR)szLastErr);\n\t\tLocalFree((HLOCAL)szLastErr);// Free the buffer.\n\t\tif (setReturn == 0)\n\t\t\tMessageBox(0,szErr,0,MB_ICONEXCLAMATION|MB_OK);\n\t\telse\n\t\t\tpushstring(szErr);\n\t\treturn;\n\t}\n\n\n\tWADlg_init(g_hbmb, g_hbma, textcolor, textscolor, textdcolor);\n\n\tif (!isUpdating)\n\t{\n\t\tSetWindowLong(g_hwndParent, GWL_EXSTYLE, WS_EX_CONTROLPARENT);\n\n\t\toldProc = IntToPtr(SetWindowLongPtr(g_hwndParent, GWLP_WNDPROC, PtrToInt(WndProc)));\n\t\tPostMessage(g_hwndParent, WM_USER+0x9, 0, 0);\n\t\tShowWindow(g_hwndParent, SW_SHOW);\n\t}\n\n\tif (setReturn == 1)\n\t\tpushstring(_T(\"success\"));\n}\n\n#ifndef LEGACY_PLUGIN\nvoid __declspec(dllexport) unskinit(HWND hwndParent, int string_size,\n\t\t\t\t\t\t\t\t\tTCHAR *variables, stack_t **stacktop,\n\t\t\t\t\t\t\t\t\textra_parameters *extra)\n#else\nvoid __declspec(dllexport) unskinit(HWND hwndParent, int string_size,\n\t\t\t\t\t\t\t\t\tTCHAR *variables, stack_t **stacktop)\n#endif\n{\n\tinternal_unskin();\n\tInvalidateRect(hwndParent, NULL, TRUE);\n}\n\nvoid internal_unskin()\n{\n\t// Free graphics stuff\n\tWADlg_close();\n\tif (g_hbma)\n\t{\n\t\tDeleteObject(g_hbma);\n\t\tg_hbma=0;\n\t}\n\tif (g_hbmb)\n\t{\n\t\tDeleteObject(g_hbmb);\n\t\tg_hbmb=0;\n\t\twascrollbars_uninitapp();\n\t}\n}\n\n// U T I L I T Y   F U N C T I O N S\n\nTCHAR* GetLastErrorStr(void)\n{\n\tLPVOID lpMsgBuf;\n\n\tFormatMessage( \n\t\tFORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,\n\t\tNULL,\n\t\tGetLastError(),\n\t\tMAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language\n\t\t(LPTSTR) &lpMsgBuf,\n\t\t0,\n\t\tNULL \n\t\t);\n\n\treturn (TCHAR*)lpMsgBuf;\n}\n\nunsigned int myhtoi(TCHAR *s)\n{\n\tunsigned int v = 0;\n\n\tfor (;;)\n\t{\n\t\tunsigned int c=*s++;\n\t\tif (c >= '0' && c <= '9')\n\t\t{\n\t\t\tc -= '0';\n\t\t}\n\t\telse if (c >= 'A' && c <= 'F')\n\t\t{\n\t\t\tc -= 'A';\n\t\t\tc += 10;\n\t\t}\n\t\telse if (c >= 'a' && c <= 'f')\n\t\t{\n\t\t\tc -= 'a';\n\t\t\tc += 10;\n\t\t}\n\t\telse break;\n\t\tv *= 16;\n\t\tv += c;\n\t}\n\treturn v;\n}\n\nunsigned int rgbtobgr(unsigned int rgb)\n{\n\tunsigned int bgr;\n\tunsigned int temp1, temp2;\n\n\ttemp1 = rgb & 0x000000FF;\n\ttemp2 = rgb & 0x00FF0000;\n\n\ttemp1 = temp1 * 0x00010000;\n\ttemp2 = temp2 / 0x00010000;\n\n\tbgr = rgb & 0x0000FF00;\n\tbgr += temp1;\n\tbgr += temp2;\n\n\treturn bgr;\n}"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/SkinnedControls.h",
    "content": "#define _WIN32_IE 0x0600\n#define WINVER 0x0500\n#define _WIN32_WINNT 0x0500\n#include <windows.h>\n#include <richedit.h>\n#include <commctrl.h>\n\n//Used in wa_dlg.h\nHINSTANCE g_hInstance;\n\n//Private #includes\n#include \"pluginapi.h\"\n#define WADLG_IMPLEMENT\n#include \"wa_dlg.h\"\n#include \"wa_scrollbars.h\"\n\n//Variables\n//================================================================\nHWND g_hwndParent;\nWNDPROC oldProc;\nLONG g_oldnsiswndstyle;\nHWND g_oldnsisparentwnd;\nHBITMAP g_hbmb;\nHBITMAP g_hbma;\n\n//Functions\n//================================================================\nBOOL CALLBACK EnumChildProc(HWND, LPARAM);\nBOOL CALLBACK EnumChildProc_ScrollBarUninit(HWND hwnd, LPARAM lParam);\nvoid internal_skin(int);\nvoid internal_unskin();\nTCHAR* GetLastErrorStr(void);\n\nunsigned int myhtoi(TCHAR*);\nunsigned int rgbtobgr(unsigned int);\nvoid FixMainControls();\n\n#ifndef LEGACY_PLUGIN\n\n// Plugin callback function\n//================================================================\nstatic UINT_PTR PluginCallback(enum NSPIM msg)\n{ \n\tif (msg == NSPIM_GUIUNLOAD)\n\t{\n\t\tinternal_unskin();\n\t}\n\treturn 0;\n}\n\n#endif\n\n#pragma message(\" \")\n#pragma message(\"----------------------------------------------------\")\n#ifndef LEGACY_PLUGIN\n\t#pragma message(\" Info: Compilation using the new NSIS plugin API\")\n#else\n\t#pragma message(\" Info: Compilation using the legacy NSIS plugin API\")\n#endif\n#pragma message(\"----------------------------------------------------\")\n#pragma message(\" \")\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/SkinnedControls.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 10.00\n# Visual C++ Express 2008\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"SkinnedControls\", \"SkinnedControls.vcproj\", \"{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7} = {5FAA4FEB-2E89-4033-9702-6605B20746A7}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"coolsb\", \"coolsb\\coolsb.vcproj\", \"{5FAA4FEB-2E89-4033-9702-6605B20746A7}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug Ansi OldAPI|Win32 = Debug Ansi OldAPI|Win32\n\t\tDebug Ansi|Win32 = Debug Ansi|Win32\n\t\tDebug Unicode|Win32 = Debug Unicode|Win32\n\t\tRelease Ansi OldAPI|Win32 = Release Ansi OldAPI|Win32\n\t\tRelease Ansi|Win32 = Release Ansi|Win32\n\t\tRelease Unicode|Win32 = Release Unicode|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi OldAPI|Win32.ActiveCfg = Debug Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi OldAPI|Win32.Build.0 = Debug Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi|Win32.ActiveCfg = Debug Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Ansi|Win32.Build.0 = Debug Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi OldAPI|Win32.ActiveCfg = Release Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi OldAPI|Win32.Build.0 = Release Ansi OldAPI|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi|Win32.ActiveCfg = Release Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Ansi|Win32.Build.0 = Release Ansi|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32\n\t\t{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}.Release Unicode|Win32.Build.0 = Release Unicode|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Debug Ansi OldAPI|Win32.ActiveCfg = Debug Ansi OldAPI|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Debug Ansi OldAPI|Win32.Build.0 = Debug Ansi OldAPI|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Debug Ansi|Win32.ActiveCfg = Debug Ansi|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Debug Ansi|Win32.Build.0 = Debug Ansi|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Release Ansi OldAPI|Win32.ActiveCfg = Release Ansi OldAPI|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Release Ansi OldAPI|Win32.Build.0 = Release Ansi OldAPI|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Release Ansi|Win32.ActiveCfg = Release Ansi|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Release Ansi|Win32.Build.0 = Release Ansi|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32\n\t\t{5FAA4FEB-2E89-4033-9702-6605B20746A7}.Release Unicode|Win32.Build.0 = Release Unicode|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/SkinnedControls.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"9,00\"\n\tName=\"SkinnedControls\"\n\tProjectGUID=\"{80973FE4-5C0E-48F7-97EC-F6FEE6A12B31}\"\n\tRootNamespace=\"SkinnedControls\"\n\tKeyword=\"Win32Proj\"\n\tTargetFrameworkVersion=\"131072\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug Ansi|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfATL=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;SkinnedControls_EXPORTS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\".\\coolsb\\coolsb.lib&#x0D;&#x0A;.\\coolsb\\detours.lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-ansi/SkinnedControls.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tProgramDatabaseFile=\"$(OutDir)/SkinnedControls.pdb\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/SkinnedControls.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Ansi|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"1\"\n\t\t\t\tFavorSizeOrSpeed=\"2\"\n\t\t\t\tWholeProgramOptimization=\"true\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;SkinnedControls_EXPORTS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\".\\coolsb\\coolsb.lib&#x0D;&#x0A;.\\coolsb\\detours.lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-ansi/SkinnedControls.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"false\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/SkinnedControls.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Unicode|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"1\"\n\t\t\t\tFavorSizeOrSpeed=\"2\"\n\t\t\t\tWholeProgramOptimization=\"true\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;SkinnedControls_EXPORTS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\".\\coolsb\\coolsb.lib&#x0D;&#x0A;.\\coolsb\\detours.lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-unicode/SkinnedControls.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"false\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/SkinnedControls.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug Unicode|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tFavorSizeOrSpeed=\"2\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;SkinnedControls_EXPORTS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\".\\coolsb\\coolsb.lib&#x0D;&#x0A;.\\coolsb\\detours.lib\"\n\t\t\t\tOutputFile=\"../../Plugins/x86-unicode/SkinnedControls.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"false\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"0\"\n\t\t\t\tEnableCOMDATFolding=\"0\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/SkinnedControls.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Ansi OldAPI|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tAdditionalOptions=\"/D &quot;LEGACY_PLUGIN&quot;\"\n\t\t\t\tOptimization=\"1\"\n\t\t\t\tFavorSizeOrSpeed=\"2\"\n\t\t\t\tWholeProgramOptimization=\"true\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;SkinnedControls_EXPORTS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\".\\coolsb\\coolsb.lib&#x0D;&#x0A;.\\coolsb\\detours.lib\"\n\t\t\t\tOutputFile=\"../../Plugins/SkinnedControls.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"false\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/SkinnedControls.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug Ansi OldAPI|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC71.vsprops\"\n\t\t\tUseOfATL=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tUseUnicodeResponseFiles=\"false\"\n\t\t\t\tAdditionalOptions=\"/D &quot;LEGACY_PLUGIN&quot;\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;SkinnedControls_EXPORTS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\".\\coolsb\\coolsb.lib&#x0D;&#x0A;.\\coolsb\\detours.lib\"\n\t\t\t\tOutputFile=\"../../Plugins/SkinnedControls.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tProgramDatabaseFile=\"$(OutDir)/SkinnedControls.pdb\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\"$(OutDir)/SkinnedControls.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\pluginapi.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\SkinnedControls.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\wa_scrollbars.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\api.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\nsis_tchar.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\pluginapi.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\SkinnedControls.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\wa_dlg.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\wa_scrollbars.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/api.h",
    "content": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2016 Nullsoft and Contributors\n * \n * Licensed under the zlib/libpng license (the \"License\");\n * you may not use this file except in compliance with the License.\n * \n * Licence details can be found in the file COPYING.\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n */\n\n#ifndef _NSIS_EXEHEAD_API_H_\n#define _NSIS_EXEHEAD_API_H_\n\n// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version\n// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))\n// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}\n\n#define NSISPIAPIVER_1_0 0x00010000\n#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0\n\n// NSIS Plug-In Callback Messages\nenum NSPIM \n{\n  NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup\n  NSPIM_GUIUNLOAD, // Called after .onGUIEnd\n};\n\n// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()\n// Return NULL for unknown messages\n// Should always be __cdecl for future expansion possibilities\ntypedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);\n\n// extra_parameters data structures containing other interesting stuff\n// but the stack, variables and HWND passed on to plug-ins.\ntypedef struct\n{\n  int autoclose;\n  int all_user_var;\n  int exec_error;\n  int abort;\n  int exec_reboot; // NSIS_SUPPORT_REBOOT\n  int reboot_called; // NSIS_SUPPORT_REBOOT\n  int XXX_cur_insttype; // Deprecated\n  int plugin_api_version; // see NSISPIAPIVER_CURR\n                          // used to be XXX_insttype_changed\n  int silent; // NSIS_CONFIG_SILENT_SUPPORT\n  int instdir_error;\n  int rtl;\n  int errlvl;\n  int alter_reg_view;\n  int status_update;\n} exec_flags_t;\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n#if !defined(_WIN32) && !defined(LPTSTR)\n#  define LPTSTR TCHAR*\n#endif\n\ntypedef struct {\n  exec_flags_t *exec_flags;\n  int (NSISCALL *ExecuteCodeSegment)(int, HWND);\n  void (NSISCALL *validate_filename)(LPTSTR);\n  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors\n} extra_parameters;\n\n// Definitions for page showing plug-ins\n// See Ui.c to understand better how they're used\n\n// sent to the outer window to tell it to go to the next inner window\n#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)\n\n// custom pages should send this message to let NSIS know they're ready\n#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)\n\n// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning\n#define NOTIFY_BYE_BYE 'x'\n\n#endif /* _PLUGIN_H_ */\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolsb.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"9,00\"\n\tName=\"coolsb\"\n\tProjectGUID=\"{5FAA4FEB-2E89-4033-9702-6605B20746A7}\"\n\tTargetFrameworkVersion=\"131072\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Release Ansi|Win32\"\n\t\t\tOutputDirectory=\".\\Release\"\n\t\t\tIntermediateDirectory=\".\\Release\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tInlineFunctionExpansion=\"1\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_LIB\"\n\t\t\t\tStringPooling=\"true\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Release/coolsb.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Release/\"\n\t\t\t\tObjectFile=\".\\Release/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Release/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG\"\n\t\t\t\tCulture=\"2057\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\".\\$(ProjectName).lib\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Release/coolsb.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug Ansi|Win32\"\n\t\t\tOutputDirectory=\".\\Debug\"\n\t\t\tIntermediateDirectory=\".\\Debug\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_LIB\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Debug/coolsb.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Debug/\"\n\t\t\t\tObjectFile=\".\\Debug/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Debug/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG\"\n\t\t\t\tCulture=\"2057\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\".\\$(ProjectName).lib\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Debug/coolsb.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Unicode|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tInlineFunctionExpansion=\"1\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_LIB\"\n\t\t\t\tStringPooling=\"true\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Release/coolsb.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Release/\"\n\t\t\t\tObjectFile=\".\\Release/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Release/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG\"\n\t\t\t\tCulture=\"2057\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\".\\$(ProjectName).lib\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Release/coolsb.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug Unicode|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tInlineFunctionExpansion=\"1\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_LIB\"\n\t\t\t\tStringPooling=\"true\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Release/coolsb.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Release/\"\n\t\t\t\tObjectFile=\".\\Release/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Release/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG\"\n\t\t\t\tCulture=\"2057\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\".\\$(ProjectName).lib\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Release/coolsb.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release Ansi OldAPI|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_LIB\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Debug/coolsb.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Debug/\"\n\t\t\t\tObjectFile=\".\\Debug/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Debug/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG\"\n\t\t\t\tCulture=\"2057\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\".\\$(ProjectName).lib\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Debug/coolsb.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug Ansi OldAPI|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_LIB\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Debug/coolsb.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Debug/\"\n\t\t\t\tObjectFile=\".\\Debug/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Debug/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG\"\n\t\t\t\tCulture=\"2057\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\".\\$(ProjectName).lib\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Debug/coolsb.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\coolsb_detours.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"coolsblib.c\"\n\t\t\t\t>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release Ansi|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug Ansi|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release Unicode|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug Unicode|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release Ansi OldAPI|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug Ansi OldAPI|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"coolscroll.c\"\n\t\t\t\t>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release Ansi|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug Ansi|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release Unicode|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug Unicode|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release Ansi OldAPI|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug Ansi OldAPI|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\coolsb_detours.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"coolsb_internal.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\coolsblib.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"coolscroll.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\detours.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"userdefs.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolsb_detours.c",
    "content": "#include <windows.h>\n\n#include \"coolsb_detours.h\"\n#include \"coolscroll.h\"\n#include \"detours.h\"\n\n#pragma warning(disable:4100)   // Trampolines don't use formal parameters.\n\nDETOUR_TRAMPOLINE(BOOL WINAPI Detour_EnableScrollBar(HWND hwnd, int wSBflags, UINT wArrows), EnableScrollBar);\nDETOUR_TRAMPOLINE(BOOL WINAPI Detour_GetScrollInfo\t(HWND hwnd, int fnBar, LPSCROLLINFO lpsi), GetScrollInfo);\nDETOUR_TRAMPOLINE(int  WINAPI Detour_GetScrollPos\t(HWND hwnd, int nBar), GetScrollPos);\nDETOUR_TRAMPOLINE(BOOL WINAPI Detour_GetScrollRange\t(HWND hwnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos), GetScrollRange);\nDETOUR_TRAMPOLINE(int  WINAPI Detour_SetScrollInfo\t(HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw), SetScrollInfo);\nDETOUR_TRAMPOLINE(int  WINAPI Detour_SetScrollPos\t(HWND hwnd, int nBar, int nPos, BOOL fRedraw), SetScrollPos);\nDETOUR_TRAMPOLINE(int  WINAPI Detour_SetScrollRange\t(HWND hwnd, int nBar, int nMinPos, int nMaxPos, BOOL fRedraw), SetScrollRange);\nDETOUR_TRAMPOLINE(BOOL WINAPI Detour_ShowScrollBar\t(HWND hwnd, int wBar, BOOL fShow), ShowScrollBar);\n\nstatic BOOL WINAPI Tramp_EnableScrollBar(HWND hwnd, int wSBflags, UINT wArrows)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_EnableScrollBar(hwnd, wSBflags, wArrows);\n\telse\n\t\treturn Detour_EnableScrollBar(hwnd, wSBflags, wArrows);\n}\n\nstatic BOOL WINAPI Tramp_GetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_GetScrollInfo(hwnd, fnBar, lpsi);\n\telse\n\t\treturn Detour_GetScrollInfo(hwnd, fnBar, lpsi);\n}\n\nstatic int\t WINAPI Tramp_GetScrollPos(HWND hwnd, int nBar)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_GetScrollPos(hwnd, nBar);\n\telse\n\t\treturn Detour_GetScrollPos(hwnd, nBar);\n}\n\nstatic BOOL WINAPI Tramp_GetScrollRange(HWND hwnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_GetScrollRange(hwnd, nBar, lpMinPos, lpMaxPos);\n\telse\n\t\treturn Detour_GetScrollRange(hwnd, nBar, lpMinPos, lpMaxPos);\n}\n\nstatic int\t WINAPI Tramp_SetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_SetScrollInfo(hwnd, fnBar, lpsi, fRedraw);\n\telse\n\t\treturn Detour_SetScrollInfo(hwnd, fnBar, lpsi, fRedraw);\n}\n\nstatic int  WINAPI Tramp_SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL fRedraw)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_SetScrollPos(hwnd, nBar, nPos, fRedraw);\n\telse\n\t\treturn Detour_SetScrollPos(hwnd, nBar, nPos, fRedraw);\n}\n\nstatic int  WINAPI Tramp_SetScrollRange(HWND hwnd, int nBar, int nMinPos, int nMaxPos, BOOL fRedraw)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_SetScrollRange(hwnd, nBar, nMinPos, nMaxPos, fRedraw);\n\telse\n\t\treturn Detour_SetScrollRange(hwnd, nBar, nMinPos, nMaxPos, fRedraw);\n}\n\nstatic BOOL WINAPI Tramp_ShowScrollBar\t\t(HWND hwnd, int wBar, BOOL fShow)\n{\n\tif(CoolSB_IsCoolScrollEnabled(hwnd))\t\n\t\treturn CoolSB_ShowScrollBar(hwnd, wBar, fShow);\n\telse\n\t\treturn Detour_ShowScrollBar(hwnd, wBar, fShow);\n}\n\nBOOL WINAPI CoolSB_InitializeApp(void)\n{\n\tDWORD dwVersion = GetVersion();\n\n\t// Only available under Windows NT, 2000 and XP\n\tif(dwVersion < 0x80000000)\n\t{\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_EnableScrollBar, (PBYTE)Tramp_EnableScrollBar);\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_GetScrollInfo,   (PBYTE)Tramp_GetScrollInfo);\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_GetScrollPos,    (PBYTE)Tramp_GetScrollPos);\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_GetScrollRange,  (PBYTE)Tramp_GetScrollRange);\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_SetScrollInfo,   (PBYTE)Tramp_SetScrollInfo);\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_SetScrollPos,    (PBYTE)Tramp_SetScrollPos);\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_SetScrollRange,  (PBYTE)Tramp_SetScrollRange);\n\t\tDetourFunctionWithTrampoline((PBYTE)Detour_ShowScrollBar,   (PBYTE)Tramp_ShowScrollBar);\n\n\t\t// don't actually use this feature within coolsb yet, but we might need it\n\t\tCoolSB_SetESBProc(Detour_EnableScrollBar);\n\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\t\n}\n\nBOOL WINAPI CoolSB_UninitializeApp(void)\n{\n\tDWORD dwVersion = GetVersion();\n\n\t// Only available under Windows NT, 2000 and XP\n\tif(dwVersion < 0x80000000)\n\t{\n\t\tDetourRemove((PBYTE)Detour_EnableScrollBar, (PBYTE)Tramp_EnableScrollBar);\n\t\tDetourRemove((PBYTE)Detour_GetScrollInfo,   (PBYTE)Tramp_GetScrollInfo);\n\t\tDetourRemove((PBYTE)Detour_GetScrollPos,    (PBYTE)Tramp_GetScrollPos);\n\t\tDetourRemove((PBYTE)Detour_GetScrollRange,  (PBYTE)Tramp_GetScrollRange);\n\t\tDetourRemove((PBYTE)Detour_SetScrollInfo,   (PBYTE)Tramp_SetScrollInfo);\n\t\tDetourRemove((PBYTE)Detour_SetScrollPos,    (PBYTE)Tramp_SetScrollPos);\n\t\tDetourRemove((PBYTE)Detour_SetScrollRange,  (PBYTE)Tramp_SetScrollRange);\n\t\tDetourRemove((PBYTE)Detour_ShowScrollBar,   (PBYTE)Tramp_ShowScrollBar);\n\n\t\t// don't actually use this feature within coolsb yet, but we might need it\n\t\tCoolSB_SetESBProc(EnableScrollBar);\n\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolsb_detours.h",
    "content": "#ifndef COOLSB_DETOURS_INCLUDED\n#define COOLSB_DETOURS_INCLUDED\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nBOOL WINAPI CoolSB_InitializeApp(void);\nBOOL WINAPI CoolSB_UninitializeApp(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolsb_internal.h",
    "content": "#ifndef _COOLSB_INTERNAL_INCLUDED\n#define _COOLSB_INTERNAL_INCLUDED\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\n#include <windows.h>\n\n//\n//\tSCROLLBAR datatype. There are two of these structures per window\n//\ntypedef struct \n{\n\tUINT\t\tfScrollFlags;\t\t//flags\n\tBOOL\t\tfScrollVisible;\t\t//if this scrollbar visible?\n\tSCROLLINFO\tscrollInfo;\t\t\t//positional data (range, position, page size etc)\n\t\n\tint\t\t\tnArrowLength;\t\t//perpendicular size (height of a horizontal, width of a vertical)\n\tint\t\t\tnArrowWidth;\t\t//parallel size (width of horz, height of vert)\n\n\t//data for inserted buttons\n\tSCROLLBUT\tsbButtons[MAX_COOLSB_BUTS];\n\tint\t\t\tnButtons;\n\tint\t\t\tnButSizeBefore;\t\t//size to the left / above the bar\n\tint\t\t\tnButSizeAfter;\t\t//size to the right / below the bar\n\n\tBOOL\t\tfButVisibleBefore;\t//if the buttons to the left are visible\n\tBOOL\t\tfButVisibleAfter;\t//if the buttons to the right are visible\n\n\tint\t\t\tnBarType;\t\t\t//SB_HORZ / SB_VERT\n\n\tUINT\t\tfFlatScrollbar;\t\t//do we display flat scrollbars?\n\tint\t\t\tnMinThumbSize;\n\n} SCROLLBAR;\n\n//\n//\tContainer structure for a cool scrollbar window.\n//\ntypedef struct\n{\n\tUINT bars;\t\t\t\t//which of the scrollbars do we handle? SB_VERT / SB_HORZ / SB_BOTH\n\tWNDPROC oldproc;\t\t//old window procedure to call for every message\n\n\tSCROLLBAR sbarHorz;\t\t//one scrollbar structure each for \n\tSCROLLBAR sbarVert;\t\t//the horizontal and vertical scrollbars\n\n\tBOOL fThumbTracking;\t// are we currently thumb-tracking??\n\tBOOL fLeftScrollbar;\t// support the WS_EX_LEFTSCROLLBAR style\n\n\tHWND hwndToolTip;\t\t// tooltip support!!!\n\n\t//size of the window borders\n\tint cxLeftEdge, cxRightEdge;\n\tint cyTopEdge,  cyBottomEdge;\n\n\t// To prevent calling original WindowProc in response\n\t// to our own temporary style change (fixes TreeView problem)\n\tBOOL bPreventStyleChange;\n\n} SCROLLWND;\n\n\n//\n//\tPRIVATE INTERNAL FUNCTIONS\n//\nSCROLLWND *GetScrollWndFromHwnd(HWND hwnd);\n#define InvertCOLORREF(col) ((~col) & 0x00ffffff)\n\n#define COOLSB_TIMERID1\t\t\t65533\t\t//initial timer\n#define COOLSB_TIMERID2\t\t\t65534\t\t//scroll message timer\n#define COOLSB_TIMERID3\t\t\t-14\t\t\t//mouse hover timer\n#define COOLSB_TIMERINTERVAL1\t300\n#define COOLSB_TIMERINTERVAL2\t55\n#define COOLSB_TIMERINTERVAL3\t20\t\t\t//mouse hover time\n\n\n//\n//\tdirection: 0 - same axis as scrollbar (i.e.  width of a horizontal bar)\n//             1 - perpendicular dimesion (i.e. height of a horizontal bar)\n//\n#define SM_CXVERTSB 1\n#define SM_CYVERTSB 0\n#define SM_CXHORZSB 0\n#define SM_CYHORZSB 1\n#define SM_SCROLL_WIDTH\t1\n#define SM_SCROLL_LENGTH 0\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolsblib.c",
    "content": "/*\n\t\n\tCool Scrollbar Library Version 1.2\n\n\tModule: coolsblib.c\n\tCopyright (c) J Brown 2001\n\n\tThis code is freeware, however, you may not publish\n\tthis code elsewhere or charge any money for it. This code\n\tis supplied as-is. I make no guarantees about the suitability\n\tof this code - use at your own risk.\n\t\n\tIt would be nice if you credited me, in the event\n\tthat you use this code in a product.\n\n\tVERSION HISTORY:\n\n\t V1.2: TreeView problem fixed by Diego Tartara\n\t\t   Small problem in thumbsize calculation also fixed (thanks Diego!)\n\n\t V1.1: Added support for Right-left windows\n\t       Changed calling convention of APIs to WINAPI (__stdcall)\n\t\t   Completely standalone (no need for c-runtime)\n\n\t V1.0: Apr 2001: Initial Version\n\n*/\n\n#define STRICT\n\n#include <windows.h>\n#include <commctrl.h>\n#include <tchar.h>\n#include \"coolscroll.h\"\n#include \"userdefs.h\"\n#include \"coolsb_internal.h\"\n\nstatic TCHAR szPropStr[] = _T(\"CoolSBSubclassPtr\");\n\nLRESULT CALLBACK CoolSBWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);\n\nSCROLLWND *GetScrollWndFromHwnd(HWND hwnd)\n{\n\treturn (SCROLLWND *)GetProp(hwnd, szPropStr);\n}\n\nSCROLLBAR *GetScrollBarFromHwnd(HWND hwnd, UINT nBar)\n{\n\tSCROLLWND *sw = GetScrollWndFromHwnd(hwnd);\n\t\n\tif(!sw) return 0;\n\t\n\tif(nBar == SB_HORZ)\n\t\treturn &sw->sbarHorz;\n\telse if(nBar == SB_VERT)\n\t\treturn &sw->sbarVert;\n\telse\n\t\treturn 0;\n}\n\nBOOL WINAPI CoolSB_IsCoolScrollEnabled(HWND hwnd)\n{\n\tif(GetScrollWndFromHwnd(hwnd))\n\t\treturn TRUE;\n\telse\n\t\treturn FALSE;\n}\n\nBOOL GetScrollRect(SCROLLWND *sw, UINT nBar, HWND hwnd, RECT *rect);\n\n//\n//\tSpecial support for USER32.DLL patching (using Detours library)\n//\tThe only place we call a real scrollbar API is in InitializeCoolSB,\n//\twhere we call EnableScrollbar.\n//\t\n//\tWe HAVE to call the origial EnableScrollbar function, \n//\tso we need to be able to set a pointer to this func when using\n//\tusing Detours (or any other LIB??)\n//\n\nstatic BOOL (WINAPI * pEnableScrollBar) (HWND, UINT, UINT) = 0;\n\nvoid WINAPI CoolSB_SetESBProc(void *proc)\n{\n\tpEnableScrollBar = proc;\n}\n//\n//\n\nstatic void RedrawNonClient(HWND hwnd, BOOL fFrameChanged)\n{\n\tif(fFrameChanged == FALSE)\n\t{\n\t\t/*\n\t\tRECT rect;\n\t\tHRGN hrgn1, hrgn2;\n\t\t\n\t\tSCROLLWND *sw = GetScrollWndFromHwnd(hwnd);\n\t\t\n\t\tGetScrollRect(sw, SB_HORZ, hwnd, &rect);\n\t\thrgn1 = CreateRectRgnIndirect(&rect);\n\t\t\n\t\tGetScrollRect(sw, SB_VERT, hwnd, &rect);\n\t\thrgn2 = CreateRectRgnIndirect(&rect);\n\t\t\n\t\tCombineRgn(hrgn1, hrgn2, hrgn1, RGN_OR);\n\t\t\n\t\tSendMessage(hwnd, WM_NCPAINT, (WPARAM)hrgn1, 0);\n\t\t\n\t\tDeleteObject(hrgn1);\n\t\tDeleteObject(hrgn2);*/\n\n\t\tSendMessage(hwnd, WM_NCPAINT, (WPARAM)1, 0);\n\t}\n\telse\n\t{\n\t\tSetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE\n\t\t\t| SWP_FRAMECHANGED | SWP_DRAWFRAME);\n\t}\n}\n\n//\n//\treturn the default minimum size of a scrollbar thumb\n//\nint WINAPI CoolSB_GetDefaultMinThumbSize(void)\n{\n\tDWORD dwVersion = GetVersion();\n\n\t// set the minimum thumb size for a scrollbar. This\n\t// differs between NT4 and 2000, so need to check to see\n\t// which platform we are running under\n\tif(dwVersion < 0x80000000)              // Windows NT/2000\n\t{\n\t\tif(LOBYTE(LOWORD(dwVersion)) >= 5)\n\t\t\treturn MINTHUMBSIZE_2000;\n\t\telse\n\t\t\treturn MINTHUMBSIZE_NT4;\n\t}\n\telse\n\t{\n\t\treturn MINTHUMBSIZE_NT4;\n\t}\n}\n\nstatic SCROLLINFO *GetScrollInfoFromHwnd(HWND hwnd, int fnBar)\n{\n\tSCROLLBAR *sb = GetScrollBarFromHwnd(hwnd, fnBar);\n\n\tif(sb == 0)\n\t\treturn FALSE;\n\n\tif(fnBar == SB_HORZ)\n\t{\n\t\treturn &sb->scrollInfo;\n\t}\n\telse if(fnBar == SB_VERT)\n\t{\n\t\treturn &sb->scrollInfo;\n\t}\n\telse\n\t\treturn NULL;\n}\n//\n//\tInitialize the cool scrollbars for a window by subclassing it\n//\tand using the coolsb window procedure instead\n//\nBOOL WINAPI InitializeCoolSB(HWND hwnd)\n{\n\tSCROLLWND *sw;\n\tSCROLLINFO *si;\n\tINITCOMMONCONTROLSEX ice;\n\tTOOLINFO ti;\n\tRECT rect;\n\tDWORD dwCurStyle;\n\t//BOOL fDisabled;\n\n\tif(pEnableScrollBar == 0)\n\t\tpEnableScrollBar = EnableScrollBar;\n\n\tGetClientRect(hwnd, &rect);\n\n\t//if we have already initialized Cool Scrollbars for this window,\n\t//then stop the user from doing it again\n\tif(GetScrollWndFromHwnd(hwnd) != 0)\n\t{\n\t\treturn FALSE;\n\t}\n\n\t//allocate a private scrollbar structure which we \n\t//will use to keep track of the scrollbar data\n\tsw = (SCROLLWND *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SCROLLWND));\n\n\tsi = &sw->sbarHorz.scrollInfo;\n\tsi->cbSize = sizeof(SCROLLINFO);\n\tsi->fMask  = SIF_ALL;\n\tGetScrollInfo(hwnd, SB_HORZ, si);\n\n\tsi = &sw->sbarVert.scrollInfo;\n\tsi->cbSize = sizeof(SCROLLINFO);\n\tsi->fMask  = SIF_ALL;\n\tGetScrollInfo(hwnd, SB_VERT, si);\n\n\t//check to see if the window has left-aligned scrollbars\n\tif(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_LEFTSCROLLBAR)\n\t\tsw->fLeftScrollbar = TRUE;\n\telse\n\t\tsw->fLeftScrollbar = FALSE;\n\n\tdwCurStyle = GetWindowLong(hwnd, GWL_STYLE);\n\n\tSetProp(hwnd, szPropStr, (HANDLE)sw);\n\n\t//try to enable the scrollbar arrows - if the return value is\n\t//non-zero, then the scrollbars were previously disabled\n\t//fDisabled = pEnableScrollBar(hwnd, SB_HORZ, ESB_ENABLE_BOTH);\n\n\t//scrollbars will automatically get enabled, even if\n\t//they aren't to start with....sorry, but there isn't an\n\t//easy alternative.\n\tif(dwCurStyle & WS_HSCROLL)\n\t\tsw->sbarHorz.fScrollFlags = CSBS_VISIBLE;\n\n\tif(dwCurStyle & WS_VSCROLL)\n\t\tsw->sbarVert.fScrollFlags = CSBS_VISIBLE;\n\n\t//need to be able to distinguish between horizontal and vertical\n\t//scrollbars in some instances\n\tsw->sbarHorz.nBarType\t     = SB_HORZ;\n\tsw->sbarVert.nBarType\t     = SB_VERT;\n\n\tsw->sbarHorz.fFlatScrollbar  = CSBS_NORMAL;\n\tsw->sbarVert.fFlatScrollbar  = CSBS_NORMAL;\n\n\t//set the default arrow sizes for the scrollbars\n\tsw->sbarHorz.nArrowLength\t = SYSTEM_METRIC;\n\tsw->sbarHorz.nArrowWidth\t = SYSTEM_METRIC;\n\tsw->sbarVert.nArrowLength\t = SYSTEM_METRIC;\n\tsw->sbarVert.nArrowWidth\t = SYSTEM_METRIC;\n\n\tsw->bPreventStyleChange\t\t = FALSE;\n\t\n\tsw->oldproc = (WNDPROC)SetWindowLong(hwnd, GWL_WNDPROC, (LONG)CoolSBWndProc);\n\n\tCoolSB_SetMinThumbSize(hwnd, SB_BOTH, CoolSB_GetDefaultMinThumbSize());\n\n#ifdef COOLSB_TOOLTIPS\n\tice.dwSize = sizeof(ice);\n\tice.dwICC  = ICC_BAR_CLASSES;\n//\tInitCommonControlsEx(&ice);\t\t\t\tRemoved by SuperPat because of Linkage Error\n\n\tsw->hwndToolTip = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW, TOOLTIPS_CLASS, _T(\"\"),\n                            WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,\n                            CW_USEDEFAULT, CW_USEDEFAULT,\n                            CW_USEDEFAULT, CW_USEDEFAULT,\n                            hwnd, NULL, GetModuleHandle(0),\n                            NULL);\n\n\tti.cbSize = sizeof(TOOLINFO);\n\tti.uFlags = TTF_IDISHWND;\n\tti.hwnd   = hwnd;\n\tti.uId    = (UINT)hwnd;\n\tti.lpszText = LPSTR_TEXTCALLBACK;\n\tti.hinst   = GetModuleHandle(0);\n\n\tSendMessage(sw->hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);\n\t\n#else\n\n\tUNREFERENCED_PARAMETER(ice);\n\tUNREFERENCED_PARAMETER(ti);\n\tsw->hwndToolTip = 0;\n\n#endif\n\t\n\t//send the window a frame changed message to update the scrollbars\n\tRedrawNonClient(hwnd, TRUE);\n\n\treturn TRUE;\n}\n\nBOOL WINAPI CoolSB_EnableScrollBar\t(HWND hwnd, int wSBflags, UINT wArrows)\n{\n\tSCROLLBAR *sbar;\n\tUINT oldstate;\n\tBOOL bFailed = FALSE;\n\n\tif(!CoolSB_IsCoolScrollEnabled(hwnd))\n\t\treturn EnableScrollBar(hwnd, wSBflags, wArrows);\n\n\tif((wSBflags == SB_HORZ || wSBflags == SB_BOTH) && \n\t\t(sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))\n\t{\n\t\toldstate = sbar->fScrollFlags;\n\t\t\n\t\t//clear any existing state, and OR in the disabled flags\n\t\tsbar->fScrollFlags = (sbar->fScrollFlags & ~ESB_DISABLE_BOTH) | wArrows;\n\n\t\tif(oldstate == sbar->fScrollFlags)\n\t\t\tbFailed = TRUE;\n\n\t}\n\n\tif((wSBflags == SB_VERT || wSBflags == SB_BOTH) && \n\t\t(sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))\n\t{\n\t\toldstate = sbar->fScrollFlags;\n\t\t\n\t\t//clear any existing state, and OR in the disabled flags\n\t\tsbar->fScrollFlags = (sbar->fScrollFlags & ~ESB_DISABLE_BOTH) | wArrows;\n\n\t\tif(oldstate == sbar->fScrollFlags)\n\t\t\tbFailed = TRUE;\n\t}\n\n\treturn !bFailed;\n}\n\nBOOL WINAPI CoolSB_GetScrollBarInfo(HWND hwnd)\n{\n//\tSCROLLBARINFO sbi; not defined in winuser.h\n\treturn FALSE;\t\n}\n\nBOOL WINAPI CoolSB_GetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi)\n{\n\tSCROLLINFO *mysi;\n\tBOOL copied = FALSE;\n\t\n\tif(!lpsi)\n\t\treturn FALSE;\n\n\tif(!(mysi = GetScrollInfoFromHwnd(hwnd, fnBar)))\n\t{\n\t\treturn GetScrollInfo(hwnd, fnBar, lpsi);\n\t}\n\t\n\tif(lpsi->fMask & SIF_PAGE)\n\t{\n\t\tlpsi->nPage = mysi->nPage;\n\t\tcopied = TRUE;\n\t}\n\n\tif(lpsi->fMask & SIF_POS)\n\t{\n\t\tlpsi->nPos = mysi->nPos;\n\t\tcopied = TRUE;\n\t}\n\n\tif(lpsi->fMask & SIF_TRACKPOS)\n\t{\n\t\tlpsi->nTrackPos = mysi->nTrackPos;\n\t\tcopied = TRUE;\n\t}\n\n\tif(lpsi->fMask & SIF_RANGE)\n\t{\n\t\tlpsi->nMin = mysi->nMin;\n\t\tlpsi->nMax = mysi->nMax;\n\t\tcopied = TRUE;\n\t}\n\n\treturn copied;\n}\n\nint\tWINAPI CoolSB_GetScrollPos (HWND hwnd, int nBar)\n{\n\tSCROLLINFO *mysi;\n\t\n\tif(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))\n\t\treturn GetScrollPos(hwnd, nBar);\n\n\treturn mysi->nPos;\n}\n\nBOOL WINAPI CoolSB_GetScrollRange (HWND hwnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos)\n{\n\tSCROLLINFO *mysi;\n\t\n\tif(!lpMinPos || !lpMaxPos)\n\t\treturn FALSE;\n\n\tif(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))\n\t\treturn GetScrollRange(hwnd, nBar, lpMinPos, lpMaxPos);\n\n\t*lpMinPos = mysi->nMin;\n\t*lpMaxPos = mysi->nMax;\n\n\treturn TRUE;\n}\n\nint\tWINAPI CoolSB_SetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw)\n{\n\tSCROLLINFO *mysi;\n\tSCROLLBAR *sbar;\n\tBOOL       fRecalcFrame = FALSE;\n\n\tif(!lpsi)\n\t\treturn FALSE;\n\n\tif(!(mysi = GetScrollInfoFromHwnd(hwnd, fnBar)))\n\t\treturn SetScrollInfo(hwnd, fnBar, lpsi, fRedraw);\n\n\t//if(CoolSB_IsThumbTracking(hwnd))\n\t//\treturn mysi->nPos;\n\n\tif(lpsi->fMask & SIF_RANGE)\n\t{\n\t\tmysi->nMin = lpsi->nMin;\n\t\tmysi->nMax = lpsi->nMax;\n\t}\n\n\t//The nPage member must specify a value from 0 to nMax - nMin +1. \n\tif(lpsi->fMask & SIF_PAGE)\n\t{\n\t\tUINT t = (UINT)(mysi->nMax - mysi->nMin + 1);\n\t\tmysi->nPage = min(max(0, lpsi->nPage), t);\n\t}\n\n\t//The nPos member must specify a value between nMin and nMax - max(nPage - 1, 0).\n\tif(lpsi->fMask & SIF_POS)\n\t{\n\t\tmysi->nPos = max(lpsi->nPos, mysi->nMin);\n\t\tmysi->nPos = min((UINT)mysi->nPos, mysi->nMax - max(mysi->nPage - 1, 0));\n\t}\n\n\tsbar = GetScrollBarFromHwnd(hwnd, fnBar);\n\n\tif((lpsi->fMask & SIF_DISABLENOSCROLL) || (sbar->fScrollFlags & CSBS_THUMBALWAYS))\n\t{\n\t\tif(!sbar->fScrollVisible)\n\t\t{\n\t\t\tCoolSB_ShowScrollBar(hwnd, fnBar, TRUE);\n\t\t\tfRecalcFrame = TRUE;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(    mysi->nPage >  (UINT)mysi->nMax \n\t\t\t|| mysi->nPage == (UINT)mysi->nMax && mysi->nMax == 0\n\t\t\t|| mysi->nMax  <= mysi->nMin)\n\t\t{\n\t\t\tif(sbar->fScrollVisible)\n\t\t\t{\n\t\t\t\tCoolSB_ShowScrollBar(hwnd, fnBar, FALSE);\n\t\t\t\tfRecalcFrame = TRUE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!sbar->fScrollVisible)\n\t\t\t{\n\t\t\t\tCoolSB_ShowScrollBar(hwnd, fnBar, TRUE);\n\t\t\t\tfRecalcFrame = TRUE;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif(fRedraw && !CoolSB_IsThumbTracking(hwnd))\n\t\tRedrawNonClient(hwnd, fRecalcFrame);\n\t\n\treturn mysi->nPos;\n}\n\n\nint WINAPI CoolSB_SetScrollPos(HWND hwnd, int nBar, int nPos, BOOL fRedraw)\n{\n\tSCROLLINFO *mysi;\n\tint oldpos;\n\t\n\tif(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))\n\t{\n\t\treturn SetScrollPos(hwnd, nBar, nPos, fRedraw);\n\t}\n\n\t//this is what should happen, but real scrollbars don't work like this..\n\t//if(CoolSB_IsThumbTracking(hwnd))\n\t//\treturn mysi->nPos;\n\n\t//validate and set the scollbar position\n\toldpos = mysi->nPos;\n\tmysi->nPos = max(nPos, mysi->nMin);\n\tmysi->nPos = min((UINT)mysi->nPos, mysi->nMax - max(mysi->nPage - 1, 0));\n\n\tif(fRedraw && !CoolSB_IsThumbTracking(hwnd))\n\t\tRedrawNonClient(hwnd, FALSE);\n\n\treturn oldpos;\n}\n\nint WINAPI CoolSB_SetScrollRange (HWND hwnd, int nBar, int nMinPos, int nMaxPos, BOOL fRedraw)\n{\n\tSCROLLINFO *mysi;\n\t\n\tif(!(mysi = GetScrollInfoFromHwnd(hwnd, nBar)))\n\t\treturn SetScrollRange(hwnd, nBar, nMinPos, nMaxPos, fRedraw);\n\n\tif(CoolSB_IsThumbTracking(hwnd))\n\t\treturn mysi->nPos;\n\n\t//hide the scrollbar if nMin == nMax\n\t//nMax-nMin must not be greater than MAXLONG\n\tmysi->nMin = nMinPos;\n\tmysi->nMax = nMaxPos;\n\t\n\tif(fRedraw)\n\t\tRedrawNonClient(hwnd, FALSE);\n\n\treturn TRUE;\n}\n\n//\n//\tShow or hide the specified scrollbars\n//\nBOOL WINAPI CoolSB_ShowScrollBar (HWND hwnd, int wBar, BOOL fShow)\n{\n\tSCROLLBAR *sbar;\n\tBOOL bFailed = FALSE;\n\tDWORD dwStyle = GetWindowLong(hwnd, GWL_STYLE);\n\n\tif(!CoolSB_IsCoolScrollEnabled(hwnd))\n\t\treturn ShowScrollBar(hwnd, wBar, fShow);\n\n\tif((wBar == SB_HORZ || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))\n\t{\n\t\tsbar->fScrollFlags  =  sbar->fScrollFlags & ~CSBS_VISIBLE;\n\t\tsbar->fScrollFlags |= (fShow == TRUE ? CSBS_VISIBLE : 0);\n\t\t//bFailed = TRUE;\n\n\t\tif(fShow)\tSetWindowLong(hwnd, GWL_STYLE, dwStyle | WS_HSCROLL);\n\t\telse\t\tSetWindowLong(hwnd, GWL_STYLE, dwStyle & ~WS_HSCROLL);\n\t}\n\n\tif((wBar == SB_VERT || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))\n\t{\n\t\tsbar->fScrollFlags  =  sbar->fScrollFlags & ~CSBS_VISIBLE;\n\t\tsbar->fScrollFlags |= (fShow == TRUE ? CSBS_VISIBLE : 0);\n\t\t//bFailed = TRUE;\n\n\t\tif(fShow)\tSetWindowLong(hwnd, GWL_STYLE, dwStyle | WS_VSCROLL);\n\t\telse\t\tSetWindowLong(hwnd, GWL_STYLE, dwStyle & ~WS_VSCROLL);\n\t}\n\n\tif(bFailed)\n\t{\n\t\treturn FALSE;\n\t}\n\telse\n\t{\n\t\t//DWORD style = GetWindowLong(hwnd, GWL_STYLE);\n\t\t//style |= WS_VSCROLL;\n\t\t\n\t\t//if(s\n\t\t//SetWindowLong(hwnd, GWL_STYLE, style);\n\n\t\tSetWindowPos(hwnd, 0, 0, 0, 0, 0, \n\t\t\tSWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | \n\t\t\tSWP_NOACTIVATE | SWP_FRAMECHANGED);\n\t\t\n\t\treturn TRUE;\n\t}\n}\n\n//\n//\tRemove cool scrollbars from the specified window.\n//\nHRESULT WINAPI UninitializeCoolSB(HWND hwnd)\n{\n\tint i = 0;\n\tSCROLLWND *sw = GetScrollWndFromHwnd(hwnd);\n\tif(!sw) return E_FAIL;\n\n\t//restore the window procedure with the original one\n\tSetWindowLong(hwnd, GWL_WNDPROC, (LONG)sw->oldproc);\n\n\tRemoveProp(hwnd, szPropStr);\n\t//SetWindowLong(hwnd, GWL_USERDATA, 0);\n\n\t//finally, release the memory needed for the cool scrollbars\n\tHeapFree(GetProcessHeap(), 0, sw);\n\n    //Force WM_NCCALCSIZE and WM_NCPAINT so the original scrollbars can kick in\n    RedrawNonClient(hwnd, TRUE);\n\n\treturn S_OK;\n}\n\n#ifdef INCLUDE_BUTTONS\n\n//\n//\tCool scrollbar specific interface (BUTTON support)\n//\n\n//\n//\tInsert a button into the scrollbar area\n//\n//\twSBflags - SB_HORZ / SB_VERT only\n//\tuPos     - position into which to insert.\n//\t\t\t\tcan be 0 to insert at the start, or -1 to insert\n//\t\t\t\tat the end of previously inserted buttons\n//\n\nBOOL WINAPI CoolSB_InsertButton(HWND hwnd, int wSBflags, UINT nPos, SCROLLBUT *psb)\n{\n\tSCROLLBAR *sbar;\n\tSCROLLBUT *sbut;\n\tUINT i;\n\n\tif(!psb) return FALSE;\n\n\tif(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))\n\t\treturn FALSE;\n\t\n\t//check that we havn't reached the maximum allowed buttons yet\n\tif(sbar->nButtons == MAX_COOLSB_BUTS)\n\t\treturn FALSE;\n\n\t//insert at end\n\tif(nPos == -1)\n\t{\n\t\tsbut = &sbar->sbButtons[sbar->nButtons];\n\t}\n\t//otherwise, need to make room\n\telse if((int)nPos < 0 || (int)nPos > (UINT)sbar->nButtons)\n\t{\n\t\treturn FALSE;\n\t}\n\telse\n\t{\n\t\t//insert space for the button at the specified position\n\t\tfor(i = sbar->nButtons; i > nPos; i--)\n\t\t{\n\t\t\tsbar->sbButtons[i] = sbar->sbButtons[i-1];\n\t\t}\n\n\t\tsbut = &sbar->sbButtons[nPos];\n\t}\n\n\t//only set the button's properties if they are\n\t//specified by the SCROLLBUT->fMask. \n\t//Otherwise, use a default property value\n\n\tif(psb->fMask & SBBF_TYPE)\n\t\tsbut->uButType   = psb->uButType;\n\telse\n\t\tsbut->uButType\t = SBBT_PUSHBUTTON;\n\n\tif(psb->fMask & SBBF_STATE)\n\t\tsbut->uState\t = psb->uState;\n\telse\n\t\tsbut->uState\t = 0;\n\n\tif(psb->fMask & SBBF_ID)\n\t\tsbut->uCmdId     = psb->uCmdId;\n\telse\n\t\tsbut->uCmdId\t = 0;\n\n\tif(psb->fMask & SBBF_SIZE)\n\t\tsbut->nSize\t\t = psb->nSize;\n\telse\n\t\tsbut->nSize\t\t = -1;\n\n\tif(psb->fMask & SBBF_PLACEMENT)\n\t\tsbut->uPlacement = psb->uPlacement;\n\telse\n\t\tsbut->uPlacement = SBBP_LEFT;\n\n\tif(psb->fMask & SBBF_BITMAP)\n\t\tsbut->hBmp\t\t = psb->hBmp;\n\telse\n\t\tsbut->hBmp\t\t = 0;\n\n\tif(psb->fMask & SBBF_ENHMETAFILE)\n\t\tsbut->hEmf\t\t = psb->hEmf;\n\telse\n\t\tsbut->hEmf\t\t = 0;\n\n\tif(psb->fMask & SBBF_CURSOR)\n\t\tsbut->hCurs = psb->hCurs;\n\telse\n\t\tsbut->hCurs = 0;\n\n\t/*\n\t\tWe don't use the callback function anymore. The uButType\n\t\tmember must now specify SBBT_OWNERDRAW, and a WM_NOTIFY will\n\t\tbe sent when a button must be drawn\n\tif((psb->fMask & SBBF_OWNERDRAW) && ((psb->uButType & SBBT_MASK) == SBBT_OWNERDRAW))\n\t\tpDrawProc\t = psb->pDrawProc;\n\telse\n\t\tpDrawProc\t = 0;*/\n\n\tsbar->nButtons++;\n\tsbut->nSizeReserved = sbut->nSize;\n\n\t//MAKE SURE that any resizable buttons are only to the left / above\n\t//a scrollbar. We don't support resize operations to the right of a scrollbar\n\tif((sbut->uButType & SBBM_RESIZABLE) &&\tsbut->uPlacement == SBBP_RIGHT)\n\t\tsbut->uButType &= ~SBBM_RESIZABLE;\n\n\tif(psb->fMask & SBBF_BUTMINMAX)\n\t{\n\t\tsbut->nMinSize = psb->nMinSize;\n\t\tsbut->nMaxSize = psb->nMaxSize;\n\t}\n\telse\n\t{\n\t\tsbut->nMinSize = 0;\n\t\tsbut->nMaxSize = -1;\n\t}\n\n\treturn TRUE;\n}\n\nstatic SCROLLBUT *GetButtonFromId(SCROLLBAR *sbar, UINT uCmdId)\n{\n\tint i;\n\tfor(i = 0; i < sbar->nButtons; i++)\n\t{\n\t\tif(sbar->sbButtons[i].uCmdId == uCmdId)\n\t\t\treturn &sbar->sbButtons[i];\n\t}\n\n\treturn 0;\n}\n\n//\n//\tModify the properties of the specified scrollbar button.\n//\twSBflags - SB_HORZ / SB_VERT only\n//\tuItem    - the command identifier specified when the button was created,\n//\t\t\t   or a non-negative position of the button, depending on if\n//\t\t\t   fByCmd is FALSE or TRUE, respectively\n//\nBOOL WINAPI CoolSB_ModifyButton (HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, SCROLLBUT *psb)\n{\n\tSCROLLBAR *sbar;\n\tSCROLLBUT *sbut;\n\n\tif(!psb) return FALSE;\n\n\t//find if this window is CoolScroll enabled\n\tif(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))\n\t\treturn FALSE;\n\n\t//find the button to modify, depending on if we\n\t//are modifying by position or command id\n\tif(fByCmd == FALSE)\n\t{\n\t\t//button from position\n\t\tif((int)uItem < 0 || (int)uItem >= (UINT)sbar->nButtons)\n\t\t\treturn FALSE;\n\t\telse\n\t\t\tsbut = &sbar->sbButtons[uItem];\n\t}\n\telse if(fByCmd == TRUE)\n\t{\n\t\t//button from command identifier\n\t\tif(!(sbut = GetButtonFromId(sbar, uItem)))\n\t\t\treturn FALSE;\n\t}\n\n\tif(psb->fMask & SBBF_TYPE)\t\t\tsbut->uButType   = psb->uButType;\n\tif(psb->fMask & SBBF_STATE)\t\t\tsbut->uState\t = psb->uState;\n\tif(psb->fMask & SBBF_ID)\t\t\tsbut->uCmdId     = psb->uCmdId;\n\tif(psb->fMask & SBBF_SIZE)\t\t\tsbut->nSize\t\t = psb->nSize;\n\tif(psb->fMask & SBBF_PLACEMENT)\t\tsbut->uPlacement = psb->uPlacement;\n\tif(psb->fMask & SBBF_BITMAP)\t\tsbut->hBmp\t\t = psb->hBmp;\n\tif(psb->fMask & SBBF_ENHMETAFILE)\tsbut->hEmf\t\t = psb->hEmf;\n\tif(psb->fMask & SBBF_CURSOR)\t\tsbut->hCurs\t\t = psb->hCurs;\n\t\n\tif(psb->fMask & SBBF_BUTMINMAX)\n\t{\n\t\tsbut->nMinSize = psb->nMinSize;\n\t\tsbut->nMaxSize = psb->nMaxSize;\n\t}\n\n\treturn TRUE;\n}\n\nBOOL WINAPI CoolSB_RemoveButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd)\n{\n\tint i;\n\tSCROLLBAR *sbar;\n\n\t//find if this window is CoolScroll enabled\n\tif(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))\n\t\treturn FALSE;\n\n\t//find the button to modify, depending on if we\n\t//are modifying by position or command id\n\tif(fByCmd == FALSE && ((int)uItem < 0 || (int)uItem >= (UINT)sbar->nButtons))\n\t{\n\t\treturn FALSE;\n\t}\n\telse if(fByCmd == TRUE)\n\t{\n\t\t//find the button with the specified command id\n\t\tfor(i = 0; i < sbar->nButtons; i++)\n\t\t{\n\t\t\tif(sbar->sbButtons[i].uCmdId == uItem)\n\t\t\t{\n\t\t\t\t//change the id to an index\n\t\t\t\tuItem = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//if we failed to find the button...\n\t\tif(i == sbar->nButtons) return FALSE;\n\t}\n\n\t//remove the button!\n\tfor(i = uItem; i < sbar->nButtons - 1; i++)\n\t{\n\t\tsbar->sbButtons[i] = sbar->sbButtons[i+1];\n\t}\n\n\tsbar->nButtons--;\n\t\n\tRedrawNonClient(hwnd, TRUE);\n\n\treturn TRUE;\n}\n\n//\n//\tfill in the supplied SCROLLBUT structure\n//\nBOOL WINAPI CoolSB_GetButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, SCROLLBUT *psb)\n{\n\tSCROLLBAR *sbar;\n\tSCROLLBUT *sbut;\n\n\tif(!psb) return FALSE;\n\n\t//find if this window is CoolScroll enabled\n\tif(!(sbar = GetScrollBarFromHwnd(hwnd, wSBflags)))\n\t\treturn FALSE;\n\n\t//find the button to modify, depending on if we\n\t//are modifying by position or command id\n\tif(fByCmd == FALSE)\n\t{\n\t\t//button from position\n\t\tif((int)uItem < 0 || (int)uItem >= (UINT)sbar->nButtons)\n\t\t\treturn FALSE;\n\t\telse\n\t\t\tsbut = &sbar->sbButtons[uItem];\n\t}\n\telse if(fByCmd == TRUE)\n\t{\n\t\t//button from command identifier\n\t\tif(!(sbut = GetButtonFromId(sbar, uItem)))\n\t\t\treturn FALSE;\n\t}\n\n\t//copy them across\n\t*psb = *sbut;\n\n\treturn FALSE; \n}\n\n#else\n\nBOOL WINAPI CoolSB_InsertButton(HWND hwnd, int wSBflags, UINT nPos,  SCROLLBUT *psb)\t\t\t\t{\treturn FALSE; }\nBOOL WINAPI CoolSB_ModifyButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, SCROLLBUT *psb)\t{\treturn FALSE; }\nBOOL WINAPI CoolSB_RemoveButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd)\t\t\t\t\t{\treturn FALSE; }\nBOOL WINAPI CoolSB_GetButton   (HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, SCROLLBUT *psb)\t{\treturn FALSE; }\n\n#endif //INCLUDE_BUTTONS\n\n//\n//\tSet the size of the scrollbars\n//\nBOOL WINAPI CoolSB_SetSize\t(HWND hwnd, int wBar, int nLength, int nWidth)\n{\n\tSCROLLBAR *sbar;\n\t\n\tif(nLength == 0 || nWidth == 0)\n\t\treturn FALSE;\n\n\tif(nLength < -8 || nWidth < -8)\n\t\treturn FALSE;\n\n\tif(nLength > 256 || nWidth > 256)\n\t\treturn FALSE;\n\n\tif(!GetScrollWndFromHwnd(hwnd))\n\t\treturn FALSE;\n\n\tif((wBar == SB_HORZ || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))\n\t{\n\t\tsbar->nArrowLength = nLength;\n\t\tsbar->nArrowWidth  = nWidth;\n\t}\n\n\tif((wBar == SB_VERT || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))\n\t{\n\t\tsbar->nArrowLength = nLength;\n\t\tsbar->nArrowWidth  = nWidth;\n\t}\n\n\tRedrawNonClient(hwnd, TRUE);\n\n\treturn TRUE;\n}\n\n\n//\n//\tAlter the display mode of the scrollbars\n//\twBar   - SB_HORZ / SB_VERT / SB_BOTH\n//\tnStyle - CSBF_NORMAL / CSBF_FLAT / CSBF_HOTTRACKED\n//\nBOOL WINAPI CoolSB_SetStyle(HWND hwnd, int wBar, UINT nStyle)\n{\n\tSCROLLBAR *sbar;\n\n\tif(!GetScrollWndFromHwnd(hwnd))\n\t\treturn FALSE;\n\n\tif((wBar == SB_HORZ || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))\n\t{\n\t\tsbar->fFlatScrollbar = nStyle;\n\t}\n\n\tif((wBar == SB_VERT || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))\n\t{\n\t\tsbar->fFlatScrollbar = nStyle;\n\t}\n\n\tRedrawNonClient(hwnd, FALSE);\n\n\treturn TRUE;\n}\n\n//\n//\tSet if the thumb is always visible, even if there is no data to\n//  scroll. Setting this keeps the scrollbar enabled, but the thumb\n//  covers the whole area\n//\t\nBOOL WINAPI CoolSB_SetThumbAlways(HWND hwnd, int wBar, BOOL fThumbAlways)\n{\n\tSCROLLBAR *sbar;\n\n\tif(!GetScrollWndFromHwnd(hwnd))\n\t\treturn FALSE;\n\n\tif((wBar == SB_HORZ || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))\n\t{\n\t\tif(fThumbAlways)\n\t\t\tsbar->fScrollFlags |=  CSBS_THUMBALWAYS;\n\t\telse\n\t\t\tsbar->fScrollFlags &= ~CSBS_THUMBALWAYS;\n\t}\n\n\tif((wBar == SB_VERT || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))\n\t{\n\t\tif(fThumbAlways)\n\t\t\tsbar->fScrollFlags |=  CSBS_THUMBALWAYS;\n\t\telse\n\t\t\tsbar->fScrollFlags &= ~CSBS_THUMBALWAYS;\n\t}\n\n\tRedrawNonClient(hwnd, FALSE);\n\n\treturn TRUE;\n}\n\n//\n//\tSet the minimum size, in pixels, that the thumb box will shrink to.\n//\nBOOL WINAPI CoolSB_SetMinThumbSize(HWND hwnd, UINT wBar, UINT size)\n{\n\tSCROLLBAR *sbar;\n\n\tif(!GetScrollWndFromHwnd(hwnd))\n\t\treturn FALSE;\n\n\tif(size == -1)\n\t\tsize = CoolSB_GetDefaultMinThumbSize();\n\n\tif((wBar == SB_HORZ || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_HORZ)))\n\t{\n\t\tsbar->nMinThumbSize = size;\n\t}\n\n\tif((wBar == SB_VERT || wBar == SB_BOTH) && \n\t   (sbar = GetScrollBarFromHwnd(hwnd, SB_VERT)))\n\t{\n\t\tsbar->nMinThumbSize = size;\n\t}\n\n\treturn TRUE;\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolsblib.h",
    "content": "#ifndef _SUPERSCROLL_INCLUDED\n#define _SUPERSCROLL_INCLUDED\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\n#include <windows.h>\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolscroll.c",
    "content": "/*\n    Cool Scrollbar Library Version 1.2\n\n    Module: coolscroll.c\n\tCopyright (c) J Brown 2001\n\t  \n\tThis code is freeware, however, you may not publish\n\tthis code elsewhere or charge any money for it. This code\n\tis supplied as-is. I make no guarantees about the suitability\n\tof this code - use at your own risk.\n\t\n\tIt would be nice if you credited me, in the event\n\tthat you use this code in a product.\n\t\n\tVERSION HISTORY:\n\n\t V1.2: TreeView problem fixed by Diego Tartara\n\t\t   Small problem in thumbsize calculation also fixed (thanks Diego!)\n\n\t V1.1: Added support for Right-left windows\n\t       Changed calling convention of APIs to WINAPI (__stdcall)\n\t\t   Completely standalone (no need for c-runtime)\n\t\t   Now supports ALL windows with appropriate USER32.DLL patching\n\t\t    (you provide!!)\n\n\t V1.0: Apr 2001: Initial Version\n\n  IMPORTANT:\n\t This whole library is based around code for a horizontal scrollbar.\n\t All \"vertical\" scrollbar drawing / mouse interaction uses the\n\t horizontal scrollbar functions, but uses a trick to convert the vertical\n\t scrollbar coordinates into horizontal equivelants. When I started this project,\n\t I quickly realised that the code for horz/vert bars was IDENTICAL, apart\n\t from the fact that horizontal code uses left/right coords, and vertical code\n\t uses top/bottom coords. On entry to a \"vertical\" drawing function, for example,\n\t the coordinates are \"rotated\" before the horizontal function is called, and\n\t then rotated back once the function has completed. When something needs to\n\t be drawn, the coords are converted back again before drawing.\n\t \n     This trick greatly reduces the amount of code required, and makes\n\t maintanence much simpler. This way, only one function is needed to draw\n\t a scrollbar, but this can be used for both horizontal and vertical bars\n\t with careful thought.\n*/\n#define STRICT\n#define WIN32_LEAN_AND_MEAN\n\n#include <windows.h>\n#include <commctrl.h>\n#include <tchar.h>\n#include \"coolscroll.h\"\n#include \"userdefs.h\"\n#include \"coolsb_internal.h\"\n\n//define some values if the new version of common controls\n//is not available.\n#ifndef NM_CUSTOMDRAW\n#define NM_CUSTOMDRAW (NM_FIRST-12)\n#define CDRF_DODEFAULT\t\t0x0000\n#define CDRF_SKIPDEFAULT\t0x0004\n#define CDDS_PREPAINT\t\t0x0001\n#define CDDS_POSTPAINT\t\t0x0002\n#endif\n\n//\n//\tSpecial thumb-tracking variables\n//\n//\nstatic UINT uCurrentScrollbar = COOLSB_NONE;\t//SB_HORZ / SB_VERT\nstatic UINT uCurrentScrollPortion = HTSCROLL_NONE;\nstatic UINT uCurrentButton = 0;\n\nstatic RECT rcThumbBounds;\t\t//area that the scroll thumb can travel in\nstatic int  nThumbSize;\t\t\t//(pixels)\nstatic int  nThumbPos;\t\t\t//(pixels)\nstatic int  nThumbMouseOffset;\t//(pixels)\nstatic int  nLastPos = -1;\t\t//(scrollbar units)\nstatic int  nThumbPos0;\t\t\t//(pixels) initial thumb position\n\n//\n//\tTemporary state used to auto-generate timer messages\n//\nstatic UINT uMouseOverId = 0;\nstatic UINT uMouseOverScrollbar = COOLSB_NONE;\nstatic UINT uHitTestPortion = HTSCROLL_NONE;\nstatic UINT uLastHitTestPortion = HTSCROLL_NONE;\nstatic RECT MouseOverRect;\n\nstatic UINT uScrollTimerMsg = 0;\nstatic UINT uScrollTimerPortion = HTSCROLL_NONE;\nstatic UINT uScrollTimerId = 0;\nstatic HWND hwndCurCoolSB = 0;\n\n//\n//\tProvide this so there are NO dependencies on CRT\n//\nstatic void CoolSB_ZeroMemory(void *ptr, DWORD bytes)\n{\n\tBYTE *bptr = (BYTE *)ptr;\n\n\twhile(bytes--) *bptr++ = 0;\n}\n\nBOOL WINAPI CoolSB_IsThumbTracking(HWND hwnd)\t\n{ \n\tSCROLLWND *sw;\n\n\tif((sw = GetScrollWndFromHwnd(hwnd)) == NULL)\n\t\treturn FALSE;\n\telse\n\t\treturn sw->fThumbTracking; \n}\n\n//\n//\tswap the rectangle's x coords with its y coords\n//\nstatic void __stdcall RotateRect(RECT *rect)\n{\n\tint temp;\n\ttemp = rect->left;\n\trect->left = rect->top;\n\trect->top = temp;\n\n\ttemp = rect->right;\n\trect->right = rect->bottom;\n\trect->bottom = temp;\n}\n\n//\n//\tswap the coords if the scrollbar is a SB_VERT\n//\nstatic void __stdcall RotateRect0(SCROLLBAR *sb, RECT *rect)\n{\n\tif(sb->nBarType == SB_VERT)\n\t\tRotateRect(rect);\n}\n\n//\n//\tCalculate if the SCROLLINFO members produce\n//  an enabled or disabled scrollbar\n//\nstatic BOOL IsScrollInfoActive(SCROLLINFO *si)\n{\n\tif((si->nPage > (UINT)si->nMax\n\t\t|| si->nMax <= si->nMin || si->nMax == 0))\n\t\treturn FALSE;\n\telse\n\t\treturn TRUE;\n}\n\n//\n//\tReturn if the specified scrollbar is enabled or not\n//\nstatic BOOL IsScrollbarActive(SCROLLBAR *sb)\n{\n\tSCROLLINFO *si = &sb->scrollInfo;\n\tif(((sb->fScrollFlags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) ||\n\t\t!(sb->fScrollFlags & CSBS_THUMBALWAYS) && !IsScrollInfoActive(si))\n\t\treturn FALSE;\n\telse\n\t\treturn TRUE;\n}\n\n//\n//\tDraw a standard scrollbar arrow\n//\nstatic int DrawScrollArrow(SCROLLBAR *sbar, HDC hdc, RECT *rect, UINT arrow, BOOL fMouseDown, BOOL fMouseOver)\n{\n\tUINT ret;\n\tUINT flags = arrow;\n\n\t//HACKY bit so this routine can be called by vertical and horizontal code\n\tif(sbar->nBarType == SB_VERT)\n\t{\n\t\tif(flags & DFCS_SCROLLLEFT)\t\tflags = flags & ~DFCS_SCROLLLEFT  | DFCS_SCROLLUP;\n\t\tif(flags & DFCS_SCROLLRIGHT)\tflags = flags & ~DFCS_SCROLLRIGHT | DFCS_SCROLLDOWN;\n\t}\n\n\tif(fMouseDown) flags |= (DFCS_FLAT | DFCS_PUSHED);\n\n#ifdef FLAT_SCROLLBARS\n\tif(sbar->fFlatScrollbar != CSBS_NORMAL)\n\t{\n\t\tHDC hdcmem1, hdcmem2;\n\t\tHBITMAP hbm1, oldbm1;\n\t\tHBITMAP hbm2, oldbm2;\n\t\tRECT rc;\n\t\tint width, height;\n\n\t\trc = *rect;\n\t\twidth  = rc.right-rc.left;\n\t\theight = rc.bottom-rc.top;\n\t\tSetRect(&rc, 0, 0, width, height);\n\n\t\t//MONOCHROME bitmap to convert the arrow to black/white mask\n\t\thdcmem1 = CreateCompatibleDC(hdc);\n\t\thbm1    = CreateBitmap(width, height, 1, 1, NULL);\n\t\tUnrealizeObject(hbm1);\n\t\toldbm1  = SelectObject(hdcmem1, hbm1);\n\t\t\n\n\t\t//NORMAL bitmap to draw the arrow into\n\t\thdcmem2 = CreateCompatibleDC(hdc);\n\t\thbm2    = CreateCompatibleBitmap(hdc, width, height);\n\t\tUnrealizeObject(hbm2);\n\t\toldbm2  = SelectObject(hdcmem2, hbm2);\n\t\t\n\n\t\tflags = flags & ~DFCS_PUSHED | DFCS_FLAT;\t//just in case\n\t\tDrawFrameControl(hdcmem2, &rc, DFC_SCROLL, flags);\n\n\n#ifndef HOT_TRACKING\n\t\tif(fMouseDown)\n\t\t{\n\t\t\t//uncomment these to make the cool scrollbars\n\t\t\t//look like the common controls flat scrollbars\n\t\t\t//fMouseDown = FALSE;\n\t\t\t//fMouseOver = TRUE;\n\t\t}\n#endif\n\t\t//draw a flat monochrome version of a scrollbar arrow (dark)\n\t\tif(fMouseDown)\n\t\t{\n\t\t\tSetBkColor(hdcmem2, GetSysColor(COLOR_BTNTEXT));\n\t\t\tBitBlt(hdcmem1, 0, 0, width, height, hdcmem2, 0, 0, SRCCOPY);\n\t\t\tSetBkColor(hdc, 0x00ffffff);\n\t\t\tSetTextColor(hdc, GetSysColor(COLOR_3DDKSHADOW));\n\t\t\tBitBlt(hdc, rect->left, rect->top, width, height, hdcmem1, 0, 0, SRCCOPY);\n\t\t}\n\t\t//draw a flat monochrome version of a scrollbar arrow (grey)\n\t\telse if(fMouseOver)\n\t\t{\n\t\t\tSetBkColor(hdcmem2, GetSysColor(COLOR_BTNTEXT));\n\t\t\tFillRect(hdcmem1, &rc, GetStockObject(WHITE_BRUSH));\n\t\t\tBitBlt(hdcmem1, 0, 0, width, height, hdcmem2, 0, 0, SRCINVERT);\n\n\t\t\tSetBkColor(hdc, GetSysColor(COLOR_3DSHADOW));\n\t\t\tSetTextColor(hdc, 0x00ffffff);\n\t\t\tBitBlt(hdc, rect->left, rect->top, width, height, hdcmem1, 0, 0, SRCCOPY);\n\t\t}\n\t\t//draw the arrow normally\n\t\telse\n\t\t{\n\t\t\tBitBlt(hdc, rect->left, rect->top, width, height, hdcmem2, 0, 0, SRCCOPY);\n\t\t}\n\n\t\tSelectObject(hdcmem1, oldbm1);\n\t\tSelectObject(hdcmem2, oldbm2);\n\t\tDeleteObject(hbm1);\n\t\tDeleteObject(hbm2);\n\t\tDeleteDC(hdcmem1);\n\t\tDeleteDC(hdcmem2);\n\n\t\tret = 0;\n\t}\n\telse\n#endif\n\tret = DrawFrameControl(hdc, rect, DFC_SCROLL, flags);\n\n\treturn ret;\n}\n\n//\n//\tReturn the size in pixels for the specified scrollbar metric,\n//  for the specified scrollbar\n//\nstatic int GetScrollMetric(SCROLLBAR *sbar, int metric)\n{\n\tif(sbar->nBarType == SB_HORZ)\n\t{\n\t\tif(metric == SM_CXHORZSB)\n\t\t{\n\t\t\tif(sbar->nArrowLength < 0)\n\t\t\t\treturn -sbar->nArrowLength * GetSystemMetrics(SM_CXHSCROLL);\n\t\t\telse\n\t\t\t\treturn sbar->nArrowLength;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(sbar->nArrowWidth < 0)\n\t\t\t\treturn -sbar->nArrowWidth * GetSystemMetrics(SM_CYHSCROLL);\n\t\t\telse\n\t\t\t\treturn sbar->nArrowWidth;\n\t\t}\n\t}\n\telse if(sbar->nBarType == SB_VERT)\n\t{\n\t\tif(metric == SM_CYVERTSB)\n\t\t{\n\t\t\tif(sbar->nArrowLength < 0)\n\t\t\t\treturn -sbar->nArrowLength * GetSystemMetrics(SM_CYVSCROLL);\n\t\t\telse\n\t\t\t\treturn sbar->nArrowLength;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(sbar->nArrowWidth < 0)\n\t\t\t\treturn -sbar->nArrowWidth * GetSystemMetrics(SM_CXVSCROLL);\n\t\t\telse\n\t\t\t\treturn sbar->nArrowWidth;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\n//\n//\t\n//\nstatic COLORREF GetSBForeColor(void)\n{\n\tCOLORREF c1 = GetSysColor(COLOR_3DHILIGHT);\n\tCOLORREF c2 = GetSysColor(COLOR_WINDOW);\n\n\tif(c1 != 0xffffff && c1 == c2)\n\t{\n\t\treturn GetSysColor(COLOR_BTNFACE);\n\t}\n\telse\n\t{\n\t\treturn GetSysColor(COLOR_3DHILIGHT);\n\t}\n}\n\nstatic COLORREF GetSBBackColor(void)\n{\n\treturn GetSysColor(COLOR_SCROLLBAR);\n}\n\n//\n//\tPaint a checkered rectangle, with each alternate\n//\tpixel being assigned a different colour\n//\nstatic void DrawCheckedRect(HDC hdc, RECT *rect, COLORREF fg, COLORREF bg)\n{\n\tstatic WORD wCheckPat[8] = \n\t{ \n\t\t0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555 \n\t};\n\n\tHBITMAP hbmp;\n\tHBRUSH  hbr, hbrold;\n\tCOLORREF fgold, bgold;\n\n\thbmp = CreateBitmap(8, 8, 1, 1, wCheckPat);\n\thbr  = CreatePatternBrush(hbmp);\n\n\tUnrealizeObject(hbr);\n\tSetBrushOrgEx(hdc, rect->left, rect->top, 0);\n\n\thbrold = (HBRUSH)SelectObject(hdc, hbr);\n\n\tfgold = SetTextColor(hdc, fg);\n\tbgold = SetBkColor(hdc, bg);\n\t\n\tPatBlt(hdc, rect->left, rect->top, \n\t\t\t\trect->right - rect->left, \n\t\t\t\trect->bottom - rect->top, \n\t\t\t\tPATCOPY);\n\t\n\tSetBkColor(hdc, bgold);\n\tSetTextColor(hdc, fgold);\n\t\n\tSelectObject(hdc, hbrold);\n\tDeleteObject(hbr);\n\tDeleteObject(hbmp);\n}\n\n//\n//\tFill the specifed rectangle using a solid colour\n//\nstatic void PaintRect(HDC hdc, RECT *rect, COLORREF color)\n{\n\tCOLORREF oldcol = SetBkColor(hdc, color);\n\tExtTextOut(hdc, 0, 0, ETO_OPAQUE, rect, _T(\"\"), 0, 0);\n\tSetBkColor(hdc, oldcol);\n}\n\n//\n//\tDraw a simple blank scrollbar push-button. Can be used\n//\tto draw a push button, or the scrollbar thumb\n//\tdrawflag - could set to BF_FLAT to make flat scrollbars\n//\nvoid DrawBlankButton(HDC hdc, const RECT *rect, UINT drawflag)\n{\n\tRECT rc = *rect;\n\t\t\n#ifndef FLAT_SCROLLBARS\t\n\tdrawflag &= ~BF_FLAT;\n#endif\n\t\n\tDrawEdge(hdc, &rc, EDGE_RAISED, BF_RECT | drawflag | BF_ADJUST);\n\tFillRect(hdc, &rc, GetSysColorBrush(COLOR_BTNFACE));\n}\n\n//\n//\tSend a WM_VSCROLL or WM_HSCROLL message\n//\nstatic void SendScrollMessage(HWND hwnd, UINT scrMsg, UINT scrId, UINT pos)\n{\n\tSendMessage(hwnd, scrMsg, MAKEWPARAM(scrId, pos), 0);\n}\n\n//\n//\tCalculate the screen coordinates of the area taken by\n//  the horizontal scrollbar. Take into account the size\n//  of the window borders\n//\nstatic BOOL GetHScrollRect(SCROLLWND *sw, HWND hwnd, RECT *rect)\n{\n\tGetWindowRect(hwnd, rect);\n\t\n\tif(sw->fLeftScrollbar)\n\t{\n\t\trect->left  += sw->cxLeftEdge + (sw->sbarVert.fScrollVisible ? \n\t\t\t\t\tGetScrollMetric(&sw->sbarVert, SM_CXVERTSB) : 0);\n\t\trect->right -= sw->cxRightEdge;\n\t}\n\telse\n\t{\n\t\trect->left   += sw->cxLeftEdge;\t\t\t\t\t//left window edge\n\t\n\t\trect->right  -= sw->cxRightEdge +\t\t\t\t//right window edge\n\t\t\t\t\t(sw->sbarVert.fScrollVisible ? \n\t\t\t\t\tGetScrollMetric(&sw->sbarVert, SM_CXVERTSB) : 0);\n\t}\n\t\n\trect->bottom -= sw->cyBottomEdge;\t\t\t\t//bottom window edge\n\t\n\trect->top\t  = rect->bottom -\n\t\t\t\t\t(sw->sbarHorz.fScrollVisible ?\n\t\t\t\t\tGetScrollMetric(&sw->sbarHorz, SM_CYHORZSB) : 0);\n\t\n\treturn TRUE;\n}\n\n//\n//\tCalculate the screen coordinates of the area taken by the\n//  vertical scrollbar\n//\nstatic BOOL GetVScrollRect(SCROLLWND *sw, HWND hwnd, RECT *rect)\n{\n\tGetWindowRect(hwnd, rect);\n\trect->top\t += sw->cyTopEdge;\t\t\t\t\t\t//top window edge\n\t\n\trect->bottom -= sw->cyBottomEdge + \n\t\t\t\t\t(sw->sbarHorz.fScrollVisible ?\t\t//bottom window edge\n\t\t\t\t\tGetScrollMetric(&sw->sbarHorz, SM_CYHORZSB) : 0);\n\n\tif(sw->fLeftScrollbar)\n\t{\n\t\trect->left\t+= sw->cxLeftEdge;\n\t\trect->right = rect->left + (sw->sbarVert.fScrollVisible ?\n\t\t\t\t\tGetScrollMetric(&sw->sbarVert, SM_CXVERTSB) : 0);\n\t}\n\telse\n\t{\n\t\trect->right  -= sw->cxRightEdge;\n\t\trect->left    = rect->right - (sw->sbarVert.fScrollVisible ?\t\n\t\t\t\t\tGetScrollMetric(&sw->sbarVert, SM_CXVERTSB) : 0);\n\t}\n\n\treturn TRUE;\n}\n\n//\tDepending on what type of scrollbar nBar refers to, call the\n//  appropriate Get?ScrollRect function\n//\nBOOL GetScrollRect(SCROLLWND *sw, UINT nBar, HWND hwnd, RECT *rect)\n{\n\tif(nBar == SB_HORZ)\n\t\treturn GetHScrollRect(sw, hwnd, rect);\n\telse if(nBar == SB_VERT)\n\t\treturn GetVScrollRect(sw, hwnd, rect);\n\telse\n\t\treturn FALSE;\n}\n\n//\n//\tThis code is a prime candidate for splitting out into a separate\n//  file at some stage\n//\n#ifdef INCLUDE_BUTTONS\n\n//\n//\tCalculate the size in pixels of the specified button\n//\nstatic int GetSingleButSize(SCROLLBAR *sbar, SCROLLBUT *sbut)\n{\n\t//multiple of the system button size\n\t//or a specific button size\n\tif(sbut->nSize < 0)\n\t{\n\t\tif(sbar->nBarType == SB_HORZ)\n\t\t\treturn -sbut->nSize * GetSystemMetrics(SM_CXHSCROLL);\n\t\telse \n\t\t\treturn -sbut->nSize * GetSystemMetrics(SM_CYVSCROLL);\n\t}\n\telse\n\t\treturn  sbut->nSize;\n}\n\n//\n//\tFind the size in pixels of all the inserted buttons,\n//\teither before or after the specified scrollbar\n//\nstatic int GetButtonSize(SCROLLBAR *sbar, HWND hwnd, UINT uBeforeAfter)\n{\n\tint i;\n\tint nPixels = 0;\n\n\tSCROLLBUT *sbut = sbar->sbButtons;\n\t\n\tfor(i = 0; i < sbar->nButtons; i++)\n\t{\n\t\t//only consider those buttons on the same side as nTopBottom says\n\t\tif(sbut[i].uPlacement == uBeforeAfter)\n\t\t{\n\t\t\tnPixels += GetSingleButSize(sbar, &sbut[i]);\n\t\t}\n\t}\n\n\treturn nPixels;\n}\n#endif //INCLUDE_BUTTONS\n\n//\n//\tWork out the scrollbar width/height for either type of scrollbar (SB_HORZ/SB_VERT)\n//\trect - coords of the scrollbar.\n//\tstore results into *thumbsize and *thumbpos\n//\nstatic int CalcThumbSize(SCROLLBAR *sbar, const RECT *rect, int *pthumbsize, int *pthumbpos)\n{\n\tSCROLLINFO *si;\n\tint scrollsize;\t\t\t//total size of the scrollbar including arrow buttons\n\tint workingsize;\t\t//working area (where the thumb can slide)\n\tint siMaxMin;\n\tint butsize;\n\tint startcoord;\n\tint thumbpos = 0, thumbsize = 0;\n\n\tint adjust=0;\n\tstatic int count=0;\n\n\t//work out the width (for a horizontal) or the height (for a vertical)\n\t//of a standard scrollbar button\n\tbutsize = GetScrollMetric(sbar, SM_SCROLL_LENGTH);\n\n\tif(1) //sbar->nBarType == SB_HORZ)\n\t{\n\t\tscrollsize = rect->right - rect->left;\n\t\tstartcoord = rect->left;\n\t}\n\t/*else if(sbar->nBarType == SB_VERT)\n\t{\n\t\tscrollsize = rect->bottom - rect->top;\n\t\tstartcoord = rect->top;\n\t}\n\telse\n\t{\n\t\treturn 0;\n\t}*/\n\n\tsi = &sbar->scrollInfo;\n\tsiMaxMin = si->nMax - si->nMin + 1;\n\tworkingsize = scrollsize - butsize * 2;\n\n\t//\n\t// Work out the scrollbar thumb SIZE\n\t//\n\tif(si->nPage == 0)\n\t{\n\t\tthumbsize = butsize;\n\t}\n\telse if(siMaxMin > 0)\n\t{\n\t\tthumbsize = MulDiv(si->nPage, workingsize, siMaxMin);\n\n\t\tif(thumbsize < sbar->nMinThumbSize)\n\t\t\tthumbsize = sbar->nMinThumbSize;\n\t}\n\n\t//\n\t// Work out the scrollbar thumb position\n\t//\n\tif(siMaxMin > 0)\n\t{\n\t\tint pagesize = max(1, si->nPage);\n\t\tthumbpos = MulDiv(si->nPos - si->nMin, workingsize-thumbsize, siMaxMin - pagesize);\n\t\t\n\t\tif(thumbpos < 0)\t\t\t\t\t\t\n\t\t\tthumbpos = 0;\n\n\t\tif(thumbpos >= workingsize-thumbsize)\t\n\t\t\tthumbpos = workingsize-thumbsize;\n\t}\n\n\tthumbpos += startcoord + butsize;\n\n\t*pthumbpos  = thumbpos;\n\t*pthumbsize = thumbsize;\n\n\treturn 1;\n}\n\n//\n//\treturn a hit-test value for whatever part of the scrollbar x,y is located in\n//\trect, x, y: SCREEN coordinates\n//\tthe rectangle must not include space for any inserted buttons \n//\t(i.e, JUST the scrollbar area)\n//\nstatic UINT GetHorzScrollPortion(SCROLLBAR *sbar, HWND hwnd, const RECT *rect, int x, int y)\n{\n\tint thumbwidth, thumbpos;\n\tint butwidth = GetScrollMetric(sbar, SM_SCROLL_LENGTH);\n\tint scrollwidth  = rect->right-rect->left;\n\tint workingwidth = scrollwidth - butwidth*2;\n\n\tif(y < rect->top || y >= rect->bottom)\n\t\treturn HTSCROLL_NONE;\n\n\tCalcThumbSize(sbar, rect, &thumbwidth, &thumbpos);\n\n\t//if we have had to scale the buttons to fit in the rect,\n\t//then adjust the button width accordingly\n\tif(scrollwidth <= butwidth * 2)\n\t{\n\t\tbutwidth = scrollwidth / 2;\t\n\t}\n\n\t//check for left button click\n\tif(x >= rect->left && x < rect->left + butwidth)\n\t{\n\t\treturn HTSCROLL_LEFT;\t\n\t}\n\t//check for right button click\n\telse if(x >= rect->right-butwidth && x < rect->right)\n\t{\n\t\treturn HTSCROLL_RIGHT;\n\t}\n\t\n\t//if the thumb is too big to fit (i.e. it isn't visible)\n\t//then return a NULL scrollbar area\n\tif(thumbwidth >= workingwidth)\n\t\treturn HTSCROLL_NONE;\n\t\n\t//check for point in the thumbbar\n\tif(x >= thumbpos && x < thumbpos+thumbwidth)\n\t{\n\t\treturn HTSCROLL_THUMB;\n\t}\t\n\t//check for left margin\n\telse if(x >= rect->left+butwidth && x < thumbpos)\n\t{\n\t\treturn HTSCROLL_PAGELEFT;\n\t}\n\telse if(x >= thumbpos+thumbwidth && x < rect->right-butwidth)\n\t{\n\t\treturn HTSCROLL_PAGERIGHT;\n\t}\n\t\n\treturn HTSCROLL_NONE;\n}\n\n//\n//\tFor vertical scrollbars, rotate all coordinates by -90 degrees\n//\tso that we can use the horizontal version of this function\n//\nstatic UINT GetVertScrollPortion(SCROLLBAR *sb, HWND hwnd, RECT *rect, int x, int y)\n{\n\tUINT r;\n\t\n\tRotateRect(rect);\n\tr = GetHorzScrollPortion(sb, hwnd, rect, y, x);\n\tRotateRect(rect);\n\treturn r;\n}\n\n//\n//\tCUSTOM DRAW support\n//\t\nstatic LRESULT PostCustomPrePostPaint0(HWND hwnd, HDC hdc, SCROLLBAR *sb, UINT dwStage)\n{\n#ifdef CUSTOM_DRAW\n\tNMCSBCUSTOMDRAW\tnmcd;\n\n\tCoolSB_ZeroMemory(&nmcd, sizeof nmcd);\n\tnmcd.hdr.hwndFrom = hwnd;\n\tnmcd.hdr.idFrom   = GetWindowLong(hwnd, GWL_ID);\n\tnmcd.hdr.code     = NM_COOLSB_CUSTOMDRAW;\n\tnmcd.nBar\t\t  = sb->nBarType;\n\tnmcd.dwDrawStage  = dwStage;\n\tnmcd.hdc\t\t  = hdc;\n\n\thwnd = GetParent(hwnd);\n\treturn SendMessage(hwnd, WM_NOTIFY, 0, (LPARAM)&nmcd);\n#else\n\treturn 0;\n#endif\n}\n\nstatic LRESULT PostCustomDrawNotify0(HWND hwnd, HDC hdc, UINT nBar, RECT *prect, UINT nItem, BOOL fMouseDown, BOOL fMouseOver, BOOL fInactive)\n{\n#ifdef CUSTOM_DRAW\n\tNMCSBCUSTOMDRAW\tnmcd;\n\n\t//fill in the standard header\n\tnmcd.hdr.hwndFrom = hwnd;\n\tnmcd.hdr.idFrom   = GetWindowLong(hwnd, GWL_ID);\n\tnmcd.hdr.code     = NM_COOLSB_CUSTOMDRAW;\n\n\tnmcd.dwDrawStage  = CDDS_ITEMPREPAINT;\n\tnmcd.nBar\t\t  = nBar;\n\tnmcd.rect\t\t  = *prect;\n\tnmcd.uItem\t\t  = nItem;\n\tnmcd.hdc\t\t  = hdc;\n\n\tif(fMouseDown) \n\t\tnmcd.uState\t\t  = CDIS_SELECTED;\n\telse if(fMouseOver)\n\t\tnmcd.uState\t\t  = CDIS_HOT;\n\telse if(fInactive)\n\t\tnmcd.uState\t\t  = CDIS_DISABLED;\n\telse\n\t\tnmcd.uState\t\t  = CDIS_DEFAULT;\n\n\thwnd = GetParent(hwnd);\n\treturn SendMessage(hwnd, WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd);\n#else\n\treturn 0;\n#endif\n}\n\n// Depending on if we are supporting custom draw, either define\n// a macro to the function name, or to nothing at all. If custom draw\n// is turned off, then we can save ALOT of code space by binning all \n// calls to the custom draw support.\n//\n#ifdef CUSTOM_DRAW\n#define PostCustomDrawNotify\tPostCustomDrawNotify0\n#define PostCustomPrePostPaint\tPostCustomPrePostPaint0\n#else\n#define PostCustomDrawNotify\t1 ? (void)0 : PostCustomDrawNotify0\n#define PostCustomPrePostPaint\t1 ? (void)0 : PostCustomPrePostPaint0\n#endif\n\nstatic LRESULT PostMouseNotify0(HWND hwnd, UINT msg, UINT nBar, RECT *prect, UINT nCmdId, POINT pt)\n{\n#ifdef NOTIFY_MOUSE\n\tNMCOOLBUTMSG\tnmcb;\n\n\t//fill in the standard header\n\tnmcb.hdr.hwndFrom\t= hwnd;\n\tnmcb.hdr.idFrom\t\t= GetWindowLong(hwnd, GWL_ID);\n\tnmcb.hdr.code\t\t= NM_CLICK;\n\n\tnmcb.nBar\t\t\t= nBar;\n\tnmcb.uCmdId\t\t\t= nCmdId;\n\tnmcb.uState\t\t\t= 0;\n\tnmcb.rect\t\t\t= *prect;\n\tnmcb.pt\t\t\t\t= pt;\n\n\thwnd = GetParent(hwnd);\n\treturn SendMessage(hwnd, WM_NOTIFY, nmcb.hdr.idFrom, (LPARAM)&nmcb);\n#else\n\treturn 0;\n#endif\n}\n\n#ifdef NOTIFY_MOUSE\n#define PostMouseNotify\t\t\tPostMouseNotify0\n#else\n#define PostMouseNotify\t\t\t1 ? (void)0 : PostMouseNotify0\n#endif\n\n\n\n//\n//\tDraw a complete HORIZONTAL scrollbar in the given rectangle\n//\tDon't draw any inserted buttons in this procedure\n//\t\n//\tuDrawFlags - hittest code, to say if to draw the\n//  specified portion in an active state or not.\n//\n//\nstatic LRESULT NCDrawHScrollbar(SCROLLBAR *sb, HWND hwnd, HDC hdc, const RECT *rect, UINT uDrawFlags)\n{\n\tSCROLLINFO *si;\n\tRECT ctrl, thumb;\n\tRECT sbm;\n\tint butwidth\t = GetScrollMetric(sb, SM_SCROLL_LENGTH);\n\tint scrollwidth  = rect->right-rect->left;\n\tint workingwidth = scrollwidth - butwidth*2;\n\tint thumbwidth   = 0, thumbpos = 0;\n\tint siMaxMin;\n\n\tBOOL fCustomDraw = 0;\n\n\tBOOL fMouseDownL = 0, fMouseOverL = 0, fBarHot = 0;\n\tBOOL fMouseDownR = 0, fMouseOverR = 0;\n\n\tCOLORREF crCheck1   = GetSBForeColor();\n\tCOLORREF crCheck2   = GetSBBackColor();\n\tCOLORREF crInverse1 = InvertCOLORREF(crCheck1);\n\tCOLORREF crInverse2 = InvertCOLORREF(crCheck2);\n\n\tUINT uDFCFlat = sb->fFlatScrollbar ? DFCS_FLAT : 0;\n\tUINT uDEFlat  = sb->fFlatScrollbar ? BF_FLAT   : 0;\n\n\t//drawing flags to modify the appearance of the scrollbar buttons\n\tUINT uLeftButFlags  = DFCS_SCROLLLEFT;\n\tUINT uRightButFlags = DFCS_SCROLLRIGHT;\n\n\tif(scrollwidth <= 0)\n\t\treturn 0;\n\n\tsi = &sb->scrollInfo;\n\tsiMaxMin = si->nMax - si->nMin;\n\n\tif(hwnd != hwndCurCoolSB)\n\t\tuDrawFlags = HTSCROLL_NONE;\n\t//\n\t// work out the thumb size and position\n\t//\n\tCalcThumbSize(sb, rect, &thumbwidth, &thumbpos);\n\t\n\tif(sb->fScrollFlags & ESB_DISABLE_LEFT)\t\tuLeftButFlags  |= DFCS_INACTIVE;\n\tif(sb->fScrollFlags & ESB_DISABLE_RIGHT)\tuRightButFlags |= DFCS_INACTIVE;\n\n\t//if we need to grey the arrows because there is no data to scroll\n\tif(!IsScrollInfoActive(si) && !(sb->fScrollFlags & CSBS_THUMBALWAYS))\n\t{\n\t\tuLeftButFlags  |= DFCS_INACTIVE;\n\t\tuRightButFlags |= DFCS_INACTIVE;\n\t}\n\n\tif(hwnd == hwndCurCoolSB)\n\t{\n#ifdef FLAT_SCROLLBARS\t\n\t\tBOOL ldis = !(uLeftButFlags & DFCS_INACTIVE);\n\t\tBOOL rdis = !(uRightButFlags & DFCS_INACTIVE);\n\n\t\tfBarHot = (sb->nBarType == (int)uMouseOverScrollbar && sb->fFlatScrollbar == CSBS_HOTTRACKED);\n\t\t\n\t\tfMouseOverL = uHitTestPortion == HTSCROLL_LEFT && fBarHot && ldis;\t\t\n\t\tfMouseOverR = uHitTestPortion == HTSCROLL_RIGHT && fBarHot && rdis;\n#endif\n\t\tfMouseDownL = (uDrawFlags == HTSCROLL_LEFT);\n\t\tfMouseDownR = (uDrawFlags == HTSCROLL_RIGHT);\n\t}\n\n\n#ifdef CUSTOM_DRAW\n\tfCustomDraw = ((PostCustomPrePostPaint(hwnd, hdc, sb, CDDS_PREPAINT)) == CDRF_SKIPDEFAULT);\n#endif\n\n\t//\n\t// Draw the scrollbar now\n\t//\n\tif(scrollwidth > butwidth*2)\n\t{\n\t\t//LEFT ARROW\n\t\tSetRect(&ctrl, rect->left, rect->top, rect->left + butwidth, rect->bottom);\n\n\t\tRotateRect0(sb, &ctrl);\n\n\t\tif(fCustomDraw)\n\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_LINELEFT, fMouseDownL, fMouseOverL, uLeftButFlags & DFCS_INACTIVE);\n\t\telse\n\t\t\tDrawScrollArrow(sb, hdc, &ctrl, uLeftButFlags, fMouseDownL, fMouseOverL);\n\n\t\tRotateRect0(sb, &ctrl);\n\n\t\t//MIDDLE PORTION\n\t\t//if we can fit the thumbbar in, then draw it\n\t\tif(thumbwidth > 0 && thumbwidth <= workingwidth\n\t\t\t&& IsScrollInfoActive(si) && ((sb->fScrollFlags & ESB_DISABLE_BOTH) != ESB_DISABLE_BOTH))\n\t\t{\t\n\t\t\t//Draw the scrollbar margin above the thumb\n\t\t\tSetRect(&sbm, rect->left + butwidth, rect->top, thumbpos, rect->bottom);\n\t\t\t\n\t\t\tRotateRect0(sb, &sbm);\n\t\t\t\n\t\t\tif(fCustomDraw)\n\t\t\t{\n\t\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &sbm, SB_PAGELEFT, uDrawFlags == HTSCROLL_PAGELEFT, FALSE, FALSE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(uDrawFlags == HTSCROLL_PAGELEFT)\n\t\t\t\t\tDrawCheckedRect(hdc, &sbm, crInverse1, crInverse2);\n\t\t\t\telse\n\t\t\t\t\tDrawCheckedRect(hdc, &sbm, crCheck1, crCheck2);\n\n\t\t\t}\n\n\t\t\tRotateRect0(sb, &sbm);\t\t\t\n\t\t\t\n\t\t\t//Draw the margin below the thumb\n\t\t\tsbm.left = thumbpos+thumbwidth;\n\t\t\tsbm.right = rect->right - butwidth;\n\t\t\t\n\t\t\tRotateRect0(sb, &sbm);\n\t\t\tif(fCustomDraw)\n\t\t\t{\n\t\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &sbm, SB_PAGERIGHT, uDrawFlags == HTSCROLL_PAGERIGHT, 0, 0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(uDrawFlags == HTSCROLL_PAGERIGHT)\n\t\t\t\t\tDrawCheckedRect(hdc, &sbm, crInverse1, crInverse2);\n\t\t\t\telse\n\t\t\t\t\tDrawCheckedRect(hdc, &sbm, crCheck1, crCheck2);\n\t\t\t\n\t\t\t}\n\t\t\tRotateRect0(sb, &sbm);\n\t\t\t\n\t\t\t//Draw the THUMB finally\n\t\t\tSetRect(&thumb, thumbpos, rect->top, thumbpos+thumbwidth, rect->bottom);\n\n\t\t\tRotateRect0(sb, &thumb);\t\t\t\n\n\t\t\tif(fCustomDraw)\n\t\t\t{\n\t\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &thumb, SB_THUMBTRACK, uDrawFlags==HTSCROLL_THUMB, uHitTestPortion == HTSCROLL_THUMB && fBarHot, FALSE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n#ifdef FLAT_SCROLLBARS\t\n\t\t\t\tif(hwnd == hwndCurCoolSB && sb->fFlatScrollbar && (uDrawFlags == HTSCROLL_THUMB || \n\t\t\t\t(uHitTestPortion == HTSCROLL_THUMB && fBarHot)))\n\t\t\t\t{\t\n\t\t\t\t\tPaintRect(hdc, &thumb, GetSysColor(COLOR_3DSHADOW));\n\t\t\t\t}\n\t\t\t\telse\n#endif\n\t\t\t\t{\n\t\t\t\t\tDrawBlankButton(hdc, &thumb, uDEFlat);\n\t\t\t\t}\n\t\t\t}\n\t\t\tRotateRect0(sb, &thumb);\n\n\t\t}\n\t\t//otherwise, just leave that whole area blank\n\t\telse\n\t\t{\n\t\t\tOffsetRect(&ctrl, butwidth, 0);\n\t\t\tctrl.right = rect->right - butwidth;\n\n\t\t\t//if we always show the thumb covering the whole scrollbar,\n\t\t\t//then draw it that way\n\t\t\tif(!IsScrollInfoActive(si)\t&& (sb->fScrollFlags & CSBS_THUMBALWAYS) \n\t\t\t\t&& ctrl.right - ctrl.left > sb->nMinThumbSize)\n\t\t\t{\n\t\t\t\t//leave a 1-pixel gap between the thumb + right button\n\t\t\t\tctrl.right --;\n\t\t\t\tRotateRect0(sb, &ctrl);\n\n\t\t\t\tif(fCustomDraw)\n\t\t\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_THUMBTRACK, fMouseDownL, FALSE, FALSE);\n\t\t\t\telse\n\t\t\t\t{\n#ifdef FLAT_SCROLLBARS\t\n\t\t\t\t\tif(sb->fFlatScrollbar == CSBS_HOTTRACKED && uDrawFlags == HTSCROLL_THUMB)\n\t\t\t\t\t\tPaintRect(hdc, &ctrl, GetSysColor(COLOR_3DSHADOW));\n\t\t\t\t\telse\n#endif\n\t\t\t\t\t\tDrawBlankButton(hdc, &ctrl, uDEFlat);\n\n\t\t\t\t}\n\t\t\t\tRotateRect0(sb, &ctrl);\n\n\t\t\t\t//draw the single-line gap\n\t\t\t\tctrl.left = ctrl.right;\n\t\t\t\tctrl.right += 1;\n\t\t\t\t\n\t\t\t\tRotateRect0(sb, &ctrl);\n\t\t\t\t\n\t\t\t\tif(fCustomDraw)\n\t\t\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_PAGERIGHT, 0, 0, 0);\n\t\t\t\telse\n\t\t\t\t\tPaintRect(hdc, &ctrl, GetSysColor(COLOR_SCROLLBAR));\n\n\t\t\t\tRotateRect0(sb, &ctrl);\n\t\t\t}\n\t\t\t//otherwise, paint a blank if the thumb doesn't fit in\n\t\t\telse\n\t\t\t{\n\t\t\t\tRotateRect0(sb, &ctrl);\n\t\n\t\t\t\tif(fCustomDraw)\n\t\t\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_PAGERIGHT, 0, 0, 0);\n\t\t\t\telse\n\t\t\t\t\tDrawCheckedRect(hdc, &ctrl, crCheck1, crCheck2);\n\t\t\t\t\n\t\t\t\tRotateRect0(sb, &ctrl);\n\t\t\t}\n\t\t}\n\n\t\t//RIGHT ARROW\n\t\tSetRect(&ctrl, rect->right - butwidth, rect->top, rect->right, rect->bottom);\n\n\t\tRotateRect0(sb, &ctrl);\n\n\t\tif(fCustomDraw)\n\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_LINERIGHT, fMouseDownR, fMouseOverR, uRightButFlags & DFCS_INACTIVE);\n\t\telse\n\t\t\tDrawScrollArrow(sb, hdc, &ctrl, uRightButFlags, fMouseDownR, fMouseOverR);\n\n\t\tRotateRect0(sb, &ctrl);\n\t}\n\t//not enough room for the scrollbar, so just draw the buttons (scaled in size to fit)\n\telse\n\t{\n\t\tbutwidth = scrollwidth / 2;\n\n\t\t//LEFT ARROW\n\t\tSetRect(&ctrl, rect->left, rect->top, rect->left + butwidth, rect->bottom);\n\n\t\tRotateRect0(sb, &ctrl);\n\t\tif(fCustomDraw)\n\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_LINELEFT, fMouseDownL, fMouseOverL, uLeftButFlags & DFCS_INACTIVE);\n\t\telse\t\n\t\t\tDrawScrollArrow(sb, hdc, &ctrl, uLeftButFlags, fMouseDownL, fMouseOverL);\n\t\tRotateRect0(sb, &ctrl);\n\n\t\t//RIGHT ARROW\n\t\tOffsetRect(&ctrl, scrollwidth - butwidth, 0);\n\t\t\n\t\tRotateRect0(sb, &ctrl);\n\t\tif(fCustomDraw)\n\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_LINERIGHT, fMouseDownR, fMouseOverR, uRightButFlags & DFCS_INACTIVE);\n\t\telse\n\t\t\tDrawScrollArrow(sb, hdc, &ctrl, uRightButFlags, fMouseDownR, fMouseOverR);\t\t\n\t\tRotateRect0(sb, &ctrl);\n\n\t\t//if there is a gap between the buttons, fill it with a solid color\n\t\t//if(butwidth & 0x0001)\n\t\tif(ctrl.left != rect->left + butwidth)\n\t\t{\n\t\t\tctrl.left --;\n\t\t\tctrl.right -= butwidth;\n\t\t\tRotateRect0(sb, &ctrl);\n\t\t\t\n\t\t\tif(fCustomDraw)\n\t\t\t\tPostCustomDrawNotify(hwnd, hdc, sb->nBarType, &ctrl, SB_PAGERIGHT, 0, 0, 0);\n\t\t\telse\n\t\t\t\tDrawCheckedRect(hdc, &ctrl, crCheck1, crCheck2);\n\n\t\t\tRotateRect0(sb, &ctrl);\n\t\t}\n\t\t\t\n\t}\n\n#ifdef CUSTOM_DRAW\n\tPostCustomPrePostPaint(hwnd, hdc, sb, CDDS_POSTPAINT);\n#endif\n\n\treturn fCustomDraw;\n}\n\n//\n//\tDraw a vertical scrollbar using the horizontal draw routine, but\n//\twith the coordinates adjusted accordingly\n//\nstatic LRESULT NCDrawVScrollbar(SCROLLBAR *sb, HWND hwnd, HDC hdc, const RECT *rect, UINT uDrawFlags)\n{\n\tLRESULT ret;\n\tRECT rc;\n\n\trc = *rect;\n\tRotateRect(&rc);\n\tret = NCDrawHScrollbar(sb, hwnd, hdc, &rc, uDrawFlags);\n\tRotateRect(&rc);\n\t\n\treturn ret;\n}\n\n//\n//\tGeneric wrapper function for the scrollbar drawing\n//\nstatic LRESULT NCDrawScrollbar(SCROLLBAR *sb, HWND hwnd, HDC hdc, const RECT *rect, UINT uDrawFlags)\n{\n\tif(sb->nBarType == SB_HORZ)\n\t\treturn NCDrawHScrollbar(sb, hwnd, hdc, rect, uDrawFlags);\n\telse\n\t\treturn NCDrawVScrollbar(sb, hwnd, hdc, rect, uDrawFlags);\n}\n\n#ifdef INCLUDE_BUTTONS\n\n//\n//\tDraw the specified bitmap centered in the rectangle\n//\nstatic void DrawImage(HDC hdc, HBITMAP hBitmap, RECT *rc)\n{\n\tBITMAP bm;\n\tint cx;\n\tint cy;   \n\tHDC memdc;\n\tHBITMAP hOldBM;\n\tRECT  rcDest = *rc;   \n\tPOINT p;\n\tSIZE  delta;\n\tCOLORREF colorOld;\n\n\tif(hBitmap == NULL) \n\t\treturn;\n\n\t// center bitmap in caller's rectangle   \n\tGetObject(hBitmap, sizeof bm, &bm);   \n\t\n\tcx = bm.bmWidth;\n\tcy = bm.bmHeight;\n\n\tdelta.cx = (rc->right-rc->left - cx) / 2;\n\tdelta.cy = (rc->bottom-rc->top - cy) / 2;\n\t\n\tif(rc->right-rc->left > cx)\n\t{\n\t\tSetRect(&rcDest, rc->left+delta.cx, rc->top + delta.cy, 0, 0);   \n\t\trcDest.right = rcDest.left + cx;\n\t\trcDest.bottom = rcDest.top + cy;\n\t\tp.x = 0;\n\t\tp.y = 0;\n\t}\n\telse\n\t{\n\t\tp.x = -delta.cx;   \n\t\tp.y = -delta.cy;\n\t}\n   \n\t// select checkmark into memory DC\n\tmemdc = CreateCompatibleDC(hdc);\n\thOldBM = (HBITMAP)SelectObject(memdc, hBitmap);\n   \n\t// set BG color based on selected state   \n\tcolorOld = SetBkColor(hdc, GetSysColor(COLOR_3DFACE));\n\n\tBitBlt(hdc, rcDest.left, rcDest.top, rcDest.right-rcDest.left, rcDest.bottom-rcDest.top, memdc, p.x, p.y, SRCCOPY);\n\n\t// restore\n\tSetBkColor(hdc, colorOld);\n\tSelectObject(memdc, hOldBM);\n\tDeleteDC(memdc);\n}\n\n//\n// Draw the specified metafile\n//\nstatic void DrawMetaFile(HDC hdc, HENHMETAFILE hemf, RECT *rect)\n{\n\tRECT rc;\n\tPOINT pt;\n\n\tSetRect(&rc, 0, 0, rect->right-rect->left, rect->bottom-rect->top);\n\tSetWindowOrgEx(hdc, -rect->left, -rect->top, &pt);\n\tPlayEnhMetaFile(hdc, hemf, &rc);\n\tSetWindowOrgEx(hdc, pt.x, pt.y, 0);\n}\n\n//\n//\tDraw a single scrollbar inserted button, in whatever style\n//\tit has been defined to use.\t\n//\nstatic UINT DrawScrollButton(SCROLLBUT *sbut, HDC hdc, const RECT *pctrl, UINT flags)\n{\n\tNMCSBCUSTOMDRAW\tnmcd;\n\tHWND hwnd;\n\tRECT rect = *pctrl;\n\tUINT f;\n\n\tswitch(sbut->uButType & SBBT_MASK)\n\t{\n\tcase SBBT_OWNERDRAW:\n\n\t\thwnd = WindowFromDC(hdc);\n\n\t\t//fill in the standard header\n\t\tnmcd.hdr.hwndFrom = hwnd;\n\t\tnmcd.hdr.idFrom   = GetWindowLong(hwnd, GWL_ID);\n\t\tnmcd.hdr.code     = NM_COOLSB_CUSTOMDRAW;\n\n\t\tnmcd.dwDrawStage  = CDDS_ITEMPREPAINT;\n\t\tnmcd.nBar\t\t  = SB_INSBUT;\n\t\tnmcd.rect\t\t  = *pctrl;\n\t\tnmcd.uItem\t\t  = sbut->uCmdId;\n\t\tnmcd.hdc\t\t  = hdc;\n\t\tnmcd.uState\t\t  = flags;\n\n\t\tIntersectClipRect(hdc, rect.left, rect.top, rect.right, rect.bottom);\n\t\tSendMessage(GetParent(hwnd), WM_NOTIFY, nmcd.hdr.idFrom, (LPARAM)&nmcd);\n\t\tSelectClipRgn(hdc, NULL);\n\n\t\tbreak;\n\n\tcase SBBT_FIXED:\n\t\tflags &= ~SBBS_PUSHED;\n\n\tcase SBBT_TOGGLEBUTTON:\n\t\tif(sbut->uState != SBBS_NORMAL)\n\t\t\tflags |= SBBS_PUSHED;\n\n\t\t//intentionally fall through here...\n\n\tcase SBBT_PUSHBUTTON: \n\t\t\n\t\tf = flags & SBBS_PUSHED ? DFCS_PUSHED | DFCS_FLAT : 0;\n\t\tif(sbut->uButType & SBBM_LEFTARROW)\n\t\t{\n\t\t\tDrawFrameControl(hdc, &rect, DFC_SCROLL, DFCS_SCROLLLEFT | f);\n\t\t}\n\t\telse if(sbut->uButType & SBBM_RIGHTARROW)\n\t\t{\n\t\t\tDrawFrameControl(hdc, &rect, DFC_SCROLL, DFCS_SCROLLRIGHT | f);\n\t\t}\n\t\telse if(sbut->uButType & SBBM_UPARROW)\n\t\t{\n\t\t\tDrawFrameControl(hdc, &rect, DFC_SCROLL, DFCS_SCROLLUP | f);\n\t\t}\n\t\telse if(sbut->uButType & SBBM_DOWNARROW)\n\t\t{\n\t\t\tDrawFrameControl(hdc, &rect, DFC_SCROLL, DFCS_SCROLLDOWN | f);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//\n\t\t\tif(flags & SBBS_PUSHED)\n\t\t\t{\n\t\t\t\tif(sbut->uButType & SBBM_RECESSED)\n\t\t\t\t{\n\t\t\t\t\tInflateRect(&rect, -1, -1);\n\t\t\t\t\tDrawEdge(hdc, &rect, EDGE_SUNKEN, BF_RECT|BF_FLAT);\n\t\t\t\t\tInflateRect(&rect, 1, 1);\n\n\t\t\t\t\tFrameRect(hdc, &rect, GetSysColorBrush(COLOR_3DDKSHADOW));\n\t\t\t\t\tInflateRect(&rect, -2, -2);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tDrawEdge(hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_FLAT | BF_ADJUST);\n\t\t\t\t\tInflateRect(&rect, 1, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// draw the button borders\n\t\t\t\tif(sbut->uButType & SBBM_TYPE2)\n\t\t\t\t{\n\t\t\t\t\tDrawFrameControl(hdc, &rect, DFC_BUTTON, DFCS_BUTTONPUSH);\n\t\t\t\t\tInflateRect(&rect, -2, -2);\n\t\t\t\t}\n\n\t\t\t\telse if(sbut->uButType & SBBM_TYPE3)\n\t\t\t\t{\n\t\t\t\t\tDrawFrameControl(hdc, &rect, DFC_BUTTON, DFCS_BUTTONPUSH);\n\t\t\t\t\tInflateRect(&rect, -1, -1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tDrawEdge(hdc, &rect, EDGE_RAISED, BF_RECT | BF_ADJUST);\n\t\t\t\t\trect.bottom++;\n\t\t\t\t\trect.right++;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tOffsetRect(&rect, -1, -1);\n\t\t\t\trect.top++;\trect.left++;\n\t\t\t}\n\n\t\t\tif(sbut->hBmp)\n\t\t\t{\n\t\t\t\tPaintRect(hdc, &rect, GetSysColor(COLOR_3DFACE));\n\n\t\t\t\tif(flags & SBBS_PUSHED)\t\n\t\t\t\t{\n\t\t\t\t\trect.top++; rect.left++;\n\t\t\t\t}\n\n\t\t\t\tIntersectClipRect(hdc, rect.left, rect.top, rect.right,rect.bottom);\n\t\t\t\tDrawImage(hdc, sbut->hBmp, &rect);\n\t\t\t\tSelectClipRgn(hdc, 0);\n\t\t\t}\n\t\t\telse if(sbut->hEmf)\n\t\t\t{\n\t\t\t\tPaintRect(hdc, &rect, GetSysColor(COLOR_3DFACE));\n\t\t\t\tInflateRect(&rect, -1, -1);\t\t\n\n\t\t\t\tif(flags & SBBS_PUSHED)\t\n\t\t\t\t{\n\t\t\t\t\trect.top++; rect.left++;\n\t\t\t\t}\n\n\t\t\t\tIntersectClipRect(hdc, rect.left, rect.top, rect.right,rect.bottom);\n\t\t\t\tDrawMetaFile(hdc, sbut->hEmf, &rect);\n\t\t\t\tSelectClipRgn(hdc, 0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tPaintRect(hdc, &rect, GetSysColor(COLOR_3DFACE));\n\t\t\t}\n\t\t}\n\t\t\t\n\n\t\tbreak;\n\n\tcase SBBT_BLANK:\n\t\tPaintRect(hdc, &rect, GetSysColor(COLOR_3DFACE));\n\t\tbreak;\n\n\tcase SBBT_FLAT:\n\t\tDrawBlankButton(hdc, &rect, BF_FLAT);\n\t\tbreak;\n\n\tcase SBBT_DARK:\n\t\tPaintRect(hdc, &rect, GetSysColor(COLOR_3DDKSHADOW));\n\t\tbreak;\n\t}\n\t\n\treturn 0;\n}\n\n//\n//\tDraw any buttons inserted into the horizontal scrollbar\n//\tassume that the button widths have already been calculated\n//\tNote: RECT *rect is the rectangle of the scrollbar\n//\t      leftright: 1 = left, 2 = right, 3 = both\n//\nstatic LRESULT DrawHorzButtons(SCROLLBAR *sbar, HDC hdc, const RECT *rect, int leftright)\n{\n\tint i;\n\tint xposl, xposr;\n\tRECT ctrl;\n\tSCROLLBUT *sbut = sbar->sbButtons;\n\t\n\txposl = rect->left - sbar->nButSizeBefore;\n\txposr = rect->right;\n\t\n\tfor(i = 0; i < sbar->nButtons; i++)\n\t{\n\t\tif((leftright & SBBP_LEFT) && sbut[i].uPlacement == SBBP_LEFT)\n\t\t{\n\t\t\tint butwidth = GetSingleButSize(sbar, &sbut[i]);\n\t\t\tSetRect(&ctrl, xposl, rect->top, xposl + butwidth, rect->bottom);\n\t\t\tRotateRect0(sbar, &ctrl);\n\t\t\tDrawScrollButton(&sbut[i], hdc, &ctrl, SBBS_NORMAL);\n\t\t\t\n\t\t\txposl += butwidth;\n\t\t}\n\n\t\tif((leftright & SBBP_RIGHT) && sbut[i].uPlacement == SBBP_RIGHT)\n\t\t{\n\t\t\tint butwidth = GetSingleButSize(sbar, &sbut[i]);\n\t\t\tSetRect(&ctrl, xposr, rect->top, xposr + butwidth, rect->bottom);\n\t\t\tRotateRect0(sbar, &ctrl);\n\t\t\tDrawScrollButton(&sbut[i], hdc, &ctrl, SBBS_NORMAL);\n\t\t\txposr += butwidth;\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic LRESULT DrawVertButtons(SCROLLBAR *sbar, HDC hdc, const RECT *rect, int leftright)\n{\n\tRECT rc = *rect;\n\tRotateRect(&rc);\n\tDrawHorzButtons(sbar, hdc, &rc, leftright);\n\treturn 0;\n}\n#endif\t// INCLUDE_BUTTONS\n\n//\n//\tDefine these two for proper processing of NCPAINT\n//\tNOT needed if we don't bother to mask the scrollbars we draw\n//\tto prevent the old window procedure from accidently drawing over them\n//\nHDC CoolSB_GetDC(HWND hwnd, WPARAM wParam)\n{\n\t// I just can't figure out GetDCEx, so I'll just use this:\n\treturn GetWindowDC(hwnd);\n\n\t/*\n\tRECT rc;\n\tDWORD flags = 0x10000;\n\tHRGN hrgn = (HRGN)wParam;\n\n\tif(hrgn == (HRGN)1)\n\t{\n\t\tGetWindowRect(hwnd, &rc);\n\t\tOffsetRect(&rc, -rc.left, -rc.top);\n\t\thrgn = CreateRectRgnIndirect(&rc);\n\t}\n\n\tif(GetWindowLong(hwnd, GWL_STYLE) & WS_CLIPCHILDREN)\n\t\tflags |= DCX_CLIPCHILDREN;\n\n\tif(GetWindowLong(hwnd, GWL_STYLE) & WS_CLIPSIBLINGS)\n\t\tflags |= DCX_CLIPSIBLINGS;\n\n\treturn GetDCEx(hwnd, hrgn, flags | DCX_CACHE|DCX_NORESETATTRS|DCX_WINDOW | DCX_INTERSECTUPDATE);\n\t*/\n\n\t//return GetDCEx(hwnd, NULL, flags | DCX_WINDOW| DCX_NORESETATTRS);\n}\n\nstatic LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n\tSCROLLBAR *sb;\n\tHDC hdc;\n\tHRGN hrgn;\n\tRECT winrect, rect;\n\tHRGN clip;\n\tBOOL fUpdateAll = ((LONG)wParam == 1);\n\tBOOL fCustomDraw = FALSE;\n\tUINT ret;\n\tDWORD dwStyle;\n\n\tGetWindowRect(hwnd, &winrect);\n\t\n\t//if entire region needs painting, then make a region to cover the entire window\n\tif(fUpdateAll)\n\t\thrgn = (HRGN)wParam;\n\telse\n\t\thrgn = (HRGN)wParam;\n\t\n\t//hdc = GetWindowDC(hwnd);\n\thdc = CoolSB_GetDC(hwnd, wParam);\n\n\t//\n\t//\tOnly draw the horizontal scrollbar if the window is tall enough\n\t//\n\tsb = &sw->sbarHorz;\n\tif(sb->fScrollVisible)\n\t{\n\t\tint hbarwidth = 0, leftright = 0;\n\n\t\t//get the screen coordinates of the whole horizontal scrollbar area\n\t\tGetHScrollRect(sw, hwnd, &rect);\n\n\t\t//make the coordinates relative to the window for drawing\n\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\n#ifdef INCLUDE_BUTTONS\n\n\t\t//work out the size of any inserted buttons so we can dra them\n\t\tsb->nButSizeBefore  = GetButtonSize(sb, hwnd, SBBP_LEFT);\n\t\tsb->nButSizeAfter   = GetButtonSize(sb, hwnd, SBBP_RIGHT);\n\n\t\t//make sure there is room for the buttons\n\t\thbarwidth = rect.right - rect.left;\n\n\t\t//check that we can fit any left/right buttons in the available space\n\t\tif(sb->nButSizeAfter < (hbarwidth - MIN_COOLSB_SIZE))\n\t\t{\n\t\t\t//adjust the scrollbar rectangle to fit the buttons into\n\t\t\tsb->fButVisibleAfter = TRUE;\n\t\t\trect.right -= sb->nButSizeAfter;\n\t\t\tleftright |= SBBP_RIGHT;\n\t\t\t\n\t\t\t//check that there is enough space for the right buttons\n\t\t\tif(sb->nButSizeBefore + sb->nButSizeAfter < (hbarwidth - MIN_COOLSB_SIZE))\n\t\t\t{\n\t\t\t\tsb->fButVisibleBefore = TRUE;\n\t\t\t\trect.left += sb->nButSizeBefore;\n\t\t\t\tleftright |= SBBP_LEFT;\n\t\t\t}\n\t\t\telse\n\t\t\t\tsb->fButVisibleBefore = FALSE;\n\t\t}\t\n\t\telse\n\t\t\tsb->fButVisibleAfter = FALSE;\n\t\t\n\t\t\n\t\tDrawHorzButtons(sb, hdc, &rect, leftright);\n#endif// INCLUDE_BUTTONS\t\t\n\n\t\tif(uCurrentScrollbar == SB_HORZ)\n\t\t\tfCustomDraw |= NCDrawHScrollbar(sb, hwnd, hdc, &rect, uScrollTimerPortion);\n\t\telse\n\t\t\tfCustomDraw |= NCDrawHScrollbar(sb, hwnd, hdc, &rect, HTSCROLL_NONE);\n\t}\n\n\t//\n\t// Only draw the vertical scrollbar if the window is wide enough to accomodate it\n\t//\n\tsb = &sw->sbarVert;\n\tif(sb->fScrollVisible)\n\t{\n\t\tint vbarheight = 0, updown = 0;\n\n\t\t//get the screen cooridinates of the whole horizontal scrollbar area\n\t\tGetVScrollRect(sw, hwnd, &rect);\n\n\t\t//make the coordinates relative to the window for drawing\n\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\n#ifdef INCLUDE_BUTTONS\n\n\t\t//work out the size of any inserted buttons so we can dra them\n\t\tsb->nButSizeBefore  = GetButtonSize(sb, hwnd, SBBP_LEFT);\n\t\tsb->nButSizeAfter   = GetButtonSize(sb, hwnd, SBBP_RIGHT);\n\n\t\t//make sure there is room for the buttons\n\t\tvbarheight = rect.bottom - rect.top;\n\n\t\t//check that we can fit any left/right buttons in the available space\n\t\tif(sb->nButSizeAfter < (vbarheight - MIN_COOLSB_SIZE))\n\t\t{\n\t\t\t//adjust the scrollbar rectangle to fit the buttons into\n\t\t\tsb->fButVisibleAfter = TRUE;\n\t\t\trect.bottom -= sb->nButSizeAfter;\n\t\t\tupdown |= SBBP_BOTTOM;\n\t\t\t\n\t\t\t//check that there is enough space for the right buttons\n\t\t\tif(sb->nButSizeBefore + sb->nButSizeAfter < (vbarheight - MIN_COOLSB_SIZE))\n\t\t\t{\n\t\t\t\tsb->fButVisibleBefore = TRUE;\n\t\t\t\trect.top += sb->nButSizeBefore;\n\t\t\t\tupdown |= SBBP_TOP;\n\t\t\t}\n\t\t\telse\n\t\t\t\tsb->fButVisibleBefore = FALSE;\n\t\t}\t\n\t\telse\n\t\t\tsb->fButVisibleAfter = FALSE;\n\t\t\n\t\n\t\tDrawVertButtons(sb, hdc, &rect, updown);\n#endif // INCLUDE_BUTTONS\n\n\t\tif(uCurrentScrollbar == SB_VERT)\n\t\t\tfCustomDraw |= NCDrawVScrollbar(sb, hwnd, hdc, &rect, uScrollTimerPortion);\n\t\telse\n\t\t\tfCustomDraw |= NCDrawVScrollbar(sb, hwnd, hdc, &rect, HTSCROLL_NONE);\n\t}\n\n\t//Call the default window procedure for WM_NCPAINT, with the\n\t//new window region. ** region must be in SCREEN coordinates **\n\tdwStyle = GetWindowLong(hwnd, GWL_STYLE);\n\n    // If the window has WS_(H-V)SCROLL bits set, we should reset them\n    // to avoid windows taking the scrollbars into account.\n    // We temporarily set a flag preventing the subsecuent \n    // WM_STYLECHANGING/WM_STYLECHANGED to be forwarded to \n    // the original window procedure\n    if ( dwStyle & (WS_VSCROLL|WS_HSCROLL) )\n    {\n        sw->bPreventStyleChange = TRUE;\n        SetWindowLong(hwnd, GWL_STYLE, dwStyle & ~(WS_VSCROLL|WS_HSCROLL));\n    }\n\t\n\tret = CallWindowProc(sw->oldproc, hwnd, WM_NCPAINT, (WPARAM)hrgn, lParam);\n\t\n    if ( dwStyle & (WS_VSCROLL|WS_HSCROLL) )\n    {\n        SetWindowLong(hwnd, GWL_STYLE, dwStyle);\n        sw->bPreventStyleChange = FALSE;\n    }\n\n\n\t// DRAW THE DEAD AREA\n\t// only do this if the horizontal and vertical bars are visible\n\tif(sw->sbarHorz.fScrollVisible && sw->sbarVert.fScrollVisible)\n\t{\n\t\tGetWindowRect(hwnd, &rect);\n\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\n\t\trect.bottom -= sw->cyBottomEdge;\n\t\trect.top  = rect.bottom - GetScrollMetric(&sw->sbarHorz, SM_CYHORZSB);\n\n\t\tif(sw->fLeftScrollbar)\n\t\t{\n\t\t\trect.left += sw->cxLeftEdge;\n\t\t\trect.right = rect.left + GetScrollMetric(&sw->sbarVert, SM_CXVERTSB);\n\t\t}\n\t\telse\n\t\t{\n\t\t\trect.right -= sw->cxRightEdge;\n\t\t\trect.left = rect.right  - GetScrollMetric(&sw->sbarVert, SM_CXVERTSB);\n\t\t}\n\t\t\n\t\tif(fCustomDraw)\n\t\t\tPostCustomDrawNotify(hwnd, hdc, SB_BOTH, &rect, 32, 0, 0, 0);\n\t\telse\n\t\t{\n\t\t\t//calculate the position of THIS window's dead area\n\t\t\t//with the position of the PARENT window's client rectangle.\n\t\t\t//if THIS window has been positioned such that its bottom-right\n\t\t\t//corner sits in the parent's bottom-right corner, then we should\n\t\t\t//show the sizing-grip.\n\t\t\t//Otherwise, assume this window is not in the right place, and\n\t\t\t//just draw a blank rectangle\n\t\t\tRECT parent;\n\t\t\tRECT rect2;\n\t\t\tHWND hwndParent = GetParent(hwnd);\n\n\t\t\tGetClientRect(hwndParent, &parent);\n\t\t\tMapWindowPoints(hwndParent, 0, (POINT *)&parent, 2);\n\n\t\t\tCopyRect(&rect2, &rect);\n\t\t\tOffsetRect(&rect2, winrect.left, winrect.top);\n\n\t\t\tif(!sw->fLeftScrollbar && parent.right == rect2.right+sw->cxRightEdge && parent.bottom == rect2.bottom+sw->cyBottomEdge\n\t\t\t || sw->fLeftScrollbar && parent.left  == rect2.left -sw->cxLeftEdge  && parent.bottom == rect2.bottom+sw->cyBottomEdge)\n\t\t\t\tDrawFrameControl(hdc, &rect, DFC_SCROLL, sw->fLeftScrollbar ? DFCS_SCROLLSIZEGRIPRIGHT : DFCS_SCROLLSIZEGRIP );\n\t\t\telse\n\t\t\t\tPaintRect(hdc, &rect, GetSysColor(COLOR_3DFACE));\n\t\t}\n\t}\n\n\tUNREFERENCED_PARAMETER(clip);\n\n\tReleaseDC(hwnd, hdc);\n\treturn ret;\n}\n\n//\n// Need to detect if we have clicked in the scrollbar region or not\n//\nstatic LRESULT NCHitTest(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n\tRECT hrect;\n\tRECT vrect;\n\tPOINT pt;\n\n\tpt.x = LOWORD(lParam);\n\tpt.y = HIWORD(lParam);\n\t\n\t//work out exactly where the Horizontal and Vertical scrollbars are\n\tGetHScrollRect(sw, hwnd, &hrect);\n\tGetVScrollRect(sw, hwnd, &vrect);\n\t\n\t//Clicked in the horizontal scrollbar area\n\tif(sw->sbarHorz.fScrollVisible && PtInRect(&hrect, pt))\n\t{\n\t\treturn HTHSCROLL;\n\t}\n\t//Clicked in the vertical scrollbar area\n\telse if(sw->sbarVert.fScrollVisible && PtInRect(&vrect, pt))\n\t{\n\t\treturn HTVSCROLL;\n\t}\n\t//clicked somewhere else\n\telse\n\t{\n\t\treturn CallWindowProc(sw->oldproc, hwnd, WM_NCHITTEST, wParam, lParam);\n\t}\n}\n\n//\n//\tReturn a HT* value indicating what part of the scrollbar was clicked\n//\tRectangle is not adjusted\n//\nstatic UINT GetHorzPortion(SCROLLBAR *sb, HWND hwnd, RECT *rect, int x, int y)\n{\n\tRECT rc = *rect;\n\n\tif(y < rc.top || y >= rc.bottom) return HTSCROLL_NONE;\n\n#ifdef INCLUDE_BUTTONS\n\n\tif(sb->fButVisibleBefore) \n\t{\n\t\t//clicked on the buttons to the left of the scrollbar\n\t\tif(x >= rc.left && x < rc.left + sb->nButSizeBefore)\n\t\t\treturn HTSCROLL_INSERTED;\n\n\t\t//adjust the rectangle to exclude the left-side buttons, now that we\n\t\t//know we havn't clicked on them\n\t\trc.left  += sb->nButSizeBefore;\n\t}\n\n\tif(sb->fButVisibleAfter)\n\t{\n\t\t//clicked on the buttons to the right of the scrollbar\n\t\tif(x >= rc.right - sb->nButSizeAfter && x < rc.right)\n\t\t\treturn HTSCROLL_INSERTED;\n\n\t\t//adjust the rectangle to exclude the right-side buttons, now that we\n\t\t//know we havn't clicked on them\n\t\trc.right -= sb->nButSizeAfter;\n\t}\n\n#endif INCLUDE_BUTTONS\n\n\t//Now we have the rectangle for the scrollbar itself, so work out\n\t//what part we clicked on.\n\treturn GetHorzScrollPortion(sb, hwnd, &rc, x, y);\n}\n\n//\n//\tJust call the horizontal version, with adjusted coordinates\n//\nstatic UINT GetVertPortion(SCROLLBAR *sb, HWND hwnd, RECT *rect, int x, int y)\n{\n\tUINT ret;\n\tRotateRect(rect);\n\tret = GetHorzPortion(sb, hwnd, rect, y, x);\n\tRotateRect(rect);\n\treturn ret;\n}\n\n//\n//\tWrapper function for GetHorzPortion and GetVertPortion\n//\nstatic UINT GetPortion(SCROLLBAR *sb, HWND hwnd, RECT *rect, int x, int y)\n{\n\tif(sb->nBarType == SB_HORZ)\n\t\treturn GetHorzPortion(sb, hwnd, rect, x, y);\n\telse if(sb->nBarType == SB_VERT)\n\t\treturn GetVertPortion(sb, hwnd, rect, x, y);\n\telse\n\t\treturn HTSCROLL_NONE;\n}\n\n//\n//\tInput: rectangle of the total scrollbar area\n//\tOutput: adjusted to take the inserted buttons into account\n//\nstatic void GetRealHorzScrollRect(SCROLLBAR *sb, RECT *rect)\n{\n\tif(sb->fButVisibleBefore) rect->left += sb->nButSizeBefore;\n\tif(sb->fButVisibleAfter)  rect->right -= sb->nButSizeAfter;\n}\n\n//\n//\tInput: rectangle of the total scrollbar area\n//\tOutput: adjusted to take the inserted buttons into account\n//\nstatic void GetRealVertScrollRect(SCROLLBAR *sb, RECT *rect)\n{\n\tif(sb->fButVisibleBefore) rect->top += sb->nButSizeBefore;\n\tif(sb->fButVisibleAfter)  rect->bottom -= sb->nButSizeAfter;\n}\n\n//\n//\tDecide which type of scrollbar we have before calling\n//  the real function to do the job\n//\nstatic void GetRealScrollRect(SCROLLBAR *sb, RECT *rect)\n{\n\tif(sb->nBarType == SB_HORZ)\n\t{\n\t\tGetRealHorzScrollRect(sb, rect);\n\t}\n\telse if(sb->nBarType == SB_VERT)\n\t{\n\t\tGetRealVertScrollRect(sb, rect);\n\t}\n}\n\n//\n//\tAll button code shoule be collected together\n//\t\n//\n#ifdef INCLUDE_BUTTONS\n\n//\n//\tReturn the index of the button covering the specified point\n//\trect\t\t- rectangle of the whole scrollbar area\n//\tpt\t\t\t- screen coords of the mouse\n//\tfReturnRect - do/don't modify the rect to return the button's area\n//\nstatic UINT GetHorzButtonFromPt(SCROLLBAR *sb, RECT *rect, POINT pt, BOOL fReturnRect)\n{\n\tint leftpos = rect->left, rightpos = rect->right;\n\tint i;\n\tint butwidth;\n\tSCROLLBUT *sbut = sb->sbButtons;\n\n\tif(!PtInRect(rect, pt))\n\t\treturn -1;\n\n\tif(sb->fButVisibleAfter)\n\t\trightpos -= sb->nButSizeAfter;\n\n\tfor(i = 0; i < sb->nButtons; i++)\n\t{\n\t\tif(sb->fButVisibleBefore && sbut[i].uPlacement == SBBP_LEFT)\n\t\t{\n\t\t\tbutwidth = GetSingleButSize(sb, &sbut[i]);\n\t\t\t\n\t\t\t//if the current button is under the specified point\n\t\t\tif(pt.x >= leftpos && pt.x < leftpos + butwidth)\n\t\t\t{\n\t\t\t\t//if the caller wants us to return the rectangle of the button\n\t\t\t\tif(fReturnRect)\n\t\t\t\t{\n\t\t\t\t\trect->left  = leftpos;\n\t\t\t\t\trect->right = leftpos + butwidth;\n\t\t\t\t}\n\n\t\t\t\treturn i;\n\t\t\t}\n\n\t\t\tleftpos += butwidth;\n\t\t}\n\t\telse if(sb->fButVisibleAfter && sbut[i].uPlacement == SBBP_RIGHT)\n\t\t{\n\t\t\tbutwidth = GetSingleButSize(sb, &sbut[i]);\n\n\t\t\t//if the current button is under the specified point\n\t\t\tif(pt.x >= rightpos && pt.x < rightpos + butwidth)\n\t\t\t{\n\t\t\t\t//if the caller wants us to return the rectangle of the button\n\t\t\t\tif(fReturnRect)\n\t\t\t\t{\n\t\t\t\t\trect->left  = rightpos;\n\t\t\t\t\trect->right = rightpos + butwidth;\n\t\t\t\t}\n\t\t\t\treturn i;\n\t\t\t}\n\n\t\t\trightpos += butwidth;\n\t\t}\n\t}\n\n\treturn -1;\n}\n\n\nstatic UINT GetVertButtonFromPt(SCROLLBAR *sb, RECT *rect, POINT pt, BOOL fReturnRect)\n{\n\tUINT ret;\n\tint temp;\n\t\n\t//swap the X/Y coords\n\ttemp = pt.x;\n\tpt.x = pt.y;\n\tpt.y = temp;\n\n\t//swap the rectangle\n\tRotateRect(rect);\n\t\n\tret = GetHorzButtonFromPt(sb, rect, pt, fReturnRect);\n\n\tRotateRect(rect);\n\treturn ret;\n}\n\n//\n//\n//\nstatic UINT GetButtonFromPt(SCROLLBAR *sb, RECT *rect, POINT pt, BOOL fReturnRect)\n{\n\tif(sb->nBarType == SB_HORZ)\n\t{\n\t\treturn GetHorzButtonFromPt(sb, rect, pt, fReturnRect);\n\t}\n\telse\n\t{\n\t\treturn GetVertButtonFromPt(sb, rect, pt, fReturnRect);\n\t}\n}\n\n//\n//\tFind the coordinates (in RECT format) of the specified button index\n//\nstatic UINT GetHorzButtonRectFromId(SCROLLBAR *sb, RECT *rect, UINT index)\n{\n\tUINT i;\n\tSCROLLBUT *sbut = sb->sbButtons;\n\tint leftpos = rect->left, rightpos = rect->right;\n\n\tif(sb->fButVisibleAfter)\n\t\trightpos -= sb->nButSizeAfter;\n\n\t//find the particular button in question\n\tfor(i = 0; i < index; i++)\n\t{\n\t\tif(sb->fButVisibleBefore && sbut[i].uPlacement == SBBP_LEFT)\n\t\t{\n\t\t\tleftpos += GetSingleButSize(sb, &sbut[i]);\n\t\t}\n\t\telse if(sb->fButVisibleAfter && sbut[i].uPlacement == SBBP_RIGHT)\n\t\t{\n\t\t\trightpos += GetSingleButSize(sb, &sbut[i]);\n\t\t}\n\t}\n\n\t//now return the rectangle\n\tif(sbut[i].uPlacement == SBBP_LEFT)\n\t{\n\t\trect->left  = leftpos;\n\t\trect->right = leftpos + GetSingleButSize(sb, &sbut[i]);\n\t}\n\telse\n\t{\n\t\trect->left  = rightpos;\n\t\trect->right = rightpos + GetSingleButSize(sb, &sbut[i]);\n\t}\n\n\treturn 0;\n}\n\nstatic UINT GetVertButtonRectFromId(SCROLLBAR *sb, RECT *rect, UINT index)\n{\n\tUINT ret;\n\tRotateRect(rect);\n\tret = GetHorzButtonRectFromId(sb, rect, index);\n\tRotateRect(rect);\n\treturn ret;\n}\n\nstatic UINT GetButtonRectFromId(SCROLLBAR *sb, RECT *rect, UINT index)\n{\n\tif(sb->nBarType == SB_HORZ)\n\t{\n\t\treturn GetHorzButtonRectFromId(sb, rect, index);\n\t}\n\telse\n\t{\n\t\treturn GetVertButtonRectFromId(sb, rect, index);\n\t}\n}\n#endif //INCLUDE_BUTTONS\t\n\n//\n//\tLeft button click in the non-client area\n//\nstatic LRESULT NCLButtonDown(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n\tRECT rect, winrect;\n\tHDC hdc;\n\tSCROLLBAR *sb;\n\tSCROLLBUT *sbut = 0;\n\tPOINT pt;\n\n\tpt.x = LOWORD(lParam);\n\tpt.y = HIWORD(lParam);\n\n\thwndCurCoolSB = hwnd;\n\n\t//\n\t//\tHORIZONTAL SCROLLBAR PROCESSING\n\t//\n\tif(wParam == HTHSCROLL)\n\t{\n\t\tuScrollTimerMsg = WM_HSCROLL;\n\t\tuCurrentScrollbar = SB_HORZ;\n\t\tsb = &sw->sbarHorz;\n\n\t\t//get the total area of the normal Horz scrollbar area\n\t\tGetHScrollRect(sw, hwnd, &rect);\n\t\tuCurrentScrollPortion = GetHorzPortion(sb, hwnd, &rect, LOWORD(lParam), HIWORD(lParam));\n\t}\n\t//\n\t//\tVERTICAL SCROLLBAR PROCESSING\n\t//\n\telse if(wParam == HTVSCROLL)\n\t{\n\t\tuScrollTimerMsg = WM_VSCROLL;\n\t\tuCurrentScrollbar = SB_VERT;\n\t\tsb = &sw->sbarVert;\n\n\t\t//get the total area of the normal Horz scrollbar area\n\t\tGetVScrollRect(sw, hwnd, &rect);\n\t\tuCurrentScrollPortion = GetVertPortion(sb, hwnd, &rect, LOWORD(lParam), HIWORD(lParam));\n\t}\n\t//\n\t//\tNORMAL PROCESSING\n\t//\n\telse\n\t{\n\t\tuCurrentScrollPortion = HTSCROLL_NONE;\n\t\treturn CallWindowProc(sw->oldproc, hwnd, WM_NCLBUTTONDOWN, wParam, lParam);\n\t}\n\n\t//\n\t// we can now share the same code for vertical\n\t// and horizontal scrollbars\n\t//\n\tswitch(uCurrentScrollPortion)\n\t{\n\t//inserted buttons to the left/right\n#ifdef INCLUDE_BUTTONS\n\tcase HTSCROLL_INSERTED:  \n\n#ifdef HOT_TRACKING\n\t\tKillTimer(hwnd, uMouseOverId);\n\t\tuMouseOverId = 0;\n\t\tuMouseOverScrollbar = COOLSB_NONE;\n#endif\n\n\t\t//find the index of the button that has been clicked\n\t\t//adjust the rectangle to give the button's rectangle\n\t\tuCurrentButton = GetButtonFromPt(sb, &rect, pt, TRUE);\n\n\t\tsbut = &sb->sbButtons[uCurrentButton];\n\t\t\n\t\t//post a notification message\n\t\tPostMouseNotify(hwnd, NM_CLICK, sb->nBarType, &rect, sbut->uCmdId, pt);\n\n\t\tGetWindowRect(hwnd, &winrect);\n\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\t\thdc = GetWindowDC(hwnd);\n\t\t\t\n\t\tDrawScrollButton(sbut, hdc, &rect, SBBS_PUSHED);\n\n\t\tReleaseDC(hwnd, hdc);\n\t\n\t\tbreak;\n#endif\t//INCLUDE_BUTTONS\n\n\tcase HTSCROLL_THUMB: \n\n\t\t//if the scrollbar is disabled, then do no further processing\n\t\tif(!IsScrollbarActive(sb))\n\t\t\treturn 0;\n\t\t\n\t\tGetRealScrollRect(sb, &rect);\n\t\tRotateRect0(sb, &rect);\n\t\tCalcThumbSize(sb, &rect, &nThumbSize, &nThumbPos);\n\t\tRotateRect0(sb, &rect);\n\t\t\n\t\t//remember the bounding rectangle of the scrollbar work area\n\t\trcThumbBounds = rect;\n\t\t\n\t\tsw->fThumbTracking = TRUE;\n\t\tsb->scrollInfo.nTrackPos = sb->scrollInfo.nPos;\n\t\t\n\t\tif(wParam == HTVSCROLL) \n\t\t\tnThumbMouseOffset = pt.y - nThumbPos;\n\t\telse\n\t\t\tnThumbMouseOffset = pt.x - nThumbPos;\n\n\t\tnLastPos = -sb->scrollInfo.nPos;\n\t\tnThumbPos0 = nThumbPos;\n\t\n\t\t//if(sb->fFlatScrollbar)\n\t\t//{\n\t\t\tGetWindowRect(hwnd, &winrect);\n\t\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\t\t\thdc = GetWindowDC(hwnd);\n\t\t\tNCDrawScrollbar(sb, hwnd, hdc, &rect, HTSCROLL_THUMB);\n\t\t\tReleaseDC(hwnd, hdc);\n\t\t//}\n\n\t\tbreak;\n\n\t\t//Any part of the scrollbar\n\tcase HTSCROLL_LEFT:  \n\t\tif(sb->fScrollFlags & ESB_DISABLE_LEFT)\t\treturn 0;\n\t\telse\t\t\t\t\t\t\t\t\t\tgoto target1;\n\t\n\tcase HTSCROLL_RIGHT: \n\t\tif(sb->fScrollFlags & ESB_DISABLE_RIGHT)\treturn 0;\n\t\telse\t\t\t\t\t\t\t\t\t\tgoto target1;\n\n\t\tgoto target1;\t\n\n\tcase HTSCROLL_PAGELEFT:  case HTSCROLL_PAGERIGHT:\n\n\t\ttarget1:\n\n\t\t//if the scrollbar is disabled, then do no further processing\n\t\tif(!IsScrollbarActive(sb))\n\t\t\tbreak;\n\n\t\t//ajust the horizontal rectangle to NOT include\n\t\t//any inserted buttons\n\t\tGetRealScrollRect(sb, &rect);\n\n\t\tSendScrollMessage(hwnd, uScrollTimerMsg, uCurrentScrollPortion, 0);\n\n\t\t// Check what area the mouse is now over :\n\t\t// If the scroll thumb has moved under the mouse in response to \n\t\t// a call to SetScrollPos etc, then we don't hilight the scrollbar margin\n\t\tif(uCurrentScrollbar == SB_HORZ)\n\t\t\tuScrollTimerPortion = GetHorzScrollPortion(sb, hwnd, &rect, pt.x, pt.y);\n\t\telse\n\t\t\tuScrollTimerPortion = GetVertScrollPortion(sb, hwnd, &rect, pt.x, pt.y);\n\n\t\tGetWindowRect(hwnd, &winrect);\n\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\t\thdc = GetWindowDC(hwnd);\n\t\t\t\n#ifndef HOT_TRACKING\n\t\t//if we aren't hot-tracking, then don't highlight \n\t\t//the scrollbar thumb unless we click on it\n\t\tif(uScrollTimerPortion == HTSCROLL_THUMB)\n\t\t\tuScrollTimerPortion = HTSCROLL_NONE;\n#endif\n\t\tNCDrawScrollbar(sb, hwnd, hdc, &rect, uScrollTimerPortion);\n\t\tReleaseDC(hwnd, hdc);\n\n\t\t//Post the scroll message!!!!\n\t\tuScrollTimerPortion = uCurrentScrollPortion;\n\n\t\t//set a timer going on the first click.\n\t\t//if this one expires, then we can start off a more regular timer\n\t\t//to generate the auto-scroll behaviour\n\t\tuScrollTimerId = SetTimer(hwnd, COOLSB_TIMERID1, COOLSB_TIMERINTERVAL1, 0);\n\t\tbreak;\n\tdefault:\n\t\treturn CallWindowProc(sw->oldproc, hwnd, WM_NCLBUTTONDOWN, wParam, lParam);\n\t\t//return 0;\n\t}\n\t\t\n\tSetCapture(hwnd);\n\treturn 0;\n}\n\n//\n//\tLeft button released\n//\nstatic LRESULT LButtonUp(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n\tRECT rect;\n\t//UINT thisportion;\n\tHDC hdc;\n\tPOINT pt;\n\tRECT winrect;\n\tUINT buttonIdx = 0;\n\t\n\t//current scrollportion is the button that we clicked down on\n\tif(uCurrentScrollPortion != HTSCROLL_NONE)\n\t{\n\t\tSCROLLBAR *sb = &sw->sbarHorz;\n\t\tlParam = GetMessagePos();\n\t\tReleaseCapture();\n\n\t\tGetWindowRect(hwnd, &winrect);\n\t\tpt.x = LOWORD(lParam);\n\t\tpt.y = HIWORD(lParam);\n\n\t\t//emulate the mouse input on a scrollbar here...\n\t\tif(uCurrentScrollbar == SB_HORZ)\n\t\t{\n\t\t\t//get the total area of the normal Horz scrollbar area\n\t\t\tsb = &sw->sbarHorz;\n\t\t\tGetHScrollRect(sw, hwnd, &rect);\n\t\t}\n\t\telse if(uCurrentScrollbar == SB_VERT)\n\t\t{\n\t\t\t//get the total area of the normal Horz scrollbar area\n\t\t\tsb = &sw->sbarVert;\n\t\t\tGetVScrollRect(sw, hwnd, &rect);\n\t\t}\n\n\t\t//we need to do different things depending on if the\n\t\t//user is activating the scrollbar itself, or one of\n\t\t//the inserted buttons\n\t\tswitch(uCurrentScrollPortion)\n\t\t{\n#ifdef INCLUDE_BUTTONS\n\t\t//inserted buttons are being clicked\n\t\tcase HTSCROLL_INSERTED:\n\t\t\t\n\t\t\t//get the rectangle of the ACTIVE button \n\t\t\tbuttonIdx = GetButtonFromPt(sb, &rect, pt, FALSE);\n\t\t\tGetButtonRectFromId(sb, &rect, uCurrentButton);\n\t\n\t\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\n\t\t\t//Send the notification BEFORE we redraw, so the\n\t\t\t//bitmap can be changed smoothly by the user if they require\n\t\t\tif(uCurrentButton == buttonIdx)\n\t\t\t{\n\t\t\t\tSCROLLBUT *sbut = &sb->sbButtons[buttonIdx];\n\t\t\t\tUINT cmdid = sbut->uCmdId;\n\t\t\t\t\n\t\t\t\tif((sbut->uButType & SBBT_MASK) == SBBT_TOGGLEBUTTON)\n\t\t\t\t\tsbut->uState ^= 1;\n\n\t\t\t\t//send a notify??\t\t\t\t\n\t\t\t\t//only post a message if the command id is valid\n\t\t\t\tif(cmdid != -1 && cmdid > 0)\n\t\t\t\t\tSendMessage(hwnd, WM_COMMAND, MAKEWPARAM(cmdid, CSBN_CLICKED), 0);\n\t\t\t\n\t\t\t\t//user might have deleted this button, so redraw whole area\n\t\t\t\tNCPaint(sw, hwnd, 1, 0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//otherwise, just redraw the button in its new state\n\t\t\t\thdc = GetWindowDC(hwnd);\n\t\t\t\tDrawScrollButton(&sb->sbButtons[uCurrentButton], hdc, &rect, SBBS_NORMAL);\n\t\t\t\tReleaseDC(hwnd, hdc);\n\t\t\t}\n\t\n\t\t\tbreak;\n#endif\t// INCLUDE_BUTTONS\n\n\t\t//The scrollbar is active\n\t\tcase HTSCROLL_LEFT:  case HTSCROLL_RIGHT: \n\t\tcase HTSCROLL_PAGELEFT:  case HTSCROLL_PAGERIGHT: \n\t\tcase HTSCROLL_NONE:\n\t\t\t\n\t\t\tKillTimer(hwnd, uScrollTimerId);\n\n\t\tcase HTSCROLL_THUMB: \n\t\n\t\t\t//In case we were thumb tracking, make sure we stop NOW\n\t\t\tif(sw->fThumbTracking == TRUE)\n\t\t\t{\n\t\t\t\tSendScrollMessage(hwnd, uScrollTimerMsg, SB_THUMBPOSITION, nLastPos);\n\t\t\t\tsw->fThumbTracking = FALSE;\n\t\t\t}\n\n\t\t\t//send the SB_ENDSCROLL message now that scrolling has finished\n\t\t\tSendScrollMessage(hwnd, uScrollTimerMsg, SB_ENDSCROLL, 0);\n\n\t\t\t//adjust the total scroll area to become where the scrollbar\n\t\t\t//really is (take into account the inserted buttons)\n\t\t\tGetRealScrollRect(sb, &rect);\n\t\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\t\t\thdc = GetWindowDC(hwnd);\n\t\t\t\n\t\t\t//draw whichever scrollbar sb is\n\t\t\tNCDrawScrollbar(sb, hwnd, hdc, &rect, HTSCROLL_NORMAL);\n\n\t\t\tReleaseDC(hwnd, hdc);\n\t\t\tbreak;\n\t\t}\n\n\t\t//reset our state to default\n\t\tuCurrentScrollPortion = HTSCROLL_NONE;\n\t\tuScrollTimerPortion\t  = HTSCROLL_NONE;\n\t\tuScrollTimerId\t\t  = 0;\n\n\t\tuScrollTimerMsg       = 0;\n\t\tuCurrentScrollbar     = COOLSB_NONE;\n\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\t/*\n\t\t// Can't remember why I did this!\n\t\tif(GetCapture() == hwnd)\n\t\t{\n\t\t\tReleaseCapture();\n\t\t}*/\n\t}\n\n\treturn CallWindowProc(sw->oldproc, hwnd, WM_LBUTTONUP, wParam, lParam);\n}\n\n//\n//\tThis function is called whenever the mouse is moved and \n//  we are dragging the scrollbar thumb about.\n//\nstatic LRESULT ThumbTrackHorz(SCROLLBAR *sbar, HWND hwnd, int x, int y)\n{\n\tPOINT pt;\n\tRECT rc, winrect, rc2;\n\tCOLORREF crCheck1 = GetSBForeColor();\n\tCOLORREF crCheck2 = GetSBBackColor();\n\tHDC hdc;\n\tint thumbpos = nThumbPos;\n\tint pos;\n\tint siMaxMin = 0;\n\tUINT flatflag = sbar->fFlatScrollbar ? BF_FLAT : 0;\n\tBOOL fCustomDraw = FALSE;\n\n\tSCROLLINFO *si;\n\tsi = &sbar->scrollInfo;\n\n\tpt.x = x;\n\tpt.y = y;\n\n\t//draw the thumb at whatever position\n\trc = rcThumbBounds;\n\n\tSetRect(&rc2, rc.left -  THUMBTRACK_SNAPDIST*2, rc.top -    THUMBTRACK_SNAPDIST, \n\t\t\t\t  rc.right + THUMBTRACK_SNAPDIST*2, rc.bottom + THUMBTRACK_SNAPDIST);\n\n\trc.left +=  GetScrollMetric(sbar, SM_CXHORZSB);\n\trc.right -= GetScrollMetric(sbar, SM_CXHORZSB);\n\n\t//if the mouse is not in a suitable distance of the scrollbar,\n\t//then \"snap\" the thumb back to its initial position\n#ifdef SNAP_THUMB_BACK\n\tif(!PtInRect(&rc2, pt))\n\t{\n\t\tthumbpos = nThumbPos0;\n\t}\n\t//otherwise, move the thumb to where the mouse is\n\telse\n#endif //SNAP_THUMB_BACK\n\t{\n\t\t//keep the thumb within the scrollbar limits\n\t\tthumbpos = pt.x - nThumbMouseOffset;\n\t\tif(thumbpos < rc.left) thumbpos = rc.left;\n\t\tif(thumbpos > rc.right - nThumbSize) thumbpos = rc.right - nThumbSize;\n\t}\n\n\tGetWindowRect(hwnd, &winrect);\n\n\tif(sbar->nBarType == SB_VERT)\n\t\tRotateRect(&winrect);\n\t\n\thdc = GetWindowDC(hwnd);\n\t\t\n#ifdef CUSTOM_DRAW\n\tfCustomDraw = PostCustomPrePostPaint(hwnd, hdc, sbar, CDDS_PREPAINT) == CDRF_SKIPDEFAULT;\n#endif\n\n\tOffsetRect(&rc, -winrect.left, -winrect.top);\n\tthumbpos -= winrect.left;\n\n\t//draw the margin before the thumb\n\tSetRect(&rc2, rc.left, rc.top, thumbpos, rc.bottom);\n\tRotateRect0(sbar, &rc2);\n\n\tif(fCustomDraw)\n\t\tPostCustomDrawNotify(hwnd, hdc, sbar->nBarType, &rc2, SB_PAGELEFT, 0, 0, 0);\n\telse\n\t\tDrawCheckedRect(hdc, &rc2, crCheck1, crCheck2);\n\t\n\tRotateRect0(sbar, &rc2);\n\n\t//draw the margin after the thumb \n\tSetRect(&rc2, thumbpos+nThumbSize, rc.top, rc.right, rc.bottom);\n\t\n\tRotateRect0(sbar, &rc2);\n\t\n\tif(fCustomDraw)\n\t\tPostCustomDrawNotify(hwnd, hdc, sbar->nBarType, &rc2, SB_PAGERIGHT, 0, 0, 0);\n\telse\n\t\tDrawCheckedRect(hdc, &rc2, crCheck1, crCheck2);\n\t\n\tRotateRect0(sbar, &rc2);\n\t\n\t//finally draw the thumb itelf. This is how it looks on win2000, anyway\n\tSetRect(&rc2, thumbpos, rc.top, thumbpos+nThumbSize, rc.bottom);\n\t\n\tRotateRect0(sbar, &rc2);\n\n\tif(fCustomDraw)\n\t\tPostCustomDrawNotify(hwnd, hdc, sbar->nBarType, &rc2, SB_THUMBTRACK, TRUE, TRUE, FALSE);\n\telse\n\t{\n\n#ifdef FLAT_SCROLLBARS\t\n\t\tif(sbar->fFlatScrollbar)\n\t\t\tPaintRect(hdc, &rc2, GetSysColor(COLOR_3DSHADOW));\n\t\telse\n#endif\n\t\t{\n\t\t\t\tDrawBlankButton(hdc, &rc2, flatflag);\n\t\t}\n\t}\n\n\tRotateRect0(sbar, &rc2);\n\tReleaseDC(hwnd, hdc);\n\n\t//post a SB_TRACKPOS message!!!\n\tsiMaxMin = si->nMax - si->nMin;\n\n\tif(siMaxMin > 0)\n\t\tpos = MulDiv(thumbpos-rc.left, siMaxMin-si->nPage + 1, rc.right-rc.left-nThumbSize);\n\telse\n\t\tpos = thumbpos - rc.left;\n\n\tif(pos != nLastPos)\n\t{\n\t\tsi->nTrackPos = pos;\t\n\t\tSendScrollMessage(hwnd, uScrollTimerMsg, SB_THUMBTRACK, pos);\n\t}\n\n\tnLastPos = pos;\n\n#ifdef CUSTOM_DRAW\n\tPostCustomPrePostPaint(hwnd, hdc, sbar, CDDS_POSTPAINT);\n#endif\n\t\n\treturn 0;\n}\n\n//\n//\tremember to rotate the thumb bounds rectangle!!\n//\nstatic LRESULT ThumbTrackVert(SCROLLBAR *sb, HWND hwnd, int x, int y)\n{\n\t//sw->swapcoords = TRUE;\n\tRotateRect(&rcThumbBounds);\n\tThumbTrackHorz(sb, hwnd, y, x);\n\tRotateRect(&rcThumbBounds);\n\t//sw->swapcoords = FALSE;\n\n\treturn 0;\n}\n\n//\n//\tCalled when we have set the capture from the NCLButtonDown(...)\n//\t\nstatic LRESULT MouseMove(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n\tRECT rect;\n\tUINT thisportion;\n\tHDC hdc;\n\tstatic UINT lastportion = 0;\n\tstatic UINT lastbutton = 0;\n\tPOINT pt;\n\tRECT winrect;\n\tUINT buttonIdx = 0;\n\n\tif(sw->fThumbTracking == TRUE)\n\t{\n\t\tint x, y;\n\t\tlParam = GetMessagePos();\n\t\tx = LOWORD(lParam);\n\t\ty = HIWORD(lParam);\n\n\t\tif(uCurrentScrollbar == SB_HORZ)\n\t\t\treturn ThumbTrackHorz(&sw->sbarHorz, hwnd, x,y);\n\n\n\t\telse if(uCurrentScrollbar == SB_VERT)\n\t\t\treturn ThumbTrackVert(&sw->sbarVert, hwnd, x,y);\n\t}\n\n\tif(uCurrentScrollPortion == HTSCROLL_NONE)\n\t{\n\t\treturn CallWindowProc(sw->oldproc, hwnd, WM_MOUSEMOVE, wParam, lParam);\n\t}\n\telse\n\t{\n\t\tLPARAM nlParam;\n\t\tSCROLLBAR *sb = &sw->sbarHorz;\n\t\tSCROLLBUT *sbut = 0;\n\n\t\tnlParam = GetMessagePos();\n\n\t\tGetWindowRect(hwnd, &winrect);\n\n\t\tpt.x = LOWORD(nlParam);\n\t\tpt.y = HIWORD(nlParam);\n\n\t\t//emulate the mouse input on a scrollbar here...\n\t\tif(uCurrentScrollbar == SB_HORZ)\n\t\t{\n\t\t\tsb = &sw->sbarHorz;\n\t\t}\n\t\telse if(uCurrentScrollbar == SB_VERT)\n\t\t{\n\t\t\tsb = &sw->sbarVert;\n\t\t}\n\n\t\t//get the total area of the normal scrollbar area\n\t\tGetScrollRect(sw, sb->nBarType, hwnd, &rect);\n\t\t\n\t\t//see if we clicked in the inserted buttons / normal scrollbar\n\t\t//thisportion = GetPortion(sb, hwnd, &rect, LOWORD(lParam), HIWORD(lParam));\n\t\tthisportion = GetPortion(sb, hwnd, &rect, pt.x, pt.y);\n\t\t\n\t\t//we need to do different things depending on if the\n\t\t//user is activating the scrollbar itself, or one of\n\t\t//the inserted buttons\n\t\tswitch(uCurrentScrollPortion)\n\t\t{\n#ifdef INCLUDE_BUTTONS\n\t\t//inserted buttons are being clicked\n\t\tcase HTSCROLL_INSERTED:\n\t\t\t\n\t\t\t//find the index of the button that has been clicked\n\t\t\t//Don't adjust the rectangle though\n\t\t\tbuttonIdx = GetButtonFromPt(sb, &rect, pt, FALSE);\n\t\t\t\t\t\t\n\t\t\t//Get the rectangle of the active button\n\t\t\tGetButtonRectFromId(sb, &rect, uCurrentButton);\n\n\t\t\t//if the button to the LEFT of the current \n\t\t\t//button is resizable, then resize it\n#ifdef RESIZABLE_BUTTONS\n\t\t\tif(uCurrentButton > 0)\n\t\t\t{\n\t\t\t\tsbut = &sb->sbButtons[uCurrentButton - 1];\n\t\t\t\n\t\t\t\t//only resize if BOTH buttons are on same side of scrollbar\n\t\t\t\tif(sbut->uPlacement == (sbut+1)->uPlacement && (sbut->uButType & SBBM_RESIZABLE))\n\t\t\t\t{\n\t\t\t\t\tint oldsize = sbut->nSize;\n\t\t\t\t\tint butsize1, butsize2;\n\t\t\t\t\tRECT rect2;\n\t\t\t\t\tint scrollsize;\n\n\t\t\t\t\tif(uCurrentScrollbar == SB_HORZ)\n\t\t\t\t\t{\n\t\t\t\t\t\trect.left -= GetSingleButSize(sb, sbut);\n\t\t\t\t\t\tsbut->nSize = pt.x - rect.left;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\trect.top -= GetSingleButSize(sb, sbut);\n\t\t\t\t\t\tsbut->nSize = pt.y - rect.top;\n\t\t\t\t\t}\n\n\t\t\t\t\t//if(sbut->nSize < 0)\tsbut->nSize = 0;\n\t\t\t\t\tif(sbut->nSize < (int)sbut->nMinSize)\n\t\t\t\t\t\tsbut->nSize = sbut->nMinSize;\n\n\t\t\t\t\tif((UINT)sbut->nSize > (UINT)sbut->nMaxSize)\n\t\t\t\t\t\tsbut->nSize = sbut->nMaxSize;\n\t\t\t\t\t\n\t\t\t\t\tGetScrollRect(sw, uCurrentScrollbar, hwnd, &rect2);\n\t\t\t\t\t\n\t\t\t\t\tif(uCurrentScrollbar == SB_HORZ)\n\t\t\t\t\t\tscrollsize = rect2.right-rect2.left;\n\t\t\t\t\telse\n\t\t\t\t\t\tscrollsize = rect2.bottom-rect2.top;\n\n\t\t\t\t\tbutsize1 = GetButtonSize(sb, hwnd, SBBP_LEFT);\n\t\t\t\t\tbutsize2 = GetButtonSize(sb, hwnd, SBBP_RIGHT);\n\n\t\t\t\t\t//adjust the button size if it gets too big\n\t\t\t\t\tif(butsize1 + butsize2 > scrollsize  - MINSCROLLSIZE)\n\t\t\t\t\t{\n\t\t\t\t\t\tsbut->nSize -= (butsize1+butsize2) - (scrollsize - MINSCROLLSIZE);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//remember what size the USER set the button to\n\t\t\t\t\tsbut->nSizeReserved = sbut->nSize;\n\t\t\t\t\tNCPaint(sw, hwnd, (WPARAM)1, (LPARAM)0);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n#endif\t//RESIZABLE_BUTTONS\t\t\t\n\t\t\t\n\t\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\n\t\t\thdc = GetWindowDC(hwnd);\n\t\t\t\n\t\t\t//if the button under the mouse is not the active button,\n\t\t\t//then display the active button in its normal state\n\t\t\tif(buttonIdx != uCurrentButton \n\t\t\t\t//include this if toggle buttons always stay depressed\n\t\t\t\t//if they are being activated\n\t\t\t\t&& (sb->sbButtons[uCurrentButton].uButType & SBBT_MASK) != SBBT_TOGGLEBUTTON)\n\t\t\t{\n\t\t\t\tif(lastbutton != buttonIdx)\n\t\t\t\t\tDrawScrollButton(&sb->sbButtons[uCurrentButton], hdc, &rect, SBBS_NORMAL);\n\t\t\t}\n\t\t\t//otherwise, depress the active button if the mouse is over\n\t\t\t//it (just like a normal scroll button works)\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(lastbutton != buttonIdx)\n\t\t\t\t\tDrawScrollButton(&sb->sbButtons[uCurrentButton], hdc, &rect, SBBS_PUSHED);\n\t\t\t}\n\n\t\t\tReleaseDC(hwnd, hdc);\n\t\t\treturn CallWindowProc(sw->oldproc, hwnd, WM_MOUSEMOVE, wParam, lParam);\n\t\t\t//break;\n\n#endif\t//INCLUDE_BUTTONS\n\n\t\t//The scrollbar is active\n\t\tcase HTSCROLL_LEFT:\t\t case HTSCROLL_RIGHT:case HTSCROLL_THUMB: \n\t\tcase HTSCROLL_PAGELEFT:  case HTSCROLL_PAGERIGHT: \n\t\tcase HTSCROLL_NONE:\n\t\t\t\n\t\t\t//adjust the total scroll area to become where the scrollbar\n\t\t\t//really is (take into account the inserted buttons)\n\t\t\tGetRealScrollRect(sb, &rect);\n\n\t\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\t\t\thdc = GetWindowDC(hwnd);\n\t\t\n\t\t\tif(thisportion != uCurrentScrollPortion)\n\t\t\t{\n\t\t\t\tuScrollTimerPortion = HTSCROLL_NONE;\n\n\t\t\t\tif(lastportion != thisportion)\n\t\t\t\t\tNCDrawScrollbar(sb, hwnd, hdc, &rect, HTSCROLL_NORMAL);\n\t\t\t}\n\t\t\t//otherwise, draw the button in its depressed / clicked state\n\t\t\telse\n\t\t\t{\n\t\t\t\tuScrollTimerPortion = uCurrentScrollPortion;\n\n\t\t\t\tif(lastportion != thisportion)\n\t\t\t\t\tNCDrawScrollbar(sb, hwnd, hdc, &rect, thisportion);\n\t\t\t}\n\n\t\t\tReleaseDC(hwnd, hdc);\n\n\t\t\tbreak;\n\t\t}\n\n\n\t\tlastportion = thisportion;\n\t\tlastbutton  = buttonIdx;\n\n\t\t//must return zero here, because we might get cursor anomilies\n\t\t//CallWindowProc(sw->oldproc, hwnd, WM_MOUSEMOVE, wParam, lParam);\n\t\treturn 0;\n\t\t\n\t}\n}\n\n#ifdef INCLUDE_BUTTONS\n#ifdef RESIZABLE_BUTTONS\n//\n//\tAny resizable buttons must be shrunk to fit if the window is made too small\n//\nstatic void ResizeButtonsToFit(SCROLLWND *sw, SCROLLBAR *sbar, HWND hwnd)\n{\n\tint butsize1, butsize2;\n\tRECT rc;\n\tint scrollsize;\n\tint i;\n\tSCROLLBUT *sbut;\n\n\t//make sure that the scrollbar can fit into space, by\n\t//shrinking any resizable buttons\n\tGetScrollRect(sw, sbar->nBarType, hwnd, &rc);\n\n\tif(sbar->nBarType == SB_HORZ)\n\t\tscrollsize = rc.right-rc.left;\n\telse\n\t\tscrollsize = rc.bottom-rc.top;\n\n\t//restore any resizable buttons to their user-defined sizes,\n\t//before shrinking them to fit. This means when we make the window\n\t//bigger, the buttons will restore to their initial sizes\n\tfor(i = 0; i < sbar->nButtons; i++)\n\t{\n\t\tsbut = &sbar->sbButtons[i];\n\t\tif(sbut->uButType & SBBM_RESIZABLE)\n\t\t{\n\t\t\tsbut->nSize = sbut->nSizeReserved;\n\t\t}\n\t}\n\t\n\tbutsize1 = GetButtonSize(sbar, hwnd, SBBP_LEFT);\n\tbutsize2 = GetButtonSize(sbar, hwnd, SBBP_RIGHT);\n\n\tif(butsize1 + butsize2 > scrollsize - MINSCROLLSIZE)\n\t{\n\t\ti = 0;\n\t\twhile(i < sbar->nButtons && \n\t\t\tbutsize1 + butsize2 > scrollsize - MINSCROLLSIZE)\n\t\t{\n\t\t\tsbut = &sbar->sbButtons[i++];\n\t\t\tif(sbut->uButType & SBBM_RESIZABLE)\n\t\t\t{\n\t\t\t\tint oldsize = sbut->nSize;\n\t\t\t\tsbut->nSize -= (butsize1+butsize2) - (scrollsize-MINSCROLLSIZE);\n\n\t\t\t\tif(sbut->nSize < (int)sbut->nMinSize)\n\t\t\t\t\tsbut->nSize = sbut->nMinSize;\n\n\t\t\t\tif((UINT)sbut->nSize > (UINT)sbut->nMaxSize)\n\t\t\t\t\tsbut->nSize = sbut->nMaxSize;\n\n\t\t\t\t\n\t\t\t\tbutsize1 -= (oldsize - sbut->nSize);\n\t\t\t}\n\t\t}\n\t}\n\n}\n#endif\n#endif\n\n//\n//\tWe must allocate from in the non-client area for our scrollbars\n//\tCall the default window procedure first, to get the borders (if any)\n//\tallocated some space, then allocate the space for the scrollbars\n//\tif they fit\n//\nstatic LRESULT NCCalcSize(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n\tNCCALCSIZE_PARAMS *nccsp;\n\tRECT *rect;\n\tRECT oldrect;\n\tBOOL fCalcValidRects = (wParam == TRUE);\n\tSCROLLBAR *sb;\n\tUINT ret;\n\tDWORD dwStyle;\n\n\t//Regardless of the value of fCalcValidRects, the first rectangle \n\t//in the array specified by the rgrc structure member of the \n\t//NCCALCSIZE_PARAMS structure contains the coordinates of the window,\n\t//so we can use the exact same code to modify this rectangle, when\n\t//wParam is TRUE and when it is FALSE.\n\tnccsp = (NCCALCSIZE_PARAMS *)lParam;\n\trect = &nccsp->rgrc[0];\n\toldrect = *rect;\n\n\tdwStyle = GetWindowLong(hwnd, GWL_STYLE);\n\n\t// TURN OFF SCROLL-STYLES.\n    if ( dwStyle & (WS_VSCROLL|WS_HSCROLL) )\n    {\n        sw->bPreventStyleChange = TRUE;\n        SetWindowLong(hwnd, GWL_STYLE, dwStyle & ~(WS_VSCROLL|WS_HSCROLL));\n    }\n\t\n\t//call the default procedure to get the borders allocated\n\tret = CallWindowProc(sw->oldproc, hwnd, WM_NCCALCSIZE, wParam, lParam);\n\n\t// RESTORE PREVIOUS STYLES (if present at all)\n    if ( dwStyle & (WS_VSCROLL|WS_HSCROLL) )\n    {\n        SetWindowLong(hwnd, GWL_STYLE, dwStyle);\n        sw->bPreventStyleChange = FALSE;\n    }\n\n\t// calculate what the size of each window border is,\n\tsw->cxLeftEdge   = rect->left     - oldrect.left;\n\tsw->cxRightEdge  = oldrect.right  - rect->right;\n\tsw->cyTopEdge    = rect->top      - oldrect.top;\n\tsw->cyBottomEdge = oldrect.bottom - rect->bottom;\n\n\tsb = &sw->sbarHorz;\n\n\t//if there is room, allocate some space for the horizontal scrollbar\n\t//NOTE: Change the \">\" to a \">=\" to make the horz bar totally fill the\n\t//window before disappearing\n\tif((sb->fScrollFlags & CSBS_VISIBLE) && \n#ifdef COOLSB_FILLWINDOW\n\t\trect->bottom - rect->top >= GetScrollMetric(sb, SM_CYHORZSB))\n#else\n\t\trect->bottom - rect->top > GetScrollMetric(sb, SM_CYHORZSB))\n#endif\n\t{\n\t\trect->bottom -= GetScrollMetric(sb, SM_CYHORZSB);\n\t\tsb->fScrollVisible = TRUE;\n\t}\n\telse\n\t\tsb->fScrollVisible = FALSE;\n\n\tsb = &sw->sbarVert;\n\n\t//if there is room, allocate some space for the vertical scrollbar\n\tif((sb->fScrollFlags & CSBS_VISIBLE) && \n\t\trect->right - rect->left >= GetScrollMetric(sb, SM_CXVERTSB))\n\t{\n\t\tif(sw->fLeftScrollbar)\n\t\t\trect->left  += GetScrollMetric(sb, SM_CXVERTSB);\n\t\telse\n\t\t\trect->right -= GetScrollMetric(sb, SM_CXVERTSB);\n\n\t\tsb->fScrollVisible = TRUE;\n\t}\n\telse\n\t\tsb->fScrollVisible = FALSE;\n\n#ifdef INCLUDE_BUTTONS\n#ifdef RESIZABLE_BUTTONS\n\tResizeButtonsToFit(sw, &sw->sbarHorz, hwnd);\n\tResizeButtonsToFit(sw, &sw->sbarVert, hwnd);\n#endif\n#endif\n\n\t//don't return a value unless we actually modify the other rectangles\n\t//in the NCCALCSIZE_PARAMS structure. In this case, we return 0\n\t//no matter what the value of fCalcValidRects is\n\treturn ret;//FALSE;\n}\n\n//\n//\tused for hot-tracking over the scroll buttons\n//\nstatic LRESULT NCMouseMove(SCROLLWND *sw, HWND hwnd, WPARAM wHitTest, LPARAM lParam)\n{\n\t//install a timer for the mouse-over events, if the mouse moves\n\t//over one of the scrollbars\n#ifdef HOT_TRACKING\n\thwndCurCoolSB = hwnd;\n\tif(wHitTest == HTHSCROLL)\n\t{\n\t\tif(uMouseOverScrollbar == SB_HORZ)\n\t\t\treturn CallWindowProc(sw->oldproc, hwnd, WM_NCMOUSEMOVE, wHitTest, lParam);\n\n\t\tuLastHitTestPortion = HTSCROLL_NONE;\n\t\tuHitTestPortion     = HTSCROLL_NONE;\n\t\tGetScrollRect(sw, SB_HORZ, hwnd, &MouseOverRect);\n\t\tuMouseOverScrollbar = SB_HORZ;\n\t\tuMouseOverId = SetTimer(hwnd, COOLSB_TIMERID3, COOLSB_TIMERINTERVAL3, 0);\n\n\t\tNCPaint(sw, hwnd, 1, 0);\n\t}\n\telse if(wHitTest == HTVSCROLL)\n\t{\n\t\tif(uMouseOverScrollbar == SB_VERT)\n\t\t\treturn CallWindowProc(sw->oldproc, hwnd, WM_NCMOUSEMOVE, wHitTest, lParam);\n\n\t\tuLastHitTestPortion = HTSCROLL_NONE;\n\t\tuHitTestPortion     = HTSCROLL_NONE;\n\t\tGetScrollRect(sw, SB_VERT, hwnd, &MouseOverRect);\n\t\tuMouseOverScrollbar = SB_VERT;\n\t\tuMouseOverId = SetTimer(hwnd, COOLSB_TIMERID3, COOLSB_TIMERINTERVAL3, 0);\n\n\t\tNCPaint(sw, hwnd, 1, 0);\n\t}\n\n#endif //HOT_TRACKING\n\treturn CallWindowProc(sw->oldproc, hwnd, WM_NCMOUSEMOVE, wHitTest, lParam);\n}\n\n//\n//\tTimer routine to generate scrollbar messages\n//\nstatic LRESULT CoolSB_Timer(SCROLLWND *swnd, HWND hwnd, WPARAM wTimerId, LPARAM lParam)\n{\n\t//let all timer messages go past if we don't have a timer installed ourselves\n\tif(uScrollTimerId == 0 && uMouseOverId == 0)\n\t{\n\t\treturn CallWindowProc(swnd->oldproc, hwnd, WM_TIMER, wTimerId, lParam);\n\t}\n\n#ifdef HOT_TRACKING\n\t//mouse-over timer\n\tif(wTimerId == COOLSB_TIMERID3)\n\t{\n\t\tPOINT pt;\n\t\tRECT rect, winrect;\n\t\tHDC hdc;\n\t\tSCROLLBAR *sbar;\n\n\t\tif(swnd->fThumbTracking)\n\t\t\treturn 0;\n\n\t\t//if the mouse moves outside the current scrollbar,\n\t\t//then kill the timer..\n\t\tGetCursorPos(&pt);\n\n\t\tif(!PtInRect(&MouseOverRect, pt))\n\t\t{\n\t\t\tKillTimer(hwnd, uMouseOverId);\n\t\t\tuMouseOverId = 0;\n\t\t\tuMouseOverScrollbar = COOLSB_NONE;\n\t\t\tuLastHitTestPortion = HTSCROLL_NONE;\n\n\t\t\tuHitTestPortion = HTSCROLL_NONE;\n\t\t\tNCPaint(swnd, hwnd, 1, 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(uMouseOverScrollbar == SB_HORZ)\n\t\t\t{\n\t\t\t\tsbar = &swnd->sbarHorz;\n\t\t\t\tuHitTestPortion = GetHorzPortion(sbar, hwnd, &MouseOverRect, pt.x, pt.y);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsbar = &swnd->sbarVert;\n\t\t\t\tuHitTestPortion = GetVertPortion(sbar, hwnd, &MouseOverRect, pt.x, pt.y);\n\t\t\t}\n\n\t\t\tif(uLastHitTestPortion != uHitTestPortion)\n\t\t\t{\n\t\t\t\trect = MouseOverRect;\n\t\t\t\tGetRealScrollRect(sbar, &rect);\n\n\t\t\t\tGetWindowRect(hwnd, &winrect);\n\t\t\t\tOffsetRect(&rect, -winrect.left, -winrect.top);\n\n\t\t\t\thdc = GetWindowDC(hwnd);\n\t\t\t\tNCDrawScrollbar(sbar, hwnd, hdc, &rect, HTSCROLL_NONE);\n\t\t\t\tReleaseDC(hwnd, hdc);\n\t\t\t}\n\t\t\t\n\t\t\tuLastHitTestPortion = uHitTestPortion;\n\t\t}\n\n\t\treturn 0;\n\t}\n#endif // HOT_TRACKING\n\n\t//if the first timer goes off, then we can start a more\n\t//regular timer interval to auto-generate scroll messages\n\t//this gives a slight pause between first pressing the scroll arrow, and the\n\t//actual scroll starting\n\tif(wTimerId == COOLSB_TIMERID1)\n\t{\n\t\tKillTimer(hwnd, uScrollTimerId);\n\t\tuScrollTimerId = SetTimer(hwnd, COOLSB_TIMERID2, COOLSB_TIMERINTERVAL2, 0);\n\t\treturn 0;\n\t}\n\t//send the scrollbar message repeatedly\n\telse if(wTimerId == COOLSB_TIMERID2)\n\t{\n\t\t//need to process a spoof WM_MOUSEMOVE, so that\n\t\t//we know where the mouse is each time the scroll timer goes off.\n\t\t//This is so we can stop sending scroll messages if the thumb moves\n\t\t//under the mouse.\n\t\tPOINT pt;\n\t\tGetCursorPos(&pt);\n\t\tScreenToClient(hwnd, &pt);\n\t\t\n\t\tMouseMove(swnd, hwnd, MK_LBUTTON, MAKELPARAM(pt.x, pt.y));\n\n\t\tif(uScrollTimerPortion != HTSCROLL_NONE)\n\t\t\tSendScrollMessage(hwnd, uScrollTimerMsg, uScrollTimerPortion, 0);\n\t\t\n\t\treturn 0;\n\t}\n\telse\n\t{\n\t\treturn CallWindowProc(swnd->oldproc, hwnd, WM_TIMER, wTimerId, lParam);\n\t}\n}\n\n//\n//\tWe must intercept any calls to SetWindowLong, to check if\n//  left-scrollbars are taking effect or not\n//\nstatic LRESULT CoolSB_StyleChange(SCROLLWND *swnd, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\n{\n\tSTYLESTRUCT *ss = (STYLESTRUCT *)lParam;\n\n\tif(wParam == GWL_EXSTYLE)\n\t{\n\t\tif(ss->styleNew & WS_EX_LEFTSCROLLBAR)\n\t\t\tswnd->fLeftScrollbar = TRUE;\n\t\telse\n\t\t\tswnd->fLeftScrollbar = FALSE;\n\t}\n\n\treturn CallWindowProc(swnd->oldproc, hwnd, msg, wParam, lParam);\n}\n\nstatic UINT curTool = -1;\nstatic LRESULT CoolSB_Notify(SCROLLWND *swnd, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n#ifdef COOLSB_TOOLTIPS\n\n\tNMTTDISPINFO *nmdi = (NMTTDISPINFO *)lParam;\n\n\tif(nmdi->hdr.hwndFrom == swnd->hwndToolTip &&\n\t\tnmdi->hdr.code == TTN_GETDISPINFO)\n\t{\n\t\t//convert the tooltip notify from a \"ISHWND\" style\n\t\t//request to an id-based request. \n\t\t//We do this because our tooltip is a window-style\n\t\t//tip, with no tools, and the GETDISPINFO request must\n\t\t//indicate which button to retrieve the text for\n\t\t//nmdi->hdr.idFrom = curTool;\n\t\tnmdi->hdr.idFrom = curTool;\n\t\tnmdi->hinst = GetModuleHandle(0);\n\t\tnmdi->uFlags &= ~TTF_IDISHWND;\n\t}\n#endif\t//COOLSB_TOOLTIPS\n\n\treturn CallWindowProc(swnd->oldproc, hwnd, WM_NOTIFY, wParam, lParam);\t\n}\n\nstatic LRESULT SendToolTipMessage0(HWND hwndTT, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\treturn SendMessage(hwndTT, message, wParam, lParam);\n}\n\n#ifdef COOLSB_TOOLTIPS\n#define SendToolTipMessage\t\tSendToolTipMessage0\n#else\n#define SendToolTipMessage\t\t1 ? (void)0 : SendToolTipMessage0\n#endif\n\n\n//\n//\tWe must intercept any calls to SetWindowLong, to make sure that\n//\tthe user does not set the WS_VSCROLL or WS_HSCROLL styles\n//\nstatic LRESULT CoolSB_SetCursor(SCROLLWND *swnd, HWND hwnd, WPARAM wParam, LPARAM lParam)\n{\n#ifdef INCLUDE_BUTTONS\n\tUINT lo = LOWORD(lParam);\n\tUINT hi = HIWORD(lParam);\n\tUINT xy;\n\tRECT rect;\n\tSCROLLBAR *sbar;\n\tSCROLLBUT *sbut;\n\tPOINT pt;\n\tUINT id;\n\tstatic UINT lastid;\n\n#ifdef HIDE_CURSOR_AFTER_MOUSEUP\n\tstatic UINT lastmsg;\n\tif(lastmsg == WM_LBUTTONDOWN)\n\t{\n\t\tlastmsg =  hi;\n\t\treturn CallWindowProc(swnd->oldproc, hwnd, WM_SETCURSOR, wParam, lParam);\t\n\t}\n\telse\n\t\tlastmsg =  hi;\n#endif\n\t\n\t//if we are over either or our scrollbars\n\tif(lo == HTHSCROLL || lo == HTVSCROLL)\n\t{\n\t\txy = GetMessagePos();\n\t\tpt.x = LOWORD(xy);\n\t\tpt.y = HIWORD(xy);\n\n\t\tif(lo == HTHSCROLL)\n\t\t{\n\t\t\tsbar = &swnd->sbarHorz;\n\t\t\tGetScrollRect(swnd, SB_HORZ, hwnd, &rect);\n\t\t\tid = GetHorzPortion(sbar, hwnd, &rect, pt.x, pt.y);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsbar = &swnd->sbarVert;\n\t\t\tGetScrollRect(swnd, SB_VERT, hwnd, &rect);\n\t\t\tid = GetVertPortion(sbar, hwnd, &rect, pt.x, pt.y);\n\t\t}\n\n\t\tif(id != HTSCROLL_INSERTED)\n\t\t{\n\t\t\tif(swnd->hwndToolTip != 0)\n\t\t\t{\n\t\t\t\tSendToolTipMessage(swnd->hwndToolTip, TTM_ACTIVATE, FALSE, 0);\n\t\t\t\tSendToolTipMessage(swnd->hwndToolTip, TTM_POP, 0, 0);\n\t\t\t}\n\n\t\t\treturn CallWindowProc(swnd->oldproc, hwnd, WM_SETCURSOR, wParam, lParam);\n\t\t}\n\t\t\n\t\tif(swnd->hwndToolTip != 0)\n\t\t{\n\t\t\tSendToolTipMessage(swnd->hwndToolTip, TTM_ACTIVATE, TRUE, 0);\n\t\t}\n\n\t\t//set the cursor if one has been specified\n\t\tif((id = GetButtonFromPt(sbar, &rect, pt, TRUE)) != -1)\n\t\t{\n\t\t\tsbut = &sbar->sbButtons[id];\n\t\t\tcurTool = sbut->uCmdId;\n\n\t\t\tif(lastid != id && swnd->hwndToolTip != 0)\n\t\t\t{\n\t\t\t\tif(IsWindowVisible(swnd->hwndToolTip))\n\t\t\t\t\tSendToolTipMessage(swnd->hwndToolTip, TTM_UPDATE, TRUE, 0);\n\t\t\t}\n\n\t\t\tlastid = id;\n\n\t\t\tif(sbut->hCurs != 0)\n\t\t\t{\n\t\t\t\tSetCursor(sbut->hCurs);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcurTool = -1;\n\t\t\tlastid = -1;\n\t\t}\n\t}\n\telse if(swnd->hwndToolTip != 0)\n\t{\n\t\tSendToolTipMessage(swnd->hwndToolTip, TTM_ACTIVATE, FALSE, 0);\n\t\tSendToolTipMessage(swnd->hwndToolTip, TTM_POP, 0, 0);\n\t}\n\n#endif\t//INCLUDE_BUTTONS\n\treturn CallWindowProc(swnd->oldproc, hwnd, WM_SETCURSOR, wParam, lParam);\n}\n\n\n//\n//\tSend the specified message to the tooltip control\n//\nstatic void __stdcall RelayMouseEvent(HWND hwnd, HWND hwndToolTip, UINT event)\n{\n#ifdef COOLSB_TOOLTIPS\n\tMSG msg;\n\n\tCoolSB_ZeroMemory(&msg, sizeof(MSG));\n\tmsg.hwnd = hwnd;\n\tmsg.message = event;\n\n\tSendMessage(hwndToolTip, TTM_RELAYEVENT, 0, (LONG)&msg);\n#else\n\tUNREFERENCED_PARAMETER(hwnd);\n\tUNREFERENCED_PARAMETER(hwndToolTip);\n\tUNREFERENCED_PARAMETER(event);\n#endif\n}\n\n\n//\n//  CoolScrollbar subclass procedure.\n//\tHandle all messages needed to mimick normal windows scrollbars\n//\nLRESULT CALLBACK CoolSBWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tWNDPROC oldproc;\n\tSCROLLWND *swnd = GetScrollWndFromHwnd(hwnd);\n\tstatic int count;\n\n\tswitch(message)\n\t{\n\tcase WM_NCDESTROY:\n\t\t//this should NEVER be called, because the user\n\t\t//should have called Uninitialize() themselves.\n\n\t\t//However, if the user tries to call Uninitialize().. \n\t\t//after this window is destroyed, this window's entry in the lookup\n\t\t//table will not be there, and the call will fail\n\t\toldproc = swnd->oldproc;\n\t\tUninitializeCoolSB(hwnd);\n\t\t\n\t\t//we must call the original window procedure, otherwise it\n\t\t//will never get the WM_NCDESTROY message, and it wouldn't\n\t\t//be able to clean up etc.\n\t\treturn CallWindowProc(oldproc, hwnd, message, wParam, lParam);\n\n\tcase WM_NCCALCSIZE:\n\t\treturn NCCalcSize(swnd, hwnd, wParam, lParam);\n\n\tcase WM_NCPAINT:\n\t\treturn NCPaint(swnd, hwnd, wParam, lParam);\t\n\n\tcase WM_NCHITTEST:\n\t\treturn NCHitTest(swnd, hwnd, wParam, lParam);\n\n\tcase WM_NCRBUTTONDOWN: case WM_NCRBUTTONUP: \n\tcase WM_NCMBUTTONDOWN: case WM_NCMBUTTONUP: \n\t\tRelayMouseEvent(hwnd, swnd->hwndToolTip, (WM_MOUSEMOVE-WM_NCMOUSEMOVE) + (message));\n\t\tif(wParam == HTHSCROLL || wParam == HTVSCROLL) \n\t\t\treturn 0;\n\t\telse \n\t\t\tbreak;\n\n\tcase WM_NCLBUTTONDBLCLK:\n\t\t//TRACE(\"WM_NCLBUTTONDBLCLK %d\\n\", count++);\n\t\tif(wParam == HTHSCROLL || wParam == HTVSCROLL)\n\t\t\treturn NCLButtonDown(swnd, hwnd, wParam, lParam);\n\t\telse\n\t\t\tbreak;\n\n\tcase WM_NCLBUTTONDOWN:\n\t\t//TRACE(\"WM_NCLBUTTONDOWN%d\\n\", count++);\n\t\tRelayMouseEvent(hwnd, swnd->hwndToolTip, WM_LBUTTONDOWN);\n\t\treturn NCLButtonDown(swnd, hwnd, wParam, lParam);\n\n\n\tcase WM_LBUTTONUP:\n\t\t//TRACE(\"WM_LBUTTONUP %d\\n\", count++);\n\t\tRelayMouseEvent(hwnd, swnd->hwndToolTip, WM_LBUTTONUP);\n\t\treturn LButtonUp(swnd, hwnd, wParam, lParam);\n\n\tcase WM_NOTIFY:\n\t\treturn CoolSB_Notify(swnd, hwnd, wParam, lParam);\n\n\t//Mouse moves are received when we set the mouse capture,\n\t//even when the mouse moves over the non-client area\n\tcase WM_MOUSEMOVE: \n\t\t//TRACE(\"WM_MOUSEMOVE %d\\n\", count++);\n\t\treturn MouseMove(swnd, hwnd, wParam, lParam);\n\t\n\tcase WM_TIMER:\n\t\treturn CoolSB_Timer(swnd, hwnd, wParam, lParam);\n\n\t//case WM_STYLECHANGING:\n\t//\treturn CoolSB_StyleChange(swnd, hwnd, WM_STYLECHANGING, wParam, lParam);\n\tcase WM_STYLECHANGED:\n\n\t\tif(swnd->bPreventStyleChange)\n\t\t{\n\t\t\t// the NCPAINT handler has told us to eat this message!\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n            if (message == WM_STYLECHANGED) \n\t\t\t\treturn CoolSB_StyleChange(swnd, hwnd, WM_STYLECHANGED, wParam, lParam);\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\n\tcase WM_NCMOUSEMOVE: \n\t\t{\n\t\t\tstatic LONG lastpos = -1;\n\n\t\t\t//TRACE(\"WM_NCMOUSEMOVE %d\\n\", count++);\n\n\t\t\t//The problem with NCMOUSEMOVE is that it is sent continuously\n\t\t\t//even when the mouse is stationary (under win2000 / win98)\n\t\t\t//\n\t\t\t//Tooltips don't like being sent a continous stream of mouse-moves\n\t\t\t//if the cursor isn't moving, because they will think that the mouse\n\t\t\t//is moving position, and the internal timer will never expire\n\t\t\t//\n\t\t\tif(lastpos != lParam)\n\t\t\t{\n\t\t\t\tRelayMouseEvent(hwnd, swnd->hwndToolTip, WM_MOUSEMOVE);\n\t\t\t\tlastpos = lParam;\n\t\t\t}\n\t\t}\n\n\t\treturn NCMouseMove(swnd, hwnd, wParam, lParam);\n\n\n\tcase WM_SETCURSOR:\n\t\treturn CoolSB_SetCursor(swnd, hwnd, wParam, lParam);\n\n\tcase WM_CAPTURECHANGED:\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n\t}\n\t\n\treturn CallWindowProc(swnd->oldproc, hwnd, message, wParam, lParam);\n}\n\n\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/coolscroll.h",
    "content": "#ifndef _COOLSBLIB_INCLUDED\n#define _COOLSBLIB_INCLUDED\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\n#include <windows.h>\n\n// To complement the exisiting SB_HORZ, SB_VERT, SB_BOTH\n// scrollbar identifiers\n#define COOLSB_NONE (-1)\n#define SB_INSBUT\t(-2)\n\n//\n//\tArrow size defines\n//\n#define SYSTEM_METRIC (-1)\n\n\n//\n// general scrollbar styles\n//\n// use the standard ESB_DISABLE_xxx flags to represent the\n// enabled / disabled states. (defined in winuser.h)\n//\n#define CSBS_THUMBALWAYS\t\t4\n#define CSBS_VISIBLE\t\t\t8\n\n//cool scrollbar styles for Flat scrollbars\n#define CSBS_NORMAL\t\t\t0\n#define CSBS_FLAT\t\t\t1\n#define CSBS_HOTTRACKED\t\t2\n\n//\n//\tButton mask flags for indicating which members of SCROLLBUT\n//\tto use during a button insertion / modification\n//\t\n#define SBBF_TYPE\t\t\t0x0001\n#define SBBF_ID\t\t\t\t0x0002\n#define SBBF_PLACEMENT\t\t0x0004\n#define SBBF_SIZE\t\t\t0x0008\n#define SBBF_BITMAP\t\t\t0x0010\n#define SBBF_ENHMETAFILE\t0x0020\n//#define SBBF_OWNERDRAW\t\t0x0040\t//unused at present\n#define SBBF_CURSOR\t\t\t0x0080\n#define SBBF_BUTMINMAX\t\t0x0100\n#define SBBF_STATE\t\t\t0x0200\n\n//button styles (states)\n#define SBBS_NORMAL\t\t\t0\n#define SBBS_PUSHED\t\t\t1\n#define SBBS_CHECKED\t\tSBBS_PUSHED\n\n//\n// scrollbar button types\n//\n#define SBBT_PUSHBUTTON\t\t1\t//standard push button\n#define SBBT_TOGGLEBUTTON\t2\t//toggle button\n#define SBBT_FIXED\t\t\t3\t//fixed button (non-clickable)\n#define SBBT_FLAT\t\t\t4\t//blank area (flat, with border)\n#define SBBT_BLANK\t\t\t5\t//blank area (flat, no border)\n#define SBBT_DARK\t\t\t6\t//dark blank area (flat)\n#define SBBT_OWNERDRAW\t\t7\t//user draws the button via a WM_NOTIFY\n\n#define SBBT_MASK\t\t\t0x1f\t//mask off low 5 bits\n\n//button type modifiers\n#define SBBM_RECESSED\t\t0x0020\t//recessed when clicked (like Word 97)\n#define SBBM_LEFTARROW\t\t0x0040\n#define SBBM_RIGHTARROW\t\t0x0080\n#define SBBM_UPARROW\t\t0x0100\n#define SBBM_DOWNARROW\t\t0x0200\n#define SBBM_RESIZABLE\t\t0x0400\n#define SBBM_TYPE2\t\t\t0x0800\n#define SBBM_TYPE3\t\t\t0x1000\n#define SBBM_TOOLTIPS\t\t0x2000\t//currently unused (define COOLSB_TOOLTIPS in userdefs.h)\n\n//button placement flags\n#define SBBP_LEFT\t1\n#define SBBP_RIGHT  2\n#define SBBP_TOP\t1\t//3\n#define SBBP_BOTTOM 2\t//4\n\n\n//\n//\tButton command notification codes\n//\tfor sending with a WM_COMMAND message\n//\n#define CSBN_BASE\t0\n#define CSBN_CLICKED (1 + CSBN_BASE)\n#define CSBN_HILIGHT (2 + CSBN_BASE)\n\n//\n//\tMinimum size in pixels of a scrollbar thumb\n//\n#define MINTHUMBSIZE_NT4   8\n#define MINTHUMBSIZE_2000  6\n\n//define some more hittest values for our cool-scrollbar\n#define HTSCROLL_LEFT\t\t(SB_LINELEFT)\n#define HTSCROLL_RIGHT\t\t(SB_LINERIGHT)\n#define HTSCROLL_UP\t\t\t(SB_LINEUP)\n#define HTSCROLL_DOWN\t\t(SB_LINEDOWN)\n#define HTSCROLL_THUMB\t\t(SB_THUMBTRACK)\n#define HTSCROLL_PAGEGUP\t(SB_PAGEUP)\n#define HTSCROLL_PAGEGDOWN\t(SB_PAGEDOWN)\n#define HTSCROLL_PAGELEFT\t(SB_PAGELEFT)\n#define HTSCROLL_PAGERIGHT\t(SB_PAGERIGHT)\n\n#define HTSCROLL_NONE\t\t(-1)\n#define HTSCROLL_NORMAL\t\t(-1)\n\n#define HTSCROLL_INSERTED\t(128)\n#define HTSCROLL_PRE\t\t(32 | HTSCROLL_INSERTED)\n#define HTSCROLL_POST\t\t(64 | HTSCROLL_INSERTED)\n\n/*\n\n\tPublic interface to the Cool Scrollbar library\n\n\n*/\n\nBOOL\tWINAPI InitializeCoolSB(HWND hwnd);\nHRESULT WINAPI UninitializeCoolSB\t(HWND hwnd);\n\nBOOL WINAPI CoolSB_SetMinThumbSize(HWND hwnd, UINT wBar, UINT size);\nBOOL WINAPI CoolSB_IsThumbTracking(HWND hwnd);\nBOOL WINAPI CoolSB_IsCoolScrollEnabled(HWND hwnd);\n\n//\nBOOL WINAPI CoolSB_EnableScrollBar\t(HWND hwnd, int wSBflags, UINT wArrows);\nBOOL WINAPI CoolSB_GetScrollInfo\t(HWND hwnd, int fnBar, LPSCROLLINFO lpsi);\nint\t WINAPI CoolSB_GetScrollPos\t(HWND hwnd, int nBar);\nBOOL WINAPI CoolSB_GetScrollRange\t(HWND hwnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos);\n\n//\nint\t WINAPI CoolSB_SetScrollInfo\t(HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw);\nint  WINAPI CoolSB_SetScrollPos\t(HWND hwnd, int nBar, int nPos, BOOL fRedraw);\nint  WINAPI CoolSB_SetScrollRange\t(HWND hwnd, int nBar, int nMinPos, int nMaxPos, BOOL fRedraw);\nBOOL WINAPI CoolSB_ShowScrollBar\t(HWND hwnd, int wBar, BOOL fShow);\n\n//\n// Scrollbar dimension functions\n//\nBOOL WINAPI CoolSB_SetSize\t\t\t(HWND hwnd, int wBar, int nLength, int nWidth);\n\n//\n// Set the visual nature of a scrollbar (flat, normal etc)\n//\nBOOL WINAPI CoolSB_SetStyle\t\t(HWND hwnd, int wBar, UINT nStyle);\nBOOL WINAPI CoolSB_SetThumbAlways\t(HWND hwnd, int wBar, BOOL fThumbAlways);\n\n//\n//\tScrollbar button structure, for inserted buttons only\n//\ntypedef struct \n{\n\tUINT\t\t\tfMask;\t\t\t//which members are in use\n\tUINT\t\t\tuPlacement;\t\t//is this button to the left/right (above/below) of the scrollbar??\n\tUINT\t\t\tuCmdId;\t\t\t//command identifier (WM_COMMAND value to send)\n\tUINT\t\t\tuButType;\t\t//\n\tUINT\t\t\tuState;\t\t\t//toggled etc\n\tint\t\t\t\tnSize;\t\t\t//size in pixels. -1 for autosize\n\t\n\tHBITMAP\t\t\thBmp;\t\t\t//handle to a bitmap to use as the button face\n\tHENHMETAFILE\thEmf;\t\t\t//handle to an enhanced metafile\n\t\n\tHCURSOR\t\t\thCurs;\t\t\t//handle to a user-supplied mouse cursor to apply\n\t\t\t\t\t\t\t\t\t//to this button\n\n\tint\t\t\t\tnSizeReserved;\t//internal variable used for resizing\n\tint\t\t\t\tnMinSize;\t\t//min size\n\tint\t\t\t\tnMaxSize;\t\t//max size\n\n} SCROLLBUT;\n\nBOOL WINAPI CoolSB_InsertButton(HWND hwnd, int wSBflags, UINT nPos,  SCROLLBUT *psb);\nBOOL WINAPI CoolSB_ModifyButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, SCROLLBUT *psb);\nBOOL WINAPI CoolSB_RemoveButton(HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd);\nBOOL WINAPI CoolSB_GetButton   (HWND hwnd, int wSBflags, UINT uItem, BOOL fByCmd, SCROLLBUT *psb);\n\nvoid WINAPI CoolSB_SetESBProc(void *proc);\n\ntypedef struct\n{\n\tNMHDR\thdr;\n\tDWORD   dwDrawStage;\n\tHDC\t\thdc;\n\tRECT\trect;\n\tUINT\tuItem;\n\tUINT\tuState;\n\tUINT\tnBar;\n\t\n} NMCSBCUSTOMDRAW;\n\ntypedef struct\n{\n\tNMHDR\thdr;\n\tRECT\trect;\n\tPOINT\tpt;\n\tUINT\tuCmdId;\n\tUINT\tuState;\n\tint\t\tnBar;\n} NMCOOLBUTMSG;\n\n/*\ntypedef struct\n{\n\tNMHDR\thdr;\n\tDWORD   dwDrawStage;\n\tHDC\t\thdc;\n\tRECT\trect;\n\tUINT\tuCmdId;\n\tUINT\tuState;\n\n} NMCOOLBUTTON_CUSTOMDRAW;\n*/\n\n\n//\n//\tDefine the WM_NOTIFY code value for cool-scrollbar custom drawing\n//\n#define NM_COOLSB_CUSTOMDRAW (0-0xfffU)\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/detours.h",
    "content": "//////////////////////////////////////////////////////////////////////////////\n//\n//  File:       detours.h\n//  Module:     detours.lib\n//\n//  Detours for binary functions.  Version 1.4. (Build 45)\n//\n//  Copyright 1995-2001, Microsoft Corporation\n//\n\n#pragma once\n#ifndef _DETOURS_H_\n#define _DETOURS_H_\n\n#pragma comment(lib, \"detours\")\n\n//////////////////////////////////////////////////////////////////////////////\n//\n#ifndef GUID_DEFINED\n#define GUID_DEFINED\ntypedef struct  _GUID\n{\n    DWORD Data1;\n    WORD Data2;\n    WORD Data3;\n    BYTE Data4[ 8 ];\n} GUID;\n#endif // !GUID_DEFINED\n\n#if defined(__cplusplus)\n#ifndef _REFGUID_DEFINED\n#define _REFGUID_DEFINED\n#define REFGUID             const GUID &\n#endif // !_REFGUID_DEFINED\n#else // !__cplusplus\n#ifndef _REFGUID_DEFINED\n#define _REFGUID_DEFINED\n#define REFGUID             const GUID * const\n#endif // !_REFGUID_DEFINED\n#endif // !__cplusplus\n//\n//////////////////////////////////////////////////////////////////////////////\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\n/////////////////////////////////////////////////// Instruction Target Macros.\n//\n#define DETOUR_INSTRUCTION_TARGET_NONE          ((PBYTE)0)\n#define DETOUR_INSTRUCTION_TARGET_DYNAMIC       ((PBYTE)~0ul)\n\n/////////////////////////////////////////////////////////// Trampoline Macros.\n//\n// DETOUR_TRAMPOLINE(trampoline_prototype, target_name)\n//\n// The naked trampoline must be at least DETOUR_TRAMPOLINE_SIZE bytes.\n//\n#define DETOUR_TRAMPOLINE_SIZE          32\n#define DETOUR_SECTION_HEADER_SIGNATURE 0x00727444   // \"Dtr\\0\"\n\n#define DETOUR_TRAMPOLINE(trampoline,target) \\\nstatic PVOID __fastcall _Detours_GetVA_##target(VOID) \\\n{ \\\n    return &target; \\\n} \\\n\\\n__declspec(naked) trampoline \\\n{ \\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { call _Detours_GetVA_##target };\\\n    __asm { jmp eax };\\\n    __asm { ret };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n}\n\n#define DETOUR_TRAMPOLINE_EMPTY(trampoline) \\\n__declspec(naked) trampoline \\\n{ \\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { xor eax, eax };\\\n    __asm { mov eax, [eax] };\\\n    __asm { ret };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n    __asm { nop };\\\n}\n\n/////////////////////////////////////////////////////////// Binary Structures.\n//\n#pragma pack(push, 8)\ntypedef struct _DETOUR_SECTION_HEADER\n{\n    DWORD       cbHeaderSize;\n    DWORD       nSignature;\n    DWORD       nDataOffset;\n    DWORD       cbDataSize;\n    \n    DWORD       nOriginalImportVirtualAddress;\n    DWORD       nOriginalImportSize;\n    DWORD       nOriginalBoundImportVirtualAddress;\n    DWORD       nOriginalBoundImportSize;\n    \n    DWORD       nOriginalIatVirtualAddress;\n    DWORD       nOriginalIatSize;\n    DWORD       nOriginalSizeOfImage;\n    DWORD       nReserve;\n} DETOUR_SECTION_HEADER, *PDETOUR_SECTION_HEADER;\n\ntypedef struct _DETOUR_SECTION_RECORD\n{\n    DWORD       cbBytes;\n    DWORD       nReserved;\n    GUID        guid;\n} DETOUR_SECTION_RECORD, *PDETOUR_SECTION_RECORD;\n#pragma pack(pop)\n\n#define DETOUR_SECTION_HEADER_DECLARE(cbSectionSize) \\\n{ \\\n      sizeof(DETOUR_SECTION_HEADER),\\\n      DETOUR_SECTION_HEADER_SIGNATURE,\\\n      sizeof(DETOUR_SECTION_HEADER),\\\n      (cbSectionSize),\\\n      \\\n      0,\\\n      0,\\\n      0,\\\n      0,\\\n      \\\n      0,\\\n      0,\\\n      0,\\\n      0,\\\n}\n\n///////////////////////////////////////////////////////////// Binary Typedefs.\n//\ntypedef BOOL (CALLBACK *PF_DETOUR_BINARY_BYWAY_CALLBACK)(PVOID pContext,\n                                                         PCHAR pszFile,\n                                                         PCHAR *ppszOutFile);\ntypedef BOOL (CALLBACK *PF_DETOUR_BINARY_FILE_CALLBACK)(PVOID pContext,\n                                                        PCHAR pszOrigFile,\n                                                        PCHAR pszFile,\n                                                        PCHAR *ppszOutFile);\ntypedef BOOL (CALLBACK *PF_DETOUR_BINARY_SYMBOL_CALLBACK)(PVOID pContext,\n                                                          DWORD nOrdinal,\n                                                          PCHAR pszOrigSymbol,\n                                                          PCHAR pszSymbol,\n                                                          PCHAR *ppszOutSymbol);\ntypedef BOOL (CALLBACK *PF_DETOUR_BINARY_FINAL_CALLBACK)(PVOID pContext);\ntypedef BOOL (CALLBACK *PF_DETOUR_BINARY_EXPORT_CALLBACK)(PVOID pContext,\n                                                          DWORD nOrdinal,\n                                                          PCHAR pszName,\n                                                          PBYTE pbCode);\n\ntypedef VOID * PDETOUR_BINARY;\ntypedef VOID * PDETOUR_LOADED_BINARY;\n\n//////////////////////////////////////////////////////// Trampoline Functions.\n//\nPBYTE WINAPI DetourFunction(PBYTE pbTargetFunction,\n                            PBYTE pbDetourFunction);\n\nBOOL WINAPI DetourFunctionWithEmptyTrampoline(PBYTE pbTrampoline,\n                                              PBYTE pbTarget,\n                                              PBYTE pbDetour);\n\nBOOL WINAPI DetourFunctionWithEmptyTrampolineEx(PBYTE pbTrampoline,\n                                                PBYTE pbTarget,\n                                                PBYTE pbDetour,\n                                                PBYTE *ppbRealTrampoline,\n                                                PBYTE *ppbRealTarget,\n                                                PBYTE *ppbRealDetour);\n\nBOOL  WINAPI DetourFunctionWithTrampoline(PBYTE pbTrampoline,\n                                          PBYTE pbDetour);\n\nBOOL  WINAPI DetourFunctionWithTrampolineEx(PBYTE pbTrampoline,\n                                            PBYTE pbDetour,\n                                            PBYTE *ppbRealTrampoline,\n                                            PBYTE *ppbRealTarget);\n\nBOOL  WINAPI DetourRemove(PBYTE pbTrampoline, PBYTE pbDetour);\n\n////////////////////////////////////////////////////////////// Code Functions.\n//\nPBYTE WINAPI DetourFindFunction(PCHAR pszModule, PCHAR pszFunction);\nPBYTE WINAPI DetourGetFinalCode(PBYTE pbCode, BOOL fSkipJmp);\n\nPBYTE WINAPI DetourCopyInstruction(PBYTE pbDst, PBYTE pbSrc, PBYTE *ppbTarget);\nPBYTE WINAPI DetourCopyInstructionEx(PBYTE pbDst,\n                                     PBYTE pbSrc,\n                                     PBYTE *ppbTarget,\n                                     LONG *plExtra);\n\n///////////////////////////////////////////////////// Loaded Binary Functions.\n//\nHMODULE WINAPI DetourEnumerateModules(HMODULE hModuleLast);\nPBYTE WINAPI DetourGetEntryPoint(HMODULE hModule);\nBOOL WINAPI DetourEnumerateExports(HMODULE hModule,\n                                   PVOID pContext,\n                                   PF_DETOUR_BINARY_EXPORT_CALLBACK pfExport);\n\nPBYTE WINAPI DetourFindPayload(HMODULE hModule, REFGUID rguid, DWORD *pcbData);\nDWORD WINAPI DetourGetSizeOfPayloads(HMODULE hModule);\n\n///////////////////////////////////////////////// Persistent Binary Functions.\n//\nBOOL WINAPI DetourBinaryBindA(PCHAR pszFile, PCHAR pszDll, PCHAR pszPath);\nBOOL WINAPI DetourBinaryBindW(PWCHAR pwzFile, PWCHAR pwzDll, PWCHAR pwzPath);\n#ifdef UNICODE\n#define DetourBinaryBind  DetourBinaryBindW\n#else\n#define DetourBinaryBind  DetourBinaryBindA\n#endif // !UNICODE\n\nPDETOUR_BINARY WINAPI DetourBinaryOpen(HANDLE hFile);\nPBYTE WINAPI DetourBinaryEnumeratePayloads(PDETOUR_BINARY pBinary,\n                                           GUID *pGuid,\n                                           DWORD *pcbData,\n                                           DWORD *pnIterator);\nPBYTE WINAPI DetourBinaryFindPayload(PDETOUR_BINARY pBinary,\n                                     REFGUID rguid,\n                                     DWORD *pcbData);\nPBYTE WINAPI DetourBinarySetPayload(PDETOUR_BINARY pBinary,\n                                    REFGUID rguid,\n                                    PBYTE pbData,\n                                    DWORD cbData);\nBOOL WINAPI DetourBinaryDeletePayload(PDETOUR_BINARY pBinary, REFGUID rguid);\nBOOL WINAPI DetourBinaryPurgePayloads(PDETOUR_BINARY pBinary);\nBOOL WINAPI DetourBinaryResetImports(PDETOUR_BINARY pBinary);\nBOOL WINAPI DetourBinaryEditImports(PDETOUR_BINARY pBinary,\n                                    PVOID pContext,\n                                    PF_DETOUR_BINARY_BYWAY_CALLBACK pfByway,\n                                    PF_DETOUR_BINARY_FILE_CALLBACK pfFile,\n                                    PF_DETOUR_BINARY_SYMBOL_CALLBACK pfSymbol,\n                                    PF_DETOUR_BINARY_FINAL_CALLBACK pfFinal);\nBOOL WINAPI DetourBinaryWrite(PDETOUR_BINARY pBinary, HANDLE hFile);\nBOOL WINAPI DetourBinaryClose(PDETOUR_BINARY pBinary);\n\n/////////////////////////////////////////////// First Chance Exception Filter.\n//\nLPTOP_LEVEL_EXCEPTION_FILTER WINAPI\nDetourFirstChanceExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelFilter);\n\n///////////////////////////////////////////////// Create Process & Inject Dll.\n//\ntypedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEA)\n    (LPCSTR lpApplicationName,\n     LPSTR lpCommandLine,\n     LPSECURITY_ATTRIBUTES lpProcessAttributes,\n     LPSECURITY_ATTRIBUTES lpThreadAttributes,\n     BOOL bInheritHandles,\n     DWORD dwCreationFlags,\n     LPVOID lpEnvironment,\n     LPCSTR lpCurrentDirectory,\n     LPSTARTUPINFOA lpStartupInfo,\n     LPPROCESS_INFORMATION lpProcessInformation);\n\ntypedef BOOL (WINAPI *PDETOUR_CREATE_PROCESS_ROUTINEW)\n    (LPCWSTR lpApplicationName,\n     LPWSTR lpCommandLine,\n     LPSECURITY_ATTRIBUTES lpProcessAttributes,\n     LPSECURITY_ATTRIBUTES lpThreadAttributes,\n     BOOL bInheritHandles,\n     DWORD dwCreationFlags,\n     LPVOID lpEnvironment,\n     LPCWSTR lpCurrentDirectory,\n     LPSTARTUPINFOW lpStartupInfo,\n     LPPROCESS_INFORMATION lpProcessInformation);\n                                  \nBOOL WINAPI DetourCreateProcessWithDllA(LPCSTR lpApplicationName,\n                                        LPSTR lpCommandLine,\n                                        LPSECURITY_ATTRIBUTES lpProcessAttributes,\n                                        LPSECURITY_ATTRIBUTES lpThreadAttributes,\n                                        BOOL bInheritHandles,\n                                        DWORD dwCreationFlags,\n                                        LPVOID lpEnvironment,\n                                        LPCSTR lpCurrentDirectory,\n                                        LPSTARTUPINFOA lpStartupInfo,\n                                        LPPROCESS_INFORMATION lpProcessInformation,\n                                        LPCSTR lpDllName,\n                                        PDETOUR_CREATE_PROCESS_ROUTINEA\n                                        pfCreateProcessA);\n\nBOOL WINAPI DetourCreateProcessWithDllW(LPCWSTR lpApplicationName,\n                                        LPWSTR lpCommandLine,\n                                        LPSECURITY_ATTRIBUTES lpProcessAttributes,\n                                        LPSECURITY_ATTRIBUTES lpThreadAttributes,\n                                        BOOL bInheritHandles,\n                                        DWORD dwCreationFlags,\n                                        LPVOID lpEnvironment,\n                                        LPCWSTR lpCurrentDirectory,\n                                        LPSTARTUPINFOW lpStartupInfo,\n                                        LPPROCESS_INFORMATION lpProcessInformation,\n                                        LPCWSTR lpDllName,\n                                        PDETOUR_CREATE_PROCESS_ROUTINEW\n                                        pfCreateProcessW);\n                  \n#ifdef UNICODE\n#define DetourCreateProcessWithDll  DetourCreateProcessWithDllW\n#define PDETOUR_CREATE_PROCESS_ROUTINE     PDETOUR_CREATE_PROCESS_ROUTINEW\n#else\n#define DetourCreateProcessWithDll  DetourCreateProcessWithDllA\n#define PDETOUR_CREATE_PROCESS_ROUTINE     PDETOUR_CREATE_PROCESS_ROUTINEA\n#endif // !UNICODE\n\nBOOL WINAPI DetourContinueProcessWithDllA(HANDLE hProcess, LPCSTR lpDllName);\nBOOL WINAPI DetourContinueProcessWithDllW(HANDLE hProcess, LPCWSTR lpDllName);\n\n#ifdef UNICODE\n#define DetourContinueProcessWithDll    DetourContinueProcessWithDllW\n#else\n#define DetourContinueProcessWithDll    DetourContinueProcessWithDllA\n#endif // !UNICODE\n//\n//////////////////////////////////////////////////////////////////////////////\n#ifdef __cplusplus\n}\n#endif // __cplusplus\n\n/////////////////////////////////////////////////////////////////// Old Names.\n//\n#define ContinueProcessWithDll            DetourContinueProcessWithDll \n#define ContinueProcessWithDllA           DetourContinueProcessWithDllA\n#define ContinueProcessWithDllW           DetourContinueProcessWithDllW\n#define CreateProcessWithDll              DetourCreateProcessWithDll \n#define CreateProcessWithDllA             DetourCreateProcessWithDllA\n#define CreateProcessWithDllW             DetourCreateProcessWithDllW\n#define DETOUR_TRAMPOLINE_WO_TARGET       DETOUR_TRAMPOLINE_EMPTY\n#define DetourBinaryPurgePayload          DetourBinaryPurgePayloads\n#define DetourEnumerateExportsForInstance DetourEnumerateExports\n#define DetourEnumerateInstances          DetourEnumerateModules\n#define DetourFindEntryPointForInstance   DetourGetEntryPoint\n#define DetourFindFinalCode               DetourGetFinalCode\n#define DetourFindPayloadInBinary         DetourFindPayload\n#define DetourGetSizeOfBinary             DetourGetSizeOfPayloads\n#define DetourRemoveWithTrampoline        DetourRemove\n#define PCREATE_PROCESS_ROUTINE           PDETOUR_CREATE_PROCESS_ROUTINE\n#define PCREATE_PROCESS_ROUTINEA          PDETOUR_CREATE_PROCESS_ROUTINEA\n#define PCREATE_PROCESS_ROUTINEW          PDETOUR_CREATE_PROCESS_ROUTINEW\n//\n\n//////////////////////////////////////////////// Detours Internal Definitions.\n//\n#ifdef __cplusplus\n#ifdef DETOURS_INTERNAL\n\n//////////////////////////////////////////////////////////////////////////////\n//\n#ifdef IMAGEAPI // defined by IMAGEHLP.H\ntypedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(LPAPI_VERSION AppVersion);\n\ntypedef BOOL (NTAPI *PF_SymInitialize)(IN HANDLE hProcess,\n                                       IN LPSTR UserSearchPath,\n                                       IN BOOL fInvadeProcess);\ntypedef DWORD (NTAPI *PF_SymSetOptions)(IN DWORD SymOptions);\ntypedef DWORD (NTAPI *PF_SymGetOptions)(VOID);\ntypedef BOOL (NTAPI *PF_SymLoadModule)(IN HANDLE hProcess,\n                                       IN HANDLE hFile,\n                                       IN PSTR ImageName,\n                                       IN PSTR ModuleName,\n                                       IN DWORD BaseOfDll,\n                                       IN DWORD SizeOfDll);\ntypedef BOOL (NTAPI *PF_SymGetModuleInfo)(IN HANDLE hProcess,\n                                          IN DWORD dwAddr,\n                                          OUT PIMAGEHLP_MODULE ModuleInfo);\ntypedef BOOL (NTAPI *PF_SymGetSymFromName)(IN HANDLE hProcess,\n                                           IN LPSTR Name,\n                                           OUT PIMAGEHLP_SYMBOL Symbol);\ntypedef BOOL (NTAPI *PF_BindImage)(IN LPSTR pszImageName,\n                                   IN LPSTR pszDllPath,\n                                   IN LPSTR pszSymbolPath);\n\ntypedef struct _DETOUR_SYM_INFO\n{\n    HANDLE                   hProcess;\n    HMODULE                  hImageHlp;\n    PF_ImagehlpApiVersionEx  pfImagehlpApiVersionEx;\n    PF_SymInitialize         pfSymInitialize;\n    PF_SymSetOptions         pfSymSetOptions;\n    PF_SymGetOptions         pfSymGetOptions;\n    PF_SymLoadModule         pfSymLoadModule;\n    PF_SymGetModuleInfo      pfSymGetModuleInfo;\n    PF_SymGetSymFromName     pfSymGetSymFromName;\n    PF_BindImage             pfBindImage;\n} DETOUR_SYM_INFO, *PDETOUR_SYM_INFO;\n\nPDETOUR_SYM_INFO DetourLoadImageHlp(VOID);\n\n#endif // IMAGEAPI\n\n//////////////////////////////////////////////////////////////////////////////\n//\nclass CDetourEnableWriteOnCodePage\n{\npublic:\n    CDetourEnableWriteOnCodePage(PBYTE pbCode, LONG cbCode = DETOUR_TRAMPOLINE_SIZE)\n    {\n        m_pbCode = pbCode;\n        m_cbCode = cbCode;\n        m_dwOldPerm = 0;\n        m_hProcess = GetCurrentProcess();\n\n        if (m_pbCode && m_cbCode) {\n            if (!FlushInstructionCache(m_hProcess, pbCode, cbCode)) {\n                return;\n            }\n            if (!VirtualProtect(pbCode,\n                                cbCode,\n                                PAGE_EXECUTE_READWRITE,\n                                &m_dwOldPerm)) {\n                return;\n            }\n        }\n    }\n\n    ~CDetourEnableWriteOnCodePage()\n    {\n        if (m_dwOldPerm && m_pbCode && m_cbCode) {\n            DWORD dwTemp = 0;\n            if (!FlushInstructionCache(m_hProcess, m_pbCode, m_cbCode)) {\n                return;\n            }\n            if (!VirtualProtect(m_pbCode, m_cbCode, m_dwOldPerm, &dwTemp)) {\n                return;\n            }\n        }\n    }\n\n    BOOL SetPermission(DWORD dwPerms)\n    {\n        if (m_dwOldPerm && m_pbCode && m_cbCode) {\n            m_dwOldPerm = dwPerms;\n            return TRUE;\n        }\n        return FALSE;\n    }\n\n    BOOL IsValid(VOID)\n    {\n        return m_pbCode && m_cbCode && m_dwOldPerm;\n    }\n\nprivate:\n    HANDLE  m_hProcess;\n    PBYTE   m_pbCode;\n    LONG    m_cbCode;\n    DWORD   m_dwOldPerm;\n};\n\n//////////////////////////////////////////////////////////////////////////////\n//\ninline PBYTE DetourGenMovEax(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xB8;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenMovEbx(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xBB;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenMovEcx(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xB9;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenMovEdx(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xBA;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenMovEsi(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xBE;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenMovEdi(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xBF;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenMovEbp(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xBD;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenMovEsp(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0xBC;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenPush(PBYTE pbCode, UINT32 nValue)\n{\n    *pbCode++ = 0x68;\n    *((UINT32*&)pbCode)++ = nValue;\n    return pbCode;\n}\n\ninline PBYTE DetourGenPushad(PBYTE pbCode)\n{\n    *pbCode++ = 0x60;\n    return pbCode;\n}\n\ninline PBYTE DetourGenPopad(PBYTE pbCode)\n{\n    *pbCode++ = 0x61;\n    return pbCode;\n}\n\ninline PBYTE DetourGenJmp(PBYTE pbCode, PBYTE pbJmpDst, PBYTE pbJmpSrc = 0)\n{\n    if (pbJmpSrc == 0) {\n        pbJmpSrc = pbCode;\n    }\n    *pbCode++ = 0xE9;\n    *((INT32*&)pbCode)++ = pbJmpDst - (pbJmpSrc + 5);\n    return pbCode;\n}\n\ninline PBYTE DetourGenCall(PBYTE pbCode, PBYTE pbJmpDst, PBYTE pbJmpSrc = 0)\n{\n    if (pbJmpSrc == 0) {\n        pbJmpSrc = pbCode;\n    }\n    *pbCode++ = 0xE8;\n    *((INT32*&)pbCode)++ = pbJmpDst - (pbJmpSrc + 5);\n    return pbCode;\n}\n\ninline PBYTE DetourGenBreak(PBYTE pbCode)\n{\n    *pbCode++ = 0xcc;\n    return pbCode;\n}\n\ninline PBYTE DetourGenRet(PBYTE pbCode)\n{\n    *pbCode++ = 0xc3;\n    return pbCode;\n}\n\ninline PBYTE DetourGenNop(PBYTE pbCode)\n{\n    *pbCode++ = 0x90;\n    return pbCode;\n}\n#endif DETOURS_INTERAL\n#endif // __cplusplus\n\n#endif // _DETOURS_H_\n//\n////////////////////////////////////////////////////////////////  End of File.\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/coolsb/userdefs.h",
    "content": "#ifndef _USERDEFINES_INCLUDED\n#define _USERDEFINES_INCLUDED\n\n/*\n\n  Define these values to alter the various\n  features of the coolscroll library. If you don't want\n  a certain feature, then you might be able to reduce the\n  size of your app by a few kb...\n\n*/\n\n/* allow inserted buttons. Without this, all button code will\n   be excluded, resulting in a smaller build (about 4kb less). This\n   may not seem much, but it is a 25% reduction! */\n#define INCLUDE_BUTTONS\t\t\n\n/* Allow user-resizable buttons. Makes no difference if INCLUDE_BUTTONS\n   is not defined for the project */\n#define RESIZABLE_BUTTONS\t\n\n/* Include tooltip support for inserted buttons. Without this, no\n   tooltip requests (TTN_GETDISPINFO's) will be sent to the window */\n#define COOLSB_TOOLTIPS\n\n/* Define this to include the custom-draw support */\n#define CUSTOM_DRAW\n\n/* Define to enable WM_NOTIFY messages to be sent for mouse event */\n#define NOTIFY_MOUSE\n\n/* Define this value to make the horizontal scrollbar stay visible even\n   if the window is sized to small vertically. Normal scrollbars always leave\n   a 1-pixel line of \"client\" area before hiding the horizontal scrollbar. This\n   value allows the window to be sized so the client area totally disappears if\n   sized too small */\n//#define COOLSB_FILLWINDOW\n\n/* minimum size of scrollbar before inserted buttons are \n   hidden to make room when the window is sized too small */\n#define MIN_COOLSB_SIZE 24\n\n/* min size of scrollbar when resizing a button, before the \n   resize is stopped because the scrollbar has gotten too small */\n#define MINSCROLLSIZE   50\t\t\n\n/* define this to display the default mouse arrow whenever the\n   the mouse is released over a button which has a user-defined cursor.\n   not really very useful, just provides a different type of feedback */\n#undef  HIDE_CURSOR_AFTER_MOUSEUP\n\n/* enable HOT_TRACKING to provide visual feedback when the mouse\n   moves over a scrollbar area (like Flat Scrollbars) */\n#define HOT_TRACKING\n\n/* enable FLAT_SCROLLBARS to include support for flat scrollbars\n   note that they must be enabled by the user first of all */\n#define FLAT_SCROLLBARS\n\n/* a normal scrollbar \"snaps\" its scroll-thumb back into position if\n   you move the mouse too far away from the window, whilst you are\n   dragging the thumb, that is. #undeffing this results in the thumb\n   never snapping back into position, no matter how far away you move\n   the mouse */\n#define SNAP_THUMB_BACK\n\n/* distance (in pixels) the mouse must move away from the thumb \n   during tracking to cause the thumb bar to snap back to its \n   starting place. Has no effect unless SNAP_THUMB_BACK is defined */\n#define THUMBTRACK_SNAPDIST 24\n\n/* maximum number of inserted buttons per bar */\n#define MAX_COOLSB_BUTS 16\t\t\n   \n/* maximum number of coolsb windows per application. \n   Set to lower if you don't need many.  */\n#define MAX_COOLSB 64\n\n#endif /* _USERDEFINES_INCLUDED */"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/nsis_tchar.h",
    "content": "/*\n * nsis_tchar.h\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2013 Nullsoft and Contributors\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n *\n * For Unicode support by Jim Park -- 08/30/2007\n */\n\n// Jim Park: Only those we use are listed here.\n\n#pragma once\n\n#ifdef _UNICODE\n\n#ifndef _T\n#define __T(x)   L ## x\n#define _T(x)    __T(x)\n#define _TEXT(x) __T(x)\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\n#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)\ntypedef unsigned short TCHAR;\n#else\ntypedef wchar_t TCHAR;\n#endif\n#endif\n\n\n// program\n#define _tenviron   _wenviron\n#define __targv     __wargv\n\n// printfs\n#define _ftprintf   fwprintf\n#define _sntprintf  _snwprintf\n#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)\n#\tdefine _stprintf   swprintf\n#else\n#\tdefine _stprintf   _swprintf\n#endif\n#define _tprintf    wprintf\n#define _vftprintf  vfwprintf\n#define _vsntprintf _vsnwprintf\n#if defined(_MSC_VER) && (_MSC_VER<=1310)\n#\tdefine _vstprintf  vswprintf\n#else\n#\tdefine _vstprintf  _vswprintf\n#endif\n\n// scanfs\n#define _tscanf     wscanf\n#define _stscanf    swscanf\n\n// string manipulations\n#define _tcscat     wcscat\n#define _tcschr     wcschr\n#define _tcsclen    wcslen\n#define _tcscpy     wcscpy\n#define _tcsdup     _wcsdup\n#define _tcslen     wcslen\n#define _tcsnccpy   wcsncpy\n#define _tcsncpy    wcsncpy\n#define _tcsrchr    wcsrchr\n#define _tcsstr     wcsstr\n#define _tcstok     wcstok\n\n// string comparisons\n#define _tcscmp     wcscmp\n#define _tcsicmp    _wcsicmp\n#define _tcsncicmp  _wcsnicmp\n#define _tcsncmp    wcsncmp\n#define _tcsnicmp   _wcsnicmp\n\n// upper / lower\n#define _tcslwr     _wcslwr\n#define _tcsupr     _wcsupr\n#define _totlower   towlower\n#define _totupper   towupper\n\n// conversions to numbers\n#define _tcstoi64   _wcstoi64\n#define _tcstol     wcstol\n#define _tcstoul    wcstoul\n#define _tstof      _wtof\n#define _tstoi      _wtoi\n#define _tstoi64    _wtoi64\n#define _ttoi       _wtoi\n#define _ttoi64     _wtoi64\n#define _ttol       _wtol\n\n// conversion from numbers to strings\n#define _itot       _itow\n#define _ltot       _ltow\n#define _i64tot     _i64tow\n#define _ui64tot    _ui64tow\n\n// file manipulations\n#define _tfopen     _wfopen\n#define _topen      _wopen\n#define _tremove    _wremove\n#define _tunlink    _wunlink\n\n// reading and writing to i/o\n#define _fgettc     fgetwc\n#define _fgetts     fgetws\n#define _fputts     fputws\n#define _gettchar   getwchar\n\n// directory\n#define _tchdir     _wchdir\n\n// environment\n#define _tgetenv    _wgetenv\n#define _tsystem    _wsystem\n\n// time\n#define _tcsftime   wcsftime\n\n#else // ANSI\n\n#ifndef _T\n#define _T(x)    x\n#define _TEXT(x) x\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\ntypedef char TCHAR;\n#endif\n\n// program\n#define _tenviron   environ\n#define __targv     __argv\n\n// printfs\n#define _ftprintf   fprintf\n#define _sntprintf  _snprintf\n#define _stprintf   sprintf\n#define _tprintf    printf\n#define _vftprintf  vfprintf\n#define _vsntprintf _vsnprintf\n#define _vstprintf  vsprintf\n\n// scanfs\n#define _tscanf     scanf\n#define _stscanf    sscanf\n\n// string manipulations\n#define _tcscat     strcat\n#define _tcschr     strchr\n#define _tcsclen    strlen\n#define _tcscnlen   strnlen\n#define _tcscpy     strcpy\n#define _tcsdup     _strdup\n#define _tcslen     strlen\n#define _tcsnccpy   strncpy\n#define _tcsrchr    strrchr\n#define _tcsstr     strstr\n#define _tcstok     strtok\n\n// string comparisons\n#define _tcscmp     strcmp\n#define _tcsicmp    _stricmp\n#define _tcsncmp    strncmp\n#define _tcsncicmp  _strnicmp\n#define _tcsnicmp   _strnicmp\n\n// upper / lower\n#define _tcslwr     _strlwr\n#define _tcsupr     _strupr\n\n#define _totupper   toupper\n#define _totlower   tolower\n\n// conversions to numbers\n#define _tcstol     strtol\n#define _tcstoul    strtoul\n#define _tstof      atof\n#define _tstoi      atoi\n#define _tstoi64    _atoi64\n#define _tstoi64    _atoi64\n#define _ttoi       atoi\n#define _ttoi64     _atoi64\n#define _ttol       atol\n\n// conversion from numbers to strings\n#define _i64tot     _i64toa\n#define _itot       _itoa\n#define _ltot       _ltoa\n#define _ui64tot    _ui64toa\n\n// file manipulations\n#define _tfopen     fopen\n#define _topen      _open\n#define _tremove    remove\n#define _tunlink    _unlink\n\n// reading and writing to i/o\n#define _fgettc     fgetc\n#define _fgetts     fgets\n#define _fputts     fputs\n#define _gettchar   getchar\n\n// directory\n#define _tchdir     _chdir\n\n// environment\n#define _tgetenv    getenv\n#define _tsystem    system\n\n// time\n#define _tcsftime   strftime\n\n#endif\n\n// is functions (the same in Unicode / ANSI)\n#define _istgraph   isgraph\n#define _istascii   __isascii\n\n#define __TFILE__ _T(__FILE__)\n#define __TDATE__ _T(__DATE__)\n#define __TTIME__ _T(__TIME__)\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/pluginapi.c",
    "content": "#include <windows.h>\n\n#include \"pluginapi.h\"\n\n#ifdef _countof\n#define COUNTOF _countof\n#else\n#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))\n#endif\n\nunsigned int g_stringsize;\nstack_t **g_stacktop;\nTCHAR *g_variables;\n\n// utility functions (not required but often useful)\n\nint NSISCALL popstring(TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpy(str,th->text);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nint NSISCALL popstringn(TCHAR *str, int maxlen)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpyn(str,th->text,maxlen?maxlen:g_stringsize);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nvoid NSISCALL pushstring(const TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop) return;\n  th=(stack_t*)GlobalAlloc(GPTR,(sizeof(stack_t)+(g_stringsize)*sizeof(TCHAR)));\n  lstrcpyn(th->text,str,g_stringsize);\n  th->next=*g_stacktop;\n  *g_stacktop=th;\n}\n\nTCHAR* NSISCALL getuservariable(const int varnum)\n{\n  if (varnum < 0 || varnum >= __INST_LAST) return NULL;\n  return g_variables+varnum*g_stringsize;\n}\n\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var)\n{\n\tif (var != NULL && varnum >= 0 && varnum < __INST_LAST) \n\t\tlstrcpy(g_variables + varnum*g_stringsize, var);\n}\n\n#ifdef _UNICODE\nint NSISCALL PopStringA(char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   int rval = popstring(wideStr);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nint NSISCALL PopStringNA(char* ansiStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, realLen*sizeof(wchar_t));\n   int rval = popstringn(wideStr, realLen);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, realLen, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringA(const char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   pushstring(wideStr);\n   GlobalFree((HGLOBAL)wideStr);\n   return;\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   lstrcpyW(wideStr, getuservariable(varnum));\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   wchar_t* wideStr = getuservariable(varnum);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n}\n\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr)\n{\n   if (ansiStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      wchar_t* wideStr = g_variables + varnum * g_stringsize;\n      MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   }\n}\n\n#else\n// ANSI defs\nint NSISCALL PopStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   int rval = popstring(ansiStr);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nint NSISCALL PopStringNW(wchar_t* wideStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   char* ansiStr = (char*) GlobalAlloc(GPTR, realLen);\n   int rval = popstringn(ansiStr, realLen);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, realLen);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   pushstring(ansiStr);\n   GlobalFree((HGLOBAL)ansiStr);\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   char* ansiStr = getuservariable(varnum);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   lstrcpyA(ansiStr, getuservariable(varnum));\n}\n\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr)\n{\n   if (wideStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      char* ansiStr = g_variables + varnum * g_stringsize;\n      WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   }\n}\n#endif\n\n// playing with integers\n\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s)\n{\n  INT_PTR v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  return v;\n}\n\nunsigned int NSISCALL myatou(const TCHAR *s)\n{\n  unsigned int v=0;\n\n  for (;;)\n  {\n    unsigned int c=*s++;\n    if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n    else break;\n    v*=10;\n    v+=c;\n  }\n  return v;\n}\n\nint NSISCALL myatoi_or(const TCHAR *s)\n{\n  int v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  // Support for simple ORed expressions\n  if (*s == _T('|')) \n  {\n      v |= myatoi_or(s+1);\n  }\n\n  return v;\n}\n\nINT_PTR NSISCALL popintptr()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return nsishelper_str_to_ptr(buf);\n}\n\nint NSISCALL popint_or()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return myatoi_or(buf);\n}\n\nvoid NSISCALL pushintptr(INT_PTR value)\n{\n\tTCHAR buffer[30];\n\twsprintf(buffer, sizeof(void*) > 4 ? _T(\"%Id\") : _T(\"%d\"), value);\n\tpushstring(buffer);\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/pluginapi.h",
    "content": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n#include \"nsis_tchar.h\"\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\n#define EXDLL_INIT()           {  \\\n        g_stringsize=string_size; \\\n        g_stacktop=stacktop;      \\\n        g_variables=variables; }\n\ntypedef struct _stack_t {\n  struct _stack_t *next;\n  TCHAR text[1]; // this should be the length of string_size\n} stack_t;\n\nenum\n{\nINST_0,         // $0\nINST_1,         // $1\nINST_2,         // $2\nINST_3,         // $3\nINST_4,         // $4\nINST_5,         // $5\nINST_6,         // $6\nINST_7,         // $7\nINST_8,         // $8\nINST_9,         // $9\nINST_R0,        // $R0\nINST_R1,        // $R1\nINST_R2,        // $R2\nINST_R3,        // $R3\nINST_R4,        // $R4\nINST_R5,        // $R5\nINST_R6,        // $R6\nINST_R7,        // $R7\nINST_R8,        // $R8\nINST_R9,        // $R9\nINST_CMDLINE,   // $CMDLINE\nINST_INSTDIR,   // $INSTDIR\nINST_OUTDIR,    // $OUTDIR\nINST_EXEDIR,    // $EXEDIR\nINST_LANG,      // $LANGUAGE\n__INST_LAST\n};\n\nextern unsigned int g_stringsize;\nextern stack_t **g_stacktop;\nextern TCHAR *g_variables;\n\nvoid NSISCALL pushstring(const TCHAR *str);\nvoid NSISCALL pushintptr(INT_PTR value);\n#define pushint(v) pushintptr((INT_PTR)(v))\nint NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack\nint NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize\nINT_PTR NSISCALL popintptr();\n#define popint() ( (int) popintptr() )\nint NSISCALL popint_or(); // with support for or'ing (2|4|8)\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);\n#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer\nunsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only\nint NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)\nTCHAR* NSISCALL getuservariable(const int varnum);\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var);\n\n#ifdef _UNICODE\n#define PopStringW(x) popstring(x)\n#define PushStringW(x) pushstring(x)\n#define SetUserVariableW(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringA(char* ansiStr);\nvoid NSISCALL PushStringA(const char* ansiStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);\n\n#else\n// ANSI defs\n\n#define PopStringA(x) popstring(x)\n#define PushStringA(x) pushstring(x)\n#define SetUserVariableA(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringW(wchar_t* wideStr);\nvoid NSISCALL PushStringW(wchar_t* wideStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif//!___NSIS_PLUGIN__H___\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/wa_dlg.h",
    "content": "/* wa_dlg.h\n\nModified for use in SkinnedControls by SuperPat\nhttp://members.tripod.com/files_saivert/\n\n\nOriginal version can be downloaded at http://www.winamp.com/nsdn\nFollowing is original license (which still applies):\n*/\n/*\n** Copyright (C) 2003 Nullsoft, Inc.\n**\n** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held \n** liable for any damages arising from the use of this software. \n**\n** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to \n** alter it and redistribute it freely, subject to the following restrictions:\n**\n**   1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. \n**      If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n**\n**   2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n**\n**   3. This notice may not be removed or altered from any source distribution.\n**\n*/\n\n#ifndef _WA_DLG_H_\n#define _WA_DLG_H_\n\n/*\n\ndont know where to put this yet :)\ngenex.bmp has button and scrollbar images, as well as some individual\npixels that describe the colors for the dialog. The button and\nscrollbar images should be self explanatory (note that the buttons\nhave 4 pixel sized edges that are not stretched, and the center is\nstretched), and the scrollbars do something similar.\nThe colors start at (48,0) and run every other pixel. The meaning\nof each pixel is:\nx=74: scrollbar color\nx=78: inverse scrollbar color\nx=82: scrollbar dead area color\n*/\n\nenum\n{\n\tWADLG_SCROLLBAR_COLOR,\n\tWADLG_SCROLLBAR_INV_COLOR,\n\tWADLG_SCROLLBAR_DEADAREA_COLOR,\n\tWADLG_NUM_COLORS\n};\n\nvoid WADlg_init(HBITMAP, HBITMAP, int, int, int); // call this on init, or on WM_DISPLAYCHANGE\nvoid WADlg_close();\nint WADlg_handleDialogMsgs(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); \n\n\nint WADlg_getColor(int idx);\n\nHBITMAP WADlg_getBitmap();\n\n#ifdef WADLG_IMPLEMENT\n\nstatic HBITMAP wadlg_bitmapb; // button\nstatic HBITMAP wadlg_bitmapsb; // scrollbar\n\nstatic int wadlg_text_color;\nstatic int wadlg_selected_text_color;\nstatic int wadlg_disabled_text_color;\n\nstatic int wadlg_colors[WADLG_NUM_COLORS];\nstatic int wadlg_defcolors[WADLG_NUM_COLORS]=\n{\n\tRGB(36,36,60),\n\tRGB(78,88,110),\n\tRGB(36,36,60),\n};\n\nint WADlg_getColor(int idx)\n{\n\tif (idx < 0 || idx >= WADLG_NUM_COLORS) return 0;\n\treturn wadlg_colors[idx];\n}\n\n// Get ScrollBar Bitmap\nHBITMAP WADlg_getBitmap()\n{\n\treturn wadlg_bitmapsb;\n}\n\nvoid WADlg_init(HBITMAP hbmb, HBITMAP hbma, int color, int selectedcolor, int disabledcolor) // call this on init, or on WM_DISPLAYCHANGE\n{\n\tif (wadlg_bitmapsb) DeleteObject(wadlg_bitmapsb);\n\twadlg_bitmapsb = hbmb;\n\n\n\tif (wadlg_bitmapsb)\n\t{\n\t\tHDC tmpDC=CreateCompatibleDC(NULL);\n\t\tHGDIOBJ o=SelectObject(tmpDC,(HGDIOBJ)wadlg_bitmapsb);\n\t\tint x;\n\t\tint defbgcol=GetPixel(tmpDC, 137, 33);\n\t\tfor (x = 0; x < WADLG_NUM_COLORS; x ++)\n\t\t{\n\t\t\tint a=GetPixel(tmpDC, 137, 1+x*2);\n\t\t\tif (a == CLR_INVALID || a == RGB(0,198,255) || a == defbgcol) \n\t\t\t{\n\t\t\t\ta=wadlg_defcolors[x];\n\t\t\t}\n\t\t\twadlg_colors[x]=a;\n\t\t}\n\n\t\tSelectObject(tmpDC,o);\n\t\tDeleteDC(tmpDC);\n\t}\n\n\tif (wadlg_bitmapb) DeleteObject(wadlg_bitmapb);\n\twadlg_bitmapb = hbma;  \n\twadlg_text_color = color;\n\twadlg_selected_text_color = selectedcolor;\n\twadlg_disabled_text_color = disabledcolor;\n}\n\nvoid WADlg_close()\n{\n\tif (wadlg_bitmapsb) DeleteObject(wadlg_bitmapsb);\n\twadlg_bitmapsb=0;\n\tif (wadlg_bitmapb) DeleteObject(wadlg_bitmapb);\n\twadlg_bitmapb=0;\n}\n\n\nint WADlg_handleDialogMsgs(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n\t// Skin a BUTTON\n\tif (uMsg == WM_DRAWITEM)\n\t{\n\t\tDRAWITEMSTRUCT *di = (DRAWITEMSTRUCT *)lParam;\n\t\tif (di->CtlType == ODT_BUTTON)\n\t\t{\n\t\t\tHDC hdc;\n\t\t\tint yoffs;\n\t\t\tint with;\n\t\t\tint height;\n\t\t\tBITMAP bm; \n\t\t\tTCHAR wt[256];\n\t\t\tRECT r;\n\n\t\t\tGetDlgItemText(hwndDlg,(int)wParam,wt,sizeof(wt));\n\n\t\t\t// If window (control) has been subclassed, we skip it.\n\t\t\t// This was added to handle InstallOptions pages which have one or more Link controls.\n\t\t\t// InstallOptions.dll do it's own owner-drawing on such controls.\n\t\t\tif( GetWindowLongPtr(di->hwndItem, GWLP_WNDPROC) != GetClassLongPtr(di->hwndItem, GCLP_WNDPROC) )\n\t\t\t{\n\t\t\t\t// this adds in an additional handling on the controls\n\t\t\t\t// which allows some [...] buttons on InstallOptions\n\t\t\t\t// pages to be correctly skinned\n\t\t\t\tif (!GetProp(di->hwndItem, _T(\"SCBtn\")) )\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thdc = CreateCompatibleDC(di->hDC);\n\t\t\tSelectObject(hdc,wadlg_bitmapb);\n\n\t\t\tr=di->rcItem;\n\t\t\tSetStretchBltMode(di->hDC,COLORONCOLOR);\n\n\t\t\tGetObject(wadlg_bitmapb, sizeof(BITMAP), &bm);\n\t\t\twith = bm.bmWidth;\n\t\t\theight = bm.bmHeight /3;\n\t\t\tif (di->itemState & ODS_SELECTED)\n\t\t\t\tyoffs = height;\n\t\t\telse if (di->itemState & ODS_DISABLED)\n\t\t\t\tyoffs = height*2;\n\t\t\telse \n\t\t\t\tyoffs = 0;\n\n\t\t\t// top left\n\t\t\tBitBlt(di->hDC,r.left,r.top,4,4,hdc,0,yoffs,SRCCOPY);\n\t\t\t// top center\n\t\t\tStretchBlt(di->hDC,r.left+4,r.top,r.right-r.left-4-4,4,hdc,4,yoffs,with-4-4,4,SRCCOPY); \n\t\t\t// top right\n\t\t\tBitBlt(di->hDC,r.right-4,r.top,4,4,hdc,with-4,yoffs,SRCCOPY); \n\t\t\t// left edge\n\t\t\tStretchBlt(di->hDC,r.left,r.top+4,4,r.bottom-r.top-4-4,hdc,0,4+yoffs,4,height-4-4,SRCCOPY);\t\n\t\t\t// right edge\n\t\t\tStretchBlt(di->hDC,r.right-4,r.top+4,4,r.bottom-r.top-4-4,hdc,with-4,4+yoffs,4,height-4-4,SRCCOPY); \n\t\t\t// center\n\t\t\tStretchBlt(di->hDC,r.left+4,r.top+4,r.right-r.left-4-4,r.bottom-r.top-4-4,hdc,4,4+yoffs,with-4-4,height-4-4,SRCCOPY);\n\t\t\t// bottom left\n\t\t\tBitBlt(di->hDC,r.left,r.bottom-4,4,4,hdc,0,height-4+yoffs,SRCCOPY); \n\t\t\t// bottom center\n\t\t\tStretchBlt(di->hDC,r.left+4,r.bottom-4,r.right-r.left-4-4,4,hdc,4,height-4+yoffs,with-4-4,4,SRCCOPY); \n\t\t\t// bottom right\n\t\t\tBitBlt(di->hDC,r.right-4,r.bottom-4,4,4,hdc,with-4,height-4+yoffs,SRCCOPY); \n\n\t\t\t// draw text\n\t\t\tSetBkMode(di->hDC,TRANSPARENT);\n\n\t\t\tif (di->itemState & ODS_SELECTED)\n\t\t\t\tSetTextColor(di->hDC, wadlg_selected_text_color);\n\t\t\telse if (di->itemState & ODS_DISABLED)\n\t\t\t\tSetTextColor(di->hDC, wadlg_disabled_text_color);\n\t\t\telse\n\t\t\t\tSetTextColor(di->hDC, wadlg_text_color);\n\n\t\t\tif (di->itemState & ODS_SELECTED) {r.left+=2; r.top+=2;}\n\t\t\tDrawText(di->hDC,wt,-1,&r,DT_VCENTER|DT_SINGLELINE|DT_CENTER);\n\n\t\t\tDeleteDC(hdc);\n\t\t}\n\t}\n\treturn 0;\n}\n#endif\n\n#endif//_WA_DLG_H_"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/wa_scrollbars.c",
    "content": "/*\nwa_scrollbars.c\nFunction for skinning scrollbars and make them follow Winamp's theme.\nTaken from Safai Ma's Album List plugin (UserInterface.*)\nSeparated out in it's own module by Saivert\n*/\n#include <windows.h>\n#include <commctrl.h>\n#include \"coolsb/coolscroll.h\"\n#include \"coolsb/coolsb_detours.h\"\n\nextern HINSTANCE g_hInstance;\n\n#include \"wa_dlg.h\"\n\n/* wascrollbars_initapp\nCall on plug-in init\nreturns 1 if scrollbars can be skinned\n*/\nint wascrollbars_initapp(void) \n{\n\t// get windows version\n\tOSVERSIONINFO osi;\n\tBOOL bWinNT = TRUE;\n\n\tosi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\n\tGetVersionEx(&osi);\n\n\t//bWin9x = (osi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);\n\tbWinNT = (osi.dwPlatformId == VER_PLATFORM_WIN32_NT);\n\n\t// initialize CoolSB\n\tif (bWinNT) {\n\t\tCoolSB_InitializeApp();\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nvoid wascrollbars_uninitapp(void) \n{\n\tCoolSB_UninitializeApp();\n}\n\n/* wascrollbars_init\nCall on window WM_CREATE or WM_INITDIALOG\nreturns 1 if scrollbars can be skinned\n*/\nint wascrollbars_init(HWND hwnd) \n{\n\t// get windows version\n\tOSVERSIONINFO osi;\n\tBOOL bWinNT = TRUE;\n\n\tosi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\n\tGetVersionEx(&osi);\n\n\t//bWin9x = (osi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);\n\tbWinNT = (osi.dwPlatformId == VER_PLATFORM_WIN32_NT);\n\n\t// configure the custom scroll bars\n\tif (bWinNT)\n\t{\n\t\tInitializeCoolSB(hwnd);\n\t\tCoolSB_SetSize(hwnd, SB_BOTH, 17, 17);\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nvoid wascrollbars_uninit(HWND hwnd) \n{\n\tUninitializeCoolSB(hwnd);\n}\n\ntypedef struct \n{\n\tint x, y;\n\tint width, height;\n} CustomDrawTable;\n\nCustomDrawTable cdt_horz_normal[] = \n{\n\t{  0, 17, 17, 17 },\t//left arrow  NORMAL\n\t{ 17, 17, 17, 17 }, //right arrow NORMAL\n\t{ WADLG_SCROLLBAR_COLOR, WADLG_SCROLLBAR_COLOR }, //page left   NORMAL\n\t{ WADLG_SCROLLBAR_COLOR, WADLG_SCROLLBAR_COLOR }, //page left   NORMAL\n\n\t{ -1, -1, -1, -1 },\t//padding\n\n\t{ 102,  0, 4, 4 }, //horz thumb (top,left)\n\t{ 102,  4, 4, 9 }, //horz thumb (middle,left)\n\t{ 102, 13, 4, 4 }, //horz thumb (bottom,left)\n\n\t{ 106,  0, 26, 4 }, //horz thumb (top,middle)\n\t{ 106,  4,  9, 9 }, //horz thumb (middle,middle,left)\n\t{ 123,  4,  9, 9 }, //horz thumb (middle,middle,right)\n\t{ 106, 13, 26, 4 }, //horz thumb (bottom,middle)\n\n\t{ 132,  0, 4, 4 }, //horz thumb (top,right)\n\t{ 132,  4, 4, 9 }, //horz thumb (middle,right)\n\t{ 132, 13, 4, 4 }, //horz thumb (bottom,right)\n\n\t{ 115,  4, 8, 9 }, //horz thumb (middle,middle,middle)\n};\n\nCustomDrawTable cdt_horz_active[] = \n{\n\t{ 34, 17, 17, 17 }, //left arrow  ACTIVE\n\t{ 51, 17, 17, 17 }, //right arrow ACTIVE\n\t{ WADLG_SCROLLBAR_INV_COLOR, WADLG_SCROLLBAR_INV_COLOR }, //page left   NORMAL\n\t{ WADLG_SCROLLBAR_INV_COLOR, WADLG_SCROLLBAR_INV_COLOR }, //page left   NORMAL\n\n\t{ -1, -1, -1, -1 },\t//padding\n\n\t{ 102, 17, 4, 4 }, //horz thumb (top,left)\n\t{ 102, 21, 4, 9 }, //horz thumb (middle,left)\n\t{ 102, 30, 4, 4 }, //horz thumb (bottom,left)\n\n\t{ 106, 17, 26, 4 }, //horz thumb (top,middle)\n\t{ 106, 21,  9, 9 }, //horz thumb (middle,middle,left)\n\t{ 123, 21,  9, 9 }, //horz thumb (middle,middle,right)\n\t{ 106, 30, 26, 4 }, //horz thumb (bottom,middle)\n\n\t{ 132, 17, 4, 4 }, //horz thumb (top,right)\n\t{ 132, 21, 4, 9 }, //horz thumb (middle,right)\n\t{ 132, 30, 4, 4 }, //horz thumb (bottom,right)\n\n\t{ 115, 21, 8, 9 }, //horz thumb (middle,middle,middle)\n};\n\nCustomDrawTable cdt_vert_normal[] = \n{\n\t{ 0,  0, 17, 17 }, //up arrow   NORMAL\n\t{ 17, 0, 17, 17 }, //down arrow NORMAL\n\t{ WADLG_SCROLLBAR_COLOR, WADLG_SCROLLBAR_COLOR }, //page left   NORMAL\n\t{ WADLG_SCROLLBAR_COLOR, WADLG_SCROLLBAR_COLOR }, //page left   NORMAL\n\n\t{ -1, -1, -1, -1 },\t//padding\n\n\t{ 68, 0, 4, 4 }, //vert thumb (left)\n\t{ 72, 0, 9, 4 }, //vert thumb (middle)\n\t{ 81, 0, 4, 4 }, //vert thumb (right)\n\n\t{ 68,  4,  4, 26 }, //vert thumb (middle,left)\n\t{ 72,  4, 11,  9 }, //vert thumb (middle,middle,top)\n\t{ 72, 21, 11,  9 }, //vert thumb (middle,middle,bottom)\n\t{ 81,  4,  4, 26 }, //vert thumb (middle,right)\n\n\t{ 68, 30, 4, 4 }, //vert thumb (bottom,left)\n\t{ 72, 30, 9, 4 }, //vert thumb (bottom,middle)\n\t{ 81, 30, 4, 4 }, //vert thumb (bottom,right)\n\n\t{ 72, 13, 9, 8 }, //vert thumb (middle,middle,middle)\n};\n\nCustomDrawTable cdt_vert_active[] = \n{\n\t{ 34, 0, 17, 17 }, //up arrow   ACTIVE\n\t{ 51, 0, 17, 17 }, //down arrow ACTIVE\n\t{ WADLG_SCROLLBAR_INV_COLOR, WADLG_SCROLLBAR_INV_COLOR }, //page left   NORMAL\n\t{ WADLG_SCROLLBAR_INV_COLOR, WADLG_SCROLLBAR_INV_COLOR }, //page left   NORMAL\n\n\t{ -1, -1, -1, -1 },\t//padding\n\n\t{ 85, 0, 4, 4 }, //vert thumb (left)\n\t{ 89, 0, 9, 4 }, //vert thumb (middle)\n\t{ 98, 0, 4, 4 }, //vert thumb (right)\n\n\t{ 85,  4,  4, 26 }, //vert thumb (middle,left)\n\t{ 89,  4, 11,  9 }, //vert thumb (middle,middle,top)\n\t{ 89, 21, 11,  9 }, //vert thumb (middle,middle,bottom)\n\t{ 98,  4,  4, 26 }, //vert thumb (middle,right)\n\n\t{ 85, 30, 4, 4 }, //vert thumb (bottom,left)\n\t{ 89, 30, 9, 4 }, //vert thumb (bottom,middle)\n\t{ 98, 30, 4, 4 }, //vert thumb (bottom,right)\n\n\t{ 89, 13, 9, 8 }, //vert thumb (middle,middle,middle)\n};\n\nBOOL wascrollbars_handleMessages(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult)\n{\n\tNMHDR* pnmh;\n\tNMCSBCUSTOMDRAW *pCSCD;\n\tRECT *rc;\n\tCustomDrawTable *cdt;\n\n\tpnmh = (NMHDR*)lParam;\n\tpCSCD = (NMCSBCUSTOMDRAW *)pnmh;\n\n\tif (!(uMsg == WM_NOTIFY && pnmh->code == NM_COOLSB_CUSTOMDRAW)) return FALSE;\n\n\t// Take the default processing unless we set this to something else below.\n\t*pResult = 0;\n\n\tif (pCSCD->dwDrawStage == CDDS_PREPAINT)\n\t{\n\t\t*pResult = CDRF_SKIPDEFAULT;\n\t\treturn TRUE;\n\t}\n\n\t//the sizing gripper in the bottom-right corner\n\tif (pCSCD->nBar == SB_BOTH)\t\n\t{\n\t\tHBRUSH hbr = CreateSolidBrush(WADlg_getColor(WADLG_SCROLLBAR_DEADAREA_COLOR));\n\t\tFillRect(pCSCD->hdc, &pCSCD->rect, hbr);\n\t\tDeleteObject(hbr);\n\n\t\t*pResult = CDRF_SKIPDEFAULT;\n\t\treturn TRUE;\n\t}\n\telse if (pCSCD->nBar == SB_HORZ)\n\t{\n\t\trc = &pCSCD->rect;\n\n\t\tif (pCSCD->uState == CDIS_SELECTED) \n\t\t\tcdt = &cdt_horz_active[pCSCD->uItem];\n\t\telse\t\t\t\t   \n\t\t\tcdt = &cdt_horz_normal[pCSCD->uItem];\n\n\t\tif ((pCSCD->uItem == HTSCROLL_PAGELEFT) ||\n\t\t\t(pCSCD->uItem == HTSCROLL_PAGERIGHT))\n\t\t{\n\t\t\tHBRUSH hbr;\n\t\t\tCOLORREF color;\n\n\t\t\tcolor = WADlg_getColor(cdt->x);\n\n\t\t\thbr = CreateSolidBrush(color);\n\t\t\tFillRect(pCSCD->hdc, rc, hbr);\n\t\t\tDeleteObject(hbr);\n\n\t\t\t*pResult = CDRF_SKIPDEFAULT;\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (pCSCD->uItem == HTSCROLL_THUMB)\n\t\t{\n\t\t\t// get skin bitmap\n\t\t\tHDC hdcSkin;\n\t\t\tHBITMAP oBitmap;\n\n\t\t\thdcSkin = CreateCompatibleDC(pCSCD->hdc);\n\t\t\toBitmap = (HBITMAP)SelectObject(hdcSkin, WADlg_getBitmap());\n\t\t\tSetStretchBltMode(pCSCD->hdc, COLORONCOLOR);\n\n\t\t\t// top left\n\t\t\tStretchBlt(pCSCD->hdc, rc->left, rc->top, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle left\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left, rc->top+4, 4, rc->bottom-rc->top-8, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// bottom left\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left, rc->bottom-4, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\n\t\t\t// top middle\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->top, rc->right-rc->left-8, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle middle left\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->top+4, (rc->right-rc->left-8)/2+2, rc->bottom-rc->top-7, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle middle right\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->right-(rc->right-rc->left-8)/2-3, rc->top+4, (rc->right-rc->left-8)/2, rc->bottom-rc->top-7, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// bottom middle\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->bottom-cdt->height, rc->right-rc->left-8, cdt->height, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\n\t\t\t// top right\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->right-4, rc->top, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle right\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->right-4, rc->top+4, 4, rc->bottom-rc->top-8, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// bottom right\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->right-4, rc->bottom-4, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\n\t\t\t// middle middle middle\n\t\t\tcdt++;\n\t\t\tif ((rc->right-rc->left-8) > cdt->width)\n\t\t\t{\n\t\t\t\tStretchBlt(pCSCD->hdc, rc->left+(rc->right-rc->left)/2-4, rc->top+4, cdt->width, cdt->height, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t}\n\n\t\t\t// free dc\n\t\t\tSelectObject(hdcSkin, oBitmap);\n\t\t\tDeleteDC(hdcSkin);\n\n\t\t\t*pResult = CDRF_SKIPDEFAULT;\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\telse if (pCSCD->nBar == SB_VERT)\n\t{\n\t\trc = &pCSCD->rect;\n\n\t\tif (pCSCD->uState == CDIS_SELECTED)  \n\t\t\tcdt = &cdt_vert_active[pCSCD->uItem];\n\t\telse\t\t\t\t    \n\t\t\tcdt = &cdt_vert_normal[pCSCD->uItem];\n\n\t\tif ((pCSCD->uItem == HTSCROLL_PAGEGUP) ||\n\t\t\t(pCSCD->uItem == HTSCROLL_PAGEGDOWN))\n\t\t{\n\t\t\tHBRUSH hbr;\n\t\t\tCOLORREF color;\n\n\t\t\tcolor = WADlg_getColor(cdt->x);\n\n\t\t\thbr = CreateSolidBrush(color);\n\t\t\tFillRect(pCSCD->hdc, rc, hbr);\n\t\t\tDeleteObject(hbr);\n\n\t\t\t*pResult = CDRF_SKIPDEFAULT;\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (pCSCD->uItem == HTSCROLL_THUMB)\n\t\t{\n\t\t\t// get skin bitmap\n\t\t\tHDC hdcSkin = CreateCompatibleDC(pCSCD->hdc);\n\t\t\tHBITMAP oBitmap = (HBITMAP)SelectObject(hdcSkin, WADlg_getBitmap());\n\t\t\tSetStretchBltMode(pCSCD->hdc, COLORONCOLOR);\n\n\t\t\t// top left\n\t\t\tStretchBlt(pCSCD->hdc, rc->left, rc->top, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// top middle\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->top, rc->right-rc->left-8, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// top right\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->right-4, rc->top, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\n\t\t\t// middle left\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left, rc->top+4, 4, rc->bottom-rc->top-8, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle middle top\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->top+4, rc->right-rc->left-7, (rc->bottom-rc->top-8)/2+2, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle middle bottom\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->bottom-(rc->bottom-rc->top-8)/2-4, rc->right-rc->left-7, (rc->bottom-rc->top-8)/2, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle right\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->right-cdt->width, rc->top+4, cdt->width, rc->bottom-rc->top-8, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\n\t\t\t// bottom left\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left, rc->bottom-4, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// bottom middle\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->bottom-4, rc->right-rc->left-8, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// bottom right\n\t\t\tcdt++;\n\t\t\tStretchBlt(pCSCD->hdc, rc->right-4, rc->bottom-4, 4, 4, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t// middle middle middle\n\t\t\tcdt++;\n\t\t\tif ((rc->bottom-rc->top-8) > cdt->height)\n\t\t\t{\n\t\t\t\tStretchBlt(pCSCD->hdc, rc->left+4, rc->top+(rc->bottom-rc->top)/2-4, cdt->width, cdt->height, hdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\t\t\t}\n\n\t\t\t// free dc\n\t\t\tSelectObject(hdcSkin, oBitmap);\n\t\t\tDeleteDC(hdcSkin);\n\n\t\t\t*pResult = CDRF_SKIPDEFAULT;\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\telse\n\t{\n\t\t*pResult = CDRF_DODEFAULT;\n\t\treturn TRUE;\n\t}\n\n\t{\n\t\tHDC hdcSkin;\n\t\tHBITMAP oBitmap;\n\n\t\t// get skin bitmap\n\t\thdcSkin = CreateCompatibleDC(pCSCD->hdc);\n\t\toBitmap = (HBITMAP)SelectObject(hdcSkin, WADlg_getBitmap());\n\t\tSetStretchBltMode(pCSCD->hdc, COLORONCOLOR);\n\n\t\t//normal bitmaps, use same code for HORZ and VERT\n\t\tStretchBlt(pCSCD->hdc, rc->left, rc->top, rc->right-rc->left, rc->bottom-rc->top,\n\t\t\thdcSkin, cdt->x, cdt->y, cdt->width, cdt->height, SRCCOPY);\n\n\t\t// free dc\n\t\tSelectObject(hdcSkin, oBitmap);\n\t\tDeleteDC(hdcSkin);\n\t}\n\t*pResult = CDRF_SKIPDEFAULT;\n\treturn TRUE;\n}"
  },
  {
    "path": "setup/nsis/tools/Contrib/SkinnedControls/wa_scrollbars.h",
    "content": "/* wa_scrollbars.h */\n#ifndef WA_SCROLLBARS_INCLUDED\n#define WA_SCROLLBARS_INCLUDED\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nint wascrollbars_initapp(void);\nvoid wascrollbars_uninitapp(void);\n\nint wascrollbars_init(HWND hwnd);\nvoid wascrollbars_uninit(HWND hwnd);\n\nBOOL wascrollbars_handleMessages(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/SoftBlue.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1  63 146 202 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/SoftBrown.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 202 146  63 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/SoftGray.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\SoftGray\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 132 132 132 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/SoftGreen.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1  63 202 146 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/SoftPurple.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 146  63 202 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/SoftRed.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\SoftRed\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 202  63 146 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/blue.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\blue\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  43  85 131 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/blue2.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\blue\\BackGround2.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround2.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  43  85 131 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/brown.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\brown\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 131  85  43 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/brown2.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\brown\\BackGround2.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround2.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 131  85  43 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/darkgreen.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  23  81  50 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/darkgreen2.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\\BackGround2.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround2.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  23  81  50 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/gray.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\gray\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  62  62  62 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/gray2.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\gray\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  62  62  62 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/green.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\green\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  43 131  85 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/green2.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\green\\BackGround2.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround2.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  43 131  85 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/purple.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\purple\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  85  43 131 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/purple2.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\purple\\BackGround2.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround2.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1  85  43 131 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/red.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\red\\BackGround.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 131  43  85 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/BGSkins/red2.nsh",
    "content": "!macro UMUI_BG\n\t\tSetOutPath \"$PLUGINSDIR\"\n\t\tFile \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\red\\BackGround2.bmp\"\n\t\tBgImage::SetBg /FILLSCREEN \"$PLUGINSDIR\\BackGround2.bmp\"\n\t\tCreateFont $1 \"Verdana\" 30 700\n\t\tBgImage::AddText \"$(^Name)\" $1 131  43  85 16 114 -1 -1\n\t\tBgImage::AddText \"$(^Name)\" $1 255 255 255 12 110 -1 -1\n\t\tBgImage::Redraw\n!macroend\n!macro UMUI_BG_Destroy\n\t\tBgImage::Destroy\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/AdditionalTasks.ini",
    "content": "[Settings]\nNumFields=1\n\n[Field 1]\nType=Label\nText=\nLeft=0\nRight=-1\nTop=0\nBottom=31\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/AlternateWelcomeFinishAbort.ini",
    "content": "[Settings]\nRect=1044\nNumFields=2\n\n[Field 1]\nType=Label\nLeft=20\nRight=-15\nTop=45\nBottom=76\nHWND=\nText=\n\n[Field 2]\nType=Label\nLeft=20\nRight=-15\nTop=76\nBottom=-1\nHWND=\nText=\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/AlternateWelcomeFinishAbortImage.ini",
    "content": "[Settings]\nRect=1044\nNumFields=3\n\n[Field 1]\nType=bitmap\nLeft=0\nRight=109\nTop=0\nBottom=-1\nFlags=RESIZETOFIT\n\n[Field 2]\nType=Label\nLeft=126\nRight=-15\nTop=45\nBottom=76\n\n[Field 3]\nType=Label\nLeft=126\nRight=-15\nTop=76\nBottom=-10\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/AlternativeStartMenu.ini",
    "content": "[Settings]\nNumFields=3\nState=0\n\n[Field 1]\nType=Label\nLeft=0\nRight=-1\nTop=0\nBottom=27\nHWND=\nText=\n\n[Field 2]\nType=Text\nLeft=0\nRight=-1\nTop=27\nBottom=39\nNotify=ONTEXTCHANGE\nState=\n\n[Field 3]\nType=Listbox\nLeft=0\nRight=-1\nTop=41\nBottom=-1\nFlags=NOTIFY\nNotify=ONSELCHANGE\nListItems="
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/Confirm.ini",
    "content": "[Settings]\nNumFields=1\n\n[Field 1]\nType=Label\nText=\nLeft=0\nRight=-1\nTop=0\nBottom=37\n\n[Field 2]\nType=Label\nText=\nLeft=0\nRight=-1\nTop=42\nBottom=55\n\n[Field 3]\nType=Text\nFlags=MULTILINE|READONLY|VSCROLL\nLeft=0\nRight=-1\nTop=55\nBottom=-1\nState="
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/Information.ini",
    "content": "[Settings]\nNumFields=2\n\n[Field 1]\nType=Label\nText=\nLeft=0\nRight=-1\nTop=0\nBottom=15\n\n[Field 2]\nType=Text\nFlags=MULTILINE|READONLY|VSCROLL\nLeft=0\nRight=-1\nTop=15\nBottom=-1\nState="
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/MaintenanceUpdateSetupType.ini",
    "content": "[Settings]\nNumFields=13\n\n[Field 1]\nType=Label\nLeft=0\nRight=-1\nTop=0\nBottom=26\nHWND=\nText=\n\n[Field 2]\nType=RadioButton\nText=\nLeft=0\nRight=-1\nTop=26\nBottom=36\nState=1\n\n[Field 3]\nType=Bitmap\nText=\nLeft=16\nRight=36\nTop=39\nBottom=59\nFlags=TRANSPARENT\n\n[Field 4]\nType=Label\nText=\nLeft=52\nRight=-1\nTop=36\nBottom=66\n\n[Field 5]\nType=RadioButton\nText=\nLeft=0\nRight=-1\nTop=66\nBottom=76\nState=0\n\n[Field 6]\nType=Bitmap\nText=\nLeft=16\nRight=36\nTop=79\nBottom=99\nFlags=TRANSPARENT\n\n[Field 7]\nType=Label\nLeft=52\nRight=-1\nTop=76\nBottom=106\nHWND=\nText=\n\n[Field 8]\nType=RadioButton\nText=\nLeft=0\nRight=-1\nTop=106\nBottom=116\n\n[Field 9]\nType=Bitmap\nText=\nLeft=16\nRight=36\nTop=119\nBottom=139\nFlags=TRANSPARENT\n\n[Field 10]\nType=Label\nLeft=52\nRight=-1\nTop=116\nBottom=145\nHWND=\nText=\n\n[Field 11]\nType=RadioButton\nText=\nLeft=0\nRight=-1\nTop=145\nBottom=155\nState=1\n\n[Field 12]\nType=Bitmap\nText=\nLeft=16\nRight=36\nTop=158\nBottom=178\nFlags=TRANSPARENT\n\n[Field 13]\nType=Label\nLeft=52\nRight=-1\nTop=155\nBottom=185\nHWND=\nText="
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/SerialNumber.ini",
    "content": "[Settings]\nNumFields=1\n\n[Field 1]\nType=Label\nText=\nLeft=0\nRight=-1\nTop=0\nBottom=29\n\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/WelcomeFinishAbort.ini",
    "content": "[Settings]\nRect=1044\nNumFields=2\n\n[Field 1]\nType=label\nLeft=20\nRight=-15\nTop=10\nBottom=50\n\n[Field 2]\nType=label\nLeft=20\nTop=50\nRight=-15\nBottom=-1"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Ini/WelcomeFinishAbortImage.ini",
    "content": "[Settings]\nRect=1044\nNumFields=3\n\n[Field 1]\nType=bitmap\nLeft=0\nRight=109\nTop=0\nBottom=-1\nFlags=RESIZETOFIT\n\n[Field 2]\nType=label\nLeft=120\nRight=-15\nTop=10\nBottom=50\n\n[Field 3]\nType=label\nLeft=120\nTop=50\nRight=-15"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Afrikaans.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Albanian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Arabic.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Armenian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Asturian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Basque.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Belarusian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Bosnian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Breton.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Bulgarian.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Bulgarian (1026)\n;By Angel <laterist@gmail.com> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Добре дошли в съветника за инсталация на $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Моля изберете език преди да започнете инсталацията на $(^NameDA):$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Добре дошли в съветника за премахване на $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Моля изберете език преди да започнете премахването на $(^NameDA):$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Език:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Този съветник ще ви преведе през стъпките необходими за инсталация на $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Въведете Вашия сериен номер за $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Моля попълнете полетата по-долу.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Моля попълнете различните полета по-долу. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT е неправилен. Моля потвъредете информацията, която въведохте.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Име\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Организация\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Сериен номер\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Код за активация\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Парола\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Съветникът събра необходимата информация и е готов за инсталация на $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Потвърдете инсталацията\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Съветникът е готова да установи $(^NameDA) на Вашия комоютър.$\\r$\\nАко желаете да проверите или промените някоя от настройките за инсталация, моля натиснете $(^BackBtn). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Съветникът събра необходимата информация и е готов за премахване на $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Потвърдете премахването\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Съветникът е готова да премахне $(^NameDA) от Вашия комоютър.$\\r$\\nАко желаете да проверите или промените някоя от настройките за премахване, моля натиснете $(^BackBtn). Натиснете $(^NextBtn) за да започнете премахването.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Настоящи настройки:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Целева папка:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Папка в началното меню:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Следните части ще бъдат установени:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Завършване на съветника по инсталация на $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Съветникът беще прекъснат преди инсталацията на $(^NameDA) да може да бъде напълно завършена.$\\r$\\n$\\r$\\nЗа да завършите инсталацията на това приложение на по-късен етап, моля заредете съветника отново.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nНатиснете $(^CloseBtn) за да излезете от съветника по инсталация.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Завършване на съветника по премахване на $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Съветникът беще прекъснат преди премахването на $(^NameDA) да може да бъде напълно завършено.$\\r$\\n$\\r$\\nЗа да завършите премахването на това приложение на по-късен етап, моля заредете съветника отново.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nНатиснете $(^CloseBtn) за да излезете от съветника по премахване.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Вид на инсталация\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Моля изберете този вид, който най-добре отговаря на изискванията Ви.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Моля изберете вид на инсталацията.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Единствено необходимте части ще бъдат установени. (Заема по-малко пространство на диска)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Всички основни части ще бъдат установени. Препоръчва се за по-голямата част от потребителите.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Всички програмни части ще бъдат установени. (Отнема най-много пространство на диска)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Изберете, коит програмни части искате да бъдат установени, както и къде да бъдат установени. Препоръчва се за напреднали потребители.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Вид на премахване\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Моля изберете този вид, който най-добре отговаря на изискванията Ви.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Моля изберете вид на премахването.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Единствено необходимте части ще бъдат премахнати.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Всички основни части ще бъдат премахнати.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Всички части ще бъдат премахнати.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Изберете, кои части от приложението ще бъдат премахнати.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Минимално\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Обикновено\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Пълно\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Ръчно\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Моля отбележете следното относно инсталацията на $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Моля отбележете следното относно премахването на $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Информация\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Информация относно $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Изберете допълнителни задачи, които да бъдат извършени по време на инсталацията на $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Изберете допълнителни задачи, които да бъдат извършени по време на премахването на $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Допълнителни задачи\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Кои са допълнителните задачи, които следва да бъдат извършени?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Допълнителни икони:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Създаване на икона на Работния плот\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Създаване на икона за Бързо стартиране\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Допълнителни параметри:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Изпълни $(^NameDA) при стартиране на Windows\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Асоцииране на видове файлове:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Асоцииране на $(^NameDA) с \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" вид на файл.\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Как ще бъдат създадени иконите:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"За всички потребители\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Само за текущия потребител\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Обновяване\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Обновяване на предна версия на приложението.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Добре дошли в съветника по обновяване на $(^NameDA).$\\r$\\nТази програма Ви позволява да обновите версия $OLDVERSION, която бе намерена на Вашия компютър.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Обновяване\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Обновяване на всички части на $(^NameDA), които са вече установени до версия $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Премахване\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Премахване на версия $OLDVERSION от Вашия компютър.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Продължаване на инсталацията\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Продължаване на обичайната инсталация. Използвайте тази възможност, ако искате да установите новата версия в друга целева папка, заедно с предната инсталация.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Поддръжка\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Промяна, поправка или премахване на приложението.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Добре дошли в съветника по поддръжка на $(^NameDA).$\\r$\\nТова приложение ще ви позволи да промените настоящото приложение.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Промяна\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Изберете нови части, които да бъдат добавени или съществуващи части, които да бъдат премахнати.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Поправка\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Нова инсталация на всички части на $(^NameDA), които са вече установени.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Премахване\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Премахване на $(^NameDA) от Вашия компютър.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Продължаване на инсталацията\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Продължаване на обичайната инсталация. Използвайте тази възможност, ако искате да установите приложението върху вече съществуваща инсталация или да го инсталирате в друга целева папка.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Съветникът има нужда от файл с име\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"за да продължи.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Съветникът има нужда от следващият носител, за да продължи.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Укажете местонахождението на файл с име\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"за да продължите.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Моля закачете\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Пътека:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Catalan.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Corsican.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Croatian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Czech.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Czech (1029)\n;By Pospec (pospec4444atgmaildotcom)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Vítejte v prùvodci instalací $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Pøed zaèátkem instalace $(^NameDA) vyberte, prosím, jazyk:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Vítejte v prùvodci odebráním $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Pøed zaèátkem odinstalace $(^NameDA) vyberte, prosím, jazyk:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Jazyk:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Tento prùvodce vás provede instalací $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Zadejte sériové èíslo pro $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Vyplòte pole níže, prosím.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Vyplòte pole níže, prosím. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT je nesprávné. Zkontrolujte, prosím, zda jste zadali správné údaje.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Jméno\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organizace\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Sériové èíslo\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Aktivaèní kód\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Heslo\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Prùvodce získal všechny potøebné informace a je pøipraven nainstalovat produkt $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Potvrdit instalaci\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Prùvodce je pøipraven nainstalovat $(^NameDA) na váš poèítaè.$\\r$\\nPokud chcete zkontrolovat nebo zmìnit nìkteré parametry instalace, kliknìte na Zpìt. $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Prùvodce získal všechny potøebné informace a je pøipraven odebrat produkt $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Potvrdit odebrání\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Prùvodce je pøipraven odebrat $(^NameDA) na váš poèítaè.$\\r$\\nPokud chcete zkontrolovat nebo zmìnit nìkteré parametry odebrat, kliknìte na Zpìt. Kliknìte na Další pro odebrání.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Stávající nastavení:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Cílová složka:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Nabídka Start:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Budou instalovány následující komponenty:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Dokonèování prùvodce instalací $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Prùvodce instalací byl ukonèen døíve, než mohl být $(^NameDA) kompletnì nainstalovaný.$\\r$\\n$\\r$\\nPro pozdìjší instalace spuste, prosím, instalátor znovu.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nKliknìte na $(^CloseBtn) pro ukonèení prùvodce instalací.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Dokonèování prùvodce odebráním $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Prùvodce odebráním byl ukonèen døíve, než mohl být $(^NameDA) kompletnì odebrán.$\\r$\\n$\\r$\\nPro pozdìjší odebrání spuste, prosím, tohoto prùvodce znovu.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nKliknìte na $(^CloseBtn) pro ukonèení prùvodce odebráním.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Typ instalace\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Prosím, vyberte typ instalace, který vám vyhovuje.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Prosím, vyberte typ instalace.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Budou instalovány jen nutné souèásti. (Šetøí místo na disku)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Budou se instalovat všechny dùležité souèásti. Doporuèuje se pro vìtšinu uživatelù.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Budou se instalovat všechny souèásti. (Potøebuje nejvíce místa na disku)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Vyberte souèásti, které se budou instalovat a urèete, kam se nainstalují. Doporuèuje se pro zkušené uživatele.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Typ odinstalace\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Prosím, vyberte typ odinstalace, který vám vyhovuje.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Prosím, vyberte typ odinstalace.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Bude ponechána vìtšina souèástí.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Budou ponechány nutné souèástí.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Celá aplikace bude odstranìna.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Vyberte souèásti programu, které se odeberou.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimální\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standardní\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Úplná\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Vlastní\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Prosím, vezmìte v úvahu tyto informace týkající se instalace $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Prosím, vezmìte v úvahu tyto informace týkající se odebrání $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Informace\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informace týkající se $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Vyberte dodateèné akce, které má prùvodce provést v prùbìhu instalace $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Vyberte dodateèné akce, které má prùvodce provést v prùbìhu odebrání $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Dodateèné akce\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Které dodateèné akce chcete provést?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Ikony:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Vytvoøit ikonu na ploše\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Vytvoøit ikonu snadného spuštìní\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Dalsi parametry:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Spouštìt $(^NameDA) po startu Windows\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Asociace souborù:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Asociovat $(^NameDA) s \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" soubory\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Vytvoøit zástupce pro:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Všechny uživatele\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Jen pro mì\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Aktualizovat\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Aktualizace pøedchozí verze programu.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Vítejte v prùvodci aktualizací $(^NameDA).$\\r$\\nTento prùvodce umožòuje aktualizovat $OLDVERSION nalezenou na vašem poèítaèi.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Aktualizovat\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Aktualizovat všechny souèásti $(^NameDA) nainstalované pøed verzí $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Odebrat\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Odebrat verzi $OLDVERSION z vašeho poèítaèe.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Pokraèovat v instalaci\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Pokraèovat v instalaci obvyklým zpùsobem. Použijte tuto volbu, pokud chcete nainstalovat tuto novìjší verzi do jiné složky než pøedchozí verzi.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Údržba\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Zmìna, oprava nebo odstranìní programu.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Vítejte v prùvodci údržbou programu $(^NameDA).$\\r$\\nPomocí tohoto prùvodce mùžete modifikovat aktuální instalaci.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Zmìnit\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Vyberte nové souèásti, které budou pøidány nebo vyberte nainstalované souèásti, které budou odebrány.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Opravit\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Pøeinstalovat všechny souèásti $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Odebrat\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Odebrat $(^NameDA) z vašeho poèítaèe.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Pokraèovat\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Pokraèovat v prùvodci obvyklým zpùsobem. Použijte tuto možnost, pokud chcete pøeinstalovat stávající instalaci programu nebo nainstalovat jej znovu do jiné složky.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Prùvodce vyžaduje soubor\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"aby mohl pokraèovat.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Vložte další disk pro pokraèování.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Urèete umístìní souboru\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"aby mohla instalace pokraèovat.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Prosím vložte\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Cesta:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Danish.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Dutch.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/English.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: English (1033)\n;By SuperPat\n;Changes by Matthias <bodenseematze@users.sourceforge.net>\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Welcome to the $(^NameDA) Setup Wizard\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Before beginning the installation of $(^NameDA), please choose a language:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Welcome to the $(^NameDA) Uninstall Wizard\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Before beginning the uninstallation of $(^NameDA), please choose a language:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Language:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"This wizard will guide you through the installation of $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Enter your serial number of $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Please inform the various fields below.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Please inform the various fields below. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT is invalid. Please reverify information that you have just entered.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Name\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organization\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Serial Number\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Activation code\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Password\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Setup has finished gathering information and is ready to install $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Confirm Installation\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Setup is ready to install $(^NameDA) on your computer.$\\r$\\nIf you want to review or change any of your installation settings, click $(^BackBtn). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Setup has finished gathering information and is ready to uninstall $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Confirm Uninstallation\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Setup is ready to uninstall $(^NameDA) on your computer.$\\r$\\nIf you want to review or change any of your uninstallation settings, click $(^BackBtn). Click $(^NextBtn) to begin the uninstall.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Current configuration:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Destination location:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Start menu folder:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"The following components will be installed:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Completing the $(^NameDA) Setup Wizard\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"The wizard was interrupted before $(^NameDA) could be completely installed.$\\r$\\n$\\r$\\nTo install this program at a later time, please run the setup again.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nClick $(^CloseBtn) to exit the Setup wizard.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Completing the $(^NameDA) Uninstall Wizard\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"The wizard was interrupted before $(^NameDA) could be completely uninstalled.$\\r$\\n$\\r$\\nTo uninstall this program at a later time, please run the uninstall again.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nClick $(^CloseBtn) to exit the Uninstall wizard.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Setup Type\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Choose the setup type that best suits your needs.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Please select a setup type.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Only the necessary features will be installed. (Requires the less disk space)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"All the main features will be installed. Recommended for the majority of the users.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"All program features will be installed. (Requires the most disk space)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Choose which programm features you want installed and where they will be installed. Recommended for advanced users.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Uninstall Type\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Choose the uninstall type that best suits your needs.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Please select an uninstall type.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Only the main features will be kept.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Only the necessary features will be kept.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"All program will be uninstalled.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Choose which programm features you want uninstall.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimal\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standard\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Complete\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Custom\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Please take note of informations concerning the installation of $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Please take note of informations concerning the uninstallation of $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Information\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informations concerning $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Select additional tasks that setup must carry out during the setup process of $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Select additional tasks that setup must carry out during the uninstall process of $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Additional Tasks\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Which are the additional tasks which must be carried out?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Additional Icons:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Create a desktop icon\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Create a Quick Launch icon\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Advanced parameters:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Launch $(^NameDA) at the windows startup\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"File Association:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Associate $(^NameDA) with the \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" file type\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"How the shortcuts will be created:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"For all users\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Only for the current user\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Update\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Update a previous version of the program.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Welcome to the $(^NameDA) update wizard.$\\r$\\nThis program lets you update the version $OLDVERSION which was found on your computer.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Update\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Update all $(^NameDA) components already installed to the version $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Remove\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Uninstall the version $OLDVERSION from your computer.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Continue setup\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Continue the setup as usual. Use this option if you want to install this newer version in an other folder in parallel with the preceding setup.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Maintenance\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Modify, repair, or remove the program.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Welcome to the $(^NameDA) setup maintenance program.$\\r$\\nThis program lets you modify the current installation.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Modify\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Select new components to add or select already installed components to remove.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Repair\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Reinstall all $(^NameDA) components already installed.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Remove\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Uninstall $(^NameDA) from your computer.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Continue setup\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Continue the setup as usual. Use this option if you want to reinstall this program over an existing install or to install it a new time in a different folder.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Setup needs the\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"file to continue.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Setup needs the next disk to continue.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Specify the location of the file\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"to continue.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Please insert the\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Path:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Esperanto.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Estonian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Farsi.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Finnish.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/French.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: French (1036)\n;By SuperPat\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Bienvenue dans le programme d'installation de $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Avant de commencer l'installation de $(^NameDA), veuillez choisir un langage:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Bienvenue dans le programme de désinstallation de $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Avant de commencer la désinstallation de $(^NameDA), veuillez choisir un langage:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Langage:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Vous êtes sur le point d'installer $(^NameDA) sur votre ordinateur.$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Entrer votre numéro de série de $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Veuillez renseigner les différents champs ci-dessous.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Veuillez renseigner les différents champs ci-dessous. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT invalide. Veuillez revérifier les informations que vous venez d'entrer.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Nom\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Société\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Numéro de série\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Code d'activation\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Mot de passe\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Le programme a finit de rassembler les informations et est prêt à installer $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Confirmation de l'installation\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Le programme est prêt à installer $(^NameDA) sur votre ordinateur.$\\r$\\nSi vous vouler revoir ou changer n'importe lequel de vos paramètres d'installation, cliquez sur $(^BackBtn). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Le programme a finit de rassembler les informations et est prêt à désinstaller $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Confirmation de la désinstallation\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Le programme est prêt à désinstaller $(^NameDA) sur votre ordinateur.$\\r$\\nSi vous vouler revoir ou changer n'importe lequel de vos paramètres de désinstallation, cliquez sur $(^BackBtn). Sinon cliquez sur $(^NextBtn) pour commencer l'installation.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Configuration actuelle:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Dossier de destination:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Répertoire du menu démarrer:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Les composants suivants seront installés:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Abandon de l'installation de $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"L'installation a été interrompue avant que $(^NameDA) n'ait été complètement installé.$\\r$\\n$\\r$\\nPour installer ce programme plus tard, redémarrez l'installation une nouvelle fois.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nCliquez sur $(^CloseBtn) pour quitter le programme d'installation.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Abandon de la désinstallation de $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"La désinstallation a été interrompue avant que $(^NameDA) n'ait été complètement désinstallé.$\\r$\\n$\\r$\\nPour désinstaller ce programme plus tard, redémarrez la désinstallation une nouvelle fois.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nCliquez sur $(^CloseBtn) pour quitter le programme de désinstallation.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Type d'installation\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Choisissez le type d'installation qui convient le plus à vos besoins.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Selectionnez un type d'installation.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Uniquement les fonctionnalités requise seront installées. (Requiert le moins d'espace disque)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Toutes les principales fonctionnalités seront installées. Recommandé pour la plupart des utilisateurs.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Toutes les fonctionnalités seront installées. (Requiert le plus d'espace disque)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Choisir quelles fonctionnalitées du programme vous voulez installer et où elles seront installées. Recommandé pour les utilisateurs avancés.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Type de Désinstallation\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Choisissez le type de désinstallation qui convient le plus à vos besoins.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Selectionnez un type de désinstallation.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Uniquement les pincipales fonctionnalités seront gardés.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Uniquement les fonctionnalités requises seront gardés.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Tous le programme sera désinstallé.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Choisir quelles fonctionnalitées du programme vous voulez désinstaller.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimale\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standard\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Complète\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Personnalisée\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Veuillez prendre connaissance des informations concernant l'installation de $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Veuillez prendre connaissance des informations concernant la désinstallation de $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Information\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informations concernant $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Sélectionnez les tâches supplémentaires que l'assistant doit effectuer pendant l'installation de $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Sélectionnez les tâches supplémentaires que l'assistant doit effectuer pendant la désinstallation de $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Tâches supplémentaires\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Quelles sont les tâches supplémentaires qui doivent être effectuées?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Icônes Additionnelles:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Créer une icône sur le bureau\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Créer une icône dans la barre de lancement rapide\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Paramètres avancés:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Lancer $(^NameDA) au démarrage de Windows\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Association de fichier:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Associer $(^NameDA) avec les fichiers de type \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" \"\n!endif\n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Comment les raccourcis seront créés:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Pour tous les utilisateurs\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Uniquement pour l'utilisateur courant\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Mise à jour\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Mettre à jour une ancienne version du programme.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Bienvenue dans l'assistant de mise à jour de $(^NameDA).$\\n$\\rCe programme va vous permettre de mettre à jour la version $OLDVERSION qui a été trouvé sur votre ordinateur.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Mettre à jour\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Mettre à jour tous les composants de $(^NameDA) déjà installés à la version $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Supprimer\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Désinstaller la version $OLDVERSION de votre ordinateur.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Continuer l'installation\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Continuer l'installation comme d'habitude. Utilisez cette option si vous voulez installer cette nouvelle version dans un autre répertoire en parallèle à la version précédente.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Maintenance\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Modifier, réparer, ou supprimer le programme.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Bienvenue dans l'assistant de maintenance de $(^NameDA).$\\r$\\nCe programme va vous permettre de modifier l'installation actuelle.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Modifier\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Sélectionner de nouveaux composants à ajouter et sélectionner des composants déjà installés à supprimer.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Réparer\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Réinstaller tous les composants de $(^NameDA) déjà installés.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Supprimer\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Désinstaller $(^NameDA) de votre ordinateur.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Continuer l'installation\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Continuer l'installation comme d'habitude. Pour réinstaller ce programme sur une précédente installation ou une nouvelle fois dans un autre répertoire.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"L'assistant d'installation à besoin du fichier\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"pour continuer.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"L'assistant d'installation à besoin du disque suivant pour continuer.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Spécifier la localisation du fichier\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"pour continuer.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Veuillez insérer le\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Chemin:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Galician.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Georgian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/German.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: German (1031)\n;By Tobias <tm2006@users.sourceforge.net>\n;Changes by Matthias <bodenseematze@users.sourceforge.net>\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Willkommen zur Installation von $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Wählen Sie bitte eine Sprache für die Installation von $(^NameDA) aus:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Willkommen zur Deinstallation von $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Wählen Sie bitte eine Sprache für die Deinstallation von $(^NameDA) aus:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Sprache:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Dieser Assistent führt durch die Installation von $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Geben Sie bitte die Seriennummer zu $(^NameDA) ein\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Bitte füllen Sie die verschiedenen Felder aus.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Bitte füllen Sie die verschiedenen Felder aus. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT ist ungültig. Bitte überprüfen Sie die eingegebenen Informationen.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Name\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organisation\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Seriennummer\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Aktivierungscode\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Passwort\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Die benötigten Informationen wurden gesammelt um $(^NameDA) zu installieren.\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Installation bestätigen\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Der Assistent ist bereit, $(^NameDA) auf den Computer zu installieren.$\\r$\\nFalls die Installationseinstellungen noch überprüft oder geändert werden sollen, klicken Sie auf $(^BackBtn). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Die benötigten Informationen wurden gesammelt um $(^NameDA) zu deinstallieren.\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Deinstallation bestätigen\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Der Assistent ist bereit, $(^NameDA) vom Computer zu entfernen.$\\r$\\nFalls die Deinstallationseinstellungen noch überprüft oder geändert werden sollen, klicken Sie auf $(^BackBtn). Klicken Sie auf $(^NextBtn), um die Deinstallation zu beginnen.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Derzeitige Konfiguration:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Zielort:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Startmenüordner:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Die folgenden Komponenten werden installiert:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Beenden des $(^NameDA) Installationsassistenten\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Der Assistent wurde unterbrochen, bevor $(^NameDA) komplett installiert werden konnte.$\\r$\\n$\\r$\\nUm das Programm zu einem späteren Zeitpunkt zu installieren, führen Sie diese Installation bitte erneut aus.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nKlicken Sie auf $(^CloseBtn), um den Installationsassistenten zu schließen.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Beenden des Deinstallationsassistenten für $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Der Assistent wurde unterbrochen, bevor $(^NameDA) komplett deinstalliert werden konnte.$\\r$\\n$\\r$\\nUm das Programm zu einem späteren Zeitpunkt zu deinstallieren, führen Sie diese Installation bitte erneut aus.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nKlicken Sie auf $(^CloseBtn), um den Deinstallationsassistenten zu schließen.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Installationsart\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Auswahl der passenden Installationsart\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Wählen Sie bitte eine Installationsart aus.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Nur die benötigten Funktionen werden installiert. (Benötigt den geringsten Speicherplatz)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Alle Hauptfunktionen werden installiert. Empfohlen für die meisten Anwender.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Alle Programmfunktionen werden installiert. (Benötigt den meisten Speicherplatz)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Wählen Sie aus, welche Programmfunktionalität wohin installiert werden soll. Empfohlen für fortgeschrittene Anwender.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Deinstallationsart\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Auswahl der passenden Deinstallationsart\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Wählen Sie bitte eine Deinstallationsart aus.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Nur die Hauptfunktionen werden beibehalten.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Nur die wichtigsten Funktionen werden beibehalten.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Das gesamte Programm wird beibehalten.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Wählen Sie aus, welche Programmfunktionalität deinstalliert werden soll.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimal\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standard\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Komplett\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Benutzerdefiniert\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Bitte beachten Sie die Informationen über die Installation von $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Bitte beachten Sie die Informationen über die Deinstallation von $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Information\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informationen über $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Wählen Sie zusätzliche Aktionen, die während des Installationsprozesses von $(^NameDA) durchgeführt werden sollen. $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Wählen Sie zusätzliche Aktionen, die während des Deinstallationsprozesses von $(^NameDA) durchgeführt werden sollen. $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Zusätzliche Aktionen\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Welche zusätzlichen Aktionen sollen durchgeführt werden?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Zusätzliche Icons:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Erstelle ein Icon auf dem Desktop\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Erstelle ein  Icon auf der Schnellstartleiste\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Fortgeschrittene Parameter:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Starte $(^NameDA) nach einem Systemstart\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Dateiverknüpfungen:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Verknüpfe $(^NameDA) mit \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" Dateityp\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Für wen sollen die Verknüpfungen erstellt werden:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Für alle Benutzer\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Nur für den angemeldeten Benutzer\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Aktualisieren\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Aktualisierung einer früheren Version des Programms.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Willkommen zum $(^NameDA) Installationsassistenten.$\\r$\\nDieses Programm führt eine Aktualisierung der Version $OLDVERSION durch.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Aktualisierung\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Aktualisierung aller bereits installierten Komponenten auf die Version $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Entfernen\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Deinstallation der Version $OLDVERSION  vom Computer.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Installation fortsetzen\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Installation wie üblich fortsetzen. Verwenden Sie diese Option, wenn die neue Version in einem anderen Ordner parallel zur bereits bestehenden Version installiert werden soll.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Anpassen\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Ändern, Reparieren oder Entfernen des Programms.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Willkommen zum $(^NameDA) Anpassungsassistenten.$\\r$\\nMit diesem Programm kann die aktuelle Installation geändert werden.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Ändern\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Wählen Sie neue Komponenten aus, um diese zu installieren oder bereits vorhandene, um diese zu deinstallieren.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Reparieren\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Reinstallation aller bereits installierten $(^NameDA) Komponenten.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Entfernen\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Deinstallation der $(^NameDA) vom Computer.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Installation fortsetzen\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Installation wie üblich fortsetzen. Verwenden Sie diese Option, wenn die Neuinstallation eine bereits existierende Installation überschreiben soll oder um eine Neuinstallation in einem anderen Verzeichnis durchzuführen.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Die Installation benötigt\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"Datei um fortsetzen zu können.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Die Installation benötigt den nächsten Datenträger um fortsetzen zu können.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Wählen Sie den Speicherort der Datei\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"um fortzusetzen.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Bitte legen Sie den Datenträger ein\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Pfad:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Greek.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Greek (1032)\n;By Matthias <bodenseematze@users.sourceforge.net> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Καλωσορίσατε στον οδηγό εγκατάστασης $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Πριν από την εγκατάσταση του $(^NameDA) επιλέξτε μία γλώσσα:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Καλωσορίσατε στον οδηγό απεγκατάστασης $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Πριν από την απεγκατάσταση του $(^NameDA) επιλέξτε μία γλώσσα:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Γλώσσα:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Αυτός ο οδηγός θα σας καθοδηγήσει μέσω της εγκατάστασης του $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Εισαγάγετε το σειριακό αριθμό για το $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Συμπληρώστε τα διάφορα πεδία.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Συμπληρώστε τα διάφορα πεδία. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"Η καταχώρηση $UMUI_SNTEXT δεν είναι έγκυρη. Επαληθεύστε τις πληροφορίες που καταχωρήσατε.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Όνομα\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Οργανισμός\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Αριθμός σειράς\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Κωδικός ενεργοποίησης\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Κωδικός πρόσβασης\"\n!endif \n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Το πρόγραμμα έχει ολοκληρώσει τη συλλογή των απαραίτητων πληροφοριών και είναι έτοιμο για την εγκατάσταση του $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Επιβεβαίωση εγκατάστασης\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Το πρόγραμμα είναι έτοιμο να εγκαταστήσει το $(^NameDA) στον υπολογιστή σας.$\\r$\\nΑν θέλετε να ελέγξετε πάλι ή να τροποποιήσετε τις ρυθμίσεις εγκατάστασης πατήστε $(^BackBtn). $_CLICK\"\n!endif \n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Το πρόγραμμα έχει ολοκληρώσει τη συλλογή των απαραίτητων πληροφοριών και είναι έτοιμο για την απεγκατάσταση του $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Επιβεβαίωση της απεγκατάστασης\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Το πρόγραμμα είναι έτοιμο να καταργήσει το $(^NameDA) από τον υπολογιστή σας.$\\r$\\nΑν θέλετε να ελέγξετε πάλι ή να τροποποιήσετε τις ρυθμίσεις απεγκατάστασης πατήστε $(^BackBtn). Πατήστε $(^BackBtn) για να ξεκινήσετε την απεγκατάσταση.\"\n!endif \n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Τρέχουσα διαμόρφωση:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Τοποθεσία προορισμού:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Φάκελος μενού έναρξης:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Θα εγκατασταθούν τα ακόλουθα στοιχεία:\"\n!endif \n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Τερματισμός του βοηθού εγκατάστασης $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Ο βοηθός εγκατάστασης διακόπηκε πριν την ολοκλήρωση της εγκατάστασης του $(^NameDA).$\\r$\\n$\\r$\\nΓια να εγκαταστήσετε το πρόγραμμα σε μεταγενέστερο χρόνο, εκτελέστε ξανά τον οδηγό.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nΚάντε κλικ στο $(^CloseBtn) για να κλείσετε τον βοηθό εγκατάστασης.\"\n!endif \n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Τερματίστε τον οδηγό απεγκατάστασης για το $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Ο βοηθός απεγκατάστασης διακόπηκε πριν την ολοκλήρωση της κατάργησης του $(^NameDA).$\\r$\\n$\\r$\\nΓια να καταργήσετε το πρόγραμμα σε μεταγενέστερο χρόνο, εκτελέστε ξανά τον οδηγό.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nΚάντε κλικ στο $(^CloseBtn) για να κλείσετε τον βοηθό απεγκατάστασης.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Τύπος οδηγού εγκατάστασης\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Επιλέξτε τον τύπο οδηγού εγκατάστασης που σας ταιριάζει.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Επιλέξτε έναν τύπο οδηγού εγκατάστασης.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Θα εγκατασταθούν μόνο οι απαραίτητες λειτουργίες. (Απαιτεί τον μικρότερο αποθηκευτικό χώρο στο δίσκο)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Θα εγκατασταθούν όλες οι κύριες λειτουργίες. Συνιστάται για τους περισσότερους χρήστες.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Θα εγκατασταθούν όλες οι λειτουργίες του προγράμματος. (Απαιτεί τον μεγαλύτερο αποθηκευτικό χώρο στο δίσκο)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Επιλέξτε ποια χαρακτηριστικά του προγράμματος θέλετε να εγκαταστήσετε και τη θέση εγκατάστασης. Συνιστάται για προχωρημένους χρήστες.\"\n!endif \n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Τύπος απεγκατάστασης\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Επιλέξτε τον τύπο απεγκατάστασης που σας ταιριάζει.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Επιλέξτε έναν τύπο απεγκατάστασης.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Θα διατηρηθούν μόνο οι κύριες λειτουργίες.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Θα διατηρηθούν μόνο οι σημαντικότερες λειτουργίες.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Θα διατηρηθεί το σύνολο του προγράμματος.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Επιλέξτε ποια χαρακτηριστικά του προγράμματος θέλετε να καταργήσετε.\"\n!endif \n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Ελάχιστη\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Τυπική\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Πλήρης\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Προσαρμοσμένη από το χρήστη\"\n!endif \n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Λάβετε υπόψη τις πληροφορίες για την εγκατάσταση του $(^NameDA).\"\n!endif \n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Λάβετε υπόψη τις πληροφορίες για την απεγκατάσταση του $(^NameDA).\"\n!endif \n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Πληροφορία\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Πληροφορίες για το $(^NameDA).\"\n!endif \n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Επιλέξτε πρόσθετες ενέργειες που πρέπει να πραγματοποιήσει ο οδηγός εγκατάστασης κατά τη διάρκεια της εγκατάστασης του $(^NameDA). $_CLICK\"\n!endif \n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Επιλέξτε πρόσθετες ενέργειες που πρέπει να πραγματοποιήσει ο οδηγός απεγκατάστασης κατά τη διάρκεια της κατάργησης του $(^NameDA). $_CLICK\"\n!endif \n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Πρόσθετες ενέργειες\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Ποιες πρόσθετες ενέργειες πρέπει να πραγματοποιηθούν;\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Πρόσθετα εικονίδια:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Δημιουργία εικονιδίου στην επιφάνεια εργασίας\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Δημιουργία εικονιδίου στη γραμμή γρήγορης εκκίνησης\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Παράμετροι για προχωρημένους:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Εκκίνηση του $(^NameDA) μετά από έναρξη του συστήματος\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Συντομεύσεις αρχείων:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Συντόμευση του $(^NameDA) με \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" Τύπος αρχείου\"\n!endif \n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Οι συντομεύσεις πρέπει να δημιουργηθούν για:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Όλους τους χρήστες\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Μόνο για τον τρέχοντα χρήστη\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Ενημέρωση\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Ενημέρωση μιας προηγούμενης έκδοσης του προγράμματος.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Καλωσορίσατε στον βοηθό ενημέρωσης $(^NameDA).$\\r$\\nΑυτό το πρόγραμμα ενημερώνει την έκδοση $OLDVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Ενημέρωση\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Ενημέρωση όλων των ήδη εγκατεστημένων στοιχείων του $(^NameDA) με την έκδοση $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Αφαίρεση\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Απεγκατάσταση του έκδοση $OLDVERSION από τον υπολογιστή σας.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Συνέχεια με τον οδηγό εγκατάστασης\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Συνέχεια με τον οδηγό εγκατάστασης όπως συνήθως. Χρησιμοποιήστε αυτή την επιλογή αν η νέα έκδοση πρέπει να εγκατασταθεί σε ένα νέο φάκελο, παράλληλα με την ήδη υπάρχουσα έκδοση.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Διαχείριση\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Τροποποίηση, επιδιόρθωση ή αφαίρεση του προγράμματος.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Καλωσορίσατε στο πρόγραμμα διαχείρισης $(^NameDA).$\\r$\\nΜε αυτό το πρόγραμμα μπορείτε να τροποποιήσετε την τρέχουσα εγκατάσταση.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Τροποποίηση\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Επιλέξτε νέα στοιχεία για να τα εγκαταστήσετε, ή επιλέξτε ήδη υπάρχοντα για να τα καταργήσετε.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Επιδιόρθωση\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Επανεγκατάσταση όλων των ήδη εγκατεστημένων στοιχείων του $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Αφαίρεση\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Απεγκατάσταση του $(^NameDA) από τον υπολογιστή σας.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Συνέχεια με τον οδηγό εγκατάστασης\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Συνέχεια με τον οδηγό εγκατάστασης όπως συνήθως. Χρησιμοποιήστε αυτή την επιλογή αν θέλετε να εγκαταστήσετε το πρόγραμμα πάνω σε μια ήδη υπάρχουσα εγκατάσταση ή να εκτελέσετε μια νέα εγκατάσταση σε μια νέα διεύθυνση.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Ο οδηγός εγκατάστασης χρειάζεται τον επόμενο δίσκο για να συνεχίσει.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"αρχείο για να συνεχίσει.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Ο οδηγός εγκατάστασης χρειάζεται τον επόμενο δίσκο για να συνεχίσει.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Επιλέξτε την τοποθεσία αποθήκευσης του αρχείου\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"για να συνεχίσετε.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Εισαγάγετε τη\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"διαδρομή:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Hebrew.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Hindi.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Hungarian.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Hungarian (1038) - Based on NSIS Official Hungarian Language\n;By Tom Evin (evin@mailbox.hu)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Üdvözli a(z) $(^NameDA) Telepítõ Varázsló\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"A(z) $(^NameDA) telepítése elõtt, válasszon nyelvet:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Üdvözli a(z) $(^NameDA) Eltávolító Varázsló\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"A(z) $(^NameDA) eltávolítása elõtt, válasszon nyelvet:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Nyelv:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"A varázsló végigvezeti a(z) $(^NameDA) telepítési folyamatán.$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Adja meg a(z) $(^NameDA) sorozatszámát\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Kérem töltse ki a következõ mezõket.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Kérem töltse ki a következõ mezõket. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"A(z) $UMUI_SNTEXT érvénytelen. Ellenõrizze újra a megadott információt.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Név\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Szervezet\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Sorozatszám\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Aktivációs kód\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Jelszó\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"A telepítõ begyûjtötte az információkat és készen áll a(z) $(^NameDA) telepítésére.\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Telepítés megerõsítése\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"A telepítõ készen áll a(z) $(^NameDA) telepítésére.$\\r$\\nHa át akarja nézni vagy módosítani a telepítési beállításokat, kattintson a Vissza gombra. $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"A telepítõ begyûjtötte az információkat és készen áll a(z) $(^NameDA) eltávolítására.\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Eltávolítás megerõsítése\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"A telepítõ készen áll a(z) $(^NameDA) eltávolítására.$\\r$\\nHa át akarja nézni vagy módosítani az eltávolítási beállításokat, kattintson a Vissza gombra. A Tovább gombbal elkezdõdik az eltávolítás.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Aktuális beállítás:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Telepítési hely:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Start menü mappa:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"A következõ összetevõk lesznek telepítve:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"A(z) $(^NameDA) Telepítõ Varázsló befejezõdött\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"A varázsló megszakadt, mielõtt a(z) $(^NameDA) sikeresen telepítésre került volna.$\\r$\\n$\\r$\\nA program késõbbi telepítéséhez, futtassa újra a telepítõt.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nA $(^CloseBtn) gombbal kiléphet a Telepítõ Varázslóból.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"A(z) $(^NameDA) Eltávolítás Varázsló befejezõdött\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"A varázsló megszakadt, mielõtt a(z) $(^NameDA) sikeresen eltávolításra került volna.$\\r$\\n$\\r$\\nA program késõbbi eltávolításához, futtassa újra az eltávolítót.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nA $(^CloseBtn) gombbal kiléphet az Eltávolítás Varázslóból.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Telepítési típus\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Válassza ki a kívánt telepítési típust.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Válasszon egy telepítési típust.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Csak a szükséges szolgáltatások lesznek telepítve. (Kevesebb lemezterület szükséges)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Minden fõ szolgáltatás telepítve lesz. A legtöbb felhasználónak ajánlott.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Minden szolgáltatás telepítve lesz. (A legtöbb lemezterület szükséges)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Kiválasztható mely program szolgáltatások települjenek és hova. Haladó felhasználóknak ajánlott.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Eltávolítási típus\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Válassza ki a kívánt eltávolítási típust.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Válasszon egy eltávolítási típust.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Csak a fõ szolgáltatások maradnak meg.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Csak a szükséges szolgáltatások maradnak meg.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Minden program szolgáltatás el lesz távolítva.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Kiválasztható mely program szolgáltatások kerüljenek eltávolításra.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimális\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Általános\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Teljes\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Egyéni\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Olvassa el a(z) $(^NameDA) telepítésére vonatkozó információkat.\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Olvassa el a(z) $(^NameDA) eltávolítására vonatkozó információkat.\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Információ\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"A(z) $(^NameDA) kapcsolódó információi.\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Válasszon további feladatot, melyet a telepítõ végrehajt a(z) $(^NameDA) telepítése során. $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Válasszon további feladatot, melyet a telepítõ végrehajt a(z) $(^NameDA) eltávolítása során. $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"További feladatok\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Mely további feladatot kell végrehajtani?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"További ikonok:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Asztali ikon létrehozása\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Gyorsindító ikon létrehozása\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"További paraméterek:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"A(z) $(^NameDA) indítása a Windows-al\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Fájl társítása:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"$(^NameDA) társítása a(z) \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" fájltípussal\"\n!endif\n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Parancsikonok létrehozása:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Minden felhasználónak\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Csak az aktuális felhasználónak\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Frissítés\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"A program korábbi verziójának frissítése.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Üdvözli a(z) $(^NameDA) frissítõ varázsló.$\\r$\\nEz a program frissíti a számítógépen található $OLDVERSION verziót.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Frissítés\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"A(z) $(^NameDA) minden, már telepített elemének frissítése $NEWVERSION verzióra.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Eltávolítás\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"A(z) $OLDVERSION verzióra eltávolítása a számítógéprõl.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Telepítés folytatása\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Telepítés folytatása a megszokott módon. Ez az opció akkor ajánlott, ha egy létezõ telepítésre akarja újratelepíteni a programot vagy ezúttal egy másik mappába telepítené.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Karbantartás\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"A program módosítása, javítása vagy eltávolítása.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Üdvözli a(z) $(^NameDA) telepítõ karbantartó programja.$\\r$\\nA programmal módosíthatja az aktuális telepítést.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Módosítás\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Új összetevõk telepíthetõk fel vagy már telepítettek távolíthatók el.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Javítás\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"A(z) $(^NameDA) minden telepített összetevõjének újratelepítése.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Eltávolítás\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"A(z) $(^NameDA) eltávolítása a számítógéprõl.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Telepítés folytatása\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Telepítés folytatása a megszokott módon. Ez az opció akkor ajánlott, ha egy létezõ telepítésre akarja újratelepíteni a programot vagy ezúttal egy másik mappába telepítené.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"A telepítéshez szükséges a(z)\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"fájl a folytatáshoz.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"A telepítéshez szükséges a következõ lemez a folytatáshoz.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Adja meg a fájl elérését\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"a folytatáshoz.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Helyezze be:\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Elérés:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Icelandic.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Indonesian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Irish.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Italian.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Italiano (1040)\n;By Matthias <bodenseematze@users.sourceforge.net> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Benvenuti all'assistente d'installatione di $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Selezionate prima di installare $(^NameDA) una lingua:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Benvenuti all'assistente di disinstallazione di $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Selezionate prima di rimuovere $(^NameDA) una lingua:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Lingua:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Questo assistente la guiderà durante l'installazione di $(^NameDA) .$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Inserite il codice di serie del $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Si prega di compilare le diverse caselle.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Si prega di compilare le diverse caselle. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT non è valido. Si prega di verificare le notificazioni immesse.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Nome\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organizzazione\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"N° di Serie\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Codice di attivazione\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Password\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"L'assistente ha raccolto tutte le informazioni dovute ed è pronto per istallare $(^NameDA) .\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Confermare l'installazione\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"L'assistente è pronto, ad installare $(^NameDA) sul Vs. Computer.$\\r$\\nSe volete verificare o modificare i parametri d'installazione, Cliccare su $(^BackBtn). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"L'assistente è pronto, a rimuovere $(^NameDA) .\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Confermare la disinstallazione\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"L'assistente è pronto, a rimuovere $(^NameDA)  dal Vs. Computer.$\\r$\\nSe volete verificare o modificare i parametri di disinstallazione, Cliccare su $(^BackBtn), Cliccare su $(^NextBtn), se volete dare il via alla disinstallazione.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Configurazione attuale:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"luogo di destinazione:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Cartella dello Start menu:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"I seguenti componenti vengono installati:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"L'assistente d'installazione di $(^NameDA)interrotto !\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"L'assistente è stato interrotto, prima di completare l'installazione di $(^NameDA).$\\r$\\n$\\r$\\nPer installare questo programma in un secondo tempo, riavviate nuovamente l'assistente d'installazione. $\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nCliccare su $(^CloseBtn), per terminare l'assistente d'installazione.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"L'assistente di disinstallazione di $(^NameDA) interrotto !\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"L'assistente è stato interrotto, prima di completare la disinstallazione di $(^NameDA).$\\r$\\n$\\r$\\nPer disinstallare questo programma in un secondo tempo, riavviate nuovamente l'assistente di disinstallazione.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nCliccare su $(^CloseBtn), per terminare l'assistente di disinstallazione.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Tipo di Setup\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Selezionate il tipo di Setup per voi più idoneo.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Selezionate un tipo di Setup.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Vengono installate solo le applicazioni necessarie (richiedono il minor spazio di memoria)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Tutte le applicazioni principali vengono installate. Consigliato per la maggior parte degli utenti .\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Vengono installate tutte le applicazioni del Programma. (richiede il maggior spazio di memoria)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Selezionate quali applicazioni di programma, in quali destinazioni devono essere installati. Consigliato solo per utenti esperti .\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Tipo di disinstallazione\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Selezionate il tipo di disinstallazione per voi più idoneo..\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Selezionate un tipo di disinstallazione.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Vengono mantenute solo le applicazioni principali.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Vengono mantenute solo le applicazioni più importanti.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"viene mantenuto tutto il programma.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Selezionate le applicazioni di programma che volete rimuovere.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minima\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standard\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Completa\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Definizione utente\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Si prega di osservare le indicazioni di installazione di(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Si prega di osservare le indicazioni di disinstallazione di $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Informazioni\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informazione su $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Selezionate le impostazioni supplementari, che durante il processo d'installazione di $(^NameDA) si dovranno applicare. $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Selezionate le impostazioni supplementari, che durante il processo di disinstallazione di $(^NameDA) si dovranno rimuovere. $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Impostazioni supplementari\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Quali impostazioni supplementari devono essere eseguite?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Icone Supplementari:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Genera un icona su Desktop\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Genera un icona sulla barra veloce d'avvio\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Parametri per esperti:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Avvia $(^NameDA) dopo l'avvio del sistema operativo\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Collegamenti file:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Collega $(^NameDA) con \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" Tipo file\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Per chi devono essere generati i collegamenti :\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"per tutti gli utenti\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Solo per l'utente annunciato\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Aggiornamento\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Update di un antecedente versione.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Benvenuti all'assistente d'update di $(^NameDA) .$\\r$\\nQuesto programma effettuerà un Update della versione $OLDVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Aggiornamento\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Update di tutti componenti installati di $(^NameDA) sulla Release $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Rimuovere\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Disinstallare Release $OLDVERSION dal Vs. Computer.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Proseguire Setup\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Proseguire con il Setup come di usuale. Utilizzate questa opzione, se volete installare questa nuova versione su un'altra destinazione alle altre versioni.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Amministrazione\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Modificare, riparare o rimuovere il programma.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Benvenuti al programma d'amministrazione di $(^NameDA) .$\\r$\\nCon questo programma potete modificare le Vs. attuale installazione.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Modificare\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Selezionate i nuovi componenti, da applicare, o selezionate dei componenti già applicati per poterli rimuovere .\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Riparare\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Reinstallazione di tutti i componenti precedentemente installati di $(^NameDA) .\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Rimuovere\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Disinstalla $(^NameDA) dal Vs. Computer.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Proseguire Setup\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Proseguire con il Setup come di usuale. Utilizzate questa opzione, se volete sovrascrivere l'installazione sull'attuale installazione o effettuare una nuova istallazione con altra destinazione.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Il Setup necessita del prossimo supporto dati per poter proseguire.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"File per poter proseguire.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Il Setup necessita del prossimo supporto dati per poter proseguire.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Selezionate la locazione memoria dei dati \"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"per proseguire.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Si prega di inserire il\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Percorso:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Japanese.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Japanese (1041)\n;By Logue <http://logue.be/>\n;modified 2009/06/23\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"$(^NameDA) のセットアップへようこそ\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"$(^NameDA) をインストールする前に言語を選択してください：$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"$(^NameDA) のアンインストールウィザードへようこそ\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"$(^NameDA) をアンインストールする前に言語を選択してください：$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"言語：\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"このウィザードは、 $(^NameDA) をインストールする上でのガイドを行います。$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"$(^NameDA) のシリアルナンバーを入力してください。\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"以下の項目を入力してください。\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"以下の項目を入力してください。$_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXTの値が不正です。お手数ですが入力内容をご確認ください。\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"名前\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"所属\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"シリアルナンバー\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"アクティベーションコード\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"パスワード\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"セットアップは、 $(^NameDA) をインストールする上での必要な情報の収集および、準備が完了しました。\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"インストールの確認\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"セットアップは、あなたのコンピューターへ $(^NameDA) をインストールする準備ができました。$\\r$\\nもしも、インストール設定を変更する必要がある場合は、「戻る」ボタンを押してください。$_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"セットアップは、 $(^NameDA) をアンインストールする上での必要な情報の収集および、準備が完了しました。\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"アンインストールの確認\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"セットアップは、あなたのコンピューターから $(^NameDA) をアンインストールする準備ができました。$\\r$\\nもしも、アンインストール設定を変更する必要がある場合は、「戻る」ボタンを押してください。「次へ」ボタンをクリックするとアンインストールを開始します。\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"現在の設定：\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"インストール先：\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"スタートメニューフォルダ：\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"インストールされるコンポーネント：\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"$(^NameDA) セットアップウィザードの中断\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"ウィザードは、 $(^NameDA) のインストール作業を中断しました。$\\r$\\n$\\r$\\nこのプログラムをインストールするためには、あとでセットアップを再実行する必要があります。$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\n「$(^CloseBtn)」ボタンを押すとセットアップウィザードを終了します。\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"$(^NameDA) アンインストールウィザードの中断\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"ウィザードは、 $(^NameDA) のアンインストール作業を中断しました。$\\r$\\n$\\r$\\nこのプログラムをアンインストールするためには、あとでアンインストールを再実行する必要があります。$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\n「$(^CloseBtn)」ボタンを押すとアンインストールウィザードを終了します。\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"セットアップタイプ\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"必要な項目を選択してください。\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"セットアップタイプを選択してください。\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"最低限必要な機能のみ（ディスク消費量が最小限です）\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"メインとなる機能がインストールされます。多くのユーザに推奨されます。\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"すべての機能がインストールされます。（ディスクの消費量が最大です）\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"プログラムに必要な機能を自分で選択できます。上級ユーザ推奨です。\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"アンインストールタイプ\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"アンインストールしたい項目を選択してください。\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"アンインストールタイプを選択してください。\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"メインとなる機能は残ります。\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"必要な機能は残ります。\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"すべてのプログラムをアンインストールします。\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"アンインストールする機能を自分で選択します。\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"最小限\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"一般\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"完全\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"カスタム\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"$(^NameDA) をインストールする上での関連情報をご確認ください。\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"$(^NameDA) をアンインストールする上での関連情報をご確認ください。\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"情報\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"$(^NameDA) の関連情報です。\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"$(^NameDA) のセットアップ作業時に行いたい追加のタスクを選択してください。$_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"$(^NameDA) のアンストール作業時に行いたい追加のタスクを選択してください$_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"追加する作業\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"追加のタスクを選択してください。\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"拡張アイコン：\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"ディスクトップに作成\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"クイック起動に作成\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"拡張パラメーター：\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Windowsのスタートアップ時に実行する $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"ファイルの関連づけ：\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"$(^NameDA) と関連づけるファイルタイプ \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" \"\n!endif\n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"作成するショートカット：\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"すべてのユーザ\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"現在のユーザのみ\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"アップデート\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"前のバージョンのプログラムをアップデートします。\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"$(^NameDA) アップデートウィザードへようこそ。$\\r$\\nこのプログラムは、コンピューターにインストールされている$OLDVERSIONをアップデートします。\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"アップデート\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"インストールされている全ての $(^NameDA) のコンポーネントを$NEWVERSIONにアップデートしています…\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"削除\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"$(^NameDA) をあなたのコンピューターからアンインストールします。\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"セットアップ続行\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"通常通りセットアップを続行してください。このオプションは、新しいバージョンのプログラムにアップデートしたり、別のフォルダにインストールしたい場合使用します。\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"メンテナンス\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"プログラムを変更、修正または削除します。\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"$(^NameDA) セットアップメンテナンスプログラムへようこそ。$\\r$\\nこのプログラムは、現在のインストールを修正することができます。\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"変更\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"新しいコンポーネントを追加したり、インストールされている項目を削除したりすることができます。\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"修復\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"$(^NameDA) のコンポーネントを再インストールします。\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"削除\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"$(^NameDA) をアンインストールします\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"セットアップ続行\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"通常通りセットアップを続行してください。このオプションは、既存のプログラムを再インストールしたり、異なるフォルダにインストールしたい場合使用します。\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"セットアップを続行するには、\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"ファイルが必要です。\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"セットアップを続行するには、次のディスクを挿入してください。\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"続けるには、\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"ファイルを指定してください。\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"のパスを入力してください：\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Korean.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Kurdish.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Latvian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Lithuanian.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Lithuanian (1063)\n;By Matthias <bodenseematze@users.sourceforge.net> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Sveiki, čia diegimo programos pagelbiklis $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Prieš diegdami $(^NameDA), pasirinkite kalbą:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Sveiki, čia šalinimo programos pagelbiklis $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Prieš šalindami $(^NameDA), pasirinkite kalbą:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Kalba:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Šis pagelbiklis padės Jums įdiegti $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Prašome įvesti $(^NameDA) serijos numerį\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Prašome užpildyti įvairius laukelius.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Prašome užpildyti įvairius laukelius. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT netinka. Patikrinkite įvestą informaciją.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Pavadinimas\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organizacija\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Serijos numeris\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Aktyvinimo kodas\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Slaptažodis\"\n!endif \n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Diegimo programa surinko reikiamą informaciją ir yra pasirengusi įdiegti $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Diegimo patvirtinimas\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Diegimo programa pasirengusi $(^NameDA) įdiegti Jūsų kompiuteryje.$\\r$\\nJei dar norėtumėte patikrinti arba pakeisti diegimo nustatymus, spustelėkite $(^BackBtn). $_CLICK\"\n!endif \n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Diegimo programa surinko reikiamą informaciją ir yra pasirengusi pašalinti $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Šalinimo patvirtinimas\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Diegimo programa pasirengusi pašalinti $(^NameDA) iš Jūsų kompiuterio.$\\r$\\nJei dar norėtumėte patikrinti arba pakeisti diegimo nustatymus, spustelėkite $(^BackBtn). Spustelėkite $(^NextBtn), jei norite pradėti šalinimo procesą.\"\n!endif \n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Dabartinė konfigūracija:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Paskirties vieta:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Pradžios meniu aplankas:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Bus įdiegti toliau nurodyti komponentai:\"\n!endif \n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Diegimo programos pagelbiklio $(^NameDA) išjungimas\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Pagelbiklis buvo išjungtas nebaigus iki galo įdiegti $(^NameDA).$\\r$\\n$\\r$\\nJei norėsite programą diegti vėliau, turėsite pagelbiklį įjungti iš naujo.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nNorėdami uždaryti diegimo programos pagelbiklį, spustelėkite $(^CloseBtn).\"\n!endif \n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Programos šalinimo pagelbiklio $(^NameDA) išjungimas\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Pagelbiklis buvo išjungtas nebaigus iki galo pašalinti $(^NameDA).$\\r$\\n$\\r$\\nJei norėsite programą šalinti vėliau, turėsite pagelbiklį įjungti iš naujo.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nNorėdami uždaryti šalinimo programos pagelbiklį, spustelėkite $(^CloseBtn).\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Diegimo programos tipas\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Pasirinkite Jums labiausiai tinkamą diegimo programos tipą.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Pasirinkite diegimo programos tipą.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Bus įdiegtos tik reikiamos funkcijos. (Joms reikia mažiausiai atminties vietos)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Bus įdiegtos visos pagrindinės funkcijos. Dažniausiai rekomenduojama naudotojams.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Bus įdiegtos visos programos funkcijos. (Joms reikia daugiausiai atminties vietos)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Prašome pasirinkti norimas programų funkcijų diegimo vietas. Rekomenduojama pažengusiems naudotojams.\"\n!endif \n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Programos šalinimo tipas\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Pasirinkite Jums labiausiai tinkamą programos šalinimo tipą.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Pasirinkite programos šalinimo tipą.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Nebus pašalintos tik pagrindinės funkcijos.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Nebus pašalintos tik svarbiausios funkcijos.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Bus išsaugota visa programa.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Pasirinkite, kurias programos funkcijas norite pašalinti.\"\n!endif \n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimaliai\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standartiškai\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Visiškai\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Nurodo naudotojas\"\n!endif \n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Prašome atkreipti dėmesį į informaciją apie $(^NameDA) įdiegimą.\"\n!endif \n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Prašome atkreipti dėmesį į informaciją apie $(^NameDA) šalinimą.\"\n!endif \n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Informacija\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informacija apie $(^NameDA).\"\n!endif \n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Pasirinkite papildomus veiksmus, kuriuos diegimo programa turi atlikti diegdama $(^NameDA). $_CLICK\"\n!endif \n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Pasirinkite papildomus veiksmus, kuriuos diegimo programa turi atlikti šalindama $(^NameDA). $_CLICK\"\n!endif \n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Papildomi veiksmai\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Kokie papildomi veiksmai turi būti atlikti?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Papildomos piktogramos:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Sukurti piktogramą darbalaukyje\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Sukurti piktogramą sparčiosios paleisties juostoje\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Papildomi parametrai:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Paleisti $(^NameDA) įsijungus sistemai\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Failų susiejimas:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"$(^NameDA) susieti su \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" Failo tipas\"\n!endif \n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Kam turi būti sukurtos sąsajos:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Visiems naudotojams\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Tik prisiregistravusiems naudotojams\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Naujinimas\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Ankstesnės programos versijos naujinimas.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Sveiki, čia $(^NameDA) naujinimo pagelbiklis.$\\r$\\nŠi programa atnaujins versiją $OLDVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Naujinimas\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Visų $(^NameDA) jau įdiegtų komponentų atnaujinimas, įdiegiant versiją $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Šalinimas\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"versiją $OLDVERSION šalinimas iš Jūsų kompiuterio.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Diegimo programos tęsimas\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Tęskite diegimo programą įprastai. Naudokite šią parinktį, jei naujoji versija turi būti paraleliai įdiegta kitame aplanke, išsaugant esamą versiją.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Tvarkymas\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Programos keitimas, taisymas arba šalinimas.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Sveiki, čia $(^NameDA) tvarkymo programa.$\\r$\\nNaudodami šią programą galite pakeisti esamą įdiegtą programą.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Keitimas\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Pasirinkite naujus komponentus, kuriuos norite įdiegti, arba jau esamus komponentus, kuriuos norite pašalinti.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Taisymas\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Iš naujo įdiegiami visi jau įdiegti $(^NameDA) komponentai.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Šalinimas\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"$(^NameDA) šalinimas iš Jūsų kompiuterio.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Diegimo programos tęsimas\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Tęskite diegimo programą įprastai. Naudokite šią parinktį, jei programą norite diegti vietoje jau įdiegtos programos, arba norite iš naujo įdiegti kitame aplanke.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Diegimo programai reikia toliau nurodytos duomenų laikmenos, kad būtų galima tęsti.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"failo, kad būtų galima tęsti.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Diegimo programai reikia toliau nurodytos duomenų laikmenos, kad būtų galima tęsti.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Pasirinkite failo išsaugojimo vietą,\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"kad būtų galima tęsti.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Prašome nurodyti\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"maršrutą:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Luxembourgish.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Macedonian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Malay.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Mongolian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Norwegian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/NorwegianNynorsk.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Pashto.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Polish.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Polish (1045)\n;By forge\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Witamy w instalatorze $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Przed rozpoczêciem instalacji $(^NameDA), proszê wybraæ jêzyk:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Witamy w deinstalatorze $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Przed rozpoczêciem deinstalacji $(^NameDA), proszê wybraæ jêzyk:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Jêzyk:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Ten przewodnik przeprowadzi Ciê przez proces instalacji $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"WprowadŸ numer seryjny dla $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Proszê wype³nij pola poni¿ej.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Proszê wype³nij pola poni¿ej. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT jest nieprawid³owy. Proszê sprawdŸ wprowadzone informacje.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Nazwa\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organizacja\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Numer Seryjny\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Kod Aktywacyjny\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Has³o\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Instalator zakoñczy³ zbieranie informacji i jest gotowy do instalacji $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"PotwierdŸ chêæ instalacji\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Instalator jest gotowy do instalacji $(^NameDA) na Twoim komputerze.$\\r$\\nJeœli chcesz sprawdziæ lub zmieniæ ustawienia instalatora, kliknij Wstecz. $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Instalator zakoñczy³ zbieranie informacji i jest gotowy do deinstalacji $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"PotwierdŸ chêæ Deinstalacji\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Instalator jest gotowy do deinstalacji $(^NameDA) z Twojego komputera.$\\r$\\nJeœli chcesz sprawdziæ lub zmieniæ ustawienia deinstalatora, kliknij Wstecz. Kliknij Dalej aby rozpocz¹æ deinstalacjê.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Obecna konfiguracja:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Lokalizacja docelowa:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Katalog w Menu Start:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Natêpuj¹ce sk³¹dniki zostan¹ zainstalowane:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Koñczenie instalacji $(^NameDA)\"\n!endif\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Praca instalatora $(^NameDA) zosta³a przerwana przed zakoñczeniem instalcji.$\\r$\\n$\\r$\\nAby póŸnije zainstalowaæ program, proszê uruchomiæ instalator ponownie.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nKliknij $(^CloseBtn) aby opuœciæ instalator.\"\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Koñczenie deinstalacji $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Praca deinstalatora $(^NameDA) zosta³a przerwana przed zakoñczeniem deinstalcji.$\\r$\\n$\\r$\\nAby póŸniej odinstalowaæ program, proszê uruchomiæ deinstaltor ponownie.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nKliknij $(^CloseBtn) aby opuœciæ deinstalator.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Typ instalacji\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Wybierz typ instalacji, który najbardziej odpowiada Twoim potrzebom.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Proszê wybraæ typ instalacji.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Tylko niezbêdne sk³adniki programu zostan¹ zainstalowane. (Wymaga najmniej miejsca na dysku)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Najwa¿niejsze sk³adniki programu zostanê zainstalowane. Sugerowana dla wiekszoœci u¿ytkowników.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Wszystkie sk³adniki programu zostan¹ zainstalowane. (Wymaga najwiecej miejsca na dysku)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Wybierz które sk³¹dniki programu chcesz zainstalowaæ i gdzie maj¹ byæ zainstalowane. Zalecane dla u¿ytkowników zaawansowanych.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Typ deinstalacji\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Wybierz typ deinstalacji, który najbardziej odpowiada Twoim potrzebom.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Proszê wybraæ typ deinstalacji.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Najwa¿niejsze sk³adniki programu zostan¹ zachowane.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Tylko niezbêdne sk³adniki programu zostan¹ zachowane.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Wszystkie sk³adniki programu zostan¹ odinstalowane.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Wybierz które sk³adniki programu chcesz odinstalowaæ.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimalna\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standardowa\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Kompletna\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"U¿ytkownika\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"SprawdŸ informacje dotycz¹ce instalacji programu $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"SprawdŸ informacje dotycz¹ce deinstalacji programu $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Informacje\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informacje dotycz¹ce $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Wybierz dodatkowe zadania, które powinny byæ wykonane podczas procesu instalcji $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Wybierz dodatkowe zadania, które powinny byæ wykonane podczas procesu deinstalcji $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Dodatkowe Zadania\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Które z dodatkowych czynnoœci chcesz wykonaæ?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Dodatkowe ikony:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Utwórz ikone na pulpicie\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Utwórz ikone w pasku szybkiego uruchamiania\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Zaawansowane ustawienia:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Uruchom $(^NameDA) przy starcie systemu windows\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Skojarzenia plików:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Skojarz $(^NameDA) z \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" typem pliku\"\n!endif\n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Jak utworzyæ skróty:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Dla wszystkich u¿ytkowników\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Tylko dla obecnego u¿ytkownika\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Aktualizacja\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Aktualizuj poprzeni¹ wersjê programu.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Witaj w przewodniku aktualizacji $(^NameDA).$\\r$\\nTen program pozwoli Ci zaktualizaowaæ wersjê $OLDVERSION znalezion¹ na Twoim komputerze.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Aktualizuj\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Aktualizuj wszystkie zainstalowne sk³adniki $(^NameDA) do wersji $NEWVERSION..\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Usuñ\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Odinstaluj wersjê $OLDVERSION z Twojego komputera.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Kontynuowanie instalacji\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Kontynuuj normaln¹ instalacje. U¿yj tej opcji aby zainstalowaæ nowasz¹ wersjê w innym katalogu ni¿ dotychczasowa instalacja.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Konserwacja\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Modyfikuj, napraw, lub usuñ program.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Witamy w instalatorze programu $(^NameDA).$\\r$\\nTen program umo¿liwi Ci modyfikacjê obecnej instalacji.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Modyfikuj\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Zaznacz nowe sk³adniki do dodanie lub zaznacz ju¿ zainstalowane aby je usun¹æ.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Napraw\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Reinstaluje wszystkie sk³adniki $(^NameDA), które ju¿ zosta³y zainstalwane.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Usuñ\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Odinstaluj $(^NameDA) z Twojego komputera.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Kontynuowanie instalacji\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Kontynuuj normaln¹ instalacje. U¿yj tej opcji aby przeinstalowaæ Use this option if you want to reinstall this program over an existing install or to install it a new time in a different folder.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Instalator potrzebuje\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"pliku aby kontynuowaæ.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Instaltor potrzebuje kolejnego dysku.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"WprowadŸ lokalizacje pliku\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"aby kontynuowaæ.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Proszê w³ó¿\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Œcie¿ka:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Portuguese.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/PortugueseBR.nsh",
    "content": "﻿;NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Brazilian Portuguese (1046)\n;By Jenner Modesto <jennermodesto@gmail.com>\n;--------------------------------\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"O Assistente terminou de reunir informações e está pronto para instalar $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Confirmar a Instalação\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"O Assistente está pronto para instalar $(^NameDA) em seu computador.$\\r$\\nSe quiser rever ou mudar quaisquer configurações da instalação, clique em Voltar. $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"O Assistente terminou de reunir informações e está pronto para instalar $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Confirmar a desinstalação\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"O Assistente está pronto para desinstalar $(^NameDA) em seu computador.$\\r$\\nSe quiser rever ou mudar quaisquer configurações da desinstalação, clique em Voltar. Clique em Avançar para iniciar a desinstalação.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Configuração atual:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Diretório de instalação:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Menu iniciar:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Terminando o Assistente de Instalação de $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"O Assistente foi interrompido antes que $(^Name) pudesse ser totalmente instalado.$\\r$\\n$\\r$\\nPara instalar esse programa mais tarde, execute o assistente novamente.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nClique em $(^CloseBtn) para sair do Assistente.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Terminando o Assistente de Desinstalação de $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"O Assistente foi interrompido antes que $(^Name) pudesse ser totalmente desinstalado.$\\r$\\n$\\r$\\nPara desinstalar esse programa mais tarde, execute o assistente novamente.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nClique em $(^CloseBtn) para sair do Assistente.\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Romanian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Russian.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Russian (1049)\n;By Matthias <bodenseematze@users.sourceforge.net> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Добро пожаловать в установку $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Выберите, пожалуйста, язык для установки $(^NameDA):$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Добро пожаловать в программу деинсталляции $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Выберите, пожалуйста, язык для деинсталляции $(^NameDA):$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Язык:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Данный ассистент выполнит установку $(^NameDA). $\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Введите серийный номер $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Заполните различные поля.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Заполните различные поля. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT недействительно. Проверьте введенную вами информацию.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Фамилия\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Организация\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Серийный номер\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Код активации\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Пароль\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Необходимая информация для установки $(^NameDA) собрана.\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Подтвердить установку\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Программа-ассистент готова к установке $(^NameDA) на ваш компьютер.$\\r$\\nЕсли требуется проверить или изменить настройки установки, нажмите $(^BackBtn). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Необходимая информация для деинсталляции $(^NameDA) собрана.\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Подтвердить деинсталляцию\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Программа-ассистент готова к деинсталляции $(^NameDA) с вашего компьютера.$\\r$\\nЕсли требуется проверить или изменить настройки деинсталляции, нажмите $(^BackBtn). Нажмите $(^NextBtn), чтобы начать  деинсталляцию.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Актуальная конфигурация:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Место назначения:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Папка начального меню:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Инсталлируются следующие компоненты:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Завершение программы-ассистента деинсталляции $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Программа-ассистент была прервана до полной инсталляции $(^NameDA).$\\r$\\n$\\r$\\nЧтобы впоследствии инсталлировать программу, выполните эту программу установки заново.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nНажмите $(^CloseBtn), чтобы закрыть программу-ассистент инсталляции.\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Выйти из программ-ассистентов деинсталляции для $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Программа-ассистент была прервана до полной деинсталляции $(^NameDA).$\\r$\\n$\\r$\\nЧтобы впоследствии деинсталлировать программу, выполните эту программу установки заново.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nНажмите $(^CloseBtn), чтобы закрыть программу-ассистент деинсталляции.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Тип установки\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Выбор подходящего типа установки\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Выберите тип установки.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Инсталлируются только необходимые функции. (требует минимального объема памяти)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Инсталлируются все основные функции. Рекомендуется для большинства пользователей.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Инсталлируются все программные функции. (требует наибольшего объема памяти)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Выберите, куда и какие программные функции необходимо установить. Рекомендуется для продвинутых пользователей.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Тип деинсталляции\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Выбор подходящего типа деинсталляции\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Выберите тип деинсталляции.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Сохраняются только основные функции.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Инсталлируются только наиболее важные функции.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Сохраняется вся программа.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Выберите программные функции, которые необходимо деинсталлировать.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Минимально\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Стандартно\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Полностью\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Определено пользователем\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Учтите информацию об установке  $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Учтите информацию о деинсталляции $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Информация\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Информация о $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Выберите дополнительные действия, которые программа должна выполнить во время процесса установки  $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Выберите дополнительные действия, которые программа должна выполнить во время процесса деинсталляции $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Дополнительные действия\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Какие дополнительные действия необходимо выполнить?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Дополнительные пиктограммы:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Создайте пиктограмму на рабочем столе\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Создайте пиктограмму на панели быстрого запуска\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Параметры для продвинутого пользователя:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Запустите $(^NameDA) после запуска системы\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Файловые ссылки:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Свяжите $(^NameDA) с \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" Тип файла\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Для кого необходимо создать ссылки:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Для всех пользователей\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Только для зарегистрированных пользователей\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Обновить\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Обновление предыдущей версии программы.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Добро пожаловать в программу-ассистент инсталляции $(^NameDA).Данная$\\r$\\nДанная программа выполнит обновление версии $OLDVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Обновление\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"обновления всех уже инсталлированных компонентов до версии $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Удалить\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Деинсталляция версии $OLDVERSION с компьютера.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Продолжить установку\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Продолжить установку как обычно. Используйте эту опцию, если новая версия должна быть установлена в другой папке параллельно с уже существующей версией.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Настроить\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Изменить, восстановить или удалить программу.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Добро пожаловать в программу-ассистент настройки $(^NameDA).$\\r$\\nПри помощи данной программы можно изменить актуальную установку.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Изменить\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Выберите новые компоненты, чтобы их установить, или уже существующие, чтобы их деинсталлировать.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Восстановить\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Переустановка всех уже существующих компонентов $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Удалить\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Деинсталляция $(^NameDA) с компьютера.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Продолжить установку\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Продолжить установку как обычно. Используйте эту опцию, если хотите инсталлировать программу поверх уже существующей установки или для повторной установки в новом каталоге.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Для установки требуется\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"файлом для продолжения работы.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Для установки требуется следующий носитель данных для продолжения работы.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Выберите место сохранения файла\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"для продолжения работы.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Вставьте новый носитель данных\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"путь:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/ScotsGaelic.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Serbian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/SerbianLatin.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/SimpChinese.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Slovak.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Slovenian.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Slovenian (1060)\n;By Matthias <bodenseematze@users.sourceforge.net> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Dobrodošli v namestitvi $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Izberite jezik za namestitev $(^NameDA):$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Dobrodošli v odstranitvi $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Izberite jezik za odstranitev $(^NameDA):$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Jezik:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Ta asistent vas bo vodil pri namestitvi $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Vnesite serijsko številko za $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Prosimo da izpolnite polja.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Prosimo da izpolnite polja. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT ni veljaven. Prosimo da preverite svoje podatke.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Ime\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organizacija\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Serijska številka\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Aktivacijska koda\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Geslo\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Za namestitev $(^NameDA) zbiram naslednjo informacijo.\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Potrditev namestitve\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Asistent je pripravljen za namestitev $(^NameDA) na računalniku.$\\r$\\nV primeru, da morate preveriti oz. spremeniti namestitvene nastavitve, pritisnite na $(^BackBtn). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Za odstranitev $(^NameDA) zbiram naslednjo informacijo.\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Potrditev odstranitve\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Asistent je pripravljen za odstranitev $(^NameDA) iz računalnika.$\\r$\\nV primeru, da morate preveriti oz. spremeniti namestitvene nastavitve, pritisnite na $(^BackBtn). Kliknite na $(^NextBtn) da začnete odstranitev.\"\n!endif\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Trenutna konfiguracija:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Ciljne mesto:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Imenik za začetni meni:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Nameščene bodo naslednje sestavne dele:\"\n!endif\n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Izhod iz asistenta za odstranitev $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Asistent je bil prekinjen, še preden je bil $(^NameDA) v celoti nameščen.$\\r$\\n$\\r$\\nDa bi program kasneje namestili, nameščanje ponovite.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nDa bi asistenta za namestitev lahko zaprli, pritisnite na $(^CloseBtn).\"\n!endif\n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Izhod iz asistenta za odstranitev $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Asistent je bil prekinjen, še preden je bil $(^NameDA) v celoti odstranjen.$\\r$\\n$\\r$\\nDa bi program kasneje odstranili, odstranjevanje ponovite.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nDa bi asistenta za odstranitev lahko zaprli, pritisnite na $(^CloseBtn).\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Način namestitve\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Izbor ustreznega načina namestitve\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Izberite način namestitve.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Nameščene bodo samo potrebne funkcije. (Zahteva najmanjši pomnilnik)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Nameščene bodo vse glavne funkcije. Priporočeno za večino uporabnikov.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Nameščene bodo vse programske funkcije. (Zahteva največji pomnilnik)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Izberite katero funkcijo programa želite namestiti. Izberite kam naj se katera od funkcij programa namesti.\"\n!endif\n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Način odstranitve\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Izbor ustreznega načina odstranitve\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Izberite način odstranitve.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Se shranijo samo glavne funkcije.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Se shranijo samo najpomembnejše funkcije.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Bode shranjen celoten program.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Izberite katero funkcijo programa želite odstraniti.\"\n!endif\n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimalno\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standardno\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"popolna\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"po meri\"\n!endif\n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Upoštevajte informacije za namestitev $(^NameDA).\"\n!endif\n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Upoštevajte informacije za odstranitev $(^NameDA).\"\n!endif\n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Informacija\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Informacije o $(^NameDA).\"\n!endif\n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Izberite dodatne dejavnosti, ki morajo biti izvedene med namestitvijo $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Izberite dodatne dejavnosti, ki morajo biti izvedene med odstranitvijo $(^NameDA). $_CLICK\"\n!endif\n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Dodatne ukrepe\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Katere dodatne ukrepe je treba izvesti?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Dodatne ikone:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Ustvarjanje ikone na namizju\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Ustvarjanje ikone v orodni vrstici za hitri zagon\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Nadaljevalne parametre:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"$(^NameDA) se bo zagnal po zagonu sistema\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Povezave datoteke:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Povezava $(^NameDA) z \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" Vrsta datoteke\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Povezave je potrebno ustvariti za:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Za vse uporabnike\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Samo za prijavljeni uporabnik\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Aktualizacija\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Posodobitev starejše različice programa.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Dobrodošli v namestitvenem asistentu $(^NameDA).$\\r$\\nTa program opravlja posodabljanje različice $OLDVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Posodabljanje\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Posodobitev vseh nameščenih sestavin do različice $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Odstranitev\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Odstranitev različice $OLDVERSION iz računalnika.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Nadaljevanje namestitve\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Običajno nadaljevanje namestitve Kadar morate novo različico namestiti v drug imenik, ki je vzporeden obstoječemu, priporočamo, da uporabite to možnost.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Prilagoditev\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Sprememba, popravilo ali odstranitev programa.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Dobrodošli v $(^NameDA) prilagoditvenem asistentu.$\\r$\\nS tem programom se trenutna namestitev lahko spremeni.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Spreminjanje\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Izberite nove komponente za namestitev, oz. izberite nameščene obstoječe komponente za odstranitev.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Popravljanje\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Ponovna namestitev vseh nameščenih $(^NameDA) sestavnih delov.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Odstranitev\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Odstranitev $(^NameDA) iz računalnika.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Nadaljevanje namestitve\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Običajno nadaljevanje namestitve Kadar morate novo namestitev shraniti na že obstoječo oz. ko se mora nova namestitev izvesti v drugem imeniku, priporočamo, da uporabite to možnost.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Za namestitev potrebujete\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"Za nadaljevanje datoteke.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Za nadaljevanje namestitve vstavite naslednjo zgoščenko.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Izberite lokacijo datoteke.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"za nadaljevanje.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Prosimo da vstavite disk\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"Pot:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Spanish.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Spanish (1034)\n;By Matthias <bodenseematze@users.sourceforge.net> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Bienvenido al asistente de Setup de $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Por favor, seleccione antes de la instalación de $(^NameDA) un idioma:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Bienvenido al asistente de desinstalación de $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Por favor, seleccione antes de la desinstalación de $(^NameDA) un idioma:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Idioma:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Este asistente lo guiará a través de la instalación de $(^NameDA).$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Por favor, introduzca el número de serie para $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Por favor, complete los diferentes campos.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Por favor, complete los diferentes campos. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT es inválido. Por favor, compruebe su información introducida.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Nombre\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organización\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Número de serie\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Código de activación\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Contraseña\"\n!endif \n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Setup ha reunido la información necesaria y está dispuesto a instalar $(^NameDA).\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Confirmar instalación\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Setup está dispuesto a instalar $(^NameDA) en su ordenador. $\\r$\\nEn caso de que aún desee comprobar o modificar las configuraciones de su instalación haga clic en $(^BackBtn). $_CLICK\"\n!endif \n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Setup ha reunido la información necesaria y está dispuesto a desinstalar $(^NameDA).\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Confirmar desinstalación\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Setup está dispuesto a desinstalar $(^NameDA) de su ordenador. $\\r$\\nEn caso de que aún desee comprobar o modificar las configuraciones de su desinstalación haga clic en $(^BackBtn). Haga clic en $(^NextBtn) para comenzar con la desinstalación.\"\n!endif \n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Configuración actual:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Localización de destino:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Carpeta de menú de inicio:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Se instalan los siguientes componentes:\"\n!endif \n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Finalizar al asistente de Setup $(^NameDA)\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"El asistente ha sido cancelado antes de que $(^NameDA) haya podido ser instalado completamente.$\\r$\\n$\\r$\\nPara instalar el programa en un momento posterior, ejecute por favor nuevamente este Setup.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nHaga clic en $(^CloseBtn), para cerrar el asistente de instalación.\"\n!endif \n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"Finalizar el asistente de desinstalación para $(^NameDA)\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"El asistente ha sido cancelado antes de que $(^NameDA) haya podido ser desinstalado completamente.$\\r$\\n$\\r$\\nPara desinstalar el programa en un momento posterior, ejecute por favor nuevamente este Setup.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nHaga clic en $(^CloseBtn), para cerrar el asistente de desinstalación.\"\n!endif\n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Tipo de Setup\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Seleccione el mejor tipo de Setup para usted.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Seleccione por favor un tipo de Setup.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Solo se instalan las funciones necesarias. (necesita el mínimo espacio de memoria)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Se instalan todas las funciones principales. Recomendado para la mayoría de usuarios.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Se instalan todas las funciones del programa. (necesita el máximo espacio de memoria)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Por favor seleccione qué funcionalidad de programa y donde quiere que sea instalada. Recomendado para usuarios avanzados.\"\n!endif \n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Tipo de desinstalación\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Seleccione el mejor tipo de desinstalación para usted.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Seleccione por favor un tipo de desinstalación\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Solo se mantienen las funciones principales.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Solo se mantienen las funciones más importantes.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Se mantiene todo el programa.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Seleccione qué funcionalidad de programa quiere desinstalar.\"\n!endif \n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Mínima\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Estándar\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Completa\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Definida por el usuario\"\n!endif \n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Por favor observe la información sobre la instalación de $(^NameDA).\"\n!endif \n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Por favor observe la información sobre la desinstalación de $(^NameDA).\"\n!endif \n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Información\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"Información sobre $(^NameDA).\"\n!endif \n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Seleccione acciones adicionales que debe ejecutar el Setup durante el proceso de instalación de $(^NameDA). $_CLICK\"\n!endif \n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Seleccione acciones adicionales que debe ejecutar el Setup durante el proceso de desinstalación de $(^NameDA). $_CLICK\"\n!endif \n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Acciones adicionales\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"¿Qué acciones adicionales tienen que ser ejecutadas?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Iconos adicionales:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Crear un icono en el escritorio\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Crear un icono en la barra de tareas\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Parámetros avanzados:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Iniciar $(^NameDA) tras un inicio de sistema\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Enlace de archivos:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Enlace $(^NameDA) con \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" tipo de archivo\"\n!endif \n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Para quién deben ser creados los enlaces:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Para todos los usuarios\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Solo para el usuario registrado\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Actualización\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Actualización a una versión anterior del programa.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Bienvenido al asistente de actualización $(^NameDA).$\\r$\\nEste programa ejecuta una actualización a la versión $OLDVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Actualización\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"Actualizar todos los componentes ya instalados de $(^NameDA) a la versión $NEWVERSION.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Eliminar\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Desinstalación de la versión $OLDVERSION de su ordenador.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Continuar Setup\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Continuar Setup como habitualmente. Utilice esta opción cuando la nueva versión tiene que ser instalada en otro ordenador paralelamente a la versión existente.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Administración\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Modificar, reparar o eliminar un programa.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Bienvenido al programa de administración $(^NameDA).$\\r$\\nCon este programa puede modificar su instalación actual.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Modificar\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Seleccione componentes nuevos para ser instalados o ya existentes para desinstalarlos.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Reparar\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Reinstalación de todos los componentes $(^NameDA) ya instalados.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Eliminar\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Desinstalación de $(^NameDA) de su ordenador.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Continuar Setup\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Continuar Setup como habitualmente. Utilice esta opción si desea instalar el programa sobre una instalación ya existente o ejecutar una nueva instalación en otro directorio.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Setup necesita el siguiente soporte de datos para poder continuar.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"archivo para poder continuar.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Setup necesita el siguiente soporte de datos para poder continuar.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Seleccione la localización de guardado del archivo\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"para continuar.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Por favor, introduzca la\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"ruta:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/SpanishInternational.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Swedish.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Tatar.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Thai.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/TradChinese.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Turkish.nsh",
    "content": ";NSIS Modern User Interface - Language File\n;Compatible with UltraModernUI 2.0 beta 1\n\n;Language: Turkish (1055)\n;By Matthias <bodenseematze@users.sourceforge.net> (copied from English and translated)\n;--------------------------------\n\n!ifdef UMUI_MULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TITLE \"Kurulum asistanýna $(^NameDA) hoþ geldiniz\"\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_TEXT \"Kurulumdan önce lütfen $(^NameDA) içerisinden bir dil seçin:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TITLE \"Program kaldýrma asistanýna $(^NameDA) hoþ geldiniz\"\n  ${LangFileString} UMUI_UNTEXT_MULTILANGUAGE_TEXT \"Programý kaldýrmadan önce lütfen $(^NameDA) içerisinden bir dil seçin:$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n!ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n  ${LangFileString} UMUI_TEXT_MULTILANGUAGE_LANGUAGE \"Dil:\"\n!endif\n\n\n!ifdef MUI_WELCOMEPAGE\n  ${LangFileString} UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT \"Bu asistan sizi $(^NameDA) ait olan kuruluma götürecektir.$\\r$\\n$\\r$\\n$\\r$\\n$_CLICK\"\n!endif\n\n\n!ifdef UMUI_SERIALNUMBERPAGE | UMUI_UNSERIALNUMBERPAGE\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_TITLE \"Lütfen $(^NameDA) ait olan seri numarasýný girin\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SUBTITLE \"Lütfen deðiþik alanlarý doldurun.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INFO_TEXT \"Lütfen deðiþik alanlarý doldurun. $_CLICK\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT \"$UMUI_SNTEXT geçersiz. Lütfen girilen bilgilerinizi kontrol edin.\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_NAME \"Ýsim\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ORGANIZATION \"Organizasyon\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_SERIALNUMBER \"Seri numarasý\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_ACTIVATIONCODE \"Aktifleþtirme kodu\"\n  ${LangFileString} UMUI_TEXT_SERIALNUMBER_PASSWORD \"Þifre\"\n!endif\n\n\n!ifdef UMUI_CONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_SUBTITLE \"Kurulum gerekli bilgileri topladý ve $(^NameDA) kurulum için hazýr.\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TITLE \"Kurulumu onayla\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXT_TOP \"Kurulum, $(^NameDA) bilgisayarýnýza kurulmak için hazýr.$\\r$\\nEðer kurulum ayarlarýnýzý kontrol etmek veya deðiþtirmek istiyorsanýz, geriye basýn. Kurulumu baþlatmak için devama basýn. $_CLICK\"\n!endif \n\n!ifdef UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_SUBTITLE \"Kurulum gerekli bilgileri topladý ve $(^NameDA) program kaldýrma için hazýr.\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TITLE \"Program kaldýrmayý onayla\"\n  ${LangFileString} UMUI_UNTEXT_INSTCONFIRM_TEXT_TOP \"Setup Kurulum, $(^NameDA) bilgisayarýnýzdan programý kaldýrmak için hazýr.$\\r$\\nEðer program kaldýrma ayarlarýnýzý kontrol etmek veya deðiþtirmek istiyorsanýz, geriye basýn. Program kaldýrma iþlemine baþlamak için devama basýn.\"\n!endif \n\n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE \"Þimdiki konfigürasyon:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION \"Hedef yer:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER \"Baþlangýç menüsü düzenleyicisi:\"\n  ${LangFileString} UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS \"Takip eden bileþenler kuruluyor:\"\n!endif \n\n\n!ifdef UMUI_ABORTPAGE\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TITLE \"Kurulum asistanýnýn $(^NameDA) sonlandýrýlmasý\"\n  ${LangFileString} UMUI_TEXT_ABORT_INFO_TEXT \"Asistan $(^NameDA) komple kurulabilene kadar iptal edildi.$\\r$\\n$\\r$\\nProgramý ileriki bir zamanda kurabilmek için bu kurulumu yeniden yürütün.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nKurulum asistanýný kapatmak için $(^CloseBtn) üzerine basýn.\"\n!endif \n\n!ifdef UMUI_UNABORTPAGE\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TITLE \"$(^NameDA) için program kaldýrma asistanýný sonlandýrýn\"\n  ${LangFileString} UMUI_UNTEXT_ABORT_INFO_TEXT \"Asistan $(^NameDA) komple program kaldýrýlana kadar iptal edildi.$\\r$\\n$\\r$\\nProgramý ileriki bir zamanda kaldýrabilmek için bu kurulumu yeniden yürütün.$\\r$\\n$\\r$\\n$\\r$\\n$\\r$\\nProgram kaldýrma asistanýný kapatmak için $(^CloseBtn) üzerine basýn.\"\n!endif \n\n\n!ifdef UMUI_SETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_TITLE \"Kurulum tipi\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_SUBTITLE \"Sizin için en iyi kurulum tipini seçin.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_INFO_TEXT \"Lütfen bir kurulum tipini seçin.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TEXT \"Sadece gerekli fonksiyonlarýn kurulumu yapýlýr. (en az hafýza yerine ihtiyaç duyar)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TEXT \"Tüm ana fonksiyonlar kurulur. Çoðu kullanýcý için önerilir.\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TEXT \"Tüm program fonksiyonlarý kurulur. (en çok hafýza yerine ihtiyaç duyar)\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TEXT \"Lütfen hangi program fonksiyonelliðini nereye kurmak istediðinizi seçin. Ýleri düzeydeki kullanýcýlara önerilir.\"\n!endif \n\n!ifdef UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_TITLE \"Program kaldýrma tipi\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_SUBTITLE \"Sizin için en iyi program kaldýrma tipini seçin.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_INFO_TEXT \"Lütfen bir program kaldýrma tipini seçin.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_MINIMAL_TEXT \"Sadece ana fonksiyonlar saklý tutulur.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_STANDARD_TEXT \"Sadece en önemli fonksiyonlar saklý tutulur.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_COMPLETE_TEXT \"Tüm program saklý tutulur.\"\n  ${LangFileString} UMUI_UNTEXT_SETUPTYPE_CUSTOM_TEXT \"Lütfen hangi program fonksiyonelliðini kaldýrmak istediðinizi seçin.\"\n!endif \n\n!ifdef UMUI_SETUPTYPEPAGE | UMUI_UNSETUPTYPEPAGE\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE \"Minimum\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_STANDARD_TITLE \"Standart\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE \"Komple\"\n  ${LangFileString} UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE \"Kullanýcý tanýmlý\"\n!endif \n\n\n!ifdef UMUI_INFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_SUBTITLE \"Lütfen $(^NameDA) ait olan kurulum hakkýndaki bilgilere dikkat edin.\"\n!endif \n\n!ifdef UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_UNTEXT_INFORMATION_SUBTITLE \"Lütfen $(^NameDA) ait olan program kaldýrma hakkýndaki bilgilere dikkat edin.\"\n!endif \n\n!ifdef UMUI_INFORMATIONPAGE | UMUI_UNINFORMATIONPAGE\n  ${LangFileString} UMUI_TEXT_INFORMATION_TITLE \"Bilgi\"\n  ${LangFileString} UMUI_TEXT_INFORMATION_INFO_TEXT \"$(^NameDA) hakkýndaki bilgiler.\"\n!endif \n\n\n!ifdef UMUI_ADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_INFO_TEXT \"Kurulumu, $(^NameDA) ait kurulum prosesi sýrasýnda yürütecek olan ilave aksiyonlarý seçin. $_CLICK\"\n!endif \n\n!ifdef UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_UNTEXT_ADDITIONALTASKS_INFO_TEXT \"Kurulumu, $(^NameDA) ait program kaldýrma prosesi sýrasýnda yürütecek olan ilave aksiyonlarý seçin. $_CLICK\"\n!endif \n\n!ifdef UMUI_ADDITIONALTASKSPAGE | UMUI_UNADDITIONALTASKSPAGE\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_TITLE \"Ýlave aksiyonlar\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_SUBTITLE \"Ýlave hangi aksiyonlarýn yürütülmesi gerekiyor?\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS \"Ýlave ikonlar:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON \"Masaüstünde bir ikon oluþtur\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON \"Hýzlý çalýþtýrma satýrýnda bir ikon oluþtur\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS \"Ýlerlemiþ parametreler:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP \"Bir sistem çalýþtýrmasýndan sonra $(^NameDA) baþlat\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION \"Dosya baðlantýlarý:\"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH \"Dosya tipi ile \"\n  ${LangFileString} UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END \" $(^NameDA) baðlantý yap\"\n!endif \n  \n  \n!ifdef UMUI_CONFIRMPAGE | UMUI_UNCONFIRMPAGE | UMUI_ALTERNATIVESTARTMENUPAGE | UMUI_UNALTERNATIVESTARTMENUPAGE\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT \"Baðlantýlar kimin için oluþturulsun:\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS \"Tüm kullanýcýlar için\"\n  ${LangFileString} UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER \"Sadece kayýtlý kullanýcýlar için\"\n!endif\n\n\n!ifdef UMUI_UPDATEPAGE\n  ${LangFileString} UMUI_TEXT_UPDATE_TITLE \"Güncelle\"\n  ${LangFileString} UMUI_TEXT_UPDATE_SUBTITLE \"Programýn daha önceki bir versiyonu için güncelleme.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_INFO_TEXT \"Güncelleme asistanýna $(^NameDA) hoþ geldiniz.$\\r$\\nBu program, bilgisayarýnýzda bulunan $OLDVERSION versiyonunun güncellemesini yapar.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TITLE \"Güncelle\"\n  ${LangFileString} UMUI_TEXT_UPDATE_UPDATE_TEXT \"$NEWVERSION versiyonundaki önceden kurulmuþ bileþenlerin tüm $(^NameDA) güncellemesi..\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TITLE \"Kaldýr\"\n  ${LangFileString} UMUI_TEXT_UPDATE_REMOVE_TEXT \"Bilgisayarýnýzdan $OLDVERSION versiyonunun program kaldýrma.\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TITLE \"Kuruluma devam et\"\n  ${LangFileString} UMUI_TEXT_UPDATE_CONTINUE_TEXT \"Kuruluma önceki gibi devam edin. Bu opsiyonu, eðer daha yeni bir versiyonu, eski versiyondan farklý bir dizine kurmak istiyorsanýz kullanýn.\"\n!endif\n\n\n!ifdef UMUI_MAINTENANCEPAGE | UMUI_UNMAINTENANCEPAGE\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_TITLE \"Yönetim\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_SUBTITLE \"Programýn deðiþtirilmesi, onarýlmasý veya kaldýrýlmasý.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_INFO_TEXT \"Yönetim programýna $(^NameDA) hoþ geldiniz.$\\r$\\nBu program ile güncel kurulumunuzu deðiþtirebilirsiniz.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TITLE \"Deðiþtir\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_MODIFY_TEXT \"Yeni bileþenleri, bunlarý kurmak veya önceden mevcut olanlarýn programýný kaldýrmak için seçin.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TITLE \"Onar\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REPAIR_TEXT \"Önceden kurulumu yapýlmýþ bileþenlerin $(^NameDA) yeniden kurulumu.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TITLE \"Kaldýr\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_REMOVE_TEXT \"Bilgisayarýnýzdan $(^NameDA) program kaldýrma.\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE \"Kuruluma devam et\"\n  ${LangFileString} UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT \"Kuruluma önceki gibi devam edin. Bu opsiyonu, eðer programý mevcut bir kurulum üzerinden kurmak istiyorsanýz veya baþka bir dizinde yeni bir kurulum yürütmek istiyorsanýz kullanýn.\"\n!endif\n\n\n!ifdef UMUI_FILEDISKREQUESTPAGE | UMUI_UNFILEDISKREQUESTPAGE\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN \"Kurulum devam edebilmek için \"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END \"dosyaya ihtiyaç duyuyor.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE \"Kurulum devam edebilmek için bir sonraki veri taþýyýcýsýna gerek duyuyor.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN \"Devam edebilmek için\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_FILE_END \"dosyanýn kaydedileceði hafýza yerini seçin.\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_DISK \"Lütfen\"\n  ${LangFileString} UMUI_TEXT_FILEDISKREQUEST_PATH \"yolu girin:\"\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Ukrainian.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Uzbek.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Vietnamese.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Language files/Welsh.nsh",
    "content": ""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/SoftBlue.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR 3d66ab\n!define /IfNDef MUI_BGCOLOR e8f1f9\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 0000FF\n!define /IfNDef UMUI_HEADERTEXT_COLOR 335182\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 3d66ab\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR FFFFFF\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/SoftBrown.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR ab663d\n!define /IfNDef MUI_BGCOLOR F9F1E8\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FF0000\n!define /IfNDef UMUI_HEADERTEXT_COLOR 825133\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR ab663d\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR FFFFFF\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 800000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/SoftGray.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR 3d66ab\n!define /IfNDef MUI_BGCOLOR F9F9F9\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 0000FF\n!define /IfNDef UMUI_HEADERTEXT_COLOR 335182\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 3d66ab\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR FFFFFF\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGray\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGray\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGray\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGray\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGray\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGray\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGray\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/SoftGreen.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR 3dab66\n!define /IfNDef MUI_BGCOLOR E8F9F1\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 008000\n!define /IfNDef UMUI_HEADERTEXT_COLOR 338251\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 3dab66\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR FFFFFF\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 008000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/SoftPurple.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR 663dab\n!define /IfNDef MUI_BGCOLOR F1E8F9\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 0000FF\n!define /IfNDef UMUI_HEADERTEXT_COLOR 513382\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 663dab\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR FFFFFF\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/SoftRed.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR ab3d66\n!define /IfNDef MUI_BGCOLOR F9E8F1\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FF0000\n!define /IfNDef UMUI_HEADERTEXT_COLOR 823351\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR ab3d66\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR FFFFFF\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 800000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftRed\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftRed\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftRed\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftRed\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftRed\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftRed\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\SoftRed\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/blue.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 4C72B2\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8b8ca4\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR eeeef3\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/blue2.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 4C72B2\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 05376c\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR 9EB3D5\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 404040\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Header2.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Bottom2.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button2.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\PageBG2.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\ScrollBar.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/brown.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR B2724C\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 00FFFF\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR a48c8b\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR f3eeee\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 800000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/brown2.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR B2724C\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 00FFFF\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 6c3705\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR D5B39E\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 404040\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 800000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Header2.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Bottom2.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Button2.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\PageBG2.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\ScrollBar.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\brown\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/darkgreen.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 36744D\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR b5d300\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8ba48c\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR eef3ee\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 008000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/darkgreen2.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 36744D\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR b5d300\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8ba48c\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR eef3ee\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 008000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Header2.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Bottom2.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Button2.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\PageBG2.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\darkgreen\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/gray.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 6D6D6D\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8e8e8e\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR ececec\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 404040\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Button.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\PageBG.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\ScrollBar.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/gray2.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 6D6D6D\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8e8e8e\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR ececec\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 404040\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Header2.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Bottom2.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Button2.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\PageBG2.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\ScrollBar.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\gray\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/green.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 4CB272\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FF00FF\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8ba48c\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR eef3ee\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 008000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/green2.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 4CB272\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FF00FF\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 056c37\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR 9ED5B3\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 404040\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 008000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Header2.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Bottom2.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Button2.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\PageBG2.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\ScrollBar.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\green\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/purple.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 724CB2\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8c8ba4\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR eeeef3\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/purple2.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 724CB2\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 37056c\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR B39ED5\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 404040\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Header2.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Bottom2.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Button2.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\PageBG2.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\ScrollBar.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\purple\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/red.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR B24C72\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 00FFFF\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR a48b8c\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR f3eeee\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 800000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/Skins/red2.nsh",
    "content": "!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR B24C72\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR 00FFFF\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 6c0537\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR D59EB3\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 404040\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 800000\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Header2.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Bottom2.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Button2.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\PageBG2.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\ScrollBar.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\red\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\""
  },
  {
    "path": "setup/nsis/tools/Contrib/UltraModernUI/UMUI.nsh",
    "content": "/*\n\nNSIS Ultra-Modern User Interface version 2.0 beta 5\nCopyright 2005-2019 SuperPat\n\nBased on:\n    NSIS Modern User Interface version 1.81 (Git version: 6b4148e215433dddd1a954291364ef52e44d12e5)\n    Copyright 2002-2019 Joost Verburg\n\n*/\n\n!ifndef MUI_INCLUDED\n!verbose push 3\n!define MUI_INCLUDED\n!define UMUI_SYSVERSION \"2.0 beta 5\"\n!define MUI_SYSVERSION \"1.81\"\n!verbose pop\n!echo \"NSIS Ultra-Modern User Interface version 2.0 beta 5 - Copyright 2005-2019 SuperPat\"\n!echo \"  (Bugfixes and some additions: 2015-2016 - Bodenseematze)\"\n!echo \"Based on: NSIS Modern User Interface version 1.81 - Copyright 2002-2019 Joost Verburg\"\n\n;--------------------------------\n!verbose push 3\n!define /IfNDef MUI_VERBOSE 3\n!verbose ${MUI_VERBOSE}\n\n;--------------------------------\n;HEADER FILES, DECLARATIONS\n\n!include WinMessages.nsh\n!include LogicLib.nsh\n\n!define UMUI_HIDEFIRSTBACKBUTTON    ;don't show the \"Back\" button on the first shown page,\n                                    ;even if it is not the first page defined\nVar MUI_TEMP1\nVar MUI_TEMP2\n\nVar UMUI_INSTALLFLAG                ; Contains a OR of all the flags define here:\n\n;--------------------------------\n;INSTALL FLAGS\n\n;definition of all the install status\n!define UMUI_DEFAULT_STATE   0      ; Default state: Any flag set\n!define UMUI_CANCELLED       1      ; set by (un).onUserAbort function\n!define UMUI_MINIMAL         2      ; set by INSTALLTYPE page\n!define UMUI_STANDARD        4      ; set by INSTALLTYPE page\n!define UMUI_COMPLETE        8      ; set by INSTALLTYPE page\n!define UMUI_CUSTOM          16     ; set by INSTALLTYPE page\n!define UMUI_MODIFY          32     ; set by MAINTENANCE page\n!define UMUI_REPAIR          64     ; set by MAINTENANCE page\n!define UMUI_UPDATE          128    ; set by UPDATE page\n!define UMUI_REMOVE          256    ; set by MAINTENANCE and UPDATE pages\n!define UMUI_CONTINUE_SETUP  512    ; set by MAINTENANCE and UPDATE pages\n!define UMUI_LANGISSET       1024   ; set by UMUI_MULTILANG_GET macro and used by MULTILANGUAGE page\n!define UMUI_SAMEVERSION     2048   ; set by (un).onGuiInit function and used by MANTENANCE and UPDATE pages\n!define UMUI_DIFFVERSION     4096   ; set by (un).onGuiInit function and used by MANTENANCE and UPDATE pages\n!define UMUI_HIDEBACKBUTTON  8192   ; set by (un).onGuiInit function\n!define UMUI_ABORTFIRSTTIME  16384  ; set by (un).onGuiInit function and used by MANTENANCE page\n!define UMUI_COMPONENTSSET   32768  ; set by COMPONENTS page\n\n;--------------------------------\n;INSERT CODE\n\n!macro MUI_INSERT\n\n  !ifndef MUI_INSERT\n    !define MUI_INSERT\n\n    !ifdef MUI_PRODUCT | MUI_VERSION\n      !warning \"The MUI_PRODUCT and MUI_VERSION defines have been removed. Use a normal Name command now.\"\n    !endif\n\n    !insertmacro MUI_INTERFACE\n\n    !insertmacro MUI_FUNCTION_GUIINIT\n    !insertmacro MUI_FUNCTION_ABORTWARNING\n\n    !ifdef MUI_IOCONVERT_USED\n      !insertmacro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT\n    !endif\n\n    !ifdef MUI_UNINSTALLER\n      !insertmacro MUI_UNFUNCTION_GUIINIT\n      !insertmacro MUI_FUNCTION_UNABORTWARNING\n\n      !ifdef MUI_UNIOCONVERT_USED\n        !insertmacro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT\n      !endif\n    !endif\n\n  !endif\n\n!macroend\n\n;--------------------------------\n;GENERAL\n\n!macro MUI_DEFAULT SYMBOL CONTENT\n\n  !define /IfNDef \"${SYMBOL}\" \"${CONTENT}\"\n\n!macroend\n\n!macro MUI_DEFAULT_IOCONVERT SYMBOL CONTENT\n\n  !ifndef \"${SYMBOL}\"\n    !define \"${SYMBOL}\" \"${CONTENT}\"\n    !define /IfNDef \"${SYMBOL}_DEFAULTSET\"\n    !define /IfNDef \"MUI_${MUI_PAGE_UNINSTALLER_PREFIX}IOCONVERT_USED\"\n  !else\n    !insertmacro MUI_UNSET \"${SYMBOL}_DEFAULTSET\"\n  !endif\n\n!macroend\n\n!macro MUI_SET SYMBOL\n\n  !define /IfNDef \"${SYMBOL}\"\n\n!macroend\n\n!macro MUI_UNSET SYMBOL\n\n  !ifdef \"${SYMBOL}\"\n    !undef \"${SYMBOL}\"\n  !endif\n\n!macroend\n\n;--------------------------------\n;INTERFACE - COMPILE TIME SETTINGS\n\n!macro MUI_INTERFACE\n\n  !ifndef MUI_INTERFACE\n    !define MUI_INTERFACE\n\n    !ifdef MUI_INSERT_NSISCONF\n      !insertmacro MUI_NSISCONF\n    !endif\n\n    !ifdef UMUI_USE_BG\n      !define /IfNDef UMUI_BGSKIN ${UMUI_USE_BG}\n      !warning \"Deprecated: The UMUI_USE_BG define was replaced by UMUI_BGSKIN.\"\n    !endif\n\n    !ifdef MUI_LANGDLL_REGISTRY_ROOT | MUI_LANGDLL_REGISTRY_KEY | MUI_LANGDLL_REGISTRY_VALUENAME\n      !warning \"Deprecated: The MUI_LANGDLL_REGISTRY_ROOT, MUI_LANGDLL_REGISTRY_KEY and MUI_LANGDLL_REGISTRY_VALUENAME defines were replaced by UMUI_LANGUAGE_REGISTRY_VALUENAME, UMUI_LANGUAGE_REGISTRY_ROOT, UMUI_LANGUAGE_REGISTRY_KEY or you can use also the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY globals parameters.\"\n    !endif\n\n    !ifdef MUI_LANGDLL_ALWAYSSHOW\n      !warning \"Deprecated: The MUI_LANGDLL_ALWAYSSHOW define was replaced by UMUI_LANGUAGE_ALWAYSSHOW.\"\n      !define /IfNDef UMUI_LANGUAGE_ALWAYSSHOW \"${MUI_LANGDLL_ALWAYSSHOW}\"\n    !endif\n\n    !ifdef UMUI_BGSKIN\n      !include \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\${UMUI_BGSKIN}.nsh\"\n    !endif\n\n    !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n      !ifndef UMUI_LANGUAGE_REGISTRY_ROOT\n        !ifdef UMUI_PARAMS_REGISTRY_ROOT\n          !define UMUI_LANGUAGE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n        !else ifdef MUI_LANGDLL_REGISTRY_ROOT\n          !define UMUI_LANGUAGE_REGISTRY_ROOT \"${MUI_LANGDLL_REGISTRY_ROOT}\"\n        !else\n          !error \"For UMUI_LANGUAGE_REGISTRY_VALUENAME, the UMUI_LANGUAGE_REGISTRY_ROOT & UMUI_LANGUAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n        !endif\n      !endif\n      !ifndef UMUI_LANGUAGE_REGISTRY_KEY\n        !ifdef UMUI_PARAMS_REGISTRY_KEY\n          !define UMUI_LANGUAGE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n        !else ifdef MUI_LANGDLL_REGISTRY_KEY\n          !define UMUI_LANGUAGE_REGISTRY_KEY \"${MUI_LANGDLL_REGISTRY_KEY}\"\n        !else\n          !error \"For UMUI_LANGUAGE_REGISTRY_VALUENAME, the UMUI_LANGUAGE_REGISTRY_ROOT & UMUI_LANGUAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n        !endif\n      !endif\n    !else ifdef MUI_LANGDLL_REGISTRY_VALUENAME\n      !define UMUI_LANGUAGE_REGISTRY_VALUENAME \"${MUI_LANGDLL_REGISTRY_VALUENAME}\"\n    !endif\n\n    !ifndef MUI_TEXTCOLOR\n      !ifdef UMUI_TEXT_COLOR\n        !warning \"Deprecated: The UMUI_TEXT_COLOR define was renamed in MUI_TEXTCOLOR since Ultra-Modern UI 2.0 beta 5\"\n        !define MUI_TEXTCOLOR \"${UMUI_TEXT_COLOR}\"\n      !else ifdef MUI_TEXT_COLOR\n        !warning \"Deprecated: The MUI_TEXT_COLOR define was renamed in MUI_TEXTCOLOR since Ultra-Modern UI 1.00 beta 2\"\n        !define MUI_TEXTCOLOR \"${MUI_TEXT_COLOR}\"\n      !endif\n    !endif\n\n    !ifdef UMUI_UI_COMPONENTSPAGE_SMALLDESC | UMUI_UI_COMPONENTSPAGE_NODESC\n      !warning \"Deprecated: The UMUI_UI_COMPONENTSPAGE_SMALLDESC and UMUI_UI_COMPONENTSPAGE_NODESC define were renamed in MUI_UI_COMPONENTSPAGE_SMALLDESC and MUI_UI_COMPONENTSPAGE_NODESC since Ultra-Modern UI 1.00 beta 2\"\n      !ifdef UMUI_UI_COMPONENTSPAGE_SMALLDESC\n        !define /IfNDef MUI_UI_COMPONENTSPAGE_SMALLDESC \"${UMUI_UI_COMPONENTSPAGE_SMALLDESC}\"\n      !endif\n      !ifdef UMUI_UI_COMPONENTSPAGE_NODESC\n        !define /IfNDef MUI_UI_COMPONENTSPAGE_NODESC \"${UMUI_UI_COMPONENTSPAGE_NODESC}\"\n      !endif\n    !endif\n\n\n!ifndef USE_MUIEx\n;-----------------\n\n    !ifdef UMUI_CUSTOM_SKIN\n      !define /IfNDef UMUI_SKIN \"${UMUI_CUSTOM_SKIN}\"\n      !warning \"Deprecated: The UMUI_CUSTOM_SKIN define is no more necessary and you can simply use the UMUI_SKIN define with your custom skin.\"\n    !endif\n\n    !addincludedir \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\\"\n\n    !ifdef UMUI_SKIN\n      !include \"${UMUI_SKIN}.nsh\"\n    !endif\n\n    !ifdef MUI_UI\n      !warning \"The MUI_UI define have been renamed by UMUI_UI in the UMUI mode in order to assure the compatibility with the former Modern UI scripts. Define Ignored\"\n    !endif\n\n    !ifdef UMUI_HEADERIMAGE_BMP | UMUI_UNHEADERIMAGE_BMP\n      !warning \"Deprecated: The UMUI_HEADERIMAGE_BMP and UMUI_UNHEADERIMAGE_BMP defines were renamed by UMUI_HEADERBGIMAGE_BMP and UMUI_UNHEADERBGIMAGE_BMP since Ultra-Modern UI 1.00 beta 2.\"\n      !ifdef UMUI_HEADERIMAGE_BMP\n        !define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${UMUI_HEADERIMAGE_BMP}\"\n      !endif\n      !ifdef UMUI_UNHEADERIMAGE_BMP\n        !define /IfNDef UMUI_UNHEADERBGIMAGE_BMP \"${UMUI_UNHEADERIMAGE_BMP}\"\n      !endif\n    !endif\n\n    !ifdef MUI_UI_HEADERIMAGE | MUI_UI_HEADERIMAGE_RIGHT | MUI_HEADERIMAGE | MUI_HEADERIMAGE_RIGHT\n      !warning \"The MUI_UI_HEADERIMAGE, MUI_UI_HEADERIMAGE_RIGHT, MUI_HEADERIMAGE and MUI_HEADERIMAGE_RIGHT defines are not currently supported in the UMUI mode.\"\n    !endif\n\n    !ifdef UMUI_UNIQUEBGIMAGE\n      !define /IfNDef UMUI_PAGEBGIMAGE\n    !endif\n    !ifdef UMUI_UNUNIQUEBGIMAGE\n      !define /IfNDef UMUI_UNPAGEBGIMAGE\n    !endif\n\n    !ifndef UMUI_ULTRAMODERN_SMALL\n      !define /IfNDef UMUI_UI \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern.exe\"\n      !define /IfNDef UMUI_UI_SB \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_sb.exe\"\n      !define /IfNDef UMUI_UI_NOLEFTIMAGE \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_noleftimage.exe\"\n    !else\n      !define /IfNDef UMUI_UI_SMALL \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_small.exe\"\n      !define /IfNDef UMUI_UI_SB \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_small_sb.exe\"\n      !define /IfNDef UMUI_USE_SMALLPAGE\n      !ifndef UMUI_UNIQUEBGIMAGE\n        !define /IfNDef UMUI_NO_WFA_BGTRANSPARENT\n      !endif\n    !endif\n\n    !ifndef UMUI_USE_SMALLPAGE\n      !define /IfNDef MUI_UI_COMPONENTSPAGE_SMALLDESC \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_smalldesc.exe\"\n      !define /IfNDef MUI_UI_COMPONENTSPAGE_NODESC \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_nodesc.exe\"\n      !define /IfNDef UMUI_UI_COMPONENTSPAGE_BIGDESC \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_bigdesc.exe\"\n    !else\n      !define /IfNDef MUI_UI_COMPONENTSPAGE_SMALLDESC \"${NSISDIR}\\Contrib\\UIs\\modern_smalldesc.exe\"\n      !define /IfNDef MUI_UI_COMPONENTSPAGE_NODESC \"${NSISDIR}\\Contrib\\UIs\\modern_nodesc.exe\"\n      !define /IfNDef UMUI_UI_COMPONENTSPAGE_BIGDESC \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_bigdesc.exe\"\n    !endif\n\n    !define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n    !define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\"\n\n    !define /IfNDef MUI_BGCOLOR 4C72B2\n    !define /IfNDef MUI_TEXTCOLOR FFFFFF\n    !define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n    !define /IfNDef UMUI_HEADERTEXT_COLOR \"${MUI_TEXTCOLOR}\"\n\n    !define /IfNDef MUI_LICENSEPAGE_BGCOLOR \"/windows\"\n    !define /IfNDef MUI_INSTFILESPAGE_COLORS \"${MUI_TEXTCOLOR} ${MUI_BGCOLOR}\"\n    !define /IfNDef MUI_INSTFILESPAGE_PROGRESSBAR \"smooth\"\n\n    !define /IfNDef UMUI_LEFTIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Left.bmp\"\n    !define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Header.bmp\"\n    !define /IfNDef UMUI_BOTTOMIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Bottom.bmp\"\n    !define /IfNDef UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button.bmp\"\n    !define /IfNDef UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\ScrollBar.bmp\"\n    !define /IfNDef UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\PageBG.bmp\"\n\n    !define /IfNDef UMUI_UNLEFTIMAGE_BMP \"${UMUI_LEFTIMAGE_BMP}\"\n    !define /IfNDef UMUI_UNHEADERBGIMAGE_BMP \"${UMUI_HEADERBGIMAGE_BMP}\"\n    !define /IfNDef UMUI_UNBOTTOMIMAGE_BMP \"${UMUI_BOTTOMIMAGE_BMP}\"\n    !define /IfNDef UMUI_UNBUTTONIMAGE_BMP \"${UMUI_BUTTONIMAGE_BMP}\"\n    !define /IfNDef UMUI_UNSCROLLBARIMAGE_BMP \"${UMUI_SCROLLBARIMAGE_BMP}\"\n    !define /IfNDef UMUI_UNPAGEBGIMAGE_BMP \"${UMUI_PAGEBGIMAGE_BMP}\"\n\n    !define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8b8ca4\n    !define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR eeeef3\n\n    !define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Wizard.bmp\"\n    !define /IfNDef MUI_UNWELCOMEFINISHPAGE_BITMAP \"${MUI_WELCOMEFINISHPAGE_BITMAP}\"\n\n    !define /IfNDef UMUI_XPSTYLE Off\n\n    !ifndef UMUI_ULTRAMODERN_SMALL\n\n      ChangeUI all \"${UMUI_UI}\"\n\n      !ifdef UMUI_NOLEFTIMAGE\n        !insertmacro MUI_UNSET UMUI_LEFTIMAGE_BMP\n        !insertmacro MUI_UNSET UMUI_UNLEFTIMAGE_BMP\n          ChangeUI IDD_INST \"${UMUI_UI_NOLEFTIMAGE}\"\n      !endif\n\n    !else\n\n      !define /IfNDef UMUI_USE_SMALL_PAGES\n      ChangeUI all \"${UMUI_UI_SMALL}\"\n\n    !endif\n\n    !ifdef UMUI_NOHEADERBGIMAGE\n      !insertmacro MUI_UNSET UMUI_HEADERBGIMAGE\n    !else\n      !define /IfNDef UMUI_HEADERBGIMAGE\n    !endif\n\n    !ifdef UMUI_HEADERBGIMAGE\n      !define /IfNDef MUI_HEADER_TRANSPARENT_TEXT\n    !endif\n\n    !ifdef UMUI_NOBOTTOMIMAGE\n      !insertmacro MUI_UNSET UMUI_BOTTOMIMAGE_BMP\n      !insertmacro MUI_UNSET UMUI_UNBOTTOMIMAGE_BMP\n    !endif\n\n    !ifdef UMUI_NO_BUTTONIMAGE\n      !insertmacro MUI_UNSET UMUI_BUTTONIMAGE_BMP\n      !insertmacro MUI_UNSET UMUI_UNBUTTONIMAGE_BMP\n    !endif\n\n    !ifdef UMUI_NO_SCROLLBARIMAGE\n      !insertmacro MUI_UNSET UMUI_SCROLLBARIMAGE_BMP\n      !insertmacro MUI_UNSET UMUI_UNSCROLLBARIMAGE_BMP\n    !endif\n\n!else\n;-------\n\n    !ifdef UMUI_SKIN\n      !warning \"The UMUI_SKIN define is not used in Modern UIEx. Define ignored.\"\n      !undef UMUI_SKIN\n    !endif\n    !insertmacro MUI_UNSET UMUI_PAGEBGIMAGE\n    !insertmacro MUI_UNSET UMUI_UNPAGEBGIMAGE\n    !insertmacro MUI_UNSET UMUI_UNIQUEBGIMAGE\n    !insertmacro MUI_UNSET UMUI_UNUNIQUEBGIMAGE\n\n    ; by default, UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE is set\n    !ifndef UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE\n      !define /IfNDef UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n    !else\n      !insertmacro MUI_UNSET UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n    !endif\n\n    !define /IfNDef MUI_UI \"${NSISDIR}\\Contrib\\UIs\\modern.exe\"\n    !define /IfNDef UMUI_UI_SB \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_sb.exe\"\n    !define /IfNDef MUI_UI_HEADERIMAGE \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe\"\n    !define /IfNDef MUI_UI_HEADERIMAGE_RIGHT \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmpr.exe\"\n    !define /IfNDef UMUI_UI_HEADERBGIMAGE \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_headerbgimage.exe\"\n    !define /IfNDef MUI_UI_COMPONENTSPAGE_SMALLDESC \"${NSISDIR}\\Contrib\\UIs\\modern_smalldesc.exe\"\n    !define /IfNDef MUI_UI_COMPONENTSPAGE_NODESC \"${NSISDIR}\\Contrib\\UIs\\modern_nodesc.exe\"\n    !define /IfNDef UMUI_UI_COMPONENTSPAGE_BIGDESC \"${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_bigdesc.exe\"\n\n    !define /IfNDef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-install.ico\"\n    !define /IfNDef MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-uninstall.ico\"\n\n    !define /IfNDef MUI_LICENSEPAGE_BGCOLOR \"/windows\"\n    !define /IfNDef MUI_INSTFILESPAGE_COLORS \"/windows\"\n    !define /IfNDef MUI_INSTFILESPAGE_PROGRESSBAR \"smooth\"\n\n    !define /IfNDef MUI_BGCOLOR \"FFFFFF\"\n    !define /IfNDef MUI_TEXTCOLOR \"000000\"\n    !define /IfNDef UMUI_TEXT_LIGHTCOLOR \"000000\"\n    !define /IfNDef UMUI_HEADERTEXT_COLOR \"${MUI_TEXTCOLOR}\"\n\n    !define /IfNDef UMUI_HEADERBGIMAGE_BMP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\HeaderBG.bmp\"\n    !define /IfNDef UMUI_UNHEADERBGIMAGE_BMP \"${UMUI_HEADERBGIMAGE_BMP}\"\n    !ifdef UMUI_BUTTONIMAGE_BMP\n      !define /IfNDef UMUI_UNBUTTONIMAGE_BMP \"${UMUI_BUTTONIMAGE_BMP}\"\n    !endif\n    !ifdef UMUI_SCROLLBARIMAGE_BMP\n      !define /IfNDef UMUI_UNSCROLLBARIMAGE_BMP \"${UMUI_SCROLLBARIMAGE_BMP}\"\n    !endif\n\n    !define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n    !define /IfNDef MUI_UNWELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n\n    !ifdef UMUI_BUTTONIMAGE_BMP | UMUI_UNBUTTONIMAGE_BMP\n      !define /IfNDef UMUI_XPSTYLE Off\n    !else\n      !define /IfNDef UMUI_XPSTYLE On\n    !endif\n\n    !if \"${MUI_WELCOMEFINISHPAGE_BITMAP}\" == \"\"\n      !error \"Invalid MUI_WELCOMEFINISHPAGE_BITMAP\"\n    !endif\n    !if \"${MUI_UNWELCOMEFINISHPAGE_BITMAP}\" == \"\"\n      !error \"Invalid MUI_UNWELCOMEFINISHPAGE_BITMAP\"\n    !endif\n\n    !define /IfNDef UMUI_USE_SMALL_PAGES\n\n    !ifdef UMUI_HEADERBGIMAGE\n\n      !define /IfNDef MUI_HEADER_TRANSPARENT_TEXT\n      !insertmacro MUI_UNSET MUI_HEADERIMAGE\n      !insertmacro MUI_UNSET MUI_HEADERIMAGE_RIGHT\n\n    !else ifdef MUI_HEADERIMAGE\n\n      !define /IfNDef MUI_HEADERIMAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp\"\n\n      !ifndef MUI_HEADERIMAGE_UNBITMAP\n        !define MUI_HEADERIMAGE_UNBITMAP \"${MUI_HEADERIMAGE_BITMAP}\"\n        !ifdef MUI_HEADERIMAGE_BITMAP_NOSTRETCH\n          !define /IfNDef MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH\n        !endif\n      !endif\n\n      !if \"${MUI_HEADERIMAGE_BITMAP}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_BITMAP\"\n      !endif\n      !if \"${MUI_HEADERIMAGE_UNBITMAP}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_UNBITMAP\"\n      !endif\n\n      !ifdef MUI_HEADERIMAGE_BITMAP_RTL\n        !ifndef MUI_HEADERIMAGE_UNBITMAP_RTL\n          !define MUI_HEADERIMAGE_UNBITMAP_RTL \"${MUI_HEADERIMAGE_BITMAP_RTL}\"\n          !ifdef MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH\n            !define /IfNDef MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH\n          !endif\n        !endif\n      !endif\n\n      !if \"${MUI_HEADERIMAGE_BITMAP_RTL}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_BITMAP_RTL\"\n      !endif\n      !if \"${MUI_HEADERIMAGE_UNBITMAP_RTL}\" == \"\"\n        !error \"Invalid MUI_HEADERIMAGE_UNBITMAP_RTL\"\n      !endif\n    !endif\n\n    ChangeUI all \"${MUI_UI}\"\n\n    !ifdef UMUI_HEADERBGIMAGE\n      ChangeUI IDD_INST \"${UMUI_UI_HEADERBGIMAGE}\"\n    !else ifdef MUI_HEADERIMAGE\n      !ifndef MUI_HEADERIMAGE_RIGHT\n        ChangeUI IDD_INST \"${MUI_UI_HEADERIMAGE}\"\n      !else\n        ChangeUI IDD_INST \"${MUI_UI_HEADERIMAGE_RIGHT}\"\n      !endif\n    !endif\n\n!endif\n;-------\n\n    !ifdef MUI_COMPONENTSPAGE_SMALLDESC\n      ChangeUI IDD_SELCOM \"${MUI_UI_COMPONENTSPAGE_SMALLDESC}\"\n    !else ifdef MUI_COMPONENTSPAGE_NODESC\n      ChangeUI IDD_SELCOM \"${MUI_UI_COMPONENTSPAGE_NODESC}\"\n    !else ifdef UMUI_COMPONENTSPAGE_BIGDESC\n      ChangeUI IDD_SELCOM \"${UMUI_UI_COMPONENTSPAGE_BIGDESC}\"\n    !endif\n\n    ; Workaround for unstyled detail button\n    !ifdef UMUI_BUTTONIMAGE_BMP | UMUI_UNBUTTONIMAGE_BMP\n      !if ! \"${UMUI_XPSTYLE}\" == \"On\"\n        ChangeUI IDD_INSTFILES \"${UMUI_UI_SB}\"\n      !endif\n    !endif\n\n    !ifdef UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n      !define /IfNDef UMUI_WELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini\"\n      !define /IfNDef UMUI_UNWELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini\"\n      !define /IfNDef UMUI_ALTERNATEWELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini\"\n      !define /IfNDef UMUI_UNALTERNATEWELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini\"\n    !else\n      !define /IfNDef UMUI_WELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini\"\n      !define /IfNDef UMUI_UNWELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini\"\n      !define /IfNDef UMUI_ALTERNATEWELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini\"\n      !define /IfNDef UMUI_UNALTERNATEWELCOMEFINISHABORTPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini\"\n    !endif\n    !define /IfNDef UMUI_MAINTENANCEUPDATESETUPTYPEPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\MaintenanceUpdateSetupType.ini\"\n    !define /IfNDef UMUI_CONFIRMPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\Confirm.ini\"\n    !define /IfNDef UMUI_INFORMATIONPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\Information.ini\"\n    !define /IfNDef UMUI_ADDITIONALTASKSPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AdditionalTasks.ini\"\n    !define /IfNDef UMUI_SERIALNUMBERPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\SerialNumber.ini\"\n    !define /IfNDef UMUI_ALTERNATIVESTARTMENUPAGE_INI \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternativeStartMenu.ini\"\n\n    !define /IfNDef MUI_COMPONENTSPAGE_CHECKBITMAP \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\"\n\n    !define /IfNDef UMUI_TEXT_INPUTCOLOR 000000\n    !define /IfNDef UMUI_BGINPUTCOLOR FFFFFF\n\n    !define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n    !define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n    !define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n\n    !define /IfNDef UMUI_UNDISABLED_BUTTON_TEXT_COLOR \"${UMUI_DISABLED_BUTTON_TEXT_COLOR}\"\n    !define /IfNDef UMUI_UNSELECTED_BUTTON_TEXT_COLOR \"${UMUI_SELECTED_BUTTON_TEXT_COLOR}\"\n    !define /IfNDef UMUI_UNBUTTON_TEXT_COLOR \"${UMUI_BUTTON_TEXT_COLOR}\"\n\n    XPStyle ${UMUI_XPSTYLE}\n\n    !ifdef UMUI_USE_ALTERNATE_PAGE | UMUI_USE_UNALTERNATE_PAGE\n      !define /IfNDef UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE 8\n    !else\n      !define /IfNDef UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE 12\n    !endif\n\n    Icon \"${MUI_ICON}\"\n    UninstallIcon \"${MUI_UNICON}\"\n\n    CheckBitmap \"${MUI_COMPONENTSPAGE_CHECKBITMAP}\"\n    LicenseBkColor \"${MUI_LICENSEPAGE_BGCOLOR}\"\n    InstallColors ${MUI_INSTFILESPAGE_COLORS}\n    InstProgressFlags ${MUI_INSTFILESPAGE_PROGRESSBAR}\n\n    SubCaption 4 \" \"\n    UninstallSubCaption 2 \" \"\n\n    !ifdef UMUI_INSTALLDIR_REGISTRY_VALUENAME\n      !ifndef UMUI_INSTALLDIR_REGISTRY_ROOT\n        !ifdef UMUI_PARAMS_REGISTRY_ROOT\n          !define UMUI_INSTALLDIR_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n        !else\n          !error \"For UMUI_INSTALLDIR_REGISTRY_VALUENAME, the UMUI_INSTALLDIR_REGISTRY_ROOT & UMUI_INSTALLDIR_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n        !endif\n      !endif\n      !ifndef UMUI_INSTALLDIR_REGISTRY_KEY\n        !ifdef UMUI_PARAMS_REGISTRY_KEY\n          !define UMUI_INSTALLDIR_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n        !else\n          !error \"For UMUI_INSTALLDIR_REGISTRY_VALUENAME, the UMUI_INSTALLDIR_REGISTRY_ROOT & UMUI_INSTALLDIR_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n        !endif\n      !endif\n      InstallDirRegKey ${UMUI_INSTALLDIR_REGISTRY_ROOT} \"${UMUI_INSTALLDIR_REGISTRY_KEY}\" \"${UMUI_INSTALLDIR_REGISTRY_VALUENAME}\"\n    !endif\n\n    !define /IfNDef MUI_ABORTWARNING_TEXT \"$(MUI_TEXT_ABORTWARNING)\"\n    !define /IfNDef MUI_UNABORTWARNING_TEXT \"$(MUI_UNTEXT_ABORTWARNING)\"\n\n  !endif\n\n!macroend\n\n\n\n;--------------------------------\n;INTERFACE - RUN-TIME\n\n; Set the background color of the static Pages\n!macro UMUI_PAGEBG_INIT\n!ifndef USE_MUIEx\n;----------------\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  SetCtlColors $MUI_TEMP1 \"${MUI_BGCOLOR}\" \"${MUI_BGCOLOR}\"\n!endif\n;-----\n!macroend\n\n; Set transparent the background of the static Pages\n!macro UMUI_PAGEBGTRANSPARENT_INIT\n!ifndef USE_MUIEx\n;----------------\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    SetCtlColors $MUI_TEMP1 \"transparent\" \"transparent\"\n  !else\n    SetCtlColors $MUI_TEMP1 \"${MUI_BGCOLOR}\" \"${MUI_BGCOLOR}\"\n  !endif\n!endif\n;-----\n!macroend\n\n; Set the background color of the control in a static Pages\n!macro UMUI_PAGECTL_INIT ID\n!ifndef USE_MUIEx\n;-----------------\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${ID}\n  SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n!endif\n;-----\n!macroend\n\n; Set transparent the background of the control in a static Pages\n!macro UMUI_PAGECTLTRANSPARENT_INIT ID\n!ifndef USE_MUIEx\n;-----------------\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${ID}\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"transparent\"\n  !else\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n  !endif\n!endif\n;-----\n!macroend\n\n; Set the background color and the light text color of the control in a static Pages\n!macro UMUI_PAGECTLLIGHT_INIT ID\n!ifndef USE_MUIEx\n;-----------------\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${ID}\n  SetCtlColors $MUI_TEMP1 \"${UMUI_TEXT_LIGHTCOLOR}\" \"${MUI_BGCOLOR}\"\n!endif\n;-----\n!macroend\n\n; Set transparent the background and the light text color of the control in a static Pages\n!macro UMUI_PAGECTLLIGHTTRANSPARENT_INIT ID\n!ifndef USE_MUIEx\n;-----------------\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${ID}\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    SetCtlColors $MUI_TEMP1 \"${UMUI_TEXT_LIGHTCOLOR}\" \"transparent\"\n  !else\n    SetCtlColors $MUI_TEMP1 \"${UMUI_TEXT_LIGHTCOLOR}\" \"${MUI_BGCOLOR}\"\n  !endif\n!endif\n;-----\n!macroend\n\n; Set the background and text colors of the input control in a static Pages\n!macro UMUI_PAGEINPUTCTL_INIT ID\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${ID}\n  SetCtlColors $MUI_TEMP1 \"${UMUI_TEXT_INPUTCOLOR}\" \"${UMUI_BGINPUTCOLOR}\"\n!macroend\n\n; Change the background on the Welcome/Finish/Abort Pages\n!macro UMUI_WFAPAGEBGTRANSPARENT_INIT HWND\n!ifndef USE_MUIEx\n;----------------\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    !ifndef UMUI_NO_WFA_BGTRANSPARENT\n      SetCtlColors ${HWND} \"\" \"transparent\"\n    !else\n      SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n    !endif\n  !else\n    SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n  !endif\n!else\n;-----\n  SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n!endif\n;-----\n!macroend\n\n; Change the background of IO Pages\n!macro UMUI_IOPAGEBGTRANSPARENT_INIT HWND\n!ifndef USE_MUIEx\n;----------------\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    !ifndef UMUI_IONOBGTRANSPARENT\n      SetCtlColors ${HWND} \"\" \"transparent\"\n    !else\n      SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n    !endif\n  !else\n    SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n  !endif\n!endif\n;-----\n  !insertmacro MUI_UNSET UMUI_IONOBGTRANSPARENT\n!macroend\n\n; Change the background of IO Pages\n!macro UMUI_IOPAGEBG_INIT HWND\n!ifndef USE_MUIEx\n;----------------\n  SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n!endif\n;-----\n!macroend\n\n; Change transparent the background of the IO Controls\n!macro UMUI_IOPAGECTLTRANSPARENT_INIT HWND\n!ifndef USE_MUIEx\n;-----------------\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"transparent\"\n  !else\n    SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n  !endif\n!else\n;-----\n  SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n!endif\n;-----\n!macroend\n\n; Change the background color of the IO Controls\n!macro UMUI_IOPAGECTL_INIT HWND\n  SetCtlColors ${HWND} \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n!macroend\n\n; Set the background and text colors of the IO Input Controls\n!macro UMUI_IOPAGEINPUTCTL_INIT HWND\n  SetCtlColors ${HWND} \"${UMUI_TEXT_INPUTCOLOR}\" \"${UMUI_BGINPUTCOLOR}\"\n!macroend\n\n; Set the background color and the light text color of the IO Controls\n!macro UMUI_IOPAGECTLLIGHT_INIT HWND\n  SetCtlColors ${HWND} \"${UMUI_TEXT_LIGHTCOLOR}\" \"${MUI_BGCOLOR}\"\n!macroend\n\n; Set transparent the background and the light text color of the IO Controls\n!macro UMUI_IOPAGECTLLIGHTTRANSPARENT_INIT HWND\n!ifndef USE_MUIEx\n;-----------------\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    SetCtlColors ${HWND} \"${UMUI_TEXT_LIGHTCOLOR}\" \"transparent\"\n  !else\n    SetCtlColors ${HWND} \"${UMUI_TEXT_LIGHTCOLOR}\" \"${MUI_BGCOLOR}\"\n  !endif\n!else\n;-----\n  SetCtlColors ${HWND} \"${UMUI_TEXT_LIGHTCOLOR}\" \"${MUI_BGCOLOR}\"\n!endif\n;-----\n!macroend\n\n!macro MUI_INNERDIALOG_TEXT CONTROL TEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 ${CONTROL}\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_HEADER_TEXT_INTERNAL ID TEXT\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT \"${ID}\"\n\n  !ifndef UMUI_HEADERBGIMAGE\n    !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n      ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    !endif\n  !endif\n\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n\n  !ifndef UMUI_HEADERBGIMAGE\n    !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n      ShowWindow $MUI_TEMP1 ${SW_SHOWNA}\n\n    !endif\n  !endif\n\n!macroend\n\n!macro MUI_HEADER_TEXT TEXT SUBTEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n!ifndef USE_MUIEx\n;-----------------\n\n  !ifndef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}UNIQUEBGIMAGE\n    SetBrandingImage /IMGID=1034 /RESIZETOFIT \"$PLUGINSDIR\\Header.bmp\"\n  !endif\n\n!else\n;-----\n\n  !ifdef UMUI_HEADERBGIMAGE\n    SetBrandingImage /IMGID=1034 /RESIZETOFIT \"$PLUGINSDIR\\Header.bmp\"\n  !endif\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n    LockWindow on\n\n  !endif\n\n!endif\n;-----\n\n  !insertmacro MUI_HEADER_TEXT_INTERNAL 1037 \"${TEXT}\"\n  !insertmacro MUI_HEADER_TEXT_INTERNAL 1038 \"${SUBTEXT}\"\n\n!ifdef USE_MUIEx\n;----------------\n\n  !ifdef MUI_HEADER_TRANSPARENT_TEXT\n\n    LockWindow off\n\n  !endif\n\n!endif\n;-----\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_HEADER_TEXT_PAGE TEXT SUBTEXT\n\n  !ifdef MUI_PAGE_HEADER_TEXT & MUI_PAGE_HEADER_SUBTEXT\n    !insertmacro MUI_HEADER_TEXT \"${MUI_PAGE_HEADER_TEXT}\" \"${MUI_PAGE_HEADER_SUBTEXT}\"\n  !else ifdef MUI_PAGE_HEADER_TEXT\n    !insertmacro MUI_HEADER_TEXT \"${MUI_PAGE_HEADER_TEXT}\" \"${SUBTEXT}\"\n  !else ifdef MUI_PAGE_HEADER_SUBTEXT\n    !insertmacro MUI_HEADER_TEXT \"${TEXT}\" \"${MUI_PAGE_HEADER_SUBTEXT}\"\n  !else\n    !insertmacro MUI_HEADER_TEXT \"${TEXT}\" \"${SUBTEXT}\"\n  !endif\n\n  !insertmacro MUI_UNSET MUI_PAGE_HEADER_TEXT\n  !insertmacro MUI_UNSET MUI_PAGE_HEADER_SUBTEXT\n\n!macroend\n\n!macro MUI_DESCRIPTION_BEGIN\n\n  FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1043\n\n  StrCmp $0 -1 0 mui.description_begin_done\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:\"\n\n!ifndef USE_MUIEx\n;----------------\n    !ifndef UMUI_ENABLE_DESCRIPTION_TEXT\n      EnableWindow $MUI_TEMP1 0\n    !else\n      !insertmacro UMUI_PAGECTLLIGHT_INIT 1043\n;      !insertmacro UMUI_PAGECTLLIGHTTRANSPARENT_INIT 1043\n    !endif\n!else\n;-----\n    EnableWindow $MUI_TEMP1 0\n!endif\n;-----\n\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:$MUI_TEXT\"\n    Goto mui.description_done\n  mui.description_begin_done:\n\n!macroend\n\n!macro MUI_DESCRIPTION_TEXT VAR TEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  StrCmp $0 ${VAR} 0 mui.description_${VAR}_done\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:\"\n\n!ifndef USE_MUIEx\n;----------------\n    !ifndef UMUI_ENABLE_DESCRIPTION_TEXT\n      EnableWindow $MUI_TEMP1 1\n    !else\n      !insertmacro UMUI_PAGECTL_INIT 1043\n;      !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1043\n    !endif\n!else\n;-----\n    EnableWindow $MUI_TEMP1 1\n!endif\n;-----\n\n    SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:${TEXT}\"\n    Goto mui.description_done\n  mui.description_${VAR}_done:\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  mui.description_done:\n\n!ifndef USE_MUIEx\n;----------------\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n\n; Workaround attempt for stransparent component description\n; But all these methods flicker:\n\n; method 1\n;    System::Call \"user32::LockWindowUpdate(i)i ($MUI_TEMP1)\"\n;    System::Call \"user32::InvalidateRect(i,i,i)i ($MUI_TEMP1, 0, 1)\"\n;!define RDW_INVALIDATE 0x0001\n;!define RDW_ERASE 0x0004\n;!define RDW_UPDATENOW 0x0100\n;    System::Call \"user32::RedrawWindow(i,i,i,i)i ($MUI_TEMP1, 0, 0, ${RDW_INVALIDATE}|${RDW_ERASE}|${RDW_UPDATENOW})\"\n;    System::Call \"user32::LockWindowUpdate(i)i (0)\"\n\n; method 2\n;    LockWindow on\n;    LockWindow off\n\n; method 3\n;  FindWindow $MUI_TEMP2 \"#32770\" \"\" $HWNDPARENT\n;  ShowWindow $MUI_TEMP2 ${SW_HIDE}\n;  ShowWindow $MUI_TEMP2 ${SW_SHOW}\n\n  !endif\n!endif\n;-----\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_ENDHEADER\n\n  IfAbort mui.endheader_abort\n\n    !ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT & MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}\" \"${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}\"\n    !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_TEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_FINISHHEADER_TEXT}\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)\"\n    !else ifdef MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)\" \"${MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT}\"\n    !else\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_TITLE)\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_SUBTITLE)\"\n    !endif\n\n  Goto mui.endheader_done\n\n  mui.endheader_abort:\n\n    !ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT & MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}\" \"${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}\"\n    !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_TEXT\n      !insertmacro MUI_HEADER_TEXT \"${MUI_INSTFILESPAGE_ABORTHEADER_TEXT}\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)\"\n    !else ifdef MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)\" \"${MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT}\"\n    !else\n      !insertmacro MUI_HEADER_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_TITLE)\" \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_SUBTITLE)\"\n    !endif\n\n  mui.endheader_done:\n\n!macroend\n\n!macro MUI_ABORTWARNING\n\n  !ifdef MUI_FINISHPAGE_ABORTWARNINGCHECK\n    StrCmp $MUI_NOABORTWARNING \"1\" mui.quit\n  !endif\n\n  !ifdef MUI_ABORTWARNING_CANCEL_DEFAULT\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 \"${MUI_ABORTWARNING_TEXT}\" IDYES mui.quit\n  !else\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION \"${MUI_ABORTWARNING_TEXT}\" IDYES mui.quit\n  !endif\n\n  Abort\n  mui.quit:\n\n!macroend\n\n!macro MUI_UNABORTWARNING\n\n  !ifdef MUI_UNABORTWARNING_CANCEL_DEFAULT\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 \"${MUI_UNABORTWARNING_TEXT}\" IDYES mui.quit\n  !else\n    MessageBox MB_YESNO|MB_ICONEXCLAMATION \"${MUI_UNABORTWARNING_TEXT}\" IDYES mui.quit\n  !endif\n\n  Abort\n  mui.quit:\n\n!macroend\n\n!macro MUI_GUIINIT\n\n  !insertmacro UMUI_WELCOMEFINISHABORTPAGE_INIT \"\"\n\n!ifdef USE_MUIEx\n;----------------\n  !insertmacro MUI_HEADERIMAGE_INIT \"\"\n!endif\n;----------------\n\n  !insertmacro MUI_GUIINIT_BASIC \"\"\n\n  !ifdef MUI_FINISHPAGE\n    !ifndef MUI_FINISHPAGE_NOAUTOCLOSE\n      SetAutoClose true\n    !endif\n  !endif\n\n!macroend\n\n!macro MUI_UNGUIINIT\n\n  !insertmacro UMUI_WELCOMEFINISHABORTPAGE_INIT \"UN\"\n\n!ifdef USE_MUIEx\n;----------------\n  !insertmacro MUI_HEADERIMAGE_INIT \"\"\n!endif\n;----------------\n\n  !insertmacro MUI_GUIINIT_BASIC \"UN\"\n\n  !ifdef MUI_UNFINISHPAGE\n    !ifndef MUI_UNFINISHPAGE_NOAUTOCLOSE\n      SetAutoClose true\n    !endif\n  !endif\n\n!macroend\n\n!macro MUI_GUIINIT_BASIC UNPREFIX\n\n  InitPluginsDir\n\n!ifndef USE_MUIEx\n;-----------------\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n  CreateFont $MUI_TEMP2 \"$(^Font)\" \"$(^FontSize)\" \"700\"\n  SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n  SetCtlColors $MUI_TEMP1 \"${UMUI_HEADERTEXT_COLOR}\" \"transparent\"\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n  SetCtlColors $MUI_TEMP1 \"${UMUI_HEADERTEXT_COLOR}\" \"transparent\"\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n  CreateFont $MUI_TEMP2 Arial 10 1400\n  SetCtlColors $MUI_TEMP1 ${UMUI_BRANDINGTEXTFRONTCOLOR} \"transparent\"\n  SendMessage $MUI_TEMP1 ${WM_SETFONT} \"$MUI_TEMP2\" 0\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:$(^Branding) \"\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n  CreateFont $MUI_TEMP2 Arial 10 1400\n  SetCtlColors $MUI_TEMP1 ${UMUI_BRANDINGTEXTBACKCOLOR} \"transparent\"\n  SendMessage $MUI_TEMP1 ${WM_SETFONT} \"$MUI_TEMP2\" 0\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:$(^Branding) \"\n\n  SetCtlColors $HWNDPARENT \"${MUI_BGCOLOR}\" \"${MUI_BGCOLOR}\"\n\n  !ifndef UMUI_${UNPREFIX}UNIQUEBGIMAGE\n\n    !ifdef UMUI_${UNPREFIX}LEFTIMAGE_BMP\n      ReserveFile \"${UMUI_${UNPREFIX}LEFTIMAGE_BMP}\"\n\n      SetOutPath \"$PLUGINSDIR\"\n      File /oname=LeftImg.bmp \"${UMUI_${UNPREFIX}LEFTIMAGE_BMP}\"\n      SetBrandingImage /IMGID=1302 /RESIZETOFIT \"$PLUGINSDIR\\LeftImg.bmp\"\n    !endif\n\n    !ifdef UMUI_HEADERBGIMAGE\n      ReserveFile \"${UMUI_${UNPREFIX}HEADERBGIMAGE_BMP}\"\n      SetOutPath \"$PLUGINSDIR\"\n      File /oname=Header.bmp \"${UMUI_${UNPREFIX}HEADERBGIMAGE_BMP}\"\n      SetBrandingImage /IMGID=1034 /RESIZETOFIT \"$PLUGINSDIR\\Header.bmp\"\n    !else\n      GetDlgItem $MUI_TEMP1 $HWNDPARENT 1034\n      SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n    !endif\n\n    !ifdef UMUI_${UNPREFIX}BOTTOMIMAGE_BMP\n      ReserveFile \"${UMUI_${UNPREFIX}BOTTOMIMAGE_BMP}\"\n\n      SetOutPath \"$PLUGINSDIR\"\n      File /oname=BtmImg.bmp \"${UMUI_${UNPREFIX}BOTTOMIMAGE_BMP}\"\n      SetBrandingImage /IMGID=1305 /RESIZETOFIT \"$PLUGINSDIR\\BtmImg.bmp\"\n    !endif\n\n    !ifdef UMUI_${UNPREFIX}PAGEBGIMAGE\n      ReserveFile \"${UMUI_${UNPREFIX}PAGEBGIMAGE_BMP}\"\n      SetOutPath \"$PLUGINSDIR\"\n      File /oname=PageBG.bmp \"${UMUI_${UNPREFIX}PAGEBGIMAGE_BMP}\"\n      SetBrandingImage /IMGID=1303 /RESIZETOFIT \"$PLUGINSDIR\\PageBG.bmp\"\n    !else\n      GetDlgItem $MUI_TEMP1 $HWNDPARENT 1303\n      ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    !endif\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1304\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n  !else\n\n    ReserveFile \"${UMUI_${UNPREFIX}PAGEBGIMAGE_BMP}\"\n    SetOutPath \"$PLUGINSDIR\"\n    File /oname=PageBG.bmp \"${UMUI_${UNPREFIX}PAGEBGIMAGE_BMP}\"\n    SetBrandingImage /IMGID=1304 /RESIZETOFIT \"$PLUGINSDIR\\PageBG.bmp\"\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1302\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1303\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1305\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1034\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n  !endif\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1018\n  SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n  ShowWindow $MUI_TEMP1 ${SW_HIDE}\n  SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n!else\n;-----------------\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n  CreateFont $MUI_TEMP2 \"$(^Font)\" \"$(^FontSize)\" \"700\"\n  SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n\n  !ifndef MUI_HEADER_TRANSPARENT_TEXT\n\n    SetCtlColors $MUI_TEMP1 \"${UMUI_HEADERTEXT_COLOR}\" \"${MUI_BGCOLOR}\"\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    SetCtlColors $MUI_TEMP1 \"${UMUI_HEADERTEXT_COLOR}\" \"${MUI_BGCOLOR}\"\n\n  !else\n\n    SetCtlColors $MUI_TEMP1 \"${UMUI_HEADERTEXT_COLOR}\" \"transparent\"\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    SetCtlColors $MUI_TEMP1 \"${UMUI_HEADERTEXT_COLOR}\" \"transparent\"\n\n  !endif\n\n  !ifdef UMUI_HEADERBGIMAGE\n\n    ReserveFile \"${UMUI_${UNPREFIX}HEADERBGIMAGE_BMP}\"\n    SetOutPath \"$PLUGINSDIR\"\n    File /oname=Header.bmp \"${UMUI_${UNPREFIX}HEADERBGIMAGE_BMP}\"\n    SetBrandingImage /IMGID=1034 /RESIZETOFIT \"$PLUGINSDIR\\Header.bmp\"\n\n  !else\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1034 ; Header background\n    SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n  !endif\n\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039 ; Header image\n  SetCtlColors $MUI_TEMP1 \"${MUI_TEXTCOLOR}\" \"${MUI_BGCOLOR}\"\n\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n  SetCtlColors $MUI_TEMP1 /BRANDING\n  GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n  SetCtlColors $MUI_TEMP1 /BRANDING\n  SendMessage $MUI_TEMP1 ${WM_SETTEXT} 0 \"STR:$(^Branding) \"\n\n!endif\n;----------------\n\n\n  !ifdef UMUI_${UNPREFIX}BUTTONIMAGE_BMP | UMUI_${UNPREFIX}SCROLLBARIMAGE_BMP\n    !insertmacro UMUI_RESERVEFILE_SKINNEDCONTROLS\n  !endif\n\n  !ifdef UMUI_${UNPREFIX}BUTTONIMAGE_BMP\n\n    ReserveFile \"${UMUI_${UNPREFIX}BUTTONIMAGE_BMP}\"\n\n    SetOutPath \"$PLUGINSDIR\"\n    File /oname=ButtonImg.bmp \"${UMUI_${UNPREFIX}BUTTONIMAGE_BMP}\"\n\n  !endif\n\n  !ifdef UMUI_${UNPREFIX}SCROLLBARIMAGE_BMP\n\n    ReserveFile \"${UMUI_${UNPREFIX}SCROLLBARIMAGE_BMP}\"\n\n    SetOutPath \"$PLUGINSDIR\"\n    File /oname=ScrollBarImg.bmp \"${UMUI_${UNPREFIX}SCROLLBARIMAGE_BMP}\"\n\n  !endif\n\n  !ifdef UMUI_${UNPREFIX}BUTTONIMAGE_BMP | UMUI_${UNPREFIX}SCROLLBARIMAGE_BMP\n\n    ;starting SkinnedControls plugin\n    !ifdef UMUI_${UNPREFIX}BUTTONIMAGE_BMP & UMUI_${UNPREFIX}SCROLLBARIMAGE_BMP\n      SkinnedControls::skinit \\\n        /disabledtextcolor=${UMUI_${UNPREFIX}DISABLED_BUTTON_TEXT_COLOR} \\\n        /selectedtextcolor=${UMUI_${UNPREFIX}SELECTED_BUTTON_TEXT_COLOR} \\\n        /textcolor=${UMUI_${UNPREFIX}BUTTON_TEXT_COLOR} \\\n        /button=$PLUGINSDIR\\ButtonImg.bmp \\\n        /scrollbar=$PLUGINSDIR\\ScrollBarImg.bmp\n    !else ifdef UMUI_${UNPREFIX}BUTTONIMAGE_BMP\n      SkinnedControls::skinit \\\n        /disabledtextcolor=${UMUI_${UNPREFIX}DISABLED_BUTTON_TEXT_COLOR} \\\n        /selectedtextcolor=${UMUI_${UNPREFIX}SELECTED_BUTTON_TEXT_COLOR} \\\n        /textcolor=${UMUI_${UNPREFIX}BUTTON_TEXT_COLOR} \\\n        /button=$PLUGINSDIR\\ButtonImg.bmp\n    !else\n      SkinnedControls::skinit /scrollbar=$PLUGINSDIR\\ScrollBarImg.bmp\n    !endif\n\n  !endif\n\n   ClearErrors\n\n  ;get parameters in a ini file\n  !insertmacro UMUI_PARAMETERS_TO_INI\n\n  !insertmacro UMUI_RESTORESHELLVARCONTEXT\n\n!macroend\n\n\n!macro UMUI_DELETE_PLUGINDIR\n  SetOutPath $EXEDIR\n  Delete \"$PLUGINSDIR\\*.*\"\n  RMDir /r /REBOOTOK $PLUGINSDIR\n  ClearErrors\n!macroend\n\n\n\n\n; Taken from the NSIS Documentation\n!macro UMUI_GET_PARAMETERS\n\n  !define UMUI_UNIQUEID ${__LINE__}\n\n  Push $R0\n  Push $R1\n  Push $R2\n  Push $R3\n\n  StrCpy $R2 1\n  StrLen $R3 $CMDLINE\n\n  ;Check for quote or space\n  StrCpy $R0 $CMDLINE $R2 ; copy the first char\n  StrCmp $R0 '\"' 0 +3\n    StrCpy $R1 '\"'\n  Goto loop${UMUI_UNIQUEID}\n    StrCpy $R1 \" \"\n\n  loop${UMUI_UNIQUEID}:\n    IntOp $R2 $R2 + 1\n    StrCpy $R0 $CMDLINE 1 $R2\n    StrCmp $R0 $R1 get${UMUI_UNIQUEID} ;found the \" or space char\n      StrCmp $R2 $R3 get${UMUI_UNIQUEID} loop${UMUI_UNIQUEID} ;all the $CMDLINE string was viewed\n\n  get${UMUI_UNIQUEID}:\n    IntOp $R2 $R2 + 1\n    StrCpy $R0 $CMDLINE 1 $R2\n    StrCmp $R0 \" \" get${UMUI_UNIQUEID}\n      StrCpy $R0 $CMDLINE \"\" $R2\n\n  Pop $R3\n  Pop $R2\n  Pop $R1\n  Exch $R0\n\n  !undef UMUI_UNIQUEID\n\n!macroend\n\n\n; Get all parameters in the command line and put it an ini\n;  /S /L=1033 /D=\"C:\\Program Files\\Foo\" para4 para5 \"para 6\"\n!macro UMUI_PARAMETERS_TO_INI\n\n  Push $R0 ;All the parameters\n  Push $R1 ;param counter\n  Push $R2 ;char counter\n  Push $R3 ;parameters string len\n  Push $R4 ;char to compare\n  Push $R5 ; param name\n  Push $R6 ; param value\n\n  IfFileExists \"$PLUGINSDIR\\Parameters.ini\" end 0\n\n  !insertmacro UMUI_GET_PARAMETERS\n  Pop $R0\n\n  StrCpy $R1 0\n\n  ;for each parameters\n  while:\n\n    ;If $R0 empty, goto end\n    StrLen $R3 $R0\n    StrCpy $R2 0\n\n    ;trim the spaces at the begining of the string\n    looptrim:\n      StrCmp $R2 $R3 end ;all the parameters string was viewed\n        StrCpy $R4 $R0 1 $R2\n        StrCmp $R4 \" \" 0 endtrim ;found the space\n          IntOp $R2 $R2 + 1\n          Goto looptrim\n    endtrim:\n\n    StrCpy $R0 $R0 \"\" $R2\n    StrCpy $R2 0\n\n    ;inc num param\n    IntOp $R1 $R1 + 1\n\n    ;If the parameter begin with a \"/\"\n    StrCpy $R4 $R0 1 $R2 ;copy the first char\n\n    StrCpy $R5 \"\" ; name empty\n    StrCpy $R6 \"\" ; value empty\n\n    StrCmp $R4 \"/\" 0 getval\n      IntOp $R2 $R2 - 1\n;      Goto getname\n\n    getname:\n      ;whait for an = or a space\n\n      IntOp $R2 $R2 + 1\n      StrCpy $R4 $R0 1 $R2\n      StrCmp $R4 \"=\" getval1 ;found the =\n        StrCmp $R4 \" \" save ;found the space\n\n          StrCpy $R5 \"$R5$R4\"\n          StrCmp $R2 $R3 save getname ;all the parameters string was viewed\n\n    getval1:\n      IntOp $R2 $R2 + 1\n    getval:\n      StrCpy $R4 $R0 1 $R2\n      StrCmp $R4 '\"' waitquote 0 ;found a quote\n\n        IntOp $R2 $R2 - 1\n\n        waitspace:\n          IntOp $R2 $R2 + 1\n          StrCpy $R4 $R0 1 $R2\n          StrCmp $R4 \" \" save ;found the space\n            StrCpy $R6 \"$R6$R4\"\n            StrCmp $R2 $R3 save waitspace ;all the parameters string was viewed\n\n        waitquote:\n          IntOp $R2 $R2 + 1\n          StrCpy $R4 $R0 1 $R2\n          StrCmp $R4 '\"' save1 ;found the quote\n            StrCpy $R6 \"$R6$R4\"\n            StrCmp $R2 $R3 save1 waitquote ;all the parameters string was viewed\n\n    save1:\n      IntOp $R2 $R2 + 2\n    save:\n      WriteIniStr \"$PLUGINSDIR\\Parameters.ini\" \"Setting\" \"Num\" \"$R1\"\n      WriteIniStr \"$PLUGINSDIR\\Parameters.ini\" \"$R1\" \"Name\" \"$R5\"\n      WriteIniStr \"$PLUGINSDIR\\Parameters.ini\" \"$R1\" \"Value\" \"$R6\"\n\n      StrCmp $R5 \"\" +2 0\n        WriteIniStr \"$PLUGINSDIR\\Parameters.ini\" \"$R5\" \"Value\" \"$R6\"\n        StrCpy $R0 $R0 \"\" $R2\n\n   Goto while\n   end:\n\n   Pop $R6\n   Pop $R5\n   Pop $R4\n   Pop $R3\n   Pop $R2\n   Pop $R1\n   Pop $R0\n\n!macroend\n\n\n!macro UMUI_GETPARAMETERVALUE SWITCH DEFAULT\n\n  Push $R0\n\n  ReadIniStr $R0 \"$PLUGINSDIR\\Parameters.ini\" \"${SWITCH}\" \"Value\"\n  StrCmp $R0 \"\" 0 +3\n    StrCpy $R0 \"${DEFAULT}\"\n    ClearErrors\n\n  Exch $R0\n\n!macroend\n\n!macro UMUI_PARAMETERISSET SWITCH\n\n  Push $R0\n\n  ClearErrors\n  ReadIniStr $R0 \"$PLUGINSDIR\\Parameters.ini\" \"${SWITCH}\" \"Value\"\n\n  ; The error flag is set if error\n  Exch $R0\n\n!macroend\n\n!macro UMUI_GETNUMPARAM\n\n  Push $R0\n\n  ReadIniStr $R0 \"$PLUGINSDIR\\Parameters.ini\" \"Setting\" \"Num\"\n  StrCmp $R0 \"\" 0 +3\n    StrCpy $R0 0\n    ClearErrors\n\n  Exch $R0\n\n!macroend\n\n\n!macro UMUI_ADDPARAMTOSAVETOREGISTRY VALUENAME DATA\n\n  !ifndef UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY\n    !error \"The global parameters: UMUI_PARAMS_REGISTRY_ROOT and UMUI_PARAMS_REGISTRY_KEY are not defined.\"\n  !endif\n\n  !define UMUI_UNIQUEID ${__LINE__}\n\n  Push $R0\n  Push $R1\n  Push $R2\n\n  ClearErrors\n  ReadIniStr $R0 \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"number\"\n  IfErrors 0 +3\n    ClearErrors\n    StrCpy $R0 0\n\n  WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"REGISTRY_ROOT\" \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n  WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"REGISTRY_KEY\" \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\n  StrCmp $R0 0 notfound${UMUI_UNIQUEID} 0\n\n  ;search if not already written in the ini file\n  StrCpy $R1 0\n\n  loop${UMUI_UNIQUEID}:\n    IntOp $R1 $R1 + 1\n    IntCmp $R1 $R0 0 0 notfound${UMUI_UNIQUEID}\n      ReadIniStr $R2 \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Value_Name\"\n      StrCmp $R2 \"${VALUENAME}\" found${UMUI_UNIQUEID} loop${UMUI_UNIQUEID}\n\n  notfound${UMUI_UNIQUEID}:\n    IntOp $R1 $R0 + 1\n\n    WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"number\" $R1\n    WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Value_Name\" \"${VALUENAME}\"\n    WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Data\" \"${DATA}\"\n\n  found${UMUI_UNIQUEID}:\n    WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Data\" \"${DATA}\"\n\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n  !undef UMUI_UNIQUEID\n\n!macroend\n\n!macro UMUI_ADDPARAMTOSAVETOREGISTRYKEY REGISTRY_ROOT REGISTRY_KEY VALUENAME DATA\n\n  !define UMUI_UNIQUEID ${__LINE__}\n\n  Push $R0\n  Push $R1\n  Push $R2\n\n  ClearErrors\n  ReadIniStr $R0 \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"number\"\n  IfErrors 0 noerror${UMUI_UNIQUEID}\n    ClearErrors\n    StrCpy $R0 0\n    Goto notfound${UMUI_UNIQUEID}\n  noerror${UMUI_UNIQUEID}:\n\n  ;search if not already written in the ini file\n  StrCpy $R1 0\n\n  loop${UMUI_UNIQUEID}:\n    IntOp $R1 $R1 + 1\n    IntCmp $R1 $R0 0 0 notfound${UMUI_UNIQUEID}\n      ReadIniStr $R2 \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Value_Name\"\n      StrCmp $R2 \"${VALUENAME}\" found${UMUI_UNIQUEID} loop${UMUI_UNIQUEID}\n\n    notfound${UMUI_UNIQUEID}:\n      IntOp $R1 $R0 + 1\n\n      WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"number\" $R1\n      WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Value_Name\" \"${VALUENAME}\"\n\n    found${UMUI_UNIQUEID}:\n      WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Data\" \"${DATA}\"\n      WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"REGISTRY_ROOT\" \"${REGISTRY_ROOT}\"\n      WriteIniStr \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"REGISTRY_KEY\" \"${REGISTRY_KEY}\"\n\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n  !undef UMUI_UNIQUEID\n\n!macroend\n\n\n!macro UMUI_ADDSHELLVARCONTEXTTOSAVETOREGISTRY\n\n  !ifdef UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME\n    !ifndef UMUI_SHELLVARCONTEXT_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_SHELLVARCONTEXT_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME, the UMUI_SHELLVARCONTEXT_REGISTRY_ROOT & UMUI_SHELLVARCONTEXT_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_SHELLVARCONTEXT_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_SHELLVARCONTEXT_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME, the UMUI_SHELLVARCONTEXT_REGISTRY_ROOT & UMUI_SHELLVARCONTEXT_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    Push $MUI_TEMP1\n    Push $MUI_TEMP2\n\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $MUI_TEMP2\n\n    StrCmp $MUI_TEMP2 \"current\" 0 +3\n      StrCpy $MUI_TEMP1 \"current\"\n    Goto +2\n      StrCpy $MUI_TEMP1 \"all\"\n\n    !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_SHELLVARCONTEXT_REGISTRY_ROOT} \"${UMUI_SHELLVARCONTEXT_REGISTRY_KEY}\" \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\" $MUI_TEMP1\n\n    Pop $MUI_TEMP2\n    Pop $MUI_TEMP1\n\n  !endif\n\n!macroend\n\n\n\n!macro UMUI_SAVEPARAMSTOREGISTRY\n\n  !ifndef MUI_PAGE_UNINSTALLER\n\n    IfAbort install_aborted\n\n      Push $MUI_TEMP1\n      Push $MUI_TEMP2\n      Push $R0\n      Push $R1\n      Push $R2\n      Push $R3\n\n      ClearErrors\n      ReadIniStr $R0 \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"number\"\n      IfErrors end 0\n\n        StrCpy $R1 \"0\"\n        loop:\n\n          IntOp $R1 $R1 + 1\n          IntCmp $R1 $R0 0 0 end\n\n            ReadIniStr $MUI_TEMP1 \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"REGISTRY_ROOT\"\n            ReadIniStr $MUI_TEMP2 \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"REGISTRY_KEY\"\n\n            ClearErrors\n            StrCmp $MUI_TEMP1 \"\" 0 +2\n              ReadIniStr $MUI_TEMP1 \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"REGISTRY_ROOT\"\n            ClearErrors\n            StrCmp $MUI_TEMP2 \"\" 0 +2\n              ReadIniStr $MUI_TEMP2 \"$PLUGINSDIR\\Registry.ini\" \"Settings\" \"REGISTRY_KEY\"\n\n            ReadIniStr $R2 \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Value_Name\"\n            ReadIniStr $R3 \"$PLUGINSDIR\\Registry.ini\" \"$R1\" \"Data\"\n            StrCmp $MUI_TEMP1 HKLM 0 +3\n              WriteRegStr HKLM \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            StrCmp $MUI_TEMP1 HKCU 0 +3\n              WriteRegStr HKCU \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            StrCmp $MUI_TEMP1 SHCTX 0 +3\n              WriteRegStr SHCTX \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            StrCmp $MUI_TEMP1 HKU 0 +3\n              WriteRegStr HKU \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            StrCmp $MUI_TEMP1 HKCR 0 +3\n              WriteRegStr HKCR \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            StrCmp $MUI_TEMP1 HKCC 0 +3\n              WriteRegStr HKCC \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            StrCmp $MUI_TEMP1 HKDD 0 +3\n              WriteRegStr HKDD \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            StrCmp $MUI_TEMP1 HKPD 0 +2\n              WriteRegStr HKPD \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n              Goto loop\n            !if ${NSIS_PACKEDVERSION} >= 0x03002000\n              StrCmp $MUI_TEMP1 HKCR32 0 +2\n                WriteRegStr HKCR32 \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n                Goto loop\n              StrCmp $MUI_TEMP1 HKCR64 0 +2\n                WriteRegStr HKCR64 \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n                Goto loop\n              StrCmp $MUI_TEMP1 HKCU32 0 +2\n                WriteRegStr HKCU32 \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n                Goto loop\n              StrCmp $MUI_TEMP1 HKCU64 0 +2\n                WriteRegStr HKCU64 \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n                Goto loop\n              StrCmp $MUI_TEMP1 HKLM32 0 +2\n                WriteRegStr HKLM32 \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n                Goto loop\n              StrCmp $MUI_TEMP1 HKLM64 0 +2\n                WriteRegStr HKLM64 \"$MUI_TEMP2\" \"$R2\" \"$R3\"\n                Goto loop\n            !endif\n      end:\n      ClearErrors\n\n      Pop $R3\n      Pop $R2\n      Pop $R1\n      Pop $R0\n      Pop $MUI_TEMP2\n      Pop $MUI_TEMP1\n\n    install_aborted:\n\n  !endif\n\n!macroend\n\n!macro UMUI_RESTORESHELLVARCONTEXT\n\n  Push $MUI_TEMP1\n  Push $MUI_TEMP2\n\n  !ifdef UMUI_DEFAULT_SHELLVARCONTEXT\n    StrCpy $MUI_TEMP1 \"${UMUI_DEFAULT_SHELLVARCONTEXT}\"\n  !else\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $MUI_TEMP1 ;current value\n  !endif\n\n  !ifdef UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME\n    !ifndef UMUI_SHELLVARCONTEXT_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_SHELLVARCONTEXT_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME, the UMUI_SHELLVARCONTEXT_REGISTRY_ROOT & UMUI_SHELLVARCONTEXT_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_SHELLVARCONTEXT_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_SHELLVARCONTEXT_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME, the UMUI_SHELLVARCONTEXT_REGISTRY_ROOT & UMUI_SHELLVARCONTEXT_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    ClearErrors\n    ReadRegStr $MUI_TEMP2 ${UMUI_SHELLVARCONTEXT_REGISTRY_ROOT} \"${UMUI_SHELLVARCONTEXT_REGISTRY_KEY}\" \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\"\n    IfErrors +2 0\n      StrCpy $MUI_TEMP1 $MUI_TEMP2\n  !endif\n\n  StrCmp $MUI_TEMP1 all 0 +3\n    SetShellVarContext all\n  Goto +2\n    SetShellVarContext current\n\n  ClearErrors\n\n  Pop $MUI_TEMP2\n  Pop $MUI_TEMP1\n\n!macroend\n\n\n!macro UMUI_GETSHELLVARCONTEXT\n\n  Push $MUI_TEMP1\n  Push $MUI_TEMP2\n\n  StrCpy $MUI_TEMP2 \"$SMPROGRAMS\"\n  SetShellVarContext current\n  StrCmp $MUI_TEMP2 \"$SMPROGRAMS\" 0 +3\n    StrCpy $MUI_TEMP1 \"current\"\n  Goto +3\n    StrCpy $MUI_TEMP1 \"all\"\n    SetShellVarContext all\n\n  Pop $MUI_TEMP2\n  Exch $MUI_TEMP1\n\n!macroend\n\n\n!macro UMUI_RESTOREINSTDIR\n\n  !ifdef UMUI_INSTALLDIR_REGISTRY_VALUENAME\n    !ifndef UMUI_INSTALLDIR_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_INSTALLDIR_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_INSTALLDIR_REGISTRY_VALUENAME, the UMUI_INSTALLDIR_REGISTRY_ROOT & UMUI_INSTALLDIR_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_INSTALLDIR_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_INSTALLDIR_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_INSTALLDIR_REGISTRY_VALUENAME, the UMUI_INSTALLDIR_REGISTRY_ROOT & UMUI_INSTALLDIR_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    Push $R0\n    ClearErrors\n    ReadRegStr $R0 ${UMUI_INSTALLDIR_REGISTRY_ROOT} \"${UMUI_INSTALLDIR_REGISTRY_KEY}\" \"${UMUI_INSTALLDIR_REGISTRY_VALUENAME}\"\n    IfErrors +2 0\n      StrCpy $INSTDIR $R0\n    ClearErrors\n    Pop $R0\n  !endif\n\n!macroend\n\n\n;Based on the StrReplace v4 function of Afrow UK\n;Usage:\n;!insertmacro UMUI_STRREPLACE $Var \"replace\" \"with\" \"in string\"\n!macro UMUI_STRREPLACE Var Replace With In\n\n  !define UMUI_UNIQUEIDSTRREPLACE ${__LINE__}\n\n  Push $R0\n  Push $R3\n  Push $R4\n  Push $R5\n  Push $R6\n  Push $R7\n  Push $R8\n\n  StrCpy $R0 \"${In}\"\n  StrCpy $R3 -1\n  StrLen $R5 $R0\n  StrLen $R6 \"${With}\"\n  StrLen $R7 \"${Replace}\"\n  Loop${UMUI_UNIQUEIDSTRREPLACE}:\n    IntOp $R3 $R3 + 1\n    StrCpy $R4 $R0 $R7 $R3\n    StrCmp $R3 $R5 End${UMUI_UNIQUEIDSTRREPLACE}\n      StrCmp $R4 \"${Replace}\" 0 Loop${UMUI_UNIQUEIDSTRREPLACE}\n\n        StrCpy $R4 $R0 $R3\n        IntOp $R8 $R3 + $R7\n        StrCpy $R8 $R0 \"\" $R8\n        StrCpy $R0 \"$R4${With}$R8\"\n        IntOp $R3 $R3 + $R6\n        IntOp $R3 $R3 - 1\n        IntOp $R5 $R5 - $R7\n        IntOp $R5 $R5 + $R6\n\n        Goto Loop${UMUI_UNIQUEIDSTRREPLACE}\n\n  End${UMUI_UNIQUEIDSTRREPLACE}:\n\n  Pop $R8\n  Pop $R7\n  Pop $R6\n  Pop $R5\n  Pop $R4\n  Pop $R3\n  Exch $R0 #out\n  Pop `${Var}`\n\n  !undef UMUI_UNIQUEIDSTRREPLACE\n\n!macroend\n\n\n\n;Usage:\n;!insertmacro UMUI_STRCOUNT \"string to count\" \"in string to search\"\n;Pop $Var ;the return number\n; \"string to count\" and \"in string to search\" must not be a var betwen $R0 and $R4\n!macro UMUI_STRCOUNT COUNT IN\n\n  !define UMUI_UNIQUEIDSTRCOUNT ${__LINE__}\n\n  Push $R0 ; counter\n  Push $R1 ; the length of the string to count\n  Push $R2 ; the length of the string into search\n  Push $R3 ; char index counter\n  Push $R4 ; string for comparaison\n\n  StrCpy $R0 0\n  StrLen $R1 \"${COUNT}\"\n  StrLen $R2 \"${IN}\"\n  StrCpy $R3 0\n  Loop${UMUI_UNIQUEIDSTRCOUNT}:\n    StrCpy $R4 \"${IN}\" $R1 $R3\n    StrCmp $R3 $R2 End${UMUI_UNIQUEIDSTRCOUNT}\n      IntOp $R3 $R3 + 1 ; incremente counter\n      StrCmp $R4 \"${COUNT}\" 0 Loop${UMUI_UNIQUEIDSTRCOUNT}\n        IntOp $R0 $R0 + 1\n        Goto Loop${UMUI_UNIQUEIDSTRCOUNT}\n  End${UMUI_UNIQUEIDSTRCOUNT}:\n\n  Pop $R4\n  Pop $R3\n  Pop $R2\n  Pop $R1\n  Exch $R0\n\n  !undef UMUI_UNIQUEIDSTRCOUNT\n\n!macroend\n\n\n\n;Based on the VersionCompare v1.0 of Instructor\n;Thanks Afrow UK (Based on his Function \"VersionCheckNew2\")\n;Usage:\n;!insertmacro UMUI_VERSIONCOMPARE VER1 VER2\n;Pop $Var ;the return   0: the same, 1: VER1 is newer, 2: VRE2 is newer\n!macro UMUI_VERSIONCOMPARE VER1 VER2\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !define UMUI_UNIQUEIDVER ${__LINE__}\n\n  Push $0\n  Push $1\n  Push $2\n  Push $3\n  Push $4\n  Push $5\n  Push $6\n  Push $7\n\n  StrCpy $0 \"${VER1}\"\n  StrCpy $1 \"${VER2}\"\n\n  begin${UMUI_UNIQUEIDVER}:\n    StrCpy $2 -1\n    IntOp $2 $2 + 1\n    StrCpy $3 $0 1 $2\n    StrCmp $3 '' +2\n      StrCmp $3 '.' 0 -3\n    StrCpy $4 $0 $2\n    IntOp $2 $2 + 1\n    StrCpy $0 $0 '' $2\n\n    StrCpy $2 -1\n    IntOp $2 $2 + 1\n    StrCpy $3 $1 1 $2\n    StrCmp $3 '' +2\n      StrCmp $3 '.' 0 -3\n    StrCpy $5 $1 $2\n    IntOp $2 $2 + 1\n    StrCpy $1 $1 '' $2\n\n    StrCmp $4$5 '' equal${UMUI_UNIQUEIDVER}\n\n      StrCpy $6 -1\n      IntOp $6 $6 + 1\n      StrCpy $3 $4 1 $6\n      StrCmp $3 '0' -2\n        StrCmp $3 '' 0 +2\n          StrCpy $4 0\n\n        StrCpy $7 -1\n        IntOp $7 $7 + 1\n        StrCpy $3 $5 1 $7\n        StrCmp $3 '0' -2\n          StrCmp $3 '' 0 +2\n            StrCpy $5 0\n\n            StrCmp $4 0 0 +2\n              StrCmp $5 0 begin${UMUI_UNIQUEIDVER} newer2${UMUI_UNIQUEIDVER}\n            StrCmp $5 0 newer1${UMUI_UNIQUEIDVER}\n              IntCmp $6 $7 0 newer1${UMUI_UNIQUEIDVER} newer2${UMUI_UNIQUEIDVER}\n\n                StrCpy $4 '1$4'\n                StrCpy $5 '1$5'\n                IntCmp $4 $5 begin${UMUI_UNIQUEIDVER} newer2${UMUI_UNIQUEIDVER} newer1${UMUI_UNIQUEIDVER}\n\n  equal${UMUI_UNIQUEIDVER}:\n    StrCpy $0 0\n    Goto end${UMUI_UNIQUEIDVER}\n  newer1${UMUI_UNIQUEIDVER}:\n    StrCpy $0 1\n    Goto end${UMUI_UNIQUEIDVER}\n  newer2${UMUI_UNIQUEIDVER}:\n    StrCpy $0 2\n\n  end${UMUI_UNIQUEIDVER}:\n\n  Pop $7\n  Pop $6\n  Pop $5\n  Pop $4\n  Pop $3\n  Pop $2\n  Pop $1\n  Exch $0\n\n  !undef UMUI_UNIQUEIDVER\n\n  !verbose pop\n\n!macroend\n\n\n;Based on the VersionConvert v1.0 of Instructor\n;Thanks Afrow UK (Based on his Function \"CharIndexReplace\")\n;Usage:\n;!insertmacro UMUI_VERSIONCONVERT VER\n;Pop $Var ;get the coverted version\n!macro UMUI_VERSIONCONVERT VER\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !define UMUI_UNIQUEIDVER ${__LINE__}\n\n  Push $0    ; Converted string\n  Push $1    ; Input version\n  Push $2    ; CharactersList\n  Push $3    ; Input String Indices\n  Push $4    ; Char extracted from input\n  Push $5    ; LastCharType\n  Push $6\n  Push $7\n\n  StrCpy $0 \"\"\n\n  StrCpy $1 \"${VER}\"\n\n  StrCpy $2 \"abcdefghijklmnopqrstuvwxyz#\"\n\n  IntOp $3 0 - 1\n\n  StrCpy $5 \"dot\"\n\n  loop${UMUI_UNIQUEIDVER}:\n    IntOp $3 $3 + 1\n\n    StrCpy $4 $1 1 $3\n    StrCmp $4 '' endcheck${UMUI_UNIQUEIDVER}\n      StrCmp $4 '.' dot${UMUI_UNIQUEIDVER}\n        StrCmp $4 '-' dot${UMUI_UNIQUEIDVER}\n          StrCmp $4 '_' dot${UMUI_UNIQUEIDVER}\n            StrCmp $4 ' ' dot${UMUI_UNIQUEIDVER}\n              StrCmp $4 '0' digit${UMUI_UNIQUEIDVER}\n                IntCmp $4 '0' letter${UMUI_UNIQUEIDVER} letter${UMUI_UNIQUEIDVER} digit${UMUI_UNIQUEIDVER}\n\n  dot${UMUI_UNIQUEIDVER}:\n    StrCmp $5 \"dot\" loop${UMUI_UNIQUEIDVER} 0\n      StrCpy $0 \"$0.\"\n      StrCpy $5 \"dot\"\n      Goto loop${UMUI_UNIQUEIDVER}\n\n  digit${UMUI_UNIQUEIDVER}:\n    StrCpy $0 \"$0$4\"\n    StrCpy $5 \"digit\"\n    Goto loop${UMUI_UNIQUEIDVER}\n\n  letter${UMUI_UNIQUEIDVER}:\n    StrCmp $5 \"digit\" 0 +2\n      StrCpy $0 \"$0.\"\n\n    StrCpy $5 \"letter\"\n\n    IntOp $6 0 - 1\n\n    letterloop${UMUI_UNIQUEIDVER}:\n      IntOp $6 $6 + 1\n      StrCpy $7 $2 1 $6\n      StrCmp $7 '#' 0 +3\n        StrCpy $0 \"$099\"\n        Goto loop${UMUI_UNIQUEIDVER}\n\n    StrCmp $4 $7 0 letterloop${UMUI_UNIQUEIDVER}\n      IntCmp $6 9 0 0 +2\n        StrCpy $0 \"$00\"\n\n      StrCpy $0 \"$0$6\"\n\n    Goto loop${UMUI_UNIQUEIDVER}\n\n  endcheck${UMUI_UNIQUEIDVER}:\n    StrCpy $7 $0 1 -1\n    StrCmp $7 '.' 0 end${UMUI_UNIQUEIDVER}\n      StrLen $6 $0\n      IntOp $6 $6 - 1\n      StrCpy $0 $0 $6\n      Goto endcheck${UMUI_UNIQUEIDVER}\n\n  end${UMUI_UNIQUEIDVER}:\n\n  Pop $7\n  Pop $6\n  Pop $5\n  Pop $4\n  Pop $3\n  Pop $2\n  Pop $1\n  Exch $0\n\n  !undef UMUI_UNIQUEIDVER\n\n  !verbose pop\n\n!macroend\n\n\n\n!macro UMUI_GETPARENTFOLDER FULPATH\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Push $0\n  Push $1\n\n  StrCpy $0 \"${FULPATH}\"\n\n  StrCpy $1 $0 1 -1\n  StrCmp $1 '\\' +3\n    StrCpy $0 $0 -1\n    Goto -3\n\n  StrCpy $1 $0 1 -1\n\n  Pop $1\n  Exch $0\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_WELCOMEFINISHABORTPAGE_INIT UNINSTALLER\n\n  !ifdef MUI_${UNINSTALLER}WELCOMEPAGE | MUI_${UNINSTALLER}FINISHPAGE | UMUI_${UNINSTALLER}ABORTPAGE | UMUI_${UNINSTALLER}MULTILANGUAGEPAGE\n\n    !ifdef UMUI_USE_${UNINSTALLER}ALTERNATE_PAGE\n       !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_${UNINSTALLER}ALTERNATEWELCOMEFINISHABORTPAGE_INI}\" \"ioSpecial.ini\"\n    !else\n       !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_${UNINSTALLER}WELCOMEFINISHABORTPAGE_INI}\" \"ioSpecial.ini\"\n    !endif\n\n    !ifdef UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n      File \"/oname=$PLUGINSDIR\\modern-wizard.bmp\" \"${MUI_${UNINSTALLER}WELCOMEFINISHPAGE_BITMAP}\"\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 1\" \"Text\" \"$PLUGINSDIR\\modern-wizard.bmp\"\n\n      !ifdef MUI_${UNINSTALLER}WELCOMEFINISHPAGE_BITMAP_NOSTRETCH\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field 1\" \"Flags\" \"\"\n      !endif\n\n    !endif\n\n  !endif\n\n!macroend\n\n!macro MUI_HEADERIMAGE_INIT UNINSTALLER\n\n  !ifdef MUI_HEADERIMAGE\n\n    InitPluginsDir\n\n    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL\n\n    StrCmp $(^RTL) 0 mui.headerimageinit_nortl\n\n      File \"/oname=$PLUGINSDIR\\modern-header.bmp\" \"${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL}\"\n\n      !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL_NOSTRETCH\n        SetBrandingImage /IMGID=1046 /RESIZETOFIT \"$PLUGINSDIR\\modern-header.bmp\"\n      !else\n        SetBrandingImage /IMGID=1046 \"$PLUGINSDIR\\modern-header.bmp\"\n      !endif\n\n      Goto mui.headerimageinit_done\n\n      mui.headerimageinit_nortl:\n\n    !endif\n\n      File \"/oname=$PLUGINSDIR\\modern-header.bmp\" \"${MUI_HEADERIMAGE_${UNINSTALLER}BITMAP}\"\n\n      !ifndef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_NOSTRETCH\n        SetBrandingImage /IMGID=1046 /RESIZETOFIT \"$PLUGINSDIR\\modern-header.bmp\"\n      !else\n        SetBrandingImage /IMGID=1046 \"$PLUGINSDIR\\modern-header.bmp\"\n      !endif\n\n    !ifdef MUI_HEADERIMAGE_${UNINSTALLER}BITMAP_RTL\n\n    mui.headerimageinit_done:\n\n    !endif\n\n  !endif\n\n!macroend\n\n;--------------------------------\n;INTERFACE - FUNCTIONS\n\n\n!macro UMUI_VERSION_SET\n\n  !ifdef UMUI_VERBUILD_REGISTRY_VALUENAME\n    !ifndef UMUI_VERBUILD\n      !warning \"UMUI_VERBUILD need to be defined with UMUI_VERBUILD_REGISTRY_VALUENAME. Ignored\"\n      !undef UMUI_VERBUILD_REGISTRY_VALUENAME\n    !endif\n  !endif\n  !ifdef UMUI_VERSION_REGISTRY_VALUENAME\n    !ifndef UMUI_VERSION\n      !warning \"UMUI_VERSION need to be defined with UMUI_VERSION_REGISTRY_VALUENAME. Ignored\"\n      !undef UMUI_VERSION_REGISTRY_VALUENAME\n    !endif\n  !endif\n\n\n  !ifdef UMUI_VERBUILD_REGISTRY_VALUENAME\n\n    !ifndef UMUI_VERBUILD_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_VERBUILD_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_VERBUILD_REGISTRY_VALUENAME, the UMUI_VERBUILD_REGISTRY_ROOT & UMUI_VERBUILD_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_VERBUILD_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_VERBUILD_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_VERBUILD_REGISTRY_VALUENAME, the UMUI_VERBUILD_REGISTRY_ROOT & UMUI_VERBUILD_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    ReadRegStr $MUI_TEMP1 ${UMUI_VERBUILD_REGISTRY_ROOT} \"${UMUI_VERBUILD_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n\n    StrCmp $MUI_TEMP1 \"\" endv 0\n\n      ClearErrors\n\n      StrCmp $MUI_TEMP1 \"${UMUI_VERBUILD}\" 0 diff\n        !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_SAMEVERSION}\n        !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_DIFFVERSION}\n        Goto endv\n      diff:\n        !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_DIFFVERSION}\n        !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_SAMEVERSION}\n\n    endv:\n    ClearErrors\n\n    !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_VERBUILD_REGISTRY_ROOT} \"${UMUI_VERBUILD_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\" \"${UMUI_VERBUILD}\"\n\n  !endif\n\n  !ifdef UMUI_VERSION_REGISTRY_VALUENAME & UMUI_VERSION\n\n    !ifndef UMUI_VERSION_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_VERSION_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_VERSION_REGISTRY_VALUENAME, the UMUI_VERSION_REGISTRY_ROOT & UMUI_VERSION_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_VERSION_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_VERSION_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_VERSION_REGISTRY_VALUENAME, the UMUI_VERSION_REGISTRY_ROOT & UMUI_VERSION_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_VERSION_REGISTRY_ROOT} \"${UMUI_VERSION_REGISTRY_KEY}\" \"${UMUI_VERSION_REGISTRY_VALUENAME}\" \"${UMUI_VERSION}\"\n  !endif\n\n!macroend\n\n\n\n!macro UMUI_PATH_SAVE\n\n  !ifdef UMUI_UNINSTALLPATH_REGISTRY_VALUENAME\n    !ifndef UMUI_UNINSTALL_FULLPATH\n      !warning \"UMUI_UNINSTALL_FULLPATH need to be defined with UMUI_UNINSTALLPATH_REGISTRY_VALUENAME. Ignored\"\n      !undef UMUI_UNINSTALLPATH_REGISTRY_VALUENAME\n    !endif\n\n    !ifndef UMUI_UNINSTALLPATH_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_UNINSTALLPATH_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_UNINSTALLPATH_REGISTRY_VALUENAME, the UMUI_UNINSTALLPATH_REGISTRY_ROOT & UMUI_UNINSTALLPATH_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_UNINSTALLPATH_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_UNINSTALLPATH_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_UNINSTALLPATH_REGISTRY_VALUENAME, the UMUI_UNINSTALLPATH_REGISTRY_ROOT & UMUI_UNINSTALLPATH_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    !ifndef UMUI_INSTALLERFULLPATH_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_INSTALLERFULLPATH_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME, the UMUI_INSTALLERFULLPATH_REGISTRY_ROOT & UMUI_INSTALLERFULLPATH_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_INSTALLERFULLPATH_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_INSTALLERFULLPATH_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME, the UMUI_INSTALLERFULLPATH_REGISTRY_ROOT & UMUI_INSTALLERFULLPATH_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n  !endif\n\n  !ifdef UMUI_UNINSTALLPATH_REGISTRY_VALUENAME & UMUI_UNINSTALL_FULLPATH\n    !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_UNINSTALLPATH_REGISTRY_ROOT} \"${UMUI_UNINSTALLPATH_REGISTRY_KEY}\" \"${UMUI_UNINSTALLPATH_REGISTRY_VALUENAME}\" \"${UMUI_UNINSTALL_FULLPATH}\"\n  !endif\n\n  !ifdef UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME\n    !ifdef UMUI_INSTALL_FULLPATH\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_INSTALLERFULLPATH_REGISTRY_ROOT} \"${UMUI_INSTALLERFULLPATH_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\" \"${UMUI_INSTALL_FULLPATH}\"\n    !else\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_INSTALLERFULLPATH_REGISTRY_ROOT} \"${UMUI_INSTALLERFULLPATH_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\" $EXEPATH\n    !endif\n  !endif\n\n!macroend\n\n\n\n!macro UMUI_MAINTENANCE_PARAMETERS_GET\n\n  ClearErrors\n  !insertmacro UMUI_PARAMETERISSET \"/remove\"\n  Pop $MUI_TEMP1\n  IfErrors noremove 0\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_REMOVE}\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_ABORTFIRSTTIME}\n    !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n    Goto endsearch\n\n  noremove:\n  !insertmacro UMUI_PARAMETERISSET \"/modify\"\n  Pop $MUI_TEMP1\n  IfErrors nomodify 0\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_MODIFY}\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_ABORTFIRSTTIME}\n    !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n    Goto endsearch\n\n  nomodify:\n  !insertmacro UMUI_PARAMETERISSET \"/repair\"\n  Pop $MUI_TEMP1\n  IfErrors norepair 0\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_REPAIR}\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_ABORTFIRSTTIME}\n    !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n    Goto endsearch\n\n  norepair:\n  !insertmacro UMUI_PARAMETERISSET \"/continue\"\n  Pop $MUI_TEMP1\n  IfErrors endsearch 0\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_CONTINUE_SETUP}\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_ABORTFIRSTTIME}\n    !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n\n  endsearch:\n  ClearErrors\n\n!macroend\n\n\n!macro MUI_FUNCTION_GUIINIT\n\n  Function .onGUIInit\n\n    !insertmacro MUI_GUIINIT\n\n    !ifdef MUI_CUSTOMFUNCTION_GUIINIT\n      Call \"${MUI_CUSTOMFUNCTION_GUIINIT}\"\n    !endif\n\n    !ifdef UMUI_BGSKIN | UMUI_USE_CUSTOMBG\n      !insertmacro UMUI_BG\n    !endif\n\n    ;Only if not already set in the .onInit function\n    StrCmp $UMUI_INSTALLFLAG \"\" 0 +2\n      StrCpy $UMUI_INSTALLFLAG 0\n\n    !insertmacro UMUI_VERSION_SET\n\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n\n    !insertmacro UMUI_MAINTENANCE_PARAMETERS_GET\n\n  FunctionEnd\n\n!ifdef UMUI_CUSTOMFUNCTION_GUIEND | UMUI_BGSKIN | UMUI_USE_CUSTOMBG\n\n  Function .onGUIEnd\n\n    !ifdef UMUI_CUSTOMFUNCTION_GUIEND\n      Call \"${UMUI_CUSTOMFUNCTION_GUIEND}\"\n    !endif\n\n    !ifdef UMUI_BGSKIN | UMUI_USE_CUSTOMBG\n      !insertmacro UMUI_BG_Destroy\n    !endif\n\n    !insertmacro UMUI_DELETE_PLUGINDIR\n\n  FunctionEnd\n\n!endif\n\n!macroend\n\n!macro MUI_FUNCTION_DESCRIPTION_BEGIN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifndef MUI_VAR_TEXT\n    Var MUI_TEXT\n    !define MUI_VAR_TEXT\n  !endif\n\n;  !define /redef MUI_PAGE_UNINSTALLER_PREFIX \"\"\n  Function .onMouseOverSection\n    !insertmacro MUI_DESCRIPTION_BEGIN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_FUNCTION_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n    !insertmacro MUI_DESCRIPTION_END\n    !ifdef MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION\n      Call \"${MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION}\"\n    !endif\n  FunctionEnd\n;  !undef MUI_PAGE_UNINSTALLER_PREFIX\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNFUNCTION_DESCRIPTION_BEGIN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n;  !define /redef MUI_PAGE_UNINSTALLER_PREFIX \"UN\"\n  Function un.onMouseOverSection\n    !insertmacro MUI_DESCRIPTION_BEGIN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNFUNCTION_DESCRIPTION_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n    !insertmacro MUI_DESCRIPTION_END\n    !ifdef MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION\n      Call \"${MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION}\"\n    !endif\n  FunctionEnd\n;  !undef MUI_PAGE_UNINSTALLER_PREFIX\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_FUNCTION_ABORTWARNING\n\n  Function .onUserAbort\n    !ifdef MUI_ABORTWARNING\n      !insertmacro MUI_ABORTWARNING\n    !endif\n\n    !ifdef MUI_CUSTOMFUNCTION_ABORT\n      Call \"${MUI_CUSTOMFUNCTION_ABORT}\"\n    !endif\n\n    !ifdef UMUI_ABORTPAGE\n      !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_CANCELLED}\n      !ifdef UMUI_USE_INSTALLOPTIONSEX\n        !insertmacro UMUI_INSTALLOPTIONSEX_SKIPVALIDATION\n      !endif\n      SendMessage $HWNDPARENT \"0x408\" \"1\" \"\"\n      Abort\n    !else\n      !insertmacro UMUI_DELETE_PLUGINDIR\n    !endif\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_UNABORTWARNING\n\n  Function un.onUserAbort\n    !ifdef MUI_UNABORTWARNING\n      !insertmacro MUI_UNABORTWARNING\n    !endif\n\n    !ifdef MUI_CUSTOMFUNCTION_UNABORT\n      Call \"${MUI_CUSTOMFUNCTION_UNABORT}\"\n    !endif\n\n    !ifdef UMUI_UNABORTPAGE\n      !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_CANCELLED}\n      !ifdef UMUI_USE_INSTALLOPTIONSEX\n        !insertmacro UMUI_INSTALLOPTIONSEX_SKIPVALIDATION\n      !endif\n      SendMessage $HWNDPARENT \"0x408\" \"1\" \"\"\n      Abort\n    !else\n      !insertmacro UMUI_DELETE_PLUGINDIR\n    !endif\n  FunctionEnd\n\n!macroend\n\n!macro MUI_UNFUNCTION_GUIINIT\n\n  Function un.onGUIInit\n\n    !insertmacro MUI_UNGUIINIT\n\n    !ifdef MUI_CUSTOMFUNCTION_UNGUIINIT\n      Call \"${MUI_CUSTOMFUNCTION_UNGUIINIT}\"\n    !endif\n\n    !ifdef UMUI_BGSKIN | UMUI_USE_CUSTOMBG\n      !insertmacro UMUI_BG\n    !endif\n\n    ;Only if not already set in the un.onInit function\n    StrCmp $UMUI_INSTALLFLAG \"\" 0 +2\n      StrCpy $UMUI_INSTALLFLAG 0\n\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_SAMEVERSION}\n    !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_DIFFVERSION}\n    !insertmacro UMUI_MAINTENANCE_PARAMETERS_GET\n\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n\n  FunctionEnd\n\n\n  !ifdef UMUI_CUSTOMFUNCTION_UNGUIEND | UMUI_BGSKIN | UMUI_USE_CUSTOMBG\n\n    Function un.onGUIEnd\n\n      !ifdef UMUI_CUSTOMFUNCTION_UNGUIEND\n        Call \"${UMUI_CUSTOMFUNCTION_UNGUIEND}\"\n      !endif\n\n      !ifdef UMUI_BGSKIN | UMUI_USE_CUSTOMBG\n        !insertmacro UMUI_BG_Destroy\n      !endif\n\n      !insertmacro UMUI_DELETE_PLUGINDIR\n\n    FunctionEnd\n\n  !endif\n\n!macroend\n\n\n!macro UMUI_UNPAGE_LEFTMESSAGEBOX A B C\n\n  !insertmacro UMUI_PAGE_LEFTMESSAGEBOX \"${A}\" \"${B}\" \"${C}\"\n\n!macroend\n\n!macro UMUI_PAGE_LEFTMESSAGEBOX A B C\n\n  !warning \"The UMUI_PAGE_LEFTMESSAGEBOX and UMUI_UNPAGE_LEFTMESSAGEBOX macros were removed since Ultra-Modern UI 1.00 beta 2.\"\n  !insertmacro MUI_UNSET UMUI_LEFTMESSAGEBOX_VAR\n  !insertmacro MUI_UNSET UMUI_LEFTMESSAGEBOX_LEFTFUNC\n\n!macroend\n\n!macro UMUI_LEFT_TEXTE A B\n\n  !warning \"The UMUI_LEFT_TEXTE macro was removed since Ultra-Modern UI 1.00 beta 2.\"\n\n!macroend\n\n!macro UMUI_LEFT_SETTIME A\n\n  !warning \"The UMUI_LEFT_SETTIME macro was removed since Ultra-Modern UI 1.00 beta 2.\"\n\n!macroend\n\n; Workaround for unkinning button after MessageBox validated\n!macro UMUI_FIX_BUTTONS_SKIN\n\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}BUTTONIMAGE_BMP\n    SendMessage $HWNDPARENT ${WM_MENUDRAG} 0 0 ; Do this to force reskin\n  !endif\n\n!macroend\n\n;--------------------------------\n;START MENU FOLDER\n\n!macro MUI_STARTMENU_GETFOLDER ID VAR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME\n\n    ReadRegStr $MUI_TEMP1 \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT}\" \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME}\"\n\n    StrCmp $MUI_TEMP1 \"\" +3\n      StrCpy \"${VAR}\" $MUI_TEMP1\n      Goto +2\n\n    StrCpy \"${VAR}\" \"${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}\"\n\n  !else\n\n    StrCpy \"${VAR}\" \"${MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER}\"\n\n  !endif\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_STARTMENU_WRITE_BEGIN ID\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !define MUI_STARTMENUPAGE_CURRENT_ID \"${ID}\"\n\n  StrCpy $MUI_TEMP1 \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\" 1\n  StrCmp $MUI_TEMP1 \">\" mui.startmenu_write_${MUI_STARTMENUPAGE_CURRENT_ID}_done\n\n    StrCmp \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\" \"\" 0 mui.startmenu_writebegin_${MUI_STARTMENUPAGE_CURRENT_ID}_notempty\n\n      !insertmacro MUI_STARTMENU_GETFOLDER \"${MUI_STARTMENUPAGE_CURRENT_ID}\" \"${MUI_STARTMENUPAGE_${MUI_STARTMENUPAGE_CURRENT_ID}_VARIABLE}\"\n\n  mui.startmenu_writebegin_${MUI_STARTMENUPAGE_CURRENT_ID}_notempty:\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_STARTMENU_WRITE_END\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  mui.startmenu_write_${MUI_STARTMENUPAGE_CURRENT_ID}_done:\n\n  !undef MUI_STARTMENUPAGE_CURRENT_ID\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;PAGES\n\n!macro MUI_PAGE_INIT\n\n  !insertmacro MUI_INTERFACE\n\n  !define /IfNDef MUI_PAGE_UNINSTALLER_PREFIX \"\"\n  !define /IfNDef MUI_PAGE_UNINSTALLER_FUNCPREFIX \"\"\n\n  !insertmacro MUI_UNSET MUI_UNIQUEID\n\n  !define MUI_UNIQUEID ${__LINE__}\n\n!macroend\n\n!macro MUI_UNPAGE_INIT\n\n  !define /IfNDef MUI_UNINSTALLER\n\n  !define MUI_PAGE_UNINSTALLER\n\n  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_PREFIX\n  !insertmacro MUI_UNSET MUI_PAGE_UNINSTALLER_FUNCPREFIX\n\n  !define MUI_PAGE_UNINSTALLER_PREFIX \"UN\"\n  !define MUI_PAGE_UNINSTALLER_FUNCPREFIX \"un.\"\n\n!macroend\n\n!macro MUI_UNPAGE_END\n\n  !undef MUI_PAGE_UNINSTALLER\n  !undef MUI_PAGE_UNINSTALLER_PREFIX\n  !undef MUI_PAGE_UNINSTALLER_FUNCPREFIX\n\n!macroend\n\n!macro MUI_PAGE_WELCOME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TITLE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE)\"\n\n  !ifdef MUI_PAGE_UNINSTALLER\n    !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TEXT \"$(MUI_UNTEXT_WELCOME_INFO_TEXT)\"\n  !else\n    !ifdef UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n      !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TEXT \"$(UMUI_TEXT_WELCOME_ALTERNATIVEINFO_TEXT)\"\n    !else\n      !insertmacro MUI_DEFAULT_IOCONVERT MUI_WELCOMEPAGE_TEXT \"$(MUI_TEXT_WELCOME_INFO_TEXT)\"\n    !endif\n  !endif\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_WELCOMEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.WelcomeLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES\n  !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT\n  !insertmacro MUI_UNSET UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_LICENSE LICENSEDATA\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}LICENSEPAGE\n\n  !define /IfNDef MUI_LICENSEPAGE_TEXT_TOP \"$(MUI_INNERTEXT_LICENSE_TOP)\"\n  !define /IfNDef MUI_LICENSEPAGE_BUTTON \"\"\n  !define /IfNDef MUI_LICENSEPAGE_CHECKBOX_TEXT \"\"\n  !define /IfNDef MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT \"\"\n  !define /IfNDef MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE \"\"\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}license\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    LicenseData \"${LICENSEDATA}\"\n\n    !ifndef MUI_LICENSEPAGE_TEXT_BOTTOM\n      !ifndef MUI_LICENSEPAGE_CHECKBOX & MUI_LICENSEPAGE_RADIOBUTTONS\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !else ifdef MUI_LICENSEPAGE_CHECKBOX\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_CHECKBOX)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !else\n        LicenseText \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS)\" \"${MUI_LICENSEPAGE_BUTTON}\"\n      !endif\n    !else\n      LicenseText \"${MUI_LICENSEPAGE_TEXT_BOTTOM}\" \"${MUI_LICENSEPAGE_BUTTON}\"\n    !endif\n\n    !ifdef MUI_LICENSEPAGE_CHECKBOX\n      LicenseForceSelection checkbox \"${MUI_LICENSEPAGE_CHECKBOX_TEXT}\"\n    !else ifdef MUI_LICENSEPAGE_RADIOBUTTONS\n      LicenseForceSelection radiobuttons \"${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT}\" \"${MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE}\"\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_LICENSEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicensePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.LicenseLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_TOP\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_TEXT_BOTTOM\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_BUTTON\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT\n  !insertmacro MUI_UNSET MUI_LICENSEPAGE_RADIOBUTTONS\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_ACCEPT\n    !insertmacro MUI_UNSET MUI_LICENSEPAGE_CHECKBOX_TEXT_DECLINE\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_COMPONENTS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}COMPONENTSPAGE\n\n  !define /IfNDef MUI_COMPONENTSPAGE_TEXT_TOP \"\"\n  !define /IfNDef MUI_COMPONENTSPAGE_TEXT_COMPLIST \"\"\n  !define /IfNDef MUI_COMPONENTSPAGE_TEXT_INSTTYPE \"\"\n  !define /IfNDef MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE \"$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE)\"\n  !define /IfNDef MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO \"$(MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO)\"\n\n  !ifndef MUI_VAR_TEXT\n    Var MUI_TEXT\n    !define MUI_VAR_TEXT\n  !endif\n\n  !ifdef UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME | UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME\n    !ifndef UMUI_VAR_UMUI_TEMP3\n      Var UMUI_TEMP3\n      !define UMUI_VAR_UMUI_TEMP3\n    !endif\n  !endif\n\n  !ifdef UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME\n    !ifndef UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME, the UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT & UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME, the UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT & UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n  !endif\n\n  !ifdef UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME\n    !ifndef UMUI_COMPONENTSPAGE_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_COMPONENTSPAGE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME, the UMUI_COMPONENTSPAGE_REGISTRY_ROOT & UMUI_COMPONENTSPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_COMPONENTSPAGE_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_COMPONENTSPAGE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME, the UMUI_COMPONENTSPAGE_REGISTRY_ROOT & UMUI_COMPONENTSPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n  !endif\n\n  !ifndef MUI_UNINSTALLER\n    !ifdef UMUI_MAINTENANCEPAGE\n      !ifndef UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME\n        !warning \"With the maintenance page, you need to set the UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME define with a clean install function.\"\n      !endif\n    !endif\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}components\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    ComponentText \"${MUI_COMPONENTSPAGE_TEXT_TOP}\" \"${MUI_COMPONENTSPAGE_TEXT_INSTTYPE}\" \"${MUI_COMPONENTSPAGE_TEXT_COMPLIST}\"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_COMPONENTSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ComponentsLeave_${MUI_UNIQUEID}\n\n  !undef MUI_COMPONENTSPAGE_TEXT_TOP\n  !undef MUI_COMPONENTSPAGE_TEXT_COMPLIST\n  !undef MUI_COMPONENTSPAGE_TEXT_INSTTYPE\n  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE\n  !insertmacro MUI_UNSET MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO\n\n  !insertmacro MUI_UNSET UMUI_COMPONENTSPAGE_REGISTRY_ROOT\n  !insertmacro MUI_UNSET UMUI_COMPONENTSPAGE_REGISTRY_KEY\n  !insertmacro MUI_UNSET UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME\n  !insertmacro MUI_UNSET UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT\n  !insertmacro MUI_UNSET UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY\n  !insertmacro MUI_UNSET UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_DIRECTORY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}DIRECTORYPAGE\n\n  !define /IfNDef MUI_DIRECTORYPAGE_TEXT_TOP \"\"\n  !define /IfNDef MUI_DIRECTORYPAGE_TEXT_DESTINATION \"\"\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}directory\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    DirText \"${MUI_DIRECTORYPAGE_TEXT_TOP}\" \"${MUI_DIRECTORYPAGE_TEXT_DESTINATION}\"\n\n    !ifdef MUI_DIRECTORYPAGE_VARIABLE\n      DirVar \"${MUI_DIRECTORYPAGE_VARIABLE}\"\n    !endif\n\n    !ifdef MUI_DIRECTORYPAGE_VERIFYONLEAVE\n      DirVerify leave\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_DIRECTORYPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.DirectoryLeave_${MUI_UNIQUEID}\n\n  !undef MUI_DIRECTORYPAGE_TEXT_TOP\n  !undef MUI_DIRECTORYPAGE_TEXT_DESTINATION\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_BGCOLOR\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VARIABLE\n  !insertmacro MUI_UNSET MUI_DIRECTORYPAGE_VERIFYONLEAVE\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_STARTMENU ID VAR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}STARTMENUPAGE\n\n  !define /IfNDef MUI_STARTMENUPAGE_DEFAULTFOLDER \"$(^Name)\"\n  !define /IfNDef MUI_STARTMENUPAGE_TEXT_TOP \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_TOP)\"\n  !define /IfNDef MUI_STARTMENUPAGE_TEXT_CHECKBOX \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_CHECKBOX)\"\n\n  !define MUI_STARTMENUPAGE_VARIABLE \"${VAR}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_VARIABLE\" \"${MUI_STARTMENUPAGE_VARIABLE}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n\n    !ifndef MUI_STARTMENUPAGE_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define MUI_STARTMENUPAGE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For MUI_STARTMENUPAGE_REGISTRY_VALUENAME, the MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef MUI_STARTMENUPAGE_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define MUI_STARTMENUPAGE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For MUI_STARTMENUPAGE_REGISTRY_VALUENAME, the MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT\" \"${MUI_STARTMENUPAGE_REGISTRY_ROOT}\"\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY\" \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\"\n\n  !endif\n\n  !ifdef UMUI_UNIQUEBGIMAGE | UMUI_PAGEBGIMAGE\n    !warning \"The MUI_STARTMENU page does not work with the UMUI_UNIQUEBGIMAGE and UMUI_PAGEBGIMAGE defines. Use the UMUI_ALTERNATIVESTARTMENU page instead.\"\n  !endif\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_STARTMENUPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.StartmenuLeave_${MUI_UNIQUEID}\n\n  !undef MUI_STARTMENUPAGE_VARIABLE\n  !undef MUI_STARTMENUPAGE_TEXT_TOP\n  !undef MUI_STARTMENUPAGE_TEXT_CHECKBOX\n  !undef MUI_STARTMENUPAGE_DEFAULTFOLDER\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_NODISABLE\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_ROOT\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_KEY\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_BGCOLOR\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_INSTFILES\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INSTFILESPAGE\n\n  !ifdef UMUI_INSTALLDIR_REGISTRY_VALUENAME\n    !ifndef UMUI_INSTALLDIR_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_INSTALLDIR_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_INSTALLDIR_REGISTRY_VALUENAME, the UMUI_INSTALLDIR_REGISTRY_ROOT & UMUI_INSTALLDIR_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_INSTALLDIR_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_INSTALLDIR_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_INSTALLDIR_REGISTRY_VALUENAME, the UMUI_INSTALLDIR_REGISTRY_ROOT & UMUI_INSTALLDIR_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}instfiles\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_INSTFILESPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InstFilesLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_TEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_TEXT\n  !insertmacro MUI_UNSET MUI_INSTFILESPAGE_ABORTWARNING_SUBTEXT\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_PAGE_FINISH\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}FINISHPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TITLE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_BUTTON \"$(MUI_BUTTONTEXT_FINISH)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOT \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_FINISH_INFO_REBOOT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOTNOW \"$(MUI_TEXT_FINISH_REBOOTNOW)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_TEXT_REBOOTLATER \"$(MUI_TEXT_FINISH_REBOOTLATER)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_RUN_TEXT \"$(MUI_TEXT_FINISH_RUN)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_FINISHPAGE_SHOWREADME_TEXT \"$(MUI_TEXT_FINISH_SHOWREADME)\"\n\n  !define /IfNDef MUI_FINISHPAGE_LINK_COLOR \"${UMUI_TEXT_LIGHTCOLOR}\"\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  !ifndef MUI_PAGE_UNINSTALLER\n    !ifndef MUI_FINISHPAGE_NOAUTOCLOSE\n      AutoCloseWindow true\n    !endif\n  !endif\n\n  !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n    !ifndef MUI_VAR_NOABORTWARNING\n      !define MUI_VAR_NOABORTWARNING\n      Var MUI_NOABORTWARNING\n    !endif\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro MUI_FUNCTION_FINISHPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.FinishLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TITLE_3LINES\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_LARGE\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_BUTTON\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CANCEL_ENABLED\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTNOW\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_TEXT_REBOOTLATER\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_REBOOTLATER_DEFAULT\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_TEXT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_PARAMETERS\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_NOTCHECKED\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_RUN_FUNCTION\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_TEXT\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_SHOWREADME_FUNCTION\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_LOCATION\n    !insertmacro MUI_UNSET MUI_FINISHPAGE_LINK_COLOR\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_TOP\n  !insertmacro MUI_UNSET MUI_FINISHPAGE_CURFIELD_BOTTOM\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_WELCOME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_WELCOME\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_CONFIRM\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !define /IfNDef MUI_UNINSTALLER\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_UNCONFIRMPAGE\n\n  !define /IfNDef MUI_UNCONFIRMPAGE_TEXT_TOP \"\"\n  !define /IfNDef MUI_UNCONFIRMPAGE_TEXT_LOCATION \"\"\n\n  PageEx un.uninstConfirm\n\n    PageCallbacks un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    UninstallText \"${MUI_UNCONFIRMPAGE_TEXT_TOP}\" \"${MUI_UNCONFIRMPAGE_TEXT_LOCATION}\"\n\n    !ifdef MUI_UNCONFIRMPAGE_VARIABLE\n      DirVar \"${MUI_UNCONFIRMPAGE_VARIABLE}\"\n    !endif\n\n  PageExEnd\n\n  !insertmacro MUI_UNFUNCTION_CONFIRMPAGE un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_TOP\n  !insertmacro MUI_UNSET MUI_UNCONFIRMPAGE_TEXT_LOCATION\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_LICENSE LICENSEDATA\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_LICENSE \"${LICENSEDATA}\"\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_COMPONENTS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_COMPONENTS\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_DIRECTORY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_DIRECTORY\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_INSTFILES\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_INSTFILES\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNPAGE_FINISH\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro MUI_PAGE_FINISH\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n;PAGE FUNCTIONS\n\n\n; TODO: Rewrite the INSTALLFLAGS Macros to be able to use conditions like: ~X|Y&~Z|~V&~W|~U meaning (~X)|(Y&~Z)|(~V&~W)|(U)\n\n\n; Convert a string VALUE1|VALUE2|VALUE4 to a OR bit by bit VALUE7 integer.\n; Convert a string VALUE1&VALUE2&VALUE4 to a OR bit by bit VALUE7 integer.\n; Usage:\n;   !insertmacro UMUI_STR2INT string\n;   Pop $VAR <INT Value>\n;   IntOp $VAR $VAR ~   only to have a NAND bit by bit VALUE inteder.\n\n!macro UMUI_STR2INT VALUE\n  Push $0 ; The source\n  Push $1 ; The output\n  Push $2 ; Temporary char\n  Push $3 ; Temporary integer\n\n  !define UMUI_UNIQUEIDSTR2INT ${__LINE__}\n\n  StrCpy $0 ${VALUE} ; Initialise the source\n  StrCpy $1 0        ; Initialise the output\n  StrCpy $3 0        ; Initialise the temporary integer\n\n  loop${UMUI_UNIQUEIDSTR2INT}:\n    StrCpy $2 $0 1 ; Get the next source char\n    StrCmp $2 \"\" done${UMUI_UNIQUEIDSTR2INT} ; Abort when none left\n      StrCpy $0 $0 \"\" 1 ; Remove it from the source\n      StrCmp $2 \"|\" +2 +1 ; | OR Bit by bit\n        StrCmp $2 \"&\" 0 +4 ; & AND Bit by bit\n          IntOp $1 $1 | $3\n          StrCpy $3 0\n          Goto loop${UMUI_UNIQUEIDSTR2INT}\n      IntOp $3 $3 * 10\n      IntOp $3 $3 + $2\n      Goto loop${UMUI_UNIQUEIDSTR2INT}\n\n  done${UMUI_UNIQUEIDSTR2INT}:\n    IntOp $1 $1 | $3\n\n  !undef UMUI_UNIQUEIDSTR2INT\n\n  StrCpy $0 $1\n  Pop $3\n  Pop $2\n  Pop $1\n  Exch $0\n!macroend\n\n\n\n\n!macro UMUI_ABORT_IF_INSTALLFLAG_IS VALUE\n  Push $0\n\n  ; convert INT|INT|INT string into an integer value\n  !ifndef UMUI_ABORT_IF_INSTALLFLAG_IS\n    !insertmacro UMUI_STR2INT ${VALUE}\n  !else\n    !insertmacro UMUI_STR2INT ${UMUI_ABORT_IF_INSTALLFLAG_IS}\n    !undef UMUI_ABORT_IF_INSTALLFLAG_IS\n  !endif\n\n  Pop $0\n\n  StrCmp $0 \"none\" +5 0\n    IntOp $0 $UMUI_INSTALLFLAG & $0\n    IntCmp $0 0 +3 0 0\n      Pop $0\n      Abort\n\n  Pop $0\n!macroend\n\n!macro UMUI_ABORT_IF_INSTALLFLAG_ISNOT VALUE\n  Push $0\n  Push $1\n\n  ; convert INT|INT|INT string into an integer value\n  !ifndef UMUI_ABORT_IF_INSTALLFLAG_ISNOT\n    !insertmacro UMUI_STR2INT ${VALUE}\n  !else\n    !insertmacro UMUI_STR2INT ${UMUI_ABORT_IF_INSTALLFLAG_ISNOT}\n    !undef UMUI_ABORT_IF_INSTALLFLAG_ISNOT\n  !endif\n\n  Pop $0\n\n  StrCmp $0 \"none\" +5 0\n\n    IntOp $0 $0 ~\n    IntOp $1 $UMUI_INSTALLFLAG | $0\n    IntCmp $1 $0 0 +4 +4\n      Pop $1\n      Pop $0\n      Abort\n\n  Pop $1\n  Pop $0\n!macroend\n\n\n\n!macro UMUI_IF_INSTALLFLAG_ISNOT VALUE\n\n  Push $0\n\n  !ifndef UMUI_POPVAR1\n    Push $1\n    !define UMUI_POPVAR1\n  !endif\n\n  !ifdef UMUI_UNIQUEIDIS\n    !define UMUI_UNIQUEIDISIMB ${__LINE__}\n  !else\n    !define UMUI_UNIQUEIDIS ${__LINE__}\n  !endif\n\n  !insertmacro UMUI_STR2INT ${VALUE}\n\n  Pop $0\n\n  !ifdef UMUI_UNIQUEIDISIMB\n\n    StrCmp $0 \"none\" endpop${UMUI_UNIQUEIDISIMB}  0\n\n      IntOp $0 $0 ~\n      IntOp $1 $UMUI_INSTALLFLAG | $0\n\n      IntCmp $1 $0 0 endpop${UMUI_UNIQUEIDISIMB} endpop${UMUI_UNIQUEIDISIMB}\n\n  !else\n\n    StrCmp $0 \"none\" endpop${UMUI_UNIQUEIDIS}  0\n\n      IntOp $0 $0 ~\n      IntOp $1 $UMUI_INSTALLFLAG | $0\n\n      IntCmp $1 $0 0 endpop${UMUI_UNIQUEIDIS} endpop${UMUI_UNIQUEIDIS}\n\n  !endif\n\n  Pop $1\n  Pop $0\n\n!macroend\n\n\n!macro UMUI_IF_INSTALLFLAG_IS VALUE\n\n  Push $0\n\n  !ifdef UMUI_UNIQUEIDIS\n    !define UMUI_UNIQUEIDISIMB ${__LINE__}\n  !else\n    !define UMUI_UNIQUEIDIS ${__LINE__}\n  !endif\n\n  !insertmacro UMUI_STR2INT ${VALUE}\n\n  Pop $0\n\n  !ifdef UMUI_UNIQUEIDISIMB\n\n    StrCmp $0 \"none\" endpop${UMUI_UNIQUEIDISIMB} 0\n\n      IntOp $0 $UMUI_INSTALLFLAG & $0\n      IntCmp $0 0 endpop${UMUI_UNIQUEIDISIMB} 0 0\n\n  !else\n\n    StrCmp $0 \"none\" endpop${UMUI_UNIQUEIDIS} 0\n\n      IntOp $0 $UMUI_INSTALLFLAG & $0\n      IntCmp $0 0 endpop${UMUI_UNIQUEIDIS} 0 0\n\n  !endif\n\n  Pop $0\n\n!macroend\n\n\n!macro UMUI_ENDIF_INSTALLFLAG\n\n  !ifdef UMUI_UNIQUEIDISIMB\n\n    Goto end${UMUI_UNIQUEIDISIMB}\n\n    endpop${UMUI_UNIQUEIDISIMB}:\n      !ifdef UMUI_POPVAR1\n        Pop $1\n        !undef UMUI_POPVAR1\n      !endif\n;      Pop $0                  ; Cause an invalide opcode\n\n    end${UMUI_UNIQUEIDISIMB}:\n\n    !undef UMUI_UNIQUEIDISIMB\n\n  !else\n\n    Goto end${UMUI_UNIQUEIDIS}\n\n    endpop${UMUI_UNIQUEIDIS}:\n      !ifdef UMUI_POPVAR1\n        Pop $1\n        !undef UMUI_POPVAR1\n      !endif\n      Pop $0\n\n    end${UMUI_UNIQUEIDIS}:\n\n    !undef UMUI_UNIQUEIDIS\n\n  !endif\n\n!macroend\n\n\n!macro UMUI_SET_INSTALLFLAG VALUE\n  Push $0\n\n  ; convert INT|INT|INT string into an integer value\n  !insertmacro UMUI_STR2INT ${VALUE}\n  Pop $0\n\n  IntOp $UMUI_INSTALLFLAG $UMUI_INSTALLFLAG | $0\n\n  Pop $0\n!macroend\n\n!macro UMUI_UNSET_INSTALLFLAG VALUE\n  Push $0\n\n  ; convert INT|INT|INT string into an integer value\n  !insertmacro UMUI_STR2INT ${VALUE}\n  Pop $0\n\n  IntOp $0 $0 ~\n  IntOp $UMUI_INSTALLFLAG $UMUI_INSTALLFLAG & $0\n\n  Pop $0\n!macroend\n\n\n\n\n!macro UMUI_UMUI_HIDEBACKBUTTON\n\n  !ifdef UMUI_HIDEFIRSTBACKBUTTON\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 3\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n  !else\n    !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_HIDEBACKBUTTON}\n      GetDlgItem $MUI_TEMP1 $HWNDPARENT 3\n      ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n  !endif\n\n  !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n\n  !ifndef UMUI_HIDENEXTBACKBUTTON\n    !insertmacro MUI_UNSET UMUI_HIDEFIRSTBACKBUTTON\n  !else\n    !define /IfNDef UMUI_HIDEFIRSTBACKBUTTON\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_HIDEBACKBUTTON}\n    !undef UMUI_HIDENEXTBACKBUTTON\n  !endif\n\n!macroend\n\n\n!macro MUI_PAGE_FUNCTION_CUSTOM TYPE\n\n  !ifdef MUI_PAGE_CUSTOMFUNCTION_${TYPE}\n    Call \"${MUI_PAGE_CUSTOMFUNCTION_${TYPE}}\"\n    !undef MUI_PAGE_CUSTOMFUNCTION_${TYPE}\n  !endif\n\n!macroend\n\n!macro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM\n\n  !ifdef MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT\n    Call \"${MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT}\"\n    !undef MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT\n  !endif\n\n!macroend\n\n\n\n!macro MUI_FUNCTION_WELCOMEPAGE PRE LEAVE\n\n  !ifndef UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n    !define UMUI_INTERNAL_WNUMFIELDS 2\n    !define UMUI_INTERNAL_WFIELDTITLE 1\n    !define UMUI_INTERNAL_WFIELDTEXT 2\n    !define UMUI_INTERNAL_WIDTITLE 1200\n    !define UMUI_INTERNAL_WIDTEXT 1201\n  !else\n    !define UMUI_INTERNAL_WNUMFIELDS 3\n    !define UMUI_INTERNAL_WFIELDTITLE 2\n    !define UMUI_INTERNAL_WFIELDTEXT 3\n    !define UMUI_INTERNAL_WIDTITLE 1201\n    !define UMUI_INTERNAL_WIDTEXT 1202\n  !endif\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"\" \"\"\n\n    !insertmacro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"NumFields\" \"${UMUI_INTERNAL_WNUMFIELDS}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"NextButtonText\" \"\"\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"CancelEnabled\" \"\"\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_WFIELDTITLE}\" \"Text\" \"MUI_WELCOMEPAGE_TITLE\"\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n      !ifndef MUI_WELCOMEPAGE_TITLE_3LINES\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_WFIELDTITLE}\" \"Bottom\" \"55\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_WFIELDTEXT}\" \"Top\" \"62\"\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_WFIELDTITLE}\" \"Bottom\" \"62\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_WFIELDTEXT}\" \"Top\" \"69\"\n      !endif\n    !endif\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_WFIELDTEXT}\" \"Bottom\" \"-1\"\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_WFIELDTEXT}\" \"Text\" \"MUI_WELCOMEPAGE_TEXT\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    LockWindow off\n\n\n    !insertmacro INSTALLOPTIONS_INITDIALOG \"ioSpecial.ini\"\n    Pop $MUI_HWND\n\n    !insertmacro UMUI_WFAPAGEBGTRANSPARENT_INIT $MUI_HWND\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_WIDTITLE}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      CreateFont $MUI_TEMP2 \"$(^Font)\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_WIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !else\n\n      ;alternate page\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_WIDTITLE}\n      CreateFont $MUI_TEMP2 \"MS Sans Serif\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 $MUI_TEMP2\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_WIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !endif\n\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 3\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_SHOW\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    LockWindow off\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n  !undef UMUI_INTERNAL_WNUMFIELDS\n  !undef UMUI_INTERNAL_WFIELDTITLE\n  !undef UMUI_INTERNAL_WFIELDTEXT\n  !undef UMUI_INTERNAL_WIDTITLE\n  !undef UMUI_INTERNAL_WIDTEXT\n\n!macroend\n\n\n\n!macro MUI_FUNCTION_LICENSEPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_LICENSE_SUBTITLE)\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro UMUI_UMUI_HIDEBACKBUTTON\n\n    !insertmacro UMUI_PAGEBGTRANSPARENT_INIT\n\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1040\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1036\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1006\n\n    !if \"${UMUI_XPSTYLE}\" == \"On\"\n      !insertmacro UMUI_PAGECTL_INIT 1034\n      !insertmacro UMUI_PAGECTL_INIT 1035\n    !else\n      !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1034\n      !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1035\n    !endif\n\n    !insertmacro MUI_INNERDIALOG_TEXT 1040 \"${MUI_LICENSEPAGE_TEXT_TOP}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n\n!macro MUI_FUNCTION_COMPONENTSPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    !ifdef UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME | UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME\n\n      !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_MINIMAL}&${UMUI_STANDARD}&${UMUI_COMPLETE}&${UMUI_COMPONENTSSET}\n\n        !ifdef UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME\n\n          ReadRegStr $MUI_TEMP1 ${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT} \"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME}\"\n          StrCmp $MUI_TEMP1 \"\" endis\n\n            ;search the ID of the saved InstType\n            ClearErrors\n            StrCpy $MUI_TEMP2 0\n            loopis:\n              InstTypeGetText $MUI_TEMP2 $UMUI_TEMP3\n              IfErrors endis\n                StrCmp $UMUI_TEMP3 $MUI_TEMP1 foundis\n                  IntOp $MUI_TEMP2 $MUI_TEMP2 + 1\n                  Goto loopis\n            foundis:\n              SetCurInstType $MUI_TEMP2\n              !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_COMPONENTSSET}\n          endis:\n          ClearErrors\n\n          ; IF page skipped save\n          GetCurInstType $MUI_TEMP1\n          InstTypeGetText $MUI_TEMP1 $MUI_TEMP2\n          StrCmp $MUI_TEMP1 \"32\" 0 +2\n            StrCpy $MUI_TEMP2 \"\"\n          !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT} \"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME}\" $MUI_TEMP2\n\n        !endif\n\n        !ifdef UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME\n\n          !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_COMPONENTSSET}\n\n            ReadRegStr $MUI_TEMP1 ${UMUI_COMPONENTSPAGE_REGISTRY_ROOT} \"${UMUI_COMPONENTSPAGE_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\"\n            StrCmp $MUI_TEMP1 \"\" End\n              ClearErrors\n              Call \"${MUI_PAGE_UNINSTALLER_FUNCPREFIX}umui_components\"\n              !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_COMPONENTSSET}\n            End:\n            ClearErrors\n\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n          ; IF page skipped save\n          StrCpy $MUI_TEMP1 \"save\"\n          !ifdef UMUI_PREUNINSTALL_FUNCTION\n            StrCpy $MUI_TEMP2 \"\"\n          !else\n            ReadRegStr $MUI_TEMP2 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\"\n            ClearErrors\n          !endif\n          Call \"${MUI_PAGE_UNINSTALLER_FUNCPREFIX}umui_components\"\n          !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_COMPONENTSPAGE_REGISTRY_ROOT} \"${UMUI_COMPONENTSPAGE_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\" $MUI_TEMP2\n\n        !endif\n\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n    !endif\n\n    ; IF setup cancelled or setuptype choosen\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MINIMAL}|${UMUI_STANDARD}|${UMUI_COMPLETE}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_COMPONENTS_SUBTITLE)\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro UMUI_UMUI_HIDEBACKBUTTON\n\n    !insertmacro UMUI_PAGEBGTRANSPARENT_INIT\n    !insertmacro UMUI_PAGEINPUTCTL_INIT 1017\n    !insertmacro UMUI_PAGEINPUTCTL_INIT 1032\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1022\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1021\n    !insertmacro UMUI_PAGECTL_INIT 1023\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1006\n    !insertmacro UMUI_PAGECTL_INIT 1043\n;    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1043\n    !insertmacro UMUI_PAGECTLLIGHT_INIT 1042\n\n    !insertmacro MUI_INNERDIALOG_TEXT 1042 \"${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE}\"\n\n    FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1043\n\n!ifndef USE_MUIEx\n;----------------\n    !ifndef UMUI_ENABLE_DESCRIPTION_TEXT\n      EnableWindow $MUI_TEMP1 0\n    !else\n      !insertmacro UMUI_PAGECTLLIGHT_INIT 1043\n;      !insertmacro UMUI_PAGECTLLIGHTTRANSPARENT_INIT 1043\n      EnableWindow $MUI_TEMP1 1\n    !endif\n!else\n;-----\n    EnableWindow $MUI_TEMP1 0\n!endif\n;-----\n\n    !insertmacro MUI_INNERDIALOG_TEXT 1043 \"${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}\"\n    StrCpy $MUI_TEXT \"${MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO}\"\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !ifdef UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME\n\n      GetCurInstType $MUI_TEMP1\n      InstTypeGetText $MUI_TEMP1 $MUI_TEMP2\n      StrCmp $MUI_TEMP1 \"32\" 0 +2\n        StrCpy $MUI_TEMP2 \"\"\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT} \"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME}\" $MUI_TEMP2\n\n    !endif\n\n    !ifdef UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME\n\n      StrCpy $MUI_TEMP1 \"save\"\n      !ifdef UMUI_PREUNINSTALL_FUNCTION\n        StrCpy $MUI_TEMP2 \"\"\n      !else\n        ReadRegStr $MUI_TEMP2 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\"\n        ClearErrors\n      !endif\n\n      Call \"${MUI_PAGE_UNINSTALLER_FUNCPREFIX}umui_components\"\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_COMPONENTSPAGE_REGISTRY_ROOT} \"${UMUI_COMPONENTSPAGE_REGISTRY_KEY}\" \"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\" $MUI_TEMP2\n\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro UMUI_DECLARECOMPONENTS_BEGIN\n  Function umui_components\n!macroend\n\n!macro UMUI_DECLAREUNCOMPONENTS_BEGIN\n  Function un.umui_components\n!macroend\n\n; TODO: Develop the version number comparison\n!macro UMUI_COMPONENT SEC\n\n  Push $0    ; len of \"${SEC}=\"\n  Push $1    ; temporary compare string\n  Push $2    ; characters to test\n  Push $3    ; Len to compare\n  Push $4    ; Counter\n\n  StrCmp $MUI_TEMP1 \"save\" 0 read${SEC}\n  ;Save choosen components\n    SectionGetFlags \"${${SEC}}\" $UMUI_TEMP3\n    IntOp $UMUI_TEMP3 $UMUI_TEMP3 & 1      ; 1 is ${SF_SELECTED}\n    StrCmp $UMUI_TEMP3 1 0 end${SEC}\n\n      ;delete \"${SEC}=*|\" from $MUI_TEMP2 if already in\n      StrLen $0 \"${SEC}=\"\n      StrCpy $2 $MUI_TEMP2\n      StrCpy $4 0\n\n      loops${SEC}:\n        StrCpy $1 $2 $0\n        StrLen $3 $2\n        IntCmp $3 $0 0 notfounds${SEC} 0\n          StrCmp $1 \"${SEC}=\" founds${SEC}\n            StrCpy $2 $2 \"\" 1\n            IntOp $4 $4 + 1\n            Goto loops${SEC}\n      founds${SEC}:\n        ;$0 the temporary new $MUI_TEMP2 string\n        StrCpy $0 $MUI_TEMP2 $4\n        loopsc${SEC}:\n          StrCpy $1 $2 1\n          StrCmp $1 \"|\" foundsc${SEC}\n            StrCpy $2 $2 \"\" 1\n            Goto loopsc${SEC}\n        foundsc${SEC}:\n          StrCpy $2 $2 \"\" 1\n          StrCpy $MUI_TEMP2 \"$0$2\"\n      notfounds${SEC}:\n        !ifdef UMUI_COMPONENT_VERSION\n          StrCpy $MUI_TEMP2 \"$MUI_TEMP2${SEC}=${VER}|\"\n        !else\n          StrCpy $MUI_TEMP2 \"$MUI_TEMP2${SEC}=|\"\n        !endif\n        Goto end${SEC}\n\n  ;Read choosen components\n  read${SEC}:\n\n    StrLen $0 \"${SEC}=\"\n    StrCpy $2 $MUI_TEMP1\n\n    loop${SEC}:\n      StrCpy $1 $2 $0\n      StrLen $3 $2\n      IntCmp $3 $0 0 notfound${SEC} 0\n        StrCmp $1 \"${SEC}=\" found${SEC}\n          StrCpy $2 $2 \"\" 1\n          Goto loop${SEC}\n\n    found${SEC}:\n      ; select component\n      SectionGetFlags \"${${SEC}}\" $0\n      IntOp $0 $0 | 1              ; 0x00000001 is ${SF_SELECTED}\n      SectionSetFlags \"${${SEC}}\" $0\n\n      Goto end${SEC}\n    notfound${SEC}:\n      ; unselect component\n      SectionGetFlags \"${${SEC}}\" $0\n      IntOp $0 $0 & 0xFFFFFFFE    ; 0xFFFFFFFE is ${SECTION_OFF}\n      SectionSetFlags \"${${SEC}}\" $0\n\n  end${SEC}:\n\n  Pop $4\n  Pop $3\n  Pop $2\n  Pop $1\n  Pop $0\n\n  !insertmacro MUI_UNSET UMUI_COMPONENT_VERSION\n\n!macroend\n\n!macro UMUI_DECLARECOMPONENTS_END\n  FunctionEnd\n!macroend\n\n!macro UMUI_DECLAREUNCOMPONENTS_END\n  FunctionEnd\n!macroend\n\n\n!macro MUI_FUNCTION_DIRECTORYPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled or setuptype choosen\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MINIMAL}|${UMUI_STANDARD}|${UMUI_COMPLETE}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_DIRECTORY_SUBTITLE)\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro UMUI_UMUI_HIDEBACKBUTTON\n\n    !insertmacro UMUI_PAGEBGTRANSPARENT_INIT\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1001\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1008\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1006\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1023\n    !insertmacro UMUI_PAGECTL_INIT 1024\n    !insertmacro UMUI_PAGECTLLIGHT_INIT 1020\n\n    !ifdef MUI_DIRECTORYPAGE_BGCOLOR\n      !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXTCOLOR \"\"\n      FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n      GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1019\n      SetCtlColors $MUI_TEMP1 \"${MUI_DIRECTORYPAGE_TEXTCOLOR}\" \"${MUI_DIRECTORYPAGE_BGCOLOR}\"\n    !else\n      !insertmacro UMUI_PAGEINPUTCTL_INIT 1019\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro MUI_FUNCTION_STARTMENUPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n      StrCmp \"${MUI_STARTMENUPAGE_VARIABLE}\" \"\" 0 +4\n\n        ReadRegStr $MUI_TEMP1 ${MUI_STARTMENUPAGE_REGISTRY_ROOT} \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n\n        StrCmp $MUI_TEMP1 \"\" +2\n          StrCpy \"${MUI_STARTMENUPAGE_VARIABLE}\" $MUI_TEMP1\n\n    !endif\n\n    ; IF setup cancelled or steuptype complete\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MINIMAL}|${UMUI_STANDARD}|${UMUI_COMPLETE}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro UMUI_UMUI_HIDEBACKBUTTON\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)\n\n    StrCmp $(^RTL) 0 mui.startmenu_nortl\n      !ifndef MUI_STARTMENUPAGE_NODISABLE\n         StartMenu::Init /rtl /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" /checknoshortcuts \"${MUI_STARTMENUPAGE_TEXT_CHECKBOX}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !else\n         StartMenu::Init /rtl /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n      !endif\n      Goto mui.startmenu_initdone\n    mui.startmenu_nortl:\n       !ifndef MUI_STARTMENUPAGE_NODISABLE\n         StartMenu::Init /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" /checknoshortcuts \"${MUI_STARTMENUPAGE_TEXT_CHECKBOX}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n       !else\n         StartMenu::Init /noicon /autoadd /text \"${MUI_STARTMENUPAGE_TEXT_TOP}\" /lastused \"${MUI_STARTMENUPAGE_VARIABLE}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n       !endif\n    mui.startmenu_initdone:\n\n    Pop $MUI_HWND\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n!ifndef USE_MUIEx\n;-----------------\n\n    !insertmacro UMUI_IOPAGEBG_INIT $MUI_HWND\n\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1003\n    !insertmacro UMUI_IOPAGECTL_INIT $MUI_TEMP1\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1005\n    !insertmacro UMUI_IOPAGECTL_INIT $MUI_TEMP1\n\n!endif\n;-----\n\n    !ifdef MUI_STARTMENUPAGE_BGCOLOR\n      !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXTCOLOR \"\"\n      GetDlgItem $MUI_TEMP1 $MUI_HWND 1002\n      SetCtlColors $MUI_TEMP1 \"${MUI_STARTMENUPAGE_TEXTCOLOR}\" \"${MUI_STARTMENUPAGE_BGCOLOR}\"\n      GetDlgItem $MUI_TEMP1 $MUI_HWND 1004\n      SetCtlColors $MUI_TEMP1 \"${MUI_STARTMENUPAGE_TEXTCOLOR}\" \"${MUI_STARTMENUPAGE_BGCOLOR}\"\n    !else\n      GetDlgItem $MUI_TEMP1 $MUI_HWND 1002\n      !insertmacro UMUI_IOPAGEINPUTCTL_INIT $MUI_TEMP1\n      GetDlgItem $MUI_TEMP1 $MUI_HWND 1004\n      !insertmacro UMUI_IOPAGEINPUTCTL_INIT $MUI_TEMP1\n    !endif\n\n    StartMenu::Show\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED\n\n    Pop $MUI_TEMP1\n    StrCmp $MUI_TEMP1 \"success\" 0 +2\n      Pop \"${MUI_STARTMENUPAGE_VARIABLE}\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${MUI_STARTMENUPAGE_REGISTRY_ROOT} \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\" \"${MUI_STARTMENUPAGE_VARIABLE}\"\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n\n!macro MUI_FUNCTION_INSTFILESPAGE PRE SHOW LEAVE\n\n  !ifdef UMUI_INSTFILEPAGE_ENABLE_CANCEL_BUTTON\n    !ifndef UMUI_NB_CALL_FUNCTION_CANCEL_DEFINED\n      !define UMUI_NB_CALL_FUNCTION_CANCEL_DEFINED\n      Var UMUI_NB_CALL_FUNCTION_CANCEL\n    !endif\n  !endif\n\n  Function \"${PRE}\"\n\n    ;IF setup is cancelled\n    !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n      SetAutoClose true\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_TITLE) $(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_SUBTITLE)\n\n    !ifdef UMUI_INSTALLDIR_REGISTRY_VALUENAME\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_INSTALLDIR_REGISTRY_ROOT} \"${UMUI_INSTALLDIR_REGISTRY_KEY}\" \"${UMUI_INSTALLDIR_REGISTRY_VALUENAME}\" $INSTDIR\n    !endif\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro UMUI_UMUI_HIDEBACKBUTTON\n\n    !insertmacro UMUI_PAGEBGTRANSPARENT_INIT\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1027\n    !insertmacro UMUI_PAGECTL_INIT 1006\n    !insertmacro UMUI_PAGECTLLIGHT_INIT 1004\n\n    !ifdef UMUI_INSTFILEPAGE_ENABLE_CANCEL_BUTTON\n      StrCpy $UMUI_NB_CALL_FUNCTION_CANCEL 0\n      GetDlgItem $MUI_TEMP1 $HWNDPARENT 2\n      EnableWindow $MUI_TEMP1 1\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    IfAbort 0 noabort\n      !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_CANCELLED}\n    noabort:\n\n    !ifdef UMUI_INSTFILEPAGE_ENABLE_CANCEL_BUTTON\n      !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n        StrCmp $UMUI_NB_CALL_FUNCTION_CANCEL 0 0 +3\n          StrCpy $UMUI_NB_CALL_FUNCTION_CANCEL 1\n          Call ${UMUI_INSTFILEPAGE_ENABLE_CANCEL_BUTTON}\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n    !endif\n\n    !insertmacro MUI_UNSET UMUI_INSTFILEPAGE_ENABLE_CANCEL_BUTTON\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !insertmacro UMUI_ADDSHELLVARCONTEXTTOSAVETOREGISTRY\n\n    ; Save paths\n    !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_CANCELLED}\n      StrCmp ${MUI_PAGE_UNINSTALLER_PREFIX} \"\" 0 endPathSave\n        !insertmacro UMUI_PATH_SAVE\n      endPathSave:\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n    ;Save all parameters\n    !insertmacro UMUI_SAVEPARAMSTOREGISTRY\n\n    !ifdef MUI_UNFINISHPAGE_NOAUTOCLOSE\n      !insertmacro MUI_ENDHEADER\n    !endif\n\n  FunctionEnd\n\n!ifndef USE_MUIEx\n;-----------------\n\n  ;This is a workaround for the background of the progress bar that wasn't drawn properly with background image\n  !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n    !ifndef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}SECTION_WORKAROUND_INSERTED\n      !define UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}SECTION_WORKAROUND_INSERTED\n\n      Section \"${MUI_PAGE_UNINSTALLER_FUNCPREFIX}\"\n        SetDetailsPrint none\n\n        FindWindow $MUI_TEMP1 \"#32770\" \"\" $HWNDPARENT\n        GetDlgItem $MUI_TEMP1 $MUI_TEMP1 1004\n\n        System::Call \"user32::InvalidateRect(i,i,i)i ($MUI_TEMP1, 0, 1)\"\n\n        SetDetailsPrint both\n      SectionEnd\n\n    !endif\n  !endif\n\n!endif\n;-----------------\n\n  !ifndef MUI_UNINSTALLER\n    !ifdef UMUI_PREUNINSTALL_FUNCTION\n\n      !ifndef UMUI_SECTION_PREUNINSTALL\n        !define UMUI_SECTION_PREUNINSTALL\n\n        Section \"\"\n          ClearErrors\n          IfFileExists $INSTDIR 0 end\n\n            Call \"${UMUI_PREUNINSTALL_FUNCTION}\"\n\n          end:\n          ClearErrors\n        SectionEnd\n\n      !endif\n\n    !endif\n  !endif\n\n!macroend\n\n!macro MUI_FUNCTION_FINISHPAGE PRE LEAVE\n\n  !ifndef UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n    !define UMUI_INTERNAL_FNUMFIELDS_3ADDITIONALCONTROLS 5\n    !define UMUI_INTERNAL_FNUMFIELDS_2ADDITIONALCONTROLS 4\n    !define UMUI_INTERNAL_FNUMFIELDS_1ADDITIONALCONTROLS 3\n    !define UMUI_INTERNAL_FIELDTITLE 1\n    !define UMUI_INTERNAL_FIELDTEXT 2\n    !define UMUI_INTERNAL_FIELDTHIRD 3\n    !define UMUI_INTERNAL_FIELDFOURTH 4\n    !define UMUI_INTERNAL_FIELDFIFTH 5\n    !define UMUI_INTERNAL_FIDTITLE 1200\n    !define UMUI_INTERNAL_FIDTEXT 1201\n    !define UMUI_INTERNAL_FIDTHIRD 1202\n    !define UMUI_INTERNAL_FIDFOURTH 1203\n    !define UMUI_INTERNAL_FIDFIFTH 1204\n    !define UMUI_INTERNAL_FPOSLINKLEFT 22\n    !define UMUI_INTERNAL_FOPTIONCHECKLEFT 26\n  !else\n    !define UMUI_INTERNAL_FNUMFIELDS_3ADDITIONALCONTROLS 6\n    !define UMUI_INTERNAL_FNUMFIELDS_2ADDITIONALCONTROLS 5\n    !define UMUI_INTERNAL_FNUMFIELDS_1ADDITIONALCONTROLS 4\n    !define UMUI_INTERNAL_FIELDTITLE 2\n    !define UMUI_INTERNAL_FIELDTEXT 3\n    !define UMUI_INTERNAL_FIELDTHIRD 4\n    !define UMUI_INTERNAL_FIELDFOURTH 5\n    !define UMUI_INTERNAL_FIELDFIFTH 6\n    !define UMUI_INTERNAL_FIDTITLE 1201\n    !define UMUI_INTERNAL_FIDTEXT 1202\n    !define UMUI_INTERNAL_FIDTHIRD 1203\n    !define UMUI_INTERNAL_FIDFOURTH 1204\n    !define UMUI_INTERNAL_FIDFIFTH 1205\n    !define UMUI_INTERNAL_FPOSLINKLEFT 130\n    !define UMUI_INTERNAL_FOPTIONCHECKLEFT 134\n  !endif\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"\" \"\"\n\n    !insertmacro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM\n\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"NextButtonText\" \"${MUI_FINISHPAGE_BUTTON}\"\n\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"CancelEnabled\" \"1\"\n    !endif\n\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTITLE}\" \"Text\" \"MUI_FINISHPAGE_TITLE\"\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n      !ifndef MUI_FINISHPAGE_TITLE_3LINES\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTITLE}\" \"Bottom\" \"38\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Top\" \"45\"\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTITLE}\" \"Bottom\" \"48\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Top\" \"55\"\n      !endif\n    !endif\n\n    !ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n      !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"85\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"115\"\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"95\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"125\"\n          !endif\n        !endif\n      !else\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"124\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"139\"\n        !endif\n      !endif\n    !else\n      !ifndef MUI_FINISHPAGE_LINK\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"-1\"\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"-15\"\n      !endif\n    !endif\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      IfRebootFlag 0 mui.finish_noreboot_init\n\n      !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"85\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"115\"\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"95\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"125\"\n          !endif\n        !endif\n      !else\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"124\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Bottom\" \"151\"\n        !endif\n      !endif\n\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Text\" \"MUI_FINISHPAGE_TEXT_REBOOT\"\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"${UMUI_INTERNAL_FNUMFIELDS_2ADDITIONALCONTROLS}\"\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Type\" \"RadioButton\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Text\" \"MUI_FINISHPAGE_TEXT_REBOOTNOW\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Left\" \"${UMUI_INTERNAL_FOPTIONCHECKLEFT}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Right\" \"-15\"\n\n      !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"90\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"100\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"120\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"130\"\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"100\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"110\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"130\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"140\"\n          !endif\n        !endif\n      !else\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"129\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"139\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"159\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"169\"\n        !endif\n      !endif\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Type\" \"RadioButton\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Text\" \"MUI_FINISHPAGE_TEXT_REBOOTLATER\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Left\" \"${UMUI_INTERNAL_FOPTIONCHECKLEFT}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Right\" \"-15\"\n\n      !ifdef MUI_FINISHPAGE_REBOOTLATER_DEFAULT\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"State\" \"0\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"State\" \"1\"\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"State\" \"1\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"State\" \"0\"\n      !endif\n\n      !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Top\" \"110\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Bottom\" \"120\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Top\" \"110\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Bottom\" \"120\"\n        !endif\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Top\" \"149\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"Bottom\" \"159\"\n      !endif\n\n        Goto mui.finish_load\n\n      mui.finish_noreboot_init:\n\n    !endif\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTEXT}\" \"Text\" \"MUI_FINISHPAGE_TEXT\"\n\n    !ifdef MUI_FINISHPAGE_RUN\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Type\" \"CheckBox\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Text\" \"MUI_FINISHPAGE_RUN_TEXT\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Left\" \"${UMUI_INTERNAL_FOPTIONCHECKLEFT}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Right\" \"-15\"\n\n      !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n        !ifndef MUI_FINISHPAGE_TITLE_3LINES\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"90\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"100\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"120\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"130\"\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"100\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"110\"\n          !else\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"130\"\n            !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"140\"\n          !endif\n        !endif\n      !else\n        !ifndef MUI_FINISHPAGE_TEXT_LARGE\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"129\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"139\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Top\" \"139\"\n          !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"Bottom\" \"149\"\n        !endif\n      !endif\n\n      !ifndef MUI_FINISHPAGE_RUN_NOTCHECKED\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"State\" \"1\"\n      !endif\n\n    !endif\n\n\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n\n      !ifdef MUI_FINISHPAGE_CURFIELD_NO\n        !undef MUI_FINISHPAGE_CURFIELD_NO\n      !endif\n\n      !ifndef MUI_FINISHPAGE_RUN\n        !define MUI_FINISHPAGE_CURFIELD_NO ${UMUI_INTERNAL_FIELDTHIRD}\n\n        !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n          !ifndef MUI_FINISHPAGE_TITLE_3LINES\n            !ifndef MUI_FINISHPAGE_TEXT_LARGE\n              !define MUI_FINISHPAGE_CURFIELD_TOP 90\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 100\n            !else\n              !define MUI_FINISHPAGE_CURFIELD_TOP 120\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 130\n            !endif\n          !else\n            !ifndef MUI_FINISHPAGE_TEXT_LARGE\n              !define MUI_FINISHPAGE_CURFIELD_TOP 100\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 110\n            !else\n              !define MUI_FINISHPAGE_CURFIELD_TOP 130\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 140\n            !endif\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !define MUI_FINISHPAGE_CURFIELD_TOP 144\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 159\n          !else\n            !define MUI_FINISHPAGE_CURFIELD_TOP 174\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 189\n          !endif\n        !endif\n      ; finishpagerun\n      !else\n        !define MUI_FINISHPAGE_CURFIELD_NO ${UMUI_INTERNAL_FIELDFOURTH}\n\n        !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n          !ifndef MUI_FINISHPAGE_TITLE_3LINES\n            !ifndef MUI_FINISHPAGE_TEXT_LARGE\n              !define MUI_FINISHPAGE_CURFIELD_TOP 110\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 120\n            !else\n              !define MUI_FINISHPAGE_CURFIELD_TOP 140\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 150\n            !endif\n          !else\n            !ifndef MUI_FINISHPAGE_TEXT_LARGE\n              !define MUI_FINISHPAGE_CURFIELD_TOP 120\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 130\n            !else\n              !define MUI_FINISHPAGE_CURFIELD_TOP 150\n              !define MUI_FINISHPAGE_CURFIELD_BOTTOM 160\n            !endif\n          !endif\n        !else\n          !ifndef MUI_FINISHPAGE_TEXT_LARGE\n            !define MUI_FINISHPAGE_CURFIELD_TOP 150\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 160\n          !else\n            !define MUI_FINISHPAGE_CURFIELD_TOP 160\n            !define MUI_FINISHPAGE_CURFIELD_BOTTOM 170\n          !endif\n        !endif\n      !endif\n\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Type\" \"CheckBox\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Text\" \"MUI_FINISHPAGE_SHOWREADME_TEXT\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Left\" \"${UMUI_INTERNAL_FOPTIONCHECKLEFT}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Right\" \"-15\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Top\" \"${MUI_FINISHPAGE_CURFIELD_TOP}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Bottom\" \"${MUI_FINISHPAGE_CURFIELD_BOTTOM}\"\n      !ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\n         !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"State\" \"1\"\n      !endif\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_LINK\n\n      !ifdef MUI_FINISHPAGE_CURFIELD_NO\n        !undef MUI_FINISHPAGE_CURFIELD_NO\n      !endif\n\n      !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n        !define MUI_FINISHPAGE_CURFIELD_NO ${UMUI_INTERNAL_FIELDFIFTH}\n      !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n        !define MUI_FINISHPAGE_CURFIELD_NO ${UMUI_INTERNAL_FIELDFOURTH}\n      !else\n        !define MUI_FINISHPAGE_CURFIELD_NO ${UMUI_INTERNAL_FIELDTHIRD}\n      !endif\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Type\" \"Link\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Text\" \"MUI_FINISHPAGE_LINK\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Left\" \"${UMUI_INTERNAL_FPOSLINKLEFT}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Right\" \"-15\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Top\" \"-14\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"Bottom\" \"-5\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${MUI_FINISHPAGE_CURFIELD_NO}\" \"State\" \"MUI_FINISHPAGE_LINK_LOCATION\"\n\n    !endif\n\n\n    !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME & MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"${UMUI_INTERNAL_FNUMFIELDS_3ADDITIONALCONTROLS}\"\n    !else ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"${UMUI_INTERNAL_FNUMFIELDS_2ADDITIONALCONTROLS}\"\n    !else ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"${UMUI_INTERNAL_FNUMFIELDS_2ADDITIONALCONTROLS}\"\n    !else ifdef MUI_FINISHPAGE_SHOWREADME & MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"${UMUI_INTERNAL_FNUMFIELDS_2ADDITIONALCONTROLS}\"\n    !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME | MUI_FINISHPAGE_LINK\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"Numfields\" \"${UMUI_INTERNAL_FNUMFIELDS_1ADDITIONALCONTROLS}\"\n    !endif\n\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n       mui.finish_load:\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    LockWindow off\n\n\n    !insertmacro INSTALLOPTIONS_INITDIALOG \"ioSpecial.ini\"\n    Pop $MUI_HWND\n\n    !insertmacro UMUI_WFAPAGEBGTRANSPARENT_INIT $MUI_HWND\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTITLE}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      CreateFont $MUI_TEMP2 \"$(^Font)\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !else\n\n      ;alternate page\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTITLE}\n      CreateFont $MUI_TEMP2 \"MS Sans Serif\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 $MUI_TEMP2\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !endif\n\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      IfRebootFlag 0 mui.finish_noreboot_show\n\n        GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTHIRD}\n        !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n        GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDFOURTH}\n        !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n        Goto mui.finish_show\n\n      mui.finish_noreboot_show:\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_RUN\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTHIRD}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n    !endif\n\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n      !ifndef MUI_FINISHPAGE_RUN\n        GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTHIRD}\n      !else\n        GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDFOURTH}\n      !endif\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n    !endif\n\n    !ifdef MUI_FINISHPAGE_LINK\n      !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n        GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDFIFTH}\n      !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n        GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDFOURTH}\n      !else\n        GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTHIRD}\n      !endif\n\n      !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n        SetCtlColors $MUI_TEMP1 \"${MUI_FINISHPAGE_LINK_COLOR}\" \"transparent\"\n      !else\n        SetCtlColors $MUI_TEMP1 \"${MUI_FINISHPAGE_LINK_COLOR}\" \"${MUI_BGCOLOR}\"\n      !endif\n\n    !endif\n\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n      mui.finish_show:\n    !endif\n\n    !if \"${UMUI_XPSTYLE}\" == \"On\"\n      !ifndef MUI_FORCECLASSICCONTROLS\n        ${If} ${IsHighContrastModeActive}\n      !endif\n        ; SetCtlColors does not change the check/radio text color (bug #443)\n        !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n          GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTHIRD}\n          System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n          GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDFOURTH}\n          System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n        !else ifdef MUI_FINISHPAGE_RUN | MUI_FINISHPAGE_SHOWREADME\n          GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDTHIRD}\n          System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n          !ifdef MUI_FINISHPAGE_RUN & MUI_FINISHPAGE_SHOWREADME\n            GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_FIDFOURTH}\n            System::Call 'UXTHEME::SetWindowTheme(p$MUI_TEMP1,w\" \",w\" \")'\n          !endif\n        !endif\n      !ifndef MUI_FORCECLASSICCONTROLS\n        ${EndIf}\n      !endif\n    !endif\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 3\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 2\n    EnableWindow $MUI_TEMP1 0\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      StrCpy $MUI_NOABORTWARNING \"1\"\n    !endif\n\n    !insertmacro INSTALLOPTIONS_SHOW\n\n    !ifdef MUI_FINISHPAGE_CANCEL_ENABLED\n      StrCpy $MUI_NOABORTWARNING \"\"\n    !endif\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    LockWindow off\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n      IfRebootFlag \"\" mui.finish_noreboot_end\n\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"State\"\n\n          StrCmp $MUI_TEMP1 \"1\" 0 +2\n            Reboot\n\n          Return\n\n      mui.finish_noreboot_end:\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_RUN\n\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"State\"\n\n      StrCmp $MUI_TEMP1 \"1\" 0 mui.finish_norun\n        !ifndef MUI_FINISHPAGE_RUN_FUNCTION\n          !ifndef MUI_FINISHPAGE_RUN_PARAMETERS\n            StrCpy $MUI_TEMP1 \"$\\\"${MUI_FINISHPAGE_RUN}$\\\"\"\n          !else\n            StrCpy $MUI_TEMP1 \"$\\\"${MUI_FINISHPAGE_RUN}$\\\" ${MUI_FINISHPAGE_RUN_PARAMETERS}\"\n          !endif\n          Exec \"$MUI_TEMP1\"\n        !else\n          Call \"${MUI_FINISHPAGE_RUN_FUNCTION}\"\n        !endif\n\n        mui.finish_norun:\n\n    !endif\n\n    !ifdef MUI_FINISHPAGE_SHOWREADME\n\n      !ifndef MUI_FINISHPAGE_RUN\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDTHIRD}\" \"State\"\n      !else\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_FIELDFOURTH}\" \"State\"\n      !endif\n\n      StrCmp $MUI_TEMP1 \"1\" 0 mui.finish_noshowreadme\n        !ifndef MUI_FINISHPAGE_SHOWREADME_FUNCTION\n           ExecShell \"open\" \"${MUI_FINISHPAGE_SHOWREADME}\"\n        !else\n          Call \"${MUI_FINISHPAGE_SHOWREADME_FUNCTION}\"\n        !endif\n\n        mui.finish_noshowreadme:\n\n    !endif\n\n  FunctionEnd\n\n  !undef UMUI_INTERNAL_FNUMFIELDS_3ADDITIONALCONTROLS\n  !undef UMUI_INTERNAL_FNUMFIELDS_2ADDITIONALCONTROLS\n  !undef UMUI_INTERNAL_FNUMFIELDS_1ADDITIONALCONTROLS\n  !undef UMUI_INTERNAL_FIELDTITLE\n  !undef UMUI_INTERNAL_FIELDTEXT\n  !undef UMUI_INTERNAL_FIELDTHIRD\n  !undef UMUI_INTERNAL_FIELDFOURTH\n  !undef UMUI_INTERNAL_FIELDFIFTH\n  !undef UMUI_INTERNAL_FIDTITLE\n  !undef UMUI_INTERNAL_FIDTEXT\n  !undef UMUI_INTERNAL_FIDTHIRD\n  !undef UMUI_INTERNAL_FIDFOURTH\n  !undef UMUI_INTERNAL_FIDFIFTH\n  !undef UMUI_INTERNAL_FPOSLINKLEFT\n  !undef UMUI_INTERNAL_FOPTIONCHECKLEFT\n\n!macroend\n\n!macro MUI_UNFUNCTION_CONFIRMPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_UNTEXT_CONFIRM_TITLE) $(MUI_UNTEXT_CONFIRM_SUBTITLE)\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro UMUI_PAGEBGTRANSPARENT_INIT\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1029\n    !insertmacro UMUI_PAGECTLLIGHT_INIT 1000\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1006\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n\n\n\n; ========================\n;   New UltraModern page\n; ========================\n\n\n\n!macro UMUI_PAGE_MULTILANGUAGE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}MULTILANGUAGEPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MULTILANGUAGEPAGE_TITLE \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_MULTILANGUAGE_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MULTILANGUAGEPAGE_TEXT \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_MULTILANGUAGE_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MULTILANGUAGEPAGE_LANGUAGE \"$(UMUI_TEXT_MULTILANGUAGE_LANGUAGE)\"\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  !ifndef UMUI_VAR_LANGLIST\n    Var UMUI_LANGLIST\n    !define UMUI_VAR_LANGLIST\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP3\n    Var UMUI_TEMP3\n    !define UMUI_VAR_UMUI_TEMP3\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.MultiLanguagePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.MultiLanguageLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_MULTILANGUAGEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.MultiLanguagePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.MultiLanguageLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET UMUI_MULTILANGUAGEPAGE_TITLE\n  !insertmacro MUI_UNSET UMUI_MULTILANGUAGEPAGE_TEXT\n  !insertmacro MUI_UNSET UMUI_MULTILANGUAGEPAGE_LANGUAGE\n  !insertmacro MUI_UNSET UMUI_MULTILANGUAGEPAGE_TITLE_3LINES\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_UNPAGE_MULTILANGUAGE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_MULTILANGUAGE\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_FUNCTION_MULTILANGUAGEPAGE PRE LEAVE\n\n  !ifndef UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n    !define UMUI_INTERNAL_MNUMFIELDS 4\n    !define UMUI_INTERNAL_MFIELDTITLE 1\n    !define UMUI_INTERNAL_MFIELDTEXT 2\n    !define UMUI_INTERNAL_MFIELDGROUPBOX 3\n    !define UMUI_INTERNAL_MFIELDDROPDOWN 4\n    !define UMUI_INTERNAL_MIDTITLE 1200\n    !define UMUI_INTERNAL_MIDTEXT 1201\n    !define UMUI_INTERNAL_MIDGROUPBOX 1202\n    !define UMUI_INTERNAL_MIDDROPDOWN 1203\n    !define UMUI_INTERNAL_MPOSGROUPBOXLEFT 75\n    !define UMUI_INTERNAL_MPOSGROUPBOXRIGHT -75\n    !define UMUI_INTERNAL_MPOSDROPDOWNLEFT 105\n    !define UMUI_INTERNAL_MPOSDROPDOWNRIGHT -105\n  !else\n    !define UMUI_INTERNAL_MNUMFIELDS 5\n    !define UMUI_INTERNAL_MFIELDTITLE 2\n    !define UMUI_INTERNAL_MFIELDTEXT 3\n    !define UMUI_INTERNAL_MFIELDGROUPBOX 4\n    !define UMUI_INTERNAL_MFIELDDROPDOWN 5\n    !define UMUI_INTERNAL_MIDTITLE 1201\n    !define UMUI_INTERNAL_MIDTEXT 1202\n    !define UMUI_INTERNAL_MIDGROUPBOX 1203\n    !define UMUI_INTERNAL_MIDDROPDOWN 1204\n    !define UMUI_INTERNAL_MPOSGROUPBOXLEFT 140\n    !define UMUI_INTERNAL_MPOSGROUPBOXRIGHT -30\n    !define UMUI_INTERNAL_MPOSDROPDOWNLEFT 170\n    !define UMUI_INTERNAL_MPOSDROPDOWNRIGHT -60\n  !endif\n\n  !define /IfNDef UMUI_HIDENEXTBACKBUTTON\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_LANGISSET}\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"\" \"\"\n\n    ; save the old language id\n    StrCpy $UMUI_TEMP3 $LANGUAGE\n\n    StrCmp $UMUI_LANGLIST \"\" 0 +2\n      MessageBox MB_OK|MB_ICONSTOP \"Ultra-Modern UI error: You have forgotten to insert the UMUI_MULTILANG_GET macro in your ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}.oninit function.\"\n\n    ClearErrors\n    ; Get the current language id\n    nsArray::Get LangMap $LANGUAGE\n    Pop $MUI_TEMP1\n\n    ;if don't exist\n    IfErrors 0 foundLang\n\n      ;search for english\n      nsArray::Get LangMap \"1033\"\n      Pop $MUI_TEMP1\n\n      ;if don't exist\n      IfErrors 0 foundLang\n\n        ;english an system language was not been inserted\n        StrCpy $MUI_TEMP1 \"\"\n\n    foundLang:\n\n    CopyFiles /SILENT \"$PLUGINSDIR\\ioSpecial.ini\" \"$PLUGINSDIR\\MultiLanguage.ini\"\n\n\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Settings\" \"NumFields\" \"${UMUI_INTERNAL_MNUMFIELDS}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Settings\" \"NextButtonText\" \"\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Settings\" \"CancelEnabled\" \"\"\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDTITLE}\" \"Text\" \"UMUI_MULTILANGUAGEPAGE_TITLE\"\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n      !ifndef UMUI_MULTILANGUAGEPAGE_TITLE_3LINES\n        !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDTITLE}\" \"Bottom\" \"55\"\n        !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDTEXT}\" \"Top\" \"62\"\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDTITLE}\" \"Bottom\" \"62\"\n        !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDTEXT}\" \"Top\" \"69\"\n      !endif\n    !endif\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDTEXT}\" \"Text\" \"UMUI_MULTILANGUAGEPAGE_TEXT\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDTEXT}\" \"Bottom\" \"120\"\n\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDGROUPBOX}\" \"Type\" \"GroupBox\"\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDGROUPBOX}\" \"Text\" \"UMUI_MULTILANGUAGEPAGE_LANGUAGE\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDGROUPBOX}\" \"Left\" \"${UMUI_INTERNAL_MPOSGROUPBOXLEFT}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDGROUPBOX}\" \"Right\" \"${UMUI_INTERNAL_MPOSGROUPBOXRIGHT}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDGROUPBOX}\" \"Top\" \"120\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDGROUPBOX}\" \"Bottom\" \"160\"\n\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"Type\" \"DropList\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"ListItems\" \"$UMUI_LANGLIST\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"State\" $MUI_TEMP1\n\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"Left\" \"${UMUI_INTERNAL_MPOSDROPDOWNLEFT}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"Right\" \"${UMUI_INTERNAL_MPOSDROPDOWNRIGHT}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"Top\" \"135\"\n    !insertmacro INSTALLOPTIONS_WRITE \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"Bottom\" \"-1\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    LockWindow off\n\n\n    !insertmacro INSTALLOPTIONS_INITDIALOG \"MultiLanguage.ini\"\n    Pop $MUI_HWND\n\n    !insertmacro UMUI_WFAPAGEBGTRANSPARENT_INIT $MUI_HWND\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_MIDTITLE}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      CreateFont $MUI_TEMP2 \"$(^Font)\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_MIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !else\n\n      ;alternate page\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_MIDTITLE}\n      CreateFont $MUI_TEMP2 \"MS Sans Serif\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 $MUI_TEMP2\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_MIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !endif\n\n\n    GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_MIDGROUPBOX}\n    !insertmacro UMUI_IOPAGECTLLIGHT_INIT $MUI_TEMP1\n    GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_MIDDROPDOWN}\n    !insertmacro UMUI_IOPAGEINPUTCTL_INIT $MUI_TEMP1\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_SHOW\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    LockWindow off\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_CANCELLED}\n\n      !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n      ; Get the choosed language name\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"MultiLanguage.ini\" \"Field ${UMUI_INTERNAL_MFIELDDROPDOWN}\" \"State\"\n\n      ;Search key of selcted value\n      ClearErrors\n      langLoop:\n        nsArray::Iterate LangMap\n        Pop $LANGUAGE\n        Pop $MUI_TEMP2\n         StrCmp $MUI_TEMP1 $MUI_TEMP2 +2 0\n          IfErrors 0 langLoop\n\n      nsArray::Clear LangMap\n\n      ; if we choose the same language\n      StrCmp $UMUI_TEMP3 $LANGUAGE 0 reloadinstall\n\n        !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_LANGISSET}\n\n        !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n          !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_LANGUAGE_REGISTRY_ROOT} \"${UMUI_LANGUAGE_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\" \"$LANGUAGE\"\n        !endif\n\n        Goto end\n      reloadinstall:\n\n        ;Recall this programm and quit\n        !insertmacro UMUI_GET_PARAMETERS\n        Pop $MUI_TEMP2\n\n        !insertmacro UMUI_DELETE_PLUGINDIR\n        HideWindow\n\n        !ifndef MUI_UNINSTALLER\n          ExecWait \"$EXEPATH $MUI_TEMP2 /L=$LANGUAGE /NCRC\"\n        !else\n          ExecWait \"$EXEPATH $MUI_TEMP2 /L=$LANGUAGE _?=$INSTDIR\"\n        !endif\n        Quit\n\n      end:\n\n\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n  FunctionEnd\n\n  !undef UMUI_INTERNAL_MNUMFIELDS\n  !undef UMUI_INTERNAL_MFIELDTITLE\n  !undef UMUI_INTERNAL_MFIELDTEXT\n  !undef UMUI_INTERNAL_MFIELDGROUPBOX\n  !undef UMUI_INTERNAL_MFIELDDROPDOWN\n  !undef UMUI_INTERNAL_MIDTITLE\n  !undef UMUI_INTERNAL_MIDTEXT\n  !undef UMUI_INTERNAL_MIDGROUPBOX\n  !undef UMUI_INTERNAL_MIDDROPDOWN\n  !undef UMUI_INTERNAL_MPOSGROUPBOXLEFT\n  !undef UMUI_INTERNAL_MPOSGROUPBOXRIGHT\n  !undef UMUI_INTERNAL_MPOSDROPDOWNLEFT\n  !undef UMUI_INTERNAL_MPOSDROPDOWNRIGHT\n\n!macroend\n\n\n!macro UMUI_PAGE_CONFIRM\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}CONFIRMPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_CONFIRMPAGE_TEXT_TOP \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTCONFIRM_TEXT_TOP)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_CONFIRMPAGE_TEXT_BOTTOM \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_TITLE)\"\n\n  !ifdef UMUI_CONFIRMPAGE_TEXTBOX\n    !ifndef UMUI_VAR_UMUI_TEMP3\n      Var UMUI_TEMP3\n      !define UMUI_VAR_UMUI_TEMP3\n    !endif\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ConfirmPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ConfirmLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_CONFIRMPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ConfirmPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ConfirmLeave_${MUI_UNIQUEID}\n\n  !undef UMUI_CONFIRMPAGE_TEXT_TOP\n  !undef UMUI_CONFIRMPAGE_TEXT_BOTTOM\n\n  !insertmacro MUI_UNSET UMUI_CONFIRMPAGE_TEXTBOX\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_UNPAGE_CONFIRM\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_CONFIRM\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_FUNCTION_CONFIRMPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n    !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_CONFIRMPAGE_INI}\" \"Confirm.ini\"\n\n    ; Bodenseematze-2016-09-15: missing PRE-Function support added:\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTCONFIRM_TITLE)\" \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INSTCONFIRM_SUBTITLE)\"\n\n    !ifdef UMUI_CONFIRMPAGE_TEXTBOX\n      FlushINI \"$PLUGINSDIR\\Confirm.ini\"\n\n      FileOpen $MUI_TEMP2 \"$PLUGINSDIR\\Confirm.ini\" a\n      !ifdef NSIS_UNICODE\n        FileSeek $MUI_TEMP2 -4 END\n      !else\n        FileSeek $MUI_TEMP2 -2 END\n      !endif\n\n      Call \"${UMUI_CONFIRMPAGE_TEXTBOX}\"\n\n      FileClose $MUI_TEMP2\n\n      !insertmacro INSTALLOPTIONS_WRITE \"Confirm.ini\" \"Settings\" NumFields \"3\"\n\n    !endif\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Confirm.ini\" \"Field 1\" \"Text\" \"UMUI_CONFIRMPAGE_TEXT_TOP\"\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Confirm.ini\" \"Field 2\" \"Text\" \"UMUI_CONFIRMPAGE_TEXT_BOTTOM\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY \"Confirm.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE STR\n\n  StrCpy $UMUI_TEMP3 \"${STR}\"\n\n  !insertmacro UMUI_STRREPLACE $UMUI_TEMP3 \"\\\" \"\\\\\" $UMUI_TEMP3\n\n  !ifdef NSIS_UNICODE\n    FileWriteUTF16LE $MUI_TEMP2 \"$UMUI_TEMP3\\r\\n\"\n  !else\n    FileWrite $MUI_TEMP2 \"$UMUI_TEMP3\\r\\n\"\n  !endif\n\n  ClearErrors\n\n!macroend\n\n\n\n\n\n\n\n!macro UMUI_PAGE_ABORT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}ABORTPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_ABORTPAGE_TITLE \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_INFO_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_ABORTPAGE_TEXT \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ABORT_INFO_TEXT)\"\n\n  !define /IfNDef UMUI_ABORTPAGE_LINK_COLOR \"${UMUI_TEXT_LIGHTCOLOR}\"\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ABORTPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ABORTLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_ABORTPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ABORTPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ABORTLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET UMUI_ABORTPAGE_TITLE\n  !insertmacro MUI_UNSET UMUI_ABORTPAGE_TITLE_3LINES\n  !insertmacro MUI_UNSET UMUI_ABORTPAGE_TEXT\n  !insertmacro MUI_UNSET UMUI_ABORTPAGE_LINK\n  !insertmacro MUI_UNSET UMUI_ABORTPAGE_LINK_LOCATION\n  !insertmacro MUI_UNSET UMUI_ABORTPAGE_LINK_COLOR\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_UNPAGE_ABORT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_ABORT\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_FUNCTION_ABORTPAGE PRE LEAVE\n\n  !ifndef UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n    !define UMUI_INTERNAL_ANUMFIELDS 2\n    !define UMUI_INTERNAL_ANUMFIELDSLINK 3\n    !define UMUI_INTERNAL_AFIELDTITLE 1\n    !define UMUI_INTERNAL_AFIELDTEXT 2\n    !define UMUI_INTERNAL_AFIELDLINK 3\n    !define UMUI_INTERNAL_AIDTITLE 1200\n    !define UMUI_INTERNAL_AIDTEXT 1201\n    !define UMUI_INTERNAL_AIDLINK 1202\n    !define UMUI_INTERNAL_APOSLINKLEFT 22\n  !else\n    !define UMUI_INTERNAL_ANUMFIELDS 3\n    !define UMUI_INTERNAL_ANUMFIELDSLINK 4\n    !define UMUI_INTERNAL_AFIELDTITLE 2\n    !define UMUI_INTERNAL_AFIELDTEXT 3\n    !define UMUI_INTERNAL_AFIELDLINK 4\n    !define UMUI_INTERNAL_AIDTITLE 1201\n    !define UMUI_INTERNAL_AIDTEXT 1202\n    !define UMUI_INTERNAL_AIDLINK 1203\n    !define UMUI_INTERNAL_APOSLINKLEFT 130\n  !endif\n\n  Function \"${PRE}\"\n\n    ;If setup is not cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_ISNOT ${UMUI_CANCELLED}\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"\" \"\"\n\n    !insertmacro MUI_WELCOMEFINISHPAGE_FUNCTION_CUSTOM\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\"  \"Settings\" NextButtonText \"$(^CloseBtn)\"\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Settings\" \"NumFields\" \"${UMUI_INTERNAL_ANUMFIELDS}\"\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\"  \"Field ${UMUI_INTERNAL_AFIELDTITLE}\" \"Text\" \"UMUI_ABORTPAGE_TITLE\"\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n      !ifndef UMUI_ABORTPAGE_TITLE_3LINES\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDTITLE}\" \"Bottom\" \"55\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDTEXT}\" \"Top\" \"62\"\n      !else\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDTITLE}\" \"Bottom\" \"62\"\n        !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDTEXT}\" \"Top\" \"69\"\n      !endif\n    !endif\n\n    !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDTEXT}\" \"Bottom\" \"-15\"\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDTEXT}\" \"Text\" \"UMUI_ABORTPAGE_TEXT\"\n\n    !ifdef UMUI_ABORTPAGE_LINK\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\"  \"Settings\" NumFields \"${UMUI_INTERNAL_ANUMFIELDSLINK}\"\n\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDLINK}\" \"Type\" \"Link\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDLINK}\" \"Text\" \"UMUI_ABORTPAGE_LINK\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDLINK}\" \"Left\" \"${UMUI_INTERNAL_APOSLINKLEFT}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDLINK}\" \"Right\" \"-15\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDLINK}\" \"Top\" \"-14\"\n      !insertmacro INSTALLOPTIONS_WRITE \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDLINK}\" \"Bottom\" \"-5\"\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"ioSpecial.ini\" \"Field ${UMUI_INTERNAL_AFIELDLINK}\" \"State\" \"UMUI_ABORTPAGE_LINK_LOCATION\"\n\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    LockWindow off\n\n\n    !insertmacro INSTALLOPTIONS_INITDIALOG \"ioSpecial.ini\"\n    Pop $MUI_HWND\n\n    !insertmacro UMUI_WFAPAGEBGTRANSPARENT_INIT $MUI_HWND\n\n    !ifndef UMUI_USE_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATE_PAGE\n\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_AIDTITLE}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      CreateFont $MUI_TEMP2 \"$(^Font)\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 0\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_AIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !else\n\n      ;alternate page\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_AIDTITLE}\n      CreateFont $MUI_TEMP2 \"MS Sans Serif\" \"${UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE}\" \"700\"\n      SendMessage $MUI_TEMP1 ${WM_SETFONT} $MUI_TEMP2 $MUI_TEMP2\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_AIDTEXT}\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP1\n\n    !endif\n\n\n    !ifdef UMUI_ABORTPAGE_LINK\n      GetDlgItem $MUI_TEMP1 $MUI_HWND ${UMUI_INTERNAL_AIDLINK}\n      !ifdef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGEBGIMAGE\n        SetCtlColors $MUI_TEMP1 \"${UMUI_ABORTPAGE_LINK_COLOR}\" \"transparent\"\n      !else\n        SetCtlColors $MUI_TEMP1 \"${UMUI_ABORTPAGE_LINK_COLOR}\" \"${MUI_BGCOLOR}\"\n      !endif\n    !endif\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 3\n    EnableWindow $MUI_TEMP1 0\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_SHOW\n\n    LockWindow on\n\n!ifdef USE_MUIEx\n;-----------------\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1028\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1256\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1035\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1037\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1038\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1039\n    ShowWindow $MUI_TEMP1 ${SW_NORMAL}\n!endif\n;-----------------\n\n    GetDlgItem $MUI_TEMP1 $HWNDPARENT 1045\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    LockWindow off\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !insertmacro UMUI_DELETE_PLUGINDIR\n\n  FunctionEnd\n\n  !undef UMUI_INTERNAL_ANUMFIELDS\n  !undef UMUI_INTERNAL_ANUMFIELDSLINK\n  !undef UMUI_INTERNAL_AFIELDTITLE\n  !undef UMUI_INTERNAL_AFIELDTEXT\n  !undef UMUI_INTERNAL_AFIELDLINK\n  !undef UMUI_INTERNAL_AIDTITLE\n  !undef UMUI_INTERNAL_AIDTEXT\n  !undef UMUI_INTERNAL_AIDLINK\n  !undef UMUI_INTERNAL_APOSLINKLEFT\n\n!macroend\n\n\n\n\n\n!macro UMUI_PAGE_INFORMATION FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}INFORMATIONPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_INFORMATIONPAGE_TEXT \"$(UMUI_TEXT_INFORMATION_INFO_TEXT)\"\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InformationPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InformationLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_INFORMATIONPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InformationPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.InformationLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET UMUI_INFORMATIONPAGE_TEXT\n  !insertmacro MUI_UNSET UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_UNPAGE_INFORMATION FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_INFORMATION \"${FILE}\"\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_FUNCTION_INFORMATIONPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"$(UMUI_TEXT_INFORMATION_TITLE)\" \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_INFORMATION_SUBTITLE)\"\n\n    !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_INFORMATIONPAGE_INI}\" \"Information.ini\"\n\n    SetOutPath $PLUGINSDIR\n    File \"${FILE}\"\n\n    ; search file names by removing characters before back-slash\n    ; $MUI_TEMP1 : file name\n    ; $R0 : character to read\n    ; $0 : seek\n    Push $R0\n    Push $0\n\n    StrLen $0 \"${FILE}\"\n\n    loopfile:\n      IntOp $0 $0 - 1\n      StrCmp $0 '0' endfile\n        StrCpy $R0 \"${FILE}\" 1 $0\n        StrCmp $R0 '\\' endfile\n          Goto loopfile\n    endfile:\n    StrCpy $MUI_TEMP1 \"${FILE}\" \"\" $0\n\n    StrCpy $R0 $MUI_TEMP1 1\n    StrCmp $R0 '\\' 0 +2\n      StrCpy $MUI_TEMP1 $MUI_TEMP1 \"\" 1\n\n    Pop $0\n    Pop $R0\n\n    ; Determine the file name based on the current language\n    ; if '*' was used in the file name, it will be replaced by the $LANGUAGE\n    !insertmacro UMUI_STRREPLACE $MUI_TEMP2 \"*\" \"$LANGUAGE\" $MUI_TEMP1\n    IfFileExists '$PLUGINSDIR\\$MUI_TEMP2' fileFound\n      ClearErrors\n      !insertmacro UMUI_STRREPLACE $MUI_TEMP2 \"*\" \"\" $MUI_TEMP1\n      IfFileExists '$PLUGINSDIR\\$MUI_TEMP2' fileFound\n        StrCpy $MUI_TEMP2 \"\"\n    fileFound:\n    StrCpy $MUI_TEMP1 $MUI_TEMP2\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !ifdef UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT\n\n      !ifndef UMUI_USE_INSTALLOPTIONSEX\n        !error \"The Rich Text Control that you want to use with the UMUI_USE_INSTALLOPTIONSEX define work only with InstallOptionEx but it seen that you don't use it. Use the define UMUI_USE_INSTALLOPTIONSEX\"\n      !endif\n\n      !insertmacro INSTALLOPTIONS_WRITE \"Information.ini\" \"Field 2\" Type \"RichText\"\n\n      StrCmp $MUI_TEMP1 \"\" fileNotFound\n      !insertmacro INSTALLOPTIONS_WRITE \"Information.ini\" \"Field 2\" State '$PLUGINSDIR\\$MUI_TEMP1'\n\n      !insertmacro INSTALLOPTIONS_WRITE \"Information.ini\" \"Field 2\" Notify ONCLICK\n\n    !else\n\n      StrCmp $MUI_TEMP1 \"\" fileNotFound\n\n      ; $MUI_TEMP1 : txt file\n      ; $MUI_TEMP2 : ini file\n      ; $R0 : text read on one line\n      ; $R1 : test if the end of line is $\\r$\\n\n      ; $0 : 1 if UTF16LE, 0 if ANSI\n\n      Push $R1\n      Push $R0\n      Push $0\n\n      FlushINI \"$PLUGINSDIR\\Information.ini\"\n\n      ClearErrors\n      !ifdef NSIS_UNICODE\n        !insertmacro UMUI_FILE_IS_UTF16LE \"$PLUGINSDIR\\$MUI_TEMP1\" $0\n      !endif\n      IfErrors doneWrite\n\n      FileOpen $MUI_TEMP1 \"$PLUGINSDIR\\$MUI_TEMP1\" r\n      IfErrors 0 +2\n        Abort\n      FileOpen $MUI_TEMP2 \"$PLUGINSDIR\\Information.ini\" a\n      IfErrors 0 +2\n        Abort\n      !ifdef NSIS_UNICODE\n        FileSeek $MUI_TEMP2 -4 END\n        FileWriteUTF16LE $MUI_TEMP2 \"$\\\"\"\n      !else\n        FileSeek $MUI_TEMP2 -2 END\n        FileWrite $MUI_TEMP2 \"$\\\"\"\n      !endif\n      IfErrors doneWrite\n\n      loopWrite:\n        !ifdef NSIS_UNICODE\n          StrCmp $0 1 0 +3 ; if UTF16LE\n            FileReadUTF16LE $MUI_TEMP1 $R0\n            Goto +2\n        !endif\n        FileRead $MUI_TEMP1 $R0\n        IfErrors doneWrite ; if End Of File\n\n        StrCpy $R1 \"$R0\" \"\" -1\n        StrCmp $R1 $\\n 0 write\n          StrCpy $R0 \"$R0\" -1\n          StrCpy $R1 \"$R0\" \"\" -1\n          StrCmp $R1 $\\r 0 +2\n            StrCpy $R0 \"$R0\" -1\n          StrCpy $R0 \"$R0\\r\\n\"\n\n        write:\n        !ifdef NSIS_UNICODE\n          FileWriteUTF16LE $MUI_TEMP2 \"$R0\"\n        !else\n          FileWrite $MUI_TEMP2 \"$R0\"\n        !endif\n        Goto loopWrite\n      doneWrite:\n      !ifdef NSIS_UNICODE\n        FileWriteUTF16LE $MUI_TEMP2 \"$\\\"\"\n      !else\n        FileWrite $MUI_TEMP2 \"$\\\"\"\n      !endif\n\n      FileClose $MUI_TEMP1\n      FileClose $MUI_TEMP2\n      ClearErrors\n\n      Pop $0\n      Pop $R0\n      Pop $R1\n\n    !endif\n\n    fileNotFound:\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Information.ini\" \"Field 1\" \"Text\" \"UMUI_INFORMATIONPAGE_TEXT\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY \"Information.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !ifdef UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT\n\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"Information.ini\" \"Settings\" Notify\n      StrCmp $MUI_TEMP1 \"ONNEXT\" +2 0\n        Abort\n\n    !endif\n\n  FunctionEnd\n\n!macroend\n\n!macro UMUI_FILE_IS_UTF16LE FILE RESULT_VAR\n  Push $2\n  Push $1\n\n  StrCpy ${RESULT_VAR} 0  ; is not UFT16LE\n  FileOpen $2 \"${FILE}\" r\n  FileReadByte $2 $1\n  IntCmpU $1 0xFF \"\" doneUTF16LE doneUTF16LE\n  FileReadByte $2 $1\n  IntCmpU $1 0xFE \"\" doneUTF16LE doneUTF16LE\n  StrCpy ${RESULT_VAR} 1  ; is UFT16LE\n  doneUTF16LE:\n    FileClose $2\n\n  Pop $1\n  Pop $2\n!macroend\n\n\n\n!macro UMUI_PAGE_ADDITIONALTASKS ADDTASKS_FUNC\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}ADDITIONALTASKSPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_ADDITIONALTASKSPAGE_TEXT_TOP \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_ADDITIONALTASKS_INFO_TEXT)\"\n\n  !ifndef UMUI_VAR_UMUI_TEMP3\n    Var UMUI_TEMP3\n    !define UMUI_VAR_UMUI_TEMP3\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP4\n    Var UMUI_TEMP4\n    !define UMUI_VAR_UMUI_TEMP4\n  !endif\n\n  !ifdef UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME\n    !ifndef UMUI_ADDITIONALTASKS_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_ADDITIONALTASKS_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME, the UMUI_ADDITIONALTASKS_REGISTRY_ROOT & UMUI_ADDITIONALTASKS_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_ADDITIONALTASKS_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_ADDITIONALTASKS_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME, the UMUI_ADDITIONALTASKS_REGISTRY_ROOT & UMUI_ADDITIONALTASKS_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AdditionalTasksPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AdditionalTasksLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_ADDITIONALTASKSPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AdditionalTasksPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AdditionalTasksLeave_${MUI_UNIQUEID}\n\n  !undef UMUI_ADDITIONALTASKSPAGE_TEXT_TOP\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_UNPAGE_ADDITIONALTASKS ADDTASKS_FUNC\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_ADDITIONALTASKS ${ADDTASKS_FUNC}\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_FUNCTION_ADDITIONALTASKSPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    ; Bodenseematze-2016-09-15: missing PRE-Function support added:\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"$(UMUI_TEXT_ADDITIONALTASKS_TITLE)\" \"$(UMUI_TEXT_ADDITIONALTASKS_SUBTITLE)\"\n\n    IfFileExists \"$PLUGINSDIR\\AdditionalTasks${ADDTASKS_FUNC}.ini\" alreadyExists\n\n      !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_ADDITIONALTASKSPAGE_INI}\" \"AdditionalTasks${ADDTASKS_FUNC}.ini\"\n\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"AdditionalTasks${ADDTASKS_FUNC}.ini\" \"Field 1\" \"Text\" \"UMUI_ADDITIONALTASKSPAGE_TEXT_TOP\"\n\n      StrCpy $UMUI_TEMP3 1   ; number of field\n      StrCpy $UMUI_TEMP4 24  ; height of all fields\n\n      StrCpy $MUI_TEMP1 \"AdditionalTasks${ADDTASKS_FUNC}.ini\"  ; name of the ini file\n      Push $MUI_TEMP1\n\n      Call \"${ADDTASKS_FUNC}\"\n\n      ; IF page skipped save\n      !ifdef UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME\n        !insertmacro UMUI_INTERNAL_ADDITIONALTASKSPAGE_ADDPARAMTOSAVETOREGISTRY\n      !endif\n\n    alreadyExists:\n\n    ; IF setup cancelled or setuptype choosen\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MINIMAL}|${UMUI_STANDARD}|${UMUI_COMPLETE}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY \"AdditionalTasks${ADDTASKS_FUNC}.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro INSTALLOPTIONS_READ $UMUI_TEMP3 \"AdditionalTasks${ADDTASKS_FUNC}.ini\" \"Settings\" NumFields\n    StrCpy $UMUI_TEMP4 1 ;init at 1 because of the label text top\n\n    ;do\n    loop:\n\n      IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 1\n\n      ;get task ID\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AdditionalTasks${ADDTASKS_FUNC}.ini\" \"Field $UMUI_TEMP4\" TaskID\n      ;if field is not a CheckBox or a RadioButton break\n      StrCmp $MUI_TEMP1 \"\" endloop 0\n\n        ;get task State\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AdditionalTasks${ADDTASKS_FUNC}.ini\" \"Field $UMUI_TEMP4\" State\n        ;save task State\n        !insertmacro INSTALLOPTIONS_WRITE \"AdditionalTasksList.ini\" \"Task $MUI_TEMP1\" State \"$MUI_TEMP2\"\n\n    endloop:\n    ;while $UMUI_TEMP4 < $UMUI_TEMP3\n    IntCmp $UMUI_TEMP4 $UMUI_TEMP3 0 loop 0\n\n    ClearErrors\n\n    ;save into the registery\n    !ifdef UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME\n      !insertmacro UMUI_INTERNAL_ADDITIONALTASKSPAGE_ADDPARAMTOSAVETOREGISTRY\n    !endif\n\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro UMUI_INTERNAL_ADDITIONALTASKSPAGE_ADDPARAMTOSAVETOREGISTRY\n\n  Push $R9\n\n  !insertmacro INSTALLOPTIONS_READ $UMUI_TEMP3 \"AdditionalTasksList.ini\" \"Settings\" NumTasks\n  StrCpy $UMUI_TEMP4 0 ;init at 1 because the label text top\n  StrCpy $R9 \"\"\n\n  ;do\n  loops:\n\n    ;get task ID\n    !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AdditionalTasksList.ini\" \"$UMUI_TEMP4\" TaskID\n    !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AdditionalTasksList.ini\" \"Task $MUI_TEMP1\" State\n\n    StrCpy $R9 \"$R9|$MUI_TEMP1=$MUI_TEMP2\"\n\n    IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 1\n\n  ;while $UMUI_TEMP4 < $UMUI_TEMP3\n  IntCmp $UMUI_TEMP4 $UMUI_TEMP3 0 loops 0\n\n  !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_ADDITIONALTASKS_REGISTRY_ROOT} \"${UMUI_ADDITIONALTASKS_REGISTRY_KEY}\" \"${UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME}\" \"$R9\"\n\n  Pop $R9\n\n  ClearErrors\n\n!macroend\n\n!macro UMUI_INTERNAL_ADDITIONALTASKSPAGE_REGISTRY_SET_STATE ID DEFSTATE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_UNIQUEID\n    !undef UMUI_UNIQUEID\n  !endif\n\n  !define UMUI_UNIQUEID ${__LINE__}\n\n  ;Search in the registery\n  !ifdef UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME\n    Push $0\n    Push $1\n    Push $2\n    Push $3\n    Push $4\n\n    ReadRegStr $0 ${UMUI_ADDITIONALTASKS_REGISTRY_ROOT} \"${UMUI_ADDITIONALTASKS_REGISTRY_KEY}\" \"${UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME}\"\n    StrCmp $0 \"\" end${UMUI_UNIQUEID}\n\n      ;search the state of the ID\n      ClearErrors\n\n      StrCpy $4 \"|${ID}=\"  ; string to search\n      StrLen $3 $4          ; len of the task to found\n\n      loop${UMUI_UNIQUEID}:\n        StrCpy $2 $0 $3\n\n        StrCmp $2 $4 found${UMUI_UNIQUEID} 0\n          StrLen $5 $0\n          IntCmp $5 $3 end${UMUI_UNIQUEID} end${UMUI_UNIQUEID} 0  ;if there is not suffitiently char end\n            StrCpy $0 $0 \"\" 1\n            Goto loop${UMUI_UNIQUEID}\n\n        found${UMUI_UNIQUEID}:\n          StrCpy $2 $0 1 $3\n\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State \"0\"\n          StrCmp $2 1 0 end${UMUI_UNIQUEID}\n            !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State \"1\"\n\n    end${UMUI_UNIQUEID}:\n    ClearErrors\n\n    Pop $4\n    Pop $3\n    Pop $2\n    Pop $1\n    Pop $0\n  !endif\n\n  !undef UMUI_UNIQUEID\n\n  !verbose pop\n\n!macroend\n\n\n\n\n\n!macro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL STR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Pop $MUI_TEMP1\n  Pop $MUI_TEMP2\n\n  IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumFields \"$UMUI_TEMP3\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"Label\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Text \"${STR}\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"5\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"-5\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 6\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n\n  Push $0\n  Push $1\n  Push $2\n  Push $3\n\n  !ifdef UMUI_UNIQUEID\n    !undef UMUI_UNIQUEID\n  !endif\n\n  !define UMUI_UNIQUEID ${__LINE__}\n\n  StrCpy $0 \"${STR}\"\n  StrCpy $2 0\n  StrCpy $3 0\n\n  loop${UMUI_UNIQUEID}:\n    StrCpy $1 $0 4\n    IntOp $2 $2 + 1\n\n    StrCmp $1 \"\" end${UMUI_UNIQUEID} 0\n\n      StrCmp $1 \"\\r\\n\" 0 +3  ; a new line if \\n\\r appear\n        IntOp $3 $3 + 1\n        StrCpy $2 0\n\n      StrCmp $2 75 0 +3      ; a new line if character number on this line is > 75\n        IntOp $3 $3 + 1\n        StrCpy $2 0\n\n      StrCpy $0 $0 \"\" 1\n      Goto loop${UMUI_UNIQUEID}\n  end${UMUI_UNIQUEID}:\n\n  !undef UMUI_UNIQUEID\n\n  IntOp $MUI_TEMP2 $3 * 8\n\n  Pop $3\n  Pop $2\n  Pop $1\n  Pop $0\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 12\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + $MUI_TEMP2\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n\n  !ifndef UMUI_NEWGROUP\n    !define UMUI_NEWGROUP\n  !endif\n\n  ClearErrors\n\n  Push $MUI_TEMP2\n  Push $MUI_TEMP1\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_ADDITIONALTASKSPAGE_ADD_TASK ID DEFSTATE STR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Pop $MUI_TEMP1\n  Pop $MUI_TEMP2\n\n  IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumFields \"$UMUI_TEMP3\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"CheckBox\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Text \"${STR}\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State \"${DEFSTATE}\"\n  !insertmacro UMUI_INTERNAL_ADDITIONALTASKSPAGE_REGISTRY_SET_STATE \"${ID}\" \"${DEFSTATE}\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" TaskID \"${ID}\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"10\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"-10\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 12\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State\n  !insertmacro INSTALLOPTIONS_WRITE \"AdditionalTasksList.ini\" \"Task ${ID}\" State \"$MUI_TEMP2\"\n\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AdditionalTasksList.ini\" \"Settings\" NumTasks\n  StrCmp $MUI_TEMP2 \"\" 0 +2\n    StrCpy $MUI_TEMP2 0\n  !insertmacro INSTALLOPTIONS_WRITE \"AdditionalTasksList.ini\" \"$MUI_TEMP2\" TaskID \"${ID}\"\n  IntOp $MUI_TEMP2 $MUI_TEMP2 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"AdditionalTasksList.ini\" \"Settings\" NumTasks \"$MUI_TEMP2\"\n\n  ClearErrors\n\n  Push $MUI_TEMP2\n  Push $MUI_TEMP1\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO ID DEFSTATE STR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Pop $MUI_TEMP1\n  Pop $MUI_TEMP2\n\n  IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumFields \"$UMUI_TEMP3\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"RadioButton\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Text \"${STR}\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State \"${DEFSTATE}\"\n  !insertmacro UMUI_INTERNAL_ADDITIONALTASKSPAGE_REGISTRY_SET_STATE \"${ID}\" \"${DEFSTATE}\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" TaskID \"${ID}\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"10\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"-10\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 12\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n\n  !ifdef UMUI_NEWGROUP\n    !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Flags \"GROUP\"\n    !undef UMUI_NEWGROUP\n  !endif\n\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State\n  !insertmacro INSTALLOPTIONS_WRITE \"AdditionalTasksList.ini\" \"Task ${ID}\" State \"$MUI_TEMP2\"\n\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AdditionalTasksList.ini\" \"Settings\" NumTasks\n  StrCmp $MUI_TEMP2 \"\" 0 +2\n    StrCpy $MUI_TEMP2 0\n  !insertmacro INSTALLOPTIONS_WRITE \"AdditionalTasksList.ini\" \"$MUI_TEMP2\" TaskID \"${ID}\"\n  IntOp $MUI_TEMP2 $MUI_TEMP2 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"AdditionalTasksList.ini\" \"Settings\" NumTasks \"$MUI_TEMP2\"\n\n  ClearErrors\n\n  Push $MUI_TEMP2\n  Push $MUI_TEMP1\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_ADDITIONALTASKSPAGE_ADD_EMPTYLINE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 6\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_ADDITIONALTASKSPAGE_ADD_LINE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Pop $MUI_TEMP1\n\n  IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumFields \"$UMUI_TEMP3\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"HLine\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"5\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"-5\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 3\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n\n  Push $MUI_TEMP1\n\n  !verbose pop\n\n!macroend\n\n; listid can be a string containing ID1|ID2|ID3\n!macro UMUI_ADDITIONALTASKS_IF_CKECKED LISTID\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_UNIQUEID\n    !undef UMUI_UNIQUEID\n  !endif\n\n  !define UMUI_UNIQUEID ${__LINE__}\n\n  Push $0\n  Push $1\n  Push $2\n\n  StrCpy $0 \"${LISTID}\"  ;the sources\n  StrCpy $1 \"\"            ;an id\n  StrCpy $MUI_TEMP1 0    ; 0 = false , 1 = true\n\n  loop${UMUI_UNIQUEID}:\n    ;copy one id\n    loopid${UMUI_UNIQUEID}:\n      StrCpy $2 $0 1\n      StrCmp $2 \"\" check${UMUI_UNIQUEID} 0\n        StrCpy $0 $0 \"\" 1\n        StrCmp $2 \"|\" check${UMUI_UNIQUEID} 0\n          StrCpy $1 \"$1$2\"\n          Goto loopid${UMUI_UNIQUEID}\n    check${UMUI_UNIQUEID}:\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AdditionalTasksList.ini\" \"Task $1\" State\n      StrCpy $1 \"\"\n      StrCmp $MUI_TEMP1 1 endloop${UMUI_UNIQUEID}\n        StrCpy $MUI_TEMP1 0\n        StrCmp $2 \"\" endloop${UMUI_UNIQUEID} loop${UMUI_UNIQUEID}\n  endloop${UMUI_UNIQUEID}:\n\n  ClearErrors\n\n  Pop $2\n  Pop $1\n  Pop $0\n\n  ; if any of VALS is checked goto done\n  StrCmp $MUI_TEMP1 1 0 done_${UMUI_UNIQUEID}\n\n  !verbose pop\n\n!macroend\n\n; listid can be a string containing ID1&ID2&ID3\n!macro UMUI_ADDITIONALTASKS_IF_NOT_CKECKED LISTID\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_UNIQUEID\n    !undef UMUI_UNIQUEID\n  !endif\n\n  !define UMUI_UNIQUEID ${__LINE__}\n\n  Push $0\n  Push $1\n  Push $2\n\n  StrCpy $0 \"${LISTID}\"  ;the sources\n  StrCpy $1 \"\"            ;an id\n  StrCpy $MUI_TEMP1 1    ; 0 = false , 1 = true\n\n  loop${UMUI_UNIQUEID}:\n    ;copy one id\n    loopid${UMUI_UNIQUEID}:\n      StrCpy $2 $0 1\n      StrCmp $2 \"\" check${UMUI_UNIQUEID} 0\n        StrCpy $0 $0 \"\" 1\n        StrCmp $2 \"&\" check${UMUI_UNIQUEID} 0\n          StrCpy $1 \"$1$2\"\n          Goto loopid${UMUI_UNIQUEID}\n    check${UMUI_UNIQUEID}:\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AdditionalTasksList.ini\" \"Task $1\" State\n      StrCpy $1 \"\"\n      StrCmp $MUI_TEMP1 0 endloop${UMUI_UNIQUEID}\n        StrCpy $MUI_TEMP1 1\n        StrCmp $2 \"\" endloop${UMUI_UNIQUEID} loop${UMUI_UNIQUEID}\n  endloop${UMUI_UNIQUEID}:\n\n  ClearErrors\n\n  Pop $2\n  Pop $1\n  Pop $0\n\n  ; if any of VALS is checked goto done\n  StrCmp $MUI_TEMP1 0 0 done_${UMUI_UNIQUEID}\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_ADDITIONALTASKS_ENDIF\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  done_${UMUI_UNIQUEID}:\n\n  !undef UMUI_UNIQUEID\n\n  !verbose pop\n\n!macroend\n\n\n\n\n!macro UMUI_PAGE_SERIALNUMBER SERIAL_FUNC\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}SERIALNUMBERPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SERIALNUMBERPAGE_TEXT_TOP \"$(UMUI_TEXT_SERIALNUMBER_INFO_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SERIALNUMBERPAGE_INVALIDATE_TEXT \"$(UMUI_TEXT_SERIALNUMBER_INVALIDATE_TEXT)\"\n\n  !ifndef UMUI_VAR_UMUI_TEMP3\n    Var UMUI_TEMP3\n    !define UMUI_VAR_UMUI_TEMP3\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP4\n    Var UMUI_TEMP4\n    !define UMUI_VAR_UMUI_TEMP4\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_SNTEXT\n    Var UMUI_SNTEXT\n    !define UMUI_VAR_UMUI_SNTEXT\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.serialnumberPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.serialnumberLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_SERIALNUMBERPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.serialnumberPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.serialnumberLeave_${MUI_UNIQUEID}\n\n  !undef UMUI_SERIALNUMBERPAGE_TEXT_TOP\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_UNPAGE_SERIALNUMBER SERIAL_FUNC\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_SERIALNUMBER ${SERIAL_FUNC}\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_FUNCTION_SERIALNUMBERPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled or setuptype choosen\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    ; Bodenseematze-2016-09-15: missing PRE-Function support added:\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"$(UMUI_TEXT_SERIALNUMBER_TITLE)\" \"$(UMUI_TEXT_SERIALNUMBER_SUBTITLE)\"\n\n    IfFileExists \"$PLUGINSDIR\\SerialNumber_${SERIAL_FUNC}.ini\" alreadyExists\n\n      !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_SERIALNUMBERPAGE_INI}\" \"SerialNumber_${SERIAL_FUNC}.ini\"\n\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"SerialNumber_${SERIAL_FUNC}.ini\" \"Field 1\" \"Text\" \"UMUI_SERIALNUMBERPAGE_TEXT_TOP\"\n\n      StrCpy $MUI_TEMP1 \"SerialNumber_${SERIAL_FUNC}.ini\"  ; name of the ini file\n      StrCpy $MUI_TEMP2 0      ; serials counter\n      StrCpy $UMUI_TEMP3 1     ; field counter\n      StrCpy $UMUI_TEMP4 30    ; height of all fields\n\n      Call \"${SERIAL_FUNC}\"\n\n      !insertmacro UMUI_SERIALNUMBERPAGE_APPLYFLAGS \"SerialNumber_${SERIAL_FUNC}.ini\"\n\n      !insertmacro UMUI_SERIALNUMBERPAGE_SAVE \"SerialNumber_${SERIAL_FUNC}.ini\"\n\n    alreadyExists:\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY \"SerialNumber_${SERIAL_FUNC}.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_CANCELLED}\n\n    !ifdef UMUI_USE_INSTALLOPTIONSEX\n\n      Push $0\n      Push $1\n      Push $2\n      Push $3\n      Push $4\n\n      ; $MUI_TEMP1    : Current field number\n      ; $0            : max lenght\n      ; $1            : state of the current field\n      ; $2            : lenght of the state\n      ; $3            : back/next field number\n      ; $4            : HWND of the back/next field\n\n      ClearErrors\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"SerialNumber_${SERIAL_FUNC}.ini\" \"Settings\" State\n      StrCmp $MUI_TEMP1 \"0\" ok 0\n\n        !insertmacro INSTALLOPTIONS_READ $1 \"SerialNumber_${SERIAL_FUNC}.ini\" \"Field $MUI_TEMP1\" State\n\n        StrCmp $1 \"\" 0 next\n\n          !insertmacro INSTALLOPTIONS_READ $3 \"SerialNumber_${SERIAL_FUNC}.ini\" \"Field $MUI_TEMP1\" BackField\n          IfErrors abort\n\n          !insertmacro INSTALLOPTIONS_READ $4 \"SerialNumber_${SERIAL_FUNC}.ini\" \"Field $3\" HWND\n          IfErrors abort\n\n            !insertmacro UMUI_INSTALLOPTIONSEX_SETFOCUS $4\n\n        next:\n\n        !insertmacro INSTALLOPTIONS_READ $0 \"SerialNumber_${SERIAL_FUNC}.ini\" \"Field $MUI_TEMP1\" MaxLen\n        IfErrors abort\n\n          StrLen $2 $1\n          StrCmp $2 $0 0 abort\n\n            !insertmacro INSTALLOPTIONS_READ $3 \"SerialNumber_${SERIAL_FUNC}.ini\" \"Field $MUI_TEMP1\" NextField\n            IfErrors abort\n\n              !insertmacro INSTALLOPTIONS_READ $4 \"SerialNumber_${SERIAL_FUNC}.ini\" \"Field $3\" HWND\n              IfErrors abort\n\n                !insertmacro UMUI_INSTALLOPTIONSEX_SETFOCUS $4\n\n        abort:\n\n        ClearErrors\n\n        Pop $4\n        Pop $3\n        Pop $2\n        Pop $1\n        Pop $0\n\n        Abort\n\n      ok:\n\n      Pop $4\n      Pop $3\n      Pop $2\n      Pop $1\n      Pop $0\n\n    !endif\n\n    !insertmacro UMUI_SERIALNUMBERPAGE_APPLYFLAGS \"SerialNumber_${SERIAL_FUNC}.ini\"\n\n    !insertmacro UMUI_SERIALNUMBERPAGE_SAVE \"SerialNumber_${SERIAL_FUNC}.ini\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n  FunctionEnd\n\n!macroend\n\n\n!macro UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_OWNER VAR\n    ClearErrors\n    ; Windows NT\n    ReadRegStr $${VAR} HKLM \"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\" \"RegisteredOwner\"\n    IfErrors 0 +2\n        ; Windows 9x\n        ReadRegStr $${VAR} HKLM \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\" \"RegisteredOwner\"\n    ClearErrors\n!macroend\n\n!macro UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_ORGANIZATION VAR\n    ClearErrors\n    ; Windows NT\n    ReadRegStr $${VAR} HKLM \"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\" \"RegisteredOrganization\"\n    IfErrors 0 +2\n        ; Windows 9x\n        ReadRegStr $${VAR} HKLM \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\" \"RegisteredOrganization\"\n    ClearErrors\n!macroend\n\n\n\n!macro UMUI_SERIALNUMBERPAGE_APPLYFLAGS FILE\n\n  Push $0\n  Push $1\n  Push $2\n  Push $4\n  Push $6\n  Push $7\n  Push $8\n  Push $9\n\n  ; $MUI_TEMP2  : serials line number\n  ; $0          : System::Call return success if ok\n  ; $1          : curent ID\n  ; $2          : curent FLAGS\n  ; $4          : the curent serial number\n  ; $6          : one portion of the $5 serial number\n  ; $7          : Is FLAGS == \"TOLOWER\"\n  ; $8          : Is FLAGS == \"TOUPPER\"\n  ; $9          : current field\n\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"${FILE}\" Settings NumTasks\n\n  StrCpy $4 0\n\n  loopApplyFlags:\n\n    ClearErrors\n\n    IntOp $4 $4 + 1\n    IntCmp $4 $MUI_TEMP2 0 0 endApplyFlags\n\n      !insertmacro INSTALLOPTIONS_READ $1 \"${FILE}\" $4 SerialID\n      !insertmacro INSTALLOPTIONS_READ $9 \"${FILE}\" $4 FirstField\n      !insertmacro INSTALLOPTIONS_READ $2 \"${FILE}\" $4 FLAGS\n\n      !insertmacro UMUI_STRCOUNT \"NUMBERS\" \"$2\"\n      Pop $7\n      IntCmp $7 0 0 loopApplyFlags loopApplyFlags\n\n      !insertmacro UMUI_STRCOUNT \"TOLOWER\" \"$2\"\n      Pop $7\n      !insertmacro UMUI_STRCOUNT \"TOUPPER\" \"$2\"\n      Pop $8\n\n      ;if $7 = $8 = 0 goto end\n      IntCmp $7 0 0 +2 +2\n        IntCmp $8 0 loopApplyFlags 0 0\n\n      ;if $7 != 0 && $8 != 0 goto end\n      IntCmp $7 0 +2 0 0\n        IntCmp $8 0 0 loopApplyFlags loopApplyFlags\n\n      loopSerialApplyFlags:\n        !insertmacro INSTALLOPTIONS_READ $6 \"${FILE}\" \"Field $9\" State\n\n        ;if flag is lower\n        IntCmp $7 0 +2 0 0\n        ;then\n          System::Call \"User32::CharLower(t r6 r6)i\"\n        ;endif\n\n        ;if flag is upper\n        IntCmp $8 0 +2 0 0\n        ;then\n          System::Call \"User32::CharUpper(t r6 r6)i\"\n        ;endif\n\n        !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $9\" State $6\n\n        !insertmacro INSTALLOPTIONS_READ $0 \"${FILE}\" \"Field $9\" HWND\n        IfErrors +2 0\n          SendMessage $0 ${WM_SETTEXT} 0 \"STR:$6\"\n        ClearErrors\n\n        !insertmacro INSTALLOPTIONS_READ $9 \"${FILE}\" \"Field $9\" NextField\n        IfErrors 0 loopSerialApplyFlags\n\n    Goto loopApplyFlags\n  endApplyFlags:\n\n  Pop $9\n  Pop $8\n  Pop $7\n  Pop $6\n  Pop $4\n  Pop $2\n  Pop $1\n  Pop $0\n\n!macroend\n\n\n\n!macro UMUI_SERIALNUMBERPAGE_SAVE FILE\n\n  Push $0\n  Push $1\n  Push $2\n  Push $3\n  Push $4\n  Push $5\n  Push $6\n  Push $7\n  Push $8\n  Push $9\n\n  ; $MUI_TEMP2  : serials line number\n  ; $0          : temp var\n  ; $1          : curent ID\n  ; $2          : curent FLAGS\n  ; $3          : temp var\n  ; $4          : the curent serial number\n  ; $5          : full serial number\n  ; $6          : one portion of the $5 serial number\n  ; $7          : temp var\n  ; $8          : Is FLAGS == \"NODASHS\"\n  ; $9          : current field\n\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"${FILE}\" Settings NumTasks\n\n  StrCpy $4 0\n\n  loopSave:\n\n    ClearErrors\n    StrCpy $5 \"\"\n\n    IntOp $4 $4 + 1\n    IntCmp $4 $MUI_TEMP2 0 0 endSave\n\n      !insertmacro INSTALLOPTIONS_READ $1 \"${FILE}\" $4 SerialID\n      !insertmacro INSTALLOPTIONS_READ $9 \"${FILE}\" $4 FirstField\n      !insertmacro INSTALLOPTIONS_READ $2 \"${FILE}\" $4 FLAGS\n\n      !insertmacro UMUI_STRCOUNT \"NODASHS\" \"$2\"\n      Pop $8\n\n      loopSerial:\n\n        !insertmacro INSTALLOPTIONS_READ $6 \"${FILE}\" \"Field $9\" State\n\n        ;if $8 != 0\n        IntCmp $8 0 +3 0 0\n        ;then\n          StrCpy $5 \"$5$6\"\n          Goto +2\n        ;else\n          StrCpy $5 \"$5-$6\"\n        ;endif\n\n        !insertmacro INSTALLOPTIONS_READ $9 \"${FILE}\" \"Field $9\" NextField\n        StrCmp $9 \"\" 0 loopSerial\n          ClearErrors\n\n          StrCpy $0 $5 1  ; get first char\n          StrCmp $0 \"-\" 0 +2\n            StrCpy $5 $5 \"\" 1\n\n          !insertmacro INSTALLOPTIONS_WRITE \"SerialNumberList.ini\" \"Serial $1\" SN \"$5\"\n\n          !insertmacro INSTALLOPTIONS_READ $3 \"SerialNumberList.ini\" \"Serial $1\" REGISTRY_VALUENAME\n          IfErrors loopSave 0\n\n            !insertmacro INSTALLOPTIONS_READ $0 \"SerialNumberList.ini\" \"Serial $1\" REGISTRY_ROOT\n            !insertmacro INSTALLOPTIONS_READ $7 \"SerialNumberList.ini\" \"Serial $1\" REGISTRY_KEY\n\n            !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY \"$0\" \"$7\" \"$3\" \"$5\"\n\n    Goto loopSave\n  endSave:\n\n  Pop $9\n  Pop $8\n  Pop $7\n  Pop $6\n  Pop $5\n  Pop $4\n  Pop $3\n  Pop $2\n  Pop $1\n  Pop $0\n\n!macroend\n\n\n!macro UMUI_SERIALNUMBERPAGE_ADD_LINE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 6\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_SERIALNUMBERPAGE_ADD_HLINE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumFields \"$UMUI_TEMP3\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"HLine\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"5\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"-1\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 3\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 4\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_SERIALNUMBERPAGE_ADD_LABEL TEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumFields \"$UMUI_TEMP3\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"Label\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Text \"${TEXT}\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"5\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"-5\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 10\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n\n  !verbose pop\n\n!macroend\n\n; ID:        A unique identifiant for this serial number\n; STR:       555 for 3 inputs of 5 characters each\n; FLAGS: \"\", NODASHS, TOUPPER, TOLOWER, NUMBERS, CANBEEMPTY\n; DEFAULT:   XXXXX-XXXXX-XXXXX OR XXXXXXXXXXXXXXX\n; WIDTH:     The initial width\n!macro UMUI_SERIALNUMBERPAGE_CREATE ID STR FLAGS DEFAULT TEXT WIDTH\n\n  !define UMUI_UNIQUEIDSN ${__LINE__}\n\n  Push $0\n  Push $1\n  Push $2\n  Push $3\n  Push $4\n  Push $5\n  Push $6\n  Push $7\n  Push $8\n  Push $9\n  Push $R0\n\n  ; $MUI_TEMP1  : name of the ini file\n  ; $MUI_TEMP2  : serials line counter\n  ; $UMUI_TEMP3 : field counter for all the page\n  ; $UMUI_TEMP4 : current height of all fields\n  ; $0          : source str (555 for 3 inputs of 5 characters each)\n  ; $1          : temp var\n  ; $2          : one of the $0 numbers\n  ; $3          : the current width\n  ; $4          : the curent serial value\n  ; $5          : the next chars of the curent serial value\n  ; $6          : one portion of the $5 serial number\n  ; $7          : temp var\n  ; $8          : Is FLAGS == \"NUMBERS\"\n  ; $9          : first field\n  ; $R0         : Is FLAGS == \"CANBEEMPTY\"\n\n  StrCpy $0 \"${STR}\"\n  StrCpy $7 0\n  StrCpy $3 \"${WIDTH}\"\n\n  !ifdef UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME\n    !ifndef UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME, the UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT & UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME, the UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT & UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    ClearErrors\n    ReadRegStr $5 \"${UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT}\" \"${UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY}\" \"${UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME}\"\n    IfErrors 0 +2\n      StrCpy $5 \"${DEFAULT}\"\n    ClearErrors\n  !else\n    StrCpy $5 \"${DEFAULT}\"\n  !endif\n\n  StrCpy $4 $5\n\n  !insertmacro UMUI_STRCOUNT \"NUMBERS\" \"${FLAGS}\"\n  Pop $8\n  !insertmacro UMUI_STRCOUNT \"CANBEEMPTY\" \"${FLAGS}\"\n  Pop $R0\n\n  ;foreach number of $0 AS $2\n  loop1${UMUI_UNIQUEIDSN}:\n    StrCpy $2 $0 1 ; Get the next source char\n\n    StrCmp $2 \"\" done1${UMUI_UNIQUEIDSN} ; Abort when none left\n      StrCpy $0 $0 \"\" 1 ; Remove it from the source\n\n      IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n\n      ; add the on text change notify if installoptionsex\n      !ifdef UMUI_USE_INSTALLOPTIONSEX\n        StrLen $1 \"${STR}\"\n        StrCmp $1 1 endTextChange${UMUI_UNIQUEIDSN} 0\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Notify ONTEXTCHANGE\n        endTextChange${UMUI_UNIQUEIDSN}:\n      !endif\n\n      !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"text\"\n\n      changeLine${UMUI_UNIQUEIDSN}:\n        !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"$3\"\n\n        ;if $2 = 0\n        IntCmp $2 0 0 +3 +3\n        ;then\n          StrCpy $3 -1\n          Goto +3\n        ;else\n          IntOp $1 $2 * 7\n          IntOp $3 $1 + $3\n        ;endif\n\n!ifdef USE_MUIEx | UMUI_ULTRAMODERN_SMALL\n;----------------\n        IntCmp $3 300 +4 +4 0\n!else\n;----------------\n        IntCmp $3 315 +4 +4 0\n!endif\n;----------------\n        StrCpy $3 ${WIDTH}\n        IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 14\n      Goto changeLine${UMUI_UNIQUEIDSN}\n\n      !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"$3\"\n      !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n      IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 12\n      !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n      IntOp $UMUI_TEMP4 $UMUI_TEMP4 - 12\n\n      ;if $2 = 0       ; no limit\n      IntCmp $2 0 0 notnull${UMUI_UNIQUEIDSN} notnull${UMUI_UNIQUEIDSN}\n      ;then\n        !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State \"$5\"\n        Goto done2${UMUI_UNIQUEIDSN}\n      ;else\n      notnull${UMUI_UNIQUEIDSN}:\n        StrCpy $6 $5 $2 ; Get $2 next source char\n        !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" State \"$6\"\n\n        StrCpy $5 $5 \"\" $2 ; Remove it from the source\n\n        ;if $5 next char is \"-\" remove\n        StrCpy $6 $5 1 ; Get the next source char\n        StrCmp $6 \"-\" 0 +2\n          StrCpy $5 $5 \"\" 1 ; Remove it from the source\n        ;endif\n      ;endif\n      done2${UMUI_UNIQUEIDSN}:\n\n      ;if $2 != 0\n      IntCmp $2 0 null${UMUI_UNIQUEIDSN} 0 0\n      ;then\n\n        !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" MaxLen \"$2\"\n\n        ;if $R0 == 0\n        IntCmp $R0 0 0 endCanBeEmpty${UMUI_UNIQUEIDSN} endCanBeEmpty${UMUI_UNIQUEIDSN}\n        ;then\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" MinLen \"$2\"\n        ;end\n        endCanBeEmpty${UMUI_UNIQUEIDSN}:\n\n        StrCpy $UMUI_SNTEXT \"${TEXT}\"\n        !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" ValidateText \"${UMUI_SERIALNUMBERPAGE_INVALIDATE_TEXT}\"\n        Goto endnull${UMUI_UNIQUEIDSN}\n\n      ;else\n      null${UMUI_UNIQUEIDSN}:\n\n        ;if $R0 == 0\n        IntCmp $R0 0 0 endCanBeEmpty2${UMUI_UNIQUEIDSN} endCanBeEmpty2${UMUI_UNIQUEIDSN}\n        ;then\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" MinLen \"1\"\n          StrCpy $UMUI_SNTEXT \"${TEXT}\"\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" ValidateText \"${UMUI_SERIALNUMBERPAGE_INVALIDATE_TEXT}\"\n        ;end\n        endCanBeEmpty2${UMUI_UNIQUEIDSN}:\n\n      ;endif\n      endnull${UMUI_UNIQUEIDSN}:\n\n      ;if $8 != 0\n      IntCmp $8 0 flagNoNumbers${UMUI_UNIQUEIDSN} 0 0\n      ;then\n        !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Flags \"ONLY_NUMBERS\"\n      ;endif\n      flagNoNumbers${UMUI_UNIQUEIDSN}:\n\n      ;if $7 != 0\n      IntCmp $7 0 isfirst${UMUI_UNIQUEIDSN}\n      ;then\n        IntOp $1 $UMUI_TEMP3 - 2\n        !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" BackField \"$1\"\n        Goto endfirst${UMUI_UNIQUEIDSN}\n      ;else\n      isfirst${UMUI_UNIQUEIDSN}:\n        StrCpy $9 $UMUI_TEMP3\n      ;endif\n      endfirst${UMUI_UNIQUEIDSN}:\n\n      IntOp $7 $7 + 1\n\n      ;if $2 == 0 done1\n      IntCmp $2 0 done1${UMUI_UNIQUEIDSN} 0 0\n\n        ; draw \"_\"\n        StrCpy $2 $0 1 ; Get the next source char\n        StrCmp $2 \"\" done1${UMUI_UNIQUEIDSN} ; Abort when none left\n\n          IntOp $1 $UMUI_TEMP3 + 2\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" NextField \"$1\"\n\n          IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"label\"\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Text \"_\"\n          IntOp $UMUI_TEMP4 $UMUI_TEMP4 - 1\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n          IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 10\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n          IntOp $UMUI_TEMP4 $UMUI_TEMP4 - 9\n          IntOp $3 $3 + 3\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"$3\"\n          IntOp $3 $3 + 7\n          !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"$3\"\n\n          Goto loop1${UMUI_UNIQUEIDSN}\n\n  done1${UMUI_UNIQUEIDSN}:\n  ;endforeach\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumFields \"$UMUI_TEMP3\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 15\n\n  ;save to list serial ini\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"$MUI_TEMP1\" \"Settings\" NumTasks\n\n  IntOp $MUI_TEMP2 $MUI_TEMP2 + 1\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Settings\" NumTasks \"$MUI_TEMP2\"\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"$MUI_TEMP2\" SerialID \"${ID}\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"$MUI_TEMP2\" FirstField \"$9\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"$MUI_TEMP2\" FLAGS \"${FLAGS}\"\n\n  !ifdef UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME\n    !insertmacro INSTALLOPTIONS_WRITE \"SerialNumberList.ini\" \"Serial ${ID}\" REGISTRY_ROOT \"${UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"SerialNumberList.ini\" \"Serial ${ID}\" REGISTRY_KEY \"${UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"SerialNumberList.ini\" \"Serial ${ID}\" REGISTRY_VALUENAME \"${UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME}\"\n  !endif\n\n  ClearErrors\n\n  !insertmacro MUI_UNSET UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME\n\n  !undef UMUI_UNIQUEIDSN\n\n  Pop $R0\n  Pop $9\n  Pop $8\n  Pop $7\n  Pop $6\n  Pop $5\n  Pop $4\n  Pop $3\n  Pop $2\n  Pop $1\n  Pop $0\n\n!macroend\n\n\n\n!macro UMUI_SERIALNUMBERPAGE_ADD_SERIAL ID STR FLAGS DEFAULT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro UMUI_SERIALNUMBERPAGE_CREATE \"${ID}\" \"${STR}\" \"${FLAGS}\" \"${DEFAULT}\" \"${ID}\" \"5\"\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL ID STR FLAGS DEFAULT TEXT\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ;label\n  IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 1\n\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Type \"Label\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Text \"${TEXT}:\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Left \"5\"\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Right \"78\"\n\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 2\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Top \"$UMUI_TEMP4\"\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 + 10\n  !insertmacro INSTALLOPTIONS_WRITE \"$MUI_TEMP1\" \"Field $UMUI_TEMP3\" Bottom \"$UMUI_TEMP4\"\n  IntOp $UMUI_TEMP4 $UMUI_TEMP4 - 12\n\n  ;inputs\n  !insertmacro UMUI_SERIALNUMBERPAGE_CREATE \"${ID}\" \"${STR}\" \"${FLAGS}\" \"${DEFAULT}\" \"${TEXT}\" \"79\"\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_SERIALNUMBER_GET ID VAR\n\n  !insertmacro INSTALLOPTIONS_READ $${VAR} \"SerialNumberList.ini\" \"Serial ${ID}\" SN\n  ClearErrors\n\n!macroend\n\n\n\n\n\n\n\n!macro UMUI_PAGE_ALTERNATIVESTARTMENU ID VAR\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}STARTMENUPAGE\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}ALTERNATIVESTARTMENUPAGE\n\n  !define /IfNDef MUI_STARTMENUPAGE_DEFAULTFOLDER \"$(^Name)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_STARTMENUPAGE_TEXT_TOP \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_TOP)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT MUI_STARTMENUPAGE_TEXT_CHECKBOX \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_CHECKBOX)\"\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_STARTMENUPAGE_SHELL_VAR_CONTEXT_TITLE \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_STARTMENUPAGE_TEXT_FOR_ALL_USERS \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_STARTMENUPAGE_TEXT_FOR_THE_CURRENT_USER \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n\n  !define MUI_STARTMENUPAGE_VARIABLE \"${VAR}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_VARIABLE\" \"${MUI_STARTMENUPAGE_VARIABLE}\"\n  !define \"MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n  !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_VALUENAME\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n\n    !ifndef MUI_STARTMENUPAGE_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define MUI_STARTMENUPAGE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For MUI_STARTMENUPAGE_REGISTRY_VALUENAME, the MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef MUI_STARTMENUPAGE_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define MUI_STARTMENUPAGE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For MUI_STARTMENUPAGE_REGISTRY_VALUENAME, the MUI_STARTMENUPAGE_REGISTRY_ROOT & MUI_STARTMENUPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_ROOT\" \"${MUI_STARTMENUPAGE_REGISTRY_ROOT}\"\n    !define \"MUI_STARTMENUPAGE_${ID}_REGISTRY_KEY\" \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\"\n\n  !endif\n\n  !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n    !ifndef UMUI_USE_INSTALLOPTIONSEX\n      !error \"You want to use a TreeView in the ALTERNATIVESTARTMENU page but you don't use InstallOptionEx. This page won't work without the UMUI_USE_INSTALLOPTIONSEX define.\"\n    !endif\n  !endif\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP3\n    Var UMUI_TEMP3\n    !define UMUI_VAR_UMUI_TEMP3\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP4\n    Var UMUI_TEMP4\n    !define UMUI_VAR_UMUI_TEMP4\n  !endif\n\n  !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n    !ifndef UMUI_VAR_UMUI_TEMP5\n      Var UMUI_TEMP5\n      !define UMUI_VAR_UMUI_TEMP5\n    !endif\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AlternativeStartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AlternativeStartmenuLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_ALTERNATIVESTARTMENUPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AlternativeStartmenuPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AlternativeStartmenuLeave_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.AlternativeStartmenuCreateList_${MUI_UNIQUEID}\n\n  !undef MUI_STARTMENUPAGE_VARIABLE\n  !undef MUI_STARTMENUPAGE_TEXT_TOP\n  !undef MUI_STARTMENUPAGE_TEXT_CHECKBOX\n  !undef MUI_STARTMENUPAGE_DEFAULTFOLDER\n\n  !undef UMUI_STARTMENUPAGE_SHELL_VAR_CONTEXT_TITLE\n  !undef UMUI_STARTMENUPAGE_TEXT_FOR_ALL_USERS\n  !undef UMUI_STARTMENUPAGE_TEXT_FOR_THE_CURRENT_USER\n\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_NODISABLE\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_ROOT\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_KEY\n  !insertmacro MUI_UNSET MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n\n  !insertmacro MUI_UNSET UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n  !insertmacro MUI_UNSET UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_FUNCTION_ALTERNATIVESTARTMENUPAGE PRE LEAVE CREATELIST\n\n  !ifdef MUI_STARTMENUPAGE_NODISABLE\n    !define UMUI_INTERNAL_ASMGOUPBOXFIELD 4\n    !define UMUI_INTERNAL_ASMALLOPTFIELD 5\n    !define UMUI_INTERNAL_ASMCURRENTOPTFIELD 6\n  !else\n    !define UMUI_INTERNAL_ASMGOUPBOXFIELD 5\n    !define UMUI_INTERNAL_ASMALLOPTFIELD 6\n    !define UMUI_INTERNAL_ASMCURRENTOPTFIELD 7\n  !endif\n\n  Function \"${PRE}\"\n\n    StrCpy $UMUI_TEMP4 \"\"\n\n    !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n\n      Push $R0\n      Push $R1\n      Push $R2\n\n      ClearErrors\n\n      StrCmp \"${MUI_STARTMENUPAGE_VARIABLE}\" \"\" 0 endreg\n\n        ReadRegStr $MUI_TEMP1 ${MUI_STARTMENUPAGE_REGISTRY_ROOT} \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\"\n\n        StrCmp $MUI_TEMP1 \"\" endreg\n          StrCpy \"${MUI_STARTMENUPAGE_VARIABLE}\" $MUI_TEMP1\n          StrLen $R0 $MUI_TEMP1\n          StrLen $R1 \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n\n          IntCmp $R0 $R1 endreg endreg 0\n            ;delete de default folder from the path if it is in.\n            IntOp $R0 $R0 - $R1\n            IntOp $R0 $R0 - 1\n\n            StrCpy $UMUI_TEMP4 $MUI_TEMP1 $R0\n\n            ;Convert this Folder path into a IOEx string\n            !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n              !insertmacro UMUI_STRREPLACE $UMUI_TEMP4 \"\\\" \"{\" $UMUI_TEMP4\n              !insertmacro UMUI_STRCOUNT \"{\" $UMUI_TEMP4\n              Pop $R0\n\n              loopadd:\n                StrCmp $R0 \"0\" endreg\n                  StrCpy $UMUI_TEMP4 \"$UMUI_TEMP4}\"\n\n                IntOp $R0 $R0 - 1\n              Goto loopadd\n            !endif\n\n      endreg:\n\n      Pop $R2\n      Pop $R1\n      Pop $R0\n\n    !endif\n\n    StrCmp \"${MUI_STARTMENUPAGE_VARIABLE}\" \"\" 0 +2\n      StrCpy \"${MUI_STARTMENUPAGE_VARIABLE}\" \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n\n    !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME ; IF page skipped save\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${MUI_STARTMENUPAGE_REGISTRY_ROOT} \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\" \"${MUI_STARTMENUPAGE_VARIABLE}\"\n    !endif\n\n    ; IF setup cancelled or steuptype complete\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MINIMAL}|${UMUI_STANDARD}|${UMUI_COMPLETE}|${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)\n\n    ; disable sellvarcontext radio buttons if no admin rights\n    !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n      UserInfo::GetAccountType\n      Pop $UMUI_TEMP5\n      StrCmp $UMUI_TEMP5 \"Admin\" endcheck\n      StrCmp $UMUI_TEMP5 \"User\" endcheck\n      StrCmp $UMUI_TEMP5 \"Power\" 0 +3\n        StrCpy $UMUI_TEMP5 \"Admin\"\n        Goto endcheck\n      StrCmp $UMUI_TEMP5 \"Guest\" 0 +3\n        StrCpy $UMUI_TEMP5 \"User\"\n        Goto endcheck\n      ;if error or win 95\n      StrCpy $UMUI_TEMP5 \"Admin\"\n\n      endcheck:\n    !endif\n\n    IfFileExists \"$PLUGINSDIR\\AlternativeStartMenu${ID}.ini\" alreadyExists\n      !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_ALTERNATIVESTARTMENUPAGE_INI}\" \"AlternativeStartMenu${ID}.ini\"\n\n      ; serach all directory and add it in the listbox/treeview\n\n      ;Save the current ShellVarContext\n      !insertmacro UMUI_GETSHELLVARCONTEXT\n      Pop $MUI_TEMP2\n\n      ; In treeview mod, the create list function directly write into the ini because of the string lengh limit to 1024 characters\n      !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n\n        FlushINI \"$PLUGINSDIR\\AlternativeStartMenu${ID}.ini\"\n\n        FileOpen $MUI_TEMP1 \"$PLUGINSDIR\\AlternativeStartMenu${ID}.ini\" a\n\n        ;search the last \"ListItems=\" in the ini and seek just after\n        Push $R0\n\n        StrCpy $UMUI_TEMP3 0\n        seekloop:\n          IntOp $UMUI_TEMP3 $UMUI_TEMP3 - 1\n          FileSeek $MUI_TEMP1 $UMUI_TEMP3 END\n          !ifdef NSIS_UNICODE\n            FileReadUTF16LE $MUI_TEMP1 $R0 10\n          !else\n            FileRead $MUI_TEMP1 $R0 10\n          !endif\n          StrCmp $R0 \"ListItems=\" 0 seekloop\n            !ifdef NSIS_UNICODE\n              IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 20\n            !else\n              IntOp $UMUI_TEMP3 $UMUI_TEMP3 + 10\n            !endif\n            FileSeek $MUI_TEMP1 $UMUI_TEMP3 END\n\n        Pop $R0\n\n        Push 0\n        Push \"\"\n\n        Call ${CREATELIST}\n\n        FileClose $MUI_TEMP1\n\n      !else\n\n        Call ${CREATELIST}\n\n        Pop $MUI_TEMP1\n\n      !endif\n\n      ;Save the saved ShellVarContext\n      StrCmp $MUI_TEMP2 \"current\" 0 +3\n        SetShellVarContext current\n      Goto +2\n        SetShellVarContext all\n\n      ClearErrors\n\n\n      ;end search all directory and add it in the listbox/treeview\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"AlternativeStartMenu${ID}.ini\" \"Field 1\" \"Text\" \"MUI_STARTMENUPAGE_TEXT_TOP\"\n\n      ;if in the old install the startmenu folder was disabled\n      StrCmp \"${MUI_STARTMENUPAGE_VARIABLE}\" \">\" 0 +5\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 2\" State \"${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 2\" Flags \"DISABLED\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" Flags \"NOTIFY|DISABLED\"\n        Goto +3\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 2\" State \"${MUI_STARTMENUPAGE_VARIABLE}\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" State \"$UMUI_TEMP4\"\n\n      !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" Type \"TreeView\"\n      !endif\n\n      ; we write only if it was not already doing by the createlist function (in case of the list lenght is > to 1024 character)\n      !ifndef UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" ListItems \"$MUI_TEMP1\"\n      !endif\n\n      !ifndef MUI_STARTMENUPAGE_NODISABLE\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" Bottom -12\n\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" Type \"CheckBox\"\n        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT  \"AlternativeStartMenu${ID}.ini\" \"Field 4\" \"Text\" \"MUI_STARTMENUPAGE_TEXT_CHECKBOX\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" Left 0\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" Right -1\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" Top -12\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" Bottom -1\n\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" State 0\n\n        StrCmp \"${MUI_STARTMENUPAGE_VARIABLE}\" \">\" 0 +2\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" State 1\n\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" Flags NOTIFY\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" Notify ONCLICK\n\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Settings\" NumFields 4\n      !endif\n\n      !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n\n        !ifdef MUI_STARTMENUPAGE_NODISABLE\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" \"Bottom\" \"-40\"\n        !else\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" \"Top\" \"-52\"\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 4\" \"Bottom\" \"-40\"\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" \"Bottom\" \"-53\"\n        !endif\n\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMGOUPBOXFIELD}\" \"Type\" \"GroupBox\"\n        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMGOUPBOXFIELD}\" \"Text\" \"UMUI_STARTMENUPAGE_SHELL_VAR_CONTEXT_TITLE\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMGOUPBOXFIELD}\" \"Left\" \"70\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMGOUPBOXFIELD}\" \"Right\" \"-70\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMGOUPBOXFIELD}\" \"Top\" \"-40\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMGOUPBOXFIELD}\" \"Bottom\" \"-1\"\n\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"Type\" \"RadioButton\"\n        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"Text\" \"UMUI_STARTMENUPAGE_TEXT_FOR_ALL_USERS\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"Left\" \"80\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"Right\" \"-80\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"Top\" \"-29\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"Bottom\" \"-19\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"Flag\" \"GROUP\"\n\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"Type\" \"RadioButton\"\n        !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"Text\" \"UMUI_STARTMENUPAGE_TEXT_FOR_THE_CURRENT_USER\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"Left\" \"80\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"Right\" \"-80\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"Top\" \"-17\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"Bottom\" \"-7\"\n\n        StrCmp $UMUI_TEMP5 \"User\" 0 admin\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" Flags \"DISABLED\"\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" Flags \"DISABLED\"\n\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"State\" \"1\"\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"State\" \"0\"\n          Goto endcontext\n        admin:\n          StrCmp $MUI_TEMP2 \"current\" 0 +4\n            !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"State\" \"1\"\n            !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"State\" \"0\"\n          Goto +3\n            !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" \"State\" \"1\"\n            !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" \"State\" \"0\"\n        endcontext:\n\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Settings\" NumFields \"${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\"\n      !endif\n\n    alreadyExists:\n\n    StrCpy $UMUI_TEMP3 \">\"\n\n    !ifndef MUI_STARTMENUPAGE_NODISABLE\n\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AlternativeStartMenu${ID}.ini\" \"Field 4\" State\n\n      StrCmp $MUI_TEMP1 \"1\" 0 nodisable\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 2\" Flags \"DISABLED\"\n        !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" Flags \"NOTIFY|DISABLED\"\n        !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" Flags \"DISABLED\"\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" Flags \"DISABLED\"\n        !endif\n        Goto endnodisable\n      nodisable:\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AlternativeStartMenu${ID}.ini\" \"Field 2\" \"State\"\n        StrCmp $MUI_TEMP2 \"\" 0 +3\n          GetDlgItem $MUI_HWND $HWNDPARENT 1 ;next\n          EnableWindow $MUI_HWND 0\n\n      endnodisable:\n\n    !else\n      !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Settings\" NumFields \"3\"\n\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AlternativeStartMenu${ID}.ini\" \"Field 2\" \"State\"\n      StrCmp $MUI_TEMP2 \"\" 0 +3\n        GetDlgItem $MUI_HWND $HWNDPARENT 1 ;next\n        EnableWindow $MUI_HWND 0\n\n    !endif\n\n    StrCmp $MUI_TEMP1 \"0\" 0 noenable\n      !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 2\" Flags \"\"\n      !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field 3\" Flags \"NOTIFY\"\n      !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n        StrCmp $UMUI_TEMP5 \"Admin\" 0 noenable\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" Flags \"\"\n          !insertmacro INSTALLOPTIONS_WRITE \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMCURRENTOPTFIELD}\" Flags \"\"\n      !endif\n    noenable:\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY_RETURN \"AlternativeStartMenu${ID}.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    ;only the first time, get the HWND\n    StrCmp $UMUI_TEMP3 \">\" 0 +2\n      Pop $UMUI_TEMP3\n\n    GetDlgItem $MUI_HWND $HWNDPARENT 1 ;next\n    EnableWindow $MUI_HWND 1\n\n    !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AlternativeStartMenu${ID}.ini\" \"Settings\" State\n\n    ; if not next, back or cancel\n    StrCmp $MUI_TEMP1 \"0\" ok 0\n\n      ; if inputtext\n      StrCmp $MUI_TEMP1 \"2\" 0 noinputtext\n\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AlternativeStartMenu${ID}.ini\" \"Field 2\" \"State\"\n        StrCmp $MUI_TEMP2 \"\" 0 +2\n          EnableWindow $MUI_HWND 0\n\n        ClearErrors\n        Abort\n\n      noinputtext:\n      ; if listbox or treeview\n      StrCmp $MUI_TEMP1 \"3\" 0 checkbox\n\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AlternativeStartMenu${ID}.ini\" \"Field 3\" \"State\"\n\n        ;Conversion IOEx State string into Folder string\n        !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n          !insertmacro UMUI_STRREPLACE $MUI_TEMP2 \"{\" \"\\\" $MUI_TEMP2\n          !insertmacro UMUI_STRREPLACE $MUI_TEMP2 \"}\" \"\" $MUI_TEMP2\n        !endif\n\n        GetDlgItem $MUI_HWND $UMUI_TEMP3 1201 ;\"Field 2\" \"HWND\"\n        SendMessage $MUI_HWND ${WM_SETTEXT} 0 \"STR:$MUI_TEMP2\\${MUI_STARTMENUPAGE_DEFAULTFOLDER}\"\n\n        ClearErrors\n        Abort\n\n      checkbox:\n        !ifndef MUI_STARTMENUPAGE_NODISABLE\n\n          !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AlternativeStartMenu${ID}.ini\" \"Field 4\" \"State\"\n          StrCmp $MUI_TEMP2 \"0\" 0 +3\n            StrCpy $MUI_TEMP2 1\n          Goto +2\n            StrCpy $MUI_TEMP2 0\n\n          GetDlgItem $MUI_HWND $UMUI_TEMP3 1201 ;\"Field 2\" \"HWND\"\n          EnableWindow $MUI_HWND $MUI_TEMP2\n          GetDlgItem $MUI_HWND $UMUI_TEMP3 1202 ;\"Field 3\" \"HWND\"\n          EnableWindow $MUI_HWND $MUI_TEMP2\n\n          !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n\n            ; enable only if admin rights\n            StrCmp $UMUI_TEMP5 \"Admin\" 0 +5\n\n              GetDlgItem $MUI_HWND $UMUI_TEMP3 1205 ;\"Field 6\" \"HWND\"\n              EnableWindow $MUI_HWND $MUI_TEMP2\n              GetDlgItem $MUI_HWND $UMUI_TEMP3 1206 ;\"Field 7\" \"HWND\"\n              EnableWindow $MUI_HWND $MUI_TEMP2\n\n          !endif\n\n          StrCmp $MUI_TEMP2 \"1\" 0 endcheckbox\n\n            GetDlgItem $MUI_HWND $HWNDPARENT 1 ;next\n\n            !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"AlternativeStartMenu${ID}.ini\" \"Field 2\" \"State\"\n            StrCmp $MUI_TEMP2 \"\" 0 +2\n              EnableWindow $MUI_HWND 0\n\n          endcheckbox:\n\n          Abort\n\n        !endif\n\n      Goto end\n    ok:\n\n    !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n\n      !ifdef UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME\n        !ifndef UMUI_SHELLVARCONTEXT_REGISTRY_ROOT\n          !ifdef UMUI_PARAMS_REGISTRY_ROOT\n            !define UMUI_SHELLVARCONTEXT_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n          !else\n            !error \"For UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME, the UMUI_SHELLVARCONTEXT_REGISTRY_ROOT & UMUI_SHELLVARCONTEXT_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n          !endif\n        !endif\n        !ifndef UMUI_SHELLVARCONTEXT_REGISTRY_KEY\n          !ifdef UMUI_PARAMS_REGISTRY_KEY\n            !define UMUI_SHELLVARCONTEXT_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n          !else\n            !error \"For UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME, the UMUI_SHELLVARCONTEXT_REGISTRY_ROOT & UMUI_SHELLVARCONTEXT_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n          !endif\n        !endif\n      !endif\n\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AlternativeStartMenu${ID}.ini\" \"Field ${UMUI_INTERNAL_ASMALLOPTFIELD}\" State\n        StrCmp $MUI_TEMP1 \"1\" 0 current\n          SetShellVarContext all\n          !ifdef UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME\n            !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_SHELLVARCONTEXT_REGISTRY_ROOT} \"${UMUI_SHELLVARCONTEXT_REGISTRY_KEY}\"  \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\" \"all\"\n          !endif\n          Goto endcontext\n\n        current:\n        SetShellVarContext current\n        !ifdef UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME\n          !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_SHELLVARCONTEXT_REGISTRY_ROOT} \"${UMUI_SHELLVARCONTEXT_REGISTRY_KEY}\" \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\" \"current\"\n        !endif\n      endcontext:\n\n    !endif\n\n    ClearErrors\n\n    !ifndef MUI_STARTMENUPAGE_NODISABLE\n      !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"AlternativeStartMenu${ID}.ini\" \"Field 4\" State\n      StrCmp $MUI_TEMP1 \"1\" 0 +3\n        StrCpy \"${MUI_STARTMENUPAGE_VARIABLE}\" \">\"\n        Goto +2\n    !endif\n\n    !insertmacro INSTALLOPTIONS_READ \"${MUI_STARTMENUPAGE_VARIABLE}\" \"AlternativeStartMenu${ID}.ini\" \"Field 2\" State\n\n    !ifdef MUI_STARTMENUPAGE_REGISTRY_VALUENAME\n      !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${MUI_STARTMENUPAGE_REGISTRY_ROOT} \"${MUI_STARTMENUPAGE_REGISTRY_KEY}\" \"${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}\" \"${MUI_STARTMENUPAGE_VARIABLE}\"\n    !endif\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    end:\n\n  FunctionEnd\n\n  Function \"${CREATELIST}\"\n\n    !ifdef UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n      !insertmacro UMUI_INTERNAL_CREATE_SMTREELIST\n    !else\n      !insertmacro UMUI_INTERNAL_CREATE_SMLIST\n    !endif\n\n  FunctionEnd\n\n  !undef UMUI_INTERNAL_ASMGOUPBOXFIELD\n  !undef UMUI_INTERNAL_ASMALLOPTFIELD\n  !undef UMUI_INTERNAL_ASMCURRENTOPTFIELD\n\n!macroend\n\n\n!macro UMUI_INTERNAL_CREATE_SMLIST_LOOP SHELLVARCONTEXT\n\n  SetShellVarContext ${SHELLVARCONTEXT}\n\n  FindFirst $R3 $R1 \"$SMPROGRAMS\\$R4\\*\"\n  FindNext $R3 $R1\n\n  loop${SHELLVARCONTEXT}:\n    FindNext $R3 $R1\n\n    StrCmp $R1 \"\" exit${SHELLVARCONTEXT}\n      IfFileExists \"$SMPROGRAMS\\$R4\\$R1\\*\" 0 loop${SHELLVARCONTEXT}\n        nsArray::Set \"SMProgList$R2\" /key='$R1' '$R1'\n        Goto loop${SHELLVARCONTEXT}\n\n  exit${SHELLVARCONTEXT}:\n    FindClose $R3\n\n!macroend\n\n; Generate the folder list for a listview\n!macro UMUI_INTERNAL_CREATE_SMLIST\n\n  Push $R4  ; directory to explore and the returned item list\n  Push $R1  ; current folder to look\n  Push $R3  ; the folder handle\n  Push $R2  ; Array name level (empty in this macro)\n\n  StrCpy $R4 \"\"\n  StrCpy $R2 \"\"\n\n  !insertmacro UMUI_INTERNAL_CREATE_SMLIST_LOOP all\n  !insertmacro UMUI_INTERNAL_CREATE_SMLIST_LOOP current\n\n  nsArray::Sort \"SMProgList$R2\" 4\n\n  nsArray::Join \"SMProgList$R2\" \"|\"\n  Pop $R4\n\n  nsArray::Clear \"SMProgList$R2\"\n\n  Pop $R2\n  Pop $R3\n  Pop $R1\n\n  Exch $R4  ; return the item list\n\n!macroend\n\n\n; Generate the folder list for a treeview\n!macro UMUI_INTERNAL_CREATE_SMTREELIST\n\n  Exch $R4  ; directory to explore\n  Exch      ; $R4 under $R2\n  Exch $R2  ; Array name level number\n\n  Push $R0  ; counter of the number of items added in this subdirectory\n  Push $R1  ; current folder to look and treeview: pop the return of the recursive function\n  Push $R3  ; the folder handle\n  Push $R5  ; the number of the level\n  Push $R6  ; the current item returned by the Read function\n\n  !insertmacro UMUI_INTERNAL_CREATE_SMLIST_LOOP all\n  !insertmacro UMUI_INTERNAL_CREATE_SMLIST_LOOP current\n\n  nsArray::Sort \"SMProgList$R2\" 4\n\n  IntOp $R5 $R2 + 1\n  StrCpy $R1 0\n  StrCpy $R0 0\n\n  ;for each item of the $R2 level, begin with the end\n  loop:\n    ClearErrors\n    nsArray::Get \"SMProgList$R2\" /at=$R0\n    IfErrors end 0\n      Pop $R6 ; key\n      Pop $R6 ; value\n\n      StrCmp $R2 \"0\" endfirstleveltest 0\n        StrCmp $R0 \"0\" 0 +3\n          !ifdef NSIS_UNICODE\n            FileWriteUTF16LE $MUI_TEMP1 \"{\"\n          !else\n            FileWrite $MUI_TEMP1 \"{\"\n          !endif\n          Goto endfirstleveltest\n        StrCmp $R1 \"}\" +2 0\n          !ifdef NSIS_UNICODE\n            FileWriteUTF16LE $MUI_TEMP1 \"|\"\n          !else\n            FileWrite $MUI_TEMP1 \"|\"\n          !endif\n      endfirstleveltest:\n        StrCmp $R2 \"0\" 0 +4\n          StrCmp $R0 \"0\" +3 0\n            StrCmp $R1 \"}\" +2 0\n            !ifdef NSIS_UNICODE\n              FileWriteUTF16LE $MUI_TEMP1 \"|\"\n            !else\n              FileWrite $MUI_TEMP1 \"|\"\n            !endif\n\n      !ifdef NSIS_UNICODE\n        FileWriteUTF16LE $MUI_TEMP1 \"$R6\"\n      !else\n        FileWrite $MUI_TEMP1 \"$R6\"\n      !endif\n\n      Push $R5\n      Push \"$R4\\$R6\"\n      Call ${CREATELIST}\n      Pop $R1\n\n      IntOp $R0 $R0 + 1\n\n      Goto loop\n    end:\n\n    StrCpy $R4 \"0\"\n\n    StrCmp $R2 \"0\" +4 0\n      StrCmp $R0 \"0\" +3 0\n        !ifdef NSIS_UNICODE\n          FileWriteUTF16LE $MUI_TEMP1 \"}\"\n        !else\n          FileWrite $MUI_TEMP1 \"}\"\n        !endif\n        StrCpy $R4 \"}\"\n\n  nsArray::Clear \"SMProgList$R2\"\n\n  Pop $R6\n  Pop $R5\n  Pop $R3\n  Pop $R1\n  Pop $R0\n\n  StrCmp $R2 \"0\" 0 nolevel0\n    Pop $R2\n    Pop $R4\n    Goto +3\n  nolevel0:\n    Pop $R2\n    Exch $R4  ; return \"}\" if it is the last character writed in the ini file, \"0\" otherwise and nothing if root directory\n\n!macroend\n\n\n\n\n!macro UMUI_INTERNAL_PAGES_SETUPTYPE_MAINTENANCE_INI_4OPTIONS FILE\n\n  !ifdef UMUI_USE_SMALL_PAGES\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 1\" Bottom 17\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 2\" Top 17\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 2\" Bottom 27\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 3\" Top 27\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 3\" Bottom 47\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 4\" Top 27\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 4\" Bottom 48\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 5\" Top 48\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 5\" Bottom 58\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 6\" Top 58\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 6\" Bottom 78\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 7\" Top 58\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 7\" Bottom 79\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 8\" Top 79\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 8\" Bottom 89\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 9\" Top 89\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 9\" Bottom 109\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 10\" Top 89\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 10\" Bottom 110\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 11\" Top 110\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 11\" Bottom 120\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 12\" Top 120\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 12\" Bottom 140\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 13\" Top 120\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Field 13\" Bottom 140\n  !endif\n\n!macroend\n\n\n\n!macro UMUI_PAGE_SETUPTYPE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}SETUPTYPEPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_TEXT \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SETUPTYPE_INFO_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_MINIMAL_TITLE \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_MINIMAL_TEXT \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SETUPTYPE_MINIMAL_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_STANDARD_TITLE \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_STANDARD_TEXT \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SETUPTYPE_STANDARD_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_COMPLETE_TITLE \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_COMPLETE_TEXT \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SETUPTYPE_COMPLETE_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_CUSTOM_TITLE \"$(UMUI_TEXT_SETUPTYPE_CUSTOM_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_SETUPTYPEPAGE_CUSTOM_TEXT \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SETUPTYPE_CUSTOM_TEXT)\"\n\n!ifndef USE_MUIEx\n;-----------------\n  !define /IfNDef UMUI_SETUPTYPEPAGE_MINIMALBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Minimal.bmp\"\n  !define /IfNDef UMUI_SETUPTYPEPAGE_STANDARDBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Standard.bmp\"\n  !define /IfNDef UMUI_SETUPTYPEPAGE_COMPLETEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Complete.bmp\"\n  !define /IfNDef UMUI_SETUPTYPEPAGE_CUSTOMBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Custom.bmp\"\n!else\n;-----\n  !define /IfNDef UMUI_SETUPTYPEPAGE_MINIMALBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\MinimalEx.bmp\"\n  !define /IfNDef UMUI_SETUPTYPEPAGE_STANDARDBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\StandardEx.bmp\"\n  !define /IfNDef UMUI_SETUPTYPEPAGE_COMPLETEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\CompleteEx.bmp\"\n  !define /IfNDef UMUI_SETUPTYPEPAGE_CUSTOMBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\CustomEx.bmp\"\n!endif\n;------\n\n  !define /IfNDef UMUI_SETUPTYPEPAGE_DEFAULTCHOICE ${UMUI_CUSTOM}\n\n  !ifdef UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME\n    !ifndef UMUI_SETUPTYPEPAGE_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_SETUPTYPEPAGE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME, the UMUI_SETUPTYPEPAGE_REGISTRY_ROOT & UMUI_SETUPTYPEPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_SETUPTYPEPAGE_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_SETUPTYPEPAGE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME, the UMUI_SETUPTYPEPAGE_REGISTRY_ROOT & UMUI_SETUPTYPEPAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP3\n    Var UMUI_TEMP3\n    !define UMUI_VAR_UMUI_TEMP3\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP4\n    Var UMUI_TEMP4\n    !define UMUI_VAR_UMUI_TEMP4\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypeLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_SETUPTYPEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypeLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_TEXT\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_MINIMAL_TITLE\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_MINIMAL_TEXT\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_STANDARD_TITLE\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_STANDARD_TEXT\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_COMPLETE_TITLE\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_COMPLETE_TEXT\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_CUSTOM_TITLE\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_CUSTOM_TEXT\n\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_MINIMALBITMAP\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_STANDARDBITMAP\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_COMPLETEBITMAP\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_CUSTOMBITMAP\n\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_MINIMAL\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_STANDARD\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_COMPLETE\n\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_DEFAULTCHOICE\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_REGISTRY_ROOT\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_REGISTRY_KEY\n  !insertmacro MUI_UNSET UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_UNPAGE_SETUPTYPE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_SETUPTYPE\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_FUNCTION_SETUPTYPEPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    IfFileExists \"$PLUGINSDIR\\SetupType.ini\" alreadyExists\n\n      !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_MAINTENANCEUPDATESETUPTYPEPAGE_INI}\" \"SetupType.ini\"\n\n      ;reduce the size of the page win 4 options and a small installer\n      !ifdef UMUI_SETUPTYPEPAGE_MINIMAL & UMUI_SETUPTYPEPAGE_STANDARD & UMUI_SETUPTYPEPAGE_COMPLETE\n        !insertmacro UMUI_INTERNAL_PAGES_SETUPTYPE_MAINTENANCE_INI_4OPTIONS \"SetupType.ini\"\n      !endif\n\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"SetupType.ini\" \"Field 1\" \"Text\" \"UMUI_SETUPTYPEPAGE_TEXT\"\n\n      ;Get registry and set the insttype\n      StrCpy $UMUI_TEMP4 ${UMUI_SETUPTYPEPAGE_DEFAULTCHOICE}\n\n      !ifdef UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME\n\n        ReadRegStr $MUI_TEMP1 ${UMUI_SETUPTYPEPAGE_REGISTRY_ROOT} \"${UMUI_SETUPTYPEPAGE_REGISTRY_KEY}\" \"${UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME}\"\n\n        StrCmp $MUI_TEMP1 \"MINIMAL\" 0 nominimal\n          StrCpy $UMUI_TEMP4 ${UMUI_MINIMAL}\n          Goto endreg\n        nominimal:\n        StrCmp $MUI_TEMP1 \"STANDARD\" 0 nostandard\n          StrCpy $UMUI_TEMP4 ${UMUI_STANDARD}\n          Goto endreg\n        nostandard:\n        StrCmp $MUI_TEMP1 \"COMPLETE\" 0 nocomplete\n          StrCpy $UMUI_TEMP4 ${UMUI_COMPLETE}\n          Goto endreg\n        nocomplete:\n        StrCmp $MUI_TEMP1 \"CUSTOM\" 0 endreg\n          StrCpy $UMUI_TEMP4 ${UMUI_CUSTOM}\n        endreg:\n\n        ClearErrors\n\n        ; IF page skipped save\n        !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_SETUPTYPEPAGE_REGISTRY_ROOT} \"${UMUI_SETUPTYPEPAGE_REGISTRY_KEY}\" \"${UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME}\" $MUI_TEMP1\n\n      !endif\n\n      !define UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER 1\n\n      !insertmacro UMUI_INTERNAL_PAGE_SETUPTYPE_ADDOPTION MINIMAL\n      !insertmacro UMUI_INTERNAL_PAGE_SETUPTYPE_ADDOPTION STANDARD\n      !insertmacro UMUI_INTERNAL_PAGE_SETUPTYPE_ADDOPTION COMPLETE\n\n      File \"/oname=$PLUGINSDIR\\Custom.bmp\" \"${UMUI_SETUPTYPEPAGE_CUSTOMBITMAP}\"\n      !define /redef /math UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER} + 1\n\n      StrCmp $UMUI_TEMP4 ${UMUI_CUSTOM} 0 +3\n        !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" State \"1\"\n      Goto +2\n        !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" State \"0\"\n\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" InstTypeID \"-1\"\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" InstTypeOption \"${UMUI_CUSTOM}\"\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" InstTypeOptionName \"CUSTOM\"\n\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT  \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" \"Text\" \"UMUI_SETUPTYPEPAGE_CUSTOM_TITLE\"\n      !define /redef /math UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER} + 1\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" \"Text\" \"$PLUGINSDIR\\Custom.bmp\"\n      !define /redef /math UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER} + 1\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT  \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" \"Text\" \"UMUI_SETUPTYPEPAGE_CUSTOM_TEXT\"\n\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Settings\" \"NumFields\" \"${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\"\n\n      !undef UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER\n\n    alreadyExists:\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    ; Bodenseematze-2016-09-15: missing PRE-Function support added:\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SETUPTYPE_TITLE)\" \"$(UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_SETUPTYPE_SUBTITLE)\"\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY \"SetupType.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro UMUI_INTERNAL_PAGE_SETUPTYPE_GETOPTION 2\n    !insertmacro UMUI_INTERNAL_PAGE_SETUPTYPE_GETOPTION 5\n    !insertmacro UMUI_INTERNAL_PAGE_SETUPTYPE_GETOPTION 8\n    !insertmacro UMUI_INTERNAL_PAGE_SETUPTYPE_GETOPTION 11\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n  FunctionEnd\n\n!macroend\n\n!macro UMUI_INTERNAL_PAGE_SETUPTYPE_ADDOPTION OPTION\n\n  !ifdef UMUI_SETUPTYPEPAGE_${OPTION}\n    File \"/oname=$PLUGINSDIR\\${OPTION}.bmp\" \"${UMUI_SETUPTYPEPAGE_${OPTION}BITMAP}\"\n    !define /redef /math UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER} + 1\n\n    ;search the ID of the InstType Associated to this option\n    ClearErrors\n    StrCpy $MUI_TEMP2 0\n    loop${OPTION}:\n      InstTypeGetText $MUI_TEMP2 $UMUI_TEMP3\n      IfErrors notfound${OPTION}\n      StrCmp $UMUI_TEMP3 \"${UMUI_SETUPTYPEPAGE_${OPTION}}\" found${OPTION} 0\n        IntOp $MUI_TEMP2 $MUI_TEMP2 + 1\n        Goto loop${OPTION}\n    found${OPTION}:\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" InstTypeID \"$MUI_TEMP2\"\n      Goto end${OPTION}\n    notfound${OPTION}:\n      ClearErrors\n      MessageBox MB_OK \"Error: ${UMUI_SETUPTYPEPAGE_${OPTION}} is not an defined InstType...$\\nThis option will not work.\"\n    end${OPTION}:\n\n    StrCmp $UMUI_TEMP4 ${UMUI_${OPTION}} 0 +4\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" State \"1\"\n      SetCurInstType $MUI_TEMP2\n    Goto +2\n      !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" State \"0\"\n\n    !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" InstTypeOption \"${UMUI_${OPTION}}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" InstTypeOptionName \"${OPTION}\"\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" \"Text\" \"UMUI_SETUPTYPEPAGE_${OPTION}_TITLE\"\n    !define /redef /math UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER} + 1\n    !insertmacro INSTALLOPTIONS_WRITE \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" \"Text\" \"$PLUGINSDIR\\${OPTION}.bmp\"\n    !define /redef /math UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER} + 1\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"SetupType.ini\" \"Field ${UMUI_INTERNAL_PAGE_SETUPTYPE_COUNTER}\" \"Text\" \"UMUI_SETUPTYPEPAGE_${OPTION}_TEXT\"\n  !endif\n\n!macroend\n\n!macro UMUI_INTERNAL_PAGE_SETUPTYPE_GETOPTION FIELDNUMBER\n\n  !insertmacro INSTALLOPTIONS_READ $UMUI_TEMP3 \"SetupType.ini\" \"Field ${FIELDNUMBER}\" \"InstTypeOption\"\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"SetupType.ini\" \"Field ${FIELDNUMBER}\" \"State\"\n  StrCmp $MUI_TEMP1 \"1\" 0 no${FIELDNUMBER}\n\n    !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"SetupType.ini\" \"Field ${FIELDNUMBER}\" \"InstTypeID\"\n    StrCmp $MUI_TEMP2 \"-1\" +2 0\n      SetCurInstType $MUI_TEMP2\n\n      !insertmacro UMUI_SET_INSTALLFLAG $UMUI_TEMP3\n\n      !ifdef UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME\n        !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"SetupType.ini\" \"Field ${FIELDNUMBER}\" \"InstTypeOptionName\"\n        !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_SETUPTYPEPAGE_REGISTRY_ROOT} \"${UMUI_SETUPTYPEPAGE_REGISTRY_KEY}\" \"${UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME}\" $MUI_TEMP1\n      !endif\n\n    Goto end${FIELDNUMBER}\n  no${FIELDNUMBER}:\n    !insertmacro UMUI_UNSET_INSTALLFLAG $UMUI_TEMP3\n  end${FIELDNUMBER}:\n\n!macroend\n\n!macro UMUI_GET_CHOOSEN_SETUP_TYPE_TEXT\n\n  Push $R0\n  Push $R1\n\n  !insertmacro INSTALLOPTIONS_READ $R1 \"SetupType.ini\" \"Field 2\" \"State\"\n  StrCmp $R1 \"1\" 0 +3\n    !insertmacro INSTALLOPTIONS_READ $R0 \"SetupType.ini\" \"Field 2\" \"Text\"\n    Goto end\n\n  !insertmacro INSTALLOPTIONS_READ $R1 \"SetupType.ini\" \"Field 5\" \"State\"\n  StrCmp $R1 \"1\" 0 +3\n    !insertmacro INSTALLOPTIONS_READ $R0 \"SetupType.ini\" \"Field 5\" \"Text\"\n    Goto end\n\n  !insertmacro INSTALLOPTIONS_READ $R1 \"SetupType.ini\" \"Field 8\" \"State\"\n  StrCmp $R1 \"1\" 0 +3\n    !insertmacro INSTALLOPTIONS_READ $R0 \"SetupType.ini\" \"Field 8\" \"Text\"\n    Goto end\n\n  !insertmacro INSTALLOPTIONS_READ $R0 \"SetupType.ini\" \"Field 11\" \"Text\"\n\n  end:\n\n  Push $R1\n  Exch $R0\n\n!macroend\n\n\n\n!macro UMUI_PAGE_MAINTENANCE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}MAINTENANCEPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_TEXT \"$(UMUI_TEXT_MAINTENANCE_INFO_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_MODIFY_TITLE \"$(UMUI_TEXT_MAINTENANCE_MODIFY_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_MODIFY_TEXT \"$(UMUI_TEXT_MAINTENANCE_MODIFY_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_REPAIR_TITLE \"$(UMUI_TEXT_MAINTENANCE_REPAIR_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_REPAIR_TEXT \"$(UMUI_TEXT_MAINTENANCE_REPAIR_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_REMOVE_TITLE \"$(UMUI_TEXT_MAINTENANCE_REMOVE_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_REMOVE_TEXT \"$(UMUI_TEXT_MAINTENANCE_REMOVE_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_CONTINUE_SETUP_TITLE \"$(UMUI_TEXT_MAINTENANCE_CONTINUE_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_MAINTENANCEPAGE_CONTINUE_SETUP_TEXT \"$(UMUI_TEXT_MAINTENANCE_CONTINUE_TEXT)\"\n\n!ifndef USE_MUIEx\n;-----------------\n  !define /IfNDef UMUI_MAINTENANCEPAGE_MODIFYBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Modify.bmp\"\n  !define /IfNDef UMUI_MAINTENANCEPAGE_REPAIRBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Repair.bmp\"\n  !define /IfNDef UMUI_MAINTENANCEPAGE_REMOVEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Remove.bmp\"\n  !define /IfNDef UMUI_MAINTENANCEPAGE_CONTINUE_SETUPBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Continue.bmp\"\n!else\n;-----\n  !define /IfNDef UMUI_MAINTENANCEPAGE_MODIFYBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\ModifyEx.bmp\"\n  !define /IfNDef UMUI_MAINTENANCEPAGE_REPAIRBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\RepairEx.bmp\"\n  !define /IfNDef UMUI_MAINTENANCEPAGE_REMOVEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\RemoveEx.bmp\"\n  !define /IfNDef UMUI_MAINTENANCEPAGE_CONTINUE_SETUPBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\ContinueEx.bmp\"\n!endif\n;------\n\n  !ifdef UMUI_MAINTENANCEPAGE_MODIFY\n    !define /IfNDef UMUI_MAINTENANCEPAGE_DEFAULTCHOICE ${UMUI_MODIFY}\n  !else ifdef UMUI_MAINTENANCEPAGE_REPAIR\n    !define /IfNDef UMUI_MAINTENANCEPAGE_DEFAULTCHOICE ${UMUI_REPAIR}\n  !endif\n\n  !ifndef UMUI_MAINTENANCEPAGE_MODIFY & UMUI_MAINTENANCEPAGE_REPAIR\n    !error \"Maintenance page: You need to define at least one of these options: UMUI_MAINTENANCEPAGE_MODIFY or UMUI_MAINTENANCEPAGE_REPAIR.\"\n  !endif\n\n  !ifdef UMUI_MAINTENANCEPAGE_REMOVE\n    !ifndef UMUI_UNINSTALL_FULLPATH | UMUI_UNINSTALLPATH_REGISTRY_VALUENAME\n      !error \"Maintenance page: You need to set the UMUI_UNINSTALL_FULLPATH and UMUI_UNINSTALLPATH_REGISTRY_VALUENAME defines with the UMUI_MAINTENANCEPAGE_REMOVE option.\"\n    !endif\n  !endif\n\n  !ifndef UMUI_PREUNINSTALL_FUNCTION\n    !warning \"Maintenance page: You need to set the UMUI_PREUNINSTALL_FUNCTION define with a clean install function.\"\n  !endif\n\n  !ifndef UMUI_VERBUILD_REGISTRY_VALUENAME | UMUI_VERBUILD\n    !error \"Maintenance page: You need to set the UMUI_VERBUILD_REGISTRY_VALUENAME and UMUI_VERBUILD defines with this page.\"\n  !endif\n\n  !ifndef UMUI_VAR_UMUI_TEMP3\n    Var UMUI_TEMP3\n    !define UMUI_VAR_UMUI_TEMP3\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypeLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_MAINTENANCEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.setuptypeLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_TEXT\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_MODIFY_TITLE\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_MODIFY_TEXT\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REPAIR_TITLE\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REPAIR_TEXT\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REMOVE_TITLE\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REMOVE_TEXT\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_CONTINUE_SETUP_TITLE\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_CONTINUE_SETUP_TEXT\n\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_MODIFYBITMAP\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REPAIRBITMAP\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REMOVEBITMAP\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_CONTINUE_SETUPBITMAP\n\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_DEFAULTCHOICE\n\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_MODIFY\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REPAIR\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_REMOVE\n  !insertmacro MUI_UNSET UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_UNPAGE_MAINTENANCE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !ifndef UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME\n      !warning \"The MAINTENANCE unpage need the UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME define\"\n    !endif\n\n    !ifndef UMUI_VAR_UMUI_TEMP4\n      Var UMUI_TEMP4\n      !define UMUI_VAR_UMUI_TEMP4\n    !endif\n\n    !insertmacro UMUI_PAGE_MAINTENANCE\n\n    ; IF installer can't be found\n    !define /redef UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_REMOVE}\n    !define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.umui.fileRequestLeave\n\n    !define UMUI_FILEDISKREQUESTPAGE_VARIABLE UMUI_TEMP4\n    !define UMUI_FILEDISKREQUESTPAGE_FILE_NAME $MUI_TEMP2\n    !define MUI_PAGE_HEADER_TEXT \"$(UMUI_TEXT_MAINTENANCE_TITLE)\"\n\n    Function un.umui.fileRequestLeave\n\n      ;Save the new installer file location\n      !ifdef UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME\n\n        !ifndef UMUI_INSTALLERFULLPATH_REGISTRY_ROOT\n          !ifdef UMUI_PARAMS_REGISTRY_ROOT\n            !define UMUI_INSTALLERFULLPATH_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n          !else\n            !error \"For UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME, the UMUI_INSTALLERFULLPATH_REGISTRY_ROOT & UMUI_INSTALLERFULLPATH_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n          !endif\n        !endif\n        !ifndef UMUI_INSTALLERFULLPATH_REGISTRY_KEY\n          !ifdef UMUI_PARAMS_REGISTRY_KEY\n            !define UMUI_INSTALLERFULLPATH_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n          !else\n            !error \"For UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME, the UMUI_INSTALLERFULLPATH_REGISTRY_ROOT & UMUI_INSTALLERFULLPATH_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n          !endif\n        !endif\n\n        !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_INSTALLERFULLPATH_REGISTRY_ROOT} \"${UMUI_INSTALLERFULLPATH_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\" \"$${UMUI_FILEDISKREQUESTPAGE_VARIABLE}\\${UMUI_FILEDISKREQUESTPAGE_FILE_NAME}\"\n      !endif\n\n      !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}\n        ;Recall this programm and quit\n        !insertmacro UMUI_GET_PARAMETERS\n        Pop $MUI_TEMP2\n\n        !insertmacro UMUI_DELETE_PLUGINDIR\n        HideWindow\n\n        ExecWait '\"$${UMUI_FILEDISKREQUESTPAGE_VARIABLE}\\${UMUI_FILEDISKREQUESTPAGE_FILE_NAME}\" $MUI_TEMP2 /modify /L=$LANGUAGE'\n        Quit\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n      !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REPAIR}\n        ;Recall this programm and quit\n        !insertmacro UMUI_GET_PARAMETERS\n        Pop $MUI_TEMP2\n\n        !insertmacro UMUI_DELETE_PLUGINDIR\n        HideWindow\n\n        ExecWait '\"$${UMUI_FILEDISKREQUESTPAGE_VARIABLE}\\${UMUI_FILEDISKREQUESTPAGE_FILE_NAME}\" $MUI_TEMP2 /repair /L=$LANGUAGE'\n        Quit\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n    FunctionEnd\n\n    !insertmacro UMUI_PAGE_FILEDISKREQUEST\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_FUNCTION_MAINTENANCEPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_UPDATE}\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_ISNOT ${UMUI_SAMEVERSION}\n\n    !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_ABORTFIRSTTIME}\n\n      ; call uninstaller if the /remove command line argument is set\n      !ifndef MUI_UNINSTALLER\n\n        !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REMOVE}\n\n          IfFileExists \"${UMUI_UNINSTALL_FULLPATH}\" 0 uninstaller_not_found\n            ;Recall this programm and quit\n            !insertmacro UMUI_GET_PARAMETERS\n            Pop $MUI_TEMP2\n\n            !insertmacro UMUI_DELETE_PLUGINDIR\n            HideWindow\n\n            ExecWait '\"${UMUI_UNINSTALL_FULLPATH}\" $MUI_TEMP2 /remove /L=$LANGUAGE'\n            Quit\n          uninstaller_not_found:\n          ClearErrors\n\n        !insertmacro UMUI_ENDIF_INSTALLFLAG\n        ;else continue\n\n      ; call installer if the /modify, /repair or /continue command line argument is set\n      !else\n\n        ReadRegStr $MUI_TEMP1 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\"\n        IfFileExists \"$MUI_TEMP1\" 0 installer_not_found\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_CONTINUE_SETUP}\n            ;Recall this programm and quit\n            !insertmacro UMUI_GET_PARAMETERS\n            Pop $MUI_TEMP2\n\n            !insertmacro UMUI_DELETE_PLUGINDIR\n            HideWindow\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}\n            ExecWait '\"$MUI_TEMP1\" $MUI_TEMP2 /modify /L=$LANGUAGE'\n            Quit\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REPAIR}\n            ExecWait '\"$MUI_TEMP1\" $MUI_TEMP2 /repair /L=$LANGUAGE'\n            Quit\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_CONTINUE_SETUP}\n            ExecWait '\"$MUI_TEMP1\" $MUI_TEMP2 /continue /L=$LANGUAGE'\n            Quit\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n        installer_not_found:\n        ClearErrors\n\n        ; continue to the next page for the File Request, Set the variable\n        !insertmacro UMUI_GETPARENTFOLDER $MUI_TEMP1\n        Pop $UMUI_TEMP4\n\n        StrLen $UMUI_TEMP3 $UMUI_TEMP4\n        StrCpy $MUI_TEMP2 $MUI_TEMP1 \"\" $UMUI_TEMP3\n\n      !endif\n\n\n      !insertmacro UMUI_UNSET_INSTALLFLAG ${UMUI_ABORTFIRSTTIME}\n      Abort\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n    ; Bodenseematze-2016-09-15: missing PRE-Function support added:\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"$(UMUI_TEXT_MAINTENANCE_TITLE)\" \"$(UMUI_TEXT_MAINTENANCE_SUBTITLE)\"\n\n    IfFileExists \"$PLUGINSDIR\\Maintenance.ini\" alreadyExists\n\n      !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_MAINTENANCEUPDATESETUPTYPEPAGE_INI}\" \"Maintenance.ini\"\n\n      ;reduce the size of the page win 4 options and a small installer\n      !ifdef UMUI_MAINTENANCEPAGE_MODIFY & UMUI_MAINTENANCEPAGE_REPAIR & UMUI_MAINTENANCEPAGE_REMOVE & UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n        !insertmacro UMUI_INTERNAL_PAGES_SETUPTYPE_MAINTENANCE_INI_4OPTIONS \"Maintenance.ini\"\n      !endif\n\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Maintenance.ini\" \"Field 1\" \"Text\" \"UMUI_MAINTENANCEPAGE_TEXT\"\n\n      StrCpy $UMUI_TEMP3 ${UMUI_MAINTENANCEPAGE_DEFAULTCHOICE}\n      !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}\n        StrCpy $UMUI_TEMP3 ${UMUI_MODIFY}\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n      !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REPAIR}\n        StrCpy $UMUI_TEMP3 ${UMUI_REPAIR}\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n      !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REMOVE}\n        StrCpy $UMUI_TEMP3 ${UMUI_REMOVE}\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n      !define UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER 1\n\n      !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_ADDOPTION MODIFY\n      !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_ADDOPTION REPAIR\n      !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_ADDOPTION REMOVE\n      !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_ADDOPTION CONTINUE_SETUP\n\n      !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Settings\" \"NumFields\" \"${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\"\n\n      !undef UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER\n\n    alreadyExists:\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY \"Maintenance.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_GETOPTION 2\n    !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_GETOPTION 5\n    !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_GETOPTION 8\n    !insertmacro UMUI_INTERNAL_PAGE_MAINTENANCE_GETOPTION 11\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !ifndef MUI_UNINSTALLER\n\n      !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_CANCELLED}\n\n        !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REMOVE}\n          ;Recall this programm and quit\n          !insertmacro UMUI_GET_PARAMETERS\n          Pop $MUI_TEMP2\n\n          !insertmacro UMUI_DELETE_PLUGINDIR\n          HideWindow\n\n          ExecWait '\"${UMUI_UNINSTALL_FULLPATH}\" $MUI_TEMP2 /remove /L=$LANGUAGE'\n          Quit\n        !insertmacro UMUI_ENDIF_INSTALLFLAG\n        ;else continue\n\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n    !else\n\n      ;Remove?\n      !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_REMOVE}&${UMUI_CANCELLED}\n\n        ReadRegStr $MUI_TEMP1 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\"\n        IfFileExists \"$MUI_TEMP1\" 0 installer_not_found\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_CONTINUE_SETUP}\n            ;Recall this programm and quit\n            !insertmacro UMUI_GET_PARAMETERS\n            Pop $MUI_TEMP2\n\n            !insertmacro UMUI_DELETE_PLUGINDIR\n            HideWindow\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}\n            ExecWait '\"$MUI_TEMP1\" $MUI_TEMP2 /modify /L=$LANGUAGE'\n            Quit\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REPAIR}\n            ExecWait '\"$MUI_TEMP1\" $MUI_TEMP2 /repair /L=$LANGUAGE'\n            Quit\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n          !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_CONTINUE_SETUP}\n            ExecWait '\"$MUI_TEMP1\" $MUI_TEMP2 /continue /L=$LANGUAGE'\n            Quit\n          !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n        installer_not_found:\n        ClearErrors\n\n        !insertmacro UMUI_GETPARENTFOLDER $MUI_TEMP1\n        Pop $UMUI_TEMP4\n\n        StrLen $UMUI_TEMP3 $UMUI_TEMP4\n        StrCpy $MUI_TEMP2 $MUI_TEMP1 \"\" $UMUI_TEMP3\n\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n      ;if installer file not found: continue (the next page will request the install exedir folder)\n\n    !endif\n\n  FunctionEnd\n\n!macroend\n\n\n!macro UMUI_INTERNAL_PAGE_MAINTENANCE_ADDOPTION OPTION\n\n  !ifdef UMUI_MAINTENANCEPAGE_${OPTION}\n    File \"/oname=$PLUGINSDIR\\${OPTION}.bmp\" \"${UMUI_MAINTENANCEPAGE_${OPTION}BITMAP}\"\n    !define /redef /math UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER} + 1\n\n    StrCmp $UMUI_TEMP3 ${UMUI_${OPTION}} 0 +4\n      !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" State \"1\"\n      SetCurInstType $MUI_TEMP2\n    Goto +2\n      !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" State \"0\"\n\n    !ifdef UMUI_MAINTENANCEPAGE_REMOVE\n      StrCmp ${OPTION} \"REMOVE\" 0 no${OPTION}\n        IfFileExists \"${UMUI_UNINSTALL_FULLPATH}\" no${OPTION} 0\n          ClearErrors\n          !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" State \"0\"\n          !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" Flags DISABLED\n      no${OPTION}:\n    !endif\n\n    !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" Maintenance \"${UMUI_${OPTION}}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" MaintenanceName \"${OPTION}\"\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" \"Text\" \"UMUI_MAINTENANCEPAGE_${OPTION}_TITLE\"\n    !define /redef /math UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER} + 1\n    !insertmacro INSTALLOPTIONS_WRITE \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" Text \"$PLUGINSDIR\\${OPTION}.bmp\"\n    !define /redef /math UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER} + 1\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Maintenance.ini\" \"Field ${UMUI_INTERNAL_PAGE_MAINTENANCE_COUNTER}\" \"Text\" \"UMUI_MAINTENANCEPAGE_${OPTION}_TEXT\"\n  !endif\n\n!macroend\n\n!macro UMUI_INTERNAL_PAGE_MAINTENANCE_GETOPTION FIELDNUMBER\n\n  !insertmacro INSTALLOPTIONS_READ $UMUI_TEMP3 \"Maintenance.ini\" \"Field ${FIELDNUMBER}\" \"Maintenance\"\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"Maintenance.ini\" \"Field ${FIELDNUMBER}\" \"State\"\n  StrCmp $MUI_TEMP1 \"1\" 0 no${FIELDNUMBER}\n\n    !insertmacro UMUI_SET_INSTALLFLAG $UMUI_TEMP3\n    Goto end${FIELDNUMBER}\n\n  no${FIELDNUMBER}:\n    !insertmacro UMUI_UNSET_INSTALLFLAG $UMUI_TEMP3\n\n  end${FIELDNUMBER}:\n\n!macroend\n\n\n\n\n\n!macro UMUI_PAGE_UPDATE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_UPDATEPAGE\n\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_UPDATEPAGE_TEXT \"$(UMUI_TEXT_UPDATE_INFO_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_UPDATEPAGE_UPDATE_TITLE \"$(UMUI_TEXT_UPDATE_UPDATE_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_UPDATEPAGE_UPDATE_TEXT \"$(UMUI_TEXT_UPDATE_UPDATE_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_UPDATEPAGE_REMOVE_TITLE \"$(UMUI_TEXT_UPDATE_REMOVE_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_UPDATEPAGE_REMOVE_TEXT \"$(UMUI_TEXT_UPDATE_REMOVE_TEXT)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_UPDATEPAGE_CONTINUE_SETUP_TITLE \"$(UMUI_TEXT_UPDATE_CONTINUE_TITLE)\"\n  !insertmacro MUI_DEFAULT_IOCONVERT UMUI_UPDATEPAGE_CONTINUE_SETUP_TEXT \"$(UMUI_TEXT_UPDATE_CONTINUE_TEXT)\"\n\n!ifndef USE_MUIEx\n;-----------------\n  !define /IfNDef UMUI_UPDATEPAGE_UPDATEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Modify.bmp\"\n  !define /IfNDef UMUI_UPDATEPAGE_REMOVEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Remove.bmp\"\n  !define /IfNDef UMUI_UPDATEPAGE_CONTINUE_SETUPBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Continue.bmp\"\n!else\n;-----\n  !define /IfNDef UMUI_UPDATEPAGE_UPDATEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\ModifyEx.bmp\"\n  !define /IfNDef UMUI_UPDATEPAGE_REMOVEBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\RemoveEx.bmp\"\n  !define /IfNDef UMUI_UPDATEPAGE_CONTINUE_SETUPBITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\ContinueEx.bmp\"\n!endif\n;------\n\n  !define /IfNDef UMUI_UPDATEPAGE_UPDATE\n  !define /IfNDef UMUI_UPDATEPAGE_DEFAULTCHOICE ${UMUI_UPDATE}\n\n  !ifndef UMUI_VERBUILD_REGISTRY_VALUENAME | UMUI_VERBUILD\n    !error \"Update page: You need to set the UMUI_VERBUILD_REGISTRY_VALUENAME and UMUI_VERBUILD defines with this page.\"\n  !endif\n\n  !ifndef UMUI_VAR_OLDVERSION\n    Var OLDVERSION\n    !define UMUI_VAR_OLDVERSION\n  !endif\n\n  !ifndef UMUI_VAR_NEWVERSION\n    Var NEWVERSION\n    !define UMUI_VAR_NEWVERSION\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.updatePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.updateLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_UPDATEPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.updatePre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.updateLeave_${MUI_UNIQUEID}\n\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_TEXT\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_UPDATE_TITLE\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_UPDATE_TEXT\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_REMOVE_TITLE\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_REMOVE_TEXT\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_CONTINUE_SETUP_TITLE\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_CONTINUE_SETUP_TEXT\n\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_UPDATEBITMAP\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_REMOVEBITMAP\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_CONTINUE_SETUPBITMAP\n\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_UPDATE\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_REMOVE\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_CONTINUE_SETUP\n\n  !insertmacro MUI_UNSET UMUI_UPDATEPAGE_DEFAULTCHOICE\n\n  !verbose pop\n\n!macroend\n\n\n!macro UMUI_FUNCTION_UPDATEPAGE PRE LEAVE\n\n  Function \"${PRE}\"\n\n    ; IF setup cancelled\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}|${UMUI_MODIFY}|${UMUI_REPAIR}\n\n    ; call uninstaller if the /remove command line argument is set\n    !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REMOVE}\n\n      IfFileExists \"${UMUI_UNINSTALL_FULLPATH}\" 0 uninstaller_not_found\n        ;Recall this programm and quit\n        !insertmacro UMUI_GET_PARAMETERS\n        Pop $MUI_TEMP2\n\n        !insertmacro UMUI_DELETE_PLUGINDIR\n        HideWindow\n\n        ExecWait '\"${UMUI_UNINSTALL_FULLPATH}\" $MUI_TEMP2 /remove /L=$LANGUAGE'\n        Quit\n      uninstaller_not_found:\n      ClearErrors\n\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n    ;else continue\n\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_ISNOT ${UMUI_DIFFVERSION}\n\n    ; Bodenseematze-2016-09-15: missing PRE-Function support added:\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !insertmacro MUI_HEADER_TEXT_PAGE \"$(UMUI_TEXT_UPDATE_TITLE)\" \"$(UMUI_TEXT_UPDATE_SUBTITLE)\"\n\n    IfFileExists \"$PLUGINSDIR\\Update.ini\" alreadyExists\n      !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${UMUI_MAINTENANCEUPDATESETUPTYPEPAGE_INI}\" \"Update.ini\"\n\n      !ifdef UMUI_VERSION\n        StrCpy $NEWVERSION \"${UMUI_VERSION}\"\n      !else\n        StrCpy $NEWVERSION \"${UMUI_VERBUILD}\"\n      !endif\n\n      !ifdef UMUI_VERSION_REGISTRY_VALUENAME\n        ReadRegStr $OLDVERSION ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERSION_REGISTRY_VALUENAME}\"\n        StrCmp $OLDVERSION \"\" 0 +2\n          ReadRegStr $OLDVERSION ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n      !else\n        ReadRegStr $OLDVERSION ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n      !endif\n\n      !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Update.ini\" \"Field 1\" \"Text\" \"UMUI_UPDATEPAGE_TEXT\"\n\n      !define UMUI_INTERNAL_PAGE_UPDATE_COUNTER 1\n\n      !insertmacro UMUI_INTERNAL_PAGE_UPDATE_ADDOPTION UPDATE\n      !insertmacro UMUI_INTERNAL_PAGE_UPDATE_ADDOPTION REMOVE\n      !insertmacro UMUI_INTERNAL_PAGE_UPDATE_ADDOPTION CONTINUE_SETUP\n\n      !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Settings\" \"NumFields\" \"${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\"\n\n      !undef UMUI_INTERNAL_PAGE_UPDATE_COUNTER\n\n      !insertmacro UMUI_VERSIONCONVERT \"${UMUI_VERBUILD}\"\n      Pop $MUI_TEMP1\n      ReadRegStr $MUI_TEMP2 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n      !insertmacro UMUI_VERSIONCONVERT $MUI_TEMP2\n      Pop $MUI_TEMP2\n      !insertmacro UMUI_VERSIONCOMPARE $MUI_TEMP1 $MUI_TEMP2\n      Pop $MUI_TEMP1\n\n      StrCmp $MUI_TEMP1 1 alreadyExists 0\n        ;disable the update option\n        !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field 2\" State \"0\"\n        !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field 2\" Flags DISABLED\n\n        StrCmp ${UMUI_UPDATEPAGE_DEFAULTCHOICE} ${UMUI_UPDATE} 0 +2\n        !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field 5\" State \"1\"\n\n    alreadyExists:\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n    !insertmacro INSTALLOPTIONS_DISPLAY \"Update.ini\"\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro UMUI_INTERNAL_PAGE_UPDATE_GETOPTION 2\n    !insertmacro UMUI_INTERNAL_PAGE_UPDATE_GETOPTION 5\n    !insertmacro UMUI_INTERNAL_PAGE_UPDATE_GETOPTION 8\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_CANCELLED}\n\n      !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_REMOVE}\n        ;Recall this programm and quit\n        !insertmacro UMUI_GET_PARAMETERS\n        Pop $MUI_TEMP2\n\n        !insertmacro UMUI_DELETE_PLUGINDIR\n        HideWindow\n\n        ExecWait '\"${UMUI_UNINSTALL_FULLPATH}\" $MUI_TEMP2 /remove /L=$LANGUAGE'\n        Quit\n      !insertmacro UMUI_ENDIF_INSTALLFLAG\n      ;else continue\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n  FunctionEnd\n\n!macroend\n\n\n!macro UMUI_INTERNAL_PAGE_UPDATE_ADDOPTION OPTION\n\n  !ifdef UMUI_UPDATEPAGE_${OPTION}\n    File \"/oname=$PLUGINSDIR\\${OPTION}.bmp\" \"${UMUI_UPDATEPAGE_${OPTION}BITMAP}\"\n    !define /redef /math UMUI_INTERNAL_PAGE_UPDATE_COUNTER ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER} + 1\n\n    StrCmp ${UMUI_UPDATEPAGE_DEFAULTCHOICE} ${UMUI_${OPTION}} 0 +4\n      !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" State \"1\"\n    Goto +2\n      !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" State \"0\"\n\n    !ifdef UMUI_UPDATEPAGE_REMOVE\n      StrCmp ${OPTION} \"REMOVE\" 0 no${OPTION}\n        IfFileExists \"${UMUI_UNINSTALL_FULLPATH}\" no${OPTION} 0\n          ClearErrors\n          !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" State \"0\"\n          !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" Flags DISABLED\n      no${OPTION}:\n    !endif\n\n    !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" Update \"${UMUI_${OPTION}}\"\n    !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" UpdateName \"${OPTION}\"\n\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" \"Text\" \"UMUI_UPDATEPAGE_${OPTION}_TITLE\"\n    !define /redef /math UMUI_INTERNAL_PAGE_UPDATE_COUNTER ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER} + 1\n    !insertmacro INSTALLOPTIONS_WRITE \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" \"Text\" \"$PLUGINSDIR\\${OPTION}.bmp\"\n    !define /redef /math UMUI_INTERNAL_PAGE_UPDATE_COUNTER ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER} + 1\n    !insertmacro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT \"Update.ini\" \"Field ${UMUI_INTERNAL_PAGE_UPDATE_COUNTER}\" \"Text\" \"UMUI_UPDATEPAGE_${OPTION}_TEXT\"\n  !endif\n\n!macroend\n\n!macro UMUI_INTERNAL_PAGE_UPDATE_GETOPTION FIELDNUMBER\n\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP2 \"Update.ini\" \"Field ${FIELDNUMBER}\" \"Update\"\n  !insertmacro INSTALLOPTIONS_READ $MUI_TEMP1 \"Update.ini\" \"Field ${FIELDNUMBER}\" \"State\"\n  StrCmp $MUI_TEMP1 \"1\" 0 no${FIELDNUMBER}\n    !insertmacro UMUI_SET_INSTALLFLAG $MUI_TEMP2\n    Goto end${FIELDNUMBER}\n  no${FIELDNUMBER}:\n    !insertmacro UMUI_UNSET_INSTALLFLAG $MUI_TEMP2\n  end${FIELDNUMBER}:\n\n!macroend\n\n\n!macro UMUI_PAGE_FILEDISKREQUEST\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_PAGE_INIT\n\n  !define /IfNDef UMUI_${MUI_PAGE_UNINSTALLER_PREFIX}FILEDISKREQUESTPAGE\n\n  !ifdef UMUI_FILEDISKREQUESTPAGE_FILE_TO_FOUND\n    !warning \"The UMUI_FILEDISKREQUESTPAGE_FILE_TO_FOUND define was renamed UMUI_FILEDISKREQUESTPAGE_FILE_NAME\"\n    !define /IfNDef UMUI_FILEDISKREQUESTPAGE_FILE_NAME \"{UMUI_FILEDISKREQUESTPAGE_FILE_TO_FOUND}\"\n    !undef UMUI_FILEDISKREQUESTPAGE_FILE_TO_FOUND\n  !endif\n\n  !ifndef UMUI_FILEDISKREQUESTPAGE_FILE_NAME || UMUI_FILEDISKREQUESTPAGE_VARIABLE\n    !error \"For the FILEDISKREQUEST page, you need to define UMUI_FILEDISKREQUESTPAGE_FILE_NAME and UMUI_FILEDISKREQUESTPAGE_VARIABLE.\"\n  !endif\n\n  !ifdef UMUI_FILEDISKREQUESTPAGE_DISK_NAME\n    !define /IfNDef UMUI_FILEDISKREQUESTPAGE_TEXT_TOP \"$(UMUI_TEXT_FILEDISKREQUEST_DISK) ${UMUI_FILEDISKREQUESTPAGE_DISK_NAME}.\"\n  !else\n    !define /IfNDef UMUI_FILEDISKREQUESTPAGE_TEXT_TOP \"$(UMUI_TEXT_FILEDISKREQUEST_FILE_BEGIN) ${UMUI_FILEDISKREQUESTPAGE_FILE_NAME} $(UMUI_TEXT_FILEDISKREQUEST_FILE_END)\"\n  !endif\n\n  !define /IfNDef UMUI_FILEDISKREQUESTPAGE_TEXT_PATH \"$(UMUI_TEXT_FILEDISKREQUEST_PATH)\"\n\n  !ifndef MUI_VAR_HWND\n    Var MUI_HWND\n    !define MUI_VAR_HWND\n  !endif\n\n  PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}directory\n\n    PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.filediskrequestPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.filediskrequestShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.filediskrequestLeave_${MUI_UNIQUEID}\n\n    Caption \" \"\n\n    DirText \"${UMUI_FILEDISKREQUESTPAGE_TEXT_TOP}\" \"${UMUI_FILEDISKREQUESTPAGE_TEXT_PATH}\" \"$(^BrowseBtn)\" \"${UMUI_FILEDISKREQUESTPAGE_TEXT_TOP}\"\n\n    DirVar \"$${UMUI_FILEDISKREQUESTPAGE_VARIABLE}\"\n\n    DirVerify leave\n\n  PageExEnd\n\n  !insertmacro UMUI_FUNCTION_FILEDISKREQUESTPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.filediskrequestPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.filediskrequestShow_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.filediskrequestLeave_${MUI_UNIQUEID}\n\n  !undef UMUI_FILEDISKREQUESTPAGE_TEXT_TOP\n  !undef UMUI_FILEDISKREQUESTPAGE_TEXT_PATH\n  !undef UMUI_FILEDISKREQUESTPAGE_VARIABLE\n  !undef UMUI_FILEDISKREQUESTPAGE_FILE_NAME\n\n  !insertmacro MUI_UNSET UMUI_FILEDISKREQUESTPAGE_DISK_NAME\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_UNPAGE_FILEDISKREQUEST\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro MUI_UNPAGE_INIT\n\n    !insertmacro UMUI_PAGE_FILEDISKREQUEST\n\n  !insertmacro MUI_UNPAGE_END\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_FUNCTION_FILEDISKREQUESTPAGE PRE SHOW LEAVE\n\n  Function \"${PRE}\"\n\n    ;if it's the installer page that call it and if remove : abort\n    !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE\n\n    !ifdef UMUI_FILEDISKREQUESTPAGE_FILE_NAME\n      !insertmacro MUI_HEADER_TEXT_PAGE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_TITLE)\" \"$(UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_BEGIN) ${UMUI_FILEDISKREQUESTPAGE_FILE_NAME} $(UMUI_TEXT_FILEDISKREQUEST_FILE_SUBTITLE_END)\"\n    !else\n      !insertmacro MUI_HEADER_TEXT_PAGE \"$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLING_TITLE)\" \"$(UMUI_TEXT_FILEDISKREQUEST_DISK_SUBTITLE)\"\n    !endif\n\n    !insertmacro UMUI_FIX_BUTTONS_SKIN\n\n  FunctionEnd\n\n  Function \"${SHOW}\"\n\n    !insertmacro UMUI_UMUI_HIDEBACKBUTTON\n\n    !insertmacro UMUI_PAGEBGTRANSPARENT_INIT\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1001\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1008\n    !insertmacro UMUI_PAGECTLTRANSPARENT_INIT 1006\n    !insertmacro UMUI_PAGECTLLIGHT_INIT 1020\n\n    FindWindow $MUI_HWND \"#32770\" \"\" $HWNDPARENT\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1023\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n    GetDlgItem $MUI_TEMP1 $MUI_HWND 1024\n    ShowWindow $MUI_TEMP1 ${SW_HIDE}\n\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n\n    !insertmacro UMUI_IF_INSTALLFLAG_ISNOT ${UMUI_CANCELLED}\n\n      ClearErrors\n      IfFileExists \"$${UMUI_FILEDISKREQUESTPAGE_VARIABLE}\\${UMUI_FILEDISKREQUESTPAGE_FILE_NAME}\" file_found 0\n        ClearErrors\n\n        ;Repost this page\n        Abort\n\n      file_found:\n\n      !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE\n\n    !insertmacro UMUI_ENDIF_INSTALLFLAG\n\n  FunctionEnd\n\n!macroend\n\n\n\n;--------------------------------\n;INSTALL OPTIONS (CUSTOM PAGES)\n\n!macro MUI_INSTALLOPTIONS_EXTRACT FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_EXTRACT \"${FILE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_EXTRACT_AS FILE FILENAME\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_EXTRACT_AS \"${FILE}\" \"${FILENAME}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_DISPLAY FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_DISPLAY \"${FILE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_DISPLAY_RETURN FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_DISPLAY_RETURN \"${FILE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_INITDIALOG FILE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_INITDIALOG \"${FILE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_SHOW\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_SHOW\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_SHOW_RETURN\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_SHOW_RETURN\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_READ VAR FILE SECTION KEY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_READ \"${VAR}\" \"${FILE}\" \"${SECTION}\" \"${KEY}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"${SECTION}\" \"${KEY}\" \"${VALUE}\"\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_INSTALLOPTIONS_WRITE_DEFAULTCONVERT FILE SECTION KEY SYMBOL\n\n  ;Converts default strings from language files to InstallOptions format\n  ;Only for use inside MUI\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  Push $R9\n\n  !ifndef \"${SYMBOL}_DEFAULTSET\"\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"${SECTION}\" \"${KEY}\" \"${${SYMBOL}}\"\n  !else\n    Push \"${${SYMBOL}}\"\n    Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}Nsis2Io\n    Pop $R9\n    !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"${SECTION}\" \"${KEY}\" $R9\n  !endif\n\n  Pop $R9\n\n  !verbose pop\n\n!macroend\n\n\n; Additional Installoptions functions\n; ------------------------------------\n\n!macro UMUI_INSTALLOPTIONSEX_SETFOCUS HWND\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    InstallOptionsEx::setFocus ${HWND}\n  !else\n    !warning \"setFocus is not available with InstallOptions, use InstallOptionsEx instead.\"\n  !endif\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_INSTALLOPTIONSEX_SKIPVALIDATION\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    InstallOptionsEx::skipValidation\n  !else\n    !warning \"skipValidation is not available with InstallOptions, use InstallOptionsEx instead.\"\n  !endif\n\n  !verbose pop\n\n!macroend\n\n\n; Convert an IO ini into a compatible IOEx ini\n!macro UMUI_INSTALLOPTIONSEX_CONVERT FILE\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    !ifndef UMUI_DONT_USE_IOEX_CONVERTER\n\n      !verbose push\n      !verbose ${MUI_VERBOSE}\n\n      Push $R0\n      Push $0\n      Push $1\n      Push $8\n      Push $R1\n      Push $R8\n\n      !insertmacro MUI_INSTALLOPTIONS_READ $R0 \"${FILE}\" \"Settings\" \"NumFields\"\n\n      ;$R0 NumField\n      ;$1 NewNumField\n      ;$R1 type\n      ;$0  counter\n      ;$R8 temp string\n      ;$8 temp var\n\n      StrCpy $0 0\n      StrCpy $1 $R0\n\n      ;do\n      loopConvert:\n        IntOp $0 $0 + 1\n\n        !insertmacro MUI_INSTALLOPTIONS_READ $R1 \"${FILE}\" \"Field $0\" \"Type\"\n\n        ;if Button\n        StrCmp $R1 \"Button\" isButtonType 0\n        ;else if Link\n        StrCmp $R1 \"Link\" isButtonType 0\n        ;else if CheckBox\n        StrCmp $R1 \"CheckBox\" isButtonType 0\n        ;else if RadioButton\n        StrCmp $R1 \"RadioButton\" 0 isNotButtonType\n        isButtonType:\n          !insertmacro UMUI_INSTALLOPTIONSEX_CONVERT_NOTIFY \"${FILE}\" \"$0\" ONCLICK\n          Goto testConvert\n        isNotButtonType:\n\n        ;else if ListBox\n        StrCmp $R1 \"ListBox\" +2 0\n        ;else if DropList\n        StrCmp $R1 \"DropList\" 0 isNotListType\n          !insertmacro UMUI_INSTALLOPTIONSEX_CONVERT_NOTIFY \"${FILE}\" \"$0\" ONSELCHANGE\n          Goto testConvert\n        isNotListType:\n\n        ;else if FileRequest\n        StrCmp $R1 \"FileRequest\" 0 isNotFileRequest\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $0\" \"Type\" \"Text\"\n          IntOp $1 $1 + 1\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Settings\" \"NumFields\" \"$1\"\n\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Type\" \"Button\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Text\" \"...\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"RefFields\" \"$0\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Top\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Top\" \"$R8\"\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Bottom\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Bottom\" \"$R8\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Right\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Right\" \"$R8\"\n          IntOp $R8 $R8 - 19\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $0\" \"Right\" \"$R8\"\n          IntOp $R8 $R8 + 3\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Left\" \"$R8\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Filter\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Filter\" \"$R8\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $0\" \"Filter\" \"\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Flags\"\n          !insertmacro UMUI_STRCOUNT \"REQ_SAVE\" \"$R8\"\n          Pop $8 ;the return number\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Flags\"\n          StrCmp $8 0 0 save\n            !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Flags\" \"OPEN_FILEREQUEST|$R8\"\n            Goto end\n          save:\n            !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Flags\" \"SAVE_FILEREQUEST|$R8\"\n          end:\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $0\" \"Flags\" \"\"\n\n          Goto testConvert\n        isNotFileRequest:\n\n        ;else if DirRequest\n        StrCmp $R1 \"DirRequest\" 0 isNotDirRequest\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $0\" \"Type\" \"Text\"\n          IntOp $1 $1 + 1\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Settings\" \"NumFields\" \"$1\"\n\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Type\" \"Button\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Text\" \"...\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"RefFields\" \"$0\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Text\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"ListItems\" \"$R8\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $0\" \"Text\" \"\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Top\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Top\" \"$R8\"\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Bottom\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Bottom\" \"$R8\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Right\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Right\" \"$R8\"\n          IntOp $R8 $R8 - 19\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $0\" \"Right\" \"$R8\"\n          IntOp $R8 $R8 + 3\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Left\" \"$R8\"\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"Root\"\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Root\" \"$R8\"\n\n          !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $1\" \"Flags\" \"DIRREQUEST\"\n\n          Goto testConvert\n        isNotDirRequest:\n\n        ;endif\n\n      testConvert:\n      ;while $0 <= $R0\n      IntCmp $0 $R0 0 loopConvert 0\n\n      Pop $R8\n      Pop $R1\n      Pop $8\n      Pop $1\n      Pop $0\n      Pop $R0\n\n      !verbose pop\n\n    !endif\n  !endif\n\n!macroend\n\n\n; Convert an IO ini into a compatible IOEx ini next and finish\n!macro UMUI_INSTALLOPTIONSEX_CONVERT_NEXT FILE\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    !ifndef UMUI_DONT_USE_IOEX_CONVERTER\n\n      !verbose push\n      !verbose ${MUI_VERBOSE}\n\n      Push $R0\n      Push $0\n      Push $8\n      Push $R1\n      Push $R8\n\n      !insertmacro MUI_INSTALLOPTIONS_READ $R0 \"${FILE}\" \"Settings\" \"NumFields\"\n\n      ;$R0 NumField\n      ;$R1 type\n      ;$0  counter\n      ;$R8 temp string\n      ;$8 temp var\n\n      StrCpy $0 0\n\n      ;do\n      loopConvertNext:\n        IntOp $0 $0 + 1\n\n        !insertmacro MUI_INSTALLOPTIONS_READ $R1 \"${FILE}\" \"Field $0\" \"Type\"\n        ;if Button\n        StrCmp $R1 \"Button\" 0 testConvertNext\n\n          !insertmacro MUI_INSTALLOPTIONS_READ $8 \"${FILE}\" \"Field $0\" \"RefFields\"\n          StrCmp $8 \"\" testConvertNext 0\n            !insertmacro MUI_INSTALLOPTIONS_READ $R8 \"${FILE}\" \"Field $0\" \"HWND\"\n            !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field $8\" \"HWND2\" \"$R8\"\n\n      testConvertNext:\n      ;while $0 <= $R0\n      IntCmp $0 $R0 0 loopConvertNext 0\n\n      Pop $R8\n      Pop $R1\n      Pop $8\n      Pop $0\n      Pop $R0\n\n      !verbose pop\n\n    !endif\n  !endif\n\n!macroend\n\n; Convert an IO NOTIFY flag into a Notify key compatible with IOEx\n!macro UMUI_INSTALLOPTIONSEX_CONVERT_NOTIFY FILE FIELD NOTIFY\n\n  Push $R9\n  Push $9\n\n  !define UMUI_UNIQUEID_CONVERTNOTIFY ${__LINE__}\n\n  !insertmacro MUI_INSTALLOPTIONS_READ $R9 \"${FILE}\" \"Field ${FIELD}\" \"Notify\"\n  StrCmp $R9 \"\" 0 end${UMUI_UNIQUEID_CONVERTNOTIFY}\n\n    !insertmacro MUI_INSTALLOPTIONS_READ $R9 \"${FILE}\" \"Field ${FIELD}\" \"Flags\"\n    StrCmp $R9 \"\" end${UMUI_UNIQUEID_CONVERTNOTIFY} 0\n      !insertmacro UMUI_STRCOUNT \"NOTIFY\" \"$R9\"\n      Pop $9 ;the return number\n      StrCmp $9 0 end${UMUI_UNIQUEID_CONVERTNOTIFY} 0\n\n        !insertmacro MUI_INSTALLOPTIONS_WRITE \"${FILE}\" \"Field ${FIELD}\" \"Notify\" \"${NOTIFY}\"\n\n  end${UMUI_UNIQUEID_CONVERTNOTIFY}:\n\n  !undef UMUI_UNIQUEID_CONVERTNOTIFY\n\n  Pop $9\n  Pop $R9\n\n!macroend\n\n\n\n;--------------------------------\n;RESERVE FILES\n\n!macro MUI_RESERVEFILE_INSTALLOPTIONS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    ReserveFile /plugin InstallOptionsEx.dll\n  !else\n    ReserveFile /plugin InstallOptions.dll\n  !endif\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_RESERVEFILE_SKINNEDCONTROLS\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ReserveFile /plugin SkinnedControls.dll\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_RESERVEFILE_LANGDLL\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n    !warning \"You tried to reserve the file LangDLL.dll whereas you have also inserted the UNMULTILANGUAGE page. You can remove the MUI_RESERVEFILE_LANGDLL macro insertion.\"\n  !endif\n\n  ReserveFile /plugin LangDLL.dll\n\n  !verbose pop\n\n!macroend\n\n\n\n;--------------------------------\n;LANGUAGES\n\n!macro MUI_LANGUAGE NLFID\n\n  ;Include a language\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ; MUI_PAGE_UNINSTALLER_PREFIX is undefined by uninstaller pages so we check MUI_UNINSTALLER as well\n  !ifndef MUI_PAGE_UNINSTALLER_PREFIX && MUI_UNINSTALLER\n    !ifndef MUI_DISABLE_INSERT_LANGUAGE_AFTER_PAGES_WARNING ; Define this to avoid the warning if you only have custom pages\n      !warning \"MUI_LANGUAGE should be inserted after the MUI_[UN]PAGE_* macros\"\n    !endif\n  !endif\n\n  !insertmacro MUI_INSERT\n\n  LoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\${NLFID}.nlf\"\n\n  ;Include language file\n  !insertmacro LANGFILE_INCLUDE_WITHDEFAULT \\\n    \"${NSISDIR}\\Contrib\\Language files\\${NLFID}.nsh\" \"${NSISDIR}\\Contrib\\Language files\\English.nsh\" \"${NSISDIR}\\Contrib\\UltraModernUI\\Language files\\${NLFID}.nsh\" \"${NSISDIR}\\Contrib\\UltraModernUI\\Language files\\English.nsh\"\n\n  ;Add language to list of languages for selection dialog\n  !define /ifndef MUI_LANGDLL_LANGUAGES \"\"\n  !define /redef MUI_LANGDLL_LANGUAGES \\\n    `\"${LANGFILE_${NLFID}_LANGDLL}\" \"${LANG_${NLFID}}\" ${MUI_LANGDLL_LANGUAGES}`\n  !define /ifndef MUI_LANGDLL_LANGUAGES_CP \"\"\n  !define /redef MUI_LANGDLL_LANGUAGES_CP \\\n    `\"${LANGFILE_${NLFID}_LANGDLL}\" \"${LANG_${NLFID}}\" \"${LANG_${NLFID}_CP}\" ${MUI_LANGDLL_LANGUAGES_CP}`\n\n  !define /ifndef UMUI_MULTILANG_LANGMAP \"\"\n  !define /redef UMUI_MULTILANG_LANGMAP \"${UMUI_MULTILANG_LANGMAP} /key=${LANG_${NLFID}} `${LANGFILE_${NLFID}_NAME}`\"\n\n  !verbose pop\n\n!macroend\n\n!macro UMUI_MULTILANG_GET\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  ;Usually, this is done only later, but we need us now\n  InitPluginsDir\n\n  ;get parameters in a ini file\n  !insertmacro UMUI_PARAMETERS_TO_INI\n  StrCpy $UMUI_INSTALLFLAG 0\n\n  ;bu default, $LANGUAGE contain the ID of the language of the system\n\n  ; get the choosen langid if it is passed in the commandline\n  !insertmacro UMUI_GETPARAMETERVALUE \"/L\" \"error\"\n  Pop $MUI_TEMP1\n\n  StrCmp $MUI_TEMP1 \"error\" checkRegistery 0\n    !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_LANGISSET}\n    Goto setlang\n\n  checkRegistery:\n\n    !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n      ReadRegStr $MUI_TEMP1 ${UMUI_LANGUAGE_REGISTRY_ROOT} \"${UMUI_LANGUAGE_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\"\n      StrCmp $MUI_TEMP1 \"\" 0 setlang\n    !endif\n    Goto endlang\n\n  setlang:\n\n    StrCpy $LANGUAGE $MUI_TEMP1\n\n    !ifndef UMUI_LANGUAGE_ALWAYSSHOW\n        !insertmacro UMUI_SET_INSTALLFLAG ${UMUI_LANGISSET}\n    !endif\n\n  endlang:\n\n  !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n    !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_LANGUAGE_REGISTRY_ROOT} \"${UMUI_LANGUAGE_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\" \"$LANGUAGE\"\n  !endif\n\n  !ifndef UMUI_VAR_LANGLIST\n    !error \"It seem that you don't have inserted the MULTILANGUAGE page.\"\n  !endif\n\n  !ifndef UMUI_MULTILANG_LANGMAP\n    !error \"MUI_LANGUAGE must be inserted before UMUI_MULTILANG_GET\"\n  !endif\n\n  ClearErrors\n\n  ; create a map that contain the langid => langstring\n  nsArray::SetList LangMap ${UMUI_MULTILANG_LANGMAP} /end\n\n  nsArray::Sort LangMap 4\n\n  nsArray::Join LangMap \"|\"\n  Pop $UMUI_LANGLIST\n\n  ClearErrors\n\n  !verbose pop\n\n!macroend\n\n\n;--------------------------------\n;LANGUAGE SELECTION DIALOG\n\n!macro MUI_LANGDLL_DISPLAY\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n    !warning \"You have used the MUI_LANGDLL_DISPLAY in your .onInit function whereas you have also inserted the MULTILANGUAGE page. Replace the MUI_LANGDLL_DISPLAY and the MUI_UNGETLANGUAGE macros by the UMUI_MULTILANG_GET macro in your .onInit and un.onInit functions otherwise, the MULTILANGUAGE page will not work.\"\n  !endif\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT | MUI_LANGDLL_REGISTRY_KEY | MUI_LANGDLL_REGISTRY_VALUENAME\n    !warning \"Deprecated: The MUI_LANGDLL_REGISTRY_ROOT, MUI_LANGDLL_REGISTRY_KEY and MUI_LANGDLL_REGISTRY_VALUENAME defines were replaced by UMUI_LANGUAGE_REGISTRY_VALUENAME, UMUI_LANGUAGE_REGISTRY_ROOT, UMUI_LANGUAGE_REGISTRY_KEY or you can use also the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY globals parameters.\"\n  !endif\n\n  !ifndef UMUI_LANGUAGE_REGISTRY_VALUENAME\n    !ifdef MUI_LANGDLL_REGISTRY_VALUENAME\n      !define UMUI_LANGUAGE_REGISTRY_VALUENAME \"${MUI_LANGDLL_REGISTRY_VALUENAME}\"\n    !endif\n  !endif\n\n  !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n\n    !ifndef UMUI_LANGUAGE_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_LANGUAGE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else ifdef MUI_LANGDLL_REGISTRY_ROOT\n        !define UMUI_LANGUAGE_REGISTRY_ROOT \"${MUI_LANGDLL_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_LANGUAGE_REGISTRY_VALUENAME, the UMUI_LANGUAGE_REGISTRY_ROOT & UMUI_LANGUAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_LANGUAGE_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_LANGUAGE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else ifdef MUI_LANGDLL_REGISTRY_KEY\n        !define UMUI_LANGUAGE_REGISTRY_KEY \"${MUI_LANGDLL_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_LANGUAGE_REGISTRY_VALUENAME, the UMUI_LANGUAGE_REGISTRY_ROOT & UMUI_LANGUAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n  !endif\n\n  !define /IfNDef MUI_LANGDLL_WINDOWTITLE \"Installer Language\"\n  !define /IfNDef MUI_LANGDLL_INFO \"Please select a language.\"\n\n  !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n\n    ReadRegStr $MUI_TEMP1 ${UMUI_LANGUAGE_REGISTRY_ROOT} \"${UMUI_LANGUAGE_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\"\n    StrCmp $MUI_TEMP1 \"\" mui.langdll_show\n      StrCpy $LANGUAGE $MUI_TEMP1\n      !ifndef UMUI_LANGUAGE_ALWAYSSHOW\n        Goto mui.langdll_done\n      !endif\n    mui.langdll_show:\n\n  !endif\n\n  !ifdef NSIS_CONFIG_SILENT_SUPPORT\n    IfSilent mui.langdll_done\n  !endif\n\n  !ifdef MUI_LANGDLL_ALLLANGUAGES | UMUI_MULTILANGUAGEPAGE | UMUI_UNMULTILANGUAGEPAGE\n    LangDLL::LangDialog \"${MUI_LANGDLL_WINDOWTITLE}\" \"${MUI_LANGDLL_INFO}\" A ${MUI_LANGDLL_LANGUAGES} \"\"\n  !else\n    LangDLL::LangDialog \"${MUI_LANGDLL_WINDOWTITLE}\" \"${MUI_LANGDLL_INFO}\" AC ${MUI_LANGDLL_LANGUAGES_CP} \"\"\n  !endif\n\n  Pop $LANGUAGE\n  StrCmp $LANGUAGE \"cancel\" 0 +2\n    Abort\n\n  !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n    !insertmacro UMUI_ADDPARAMTOSAVETOREGISTRYKEY ${UMUI_LANGUAGE_REGISTRY_ROOT} \"${UMUI_LANGUAGE_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\" \"$LANGUAGE\"\n  !endif\n\n  !ifdef NSIS_CONFIG_SILENT_SUPPORT | UMUI_LANGUAGE_REGISTRY_VALUENAME\n    mui.langdll_done:\n  !endif\n\n  !verbose pop\n\n!macroend\n\n!macro MUI_UNGETLANGUAGE\n\n  !verbose push\n  !verbose ${MUI_VERBOSE}\n\n  !ifdef UMUI_UNMULTILANGUAGEPAGE\n    !warning \"You have used the MUI_UNGETLANGUAGE in your un.onInit function whereas you have also inserted the UNMULTILANGUAGE page. Replace the MUI_LANGDLL_DISPLAY and the MUI_UNGETLANGUAGE macros by the UMUI_MULTILANG_GET macro in your .onInit and un.onInit functions otherwise, the MULTILANGUAGE page will not work.\"\n  !endif\n\n  !ifdef MUI_LANGDLL_REGISTRY_ROOT | MUI_LANGDLL_REGISTRY_KEY | MUI_LANGDLL_REGISTRY_VALUENAME\n    !warning \"Deprecated: The MUI_LANGDLL_REGISTRY_ROOT, MUI_LANGDLL_REGISTRY_KEY and MUI_LANGDLL_REGISTRY_VALUENAME defines were replaced by UMUI_LANGUAGE_REGISTRY_ROOT, UMUI_LANGUAGE_REGISTRY_KEY and UMUI_LANGUAGE_REGISTRY_VALUENAME or you can use also the UMUI_PARAMS_REGISTRY_ROOT and UMUI_PARAMS_REGISTRY_KEY globals parameters.\"\n  !endif\n\n  !ifndef UMUI_LANGUAGE_REGISTRY_VALUENAME\n    !ifdef MUI_LANGDLL_REGISTRY_VALUENAME\n      !define UMUI_LANGUAGE_REGISTRY_VALUENAME \"${MUI_LANGDLL_REGISTRY_VALUENAME}\"\n    !endif\n  !endif\n\n  !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n\n    !ifndef UMUI_LANGUAGE_REGISTRY_ROOT\n      !ifdef UMUI_PARAMS_REGISTRY_ROOT\n        !define UMUI_LANGUAGE_REGISTRY_ROOT \"${UMUI_PARAMS_REGISTRY_ROOT}\"\n      !else ifdef MUI_LANGDLL_REGISTRY_ROOT\n        !define UMUI_LANGUAGE_REGISTRY_ROOT \"${MUI_LANGDLL_REGISTRY_ROOT}\"\n      !else\n        !error \"For UMUI_LANGUAGE_REGISTRY_VALUENAME, the UMUI_LANGUAGE_REGISTRY_ROOT & UMUI_LANGUAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n    !ifndef UMUI_LANGUAGE_REGISTRY_KEY\n      !ifdef UMUI_PARAMS_REGISTRY_KEY\n        !define UMUI_LANGUAGE_REGISTRY_KEY \"${UMUI_PARAMS_REGISTRY_KEY}\"\n      !else ifdef MUI_LANGDLL_REGISTRY_KEY\n        !define UMUI_LANGUAGE_REGISTRY_KEY \"${MUI_LANGDLL_REGISTRY_KEY}\"\n      !else\n        !error \"For UMUI_LANGUAGE_REGISTRY_VALUENAME, the UMUI_LANGUAGE_REGISTRY_ROOT & UMUI_LANGUAGE_REGISTRY_KEY parameters or else the UMUI_PARAMS_REGISTRY_ROOT & UMUI_PARAMS_REGISTRY_KEY global parameters must be defined.\"\n      !endif\n    !endif\n\n    ReadRegStr $MUI_TEMP1 ${UMUI_LANGUAGE_REGISTRY_ROOT} \"${UMUI_LANGUAGE_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\"\n    StrCmp $MUI_TEMP1 \"\" 0 mui.ungetlanguage_setlang\n\n  !endif\n\n  !insertmacro MUI_LANGDLL_DISPLAY\n\n  !ifdef UMUI_LANGUAGE_REGISTRY_VALUENAME\n\n    Goto mui.ungetlanguage_done\n\n    mui.ungetlanguage_setlang:\n      StrCpy $LANGUAGE $MUI_TEMP1\n\n    mui.ungetlanguage_done:\n\n  !endif\n\n  !verbose pop\n\n!macroend\n\n;--------------------------------\n\n/*\n\nLangFile.nsh\n\nHeader file to create language files that can be\nincluded with a single command.\n\nCopyright 2008-2016 Joost Verburg, Anders Kjersem\n\n* Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT\n  can be called from the script to include a language file.\n\n  - LANGFILE_INCLUDE takes the language file name as parameter.\n  - LANGFILE_INCLUDE_WITHDEFAULT takes as additional second\n    parameter, the default language file to load missing strings from.\n\n* Language strings in the language file have the format:\n  ${LangFileString} LANGSTRING_NAME \"Text\"\n\n* There are two types of language header files:\n\n  - NSIS multi-lang support; these must start with the LANGFILE macro and\n    provide strings for features like MUI and MultiUser. If you are adding\n    support for a new language to NSIS you should make a copy of English.nsh\n    and translate this .nsh along with the .nlf.\n  - Custom installer strings; these must start with the LANGFILE_EXT macro and\n    contain translated versions of\n    custom strings used in a particular installer.\n    This is useful if you want to put the translations for each language in\n    their own separate file.\n\n* Example:\n\n  ; Setup.nsi\n  !include \"MUI.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro LANGFILE_INCLUDE \"DanishExtra.nsh\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro LANGFILE_INCLUDE \"SwedishExtra.nsh\"\n  Section\n  MessageBox MB_OK \"$(myCustomString)\"\n  SectionEnd\n\n  ; SwedishExtra.nsh\n  !insertmacro LANGFILE_EXT Swedish\n  ${LangFileString} myCustomString \"Bork bork\"\n\n*/\n\n!ifndef LANGFILE_INCLUDED\n!define LANGFILE_INCLUDED\n\n!macro LANGFILE_INCLUDE FILENAME UMUI_FILENAME\n\n  ;Called from script: include a langauge file\n\n  !define /redef LangFileString \"!insertmacro LANGFILE_SETSTRING\"\n\n  !define LANGFILE_SETNAMES\n  !include \"${FILENAME}\"\n  !include \"${UMUI_FILENAME}\"\n  !undef LANGFILE_SETNAMES\n\n  ;Create language strings\n  !define /redef LangFileString \"!insertmacro LANGFILE_LANGSTRING\"\n  !include \"${FILENAME}\"\n  !include \"${UMUI_FILENAME}\"\n\n!macroend\n\n!macro LANGFILE_INCLUDE_WITHDEFAULT FILENAME FILENAME_DEFAULT UMUI_FILENAME UMUI_FILENAME_DEFAULT\n\n  ;Called from script: include a langauge file\n  ;Obtains missing strings from a default file\n\n  !define /redef LangFileString \"!insertmacro LANGFILE_SETSTRING\"\n\n  !define LANGFILE_SETNAMES\n  !include \"${FILENAME}\"\n  !include \"${UMUI_FILENAME}\"\n  !undef LANGFILE_SETNAMES\n\n  ;Include default language for missing strings\n  !define LANGFILE_PRIV_INCLUDEISFALLBACK \"${FILENAME_DEFAULT}\"\n  !include \"${FILENAME_DEFAULT}\"\n  !undef LANGFILE_PRIV_INCLUDEISFALLBACK\n  !include \"${UMUI_FILENAME_DEFAULT}\"\n\n  ;Create language strings\n  !define /redef LangFileString \"!insertmacro LANGFILE_LANGSTRING\"\n  !include \"${FILENAME_DEFAULT}\"\n  !include \"${UMUI_FILENAME_DEFAULT}\"\n\n!macroend\n\n!macro LANGFILE NLFID ENGNAME NATIVENAME NATIVEASCIINAME\n\n  ;Start of standard NSIS language file\n\n  ; NLFID: Must match the name of the .nlf file\n  ; ENGNAME: English name of language, \"=\" if it is the same as NLFID\n  ; NATIVENAME: Native name of language. (In Unicode)\n  ; NATIVEASCIINAME: Native name of language using only ASCII, \"=\" if it is the same as NATIVENAME\n\n  ; Example: LANGFILE \"Swedish\" = \"Svenska\" =\n  ; For more examples, see French.nsh, Greek.nsh and PortugueseBR.nsh\n\n  !ifdef LANGFILE_SETNAMES\n\n    !ifdef LANGFILE_IDNAME\n      !undef LANGFILE_IDNAME\n    !endif\n\n    !define LANGFILE_IDNAME \"${NLFID}\"\n\n    ; ModernUI or the .nsi can change LANGFILE_LANGDLL_FMT if desired\n    !ifndef LANGFILE_LANGDLL_FMT\n      !ifndef NSIS_UNICODE\n        !define LANGFILE_LANGDLL_FMT \"%ENGNAME% / %NATIVEASCIINAME%\"\n      !endif\n      !define /ifndef LANGFILE_LANGDLL_FMT \"%NATIVENAME%\"\n    !endif\n\n    !ifndef \"LANGFILE_${NLFID}_NAME\"\n      !if \"${ENGNAME}\" == \"=\"\n        !define /redef ENGNAME \"${NLFID}\"\n      !endif\n      !if \"${NATIVEASCIINAME}\" == \"=\"\n        !define /redef NATIVEASCIINAME \"${NATIVENAME}\"\n      !endif\n\n      !define \"LANGFILE_${NLFID}_ENGLISHNAME\" \"${ENGNAME}\"\n      !ifdef NSIS_UNICODE\n        !define \"LANGFILE_${NLFID}_NAME\" \"${NATIVENAME}\"\n      !else\n        !define \"LANGFILE_${NLFID}_NAME\" \"${NATIVEASCIINAME}\"\n      !endif\n\n      !searchreplace LANGFILE_${NLFID}_LANGDLL \"${LANGFILE_LANGDLL_FMT}\" %NATIVEASCIINAME% \"${NATIVEASCIINAME}\"\n      !searchreplace LANGFILE_${NLFID}_LANGDLL \"${LANGFILE_${NLFID}_LANGDLL}\" %NATIVENAME% \"${NATIVENAME}\"\n      !searchreplace LANGFILE_${NLFID}_LANGDLL \"${LANGFILE_${NLFID}_LANGDLL}\" %ENGNAME% \"${ENGNAME}\"\n\n    !endif\n\n  !endif\n\n!macroend\n\n!macro LANGFILE_EXT IDNAME\n\n  ;Start of installer language file\n\n  !ifdef LANGFILE_SETNAMES\n\n    !define /redef LANGFILE_IDNAME \"${IDNAME}\"\n\n  !endif\n\n!macroend\n\n!macro LANGFILE_SETSTRING NAME VALUE\n\n  ;Set define with translated string\n\n  !ifndef ${NAME}\n    !define \"${NAME}\" \"${VALUE}\"\n    !ifdef LANGFILE_PRIV_INCLUDEISFALLBACK\n      !warning 'LangString \"${NAME}\" for language ${LANGFILE_IDNAME} is missing, using fallback from \"${LANGFILE_PRIV_INCLUDEISFALLBACK}\"'\n    !endif\n  !endif\n\n!macroend\n\n!macro LANGFILE_LANGSTRING NAME DUMMY\n\n  ;Create a language string from a define and undefine\n\n  LangString \"${NAME}\" \"${LANG_${LANGFILE_IDNAME}}\" \"${${NAME}}\"\n  !undef \"${NAME}\"\n\n!macroend\n\n!endif\n\n;--------------------------------\n\n/*\n\nInstallOptions.nsh\nMacros and conversion functions for InstallOptions\n\n*/\n\n!ifndef ___NSIS__INSTALL_OPTIONS__NSH___\n!define ___NSIS__INSTALL_OPTIONS__NSH___\n\n!macro INSTALLOPTIONS_FUNCTION_READ_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_IO2NSIS \"\"\n!macroend\n\n!macro INSTALLOPTIONS_UNFUNCTION_READ_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_IO2NSIS un.\n!macroend\n\n!macro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_NSIS2IO \"\"\n!macroend\n\n!macro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_NSIS2IO un.\n!macroend\n\n!macro INSTALLOPTIONS_FUNCTION_NSIS2IO UNINSTALLER_FUNCPREFIX\n\n  ; Convert an NSIS string to a form suitable for use by InstallOptions\n  ; Usage:\n  ;   Push <NSIS-string>\n  ;   Call Nsis2Io\n  ;   Pop <IO-string>\n\n  Function ${UNINSTALLER_FUNCPREFIX}Nsis2Io\n\n    Exch $0 ; The source\n    Push $1 ; The output\n    Push $2 ; Temporary char\n    StrCpy $1 \"\" ; Initialise the output\n\n  loop:\n    StrCpy $2 $0 1 ; Get the next source char\n    StrCmp $2 \"\" done ; Abort when none left\n      StrCpy $0 $0 \"\" 1 ; Remove it from the source\n      StrCmp $2 \"\\\" \"\" +3 ; Back-slash?\n        StrCpy $1 \"$1\\\\\"\n        Goto loop\n      StrCmp $2 \"$\\r\" \"\" +3 ; Carriage return?\n        StrCpy $1 \"$1\\r\"\n        Goto loop\n      StrCmp $2 \"$\\n\" \"\" +3 ; Line feed?\n        StrCpy $1 \"$1\\n\"\n        Goto loop\n      StrCmp $2 \"$\\t\" \"\" +3 ; Tab?\n        StrCpy $1 \"$1\\t\"\n        Goto loop\n      StrCpy $1 \"$1$2\" ; Anything else\n      Goto loop\n\n  done:\n    StrCpy $0 $1\n    Pop $2\n    Pop $1\n    Exch $0\n\n  FunctionEnd\n\n!macroend\n\n!macro INSTALLOPTIONS_FUNCTION_IO2NSIS UNINSTALLER_FUNCPREFIX\n\n  ; Convert an InstallOptions string to a form suitable for use by NSIS\n  ; Usage:\n  ;   Push <IO-string>\n  ;   Call Io2Nsis\n  ;   Pop <NSIS-string>\n\n  Function ${UNINSTALLER_FUNCPREFIX}Io2Nsis\n\n    Exch $0 ; The source\n    Push $1 ; The output\n    Push $2 ; Temporary char\n    StrCpy $1 \"\" ; Initialise the output\n\n  loop:\n    StrCpy $2 $0 1 ; Get the next source char\n    StrCmp $2 \"\" done ; Abort when none left\n      StrCpy $0 $0 \"\" 1 ; Remove it from the source\n      StrCmp $2 \"\\\" +3 ; Escape character?\n        StrCpy $1 \"$1$2\" ; If not just output\n        Goto loop\n      StrCpy $2 $0 1 ; Get the next source char\n      StrCpy $0 $0 \"\" 1 ; Remove it from the source\n      StrCmp $2 \"\\\" \"\" +3 ; Back-slash?\n        StrCpy $1 \"$1\\\"\n        Goto loop\n      StrCmp $2 \"r\" \"\" +3 ; Carriage return?\n        StrCpy $1 \"$1$\\r\"\n        Goto loop\n      StrCmp $2 \"n\" \"\" +3 ; Line feed?\n        StrCpy $1 \"$1$\\n\"\n        Goto loop\n      StrCmp $2 \"t\" \"\" +3 ; Tab?\n        StrCpy $1 \"$1$\\t\"\n        Goto loop\n      StrCpy $1 \"$1$2\" ; Anything else (should never get here)\n      Goto loop\n\n  done:\n    StrCpy $0 $1\n    Pop $2\n    Pop $1\n    Exch $0\n\nFunctionEnd\n\n!macroend\n\n!macro INSTALLOPTIONS_EXTRACT FILE\n\n  InitPluginsDir\n  File \"/oname=$PLUGINSDIR\\${FILE}\" \"${FILE}\"\n  !ifdef NSIS_UNICODE\n    !ifdef UMUI_USE_INSTALLOPTIONSEX\n      InstallOptionsEx::make_unicode \"$PLUGINSDIR\\${FILE}\"\n    !else\n      InstallOptions::make_unicode \"$PLUGINSDIR\\${FILE}\"\n    !endif\n  !endif\n  !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Settings\" \"RTL\" \"$(^RTL)\"\n\n!macroend\n\n!macro INSTALLOPTIONS_EXTRACT_AS FILE FILENAME\n\n  InitPluginsDir\n  File \"/oname=$PLUGINSDIR\\${FILENAME}\" \"${FILE}\"\n  !ifdef NSIS_UNICODE\n    !ifdef UMUI_USE_INSTALLOPTIONSEX\n      InstallOptionsEx::make_unicode \"$PLUGINSDIR\\${FILENAME}\"\n    !else\n      InstallOptions::make_unicode \"$PLUGINSDIR\\${FILENAME}\"\n    !endif\n  !endif\n  !insertmacro INSTALLOPTIONS_WRITE \"${FILENAME}\" \"Settings\" \"RTL\" \"$(^RTL)\"\n\n!macroend\n\n!macro INSTALLOPTIONS_DISPLAY FILE\n\n  !insertmacro MUI_INSTALLOPTIONS_DISPLAY_RETURN ${FILE}\n  Exch\n\n!macroend\n\n!macro INSTALLOPTIONS_DISPLAY_RETURN FILE\n\n  ; IF setup cancelled\n  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n  !define /IfNDef MUI_PAGE_UNINSTALLER_PREFIX \"\"\n\n  ; we can't use InstallOptions::dialog function with UMUI because the background can not be initialised\n  Push $MUI_TEMP1\n  Push $MUI_TEMP2\n  Push $R0\n  Push $0\n  Push $1\n  Push $R1\n\n  !insertmacro INSTALLOPTIONS_INITDIALOG \"${FILE}\"\n  Pop $MUI_TEMP1\n\n  !insertmacro UMUI_IOPAGEBGTRANSPARENT_INIT $MUI_TEMP1\n\n  !insertmacro INSTALLOPTIONS_READ $R0 \"${FILE}\" \"Settings\" \"NumFields\"\n\n  ;$R0 NumField\n  ;$R1 type\n  ;$0  counter\n  ;$1  counter + 1200\n\n  StrCpy $1 1200\n  StrCpy $0 0\n\n  ;do\n  loop:\n    IntOp $0 $0 + 1\n\n    GetDlgItem $MUI_TEMP2 $MUI_TEMP1 $1\n\n    !insertmacro INSTALLOPTIONS_READ $R1 \"${FILE}\" \"Field $0\" \"Type\"\n    ;if text\n    StrCmp $R1 \"Text\" input 0\n    ;else if password\n    StrCmp $R1 \"Password\" input 0\n    ;else if listbox\n    StrCmp $R1 \"ListBox\" input 0\n    ;else if DropList\n    StrCmp $R1 \"DropList\" input 0\n    ;else if DateTime\n    StrCmp $R1 \"DateTime\" input 0\n    ;else if  ComboBox\n    StrCmp $R1 \"ComboBox\" input 0\n    ;else if TreeView\n    StrCmp $R1 \"TreeView\" input 0\n    ;else if IPAddress\n    StrCmp $R1 \"IPAddress\" input 0\n    ;else if FileRequest\n    StrCmp $R1 \"FileRequest\" +2 0\n    ;else if DirRequest\n    StrCmp $R1 \"DirRequest\" 0 notInput\n      IntOp $1 $1 + 1\n\n    input:\n      !insertmacro UMUI_IOPAGEINPUTCTL_INIT $MUI_TEMP2\n      Goto test\n    notInput:\n\n!ifndef USE_MUIEx\n;----------------\n    ;if GroupBox\n    StrCmp $R1 \"GroupBox\" 0 notGroupBox\n      !insertmacro UMUI_IOPAGECTLLIGHT_INIT $MUI_TEMP2\n      Goto test\n    notGroupBox:\n    ;else if link\n    StrCmp $R1 \"Link\" 0 notLink\n      !insertmacro UMUI_IOPAGECTLLIGHTTRANSPARENT_INIT $MUI_TEMP2\n      Goto test\n    notLink:\n\n    !if \"${UMUI_XPSTYLE}\" == \"On\"\n      ;else if CheckBox\n      StrCmp $R1 \"CheckBox\" +2 0\n      ;else if RadioButton\n      StrCmp $R1 \"RadioButton\" 0 notCheckBoxRadio\n        !insertmacro UMUI_IOPAGECTL_INIT $MUI_TEMP2\n        Goto test\n      notCheckBoxRadio:\n    !endif\n\n    ;else if not Button (label, checkbox, radiobutton...)\n    StrCmp $R1 \"Button\" test 0\n      !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $MUI_TEMP2\n\n!endif\n;-----\n\n  test:\n    IntOp $1 $1 + 1\n    ;while $0 <= $R0\n    IntCmp $0 $R0 0 loop 0\n\n  Pop $R1\n  Pop $1\n  Pop $0\n  Pop $R0\n  Pop $MUI_TEMP2\n  Exch $MUI_TEMP1\n\n  !insertmacro INSTALLOPTIONS_SHOW_RETURN\n\n!macroend\n\n!macro INSTALLOPTIONS_INITDIALOG FILE\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    !insertmacro UMUI_INSTALLOPTIONSEX_CONVERT \"${FILE}\"\n    InstallOptionsEx::initDialog \"$PLUGINSDIR\\${FILE}\"\n    !insertmacro UMUI_INSTALLOPTIONSEX_CONVERT_NEXT \"${FILE}\"\n  !else\n    InstallOptions::initDialog \"$PLUGINSDIR\\${FILE}\"\n  !endif\n\n  !insertmacro UMUI_UMUI_HIDEBACKBUTTON\n\n!macroend\n\n!macro INSTALLOPTIONS_SHOW\n\n  Push $0\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    InstallOptionsEx::show\n  !else\n    InstallOptions::show\n  !endif\n  Pop $0\n\n  Pop $0\n\n!macroend\n\n!macro INSTALLOPTIONS_SHOW_RETURN\n\n  !ifdef UMUI_USE_INSTALLOPTIONSEX\n    InstallOptionsEx::show\n  !else\n    InstallOptions::show\n  !endif\n\n!macroend\n\n!macro INSTALLOPTIONS_READ VAR FILE SECTION KEY\n\n  ReadIniStr ${VAR} \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\"\n\n!macroend\n\n!macro INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE\n\n  WriteIniStr \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\" \"${VALUE}\"\n\n!macroend\n\n!macro INSTALLOPTIONS_READ_CONVERT VAR FILE SECTION KEY\n\n  ReadIniStr ${VAR} \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\"\n  Push ${VAR}\n  Call Io2Nsis\n  Pop ${VAR}\n\n!macroend\n\n!macro INSTALLOPTIONS_READ_UNCONVERT VAR FILE SECTION KEY\n\n  ReadIniStr ${VAR} \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\"\n  Push ${VAR}\n  Call un.Io2Nsis\n  Pop ${VAR}\n\n!macroend\n\n!macro INSTALLOPTIONS_WRITE_CONVERT FILE SECTION KEY VALUE\n\n  Push $0\n  StrCpy $0 \"${VALUE}\"\n  Push $0\n  Call Nsis2Io\n  Pop $0\n\n  WriteIniStr \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\" $0\n\n  Pop $0\n\n!macroend\n\n!macro INSTALLOPTIONS_WRITE_UNCONVERT FILE SECTION KEY VALUE\n\n  Push $0\n  StrCpy $0 \"${VALUE}\"\n  Push $0\n  Call un.Nsis2Io\n  Pop $0\n\n  WriteIniStr \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\" $0\n\n  Pop $0\n\n!macroend\n\n!endif # ___NSIS__INSTALL_OPTIONS__NSH___\n\n\n;--------------------------------\n;END\n\n!verbose pop\n!endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/Array.c",
    "content": "/*\n  nsArray NSIS plug-in by Stuart Welch <afrowuk@afrowsoft.co.uk>\n  v1.1.1.7 - 2nd December 2014\n*/\n\n#include <windows.h>\n#include \"Array.h\"\n#include \"pluginapi.h\"\n\n// Initializes pointers to NULL and array count to 0.\nvoid InitArrays()\n{\n  g_arrays.pFirst = NULL;\n  g_arrays.pLast = NULL;\n  g_arrays.nCount = 0;\n}\n\n// Deallocates all arrays and their data.\nvoid UnInitArrays()\n{\n  struct ARRAY* pArray = g_arrays.pFirst;\n  while (pArray != NULL)\n  {\n    struct ARRAY* pArrayNext = pArray->pNext;\n    ClearArray(pArray);\n    FREE(pArray);\n    pArray = pArrayNext;\n  }\n}\n\n// Adds a new array with the given name. If the array already exists then it is cleared.\nstruct ARRAY* NewArray(TCHAR* pName)\n{\n  struct ARRAY* pArrayExisting = GetArray(pName);\n  if (pArrayExisting == NULL)\n  {\n    ALLOC(struct ARRAY, pArray);\n    ALLOC_STRCPY(pArray->pName, pName);\n    pArray->pFirstElement = NULL;\n    pArray->pLastElement = NULL;\n    pArray->pCurrentElement = NULL;\n    pArray->nCount = 0;\n    pArray->iNextIndex = 0;\n    pArray->pNext = NULL;\n\n    if (g_arrays.pFirst == NULL)\n    {\n      g_arrays.pFirst = pArray;\n      g_arrays.pLast = pArray;\n      g_arrays.nCount = 1;\n      pArray->pPrev = NULL;\n    }\n    else\n    {\n      struct ARRAY* pLast = g_arrays.pLast;\n      g_arrays.pLast->pNext = pArray;\n      g_arrays.pLast = pArray;\n      g_arrays.nCount++;\n      pArray->pPrev = pLast;\n    }\n\n    return pArray;\n  }\n\n  ClearArray(pArrayExisting);\n  return pArrayExisting;\n}\n\n// Deletes the given array.\nvoid DeleteArray(struct ARRAY* pArray)\n{\n  ClearArray(pArray);\n\n  if (g_arrays.nCount == 1)\n  {\n    g_arrays.pFirst = NULL;\n    g_arrays.pLast = NULL;\n  }\n  else\n  {\n    if (g_arrays.pFirst == pArray)\n      g_arrays.pFirst = pArray->pNext;\n    if (g_arrays.pLast == pArray)\n      g_arrays.pLast = pArray->pPrev;\n\n    if (pArray->pNext != NULL)\n      pArray->pNext->pPrev = pArray->pPrev;\n    if (pArray->pPrev != NULL)\n      pArray->pPrev->pNext = pArray->pNext;\n  }\n\n  FREE(pArray->pName);\n  FREE(pArray);\n  g_arrays.nCount--;\n}\n\n// Removes all elements from the given array.\nvoid ClearArray(struct ARRAY* pArray)\n{\n  struct ELEMENT* pElement = pArray->pFirstElement;\n\n  while (pElement != NULL)\n  {\n    struct ELEMENT* pElementNext = pElement->pNext;\n    FREE(pElement->pKey);\n    FREE(pElement->pData);\n    FREE(pElement);\n    pElement = pElementNext;\n  }\n\n  pArray->pFirstElement = NULL;\n  pArray->pLastElement = NULL;\n  pArray->pCurrentElement = NULL;\n  pArray->nCount = 0;\n  pArray->iNextIndex = 0;\n}\n\n// Gets the array with the given name.\nstruct ARRAY* GetArray(TCHAR* pName)\n{\n  struct ARRAY* pArray = g_arrays.pFirst;\n\n  while (pArray != NULL)\n  {\n    if (lstrcmp(pArray->pName, pName) == 0)\n      return pArray;\n\n    pArray = pArray->pNext;\n  }\n\n  return NULL;\n}\n\n// Determines if the given string is an integer.\nBOOL IsInt(TCHAR* pStr)\n{\n  int i = 0, l = lstrlen(pStr);\n\n  if (l > 0)\n  {\n    if (pStr[0] == TEXT('-'))\n      i++;\n    for (; pStr[i] >= TEXT('0') && pStr[i] <= TEXT('9') && i < l; ++i);\n    return i == l;\n  }\n\n  return FALSE;\n}\n\n// Fills the given buffer with the next element index for the given array.\nvoid GetNextIndex(struct ARRAY* pArray, TCHAR* pKey)\n{\n  wsprintf(pKey, TEXT(\"%d\"), pArray->iNextIndex);\n}\n\n// Adds a new element to the given array. Returns the new element.\nstruct ELEMENT* NewElement(struct ARRAY* pArray, TCHAR* pKey, TCHAR* pData)\n{\n  struct ELEMENT* pElement = GetElement(pArray, pKey);\n\n  if (pElement != NULL)\n  {\n    SetElementData(pElement, pData);\n  }\n  else\n  {\n    ALLOC_P(struct ELEMENT, pElement);\n    ALLOC_STRCPY(pElement->pKey, pKey);\n    ALLOC_STRCPY(pElement->pData, pData);\n\n    // If key is an integer, increase the last index.\n    if (IsInt(pKey))\n    {\n      int i = myatoi(pKey);\n      if (i >= pArray->iNextIndex)\n        pArray->iNextIndex = i + 1;\n    }\n\n    // No elements.\n    if (pArray->pFirstElement == NULL)\n    {\n      pArray->pFirstElement = pElement;\n      pArray->pLastElement = pElement;\n      pArray->nCount = 1;\n      pElement->pNext = NULL;\n      pElement->pPrev = NULL;\n    }\n    else\n    {\n      struct ELEMENT* pLast = pArray->pLastElement;\n      pArray->pLastElement->pNext = pElement;\n      pArray->pLastElement = pElement;\n      pArray->nCount++;\n      pElement->pNext = NULL;\n      pElement->pPrev = pLast;\n    }\n  }\n\n  return pElement;\n}\n\n// Deletes the given element from the given array.\nvoid DeleteElement(struct ARRAY* pArray, struct ELEMENT* pElement)\n{\n  if (pArray->nCount == 1)\n  {\n    pArray->pFirstElement = NULL;\n    pArray->pLastElement = NULL;\n  }\n  else\n  {\n    if (pArray->pFirstElement == pElement)\n      pArray->pFirstElement = pElement->pNext;\n    if (pArray->pLastElement == pElement)\n      pArray->pLastElement = pElement->pPrev;\n\n    if (pElement->pNext != NULL)\n      pElement->pNext->pPrev = pElement->pPrev;\n    if (pElement->pPrev != NULL)\n      pElement->pPrev->pNext = pElement->pNext;\n  }\n  \n  FREE(pElement->pKey);\n  FREE(pElement->pData);\n  FREE(pElement);\n  pArray->nCount--;\n}\n\n// Gets the element in the given array with the given key.\nstruct ELEMENT* GetElement(struct ARRAY* pArray, TCHAR* pKey)\n{\n  struct ELEMENT* pElement = pArray->pFirstElement;\n\n  while (pElement != NULL)\n  {\n    if (lstrcmp(pElement->pKey, pKey) == 0)\n      return pElement;\n\n    pElement = pElement->pNext;\n  }\n\n  return NULL;\n}\n\n// Gets the element in the given array at the given index.\nstruct ELEMENT* GetElementAt(struct ARRAY* pArray, int iIndex)\n{\n  struct ELEMENT* pElement;\n  int i;\n\n  if (iIndex < 0)\n  {\n    pElement = pArray->pLastElement;\n    for (i = -1; i > iIndex && pElement != NULL; i--)\n      pElement = pElement->pPrev;\n  }\n  else\n  {\n    pElement = pArray->pFirstElement;\n    for (i = 0; i < iIndex && pElement != NULL; i++)\n      pElement = pElement->pNext;\n  }\n\n  return pElement;\n}\n\n// Gets the element in the given array that matches the given value (case insensitive).\nstruct ELEMENT* GetElementByVal(struct ARRAY* pArray, TCHAR* pData)\n{\n  struct ELEMENT* pElement = pArray->pFirstElement;\n\n  while (pElement != NULL)\n  {\n    if (lstrcmpi(pElement->pData, pData) == 0)\n      return pElement;\n\n    pElement = pElement->pNext;\n  }\n\n  return NULL;\n}\n\n// Gets the next element in the current array iteration.\nstruct ELEMENT* GetNextElement(struct ARRAY* pArray)\n{\n  pArray->pCurrentElement = pArray->pCurrentElement == NULL ? pArray->pFirstElement : pArray->pCurrentElement->pNext;\n  return pArray->pCurrentElement;\n}\n\n// Gets the previous element in the current array iteration.\nstruct ELEMENT* GetPrevElement(struct ARRAY* pArray)\n{\n  pArray->pCurrentElement = pArray->pCurrentElement == NULL ? pArray->pLastElement : pArray->pCurrentElement->pPrev;\n  return pArray->pCurrentElement;\n}\n\n// Sets the data for the given element.\nvoid SetElementData(struct ELEMENT* pElement, TCHAR* pData)\n{\n  FREE(pElement->pData);\n  ALLOC_STRCPY(pElement->pData, pData);\n}\n\n#ifdef ARRAY_SORT\n// Sorts the given array.\nvoid SortArray(struct ARRAY* pArray, enum SA_FLAGS flags)\n{\n  if (pArray->pFirstElement != NULL)\n  {\n    struct ELEMENT* pElementI = pArray->pFirstElement->pNext;\n    struct ELEMENT* pElementJ;\n    TCHAR* pKeyTemp;\n    TCHAR* pDataTemp;\n\n    while (pElementI != NULL)\n    {\n      pKeyTemp = pElementI->pKey;\n      pDataTemp = pElementI->pData;\n      pElementJ = pElementI->pPrev;\n\n      while (pElementJ != NULL &&\n            ((flags & SA_NUMERIC) ?\n              ((flags & SA_DESCENDING) ? myatoi((flags & SA_BY_KEYS) ? pKeyTemp : pDataTemp) > myatoi((flags & SA_BY_KEYS) ? pElementJ->pKey : pElementJ->pData) : myatoi((flags & SA_BY_KEYS) ? pKeyTemp : pDataTemp) < myatoi((flags & SA_BY_KEYS) ? pElementJ->pKey : pElementJ->pData)) :\n              ((flags & SA_DESCENDING) ?\n                ((flags & SA_IGNORE_CASE) ? lstrcmpi((flags & SA_BY_KEYS) ? pKeyTemp : pDataTemp, (flags & SA_BY_KEYS) ? pElementJ->pKey : pElementJ->pData) > 0 : lstrcmp((flags & SA_BY_KEYS) ? pKeyTemp : pDataTemp, (flags & SA_BY_KEYS) ? pElementJ->pKey : pElementJ->pData) > 0) :\n                ((flags & SA_IGNORE_CASE) ? lstrcmpi((flags & SA_BY_KEYS) ? pKeyTemp : pDataTemp, (flags & SA_BY_KEYS) ? pElementJ->pKey : pElementJ->pData) < 0 : lstrcmp((flags & SA_BY_KEYS) ? pKeyTemp : pDataTemp, (flags & SA_BY_KEYS) ? pElementJ->pKey : pElementJ->pData) < 0))))\n      {\n        if ((flags & SA_BY_KEYS) || !(flags & SA_VALUES_ONLY))\n          pElementJ->pNext->pKey = pElementJ->pKey;\n        pElementJ->pNext->pData = pElementJ->pData;\n        pElementJ = pElementJ->pPrev;\n      }\n\n      if (pElementJ == NULL)\n      {\n        if ((flags & SA_BY_KEYS) || !(flags & SA_VALUES_ONLY))\n          pArray->pFirstElement->pKey = pKeyTemp;\n        pArray->pFirstElement->pData = pDataTemp;\n      }\n      else\n      {\n        if ((flags & SA_BY_KEYS) || !(flags & SA_VALUES_ONLY))\n          pElementJ->pNext->pKey = pKeyTemp;\n        pElementJ->pNext->pData = pDataTemp;\n      }\n      pElementI = pElementI->pNext;\n    }\n  }\n}\n#endif\n\n#ifdef ARRAY_COPY\n// Copies the given array to a new array with the given name.\nstruct ARRAY* CopyArray(struct ARRAY* pArraySrc, TCHAR* pNameDest)\n{\n  struct ARRAY* pArrayDest;\n  struct ELEMENT* pElementSrc;\n\n  if (lstrcmp(pArraySrc->pName, pNameDest) == 0)\n    return pArraySrc;\n\n  pArrayDest = NewArray(pNameDest);\n  pElementSrc = pArraySrc->pFirstElement;\n\n  while (pElementSrc != NULL)\n  {\n    NewElement(pArrayDest, pElementSrc->pKey, pElementSrc->pData);\n    pElementSrc = pElementSrc->pNext;\n  }\n\n  return pArrayDest;\n}\n\n// Copies the keys from the given array to a new array with the given name.\nstruct ARRAY* CopyArrayKeys(struct ARRAY* pArraySrc, TCHAR* pNameDest)\n{\n  struct ARRAY* pArrayDest;\n  struct ELEMENT* pElementSrc;\n  TCHAR* pKey;\n\n  if (lstrcmp(pArraySrc->pName, pNameDest) == 0)\n    return pArraySrc;\n\n  pArrayDest = NewArray(pNameDest);\n  pElementSrc = pArraySrc->pFirstElement;\n\n  ALLOC_C_P(TCHAR, pKey, 32);\n  while (pElementSrc != NULL)\n  {\n    GetNextIndex(pArrayDest, pKey);\n    NewElement(pArrayDest, pKey, pElementSrc->pKey);\n    pElementSrc = pElementSrc->pNext;\n  }\n  FREE(pKey);\n\n  return pArrayDest;\n}\n#endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/Array.h",
    "content": "#ifndef __ARRAY_H__\n#define __ARRAY_H__\n\n// Comment out as needed to reduce DLL size!\n#define ARRAY_CLEAR\n#define ARRAY_SORT\n//#define ARRAY_COPY\n#define ARRAY_JOIN\n#define ARRAY_SPLIT\n//#define ARRAY_TOSTRING\n\n// An element of an array.\nstruct ELEMENT\n{\n  // The array key or index (string).\n  TCHAR* pKey;\n  // The array element data (string).\n  TCHAR* pData;\n  // Pointer to the next element.\n  struct ELEMENT* pNext;\n  // Pointer to the previous element.\n  struct ELEMENT* pPrev;\n};\n\n// An array of elements.\nstruct ARRAY\n{\n  // Array name.\n  TCHAR* pName;\n  // Pointer to the first element in the array.\n  struct ELEMENT* pFirstElement;\n  // Pointer to the last element in the array.\n  struct ELEMENT* pLastElement;\n  // Pointer to the current element in the array for array iteration.\n  struct ELEMENT* pCurrentElement;\n  // The number of elements.\n  int nCount;\n  // The next index number for a new element without a specified key.\n  int iNextIndex;\n  // Pointer to the next array.\n  struct ARRAY* pNext;\n  // Pointer to the previous array.\n  struct ARRAY* pPrev;\n};\n\n// A list of arrays.\nstruct LIST\n{\n  // Pointer to the first array in the list.\n  struct ARRAY* pFirst;\n  // Pointer to the last array in the list.\n  struct ARRAY* pLast;\n  // The number of arrays.\n  int nCount;\n};\n\n#ifdef ARRAY_SORT\n// Sort options.\nenum SA_FLAGS\n{\n  // Sort descending instead of ascending.\n  SA_DESCENDING = 1,\n  // Numeric comparison rather than string.\n  SA_NUMERIC = 2,\n  // Ignore character case.\n  SA_IGNORE_CASE = 4,\n  // Sort by keys rather than by values.\n  SA_BY_KEYS = 8,\n  // Sort the values only (leave the keys in the original order).\n  SA_VALUES_ONLY = 16\n};\n#endif\n\n// The list of arrays.\nstruct LIST g_arrays;\n\n// Initializes pointers to NULL and array count to 0.\nvoid InitArrays();\n// Deallocates all arrays and their data.\nvoid UnInitArrays();\n// Adds a new array with the given name. If the array already exists then it is cleared.\nstruct ARRAY* NewArray(TCHAR* pName);\n// Deletes the given array.\nvoid DeleteArray(struct ARRAY* pArray);\n// Removes all elements from the given array.\nvoid ClearArray(struct ARRAY* pArray);\n// Gets the array with the given name.\nstruct ARRAY* GetArray(TCHAR* pName);\n// Fills the given buffer with the next element index for the given array.\nvoid GetNextIndex(struct ARRAY* pArray, TCHAR* pKey);\n// Adds a new element to the given array. Returns the new element.\nstruct ELEMENT* NewElement(struct ARRAY* pArray, TCHAR* pKey, TCHAR* pData);\n// Deletes the given element from the given array.\nvoid DeleteElement(struct ARRAY* pArray, struct ELEMENT* pElement);\n// Gets the element in the given array with the given key.\nstruct ELEMENT* GetElement(struct ARRAY* pArray, TCHAR* pKey);\n// Gets the element in the given array at the given index.\nstruct ELEMENT* GetElementAt(struct ARRAY* pArray, int iIndex);\n// Gets the element in the given array that matches the given value (case insensitive).\nstruct ELEMENT* GetElementByVal(struct ARRAY* pArray, TCHAR* pData);\n// Gets the next element in the current array iteration.\nstruct ELEMENT* GetNextElement(struct ARRAY* pArray);\n// Gets the previous element in the current array iteration.\nstruct ELEMENT* GetPrevElement(struct ARRAY* pArray);\n// Sets the data for the given element.\nvoid SetElementData(struct ELEMENT* pElement, TCHAR* pData);\n\n#ifdef ARRAY_SORT\n// Sorts the given array.\nvoid SortArray(struct ARRAY* pArray, enum SA_FLAGS flags);\n#endif\n\n#ifdef ARRAY_COPY\n// Copies the given array to a new array with the given name.\nstruct ARRAY* CopyArray(struct ARRAY* pArraySrc, TCHAR* pNameDest);\n// Copies the keys from the given array to a new array with the given name.\nstruct ARRAY* CopyArrayKeys(struct ARRAY* pArraySrc, TCHAR* pNameDest);\n#endif\n\n#define ALLOC(T, V) T* V = (T*)GlobalAlloc(GMEM_FIXED, sizeof(T))\n#define ALLOC_P(T, V) V = (T*)GlobalAlloc(GMEM_FIXED, sizeof(T))\n#define ALLOC_C(T, V, C) T* V = (T*)GlobalAlloc(GMEM_FIXED, C * sizeof(T))\n#define ALLOC_C_P(T, V, C) V = (T*)GlobalAlloc(GMEM_FIXED, C * sizeof(T))\n#define ALLOC_STRCPY(V, S) V = (TCHAR*)GlobalAlloc(GMEM_FIXED, (lstrlen(S) + 1) * sizeof(TCHAR)); lstrcpy(V, S)\n#define FREE(P) GlobalFree(P)\n\n#endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/api.h",
    "content": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2013 Nullsoft and Contributors\n * \n * Licensed under the zlib/libpng license (the \"License\");\n * you may not use this file except in compliance with the License.\n * \n * Licence details can be found in the file COPYING.\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n */\n\n#ifndef _NSIS_EXEHEAD_API_H_\n#define _NSIS_EXEHEAD_API_H_\n\n// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version\n// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))\n// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}\n\n#define NSISPIAPIVER_1_0 0x00010000\n#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0\n\n// NSIS Plug-In Callback Messages\nenum NSPIM \n{\n\tNSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup\n\tNSPIM_GUIUNLOAD, // Called after .onGUIEnd\n};\n\n// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()\n// Return NULL for unknown messages\n// Should always be __cdecl for future expansion possibilities\ntypedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);\n\n// extra_parameters data structures containing other interesting stuff\n// but the stack, variables and HWND passed on to plug-ins.\ntypedef struct\n{\n  int autoclose;\n  int all_user_var;\n  int exec_error;\n  int abort;\n  int exec_reboot; // NSIS_SUPPORT_REBOOT\n  int reboot_called; // NSIS_SUPPORT_REBOOT\n  int XXX_cur_insttype; // depreacted\n  int plugin_api_version; // see NSISPIAPIVER_CURR\n                          // used to be XXX_insttype_changed\n  int silent; // NSIS_CONFIG_SILENT_SUPPORT\n  int instdir_error;\n  int rtl;\n  int errlvl;\n  int alter_reg_view;\n  int status_update;\n} exec_flags_t;\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\ntypedef struct {\n  exec_flags_t *exec_flags;\n  int (NSISCALL *ExecuteCodeSegment)(int, HWND);\n  void (NSISCALL *validate_filename)(TCHAR *);\n  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors\n} extra_parameters;\n\n// Definitions for page showing plug-ins\n// See Ui.c to understand better how they're used\n\n// sent to the outer window to tell it to go to the next inner window\n#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)\n\n// custom pages should send this message to let NSIS know they're ready\n#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)\n\n// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning\n#define NOTIFY_BYE_BYE 'x'\n\n#endif /* _PLUGIN_H_ */\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/nsArray.c",
    "content": "/*\n  nsArray NSIS plug-in by Stuart Welch <afrowuk@afrowsoft.co.uk>\n  v1.1.1.7 - 2nd December 2014\n*/\n\n#include <windows.h>\n#include \"nsArray.h\"\n#include \"Array.h\"\n#include \"pluginapi.h\"\n\nHANDLE g_hInstance;\nextern struct LIST g_arrays;\n\n// Frees memory on plug-in unload.\nstatic UINT_PTR PluginCallback(enum NSPIM msg)\n{\n  if (msg == NSPIM_UNLOAD)\n  {\n    UnInitArrays();\n  }\n  return 0;\n}\n\nint lstrcmpn(TCHAR* a, TCHAR* b, int m, BOOL bIgnoreCase)\n{\n  int i, j;\n  for (i = 0, j = 0; j < m; i++, j++)\n  {\n    TCHAR ca = bIgnoreCase ? LOWORD(CharLower((LPTSTR)a[i])) : a[i];\n    TCHAR cb = bIgnoreCase ? LOWORD(CharLower((LPTSTR)b[j])) : b[j];\n    if (ca < cb)\n      return -1;\n    if (ca > cb)\n      return 1;\n  }\n  return 0;\n}\n\n// Gets the number of elements in an array.\nNSISFUNC(Length)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n\n      if (pArray != NULL)\n      {\n        wsprintf(pArg, TEXT(\"%d\"), pArray->nCount);\n        pushstring(pArg);\n        bOK = TRUE;\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n// Gets a single element in an array.\nNSISFUNC(Get)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n    ALLOC_C(TCHAR, pArg, string_size);\n\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n\n      if (popstring(pArg) == 0 && pArray != NULL)\n      {\n        struct ELEMENT* pElement;\n        BOOL bDataOnly = FALSE;\n\n        if (lstrcmpn(pArg, TEXT(\"/at=\"), 4, TRUE) == 0)\n        {\n          pElement = GetElementAt(pArray, myatoi(pArg + 4));\n        }\n        else\n        {\n          pElement = GetElement(pArray, pArg);\n          bDataOnly = TRUE;\n        }\n\n        if (pElement != NULL)\n        {\n          pushstring(pElement->pData);\n          if (!bDataOnly)\n            pushstring(pElement->pKey);\n          bOK = TRUE;\n        }\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n// Adds a single value to an array.\nNSISFUNC(Set)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n      ALLOC_C(TCHAR, pKey, string_size);\n\n      if (pArray == NULL)\n        pArray = NewArray(pArg);\n\t  \n      if (popstring(pArg) == 0)\n      {\n        if (lstrcmpn(pArg, TEXT(\"/at=\"), 4, TRUE) == 0)\n        {\n          struct ELEMENT* pElement = GetElementAt(pArray, myatoi(pArg + 4));\n\n          if (popstring(pArg) == 0 && pElement != NULL)\n          {\n            SetElementData(pElement, pArg);\n            bOK = TRUE;\n          }\n        }\n        else if (lstrcmpn(pArg, TEXT(\"/key=\"), 5, TRUE) == 0)\n        {\n          lstrcpy(pKey, pArg + 5);\n\n          if (popstring(pArg) == 0 && NewElement(pArray, pKey, pArg) != NULL)\n            bOK = TRUE;\n        }\n        else\n        {\n          GetNextIndex(pArray, pKey);\n\n          if (NewElement(pArray, pKey, pArg) != NULL)\n            bOK = TRUE;\n        }\n      }\n      FREE(pKey);\n    }\n    FREE(pArg);\n\n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n// Adds one or more values to an array.\nNSISFUNC(SetList)\n{\n  DLL_INIT();\n  {\n    int bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n      ALLOC_C(TCHAR, pKey, string_size);\n\n      if (pArray == NULL)\n        pArray = NewArray(pArg);\n\n      bOK = TRUE;\n\n      while (popstring(pArg) == 0)\n      {\n        if (lstrcmpi(pArg, TEXT(\"/end\")) == 0)\n          break;\n\n        if (lstrcmpn(pArg, TEXT(\"/at=\"), 4, TRUE) == 0)\n        {\n          struct ELEMENT* pElement = GetElementAt(pArray, myatoi(pArg + 4));\n\n          if (popstring(pArg) == 0 && pElement != NULL)\n            SetElementData(pElement, pArg);\n          else\n            bOK = FALSE;\n        }\n        else if (lstrcmpn(pArg, TEXT(\"/key=\"), 5, TRUE) == 0)\n        {\n          lstrcpy(pKey, pArg + 5);\n\n          if (popstring(pArg) != 0 || NewElement(pArray, pKey, pArg) == NULL)\n            bOK = FALSE;\n        }\n        else\n        {\n          GetNextIndex(pArray, pKey);\n\n          if (NewElement(pArray, pKey, pArg) == NULL)\n            bOK = FALSE;\n        }\n      }\n      FREE(pKey);\n    }\n    FREE(pArg);\n\n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n// Removes a single value from an array.\nNSISFUNC(Remove)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      BOOL fList = FALSE;\n      struct ARRAY* pArray = GetArray(pArg);\n\n      if (popstring(pArg) == 0)\n      {\n        struct ELEMENT* pElement;\n\n        if (lstrcmpn(pArg, TEXT(\"/at=\"), 4, TRUE) == 0)\n        {\n          pElement = GetElementAt(pArray, myatoi(pArg + 4));\n        }\n        else if (lstrcmpn(pArg, TEXT(\"/val=\"), 5, TRUE) == 0)\n        {\n          pElement = GetElementByVal(pArray, pArg + 5);\n        }\n        else\n        {\n          pElement = GetElement(pArray, pArg);\n        }\n\n        if (pElement != NULL)\n        {\n          DeleteElement(pArray, pElement);\n          bOK = TRUE;\n        }\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n// Removes one or more values from an array.\nNSISFUNC(RemoveList)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n      \n      bOK = TRUE;\n\n      while (popstring(pArg) == 0)\n      {\n        if (lstrcmpi(pArg, TEXT(\"/end\")) == 0)\n          break;\n\n        if (pArray != NULL)\n        {\n          struct ELEMENT* pElement;\n\n          if (lstrcmpn(pArg, TEXT(\"/at=\"), 4, TRUE) == 0)\n          {\n            pElement = GetElementAt(pArray, myatoi(pArg + 4));\n          }\n          else if (lstrcmpn(pArg, TEXT(\"/val=\"), 5, TRUE) == 0)\n          {\n            pElement = GetElementByVal(pArray, pArg + 5);\n          }\n          else\n          {\n            pElement = GetElement(pArray, pArg);\n          }\n\n          if (pElement != NULL)\n            DeleteElement(pArray, pElement);\n          else\n            bOK = FALSE;\n        }\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n// Iterates through array elements.\nNSISFUNC(Iterate)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n    ALLOC_C(TCHAR, pArg, string_size);\n\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n      BOOL bNext = TRUE;\n      struct ELEMENT* pElement = NULL;\n\n      if (popstring(pArg) == 0)\n      {\n        if (lstrcmpi(pArg, TEXT(\"/reset\")) == 0)\n        {\n          if (pArray != NULL)\n          {\n            pArray->pCurrentElement = NULL;\n            bOK = TRUE;\n          }\n\n          bNext = FALSE;\n        }\n        else if (lstrcmpi(pArg, TEXT(\"/prev\")) == 0)\n        {\n          if (pArray != NULL)\n          {\n            pElement = GetPrevElement(pArray);\n          }\n\n          bNext = FALSE;\n        }\n        else\n        {\n          pushstring(pArg);\n        }\n      }\n\n      if (bNext && pArray != NULL)\n      {\n        pElement = GetNextElement(pArray);\n      }\n\n      if (pElement != NULL)\n      {\n        pushstring(pElement->pData);\n        pushstring(pElement->pKey);\n        bOK = TRUE;\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n#ifdef ARRAY_CLEAR\n// Removes all elements from an array.\nNSISFUNC(Clear)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n\n      if (pArray != NULL)\n      {\n        ClearArray(pArray);\n        bOK = TRUE;\n      }\n    }\n    FREE(pArg);\n\n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n#endif\n\n#ifdef ARRAY_SORT\n// Sorts the array.\nNSISFUNC(Sort)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n      if (popstring(pArg) == 0 && pArray != NULL)\n      {\n        SortArray(pArray, (enum SA_FLAGS)myatoi_or(pArg));\n        bOK = TRUE;\n      }\n    }\n\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n#endif\n\n#ifdef ARRAY_COPY\n// Copies an array to a new array.\nNSISFUNC(Copy)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n        \n      if (popstring(pArg) == 0 && pArray != NULL && CopyArray(pArray, pArg) != NULL)\n        bOK = TRUE;\n    }\n\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n\n// Copies an array's keys to a new array.\nNSISFUNC(CopyKeys)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n        \n      if (popstring(pArg) == 0 && pArray != NULL && CopyArrayKeys(pArray, pArg) != NULL)\n        bOK = TRUE;\n    }\n\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n#endif\n\n#ifdef ARRAY_JOIN\n// Joins the elements of the array into a string.\nNSISFUNC(Join)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n\n      if (popstring(pArg) == 0 && pArray != NULL)\n      {\n        ALLOC_C(TCHAR, pJoined, string_size);\n\n        struct ELEMENT* pElement = pArray->pFirstElement;\n        int chars = 0, joinLen = lstrlen(pArg);\n        BOOL bNoEmpty = FALSE;\n        \n        if (popstring(pJoined) == 0)\n        {\n          if (lstrcmpi(pJoined, TEXT(\"/noempty\")) == 0)\n            bNoEmpty = TRUE;\n          else\n            pushstring(pJoined);\n        }\n        \n        bOK = TRUE;\n        lstrcpy(pJoined, TEXT(\"\"));\n        while (pElement != NULL)\n        {\n          if (*pElement->pData || !bNoEmpty)\n          {\n            int length = lstrlen(pElement->pData);\n            lstrcpyn(pJoined + chars, pElement->pData, string_size - chars - 1);\n            chars += length;\n\n            if (chars >= string_size)\n            {\n              bOK = FALSE;\n              break;\n            }\n\n            if (pElement->pNext != NULL && (*pElement->pNext->pData || !bNoEmpty))\n            {\n              lstrcpyn(pJoined + chars, pArg, string_size - chars - 1);\n              chars += joinLen;\n            }\n\n            if (chars >= string_size)\n            {\n              bOK = FALSE;\n              break;\n            }\n          }\n          pElement = pElement->pNext;\n        }\n\n        pushstring(pJoined);\n\n        FREE(pJoined);\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n#endif\n\n#ifdef ARRAY_SPLIT\n// Splits a string into an array using a delimiter string.\nNSISFUNC(Split)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size + 1);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n      ALLOC_C(TCHAR, pDel, string_size);\n\n      if (pArray == NULL)\n        pArray = NewArray(pArg);\n\n      if (popstring(pArg) == 0 && popstring(pDel) == 0 && pArray != NULL)\n      {\n        int i, j, nDel = lstrlen(pDel), nArg = lstrlen(pArg);\n        ALLOC_C(TCHAR, pKey, string_size);\n        ALLOC_C(TCHAR, pVal, string_size);\n        BOOL bNoEmpty = FALSE;\n        BOOL bIgnoreCase = FALSE;\n\n        while (popstring(pKey) == 0)\n        {\n          if (lstrcmpi(pKey, TEXT(\"/noempty\")) == 0)\n          {\n            bNoEmpty = TRUE;\n          }\n          else if (lstrcmpi(pKey, TEXT(\"/ignorecase\")) == 0)\n          {\n            bIgnoreCase = TRUE;\n          }\n          else\n          {\n            pushstring(pKey);\n            break;\n          }\n        }\n          \n        pVal[0] = (TCHAR)NULL;\n\n        if (nArg == 0 && !bNoEmpty)\n        {\n          GetNextIndex(pArray, pKey);\n          NewElement(pArray, pKey, TEXT(\"\"));\n        }\n\n        for (i = 0, j = 0; i <= nArg; i++)\n        {\n          if (!*pDel)\n          {\n            GetNextIndex(pArray, pKey);\n            pVal[0] = pArg[i];\n            pVal[1] = (TCHAR)NULL;\n            NewElement(pArray, pKey, pVal);\n          }\n          else\n          {\n            if (lstrcmpn(pArg + i, pDel, nDel, bIgnoreCase) == 0)\n            {\n              if (*pVal || !bNoEmpty)\n              {\n                GetNextIndex(pArray, pKey);\n                NewElement(pArray, pKey, pVal);\n              }\n              i += nDel - 1;\n              pVal[0] = (TCHAR)NULL;\n              j = 0;\n            }\n            else\n            {\n              pVal[j] = pArg[i];\n              pVal[j + 1] = (TCHAR)NULL;\n              j++;\n            }\n          }\n        }\n\n        if (j > 0 && (*pVal || !bNoEmpty))\n        {\n          GetNextIndex(pArray, pKey);\n          NewElement(pArray, pKey, pVal);\n        }\n\n        FREE(pKey);\n        FREE(pVal);\n      }\n      FREE(pDel);\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n#endif\n\n#ifdef ARRAY_TOSTRING\n// Returns a string representation of the array.\nNSISFUNC(ToString)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n\n      if (pArray != NULL)\n      {\n        ALLOC_C(TCHAR, pJoined, string_size);\n\n        struct ELEMENT* pElement = pArray->pFirstElement;\n        int chars = 0;\n        \n        bOK = TRUE;\n        lstrcpy(pJoined, TEXT(\"\"));\n        while (pElement != NULL)\n        {\n          int length = lstrlen(pElement->pKey);\n          lstrcpyn(pJoined + chars, pElement->pKey, string_size - chars - 1);\n          chars += length;\n\n          if (chars >= string_size)\n          {\n            bOK = FALSE;\n            break;\n          }\n\n          lstrcpyn(pJoined + chars, TEXT(\" => \"), string_size - chars - 1);\n          chars += 4;\n\n          if (chars >= string_size)\n          {\n            bOK = FALSE;\n            break;\n          }\n\n          length = lstrlen(pElement->pData);\n          lstrcpyn(pJoined + chars, pElement->pData, string_size - chars - 1);\n          chars += length;\n\n          if (chars >= string_size)\n          {\n            bOK = FALSE;\n            break;\n          }\n\n          if (pElement->pNext != NULL)\n          {\n            lstrcpyn(pJoined + chars, TEXT(\", \"), string_size - chars - 1);\n            chars += 2;\n          }\n\n          if (chars >= string_size)\n          {\n            bOK = FALSE;\n            break;\n          }\n\n          pElement = pElement->pNext;\n        }\n\n        pushstring(pJoined);\n\n        FREE(pJoined);\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n#endif\n\n#ifdef ARRAY_REVERSE\n// Reverses the contents of an array.\nNSISFUNC(Reverse)\n{\n  DLL_INIT();\n  {\n    BOOL bOK = FALSE;\n\n    ALLOC_C(TCHAR, pArg, string_size);\n    if (popstring(pArg) == 0)\n    {\n      struct ARRAY* pArray = GetArray(pArg);\n\n      if (pArray != NULL)\n      {\n        ReverseArray(pArray);\n        bOK = TRUE;\n      }\n    }\n    FREE(pArg);\n    \n    if (!bOK)\n      extra->exec_flags->exec_error = 1;\n  }\n}\n#endif\n\nBOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)\n{\n  g_hInstance = hInst;\n\n  if (ul_reason_for_call == DLL_PROCESS_ATTACH)\n  {\n    InitArrays();\n  }\n\n  return TRUE;\n}"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/nsArray.h",
    "content": "#ifndef __NSARRAY_H__\n#define __NSARRAY_H__\n\n#define NSISFUNC(name) void __declspec(dllexport) name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra)\n#define DLL_INIT() EXDLL_INIT(); extra->RegisterPluginCallback((HMODULE)g_hInstance, PluginCallback)\n\n#endif"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/nsArray.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"nsArray\", \"nsArray.vcxproj\", \"{A9A59D5F-D5AD-40CA-ABD0-816574956E94}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug Unicode|Win32 = Debug Unicode|Win32\n\t\tDebug Unicode|x64 = Debug Unicode|x64\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tRelease Unicode|Win32 = Release Unicode|Win32\n\t\tRelease Unicode|x64 = Release Unicode|x64\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug Unicode|x64.Build.0 = Debug Unicode|x64\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Debug|x64.Build.0 = Debug|x64\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release Unicode|Win32.Build.0 = Release Unicode|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release Unicode|x64.ActiveCfg = Release Unicode|x64\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release Unicode|x64.Build.0 = Release Unicode|x64\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release|Win32.Build.0 = Release|Win32\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release|x64.ActiveCfg = Release|x64\n\t\t{A9A59D5F-D5AD-40CA-ABD0-816574956E94}.Release|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/nsArray.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug Unicode|Win32\">\n      <Configuration>Debug Unicode</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug Unicode|x64\">\n      <Configuration>Debug Unicode</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release Unicode|Win32\">\n      <Configuration>Release Unicode</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release Unicode|x64\">\n      <Configuration>Release Unicode</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{A9A59D5F-D5AD-40CA-ABD0-816574956E94}</ProjectGuid>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseOfMfc>false</UseOfMfc>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseOfMfc>false</UseOfMfc>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseOfMfc>false</UseOfMfc>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseOfMfc>false</UseOfMfc>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseOfMfc>false</UseOfMfc>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseOfMfc>false</UseOfMfc>\n    <CharacterSet>MultiByte</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\..\\Plugins\\x86-ansi\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration)\\</IntDir>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</GenerateManifest>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</GenerateManifest>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\..\\Plugins\\</OutDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\">$(SolutionDir)..\\..\\Unicode\\Plugins\\</OutDir>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</GenerateManifest>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</GenerateManifest>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\">false</GenerateManifest>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\">false</GenerateManifest>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">$(SolutionDir)..\\..\\Plugins\\x86-unicode\\</OutDir>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">false</GenerateManifest>\n    <GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\">false</GenerateManifest>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\">\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-unicode\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-ansi\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-ansi\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\">\n    <OutDir>$(SolutionDir)..\\..\\Plugins\\x64-unicode\\</OutDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Midl>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <TargetEnvironment>Win32</TargetEnvironment>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <Optimization>Full</Optimization>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <TargetMachine>MachineX86</TargetMachine>\n      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <Optimization>Full</Optimization>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Midl>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <TargetEnvironment>Win32</TargetEnvironment>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsArray_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <Optimization>Disabled</Optimization>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <TargetMachine>MachineX86</TargetMachine>\n      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsArray_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <Optimization>Disabled</Optimization>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'\">\n    <Midl>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <TargetEnvironment>Win32</TargetEnvironment>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsArray_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <Optimization>Disabled</Optimization>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <TargetMachine>MachineX86</TargetMachine>\n      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug Unicode|x64'\">\n    <Midl>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsArray_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <Optimization>Disabled</Optimization>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|Win32'\">\n    <Midl>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <TargetEnvironment>Win32</TargetEnvironment>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>Full</Optimization>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <TargetMachine>MachineX86</TargetMachine>\n      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release Unicode|x64'\">\n    <Midl>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MkTypLibCompatible>true</MkTypLibCompatible>\n      <SuppressStartupBanner>true</SuppressStartupBanner>\n      <HeaderFileName>\n      </HeaderFileName>\n    </Midl>\n    <ClCompile>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <BufferSecurityCheck>false</BufferSecurityCheck>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>Full</Optimization>\n    </ClCompile>\n    <ResourceCompile>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <Culture>0x0409</Culture>\n    </ResourceCompile>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n      <EntryPointSymbol>DllMain</EntryPointSymbol>\n      <DataExecutionPrevention>\n      </DataExecutionPrevention>\n      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"Array.c\" />\n    <ClCompile Include=\"nsArray.c\" />\n    <ClCompile Include=\"pluginapi.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"api.h\" />\n    <ClInclude Include=\"Array.h\" />\n    <ClInclude Include=\"nsArray.h\" />\n    <ClInclude Include=\"nsis_tchar.h\" />\n    <ClInclude Include=\"pluginapi.h\" />\n    <ClInclude Include=\"resource.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"nsArray.rc\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/nsArray.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"Array.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"nsArray.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"pluginapi.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"resource.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"Array.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"nsArray.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"api.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"nsis_tchar.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"pluginapi.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"nsArray.rc\">\n      <Filter>Resource Files</Filter>\n    </ResourceCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/nsis_tchar.h",
    "content": "/*\n * nsis_tchar.h\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2013 Nullsoft and Contributors\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n *\n * For Unicode support by Jim Park -- 08/30/2007\n */\n\n// Jim Park: Only those we use are listed here.\n\n#pragma once\n\n#ifdef _UNICODE\n\n#ifndef _T\n#define __T(x)   L ## x\n#define _T(x)    __T(x)\n#define _TEXT(x) __T(x)\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\n#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)\ntypedef unsigned short TCHAR;\n#else\ntypedef wchar_t TCHAR;\n#endif\n#endif\n\n\n// program\n#define _tenviron   _wenviron\n#define __targv     __wargv\n\n// printfs\n#define _ftprintf   fwprintf\n#define _sntprintf  _snwprintf\n#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)\n#\tdefine _stprintf   swprintf\n#else\n#\tdefine _stprintf   _swprintf\n#endif\n#define _tprintf    wprintf\n#define _vftprintf  vfwprintf\n#define _vsntprintf _vsnwprintf\n#if defined(_MSC_VER) && (_MSC_VER<=1310)\n#\tdefine _vstprintf  vswprintf\n#else\n#\tdefine _vstprintf  _vswprintf\n#endif\n\n// scanfs\n#define _tscanf     wscanf\n#define _stscanf    swscanf\n\n// string manipulations\n#define _tcscat     wcscat\n#define _tcschr     wcschr\n#define _tcsclen    wcslen\n#define _tcscpy     wcscpy\n#define _tcsdup     _wcsdup\n#define _tcslen     wcslen\n#define _tcsnccpy   wcsncpy\n#define _tcsncpy    wcsncpy\n#define _tcsrchr    wcsrchr\n#define _tcsstr     wcsstr\n#define _tcstok     wcstok\n\n// string comparisons\n#define _tcscmp     wcscmp\n#define _tcsicmp    _wcsicmp\n#define _tcsncicmp  _wcsnicmp\n#define _tcsncmp    wcsncmp\n#define _tcsnicmp   _wcsnicmp\n\n// upper / lower\n#define _tcslwr     _wcslwr\n#define _tcsupr     _wcsupr\n#define _totlower   towlower\n#define _totupper   towupper\n\n// conversions to numbers\n#define _tcstoi64   _wcstoi64\n#define _tcstol     wcstol\n#define _tcstoul    wcstoul\n#define _tstof      _wtof\n#define _tstoi      _wtoi\n#define _tstoi64    _wtoi64\n#define _ttoi       _wtoi\n#define _ttoi64     _wtoi64\n#define _ttol       _wtol\n\n// conversion from numbers to strings\n#define _itot       _itow\n#define _ltot       _ltow\n#define _i64tot     _i64tow\n#define _ui64tot    _ui64tow\n\n// file manipulations\n#define _tfopen     _wfopen\n#define _topen      _wopen\n#define _tremove    _wremove\n#define _tunlink    _wunlink\n\n// reading and writing to i/o\n#define _fgettc     fgetwc\n#define _fgetts     fgetws\n#define _fputts     fputws\n#define _gettchar   getwchar\n\n// directory\n#define _tchdir     _wchdir\n\n// environment\n#define _tgetenv    _wgetenv\n#define _tsystem    _wsystem\n\n// time\n#define _tcsftime   wcsftime\n\n#else // ANSI\n\n#ifndef _T\n#define _T(x)    x\n#define _TEXT(x) x\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\ntypedef char TCHAR;\n#endif\n\n// program\n#define _tenviron   environ\n#define __targv     __argv\n\n// printfs\n#define _ftprintf   fprintf\n#define _sntprintf  _snprintf\n#define _stprintf   sprintf\n#define _tprintf    printf\n#define _vftprintf  vfprintf\n#define _vsntprintf _vsnprintf\n#define _vstprintf  vsprintf\n\n// scanfs\n#define _tscanf     scanf\n#define _stscanf    sscanf\n\n// string manipulations\n#define _tcscat     strcat\n#define _tcschr     strchr\n#define _tcsclen    strlen\n#define _tcscnlen   strnlen\n#define _tcscpy     strcpy\n#define _tcsdup     _strdup\n#define _tcslen     strlen\n#define _tcsnccpy   strncpy\n#define _tcsrchr    strrchr\n#define _tcsstr     strstr\n#define _tcstok     strtok\n\n// string comparisons\n#define _tcscmp     strcmp\n#define _tcsicmp    _stricmp\n#define _tcsncmp    strncmp\n#define _tcsncicmp  _strnicmp\n#define _tcsnicmp   _strnicmp\n\n// upper / lower\n#define _tcslwr     _strlwr\n#define _tcsupr     _strupr\n\n#define _totupper   toupper\n#define _totlower   tolower\n\n// conversions to numbers\n#define _tcstol     strtol\n#define _tcstoul    strtoul\n#define _tstof      atof\n#define _tstoi      atoi\n#define _tstoi64    _atoi64\n#define _tstoi64    _atoi64\n#define _ttoi       atoi\n#define _ttoi64     _atoi64\n#define _ttol       atol\n\n// conversion from numbers to strings\n#define _i64tot     _i64toa\n#define _itot       _itoa\n#define _ltot       _ltoa\n#define _ui64tot    _ui64toa\n\n// file manipulations\n#define _tfopen     fopen\n#define _topen      _open\n#define _tremove    remove\n#define _tunlink    _unlink\n\n// reading and writing to i/o\n#define _fgettc     fgetc\n#define _fgetts     fgets\n#define _fputts     fputs\n#define _gettchar   getchar\n\n// directory\n#define _tchdir     _chdir\n\n// environment\n#define _tgetenv    getenv\n#define _tsystem    system\n\n// time\n#define _tcsftime   strftime\n\n#endif\n\n// is functions (the same in Unicode / ANSI)\n#define _istgraph   isgraph\n#define _istascii   __isascii\n\n#define __TFILE__ _T(__FILE__)\n#define __TDATE__ _T(__DATE__)\n#define __TTIME__ _T(__TIME__)\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/pluginapi.c",
    "content": "#include <windows.h>\n\n#include \"pluginapi.h\"\n\n#ifdef _countof\n#define COUNTOF _countof\n#else\n#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))\n#endif\n\nunsigned int g_stringsize;\nstack_t **g_stacktop;\nTCHAR *g_variables;\n\n// utility functions (not required but often useful)\n\nint NSISCALL popstring(TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpy(str,th->text);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nint NSISCALL popstringn(TCHAR *str, int maxlen)\n{\n  stack_t *th;\n  if (!g_stacktop || !*g_stacktop) return 1;\n  th=(*g_stacktop);\n  if (str) lstrcpyn(str,th->text,maxlen?maxlen:g_stringsize);\n  *g_stacktop = th->next;\n  GlobalFree((HGLOBAL)th);\n  return 0;\n}\n\nvoid NSISCALL pushstring(const TCHAR *str)\n{\n  stack_t *th;\n  if (!g_stacktop) return;\n  th=(stack_t*)GlobalAlloc(GPTR,(sizeof(stack_t)+(g_stringsize)*sizeof(TCHAR)));\n  lstrcpyn(th->text,str,g_stringsize);\n  th->next=*g_stacktop;\n  *g_stacktop=th;\n}\n\nTCHAR* NSISCALL getuservariable(const int varnum)\n{\n  if (varnum < 0 || varnum >= __INST_LAST) return NULL;\n  return g_variables+varnum*g_stringsize;\n}\n\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var)\n{\n\tif (var != NULL && varnum >= 0 && varnum < __INST_LAST) \n\t\tlstrcpy(g_variables + varnum*g_stringsize, var);\n}\n\n#ifdef _UNICODE\nint NSISCALL PopStringA(char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   int rval = popstring(wideStr);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nint NSISCALL PopStringNA(char* ansiStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, realLen*sizeof(wchar_t));\n   int rval = popstringn(wideStr, realLen);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, realLen, NULL, NULL);\n   GlobalFree((HGLOBAL)wideStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringA(const char* ansiStr)\n{\n   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   pushstring(wideStr);\n   GlobalFree((HGLOBAL)wideStr);\n   return;\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   lstrcpyW(wideStr, getuservariable(varnum));\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   wchar_t* wideStr = getuservariable(varnum);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n}\n\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr)\n{\n   if (ansiStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      wchar_t* wideStr = g_variables + varnum * g_stringsize;\n      MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   }\n}\n\n#else\n// ANSI defs\nint NSISCALL PopStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   int rval = popstring(ansiStr);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nint NSISCALL PopStringNW(wchar_t* wideStr, int maxlen)\n{\n   int realLen = maxlen ? maxlen : g_stringsize;\n   char* ansiStr = (char*) GlobalAlloc(GPTR, realLen);\n   int rval = popstringn(ansiStr, realLen);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, realLen);\n   GlobalFree((HGLOBAL)ansiStr);\n   return rval;\n}\n\nvoid NSISCALL PushStringW(wchar_t* wideStr)\n{\n   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);\n   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   pushstring(ansiStr);\n   GlobalFree((HGLOBAL)ansiStr);\n}\n\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)\n{\n   char* ansiStr = getuservariable(varnum);\n   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);\n}\n\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr)\n{\n   lstrcpyA(ansiStr, getuservariable(varnum));\n}\n\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr)\n{\n   if (wideStr != NULL && varnum >= 0 && varnum < __INST_LAST)\n   {\n      char* ansiStr = g_variables + varnum * g_stringsize;\n      WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);\n   }\n}\n#endif\n\n// playing with integers\n\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s)\n{\n  INT_PTR v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  return v;\n}\n\nunsigned int NSISCALL myatou(const TCHAR *s)\n{\n  unsigned int v=0;\n\n  for (;;)\n  {\n    unsigned int c=*s++;\n    if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n    else break;\n    v*=10;\n    v+=c;\n  }\n  return v;\n}\n\nint NSISCALL myatoi_or(const TCHAR *s)\n{\n  int v=0;\n  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))\n  {\n    s++;\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('9')) c-=_T('0');\n      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;\n      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;\n      else break;\n      v<<=4;\n      v+=c;\n    }\n  }\n  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))\n  {\n    for (;;)\n    {\n      int c=*(++s);\n      if (c >= _T('0') && c <= _T('7')) c-=_T('0');\n      else break;\n      v<<=3;\n      v+=c;\n    }\n  }\n  else\n  {\n    int sign=0;\n    if (*s == _T('-')) sign++; else s--;\n    for (;;)\n    {\n      int c=*(++s) - _T('0');\n      if (c < 0 || c > 9) break;\n      v*=10;\n      v+=c;\n    }\n    if (sign) v = -v;\n  }\n\n  // Support for simple ORed expressions\n  if (*s == _T('|')) \n  {\n      v |= myatoi_or(s+1);\n  }\n\n  return v;\n}\n\nINT_PTR NSISCALL popintptr()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return nsishelper_str_to_ptr(buf);\n}\n\nint NSISCALL popint_or()\n{\n  TCHAR buf[128];\n  if (popstringn(buf,COUNTOF(buf)))\n    return 0;\n  return myatoi_or(buf);\n}\n\nvoid NSISCALL pushintptr(INT_PTR value)\n{\n\tTCHAR buffer[30];\n\twsprintf(buffer, sizeof(void*) > 4 ? _T(\"%Id\") : _T(\"%d\"), value);\n\tpushstring(buffer);\n}\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/nsArray/pluginapi.h",
    "content": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n#include \"nsis_tchar.h\"\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n\n#define EXDLL_INIT()           {  \\\n        g_stringsize=string_size; \\\n        g_stacktop=stacktop;      \\\n        g_variables=variables; }\n\ntypedef struct _stack_t {\n  struct _stack_t *next;\n  TCHAR text[1]; // this should be the length of string_size\n} stack_t;\n\nenum\n{\nINST_0,         // $0\nINST_1,         // $1\nINST_2,         // $2\nINST_3,         // $3\nINST_4,         // $4\nINST_5,         // $5\nINST_6,         // $6\nINST_7,         // $7\nINST_8,         // $8\nINST_9,         // $9\nINST_R0,        // $R0\nINST_R1,        // $R1\nINST_R2,        // $R2\nINST_R3,        // $R3\nINST_R4,        // $R4\nINST_R5,        // $R5\nINST_R6,        // $R6\nINST_R7,        // $R7\nINST_R8,        // $R8\nINST_R9,        // $R9\nINST_CMDLINE,   // $CMDLINE\nINST_INSTDIR,   // $INSTDIR\nINST_OUTDIR,    // $OUTDIR\nINST_EXEDIR,    // $EXEDIR\nINST_LANG,      // $LANGUAGE\n__INST_LAST\n};\n\nextern unsigned int g_stringsize;\nextern stack_t **g_stacktop;\nextern TCHAR *g_variables;\n\nvoid NSISCALL pushstring(const TCHAR *str);\nvoid NSISCALL pushintptr(INT_PTR value);\n#define pushint(v) pushintptr((INT_PTR)(v))\nint NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack\nint NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize\nINT_PTR NSISCALL popintptr();\n#define popint() ( (int) popintptr() )\nint NSISCALL popint_or(); // with support for or'ing (2|4|8)\nINT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);\n#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer\nunsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only\nint NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)\nTCHAR* NSISCALL getuservariable(const int varnum);\nvoid NSISCALL setuservariable(const int varnum, const TCHAR *var);\n\n#ifdef _UNICODE\n#define PopStringW(x) popstring(x)\n#define PushStringW(x) pushstring(x)\n#define SetUserVariableW(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringA(char* ansiStr);\nvoid NSISCALL PushStringA(const char* ansiStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);\n\n#else\n// ANSI defs\n\n#define PopStringA(x) popstring(x)\n#define PushStringA(x) pushstring(x)\n#define SetUserVariableA(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringW(wchar_t* wideStr);\nvoid NSISCALL PushStringW(wchar_t* wideStr);\nvoid NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, char* ansiStr);\nvoid NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif//!___NSIS_PLUGIN__H___\n"
  },
  {
    "path": "setup/nsis/tools/Contrib/zip2exe/Base.nsh",
    "content": ";Change this file to customize zip2exe generated installers\n\nName \"${ZIP2EXE_NAME}\"\nOutFile \"${ZIP2EXE_OUTFILE}\"\n\nAllowRootDirInstall true\n\n\n!ifdef ZIP2EXE_COMPRESSOR_SOLID\n  !define SETCOMPRESSOR_SWITCH /SOLID\n!else\n  !define SETCOMPRESSOR_SWITCH\n!endif\n\n!ifdef ZIP2EXE_COMPRESSOR_ZLIB\n  SetCompressor ${SETCOMPRESSOR_SWITCH} zlib\n!else ifdef ZIP2EXE_COMPRESSOR_BZIP2\n  SetCompressor ${SETCOMPRESSOR_SWITCH} bzip2\n!else ifdef ZIP2EXE_COMPRESSOR_LZMA\n  SetCompressor ${SETCOMPRESSOR_SWITCH} lzma\n!endif\n\n!ifdef ZIP2EXE_INSTALLDIR\n\n  InstallDir \"${ZIP2EXE_INSTALLDIR}\"\n\n  Function zip2exe.SetOutPath\n    SetOutPath \"$INSTDIR\"\n  FunctionEnd\n\n!else ifdef ZIP2EXE_INSTALLDIR_WINAMP\n\n  InstallDir \"$PROGRAMFILES\\Winamp\"\n  InstallDirRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Winamp\" \"UninstallString\"\n\n  Function .onVerifyInstDir\n    IfFileExists $INSTDIR\\winamp.exe WinampInstalled\n      Abort\n    WinampInstalled:\n  FunctionEnd\n\n  !ifdef ZIP2EXE_INSTALLDIR_WINAMPMODE\n \n    Var ZIP2EXE_TEMP1\n    Var ZIP2EXE_TEMP2\n\n    Function zip2exe.SetOutPath\n       !ifdef ZIP2EXE_INSTALLDIR_SKINS\n         StrCpy $ZIP2EXE_TEMP1 \"$INSTDIR\\Skins\"\n       !else\n         StrCpy $ZIP2EXE_TEMP1 \"$INSTDIR\\Plugins\"\n       !endif\n       ReadINIStr $ZIP2EXE_TEMP2 \"$INSTDIR\\winamp.ini\" \"Winamp\" \"${ZIP2EXE_INSTALLDIR_WINAMPMODE}\"\n         StrCmp $ZIP2EXE_TEMP2 \"\" End\n         IfFileExists $ZIP2EXE_TEMP2 0 End\n         StrCpy $ZIP2EXE_TEMP1 $ZIP2EXE_TEMP2\n       End:\n         SetOutPath $ZIP2EXE_TEMP1\n    FunctionEnd\n\n  !else\n\n    Function zip2exe.SetOutPath\n      !ifdef ZIP2EXE_INSTALLDIR_PLUGINS\n        SetOutPath \"$INSTDIR\\Plugins\"\n      !else\n        SetOutPath \"$INSTDIR\"\n      !endif\n    FunctionEnd\n\n  !endif\n\n!endif\n\n!macro SECTION_BEGIN\n\n  Section \"\"\n  \n    Call zip2exe.SetOutPath\n  \n!macroend\n\n!macro SECTION_END\n\n  SectionEnd\n  \n!macroend"
  },
  {
    "path": "setup/nsis/tools/Contrib/zip2exe/Classic.nsh",
    "content": ";Change this file to customize zip2exe generated installers with a classic interface\n\nPage directory\nPage instfiles"
  },
  {
    "path": "setup/nsis/tools/Contrib/zip2exe/Modern.nsh",
    "content": ";Change this file to customize zip2exe generated installers with a modern interface\n\n!include \"MUI2.nsh\"\n\n!insertmacro MUI_PAGE_DIRECTORY\n!insertmacro MUI_PAGE_INSTFILES\n\n!insertmacro MUI_LANGUAGE \"English\""
  },
  {
    "path": "setup/nsis/tools/Docs/AccessControl/AccessControl.txt",
    "content": "ACCESS CONTROL PLUGIN\n---------------------\n\nWritten by Mathias Hasselmann <mathias@taschenorakel.de>\nModifications by:\n* Afrow UK <afrowuk@afrowsoft.co.uk>\n* AndersK <anders_k@users.sf.net>\n\nThe AccessControl plugin for NSIS provides a set of functions related \nWindows NT access control list (ACL) management.\n\n\nMODIFICATIONS\n-------------\n\nv1.0.8.1 - 7th July 2014 - AndersK\n* Don't require SE_RESTORE_NAME and SE_TAKE_OWNERSHIP_NAME when changing owner.\n* Fixed broken return value when trustee parsing failed\n\nv1.0.8.0 - 24th March 2014 - AndersK\n* Added basic String SID parsing in the emulated ConvertStringSidToSid (Broken in v1.0.6)\n* Fixed WinNT4 and Win95 support? (Unicode DLL will not load on Win95 but will probably load on Win98)\n* Fixed leaks from ParseSid and ConvertSidToStringSid\n* NameToSid and SidToName now pushes \"error\" and error details\n* Better GetCurrentUserName error handling (Still returns the problematic \"error\" string)\n\nv1.0.7.0 - 25th February 2012 - Afrow UK\n* Fixed DisableFileInheritance (broken in v1.0.5.0).\n\nv1.0.6.0 - 26th January 2012 - Afrow UK\n* Wrote replacements for ConvertSidToStringSid/ConvertStringSidToSid for\n  backwards compatibility with Windows NT4/ME (ANSI build only).\n* Loads RegSetKeySecurity/RegGetKeySecurity functions at run-time for\n  backwards compatibility with Windows NT4/ME (ANSI build only).\n* Removed commented out legacy code.\n\nv1.0.5.0 - 25th January 2012 - Afrow UK\n* Removed IsUserTheAdministrator.\n* Added NameToSid.\n* Major code cleanup/rewrite.\n* Proper Unicode build (with Unicode plugin API).\n* Support for 64-bit registry (SetRegView 64).\n* Functions now return \"ok\" on success or \"error\" otherwise. On \"error\",\n  the next item on the stack will be the error description.\n* Added version information resource.\n\n23rd January 2008 - Afrow UK\n* Added function IsUserTheAdministrator.\n* Cleaned up code. Rebuilt as pure cpp, decreasing DLL size.\n* No longer using gobal temp variable for strings.\n\n7th January 2008 - Afrow UK\n* Fixed registry instructions.\n\n8th November 2007 - Afrow UK\n* EnableInheritance/DisableInheritance names changed.\n* Functions added:\n    EnableFileInheritance\n    DisableFileInheritance\n    EnableRegKeyInheritance\n    DisableRegKeyInheritance\n    GetFileOwner\n    GetFileGroup\n    GetRegKeyOwner\n    GetRegKeyGroup\n    ClearOnFile\n    ClearOnRegKey\n    GetCurrentUserName\n    SidToName\n\n21st August 2007 - Afrow UK\n* Added /noinherit switch to prevent child objects inheriting a\n  particular permission.\n* Added EnableInheritance and DisableInheritance functions.\n* Removed code to print items in the install log.\n\n13th July 2007 - kichik\n* Return proper error codes (return value instead of GetLastError())\n\n30th June 2006 - Afrow UK\n* Error MessageBox removed.\n* Error messages are now just returned on NSIS stack.\n\n\nCONVENTIONS\n-----------\n\n<filename>\n  A valid Windows(tm) filename (ie. \"C:\\WINDOWS\\\" or\n  \"\\\\HOSTNAME\\SHARE\").\n\n<rootkey>\n  The well-known root of a registry key. Following values are defined:\n\n    HKCR - HKEY_CLASSES_ROOT\n    HKLM - HKEY_LOCAL_MACHINE\n    HKCU - HKEY_CURRENT_USER\n    HKU  - HKEY_USERS\n\n<regkey>\n  The name of the registry to alter (ie. \"Software\\Microsoft\\Windows\").\n\n<trustee>\n  A valid Windows(tm) account. The account can be specified as relative \n  account name (ie. \"Administrator\" or \"Everyone\"), a qualified account \n    name (ie. \"Domain\\Administrator\") or as security identifier (SID, \n  ie. \"(S-1-5-32-545)\"). \"BUILTIN\\USERS\" is also a valid account name.\n  For a list of trustee names, open up\n    Control Panel > Administrative Tools > Computer Management >\n    Local Users and Groups.\n  WinNT4 uses a emulated version of ConvertStringSidToSid and \n  only supports the following SDDL strings: AN, AU, BA, BU, IU, SY and WD\n\n<permissions>\n  A combination of access rights (ie. \"FullAccess\" or \n  \"GenericRead + GenericWrite\").\n  For a full list of access rights, open the AccessControl.cpp source\n  file in Notepad.\n\n/NOINHERIT\n  Ensures the specified ACEs (Access Control Entries) are not inherited\n  by child nodes (i.e for directory or registry key objects).\n\nHANDLING ERRORS\n---------------\n\nTo handle errors, check the result on the stack:\n\n  AccessControl::SetOnRegKey HKLM Software\\MyApp Stuart FullAccess\n  Pop $R0\n  ${If} $R0 == error\n    Pop $R0\n    DetailPrint `AccessControl error: $R0`\n  ${EndIf}\n\nFUNCTIONS\n---------\n\nGrantOnFile [/NOINHERIT] <filename> <trustee> <permissions>\nGrantOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Makes sure that the trustee get the requested access rights on \n  that object.\n\n---------\n\nSetOnFile [/NOINHERIT] <filename> <trustee> <permissions>\nSetOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Replaces any existing access rights for the trustee on the object\n  with the specified access rights.\n\n---------\n\nClearOnFile [/NOINHERIT] <filename> <trustee> <permissions>\nClearOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Replaces all trustees on the object with the specified trustee and\n  access rights.\n\n---------\n\nDenyOnFile [/NOINHERIT] <filename> <trustee> <permissions>\nDenyOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Explicitly denies an access right on a object.\n\n---------\n\nRevokeOnFile [/NOINHERIT] <filename> <trustee> <permissions>\nRevokeOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Removes a formerly defined access right for that object.\n  Note that access rights will still be revoked even if they are\n  inherited.\n\n---------\n\nSetFileOwner <filename> <trustee>\nSetRegKeyOwner <rootkey> <regkey> <trustee>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Changes the owner of an object.\n\n---------\n\nGetFileOwner <filename>\nGetRegKeyOwner <rootkey> <regkey>\nPop $Owner ; or \"error\" + error details\n\n  Gets the owner of an object.\n\n---------\n\nSetFileGroup <filename> <trustee>\nSetRegKeyGroup <rootkey> <regkey> <trustee>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Changes the primary group of the object.\n\n---------\n\nGetFileGroup <filename>\nGetRegKeyGroup <rootkey> <regkey>\nPop $Group ; or \"error\" + error details\n\n  Gets the primary group of the object.\n\n---------\n\nEnableFileInheritance <filename>\nEnableRegKeyInheritance <rootkey> <regkey>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Enables inheritance of parent object permissions.\n\n---------\n\nDisableFileInheritance <filename>\nDisableRegKeyInheritance <rootkey> <regkey>\nPop $Result ; \"ok\" or \"error\" + error details\n\n  Disables inheritance of parent object permissions.\n\n---------\n\nSidToName <sidstring>\nPop $Domain ; or \"error\" + error details\nPop $Username\n\n  Converts an SID on the local machine to the corresponding username and\n  domain name.\n\n---------\n\nNameToSid <username>\nPop $SID ; or \"error\" + error details\n\n  Gets the SID of the specified username on the local machine.\n\n---------\n\nGetCurrentUserName\nPop $Username ; or \"error\"\n\n  Gets the username of the current user running the setup.\n\n---------"
  },
  {
    "path": "setup/nsis/tools/Docs/AdvSplash/advsplash.txt",
    "content": "AdvSplash.dll - small (5.5k), simple plugin that lets you throw \nup a splash screen in NSIS installers with cool \nfading effects (Win2000+) and transparency.\n\nTo use:\n\nCreate a .BMP file of your splash screen.\nCreate a .WAV file to play while your splash screen shows. (optional)\n\nAdd the following lines to your .NSI file:\n\nFunction .onInit\n  InitPluginsDir\n  File \"/oname=$PluginsDir\\spltmp.bmp\" \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\llama.bmp\"\n\n; optional\n; File /oname=$PluginsDir\\spltmp.wav \"my_splashsound.wav\"\n\n  advsplash::show 1000 600 400 -1 $PluginsDir\\spltmp\n\n  Pop $0 ; $0 has '1' if the user closed the splash screen early,\n         ; '0' if everything closed normally, and '-1' if some error occurred.\n\nFunctionEnd\n\nCalling format\n        advsplash::show Delay FadeIn FadeOut KeyColor FileName\n\nDelay - length to show the screen for (in milliseconds)\nFadeIn - length to show the fadein scene (in ms) (not included in Delay)\nFadeOut - length to show the fadeout scene (in ms) (not included in Delay)\nKeyColor - color used for transparency, could be any RGB value \n        (for ex. R=255 G=100 B=16 -> KeyColor=0xFF6410), \n        use KeyColor=-1 if there is no transparent color in your image.\nFileName - splash bitmap filename (without the .bmp). The BMP file used will be \n        this parameter.bmp, and the wave file used (if present) will be this \n        parameter.wav.\n\n(If you already have an .onInit function, put that in it)\n\nNote 1: fadein/fadeout supported only on win2k/winxp systems, all other systems\nwill show simple splash screen with Delay = Delay + FadeIn + FadeOut. Also, I've\nnoted my winXP uses no transparent color at 16 bpp, so at bpps lower than 32\nfor images with transparent color no fading effect will occur.\n\nNote 2: the return value of splash is 1 if the user closed the splash \nscreen early (pop it from the stack)\n\n-Justin\nConverted to a plugin DLL by Amir Szekely (kichik)\nFading and transparency by Nik Medved (brainsucker)"
  },
  {
    "path": "setup/nsis/tools/Docs/Banner/Readme.txt",
    "content": "BANNER PLUG-IN\n--------------\n\nThe Banner plug-in shows a banner with customizable text. It uses the IDD_VERIFY dialog of the UI.\n\nThere are three functions - show, getWindow and destroy.\n\nUsage\n-----\n\nBanner::show \"Text to show\"\n\n[optional] Banner::getWindow\n\nBanner::destroy\n\nSee Example.nsi for an example.\n\nModern UI\n---------\n\nThe Modern UI has two labels on the IDD_VERIFY dialog. To change all the texts, use:\n\nBanner::show /set 76 \"Text 1 (replaces Please wait while Setup is loading...)\" \"Normal text\"\n\nCustom UI\n---------\n\nIf you have more labels on your IDD_VERIFY dialog, you can use multiple /set parameters to change the texts.\n\nExample:\n\nBanner::show /set 76 \"bah #1\" /set 54 \"bah #2\" \"Normal text\"\n\nThe second parameter for /set is the ID of the control.\n\nSome More Tricks\n----------------\n\nIf you use /set to set the main string (IDC_STR, 1030) you can specify a different string for the window's caption and for the main string.\n\nIf you use an empty string as the main string (Banner::show \"\") the banner window will not show on the taskbar.\n\nCredits\n-------\n\nA joint effort of brainsucker and kichik in honor of the messages dropped during the battle"
  },
  {
    "path": "setup/nsis/tools/Docs/BgImage/BgImage.txt",
    "content": "BgImage.DLL - NSIS extension DLL\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nDisplays an image or a gradient with user defined texts and/or images behind the NSIS window.\nCan also play WAVs.\n\nSee Example.nsi for a usage example.\n\nUsage\n~~~~~\n\n1) Call SetBg to set the background\n2) Call AddText, or AddImage to add texts and images\n3) Call Redraw to update the background window\n4) Optional - repeat steps 2-3 to add more images\n           -or-\n   call Clear and repeat steps 1-3 for a completely new background.\n5) Call Destroy when the background is no longer required (.onGUIEnd for example)\n\nNotes\n~~~~~\n\n* This plugin requires NSIS 2.42 and above.\n\n* Do not call SetBg (which creates the window) from a section or a function called by a section.\n   BgImge must be run from the GUI thread as the installation thread is not built to handle GUI.\n\nAvailable functions\n~~~~~~~~~~~~~~\n\nSetBg [/FILLSCREEN|/TILED] path_to_bitmap\nSetBg /GRADIENT R G B R G B\n   Sets the background and creates the window if necessary\n   Use /FILLSCREEN to make the image fill the screen\n   Use /TILED to set a tiled background\n   Use /GRADIENT to set a gradient background\n\n   If SetReturn on was called returns \"success\" on the stack\n     or an error string if there was an error\n\n   Do not use in .onInit!\n\nAddImage [/TRANSPARENT R G B] path_to_bitmap X Y\n   Adds an image to the background window at (X,Y)\n     X and Y can be negative to specify distance from right/bottom\n   Use /TRANSPARENT to make BgImage draw the image transparently\n     Define the transparent color using R G B\n\n   If SetReturn on was called returns \"success\" on the stack\n     or an error string if there was an error\n\nAddText text font_handle R G B X Y X Y\n  Adds text to the background window\n  Use NSIS's CreateFont to create a font and pass it as font_handle\n  Use R G B to set the text color\n  The first X Y is for the top left corner of the text box\n  The second X Y is for the bottom right corner of the text box\n  X and Y can be negative to specify distance from right/bottoms\n\n  If SetReturn on was called returns \"success\" on the stack\n     or an error string if there was an error\n\nClear\n   Clears all of the current background, images and texts\n\nDestroy\n   Destroys the current background window\n   Destroy calls Clear automatically\n\nSound [/WAIT|/LOOP] path_to_wav\nSound /STOP\n   Plays a wave file\n   Use /WAIT to wait for the sound to finish playing\n   Use /LOOP to loop the sound\n   Use Sound /STOP to stop the loop\n\nSetReturn on|off\n   Enable return values from SetBg, AddImage and AddText\n   Default value is off because all of the possible errors\n     are either things you should handle when debugging your script\n     such as \"can't load bitmap\" or errors you can do nothing about\n     such as \"memory allocation error\"\n\nCredits\n~~~~~~~\n\nCoded by Amir Szekely, aka KiCHiK\n\nXimon Eighteen, aka Sunjammer - Fixed window title bar issues\niceman_k - Text idea and original implementation\nLajos Molnar, aka orfanik - Tile idea and original implementation\nJason Reis - Coding help"
  },
  {
    "path": "setup/nsis/tools/Docs/Dialer/Dialer.txt",
    "content": "DIALER PLUGIN\n-------------\n\nWritten by Amir Szekely aka KiCHiK\nReadme by Joost Verburg\n\nThe Dialer plugin for NSIS provides five functions related to internet connections.\n\nTo download files from the internet, use the NSISdl plugin.\n\nUSAGE\n-----\n\nExample of usage:\n\nClearErrors           ;Clear the error flag\nDialer::FunctionName  ;Call Dialer function\nIfErrors \"\" +3        ;Check for errors\n  MessageBox MB_OK \"Function not available\"\n  Quit\nPop $R0               ;Get the return value from the stack\nMessageBox MB_OK $R0  ;Display the return value\n\nEXAMPLE FUNCTION\n----------------\n\n; ConnectInternet (uses Dialer plugin)\n; Written by Joost Verburg \n;\n; This function attempts to make a connection to the internet if there is no\n; connection available. If you are not sure that a system using the installer\n; has an active internet connection, call this function before downloading\n; files with NSISdl.\n; \n; The function requires Internet Explorer 3, but asks to connect manually if\n; IE3 is not installed.\n\nFunction ConnectInternet\n\n  Push $R0\n    \n    ClearErrors\n    Dialer::AttemptConnect\n    IfErrors noie3\n    \n    Pop $R0\n    StrCmp $R0 \"online\" connected\n      MessageBox MB_OK|MB_ICONSTOP \"Cannot connect to the internet.\"\n      Quit ;Remove to make error not fatal\n    \n    noie3:\n  \n    ; IE3 not installed\n    MessageBox MB_OK|MB_ICONINFORMATION \"Please connect to the internet now.\"\n    \n    connected:\n  \n  Pop $R0\n  \nFunctionEnd\n\nFUNCTIONS\n---------\n\nIf a function is not available on the system, the error flag will be set.\n\n* AttemptConnect\n\n  Attempts to make a connection to the Internet if the system is not connected.\n  \n  online - already connected / connection successful\n  offline - connection failed\n  \n  Requires Internet Explorer 3 or later\n\n* AutodialOnline\n\n  Causes the modem to automatically dial the default Internet connection if the system\n  is not connected to the internet. If the system is not set up to automatically\n  connect, it will prompt the user.\n  \n  Return values:\n  \n  online - already connected / connection successful\n  offline - connection failed\n  \n  Requires Internet Explorer 4 or later\n\n* AutodialUnattended\n\n  Causes the modem to automatically dial the default Internet connection if the system\n  is not connected to the internet. The user will not be prompted.\n  \n  Return values:\n  \n  online - already connected / connection successful\n  offline - connection failed\n  \n  Requires Internet Explorer 4 or later\n\n* AutodialHangup\n\n  Disconnects an automatic dial-up connection.\n  \n  Return values:\n\n  success - disconnection successful\n  failure - disconnection failed\n  \n  Requires Internet Explorer 4 or later\n\n* GetConnectedState\n\n  Checks whether the system is connected to the internet.\n  \n  Return values:\n\n  online - system is online\n  offline - system is offline\n  \n  Requires Internet Explorer 4 or later"
  },
  {
    "path": "setup/nsis/tools/Docs/ExecDos/Readme.txt",
    "content": "Description\n\nPlug-in works with console applications - creates hidden child process with redirected i/o. Compare to NSISdl has 4 add-ons: 1) string parameter that serves as stdin for running application; 2) sync/async process launch option; 3) works out of section as well; 4) multithreading.  First may be useful if you want to give login/password to the running application, second - for long running applications, third - for .onInit function check outs, fourth - to run few DOS application at a time. Plug-in can put application output to log file, 'detailed' installer window, any other text window, to installer stack or call script function to handle every line. Maximim input string size is 8kB in the special NSIS build, 1 kB otherwise.\n\n\nHow To Use\n\n  ExecDos::exec [/ASYNC] [/TIMEOUT=xxx] [/TOSTACK | /DETAILED | /TOWINDOW | /TOFUNC] [/ENDFUNC=func] [/DISABLEFSR] application_to_run [stdin_string] [log_file_name | window | function]\n\n  /ASYNC - not waits for process exit. Use 'wait' to get exit code\n  /TIMEOUT - TOTAL execution time, milliseconds, for example /TIMEOUT=10000. \n            Default is big enough. Short timeouts may cause app to be terminated. \n  /TOSTACK - puts not empty output lines to stack (not reads log_file_name parameter from stack)\n  /DETAILED - puts output lines to installer' detailed window\n  /TOWINDOW - adds output lines to target window. Edit, RichEdit, ListView and ListBox supported\n  /TOFUNC - pushes output lines to installer stack and calls script function\n  /DISABLEFSR - disables WOW64 file system redirection on x64 machines for the ExecDos internal thread\n  application_to_run - application to run (required)\n  stdin_string - all that application can get from stdin (optional)\n  log_file_name - file where to put app's stdout (optional) OR target window handle OR script function pointer\nPlease note - last 2 parameters are optional if installer stack is empty. More safe to use \"\" for unused parameters in case the stack is not empty. If you find a random file appearing during install then this is why (i.e. log_file_name)!\n\n  ExecDos::wait HANDLE\n  HANDLE - for async mode only, thread handle to wait for. Returnes application exit code or error code.\n\n  ExecDos::isdone HANDLE\n  HANDLE - for async mode only, checks thread is running. Returns 1 if application have exited, 0 if still running, -1 on error.\n\n\nExample of async launch\n\n  ExecDos::exec /ASYNC \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" \"$EXEDIR\\execdos.log\"\n  Pop $0 ; thread handle for 'wait'.\n  ExecDos::wait $0\n  Pop $0 ; exit code\n  MessageBox MB_OK \"Exit code $0\"\n\nsync launch\n\n  ExecDos::exec \"$EXEDIR\\consApp.exe\" \"\" \"\"\n  Pop $0 ; exit code\n  MessageBox MB_OK \"Exit code $0\"\n\n\nBAT files specifics\n\nOn some of Win98 systems \"Close on exit\" option is not set for DOS apps. As a result after batch execution was finished (and installer continue it's job) hidden window still remains in the system as \"winoldapp\". Following two lines solve the problem \n\n@echo off\n# place your bat code here\ncls\n\nTelnet and ssh - Plug-in not works with applications requiring terminal emulation.\n\n\nTakhir Bedertdinov, INEUM, Moscow, Russia\nStuart 'Afrow UK' Welch, UK, afrowuk@afrowsoft.co.uk\n\n"
  },
  {
    "path": "setup/nsis/tools/Docs/InstallOptions/Changelog.txt",
    "content": "DLL version 2.47 (4/27/2007)\n* Line breaks support in Link control\n* Added HLine and VLine controls\n\nDLL version 2.46 (3/31/2007)\n* Use installer's name for message boxes\n\nDLL version 2.45 (1/23/2007)\n* Added FOCUS flag for setting focus to a control other than the first\n\nDLL version 2.44 (10/11/2005)\n* Added HWND and HWND2 entries to the INI file to avoid messy calculations of the correct control id\n\nDLL version 2.43 (10/4/2005)\n* Fixed alteration of the working directory by FileRequest\n* Added WS_EX_LEFTSCROLLBAR in RTL mode\n\nDLL version 2.42 (1/21/2005)\n* Added TRANSPARENT flag for BITMAP fields (funded by Chris Morgan)\n\nDLL version 2.41 (8/5/2004)\n* Bitmaps are now automatically centered\n* Fixed a bug which prevented enabling the next button from the leave function of InstallOptions pages\n* Fixed a rare freeze\n\nDLL version 2.4 (1/4/2004)\n* Initial focus is set in \"initDialog\" making it possible to override it from NSIS prior to calling \"show\"\n* When initial focus is to a Text field InstallOptions now follows standard Windows behaviour by having the text selected\n* Label and other static fields no longer have State= written to the INI file when leaving the dialog\n* NOTIFY flag can now be used with Link fields (State should be omitted in this case)\n* Likewise, State can now be used with Button fields (behaves the same as with Link fields)\n* NOTIFY flag can also now be used with ListBox and DropList fields to have NSIS notified when the selection changes\n* Meaning of RIGHT flag is now reversed in right-to-left language mode\n* HSCROLL and VSCROLL flags are no longer restricted to Text fields\n* Various Link field fixes\n\nDLL version 2.3 (12/4/2003)\n* Added new control type \"Button\"\n* Added new flag \"NOTIFY\"\n* Added new flag \"NOWORDWRAP\" for multi-line text boxes\n* Reduced size down to 12K\n* Better RTL support\n\nDLL version 2.2 (6/10/2003)\n* Added New control type LINK\n* \\r\\n converts to newline in Multiline edit box\n* Support for multiline edit box\n* Better tab order in DirRequest and FileRequest\n* Added READONLY option to text box\n* Minor fixes\n\nDLL version 2.1 (3/15/2003)\n* \\r\\n converts to newline in both label Text and ValidateText\n* New browse dialog style (modern)\n* Word wrapping for check boxes and radio buttons\n* No ugly border for edit fields under XP\n* Scroll bar for list boxes\n* Works with SetStaticBkColor\n* DISABLED dir and file request fields now disable the browse button too\n* No more STATE value for labels\n* Minor fixes\n\nDLL version 2.0 (1/4/2003)\n* Supports custom font and DPI settings (by Joost Verburg)\n* INI files should contain dialog units now, no pixels (by Joost Verburg)\n* RESIZETOFIT flag for Bitmap control (by Amir Szekely)\n* New documentation (by Joost Verburg)\n* New GROUP/NOTABSTOP/DISABLED flags\n\nDLL version 1.7 beta (11/2/2002)\n* Added initDialog and show DLL functions\n\nDLL version 1.6 beta (9/30/2002)\n* CancelConfirmIcon becomes CancelConfirmFlags and can now take the other common MessageBox flags\n\nDLL version 1.5 beta (9/26/2002)\n* Made close [x] button behave like Cancel (thanks brainsucker)\n\nDLL version 1.4 beta (9/4/2002)\n* Added Icon and Bitmap controls (by Amir Szekely)\n\nDLL version 1.3 beta (8/15/2002)\n* Added CancelShow (by ORTIM)\n* Added pixel transformation for widgets (by ORTIM)\n\nDLL version 1.2 beta (7/31/2002)\n* Added CancelEnabled (by ORTIM)\n* Added CancelConfirmCaption and CancelConfirmIcon (by Amir Szekely)\n\nDLL version 1.1 beta (7/22/2002)\n* Font is now taken from the main NSIS window (by Amir Szekely)\n\nDLL version 1.0 beta (12/16/2001)\n* Moved to DLL, no longer need parentwnd ini writing\n* Tons of changes - no longer fully compatible (see source for a big list)\n* removed support for silent installers (it seems the old version would bring up it's own dialog)\n\nversion 1.4 (11/18/2001)\n* Added Listbox controls.\n* Added MULTISELECT flag.\n* Made the HWND list for the parent window controls dynamically allocated. This prevents a crash if NSIS ever gets more than 150 controls on it's main window.\n* The TEXT property of DirRequest control can be used to specify an initial directory. The current directory is automatically selected when clicking the browse button of the DirRequest control.\n* Added ROOT property to DirRequest which can be used to set the root directory (mostly due to felfert)\n* Edit controls will now auto scroll (thanks felfert)\n* Fixed a problem where the window wouldn't draw properly on some systems (thanks felfert)\n\nversion 1.3 (11/03/2001)\n* Got rid of the call to RedrawWindow() because it's no longer needed with the WS_CLIPCHILDREN flag for NSIS.\n* Removed a few hardcoded limits of buffer sizes\n* Added Checkbox and RadioButton controls\n* Added RIGHT and CHECKED flags\n\nversion 1.2.2 (10/30/2001)\n* Additional size reductions. Further reduced the size down to 8k.\n* The text parameter to a combobox can now be used to specify the initial value\n* Changed from InvalidateRect() to RedrawWindow() to force a redraw after a browse dialog\n* On startup, set the flags of the NSIS window to include WS_CLIPCHILDREN. Otherwise, our controls don't get drawn right.\n\nversion 1.2.1 (10/28/2001)\n* Bug fix. ControlID for the caption and the OK button were reused by the first two controls. (Thanks Schultz)\n\nversion 1.2j (10/28/2001)\n* 8.5kb from 44kb. heh. (by Justin Frankel)\n\nversion 1.2 (10/28/2001)\n* Still 44k\n* Added the \"FileRequest\" and \"DirRequest\" control types (thanks Schultz)\n* Added \"MinLen\", \"MaxLen\", and \"ValidateText\" properties to fields\n* Added \"Flags\" as a way to specify additional parameters for controls\n* Few more changes to the documentation\n* Cleaned the code in a few places...still trying to make it smaller\n\nversion 1.1 (10/27/2001)\n* Added the \"Title\" option (thanks Alex)\n* Moved the OK button so it is in the same location as the buttons on the main NSIS window (thanks Alex)\n* Pressing \"ENTER\" will now automatically select the OK button (thanks Alex)\n* Slightly improved the documentation\n\nversion 1.01 (10/25/2001)\n* Fixed the SetFocus loop so it exits after the first control like it was supposed to\n* Added the license to the documentation\n\nversion 1.0 (10/25/2001)\n* Barely qualifies as a distribution\n"
  },
  {
    "path": "setup/nsis/tools/Docs/InstallOptions/Readme.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n    <title>InstallOptions 2</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <style type=\"text/css\">\n        /*<![CDATA[*/\n        html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff; }\n        html { font-size: 0.80em; }\n        body { font-size: 1em; font-size: 1rem; }\n        pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }\n        body\n        {\n            padding:1.5em 0; margin:0;\n            background-color: #F0F0F0;\n            font-family: Verdana, Arial, Helvetica, sans-serif;\n            font-weight: normal;\n            text-align: left;\n        }\n        p, li\n        {\n            font-size: 100%;\n        }\n        .center\n        {\n            text-align: center;\n        }\n        table\n        {\n            margin: auto;\n            font-size: 100%;\n            background-color: #FFFFFF;\n        }\n        .maintable\n        {\n            border: 2px solid #376EAB;\n            width: 90%;\n        }\n        .parameter\n        {\n            font-weight: bold;\n            color: #6586AC;\n        }\n        h1\n        {\n            font-size: 140%;\n            color: #333333;\n            font-weight: normal;\n            text-align: center;\n            margin-top: 1.5em;\n        }\n        h2\n        {\n            font-size: 130%;\n            color: #7A7272;\n            font-weight: normal;\n        }\n        h3\n        {\n            font-size: 120%;\n            font-weight: bold;\n            color: #303030;\n        }\n        div\n        {\n            margin: 1.1em;\n        }\n        a:link, a:visited, a:active\n        {\n            color: #294F75;\n            text-decoration: none;\n        }\n        a:hover\n        {\n            color: #182634;\n            text-decoration: underline;\n        }\n        .subtable\n        {\n            border: 0px;\n            margin-left: 1.3em;\n            margin-right: 1.3em;\n        }\n        .lefttable\n        {\n            background-color: #CCCCCC;\n            vertical-align: top;\n        }\n        .righttable\n        {\n            background-color: #EEEEEE;\n            vertical-align: top;\n        }\n        /*]]>*/</style>\n</head>\n<body>\n    <table width=\"750\" class=\"maintable\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n        <tr>\n            <td>\n                <h1>\n                    InstallOptions 2</h1>\n                <div>\n                    <p>\n                        The InstallOptions plug-in is deprecated. For new scripts, it is recommended to\n                        use the new nsDialogs plug-in instead.</p>\n                </div>\n                <div>\n                    <h2 id=\"intro\">\n                        Introduction</h2>\n                    <div>\n                        <p>\n                            InstallOptions is an NSIS plugin which allows you to create custom pages for NSIS\n                            installers, to prompt the user for extra information.</p>\n                        <p>\n                            The dialogs created by InstallOptions are based on INI files which define the controls\n                            on the dialog and their properties. These INI files can be modified from the script\n                            to adjust the dialogs at runtime.</p>\n                        <p>\n                            The format of INI files is described in a <a href=\"http://en.wikipedia.org/wiki/Ini_file\">\n                                Wikipedia article</a>.</p>\n                    </div>\n                    <h2 id=\"ini\">\n                        INI file structure</h2>\n                    <div>\n                        <p>\n                            The INI file has one required section. This section includes the number of controls\n                            to be created as well as general window attributes. The INI file also includes a\n                            variable number of Field sections which are used to create the controls to be displayed.</p>\n                        <p>\n                            The required section is named &quot;<em>Settings</em>&quot;. It can contain the\n                            following values:</p>\n                        <table class=\"subtable\">\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>NumFields</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(required)</em></td>\n                                <td class=\"righttable\">\n                                    The number of control elements to be displayed on the dialog window.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Title</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    If specified, gives the text to set the titlebar to. Otherwise, the titlebar text\n                                    is not changed.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>CancelEnabled</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    If specified, overrides NSIS settings and enables or disables the cancel button.\n                                    If set to 1, the cancel button will be enabled. If set to 0, the cancel button will\n                                    be disabled.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>CancelShow</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    If specified, overrides NSIS settings and shows or hides the cancel button If set\n                                    to 1, the cancel button will be shown. If set to 0, the cancel button will be hidden.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>BackEnabled</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    If specified, overrides NSIS settings and enables or disables the back button. If\n                                    set to 1, the back button will be enabled. If set to 0, the back button will be\n                                    disabled.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>CancelButtonText</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Overrides the text for the cancel button. If not specified, the cancel button text\n                                    will not be changed.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>NextButtonText</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Overrides the text for the next button. If not specified, the next button text will\n                                    not be changed.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>BackButtonText</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Overrides the text for the back button. If not specified, the back button text will\n                                    not be changed.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Rect</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Overrides the default rect ID to run over. This will make IO resize itself according\n                                    to a different rect than NSIS's dialogs rect.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>RTL</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    If 1 is specified the dialog will be mirrored and all texts will be aligned to the\n                                    right. The INSTALLOPTIONS_EXTRACT macros automatically set this field to the right\n                                    value for the current installer language as given by the NSIS string $(^RTL).</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>State</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(output)</em></td>\n                                <td class=\"righttable\">\n                                    This is not something you have to supply yourself but is set by InstallOptions,\n                                    before calling your custom page validation function, to the field number of the\n                                    custom Button control (or other control having the Notify flag) the user pressed,\n                                    if any.</td>\n                            </tr>\n                        </table>\n                        <p>\n                            Each field section has the heading &quot;Field #&quot; where # must be sequential\n                            numbers from 1 to NumFields. Each Field section can contain the following values:</p>\n                        <table class=\"subtable\">\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Type</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(required)</em></td>\n                                <td class=\"righttable\">\n                                    Type of control to be created. Valid values are &quot;<em>Label</em>&quot;, &quot;<em>Text</em>&quot;,\n                                    &quot;<em>Password</em>&quot;, &quot;<em>Combobox</em>&quot;, &quot;<em>DropList</em>&quot;,\n                                    &quot;<em>Listbox</em>&quot;, &quot;<em>CheckBox</em>&quot;, &quot;<em>RadioButton</em>&quot;,\n                                    &quot;<em>FileRequest</em>&quot;, &quot;<em>DirRequest</em>&quot; &quot;<em>Icon</em>&quot;,\n                                    &quot;<em>Bitmap</em>&quot;, &quot;<em>GroupBox</em>&quot;, &quot;<em>HLine</em>&quot;,\n                                    &quot;<em>VLine</em>&quot;, &quot;<em>Link</em>&quot; or &quot;<em>Button</em>&quot;.<br />\n                                    <br />\n                                    A &quot;<em>Label</em>&quot; is used to display static text. (i.e. a caption for\n                                    a textbox)<br />\n                                    A &quot;<em>Text</em>&quot; and &quot;<em>Password</em>&quot; accept text input\n                                    from the user. &quot;<em>Password</em>&quot; masks the input with * characters.<br />\n                                    A &quot;<em>Combobox</em>&quot; allows the user to type text not in the popup list,\n                                    a &quot;<em>Droplist</em>&quot; only allows selection of items in the list.<br />\n                                    A &quot;<em>Listbox</em>&quot; shows multiple items and can optionally allow the\n                                    user to select more than one item.<br />\n                                    A &quot;<em>CheckBox</em>&quot; control displays a check box with label.<br />\n                                    A &quot;<em>RadioButton</em>&quot; control displays a radio button with label.<br />\n                                    A &quot;<em>FileRequest</em>&quot; control displays a textbox and a browse button.\n                                    Clicking the browse button will display a file requester where the user can browse\n                                    for a file.<br />\n                                    A &quot;<em>DirRequest</em>&quot; control displays a textbox and a browse button.\n                                    Clicking the browse button will display a directory requester where the user can\n                                    browse for a directory.<br />\n                                    An &quot;<em>Icon</em>&quot; control displays an icon. Use no Text to use the installer\n                                    icon.<br />\n                                    A &quot;<em>Bitmap</em>&quot; control displays a bitmap.<br />\n                                    A &quot;<em>GroupBox</em>&quot; control displays a frame to group controls.<br />\n                                    A &quot;<em>HLine</em>&quot; control displays a horizontal line to separate controls.<br />\n                                    A &quot;<em>VLine</em>&quot; control displays a vertical line to separate controls.<br />\n                                    A &quot;<em>Link</em>&quot; control displays a static hot text. When the user clicks\n                                    the control the contents of <strong>State</strong> (e.g. http://...) will be executed\n                                    using ShellExecute. Alternatively <strong>State</strong> can be omitted and the\n                                    <em>NOTIFY</em> flag used to have your NSIS script called. See the &quot;<em>NOTIFY</em>&quot;\n                                    flag below for more information.<br />\n                                    A &quot;<em>Button</em>&quot; control displays a push button that can be used in\n                                    the same way as the &quot;<em>Link</em>&quot; control above.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Text</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Specifies the caption of a label, checkbox, or radio button control. For DirRequest\n                                    control this specifies the title of the browse dialog. For icon and bitmaps control\n                                    this specifies the path to the image.<br />\n                                    <br />\n                                    <strong>Note:</strong> For labels, \\r\\n will be converted to a newline. To use a\n                                    back-slash in your text you have to escape it using another back-slash - \\\\. Described\n                                    <a href=\"#escaping\">below</a> are NSIS functions for converting text to/from this\n                                    format.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>State</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Specifies the state of the control. This is updated when the user closes the window,\n                                    so you can read from it from NSIS. For edit texts and dir and file request boxes,\n                                    this is the string that is specified. For radio button and check boxes, this can\n                                    be '0' or '1' (for unchecked or checked). For list boxes, combo boxes and drop lists\n                                    this is the selected items separated by pipes ('|'). For Links and Buttons this\n                                    can specify something to be executed or opened (using ShellExecute).<br />\n                                    <br />\n                                    <strong>Note:</strong> For Text fields with the MULTILINE flag, \\r\\n will be converted\n                                    to a newline. To use a back-slash in your text you have to escape it using another\n                                    back-slash - \\\\. Described <a href=\"#escaping\">below</a> are NSIS functions for\n                                    converting text to/from this format.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>ListItems</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    A list of items to display in a combobox, droplist, or listbox.<br />\n                                    This is a single line of text with each item separated by a pipe character '|'</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>MaxLen</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Causes validation on the selected control to limit the maximum length of text.<br />\n                                    If the user specifies more text than this, a message box will appear when they click\n                                    &quot;OK&quot; and the dialog will not be dismissed.<br />\n                                    You should not use this on a &quot;<em>combobox</em>&quot; since the user can not\n                                    control what is selected.<br />\n                                    This should be set to a maximum of 260 for &quot;<em>FileRequest</em>&quot; and\n                                    &quot;<em>DirRequest</em>&quot; controls.<br />\n                                    Ignored on &quot;<em>Label</em>&quot; controls.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>MinLen</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Causes validation on the selected control to force the user to enter a minimum amount\n                                    of text.<br />\n                                    If the user specifies less text than this, a message box will appear when they click\n                                    &quot;OK&quot; and the dialog will not be dismissed.<br />\n                                    Unlike MaxLen, this is useful for &quot;<em>Combobox</em>&quot; controls. By setting\n                                    this to a value of &quot;1&quot; the program will force the user to select an item.<br />\n                                    Ignored on &quot;<em>Label</em>&quot; controls.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>ValidateText</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    If the field fails the test for &quot;<em>MinLen</em>&quot; or &quot;<em>MaxLen</em>&quot;,\n                                    a messagebox will be displayed with this text.<br />\n                                    <br />\n                                    <strong>Note:</strong> \\r\\n will be converted to a newline, two back-slashes will\n                                    be converted to one - \\\\. Described <a href=\"#escaping\">below</a> are NSIS functions\n                                    for converting text to/from this format.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Left<br />\n                                        Right<br />\n                                        Top<br />\n                                        Bottom</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(required)</em></td>\n                                <td class=\"righttable\">\n                                    The position on the dialog where this control appears. All sizes should be set in\n                                    dialog units. To get the right dimensions for your controls, design your dialog\n                                    using a resource editor and copy the dimensions to the INI file.<br />\n                                    <br />\n                                    <strong>Note:</strong> You can specify negative coordinates to specify the distance\n                                    from the right or bottom edge.<br />\n                                    <br />\n                                    <strong>Note (2):</strong> For combobox or droplist, the &quot;<em>bottom</em>&quot;\n                                    value is not used in the same way.<br />\n                                    In this case, the bottom value is the maximum size of the window when the pop-up\n                                    list is being displayed. All other times, the combobox is automatically sized to\n                                    be one element tall. If you have trouble where you can not see the combobox drop-down,\n                                    then check the bottom value and ensure it is large enough. A rough guide for the\n                                    height required is the number of items in the list multiplied by 8, plus 20.<br />\n                                    <br />\n                                    <strong>Note (3):</strong> FileRequest and DirRequest controls will allocate 15\n                                    dialog units to the browse button. Make this control wide enough the contents of\n                                    the textbox can be seen.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Filter</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Specifies the filter to be used in the &quot;<em>FileRequest</em>&quot; control.<br />\n                                    This is constructed by putting pairs of entries together, each item separated by\n                                    a | character.<br />\n                                    The first value in each pair is the text to display for the filter.<br />\n                                    The second value is the pattern to use to match files.<br />\n                                    For example, you might specify:<br />\n                                    Filter=Text Files|*.txt|Programs|*.exe;*.com|All Files|*.*<br />\n                                    If not specified, then the filter defaults to All Files|*.*<br />\n                                    <br />\n                                    <strong>Note:</strong> you should not put any extra spaces around the | characters.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Root</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    Used by <strong>DirRequest</strong> controls to specify the root directory of the\n                                    search. By default, this allows the user to browse any directory on the computer.\n                                    This will limit the search to a particular directory on the system.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"lefttable\">\n                                    <strong>Flags</strong></td>\n                                <td class=\"lefttable\">\n                                    <em>(optional)</em></td>\n                                <td class=\"righttable\">\n                                    This specifies additional flags for the display of different controls. Each value\n                                    should be separated by a | character, and you should be careful not to put any spaces\n                                    around the | character.<br />\n                                    <table class=\"righttable\">\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                <strong>Value</strong></td>\n                                            <td class=\"righttable\">\n                                                <strong>Meaning</strong></td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                REQ_SAVE</td>\n                                            <td class=\"righttable\">\n                                                This causes &quot;<em>FileRequest</em>&quot; controls to display a Save As dialog.\n                                                If not specified, an Open dialog is used.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                FILE_MUST_EXIST</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>FileRequest</em>&quot; to determine if the selected file must\n                                                exist.<br />\n                                                This only applies if an &quot;Open&quot; dialog is being displayed.<br />\n                                                This currently does not force the file to exist other than through the browse button.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                FILE_EXPLORER</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>FileRequest</em>&quot;, enables new file request look (recommended)</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                FILE_HIDEREADONLY</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>FileRequest</em>&quot;, hides &quot;open read only&quot; checkbox\n                                                in open dialog.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                WARN_IF_EXIST</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>FileRequest</em>&quot; to display a warning message if the selected\n                                                file already exists.<br />\n                                                The warning message is only displayed for files selected with the browse button.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                PATH_MUST_EXIST</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>FileRequest</em>&quot; to force the path to exist. Prevents the\n                                                user from typing a non-existent path into the browse dialog window.<br />\n                                                This only validates path's selected with the browse button.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                PROMPT_CREATE</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>FileRequest</em>&quot; to display a warning if the selected file\n                                                does not exist. However, it still allows the user to select the file.<br />\n                                                This only displays the warning for files selected with the browse button.<br />\n                                                Doesn't work along with REQ_SAVE.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                RIGHT</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>Checkbox</em>&quot; and &quot;<em>Radiobutton</em>&quot; controls\n                                                to specify you want the checkbox to the right of the text instead of the left as\n                                                is the default.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                MULTISELECT</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>Listbox</em>&quot; controls. Turns string selection on or off\n                                                each time the user clicks or double-clicks a string in the list box. The user can\n                                                select any number of strings. If this flag and EXTENDEDSELCT are not specified,\n                                                only one item can be selected from the list.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                EXTENDEDSELCT</td>\n                                            <td class=\"righttable\">\n                                                Used by &quot;<em>Listbox</em>&quot; controls. Allows multiple items to be selected\n                                                by using the SHIFT key and the mouse or special key combinations. If this flag and\n                                                MULTISELECT are not specified, only one item can be selected from the list.</td>\n                                        </tr>\n                                        <tr>\n                                            <td class=\"righttable\">\n                                                RESIZETOFIT</td>\n                                            <td class=\"righttable\">\n                                                This causes &quot;<em>Bitmap</em>&quot; controls to resize the image to the size\n                                                of the control. Also useful to support custom DPI settings. Without this, the image\n                                                will be centered within the specified area.</td>\n                                        </tr>\n                                        <td class=\"righttable\">\n                                            TRANSPARENT</td>\n                                        <td class=\"righttable\">\n                                            Used by &quot;<em>Bitmap</em>&quot; controls. Hides every pixel with the same color\n                                            as of the top left pixel. This allows to see-through to controls behind it. This\n                                            flag doesn't work well with a combination of the RESIZETOFIT flag and bitmaps with\n                                            more than 256 colors.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    GROUP</td>\n                                <td class=\"righttable\">\n                                    Add this flag to the first control of a group of controls to group them. Grouping\n                                    controls allows you to create multiple groups of radio button and makes keyboard\n                                    navigation using arrow keys easier.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    FOCUS</td>\n                                <td class=\"righttable\">\n                                    Sets focus on the specified control, instead of the first focusable control. If\n                                    more than one field is specified with this flag, only the first one will receive\n                                    focus.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    NOTABSTOP</td>\n                                <td class=\"righttable\">\n                                    Do not stop on the control when the user pressed the Tab key. Add NOTABSTOP to all\n                                    controls of a group except the first one to allow navigation between groups with\n                                    the Tab key.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    DISABLED</td>\n                                <td class=\"righttable\">\n                                    Causes a control to be disabled.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    ONLY_NUMBERS</td>\n                                <td class=\"righttable\">\n                                    Used by &quot;<em>Text</em>&quot; controls. Forces the user to enter only numbers\n                                    into the edit box.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    MULTILINE</td>\n                                <td class=\"righttable\">\n                                    Used by &quot;<em>Text</em>&quot; controls. Causes the control to accept multiple-lines.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    WANTRETURN</td>\n                                <td class=\"righttable\">\n                                    Used by &quot;<em>Text</em>&quot; controls with multiple-line. Specifies that a\n                                    carriage return be inserted when the user presses the ENTER key while entering text\n                                    into the text box.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    NOWORDWRAP</td>\n                                <td class=\"righttable\">\n                                    Used by &quot;<em>Text</em>&quot; controls with multiple-line. Disables the word-wrap\n                                    that occurs when long lines are entered. Long lines instead scroll off to the side.\n                                    Specifying the HSCROLL flag also has this effect.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    HSCROLL</td>\n                                <td class=\"righttable\">\n                                    Show a horizontal scrollbar. When used by &quot;<em>Text</em>&quot; controls with\n                                    multiple-lines this also disables word-wrap.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    VSCROLL</td>\n                                <td class=\"righttable\">\n                                    Show a vertical scrollbar.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    READONLY</td>\n                                <td class=\"righttable\">\n                                    Used by &quot;<em>Text</em>&quot; controls. Prevents the user from entering or editing\n                                    text in the edit control, but allow the user to select and copy the text.</td>\n                            </tr>\n                            <tr>\n                                <td class=\"righttable\">\n                                    NOTIFY</td>\n                                <td class=\"righttable\">\n                                    Used by &quot;<em>Button</em>&quot;, &quot;<em>Link</em>&quot;, &quot;<em>CheckBox</em>&quot;,\n                                    &quot;<em>RadioButton</em>&quot;, &quot;<em>ListBox</em>&quot; and &quot;<em>DropList</em>&quot;\n                                    controls. Causes InstallOptions to call your NSIS custom page validation/leave function\n                                    whenever the control's selection changes. Your validation/leave function can read\n                                    the &quot;<em>State</em>&quot; value from the &quot;<em>Settings</em>&quot; section\n                                    to determine which control caused the notification, if any, and perform some appropriate\n                                    action followed by an Abort instruction (to tell NSIS to return to the page). The\n                                    Examples\\InstallOptions folder contains an example script showing how this might\n                                    be used.</td>\n                            </tr>\n                        </table>\n            </td>\n        </tr>\n        <tr>\n            <td class=\"lefttable\">\n                <strong>TxtColor</strong></td>\n            <td class=\"lefttable\">\n                <em>(optional)</em></td>\n            <td class=\"righttable\">\n                Used by <strong>Link</strong> controls to specify the foreground color of the text.\n                Format: 0xBBGGRR (hexadecimal).</td>\n        </tr>\n        <tr>\n            <td class=\"lefttable\">\n                <strong>HWND<br>\n                    HWND2</strong></td>\n            <td class=\"lefttable\">\n                <em>(output)</em></td>\n            <td class=\"righttable\">\n                After initDialog returns, this will contain the HWND of the control created by this\n                field. It can be used instead of FindWindow and GetDlgItem. HWND2 contains the HWND\n                of an additional control, such as the browse button.</td>\n        </tr>\n    </table>\n    </div>\n    <h2 id=\"nsh\">\n        Header file</h2>\n    <div>\n        <p>\n            The InstallOptions header files provides macros and functions to easily create custom\n            dialogs. You can include it on the top of your script as follows:\n            <pre>\n!include InstallOptions.nsh\n</pre>\n    </div>\n    <h2 id=\"dialog\">\n        Creating dialogs</h2>\n    <div>\n        <h3 id=\"extract\">\n            Extracting the INI file</h3>\n        <div>\n            <p>\n                First, you have to extract your InstallOptions INI files in the .onInit function\n                (or un.onInit for the uninstaller) using the INSTALLOPTIONS_EXTRACT macro. The files\n                will be extracted to a temporary folder (the NSIS plug-ins folder) that is automatically\n                created.</p>\n            <pre>\nFunction .onInit\n  !insertmacro INSTALLOPTIONS_EXTRACT &quot;ioFile.ini&quot;\nFunctionEnd\n</pre>\n            <p>\n                If the INI file is located in another directory, use INSTALLOPTIONS_EXTRACT_AS.\n                The second parameter is the filename in the temporary folder, which is the filename\n                that should be used as input for the other macros.</p>\n            <pre>\nFunction .onInit\n  !insertmacro INSTALLOPTIONS_EXTRACT_AS &quot;..\\ioFile.ini&quot; &quot;ioFile.ini&quot;\nFunctionEnd\n</pre>\n        </div>\n        <h3 id=\"display\">\n            Displaying the dialog</h3>\n        <div>\n            <p>\n                You can call InstallOptions in a page function defined with the Page or UninstPage\n                command. Check the NSIS documentation (Scripting Reference -&gt; Pages) for information\n                about the page system.</p>\n            <pre>\nPage custom CustomPageFunction</pre>\n            <p>\n                To display the dialog, use the INSTALLOPTIONS_DISPLAY macro:<pre>\nFunction CustomPageFunction ;Function name defined with Page command\n  !insertmacro INSTALLOPTIONS_DISPLAY &quot;ioFile.ini&quot;\nFunctionEnd\n</pre>\n        </div>\n    </div>\n    <h2 id=\"input\">\n        User input</h2>\n    <div>\n        <p>\n            To get the input of the user, read the State value of a Field using the INSTALLOPTIONS_READ\n            macro:</p>\n        <pre>\n!insertmacro INSTALLOPTIONS_READ $VAR &quot;ioFile.ini&quot; &quot;Field #&quot; &quot;Name&quot;\n</pre>\n    </div>\n    <h2 id=\"writing\">\n        Writing to INI files</h2>\n    <div>\n        <p>\n            The INSTALLOPTIONS_WRITE macro allows you to write values to the INI file to change\n            texts or control settings at runtime:\n            <pre>\n!insertmacro INSTALLOPTIONS_WRITE &quot;ioFile.ini&quot; &quot;Field #&quot; &quot;Name&quot; &quot;Value&quot;\n</pre>\n    </div>\n    <h2 id=\"escape\">\n        Escaped values</h2>\n    <div>\n        <p>\n            Some InstallOptions values are escaped (in a similar manner to &quot;C&quot; strings)\n            to allow characters to be used that are not normally valid in INI file values. The\n            affected values are:</p>\n        <ul>\n            <li>The ValidateText field</li>\n            <li>The Text value of Label fields</li>\n            <li>The State value of Text fields that have the MULTILINE flag</li>\n        </ul>\n        <p>\n            The escape character is the back-slash character (&quot;\\&quot;) and the available\n            escape sequences are:</p>\n        <table class=\"subtable\">\n            <tr>\n                <td class=\"lefttable\">\n                    &quot;\\\\&quot;</td>\n                <td class=\"righttable\">\n                    Back-slash</td>\n            </tr>\n            <tr>\n                <td class=\"lefttable\">\n                    &quot;\\r&quot;</td>\n                <td class=\"righttable\">\n                    Carriage return (ASCII 13)</td>\n            </tr>\n            <tr>\n                <td class=\"lefttable\">\n                    &quot;\\n&quot;</td>\n                <td class=\"righttable\">\n                    Line feed (ASCII 10)</td>\n            </tr>\n            <tr>\n                <td class=\"lefttable\">\n                    &quot;\\t&quot;</td>\n                <td class=\"righttable\">\n                    Tab (ASCII 9)</td>\n            </tr>\n        </table>\n        <p>\n            The INSTALLOPTIONS_READ_CONVERT and INSTALLOPTIONS_WRITE_CONVERT macros automatically\n            convert these characters in installer code. In uninstaller code, use INSTALLOPTIONS_READ_UNCONVERT\n            and INSTALLOPTIONS_WRITE_UNCONVERT.</p>\n        <p>\n            To use these macros in your script, the conversion functions need to be included:</p>\n        <pre>\n;For INSTALLOPTIONS_READ_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_READ_CONVERT\n;For INSTALLOPTIONS_WRITE_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT\n;For INSTALLOPTIONS_READ_UNCONVERT\n  !insertmacro INSTALLOPTIONS_UNFUNCTION_READ_CONVERT\n;For INSTALLOPTIONS_WRITE_UNCONVERT\n  !insertmacro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT\n</pre>\n    </div>\n    <h2 id=\"validate\">\n        Input validation</h2>\n    <div>\n        <p>\n            To validate the user input (for example, to check whether the user has filled in\n            a textbox) use the leave function of the Page command and Abort when the validation\n            has failed:</p>\n        <pre>\nFunction ValidateCustom\n\n  !insertmacro INSTALLOPTIONS_READ $R0 \"test.ini\" \"Field 1\" \"State\"\n  StrCmp $R0 \"\" 0 +3\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"Please enter your name.\"\n    Abort\n\nFunctionEnd\n</pre>\n    </div>\n    <h2 id=\"dialogreturn\">\n        Return value</h2>\n    <div>\n        After a dialog is created (using display or show), a return value is available:</p>\n        <ul>\n            <li>success - The user has pressed the Next button</li>\n            <li>back - The user has pressed the Back button</li>\n            <li>cancel - The user has pressed the Cancel button</li>\n            <li>error - An error has occurred, the dialog cannot be displayed.</li>\n        </ul>\n        <p>\n            You only have to check this value if you need something really special, such as\n            doing something when the user pressed the Back button.</p>\n        <p>\n            If you need the return value, use the INSTALLOPTIONS_DISPLAY_RETURN or INSTALLOPTIONS_SHOW_RETURN\n            macro. The return value will be added to the stack, so you can use the Pop command\n            to get it.</p>\n    </div>\n    <h2 id=\"reserve\">\n        Reserve files</h2>\n    <div>\n        <p>\n            When using solid compression, it's important that files which are being extracted\n            in user interface functions are located before other files in the data block. Otherwise\n            there may be a delay before a page can be displayed.</p>\n        <p>\n            To ensure that this is the case, add ReserveFile commands for InstallOptions and\n            the INI files before all sections and functions:</p>\n        <pre>\nReserveFile &quot;test.ini&quot;\nReserveFile /plugin InstallOptions.dll\n</pre>\n    </div>\n    <h2>\n        Fonts and colors</h2>\n    <div>\n        <p>\n            To customize fonts or colors on InstallOptions dialogs, the INSTALLOPTIONS_INITDIALOG\n            and INSTALLOPTIONS_SHOW macro can be used.</p>\n        <p>\n            INSTALLOPTIONS_INITDIALOG creates the dialog in memory, but does not show it. After\n            inserting this macro, you can set the fonts and colors, and then insert INSTALLOPTIONS_SHOW\n            to show the dialog.</p>\n        <p>\n            The INSTALLOPTIONS_INITDIALOG macro also pushes the HWND of the custom dialog to\n            the stack. Control HWND's are available for each control in the HWND entry of the\n            corresponding field in the INI file.</p>\n        <p>\n            Example of using a custom font:</p>\n        <pre>\nVar HWND\nVar DLGITEM\nVar FONT\n\nFunction FunctionName ;FunctionName defined with Page command\n\n  !insertmacro INSTALLOPTIONS_INITDIALOG &quot;ioFile.ini&quot;\n  Pop $HWND ;HWND of dialog\n    \n  !insertmacro INSTALLOPTIONS_READ $DLGITEM &quot;ioFile.ini&quot; &quot;Field 1&quot; &quot;HWND&quot;\n    \n  ;$DLGITEM contains the HWND of the first field\n  CreateFont $FONT &quot;Tahoma&quot; 10 700 \n  SendMessage $DLGITEM ${WM_SETFONT} $FONT 0\n        \n  !insertmacro INSTALLOPTIONS_SHOW\n\nFunctionEnd\n</pre>\n    </div>\n    <h2 id=\"credits\">\n        Credits</h2>\n    <div>\n        <p>\n            Original version by Michael Bishop<br />\n            DLL version by Nullsoft, Inc.<br />\n            DLL version 2 by Amir Szekely, ORTIM, Joost Verburg<br />\n            New documentation by Joost Verburg</p>\n    </div>\n    <h2 id=\"license\">\n        License</h2>\n    <div>\n        <pre>\nOriginal version Copyright &copy; 2001 Michael Bishop\nDLL version 1 Copyright &copy; 2001-2002 Nullsoft, Inc., ORTIM\nDLL version 2 Copyright &copy; 2003-2022 Amir Szekely, Joost Verburg, Dave Laundon\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented;\n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.\n</pre>\n    </div>\n    </div> </td> </tr> </table>\n</body>\n</html>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/InstallOptionsEx/License.txt",
    "content": "Original IO version Copyright  2001 Michael Bishop\nIO DLL version 1 Copyright  2001-2002 Nullsoft, Inc., ORTIM\nIO DLL version 2 Copyright  2003-2009 Amir Szekely, Joost Verburg, Dave Laundon\nIOEx DLL (changed from original IO 2) Copyright  2004-2005 Diego Pedroso \nIOEx DLL (starting at v.2.4.5) Copyright  2006-2019 SuperPat\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented;\n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.\n"
  },
  {
    "path": "setup/nsis/tools/Docs/InstallOptionsEx/Readme.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\n  <meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\" />\n  <title>InstallOptionsEx Readme</title>\n\n  <link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\">\n  <script src=\"basic.js\" type=\"text/javascript\"></script>\n</head>\n\n<body>\n  <table class=\"maintable\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n  <tr>\n  <td>\n  <h1 class=mm>InstallOptionsEx</h1>\n  <h2 class=mm><i>2.4.5 beta 3</i></h2>\n  <div>\n\n  <a target=\"_blank\" onClick=\"CollapseAll()\" class=mm>Collapse All</a> | <a target=\"_blank\" onClick=\"ExpandAll()\">Expand All</a> | <a target=\"_blank\" onClick=\"InverseAll()\">Invert All</a><br />\n\n  <center>\n\n  <!-- First Item -->\n\n  <script type=\"text/javascript\">WriteTitleStart(\"\", \"intro\");</script>\n    Introduction\n  <script type=\"text/javascript\">WriteTitleEnd();</script>\n  <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n    <p class=\"bm\">InstallOptions and InstallOptionsEx are NSIS plugins which allow you to create custom pages for\n    NSIS installers, to prompt the user for extra information. InstallOptionsEx is an expanded version of\n    InstallOptions containing many new features, with size drawback. As it is not in the main distribution,\n    InstallOptionsEx aims for experiments towards new GUI features in order to achieve long term goals that\n    InstallOptions couldn't achive.</p>\n\n    <p>InstallOptionsEx creates dialogs that can be displayed inside the NSIS\n    window. The controls inside the dialog are translated from a resource file - a file with .ini\n    extention with contents conforming standards from this documentation.</p>\n\n    <p>NSIS 2 has a new standard page system which allows the plugin to add custom pages to your installer\n    without being bothered by complex \"next\" and \"previous\" page functions from the previous NSIS version.\n    It has also a newer and improved plugin system allowing automatic extraction and plugin deletion\n    when a plugin is used. The temporary plugins folder, used by default by this plugin, is deleted automatically -\n    resource files can be stored there for automatic deletion as you wish.</p>\n\n    <p>This version of InstallOptionsEx has been designed for NSIS 2, thus supporting\n    customized user interfaces and custom font and DPI settings.</p>\n\n    <p class=\"tm\">This documentation uses the \"expand and collapse\" effect. This makes information to be easily\n    organized and accessed by only showing revelant items in a category. Clicking in a category name will open\n    up or close down greater details towards the category. It is also possible to click on \"Collapse All\", \"Expand All\" and\n    \"Invert All\" links located in the top of this document to open or close categories.</p>\n  <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <!-- Next Item -->\n\n  <script type=\"text/javascript\">WriteTitleStart(\"\", \"reference\");</script>\n    Page INI File Reference\n  <script type=\"text/javascript\">WriteTitleEnd();</script>\n  <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n    <p class=\"bm\">This category contains the complete resource file reference. For greater readibility for those\n    who used InstallOptions priorily, the reference uses colors representing the changes between InstallOptionsEx\n    and InstallOptions, as stated below:</p>\n\n    <center><table>\n    <tr><td bgcolor=#777777>&nbsp;&nbsp;&nbsp;</td>\n    <td bgcolor=#cccccc>Old and supported (InstallOptionsEx/InstallOptions)</td></tr>\n    <tr><td bgcolor=#ff5500>&nbsp;&nbsp;&nbsp;</td>\n    <td bgcolor=#ff9900>New and supported (InstallOptionsEx only)</td></tr>\n    <tr><td bgcolor=#006600>&nbsp;&nbsp;&nbsp;</td>\n    <td bgcolor=#669966>Old but not supported (InstallOptions only)</td></tr>\n    </table></center>\n\n    <p>The resource file structure needs to conform with the basic Windows Registry\n    file format for the proper translation, as shown below:</p>\n\n    <pre>  [<b>Section</b>]\n  <b>Key</b>=<i>Value</i>\n  <b>Key2</b>=<i>Value2</i>\n\n  [<b>Section2</b>]\n  <b>Key</b>=<i>Value</i>\n  <b>Key2</b>=<i>Value2</i></pre>\n\n    <p>The following is a list of sections supported by the plugin:</p>\n\n    <!-- First Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings\");</script>\n      Settings\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">This section configures both the dialog and the window as a whole. The following are\n      the keys supported by this section:</p>\n\n      <!-- First Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-NumFields\");</script>\n        NumFields</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">The last control (field) number of a dialog to be translated by the\n        plugin. This is an option from InstallOptions supported only for compatibility reasons.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>Last field number (all fields will be created).</i><br />\n        <b>Supported since: </b><i>InstallOptions 1.0</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-Title\");</script>\n        Title</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Sets the window title bar text.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>Current window title bar text.</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.1, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-CancelEnabled\");</script>\n        CancelEnabled</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Enables or disables the cancel button. If set to 1, the cancel button will\n        be enabled. If set to 0, the cancel button will be disabled.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>1 (Enabled).</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.2 beta, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-CancelShow\");</script>\n        CancelShow</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Shows or hides the cancel button. If set to 1, the cancel button will be\n        shown. If set to 0, the cancel button will be hidden.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>1 (Show).</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.4 beta, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-BackEnabled\");</script>\n        BackEnabled</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Enables or disables the back button. If set to 1, the back button will\n        be enabled. If set to 0, the back button will be disabled.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>1 (Enabled) or 0 (Disabled) if the page is the first to appear.</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Settings-BackShow\");</script>\n        BackShow</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Shows or hides the back button. If set to 1, the back button will be\n        shown. If set to 0, the back button will be hidden.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>1 (Show) or 0 (Hide) if the page is the first to appear.</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Settings-NextEnabled\");</script>\n        NextEnabled</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Enables or disables the next button. If set to 1, the next button will\n        be enabled. If set to 0, the next button will be disabled.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>1 (Enabled).</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Settings-NextShow\");</script>\n        NextShow</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Shows or hides the next button. If set to 1, the next button will be\n        shown. If set to 0, the next button will be hidden.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>1 (Show).</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-CancelButtonText\");</script>\n        CancelButtonText</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Sets the \"Cancel\" button text.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>Current \"cancel\" button text.</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-BackButtonText\");</script>\n        BackButtonText</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Sets the \"Back\" button text.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>Current \"back\" button text.</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-NextButtonText\");</script>\n        NextButtonText</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Sets the \"Next\" button text.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>Current \"next\" button text.</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-Rect\");</script>\n        Rect</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Sets the rectangle ID where all the controls will be created and where the\n        page boundaries are. This means that any boundary values for\n        <i>Left</i>, <i>Right</i>, <i>Top</i>, <i>Bottom</i> INI keys for\n        <i>Field #</i> INI sections will be based on the top-left part and limited to\n        the right-bottom part of the rectangle.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>1018 (Dimensions: Default UI: 233x130, Modern UI: 300x140).</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-RTL\");</script>\n        RTL</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Specifies if the rectangle of controls will be mirrored and texts\n        will be aligned to the right. If 1, it is true. If 0, it is false.\n        If $(^RTL), it depends on the language of your application. Some controls might\n        not have the text aligned correctly because of Windows limitations on most of the\n        international versions of Windows.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>0 (Normal control positions, texts aligned to left).</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Settings-MUnit\");</script>\n        MUnit</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies which measurement unit should the plug-in use for interpreting the controls positions.\n        If 1, <i>pixels</i> are used. If 0, <i>dialog units</i> are used.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>0 (Dialog units).</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Settings-BufferSize\");</script>\n        BufferSize</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the size in characters of all buffers used by the plug-in used in writing\n        and reading operations done to the page INI file.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>8192 characters, including the terminating character.</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Settings-TimeOut\");</script>\n        TimeOut</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the time in miliseconds for the page to return, regularly, to\n        the validation function. This time pauses when a notification is called and returned\n        to the validation function until the \"Abort\" instruction is used. If the value is lesser\n        than 10 or bigger than 2147483647 (about 25 days) (limits are for Windows), the values\n        are ignored and the timer is not set. Default value is 0 (no timer).</p>\n        <p class=\"tm\"><b>Default Value: </b><i>0 (No timer).</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 2</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Settings-State\");</script>\n        State</b></a> <i>(Output)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Specifies which control called the validation function using control\n        notifications, or, if the value is 0, the page itself by page notifications.</p>\n        <p class=\"tm\"><b>Return Values: </b><i>0 (Page), 1 or more (Field ID).</i><br />\n        <b>Supported by: </b><i>InstallOptions 2.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Settings-Notify\");</script>\n        Notify</b></a> <i>(Output)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies which page or control notification called the\n        validation function. For this value to recognize a control notification, the control has\n        to have 1 or more notification flags.</p>\n        <p class=\"tm\"><b>Return Values: </b><i>ONCANCEL (Cancel button activated), ONBACK (Back\n        button activated), ONNEXT (Next button activated), ONTIMEOUT (time from </i>TimeOut<i>\n        INI key expired), activated notification flag name from the control indicated\n        by </i>State<i> INI key.</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field\");</script>\n      Field #</b></a> (where <b>#</b> is a sequential number starting at 1)<b><a>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">A field is a control template to be created by the plugin when\n      the dialog is created. The following are the keys supported by this\n      section:</p>\n\n      <!-- First Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type\");</script>\n        Type</b></a> <i>(Required) (Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Specifies the control type. One of the following can be used to determine\n        a control type:</p>\n\n    <p>Controls in that section are organized as follows, from the simplest\n    control to the most complex:</p>\n\n    <ul>\n    <li>Controls that don't receive any focus at all. (<i>Label</i> -> <i>VLine</i>)</li>\n    <li>Controls that receive mostly mouse focus. (<i>Link</i> -> <i>UpDown</i>)</li>\n    <li>Controls that <i>State</i> text can be edited manually. (<i>Text</i> -> <i>RichText</i>)</li>\n    <li>Controls that contain a customizable list of items. (<i>DropList</i> -> <i>TreeView</i>)</li>\n    <li>Controls that contain a non-customizable list of items. (<i>TrackBar</i> -> <i>MonthCalendar</i>)</li>\n    </ul>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-Label\");</script>\n          Label\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Used to display static text.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-GroupBox\");</script>\n          GroupBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Displays a frame to group controls.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-Image\");</script>\n          Image\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Can display the following:\n          <li>an icon file (.ico);</li>\n          <li>a cursor file (.cur);</li>\n          <li>an animated cursor file (.ani);</li>\n          <li>an icon from an executable file (.exe);</li>\n          <li>an icon from a dll file (.dll);</li>\n          <li>a bitmap file (.bmp);</li>\n          <li>an Audio Video Interleave file without sound with no or with run-length of 8 bits (BI_RLE8) encoding compression (.avi).</li>\n          <li>a Graphics Interchange Format file (uses OLE) (.gif);</li>\n          <li>a Joint Photographic Experts Group file (uses OLE) (.jpg, .jpeg);</li>\n          <p>The plugin will always try to use the best image appearance for the user's display.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IO\", \"Field-Type-Icon\");</script>\n          Icon\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n          <p class=\"bm\">Deprecated: Integrated with <i>Image</i> controls but still supported for compatibility.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.4 beta, InstallOptionsEx 2.4.1 beta 1 - 2.4.2 beta 4</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IO\", \"Field-Type-Bitmap\");</script>\n          Bitmap\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n          <p class=\"bm\">Deprecated: Integrated with <i>Image</i> controls but still supported for compatibility.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.4 beta, InstallOptionsEx 2.4.1 beta 1 - 2.4.2 beta 4</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IO\", \"Field-Type-Animation\");</script>\n          Animation\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n          <p class=\"bm\">Deprecated: Integrated with <i>Image</i> controls but still supported for compatibility.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1 - 2.4.2 beta 4</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-ProgressBar\");</script>\n          ProgressBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Displays a bar that shows progress. To make use of the ability to show progress, use\n          the <i>TimeOut</i> INI key for <i>Settings</i> INI section.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-HLine\");</script>\n          HLine\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Displays a horizontal line to separate controls.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.47, InstallOptionsEx 2.4.5 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-VLine\");</script>\n          VLine\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Displays a vertical line to separate controls.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.47, InstallOptionsEx 2.4.5 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-Link\");</script>\n          Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Displays a static hot text that, when the mouse is passed over its area,\n          the mouse cursor turns into a hand.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-CheckBox\");</script>\n          CheckBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Displays a check box with label.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-RadioButton\");</script>\n          RadioButton\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Displays a radio button with label.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-Button\");</script>\n          Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Displays a push button that can be used in the same way as the \"Link\" control above.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-UpDown\");</script>\n          UpDown\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Displays a pair of arrow buttons used to increment or decrement a number\n          in a <i>Text</i>, <i>Password</i>, <i>RichText</i> or <i>ComboBox</i> buddy controls,\n          to change the selection upwards or downwards of a <i>ListBox</i> control,\n          or to be used alone (without the user knowing what number the user selected).</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-Text\");</script>\n          Text\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Accepts text input from the user.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-Password\");</script>\n          Password\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Accepts password input from the user. The input is masked with asterisk \"*\" characters by default.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-IPAddress\");</script>\n          IPAddress\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Displays an edit box used specially for IP address input.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IO\", \"Field-Type-FileRequest\");</script>\n          FileRequest\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n          <p class=\"bm\">Use <i>Text</i> and <i>Button</i> controls instead.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1-4 only</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IO\", \"Field-Type-DirRequest\");</script>\n          DirRequest\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n          <p class=\"bm\">Use <i>Text</i> and <i>Button</i> controls instead.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1-4 only</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-RichText\");</script>\n          RichText\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Displays an edit box with the contents of a file specified and with advanced editor options.\n          This control supports the following types of files:\n          <li>a text file (.txt);</li>\n          <li>a rich text file (.rtf).</li>\n\n          The following versions of this control are used by this plug-in:\n\n          <li>2.0 - (Recommended) Included in all Windows versions except Windows 95. Compatible in all versions of Windows.</li>\n          <li>1.0 - Included in all Windows versions except Windows 2000, and XP.</li>\n\n          <b>Notes:</b>\n\n          <ul>\n          <li>Only one line of the text file will be retrieved if the control doesn't have the <i>MULTILINE</i> flag.</li>\n          <li>No \"escape characters\" conversion is applied to the input or output.</li>\n          <li><a target=\"_blank\" href=\"https://msdn.microsoft.com/en-us/library/windows/desktop/bb787873(v=vs.85).aspx#rich_edit_shortcut_keys\">List of keyboard shortcuts used by the control</a>.</li>\n          </ul>\n          </p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-DropList\");</script>\n          DropList\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Only allows selection of items in the list.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-ComboBox\");</script>\n          ComboBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Allows the user to select a item in the pop up list and to type text not in there.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-DateTime\");</script>\n          DateTime\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Displays a combobox where the user can pick or select a date or time\n          he/she wants.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Type-ListBox\");</script>\n          ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Shows multiple items and can optionally allow the user to select more than one item.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.4, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-ListView\");</script>\n          ListView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Shows a linear list of items. Each item consists of a\n          label, optional 16x16px and 32x32px images. Images are respectively from\n          <i>SmallImageList</i> and <i>LargeImageList</i> keys.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-TreeView\");</script>\n          TreeView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Shows a hierarchical list of items. Each item consists of a\n          label, and each item can have a list of subitems associated with it. By\n          clicking an item, the user can expand or collapse the associated list of\n          subitems.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-TrackBar\");</script>\n          TrackBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Displays a bar where the user can select with the slider one of the\n          options indicated by ticks. It doesn't include labels.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Type-MonthCalendar\");</script>\n          MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Displays a month calendar where the user can select a date he/she wants.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Text\");</script>\n        Text</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Generally specifies control caption, but this can depend on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Text-Label\");</script>\n          Label\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the control caption.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Text-Image\");</script>\n          Image\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the path to the image. The type of image will be determined by its\n          file extension, as described in <i>Type<i> key for <i>Field #</i> section.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Text-CheckBox/RadioButton\");</script>\n          CheckBox/RadioButton\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the control caption.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Text-Button\");</script>\n          Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies control's text. If <i>ICON</i> or <i>BITMAP</i> flags are\n          associated with a button control, this specifies the path where the icon or\n          bitmap is.</p>\n          <p><b>For InstallOptions and InstallOptionsEx 2.4.1 beta 1 only:</b><br />\n          &nbsp;&nbsp;This only specifies control's text.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 2.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Text-Text/Password/RichText\");</script>\n          Text/Password/RichText\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">When the <i>PASSWORD</i> flag is specified, except for <i>Password</i> controls, this\n          specifies the password mask character. The displayed control characters are immediately\n          hidden by the character specified.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>*</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 10</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Text-DateTime\");</script>\n          DateTime\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the format to show the <i>State</i> value. The format basic explanation\n          can be found on the <i>Regional and Language Options</i> on\n          <i>Control Panel</i>.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Date format\n          specified by the user in the </i>Regional and Language Options<i> from\n          </i>Control Panel<i>. Example: dd/MM/yyyy.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Text-ListBox\");</script>\n          ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the width of the vertical columns inside the control in\n          pixels. Specifying 0 makes the control to have only one column occupying\n          the entire control.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0 (1 column occupying entire control).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 13</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State\");</script>\n        State</b></a> <i>(Depends)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Specifies the state of the control. This is updated when the user closes\n        the window, so you can read from it from NSIS. The input/output depends on\n        the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-Image\");</script>\n          Image</b></a> <i>(Input)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If the image is an icon from an executable or dll file, this specifies the\n          icon index number of the desired icon inside the executable or dll file. 0 or an empty\n          value means that the first icon inside the file will be used.</p>\n\n          <p>If the image is an animation, this specifies the number of times the animation\n          is repeated from the <i>MinLen</i> to the <i>MaxLen</i> value point.\n          If more than 0, the animation will repeat that number of times. If 0, the\n          animation doesn't get played when the dialog is shown. If -1, the number of\n          loops is unlimited.</p>\n\n          <p>If the file indicated by <i>Text</i>'s value doesn't exist, this specifies a flag\n          which determines a default icon, cursor or bitmap from the operationing system. This\n          can be one of the following:</p>\n\n          <p><b>Icons (32x32 pixels resources):</b></p>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            APPLICATION\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default application icon for programs.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            EXCLAMATION\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows an icon with an exclamation mark inside a yellow triangle.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            INFORMATION\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows an icon with an exclamation mark inside a white balloon.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            QUESTION\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows an icon with a question mark inside a white balloon.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            STOP\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows an icon with the letter \"X\" inside a red circle.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            WINLOGO\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Shows a Windows icon.</p>\n            <p class=\"tm\"><b>For Windows XP:</b><br />\n            &nbsp;&nbsp;Same as <i>APPLICATION</i>.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <p><b>Cursors (32x32 pixels resources):</b></p>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            APPSTARTING\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like an small arrow pointing between north/north-west\n            with an hourglass that appears when an application in the background is occupied.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            ARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like an arrow pointing between north/north-west\n            for usual use.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            CROSS\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a cross and used by some graphic programs\n            to select a group of pixels more accuratelly than using the default cursor.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            HAND\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a hand with a finger pointing to north\n            and used by some applications to give more attention to the location pointed. The\n            plug-in always shows this cursor when the cursor is over a <i>Link</i> control.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            HELP\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like an small arrow pointing between north/north-west\n            with a question mark used by some applications for giving more information about an item.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            IBEAM\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a roman numeral \"I\" used by\n            text supporting applications to distinguish the position of the cursor between 2\n            letters, so their selection can be easier.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            NO\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a circle with a north-west to\n            south-east diagonal line used by some applications to inform the user that the\n            cursor current position is not allowed for a determined mouse operation.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            SIZEALL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a cross with arrow heads on all the line ends\n            used for moving objects from one place to another.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            SIZENESW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a north-east to south-west diagonal line\n            with arrow heads on the line ends for resizing objects.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            SIZENS\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a north to south vertical line\n            with arrow heads on the line ends for resizing objects.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            SIZENWSE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a north-west to south-east diagonal line\n            with arrow heads on the line ends for resizing objects.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            SIZEWE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a west to east horizontal line\n            with arrow heads on the line ends for resizing objects.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            UPARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a vertical line\n            with an arrow head on the top for selecting columns of stacked objects.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            WAIT\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default cursor generally shaped like a hourglass that appears when the\n            program on the foreground is occupied.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <p><b>Bitmaps (resources with varied sizes):</b></p>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            BTNCORNERS\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap that shows the corners of a button (?).</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            SIZE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like 3 south-west to north-east diagonal\n            lines, usually accompanied by the SIZENWSE cursor that shows that you can resize a button.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            CHECK\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a check mark that shows that\n            an option is enabled or a process has been completed.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            CHECKBOXES\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap for the checkboxes and radiobuttons for all controls.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            CLOSE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap for the default application icons in 16x16 each (?).</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            COMBO\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like an arrow without its tail pointing south\n            that shows that an option has sub-options or a process has sub-processes.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            DNARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing south that is used by scroll bars or for the future <i>ScrollBar</i> control.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            DNARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing south that is used by scroll bars to allow the user to scroll down a\n            window or control.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            DNARROWD\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing south that is used by scroll bars to allow the user to scroll down a\n            window or control. This shows <i>DNARROW</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            DNARROWI\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing south that is used by scroll bars to allow the user to scroll down a\n            window or control. This shows <i>DNARROW</i>'s disabled state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            LFARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing left that is used by scroll bars to allow the user to scroll left a\n            window or control.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            LFARROWD\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing left that is used by scroll bars to allow the user to scroll left a\n            window or control. This shows <i>LFARROW</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            LFARROWI\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing left that is used by scroll bars to allow the user to scroll left a\n            window or control. This shows <i>LFARROW</i>'s disabled state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            MNARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like an arrow without\n            its tail pointing right that is used to show that options or processes are going\n            to be completed or that show that there are sub-options or sub-processes that\n            are not being shown.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            REDUCE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with a small horizontal\n            line that is used to show the window can be minimized to the taskbar.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            REDUCED\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with a small horizontal\n            line that is used to show the window can be minimized to the taskbar.\n            This shows <i>REDUCE</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            REDUCED\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with a small horizontal\n            line that is used to show the window can be minimized to the taskbar.\n            This shows <i>REDUCE</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            RESTORE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with the drawing of two small\n            windows that is used to show the window can be restored to its original size.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            RESTORED\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with the drawing of two small\n            windows that is used to show the window can be restored to its original size.\n            This shows <i>RESTORE</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            RGARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing right that is used by scroll bars to allow the user to scroll right a\n            window or control.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            RGARROWD\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing right that is used by scroll bars to allow the user to scroll right a\n            window or control. This shows <i>LFARROW</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            RGARROWI\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing right that is used by scroll bars to allow the user to scroll right a\n            window or control. This shows <i>LFARROW</i>'s disabled state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            SIZE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like 3 south-west to north-east diagonal\n            lines, usually accompanied by the SIZENWSE cursor that shows that you can resize a window.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            UPARROW\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing up that is used by scroll bars to allow the user to scroll up a\n            window or control.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            UPARROWD\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing up that is used by scroll bars to allow the user to scroll up a\n            window or control. This shows <i>UPARROW</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            UPARROWI\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with an arrow without\n            its tail pointing up that is used by scroll bars to allow the user to scroll up a\n            window or control. This shows <i>UPARROW</i>'s disabled state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            ZOOM\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with the drawing of a small\n            window that is used to show the window can be maximized to its maximum size.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\");</script>\n            ZOOMD\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p>Shows the default bitmap generally shaped like a button with the drawing of a small\n            window that is used to show the window can be maximized to its maximum size.\n            This shows <i>ZOOM</i>'s pressed state.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <p class=\"tm\"><b>Default Values: </b><br />\n          <b>If the image is of type icon from an executable or dll file:</b> <i>0 (the first icon).</i><br />\n          <b>If the image is of type animation:</b> <i>-1 (unlimited animation loops).</i><br />\n          <b>If the file indicated by <i>Text</i>'s value doesn't exist:</b> <i>Program default icon.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-ProgressBar\");</script>\n          ProgressBar</b></a> <i>(Input)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies at what point the progress is.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0 (Start)</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-CheckBox\");</script>\n          CheckBox</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">'0' or '1' (for unchecked or checked). When the flag <i>3STATE</i> is\n          used, '2' is the indetermined (grayed) state of the control.</p>\n          <p class=\"tm\">Supported by: </b><i>InstallOptions 1.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-RadioButton\");</script>\n          RadioButton</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">'0' or '1' (for unchecked or checked).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0 (Unchecked).</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-Link-Button\");</script>\n          Link/Button</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies something to be executed or opened. Doesn't support parameters.\n          If one of the flags names ended in \"REQUEST\" is specified, this specifies the return value for the\n          operation done in the dialog. This can change, depending on which \"REQUEST\" flag is\n          chosen on <i>Flags</i> key:</p>\n\n          <!-- First Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-Link-Button-OPEN_FILEREQUEST\");</script>\n            OPEN_FILEREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Specifies a file to be selected in the \"Open\" dialog by default. If <i>MULTISELECT</i>\n            flag is specified, files are enclosed inside double quotes (\") and separated by a space\n            character ( ). If the dialog is canceled, the default value is the previous specified file as state.</p>\n            <p class=\"tm\"><b>Default Value: </b><i>No file is selected, but the folder location depends on OS version.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-Link-Button-SAVE_FILEREQUEST\");</script>\n            SAVE_FILEREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Specifies a file to be selected in the \"Save\" dialog by default. If the dialog is canceled,\n            the default value is the previous specified file as state.</p>\n            <p class=\"tm\"><b>Default Value: </b><i>No file is selected, but the folder location depends on OS version.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-Link-Button-DIRREQUEST\");</script>\n            DIRREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Specifies the folder to select in the \"Browse\" dialog. If the dialog is canceled,\n            the default value is the previous folder specified as state.</p>\n            <p class=\"tm\"><b>Default Value: </b><i>Desktop (same as $DESKTOP variable on NSIS).</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-Link-Button-COLORREQUEST\");</script>\n            COLORREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Specifies the color to appear or selected in \"Color\" dialog by default. Format:\n            0xBBRRGG (hexadecimal). If the dialog is canceled, the default value is the previous string specified as state.</p>\n            <p class=\"tm\"><b>Default Value: </b><i>None, string is treated as black (0x000000).</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-Link-Button-FONTREQUEST\");</script>\n            FONTREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Specifies the font to appear or selected in \"Font\" dialog by default. The format\n            bases on the actual values of font keys and a color key, separated by\n            \"|\" characters in this order:</p>\n            <p>\"FontName|FontHeight|FontBold|FontItalic|FontUnderline|FontStrikeOut|TxtColor\".</p>\n            <p>If the dialog is canceled, the default value is the previous string specified as state.</p>\n            <p class=\"tm\"><b>Default Value: </b><i>Default font (only if nothing is specified).</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 2.2 (for Link), InstallOptions 2.3 (for button), InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-UpDown\");</script>\n          UpDown</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the selected number option. Ignored if <i>RefFields</i> key\n          is specified.\n          <p class=\"tm\"><b>Default Value: </b><i>0 (First Number).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-Text\");</script>\n          Text</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">String to appear.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-Password\");</script>\n          Password</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">String to appear hidden by mask characters.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-IPAddress\");</script>\n          IPAddress</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">IP address to appear.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0.0.0.0.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-RichText\");</script>\n          RichText</b></a> <i>(Input)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies a file to be opened for both reading and writing operations. The type\n          of text file will be determined by its actual contents.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-DropList/ComboBox\");</script>\n          DropList</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the selected item name.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-DropList/ComboBox\");</script>\n          ComboBox</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the selected item name. If the item specified does not\n          exist, then the string will be only used in the text box part of the control.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-DateTime\");</script>\n          DateTime</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the date and time to show. Has to be in this format:<br />\n          <br />\n          <i>dd/MM/yyyy HH:mm:ss w</i> (w = day of the week as a number -> Sunday = 0, Monday = 1...)\n          <br />\n          <br />The separators can be:<br/>\n          <br />\n          <i>\"/\", \"\\\", \"-\", \":\" or \" \".</i><br />\n          <br />\n          If you don't want to specify all those numbers, you can use bogus numbers, i.e.:<br />\n          <br />\n          23-02-2005 00:00:00 0</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Current date and time.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-State-ListBox\");</script>\n          ListBox</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies selected items names separated by pipes ('|').</p>\n          <p class=\"tm\"><b>Default Value: </b><i>The first item on </i>ListItems<i>.</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.4, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-ListView\");</script>\n          ListView</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies selected items names separated by pipes (\"|\").</p>\n\n          <p>If <i>CHECKBOXES</i> is specified, this specifies the state of all\n          items (not subitems) checkboxes with state flags (not item names). The\n          items are separated by pipes (\"|\").</p>\n\n          <p>Example:</p>\n\n          <pre>  ListItems=<b>Item1</b>{SubItem1ofItem1|SubItem2ofItem1}<b>Item2</b>|<b>Item3</b></b>\n  State=<b>0</b>|<b>1</b>|<b>3</b></pre>\n\n          <p>Item state flags have to be joined with \"bitwise OR\" before writing to the\n          INI file. Example:</p>\n\n          <pre>  <b>3</b> = <b>0x0B</b> = Checked + Read-Only.</pre>\n\n          <p>Then put it like this in the <i>State</i> INI value:</p>\n\n          <pre>  State=0|1|<b>3</b></pre>\n\n          <p>After you run the page, you can verify if one of the bits is selected by\n          doing a \"bitwise AND\". There is no way to detect if the \"Unchecked\" state flag\n          is used because it's 0. Instead, try to check for the \"Checked\" state flag.</p>\n\n          <p>State of checkboxes:</p>\n          <ul>\n          <li><b>0</b> or <b>0x00</b> - Checkbox is unchecked.</li>\n          <li><b>1</b> or <b>0x01</b> - Checkbox is checked.</li>\n          <li><b>2</b> or <b>0x02</b> - Checkbox is read-only.</li>\n          <li><b>4</b> or <b>0x04</b> - No checkbox (not totally supported yet).</li>\n          </ul>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-TreeView\");</script>\n          TreeView</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the selected item name with all the parent items\n          names. The structure syntax is the same as on <i>ListItems</i> INI value\n          name:</p>\n          <ul>\n          <li><b>{</b> - Starts a new tree level. The item to the left of this\n          character is the parent item.</li>\n          <li><b>|</b> - Separates an item from another.</li>\n          <li><b>}</b> - Ends a tree level.</li>\n          </ul>\n\n          <p>Example:</p>\n\n          <pre>  ListItems=<b>MyParentItem{</b>MyChildItem1|<b>MyChildItem2}</b>\n  State=<b>MyParentItem{MyChildItem2}</b></pre>\n\n          <p>If <i>CHECKBOXES</i> is specified, it specifies the state of all items\n          checkboxes with state flags (not item names). In this case, you have to\n          follow the exact same structure of the items as on <i>ListItems</i> INI value\n          name. Example:</p>\n\n          <pre>  ListItems=MyParentItem<b>{</b>MyChildItem1<b>|</b>MyChildItem2<b>}</b>\n  State=0<b>{</b>11<b>|</b>4<b>}</b></pre>\n\n          <p>Item state flags have to be joined with \"bitwise OR\" before writing to the\n          INI file. Example:</p>\n\n          <pre>  <b>11</b> = <b>0x0B</b> = Checked + Read-Only + Bold.</pre>\n\n          <p>Then put it like this in the <i>State</i> INI value:</p>\n\n          <pre>  State=0{<b>11</b>|4}</pre>\n\n          <p>After you run the page, you can verify if one of the bits is selected by\n          doing a \"bitwise AND\". There is no way to detect if the \"Unchecked\" state flag\n          is used because it's 0. Instead, try to check for the \"Checked\" state flag.</p>\n\n          <p>State of checkboxes:</p>\n          <ul>\n          <li><b>0</b> or <b>0x00</b> - Checkbox is unchecked (ignored by parent items except when there is no child items that have checkboxes).</li>\n          <li><b>1</b> or <b>0x01</b> - Checkbox is checked  (same note as above).</li>\n          <li><b>2</b> or <b>0x02</b> - Checkbox is read-only  (same note as above).</li>\n          <li><b>4</b> or <b>0x04</b> - No checkbox.</li>\n          <li><b>8</b> or <b>0x08</b> - Bold item.</li>\n          <li><b>16</b> or <b>0x10</b> - Expand item (only for parent items).</li>\n          <li><b>32</b> or <b>0x20</b> - Swap between partially checked state to unchecked state (reserved, only for parent items). Checkbox is unchecked.</li>\n          <li><b>33</b> or <b>0x21</b> - Swap between partially checked state to unchecked state (reserved, only for parent items). Checkbox is partially checked.</li>\n          <li><b>64</b> or <b>0x40</b> - Swap between partially checked state to checked state (reserved, only for parent items). Checkbox is partially checked.</li>\n          <li><b>65</b> or <b>0x41</b> - Swap between partially checked state to checked state (reserved, only for parent items). Checkbox is checked.</li>\n          <li><b>128</b> or <b>0x80</b> - Stay in a partially checked state (reserved, only for parent items). Checkbox is partially checked.</li>\n          <li><b>129</b> or <b>0x81</b> - Stay in a partially checked state (reserved, only for parent items). Checkbox is partially checked.</li>\n          </ul>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-TrackBar\");</script>\n          TrackBar</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies an item index to be selected. If 0, the first item is selected.\n          If -1, the last item is selected.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0 (First Item)</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-State-MonthCalendar\");</script>\n          MonthCalendar</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the date to show. Has to be in this format:<br />\n          <br />\n          <i>dd/MM/yyyy</i>\n          <br />\n          <br />Separators can be:<br/>\n          <br />\n          <i>\"/\", \"\\\", \"-\", \":\" or \" \".</i><br /></p>\n          <p class=\"tm\"><b>Default Value: </b><i>Current date.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-ListItems\");</script>\n        ListItems</b></a> <i>(Depends)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Generally specifies a list of items to display in a control. The input/output depends on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ListItems-Link-Button\");</script>\n          Link/Button</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">When <i>DIRREQUEST</i> flag is used, this specifies the text above the\n          <i>TreeView</i> control in the \"Browse For Folder\" dialog.</p>\n\n          <p>When <i>COLORREQUEST</i> flag is used, this specifies a list of 16 custom colors to display.\n          This is a single line of text with each item separated by a pipe character '|'. If there are\n          non-filled colors, they default to white (0xFFFFFF). If there are more colors than the limit, the extra\n          items are ignored. Format: 0xBBRRGG (hexadecimal).</p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>For flag </i>COLORREQUEST<i>: White (0xFFFFFF) for non-filled colors.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-ListItems-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox</b></a> <i>(Input)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies a list of items to display. This is a single line of text with\n          each item separated by a pipe character '|'.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ListItems-ListView\");</script>\n          ListView</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies a list of item and subitem names to display. Subitems\n          are items that appear when the flag <i>REPORT_VIEW</i> is specified as\n          the additional information for a corresponding item. This is a single line of\n          text with this structure syntax:</p>\n          <ul>\n          <li><b>{</b> - Starts a new group level. Items inside this level are\n          subitems of that item on the left of this character. Only 1 sublevel is\n          allowed and supported correctly.</li>\n          <li><b>|</b> - Separates an item or subitem from another.</li>\n          <li><b>}</b> - Ends a group level.</li>\n          </ul>\n          <p>This value only returns when <i>EDITLABELS</i> flag is set.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ListItems-TreeView\");</script>\n          TreeView</b></a> <i>(Input/Output)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies a list of items to display. This is a single line of\n          text with this structure syntax:</p>\n          <ul>\n          <li><b>{</b> - Starts a new tree level. The item to the left of this\n          character is the parent item.</li>\n          <li><b>|</b> - Separates an item from another.</li>\n          <li><b>}</b> - Ends a tree level.</li>\n          </ul>\n          <p>This value only returns when <i>EDITLABELS</i> flag is set.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-RefFields\");</script>\n        RefFields</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the field used as a reference to process input\n        and output operations. This specification can change from control to control:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-RefFields-Link-Button\");</script>\n          Link/Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">When used with <i>OPEN_FILEREQUEST</i>, <i>SAVE_FILEREQUEST</i>,\n          <i>DIRREQUEST</i> or <i>COLORREQUEST</i> flags, this specifies the field used as a reference\n          to process input (for <i>COLORREQUEST</i> flag) and output operations (for all\n          flags). Default is the control itself, where the <i>State</i> value is used.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>\"\" (the control itself).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-RefFields-UpDown\");</script>\n          UpDown\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the field used as a reference to process input\n          and output operations. Default is the control itself, where the <i>State</i> INI value is used.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>\"\" (the control itself).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-MaxLen\");</script>\n        MaxLen</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Causes validation on the selected control to limit the maximum length of\n        text or options. If the user specifies more text or options than this, a\n        message box may appear and the dialog will not be dismissed. This specification can change\n        depending on control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MaxLen-Image\");</script>\n          Image\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If the image is of type animation, this specifies the ending frame. If 0,\n          it is the first frame of the animation and makes it not to be played. If -1, it is the last\n          frame of the animation. If this is the same as specified on <i>MinLen</i>\n          INI key, it will only show that frame without playing the animation.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>-1 (Last frame of the animation).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MaxLen-ProgressBar\");</script>\n          ProgressBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the maximum progress limit. Maximum is 65535.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>100.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MaxLen-UpDown\");</script>\n          UpDown\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the maximum item number. The default and real maximum values are 2147483646. The minimum value is -2147483646.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>2147483646 (maximum value).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-MaxLen-Text/Password/RichText/ComboBox\");</script>\n          Text/Password/RichText/ComboBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the maximum length of text. There are specific limits for different control types:\n          <ul>\n          <li>For <i>Text</i> and <i>Password</i> controls without <i>MULTILINE</i> flag and <i>ComboBox</i> controls: 32KB of characters.</li>\n          <li>For <i>Text</i> and <i>Password</i> controls with <i>MULTILINE</i> flag: 64KB of characters.</li>\n          <li>For <i>RichText</i> controls: 4GB of characters.</li>\n          </ul>\n\n          <i>BufferSize</i> INI value for <i>Settings</i> INI section only truncates\n          characters when input or output operations are completed.\n\n          If the value is 0, then no text will be allowed in the control.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Buffer size or the text limit, whichever is smaller.</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MaxLen-TrackBar\");</script>\n          TrackBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the maximum number of items.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>100.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-MinLen\");</script>\n        MinLen</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Causes validation on the selected control to force the user to enter a\n        minimum amount of text. If the user specifies less text than this, a message\n        box may appear and the dialog will not be dismissed. The specification can change\n        depending on control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MinLen-Image\");</script>\n          Image\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If the image is of type animation, this specifies the starting\n          frame. If 0, it is the first frame of the animation. If -1, it is the last\n          frame of the animation and makes it not to be played. If this is the same\n          as specified on <i>MaxLen</i> INI key, it will only show that frame\n          without playing the animation.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0 (First frame of the animation).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MinLen-UpDown\");</script>\n          UpDown\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the minimum item number. The default and real minimum values are -2147483646. The maximum value is 2147483646.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>-2147483646 (minimum value).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-MinLen-Text/Password/ComboBox/RichText\");</script>\n          Text/Password/ComboBox/RichText\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the minimum length of text. Maximum value is described in the\n          <i>MaxLen</i> INI key description. If 0, means that there is no minimum limit.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0 (No minimum limit).</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-ValidateText\");</script>\n        ValidateText</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">If the control fails the test for <i>MinLen</i> or <i>MaxLen</i>, a\n        MessageBox will be displayed with this text. If blank, specifies that a\n        MessageBox shouldn't appear, but it still returns back to the page.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>MessageBox doesn't appear.</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Left/Right/Top/Bottom/Height/Width\");</script>\n        Left/Right/Top/Bottom/Height/Width</b></a> <i>(Required) (Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Specify the position on the dialog where this control appears. Width and/or Height\n        can be specified instead of Right and/or Bottom. All sizes should be set in\n        dialog units. To get the right dimensions for your controls, design your\n        dialog using a resource editor and copy the dimensions to the INI file.\n        Specify negative coordinates to specify the distance from the right or\n        bottom edge (except for <i>Height</i> and <i>Width</i>). This can change\n        depending on control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Left/Right/Top/Bottom/Height/Width-DropList/ComboBox\");</script>\n          DropList/ComboBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">There is a different meaning of the <i>Bottom</i> value in different\n          Windows versions. Bottom value equals:\n          <li><b>Win9x-Win2k:</b> Maximum size of the pop-up list + the actual control size.</li>\n          <li><b>WinXP:</b> Maximum size of the pop-up list only. All other times, the control\n          is automatically sized to be one element tall.</li>\n\n          If you have trouble where you can not see the combobox drop-down, then check\n          the <i>Bottom</i> value and ensure it is large enough. A rough guide for the\n          height required is the number of items in the list multiplied by 8, plus 20.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ListItemsHeight\");</script>\n        ListItemsHeight</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ListItemsHeight-DropList/ComboBox/ListBox/TreeView\");</script>\n          DropList/ComboBox/ListBox/TreeView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the height of each item contained into the control in pixels.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>15 pixels.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Filter\");</script>\n        Filter</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Filter-Link/Button\");</script>\n          Link/Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the filter to be used when using the\n          <i>OPEN_FILEREQUEST</i> or <i>SAVE_FILEREQUEST</i> flags. This is constructed\n          by putting pairs of entries together, each item separated by a | character.\n          The first value in each pair is the text to display for the filter. The\n          second value is the pattern to use to match files.\n\n          <p>For example, you might specify:</p>\n\n          <p>Filter=Text Files|*.txt<b>|</b>Programs|*.exe;*.com<b>|</b>All Files|*.*</p>\n          <p><b>For InstallOptions:</b><br />\n          &nbsp;&nbsp;Used only by <i>FileRequest</i> controls.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>All Files|*.* (All files).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1/i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Root\");</script>\n        Root</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Root-Link/Button\");</script>\n          Link/Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the root directory of the search when\n          <i>DIRREQUEST</i> flag is specified. This limits the search to a particular\n          directory on the system.</p>\n          <p><b>For InstallOptions:</b><br />\n          &nbsp;&nbsp;Used only by <i>DirRequest</i> controls.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>User's \"My Computer\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.4, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags\");</script>\n        Flags</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">This specifies additional flags for the display of different controls. Each\n        value should be separated by a | character. These flags are separated by\n        control types:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-All\");</script>\n          All</b></a> <i>(With Exceptions)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IO\", \"Field-Flags-All-NOTIFY\");</script>\n            NOTIFY </b></a> <i>(Except Label, Bitmap, Icon, ProgressBar and GroupBox controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n            <p class=\"bm\">Removed due to the new notification system.</p>\n            <p><b>For InstallOptionsEx 2.4.1 beta 5:</b><br />\n            &nbsp;&nbsp;Causes InstallOptionsEx to call your NSIS custom page validation/leave\n            function whenever the control's selection changes. Your validation/leave\n            function can read the <i>State</i> value from the \"Settings\" section to\n            determine which control caused the notification, if any, and perform\n            some appropriate action followed by an <i>Abort</i> instruction (to tell NSIS\n            to return back to the page).</p>\n            <p><b>For InstallOptionsEx 2.4.1 beta 4:</b><br />\n            &nbsp;&nbsp;Supported by all controls except <i>Label</i>, <i>Bitmap</i>, <i>Icon</i>, <i>GroupBox</i>, <i>MonthCalendar</i>, <i>DateTime</i>, <i>HotKey</i> and <i>UpDown</i> controls.</p>\n            <p><b>For InstallOptionsEx 2.4.1 beta 3 and below:</b><br />\n            &nbsp;&nbsp;Supported by <i>Text</i>, <i>Password</i>, <i>IPAddress</i>, <i>ComboBox</i>, <i>DropList</i>, <l>ListBox</i>, <i>CheckBox</i>, <i>RadioButton</i>, <i>Link</i> and <i>Button</i> controls.</p>\n            <p><b>For InstallOptionsEx 2.4.1 beta 1:</b><br />\n            &nbsp;&nbsp;Supported by <i>Text</i>, <i>Password</i>, <i>ComboBox</i>, <i>DropList</i>, <l>ListBox</i>, <i>CheckBox</i>, <i>RadioButton</i>, <i>Link</i> and <i>Button</i> controls.</p>\n            <p><b>For InstallOptions:</b><br />\n            &nbsp;&nbsp;Supported by <i>DropList</i>, <l>ListBox</i>, <i>CheckBox</i>, <i>RadioButton</i>, <i>Link</i> and <i>Button</i> controls.</p>\n            <p><b>For InstallOptions 2.3:</b><br />\n            &nbsp;&nbsp;Supported by <i>CheckBox</i>, <i>RadioButton</i>, <i>Button</i> controls.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.3, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-All-DISABLED\");</script>\n            DISABLED</b></a> <i>(Except Image controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Causes a control to be disabled.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-All-FOCUS\");</script>\n            FOCUS</b></a> <i>(Except Label, Image, ProgressBar and GroupBox controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Sets focus on the specified control, instead of the first focusable control. If more than one field is specified with this flag, only the first one will receive focus.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.45, InstallOptionsEx 2.4.5 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-All-GROUP\");</script>\n            GROUP</b></a> <i>(Except Label, Image, ProgressBar and GroupBox controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Add this flag to the first control of a group of controls to group their tabulation.\n            Grouping controls allows you to create multiple tabulation groups, making easier the\n            keyboard navigation using arrow keys.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-All-NOTABSTOP\");</script>\n            NOTABSTOP</b></a> <i>(Except Label, Image, ProgressBar and GroupBox controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Do not stop on the control when the user pressed the Tab key. Add\n            <i>NOTABSTOP</i> to all controls of a group started with <i>GROUP</i> flag,\n            except the first one to allow navigation between groups with the Tab key.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Image\");</script>\n          Image\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Image-RESIZETOFIT\");</script>\n            RESIZETOFIT\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">For all types of image, except animation. This resizes the image to\n            the size of the control. Also useful to support custom DPI settings.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Image-TRANSPARENT\");</script>\n            TRANSPARENT\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">If the image is not of type icon or cursor, it hides every pixel with the\n            same color as of the top left pixel. This allows to see-through to controls behind it.\n            This flag doesn't work well with a combination of the <i>RESIZETOFIT</i> flag and\n            images with more than 256 colors. If the image is of type icon, the transparency is\n            automatically applied; adding this flag would only add another layer of transparency.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.4.2, InstallOptionsEx 2.4.1 beta 13</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ProgressBar\");</script>\n          ProgressBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ProgressBar-SMOOTH\");</script>\n            SMOOTH\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the progress bar smooth.</p>\n            <p class=\"tm\"><b>Internet Explorer 3.0 or above required.</b><br />\n            <p><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ProgressBar-VSCROLL\");</script>\n            VSCROLL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the progress bar to appear as a vertical progress bar with the\n            indicator bar starting from the bottom.</p>\n            <p class=\"tm\"><b>Internet Explorer 3.0 or above required.</b><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 11</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-CheckBox/RadioButton\");</script>\n          CheckBox/RadioButton</b></a> <i>(With Exceptions)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-CheckBox/RadioButton-READONLY\");</script>\n            READONLY\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Prevents the user from changing the check state of the control.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 13</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-CheckBox/RadioButton-3STATE\");</script>\n            3STATE</b></a> <i>(Except RadioButton controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to have an additional \"not determined\" state. This is\n            generally used when some items are selected from another controls, but\n            not all of them. <i>State</i> can input and output the number 2 as that state.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button\");</script>\n          Link/Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-OPEN_FILEREQUEST\");</script>\n            OPEN_FILEREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to display a common dialog requiring a file for input to open.</p>\n            <p class=\"tm\"><b>Required: </b>A <i>Notify</i> key flag.<br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 11</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-SAVE_FILEREQUEST\");</script>\n            SAVE_FILEREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to display a common dialog requiring a file for input to save on.</p>\n            <p class=\"tm\"><b>Required: </b>A <i>Notify</i> key flag.<br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 11</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IO\");</script>\n            REQ_SAVE</b></a> <i>(Only Button)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n            <p class=\"bm\">Deprecated: Renamed to <i>SAVE_FILEREQUEST</i>, but kept for compatibility purposes.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-DIRREQUEST\");</script>\n            DIRREQUEST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to display a common dialog requiring a directory for input.</p>\n            <p class=\"tm\"><b>Required: </b>A <i>Notify</i> key flag.<br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-FILE_MUST_EXIST\");</script>\n            FILE_MUST_EXIST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Determines if the selected file must exist. It only affects the\n            <i>OPEN_FILEREQUEST</i> dialog.</p>\n            <p class=\"tm\"><b>Required flags: </b><i>OPEN_FILEREQUEST.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-FILE_EXPLORER\");</script>\n            FILE_EXPLORER\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Enables new file request look (recommended).</p>\n            <p class=\"tm\"><b>Required flags: </b><i>OPEN_FILEREQUEST or SAVE_FILEREQUEST.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-FILE_HIDEREADONLY\");</script>\n            FILE_HIDEREADONLY\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Hides the \"open read only\" check box. </p>\n            <p class=\"tm\"><b>Required flags: </b><i>OPEN_FILEREQUEST.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-WARN_IF_EXIST\");</script>\n            WARN_IF_EXIST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Displays a warning message if the selected file already exists. It\n            only affects <i>OPEN_FILEREQUEST</i> or <i>SAVE_FILEREQUEST</i> dialogs.\n            <p class=\"tm\"><b>Required flags: </b><i>OPEN_FILEREQUEST or SAVE_FILEREQUEST.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-PATH_MUST_EXIST\");</script>\n            PATH_MUST_EXIST\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Prevents the user from typing a non-existent path. It only affects\n            <i>OPEN_FILEREQUEST</i> or <i>SAVE_FILEREQUEST</i> dialogs.\n            <p class=\"tm\"><b>Required flags: </b><i>OPEN_FILEREQUEST or SAVE_FILEREQUEST.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-PROMPT_CREATE\");</script>\n            PROMPT_CREATE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Displays a warning if the selected file does not exist. However, it\n            still allows the user to select the file. It only affects\n            <i>OPEN_FILEREQUEST</i> dialogs.\n            <p class=\"tm\"><b>Required flags: </b><i>OPEN_FILEREQUEST.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-BITMAP\");</script>\n            BITMAP</b></a> <i>(Only Button)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to show a bitmap instead of text. ICON flag\n            disables this flag.\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-Link-Button-ICON\");</script>\n            ICON</b></a> <i>(Only Button)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to show an icon instead of text.\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-UpDown\");</script>\n          UpDown\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-UpDown-HSCROLL\");</script>\n            HSCROLL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the arrow heads of the control to point left and right instead of up\n            and down.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 11</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-UpDown-WRAP\");</script>\n            WRAP\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the position to \"wrap\" if it is incremented or decremented beyond\n            the ending or beginning of the range.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 4</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText\");</script>\n          Text/Password/RichText</b></a> <i>(With Exceptions)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-ONLY_NUMBERS\");</script>\n            ONLY_NUMBERS\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Forces the user to enter only numbers into the edit box. Doesn't allow\n            negative numbers to be entered. Text can still be pasted normally. </p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-MULTILINE\");</script>\n            MULTILINE\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Causes the control to accept multiple-lines.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-WANTRETURN\");</script>\n            WANTRETURN\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Specifies that a carriage return be inserted when the user presses the\n            ENTER key while entering text into the text box.</p>\n            <p class=\"tm\"><b>Required flags: </b><i>MULTILINE.</i><br />\n            <b>Supported by: </b><i>InstallOptions 2.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-NOWORDWRAP\");</script>\n            NOWORDWRAP\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Disables the word-wrap that occurs when long lines are entered. Long\n            lines instead scroll off to the side.</p>\n            <p class=\"tm\"><b>Required flags: </b><i>MULTILINE.</i><br />\n            <b>Disabled by flags: </b><i>HSCROLL.</i><br />\n            <b>Supported by: </b><i>InstallOptions 2.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-HSCROLL\");</script>\n            HSCROLL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Shows a horizontal scroll bar.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-READONLY\");</script>\n            READONLY\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Prevents the user from entering or editing text in the edit control,\n            but allow the user to select and copy the text.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-VSCROLL\");</script>\n            VSCROLL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Shows a vertical scroll bar.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-Text/Password/RichText-PASSWORD\");</script>\n            PASSWORD</b></a> <i>(Except Password controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Same as using the control <i>Password</i> when used with a <i>Text</i> control. This flag also works for\n            <i>RichText</i> controls, but there is no other control equivalent to the combination of <i>RichText</i> control and\n            <i>PASSWORD</i> flag.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-DropList/ComboBox\");</script>\n          DropList/ComboBox</b></a> <i>(With Exceptions)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-DropList/ComboBox-VSCROLL\");</script>\n            VSCROLL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Shows a disabled vertical scroll bar when there is no need for one.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 13</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-DropList/ComboBox-DROPLIST\");</script>\n            DROPLIST</b></a> <i>(Except DropList controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Same as using the control <i>DropList</i>.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-DateTime\");</script>\n          DateTime\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-DateTime-UPDOWN\");</script>\n            UPDOWN\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to be like an <i>UpDown</i> control with a <i>Text</i> control, but\n            using date and time.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-ListBox\");</script>\n          ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-ListBox-MULTISELECT\");</script>\n            MULTISELECT\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Turns string selection on or off each time the user clicks or double-clicks\n            a string in the control. The user can select any number of strings.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.4, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListBox-EXTENDEDSELECT\");</script>\n            EXTENDEDSELECT\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Allows multiple items to be selected by using the SHIFT key and the\n            mouse or special key combinations.</p>\n            <p class=\"tm\"><b>Disabled by flags: </b><i>MULTISELECT.</i><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 11</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IO\", \"Field-Flags-ListBox-EXTENDEDSELCT\");</script>\n            EXTENDEDSELCT\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IO\");</script>\n            <p class=\"bm\">Deprecated: Renamed to <i>EXTENDEDSELECT</i>, but kept for compatibility purposes.</p>\n            <p class=\"tm\"><b>Disabled by flags: </b><i>MULTISELECT.</i><br />\n            <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-ListBox-VSCROLL\");</script>\n            VSCROLL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Shows a disabled vertical scroll bar when there is no need for one.</p>\n            <p class=\"tm\"><b>Disabled by flags: </b><i>MULTISELECT.</i><br />\n            <b>Supported by: </b><i>InstallOptions 2.4, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListView/TreeView\");</script>\n          ListView/TreeView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListView/TreeView-CHECKBOXES\");</script>\n            CHECKBOXES\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Enables check boxes for items in <i>TreeView</i> and\n            <i>ListView</i> controls and the use of the space character to switch\n            among states. A check box is displayed only if an image is associated\n            with the item by using <i>StateImageList</i> INI key. See\n            <i>State</i> INI key for more information regarding the selection\n            of items.</p>\n            <p class=\"tm\"><b>Internet Explorer 3.0 or above required.</b><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListView/TreeView-EDITLABELS\");</script>\n            EDITLABELS\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Enables the edition of <i>ListItems</i> items in the control\n            by selecting the item first and then clicking over the label. It's doesn't\n            yet return values</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-Flags-ListView/TreeView-MULTISELECT\");</script>\n            MULTISELECT</b></a> <i>(Except TreeView controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n            <p class=\"bm\">Turns string selection on or off each time the user clicks or double-clicks\n            a string in the control. The user can select any number of strings.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.4, InstallOptionsEx 2.4.1 beta 1</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListView/TreeView-LIST_VIEW\");</script>\n            LIST_VIEW</b></a> <i>(Except TreeView controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Shows items in list view mode. This mode shows items in\n            inverse \"N\" mode. That means: the first item starts at the upper-left\n            corner of the control, then the next item comes below it. If the next\n            item doesn't fit between the last item on the column and the control's\n            bottom boundary, it goes to the next column. This mode uses images from the\n            <i>SmallImageList</i> for the items images. An item image goes to the\n            left of the label.</p></p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListView/TreeView-ICON_VIEW\");</script>\n            ICON_VIEW</b></a> <i>(Except TreeView controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Shows items in icon view mode. This mode shows items in\n            \"Z\" mode. That means: the first item starts at the upper-left corner of\n            the control, then the next item comes on the right of it. If the next\n            item doesn't fit between the last item on the row and the control's\n            right boundary, it goes to the next row. This mode uses images from the\n            <i>LargeImageList</i> for the items images. An item image goes above the\n            label.</p></p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListView/TreeView-SMALLICON_VIEW\");</script>\n            SMALLICON_VIEW</b></a> <i>(Except TreeView controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Shows items in small icon view mode. This mode shows items in\n            \"Z\" mode. That means: the first item starts at the upper-left corner of\n            the control, then the next item comes on the right of it. If the next\n            item doesn't fit between the last item on the row and the control's right\n            boundary, it goes to the next row. This mode uses images from the\n            <i>SmallImageList</i> for the items images. An item image goes to the\n            left of the label.</p></p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-ListView/TreeView-REPORT_VIEW\");</script>\n            REPORT_VIEW</b></a> <i>(Except TreeView controls)</i> <a><b>\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Shows items in report view mode. This mode shows items in\n            inverse \"N\" mode. That means: the first item starts at the upper-left\n            corner of the control, then the next item comes below it. This mode\n            allows subitems, that describe items, to appear with header\n            items for the columns used to describe what each subitem is. Header\n            items can added with <i>HeaderItems</i> key. Also, <i>HeaderAlign</i>\n            aligns columns for each header item and <i>HeaderWidth</i> adjusts the\n            width for each column. This mode uses images from the <i>SmallImageList</i>\n            for the items images. An item image goes to the left of the label.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-TrackBar\");</script>\n          TrackBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-TrackBar-NOTICKS\");</script>\n            NO_TICKS\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to don't show ticks on the control.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-TrackBar-VSCROLL\");</script>\n            VSCROLL\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to be vertically orientated.</p>\n            <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 2</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-MonthCalendar\");</script>\n          MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n          <!-- First Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-MonthCalendar-NOTODAY\");</script>\n            NOTODAY\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to do not display the today's date at the bottom of\n            the control and its red circle.</p>\n            <p class=\"tm\"><b>Internet Explorer 3.0 or above required.</b><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n          <!-- Next Sub-Sub-Sub-Sub-Item -->\n\n          <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Flags-MonthCalendar-WEEKNUMBERS\");</script>\n            WEEKNUMBERS\n          <script type=\"text/javascript\">WriteTitleEnd();</script>\n          <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n            <p class=\"bm\">Makes the control to display week numbers (1-52) to the left of each\n            row of days. Week 1 is defined as the first week that contains at least\n            four days.</p>\n            <p class=\"tm\"><b>Internet Explorer 3.0 or above required.</b><br />\n            <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 3</i></p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n        <b>Supported by: </b><i>InstallOptions 1.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify\");</script>\n        Notify</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Causes InstallOptionsEx to call your NSIS custom page validation/leave\n        function whenever the control's selection changes depending on your choice of\n        notification flags.</p>\n        <p>Your validation/leave function can read the <i>State</i> value accompanied with <i>Notify</i>\n        value from the <i>\"Settings\"</i> section to determine which control caused the notification\n        resp. what notification did it receive of those you chose in the field section\n        <i>Notify</i> value, if any, and perform some appropriate action followed by an <i>Abort</i>\n        instruction (to tell NSIS to return back to the page).\n        <p>Each notification flag should be separated with a | character, and you\n        should be careful not to put any spaces around the | character.</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONCLICK\");</script>\n          ONCLICK</b></a> <i>(Only Label, Icon, Bitmap, Link, CheckBox, RadioButton, Button, ListView, TreeView, RichText)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user clicks the control. If used with\n          <i>ONDBLCLICK</i>, only single clicks will be considered from this notification\n          flag.</p>\n\n          <p>For <i>RichText</i> controls only: This notification flag notifies when the user\n          clicks a link in a document.\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONRCLICK\");</script>\n          ONRCLICK</b></a> <i>(Only ListView/TreeView)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user right-clicks the control.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 2</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONDBLCLICK\");</script>\n          ONDBLCLICK</b></a> <i>(Only Label, Icon, Bitmap, Link, CheckBox, RadioButton, Button, ListBox, ListView, TreeView)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user double-clicks the control.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONRDBLCLICK\");</script>\n          ONRDBLCLICK</b></a> <i>(Only ListView)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user right-double-clicks the control.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONSTART\");</script>\n          ONSTART</b></a> <i>(Only Animation)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the control starts to play an animation. An exception is when it starts for the first time. Not tested.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONSTOP\");</script>\n          ONSTOP</b></a> <i>(Only Animation)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the control stops to play an animation.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONSETFOCUS\");</script>\n          ONSETFOCUS</b></a> <i>(Except Label, Icon, Bitmap, Animation, UpDown, MonthCalendar GroupBox, ProgressBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the control gains focus.\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONKILLFOCUS\");</script>\n          ONKILLFOCUS</b></a> <i>(Except Label, Icon, Bitmap, Animation, UpDown, MonthCalendar, GroupBox, ProgressBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the control loses focus.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONSELFOCUS\");</script>\n          ONSELCHANGE</b></a> <i>(Only UpDown, IPAddress, DropList, ComboBox, DateTime, ListBox, ListView, TreeView, TrackBar, MonthCalendar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user changes the state of the control.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONTEXTCHANGE\");</script>\n          ONTEXTCHANGE</b></a> <i>(Only Text, Password, IPAddress, DropList, ComboBox)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user changes the state of the text on the control (i.e. when writing) after the change appears on screen.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONTEXTUPDATE\");</script>\n          ONTEXTUPDATE</b></a> <i>(Only Text, Password, DropList, ComboBox)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user changes the state of the text on the control (i.e. when writing) before the change appears on screen.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONTEXTSELCHANGE\");</script>\n          ONTEXTSELCHANGE</b></a> <i>(Only RichText)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user changes the state of the text selection on the control.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONTEXTVSCROLL\");</script>\n          ONTEXTVSCROLL</b></a> <i>(Only Text, Password)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user clicks on the vertical scroll bar, or when the user scrolls using the keyboard or mouse wheel.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONTEXTTRUNCATE\");</script>\n          ONTEXTTRUNCATE</b></a> <i>(Only Text, Password)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user tries to enter more characters than the limit estipulated by <i>MaxLen</i> INI key. This does part of the job of <i>ValidateText</i> INI key.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONLISTOPEN\");</script>\n          ONLISTOPEN</b></a> <i>(Only DropList, ComboBox, DateTime)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when a control receives a click on the arrow head on the right side of the control (or left if the dialog is in RTL mode).</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Notify-All-ONLISTCLOSE\");</script>\n          ONLISTCLOSE</b></a> <i>(Only DropList, ComboBox, DateTime)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Notifies when the user closes the list of items shown by the arrow head on the right side of the control (or left if the dialog is in RTL mode).</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-NotifyCursor\");</script>\n        NotifyCursor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the cursor to show when the mouse is over a control with the ONCLICK\n        notification flag. The list is the same as mentioned in the cursor resources into\n        <i>State</i> key for <i>Image</i> controls.\n\n        <p>For <i>RichText</i> controls only: This doesn't work.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>ARROW (Standard arrow cursor).</i><br />\n        <b>Default Value for <i>Link</i> controls only: </b><i>HAND (Hand shaped cursor).</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 4</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-HeaderItems\");</script>\n        HeaderItems</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Generally specifies a list of items separated by pipes (\"|\") to\n        display as column names. The input depends on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-HeaderItems-ListView\");</script>\n          ListView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies a list of items separated by pipes (\"|\") to display\n          as column names when <i>REPORT_VIEW</i> flag is used. If there is more\n          columns than necessary, they will be ignored. If there is less, empty\n          column names will be assigned.</p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-HeaderItemsWidth\");</script>\n        HeaderItemsWidth</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Generally specifies the widths for each column. Each width\n        has to be separated by pipes (\"|\"). The input depends on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-HeaderItemsWidth-ListView\");</script>\n          ListView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the widths in pixels for each column when\n          <i>REPORT_VIEW</i> flag is used. Each width has to be separated by pipes\n          (\"|\"). If there is more widths than necessary, they will be ignored. If\n          there is less, default is 100 pixels.</p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>100 pixels for each column with no\n          width assigned.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-HeaderItemsAlign\");</script>\n        HeaderItemsAlign</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Generally specifies an alignment for each column. Each alignment\n        has to be separated by pipes (\"|\"). The input depends on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-HeaderItemsAlign-ListView\");</script>\n          ListView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the horizontal alignments (<i>LEFT</i> or <i>RIGHT</i>)\n          for each column when <i>REPORT_VIEW</i> flag is used. Each aligment has\n          to be separated by pipes (\"|\"). The first column cannot have a custom\n          alignment (OS limitation). If there is more aligments than necessary,\n          they will be ignored. If there is less, default is <i>LEFT</i>.\n          <i>RTL</i> INI key from \"Settings\" INI section inverts this\n          value.</p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>LEFT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-StateImageList\");</script>\n        StateImageList</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Generally specifies a list of images for the state of an item,\n        but this could change depending on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-StateImageList-ListView\");</script>\n          ListView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If <i>CHECKBOXES</i> flag is specified, this <b>has</b> to\n          specify the path to a bitmap (.bmp) containing 6 16x16 pixels long state\n          images. Those are listed below in order:</p>\n          <ul>\n          <li>Nothing;</li>\n          <li>Unchecked;</li>\n          <li>Checked;</li>\n          <li>Intermediate or grayed out (Not used);</li>\n          <li>Disabled and unchecked;</li>\n          <li>Disabled and checked.</li>\n          </ul>\n          <p>Mask color for transparency is #FF00FF (format #RRGGBB). Total bitmap size\n          is limited to 96x16 pixels. This can use the same graphics used by the\n          NSIS' instruction \"CheckBitmap\". This type of image is displayed when:</p>\n          <ul>\n          <li><i>ICON_VIEW</i> flag is not specified and <i>SmallImageList</i> key is specified: on the left of an item icon;</li>\n          <li><i>ICON_VIEW</i> flag is not specified and <i>SmallImageList</i> key is not specified: on the left of an item label;</li>\n          <li><i>ICON_VIEW</i> flag is specified: behind the top-left corner of an item icon.</li></p>\n          </ul>\n          <p class=\"tm\"><b>Required by flags: </b>CHECKBOXES<i>.</i><br />\n          <b>Default Value: </b><i>None.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-StateImageList-TreeView\");</script>\n          TreeView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If <i>CHECKBOXES</i> flag is specified, this <b>has</b> to\n          specify the path to a bitmap (.bmp) containing 6 16x16 pixels long state\n          images. Those are listed below in order:</p>\n          <ul>\n          <li>Nothing or focus rectangle;</li>\n          <li>Unchecked;</li>\n          <li>Checked;</li>\n          <li>Intermediate or grayed out;</li>\n          <li>Disabled and unchecked;</li>\n          <li>Disabled and checked.</li>\n          </ul>\n          Mask color for transparency is #FF00FF (format #RRGGBB). Total bitmap size\n          is limited to 96x16 pixels. This can use the same graphics used by the\n          NSIS' instruction \"CheckBitmap\". This type of image is displayed on the\n          left of an item's label.</p>\n\n          <p class=\"tm\"><b>Required by flags: </b>CHECKBOXES<i>.</i><br />\n          <b>Default Value: </b><i>None.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SmallImageList\");</script>\n        SmallImageList</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Generally specifies a list of 16x16px images for items,\n        but this could change depending on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SmallImageList-ListView\");</script>\n          ListView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If a flag for any view except for <i>ICON_VIEW</i> flag is specified, this\n          specifies the path to a bitmap (.bmp) containing 16x16 pixels images for\n          all items. Mask color for transparency is #FF00FF (format #RRGGBB).\n          This type of image is displayed between the state image and the label of an item.</p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>None.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-LargeImageList\");</script>\n        LargeImageList</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Generally specifies a list of 32x32px images for items,\n        but this could change depending on the control type:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-LargeImageList-ListView\");</script>\n          ListView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If <i>ICON_VIEW</i> flag is specified, specifies the path to a\n          bitmap (.bmp) containing 32x32 pixels large state images for all items. Mask\n          color for transparency is #FF00FF (format #RRGGBB). This type of image is\n          displayed above an item label.</p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>None.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 3</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align\");</script>\n        Align</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">This specifies flags for the horizontal alignment of controls. Only\n        one of the flags below can be used:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align-LEFT\");</script>\n          LEFT\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align-CENTER\");</script>\n          CENTER\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align-RIGHT\");</script>\n          RIGHT\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p>These below are controls that support some or all of the flags above. Flags\n        can be utilized differently from control to control:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align-CheckBox/RadioButton\");</script>\n          CheckBox/RadioButton\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the button to the custom aligment; left or right\n          of the text. <i>RTL</i> INI key from \"Settings\" INI section inverts\n          this value.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>LEFT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align-UpDown\");</script>\n          UpDown\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the control to the custom aligment; left or right\n          of a buddy control. This has no effect if <i>Text</i> INI key is not\n          used. <i>RTL</i> INI key from \"Settings\" INI section inverts this\n          value.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>RIGHT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align-DateTime\");</script>\n          DateTime\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the month calendar to the custom alignment; to the\n          left or right margin of the control. This has no effect if <i>UPDOWN</i> flag\n          from <i>Flags</i> INI key is specified. <i>RTL</i> INI key\n          from \"Settings\" INI section inverts this value.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>LEFT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-Align-TrackBar\");</script>\n          TrackBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the ticks to the custom alignment; to the left, both\n          ends (<i>CENTER</i>), or right margin of the control. This has no effect if\n          <i>VSCROLL</i> flag from <i>Flags</i> INI key is not specified.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>CENTER</i>, <i>RIGHT</i> flags.<br />\n          <b>Required flag: </b><i>VSCROLL from Flags INI key.</i><br />\n          <b>Default Value: </b><i>RIGHT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-VAlign\");</script>\n        VAlign</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">This specifies flags for the vertical alignment of controls. Only\n        one of the flags below can be used:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-VAlign-TOP\");</script>\n          TOP\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-VAlign-CENTER\");</script>\n          CENTER\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-VAlign-BOTTOM\");</script>\n          BOTTOM\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p>These below are controls that support some or all of the flags above. Flags\n        can be utilized differently from control to control:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-VAlign-TrackBar\");</script>\n          TrackBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the ticks to the custom alignment; to the\n          top, both ends (<i>CENTER</i>), or bottom margin of the control.</p>\n          <p class=\"tm\"><b>Supports: </b><i>TOP</i>, <i>CENTER</i>, <i>BOTTOM</i> flags.<br />\n          <b>Default Value: </b><i>BOTTOM.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign\");</script>\n        TxtAlign</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">This specifies flags for the horizontal alignment of text on\n        controls. Only one of the flags below can be used:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-LEFT\");</script>\n          LEFT\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-CENTER\");</script>\n          CENTER\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-RIGHT\");</script>\n          RIGHT\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-JUSTIFY\");</script>\n          JUSTIFY\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory. Reserved for future use.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p>These below are controls that support some or all of the flags above. Flags\n        can be utilized differently from control to control:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-Label/GroupBox/Link\");</script>\n          Label/GroupBox/Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the text to the custom aligment; to the left, center,\n          or right margin of the control. <i>RTL</i> INI key from \"Settings\"\n          INI section inverts this value.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>CENTER</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>LEFT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-CheckBox/RadioButton\");</script>\n          CheckBox/RadioButton\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the text to the custom aligment; left or right\n          of the button. <i>RTL</i> INI key from \"Settings\" INI section inverts\n          this value.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>LEFT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-Button\");</script>\n          Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the text to the custom aligment; to the left, center,\n          or right margin of the control. <i>RTL</i> INI key from \"Settings\"\n          INI section inverts this value.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>CENTER</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>CENTER.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-Text/Password\");</script>\n          Text/Password\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the text to the custom aligment; to the left, center,\n          or right margin of the control. <i>RTL</i> INI key from \"Settings\"\n          INI section inverts this value.</p>\n          <p class=\"tm\"><b>Windows 95, Windows NT 4.0 and earlier require: <i>MULTILINE</i>\n          flag from <i>Flags</i> INI key.</b><br />\n          <b>Supports: </b><i>LEFT</i>, <i>CENTER</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>LEFT.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtAlign-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the text of items and text box to the custom aligment;\n          to the left, center, or right margin of items and control. <i>RTL</i> INI\n          key from \"Settings\" INI section inverts this value.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>CENTER</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>CENTER.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtVAlign\");</script>\n        TxtVAlign</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">This specifies flags for the vertical alignment of text on\n        controls. Only one of the flags below can be used:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtVAlign-TOP\");</script>\n          TOP\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtVAlign-CENTER\");</script>\n          CENTER\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtVAlign-BOTTOM\");</script>\n          BOTTOM\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtVAlign-JUSTIFY\");</script>\n          JUSTIFY\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Self-explanatory. Reserved for future use.</p>\n          <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p>These below are controls that support some or all of the flags above. Flags\n        can be utilized differently from control to control:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtVAlign-Button\");</script>\n          Button\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Positions the text to the custom aligment; to the top, center,\n          or bottom margin of the control.</p>\n          <p class=\"tm\"><b>Supports: </b><i>LEFT</i>, <i>CENTER</i>, <i>RIGHT</i> flags.<br />\n          <b>Default Value: </b><i>CENTER.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-TxtColor\");</script>\n        TxtColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtColor-Label/Text/Password\");</script>\n          Label/Text/Password\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's text default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtColor-ProgressBar\");</script>\n          ProgressBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the color of the indicator bar. This can only be used when not\n          using Windows themes. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Selected Items\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-TxtColor-Link\");</script>\n          Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0xFF0000 (Blue).</i><br />\n          <b>Supported by: </b><i>InstallOptions 2.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtColor-DropList/ComboBox/ListBox/ListView/TreeView\");</script>\n          DropList/ComboBox/ListBox/ListView/TreeView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text when an item is not selected.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's text default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtColor-DateTime/MonthCalendar\");</script>\n          DateTime/MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the normal days text in the\n          calendar of the control. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's text default color for \"ToolTip\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.2, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-BgColor\");</script>\n        BgColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-BgColor-Label/Text/Link\");</script>\n          Label/Text/Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the control. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current background color.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-BgColor-ProgressBar\");</script>\n          ProgressBar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the color of the background part of the bar. This can only be\n          used when not using Windows themes. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-BgColor-DropList/ComboBox/ListBox/ListView/TreeView\");</script>\n          DropList/ComboBox/ListBox/ListView/TreeView\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the text when an item is not selected.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-BgColor-DateTime/MonthCalendar\");</script>\n          DateTime/MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the month calendar. Format: 0xBBRRGG\n          (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"ToolTip\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelTxtColor\");</script>\n        SelTxtColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelTxtColor-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text when an item is selected.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's text default color for \"Selected Item\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelTxtColor-DateTime/MonthCalendar\");</script>\n          DateTime/MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the selected text and title text of the\n          calendar. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's text default color for \"Selected Items\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelBgColor\");</script>\n        SelBgColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelBgColor-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the text when an item is selected.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Selected Items\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelBgColor-DateTime/MonthCalendar\");</script>\n          DateTime/MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the month calendar selected text and\n          title text. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Selected Items\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtColor\");</script>\n        DisTxtColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtColor-Label/Text\");</script>\n          Label/Text\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text when the control is disabled.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's grayed text color (not configurable).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtColor-Link\");</script>\n          Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text when the control is disabled.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0x640000 (Dark Blue)</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtColor-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text when an item is not selected and\n          the control is disabled. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's grayed text color (not configurable).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisBgColor\");</script>\n        DisBgColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisBgColor-Label/Text/Link\");</script>\n          Label/Text/Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the text when the control is disabled.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current background color.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisBgColor-DropList/ComboBox\");</script>\n          DropList/ComboBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the text when an item is not selected\n          and the control is disabled. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's grayed background color (not configurable).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisBgColor-ListBox\");</script>\n          ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the text when an item is not selected\n          and the control is disabled. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisSelTxtColor\");</script>\n        DisSelTxtColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisSelTxtColor-ListBox\");</script>\n          ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text when an item is selected and\n          the control is disabled. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0xFFFFFF (White).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisSelBgColor\");</script>\n        DisSelBgColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisSelBgColor-ListBox\");</script>\n          ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the text when an item is selected and\n          the control is disabled. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0xAAAAAA (Light Gray).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MonthOutColor\");</script>\n        MonthOutColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MonthOutColor-MonthCalendar\");</script>\n          MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the outside part of the month calendar.\n          This is only used when you specify a bigger control size than the calendar\n          itself. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MonthTrailingTxtColor\");</script>\n        MonthTrailingTxtColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-MonthTrailingTxtColor-MonthCalendar\");</script>\n          MonthCalendar\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the days from the last or next\n          month being shown. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's grayed text color (not configurable).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtShwColor\");</script>\n        TxtShwColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtShwColor-Label/Link\");</script>\n          Label/Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the shadow. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>No shadow.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-TxtShwColor-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the shadow when an item is not selected. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>No shadow.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelTxtShwColor\");</script>\n        SelTxtShwColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-SelTxtShwColor-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the shadow when an item is selected.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>No shadow.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtShwColor\");</script>\n        DisTxtShwColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtShwColor-Label\");</script>\n          Label\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the shadow when the control is disabled.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtShwColor-Link\");</script>\n          Link\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the shadow when the control is disabled.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>0xFFFFFF (White).</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisTxtShwColor-DropList/ComboBox/ListBox\");</script>\n          DropList/ComboBox/ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the shadow when an item is not\n          selected and when the control is disabled. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>No shadow.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisSelTxtShwColor\");</script>\n        DisSelTxtShwColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-DisSelTxtShwColor-ListBox\");</script>\n          ListBox\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground text color of the shadow when an item is selected\n          and when the control is disabled. Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>No shadow.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 9</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ReadOnlyTxtColor\");</script>\n        ReadOnlyTxtColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ReadOnlyTxtColor-Text/Password\");</script>\n          Text/Password\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the foreground color of the text when the control has the read-only flag set.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's text default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ReadOnlyBgColor\");</script>\n        ReadOnlyBgColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ReadOnlyBgColor-Text/Password/RichText\");</script>\n          Text/Password/RichText\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Specifies the background color of the text when the control has the read-only flag set.\n          Format: 0xBBRRGG (hexadecimal).</p>\n          <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"Window\".</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontName\");</script>\n        FontName</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontName-All\");</script>\n          All Controls</b></a> <i>(Except Icon, Bitmap, Animation, ProgressBar, TrackBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Sets the control font. It has to be a font name &lt;= 32 characters.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current font.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 7</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontHeight\");</script>\n        FontHeight</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontHeight-All\");</script>\n          All Controls</b></a> <i>(Except Icon, Bitmap, Animation, ProgressBar, TrackBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Sets the control font height in points.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current font.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontWidth\");</script>\n        FontWidth</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontWidth-All\");</script>\n          All Controls</b></a> <i>(Except Icon, Bitmap, Animation, ProgressBar, TrackBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Sets the control font average character width in pixels.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current font.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontBold\");</script>\n        FontBold</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontBold-All\");</script>\n          All Controls</b></a> <i>(Except Icon, Bitmap, Animation, ProgressBar, TrackBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If set to 1, this makes the text to become bold.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current font.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontItalic\");</script>\n        FontItalic</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontItalic-All\");</script>\n          All Controls</b></a> <i>(Except Icon, Bitmap, Animation, ProgressBar, TrackBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If set to 1, this makes the text to become italic.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current font.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontUnderline\");</script>\n        FontUnderline</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-FontUnderline-All\");</script>\n          All Controls</b></a> <i>(Except Icon, Bitmap, Animation, ProgressBar, TrackBar)</i> <a><b>\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">If set to 1, this makes the text to have an underline.</p>\n          <p class=\"tm\"><b>Default Value: </b><i>Window's current font.</i><br />\n          <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 6</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipText\");</script>\n        ToolTipText</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Determines the text of a control tooltip. It is required to make show a\n        tooltip.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 8</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipFlags\");</script>\n        ToolTipFlags</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">This specifies additional flags specially for a control tooltip. Each\n        tooltip flag should be separated with a | character:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipFlags-NOALWAYSTIP\");</script>\n          NOALWAYSTIP\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=pm>Makes the tooltip to do not show up when the window doesn't have focus.</p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipFlags-BALLOON\");</script>\n          BALLOON\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Makes the tooltip to look like a balloon with a steam pointing to the\n          control. Enables the use of <i>ToolTipTitle</i> and <i>ToolTipIcon</i>.</p>\n          <p class=\"tm\"><b>Internet Explorer 5.0 or above required.</b></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipFlags-NOANIMATE\");</script>\n          NOANIMATE\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Removes the tooltip sliding animation.</p>\n          <p class=\"tm\"><b>Internet Explorer 5.0 or above required.</b></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipFlags-NOFADE\");</script>\n          NOFADE\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Removes the tooltip fade animation.</p>\n          <p class=\"tm\"><b>Internet Explorer 5.0 or above required.</b></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipFlags-NOPREFIX\");</script>\n          NOPREFIX\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=pm>Prevents the system from stripping the ampersand (&amp;) character from a string.</p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Default Value: </b><i>None</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 8</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipWidth\");</script>\n        ToolTipWidth</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Determines the maximum width of the tooltip. If the text passes from this\n        limit it is automatically broken into multiple lines. This limit can be\n        surpassed if a word is bigger than the maximum width indicated here.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>300.</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 8</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipTxtColor\");</script>\n        ToolTipTxtColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the foreground color of the tooltip text and the tooltip border.\n        Format: 0xBBRRGG (hexadecimal).</p>\n        <p class=\"tm\"><b>Default Value: </b><i>System's text default color for \"ToolTip\".</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 8</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipBgColor\");</script>\n        ToolTipBgColor</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the background color of the tooltip. Format: 0xBBRRGG (hexadecimal).</p>\n        <p class=\"tm\"><b>Default Value: </b><i>System's background default color for \"ToolTip\".</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 8</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipIcon\");</script>\n        ToolTipIcon</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the icon of a control tooltip that has the <i>BALLOON</i> flag. The\n        value can be one of the following 16 by 16 pixels icon resources or an empty value\n        meaning no icon:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipIcon-INFORMATION\");</script>\n          INFORMATION\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Shows an icon with an exclamation mark inside a white balloon.</p>\n          <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipIcon-EXCLAMATION\");</script>\n          EXCLAMATION\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Shows an icon with an exclamation mark inside a yellow triangle.</p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <!-- Next Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipIcon-STOP\");</script>\n          STOP\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n          <p class=\"bm\">Shows an icon with the letter \"X\" inside a red circle.</p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Default Value: </b><i>\"\" (No icon).</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.2 beta 5</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"Field-ToolTipTitle\");</script>\n        ToolTipTitle</b></a> <i>(Input)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Specifies the title text of a tooltip with <i>BALLOON</i> flag. It appears\n        bold above the normal tooltip text. If empty, no title will appear.</p>\n        <p class=\"tm\"><b>Default Value: </b><i>\"\" (No title).</i><br />\n        <b>Supported by: </b><i>InstallOptionsEx 2.4.1 beta 8</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"Field-HWND\");</script>\n        HWND</b></a> <i>(Output)</i> <a><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">After initDialog returns, this will contain the HWND of the control created by this field. It can be used instead of FindWindow and GetDlgItem.</p>\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.4.4, InstallOptionsEx 2.4.5 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <!-- Next Item -->\n\n  <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse\");</script>\n    How to Use\n  <script type=\"text/javascript\">WriteTitleEnd();</script>\n  <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n    <!-- First Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step1\");</script>\n      Step 1: Using With Modern UI 1\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p>As this is a different module than the original InstallOptions, none of\n      the commands provided by Modern UI supports InstallOptionsEx.dll, but you can\n      make a \"trick\" by renaming this dll to InstallOptions.dll. But remember, if you\n      use mixed Modern UI with these commands below, you'll have to call like you would\n      for the normal InstallOptions.dll. Both dlls calling are similar. If you do this\n      above, you can see instructions from <a target=\"_blank\" href=\"../Modern%20UI/Readme.html#customPages\">\n      Modern UI documentation</a>. However, It is not garantee that custom Modern UI pages will work\n      correctly with this plugin.</p>\n      <p class=pm>Two versions of the plugin are available: a legacy version and a version using the new NSIS plugin API.</p>\n      <li>The legacy version can NOT be used as a replacement of the original InstallOptions.dll with Modern UI since NSIS 2.42 \n      because they removed the /NOULOAD flag of the initDialog functions.</li>\n      <li>The new API version can be used with Modern UI since NSIS 2.42 and can not work with prior versions.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step1\");</script>\n      Step 1: Using With UltraModernUI\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=pm>UltraModernUI, since version 1.00 beta 2, support natively two plug-ins to displays custom pages, the original InstallOptions and InstallOptionsEx.</p>\n      <p>If you wan't to use InstallOptionEx Instead of the original IntallOptions plug-in, you only have to use the UMUI_USE_INSTALLOPTIONSEX define in your scripts.</p>\n      <p>UltraModernUI can automatically convert, on the fly, your custom InstallOptions INI files into compatibles InstallOptionsEx INI.</p>\n      <p>One the other hand, UltraModernUI can automatically skin your custom pages by using the MUI_INSTALLOPTIONS_DISPLAY macro.</p>\n      <p>You can see instructions from <a target=\"_blank\" href=\"../UltraModernUI/Readme.html#customPages\"> UltraModern UI documentation</a>.</p>\n      <p class=pm>Two versions of the plugin are available: a legacy version and a version using the new NSIS plugin API.</p>\n      <li>The legacy version can be used with UltraModern UI and all NSIS versions.</li>\n      <li>The new API version can NOT be used with NSIS versions prior to 2.42.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step2\");</script>\n      Step 2: Extract the INI File\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">First, you have to extract the INI files for the dialogs in the\n      .onInit function:</p>\n      <pre class=\"tm\">  Function .onInit\n\n    InitPluginsDir\n    File /oname=$PLUGINSDIR\\test.ini test.ini\n\n  FunctionEnd</pre>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step3\");</script>\n      Step 3: Call the DLL\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">You can call InstallOptionsEx in a page function, check the\n      <a target=\"_blank\" href=\"../../Docs/Chapter4.html#4.5\">NSIS documentation</a> for\n      information about the page system. Example:</p>\n      <pre>  Page custom SetCustom ValidateCustom</pre>\n      <p>The InstallOptionsEx DLL has three functions:</p>\n\n      <!-- First Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step4-make_unicode\");</script>\n        make_unicode</b> <i>\"ini_file\"</i><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Convert an ANSI INI file to the UNICODE charset. Parameters:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step3-dialog-ini_file\");</script>\n          \"ini_file\"\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the location where the INI file that will be used by\n          the plugin to create the dialog is. This can be:\n\n          <li>Relative path from the current plugin location. The path has to be without \".\" or \"..\". (i.e. \"test.ini\" = \"$PLUGINSDIR\\test.ini\")</li>\n          <li>Relative path from the current installer location. The path has to be with \".\" or \"..\". (i.e. \".\\test.ini\" = \"$EXEDIR\\test.ini\")</li>\n          <li>Absolute path. (i.e. \"C:\\test.ini\")</li></p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>No default value.</i><br />\n          <b>Supported by: </b><i>InstallOptions 2.47 Unicode Only, InstallOptionsEx 2.4.5 beta 3 Unicode Only</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 2.47 Unicode Only, InstallOptionsEx 2.4.5 beta 3 Unicode Only</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step3-dialog\");</script>\n        dialog</b> <i>\"ini_file\"</i><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Creates the dialog immediately. Parameters:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step3-dialog-ini_file\");</script>\n          \"ini_file\"\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the location where the INI file that will be used by\n          the plugin to create the dialog is. This can be:\n\n          <li>Relative path from the current plugin location. The path has to be without \".\" or \"..\". (i.e. \"test.ini\" = \"$PLUGINSDIR\\test.ini\")</li>\n          <li>Relative path from the current installer location. The path has to be with \".\" or \"..\". (i.e. \".\\test.ini\" = \"$EXEDIR\\test.ini\")</li>\n          <li>Absolute path. (i.e. \"C:\\test.ini\")</li></p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>No default value.</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step3-initDialog\");</script>\n        initDialog</b> <i>\"ini_file\"</i><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Creates the dialog in memory and doesn't show it. Parameters:</p>\n\n        <!-- First Sub-Sub-Sub-Item -->\n\n        <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step3-initDialog-ini_file\");</script>\n          \"ini_file\"\n        <script type=\"text/javascript\">WriteTitleEnd();</script>\n        <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n          <p class=\"bm\">Specifies the location where the INI file that will be used by\n          the plugin to create the dialog is. This can be:\n\n          <li>Relative path from the current plugin location. The path has to be without \".\" or \"..\". (i.e. \"test.ini\" = \"$PLUGINSDIR\\test.ini\")</li>\n          <li>Relative path from the current installer location. The path has to be with \".\" or \"..\". (i.e. \".\\test.ini\" = \"$EXEDIR\\test.ini\")</li>\n          <li>Absolute path. (i.e. \"C:\\test.ini\")</li></p>\n\n          <p class=\"tm\"><b>Default Value: </b><i>No default value.</i><br />\n          <b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n        <script type=\"text/javascript\">WriteTextEnd();</script>\n\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step3-show\");</script>\n        show\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n        <p class=\"bm\">Shows a previously dialog created in memory by the DLL function \"initDialog\".\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptions 1.0, InstallOptionsEx 2.4.1 beta 1</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"HowToUse-Step4-setFocus\");</script>\n        setFocus</b> <i>\"HWND\"</i><b>\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Set the focus on the specified control in parameter but prefer to use the FOCUS flag if you can.<br />\n        This function was designed to be employed in your leave script functions (when the control is already shown).</p>\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.5 beta 2</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n      <!-- Next Sub-Sub-Item -->\n\n      <script type=\"text/javascript\">WriteTitleStart(\"IOEx\", \"HowToUse-Step4-skipValidation\");</script>\n        skipValidation\n      <script type=\"text/javascript\">WriteTitleEnd();</script>\n      <script type=\"text/javascript\">WriteTextStart(\"IOEx\");</script>\n        <p class=\"bm\">Skip the validation of the page.<br />\n        This function was designed if a page contains fields with MinLen or MaxLen and ValidateText attributes, you can go to the next page by skipping the text validation.</p>\n        <p class=\"tm\"><b>Supported by: </b><i>InstallOptionsEx 2.4.5 beta 2</i></p>\n      <script type=\"text/javascript\">WriteTextEnd();</script>\n\n\n      <p>Usually, you only need to use the dialog function:</p>\n      <pre>  Function SetCustom ;FunctionName defined with Page command\n\n    ;Display the InstallOptionsEx dialog\n    InstallOptionsEx::dialog $PLUGINSDIR\\test.ini\n    Pop $HWND\n\n  FunctionEnd</pre>\n      <p class=\"tm\">Note that the page can be updated by changing anything on the INI file.\n      That means, you should secure it in difficult places so that no one can\n      change it when you're not expecting it. But this will probably change in future\n      versions.</p>\n\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step4\");</script>\n      Step 4: Get the Output\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">To get the input of the user, read the State value of a Field\n      using ReadINIStr:</p>\n      <pre>  ReadINIStr $R0 \"$PLUGINSDIR\\test.ini\" \"Field 1\" \"State\"</pre>\n      <p><a target=\"_blank\" name=\"escaping\" id=\"escaping\"></a><b>Note:</b></p>\n      <p>Some InstallOptionsEx values are escaped to allow characters to\n      be used that are not normally valid in INI file values. For new lines,\n      carriage return, line feed and back-slash, the affected values are:</p>\n\n      <ul>\n      <li>The <i>ValidateText</i> field.</li>\n      <li>The <i>Text</i> value of <i>Label</i>, <i>Link</i>, <i>DropList</i>, <i>ComboBox</i>\n      <i>DropList</i> and <i>ListView</i> (except Tab character) fields.</li>\n      <li>The <i>State</i> value of <i>Text</i> fields that have the MULTILINE flag.</li>\n      <li>The <i>ListItems</i> value of Button fields that have the DIRREQUEST flag.</li>\n      </ul>\n\n      For \"\\|\", the affected values are:\n\n      <ul>\n      <li>All list based values that don't use numbers alone of <i>ListBox</i>, <i>DropList</i>,\n      <i>ComboBox</i>, <i>ListView</i> and <i>TreeView</i> controls.</li>\n      </ul>\n\n      For \"\\{\" and \"\\}\", the affected values are:\n\n      <ul>\n      <li>All list based values that don't use numbers alone of <i>ListView</i> and <i>TreeView</i> controls.</li>\n      </ul>\n\n      <p>Every value of a key is affected by variables\n      which are updated to the time the page was reserved or showed\n      without reserving.</p>\n\n      <p>Escape characters and variables:</p>\n\n      <ul>\n      <li><b>$0-$9, $R0-$R9</b> - Variables</li>\n      <li><b>\\r</b> - Carriage return (ASCII 13)</li>\n      <li><b>\\n</b> - Line feed (ASCII 10)</li>\n      <li><b>\\t</b> - Tab (ASCII 9)</li>\n      <li><b>\\\\</b> - Back-slash</li>\n      <li><b>\\|</b> - Pipe</li>\n      <li><b>\\{</b> - Start curly bracket</li>\n      <li><b>\\}</b> - End curly bracket</li>\n      </ul>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step5\");</script>\n      Step 5: Validate the Output\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">If you want to validate the input on the page, for example, you\n      want to check whether the user has filled in a textbox, use the\n      leave function of the Page command and Abort when the validation\n      has failed:</p>\n      <pre class=\"tm\">  Function ValidateCustom\n\n    ReadINIStr $R0 \"$PLUGINSDIR\\test.ini\" \"Field 1\" \"State\"\n    StrCmp $0 \"\" 0 +3\n      MessageBox MB_ICONEXCLAMATION|MB_OK \"Please enter your name.\"\n      Abort\n\n  FunctionEnd</pre>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step6\");</script>\n      Step 6: Return Value\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">After you have called the DLL, InstallOptionsEx adds one string to\n      the stack, with one of the following values:</p>\n      <ul>\n      <li>success - The user has pressed the Next button</li>\n      <li>back - The user has pressed the Back button</li>\n      <li>cancel - The user has pressed the Cancel button</li>\n      <li>error - An error has occurred, the dialog cannot be\n      displayed.</li>\n      </ul>\n      <p>Usually, you don't need to check this value, but you still have\n      to remove it from the stack (have a look at the example above).</p>\n      <p class=\"tm\">You only have to check this value if you need something really\n      special, such as doing something when the user pressed the Back\n      button.</p>\n\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"HowToUse-Step6\");</script>\n      Step 7: Fonts and colors\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <p class=\"bm\">To customize fonts or colors on InstallOptions dialogs, the initDialog and show plugin functions can be used.</p>\n      <p class=\"bm\">InstallOptionsEx::initDialog creates the dialog in memory, but does not show it. After inserting this macro, you can set the fonts and colors, and then insert InstallOptionsEx::show to show the dialog.</p>\n      <p class=\"bm\">The InstallOptionsEx::initDialog function also pushes the HWND of the custom dialog to the stack. Control HWND's are available for each control in the HWND entry of the corresponding field in the INI file.</p>\n      <p class=\"tm\">Example of using a custom font:</p>\n      <pre class=\"tm\">  Var HWND\n  Var DLGITEM\n  Var FONT\n\n  Function FunctionName ;FunctionName defined with Page command\n\n    InstallOptionsEx::initDialog \"ioFile.ini\"\n    Pop $HWND ;HWND of dialog\n    \n    ReadIniStr $DLGITEM \"$PLUGINSDIR\\ioFile.ini\" \"Field 1\" \"HWND\"\n    \n    ;$DLGITEM contains the HWND of the first field\n    CreateFont $FONT \"Tahoma\" 10 700 \n    SendMessage $DLGITEM ${WM_SETFONT} $FONT 0\n        \n    InstallOptionsEx::show\n\n  FunctionEnd</pre>\n\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <!-- Next Item -->\n\n  <script type=\"text/javascript\">WriteTitleStart(\"\", \"ReserveFiles\");</script>\n    Reserve Files\n  <script type=\"text/javascript\">WriteTitleEnd();</script>\n  <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n    <p class=\"bm\">If you are using BZIP2 (solid) compression, it's important that\n    files which are being extracted on initialization or page functions\n    are located before other files in the data block, because this will\n    make your installer faster.</p>\n    <p>If there are File commands in your sections or functions above\n    the init- or page functions, add ReserveFile commands above your\n    sections and functions:</p>\n    <pre class=\"tm\">  ReserveFile \"test.ini\"\n  ReserveFile \"${NSISDIR}\\Plugins\\InstallOptionsEx.dll\"</pre>\n  <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <!-- Next Item -->\n\n  <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist\");</script>\n    Versions History\n  <script type=\"text/javascript\">WriteTitleEnd();</script>\n  <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n\n    <!-- First Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.5 beta 3\");</script>\n      IOEx DLL version 2.4.5 beta 3</b></a> <i>(27/Aug/2016)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      A big thank to Tallmaris (Leandro Tramma) for the initial unicode compatibility.<br />\n      <li>Added: Full unicode support;</li>\n      <li>Added: make_unicode dll function for Unicode build: Convert an ANSI INI file to the UNICODE charset;</li>\n      <li>Applied patches from the original InstallOptions source repository.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.5 beta 2\");</script>\n      IOEx DLL version 2.4.5 beta 2</b></a> <i>(13/Jun/2009)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      A big thank to Scott (alias sheik), Daz (alias Dro) and Phalanger for there help to fix bugs of this version.<br />\n      <li>Compiled with VisualStudio 2008. Smaller dll.</li>\n      <li>Added: setFocus dll function: Set the focus on the specified control in parameter. It was designed to be used in your leave script functions.</li>\n      <li>Added: skipValidation dll function: If a page contains fields with MinLen or MaxLen and ValidateText attributes, you can go to the next page by skipping the text validation.</li>\n      <li>Added: New control type VLine and HLine (IO patch #1683189).</li>\n      <li>Fixed: If more than one notify flags is used for a control, any action was notified.</li>\n      <li>Fixed: The fopen_s and sscanf_s functions are used by default instead of fopen and sscanf except if you define NOTUSE_SECURE_FUNCTIONS in the plugin compilation options (VisualStudio 6 only).</li>\n      <li>Fixed: Groupbox and Link controls colors problems.</li>\n      <li>Fixed: A filter key problem for button using the OPEN_FILEREQUEST and the SAVE_FILEREQUEST flags, it did not cut the string in items.</li>\n      <li>Fixed: A problem in the DIRREQUEST that doesn't go to the folder indicated in the RefFields State or in its own State key.</li>\n      <li>Fixed: The Notify=ONCLICK and Notify=ONDBLCLICK didn't work with the Link control.</li>\n      <li>Fixed: Applied IO Patch that kill some compiler warnings under Linux and mingw32.</li>\n      <li>Fixed: Use installer's name for message boxes (IO patch #1661677).</li>\n      <li>Fixed: A memory access violation.</li>\n      <li>Fixed: Transparent icons had a grey background.</li>\n      <li>Link and Button can be used in the same way. It was not cleary indicated in this documentation.</li>\n      <li>The Notify=ONCLICK is not necessary any more for a link or a button using OPEN_FILEREQUEST, SAVE_FILEREQUEST, DIRREQUEST, FONTREQUEST and COLORREQUEST flags to show the dialog. As for if the State key containing something to be executed or opened. Thus the leave function is not called any more unnecessarily.</li>\n      <li>Size optimization: msdn now says SHGetMalloc returns the same allocator CoTaskMemFree uses and a little debugging backs this even on Windows 95 (IO patch).</li>\n      <li>Disable the X button for InstallOptions pages as well when CancelEnabled is used (IO patch).</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.5 beta 1\");</script>\n      IOEx DLL version 2.4.5 beta 1</b></a> <i>(09/Feb/2007)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Compiled with VisualStudio 2005. Fixed warnings and use the secure fopen_s function instead of fopen.</li>\n      <li>Fixed: The selection of a subitem in TreeView returned only the root item.</li>\n      <li>Fixed: Empty items appeared sometimes in TreeView.</li>\n      <li>Fixed: RichText files were not loaded if they were situated in a directory starting with \"n\", \"r\" or \"t\".</li>\n      <li>Fixed: Richtext fields were selected and scrolled down even if they used the READONLY and MULTILINE flags.</li>\n      <li>Fixed: WS_EX_LEFTSCROLLBAR in RTL mode (IO bug #1283528).</li>\n      <li>RichText files are not rewritten any more in the leave function if the READONLY flag is used.</li>\n      <li>Added: VSCROLL flag support for RichText controls.</li>\n      <li>Added: ONCLICK flag by default on Notify key if not specified for Link controls for IO compatibility.</li>\n      <li>Added: HWND entry to the INI file to avoid messy calculations of the correct control id.</li>\n      <li>Added: FOCUS flag for setting focus to a control other than the first (IO patch #1634704).</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.2 beta 5\");</script>\n      IOEx DLL version 2.4.4 beta 2</b></a> <i>(12/Feb/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Fixed: Image controls implementation was coded poorly.</li>\n      <li>Fixed: Dialog box now can be colored (bug introduced IOEx 2.4.1 beta 6).</li>\n      <li>Fixed: Filter key value had last character chop down.</li>\n      <li>Fixed: Filter key value's first item in array is the only one detected.</li>\n      <li>Fixed: Filter key value can overrun the buffer by one byte besides the \"BufferSize\" limit for characters.</li>\n      <li>Added: Ability to convert \"\\\\\" to \"\\\" in lists.</li>\n      <li>Fixed: The ListItems value name for ComboBox and DropList controls can't have the combination \"\\\\\" and \"\\|\". This needs to be verified.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.2 beta 5\");</script>\n      IOEx DLL version 2.4.4 beta 1</b></a> <i>(13/Nov/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Removed GPL'd code from the plug-in. Removed support for GDI+, which in turn, removed newer systems support of .png, .tiff, and .emf files.</li>\n      <li>Added support for the key \"F2\" on <i>TreeView</i> and <i>ListView</i> controls.</li>\n      <li>Fixed the selection of the last item with the \"End\" key in a <i>ListView</i> control without the <i>CHECKBOXES</i> flag and without using <i>LargeImageList</i> INI key.</li>\n      <li>Fixed: When StateImageList points to an invalid file, it still applies the <i>CHECKBOXES</i> flag normally.</li>\n      <li>Fixed: When a label was not changed in TreeView or ListView controls that use the <i>EDITLABELS</i> flags, it was emptied.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.2 beta 5\");</script>\n      IOEx DLL version 2.4.2 beta 5</b></a> <i>(13/Sep/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>RichText</i> control.</li>\n      <li>Added <i>BufferSize</i> key for <i>Settings</i> section. A note though,\n      everything, including <i>Type</i> value for all fields are affected.</li>\n      <li>Added <i>ReadOnlyTxtColor</i> and <i>ReadOnlyBgColor</i> keys for <i>Text</i> and\n      <i>RichText</i> controls.</li>\n      <li>Added <i>ONTEXTSELCHANGE</i> notification flag for <i>RichText</i> controls.</li>\n      <li><i>Bitmap</i>, <i>Icon</i> and <i>Animation</i> controls have now fused together\n      into a control called <i>Image</i>. The old control names are still supported\n      for compatibility.</li>\n      <li><i>Image</i> controls now use GDI+ or OLE when needed. So there are new file\n      types supported: .jpg, .jpeg, .gif (GDI+ or OLE), .png, .tiff, .wmf, .emf\n      (GDI+ only).</li>\n      <li><b>Older INI files braking notice:</b> Renamed icon names for <i>ToolTipIcon</i> key to <i>INFORMATION</i>,\n      <i>EXCLAMATION</i> and <i>STOP</i>, as defined under the icon resources for the\n      <i>State</i> key for <i>Image</i> controls.</li>\n      <li>Added \"\\|\" escape characters for <i>ListBox</i>, <i>DropList</i>, <i>ComboBox</i> controls.\n      This applies to list based keys only.</li>\n      <li>Added \"\\|\", \"\\{\" and \"\\}\" escape characters for <i>ListView</i> and <i>TreeView</i> controls.\n      This applies to list based keys that do not use just numbers only.</li>\n      <li>Fixed internal memory leaks and bugs.</li>\n      <li>For <i>Link</i> and <i>Button</i> controls using <i>DIRREQUEST</i> flag:</li>\n      <ul>\n        <li>Fixed the non-disabling \"OK\" button when a non-folder item was selected (like My Computer).</li>\n        <li>Added ability for the <i>State</i> INI key to specify the initial folder shown in the <i>DIRREQUEST</i> dialog.</li>\n      </ul>\n      <li>Now <i>FONTREQUEST</i> and <i>COLORREQUEST</i> flags for <i>Button</i> and <i>Link</i> controls output the control state\n      even if a value is specified for the <i>RefFields</i> key.</li>\n      <li>Fixed string not being truncated at the maximum buffer size allowed when <i>Text</i> and <i>Password</i>\n      controls returned (IO bug).</li>\n      <li>Fixed <i>Link</i> and <i>Button</i> controls with <i>DIRREQUEST</i> flag: \"|\" character was appended everytime to the end of\n      <i>ListItems</i> key.</li>\n      <li>Corrected the formula to convert pixels into points for <i>Link</i> and <i>Button</i> controls with <i>FONTREQUEST</i> flag.</li>\n      <li>Fixed <i>Link</i> and <i>Button</i> controls <i>State</i> key return value when used with <i>FILE_OPENREQUEST</i> and\n      <i>MULTISELECT</i> flags: String was truncated to the first 1023 characters (1024 w/ the terminator character).</li>\n      <li><i>State</i> INI key for <i>ComboBox</i> controls now uses the text specified for the state if it is not one of the items\n      specified in <i>ListItems</i>.</li>\n      <li><i>HSCROLL</i> and <i>VSCROLL</i> flags won't work anymore if specified for controls that do not support this flag. The effect is simply useless.</li>\n      <li>Re-added <i>EXTENDEDSELCT</i> and <i>REQ_SAVE</i> flags for compatibility purposes with IO.</li>\n      <li>Fixed bugs #<a target=\"_blank\" href=\"http://sourceforge.net/tracker/index.php?func=detail&aid=1287731&group_id=22049&atid=373085\">1287731</a> and #<a target=\"_blank\" href=\"http://sourceforge.net/tracker/index.php?func=detail&aid=1283528&group_id=22049&atid=373085\">1283528</a>.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.2 beta 4\");</script>\n      IOEx DLL version 2.4.2 beta 4</b></a> <i>(3/Aug/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>MUnit</i> key for <i>Settings</i> section and <i>NotifyCursor</i>\n      for <i>Field #</i> section.</li>\n      <li>Re-implemented <i>NumFields</i> from original InstallOptions for compatibility reasons.</li>\n      <li>Added <i>ListView</i> and <i>TreeView</i> controls support for <i>TxtColor</i>\n      and <i>BgColor</i> values.</li>\n      <li>Added <i>EDITLABELS</i> flag for <i>TreeView</i> and <i>ListView</i> controls\n      and <i>MULTISELECT</i> for <i>ListView</i> controls (made single selection\n      default in this case).</li>\n      <li>Fixed empty item names for <i>TreeView</i> and <i>ListView</i> controls.</li>\n      <li>Fixed the return of <i>State</i> and <i>ListItems</i> INI values for\n      <i>Link</i> and <i>Button</i> controls with <i>COLORREQUEST</i> flag.</li>\n      <li>Fixed an interminable loop when <i>UpDown</i> controls had a buddy control\n      that had the <i>ONTEXTCHANGE</i> or <i>ONTEXTUPDATE</i> notification flags.</li>\n      <li>Fixed the range of numbers for <i>UpDown</i> controls. Maximum value for <i>MaxLen</i>\n      and <i>MinLen</i> is 2147483646 and the minimum is -2147483646. Also the default\n      values for the two keys are 2147483646 and -2147483646, respectively.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.2 beta 3\");</script>\n      IOEx DLL version 2.4.2 beta 3</b></a> <i>(2/Jul/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added new keys for \"Field #\" section: <i>RefFields</i>, <i>StateImageList</i>,\n      <i>SmallImageList</i>, <i>LargeImageList</i>, <i>HeaderItems</i>, <i>HeaderItemsAlign</i>,\n      <i>HeaderWidth</i>.</li>\n      <li>Added new flags for <i>ListView</i> controls: <i>LIST_VIEW</i>,\n      <i>ICON_VIEW</i>, <i>SMALLICON_VIEW</i>, and <i>REPORT_VIEW</i> and for\n      <i>Link</i> and <i>Button</i> controls: <i>COLORREQUEST</i>, <i>FONTREQUEST</i>.</li>\n      <li><b>Older INI's braking notice:</b> All values supported by <i>OPEN_FILEREQUEST</i>,\n      <i>SAVE_FILEREQUEST</i> and <i>DIRREQUEST</i> flags for <i>Link</i> and <i>Button</i>\n      controls on <i>State</i> key and <i>UpDown</i> controls on <i>Text</i> key\n      were transfered to <i>RefFields</i> key.</li>\n      <li>Now <i>Link</i> and <i>Button</i> controls with <i>OPEN_FILEREQUEST</i>,\n      <i>SAVE_FILEREQUEST</i>, <i>DIRREQUEST</i>, <i>COLORREQUEST</i>,\n      <i>FONTREQUEST</i> flags output state values to <i>State</i> key.</li>\n      <li><i>UpDown</i> controls now detect automatically the text from its buddy control.\n      <i>State</i> value is not used anymore when the buddy control is set.</li>\n      <li><b>Older INI's braking notice:</b> All values for <i>TreeView</i>\n      controls on <i>Text</i> key ware transfered to <i>StateImageList</i> key.</li>\n      <li>Fixed automatic Custom Draw setting for <i>Label</i>, <i>DropList</i>, <i>ComboBox</i>, and\n      <i>ListBox</i>. Custom Draw setting will only be set if you specify one of the\n      color commands values. Because of this, when this setting is disabled, the\n      colors will be as the Windows' default, and some features like multiline for\n      those controls (except <i>Label</i>) will be disabled. The good news is that this fixes\n      problems when setting text to those controls or change some colors for now. To\n      use custom draw in controls with default color values, use empty values like on \"TxtColor=\".</li>\n      <li>Added forgotten details about <i>Animation</i> controls support for the\n      <i>State</i> INI value, types of animation supported, <i>TreeView</i>\n      controls support for the <i>StateImageList</i> INI value, and the\n      <i>ONSELCHANGE</i> notification flag.</li>\n      <li>Fixed problems with notifications that executed when other handled or non-handled\n      notifications were activated.</li>\n      <li>Fixed checkbox state changes on <i>TreeView</i> controls when the space key\n      was pressed.</li>\n      <li>Other small bugfixes.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.2 beta 2\");</script>\n      IOEx DLL version 2.4.2 beta 2</b></a> <i>(7/May/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>TimeOut</i> INI key for \"Settings\" section. This enables the\n      page to return after the specified time. When notifications are activated,\n      the timer pauses until \"Abort\" is called on page's validation function. Also, it\n      continues to repeat until the page is closed.</li>\n      <li>Added <i>ONRCLICK</i> for <i>TreeView</i> controls.</li>\n      <li>Fixed <i>ONCLICK</i> notification flag: Only captured single-clicks when\n      <i>ONDBLCLICK</i> was not set.</li>\n      <li>Added the missing <i>Notify</i> INI key on the documentation.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.2 beta 1\");</script>\n      IOEx DLL version 2.4.2 beta 1</b></a> <i>(22/Mar/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added new control type: <i>TreeView</i>.</li>\n      <li>Major Fix: <i>Password</i> controls without a value for <i>Text</i> INI\n      key gave a fatal error.</li>\n      <li>Added new flags to <i>Flags</i> INI key: <i>CHECKBOXES</i> for\n      <i>TreeView</i> controls, <i>TRANSPARENT</i> for <i>Animation</i> controls\n      (second implementation).</li>\n      <li>Removed flags from <i>Flags</i> INI key: <i>RIGHT</i> for\n      <i>CheckBox</i> and <i>RadioButton</i> controls, <i>LEFT</i> for <i>UpDown</i>\n      controls.</li>\n      <li>Added new INI keys for \"Field #\" INI sections: <i>Align</i>,\n      <i>VAlign</i>, <i>TxtAlign</i>,and <i>TxtVAlign</i>.</li>\n      <li>Removed ellipsis support for strings that pass control border boundaries on\n      <i>Label</i>, <i>Link</i>, <i>DropList</i>, <i>ComboBox</i> and <i>ListBox</i>\n      controls.</li>\n      <li>Added tab character support for <i>Label</i> and <i>Link</i> controls.</li>\n      <li>Added carriage return, new line and tab characters support for <i>DropList</i>,\n      <i>ComboBox</i> and <i>ListBox</i> controls.</li>\n      <li>Adjusted rectangles of <i>Label</i> and <i>Link</i> controls so that the\n      focus rectangle don't cut part of strings (only <i>Link</i> controls) and have\n      at least 1 pixel of background color on the left and right of the control.</li>\n      <li>Right-To-Left dialogs have the <i>UpDown</i> control to invert\n      its position in relation to its buddy control.</li>\n      <li>Forgot to mention about <i>NOWORDWRAP</i> flag for <i>Text</i> and\n      <i>Password</i> controls in the documentation.</li>\n      <li><i>MaxLen</i> INI key for <i>TrackBar</i> controls didn't calculate\n      correctly the maximum number of items. Now if you specify 10, there will be 10\n      items.</li>\n      <li>Aplied patch <a target=\"_blank\" href=\"http://sourceforge.net/tracker/index.php?func=detail&aid=1164307&group_id=22049&atid=373087\">\n      #1164307</a>.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 13\");</script>\n      IOEx DLL version 2.4.1 beta 13</b></a> <i>(22/Jan/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>VSCROLL</i> for <i>ComboBox</i> and <i>DropList</i> controls, and\n      <i>READONLY</i> flag for <i>CheckBox</i> and <i>RadioButton</i> controls.</li>\n      <li>Text on <i>Button</i> controls is automatically wrapped if there has no\n      sufficient space.</li>\n      <li><i>Label</i>, <i>Bitmap</i> and <i>Icon</i> controls can have <i>Link</i>\n      controls underneath them so the \"hand\" cursor shows when pointing to those.</li>\n      <li>The text of <i>DateTime</i> controls is now aligned to the right when\n      <i>RTL</i> is activated.</li>\n      <li><i>ListBox</i> controls new feature: multiple vertical columns (see\n      <i>Text</i> INI key).</li>\n      <li>Added \"Collapse/Expand/Invert All\" options to documentation.</li>\n      <li>Optimized the documentation.</li>\n      <li>Removed \"page update from INI file changes\" feature.</li>\n      <li>Added <i>TRANSPARENT</i> flag for <i>Bitmap</i> controls (Added on IO 2.4.2).</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 12\");</script>\n      IOEx DLL version 2.4.1 beta 12</b></a> <i>(28/Dec/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added the ability to update the page when showing it. (There are still\n      bugs to be fixed here.)</li>\n      <li>DLL size reduced to 13.5kb. Increased speed to load pages by fixing\n      internal memory leaks.</li>\n      <li><i>Flags</i> INI key optimizations:\n      <ul>\n      <li>Added <i>MULTISELECT</i> flag for <i>Button</i> controls.</li>\n      <li>Fixed <i>FILE_EXPLORER</i> flag: had effect similar to\n      <i>HSCROLL</i> flag.</li>\n      <li><i>HSCROLL</i> and <i>VSCROLL</i> flags support for <i>Button</i>\n      controls was removed.</li>\n      </ul>\n      </li>\n      <li>New documentation (which will be improved more in future versions).</li>\n      <li>Removed <i>HotKey</i> control, for optimization purposes.</li>\n      <li>Removed a <i>ComboBox</i> feature of setting images for each list item. It\n      already had lots of problems since its inclusion.</li>\n      <li>Fixed <i>Icon</i> controls: Didn't use the right icon size when told to do\n      so.</li>\n      <li><i>Icon</i> controls additionally support cursors (*.cur) and animated cursors\n      (*.ani).</li>\n      <li>Fixed <i>DateTime</i> and <i>MonthCalendar</i> controls: Not enough space\n      on buffers, changed date and time format.</li>\n      <li>Made the focus rectangle on <i>Link</i> controls to occupy the control\n      rectangle border, not the text rectangle border.</li>\n      <li>New lines work again on <i>Link</i> controls.</li>\n      <li>Fixed: <i>Link</i> controls didn't execute <i>State</i> INI value and\n      instead it showed a browse dialog.</li>\n      <li>Fixed documentation: <i>MonthCalendar</i> controls can have a\n      <i>State</i> INI value.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 11\");</script>\n      IOEx DLL version 2.4.1 beta 11</b></a> <i>(07/Nov/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li><i>Flags</i> INI key optimizations:\n      <ul>\n      <li>Removed the \"not useful\" <i>BACK_RECT</i>, <i>NOTODAYCIRCLE</i>,\n      <i>TRANSPARENT</i> and <i>CENTER</i> flags. The second flag effect is\n      implemented with <i>NOTODAY</i> and the last flag is implemented to the\n      <i>Animation</i> control normal functionality.</li>\n      <li>Removed <i>VERTICAL</i> flag. Use <i>VSCROLL</i> instead.</li>\n      <li>Renamed <i>EXTENDEDSELCT</i> to <i>EXTENDEDSELECT</i>.</li>\n      <li>Renamed <i>FILEREQUEST</i> to <i>OPEN_FILEREQUEST</i> and <i>REQ_SAVE</i>\n      to <i>SAVE_FILEREQUEST</i> and removed its requirement of the <i>OPEN_FILEREQUEST</i>\n      flag.</li>\n      </ul>\n      </li>\n      <li>Fixed <i>ComboBox</i> and <i>DropList</i> controls: Disabled controls now\n      have their text on the right color by default.</li>\n      <li>Fixed <i>ListBox</i> controls: Focus boundary rectangle wasn't being drawn.</li>\n      <li>Font INI keys are now supportable by all controls.</li>\n      <li>Fixed <i>Link</i> controls: They are underlined by default except when\n      <i>FontUnderline=0</i> is set.</li>\n      <li>Changed importance level of <i>Height</i> and <i>Width</i>. Now if\n      <i>Right</i> is specified, <i>Width</i> is ignored, and if <i>Bottom</i>\n      is specified, <i>Height</i> is ignored.</li>\n      <li>Fixed \"Back\" button appearance: It should appear only after the first page.</li>\n      <li>Changed <i>State</i> and <i>Notify</i> INI keys from\n      <i>Settings</i> INI section:\n      <ul>\n      <li>Fixed: <i>State</i> had the value of 0 and <i>Notify</i> didn't even\n      appear when <i>OPEN_FILEREQUEST</i>, <i>SAVE_FILEREQUEST</i> or\n      <i>DIRREQUEST</i> were used on a <i>Button</i> control.</li>\n      <li>As the appearance of these INI keys are imminent: If <i>State</i>\n      = 0, the page returned a notification. If <i>Notify</i> = <i>ONNEXT</i>,\n      <i>ONBACK</i> or <i>ONCANCEL</i>, the user clicked on next, back or\n      cancel buttons, respectively.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 10\");</script>\n      IOEx DLL version 2.4.1 beta 10</b></a> <i>(29/Oct/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Fixed <i>VSCROLL</i> flag: wasn't supported by <i>ListBox</i> controls.</li>\n      <li>Changed flag name: <i>HORIZONTAL</i> to <i>HSCROLL</i>.</li>\n      <li>Mentioned <i>PASSWORD</i> for <i>Text</i> and <i>DROPLIST</i> for\n      <i>ComboBox</i> controls on the documentation.</li>\n      <li>Added new feature to <i>Password</i> controls: Password mask character (see\n      <i>Text</i> INI key).</li>\n      <li>Added new feature to <i>Animation</i> controls: Adjustment of number of loops\n      (see <i>State</i> INI key).</li>\n      <li>Added new features to <i>Icon</i> controls:\n      <ul>\n      <li>Supports getting icons from executables, and dlls (see Text and State INI keys).</li>\n      <li>Supports default Windows icons (see State INI value). Options:\n      <i>APPLICATION</i>, <i>EXCLAMATION</i>, <i>INFORMATION</i>,\n      <i>QUESTION</i>, <i>STOP</i> and <i>WINLOGO</i>.</li>\n      </ul>\n      <li>Added variables $0-$9, $R0-$R9 support before reserving or showing without\n      reserving pages. It is supported on every value of a key and can be used multiple\n      times on the same value.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 9\");</script>\n      IOEx DLL version 2.4.1 beta 9</b></a> <i>(23/Aug/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Fixed <i>DISABLED Label</i> controls: didn't draw shadow.</li>\n      <li><i>DISABLED Label</i> and <i>Link</i> are now controls supported by\n      <i>DisTxtColor</i> key.</li>\n      <li>Fixed <i>Label</i> and <i>Link</i> controls: didn't draw background\n      color on the entire control.</li>\n      <li>Shadow Text feature added. Added <i>TxtShwColor</i>, <i>DisTxtShwColor</i>,\n      <i>SelTxtShwColor</i> and <i>DisSelTxtShwColor</i>.\n      <li>First DLL optimizations: 0.5 kb smaller on uncompressed build (no change for\n      compressed build).</li>\n      <li>Fixed text positioning of <i>ComboBox</i>, <i>DropList</i> and\n      <i>ListBox</i> controls. They are now closer to the control border.</li>\n      <li>Fixed focus rectangle not appearing on <i>ComboBox</i> and <i>DropList</i>.</li>\n      <li>ListBox, ComboBox and DropList controls have automatic word ellipsis.</li>\n      <li><i>FontOrientation</i> and <i>FontEscapement</i> removed - because most\n      of the drawing commands do not support this feature.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 8\");</script>\n      IOEx DLL version 2.4.1 beta 8</b></a> <i>(18/Aug/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added ToolTips feature -> Added <i>ToolTipText</i>, <i>ToolTipFlags</i>,\n      <i>ToolTipMaxWidth</i>, <i>ToolTipTxtColor</i>, <i>ToolTipBgColor</i>,\n      <i>ToolTipIcon</i> and <i>ToolTipTitle</i> keys.</li>\n      <li>Fixed <i>DISABLED ComboBox</i> and <i>DropList</i> controls bug: Didn't\n      redraw right.</li>\n      <li>Fixed <i>DISABLED ListBox</i> controls bug: User specified colors didn't\n      apply.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 7\");</script>\n      IOEx DLL version 2.4.1 beta 7</b></a> <i>(14/Aug/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>Notify</i> key for \"Settings\" and \"Field #\"\n      sections.</li>\n      <li>Added: <i>ONSETFOCUS</i>, <i>ONKILLFOCUS</i>,\n      <i>ONLISTOPEN</i>, <i>ONLISTCLOSE</i>, <i>ONSELCHANGE</i>,\n      <i>ONTEXTCHANGE</i>, <i>ONTEXTUPDATE</i>, <i>ONCLICK</i>,\n      <i>ONDBLCLICK</i>, <i>ONTEXTTRUNCATE</i>, <i>ONTEXTVSCROLL</i>,\n      <i>ONSTART</i> and <i>ONSTOP</i> notification flags.\n      </ul>\n      <li>Added <i>BackShow</i>, <i>NextEnabled</i> and <i>NextShow</i> for\n      \"Settings\" section.</li>\n      <li><i>Fixed the control extension beyond the rectangle height and width</i>\n      addition of the last version removed.</li>\n      <li>Fixed <i>Text</i> controls: \"black\" color was being set even when you\n      didn't.</li>\n      <li>Fixed <i>ListBox</i> controls: didn't appear as they were disabled.</li>\n      <li>Added missing features to the documentation which last version's didn't\n      mention.</li>\n      <li>Added <i>FontName</i> for <i>Label</i>, <i>Link</i>,\n      <i>ListBox</i>, <i>ComboBox</i>, <i>DropList</i>, <i>Text</i> and\n      <i>Password</i> controls, <i>DisBgColor</i>, <i>DisTxtColor</i>,\n      <i>DisSelBgColor</i> and <i>DisSelTxtColor</i> for <i>ListBox</i> control.</li>\n      <li><i>ListItems</i> for <i>Button</i> controls w/ <i>DIRREQUEST</i> flag\n      is the text which appears above the Tree-View control of directories.</li>\n      <li>Added a new flag to <i>CheckBox</i> controls, the old and famous \"3STATE\"\n      flag that allows you to set additionally an indetermined (or grayed) state.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 6\");</script>\n      IOEx DLL version 2.4.1 beta 6</b></a> <i>(25/Jul/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added a wide range of commands for setting initial color and font formatting\n      without using NSIS commands.</li>\n      <li>Fixed the control extention beyond the rectangle height and width. This makes the\n      control to resize itself when necessary. </li>\n      <li>Added file verification before setting a bitmap or icon to <i>DropList</i>,\n      <i>ComboBox</i> and <i>Button</i> controls.</li>\n      <li>Added <i>Height</i> and <i>Width</i> keys.</li>\n      <li>Fixed a stupid bug that made some controls flags to be set when you did not\n      specify them.</li>\n      <li>Fixed another stupid bug that made <i>ProgresBar</i> controls to do not\n      show their indicator bar correctly.</li>\n      <li>Added one laking information about the stand alone keys for <i>HotKey</i> controls.</li>\n      <li>Fixed other minor bugs.</li>\n      <li>Added ellipsis style for all controls that support ownerdraw style.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 5\");</script>\n      IOEx DLL version 2.4.1 beta 5</b></a> <i>(27/Jun/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>HotKey</i> control.</li>\n      <li>Added support of <i>NOTIFY</i> flag for <i>MonthCalendar</i>, <i>DateTime</i>,\n      <i>UpDown</i> and <i>HotKey</i> controls.</li>\n      <li>Added information to controls and options their minimum supportable OS.</li>\n      <li>C style escape characters restored again.</li>\n      <li>Fixed problems with new controls about the TabStop not working.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 4\");</script>\n      IOEx DLL version 2.4.1 beta 4</b></a> <i>(11/Jun/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>UpDown</i> control.</li>\n      <li>Removed <i>FileRequest</i> and <i>DirRequest</i> controls. Use <i>Text</i>\n      and <i>Button</i> controls instead.</li>\n      <li>Added <i>FILEREQUEST</i> and <i>DIRREQUEST</i> flags for <i>Button</i>\n      controls and <i>LEFT</i>, <i>HORIZONTAL</i> and <i>WRAP</i> flags for\n      <i>UpDown</i> controls.</li>\n      <li>NSIS <i>$\\n</i>, <i>$\\r</i> and <i>$\\t</i> imported to remove the need\n      for conversions between NSIS characters and plugin's.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 3\");</script>\n      IOEx DLL version 2.4.1 beta 3</b></a> <i>(7/Jun/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>DateTime</i> and <i>MonthCalendar</i> controls.</li>\n      <li>Added <i>UPDOWN</i> flag for <i>DateTime</i> controls and\n      <i>NOTODAY</i>, <i>NOTODAYCIRCLE</i> and <i>WEEKNUMBERS</i> flags for\n      <i>MonthCalendar</i> controls.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 2\");</script>\n      IOEx DLL version 2.4.1 beta 2</b></a> <i>(31/May/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>TrackBar</i> and <i>IPAddress</i> controls.</li>\n      <li>Added ability of <i>Button</i> controls of\n      supporting an image or icon.</li>\n      <li>Added <i>BACK_RECT</i>, <i>TOOLTIPS</i> and <i>NO_TICKS</i> flags for\n      <i>TrackBar</i> controls and <i>BITMAP</i> and <i>ICON</i> flags for\n      <i>Button</i> controls.</li>\n      <li>Added support of <i>NOTIFY</i> flag for <i>IPAddress</i> control.</li>\n      <li>Removed <i>NOAUTOPLAY</i> flag for <i>Animation</i> control.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IOEx 2.4.1 beta 1\");</script>\n      IOEx DLL version 2.4.1 beta 1</b></a> <i>(24/May/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Removed <i>NumFields</i> from INI File \"Settings\" section.</li>\n      <li>Added <i>Animation</i> and <i>ProgressBar</i> controls.</li>\n      <li>Added ability of <i>ComboBox</i> and <i>DropList</i> controls of\n      supporting images for each item in their list boxes.</li>\n      <li>Added <i>TRANSPARENT</i>, <i>CENTER</i> and <i>NOAUTOPLAY</i> flags for\n      <i>Animation</i> controls and <i>SMOOTH</i> and <i>VERTICAL</i> flags for\n      <i>ProgressBar</i> controls.</li>\n      <li>Added support of <i>NOTIFY</i> flag for <i>Text</i>, <i>Password</i> and\n      <i>ComboBox</i> controls.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4.7\");</script>\n      IO DLL version 2.4.7</b></a> <i>(27/Apr/2007)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Line breaks support in Link control.</li>\n      <li>Added HLine and VLine controls.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4.6\");</script>\n      IO DLL version 2.4.6</b></a> <i>(31/Mar/2007)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Use installer's name for message boxes.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4.5\");</script>\n      IO DLL version 2.4.5</b></a> <i>(23/Jan/2007)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added FOCUS flag for setting focus to a control other than the first.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4.4\");</script>\n      IO DLL version 2.4.4</b></a> <i>(11/Oct/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added HWND and HWND2 entries to the INI file to avoid messy calculations of the correct control id.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4.3\");</script>\n      IO DLL version 2.4.3</b></a> <i>(4/Oct/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Fixed alteration of the working directory by <i>FileRequest</i>.</li>\n      <li>Added WS_EX_LEFTSCROLLBAR in RTL mode.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4.2\");</script>\n      IO DLL version 2.4.2</b></a> <i>(21/Jan/2005)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added TRANSPARENT flag for BITMAP fields (funded by Chris Morgan).</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4.1\");</script>\n      IO DLL version 2.4.1</b></a> <i>(8/May/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Bitmaps are now automatically centered</li>\n      <li>Fixed a bug which prevented enabling the next button from the leave function\n      of InstallOptions pages</li>\n      <li>Fixed a rare freeze</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.4\");</script>\n      IO DLL version 2.4</b></a> <i>(4/Jan/2004)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Initial focus is set in \"initDialog\" making it possible to override it from\n      NSIS prior to calling \"show\"</li>\n      <li>When initial focus is to a Text field InstallOptions now follows standard\n      Windows behaviour by having the text selected</li>\n      <li>Label and other static fields no longer have State= written to the INI\n      file when leaving the dialog</li>\n      <li>NOTIFY flag can now be used with Link fields (State should be omitted in\n      this case)</li>\n      <li>Likewise, State can now be used with Button fields (behaves the same as with\n      Link fields)</li>\n      <li>NOTIFY flag can also now be used with ListBox and DropList fields to have\n      NSIS notified when the selection changes</li>\n      <li>Meaning of RIGHT flag is now reversed in right-to-left language mode</li>\n      <li>HSCROLL and VSCROLL flags are no longer restricted to Text fields</li>\n      <li>Various Link field fixes</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.3\");</script>\n      IO DLL version 2.3</b></a> <i>(4/Dec/2003)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added new control type \"Button\"</li>\n      <li>Added new flag \"NOTIFY\"</li>\n      <li>Added new flag \"NOWORDWRAP\" for multi-line text boxes</li>\n      <li>Reduced size down to 12K</li>\n      <li>Better RTL support</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.2\");</script>\n      IO DLL version 2.2</b></a> <i>(10/Jun/2003)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added New control type LINK</li>\n      <li>\\r\\n converts to newline in Multiline edit box</li>\n      <li>Support for multiline edit box</li>\n      <li>Better tab order in DirRequest and FileRequest</li>\n      <li>Added READONLY option to text box</li>\n      <li>Minor fixes</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.1\");</script>\n      IO DLL version 2.1</b></a> <i>(15/Mar/2003)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>\\r\\n converts to newline in both label Text and ValidateText</li>\n      <li>New browse dialog style (modern)</li>\n      <li>Word wrapping for check boxes and radio buttons</li>\n      <li>No ugly border for edit fields under XP</li>\n      <li>Scroll bar for list boxes</li>\n      <li>Works with SetStaticBkColor</li>\n      <li>DISABLED dir and file request fields now disable the browse button too</li>\n      <li>No more STATE value for labels</li>\n      <li>Minor fixes</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 2.0\");</script>\n      IO DLL version 2.0</b></a> <i>(4/Mar/2003)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Supports custom font and DPI settings (by Joost Verburg)</li>\n      <li>INI files should contain dialog units now, no pixels (by Joost Verburg)</li>\n      <li>RESIZETOFIT flag for Bitmap control (by Amir Szekely)</li>\n      <li>New documentation (by Joost Verburg)</li>\n      <li>New GROUP/NOTABSTOP/DISABLED flags</li>\n      <li>Added <i>Rect</i> INI key.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.7 beta\");</script>\n      IO DLL version 1.7 beta</b></a> <i>(2/Nov/2002)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added <i>initDialog</i> and <i>show</i> DLL functions.</li>\n      <li>Removed <i>CancelConfirm</i>, <i>CancelConfirmCaption</i>, <i>CancelConfirmFlags</i>\n      INI keys.</li>\n      <li>Renamed <i>BackDisabled</i> INI key to <i>BackEnabled</i>.\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.6 beta\");</script>\n      IO DLL version 1.6 beta</b></a> <i>(30/Sep/2002)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>CancelConfirmIcon becomes CancelConfirmFlags and can now take the other\n      common MessageBox flags</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.5 beta\");</script>\n      IO DLL version 1.5 beta</b></a> <i>(26/Sep/2002)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Made close [x] button behave like Cancel (thanks brainsucker)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.4 beta\");</script>\n      IO DLL version 1.4 beta</b></a> <i>(4/Sep/2002)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added Icon and Bitmap controls (by Amir Szekely)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.3 beta\");</script>\n      IO DLL version 1.3 beta</b></a> <i>(15/Aug/2002)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added CancelShow (by ORTIM)</li>\n      <li>Added pixel transformation for widgets (by ORTIM)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.2 beta\");</script>\n      IO DLL version 1.2 beta</b></a> <i>(31/Jul/2002)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added CancelEnabled (by ORTIM)</li>\n      <li>Added CancelConfirmCaption and CancelConfirmIcon (by Amir Szekely)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.1 beta\");</script>\n      IO DLL version 1.1 beta</b></a> <i>(22/Jul/2002)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Font is now taken from the main NSIS window (by Amir Szekely)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.0 beta\");</script>\n      IO DLL version 1.0 beta</b></a> <i>(16/Dec/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Moved to DLL, no longer need parentwnd ini writing</li>\n      <li>Tons of changes - no longer fully compatible (see source for a big list)</li>\n      <li>removed support for silent installers (it seems the old version would bring up it's own dialog)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.4\");</script>\n      IO DLL version 1.4</b></a> <i>(18/Nov/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added Listbox controls.</li>\n      <li>Added MULTISELECT flag.</li>\n      <li>Made the HWND list for the parent window controls dynamically allocated. This prevents a crash if NSIS ever gets more than 150 controls on it's main window.</li>\n      <li>The TEXT property of DirRequest control can be used to specify an initial directory. The current directory is automatically selected when clicking the browse button of the DirRequest control.</li>\n      <li>Added ROOT property to DirRequest which can be used to set the root directory (mostly due to felfert)</li>\n      <li>Edit controls will now auto scroll (thanks felfert)</li>\n      <li>Fixed a problem where the window wouldn't draw properly on some systems (thanks felfert)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.3\");</script>\n      IO DLL version 1.3</b></a> <i>(03/Nov/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Got rid of the call to RedrawWindow() because it's no longer needed with the WS_CLIPCHILDREN flag for NSIS.</li>\n      <li>Removed a few hardcoded limits of buffer sizes</li>\n      <li>Added Checkbox and RadioButton controls</li>\n      <li>Added RIGHT and CHECKED flags</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.2.2\");</script>\n      IO DLL version 1.2.2</b></a> <i>(30/Oct/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Additional size reductions. Further reduced the size down to 8k.</li>\n      <li>The text parameter to a combobox can now be used to specify the initial value</li>\n      <li>Changed from InvalidateRect() to RedrawWindow() to force a redraw after a browse dialog</li>\n      <li>On startup, set the flags of the NSIS window to include WS_CLIPCHILDREN. Otherwise, our controls don't get drawn right.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.2.1\");</script>\n      IO DLL version 1.2.1</b></a> <i>(28/Oct/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Bug fix. ControlID for the caption and the OK button were reused by the first two controls. (Thanks Schultz)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.2.0.1\");</script>\n      IO DLL version 1.2.0.1</b></a> <i>(28/Oct/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>8.5kb from 44kb. heh. (by Justin Frankel)</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.2\");</script>\n      IO DLL version 1.2</b></a> <i>(28/Oct/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Still 44k</li>\n      <li>Added the \"FileRequest\" and \"DirRequest\" control types (thanks Schultz)</li>\n      <li>Added \"MinLen\", \"MaxLen\", and \"ValidateText\" properties to fields</li>\n      <li>Added \"Flags\" as a way to specify additional parameters for controls</li>\n      <li>Few more changes to the documentation</li>\n      <li>Cleaned the code in a few places...still trying to make it smaller</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.1\");</script>\n      IO DLL version 1.1</b></a> <i>(27/Oct/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Added the \"Title\" option (thanks Alex)</li>\n      <li>Moved the OK button so it is in the same location as the buttons on the main NSIS window (thanks Alex)</li>\n      <li>Pressing \"ENTER\" will now automatically select the OK button (thanks Alex)</li>\n      <li>Slightly improved the documentation</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.0.1\");</script>\n      IO DLL version 1.0.1</b></a> <i>(25/Oct/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Fixed the SetFocus loop so it exits after the first control like it was supposed to</li>\n      <li>Added the license to the documentation</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n    <!-- Next Sub-Item -->\n\n    <script type=\"text/javascript\">WriteTitleStart(\"\", \"VerHist-IO 1.0\");</script>\n      IO DLL version 1.0</b></a> <i>(25/Oct/2001)</i> <a><b>\n    <script type=\"text/javascript\">WriteTitleEnd();</script>\n    <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n      <li>Barely qualifies as a distribution.</li>\n    <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <!-- Next Item -->\n\n  <script type=\"text/javascript\">WriteTitleStart(\"\", \"Credits\");</script>\n    Credits\n  <script type=\"text/javascript\">WriteTitleEnd();</script>\n  <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n    <p class=pm>Original IO version by Michael Bishop<br />\n    IO DLL version by Nullsoft, Inc.<br />\n    IO DLL version 2 by Amir Szekely, ORTIM, Joost Verburg<br />\n    IOEx DLL (changed from original IO 2) by Diego Pedroso<br />\n    IOEx DLL (starting at v.2.4.5) by SuperPat<br />&nbsp;<br />\n\n    Documentation for InstallOptions 2 by Joost Verburg<br />\n    InstallOptionsEx Documentation (changed from InstallOptions') by Diego Pedroso and by SuperPat since version 2.4.5 beta 1<br />\n  <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  <!-- Next Item -->\n\n  <script type=\"text/javascript\">WriteTitleStart(\"\", \"License\");</script>\n    License\n  <script type=\"text/javascript\">WriteTitleEnd();</script>\n  <script type=\"text/javascript\">WriteTextStart(\"\");</script>\n    <pre class=pm>\nOriginal IO version Copyright &copy; 2001 Michael Bishop\nIO DLL version 1 Copyright &copy; 2001-2002 Nullsoft, Inc., ORTIM\nIO DLL version 2 Copyright &copy; 2003-2009 Amir Szekely, Joost Verburg, Dave Laundon\nIOEx DLL (changed from original IO 2) Copyright &copy; 2004-2005 Diego Pedroso \nIOEx DLL (starting at v.2.4.5) Copyright &copy; 2006-2019 SuperPat\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented;\n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.</pre>\n  <script type=\"text/javascript\">WriteTextEnd();</script>\n\n  </center></div>\n  <h6>&nbsp;</h6>\n  </td>\n  </tr>\n  </table>\n</body>\n</html>"
  },
  {
    "path": "setup/nsis/tools/Docs/InstallOptionsEx/basic.js",
    "content": "<!-- Expand/Collapse Effect -->\n\n/***********************************************\n* Switch Content script-  Dynamic Drive (www.dynamicdrive.com)\n* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.\n* Visit http://www.dynamicdrive.com/ for full source code\n***********************************************/\n\nvar pszAnchorPrefix = \"a_\";\nvar pszDivisionPrefix = \"sc\";\n\nfunction Expand(cid){\n  document.getElementById(cid).style.display=(document.getElementById(cid).style.display!=\"block\")? \"block\" : \"none\"\n}\n\nfunction ExpandByName(name){\n  Expand(getElementbyAnchorName(name));\n}\n\nfunction getElementbyAnchorName(name){\n  var tags=document.getElementsByTagName(\"div\");\n  for (i=0; i<tags.length; i++)\n    if(tags[i].name.substr(0,pszAnchorPrefix.length) == pszAnchorPrefix && tags[i].name.substr(pszAnchorPrefix.length) == name)\n      return pszDivisionPrefix+tags[i].id;\n  return -1;\n}\n\nfunction ExpandAll(){\n  var i=0;\n  var ia=0;\n  var tags=document.getElementsByTagName(\"div\");\n  for (i=0; i<tags.length; i++){\n    if(tags[i].id.substr(0,pszDivisionPrefix.length) == pszDivisionPrefix)\n    {\n      ia++;\n      document.getElementById(pszDivisionPrefix+ia).style.display=\"block\"\n    }\n  }\n}\n\nfunction CollapseAll(){\n  var i=0;\n  var ia=0;\n  var tags=document.getElementsByTagName(\"div\");\n  for (i=0; i<tags.length; i++){\n    if(tags[i].id.substr(0,pszDivisionPrefix.length) == pszDivisionPrefix)\n    {\n      ia++;\n        document.getElementById(pszDivisionPrefix+ia).style.display=\"none\"\n    }\n  }\n}\n\nfunction InverseAll(){\n  var i=0;\n  var ia=0;\n  var tags=document.getElementsByTagName(\"div\");\n  for (i=0; i<tags.length; i++){\n    if(tags[i].id.substr(0,pszDivisionPrefix.length) == pszDivisionPrefix)\n    {\n      ia++;\n      document.getElementById(pszDivisionPrefix+ia).style.display=(document.getElementById(pszDivisionPrefix+ia).style.display!=\"block\")? \"block\" : \"none\"\n    }\n  }\n}\n\nvar nTable = 0;\n\n<!-- Write -->\n\nvar nLevel = -1;\nvar nLevelItem = -1;\n\nvar pszLevels = \"\";\nvar aLevels = [0];\n\nfunction WriteTitleStart(style, name) {\n  nTable++;\n\n  nLevel++;\n  if(aLevels[nLevel] == undefined)\n    aLevels[nLevel] = 1;\n  else\n    aLevels[nLevel]++;\n  var nLevelTemp = aLevels.length - 1;\n  while(nLevel < nLevelTemp--)\n  {\n    delete aLevels[nLevelTemp+1];\n    aLevels.length--;\n  }\n  pszLevels = aLevels.join(\".\");\n\n  document.write('<table cellspacing=0 ');\n\n  if(style == \"\" || style == undefined)\n  {\n    if(nLevel == 0)\n      document.write('class=ti');\n    else\n      document.write('class=tia');\n  }\n  else if(style == \"IOEx\")\n    document.write('class=tian');\n  else if(style == \"IO\")\n    document.write('class=tiao');\n\n  if(name == undefined)\n    name = \"\";\n\n  //+pszAnchorPrefix+name+\n  document.write('><tr><td>&nbsp;<a id=\"'+nTable+'\" name=\"'+pszLevels+'\" onClick=\"Expand(' + \"'\" + pszDivisionPrefix + nTable + \"'\" + ')\"><b><font color=\"#DDDDDD\">'+pszLevels+'</font> ');\n}\nfunction WriteTitleEnd() {\n  nLevel--;\n  document.write('</b></a></td></tr></table>');\n}\n\nfunction WriteTextStart(style) {\n  nLevel++;\n  document.write('<div id=\"' + pszDivisionPrefix + nTable + '\" class=sc><table ');\n\n  if(style == \"\" || style == undefined)\n    if(nLevel == 0)\n      document.write('class=tx');\n    else\n      document.write('class=txa');\n  else if(style == \"IOEx\")\n    document.write('class=txan');\n  else if(style == \"IO\")\n    document.write('class=txao');\n\n  document.write('><tr><td>');\n}\n\nfunction WriteTextEnd() {\n  nLevel--;\n  document.write('</td></tr></table></div>');\n}\n"
  },
  {
    "path": "setup/nsis/tools/Docs/InstallOptionsEx/style.css",
    "content": "body\n  {\n  background-color: #F0F0F0;\n  font: 11px Verdana, Helvetica;\n  text-align: justify;\n  padding: 10px;\n  }\n\nh1\n  {\n  color: #333;\n  font: 30px Verdana, Helvetica;\n  margin-top: 20px;\n  margin-bottom: 0px;\n  }\n  \nh2\n  {\n  color: #333;\n  font: 16px Verdana, Helvetica;\n  margin-top: 0px;\n  }\n  \n.mm\n  {\n  margin-left: 5%;\n  }\n\nul\n  {\n  margin: 0px 40px 5px 40px;\n  list-style-type: circle;\n  }\n  \nul ul\n  {\n  margin: 0px 60px 5px 60px;\n  list-style-type: square;\n  }\n\np, pre, br\n  {\n  margin: 7.5px 0px;\n  }\n  \n.tm\n  {\n  margin: 7.5px 0px 0px;\n  }\n  \n.bm\n  {\n  margin: 0px 0px 7.5px;\n  }\n  \n.pm\n  {\n  margin: 0px;\n  }\n\na:link, a:visited, a:active\n  {\n  color: #294F75;\n  }\n\na:hover\n  {\n  color: #182634;\n  text-decoration: underline;\n  }\n  \ntable\n  {\n  background-color: #FFF;\n  border: 1px solid #000;\n  font: 11px Verdana;\n  text-align: justify;\n  }\n\n.maintable\n  {\n  border: 2px solid #376EAB;\n  width: 95%;\n  }\n  \n.ti\n  {\n  color: #FFF;\n  background-color: #888;\n  font: 12px Arial;\n  text-indent: 2px;\n  width: 90%;\n  }\n\n.tia\n  {\n  color: #FFF;\n  background-color: #888;\n  font: 12px Arial;\n  text-indent: 2px;\n  width: 100%;\n  }\n  \n.tian\n  {\n  color: #FFF;\n  background-color: #F60;\n  font: 12px Arial;\n  text-indent: 2px;\n  width: 100%;\n  }\n\n.tiao\n  {\n  color: #FFF;\n  background-color: #070;\n  font: 12px Arial;\n  text-indent: 2px;\n  width: 100%;\n  }\n\n.tx\n  {\n  background-color: #DDD;\n  border-top: 0px solid #000;\n  width: 90%;\n  padding: 2%;\n  }\n\n.txa\n  {\n  background-color: #DDD;\n  border-top: 0px solid #000;\n  width: 100%;\n  padding: 2%;\n  }\n\n.txan\n  {\n  background-color: #fA0;\n  border-top: 0px solid #000;\n  width: 100%;\n  padding: 2%;\n  }\n\n.txao\n  {\n  background-color: #7A7;\n  border-top: 0px solid #000;\n  width: 100%;\n  padding: 2%;\n  }\n\n.trigger\n  {\n  cursor: pointer;\n  cursor: hand;\n  }\n\n.toggle\n  {\n  display: none;\n  }\n\na\n  {\n  cursor: pointer;\n  cursor: hand;\n  }\n  \n.sc{display:none;}"
  },
  {
    "path": "setup/nsis/tools/Docs/Math/Math.txt",
    "content": "Math::Script NSIS plugin.\n\nC-like style scripting (operators at least).\nTip1: plugin watches the case of the letters.\nTip2: plugin makes almost no error checks. So YOU should check your script\ntwice before run :)\n\nNew HOW TO USE: run the MathTest.Exe, and try yourself. After spending \nsome minutes your should be able to write your script by yourself.\nTo include it to your NSIS script just insert that: \n        Math::Script \"YourScript1\"\n        Math::Script \"YourScript2\"\n        Math::Script \"YourScriptFinal\"\n\nHow to use it? Simple:\n        Strcpy $0 \"Brainsucker\"\n        Math::Script \"a = 'Math'; B = 'Script'; r0 += ' wants to use ' + a + '::' + b +'!'\"\n        DetailPrint \"$0\"\nThat string will fill r0 with some stuff. \n\nHere are some other samples:\n        10! (factorial, r0 will contain '10! = 362880'):\n                r0 = '10! = ' + (1*2*3*4*5*6*7*8*9)\n        the same:\n                a = b = 1; #{++a <= 10, b = b*a}; r0 = (a-1) + '! = ' + b\n        Some floating point:\n                Strcpy $R0 \"1e1\"\n                Math::Script \"pi = 3.14159; R1 = 2*pi*R0; r0 = 'Length of circle with radius ' + R0 + ' is equal to ' + R1 + '.'\"\n                Detailprint \"$0\"        \n\nOk. Variables. \nNSIS: r0-r9 -> $0-$9. R0-R9 -> $R0-$R9. \nAlso CL ($CMDLINE), ID ($INSTDIR), OD ($OUTDIR), LG ($LANG), ED ($EXEDIR).\nUser definable: name starting from character, up to 28 letters long.\n\nStacks. Two stacks are supported: NSIS stack and plugin's own stack. I see no \nreasons for using plugin stack, but if you will, remember - the plugin stores\nvariables used at function to that stack before function execution, and restores\nafter execution. Even less I recommend you to use NSIS stack. You should use it\nonly for input/output.\nHow to use? It's variable styled. Plugins stack is associated with S variable,\nand NSIS stack associated with NS variable. To push to stack just do \"S=0\" or\n\"NS=0\", to pop from stack \"a=S\" or \"b=NS\". Combined operations supported too: \n\"S += 1.5\" will increment value at the top of stack by 1.5.\n\nSupported types: int (in fact that is __int64), float (double in fact),\nstring.\nInt: just numbers, may include sign.\nFloat: -123.456, 123.456e-78, 123e-45\nString: something in quotes (\"\", '', ``).\n\nThere is also an array type. It is actually a reference type, so if b is array\nand you will perform \"a=b\", the a and b will reference a single array.\nTo create a copy of array, use ca func: dest = ca(source). Btw - you couldn't\ncontrol dimensions of arrays - they are autosized.\nTo declare array:\na = {};\nTo declare array and initialize some items with values:\n{\"Hello!\", \"Use\", \"mixed types\", 1.01e23, \"like that\" ,1234};\nTo access array:\na[index] = \"Cool\";\n\nAlso [] operation could be used to strings. str[x] gives you a single char with\nindex x (zero-based) as new string. str[-x] - the same, but x counts from the\nstring end (so the last char is -1). str[x,y] gives you characters in range x-y\n(inclusive), both x and y could be <0 - in this case they counted from the end\nof the string.\n\nThe function could be useful - is conversion of arrays to strings and back.\nExample:\na = a(\"Hello\"); str = s(a);\nAfter running such script array a will contain 6 integers (chars and last zero \n- end of string), and str will contain your string back.\n\nOperators (some binary, some unary):\n>>= <<= -= += /= *= |= &= ^= %= -- ++ >> << && || <= =< >= => != ==\n= + - * / % < > & | ^ ~ !\nOnly some are applicable to float (logic & arithmetic) and string (+ and logic) \nof course. \nAdditional case: reference/de-reference operators (& and *). & will\ngive you the reference to argument which should be a variable (NSIS, user, array\nitem, stack), and * will convert it back to original variable. For example \n(a=&b; *a=10) will set b to 10. Expression (*&a) is equal to simple (a).\n\nScript is set of expressions (mathematical in general) delimited with ';'.\nProcessing is mathematically right (2+2*2 will give 6), operations are performed\nin a C like order (precedence).\n\nFlow control:\n        if-then-else like:      #[if-expression, then-expr, else-expr]\n                example:\n                        #[a==0, b=1; c=2, b *= (--c); c/=10]               \n                C eq:\n                        if (a==0) { b=1; c=2;} else { b*=(c++);c-=10; }\n        while (expr) do; like   #{expr, do}\n                example:\n                        #{(c<1.1e25)&&(b < 10), b++; c*=1.23}\n                C eq:\n                        while ((c<1.1e25)&&(b<10)) { b++; c*=1.23; }\n\nWATCH OUT! Comma (,) separates if-expr, then-expr, and else-expr from each \nother. All sub-expressions separated by (;) are the part of one expression,\nand the result of the last one of these sub-exprs gives you the result of \nexpression.\n\nAll the stuff (like variables and functions) will be saved between calls.\n\nFunctions:\n        type conversions:\n                l(string)       returns the length of string or array argument\n                s(source)       converts source to string type\n                i(source)       converts source to int type\n                f(source)       converts source to float type\n                c(source)       if source is string, returns int value of first\n                        char, if source is int, returns string which consists\n                        of a single char (source) (+0 terminator).\n                a(source)       converts source to array (only string supported)\n                ff(float, format)       converts float to string, with format\n                                        options.\n                        options = precision + flags.\n                        Precision shows how many digits after decimal point\n                        will be shown. Flags:\n                                16 (or 0x10) - No Exponential View \n                                        (number will be shown as 123.123)\n                                32 (or 0x20) - Only exponential view\n                                        (number will be shown as 123.12e123)\n                                64 (or 0x40) - use 'E' character instead of 'e' \n                        By default the plugin decides itself how to show your\n                        number.\n\n        math (description of all these functions is available at MSDN, use the\n            second given name for search):\n                sin(x),         sin     Sine of argument\n                cos(x),         cos     Cosine of argument\n                cel(x),         ceil    Ceil of argument (no fract. part) \n                csh(x),         cosh    Hyperbolic Cosine of Argument        \n                exp(x),         exp     Exponential\n                abs(x),         abs     Absolute value (warning: float)\n                flr(x),         floor   Floor of argument (no fract. part) \n                asn(x),         asin    ArcSine of argument\n                acs(x),         acos    ArcCosine of argument\n                atn(x),         atan    ArcTangent of argument\n                ln(x),          log     Exponential Logarithm\n                log(x),         log10   Decimal logarithm\n                snh(x),         sinh    Hyperbolic Sine of Argument\n                sqt(x),         sqrt    Square root of argument\n                tan(x),         tan     Tangent of argument\n                tnh(x),         tanh    Hyperbolic tangent  of argument\n\n          functions taking two arguments\n                at2(x, y)       atan2    Arctangent of the value (y/x)\n                pow(x, y)       pow      power, x^y\n                fmd(x, y)       fmod     floating point remainder\n                fex(x, o)       frexp    Gets the mantissa (result = r) \n                                        and exponent (o) of floating-point \n                                        number (x): x = r*(2^o)\n                mdf(x, o)       modf    Splits a floating-point value into \n                                        fractional and integer parts.\n\nUser-defined functions.\nIt's very simple. Example:\n        test(a,b) (a+b);\nAfter that test(1,2) will give you 3. \n        test2(a,b) (a=a+b; b *= a);\nThe result of function is always the result of last expression.\nAs said before it better not to use stack (S) in between function calls.\nIt will be better to develop variable-safe functions, i.e. functions which will\nnot corrupt variables. For this you should either push/pop them to stack, or\ndeclare as additional arguments, which will never be used. Example:\n        test3(a,b,c) (c=10; #{--c > 0, a=sqrt(a*b)}; a)\nNo matter how many arguments will be passed to function, the values of all three \nvars (a,b,c) will be saved. \nSuch variable-safe functions could be recursive:\n        Math::Script 'rec(a) (#[a > 0, rec(a-1), 0]+a);'\n        Math::Script 'R1 = rec(10)'\nwill set R1 to right result 55.\nSometimes functions will need to return more than one value, in this case you\ncould declare argument as referent (b at example):\n        test4(a, &b) (*b = a*a; a*a*a)\nIn this case test4 will return a^3, and if we will call it like that test4(a,c),\nit will place a^2 to c. BUT! Note: you should use de-referencer (*) with variable,\nat example *b. CAUTION: never use the same variable as function internal reference\nvariable and external argument variable (for example test4(a,b)). It will surely \nfail. Also: if you declared argument as reference - you should never supply\na constant expression to it. It could be either array item (array[1]), NSIS\nregister R0, any of the user variables (beside the variable with the same name:), \nbut never the constant.\n\nAnother may-be-useful possibility is to redeclare the function (the usual \ndeclaration at the time when function already defined will simply call that\nfunction). For such task you could use \"#name\", like \"func()(1); #func()(2);\".\nBut beware, function declaration occurs at time of parsing, so it's not possible\nto perform flow controlled declaration. \nSUCH IS NOT POSSIBLE: \"#[a<0, #func()(1), #func()(2)]\"\nIT WILL SIMPLY DEFINE #func as (2), as the latest variant.\n        \n(c) Nik Medved (brainsucker)"
  },
  {
    "path": "setup/nsis/tools/Docs/Modern UI/Changelog.txt",
    "content": "NSIS Modern User Interface\nVersion History\n\n1.81\n* Added MUI_TEXTCOLOR (2018-09-09)\n* Added MUI_PAGE_CUSTOMFUNCTION_DESTROYED (2017-04-03)\n* Added support for MUI_UNCONFIRMPAGE_VARIABLE (RFE #511) (2016-12-30)\n\n1.8 - August 9, 2007\n* Uses the new language files\n* Updated documentation\n* Although MUI_DIRECTORYPAGE_BGCOLOR and MUI_STARTMENUPAGE_BGCOLOR are documented as interface\n  settings that apply to every directory page or Start Menu folder page, they were actually\n  implemented as page specific settings. They have been changed to interface settings.\n* MUI_LANGDLL_DISPLAY now also reads a previously saved language from the registry if the\n  installation is silent.\n* InstallOptions macros have been moved to a separate header file (InstallOptions.nsh).\n  The MUI_INSTALLOPTIONS_* macros are still provided for backwards compatibility and insert the\n  equalivent INSTALLOPTIONS_* macros.\n* Added MUI_CUSTOMFUNCTION_MOUSEOVERSECTION\n\n1.78 - June 8, 2007\n* Added MUI_STARTMENUPAGE_BGCOLOR\n* Added MUI_DIRECTORYPAGE_BGCOLOR\n* Added MUI_LANGDLL_ALLLANGUAGES\n\n1.77 - April 27, 2007\n* Added MUI_FINISHPAGE_CANCEL_ENABLED\n* Added MUI_FINISHPAGE_REBOOTLATER_DEFAULT\n* Block unsupported languages in the language selection dialog\n* Cancel button no longer enabled by default on the finish page\n* Reduced flicker caused by MUI_HEADER_TRANSPARENT_TEXT\n\n1.76 - September 23, 2006\n* Added MUI_ABORTWARNING_CANCEL_DEFAULT\n\n1.75 - April 1, 2006\n* Added show function for the start menu page\n* Added MUI_HEADER_TRANSPARENT_TEXT for transparent header texts\n\n1.74 - September 4, 2005\n* Fixed compile error when checkboxes are used on multiple finish page pages\n\n1.73 - August 6, 2005\n* The checkboxes to run an application or show a Readme file can now also be used on an uninstaller\n  finish pages or multiple finish pages\n\n1.72 - November 27, 2004\n* Fixed state of Finish page Cancel button when both an installer and uninstaller page is included\n\n1.71 - October 14, 2004\n* The selected language is only stored in the registry when installation was successful\n\n1.70 - February 6, 2004\n* Improved documentation\n* New Init custom function for Welcome and Finish page\n\n1.69 - January 7, 2004\n* All uninstaller pages work without installer pages\n* Fixed top text on uninstaller license page\n\n1.68 - November 24, 2003\n* New settings for extra space for title and text on Welcome and Finish page.\n* Improved handling of verbose settings. Define MUI_VERBOSE the set the Modern UI verbose level (1-4).\n* Language file string for uninstaller reboot information\n* Setting for folder validation in leave function\n* Fixed finish page text settings for multiple pages\n\n1.67 - November 18, 2003\n* Support for uninstaller Welcome pages and Finish pages\n* Improved and changed text settings\n* ID for Start Menu Folder pages, easier to use multiple pages\n* Renamed a few settings\n* Default header image\n* Support for uninstaller abort warning\n* Setting for 3 line text on Welcome and Finish page\n  (NOTE: New settings have been introduced in version 1.68)\n* Language file backwards compatibility: English for missing strings\n* Support for different uninstaller header image\n* Language selection dialog not displayed if installer is silent\n* Cancel button on Finish page when there are options\n* Full RTL support\n\n1.66 - October 7, 2003\n* New system for page settings and custom pages\n* Support for uninstaller components page\n* Support for multiple pages of the same type\n* New position for interface settings\n* Changed macro and setting names\n* Updated language system, new language files and settings\n* Removed MUI_BRANDINGTEXT. You can use the standard BrandingText instruction.\n* Removed MUI_PRODUCT and MUI VERSION. You can use the standard Name instruction.\n\n1.65 - July 16, 2003\n* New page configuration system, no different system for installers with custom pages\n* Default windows color for the license text background\n* Example script updates (new format, user variables)\n* Improved registry storage for Start Menu folder\n* ReserveFile macro for StartMenu plug-in\n* Option to always show the language selection dialog (even if a language has been stored in the registry)\n* Checkboxes on Finish page can be used to call a function\n* Support for custom leave functions for Start Menu Folder, Welcome and Finish pages\n* Support for a link on the Finish page\n* New macro to get Start Menu folder in uninstaller\n* Options to disable bitmap stretching\n* Components page description box info text: always displayed\n  when mouse is outside box, disabled style\n\n1.64 - April 27, 2003\n* Support for license page with checkbox or radiobuttons to let the user accept the agreement or not\n* Macros for finish headers don't have to be inserted anymore\n* Language preference stored when installation has completed, no problems anymore when the users selects the wrong language\n* Header text for aborted installation\n* New macros: get language for uninstaller, delete shortcuts\n* Language specific fonts\n* Welcome/Finish page INI files can be modified in pre functions\n* More texts can be customized\n\n1.63 - March 9, 2003\n* Support for a bitmap in the wizard header\n* New defines to change the components page interface\n* MUI_SYSTEM inserted automatically\n* Single macro for language selection dialog\n* Removed page description in window title\n* Easier to customize resource files\n* New system for custom functions\n* Start Menu folder registry key automatically written\n* New InstallOptions macros that do not remove the return value from the stack\n* Support for custom pages before the finish page\n* Renamed Start Menu page defines\n* 'Do not create shortcuts' checkbox can be removed\n* 'MS Shell Dlg' font for header title\n* RTL support\n* Documentation updates\n* Minor fixes\n\n1.62 - February 2, 2003\n* New language strings for Finish page\n* Possibility to let a Modern UI Function call your own function\n* No problems anymore when using both 'Run program' and 'Show Readme' on the Finish page\n* Default state of checkboxes on the finish page can be changed\n* Welcome / Finish page compatible with custom DPI settings\n* Converted Install Options INI files to use dialog units\n* More ReserveFile macros\n  (NOTE: Some of these macros have been removed in later versions)\n* Background color can be changed with a define\n* Support for multilingual branding texts\n* Start Menu / Finish page window titles also work when using custom page commands\n* Language files should be inserted after inserting the MUI_SYSTEM macro\n  (NOTE: The MUI_SYSTEM macro has been removed in version 1.63)\n* Define MUI_MANUALVERBOSE if you don't want the Modern UI to change the verbose settings during compilation\n  (NOTE: This setting has been changed in version 1.68)\n    \n1.61 - December 5, 2002\n* modern3.exe UI without description area\n  (NOTE: This setting has been changed in version 1.63)\n* Added define to show uninstall confirm page\n* Added language string for finish page title and continue to uninstall\n* Define for parameters for the application to run on the finish page\n* Minor fixes\n\n1.6 - November 18, 2002\n* Welcome / Finish page\n* Automatic ask for reboot on finish page\n* Create no shortcut option on the Start Menu Folder selection page\n* Customizing GUIInit functions easier\n* Minor font / UI changes\n\n1.5 - November 11, 2002\n* New language file format\n* Language strings can be changed in the script without editing languagefiles\n* Start Menu Folder selection page\n* 'Click Next to continue' and 'Click Install to start the installation' texts automatically change to the page order\n* Install Options macros updated. MUI_INSTALLOPTIONS_DISPLAY is the standard macro now.\n  Use MUI_INSTALLOPTIONS_INITDIALOG and MUI_INSTALLOPTIONS_SHOW if you want to customize dialog controls.\n* No more writing window titles & abort warnings to Install Options INI Files\n* Compatible with updated paging system\n* Renamed macros and defines\n* Minor fixes\n\n1.4 - November 4, 2002\n* Uses new NSIS Page command\n* Macro System updates (smaller)\n* Macro System a lot easier\n* Modern UI Language Files load NLF language files\n* Renamed macros and defines\n\n1.3 - October 27, 2002\n* Easier macro system for basic scripts\n* New MultiLanguage system using Modern UI Language Files\n* New directory structure (header/language files in Contrib\\Modern UI)\n* Small bugfixes & typo corrections\n* SetPage function should be set using defines\n* Different NextPage/PrevPage/FinishHeader macros for install/uninstall\n  (NOTE: These macros have been removed in version 1.4)\n* Interface settings can be defined (for example, MUI_ICON), no parameters for MUI_INTERFACE anymore\n* New Install Options macros to read/write IO INI file value\n\n1.21 - September 30, 2002\n* Temp vars set in Modern UI header\n* Currentpage & Install Options vars should be set using\n  parameters of the MUI_INTERFACE and * MUI_INSTALLOPTIONS macros\n  (NOTE: The MUI_INTERFACE macro has been removed in version 1.3)\n* MultiLanguage.nsi uses the new language strings\n\n1.2 - September 22, 2002\n  (NOTE: All macros mentioned here have been removed in version 1.4)\n  \n* Lots of macro system updates & fixes\n* InstallOptions support in macro system\n* Added Modern UI + InstallOptions example (InstallOptions.nsi)\n* MUI_NEXTPAGE_OUTER integrated in MUI_NEXTPAGE\n* No hard-coded function names anymore (you should give\n  MUI_PREVPAGE a parameter with the set page function name\n  (for example, MUI_PREVPAGE SetPage)\n* Examples use ReserveFile for faster startup\n\n1.19 - Semtember 19, 2002\n* Renamed some macros\n* Custom code can be used between page start/stop macros\n  (NOTE: These macros have been removed in version 1.4)\n\n1.18 - Semtember 13, 2002\n* Uses the new Sendmessage string option\n\n1.17 - Semtember 10, 2002\n* Win9x font weight bug fixed (font of title in white rect)\n\n1.16 - Semtember 6, 2002\n* Change text 'Scroll down' on license page to 'Press Page Down',\n  because the RichEdit control has focus by default now\n\n1.15 - Semtember 4, 2002\n* Multilanguage example: changed LangDialog to LangDLL::LangDialog (using the DLL name is now required)\n  (NOTE: A new macro for the language selection dialog has been introduced in version 1.63)\n\n1.14 - Semtember 3, 2002\n* Small grammar fix (thanks eccles)\n* UI files updated by Justin for better RichEdit usage\n\n1.13 - Semtember 2, 2002\n* Added 16 color icons \n\n1.12 - August 30, 2002\n* Verifying installer & Unpacking data dialog has no titlebar anymore\n\n1.11 - August 29, 2002\n* Finish header for uninstaller can also be set using MUI_FINISHHEADER\n  (NOTE: The MUI_FINISHHEADER macro has been removed in version 1.64)\n\n1.1 - August 29, 2002\n  (NOTE: All settings mentioned here do not exist anymore)\n\n* Header file with macros, it's now very easy to use the UI in your scripts\n* Added the modern2.exe UI, with an other location of the Description frame, for installers with a lot of subsections (thanks rainwater)\n* Updated example scripts\n* Added Multilanguage.nsi example (Multilanguage & LangDLL)\n* Fixed background color issue with some custom XP themes\n* Removed WS_VISIBLE from black rect for inner dialog (fixes display issues)\n* Changed size of description area\n* Example script: Added instructions for the user on the Description frame\n* Auto sizing branding text\n* Used modern.bmp for the checks (thanks rainwater)\n* Using the new NSIS version, descriptions work using the keyboard and you can give descriptions to subsections\n* Correct font size using High-DPI fonts\n\n1.0 - August 26, 2002\n* Initial release"
  },
  {
    "path": "setup/nsis/tools/Docs/Modern UI/License.txt",
    "content": "Copyright 2002-2022 Joost Verburg\n\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.\n"
  },
  {
    "path": "setup/nsis/tools/Docs/Modern UI/Readme.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n    <title>NSIS Modern User Interface - Documentation</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <style type=\"text/css\">\n        /*<![CDATA[*/\n        html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; }\n        html { font-size: 0.80em; }\n        body { font-size: 1em; font-size: 1rem; }\n        pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }\n        body\n        {\n            padding:1.5em 0; margin:0;\n            background-color: #F0F0F0;\n            font-family: Verdana, Arial, Helvetica, sans-serif;\n            font-weight: normal;\n            text-align: justify;\n        }\n        p, li\n        {\n            font-size: 100%;\n        }\n        table\n        {\n            margin: auto;\n            background-color: #FFFFFF;\n        }\n        .maintable\n        {\n            border: 2px solid #376EAB;\n            width: 90%;\n        }\n        .parameter\n        {\n            font-weight: bold;\n            color: #6586AC;\n        }\n        h1\n        {\n            font-size: 140%;\n            color: #7A7272;\n            font-weight: normal;\n        }\n        h2\n        {\n            font-size: 130%;\n            font-weight: bold;\n            color: #303030;\n        }\n        h3\n        {\n            font-size: 120%;\n            font-weight: bold;\n            color: #2B5885;\n        }\n        div\n        {\n            margin: 1.1em;\n        }\n        div.settings\n        {\n            margin-right: 0;\n        }\n        a:link, a:visited, a:active\n        {\n            color: #294F75;\n            text-decoration: none;\n        }\n        a:hover\n        {\n            color: #182634;\n            text-decoration: underline;\n        }\n        .trigger\n        {\n            cursor: pointer;\n            cursor: hand;\n            height: 14px;\n        }\n        .toggle\n        {\n            display: block;\n        }\n        .options\n        {\n            text-align: center;\n            cursor: pointer;\n            cursor: hand;\n            color: #294F75;\n        }\n        /*]]>*/</style>\n\n    <script type=\"text/javascript\">\n//<![CDATA[\n\n   var image_open = new Image();\n   image_open.src = \"images/open.gif\";\n   var image_closed = new Image();\n   image_closed.src = \"images/closed.gif\";\n\n   function GEBY(d, i) { return d.getElementById ? d.getElementById(i) : document.all ? document.all[i] : 0 }\n\n   function toggle(image, section) {\n\n      if (section = GEBY(document, section))\n      {\n         image = GEBY(document, image);\n         if (section.style.display != \"none\")\n         {\n            section.style.display = \"none\";\n            image.src = image_closed.src;\n         }\n         else\n         {\n            section.style.display = \"block\";\n            image.src = image_open.src;\n         }\n      }\n   }\n\n   function expandall() {\n\n     var divNodeList = document.getElementsByTagName('div'); \n     for (i = 0; i < divNodeList.length; i++) { \n        if(divNodeList[i].id) {\n           divNodeList[i].style.display = \"block\";\n           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = \"images/open.gif\";\n        }\n     }\n     \n   }\n\n   function collapseall() {\n\n     var divNodeList = document.getElementsByTagName('div'); \n     for (i = 0; i < divNodeList.length; i++) { \n        if(divNodeList[i].id) {\n           divNodeList[i].style.display = \"none\";\n           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = \"images/closed.gif\";\n        }\n     }\n\n   }\n\n   function onDocLoad() {\n\n      toggle('trigger_scr', 'toggle_scr');\n      toggle('trigger_lic', 'toggle_lic');\n   }\n\n//]]>\n    </script>\n\n</head>\n<body onLoad=\"onDocLoad()\">\n    <table width=\"750\" class=\"maintable\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n        <tr>\n            <td>\n                <img src=\"images/header.gif\" width=\"750\" height=\"80\" alt=\"\" />\n                <p class=\"options\">\n                    <a onclick=\"expandall()\">[Expand all]</a>&nbsp; &nbsp;<a onclick=\"collapseall()\">[Collapse\n                        all]</a></p>\n                <div>\n                    <h1>\n                        Introduction</h1>\n                    <div>\n                        <p>\n                            The Modern UI provides a user interface for NSIS installers with a modern wizard\n                            style, similar to the wizards of recent Windows versions. It is based on the basic\n                            user interface that is provided by the NSIS compiler itself and extends it with\n                            more interface features and pages.</p>\n                        <p>\n                            All standard NSIS pages (such as the pages to select components and the installation\n                            folder) are supported as well as a number of additional pages. The welcome page\n                            allows you to provide an introduction to the installation process, while the finish\n                            page provides a way to let the user decide what steps should be performed after\n                            the setup wizard is closed (for example, whether the application should be started\n                            immediately). A finish page can also be used to ask for a system restart is necessary.</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_scr\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_scr', 'toggle_scr');\" />\n                            Screenshots</h3>\n                        <div class=\"toggle\" id=\"toggle_scr\">\n                            <p><img src=\"images/screen1.png\" width=\"503\" height=\"393\" alt=\"\" /></p>\n                            <p><img src=\"images/screen2.png\" width=\"503\" height=\"393\" alt=\"\" /></p>\n                        </div>\n                    </div>\n                    <h1>\n                        Script header</h1>\n                    <div>\n                        <p>\n                            The settings for the Modern UI should be inserted in the header of the script file.\n                            It&#39;s important to follow the same order as the items below.&nbsp;For example,\n                            interface settings should be defined before you insert pages, because the pages\n                            depend on the interface configuration. It may be useful to look at the <a href=\"#examples\">\n                                example scripts</a> too see how this is done in actual script files.</p>\n                        <p>\n                            Parameters are given in this format: <span class=\"parameter\">required (option1 | option2)\n                                [optional]</span></p>\n                        <h2>\n                            1. Header file</h2>\n                        <div>\n                            <p>\n                                First of all, add this line to the top of script to include the Modern UI:</p>\n                            <pre>\n!include &quot;MUI.nsh&quot;\n</pre>\n                        </div>\n                        <h2>\n                            2. Interface configuration</h2>\n                        <div>\n                            <p>\n                                Then, you may want to use interface settings to change the look and feel of the\n                                installer. These settings apply to all pages.<p>\n                                    The interface settings provided by the NSIS compiler itself (such as LicenseText,\n                                    Icon, CheckBitmap, InstallColors) should not be used in Modern UI scripts. The Modern\n                                    UI provides equalivent or extended versions of these settings.<p>\n                                        Examples:</p>\n                                    <pre>\n!define MUI_COMPONENTSPAGE_SMALLDESC ;No value\n!define MUI_UI &quot;myUI.exe&quot; ;Value\n!define MUI_INSTFILESPAGE_COLORS &quot;FFFFFF 000000&quot; ;Two colors\n</pre>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_in\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_in', 'toggle_in');\" />\n                                        Interface settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_in\">\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ingen\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_ingen', 'toggle_ingen');\" />\n                                            Page header</h3>\n                                        <div class=\"toggle\" id=\"toggle_ingen\">\n                                            <p>\n                                                <strong>MUI_ICON</strong> <span class=\"parameter\">icon_file</span><br />\n                                                The icon for the installer.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-install.ico</em></p>\n                                            <p>\n                                                <strong>MUI_UNICON</strong> <span class=\"parameter\">icon_file</span><br />\n                                                The icon for the uninstaller.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-uninstall.ico</em></p>\n                                            <p>\n                                                <strong>MUI_HEADERIMAGE</strong><br />\n                                                Display an image on the header of the page.</p>\n                                            <div class=\"settings\">\n                                                <p>\n                                                    <strong>MUI_HEADERIMAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                    Bitmap image to display on the header of installers pages (recommended size: 150x57\n                                                    pixels).<br />\n                                                    <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp</em></p>\n                                                <div class=\"settings\">\n                                                    <p>\n                                                        <strong>MUI_HEADERIMAGE_BITMAP_NOSTRETCH</strong><br />\n                                                        Do not stretch the installer header bitmap to fit the size of the field. Use this\n                                                        option only if you have an image that does not use the whole space. If you have\n                                                        a full size bitmap that fits exactly, you should not use this option because the\n                                                        size of the field will be different if the user has a custom DPI setting.</p>\n                                                    <p>\n                                                        <strong>MUI_HEADERIMAGE_BITMAP_RTL</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                        Bitmap image to display on the header of installers pages when using a RTL language\n                                                        (recommended size: 150x57 pixels).<br />\n                                                        <em>Default: Non-RTL bitmap</em></p>\n                                                    <div class=\"settings\">\n                                                        <p>\n                                                            <strong>MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH</strong><br />\n                                                            Do not stretch the installer header bitmap when using a RTL language to fit the\n                                                            size of the field. Use this option only if you have an image that does not use the\n                                                            whole space. If you have a full size bitmap that fits exactly, you should not use\n                                                            this option because the size of the field will be different if the user has a custom\n                                                            DPI setting.</p>\n                                                    </div>\n                                                </div>\n                                                <p>\n                                                    <strong>MUI_HEADERIMAGE_UNBITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                    Bitmap image to display on the header of uninstaller pages (recommended size: 150x57\n                                                    pixels).<br />\n                                                    <em>Default: Installer header bitmap</em></p>\n                                                <div class=\"settings\">\n                                                    <p>\n                                                        <strong>MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH</strong><br />\n                                                        Do not stretch the uninstaller header bitmap to fit the size of the field. Use this\n                                                        option only if you have an image that does not use the whole space. If you have\n                                                        a full size bitmap that fits exactly, you should not use this option because the\n                                                        size of the field will be different if the user has a custom DPI setting.</p>\n                                                    <p>\n                                                        <strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                        Bitmap image to display on the header of uninstallers pages when using a RTL language\n                                                        (recommended size: 150x57 pixels).<br />\n                                                        <em>Default: Installer RTL header bitmap</em></p>\n                                                    <div class=\"settings\">\n                                                        <p>\n                                                            <strong>MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH</strong><br />\n                                                            Do not stretch the uninstaller header bitmap when using a RTL language to fit the\n                                                            size of the field. Use this option only if you have an image that does not use the\n                                                            whole space. If you have a full size bitmap that fits exactly, you should not use\n                                                            this option because the size of the field will be different if the user has a custom\n                                                            DPI setting.</p>\n                                                    </div>\n                                                </div>\n                                                <p>\n                                                    <strong>MUI_HEADERIMAGE_RIGHT</strong><br />\n                                                    Display the header image on the right side instead of the left side (when using\n                                                    a RTL language it will be displayed on the left side instead of the right side).</p>\n                                            </div>\n                                            <p>\n                                                <strong>MUI_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n                                                Background color for the header, the Welcome page and the Finish page.<br />\n                                                <em>Default: FFFFFF</em></p>\n                                            <p>\n                                                <strong>MUI_HEADER_TRANSPARENT_TEXT</strong><br />\n                                                Set a transparent background for the header's label controls. Useful for custom\n                                                user interfaces that set a bigger header image.</p>\n                                            <p>\n                                                <strong>MUI_TEXTCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n                                                Text color for the header, the Welcome page and the Finish page.<br />\n                                                <em>Default: 000000</em></p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inres\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inres', 'toggle_inres');\" />\n                                            Interface resources</h3>\n                                        <div class=\"toggle\" id=\"toggle_inres\">\n                                            <p>\n                                                <strong>MUI_UI</strong> <span class=\"parameter\">ui_file</span><br />\n                                                The interface file with the dialog resources. Change this if you have made your\n                                                own customized UI.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern.exe</em></p>\n                                            <p>\n                                                <strong>MUI_UI_HEADERIMAGE</strong> <span class=\"parameter\">ui_file</span><br />\n                                                The interface files with the dialog resource IDD_INST that contains a bitmap control\n                                                and space for the header bitmap.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe</em></p>\n                                            <p>\n                                                <strong>MUI_UI_HEADERIMAGE_RIGHT</strong> <span class=\"parameter\">ui_file</span><br />\n                                                The interface files with the dialog resource IDD_INST that contains a bitmap control\n                                                and space for the header bitmap on the right side.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmpr.exe</em></p>\n                                            <p>\n                                                <strong>MUI_UI_COMPONENTSPAGE_SMALLDESC</strong> <span class=\"parameter\">ui_file</span><br />\n                                                The interface files with a customized dialog resource IDD_SELCOM with a small description\n                                                area.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_smalldesc.exe</em></p>\n                                            <p>\n                                                <strong>MUI_UI_COMPONENTSPAGE_NODESC</strong> <span class=\"parameter\">ui_file</span><br />\n                                                The interface files with a customized dialog resource IDD_SELCOM without a description\n                                                area.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_nodesc.exe</em></p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inwf\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inwf', 'toggle_inwf');\" />\n                                            Installer welcome/finish page</h3>\n                                        <div class=\"toggle\" id=\"toggle_inwf\">\n                                            <p>\n                                                <strong>MUI_WELCOMEFINISHPAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp</em></p>\n                                            <div class=\"settings\">\n                                                <p>\n                                                    <strong>MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />\n                                                    Do not stretch the bitmap for the Welcome and Finish page to fit the size of the\n                                                    field. Use this option only if you have an image that does not use the whole space.\n                                                    If you have a full size bitmap that fits exactly, you should not use this option\n                                                    because the size of the field will be different if the user has a custom DPI setting.</p>\n                                            </div>\n                                            <p>\n                                                <strong>MUI_WELCOMEFINISHPAGE_INI</strong> <span class=\"parameter\">ini_file</span><br />\n                                                InstallOptions INI file for the Welcome page and the Finish page.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Modern UI\\ioSpecial.ini</em></p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inuwf\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inuwf', 'toggle_inuwf');\" />\n                                            Uninstaller welcome/finish page</h3>\n                                        <div class=\"toggle\" id=\"toggle_inuwf\">\n                                            <p>\n                                                <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp</em></p>\n                                            <div class=\"settings\">\n                                                <p>\n                                                    <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />\n                                                    Do not stretch the bitmap for the Welcome and Finish page to fit the size of the\n                                                    field. Use this option only if you have an image that does not use the whole space.\n                                                    If you have a full size bitmap that fits exactly, you should not use this option\n                                                    because the size of the field will be different if the user has a custom DPI setting.</p>\n                                            </div>\n                                            <p>\n                                                <strong>MUI_UNWELCOMEFINISHPAGE_INI</strong> <span class=\"parameter\">ini_file</span><br />\n                                                InstallOptions INI file for the uninstaller Welcome page and the Finish page.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Modern UI\\ioSpecial.ini</em></p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inl\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inl', 'toggle_inl');\" />\n                                            License page</h3>\n                                        <div class=\"toggle\" id=\"toggle_inl\">\n                                            <p>\n                                                <strong>MUI_LICENSEPAGE_BGCOLOR</strong> <span class=\"parameter\">(/windows | /grey |\n                                                    (color: RRGGBB hexadecimal))</span><br />\n                                                The background color for the license textbox. Use /windows for the Windows text\n                                                background color (usually white). Use the /grey for the window background color\n                                                (usually grey).<br />\n                                                <em>Default: /windows</em></p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inc\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inc', 'toggle_inc');\" />\n                                            Components page</h3>\n                                        <div class=\"toggle\" id=\"toggle_inc\">\n                                            <p>\n                                                <strong>MUI_COMPONENTSPAGE_CHECKBITMAP</strong> <span class=\"parameter\">bitmap_file</span><br />\n                                                The bitmap with images for the checks of the component select treeview.<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp</em></p>\n                                            <p>\n                                                <strong>MUI_COMPONENTSPAGE_SMALLDESC</strong><br />\n                                                A small description area on the bottom of the page. Use this layout if you have\n                                                a lot of sections and don't need large descriptions.</p>\n                                            <p>\n                                                <strong>MUI_COMPONENTSPAGE_NODESC</strong><br />\n                                                No description area.</p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ind\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_ind', 'toggle_ind');\" />\n                                            Directory page</h3>\n                                        <div class=\"toggle\" id=\"toggle_ind\">\n                                            <p>\n                                                <strong>MUI_DIRECTORYPAGE_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n                                                The background color for the directory textbox.</p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ins\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_ins', 'toggle_ins');\" />\n                                            Start Menu folder page</h3>\n                                        <div class=\"toggle\" id=\"toggle_ins\">\n                                            <p>\n                                                <strong>MUI_STARTMENUPAGE_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n                                                The background color for the startmenu directory list and textbox.</p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ini\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_ini', 'toggle_ini');\" />\n                                            Installation page</h3>\n                                        <div class=\"toggle\" id=\"toggle_ini\">\n                                            <p>\n                                                <strong>MUI_INSTFILESPAGE_COLORS</strong> <span class=\"parameter\">(/windows | &quot;(foreground\n                                                    color: RRGGBB hexadecimal) (background color: RRGGBB hexadecimal)&quot;)</span><br />\n                                                The colors of the details screen. Use /windows for the default Windows colors.<br />\n                                                <em>Default: /windows</em></p>\n                                            <p>\n                                                <strong>MUI_INSTFILESPAGE_PROGRESSBAR</strong> <span class=\"parameter\">(&quot;&quot;\n                                                    | colored | smooth)</span><br />\n                                                The style of the progress bar. Colored makes it use the MUI_INSTALLCOLORS.<br />\n                                                <em>Default: smooth</em></p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inf\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inf', 'toggle_inf');\" />\n                                            Installer finish page</h3>\n                                        <div class=\"toggle\" id=\"toggle_inf\">\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_NOAUTOCLOSE</strong><br />\n                                                Do not automatically jump to the finish page, to allow the user to check the install\n                                                log.</p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_uinf\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_uinf', 'toggle_uinf');\" />\n                                            Uninstaller finish page</h3>\n                                        <div class=\"toggle\" id=\"toggle_uinf\">\n                                            <p>\n                                                <strong>MUI_UNFINISHPAGE_NOAUTOCLOSE</strong><br />\n                                                Do not automatically jump to the finish page, to allow the user to check the uninstall\n                                                log.</p>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inaw\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inaw', 'toggle_inaw');\" />\n                                            Abort warning</h3>\n                                        <div class=\"toggle\" id=\"toggle_inaw\">\n                                            <p>\n                                                <strong>MUI_ABORTWARNING</strong><br />\n                                                Show a message box with a warning when the user wants to close the installer.</p>\n                                            <div class=\"settings\">\n                                                <p>\n                                                    <strong>MUI_ABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                                    Text to display on the abort warning message box.</p>\n                                                <p>\n                                                    <strong>MUI_ABORTWARNING_CANCEL_DEFAULT</strong><br />\n                                                    Set the Cancel button as the default button on the message box.</p>\n                                            </div>\n                                        </div>\n                                        <h3>\n                                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inuaw\" src=\"images/open.gif\"\n                                                onclick=\"toggle('trigger_inuaw', 'toggle_inuaw');\" />\n                                            Uninstaller abort warning</h3>\n                                        <div class=\"toggle\" id=\"toggle_inuaw\">\n                                            <p>\n                                                <strong>MUI_UNABORTWARNING</strong><br />\n                                                Show a message box with a warning when the user wants to close the uninstaller.</p>\n                                            <div class=\"settings\">\n                                                <p>\n                                                    <strong>MUI_UNABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                                    Text to display on the abort warning message box.</p>\n                                                <p>\n                                                    <strong>MUI_UNABORTWARNING_CANCEL_DEFAULT</strong><br />\n                                                    Set the Cancel button as the default button on the message box.</p>\n                                            </div>\n                                        </div>\n                                    </div>\n                        </div>\n                        <h2>\n                            3. Pages</h2>\n                        <div>\n                            <p>\n                                Insert the following macros to set the pages you want to use. The pages will appear\n                                in the order in which you insert them in the script. You can also insert custom\n                                Page commands between the macros to add custom pages.</p>\n                            <p>\n                                You can add multiple pages of certain types (for example, if you want the user to\n                                specify multiple folders).</p>\n                            <p>\n                                Examples:</p>\n                            <pre>\n!insertmacro MUI_PAGE_LICENSE &quot;License.rtf&quot;\n!insertmacro MUI_PAGE_COMPONENTS\n\nVar StartMenuFolder\n!insertmacro MUI_PAGE_STARTMENU &quot;Application&quot; $StartMenuFolder\n</pre>\n                            <p>\n                                You will need the page ID for the Start Menu folder page when using the Start Menu\n                                folder macros. The folder will be stored in the specified variable.</p>\n                            <p>\n                                <strong>Installer pages</strong><br />\n                                MUI_PAGE_WELCOME<br />\n                                MUI_PAGE_LICENSE <span class=\"parameter\">textfile</span><br />\n                                MUI_PAGE_COMPONENTS<br />\n                                MUI_PAGE_DIRECTORY<br />\n                                MUI_PAGE_STARTMENU <span class=\"parameter\">pageid variable</span><br />\n                                MUI_PAGE_INSTFILES<br />\n                                MUI_PAGE_FINISH</p>\n                            <p>\n                                <strong>Uninstaller pages</strong><br />\n                                MUI_UNPAGE_WELCOME<br />\n                                MUI_UNPAGE_CONFIRM<br />\n                                MUI_UNPAGE_LICENSE <span class=\"parameter\">textfile</span><br />\n                                MUI_UNPAGE_COMPONENTS<br />\n                                MUI_UNPAGE_DIRECTORY<br />\n                                MUI_UNPAGE_INSTFILES<br />\n                                MUI_UNPAGE_FINISH</p>\n                            <h3>\n                                <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pg\" src=\"images/open.gif\"\n                                    onclick=\"toggle('trigger_pg', 'toggle_pg');\" />\n                                Page settings</h3>\n                            <div class=\"toggle\" id=\"toggle_pg\">\n                                <p>\n                                    Page settings apply to a single page and should be set before inserting a page macro.\n                                    The same settings can be used for installer and uninstaller pages. You have to repeat\n                                    the setting if you want it to apply to multiple pages. Example:</p>\n                                <pre>\n;Add a directory page to let the user specify a plug-ins folder\n;Store the folder in $PluginsFolder\n\nVar PLUGINS_FOLDER\n!define MUI_DIRECTORYPAGE_VARIABLE $PluginsFolder\n!insertmacro MUI_PAGE_DIRECTORY\n</pre>\n                                <p>\n                                    <p>\n                                        All standard texts in the user interface are loaded from language files, which are\n                                        available for all languages supported by NSIS. So you only need to define these\n                                        texts if you want to change the default.</p>\n                                    <p>\n                                        If the parameter is a text that should be different for each language, define a\n                                        language string using LangString and use $(LangStringName) as value. For a license\n                                        text in multiple languages, LicenseLangString can be used. Refer the NSIS Users\n                                        Manual for more information about installers with multiple languages.</p>\n                                    <p>\n                                        In all text settings, the doublequote character (&quot;) should be escaped in the\n                                        following form: $\\&quot;</p>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgg\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgg', 'toggle_pgg');\" />\n                                        General page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgg\">\n                                        <p>\n                                            <strong>MUI_PAGE_HEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the header of the page.</p>\n                                        <p>\n                                            <strong>MUI_PAGE_HEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Subtext to display on the header of the page.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgw\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgw', 'toggle_pgw');\" />\n                                        Welcome page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgw\">\n                                        <p>\n                                            To add a newline to any of these texts, use \\r\\n instead of $\\r$\\n.</p>\n                                        <p>\n                                            <strong>MUI_WELCOMEPAGE_TITLE</strong> <span class=\"parameter\">title</span><br />\n                                            Title to display on the top of the page.</p>\n                                        <p>\n                                            <strong>MUI_WELCOMEPAGE_TITLE_3LINES</strong><br />\n                                            Extra space for the title area.</p>\n                                        <p>\n                                            <strong>MUI_WELCOMEPAGE_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the page.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgl\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgl', 'toggle_pgl');\" />\n                                        License page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgl\">\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the top of the page.</p>\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_TEXT_BOTTOM</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the bottom of the page.</p>\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_BUTTON</strong> <span class=\"parameter\">button_text</span><br />\n                                            Text to display on the 'I Agree' button.</p>\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_CHECKBOX</strong><br />\n                                            Display a checkbox the user has to check to agree with the license terms.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_LICENSEPAGE_CHECKBOX_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                                Text to display next to the checkbox to agree with the license terms.</p>\n                                        </div>\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_RADIOBUTTONS</strong><br />\n                                            Display two radio buttons to allow the user to choose between accepting the license\n                                            terms or not.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT</strong> <span class=\"parameter\">text</span><br />\n                                                Text to display next to the checkbox to accept the license terms.</p>\n                                            <p>\n                                                <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE</strong> <span class=\"parameter\">text</span><br />\n                                                Text to display next to the checkbox to decline the license terms.</p>\n                                        </div>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgc\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgc', 'toggle_pgc');\" />\n                                        Components page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgc\">\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the top of the page.</p>\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_TEXT_COMPLIST</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on next to the components list.</p>\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_TEXT_INSTTYPE</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on next to the installation type combo box.</p>\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the of the top of the description box.</p>\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display inside the description box when no section is selected.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgd\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgd', 'toggle_pgd');\" />\n                                        Directory page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgd\">\n                                        <p>\n                                            <strong>MUI_DIRECTORYPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on top of the page.</p>\n                                        <p>\n                                            <strong>MUI_DIRECTORYPAGE_TEXT_DESTINATION</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the destination folder frame.</p>\n                                        <p>\n                                            <strong>MUI_DIRECTORYPAGE_VARIABLE</strong> <span class=\"parameter\">variable</span><br />\n                                            Variable in which to store the selected folder.<br />\n                                            <em>Default: $INSTDIR</em></p>\n                                        <p>\n                                            <strong>MUI_DIRECTORYPAGE_VERIFYONLEAVE</strong><br />\n                                            Does not disable the Next button when a folder is invalid but allows you to use\n                                            GetInstDirError in the leave function to handle an invalid folder.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgs\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgs', 'toggle_pgs');\" />\n                                        Start Menu folder page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgs\">\n                                        <p>\n                                            <strong>MUI_STARTMENUPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the top of the page.</p>\n                                        <p>\n                                            <strong>MUI_STARTMENUPAGE_TEXT_CHECKBOX</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display next to the checkbox to disable the Start Menu folder creation.</p>\n                                        <p>\n                                            <strong>MUI_STARTMENUPAGE_DEFAULTFOLDER</strong> <span class=\"parameter\">folder</span><br />\n                                            The default Start Menu Folder.</p>\n                                        <p>\n                                            <strong>MUI_STARTMENUPAGE_NODISABLE</strong><br />\n                                            Do not display the checkbox to disable the creation of Start Menu shortcuts.</p>\n                                        <p>\n                                            <strong>MUI_STARTMENUPAGE_REGISTRY_ROOT</strong> <span class=\"parameter\">root</span><br />\n                                            <strong>MUI_STARTMENUPAGE_REGISTRY_KEY</strong> <span class=\"parameter\">key</span><br />\n                                            <strong>MUI_STARTMENUPAGE_REGISTRY_VALUENAME</strong> <span class=\"parameter\">value_name</span><br />\n                                            The registry key to store the Start Menu folder. The page will use it to remember\n                                            the users preference. You should also use for the uninstaller to remove the Start\n                                            Menu folders. Don't forget to remove this key during uninstallation.</p>\n                                        <p>\n                                            For the uninstaller, use the MUI_STARTMENU_GETFOLDER macro to get the Start Menu\n                                            folder:</p>\n                                        <pre>\n!insertmacro MUI_STARTMENU_GETFOLDER page_id $R0\n  Delete &quot;$SMPROGRAMS\\$R0\\Your Shortcut.lnk&quot;\n</pre>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgi\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgi', 'toggle_pgi');\" />\n                                        Installation page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgi\">\n                                        <p>\n                                            <strong>MUI_INSTFILESPAGE_FINISHHEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the header of the installation page when the installation has\n                                            been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>\n                                        <p>\n                                            <strong>MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Subtext to display on the header of the installation page when the installation\n                                            has been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>\n                                        <p>\n                                            <strong>MUI_INSTFILESPAGE_ABORTHEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the header of the installation page when the installation has\n                                            been aborted.</p>\n                                        <p>\n                                            <strong>MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Subext to display on the header of the installation page when the installation has\n                                            been aborted.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgf\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgf', 'toggle_pgf');\" />\n                                        Finish page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgf\">\n                                        <p>\n                                            To add a newline to any of these texts, use \\r\\n instead of $\\r$\\n.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_TITLE</strong> <span class=\"parameter\">title</span><br />\n                                            Title to display on the top of the page.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_TITLE_3LINES</strong><br />\n                                            Extra space for the title area.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the page.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_TEXT_LARGE</strong><br />\n                                            Extra space for the text area (if using checkboxes).</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_BUTTON</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the Finish button.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_CANCEL_ENABLED</strong><br />\n                                            Enable the Cancel button so the user can skip any options displayed on the finish\n                                            page.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_TEXT_REBOOT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the finish page when asking for a system reboot.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_TEXT_REBOOTNOW</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display next to the 'Reboot now' option button.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_TEXT_REBOOTLATER</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display next to the 'Reboot later' option button.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_REBOOTLATER_DEFAULT</strong><br />\n                                            Sets the 'Reboot later' option as the default option.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_RUN</strong> <span class=\"parameter\">exe_file</span><br />\n                                            Application which the user can select to run using a checkbox. You don't need to\n                                            put quotes around the filename when it contains spaces.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_RUN_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                                Texts to display next to the 'Run program' checkbox.</p>\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_RUN_PARAMETERS</strong> <span class=\"parameter\">parameters</span><br />\n                                                Parameters for the application to run. Don't forget to escape double quotes in the\n                                                value (use $\\&quot;).</p>\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_RUN_NOTCHECKED</strong><br />\n                                                Do not check the 'Run program' checkbox by default</p>\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_RUN_FUNCTION</strong> <span class=\"parameter\">function</span><br />\n                                                Call a function instead of executing an application (define MUI_FINISHPAGE_RUN without\n                                                parameters). You can use the function to execute multiple applications or you can\n                                                change the checkbox name and use it for other things.</p>\n                                        </div>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_SHOWREADME</strong> <span class=\"parameter\">file/url</span><br />\n                                            File or website which the user can select to view using a checkbox. You don't need\n                                            to put quotes around the filename when it contains spaces.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_SHOWREADME_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                                Texts to display next to the 'Show Readme' checkbox.</p>\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_SHOWREADME_NOTCHECKED</strong><br />\n                                                Do not check the 'Show Readme' checkbox by default</p>\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_SHOWREADME_FUNCTION</strong> <span class=\"parameter\">function</span><br />\n                                                Call a function instead of showing a file (define MUI_FINISHPAGE_SHOWREADME without\n                                                parameters). You can use the function to show multiple files or you can change the\n                                                checkbox name and use it for other things.</p>\n                                        </div>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_LINK</strong> <span class=\"parameter\">link_text</span><br />\n                                            Text for a link on the which the user can click to view a website or file.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_LINK_LOCATION</strong> <span class=\"parameter\">file/url</span><br />\n                                                Website or file which the user can select to view using the link. You don't need\n                                                to put quotes around the filename when it contains spaces.</p>\n                                            <p>\n                                                <strong>MUI_FINISHPAGE_LINK_COLOR</strong> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n                                                Text color for the link on the Finish page.<br />\n                                                <em>Default: 000080</em></p>\n                                        </div>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_NOREBOOTSUPPORT</strong><br />\n                                            Disables support for the page that allows the user to reboot the system. Define\n                                            this option to save some space if you are not using the /REBOOTOK flag or SetRebootFlag.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgu\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_pgu', 'toggle_pgu');\" />\n                                        Uninstall confirm page settings</h3>\n                                    <div class=\"toggle\" id=\"toggle_pgu\">\n                                        <p>\n                                            <strong>MUI_UNCONFIRMPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display on the top of the page.</p>\n                                        <p>\n                                            <strong>MUI_UNCONFIRMPAGE_TEXT_LOCATION</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display next to the uninstall location text box.</p>\n                                        <p>\n                                            <strong>MUI_UNCONFIRMPAGE_VARIABLE</strong> <span class=\"parameter\">variable</span><br />\n                                        Variable in which to store the uninstall source folder.<br />\n                                        <em>Default: $INSTDIR</em></p>\n                                    </div>\n                            </div>\n                        </div>\n                        <h2>\n                            4. Language files</h2>\n                        <div>\n                            <p>\n                                Insert the Modern UI language files for the languages to want to include.</p>\n                            <pre>\n!insertmacro MUI_LANGUAGE &quot;English&quot;\n</pre>\n                            <p>\n                                The standard NSIS language files are loaded automatically, there is no need to use\n                                LoadLanguageFile.</p>\n                        </div>\n                        <h2>\n                            5. Reserve files</h2>\n                        <div>\n                            <p>\n                                If you are using solid compression, files that are required before the actual installation\n                                should be stored first in the data block, because this will make your installer\n                                start faster. Include reserve file commands for such files before your sections\n                                and functions:</p>\n                            <pre>\nReserveFile &quot;ioFile.ini&quot; ;Your own InstallOptions INI files\n!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in\n!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog\n</pre>\n                        </div>\n                    </div>\n                    <h1>\n                        Script code for pages</h1>\n                    <div>\n                        <p>\n                            Some pages allow you to show additional information or can be used to get user input.\n                            Here you can find the script code to use these features.</p>\n                        <h2>\n                            Components page descriptions</h2>\n                        <div>\n                            <p>\n                                The Modern UI components page has a text box in which a description can be shown\n                                when the user hovers the mouse over a component. If you don't want to use these\n                                descriptions, insert the MUI_COMPONENTSPAGE_NODESC interface setting.</p>\n                            <p>\n                                To set a description for a section, an additional parameter needs to be added to\n                                Section command with a unique identifier for the section. This name can later be\n                                used to set the description for this section.</p>\n                            <pre>\nSection &quot;Section Name 1&quot; Section1\n   ...\nSectionEnd\n</pre>\n                            <p>\n                                After the sections, use these macros to set the descriptions:</p>\n                            <pre>\nLangString DESC_Section1 ${LANG_ENGLISH} &quot;Description of section 1.&quot;\nLangString DESC_Section2 ${LANG_ENGLISH} &quot;Description of section 2.&quot;\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n</pre>\n                            <p>\n                                For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN and MUI_UNFUNCTION_DESCRIPTION_END\n                                macros.</p>\n                        </div>\n                        <h2>\n                            Start Menu folder</h2>\n                        <div>\n                            <p>\n                                Put the code to write the shortcuts (using CreateShortcut) between the MUI_STARTMENU_WRITE_BEGIN\n                                and MUI_STARTMENU_WRITE_END macros:</p>\n                            <pre>\n!insertmacro MUI_STARTMENU_WRITE_BEGIN pageid\n  ...create shortcuts...\n!insertmacro MUI_STARTMENU_WRITE_END\n</pre>\n                            <p>\n                                The page ID should be the ID of the page on which the user has selected the folder\n                                for the shortcuts you want to write.</p>\n                            <p>\n                                The variable which contains the folder and the page ID are set as parameters of\n                                the page macro.</p>\n                        </div>\n                    </div>\n                    <h1>\n                        Language selection dialog</h1>\n                    <div>\n                        <p>\n                            If you want the installer to display a language selection dialog (see the the <a\n                                href=\"../../Examples/Modern%20UI/MultiLanguage.nsi\">MultiLanguage.nsi</a> example),\n                            insert the MUI_LANGDLL_DISPLAY macro in the .onInit function:</p>\n                        <pre>\nFunction .onInit\n\n  !insertmacro MUI_LANGDLL_DISPLAY\n\nFunctionEnd\n</pre>\n                        <p>\n                            This macro can also be used in the un.onInit function.</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_lss\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_lss', 'toggle_lss');\" />\n                            Settings for registry storage of selected language</h3>\n                        <div class=\"toggle\" id=\"toggle_lss\">\n                            <p>\n                                To remember the user's preference, you can define a registry key. These defines\n                                should be set before inserting the installation page macro.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_REGISTRY_ROOT</strong> <span class=\"parameter\">root</span><br />\n                                <strong>MUI_LANGDLL_REGISTRY_KEY</strong> <span class=\"parameter\">key</span><br />\n                                <strong>MUI_LANGDLL_REGISTRY_VALUENAME</strong> <span class=\"parameter\">value_name</span><br />\n                                The registry key to store the language. The users preference will be remembered.\n                                You can also use it for the uninstaller to display the right language. Don't forget\n                                to remove this key in the uninstaller.</p>\n                            <p>\n                                For the uninstaller, insert the MUI_UNGETLANGUAGE macro in un.onInit to get the\n                                stored language preference:</p>\n                            <pre>\nFunction un.onInit\n\n  !insertmacro MUI_UNGETLANGUAGE\n\nFunctionEnd\n</pre>\n                        </div>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_lsin\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_lsin', 'toggle_lsin');\" />\n                            Interface settings for selection dialog</h3>\n                        <div class=\"toggle\" id=\"toggle_lsin\">\n                            <p>\n                                To customize the language selection dialog interface, use these defines before inserting\n                                the MUI_LANGDLL_DISPLAY macro.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_WINDOWTITLE</strong> <span class=\"parameter\">text</span><br />\n                                The window title of the language selection dialog.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_INFO</strong> <span class=\"parameter\">text</span><br />\n                                The text to display on the language selection dialog.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_ALWAYSSHOW</strong><br />\n                                Always show the language selection dialog, even if a language has been stored in\n                                the registry. The language stored in the registry will be selected by default.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_ALLLANGUAGES</strong><br />\n                                Always show all available languages and don't filter according to their codepage.</p>\n                        </div>\n                    </div>\n                    <h1>\n                        Custom pages</h1>\n                    <div>\n                        <p>\n                            If you want add your custom pages to your installer, you can insert your own page\n                            commands between the page macros. The <a href=\"../InstallOptions/Readme.html\">InstallOptions\n                                documentation</a> provides information about creating custom pages using InstallOptions.</p>\n                        <pre>\n!insertmacro MUI_PAGE_WELCOME\nPage custom FunctionName ;Custom page\n!insertmacro MUI_PAGE_COMPONENTS\n \n;Uninstaller\n!insertmacro MUI_UNPAGE_CONFIRM\nUninstPage custom un.FunctionName ;Custom page\n!insertmacro MUI_UNPAGE_INSTFILES\n</pre>\n                        <p>\n                            Use the MUI_HEADER_TEXT macro to set the text on the page header in a page function:</p>\n                        <pre>\nLangString PAGE_TITLE ${LANG_ENGLISH} &quot;Title&quot;\nLangString PAGE_SUBTITLE ${LANG_ENGLISH} &quot;Subtitle&quot;\n\nFunction CustomPageFunction\n  !insertmacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)\n  !insertmacro MUI_INSTALLOPTIONS_DISPLAY &quot;ioFile.ini&quot;\nFunctionEnd\n</pre>\n                    </div>\n                    <h1>\n                        Custom functions</h1>\n                    <div>\n                        <p>\n                            Interface functions provided by NSIS, like the .onGUIInit function and the page\n                            functions are automatically included by the Modern UI and filled with code to support\n                            new interface features. If you want to add additional code to these function, create\n                            a function with the custom script code in the script use the Modern UI functions\n                            call them.</p>\n                        <p>\n                            Example:</p>\n                        <pre class=\"text\">\n!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit\n\nFunction myGUIInit\n  ...your own code...\nFunctionEnd\n</pre>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_cfg\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_cfg', 'toggle_cfg');\" />\n                            General Custom Functions</h3>\n                        <div class=\"toggle\" id=\"toggle_cfg\">\n                            <p>\n                                These defines should be set before inserting the language macros.</p>\n                            <p>\n                                <strong>MUI_CUSTOMFUNCTION_GUIINIT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_UNGUIINIT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_ABORT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_UNABORT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION</strong> <span class=\"parameter\">function</span></p>\n\t\t\t\t\t\t\t<p>\n                                Mouse over functions are only available when the description macros\n\t\t\t\t\t\t\t\t(MUI_FUNCTION_DESCRIPTION_BEGIN) are used. When component page descriptions are not\n\t\t\t\t\t\t\t\tused, regular .onMouseOverSection and un.onMouseOverSection must be used.</p>\n                        </div>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_cfpg\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_cfpg', 'toggle_cfpg');\" />\n                            Page Custom Functions</h3>\n                        <div class=\"toggle\" id=\"toggle_cfpg\">\n                            <p>\n                                These defines should be set before inserting a page macro.</p>\n                            <p>\n                                <strong>MUI_PAGE_CUSTOMFUNCTION_PRE</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_PAGE_CUSTOMFUNCTION_SHOW</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_PAGE_CUSTOMFUNCTION_LEAVE</strong> <span class=\"parameter\">function</span></p>\n                            <p>\n                                <strong>Notes:</strong></p>\n                            <ul>\n                                <li>In the Pre function of the Welcome page and the Finish page, you can write to the\n                                    InstallOptions INI file of the page (ioSpecial.ini)</li>\n                                <li>In the Show function of the Welcome, Finish and StartMenu pages, $MUI_HWND contains\n                                    the HWND of the inner dialog</li>\n                            </ul>\n                        </div>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_cfwf\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_cfwf', 'toggle_cfwf');\" />\n                            Welcome/Finish Page Custom Functions</h3>\n                        <div class=\"toggle\" id=\"toggle_cfwf\">\n                            <p>\n                                This define should be inserted before a single Welcome or Finish page.</p>\n                            <p>\n                                <strong>MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT</strong> <span class=\"parameter\">function</span></p>\n                            <p>\n                                This Init function is called before the InstallOptions INI file for the page is\n                                written, so you can use it to initialize any variables used in the page settings.</p>\n                        </div>\n                    </div>\n                    <h1>\n                        <a name=\"examples\" id=\"examples\">Example scripts</a></h1>\n                    <div>\n                        <p>\n                            Basic: <a href=\"../../Examples/Modern%20UI/Basic.nsi\">Basic.nsi</a><br />\n                            Welcome/Finish page: <a href=\"../../Examples/Modern%20UI/WelcomeFinish.nsi\">WelcomeFinish.nsi</a><br />\n                            Multiple languages: <a href=\"../../Examples/Modern%20UI/MultiLanguage.nsi\">MultiLanguage.nsi</a><br />\n                            Header image: <a href=\"../../Examples/Modern%20UI/HeaderBitmap.nsi\">HeaderBitmap.nsi</a><br />\n                            Custom pages: <strike><a href=\"../../Examples/Modern%20UI/InstallOptions.nsi\">InstallOptions.nsi</a></strike><br />\n                            Start Menu Folder page: <a href=\"../../Examples/Modern%20UI/StartMenu.nsi\">StartMenu.nsi</a></p>\n                    </div>\n                    <h1>\n                        Credits</h1>\n                    <div>\n                        <p>\n                            Written by Joost Verburg.<br />\n                            Icons designed by Nikos Adamamas, aka adni18.<br />\n                            Thanks to Amir Szekely, aka KiCHiK, for his work on NSIS to make this possible.</p>\n                    </div>\n                    <h1>\n                        License</h1>\n                    <div>\n                        <p>\n                            The zlib/libpng license applies to the Modern UI.</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_lic\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_lic', 'toggle_lic');\" />\n                            License Terms</h3>\n                        <div class=\"toggle\" id=\"toggle_lic\">\n                            <pre>\nCopyright &copy; 2002-2022 Joost Verburg\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; \n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.\n</pre>\n                        </div>\n                    </div>\n                </div>\n            </td>\n        </tr>\n    </table>\n</body>\n</html>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/Modern UI 2/License.txt",
    "content": "Copyright  2002-2022 Joost Verburg\n\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution."
  },
  {
    "path": "setup/nsis/tools/Docs/Modern UI 2/Readme.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n    <title>NSIS Modern User Interface - Documentation</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <style type=\"text/css\">\n        /*<![CDATA[*/\n        html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; }\n        html { font-size: 0.80em; }\n        body { font-size: 1em; font-size: 1rem; }\n        pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }\n        body\n        {\n            padding:1.5em 0; margin:0;\n            background-color: #F0F0F0;\n            font-family: Verdana, Arial, Helvetica, sans-serif;\n            font-weight: normal;\n            text-align: justify;\n        }\n        p, li\n        {\n            font-size: 100%;\n        }\n        table\n        {\n            margin: auto;\n            background-color: #FFFFFF;\n        }\n        .maintable\n        {\n            border: 2px solid #376EAB;\n            width: 90%;\n        }\n        .parameter\n        {\n            font-weight: bold;\n            color: #6586AC;\n        }\n        h1\n        {\n            font-size: 140%;\n            color: #7A7272;\n            font-weight: normal;\n        }\n        h2\n        {\n            font-size: 130%;\n            font-weight: bold;\n            color: #303030;\n        }\n        h3\n        {\n            font-size: 120%;\n            font-weight: bold;\n            color: #2B5885;\n        }\n        div\n        {\n            margin: 1.1em;\n        }\n        div.settings\n        {\n            margin-right: 0;\n        }\n        a:link, a:visited, a:active\n        {\n            color: #294F75;\n            text-decoration: none;\n        }\n        a:hover\n        {\n            color: #182634;\n            text-decoration: underline;\n        }\n        .trigger\n        {\n            cursor: pointer;\n            cursor: hand;\n            height: 14px;\n        }\n        .toggle\n        {\n            display: block;\n        }\n        .options\n        {\n            text-align: center;\n            cursor: pointer;\n            cursor: hand;\n            color: #294F75;\n        }\n        /*]]>*/</style>\n\n    <script type=\"text/javascript\">\n//<![CDATA[\n\n   var image_open = new Image();\n   image_open.src = \"images/open.gif\";\n   var image_closed = new Image();\n   image_closed.src = \"images/closed.gif\";\n\n   function GEBY(d, i) { return d.getElementById ? d.getElementById(i) : document.all ? document.all[i] : 0 }\n\n   function toggle(image, section) {\n\n      if (section = GEBY(document, section))\n      {\n         image = GEBY(document, image);\n         if (section.style.display != \"none\")\n         {\n            section.style.display = \"none\";\n            image.src = image_closed.src;\n         }\n         else\n         {\n            section.style.display = \"block\";\n            image.src = image_open.src;\n         }\n      }\n   }\n\n   function expandall() {\n\n     var divNodeList = document.getElementsByTagName('div'); \n     for (i = 0; i < divNodeList.length; i++) { \n        if(divNodeList[i].id) {\n           divNodeList[i].style.display = \"block\";\n           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = \"images/open.gif\";\n        }\n     }\n     \n   }\n\n   function collapseall() {\n\n     var divNodeList = document.getElementsByTagName('div'); \n     for (i = 0; i < divNodeList.length; i++) { \n        if(divNodeList[i].id) {\n           divNodeList[i].style.display = \"none\";\n           document.getElementById('trigger_' + divNodeList[i].id.substr(7)).src = \"images/closed.gif\";\n        }\n     }\n\n   }\n\n   function onDocLoad() {\n\n      toggle('trigger_scr', 'toggle_scr');\n      toggle('trigger_lic', 'toggle_lic');\n   }\n\n//]]>\n    </script>\n\n</head>\n<body onLoad=\"onDocLoad()\">\n    <table width=\"750\" class=\"maintable\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n        <tr>\n            <td>\n                <img src=\"images/header.gif\" width=\"750\" height=\"80\" alt=\"\" />\n                <p class=\"options\">\n                    <a onclick=\"expandall()\">[Expand all]</a>&nbsp; &nbsp;<a onclick=\"collapseall()\">[Collapse\n                        all]</a></p>\n                <div>\n                    <h1>\n                        Introduction</h1>\n                    <div>\n                        <p>\n                            The Modern UI provides a user interface for NSIS installers with a modern wizard\n                            style, similar to the wizards of recent Windows versions. It is based on the basic\n                            user interface that is provided by the NSIS compiler itself and extends it with\n                            more interface features and pages.</p>\n                        <p>\n                            All standard NSIS pages (such as the pages to select components and the installation\n                            folder) are supported as well as a number of additional pages. The welcome page\n                            allows you to provide an introduction to the installation process, while the finish\n                            page provides a way to let the user decide what steps should be performed after\n                            the setup wizard is closed (for example, whether the application should be started\n                            immediately). A finish page can also be used to ask for a system restart is necessary.</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_scr\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_scr', 'toggle_scr');\" />\n                            Screenshots</h3>\n                        <div class=\"toggle\" id=\"toggle_scr\">\n                            <p><img src=\"images/screen1.png\" width=\"503\" height=\"393\" alt=\"\" /></p>\n                            <p><img src=\"images/screen2.png\" width=\"503\" height=\"393\" alt=\"\" /></p>\n                        </div>\n                    </div>\n                    <h1>\n                        Modern UI 2.1</h1>\n                    <div>\n                        <p>\n                            This new version makes it easier to customize pages, because the same method can\n                            be used to&nbsp; change standard NSIS pages as well as additional pages provided\n                            by the Modern UI. It is now also possible for other NSIS plug-ins to add new pages\n                            to the Modern UI. You can expect to see examples of this soon.</p>\n                        <p>\n                            The welcome and finish page are no longer implemented using InstallOptions. Instead,\n                            the new nsDialogs plug-in is used. nsDialogs allows you to create custom pages or\n                            customize existing pages directly from the script.</p>\n                        <p>\n                            To upgrade a Modern UI 1.8 script, you should:</p>\n                        <ul>\n                            <li>Insert the MUI2.nsh header file instead of MUI.nsh.</li>\n                            <li>The macros for InstallOptions have been moved to a separate header file unrelated\n                                to the Modern UI. If you are still using InstallOptions for custom pages, insert\n                                InstallOptions.nsh and use the INSTALLOPTIONS_* macros instead of the MUI_INSTALLOPTIONS_*\n                                macros. The macros themselves have remained the same.</li>\n                            <li>Rewrite customization code for the Modern UI 1.8 welcome and finish pages in which\n                                the InstallOptions INI file is used. nsDialogs commands should be used instead.</li>\n                            <li>Use the standard NSIS method to escape special characters in all texts. For example,\n                                $\\r$\\n creates newline.</li>\n                        </ul>\n                    </div>\n                    <h1>\n                        Script header</h1>\n                    <div>\n                        <p>\n                            The settings for the Modern UI should be inserted in the header of the script file.\n                            It&#39;s important to follow the same order as the items below.&nbsp;For example,\n                            interface settings should be defined before you insert pages, because the pages\n                            depend on the interface configuration. It may be useful to look at the <a href=\"#examples\">\n                                example scripts</a> too see how this is done in actual script files.</p>\n                        <p>\n                            Parameters are given in this format: <span class=\"parameter\">required (option1 | option2)\n                                [optional]</span></p>\n                    </div>\n                    <h2>\n                        1. Header file</h2>\n                    <div>\n                        <p>\n                            First of all, add this line to the top of script to include the Modern UI:</p>\n                        <pre>\n!include MUI2.nsh\n</pre>\n                    </div>\n                    <h2>\n                        2. Interface configuration</h2>\n                    <div>\n                        <p>\n                            Then, you may want to use interface settings to change the look and feel of the\n                            installer. These settings apply to all pages.<p>\n                                The interface settings provided by the NSIS compiler itself (such as LicenseText,\n                                Icon, CheckBitmap, InstallColors) should not be used in Modern UI scripts. The Modern\n                                UI provides equalivent or extended versions of these settings.<p>\n                                    Examples:</p>\n                                <pre>\n!define MUI_COMPONENTSPAGE_SMALLDESC ;No value\n!define MUI_UI &quot;myUI.exe&quot; ;Value\n!define MUI_INSTFILESPAGE_COLORS &quot;FFFFFF 000000&quot; ;Two colors\n</pre>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_in\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_in', 'toggle_in');\" />\n                                    Interface settings</h3>\n                                <div class=\"toggle\" id=\"toggle_in\">\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ingen\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_ingen', 'toggle_ingen');\" />\n                                        Page header</h3>\n                                    <div class=\"toggle\" id=\"toggle_ingen\">\n                                        <p>\n                                            <strong>MUI_ICON</strong> <span class=\"parameter\">icon_file</span><br />\n                                            The icon for the installer.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-install.ico</em></p>\n                                        <p>\n                                            <strong>MUI_UNICON</strong> <span class=\"parameter\">icon_file</span><br />\n                                            The icon for the uninstaller.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-uninstall.ico</em></p>\n                                        <p>\n                                            <strong>MUI_HEADERIMAGE</strong><br />\n                                            Display an image on the header of the page.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_HEADERIMAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                Bitmap image to display on the header of installers pages (recommended size: 150x57\n                                                pixels).<br />\n                                                <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp</em></p>\n                                            <div class=\"settings\">\n                                                <p>\n                                                    <strong>MUI_HEADERIMAGE_BITMAP_STRETCH</strong> <span class=\"parameter\">mode</span><br />\n                                                    <ul>\n                                                    <li><p><strong>FitControl</strong> (Default)<br />\n                                                    Stretch the image to fit the image control.</p>\n                                                    <li><p><strong>NoStretchNoCropNoAlign</strong><br />\n                                                    Do not stretch the image to fit the size of the image control.\n                                                    You should not use this option if you have a full size bitmap that fits exactly because\n                                                    the size of the field will be different if the user has a custom DPI setting or\n                                                    if the installer is using a CJK language.</p>\n                                                    <li><p><strong>NoStretchNoCrop</strong><br />\n                                                    This is similar to NoStretchNoCropNoAlign but will align the image to the right edge when \n                                                    using a RTL language or if MUI_HEADERIMAGE_RIGHT is defined.</p>\n                                                    <li><p><strong>AspectFitHeight</strong><br />\n                                                    Scale the image up or down until it is the same height as the image control while \n                                                    maintaining the image aspect ratio.</p>\n                                                    </ul>\n                                                </p>\n                                                <p>\n                                                    <strong>MUI_HEADERIMAGE_BITMAP_RTL</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                    Bitmap image to display on the header of installers pages when using a RTL language\n                                                    (recommended size: 150x57 pixels).<br />\n                                                    <em>Default: Non-RTL bitmap</em></p>\n                                                <div class=\"settings\">\n                                                    <p>\n                                                        <strong>MUI_HEADERIMAGE_BITMAP_RTL_STRETCH</strong> <span class=\"parameter\">mode</span><br />\n                                                        See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>\n                                                </div>\n                                            </div>\n                                            <p>\n                                                <strong>MUI_HEADERIMAGE_UNBITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                Bitmap image to display on the header of uninstaller pages (recommended size: 150x57\n                                                pixels).<br />\n                                                <em>Default: Installer header bitmap</em></p>\n                                            <div class=\"settings\">\n                                                <p>\n                                                    <strong>MUI_HEADERIMAGE_UNBITMAP_STRETCH</strong> <span class=\"parameter\">mode</span><br />\n                                                    See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>\n                                                <p>\n                                                    <strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong> <span class=\"parameter\">bmp_file</span><br />\n                                                    Bitmap image to display on the header of uninstallers pages when using a RTL language\n                                                    (recommended size: 150x57 pixels).<br />\n                                                    <em>Default: Installer RTL header bitmap</em></p>\n                                                <div class=\"settings\">\n                                                    <p>\n                                                        <strong>MUI_HEADERIMAGE_UNBITMAP_RTL_STRETCH</strong> <span class=\"parameter\">mode</span><br />\n                                                        See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>\n                                                </div>\n                                            </div>\n                                            <p>\n                                                <strong>MUI_HEADERIMAGE_RIGHT</strong><br />\n                                                Display the header image on the right side instead of the left side (when using\n                                                a RTL language it will be displayed on the left side instead of the right side).</p>\n                                        </div>\n                                        <p>\n                                            <strong>MUI_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n                                            Background color for the header, the Welcome page and the Finish page.<br />\n                                            <em>Default: FFFFFF</em></p>\n                                        <p>\n                                            <strong>MUI_HEADER_TRANSPARENT_TEXT</strong><br />\n                                            Set a transparent background for the header's label controls. Useful for custom\n                                            user interfaces that set a bigger header image.</p>\n                                        <p>\n                                            <strong>MUI_TEXTCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n                                            Text color for the header, the Welcome page and the Finish page.<br />\n                                            <em>Default: 000000</em></p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inres\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inres', 'toggle_inres');\" />\n                                        Interface resources</h3>\n                                    <div class=\"toggle\" id=\"toggle_inres\">\n                                        <p>\n                                            <strong>MUI_UI</strong> <span class=\"parameter\">ui_file</span><br />\n                                            The interface file with the dialog resources. Change this if you have made your\n                                            own customized UI.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern.exe</em></p>\n                                        <p>\n                                            <strong>MUI_UI_HEADERIMAGE</strong> <span class=\"parameter\">ui_file</span><br />\n                                            The interface files with the dialog resource IDD_INST that contains a bitmap control\n                                            and space for the header bitmap.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe</em></p>\n                                        <p>\n                                            <strong>MUI_UI_HEADERIMAGE_RIGHT</strong> <span class=\"parameter\">ui_file</span><br />\n                                            The interface files with the dialog resource IDD_INST that contains a bitmap control\n                                            and space for the header bitmap on the right side.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmpr.exe</em></p>\n                                        <p>\n                                            <strong>MUI_UI_COMPONENTSPAGE_SMALLDESC</strong> <span class=\"parameter\">ui_file</span><br />\n                                            The interface files with a customized dialog resource IDD_SELCOM with a small description\n                                            area.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_smalldesc.exe</em></p>\n                                        <p>\n                                            <strong>MUI_UI_COMPONENTSPAGE_NODESC</strong> <span class=\"parameter\">ui_file</span><br />\n                                            The interface files with a customized dialog resource IDD_SELCOM without a description\n                                            area.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_nodesc.exe</em></p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inwf\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inwf', 'toggle_inwf');\" />\n                                        Installer welcome/finish page</h3>\n                                    <div class=\"toggle\" id=\"toggle_inwf\">\n                                        <p>\n                                            <strong>MUI_WELCOMEFINISHPAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                            Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp</em></p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH</strong> <span class=\"parameter\">mode</span><br />\n                                                See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>\n                                        </div>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inuwf\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inuwf', 'toggle_inuwf');\" />\n                                        Uninstaller welcome/finish page</h3>\n                                    <div class=\"toggle\" id=\"toggle_inuwf\">\n                                        <p>\n                                            <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n                                            Bitmap for the Welcome page and the Finish page (recommended size: 164x314 pixels).<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp</em></p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH</strong> <span class=\"parameter\">mode</span><br />\n                                                See MUI_HEADERIMAGE_BITMAP_STRETCH for a list of the available stretch modes.</p>\n                                        </div>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inl\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inl', 'toggle_inl');\" />\n                                        License page</h3>\n                                    <div class=\"toggle\" id=\"toggle_inl\">\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_BGCOLOR</strong> <span class=\"parameter\">(/windows | /grey |\n                                                (color: RRGGBB hexadecimal))</span><br />\n                                            The background color for the license textbox. Use /windows for the Windows text\n                                            background color (usually white). Use the /grey for the window background color\n                                            (usually grey).<br />\n                                            <em>Default: /windows</em></p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inc\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inc', 'toggle_inc');\" />\n                                        Components page</h3>\n                                    <div class=\"toggle\" id=\"toggle_inc\">\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_CHECKBITMAP</strong> <span class=\"parameter\">bitmap_file</span><br />\n                                            The bitmap with images for the checks of the component select treeview.<br />\n                                            <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp</em></p>\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_SMALLDESC</strong><br />\n                                            A small description area on the bottom of the page. Use this layout if you have\n                                            a lot of sections and don't need large descriptions.</p>\n                                        <p>\n                                            <strong>MUI_COMPONENTSPAGE_NODESC</strong><br />\n                                            No description area.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ind\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_ind', 'toggle_ind');\" />\n                                        Directory page</h3>\n                                    <div class=\"toggle\" id=\"toggle_ind\">\n                                        <p>\n                                            <strong>MUI_DIRECTORYPAGE_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n                                            The background color for the directory textbox.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ins\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_ins', 'toggle_ins');\" />\n                                        Start Menu folder page</h3>\n                                    <div class=\"toggle\" id=\"toggle_ins\">\n                                        <p>\n                                            <strong>MUI_STARTMENUPAGE_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n                                            The background color for the startmenu directory list and textbox.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_ini\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_ini', 'toggle_ini');\" />\n                                        Installation page</h3>\n                                    <div class=\"toggle\" id=\"toggle_ini\">\n                                        <p>\n                                            <strong>MUI_INSTFILESPAGE_COLORS</strong> <span class=\"parameter\">(/windows | &quot;(foreground\n                                                color: RRGGBB hexadecimal) (background color: RRGGBB hexadecimal)&quot;)</span><br />\n                                            The colors of the details screen. Use /windows for the default Windows colors.<br />\n                                            <em>Default: /windows</em></p>\n                                        <p>\n                                            <strong>MUI_INSTFILESPAGE_PROGRESSBAR</strong> <span class=\"parameter\">(&quot;&quot;\n                                                | colored | smooth)</span><br />\n                                            The style of the progress bar. Colored makes it use the MUI_INSTALLCOLORS.<br />\n                                            <em>Default: smooth</em></p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inf\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inf', 'toggle_inf');\" />\n                                        Installer finish page</h3>\n                                    <div class=\"toggle\" id=\"toggle_inf\">\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_NOAUTOCLOSE</strong><br />\n                                            Do not automatically jump to the finish page, to allow the user to check the install\n                                            log.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_uinf\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_uinf', 'toggle_uinf');\" />\n                                        Uninstaller finish page</h3>\n                                    <div class=\"toggle\" id=\"toggle_uinf\">\n                                        <p>\n                                            <strong>MUI_UNFINISHPAGE_NOAUTOCLOSE</strong><br />\n                                            Do not automatically jump to the finish page, to allow the user to check the uninstall\n                                            log.</p>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inaw\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inaw', 'toggle_inaw');\" />\n                                        Abort warning</h3>\n                                    <div class=\"toggle\" id=\"toggle_inaw\">\n                                        <p>\n                                            <strong>MUI_ABORTWARNING</strong><br />\n                                            Show a message box with a warning when the user wants to close the installer.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_ABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                                Text to display on the abort warning message box.</p>\n                                            <p>\n                                                <strong>MUI_ABORTWARNING_CANCEL_DEFAULT</strong><br />\n                                                Set the Cancel button as the default button on the message box.</p>\n                                        </div>\n                                    </div>\n                                    <h3>\n                                        <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_inuaw\" src=\"images/open.gif\"\n                                            onclick=\"toggle('trigger_inuaw', 'toggle_inuaw');\" />\n                                        Uninstaller abort warning</h3>\n                                    <div class=\"toggle\" id=\"toggle_inuaw\">\n                                        <p>\n                                            <strong>MUI_UNABORTWARNING</strong><br />\n                                            Show a message box with a warning when the user wants to close the uninstaller.</p>\n                                        <div class=\"settings\">\n                                            <p>\n                                                <strong>MUI_UNABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                                Text to display on the abort warning message box.</p>\n                                            <p>\n                                                <strong>MUI_UNABORTWARNING_CANCEL_DEFAULT</strong><br />\n                                                Set the Cancel button as the default button on the message box.</p>\n                                        </div>\n                                    </div>\n                                </div>\n                    </div>\n                    <h2>\n                        3. Pages</h2>\n                    <div>\n                        <p>\n                            Insert the following macros to set the pages you want to use. The pages will appear\n                            in the order in which you insert them in the script. You can also insert custom\n                            Page commands between the macros to add custom pages.</p>\n                        <p>\n                            You can add multiple pages of certain types (for example, if you want the user to\n                            specify multiple folders).</p>\n                        <p>\n                            Examples:</p>\n                        <pre>\n!insertmacro MUI_PAGE_LICENSE &quot;License.rtf&quot;\n!insertmacro MUI_PAGE_COMPONENTS\n\nVar StartMenuFolder\n!insertmacro MUI_PAGE_STARTMENU &quot;Application&quot; $StartMenuFolder\n</pre>\n                        <p>\n                            You will need the page ID for the Start Menu folder page when using the Start Menu\n                            folder macros. The folder will be stored in the specified variable.</p>\n                        <p>\n                            <strong>Installer pages</strong><br />\n                            MUI_PAGE_WELCOME<br />\n                            MUI_PAGE_LICENSE <span class=\"parameter\">textfile</span><br />\n                            MUI_PAGE_COMPONENTS<br />\n                            MUI_PAGE_DIRECTORY<br />\n                            MUI_PAGE_STARTMENU <span class=\"parameter\">pageid variable</span><br />\n                            MUI_PAGE_INSTFILES<br />\n                            MUI_PAGE_FINISH</p>\n                        <p>\n                            <strong>Uninstaller pages</strong><br />\n                            MUI_UNPAGE_WELCOME<br />\n                            MUI_UNPAGE_CONFIRM<br />\n                            MUI_UNPAGE_LICENSE <span class=\"parameter\">textfile</span><br />\n                            MUI_UNPAGE_COMPONENTS<br />\n                            MUI_UNPAGE_DIRECTORY<br />\n                            MUI_UNPAGE_INSTFILES<br />\n                            MUI_UNPAGE_FINISH</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pg\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_pg', 'toggle_pg');\" />\n                            Page settings</h3>\n                        <div class=\"toggle\" id=\"toggle_pg\">\n                            <p>\n                                Page settings apply to a single page and should be set before inserting a page macro.\n                                The same settings can be used for installer and uninstaller pages. You have to repeat\n                                the setting if you want it to apply to multiple pages. Example:</p>\n                            <pre>\n;Add a directory page to let the user specify a plug-ins folder\n;Store the folder in $PluginsFolder\n\nVar PLUGINS_FOLDER\n!define MUI_DIRECTORYPAGE_VARIABLE $PluginsFolder\n!insertmacro MUI_PAGE_DIRECTORY\n</pre>\n                            <p>\n                                <p>\n                                    All standard texts in the user interface are loaded from language files, which are\n                                    available for all languages supported by NSIS. So you only need to define these\n                                    texts if you want to change the default.</p>\n                                <p>\n                                    If the parameter is a text that should be different for each language, define a\n                                    language string using LangString and use $(LangStringName) as value. For a license\n                                    text in multiple languages, LicenseLangString can be used. Refer the NSIS Users\n                                    Manual for more information about installers with multiple languages.</p>\n                                <p>\n                                    In all text settings, the doublequote character (&quot;) should be escaped in the\n                                    following form: $\\&quot;</p>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgg\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgg', 'toggle_pgg');\" />\n                                    General page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgg\">\n                                    <p>\n                                        <strong>MUI_PAGE_HEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the header of the page.</p>\n                                    <p>\n                                        <strong>MUI_PAGE_HEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Subtext to display on the header of the page.</p>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgw\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgw', 'toggle_pgw');\" />\n                                    Welcome page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgw\">\n                                    <p>\n                                        <strong>MUI_WELCOMEPAGE_TITLE</strong> <span class=\"parameter\">title</span><br />\n                                        Title to display on the top of the page.</p>\n                                    <p>\n                                        <strong>MUI_WELCOMEPAGE_TITLE_3LINES</strong><br />\n                                        Extra space for the title area.</p>\n                                    <p>\n                                        <strong>MUI_WELCOMEPAGE_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the page.</p>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgl\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgl', 'toggle_pgl');\" />\n                                    License page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgl\">\n                                    <p>\n                                        <strong>MUI_LICENSEPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the top of the page.</p>\n                                    <p>\n                                        <strong>MUI_LICENSEPAGE_TEXT_BOTTOM</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the bottom of the page.</p>\n                                    <p>\n                                        <strong>MUI_LICENSEPAGE_BUTTON</strong> <span class=\"parameter\">button_text</span><br />\n                                        Text to display on the 'I Agree' button.</p>\n                                    <p>\n                                        <strong>MUI_LICENSEPAGE_CHECKBOX</strong><br />\n                                        Display a checkbox the user has to check to agree with the license terms.</p>\n                                    <div class=\"settings\">\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_CHECKBOX_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display next to the checkbox to agree with the license terms.</p>\n                                    </div>\n                                    <p>\n                                        <strong>MUI_LICENSEPAGE_RADIOBUTTONS</strong><br />\n                                        Display two radio buttons to allow the user to choose between accepting the license\n                                        terms or not.</p>\n                                    <div class=\"settings\">\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display next to the checkbox to accept the license terms.</p>\n                                        <p>\n                                            <strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE</strong> <span class=\"parameter\">text</span><br />\n                                            Text to display next to the checkbox to decline the license terms.</p>\n                                    </div>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgc\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgc', 'toggle_pgc');\" />\n                                    Components page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgc\">\n                                    <p>\n                                        <strong>MUI_COMPONENTSPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the top of the page.</p>\n                                    <p>\n                                        <strong>MUI_COMPONENTSPAGE_TEXT_COMPLIST</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on next to the components list.</p>\n                                    <p>\n                                        <strong>MUI_COMPONENTSPAGE_TEXT_INSTTYPE</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on next to the installation type combo box.</p>\n                                    <p>\n                                        <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the of the top of the description box.</p>\n                                    <p>\n                                        <strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display inside the description box when no section is selected.</p>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgd\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgd', 'toggle_pgd');\" />\n                                    Directory page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgd\">\n                                    <p>\n                                        <strong>MUI_DIRECTORYPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on top of the page.</p>\n                                    <p>\n                                        <strong>MUI_DIRECTORYPAGE_TEXT_DESTINATION</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the destination folder frame.</p>\n                                    <p>\n                                        <strong>MUI_DIRECTORYPAGE_VARIABLE</strong> <span class=\"parameter\">variable</span><br />\n                                        Variable in which to store the selected folder.<br />\n                                        <em>Default: $INSTDIR</em></p>\n                                    <p>\n                                        <strong>MUI_DIRECTORYPAGE_VERIFYONLEAVE</strong><br />\n                                        Does not disable the Next button when a folder is invalid but allows you to use\n                                        GetInstDirError in the leave function to handle an invalid folder.</p>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgs\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgs', 'toggle_pgs');\" />\n                                    Start Menu folder page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgs\">\n                                    <p>\n                                        <strong>MUI_STARTMENUPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the top of the page.</p>\n                                    <p>\n                                        <strong>MUI_STARTMENUPAGE_TEXT_CHECKBOX</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display next to the checkbox to disable the Start Menu folder creation.</p>\n                                    <p>\n                                        <strong>MUI_STARTMENUPAGE_DEFAULTFOLDER</strong> <span class=\"parameter\">folder</span><br />\n                                        The default Start Menu Folder.</p>\n                                    <p>\n                                        <strong>MUI_STARTMENUPAGE_NODISABLE</strong><br />\n                                        Do not display the checkbox to disable the creation of Start Menu shortcuts.</p>\n                                    <p>\n                                        <strong>MUI_STARTMENUPAGE_REGISTRY_ROOT</strong> <span class=\"parameter\">root</span><br />\n                                        <strong>MUI_STARTMENUPAGE_REGISTRY_KEY</strong> <span class=\"parameter\">key</span><br />\n                                        <strong>MUI_STARTMENUPAGE_REGISTRY_VALUENAME</strong> <span class=\"parameter\">value_name</span><br />\n                                        The registry key to store the Start Menu folder. The page will use it to remember\n                                        the users preference. You should also use for the uninstaller to remove the Start\n                                        Menu folders. Don't forget to remove this key during uninstallation.</p>\n                                    <p>\n                                        For the uninstaller, use the MUI_STARTMENU_GETFOLDER macro to get the Start Menu\n                                        folder:</p>\n                                    <pre>\n!insertmacro MUI_STARTMENU_GETFOLDER page_id $R0\n  Delete &quot;$SMPROGRAMS\\$R0\\Your Shortcut.lnk&quot;\n</pre>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgi\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgi', 'toggle_pgi');\" />\n                                    Installation page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgi\">\n                                    <p>\n                                        <strong>MUI_INSTFILESPAGE_FINISHHEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the header of the installation page when the installation has\n                                        been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>\n                                    <p>\n                                        <strong>MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Subtext to display on the header of the installation page when the installation\n                                        has been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>\n                                    <p>\n                                        <strong>MUI_INSTFILESPAGE_ABORTHEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the header of the installation page when the installation has\n                                        been aborted.</p>\n                                    <p>\n                                        <strong>MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Subext to display on the header of the installation page when the installation has\n                                        been aborted.</p>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgf\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgf', 'toggle_pgf');\" />\n                                    Finish page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgf\">\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_TITLE</strong> <span class=\"parameter\">title</span><br />\n                                        Title to display on the top of the page.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_TITLE_3LINES</strong><br />\n                                        Extra space for the title area.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the page.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_TEXT_LARGE</strong><br />\n                                        Extra space for the text area (if using checkboxes).</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_BUTTON</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the Finish button.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_CANCEL_ENABLED</strong><br />\n                                        Enable the Cancel button so the user can skip any options displayed on the finish\n                                        page.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_TEXT_REBOOT</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the finish page when asking for a system reboot.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_TEXT_REBOOTNOW</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display next to the 'Reboot now' option button.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_TEXT_REBOOTLATER</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display next to the 'Reboot later' option button.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_REBOOTLATER_DEFAULT</strong><br />\n                                        Sets the 'Reboot later' option as the default option.</p>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_RUN</strong> <span class=\"parameter\">exe_file</span><br />\n                                        Application which the user can select to run using a checkbox. You don't need to\n                                        put quotes around the filename when it contains spaces.</p>\n                                    <div class=\"settings\">\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_RUN_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Texts to display next to the 'Run program' checkbox.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_RUN_PARAMETERS</strong> <span class=\"parameter\">parameters</span><br />\n                                            Parameters for the application to run. Don't forget to escape double quotes in the\n                                            value (use $\\&quot;).</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_RUN_NOTCHECKED</strong><br />\n                                            Do not check the 'Run program' checkbox by default</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_RUN_FUNCTION</strong> <span class=\"parameter\">function</span><br />\n                                            Call a function instead of executing an application (define MUI_FINISHPAGE_RUN without\n                                            parameters). You can use the function to execute multiple applications or you can\n                                            change the checkbox name and use it for other things.</p>\n                                    </div>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_SHOWREADME</strong> <span class=\"parameter\">file/url</span><br />\n                                        File or website which the user can select to view using a checkbox. You don't need\n                                        to put quotes around the filename when it contains spaces.</p>\n                                    <div class=\"settings\">\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_SHOWREADME_TEXT</strong> <span class=\"parameter\">text</span><br />\n                                            Texts to display next to the 'Show Readme' checkbox.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_SHOWREADME_NOTCHECKED</strong><br />\n                                            Do not check the 'Show Readme' checkbox by default</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_SHOWREADME_FUNCTION</strong> <span class=\"parameter\">function</span><br />\n                                            Call a function instead of showing a file (define MUI_FINISHPAGE_SHOWREADME without\n                                            parameters). You can use the function to show multiple files or you can change the\n                                            checkbox name and use it for other things.</p>\n                                    </div>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_LINK</strong> <span class=\"parameter\">link_text</span><br />\n                                        Text for a link on the which the user can click to view a website or file.</p>\n                                    <div class=\"settings\">\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_LINK_LOCATION</strong> <span class=\"parameter\">file/url</span><br />\n                                            Website or file which the user can select to view using the link. You don't need\n                                            to put quotes around the filename when it contains spaces.</p>\n                                        <p>\n                                            <strong>MUI_FINISHPAGE_LINK_COLOR</strong> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n                                            Text color for the link on the Finish page.<br />\n                                            <em>Default: 000080</em></p>\n                                    </div>\n                                    <p>\n                                        <strong>MUI_FINISHPAGE_NOREBOOTSUPPORT</strong><br />\n                                        Disables support for the page that allows the user to reboot the system. Define\n                                        this option to save some space if you are not using the /REBOOTOK flag or SetRebootFlag.</p>\n                                </div>\n                                <h3>\n                                    <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_pgu\" src=\"images/open.gif\"\n                                        onclick=\"toggle('trigger_pgu', 'toggle_pgu');\" />\n                                    Uninstall confirm page settings</h3>\n                                <div class=\"toggle\" id=\"toggle_pgu\">\n                                    <p>\n                                        <strong>MUI_UNCONFIRMPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display on the top of the page.</p>\n                                    <p>\n                                        <strong>MUI_UNCONFIRMPAGE_TEXT_LOCATION</strong> <span class=\"parameter\">text</span><br />\n                                        Text to display next to the uninstall location text box.</p>\n                                    <p>\n                                        <strong>MUI_UNCONFIRMPAGE_VARIABLE</strong> <span class=\"parameter\">variable</span><br />\n                                        Variable in which to store the uninstall source folder.<br />\n                                        <em>Default: $INSTDIR</em></p>\n                                </div>\n                        </div>\n                    </div>\n                    <h2>\n                        4. Language files</h2>\n                    <div>\n                        <p>\n                            Insert the Modern UI language files for the languages to want to include.</p>\n                        <pre>\n!insertmacro MUI_LANGUAGE &quot;English&quot;\n</pre>\n                        <p>\n                            The standard NSIS language files are loaded automatically, there is no need to use\n                            LoadLanguageFile.</p>\n                    </div>\n                    <h2>\n                        5. Reserve files</h2>\n                    <div>\n                        <p>\n                            If you are using solid compression, files that are required before the actual installation\n                            should be stored first in the data block, because this will make your installer\n                            start faster. Include reserve file commands for such files before your sections\n                            and functions:</p>\n                        <pre>\nReserveFile /plugin MyPlugin.dll\n!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog\n...\n</pre>\n                    </div>\n                    <h1>\n                        Script code for pages</h1>\n                    <div>\n                        <p>\n                            Some pages allow you to show additional information or can be used to get user input.\n                            Here you can find the script code to use these features.</p>\n                        <h2>\n                            Components page descriptions</h2>\n                        <div>\n                            <p>\n                                The Modern UI components page has a text box in which a description can be shown\n                                when the user hovers the mouse over a component. If you don't want to use these\n                                descriptions, insert the MUI_COMPONENTSPAGE_NODESC interface setting.</p>\n                            <p>\n                                To set a description for a section, an additional parameter needs to be added to\n                                Section command with a unique identifier for the section. This name can later be\n                                used to set the description for this section.</p>\n                            <pre>\nSection &quot;Section Name 1&quot; Section1\n   ...\nSectionEnd\n</pre>\n                            <p>\n                                After the sections, use these macros to set the descriptions:</p>\n                            <pre>\nLangString DESC_Section1 ${LANG_ENGLISH} &quot;Description of section 1.&quot;\nLangString DESC_Section2 ${LANG_ENGLISH} &quot;Description of section 2.&quot;\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n</pre>\n                            <p>\n                                For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN and MUI_UNFUNCTION_DESCRIPTION_END\n                                macros.</p>\n                        </div>\n                        <h2>\n                            Start Menu folder</h2>\n                        <div>\n                            <p>\n                                Put the code to write the shortcuts (using CreateShortcut) between the MUI_STARTMENU_WRITE_BEGIN\n                                and MUI_STARTMENU_WRITE_END macros:</p>\n                            <pre>\n!insertmacro MUI_STARTMENU_WRITE_BEGIN pageid\n  ...create shortcuts...\n!insertmacro MUI_STARTMENU_WRITE_END\n</pre>\n                            <p>\n                                The page ID should be the ID of the page on which the user has selected the folder\n                                for the shortcuts you want to write.</p>\n                            <p>\n                                The variable which contains the folder and the page ID are set as parameters of\n                                the page macro.</p>\n                        </div>\n                    </div>\n                    <h1>\n                        Language selection dialog</h1>\n                    <div>\n                        <p>\n                            If you want the installer to display a language selection dialog (see the the <a\n                                href=\"../../Examples/Modern%20UI/MultiLanguage.nsi\">MultiLanguage.nsi</a> example),\n                            insert the MUI_LANGDLL_DISPLAY macro in the .onInit function:</p>\n                        <pre>\nFunction .onInit\n\n  !insertmacro MUI_LANGDLL_DISPLAY\n\nFunctionEnd\n</pre>\n                        <p>\n                            This macro can also be used in the un.onInit function.</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_lss\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_lss', 'toggle_lss');\" />\n                            Settings for registry storage of selected language</h3>\n                        <div class=\"toggle\" id=\"toggle_lss\">\n                            <p>\n                                To remember the user's preference, you can define a registry key. These defines\n                                should be set before inserting the installation page macro.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_REGISTRY_ROOT</strong> <span class=\"parameter\">root</span><br />\n                                <strong>MUI_LANGDLL_REGISTRY_KEY</strong> <span class=\"parameter\">key</span><br />\n                                <strong>MUI_LANGDLL_REGISTRY_VALUENAME</strong> <span class=\"parameter\">value_name</span><br />\n                                The registry key to store the language. The users preference will be remembered.\n                                You can also use it for the uninstaller to display the right language. Don't forget\n                                to remove this key in the uninstaller.</p>\n                            <p>\n                                For the uninstaller, insert the MUI_UNGETLANGUAGE macro in un.onInit to get the\n                                stored language preference:</p>\n                            <pre>\nFunction un.onInit\n\n  !insertmacro MUI_UNGETLANGUAGE\n\nFunctionEnd\n</pre>\n                        </div>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_lsin\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_lsin', 'toggle_lsin');\" />\n                            Interface settings for selection dialog</h3>\n                        <div class=\"toggle\" id=\"toggle_lsin\">\n                            <p>\n                                To customize the language selection dialog interface, use these defines before inserting\n                                the MUI_LANGDLL_DISPLAY macro.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_WINDOWTITLE</strong> <span class=\"parameter\">text</span><br />\n                                The window title of the language selection dialog.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_INFO</strong> <span class=\"parameter\">text</span><br />\n                                The text to display on the language selection dialog.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_ALWAYSSHOW</strong><br />\n                                Always show the language selection dialog, even if a language has been stored in\n                                the registry. The language stored in the registry will be selected by default.</p>\n                            <p>\n                                <strong>MUI_LANGDLL_ALLLANGUAGES</strong><br />\n                                Always show all available languages and don't filter according to their codepage.</p>\n                        </div>\n                    </div>\n                    <h1>\n                        Custom pages</h1>\n                    <div>\n                        <p>\n                            If you want add your custom pages to your installer, you can insert your own page\n                            commands between the page macros.</p>\n                        <pre>\n!insertmacro MUI_PAGE_WELCOME\nPage custom FunctionName ;Custom page\n!insertmacro MUI_PAGE_COMPONENTS\n \n;Uninstaller\n!insertmacro MUI_UNPAGE_CONFIRM\nUninstPage custom un.FunctionName ;Custom page\n!insertmacro MUI_UNPAGE_INSTFILES\n</pre>\n                        <p>\n                            Use the MUI_HEADER_TEXT macro to set the text on the page header in a page function:</p>\n                        <pre>\nLangString PAGE_TITLE ${LANG_ENGLISH} &quot;Title&quot;\nLangString PAGE_SUBTITLE ${LANG_ENGLISH} &quot;Subtitle&quot;\n\nFunction CustomPageFunction\n  !insertmacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)\n  nsDialogs::...\n  ...\nFunctionEnd\n</pre>\n                    </div>\n                    <h1>\n                        Custom functions</h1>\n                    <div>\n                        <p>\n                            Interface functions provided by NSIS, like the .onGUIInit function and the page\n                            functions are automatically included by the Modern UI and filled with code to support\n                            new interface features. If you want to add additional code to these function, create\n                            a function with the custom script code in the script use the Modern UI functions\n                            call them.</p>\n                        <p>\n                            Example:</p>\n                        <pre class=\"text\">\n!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit\n\nFunction myGUIInit\n  ...\nFunctionEnd</pre>\n                        <p>\n                            Modern UI pages can also customized using custom functions.</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_cfg\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_cfg', 'toggle_cfg');\" />\n                            General Custom Functions</h3>\n                        <div class=\"toggle\" id=\"toggle_cfg\">\n                            <p>\n                                These defines should be set before inserting the language macros.</p>\n                            <p>\n                                <strong>MUI_CUSTOMFUNCTION_GUIINIT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_UNGUIINIT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_ABORT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_UNABORT</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION</strong> <span class=\"parameter\">function</span></p>\n\t\t\t\t\t\t\t<p>\n                                Mouse over functions are only available when the description macros\n\t\t\t\t\t\t\t\t(MUI_FUNCTION_DESCRIPTION_BEGIN) are used. When component page descriptions are not\n\t\t\t\t\t\t\t\tused, regular .onMouseOverSection and un.onMouseOverSection must be used.</p>\n                        </div>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_cfpg\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_cfpg', 'toggle_cfpg');\" />\n                            Page Custom Functions</h3>\n                        <div class=\"toggle\" id=\"toggle_cfpg\">\n                            <p>\n                                These defines should be set before inserting a page macro.</p>\n                            <p>\n                                <strong>MUI_PAGE_CUSTOMFUNCTION_PRE</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_PAGE_CUSTOMFUNCTION_SHOW</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_PAGE_CUSTOMFUNCTION_LEAVE</strong> <span class=\"parameter\">function</span><br />\n                                <strong>MUI_PAGE_CUSTOMFUNCTION_DESTROYED</strong> <span class=\"parameter\">function</span><br />\n                            </p>\n                            <p>\n                                The pre function is called first and allows you to initialize variables or decide\n                                whether the page should be skipped. Then, the show function is called, which can\n                                be used to customize the interface. Finally, the user input can be validated in the\n                                leave function. The NSIS Users Manual provides more information about these functions.</p>\n                            <p>\n                                In the show function, the window handles of all controls on the page can be retrieved\n                                from a Modern UI variable. A list of the variables names is not yet available. For\n                                now, refer to the source files of the Modern UI 2. The variable declarations can\n                                be found in the first lines of the header file for a certain page.</p>\n                            <p>\n                                The destroyed function is called after a external/plug-in page has been destroyed.\n                        </div>\n                    </div>\n                    <h1>\n                        <a name=\"examples\" id=\"examples\">Example scripts</a></h1>\n                    <div>\n                        <p>\n                            Basic: <a href=\"../../Examples/Modern%20UI/Basic.nsi\">Basic.nsi</a><br />\n                            Welcome/Finish page: <a href=\"../../Examples/Modern%20UI/WelcomeFinish.nsi\">WelcomeFinish.nsi</a><br />\n                            Multiple languages: <a href=\"../../Examples/Modern%20UI/MultiLanguage.nsi\">MultiLanguage.nsi</a><br />\n                            Header image: <a href=\"../../Examples/Modern%20UI/HeaderBitmap.nsi\">HeaderBitmap.nsi</a><br />\n                            Start Menu Folder page: <a href=\"../../Examples/Modern%20UI/StartMenu.nsi\">StartMenu.nsi</a></p>\n                    </div>\n                    <h1>\n                        Credits</h1>\n                    <div>\n                        <p>\n                            Written by Joost Verburg.<br />\n                            Icons designed by Nikos Adamamas, aka adni18.<br />\n                            Thanks to Amir Szekely, aka KiCHiK, for his work on NSIS to make this possible.</p>\n                    </div>\n                    <h1>\n                        License</h1>\n                    <div>\n                        <p>\n                            The zlib/libpng license applies to the Modern UI.</p>\n                        <h3>\n                            <img class=\"trigger\" alt=\"Open/Close section\" id=\"trigger_lic\" src=\"images/open.gif\"\n                                onclick=\"toggle('trigger_lic', 'toggle_lic');\" />\n                            License Terms</h3>\n                        <div class=\"toggle\" id=\"toggle_lic\">\n                            <pre>\nCopyright &copy; 2002-2022 Joost Verburg\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; \n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.\n</pre>\n                        </div>\n                    </div>\n                </div>\n            </td>\n        </tr>\n    </table>\n</body>\n</html>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/MultiUser/Readme.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"en\">\n<head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <meta name=\"color-scheme\" content=\"light dark\">\n    <title>Multi-User Header File (MultiUser.nsh)</title>\n    <style type=\"text/css\">\n:root { color-scheme: light dark; }\nhtml, body { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; color: #050505; background-color: #fefefe; }\nhtml { font-size: 0.9em; }\nbody { font-size: 1em; font-size: 1rem; }\npre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }\npre, pre code {background-color: #f6f6f6;  }\ntr:nth-child(odd) { background-color: #fafafa; }\ntable, tr, td { border: 1px solid #dddddd; border-collapse: collapse; }\ntd { padding: 0.3em; vertical-align: top; }\n\n@media (prefers-color-scheme: dark) {\nhtml, body { color: #eeeeee; background-color: #161616; }\na, a:link, a:visited, a:active { color: #79b; } a:hover { color: #3ad; }\npre, pre code {background-color: #202020; }\ntable, tr, td { border-color: #202020; }\ntr:nth-child(odd) { background-color: #181818; }\n}\n    </style>\n</head>\n<body>\n    <h1>Multi-User Header File (MultiUser.nsh)</h1>\n    <p><i>Installer configuration for multi-user Windows environments</i></p>\n    <h2>Table of Contents</h2>\n    <ul>\n        <li><a href=\"#introduction\">Introduction</a></li>\n        <li><a href=\"#executionlevel\">Initialization and Execution Level</a>\n            <li><a href=\"#installationmode\">Installation Mode</a></ul>\n    <h2><a name=\"introduction\"></a>Introduction</h2>\n    <p>\n        Modern Windows versions support multiple users accounts on a single computer, each\n        with different privileges. For security reasons, the privileges of applications\n        can also be limited. For an installer, the <i>execution level</i> and <i>installation\n            mode</i> are important. The execution level determines the privileges of the\n        installer application. For example, to install hardware drivers, administrator privileges\n        are required. Applications can also be installed for a single user or for all users\n        on a computer, which is determined by the installation mode. Installation for all\n        users requires a higher execution level as compared with a single user setup. The\n        MultiUser.nsh header files provides the features to automatically handle all these\n        aspects related to user accounts and installer privileges.</p>\n    <p>\n        Note that all settings need to be set before including the MultiUser.nsh header\n        file.</p>\n    <h2>Initialization and <a name=\"executionlevel\"></a>Execution Level&nbsp;</h2>\n    <p>\n        Before the MultiUser.nsh file is included, the MULTIUSER_EXECUTIONLEVEL define should\n        be set to one of the following values depending on the execution level that is required:</p>\n    <table>\n        <tr>\n            <td>\n                <b>Value </b>\n            </td>\n            <td>\n                <b>Description</b>\n            </td>\n            <td>\n                <b>Typical application</b>\n            </td>\n        </tr>\n        <tr>\n            <td>\n                Admin\n            </td>\n            <td>\n                Administrator privileges are required\n            </td>\n            <td>\n                Access data of all users accounts\n            </td>\n        </tr>\n        <tr>\n            <td>\n                Power\n            </td>\n            <td>\n                Power User privileges are required<br>\n                (Power Users no longer exist in Windows Vista. For Vista this is equivalent to Admin)\n            </td>\n            <td>\n                Installation for all users (writing to &quot;Program Files&quot; or HKLM registry\n                keys), driver installation\n            </td>\n        </tr>\n        <tr>\n            <td>\n                Highest\n            </td>\n            <td>\n                Request the highest possible execution level for the current user\n            </td>\n            <td>\n                Mixed-mode installer that can both be installed per-machine or per-user\n            </td>\n        </tr>\n        <tr>\n            <td>\n                Standard\n            </td>\n            <td>\n                No special rights required\n            </td>\n            <td>\n                Installation for current user only\n            </td>\n        </tr>\n    </table>\n    <p>\n        Insert the MULTIUSER_INIT and MULTIUSER_UNINT macros in the .onInit and un.onInit\n        function to verify these privileges. If no uninstaller is created in the script,\n        define MULTIUSER_NOUNINSTALL.</p>\n        <pre><code>!define MULTIUSER_EXECUTIONLEVEL Highest\n;!define MULTIUSER_NOUNINSTALL ;Uncomment if no uninstaller is created\n!include MultiUser.nsh\n\n...\n\nFunction .onInit\n  !insertmacro MULTIUSER_INIT\nFunctionEnd\n\nFunction un.onInit\n  !insertmacro MULTIUSER_UNINIT\nFunctionEnd</code></pre>\n    <p>\n        Whether the required privileges can be obtained depends on the user that starts\n        the installer:</p>\n    <ul>\n        <li>Windows NT 4/2000/XP/2003 give the installer the same privileges as the user itself.\n            If the privileges of the user are not sufficient (e.g. Admin level is required is\n            set but the user has no administrator rights), the macros will display an error\n            message and quit the installer. If is however possible to manually run the installer\n            with an administrator account.</li>\n        <li>Windows Vista restricts the privileges of all applications by default. Depending\n            on requested execution level, MultiUser.nsh will set the RequestExecutionLevel flag\n            to request privileges. The user will be asked for confirmation and (if necessary)\n            for an administrator password.</li>\n        <li>Windows 95/98/98 do not set any restrictions on users or applications. Administrator\n            rights are always available.</li>\n    </ul>\n    <p>\n        It is recommended to insert these initialization macros before macros that require\n        user intervention. For example, it does not make sense to ask a user for an installer\n        language if the installer will quit afterwards because the user account does not\n        have the required privileges. After the macros are inserted, the variable $MultiUser.Privileges\n        will contain the current execution level (Admin, Power, User or Guest).</p>\n    <p>\n        The following additional settings are available to customize the initialization:</p>\n    <table>\n        <tr>\n            <td><b>Setting</b></td>\n            <td><b>Description</b></td>\n        </tr>\n        <tr>\n            <td>\n                MULTIUSER_INIT_TEXT_ADMINREQUIRED\n            </td>\n            <td>\n                Error message to be displayed when administrator rights are required but not available.\n            </td>\n        </tr>\n        <tr>\n            <td>\n                MULTIUSER_INIT_TEXT_POWERREQUIRED\n            </td>\n            <td>\n                Error message to be displayed when Power User rights are required but not available.\n            </td>\n        </tr>\n        <tr>\n            <td>\n                MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE\n            </td>\n            <td>\n                Error message to be displayed when administrator or Power User rights are required\n                because of an installation mode setting on the command line (see below) but are\n                not available.\n            </td>\n        </tr>\n        <tr>\n            <td>\n                MULTIUSER_USE_PROGRAMFILES64\n            </td>\n            <td>\n                Use $PROGRAMFILES64 instead of $PROGRAMFILES as the default all users directory.\n            </td>\n        </tr>\n        <tr>\n            <td>\n                MULTIUSER_INIT_FUNCTIONQUIT<br>\n                MULTIUSER_INIT_UNFUNCTIONQUIT\n            </td>\n            <td>\n                A custom function to be called when the installer is closed due to insufficient\n                privileges.\n            </td>\n        </tr>\n    </table>\n    <h2><a name=\"installationmode\"></a>Installation Mode</h2>\n    <p>\n        As mentioned before, applications can both be installed for a single users or for\n        all users on a computer. Applications for all users are typically installed in the\n        Program Files folder and appear in the Start Menu of every user. On the contrary,\n        applications for a single user are usually installed in the local Application Data\n        folder and only a appear in the Start Menu of the user who installed the application.</p>\n    <p>\n        By default, MultiUser.nsh will set the installation mode for a per-machine installation\n        if Administrator or Power User rights are available (this is always the case if\n        the execution level is set to Admin or Power, if Highest is set it depends on the\n        user account). For the Standard execution level the installation will always be\n        for a single user. On Windows 95/98/Me installation for a single user is not possible, a per-machine installation will be performed.</p>\n    <p>\n        The following settings are available to change the default installation mode:\n        <table>\n            <tr>\n                <td><b>Setting</b></td>\n                <td><b>Description</b></td>\n            </tr>\n            <tr>\n                <td>\n                    MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER\n                </td>\n                <td>\n                    Set default to a per-user installation, even if the rights for a per-machine installation\n                    are available.\n                </td>\n            </tr>\n            <tr>\n                <td>\n                    MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME\n                </td>\n                <td>\n                    Non-empty registry key that is created during the installation in either HKCU or\n                    HKLM. The default installation mode will automatically be set to the previously\n                    selected mode depending on the location of the key.\n                </td>\n            </tr>\n        </table>\n        <p>\n            After initialization, the variable $MultiUser.InstallMode will contain the current\n            installation mode (AllUsers or CurrentUser).\n        </p>\n        <h3>Mixed-Mode Installation</h3>\n        <p>\n            For the Admin and Power levels, both a per-machine as well as a per-user installation\n            is possible. If the Highest level is set and the user is an Administrator or Power\n            User, both options are also available.</p>\n        <p>\n            Usually it's a good thing to give the user to choice between these options. For\n            users of the Modern UI version 2, a page is provided that asks the user for the\n            installation mode. To use this page, define MULTIUSER_MUI before including User.nsh.\n            Then, the MULTIUSER_PAGE_INSTALLMODE macro can be used just like a normal Modern\n            UI page (this page will automatically be skipped when running Windows 95/98/Me):</p>\n        <pre><code>!define MULTIUSER_EXECUTIONLEVEL Highest\n<b>!define MULTIUSER_MUI</b>\n!define MULTIUSER_INSTALLMODE_COMMANDLINE\n!include MultiUser.nsh\n!include MUI2.nsh\n\n<b>!insertmacro MULTIUSER_PAGE_INSTALLMODE</b>\n!insertmacro MUI_PAGE_DIRECTORY\n!insertmacro MUI_PAGE_INSTFILES \n\n!insertmacro MUI_LANGUAGE English\n\n...\n\nFunction .onInit\n  !insertmacro MULTIUSER_INIT\nFunctionEnd\n\nFunction un.onInit\n  !insertmacro MULTIUSER_UNINIT\nFunctionEnd</code></pre>\n        <p>\n            The MULTIUSER_INSTALLMODE_COMMANDLINE setting that also appears in this example\n            enables the installation mode to be set using the /AllUsers or /CurrentUser command\n            line parameters. This is especially useful for silent setup.</p>\n        <p>\n            The following settings can be used to customize the texts on the page (in addition\n            to the general Modern UI page settings):</p>\n        <table>\n            <tr>\n                <td><b>Setting</b></td>\n                <td><b>Description</b></td>\n            </tr>\n            <tr>\n                <td>MULTIUSER_INSTALLMODEPAGE_TEXT_TOP</td>\n                <td>Text to display on the top of the page.</td>\n            </tr>\n            <tr>\n                <td>MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS</td>\n                <td>Text to display on the radio button for a per-machine installation.</td>\n            </tr>\n            <tr>\n                <td>MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER</td>\n                <td>Text to display on the radio button for a per-user installation.</td>\n            </tr>\n            <tr>\n                <td>MULTIUSER_INSTALLMODEPAGE_SHOWUSERNAME</td>\n                <td>Append the username to the per-user radio button.</td>\n            </tr>\n        </table>\n        <h3>Installation Mode Initialization</h3>\n        <p>\n            The SetShellVarContext flag (which determines the folders for e.g. shortcuts, like\n            $DESKTOP) is automatically set depending on the installation mode. In addition,\n            the following settings can be used to perform additional actions when the installation\n            mode is initialized:</p>\n        <table>\n            <tr>\n                <td><b>Setting</b></td>\n                <td><b>Description</b></td>\n            </tr>\n            <tr>\n                <td>MULTIUSER_INSTALLMODE_INSTDIR</td>\n                <td>\n                    Name of the folder in which to install the application, without a path. This folder\n                    will be located in Program Files for a per-machine installation and in the local\n                    Application Data folder for a per-user installation (if supported).\n                </td>\n            </tr>\n            <tr>\n                <td>MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME</td>\n                <td>\n                    Registry key from which to obtain a previously stored installation folder. It will\n                    be retrieved from HKCU for per-user and HKLM for per-machine.\n                </td>\n            </tr>\n            <tr>\n                <td>\n                    MULTIUSER_INSTALLMODE_FUNCTION<br>\n                    MULTIUSER_INSTALLMODE_UNFUNCTION\n                </td>\n                <td>\n                    A custom function to be called during the initialization of the installation mode\n                    to set additional installer settings that depend on the mode\n                </td>\n        </table>\n        <p>\n            To set the installation mode manually, call one of these four functions:</p>\n        <table>\n            <tr>\n                <td>\n                    <b>Function name</b>\n                </td>\n                <td>\n                    <b>Installation mode</b>\n                </td>\n            </tr>\n            <tr>\n                <td>\n                    MultiUser.InstallMode.AllUsers\n                </td>\n                <td>\n                    Installer: Per-machine installation\n                </td>\n            </tr>\n            <tr>\n                <td>\n                    MultiUser.InstallMode.CurrentUser\n                    <td>\n                        Installer: Per-user installation\n                    </td>\n            </tr>\n            <tr>\n                <td>\n                    un.MultiUser.InstallMode.AllUsers<td>\n                        Uninstaller: Per-machine installation\n                    </td>\n            </tr>\n            <tr>\n                <td>\n                    un.MultiUser.InstallMode.CurrentUser<td>\n                        Uninstaller: Per-user installation\n                    </td>\n            </tr>\n        </table>\n</body>\n</html>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/NSISdl/License.txt",
    "content": "NSISdl 1.1 - HTTP downloading plugin for NSIS\nCopyright (C) 2001-2002 Yaroslav Faybishenko & Justin Frankel\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\n   claim that you wrote the original software. If you use this software\n   in a product, an acknowledgment in the product documentation would be\n   appreciated but is not required.\n2. Altered source versions must be plainly marked as such, and must not be\n   misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution."
  },
  {
    "path": "setup/nsis/tools/Docs/NSISdl/ReadMe.txt",
    "content": "NSISdl 1.3 - HTTP downloading plugin for NSIS\n---------------------------------------------\n\nCopyright (C) 2001-2002 Yaroslav Faybishenko & Justin Frankel\n\nThis plugin can be used from NSIS to download files via HTTP.\nNote: HTTPS is not supported, only plain HTTP!\n\nTo connect to the internet, use the Dialer plugin.\n\nUSAGE\n-----\n\nNSISdl::download http://www.domain.com/file localfile.exe\n\nYou can also pass /TIMEOUT to set the timeout in milliseconds:\n\nNSISdl::download /TIMEOUT=30000 http://www.domain.com/file localfile.exe\n\nThe return value is pushed to the stack:\n\n  \"cancel\" if cancelled\n  \"success\" if success\n  otherwise, an error string describing the error\n\nIf you don't want the progress window to appear, use NSISdl::download_quiet.\n\nExample of usage:\n\nNSISdl::download http://www.domain.com/file localfile.exe\nPop $R0 ;Get the return value\n  StrCmp $R0 \"success\" +3\n    MessageBox MB_OK \"Download failed: $R0\"\n    Quit\n\nFor another example, see waplugin.nsi in the examples directory.\n\nPROXIES\n-------\n\nNSISdl supports only basic configurations of proxies. It doesn't support\nproxies which require authentication, automatic configuration script, etc.\nNSISdl reads the proxy configuration from Internet Explorer's registry key\nunder HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings. It\nreads and parses ProxyEnable and ProxyServer.\n\nIf you don't want NSISdl to use Internet Explorer's settings, use the\n/NOIEPROXY flag. /NOIEPROXY should be used after /TRANSLATE and\n/TIMEOUT. For example:\n\nIf you want to specify a proxy on your own, use the /PROXY flag.\n\nNSISdl::download /NOIEPROXY http://www.domain.com/file localfile.exe\nNSISdl::download /TIMEOUT=30000 /NOIEPROXY http://www.domain.com/file localfile.exe\nNSISdl::download /PROXY proxy.whatever.com http://www.domain.com/file localfile.exe\nNSISdl::download /PROXY proxy.whatever.com:8080 http://www.domain.com/file localfile.exe\n\nTRANSLATE\n---------\n\nTo translate NSISdl add the following values to the call line:\n\n/TRANSLATE2 downloading connecting second minute hour seconds minutes hours progress\n\nDefault values are:\n \n  downloading - \"Downloading %s\"\n  connecting - \"Connecting ...\"\n  second - \" (1 second remaining)\"\n  minute - \" (1 minute remaining)\"\n  hour - \" (1 hour remaining)\"\n  seconds - \" (%u seconds remaining)\"\n  minutes - \" (%u minutes remaining)\"\n  hours - \" (%u hours remaining)\"\n  progress - \"%skB (%d%%) of %skB @ %u.%01ukB/s\"\n\nThe old /TRANSLATE method still works for backward compatibility.\n\n/TRANSLATE downloading connecting second minute hour plural progress remaining\n\nDefault values are:\n\n  downloading - \"Downloading %s\"\n  connecting - \"Connecting ...\"\n  second - \"second\"\n  minute - \"minute\"\n  hour - \"hour\"\n  plural - \"s\"\n  progress - \"%dkB (%d%%) of %ukB @ %d.%01dkB/s\"\n  remaining -  \" (%d %s%s remaining)\"\n\n/TRANSLATE and /TRANSLATE2 must come before /TIMEOUT.\n"
  },
  {
    "path": "setup/nsis/tools/Docs/NScurl/NScurl.Readme.htm",
    "content": "<div style=\"border:solid 1px black;padding:20px\">\n<h2>Contents</h2>\n<ul>\n<li><a href=\"#about\">About</a>\n<li>HTTP functions\n<ul>\n<li><a href=\"#http\">NScurl::http</a>\n<li><a href=\"#query\">NScurl::query</a>\n<li><a href=\"#wait\">NScurl::wait</a>\n<li><a href=\"#enumerate\">NScurl::enumerate</a>\n<li><a href=\"#cancel\">NScurl::cancel</a>\n</ul>\n<li>Utility functions\n<ul>\n<li><a href=\"#escape\">NScurl::escape</a>\n<li><a href=\"#unescape\">NScurl::unescape</a>\n<li><a href=\"#md5\">NScurl::md5</a>\n<li><a href=\"#sha1\">NScurl::sha1</a>\n<li><a href=\"#sha256\">NScurl::sha256</a>\n</ul>\n</div>\n\n<h2><a name=\"about\">About</h2> \n<b><a href=\"https://github.com/negrutiu/nsis-nscurl/\">NScurl</a></b> is a <b><a href=\"https://github.com/negrutiu/nsis/\">NSIS</a> (Nullsoft Scriptable Install System)</b> plugin with advanced HTTP/HTTPS capabilities.<br>\nIt's implemented on top of <a href=\"https://curl.haxx.se/libcurl/\">libcurl</a> with <a href=\"https://www.openssl.org/\">OpenSSL</a> as SSL backend.<br>\n<br>\n<b>Official project page:</b> <a href=\"https://github.com/negrutiu/nsis-nscurl/\">https://github.com/negrutiu/nsis-nscurl</a><br>\n<b>Dependencies:</b> <a href=\"https://github.com/negrutiu/libcurl-devel/\">https://github.com/negrutiu/libcurl-devel</a><br>\n\n<h3><a name=\"features\">Features</h3>\n<ul>\n<li>Modern: supports modern protocols and ciphers including HTTP/2, TLS1.3, etc.\n<li>Compatible: works well on Windows NT4, Windows 10 and everything in between\n<li>Multi-threaded: download/upload multiple files in parallel\n<li>Asynchronous: start multiple background transfers, check on them later\n<li>Insistent: multiple attempts to connect and resume interrupted transfers\n<li>NSIS aware: download files at any installation stage (from .onInit, from Sections, from custom pages, silent installers, etc)\n<li>Verbose: plenty of useful information is available for querying (transfer size, speed, HTTP status, HTTP headers, etc)\n<li>Supports HTTP and TLS authentication\n<li>Supports all relevant HTTP methods (GET, POST, HEAD, etc)\n<li>Supports DNS-over-HTTPS name resolution\n<li>Supports custom HTTP headers and data\n<li>Supports proxy servers (both authenticated and open)\n<li>Supports files larger than 4GB\n<li>Can download remote content to RAM instead of a file\n<li>Maaany more...\n</ul>\n\n<style>\ntable {\n  font-family: arial, sans-serif;\n  border-collapse: collapse;\n  width: 100%;\n}\n\nth {\n  border: 1px solid #dddddd;\n  background-color: #888888;\n  color: #ffffff;\n  text-align: left;\n  padding: 8px;\n}\n\ntd {\n  border: 1px solid #dddddd;\n  text-align: left;\n  padding: 8px;\n}\n\ntr:nth-child(even) {\n  background-color: #dddddd;\n}\n</style>\n\n<hr>\n\n<h2><a name=\"http\">NScurl::http</a> &lt;METHOD&gt; &lt;URL&gt; &lt;DEST&gt; &lt;params&gt; /END</h2>\n\n<h3>Description:</h3>\nThis function creates a new HTTP request.<br>\nRequests are added to the internal transfer queue and wait there until a worker thread becomes available.<br>\nCompleted transfers remain in the queue and can be <a href=\"#query\">queried</a> at any time.<br>\nBy default the function waits (synchronously) for the new request to complete, unless /BACKGROUND parameter is used.<br>\n\n<h3>Return value:</h3>\nThe return value is pushed to the stack.<br>\nBy default, the function returns the transfer status (aka \"@ERROR@\" query <a href=\"#keywords\">keyword</a>). <b>\"OK\" for success.</b><br>\nIf <b>/BACKGROUND</b> is specified, the function returns an unique transfer ID.<br>\nIf <b>/RETURN</b> is specified, the function returns a custom value depending on the specified query <a href=\"#keywords\">keyword</a>.<br>\n\n<h3>Examples:</h3>\n\n<div style=\"background-color: #dddddd\">\n<b># Quick transfer (with Cancel and resume)</b><br>\n<a href=\"#http\">NScurl::http</a> GET \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\" \"$TEMP\\SysinternalsSuite.zip\" /CANCEL /RESUME /END<br>\nPop $0 ; Status text (\"OK\" for success)<br>\n</div>\n<br>\n<div style=\"background-color: #dddddd\">\n<b># Quick transfer (with custom GET parameters and custom request headers)</b><br>\n<a href=\"#http\">NScurl::http</a> GET \"https://httpbin.org/get?param1=value1&amp;param2=value2\" \"$TEMP\\httpbin_get.json\" /HEADER \"Header1: Value1\" /HEADER \"Header2: Value2\" /END<br>\nPop $0 ; Status text (\"OK\" for success)<br>\n</div>\n<br>\n<div style=\"background-color: #dddddd\">\n<b># POST json file</b><br>\n<a href=\"#http\">NScurl::http</a> POST \"https://httpbin.org/post\" Memory /HEADER \"Content-Type: application/json\" /DATA '{ \"number_of_the_beast\" : 666 }' /END<br>\nPop $0 ; Status text (\"OK\" for success)<br>\n</div>\n<br>\n<div style=\"background-color: #dddddd\">\n<b># POST json file (as multi-part form)</b><br>\n<a href=\"#http\">NScurl::http</a> POST \"https://httpbin.org/post\" Memory /POST \"User\" \"My user name\" /POST \"Password\" \"My password\" /POST FILENAME=maiden.json TYPE=application/json \"Details\" '{ \"number_of_the_beast\" : 666 }' /END<br>\nPop $0 ; Status text (\"OK\" for success)<br>\n</div>\n\n<h3>Parameters:</h3>\n<table>\n<tr>\n\t<td>GET | POST | HEAD | PUT | ...</td>\n\t<td>HTTP method.<br>\n\t<b>NOTE: This parameter is mandatory.</b><br>\n\t</td>\n</tr>\n<tr>\n\t<td>URL</td>\n\t<td>Full URI, including query parameters.<br>\n\t<b>NOTE:</b> Query parameters must be escaped by the caller. <a href=\"#escape\">NScurl::escape</a> is available for that.<br>\n\t<b>NOTE: This parameter is mandatory.</b><br>\n\t</td>\n</tr>\n<tr>\n\t<td>filename|MEMORY</td>\n\t<td>Transfer destination.<br>\n\tIf \"MEMORY\" is specified the remote content is downloaded to RAM. It can be retrieved later using the @RECVDATA@ <a href=\"#keywords\">query keyword</a>.<br>\n\t<b>NOTE:</b> The data downloaded to MEMORY will be truncated to NSIS' maximum string length (1KB, 4KB, 8KB, depending on the NSIS build). If you expect larger data, it's recommended to download it to a file on disk.<br>\n\t<b>NOTE: This parameter is mandatory.</b><br>\n\t</td>\n</tr>\n<tr>\n\t<td>/RETURN query_string</td>\n\t<td>Request a custom return value. Default is \"@ERROR@\" (aka transfer status)<br>\n\tAny combination of <a href=\"#keywords\">query keywords</a> is accepted.<br>\n\t(e.g. \"@ERRORCODE@ - @ELAPSEDTIME@\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/PROXY proxy</td>\n\t<td>Connect through a proxy server.<br>\n\t<b>Syntax:</b> scheme://address.domain[:port].<br>\n\tSupported schemes: http, https, socks4, socks4a, socks5, socks5a<br>\n\tFor more information visit libcurl's <a href=\"https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html\">CURLOPT_PROXY</a> documentation.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/DOH &lt;url&gt;</td>\n\t<td>Specify a <a href=\"https://en.wikipedia.org/wiki/DNS_over_HTTPS\">DNS over HTTPS</a> server to resolve DNS requests securely.<br>\n\t<b>NOTE:</b> This DoH server is used for the current transfer only. It's not a global setting.<br>\n\t<b>EXAMPLE:</b> [...] /DOH \"<a href=\"https://cloudflare-dns.com/dns-query\">https://cloudflare-dns.com/dns-query</a>\"<br>\n\t<b>EXAMPLE:</b> [...] /DOH \"<a href=\"https://doh.opendns.com/dns-query\">https://doh.opendns.com/dns-query</a>\"<br>\n\t<b>EXAMPLE:</b> [...] /DOH \"<a href=\"https://dns.google/dns-query\">https://dns.google/dns-query</a>\"<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/TIMEOUT time<br>\n\t/CONNECTTIMEOUT time<br>\n\t</td>\n\t<td>Connect timeout (default: 5m)<br>\n\tThis value applies to a single connection attempt.<br>\n\tUnless you also specify <b>/INSIST</b>, NScurl will only try to connect once.<br>\n\t<br>\n\t<b>NOTE:</b> The <b>time</b> value represents the timeout period in milliseconds. The \"s\", \"m\" or \"h\" suffixes are accepted.<br>\n\t<b>EXAMPLES:</b> /TIMEOUT 5000, /TIMEOUT 5s, /TIMEOUT 15m, /TIMEOUT 24h<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/COMPLETETIMEOUT time</td>\n\t<td>Transfer timeout (default: infinite)<br>\n\tThis value sets a maximum time limit that a transfer is allowed to run. When this timeout is reached the transfer is cancelled.<br>\n\tSee <b>/TIMEOUT</b> for <b>time</b> examples.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/LOWSPEEDLIMIT bps time</td>\n\t<td>Low speed limit (default: none)<br>\n\tAborts the transfer if the transfer speed falls below <b>bps</b> for a period of <b>time</b>.<br>\n\tSee <b>/TIMEOUT</b> for <b>time</b> examples.<br>\n\t<br>\n\t<b>EXAMPLE:</b> [...] /LOWSPEEDLIMIT 204800 10s [...]<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/SPEEDCAP bps</td>\n\t<td>Speed cap (default: none)<br>\n\tThe transfer speed will not be allowed to exceed this value.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/INSIST</td>\n\t<td>NScurl will try more aggressively to connect to the webserver.<br>\n\tIt will keep trying to connect until a timeout is reached, even if critical errors occur (e.g. no network connection, server down, etc.)<br>\n\tIn addition NScurl will try to re-establish dropped <b>HTTP GET</b> transfers and resume them.<br>\n\tBy default any error will abort the transfer.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/RESUME</td>\n\t<td>Resume the transfer if (part of) the destination file already exists.<br>\n\tBy default the destination is overwritten and the transfer starts over.</td>\n</tr>\n<tr>\n\t<td>/NOREDIRECT</td>\n\t<td>Don't follow HTTP redirections. They are followed by default</td>\n</tr>\n<tr>\n\t<td>/USERAGENT agent</td>\n\t<td>Overwrite the default user agent.<br>\n\tDefault is <b>nscurl/&lt;version&gt;</b>\n\t</td>\n</tr>\n<tr>\n\t<td>/REFERER url</td>\n\t<td>Optional referrer URL.</td>\n</tr>\n<tr>\n\t<td>/DEBUG [nodata] debugfile</td>\n\t<td>Write transfer HTTP/SSL details to a debugging file.<br>\n    <b>nodata</b> prevents the remote content from being actually written to the debugging file. Only its size gets written.<br>\n\tDisabled by default.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/AUTH [TYPE=basic|digest|digestie] user pass</td>\n\t<td>HTTP authentication.<br>\n\tType is determined automatically if not specified. However, an explicit type must be specified when connecting to servers with \"hidden\" authentication.<br>\n\tUsername and password must be cleartext, unescaped.<br>\n\tFor more information visit libcurl's <a href=\"https://curl.haxx.se/libcurl/c/CURLOPT_HTTPAUTH.html\">CURLOPT_HTTPAUTH</a> documentation.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/AUTH TYPE=bearer token</td>\n\t<td>HTTP bearer authentication.<br>\n\tThe OAuth 2.0 token is mandatory.<br>\n\tFor more information visit libcurl's <a href=\"https://curl.haxx.se/libcurl/c/CURLOPT_HTTPAUTH.html\">CURLOPT_HTTPAUTH</a> documentation.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/TLSAUTH user pass</td>\n\t<td><a href=\"https://en.wikipedia.org/wiki/TLS-SRP\">TLS-SRP</a> (Secure Remote Password) authentication.<br>\n\tUsername and password must be cleartext, unescaped.<br>\n\tFor more information visit libcurl's <a href=\"https://curl.haxx.se/libcurl/c/CURLOPT_TLSAUTH_TYPE.html\">CURLOPT_TLSAUTH_TYPE</a> documentation.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/HEADER hdr(s)</td>\n\t<td>Additional HTTP request header(s).<br>\n\t<b>NOTE:</b> Multiple headers can be separated by CRLF ($\\r$\\n)<br>\n\t<b>NOTE:</b> Multiple /HEADER parameters are accepted.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/DATA [-string|file|memory] &lt;data&gt;</td>\n\t<td>Upload local data to the server.<br>\n\t<br>\n\tThe data is read either from a file or directly from memory.<br>\n\tThe optional <b>-string</b>, <b>-file</b>, <b>-memory</b> hints can be used to indicate <b>data</b>'s origin.<br>\n\tIf unspecified, the function tries to guess whether <b>data</b> represents a file name or a generic string.<br>\n\t<br>\n\t<b>EXAMPLES:</b><br>\n\t<a href=\"#http\"><b>NScurl::http</b></a> PUT ${url} ${file} /DATA <b>\"Send generic string\"</b> /END<br>\n\t<a href=\"#http\"><b>NScurl::http</b></a> PUT ${url} ${file} /DATA <b>\"C:\\dir\\file.dat\"</b> /END<br>\n\t<a href=\"#http\"><b>NScurl::http</b></a> PUT ${url} ${file} /DATA <b>-string \"C:\\dir\\file.dat\"</b> /END  /* Upload the file path itself <u>as string</u> */<br>\n\t<a href=\"#http\"><b>NScurl::http</b></a> PUT ${url} ${file} /DATA <b>-memory 0xdeadbeef 256</b> /END<br>\n\t<br>\n\t<b>NOTE:</b> The <b>-memory</b> hint must be followed by two parameters: address and size.<br>\n\t<b>NOTE:</b> Although optional, it's recommended that you always specify the <b>-string|file|memory</b> hint.<br>\n\t<b>NOTE:</b> Requires POST or PUT methods. Ignored otherwise.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/POST\n\t<p style=\"margin-left: 10px; margin-top: 0; margin-bottom: 0\">\n\t\t[FILENAME=remote_filename]<br>\n\t\t[TYPE=mime_type]<br>\n\t\t&lt;name&gt;<br>\n\t\t[-string|file|memory] &lt;data&gt;<br>\n\t</p>\n\t</td>\n\t<td>Upload a multipart form to the server.<br>\n\t<br>\n\tFILENAME: Optional remote file name<br>\n\tTYPE: Optional MIME type<br>\n\tname: Form part name<br>\n\tdata: Form part data<br>\n\t<br>\n\t<b>EXAMPLE:</b><br>\n\t<a href=\"#http\"><b>NScurl::http</b></a> POST ${url} ${file} \\<br>\n\t<p style=\"margin-left: 10px; margin-top: 0; margin-bottom: 0\">\n\t\t/POST \"User\" <b>\"My User Name\"</b> \\<br>\n\t\t/POST \"Pass\" <b>\"My Password\"</b> \\<br>\n\t\t/POST \"InfoFile\" <b>-string \"$TEMP\\MyDetail.json\"</b> /* Upload the file path itself <u>as string</u> */ \\<br>\n\t\t/POST \"InfoData\" <b>-file \"$TEMP\\MyDetail.json\"</b> /* Upload the file content */ \\<br>\n\t\t/POST \"Image\" FILENAME=MyImage.jpg TYPE=image/jpeg <b>\"$TEMP\\MyImage.jpg\"</b> \\<br>\n\t\t/POST \"Details\" FILENAME=MyDetails.json TYPE=application/json <b>'{ \"number_of_the_beast\" : 666 }'</b> \\<br>\n\t\t/END<br>\n\t</p>\n\t<br>\n\t<b>NOTE:</b> See /DATA to learn how <b>data</b> is interpreted.<br>\n\t<b>NOTE:</b> Multiple /POST parameters are accepted. All form parts will be sent as one multipart form.<br>\n\t<b>NOTE:</b> Requires POST method. Ignored otherwise.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/Zone.Identifier<br>\n\t/MARKOFTHEWEB<br>\n\t</td>\n\t<td>Marks the output file with the \"Mark of the Web\".<br>\n\tAn alternate NTFS data stream named \"Zone.Identifier\" is attached to the output file.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/CACERT \"path\\cacert.pem\"</td>\n\t<td>Validate webserver identity using a custom <b>cacert.pem</b> certificate database.<br>\n\tBy default a built-in <b>cacert.pem</b> is extracted and used at runtime.<br>\n\tSSL validation can be turned off by specifying an empty (\"\") path.<br>\n\t<br>\n\t<b>NOTE:</b> The embedded <b>cacert.pem</b> can rapidly become obsolete. That would lead to legitimate websites being treated as untrusted.<br>\n\t<b>NOTE:</b> The libcurl project maintains a <b>cacert.pem</b> database that is considered trusted. You can <a href=\"https://curl.haxx.se/docs/caextract.html\">download it</a> from their website and feed it to NScurl as custom certificate store.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/CERT thumbprint</td>\n\t<td>Specify an additional trusted certificate SHA1 thumbprint (e.g. /CERT 917e732d330f9a12404f73d8bea36948b929dffc).<br>\n\tTrusted thumbprints are used for SSL validation in addition to the <b>cacert.pem</b> database.<br>\n\t<br>\n\t<b>NOTE:</b> Multiple /CERT parameters are accepted. All thumbprints are aggregated into a big certificate whitelist.<br>\n\t<b>NOTE:</b> <b>cacert.pem</b> database can be turned off by specifying an empty path (<b>/CACERT \"\"</b>), leaving the thumbprint list the only certificate store used for validation.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/DEPEND id</td>\n\t<td>Makes this HTTP request dependent on another request.<br>\n\tThe new request will wait in queue until its dependency gets completed.<br>\n\tUseful to establish a precise HTTP request order in a multi-threaded environment.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/TAG tag</td>\n\t<td>Assign a tag to the new HTTP request.<br>\n\tMultiple transfers can be grouped together under the same tag.<br>\n\t<b>NOTE:</b> Tags are custom strings with no character restrictions.<br>\n\t<br>\n\t<b>EXAMPLE:</b><br>\n\t<a href=\"#http\">NScurl::http</a> GET ${URL1} ${File1} <b>/TAG \"FirstTag\"</b> /BACKGROUND /END<br>\n\t<a href=\"#http\">NScurl::http</a> GET ${URL2} ${File2} <b>/TAG \"SecondTag\"</b> /BACKGROUND /END<br>\n\t<a href=\"#http\">NScurl::http</a> GET ${URL3} ${File3} <b>/TAG \"FirstTag\"</b> /BACKGROUND /END<br>\n\t<a href=\"#wait\">NScurl::wait</a> <b>/TAG \"FirstTag\"</b> /END<br>\n\t<a href=\"#cancel\">NScurl::cancel</a> <b>/TAG \"FirstTag\"</b> /REMOVE<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/BACKGROUND</td>\n\t<td>By default, NScurl::http creates a new HTTP request and <b>waits</b> for it to complete.<br>\n\tWith <b>/BACKGROUND</b> you mark the new request as a background transfer and place it in the queue for later processing.<br>\n\tThe call returns immediately, no visual progress is displayed.<br>\n\t<b>NOTE:</b> <b><a href=\"#http\">NScurl::http</a></b> will return a <b>transfer ID</b> instead of the transfer status. The ID can be used later for <a href=\"#query\">querying</a>.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/PAGE</td>\n\t<td>Wait for the transfer to complete in Page-mode.<br>\n\tWhen waiting from an NSIS section (while on the <b>InstFiles</b> page), the function will create a dedicated progress bar to visually display the progress.<br>\n\t<b>NOTE:</b> /PAGE is the default wait mode if nothing else is specified!<br>\n\t<b>NOTE:</b> /PAGE is incompatible with /BACKGROUND.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/POPUP</td>\n\t<td>Wait for the transfer to complete in Popup-mode.<br>\n\tProgress is displayed on a pop-up window.<br>\n\t<b>NOTE:</b> /POPUP is incompatible with /BACKGROUND.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/SILENT</td>\n\t<td>Wait silently for the transfer to complete.<br>\n\tNo visual progress is displayed.<br>\n\t<b>NOTE:</b> This is the default wait mode for <b>silent</b> installers.<br>\n\t<b>NOTE:</b> /SILENT is incompatible with /BACKGROUND.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/CANCEL</td>\n\t<td>Enable <b>Cancel</b> button when waiting in Page-mode or Popup-mode.<br>\n\tBy default transfers can not be cancelled.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/TITLEWND hwnd<br>\n\t/TEXTWND hwnd<br>\n\t/PROGRESSWND hwnd<br>\n\t/CANCELWND hwnd<br>\n\t</td>\n\t<td>Optional Title window handle.<br>\n\tOptional Text/Status window handle.<br>\n\tOptional progress bar window handle.<br>\n\tOptional Cancel button handle.<br>\n\t<b>NOTE:</b> These windows are automatically detected/created by default.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/STRING TITLE string<br>\n\t/STRING TITLE_NOSIZE string<br>\n\t/STRING TITLE_MULTI string<br>\n\t/STRING TEXT string<br>\n\t/STRING TEXT_NOSIZE string<br>\n\t/STRING TEXT_MULTI string<br>\n\t</td>\n\t<td>Overwrite the default (English) UI strings.<br>\n\tUseful to create localized installers.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/END</td>\n\t<td>Must always conclude the list of parameters.<br>\n\t<b>NOTE: This parameter is mandatory.</b><br>\n\t</td>\n</tr>\n</table>\n<br>\n\n<hr>\n\n<h2><a name=\"query\">NScurl::query</a> [/ID id] [/TAG tag] \"query_string\"</h2>\n\n<h3>Description:</h3>\nQuery information.<br>\nThis function will replace <a href=\"#keywords\">query keywords</a> inside <b>query_string</b> with real data.<br>\n<b>Transfer-specific keywords</b> are only available when a single transfer is matched (See /ID and /TAG).</br>\n<b>Global keywords</b> are always available.<br>\n\n<h3>Return value:</h3>\n<b>query_string</b> with expanded keywords is returned on the stack.\n\n<h3>Examples:</h3>\n<div style=\"background-color: #dddddd\">\n<i>; Query information about a specific HTTP request</i><br>\n<b><a href=\"#http\">NScurl::http</a></b> GET \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\" \"$TEMP\\SysinternalsSuite.zip\" /RETURN \"<a href=\"#keywords\">@ID@</a>\" /END<br>\nPop $0 ; <i>Transfer ID</i><br>\n<b><a href=\"#query\">NScurl::query</a></b> /ID $0 \"Status: @ERROR@, Headers: @RECVHEADERS@\"<br>\nPop $1 ; <i>Server response headers</i>\n</div>\n<br>\n\n<div style=\"background-color: #dddddd\">\n<i>; Query global information</i><br>\n<b><a href=\"#http\">NScurl::query</a></b> \"<a href=\"#keywords\">@TOTALSIZE@</a> - <a href=\"#keywords\">@TOTALSPEED@</a>\"<br>\nPop $0\n</div>\n<br>\n\n<h3>Parameters:</h3>\n<table>\n<tr>\n\t<td>/ID id</td>\n\t<td>Query information about a specific transfer.<br>\n\tThe transfer ID is returned by <a href=\"#http\">NScurl::http</a>.<br>\n</tr>\n<tr>\n\t<td>/TAG tag</td>\n\t<td>Query information about multiple transfers tagged with the same <b>tag</b>.<br>\n\tSee <a href=\"#http\">NScurl::http</a>.\n\t</td>\n</tr>\n<tr>\n\t<td>query_string</td>\n\t<td>The input string.<br>\n\tThe function will replace <a href=\"#keywords\">query keywords</a> with real data and return the result.<br>\n\t</td>\n</tr>\n</table>\n\n<h3><a name=\"keywords\">Query Keywords:</a></h3>\n\n<table>\n<tr>\n\t<th><u>Transfer-specific</u> keywords</th>\n\t<th>Comments</th>\n</tr>\n<tr>\n\t<td>@ID@</td>\n\t<td>Unique transfer ID<br>\n\tValue: (Integer) &gt;= 1<br>\n\tUseful for <a href=\"#http\">NScurl::http</a> /return \"@ID@\"\n\t</td>\n</tr>\n<tr>\n\t<td>@STATUS@</td>\n\t<td>Transfer status.<br>\n\tValue: (String) One of \"Waiting\", \"Running\" or \"Complete\"\n\t</td>\n</tr>\n<tr>\n\t<td>@METHOD@</td>\n\t<td>HTTP method (e.g. GET, POST, PUT, etc.)<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@URL@</td>\n\t<td>Full HTTP request URI.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@FINALURL@</td>\n\t<td>The final HTTP request URI, after all redirections had been followed.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@OUT@</td>\n\t<td>Transfer destination.<br>\n\tCan be a file path, or the special term \"Memory\".\n\t</td>\n</tr>\n<tr>\n\t<td>@OUTFILE@</td>\n\t<td>Destination file name extracted from @OUT@ (e.g. \"SysinternalsSuite.zip\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@OUTDIR@</td>\n\t<td>Destination directory extracted from @OUT@ (e.g. \"C:\\Downloads\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@SERVERIP@</td>\n\t<td>HTTP server IP address.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@SERVERPORT@</td>\n\t<td>HTTP server IP port number (usually 80 or 443)<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@FILESIZE@<br>\n\t@FILESIZE_B@<br>\n\t</td>\n\t<td>Remote file size extracted from <b>Content-Length</b> HTTP header.<br>\n\tValue: (String) Nicely formatted file size (e.g. \"100 bytes\", \"250 KB\", \"10 MB\", \"1.2 GB\", etc.)<br>\n\t<b>NOTE:</b> It may be unknown during the transfer. Some servers don't report this value.<br>\n\t<b>NOTE:</b> @FILESIZE_B@ returns the same value in bytes.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@XFERSIZE@<br>\n\t@XFERSIZE_B@<br>\n\t</td>\n\t<td>The amount of data actually transferred.<br>\n\t<b>NOTE:</b> It's usually the same value as @FILESIZE@, but it can be smaller if the transfer got cancelled.<br>\n\t<b>NOTE:</b> @XFERSIZE_B@ returns the same value in bytes.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@PERCENT@</td>\n\t<td>Transfer progress.<br>\n\tValue: (Integer) 0-100, or -1 if the percent is unknown.<br>\n\t<b>NOTE:</b> The percent might be unknown if the webserver doesn't send Content-Length header.\n\t</td>\n</tr>\n<tr>\n\t<td>@SPEED@<br>\n\t@SPEED_B@<br>\n\t</td>\n\t<td>Transfer speed, nicely formatted (e.g. \"100 KB/s\", \"1.2 MB/s\", etc.)<br>\n\t<b>NOTE:</b> @SPEED_B@ returns the same value in bytes/s.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TIMEELAPSED@<br>\n\t@TIMEELAPSED_MS@<br>\n\t</td>\n\t<td>Transfer elapsed time. Formatted as [d.][hh:]mm:ss (e.g. \"05:02\" for 5m and 2s)<br>\n\tIt doesn't include the time this request has waited in the queue.<br>\n\t<b>NOTE:</b> @TIMEELAPSED_MS@ returns the same value in milliseconds.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TIMEREMAINING@<br>\n\t@TIMEREMAINING_MS@<br>\n\t</td>\n\t<td>The estimated time required by this transfer to complete. Formatted as [d.][hh:]mm:ss<br>\n\t<b>NOTE:</b> @TIMEREMAINING_MS@ returns the same value in milliseconds.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@SENTHEADERS@<br>\n\t@SENTHEADERS:Header-Name@<br>\n\t@SENTHEADERS_RAW@<br>\n\t</td>\n\t<td>HTTP request headers.<br>\n\tSome special characters such as \\t, \\r, \\n are replaced by their string representation \"\\t\", \"\\r\", \"\\n\"<br>\n\t<b>NOTE:</b> @SENTHEADERS:Header-Name@ extracts the value of a specific header.<br>\n\t<b>NOTE:</b> @SENTHEADERS_RAW@ returns the same value with no characters replaced.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@RECVHEADERS@<br>\n\t@RECVHEADERS:Header-Name@<br>\n\t@RECVHEADERS_RAW@<br>\n\t</td>\n\t<td>HTTP response headers.<br>\n\tSome special characters such as \\t, \\r, \\n are replaced by their string representation \"\\t\", \"\\r\", \"\\n\"<br>\n\t<b>NOTE:</b> @RECVHEADERS:Header-Name@ extracts the value of a specific header.<br>\n\t<b>NOTE:</b> @RECVHEADERS_RAW@ returns the same value with no characters replaced.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@RECVDATA@<br>\n\t@RECVDATA_RAW@<br>\n\t</td>\n\t<td>A sample of the received data.<br>\n\tNon-printable characters are replaced with \".\"<br>\n\t<b>NOTE:</b> Can retrieve remote content downloaded to <b>MEMORY</b>.<br>\n\t<b>NOTE:</b> This value is truncated to NSIS' maximum string length (1KB, 4KB, 8KB, depending on the NSIS build).<br>\n\t<b>NOTE:</b> @RECVDATA_RAW@ returns the same value with no characters replaced.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TAG@</td>\n\t<td>Transfer tag, empty by default.<br>\n\tMultiple transfers can be tagged with the same tag.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@ERROR@</td>\n\t<td>The final transfer status.<br>\n\tValues: \"<b>OK</b>\" for success, '0x2a \"Callback aborted\"', etc.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@ERRORCODE@</td>\n\t<td>The numeric status code.<br>\n\tIt can be either an HTTP status code, a libcurl error code, or a Win32 error code.<br>\n\tValue: (Integer) 200, 206, 404, 0x2a, etc.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@ERRORTYPE@</td>\n\t<td>Returns @ERRORCODE@ error type.<br>\n\tValue: (String) \"win32\", \"curl\" or \"http\"<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@CANCELLED@</td>\n\t<td>Indicates whether the transfer was cancelled by the user.<br>\n\tValue: (Boolean) 0 or 1.<br>\n\t</td>\n</tr>\n\n\n<tr>\n\t<th><u>Global</u> keywords</th>\n\t<th>Comments</th>\n</tr>\n<tr>\n\t<td>@PLUGINNAME@</td>\n\t<td>\"<b>NScurl</b>\"<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@PLUGINVERSION@</td>\n\t<td>Plugin's version.<br>\n\tReturns the \"FileVersion\" value from Version Information resource block.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@PLUGINAUTHOR@</td>\n\t<td>Author's name.<br>\n\tReturns the \"CompanyName\" value from Version Information resource block.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@PLUGINWEB@</td>\n\t<td>Project's website.<br>\n\tReturns the \"LegalTrademarks\" value from Version Information resource block.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@CURLVERSION@</td>\n\t<td>libcurl version (e.g. \"7.68.0\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@CURLSSLVERSION@</td>\n\t<td>SSL backend version (e.g. \"7.68.0\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@CURLPROTOCOLS@</td>\n\t<td>libcurl built-in protocols (e.g. \"http https\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@CURLFEATURES@</td>\n\t<td>libcurl built-in features (e.g. \"SSL NTLM Debug AsynchDNS Largefile TLS-SRP UnixSockets\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@USERAGENT@</td>\n\t<td>The default user agent (e.g. \"nscurl/1.2020.3.1\")<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALCOUNT@</td>\n\t<td>The number of HTTP requests in the queue.<br>\n\tIncludes all \"Waiting\", \"Running\" and \"Complete\" requests.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALWAITING@</td>\n\t<td>The number of \"Waiting\" requests in the queue.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALRUNNING@</td>\n\t<td>The number of \"Running\" requests in the queue.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALCOMPLETE@</td>\n\t<td>The number of \"Complete\" requests in the queue.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALACTIVE@</td>\n\t<td>The number of \"Waiting\" + \"Running\" requests in the queue.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALSTARTED@</td>\n\t<td>The number of \"Running\" + \"Completed\" requests in the queue.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALERRORS@</td>\n\t<td>The number of failed requests in the queue.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALSPEED@<br>\n\t@TOTALSPEED_B@<br>\n\t</td>\n\t<td>The aggregated speed of \"Running\" transfers (e.g. \"120 KB/s\", \"1.2 MB/s\", etc.)<br>\n\t<b>NOTE:</b> @TOTALSPEED_B@ returns the same value in bytes/s.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALSIZE@<br>\n\t@TOTALSIZE_B@<br>\n\t</td>\n\t<td>The aggregated amount of Downloaded + Uploaded data (e.g. \"100 MB\", \"5 GB\", etc.)<br>\n\t<b>NOTE:</b> @TOTALSIZE_B@ returns the same value in bytes.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALSIZEUP@<br>\n\t@TOTALSIZEUP_B@<br>\n\t</td>\n\t<td>The aggregated amount of Uploaded data (e.g. \"100 MB\", \"5 GB\", etc.)<br>\n\t<b>NOTE:</b> @TOTALSIZEUP_B@ returns the same value in bytes.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@TOTALSIZEDOWN@<br>\n\t@TOTALSIZEDOWN_B@<br>\n\t</td>\n\t<td>The aggregated amount of Downloaded data (e.g. \"100 MB\", \"5 GB\", etc.)<br>\n\t<b>NOTE:</b> @TOTALSIZEDOWN_B@ returns the same value in bytes.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@THREADS@</td>\n\t<td>Current number of worker threads.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>@MAXTHREADS@</td>\n\t<td>Maximum number of worker threads.<br>\n\t</td>\n</tr>\n\n</table>\n<br>\n\n<hr>\n\n<h2><a name=\"wait\">NScurl::wait</a> [/ID id] [/TAG tag] &lt;params&gt; /END</h2>\n\n<h3>Description:</h3>\nWait synchronously for <b>background</b> transfer(s) to complete.<br>\nDepending on parameters visual progress may or may not be displayed.<br>\nYou can either wait for a specific transfer, or wait for multiple transfers in one go.<br>\n\n<h3>Return value:</h3>\n<b>None</b>\n\n<h3>Example:</h3>\n<div style=\"background-color: #dddddd\">\n<b># Start a background transfer</b><br>\n<b><a href=\"#http\">NScurl::http</a></b> GET \"${URL}\" \"${FILE}\" <b>/BACKGROUND</b> /END<br>\nPop $0\t; Transfer ID<br>\n<br>\n<b># ...do some useful stuff...</b><br>\n<br>\n<b># Wait...</b><br>\n<b><a href=\"#wait\">NScurl::wait</a></b> /ID $0 /CANCEL /END<br>\n</div>\n<br>\n\n<h3>Parameters:</h3>\n<table>\n<tr>\n\t<td>/ID id</td>\n\t<td>Wait for a specific transfer.<br>\n\tThe transfer ID is returned by <a href=\"#http\">NScurl::http</a>.<br>\n</tr>\n<tr>\n\t<td>/TAG tag</td>\n\t<td>Wait for multiple transfers tagged with the same <b>tag</b>.<br>\n\tSee <a href=\"#http\">NScurl::http</a>\n\t</td>\n</tr>\n<tr>\n\t<td>/PAGE</td>\n\t<td>See <a href=\"#http\">NScurl::http</a></td>\n</tr>\n<tr>\n\t<td>/POPUP</td>\n\t<td>See <a href=\"#http\">NScurl::http</a></td>\n</tr>\n<tr>\n\t<td>/SILENT</td>\n\t<td>See <a href=\"#http\">NScurl::http</a></td>\n</tr>\n<tr>\n\t<td>/CANCEL</td>\n\t<td>See <a href=\"#http\">NScurl::http</a></td>\n</tr>\n<tr>\n\t<td>/TITLEWND hwnd<br>\n\t/TEXTWND hwnd<br>\n\t/PROGRESSWND hwnd<br>\n\t/CANCELWND hwnd<br>\n\t</td>\n\t<td>See <a href=\"#http\">NScurl::http</a></td>\n</tr>\n<tr>\n\t<td>/STRING TITLE string<br>\n\t/STRING TITLE_NOSIZE string<br>\n\t/STRING TITLE_MULTI string<br>\n\t/STRING TEXT string<br>\n\t/STRING TEXT_NOSIZE string<br>\n\t/STRING TEXT_MULTI string<br>\n\t<td>See <a href=\"#http\">NScurl::http</a></td>\n\t</td>\n</tr>\n<tr>\n\t<td>/END</td>\n\t<td>Must always conclude the list of parameters.<br>\n\t<b>NOTE: This parameter is mandatory.</b><br>\n\t</td>\n</tr>\n</table>\n<br>\n\n<hr>\n\n<h2><a name=\"enumerate\">NScurl::enumerate</a> [/TAG tag] [/STATUS status] /END</h2>\n\n<h3>Description:</h3>\nEnumerate HTTP transfers from the internal transfer queue.<br>\n\n<h3>Return value:</h3>\nTransfer ID's are pushed one by one to the stack.<br>\nAn empty string (\"\") is pushed to the stack to mark the end of the enumeration.<br>\n\n<h3>Examples:</h3>\n<div style=\"background-color: #dddddd\">\n<b><a href=\"#enumerate\">NScurl::enumerate</a></b> /END<br>\n_enum_loop:<br>\n\t<p style=\"margin-left: 20px; margin-top: 0; margin-bottom: 0\">\n\tPop $0<br>\n\tStrCmp $0 \"\" _enum_end<br>\n\tDetailPrint 'TODO: Transfer ID $0'<br>\n\tGoto _enum_loop<br>\n\t</p>\n_enum_end:<br>\n</div>\n<br>\n\n<h3>Parameters:</h3>\n<table>\n<tr>\n\t<td>/TAG tag</td>\n\t<td>Enumerate transfers tagged with the same <b>tag</b>.</td>\n</tr>\n<tr>\n\t<td>/STATUS Waiting|Running|Complete</td>\n\t<td>Enumerate transfer with specific status:<br>\n\t<li><b>Waiting</b>: transfers that are still waiting in the queue<br>\n\t<li><b>Running</b>: transfers currently in progress.<br>\n\t<li><b>Complete</b>: complete/aborted/failed transfers.<br>\n\t<br>\n\t<b>NOTE:</b> Multiple /STATUS parameters are accepted.<br>\n\t</td>\n</tr>\n<tr>\n\t<td>/END</td>\n\t<td>Must always conclude the list of parameters.<br>\n\t<b>NOTE: This parameter is mandatory.</b><br>\n\t</td>\n</tr>\n</table>\n<br>\n\n<hr>\n\n<h2><a name=\"cancel\">NScurl::cancel</a> [/ID id] [/TAG tag] [/REMOVE]</h2>\n\n<h3>Description:</h3>\nCancel (background) transfers and optionally remove them from the queue.\n\n\n<h3>Return value:</h3>\nNone.\n\n<h3>Parameters:</h3>\n<table>\n<tr>\n\t<td>/ID id</td>\n\t<td>Cancel a specific transfer.<br>\n\tThe transfer ID is returned by <a href=\"#http\">NScurl::http</a> /BACKGROUND<br>\n</tr>\n<tr>\n\t<td>/TAG tag</td>\n\t<td>Cancel multiple transfers tagged with the same <b>tag</b>.<br>\n\tSee <a href=\"#http\">NScurl::http</a> /TAG\n\t</td>\n</tr>\n<tr>\n\t<td>/REMOVE</td>\n\t<td>In addition to cancelling, the transfer(s) are also permanently removed from the queue.<br>\n\tFurther attempts to <a href=\"#query\">NScurl::query</a> them will fail.<br>\n\t</td>\n</tr>\n</table>\n<br>\n\n<hr>\n\n<h2><a name=\"escape\">NScurl::escape</a> &lt;string&gt;<br>\n<a name=\"unescape\">NScurl::unescape</a> &lt;string&gt;</h2>\n\n<h3>Description:</h3>\nUn/Escape URL strings (converts all illegal URLs characters to/from their %XX format).<br>\n\n<h3>Return value:</h3>\nUn/Escaped string is pushed to the stack.<br>\n\n<h3>Examples:</h3>\n<div style=\"background-color: #dddddd\">\n<b><a href=\"#escape\">NScurl::escape</a></b> \"aaa bbb ccc=ddd&eee\"<br>\nPop $0\t; Returns \"aaa%20bbb%20ccc%3Dddd%26eee\"<br>\n<br>\n<b><a href=\"#unescape\">NScurl::unescape</a></b> $0<br>\nPop $0\t; Returns the original string<br>\n</div>\n<br>\n\n<hr>\n\n<h2><a name=\"md5\">NScurl::md5</a> [-string|file|memory] &lt;data&gt;<br>\n<a name=\"sha1\">NScurl::sha1</a> [-string|file|memory] &lt;data&gt;<br>\n<a name=\"sha256\">NScurl::sha256</a> [-string|file|memory] &lt;data&gt;</h2>\n\n<h3>Description:</h3>\nCompute MD5 / SHA1 / SHA256 hashes.<br>\nThe data can be read either from a file or directly from memory.<br>\n<b>NOTE:</b> See /DATA to learn how <b>data</b> is interpreted.<br>\n\n<h3>Return value:</h3>\nThe hash (formatted as hex string) is pushed to the stack.<br>\n\n<h3>Examples:</h3>\n<div style=\"background-color: #dddddd\">\n<b><a href=\"#md5\">NScurl::md5</a></b> \"Hash this string\"<br>\nPop $0\t; e.g. \"376630459092d7682c2a2e745d74aa6b\"<br>\n<br>\n<b><a href=\"#md5\">NScurl::md5</a></b> $EXEPATH<br>\nPop $0\t; e.g. \"93a52d04f7b56bc267d45bd95c6de49b\"<br>\n<br>\n<b><a href=\"#sha1\">NScurl::sha1</a></b> -file $EXEPATH<br>\nPop $0\t; e.g. \"faff487654d4dfa1deb5e5d462c8cf51b00a4acd\"<br>\n<br>\n<b><a href=\"#sha1\">NScurl::sha1</a></b> -string $EXEPATH /* Hash the file path as regular string */<br>\nPop $0<br>\n<br>\n<b><a href=\"#sha256\">NScurl::sha256</a></b> $EXEPATH<br>\nPop $0\t; e.g. \"e6fababe9530b1d5c4395ce0a1379c201ebb017997e4671a442a8410d1e2e6ac\"<br>\n</div>\n<br>\n\n<hr>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/NSutils/NSutils.Readme.txt",
    "content": "_______________________________________________________________________________\n\nFunctions exported by NSutils\nhttps://github.com/negrutiu/nsis-nsutils\nmarius.negrutiu@protonmail.com\n_______________________________________________________________________________\n\n[GetVersionInfoString]\nExtract specific strings from an executable's version information block.\nBe mindful of the file system redirection on 64-bit platforms!\n\nSyntax:\n\tNSutils::GetVersionInfoString ExeName VersionInfoString\n\nReturn value:\n\tThe requested string will be returned on the stack\n\nExample:\n\t${DisableX64FSRedirection}\t; Optional. On 64-bit platforms, read from System32 rather than SysWOW64\n\tNSutils::GetVersionInfoString \"$SYSDIR\\Notepad.exe\" \"LegalCopyright\"\n\tPop $0\n\t${If} \"$0\" != \"\"\n\t\t; Valid string\n\t\tMessageBox MB_ICONINFORMATION 'LegalCopyright = \"$0\"'\n\t${Else}\n\t\t; Some error. Probably the string is missing\n\t${EndIf}\n\t${EnableX64FSRedirection}\n_______________________________________________________________________________\n\n[GetFileVersion]\nExtract the numeric file version from an executable's version information block.\nBe mindful of the file system redirection on 64-bit platforms!\n\nSyntax:\n\tNSutils::GetFileVersion ExeName\n\nReturn values:\n\tIf the operation is successful, the function will return a pre-formatted\n\t\"v1.v2.v3.v4\" version string on the stack. In addition, $1, $2, $3 and $4\n\twill store each individual version component.\n\tIf the operation is unsuccessful, an empty string will be returned on the\n\tstack, and $1..$4 will not be set.\n\nExample:\n\t${DisableX64FSRedirection}\t; Optional. On 64-bit platforms, read from System32 rather than SysWOW64\n\tNSutils::GetFileVersion \"$SYSDIR\\Notepad.exe\"\n\tPop $0\n\t${If} \"$0\" != \"\"\n\t\t; $1, $2, $3, $4 are valid\n\t\tMessageBox MB_ICONINFORMATION \"FileVersion: $0 ($1, $2, $3, $4)\"\n\t${Else}\n\t\t; Error\n\t${EndIf}\n\t${EnableX64FSRedirection}\n_______________________________________________________________________________\n\n[GetProductVersion]\nExtract the numeric product version from an executable's version information block.\nBe mindful of the file system redirection on 64-bit platforms!\n\nSyntax:\n\tNSutils::GetProductVersion ExeName\n\nReturn values:\n\tIf the operation is successful, the function will return a pre-formatted\n\t\"v1.v2.v3.v4\" version string on the stack. In addition, $1, $2, $3 and $4\n\twill store each individual version component.\n\tIf the operation is unsuccessful, an empty string will be returned on the\n\tstack, and $1..$4 will not be set.\n\nExample:\n\t${DisableX64FSRedirection}\t; Optional. On 64-bit platforms, read from System32 rather than SysWOW64\n\tNSutils::GetFileVersion \"$SYSDIR\\Notepad.exe\"\n\tPop $0\n\t${If} \"$0\" != \"\"\n\t\t; $1, $2, $3, $4 are valid\n\t\tMessageBox MB_ICONINFORMATION \"ProductVersion: $0 ($1, $2, $3, $4)\"\n\t${Else}\n\t\t; Error\n\t${EndIf}\n\t${EnableX64FSRedirection}\n_______________________________________________________________________________\n\n[ReadResourceString]\nRead a string from an executable's string table.\nBe mindful of the file system redirection on 64-bit platforms!\n\nSyntax:\n\tNSutils::ReadResourceString ExeName StringID StringLANG\n\nReturn values:\n\tThe resource string on the stack.\n\tAn empty string is returned in case of any error.\n\nExample:\n\t${DisableX64FSRedirection}\t; Optional. On 64-bit platforms, read from System32 rather than SysWOW64\n\tNSutils::ReadResourceString \"$SYSDIR\\Notepad.exe\" 14 1033\n\tPop $0\n\t${If} \"$0\" != \"\"\n\t\tMessageBox MB_ICONINFORMATION 'String #13: \"$0\"'\n\t${Else}\n\t\t; Error\n\t${EndIf}\n\t${EnableX64FSRedirection}\n_______________________________________________________________________________\n\n[WriteResourceString]\nWrite a string to an executable's string table.\nIf an empty string is specified, it will be removed from the string table.\n\nBe mindful of the file system redirection on 64-bit platforms!\nBe mindful of the .LN and .mui files (introduced in Vista)!\nExecutables with sattelite .mui files cannot have their string tables updated!\nRead more: \"http://msdn.microsoft.com/en-us/library/windows/desktop/ms648049(v=vs.85).aspx\"\n\nSyntax:\n\tNSutils::WriteResourceString ExeName StringID StringLANG \"The string\"\n\nReturn values:\n\t0/1 on the stack\n\nExample:\n\t${DisableX64FSRedirection}\t; Optional. On 64-bit platforms\n\tNSutils::WriteResourceString \"$EXEDIR\\MyExecutable.exe\" 100 1033 \"My new string\"\n\tPop $0\n\t${If} $0 = ${TRUE}\n\t\tMessageBox MB_ICONINFORMATION 'String #100 successfully modified'\n\t${Else}\n\t\t; Error\n\t${EndIf}\n\t${EnableX64FSRedirection}\n_______________________________________________________________________________\n\n[ExecutePendingFileRenameOperations]\nThe routine examines the \"PendingFileRenameOperations\" registry value\nand executes all pending operations that match a specified substring.\nOperations will be removed from the registry value, and won't\nbe executed again at the next reboot...\nOperations will be logged to LogFile.\n\nSyntax:\n\tNSutils::ExecutePendingFileRenameOperations \"FileSubstring\" \"LogFile\"\n\nReturn values:\n\tTwo error codes are returned on the stack.\n\t1. Win32 error code\n\t2. Win32 error code of the first failed operation\n\nExample:\n\tNSutils::ExecutePendingFileRenameOperations \"AppData\\Local\\Temp\" \"C:\\MyPath\\MyLog.txt\"\n\tPop $0\n\tPop $1\n\t${If} $0 = ${ERROR_SUCCESS}\n\t\t${If} $1 = ${ERROR_SUCCESS}\n\t\t\t; Success. All file operations were successful, as well\n\t\t${Else}\n\t\t\t; Success, but some file operations failed...\n\t\t${EndIf}\n\t${Else}\n\t${EndIf}\n_______________________________________________________________________________\n\n[FindPendingFileRenameOperations]\nThe routine searches the \"PendingFileRenameOperations\" registry value for\npending operations that match a specified substring.\n\nSyntax:\n\tNSutils::FindPendingFileRenameOperations \"FileSubstring\"\n\nReturn values:\n\t[Stack] The first path containing the substring, or, an empty string if nothing is found\n\nExample:\n\tNSutils::FindPendingFileRenameOperations \"AppData\\Local\\Temp\"\n\tPop $0 ; First path containing the substring\n\t${If} $0 != \"\"\n\t\t; Path found\n\t${Else}\n\t\t; Nothing found\n\t${EndIf}\n_______________________________________________________________________________\n\n[DisableProgressStepBack]\n[RestoreProgressStepBack]\nDon't allow the progress bar control to step back.\nThis is a common problem if your script has loops.\nIt only works when called from a Section (while the InstFiles page is active)\n\nSyntax:\n\tNSutils::DisableProgressStepBack ProgressBarHandle\n\tNSutils::RestoreProgressStepBack ProgressBarHandle\n\nReturn value:\n\tNone\n\nExample:\n\tNSutils::DisableProgressStepBack $mui.InstFilesPage.ProgressBar\n\t${For} $R0 1 10\n\t\tSleep 1000\n\t${Next}\n\tNSutils::RestoreProgressStepBack $mui.InstFilesPage.ProgressBar\n_______________________________________________________________________________\n\n[RedirectProgressBar]\nRedirect the relevant window messages of a progress bar to another progress bar.\nTo stop the redirection set ProgressBar2Handle to NULL.\n\nSyntax:\n\tNSutils::RedirectProgressBar ProgressBarHandle ProgressBar2Handle|NULL\n\nReturn value:\n\tNone\n\nExample:\n\tNSutils::RedirectProgressBar $mui.InstFilesPage.ProgressBar $mui.MyProgressBar\n\t${For} $R0 1 10\n\t\tSleep 1000\n\t${Next}\n\tNSutils::RedirectProgressBar $mui.InstFilesPage.ProgressBar 0\n_______________________________________________________________________________\n\n[StartTimer]\n[StopTimer]\nStart a timer. A callback is fired each time the clock ticks.\nThe callback is a regular NSIS function, no input, no output.\n\nWarning:\n\tThe timer can hit while another piece of the script is running\n\tYour Timer callback function should save the status and restore it before exiting\n\nSyntax:\n\tNSutils::StartTimer NsisCallbackFunction TimerPeriodMS\n\tNSutils::StopTimer NsisCallbackFunction\n\nReturn values:\n\tNone\n\nExample:\n\tFunction OnMyTimer\n\t\tSystem::Call 'user32::MessageBeep( i 0xffffffff )'\n\tFunctionEnd\n\t...\n\tGetFunctionAddress $0 OnMyTimer\n\tNSutils::StartTimer $0 1000\n\t...\n\t...\n\tGetFunctionAddress $0 OnMyTimer\n\tNSutils::StopTimer $0\n_______________________________________________________________________________\n\n[StartReceivingClicks]\n[StopReceivingClicks]\n\nSubclass a (parent) window in order to intercept BN_CLICKED commands.\nA NSIS callback function is fired whenever a child button is clicked.\nThe callback function is a regular NSIS function. It receives button's HWND and ID on the stack. No return value.\n\nSyntax:\n\tNSutils::StartReceivingClicks ParentHwnd NsisCallbackFunction\n\tNSutils::StopReceivingClicks ParentHwnd\n\nReturn values:\n\tNone\n\nExample:\n\tFunction OnButtonClicked\n\t\tPop $1\t; Button HWND\n\t\tPop $2\t; Button control ID\n\t\tMessageBox MB_OK \"Clicked button $2\"\n\tFunctionEnd\n\t...\n\tGetFunctionAddress $0 OnButtonClicked\n\tNSutils::StartReceivingClicks $HWNDPARENT $0\n\t...\n\tNSutils::StopReceivingClicks $HWNDPARENT\n_______________________________________________________________________________\n\n[LoadImageFile]\nLoad an image in memory (HBITMAP) using oleaut32!OleLoadPicturePath.\nThe source can be either a local file or a remote URL\nSupported formats: BMP, JPEG, GIF\n\nYou have to specify the HBITMAP dimensions. The original image will be fitted\nwithin these boundaries according to alignment flags.\nAlignH can be \"left\", \"right\" or \"center\"\nAlignV can be \"top\", \"bottom\" or \"center\"\n\n[!] When no longer needed you must destroy de HBITMAP by calling user32!DeleteObject\n\nSyntax:\n\tNSutils::LoadImageFile ImageFile|URL Width Height AlignH AlighV\n\nReturn values:\n\tAn HBITMAP on the stack\n\nExample:\n\tNSutils::LoadImageFile \"http://www.codeproject.com/App_Themes/CodeProject/Img/logo250x135.gif\" 640 480 center center\n\tPop $0\t; HBITMAP\n\t...\n\tSystem::Call 'user32::DeleteObject( p $0 )'\n\n_______________________________________________________________________________\n\n[RejectCloseMessages]\nReject closing window messages such as WM_CLOSE, WM_DESTROY, WM_COMMAND(IDCANCEL), WM_SYSCOMMAND(SC_CLOSE), etc\nSuch messages will be rejected when sent to your Installer\n\nSyntax:\n\tNSutils::RejectCloseMessages true|false\n\nReturn values:\n\tNone\n\nExample:\n\tNSutils::RejectCloseMessages true\n\t...\n\tNSutils::RejectCloseMessages false\n_______________________________________________________________________________\n\n[CloseFileHandles]\nClose all opened handles to the specified file or folder.\nBe mindful of the file system redirection on 64-bit platforms!\n\nSyntax:\n\tNSutils::CloseFileHandles \"File\"\n\nReturn values:\n\tThe number of closed handles\n\nExample:\n\t${DisableX64FSRedirection}\t; Optional. On 64-bit platforms, read from System32 rather than SysWOW64\n\tNSutils::CloseFileHandles \"$SYSDIR\\drivers\\etc\\hosts\"\n\t${EnableX64FSRedirection}\n\tPop $0\n\tMessageBox MB_OK \"$0 handles were closed\"\n_______________________________________________________________________________\n\n[RegMultiSzInsertBefore]\n[RegMultiSzInsertAfter]\n[RegMultiSzInsertAtIndex]\nInsert a substring to a REG_MULTI_SZ registry value\n\nSyntax:\n\tNSutils::RegMultiSzInsertBefore  \"RegKeyName\" \"RegValueName\" KeyFlags \"InsertStr\" \"InsertBeforeStr\"\n\tNSutils::RegMultiSzInsertAfter   \"RegKeyName\" \"RegValueName\" KeyFlags \"InsertStr\" \"InsertAfterStr\"\n\tNSutils::RegMultiSzInsertAtIndex \"RegKeyName\" \"RegValueName\" KeyFlags \"InsertStr\" Index\n\nReturn value:\n\t[Stack] Win32 error\n\nExamples:\n\tNSutils::RegMultiSzInsertBefore  \"HKCU\\Software\\MyCompany\" \"MyValue\" ${KEY_WOW64_64KEY} \"Line 4\" \"Line 5\"\n\tPop $0\t; Win32 error\n\tNSutils::RegMultiSzInsertAfter   \"HKCU\\Software\\MyCompany\" \"MyValue\" ${KEY_WOW64_64KEY} \"Line 4\" \"Line 3\"\n\tPop $0\t; Win32 error\n\tNSutils::RegMultiSzInsertAtIndex \"HKCU\\Software\\MyCompany\" \"MyValue\" ${KEY_WOW64_64KEY} \"Line 4\" 3\n\tPop $0\t; Win32 error\n_______________________________________________________________________________\n\n[RegMultiSzDelete]\nDelete a substring from a REG_MULTI_SZ registry value\n\nSyntax:\n\tNSutils::RegMultiSzDelete \"RegKeyName\" \"RegValueName\" KeyFlags \"DeleteStr\" RemoveValueIfEmpty\n\nReturn value:\n\t[Stack] Win32 error\n\nExample:\n\tNSutils::RegMultiSzDelete \"HKCU\\Software\\MyCompany\" \"MyValue\" ${KEY_WOW64_64KEY} \"Line 4\" ${TRUE}\n\tPop $0\t; Win32 error\n_______________________________________________________________________________\n\n[RegMultiSzRead]\nRead a substring from a REG_MULTI_SZ registry value\n\nSyntax:\n\tNSutils::RegMultiSzRead \"RegKeyName\" \"RegValueName\" KeyFlags Index\n\nReturn value:\n\t[Stack] Win32 error\n\t[Stack] The substring, or an empty string in case of errors\n\nExample:\n\tNSutils::RegMultiSzRead \"HKCU\\Software\\MyCompany\" \"MyValue\" ${KEY_WOW64_64KEY} 2\n\tPop $0\t; Win32 error\n\tPop $1\t; Substring at index 2\n_______________________________________________________________________________\n\n[RegBinaryInsertString]\nWrite a wide-character string to a REG_BINARY registry value, at a specific position\nThe NULL terminator is not written\n\nSyntax:\n\tNSutils::RegBinaryInsertString \"RegKeyName\" \"RegValueName\" KeyFlags Offset String\n\nReturn value:\n\t[Stack] Win32 error\n\nExample:\n\t; Write \"MyString\" to a REG_BINARY value, at (byte) offset 100\n\tNSutils::RegBinaryInsertString \"HKCU\\Software\\MyCompany\" \"MyValue\" ${KEY_WOW64_64KEY} 100 \"My string\"\n\tPop $0\t; Win32 error\n_______________________________________________________________________________\n\n[CPUID]\nRetrieve CPU capabilities\n\nSyntax:\n\tNSutils::CPUID FuncId\n\nReturn values:\n\t[Stack] EAX\n\t[Stack] EBX\n\t[Stack] ECX\n\t[Stack] EDX\n\nExample:\n\t; Check SSE2 availability (Function 1, EDX, bit 26)\n\tNSutils::CPUID 1\n\tPop $1\t; EAX\n\tPop $2\t; EBX\n\tPop $3\t; ECX\n\tPop $4\t; EDX\n\tIntOp $0 $4 & 0x4000000\n\t${If} $0 <> 0\n\t\tDetailPrint \"CPU supports SSE2\"\n\t${EndIf}\n_______________________________________________________________________________\n\n[CompareFiles]\nTest whether two files are identical (content comparison)\n\nSyntax:\n\tNSutils::CompareFiles File1 File2\n\nReturn value:\n\t[Stack] 0/1\n\nExample:\n\tNSutils::CompareFiles \"C:\\MyFile1.txt\" \"C:\\MyFile2.txt\"\n\tPop $0\n\t${If} $0 = ${TRUE}\n\t\tDetailPrint \"Files are identical\"\n\t${EndIf}\n_______________________________________________________________________________\n\n[RemoveSoftwareRestrictionPolicies]\nThis routine enumerates software restriction policies and removes the ones that\nmatch a substring.\n\nSyntax:\n\tNSutils::RemoveSoftwareRestrictionPolicies \"FileSubstring\" \"LogFile\"\n\nInput:\n\t[Param] FileSubstring. All policies having this substring in their path will be removed\n\t[Param] LogFile. Optional\n\nOutput:\n\t[Stack] Win32/HRESULT\n\t[Stack] Removed policy count\n\nExample:\n\tNSutils::RemoveSoftwareRestrictionPolicies \"MyApp\" \"$EXEDIR\\MyLog.txt\"\n\tPop $0  ; Error\n\tPop $1  ; Removed count\n\t${If} $0 = 0\n\t\t; Success\n\t${EndIf}\n_______________________________________________________________________________\n\n[DriveIsSSD]\nCheck if the specified drive is SSD by examining its TRIM capability\n\nSyntax:\n\tNSutils::DriveIsSSD \"FileOrDirectory\"\n\nInput:\n\t[Stack] File|Dir\n\nOutput:\n\t[Stack] TRUE/FALSE\n\nExample:\n\tNSutils::DriveIsSSD \"$INSTDIR\"\n\tPop $0\n\t${If} $0 <> ${FALSE}\n\t\t; Drive is SSD\n\t${EndIf}\n_______________________________________________________________________________\n"
  },
  {
    "path": "setup/nsis/tools/Docs/NSxfer/NSxfer.Readme.txt",
    "content": "\nNSxfer - NSIS WinINet Plugin\nhttps://github.com/negrutiu/nsis-nsxfer\nmarius.negrutiu@protonmail.com\n_________________________________________________________________________________________________\n\nFeatures:\n- Multi-threaded: download multiple files in parallel\n- Asynchronous: start a download now, check its status later\n- Aggressive: multiple attempts to connect, multiple attempts to reconnect, resume interrupted transfers, etc\n- NSIS aware: download files at any installation stage (from .onInit, from Sections, from custom pages, silent installers, etc)\n- Informative: plenty of useful information is available for each download (size, speed, HTTP status, HTTP headers, etc)\n- Supports all relevant HTTP methods (GET, POST, HEAD, etc)\n- Supports custom HTTP headers and data\n- Supports proxy servers (both authenticated and open)\n- Supports files larger than 4GB\n- Can download remote content to RAM instead of a file\n- Many more...\n\nExamples:\n\t# Quick transfer, single file\n\tNSxfer::Transfer /URL \"http://MyServer/MyFile\" /LOCAL \"$TEMP\\MyFile\" /MODE Page /ABORT \"Abort Title\" \"Are you sure?\" /END\n\tPop $0 ; Status text (\"OK\" for success)\n\tDetailPrint \"Status: $0\"\n\n\t# Parallel transfer, multiple files\n\t; Start the downloads\n\tNSxfer::Request /URL \"http://MyServer1/MyFile1\" /LOCAL \"$TEMP\\MyFile1\" /END\n\tPop $1 ; Request ID1\n\tNSxfer::Request /URL \"http://MyServer2/MyFile2\" /LOCAL \"$TEMP\\MyFile2\" /END\n\tPop $2 ; Request ID2\n\tNSxfer::Request /URL \"http://MyServer3/MyFile3\" /LOCAL \"$TEMP\\MyFile3\" /END\n\tPop $3 ; Request ID3\n\t\n\t; ...do other useful stuff...\n\t\n\t; Wait for all downloads to complete\n\tNSxfer::Wait /MODE Page /ABORT \"Abort\" \"Are you sure?\" /END\n\n\t; Query status (1)\n\tNSxfer::Query /ID $1 /ERRORCODE /END\n\tPop $0 ; Error code (HTTP status 200-299 for success)\n\tDetailPrint \"Status1: $0\"\n\t; Query status (2)\n\tNSxfer::Query /ID $2 /ERRORCODE /END\n\tPop $0 ; Error code (HTTP status 200-299 for success)\n\tDetailPrint \"Status2: $0\"\n\t; Query status (3)\n\tNSxfer::Query /ID $3 /ERRORCODE /END\n\tPop $0 ; Error code (HTTP status 200-299 for success)\n\tDetailPrint \"Status3: $0\"\n\n\t; ...you got the idea...\n_________________________________________________________________________________________________\n\nNSxfer::Transfer\t[/PRIORITY prio] [/DEPEND id]\n\t\t\t\t\t[/METHOD GET|POST]\n\t\t\t\t\t/URL url\n\t\t\t\t\t[/LOCAL file|MEMORY|NONE]\n\t\t\t\t\t[/HEADERS hdr]\n\t\t\t\t\t[/DATA data | /DATAFILE file]\n\t\t\t\t\t[/TIMEOUTCONNECT msec] [/TIMEOUTRECONNECT msec]\n\t\t\t\t\t[/OPTCONNECTRETRIES count] [/OPTCONNECTTIMEOUT msec] [/OPTRECEIVETIMEOUT msec] [/OPTSENDTIMEOUT msec]\n\t\t\t\t\t[/PROXY server] [/PROXYUSER user] [/PROXYPASS pass]\n\t\t\t\t\t[/REFERER url]\n\t\t\t\t\t[/INTERNETFLAGS flags] [/SECURITYFLAGS flags]\n\t\t\t\t\t[/MODE SILENT|POPUP|PAGE]\n\t\t\t\t\t[/TITLEHWND Wnd] [/STATUSHWND Wnd] [/PROGRESSHWND Wnd]\n\t\t\t\t\t[/TITLETEXT Text MultiText] [/STATUSTEXT Text Multitext]\n\t\t\t\t\t[/ABORT Title Message]\n\t\t\t\t\t/END\n\nRemarks:\n\tMake a (single) HTTP request, wait for it to complete and return the status code.\n\tThis routine is recommended if you only need to transfer one file at a time.\n\n\tTo transfer multiple files in parallel, you must use lower level functions (Request(1) + Request(2) + ... + Request(n) + [...] + Wait(*) + Query(*))\n\t\nParameters:\n\t[...]\t\t\t\t\t\t| Check out \"Request\" parameters!\n\t[...]\t\t\t\t\t\t| Check out \"Wait\" parameters!\n\t/END\t\t\t\t\t\t| Must conclude the parameter list, otherwise the NSIS stack will be emptied...\n\nReturn:\n\t[Stack] \"OK\" for successful transfers, or an error string (HTTP or Win32) otherwise\n_________________________________________________________________________________________________\n\nNSxfer::Request\t\t[/PRIORITY prio] [/DEPEND id]\n\t\t\t\t\t[/METHOD GET|POST]\n\t\t\t\t\t/URL url\n\t\t\t\t\t[/LOCAL file|MEMORY|NONE]\n\t\t\t\t\t[/HEADERS hdr]\n\t\t\t\t\t[/DATA data | /DATAFILE file]\n\t\t\t\t\t[/TIMEOUTCONNECT msec] [/TIMEOUTRECONNECT msec]\n\t\t\t\t\t[/OPTCONNECTRETRIES count] [/OPTCONNECTTIMEOUT msec] [/OPTRECEIVETIMEOUT msec] [/OPTSENDTIMEOUT msec]\n\t\t\t\t\t[/PROXY server] [/PROXYUSER user] [/PROXYPASS pass]\n\t\t\t\t\t[/REFERER url]\n\t\t\t\t\t[/INTERNETFLAGS flags] [/SECURITYFLAGS flags]\n\t\t\t\t\t/END\n\nRemarks:\n\tAdd a transfer request to the queue.\n\tThe transfer will start as soon as a worker thread becomes available.\n\tThis command will not display any GUI.\n\t\nParameters:\n\t/PRIORITY\t\t\t\t\t| Priority in queue. Lower value mean higher priority (default: 1000)\n\t/DEPEND id\t\t\t\t\t| Another request that this one depends on. The new request will wait in queue until the other is completed (default: 0, no dependency)\n\t/METHOD GET|POST|HEAD|...\t| HTTP Method (default: GET)\n\t/URL url\t\t\t\t\t| HTTP or HTTPS...\n\t/LOCAL file|MEMORY|NONE\t\t| Local destination. Can be either a local file, a memory buffer, or none (none: make the HTTP request, but don't transfer the content) (default: NONE)\n\t/HEADERS hdr\t\t\t\t| Additional HTTP headers, delimited by CRLF (\\r\\n)\n\t/DATA data\t\t\t\t\t| Additional data to be sent as part of the HTTP request\n\t/DATAFILE file\t\t\t\t| Additional data to be sent as part of the HTTP request (read from the specified file)\n\t/TIMEOUTCONNECT msec\t\t| Keep trying to connect for \"msec\" milliseconds (default: 0, no retries)\n\t/TIMEOUTRECONNECT msec\t\t| Keep trying to reconnect for \"msec\" milliseconds, if the connection drops while downloading (default: 0, no reconnecting)\n\t/OPTCONNECTRETRIES count\t| InternetSetOption( Session, INTERNET_OPTION_CONNECT_RETRIES ). Relevant only for remote hosts with multiple IPs!\n\t/OPTCONNECTTIMEOUT msec\t\t| InternetSetOption( Session, INTERNET_OPTION_CONNECT_TIMEOUT )\n\t/OPTRECEIVETIMEOUT msec\t\t| InternetSetOption( Request, INTERNET_OPTION_RECEIVE_TIMEOUT )\n\t/OPTSENDTIMEOUT msec\t\t| InternetSetOption( Request, INTERNET_OPTION_SEND_TIMEOUT )\n\t/PROXY server\t\t\t\t| CERN type proxies (ex: \"http=http://my_proxy:my_port\"). SOCKS proxies are supported if Internet Explorer is installed\n\t/PROXYUSER user\t\t\t\t| Optional username for authenticated proxies\n\t/PROXYPASS pass\t\t\t\t| Optional password for authenticated proxies\n\t/REFERER url\t\t\t\t| Optional referer URL, passed to InternetOpenRequest\n\t/INTERNETFLAGS flags\t\t| Combination of INTERNET_FLAG_XXX passed to InternetOpenRequest (default: 0x84082200, INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|INTERNET_FLAG_NO_COOKIES|INTERNET_FLAG_NO_UI|INTERNET_FLAG_RELOAD)\n\t/SECURITYFLAGS flags\t\t| Combination of SECURITY_FLAG_XXX passed to InternetSetOption(INTERNET_OPTION_SECURITY_FLAGS) (default: 0x2080, SECURITY_FLAG_IGNORE_REVOCATION|SECURITY_FLAG_IGNORE_CERT_DATE_INVALID)\n\t/END\t\t\t\t\t\t| Must conclude the parameter list, otherwise the NSIS stack will be emptied...\n\nReturn:\n\t[Stack] An unique request ID. You'll need it later, to query the status\n\nExamples:\n\n\t; Download to local file\n\tNSxfer::Request /URL \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\" /LOCAL \"$EXEDIR\\SysinternalsSuite.zip\" /TIMEOUTCONNECT 60000 /TIMEOUTRECONNECT 300000 /END\n\tPop $0\t; Request ID\n\n\t; Download to memory, highest priority\n\tNSxfer::Request /PRIORITY 1 /URL \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\" /LOCAL MEMORY /END\n\tPop $0\t; Request ID\n\n\t; Send the HTTP request but don't download the content\n\tNSxfer::Request /URL \"http://mydomain.com:800?param1=va1&param2=val2\" /LOCAL NONE /END\n\tPop $0\t; Request ID\n\n\t; POST a form\n\tNSxfer::Request /METHOD POST /URL \"http://httpbin.org/post\" /LOCAL \"Post.txt\" /HEADERS \"Content-Type: application/x-www-form-urlencoded\" /DATA \"user=MY+NAME&pass=MY+PASSWORD\" /END\n\tPop R0\t; Request ID\n_________________________________________________________________________________________________\n\nNSxfer::Wait\t\t[/ID id] [/PRIORITY prio]\t; Selection parameters\n\t\t\t\t\t[/MODE SILENT|POPUP|PAGE]\n\t\t\t\t\t[/TITLEHWND Wnd] [/STATUSHWND Wnd] [/PROGRESSHWND Wnd]\n\t\t\t\t\t[/TITLETEXT Text MultiText] [/STATUSTEXT Text Multitext]\n\t\t\t\t\t[/ABORT Title Message]\n\t\t\t\t\t/END\n\nRemarks:\n\tWait (by ID or PRIORITY) for one or multiple transfers to complete\n\n\tWaiting modes:\n\t- SILENT\t\t\t\t\t| No GUI is displayed, the call returns when transfer(s) complete(s)\n\t- POPUP\t\t\t\t\t\t| Progress is displayed on a popup window\n\t- PAGE\t\t\t\t\t\t| Progress is displayed on an installer page (InstFiles or custom). This mode is available only when the installer is visible.\n\n\tSILENT and POPUP modes are available at all times, including silent installers.\n\tPAGE mode requires that the installer is visible, and a page is currently active. In silent installers, PAGE mode is automatically converted to SILENT mode.\n\n\tAll displayed texts can be customized.\n\tThe plugin will choose between \"Text\" and \"MultiText\", based on whether waiting for one or multiple transfers\n\tAll texts may contain keywords that are automatically replaced at runtime.\n\n\tTransfer-specific keywords:\n\t{ID}\t\t\t\t\t\t| The request ID returned by NSxfer::Request\n\t{STATUS}\t\t\t\t\t| \"Waiting\", \"Downloading\" or \"Completed\" (English only)\n\t{WININETSTATUS}\t\t\t\t| The last status reported by the InternetCallback (http://msdn.microsoft.com/EN-US/library/windows/desktop/aa385121(v=vs.85).aspx)\n\t{METHOD}\t\t\t\t\t| The HTTP method in use (GET, POST, HEAD, etc.)\n\t{URL}\t\t\t\t\t\t| Full URI\n\t{IP}\t\t\t\t\t\t| Server's IP address, or an empty string\n\t{PROXY}\t\t\t\t\t\t| The proxy server, or an empty string\n\t{LOCAL}\t\t\t\t\t\t| The local destination (file path|Memory|None)\n\t{LOCALFILEDIR}\t\t\t\t| The file directory (no name), extracted from the local path\n\t{LOCALFILENAME}\t\t\t\t| The file name (no path), extracted from the local path\n\t{FILESIZE}\t\t\t\t\t| The remote content length, nicely formatted (ex: \"1,3 GB\")\n\t{FILESIZEBYTES}\t\t\t\t| The remote content length (can exceed 4GB (32-bit boundary))\n\t{RECVSIZE}\t\t\t\t\t| The amount of bytes received, nicely formatted (ex: \"1,3 GB\")\n\t{RECVSIZEBYTES}\t\t\t\t| The amount of bytes received\n\t{PERCENT}\t\t\t\t\t| Percent (0-100)\n\t{SPEED}\t\t\t\t\t\t| Transfer speed (nicely formatted, ex: \"1,4 MB/s\")\n\t{SPEEDBYTES}\t\t\t\t| Transfer speed (bytes/second)\n\t{TIMESTART}\t\t\t\t\t| The timestamp when the transfer has started (ex: 2014/10/18 08:24)\n\t{TIMEELAPSED}\t\t\t\t| Amount of time since the transfer has started (ex: 3 min, 2 sec)\n\t{TIMEREMAINING}\t\t\t\t| Estimated amount of time until the transfer will complete (ex: 10 min, 35 sec)\n\n\tGlobal keywords:\n\t{TOTALCOUNT}\t\t\t\t| The overall number of requests (waiting + downloading + completed)\n\t{TOTALWAITING}\t\t\t\t| The number of waiting requests\n\t{TOTALACTIVE}\t\t\t\t| The number of downloading + completed requests\n\t{TOTALDOWNLOADING}\t\t\t| The number of requests in progress\n\t{TOTALCOMPLETED}\t\t\t| The number of completed requests\n\t{TOTALRECVSIZE}\t\t\t\t| The amount of bytes received, nicely formatted (ex: \"1,3 GB\")\n\t{TOTALRECVSIZEBYTES}\t\t| The amount of bytes received\n\t{TOTALSPEED}\t\t\t\t| The combined speed of transfers in progress (nicely formatted, ex: \"1,4 MB/s\")\n\t{TOTALSPEEDBYTES}\t\t\t| The combined speed of transfers in progress (bytes/second)\n\t{TOTALTHREADS}\t\t\t\t| Worker thread count\n\t{ORIGINALTITLE}\t\t\t\t| The original title text \n\t{ORIGINALSTATUS}\t\t\t| The original status text\n\t{PLUGINNAME}\t\t\t\t| Plugin name (\"NSxfer\")\n\t{PLUGINVERSION}\t\t\t\t| Plugin version\n\t{ANIMLINE}\t\t\t\t\t| The classic \\|/- animation\n\t{ANIMDOTS}\t\t\t\t\t| The classic ./../... animation\n\nParameters:\n\t/ID id\t\t\t\t\t\t| Wait for a specific transfer. If not specified, we're waiting for all transfers\n\t/PRIORITY prio\t\t\t\t| Wait for transfers with specific priority. If not specified we're waiting for all transfers\n\t/MODE\t\t\t\t\t\t| Wait mode\n\t/TITLEHWND\t\t\t\t\t| Custom control to display the Title text\n\t/STATUSHWND\t\t\t\t\t| Custom control to display the Status text\n\t/PROGRESSHWND\t\t\t\t| Custom progress control\n\t/TITLETEXT Text MultiText\t| The Title text. \"Text\" is displayed when waiting for a single transfer, whereas \"MultiText\" is displayed when waiting for multiple transfers. Both texts may contain keywords\n\t/STATUSTEXT Text MultiText\t| The Status text. \"Text\" is displayed when waiting for a single transfer, whereas \"MultiText\" is displayed when waiting for multiple transfers. Both texts may contain keywords\n\t/ABORT Title Message\t\t| The transfer can be aborted. If Message is not empty, a confirmation box (Yes/No) will be diaplayed. If Message is empty, the transfer will abort quietly. By default abortion is disabled\n\t/END\t\t\t\t\t\t| Must conclude the parameter list, otherwise the NSIS stack will be emptied...\n\nReturn:\n\t[Stack] Result code. Ignore it!\n\nExamples:\n\t; Wait for requests with priority 2000 (Popup mode)\n\tNSxfer::Wait \\\n\t\t/PRIORITY 2000 /MODE POPUP \\\n\t\t/STATUSTEXT \\\n\t\t\t\"Received {RECVSIZE}/{FILESIZE} @ {SPEED}, ETA: {TIMEREMAINING}$\\n{URL}\" \\\n\t\t\t\"Downloading {TOTALACTIVE}/{TOTALCOUNT} files. Received {TOTALRECVSIZE} @ {TOTALSPEED}\" \\\n\t\t/TITLETEXT \\\n\t\t\t\"{PERCENT}% - Downloading...\" \\\n\t\t\t\"Downloading {TOTALCOUNT} files...\" \\\n\t\t/ABORT \"Abort\" \"Are your sure?\"\n\tPop $0\n_________________________________________________________________________________________________\n\nNSxfer::Enumerate\t[/STATUS waiting|downloading|completed]\n\t\t\t\t\t[/PRIORITY prio]\n\t\t\t\t\t/END\n\nRemarks:\n\tEnumerate transfer requests from the queue (by STATUS and/or PRIORITY).\n\tBe aware that completed requests remain in queue. They can be filtered out using /STATUS\n\nParameters:\n\t/STATUS\t\t\t\t\t\t| Enumerate requests with specific status (Waiting, Downloading, Completed). If not specified, all requests will be enumerated\n\t/PRIORITY prio\t\t\t\t| Enumerate requests with specific priority. If not specified, all requests will be enumerated\n\t/END\t\t\t\t\t\t| Must conclude the parameter list, otherwise the NSIS stack will be emptied...\n\nReturn:\n\t[Stack] Request count (N)\n\t[Stack] ID1\n\t[Stack] ID2\n\t[Stack] ...\n\t[Stack] IDn\n\nExample:\n\t; Enumerate all completed requests\n\tNSxfer::Enumerate /STATUS \"Completed\" /END\n\tPop $1 ; Count\n\t${For} $0 1 $1\n\t\tPop $2\n\t\tDetailPrint \"[$0] Request ID = $2\"\n\t${Next}\n_________________________________________________________________________________________________\n\nNSxfer::Query\t/ID id\n\t\t\t\t[/PRIORITY] [/DEPEND]\n\t\t\t\t[/STATUS] [/WININETSTATUS]\n\t\t\t\t[/METHOD] [/URL] [/IP] [/PROXY] [/LOCAL]\n\t\t\t\t[/SENTHEADERS] [/RECVHEADERS]\n\t\t\t\t[/FILESIZE] [/RECVSIZE] [/PERCENT] [/SPEEDBYTES] [/SPEED]\n\t\t\t\t[/CONTENT] [/DATA]\n\t\t\t\t[/TIMEWAITING] [/TIMEDOWNLOADING]\n\t\t\t\t[/CONNECTIONDROPS]\n\t\t\t\t[/ERRORCODE] [/ERRORTEXT]\n\t\t\t\t/END\n\nRemarks:\n\tQuery information about a specific transfer request.\n\nParameters:\n\t/ID id\t\t\t\t\t| The request ID returned by NSxfer::Request\n\t-----------             | ------------------\n\t/PRIORITY\t\t\t\t| Request priority\n\t/DEPEND\t\t\t\t\t| Dependency ID\n\t/STATUS\t\t\t\t\t| Request status (downloading|waiting|completed)\n\t/WININETSTATUS\t\t\t| The last status reported by the InternetCallback (http://msdn.microsoft.com/EN-US/library/windows/desktop/aa385121(v=vs.85).aspx)\n\t/METHOD\t\t\t\t\t| The HTTP method in use (GET, POST, HEAD, etc.)\n\t/URL\t\t\t\t\t| Full URL\n\t/IP\t\t\t\t\t\t| Server's IP address, or an empty string\n\t/PROXY\t\t\t\t\t| The proxy server, or an empty string\n\t/LOCAL\t\t\t\t\t| The local destination (file|MEMORY|NONE)\n\t/SENTHEADERS\t\t\t| The raw HTTP headers sent to the server\n\t/RECVHEADERS\t\t\t| The raw HTTP headers received from the server\n\t/FILESIZE\t\t\t\t| The remote content length (can exceed 4GB (32-bit boundary))\n\t/RECVSIZE\t\t\t\t| The amount of bytes received so far\n\t/PERCENT\t\t\t\t| Percent (0-100)\n\t/SPEED\t\t\t\t\t| Transfer speed (nicely formatted, ex: \"1,4 MB/s\")\n\t/SPEEDBYTES\t\t\t\t| Transfer speed (bytes/second)\n\t/CONTENT\t\t\t\t| Retrieves the remote content (max NSIS_MAX_STRLEN) downloaded to memory. Non-printable characters will be replaced with '.'\n\t/DATA\t\t\t\t\t| Retrieves the data sent to the server (max NSIS_MAX_STRLEN). Non-printable characters will be replaced with '.'\n\t/TIMEWAITING\t\t\t| Amount of time (milliseconds) spent waiting in queue\n\t/TIMEDOWNLOADING\t\t| Amount of time (milliseconds) spent transferring\n\t/CONNECTIONDROPS\t\t| Number of times the connection dropped out during the transfer\n\t/ERRORCODE\t\t\t\t| Win32 error code, or HTTP status code\n\t/ERRORTEXT\t\t\t\t| The error explained\n\t/END\t\t\t\t\t| Must conclude the parameter list, otherwise the NSIS stack will be emptied...\n\nReturn:\n\tA value for each parameter, in the same order\n\t[Stack] Value1\n\t[Stack] Value2\n\t[Stack] ...\n\t[Stack] ValueN\n\nExample:\n\tNSxfer::Query /ID $varID /STATUS /URL /PERCENT /SPEED /END\n\tPop $0\t;Status\n\tPop $1\t;URL\n\tPop $2\t;Percent\n\tPop $3\t;Speed\n\tDetailPrint \"Status:$0, URL:$1, Percent:$2, Speed:$3\"\n_________________________________________________________________________________________________\n\nNSxfer::Set\t\t\t[/ID id] [/PRIORITY prio]\t; Selection parameters\n\t\t\t\t\t[/SETPRIORITY prio]\n\t\t\t\t\t[/SETDEPEND id]\n\t\t\t\t\t[/ABORT]\n\t\t\t\t\t[/REMOVE]\n\t\t\t\t\t/END\n\nRemarks:\n\tModify one or multiple transfer requests (by ID or PRIORITY)\n\tWhen aborting a file transfer the received content is not removed (from disk). It's possible to resume the transfer later.\n\tThe caller is responsible for cleaning up unfinished/aborted downloads.\n\nParameters:\n\t/ID id\t\t\t\t\t| Modify specific request. If not specified, all requests will be modified\n\t/PRIORITY prio\t\t\t| Modify requests with specific priority. If not specified, all requests will be modified\n\t/SETPRIORITY prio\t\t| New priority\n\t/SETDEPEND id\t\t\t| New dependency\n\t/ABORT\t\t\t\t\t| Abort specified transfers\n\t/REMOVE\t\t\t\t\t| Remove specified transfers from queue\n\t/END\t\t\t\t\t| Must conclude the parameter list, otherwise the NSIS stack will be emptied...\n\nReturn:\n\t[Stack] Result code. Ignore it!\n\nExamples:\n\t; Abort all transfers\n\tNSxfer::Set /ABORT /END\n\n\t; Abort all transfer with priority 3000\n\tNSxfer::Set /PRIORITY 3000 /ABORT /END\n\n\t; Abort a specific transfer\n\tNSxfer::Set /ID 666 /ABORT /END\n\n\t; Modify priority 3000 to 5000\n\tNSxfer::Set /PRIORITY 3000 /SETPRIORITY 5000 /END\n\n\t; Modify one request's dependency\n\tNSxfer::Set /ID 666 /SETDEPEND 1 /END\n\n\t; Remove one request's dependency (by setting it to 0)\n\tNSxfer::Set /ID 666 /SETDEPEND 0 /END\n\n\t; Abort all and clear the queue\n\tNSxfer::Set /REMOVE /END\n_________________________________________________________________________________________________\n\nNSxfer::QueryGlobal [/TOTALCOUNT] [/TOTALWAITING] [/TOTALDOWNLOADING] [/TOTALCOMPLETED]\n\t\t\t\t\t[/TOTALSPEED] [/TOTALSPEEDBYTES]\n\t\t\t\t\t[/TOTALTHREADS]\n\t\t\t\t\t[/PLUGINNAME] [/PLUGINVERSION]\n\t\t\t\t\t[/USERAGENT]\n\t\t\t\t\t/END\n\nRemarks:\n\tQuery global information.\n\nParameters:\n\t/TOTALCOUNT\t\t\t\t| The overall number of requests (waiting + downloading + completed)\n\t/TOTALWAITING\t\t\t| The number of waiting requests\n\t/TOTALDOWNLOADING\t\t| The number of requests in progress\n\t/TOTALCOMPLETED\t\t\t| The number of completed requests\n\t/TOTALRECVSIZE\t\t\t| The amount of bytes received, nicely formatted (ex: \"1,3 GB\")\n\t/TOTALRECVSIZEBYTES\t\t| The amount of bytes received\n\t/TOTALSPEED\t\t\t\t| The combined speed of requests in progress (nicely formatted, ex: \"1,4 MB/s\")\n\t/TOTALSPEEDBYTES\t\t| The combined speed of requests in progress (bytes/second)\n\t/TOTALTHREADS\t\t\t| Worker thread count\n\t/PLUGINNAME\t\t\t\t| \"NSxfer\"\n\t/PLUGINVERSION\t\t\t| Version string such as \"1.2014.11.16\"\n\t/USERAGENT\t\t\t\t| User agent (ex: \"Mozilla/5.0 (Windows; WOW64) xfer/1.0\")\n\t/END\t\t\t\t\t| Must conclude the parameter list, otherwise the NSIS stack will be emptied...\n\nReturn:\n\tA value for each parameter, in the same order\n\t[Stack] Value1\n\t[Stack] Value2\n\t[Stack] ...\n\t[Stack] ValueN\n\nExample:\n\tNSxfer::QueryGlobal /TOTALCOUNT /TOTALCOMPLETED /TOTALDOWNLOADING /TOTALSPEED /TOTALTHREADS /END\n\tPop $R0 ; Total\n\tPop $R1 ; Completed\n\tPop $R2 ; Downloading\n\tPop $R3 ; Speed\n\tPop $R4 ; Worker threads\n\n\tDetailPrint \"Transferring $R1+$R2/$R0 files at $R3 using $R4 worker threads\"\n_________________________________________________________________________________________________\n\n"
  },
  {
    "path": "setup/nsis/tools/Docs/ShellLink/Readme.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\">\n<HTML><HEAD><TITLE>ShellLink</TITLE>\n<META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\">\n<STYLE type=text/css>\nBODY {\n\tPADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-WEIGHT: normal; FONT-SIZE: 10pt; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #f0f0f0\n}\nCENTER {\n\tTEXT-ALIGN: center\n}\nTABLE {\n\tMARGIN: auto; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left\n}\n.maintable {\n\tBORDER-RIGHT: #376eab 2px solid; BORDER-TOP: #376eab 2px solid; BORDER-LEFT: #376eab 2px solid; BORDER-BOTTOM: #376eab 2px solid\n}\n.margin {\n\tMARGIN: 20px\n}\n.text {\n\tMARGIN: 20px\n}\n.bold {\n\tFONT-WEIGHT: bold\n}\n.italic {\n\tFONT-STYLE: italic\n}\n.bigheader {\n\tFONT-SIZE: 24pt; MARGIN: 10px; COLOR: #333333; TEXT-ALIGN: center\n}\n.header {\n\tFONT-SIZE: 14pt; COLOR: #7a7272\n}\n.subheader {\n\tFONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\n}\n.footer {\n\tFONT-SIZE: 8pt; MARGIN: 5px; COLOR: #909090; TEXT-ALIGN: right\n}\nA:link {\n\tCOLOR: #294f75; TEXT-DECORATION: none\n}\nA:visited {\n\tCOLOR: #294f75; TEXT-DECORATION: none\n}\nA:active {\n\tCOLOR: #294f75; TEXT-DECORATION: none\n}\nA:hover {\n\tCOLOR: #182634; TEXT-DECORATION: none\n}\n</STYLE>\n\n<META content=\"MSHTML 6.00.2800.1264\" name=GENERATOR></HEAD>\n<BODY>\n<DIV class=center>\n<TABLE class=maintable cellSpacing=0 cellPadding=0 width=750>\n  <TBODY>\n  <TR>\n    <TD>\n      <TABLE cellSpacing=0 cellPadding=0>\n        <TBODY>\n        <TR>\n          <TD>\n            <P class=bigheader>ShellLink </P></TD></TR>\n        <TR>\n          <TD>\n<DIV style=\"MARGIN: 20px\">\n<P style=\"FONT-SIZE: 14pt; COLOR: #7a7272\">Introduction</P>\n<P style=\"MARGIN: 20px\">ShellLink is a NSIS plugin that allows you to read and write shell link (.lnk) files.</P>\n<P style=\"FONT-SIZE: 14pt; COLOR: #7a7272\">How to use</P>\n<P style=\"MARGIN: 20px\">Make sure you have a valid path (link.lnk) to the shell link file.</P>\n\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Working Directory</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutWorkingDirectory link.lnk\nPop $0\n\n$0=C:\\Program Files\\MyProgram\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Target</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutTarget link.lnk\nPop $0\n\n$0=C:\\Program Files\\MyProgram\\run.exe\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Arguments </P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutArgs link.lnk\nPop $0\n\n$0=/s /d=1\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Icon Location </P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutIconLocation link.lnk\nPop $0\n\n$0=C:\\Program Files\\MyProgram\\run.dll\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Icon Index </P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutIconIndex link.lnk\nPop $0\n\n$0=3\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Show Mode </P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutShowMode link.lnk\nPop $0\n\n$0=0    (SW_HIDE)\n$0=1    (SW_SHOWNORMAL or SW_NORMAL)\n$0=2    (SW_SHOWMINIMIZED)\n$0=3    (SW_SHOWMAXIMIZED or SW_MAXIMIZE)\n$0=4    (SW_SHOWNOACTIVATE)\n$0=5    (SW_SHOW)\n$0=6    (SW_MINIMIZE)\n$0=7    (SW_SHOWMINNOACTIVE)\n$0=8    (SW_SHOWNA)\n$0=9    (SW_RESTORE)\n$0=10   (SW_SHOWDEFAULT)\n$0=11   (SW_FORCEMINIMIZE or SW_MAX)\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Hot Keys</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutHotkey link.lnk\nPop $0\n\n$0=634\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Get Shortcut Description</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::GetShortCutDescription link.lnk\nPop $0\n\n$0=My Shortcut Description\n</PRE>\n\n<BR>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Working Directory</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutWorkingDirectory link.lnk directory\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Target</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutTarget link.lnk target.file\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Arguments</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutArgs link.lnk parameters\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Icon Location</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutIconLocation link.lnk icon.file\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Icon Index</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutIconIndex link.lnk icon_index_number\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Show Mode</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutShowMode link.lnk start_options\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Hot Keys</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutHotkey link.lnk keyboard_shortcut\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut Description</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetShortCutDescription link.lnk description\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">Set Shortcut to Run As Administrator</P>\n<PRE style=\"MARGIN: 20px\">ShellLink::SetRunAsAdministrator link.lnk\nPop $0\n\n$0=0   -no errors\n$0=-1  -error\n</PRE>\n\n<P style=\"FONT-SIZE: 14pt; COLOR: #7a7272\">Source code</P>\n<P style=\"FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN: 20px; COLOR: #303030\">NSIS plug-in (C++)</P>\n<P style=\"MARGIN: 20px\">A download link to the source and DLL of this NSIS plug-in \ncan be found below.</P>\n<P style=\"FONT-SIZE: 14pt; COLOR: #7a7272\">Version history</P>\n<UL>\n  <LI>1.2 by Afrow UK\n  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-added Unicode build\n  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-added SetRunAsAdministrator\n  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-cleaned up code</LI>\n  <LI>1.1 by Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-code has been rewritten\n  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-added functions to change shell link information\n  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-reduced dll size 44Kb -> 4Kb\n  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-documentation updated</LI>\n  <LI>1.0 first release of ShellLink.</LI>\n</UL>\n<P style=\"FONT-SIZE: 14pt; COLOR: #7a7272\">Credits</P>\n<P style=\"MARGIN: 20px\">Written and documented by Angelo Mandato </P>\n<P style=\"FONT-SIZE: 14pt; COLOR: #7a7272\">License</P>\n<PRE style=\"MARGIN: 20px\">&copy; 2004 Angelo Mandato\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; \n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.\n</PRE>\n<P style=\"FONT-SIZE: 14pt; COLOR: #7a7272\">Download</P>\n<P style=\"MARGIN: 20px\">Original link: <a href=\"http://www.spaceblue.com/downloads/shelllink.zip\">http://www.spaceblue.com/downloads/shelllink.zip</a><br>NSIS Wiki: <a href=\"http://nsis.sourceforge.net/ShellLink_plug-in\">http://nsis.sourceforge.net/ShellLink_plug-in</a></P>\n            </DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></BODY></HTML>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/SkinnedControls/Readme.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\n  <meta content=\"SuperPat\" name=\"author\" />\n  <meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\" />\n\n  <link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\n\n  <script type=\"text/javascript\" src=\"script.js\"></script>\n\n  <title>SkinnedControls Plug-in for NSIS</title>\n\n</head>\n\n<body>\n\n  <div class=\"maintable\">\n\n  <a target=\"_blank\" href=\"http://ultramodernui.sourceforge.net/\" title=\"Go to the SkinnedControls Plug-in for NSIS home page\"><img src=\"images/header_sc.png\" alt=\"SkinnedControls Plug-in for NSIS\" /></a>\n\n    <p class=\"options\" style=\"margin-top:3px;\"><a onclick=\"loadSlider();expandall();\">[Expand all]</a>&nbsp;&nbsp;<a onclick=\"collapseall();\">[Collapse all]</a></p>\n\n    <div>\n\n      <h1>Introduction</h1>\n\n      <div style=\"text-align: justify;\">\n        <p>This NSIS plug-in allows to skin all buttons and scroll bars of your installer and allows to select text colors on buttons even those on custom pages.</p>\n        <p>It was developed with an aim of integrate it in UltraModernUI, an new user interface with a style like the most recent installers for NSIS. (<a target=\"_blank\" href=\"http://ultramodernui.sourceforge.net\">http://ultramodernui.sourceforge.net</a>)</p>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_screenshots\" src=\"images/closed.gif\" onclick=\"loadSlider();toggle('trigger_screenshots', 'toggle_screenshots');\" /> Screenshots</h3>\n        <div class=\"toggle\" id=\"toggle_screenshots\">\n\n          <div id=\"sliderFrame\">\n            <div id=\"slider\">\n              <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/SkinnedControls1.png\" alt=\"SkinnedControls Plug-in used with Modern UI or Modern UIEx interface\" />\n              <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/SkinnedControls2.png\" alt=\"SkinnedControls Plug-in used with Classic UI interface\" />\n              <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI09.png\" alt=\"SkinnedControls Plug-in used with UltraModernUI interface\" />\n            </div>\n          </div>\n\n        </div>\n\n      </div>\n\n      <h1>Usage</h1>\n      <div>\n\n        <h3>SkinnedControls::skinit Function</h3>\n\n        <p>Skins the installer's buttons and scrollbars with selected bitmaps and sets colors for texts on buttons.</p>\n\n        <h4>Parameters:</h4>\n        <div>\n          <h5>/SetReturn</h5>\n              Force the method to return \"success\" on the stack or an error string if there was an error.<br />\n              This parameter must be set first.<br /><br />\n          <h5>/scrollbar=<span class=\"parameter\"><span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span></span></h5>\n              Scrollbar image (se below).<br /><br />\n          <h5>/button=<span class=\"parameter\"><span class=\"parameter\">$PLUGINSDIR\\button.bmp</span></span></h5>\n              Button image (se below).<br /><br />\n          <h5>/disabledtextcolor=<span class=\"parameter\"><span class=\"parameter\">808080</span></span></h5>\n              Color of text when button is disabled (Format is in hex: RRGGBB as CSS colors).<br /><br />\n          <h5>/selectedtextcolor=<span class=\"parameter\"><span class=\"parameter\">000080</span></span></h5>\n              Color of text when button is being clicked (Format is in hex: RRGGBB as CSS colors).<br /><br />\n          <h5>/textcolor=<span class=\"parameter\"><span class=\"parameter\">000000</span></span></h5>\n              Color for normal state of button (Format is in hex: RRGGBB as CSS colors).\n        </div>\n\n        <p>One of /scrollbar and /button parameter is required, other is optionnal.</p>\n\n        <p>If /SetReturn is set, the method returns \"success\" on the stack or an error string if there was an error.<br />\n        Else, error message boxes displayed automatically.</p>\n\n        <p>Parameter names are now ignore case.</p>\n\n        <h3>SkinnedControls::setskin Function</h3>\n\n        <p>Modifiy parameter. Use the same parameters as skinit</p>\n\n        <h3>SkinnedControls::unskinit Function</h3>\n\n        <p>Releases the plug-in resources (usually called in the (un).onGUIEnd function). This method is now optional thanks to the new NSIS plug-in API.</p>\n      </div>\n\n      <div>\n\n      <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_clui\" src=\"images/closed.gif\" onclick=\"toggle('trigger_clui', 'toggle_clui');\"/> Usage without Modern UI</h2>\n      <div class=\"toggle\" id=\"toggle_clui\">\n\n        <ul>\n          <li><p>First, in the .onInit function, extract the button bitmap:</p>\n<pre>Function .onInit\n  InitPluginsDir\n  ; Extract bitmaps for buttons and scrollbars\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd</pre></li>\n\n          <li><p>Second, in the .onGUIInit function, it is time to let the plug-in do the work:</p>\n<pre>Function .onGUIInit\n  <strong>SkinnedControls::skinit</strong> /NOUNLOAD \\\n                          /disabledtextcolor=<span class=\"parameter\">808080</span> \\\n                          /selectedtextcolor=<span class=\"parameter\">000080</span> \\\n                          /textcolor=<span class=\"parameter\">000000</span> \\\n                          \"/scrollbar=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n                          \"/button=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\"\nFunctionEnd</pre></li>\n\n          <li><p>It's the same thing for the uninstaller:</p>\n<pre>Function un.onInit\n  InitPluginsDir\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd\n\nFunction un.onGUIInit\n  <strong>SkinnedControls::skinit</strong> /NOUNLOAD \\\n                          /disabledtextcolor=<span class=\"parameter\">808080</span> \\\n                          /selectedtextcolor=<span class=\"parameter\">000080</span> \\\n                          /textcolor=<span class=\"parameter\">000000</span> \\\n                          \"/scrollbar=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n                          \"/button=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\"\nFunctionEnd</pre></li>\n\n          <li><p>That's all!</p></li>\n        </ul>\n\n      </div>\n\n      <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_mui\" src=\"images/closed.gif\" onclick=\"toggle('trigger_mui', 'toggle_mui');\"/> Usage with Modern UI</h2>\n      <div class=\"toggle\" id=\"toggle_mui\">\n\n        <ul>\n          <li><p>First, in the .onInit function, extract the button bitmap:</p>\n<pre>Function .onInit\n  InitPluginsDir\n  ; Extract bitmaps for buttons and scrollbars\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd</pre></li>\n\n          <li><p>Second, create a function, for example, named myGUIInit, it is time to let the plug-in do the work:</p>\n<pre>Function myGUIInit\n  <strong>SkinnedControls::skinit</strong> /NOUNLOAD \\\n                          /disabledtextcolor=<span class=\"parameter\">808080</span> \\\n                          /selectedtextcolor=<span class=\"parameter\">000080</span> \\\n                          /textcolor=<span class=\"parameter\">000000</span> \\\n                          \"/scrollbar=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n                          \"/button=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\"\nFunctionEnd</pre>\n   <p>And add this line before the insertion of macro page.</p>\n<pre>!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit</pre></li>\n\n          <li><p>It's the same thing for the uninstaller:</p>\n<pre>Function un.onInit\n  InitPluginsDir\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n       \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd\n\nFunction un.myGUIInit\n  <strong>SkinnedControls::skinit</strong> /NOUNLOAD \\\n                          /disabledtextcolor=<span class=\"parameter\">808080</span> \\\n                          /selectedtextcolor=<span class=\"parameter\">000080</span> \\\n                          /textcolor=<span class=\"parameter\">000000</span> \\\n                          \"/scrollbar=<span class=\"parameter\">$PLUGINSDIR\\scrollbar.bmp</span>\" \\\n                          \"/button=<span class=\"parameter\">$PLUGINSDIR\\button.bmp</span>\"\nFunctionEnd</pre>\n   <p>And add this line before the insertion of macro page.</p>\n<pre>!define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGUIInit</pre></li>\n\n          <li><p>That's all!</p></li>\n        </ul>\n      </div>\n\n      <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui', 'toggle_umui');\"/> Usage with UltraModernUI and ModernUIEx</h2>\n      <div class=\"toggle\" id=\"toggle_umui\">\n\n        <p>UltraModernUI and ModernUIEx natively integrate the SkinnedControls plug-in.</p>\n        <ul>\n          <li><p>With MUIEx, all you need to do is to define some stuffs before the inclusion of macro pages.<br />\n             With UMUI which enable this plug-in through its skins system, you can define the same stuffs before the UMUI_SKIN define to override default skin values:</p>\n<pre>!define UMUI_BUTTONIMAGE_BMP \\\n       \"<span class=\"parameter\">${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp</span>\"\n!define UMUI_SCROLLBARIMAGE_BMP \\\n       \"<span class=\"parameter\">${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp</span>\"\n\n!define UMUI_DISABLED_BUTTON_TEXT_COLOR <span class=\"parameter\">808080</span>\n!define UMUI_SELECTED_BUTTON_TEXT_COLOR <span class=\"parameter\">000080</span>\n!define UMUI_BUTTON_TEXT_COLOR <span class=\"parameter\">000000</span></pre></li>\n\n          <li><p>That's all!</p></li>\n        </ul>\n      </div>\n      </div>\n\n      <h1>BITMAPS</h1>\n\n      <ul>\n\n        <li>\n        <a target=\"_blank\" download href=\"../../Contrib/SkinnedControls/skins/defaultbtn.bmp\" style=\"float:right; margin-left:20px;\"><img src=\"../../Contrib/SkinnedControls/skins/defaultbtn.bmp\" alt=\"\" /></a>\n        <p>To skin the buttons, the plug-in need a bitmap image:<br />\n        The image width must be, at least, 10 pixels.<br />\n        The image height must be a multiple of three with, at least, 30 pixels.<br />\n        The typical image size is 72*72 pixels for smoother gradients.<br />\n        The first height third is for normal buttons,<br />\n        the next third is for activated buttons and the last third is for disabled buttons.</p>\n        </li>\n\n        <li>\n        <a target=\"_blank\" download href=\"../../Contrib/SkinnedControls/skins/defaultsb.bmp\" style=\"float:right; margin-left:20px;\"><img src=\"../../Contrib/SkinnedControls/skins/defaultsb.bmp\" alt=\"\" /></a>\n        <p>To skin the scrollbars, the plug-in need an other bitmap image:<br />\n        The image image size is 134*34 pixels.<br />\n        It is composed of several little images in one file for normal an clicked arrows and bars.<br />\n        On the very right, three pixels appear for normal color, inverted color and deadarea color.</p>\n        </li>\n      </ul>\n\n      <h1>Problems and workarounds</h1>\n\n      <ul>\n\n        <li><p>During the installation, the \"Show Detail\" button is unskinned:</p>\n          <p>You can insert this instruction on your script to workaround this bug, for classic UI:</p>\n          <pre>ChangeUI IDD_INSTFILES \"${NSISDIR}\\Contrib\\UIs\\default_sb.exe\"</pre>\n          <p>for ModernUI:</p>\n          <pre>ChangeUI IDD_INSTFILES \"${NSISDIR}\\Contrib\\UIs\\modern_sb.exe\"</pre>\n        </li>\n        \n        <li><p>When using the previous workaround the \"Show Detail\" button is invisible:</p>\n          <p>Modern UI set the XPStyle instruction to On automatically. XPStyle must be set to Off with the previous workaround otherwise the \"Show Detail\" button will disappear:</p>\n          <pre>XPStyle Off</pre>\n        </li>\n        \n        <li><p>When you use MessageBox function on some page (or some other pop-up windows like Banner plug-in), the some page buttons and scrollbars got unskinned:</p>\n          <p>You can use this tricky workaround to fix this:</p>\n          <pre>MessageBox MB_OK \"This message causes SkinnedControls bug...\" \n; After clicking OK the buttons lost their skin\nSendMessage $HWNDPARENT ${WM_MENUDRAG} 0 0 ; Do this to force reskin\n;If you use UMUI or MUIEx interfaces, you can simply insert macro:\n!insertmacro UMUI_FIX_BUTTONS_SKIN\n</pre>\n          <p>We used WM_MENUDRAG message (which is normally unused) to notify window to put another refresh message into queue -> to force redrawing. See the source code how it works.</p>\n        </li>\n\n        <li><p>The plug-in does not work on Windows 95:</p>\n          <p>Plug-ins compiled with Visual Studio 2008 is not executed... Microsoft says:<br />\n          \"Beginning with Visual C++ 2008, Visual C++ does not support targeting Windows 95, Windows 98, Windows ME, or Windows NT [4].\"</p>\n        </li>\n\n        <li><p>Scrollbars are not skinned on Windows 9x/Me:</p>\n          <p>The Cool Scrollbar Library, that the plug-in use, work only on Windows NT kernel.</p>\n        </li>\n\n      </ul>\n\n      <h1>Example Scripts</h1>\n\n      <div>\n        <p>These examples are in the NSISDir\\Examples\\SkinnedControls folder:</p>\n        <ul>\n          <li>Classic UI example: <a target=\"_blank\" href=\"../../Examples/SkinnedControls/Example.nsi\">Example.nsi</a></li>\n          <li>Modern UI example: <a target=\"_blank\" href=\"../../Examples/SkinnedControls/Example_MUI.nsi\">Example_MUI.nsi</a></li>\n          <li>ModernUIEx example: <a target=\"_blank\" href=\"../../Examples/SkinnedControls/Example_MUIEx.nsi\">Example_MUIEx.nsi</a></li>\n          <li>SkinnedControls installer: <a target=\"_blank\" href=\"../../Examples/SkinnedControls/SkinnedControls.nsi\">SkinnedControls.nsi</a></li>\n        </ul>\n      </div>\n\n      <h1>TODO</h1>\n\n      <div>\n        <p>Help wanted for improve this plug-in:</p>\n        <ul>\n          <li>Find better ways to fix buttons which unskin to avoid crappy workaround.</li>\n          <li>Support transparency for buttons.</li>\n          <li>Ability to skin checkboxes and radio buttons (transparency background required).</li>\n          <li>Ability to skin dropdown scroll bars and arrow down button.</li>\n          <li>Ability to skin MessageBox buttons and text and background colors.</li>\n        </ul>\n      </div>\n\n      <h1>Version History</h1>\n      <ul>\n\n        <li><strong>Version 1.4</strong> - December 25, 2016\n          <ul>\n            <li>Migrate to the new NSIS plug-in API;</li>\n            <li>The unskinit function in now optional thanks to the new NSIS plug-in API;</li>\n            <li>Parameter names are now ignore case.</li>\n          </ul>\n        </li>\n\n        <li><strong>Version 1.3</strong> - August 27, 2016\n          <ul>\n            <li>Button image size are no more limited to allow smoother gradients (see above);</li>\n            <li>\"success\" or error messages is no longer pushed in the stack by skinit and setskin methods unless the new /SetReturn parameter is set;</li>\n            <li>Fix License text and other RichText scrollbars was not skinned in Unicode Build;</li>\n            <li>Code cleanup;</li>\n            <li>Rewritten documentation.</li>\n          </ul>\n        </li>\n\n        <li><strong>Version 1.2</strong> (by Slappy) - 2011\n          <ul>\n            <li>Fixed unskinning buttons after MessageBox is shown (see above);\n            <li>Project was converted to Visual Studio 2008 format.\n          </ul>\n        </li>\n\n        <li><strong>Version 1.1</strong> (by Tallmaris) - 2010\n          <ul>\n            <li>Littles bug fixes &amp; Unicode build.</li>\n          </ul>\n        </li>\n\n        <li><strong>Version 1.0</strong> - 2009\n          <ul>\n            <li>First public release.</li>\n            <li>Replace the former SkinnedButton plug-in.</li>\n          </ul>\n        </li>\n\n      </ul>\n\n\n      <h1>Credits</h1>\n      <div>\n\n        <p>Made by SuperPat<br />\n        Based on <a target=\"_blank\" href=\"http://nsis.sourceforge.net/Wansis_plug-in\">wansis</a>, a Plug-in written by Saivert that skins NSIS like Winamp<br />\n          and use the wa_dlg.h courtesy of Nullsoft, Inc.<br />\n          as well as the Cool Scrollbar Library Copyright (c) J Brown 2001.</p>\n\n      </div>\n\n\n\n      <h1>Help</h1>\n      <div>\n\n        <p>Please post questions at the <a target=\"_blank\" href=\"http://forums.winamp.com/forumdisplay.php?forumid=65\">Official NSIS Forum</a>.</p>\n\n      </div>\n\n\n\n      <h1>License</h1>\n      <div>\n\n        <p>The zlib/libpng license applies to the SkinnedControls plug-in.</p>\n\n\n        <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_lic\" src=\"images/closed.gif\" onclick=\"toggle('trigger_lic', 'toggle_lic');\"/> License Terms</h2>\n        <div class=\"toggle\" id=\"toggle_lic\">\n\n  <pre>Copyright &copy; 2005-2019 SuperPat</pre>\n\n  <pre>Based on <a target=\"_blank\" href=\"http://nsis.sourceforge.net/Wansis_plug-in\">wansis</a>, a Plug-in written by Saivert that skins NSIS like Winamp\nand use the wa_dlg.h courtesy of Nullsoft, Inc.\nas well as the Cool Scrollbar Library Copyright &copy; J Brown 2001.</pre>\n\n  <pre>This software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.</pre>\n\n  <pre>Permission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:</pre>\n\n  <pre>1. The origin of this software must not be misrepresented;\n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.</pre>\n\n        </div>\n\n      </div>\n\n    </div>\n\n    <div class=\"footer\">&copy; 2005-2019 SuperPat</div>\n\n  </div>\n\n</body>\n\n</html>"
  },
  {
    "path": "setup/nsis/tools/Docs/SkinnedControls/license.txt",
    "content": "Copyright  2005-2019 SuperPat\n\nBased on wansis, a Plug-in written by Saivert that skins NSIS like Winamp\nand use the wa_dlg.h courtesy of Nullsoft, Inc.\nas well as the Cool Scrollbar Library Copyright  J Brown 2001.\n\nSkinned Controls plugin is based on the wansis plugin of Saivert (http://nsis.sourceforge.net/Wansis_plug-in) and it use the wa_dlg.h courtesy of Nullsoft, Inc.\n\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution."
  },
  {
    "path": "setup/nsis/tools/Docs/SkinnedControls/script.js",
    "content": "var image_open = \"images/open.gif\";\nvar image_closed = \"images/closed.gif\";\n\nfunction toggle(image, section) {\n  if (document.getElementById(section).style.display == \"block\") {\n    document.getElementById(section).style.display = \"none\";\n    document.getElementById(image).src = image_closed;\n    document.getElementById(image).alt = \"[+]\";\n  } else {\n    document.getElementById(section).style.display = \"block\";\n    document.getElementById(image).src = image_open;\n    document.getElementById(image).alt = \"[-]\";\n  }\n}\n\nfunction expandall() {\n  var divNodeList = document.getElementsByTagName('div');\n  for (i = 0; i < divNodeList.length; i++) {\n    if (divNodeList[i].id) {\n      var trigger = document.getElementById('trigger_' + divNodeList[i].id.substr(7));\n      if (trigger) {\n        divNodeList[i].style.display = \"block\";\n        trigger.src = image_open;\n        triggeralt = \"[-]\";\n      }\n    }\n  }\n}\n\nfunction collapseall() {\n  var divNodeList = document.getElementsByTagName('div');\n  for (i = 0; i < divNodeList.length; i++) {\n    if (divNodeList[i].id) {\n      var trigger = document.getElementById('trigger_' + divNodeList[i].id.substr(7));\n      if (trigger) {\n        divNodeList[i].style.display = \"none\";\n        trigger.src = image_open;\n        triggeralt = \"[+]\";\n      }\n    }\n  }\n}\n\nfunction loadSlider() {\n  var slider = document.getElementById('slider');\n  var imgList = slider.getElementsByTagName('img');\n  for (var i = 0; i < imgList.length; i++) {\n    if (imgList[i].getAttribute('data-src')){\n      imgList[i].src = imgList[i].getAttribute('data-src');\n      imgList[i].removeAttribute('data-src');\n    }\n  }\n  if (imageSlider)\n    imageSlider.reload();\n}\n\nvar sliderOptions = {\n  sliderId: \"slider\",\n  startSlide: 0,\n  effect: \"series1\",\n  effectRandom: false,\n  pauseTime: 3000,\n  transitionTime: 500,\n  slices: 12,\n  boxes: 8,\n  hoverPause: 1,\n  autoAdvance: true,\n  thumbnailsWrapperId: \"thumbs\",\n  m: false,\n  license: \"zlib/libpng\"\n};\n\nvar imageSlider = new mcImgSlider(sliderOptions);\n\n/* Menucool Javascript Image Slider v2016.4.2. Copyright www.menucool.com */\nfunction mcImgSlider(i) { for (var I = function (a) { return document.getElementById(a) }, d = \"length\", Q = \"getElementsByTagName\", t = function (e) { var a = e.childNodes, c = []; if (a) for (var b = 0, f = a[d]; b < f; b++)a[b].nodeType == 1 && c.push(a[b]); return c }, g = \"className\", h = \"getAttribute\", y = \"opacity\", U = function (a, b) { return a[Q](b) }, mb = function (a) { for (var c, e, b = a[d]; b; c = parseInt(Math.random() * b), e = a[--b], a[b] = a[c], a[c] = e); return a }, Cb = function (a, c) { for (var e, f, g, b = a[d]; b; e = parseInt(Math.random() * b), f = a[--b], a[b] = a[e], a[e] = f, g = c[b], c[b] = c[e], c[e] = g); return [a, c] }, Bb = function (a, c, b) { if (a.addEventListener) a.addEventListener(c, b, false); else a.attachEvent && a.attachEvent(\"on\" + c, b) }, P = document, J = window.requestAnimationFrame, V = window.cancelAnimationFrame, nb = [\"ms\", \"webkit\"], v = \"\", db = 0; db < nb[d] && !J; ++db) { v = nb[db]; J = window[v + \"RequestAnimationFrame\"]; V = window[v + \"CancelAnimationFrame\"]; v = \"-\" + v + \"-\" } var yb = function () { var b = U(P, \"head\"); if (b[d]) { var a = P.createElement(\"style\"); b[0].appendChild(a); return a.sheet ? a.sheet : a.styleSheet } else return 0 }, sb = function () { var a = yb(); if (a) if (typeof a.insertRule != \"undefined\") { var b = \"@\" + v + \"keyframes jisSpinner {from{\" + v + \"transform:rotate(0deg);} to{\" + v + \"transform:rotate(360deg);}}\"; a.insertRule(b, 0); var c = \"#\" + i.sliderId + \" .bgLayer {position:absolute;width:100%;height:100%;}\"; a.insertRule(c, 0); var d = \"#\" + i.sliderId + \"::before {\" + v + \"animation:jisSpinner 0.6s linear infinite;transform:translate3d(0,0,0);content:'';position:absolute;left:50%;top:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;border-width:4px;border-color:black rgba(0, 0, 0, 0.8) rgba(255, 255, 255, 0.8) rgba(255, 255, 255, 0.8);border-style:solid;border-radius:50%;}\"; a.insertRule(d, 0) } else a.addRule(\"#\" + i.sliderId + \" .bgLayer\", \"position:absolute;width:100%;height:100%;\") }; sb(); var c = \"style\", H = \"display\", Eb = \"visibility\", r = \"width\", q = \"height\", O = \"top\", B = \"background\", p = \"undefined\", Fb = \"marginLeft\", F = \"appendChild\", l = \"parentNode\", k = \"nodeName\", S = \"innerHTML\", bb = \"offsetWidth\", u = setTimeout, z = clearTimeout, w = \"indexOf\", N = \"setAttribute\", ab = \"removeChild\", L = function () { this.d = []; this.b = null }, zb = function () { var b = 50, a = navigator.userAgent, c; if ((c = a[w](\"MSIE \")) != -1) b = parseInt(a.substring(c + 5, a[w](\".\", c))); if (a[w](\"Safari\") != -1 && a[w](\"Chrome\") == -1) b = 300; if (a[w](\"Opera\") != -1) b = 400; return b }, T = zb() < 9, Z = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), K = function (a, b) { if (a) { a.o = b; if (T) a[c].filter = \"alpha(opacity=\" + b * 100 + \")\"; else a[c][y] = b } }; L.a = { f: function (a) { return -Math.cos(a * Math.PI) / 2 + .5 }, h: function (b, a) { return Math.pow(b, a * 2) }, j: function (b, a) { return 1 - Math.pow(1 - b, a * 2) } }; L.prototype = { k: { c: i.transitionTime, a: function () { }, b: L.a.f, d: 1 }, m: function (h, d, g, c) { for (var b = [], i = g - d, j = g > d ? 1 : -1, f = Math.ceil(60 * c.c / 1e3), a, e = 1; e <= f; e++) { a = d + c.b(e / f, c.d) * i; if (h != y) a = Math.round(a); b.push(a) } b.e = 0; return b }, n: function () { this.b == null && this.p() }, p: function () { this.q(); var a = this; this.b = J ? J(function () { a.p() }) : window.setInterval(function () { a.q() }, 15) }, q: function () { var a = this.d[d]; if (a) { for (var c = 0; c < a; c++)this.o(this.d[c]); while (a--) { var b = this.d[a]; if (b.d.e == b.d[d]) { b.c(); this.d.splice(a, 1) } } } else { if (J && V) V(this.b); else window.clearInterval(this.b); this.b = null } }, o: function (a) { if (a.d.e < a.d[d]) { var e = a.b, b = a.d[a.d.e]; if (a.b == y) { if (T) { e = \"filter\"; b = \"alpha(opacity=\" + Math.round(b * 100) + \")\" } } else b += \"px\"; a.a[c][e] = b; a.d.e++ } }, r: function (e, b, d, f, a) { a = this.s(this.k, a); var c = this.m(b, d, f, a); this.d.push({ a: e, b: b, d: c, c: a.a }); this.n() }, s: function (c, b) { b = b || {}; var a, d = {}; for (a in c) d[a] = typeof b[a] !== p ? b[a] : c[a]; return d } }; var G = new L, fb = function () { G.d = []; z(m); z(R); m = R = null }, xb = function (b) { var a = [], c = b[d]; while (c--) a.push(String.fromCharCode(b[c])); return a.join(\"\") }, b = { a: 0, e: \"\", d: 0, c: 0, b: 0 }, a, f, o, s, D, A, m, R, x, M, W, e, E, j = null, vb = function () { this[N](\"data-loaded\", \"t\") }, hb = function (b) { if (b == \"series1\") a.a = [6, 8, 15, 2, 5, 14, 13, 3, 7, 4, 14, 1, 13, 15]; else if (b == \"series2\") a.a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]; else a.a = b.split(/\\W+/); a.a.p = i.effectRandom ? -1 : a.a[d] == 1 ? 0 : 1 }, X = function () { a = { b: i.pauseTime, c: i.transitionTime, f: i.slices, g: i.boxes, d: i.license, h: i.hoverPause, i: i.autoAdvance, l: i.thumbnailsWrapperId, Ob: function () { typeof beforeSlideChange !== p && beforeSlideChange(arguments) }, Oa: function () { typeof afterSlideChange !== p && afterSlideChange(arguments) } }; if (f) a.m = Math.ceil(f.offsetHeight * a.g / f[bb]); hb(i.effect); a.n = function () { var b; if (a.a.p == -1) b = a.a[Math.floor(Math.random() * a.a[d])]; else { b = a.a[a.a.p]; a.a.p++; if (a.a.p >= a.a[d]) a.a.p = 0 } if (b < 1 || b > 17) b = 15; return b } }, qb = [\"$1$2$3\", \"$1$2$3\", \"$1$24\", \"$1$23\", \"$1$22\"], jb = function () { if (b.b != 2) { b.b = 1; z(m); m = null } }, gb = function () { if (b.b != 2) { b.b = 0; if (m == null && !b.c && a.i) m = u(function () { j.y(j.n(b.a + 1), 0, 1) }, a.b / 2) } }, rb = function () { var a = 0, b = 0, c; while (a < e.length) { c = e[a][g] == \"lazyImage\" || e[a][h](\"data-src\") || e[a][g][w](\" video\") > -1 && typeof McVideo != p; if (c) { b = 1; break } ++a } return b }, n = [], ib = function (b) { var a = n[d]; if (a) while (a--) n[a][g] = a != b && n[a].on == 0 ? \"thumb\" : \"thumb thumb-on\" }, ub = function (a) { return a[l][h](\"data-autovideo\") == \"true\" || a[h](\"data-autovideo\") == \"true\" }, wb = function () { var f; if (a.l) f = I(a.l); if (f) for (var h = U(f, \"*\"), e = 0; e < h[d]; e++)h[e][g] == \"thumb\" && n.push(h[e]); var c = n[d]; if (c) { while (c--) { n[c].on = 0; n[c].i = c; n[c].onclick = function () { j.y(this.i, ub(this)) }; if (!Z) { n[c].onmouseover = function () { this.on = 1; this[g] = \"thumb thumb-on\"; a.h == 2 && jb() }; n[c].onmouseout = function () { this.on = 0; this[g] = this.i == b.a ? \"thumb thumb-on\" : \"thumb\"; a.h == 2 && gb() } } } ib(0) } return c }, cb = function (a, e, g, c, b, d, f) { u(function () { if (e && g == e - 1) { var f = {}; f.a = function () { j.o() }; for (var h in a) f[h] = a[h] } else f = a; typeof b[r] !== p && G.r(c, \"width\", b[r], d[r], a); typeof b[q] !== p && G.r(c, \"height\", b[q], d[q], a); G.r(c, y, b[y], d[y], f) }, f) }, kb = function (a) { f = a; this.Id = f.id; this.c() }, ob = function (e, c) { for (var b = [], a = 0; a < e[d]; a++)b[b[d]] = String.fromCharCode(e.charCodeAt(a) - (c ? c : 3)); return b.join(\"\") }, pb = [/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/, /.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/, /^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/, /.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/, /^(\\w)[^.]*(\\w)$/], C = function (b) { var a = P.createElement(\"div\"); a[g] = b; return a }, tb = function (b, c) { var p = /\\/?(SOURCE|EMBED|OBJECT|\\/VIDEO|\\/AUDIO)/, g = t(f), a = g[d], i; while (a--) { i = g[a]; (i[k] == \"BR\" || T && p.test(i[k])) && f[ab](i) } g = f.children; var e = g[d]; if (b == \"shuffle\") { var h = []; for (a = 0, pos = e; a < pos; a++)h[h.length] = g[a]; if (c && c[d] == e) { var o = c[0].parentNode, j = []; for (a = 0, pos = e; a < pos; a++)j[j.length] = c[a]; var l = Cb(h, j), m = l[0], n = l[1] } else m = mb(h); for (a = 0, pos = e; a < pos; a++) { f.appendChild(m[a]); n && o.appendChild(n[a]) } b = 0 } else if (b == \"random\") b = Math.floor(Math.random() * e); if (b) { b = b % e; a = 0; while (1) if (a++ == b) break; else { f.appendChild(f.children[0]); c && c[0].parentNode.appendChild(c[0]) } } return f.children }; kb.prototype = { c: function () { if (x) return; o = f[bb]; s = f.offsetHeight; var r = t(f), G = r[d]; if (a.l) { var p = I(a.l); p = p ? p.children : 0 } r = tb(i.startSlide, p); this.M(a.d); var j, n; e = []; while (G--) { j = r[G]; n = 0; j[c][H] = \"none\"; if (j[k] == \"VIDEO\" || j[k] == \"AUDIO\") { j[c].position = \"absolute\"; n = C(\"video\"); j[l].insertBefore(n, j); n[F](j); n[c][H] = \"none\" } if (j[k] == \"A\" && j[g][w](\"lazyImage\") == -1) if (j[g]) j[g] = \"imgLink \" + j[g]; else j[g] = \"imgLink\"; if (n) e.push(n); else e.push(j); if (j[g][w](\" video\") != -1) { this.A(j); this.b(j) } } e.reverse(); b.d = e[d]; a.m = Math.ceil(s * a.g / o); E = C(\"sliderInner\"); f[F](E); A = C(\"mc-caption\"); f[F](A); A[c].transition = \"opacity \" + a.c + \"ms\"; var v = this.v(); if (e[b.a][k] == \"IMG\") b.e = e[b.a]; else b.e = U(e[b.a], \"img\")[0]; if (e[b.a][k] == \"A\" || e[b.a][g] == \"video\") e[b.a][c][H] = \"block\"; M[c][B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat'; if (typeof getComputedStyle != \"undefined\") { var y = getComputedStyle(f, null).borderRadius; if (y) M[c].borderRadius = y } D = this.k(); this.m(); var q = b.e[l], z; if (z = q.aP) { this.d(q); if (z === 1) q.aP = 0 } else if (a.i && b.d > 1) { u(function () { v.e(1) }, 0); m = u(function () { v.y(v.n(1), 0, 1) }, a.b + a.c) } if (a.h != 0 && !Z) { f.onmouseover = jb; f.onmouseout = gb } }, b: function (a) { if (typeof McVideo != p) { a.onclick = function () { return this.aP ? false : j.d(this) }; McVideo.register(a, this) } }, A: function (a) { if (typeof a.aP === p) { var b = a[h](\"data-autovideo\"); if (b == \"true\") a.aP = true; else if (b == \"1\") a.aP = 1; else a.aP = 0 } }, d: function (c) { z(m); m = null; var a = McVideo.play(c, o, s, this.Id); if (a || Z) b.b = 2; return false }, f: function () { x = C(\"navBulletsWrapper\"); for (var e = [], a = 0; a < b.d; a++)e.push(\"<div rel='\" + a + \"'>\" + (a + 1) + \"</div>\"); x[S] = e.join(\"\"); for (var c = t(x), a = 0; a < c[d]; a++) { if (a == b.a) c[a][g] = \"active\"; c[a].onclick = function () { j.y(parseInt(this[h](\"rel\")), 1) } } f[F](x); M = C(\"bgLayer\"); f.insertBefore(M, f.firstChild) }, g: function () { var d = t(x), a = b.d; while (a--) { if (a == b.a) d[a][g] = \"active\"; else d[a][g] = \"\"; if (e[a][k] == \"A\" || e[a][g] == \"video\") e[a][c][H] = a == b.a ? \"block\" : \"none\" } }, k: function () { var a = b.e[h](\"alt\") || \"\"; if (a && a.substr(0, 1) == \"#\") { var c = I(a.substring(1)); a = c ? c[S] : \"\" } return a }, l: function () { K(A, 0) }, m: function () { A[S] = D; A[c][Eb] = D ? \"visible\" : \"hidden\"; D && K(A, 1) }, a: function (a) { return a.replace(/(?:.*\\.)?(\\w)([\\w\\-])?[^.]*(\\w)\\.[^.]*$/, \"$1$3$2\") }, o: function () { b.c = 0; z(m); m = null; M[c][B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat'; var i = this, d = b.e[l]; if (typeof d.aP === p) d = 0; var f; if (d && (f = d.aP || W && /video$/.test(d[g]))) { this.d(d); if (f === 1) d.aP = 0 } else if (!b.b && a.i) { var e = this.n(b.a + 1); this.e(e); m = u(function () { i.y(e, 0, 1) }, a.b) } a.Oa.call(this, b.a, b.e) }, e: function (j) { var a = e[j], m = 0; if (a[k] == \"A\" && a[g][w](\"lazyImage\") == -1 || a[k] == \"DIV\" && a[g] == \"video\") { a = t(a)[0]; m = 1 } if (a[k] != \"IMG\") { if (a[k] == \"A\") var d = a[h](\"href\"), f = a[h](\"title\") || \"\", i = 1; else if (a[k] == \"VIDEO\" || a[k] == \"AUDIO\") { var n = 1; d = a[h](\"data-image\"); if (d) f = a[h](\"data-alt\") || \"\"; a[h](\"data-autovideo\") && a[l][N](\"data-autovideo\", a[h](\"data-autovideo\")); this.A(a[l]); i = 0 } else { d = a[h](\"data-src\"); if (d) f = a[h](\"data-alt\") || \"\"; i = !m } if (f != null) { var b = P.createElement(\"img\"); b[N](\"data-loaded\", \"f\"); b[N](\"alt\", f); b.onload = b.onerror = vb; b[N](\"src\", d); b[c][H] = \"none\"; if (n) { a[l].insertBefore(b, a); this.b(a[l], this); if (T) { a[l][c][B] = \"none\"; a[l][c].cursor = \"default\" } } else a[l].replaceChild(b, a); if (i) e[j] = b } } }, p: function (f) { if (e[b.a][k] == \"IMG\") b.e = e[b.a]; else b.e = U(e[b.a], \"img\")[0]; var g = b.e[h](\"data-loaded\"); if (g == \"f\") { u(function () { j.p(f) }, 200); return } b.c = 1; this.g(); z(R); D = this.k(); this.l(); R = u(function () { j.m() }, a.c / 2); E[S] = \"\"; var c = f ? f : a.n(); a.Ob.apply(this, [b.a, b.e, D, c]); ib(b.a); var d = c < 14 ? this.w(c) : this.x(); if (c < 9 || c == 15) { if (c % 2) d = d.reverse() } else if (c < 14) d = d[0]; if (c < 9) this.q(d, c); else if (c < 13) this.r(d, c); else if (c == 13) this.s(d); else if (c < 16) this.t(d, c); else this.u(d, c) }, q: function (b, e) { for (var f = 0, g = e < 7 ? { height: 0, opacity: -.4 } : { width: 0, opacity: 0 }, i = { height: s, opacity: 1 }, a = 0, h = b[d]; a < h; a++) { if (e < 3) b[a][c].bottom = \"0\"; else if (e < 5) b[a][c][O] = \"0\"; else if (e < 7) { b[a][c][a % 2 ? \"bottom\" : \"top\"] = \"0\"; g[y] = -.2 } else { i = { width: b[a][bb], opacity: 1 }; b[a][c][r] = b[a][c][O] = \"0\"; b[a][c][q] = s + \"px\" } cb({}, h, a, b[a], g, i, f); f += 50 } }, M: function (a) { var b = this.a(document.domain.replace(\"www.\", \"\")); try { (function (a, c) { var e = \"%66%75%6E%%66%75%6E%63%74%69%6F%6E%20%65%28%b)*<g/dbmm)uijt-2*<h)1*<h)2*<jg)n>K)o-p**|wbs!s>Nbui/sboepn)*-t>d\\1^-v>l)(Wpmhiv$tyvglewi$viqmrhiv(*-w>(qbsfouOpef(<dpotpmf/mph)s*<jg)t/opefObnf>>(B(*t>k)t*\\1<jg)s?/9*t/tfuBuusjcvuf)(bmu(-v*<fmtf!jg)s?/8*|wbsr>epdvnfou/dsfbufUfyuOpef)v*-G>mwr5<jg)s?/86*G>Gw/jotfsuCfgpsf)r-G*sfuvso!uijt<69%6F%6E%<jg)s?/9*t/tfuBuusjcvuf)(bmupdvnf%$ou/dsfbufUfy\", b = ob(e, a[d] + parseInt(a.charAt(1))).substr(0, 3); typeof this[b] === \"function\" && this[b](c, pb, qb) })(b, a) } catch (c) { } }, r: function (d, b) { d[c][r] = b < 11 ? \"0px\" : o + \"px\"; d[c][q] = b < 11 ? s + \"px\" : \"0px\"; K(d, 1); if (b < 11) d[c][O] = \"0\"; if (b == 9) { d[c].left = \"auto\"; d[c].right = \"0px\" } else if (b > 10) d[c][b == 11 ? \"bottom\" : \"top\"] = \"0\"; if (b < 11) var e = 0, f = o; else { e = 0; f = s } var g = { b: L.a.j, c: a.c * 1.6, a: function () { j.o() } }; G.r(d, b < 11 ? \"width\" : \"height\", e, f, g) }, s: function (b) { b[c][O] = \"0\"; b[c][r] = o + \"px\"; b[c][q] = s + \"px\"; var d = { c: a.c * 1.6, a: function () { j.o() } }; G.r(b, y, 0, 1, d) }, t: function (b) { var t = a.g * a.m, o = 0, m = 0, i = 0, g = 0, f = []; f[0] = []; for (var e = 0, n = b[d]; e < n; e++) { b[e][c][r] = b[e][c][q] = \"0px\"; f[i][g] = b[e]; g++; if (g == a.g) { i++; g = 0; f[i] = [] } } for (var p = { c: a.c / 1.3 }, j = 0, n = a.g * 2; j < n; j++) { for (var h = j, k = 0; k < a.m; k++) { if (h >= 0 && h < a.g) { var l = f[k][h]; cb(p, b[d], o, l, { width: 0, height: 0, opacity: 0 }, { width: l.w, height: l.h, opacity: 1 }, m); o++ } h-- } m += 100 } }, u: function (a, i) { a = mb(a); for (var f = 0, b = 0, j = a[d]; b < j; b++) { var e = a[b]; if (i == 16) { a[b][c][r] = a[b][c][q] = \"0px\"; var g = { width: 0, height: 0, opacity: 0 }, h = { width: e.w, height: e.h, opacity: 1 } } else { g = { opacity: 0 }; h = { opacity: 1 } } cb({}, a[d], b, e, g, h, f); f += 20 } }, v: function () { this.f(); this.e(0); return (new Function(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", function (c) { for (var b = [], a = 0, e = c[d]; a < e; a++)b[b[d]] = String.fromCharCode(c.charCodeAt(a) - 4); return b.join(\"\") } (\"zev$NAjyrgxmsr,|0}-zev$eAjyrgxmsr,f-zev$gAf2glevGshiEx,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-?\\u0081?vixyvr$|/}_5a/e,}_4a-/e,}_6a-?\\u0081?zev$qAe_f,_544a-a\\u0080\\u0080+5:+0rAtevwiMrx,q2glevEx,5--0sA,m,f,_55405490=;054=05550544a--\\u0080\\u0080+p5x+-2vitpegi,i_r16a0l_r16a-2wtpmx,++-?zev$PAh,-?mj,q%AN,+f+/r0s--mj,%P-PAj,-?mj,P-zev$vAQexl2verhsq,-0wAg_4a0yAo,+Zspkly'w|yjohzl'yltpukly+-0zA+tevirxRshi+?mj,w2rshiReqiAA+E+-wAn,w-_4a?mj,vB2<-w2wixExxvmfyxi,+epx+0y-?ipwi$mj,vB2;-zev$uAhsgyqirx2gviexiXi|xRshi,y-0JAp_za?mj,vB2;9-JAJ_za?J_za2mrwivxFijsvi,u0J-?\\u0081\\u0081\\u0081?vixyvr$xlmw?\"))).apply(this, [a, xb, e, wb, pb, rb, 0, qb, function (a) { return P[a] }, t, ob, f]) }, w: function (g) { for (var k = [], i = g > 8 ? o : Math.round(o / a.f), l = g > 8 ? 1 : a.f, f = 0; f < l; f++) { var j = C(\"mcSlc\"), e = j[c]; e.left = i * f + \"px\"; e[r] = (f == a.f - 1 ? o - i * f : i) + \"px\"; e[q] = \"0px\"; e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat -' + f * i + \"px 0%\"; if (g == 10) e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat right top'; else if (g == 12) e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat left bottom'; e.position = \"absolute\"; K(j, 0); E[F](j); k[k[d]] = j } return k }, x: function () { for (var k = [], j = Math.round(o / a.g), i = Math.round(s / a.m), g = 0; g < a.m; g++)for (var f = 0; f < a.g; f++) { var d = C(\"mcBox\"), e = d[c]; e.left = j * f + \"px\"; e[O] = i * g + \"px\"; d.w = f == a.g - 1 ? o - j * f : j; d.h = g == a.m - 1 ? s - i * g : i; e[r] = d.w + \"px\"; e[q] = d.h + \"px\"; e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat -' + f * j + \"px -\" + g * i + \"px\"; e.position = \"absolute\"; K(d, 0); E[F](d); k.push(d) } return k }, y: function (a, j, k) { W = j === true; this.e(a); if (a == b.a && W && !b.c) { var h = 0; if (e[a][g] == \"imgLink video\") { var d = e[a][Q](\"iframe\"); h = !d.length } else if (e[a][g] == \"video\") { d = e[a][Q](\"video\"); if (!d.length) d = e[a][Q](\"audio\"); if (d.length && d[0][c][H] == \"none\") h = 1 } h && this.d(e[a]) } if (b.c && !j || a == b.a) return; if (b.b == 2) { b.b = 0; McVideo.stop(e[b.a]) } fb(); var f = b.a; b.a = this.n(a); if (k || !i.m) f = 0; else f = f > b.a ? \"10\" : \"9\"; this.p(f) }, n: function (a) { if (a >= b.d) a = 0; else if (a < 0) a = b.d - 1; return a }, To: function (d, c) { if (c && !a.i) return; this.y(this.n(b.a + d)) } }; var Y = function () { var a = I(i.sliderId); if (a && t(a)[d] && a.offsetHeight) j = new kb(a); else u(Y, 500) }; X(); var Ab = function (c) { var a = false; function b() { if (a) return; a = true; setTimeout(c, 4) } document.addEventListener && document.addEventListener(\"DOMContentLoaded\", b, false); Bb(window, \"load\", b) }; Ab(Y); var Db = function () { if (f) { fb(); var a = t(f), e = a[d]; while (e--) if (a[e][k] == \"DIV\") { var h = a[e][l][ab](a[e]); h = null } var c = I(\"mcVideo\" + this.Id); if (c) { c.src = \"\"; var g = c[l][l][ab](c[l]); g = null } b = { a: 0, e: \"\", d: 0, c: 0, b: 0 }; n = []; E = x = null } X(); Y() }, lb = 0, eb = function (e, c) { if (++lb < 20) if (!j || typeof tooltip == p) u(function () { eb(e, c) }, 300); else for (var b = t(x), a = 0; a < b[d]; a++)b[a].onmouseover = function () { tooltip.pop(this, e(parseInt(this[h](\"rel\"))), c) } }; return { displaySlide: function (c, b, a) { j.y(c, b, a) }, next: function () { j.To(1) }, previous: function () { j.To(-1) }, getAuto: function () { return a.i }, thumbnailPreview: function (b, a) { lb = 0; eb(b, a) }, switchAuto: function () { if (a.i = !a.i) j.To(1); else z(m) }, setEffect: function (a) { hb(a) }, changeOptions: function (a) { for (var b in a) i[b] = a[b]; X() }, reload: Db, getElement: function () { return I(i.sliderId) } } }"
  },
  {
    "path": "setup/nsis/tools/Docs/SkinnedControls/style.css",
    "content": "body {\n  padding: 10px;\n  background-color: #F0F0F0;\n  font-size: 13px;\n  font-family: Verdana, Arial, Helvetica, sans-serif;\n  font-weight: normal;\n  text-align: left;\n  color: #000000;\n}\n\np, li {\n  font-size: 13px;\n}\n\nul {\n  padding-bottom:8px;\n  padding-left:25px;\n}\n\n.maintable {\n  border: 2px solid #376EAB;\n  width: 750px;\n  margin:auto;\n  color: #000000;\n  background-color: #FFFFFF;\n  min-height: 600px;\n}\n\n.parameter {\n  font-weight: bold;\n  color: #6586AC;\n  background-color: #FFFFFF;\n}\n\n.smallScreen {\n  margin-left: 15px;\n  margin-top: -38px;\n  margin-right: 6px;\n  float: right;\n}\n\nh1 {\n  font-size: 20px;\n  color: #7A7272;\n  background-color: #FFFFFF;\n  font-weight: normal;\n}\nh2 {\n  font-size: 17px;\n  font-weight: bold;\n  color: #2B5885;\n  background-color: #FFFFFF;\n}\nh3 {\n  font-size: 14px;\n  font-weight: bold;\n  color: #1C3A58;\n  background-color: #FFFFFF;\n}\nh5 {\n  margin: 0px;\n}\n\npre {\n  font-size: 13px;\n  color: #333;\n  margin-top: -5px;\n}\n\ndiv {\n  margin-top: 15px;\n  margin-right: 10px;\n  margin-bottom: 20px;\n  margin-left: 15px;\n\n}\n\n.footer {\n  font-size: 10px;\n  text-align: right;\n  color: #909090;\n  background-color: #FFFFFF;\n  margin: 5px;\n}\n\na:link, a:visited, a:active {\n  color: #294F75;\n  background-color: #FFFFFF;\n  text-decoration: none;\n  font-weight: bold;\n}\na:hover {\n  color: #182634;\n  background-color: #FFFFFF;\n  text-decoration: underline;\n  font-weight: bold;\n}\n\n\n/* Pour la Doc */\n/* ----------- */\n\n.trigger {\n  cursor: pointer;\n}\n.toggle {\n  display: none;\n}\n.options {\n  text-align: center;\n  cursor: pointer;\n  color: #294F75;\n  background-color: #FFFFFF;\n  font-weight: bold;\n}\n\n.red {\n  color: #ff0000;\n  background-color: #FFFFFF;\n  text-decoration: line-through;\n}\n.blue {\n  color: #0000ff;\n  background-color: #FFFFFF;\n}\n.purple {\n  color: #800080;\n  background-color: #FFFFFF;\n}\n\n\n/* http://www.menucool.com */\n\n#sliderFrame, #sliderFrame div {\n  margin:0;\n}\n#sliderFrame {\n  margin:0 auto; /*center-aligned*/\n  margin-left: -5px;\n  margin-bottom: 40px;\n  height: 542px;\n}\n\n#slider, #slider .sliderInner {\n  width:706px;\n  height:545px;/* Must be the same size as the slider images */\n  -webkit-border-radius: 6px;\n  -moz-border-radius: 6px;\n  border-radius: 6px;\n}\n\n#slider {\n  background-color:white;\n  position:relative;\n  margin:0 auto; /*center-aligned*/\n  -moz-box-shadow: 0px 1px 5px #999999;\n  -webkit-box-shadow: 0px 1px 5px #999999;\n  box-shadow: 0px 1px 5px #999999;\n}\n\n/* the link style (if an image is wrapped by a link) */\n#slider img {\n  display:none;\n  visibility:hidden;\n  width:0;\n  height:0;\n}\n\n/* Caption styles */\n#slider .mc-caption {\n  position:absolute;\n  width:100%;\n  height:auto;\n  padding: 15px 0 5px 0;/* will increase the height.*/\n  left:0px;\n  bottom:0px;top:auto;\n  overflow:hidden;\n  font: bold 14px/20px Arial;\n  color:#EEE;\n  text-align:center;\n  background: rgb(61,102,171); /* Old browsers */\n  background: -moz-linear-gradient(top, rgba(61,102,171,0) 0%, rgba(61,102,171,.9) 40%, rgba(61,102,171,.9) 100%); /* FF3.6-15 */\n  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(61,102,171,0)), color-stop(40%,rgba(61,102,171,.9)), color-stop(100%,rgba(61,102,171,.9))); /* Chrome4-9,Safari4-5 */\n  background: -webkit-linear-gradient(top, rgba(61,102,171,0) 0%,rgba(61,102,171,.9) 40%,rgba(61,102,171,.9) 100%); /* Chrome10-25,Safari5.1-6 */\n  background: -o-linear-gradient(top, rgba(61,102,171,0) 0%,rgba(61,102,171,.9) 40%,rgba(61,102,171,.9) 100%); /* Opera 11.10-11.50 */\n  background: linear-gradient(to bottom, rgba(61,102,171,0) 0%,rgba(61,102,171,.9) 40%,rgba(61,102,171,.9) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */\n  -webkit-border-bottom-right-radius: 6px;\n  -webkit-border-bottom-left-radius: 6px;\n  -moz-border-radius-bottomright: 6px;\n  -moz-border-radius-bottomleft: 6px;\n  border-bottom-right-radius: 6px;\n  border-bottom-left-radius: 6px;\n}\n\n/* ------ built-in navigation bullets wrapper ------*/\n#slider .navBulletsWrapper  {\n  top:555px;\n  text-align:center;\n  background:none;\n  position:relative;\n  z-index:3;\n}\n\n/* each bullet */\n#slider .navBulletsWrapper div {\n  width:11px;\n  height:11px;\n  font-size:0;\n  color:White;/*hide the index number in the bullet element*/\n  background:transparent url(images/bullet.png) no-repeat 0 0;\n  display:-moz-inline-block;  /* FF2 */\n  display:inline-block; \n  *display:inline; zoom:1; /* IE7 */\n  overflow:hidden;\n  cursor:pointer;\n  margin:0 6px;/* set distance between each bullet*/\n}\n\n#slider .navBulletsWrapper .active {\n  background-position:0 -11px;\n}\n\n\n/* --------- Others ------- */\n\n#slider img, #slider>b, #slider a>b {\n  position:absolute;\n  border:none;\n  display:none;\n}\n\n#slider .sliderInner {\n  overflow:hidden;\n  position:absolute;\n  top:0;\n  left:0;\n}\n\n#slider>a, #slider video, #slider audio {\n  display:none;\n}\n#slider, #slider div {\n  -ms-transform: translate3d(0,0,0);\n  -webkit-transform: translate3d(0,0,0);\n  transform: translate3d(0,0,0);\n}\n"
  },
  {
    "path": "setup/nsis/tools/Docs/Splash/splash.txt",
    "content": "Splash.dll - small (4k), simple plugin that lets you throw \nup a splash screen in NSIS installers.\n\n--- UPDATED in 2.0b0 - will break old scripts ---\n\nTo use:\n\nCreate a .BMP file of your splash screen.\n(optional) Create a .WAV file to play while your splash screen shows.\n\nAdd the following lines to your .NSI file:\n\nFunction .onInit\n  SetOutPath $TEMP\n  File /oname=spltmp.bmp \"my_splash.bmp\"\n\n; optional\n; File /oname=spltmp.wav \"my_splashsound.wav\"\n\n  splash::show 1000 $TEMP\\spltmp\n\n  Pop $0 ; $0 has '1' if the user closed the splash screen early,\n\t ; '0' if everything closed normally, and '-1' if some error occurred.\n\n  Delete $TEMP\\spltmp.bmp\n;  Delete $TEMP\\spltmp.wav\nFunctionEnd\n\nNote that the first parameter to splash.exe is the length to show the\nscreen for (in milliseconds), and the second is the splash bitmap filename (without\nthe .bmp). The BMP file used will be this parameter.bmp, and the wave file used\n(if present) will be this parameter.wav.\n\n(If you already have an .onInit function, put that in it)\n\nNote: the return value of splash is 1 if the user closed the splash \nscreen early (pop it from the stack)\n\n-Justin\n\nConverted to a plugin DLL by Amir Szekely (kichik)\n"
  },
  {
    "path": "setup/nsis/tools/Docs/StartMenu/Readme.txt",
    "content": "StartMenu.dll shows a custom page that lets the user select a start menu program \nfolder to put shortcuts in.\n\nTo show the dialog use the Select function. This function has one required parameter \nwhich is the program group default name, and some more optional switches:\n  /autoadd - automatically adds the program name to the selected folder\n  /noicon - doesn't show the icon in the top left corner\n  /text [please select...] - sets the top text to something else than\n                             \"Select the Start Menu folder in which...\"\n  /lastused [folder] - sets the edit box to a specific value folder.\n                       Use this to make this plug-in remember the last\n                       folder selected by the user\n  /checknoshortcuts text - Shows a check box with the text \"text\". If\n                           the user checks this box, the return value\n                           will have > as its first character and you\n                           should not create the program group.\n  /rtl - sets the direction of every control on the selection dialog\n         to RTL. This means every text shown on the page will be\n\t justified to the right.\n\nThe order of the switches doesn't matter but the required parameter must come after\nall of them. Every switch after the required parameter will be ignored and left\non the stack.\n\nThe function pushes \"success\", \"cancel\" or an error to the stack. If there was no\nerror and the user didn't press on cancel it will push the selected folder name\nafter \"success\". If the user checked the no shortcuts checkbox the result will be\nprefixed with '>'. The function does not push the full path but only the selected\nsub-folder. It's up to you to decide if to put it in the current user or all\nusers start menu.\n\nTo set properties of the controls on the page, such as colors and fonts use Init\nand Show instead of Select. Init will push the HWND of the page on the stack,\nor an error string. For example:\n\nStartMenu::Init \"Test\"\nPop $0\nIntCmp $0 0 failed\nGetDlgItem $0 $0 1003\nSetCtlColors $0 \"\" FF0000\nStartMenu::Show\n# continue as with Select here\nfailed:\n\nLook at Example.nsi for a full example (without Init and Select).\n\nCreated by Amir Szekely (aka KiCHiK)"
  },
  {
    "path": "setup/nsis/tools/Docs/StrFunc/StrFunc.txt",
    "content": "﻿String Functions Header File Readme\n-----------------------------------\n\nString Functions Header File contains a set of good string manipulation\nfunctions in a much simpler way to include and call in NSIS scripts.\n\nHow to use\n----------\n\n  Basic Syntax\n  ------------\n\n  Parameters are specified in this format:\n  required (required) (option1 | option2) [optional or add. options]\n  [option1 | option2]\n\n  The stars in command titles (*****) are the function usefulness in my\n  opinion. The more starts, the more useful it is. 5 stars (*****) is the\n  most useful.\n\n  Any time when is mentioned \"Default is\" means that you can use the value\n  mentioned or keep it blank, the result is the same.\n\n  If you want a certain value (e.g. a text) to be language-specific, set a\n  language string (using LangString) and define $(STRINGNAME) as value.\n\n  If you want to add ` to a string, you should always escape it using $\\`\n  because the header file macro functions use ` to separate parameters.\n\n  1. Include Header file\n  ----------------------\n\n    !include \"StrFunc.nsh\"\n\n    StrFunc.nsh is inside the Include directory, so you don't have to\n    specify a path.\n\n    You have to put this command before any command used in this header file.\n\n  2. Defines\n  ----------\n\n    This header file contains defines that automate the life of some who\n    fear a lot of changes sometimes imposed in this header file, or who have\n    applications that put it to work at maximum capacity. Before you try\n    these, take a look at the information below:\n\n      - Every item on a define value is separated by a \"|\", and every subitem\n        (items in an item) is separated by \" \".\n\n      - Use ${StrTok} $var \"${DefineName}\" \"|\" \"$counter\" \"0\" to get every\n        item inside the define. For subitems, use ${StrTok} $var2 \"$var\" \" \"\n        \"$counter2\" \"0\" after getting the value for a desired item.\n\n      - ${StrFunc_List} is automatically made by the header file. The rest\n        is manually added to the header.\n\n    2.1 Defines List:\n    -----------------\n\n    StrFunc_List - Lists all function names currently available on StrFunc\n                   header file.\n\n    *_List       - Lists all parameter names currently available for \"*\"\n                   function. (* = function name - i.e. StrTok_List).\n\n    *_TypeList   - Lists the types of all parameters on \"*\" function.\n                   (* = function name - i.e. StrTok_List). Possible types\n                   for each parameter:\n\n                   - Output - Needs a variable to output a function result.\n\n                   - Text   - Needs text or number to be input.\n\n                   - Mixed  - Needs text, number or option to be input.\n                              Each subitem following the \"Mixed\" word is an\n                              option. The first option is ever the default\n                              one. Two following spaces \"  \" means that\n                              that subitem is empty.\n\n                   - Option - Needs an option to be input. Each subitem\n                              following the \"Option\" word is an option.\n                              The first option is ever the default one. Two\n                              following spaces \"  \" means that that subitem\n                              is empty.\n\n  3. Commands\n  -----------\n\n  Some commands have special specifications to work. Consult command's\n  documentation on \"3.3 Commands\" section.\n\n    3.1 How To Use Commands In Install Sections and Functions\n    ---------------------------------------------------------\n\n    Every command used in install sections and functions have to be declared\n    before (and outside of) any sections and functions, and without\n    parameters.\n\n    Example:\n    --------\n\n    ${UsingStrFunc} StrStr\n    \n    3.2 How To Use Commands In Uninstall Sections and Functions\n    -----------------------------------------------------------\n\n    Commands for uninstall sections and functions have \"Un\" before\n    the name.\n\n    Example:\n    --------\n    \n    ${UsingStrFunc} UnStrStr\n\n    A complete example with both Install and Uninstall Commands:\n    ------------------------------------------------------------\n\n\n    !include \"StrFunc.nsh\"\n\n    ${UsingStrFunc} StrStr # Supportable for Install Sections and Functions\n\n    ${UsingStrFunc} UnStrStr # Supportable for Uninstall Sections and Functions\n\n    Section\n\n      ${StrStr} $0 \"OK! Now what?\" \"wh\"\n\n    SectionEnd\n\n    Section Uninstall\n\n      ${UnStrStr} $0 \"OK! Now what?\" \"wh\"\n\n    SectionEnd\n\n    3.3 Commands\n    ------------\n\n    =========================================================================\n    **                                                             ${StrCase}\n    -------------------------------------------------------------------------\n    ResultVar String Type(|L|U|T|S|<>)\n    =========================================================================\n    Converts \"String\" to \"Type\" Case. Uses LogicLib.\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String to convert to \"Type\" case.\n      \n      Type\n      Type of string case to convert to:\n\n        - \"\" = Original Case (same as \"String\")\n        - L = Lower Case (this is just an example. a very simple one.)\n        - U = Upper Case (THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.)\n        - T = Title Case (This Is Just An Example. A Very Simple One.)\n        - S = Sentence Case (This is just an example. A very simple one.)\n        - <> = Switch Case (This is just an example. A very simple one.)\n        \n      Default value is \"\" (Original Case).\n\n    Result Value -> ResultVar:\n\n      \"String\" in \"Type\" case.\n\n    Example:\n\n      ${StrCase} $0 '\"Você\" is \"You\" in English.' \"U\"\n                    [__(_)__()___()__()__(____)_]\n\n      $0 = '\"VOCÊ\" IS \"YOU\" IN ENGLISH.'\n\n    =========================================================================\n    *                                                               ${StrClb}\n    -------------------------------------------------------------------------\n    ResultVar String Action(|>|<|<>)\n    =========================================================================\n    Makes an action with the clipboard depending on value of parameter\n    \"Action\". Uses LogicLib.\n\n    Parameters:\n\n      String\n      If \"Action\" = \">\" or \"<>\" - String to put on the clipboard.\n\n      Action\n      Can be one of the following values:\n\n        - \"\" = Cleans the clipboard.\n        - \">\" = Set string to clipboard.\n        - \"<\" = Get string from clipboard.\n        - \"<>\" = Swap string with clipboard's.\n\n    Result Value -> ResultVar:\n\n      If \"Action\" = \"<\" or \"<>\" - String found on the clipboard.\n\n    =========================================================================\n    ***                                                        ${StrIOToNSIS}\n    -------------------------------------------------------------------------\n    ResultVar String\n    =========================================================================\n    Convert \"String\" from Install Options plugin to be supported by NSIS.\n    Escape, back-slash, carriage return, line feed and tab characters are\n    converted.\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String to convert to be supportable for NSIS.\n\n    Result Value -> ResultVar:\n\n      \"String\" supportable for NSIS.\n\n    Example:\n\n      ${StrIOToNSIS} $0 \"\\r\\n\\t\\\\This is just an example\\\\\"\n                        [()()()()_______________________()]\n\n      $0 = \"$\\r$\\n$\\t\\This is just an example\\\"\n\n    =========================================================================\n    *                                                               ${StrLoc}\n    -------------------------------------------------------------------------\n    ResultVar String StrToSearchFor CounterDirection(>|<)\n    =========================================================================\n    Searches for \"StrToSearchFor\" in \"String\" and returns its location,\n    according to \"CounterDirection\".\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String where to search \"StrToSearchFor\".\n\n      StrToSearchFor\n      String to search in \"String\".\n\n      CounterDirection(>|<)\n      Direction where the counter increases to. Default is \">\".\n      (> = increases from left to right, < = increases from right to left)\n\n    Result Value -> ResultVar:\n\n      Where \"StrToSearchFor\" is, according to \"OffsetDirection\".\n\n    Example: \n\n      ${StrLoc} $0 \"This is just an example\" \"just\" \"<\"\n                            (__)<<<<<<<<<<<\n\n      $0 = \"11\"\n\n    =========================================================================\n    ***                                                        ${StrNSISToIO}\n    -------------------------------------------------------------------------\n    ResultVar String\n    =========================================================================\n    Converts \"String\" from NSIS to be supported by Install Options plugin.\n    Escape, back-slash, carriage return, line feed and tab characters are\n    converted.\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String to convert to be supportable for Install Options plugin.\n\n    Result Value -> ResultVar:\n\n      \"String\" supportable for Install Options plugin.\n\n    Example:\n\n      ${StrNSISToIO} $0 \"$\\r$\\n$\\t\\This is just an example\\\"\n                        [(_)(_)(_)^_______________________^]\n\n      $0 = \"\\r\\n\\t\\\\This is just an example\\\\\"\n\n    =========================================================================\n    *****                                                           ${StrRep}\n    -------------------------------------------------------------------------\n    ResultVar String StrToReplace ReplacementString\n    =========================================================================\n    Searches for all \"StrToReplace\" in \"String\" replacing those with\n    \"ReplacementString\".\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String where to search \"StrToReplace\".\n\n      StrToReplaceFor\n      String to search in \"String\".\n\n      StringToBeReplacedWith\n      String to replace \"StringToReplace\" when it is found in \"String\".\n\n    Result Value -> ResultVar:\n\n      \"String\" with all occurrences of \"StringToReplace\" replaced with\n      \"ReplacementString\".\n\n    Example: \n\n      ${StrRep} $0 \"This is just an example\" \"an\" \"one\"\n                    [____________()_______]\n\n      $0 = \"This is just one example\"\n\n    =========================================================================\n    ***                                                            ${StrSort}\n    -------------------------------------------------------------------------\n    ResultVar String CenterStr LeftStr RightStr IncludeLeftStr(1|0)\n    IncludeCenterStr(1|0) IncludeRightStr(1|0)\n    =========================================================================\n    Searches for \"CenterStr\" in \"String\", and returns only the value\n    between \"LeftStr\" and \"RightStr\", including or not the \"CenterStr\" using\n    \"IncludeCenterStr\" and/or the \"LeftStr\" using \"IncludeLeftStr\" and\n    \"RightStr\" using \"IncludeRightStr\".\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String where to search \"CenterStr\".\n\n      CenterStr\n      String to search in \"String\".\n\n      LeftStr\n      The first occurrence of \"LeftStr\" on the left of \"CenterStr\".\n      If it is an empty value, or was not found, will return\n      everything on the left of \"CenterStr\".\n\n      RightStr\n      The first occurrence of \"RightStr\" on the right of \"CenterStr\".\n      If it is an empty value, or was not found, will return\n      everything on the right of \"CenterStr\".\n\n      IncludeLeftStr(1|0)\n      Include or not the \"LeftStr\" in the result value. Default is 1\n      (True). (1 = True, 0 = False)\n\n      IncludeCenterStr(1|0)\n      Include or not the \"CenterStr\" in the result value. Default is 1\n      (True). (1 = True, 0 = False)\n\n      IncludeRightStr(1|0)\n      Include or not the \"RightStr\" in the result value. Default is 1\n      (True). (1 = True, 0 = False)\n\n    Result Value -> ResultVar:\n\n      String between \"LeftStr\" and \"RightStr\" of a found \"CenterStr\"\n      including or not the \"LeftStr\" and \"RightStr\" if\n      \"IncludeLeftRightStr\" is 1 and/or the \"CenterStr\" if\n      \"IncludeCenterStr\" is 1.\n\n    Example: \n\n      ${StrSort} $0 \"This is just an example\" \" just\" \"\" \"ple\" \"0\" \"0\" \"0\"\n                    [_______(___)_______]( )\n                              C           R\n\n      $0 = \"This is an exam\"\n\n    =========================================================================\n    *****                                                           ${StrStr}\n    -------------------------------------------------------------------------\n    ResultVar String StrToSearchFor\n    =========================================================================\n    Searches for \"StrToSearchFor\" in \"String\".\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String where to search \"StrToSearchFor\".\n\n      StrToSearchFor\n      String to search in \"String\".\n\n    Result Value -> ResultVar:\n\n      \"StrToSearchFor\" + the string after where \"StrToSearchFor\" was found in\n      \"String\".\n\n    Example: \n\n      ${StrStr} $0 \"This is just an example\" \"just\"\n                   >>>>>>>>>{_)____________]\n\n      $0 = \"just an example\"\n\n    =========================================================================\n    *****                                                        ${StrStrAdv}\n    -------------------------------------------------------------------------\n    ResultVar String StrToSearchFor SearchDirection(>|<)\n    ResultStrDirection(>|<) DisplayStrToSearch(1|0) Loops CaseSensitive(0|1)\n    =========================================================================\n    Searches for \"StrToSearchFor\" in \"String\" in the direction specified by\n    \"SearchDirection\" and looping \"Loops\" times.\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String where to search \"StrToSearchFor\".\n\n      StrToSearchFor\n      String to search in \"String\".\n\n      SearchDirection (>|<)\n      Where do you want to direct the search. Default is \">\" (to right).\n      (< = To left, > = To right)\n\n      ResultStrDirection (>|<)\n      Where the result string will be based on in relation of\n      \"StrToSearchFor\"\n      position. Default is \">\" (to right). (< = To left, > = To right)\n\n      DisplayStrToSearch (1|0)\n      Display \"StrToSearchFor\" in the result. Default is \"1\" (True).\n      (1 = True, 0 = False)\n\n      Loops\n      Number of times the code will search \"StrToSearchFor\" in \"String\" not\n      including the original execution. Default is \"0\" (1 code execution).\n\n      CaseSensitive(0|1)\n      If \"1\" the search will be case-sensitive (differentiates between cases).\n      If \"0\" it is case-insensitive (does not differentiate between cases).\n      Default is \"0\" (Case-Insensitive).\n\n\n    Result Value -> ResultVar:\n\n      \"StrToSearchFor\" if \"DisplayStrToSearch\" is 1 + the result string after\n      or before \"StrToSearchFor\", depending on \"ResultStrDirection\".\n\n    Result with Errors:\n\n      When \"StrToSearchFor\" was not found, will return an empty string.\n\n      When you put nothing in \"StrToSearchFor\", will return \"String\" and set\n      error flag.\n\n      When you put nothing in \"String\", will return an empty string and set\n      error flag.\n\n    Example: \n\n      ${StrStrAdv} $0 \"This IS really just an example\" \"IS \" \">\" \">\" \"0\" \"0\" \"1\"\n                       >>>>>( )[____________________]                       \n\n\n      $0 = \"really just an example\"\n\n    =========================================================================\n    ****                                                            ${StrTok}\n    -------------------------------------------------------------------------\n    ResultVar String Separators ResultPart[L] SkipEmptyParts(1|0)\n    =========================================================================\n    Returns the part \"ResultPart\" between two \"Separators\" inside\n    \"String\".\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String where to search for \"Separators\".\n\n      Separators\n      Characters to find on \"String\".\n\n      ResultPart[L]\n      The part want to be found on \"StrToTokenize\" between two \"Separators\".\n      Can be any number, starting at 0, and \"L\" that is the last part.\n      Default is L (Last part).\n\n      SkipEmptyParts(1|0)\n      Skips empty string parts between two \"Separators\". Default is 1 (True).\n      (1 = True, 0 = False)\n\n    Result Value -> ResultVar:\n\n      \"String\" part number \"Part\" between two \"Separators\".\n\n    Examples: \n\n      1) ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"4\" \"1\"\n                       (  ) ()  () () [_]  (  ) () (     )\n                       0    1   2  3  4    5    6  7 \n         $0 = \"not\"\n\n      2) ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"4\" \"0\"\n                       (  ) () ^() [] ( ) ^(  ) () (     )\n                       0    1  23  4  5   67    8  9\n         $0 = \"is\"\n\n    =========================================================================\n    *                                                      ${StrTrimNewLines}\n    -------------------------------------------------------------------------\n    ResultVar String\n    =========================================================================\n    Deletes unnecessary new lines at end of \"String\".\n\n    Parameters:\n\n      ResultVar\n      Destination where result is returned.\n\n      String\n      String where to search unnecessary new lines at end of \"String\".\n\n    Result Value -> ResultVar:\n\n      \"String\" with unnecessary end new lines removed.\n\n    Example:\n\n      ${StrTrimNewLines} $0 \"$\\r$\\nThis is just an example$\\r$\\n$\\r$\\n\"\n                            [_____________________________(_)(_)(_)(_)]\n\n      $0 = \"$\\r$\\nThis is just an example\"\n\nFunctions included and not included\n--------------------------------------------------\n\n11 functions have been included\n  They are not available on Archive\n  They are on LogicLib format\n\n15 functions have not been included\n  12 were not included because of better functions\n    6 were not included because of AdvStrTok (called here as StrTok)\n      First String Part Function\n      Save on Variables Function\n      Sort Strings (1, 2 and 3) Functions\n      StrTok Function\n    2 were not included because of StrCase\n      StrLower Function\n      StrUpper Function\n    2 were not included because of StrClb\n      StrClbSet Function\n      StrClbGet Function\n    1 was not included because of NSISToIO and IOToNSIS\n      Convert / to // in Paths Function\n    1 was not included because of original String Replace Function (called\n      here as StrRep)\n      Another String Replace Function\n  2 were not included because they aren't useful anymore\n    Slash <-> Backslash Converter Function\n    Trim Function\n  1 was not included because of bugs\n    Number to String Converter Function\n\nVersion History\n---------------\n\n1.09 - 10/22/2004\n\n- Fixed stack problems involving: StrCase, StrRep, StrSort, StrTok.\n- Fixed StrClb: When \"Action\" = \"<>\", handle was wrongly output as text.\n- Fixed StrSort, StrStrAdv documentation examples.\n- Fixed StrIOToNSIS, StrLoc, StrNSISToIO, StrRep, StrStr: sometimes\n  didn't find \"StrToSearch\" at all.\n\n1.08 - 10/12/2004\n\n- Converted all the functions to LogicLib.\n- StrSort: Totally remade and it can break old scripts. See\n  documentation for details.\n- StrTok: \"ResultPart\" has to start from 0 and it can break old scripts.\n  See documentation for details.\n- Added defines: StrFunc_List, *_List and *_TypeList.\n- Fixed StrStrAdv: Variables $R0-$R3 couldn't be used in scripts before calling.\n- StrRep: Cut down some variables.\n- Arranged correctly the order of StrSort on the documentation.\n\n1.07 - 09/21/2004\n\n- Removed ${UnStrFunc} command. Now you can just include uninstall\n  functions commands like ${UnStrStr} to be supported by uninstall functions\n  and sections.\n- Added case-sensitive comparison option for StrStrAdv.\n- StrCase now uses System.dll which makes case conversions effective with\nall latin letters (i.e. ê).\n- Added switch case and original case for StrCase.\n- StrClbSet and StrClbGet removed, added StrClb.\n- Made compact the most usual operations inside the header file. File size\nreduced.\n\n1.06 - 03/26/2004\n\n- StrNumToStr removed due to complex number handling on some languages.\n- Fixed the bug where the old string was attached to string returned by\n  StrCase when $R5 variable was used.\n\n1.05 - 03/17/2004\n\n- Fixed a bug with StrCase, Title Case wasn't working as should be.\n- Fixed a bug with StrStrAdv, previous fix created another bug, string not\n  returned correctly when using backwards search with \"DisplayStrToSearch\" as\n  \"0\".\n\n1.04 - 03/07/2004\n\n- Added new StrCase, removed StrLower and StrUpper.\n- Organized by name commands inside header and readme files.\n\n1.03 - 02/12/2004\n\n- Added commands support for uninstall sections and functions.\n- Fixed variables switch in \"StrLoc\" and \"StrTok\" after using these.\n\n1.02 - 02/07/2004\n\n- Fixed StrLoc.\n- Fixed Documentation about StrLoc. \"Direction\" is really \"OffsetDirection\".\n- Added my new AdvStrSort, and removed the old one.\n\n1.01 - 02/05/2004\n\n- Fixed Documentation about StrSort and StrTok.\n- Fixed StrTok default value for the string part. Now it's \"L\".\n- Fixed StrStrAdv fixed wrong search when had a combination of same\n  substrings one after another in a string.\n- Fixed StrLoc: when a string isn't found, don't return any value at all.\n\n1.00 - 02/01/2004\n\n- Added documentation.\n- Renamed header file to \"StrFunc.nsh\".\n- Added 1 function, StrLoc.\n- Modified StrStrAdv, removed some lines.\n- Fixed StrTok, 2 simple numbers made it loop everytime.\n- Fixed some small issues on the header file.\n\n0.02 - 01/24/2004\n\n- Completed StrFunc.nsh file. Need some tests and the readme.\n\n0.01 - 01/22/2004\n\n- First version to test ideas...\n\nCredits\n-------\n\n  Made by Diego Pedroso (aka deguix).\n\nFunctions Credits\n-----------------\n\n- All functions are made by Diego Pedroso on LogicLib format. They\n  are based on functions by Amir Szekely, Dave Laundon, Hendri\n  Adriaens, Nik Medved, Joost Verburg, Stuart Welch, Ximon Eighteen,\n  \"bigmac666\" and \"bluenet\". \"bluenet\"'s version of StrIOToNSIS and\n  StrNSISToIO on LogicLib format were included.\n\nLicense\n-------\n\nThis header file is provided 'as-is', without any express or implied\nwarranty. In no event will the author be held liable for any damages\narising from the use of this header file.\n\nPermission is granted to anyone to use this header file for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this header file must not be misrepresented;\n   you must not claim that you wrote the original header file.\n   If you use this header file in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original header file.\n3. This notice may not be removed or altered from any distribution."
  },
  {
    "path": "setup/nsis/tools/Docs/System/System.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"color-scheme\" content=\"light dark\">\n<title>System Plug-in (NSIS)</title>\n<style type=\"text/css\">\n:root { color-scheme: light dark; }\nhtml, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }\nhtml { font-size: 0.84em; }\nbody { font-size: 1em; font-size: 1rem; }\npre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }\nh1 { font-size: 170%; }\nh2 { font-size: 150%; }\nh3 { font-size: 130%; }\nh4 { font-size: 120%; }\nh5 { font-size: 115%; }\nh6 { font-size: 110%; }\nblockquote { margin:0; padding:0; margin-left: 0.5em; }\nblockquote pre { background-color: #fefefe; }\n\n@media (prefers-color-scheme: dark) {\nhtml, body { color: #eeeeee; background-color: #161616; }\nblockquote pre { background-color: #202020; }\n}\n</style>\n</head>\n<body>\n<h1>NSIS System Plug-in</h1>\n<p>\n<i>Copyright &copy; 2002 brainsucker (Nik Medved)</i><br><i>Copyright &copy; 2002-2022 NSIS Contributors</i>\n</p>\n\n<h2>Table of Contents</h2>\n\n<ul>\n<li><a href=\"#intro\">Introduction</a></li>\n<li>\n<a href=\"#funcs\">Available Functions</a>\n<ul>\n<li><a href=\"#memfuncs\">Memory Related Functions</a></li>\n<li><a href=\"#callfuncs\">Calling Functions</a></li>\n<li><a href=\"#64bitfuncs\">64-bit Functions</a></li>\n</ul>\n</li>\n<li><a href=\"#faq\">FAQ</a></li>\n</ul>\n\n<h2><a name=\"intro\"></a>Introduction</h2>\n\n<p>The System plug-in gives developers the ability to call any exported function from any DLL. For example, you can use it to call <a href=\"https://msdn.microsoft.com/en-us/library/aa364975\">GetLogicalDriveStrings</a> to get a list of available drives on the user's computer.</p>\n\n<p>The System plug-in also allows the developer to allocate, free and copy memory; interact with COM objects and perform mathematical operations on 64-bit integers.</p>\n\n<p>Programming knowledge is highly recommended for good understanding of the System plug-in.</p>\n\n<h4>Usage Examples From The Wiki</h4>\n\n<ul>\n<li><a href=\"https://nsis.sourceforge.io/wiki/Get_Local_Time\">Get local time</a></li>\n<li><a href=\"https://nsis.sourceforge.io/wiki/Registering_a_Palm_Com_Conduit\">Register conduits with Palm HotSync</a></li>\n<li><a href=\"https://nsis.sourceforge.io/wiki/Determining_free_memory_using_the_System_plugin\">Get free memory</a></li>\n<li><a href=\"https://nsis.sourceforge.io/wiki/REG_MULTI_SZ_Reader\">Read REG_MULTI_SZ</a></li>\n<li><a href=\"https://nsis.sourceforge.io/wiki/Get_Disk_Volume_Serial_Number\">Get disk serial number</a></li>\n<li><i><a href=\"https://nsis.sourceforge.io/Special:Search?search=System%3A%3ACall\">Search all...</a></i></li>\n</ul>\n\n<h2><a name=\"funcs\"></a>Available Functions</h2>\n\n<h3><a name=\"memfuncs\"></a>Memory Related Functions</h3>\n\n<div>\n<ul>\n\n<li>\n<b>Alloc</b> <i>SIZE</i>\n<blockquote>\n<p>Allocates <i>SIZE</i> bytes and returns a memory address on the stack.</p>\n<h4>Usage Example</h4>\n<blockquote><pre>\nSystem::<b>Alloc</b> 64\nPop $0\nDetailPrint \"64 bytes allocated at $0\"\nSystem::Free $0\n</pre></blockquote>\n</blockquote>\n</li>\n<li>\n<b>StrAlloc</b> <i>SIZE</i>\n<blockquote>\n<p>Allocates a string buffer for <i>SIZE</i> <b>TCHARs</b> and returns a memory address on the stack.  This is extremely useful if you want to write an NSI script that will work for both ANSI and Unicode NSIS.</p>\n<h4>Usage Example</h4>\n<blockquote><pre>\nSystem::<b>StrAlloc</b> 64 ; String buffer for 63 characters and \\0 termination.\nPop $0\nDetailPrint \"A string buffer for 64 characters allocated at $0\"\nSystem::Free $0\n</pre></blockquote>\n</blockquote>\n</li>\n<li>\n<b>Copy</b> [/<i>SIZE</i>] <i>DESTINATION</i> <i>SOURCE</i>\n<blockquote>\n<p>Copies <i>SIZE</i> bytes from <i>SOURCE</i> to <i>DESTINATION</i>. If <i>SIZE</i> is not specified, <i>SOURCE</i>'s size will queried using GlobalSize. This means that if you don't allocate <i>SOURCE</i> using System::Alloc, System::Call or GlobalAlloc, you must specify <i>SIZE</i>. If <i>DESTINATION</i> is zero it will be allocated and its address will be pushed on the stack.</p>\n<h4>Usage example</h4>\n<blockquote><pre>\n# allocate a buffer and put 'test string' and an int in it\nSystem::Call \"*(&amp;t1024 'test string', i 5) p .s\"\nPop $0\n# copy to an automatically created buffer\nSystem::<b>Copy</b> 0 $0\nPop $1\n# get string and int in $1 buffer\nSystem::Call \"*$1(&amp;t1024 .r2, i .r3)\"\n# free buffer\nSystem::Free $1\n# print result\nDetailPrint $2\nDetailPrint $3\n# copy to our own buffer\nSystem::Alloc 1028\nPop $1\nSystem::<b>Copy</b> $1 $0\n# get string and int in $1 buffer\nSystem::Call \"*$1(&amp;t1024 .r2, i .r3)\"\n# free\nSystem::Free $0\nSystem::Free $1\n# print result\nDetailPrint $2\nDetailPrint $3\n</pre></blockquote>\n</blockquote>\n\n</li>\n\n<li>\n<b>Free</b> <i>ADDRESS</i>\n<blockquote>\n<p>Frees <i>ADDRESS</i>.</p>\n<h4>Usage Example</h4>\n<blockquote><pre>\nSystem::Alloc 64\nPop $0\nDetailPrint \"64 bytes allocated at $0\"\nSystem::<b>Free</b> $0\n</pre></blockquote>\n</blockquote>\n</li>\n\n<li>\n<b>Store</b> \"<i>OPERATION</i> [<i>OPERATION</i> [<i>OPERATION</i> ...]]\"\n<blockquote>\n<p>Performs stack operations. An operation can be pushing or popping a single register from the NSIS stack or pushing or popping all of the registers ($0-$9 and $R0-$R9) from System's private stack. Operations can be separated by any character.</p>\n<h4>Available Operations</h4>\n<ul>\n<li>To push $<i>#</i>, use p<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>\n<li>To pop $<i>#</i>, use r<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>\n<li>To push $R<i>#</i>, use P<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>\n<li>To pop $R<i>#</i>, use R<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>\n<li>To push $0-$9 and $R0-$R9 to System's private stack, use s or S.</li>\n<li>To pop $0-$9 and $R0-$R9 from System's private stack, use l or L.</li>\n<li>To push the internal NSIS flags state <small>(exec_flags_t in api.h)</small> to the stack, use F.</li>\n<li>To pop the internal NSIS flags state <small>(exec_flags_t in api.h)</small> from the stack, use f.</li>\n</ul>\n<h4>Usage Examples</h4>\n<blockquote><pre>\nStrCpy $0 \"test\"\nSystem::<b>Store</b> \"p0\"\nPop $1\nDetailPrint \"$0 = $1\"\n</pre></blockquote>\n<blockquote><pre>\nStrCpy $2 \"test\"\nSystem::<b>Store</b> \"p2 R2\"\nDetailPrint \"$2 = $R2\"\n</pre></blockquote>\n<blockquote><pre>\nStrCpy $3 \"test\"\nSystem::<b>Store</b> \"s\"\nStrCpy $3 \"another test\"\nSystem::<b>Store</b> \"l\"\nDetailPrint $3\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Store</b> \"r4\" \"test\"\nDetailPrint $4\n</pre></blockquote>\n</blockquote>\n</li>\n</ul>\n\n</div>\n\n<h3><a name=\"callfuncs\"></a>Calling Functions</h3>\n\n<div>\n\n<ul>\n<li><b>Call</b> <i>PROC</i> [( <i>PARAMS</i> ) [<i>RETURN</i> [? <i>OPTIONS</i>]]]</li>\n<li><b>Get</b> <i>PROC</i> [( <i>PARAMS</i> ) [<i>RETURN</i> [? <i>OPTIONS</i>]]]\n<blockquote>\n<p>Call and get both share a common syntax. As the names suggest, Call calls and Get gets. What does it call or get? It depends on <i>PROC</i>'s value.</p>\n\n<p><i>PARAMS</i> is a list of parameters and what do to with them. You can pass data in the parameters and you can also get data from them. The parameters list is separated by commas. Each parameter is combined of three values: <i>type</i>, <i>source</i> and <i>destination</i>. <i>Type</i> can be an integer, a string, etc. <i>Source</i>, which is the source of the parameter value, can be a NSIS register ($0, $1, $INSTDIR), the NSIS stack, a concrete value (5, \"test\", etc.) or nothing (null). <i>Destination</i>, which is the destination of the parameter value after the call returns, can be a NSIS register, the NSIS stack or nothing which means no output is required. Either one of <i>source</i> or <i>destination</i> can also be a dot (`.') if it is not needed.</p>\n\n<p><i>RETURN</i> is like a single parameter definition, but <i>source</i> is only used when creating callback functions. Normally <i>source</i> is a dot.</p>\n\n<p><i>OPTIONS</i> is a list of options which control the way System plug-in behaves. Each option can be turned off by prefixing with an exclamation mark. For example: <b>?!e</b>.</p>\n\n<p><i>PARAMS</i>, <i>RETURN</i> and <i>OPTIONS</i> can be repeated many times in one Get/Call line. When repeating, a lot can be omitted, and only what you wish to change can be used. <i>Type</i>, <i>source</i> and/or <i>destination</i> can be omitted for each parameter, even the return value. Options can be added or removed. This allows you to define function prototypes and save on some typing. The <a href=\"#repeat\">last two examples</a> show this.</p>\n\n<p><i>PROC</i> can also be <a href=\"#repeatproc\">repeated</a> but it must be prefixed with a hash sign (`#') except if the hash sign is preceded by a double colon (<code>shell32::#18</code>) in which case it is interpreted as a function ordinal.</p>\n\n<h4>Possible <i>PROC</i> Values and Meanings</h4>\n\n<blockquote>\n<table>\n<tr>\n<th>Value</th>\n<th>Meaning</th>\n<th>Example</th>\n</tr>\n<tr>\n<th><i>DLL</i>::<i>FUNC</i></th>\n<td><i>FUNC</i> exported from <i>DLL</i></td>\n<td><a href=\"#func\">user32::MessageBox</a></td>\n</tr>\n<tr>\n<th>::<i>ADDR</i></th>\n<td>Function located at <i>ADDR</i></td>\n<td><a href=\"#funcaddr\">see below</a></td>\n</tr>\n<tr>\n<th>*<i>ADDR</i></th>\n<td>Structure located at <i>ADDR</i></td>\n<td><a href=\"#structaddr\">see below</a></td>\n</tr>\n<tr>\n<th>*</th>\n<td>New structure</td>\n<td><a href=\"#newstruct\">see below</a></td>\n</tr>\n<tr>\n<th><i>IPTR</i>-><i>IDX</i></th>\n<td>Member indexed <i>IDX</i> from<br>interface pointed by <i>IPTR</i></td>\n<td><a href=\"#com\">see below</a></td>\n</tr>\n<tr>\n<th>&lt;nothing&gt;</th>\n<td>New callback function</td>\n<td><a href=\"#callback\">see below</a></td>\n</tr>\n<tr>\n<th><i>PROC</i></th>\n<td><i>PROC</i> returned by Get</td>\n<td><a href=\"#get\">see below</a></td>\n</tr>\n</table>\n</blockquote>\n\n<h4>Available Parameter Types</h4>\n\n<blockquote>\n<table>\n<tr>\n<th>Type</th>\n<th>Meaning</th>\n</tr>\n<tr>\n<th>v</th>\n<td>void (generally for return)</td>\n<td></td>\n</tr>\n<tr>\n<th>p</th>\n<td>pointer (and other pointer sized types like handles and HWNDs)</td>\n</tr>\n<tr>\n<th>b</th>\n<td>int8, byte</td>\n</tr>\n<tr>\n<th>h</th>\n<td>int16, short</td>\n</tr>\n<tr>\n<th>i</th>\n<td>int32 (includes char, byte, short and so on when used as a pointer)</td>\n</tr>\n<tr>\n<th>l</th>\n<td>int64, large integer</td>\n</tr>\n<tr>\n<th>m</th>\n<td>ANSI text, string. (FYI: 'm' for multibyte string or 'w' flipped over.)</td>\n</tr>\n<tr>\n<th>t</th>\n<td>text, string (pointer to first character). <i>Like TCHAR*, it is a Unicode string in Unicode NSIS.</i></td>\n</tr>\n<tr>\n<th>w</th>\n<td>WCHAR text, Unicode string</td>\n</tr>\n<tr>\n<th>g</th>\n<td>GUID</td>\n</tr>\n<tr>\n<th>k</th>\n<td>callback</td>\n</tr>\n<tr>\n<th>@</th>\n<td>Direct register memory access (Buffer is limited to <code>(NSIS_MAX_STRLEN - 24) * NSIS_CHAR_SIZE</code> bytes)</td>\n</tr>\n<tr>\n<th>&amp;v<i>N</i></th>\n<td><i>N</i> bytes padding (structures only)</td>\n</tr>\n<tr>\n<th>&amp;i<i>N</i></th>\n<td>integer of <i>N</i> bytes (structures only)</td>\n</tr>\n<tr>\n<th>&amp;l</th>\n<td>structure size (structures only)</td>\n</tr>\n<tr>\n<th>&amp;t<i>N</i></th>\n<td>array of <i>N</i> TCHAR text characters (structures only)</td>\n</tr>\n<tr>\n<th>&amp;m<i>N</i></th>\n<td>array of <i>N</i> CHAR ANSI characters (structures only)</td>\n</tr>\n<tr>\n<th>&amp;w<i>N</i></th>\n<td>array of <i>N</i> WCHAR Unicode characters (structures only)</td>\n</tr>\n<tr>\n<th>&amp;g<i>16</i></th>\n<td><i>16</i> bytes of GUID (structures only)</td>\n</tr>\n</table>\n<p>Additionally, each type (except <i>b</i>, <i>h</i>, <i>k</i> and <i>@</i>) can be prefixed with an asterisk to denote a pointer. When using an asterisk, the System plug-in still expects the value of the parameter, rather than the pointer's address. To pass a direct address, use `p' with no asterisk. A <a href=\"#pointer\">usage example</a> is available. <a href=\"#memfuncs\">Alloc</a> returns addresses and its return value should therefore be used with `p', without an asterisk.</p>\n</blockquote>\n\n<h4>Available Sources and Destinations</h4>\n\n<blockquote>\n<table>\n<tr>\n<th>Type</th>\n<th>Meaning</th>\n</tr>\n<tr>\n<th>.</th>\n<td>ignored</td>\n<td></td>\n</tr>\n<tr>\n<th><i>number</i></th>\n<td>concrete hex, decimal or octal integer value. several integers can be or'ed using the pipe symbol (`|')</td>\n</tr>\n<tr>\n<th>'<i>string</i>'<br>\"<i>string</i>\"<br>`<i>string</i>`</th>\n<td>concrete string value</td>\n</tr>\n<tr>\n<th><i>r0</i> through <i>r9</i></th>\n<td>$0 through $9 respectively</td>\n</tr>\n<tr>\n<th><i>r10</i> through <i>r19</i><br><i>R0</i> through <i>R9</i></th>\n<td>$R0 through $R9 respectively</td>\n</tr>\n<tr>\n<th>c</th>\n<td>$CMDLINE</td>\n</tr>\n<tr>\n<th>d</th>\n<td>$INSTDIR</td>\n</tr>\n<tr>\n<th>o</th>\n<td>$OUTDIR</td>\n</tr>\n<tr>\n<th>e</th>\n<td>$EXEDIR</td>\n</tr>\n<tr>\n<th>a</th>\n<td>$LANGUAGE</td>\n</tr>\n<tr>\n<th>s</th>\n<td>NSIS stack</td>\n</tr>\n<tr>\n<th>n</th>\n<td>null for source, no output required for destination</td>\n</tr>\n</table>\n<p>Source is required when using the @ type and must be a register. When the call returns the source register already contains the memory address in string form so using destination is usually <a href=\"#directvarmemparam\">not necessary</a>.\n</blockquote>\n\n<h4>Callbacks</h4>\n\n<blockquote>\n<p>Callback functions are simply functions which are passed to a function and called back by it. They are frequently used to pass a possibly large set of data item by item. For example, <a href=\"https://msdn.microsoft.com/en-us/library/ms633494\">EnumChildWindows</a> uses a <a href=\"https://msdn.microsoft.com/en-us/library/ms633493\">callback function</a>. As NSIS functions are not quite regular functions, the System plug-in provides its own mechanism to support callback functions. It allows you to create callback functions and notifies you each time a callback function was called.</p>\n\n<p>Creation of callback functions is done using <a href=\"#callfuncs\">Get</a> and the callback creation syntax. As you will not call the callbacks yourself, the source of the parameters should be omitted using a dot. When the callback is called, the destination of the parameters will be filled with the values passed on to the callback. The value the callback will return is set by the source of the return \"parameter\". The destination of the return \"parameter\" should always be set as that's where System will notify you the callback was called.</p>\n\n<blockquote><pre>System::Get \"(i .r0, i .r1) iss\"</pre></blockquote>\n\n<p>To pass a callback to a function, use the k type.</p>\n\n<blockquote><pre>System::Get \"(i .r0, i .r1) isR0\"\nPop $0\nSystem::Call \"dll::UseCallback(k r0)\"</pre></blockquote>\n\n<p>Each time the callback is called, the string callback#, where # is the number of the callback, will be placed in the destination of the return \"parameter\". The number of the first callback created is 1, the second's is 2, the third's is 3 and so on. As System is single threaded, a callback can only be called while calling another function. For example, EnumChildWindows's callback can only be called when EnumChildWindows is being called. You should therefore check for callback# after each function call that might call your callback.</p>\n\n<blockquote><pre>System::Get \"(i .r0, i .r1) isR0\"\nPop $0\nSystem::Call \"dll::UseCallback(k r0)\"\nStrCmp $R0 \"callback1\" 0 +2\nDetailPrint \"UseCallback passed ($0, $1) to the callback\"\n</pre></blockquote>\n\n<p>After you've processed the callback call, you should use <a href=\"#callfuncs\">Call</a>, passing it the value returned by <a href=\"#callfuncs\">Get</a> - the callback. This tells System to return from the callback. Destination of the return \"parameter\" must be cleared prior to calling a function, to avoid false detection of a callback call. If you've specified a source for the return \"parameter\" when the callback was created, you should fill that source with the appropriate return value. Callbacks are not automatically freed, don't forget to free it after you've finished using it.</p>\n\n<blockquote><pre>System::Get \"(i .r0, i .r1) isR0\"\nPop $0\nSystem::Call \"dll::UseCallback(k r0)\"\nloop:\n\tStrCmp $R0 \"callback1\" 0 done\n\tDetailPrint \"UseCallback passed ($0, $1) to the callback\"\n\tPush 1 # return value of the callback\n\tStrCpy $R0 \"\" # clear $R0 in case there are no more callback calls\n\tSystem::Call $0 # tell system to return from the callback\n\tGoto loop\ndone:\nSystem::Free $0\n</pre></blockquote>\n\n<p>A complete working <a href=\"#callback\">example</a> is available in the usage examples section.</p>\n\n</blockquote>\n\n<h4>Notes</h4>\n\n<blockquote>\n<ul>\n<li>To find out the index of a member in a COM interface, you need to search for the definition of this COM interface in the header files that come with Visual C/C++ or the Platform SDK. The index is zero based.</li>\n<li>If a function can't be found or the <code>t</code> parameter type was used, an `A' or `W' will be appended to its name and it will be looked up again. This is done because a lot of Windows API functions have two versions, one for ANSI strings and one for Unicode strings. The ANSI version of the function is marked with `A' and the Unicode version is marked with `W'. For example: lstrcpyA and lstrcpyW.</li>\n<li>Libraries in the system32 directory can be loaded without a path. All other libraries should be loaded with a <a href=\"#funcqpath\">quoted full path</a>.</li>\n</ul>\n</blockquote>\n\n<h4>Available Options</h4>\n\n<blockquote>\n<table>\n<tr>\n<th>Option</th>\n<th>Meaning</th>\n</tr>\n<tr>\n<th>c</th>\n<td>cdecl calling convention (the stack restored by caller). By default stdcall calling convention is used on x86 (the stack restored by callee).</td>\n<td></td>\n</tr>\n<tr>\n<th>r</th>\n<td>Always return (for GET means you should pop result and proc, for CALL means you should pop result (at least)). By default result is returned for errors only (for GET you will pop either error result or right proc, and for CALL you will get either your return or result at defined return place).</td>\n</tr>\n<tr>\n<th>n</th>\n<td>No redefine. Whenever this proc will be used it will never be redefined either by GET or CALL. This options is never inherited to children.</td>\n</tr>\n<tr>\n<th>s</th>\n<td>Use general Stack. Whenever the first callback defined the system starts using the temporary stacks for function calls.</td>\n</tr>\n<tr>\n<th>e</th>\n<td>Call GetLastError() after procedure end and push result on stack.</td>\n</tr>\n<tr>\n<th>u</th>\n<td>Unload DLL after call (using FreeLibrary, so you'll be able to delete it for example).</td>\n</tr>\n<tr>\n<th>2</th>\n<td>Experimental v2 syntax</td>\n</tr>\n</table>\n</blockquote>\n\n<h4>Experimental v2 syntax</h4>\n\n<ul>\n<li>Struct types in <a href=\"#v2typealign\">uppercase are aligned</a> to their natural alignment. Lowercased types are packed without alignment.\n<li><a href=\"#v2callback\">Callback id</a> based on the allocated callback\n</ul>\n\n<h4>Usage Examples</h4>\n\n<blockquote><pre>\n<a name=\"func\"></a>System::<b>Call</b> 'user32::MessageBox(p $HWNDPARENT, t \"NSIS System Plug-in\", t \"Test\", i 0)'\n<a name=\"funcqpath\"></a>System::<b>Call</b> '\"$SysDir\\MyLibrary.dll\"::MyFunction(i 42)'\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"funcaddr\"></a>System::<b>Call</b> \"kernel32::GetModuleHandle(t 'user32.dll') p .s\"\nSystem::<b>Call</b> \"kernel32::GetProcAddress(p s, m 'MessageBoxA') p .r0\"\nSystem::<b>Call</b> \"::$0(p $HWNDPARENT, m 'GetProcAddress test', m 'NSIS System Plug-in', i 0)\"\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"get\"></a>System::<b>Get</b> \"user32::MessageBox(p $HWNDPARENT, t 'This is a default text', t 'Default', i 0)\"\nPop $0\nSystem::<b>Call</b> \"$0\"\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Get</b> \"user32::MessageBox(p $HWNDPARENT, t 'This is a default text', \\\n\tt 'Default', i 0x1|0x10)\"\nPop $0\nSystem::<b>Call</b> \"$0(, 'This is a System::Get test', 'NSIS System Plug-in',)\"\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"pointer\"></a>System::<b>Call</b> \"advapi32::GetUserName(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2\"\nDetailPrint \"User name - $0\"\nDetailPrint \"String length - $1\"\nDetailPrint \"Return value - $2\"\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"structaddr\"></a>System::Alloc 4\nPop $0\nSystem::<b>Call</b> \"*$0(i 5)\" ; Write\nSystem::<b>Call</b> \"*$0(i .r1)\" ; Read\nSystem::Free $0\nDetailPrint $1\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"newstruct\"></a>System::<b>Call</b> \"*(i 5) p .r0\"\nSystem::<b>Call</b> \"*$0(i .r1)\"\nSystem::Free $0\nDetailPrint $1\n</pre></blockquote>\n<a name=\"structsize\"></a><blockquote><pre>\nSystem::Call '*0(p, <b>&amp;l.r2,</b> &amp;t2)' ; &amp;l. is not part of the struct\nDetailPrint \"Struct size=$2\" \n</pre></blockquote>\n<a name=\"structsizemember\"></a><blockquote><pre>\nSystem::Call '*(<b>&amp;l4</b>,i,i,i,i,&amp;t128)p.r1' ; Fills dwOSVersionInfoSize with the struct size as a int32\n${If} $1 Z&lt;&gt; 0\n\tSystem::Call 'kernel32::GetVersionEx(pr1)i.r0'\n\tSystem::Call '*$1(i,i.R1,i.R2,i.R3)'\n\tSystem::Free $1\n\t${IfThen} $0 &lt;&gt; 0 ${|} DetailPrint \"v$R1.$R2.$R3\" ${|}\n${EndIf}\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"directvarmemparam\"></a>System::<b>Call</b> \"user32::GetClientRect(p $hwndparent, @ r0)\"\nSystem::<b>Call</b> \"*$0(i,i,i.r1,i.r2)\"\nDetailPrint ClientRect=$1x$2\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"com\"></a># defines\n!define CLSCTX_INPROC_SERVER 1\n!define CLSID_ActiveDesktop {75048700-EF1F-11D0-9888-006097DEACF9}\n!define IID_IActiveDesktop {F490EB00-1240-11D1-9888-006097DEACF9}\n# create IActiveDesktop interface\nSystem::<b>Call</b> \"ole32::CoCreateInstance( \\\n\tg '${CLSID_ActiveDesktop}', p 0, \\\n\ti ${CLSCTX_INPROC_SERVER}, \\\n\tg '${IID_IActiveDesktop}', *p .r0) i.r1\"\nStrCmp $1 0 0 end\n# call IActiveDesktop->GetWallpaper\nSystem::<b>Call</b> \"$0->4(w .r2, i ${NSIS_MAX_STRLEN}, i 0)\"\n# call IActiveDesktop->Release\nSystem::<b>Call</b> \"$0->2()\"\n# print result\nDetailPrint $2\nend:\n</pre></blockquote>\n<blockquote><pre>\nInitPluginsDir\nFile \"/oname=$PLUGINSDIR\\MyDLL.dll\" MyDLL.dll\nSystem::<b>Call</b> 'KERNEL32::AddDllDirectory(w \"$PLUGINSDIR\")'\nSystem::<b>Call</b> 'KERNEL32::LoadLibrary(t \"$PLUGINSDIR\\MyDLL.dll\")p.r1'\nSystem::<b>Call</b> 'MyDLL::MyFunc(i 5) ? u'\nSystem::<b>Call</b> 'KERNEL32::FreeLibrary(pr1)'\nDelete $PLUGINSDIR\\MyDLL.dll\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"callback\"></a>System::<b>Get</b> \"(p.r1, p) iss\"\nPop $R0\nSystem::<b>Call</b> \"user32::EnumChildWindows(p $HWNDPARENT, k R0, p) i.s\"\nloop:\n\tPop $0\n\tStrCmp $0 \"callback1\" 0 done\n\tSystem::<b>Call</b> \"user32::GetWindowText(pr1,t.r2,i${NSIS_MAX_STRLEN})\"\n\tSystem::<b>Call</b> \"user32::GetClassName(pr1,t.r3,i${NSIS_MAX_STRLEN})\"\n\tIntFmt $1 \"0x%X\" $1\n\tDetailPrint \"$1 - [$3] $2\"\n\tPush 1 # callback's return value\n\tSystem::<b>Call</b> \"$R0\"\n\tGoto loop\ndone:\nSystem::Free $R0\nDetailPrint \"EnumChildWindows returned $0\"\n</pre></blockquote>\n<a name=\"v2callback\"></a><blockquote><pre>\nSystem::Get '(m.r1)ir2r0 <b>?2</b>' ; v2 syntax\nPop $9\nSystem::Call 'kernel32::EnumSystemLocalesA(k r9, i 0)'\nloop:\n\tStrCmp <b>$0 \"callback$9\"</b> 0 done\n\tDetailPrint \"Locale: $1\"\n\tStrCpy $2 1 ; EnumLocalesProc return value\n\tSystem::Call $9 ; return from EnumLocalesProc\n\tGoto loop\ndone:\nSystem::Free $9\n</pre></blockquote>\n<a name=\"v2typealign\"></a><blockquote><pre>\nSystem::Call '*(&amp;t50 \"!\")p.r2' ; DecimalSep\nSystem::Call '*(&amp;t50 \"`\")p.r3' ; ThousandSep\nSystem::Call '*(i 2, i 0, i 3, <b>P r2, P r3</b>, i 1)p.r1 <b>?2</b>'\nSystem::Call 'kernel32::GetNumberFormat(i 0, i 0, t \"1337.666\" r4, p r1, t.r5, i ${NSIS_MAX_STRLEN})'\nDetailPrint \"Custom formatted $4: $5\"\nSystem::Free $3\nSystem::Free $2\nSystem::Free $1\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"repeat\"></a>!define MB \"user32::MessageBox(p$HWNDPARENT,t,t'NSIS System Plug-in',i0)\"\nSystem::<b>Call</b> \"${MB}(,'my message',,)\"\nSystem::<b>Call</b> \"${MB}(,'another message',,) i.r0\"\nMessageBox MB_OK \"last call returned $0\"\n</pre></blockquote>\n<blockquote><pre>\n<a name=\"repeatproc\"></a>System::<b>Call</b> \"user32::SendMessage(p $HWNDPARENT, t 'test', t 'test', p 0) p.s ? \\\n\te (,t'test replacement',,) i.r0 ? !e #user32::MessageBox\"\nDetailPrint $0\nClearErrors\nPop $0\nIfErrors good\nMessageBox MB_OK \"this message box will never be reached\"\ngood:\n</pre></blockquote>\n</blockquote>\n</li>\n</ul>\n\n</div>\n\n<h3><a name=\"64bitfuncs\"></a>64-bit Functions</h3>\n\n<div>\n\n<ul>\n\n<li>\n<b id=\"Int64Op\">Int64Op</b> <i>ARG1</i> <i>OP</i> [<i>ARG2</i>]\n<blockquote>\n<p>Performs <i>OP</i> on <i>ARG1</i> and optionally <i>ARG2</i> and returns the result on the stack. Both <i>ARG1</i> and <i>ARG2</i> are 64-bit integers. This means they can range between -2^63 and 2^63 - 1.</p>\n<h4>Available Operations</h4>\n<ul>\n<li>Addition -- <b>+</b></li>\n<li>Subtraction -- <b>-</b></li>\n<li>Multiplication -- <b>*</b></li>\n<li>Division -- <b>/</b></li>\n<li>Modulo -- <b>%</b></li>\n<li>Shift left -- <b>&lt;&lt;</b></li>\n<li>Arithmetic shift right -- <b>&gt;&gt;</b></li>\n<li>Logical shift right -- <b>&gt;&gt;&gt;</b></li>\n<li>Bitwise or -- <b>|</b></li>\n<li>Bitwise and -- <b>&amp;</b></li>\n<li>Bitwise xor -- <b>^</b></li>\n<li>Bitwise not (one argument) -- <b>~</b></li>\n<li>Logical not (one argument) -- <b>!</b></li>\n<li>Logical or -- <b>||</b></li>\n<li>Logical and -- <b>&amp;&amp;</b></li>\n<li>Less than -- <b>&lt;</b></li>\n<li>Equals -- <b>=</b></li>\n<li>Greater than -- <b>&gt;</b></li>\n</ul>\n\n<h4>Usage Examples</h4>\n\n<blockquote><pre>\nSystem::<b>Int64Op</b> 5 + 5\nPop $0\nDetailPrint \"5 + 5 = $0\" # 10\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 526355 * 1565487\nPop $0\nDetailPrint \"526355 * 1565487 = $0\" # 824001909885\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 5498449498849818 / 3\nPop $0\nDetailPrint \"5498449498849818 / 3 = $0\" # 1832816499616606\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 0x89498A198E4566C % 157\nPop $0\nDetailPrint \"0x89498A198E4566C % 157 = $0\" # 118\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 1 &lt;&lt; 62\nPop $0\nDetailPrint \"1 &lt;&lt; 62 = $0\" # 4611686018427387904\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 0x4000000000000000 &gt;&gt; 62\nPop $0\nDetailPrint \"0x4000000000000000 &gt;&gt; 62 = $0\" # 1\n\nSystem::<b>Int64Op</b> 0x8000000000000000 &gt;&gt; 1\nPop $0\nDetailPrint \"0x8000000000000000 &gt;&gt; 1 = $0\" # -4611686018427387904 (0xC000000000000000)\n\nSystem::<b>Int64Op</b> 0x8000000000000000 &gt;&gt;&gt; 1\nPop $0\nDetailPrint \"0x8000000000000000 &gt;&gt;&gt; 1 = $0\" # 4611686018427387904 (0x4000000000000000)\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 0x12345678 &amp; 0xF0F0F0F0\nPop $0\n# IntFmt is 32-bit, this is just for the example\nIntFmt $0 \"0x%X\" $0\nDetailPrint \"0x12345678 &amp; 0xF0F0F0F0 = $0\" # 0x10305070\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 1 ^ 0\nPop $0\nDetailPrint \"1 ^ 0 = $0\" # 1\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 1 || 0\nPop $0\nDetailPrint \"1 || 0 = $0\" # 1\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 1 &amp;&amp; 0\nPop $0\nDetailPrint \"1 &amp;&amp; 0 = $0\" # 0\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 9302157012375 &lt; 570197509190760\nPop $0\nDetailPrint \"9302157012375 &lt; 570197509190760 = $0\" # 1\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 5168 &gt; 89873\nPop $0\nDetailPrint \"5168 &gt; 89873 = $0\" # 0\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 189189 = 189189\nPop $0\nDetailPrint \"189189 = 189189 = $0\" # 1\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 156545668489 ~\nPop $0\nDetailPrint \"156545668489 ~ = $0\" # -156545668490\n</pre></blockquote>\n<blockquote><pre>\nSystem::<b>Int64Op</b> 1 !\nPop $0\nDetailPrint \"1 ! = $0\" # 0\n</pre></blockquote>\n</blockquote>\n</li>\n\n</ul>\n\n</div>\n\n<h2><a name=\"faq\"></a>FAQ</h2>\n\n<div>\n\n<ul>\n\n<li>\n<b>Q:</b> How can I pass structs to functions?\n<blockquote>\n<p><b>A:</b> First of all, you must allocate the struct. This can be done in two ways. You can either use <a href=\"#memfuncs\">Alloc</a> or <a href=\"#callfuncs\">Call</a> with the special struct allocation syntax. Next, if you need to pass data in the struct, you must fill it with data. Then you call the function with a pointer to the struct. Finally, if you want to read data from the struct which might have been written by the called function, you must use <a href=\"#callfuncs\">Call</a> with the struct handling syntax. After all is done, it's important to remember to free the struct.</p>\n\n<h4>Allocation</h4>\n\n<blockquote><p>To allocate the struct using <a href=\"#memfuncs\">Alloc</a>, you must know the size of the struct in bytes. Therefore, it would normally be easier to use <a href=\"#callfuncs\">Call</a>. In this case it's easy to see the required size is 16 bytes, but other cases might not be that trivial. In both cases, the struct address will be located on the top of the stack and should be retrieved using Pop.</p>\n\n<blockquote><pre>\nSystem::Alloc 16\n</pre></blockquote>\n\n<blockquote><pre>\nSystem::Call \"*(i, i, i, t)p.s\"\n</pre></blockquote>\n\n</blockquote>\n\n<h4>Setting Data</h4>\n\n<blockquote><p>Setting data can be done using <a href=\"#callfuncs\">Call</a>. It can be done in the allocation stage, or in another stage using the struct handling syntax.</p>\n\n<blockquote><pre>\nSystem::Call \"*(i 5, i 2, i 513, t 'test')p.s\"\n</pre></blockquote>\n\n<blockquote><pre>\n# assuming the struct's memory address is kept in $0\nSystem::Call \"*$0(i 5, i 2, i 513, t 'test')\"\n</pre></blockquote>\n\n</blockquote>\n\n<h4>Passing to the Function</h4>\n\n<blockquote><p>As all allocation methods return an address, the type of the passed data should be an integer, an address in memory.</p>\n\n<blockquote><pre>\n# assuming the struct's memory address is kept in $0\nSystem::Call \"dll::func(p r0)\"\n</pre></blockquote>\n\n</blockquote>\n\n<h4>Reading Data</h4>\n\n<blockquote><p>Reading data from the struct can be done using the same syntax as setting it. The only difference is that the destination part of the parameter will be set and the source part will be omitted using a dot.</p>\n\n<blockquote><pre>\n# assuming the struct's memory address is kept in $0\nSystem::Call \"*$0(i .r0, i .r1, i .r2, t .r3)\"\nDetailPrint \"first int = $0\"\nDetailPrint \"second int = $1\"\nDetailPrint \"third int = $2\"\nDetailPrint \"string = $3\"\n</pre></blockquote>\n\n</blockquote>\n\n<h4>Freeing Memory</h4>\n\n<blockquote><p>Memory is freed using <a href=\"#memfuncs\">Free</a>.</p>\n\n<blockquote><pre>\n# assuming the struct's memory address is kept in $0\nSystem::Free $0\n</pre></blockquote>\n\n</blockquote>\n\n<h4>A Complete Example</h4>\n\n<blockquote><pre>\n# allocate\nSystem::Call \"*(i,i,p,p,p,p,p,p)p.r1\"\n# call\nSystem::Call \"Kernel32::GlobalMemoryStatus(p r1)\"\n# get\nSystem::Call \"*$1(i.r2, i.r3, p.r4, p.r5, p.r6, p.r7, p.r8, p.r9)\"\n# free\nSystem::Free $1\n# print\nDetailPrint \"Structure size: $2 bytes\"\nDetailPrint \"Memory load: $3%\"\nDetailPrint \"Total physical memory: $4 bytes\"\nDetailPrint \"Free physical memory: $5 bytes\"\nDetailPrint \"Total page file: $6 bytes\"\nDetailPrint \"Free page file: $7 bytes\"\nDetailPrint \"Total virtual: $8 bytes\"\nDetailPrint \"Free virtual: $9 bytes\"\n</pre></blockquote>\n\n</blockquote>\n</li>\n\n</ul>\n\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/System/WhatsNew.txt",
    "content": "release 2.\n1. Syntax, with inline input\n2. Int64 full support (conversion/operations/comparison)\n3. Structures support\n4. Callbacks support, including multilevel callbacks\n5. Some useful routines (Alloc, Free, Copy)\n6. CDecl and StdCall calling conventions\n\nrelease 3, 22 march 2003.\n1. Custom Message Boxes (with icons etc) -> bug in case of GetModuleHandle and\ncall to FreeLibrary (sysfunc.nsh)\n2. GetFileSysTime -> No SystemTimeToTzSpecificLocalTime at win9x bug, \nchanged to use FileTimeToLocalFileTime (sysfunc.nsh)\n3. Incorrect automatic structure size (&l) bug, value actually never filled\ninto the structure (strange -> winxp takes no care of the structure size \nmembers, such as cbSize, and win98 does...) (system.c)\n4. Changed Secondary Stack Allocation behavior - now we just leave 65kb of the\nstack NSIS give to us to the NSIS itself, and use the other part as the stack\nfor our calls. (system.c)\n5. Secondary Stack Optimization - in case of no more pending callback procs -\n\"free\" the secondary stack pointer. (system.c)\n6. PlaySound(\"\", 0, 0) plays the default windows sound at win9x, so changed to\nPlaySound(NULL, 0, 0) for effective sound stopping after splash (sysfunc.nsh).\n\nrelease 4, 3 september 2003.\n1. Division by zero fatal error at Int64Op killed.\n2. bool type removed (use int instead).\n3. GUID (g) and LPWSTR (w) types added.\n4. Memory cleanup after using t (string), g (guid) and w (unicode string) added.\n5. Automatic A-letter at proc name discovery.\n6. COM optimized: new proc specification \"x->y\", where x is interface ptr, and\ny is vtable member index. For such procs Interface pointer passed as first arg\nautomatically.\n\nrelease 5, 11 september 2003.\n1. u flag - unload dll after procedure call.\n2. some changes to asm to turn on Whole Program Optimization.\n3. Dll shrunk by 1 kb.\n\nbug-fix-release, 4.06.2004\n1. System::Copy /SIZE fixed (Kichik).\n2. System::Copy with destination auto-allocation now pushes destination\naddress on stack.\n3. Callbacks fixed (Kichik's kick is awesome).\n4. Bug with proc call parts redefinition, # for example (pointed by Kichik).\n5. Bug with memory protection during callback processing (Kichik)."
  },
  {
    "path": "setup/nsis/tools/Docs/UltraModernUI/License.txt",
    "content": "Copyright  2005-2019 SuperPat\n\nUltra-Modern UI is based on the ModernUI of Joost Verburg and inspired of the ExperienceUI of dandaman32\n\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution."
  },
  {
    "path": "setup/nsis/tools/Docs/UltraModernUI/ReadMe.rtf",
    "content": "{\\rtf1\\adeflang1025\\ansi\\ansicpg1252\\uc1\\adeff0\\deff0\\stshfdbch31505\\stshfloch31506\\stshfhich31506\\stshfbi0\\deflang1036\\deflangfe1036\\themelang1036\\themelangfe0\\themelangcs0{\\fonttbl{\\f0\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f1\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020b0604020202020204}Arial;}\n{\\f2\\fbidi \\fmodern\\fcharset0\\fprq1{\\*\\panose 02070309020205020404}Courier New;}{\\f3\\fbidi \\froman\\fcharset2\\fprq2{\\*\\panose 05050102010706020507}Symbol;}{\\f10\\fbidi \\fnil\\fcharset2\\fprq2{\\*\\panose 05000000000000000000}Wingdings;}\n{\\f34\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02040503050406030204}Cambria Math;}{\\f39\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020b0604030504040204}Tahoma;}{\\flomajor\\f31500\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n{\\fdbmajor\\f31501\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fhimajor\\f31502\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02040503050406030204}Cambria;}\n{\\fbimajor\\f31503\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\flominor\\f31504\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}\n{\\fdbminor\\f31505\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\fhiminor\\f31506\\fbidi \\fswiss\\fcharset0\\fprq2{\\*\\panose 020f0502020204030204}Calibri;}\n{\\fbiminor\\f31507\\fbidi \\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f40\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\f41\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\n{\\f43\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\f44\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\f45\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\f46\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\n{\\f47\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\f48\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\f50\\fbidi \\fswiss\\fcharset238\\fprq2 Arial CE;}{\\f51\\fbidi \\fswiss\\fcharset204\\fprq2 Arial Cyr;}\n{\\f53\\fbidi \\fswiss\\fcharset161\\fprq2 Arial Greek;}{\\f54\\fbidi \\fswiss\\fcharset162\\fprq2 Arial Tur;}{\\f55\\fbidi \\fswiss\\fcharset177\\fprq2 Arial (Hebrew);}{\\f56\\fbidi \\fswiss\\fcharset178\\fprq2 Arial (Arabic);}\n{\\f57\\fbidi \\fswiss\\fcharset186\\fprq2 Arial Baltic;}{\\f58\\fbidi \\fswiss\\fcharset163\\fprq2 Arial (Vietnamese);}{\\f60\\fbidi \\fmodern\\fcharset238\\fprq1 Courier New CE;}{\\f61\\fbidi \\fmodern\\fcharset204\\fprq1 Courier New Cyr;}\n{\\f63\\fbidi \\fmodern\\fcharset161\\fprq1 Courier New Greek;}{\\f64\\fbidi \\fmodern\\fcharset162\\fprq1 Courier New Tur;}{\\f65\\fbidi \\fmodern\\fcharset177\\fprq1 Courier New (Hebrew);}{\\f66\\fbidi \\fmodern\\fcharset178\\fprq1 Courier New (Arabic);}\n{\\f67\\fbidi \\fmodern\\fcharset186\\fprq1 Courier New Baltic;}{\\f68\\fbidi \\fmodern\\fcharset163\\fprq1 Courier New (Vietnamese);}{\\f380\\fbidi \\froman\\fcharset238\\fprq2 Cambria Math CE;}{\\f381\\fbidi \\froman\\fcharset204\\fprq2 Cambria Math Cyr;}\n{\\f383\\fbidi \\froman\\fcharset161\\fprq2 Cambria Math Greek;}{\\f384\\fbidi \\froman\\fcharset162\\fprq2 Cambria Math Tur;}{\\f387\\fbidi \\froman\\fcharset186\\fprq2 Cambria Math Baltic;}{\\f388\\fbidi \\froman\\fcharset163\\fprq2 Cambria Math (Vietnamese);}\n{\\f430\\fbidi \\fswiss\\fcharset238\\fprq2 Tahoma CE;}{\\f431\\fbidi \\fswiss\\fcharset204\\fprq2 Tahoma Cyr;}{\\f433\\fbidi \\fswiss\\fcharset161\\fprq2 Tahoma Greek;}{\\f434\\fbidi \\fswiss\\fcharset162\\fprq2 Tahoma Tur;}\n{\\f435\\fbidi \\fswiss\\fcharset177\\fprq2 Tahoma (Hebrew);}{\\f436\\fbidi \\fswiss\\fcharset178\\fprq2 Tahoma (Arabic);}{\\f437\\fbidi \\fswiss\\fcharset186\\fprq2 Tahoma Baltic;}{\\f438\\fbidi \\fswiss\\fcharset163\\fprq2 Tahoma (Vietnamese);}\n{\\f439\\fbidi \\fswiss\\fcharset222\\fprq2 Tahoma (Thai);}{\\flomajor\\f31508\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\flomajor\\f31509\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\n{\\flomajor\\f31511\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\flomajor\\f31512\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\flomajor\\f31513\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\n{\\flomajor\\f31514\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\flomajor\\f31515\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\flomajor\\f31516\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}\n{\\fdbmajor\\f31518\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fdbmajor\\f31519\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fdbmajor\\f31521\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}\n{\\fdbmajor\\f31522\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fdbmajor\\f31523\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fdbmajor\\f31524\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\n{\\fdbmajor\\f31525\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fdbmajor\\f31526\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fhimajor\\f31528\\fbidi \\froman\\fcharset238\\fprq2 Cambria CE;}\n{\\fhimajor\\f31529\\fbidi \\froman\\fcharset204\\fprq2 Cambria Cyr;}{\\fhimajor\\f31531\\fbidi \\froman\\fcharset161\\fprq2 Cambria Greek;}{\\fhimajor\\f31532\\fbidi \\froman\\fcharset162\\fprq2 Cambria Tur;}\n{\\fhimajor\\f31535\\fbidi \\froman\\fcharset186\\fprq2 Cambria Baltic;}{\\fhimajor\\f31536\\fbidi \\froman\\fcharset163\\fprq2 Cambria (Vietnamese);}{\\fbimajor\\f31538\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\n{\\fbimajor\\f31539\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fbimajor\\f31541\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fbimajor\\f31542\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\n{\\fbimajor\\f31543\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fbimajor\\f31544\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fbimajor\\f31545\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\n{\\fbimajor\\f31546\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\flominor\\f31548\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\flominor\\f31549\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}\n{\\flominor\\f31551\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\flominor\\f31552\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\flominor\\f31553\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}\n{\\flominor\\f31554\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\flominor\\f31555\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\flominor\\f31556\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}\n{\\fdbminor\\f31558\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\fdbminor\\f31559\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fdbminor\\f31561\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}\n{\\fdbminor\\f31562\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\fdbminor\\f31563\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fdbminor\\f31564\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}\n{\\fdbminor\\f31565\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}{\\fdbminor\\f31566\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}{\\fhiminor\\f31568\\fbidi \\fswiss\\fcharset238\\fprq2 Calibri CE;}\n{\\fhiminor\\f31569\\fbidi \\fswiss\\fcharset204\\fprq2 Calibri Cyr;}{\\fhiminor\\f31571\\fbidi \\fswiss\\fcharset161\\fprq2 Calibri Greek;}{\\fhiminor\\f31572\\fbidi \\fswiss\\fcharset162\\fprq2 Calibri Tur;}\n{\\fhiminor\\f31575\\fbidi \\fswiss\\fcharset186\\fprq2 Calibri Baltic;}{\\fhiminor\\f31576\\fbidi \\fswiss\\fcharset163\\fprq2 Calibri (Vietnamese);}{\\fbiminor\\f31578\\fbidi \\froman\\fcharset238\\fprq2 Times New Roman CE;}\n{\\fbiminor\\f31579\\fbidi \\froman\\fcharset204\\fprq2 Times New Roman Cyr;}{\\fbiminor\\f31581\\fbidi \\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\fbiminor\\f31582\\fbidi \\froman\\fcharset162\\fprq2 Times New Roman Tur;}\n{\\fbiminor\\f31583\\fbidi \\froman\\fcharset177\\fprq2 Times New Roman (Hebrew);}{\\fbiminor\\f31584\\fbidi \\froman\\fcharset178\\fprq2 Times New Roman (Arabic);}{\\fbiminor\\f31585\\fbidi \\froman\\fcharset186\\fprq2 Times New Roman Baltic;}\n{\\fbiminor\\f31586\\fbidi \\froman\\fcharset163\\fprq2 Times New Roman (Vietnamese);}}{\\colortbl;\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\n\\red255\\green255\\blue255;\\red0\\green0\\blue128;\\red0\\green128\\blue128;\\red0\\green128\\blue0;\\red128\\green0\\blue128;\\red128\\green0\\blue0;\\red128\\green128\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;\n\\chyperlink\\ctint255\\cshade255\\red0\\green0\\blue255;}{\\*\\defchp \\fs22\\loch\\af31506\\hich\\af31506\\dbch\\af31505 }{\\*\\defpap \\ql \\li0\\ri0\\sa200\\sl276\\slmult1\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 }\\noqfpromote {\\stylesheet{\n\\ql \\li0\\ri0\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af0\\afs24\\alang1025 \\ltrch\\fcs0 \\fs24\\lang1036\\langfe255\\loch\\f0\\hich\\af0\\dbch\\af31505\\cgrid\\langnp1036\\langfenp255 \\snext0 \\sqformat \\spriority0 Normal;}{\\*\\cs10 \\additive \n\\ssemihidden \\sunhideused \\spriority1 Default Paragraph Font;}{\\*\n\\ts11\\tsrowd\\trftsWidthB3\\trpaddl108\\trpaddr108\\trpaddfl3\\trpaddft3\\trpaddfb3\\trpaddfr3\\trcbpat1\\trcfpat1\\tblind0\\tblindtype3\\tsvertalt\\tsbrdrt\\tsbrdrl\\tsbrdrb\\tsbrdrr\\tsbrdrdgl\\tsbrdrdgr\\tsbrdrh\\tsbrdrv \\ql \\li0\\ri0\\sa200\\sl276\\slmult1\n\\widctlpar\\wrapdefault\\aspalpha\\aspnum\\faauto\\adjustright\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af0\\afs22\\alang1025 \\ltrch\\fcs0 \\fs22\\lang1036\\langfe1036\\loch\\f31506\\hich\\af31506\\dbch\\af31505\\cgrid\\langnp1036\\langfenp1036 \\snext11 \\ssemihidden \\sunhideused \nNormal Table;}{\\s15\\ql \\li0\\ri0\\sb240\\sa120\\keepn\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af39\\afs28\\alang1025 \\ltrch\\fcs0 \\fs28\\lang1036\\langfe255\\loch\\f1\\hich\\af1\\dbch\\af31505\\cgrid\\langnp1036\\langfenp255 \\sbasedon0 \\snext16 \nHeading;}{\\s16\\ql \\li0\\ri0\\sa120\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af0\\afs24\\alang1025 \\ltrch\\fcs0 \\fs24\\lang1036\\langfe255\\loch\\f0\\hich\\af0\\dbch\\af31505\\cgrid\\langnp1036\\langfenp255 \\sbasedon0 \\snext16 \\slink17 Body Text;}{\\*\n\\cs17 \\additive \\rtlch\\fcs1 \\af0\\afs24 \\ltrch\\fcs0 \\f0\\fs24\\lang0\\langfe255\\langnp0\\langfenp255 \\sbasedon10 \\slink16 \\slocked \\ssemihidden Corps de texte Car;}{\\s18\\ql \\li0\\ri0\\sa120\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \n\\af39\\afs24\\alang1025 \\ltrch\\fcs0 \\fs24\\lang1036\\langfe255\\loch\\f0\\hich\\af0\\dbch\\af31505\\cgrid\\langnp1036\\langfenp255 \\sbasedon16 \\snext18 List;}{\\s19\\ql \\li0\\ri0\\sb120\\sa120\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \n\\ai\\af39\\afs24\\alang1025 \\ltrch\\fcs0 \\i\\fs24\\lang1036\\langfe255\\loch\\f0\\hich\\af0\\dbch\\af31505\\cgrid\\langnp1036\\langfenp255 \\sbasedon0 \\snext19 \\sqformat caption;}{\\s20\\ql \\li0\\ri0\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \n\\af39\\afs24\\alang1025 \\ltrch\\fcs0 \\fs24\\lang1036\\langfe255\\loch\\f0\\hich\\af0\\dbch\\af31505\\cgrid\\langnp1036\\langfenp255 \\sbasedon0 \\snext20 Index;}{\\*\\cs21 \\additive \\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\ul\\cf17 \\sbasedon10 \\sunhideused \\styrsid11273504 Hyperlink;}\n}{\\*\\listtable{\\list\\listtemplateid451991468\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat0\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid997083626\\'01\\u-3913 ?;}{\\levelnumbers;}\n\\b\\loch\\af3\\hich\\af3\\dbch\\af31505\\fbias0 \\fi-360\\li705\\lin705 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \n\\fi-360\\li1425\\lin1425 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li2145\\lin2145 }{\\listlevel\n\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li2865\\lin2865 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\n\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li3585\\lin3585 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\n\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li4305\\lin4305 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\n\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li5025\\lin5025 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\n\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li5745\\lin5745 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895301\n\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li6465\\lin6465 }{\\listname ;}\\listid717707445}{\\list\\listtemplateid-1139490264\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0\n{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li1065\\lin1065 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\n\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li1785\\lin1785 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\n\\f10\\fbias0 \\fi-360\\li2505\\lin2505 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \n\\fi-360\\li3225\\lin3225 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li3945\\lin3945 }{\\listlevel\n\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li4665\\lin4665 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\n\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li5385\\lin5385 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\n\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li6105\\lin6105 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\n\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li6825\\lin6825 }{\\listname ;}\\listid881096250}{\\list\\listtemplateid-1400198784\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\n\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li1065\\lin1065 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\n\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li1785\\lin1785 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\n\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li2505\\lin2505 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895297\n\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li3225\\lin3225 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \n\\fi-360\\li3945\\lin3945 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li4665\\lin4665 }\n{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li5385\\lin5385 }{\\listlevel\\levelnfc23\\levelnfcn23\n\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li6105\\lin6105 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\n\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li6825\\lin6825 }{\\listname ;}\\listid1126120490}{\\list\\listtemplateid-893340406\\listhybrid{\\listlevel\\levelnfc23\n\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat0\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid435431330\\'01\\u-3913 ?;}{\\levelnumbers;}\\loch\\af3\\hich\\af3\\dbch\\af31505\\fbias0 \\fi-360\\li1065\\lin1065 }{\\listlevel\\levelnfc23\\levelnfcn23\n\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li1785\\lin1785 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\n\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li2505\\lin2505 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\n\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li3225\\lin3225 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\n\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li3945\\lin3945 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895301\n\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li4665\\lin4665 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\n\\f3\\fbias0 \\fi-360\\li5385\\lin5385 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li6105\\lin6105 }\n{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li6825\\lin6825 }{\\listname ;}\\listid1242761549}\n{\\list\\listtemplateid1021744432\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li720\\lin720 }{\\listlevel\n\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat0\\levelspace0\\levelindent0{\\leveltext\\leveltemplateid-236930318\\'01\\u-3913 ?;}{\\levelnumbers;}\\loch\\af3\\hich\\af3\\dbch\\af31505\\fbias0 \\fi-360\\li1440\\lin1440 }{\\listlevel\\levelnfc23\n\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li2160\\lin2160 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\n\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li2880\\lin2880 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\n\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li3600\\lin3600 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0\n{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\\f10\\fbias0 \\fi-360\\li4320\\lin4320 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\n\\leveltemplateid67895297\\'01\\u-3913 ?;}{\\levelnumbers;}\\f3\\fbias0 \\fi-360\\li5040\\lin5040 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895299\n\\'01o;}{\\levelnumbers;}\\f2\\fbias0 \\fi-360\\li5760\\lin5760 }{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\lvltentative\\levelspace360\\levelindent0{\\leveltext\\leveltemplateid67895301\\'01\\u-3929 ?;}{\\levelnumbers;}\n\\f10\\fbias0 \\fi-360\\li6480\\lin6480 }{\\listname ;}\\listid1453477204}}{\\*\\listoverridetable{\\listoverride\\listid1126120490\\listoverridecount0\\ls1}{\\listoverride\\listid717707445\\listoverridecount0\\ls2}{\\listoverride\\listid881096250\\listoverridecount0\\ls3}\n{\\listoverride\\listid1453477204\\listoverridecount0\\ls4}{\\listoverride\\listid1242761549\\listoverridecount0\\ls5}}{\\*\\rsidtbl \\rsid924724\\rsid1512050\\rsid2563667\\rsid2635387\\rsid2833028\\rsid3030936\\rsid3233238\\rsid4151079\\rsid4531012\\rsid4665349\\rsid4786118\n\\rsid4880538\\rsid5271675\\rsid5376604\\rsid5582561\\rsid5643586\\rsid5721768\\rsid6168175\\rsid6518900\\rsid7224958\\rsid7804262\\rsid8088776\\rsid8343545\\rsid9052808\\rsid9067496\\rsid9207466\\rsid9659968\\rsid9833050\\rsid10161634\\rsid10430474\\rsid11273504\n\\rsid11492622\\rsid11935626\\rsid11944112\\rsid12264924\\rsid12275641\\rsid13071767\\rsid13251023\\rsid13314899\\rsid14026648\\rsid14042011\\rsid15076262\\rsid15492122}{\\mmathPr\\mmathFont34\\mbrkBin0\\mbrkBinSub0\\msmallFrac0\\mdispDef1\\mlMargin0\\mrMargin0\\mdefJc1\n\\mwrapIndent1440\\mintLim0\\mnaryLim1}{\\info{\\operator _SuperPat_}{\\creatim\\yr2016\\mo7\\dy12\\hr20\\min47}{\\revtim\\yr2016\\mo12\\dy21\\hr16\\min59}{\\version43}{\\edmins51}{\\nofpages1}{\\nofwords426}{\\nofchars2346}{\\nofcharsws2767}{\\vern49167}}{\\*\\xmlnstbl {\\xmlns1 h\nttp://schemas.microsoft.com/office/word/2003/wordml}}\\paperw12240\\paperh15840\\margl1800\\margr1800\\margt1440\\margb1440\\gutter0\\ltrsect \n\\deftab709\\widowctrl\\ftnbj\\aenddoc\\hyphhotz425\\trackmoves0\\trackformatting1\\donotembedsysfont0\\relyonvml0\\donotembedlingdata1\\grfdocevents0\\validatexml0\\showplaceholdtext0\\ignoremixedcontent0\\saveinvalidxml0\\showxmlerrors0\\horzdoc\\dghspace120\\dgvspace120\n\\dghorigin1701\\dgvorigin1984\\dghshow0\\dgvshow3\\jcompress\\viewkind1\\viewscale100\\rsidroot4880538 \\fet0{\\*\\wgrffmtfilter 2450}\\ilfomacatclnup0\\ltrpar \\sectd \\ltrsect\\sbknone\\linex0\\sectdefaultcl\\sftnbj {\\*\\pnseclvl1\\pnucrm\\pnstart1\\pnindent720\\pnhang \n{\\pntxta .}}{\\*\\pnseclvl2\\pnucltr\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl3\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxta .}}{\\*\\pnseclvl4\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxta )}}{\\*\\pnseclvl5\\pndec\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}\n{\\pntxta )}}{\\*\\pnseclvl6\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl7\\pnlcrm\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl8\\pnlcltr\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl9\n\\pnlcrm\\pnstart1\\pnindent720\\pnhang {\\pntxtb (}{\\pntxta )}}\\pard\\plain \\ltrpar\\qc \\li0\\ri0\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0 \\rtlch\\fcs1 \\af0\\afs24\\alang1025 \\ltrch\\fcs0 \n\\fs24\\lang1036\\langfe255\\loch\\af0\\hich\\af0\\dbch\\af31505\\cgrid\\langnp1036\\langfenp255 {\\rtlch\\fcs1 \\ab\\af0 \\ltrch\\fcs0 \\b\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid4531012 \\hich\\af0\\dbch\\af31505\\loch\\f0 Ultra-Modern UI }{\\rtlch\\fcs1 \\ab\\af0 \n\\ltrch\\fcs0 \\b\\lang1033\\langfe255\\langnp1033\\insrsid7804262 \\hich\\af0\\dbch\\af31505\\loch\\f0 Informations}{\\rtlch\\fcs1 \\ab\\af0 \\ltrch\\fcs0 \\b\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid4531012 \n\\par }\\pard \\ltrpar\\qj \\li0\\ri0\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0\\pararsid924724 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid4531012 \n\\par \n\\par }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 The }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid6518900\\charrsid924724 \n\\hich\\af0\\dbch\\af31505\\loch\\f0 Ultra-Modern}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 \n User Interface is a new interface with a style like the most recent installers for NSIS }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid6168175\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 3}{\\rtlch\\fcs1 \\af0\\afs20 \n\\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0  (Nullsoft Scriptable Install System) x86 edition, \\hich\\af0\\dbch\\af31505\\loch\\f0 \nthe tool that allows programmers to create such installers for Windows. Ultra-Modern UI and NSIS are released under an open source license.\n\\par \n\\par \\hich\\af0\\dbch\\af31505\\loch\\f0 The }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid6518900\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 Ultra-Modern}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0  User Interface also features new pages (Confirm, Abort, AlternativeStartMenu, AdditionalTasks, Info\\hich\\af0\\dbch\\af31505\\loch\\f0 \nrmation, Maintenance, Update, SetupType, Serial Number...).\n\\par \n\\par \\hich\\af0\\dbch\\af31505\\loch\\f0 Ultra-Modern UI include also Modern UIEx. Modern UIEx is the same User Interface as the original Modern UI style but with the support of the new Ultra}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid2833028 -}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 Modern pages.\n\\par \n\\par \\hich\\af0\\dbch\\af31505\\loch\\f0 Using the Ultra-Modern UI macros and\\hich\\af0\\dbch\\af31505\\loch\\f0  language files, writing scripts with a}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13071767\\charrsid924724 \n\\hich\\af0\\dbch\\af31505\\loch\\f0 n }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid6518900\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 ultra-modern}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0  interface is easy. }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid924724\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nA lot of examples are available}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang9\\langfe255\\langnp9\\insrsid924724\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0  to show the different features}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid924724\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0  and the}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0  document}{\n\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid924724\\charrsid924724 \\hich\\af0\\dbch\\af31505\\loch\\f0 ation}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid924724 \n\\hich\\af0\\dbch\\af31505\\loch\\f0  contains all information about writing Ultra-Modern UI scripts and a reference of all settings.\n\\par }\\pard \\ltrpar\\ql \\li0\\ri0\\nowidctlpar\\wrapdefault\\faauto\\rin0\\lin0\\itap0\\pararsid924724 {\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid8088776 \n\\par }{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5582561\\charrsid4531012 \n\\par }{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid4531012\\charrsid4531012 \\hich\\af0\\dbch\\af31505\\loch\\f0 Wh\\hich\\af0\\dbch\\af31505\\loch\\f0 at\\hich\\f0 \\rquote \\loch\\f0 s new in }{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \n\\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid4531012 \\hich\\af0\\dbch\\af31505\\loch\\f0 Ultra-Modern UI}{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid4531012\\charrsid4531012 \\hich\\af0\\dbch\\af31505\\loch\\f0  }{\\rtlch\\fcs1 \n\\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5376604\\charrsid4531012 \\hich\\af0\\dbch\\af31505\\loch\\f0 version}{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5376604 \n\\hich\\af0\\dbch\\af31505\\loch\\f0  }{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid4531012\\charrsid4531012 \\hich\\af0\\dbch\\af31505\\loch\\f0 2.0?}{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \n\\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid11944112\\charrsid4531012 \n\\par }{\\rtlch\\fcs1 \\ab\\af0\\afs20 \\ltrch\\fcs0 \\b\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid4531012\\charrsid4531012 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid15076262 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nUltra-Modern UI is now fully compatible with NSIS version 3 x86 edition and now with the large string special build;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}\\hich\\af0\\dbch\\af31505\\loch\\f0 The NSISArray }{\\rtlch\\fcs1 \\af0\\afs20 \n\\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13314899 \\hich\\af0\\dbch\\af31505\\loch\\f0 plug-in}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 \n was replaced by the new nsArray }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13314899 \\hich\\af0\\dbch\\af31505\\loch\\f0 plug-in}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0  in version 1.1.1.7 who\\hich\\af0\\dbch\\af31505\\loch\\f0  is faster and uses less memory;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}\\hich\\af0\\dbch\\af31505\\loch\\f0 Updated the InstallOptionsEx }{\n\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13314899 \\hich\\af0\\dbch\\af31505\\loch\\f0 plug-in}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \n\\hich\\af0\\dbch\\af31505\\loch\\f0  to version 2.4.5 beta 3 with full unicode support;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid5271675 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 Updated the SkinnedControls \n}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13314899 \\hich\\af0\\dbch\\af31505\\loch\\f0 plug-in}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \n\\hich\\af0\\dbch\\af31505\\loch\\f0  to version }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid7224958 \\hich\\af0\\dbch\\af31505\\loch\\f0 1.4}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0  }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5643586\\charrsid5643586 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nwith support of the new NSIS plug-in API}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5643586 \\hich\\af0\\dbch\\af31505\\loch\\f0 , }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5271675\\charrsid5271675 \\hich\\af0\\dbch\\af31505\\loch\\f0 ignore case parameters name support}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid7224958 \\hich\\af0\\dbch\\af31505\\loch\\f0 , }\n{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 unicode support, rewritten documentation and button image size are no more limited to allow smoother gradients;}{\n\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid5721768\\charrsid5721768 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid5721768 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nSeveral new and completed language files and other minor fixes:}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li1440\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\ilvl1\\rin0\\lin1440\\itap0\\pararsid9659968 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 C}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ompleted}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 :}{\\rtlch\\fcs1 \\af0\\afs20 \n\\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0  }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nGerman language file }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 b}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \n\\hich\\af0\\dbch\\af31505\\loch\\f0 y }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nGreek language file by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nItalian language file by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nLithuanian language file by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nRussian language file by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nSlovenian language file by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nSpanish language file by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 Turkish language file}{\n\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0  by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \n\\hich\\af0\\dbch\\af31505\\loch\\f0 Bodenseematze}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f3\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9833050\\charrsid9833050 \\loch\\af3\\dbch\\af31505\\hich\\f3 \\'b7\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9833050\\charrsid9833050 \\hich\\af0\\dbch\\af31505\\loch\\f0 New: }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 Bulgarian language file}{\n\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968 \\hich\\af0\\dbch\\af31505\\loch\\f0  by }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9659968\\charrsid9659968 \n\\hich\\af0\\dbch\\af31505\\loch\\f0 Angel}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid5721768\\charrsid12264924 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid15076262 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nThe information page is now compatible with UTF16LE text files if compiled in Unicode;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid13251023 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nThe information page is now compatible with Unix style (LF only) line return text files;}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023\\charrsid13251023 \\hich\\af0\\dbch\\af31505\\loch\\f0  }{\\rtlch\\fcs1 \\af0\\afs20 \n\\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid13251023\\charrsid6518900 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid15076262 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023\\charrsid6518900 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nThe UMUI_CUSTOM_SKIN define is now deprecated, it is no more necessary and \\hich\\af0\\dbch\\af31505\\loch\\f0 you can simply use the UMUI_SKIN define with your custom skin;}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0  }{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}\\hich\\af0\\dbch\\af31505\\loch\\f0 \nAll button image was recreated with smoother gradient;}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid13251023\\charrsid13251023 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid13251023 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023\\charrsid13251023 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nReduced weight of skin images;}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid13251023\\charrsid13251023 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023\\charrsid13251023 \\hich\\af0\\dbch\\af31505\\loch\\f0 Updated and completed documentation;}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid13251023\\charrsid12264924 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 Added an example for nsDialogs based custom page and documentation;}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid6518900\\charrsid12264924 \n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid15076262 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 \nThe default install directory for the NSIS + Ultra-Modern UI package is now C:\\\\ProgramData on Windows Vista and upper to allow examples to be compiled without access rights errors;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid12264924\\charrsid12264924 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}}\\pard \\ltrpar\n\\ql \\fi-360\\li720\\ri0\\nowidctlpar\\wrapdefault\\faauto\\ls4\\rin0\\lin720\\itap0\\pararsid9052808 {\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid12264924\\charrsid12264924 \\hich\\af0\\dbch\\af31505\\loch\\f0 A lot\n\\hich\\af0\\dbch\\af31505\\loch\\f0  of bug fixes and optimizations}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9052808\\charrsid9052808 \\hich\\af0\\dbch\\af31505\\loch\\f0 ;\n\\par {\\listtext\\pard\\plain\\ltrpar \\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\f2\\fs20\\lang1033\\langfe255\\langnp1033\\langfenp255\\insrsid9052808\\charrsid9052808 \\hich\\af2\\dbch\\af31505\\loch\\f2 o\\tab}\\hich\\af0\\dbch\\af31505\\loch\\f0 Source code now on GitHub}{\\rtlch\\fcs1 \n\\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9067496 \\hich\\af0\\dbch\\af31505\\loch\\f0 :}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid3233238 \\hich\\af0\\dbch\\af31505\\loch\\f0  }{\\rtlch\\fcs1 \\af0\\afs20 \n\\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9052808\\charrsid3233238 \\hich\\af0\\dbch\\af31505\\loch\\f0 https://github.com/SuperPat45/UltraModernUI}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \n\\fs20\\lang1033\\langfe255\\langnp1033\\insrsid9052808\\charrsid9052808 .}{\\rtlch\\fcs1 \\af0\\afs20 \\ltrch\\fcs0 \\fs20\\lang1033\\langfe255\\langnp1033\\insrsid8343545\\charrsid4531012 \n\\par }{\\*\\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a\n9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad\n5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6\nb01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0\n0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6\na7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f\nc7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512\n0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462\na1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865\n6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b\n4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b\n4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100b18954f3ac060000a51b0000160000007468656d652f7468656d652f\n7468656d65312e786d6cec594f6f1b4514bf23f11d467b6f6327761a4775aad8b11b68d346b15bd4e37877bc3bcdecce6a669cd437d41e9190100571a0123790\n1050a995b894131f25500445ea57e0cdccee7a275e93a48da082e6d0dab3bf79ffdf6fdeac2f5fb91733744084a43c697bf58b350f91c4e7014dc2b6776bd8bf\nb0e621a9701260c613d2f6a6447a5736de7de7325e5711890982fd895cc76d2f522a5d5f5a923e2c637991a7248167632e62ace0ab089702810f416ecc96966b\nb5d5a518d3c443098e41ec30faf91b1076733ca63ef13672e93d062a1225f582cfc440cb26d9961236d8af6b849cca2e13e800b3b6078a027e3824f794871896\n0a1eb4bd9af9f396362e2fe1f56c13530bf696f6f5cd5fb62fdb10ec2f1b9d221c154aebfd46ebd25621df00989ac7f57abd6eaf5ec83300ecfbe0a9b5a52cb3\nd15fab7772992590fd382fbb5b6bd61a2ebe247f65cee656a7d369b6325bac5003b21f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0\nfd4badd5868b37a088d1647f0ead13daef67d20bc898b3ed4af81ac0d76a197c86826a28aa4bab18f3442daab518dfe5a20f000d6458d104a9694ac6d88732ee\ne2782428d60af03ac1a52776c997734b5a1792bea0a96a7befa7185a6226efe5b3ef5e3e7b828eee3f3dbaffe3d1830747f77fb0829c5ddb3809cbbb5e7cfdc9\n9f8f3e447f3cf9eac5c3cfaaf1b28cfff5fb8f7ef9e9d36a20b4cfcc9ce79f3ffeede9e3e75f7cfcfbb70f2be09b028fcaf0218d894437c821dae3313866a2e2\n5a4e46e26c3b8611a6e51d9b49287182b5960af93d1539e81b53ccb2ec387674881bc1db02e8a30a787572d73178108989a2159aaf45b103dce19c75b8a88cc2\n35adab14e6e12409ab958b4919b787f14195ee2e4e9cfcf62629f0665e968ee3dd883866ee329c281c928428a49ff17d422abcbb43a913d71dea0b2ef958a13b\n147530ad0cc9908e9c6a9a6ddaa631e4655ae533e4db89cdce6dd4e1accaeb2d72e022a12b30ab307e489813c6ab78a2705c25728863560ef875aca22a230753\ne197713da920d321611cf5022265d59e9b02fc2d25fd1a06c6aa4cfb0e9bc62e5228ba5f25f33ae6bc8cdce2fbdd08c76915764093a88c7d4fee438962b4cb55\n157c87bb1da2bf431e70b230ddb72971d27d321bdca2a163d2ac40f49389a8c8e555c29dfa1d4cd91813433540ea0e57c734f93be2661498db6a383fe206aa7c\nfee5a30abbdf54cade84d3abaa67b68f11f522dc717aee7211d0379f9db7f024d925d010f347d45b727e4bcede7f9e9c17f5f3f953f28c8581a0f52c62076d33\n76c70ba7ee31656ca0a68c5c9766f09670f6047d58d4fbcc959314b7b034828fba934181830b05367b90e0ea03aaa241845318daeb9e1612ca4c742851ca255c\n16cd72a56c8d87c15fd9ab66535f422c7348ac7678609757f4727ed728c418ab4273a1cd15ad6801a755b67229130abebd8ab2ba36ead4daeac634438a8eb6c2\n651d627329879017aec162114d186a108c4210e555b8f46bd570d9c18c043aee3647795a4c16ce334532c201c972a4fd9ecf51dd2429af953947b41fb618f4c5\nf184a895b4b5b4d8d7d0769a2495d53516a8cbb3f73a59ca2b7896259076bc1d59526e4e96a0c3b6d76a2e373de4e3b4ed8de19e0c1fe314b22ef51c8959086f\n9b7c256cd99fd8cca6cb67d96ce58eb94d5087571f36ee730e3b3c900aa9b6b08c6c6998475909b0446bb2f62f3721ace7e540051b9dce8a953528867fcd0a88\na39b5a321e135f95935d5ad1b1b35f332ae51345c4200a0ed1884dc41e86f4eb52057f022ae175876104fd05decde9689b472e39674d577e236670761db334c2\n19ddea16cd3bd9c20d211536986f25f3c0b74adb8d736777c5b4fc39b9522ee3ff992bfa3c81b70f2b81ce800fef860546ba53da1e172ae2c0426944fdbe80c1\nc17007540bbcdf85c75054f086dafc2fc881fedff69c9561da1a2e916a8f864850388f542408d9055a32d57782b07a767659912c13642aaa64ae4cadd9237240\nd85073e0aa3edb3d1441a91b36c968c0e08ed79ffb3deba051a8879c72bf394c569cbdb607fee9c9c7363338e5f2b01968f2f8172616e3c1ec54b5fbcdf6fcec\n2d3ba21fccc6ac46de15a0ac7414b4b2b67f4513ce78d45ac69af378b9991b07599cf718168b812885774848ff03e71f153eb3bf76e80375c8f7805b11fc78a1\n8541d940555fb08307d2046917473038d9455b4c5a940d6d363ae9a8e587f5394fba85de63c1d6969d26df670c76319cb9ea9c5e3ccf60671176626dd716861a\n327bbc4561699c5f644c62ccef64e55fb2f8e82e247a0b7e339830254d31c1ef5402c30c3d307d00cd6f359aad1b7f010000ffff0300504b0304140006000800\n000021000dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2\n301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e40\n52164e89d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62\n107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d00140006000800000021\n00e9de0fbfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d001400060008000000\n2100a5d6a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b79961683\n0000008a0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008\n0000002100b18954f3ac060000a51b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d0014\n0006000800000021000dd1909fb60000001b0100002700000000000000000000000000b60900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000b10a00000000}\n{\\*\\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d\n617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169\n6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363\n656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}\n{\\*\\latentstyles\\lsdstimax267\\lsdlockeddef0\\lsdsemihiddendef1\\lsdunhideuseddef1\\lsdqformatdef0\\lsdprioritydef99{\\lsdlockedexcept \\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority0 \\lsdlocked0 Normal;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 1;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 2;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 3;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 4;\n\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 5;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 6;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 7;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 8;\\lsdqformat1 \\lsdpriority9 \\lsdlocked0 heading 9;\n\\lsdpriority39 \\lsdlocked0 toc 1;\\lsdpriority39 \\lsdlocked0 toc 2;\\lsdpriority39 \\lsdlocked0 toc 3;\\lsdpriority39 \\lsdlocked0 toc 4;\\lsdpriority39 \\lsdlocked0 toc 5;\\lsdpriority39 \\lsdlocked0 toc 6;\\lsdpriority39 \\lsdlocked0 toc 7;\n\\lsdpriority39 \\lsdlocked0 toc 8;\\lsdpriority39 \\lsdlocked0 toc 9;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdlocked0 caption;\\lsdunhideused0 \\lsdlocked0 List;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority10 \\lsdlocked0 Title;\n\\lsdpriority1 \\lsdlocked0 Default Paragraph Font;\\lsdunhideused0 \\lsdlocked0 Body Text;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority11 \\lsdlocked0 Subtitle;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority22 \\lsdlocked0 Strong;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority20 \\lsdlocked0 Emphasis;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority59 \\lsdlocked0 Table Grid;\\lsdunhideused0 \\lsdlocked0 Placeholder Text;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority1 \\lsdlocked0 No Spacing;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority60 \\lsdlocked0 Light Shading;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority61 \\lsdlocked0 Light List;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority62 \\lsdlocked0 Light Grid;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority63 \\lsdlocked0 Medium Shading 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority64 \\lsdlocked0 Medium Shading 2;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority65 \\lsdlocked0 Medium List 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority66 \\lsdlocked0 Medium List 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority67 \\lsdlocked0 Medium Grid 1;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority68 \\lsdlocked0 Medium Grid 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority69 \\lsdlocked0 Medium Grid 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority70 \\lsdlocked0 Dark List;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority71 \\lsdlocked0 Colorful Shading;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority72 \\lsdlocked0 Colorful List;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority73 \\lsdlocked0 Colorful Grid;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority60 \\lsdlocked0 Light Shading Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority61 \\lsdlocked0 Light List Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority62 \\lsdlocked0 Light Grid Accent 1;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 1;\n\\lsdunhideused0 \\lsdlocked0 Revision;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority34 \\lsdlocked0 List Paragraph;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority29 \\lsdlocked0 Quote;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority30 \\lsdlocked0 Intense Quote;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 1;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority70 \\lsdlocked0 Dark List Accent 1;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority72 \\lsdlocked0 Colorful List Accent 1;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 1;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority60 \\lsdlocked0 Light Shading Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority61 \\lsdlocked0 Light List Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority62 \\lsdlocked0 Light Grid Accent 2;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 2;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 2;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority70 \\lsdlocked0 Dark List Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 2;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority72 \\lsdlocked0 Colorful List Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 2;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority60 \\lsdlocked0 Light Shading Accent 3;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority61 \\lsdlocked0 Light List Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority62 \\lsdlocked0 Light Grid Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 3;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 3;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 3;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority70 \\lsdlocked0 Dark List Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority72 \\lsdlocked0 Colorful List Accent 3;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 3;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority60 \\lsdlocked0 Light Shading Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority61 \\lsdlocked0 Light List Accent 4;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority62 \\lsdlocked0 Light Grid Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 4;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 4;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority70 \\lsdlocked0 Dark List Accent 4;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority72 \\lsdlocked0 Colorful List Accent 4;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 4;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority60 \\lsdlocked0 Light Shading Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority61 \\lsdlocked0 Light List Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority62 \\lsdlocked0 Light Grid Accent 5;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 5;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 5;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority70 \\lsdlocked0 Dark List Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 5;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority72 \\lsdlocked0 Colorful List Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 5;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority60 \\lsdlocked0 Light Shading Accent 6;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority61 \\lsdlocked0 Light List Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority62 \\lsdlocked0 Light Grid Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority63 \\lsdlocked0 Medium Shading 1 Accent 6;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority64 \\lsdlocked0 Medium Shading 2 Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority65 \\lsdlocked0 Medium List 1 Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority66 \\lsdlocked0 Medium List 2 Accent 6;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority67 \\lsdlocked0 Medium Grid 1 Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority68 \\lsdlocked0 Medium Grid 2 Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority69 \\lsdlocked0 Medium Grid 3 Accent 6;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority70 \\lsdlocked0 Dark List Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority71 \\lsdlocked0 Colorful Shading Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority72 \\lsdlocked0 Colorful List Accent 6;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdpriority73 \\lsdlocked0 Colorful Grid Accent 6;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority19 \\lsdlocked0 Subtle Emphasis;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority21 \\lsdlocked0 Intense Emphasis;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority31 \\lsdlocked0 Subtle Reference;\n\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority32 \\lsdlocked0 Intense Reference;\\lsdsemihidden0 \\lsdunhideused0 \\lsdqformat1 \\lsdpriority33 \\lsdlocked0 Book Title;\\lsdpriority37 \\lsdlocked0 Bibliography;\n\\lsdqformat1 \\lsdpriority39 \\lsdlocked0 TOC Heading;}}{\\*\\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000\nd0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nfffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000002091\n4c48a35bd201feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000\n00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000\n000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000\n0000000000000000000000000000000000000000000000000105000000000000}}"
  },
  {
    "path": "setup/nsis/tools/Docs/UltraModernUI/ReadMe.txt",
    "content": "\n    Ultra-Modern UI Informations\n    ============================\n\n\nThe Ultra-Modern User Interface is a new interface with a style like the most recent installers for NSIS 3 (Nullsoft Scriptable Install System) x86 edition, the tool that allows programmers to create such installers for Windows. Ultra-Modern UI and NSIS are released under an open source license.\n\nThe Ultra-Modern User Interface also features new pages (Confirm, Abort, AlternativeStartMenu, AdditionalTasks, Information, Maintenance, Update, SetupType, Serial Number...).\n\nUltra-Modern UI include also Modern UIEx. Modern UIEx is the same User Interface as the original Modern UI style but with the support of the new Ultra-Modern pages.\n\nUsing the Ultra-Modern UI macros and language files, writing scripts with an ultra-modern interface is easy. A lot of examples are available to show the different features and the documentation contains all information about writing Ultra-Modern UI scripts and a reference of all settings.\n\n\nWhat's new in Ultra-Modern UI version 2.0?\n------------------------------------------\n\n  o  Ultra-Modern UI is now fully compatible with NSIS version 3 x86 edition and now with the large string special build;\n  o  The NSISArray plug-in was replaced by the new nsArray plug-in in version 1.1.1.7 who is faster and uses less memory;\n  o  Updated the InstallOptionsEx plug-in to version 2.4.5 beta 3 with full unicode support;\n  o  Updated the SkinnedControls plug-in to version 1.4 with support of the new NSIS plug-in API, ignore case parameters name support, unicode support, rewritten documentation and button image size are no more limited to allow smoother gradients;\n  o  Several new and completed language files and other minor fixes:\n      * Completed: German language file by Bodenseematze;\n      * New: Greek language file by Bodenseematze;\n      * New: Italian language file by Bodenseematze;\n      * New: Lithuanian language file by Bodenseematze;\n      * New: Russian language file by Bodenseematze;\n      * New: Slovenian language file by Bodenseematze;\n      * New: Spanish language file by Bodenseematze;\n      * New: Turkish language file by Bodenseematze;\n      * New: Bulgarian language file by Angel;\n  o  The information page is now compatible with UTF16LE text files if compiled in Unicode;\n  o  The information page is now compatible with Unix style (LF only) line return text files;\n  o  The UMUI_CUSTOM_SKIN define is now deprecated, it is no more necessary and you can simply use the UMUI_SKIN define with your custom skin;\n  o  All button image was recreated with smoother gradient;\n  o  Reduced weight of skin images;\n  o  Updated and completed documentation;\n  o  Added an example for nsDialogs based custom page and documentation;\n  o  The default install directory for the NSIS + Ultra-Modern UI package is now C:\\ProgramData on Windows Vista and upper to allow examples to be compiled without access rights errors;\n  o  A lot of bug fixes and optimizations;\n  o  Source code now on GitHub: https://github.com/SuperPat45/UltraModernUI.\n  "
  },
  {
    "path": "setup/nsis/tools/Docs/UltraModernUI/Readme.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\n  <meta content=\"SuperPat\" name=\"author\" />\n  <meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\" />\n\n  <link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\n\n  <script type=\"text/javascript\" src=\"script.js\"></script>\n\n  <title>NSIS Ultra-Modern User Interface</title>\n\n</head>\n\n<body>\n\n  <div class=\"maintable\">\n\n  <a target=\"_blank\" href=\"http://ultramodernui.sourceforge.net/\" title=\"Go to the NSIS Ultra-Modern User Interface home page\"><img src=\"images/header.png\" alt=\"NSIS Ultra-Modern User Interface\" /></a>\n\n  <p class=\"options\"><a onclick=\"loadSlider();expandall();\">[Expand all]</a>&nbsp;&nbsp;<a onclick=\"collapseall();\">[Collapse all]</a></p>\n\n  <div>\n\n    <img class=\"smallScreen\" src=\"images/SmallScreen.png\" alt=\"\" />\n\n    <h1>Introduction</h1>\n\n    <div style=\"text-align: justify;\">\n      <p>The Ultra-Modern User Interface is a new interface with a style like the most recent installers for NSIS 3 (Nullsoft Scriptable Install System) x86 edition, the tool that allows programmers to create such installers for Windows. Ultra-Modern UI and NSIS are released under an open source license.</p>\n      <p>The Ultra-Modern User Interface also features new pages (Confirm, Abort, AlternativeStartMenu, AdditionalTasks, Information, Maintenance, Update, SetupType...). The interface and the graphics can be customized using the provided settings and the new skins system. </p>\n      <p>Ultra-Modern UI include also an other User Interface named Modern UIEx. Modern UIEx is the same User Interface as the original Modern UI style but with the support of the new ultra-modern pages and with a little more options.</p>\n      <p>Using the Ultra-Modern UI macros and language files, writing scripts with a ultra-modern interface is easy. A lot of examples are available to show the different features and this document contains all information about writing Ultra-Modern UI scripts and a reference of all settings.</p>\n      <p>The issue of Ultra-Modern UI is to be the most compatible with the existing Modern UI scripts. Because of it is based on the Modern UI of Joost Verburg, it use the same macro a define and provide new one. The new macro and define use the prefix UMUI_ instead of MUI_.</p>\n      <p>Please be aware that the Ultra-Modern UI and the Modern UI interfaces settings are different compared to the classic interface. This means that you should not use settings like LicenseText, Icon, CheckBitmap, InstallColors etc. but the ones that are documented here.</p>\n      <p>Ultra-Modern UI include three NSIS plug-ins:</p>\n      <ul>\n        <li><a target=\"_blank\" href=\"../SkinnedControls/Readme.html\">SkinnedControls</a>: a plug-in, natively integrated to Ultra-Modern UI, to skin all buttons and scroll bars of your installer;</li>\n        <li><a target=\"_blank\" href=\"../InstallOptionsEx/Readme.html\">InstallOptionsEx</a>: an extension, natively integrated to Ultra-Modern UI, of the original <a target=\"_blank\" href=\"../InstallOptions/Readme.html\">InstallOptions</a> plug-in with more feature to create custom pages;</li>\n        <li><a target=\"_blank\" href=\"../nsArray/Readme.txt\">nsArray</a>: needed by some Ultra-Modern UI features, provide less out-of-the-box arrays and map features.</li>\n      </ul>\n\n      <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_screenshots\" src=\"images/closed.gif\" onclick=\"loadSlider();toggle('trigger_screenshots', 'toggle_screenshots');\" /> Screenshots</h3>\n      <div class=\"toggle\" id=\"toggle_screenshots\">\n\n        <div id=\"sliderFrame\">\n            <div id=\"slider\">\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI01.png\" alt=\"Multi language page with default skin\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI02.png\" alt=\"Welcome page with blue skin with alternative text and alternative style options\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI03.png\" alt=\"Maintenance page with blue2 skin with page background image option\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI04.png\" alt=\"Update page with SoftBlue skin with page background image option\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI05.png\" alt=\"License page with SoftRed skin\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI06.png\" alt=\"Information page in RTF file with SoftBrown skin\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI07.png\" alt=\"Setup type page\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI08.png\" alt=\"Directory page with unique background image option\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI09.png\" alt=\"Alternative start menu page with TreeView\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI10.png\" alt=\"Additional tasks page with green skin\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI11b.png\" alt=\"Installer confirm page with red skin\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUI12.png\" alt=\"Abort page\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUINoLeftImage01.png\" alt=\"License page with the no left image option\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUINoLeftImage02.png\" alt=\"Directory page with the no left image option with SoftBule skin\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUISmall01.png\" alt=\"Welcome page with the small page option\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/UMUISmall02.png\" alt=\"Directory page with the small page option\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/MUIEx01.png\" alt=\"Multi language page with the Modern UIEx interface\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/MUIEx02.png\" alt=\"Setup type page with the Modern UIEx interface\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/MUIEx03.png\" alt=\"Additional tasks page with the Modern UIEx interface\" />\n                <img data-src=\"http://ultramodernui.sourceforge.net/images/screenshots/MUIEx04.png\" alt=\"Serial number page with the Modern UIEx interface\" />\n            </div>\n        </div>\n\n      </div>\n\n      <p>The colors, that are used in this document, correspond to the differences between Ultra-Modern UI / Modern UIEx and the original Modern UI:</p>\n      <ul>\n        <li><strong>BLACK:</strong>&nbsp; macro and define that were the same;</li>\n        <li><span class=\"red\"><strong>RED:</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;macro and define that were removed;</li>\n        <li><span class=\"blue\"><strong>BLUE:</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;macro and define that were added;</li>\n        <li><span class=\"purple\"><strong>PURPLE:</strong></span>&nbsp;macro and define that were modified.</li>\n      </ul>\n\n    </div>\n\n    <h1>Writing Ultra-Modern UI Scripts</h1>\n\n    <div style=\"text-align: justify;\">\n      <p>The Ultra-Modern UI has a macro system, so all the code to control the interface has already been written for you.</p>\n      <p>If you want to start a new Ultra-Modern UI script or upgrade an older script with the Modern UI or Classic UI, follow the steps below.</p>\n      <p>Taking a look at the <a href=\"#examples\">example scripts</a> will also help you to learn more about the Ultra-Modern UI.</p>\n\n      <h2>Syntax</h2>\n      <div>\n        <p>Some defines (e.g. MUI_COMPONENTSPAGE_SMALLDESC) don't need a value, they are true/false settings. Others (e.g. MUI_UI) can be used to define a specific value.</p>\n        <p>Parameters are specified in this format: <span class=\"parameter\">required (option1 | option2) [optional]</span></p>\n        <p>Parameters for defined settings should be in one string:</p>\n        <pre>!define MUI_COMPONENTSPAGE_SMALLDESC ;No value<br />!define MUI_UI \"myUI.exe\" ;Value<br />!define MUI_INSTFILESPAGE_COLORS \"FFFFFF 000000\" ;Multiple settings<br /></pre>\n        <p>If you want a certain value (e.g. a text) to be language-specific, set a language string (using LangString) and define $(STRINGNAME) as value. Use a license language string (LicenseLangString) for the license text.</p>\n        <p>If you want to add \" to a Modern UI string, you should always escape it using $\\\" because the Modern UI macros use \" to separate parameters.</p>\n      </div>\n\n\n      <h2>1. Header file</h2>\n      <div>\n\n        <p>If you want to upgrade your Modern UI script to the Ultra-Modern style, simply replace the line:</p>\n        <pre>!include \"MUI.nsh\"</pre>\n        <p>in your script by this one:</p>\n        <pre><span class=\"purple\">!include \"UMUI.nsh\"</span></pre>\n        <p>Or this one if you want to use the Modern UIEx style (The extended version of Modern UI but with the support of the new Ultra-Modern pages):</p>\n        <pre><span class=\"purple\">!include \"MUIEx.nsh\"</span></pre>\n\n        <p>UMUI.nsh and MUIEx.nsh are in the Include directory, so you don't have to specify a path.</p>\n\n        Warning, if you use the .onGuiEnd or un.onGuiEnd functions in your script, <a href=\"#customFunctions\">see this link</a>\n      </div>\n\n\n      <h2><a id=\"interfaceConf\">2. Interface Configuration</a></h2>\n      <div>\n\n        <p>Interface settings should be set before inserting page macros. Page interface settings apply to all pages of a certain type.</p>\n        <p>There are some difference between UMUI and MUIEx defined in particular on the default values:</p>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_in\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_in', 'toggle_umui_in');\" /> Interface Settings for Ultra-Modern UI</h3>\n        <div class=\"toggle\" id=\"toggle_umui_in\">\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_ac\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_ac', 'toggle_umui_ac');\" /> Skin Setting</h3>\n        <div class=\"toggle\" id=\"toggle_umui_ac\">\n\n          <p><span class=\"blue\"><strong>UMUI_SKIN</strong></span> <span class=\"parameter\">skin_name</span><br />\n          Use a skin. It contain a lot of interface settings defines. You can change a setting to redefining it.<br />\n          You can also use a custom skin not included in the default skin folders. It can contain all the Interface Setting defines you need.<br />\n          <span class=\"blue\"><em>Default: none</em></span></p>\n\n          <p><em style=\"font-style: normal;\">Example of the \"blue\" skin:</em></p>\n<pre>!define /IfNDef MUI_TEXTCOLOR FFFFFF\n!define /IfNDef MUI_BGCOLOR 4C72B2\n!define /IfNDef UMUI_TEXT_LIGHTCOLOR FFFF00\n!define /IfNDef UMUI_HEADERTEXT_COLOR FFFFFF\n!define /IfNDef UMUI_BRANDINGTEXTFRONTCOLOR 8b8ca4\n!define /IfNDef UMUI_BRANDINGTEXTBACKCOLOR eeeef3\n!define /IfNDef UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n!define /IfNDef UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n!define /IfNDef UMUI_BUTTON_TEXT_COLOR 000000\n!define /IfNDef UMUI_LEFTIMAGE_BMP \\\n    \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Left.bmp\"\n!define /IfNDef UMUI_HEADERBGIMAGE_BMP \\\n    \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Header.bmp\"\n!define /IfNDef UMUI_BOTTOMIMAGE_BMP \\\n    \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Bottom.bmp\"\n!define /IfNDef UMUI_BUTTONIMAGE_BMP \\\n    \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button.bmp\"\n!define /IfNDef UMUI_SCROLLBARIMAGE_BMP \\\n    \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\ScrollBar.bmp\"\n!define /IfNDef UMUI_PAGEBGIMAGE_BMP \\\n    \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\PageBG.bmp\"\n!define /IfNDef MUI_WELCOMEFINISHPAGE_BITMAP \\\n    \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Wizard.bmp\"\n!define /IfNDef MUI_ICON \\\n    \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n!define /IfNDef MUI_UNICON \\\n    \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\"</pre>\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_ad\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_ad', 'toggle_umui_ad');\" /> BackGround Skin Setting</h3>\n        <div class=\"toggle\" id=\"toggle_umui_ad\">\n\n          <p><span class=\"blue\"><strong>UMUI_USE_BG</strong></span> <span class=\"parameter\">background_skin_name</span><br />\n          Use a background skin. It contain two macro named \"UMUI_BG\" and \"UMUI_BG_Destroy\".<br />\n          <span class=\"blue\"><em>Default: none</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_USE_CUSTOMBG</strong></span><br />\n          Use a custom background skin. don't forget to create two macro named \"UMUI_BG\" and \"UMUI_BG_Destroy\".</p>\n\n          <p><em style=\"font-style: normal;\">Example of a custom background skin:</em></p>\n\n<pre>!define UMUI_USE_CUSTOMBG\n\n!macro UMUI_BG\n  SetOutPath \"$PLUGINSDIR\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\SpotlightBG.bmp\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\KeyBG.bmp\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\HeaderBG.bmp\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\BtmImgBG.bmp\"\n  BgImage::SetBg /GRADIENT 78 111 214 78 111 214\n  BgImage::AddImage \"$PLUGINSDIR\\HeaderBG.bmp\" 0 0\n  BgImage::AddImage \"$PLUGINSDIR\\SpotlightBG.bmp\" 0 57\n  BgImage::AddImage \"$PLUGINSDIR\\BtmImgBG.bmp\" 0 -70\n  BgImage::AddImage \"$PLUGINSDIR\\KeyBG.bmp\" -248 -351\n  CreateFont $1 \"Verdana\" 30 700\n  BgImage::AddText \"$(^Name)\" $1 8 51 155 15 70 -1 -1\n  BgImage::AddText \"$(^Name)\" $1 255 255 255 10 65 -1 -1\n  BgImage::Redraw\n!macroend\n\n!macro UMUI_BG_Destroy\n  BgImage::Destroy\n!macroend</pre>\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_ingen\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_ingen', 'toggle_umui_ingen');\" /> General Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_ingen\">\n\n          <p><strong>MUI_ICON</strong> <span class=\"parameter\">icon_file</span><br />\n          The icon for the installer.<br />\n          <span class=\"purple\"><em>Default: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Icon.ico</em></span></p>\n\n          <p><strong>MUI_UNICON</strong> <span class=\"parameter\">icon_file</span><br />\n          The icon for the uninstaller.<br />\n          <span class=\"purple\"><em>Default: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico</em></span></p>\n\n          <p><span class=\"red\"><strong>MUI_HEADERIMAGE</strong></span><br />\n          Display an image on the header of the page.</p>\n\n          <div>\n\n            <p><span class=\"red\"><strong>MUI_HEADERIMAGE_BITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n            Bitmap image to display on the header of installers pages (recommended size: 150x57 pixels).<br />\n            <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp</em></p>\n\n            <div>\n              <p><span class=\"red\"><strong>MUI_HEADERIMAGE_BITMAP_NOSTRETCH</strong></span><br />\n              Do not stretch the installer header bitmap to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n\n              <p><span class=\"red\"><strong>MUI_HEADERIMAGE_BITMAP_RTL</strong></span> <span class=\"parameter\">bmp_file</span><br />\n              Bitmap image to display on the header of installers pages when using a RTL language (recommended size: 150x57 pixels).<br />\n              <em>Default: Non-RTL bitmap</em></p>\n\n              <div>\n                <p><span class=\"red\"><strong>MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH</strong></span><br />\n                Do not stretch the installer header bitmap when using a RTL language to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n              </div>\n            </div>\n\n            <p><span class=\"red\"><strong>MUI_HEADERIMAGE_UNBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n            Bitmap image to display on the header of uninstaller pages (recommended size: 150x57 pixels).<br />\n            <em>Default: Installer header bitmap</em></p>\n\n            <div>\n              <p><span class=\"red\"><strong>MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH</strong></span><br />\n              Do not stretch the uninstaller header bitmap to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n\n              <p><span class=\"red\"><strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong></span> <span class=\"parameter\">bmp_file</span><br />\n              Bitmap image to display on the header of uninstallers pages when using a RTL language (recommended size: 150x57 pixels).<br />\n              <em>Default: Installer RTL header bitmap</em></p>\n\n              <div>\n                <p><span class=\"red\"><strong>MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH</strong></span><br />\n                Do not stretch the uninstaller header bitmap when using a RTL language to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n              </div>\n            </div>\n\n            <p><span class=\"red\"><strong>MUI_HEADERIMAGE_RIGHT</strong></span><br />\n            Display the header image on the right side instead of the left side (when using a RTL language it will be displayed on the left side instead of the right side).</p>\n\n          </div>\n\n          <p><strong>MUI_TEXTCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Text color for all the pages.\n          <span class=\"purple\"><em>Default: FFFFFF</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_TEXT_LIGHTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Text color for GroupBox and Link of all the pages.<br />\n          <span class=\"blue\"><em>Default: FFFF00</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_TEXT_INPUTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Text color for input controls (except checkboxes and radio buttons) of all the pages.<br />\n          <span class=\"blue\"><em>Default: 000000</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BGINPUTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Background color for input controls (except checkboxes and radio buttons) of all the pages.<br />\n          <span class=\"blue\"><em>Default: FFFFFF</em></span></p>\n\n          <p><strong>MUI_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Background color for all the pages.<br />\n          <span class=\"purple\"><em>Default: 4C72B2</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BRANDINGTEXTFRONTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Branding text front color for all the pages.<br />\n          <span class=\"blue\"><em>Default: 8b8ca4</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BRANDINGTEXTBACKCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Branding text back color for all the pages.<br />\n          <span class=\"blue\"><em>Default: eeeef3</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_HEADERTEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Header text color for all the pages.<br />\n          <span class=\"blue\"><em>Default: ${MUI_TEXTCOLOR}</em></span></p>\n\n          <p><span class=\"red\"><strong>MUI_HEADER_TRANSPARENT_TEXT</strong></span><br />\n          Set a transparent background for the  header's label controls. Useful for custom user interfaces that set a bigger header image.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_HEADERBGIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to display on the header of installers pages.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Header.bmp</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_LEFTIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to display on the left of installers pages.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Left.bmp</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BOTTOMIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to display on the bottom of installers pages.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\BtmImg.bmp</em></span></p>\n\n          <div>\n            <span class=\"blue\"><strong>UMUI_NOBOTTOMIMAGE</strong></span><br />\n            Don't draw the bottom Image of installers and uninstallers pages.\n          </div>\n\n          <p><span class=\"blue\"><strong>UMUI_UNIQUEBGIMAGE</strong></span><br />\n          Show a single full background image of installer.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_PAGEBGIMAGE</strong></span><br />\n          Show a background image on installers page.</p>\n\n          <div>\n            <p><span class=\"blue\"><strong>UMUI_PAGEBGIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n            Bitmap image for background of installers pages or single full bitmap image of installer.<br />\n            <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\PageBG.bmp</em></span></p>\n          </div>\n\n\n          <p><span class=\"blue\"><strong>UMUI_BUTTONIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all buttons of installer.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button.bmp</em></span></p>\n\n          <div>\n            <span class=\"blue\"><strong>UMUI_NO_BUTTONIMAGE</strong></span><br />\n            Don't skin buttons of installers and uninstaller.\n\n            <p><span class=\"blue\"><strong>UMUI_DISABLED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for disabled buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: 808080</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_SELECTED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for selected buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: 000080</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for normal buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: 000000</em></span></p>\n          </div>\n\n          <p><span class=\"blue\"><strong>UMUI_SCROLLBARIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all scroll bars of installer.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\ScrollBar.bmp</em></span></p>\n\n          <div>\n            <span class=\"blue\"><strong>UMUI_NO_SCROLLBARIMAGE</strong></span><br />\n            Don't skin scroll bars of installer and uninstaller.\n          </div>\n    \n          <p><span class=\"blue\"><strong>UMUI_UNHEADERBGIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to display on the header of uninstallers pages.<br />\n          <span class=\"blue\"><em>Default: ${UMUI_HEADERBGIMAGE_BMP}</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UNLEFTIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to display on the left of uninstallers pages.<br />\n          <span class=\"blue\"><em>Default: ${UMUI_LEFTIMAGE_BMP}</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UNBOTTOMIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to display on the bottom of uninstallers pages.<br />\n          <span class=\"blue\"><em>Default: ${UMUI_BOTTOMIMAGE_BMP}</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UNUNIQUEBGIMAGE</strong></span><br />\n          Show a single full background image of uninstaller.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_UNPAGEBGIMAGE</strong></span><br />\n          Show a background image on uninstallers page.</p>\n\n          <div>\n            <p><span class=\"blue\"><strong>UMUI_UNPAGEBGIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n            Bitmap image for background of uninstallers pages or single full bitmap image of uninstaller.<br />\n            <span class=\"blue\"><em>Default: ${UMUI_PAGEBGIMAGE_BMP}</em></span></p>\n          </div>\n\n          <p><span class=\"blue\"><strong>UMUI_UNBUTTONIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all buttons of uninstaller.<br />\n          <span class=\"blue\"><em>Default: ${UMUI_BUTTONIMAGE_BMP}</em></span></p>\n\n          <div>\n            <p><span class=\"blue\"><strong>UMUI_UNDISABLED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for disabled buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: ${UMUI_DISABLED_BUTTON_TEXT_COLOR}</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_UNSELECTED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for selected buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: ${UMUI_SELECTED_BUTTON_TEXT_COLOR}</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_UNBUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for normal buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: ${UMUI_BUTTON_TEXT_COLOR}</em></span></p>\n          </div>\n\n          <p><span class=\"blue\"><strong>UMUI_UNSCROLLBARIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all scroll bars of uninstaller.<br />\n          <span class=\"blue\"><em>Default: ${UMUI_SCROLLBARIMAGE_BMP}</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BRANDINGTEXTFRONTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          The front color of the bottom text. Use the BrandingText instruction to replace the default text.<br />\n          <span class=\"blue\"><em>Default: 8B8CA4</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BRANDINGTEXTBACKCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          The back color of the bottom text. It is shifted in comparison with the front text of one pixel to right and down below in order to give relief.<br />\n          <span class=\"blue\"><em>Default: EEEEF3</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_XPSTYLE</strong></span> <span class=\"parameter\">(On/Off)</span><br />\n          Sets whether or not a XP visual style manifest will be added to the installer. This manifest makes the installers controls use the new visual styles when running on Windows XP and later. This affects the uninstaller too.<br />\n          <span class=\"blue\"><em>Default: Off</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_ULTRAMODERN_SMALL</strong></span><br />\n          Use a small interface having the same size as Modern UI but with ultra-modern graphics.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_NOLEFTIMAGE</strong></span><br />\n          User an interface without the left image.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inres\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inres', 'toggle_umui_inres');\" /> Interface Resource Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inres\">\n\n          <p><span class=\"purple\"><strong>UMUI_UI</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface file with the dialog resources when the <strong>UMUI_ULTRAMODERN_SMALL</strong> option not defined. Change this if you have made your own customized UI.<br />\n          The MUI_UI define has been renamed in Ultra-Modern UI in order to assure the compatibility with the former Modern UI scripts.<br />\n          <span class=\"purple\"><em>Default: ${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern.exe</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UI_SMALL</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface file with the dialog resources when the <strong>UMUI_ULTRAMODERN_SMALL</strong> option defined. Change this if you have made your own customized UI.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_small.exe</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UI_NOLEFTIMAGE</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface file with the dialog resources IDD_INST when the <strong>UMUI_NOLEFTIMAGE</strong> option defined and the <strong>UMUI_ULTRAMODERN_SMALL</strong> option not defined. Change this if you have made your own customized UI.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_noleftimage.exe</em></span></p>\n\n          <p><span class=\"red\"><strong>MUI_UI_HEADERIMAGE</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface files with the dialog resource IDD_INST that contains a bitmap control and space for the header bitmap.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe</em></p>\n\n          <p><span class=\"red\"><strong>MUI_UI_HEADERIMAGE_RIGHT</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface files with the dialog resource IDD_INST that contains a bitmap control and space for the header bitmap on the right side.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmpr.exe</em></p>\n\n          <p><strong>MUI_UI_COMPONENTSPAGE_SMALLDESC</strong> <span class=\"parameter\">ui_file</span><br />\n          The interface files with a customized dialog resource IDD_SELCOM with a small description area.<br />\n          <em><span class=\"purple\">Default without UMUI_USE_SMALLPAGE option defined:<br />${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_smalldesc.exe</span><br />\n          Default with UMUI_USE_SMALLPAGE option defined:<br />${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_smalldesc.exe</em></p>\n\n          <p><strong>MUI_UI_COMPONENTSPAGE_NODESC</strong> <span class=\"parameter\">ui_file</span><br />\n          The interface files with a customized dialog resource IDD_SELCOM without a description area.<br />\n          <em><span class=\"purple\">Default without UMUI_USE_SMALLPAGE option defined:<br />${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_nodesc.exe</span><br />\n          Default with UMUI_USE_SMALLPAGE option defined:<br />${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_nodesc.exe</em></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UI_COMPONENTSPAGE_BIGDESC</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface files with a customized dialog resource IDD_SELCOM with a big description area.<br />\n          <span class=\"blue\"><em>Default without UMUI_USE_SMALLPAGE option defined:<br />${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\UltraModern_bigdesc.exe<br />\n          Default with UMUI_USE_SMALLPAGE option defined:<br />${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_bigdesc.exe</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inwf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inwf', 'toggle_umui_inwf');\" /> Welcome/Finish/Abort Pages Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inwf\">\n\n          <p><span class=\"blue\"><strong>UMUI_USE_ALTERNATE_PAGE</strong></span><br />\n          Use an alternative Welcome page, Finish page and Abort page that looks like the most recent installers</p>\n\n         <p><span class=\"blue\"><strong>UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE</strong></span> <span class=\"parameter\">size</span><br />\n         Use an alternative Welcome page, Finish page and Abort page that looks like the most recent installers<br />\n         <em><span class=\"blue\">Default with UMUI_USE_ALTERNATE_PAGE option defined: 8</span><br />\n         Default without UMUI_USE_ALTERNATE_PAGE option defined: 12</em></p>\n\n          <p><span class=\"purple\"><strong>MUI_WELCOMEFINISHPAGE_BITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap for the Welcome, the Finish and the Abort pages (recommended size: 164x314 pixels).<br />\n          <em><span class=\"purple\">Default with UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option defined:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Wizard.bmp<br />\n          Default without UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option defined: none</span></em></p>\n\n          <div>\n            <p><strong>MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />\n            Do not stretch the bitmap for the Welcome, the Finish and the Abort pagesto fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n          </div>\n\n         <p><span class=\"blue\"><strong>UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE</strong></span><br />\n         Enable Bitmap for the Welcome, the Finish and the Abort pages.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inwfi\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inwfi', 'toggle_umui_inwfi');\" /> Welcome/Finish/Abort Pages InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inwfi\">\n\n          <p><span class=\"purple\"><strong>UMUI_WELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Welcome, the Finish and the Abort pages.<br />\n          The MUI_WELCOMEFINISHPAGE_INI define has been renamed in Ultra-Modern UI in order to assure the compatibility with the former Modern UI scripts.<br />\n          <span class=\"purple\"><em>Default with UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini<br />\n          Default without UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_ALTERNATEWELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Alternate Welcome page, the Alternate Finish page and the Alternate Abort page.<br />\n          <span class=\"blue\"><em>Default with UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini<br />\n          Default without UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inuwf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inuwf', 'toggle_umui_inuwf');\" /> Uninstaller Welcome/Finish/Abort Pages Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inuwf\">\n\n          <p><span class=\"blue\"><strong>UMUI_USE_UNALTERNATE_PAGE</strong></span><br />\n          Use an alternative Welcome page, Finish page and Abort page that looks like the most recent installers</p>\n\n          <p><span class=\"purple\"><strong>MUI_UNWELCOMEFINISHPAGE_BITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap for the Welcome, the Finish and the Abort pages (recommended size: 164x314 pixels).<br />\n          <span class=\"purple\"><em>Default : ${MUI_WELCOMEFINISHPAGE_BITMAP}</em></span></p>\n\n          <div>\n            <p><strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />\n            Do not stretch the bitmap for the Welcome, the Finish and the Abort pagesto fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n          </div>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inuwfi\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inuwfi', 'toggle_umui_inuwfi');\" /> Uninstaller Welcome/Finish/Abort Pages Interface INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inuwfi\">\n\n          <p><span class=\"purple\"><strong>UMUI_UNWELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the uninstaller Welcome page, the Finish page and the Abort page.<br />\n          The MUI_UNWELCOMEFINISHPAGE_INI define has been renamed in Ultra-Modern UI in order to assure the compatibility with the former Modern UI scripts.<br />\n          <span class=\"purple\"><em>Default with UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini<br />\n          Default without UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_ALTERNATEUNWELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the uninstaller Alternate Welcome page, the Alternate Finish page and the Alternate Abort page.<br />\n          <span class=\"blue\"><em>Default with UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini<br />\n          Default without UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inmus\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inmus', 'toggle_umui_inmus');\" /> Maintenance/Update/SetupType Pages InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inmus\">\n\n          <p><span class=\"blue\"><strong>UMUI_MAINTENANCEUPDATESETUPTYPEPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Maintenance, the Update and the SetupType pages.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\MaintenanceUpdateSetupType.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_incnf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_incnf', 'toggle_umui_incnf');\" /> Confirm Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_incnf\">\n\n          <p><span class=\"blue\"><strong>UMUI_CONFIRMPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Confirm page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\Confirm.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_ininf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_ininf', 'toggle_umui_ininf');\" /> Information Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_ininf\">\n\n          <p><span class=\"blue\"><strong>UMUI_INFORMATIONPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Information page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\Information.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inadt\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inadt', 'toggle_umui_inadt');\" /> AdditionalTasks Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inadt\">\n\n          <p><span class=\"blue\"><strong>UMUI_ADDITIONALTASKSPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the AdditionalTasks page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AdditionalTasks.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_insn\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_insn', 'toggle_umui_insn');\" /> SerialNumber Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_insn\">\n\n          <p><span class=\"blue\"><strong>UMUI_SERIALNUMBERPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the SerialNumber page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\SerialNumber.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inasm\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inasm', 'toggle_umui_inasm');\" /> AlternativeStartMenu Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inasm\">\n\n          <p><span class=\"blue\"><strong>UMUI_ALTERNATIVESTARTMENUPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the AlternativeStartMenu page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternativeStartMenu.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inl\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inl', 'toggle_umui_inl');\" /> License Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inl\">\n\n          <p><strong>MUI_LICENSEPAGE_BGCOLOR</strong> <span class=\"parameter\">(/windows | /grey | (color: RRGGBB hexadecimal))</span><br />\n          The background color for the license textbox. Use /windows for the Windows text background color (usually white). Use the /grey for the window background color (usually grey).<br />\n          <em>Default: /windows</em></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inc\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inc', 'toggle_umui_inc');\" /> Components Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inc\">\n\n          <p><strong>MUI_COMPONENTSPAGE_CHECKBITMAP</strong> <span class=\"parameter\">bitmap_file</span><br />\n          The bitmap with images for the checks of the component select treeview.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp</em></p>\n\n          <p><strong>MUI_COMPONENTSPAGE_SMALLDESC</strong><br />\n          A small description area on the bottom of the page. Use this layout if you have a lot of sections and don't need large descriptions.</p>\n\n          <p><strong>MUI_COMPONENTSPAGE_NODESC</strong><br />\n          No description area.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_BIGDESC</strong></span><br />\n          A big description area on the bottom of the page. Use this layout if you have a lot of sections and need large descriptions.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_ENABLE_DESCRIPTION_TEXT</strong></span> <span class=\"parameter\">ini_file</span><br />\n          Enable the description text when the mouse is not positionned over a component.<br />\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_ini\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_ini', 'toggle_umui_ini');\" /> Installation Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_ini\">\n\n          <p><strong>MUI_INSTFILESPAGE_COLORS</strong> <span class=\"parameter\">(/windows | (foreground color: RRGGBB hexadecimal) (background color: RRGGBB hexadecimal))</span><br />\n          The colors of the details screen. Use /windows for the default Windows colors.<br />\n          <span class=\"purple\"><em>Default: ${MUI_TEXTCOLOR} ${MUI_BGCOLOR}</em></span></p>\n\n          <p><strong>MUI_INSTFILESPAGE_PROGRESSBAR</strong> <span class=\"parameter\">(\"\" | colored | smooth)</span><br />\n          The style of the progress bar. Colored makes it use the MUI_INSTALLCOLORS.<br />\n          <em>Default: smooth</em></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inf', 'toggle_umui_inf');\" /> Installer Finish Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inf\">\n\n          <p><strong>MUI_FINISHPAGE_NOAUTOCLOSE</strong><br />\n          Do not automatically jump to the finish page, to allow the user to check the install log.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_uinf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_uinf', 'toggle_umui_uinf');\" /> Uninstaller Finish Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_uinf\">\n\n          <p><strong>MUI_UNFINISHPAGE_NOAUTOCLOSE</strong><br />\n          Do not automatically jump to the finish page, to allow the user to check the uninstall log.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inaw\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inaw', 'toggle_umui_inaw');\" /> Abort Warning Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inaw\">\n\n          <p><strong>MUI_ABORTWARNING</strong><br />\n          Show a message box with a warning when the user wants to close the installer.</p>\n\n          <div>\n            <p><strong>MUI_ABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n            Text to display on the abort warning messagebox.</p>\n            <p><strong>MUI_ABORTWARNING_CANCEL_DEFAULT</strong><br />\n            Set the Cancel button as the default button on the message box.</p>\n          </div>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_umui_inuaw\" src=\"images/closed.gif\" onclick=\"toggle('trigger_umui_inuaw', 'toggle_umui_inuaw');\" /> Uninstaller Abort Warning Settings</h3>\n        <div class=\"toggle\" id=\"toggle_umui_inuaw\">\n\n          <p><strong>MUI_UNABORTWARNING</strong><br />\n          Show a message box with a warning when the user wants to close the uninstaller.</p>\n\n          <div>\n            <p><strong>MUI_UNABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n            Text to display on the abort warning messagebox.</p>\n\n            <p><strong>MUI_UNABORTWARNING_CANCEL_DEFAULT</strong><br />\n            Set the Cancel button as the default button on the message box.</p>\n          </div>\n\n        </div>\n\n      </div>\n\n\n      <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_in\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_in', 'toggle_muiex_in');\" /> Interface Settings for Modern UIEx</h3>\n      <div class=\"toggle\" id=\"toggle_muiex_in\">\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_ad\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_ad', 'toggle_muiex_ad');\" /> BackGround Skin Setting</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_ad\">\n\n          <p><span class=\"blue\"><strong>UMUI_USE_BG</strong></span> <span class=\"parameter\">bgskin_name</span><br />\n          Use a background skin. It contain two macro named \"UMUI_BG\" and \"UMUI_BG_Destroy\".<br />\n          <span class=\"blue\"><em>Default: none</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_USE_CUSTOMBG</strong></span><br />\n          Use a custom background skin. don't forget to create two macro named \"UMUI_BG\" and \"UMUI_BG_Destroy\".</p>\n\n          <p>Example of a custom background skin:</p>\n<pre>!define UMUI_USE_CUSTOMBG\n\n!macro UMUI_BG\n  SetOutPath \"$PLUGINSDIR\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\SpotlightBG.bmp\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\KeyBG.bmp\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\HeaderBG.bmp\"\n  File \"${NSISDIR}\\Contrib\\UltraModernUI\\BGSkins\\wxp\\BtmImgBG.bmp\"\n  BgImage::SetBg /GRADIENT 78 111 214 78 111 214\n  BgImage::AddImage \"$PLUGINSDIR\\HeaderBG.bmp\" 0 0\n  BgImage::AddImage \"$PLUGINSDIR\\SpotlightBG.bmp\" 0 57\n  BgImage::AddImage \"$PLUGINSDIR\\BtmImgBG.bmp\" 0 -70\n  BgImage::AddImage \"$PLUGINSDIR\\KeyBG.bmp\" -248 -351\n  CreateFont $1 \"Verdana\" 30 700\n  BgImage::AddText \"$(^Name)\" $1 8 51 155 15 70 -1 -1\n  BgImage::AddText \"$(^Name)\" $1 255 255 255 10 65 -1 -1\n  BgImage::Redraw\n!macroend\n\n!macro UMUI_BG_Destroy\n  BgImage::Destroy\n!macroend</pre>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_ingen\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_ingen', 'toggle_muiex_ingen');\" /> General Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_ingen\">\n\n          <p><strong>MUI_ICON</strong> <span class=\"parameter\">icon_file</span><br />\n          The icon for the installer.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-install.ico</em></p>\n\n          <p><strong>MUI_UNICON</strong> <span class=\"parameter\">icon_file</span><br />\n          The icon for the uninstaller.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-uninstall.ico</em></p>\n\n          <p><strong>MUI_HEADERIMAGE</strong><br />\n          Display an image on the header of the page.</p>\n\n          <div>\n\n            <p><strong>MUI_HEADERIMAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n            Bitmap image to display on the header of installers pages (recommended size: 150x57 pixels).<br />\n            <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp</em></p>\n\n            <div>\n              <p><strong>MUI_HEADERIMAGE_BITMAP_NOSTRETCH</strong><br />\n              Do not stretch the installer header bitmap to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n\n              <p><strong>MUI_HEADERIMAGE_BITMAP_RTL</strong> <span class=\"parameter\">bmp_file</span><br />\n              Bitmap image to display on the header of installers pages when using a RTL language (recommended size: 150x57 pixels).<br />\n              <em>Default: Non-RTL bitmap</em></p>\n\n              <div>\n                <p><strong>MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH</strong><br />\n                Do not stretch the installer header bitmap when using a RTL language to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n             </div>\n           </div>\n\n           <p><strong>MUI_HEADERIMAGE_UNBITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n           Bitmap image to display on the header of uninstaller pages (recommended size: 150x57 pixels).<br />\n           <em>Default: Installer header bitmap</em></p>\n\n           <div>\n             <p><strong>MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH</strong><br />\n             Do not stretch the uninstaller header bitmap to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n\n             <p><strong>MUI_HEADERIMAGE_UNBITMAP_RTL</strong> <span class=\"parameter\">bmp_file</span><br />\n             Bitmap image to display on the header of uninstallers pages when using a RTL language (recommended size: 150x57 pixels).<br />\n             <em>Default: Installer RTL header bitmap</em></p>\n\n             <div>\n               <p><strong>MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH</strong><br />\n               Do not stretch the uninstaller header bitmap when using a RTL language to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n             </div>\n           </div>\n\n           <p><strong>MUI_HEADERIMAGE_RIGHT</strong><br />\n           Display the header image on the right side instead of the left side (when using a RTL language it will be displayed on the left side instead of the right side).</p>\n\n          </div>\n\n\n          <p><span class=\"blue\"><strong>UMUI_HEADERBGIMAGE</strong></span><br />\n          Display a background image on the header of the page.</p>\n\n          <div>\n            <p><span class=\"blue\"><strong>UMUI_NOHEADERBGIMAGE</strong></span><br />\n            Hide the background image on the header of the page.</p>\n  \n            <p><span class=\"blue\"><strong>UMUI_HEADERBGIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n            Bitmap image to display on the header of installers pages (recommended size: 497*59 pixels).<br />\n            <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\Graphics\\Header\\UltraModernUI\\HeaderBG.bmp\"</em></span></p>\n  \n            <p><span class=\"blue\"><strong>UMUI_UNHEADERBGIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n            Bitmap image to display on the header of installers pages (recommended size: 497*59 pixels).<br />\n            <span class=\"blue\"><em>Default: ${UMUI_HEADERBGIMAGE_BMP}\"</em></span></p>\n\n          </div>\n\n          <p><strong>MUI_TEXTCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Text color for all the pages.\n          <em>Default: 000000</em></p>\n\n          <p><span class=\"blue\"><strong>UMUI_TEXT_LIGHTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Default link color for finish and abort pages.<br />\n          <span class=\"blue\"><em>Default: 000000</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_TEXT_INPUTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Text color for input controls (except checkboxes and radio buttons) of all the pages.<br />\n          <span class=\"blue\"><em>Default: 000000</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BGINPUTCOLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Background color for input controls (except checkboxes and radio buttons) of all the pages.<br />\n          <span class=\"blue\"><em>Default: FFFFFF</em></span></p>\n\n          <p><strong>MUI_BGCOLOR</strong> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Background color for the header, the Welcome, the Finish and the Abort pages.<br />\n          <em>Default: FFFFFF</em></p>\n\n          <p><span class=\"blue\"><strong>UMUI_HEADERTEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n          Header text color for all the pages.<br />\n          <span class=\"blue\"><em>Default: ${MUI_TEXTCOLOR}</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_BUTTONIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all buttons of installer.<br />\n          <span class=\"blue\"><em>Default: none</em></span></p>\n\n          <div>\n            <p><span class=\"blue\"><strong>UMUI_DISABLED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for disabled buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: 808080</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_SELECTED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for selected buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: 000080</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for normal buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: 000000</em></span></p>\n          </div>\n        \n          <p><span class=\"blue\"><strong>UMUI_SCROLLBARIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all scroll bars of installer.<br />\n          <span class=\"blue\"><em>Default: none</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UNBUTTONIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all buttons of uninstaller.<br />\n          <span class=\"blue\"><em>Default: none</em></span></p>\n\n          <div>\n            <p><span class=\"blue\"><strong>UMUI_UNDISABLED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for disabled buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: ${UMUI_DISABLED_BUTTON_TEXT_COLOR}</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_UNSELECTED_BUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for selected buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: ${UMUI_SELECTED_BUTTON_TEXT_COLOR}</em></span></p>\n\n            <p><span class=\"blue\"><strong>UMUI_UNBUTTON_TEXT_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBBR hexadecimal)</span><br />\n            Text color for normal buttons of all the pages.<br />\n            <span class=\"blue\"><em>Default: ${UMUI_BUTTON_TEXT_COLOR}</em></span></p>\n          </div>\n\n          <p><span class=\"blue\"><strong>UMUI_UNSCROLLBARIMAGE_BMP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap image to skin all scroll bars of uninstaller.<br />\n          <span class=\"blue\"><em>Default: none</em></span></p>\n\n          <p><strong>MUI_HEADER_TRANSPARENT_TEXT</strong><br />\n          Set a transparent background for the  header's label controls. Useful for custom user interfaces that set a bigger header image.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_XPSTYLE</strong></span> <span class=\"parameter\">(On/Off)</span><br />\n          Sets whether or not a XP visual style manifest will be added to the installer. This manifest makes the installers controls use the new visual styles when running on Windows XP and later. This affects the uninstaller too.<br />\n          <span class=\"blue\"><em>Default with UMUI_BUTTONIMAGE_BMP|UMUI_UNBUTTONIMAGE_BMP option defined: Off<br />\n          Default without UMUI_BUTTONIMAGE_BMP&UMUI_UNBUTTONIMAGE_BMP option defined: On</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inres\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inres', 'toggle_muiex_inres');\" /> Interface Resource Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inres\">\n\n          <p><strong>MUI_UI</strong> <span class=\"parameter\">ui_file</span><br />\n          The interface file with the dialog resources. Change this if you have made your own customized UI.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern.exe</em></p>\n\n          <p><strong>MUI_UI_HEADERIMAGE</strong> <span class=\"parameter\">ui_file</span><br />\n          The interface files with the dialog resource IDD_INST that contains a bitmap control and space for the header bitmap.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe</em></p>\n\n          <p><strong>MUI_UI_HEADERIMAGE_RIGHT</strong> <span class=\"parameter\">ui_file</span><br />\n          The interface files with the dialog resource IDD_INST that contains a bitmap control and space for the header bitmap on the right side.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_headerbmpr.exe</em></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UI_HEADERBGIMAGE</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface files with the dialog resource IDD_INST that contains a bitmap control for the header background bitmap.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_headerbgimage.exe</em></span></p>\n\n          <p><strong>MUI_UI_COMPONENTSPAGE_SMALLDESC</strong> <span class=\"parameter\">ui_file</span><br />\n          The interface files with a customized dialog resource IDD_SELCOM with a small description area.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_smalldesc.exe</em></p>\n\n          <p><strong>MUI_UI_COMPONENTSPAGE_NODESC</strong> <span class=\"parameter\">ui_file</span><br />\n          The interface files with a customized dialog resource IDD_SELCOM without a description area.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\UIs\\modern_nodesc.exe</em></p>\n\n          <p><span class=\"blue\"><strong>UMUI_UI_COMPONENTSPAGE_BIGDESC</strong></span> <span class=\"parameter\">ui_file</span><br />\n          The interface files with a customized dialog resource IDD_SELCOM with a big description area.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UIs\\UltraModernUI\\modern_bigdesc.exe</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inwf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inwf', 'toggle_muiex_inwf');\" /> Welcome/Finish/Abort Pages Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inwf\">\n\n          <p><span class=\"blue\"><strong>UMUI_USE_ALTERNATE_PAGE</strong></span><br />\n          Use an alternative Welcome page, Finish page and Abort page that looks like the most recent installers</p>\n\n          <p><span class=\"blue\"><strong>UMUI_WELCOMEFINISHABORT_TITLE_FONTSIZE</strong></span> <span class=\"parameter\">size</span><br />\n          Use an alternative Welcome page, Finish page and Abort page that looks like the most recent installers<br />\n          <em><span class=\"blue\">Default with UMUI_USE_ALTERNATE_PAGE option defined: 8</span><br />\n          Default without UMUI_USE_ALTERNATE_PAGE option defined: 12</em></p>\n\n          <p><strong>MUI_WELCOMEFINISHPAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap for the Welcome, the Finish and the Abort pages (recommended size: 164x314 pixels).<br />\n          <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp</em></p>\n\n          <div>\n            <p><strong>MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />\n            Do not stretch the bitmap for the Welcome, the Finish and the Abort pagesto fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n          </div>\n\n          <p><span class=\"blue\"><strong>UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE</strong></span><br />\n          Disable Bitmap for the Welcome, the Finish and the Abort pages.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inwfi\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inwfi', 'toggle_muiex_inwfi');\" /> Welcome/Finish/Abort Pages InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inwfi\">\n\n          <p><span class=\"purple\"><strong>UMUI_WELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Welcome, the Finish and the Abort pages.<br />\n          The MUI_WELCOMEFINISHPAGE_INI define has been renamed in Ultra-Modern UI in order to assure the compatibility with the former Modern UI scripts.<br />\n          <span class=\"purple\"><em>Default without UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini<br />\n          Default with UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini</em></span></p>\n\n          <p><span class=\"blue\"><strong>UMUI_ALTERNATEWELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Alternate Welcome page, the Alternate Finish page and the Alternate Abort page.<br />\n          <span class=\"blue\"><em>Default without UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini<br />\n          Default with UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inuwf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inuwf', 'toggle_muiex_inuwf');\" /> Uninstaller Welcome/Finish/Abort Pages Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inuwf\">\n\n          <p><span class=\"blue\"><strong>UMUI_USE_UNALTERNATE_PAGE</strong></span><br />\n          Use an alternative Welcome page, Finish page and Abort page that looks like the most recent installers</p>\n\n          <p><strong>MUI_UNWELCOMEFINISHPAGE_BITMAP</strong> <span class=\"parameter\">bmp_file</span><br />\n          Bitmap for the Welcome, the Finish and the Abort pages (recommended size: 164x314 pixels).<br />\n          <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp</em></p>\n\n          <div>\n            <p><strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />\n            Do not stretch the bitmap for the Welcome, the Finish and the Abort pagesto fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting.</p>\n          </div>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inuwfi\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inuwfi', 'toggle_muiex_inuwfi');\" /> Uninstaller Welcome/Finish/Abort Pages Interface INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inuwfi\">\n\n           <p><span class=\"purple\"><strong>UMUI_UNWELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n           InstallOptions INI file for the uninstaller Welcome page, the Finish page and the Abort page.<br />\n           The MUI_UNWELCOMEFINISHPAGE_INI define has been renamed in Ultra-Modern UI in order to assure the compatibility with the former Modern UI scripts.<br />\n           <span class=\"purple\"><em>Default without UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini<br />\n           Default with UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini</em></span></p>\n\n           <p><span class=\"blue\"><strong>UMUI_ALTERNATEUNWELCOMEFINISHABORTPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n           InstallOptions INI file for the uninstaller Alternate Welcome page, the Alternate Finish page and the Alternate Abort page.<br />\n           <span class=\"blue\"><em>Defaultout with UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini<br />\n           Default with UMUI_WELCOMEFINISHABORTPAGE_NOTUSE_IMAGE option enabled:<br />${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inmus\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inmus', 'toggle_muiex_inmus');\" /> Maintenance/Update/SetupType Pages InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inmus\">\n\n          <p><span class=\"blue\"><strong>UMUI_MAINTENANCEUPDATESETUPTYPEPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Maintenance, the Update and the SetupType pages.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\MaintenanceUpdateSetupType.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_incnf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_incnf', 'toggle_muiex_incnf');\" /> Confirm Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_incnf\">\n\n          <p><span class=\"blue\"><strong>UMUI_CONFIRMPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Confirm page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\Confirm.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_ininf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_ininf', 'toggle_muiex_ininf');\" /> Information Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_ininf\">\n\n          <p><span class=\"blue\"><strong>UMUI_INFORMATIONPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the Information page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\Information.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inadt\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inadt', 'toggle_muiex_inadt');\" /> AdditionalTasks Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inadt\">\n\n          <p><span class=\"blue\"><strong>UMUI_ADDITIONALTASKSPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the AdditionalTasks page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AdditionalTasks.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_insn\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_insn', 'toggle_muiex_insn');\" /> SerialNumber Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_insn\">\n\n          <p><span class=\"blue\"><strong>UMUI_SERIALNUMBERPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the SerialNumber page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\SerialNumber.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inasm\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inasm', 'toggle_muiex_inasm');\" /> AlternativeStartMenu Page InstallOptions INI Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inasm\">\n\n          <p><span class=\"blue\"><strong>UMUI_ALTERNATIVESTARTMENUPAGE_INI</strong></span> <span class=\"parameter\">ini_file</span><br />\n          InstallOptions INI file for the AlternativeStartMenu page.<br />\n          <span class=\"blue\"><em>Default: ${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\AlternativeStartMenu.ini</em></span></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inl\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inl', 'toggle_muiex_inl');\" /> License Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inl\">\n\n          <p><strong>MUI_LICENSEPAGE_BGCOLOR</strong> <span class=\"parameter\">(/windows | /grey | (color: RRGGBB hexadecimal))</span><br />\n          The background color for the license textbox. Use /windows for the Windows text background color (usually white). Use the /grey for the window background color (usually grey).<br />\n          <em>Default: /windows</em></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inc\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inc', 'toggle_muiex_inc');\" /> Components Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inc\">\n\n          <p><strong>MUI_COMPONENTSPAGE_CHECKBITMAP</strong> <span class=\"parameter\">bitmap_file</span><br />\n          The bitmap with images for the checks of the component select treeview.<br />\n          <em>Default: ${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp</em></p>\n\n          <p><strong>MUI_COMPONENTSPAGE_SMALLDESC</strong><br />\n          A small description area on the bottom of the page. Use this layout if you have a lot of sections and don't need large descriptions.</p>\n\n          <p><strong>MUI_COMPONENTSPAGE_NODESC</strong><br />\n          No description area.</p>\n\n          <p><span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_BIGDESC</strong></span><br />\n          A big description area on the bottom of the page. Use this layout if you have a lot of sections and need large descriptions.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_ini\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_ini', 'toggle_muiex_ini');\" /> Installation Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_ini\">\n\n          <p><strong>MUI_INSTFILESPAGE_COLORS</strong> <span class=\"parameter\">(/windows | (foreground color: RRGGBB hexadecimal) (background color: RRGGBB hexadecimal))</span><br />\n          The colors of the details screen. Use /windows for the default Windows colors.<br />\n          <em>Default: /windows</em></p>\n\n          <p><strong>MUI_INSTFILESPAGE_PROGRESSBAR</strong> <span class=\"parameter\">(\"\" | colored | smooth)</span><br />\n          The style of the progress bar. Colored makes it use the MUI_INSTALLCOLORS.<br />\n          <em>Default: smooth</em></p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inf', 'toggle_muiex_inf');\" /> Installer Finish Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inf\">\n\n          <p><strong>MUI_FINISHPAGE_NOAUTOCLOSE</strong><br />\n          Do not automatically jump to the finish page, to allow the user to check the install log.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_uinf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_uinf', 'toggle_muiex_uinf');\" /> Uninstaller Finish Page Interface Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_uinf\">\n\n          <p><strong>MUI_UNFINISHPAGE_NOAUTOCLOSE</strong><br />\n          Do not automatically jump to the finish page, to allow the user to check the uninstall log.</p>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inaw\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inaw', 'toggle_muiex_inaw');\" /> Abort Warning Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inaw\">\n\n          <p><strong>MUI_ABORTWARNING</strong><br />\n          Show a message box with a warning when the user wants to close the installer.</p>\n\n          <div>\n            <p><strong>MUI_ABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n            Text to display on the abort warning messagebox.</p>\n            <p><strong>MUI_ABORTWARNING_CANCEL_DEFAULT</strong><br />\n            Set the Cancel button as the default button on the message box.</p>\n          </div>\n\n        </div>\n\n\n        <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_muiex_inuaw\" src=\"images/closed.gif\" onclick=\"toggle('trigger_muiex_inuaw', 'toggle_muiex_inuaw');\" /> Uninstaller Abort Warning Settings</h3>\n        <div class=\"toggle\" id=\"toggle_muiex_inuaw\">\n\n          <p><strong>MUI_UNABORTWARNING</strong><br />\n          Show a message box with a warning when the user wants to close the uninstaller.</p>\n\n          <div>\n            <p><strong>MUI_UNABORTWARNING_TEXT</strong> <span class=\"parameter\">text</span><br />\n            Text to display on the abort warning messagebox.</p>\n\n            <p><strong>MUI_UNABORTWARNING_CANCEL_DEFAULT</strong><br />\n            Set the Cancel button as the default button on the message box.</p>\n          </div>\n\n        </div>\n\n    </div>\n\n  </div>\n\n\n  <h2>3. Pages</h2>\n  <div>\n\n    <p>Insert the following macros to set the pages you want to use. The pages will appear in the order you insert them in your script. You can also insert custom Page commands between the macros to add custom pages. <a href=\"#customPages\">More info about custom pages...</a></p>\n    <p>You can add multiple pages of certain types (for example, if you want the user to specify multiple folders).</p>\n\n    <p>Examples:</p>\n<pre>!insertmacro MUI_PAGE_LICENSE \"License.rtf\"\n!insertmacro MUI_PAGE_COMPONENTS\nVar STARTMENU_FOLDER\n!insertmacro MUI_PAGE_STARTMENU \"Application\" $STARTMENU_FOLDER</pre>\n\n    <p>You will need the page ID for the Start Menu Folder page when using the Start Menu Folder macros. The Start Menu Folder will be stored in the specified variable.</p>\n\n    <strong>Installer Pages:</strong>\n    <ul>\n      <li><span class=\"blue\">UMUI_PAGE_MULTILANGUAGE</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_MAINTENANCE</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_UPDATE</span></li>\n      <li>MUI_PAGE_WELCOME</li>\n      <li>MUI_PAGE_LICENSE <span class=\"parameter\">text/rtf_file</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_INFORMATION</span> <span class=\"parameter\">text/rtf_files</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_SERIALNUMBER</span> <span class=\"parameter\">function</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_SETUPTYPE</span></li>\n      <li>MUI_PAGE_COMPONENTS</li>\n      <li>MUI_PAGE_DIRECTORY</li>\n      <li>MUI_PAGE_STARTMENU <span class=\"parameter\">page_id variable</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_ALTERNATIVESTARTMENU</span> <span class=\"parameter\">page_id variable</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_ADDITIONALTASKS</span> <span class=\"parameter\">function</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_CONFIRM</span></li>\n      <li><span class=\"blue\">UMUI_PAGE_FILEDISKREQUEST</span></li>\n      <li>MUI_PAGE_INSTFILES</li>\n      <li>MUI_PAGE_FINISH</li>\n      <li><span class=\"blue\">UMUI_PAGE_ABORT</span></li>\n    </ul>\n\n    <strong>Uninstaller Pages:</strong>\n    <ul>\n      <li><span class=\"blue\">UMUI_UNPAGE_MULTILANGUAGE</span></li>\n      <li><span class=\"blue\">UMUI_UNPAGE_MAINTENANCE</span></li>\n      <li>MUI_UNPAGE_WELCOME</li>\n      <li>MUI_UNPAGE_CONFIRM</li>\n      <li>MUI_UNPAGE_LICENSE <span class=\"parameter\">text/rtf_file</span></li>\n      <li><span class=\"blue\">UMUI_UNPAGE_INFORMATION</span> <span class=\"parameter\">text/rtf_files</span></li>\n      <li><span class=\"blue\">UMUI_UNPAGE_SERIALNUMBER</span> <span class=\"parameter\">un.function</span></li>\n      <li><span class=\"blue\">UMUI_UNPAGE_SETUPTYPE</span></li>\n      <li>MUI_UNPAGE_COMPONENTS</li>\n      <li>MUI_UNPAGE_DIRECTORY</li>\n      <li><span class=\"blue\">UMUI_UNPAGE_ADDITIONALTASKS</span> <span class=\"parameter\">page_id un.function</span></li>\n      <li><span class=\"blue\">UMUI_UNPAGE_CONFIRM</span></li>\n      <li><span class=\"blue\">UMUI_UNPAGE_FILEDISKREQUEST</span></li>\n      <li>MUI_UNPAGE_INSTFILES</li>\n      <li>MUI_UNPAGE_FINISH</li>\n      <li><span class=\"blue\">UMUI_UNPAGE_ABORT</span></li>\n    </ul>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pg\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pg', 'toggle_pg');\" /> Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pg\">\n\n    <p>Page settings apply to a single page and should be set before inserting a page macro. You have to repeat the setting if you want it to apply to multiple pages. Example:</p>\n\n<pre>;Add a directory page to let the user specify a plug-ins folder\n;Store the folder in $PLUGINS_FOLDER\nVar PLUGINS_FOLDER\n!define MUI_DIRECTORYPAGE_VARIABLE $PLUGINS_FOLDER\n!insertmacro MUI_PAGE_DIRECTORY</pre>\n\n    <p><strong>Note:</strong> There is no difference between installer and uninstaller page settings.</p>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgg\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgg', 'toggle_pgg');\" /> General Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgg\">\n\n      <p><strong>MUI_PAGE_HEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the header of the page.</p>\n\n      <p><strong>MUI_PAGE_HEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n      Subtext to display on the header of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_PREUNINSTALL_FUNCTION</strong></span> <span class=\"parameter\">function</span><br />\n      A function to remove already installed files, but keeping configuration files and registery keys, executed before the installation itself. Useful in repair, modify and update mode or when user uncheck already installed components.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_PARAMS_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_PARAMS_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      The default registry key to store diverse values. Some pages will use it to remember the selected values. Don't forget to remove this key during uninstallation.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_INSTALLDIR_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_INSTALLDIR_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"blue\"><strong>UMUI_INSTALLDIR_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the $INSTDIR variable. This replace the InstallDirRegKey instruction. This value will be automatically saved to the registry on install success. Don't forget to remove this key during uninstallation.<br />\n      UMUI_INSTALLDIR_REGISTRY_ROOT and UMUI_INSTALLDIR_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_DEFAULT_SHELLVARCONTEXT</strong></span> <span class=\"parameter\">(all/current)</span><br />\n      Set the default context of $SMPROGRAMS and other shell folders. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes. If the all users folder is not found, the current user folder will be used. Please take into consideration that a \"normal user\" has no rights to write in the all users area. Only admins have full access rights to the all users area. You can check this by using the UserInfo plug-in. See Contrib\\UserInfo\\UserInfo.nsi for an example.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_SHELLVARCONTEXT_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_SHELLVARCONTEXT_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"blue\"><strong>UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the ShellVarContext (current|all). Useful if the user has the option to choose through the AlternativeStartMenu page or the AddistionalTasks page. This value will be automatically saved to the registry on install success. Don't forget to remove this key during uninstallation.<br />\n      UMUI_SHELLVARCONTEXT_REGISTRY_ROOT and UMUI_SHELLVARCONTEXT_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p>You can use these macros to add value to save automatically to the registry on install success. Don't forget to remove this key during uninstallation.<br />\n      <strong>UMUI_ADDPARAMTOSAVETOREGISTRY</strong> <span class=\"parameter\">registry_root registry_key value_name data</span><br />\n      <strong>UMUI_ADDPARAMTOSAVETOREGISTRY</strong> <span class=\"parameter\">value_name data</span><br />\n      The last one required the <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> parameters to be defined.</p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgw\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgw', 'toggle_pgw');\" /> MultiLanguage Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgw\">\n\n      <p><span class=\"blue\"><strong>UMUI_MULTILANGUAGEPAGE_TITLE</strong></span> <span class=\"parameter\">title</span><br />\n      Title to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_MULTILANGUAGEPAGE_TITLE_3LINES</strong></span><br />\n      Extra space for the title area.<br />\n      It is not used in the alternate welcome page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_MULTILANGUAGEPAGE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the page. Use \\r\\n for a newline.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_MULTILANGUAGEPAGE_LANGUAGE</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the language frame.</p>\n\n      <p><span class=\"purple\"><strong>UMUI_LANGUAGE_ALWAYSSHOW</strong></span><br />\n      Always show the language selection dialog, even if a language has been stored in the registry. The language stored in the registry will be selected by default.</p>\n  \n      <p><span class=\"purple\"><strong>UMUI_LANGUAGE_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"purple\"><strong>UMUI_LANGUAGE_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"purple\"><strong>UMUI_LANGUAGE_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the language. The users preference will be remembered. You can also use it for the uninstaller to display the right language. This value will be automatically saved to the registry on install success. Don't forget to remove this key in the uninstaller.<br />\n      UMUI_LANGUAGE_REGISTRY_ROOT and UMUI_LANGUAGE_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n     \n      <p>Insert the Modern UI language files for the languages to want to include:</p>\n      <pre>!insertmacro MUI_LANGUAGE \"English\"<br /></pre>\n\n      <p>For the installer and the uninstaller, insert the <strong>UMUI_MULTILANG_GET</strong> macro in .onInit and un.onInit fuctions to get the stored language list:</p>\n<pre>Function .onInit\n!insertmacro UMUI_MULTILANG_GET\nFunctionEnd\nFunction un.onInit\n!insertmacro UMUI_MULTILANG_GET\nFunctionEnd</pre>\n      <p>If you need to use the instruction \"SetRegView 64\", it must be inserted in the (un).onInit functions and before the UMUI_MULTILANG_GET macro insertions.</p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_mn\" src=\"images/closed.gif\" onclick=\"toggle('trigger_mn', 'toggle_mn');\" /> Maintenance Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_mn\">\n\n      <p>This page is shown only when the product is already installed in the same version. It draw radio buttons usualy named Modify, Repair, Remove and Continue setup. If Repair is selected, the Components, Directory and StartMenu pages are skipped.<br />\n      To work, the <strong>UMUI_VERBUILD_REGISTRY_VALUENAME</strong> and the <strong>UMUI_VERBUILD</strong> parameters are required but also, the <strong>UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME</strong>, the <strong>UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME</strong> and optionally the <strong>UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME</strong> parameter of the Component Page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_MODIFY</strong></span><br />\n      Enable the modify option.</p>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_MODIFY_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the modify radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_MODIFY_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the modify radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_MODIFYBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the modify radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Modify.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\ModifyEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REPAIR</strong></span><br />\n      Enable the repair option.</p>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REPAIR_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the repair radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REPAIR_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the repair radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REPAIRBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the repair radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Repair.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\RepairEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REMOVE</strong></span><br />\n      Enable the remove option.</p>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REMOVE_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the remove radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REMOVE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the remove radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_REMOVEBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the remove radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Remove.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\RemoveEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_CONTINUE_SETUP</strong></span><br />\n      Enable the continue setup option.</p>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_CONTINUE_SETUP_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the continue setup radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_CONTINUE_SETUP_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the continue setup radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_CONTINUE_SETUPBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the continue setup radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Continue.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\ContinueEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_MAINTENANCEPAGE_DEFAULTCHOICE</strong></span> <span class=\"parameter\">flag</span><br />\n      The default selected flag: must be one of ${UMUI_MODIFY}, ${UMUI_REPAIR}, ${UMUI_REMOVE} or ${UMUI_CONTINUE_SETUP}<br />\n      <span class=\"blue\"><em>Default: ${UMUI_MODIFY}</em></span></p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_upd\" src=\"images/closed.gif\" onclick=\"toggle('trigger_upd', 'toggle_upd');\" /> Update Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_upd\">\n\n      <p>This page is shown only when the product is already installed in a different version. It draw radio buttons usualy named Update, Remove and Continue setup. If Update is selected, the Components, Directory and StartMenu pages are skipped.<br />\n      To work, the <strong>UMUI_VERBUILD_REGISTRY_VALUENAME</strong> and the <strong>UMUI_VERBUILD</strong> parameters are required but also, the <strong>UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME</strong> and optionally the <strong>UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME</strong> parameter of the Component Page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_UPDATE_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n      Title of the update radiobutton.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_UPDATE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display under the update radiobutton.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_UPDATEBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n      Bitmap image to display under the update radiobutton.<br />\n      <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Update.bmp<br />\n      Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\UpdateEx.bmp</em></span></p>\n\n      <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_REMOVE</strong></span><br />\n      Enable the remove option.</p>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_REMOVE_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the remove radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_REMOVE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the remove radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_REMOVEBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the remove radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Remove.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\RemoveEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_CONTINUE_SETUP</strong></span><br />\n      Enable the continue setup option.</p>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_CONTINUE_SETUP_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the continue setup radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_CONTINUE_SETUP_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the continue setup radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_CONTINUE_SETUPBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the continue setup radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Continue.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\ContinueEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_UPDATEPAGE_DEFAULTCHOICE</strong></span> <span class=\"parameter\">flag</span><br />\n      The default selected flag: must be one of ${UMUI_UPDATE}, ${UMUI_REPAIR}, ${UMUI_REMOVE} or ${UMUI_CONTINUE_SETUP}<br />\n      <span class=\"blue\"><em>Default: ${UMUI_CONTINUE_SETUP}</em></span></p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgl\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgl', 'toggle_pgl');\" /> License Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgl\">\n\n      <p><strong>MUI_LICENSEPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><strong>MUI_LICENSEPAGE_TEXT_BOTTOM</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the bottom of the page.</p>\n\n      <p><strong>MUI_LICENSEPAGE_BUTTON</strong> <span class=\"parameter\">button_text</span><br />\n      Text to display on the 'I Agree' button.</p>\n\n      <p><strong>MUI_LICENSEPAGE_CHECKBOX</strong><br />\n      Display a checkbox the user has to check to agree with the license terms.</p>\n\n      <div>\n        <p><strong>MUI_LICENSEPAGE_CHECKBOX_TEXT</strong> <span class=\"parameter\">text</span><br />\n        Text to display next to the checkbox to agree with the license terms.</p>\n      </div>\n\n      <p><strong>MUI_LICENSEPAGE_RADIOBUTTONS</strong><br />\n      Display two radio buttons to allow the user to choose between accepting the license terms or not.</p>\n\n      <div>\n        <p><strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT</strong> <span class=\"parameter\">text</span><br />\n        Text to display next to the checkbox to accept the license terms.</p>\n\n        <p><strong>MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE</strong> <span class=\"parameter\">text</span><br />\n        Text to display next to the checkbox to decline the license terms.</p>\n      </div>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_aj\" src=\"images/closed.gif\" onclick=\"toggle('trigger_aj', 'toggle_aj');\" /> Information Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_aj\">\n\n      <p>The pages display a single or multiple textes files or Richtext RTF files.<br />\n      File name may contains a * which will be replaced by the language code. For example:<br />\n      \"information1033.txt\" will be displayed for english and \"information1036.txt\" for french.<br />\n      Optional \"information.txt\" for untranslated language files (if \"informationXXXX.txt\" not found).<br />\n      Text files support the UTF16LE charset only if the Unicode True instruction set or an ANSI charset.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_INFORMATIONPAGE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT</strong></span><br />\n      Information file(s) is/are in RichText RTF format.</p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_sn\" src=\"images/closed.gif\" onclick=\"toggle('trigger_sn', 'toggle_sn');\" /> SerialNumber Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_sn\">\n\n      <p><span class=\"blue\"><strong>UMUI_SERIALNUMBERPAGE_TEXT_TOP</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p>The page take a function in parameter containing some macro to add elements on the page. Example:</p>\n<pre>Function serial_function\n\n;Get the windows name and organisation\n!insertmacro UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_OWNER R0\n!insertmacro UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_ORGANIZATION R1\n\nStrCpy $R2 \"11111-22222-33333-44444-55555\"\n\n  !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME \"RegName\"\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL \\\n    REGNAME      0 \"TOUPPER\"           $R0 \"$(UMUI_TEXT_SERIALNUMBER_NAME)\"\n\n  !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME \"Organisation\"\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL \\\n    ORGANISATION 0 \"CANBEEMPTY|TOLOWER\" $R1 \"$(UMUI_TEXT_SERIALNUMBER_ORGANIZATION)\"\n\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_HLINE\n\n  !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME \"SerialNumber\"\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL \\\n    SERIAL     55555 \"NUMBERS|NODASHS\" $R2 \"$(UMUI_TEXT_SERIALNUMBER_SERIALNUMBER)\"\n\nFunctionEnd</pre>\n      <p><strong>UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_OWNER</strong> <span class=\"parameter\">default</span><br />\n      Macro to get the windows registered user;<br />\n      <strong>UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_ORGANIZATION</strong> <span class=\"parameter\">default</span><br />\n      Macro to get the windows registered organization;<br />\n      <strong>UMUI_SERIALNUMBERPAGE_ADD_LABEL</strong> <span class=\"parameter\">text</span><br />\n      Macro to add a text;<br />\n      <strong>UMUI_SERIALNUMBERPAGE_ADD_SERIAL</strong> <span class=\"parameter\">serialID type flags default</span><br />\n      <strong>UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL</strong> <span class=\"parameter\">serialID type flags default text</span><br />\n      Two macros to add an input with label. Parameters are:<br />\n      serialID: A unique identifiant for this serial number<br />\n      type: How many chars and how many inputs to show on the line. Example: 555 for 3 inputs of 5 characters each, 0 for unlimited chars<br />\n      flags: Can be one or many (separated by |) of \"\", NODASHS, TOUPPER, TOLOWER, NUMBERS, CANBEEMPTY<br />\n      default: The défault value if not already saved in the registry.<br />\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Example XXXXX-XXXXX-XXXXX or XXXXXXXXXXXXXXX<br />\n      A define are available on these macro :<br />\n      <span class=\"blue\"><strong>UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"blue\"><strong>UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the value. This value will be automatically saved to the registry on install success. Don't forget to remove this key in the uninstaller.<br />\n      UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_ROOT and UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p>Use the <strong>UMUI_SERIALNUMBER_GET</strong> <span class=\"parameter\">serialID variable</span> macro to get the value.</p>\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_ak\" src=\"images/closed.gif\" onclick=\"toggle('trigger_ak', 'toggle_ak');\" /> SetupType Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_ak\">\n\n      <p>This page draw radio buttons usualy named Minimal, Standard, Complete and Custom. If Custom is not selected, the Components, Directory and StartMenu pages are skipped.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_MINIMAL</strong></span> <span class=\"parameter\">InstTypeName</span><br />\n      Enable the minimal option. The InstTypeName must correspond to an existing InstType declaration. Typically:</p>\n<pre>!define UMUI_SETUPTYPEPAGE_MINIMAL \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"</pre>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_MINIMAL_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the minimal radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_MINIMAL_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the minimal radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_MINIMALBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the minimal radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Minimal.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\MinimalEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_STANDARD</strong></span> <span class=\"parameter\">InstTypeName</span><br />\n      Enable the standard option. The InstTypeName must correspond to an existing InstType declaration. Typically:</p>\n<pre>!define UMUI_SETUPTYPEPAGE_STANDARD \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"</pre>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_STANDARD_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the standard radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_STANDARD_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the standard radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_STANDARDBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the standard radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Standard.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\StandardEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_COMPLETE</strong></span> <span class=\"parameter\">InstTypeName</span><br />\n      Enable the complete option. The InstTypeName must correspond to an existing InstType declaration. Typically:</p>\n<pre>!define UMUI_SETUPTYPEPAGE_COMPLETE \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"</pre>\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_COMPLETE_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Title of the complete radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_COMPLETE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display under the complete radiobutton.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_COMPLETEBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n        Bitmap image to display under the complete radiobutton.<br />\n        <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Complete.bmp<br />\n        Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\CompleteEx.bmp</em></span></p>\n      </div>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_CUSTOM_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n      Title of the custom radiobutton.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_CUSTOM_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display under the custom radiobutton.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_CUSTOMBITMAP</strong></span> <span class=\"parameter\">bmp_file</span><br />\n      Bitmap image to display under the custom radiobutton.<br />\n      <span class=\"blue\"><em>Default with UMUI: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\Custom.bmp<br />\n      Default with MUIEx: ${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\CustomEx.bmp</em></span></p>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_DEFAULTCHOICE</strong></span> <span class=\"parameter\">flag</span><br />\n      The default selected flag: must be one of ${UMUI_MINIMAL}, ${UMUI_STANDARD}, ${UMUI_COMPLETE} or ${UMUI_CUSTOM}<br />\n      <span class=\"blue\"><em>Default: ${UMUI_CUSTOM}</em></span></p>\n\n      <p><span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"blue\"><strong>UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store selected setup type. The page will use it to remember the selected setup type. This value will be automatically saved to the registry on install success. Don't forget to remove this key during uninstallation.<br />\n      UMUI_SETUPTYPEPAGE_REGISTRY_ROOT and UMUI_SETUPTYPEPAGE_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p>You can use the macro UMUI_GET_CHOOSEN_SETUP_TYPE_TEXT to get the selected setup type text for, by example, the Confirm page function:</p>\n<pre>Function confirm_function\n; ...\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SETUPTYPE_TITLE):\"\n  !insertmacro UMUI_GET_CHOOSEN_SETUP_TYPE_TEXT\n  Pop $R0\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $R0\"\n; ...\nFunctionEnd</pre>\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgc\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgc', 'toggle_pgc');\" /> Components Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgc\">\n\n      <p><strong>MUI_COMPONENTSPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><strong>MUI_COMPONENTSPAGE_TEXT_COMPLIST</strong> <span class=\"parameter\">text</span><br />\n      Text to display on next to the components list.</p>\n\n      <p><strong>MUI_COMPONENTSPAGE_TEXT_INSTTYPE</strong> <span class=\"parameter\">text</span><br />\n      Text to display on next to the installation type combo box.</p>\n\n      <p><strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the of the top of the description box.</p>\n\n      <p><strong>MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO</strong> <span class=\"parameter\">text</span><br />\n      Text to display inside the description box when no section is selected.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store selected setup type. The page will use it to remember the selected setup type. This value will be automatically saved to the registry on install success. Don't forget to remove this key during uninstallation.<br />\n      UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_ROOT and UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"blue\"><strong>UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store selected components. The page will use it to remember the selected components. This value will be automatically saved to the registry on install success. Don't forget to remove this key during uninstallation.<br />\n      UMUI_COMPONENTSPAGE_REGISTRY_ROOT and UMUI_COMPONENTSPAGE_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.<br />\n      Components must be declared using UMUI_COMPONENT macro surrounded by UMUI_DECLARECOMPONENTS_BEGIN and UMUI_DECLARECOMPONENTS_END macros:</p>\n<pre>Section \"Section 1\" SecID1\nSectionEnd\nSection \"Section 2\" SecID2\nSectionEnd\n\n!insertmacro UMUI_DECLARECOMPONENTS_BEGIN\n  !insertmacro UMUI_COMPONENT SecID1\n  !insertmacro UMUI_COMPONENT SecID2\n!insertmacro UMUI_DECLARECOMPONENTS_END</pre>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgd\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgd', 'toggle_pgd');\" /> Directory Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgd\">\n\n      <p><strong>MUI_DIRECTORYPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n      Text to display on top of the page.</p>\n\n      <p><strong>MUI_DIRECTORYPAGE_TEXT_DESTINATION</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the destination folder frame.</p>\n\n      <p><strong>MUI_DIRECTORYPAGE_VARIABLE</strong> <span class=\"parameter\">variable</span><br />\n      Variable in which to store the selected folder.<br />\n      <em>Default: $INSTDIR</em></p>\n\n      <p><strong>MUI_DIRECTORYPAGE_VERIFYONLEAVE</strong><br />\n      Does not disable the Next button when a folder is invalid but allows you to use GetInstDirError in the leave function to handle an invalid folder.</p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgs\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgs', 'toggle_pgs');\" /> Start Menu Folder Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgs\">\n\n      <p>For that the START_MENU page uses the colors of background and of text, you must use at least the version 2.06 of NSIS</p>\n\n      <p>Put the code to write the shortcuts (using CreateShortcut) between the MUI_STARTMENU_WRITE_BEGIN and MUI_STARTMENU_WRITE_END macros:</p>\n<pre>!insertmacro MUI_STARTMENU_WRITE_BEGIN page_id\n...create shortcuts...\n!insertmacro MUI_STARTMENU_WRITE_END</pre>\n\n      <p>The page ID should be the ID of the page on which the user has selected the folder for the shortcuts you want to write.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_TEXT_CHECKBOX</strong> <span class=\"parameter\">text</span><br />\n      Text to display next to the checkbox to disable the Start Menu folder creation.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_DEFAULTFOLDER</strong> <span class=\"parameter\">folder</span><br />\n      The default Start Menu Folder.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_NODISABLE</strong><br />\n      Do not display the checkbox to disable the creation of Start Menu shortcuts.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_REGISTRY_ROOT</strong> <span class=\"parameter\">root</span><br />\n      <strong>MUI_STARTMENUPAGE_REGISTRY_KEY</strong> <span class=\"parameter\">key</span><br />\n      <strong>MUI_STARTMENUPAGE_REGISTRY_VALUENAME</strong> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the Start Menu folder. The page will use it to remember the users preference. This value will be automatically saved to the registry on install success. You should also use for the uninstaller to remove the Start Menu folders. Don't forget to remove this key during uninstallation.<br />\n      MUI_STARTMENUPAGE_REGISTRY_ROOT and MUI_STARTMENUPAGE_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p>For the uninstaller, use the <strong>MUI_STARTMENU_GETFOLDER</strong> macro to get the Start Menu folder:</p>\n<pre>!insertmacro MUI_STARTMENU_GETFOLDER page_id $R0\nDelete \"$SMPROGRAMS\\$R0\\Your Shortcut.lnk\"</pre>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgasm\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgasm', 'toggle_pgasm');\" /> Alternative Start Menu Folder Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgasm\">\n\n      <p>For that the START_MENU page uses the colors of background and of text, you must use at least the version 2.06 of NSIS</p>\n\n      <p>Put the code to write the shortcuts (using CreateShortcut) between the MUI_STARTMENU_WRITE_BEGIN and MUI_STARTMENU_WRITE_END macros:</p>\n\n<pre>!insertmacro MUI_STARTMENU_WRITE_BEGIN page_id\n...create shortcuts...\n!insertmacro MUI_STARTMENU_WRITE_END</pre>\n\n      <p>The page ID should be the ID of the page on which the user has selected the folder for the shortcuts you want to write.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_TEXT_CHECKBOX</strong> <span class=\"parameter\">text</span><br />\n      Text to display next to the checkbox to disable the Start Menu folder creation.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_DEFAULTFOLDER</strong> <span class=\"parameter\">folder</span><br />\n      The default Start Menu Folder.</p>\n\n      <p><strong>MUI_STARTMENUPAGE_NODISABLE</strong><br />\n      Do not display the checkbox to disable the creation of Start Menu shortcuts.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW</strong></span><br />\n      Replace the default ListVIew by a TreeView.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT</strong></span><br />\n      Show radio buttons to select ShellVarContext.</p>\n\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_STARTMENUPAGE_SHELL_VAR_CONTEXT_TITLE</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display on the top of the ShellVarContext GroupBox.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_STARTMENUPAGE_TEXT_FOR_ALL_USERS</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display next to the radio button to select for all users ShellVarContext.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_STARTMENUPAGE_TEXT_FOR_THE_CURRENT_USER</strong></span> <span class=\"parameter\">text</span><br />\n        Text to display next to the radio button to select the current user ShellVarContext.</p>\n      </div>\n\n      <p><strong>MUI_STARTMENUPAGE_REGISTRY_ROOT</strong> <span class=\"parameter\">root</span><br />\n      <strong>MUI_STARTMENUPAGE_REGISTRY_KEY</strong> <span class=\"parameter\">key</span><br />\n      <strong>MUI_STARTMENUPAGE_REGISTRY_VALUENAME</strong> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the Start Menu folder. The page will use it to remember the users preference. This value will be automatically saved to the registry on install success. You should also use for the uninstaller to remove the Start Menu folders. Don't forget to remove this key during uninstallation.<br />\n      MUI_STARTMENUPAGE_REGISTRY_ROOT and MUI_STARTMENUPAGE_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p>For the uninstaller, use the <strong>MUI_STARTMENU_GETFOLDER</strong> macro to get the Start Menu folder:</p>\n<pre>!insertmacro MUI_STARTMENU_GETFOLDER page_id $R0\nDelete \"$SMPROGRAMS\\$R0\\Your Shortcut.lnk\"</pre>\n\n      <p>You can use the <strong>UMUI_GETSHELLVARCONTEXT</strong> macro to get the selected selected shell var context for, by example, the Confirm page function:</p>\n<pre>Function confirm_function\n; ...\n  ;Only if StartMenu Folder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n        \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER)\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $STARTMENU_FOLDER\"\n\n    ;ShellVarContext\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $1\n    StrCmp $1 \"all\" 0 current\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n          \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      Goto endsvc\n    current:\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n          \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    endsvc:\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  !insertmacro MUI_STARTMENU_WRITE_END\n; ...\nFunctionEnd</pre>\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_adt\" src=\"images/closed.gif\" onclick=\"toggle('trigger_adt', 'toggle_adt');\" /> AdditionalTasks Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_adt\">\n\n      <p><span class=\"blue\"><strong>UMUI_ADDITIONALTASKSPAGE_TEXT_TOP</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_ADDITIONALTASKS_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"blue\"><strong>UMUI_ADDITIONALTASKS_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"blue\"><strong>UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the AddistionalTasks value. The page will use it to remember the all selected all value selected on all the AddistionalTasks pages. This value will be automatically saved to the registry on install success. Don't forget to remove this key during uninstallation.<br />\n      UMUI_ADDITIONALTASKS_REGISTRY_ROOT and UMUI_ADDITIONALTASKS_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.</p>\n\n      <p>The page take a function in parameter containing some macro to add elements on the page.<br />\n      <strong>UMUI_ADDITIONALTASKSPAGE_ADD_LABEL</strong> <span class=\"parameter\">text</span><br />\n      Macro to add a text;<br />\n      <strong>UMUI_ADDITIONALTASKSPAGE_ADD_TASK</strong> <span class=\"parameter\">taskID isChecked text</span><br />\n      Macro to add a checkbox task;<br />\n      <strong>UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO</strong> <span class=\"parameter\">taskID isSelected text</span><br />\n      Macro to add a radio task;<br />\n      <strong>UMUI_ADDITIONALTASKSPAGE_ADD_EMPTYLINE</strong><br />\n      Macro to add an empty line;<br />\n      <strong>UMUI_ADDITIONALTASKSPAGE_ADD_LINE</strong><br />\n      Macro to add an horizontal line;<br />\n       for example:</p>\n<pre>Function addtasks_function\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK DESKTOP 1 \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK QUICK_LAUNCH 1 \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_EMPTYLINE\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK STARTUP 1 \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK ASSOCIATE 0 \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH) .UMUI $(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LINE\n\n  ; only if a directory has been selected in the STARTMENU page\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n    !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO ALL 1 \\\n      \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n    !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 0 \\\n      \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n  !insertmacro MUI_STARTMENU_WRITE_END\n\nFunctionEnd</pre>\n\n      <p>You can use the <strong>UMUI_ADDITIONALTASKS_IF_CKECKED, UMUI_ADDITIONALTASKS_IF_NOT_CKECKED</strong> and <strong>UMUI_ADDITIONALTASKS_ENDIF</strong> macros to check if element is selected.<br />\n      By example, the Confirm page function:</p>\n<pre>Function confirm_function\n; ...\n  ;Only if one at least of the six checks is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP|QUICK_LAUNCH|STARTUP|ASSOCIATE|ALL|CURRENT\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"$(UMUI_TEXT_ADDITIONALTASKS_TITLE):\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if one at least of additional icon check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP|QUICK_LAUNCH\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"      $(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if the first check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"            $(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if the second check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED QUICK_LAUNCH\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"            $(UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if start programm at windows startup check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED STARTUP\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"      $(UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"            $(UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n  ;Only if file association check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ASSOCIATE\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"      $(UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"            $(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH) .UMUI $(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n  ; only if a directory has been selected in the STARTMENU page\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL|CURRENT\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if for all user radio is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if for current user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED CURRENT\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n      \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n; ...\nFunctionEnd</pre>\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgab\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgab', 'toggle_pgab');\" /> Install Confirm Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgab\">\n\n      <p><span class=\"blue\"><strong>UMUI_CONFIRMPAGE_TEXT_TOP</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_CONFIRMPAGE_TEXT_BOTTOM</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the bottom of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_CONFIRMPAGE_TEXTBOX</strong></span> <span class=\"parameter\">function_name</span><br />\n      Draw a TextBox in which will be post the current configuration. The function will be use to add lines (using the UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE macro).</p>\n\n      <p>For example to add the Destination Location and the Start Menu Floder :</p>\n<pre>Function function_name\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n    \"$(UMUI_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \" $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  ;Only if StartMenu Floder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \\\n    \"$(UMUI_INSTCONFIRM_TEXTBOX_START_MENU_FLODER)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \" $STARTMENU_FOLDER\"\n  !insertmacro MUI_STARTMENU_WRITE_END\nFunctionEnd</pre>\n\n      <p>Use the <strong>UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE</strong> macro to add lines with a empty string to jump a line.<br />\n      The $(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION) and <br />\n      $(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FLODER) variables are defined in the langage files. </p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_fdr\" src=\"images/closed.gif\" onclick=\"toggle('trigger_fdr', 'toggle_fdr');\" /> FileDiskRequest Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_fdr\">\n\n      <p>This page is shown only when the file to search is not on the folder stored on the specified variable.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_FILEDISKREQUESTPAGE_TEXT_TOP</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_FILEDISKREQUESTPAGE_TEXT_PATH</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the folder frame.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_FILEDISKREQUESTPAGE_FILE_NAME</strong></span> <span class=\"parameter\">name</span><br />\n      The name of the file to search.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_FILEDISKREQUESTPAGE_DISK_NAME</strong></span> <span class=\"parameter\">name</span><br />\n      Optional. The name of the disk containing the file to search. This parameter change the default UMUI_FILEDISKREQUESTPAGE_TEXT_TOP.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_FILEDISKREQUESTPAGE_VARIABLE</strong></span> <span class=\"parameter\">variable</span><br />\n      Variable in which to store the selected folder.</p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgi\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgi', 'toggle_pgi');\" /> Installation Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgi\">\n\n      <p><strong>MUI_INSTFILESPAGE_FINISHHEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the header of the installation page when the installation has been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>\n\n      <p><strong>MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n      Subext to display on the header of the installation page when the installation has been completed (won't be displayed when using a Finish page without MUI_(UN)FINISHPAGE_NOAUTOCLOSE).</p>\n\n      <p><strong>MUI_INSTFILESPAGE_ABORTHEADER_TEXT</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the header of the installation page when the installation has been aborted.</p>\n\n      <p><strong>MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT</strong> <span class=\"parameter\">text</span><br />\n      Subext to display on the header of the installation page when the installation has been aborted.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_INSTFILEPAGE_ENABLE_CANCEL_BUTTON</strong></span> <span class=\"parameter\">function_name</span><br />\n      Enable the instfile page cancel button and call the function_name in case of cancelled. This function must cancel the modifications of the system that there could have had. For the UNPAGE_INSTFILE, this function must begin with \"un.\" . </p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgf', 'toggle_pgf');\" /> Finish Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgf\">\n\n      <p><strong>MUI_FINISHPAGE_TITLE</strong> <span class=\"parameter\">title</span><br />\n      Title to display on the top of the page.</p>\n\n      <p><strong>MUI_FINISHPAGE_TITLE_3LINES</strong><br />\n      Extra space for the title area.<br />\n      It is not used in the alternate finish page.</p>\n\n      <p><strong>MUI_FINISHPAGE_TEXT</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the page. Use \\r\\n for a newline.</p>\n\n      <p><strong>MUI_FINISHPAGE_TEXT_LARGE</strong><br />\n      Extra space for the text area (if using checkboxes).</p>\n\n      <p><strong>MUI_FINISHPAGE_BUTTON</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the Finish button.</p>\n\n      <p><strong>MUI_FINISHPAGE_TEXT_REBOOT</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the finish page when asking for a system reboot. Use \\r\\n for a newline.</p>\n\n      <p><strong>MUI_FINISHPAGE_TEXT_REBOOTNOW</strong> <span class=\"parameter\">text</span><br />\n      Text to display next to the 'Reboot now' option button.</p>\n\n      <p><strong>MUI_FINISHPAGE_TEXT_REBOOTLATER</strong> <span class=\"parameter\">text</span><br />\n      Text to display next to the 'Reboot later' option button.</p>\n\n      <p><strong>MUI_FINISHPAGE_RUN</strong> <span class=\"parameter\">exe_file</span><br />\n      Application which the user can select to run using a checkbox. You don't need to put quotes around the filename when it contains spaces.</p>\n\n      <div>\n        <p><strong>MUI_FINISHPAGE_RUN_TEXT</strong> <span class=\"parameter\">text</span><br />\n        Texts to display next to the 'Run program' checkbox.</p>\n\n        <p><strong>MUI_FINISHPAGE_RUN_PARAMETERS</strong> <span class=\"parameter\">parameters</span><br />\n        Parameters for the application to run. Don't forget to escape double quotes in the value (use $\\\").</p>\n\n        <p><strong>MUI_FINISHPAGE_RUN_NOTCHECKED</strong><br />\n        Do not check the 'Run program' checkbox by default</p>\n\n        <p><strong>MUI_FINISHPAGE_RUN_FUNCTION</strong> <span class=\"parameter\">function_name</span><br />\n        Call a function instead of executing an application (define MUI_FINISHPAGE_RUN without parameters). You can use the function to exectute multiple applications or you can change the checkbox name and use it for other things.</p>\n      </div>\n\n      <p><strong>MUI_FINISHPAGE_SHOWREADME</strong> <span class=\"parameter\">file/url</span><br />\n      File or website which the user can select to view using a checkbox. You don't need to put quotes around the filename when it contains spaces.</p>\n\n      <div>\n        <p><strong>MUI_FINISHPAGE_SHOWREADME_TEXT</strong> <span class=\"parameter\">text</span><br />\n        Texts to display next to the 'Show Readme' checkbox.</p>\n\n        <p><strong>MUI_FINISHPAGE_SHOWREADME_NOTCHECKED</strong><br />\n        Do not check the 'Show Readme' checkbox by default</p>\n\n        <p><strong>MUI_FINISHPAGE_SHOWREADME_FUNCTION</strong> <span class=\"parameter\">function_name</span><br />\n        Call a function instead of showing a file (define MUI_FINISHPAGE_SHOWREADME without parameters). You can use the function to show multiple files or you can change the checkbox name and use it for other things.</p>\n      </div>\n\n      <p><strong>MUI_FINISHPAGE_LINK</strong> <span class=\"parameter\">link_text</span><br />\n      Text for a link on the which the user can click to view a website or file.</p>\n\n      <div>\n        <p><strong>MUI_FINISHPAGE_LINK_LOCATION</strong> <span class=\"parameter\">file/url</span><br />\n        Website or file which the user can select to view using the link. You don't need to put quotes around the filename when it contains spaces.</p>\n\n        <p><strong>MUI_FINISHPAGE_LINK_COLOR</strong> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n        Text color for the link on the Finish page.<br />\n        <span class=\"purple\"><em>Default: ${UMUI_TEXT_LIGHTCOLOR}</em></span></p>\n      </div>\n\n      <p><strong>MUI_FINISHPAGE_NOREBOOTSUPPORT</strong><br />\n      Disables support for the page that allows the user to reboot the system. Define this option to save some space if you are not using the /REBOOTOK flag or SetRebootFlag.</p>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgau\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgau', 'toggle_pgau');\" /> Abort Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgau\"> <strong><span class=\"blue\">UMUI_ABORTPAGE_TITLE</span></strong> <span class=\"parameter\">title</span><br />\n\n      Title to display on the top of the page.\n\n      <p><span class=\"blue\"><strong>UMUI_ABORTPAGE_TITLE_3LINES</strong></span><br />\n      Extra space for the title area.<br />\n      It is not used in the alternate abort page.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_ABORTPAGE_TEXT</strong></span> <span class=\"parameter\">text</span><br />\n      Text to display on the page. Use \\r\\n for a newline.</p>\n\n      <p><span class=\"blue\"><strong>UMUI_ABORTPAGE_LINK</strong></span> <span class=\"parameter\">link_text</span><br />\n      Text for a link on the which the user can click to view a website or file.</p>\n\n      <div>\n        <p><span class=\"blue\"><strong>UMUI_ABORTPAGE_LINK_LOCATION</strong></span> <span class=\"parameter\">file/url</span><br />\n        Website or file which the user can select to view using the link. You don't need to put quotes around the filename when it contains spaces.</p>\n\n        <p><span class=\"blue\"><strong>UMUI_ABORTPAGE_LINK_COLOR</strong></span> <span class=\"parameter\">(color: RRGGBB hexadecimal)</span><br />\n        Text color for the link on the Finish page.<br />\n        <span class=\"blue\"><em>Default: ${UMUI_TEXT_LIGHTCOLOR}</em></span></p>\n      </div>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pgu\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pgu', 'toggle_pgu');\" /> Uninstall Confirm Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pgu\">\n\n      <p><strong>MUI_UNCONFIRMPAGE_TEXT_TOP</strong> <span class=\"parameter\">text</span><br />\n      Text to display on the top of the page.</p>\n\n      <p><strong>MUI_UNCONFIRMPAGE_TEXT_LOCATION</strong> <span class=\"parameter\">text</span><br />\n      Text to display next to the uninstall location text box.</p>\n\n      <strong>MUI_UNCONFIRMPAGE_VARIABLE</strong> <span class=\"parameter\">variable</span><br />\n      Variable in which to store the uninstall source folder.<br />\n      <em>Default: $INSTDIR</em></p>\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_pga\" src=\"images/closed.gif\" onclick=\"toggle('trigger_pga', 'toggle_pga');\" /> Advanced Page Settings</h3>\n    <div class=\"toggle\" id=\"toggle_pga\">\n\n      <p>You can add custom code to the page functions of your Modern UI pages. <a href=\"#customFunctions\">More info...</a></p>\n\n    </div>\n\n  </div>\n\n</div>\n\n\n\n<h2>4. Custom functions</h2>\n<div>\n\n  <p>If you want add your own code to functions inserted by the Modern UI (e.g. the .onGUIInit function and the page functions), create your own function and let the Modern UI functions call them.</p>\n\n  <p><a href=\"#customFunctions\">More info...</a></p>\n\n</div>\n\n\n<h2>5. Language files</h2>\n<div>\n\n  <p>Insert the Modern UI language files for the languages to want to include.</p>\n\n  <pre>!insertmacro MUI_LANGUAGE \"English\"<br /></pre>\n\n  <p>The Modern UI language files load the NLF language files, so you should not use LoadLanguageFile.</p>\n\n\n  <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_lp\" src=\"images/closed.gif\" onclick=\"toggle('trigger_lp', 'toggle_lp');\" /> Language Selection Page</h3>\n  <div class=\"toggle\" id=\"toggle_lp\">\n\n    <p>See the MultiLanguage Page Settings above.</p>\n\n  </div>\n\n\n  <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_ls\" src=\"images/closed.gif\" onclick=\"toggle('trigger_ls', 'toggle_ls');\" /> Language Selection Dialog</h3>\n  <div class=\"toggle\" id=\"toggle_ls\">\n\n    <p>If you want the installer to display a language selection dialog (have a look at the <a href=\"../../Examples/Modern%20UI/MultiLanguage.nsi\">MultiLanguage.nsi</a> example), insert the MUI_LANGDLL_DISPLAY macro in the .onInit function:</p>\n\n<pre>Function .onInit\n!insertmacro MUI_LANGDLL_DISPLAY\nFunctionEnd</pre>\n\n    <p>You can also use this macro for the uninstaller, in the un.onInit function.</p>\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_lss\" src=\"images/closed.gif\" onclick=\"toggle('trigger_lss', 'toggle_lss');\" /> Language Selection Dialog Settings</h3>\n    <div class=\"toggle\" id=\"toggle_lss\">\n\n      <p>To remember to users preference, you ca define a registry key.<br />\n\n      <strong>Note:</strong> These defines should be set before inserting the installation page macro.</p>\n\n      <p><span class=\"purple\"><strong>UMUI_LANGUAGE_REGISTRY_ROOT</strong></span> <span class=\"parameter\">root</span><br />\n      <span class=\"purple\"><strong>UMUI_LANGUAGE_REGISTRY_KEY</strong></span> <span class=\"parameter\">key</span><br />\n      <span class=\"purple\"><strong>UMUI_LANGUAGE_REGISTRY_VALUENAME</strong></span> <span class=\"parameter\">value_name</span><br />\n      The registry key to store the language. The users preference will be remembered. You can also use it for the uninstaller to display the right language. This value will be automatically saved to the registry on install success. Don't forget to remove this key in the uninstaller.<br />\n      UMUI_LANGUAGE_REGISTRY_ROOT and UMUI_LANGUAGE_REGISTRY_KEY defines are optional when <strong>UMUI_PARAMS_REGISTRY_ROOT</strong> and <strong>UMUI_PARAMS_REGISTRY_KEY</strong> are defined.<br />\n      The MUI_LANGDLL_REGISTRY_ROOT, MUI_LANGDLL_REGISTRY_KEY and MUI_LANGDLL_REGISTRY_VALUENAME defines has been renamed in Ultra-Modern UI.</p>\n\n      <p>For the uninstaller, insert the <strong>MUI_UNGETLANGUAGE</strong> macro in un.onInit to get the stored language preference:</p>\n\n<pre>Function un.onInit\n!insertmacro MUI_UNGETLANGUAGE\nFunctionEnd</pre>\n\n    </div>\n\n\n    <h3><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_lsin\" src=\"images/closed.gif\" onclick=\"toggle('trigger_lsin', 'toggle_lsin');\" /> Language Selection Dialog Interface Settings</h3>\n    <div class=\"toggle\" id=\"toggle_lsin\">\n\n      <p>To customize the language selection dialog interface, use these defines before inserting the MUI_LANGDLL_DISPLAY macro.</p>\n\n      <p><strong>MUI_LANGDLL_WINDOWTITLE</strong> <span class=\"parameter\">text</span><br />\n      The window title of the language selection dialog.</p>\n\n      <p><strong>MUI_LANGDLL_INFO</strong> <span class=\"parameter\">text</span><br />\n      The text to display on the language selection dialog.</p>\n\n      <p><span class=\"purple\"><strong>UMUI_LANGUAGE_ALWAYSSHOW</strong></span><br />\n      Always show the language selection dialog, even if a language has been stored in the registry. The language stored in the registry will be selected by default.<br />\n      The MUI_LANGDLL_ALWAYSSHOW define has been renamed in UltraModernUI.</p>\n\n    </div>\n\n  </div>\n\n</div>\n\n\n\n<h2>6. Reserve files</h2>\n<div>\n\n  <p>If you are using solid compression (by default, solid compression is enabled for BZIP2 and LZMA), it's important that files which are being extracted in init- or page functions function are located before other files in the data block, because this will make your installer faster.</p>\n\n  <p>If there are File commands in your sections or functions above the init- or page functions, add the reserve file macros above your sections and functions.</p>\n\n  <pre>ReserveFile \"ioFile.ini\" ;Your own InstallOptions INI files<br />!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in<br />!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog<br /></pre>\n\n</div>\n\n\n\n<h2>7. Your own sections and functions</h2>\n<div>\n\n  <p>Add your installer sections and functions. See the NSIS Users Manual for details.</p>\n\n  <p>Information about section code and function code for Start Menu shortcut creation and language selection can be found above.</p>\n\n</div>\n\n\n\n<h2>8. Section descriptions</h2>\n<div>\n\n  <p>The descriptions of sections will be displayed on the components page, when the user hovers the mouse over a section. If you don't want to use descriptions, use the MUI_COMPONENTSPAGE_NODESC interface setting.</p>\n\n  <p>To set a description for a section, you have to add an additional parameter to the Section commmand with a name for the define that should contain the section number.</p>\n\n<pre>Section \"Section Name 1\" Section1\n ...\nSectionEnd</pre>\n\n  <p>Use these macros to set the descriptions:</p>\n  <pre>LangString DESC_Section1 ${LANG_ENGLISH} \"Description of section 1.\"<br />LangString DESC_Section2 ${LANG_ENGLISH} \"Description of section 2.\"<br /><br />!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN<br /> !insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)<br /> !insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)<br />!insertmacro MUI_FUNCTION_DESCRIPTION_END<br /></pre>\n\n  <p>For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN and MUI_UNFUNCTIONS_DESCRIPTION_END macros.</p>\n\n</div>\n\n</div>\n\n\n<h1><a id=\"customPages\"></a>Custom pages</h1>\n<div>\n\n   <p>If you want add your custom pages to your installer, you should insert your own page commands between the page macros.</p>\n\n<pre>!insertmacro MUI_PAGE_WELCOME\nPage custom FunctionName ;Custom page\n!insertmacro MUI_PAGE_COMPONENTS\n\n;Uninstaller\n!insertmacro MUI_UNPAGE_CONFIRM\nUninstPage custom un.FunctionName ;Custom page\n!insertmacro MUI_UNPAGE_INSTFILES</pre>\n\n\n  <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_io\" src=\"images/closed.gif\" onclick=\"toggle('trigger_io', 'toggle_io');\" /> Using InstallOptions or InstallOptionsEx for custom pages</h2>\n  <div class=\"toggle\" id=\"toggle_io\">\n\n    <p>Ultra-Modern UI support natively two plug-ins to displays custom pages which you can create using INI files. InstallOptions and InstallOptionsEx:</p>\n\n    <p>InstallOptions is the original plug-in used by Modern UI.</p>\n\n    <p>InstallOptionsEx, writing by deguix and by SuperPat since version 2.4.5, is an expanded version of InstallOptions containing many new features, with size drawback.</p>\n\n    <p>Have a look at the <a target=\"_blank\" href=\"../InstallOptions/Readme.html\">InstallOptions documentation</a> or the <a target=\"_blank\" href=\"../InstallOptionsEx/Readme.html\">InstallOptionsEx documentation</a> for info about creating InstallOptions(Ex) INI files.</p>\n\n    <p>If you wan't to use InstallOptionEx Instead of the original IntallOption pluyg-in, you have to use the <strong>UMUI_USE_INSTALLOPTIONSEX</strong> define.</p>\n  \n    <p>InstallOptionEx is used in the Alternative Start Menu page to show Start Menu directories in a TreeView and in the Information pages to show RichText files. You can't use these features if InstallOptionEx is not activated.</p>\n\n\n    <p>Next, you have to extract your InstallOptions INI File in the .onInit function (un.onInit for the uninstaller) using the <strong>MUI_INSTALLOPTIONS_EXTRACT</strong> macro:</p>\n\n<pre>Function .onInit\n!insertmacro MUI_INSTALLOPTIONS_EXTRACT \"ioFile.ini\"\nFunctionEnd</pre>\n\n    <p>If your INI File is located in another directory, use MUI_INSTALLOPTIONS_EXTRACT_AS. The second parameter is the filename for the temporary plug-ins directory, use this filename as parameter for the other InstallOptions macros.</p>\n\n<pre>Function .onInit\n!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS \"..\\ioFile.ini\" \"ioFile.ini\"\nFunctionEnd</pre>\n\n    <p>You can call InstallOptions in the function defined with the Page or UninstPage command using the MUI_INSTALLOPTIONS_DISPLAY macro. \n    This macro skin automatically your custom pages. It can also automatically convert, on the fly, your custom InstallOptions INI into an InstallOptionsEx INI.</p>\n\n    <p>If the UMUI_(UN)PAGE_ABORT page is inserted, you need to use the <strong>UMUI_ABORT_IF_INSTALLFLAG_IS</strong> macro with the ${UMUI_CANCELLED} flag to hide the page when user cancel the installation:</p>\n    <p>Use the <strong>MUI_HEADER_TEXT</strong> macro to set the text on the page header:</p>\n\n<pre>LangString TEXT_IO_TITLE ${LANG_ENGLISH} \"Install Options Page Title\"\nLangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} \"A subtitle\"\nFunction FunctionName ;FunctionName defined with Page command\n  <span class=\"blue\">\n  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n  </span>\n  !insertmacro MUI_HEADER_TEXT \"$(TEXT_IO_TITLE)\" \"$(TEXT_IO_SUBTITLE)\"\n  !insertmacro MUI_INSTALLOPTIONS_DISPLAY \"ioFile.ini\"\nFunctionEnd</pre>\n\n    <p>For custom fonts and colors, macros for the initDialog and show functions of InstallOptions are also available. It can automatically convert, on the fly, your custom InstallOptions INI into an InstallOptionsEx INI. \n    Contrary to the MUI_INSTALLOPTIONS_DISPLAY macro, These one can't skin automatically your pages and you need to apply manually the text color and background color to all fields:</p>\n\n<pre>Var HWND\nVar DLGITEM\nVar FONT\nLangString TEXT_IO_TITLE ${LANG_ENGLISH} \"Install Options Page Title\"\nLangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} \"A subtitle\"\nFunction FunctionName ;FunctionName defined with Page command\n  <span class=\"blue\">\n  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n  </span>\n  !insertmacro MUI_HEADER_TEXT \"$(TEXT_IO_TITLE)\" \"$(TEXT_IO_SUBTITLE)\"\n  !insertmacro MUI_INSTALLOPTIONS_INITDIALOG \"ioFile.ini\"\n  Pop $HWND ;HWND of dialog\n  <span class=\"blue\">\n  ;If you do not use MUIEx, apply the background color to the page:\n  ; Manually:\n  SetCtlColors $HWND \"\" \"${MUI_BGCOLOR}\"\n  ; or if you use a background image:\n  SetCtlColors $HWND \"\" \"transparent\"\n  ; Or using this macro:\n  !insertmacro UMUI_IOPAGEBGTRANSPARENT_INIT $HWND\n\n  ;You can apply the right text color and background color to all the Text, Password,\n  ; DateTime, IPAddress, ListBox, ComboBox, DropList, FileRequest and DirRequest fields\n  ; Manually:\n  GetDlgItem $0 $HWND 1200\n  SetCtlColors $0 ${UMUI_TEXT_INPUTCOLOR} ${UMUI_BGINPUTCOLOR}\n  ; Or using this macro:\n  GetDlgItem $0 $HWND 1201\n  !insertmacro UMUI_IOPAGEINPUTCTL_INIT $0\n\n  ;You need to apply the right text color and background color to all the Link fields\n  ; Manually:\n  GetDlgItem $0 $HWND 1202\n  SetCtlColors $0 ${UMUI_TEXT_LIGHTCOLOR} ${MUI_BGCOLOR}\n  ; or if you use a background image:\n  SetCtlColors $0 ${UMUI_TEXT_LIGHTCOLOR} \"transparent\"\n  ; Or using this macro:\n  GetDlgItem $0 $HWND 1203\n  !insertmacro UMUI_IOPAGECTLLIGHTTRANSPARENT_INIT $0\n\n  ;You need to apply the right text color and background color to all the\n  ; GroupBox fields\n  ; Manually:\n  GetDlgItem $0 $HWND 1202\n  SetCtlColors $0 ${UMUI_TEXT_LIGHTCOLOR} ${MUI_BGCOLOR}\n  ; Or using this macro:\n  GetDlgItem $0 $HWND 1203\n  !insertmacro UMUI_IOPAGECTLLIGHT_INIT $0\n\n  ;If you do not use MUIEx, you need to apply the right text color and background color\n  ; to all the label, checkbox, radiobutton fields\n  ; Manually:\n  GetDlgItem $0 $HWND 1204\n  SetCtlColors $0 ${MUI_TEXTCOLOR} ${MUI_BGCOLOR}\n  ; or if you use a background image:\n  SetCtlColors $0 ${MUI_TEXTCOLOR} \"transparent\"\n  ; Or using this macro:\n  GetDlgItem $0 $HWND 1205\n  !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $0\n  </span>\n  GetDlgItem $DLGITEM $HWND 1200 ;1200 + Field number - 1\n  ;$DLGITEM contains the HWND of the first field\n  CreateFont $FONT \"Tahoma\" 10 700 SendMessage $DLGITEM ${WM_SETFONT} $FONT 0\n  !insertmacro MUI_INSTALLOPTIONS_SHOW\nFunctionEnd</pre>\n\n    <p>If you need the InstallOptions return value (success, back, cancel, error), use the <strong>MUI_INSTALLOPTIONS_DISPLAY_RETURN</strong> or <strong>MUI_INSTALLOPTIONS_SHOW_RETURN</strong> macros. The return value will be added to the stack, so you can use the Pop command to get it.</p>\n\n    <p>Use these macros to read or write INI file values:</p>\n\n<pre>!insertmacro MUI_INSTALLOPTIONS_READ $VAR \"ioFile.ini\" \"Field #\" \"Name\"\n!insertmacro MUI_INSTALLOPTIONS_WRITE \"ioFile.ini\" \"Field #\" \"Name\" \"Value\"</pre>\n\n    <p>For example, you can use the <strong>MUI_INSTALLOPTIONS_READ</strong> macro in a section to get the user input:</p>\n\n    <pre>!insertmacro MUI_INSTALLOPTIONS_READ $R0 \"ioFile.ini\" \"Field 1\" \"State\"</pre>\n\n    <p>For more details about InstallOptions, validation of user input etc., check the <a target=\"_blank\" href=\"../InstallOptions/Readme.html\">InstallOptions documentation</a> or the <a href=\"../InstallOptionsEx/Readme.html\">InstallOptionsEx documentation</a>.</p>\n\n  </div>\n\n\n  <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_nsDialogs\" src=\"images/closed.gif\" onclick=\"toggle('trigger_nsDialogs', 'toggle_nsDialogs');\" /> Using nsDialogs for custom pages</h2>\n  <div class=\"toggle\" id=\"toggle_nsDialogs\">\n\n    <p>nsDialogs is the official plug-in used by Modern UI 2.</p>\n\n    <p>Ultra-Modern UI version 2 still not use the nsDialogs plug-in to displays custom pages but InstallOptions(Ex), so usage of nsDialogs is not recommended because two concurrent plug-ins will be used in parallel due to custom UMUI pages.</p>\n\n    <p>Have a look at the <a target=\"_blank\" href=\"../nsDialogs/Readme.html\">nsDialogs documentation</a> for info about creating nsDialogs custom pages.</p>\n\n    <p>Contrary to InstallOptions(Ex), Ultra-Modern UI does not have macro to skin automatically your custom pages.</p>\n\n    <p>If the UMUI_(UN)PAGE_ABORT page is inserted, you need to use the <strong>UMUI_ABORT_IF_INSTALLFLAG_IS</strong> macro with the ${UMUI_CANCELLED} flag to hide the page when user cancel the installation:</p>\n    <p>Use the <strong>MUI_HEADER_TEXT</strong> macro to set the text on the page header:</p>\n\n<pre>!include nsDialogs.nsh\nLangString TEXT_NSD_TITLE ${LANG_ENGLISH} \"nsDialogs Page Title\"\nLangString TEXT_NSD_SUBTITLE ${LANG_ENGLISH} \"A subtitle\"\nFunction FunctionName ;FunctionName defined with Page command\n  <span class=\"blue\">\n  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n  </span>\n  !insertmacro MUI_HEADER_TEXT \"$(TEXT_NSD_TITLE)\" \"$(TEXT_NSD_SUBTITLE)\"\n  nsDialogs::Create 1018\n  Pop $HWND ;HWND of dialog\n  <span class=\"blue\">\n  ;If you do not use MUIEx, apply the background color to the page:\n  ; Manually:\n  SetCtlColors $HWND \"\" \"${MUI_BGCOLOR}\"\n  ; or if you use a background image:\n  SetCtlColors $HWND \"\" \"transparent\"\n  ; Or using this macro:\n  !insertmacro UMUI_IOPAGEBGTRANSPARENT_INIT $HWND\n  </span>\n  ${NSD_CreateText} 0 35 100% 12u hello\n  Pop $0\n  <span class=\"blue\">\n  ;You can apply the right text color and background color to all the Text, Password,\n  ; Number, ListBox, ComboBox, DropList, FileRequest and DirRequest input fields\n  ; Manually:\n  SetCtlColors $0 ${UMUI_TEXT_INPUTCOLOR} ${UMUI_BGINPUTCOLOR}\n  ; Or using this macro:\n  !insertmacro UMUI_IOPAGEINPUTCTL_INIT $0\n  </span>\n  ${NSD_CreateLink} 10 120 100% 12 \"http://ultramodernui.sourceforge.net/\"\n  Pop $0\n  ${NSD_OnClick} $0 onClickMyLink  \n  <span class=\"blue\">\n  ;You need to apply the right text color and background color to all the Link fields\n  ; Manually:\n  SetCtlColors $0 ${UMUI_TEXT_LIGHTCOLOR} ${MUI_BGCOLOR}\n  ; or if you use a background image:\n  SetCtlColors $0 ${UMUI_TEXT_LIGHTCOLOR} \"transparent\"\n  ; Or using this macro:\n  !insertmacro UMUI_IOPAGECTLLIGHTTRANSPARENT_INIT $0\n  </span>\n  ${NSD_CreateGroupBox} 0 40u 100% 40u \"Group\"\n  Pop $0\n  <span class=\"blue\">\n  ;You need to apply the right text color and background color to all the\n  ; GroupBox fields\n  ; Manually:\n  SetCtlColors $0 ${UMUI_TEXT_LIGHTCOLOR} ${MUI_BGCOLOR}\n  ; Or using this macro:\n  !insertmacro UMUI_IOPAGECTLLIGHT_INIT $0\n  </span>\n  ${NSD_CreateCheckbox} 0 -50 100% 8u Test\n  Pop $0\n  GetFunctionAddress $HWND OnCheckbox\n  nsDialogs::OnClick $0 $HWND\n  <span class=\"blue\">\n  ;If you do not use MUIEx, you need to apply the right text color and background color\n  ; to all the label, checkbox, radiobutton fields\n  ; Manually:\n  SetCtlColors $0 ${MUI_TEXTCOLOR} ${MUI_BGCOLOR}\n  ; or if you use a background image:\n  SetCtlColors $0 ${MUI_TEXTCOLOR} \"transparent\"\n  ; Or using this macro:\n  !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $0\n  </span>\n  nsDialogs::Show\nFunctionEnd</pre>\n\n    <p>For more details about nsDialogs, validation of user input etc., check the <a target=\"_blank\" href=\"../nsDialogs/Readme.html\">nsDialogs documentation</a>.</p>\n\n  </div>\n\n\n  <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_dlg\" src=\"images/closed.gif\" onclick=\"toggle('trigger_dlg', 'toggle_dlg');\" /> Customize standard dialogs</h2>\n  <div class=\"toggle\" id=\"toggle_dlg\">\n\n    <p>To change elements on the dialogs, use customized UI resource files (see <a href=\"#interfaceConf\">Interface Configuration</a>).\n    You can change your copies of the original files (in the Contrib\\UIs folder) by using an application such as <a target=\"_blank\" href=\"http://www.users.on.net/johnson/resourcehacker/\">Resource Hacker</a>.</p>\n\n    <p>The 'Please wait while Setup is loading...' text on the splash screen that is being displayed while the installer is starting (Verifying installer, Unpacking data) can be changed by using a customized UI resource file (MUI_UI setting) with a modified dialog 111.<br />\n    The 'Verifying installer' and 'Unpacking data' texts are defined in the language header file of the NSIS exehead (Source\\exehead\\lang.h). To change them, you have to edit this file and recompile NSIS.</p>\n\n    <p>To modify the Welcome dialog and Finish dialog, use a custom INI file (MUI_SPECIALINI setting) or write to the INI file in the custom page functions.</p>\n\n  </div>\n\n</div>\n\n\n\n<h1><a id=\"customFunctions\"></a>Customize Ultra-Modern UI Functions</h1>\n<div>\n\n  <p>If you want add your own code to functions inserted by the Ultra-Modern UI, such as the .onGUIInit function and the Page functions, create your own function and let the Ultra-Modern UI functions call them. Use the defines to define the name of your functions.</p>\n  <p>Contrary to Modern UI, Ultra-Modern UI may also define itself, if background skin is used, the .onGUIEnd and the un.onGUIEnd functions. Consequently, you may not be able to declare them in your script, and, in this case, you must used this customization.</p>\n\n  <p>Example:</p>\n\n<pre>!define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit\nFunction myGUIInit\n ...your own code...\nFunctionEnd\n\n<span class=\"blue\">!define UMUI_CUSTOMFUNCTION_GUIEND myGUIEnd\nFunction myGUIEnd\n ...your own code...\nFunctionEnd</span>\n\n!define MUI_CUSTOMFUNCTION_UNGUIINIT myunGUIInit\nFunction myunGUIInit\n ...your own code...\nFunctionEnd\n\n<span class=\"blue\">!define UMUI_CUSTOMFUNCTION_UNGUIEND myunGUIEnd\nFunction myunGUIEnd\n ...your own code...\nFunctionEnd</span></pre>\n\n\n  <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_cfg\" src=\"images/closed.gif\" onclick=\"toggle('trigger_cfg', 'toggle_cfg');\" /> General Custom Functions</h2>\n  <div class=\"toggle\" id=\"toggle_cfg\">\n\n    <p>These defines should be set before inserting the language macros.</p>\n\n    <p><strong>MUI_CUSTOMFUNCTION_GUIINIT</strong> <span class=\"parameter\">function</span><br />\n    <strong>MUI_CUSTOMFUNCTION_UNGUIINIT</strong> <span class=\"parameter\">function</span><br />\n    <span class=\"blue\"><strong>UMUI_CUSTOMFUNCTION_GUIEND</strong></span> <span class=\"parameter\">function</span><br />\n    <span class=\"blue\"><strong>UMUI_CUSTOMFUNCTION_UNGUIEND</strong></span> <span class=\"parameter\">function</span><br />\n    <strong>MUI_CUSTOMFUNCTION_ABORT</strong> <span class=\"parameter\">function</span><br />\n    <strong>MUI_CUSTOMFUNCTION_UNABORT</strong> <span class=\"parameter\">function</span><br />\n    <strong>MUI_CUSTOMFUNCTION_ONMOUSEOVERSECTION</strong> <span class=\"parameter\">function</span><br />\n    <strong>MUI_CUSTOMFUNCTION_UNONMOUSEOVERSECTION</strong> <span class=\"parameter\">function</span></p>\n    <p>Mouse over functions are only available when the description macros (MUI_FUNCTION_DESCRIPTION_BEGIN) are used. \n      When component page descriptions are not used, regular .onMouseOverSection and un.onMouseOverSection must be used.</p>\n  </div>\n\n\n  <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_cfpg\" src=\"images/closed.gif\" onclick=\"toggle('trigger_cfpg', 'toggle_cfpg');\" /> Page Custom Functions</h2>\n  <div class=\"toggle\" id=\"toggle_cfpg\">\n\n    <p>These defines should be set before inserting a page macro.</p>\n\n    <p><strong>MUI_PAGE_CUSTOMFUNCTION_PRE</strong> <span class=\"parameter\">function</span><br />\n    <strong>MUI_PAGE_CUSTOMFUNCTION_SHOW</strong> <span class=\"parameter\">function</span><br />\n    <strong>MUI_PAGE_CUSTOMFUNCTION_LEAVE</strong> <span class=\"parameter\">function</span><br />\n    <strong>MUI_PAGE_CUSTOMFUNCTION_DESTROYED</strong> <span class=\"parameter\">function</span></p>\n\n    <p><strong>Notes:</strong></p>\n    <ul>\n      <li>In the Pre function of the Welcome, the Finish and the Abort pages, you can write to the InstallOptions INI file of the page (ioSpecial.ini)</li>\n      <li>In the Show function of Welcome, Finish and StartMenu pages, $MUI_HWND contains the HWND of the inner dialog</li>\n      <li>The destroyed function is called after a external/plug-in page has been destroyed. (Currently only for the original StartMenu Page)</li>\n    </ul>\n\n  </div>\n\n\n  <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_cfwf\" src=\"images/closed.gif\" onclick=\"toggle('trigger_cfwf', 'toggle_cfwf');\" /> Welcome/Finish/Abort Pages Custom Functions</h2>\n  <div class=\"toggle\" id=\"toggle_cfwf\">\n\n    <p>This define should be inserted before a single Welcome, Finish or Abort page.</p>\n\n    <p><strong>MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT</strong> <span class=\"parameter\">function</span></p>\n    <p>This Init function is called before the InstallOptions INI file for the page is written, so you can use it to initialize any variables used in the page settings.</p>\n\n  </div>\n\n</div>\n\n\n\n<h1><a id=\"examples\"></a>Example Scripts</h1>\n<div>\n  <p>These examples are in the NSISDir\\Examples\\UltraModernUI folder :</p>\n  <ul>\n    <li>Basic: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/Basic.nsi\">Basic.nsi</a></li>\n    <li>BigTest: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/bigtest.nsi\">bigtest.nsi</a></li>\n    <li>Header with Bitmap (MUIEx only): <a target=\"_blank\" href=\"../../Examples/UltraModernUI/HeaderBitmapEx.nsi\">HeaderBitmapEx.nsi</a></li>\n    <li>Header with Background image (MUIEx only): <a target=\"_blank\" href=\"../../Examples/UltraModernUI/HeaderBGImageEx.nsi\">HeaderBGImageEx.nsi</a></li>\n    <li>Background Skin: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/PageBG.nsi\">PageBG.nsi</a></li>\n    <li>No left Image UI (UMUI only): <a target=\"_blank\" href=\"../../Examples/UltraModernUI/NoLeftImage.nsi\">NoLeftImage.nsi</a></li>\n    <li>Ultra-Modern Small UI (UMUI only): <a target=\"_blank\" href=\"../../Examples/UltraModernUI/UltraModernSmall.nsi\">UltraModernSmall.nsi</a></li>\n    <li>Multiple languages page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/MultiLanguage.nsi\">MultiLanguage.nsi</a></li>\n    <li>Maintenance page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/Maintenance.nsi\">Maintenance.nsi</a></li>\n    <li>Update page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/Update.nsi\">Update.nsi</a></li>\n    <li>Welcome/Finish/Abort page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/WelcomeFinishAbort.nsi\">WelcomeFinishAbort.nsi</a></li>\n    <li>Information page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/Information.nsi\">Information.nsi</a></li>\n    <li>Serial Number page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/SerialNumber.nsi\">SerialNumber.nsi</a></li>\n    <li>Setup Type page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/SetupType.nsi\">SetupType.nsi</a></li>\n    <li>Alternative Start Menu Folder page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/StartMenu.nsi\">StartMenu.nsi</a></li>\n    <li>Additional Tasks page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/AdditionalTasks.nsi\">AdditionalTasks.nsi</a></li>\n    <li>Confirm page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/Confirm.nsi\">Confirm.nsi</a></li>\n    <li>File&disk request page: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/FileDiskRequest.nsi\">FileDiskRequest.nsi</a></li>\n    <li>Custom pages: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/InstallOptions.nsi\">InstallOptions.nsi</a></li>\n    <li>Custom pages: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/nsDialogs.nsi\">nsDialogs.nsi</a></li>\n    <li>NSIS menu with Ultra-Modern UI: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/NSISUMUIMenu.nsi\">NSISUMUIMenu.nsi</a></li>\n    <li>Ultra-Modern UI installer: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/UltraModernUI.nsi\">UltraModernUI.nsi</a></li>\n    <li>NSIS+Ultra-Modern UI installer: <a target=\"_blank\" href=\"../../Examples/UltraModernUI/NSISUltraModernUI.nsi\">NSISUltraModernUI.nsi</a></li>\n  </ul>\n</div>\n\n\n\n<h1>Version History</h1>\n<ul>\n\n  <li><strong>Version 2.0 beta 5</strong> - January 01, 2019\n  <ul>\n    <li>Ultra-Modern UI is resynchronized under Modern UI version 1.81.</li>\n    <li>Consequently, The UMUI_TEXT_COLOR define was renamed in MUI_TEXTCOLOR.</li>\n    <li>UMUI now provide an extended NSIS Menu with links for UMUI and extra plugins documentations.</li>\n    <li>Consequently, UMUI installers no more create extra shortcuts on the start menu, but replace the original NSIS menu shortcuts.</li>\n    <li>Fixed bug when the Additional Tasks page is skipped, options were not affected...</li>\n    <li>Fixed bug when the License page text is unreadable with the Windows high contrast mode.</li>\n    <li>Minor Fixes.</li>\n  </ul>\n  </li>\n\n  <li><strong>Version 2.0 beta 4</strong> - February 04, 2018\n  <ul>\n    <li>Fixed UMUI_PAGE_SERIALNUMBER and UMUI_UNPAGE_SERIALNUMBER pages failed to compile.</li>\n  </ul>\n  </li>\n\n  <li><strong>Version 2.0 beta 3</strong> - August 06, 2017\n  <ul>\n    <li>New Bulgarian language files by Angel.</li>\n    <li>Added support HKCR32, HKCR64, HKCU32, HKCU64, HKLM32 and HKLM64 root keys for all the UMUI_*_REGISTRY_ROOT defines and for the UMUI_ADDPARAMTOSAVETOREGISTRYKEY macro with NSIS versions >= 3.02.</li>\n    <li>Added support for MUI_UNCONFIRMPAGE_VARIABLE from Modern UI 1.8.</li>\n    <li>Added support for MUI_PAGE_CUSTOMFUNCTION_DESTROYED for original StartMenu page from Modern UI 1.8.</li>\n    <li>Minor Fixes.</li>\n  </ul>\n  </li>\n\n  <li><strong>Version 2.0 beta 2</strong> - December 25, 2016\n  <ul>\n    <li>Updated the SkinnedControls plug-in to version 1.4 with support of the new NSIS plug-in API, optional unskinit method calls and ignore case parameters name support.</li>\n    <li>Fixed: Links on RichText information pages are now clickable;</li>\n    <li>Fixed: Missing MUI_PAGE_CUSTOMFUNCTION_PRE support missing for some Ultra-Modern pages (by Bodenseematze);</li>\n    <li>Fixed: Most of the time, command line parameters were not transferred to Exec calls (thanks Bodenseematze);</li>\n    <li>Several new and completed language files and other minor fixes by Bodenseematze:</li>\n    <ul>\n      <li>Completed: German language file;</li>\n      <li>New: Greek language file;</li>\n      <li>New: Italian language file;</li>\n      <li>New: Lithuanian language file;</li>\n      <li>New: Russian language file;</li>\n      <li>New: Slovenian language file;</li>\n      <li>New: Spanish language file;</li>\n      <li>New: Turkish language file;</li>\n    </ul>\n    <li>Minor optimizations.</li>\n  </ul>\n  </li>\n\n  <li><strong>Version 2.0 beta 1</strong> - August 27, 2016\n  <ul>\n    <li>Ultra-Modern UI is now fully compatible with NSIS version 3 x86 edition and now with the large string special build;\n    <li>The NSISArray plug-in was replaced by the new nsArray plug-in in version 1.1.1.7 who is faster and uses less memory;</li>\n    <li>Updated the InstallOptionsEx plug-in to version 2.4.5 beta 3 with full unicode support;</li>\n    <li>Updated the SkinnedControls plug-in to version 1.3 with unicode support, bug fixed, rewritten documentation, button image size no more limited to allow smoother gradients...;</li>\n    <li>The information page is now compatible with UTF16LE text files if compiled in Unicode;</li>\n    <li>The information page is now compatible with Unix style (LF only) line return text files;</li>\n    <li>The UMUI_CUSTOM_SKIN define is now deprecated, it is no more necessary and you can simply use the UMUI_SKIN define with your custom skin;</li>\n    <li>All button image was recreated with smoother gradient;</li>\n    <li>Reduced weight of skin images;</li>\n    <li>Updated and almost completed documentation;</li>\n    <li>Added an example for nsDialogs based custom page and documentation;</li>\n    <li>The default install directory for the NSIS + Ultra-Modern UI package is now C:\\ProgramData on Windows Vista and upper to allow examples to be compiled without access rights errors;</li>\n    <li>A lot of bug fixes and optimizations;</li>\n    <li>Source code now on GitHub: <a target=\"_blank\" href=\"https://github.com/SuperPat45/UltraModernUI\">https://github.com/SuperPat45/UltraModernUI</a>.</li>\n  </ul>\n  </li>\n\n  <li><strong>Version 1.00 beta 2</strong> - November 11, 2010\n  <ul>\n    <li>Second public beta release after more than three development years.</li>\n    <li>Ultra-Modern UI use the new NSIS Doc directory used since the version 2.07 and UMUI.nsh is resynchronised under Modern UI version 1.8.</li>\n    <li>Ultra-Modern UI include also a second Unser Interface named Modern UIEx. Modern UIEx is an extended version of Modern UI but with the new UltraModern pages support.</li>\n\n    <li>Ultra-Modern UI included henceforth three plug-ins that are supported natively :\n      <ul>\n        <li>The SkinnedControls plug-in. SkinnedScrollControls is based on the wansis plug-in of Saivert and can skin all buttons and scroll bars of your NSIS installer like the most recent installers as well as the scrollbars (only for Windows 2000/XP/2003/Vista/2008).</li>\n        <li>The fixed version of the InstallOptionEx plug-in. InstallOptionEx is writen by Diego Pedroso (deguix) and is an expanded version of InstallOptions containing many new features, with size drawback. This version, debugged by SuperPat, contain a lot of bug fixes necessary to the correct operation of some Ultra-Modern UI pages.</li>\n        <li>The NSISArray plug-in. This plug-in written by Afrow UK, allows the support of the array in NSIS. It comes with plenty of functions for managing your arrays. This plug-in is used with the AlternativeStartMenu and MultiLanguages Pages of Ultra-Modern UI.</li>\n      </ul>\n    </li>\n\n    <li>All skins were remakes and twenty skins are now available. blue, blue2, SoftBlue, red, red2, SoftRed....</li>\n\n    <li>New pages are available:\n      <ul>\n        <li>MultiLanguage Page that can be replace the MultiLanguage Plug-in.</li>\n        <li>Maintenance Page with Repair, Modify, Uninstall and Continue Setup options.</li>\n        <li>Update Page with Update, Uninstall and Continue Setup options.</li>\n        <li>Information Page for viewing text and RichText files.</li>\n        <li>SerialNumber Page.</li>\n        <li>Setup Type Page with Minimal, Standard, Complete and Custom options.</li>\n        <li>AlternativeStartMenu Page to replace the StartMenu Plug-in. It allow to use a TreeWiew instead of the ListView and can set the ShellVarContext</li>\n        <li>Additional Tasks page.</li>\n        <li>File and Disk Request Page.</li>\n      </ul>\n    </li>\n\n    <li>Left Text, Left Time and LeftMessageBox functions are removed.</li>\n    <li>And a huge number of fixes and improvements.</li>\n  </ul>\n  </li>\n\n  <li><strong>Version 1.00 beta 1</strong> - March 20, 2005\n  <ul>\n    <li>First public beta release.</li>\n    <li>Several skins are available in several color (blue , green, red, purple, brown, gray, cleargreen) and a background skin named wxp. You can obviously create your own skins.</li>\n    <li>The Header Image defines are disables momentarily.</li>\n    <li>New pages are available: Abrot Page and Confim page with recapitulation of your setting , LeftMessageBox.</li>\n    <li>Draw Left Text and Left Time.</li>\n  </ul>\n  </li>\n\n\n</ul>\n\n\n<h1>Credits</h1>\n<div>\n\n  <p>Made by SuperPat<br />\n  - Based on Modern UI 1.81 Copyright 2002-2019 Joost Verburg.<br />\n  - And inspired of the ExperienceUI of dandaman32.</p>\n\n  <p>Skins by SuperPat<br />\n  UltraModern Icons and WXP BackGround skin is taken again on ExperineceUI of dandaman32.</p>\n\n</div>\n\n\n\n<h1>Help</h1>\n<div>\n\n  <p>Please post questions at the <a target=\"_blank\" href=\"http://forums.winamp.com/forumdisplay.php?forumid=65\">Official NSIS Forum</a>.</p>\n\n</div>\n\n\n\n<h1>License</h1>\n<div>\n\n  <p>The zlib/libpng license applies to Ultra-Modern UI.</p>\n\n\n  <h2><img class=\"trigger\" title=\"Open/Close section\" alt=\"[+]\" id=\"trigger_lic\" src=\"images/closed.gif\" onclick=\"toggle('trigger_lic', 'toggle_lic');\" /> License Terms</h2>\n  <div class=\"toggle\" id=\"toggle_lic\">\n\n  <pre>Copyright &copy; 2005-2019 SuperPat</pre>\n\n  <pre>This software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.</pre>\n\n  <pre>Permission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:</pre>\n\n  <pre>1. The origin of this software must not be misrepresented;\n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.</pre>\n\n   </div>\n\n</div>\n\n</div>\n\n  <div class=\"footer\">&copy; 2005-2019 SuperPat</div>\n\n  </div>\n\n</body>\n</html>"
  },
  {
    "path": "setup/nsis/tools/Docs/UltraModernUI/script.js",
    "content": "var image_open = \"images/open.gif\";\nvar image_closed = \"images/closed.gif\";\n\nfunction toggle(image, section) {\n  if (document.getElementById(section).style.display == \"block\") {\n    document.getElementById(section).style.display = \"none\";\n    document.getElementById(image).src = image_closed;\n    document.getElementById(image).alt = \"[+]\";\n  } else {\n    document.getElementById(section).style.display = \"block\";\n    document.getElementById(image).src = image_open;\n    document.getElementById(image).alt = \"[-]\";\n  }\n}\n\nfunction expandall() {\n  var divNodeList = document.getElementsByTagName('div');\n  for (i = 0; i < divNodeList.length; i++) {\n    if (divNodeList[i].id) {\n      var trigger = document.getElementById('trigger_' + divNodeList[i].id.substr(7));\n      if (trigger) {\n        divNodeList[i].style.display = \"block\";\n        trigger.src = image_open;\n        triggeralt = \"[-]\";\n      }\n    }\n  }\n}\n\nfunction collapseall() {\n  var divNodeList = document.getElementsByTagName('div');\n  for (i = 0; i < divNodeList.length; i++) {\n    if (divNodeList[i].id) {\n      var trigger = document.getElementById('trigger_' + divNodeList[i].id.substr(7));\n      if (trigger) {\n        divNodeList[i].style.display = \"none\";\n        trigger.src = image_open;\n        triggeralt = \"[+]\";\n      }\n    }\n  }\n}\n\nfunction loadSlider() {\n  var slider = document.getElementById('slider');\n  var imgList = slider.getElementsByTagName('img');\n  for (var i = 0; i < imgList.length; i++) {\n    if (imgList[i].getAttribute('data-src')){\n      imgList[i].src = imgList[i].getAttribute('data-src');\n      imgList[i].removeAttribute('data-src');\n    }\n  }\n  if (imageSlider)\n    imageSlider.reload();\n}\n\nvar sliderOptions = {\n  sliderId: \"slider\",\n  startSlide: 0,\n  effect: \"series1\",\n  effectRandom: false,\n  pauseTime: 3000,\n  transitionTime: 500,\n  slices: 12,\n  boxes: 8,\n  hoverPause: 1,\n  autoAdvance: true,\n  thumbnailsWrapperId: \"thumbs\",\n  m: false,\n  license: \"zlib/libpng\"\n};\n\nvar imageSlider = new mcImgSlider(sliderOptions);\n\n/* Menucool Javascript Image Slider v2016.4.2. Copyright www.menucool.com */\nfunction mcImgSlider(i) { for (var I = function (a) { return document.getElementById(a) }, d = \"length\", Q = \"getElementsByTagName\", t = function (e) { var a = e.childNodes, c = []; if (a) for (var b = 0, f = a[d]; b < f; b++)a[b].nodeType == 1 && c.push(a[b]); return c }, g = \"className\", h = \"getAttribute\", y = \"opacity\", U = function (a, b) { return a[Q](b) }, mb = function (a) { for (var c, e, b = a[d]; b; c = parseInt(Math.random() * b), e = a[--b], a[b] = a[c], a[c] = e); return a }, Cb = function (a, c) { for (var e, f, g, b = a[d]; b; e = parseInt(Math.random() * b), f = a[--b], a[b] = a[e], a[e] = f, g = c[b], c[b] = c[e], c[e] = g); return [a, c] }, Bb = function (a, c, b) { if (a.addEventListener) a.addEventListener(c, b, false); else a.attachEvent && a.attachEvent(\"on\" + c, b) }, P = document, J = window.requestAnimationFrame, V = window.cancelAnimationFrame, nb = [\"ms\", \"webkit\"], v = \"\", db = 0; db < nb[d] && !J; ++db) { v = nb[db]; J = window[v + \"RequestAnimationFrame\"]; V = window[v + \"CancelAnimationFrame\"]; v = \"-\" + v + \"-\" } var yb = function () { var b = U(P, \"head\"); if (b[d]) { var a = P.createElement(\"style\"); b[0].appendChild(a); return a.sheet ? a.sheet : a.styleSheet } else return 0 }, sb = function () { var a = yb(); if (a) if (typeof a.insertRule != \"undefined\") { var b = \"@\" + v + \"keyframes jisSpinner {from{\" + v + \"transform:rotate(0deg);} to{\" + v + \"transform:rotate(360deg);}}\"; a.insertRule(b, 0); var c = \"#\" + i.sliderId + \" .bgLayer {position:absolute;width:100%;height:100%;}\"; a.insertRule(c, 0); var d = \"#\" + i.sliderId + \"::before {\" + v + \"animation:jisSpinner 0.6s linear infinite;transform:translate3d(0,0,0);content:'';position:absolute;left:50%;top:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;border-width:4px;border-color:black rgba(0, 0, 0, 0.8) rgba(255, 255, 255, 0.8) rgba(255, 255, 255, 0.8);border-style:solid;border-radius:50%;}\"; a.insertRule(d, 0) } else a.addRule(\"#\" + i.sliderId + \" .bgLayer\", \"position:absolute;width:100%;height:100%;\") }; sb(); var c = \"style\", H = \"display\", Eb = \"visibility\", r = \"width\", q = \"height\", O = \"top\", B = \"background\", p = \"undefined\", Fb = \"marginLeft\", F = \"appendChild\", l = \"parentNode\", k = \"nodeName\", S = \"innerHTML\", bb = \"offsetWidth\", u = setTimeout, z = clearTimeout, w = \"indexOf\", N = \"setAttribute\", ab = \"removeChild\", L = function () { this.d = []; this.b = null }, zb = function () { var b = 50, a = navigator.userAgent, c; if ((c = a[w](\"MSIE \")) != -1) b = parseInt(a.substring(c + 5, a[w](\".\", c))); if (a[w](\"Safari\") != -1 && a[w](\"Chrome\") == -1) b = 300; if (a[w](\"Opera\") != -1) b = 400; return b }, T = zb() < 9, Z = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), K = function (a, b) { if (a) { a.o = b; if (T) a[c].filter = \"alpha(opacity=\" + b * 100 + \")\"; else a[c][y] = b } }; L.a = { f: function (a) { return -Math.cos(a * Math.PI) / 2 + .5 }, h: function (b, a) { return Math.pow(b, a * 2) }, j: function (b, a) { return 1 - Math.pow(1 - b, a * 2) } }; L.prototype = { k: { c: i.transitionTime, a: function () { }, b: L.a.f, d: 1 }, m: function (h, d, g, c) { for (var b = [], i = g - d, j = g > d ? 1 : -1, f = Math.ceil(60 * c.c / 1e3), a, e = 1; e <= f; e++) { a = d + c.b(e / f, c.d) * i; if (h != y) a = Math.round(a); b.push(a) } b.e = 0; return b }, n: function () { this.b == null && this.p() }, p: function () { this.q(); var a = this; this.b = J ? J(function () { a.p() }) : window.setInterval(function () { a.q() }, 15) }, q: function () { var a = this.d[d]; if (a) { for (var c = 0; c < a; c++)this.o(this.d[c]); while (a--) { var b = this.d[a]; if (b.d.e == b.d[d]) { b.c(); this.d.splice(a, 1) } } } else { if (J && V) V(this.b); else window.clearInterval(this.b); this.b = null } }, o: function (a) { if (a.d.e < a.d[d]) { var e = a.b, b = a.d[a.d.e]; if (a.b == y) { if (T) { e = \"filter\"; b = \"alpha(opacity=\" + Math.round(b * 100) + \")\" } } else b += \"px\"; a.a[c][e] = b; a.d.e++ } }, r: function (e, b, d, f, a) { a = this.s(this.k, a); var c = this.m(b, d, f, a); this.d.push({ a: e, b: b, d: c, c: a.a }); this.n() }, s: function (c, b) { b = b || {}; var a, d = {}; for (a in c) d[a] = typeof b[a] !== p ? b[a] : c[a]; return d } }; var G = new L, fb = function () { G.d = []; z(m); z(R); m = R = null }, xb = function (b) { var a = [], c = b[d]; while (c--) a.push(String.fromCharCode(b[c])); return a.join(\"\") }, b = { a: 0, e: \"\", d: 0, c: 0, b: 0 }, a, f, o, s, D, A, m, R, x, M, W, e, E, j = null, vb = function () { this[N](\"data-loaded\", \"t\") }, hb = function (b) { if (b == \"series1\") a.a = [6, 8, 15, 2, 5, 14, 13, 3, 7, 4, 14, 1, 13, 15]; else if (b == \"series2\") a.a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]; else a.a = b.split(/\\W+/); a.a.p = i.effectRandom ? -1 : a.a[d] == 1 ? 0 : 1 }, X = function () { a = { b: i.pauseTime, c: i.transitionTime, f: i.slices, g: i.boxes, d: i.license, h: i.hoverPause, i: i.autoAdvance, l: i.thumbnailsWrapperId, Ob: function () { typeof beforeSlideChange !== p && beforeSlideChange(arguments) }, Oa: function () { typeof afterSlideChange !== p && afterSlideChange(arguments) } }; if (f) a.m = Math.ceil(f.offsetHeight * a.g / f[bb]); hb(i.effect); a.n = function () { var b; if (a.a.p == -1) b = a.a[Math.floor(Math.random() * a.a[d])]; else { b = a.a[a.a.p]; a.a.p++; if (a.a.p >= a.a[d]) a.a.p = 0 } if (b < 1 || b > 17) b = 15; return b } }, qb = [\"$1$2$3\", \"$1$2$3\", \"$1$24\", \"$1$23\", \"$1$22\"], jb = function () { if (b.b != 2) { b.b = 1; z(m); m = null } }, gb = function () { if (b.b != 2) { b.b = 0; if (m == null && !b.c && a.i) m = u(function () { j.y(j.n(b.a + 1), 0, 1) }, a.b / 2) } }, rb = function () { var a = 0, b = 0, c; while (a < e.length) { c = e[a][g] == \"lazyImage\" || e[a][h](\"data-src\") || e[a][g][w](\" video\") > -1 && typeof McVideo != p; if (c) { b = 1; break } ++a } return b }, n = [], ib = function (b) { var a = n[d]; if (a) while (a--) n[a][g] = a != b && n[a].on == 0 ? \"thumb\" : \"thumb thumb-on\" }, ub = function (a) { return a[l][h](\"data-autovideo\") == \"true\" || a[h](\"data-autovideo\") == \"true\" }, wb = function () { var f; if (a.l) f = I(a.l); if (f) for (var h = U(f, \"*\"), e = 0; e < h[d]; e++)h[e][g] == \"thumb\" && n.push(h[e]); var c = n[d]; if (c) { while (c--) { n[c].on = 0; n[c].i = c; n[c].onclick = function () { j.y(this.i, ub(this)) }; if (!Z) { n[c].onmouseover = function () { this.on = 1; this[g] = \"thumb thumb-on\"; a.h == 2 && jb() }; n[c].onmouseout = function () { this.on = 0; this[g] = this.i == b.a ? \"thumb thumb-on\" : \"thumb\"; a.h == 2 && gb() } } } ib(0) } return c }, cb = function (a, e, g, c, b, d, f) { u(function () { if (e && g == e - 1) { var f = {}; f.a = function () { j.o() }; for (var h in a) f[h] = a[h] } else f = a; typeof b[r] !== p && G.r(c, \"width\", b[r], d[r], a); typeof b[q] !== p && G.r(c, \"height\", b[q], d[q], a); G.r(c, y, b[y], d[y], f) }, f) }, kb = function (a) { f = a; this.Id = f.id; this.c() }, ob = function (e, c) { for (var b = [], a = 0; a < e[d]; a++)b[b[d]] = String.fromCharCode(e.charCodeAt(a) - (c ? c : 3)); return b.join(\"\") }, pb = [/(?:.*\\.)?(\\w)([\\w\\-])[^.]*(\\w)\\.[^.]+$/, /.*([\\w\\-])\\.(\\w)(\\w)\\.[^.]+$/, /^(?:.*\\.)?(\\w)(\\w)\\.[^.]+$/, /.*([\\w\\-])([\\w\\-])\\.com\\.[^.]+$/, /^(\\w)[^.]*(\\w)$/], C = function (b) { var a = P.createElement(\"div\"); a[g] = b; return a }, tb = function (b, c) { var p = /\\/?(SOURCE|EMBED|OBJECT|\\/VIDEO|\\/AUDIO)/, g = t(f), a = g[d], i; while (a--) { i = g[a]; (i[k] == \"BR\" || T && p.test(i[k])) && f[ab](i) } g = f.children; var e = g[d]; if (b == \"shuffle\") { var h = []; for (a = 0, pos = e; a < pos; a++)h[h.length] = g[a]; if (c && c[d] == e) { var o = c[0].parentNode, j = []; for (a = 0, pos = e; a < pos; a++)j[j.length] = c[a]; var l = Cb(h, j), m = l[0], n = l[1] } else m = mb(h); for (a = 0, pos = e; a < pos; a++) { f.appendChild(m[a]); n && o.appendChild(n[a]) } b = 0 } else if (b == \"random\") b = Math.floor(Math.random() * e); if (b) { b = b % e; a = 0; while (1) if (a++ == b) break; else { f.appendChild(f.children[0]); c && c[0].parentNode.appendChild(c[0]) } } return f.children }; kb.prototype = { c: function () { if (x) return; o = f[bb]; s = f.offsetHeight; var r = t(f), G = r[d]; if (a.l) { var p = I(a.l); p = p ? p.children : 0 } r = tb(i.startSlide, p); this.M(a.d); var j, n; e = []; while (G--) { j = r[G]; n = 0; j[c][H] = \"none\"; if (j[k] == \"VIDEO\" || j[k] == \"AUDIO\") { j[c].position = \"absolute\"; n = C(\"video\"); j[l].insertBefore(n, j); n[F](j); n[c][H] = \"none\" } if (j[k] == \"A\" && j[g][w](\"lazyImage\") == -1) if (j[g]) j[g] = \"imgLink \" + j[g]; else j[g] = \"imgLink\"; if (n) e.push(n); else e.push(j); if (j[g][w](\" video\") != -1) { this.A(j); this.b(j) } } e.reverse(); b.d = e[d]; a.m = Math.ceil(s * a.g / o); E = C(\"sliderInner\"); f[F](E); A = C(\"mc-caption\"); f[F](A); A[c].transition = \"opacity \" + a.c + \"ms\"; var v = this.v(); if (e[b.a][k] == \"IMG\") b.e = e[b.a]; else b.e = U(e[b.a], \"img\")[0]; if (e[b.a][k] == \"A\" || e[b.a][g] == \"video\") e[b.a][c][H] = \"block\"; M[c][B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat'; if (typeof getComputedStyle != \"undefined\") { var y = getComputedStyle(f, null).borderRadius; if (y) M[c].borderRadius = y } D = this.k(); this.m(); var q = b.e[l], z; if (z = q.aP) { this.d(q); if (z === 1) q.aP = 0 } else if (a.i && b.d > 1) { u(function () { v.e(1) }, 0); m = u(function () { v.y(v.n(1), 0, 1) }, a.b + a.c) } if (a.h != 0 && !Z) { f.onmouseover = jb; f.onmouseout = gb } }, b: function (a) { if (typeof McVideo != p) { a.onclick = function () { return this.aP ? false : j.d(this) }; McVideo.register(a, this) } }, A: function (a) { if (typeof a.aP === p) { var b = a[h](\"data-autovideo\"); if (b == \"true\") a.aP = true; else if (b == \"1\") a.aP = 1; else a.aP = 0 } }, d: function (c) { z(m); m = null; var a = McVideo.play(c, o, s, this.Id); if (a || Z) b.b = 2; return false }, f: function () { x = C(\"navBulletsWrapper\"); for (var e = [], a = 0; a < b.d; a++)e.push(\"<div rel='\" + a + \"'>\" + (a + 1) + \"</div>\"); x[S] = e.join(\"\"); for (var c = t(x), a = 0; a < c[d]; a++) { if (a == b.a) c[a][g] = \"active\"; c[a].onclick = function () { j.y(parseInt(this[h](\"rel\")), 1) } } f[F](x); M = C(\"bgLayer\"); f.insertBefore(M, f.firstChild) }, g: function () { var d = t(x), a = b.d; while (a--) { if (a == b.a) d[a][g] = \"active\"; else d[a][g] = \"\"; if (e[a][k] == \"A\" || e[a][g] == \"video\") e[a][c][H] = a == b.a ? \"block\" : \"none\" } }, k: function () { var a = b.e[h](\"alt\") || \"\"; if (a && a.substr(0, 1) == \"#\") { var c = I(a.substring(1)); a = c ? c[S] : \"\" } return a }, l: function () { K(A, 0) }, m: function () { A[S] = D; A[c][Eb] = D ? \"visible\" : \"hidden\"; D && K(A, 1) }, a: function (a) { return a.replace(/(?:.*\\.)?(\\w)([\\w\\-])?[^.]*(\\w)\\.[^.]*$/, \"$1$3$2\") }, o: function () { b.c = 0; z(m); m = null; M[c][B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat'; var i = this, d = b.e[l]; if (typeof d.aP === p) d = 0; var f; if (d && (f = d.aP || W && /video$/.test(d[g]))) { this.d(d); if (f === 1) d.aP = 0 } else if (!b.b && a.i) { var e = this.n(b.a + 1); this.e(e); m = u(function () { i.y(e, 0, 1) }, a.b) } a.Oa.call(this, b.a, b.e) }, e: function (j) { var a = e[j], m = 0; if (a[k] == \"A\" && a[g][w](\"lazyImage\") == -1 || a[k] == \"DIV\" && a[g] == \"video\") { a = t(a)[0]; m = 1 } if (a[k] != \"IMG\") { if (a[k] == \"A\") var d = a[h](\"href\"), f = a[h](\"title\") || \"\", i = 1; else if (a[k] == \"VIDEO\" || a[k] == \"AUDIO\") { var n = 1; d = a[h](\"data-image\"); if (d) f = a[h](\"data-alt\") || \"\"; a[h](\"data-autovideo\") && a[l][N](\"data-autovideo\", a[h](\"data-autovideo\")); this.A(a[l]); i = 0 } else { d = a[h](\"data-src\"); if (d) f = a[h](\"data-alt\") || \"\"; i = !m } if (f != null) { var b = P.createElement(\"img\"); b[N](\"data-loaded\", \"f\"); b[N](\"alt\", f); b.onload = b.onerror = vb; b[N](\"src\", d); b[c][H] = \"none\"; if (n) { a[l].insertBefore(b, a); this.b(a[l], this); if (T) { a[l][c][B] = \"none\"; a[l][c].cursor = \"default\" } } else a[l].replaceChild(b, a); if (i) e[j] = b } } }, p: function (f) { if (e[b.a][k] == \"IMG\") b.e = e[b.a]; else b.e = U(e[b.a], \"img\")[0]; var g = b.e[h](\"data-loaded\"); if (g == \"f\") { u(function () { j.p(f) }, 200); return } b.c = 1; this.g(); z(R); D = this.k(); this.l(); R = u(function () { j.m() }, a.c / 2); E[S] = \"\"; var c = f ? f : a.n(); a.Ob.apply(this, [b.a, b.e, D, c]); ib(b.a); var d = c < 14 ? this.w(c) : this.x(); if (c < 9 || c == 15) { if (c % 2) d = d.reverse() } else if (c < 14) d = d[0]; if (c < 9) this.q(d, c); else if (c < 13) this.r(d, c); else if (c == 13) this.s(d); else if (c < 16) this.t(d, c); else this.u(d, c) }, q: function (b, e) { for (var f = 0, g = e < 7 ? { height: 0, opacity: -.4 } : { width: 0, opacity: 0 }, i = { height: s, opacity: 1 }, a = 0, h = b[d]; a < h; a++) { if (e < 3) b[a][c].bottom = \"0\"; else if (e < 5) b[a][c][O] = \"0\"; else if (e < 7) { b[a][c][a % 2 ? \"bottom\" : \"top\"] = \"0\"; g[y] = -.2 } else { i = { width: b[a][bb], opacity: 1 }; b[a][c][r] = b[a][c][O] = \"0\"; b[a][c][q] = s + \"px\" } cb({}, h, a, b[a], g, i, f); f += 50 } }, M: function (a) { var b = this.a(document.domain.replace(\"www.\", \"\")); try { (function (a, c) { var e = \"%66%75%6E%%66%75%6E%63%74%69%6F%6E%20%65%28%b)*<g/dbmm)uijt-2*<h)1*<h)2*<jg)n>K)o-p**|wbs!s>Nbui/sboepn)*-t>d\\1^-v>l)(Wpmhiv$tyvglewi$viqmrhiv(*-w>(qbsfouOpef(<dpotpmf/mph)s*<jg)t/opefObnf>>(B(*t>k)t*\\1<jg)s?/9*t/tfuBuusjcvuf)(bmu(-v*<fmtf!jg)s?/8*|wbsr>epdvnfou/dsfbufUfyuOpef)v*-G>mwr5<jg)s?/86*G>Gw/jotfsuCfgpsf)r-G*sfuvso!uijt<69%6F%6E%<jg)s?/9*t/tfuBuusjcvuf)(bmupdvnf%$ou/dsfbufUfy\", b = ob(e, a[d] + parseInt(a.charAt(1))).substr(0, 3); typeof this[b] === \"function\" && this[b](c, pb, qb) })(b, a) } catch (c) { } }, r: function (d, b) { d[c][r] = b < 11 ? \"0px\" : o + \"px\"; d[c][q] = b < 11 ? s + \"px\" : \"0px\"; K(d, 1); if (b < 11) d[c][O] = \"0\"; if (b == 9) { d[c].left = \"auto\"; d[c].right = \"0px\" } else if (b > 10) d[c][b == 11 ? \"bottom\" : \"top\"] = \"0\"; if (b < 11) var e = 0, f = o; else { e = 0; f = s } var g = { b: L.a.j, c: a.c * 1.6, a: function () { j.o() } }; G.r(d, b < 11 ? \"width\" : \"height\", e, f, g) }, s: function (b) { b[c][O] = \"0\"; b[c][r] = o + \"px\"; b[c][q] = s + \"px\"; var d = { c: a.c * 1.6, a: function () { j.o() } }; G.r(b, y, 0, 1, d) }, t: function (b) { var t = a.g * a.m, o = 0, m = 0, i = 0, g = 0, f = []; f[0] = []; for (var e = 0, n = b[d]; e < n; e++) { b[e][c][r] = b[e][c][q] = \"0px\"; f[i][g] = b[e]; g++; if (g == a.g) { i++; g = 0; f[i] = [] } } for (var p = { c: a.c / 1.3 }, j = 0, n = a.g * 2; j < n; j++) { for (var h = j, k = 0; k < a.m; k++) { if (h >= 0 && h < a.g) { var l = f[k][h]; cb(p, b[d], o, l, { width: 0, height: 0, opacity: 0 }, { width: l.w, height: l.h, opacity: 1 }, m); o++ } h-- } m += 100 } }, u: function (a, i) { a = mb(a); for (var f = 0, b = 0, j = a[d]; b < j; b++) { var e = a[b]; if (i == 16) { a[b][c][r] = a[b][c][q] = \"0px\"; var g = { width: 0, height: 0, opacity: 0 }, h = { width: e.w, height: e.h, opacity: 1 } } else { g = { opacity: 0 }; h = { opacity: 1 } } cb({}, a[d], b, e, g, h, f); f += 20 } }, v: function () { this.f(); this.e(0); return (new Function(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", function (c) { for (var b = [], a = 0, e = c[d]; a < e; a++)b[b[d]] = String.fromCharCode(c.charCodeAt(a) - 4); return b.join(\"\") } (\"zev$NAjyrgxmsr,|0}-zev$eAjyrgxmsr,f-zev$gAf2glevGshiEx,4-2xsWxvmrk,-?vixyvr$g2wyfwxv,g2pirkxl15-?\\u0081?vixyvr$|/}_5a/e,}_4a-/e,}_6a-?\\u0081?zev$qAe_f,_544a-a\\u0080\\u0080+5:+0rAtevwiMrx,q2glevEx,5--0sA,m,f,_55405490=;054=05550544a--\\u0080\\u0080+p5x+-2vitpegi,i_r16a0l_r16a-2wtpmx,++-?zev$PAh,-?mj,q%AN,+f+/r0s--mj,%P-PAj,-?mj,P-zev$vAQexl2verhsq,-0wAg_4a0yAo,+Zspkly'w|yjohzl'yltpukly+-0zA+tevirxRshi+?mj,w2rshiReqiAA+E+-wAn,w-_4a?mj,vB2<-w2wixExxvmfyxi,+epx+0y-?ipwi$mj,vB2;-zev$uAhsgyqirx2gviexiXi|xRshi,y-0JAp_za?mj,vB2;9-JAJ_za?J_za2mrwivxFijsvi,u0J-?\\u0081\\u0081\\u0081?vixyvr$xlmw?\"))).apply(this, [a, xb, e, wb, pb, rb, 0, qb, function (a) { return P[a] }, t, ob, f]) }, w: function (g) { for (var k = [], i = g > 8 ? o : Math.round(o / a.f), l = g > 8 ? 1 : a.f, f = 0; f < l; f++) { var j = C(\"mcSlc\"), e = j[c]; e.left = i * f + \"px\"; e[r] = (f == a.f - 1 ? o - i * f : i) + \"px\"; e[q] = \"0px\"; e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat -' + f * i + \"px 0%\"; if (g == 10) e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat right top'; else if (g == 12) e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat left bottom'; e.position = \"absolute\"; K(j, 0); E[F](j); k[k[d]] = j } return k }, x: function () { for (var k = [], j = Math.round(o / a.g), i = Math.round(s / a.m), g = 0; g < a.m; g++)for (var f = 0; f < a.g; f++) { var d = C(\"mcBox\"), e = d[c]; e.left = j * f + \"px\"; e[O] = i * g + \"px\"; d.w = f == a.g - 1 ? o - j * f : j; d.h = g == a.m - 1 ? s - i * g : i; e[r] = d.w + \"px\"; e[q] = d.h + \"px\"; e[B] = 'url(\"' + b.e[h](\"src\") + '\") no-repeat -' + f * j + \"px -\" + g * i + \"px\"; e.position = \"absolute\"; K(d, 0); E[F](d); k.push(d) } return k }, y: function (a, j, k) { W = j === true; this.e(a); if (a == b.a && W && !b.c) { var h = 0; if (e[a][g] == \"imgLink video\") { var d = e[a][Q](\"iframe\"); h = !d.length } else if (e[a][g] == \"video\") { d = e[a][Q](\"video\"); if (!d.length) d = e[a][Q](\"audio\"); if (d.length && d[0][c][H] == \"none\") h = 1 } h && this.d(e[a]) } if (b.c && !j || a == b.a) return; if (b.b == 2) { b.b = 0; McVideo.stop(e[b.a]) } fb(); var f = b.a; b.a = this.n(a); if (k || !i.m) f = 0; else f = f > b.a ? \"10\" : \"9\"; this.p(f) }, n: function (a) { if (a >= b.d) a = 0; else if (a < 0) a = b.d - 1; return a }, To: function (d, c) { if (c && !a.i) return; this.y(this.n(b.a + d)) } }; var Y = function () { var a = I(i.sliderId); if (a && t(a)[d] && a.offsetHeight) j = new kb(a); else u(Y, 500) }; X(); var Ab = function (c) { var a = false; function b() { if (a) return; a = true; setTimeout(c, 4) } document.addEventListener && document.addEventListener(\"DOMContentLoaded\", b, false); Bb(window, \"load\", b) }; Ab(Y); var Db = function () { if (f) { fb(); var a = t(f), e = a[d]; while (e--) if (a[e][k] == \"DIV\") { var h = a[e][l][ab](a[e]); h = null } var c = I(\"mcVideo\" + this.Id); if (c) { c.src = \"\"; var g = c[l][l][ab](c[l]); g = null } b = { a: 0, e: \"\", d: 0, c: 0, b: 0 }; n = []; E = x = null } X(); Y() }, lb = 0, eb = function (e, c) { if (++lb < 20) if (!j || typeof tooltip == p) u(function () { eb(e, c) }, 300); else for (var b = t(x), a = 0; a < b[d]; a++)b[a].onmouseover = function () { tooltip.pop(this, e(parseInt(this[h](\"rel\"))), c) } }; return { displaySlide: function (c, b, a) { j.y(c, b, a) }, next: function () { j.To(1) }, previous: function () { j.To(-1) }, getAuto: function () { return a.i }, thumbnailPreview: function (b, a) { lb = 0; eb(b, a) }, switchAuto: function () { if (a.i = !a.i) j.To(1); else z(m) }, setEffect: function (a) { hb(a) }, changeOptions: function (a) { for (var b in a) i[b] = a[b]; X() }, reload: Db, getElement: function () { return I(i.sliderId) } } }"
  },
  {
    "path": "setup/nsis/tools/Docs/UltraModernUI/style.css",
    "content": "body {\n  padding: 10px;\n  background-color: #F0F0F0;\n  font-size: 13px;\n  font-family: Verdana, Arial, Helvetica, sans-serif;\n  font-weight: normal;\n  text-align: left;\n  color: #000000;\n}\n\np, li {\n  font-size: 13px;\n}\n\nul {\n  padding-bottom:8px;\n  padding-left:25px;\n}\n\n.maintable {\n  border: 2px solid #376EAB;\n  width: 750px;\n  margin:auto;\n  color: #000000;\n  background-color: #FFFFFF;\n  min-height: 600px;\n}\n\n.parameter {\n  font-weight: bold;\n  color: #6586AC;\n  background-color: #FFFFFF;\n}\n\n.smallScreen {\n  margin-left: 15px;\n  margin-top: -38px;\n  margin-right: 6px;\n  float: right;\n}\n\nh1 {\n  font-size: 20px;\n  color: #7A7272;\n  background-color: #FFFFFF;\n  font-weight: normal;\n}\nh2 {\n  font-size: 17px;\n  font-weight: bold;\n  color: #2B5885;\n  background-color: #FFFFFF;\n}\nh3 {\n  font-size: 14px;\n  font-weight: bold;\n  color: #1C3A58;\n  background-color: #FFFFFF;\n}\nh5 {\n  margin: 0px;\n}\n\npre {\n  font-size: 13px;\n  color: #333;\n  margin-top: -5px;\n}\n\ndiv {\n  margin-top: 15px;\n  margin-right: 10px;\n  margin-bottom: 20px;\n  margin-left: 15px;\n\n}\n\n.footer {\n  font-size: 10px;\n  text-align: right;\n  color: #909090;\n  background-color: #FFFFFF;\n  margin: 5px;\n}\n\na:link, a:visited, a:active {\n  color: #294F75;\n  background-color: #FFFFFF;\n  text-decoration: none;\n  font-weight: bold;\n}\na:hover {\n  color: #182634;\n  background-color: #FFFFFF;\n  text-decoration: underline;\n  font-weight: bold;\n}\n\n\n/* Pour la Doc */\n/* ----------- */\n\n.trigger {\n  cursor: pointer;\n}\n.toggle {\n  display: none;\n}\n.options {\n  text-align: center;\n  cursor: pointer;\n  color: #294F75;\n  background-color: #FFFFFF;\n  font-weight: bold;\n}\n\n.red {\n  color: #ff0000;\n  background-color: #FFFFFF;\n  text-decoration: line-through;\n}\n.blue {\n  color: #0000ff;\n  background-color: #FFFFFF;\n}\n.purple {\n  color: #800080;\n  background-color: #FFFFFF;\n}\n\n\n/* http://www.menucool.com */\n\n#sliderFrame, #sliderFrame div {\n  margin:0;\n}\n#sliderFrame {\n  margin:0 auto; /*center-aligned*/\n  margin-left: -5px;\n  margin-bottom: 40px;\n  height: 542px;\n}\n\n#slider, #slider .sliderInner {\n  width:706px;\n  height:545px;/* Must be the same size as the slider images */\n  -webkit-border-radius: 6px;\n  -moz-border-radius: 6px;\n  border-radius: 6px;\n}\n\n#slider {\n  background-color:white;\n  position:relative;\n  margin:0 auto; /*center-aligned*/\n  -moz-box-shadow: 0px 1px 5px #999999;\n  -webkit-box-shadow: 0px 1px 5px #999999;\n  box-shadow: 0px 1px 5px #999999;\n}\n\n/* the link style (if an image is wrapped by a link) */\n#slider img {\n  display:none;\n  visibility:hidden;\n  width:0;\n  height:0;\n}\n\n/* Caption styles */\n#slider .mc-caption {\n  position:absolute;\n  width:100%;\n  height:auto;\n  padding: 15px 0 5px 0;/* will increase the height.*/\n  left:0px;\n  bottom:0px;top:auto;\n  overflow:hidden;\n  font: bold 14px/20px Arial;\n  color:#EEE;\n  text-align:center;\n  background: rgb(61,102,171); /* Old browsers */\n  background: -moz-linear-gradient(top, rgba(61,102,171,0) 0%, rgba(61,102,171,.9) 40%, rgba(61,102,171,.9) 100%); /* FF3.6-15 */\n  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(61,102,171,0)), color-stop(40%,rgba(61,102,171,.9)), color-stop(100%,rgba(61,102,171,.9))); /* Chrome4-9,Safari4-5 */\n  background: -webkit-linear-gradient(top, rgba(61,102,171,0) 0%,rgba(61,102,171,.9) 40%,rgba(61,102,171,.9) 100%); /* Chrome10-25,Safari5.1-6 */\n  background: -o-linear-gradient(top, rgba(61,102,171,0) 0%,rgba(61,102,171,.9) 40%,rgba(61,102,171,.9) 100%); /* Opera 11.10-11.50 */\n  background: linear-gradient(to bottom, rgba(61,102,171,0) 0%,rgba(61,102,171,.9) 40%,rgba(61,102,171,.9) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */\n  -webkit-border-bottom-right-radius: 6px;\n  -webkit-border-bottom-left-radius: 6px;\n  -moz-border-radius-bottomright: 6px;\n  -moz-border-radius-bottomleft: 6px;\n  border-bottom-right-radius: 6px;\n  border-bottom-left-radius: 6px;\n}\n\n/* ------ built-in navigation bullets wrapper ------*/\n#slider .navBulletsWrapper  {\n  top:555px;\n  text-align:center;\n  background:none;\n  position:relative;\n  z-index:3;\n}\n\n/* each bullet */\n#slider .navBulletsWrapper div {\n  width:11px;\n  height:11px;\n  font-size:0;\n  color:White;/*hide the index number in the bullet element*/\n  background:transparent url(images/bullet.png) no-repeat 0 0;\n  display:-moz-inline-block;  /* FF2 */\n  display:inline-block; \n  *display:inline; zoom:1; /* IE7 */\n  overflow:hidden;\n  cursor:pointer;\n  margin:0 6px;/* set distance between each bullet*/\n}\n\n#slider .navBulletsWrapper .active {\n  background-position:0 -11px;\n}\n\n\n/* --------- Others ------- */\n\n#slider img, #slider>b, #slider a>b {\n  position:absolute;\n  border:none;\n  display:none;\n}\n\n#slider .sliderInner {\n  overflow:hidden;\n  position:absolute;\n  top:0;\n  left:0;\n}\n\n#slider>a, #slider video, #slider audio {\n  display:none;\n}\n#slider, #slider div {\n  -ms-transform: translate3d(0,0,0);\n  -webkit-transform: translate3d(0,0,0);\n  transform: translate3d(0,0,0);\n}\n"
  },
  {
    "path": "setup/nsis/tools/Docs/VPatch/Readme.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"color-scheme\" content=\"light dark\">\n<title>VPatch 3</title>\n<style type=\"text/css\">\n/*<![CDATA[*/\n:root { color-scheme: light dark; }\nhtml, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }\nhtml { font-size: 0.84em; }\nbody { font-size: 1em; font-size: 1rem; }\npre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }\nh1 { font-size: 170%; }\nh2 { font-size: 150%; }\nh3 { font-size: 130%; }\nh4 { font-size: 120%; }\nh5 { font-size: 115%; }\nh6 { font-size: 110%; }\n\nbody\n        {\n        padding:1.5em 0; margin:0;\n        font-family: Verdana, Arial, Helvetica, sans-serif;\n        font-weight: normal;\n        text-align: left;\n        }\n\np, li { font-size: 1em; }\ntable\n        {\n        margin: auto;\n        font-size: 1em;\n        }\nh1\n        {\n        font-size: 250%;\n        color: #333333;\n        font-weight: normal;\n        text-align: center;\n        }\n\nh2\n        {\n        font-size: 150%;\n        color: #7A7272;\n        font-weight: normal;\n        }\n\nh3\n        {\n        font-size: 130%;\n        font-weight: bold;\n        color: #303030;\n        }\n\ndiv\n        {\n        margin: 1.5em;\n        }\n\na:link, a:visited, a:active { color: #294F75; text-decoration: none; }\na:hover { color: #182634; text-decoration: underline; }\n\n.T tr:nth-child(odd) { background-color: #fafafa; }\n.T tr, .T td { border: 1px solid #f5f5f5; border-collapse: collapse; padding: 0.2em; }\n\n@media (prefers-color-scheme: dark) {\nhtml, body { color: #eeeeee; background-color: #161616; }\nh1, h2, h3, h4, h5, h5 { color: inherit; }\na, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; }\n.T tr:nth-child(odd) { background-color: #222222; }\n.T tr, .T td { border: 1px solid #202020; border-collapse: collapse; padding: 0.2em; }\n}\n\n/*]]>*/\n</style>\n</head>\n<body>\n  <h1>VPatch 3.1</h1>\n          <div>\n          <h2>Introduction</h2>\n          <div>\n          <p>VPatch allows to create a patch file to update previous versions \n            of your software. The GenPat utility generates the patch file.\n            The plug-in can use the patch to update a file. Using a patch, you can \n            reduce the download size of your updates because only the differences \n            between the files are included in the patch file.</p>\n          </div>\n          <h2>How to use</h2>\n          <div>\n          <h3>Generate the patch file</h3>\n          <div>\n          <p>Make sure you have the source file (original version) and the target \n            file (version to update to). For example, DATA.DTA (currently on user \n            system) and DATA_20.DTA (version 2.0 of this data file). Now call \n            the command line tool GenPat.exe:</p>\n          <pre>GENPAT oldfile.txt newfile.txt patch.pat</pre>\n          <p>Now, the patch will be generated, this will take some time.</p>\n            <p>Using the /B=(BlockSize) parameter of the GenPat utility (put it \n              after the filenames), you can use a different block size. A smaller \n              block size may result in a smaller patch, but the generation will \n              take more time (the default blocksize is 64).</p>\n            <p>If you have trouble using this command-line utility, you can download \n              a GUI (graphical user interface) for VPatch from its own website: \n              <a href=\"http://www.tibed.net/vpatch\">http://www.tibed.net/vpatch</a>.</p>\n          </div>\n          <h3>Update the file during installation</h3>\n          <div>\n          <p>Use the VPatch plug-in to update a file using a patch file:</p>\n          <pre>vpatch::vpatchfile \"patch.pat\" \"oldfile.txt\" \"temporary_newfile.txt\"</pre>\n          <p>The result of the patch operating will be added to the stack and \n            can be one of the following texts:</p>\n          <ul>\n            <li>OK</li>\n            <li>OK, new version already installed</li>\n            <li>An error occurred while patching</li>\n            <li>Patch data is invalid or corrupt</li>\n            <li>No suitable patches were found</li>\n          </ul>\n            <p>Check <a href=\"../../Examples/VPatch/example.nsi\">example.nsi</a> for an example. \n              You \nshould check whether the stack string starts with &quot;OK&quot; \n              because then the patch has succeeded and you can rename &quot;temporary_newfile.txt&quot; \n              to &quot;oldfile.txt&quot; to replace the original, if you want.</p>\n          </div>\n          <h3>Multiple patches in one file</h3>\n          <div>\n          <p>GenPat appends a patch to the file you specified. If there is already \n            a patch for the same original file, with the same CRC/MD5, in the patch file,\n \n            the patch will be replaced. For example, if you want to be able to upgrade\n version 1 and 2 to version 3, \n            you can put a 1 &gt; 3 and 2 &gt; 3 patch in \none file.</p>\n          <p>You can also put patches for different files in one patch file, for \n            example, a patch from file A version 1 to file A version 2 and a patch \n            from file B version 1 to file B version 2. Just call the plug-in multiple \n            times with the same patch file. It will automatically select the right \n            patch (based on the file CRC).</p>\n          </div>\n          <h3>Patch generator (GenPat) exit codes</h3>\n          <div>\n            <p>In version 3 the following exit codes (known as error levels in \n              the DOS period) can be returned by GenPat. GenPat will return an \n              exit code based on success of the patch generation. Here is a list \n              of the possible exit codes:</p>\n            <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"T\">\n              <tr> \n                <td nowrap><b>Exit code</b></td>\n                <td><b>Description</b></td>\n              </tr>\n              <tr> \n                <td>0</td>\n                <td>Success</td>\n              </tr>\n              <tr> \n                <td>1</td>\n                <td>Arguments missing</td>\n              </tr>\n              <tr> \n                <td>2</td>\n                <td>Other error</td>\n              </tr>\n              <tr>\n                <td>3</td>\n                <td>Source file already has a patch in specified patch file (ERROR), \n                  use /R switch to override</td>\n              </tr>\n            </table>\n            <p>These exit codes can be useful when you generate patch files through \n              a NSIS script.</p>\n        </div>\n        </div>\n        </div>\n        <div>\n          <h2>Source code</h2>\n          <div>\n          <p>Source code is available in the original package and in the SVN repository of NSIS.</p>\n\n          <h3>NSIS plug-in (C++)</h3>\n          <div>\n          <p>The source of the NSIS plug-in that applies patches can be found \n            in the Source\\Plugin folder.</p>\n          </div>\n          <h3>Patch Generator (C++)</h3>\n          <div>\n            <p>The most interesting part of VPatch, the actual patch generation \n              algorithm, can be found in Source\\GenPat\\PatchGenerator.cpp. \n              The \nheader of that file contains a brief explanation of the algorithm as well.\n            </p>\n          </div>\n          <h3>User interface (Delphi)</h3>\n          <div>\n          <p>A user interface is included as well, which you will have to build \n            yourself because the GUI executable was too large to include. Besides \n            Borland Delphi 6 or higher (you can use the freely available Personal \n            edition), you will also need to install the <a href=\"http://www.delphi-gems.com\">VirtualTreeView</a> component by Mike Lischke.</p>\n          </div>\n          </div>\n          <h2>Version history</h2>\n          <div>\n          <ul>\n            <li>3.1 \n              <ul>\n                <li>GenPat now compiles on POSIX platforms (MinGW/GCC), Visual \n                  C++ 6 and Borland C++.</li>\n                <li>More test cases to verify functionality of GenPat.</li>\n              </ul>\n            </li>\n            <li>3.0 \n              <ul>\n                <li><b>Final</b>: Updates to the GUI, installer</li>\n                <li><b>RC8</b>: GenPat will now flag replacement of a patch (e.g. \n                  the source file has the same contents as a previous patch inside \n                  a patch file) as an error. You can specifically allow it using \n                  the /R switch. Added license to source files.</li>\n                <li><b>RC7</b>: Fixed critical bug in GenPat with multiple patches \n                  in a single file. Fixed serious bug in stand-alone EXE runtime: \n                  process kept on running forever. Included case testing through \n                  a Python script to test common usage (and prevent bugs like \n                  the one in GenPat in the future).</li>\n                <li><b>RC6</b>: Upgraded to non-beta compiler. Added /A switch \n                  to change block match limit and /O to deactivate the limit. \n                  Updated GUI to support the /O switch.</li>\n                <li><b>RC4a to RC5a</b>: input block size is now checked for power \n                  of 2 and fixed if incorrect. When patch file does not yet exist, \n                  no longer forgets to create the header. No longer tries to allocate \n                  memory when there are no chunks. Fixed memory leaks.</li>\n                <li>Target file date is now preserved inside a patch and restored \n                  on the user system.</li>\n                <li>MD5 checksums are now used instead of CRC32 checksums, unless \n                  existing patches in a file already are in CRC32 mode.</li>\n                <li>The patch generator, GenPat, has been completely rewritten \n                  in C++. It no longer needs to keep the entire files in memory, \n                  instead memory usage is a certain percentage of the source file \n                  size. The percentage is based on the block size, larger block \n                  sizes will reduce memory usage.</li>\n                <li>All runtimes now share a common codebase, perform proper error \n                  checking and don't leave behind files if the input file was \n                  already up to date.</li>\n                <li>Bug Fix: The patch generator algorithm no longer reduces to \n                  a quadratic runtime if there are many blocks with the same content \n                  in the files to patch.</li>\n                <li>Bug Fix: The documentation of the command-line utilities was \n                  incorrect and no warnings would be given by the runtimes, causing \n                  the patch not to work (this does not apply to NSIS patches).</li>\n              </ul>\n            </li>\n            <li>2.1 \n              <ul>\n                <li>Added argument checking and error handling to GenPat. Now \n                  returns exit codes as well to indicate success/failure (and \n                  the reason for failure). Only GenPat has changed in this version \n                  compared to 2.0 final.</li>\n                <li>Bug Fix: GenPat no longer gives an Access Violation when attempting \n                  to patch a file smaller than 64 bytes into a file larger than \n                  64 bytes.</li>\n              </ul>\n            </li>\n            <li>2.0 final \n              <ul>\n                <li>Cleaned up source code for the patch generator, which is now \n                  included (this code is written in Borland Delphi 6 and compiles \n                  with the freely available Personal edition).</li>\n              </ul>\n            </li>\n            <li>2.0 beta 2 \n              <ul>\n                <li>All new algorithm used in the patch generator: much faster \n                  (up to 90%) while using smaller block sizes (higher compression)</li>\n                <li>Created a NSIS 2 plugin</li>\n                <li>Works with small files</li>\n                <li>Replaces existing patch in file if original file CRC is identical</li>\n              </ul>\n            </li>\n          </ul>\n          </div>\n          <h2>Credits</h2>\n          <div>\n          <p>Written by Koen van de Sande.<br>\n            C plug-in initially by Edgewize, updated by Koen van de Sande.<br>\n            New documentation and example by Joost Verburg and Koen van de Sande.</p>\n          </div>\n          <h2>License</h2>\n          <div><pre>\nCopyright (C) 2001-2005 Koen van de Sande / Van de Sande Productions\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; \n   you must not claim that you wrote the original software.\n   If you use this software in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such,\n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any distribution.\n</pre></div>\n  </div>\n\n</body>\n</html>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/makensisw/License.txt",
    "content": "Copyright (c) 2002 Robert Rainwater <rrainwater@yahoo.com>\n\nThis software is provided 'as-is', without any express or implied\nwarranty.  In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n"
  },
  {
    "path": "setup/nsis/tools/Docs/makensisw/Readme.txt",
    "content": "----------------------------------------------------\nMakeNSISW - MakeNSIS Windows Wrapper\n----------------------------------------------------\n\n\nAbout MakeNSISW\n---------------\nMakeNSISW is a wrapper for the NSIS compiler (MakeNSIS).\nMakeNSISW allows you to compile NSIS scripts using a Windows GUI interface.\n\n\nRequirements\n------------\nMakeNSISW requires NSIS be installed on your system.  The default \ndirectory for this installation is $PROGRAMFILES\\NSIS\\Contrib\\MakeNSISW.\n\n\nUsage:\n------\nIf you installed the Shell Extensions option during the installation, then\nall that is required is that you choose 'Compile NSI' from the right-\nclick menu on a NSIS script.  This will invoke MakeNSISW.\n\nThe format of the parameters when calling MakeNSISW from the commandline is:\n  makensisw [options] [script.nsi | - [...]]\n\nFor the options, please see the MakeNSIS documentation.\n\n\nShortcut Keys\n-------------\nCtrl+A: Select all text\nCtrl+B: Open Script Folder\nCtrl+C: Copy selected text\nCtrl+D: Open the Define Symbols dialog\nCtrl+E: Edit the script\nCtrl+F: Find text\nCtrl+K: Abort compiler\nCtrl+L: Load a script\nCtrl+R, F7: Recompile the script\nCtrl+T, Ctrl+F5: Test the installer\nCtrl+W: Clear log window\nCtrl+<+|-|0>: Zoom log window\nAlt+X: Exit the application\nF1: View Documentation\nF5: Recompile and Test\n\n\nVersion History\n---------------\n0.1\n - Initial Release\n\n0.2\n - Added ability to save output and copy output\n\n0.3\n - Added option to recompile script (F2 or File|Recompile)\n - Added Help Menu\n - Return code is now always set\n - Added Accelerator key support for Exit and Recompile\n - No longer uses NSIS's version string\n - Made clearer status message in title bar\n - Disabled menu/accelerator functions during compile\n\n0.4\n - Fixed Copy Selected bug\n\n0.5\n - Minor Makefile changes (mingw)\n - Moved strings into global strings to make editing easier\n - Added Clear Log Command under Edit menu\n - Recompile no longer clears the log window (use F5)\n - Close is now the default button when you hit enter\n - added VC++ project, updated resources to work with VC++\n - rearranged directory structure\n - makefiles now target ../../makensisw.exe\n - removed makensisw home link in help menu (hope this is ok,\n   doesn't really seem needed to me)\n - made display use a fixed width font (Some people may not like\n   this, but I do)\n - added 'test' button (peeks output for 'Output' line)\n - made it so that the log shows the most recent 32k.\n - made it so that the log always clears on a recompile.\n - compiled with VC++ so no longer needs msvcrt.dll\n - made the compiler name be a full path (for more flexibility)\n\n0.6\n - print correct usage if unable to execute compiler\n - removed mingw warnings\n - set title/branding before errors\n - some docs changes\n - Added Edit|Edit Script function\n\n0.7\n - Edit Script should now work for output>32k\n - Added resize support (thanks to felfert)\n - Added window position saving (thanks to felfert)\n - Disable some items when exec of makensis failed\n\n0.8\n - Added window size constraints (thanks to bcheck)\n - Cleaned up the resource file\n\n0.9\n - Removed global strings (moved into #defines)\n - Some GUI changes\n - No longer focused Close button (its default anyways)\n - Fixed resize bug on minimize/restore (thanks to felfert)\n - Made window placement stored in HKLM instead of HKCU, cause\n   I hate things that get littered in HKCU.\n\n1.0\n - Fixed bug with large output causing crash\n\n1.1\n - Crash may actually be fixed\n\n1.2\n - XP visual style support\n\n1.3\n - Added Documentation menu item\n - Fix GUI problem with About dialog\n\n1.4\n - Edit Script command will now work with or without file associations\n - Added default filename for save dialog\n - Use standard fonts\n - Documentation menuitem caused recompile\n\n1.5\n - Fixed Copy All function\n\n1.6\n - Reduced size from 44k to 12k (kichik)\n - Editbox not limited to 32k (now using richedit control)\n - Made the log window font-size smaller.\n\n1.7\n - Added check for warnings\n - Added sound for successful compilations\n - Update home page and documentation menu items to Sourceforge page\n\n1.8\n - Contents of log window are now streamed in\n - Empty log window check (to prevent random crashes)\n\n1.9\n - Text always scrolls to bottom (kichik)\n - Updated link to new docs\n - Makensisw now takes the same parameters as makensis.exe\n - Fixed some random crashes\n - Drag and Drop Support into the Makensisw window\n - Updated icon to more sexy one\n - Added Load Script option on File menu\n - Added Search Dialog (Ctrl+F) (kichik)\n - Added Select All (Ctrl+A), Copy (Ctrl+C), Exit (Alt+X) keys\n - Branding text now reflects NSIS version\n - Added some simple tool tips\n - Added Context Menu in log window\n - Added resize gripper\n - Ctrl+L loads a script\n - Added Clear Log (Ctrl+W)\n - Browse Script (Ctrl+B) launches explorer in script directory\n - Check for Update command\n - Added link to the NSIS Forum under Help menu\n - Bunch of other stuff not worth mentioning\n - Define Symbols menu (Ctrl+D)\n\n2.0\n - Improved user interface\n - Define Symbols is available even if a script is not loaded\n - Defined Symbols are saved on exit and reloaded on start\n - Added NSIS Update menu\n - Added toolbar for commonly used menus\n - Made the Toolbar style flat\n - Added option for compile & run\n - Added compressor setting option\n - Added support for lzma compression\n - Added named Symbols sets.\n\n2.1\n - Added \"Cancel compilation\" menu item\n\n2.2\n- Settings saved in HKCU instead of HKLM\n- Added menu accelerators to MRU list\n\n2.3\n- Escape button closes MakeNSISw\n\n2.3.1\n- Fixed broken command line parameter handling\n\n2.3.2\n- The size gripper can be used to resize the window\n\n2.3.3\n- Update check switched from JNetLib to WinInet\n- New file type icons\n\n2.3.4\n- Added Window Info/Spy feature\n- System DPI aware\n- New toolbar images\n\n2.3.5\n- Added log window colors\n- Basic AppEvents custom sound support for BuildComplete, BuildWarning and BuildError\n\n2.3.6\n- Added GUID generator tool\n\n2.4\n- Added Lookup tool\n- Use Consolas font if it exists\n\n2.4.1\n- Close button transforms to Abort when appropriate\n- Prevent user from modifying the log\n- Log zoom\n\n\nCopyright Information\n---------------------\nCopyright (c) 2002 Robert Rainwater\nContributors: Justin Frankel, Fritz Elfert, Amir Szekely, \n              Sunil Kamath, Joost Verburg, Anders Kjersem.\n\nThis software is provided 'as-is', without any express or implied\nwarranty.  In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n"
  },
  {
    "path": "setup/nsis/tools/Docs/nsArray/Readme.txt",
    "content": "nsArray NSIS plug-in\n\nAuthor:   Stuart 'Afrow UK' Welch <afrowuk@afrowsoft.co.uk>\nCompany:  Afrow Soft Ltd\nLanguage: C\nDate:     2nd December 2014\nVersion:  1.1.1.7\n\nPlug-in for NSIS which provides dynamic, indexed and associative arrays\n(much like PHP). See Examples\\nsArray\\*.\n\n------------------------------------------------------------------------\nFeatures\n------------------------------------------------------------------------\n\n* Small DLL written in pure C\n* Low memory usage\n  - Linked lists\n  - Allocates small blocks of memory rather than one contiguous block\n* Much faster\n  - Uses memory pointers\n  - E.g. sorting copies memory pointers, not the data itself\n* Very simple usage\n  - Minimal set of functions\n  - Dynamic array size\n  - Indexed and associative (hashed)\n* No limit on the number of arrays\n\n------------------------------------------------------------------------\nNotice\n------------------------------------------------------------------------\n\n  For plug-in call usage in this readme, square brackets ([, ]) around\n  a plug-in call argument denote an optional argument.\n\n  I.e. [...] means there can optionally be more repeated arguments of\n  the same type already given.\n\n------------------------------------------------------------------------\nSetting & Getting Values\n------------------------------------------------------------------------\n\n  nsArray::Set my_array value\n\n  Adds `value` to the end of `my_array` with the next element index as\n  its key. If `my_array` does not already exist, it will be created.\n\n  Example:\n    ; array = {}\n    nsArray::Set array hello\n    ; array = {0 => hello}\n\n  --------------------------------------------------------------------\n\n  nsArray::Set my_array /key=key value\n\n  Adds `value` at `key`, overwriting any existing value.\n\n  Example:\n    ; array = {}\n    nsArray::Set array /key=Name Stuart\n    ; array = {Name => Stuart}\n\n  --------------------------------------------------------------------\n\n  nsArray::Set my_array /at=position value\n\n  Sets an element's value at the given zero-based position. An element\n  must already exist at the given position, or else the call will fail.\n  Specify a negative number to get an element starting from the end of\n  the array, with -1 being the last element, -2 the second-to-last and\n  so on. The error flag is set if the position is out of range.\n\n  Example:\n    ; array = {FirstName => Stuart, LastName => Welsh}\n    nsArray::Set array /at=1 Welch\n    ; array = {FirstName => Stuart, LastName => Welch}\n\n  --------------------------------------------------------------------\n\n  nsArray::SetList my_array element1 [element2 [...] /end\n\n  Adds multiple elements to `my_array` (note that /end is required).\n  Elements in the list are matched using the same syntax as the Set\n  function (above).\n\n  Example:\n    ; array = {lol => 1}\n    nsArray::SetList array /key=blah v1 v2 /at=0 v3 /key=9 22 v4 /end\n    ; array = {lol => v3, blah => v1, 0 => v2, 9 => 22, 10 => v4}\n\n  --------------------------------------------------------------------\n\n  nsArray::Get my_array key\n  Pop $value\n\n  Gets the value from `my_array` with the given key (or index). The\n  error flag is set if the array or key does not exist.\n\n  Example:\n    ; array = {0 => value1, blah => value2, 5 => value3}\n    nsArray::Get array 0\n    Pop $R0 ; value1\n    nsArray::Get array blah\n    Pop $R0 ; value2\n    nsArray::Get array 5\n    Pop $R0 ; value3\n\n  --------------------------------------------------------------------\n\n  nsArray::Get my_array /at=position\n  Pop $key\n  Pop $value\n\n  Gets an element's key and value from `my_array` at the given\n  zero-based position. This is useful for enumerating all keys and\n  values. Specify a negative number to get an element starting from the\n  end of the array, with -1 being the last element, -2 the second-to-\n  last and so on. The error flag is set if the position is out of range.\n\n  --------------------------------------------------------------------\n\n  nsArray::Iterate my_array\n  Pop $key\n  Pop $value\n\n  Gets the next element in the array for iteration through all elements,\n  starting from the first element. The error flag is set when the\n  iterator reaches the end of the array, on which the iterator is\n  reset.\n\n  --------------------------------------------------------------------\n\n  nsArray::Iterate my_array /prev\n  Pop $key\n  Pop $value\n\n  Gets the previous element in the array for iteration through all\n  elements (i.e. in reverse order), starting from the last element. The\n  error flag is set when the iterator reaches the end of the array,\n  on which the iterator is reset.\n\n  --------------------------------------------------------------------\n\n  nsArray::Iterate my_array /reset\n\n  Resets the current array iteration so that it can now start from the\n  beginning of the array again.\n\n------------------------------------------------------------------------\nRemoving Values\n------------------------------------------------------------------------\n\n  nsArray::Remove my_array element\n\n  Removes a single element by key, position or value.\n\n  Elements to remove can be matched using:\n\n   key      - Remove an element with the given key (case sensitive).\n   /at=pos  - Remove an element at the given zero-based position.\n   /val=val - Remove an element with the given value (case insensitive).\n\n  The error flag is set if the array does not exist or if the element\n  cannot be removed.\n\n  --------------------------------------------------------------------\n\n  nsArray::RemoveList my_array element1 [element2 [...]] /end\n\n  Removes multiple elements from `my_array` (note that /end is\n  required). Elements in the list are matched using the same syntax as\n  the Remove function (above).\n\n  Example:\n    ; array = {0 => ja, Hello => value1, blah => value2, 5 => value3}\n    nsArray::Remove array 0\n    ; array = {Hello => value1, blah => value2, 5 => value3}\n    nsArray::RemoveList array Hello /val=VALUE2 /at=0 /end\n    ; array = {}\n\n  --------------------------------------------------------------------\n\n  nsArray::Clear my_array\n\n  Removes all elements from `my_array`. The error flag is set if the\n  array does not exist.\n\n------------------------------------------------------------------------\nGeneral Functions\n------------------------------------------------------------------------\n\n  nsArray::Sort my_array flags\n\n  Sorts `my_array` using the given flags. Flags can be a combination of:\n\n  1  = Sort in descending order rather than ascending.\n  2  = Sort numeric rather than alpha.\n  4  = Ignore character case.\n  8  = Sort by keys rather than by values.\n  16 = Do not reorder keys when sorting by values.\n\n  E.g. specify `3` for `flags` to sort numbers in descending order. The\n  error flag is set if the array does not exist.\n\n  --------------------------------------------------------------------\n\n  nsArray::Join my_array join_str [/noempty]\n  Pop $joined\n\n  Concatenates the values of `my_array` into a string with `join_str` as\n  the delimiter. The error flag is set if the array does not exist or if\n  the result cannot completely fit into the output buffer\n  (NSIS_MAX_STRLEN) although as much as can fit into the output buffer\n  will still be returned. Specify /noempty to skip empty entries.\n\n  --------------------------------------------------------------------\n\n  nsArray::Split my_array split_str delim_str [/noempty] [/ignorecase]\n\n  Splits `split_str` into `my_array` using `delim_str` as the\n  delimiter. Specify /noempty to skip empty entries. Specify\n  /ignorecase to ignore the case of the delimiter.\n\n  --------------------------------------------------------------------\n\n  nsArray::Length my_array\n  Pop $length\n\n  Gets the number of elements in `my_array`. The error flag is set if\n  the array does not exist.\n\n------------------------------------------------------------------------\nScript Header Functions\n------------------------------------------------------------------------\n\n  nsArray.nsh contains some useful functions to further extend the\n  functionality of the plug-in. To use:\n\n    !include nsArray.nsh\n\n  --------------------------------------------------------------------\n\n  ${nsArray_Copy} src_array dst_array\n\n  Copies `src_array` to a new array called `dst_array`. The error flag\n  is set if the source array does not exist. The destination array can\n  already exist, in which case it is overwritten.\n\n  --------------------------------------------------------------------\n\n  ${nsArray_CopyKeys} src_array dst_array\n\n  Copies the keys from `src_array` to a new array called `dst_array`.\n  The error flag is set if the source array does not exist. The\n  destination array can already exist, in which case it is overwritten.\n\n  --------------------------------------------------------------------\n\n  ${nsArray_ToString} my_array\n  Pop $var\n\n  Returns a string representation of `my_array` which includes keys and\n  values in the format key1 => value1, key2 => value2, etc.. The error\n  flag is set if the array does not exist or if the result cannot\n  completely fit into the output buffer (NSIS_MAX_STRLEN) although as\n  much as can fit into the output buffer will still be returned.\n\n  --------------------------------------------------------------------\n\n  ${ForEachIn} my_array $key $value\n    DetailPrint \"my_array[$key] => $value\"\n  ${Next}\n\n  An array implementation of the LogicLib ForEach loop. The loop will\n  iterate over each element of the array, where $key and $value are an\n  element's respective key and value. One can iterate in reverse order\n  using ${ForEachInReverse}.\n\n------------------------------------------------------------------------\nChange Log\n------------------------------------------------------------------------\n\n1.1.1.7 - 2nd December 2014\n* x64 ANSI/Unicode builds.\n* DLL is no longer UPX compressed.\n\n1.1.1.6 - 1st June 2013\n* Fixed memory access violation in Iterate function due to NULL pointer\n  when an invalid array name is supplied.\n\n1.1.1.5 - 26th May 2013\n* Added /at= for Set and SetList functions.\n* Fixed SetList and RemoveList not setting the error flag on error if\n  one element was not set/added or removed successfully.\n* Added Iterate function which replaces iteration using Get with /next,\n  /prev and /reset.\n\n1.1.1.4 - 3rd September 2012\n* Replaced Set /list with SetList.\n* Replaced Remove /list with RemoveList.\n\n1.1.1.3 - 20th March 2012\n* Set and Remove functions require /list and /end when specifying\n  multiple elements to avoid eating up the stack. /end is not necessary\n  unless /list was used.\n* Fixed Remove function eating up the stack if the array does not exist.\n\n1.1.1.2 - 13th February 2012\n* Replaced /at=-1 with /next for Get function.\n* Replaced /at=-2 with /prev for Get function.\n* Added /reset switch to Get function to reset /next or /prev iteration.\n* The /at=position switch for Get and Remove functions now support\n  negative numbers.\n* Added call to Get /reset before entering ForEachIn loop.\n* Fixed incorrect usage of Split function in the readme.\n\n1.1.1.1 - 12th February 2012\n* Optimised Get /at=-1 by using a pointer instead of a counter.\n* Added Get /at=-2 to iterate in reverse order.\n* Added script header ForEachInReverse LogicLib loop.\n\n1.1.1.0 - 12th February 2012\n* Added Split function.\n* Added /noempty switch to Join function.\n* Sort function now supports ORing (|) for its sort flags.\n* Replaced Delete function with Clear function.\n* Replace GetAt function with /at=position switch on Get function.\n* Added Get /at=-1 for array element iteration.\n* Added /at=position and /val=value switches for Remove function.\n* Implemented script header replacements for Copy, CopyKeys and\n  ToString functions.\n* Added script header ForEachIn LogicLib loop.\n\n1.1.0.2 - 12th October 2011\n* Added GetAt function.\n* Added additional sort flag (16) to retain keys/indices order when\n  sorting values.\n* Removed New function. Set function now creates the array if it doesn't\n  already exist.\n\n1.1.0.1 - 9th September 2011\n* Fixed Get function returning incorrect values.\n\n1.1.0.0 - 2nd July 2011\n* Re-designed many plug-in functions to deal with indexed and\n  associative arrays.\n* Added ToString function.\n* Added CopyKeys function.\n* Added additional Sort function flag (8).\n\n1.0.0.1 - 2nd June 2011\n* Fixed decrementing of element and array counters on element and array\n  deletion.\n* Fixed memory leak of array name on array deletion.\n* Fixed bad pointers remaining after last element and array deletion.\n\n1.0.0.0 - 7th May 2011\n* First version.\n\n------------------------------------------------------------------------\nLicense\n------------------------------------------------------------------------\n\nThis plug-in is provided 'as-is', without any express or implied\nwarranty. In no event will the author be held liable for any damages\narising from the use of this plug-in.\n\nPermission is granted to anyone to use this plug-in for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this plug-in must not be misrepresented; you must not\n   claim that you wrote the original plug-in.\n   If you use this plug-in in a product, an acknowledgment in the\n   product documentation would be appreciated but is not required.\n2. Altered versions must be plainly marked as such, and must not be\n   misrepresented as being the original plug-in.\n3. This notice may not be removed or altered from any distribution."
  },
  {
    "path": "setup/nsis/tools/Docs/nsDialogs/Readme.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"color-scheme\" content=\"light dark\">\n<title>nsDialogs</title>\n<style type=\"text/css\">\n:root { color-scheme: light dark; }\nhtml, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }\nhtml { font-size: 0.85em; }\nbody { font-size: 1em; font-size: 1rem; }\nblockquote { margin: 0.75em; } .faq blockquote { margin-left: 0; }\npre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }\nspan.inlcod i { padding: 0px 0.2em; color: #444444; font-size:95%; }\ncode { margin-left: 1.2em; padding: 0.5em; background-color: #f0f0f0; display:inline-block; }\nblockquote pre { background-color: #fafafa; padding:0.5em; overflow: auto; }\nblockquote pre > b { color: #bb0000; }\nabbr { font-variant: none; cursor: help; }\n\n@media (prefers-color-scheme: dark) {\nhtml, body { color: #eeeeee; background-color: #161616; }\nspan.inlcod i { color: #bbbbbb; }\ncode { background-color: #202020; }\nblockquote pre { background-color: #222222; }\nblockquote pre > b { color: #eebbbb; }\n}\n</style>\n</head>\n<body>\n\n<h1>NSIS nsDialogs Plug-in</h1>\n<p><i>Next generation of user interface design</i></p>\n\n<h2>Table of Contents</h2>\n\n<ul>\n<li><a href=\"#intro\">Introduction</a></li>\n<li>\n<a href=\"#step\">Step-by-Step Tutorial</a>\n<ul>\n<li><a href=\"#step-page\">Custom Page</a></li>\n<li><a href=\"#step-add\">Adding Controls</a></li>\n<li><a href=\"#step-state\">Control State</a></li>\n<li><a href=\"#step-notify\">Real-time Notification</a></li>\n<li><a href=\"#step-memory\">Memory</a></li>\n</ul>\n</li>\n<li>\n<a href=\"#ref\">Function Reference</a>\n<ul>\n<li><a href=\"#ref-create\">Create</a></li>\n<li><a href=\"#ref-createcontrol\">CreateControl</a></li>\n<li><a href=\"#ref-show\">Show</a></li>\n<li><a href=\"#ref-selectfiledialog\">SelectFileDialog</a></li>\n<li><a href=\"#ref-selectfolderdialog\">SelectFolderDialog</a></li>\n<li><a href=\"#ref-setrtl\">SetRTL</a></li>\n<li><a href=\"#ref-getuserdata\">GetUserData</a></li>\n<li><a href=\"#ref-setuserdata\">SetUserData</a></li>\n<li><a href=\"#ref-onback\">OnBack</a></li>\n<li><a href=\"#ref-onchange\">OnChange</a></li>\n<li><a href=\"#ref-onclick\">OnClick</a></li>\n<li><a href=\"#ref-onnotify\">OnNotify</a></li>\n<li><a href=\"#ref-createtimer\">CreateTimer</a></li>\n<li><a href=\"#ref-killtimer\">KillTimer</a></li>\n</ul>\n</li>\n<li>\n<a href=\"#mref\">Macro Reference</a>\n<ul>\n<li><a href=\"#mref-create\">NSD_Create*</a></li>\n<li><a href=\"#mref-onback\">NSD_OnBack</a>, <a href=\"#mref-onchange\">NSD_OnChange</a>, <a href=\"#mref-onclick\">NSD_OnClick</a>, <a href=\"#mref-onnotify\">NSD_OnNotify</a></li>\n<li><a href=\"#mref-setfocus\">NSD_SetFocus</a></li>\n<li><a href=\"#mref-createtimer\">NSD_CreateTimer</a>, <a href=\"#mref-killtimer\">NSD_KillTimer</a></li>\n<li><a href=\"#mref-addstyle\">NSD_AddStyle</a>, <a href=\"#mref-addexstyle\">NSD_AddExStyle</a>, <a href=\"#mref-removestyle\">NSD_RemoveStyle</a>, <a href=\"#mref-removeexstyle\">NSD_RemoveExStyle</a></li>\n<li><a href=\"#mref-gettext\">NSD_GetText</a>, <a href=\"#mref-settext\">NSD_SetText</a></li>\n<li>Text, Password &amp; Number: \n<a href=\"#mref-settextlimit\">NSD_Edit_SetTextLimit</a>, \n<a href=\"#mref-edsetro\">NSD_Edit_SetReadOnly</a>,\n<a href=\"#mref-edsetcuebanner\">NSD_Edit_SetCueBannerText</a>\n</li>\n<li>RichEdit: \n<a href=\"#mref-richsettextlimit\">NSD_RichEd_SetTextLimit</a>, \n<a href=\"#mref-richseteventmask\">NSD_RichEd_SetEventMask</a>, \n<a href=\"#mref-richsetbkclr\">NSD_RichEd_SetCustomBackgroundColor</a>\n</li>\n<li>CheckBox &amp; RadioButton: \n<a href=\"#mref-getstate\">NSD_GetState</a>, \n<a href=\"#mref-setstate\">NSD_SetState</a>, \n<a href=\"#mref-check\">NSD_Check</a>, \n<a href=\"#mref-uncheck\">NSD_Uncheck</a>\n</li>\n<li>ComboBox &amp; DropList: \n<a href=\"#mref-cbaddstring\">NSD_CB_AddString</a>, \n<a href=\"#mref-cbinsstring\">NSD_CB_PrependString, NSD_CB_AppendString, NSD_CB_InsertString</a>, \nNSD_CB_DelString, \nNSD_CB_DelItem, \nNSD_CB_Clear, \n<a href=\"#mref-cbgetcount\">NSD_CB_GetCount</a>, \n<a href=\"#mref-cbselectstring\">NSD_CB_SelectString</a>\n</li>\n<li>ListBox: \n<a href=\"#mref-lbaddstring\">NSD_LB_AddString</a>, \n<a href=\"#mref-lbinsstring\">NSD_LB_PrependString, NSD_LB_AppendString, NSD_LB_InsertString</a>, \n<a href=\"#mref-lbdelstring\">NSD_LB_DelString</a>, \n<a href=\"#mref-lbdelitem\">NSD_LB_DelItem</a>, \n<a href=\"#mref-lbclear\">NSD_LB_Clear</a>, \n<a href=\"#mref-lbgetcount\">NSD_LB_GetCount</a>, \n<a href=\"#mref-lbselectstring\">NSD_LB_SelectString</a>, \n<a href=\"#mref-lbgetselection\">NSD_LB_GetSelection</a>\n</li>\n<li>Animation: \n<a href=\"#mref-animopenfile\">NSD_Anim_OpenFile</a>, \n<a href=\"#mref-animplay\">NSD_Anim_Play</a>, \n<a href=\"#mref-animstop\">NSD_Anim_Stop</a>\n</li>\n<li>HTrackBar &amp; VTrackBar: \n<a href=\"#mref-trackgetpos\">NSD_TrackBar_GetPos</a>, \n<a href=\"#mref-tracksetpos\">NSD_TrackBar_SetPos</a>, \n<a href=\"#mref-tracksetrmin\">NSD_TrackBar_SetRangeMin</a>, \n<a href=\"#mref-tracksetrmax\">NSD_TrackBar_SetRangeMax</a>, \n<a href=\"#mref-tracksetticfr\">NSD_TrackBar_SetTicFreq</a>\n</li>\n<li>UpDown: \n<a href=\"#mref-udsetbuddy\">NSD_UD_SetBuddy</a>, \n<a href=\"#mref-udgetpos\">NSD_UD_GetPos</a>, \n<a href=\"#mref-udsetpos\">NSD_UD_SetPos</a>,\n<a href=\"#mref-udsetpackedrange\">NSD_UD_SetPackedRange</a>\n</li>\n<li>HotKey: \n<a href=\"#mref-hkgethk\">NSD_HK_GetHotKey</a>, <a href=\"#mref-hksethk\">NSD_HK_SetHotKey</a>\n</li>\n<li>DatePicker: \n<a href=\"#mref-dategetdatefields\">NSD_Date_GetDateFields</a>\n</li>\n<li>Bitmap: \n<a href=\"#mref-setbitmap\">NSD_SetBitmap</a>, \n<a href=\"#mref-setsbitmap\">NSD_SetStretchedBitmap</a>, \n<a href=\"#mref-clearbitmap\">NSD_ClearBitmap</a>, \n<a href=\"#mref-freebitmap\">NSD_FreeBitmap</a>\n</li>\n<li>Icon: \n<a href=\"#mref-seticon\">NSD_SetIcon</a>, \n<a href=\"#mref-seticonfrominstaller\">NSD_SetIconFromInstaller</a>, \n<a href=\"#mref-clearicon\">NSD_ClearIcon</a>, \n<a href=\"#mref-freeicon\">NSD_FreeIcon</a>\n</li>\n</ul>\n</li>\n<li><a href=\"#faq\">FAQ</a></li>\n</ul>\n\n<h2><a name=\"intro\"></a>Introduction</h2>\n\n<p>nsDialogs allows creation of custom pages in the installer. On top of the built-in pages, nsDialogs can create pages with any type of controls in any order and arrangement. It can create everything from a simple page with one label to form which reacts to user's actions. <a href=\"../Modern%20UI%202/Readme.html\">Modern UI 2</a>, for example, uses nsDialogs to create the welcome and finish pages.</p>\n\n<p>nsDialogs is a NSIS plug-in, introduced in version 2.29 as a replacement for <a href=\"../InstallOptions/Readme.html\">InstallOptions</a>. nsDialogs doesn't use INI files, so it's way faster than InstallOptions. Integration with the script is tighter and more natural - creating controls is done using plug-in functions and notification is done by directly calling a function in the script. Unlike InstallOptions, there isn't a predefined set of available control type and by providing a lower level access to Windows API, every type of control can be created and pages can be more customizable.</p>\n\n<p>The same thing that makes nsDialogs more flexible can also make it more complicated for users with no knowledge of Win32 API. This is solved by creating a library of predefined functions, defined in script, that allow creation and handling of controls. This way, novices get easy access to the flexibility, while advanced users still get access to the <a href=\"http://msdn.microsoft.com/en-us/library/bb773169\">core functionality</a> by modifying the library or simply avoid using it.</p>\n\n<h2><a name=\"step\"></a>Step-by-Step Tutorial</h2>\n\n<h3><a name=\"step-page\"></a>Custom Page</h3>\n\n<p>Before you can start adding controls you need to create a nsDialogs custom page. nsDialogs pages can only be created in a custom page's creator function, not in sections nor regular functions. Lets create a basic script with a empty nsDialogs page as our skeleton:</p>\n\n<blockquote><pre><b>!include LogicLib.nsh</b>\n\nName nsDialogs\nOutFile nsDialogs.exe\nXPStyle on\n\n<b>\nVar Dialog\n\nPage custom nsDialogsPage</b>\nPage instfiles\n\n<b>Function nsDialogsPage\n\tnsDialogs::Create 1018\n\tPop $Dialog\n\n\t${If} $Dialog == error\n\t\tAbort\n\t${EndIf}\n\n\tnsDialogs::Show\nFunctionEnd</b>\n\nSection\nSectionEnd</pre></blockquote>\n<span class=\"inlcod\">\n<p>The first call must always be to <i>nsDialogs::Create</i>. It will create a new dialog in the page and return its <i>HWND</i> on the stack. The result must be popped from the stack to prevent stack corruption. If the result is <i>error</i>, the dialog couldn't be created and the page must be aborted!</p>\n<p><i>nsDialogs::Create</i> accepts one parameter. It has a very specific function, but to keep things simple for this tutorial, it must always be 1018.</p>\n<p><i>HWND</i> is a number that uniquely identifies the dialog and can be used with <i>SendMessage</i>, <i>SetCtlColors</i> and Win32 API functions.</p>\n<p>The dialog is not fully constructed at this point and you can make modifications to it before it is displayed. To finalize and display the dialog you must call <i>nsDialogs::Show</i>. This function will not return until the user clicks Next, Back or Cancel.</p>\n</span>\n\n\n<h3><a name=\"step-add\"></a>Adding Controls</h3>\n\n<span class=\"inlcod\">\n<p>Compiling the last script and running it results in an empty page which is not very useful. So now we'll add some controls to it to. To do so, we'll use <a href=\"#mref-create\">${NSD_Create*}</a> macros from nsDialogs.nsh. Each of those macros takes 5 parameters - x, y, width, height and text. Each macro also returns one value on the stack, which is the new control's <i>HWND</i>. Like the dialogs <i>HWND</i>, it must be popped from the stack and saved.</p>\n\n<p>Each of the measurements that the macros take can use one of three unit types - pixels, dialog units or percentage of the dialog's size. It can also be negative to indicate it should be measured from the end. To use dialog units, the measurement must be suffixed with the letter <i>u</i>. To use percentage, the measurement must be suffixed with the percentage sign - <i>%</i>. Any other suffix, or no suffix, means pixels.</p>\n\n<p>Dialog units allow creation of dialogs that scale well when different fonts or <abbr title=\"Dots per Inch\">DPI</abbr> is used. Its size in pixels is determined at runtime based on the font and the DPI. For example, standard pages in the classic NSIS user interface are 266 dialog units wide and 130 dialog units high. Pages in Modern UI are 300 dialogs units wide and 140 dialog units high. In different resolutions, using different fonts or DPI settings, the dialogs will always have the same size in dialog units, but different size in pixels.</p>\n</span>\n<blockquote><pre><b>!include nsDialogs.nsh</b>\n!include LogicLib.nsh\n\nName nsDialogs\nOutFile nsDialogs.exe\nXPStyle on\n\nVar Dialog\n<b>Var Label\nVar Text</b>\n\nPage custom nsDialogsPage\nPage instfiles\n\nFunction nsDialogsPage\n\n\tnsDialogs::Create 1018\n\tPop $Dialog\n\n\t${If} $Dialog == error\n\t\tAbort\n\t${EndIf}\n<b>\n\t${NSD_CreateLabel} 0 0 100% 12u \"Hello, welcome to nsDialogs!\"\n\tPop $Label\n\n\t${NSD_CreateText} 0 13u 100% -13u \"Type something here...\"\n\tPop $Text\n</b>\n\tnsDialogs::Show\n\nFunctionEnd\n\nSection\nSectionEnd</pre></blockquote>\n\n<p>Available control types that can be created with <a href=\"#mref-create\">${NSD_Create*}</a> are: \nHLine, \nVLine, \nLabel, \nIcon, \nBitmap, \nBrowseButton, \nLink, \nButton, \nGroupBox, \nCheckBox, \nRadioButton (FirstRadioButton and AdditionalRadioButton), \nText, \nMLText, \nPassword, \nNumber, \nFileRequest, \nDirRequest, \nRichEdit, \nComboBox, \nDropList, \nListBox, \nSortedListBox, \nProgressBar, \nAnimation, \nHTrackBar, \nVTrackBar, \nUpDown, \nHotKey, \nDatePicker, \nIPAddress, \nNetAddress.\n</p>\n\n<h3><a name=\"step-state\"></a>Control State</h3>\n\n<span class=\"inlcod\">\n<p>Now that we have some controls that the user can interact with, it's time to see what the user actually does with them. For that, we'll first add a \"leave callback function\" to our page. In that function, we'll query the state of the text control we've created and display it to the user. To do so, we'll use the <a href=\"#mref-gettext\">${NSD_GetText}</a> macro. Use the <a href=\"#mref-getstate\">${NSD_GetState}</a> macro for RadioButton and CheckBox controls.</p>\n\n<p>Note that not all controls support <a href=\"#mref-gettext\">${NSD_GetText}</a> and some require special handling with specific messages defined in WinMessages.nsh. For example, the ListBox control requires usage of <i>LB_GETCURSEL</i> and <i>LB_GETTEXT</i>. With time, the library of macros in nsDialogs.nsh will fill with more and more macros that'll handle more cases like this.</p>\n</span>\n<blockquote><pre>!include nsDialogs.nsh\n!include LogicLib.nsh\n\nName nsDialogs\nOutFile nsDialogs.exe\nXPStyle on\n\nVar Dialog\nVar Label\nVar Text\n\nPage custom nsDialogsPage <b>nsDialogsPageLeave</b>\nPage instfiles\n\nFunction nsDialogsPage\n\n\tnsDialogs::Create 1018\n\tPop $Dialog\n\n\t${If} $Dialog == error\n\t\tAbort\n\t${EndIf}\n\n\t${NSD_CreateLabel} 0 0 100% 12u \"Hello, welcome to nsDialogs!\"\n\tPop $Label\n\n\t${NSD_CreateText} 0 13u 100% -13u \"Type something here...\"\n\tPop $Text\n\n\tnsDialogs::Show\n\nFunctionEnd\n\n<b>Function nsDialogsPageLeave\n\n\t${NSD_GetText} $Text $0\n\tMessageBox MB_OK \"You typed:$\\n$\\n$0\"\n\nFunctionEnd</b>\n\nSection\nSectionEnd</pre></blockquote>\n\n<h3><a name=\"step-notify\"></a>Real-time Notification</h3>\n\n<span class=\"inlcod\">\n<p>One of the more exciting new features of nsDialogs is callback function notification of changes to the dialog. nsDialogs can call a function defined in a script in response to a user action such as changing of a text field or click of a button. To make nsDialogs notify us of events, we'll use <a href=\"#mref-onclick\">${NSD_OnClick}</a> and <a href=\"#mref-onchange\">${NSD_OnChange}</a>. Not every control supports both of the events. For example, there is nothing to notify about label changes, only clicks.</p>\n\n<p>When the callback function is called, the control's <i>HWND</i> will be waiting on the stack and must be popped to prevent stack corruption. In this simple example, this is not so useful. But in case of a bigger script where several controls are associated with the same callback function, the <i>HWND</i> can shed some light on which control originated the event.</p>\n\n<p>The new example will respond to the user typing \"hello\" in the text box.</p>\n</span>\n<blockquote><pre>!include nsDialogs.nsh\n!include LogicLib.nsh\n\nName nsDialogs\nOutFile nsDialogs.exe\nXPStyle on\n\nVar Dialog\nVar Label\nVar Text\n\nPage custom nsDialogsPage nsDialogsPageLeave\nPage instfiles\n\nFunction nsDialogsPage\n\n\tnsDialogs::Create 1018\n\tPop $Dialog\n\n\t${If} $Dialog == error\n\t\tAbort\n\t${EndIf}\n\n\t${NSD_CreateLabel} 0 0 100% 12u \"Hello, welcome to nsDialogs!\"\n\tPop $Label\n\n\t${NSD_CreateText} 0 13u 100% -13u \"Type something here...\"\n\tPop $Text\n\t<b>${NSD_OnChange} $Text nsDialogsPageTextChange</b>\n\n\tnsDialogs::Show\n\nFunctionEnd\n\nFunction nsDialogsPageLeave\n\n\t${NSD_GetText} $Text $0\n\tMessageBox MB_OK \"You typed:$\\n$\\n$0\"\n\nFunctionEnd\n\n<b>Function nsDialogsPageTextChange\n\n\tPop $1 # $1 == $ Text\n\n\t${NSD_GetText} $Text $0\n\n\t${If} $0 == \"hello\"\n\n\t\tMessageBox MB_OK \"right back at ya!\"\n\n\t${EndIf}\n\nFunctionEnd</b>\n\nSection\nSectionEnd</pre></blockquote>\n\n<h3><a name=\"step-memory\"></a>Memory</h3>\n\n<p>So far we have a page that has some basic input controls. But what happens when the user goes to the next page and comes back? With the current code, the user's input will not be remembered. To remember, we'll use the already present leave callback function to store the user's choice in variables and pass these values when creating the controls the next time. For a better example, we'll also add a checkbox to the page and use <a href=\"#mref-getstate\">${NSD_GetState}</a> and <a href=\"#mref-setstate\">${NSD_SetState}</a> to get and set its state.</p>\n\n<p>For clarity, we'll remove some of the notifications from the previous step.</p>\n\n<blockquote><pre>!include nsDialogs.nsh\n!include LogicLib.nsh\n\nName nsDialogs\nOutFile nsDialogs.exe\nXPStyle on\n\nVar Dialog\nVar Label\nVar Text\n<b>Var Text_State\nVar Checkbox\nVar Checkbox_State</b>\n\nPage custom nsDialogsPage nsDialogsPageLeave\n<b>Page license</b>\nPage instfiles\n\n<b>Function .onInit\n\n\tStrCpy $Text_State \"Type something here...\"\n\nFunctionEnd</b>\n\nFunction nsDialogsPage\n\n\tnsDialogs::Create 1018\n\tPop $Dialog\n\n\t${If} $Dialog == error\n\t\tAbort\n\t${EndIf}\n\n\t${NSD_CreateLabel} 0 0 100% 12u \"Hello, welcome to nsDialogs!\"\n\tPop $Label\n\n\t${NSD_CreateText} 0 13u 100% <b>12u $Text_State</b>\n\tPop $Text\n\n\t<b>${NSD_CreateCheckbox} 0 30u 100% 10u \"&amp;Something\"\n\tPop $Checkbox\n\n\t${If} $Checkbox_State == ${BST_CHECKED}\n\t\t${NSD_Check} $Checkbox\n\t${EndIf}\n\n\t# alternative for the above ${If}:\n\t#${NSD_SetState} $Checkbox_State</b>\n\n\tnsDialogs::Show\n\nFunctionEnd\n\nFunction nsDialogsPageLeave\n\n\t${NSD_GetText} $Text <b>$Text_State</b>\n\t<b>${NSD_GetState} $Checkbox $Checkbox_State</b>\n\nFunctionEnd\n\nSection\nSectionEnd</pre></blockquote>\n\n<h2><a name=\"ref\"></a>Function Reference</h2>\n\n<h3><a name=\"ref-create\"></a>Create</h3>\n<p><code>nsDialogs::Create <i>rect</i></code></p>\n<p>Creates a new dialog. <i>rect</i> specific the identifier of the control whose location will be mimiced. This should usually be 1018, which is control mimiced for creation of built-in pages. The Modern UI also has control 1044 for the welcome and the finish page.</p>\n<p>Returns the new dialog's HWND on the stack or <i>error</i>.</p>\n\n<h3><a name=\"ref-createcontrol\"></a>CreateControl</h3>\n<p><code>nsDialogs::CreateControl <i>class</i> <i>style</i> <i>extended_style</i> <i>x</i> <i>y</i> <i>width</i> <i>height</i> <i>text</i></code></p>\n<p>Create a new control in the current dialog. A dialog must exist for this to work, so nsDialogs::Create must be called prior to this function.</p>\n<p>Returns the new control's HWND on the stack or <i>error</i>.</p>\n\n<h3><a name=\"ref-show\"></a>Show</h3>\n<p><code>nsDialogs::Show</code></p>\n<p>Displays the page. Call this once finished with nsDialogs::Create, nsDialogs::CreateControl and the rest.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-selectfiledialog\"></a>SelectFileDialog</h3>\n<p><code>nsDialogs::SelectFileDialog <i>mode</i> <i>initial_selection</i> <i>filter</i></code></p>\n<p>Displays a file selection dialog to the user. If <i>mode</i> is set to <i>save</i>, displays a file save dialog. If <i>mode</i> is set to <i>open</i>, displays a file open dialog.\n<p><i>initial_selection</i> can be used to provide the user with a default file to look for and/or a default folder to look in. If <i>initial_selection</i> is empty no default filename will be provided for the user and the dialog will start in the current working directory. If <i>initial_selection</i> specifies just a filename, for example \"test.exe\", the dialog will be set up to look for a file called test.exe in the current working directory. If <i>initial_selection</i> specifies just a directory, for example \"C:\\Program Files\", the dialog starts in the provided directory with no file name provided. If <i>initial_selection</i> specifies a directory and a filename, for example \"C:\\Windows\\System32\\calc.exe\", the dialog will be set up to look for a file called calc.exe in the directory C:\\Windows\\System32.</p>\n<p><i>filter</i> is a list of available file filter pairs separated by pipes. A filter pair consists of a display string and a <a href=\"https://blogs.msdn.microsoft.com/jeremykuhne/2017/06/04/wildcards-in-windows/\">DOS-style wildcard pattern</a>. If an empty string is passed, the default is used (<i>\"All Files|*.*\"</i>).</p>\n<p>Returns the selected file on the stack or an empty string if the user canceled the operation.</p>\n<blockquote><pre>\nnsDialogs::SelectFileDialog open \"$DOCUMENTS\\Config.ini\" \".ini files|*.ini|All Files|*.*\"\nPop $0\nStrCmp $0 \"\" ...\n</pre></blockquote>\n\n<h3><a name=\"ref-selectfolderdialog\"></a>SelectFolderDialog</h3>\n<p><code>nsDialogs::SelectFolderDialog <i>title</i> <i>initial_selection</i></code></p>\n<p>Displays a directory selection dialog to the user.</p>\n<p>Returns the selected directory on the stack or \"error\" in case the user canceled the operation or an error occurred.</p>\n\n<h3><a name=\"ref-setrtl\"></a>SetRTL</h3>\n<p><code>nsDialogs::SetRTL <i>rtl_setting</i></code></p>\n<p>Sets right-to-left mode on or off. If <i>rtl_setting</i> is 0, it's set to off. If <i>rtl_setting</i> is 1, it's set to on. This function must be called before any calls to nsDialogs::CreateControl.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-getuserdata\"></a>GetUserData</h3>\n<p><code>nsDialogs::GetUserData <i>control_HWND</i></code></p>\n<p>Returns user data associated with the control on the stack.  Use nsDialogs::SetUserData to set this data.</p>\n\n<h3><a name=\"ref-setuserdata\"></a>SetUserData</h3>\n<p><code>nsDialogs::SetUserData <i>control_HWND</i> <i>data</i></code></p>\n<p>Associates <i>data</i> with the control. Use nsDialogs::GetUserData to get this data.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-onback\"></a>OnBack</h3>\n<p><code>nsDialogs::OnBack <i>function_address</i></code></p>\n<p>Sets the callback function for the Back button. This function will be called when the user clicks the back button. Call Abort in this function to prevent the user from going back to the last page.</p>\n<p>Use GetFunctionAddress to get the address of the desired callback function.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-onchange\"></a>OnChange</h3>\n<p><code>nsDialogs::OnChange <i>control_HWND</i> <i>function_address</i></code></p>\n<p>Sets a change notification callback function for the given control. Whenever the control changes, the function will be called and the control's HWND will be waiting on its stack.</p>\n<p>Use GetFunctionAddress to get the address of the desired callback function.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-onclick\"></a>OnClick</h3>\n<p><code>nsDialogs::OnClick <i>control_HWND</i> <i>function_address</i></code></p>\n<p>Sets a click notification callback function for the given control. Whenever the control is clicked, the function will be called and the control's HWND will be waiting on its stack.</p>\n<p>Use GetFunctionAddress to get the address of the desired callback function.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-onnotify\"></a>OnNotify</h3>\n<p><code>nsDialogs::OnNotify <i>control_HWND</i> <i>function_address</i></code></p>\n<p>Sets a notification callback function for the given control. Whenever the control receives the WM_NOTIFY message, the function will be called and the control's HWND, notification code and a pointer to the NMHDR structure will be waiting on its stack. Use ${NSD_Return} to return a value.</p>\n<p>Use GetFunctionAddress to get the address of the desired callback function.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-createtimer\"></a>CreateTimer</h3>\n<p><code>nsDialogs::CreateTimer <i>function_address</i> <i>timer_interval</i></code></p>\n<p>Sets a timer that'd call the callback function for the given control every in a constant interval. Interval times are specified in milliseconds.</p>\n<p>Use GetFunctionAddress to get the address of the desired callback function.</p>\n<p>Returns nothing.</p>\n\n<h3><a name=\"ref-killtimer\"></a>KillTimer</h3>\n<p><code>nsDialogs::KillTimer <i>function_address</i></code></p>\n<p>Kills a previously set timer.</p>\n<p>Use GetFunctionAddress to get the address of the desired callback function.</p>\n<p>Returns nothing.</p>\n\n<h2><a name=\"mref\"></a>Macro Reference</h2>\n<p>nsDialogs.nsh contains a lot of macros that can make nsDialogs usage a lot easier. Below is a description of each of those macros including purpose, syntax, input and output.</p>\n\n<h3><a name=\"mref-create\"></a>NSD_Create*</h3>\n<p><code>${NSD_Create*} <i>x</i> <i>y</i> <i>width</i> <i>height</i> <i>text</i></code></p>\n<p>Create a new control in the current dialog. A dialog must exist for this to work, so nsDialogs::Create must be called prior to this function.</p>\n<p>Available variants:</p>\n<ul>\n<li>${NSD_CreateHLine}</li>\n<li>${NSD_CreateVLine}</li>\n<li>${NSD_CreateLabel}</li>\n<li>${NSD_CreateIcon}</li>\n<li>${NSD_CreateBitmap}</li>\n<li>${NSD_CreateBrowseButton}</li>\n<li>${NSD_CreateLink}</li>\n<li>${NSD_CreateButton}</li>\n<li>${NSD_CreateGroupBox}</li>\n<li>${NSD_CreateCheckBox}</li>\n<li>${NSD_CreateRadioButton} <small>(${NSD_CreateFirstRadioButton} and ${NSD_CreateAdditionalRadioButton})</small></li>\n<li>${NSD_CreateText}</li>\n<li>${NSD_CreateMLText}</li>\n<li>${NSD_CreatePassword}</li>\n<li>${NSD_CreateNumber}</li>\n<li>${NSD_CreateFileRequest}</li>\n<li>${NSD_CreateDirRequest}</li>\n<li>${NSD_CreateRichEdit}</li>\n<li>${NSD_CreateComboBox}</li>\n<li>${NSD_CreateDropList}</li>\n<li>${NSD_CreateListBox}</li>\n<li>${NSD_CreateSortedListBox}</li>\n<li>${NSD_CreateProgressBar}</li>\n<li>${NSD_CreateAnimation}</li>\n<li>${NSD_CreateHTrackBar}</li>\n<li>${NSD_CreateVTrackBar}</li>\n<li>${NSD_CreateUpDown}</li>\n<li>${NSD_CreateHotKey}</li>\n<li>${NSD_CreateDatePicker} <small>(Requires <abbr title=\"Internet Explorer\">IE</abbr> 3.1 and <span class=\"inlcod\"><i>${NSD_InitCommonControlsEx}</i></span>)</small></li>\n<li>${NSD_CreateIPAddress} <small>(Requires <abbr title=\"Internet Explorer\">IE</abbr> 4 and <span class=\"inlcod\"><i>${NSD_InitCommonControl_IPAddress}</i></span>)</small></li>\n<li>${NSD_CreateNetAddress} <small>(Requires Vista and <span class=\"inlcod\"><i>${NSD_InitCommonControl_NetAddress}</i></span>)</small></li>\n</ul>\n<p>Returns the new control's HWND on the stack or <i>error</i></p>\n\n<h3><a name=\"mref-onback\"></a>NSD_OnBack</h3>\n<p><code>${NSD_OnBack} <i>function_name</i></code></p>\n<p>See <a href=\"#ref-onback\">OnBack</a> for more details.</p>\n\n<h3><a name=\"mref-onchange\"></a>NSD_OnChange</h3>\n<p><code>${NSD_OnChange} <i>control_HWND</i> <i>function_name</i></code></p>\n<p>See <a href=\"#ref-onchange\">OnChange</a> for more details.</p>\n<p>See <a href=\"#step-notify\">Real-time Notification</a> for usage example.</p>\n\n<h3><a name=\"mref-onclick\"></a>NSD_OnClick</h3>\n<p><code>${NSD_OnClick} <i>control_HWND</i> <i>function_name</i></code></p>\n<p>See <a href=\"#ref-onclick\">OnClick</a> for more details.</p>\n\n<h3><a name=\"mref-onnotify\"></a>NSD_OnNotify</h3>\n<p><code>${NSD_OnNotify} <i>control_HWND</i> <i>function_name</i></code></p>\n<p>See <a href=\"#ref-onnotify\">OnNotify</a> for more details.</p>\n\n<h3><a name=\"mref-return\"></a>NSD_Return</h3>\n<p><code>${NSD_Return} <i>value</i></code></p>\n<p>Used to return a value back to Windows from a OnNotify callback.</p>\n\n<h3><a name=\"mref-setfocus\"></a>NSD_SetFocus</h3>\n<p><code>${NSD_SetFocus} <i>control_HWND</i></code></p>\n<p>Sets focus to a control.</p>\n\n<h3><a name=\"mref-createtimer\"></a>NSD_CreateTimer</h3>\n<p><code>${NSD_CreateTimer} <i>function_name</i> <i>timer_interval</i></code></p>\n<p>See <a href=\"#ref-createtimer\">CreateTimer</a> for more details.</p>\n\n<h3><a name=\"mref-killtimer\"></a>NSD_KillTimer</h3>\n<p><code>${NSD_KillTimer} <i>function_name</i></code></p>\n<p>See <a href=\"#ref-killtimer\">KillTimer</a> for more details.</p>\n\n<h3><a name=\"mref-addstyle\"></a>NSD_AddStyle</h3>\n<p><code>${NSD_AddStyle} <i>control_HWND</i> <i>style</i></code></p>\n<p>Adds one or more window styles to a control. Multiple styles should be separated with pipes `|'.</p>\n<p>See MSDN for shared and per-control style descriptions.</p>\n\n<h3><a name=\"mref-addexstyle\"></a>NSD_AddExStyle</h3>\n<p><code>${NSD_AddExStyle} <i>control_HWND</i> <i>style</i></code></p>\n<p>Adds one or more extended window styles to a control. Multiple styles should be separated with pipes `|'.</p>\n<p>See <a href=\"https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543\">MSDN</a> for style descriptions.</p>\n\n<h3><a name=\"mref-removestyle\"></a>NSD_RemoveStyle</h3>\n<p><code>${NSD_RemoveStyle} <i>control_HWND</i> <i>style</i></code></p>\n<p>Removes one or more window styles from a control.</p>\n\n<h3><a name=\"mref-removeexstyle\"></a>NSD_RemoveExStyle</h3>\n<p><code>${NSD_RemoveExStyle} <i>control_HWND</i> <i>style</i></code></p>\n<p>Removes one or more extended window styles from a control.</p>\n\n<h3><a name=\"mref-gettext\"></a>NSD_GetText</h3>\n<p><code>${NSD_GetText} <i>control_HWND</i> <i>$output_variable</i></code></p>\n<p>Retrieves the text of a control and stores it into <i>output_variable</i>. Especially useful for textual controls.</p>\n<p>See <a href=\"#step-state\">Control State</a> for usage example.</p>\n\n<h3><a name=\"mref-settext\"></a>NSD_SetText</h3>\n<p><code>${NSD_SetText} <i>control_HWND</i> <i>text</i></code></p>\n<p>Sets the text of a control.</p>\n\n<h3><a name=\"mref-settextlimit\"></a>NSD_Edit_SetTextLimit</h3>\n<p><code>${NSD_Edit_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>\n<p>Sets the input length limit for a text control.</p>\n\n<h3><a name=\"mref-edsetro\"></a>NSD_Edit_SetReadOnly</h3>\n<p><code>${NSD_Edit_SetReadOnly} <i>control_HWND</i> <i>readonly</i></code></p>\n<p>1 to make the text control read-only or 0 to allow the user to input data.</p>\n\n<h3><a name=\"mref-edsetcuebanner\"></a>NSD_Edit_SetCueBannerText</h3>\n<p><code>${NSD_Edit_SetCueBannerText} <i>control_HWND</i> <i>displaywhenfocused</i> <i>text</i></code></p>\n<p>Set a text hint displayed when the control is empty. The text is only visible on WinXP and later. Requires <i>XPStyle on</i>.</p>\n\n<h3><a name=\"mref-richsettextlimit\"></a>NSD_RichEd_SetTextLimit</h3>\n<p><code>${NSD_RichEd_SetTextLimit} <i>control_HWND</i> <i>limit</i></code></p>\n<p>Sets the input length limit.</p>\n\n<h3><a name=\"mref-richseteventmask\"></a>NSD_RichEd_SetEventMask</h3>\n<p><code>${NSD_RichEd_SetEventMask} <i>control_HWND</i> <i>eventmask</i></code></p>\n\n<h3><a name=\"mref-richsetbkclr\"></a>NSD_RichEd_SetCustomBackgroundColor</h3>\n<p><code>${NSD_RichEd_SetCustomBackgroundColor} <i>control_HWND</i> <i>COLORREF</i></code></p>\n\n<h3><a name=\"mref-getstate\"></a>NSD_GetState</h3>\n<p><code>${NSD_GetState} <i>control_HWND</i> <i>$output_variable</i></code></p>\n<p>Retrieves the state of a check box or a radio button control. Possible outputs are ${BST_CHECKED} and ${BST_UNCHECKED}.</p>\n<p>See <a href=\"#step-memory\">Memory</a> for usage example.</p>\n\n<h3><a name=\"mref-setstate\"></a>NSD_SetState</h3>\n<p><code>${NSD_SetState} <i>control_HWND</i> <i>state</i></code></p>\n<p>Sets the state of a check box or a radio button control. Possible values for <i>state</i> are ${BST_CHECKED} and ${BST_UNCHECKED}.</p>\n<p>See <a href=\"#step-memory\">Memory</a> for usage example.</p>\n\n<h3><a name=\"mref-check\"></a>NSD_Check</h3>\n<p><code>${NSD_Check} <i>control_HWND</i></code></p>\n<p>Checks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_CHECKED}.</p>\n\n<h3><a name=\"mref-uncheck\"></a>NSD_Uncheck</h3>\n<p><code>${NSD_Uncheck} <i>control_HWND</i></code></p>\n<p>Unchecks a check box or a radio button control. Same as calling ${NSD_SetState} with ${BST_UNCHECKED}.</p>\n<p>See <a href=\"#step-memory\">Memory</a> for usage example.</p>\n\n<h3><a name=\"mref-cbaddstring\"></a>NSD_CB_AddString</h3>\n<p><code>${NSD_CB_AddString} <i>combo_HWND</i> <i>string</i></code></p>\n<p>Adds a string to a combo box.</p>\n\n<h3><a name=\"mref-cbinsstring\"></a>NSD_CB_InsertString</h3>\n<p><code>${NSD_CB_InsertString} <i>combo_HWND</i> <i>index</i> <i>string</i></code></p>\n<p><code>${NSD_CB_PrependString} <i>combo_HWND</i> <i>string</i></code></p>\n<p><code>${NSD_CB_AppendString} <i>combo_HWND</i> <i>string</i></code></p>\n<p>Insert a string in a specified position in a combo box.</p>\n\n<h3><a name=\"mref-cbselectstring\"></a>NSD_CB_SelectString</h3>\n<p><code>${NSD_CB_SelectString} <i>combo_HWND</i> <i>string</i></code></p>\n<p>Selects a string in a combo box.</p>\n\n<h3><a name=\"mref-cbgetcount\">NSD_CB_GetCount</a></h3>\n<p><code>${NSD_CB_GetCount} <i>combo_HWND</i> <i>$output_variable</i></code></p>\n\n<h3><a name=\"mref-lbaddstring\"></a>NSD_LB_AddString</h3>\n<p><code>${NSD_LB_AddString} <i>listbox_HWND</i> <i>string</i></code></p>\n<p>Adds a string to a list box.</p>\n\n<h3><a name=\"mref-lbinsstring\"></a>NSD_LB_InsertString</h3>\n<p><code>${NSD_LB_InsertString} <i>listbox_HWND</i> <i>index</i> <i>string</i></code></p>\n<p><code>${NSD_LB_PrependString} <i>listbox_HWND</i> <i>string</i></code></p>\n<p><code>${NSD_LB_AppendString} <i>listbox_HWND</i> <i>string</i></code></p>\n<p>Insert a string in a specified position in a list box.</p>\n\n<h3><a name=\"mref-lbdelstring\"></a>NSD_LB_DelString</h3>\n<p><code>${NSD_LB_DelString} <i>listbox_HWND</i> <i>string</i></code></p>\n<p>Deletes a string from a list box.</p>\n\n<h3><a name=\"mref-lbdelitem\"></a>NSD_LB_DelItem</h3>\n<p><code>${NSD_LB_DelItem} <i>listbox_HWND</i> <i>itemindex</i></code></p>\n<p>Deletes a string from a list box.</p>\n\n<h3><a name=\"mref-lbclear\">NSD_LB_Clear</a></h3>\n<p><code>${NSD_LB_Clear} <i>listbox_HWND</i></code></p>\n<p>Deletes all strings from a list box.</p>\n\n<h3><a name=\"mref-lbgetcount\">NSD_LB_GetCount</a></h3>\n<p><code>${NSD_LB_GetCount} <i>listbox_HWND</i> <i>$output_variable</i></code></p>\n<p>Retrieves the number of strings from a list box.</p>\n\n<h3><a name=\"mref-lbselectstring\"></a>NSD_LB_SelectString</h3>\n<p><code>${NSD_LB_SelectString} <i>listbox_HWND</i> <i>string</i></code></p>\n<p>Selects a string in a list box.</p>\n\n<h3><a name=\"mref-lbgetselection\">NSD_LB_GetSelection</a></h3>\n<p><code>${NSD_LB_GetSelection} <i>listbox_HWND</i> <i>$output_variable</i></code></p>\n<p>Retrieves the selected string from a list box. Returns an empty string if no string is selected.</p>\n\n<h3><a name=\"mref-animopenfile\">NSD_Anim_OpenFile</a></h3>\n<p><code>${NSD_Anim_OpenFile} <i>anim_HWND</i> <i>avi_path</i></code></p>\n<p>Opens the specified (silent) .AVI movie clip.</p>\n\n<h3><a name=\"mref-animplay\">NSD_Anim_Play</a></h3>\n<p><code>${NSD_Anim_Play} <i>anim_HWND</i></code></p>\n<p>Plays the movie clip repeatedly.</p>\n\n<h3><a name=\"mref-animstop\">NSD_Anim_Stop</a></h3>\n<p><code>${NSD_Anim_Stop} <i>anim_HWND</i></code></p>\n<p>Stops playback.</p>\n\n<h3><a name=\"mref-trackgetpos\">NSD_TrackBar_GetPos</a></h3>\n<p><code>${NSD_TrackBar_GetPos} <i>track_HWND</i> <i>$output</i></code></p>\n\n<h3><a name=\"mref-tracksetpos\">NSD_TrackBar_SetPos</a></h3>\n<p><code>${NSD_TrackBar_SetPos} <i>track_HWND</i> <i>pos</i></code></p>\n\n<h3><a name=\"mref-tracksetrmin\">NSD_TrackBar_SetRangeMin</a></h3>\n<p><code>${NSD_TrackBar_SetRangeMin} <i>track_HWND</i> <i>minpos</i></code></p>\n\n<h3><a name=\"mref-tracksetrmax\">NSD_TrackBar_SetRangeMax</a></h3>\n<p><code>${NSD_TrackBar_SetRangeMax} <i>track_HWND</i> <i>maxpos</i></code></p>\n\n<h3><a name=\"mref-tracksetticfr\">NSD_TrackBar_SetTicFreq</a></h3>\n<p><code>${NSD_TrackBar_SetTicFreq} <i>track_HWND</i> <i>frequency</i></code></p>\n<p>Sets the interval frequency for tick marks.</p>\n\n<h3><a name=\"mref-udsetbuddy\">NSD_UD_SetBuddy</a></h3>\n<p><code>${NSD_UD_SetBuddy} <i>ud_HWND</i> <i>buddy_HWND</i></code></p>\n\n<h3><a name=\"mref-udgetpos\">NSD_UD_GetPos</a></h3>\n<p><code>${NSD_UD_GetPos} <i>ud_HWND</i> <i>$output</i></code></p>\n\n<h3><a name=\"mref-udsetpos\">NSD_UD_SetPos</a></h3>\n<p><code>${NSD_UD_SetPos} <i>ud_HWND</i> <i>pos</i></code></p>\n\n<h3><a name=\"mref-udsetpackedrange\">NSD_UD_SetPackedRange</a></h3>\n<p><code>${NSD_UD_SetPackedRange} <i>ud_HWND</i> <i>packedrange</i></code></p>\n<p>Sets the min-max range. Two signed 16-bit numbers packed into 32-bits.</p>\n\n<h3><a name=\"mref-hkgethk\">NSD_HK_GetHotKey</a></h3>\n<p><code>${NSD_HK_GetHotKey} <i>hk_HWND</i> <i>$output</i></code></p>\n<p>Bits 0..7 specify the virtual key code and bits 8..15 specify the HOTKEYF modifier flags.</p>\n\n<h3><a name=\"mref-hksethk\">NSD_HK_SetHotKey</a></h3>\n<p><code>${NSD_HK_SetHotKey} <i>hk_HWND</i> <i>packedhotkey</i></code></p>\n\n<h3><a name=\"mref-dategetdatefields\">NSD_Date_GetDateFields</a></h3>\n<p><code>${NSD_Date_GetDateFields} <i>HWND</i></code></p>\n<p>Returns the month, day and year on the stack.</p>\n\n<h3><a name=\"mref-setbitmap\"></a><a name=\"mref-setimage\"></a>NSD_SetBitmap</h3>\n<p><code>${NSD_SetBitmap} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>\n<p>Loads a bitmap from <i>image_path</i> and displays it on <i>control_HWND</i> created by <a href=\"#mref-create\">${NSD_CreateBitmap}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href=\"#mref-freebitmap\">${NSD_FreeBitmap}</a> once no longer necessary.</p>\n<p>The image must be extracted to the user's computer prior to calling this macro. A good place to extract images is $PLUGINSDIR.</p>\n<blockquote><pre>!include nsDialogs.nsh\n\nName nsDialogs\nOutFile nsDialogs.exe\n\nPage custom nsDialogsImage\nPage instfiles\n\nVar Dialog\nVar ImageCtrl\nVar BmpHandle\n\nFunction .onInit\n\tInitPluginsDir\n\tFile /oname=$PLUGINSDIR\\image.bmp \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis-r.bmp\"\nFunctionEnd\n\nFunction nsDialogsImage\n\tnsDialogs::Create 1018\n\tPop $Dialog\n\n\t${If} $Dialog == error\n\t\tAbort\n\t${EndIf}\n\n\t${NSD_CreateBitmap} 0 0 100% 100% \"\"\n\tPop $ImageCtrl\n\t${NSD_SetBitmap} $ImageCtrl $PLUGINSDIR\\image.bmp $BmpHandle\n\n\tnsDialogs::Show\n\n\t${NSD_FreeBitmap} $BmpHandle\nFunctionEnd\n\nSection\nSectionEnd</pre></blockquote>\n\n<h3><a name=\"mref-setsbitmap\"></a><a name=\"mref-setsimage\"></a>NSD_SetStretchedBitmap</h3>\n<p><code>${NSD_SetStretchedBitmap} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>\n<p>Loads and displays a bitmap just like <a href=\"#mref-setbitmap\">${NSD_SetImage}</a> but stretches the image to fit the control.</p>\n\n<h3><a name=\"mref-clearbitmap\"></a><a name=\"mref-clearimage\"></a>NSD_ClearBitmap</h3>\n<p><code>${NSD_ClearBitmap} <i>control_HWND</i></code></p>\n<p>Clears a bitmap from a image control.</p>\n\n<h3><a name=\"mref-freebitmap\"></a><a name=\"mref-freeimage\"></a>NSD_FreeBitmap</h3>\n<p><code>${NSD_FreeImage} <i>image_handle</i></code></p>\n<p>Frees an image handle previously loaded with <a href=\"#mref-setbitmap\">${NSD_SetImage}</a> or <a href=\"#mref-setsbitmap\">${NSD_SetStretchedBitmap}</a>.</p>\n\n<h3><a name=\"mref-seticon\"></a>NSD_SetIcon</h3>\n<p><code>${NSD_SetIcon} <i>control_HWND</i> <i>image_path</i> <i>$output_variable</i></code></p>\n<p>Same as <a href=\"#mref-setimage\">${NSD_SetImage}</a>, but used for loading and setting an icon in a control created by <a href=\"#mref-create\">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href=\"#mref-freeicon\">${NSD_FreeIcon}</a> once no longer necessary.</p>\n\n<h3><a name=\"mref-seticonfrominstaller\"></a>NSD_SetIconFromInstaller</h3>\n<p><code>${NSD_SetIconFromInstaller} <i>control_HWND</i> <i>$output_variable</i></code></p>\n<p>Loads the icon used in the installer and displays it on <i>control_HWND</i> created by <a href=\"#mref-create\">${NSD_CreateIcon}</a>. The image handle is stored in <i>output_variable</i> and should be freed using <a href=\"#mref-freeicon\">${NSD_FreeIcon}</a> once no longer necessary.</p>\n\n<h3><a name=\"mref-clearicon\"></a>NSD_ClearIcon</h3>\n<p><code>${NSD_ClearIcon} <i>control_HWND</i></code></p>\n<p>Clears an icon from a control.</p>\n\n<h3><a name=\"mref-freeicon\"></a>NSD_FreeIcon</h3>\n<p><code>${NSD_FreeIcon} <i>icon_handle</i></code></p>\n<p>Frees an icon handle previously loaded with <a href=\"#mref-seticon\">${NSD_SetIcon}</a> or <a href=\"#mref-seticonfrominstaller\">${NSD_SetIconFromInstaller}</a>.</p>\n\n\n<h2><a name=\"faq\"></a>FAQ</h2>\n<div class=\"faq\">\n<ul>\n<li>\n<b>Q:</b> Can nsDialogs handle InstallOptions INI files?\n<blockquote>\n<p><b>A:</b> nsDialogs.nsh contains a function called <i>CreateDialogFromINI</i> that can create nsDialogs' dialog from an INI file. It can handle every type of control InstallOptions supports, but doesn't handle the flags or notifications. <i>Examples\\nsDialogs\\InstallOptions.nsi</i> shows a usage example of this function.</p>\n</blockquote>\n</li>\n</ul>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "setup/nsis/tools/Docs/nsExec/nsExec.txt",
    "content": "nsExec\n------\nnsExec will execute command-line based programs and capture the output\nwithout opening a dos box.\n\n\nUsage\n-----\nnsExec::Exec [/MBCS] [/OEM] [/TIMEOUT=x] path\nPop $0\n\n-or-\n\nnsExec::ExecToLog [/MBCS] [/OEM] [/TIMEOUT=x] path\nPop $0\n\n-or-\n\nnsExec::ExecToStack [/MBCS] [/OEM] [/TIMEOUT=x] path\nPop $0 ; Return\nPop $1 ; Output\n\nAll functions are the same except ExecToLog will print the output\nto the log window and ExecToStack will push up to ${NSIS_MAX_STRLEN}\ncharacters of output onto the stack after the return value.\n\nUse the /MBCS switch to disable Unicode detection and always treat the text as ANSI.\n\nUse the /OEM switch to convert the output text from OEM to ANSI.\n\nThe timeout value is optional.  The timeout is the time in\nmilliseconds nsExec will wait for output.  If output from the\nprocess is received, the timeout value is reset and it will\nagain wait for more output using the timeout value.  See Return \nValue for how to check if there was a timeout.\n\nTo ensure that command are executed without problems on all windows versions,\nis recommended to use the following syntax:\n\n   nsExec::ExecToStack [OPTIONS] '\"PATH\" param1 param2 paramN'\n\nThis way the application path may contain non 8.3 paths (with spaces)\n\nReturn Value\n------------\nIf nsExec is unable to execute the process, it will return \"error\"\non the top of the stack, if the process timed out it will return\n\"timeout\", else it will return the return code from the\nexecuted process.\n\n\nCopyright Info\n--------------\nCopyright (c) 2002 Robert Rainwater\nThanks to Justin Frankel and Amir Szekely"
  },
  {
    "path": "setup/nsis/tools/Docs/w7tbp/w7tbp.Readme.txt",
    "content": "\n****************************************\n** TaskbarProgress NSIS plug-in\n****************************************\n\nAuthor:  AndersK\nWeblink: http://nsis.sourceforge.net/TaskbarProgress_plug-in\nVersion: 20091109\nMinimum NSIS Version: 2.43\nLicense: zlib/libpng\nContrib: Marius Negrutiu (built for amd64-unicode)\n         https://github.com/negrutiu/nsis\n\n\n****************************************\n** Usage:\n****************************************\n\nSection -MyFirstSection\n\tw7tbp::Start /NOUNLOAD\nSectionEnd\n\nCall \"w7tbp::Start /NOUNLOAD\" from your first section\n/NOUNLOAD is mandatory otherwise the framework unloads the plugin immediately\n\nThe plugin will do the rest...\nIt monitors installer's progress bar and reflects it in the taskbar\nEnjoy!\n\nNOTE: Threre's no \"w7tbp::Stop\". The plugin will unload automatically when the installer exits\n"
  },
  {
    "path": "setup/nsis/tools/Examples/AdvSplash/Example.nsi",
    "content": "Name \"AdvSplash.dll test\"\n\nOutFile \"AdvSplash Test.exe\"\n\nXPStyle on\n\nFunction .onInit\n        # the plugins dir is automatically deleted when the installer exits\n        InitPluginsDir\n        File /oname=$PLUGINSDIR\\splash.bmp \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp\"\n        #optional\n        #File /oname=$PLUGINSDIR\\splash.wav \"C:\\myprog\\sound.wav\"\n\n        MessageBox MB_OK \"Fading\"\n\n        advsplash::show 1000 600 400 -1 $PLUGINSDIR\\splash\n\n        Pop $0          ; $0 has '1' if the user closed the splash screen early,\n                        ; '0' if everything closed normally, and '-1' if some error occurred.\n\n        MessageBox MB_OK \"Transparency\"\n        File /oname=$PLUGINSDIR\\splash.bmp \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-uninstall.bmp\"\n        advsplash::show 2000 0 0 0x1856B1 $PLUGINSDIR\\splash\n        Pop $0 \n\n        MessageBox MB_OK \"Transparency/Fading\"\n        File /oname=$PLUGINSDIR\\splash.bmp \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\llama.bmp\"\n        advsplash::show 1000 600 400 0x04025C $PLUGINSDIR\\splash\n        Pop $0 \n\n        Delete $PLUGINSDIR\\splash.bmp\nFunctionEnd\n\nSection\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/AppGen.nsi",
    "content": "/*\nNote: This is not a installer example script, it's a script for a simple application used by some of the other examples.\n*/\n\n!define /math ARCBITS ${NSIS_PTR_SIZE} * 8\nName \"${NAME}\"\n!define /IfNDef OUTFILE \"\"\nOutFile \"${OUTFILE}\"\nUnicode True\n!define /IfNDef REL User\nRequestExecutionLevel ${REL}\nXPStyle On\nManifestDPIAware True\nAutoCloseWindow True\nBrandingText \" \"\nCaption \"$(^Name) (${ARCBITS}-bit)\"\nMiscButtonText \" \" \" \" \"E&xit\" \" \"\nLicenseBkColor /windows\n\n!ifdef COMPANY\n!ifndef NOPEVI\n!define /IfNDef VER 1.2.3.4\nVIProductVersion ${VER}\nVIAddVersionKey /LANG=0 \"FileVersion\" \"${VER}\"\nVIAddVersionKey /LANG=0 \"CompanyName\" \"${COMPANY}\"\nVIAddVersionKey /LANG=0 \"LegalCopyright\" \"${U+00A9} ${COMPANY}\"\nVIAddVersionKey /LANG=0 \"FileDescription\" \"${NAME}\"\n!endif\n!endif\n\n!include WinMessages.nsh\n!include LogicLib.nsh\n\nPageEx License\n\tCaption \" \"\n\tLicenseText \"$ExeFile$\\n$ExePath\" \"E&xit\"\n\tPageCallbacks \"\" OnShow\nPageExEnd\nPage InstFiles\n\n\nFunction .onInit\n!ifdef AUMI\nSystem::Call 'SHELL32::SetCurrentProcessExplicitAppUserModelID(ws)' \"${AUMI}\"\n!endif\nFunctionEnd\n\n\nFunction OnShow\nFindWindow $0 \"#32770\" \"\" $hWndParent\nGetDlgItem $R9 $0 0x3E8\n\n!ifdef MSG\nSendMessage $R9 ${EM_REPLACESEL} \"\" \"STR:${MSG}$\\r$\\n$\\r$\\n\"\n!endif\n\n!ifdef TMPLDATA\n${IfNot} ${FileExists} \"$AppData\\${NAME}\\*\"\n  ; Copy template data from the shared source to this users profile\n  CreateDirectory \"$AppData\\${NAME}\"\n  CopyFiles /Silent \"${TMPLDATA}\\*\" \"$AppData\\${NAME}\"\n${EndIf}\nReadIniStr $2 \"$AppData\\${NAME}\\Data.ini\" Example Count\nIntOp $2 $2 + 1\nWriteIniStr \"$AppData\\${NAME}\\Data.ini\" Example Count $2\nSendMessage $R9 ${EM_REPLACESEL} \"\" \"STR:Launch Count=$2$\\r$\\n$\\r$\\n\"\n!endif\n\nSendMessage $R9 ${EM_REPLACESEL} \"\" \"STR:CmdLine=$CmdLine$\\r$\\n\"\nReadEnvStr $2 \"USERNAME\"\nSendMessage $R9 ${EM_REPLACESEL} \"\" \"STR:%USERNAME%=$2$\\r$\\n\"\nReadEnvStr $2 \"__COMPAT_LAYER\"\nStrCmp $2 \"\" +2\nSendMessage $R9 ${EM_REPLACESEL} \"\" \"STR:Compatibility=$2$\\r$\\n\"\nFunctionEnd\n\nSection\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Banner/Example.nsi",
    "content": "# Look at Readme.txt for usage alongside with the Modern UI\n\n!include \"WinMessages.nsh\"\n\nName \"Banner.dll test\"\n\nOutFile \"Banner Test.exe\"\n\nShowInstDetails show\n\nFunction .onInit\n\tBanner::show \"Calculating important stuff...\"\n\n\tBanner::getWindow\n\tPop $1\n\n\tagain:\n\t\tIntOp $0 $0 + 1\n\t\tSleep 1\n\t\tStrCmp $0 100 0 again\n\n\tGetDlgItem $2 $1 1030\n\tSendMessage $2 ${WM_SETTEXT} 0 \"STR:Calculating more important stuff...\"\n\n\tagain2:\n\t\tIntOp $0 $0 + 1\n\t\tSleep 1\n\t\tStrCmp $0 200 0 again2\n\n\tBanner::destroy\nFunctionEnd\n\nSection\n\tDetailPrint \"Using previous calculations to quickly calculate 1*2000...\"\n\tSleep 1000\n\tDetailPrint \"Eureka! It's $0!!!\"\n\tDetailPrint \"\"\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/BgImage/Example.nsi",
    "content": "Name \"BgImage.dll test\"\n\nOutFile \"BgImage Test.exe\"\n\nXPStyle on\nRequestExecutionLevel user\n\n!define DEBUG\n!macro GetReturnValue\n!ifdef DEBUG\n\tPop $R9\n\tStrCmp $R9 success +2\n\t\tDetailPrint \"Error: $R9\"\n!endif\n!macroend\n\nFunction .onGUIInit\n\t# the plugins dir is automatically deleted when the installer exits\n\tInitPluginsDir\n\t# lets extract some bitmaps...\n\tFile /oname=$PLUGINSDIR\\1.bmp \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\llama.bmp\"\n\tFile /oname=$PLUGINSDIR\\2.bmp \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\"\n\n!ifdef DEBUG\n\t# turn return values on if in debug mode\n\tBgImage::SetReturn on\n!endif\n\n\t# set the initial background for images to be drawn on\n\t# we will use a gradient from drak green to dark red\n\tBgImage::SetBg /GRADIENT 0 0x80 0 0x80 0 0\n\t!insertmacro GetReturnValue\n\t# add an image @ (150,0)\n\tBgImage::AddImage $PLUGINSDIR\\2.bmp 150 0\n\t!insertmacro GetReturnValue\n\t# add the same image only transparent (magenta wiped) @ (150,16)\n\tBgImage::AddImage /TRANSPARENT 255 0 255 $PLUGINSDIR\\2.bmp 150 16\n\t!insertmacro GetReturnValue\n\t# create the font for the following text\n\tCreateFont $R0 \"Comic Sans MS\" 50 700\n\t# add a blue shadow for the text\n\tBgImage::AddText \"Testing 1... 2... 3...\" $R0 0 0 255 48 48 798 198\n\t!insertmacro GetReturnValue\n\t# add a green shadow for the text\n\tBgImage::AddText \"Testing 1... 2... 3...\" $R0 0 255 0 52 52 802 202\n\t!insertmacro GetReturnValue\n\t# add the text\n\tBgImage::AddText \"Testing 1... 2... 3...\" $R0 255 0 0 50 50 800 200\n\t!insertmacro GetReturnValue\n\t# show our creation to the world!\n\tBgImage::Redraw\n\t# Refresh doesn't return any value\n\t\nFunctionEnd\n\nShowInstDetails show\n\nSection\n\t# play some sounds\n\tFindFirst $0 $1 $WINDIR\\Media\\*.wav\n\tStrCmp $0 \"\" skipSound\n\t\tmoreSounds:\n\t\tStrCmp $1 \"\" noMoreSounds\n\t\t\tBgImage::Sound /WAIT $WINDIR\\Media\\$1\n\t\t\t# Sound doesn't return any value either\n\t\t\tMessageBox MB_YESNO \"Another sound?\" IDNO noMoreSounds\n\t\t\t\tFindNext $0 $1\n\t\t\t\tGoto moreSounds\n\n\tnoMoreSounds:\n\t\tFindClose $0\n\tskipSound:\n\n\t# change the background image to Mike, tiled\n\tBgImage::SetBg /TILED $PLUGINSDIR\\1.bmp\n\t!insertmacro GetReturnValue\n\t# we have to redraw to reflect the changes\n\tBgImage::Redraw\n\n\tMessageBox MB_OK \"Mike the llama\"\n\n\t# clear everything\n\tBgImage::Clear\n\t# Clear doesn't return any value\n\t# set another gradient\n\tBgImage::SetBg /GRADIENT 0xFF 0xFA 0xBA 0xAA 0xA5 0x65\n\t!insertmacro GetReturnValue\n\t# add some text\n\tBgImage::AddText \"A Desert for Mike\" $R0 0 0 0 50 50 800 150\n\t!insertmacro GetReturnValue\n\t# add mike as an image\n\tBgImage::AddImage $PLUGINSDIR\\1.bmp 50 150\n\t!insertmacro GetReturnValue\n\t# again, we have to call redraw to reflect changes\n\tBgImage::Redraw\nSectionEnd\n\nFunction .onGUIEnd\n\tBgImage::Destroy\n\t# Destroy doesn't return any value\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/Batch.nsi",
    "content": "\n!define APP_NAME BatchTest\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n!include \"MUI2.nsh\"\n!insertmacro MUI_PAGE_INSTFILES\n!insertmacro MUI_LANGUAGE \"English\"\n\n\nSection \"Dummy Section\" SecDummy\n\n    ExecDos::exec '\"$EXEDIR\\first.bat\"' \"\" \"$EXEDIR\\stdout.txt\"\n    Pop $0\n    MessageBox MB_OK \"Exit code $0\"\n\nSectionEnd\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/Detailed.nsi",
    "content": ";--------------------------------\n; ExecDos plug-in Script Sample\n; Takhir Bedertdinov\n\n\n;--------------------------------\n; Base names definition\n\n  !define APP_NAME Detailed\n  !define DOS_APP consApp.exe\n\n\n;--------------------------------\n; General Attributes\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n\n;--------------------------------\n; Interface Settings\n\n  !include \"MUI2.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n;--------------------------------\n; Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n    SetDetailsView show\n    DetailPrint \"Executing console application\" \n; async launch\n    ExecDos::exec /ASYNC /DETAILED /TIMEOUT=6000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\"\n    Pop $0 ; thread handle for 'wait'\n\n; time to check process exit code (optional)\n    ExecDos::wait $0\n\n    Pop $0 ; return value - process exit code or error or STILL_ACTIVE (0x103).\n; normal exit code is 5 for consApp.exe\n    MessageBox MB_OK \"Exit code $0\"\n\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/Example.nsi",
    "content": ";--------------------------------\n; ExecDos plug-in Script Sample\n; Takhir Bedertdinov\n\n\n;--------------------------------\n; Base names definition\n\n  !define APP_NAME ExecDos\n  !define DOS_APP consApp.exe\n\n\n;--------------------------------\n; General Attributes\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n\n;--------------------------------\n; Interface Settings\n\n  !include \"MUI2.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n;--------------------------------\n; Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n; entry points: 'exec' and 'wait'\n\n; exec - starts hidden process with redirected IO\n; parameters: [/NOUNLOAD /ASYNC] [/TIMEOUT=xxx] [/TOSTACK] application_to_run [stdin_string] [log_file_name]\n; /ASYNC - not waits for process exit.\n; timeout is TOTAL execution time, milliseconds\n; for example /TIMEOUT=10000    Should be >50   Default is big enough\n; short timeouts may cause -8 plug-in exit code (APPLICATION TERMINATED)\n; application_to_run is mandatory, other params are optional, but if stack\n; stores other vars, would be better to set \"\" for unused parameter\n; return value in the sync mode is application' exit code\n; with /ASYNC option returns thread handle\n\n; wait - waits for process exit (with /ASYNC option only). Require thread handle. Optional if you don't need exit code.\n; parameters: thread_handle. If stack is not used between 'exec' and 'wait', both Pop $0 and 'wait' param may be skipped.\n; process exit code is available (Pop) after 'wait' exits.\n\n    DetailPrint \"Executing console application\" \n; async launch\n    ExecDos::exec /NOUNLOAD /ASYNC /TIMEOUT=5000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" \"$EXEDIR\\stdout.txt\"\n    Pop $0 ; thread handle for 'wait'\n\n; you can add installation code here, for example\n    Sleep 1000\n    DetailPrint \"Installing Software\"\n    Sleep 1000\n    DetailPrint \"Installing More Software\"\n    Sleep 1000\n\n; time to check process exit code (optional)\n    ExecDos::wait $0\n\n; sync launch\n;    ExecDos::exec /TIMEOUT=5000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" \"$EXEDIR\\stdout.txt\"\n\n    Pop $0 ; return value - process exit code or error or STILL_ACTIVE (0x103).\n; normal exit code is 5 for consApp.exe\n    MessageBox MB_OK \"Exit code $0\"\n\nSectionEnd\n\n;Function .onInit\n;    ExecDos::exec /NOUNLOAD /TIMEOUT=5000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" \"$EXEDIR\\${APP_NAME}.log\"\n;    Pop $0\n;    MessageBox MB_OK \"Exit code $0\"\n;FunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/IsDone.nsi",
    "content": ";--------------------------------\n; ExecDos plug-in Script Sample\n; Takhir Bedertdinov\n\n\n;--------------------------------\n; Base names definition\n\n  !define APP_NAME \"ExecDos IsDone\"\n  !define DOS_APP consApp.exe\n\n\n;--------------------------------\n; General Attributes\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n\n;--------------------------------\n; Interface Settings\n\n  !include \"MUI2.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n\n\n  !insertmacro MUI_LANGUAGE \"English\"\n\n; $R1 - process status, 1 = exited, 0 = still running\n; $R7 - Exit code\n; $R9 - thread handle\n\n\n\n;--------------------------------\n; Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetDetailsView show\n\n; async launch to detailed  - no last parameter.\n  DetailPrint \"Executing console application, async mode\" \n  ExecDos::exec /NOUNLOAD /ASYNC /DETAILED /TIMEOUT=6000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\"\n  Pop $R9 ; thread handle for 'wait'\n  ExecDos::isdone /NOUNLOAD $R9\n  Pop $R1\n  DetailPrint \"isdone returned $R1\" \n  Sleep 5000\n  ExecDos::isdone /NOUNLOAD $R9\n  Pop $R1\n  DetailPrint \"isdone returned $R1\" \n; some other code may be here\n; time to check process exit code (optional)\n  ExecDos::wait $R9\n  Pop $R7\n\n; normal exit code is 5 for consApp.exe\n  DetailPrint \"Exit code $R7\" \n\n\nSectionEnd\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/Multi.nsi",
    "content": "!define APP_NAME Multi\n!define DOS_APP consApp.exe\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n\n  !include \"MUI2.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_LANGUAGE \"English\"\n\nSection \"Dummy Section\" SecDummy\n\n; async launch, application sleeps 1 sec while bat is executing (see consApp.cpp)\n    ExecDos::exec /NOUNLOAD /ASYNC \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" \"$EXEDIR\\stdout1.txt\"\n    Pop $0 ; consApp.exe thread handle for 'wait'\n; sync launch (may be async as well, but with 'ExecDos::wait /NOUNLOAD $1' and 'Pop $1' this case)\n    ExecDos::exec /NOUNLOAD \"$EXEDIR\\first.bat\" \"\" \"$EXEDIR\\stdout2.txt\"\n    Pop $1 ; bat exit code\n    ExecDos::wait $0 ; consApp.exe handle\n    Pop $0 ; return value - consApp.exe exit code or error or STILL_ACTIVE (0x103).\n; normal exit code is 5 for consApp.exe, 0 for bat. log files have additional info\n    MessageBox MB_OK \"Exit code bat=$1, exe=$0\"\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/ToFunc.nsi",
    "content": ";--------------------------------\n; ExecDos plug-in Script Sample\n; Takhir Bedertdinov\n\n\n;--------------------------------\n; Base names definition\n\n  !define APP_NAME \"ExecDos ToStack\"\n  !define DOS_APP consApp.exe\n\n\n;--------------------------------\n; General Attributes\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n\n;--------------------------------\n; Interface Settings\n\n  !include \"MUI2.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n;--------------------------------\n; Our function to be called\nFunction LogFunction\n  IntOp $1 $1 + 1\n  Pop $2\n  MessageBox MB_OK \"Output line #$1: $2\"\nFunctionEnd\n\n\n;--------------------------------\n; Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n    StrCpy $1 0\n\n    DetailPrint \"Executing console application\" \n; async launch\n    GetFunctionAddress $0 LogFunction\n    ExecDos::exec /ASYNC /TOFUNC /TIMEOUT=5000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" $0\n    Pop $0 ; thread handle for 'wait'\n\n; execute NSIS code here if you want\n\n; time to check process exit code (optional)\n    ExecDos::wait $0\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/ToStack.nsi",
    "content": ";--------------------------------\n; ExecDos plug-in Script Sample\n; Takhir Bedertdinov\n\n\n;--------------------------------\n; Base names definition\n\n  !define APP_NAME \"ExecDos ToStack\"\n  !define DOS_APP consApp.exe\n\n\n;--------------------------------\n; General Attributes\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n\n;--------------------------------\n; Interface Settings\n\n  !include \"MUI2.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n;--------------------------------\n; Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n    DetailPrint \"Executing console application\" \n; async launch\n    ExecDos::exec /ASYNC /TOSTACK /TIMEOUT=5000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\"\n    Pop $0 ; thread handle for 'wait'\n\n; you can add installation code here, for example\n    Sleep 1000\n    DetailPrint \"Installing Software\"\n    Sleep 1000\n    DetailPrint \"Installing More Software\"\n    Sleep 1000\n\n; time to check process exit code (optional)\n    ExecDos::wait $0\n\n    Pop $0 ; return value - process exit code or error or STILL_ACTIVE (0x103).\n; normal exit code is 5 for consApp.exe\n    MessageBox MB_OK \"Exit code $0\"\n\n    StrCpy $2 \"\"\nloop:\n    Pop $1\n    IfErrors show\n    StrCpy $2 \"$1$\\n$2\"\n    GoTo loop\nshow:\n    MessageBox MB_OK \"$2\"\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/ToWindow.nsi",
    "content": ";--------------------------------\n; ExecDos plug-in Script Sample\n; Takhir Bedertdinov\n\n\n;--------------------------------\n; Base names definition\n\n  !define APP_NAME \"ExecDos ToWindow\"\n  !define DOS_APP consApp.exe\n\n\n;--------------------------------\n; General Attributes\n\nName \"${APP_NAME} Test\"\nOutFile \"${APP_NAME}.exe\"\n\n\n;--------------------------------\n; Interface Settings\n\n  !include \"MUI2.nsh\"\n  !include \"InstallOptions.nsh\"\n  Page custom CustomPageEdit\n  Page custom CustomPageList\n  !insertmacro MUI_PAGE_INSTFILES\n\n\n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n; $R0 - enable/disable buttons flag\n; $R2 - end function pointer\n; $R4 - $R7 - Exit codes collection\n; $R8 - target window handle\n; $R9 - thread handle\n\n\n\n;--------------------------------\n; Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetDetailsView show\n\n; sync launch to window\n  DetailPrint \"Executing console application, sync mode\" \n  FindWindow $0 \"#32770\" \"\" $HWNDPARENT\n  GetDlgItem $R8 $0 1016\n  ExecDos::exec /TOWINDOW /TIMEOUT=6000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" $R8\n  Pop $R6 ; return value - process exit code or error or STILL_ACTIVE (0x103).\n\n\n; async launch to detailed  - no last parameter.\n  DetailPrint \"Executing console application, async mode\" \n  ExecDos::exec /ASYNC /DETAILED /TIMEOUT=6000 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\"\n  Pop $R9 ; thread handle for 'wait'\n; some other code may be here\n; time to check process exit code (optional)\n  ExecDos::wait $R9\n  Pop $R7\n\n; normal exit code is 5 for consApp.exe\n    MessageBox MB_OK \"Exit codes $R4 $R5 $R6 $R7\"\n\n\nSectionEnd\n\nFunction enableNext\n\n  GetDlgItem $0 $HWNDPARENT 1\n  EnableWindow $0 $R0\n  GetDlgItem $0 $HWNDPARENT 2\n  EnableWindow $0 $R0\n  GetDlgItem $0 $HWNDPARENT 3\n  EnableWindow $0 $R0\n\nFunctionEnd\n\nFunction CustomPageEdit\n\n  !insertmacro MUI_HEADER_TEXT \"ExecDos /TOWINDOW test\" \"Multiline Edit Window\"\n  !insertmacro INSTALLOPTIONS_EXTRACT ml_edit.ini\n  !insertmacro INSTALLOPTIONS_INITDIALOG ml_edit.ini\n  Pop $0\n  !insertmacro INSTALLOPTIONS_READ $R8 ml_edit.ini \"Field 1\" HWND\n  StrCpy $R0 0\n  Call enableNext\n  StrCpy $R0 1\n  GetFunctionAddress $R2 enableNext\n  ExecDos::exec /ASYNC /TOWINDOW /ENDFUNC=$R2 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" $R8\n  Pop $R9\n  !insertmacro INSTALLOPTIONS_SHOW\n\n  ; Security feature.\n  ExecDos::wait $R9\n  Pop  $R4\n\n\n\nFunctionEnd\n\nFunction CustomPageList\n\n  !insertmacro MUI_HEADER_TEXT \"ExecDos /TOWINDOW test\" \"ListBox Window\"\n  !insertmacro INSTALLOPTIONS_EXTRACT listbox.ini\n  !insertmacro INSTALLOPTIONS_INITDIALOG listbox.ini\n  Pop $0\n  !insertmacro INSTALLOPTIONS_READ $R8 listbox.ini \"Field 1\" HWND\n  StrCpy $R0 0\n  Call enableNext\n  StrCpy $R0 1\n  ExecDos::exec /ASYNC /TOWINDOW /ENDFUNC=$R2 \"$EXEDIR\\consApp.exe\" \"test_login$\\ntest_pwd$\\n\" $R8\n  Pop $R9\n\n  !insertmacro INSTALLOPTIONS_SHOW\n\n  ExecDos::wait $R9\n  Pop  $R5\n\n\n\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/first.bat",
    "content": "@echo off\nSET PATH=c:\\aaa;%PATH%\ncall second.bat\ndir\nmore bat.nsi\ncls\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/listbox.ini",
    "content": "[Settings]\nNumFields=1\n\n[Field 1]\nType=ListBox\nLeft=10\nRight=-10\nTop=20\nBottom=120\nState=\"Welcome\\r\\n\"\nFlags=MULTILINE|VSCROLL|WANTRETURN"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/ml_edit.ini",
    "content": "[Settings]\nNumFields=1\n\n[Field 1]\nType=Text\nLeft=10\nRight=-10\nTop=20\nBottom=120\nState=\"Welcome\\r\\n\"\nFlags=MULTILINE|VSCROLL|WANTRETURN"
  },
  {
    "path": "setup/nsis/tools/Examples/ExecDos/second.bat",
    "content": "@echo off\nPATH\ncls"
  },
  {
    "path": "setup/nsis/tools/Examples/FileFunc.ini",
    "content": "[Settings]\nNumFields=11\nNextButtonText=&Enter\n\n[Field 1]\nType=Droplist\nFlags=NOTIFY\nState=\"  1. Locate\"\nListItems=|  1. Locate|  2. GetSize                 (file)|                                   (directory)|                                   (no size, no subdir)|  3. DriveSpace|  4. GetDrives             (by type)|                                   (all by letter)|  5. GetTime                (local time)|                                   (file time)|  6. GetFileAttributes|  7. GetFileVersion|  8. GetExeName|  9. GetExePath|10. GetParameters|11. GetOptions|12. GetRoot|13. GetParent|14. GetFileName|15. GetBaseName|16. GetFileExt|17. BannerTrimPath|18. DirState|19. RefreshShellIcons\nLeft=44\nRight=190\nTop=1\nBottom=210\n\n[Field 2]\nType=FileRequest\nLeft=44\nRight=-10\nTop=22\nBottom=33\n\n[Field 3]\nType=DirRequest\nLeft=44\nRight=-10\nTop=22\nBottom=33\n\n[Field 4]\nType=Text\nLeft=44\nRight=-10\nTop=36\nBottom=49\n\n[Field 5]\nType=Text\nState=LocateCallback\nLeft=44\nRight=232\nTop=53\nBottom=66\n\n[Field 6]\nType=Button\nText=view\nFlags=NOTIFY\nLeft=236\nRight=255\nTop=54\nBottom=65\n\n[Field 7]\nType=Text\nFlags=MULTILINE|VSCROLL|HSCROLL|READONLY\nLeft=44\nRight=-10\nTop=73\nBottom=128\n\n[Field 8]\nType=Label\nText=Path\nLeft=10\nRight=43\nTop=24\nBottom=36\n\n[Field 9]\nType=Label\nText=Options\nLeft=10\nRight=43\nTop=40\nBottom=52\n\n[Field 10]\nType=Label\nText=Function\nLeft=10\nRight=44\nTop=56\nBottom=67\n\n[Field 11]\nType=Label\nText=Result:\nLeft=12\nRight=42\nTop=94\nBottom=102\n"
  },
  {
    "path": "setup/nsis/tools/Examples/FileFunc.nsi",
    "content": ";_____________________________________________________________________________\n;\n;                          File Functions\n;_____________________________________________________________________________\n;\n; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\nName \"File Functions\"\nOutFile \"FileFunc.exe\"\nCaption \"$(^Name)\"\nXPStyle on\nRequestExecutionLevel user\n\n!include \"WinMessages.nsh\"\n!include \"FileFunc.nsh\"\n\nVar INI\nVar HWND\nVar STATE\nVar FUNCTION\nVar LOCATE1\nVar LOCATE2\nVar GETSIZE1\nVar GETSIZE2\nVar GETSIZE3\nVar GETSIZE4\nVar GETSIZE5\nVar GETSIZE6\nVar DRIVESPACE1\nVar DRIVESPACE2\nVar GETDRIVES1\nVar GETTIME1\nVar GETTIME2\nVar GETFILEATTRIBUTES1\nVar GETFILEATTRIBUTES2\nVar GETFILEVERSION1\nVar GETOPTIONS1\nVar GETOPTIONS2\nVar GETROOT1\nVar GETPARENT1\nVar GETFILENAME1\nVar GETBASENAME1\nVar GETFILEEXT1\nVar BANNERTRIMPATH1\nVar BANNERTRIMPATH2\nVar DIRSTATE1\n\nPage Custom ShowCustom LeaveCustom\n\nFunction ShowCustom\n\tInstallOptions::initDialog \"$INI\"\n\tPop $hwnd\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1206\n\tEnableWindow $1 0\n\tSendMessage $1 ${WM_ENABLE} 1 0\n\tStrCpy $LOCATE1 $DOCUMENTS\n\tStrCpy $LOCATE2 '/L=FD /M=*.* /S=0B /G=1 /B=0'\n\tStrCpy $GETSIZE1 '$WINDIR'\n\tStrCpy $GETSIZE2 '/M=Explorer.exe /S=0K /G=0'\n\tStrCpy $GETSIZE3 '$PROGRAMFILES\\Common Files'\n\tStrCpy $GETSIZE4 '/S=0M'\n\tStrCpy $GETSIZE5 '$WINDIR'\n\tStrCpy $GETSIZE6 '/G=0'\n\tStrCpy $DRIVESPACE1 'C:\\'\n\tStrCpy $DRIVESPACE2 '/D=F /S=M'\n\tStrCpy $GETDRIVES1 'FDD+CDROM'\n\tStrCpy $GETTIME1 '$WINDIR\\Explorer.exe'\n\tStrCpy $GETTIME2 'C'\n\tStrCpy $GETFILEATTRIBUTES1 'C:\\IO.SYS'\n\tStrCpy $GETFILEATTRIBUTES2 'ALL'\n\tStrCpy $GETFILEVERSION1 '$WINDIR\\Explorer.exe'\n\tStrCpy $GETOPTIONS1 '/SILENT=yes /INSTDIR=\"$PROGRAMFILES\\Common Files\"'\n\tStrCpy $GETOPTIONS2 '/INSTDIR='\n\tStrCpy $GETROOT1 'C:\\path\\file.dll'\n\tStrCpy $GETPARENT1 'C:\\path\\file.dll'\n\tStrCpy $GETFILENAME1 'C:\\path\\file.dll'\n\tStrCpy $GETBASENAME1 'C:\\path\\file.dll'\n\tStrCpy $GETFILEEXT1 'C:\\path\\file.dll'\n\tStrCpy $BANNERTRIMPATH1 'C:\\Server\\Documents\\Terminal\\license.htm'\n\tStrCpy $BANNERTRIMPATH2 '34A'\n\tStrCpy $DIRSTATE1 '$TEMP'\n\n\tGetDlgItem $1 $HWND 1203\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$LOCATE1\"\n\tGetDlgItem $1 $HWND 1205\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$LOCATE2\"\n\tInstallOptions::show\n\tPop $0\nFunctionEnd\n\nFunction LeaveCustom\n\tReadINIStr $STATE $INI \"Field 1\" \"State\"\n\tReadINIStr $R1 $INI \"Field 2\" \"State\"\n\tReadINIStr $R2 $INI \"Field 3\" \"State\"\n\tReadINIStr $R3 $INI \"Field 4\" \"State\"\n\tReadINIStr $R4 $INI \"Field 5\" \"State\"\n\tReadINIStr $0 $INI \"Settings\" \"State\"\n\tStrCmp $0 6 view\n\tStrCmp $0 0 Enter\n\tgoto main\n\n\tview:\n\tStrCpy $0 '$$'\n\tStrCpy $1 'n'\n\tStrCpy $2 'r'\n\tStrCmp $R4 \"LocateCallback\" 0 +3\n\tStrCpy $R0 `Function LocateCallback$\\r$\\n\tMessageBox MB_OKCANCEL '$0$$R9    \"path\\name\"=[$$R9]$0\\$1$0$$R8    \"path\"          =[$$R8]$0\\$1$0$$R7    \"name\"        =[$$R7]$0\\$1$0$$R6    \"size\"           =[$$R6]' IDOK +2$\\r$\\n\tStrCpy $$R0 StopLocate$\\r$\\n$\\r$\\n\tPush $$R0$\\r$\\nFunctionEnd`\n\tgoto send\n\tStrCmp $R4 \"GetDrivesCallback\" 0 error\n\tStrCpy $R0 `Function GetDrivesCallback$\\r$\\n\tMessageBox MB_OKCANCEL '$0$$9    \"drive letter\"=[$$9]$0\\$1$0$$8    \"drive type\" =[$$8]' IDOK +2$\\r$\\n\tStrCpy $$R0 StopGetDrives$\\r$\\n\tStrCpy $$R5 '$$R5$$9  [$$8 Drive]$$\\$2$$\\$1'$\\r$\\n$\\r$\\n\tPush $$R0$\\r$\\nFunctionEnd`\n\tgoto send\n\n\tmain:\n\tStrCmp $FUNCTION '' DefaultSend\n\tStrCmp $FUNCTION Locate 0 +4\n\tStrCpy $LOCATE1 $R2\n\tStrCpy $LOCATE2 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetSize1 0 +4\n\tStrCpy $GETSIZE1 $R2\n\tStrCpy $GETSIZE2 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetSize2 0 +4\n\tStrCpy $GETSIZE3 $R2\n\tStrCpy $GETSIZE4 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetSize3 0 +4\n\tStrCpy $GETSIZE5 $R2\n\tStrCpy $GETSIZE6 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION DriveSpace 0 +4\n\tStrCpy $DRIVESPACE1 $R1\n\tStrCpy $DRIVESPACE2 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetDrives 0 +3\n\tStrCpy $GETDRIVES1 $R1\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetTime 0 +4\n\tStrCpy $GETTIME1 $R1\n\tStrCpy $GETTIME2 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetFileAttributes 0 +4\n\tStrCpy $GETFILEATTRIBUTES1 $R1\n\tStrCpy $GETFILEATTRIBUTES2 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetFileVersion 0 +3\n\tStrCpy $GETFILEVERSION1 $R1\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetOptions 0 +4\n\tStrCpy $GETOPTIONS1 $R1\n\tStrCpy $GETOPTIONS2 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetRoot 0 +3\n\tStrCpy $GETROOT1 $R1\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetParent 0 +3\n\tStrCpy $GETPARENT1 $R1\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetFileName 0 +3\n\tStrCpy $GETFILENAME1 $R1\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetBaseName 0 +3\n\tStrCpy $GETBASENAME1 $R1\n\tgoto DefaultSend\n\tStrCmp $FUNCTION GetFileExt 0 +3\n\tStrCpy $GETFILEEXT1 $R1\n\tgoto DefaultSend\n\tStrCmp $FUNCTION BannerTrimPath 0 +4\n\tStrCpy $BANNERTRIMPATH1 $R1\n\tStrCpy $BANNERTRIMPATH2 $R3\n\tgoto DefaultSend\n\tStrCmp $FUNCTION DirState 0 +2\n\tStrCpy $DIRSTATE1 $R2\n\n\tDefaultSend:\n\tGetDlgItem $1 $HWND 1201\n\tEnableWindow $1 1\n\tShowWindow $1 0\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1202\n\tEnableWindow $1 1\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1203\n\tEnableWindow $1 1\n\tShowWindow $1 0\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1204\n\tEnableWindow $1 1\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1205\n\tEnableWindow $1 1\n\tGetDlgItem $1 $HWND 1206\n\tShowWindow $1 0\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1207\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\n\tReadINIStr $0 $INI \"Field 1\" \"State\"\n\tStrCmp $0 \"  1. Locate\" 0 GetSize1Send\n\tStrCpy $FUNCTION Locate\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$LOCATE1\"\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$LOCATE2\"\n\tGetDlgItem $1 $HWND 1206\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:LocateCallback\"\n\tGetDlgItem $1 $HWND 1207\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Path\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Options\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Function\"\n\tabort\n\n\tGetSize1Send:\n\tStrCmp $0 \"  2. GetSize                 (file)\" 0 GetSize2Send\n\tStrCpy $FUNCTION 'GetSize1'\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETSIZE1\"\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETSIZE2\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:File\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Options\"\n\tAbort\n\n\tGetSize2Send:\n\tStrCmp $0 \"                                   (directory)\" 0 GetSize3Send\n\tStrCpy $FUNCTION 'GetSize2'\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETSIZE3\"\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETSIZE4\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Directory\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Options\"\n\tAbort\n\n\tGetSize3Send:\n\tStrCmp $0 \"                                   (no size, no subdir)\" 0 DriveSpaceSend\n\tStrCpy $FUNCTION 'GetSize3'\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETSIZE5\"\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETSIZE6\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Directory\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Options\"\n\tAbort\n\n\tDriveSpaceSend:\n\tStrCmp $0 \"  3. DriveSpace\" 0 GetDrivesSend\n\tStrCpy $FUNCTION DriveSpace\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$DRIVESPACE1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$DRIVESPACE2\"\n\tGetDlgItem $1 $HWND 1206\n\tShowWindow $1 0\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1207\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Drive\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Options\"\n\tabort\n\n\tGetDrivesSend:\n\tStrCmp $0 \"  4. GetDrives             (by type)\" 0 GetDrives2Send\n\tStrCpy $FUNCTION GetDrives\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETDRIVES1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1206\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:GetDrivesCallback\"\n\tGetDlgItem $1 $HWND 1207\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Function\"\n\tabort\n\n\tGetDrives2Send:\n\tStrCmp $0 \"                                   (all by letter)\" 0 GetTime1Send\n\tStrCpy $FUNCTION ''\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tSendMessage $1 ${WM_ENABLE} 1 0\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:ALL\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1206\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:GetDrivesCallback\"\n\tGetDlgItem $1 $HWND 1207\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Function\"\n\tabort\n\n\tGetTime1Send:\n\tStrCmp $0 \"  5. GetTime                (local time)\" 0 GetTime2Send\n\tStrCpy $FUNCTION ''\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tSendMessage $1 ${WM_ENABLE} 1 0\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tEnableWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:L\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tAbort\n\n\tGetTime2Send:\n\tStrCmp $0 \"                                   (file time)\" 0 GetFileAttributesSend\n\tStrCpy $FUNCTION GetTime\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETTIME1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETTIME2\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:File\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tAbort\n\n\tGetFileAttributesSend:\n\tStrCmp $0 \"  6. GetFileAttributes\" 0 GetFileVersionSend\n\tStrCpy $FUNCTION GetFileAttributes\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETFILEATTRIBUTES1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETFILEATTRIBUTES2\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Path\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Attrib\"\n\tAbort\n\n\tGetFileVersionSend:\n\tStrCmp $0 \"  7. GetFileVersion\" 0 GetCmdSend\n\tStrCpy $FUNCTION GetFileVersion\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETFILEVERSION1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:File\"\n\tAbort\n\n\tGetCmdSend:\n\tStrCmp $0 \"  8. GetExeName\" +3\n\tStrCmp $0 \"  9. GetExePath\" +2\n\tStrCmp $0 \"10. GetParameters\" 0 GetOptionsSend\n\tStrCpy $FUNCTION ''\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tAbort\n\n\tGetOptionsSend:\n\tStrCmp $0 \"11. GetOptions\" 0 GetRootSend\n\tStrCpy $FUNCTION GetOptions\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETOPTIONS1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETOPTIONS2\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Parameters\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tAbort\n\n\tGetRootSend:\n\tStrCmp $0 \"12. GetRoot\" 0 GetParentSend\n\tStrCpy $FUNCTION GetRoot\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETROOT1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:FullPath\"\n\tAbort\n\n\tGetParentSend:\n\tStrCmp $0 \"13. GetParent\" 0 GetFileNameSend\n\tStrCpy $FUNCTION GetParent\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETPARENT1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:PathString\"\n\tAbort\n\n\tGetFileNameSend:\n\tStrCmp $0 \"14. GetFileName\" 0 GetBaseNameSend\n\tStrCpy $FUNCTION GetFileName\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETFILENAME1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:PathString\"\n\tAbort\n\n\tGetBaseNameSend:\n\tStrCmp $0 \"15. GetBaseName\" 0 GetFileExtSend\n\tStrCpy $FUNCTION GetBaseName\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETBASENAME1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:FileString\"\n\tAbort\n\n\tGetFileExtSend:\n\tStrCmp $0 \"16. GetFileExt\" 0 BannerTrimPathSend\n\tStrCpy $FUNCTION GetFileExt\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$GETFILEEXT1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:FileString\"\n\tAbort\n\n\tBannerTrimPathSend:\n\tStrCmp $0 \"17. BannerTrimPath\" 0 DirStateSend\n\tStrCpy $FUNCTION BannerTrimPath\n\tGetDlgItem $1 $HWND 1201\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$BANNERTRIMPATH1\"\n\tGetDlgItem $1 $HWND 1202\n\tShowWindow $1 1\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$BANNERTRIMPATH2\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:PathString\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tAbort\n\n\tDirStateSend:\n\tStrCmp $0 \"18. DirState\" 0 RefreshShellIconsSend\n\tStrCpy $FUNCTION DirState\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$DIRSTATE1\"\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Directory\"\n\tAbort\n\n\tRefreshShellIconsSend:\n\tStrCmp $0 \"19. RefreshShellIcons\" 0 Abort\n\tStrCpy $FUNCTION ''\n\tGetDlgItem $1 $HWND 1205\n\tShowWindow $1 0\n\n\tAbort:\n\tAbort\n\n;=Enter=\n\tEnter:\n\tStrCpy $R0 ''\n\tStrCpy $R5 ''\n\n\tStrCmp $STATE \"  1. Locate\" Locate\n\tStrCmp $STATE \"  2. GetSize                 (file)\" GetSize\n\tStrCmp $STATE \"                                   (directory)\" GetSize\n\tStrCmp $STATE \"                                   (no size, no subdir)\" GetSize\n\tStrCmp $STATE \"  3. DriveSpace\" DriveSpace\n\tStrCmp $STATE \"  4. GetDrives             (by type)\" GetDrives\n\tStrCmp $STATE \"                                   (all by letter)\" GetDrives\n\tStrCmp $STATE \"  5. GetTime                (local time)\" GetTime\n\tStrCmp $STATE \"                                   (file time)\" GetTime\n\tStrCmp $STATE \"  6. GetFileAttributes\" GetFileAttributes\n\tStrCmp $STATE \"  7. GetFileVersion\" GetFileVersion\n\tStrCmp $STATE \"  8. GetExeName\" GetExeName\n\tStrCmp $STATE \"  9. GetExePath\" GetExePath\n\tStrCmp $STATE \"10. GetParameters\" GetParameters\n\tStrCmp $STATE \"11. GetOptions\" GetOptions\n\tStrCmp $STATE \"12. GetRoot\" GetRoot\n\tStrCmp $STATE \"13. GetParent\" GetParent\n\tStrCmp $STATE \"14. GetFileName\" GetFileName\n\tStrCmp $STATE \"15. GetBaseName\" GetBaseName\n\tStrCmp $STATE \"16. GetFileExt\" GetFileExt\n\tStrCmp $STATE \"17. BannerTrimPath\" BannerTrimPath\n\tStrCmp $STATE \"18. DirState\" DirState\n\tStrCmp $STATE \"19. RefreshShellIcons\" RefreshShellIcons\n\tAbort\n\n\tLocate:\n\t${Locate} \"$R2\" \"$R3\" \"LocateCallback\"\n\tIfErrors error\n\tStrCmp $R0 StopLocate 0 +3\n\tStrCpy $R0 'stopped'\n\tgoto send\n\tStrCpy $R0 'done'\n\tgoto send\n\n\tGetSize:\n\t${GetSize} \"$R2\" \"$R3\" $0 $1 $2\n\tIfErrors error\n\tStrCpy $R0 \"Size=$0$\\r$\\nFiles=$1$\\r$\\nFolders=$2\"\n\tgoto send\n\n\tDriveSpace:\n\t${DriveSpace} \"$R1\" \"$R3\" $0\n\tIfErrors error\n\tStrCpy $R0 \"$0\"\n\tgoto send\n\n\tGetDrives:\n\t${GetDrives} \"$R1\" \"GetDrivesCallback\"\n\tStrCmp $R0 StopGetDrives 0 +3\n\tStrCpy $R0 '$R5stopped'\n\tgoto send\n\tStrCpy $R0 '$R5done'\n\tgoto send\n\n\tGetTime:\n\t${GetTime} \"$R1\" \"$R3\" $0 $1 $2 $3 $4 $5 $6\n\tIfErrors error\n\tStrCpy $R0 'Date=$0/$1/$2 ($3)$\\r$\\nTime=$4:$5:$6'\n\tgoto send\n\n\tGetFileAttributes:\n\t${GetFileAttributes} \"$R1\" \"$R3\" $0\n\tIfErrors error\n\tStrCpy $R0 '$0'\n\tgoto send\n\n\tGetFileVersion:\n\t${GetFileVersion} \"$R1\" $0\n\tIfErrors error\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tGetExeName:\n\t${GetExeName} $0\n\tStrCpy $R0 '$0'\n\tgoto send\n\n\tGetExePath:\n\t${GetExePath} $0\n\tStrCpy $R0 '$0'\n\tgoto send\n\n\tGetParameters:\n\t${GetParameters} $0\n\tStrCpy $R0 '$0'\n\tStrCmp $R0 '' 0 send\n\tStrCpy $R0 'no parameters'\n\tgoto send\n\n\tGetOptions:\n\t${GetOptions} \"$R1\" \"$R3\" $0\n\tIfErrors error\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tGetRoot:\n\t${GetRoot} \"$R1\" $0\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tGetParent:\n\t${GetParent} \"$R1\" $0\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tGetFileName:\n\t${GetFileName} \"$R1\" $0\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tGetBaseName:\n\t${GetBaseName} \"$R1\" $0\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tGetFileExt:\n\t${GetFileExt} \"$R1\" $0\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tBannerTrimPath:\n\t${BannerTrimPath} \"$R1\" \"$R3\" $0\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tDirState:\n\t${DirState} \"$R2\" $0\n\tStrCpy $R0  '$0'\n\tgoto send\n\n\tRefreshShellIcons:\n\t${RefreshShellIcons}\n\tStrCpy $R0 'done'\n\tgoto send\n\n\terror:\n\tStrCpy $R0 'error'\n\n\tsend:\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$R0\"\n\n\tabort\nFunctionEnd\n\nFunction LocateCallback\n\tMessageBox MB_OKCANCEL '$$R9    \"path\\name\"=[$R9]$\\n$$R8    \"path\"          =[$R8]$\\n$$R7    \"name\"        =[$R7]$\\n$$R6    \"size\"           =[$R6]' IDOK +2\n\tStrCpy $R0 StopLocate\n\n\tPush $R0\nFunctionEnd\n\nFunction GetDrivesCallback\n\tMessageBox MB_OKCANCEL '$$9    \"drive letter\"=[$9]$\\n$$8    \"drive type\" =[$8]' IDOK +2\n\tStrCpy $R0 StopGetDrives\n\tStrCpy $R5 '$R5$9  [$8 Drive]$\\r$\\n'\n\n\tPush $R0\nFunctionEnd\n\nFunction .onInit\n\tInitPluginsDir\n\tGetTempFileName $INI $PLUGINSDIR\n\tFile /oname=$INI \"FileFunc.ini\"\nFunctionEnd\n\nPage instfiles\n\nSection \"Empty\"\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/FileFuncTest.nsi",
    "content": ";_____________________________________________________________________________\n;\n;                          File Functions Test\n;_____________________________________________________________________________\n;\n; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\nName \"File Functions Test\"\nOutFile \"FileFuncTest.exe\"\nCaption \"$(^Name)\"\nShowInstDetails show\nXPStyle on\nRequestExecutionLevel user\n\nVar FUNCTION\nVar OUT1\nVar OUT2\nVar OUT3\nVar OUT4\nVar OUT5\nVar OUT6\nVar OUT7\n\n!include \"FileFunc.nsh\"\n!include \"LogicLib.nsh\"\n\n;############### INSTALL ###############\n\n!define StackVerificationStart `!insertmacro StackVerificationStart`\n!macro StackVerificationStart _FUNCTION\n\tStrCpy $FUNCTION ${_FUNCTION}\n\tCall StackVerificationStart\n!macroend\n\n!define StackVerificationEnd `!insertmacro StackVerificationEnd`\n!macro StackVerificationEnd\n\tCall StackVerificationEnd\n!macroend\n\nFunction StackVerificationStart\n\tStrCpy $0 !0\n\tStrCpy $1 !1\n\tStrCpy $2 !2\n\tStrCpy $3 !3\n\tStrCpy $4 !4\n\tStrCpy $5 !5\n\tStrCpy $6 !6\n\tStrCpy $7 !7\n\tStrCpy $8 !8\n\tStrCpy $9 !9\n\tStrCpy $R0 !R0\n\tStrCpy $R1 !R1\n\tStrCpy $R2 !R2\n\tStrCpy $R3 !R3\n\tStrCpy $R4 !R4\n\tStrCpy $R5 !R5\n\tStrCpy $R6 !R6\n\tStrCpy $R7 !R7\n\tStrCpy $R8 !R8\n\tStrCpy $R9 !R9\nFunctionEnd\n\nFunction StackVerificationEnd\n\tIfErrors +3\n\tDetailPrint 'PASSED $FUNCTION no errors'\n\tgoto +2\n\tDetailPrint 'FAILED   $FUNCTION error'\n\n\tStrCmp $0 '!0' 0 error\n\tStrCmp $1 '!1' 0 error\n\tStrCmp $2 '!2' 0 error\n\tStrCmp $3 '!3' 0 error\n\tStrCmp $4 '!4' 0 error\n\tStrCmp $5 '!5' 0 error\n\tStrCmp $6 '!6' 0 error\n\tStrCmp $7 '!7' 0 error\n\tStrCmp $8 '!8' 0 error\n\tStrCmp $9 '!9' 0 error\n\tStrCmp $R0 '!R0' 0 error\n\tStrCmp $R1 '!R1' 0 error\n\tStrCmp $R2 '!R2' 0 error\n\tStrCmp $R3 '!R3' 0 error\n\tStrCmp $R4 '!R4' 0 error\n\tStrCmp $R5 '!R5' 0 error\n\tStrCmp $R6 '!R6' 0 error\n\tStrCmp $R7 '!R7' 0 error\n\tStrCmp $R8 '!R8' 0 error\n\tStrCmp $R9 '!R9' 0 error\n\tDetailPrint 'PASSED $FUNCTION stack'\n\tgoto end\n\n\terror:\n\tDetailPrint 'FAILED   $FUNCTION stack'\n;\tMessageBox MB_OKCANCEL '$$0={$0}$\\n$$1={$1}$\\n$$2={$2}$\\n$$3={$3}$\\n$$4={$4}$\\n$$5={$5}$\\n$$6={$6}$\\n$$7={$7}$\\n$$8={$8}$\\n$$9={$9}$\\n$$R0={$R0}$\\n$$R1={$R1}$\\n$$R2={$R2}$\\n$$R3={$R3}$\\n$$R4={$R4}$\\n$$R5={$R5}$\\n$$R6={$R6}$\\n$$R7={$R7}$\\n$$R8={$R8}$\\n$$R9={$R9}' IDOK +2\n;\tquit\n\n\tend:\nFunctionEnd\n\n\n\nSection Locate\n\t${StackVerificationStart} Locate\n\n\t${Locate} '$DOCUMENTS' '/L=FD /M=*.* /S=0B /G=0' 'LocateCallback'\n\n\t${StackVerificationEnd}\nSectionEnd\n\nFunction LocateCallback\n;\tMessageBox MB_YESNO '$$0={$0}$\\n$$1={$1}$\\n$$2={$2}$\\n$$3={$3}$\\n$$4={$4}$\\n$$5={$5}$\\n$$6={$6}$\\n$$7={$7}$\\n$$8={$8}$\\n$$9={$9}$\\n$$R0={$R0}$\\n$$R1={$R1}$\\n$$R2={$R2}$\\n$$R3={$R3}$\\n$$R4={$R4}$\\n$$R5={$R5}$\\n$$R6={$R6}$\\n$$R7={$R7}$\\n$$R8={$R8}$\\n$$R9={$R9}$\\n$\\nContinue?' IDYES +2\n;\tStrCpy $0 StopLocate\n\n\tPush $0\nFunctionEnd\n\n\nSection GetSize\n\t${StackVerificationStart} GetSize\n\n\t${GetSize} '$WINDIR' '/M=Explorer.exe /S=0K /G=0' $OUT1 $OUT2 $OUT3\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection DriveSpace\n\t${StackVerificationStart} DriveSpace\n\n\t${DriveSpace} 'C:\\' '/D=F /S=M' $OUT1\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetDrives\n\t${StackVerificationStart} GetDrives\n\n\t${GetDrives} 'FDD+CDROM' 'GetDrivesCallback'\n\n\t${StackVerificationEnd}\nSectionEnd\n\nFunction GetDrivesCallback\n;\tMessageBox MB_YESNO '$$0={$0}$\\n$$1={$1}$\\n$$2={$2}$\\n$$3={$3}$\\n$$4={$4}$\\n$$5={$5}$\\n$$6={$6}$\\n$$7={$7}$\\n$$8={$8}$\\n$$9={$9}$\\n$$R0={$R0}$\\n$$R1={$R1}$\\n$$R2={$R2}$\\n$$R3={$R3}$\\n$$R4={$R4}$\\n$$R5={$R5}$\\n$$R6={$R6}$\\n$$R7={$R7}$\\n$$R8={$R8}$\\n$$R9={$R9}$\\n$\\nContinue?' IDYES +2\n;\tStrCpy $0 StopGetDrives\n\n\tPush $0\nFunctionEnd\n\n\nSection GetTime\n\t${StackVerificationStart} GetTime\n\n\t${GetTime} '' 'L' $OUT1 $OUT2 $OUT3 $OUT4 $OUT5 $OUT6 $OUT7\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetFileAttributes\n\t${StackVerificationStart} GetFileAttributes\n\n\t${GetFileAttributes} '$WINDIR\\explorer.exe' 'ALL' $OUT1\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetFileVersion\n\t${StackVerificationStart} GetFileVersion\n\n\t${GetFileVersion} '$WINDIR\\explorer.exe' $OUT1\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetExeName\n\t${StackVerificationStart} GetExeName\n\n\t${GetExeName} $OUT1\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetExePath\n\t${StackVerificationStart} GetExePath\n\n\t${GetExePath} $OUT1\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetParameters\n\t${StackVerificationStart} GetParameters\n\n\t# basic stuff\n\n\tStrCpy $CMDLINE '\"$PROGRAMFILES\\Something\\Hello.exe\"'\n\t${GetParameters} $OUT1\n\tStrCpy $CMDLINE '\"$PROGRAMFILES\\Something\\Hello.exe\" test'\n\t${GetParameters} $OUT2\n\tStrCpy $CMDLINE '\"$PROGRAMFILES\\Something\\Hello.exe\" \"test\"'\n\t${GetParameters} $OUT3\n\tStrCpy $CMDLINE 'C:\\Hello.exe'\n\t${GetParameters} $OUT4\n\tStrCpy $CMDLINE 'C:\\Hello.exe test'\n\t${GetParameters} $OUT5\n\tStrCpy $CMDLINE 'C:\\Hello.exe \"test\"'\n\t${GetParameters} $OUT6\n\tStrCpy $CMDLINE 'C:\\Hello.exe       test test  '\n\t${GetParameters} $OUT7\n\n\t${If} $OUT1 != \"\"\n\t${OrIf} $OUT2 != \"test\"\n\t${OrIf} $OUT3 != '\"test\"'\n\t${OrIf} $OUT4 != \"\"\n\t${OrIf} $OUT5 != \"test\"\n\t${OrIf} $OUT6 != '\"test\"'\n\t${OrIf} $OUT7 != 'test test'\n\t\tSetErrors\n\t${EndIf}\n\n\t# some corner cases\n\n\tStrCpy $CMDLINE ''\n\t${GetParameters} $OUT1\n\tStrCpy $CMDLINE '\"'\n\t${GetParameters} $OUT2\n\tStrCpy $CMDLINE '\"\"'\n\t${GetParameters} $OUT3\n\tStrCpy $CMDLINE '\"\" test'\n\t${GetParameters} $OUT4\n\tStrCpy $CMDLINE ' test'\n\t${GetParameters} $OUT5\n\tStrCpy $CMDLINE '  test' # left over bug(?) from old GetParameters\n\t                         # it starts looking for ' ' from the third char\n\t${GetParameters} $OUT6\n\tStrCpy $CMDLINE ' '\n\t${GetParameters} $OUT7\n\n\t${If} $OUT1 != \"\"\n\t${OrIf} $OUT2 != \"\"\n\t${OrIf} $OUT3 != \"\"\n\t${OrIf} $OUT4 != \"\"\n\t${OrIf} $OUT5 != \"\"\n\t${OrIf} $OUT6 != \"\"\n\t${OrIf} $OUT7 != \"\"\n\t\tSetErrors\n\t${EndIf}\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetOptions\n\t${StackVerificationStart} GetOptions\n\n\t${GetOptions} '/INSTDIR=C:\\Program Files\\Common Files /SILENT=yes' '/INSTDIR=' $OUT1\n\tStrCmp $OUT1 'C:\\Program Files\\Common Files' 0 error\n\n\t${GetOptions} '-TMP=temp.tmp -INSTDIR=\"C:/Program Files/Common Files\" -SILENT=yes' '-INSTDIR=' $OUT1\n\tStrCmp $OUT1 'C:/Program Files/Common Files' 0 error\n\n\t${GetOptions} \"/INSTDIR='C:/Program Files/Common Files' /SILENT=yes\" '/INSTDIR=' $OUT1\n\tStrCmp $OUT1 'C:/Program Files/Common Files' 0 error\n\n\tStrCpy $OUT1 '/INSTDIR=`C:/Program Files/Common Files` /SILENT=yes'\n\t${GetOptions} '$OUT1' '/INSTDIR=' $OUT1\n\tStrCmp $OUT1 'C:/Program Files/Common Files' 0 error\n\n\t${GetOptions} '/SILENT=yes /INSTDIR=C:\\Program Files\\Common Files' '/INSTDIR=' $OUT1\n\tStrCmp $OUT1 'C:\\Program Files\\Common Files' 0 error\n\n\t${GetOptions} \"/INSTDIR=common directory: 'C:\\Program Files\\Common Files' /SILENT=yes\" '/INSTDIR=' $OUT1\n\tStrCmp $OUT1 \"common directory: 'C:\\Program Files\\Common Files'\" 0 error\n\n\t${GetOptions} '/INSTDIR=WxxxW /SILENT=yes' '/INSTDIR=' $OUT1\n\tStrCmp $OUT1 'WxxxW' 0 error\n\n\t${GetOptions} \"/Prm='/D=True' /D=1\" '/D=' $OUT1\n\tStrCmp $OUT1 \"1\" 0 error\n\n\t${GetOptions} \"/D=1 /Prm='/D=True'\" '/Prm=' $OUT1\n\tStrCmp $OUT1 \"/D=True\" 0 error\n\n\t${GetOptions} `/D=1 /Prm='/D=\"True\" /S=\"/Temp\"'` '/Prm=' $OUT1\n\tStrCmp $OUT1 '/D=\"True\" /S=\"/Temp\"' 0 error\n\n\t${GetOptions} `/INSTDIR='\"C:/Program Files/Common Files\"' /SILENT=yes` '/INSTDIR=' $OUT1\n\tStrCmp $OUT1 '\"C:/Program Files/Common Files\"' 0 error\n\n\t${GetOptions} `/INSTDIR='\"C:/Program Files/Common Files\"' /SILENT=yes` '/INSTDIR*=' $OUT1\n\tIfErrors 0 error\n\tStrCmp $OUT1 '' 0 error\n\n\t${GetOptions} `/INSTDIR=\"C:/Program Files/Common Files\" /SILENT=yes` '' $OUT1\n\tIfErrors 0 error\n\tStrCmp $OUT1 '' 0 error\n\n\t${GetOptionsS} '/INSTDIR=C:\\Program Files\\Common Files /SILENT' '/SILENT' $OUT1\n\tIfErrors error\n\tStrCmp $OUT1 '' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetOptionsS\n\t${StackVerificationStart} GetOptionsS\n\n\t${GetOptionsS} '/INSTDIR=C:\\Program Files\\Common Files /SILENT=yes' '/INSTDIR=' $OUT1\n\tIfErrors error\n\tStrCmp $OUT1 'C:\\Program Files\\Common Files' 0 error\n\n\t${GetOptionsS} '/INSTDIR=C:\\Program Files\\Common Files /SILENT=yes' '/Instdir=' $OUT1\n\tIfErrors 0 error\n\tStrCmp $OUT1 '' 0 error\n\n\t${GetOptionsS} '/INSTDIR=C:\\Program Files\\Common Files /SILENT' '/SILENT' $OUT1\n\tIfErrors error\n\tStrCmp $OUT1 '' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetRoot\n\t${StackVerificationStart} GetRoot\n\n\t${GetRoot} 'C:\\Program Files\\NSIS' $OUT1\n\tStrCmp $OUT1 'C:' 0 error\n\n\t${GetRoot} '\\\\SuperPimp\\NSIS\\Source\\exehead\\Ui.c' $OUT1\n\tStrCmp $OUT1 '\\\\SuperPimp\\NSIS' 0 error\n\n\t${GetRoot} '\\\\Program Files\\NSIS' $OUT1\n\tStrCmp $OUT1 '\\\\Program Files\\NSIS' 0 error\n\n\t${GetRoot} '\\\\Program Files\\NSIS\\' $OUT1\n\tStrCmp $OUT1 '\\\\Program Files\\NSIS' 0 error\n\n\t${GetRoot} '\\\\Program Files\\NSIS\\Source\\exehead\\Ui.c' $OUT1\n\tStrCmp $OUT1 '\\\\Program Files\\NSIS' 0 error\n\n\t${GetRoot} '\\Program Files\\NSIS' $OUT1\n\tStrCmp $OUT1 '' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetParent\n\t${StackVerificationStart} GetParent\n\n\t${GetParent} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\tStrCmp $OUT1 'C:\\Program Files\\Winamp' 0 error\n\n\t${GetParent} 'C:\\Program Files\\Winamp\\plugins' $OUT1\n\tStrCmp $OUT1 'C:\\Program Files\\Winamp' 0 error\n\n\t${GetParent} 'C:\\Program Files\\Winamp\\plugins\\' $OUT1\n\tStrCmp $OUT1 'C:\\Program Files\\Winamp' 0 error\n\n\t${GetParent} 'C:\\' $OUT1\n\tStrCmp $OUT1 '' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetFileName\n\t${StackVerificationStart} GetFileName\n\n\t${GetFileName} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\tStrCmp $OUT1 'uninstwa.exe' 0 error\n\n\t${GetFileName} 'uninstwa.exe' $OUT1\n\tStrCmp $OUT1 'uninstwa.exe' 0 error\n\n\t${GetFileName} 'C:\\Program Files\\Winamp\\plugins' $OUT1\n\tStrCmp $OUT1 'plugins' 0 error\n\n\t${GetFileName} 'C:\\Program Files\\Winamp\\plugins\\' $OUT1\n\tStrCmp $OUT1 'plugins' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetBaseName\n\t${StackVerificationStart} GetBaseName\n\n\t${GetBaseName} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\tStrCmp $OUT1 'uninstwa' 0 error\n\n\t${GetBaseName} 'uninstwa.exe' $OUT1\n\tStrCmp $OUT1 'uninstwa' 0 error\n\n\t${GetBaseName} 'C:\\Program Files\\Winamp\\plugins' $OUT1\n\tStrCmp $OUT1 'plugins' 0 error\n\n\t${GetBaseName} 'C:\\Program Files\\Winamp\\plugins\\' $OUT1\n\tStrCmp $OUT1 '' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection GetFileExt\n\t${StackVerificationStart} GetFileExt\n\n\t${GetFileExt} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\tStrCmp $OUT1 'exe' 0 error\n\n\t${GetFileExt} 'uninstwa.exe' $OUT1\n\tStrCmp $OUT1 'exe' 0 error\n\n\t${GetFileExt} 'C:\\Program Files\\Winamp\\plugins' $OUT1\n\tStrCmp $OUT1 '' 0 error\n\n\t${GetFileExt} 'C:\\Program Files\\Winamp\\plugins\\' $OUT1\n\tStrCmp $OUT1 '' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection BannerTrimPath\n\t${StackVerificationStart} BannerTrimPath\n\n\t${BannerTrimPath} 'C:\\Server\\Documents\\Terminal\\license.htm' '35A' $OUT1\n\tStrCmp $OUT1 'C:\\Server\\...\\Terminal\\license.htm' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '3A' $OUT1\n\tStrCmp $OUT1 '' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '4A' $OUT1\n\tStrCmp $OUT1 'C...' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '11A' $OUT1\n\tStrCmp $OUT1 'C:\\12\\...' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '13A' $OUT1\n\tStrCmp $OUT1 'C:\\12\\...\\789' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '14A' $OUT1\n\tStrCmp $OUT1 'C:\\12\\3456\\789' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '14A' $OUT1\n\tStrCmp $OUT1 'C:\\12\\3456\\789' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '11B' $OUT1\n\tStrCmp $OUT1 'C:\\12\\...' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '5B' $OUT1\n\tStrCmp $OUT1 'C:...' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '5B' $OUT1\n\tStrCmp $OUT1 'C:...' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '11C' $OUT1\n\tStrCmp $OUT1 'C:\\12\\34...' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '9D' $OUT1\n\tStrCmp $OUT1 'C:\\12\\...' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '10D' $OUT1\n\tStrCmp $OUT1 'C:\\...\\789' 0 error\n\n\t${BannerTrimPath} 'C:\\12\\3456\\789' '11D' $OUT1\n\tStrCmp $OUT1 'C:\\1...\\789' 0 error\n\n\t${BannerTrimPath} '123456789' '5D' $OUT1\n\tStrCmp $OUT1 '12...' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection DirState\n\t${StackVerificationStart} DirState\n\n\t${DirState} '$TEMP' $OUT1\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection RefreshShellIcons\n\t${StackVerificationStart} RefreshShellIcons\n\n\t${RefreshShellIcons}\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WriteUninstaller\n\tgoto +2\n\tWriteUninstaller '$EXEDIR\\un.FileFuncTest.exe'\nSectionEnd\n\n\n\n;############### UNINSTALL ###############\n\nSection un.Uninstall\n\t${Locate} '$DOCUMENTS' '/L=FD /M=*.* /S=0B /G=0' 'un.LocateCallback'\n\t${GetSize} '$WINDIR' '/M=Explorer.exe /S=0K /G=0' $OUT1 $OUT2 $OUT3\n\t${DriveSpace} 'C:\\' '/D=F /S=M' $OUT1\n\t${GetDrives} 'FDD+CDROM' 'un.GetDrivesCallback'\n\t${GetTime} '' 'L' $OUT1 $OUT2 $OUT3 $OUT4 $OUT5 $OUT6 $OUT7\n\t${GetFileAttributes} '$WINDIR\\explorer.exe' 'ALL' $OUT1\n\t${GetFileVersion} '$WINDIR\\explorer.exe' $OUT1\n\t${GetExeName} $OUT1\n\t${GetExePath} $OUT1\n\t${GetParameters} $OUT1\n\t${GetOptions} '/INSTDIR=C:\\Program Files\\Common Files /SILENT=yes' '/INSTDIR=' $OUT1\n\t${GetOptionsS} '/INSTDIR=C:\\Program Files\\Common Files /SILENT=yes' '/INSTDIR=' $OUT1\n\t${GetRoot} 'C:\\Program Files\\NSIS' $OUT1\n\t${GetParent} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\t${GetFileName} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\t${GetBaseName} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\t${GetFileExt} 'C:\\Program Files\\Winamp\\uninstwa.exe' $OUT1\n\t${BannerTrimPath} 'C:\\Server\\Documents\\Terminal\\license.htm' '35A' $OUT1\n\t${DirState} '$TEMP' $OUT1\n\t${RefreshShellIcons}\nSectionEnd\n\nFunction un.LocateCallback\n\tPush $0\nFunctionEnd\n\nFunction un.GetDrivesCallback\n\tPush $0\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/test.ini",
    "content": "[Settings]\nNumFields=8\n\n[Field 1]\nType=GroupBox\nLeft=0\nRight=-1\nTop=0\nBottom=-5\nText=\" This is a group box... \"\n\n[Field 2]\nType=checkbox\nText=Install support for X\nLeft=10\nRight=-10\nTop=17\nBottom=25\nState=0\nFlags=GROUP\n\n[Field 3]\nType=checkbox\nText=Install support for Y\nLeft=10\nRight=-10\nTop=30\nBottom=38\nState=1\nFlags=NOTABSTOP\n\n[Field 4]\nType=checkbox\nText=Install support for Z\nLeft=10\nRight=-10\nTop=43\nBottom=51\nState=0\nFlags=NOTABSTOP\n\n[Field 5]\nType=FileRequest\nState=C:\\dummy.xyz\nLeft=10\nRight=-10\nTop=56\nBottom=68\nFilter=XYZ Files|*.xyz|All files|*.*\nFlags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY\n\n[Field 6]\nType=DirRequest\nLeft=10\nRight=-10\nTop=73\nBottom=85\nText=Select a directory...\nState=C:\\Program Files\\NSIS\n\n[Field 7]\nType=Label\nLeft=10\nRight=-10\nTop=90\nBottom=98\nText=This is a label...\n\n[Field 8]\nType=Text\nLeft=10\nRight=-10\nTop=98\nBottom=120\nState=\"Multiline\\r\\nedit...\"\nFlags=MULTILINE|VSCROLL|WANTRETURN"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/test.nsi",
    "content": ";InstallOptions Test Script\n;Written by Joost Verburg\n;--------------------------\n\n!define TEMP1 $R0 ;Temp variable\n\n;The name of the installer\nName \"InstallOptions Test\"\n\n;The file to write\nOutFile \"Test.exe\"\n\n; Show install details\nShowInstDetails show\n\n;Things that need to be extracted on startup (keep these lines before any File command!)\n;Only useful for BZIP2 compression\n;Use ReserveFile for your own InstallOptions INI files too!\n\nReserveFile /plugin InstallOptions.dll\nReserveFile \"test.ini\"\n\n;Order of pages\nPage custom SetCustom ValidateCustom \": Testing InstallOptions\" ;Custom page. InstallOptions gets called in SetCustom.\nPage instfiles\n\nSection \"Components\"\n\n  ;Get Install Options dialog user input\n\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 2\" \"State\"\n  DetailPrint \"Install X=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 3\" \"State\"\n  DetailPrint \"Install Y=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 4\" \"State\"\n  DetailPrint \"Install Z=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"State\"\n  DetailPrint \"File=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 6\" \"State\"\n  DetailPrint \"Dir=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 8\" \"State\"\n  DetailPrint \"Info=${TEMP1}\"\n  \nSectionEnd\n\nFunction .onInit\n\n  ;Extract InstallOptions files\n  ;$PLUGINSDIR will automatically be removed when the installer closes\n  \n  InitPluginsDir\n  File /oname=$PLUGINSDIR\\test.ini \"test.ini\"\n  \nFunctionEnd\n\nFunction SetCustom\n\n  ;Display the InstallOptions dialog\n\n  Push ${TEMP1}\n\n    InstallOptions::dialog \"$PLUGINSDIR\\test.ini\"\n    Pop ${TEMP1}\n  \n  Pop ${TEMP1}\n\nFunctionEnd\n\nFunction ValidateCustom\n\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 2\" \"State\"\n  StrCmp ${TEMP1} 1 done\n  \n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 3\" \"State\"\n  StrCmp ${TEMP1} 1 done\n\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 4\" \"State\"\n  StrCmp ${TEMP1} 1 done\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"You must select at least one install option!\"\n    Abort\n\n  done:\n  \nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/testimgs.ini",
    "content": "[Settings]\nNumFields=8\n\n[Field 1]\nType=GroupBox\nLeft=0\nRight=-1\nTop=0\nBottom=-5\nText=\" Images \"\n\n[Field 2]\nType=Bitmap\nLeft=10\nRight=-10\nTop=10\nBottom=30\nFlags=TRANSPARENT\n\n[Field 3]\nType=Bitmap\nLeft=10\nRight=-10\nTop=35\nBottom=45\nFlags=TRANSPARENT\n\n[Field 4]\nType=Bitmap\nLeft=10\nRight=-10\nTop=50\nBottom=70\nFlags=RESIZETOFIT|TRANSPARENT\n\n[Field 5]\nType=Bitmap\nLeft=10\nRight=-10\nTop=75\nBottom=95\nFlags=RESIZETOFIT|TRANSPARENT\n\n[Field 6]\nType=Icon\nLeft=10\nRight=40\nTop=100\nBottom=120\n\n[Field 7]\nType=Icon\nLeft=50\nRight=80\nTop=100\nBottom=120\n\n[Field 8]\nType=Label\nLeft=10\nRight=-10\nTop=10\nBottom=-10\nText=ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/testimgs.nsi",
    "content": ";InstallOptions Test Script\n;Written by Joost Verburg\n;--------------------------\n\n;The name of the installer\nName \"InstallOptions Test\"\n\n;The file to write\nOutFile \"Test.exe\"\n\n; Show install details\nShowInstDetails show\n\n;Things that need to be extracted on startup (keep these lines before any File command!)\n;Only useful for BZIP2 compression\n;Use ReserveFile for your own InstallOptions INI files too!\n\nReserveFile /plugin InstallOptions.dll\nReserveFile \"testimgs.ini\"\nReserveFile \"${NSISDIR}\\Contrib\\Graphics\\Checks\\colorful.bmp\"\nReserveFile \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\"\nReserveFile \"${NSISDIR}\\Contrib\\Graphics\\Icons\\pixel-install.ico\"\n\n;Order of pages\nPage custom SetCustom \"\" \": Testing InstallOptions\" ;Custom page. InstallOptions gets called in SetCustom.\nPage instfiles\n\nSection  \nSectionEnd\n\nFunction .onInit\n\n  ;Extract InstallOptions files\n  ;$PLUGINSDIR will automatically be removed when the installer closes\n  \n  InitPluginsDir\n  File /oname=$PLUGINSDIR\\testimgs.ini \"testimgs.ini\"\n  File /oname=$PLUGINSDIR\\image.bmp \"${NSISDIR}\\Contrib\\Graphics\\Checks\\colorful.bmp\"\n  File /oname=$PLUGINSDIR\\image2.bmp \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\"\n  File /oname=$PLUGINSDIR\\icon.ico \"${NSISDIR}\\Contrib\\Graphics\\Icons\\pixel-install.ico\"\n\n  ;Write image paths to the INI file\n\n  WriteINIStr $PLUGINSDIR\\testimgs.ini \"Field 2\" \"Text\" $PLUGINSDIR\\image.bmp\n  WriteINIStr $PLUGINSDIR\\testimgs.ini \"Field 3\" \"Text\" $PLUGINSDIR\\image2.bmp\n  WriteINIStr $PLUGINSDIR\\testimgs.ini \"Field 4\" \"Text\" $PLUGINSDIR\\image.bmp\n  WriteINIStr $PLUGINSDIR\\testimgs.ini \"Field 5\" \"Text\" $PLUGINSDIR\\image2.bmp\n  WriteINIStr $PLUGINSDIR\\testimgs.ini \"Field 6\" \"Text\" $PLUGINSDIR\\icon.ico\n  ;No Text for Field 7 so it'll show the installer's icon\n  \nFunctionEnd\n\nFunction SetCustom\n\n  ;Display the InstallOptions dialog\n  InstallOptions::dialog \"$PLUGINSDIR\\testimgs.ini\"\n  Pop $0\n\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/testlink.ini",
    "content": "[Settings]\nNumFields=5\n\n[Field 1]\nType=Label\nLeft=10\nRight=-40\nTop=10\nBottom=18\nText=This custom page demonstrates the \"Link\" control\n\n[Field 2]\nType=Link\nLeft=20\nRight=-40\nTop=40\nBottom=50\nText=* Run notepad\n\n[Field 3]\nType=Link\nLeft=20\nRight=-40\nTop=55\nBottom=65\nState=mailto:someone@anywhere.com\nText=* Send E-mail\n\n[Field 4]\nType=Link\nLeft=20\nRight=-40\nTop=70\nBottom=80\nState=https://nsis.sourceforge.io/\nText=* Homepage https://nsis.sourceforge.io/\n\n[Field 5]\nType=Text\nLeft=20\nRight=-40\nTop=85\nBottom=98\nState=Just to test proper interaction with the other fields\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/testlink.nsi",
    "content": ";InstallOptions Test Script\n;Written by Ramon\n;This script demonstrates the power of the new control \"LINK\"\n;that allows you to execute files, send mails, open wepsites, etc.\n;--------------------------\n\n!define TEMP1 $R0 ;Temp variable\n\n;The name of the installer\nName \"InstallOptions Test Link\"\n\n;The file to write\nOutFile \"TestLink.exe\"\n\n; Show install details\nShowInstDetails show\n\n;Things that need to be extracted on startup (keep these lines before any File command!)\n;Only useful for BZIP2 compression\n;Use ReserveFile for your own InstallOptions INI files too!\n\nReserveFile /plugin InstallOptions.dll\nReserveFile \"testlink.ini\"\n\n;Order of pages\nPage custom SetCustom\nPage instfiles\n\nSection \"Components\"\n\n  ;Get Install Options dialog user input\n\nSectionEnd\n\nFunction .onInit\n\n  ;Extract InstallOptions files\n  ;$PLUGINSDIR will automatically be removed when the installer closes\n  \n  InitPluginsDir\n  File /oname=$PLUGINSDIR\\test.ini \"testlink.ini\"\n  WriteIniStr $PLUGINSDIR\\test.ini \"Field 2\" \"State\" \"$WINDIR\\Notepad.exe\"\n  \nFunctionEnd\n\nFunction SetCustom\n\n  ;Display the InstallOptions dialog\n\n  Push ${TEMP1}\n\n    InstallOptions::dialog \"$PLUGINSDIR\\test.ini\"\n    Pop ${TEMP1}\n  \n  Pop ${TEMP1}\n\nFunctionEnd\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/testnotify.ini",
    "content": "[Settings]\nNumFields=11\n\n[Field 1]\nType=Groupbox\nText=\"This is a group box...\"\nLeft=0\nRight=-1\nTop=0\nBottom=-4\n\n[Field 2]\nType=Checkbox\nText=Install support for X\nFlags=NOTIFY\nState=1\nLeft=10\nRight=100\nTop=17\nBottom=25\n\n[Field 3]\nType=Checkbox\nText=Install support for Y\nState=0\nLeft=10\nRight=100\nTop=30\nBottom=38\n\n[Field 4]\nType=Checkbox\nText=Install support for Z\nFlags=RIGHT\nState=0\nLeft=10\nRight=100\nTop=43\nBottom=51\n\n[Field 5]\nType=FileRequest\nFlags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY\nState=C:\\dummy.xyz\nFilter=XYZ Files|*.xyz|All files|*.*\nLeft=10\nRight=-10\nTop=56\nBottom=69\n\n[Field 6]\nType=DirRequest\nText=Select a directory...\nState=C:\\Program Files\\NSIS\nLeft=10\nRight=-10\nTop=74\nBottom=87\n\n[Field 7]\nType=Label\nText=This is a label...\nLeft=10\nRight=-10\nTop=89\nBottom=97\n\n[Field 8]\nType=Text\nFlags=MULTILINE|VSCROLL|WANTRETURN|NOWORDWRAP\nState=\"Multiline\\r\\nedit...\"\nLeft=10\nRight=-10\nTop=97\nBottom=118\nMinLen=1\nValidateText=Please enter some text before proceeding.\n\n[Field 9]\nType=Button\nFlags=NOTIFY\nText=&Clear\nLeft=-60\nRight=-10\nTop=19\nBottom=33\n\n[Field 10]\nType=Button\nText=&Email\nState=mailto:someone@anywhere.com\nLeft=-60\nRight=-10\nTop=35\nBottom=49\n\n[Field 11]\nType=DROPLIST\nListItems=Show|Hide\nState=Show\nFlags=NOTIFY\nLeft=120\nRight=-80\nTop=20\nBottom=56\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptions/testnotify.nsi",
    "content": "; InstallOptions script demonstrating custom buttons\n;----------------------------------------------------\n\n!include WinMessages.nsh\n\n; The name of the installer\nName \"InstallOptions Test\"\n\n; The file to write\nOutFile \"TestNotify.exe\"\n\n; Show install details\nShowInstDetails show\n\n; Called before anything else as installer initialises\nFunction .onInit\n\n  ; Extract InstallOptions files\n  ; $PLUGINSDIR will automatically be removed when the installer closes\n  InitPluginsDir\n  File /oname=$PLUGINSDIR\\test.ini \"testnotify.ini\"\n\nFunctionEnd\n\n; Our custom page\nPage custom ShowCustom LeaveCustom \": Testing InstallOptions\"\n\nFunction ShowCustom\n\n  ; Initialise the dialog but don't show it yet\n  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \"Test the right-to-left version?\" IDNO +2\n    WriteINIStr \"$PLUGINSDIR\\test.ini\" \"Settings\" \"RTL\" \"1\"\n  InstallOptions::initDialog \"$PLUGINSDIR\\test.ini\"\n  ; In this mode InstallOptions returns the window handle so we can use it\n  Pop $0\n  ; Now show the dialog and wait for it to finish\n  InstallOptions::show\n  ; Finally fetch the InstallOptions status value (we don't care what it is though)\n  Pop $0\n\nFunctionEnd\n\nFunction LeaveCustom\n\n  ; At this point the user has either pressed Next or one of our custom buttons\n  ; We find out which by reading from the INI file\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Settings\" \"State\"\n  StrCmp $0 0 validate  ; Next button?\n  StrCmp $0 2 supportx  ; \"Install support for X\"?\n  StrCmp $0 9 clearbtn  ; \"Clear\" button?\n  StrCmp $0 11 droplist ; \"Show|Hide\" drop-list?\n  Abort ; Return to the page\n\nsupportx:\n  ; Make the FileRequest field depend on the first checkbox\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 2\" \"State\"\n  ReadINIStr $1 \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"HWND\"\n  EnableWindow $1 $0\n  ReadINIStr $1 \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"HWND2\"\n  EnableWindow $1 $0\n  ; Add the disabled flag too so when we return to this page it's disabled again\n  StrCmp $0 0 0 +3\n\n    WriteINIStr \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"Flags\" \"GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY|DISABLED\"\n    Goto +2\n\n    WriteINIStr \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"Flags\" \"GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY\"\n  Abort ; Return to the page\n\nclearbtn:\n  ; Clear all text fields\n  ReadINIStr $1 \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"HWND\"\n  SendMessage $1 ${WM_SETTEXT} 0 \"STR:\"\n  ReadINIStr $1 \"$PLUGINSDIR\\test.ini\" \"Field 6\" \"HWND\"\n  SendMessage $1 ${WM_SETTEXT} 0 \"STR:\"\n  ReadINIStr $1 \"$PLUGINSDIR\\test.ini\" \"Field 8\" \"HWND\"\n  SendMessage $1 ${WM_SETTEXT} 0 \"STR:\"\n  Abort ; Return to the page\n\ndroplist:\n  ; Make the DirRequest field depend on the droplist\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 11\" \"State\"\n  StrCmp $0 \"Show\" +3\n    StrCpy $0 0\n  Goto +2\n    StrCpy $0 1\n  ReadINIStr $1 \"$PLUGINSDIR\\test.ini\" \"Field 6\" \"HWND\"\n  EnableWindow $1 $0\n  ReadINIStr $1 \"$PLUGINSDIR\\test.ini\" \"Field 6\" \"HWND2\"\n  EnableWindow $1 $0\n  ; Add the disabled flag too so when we return to this page it's disabled again\n  StrCmp $0 0 0 +3\n\n    WriteINIStr \"$PLUGINSDIR\\test.ini\" \"Field 6\" \"Flags\" \"DISABLED\"\n    Goto +2\n\n    WriteINIStr \"$PLUGINSDIR\\test.ini\" \"Field 6\" \"Flags\" \"\"\n  Abort ; Return to the page\n\nvalidate:\n  ; At this point we know the Next button was pressed, so perform any validation\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 2\" \"State\"\n  StrCmp $0 1 done\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 3\" \"State\"\n  StrCmp $0 1 done\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 4\" \"State\"\n  StrCmp $0 1 done\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"You must select at least one install option!\"\n    Abort\ndone:\n\nFunctionEnd\n\n; Installation page\nPage instfiles\n\nSection\n\n  ;Get Install Options dialog user input\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 2\" \"State\"\n  DetailPrint \"Install X=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 3\" \"State\"\n  DetailPrint \"Install Y=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 4\" \"State\"\n  DetailPrint \"Install Z=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"State\"\n  DetailPrint \"File=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 6\" \"State\"\n  DetailPrint \"Dir=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\test.ini\" \"Field 8\" \"State\"\n  DetailPrint \"Info=$0\"\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptionsEx/InstallOptionsEx.nsi",
    "content": "; o-----------------------------------------------------o\n; |   InstallOptionsEx 2.4.5 beta 3                     |\n; (-----------------------------------------------------)\n; | Installer script.      / A plug-in for NSIS 2 and 3 |\n; |                       ------------------------------|\n; | By SuperPat                                         |\n; o-----------------------------------------------------o\n\n;--------------------------------\n;General\n\n  !define VERSION \"2.4.5b3\"\n  !define NAME \"NSIS InstallOptionsEx plugin\"\n\n  !define /date VERIPV \"2.4.5.3\"\n  VIProductVersion \"${VERIPV}\"\n  VIAddVersionKey ProductName \"InstallOptionsEx plugin for NSIS (Nullsoft Scriptable Install System).\"\n  VIAddVersionKey ProductVersion \"${VERSION}\"\n  VIAddVersionKey Comments \"InstallOptionsEx plugin for NSIS (Nullsoft Scriptable Install System).\"\n  VIAddVersionKey LegalTrademarks \"InstallOptionsEx is released under the zlib/libpng license: http://nsis.sf.net/License\"\n  VIAddVersionKey LegalCopyright \"Copyright � 2005-2019 SuperPat, Copyright � 2004-2005 Diego Pedroso\"\n  VIAddVersionKey FileDescription \"InstallOptionsEx allow you to create custom pages for NSIS installers, to prompt the user for extra information.\"\n  VIAddVersionKey FileVersion \"${VERIPV}\"\n  \n;--------------------------------\n;Configuration\n\n  ; The name of the installer\n  Name \"${NAME} version ${VERSION}\"\n\n  ; The file to write\n  OutFile \"InstallOptionsEx${VERSION}.exe\"\n\n  ;Generate unicode installer\n  Unicode True\n\n  SetCompressor /FINAL /SOLID lzma\n  \n  ;Windows vista compatibility\n  RequestExecutionLevel admin\n\n  BrandingText \"${NAME} version ${VERSION}\"\n\n  ;Default installation folder\n  InstallDir $PROGRAMFILES\\NSIS\n\n;--------------------------------\n;Include UltraModernUI between others\n\n  !include \"MUIEx.nsh\"\n  !include \"Sections.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define MUI_COMPONENTSPAGE_SMALLDESC\n  \n  !define MUI_LICENSEPAGE_RADIOBUTTONS\n  \n  !define MUI_HEADERIMAGE\n\n;--------------------------------\n;Registry Settings\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKLM\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\NSIS\"\n  \n  InstallDirRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"\"\n\n;--------------------------------\n;Reserve Files\n\n  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\n\n;--------------------------------\n;Pages\n\n  Var STARTMENU_FOLDER\n\n    !define UMUI_MULTILANGUAGEPAGE_TITLE_3LINES\n  !insertmacro UMUI_PAGE_MULTILANGUAGE\n    !define UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n    !define MUI_WELCOMEPAGE_TITLE_3LINES\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"..\\..\\Docs\\InstallOptionsEx\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n    !define MUI_STARTMENUPAGE_DEFAULTFOLDER \"NSIS\\Contrib\"\n  !insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU Application $STARTMENU_FOLDER\n;  !insertmacro MUI_PAGE_DIRECTORY\n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n  !insertmacro MUI_PAGE_INSTFILES\n    !define MUI_FINISHPAGE_TITLE_3LINES\n    !define MUI_FINISHPAGE_SHOWREADME \"${NSISDIR}\\Docs\\InstallOptionsEx\\Readme.html\"\n    !define MUI_FINISHPAGE_LINK \"InstallOptionsEx Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://nsis-ioex.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n    !define UMUI_ABORTPAGE_TITLE_3LINES\n    !define UMUI_ABORTPAGE_LINK \"InstallOptionsEx Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://nsis-ioex.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n \n    !define UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n    !define MUI_FINISHPAGE_TITLE_3LINES\n    !define MUI_FINISHPAGE_LINK \"InstallOptionsEx Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://nsis-ioex.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n    !define UMUI_ABORTPAGE_TITLE_3LINES\n    !define UMUI_ABORTPAGE_LINK \"InstallOptionsEx Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://nsis-ioex.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT\n\n;--------------------------------\n;Languages\n\n; first language is the default language if the system language is not in this list\n  !insertmacro MUI_LANGUAGE \"English\"\n\n; Other UMUI translated languages\n  !insertmacro MUI_LANGUAGE \"Bulgarian\"\n  !insertmacro MUI_LANGUAGE \"Czech\"\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"German\"\n  !insertmacro MUI_LANGUAGE \"Greek\"\n  !insertmacro MUI_LANGUAGE \"Hungarian\"\n  !insertmacro MUI_LANGUAGE \"Italian\"\n  !insertmacro MUI_LANGUAGE \"Japanese\"\n  !insertmacro MUI_LANGUAGE \"Lithuanian\"\n  !insertmacro MUI_LANGUAGE \"Polish\"\n  !insertmacro MUI_LANGUAGE \"Russian\"\n  !insertmacro MUI_LANGUAGE \"Slovenian\"\n  !insertmacro MUI_LANGUAGE \"Spanish\"\n  !insertmacro MUI_LANGUAGE \"Turkish\"\n; Other UMUI partially translated language\n  !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n\n; Other untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n  !insertmacro MUI_LANGUAGE \"SimpChinese\"\n  !insertmacro MUI_LANGUAGE \"TradChinese\"\n  !insertmacro MUI_LANGUAGE \"Korean\"\n  !insertmacro MUI_LANGUAGE \"Dutch\"\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro MUI_LANGUAGE \"Norwegian\"\n  !insertmacro MUI_LANGUAGE \"NorwegianNynorsk\"\n  !insertmacro MUI_LANGUAGE \"Finnish\"\n  !insertmacro MUI_LANGUAGE \"Portuguese\"\n  !insertmacro MUI_LANGUAGE \"Ukrainian\"\n  !insertmacro MUI_LANGUAGE \"Slovak\"\n  !insertmacro MUI_LANGUAGE \"Croatian\"\n  !insertmacro MUI_LANGUAGE \"Thai\"\n  !insertmacro MUI_LANGUAGE \"Romanian\"\n  !insertmacro MUI_LANGUAGE \"Latvian\"\n  !insertmacro MUI_LANGUAGE \"Macedonian\"\n  !insertmacro MUI_LANGUAGE \"Estonian\"\n  !insertmacro MUI_LANGUAGE \"Serbian\"\n  !insertmacro MUI_LANGUAGE \"SerbianLatin\"\n  !insertmacro MUI_LANGUAGE \"Arabic\"\n  !insertmacro MUI_LANGUAGE \"Farsi\"\n  !insertmacro MUI_LANGUAGE \"Hebrew\"\n  !insertmacro MUI_LANGUAGE \"Indonesian\"\n  !insertmacro MUI_LANGUAGE \"Mongolian\"\n  !insertmacro MUI_LANGUAGE \"Luxembourgish\"\n  !insertmacro MUI_LANGUAGE \"Albanian\"\n  !insertmacro MUI_LANGUAGE \"Breton\"\n  !insertmacro MUI_LANGUAGE \"Belarusian\"\n  !insertmacro MUI_LANGUAGE \"Icelandic\"\n  !insertmacro MUI_LANGUAGE \"Malay\"\n  !insertmacro MUI_LANGUAGE \"Bosnian\"\n  !insertmacro MUI_LANGUAGE \"Kurdish\"\n  !insertmacro MUI_LANGUAGE \"Irish\"\n  !insertmacro MUI_LANGUAGE \"Uzbek\"\n  !insertmacro MUI_LANGUAGE \"Galician\"\n  !insertmacro MUI_LANGUAGE \"Afrikaans\"\n  !insertmacro MUI_LANGUAGE \"Catalan\"\n  !insertmacro MUI_LANGUAGE \"Esperanto\"\n  !insertmacro MUI_LANGUAGE \"Asturian\"\n  !insertmacro MUI_LANGUAGE \"Basque\"\n  !insertmacro MUI_LANGUAGE \"Pashto\"\n  !insertmacro MUI_LANGUAGE \"ScotsGaelic\"\n  !insertmacro MUI_LANGUAGE \"Vietnamese\"\n  !insertmacro MUI_LANGUAGE \"Welsh\"\n  !insertmacro MUI_LANGUAGE \"Corsican\"\n  !insertmacro MUI_LANGUAGE \"Tatar\"\n\n; Other unicode only untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"Armenian\"\n  !insertmacro MUI_LANGUAGE \"Georgian\"\n  !insertmacro MUI_LANGUAGE \"Hindi\"\n  \n;--------------------------------\n; The stuff to install\n\nSection \"${NAME}, examples & docs\" SecIOEx\n  SectionIn RO\n  \n  ReadRegDword $0 HKLM Software\\NSIS \"VersionMajor\"\n  StrCmp $0 3 0 +6\n    ; NSIS 3\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi\n    File \"..\\..\\Plugins\\x86-ansi\\InstallOptionsEx.dll\"\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\InstallOptionsEx.dll\"\n    Goto +3\n    \n    ; NSIS 2\n    SetOutPath $INSTDIR\\Plugins\n    File \"..\\..\\Plugins\\x86-ansi\\InstallOptionsEx.dll\"\n  \n  SetOutPath $INSTDIR\\Examples\\InstallOptionsEx\n  File \"*.nsi\"\n  File \"*.ini\"\n  \n  SetOutPath $INSTDIR\\Docs\\InstallOptionsEx\n  File \"..\\..\\Docs\\InstallOptionsEx\\*.*\"\n\n  ; Write the uninstall keys for Windows\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayName\" \"${NAME}\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayIcon\" \"$INSTDIR\\uninstall_InstallOptionsEx.exe,0\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"UninstallString\" \"$INSTDIR\\uninstall_InstallOptionsEx.exe\"\n  WriteUninstaller \"uninstall_InstallOptionsEx.exe\"\n\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    SetOutPath \"$SMPROGRAMS\\$STARTMENU_FOLDER\\\"\n    CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\InstallOptionsEx Readme.lnk\" \"$INSTDIR\\Docs\\InstallOptionsEx\\Readme.html\"\n    CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\Uninstall InstallOptionsEx.lnk\" \"$INSTDIR\\uninstall_InstallOptionsEx.exe\"\n  !insertmacro MUI_STARTMENU_WRITE_END\n\nSectionEnd\n\nSection \"Source Code\" SecSrc\n    \n  SetOutPath $INSTDIR\\Contrib\\InstallOptionsEx\n  File \"..\\..\\Contrib\\InstallOptionsEx\\*.c\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\*.h\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\ioptdll.rc\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\io.sln\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\io.vcproj\"\n  SetOutPath $INSTDIR\\Contrib\\InstallOptionsEx\\Controls\n  File \"..\\..\\Contrib\\InstallOptionsEx\\Controls\\*.h\"\n    \nSectionEnd\n\n;--------------------------------\n; Uninstaller\n\nSection \"Uninstall\"\n  \n  ; Remove registry keys\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\n  DeleteRegKey HKLM \"SOFTWARE\\NSIS\\${NAME}\"\n\n  Delete \"$INSTDIR\\Plugins\\InstallOptionsEx.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\InstallOptionsEx.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\InstallOptionsEx.dll\"\n  RMDir /r \"$INSTDIR\\Contrib\\InstallOptionsEx\"\n  Delete \"$INSTDIR\\Docs\\InstallOptionsEx\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\InstallOptionsEx\"\n  Delete \"$INSTDIR\\Examples\\InstallOptionsEx\\*.*\"\n  RMDir \"$INSTDIR\\Examples\\InstallOptionsEx\"\n  Delete \"$INSTDIR\\uninstall_InstallOptionsEx.exe\"\n  RMDir \"$INSTDIR\"\n\n  !insertmacro MUI_STARTMENU_GETFOLDER Application $STARTMENU_FOLDER\n  Delete \"$SMPROGRAMS\\$STARTMENU_FOLDER\\InstallOptionsEx Readme.lnk\"\n  Delete \"$SMPROGRAMS\\$STARTMENU_FOLDER\\Uninstall InstallOptionsEx.lnk\"\n  RMDir \"$SMPROGRAMS\\$STARTMENU_FOLDER\"\n  RMDir \"$SMPROGRAMS\\$STARTMENU_FOLDER\\..\"\n  \nSectionEnd\n\n;--------------------------------------\n; Components and Confirm page functions\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecIOEx} \"Install the ANSI and UNICODE version of the plugin, the documentation and examples of the InstallOptionsEx NSIS plugin.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSrc} \"The Sources code of the InstallOptionsEx plugin.\"\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n\n!macro confirm_addline section\n\n  SectionGetFlags ${Sec${section}} $1\n  IntOp $1 $1 & ${SF_SELECTED}\n  IntCmp $1 ${SF_SELECTED} 0 n${section} n${section}\n    SectionGetText ${Sec${section}} $1\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"    - $1\"\n  n${section}:\n\n!macroend\n\nFunction confirm_function\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  ;Only if StartMenu Floder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER)\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $STARTMENU_FOLDER\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n    ;ShellVarContext\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $1\n    StrCmp $1 \"all\" 0 current\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      Goto endsvc\n    current:\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    endsvc:\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  !insertmacro MUI_STARTMENU_WRITE_END\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n\n  !insertmacro confirm_addline IOEx\n  !insertmacro confirm_addline Src\n\nFunctionEnd\n\n;--------------------------------\n; Init functions\n\nFunction .onInit\n  \n  ; Check NSIS Version\n  ReadRegDword $0 HKLM Software\\NSIS \"VersionMajor\"\n  StrCmp $0 3 okNSIS 0\n    StrCmp $0 2 0 +3\n      ReadRegDword $0 HKLM Software\\NSIS \"VersionMinor\"\n      IntCmp $0 42 okNSIS 0 okNSIS\n  \n        MessageBox MB_OK|MB_ICONSTOP \"NSIS version 2.42 or NSIS 3 are not installed on your computer.$\\r$\\nPlease, install NSIS (http://nsis.sourceforge.net) and then re-execute this install.$\\n$\\rThis install will stop.\"\n        Quit\n\n  okNSIS:\n  ClearErrors\n\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd\n\nFunction un.onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptionsEx/test.ini",
    "content": "[Settings]\nNumFields=10\nState=0\n\n[Field 1]\nType=GroupBox\nLeft=0\nRight=-1\nTop=0\nBottom=-5\nText=\" This is a group box... \"\n\n[Field 2]\nType=checkbox\nText=Install support for X\nLeft=10\nRight=-10\nTop=17\nBottom=25\nState=0\n\n[Field 3]\nType=checkbox\nText=Install support for Y\nLeft=10\nRight=-10\nTop=30\nBottom=38\nState=1\n\n[Field 4]\nType=checkbox\nText=Install support for Z\nLeft=10\nRight=-10\nTop=43\nBottom=51\nState=0\n\n[Field 5]\nType=Text\nState=C:\\poop.poop\nLeft=10\nRight=-35\nTop=56\nBottom=68\n\n[Field 6]\nType=Button\nLeft=-30\nRight=-10\nTop=56\nBottom=68\nText=...\nFlags=OPEN_FILEREQUEST|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY\nFilter=Text Files|*.txt|Programs|*.exe;*.com|All Files|*.*\nRefFields=5\n\n[Field 7]\nType=Text\nLeft=10\nRight=-35\nTop=73\nBottom=85\nState=C:\\Program Files\\NSIS\n\n[Field 8]\nType=Button\nLeft=-30\nRight=-10\nTop=73\nBottom=85\nText=...\nFlags=DIRREQUEST\nListItems=Select a directory...\nRefFields=7\nRoot=\n\n[Field 9]\nType=Label\nLeft=10\nRight=-10\nTop=90\nBottom=98\nText=This is a label...\n\n[Field 10]\nType=Text\nLeft=10\nRight=-10\nTop=98\nBottom=120\nState=\"Multiline\\r\\nedit...\"\nFlags=MULTILINE|VSCROLL|WANTRETURN"
  },
  {
    "path": "setup/nsis/tools/Examples/InstallOptionsEx/test.nsi",
    "content": ";InstallOptionsEx Test Script\n;Original Version Written by Joost Verburg\n;-----------------------------------------\n\n!define TEMP1 $R0 ;Temp variable\n\n;The name of the installer\nName \"InstallOptionsEx Test\"\n\n;The file to write\nOutFile \"Test.exe\"\n\n; Show install details\nShowInstDetails show\n\n;Things that need to be extracted on startup (keep these lines before any File command!)\n;Only useful for BZIP2 compression\n;Use ReserveFile for your own InstallOptions INI files too!\n\nReserveFile /plugin InstallOptionsEx.dll\nReserveFile test.ini\n\n;Order of pages\nPage custom SetCustom ValidateCustom \": Testing InstallOptions\" ;Custom page. InstallOptions gets called in SetCustom.\nPage instfiles\n\nSection \"Components\"\n\n  ;Get Install Options dialog user input\n\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 2\" \"State\"\n  DetailPrint \"Install X=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 3\" \"State\"\n  DetailPrint \"Install Y=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 4\" \"State\"\n  DetailPrint \"Install Z=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 5\" \"State\"\n  DetailPrint \"File=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 7\" \"State\"\n  DetailPrint \"Dir=${TEMP1}\"\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 10\" \"State\"\n  DetailPrint \"Info=${TEMP1}\"\n  \nSectionEnd\n\nFunction .onInit\n\n  ;Extract InstallOptions files\n  ;$PLUGINSDIR will automatically be removed when the installer closes\n  \n  InitPluginsDir\n  File /oname=$PLUGINSDIR\\test.ini \"test.ini\"\n  \nFunctionEnd\n\nFunction SetCustom\n\n  ;Display the InstallOptions dialog\n\n  Push ${TEMP1}\n\n    InstallOptionsEx::dialog \"$PLUGINSDIR\\test.ini\"\n    Pop ${TEMP1}\n  \n  Pop ${TEMP1}\n\nFunctionEnd\n\nFunction ValidateCustom\n\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 2\" \"State\"\n  StrCmp ${TEMP1} 1 done\n  \n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 3\" \"State\"\n  StrCmp ${TEMP1} 1 done\n\n  ReadINIStr ${TEMP1} \"$PLUGINSDIR\\test.ini\" \"Field 4\" \"State\"\n  StrCmp ${TEMP1} 1 done\n    MessageBox MB_ICONEXCLAMATION|MB_OK \"You must select at least one install option!\"\n    Abort\n\n  done:\n  \nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Library.nsi",
    "content": "# This example tests the compile time aspect of the Library macros\n# more than the runtime aspect. It is more of a syntax example,\n# rather than a usage example.\n\n!include \"Library.nsh\"\n\nName \"Library Test\"\nOutFile \"Library Test.exe\"\n\nInstallDir \"$TEMP\\Library Test\"\n\nPage directory\nPage instfiles\n\nXPStyle on\n\nRequestExecutionLevel user\n\n\n!define TestDLL '\"${NSISDIR}\\Plugins\\${NSIS_CPU}-unicode\\LangDLL.dll\"'\n!define TestEXE '\"${NSISDIR}\\Contrib\\UIs\\default.exe\"'\n\nSection\n\n!insertmacro InstallLib DLL       NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib DLL       NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib DLL       NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib DLL       NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib REGDLL    NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLL    NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLL    NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLL    NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib TLB       NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib TLB       NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib TLB       NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib TLB       NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib REGDLLTLB NOTSHARED REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLLTLB NOTSHARED NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLLTLB NOTSHARED REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLLTLB NOTSHARED NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib DLL       $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib DLL       $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib DLL       $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib DLL       $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib REGDLL    $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLL    $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLL    $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLL    $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib TLB       $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib TLB       $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib TLB       $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib TLB       $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib REGDLLTLB $0        REBOOT_PROTECTED      ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLLTLB $0        NOREBOOT_PROTECTED    ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLLTLB $0        REBOOT_NOTPROTECTED   ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n!insertmacro InstallLib REGDLLTLB $0        NOREBOOT_NOTPROTECTED ${TestDLL} $INSTDIR\\test.dll $INSTDIR\n\n!insertmacro InstallLib REGEXE    $0        REBOOT_PROTECTED      ${TestEXE} $INSTDIR\\test.exe $INSTDIR\n!insertmacro InstallLib REGEXE    $0        NOREBOOT_PROTECTED    ${TestEXE} $INSTDIR\\test.exe $INSTDIR\n!insertmacro InstallLib REGEXE    $0        REBOOT_NOTPROTECTED   ${TestEXE} $INSTDIR\\test.exe $INSTDIR\n!insertmacro InstallLib REGEXE    $0        NOREBOOT_NOTPROTECTED ${TestEXE} $INSTDIR\\test.exe $INSTDIR\n\nWriteUninstaller $INSTDIR\\uninstall.exe\n\nSectionEnd\n\nSection uninstall\n\n!insertmacro UninstallLib DLL       NOTSHARED NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       NOTSHARED REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib REGDLL    NOTSHARED NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    NOTSHARED REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib TLB       NOTSHARED NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       NOTSHARED REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib REGDLLTLB NOTSHARED NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB NOTSHARED REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB NOTSHARED NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB NOTSHARED REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB NOTSHARED NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib DLL       SHARED    NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       SHARED    REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       SHARED    NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       SHARED    REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib DLL       SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib REGDLL    SHARED    NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    SHARED    REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    SHARED    NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    SHARED    REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLL    SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib TLB       SHARED    NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       SHARED    REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       SHARED    NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       SHARED    REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib TLB       SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib REGDLLTLB SHARED    NOREMOVE               $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB SHARED    REBOOT_PROTECTED       $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB SHARED    NOREBOOT_PROTECTED     $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB SHARED    REBOOT_NOTPROTECTED    $INSTDIR\\test.dll\n!insertmacro UninstallLib REGDLLTLB SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\\test.dll\n\n!insertmacro UninstallLib REGEXE    SHARED    NOREMOVE               $INSTDIR\\test.exe\n!insertmacro UninstallLib REGEXE    SHARED    REBOOT_PROTECTED       $INSTDIR\\test.exe\n!insertmacro UninstallLib REGEXE    SHARED    NOREBOOT_PROTECTED     $INSTDIR\\test.exe\n!insertmacro UninstallLib REGEXE    SHARED    REBOOT_NOTPROTECTED    $INSTDIR\\test.exe\n!insertmacro UninstallLib REGEXE    SHARED    NOREBOOT_NOTPROTECTED  $INSTDIR\\test.exe\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/LogicLib.nsi",
    "content": "!verbose 2\n\nName \"NSIS LogicLib Example\"\nOutFile \"LogicLib.exe\"\nShowInstDetails show\nRequestExecutionLevel user\n\n!include \"LogicLib.nsh\"\n\n;!undef LOGICLIB_VERBOSITY\n;!define LOGICLIB_VERBOSITY 4   ; For debugging - watch what logiclib does with your code!\n\nPage components \"\" \"\" ComponentsLeave\nPage instfiles\n\nSection /o \"Run tests\" TESTS\n\n  ; kinds of if other than \"value1 comparison value2\"\n  ClearErrors\n  FindFirst $R1 $R2 \"$PROGRAMFILES\\*\"\n  ${Unless} ${Errors}\n    ${Do}\n      ${Select} $R2\n        ${Case2} \".\" \"..\"\n          ; Do nothing\n        ${CaseElse}\n          DetailPrint \"Found $PROGRAMFILES\\$R2\"\n      ${EndSelect}\n      FindNext $R1 $R2\n    ${LoopUntil} ${Errors}\n    FindClose $R1\n  ${EndUnless}\n\n  ${If} ${FileExists} \"${__FILE__}\"\n    DetailPrint 'Source file \"${__FILE__}\" still exists'\n  ${Else}\n    DetailPrint 'Source file \"${__FILE__}\" has gone'\n  ${EndIf}\n\n  ; if..endif\n  StrCpy $R1 1\n  StrCpy $R2 \"\"\n  ${If} $R1 = 1\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} $R1 = 2\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} $R1 < 2\n    StrCpy $R2 $R2C\n  ${EndIf}\n  ${If} $R1 < -2\n    StrCpy $R2 $R2D\n  ${EndIf}\n  ${If} $R1 > 2\n    StrCpy $R2 $R2E\n  ${EndIf}\n  ${If} $R1 > -2\n    StrCpy $R2 $R2F\n  ${EndIf}\n  ${If} $R1 <> 1\n    StrCpy $R2 $R2G\n  ${EndIf}\n  ${If} $R1 <> 2\n    StrCpy $R2 $R2H\n  ${EndIf}\n  ${If} $R1 >= 2\n    StrCpy $R2 $R2I\n  ${EndIf}\n  ${If} $R1 >= -2\n    StrCpy $R2 $R2J\n  ${EndIf}\n  ${If} $R1 <= 2\n    StrCpy $R2 $R2K\n  ${EndIf}\n  ${If} $R1 <= -2\n    StrCpy $R2 $R2L\n  ${EndIf}\n  ${If} $R2 == \"ACFHJK\"\n    DetailPrint \"PASSED If..EndIf test\"\n  ${Else}\n    DetailPrint \"FAILED If..EndIf test\"\n  ${EndIf}\n\n  ; if..elseif..else..endif\n  StrCpy $R1 A\n  StrCpy $R2 \"\"\n  ${If} $R1 == A\n    StrCpy $R2 $R2A\n  ${ElseIf} $R1 == B\n    StrCpy $R2 $R2B\n  ${ElseUnless} $R1 != C\n    StrCpy $R2 $R2C\n  ${Else}\n    StrCpy $R2 $R2D\n  ${EndIf}\n  ${If} $R1 == D\n    StrCpy $R2 $R2D\n  ${ElseIf} $R1 == A\n    StrCpy $R2 $R2A\n  ${ElseUnless} $R1 != B\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2C\n  ${EndIf}\n  ${If} $R1 == C\n    StrCpy $R2 $R2C\n  ${ElseIf} $R1 == D\n    StrCpy $R2 $R2D\n  ${ElseUnless} $R1 != A\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} $R1 == B\n    StrCpy $R2 $R2B\n  ${ElseIf} $R1 == C\n    StrCpy $R2 $R2C\n  ${ElseUnless} $R1 != D\n    StrCpy $R2 $R2D\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} $R2 == \"$R1$R1$R1$R1\"\n    DetailPrint \"PASSED If..ElseIf..Else..EndIf test\"\n  ${Else}\n    DetailPrint \"FAILED If..ElseIf..Else..EndIf test\"\n  ${EndIf}\n\n  ; if..andif..orif..endif\n  StrCpy $R2 \"\"\n  ${If} 1 = 1\n  ${AndIf} 2 = 2\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 1\n  ${AndIf} 2 = 3\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 2\n  ${AndIf} 2 = 2\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 2\n  ${AndIf} 2 = 3\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n\n  ${If} 1 = 1\n  ${OrIf} 2 = 2\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 1\n  ${OrIf} 2 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 2\n  ${OrIf} 2 = 2\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 2\n  ${OrIf} 2 = 3\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n\n  ${If} 1 = 1\n  ${AndIf} 2 = 2\n  ${OrIf} 3 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 1\n  ${AndIf} 2 = 3\n  ${OrIf} 3 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 2\n  ${AndIf} 2 = 2\n  ${OrIf} 3 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 2\n  ${AndIf} 2 = 3\n  ${OrIf} 3 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 1\n  ${AndIf} 2 = 2\n  ${OrIf} 3 = 4\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 1\n  ${AndIf} 2 = 3\n  ${OrIf} 3 = 4\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 2\n  ${AndIf} 2 = 2\n  ${OrIf} 3 = 4\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 2\n  ${AndIf} 2 = 3\n  ${OrIf} 3 = 4\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n\n  ${If} 1 = 1\n  ${OrIf} 2 = 2\n  ${AndIf} 3 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 1\n  ${OrIf} 2 = 3\n  ${AndIf} 3 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 2\n  ${OrIf} 2 = 2\n  ${AndIf} 3 = 3\n    StrCpy $R2 $R2A\n  ${Else}\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 1 = 2\n  ${OrIf} 2 = 3\n  ${AndIf} 3 = 3\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 1\n  ${OrIf} 2 = 2\n  ${AndIf} 3 = 4\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 1\n  ${OrIf} 2 = 3\n  ${AndIf} 3 = 4\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 2\n  ${OrIf} 2 = 2\n  ${AndIf} 3 = 4\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 1 = 2\n  ${OrIf} 2 = 3\n  ${AndIf} 3 = 4\n    StrCpy $R2 $R2B\n  ${Else}\n    StrCpy $R2 $R2A\n  ${EndIf}\n\n  ${If} $R2 == \"AAAAAAAAAAAAAAAAAAAAAAAA\"\n    DetailPrint \"PASSED If..AndIf..OrIf..Else..EndIf test\"\n  ${Else}\n    DetailPrint \"FAILED If..AndIf..OrIf..Else..EndIf test\"\n  ${EndIf}\n\n  ; ifthen..|..|\n  StrCpy $R1 1\n  StrCpy $R2 \"\"\n  ${IfThen} $R1 = 1 ${|} StrCpy $R2 $R2A ${|}\n  ${IfThen} $R1 = 2 ${|} StrCpy $R2 $R2B ${|}\n  ${IfNotThen} $R1 = 1 ${|} StrCpy $R2 $R2C ${|}\n  ${IfNotThen} $R1 = 2 ${|} StrCpy $R2 $R2D ${|}\n  ${If} $R2 == \"AD\"\n    DetailPrint \"PASSED IfThen test\"\n  ${Else}\n    DetailPrint \"FAILED IfThen test\"\n  ${EndIf}\n\n  ; ifcmd..||..| and if/unless cmd\n  StrCpy $R2 \"\"\n  ${IfCmd} MessageBox MB_YESNO \"Please click Yes\" IDYES ${||} StrCpy $R2 $R2A ${|}\n  ${Unless} ${Cmd} `MessageBox MB_YESNO|MB_DEFBUTTON2 \"Please click No\" IDYES`\n    StrCpy $R2 $R2B\n  ${EndUnless}\n  ${If} $R2 == \"AB\"\n    DetailPrint \"PASSED IfCmd/If Cmd test\"\n  ${Else}\n    DetailPrint \"FAILED IfCmd/If Cmd test\"\n  ${EndIf}\n\n  ; select..case..case2..case3..case4..case5..caseelse..endselect\n  StrCpy $R1 1\n  StrCpy $R2 \"\"\n  ${Select} $R1\n    ${Case} \"1\"\n      StrCpy $R2 $R2A\n    ${Case} \"2\"\n      StrCpy $R2 $R2B\n    ${Case2} \"3\" \"4\"\n      StrCpy $R2 $R2C\n    ${CaseElse}\n      StrCpy $R2 $R2D\n  ${EndSelect}\n  ${Select} $R1\n    ${Case} \"2\"\n      StrCpy $R2 $R2A\n    ${Case} \"3\"\n      StrCpy $R2 $R2B\n    ${Case2} \"4\" \"5\"\n      StrCpy $R2 $R2C\n    ${CaseElse}\n      StrCpy $R2 $R2D\n  ${EndSelect}\n  ${Select} $R1\n    ${Case} \"3\"\n      StrCpy $R2 $R2A\n    ${Case} \"4\"\n      StrCpy $R2 $R2B\n    ${Case2} \"5\" \"1\"\n      StrCpy $R2 $R2C\n    ${CaseElse}\n      StrCpy $R2 $R2D\n  ${EndSelect}\n  ${Select} $R1\n    ${Case} \"4\"\n      StrCpy $R2 $R2A\n    ${Case} \"5\"\n      StrCpy $R2 $R2B\n    ${Case2} \"1\" \"2\"\n      StrCpy $R2 $R2C\n    ${CaseElse}\n      StrCpy $R2 $R2D\n  ${EndSelect}\n  ${If} $R2 == \"ADCC\"\n    DetailPrint \"PASSED Select..Case*..EndSelect test\"\n  ${Else}\n    DetailPrint \"FAILED Select..Case*..EndSelect test\"\n  ${EndIf}\n\n  ; switch..case..caseelse..endswitch\n  StrCpy $R2 \"\"\n  ${For} $R1 1 10\n    ${Switch} $R1\n      ${Case} 3\n        StrCpy $R2 $R2A\n      ${Case} 4\n        StrCpy $R2 $R2B\n        ${Break}\n      ${Case} 5\n        StrCpy $R2 $R2C\n    ${EndSwitch}\n    ${Switch} $R1\n      ${Case} 1\n        StrCpy $R2 $R2D\n      ${Default}\n        StrCpy $R2 $R2E\n        ${Break}\n      ${Case} 2\n        StrCpy $R2 $R2F\n    ${EndSwitch}\n    ${Switch} $R1\n      ${Case} 6\n      ${Case} 7\n        StrCpy $R2 $R2G\n        ${If} $R1 = 6\n      ${Case} 8\n          StrCpy $R2 $R2H\n          ${Switch} $R1\n            ${Case} 6\n              StrCpy $R2 $R2I\n              ${Break}\n            ${Case} 8\n              StrCpy $R2 $R2J\n          ${EndSwitch}\n        ${EndIf}\n        StrCpy $R2 $R2K\n        ${Break}\n      ${Default}\n        StrCpy $R2 $R2L\n      ${Case} 9\n        StrCpy $R2 $R2M\n    ${EndSwitch}\n  ${Next}\n  ${If} $R2 == \"DELMFLMABELMBELMCELMEGHIKEGKEHJKEMELM\"\n    DetailPrint \"PASSED Switch..Case*..EndSwitch test\"\n  ${Else}\n    DetailPrint \"FAILED Switch..Case*..EndSwitch test\"\n  ${EndIf}\n\n  ; for[each]..exitfor..next\n  StrCpy $R2 \"\"\n  ${For} $R1 1 5\n    StrCpy $R2 $R2$R1\n  ${Next}\n  ${ForEach} $R1 10 1 - 1\n    StrCpy $R2 $R2$R1\n  ${Next}\n  ${For} $R1 1 0\n    StrCpy $R2 $R2$R1\n  ${Next}\n  ${If} $R2 == \"1234510987654321\"\n    DetailPrint \"PASSED For[Each]..Next test\"\n  ${Else}\n    DetailPrint \"FAILED For[Each]..Next test\"\n  ${EndIf}\n\n  ; do..loop\n  StrCpy $R1 0\n  Call DoLoop\n  ${If} $R1 == 5\n    DetailPrint \"PASSED Do..Loop test\"\n  ${Else}\n    DetailPrint \"FAILED Do..Loop test\"\n  ${EndIf}\n\n  ; do..exitdo..loop\n  StrCpy $R1 0\n  StrCpy $R2 \"\"\n  ${Do}\n    StrCpy $R2 $R2$R1\n    IntOp $R1 $R1 + 1\n    ${If} $R1 > 10\n      ${ExitDo}\n    ${EndIf}\n  ${Loop}\n  ${If} $R2 == \"012345678910\"\n    DetailPrint \"PASSED Do..ExitDo..Loop test\"\n  ${Else}\n    DetailPrint \"FAILED Do..ExitDo..Loop test\"\n  ${EndIf}\n\n  ; do..exitdo..loopuntil\n  StrCpy $R1 0\n  StrCpy $R2 \"\"\n  ${Do}\n    StrCpy $R2 $R2$R1\n    IntOp $R1 $R1 + 1\n  ${LoopUntil} $R1 >= 5\n  ${If} $R2 == \"01234\"\n    DetailPrint \"PASSED Do..ExitDo..LoopUntil test\"\n  ${Else}\n    DetailPrint \"FAILED Do..ExitDo..LoopUntil test\"\n  ${EndIf}\n\n  ; dountil..exitdo..loop\n  StrCpy $R1 0\n  StrCpy $R2 \"\"\n  ${DoUntil} $R1 >= 5\n    StrCpy $R2 $R2$R1\n    IntOp $R1 $R1 + 1\n  ${Loop}\n  ${If} $R2 == \"01234\"\n    DetailPrint \"PASSED DoUntil..ExitDo..Loop test\"\n  ${Else}\n    DetailPrint \"FAILED DoUntil..ExitDo..Loop test\"\n  ${EndIf}\n\n  ; nested do test\n  StrCpy $R1 0\n  StrCpy $R2 0\n  StrCpy $R3 \"\"\n  ${Do}\n    StrCpy $R3 $R3$R1$R2\n    IntOp $R1 $R1 + 1\n    ${If} $R1 > 5\n      ${ExitDo}\n    ${EndIf}\n    StrCpy $R2 0\n    ${Do}\n      StrCpy $R3 $R3$R1$R2\n      IntOp $R2 $R2 + 1\n      ${If} $R2 >= 5\n        ${ExitDo}\n      ${EndIf}\n    ${Loop}\n  ${Loop}\n  ${If} $R3 == \"00101112131415202122232425303132333435404142434445505152535455\"\n    DetailPrint \"PASSED nested Do test\"\n  ${Else}\n    DetailPrint \"FAILED nested Do test\"\n  ${EndIf}\n\n  ; while..exitwhile..endwhile (exact replica of dowhile..enddo}\n  StrCpy $R1 0\n  StrCpy $R2 \"\"\n  ${While} $R1 < 5\n    StrCpy $R2 $R2$R1\n    IntOp $R1 $R1 + 1\n  ${EndWhile}\n  ${If} $R2 == \"01234\"\n    DetailPrint \"PASSED While..ExitWhile..EndWhile test\"\n  ${Else}\n    DetailPrint \"FAILED While..ExitWhile..EndWhile test\"\n  ${EndIf}\n\n  ; Unsigned integer tests\n  StrCpy $R2 \"\"\n  ${If} -1 < 1\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} -1 U< 1\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 0xFFFFFFFF > 1\n    StrCpy $R2 $R2C\n  ${EndIf}\n  ${If} 0xFFFFFFFF U> 1\n    StrCpy $R2 $R2D\n  ${EndIf}\n  ${If} $R2 == \"AD\"\n    DetailPrint \"PASSED unsigned integer test\"\n  ${Else}\n    DetailPrint \"FAILED unsigned integer test\"\n  ${EndIf}\n\n  ; 64-bit integer tests (uses System.dll)\n  StrCpy $R2 \"\"\n  ${If} 0x100000000 L= 4294967296\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} 0x100000000 L< 0x200000000\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} 0x500000000 L>= 0x500000000\n    StrCpy $R2 $R2C\n  ${EndIf}\n  ${If} $R2 == \"ABC\"\n    DetailPrint \"PASSED 64-bit integer test\"\n  ${Else}\n    DetailPrint \"FAILED 64-bit integer test\"\n  ${EndIf}\n\n  ; Extra string tests (uses System.dll)\n  StrCpy $R2 \"\"\n  ${If} \"A\" S< \"B\"\n    StrCpy $R2 $R2A\n  ${EndIf}\n  ${If} \"b\" S> \"A\"\n    StrCpy $R2 $R2B\n  ${EndIf}\n  ${If} \"a\" S<= \"B\"\n    StrCpy $R2 $R2C\n  ${EndIf}\n  ${If} \"B\" S< \"B\"\n    StrCpy $R2 $R2D\n  ${EndIf}\n  ${If} \"A\" S== \"A\"\n    StrCpy $R2 $R2E\n  ${EndIf}\n  ${If} \"A\" S== \"a\"\n    StrCpy $R2 $R2F\n  ${EndIf}\n  ${If} \"A\" S!= \"a\"\n    StrCpy $R2 $R2G\n  ${EndIf}\n  ${If} $R2 == \"ABCEG\"\n    DetailPrint \"PASSED extra string test\"\n  ${Else}\n    DetailPrint \"FAILED extra string test\"\n  ${EndIf}\n\nSectionEnd\n\nFunction ComponentsLeave\n  ; Section flags tests (requires sections.nsh be included)\n  ${Unless} ${SectionIsSelected} ${TESTS}\n    MessageBox MB_OK \"Please select the component\"\n    Abort\n  ${EndIf}\nFunctionEnd\n\nFunction DoLoop\n\n  ${Do}\n    IntOp $R1 $R1 + 1\n    ${If} $R1 == 5\n      Return\n    ${EndIf}\n  ${Loop}\n\nFunctionEnd\n\n!verbose 3\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Math/math.nsi",
    "content": "; This is just an example of Math plugin\n; \n; (c) brainsucker, 2002\n; (r) BSForce\n\nName \"Math Plugin Example\"\nOutFile \"math.exe\"\nShowInstDetails show\nXPStyle on\n\nSection \"ThisNameIsIgnoredSoWhyBother?\"\n    Math::Script 'SaR(s,fa,ra, i,f,r,e,p) (i=0;#{i<l(fa),e=l(f=fa[i]);r=ra[i];p=0;#{p<l(s),#[s[p,p+e-1]==f,s=(s[,p-1])+r+(s[p+e,]);p+=l(r), p++]}; i++}; s);'\n    Math::Script \"TQ(s) (s = s(NS); #[s[0]=='$\\\"',s=s[1,]]; #[s[-1]=='$\\\"',s=s[,-2]]; NS = s)\"\n    Math::Script \"P(s,e, p,i) (p=-1;i=0; #{(i<l(s))&&(p<0), #[s[i,i+l(e)-1]==e, p=i]; i++}; p)\"\n    Math::Script \"DL(s) (s=s(NS); p=P(s,'\\r\\n'); #[p>=0, (NS=s[p+4,]; NS=#[p>0,s[,p-1],'']), (NS='';NS=s)])\"\n\n    Math::Script \"a = 'Hello \\r\\n World \\r\\n!!!'; a = SaR(a,{'\\r','\\n'},{'$\\r','$\\n'}); R0 = a\"\n    Math::Script \"NS = '$\\\"In quotes$\\\"'; TQ(); R1=NS; R3=P(s(R1),'qu')\"\n    Math::Script \"NS = 'No quotes'; TQ(); R2=NS\"\n    Math::Script \"NS='123\\r\\n456\\r\\n789'; DL(); R4=NS; DL(); R5=NS; DL(); R6=NS; R7=NS\"\n\n\n    DetailPrint \"'$R0'\"\n    DetailPrint \"'$R1'\"\n    DetailPrint \"'$R2'\"\n    DetailPrint \"'$R3'\"\n    DetailPrint \"'$R4'\"\n    DetailPrint \"'$R5'\"\n    DetailPrint \"'$R6'\"\n    DetailPrint \"'$R7'\"\nSectionEnd \n\n; eof\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Math/mathtest.ini",
    "content": "[Settings]\nNumFields=10\nNextButtonText=Execute\nCancelButtonText=Quit\nBackButtonText=Readme\n\n[Field 1]\nType=label\nText=Enter your script here:\nLeft=0\nRight=-1\nTop=0\nBottom=8\n\n[Field 2]\nType=text\nLeft=0\nRight=-1\nTop=9\nBottom=55\nflags=MULTILINE|WANTRETURN|HSCROLL\nState=\"\"\n\n[Field 3]\nType=text\nLeft=53\nRight=175\nTop=56\nBottom=140\nflags=MULTILINE|READONLY\nState=\"\"\n\n[Field 4]\nType=text\nLeft=175\nRight=-1\nTop=56\nBottom=140\nflags=MULTILINE|READONLY\nState=\"\"\n\n[Field 5]\nType=RadioButton\nLeft=0\nRight=-1\nTop=70\nBottom=80\nflags=GROUP\nText=\"Your script\"\nState=1\n\n[Field 6]\nType=RadioButton\nLeft=0\nRight=-1\nTop=80\nBottom=90\nflags=\nText=\"Sample 1\"\nState=0\n\n[Field 7]\nType=RadioButton\nLeft=0\nRight=-1\nTop=90\nBottom=100\nflags=\nText=\"Sample 2\"\nState=0\n\n[Field 8]\nType=RadioButton\nLeft=0\nRight=-1\nTop=100\nBottom=110\nflags=\nText=\"Sample 3\"\nState=0\n\n[Field 9]\nType=RadioButton\nLeft=0\nRight=-1\nTop=110\nBottom=120\nflags=\nText=\"Sample 4\"\nState=0\n\n[Field 10]\nType=RadioButton\nLeft=0\nRight=-1\nTop=120\nBottom=130\nflags=\nText=\"Sample 5\"\nState=0\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Math/mathtest.nsi",
    "content": ";NSIS Modern User Interface version 1.65\n;InstallOptions Example Script\n;Written by Joost Verburg\n\n  !define MUI_BUTTONTEXT_NEXT      \"Execute\"\n\n;---------------------\n;Include Modern UI\n\n  !include \"MUI.nsh\"\n\n;--------------------------------\n;Product Info\n\nName \"Math::Script Test\"\n\n;--------------------------------\n;Configuration\n\n  ;General\n  OutFile \"MathTest.exe\"\n\n;--------------------------------\n;Variables\n\n  Var TEMP1\n  Var TEMP2\n  Var TEMP3\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"mathtest.txt\"\n  Page custom ScriptPageEnter\n  Page instfiles\n \n;--------------------------------\n;Modern UI Configuration\n\n;  !define MUI_ABORTWARNING\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Reserve Files\n  \n  ;Things that need to be extracted on first (keep these lines before any File command!)\n  ;Only for BZIP2 compression\n  \n  ReserveFile \"MathTest.ini\"\n  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\n\n;--------------------------------\n;Installer Functions\n\nLangString SCRIPTSAMPLE0 ${LANG_ENGLISH} \"r0 = 'Hello'; r1 = 'Math::Script'\\r\\nr0 += ' from the ' + r1 + '!'; r1=''\"\nLangString SCRIPTSAMPLE1 ${LANG_ENGLISH} \"a =0; b=1.0\\r\\n#{a++ < 100, b *= a}\\r\\nr0 = a; R0 = b; R1 = ff(b, 15)\\r\\nr1 = (a-1) + '! = ' + b\"\nLangString SCRIPTSAMPLE2 ${LANG_ENGLISH} 'pi=3.14159; \\r\\nangle = pi/4;\\r\\ntext = \"x = \" + ff(angle,16+3) \\r\\nr0 = text +=  \", sin x = \" + sin(angle)'\nLangString SCRIPTSAMPLE3 ${LANG_ENGLISH} \"v1 = 123.456;  v2 = 123456789.1011\\r\\nr0 = v1; r1 = v2\\r\\nr2 = ff(v1, 3); r3 = ff(v2, 3); r4 = ff(v1, 3+16); r5 = ff(v2, 3+16)\\r\\nr6 = ff(v1, 3+32); r7 = ff(v2, 3+32); r8 = ff(v1, 3+32+64); r9 = ff(v2, 3+32+64)\\r\\n\"\nLangString SCRIPTSAMPLE4 ${LANG_ENGLISH} \"a = 10000; b = 0; #{--a > 0, b+= a}; r0 = a; r1 = b\\r\\nz = 1.55; r2 = #[z > 1.5, 'Its greater', 'Its lower']\\r\\nz = 1.45; r3 = #[z > 1.5, 'Its greater', 'Its lower']\"\nLangString SCRIPTSAMPLE5 ${LANG_ENGLISH} 'r0 = \"123a123\"\\r\\nr1 = r0; \\r\\nr2 = s(r0); r3 = f(r0); r4 = i(r0); r5 = l(r0)' \n\nFunction .onInit\n\n  ;Extract InstallOptions INI files\n  !insertmacro MUI_INSTALLOPTIONS_EXTRACT \"MathTest.ini\"\n\n  Strcpy \"$TEMP1\" \"$(SCRIPTSAMPLE0)\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 2\" \"State\" $TEMP1\n  \nFunctionEnd\n\nLangString TEXT_IO_TITLE ${LANG_ENGLISH} \"MathTest Script Page\"\nLangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} \"Try your scripting capapibilites or test one of sample scripts\"\n\n\nFunction DumpVariables\n  Strcpy \"$TEMP1\" \"$$0='$0'\\r\\n$$1='$1'\\r\\n$$2='$2'\\r\\n$$3='$3'\\r\\n$$4='$4'\\r\\n$$5='$5'\\r\\n$$6='$6'\\r\\n$$7='$7'\\r\\n$$8='$8'\\r\\n$$9='$9'\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 3\" \"State\" $TEMP1  \n  Strcpy \"$TEMP1\" \"$$R0='$R0'\\r\\n$$R1='$R1'\\r\\n$$R2='$R2'\\r\\n$$R3='$R3'\\r\\n$$R4='$R4'\\r\\n$$R5='$R5'\\r\\n$$R6='$R6'\\r\\n$$R7='$R7'\\r\\n$$R8='$R8'\\r\\n$$R9='$R9'\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 4\" \"State\" $TEMP1  \nFunctionEnd\n\nFunction ClearVariables\n  Math::Script \"r0=r1=r2=r3=r4=r5=r6=r7=r8=r9=R0=R1=R2=R3=R4=R5=R6=R7=R8=R9=''\"\nFunctionEnd\n\nFunction GetLine\n  push $TEMP1\n  Math::Script \"mtsDL()\"\n  pop $TEMP2\n  pop $TEMP1\nFunctionEnd\n\nFunction ExecuteScript\n  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 \"MathTest.ini\" \"Field 2\" \"State\" \n\n  Math::Script \"mtsTQ(s) (s = s(NS); #[s[0]=='$\\\"',s=s[1,]]; #[s[-1]=='$\\\"',s=s[,-2]]; NS = s)\"\n  Math::Script \"mtsP(s,e, p,i) (p=-1;i=0; #{(i<l(s))&&(p<0), #[s[i,i+l(e)-1]==e, p=i]; i++}; p)\"\n  Math::Script \"mtsDL(s) (s=s(NS); p=mtsP(s,'\\r\\n'); #[p>=0, (NS=s[p+4,]; NS=#[p>0,s[,p-1],'']), (NS='';NS=s)])\"\n\n  push  $TEMP1\n  ; remove \"\"\n  Math::Script \"mtsTQ()\"\n  pop   $TEMP1\n\n  ; script at $TEMP1\nGo:\n   StrLen $TEMP3 $TEMP1\n   IntCmp $TEMP3 0 End\n   ; get single line to $TEMP2\n   Call GetLine\n;   MessageBox MB_OK \"'$TEMP2'      '$TEMP1'\"\n   Math::Script \"$TEMP2\"\n   goto Go\nEnd:\n   Math::Script \"\"\nFunctionEnd\n\nFunction ScriptPageEnter\n      \n  !insertmacro MUI_HEADER_TEXT \"$(TEXT_IO_TITLE)\" \"$(TEXT_IO_SUBTITLE)\"\n\nAgain:\n  Call ClearVariables\n  Call ExecuteScript\n  Call DumpVariables\n\n  !insertmacro MUI_INSTALLOPTIONS_DISPLAY_RETURN \"mathtest.ini\"\n  pop $TEMP3\n\n  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 \"MathTest.ini\" \"Field 5\" \"State\"\n  IntCmp $TEMP1 1 Test\n\n  Strcpy \"$TEMP2\" \"$(SCRIPTSAMPLE1)\"\n  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 \"MathTest.ini\" \"Field 6\" \"State\"\n  IntCmp $TEMP1 1 Write\n\n  Strcpy \"$TEMP2\" \"$(SCRIPTSAMPLE2)\"\n  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 \"MathTest.ini\" \"Field 7\" \"State\"\n  IntCmp $TEMP1 1 Write\n\n  Strcpy \"$TEMP2\" \"$(SCRIPTSAMPLE3)\"\n  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 \"MathTest.ini\" \"Field 8\" \"State\"\n  IntCmp $TEMP1 1 Write\n\n  Strcpy \"$TEMP2\" \"$(SCRIPTSAMPLE4)\"\n  !insertmacro MUI_INSTALLOPTIONS_READ $TEMP1 \"MathTest.ini\" \"Field 9\" \"State\"\n  IntCmp $TEMP1 1 Write\n\n  Strcpy \"$TEMP2\" \"$(SCRIPTSAMPLE5)\"\n\nWrite:\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 2\" \"State\" \"$TEMP2\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 5\" \"State\" \"1\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 6\" \"State\" \"0\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 7\" \"State\" \"0\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 8\" \"State\" \"0\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 9\" \"State\" \"0\"\n  !insertmacro MUI_INSTALLOPTIONS_WRITE \"MathTest.ini\" \"Field 10\" \"State\" \"0\"\n\nTest:\n  Strcmp $TEMP3 \"success\" Again\n\nFunctionEnd\n\nSection \"Dummy Section\" SecDummy  \nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Math/mathtest.txt",
    "content": "Math Tester.\n\nThis demo allows you to test your Math::Script expressions without need to compile anything. Just enter your expressions into multiline editbox (every single line is a separate call to Math::Script) or select one of sample expressions and press Execute.\n\nEvery call to Math::Script can accept up to 1kb of script, but this demo is limited to the summ of 1 kb at all lines. And... watch your scripts. No.... Watch your errors at scripts!\n\n(c) Brainsucker, 2003.\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Memento.nsi",
    "content": "!include LogicLib.nsh\n!include Memento.nsh\n\nName Memento\nOutFile Memento.exe\n\nXPStyle on\n\nShowInstDetails show\n\nPage components\nPage instfiles\n\nRequestExecutionLevel user\n\n# settings\n\n!define MEMENTO_REGISTRY_ROOT HKCU\n!define MEMENTO_REGISTRY_KEY \"Software\\NSIS\\Memento Test\"\n\n# restore\n\nFunction .onInit\n\n  ${If} ${Cmd} `MessageBox MB_YESNO \"Would you like to load an example state?\" IDYES`\n    \n\tDeleteRegKey  HKCU \"Software\\NSIS\\Memento Test\"\n\n\tWriteRegStr   HKCU \"Software\\NSIS\\Memento Test\" MementoSectionUsed \"\"\n\tWriteRegDWORD HKCU \"Software\\NSIS\\Memento Test\" MementoSection_sec_horse   1\n\tWriteRegDWORD HKCU \"Software\\NSIS\\Memento Test\" MementoSection_sec_chicken 1\n\tWriteRegDWORD HKCU \"Software\\NSIS\\Memento Test\" MementoSection_sec_donkey  0\n\tWriteRegDWORD HKCU \"Software\\NSIS\\Memento Test\" MementoSection_sec_croc    0\n\n  ${EndIf}\n\n  ${MementoSectionRestore}\n\nFunctionEnd\n\n# sections\n\n${MementoSection} horse sec_horse\n${MementoSectionEnd}\n\n${MementoSection} donkey sec_donkey\n${MementoSectionEnd}\n\n${MementoSection} chicken sec_chicken\n${MementoSectionEnd}\n\nSectionGroup /e group\n\n  SectionGroup /e group\n\n    ${MementoSection} croc sec_croc\n    ${MementoSectionEnd}\n\n    ${MementoSection} cow sec_cow\n    ${MementoSectionEnd}\n\n  SectionGroupEnd\n\nSectionGroupEnd\n\n${MementoUnselectedSection} dinosaur sec_dinosaur\n${MementoSectionEnd}\n\n# done...\n\n${MementoSectionDone}\n\n# save\n\nFunction .onInstSuccess\n\n  ${MementoSectionSave}\n\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Modern UI/Basic.nsi",
    "content": ";NSIS Modern User Interface\n;Basic Example Script\n;Written by Joost Verburg\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUI2.nsh\"\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"Modern UI Test\"\n  OutFile \"Basic.exe\"\n  Unicode True\n\n  ;Default installation folder\n  InstallDir \"$LOCALAPPDATA\\Modern UI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\Modern UI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/Modern UI/HeaderBitmap.nsi",
    "content": ";NSIS Modern User Interface\n;Header Bitmap Example Script\n;Written by Joost Verburg\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUI2.nsh\"\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"Modern UI Test\"\n  OutFile \"HeaderBitmap.exe\"\n  Unicode True\n\n  ;Default installation folder\n  InstallDir \"$LOCALAPPDATA\\Modern UI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\Modern UI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Interface Configuration\n\n  !define MUI_HEADERIMAGE\n  !define MUI_HEADERIMAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp\" ; optional\n  !define MUI_ABORTWARNING\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/Modern UI/MultiLanguage.nsi",
    "content": ";NSIS Modern User Interface\n;Multilingual Example Script\n;Written by Joost Verburg\n\n!pragma warning error all\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUI2.nsh\"\n\n;--------------------------------\n;General\n\n  ;Properly display all languages (Installer will not work on Windows 95, 98 or ME!)\n  Unicode true\n\n  ;Name and file\n  Name \"Modern UI Test\"\n  OutFile \"MultiLanguage.exe\"\n\n  ;Default installation folder\n  InstallDir \"$LOCALAPPDATA\\Modern UI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\Modern UI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n\n  ;Show all languages, despite user's codepage\n  !define MUI_LANGDLL_ALLLANGUAGES\n\n;--------------------------------\n;Language Selection Dialog Settings\n\n  ;Remember the installer language\n  !define MUI_LANGDLL_REGISTRY_ROOT \"HKCU\" \n  !define MUI_LANGDLL_REGISTRY_KEY \"Software\\Modern UI Test\" \n  !define MUI_LANGDLL_REGISTRY_VALUENAME \"Installer Language\"\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_PAGE_FINISH\n  \n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_UNPAGE_COMPONENTS\n  !insertmacro MUI_UNPAGE_DIRECTORY\n  !insertmacro MUI_UNPAGE_INSTFILES\n  !insertmacro MUI_UNPAGE_FINISH\n\n;--------------------------------\n;Languages\n\n  !insertmacro MUI_LANGUAGE \"English\" ; The first language is the default language\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"German\"\n  !insertmacro MUI_LANGUAGE \"Spanish\"\n  !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n  !insertmacro MUI_LANGUAGE \"SimpChinese\"\n  !insertmacro MUI_LANGUAGE \"TradChinese\"\n  !insertmacro MUI_LANGUAGE \"Japanese\"\n  !insertmacro MUI_LANGUAGE \"Korean\"\n  !insertmacro MUI_LANGUAGE \"Italian\"\n  !insertmacro MUI_LANGUAGE \"Dutch\"\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro MUI_LANGUAGE \"Norwegian\"\n  !insertmacro MUI_LANGUAGE \"NorwegianNynorsk\"\n  !insertmacro MUI_LANGUAGE \"Finnish\"\n  !insertmacro MUI_LANGUAGE \"Greek\"\n  !insertmacro MUI_LANGUAGE \"Russian\"\n  !insertmacro MUI_LANGUAGE \"Portuguese\"\n  !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n  !insertmacro MUI_LANGUAGE \"Polish\"\n  !insertmacro MUI_LANGUAGE \"Ukrainian\"\n  !insertmacro MUI_LANGUAGE \"Czech\"\n  !insertmacro MUI_LANGUAGE \"Slovak\"\n  !insertmacro MUI_LANGUAGE \"Croatian\"\n  !insertmacro MUI_LANGUAGE \"Bulgarian\"\n  !insertmacro MUI_LANGUAGE \"Hungarian\"\n  !insertmacro MUI_LANGUAGE \"Thai\"\n  !insertmacro MUI_LANGUAGE \"Romanian\"\n  !insertmacro MUI_LANGUAGE \"Latvian\"\n  !insertmacro MUI_LANGUAGE \"Macedonian\"\n  !insertmacro MUI_LANGUAGE \"Estonian\"\n  !insertmacro MUI_LANGUAGE \"Turkish\"\n  !insertmacro MUI_LANGUAGE \"Lithuanian\"\n  !insertmacro MUI_LANGUAGE \"Slovenian\"\n  !insertmacro MUI_LANGUAGE \"Serbian\"\n  !insertmacro MUI_LANGUAGE \"SerbianLatin\"\n  !insertmacro MUI_LANGUAGE \"Arabic\"\n  !insertmacro MUI_LANGUAGE \"Farsi\"\n  !insertmacro MUI_LANGUAGE \"Hebrew\"\n  !insertmacro MUI_LANGUAGE \"Indonesian\"\n  !insertmacro MUI_LANGUAGE \"Mongolian\"\n  !insertmacro MUI_LANGUAGE \"Luxembourgish\"\n  !insertmacro MUI_LANGUAGE \"Albanian\"\n  !insertmacro MUI_LANGUAGE \"Breton\"\n  !insertmacro MUI_LANGUAGE \"Belarusian\"\n  !insertmacro MUI_LANGUAGE \"Icelandic\"\n  !insertmacro MUI_LANGUAGE \"Malay\"\n  !insertmacro MUI_LANGUAGE \"Bosnian\"\n  !insertmacro MUI_LANGUAGE \"Kurdish\"\n  !insertmacro MUI_LANGUAGE \"Irish\"\n  !insertmacro MUI_LANGUAGE \"Uzbek\"\n  !insertmacro MUI_LANGUAGE \"Galician\"\n  !insertmacro MUI_LANGUAGE \"Afrikaans\"\n  !insertmacro MUI_LANGUAGE \"Catalan\"\n  !insertmacro MUI_LANGUAGE \"Esperanto\"\n  !insertmacro MUI_LANGUAGE \"Asturian\"\n  !insertmacro MUI_LANGUAGE \"Basque\"\n  !insertmacro MUI_LANGUAGE \"Pashto\"\n  !insertmacro MUI_LANGUAGE \"ScotsGaelic\"\n  !insertmacro MUI_LANGUAGE \"Georgian\"\n  !insertmacro MUI_LANGUAGE \"Vietnamese\"\n  !insertmacro MUI_LANGUAGE \"Welsh\"\n  !insertmacro MUI_LANGUAGE \"Armenian\"\n  !insertmacro MUI_LANGUAGE \"Corsican\"\n  !insertmacro MUI_LANGUAGE \"Tatar\"\n  !insertmacro MUI_LANGUAGE \"Hindi\"\n\n;--------------------------------\n;Reserve Files\n  \n  ;If you are using solid compression, files that are required before\n  ;the actual installation should be stored first in the data block,\n  ;because this will make your installer start faster.\n  \n  !insertmacro MUI_RESERVEFILE_LANGDLL\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Installer Functions\n\nFunction .onInit\n\n  !insertmacro MUI_LANGDLL_DISPLAY\n\nFunctionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGUAGE SPECIFIC\n\n  ;Assign descriptions to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} \"A test section.\"\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd\n\n;--------------------------------\n;Uninstaller Functions\n\nFunction un.onInit\n\n  !insertmacro MUI_UNGETLANGUAGE\n  \nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/Modern UI/StartMenu.nsi",
    "content": ";NSIS Modern User Interface\n;Start Menu Folder Selection Example Script\n;Written by Joost Verburg\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUI2.nsh\"\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"Modern UI Test\"\n  OutFile \"StartMenu.exe\"\n  Unicode True\n\n  ;Default installation folder\n  InstallDir \"$LOCALAPPDATA\\Modern UI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\Modern UI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Variables\n\n  Var StartMenuFolder\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  \n  ;Start Menu Folder Page Configuration\n  !define MUI_STARTMENUPAGE_REGISTRY_ROOT \"HKCU\" \n  !define MUI_STARTMENUPAGE_REGISTRY_KEY \"Software\\Modern UI Test\" \n  !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n  \n  !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder\n  \n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n  \n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    \n    ;Create shortcuts\n    CreateDirectory \"$SMPROGRAMS\\$StartMenuFolder\"\n    CreateShortcut \"$SMPROGRAMS\\$StartMenuFolder\\Uninstall.lnk\" \"$INSTDIR\\Uninstall.exe\"\n  \n  !insertmacro MUI_STARTMENU_WRITE_END\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n  \n  !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder\n    \n  Delete \"$SMPROGRAMS\\$StartMenuFolder\\Uninstall.lnk\"\n  RMDir \"$SMPROGRAMS\\$StartMenuFolder\"\n  \n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/Modern UI/WelcomeFinish.nsi",
    "content": ";NSIS Modern User Interface\n;Welcome/Finish Page Example Script\n;Written by Joost Verburg\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUI2.nsh\"\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"Modern UI Test\"\n  OutFile \"WelcomeFinish.exe\"\n  Unicode True\n\n  ;Default installation folder\n  InstallDir \"$LOCALAPPDATA\\Modern UI Test\"\n\n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\Modern UI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_PAGE_FINISH\n\n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  !insertmacro MUI_UNPAGE_FINISH\n\n;--------------------------------\n;Languages\n\n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n\n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/ModernXL.nsi",
    "content": "\n/****************************************************************\n\tThis script generates a ModernXL demo installer\n*****************************************************************/\n\n; External definitions:\n; BUILD_MODERN       | Build a Modern UI (default NSIS UI)\n; BUILD_MODERN_XL    | Build a \"Modern XL\" UI installer\n; BUILD_MODERN_XXL   | Build a \"Modern XXL\" UI installer\n\nTarget x86-unicode\n\nInstallDir \"$DESKTOP\"\t; No files will be actually written\n\nManifestDPIAware true\nRequestExecutionLevel user\n\n!ifdef BUILD_MODERN_XXL\n\n# Modern XXL UI (fits 1024*768 and higher resolutions)\nName     \"ModernXXL Demo\"\nOutFile  \"ModernXXL.exe\"\n!include \"ModernXXL.nsh\"\n\n!else ifdef BUILD_MODERN\n\n# Modern UI (NSIS default)\nName     \"Modern UI Demo\"\nOutFile  \"Modern.exe\"\n\n!else\n\n# ModernXL UI (fits 800*600 and higher resolutions)\nName     \"ModernXL Demo\"\nOutFile  \"ModernXL.exe\"\n!include \"ModernXL.nsh\"\n\n!endif\n\n!include \"MUI2.nsh\"\n\n!define MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis-menu.ico\"\n!define MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis3-uninstall.ico\"\n\n!define MUI_WELCOMEPAGE_TITLE_3LINES\n\n;!define MUI_LICENSEPAGE_CHECKBOX\n;!define MUI_LICENSEPAGE_RADIOBUTTONS\n\n!define MUI_COMPONENTSPAGE_SMALLDESC\n;!define MUI_COMPONENTSPAGE_NODESC\n\n!define MUI_FINISHPAGE_NOAUTOCLOSE\n!define MUI_UNFINISHPAGE_NOAUTOCLOSE\n\n!define MUI_FINISHPAGE_TITLE_3LINES\n!define MUI_FINISHPAGE_RUN \"https://nsis.sourceforge.io/Category:Code_Examples\"\n!define MUI_FINISHPAGE_RUN_NOTCHECKED\n!define MUI_FINISHPAGE_SHOWREADME \"https://nsis.sourceforge.io/License\"\n!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED\n!define MUI_FINISHPAGE_LINK \"See more NSIS tutorials\"\n!define MUI_FINISHPAGE_LINK_LOCATION \"https://nsis.sourceforge.io/Category:Tutorials\"\n\nVar StartMenuFolder\n\n!insertmacro MUI_PAGE_WELCOME\n!insertmacro MUI_PAGE_LICENSE \"${__FILE__}\"\n!insertmacro MUI_PAGE_COMPONENTS\n!insertmacro MUI_PAGE_DIRECTORY\n!insertmacro MUI_PAGE_STARTMENU \"$(^Name)\" $StartMenuFolder\n!insertmacro MUI_PAGE_INSTFILES\n!insertmacro MUI_PAGE_FINISH\n\n!insertmacro MUI_LANGUAGE \"Arabic\"\n!insertmacro MUI_LANGUAGE \"Armenian\"\n!insertmacro MUI_LANGUAGE \"Bulgarian\"\n!insertmacro MUI_LANGUAGE \"English\"\n!insertmacro MUI_LANGUAGE \"Farsi\"\n!insertmacro MUI_LANGUAGE \"French\"\n!insertmacro MUI_LANGUAGE \"German\"\n!insertmacro MUI_LANGUAGE \"Greek\"\n!insertmacro MUI_LANGUAGE \"Hebrew\"\n!insertmacro MUI_LANGUAGE \"Hindi\"\n!insertmacro MUI_LANGUAGE \"Japanese\"\n!insertmacro MUI_LANGUAGE \"Mongolian\"\n!insertmacro MUI_LANGUAGE \"Pashto\"\n!insertmacro MUI_LANGUAGE \"Romanian\"\n!insertmacro MUI_LANGUAGE \"Russian\"\n!insertmacro MUI_LANGUAGE \"SimpChinese\"\n!insertmacro MUI_LANGUAGE \"Spanish\"\n!insertmacro MUI_LANGUAGE \"Thai\"\n!insertmacro MUI_LANGUAGE \"TradChinese\"\n!insertmacro MUI_LANGUAGE \"Vietnamese\"\n\n\nFunction .onInit\n\t!insertmacro MUI_LANGDLL_DISPLAY\nFunctionEnd\n\nInstType \"Full\"   IT_FULL\nInstType \"Group1\" IT_GROUP1\nInstType \"Group2\" IT_GROUP2\nInstType \"Group3\" IT_GROUP3\n\nSectionGroup /e \"Group 1\" Group1\nSection \"Feature 1.1\" Section11\n\tSectionInstType ${IT_FULL} ${IT_GROUP1}\n\tDetailPrint \"${__SECTION__}\"\nSectionEnd\nSection \"Feature 1.2\" Section12\n\tSectionInstType ${IT_FULL} ${IT_GROUP1}\n\tDetailPrint \"${__SECTION__}\"\nSectionEnd\nSectionGroupEnd\n\nSectionGroup /e \"Group 2\" Group2\nSection \"Feature 2.1\" Section21\n\tSectionInstType ${IT_FULL} ${IT_GROUP2}\n\tDetailPrint \"${__SECTION__}\"\nSectionEnd\nSection \"Feature 2.2\" Section22\n\tSectionInstType ${IT_FULL} ${IT_GROUP2}\n\tDetailPrint \"${__SECTION__}\"\nSectionEnd\nSectionGroupEnd\n\nSectionGroup /e \"Group 3\" Group3\nSection \"Feature 3.1\" Section31\n\tSectionInstType ${IT_FULL} ${IT_GROUP3}\n\tDetailPrint \"${__SECTION__}\"\nSectionEnd\nSection \"Feature 3.2\" Section32\n\tSectionInstType ${IT_FULL} ${IT_GROUP3}\n\tDetailPrint \"${__SECTION__}\"\nSectionEnd\nSectionGroupEnd\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${Group1}    \"Description of group 1\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section11} \"Description of feature 1.1\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section12} \"Description of feature 1.2\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Group2}    \"Description of group 2\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section21} \"Description of feature 2.1\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section22} \"Description of feature 2.2\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Group3}    \"Description of group 3\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section31} \"Description of feature 3.1\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${Section32} \"Description of feature 3.2\"\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n"
  },
  {
    "path": "setup/nsis/tools/Examples/NSISMenu.nsi",
    "content": "OutFile \"NSIS.exe\"\nName \"NSIS Menu\"\nUnicode True\nRequestExecutionLevel User\nXPStyle On\nManifestDPIAware System\nSetCompressor LZMA\nChangeUI IDD_INST \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe\"\nIcon \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis-menu.ico\"\nBrandingText \" \"\nMiscButtonText \" \" \" \" \" \" \" \"\nInstallButtonText \" \"\nCompletedText \" \"\nLangString ^ClickInstall 0 \" \"\nCaption \"$(^Name)\"\n\n!macro UNPACKVERFIELD out in shr mask fmt\n!define /redef /math ${out} ${in} >>> ${shr}\n!define /redef /math ${out} ${${out}} & ${mask}\n!define /redef /intfmt ${out} \"${fmt}\" ${${out}}\n!macroend\n\n!ifndef VER_MAJOR & VER_MINOR\n!ifdef NSIS_PACKEDVERSION\n!insertmacro UNPACKVERFIELD VER_MAJOR ${NSIS_PACKEDVERSION} 24 0x0ff \"%X\"\n!insertmacro UNPACKVERFIELD VER_MINOR ${NSIS_PACKEDVERSION} 12 0xfff \"%X\"\n!insertmacro UNPACKVERFIELD VER_REVISION ${NSIS_PACKEDVERSION} 4 255 \"%X\"\n!insertmacro UNPACKVERFIELD VER_BUILD ${NSIS_PACKEDVERSION} 00 0x00f \"%X\"\n!endif\n!endif\n!ifdef VER_MAJOR & VER_MINOR\n!define /ifndef VER_REVISION 0\n!define /ifndef VER_BUILD 0\n!searchreplace VERSTR \"${NSIS_VERSION}\" \"v\" \"\"\nVIProductVersion ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}\nVIAddVersionKey \"ProductName\" \"NSIS\"\nVIAddVersionKey \"ProductVersion\" \"${VERSTR}\"\nVIAddVersionKey \"FileVersion\" \"${VERSTR}\"\nVIAddVersionKey \"FileDescription\" \"NSIS Menu\"\nVIAddVersionKey \"LegalCopyright\" \"http://nsis.sf.net/License\"\n!endif\n\n!include nsDialogs.nsh\n!include WinMessages.nsh\n!include LogicLib.nsh\n!define /IfNDef IDC_CHILDRECT 1018\n!define QUIT_ON_EXECUTE\n!define PR $ExeDir ; Local root path\n!define PD \"Docs\" ; Local with WWW fallback (located at the same relative path)\n!define WWW \"http://nsis.sf.net\"\n\n!define CB_HEADER '0x755585 0x222222'\n!define UY_HEADER 28\n!define CT_PAGE '0x000000 0xaaaaaa'\n!define CB_PAGE '0xffffff 0x111111'\n!define CT_SECTION '0x666666 0xeeeeee'\n!define CB_SECTION '${CB_PAGE}'\n!define UY_SECTION 11 ; Height of a section\n!define UY_SECTIONBPAD 2 ; Extra padding on the bottom of section headers\n!define UY_TXT 9 ; Height of a normal item\n!define UY_TXTBPAD 1 ; Extra padding on the bottom of normal items\n!define UX_COLPAD 7 ; Spacing between columns\n!define UY_ROW2 104 ; Absolute position of the 2nd row\n!define CT_LINK '0x0c6e97 0x0c6e97' ; SYSCLR:HOTLIGHT\n!define /Math UX_PAGE 00 + ${UX_COLPAD}\n!define /Math UY_PAGE ${UY_HEADER} + 20\n!define UX ${UX_PAGE}\n!define CB_FOOTERLINE '0xc4c4c4 0x333333'\n!define CT_FOOTER '0xbbbbbb 0x444444'\n\nVar UseLightTheme\n\nFunction .onGUIInit\nReadRegDWORD $UseLightTheme HKCU \"Software\\NSIS\" \"UseLightTheme\"\nStrCmp $UseLightTheme \"\" 0 +2\nReadRegDWORD $UseLightTheme HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize\" \"AppsUseLightTheme\"\nStrCmp $UseLightTheme \"\" 0 +2\nStrCpy $UseLightTheme 1 ; Default\n\nStrCmp $UseLightTheme \"0\" 0 +5\nSystem::Call 'DWMAPI::DwmSetWindowAttribute(p$hWndParent,i20,*i1,i4)i.r0' ; 20H1\nIntCmp $0 0 +3 +3\nSystem::Call 'DWMAPI::DwmSetWindowAttribute(p$hWndParent,i19,*i1,i4)i.r0' ; ; 19H1\nSystem::Call 'USER32::SetProp(p$hWndParent,t\"UseImmersiveDarkModeColors\",i1)' ; 1809\nFunctionEnd\n\n!define SetCtlColors \"!insertmacro SetCtlColors \"\n!macro SetCtlColors hWnd ctlig ctdar cblig cbdar\nStrCmp $UseLightTheme \"0\" 0 +3\nSetCtlColors ${hWnd} \"${ctdar}\" ${cbdar}\nGoto +2\nSetCtlColors ${hWnd} \"${ctlig}\" ${cblig}\n!macroend\n\n\nFunction PageLeave\nSystem::Call 'USER32::GetFocus()p.r0'\nSystem::Call 'USER32::GetDlgCtrlID(pr0)i.r1'\nSystem::Call 'USER32::GetParent(pr0)p.r2'\nSendMessage $2 ${WM_COMMAND} $1 $0 ; Handle <ENTER> in dialog by pretending it was a click on the active control\nAbort\nFunctionEnd\n\nFunction PageCreate\nGetDlgItem $0 $hWndParent 1\nShowWindow $0 0\nGetDlgItem $0 $hWndParent 2\nShowWindow $0 0\n\nSystem::Call 'USER32::GetClientRect(p$hWndParent,@r0)'\nSystem::Call '*$0(i,i,i.r3,i.r4)'\nGetDlgItem $0 $hWndParent ${IDC_CHILDRECT}\nSystem::Call 'USER32::MoveWindow(pr0,i0,i0,ir3,ir4,i0)'\n\nnsDialogs::Create ${IDC_CHILDRECT}\nPop $R9\n${SetCtlColors} $R9 ${CT_PAGE} ${CB_PAGE}\n\n!macro StartColumn W\n!define /ReDef UY ${UY_PAGE}\n!define /ReDef UX_W ${W}\n!ifdef UX_INTERNAL_PREV_W\n!define /ReDef /Math UX ${UX} + ${UX_INTERNAL_PREV_W}\n!define /ReDef /Math UX ${UX} + ${UX_COLPAD}\n!define /ReDef UX_INTERNAL_PREV_W ${UX_W}\n!else\n!define /Math UX_INTERNAL_PREV_W 0 + ${UX_W}\n!endif\n!macroend\n!macro CreateHeader Txt W\n!define /ReDef /Math W ${W} + 4 ; Make it slightly wider\n${NSD_CreateLabel} ${UX}u ${UY}u ${W}u ${UY_SECTION}u \"${Txt}\"\nPop $0\n${SetCtlColors} $0 ${CT_SECTION} transparent transparent\nSendMessage $0 ${WM_SETFONT} ${HF_HEADER} 1\n!define /ReDef /Math UY ${UY} + ${UY_SECTION}\n!define /ReDef /Math UY ${UY} + ${UY_SECTIONBPAD}\n!macroend\n!macro CreateControl Class Txt W H\n${NSD_Create${Class}} ${UX}u ${UY}u ${W}u ${H}u \"${Txt}\"\n!define /ReDef /Math UY ${UY} + ${H}\n!define /ReDef /Math UY ${UY} + ${UY_TXTBPAD}\n!macroend\n!macro CreateSimpleLinkHelper Txt Url W\n!insertmacro CreateControl Link \"${Txt}|${Url}\" ${W} ${UY_TXT}\n!macroend\n!macro CreateSimpleLink Txt Url W\n!insertmacro CreateSimpleLinkHelper \"${Txt}\" \"${Url}\" ${W}\nCall ConfigureLink\n!macroend\n\n\n; --- Header ---\n!define HF_HEADER $R8\nCreateFont ${HF_HEADER} \"Arial\" ${UY_SECTION} 700\n\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE} ${__NSD_Label_EXSTYLE} 33u 0 -33u ${UY_HEADER}u \"\"\nPop $0\n${SetCtlColors} $0 0xffffff 0xffffff ${CB_HEADER}\n\n; CCv5 does not paint the background outside of the icon correctly when SS_CENTERIMAGE is used so we have to overlay a small icon on top of the background\nnsDialogs::CreateControl ${__NSD_Icon_CLASS} ${__NSD_Icon_STYLE} ${__NSD_Icon_EXSTYLE} 4u 4u 33u ${UY_HEADER}u \"\"\nPop $0\n${SetCtlColors} $0 \"\" \"\" ${CB_HEADER}\n${NSD_SetIconFromInstaller} $0 $1\nnsDialogs::CreateControl ${__NSD_Icon_CLASS} ${__NSD_Icon_STYLE}|${SS_CENTERIMAGE}|${SS_CENTER} ${__NSD_Icon_EXSTYLE} 0 0 33u ${UY_HEADER}u \"\"\nPop $0\n${SetCtlColors} $0 \"\" \"\" ${CB_HEADER}\n\nCreateFont $1 \"Trebuchet MS\" 17\n!searchreplace VERSTR \"${NSIS_VERSION}\" \"v\" \"\"\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE}|${SS_CENTERIMAGE}|${SS_ENDELLIPSIS} ${__NSD_Label_EXSTYLE} 34u 1u -34u ${UY_HEADER}u \"nullsoft scriptable install system ${VERSTR}\"\nPop $0\nSetCtlColors $0 0x3A2A42 transparent\nSendMessage $0 ${WM_SETFONT} $1 1\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE}|${SS_CENTERIMAGE}|${SS_ENDELLIPSIS} ${__NSD_Label_EXSTYLE} 33u 0 -33u ${UY_HEADER}u \"nullsoft scriptable install system ${VERSTR}\"\nPop $0\nSetCtlColors $0 0xffffff transparent\nSendMessage $0 ${WM_SETFONT} $1 1\n\n\n; --- Page ---\n!insertmacro StartColumn 90\n!insertmacro CreateHeader \"Compiler\" ${UX_W}\n!insertmacro CreateSimpleLink \"Compile NSI scripts\" \"${PR}\\MakeNSISW\" ${UX_W}\n!insertmacro CreateSimpleLink \"Installer based on .ZIP file\" \"${PR}\\bin\\Zip2Exe\" ${UX_W}\n\n\n!define /ReDef UY ${UY_ROW2}\n!insertmacro CreateHeader \"Developer Center\" ${UX_W}\n!define /ReDef UY_MULTILINE 42\n!insertmacro CreateControl Label \"Many more examples, tutorials, plug-ins and NSIS-related software are available at the online Developer Center.\" ${UX_W} ${UY_MULTILINE}\nPop $0\n${SetCtlColors} $0 ${CT_PAGE} ${CB_PAGE}\n\n\n!insertmacro StartColumn 80\n!insertmacro CreateHeader \"Documentation\" ${UX_W}\n!insertmacro CreateSimpleLink \"NSIS Users Manual\" \"${PR}\\NSIS.chm|${WWW}/Docs/\" ${UX_W}\n!insertmacro CreateSimpleLink \"Example scripts\" \"${PR}\\Examples|${WWW}/Examples\" ${UX_W}\n!insertmacro CreateSimpleLink \"Modern UI 2\" \"${PD}\\Modern UI 2\\Readme.html\" ${UX_W}\n\n\n!define /ReDef UY ${UY_ROW2}\n!insertmacro CreateHeader \"Online Help\" ${UX_W}\n!insertmacro CreateSimpleLink \"Developer Center\" \"${WWW}/Developer_Center\" ${UX_W}\n!insertmacro CreateSimpleLink \"FAQ\" \"${WWW}/FAQ\" ${UX_W}\n!insertmacro CreateSimpleLink \"Forum\" \"http://forums.winamp.com/forumdisplay.php?forumid=65\" ${UX_W}\n;\"Project Tracker\" \"http://sourceforge.net/tracker/?group_id=22049\"\n!insertmacro CreateSimpleLink \"Bug Tracker\" \"http://sourceforge.net/tracker/?group_id=22049&atid=373085\" ${UX_W}\n!insertmacro CreateSimpleLink \"Stackoverflow\" \"http://stackoverflow.com/questions/tagged/nsis\" ${UX_W}\n!insertmacro CreateSimpleLink \"Chat\" \"${WWW}/r/Chat\" ${UX_W}\n;insertmacro CreateSimpleLink \"IRC channel\" \"irc://irc.landoleet.org/nsis\" ${UX_W}\n;\"Pastebin\" \"http://nsis.pastebin.com/index/1FtyKP89\"\n;\"Search\" \"http://www.google.com/cse/home?cx=005317984255499820329:c_glv1-6a6a\"\n\n\n!insertmacro StartColumn 130\n!insertmacro CreateHeader \"Plug-ins\" ${UX_W}\n!macro CreatePluginLink Name Desc Url\n!define /ReDef SAVE_UY ${UY}\n!insertmacro CreateSimpleLinkHelper \"${Name}\" \"${Url}\" ${UX_W} ; AdjustLinkPair will configure this link\n!define /ReDef UY ${SAVE_UY}\n!insertmacro CreateControl Label \"${Name} - ${Desc}\" ${UX_W} ${UY_TXT}\nCall AdjustLinkPair\n!macroend\n!insertmacro CreatePluginLink \"AdvSplash\" \"splash with fade in/out\"     \"${PD}\\AdvSplash\\advsplash.txt\"\n!insertmacro CreatePluginLink \"Banner\"    \"banner with custom text\"     \"${PD}\\Banner\\Readme.txt\"\n!insertmacro CreatePluginLink \"BgImage\"   \"background image\"            \"${PD}\\BgImage\\BgImage.txt\"\n!insertmacro CreatePluginLink \"Dialer\"    \"internet connection\"         \"${PD}\\Dialer\\Dialer.txt\"\n!insertmacro CreatePluginLink \"Math\"      \"math operations\"             \"${PD}\\Math\\Math.txt\"\n!insertmacro CreatePluginLink \"nsDialogs\" \"custom wizard pages\"         \"${PD}\\nsDialogs\\Readme.html\"\n!insertmacro CreatePluginLink \"nsExec\"    \"launch command line tools\"   \"${PD}\\nsExec\\nsExec.txt\"\n!insertmacro CreatePluginLink \"NSISdl\"    \"download files\"              \"${PD}\\NSISdl\\Readme.txt\"\n!insertmacro CreatePluginLink \"Splash\"    \"splash screen\"               \"${PD}\\Splash\\splash.txt\"\n!insertmacro CreatePluginLink \"StartMenu\" \"Start Menu folder selection\" \"${PD}\\StartMenu\\Readme.txt\"\n!insertmacro CreatePluginLink \"System\"    \"Windows API calls\"           \"${PD}\\System\\System.html\"\n!insertmacro CreatePluginLink \"VPatch\"    \"update existing files\"       \"${PD}\\VPatch\\Readme.html\"\n\n\n; --- Footer ---\n${NSD_CreateLabel} 0 -22u 100% 1 \"\"\nPop $0\n${SetCtlColors} $0 000000 000000 ${CB_FOOTERLINE}\n\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE}|${SS_CENTERIMAGE}|${SS_NOTIFY} ${__NSD_Label_EXSTYLE} -110u -20u 100% 20u \"nsis.sourceforge.net\"\nPop $0\n${SetCtlColors} $0 ${CT_FOOTER} transparent transparent\nSendMessage $0 ${WM_SETFONT} ${HF_HEADER} 1\nnsDialogs::SetUserData $0 \"https://nsis.sourceforge.io\"\n${NSD_OnClick} $0 OnLinkClick\n\nnsDialogs::Show\nFunctionEnd\n\nFunction OnLinkClick\nPop $1 ; HWND\nnsDialogs::GetUserData $1\nCall SplitPipe\nPop $0 ; First URL in UserData from SplitPipe\nStrCpy $3 \"\"\nStrCpy $1 $0 4 ; Copy length of ${PD}\n${IfThen} $1 == \"${PD}\" ${|} StrCpy $3 \"${PR}\\\" ${|}\n!ifdef QUIT_ON_EXECUTE\nSystem::Call 'USER32::GetKeyState(i0x11)i.r9' ; VK_CONTROL\n!endif\nClearErrors\nExecShell \"\" \"$3$0\"\nPop $1 ; ... the rest of SplitPipe ...\n${If} $1 != \"\"  ; ... might contain a fallback location\n\tStrCpy $0 $1\n\tStrCpy $3 \"\"\n${ElseIf} $3 != \"\" ; Local docs path failed, use WWW fallback\n\tStrCpy $3 0\n\tslashconvloop:\n\t\tStrCpy $2 $0 1 $3\n\t\t${If} $2 == \"\\\"\n\t\t\tStrCpy $2 $0 $3\n\t\t\tIntOp $3 $3 + 1\n\t\t\tStrCpy $0 $0 \"\" $3\n\t\t\tStrCpy $0 \"$2/$0\"\n\t\t${Else}\n\t\t\tIntOp $3 $3 + 1\n\t\t${EndIf}\n\t\tStrCmp $2 \"\" 0 slashconvloop\n\tStrCpy $3 \"${WWW}/\"\n${EndIf}\n${If} \"$3$1\" != \"\"\n${AndIf} ${Errors}\n\tExecShell \"\" \"$3$0\"\n${EndIf}\n${If} ${Errors}\n\t!ifdef QUIT_ON_EXECUTE\n\tStrCpy $9 0 ; Don't allow close\n\t!endif\n\tMessageBox MB_IconStop 'Error: Unable to open \"$0\"!'\n${EndIf}\n!ifdef QUIT_ON_EXECUTE\n${IfThen} $9 < 0 ${|} SendMessage $hWndParent ${WM_CLOSE} 0 0 ${|}\n!endif\nFunctionEnd\n\nFunction ConfigureLink\nPop $1 ; HWND\n${NSD_OnClick} $1 OnLinkClick\n${SetCtlColors} $1 ${CT_LINK} ${CB_PAGE}\n${NSD_GetText} $1 $4\nPush $4\nCall SplitPipe\nPop $4\nPop $2\n${NSD_SetText} $1 $4\nnsDialogs::SetUserData $1 $2\nSystem::Call 'USER32::GetDC(pr1)p.r3'\nSendMessage $1 ${WM_GETFONT} 0 0 $5\nSystem::Call 'GDI32::SelectObject(pr3,pr5)p.s'\nStrLen $5 $4\nSystem::Call 'GDI32::GetTextExtentPoint32(pr3,tr4,ir5,@r5)'\nSystem::Call '*$5(i.r6)'\nSystem::Call 'GDI32::SelectObject(pr3,ps)'\nSystem::Call 'USER32::ReleaseDC(pr1,pr3)'\nSystem::Call 'USER32::GetWindowRect(pr1,@r3)'\nSystem::Call '*$3(i,i.r5,i,i.r7)'\nIntOp $7 $7 - $5\nIntOp $6 $6 + 4 ; Padding for focus rect\nSystem::Call 'USER32::SetWindowPos(pr1,p,i,i,ir6,ir7,i0x16)'\nFunctionEnd\n\nFunction AdjustLinkPair\nPop $2 ; Label\n${SetCtlColors} $2 ${CT_PAGE} ${CB_PAGE}\nCall ConfigureLink\nFunctionEnd\n\nFunction SplitPipe\nExch $0\nPush $1\nPush $2\nStrCpy $2 0\nfindSep:\nStrCpy $1 $0 1 $2\nIntOp $2 $2 + 1\nStrCmp $1 \"\" +2\nStrCmp $1 \"|\" \"\" findSep\nStrCpy $1 $0 \"\" $2\nIntOp $2 $2 - 1\nStrCpy $0 $0 $2\nPop $2\nExch $1\nExch\nExch $0\nFunctionEnd\n\nSection\nSectionEnd\n\nPage Custom PageCreate PageLeave\n!pragma warning disable 8000 ; Page instfiles not used"
  },
  {
    "path": "setup/nsis/tools/Examples/NScurl/NScurl-Test-build.bat",
    "content": "REM :: Marius Negrutiu :: 2019/08/25\n@echo off\nSetLocal EnableDelayedExpansion\n\nif not exist \"%NSIS%\\makensis.exe\" pushd \"%~dp0..\\..\" && set NSIS=!CD!&& popd\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%NSIS_INSTDIR%\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%PROGRAMFILES%\\NSIS\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%PROGRAMFILES(X86)%\\NSIS\nif not exist \"%NSIS%\\makensis.exe\" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2\n\necho ********************************************************************************\necho %NSIS%\\makensis.exe\necho ********************************************************************************\n\nTitle Build: amd64-unicode\n\"%NSIS%\\makensis.exe\" /V4 /DAMD64 \"%~dp0\\NScurl-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n\nTitle Build: x86-ansi\n\"%NSIS%\\makensis.exe\" /V4 /DANSI \"%~dp0\\NScurl-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n\nTitle Build: x86-unicode\n\"%NSIS%\\makensis.exe\" /V4 \"%~dp0\\NScurl-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n"
  },
  {
    "path": "setup/nsis/tools/Examples/NScurl/NScurl-Test.nsi",
    "content": "\n# NScurl demo\n# Marius Negrutiu - https://github.com/negrutiu/nsis-nscurl\n\n!ifdef AMD64\n\t!define _TARGET_ amd64-unicode\n!else ifdef ANSI\n\t!define _TARGET_ x86-ansi\n!else\n\t!define _TARGET_ x86-unicode\t\t; Default\n!endif\n\nTarget ${_TARGET_}\n\n!if /fileexists \"${NSISDIR}\\Include\\ModernXXL.nsh\"\n\t!include \"ModernXXL.nsh\"\t\t; Available in the NSIS fork from https://github.com/negrutiu/nsis\n!endif\n!include \"MUI2.nsh\"\n!define LOGICLIB_STRCMP\n!include \"LogicLib.nsh\"\n!include \"Sections.nsh\"\n\n!define /ifndef NULL 0\n!define TEST_FILE \"$SYSDIR\\lz32.dll\"\t\t; ...random file that exists in every Windows build\n\n# NScurl.dll development location\n!ifdef DEVEL\n!if ! /FileExists \"..\\Release-mingw-${_TARGET_}\\NScurl.dll\"\n\t!error \"Missing \\Release-mingw-${_TARGET_}\\NScurl.dll\"\n!endif\n!AddPluginDir /amd64-unicode \"..\\Release-mingw-amd64-unicode\"\n!AddPluginDir /x86-unicode   \"..\\Release-mingw-x86-unicode\"\n!AddPluginDir /x86-ansi      \"..\\Release-mingw-x86-ansi\"\n!endif\n\n# GUI settings\n!define /ifndef MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\orange-install-nsis.ico\"\n!define /ifndef MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp\"\n\n# Welcome page\n;!define MUI_WELCOMEPAGE_TITLE_3LINES\n;!insertmacro MUI_PAGE_WELCOME\n\n# Components page\n!define INSTTYPE_NONE\t1\n!define INSTTYPE_MOST\t2\nInstType \"None\"\t\t\t; 1\nInstType \"Most\"\t\t\t; 2\n!define MUI_COMPONENTSPAGE_NODESC\n!insertmacro MUI_PAGE_COMPONENTS\n\n# Installation page\n!insertmacro MUI_PAGE_INSTFILES\n\n# Language\n!insertmacro MUI_LANGUAGE \"English\"\n;!insertmacro MUI_LANGUAGE \"Romanian\"\n!insertmacro MUI_RESERVEFILE_LANGDLL\n\n# Installer details\nName    \"NScurl-Test-${_TARGET_}\"\nOutFile \"NScurl-Test-${_TARGET_}.exe\"\nXPStyle on\nRequestExecutionLevel user\t\t; Don't require UAC elevation\nShowInstDetails show\nManifestDPIAware true\n\n#---------------------------------------------------------------#\n# .onInit                                                       #\n#---------------------------------------------------------------#\nFunction .onInit\n\n\t; Initializations\n\tInitPluginsDir\n\n\t; Language selection\n\t!define MUI_LANGDLL_ALLLANGUAGES\n\t!insertmacro MUI_LANGDLL_DISPLAY\n\n/*\n\t; .onInit download demo\n\t; NOTE: Transfers from .onInit can be either Silent or Popup (no Page!)\n\t!define /redef LINK  \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\"\n\t!define /redef FILE  \"$EXEDIR\\_SysinternalsSuiteLive_onInit.zip\"\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /POPUP /CANCEL /END\n\tPop $0\n*/\nFunctionEnd\n\n\nSection \"Cleanup test files\"\n\tSectionIn ${INSTTYPE_NONE} ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\tFindFirst $0 $1 \"$EXEDIR\\_*.*\"\nloop:\n\tStrCmp $1 \"\" done\n\tDelete \"$EXEDIR\\$1\"\n\tFindNext $0 $1\n\tGoto loop\ndone:\n\tFindClose $0\nSectionEnd\n\n\nSection \"Background (50 * put)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\tStrCpy $1 \"\"\n\t${For} $R0 1 50\n\t\tNScurl::http PUT \"https://httpbin.org/put\" \"Memory\" /DATA (file) \"${TEST_FILE}\" /BACKGROUND /INSIST /TAG \"parallels\" /END\n\t\tPop $0\n\t\tIntCmp $R0 1 +2 +1 +1\n\t\t\tStrCpy $1 \"$1, \"\n\t\tStrCpy $1 \"$1$0\"\n\t${Next}\n\tDetailPrint \"IDs = {$1}\"\nSectionEnd\n\n\nSection \"httpbin.org/get\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/get?param1=value1&param2=value2'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http get \"${LINK}\" \"${FILE}\" /HEADER \"Header1: Value1$\\r$\\nHeader2: Value2\" /HEADER \"Header3: Value3\" /REFERER \"https://test.com\" /END\n\tPop $0\n\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"sysinternals.com/get (Page)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK  \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\"\n\t!define /redef FILE  \"$EXEDIR\\_SysinternalsSuiteLive.zip\"\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http get \"${LINK}\" \"${FILE}\" /CANCEL /INSIST /Zone.Identifier /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"sysinternals.com/get (Popup)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK  \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\"\n\t!define /redef FILE  \"$EXEDIR\\_SysinternalsSuiteLive_Popup.zip\"\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http get \"${LINK}\" \"${FILE}\" /CANCEL /POPUP /INSIST /Zone.Identifier /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"sysinternals.com/get (Silent)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK  \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\"\n\t!define /redef FILE  \"$EXEDIR\\_SysinternalsSuiteLive_Silent.zip\"\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http get \"${LINK}\" \"${FILE}\" /CANCEL /SILENT /INSIST /Zone.Identifier /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"sysinternals.com/get (SpeedCap: 300KB/s)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK  \"http://live.sysinternals.com/Files/SysinternalsSuite.zip\"\n\t!define /redef FILE  \"$EXEDIR\\_SysinternalsSuiteLive_SpeedCap.zip\"\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http get \"${LINK}\" \"${FILE}\" /CANCEL /INSIST /SPEEDCAP 307200 /Zone.Identifier /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"httpbin.org/post (multipart/form-data)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/post?param1=value1&param2=value2'\n\t!define /redef FILE '$EXEDIR\\_POST_httpbin_multipart.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\t!define S1 \"<Your memory data here>\"\n\tStrLen $R1 \"${S1}\"\n\tSystem::Call '*(&m128 \"${S1}\") p.r10'\n\n\tNScurl::http \\\n\t\tPOST \\\n\t\t\"${LINK}\" \\\n\t\t\"${FILE}\" \\\n\t\t/HEADER \"Header1: Value1$\\r$\\nHeader2: Value2\" \\\n\t\t/HEADER \"Header3: Value3\" \\\n\t\t/POST \"filename=maiden.json\" \"type=application/json\" \"maiden.json\" '{ \"number_of_the_beast\" : 666 }' \\\n\t\t/POST \"Name\" \"<Your name here>\" \\\n\t\t/POST \"Password\" \"<Your password here>\" \\\n\t\t/POST \"filename=test.bin\" \"test.bin\" (file) \"${TEST_FILE}\" \\\n\t\t/POST \"filename=test2.bin\" \"test2.bin\" (file) \"${TEST_FILE}\" \\\n\t\t/POST \"type=application/octet-stream\" \"Binary\" (memory) $R0 $R1 \\\n\t\t/INSIST \\\n\t\t/REFERER \"https://test.com\" \\\n\t\t/END\n\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\n\tSystem::Free $R0\n\t!undef S1\n\nSectionEnd\n\n\nSection \"httpbin.org/post (application/x-www-form-urlencoded)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/post?param1=value1&param2=value2'\n\t!define /redef FILE '$EXEDIR\\_POST_httpbin_postfields.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http \\\n\t\tPOST \\\n\t\t\"${LINK}\" \\\n\t\t\"${FILE}\" \\\n\t\t/HEADER \"Header1: Value1$\\r$\\nHeader2: Value2\" \\\n\t\t/HEADER \"Header3: Value3\" \\\n\t\t/DATA 'User=Your+name+here&Password=Your+password+here' \\\n\t\t/INSIST \\\n\t\t/REFERER \"https://test.com\" \\\n\t\t/END\n\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"httpbin.org/post (application/json)\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/post?param1=value1&param2=value2'\n\t!define /redef FILE '$EXEDIR\\_POST_httpbin_json.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http \\\n\t\tPOST \\\n\t\t\"${LINK}\" \\\n\t\t\"${FILE}\" \\\n\t\t/HEADER \"Content-Type: application/json\" \\\n\t\t/DATA '{ \"number_of_the_beast\" : 666 }' \\\n\t\t/INSIST \\\n\t\t/REFERER \"https://test.com\" \\\n\t\t/END\n\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"httpbin.org/put\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/put?param1=value1&param2=value2'\n\t!define /redef FILE '$EXEDIR\\_PUT_httpbin.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http \\\n\t\tPUT \\\n\t\t\"${LINK}\" \\\n\t\t\"${FILE}\" \\\n\t\t/HEADER \"Header1: Value1$\\r$\\nHeader2: Value2\" \\\n\t\t/HEADER \"Header3: Value3\" \\\n\t\t/HEADER \"Content-Type: application/json\" \\\n\t\t/DATA '{ \"number_of_the_beast\" : 666 }' \\\n\t\t/INSIST \\\n\t\t/REFERER \"https://test.com\" \\\n\t\t/END\n\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"Big file (100MB)\"\n\t;SectionIn ${INSTTYPE_CUSTOM}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://speed.hetzner.de/100MB.bin'\n\t!define /redef FILE '$EXEDIR\\_GET_100MB.bin'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /CANCEL /RESUME /TITLEWND $HWNDPARENT /INSIST /TIMEOUT 30000 /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSection \"Big file (10GB)\"\n\t;SectionIn ${INSTTYPE_CUSTOM}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://speed.hetzner.de/10GB.bin'\n\t!define /redef FILE '$EXEDIR\\_GET_10GB.bin'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /CANCEL /RESUME /TITLEWND $HWNDPARENT /INSIST /TIMEOUT 30000 /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\n\nSectionEnd\n\n\nSectionGroup /e \"Errors\"\n\nSection \"httpbin.org/get/status/40x\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/status/400,401,402,403,404,405'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_40x.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /DEBUG \"${FILE}.md\" /INSIST /TIMEOUT 30s /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSection \"httpbin.org/post/status/40x\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/status/400,401,402,403,404,405'\n\t!define /redef FILE '$EXEDIR\\_POST_httpbin_40x.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http POST \"${LINK}\" \"${FILE}\" /DEBUG \"${FILE}.md\" /INSIST /TIMEOUT 30s /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSection \"httpbin.org/put/status/40x\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/status/400,401,402,403,404,405'\n\t!define /redef FILE '$EXEDIR\\_PUT_httpbin_40x.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\n\tNScurl::http PUT \"${LINK}\" \"${FILE}\" /DEBUG \"${FILE}.md\" /HEADER \"Content-Type: application/json\" /DATA '{ \"number_of_the_beast\" : 666 }' /INSIST /TIMEOUT 30s /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSectionGroupEnd\t\t\t; Errors\n\n\nSectionGroup /e \"Authentication\"\n\nSection \"httpbin.org/basic-auth\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/basic-auth/MyUser/MyPass'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_basic-auth.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /AUTH \"MyUser\" \"MyPass\" \"/DEBUG\" \"${FILE}.md\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection \"httpbin.org/hidden-basic-auth\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/hidden-basic-auth/MyUser/MyPass'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_hidden-basic-auth.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /AUTH \"type=basic\" \"MyUser\" \"MyPass\" \"/DEBUG\" \"${FILE}.md\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection \"httpbin.org/bearer\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/bearer'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_bearer.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /AUTH \"type=bearer\" \"MyOauth2Token\" \"/DEBUG\" \"${FILE}.md\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection \"httpbin.org/digest-auth/auth\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/digest-auth/auth/MyUser/MyPass/SHA-256'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_digest-auth.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /AUTH \"type=digest\" \"MyUser\" \"MyPass\" \"/DEBUG\" \"${FILE}.md\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection \"httpbin.org/digest-auth/auth-int\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/digest-auth/auth-int/MyUser/MyPass/SHA-256'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_digest-auth-int.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /AUTH \"MyUser\" \"MyPass\" \"/DEBUG\" \"${FILE}.md\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSectionGroupEnd\t\t; Authentication\n\n\nSectionGroup /e \"Proxy\"\n\nSection \"httpbin.org/get\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/get?param1=value1&param2=value2'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_proxy.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /PROXY \"http://136.243.47.220:3128\" \"/DEBUG\" \"${FILE}.md\" /END\t\t; Germany\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection \"httpbin.org/digest-auth/auth-int\"\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://httpbin.org/digest-auth/auth-int/MyUser/MyPass/SHA-256'\n\t!define /redef FILE '$EXEDIR\\_GET_httpbin_proxy_digest-auth-int.json'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /AUTH \"MyUser\" \"MyPass\" /PROXY \"http://136.243.47.220:3128\" \"/DEBUG\" \"${FILE}.md\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSectionGroupEnd\t\t; Proxy\n\n\nSectionGroup /e \"SSL Validation\"\n\nSection \"Expired certificate\"\n\tSectionIn ${INSTTYPE_MOST}\n\t\t\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://expired.badssl.com/'\n\t!define /redef FILE 'Memory'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSection \"Revoked certificate\"\n\tSectionIn ${INSTTYPE_MOST}\n\t\t\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://revoked.badssl.com/'\n\t!define /redef FILE 'Memory'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSection \"Self-signed certificate\"\n\tSectionIn ${INSTTYPE_MOST}\n\t\t\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://self-signed.badssl.com/'\n\t!define /redef FILE 'Memory'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSection \"Untrusted certificate\"\n\tSectionIn ${INSTTYPE_MOST}\n\t\t\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://untrusted-root.badssl.com/'\n\t!define /redef FILE 'Memory'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSection \"Wrong host\"\n\tSectionIn ${INSTTYPE_MOST}\n\t\t\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://wrong.host.badssl.com/'\n\t!define /redef FILE 'Memory'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSection \"HTTP public key pinning (HPKP)\"\n\tSectionIn ${INSTTYPE_MOST}\n\t\t\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t!define /redef LINK 'https://pinning-test.badssl.com/'\n\t!define /redef FILE 'Memory'\n\tDetailPrint 'NScurl::http \"${LINK}\" \"${FILE}\"'\n\tNScurl::http GET \"${LINK}\" \"${FILE}\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\nSectionGroupEnd\t\t; SSL Validation\n\n\nSection \"Wait for all\"\n\tSectionIn ${INSTTYPE_NONE} ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\tDetailPrint 'Waiting...'\n\tNScurl::wait /CANCEL /TITLEWND $HWNDPARENT /end\n\n\t; Print summary\n\tCall PrintAllRequests\n\nSectionEnd\n\n\nFunction PrintAllRequests\n\n\t; NScurl::enumerate\n\tNScurl::enumerate /END\n\t\n_enum_loop:\n\n\tStrCpy $0 \"\"\n\tPop $0\n\tStrCmp $0 \"\" _enum_end\n\n\tDetailPrint '[ID: $0] -----------------------------------------------'\n\n\tNScurl::query /ID $0 'Status: @Status@, @ERROR@, Percent: @PERCENT@%, Size: @XFERSIZE@, Speed: @SPEED@, Time: @TIMEELAPSED@, Tag: \"@TAG@\"'\n\tPop $1\n\tDetailPrint \"$1\"\n\n\tNScurl::query /ID $0 '@METHOD@ @URL@ -> @OUT@'\n\tPop $1\n\tDetailPrint \"$1\"\n\n\tNScurl::query /ID $0 'Request Headers: @SENTHEADERS@'\n\tPop $1\n\tDetailPrint \"$1\"\n\n\tNScurl::query /ID $0 'Reply Headers: @RECVHEADERS@'\n\tPop $1\n\tDetailPrint \"$1\"\n\n\tNScurl::query /ID $0 'Remote Content: @RECVDATA@'\n\tPop $1\n\tDetailPrint \"$1\"\n\n\tGoto _enum_loop\n_enum_end:\n\nFunctionEnd\n\n\nSectionGroup /e Extra\n\n\nSection Test\n\t;SectionIn ${INSTTYPE_CUSTOM}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\t; NScurl::echo\n\tNScurl::echo \"aaa\" bbb 1 0x2 /END\n\tPop $0\n\tDetailPrint 'NScurl::echo(...) = \"$0\"'\n\nSectionEnd\n\n\nSection Hashes\n\t;SectionIn ${INSTTYPE_CUSTOM}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\t!define S1 \"Hash this string\"\n\n\t; NScurl::md5 (file) filename\n\tNScurl::md5 (file) $EXEPATH\n\tPop $0\n\tDetailPrint 'NScurl::md5 (file) \"$EXEFILE\" = \"$0\"'\n\n\t; NScurl::md5 (string) string\n\tNScurl::md5 (string) \"${S1}\"\n\tPop $0\n\tDetailPrint 'NScurl::md5 (string) \"${S1}\" = \"$0\"'\n\n\t; NScurl::md5 (memory) ptr size\n\tStrLen $R1 \"${S1}\"\n\tSystem::Call '*(&m128 \"${S1}\") p.r10'\n\tIntFmt $R0 \"0x%Ix\" $R0\n\n\tNScurl::md5 (memory) $R0 $R1\n\tPop $0\n\tDetailPrint 'NScurl::md5 (memory) ($R0:\"${S1}\", $R1) = \"$0\"'\n\n\tSystem::Free $R0\n\n\t; NScurl::sha1\n\tNScurl::sha1 (file) $EXEPATH\n\tPop $0\n\tDetailPrint 'NScurl::sha1 (file) \"$EXEFILE\" = \"$0\"'\n\n\t; NScurl::sha256\n\tNScurl::sha256 (file) $EXEPATH\n\tPop $0\n\tDetailPrint 'NScurl::sha256 (file) \"$EXEFILE\" = \"$0\"'\n\n\t!undef S1\nSectionEnd\n\n\nSection \"Un/Escape\"\n\t;SectionIn ${INSTTYPE_CUSTOM}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\tStrCpy $R0 \"aaa bbb ccc=ddd&eee\"\n\tDetailPrint \"Original: $R0\"\n\n\tNScurl::escape $R0\n\tPop $1\n\tDetailPrint \"Escaped: $1\"\n\n\tNScurl::unescape $1\n\tPop $0\n\tDetailPrint \"Unescaped: $0\"\n\nSectionEnd\n\n\nSection About\n\tSectionIn ${INSTTYPE_MOST}\n\tDetailPrint '=====[ ${__SECTION__} ]==============================='\n\n\tNScurl::query \"NScurl/@PLUGINVERSION@\"\n\tPop $0\n\tDetailPrint '$0'\n\n\tNScurl::query \"    @PLUGINAUTHOR@\"\n\tPop $0\n\tDetailPrint '$0'\n\n\tNScurl::query \"    @PLUGINWEB@\"\n\tPop $0\n\tDetailPrint '$0'\n\n\tNScurl::query \"curl/@CURLVERSION@ @CURLSSLVERSION@\"\n\tPop $0\n\tDetailPrint '$0'\n\n\tNScurl::query \"    Protocols: @CURLPROTOCOLS@\"\n\tPop $0\n\tDetailPrint '$0'\n\n\tNScurl::query \"    Features: @CURLFEATURES@\"\n\tPop $0\n\tDetailPrint '$0'\n\n\tNScurl::query \"Agent: @USERAGENT@\"\n\tPop $0\n\tDetailPrint '$0'\nSectionEnd\n\n\nSectionGroupEnd\t\t; Extra\n"
  },
  {
    "path": "setup/nsis/tools/Examples/NSutils/NSutils-Test-build.bat",
    "content": "REM :: Marius Negrutiu :: 2019/08/25\n@echo off\nSetLocal EnableDelayedExpansion\n\nif not exist \"%NSIS%\\makensis.exe\" pushd \"%~dp0..\\..\" && set NSIS=!CD!&& popd\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%NSIS_INSTDIR%\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%PROGRAMFILES%\\NSIS\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%PROGRAMFILES(X86)%\\NSIS\nif not exist \"%NSIS%\\makensis.exe\" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2\n\necho ********************************************************************************\necho %NSIS%\\makensis.exe\necho ********************************************************************************\n\nTitle Build: amd64-unicode\n\"%NSIS%\\makensis.exe\" /V4 /DAMD64 \"%~dp0\\NSutils-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n\nTitle Build: x86-ansi\n\"%NSIS%\\makensis.exe\" /V4 /DANSI \"%~dp0\\NSutils-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n\nTitle Build: x86-unicode\n\"%NSIS%\\makensis.exe\" /V4 \"%~dp0\\NSutils-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n"
  },
  {
    "path": "setup/nsis/tools/Examples/NSutils/NSutils-Test.nsi",
    "content": "﻿\n!ifdef AMD64\n\t!define _TARGET_ amd64-unicode\n!else ifdef ANSI\n\t!define _TARGET_ x86-ansi\n!else\n\t!define _TARGET_ x86-unicode\t\t; Default\n!endif\n\nTarget ${_TARGET_}\n\n!include \"MUI2.nsh\"\n!include \"LogicLib.nsh\"\n!include \"x64.nsh\"\n!include \"FileFunc.nsh\"\n!include \"Win\\WinNT.nsh\"\n\n# NSutils.dll development location\n!ifdef DEVEL\n!if ! /FileExists \"..\\Release-mingw-${_TARGET_}\\NSutils.dll\"\n\t!error \"Missing \\Release-mingw-${_TARGET_}\\NSutils.dll\"\n!endif\n!AddPluginDir /amd64-unicode \"..\\Release-mingw-amd64-unicode\"\n!AddPluginDir /x86-unicode   \"..\\Release-mingw-x86-unicode\"\n!AddPluginDir /x86-ansi      \"..\\Release-mingw-x86-ansi\"\n!endif\n\n!define /ifndef TRUE 1\n!define /ifndef FALSE 0\n!define /ifndef ERROR_SUCCESS 0\n\n# GUI settings\n!define MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\orange-install-nsis.ico\"\n!define MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp\"\n\nSpaceTexts \"none\"\n!define MUI_COMPONENTSPAGE_NODESC\n!insertmacro MUI_PAGE_COMPONENTS\n\n!insertmacro MUI_PAGE_INSTFILES\n\n# Prepare strings\n!insertmacro MUI_LANGUAGE \"English\"\n\n# Installer details\nName    \"NSutils-Test-${_TARGET_}\"\nOutFile \"NSutils-Test-${_TARGET_}.exe\"\nXPStyle on\nRequestExecutionLevel user ; don't require UAC elevation\nManifestDPIAware true\nManifestSupportedOS all\nShowInstDetails show\n\n!define Print DetailPrint\n\n\nFunction .onInit\nFunctionEnd\n\nFunction PrintFileVersion\n\n\tPop $R0\t\t; The file name\n\n\t${Print} \"$R0\"\n\n\tNSutils::GetFileVersion \"$R0\"\n\tPop $0\n\t${Print} \"    FileVersion: $0 ($1,$2,$3,$4)\"\n\n\tNSutils::GetProductVersion \"$R0\"\n\tPop $0\n\t${Print} \"    ProductVersion: $0 ($1,$2,$3,$4)\"\n\n\tNSutils::GetVersionInfoString $R0 \"CompanyName\"\n\tPop $0\n\t${Print} \"    CompanyName: $0\"\n\n\tNSutils::GetVersionInfoString $R0 \"FileDescription\"\n\tPop $0\n\t${Print} \"    FileDescription: $0\"\n\n\tNSutils::GetVersionInfoString $R0 \"FileVersion\"\n\tPop $0\n\t${Print} \"    FileVersion: $0\"\n\n\tNSutils::GetVersionInfoString \"$R0\" \"InternalName\"\n\tPop $0\n\t${Print} \"    InternalName: $0\"\n\n\tNSutils::GetVersionInfoString $R0 \"LegalCopyright\"\n\tPop $0\n\t${Print} \"    LegalCopyright: $0\"\n\n\tNSutils::GetVersionInfoString \"$R0\" \"OriginalFilename\"\n\tPop $0\n\t${Print} \"    OriginalFilename: $0\"\n\n\tNSutils::GetVersionInfoString \"$R0\" \"ProductName\"\n\tPop $0\n\t${Print} \"    ProductName: $0\"\n\n\tNSutils::GetVersionInfoString \"$R0\" \"ProductVersion\"\n\tPop $0\n\t${Print} \"    ProductVersion: $0\"\n\nFunctionEnd\n\n\nSection /o \"Test version info\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\t${GetSize} \"$SYSDIR\" \"/M=Notepad.exe /S=0K /G=0\" $0 $1 $2\n\t${Print} \"    File system redirection: Enabled\"\n\t${Print} \"    FileSize: $0 KB\"\n\tPush \"$SYSDIR\\Notepad.exe\"\n\tCall PrintFileVersion\n\n\t${DisableX64FSRedirection}\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"    File system redirection: Disabled\"\n\t${GetSize} \"$SYSDIR\" \"/M=Notepad.exe /S=0K /G=0\" $0 $1 $2\n\t${Print} \"    FileSize: $0 KB\"\n\tPush \"$SYSDIR\\Notepad.exe\"\n\tCall PrintFileVersion\n\t${EnableX64FSRedirection}\n\nSectionEnd\n\n\nSection /o \"Test progress bar (default, steping back)\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"Looping with the default progress bar settings...\"\n\t${For} $R0 1 10\n\t\t${Print} \"    Step $R0/10 (default behavior, the progress bar is stepping back)\"\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t${Next}\n\nSectionEnd\n\n\nSection /o \"Test progress bar (fixed, no stepping back)\"\n\n\tNSutils::DisableProgressStepBack $mui.InstFilesPage.ProgressBar\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"Looping with DisableProgressStepBack...\"\n\t${For} $R0 1 10\n\t\t${Print} \"    Step $R0/10\"\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 100\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t\tSleep 10\n\t${Next}\n\tNSutils::RestoreProgressStepBack $mui.InstFilesPage.ProgressBar\n\nSectionEnd\n\n\nSection /o \"Test PendingFileRenameOperations (requires Admin)\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\n\tSystem::Call 'kernel32::CopyFile( t \"$SYSDIR\\Notepad.exe\", t \"$DESKTOP\\MyNotepad.exe\", i 0 ) i.r0'\n\t${Print} 'CopyFile( \"Notepad.exe\", \"DESKTOP\\MyNotepad.exe\" ) == $0'\n\n\t!define MOVEFILE_DELAY_UNTIL_REBOOT 0x4\n\tSystem::Call 'kernel32::MoveFileEx( t \"$DESKTOP\\MyNotepad.exe\", t \"$DESKTOP\\MyNotepad2.exe\", i ${MOVEFILE_DELAY_UNTIL_REBOOT} ) i.r0'\n\t${Print} 'MoveFileEx( \"DESKTOP\\MyNotepad.exe\", \"DESKTOP\\MyNotepad2.exe\", MOVEFILE_DELAY_UNTIL_REBOOT ) == $0'\n\n\tNSutils::ExecutePendingFileRenameOperations \"MyNotepad\" \"$EXEDIR\\PendingFileRename.log\"\n\tPop $0\t; Win32 error code\n\tPop $1\t; Win32 error code of the first failed operation\n\n\t${If} ${FileExists} \"$DESKTOP\\MyNotepad2.exe\"\n\t\t${Print} \"[SUCCESS] ExecutePendingFileRenameOperations ($$0 = $0, $$1 = $1)\"\n\t${Else}\n\t\t${Print} \"[ERROR] ExecutePendingFileRenameOperations ($$0 = $0, $$1 = $1)\"\n\t\t${If} $0 = 5\n\t\t\t${Print} \"[ERROR] Access is denied. Run as administrator!\"\n\t\t${EndIf}\n\t${EndIf}\n\n\tDelete \"$DESKTOP\\MyNotepad.exe\"\n\tDelete \"$DESKTOP\\MyNotepad2.exe\"\n\nSectionEnd\n\n\nSection /o \"Test FindFileRenameOperations\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\n\tStrCpy $R0 \"temp\"\t; Substring to find\n\tNSutils::FindPendingFileRenameOperations $R0\n\tPop $0\n\t${Print} 'FindPendingFileRenameOperations( \"$R0\" ) == \"$0\"'\n\n\n\tStrCpy $R0 \"*\"\t\t; Substring to find\n\tNSutils::FindPendingFileRenameOperations $R0\n\tPop $0\n\t${Print} 'FindPendingFileRenameOperations( \"$R0\" ) == \"$0\"'\n\nSectionEnd\n\n\nSection /o \"Test string table manipulation\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\n\tSystem::Call 'kernel32::CopyFile( t \"$EXEPATH\", t \"$DESKTOP\\MyTest.exe\", i 0 ) i.r0'\n\t${Print} 'CopyFile( \"$EXEPATH\", \"DESKTOP\\MyTest.exe\" ) == $0'\n\n\tNSutils::ReadResourceString \"$DESKTOP\\MyUser32.dll\" 100 1033\n\tPop $0\n\t${If} $0 == \"\"\n\t\t${Print} 'String #10: \"$0\". Ok!'\n\t${Else}\n\t\t${Print} 'String #10: \"$0\". Should have been empty!'\n\t${EndIf}\n\n\tNSutils::WriteResourceString \"$DESKTOP\\MyTest.exe\" 100 1033 \"Dela beat cârciumă vin / Merg pe gard, de drum mă țin\"\n\tPop $0\n\t${If} $0 = ${FALSE}\n\t\tStrCpy $0 \"ERROR\"\n\t${Else}\n\t\tStrCpy $0 \"SUCCESS\"\n\t${EndIf}\n\t${Print} 'Write #100: $0'\n\n\tNSutils::ReadResourceString \"$DESKTOP\\MyTest.exe\" 100 1033\n\tPop $0\n\t${If} $0 != \"\"\n\t\t${Print} 'String #100: \"$0\". Ok!'\n\t${Else}\n\t\t${Print} 'String #100: \"\". Should have been valid!'\n\t${EndIf}\n\n\tNSutils::WriteResourceString \"$DESKTOP\\MyTest.exe\" 100 1033 \"\"\n\tPop $0\n\t${If} $0 = ${FALSE}\n\t\tStrCpy $0 \"ERROR\"\n\t${Else}\n\t\tStrCpy $0 \"SUCCESS\"\n\t${EndIf}\n\t${Print} 'Delete #100: $0'\n\n\tNSutils::ReadResourceString \"$DESKTOP\\MyTest.exe\" 100 1033\n\tPop $0\n\t${If} $0 == \"\"\n\t\t${Print} 'String #10: \"$0\". Ok!'\n\t${Else}\n\t\t${Print} 'String #10: \"$0\". Should have been empty!'\n\t${EndIf}\n\n\tDelete \"$DESKTOP\\MyTest.exe\"\n\nSectionEnd\n\n\nSection /o \"Test close file handles\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\t${DisableX64FSRedirection}\n\n\t!define CREATE_NEW\t\t\t\t1\n\t!define CREATE_ALWAYS\t\t\t2\n\t!define OPEN_EXISTING\t\t\t3\n\t!define OPEN_ALWAYS\t\t\t\t4\n\n\t!define INVALID_HANDLE_VALUE\t-1\n\n\t;!define TESTFILE \"$TEMP\\test_close_handles.txt\"\n\t!define TESTFILE \"$SYSDIR\\drivers\\etc\\hosts\"\n\t${Print} \"TESTFILE = ${TESTFILE}\"\n\n\t; Open test file (handle1)\n\tSystem::Call 'kernel32::CreateFile( t \"${TESTFILE}\", i ${GENERIC_READ}, i ${FILE_SHARE_READ}, p 0, i ${OPEN_ALWAYS}, i ${FILE_ATTRIBUTE_NORMAL}, p 0 ) p.r10 ? e'\n\tPop $0\t; GetLastError\n\t${If} $R0 p<> ${INVALID_HANDLE_VALUE}\n\t\tStrCpy $0 0\n\t${EndIf}\n\t${Print} 'CreateFile( #1, TESTFILE ) = $0'\n\n\t; Open test file (handle2)\n\tSystem::Call 'kernel32::CreateFile( t \"${TESTFILE}\", i ${GENERIC_READ}, i ${FILE_SHARE_READ}, p 0, i ${OPEN_ALWAYS}, i ${FILE_ATTRIBUTE_NORMAL}, p 0 ) p.r11 ? e'\n\tPop $0\t; GetLastError\n\t${If} $R1 p<> ${INVALID_HANDLE_VALUE}\n\t\tStrCpy $0 0\n\t${EndIf}\n\t${Print} 'CreateFile( #2, TESTFILE ) = $0'\n\n\t; ----------------------------------\n\n\t${Print} 'Close TESTFILE file handles'\n\tNSutils::CloseFileHandles \"${TESTFILE}\"\n\tPop $0\n\t${Print} '  $0 handles closed'\n\n\t; ----------------------------------\n\n\t; Close test file (handle1)\n\tSystem::Call 'kernel32::CloseHandle( p r10 ) i.r1 ? e'\n\tPop $0\t; GetLastError\n\t${If} $1 <> ${FALSE}\n\t\tStrCpy $0 0\n\t${EndIf}\n\t${If} $0 = 6\n\t\t${Print} 'CloseHandle( #1, TESTFILE ) = $0 [CORRECT]'\n\t${Else}\n\t\t${Print} 'CloseHandle( #1, TESTFILE ) = $0 [INCORRECT]'\n\t${EndIf}\n\n\t; Close test file (handle2)\n\tSystem::Call 'kernel32::CloseHandle( p r11 ) i.r1 ? e'\n\tPop $0\t; GetLastError\n\t${If} $1 <> ${FALSE}\n\t\tStrCpy $0 0\n\t${EndIf}\n\t${If} $0 = 6\n\t\t${Print} 'CloseHandle( #2, TESTFILE ) = $0 [CORRECT]'\n\t${Else}\n\t\t${Print} 'CloseHandle( #2, TESTFILE ) = $0 [INCORRECT]'\n\t${EndIf}\n\n\t;Delete \"${TESTFILE}\"\n\n\t${EnableX64FSRedirection}\n\nSectionEnd\n\n\nSection /o \"Test REG_MULTI_SZ operations\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"REG_MULTI_SZ tests\"\n\n\tSetRegView 64\n\tDeleteRegValue HKCU \"Software\\MyCompany\" \"MyValue\"\n\tDeleteRegKey HKCU \"Software\\MyCompany\"\n\n\t; Insert\n\tNSutils::RegMultiSzInsertAfter \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"ccc\" \"\"\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzInsert( \"ccc\" after \"\" ) = $0'\n\n\tNSutils::RegMultiSzInsertBefore \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"bbb\" \"ccc\"\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzInsert( \"bbb\" before \"ccc\" ) = $0'\n\n\tNSutils::RegMultiSzInsertAfter \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"ddd\" \"ccc\"\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzInsert( \"ddd\" after \"ccc\" ) = $0'\n\n\tNSutils::RegMultiSzInsertAtIndex \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"aaa\" 0\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzInsert( \"ddd\" at index 0 ) = $0'\n\n\tNSutils::RegMultiSzInsertAtIndex \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"eee\" 4\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzInsert( \"eee\" at index 4 ) = $0'\n\n\t; Verify\n\t${For} $1 0 1000\n\t\tNSutils::RegMultiSzRead \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 $1\n\t\tPop $0\t; Win32 error\n\t\tPop $2\t; The substring\n\t\tIntFmt $0 \"0x%x\" $0\n\t\tStrCpy $3 \"\"\n\t\t${If} $0 = ${ERROR_SUCCESS}\n\t\t\t${If} $1 = 0\n\t\t\t\tStrCpy $3 \"[CORRECT]\"\n\t\t\t\tStrCmp $2 \"aaa\" +2 +1\n\t\t\t\t\tStrCpy $3 \"[INCORRECT]\"\n\t\t\t${ElseIf} $1 = 1\n\t\t\t\tStrCpy $3 \"[CORRECT]\"\n\t\t\t\tStrCmp $2 \"bbb\" +2 +1\n\t\t\t\t\tStrCpy $3 \"[INCORRECT]\"\n\t\t\t${ElseIf} $1 = 2\n\t\t\t\tStrCpy $3 \"[CORRECT]\"\n\t\t\t\tStrCmp $2 \"ccc\" +2 +1\n\t\t\t\t\tStrCpy $3 \"[INCORRECT]\"\n\t\t\t${ElseIf} $1 = 3\n\t\t\t\tStrCpy $3 \"[CORRECT]\"\n\t\t\t\tStrCmp $2 \"ddd\" +2 +1\n\t\t\t\t\tStrCpy $3 \"[INCORRECT]\"\n\t\t\t${ElseIf} $1 = 4\n\t\t\t\tStrCpy $3 \"[CORRECT]\"\n\t\t\t\tStrCmp $2 \"eee\" +2 +1\n\t\t\t\t\tStrCpy $3 \"[INCORRECT]\"\n\t\t\t${EndIf}\n\t\t${EndIf}\n\t\t${Print} '  RegMultiSzRead( $1 ) = $0: \"$2\" $3'\n\t\tIntCmp $0 ${ERROR_SUCCESS} +2 +1 +1\n\t\t\t${Break}\n\t${Next}\n\n\t; Delete\n\tNSutils::RegMultiSzDelete \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"ccc\" ${TRUE}\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzDelete( \"ccc\" ) = $0'\n\n\tNSutils::RegMultiSzDelete \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"bbb\" ${TRUE}\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzDelete( \"bbb\" ) = $0'\n\n\tNSutils::RegMultiSzDelete \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"aaa\" ${TRUE}\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzDelete( \"aaa\" ) = $0'\n\n\tNSutils::RegMultiSzDelete \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"ddd\" ${TRUE}\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzDelete( \"ddd\" ) = $0'\n\n\tNSutils::RegMultiSzDelete \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"eee\" ${TRUE}\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzDelete( \"eee\" ) = $0'\n\n\tNSutils::RegMultiSzDelete \"HKCU\\Software\\MyCompany\" \"MyValue\" 0 \"xxx\" ${TRUE}\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} '  RegMultiSzDelete( \"xxx\" ) = $0'\n\n\tDeleteRegValue HKCU \"Software\\MyCompany\" \"MyValue\"\n\tDeleteRegKey HKCU \"Software\\MyCompany\"\n\tSetRegView 32\n\nSectionEnd\n\n\nSection /o \"Test REG_BINARY operations\"\n\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"REG_BINARY tests\"\n\n\t!define REGKEY \"Software\\MyCompany\"\n\t!define REGVAL \"MyValue\"\n\n\tSetRegView 64\n\tDeleteRegValue HKCU \"${REGKEY}\" \"${REGVAL}\"\n\tDeleteRegKey HKCU \"${REGKEY}\"\n\n\t; Write 1\n\t!define STRING \"abc\"\n\t!define OFFSET 10\n\t!define FLAGS 0\n\tNSutils::RegBinaryInsertString \"HKCU\\${REGKEY}\" \"${REGVAL}\" ${FLAGS} ${OFFSET} \"${STRING}\"\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} \"  RegBinaryInsertString( HKCU\\${REGKEY}[${REGVAL}], ${OFFSET}, ${STRING} ) == $0\"\n\t!undef STRING\n\t!undef OFFSET\n\t!undef FLAGS\n\n\t; Write 2\n\t!define STRING \"abcdef\"\n\t!define OFFSET 10\n\t!define FLAGS 0\n\tNSutils::RegBinaryInsertString \"HKCU\\${REGKEY}\" \"${REGVAL}\" ${FLAGS} ${OFFSET} \"${STRING}\"\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} \"  RegBinaryInsertString( HKCU\\${REGKEY}[${REGVAL}], ${OFFSET}, ${STRING} ) == $0\"\n\t!undef STRING\n\t!undef OFFSET\n\t!undef FLAGS\n\n\t; Write 3\n\t!define STRING \"XY\"\n\t!define OFFSET 14\n\t!define FLAGS 0\n\tNSutils::RegBinaryInsertString \"HKCU\\${REGKEY}\" \"${REGVAL}\" ${FLAGS} ${OFFSET} \"${STRING}\"\n\tPop $0\n\tIntFmt $0 \"0x%x\" $0\n\t${Print} \"  RegBinaryInsertString( HKCU\\${REGKEY}[${REGVAL}], ${OFFSET}, ${STRING} ) == $0\"\n\t!undef STRING\n\t!undef OFFSET\n\t!undef FLAGS\n\n\t; TODO: Do it automatically\n\tMessageBox MB_ICONINFORMATION 'Manually verify HKCU\\${REGKEY}[${REGVAL}]$\\nMust be \"...abXYef\"'\n\n\tDeleteRegValue HKCU \"${REGKEY}\" \"${REGVAL}\"\n\tDeleteRegKey HKCU \"${REGKEY}\"\n\tSetRegView 32\n\n\t!undef REGKEY\n\t!undef REGVAL\n\nSectionEnd\n\n\nSection /o \"Test compare files\"\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"Test compare files\"\n\n\tNSutils::CompareFiles \"C:\\Windows\\inf\\setupapi.dev.log\" \"C:\\Windows\\inf\\setupapi.setup.log\"\n\tPop $0\n\t${Print} \"  CompareFiles ( setupapi.dev.log, setupapi.setup.log ) == (BOOL)$0\"\n\n\tNSutils::CompareFiles \"C:\\Windows\\inf\\setupapi.dev.log\" \"C:\\Windows\\inf\\setupapi.dev.log\"\n\tPop $0\n\t${Print} \"  CompareFiles ( setupapi.dev.log, setupapi.dev.log ) == (BOOL)$0\"\n\n\tNSutils::CompareFiles \"C:\\Windows\\inf\\setupapi.dev.log\" \"C:\\Windows\\inf\\setupapi.invalid.log\"\n\tPop $0\n\t${Print} \"  CompareFiles ( setupapi.dev.log, setupapi.invalid.log ) == (BOOL)$0\"\nSectionEnd\n\n\nSection /o \"Test SSD\"\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"Test SSD\"\n\n\tStrCpy $9 \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\t${For} $R0 0 25\n\t\tStrCpy $R1 $9 1 $R0\n\n\t\tNSutils::DriveIsSSD \"$R1:\"\n\t\tPop $0\n\t\t${Print} \"  DriveIsSSD ( $R1: ) == (BOOL)$0\"\n\n\t${Next}\n\nSectionEnd\n\n\n!macro CPUID_PRINT_FEATURE _Feature _Reg _Mask\n\tIntOp $0 ${_Reg} & ${_Mask}\n\t${If} $0 <> 0\n\t\t${Print} '  [*] ${_Feature}'\n\t${Else}\n\t\t${Print} '  [ ] ${_Feature}'\n\t${EndIf}\n!macroend\n\nSection /o \"CPUID\"\n\t${Print} \"--------------------------------------------------------------\"\n\t${Print} \"CPUID tests\"\n\n\t!define MASK_MMX\t0x800000\t\t; EDX1\n\t!define MASK_SSE\t0x2000000\t\t; EDX1\n\t!define MASK_SSE2\t0x4000000\t\t; EDX1\n\t!define MASK_SSE3\t0x1\t\t\t\t; ECX1\n\t!define MASK_SSSE3\t0x200\t\t\t; ECX1\n\t!define MASK_SSE41\t0x80000\t\t\t; ECX1\n\t!define MASK_SSE42\t0x100000\t\t; ECX1\n\t!define MASK_3DNOW\t0x80000000\t\t; EDX81\n\t!define MASK_3DNOWX\t0x40000000\t\t; EDX81\n\t!define MASK_LM\t\t0x20000000\t\t; EDX81\n\n\tNSutils::CPUID 1\n\tPop $1\t; EAX\n\tPop $2\t; EBX\n\tPop $3\t; ECX\n\tPop $4\t; EDX\n\n\t!insertmacro CPUID_PRINT_FEATURE \"MMX\" $4 ${MASK_MMX}\n\t!insertmacro CPUID_PRINT_FEATURE \"SSE\" $4 ${MASK_SSE}\n\t!insertmacro CPUID_PRINT_FEATURE \"SSE2\" $4 ${MASK_SSE2}\n\t!insertmacro CPUID_PRINT_FEATURE \"SSE3\" $3 ${MASK_SSE3}\n\t!insertmacro CPUID_PRINT_FEATURE \"Supplemental SSE3\" $3 ${MASK_SSSE3}\n\t!insertmacro CPUID_PRINT_FEATURE \"SSE4.1\" $3 ${MASK_SSE41}\n\t!insertmacro CPUID_PRINT_FEATURE \"SSE4.2\" $3 ${MASK_SSE42}\n\n\tNSutils::CPUID 0x80000001\n\tPop $1\t; EAX\n\tPop $2\t; EBX\n\tPop $3\t; ECX\n\tPop $4\t; EDX\n\n\t!insertmacro CPUID_PRINT_FEATURE \"3DNow!\" $4 ${MASK_3DNOW}\n\t!insertmacro CPUID_PRINT_FEATURE \"Extended 3DNow!\" $4 ${MASK_3DNOWX}\n\t!insertmacro CPUID_PRINT_FEATURE \"64BIT\" $4 ${MASK_LM}\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/NSxfer/NSxfer-Test-build.bat",
    "content": "REM :: Marius Negrutiu :: 2019/08/25\n@echo off\nSetLocal EnableDelayedExpansion\n\nif not exist \"%NSIS%\\makensis.exe\" pushd \"%~dp0..\\..\" && set NSIS=!CD!&& popd\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%NSIS_INSTDIR%\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%PROGRAMFILES%\\NSIS\nif not exist \"%NSIS%\\makensis.exe\" set NSIS=%PROGRAMFILES(X86)%\\NSIS\nif not exist \"%NSIS%\\makensis.exe\" echo ERROR: NSIS not found ^(Tip: NSIS_INSTDIR can be defined to point to NSIS binaries^) && pause && exit /B 2\n\necho ********************************************************************************\necho %NSIS%\\makensis.exe\necho ********************************************************************************\n\nTitle Build: amd64-unicode\n\"%NSIS%\\makensis.exe\" /V4 /DAMD64 \"%~dp0\\NSxfer-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n\nTitle Build: x86-ansi\n\"%NSIS%\\makensis.exe\" /V4 /DANSI \"%~dp0\\NSxfer-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n\nTitle Build: x86-unicode\n\"%NSIS%\\makensis.exe\" /V4 \"%~dp0\\NSxfer-Test.nsi\"\nif %errorlevel% neq 0 pause && exit /B %errorlevel%\n"
  },
  {
    "path": "setup/nsis/tools/Examples/NSxfer/NSxfer-Test.nsi",
    "content": "\n# NSxfer demo\n# Marius Negrutiu - https://github.com/negrutiu/nsis-nsxfer#nsis-plugin-nsxfer\n\n!ifdef AMD64\n\t!define _TARGET_ amd64-unicode\n!else ifdef ANSI\n\t!define _TARGET_ x86-ansi\n!else\n\t!define _TARGET_ x86-unicode\t\t; Default\n!endif\n\nTarget ${_TARGET_}\n\n!include \"MUI2.nsh\"\n!define LOGICLIB_STRCMP\n!include \"LogicLib.nsh\"\n!include \"Sections.nsh\"\n\n!include \"StrFunc.nsh\"\n${StrRep}\t\t\t\t; Declare in advance\n\n!define /ifndef NULL 0\n\n\n# NSxfer.dll development location\n!ifdef DEVEL\n!if ! /FileExists \"..\\Release-mingw-${_TARGET_}\\NSxfer.dll\"\n\t!error \"Missing \\Release-mingw-${_TARGET_}\\NSxfer.dll\"\n!endif\n!AddPluginDir /amd64-unicode \"..\\Release-mingw-amd64-unicode\"\n!AddPluginDir /x86-unicode   \"..\\Release-mingw-x86-unicode\"\n!AddPluginDir /x86-ansi      \"..\\Release-mingw-x86-ansi\"\n!endif\n\n# GUI settings\n!define MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\orange-install-nsis.ico\"\n!define MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp\"\n\n# Welcome page\n;!define MUI_WELCOMEPAGE_TITLE_3LINES\n;!insertmacro MUI_PAGE_WELCOME\n\n# Components page\nInstType \"All\"\t\t; 1\nInstType \"None\"\t\t; 2\n!define MUI_COMPONENTSPAGE_NODESC\n!insertmacro MUI_PAGE_COMPONENTS\n\n# Installation page\n!insertmacro MUI_PAGE_INSTFILES\n\n# Language\n!insertmacro MUI_LANGUAGE \"English\"\n;!insertmacro MUI_LANGUAGE \"Romanian\"\n!insertmacro MUI_RESERVEFILE_LANGDLL\n\n# Installer details\nName    \"NSxfer-Test-${_TARGET_}\"\nOutFile \"NSxfer-Test-${_TARGET_}.exe\"\nXPStyle on\nRequestExecutionLevel user\t\t; Don't require UAC elevation\nShowInstDetails show\nManifestDPIAware true\n\n\n#---------------------------------------------------------------#\n# .onInit                                                       #\n#---------------------------------------------------------------#\nFunction .onInit\n\n\t; Initializations\n\tInitPluginsDir\n\n\t; Language selection\n\t!define MUI_LANGDLL_ALLLANGUAGES\n\t!insertmacro MUI_LANGDLL_DISPLAY\n\n/*\n\t; .onInit download demo\n\t; NOTE: Transfers from .onInit can be either Silent or Popup (no Page!)\n\t!define /redef LINK 'https://httpbin.org/post?param1=1&param2=2'\n\t!define /redef FILE '$EXEDIR\\_Post_onInit.json'\n\tDetailPrint 'NSxfer::Transfer \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Transfer /METHOD POST /MODE Popup /URL \"${LINK}\" /LOCAL \"${FILE}\" /DATA 'User=My+User&Pass=My+Pass' /HEADERS \"Content-Type: application/x-www-form-urlencoded$\\r$\\nContent-Dummy: Dummy\" /TIMEOUTCONNECT 15000 /TIMEOUTRECONNECT 60000 /REFERER \"https://wikipedia.org\" /END\n\tPop $0\n*/\nFunctionEnd\n\n\nSection \"Cleanup test files\"\n\tSectionIn 1\t2 ; All\n\tFindFirst $0 $1 \"$EXEDIR\\_*.*\"\nloop:\n\tStrCmp $1 \"\" done\n\tDelete \"$EXEDIR\\$1\"\n\tFindNext $0 $1\n\tGoto loop\ndone:\n\tFindClose $0\nSectionEnd\n\n\nSection /o \"HTTP GET (Page mode)\"\n\tSectionIn 1\t; All\n\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint '${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\n\t!define /redef LINK 'http://live.sysinternals.com/Files/SysinternalsSuite.zip'\n\t!define /redef FILE '$EXEDIR\\_SysinternalsSuite.zip'\n\tDetailPrint 'NSxfer::Transfer \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Transfer /URL \"${LINK}\" /LOCAL \"${FILE}\" /TIMEOUTCONNECT 15000 /TIMEOUTRECONNECT 30000 /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection /o \"HTTP GET (Popup mode)\"\n\tSectionIn 1\t; All\n\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint '${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\n\t; NOTE: github.com doesn't support Range headers\n\t!define /redef LINK `https://github.com/cuckoobox/cuckoo/archive/master.zip`\n\t!define /redef FILE \"$EXEDIR\\_CuckooBox_master.zip\"\n\tDetailPrint 'NSxfer::Transfer \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Transfer /URL \"${LINK}\" /LOCAL \"${FILE}\" /Mode Popup /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection /o \"HTTP GET (Silent mode)\"\n\tSectionIn 1\t; All\n\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint '${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\n\t!define /redef LINK `https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US`\n\t!define /redef FILE \"$EXEDIR\\_Firefox.exe\"\n\tDetailPrint 'NSxfer::Transfer \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Transfer /URL \"${LINK}\" /LOCAL \"${FILE}\" /Mode Silent /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection /o \"HTTP GET (Parallel transfers)\"\n\tSectionIn 1\t; All\n\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint '${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\n\t; Request 1\n\t!define /redef LINK `https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US`\n\t!define /redef FILE \"$EXEDIR\\_Firefox(2).exe\"\n\tDetailPrint 'NSxfer::Request \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Request /URL \"${LINK}\" /LOCAL \"${FILE}\" /Mode Silent /END\n\tPop $1\n\n\t; Request 2\n\t!define /redef LINK `https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US`\n\t!define /redef FILE \"$EXEDIR\\_Firefox(3).exe\"\n\tDetailPrint 'NSxfer::Request \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Request /URL \"${LINK}\" /LOCAL \"${FILE}\" /TIMEOUTCONNECT 15000 /END\n\tPop $2\n\n\t; Request 3\n\t!define /redef LINK `http://download.osmc.tv/installers/osmc-installer.exe`\n\t!define /redef FILE \"$EXEDIR\\_osmc_installer.exe\"\n\tDetailPrint 'NSxfer::Request \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Request /URL \"${LINK}\" /LOCAL \"${FILE}\" /TIMEOUTCONNECT 15000 /END\n\tPop $3\n\n\t; Wait for all\n\tDetailPrint 'Waiting . . .'\n\tNSxfer::Wait /MODE Page /ABORT \"Abort\" \"Are you sure?\" /END\n\tPop $0\n\n\t; Validate individual transfer status...\n\t; TODO\n\n\tDetailPrint 'Done'\nSectionEnd\n\n\nSection /o \"HTTP GET (proxy)\"\n\tSectionIn 1\t; All\n\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint '${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\n\t!define /redef LINK  \"https://live.sysinternals.com/Files/SysinternalsSuite.zip\"\n\t!define /redef FILE  \"$EXEDIR\\_SysinternalsSuiteLive_proxy.zip\"\n\t!define /redef PROXY \"http=54.36.139.108:8118 https=54.36.139.108:8118\"\t\t\t; France\n\tDetailPrint 'NSxfer::Transfer /proxy ${PROXY} \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Transfer /PRIORITY 10 /URL \"${LINK}\" /LOCAL \"${FILE}\" /PROXY \"${PROXY}\" /TIMEOUTCONNECT 15000 /TIMEOUTRECONNECT 60000 /ABORT \"Abort\" \"Are you sure?\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection /o \"HTTP POST (application/json)\"\n\tSectionIn 1\t; All\n\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint '${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\n\t!define /redef LINK 'https://httpbin.org/post?param1=1&param2=2'\n\t!define /redef FILE '$EXEDIR\\_Post_json.json'\n\tDetailPrint 'NSxfer::Transfer \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Transfer /METHOD POST /URL \"${LINK}\" /LOCAL \"${FILE}\" /DATA '{\"number_of_the_beast\" : 666}' /HEADERS \"Content-Type: application/json\" /TIMEOUTCONNECT 15000 /TIMEOUTRECONNECT 60000 /REFERER \"https://wikipedia.org\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\nSection /o \"HTTP POST (application/x-www-form-urlencoded)\"\n\tSectionIn 1\t; All\n\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint '${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\n\t!define /redef LINK 'http://httpbin.org/post?param1=1&param2=2'\n\t!define /redef FILE '$EXEDIR\\_Post_form.json'\n\tDetailPrint 'NSxfer::Transfer \"${LINK}\" \"${FILE}\"'\n\tNSxfer::Transfer /METHOD POST /URL \"${LINK}\" /LOCAL \"${FILE}\" /DATA 'User=My+User&Pass=My+Pass' /HEADERS \"Content-Type: application/x-www-form-urlencoded$\\r$\\nContent-Dummy: Dummy\" /TIMEOUTCONNECT 15000 /TIMEOUTRECONNECT 60000 /REFERER \"https://wikipedia.org\" /END\n\tPop $0\n\tDetailPrint \"Status: $0\"\nSectionEnd\n\n\n!macro TEST_DEPENDENCY_REQUEST _Filename _DependsOn\n\t!define /redef LINK `http://httpbin.org/post`\n\tDetailPrint 'NSxfer::Request \"${LINK}\" \"${_Filename}.txt\"'\n\tNSxfer::Request /PRIORITY 2000 /DEPEND ${_DependsOn} /METHOD POST /URL \"${LINK}\" /LOCAL \"$EXEDIR\\${_Filename}.txt\" /HEADERS \"Content-Type: application/x-www-form-urlencoded$\\r$\\nContent-Test: TEST\" /DATA \"user=My+User+Name&pass=My+Password\" /TIMEOUTCONNECT 15000 /TIMEOUTRECONNECT 60000 /REFERER \"${LINK}\" /END\n\tPop $0\t; Request ID\n!macroend\n\n\nSection /o \"Test Dependencies (depend on first request)\"\n\t;SectionIn 1\t; All\n\n\tStrCpy $R0 0\t; First request ID\n\tStrCpy $R1 0\t; Last request ID\n\n\t; First request\n\t!insertmacro TEST_DEPENDENCY_REQUEST \"_DependOnFirst1\" -1\n\tStrCpy $R0 $0\t; Remember the first ID\n\tStrCpy $R1 $0\t; Remember the last request ID\n\n\t; Subsequent requests\n\t${For} $1 2 20\n\t\t!insertmacro TEST_DEPENDENCY_REQUEST \"_DependOnFirst$1\" $R0\n\t\tStrCpy $R1 $0\t; Remember the last request ID\n\t${Next}\n\n\t; Sleep\n\t;Sleep 2000\n\n\t; Unlock the first request, and consequently all the others...\n\tNSxfer::Set /ID $R0 /SETDEPEND 0 /END\n\tPop $0\t; Error code. Ignored\n\n\t; Wait\n\tDetailPrint 'Waiting . . .'\n\tNSxfer::Wait /MODE Page /ABORT \"Abort\" \"Are you sure?\" /END\n\tPop $0\n\nSectionEnd\n\n\nSection /o \"Test Dependencies (depend on previous request)\"\n\t;SectionIn 1\t; All\n\n\tStrCpy $R0 0\t; First request ID\n\tStrCpy $R1 0\t; Last request ID\n\n\t; First request\n\t!insertmacro TEST_DEPENDENCY_REQUEST \"_DependOnPrevious1\" -1\n\tStrCpy $R0 $0\t; Remember the first ID\n\tStrCpy $R1 $0\t; Remember the last request ID\n\n\t; Subsequent requests\n\t${For} $1 2 20\n\t\t!insertmacro TEST_DEPENDENCY_REQUEST \"_DependOnPrevious$1\" $R1\n\t\tStrCpy $R1 $0\t; Remember the last request ID\n\t${Next}\n\n\t; Sleep\n\t;Sleep 2000\n\n\t; Unlock the first request, and consequently all the others...\n\tNSxfer::Set /ID $R0 /SETDEPEND 0 /END\n\tPop $0\t; Error code. Ignored\n\n\t; Wait\n\tDetailPrint 'Waiting . . .'\n\tNSxfer::Wait /MODE Page /ABORT \"Abort\" \"Are you sure?\" /END\n\tPop $0\n\nSectionEnd\n\n\nFunction PrintSummary\n\n\tPush $0\n\tPush $1\n\tPush $2\n\tPush $3\n\tPush $R0\n\tPush $R1\n\tPush $R2\n\tPush $R3\n\tPush $R4\n\n\t; Enumerate all transfers (completed + pending + waiting)\n\tDetailPrint \"NSxfer::Enumerate\"\n\tNSxfer::Enumerate /END\n\n\tPop $1\t; Count\n\tDetailPrint \"    $1 requests\"\n\t${For} $0 1 $1\n\n\t\tPop $2\t; Request ID\n\n\t\tNSxfer::Query /ID $2 /PRIORITY /DEPEND /STATUS /WININETSTATUS /METHOD /URL /PROXY /IP /LOCAL /DATA /SENTHEADERS /RECVHEADERS /RECVSIZE /FILESIZE /PERCENT /SPEEDBYTES /SPEED /TIMEWAITING /TIMEDOWNLOADING /ERRORCODE /ERRORTEXT /CONNECTIONDROPS /CONTENT /END\n\n\t\tStrCpy $R0 \"[>] ID:$2\"\n\t\tPop $3 ;PRIORITY\n\t\tStrCpy $R0 \"$R0, Prio:$3\"\n\t\tPop $3 ;DEPEND\n\t\tIntCmp $3 0 +2 +1 +1\n\t\t\tStrCpy $R0 \"$R0, DependsOn:$3\"\n\t\tPop $3 ;STATUS\n\t\tStrCpy $R0 \"$R0, [$3]\"\n\t\tPop $3 ;WININETSTATUS\n\t\tStrCpy $R0 \"$R0, WinINet:$3\"\n\t\tDetailPrint $R0\n\n\t\tStrCpy $R0 \"  [Request]\"\n\t\tPop $3 ;METHOD\n\t\tStrCpy $R0 \"$R0 $3\"\n\t\tPop $3 ;URL\n\t\tStrCpy $R0 \"$R0 $3\"\n\t\tDetailPrint $R0\n\n\t\tPop $3 ;PROXY\n\t\tStrCmp $3 \"\" +2 +1\n\t\t\tDetailPrint \"  [Proxy] $3\"\n\t\tPop $3 ;IP\n\t\tStrCmp $3 \"\" +2 +1\n\t\t\tDetailPrint \"  [Server] $3\"\n\n\t\tPop $3 ;LOCAL\n\t\tDetailPrint \"  [Local] $3\"\n\n\t\tPop $3 ;DATA\n\t\t${If} $3 != \"\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\r\" \"\\r\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\n\" \"\\n\"\n\t\t\tDetailPrint \"  [Sent Data] $3\"\n\t\t${EndIf}\n\t\tPop $3 ;SENTHEADERS\n\t\t${If} $3 != \"\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\r\" \"\\r\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\n\" \"\\n\"\n\t\t\tDetailPrint \"  [Sent Headers] $3\"\n\t\t${EndIf}\n\t\tPop $3 ;RECVHEADERS\n\t\t${If} $3 != \"\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\r\" \"\\r\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\n\" \"\\n\"\n\t\t\tDetailPrint \"  [Recv Headers] $3\"\n\t\t${EndIf}\n\n\t\tStrCpy $R0 \"  [Size]\"\n\t\tPop $3 ;RECVSIZE\n\t\tStrCpy $R0 \"$R0 $3\"\n\t\tPop $3 ;FILESIZE\n\t\tStrCpy $R0 \"$R0/$3\"\n\t\tPop $3 ;PERCENT\n\t\tStrCpy $R0 \"$R0 ($3%)\"\n\t\tPop $3 ;SPEEDBYTES\n\t\tPop $3 ;SPEED\n\t\tStrCmp $3 \"\" +2 +1\n\t\t\tStrCpy $R0 \"$R0 @ $3\"\n\t\tDetailPrint \"$R0\"\n\n\t\tStrCpy $R0 \"  [Time]\"\n\t\tPop $3 ;TIMEWAITING\n\t\tStrCpy $R0 \"$R0 Waiting $3ms\"\n\t\tPop $3 ;TIMEDOWNLOADING\n\t\tStrCpy $R0 \"$R0, Downloading $3ms\"\n\t\tDetailPrint \"$R0\"\n\n\t\tStrCpy $R0 \"  [Error]\"\n\t\tPop $3 ;ERRORCODE\n\t\tStrCpy $R0 \"$R0 $3\"\n\t\tPop $3 ;ERRORTEXT\n\t\tStrCpy $R0 \"$R0, $3\"\n\t\tPop $3 ;CONNECTIONDROPS\n\t\tIntCmp $3 0 +2 +1 +1\n\t\t\tStrCpy $R0 \"$R0, Drops:$3\"\n\t\tDetailPrint \"$R0\"\n\n\t\tPop $3 ;CONTENT\n\t\t${If} $3 != \"\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\r\" \"\\r\"\n\t\t\t${StrRep} $3 \"$3\" \"$\\n\" \"\\n\"\n\t\t\tDetailPrint \"  [Content] $3\"\n\t\t${EndIf}\n\t${Next}\n\n\tNSxfer::QueryGlobal /TOTALCOUNT /TOTALCOMPLETED /TOTALDOWNLOADING /TOTALSPEED /TOTALTHREADS /PLUGINNAME /PLUGINVERSION /USERAGENT /END\n\tPop $R0 ; Total\n\tPop $R1 ; Completed\n\tPop $R2 ; Downloading\n\tPop $R3 ; Speed\n\tPop $R4 ; Worker threads\n\tPop $1\t; Plugin Name\n\tPop $2\t; Plugin Version\n\tPop $3\t; Useragent\n\n\tDetailPrint \"Transferring $R1+$R2/$R0 items at $R3 using $R4 worker threads\"\n\tDetailPrint \"[>] $1 $2\"\n\tDetailPrint \"[>] User agent: $3\"\n\n\tPop $R4\n\tPop $R3\n\tPop $R2\n\tPop $R1\n\tPop $R0\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\nFunctionEnd\n\n\nSection -Summary\n\tDetailPrint '-----------------------------------------------'\n\tDetailPrint ' ${__SECTION__}'\n\tDetailPrint '-----------------------------------------------'\n\tCall PrintSummary\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/exdll-vs2008.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 10.00\n# Visual Studio 2008\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"exdll\", \"exdll-vs2008.vcproj\", \"{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/exdll-vs2008.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"9.00\"\n\tName=\"exdll\"\n\tProjectGUID=\"{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}\"\n\tRootNamespace=\"exdll\"\n\tTargetFrameworkVersion=\"0\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\".\\Release\"\n\t\t\tIntermediateDirectory=\".\\Release\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG\"\n\t\t\t\tMkTypLibCompatible=\"true\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t\tTypeLibraryName=\".\\Release/exdll.tlb\"\n\t\t\t\tHeaderFileName=\"\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"1\"\n\t\t\t\tInlineFunctionExpansion=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;WIN32;_WINDOWS;_USRDLL;EXDLL_EXPORTS;NSISCALL=__stdcall\"\n\t\t\t\tStringPooling=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tBufferSecurityCheck=\"false\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Release/exdll.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Release/\"\n\t\t\t\tObjectFile=\".\\Release/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Release/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG\"\n\t\t\t\tCulture=\"1033\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"odbc32.lib odbccp32.lib nsis\\pluginapi.lib\"\n\t\t\t\tOutputFile=\".\\Release/exdll.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tGenerateManifest=\"false\"\n\t\t\t\tIgnoreAllDefaultLibraries=\"true\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"libc.lib\"\n\t\t\t\tProgramDatabaseFile=\".\\Release/exdll.pdb\"\n\t\t\t\tOptimizeForWindows98=\"1\"\n\t\t\t\tEntryPointSymbol=\"DllMain\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\".\\Release/exdll.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Release/exdll.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\".\\Debug\"\n\t\t\tIntermediateDirectory=\".\\Debug\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tInheritedPropertySheets=\"$(VCInstallDir)VCProjectDefaults\\UpgradeFromVC60.vsprops\"\n\t\t\tUseOfMFC=\"0\"\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG\"\n\t\t\t\tMkTypLibCompatible=\"true\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t\tTypeLibraryName=\".\\Debug/exdll.tlb\"\n\t\t\t\tHeaderFileName=\"\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;WIN32;_WINDOWS;_USRDLL;EXDLL_EXPORTS;NSISCALL=__stdcall\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"0\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tBufferSecurityCheck=\"false\"\n\t\t\t\tPrecompiledHeaderFile=\".\\Debug/exdll.pch\"\n\t\t\t\tAssemblerListingLocation=\".\\Debug/\"\n\t\t\t\tObjectFile=\".\\Debug/\"\n\t\t\t\tProgramDataBaseFileName=\".\\Debug/\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG\"\n\t\t\t\tCulture=\"1033\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"odbc32.lib odbccp32.lib nsis\\pluginapi.lib\"\n\t\t\t\tOutputFile=\".\\Debug/exdll.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tGenerateManifest=\"false\"\n\t\t\t\tIgnoreAllDefaultLibraries=\"true\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tProgramDatabaseFile=\".\\Debug/exdll.pdb\"\n\t\t\t\tEntryPointSymbol=\"DllMain\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"\n\t\t\t\tImportLibrary=\".\\Debug/exdll.lib\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t\tSuppressStartupBanner=\"true\"\n\t\t\t\tOutputFile=\".\\Debug/exdll.bsc\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"exdll.c\"\n\t\t\t\t>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tAdditionalIncludeDirectories=\"\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Debug|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tAdditionalIncludeDirectories=\"\"\n\t\t\t\t\t\tPreprocessorDefinitions=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"nsis\\pluginapi.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n\t\t\t>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/exdll.c",
    "content": "#include <windows.h>\n#include <nsis/pluginapi.h> // nsis plugin\n\nHINSTANCE g_hInstance;\nHWND g_hwndParent;\n\n// To work with Unicode version of NSIS, please use TCHAR-type\n// functions for accessing the variables and the stack.\n\nvoid __declspec(dllexport) myFunction(HWND hwndParent, int string_size, \n                                      LPTSTR variables, stack_t **stacktop,\n                                      extra_parameters *extra, ...)\n{\n  EXDLL_INIT();\n  g_hwndParent = hwndParent;\n\n\n  // note if you want parameters from the stack, pop them off in order.\n  // i.e. if you are called via exdll::myFunction file.dat read.txt\n  // calling popstring() the first time would give you file.dat,\n  // and the second time would give you read.txt. \n  // you should empty the stack of your parameters, and ONLY your\n  // parameters.\n\n  // do your stuff here\n  {\n    LPTSTR msgbuf = (LPTSTR) GlobalAlloc(GPTR, (3 + string_size + 1) * sizeof(*msgbuf));\n    if (msgbuf)\n    {\n      wsprintf(msgbuf, TEXT(\"$0=%s\"), getuservariable(INST_0));\n      MessageBox(g_hwndParent, msgbuf, TEXT(\"Message from example plugin\"), MB_OK);\n      GlobalFree(msgbuf);\n    }\n  }\n}\n\n\nBOOL WINAPI DllMain(HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)\n{\n  g_hInstance = hInst;\n  return TRUE;\n}\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/exdll.dpr",
    "content": "{\n  NSIS ExDLL example\n  (C) 2001 - Peter Windridge\n\n  Fixed and formatted by Brett Dever\n  http://editor.nfscheats.com/\n\n  Tested in Delphi 7.0\n}\n\nlibrary exdll;\n\nuses Windows;\n\ntype\n  VarConstants = (\n    INST_0,\n    INST_1,       // $1\n    INST_2,       // $2\n    INST_3,       // $3\n    INST_4,       // $4\n    INST_5,       // $5\n    INST_6,       // $6\n    INST_7,       // $7\n    INST_8,       // $8\n    INST_9,       // $9\n    INST_R0,      // $R0\n    INST_R1,      // $R1\n    INST_R2,      // $R2\n    INST_R3,      // $R3\n    INST_R4,      // $R4\n    INST_R5,      // $R5\n    INST_R6,      // $R6\n    INST_R7,      // $R7\n    INST_R8,      // $R8\n    INST_R9,      // $R9\n    INST_CMDLINE, // $CMDLINE\n    INST_INSTDIR, // $INSTDIR\n    INST_OUTDIR,  // $OUTDIR\n    INST_EXEDIR,  // $EXEDIR\n    INST_LANG,    // $LANGUAGE\n    __INST_LAST\n    );\n  TVariableList = INST_0..__INST_LAST;\n  pstack_t = ^stack_t;\n  stack_t = record\n    next: pstack_t;\n    text: PChar;\n  end;\n\nvar\n  g_stringsize: integer;\n  g_stacktop: ^pstack_t;\n  g_variables: PChar;\n  g_hwndParent: HWND;\n\nfunction PopString(): string;\nvar\n  th: pstack_t;\nbegin\n  if integer(g_stacktop^) <> 0 then begin\n    th := g_stacktop^;\n    Result := PChar(@th.text);\n    g_stacktop^ := th.next;\n    GlobalFree(HGLOBAL(th));\n  end;\nend;\n\nprocedure PushString(const str: string='');\nvar\n  th: pstack_t;\nbegin\n  if integer(g_stacktop) <> 0 then begin\n    th := pstack_t(GlobalAlloc(GPTR, SizeOf(stack_t) + g_stringsize));\n    lstrcpyn(@th.text, PChar(str), g_stringsize);\n    th.next := g_stacktop^;\n    g_stacktop^ := th;\n  end;\nend;\n\nfunction GetUserVariable(const varnum: TVariableList): string;\nbegin\n  if (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then\n    Result := g_variables + integer(varnum) * g_stringsize\n  else\n    Result := '';\nend;\n\nprocedure SetUserVariable(const varnum: TVariableList; const value: string);\nbegin\n  if (value <> '') and (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then\n    lstrcpy(g_variables + integer(varnum) * g_stringsize, PChar(value))\nend;\n\nprocedure NSISDialog(const text, caption: string; const buttons: integer);\nbegin\n  MessageBox(g_hwndParent, PChar(text), PChar(caption), buttons);\nend;\n\nprocedure ex_dll(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer); cdecl;\nbegin\n  // setup global variables\n  g_stringsize := string_size;\n  g_hwndParent := hwndParent;\n  g_stacktop := stacktop;\n  g_variables := variables;\n  // end global variable setup\n\n  NSISDialog(GetUserVariable(INST_0), 'The value of $0', MB_OK);\n  NSISDialog(PopString, 'pop', MB_OK);\n  PushString('Hello, this is a push');\n  SetUserVariable(INST_0, 'This is user var $0');\nend;\n\nexports ex_dll;\n\nbegin\nend.\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/exdll.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"exdll\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\n\nCFG=exdll - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE \n!MESSAGE NMAKE /f \"exdll.mak\".\n!MESSAGE \n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE \n!MESSAGE NMAKE /f \"exdll.mak\" CFG=\"exdll - Win32 Debug\"\n!MESSAGE \n!MESSAGE Possible choices for configuration are:\n!MESSAGE \n!MESSAGE \"exdll - Win32 Release\" (based on \"Win32 (x86) Dynamic-Link Library\")\n!MESSAGE \"exdll - Win32 Debug\" (based on \"Win32 (x86) Dynamic-Link Library\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nMTL=midl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"exdll - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"Release\"\n# PROP Intermediate_Dir \"Release\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"EXDLL_EXPORTS\" /YX /FD /c\n# ADD CPP /nologo /MT /W3 /GX /O1 /I \".\" /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"EXDLL_EXPORTS\" /D NSISCALL=__stdcall /YX /FD /c\n# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib /nologo /dll /machine:I386\n# ADD LINK32 user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib nsis\\pluginapi.lib /nologo /entry:\"DllMain\" /dll /machine:I386 /nodefaultlib /out:\"../../Plugins/exdll.dll\" /opt:nowin98\n# SUBTRACT LINK32 /pdb:none\n\n!ELSEIF  \"$(CFG)\" == \"exdll - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"Debug\"\n# PROP BASE Intermediate_Dir \"Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"Debug\"\n# PROP Intermediate_Dir \"Debug\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"EXDLL_EXPORTS\" /YX /FD /GZ /c\n# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I \".\" /D \"_DEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"EXDLL_EXPORTS\" /D NSISCALL=__stdcall /YX /FD /GZ /c\n# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\n# ADD LINK32 user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib nsis\\pluginapi.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\n\n!ENDIF \n\n# Begin Target\n\n# Name \"exdll - Win32 Release\"\n# Name \"exdll - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=.\\exdll.c\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# Begin Source File\n\nSOURCE=.\\nsis\\pluginapi.h\n# End Source File\n# End Group\n# Begin Group \"Resource Files\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/exdll.dsw",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n###############################################################################\n\nProject: \"exdll\"=.\\exdll.dsp - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/exdll_with_unit.dpr",
    "content": "{\n  NSIS ExDLL2 example\n  Original is ExDLL\n  (C) 2001 - Peter Windridge\n\n  Changed with delphi unit nsis.pas\n  by bernhard mayer\n\n  Tested in Delphi 7.0\n}\n\n// Example NSIS code\n{\nSection\n  exdll_with_unit::registerplugincallback\n\n  StrCpy $3 \"Hello\"\n  Push \"World\"\n  exdll_with_unit::pop_dlg_push\n  Pop $1\n  DetailPrint $$1=$1\n  DetailPrint $$3=$3\n\n  GetFunctionAddress $0 nsistest\n  Push $0\n  exdll_with_unit::callnsisfunc\nSectionEnd\n\nFunction nsistest\n  DetailPrint \"Hello from NSIS function\"\nFunctionEnd\n}\n\n\nlibrary exdll;\n\nuses\n  nsis, windows;\n\n{$IFDEF UNICODE}\ntype TString = System.WideString; // UnicodeString?\ntype PTChar = PWideChar;\n{$ELSE}\ntype TString = AnsiString;\ntype PTChar = PAnsiChar;\n{$ENDIF}\n\nprocedure pop_dlg_push(const hwndParent: HWND; const string_size: integer; const variables: PTChar; const stacktop: pointer); cdecl;\nbegin\n  // set up global variables\n  Init(hwndParent, string_size, variables, stacktop);\n\n  NSISDialog(GetUserVariable(INST_3), 'The value of $3', MB_OK);\n  NSISDialog(PopString, 'pop', MB_OK);\n  PushString('Hello, this is a push');\n  SetUserVariable(INST_3, 'This is user var $3');\nend;\n\n\nprocedure callnsisfunc(const hwndParent: HWND; const string_size: integer; const variables: PTChar; const stacktop: pointer; const extraparameters: pointer); cdecl;\nvar\n  FuncAddr : TString;\nbegin\n  Init(hwndParent, string_size, variables, stacktop, extraparameters);\n\n  FuncAddr := PopString();\n  Call(FuncAddr);\nend;\n\n\nfunction mynsiscallback(const NSPIM: TNSPIM): Pointer; cdecl;\nbegin\n  Result := nil;\n  if NSPIM = NSPIM_UNLOAD then\n    begin\n      NSISDialog(PTChar('NSPIM_UNLOAD is the final callback, goodbye...'), PTChar('mynsiscallback'), MB_OK);\n    end;\nend;\n\n\nprocedure registerplugincallback(const hwndParent: HWND; const string_size: integer; const variables: PTChar; const stacktop: pointer; const extraparameters: pointer); cdecl;\nvar\n  ThisDllInstance : HMODULE;\nbegin\n  Init(hwndParent, string_size, variables, stacktop, extraparameters);\n\n  if g_extraparameters <> nil then\n  begin\n    ThisDllInstance := hInstance;\n    TRegisterPluginCallback(g_extraparameters.RegisterPluginCallback)(ThisDllInstance, @mynsiscallback);\n  end;\nend;\n\n\nexports pop_dlg_push;\nexports callnsisfunc;\nexports registerplugincallback;\n\nbegin\nend.\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/extdll.inc",
    "content": ";################################################################\n; ExtDLL header for MASM32\n;\n; Author: Ramon\n;\n; Obs: This header must be included after windows.inc and kernel32.inc\n;      because it need the prototypes for lstrcpy, lstrcpyn, \n;      GlobalAlloc and GlobalFree\n;\n;################################################################\nstack_t struct\n  next dd ?\n  text dd ? ; 1 DUP(?) ; this should be the length of string_size\nstack_t ends\n\n.const\n; For page showing plug-ins\nWM_NOTIFY_OUTER_NEXT   equ (WM_USER+0x8)\nWM_NOTIFY_CUSTOM_READY equ (WM_USER+0xd)\nNOTIFY_BYE_BYE         equ 'x'\n\nINST_0 EQU 0         ; $0\nINST_1 EQU 1         ; $1\nINST_2 EQU 2         ; $2\nINST_3 EQU 3         ; $3\nINST_4 EQU 4         ; $4\nINST_5 EQU 5         ; $5\nINST_6 EQU 6         ; $6\nINST_7 EQU 7         ; $7\nINST_8 EQU 8         ; $8\nINST_9 EQU 9         ; $9\nINST_R0 EQU 10        ; $R0\nINST_R1 EQU 11        ; $R1\nINST_R2 EQU 12        ; $R2\nINST_R3 EQU 13        ; $R3\nINST_R4 EQU 14        ; $R4\nINST_R5 EQU 15        ; $R5\nINST_R6 EQU 16        ; $R6\nINST_R7 EQU 17        ; $R7\nINST_R8 EQU 18        ; $R8\nINST_R9 EQU 19        ; $R9\nINST_CMDLINE EQU 20   ; $CMDLINE\nINST_INSTDIR EQU 21   ; $INSTDIR\nINST_OUTDIR EQU 22    ; $OUTDIR\nINST_EXEDIR EQU 23    ; $EXEDIR\nINST_LANG EQU 24      ; $LANGUAGE\n__INST_LAST EQU 25\n\n.data?\ng_stringsize dd ?\ng_stacktop dd ?\ng_variables dd ?\n\nm2m MACRO M1, M2\n      push M2\n      pop  M1\nENDM\n\nEXDLL_INIT MACRO\n      m2m g_stringsize, string_size\n      m2m g_stacktop, stacktop\n      m2m g_variables, variables\nENDM\n\n.code\n\n; utility functions (not required but often useful)\npopstring proc uses edi pStr:DWORD\n\n  LOCAL th:DWORD\n\n  mov edi, g_stacktop\n  cmp edi, 0\n  jz  STACK_ERR\n  mov edi, [edi]\n  cmp edi, 0\n  jz  STACK_ERR\n\n  ASSUME edi:PTR stack_t\n  invoke lstrcpy, pStr, ADDR [edi].text\n  mov th , edi\n  mov edi, [edi].next\n  mov eax, g_stacktop\n  mov [eax], edi\n  invoke GlobalFree, th\n  ASSUME edi:PTR NOTHING\n  mov eax, 0\n  ret\n  \nSTACK_ERR:\n  mov eax, 1\n  ret\n\npopstring endp\n\npushstring proc uses edi pStr:DWORD\n\n  cmp g_stacktop, 0\n  jz  STACK_ERR\n\n  mov eax, sizeof stack_t\n  add eax, g_stringsize\n  invoke GlobalAlloc, GPTR, eax\n\n  mov edi, eax\n  assume edi:PTR stack_t\n\n  invoke lstrcpyn, ADDR [edi].text, pStr, g_stringsize\n  mov eax, g_stacktop\n  push DWORD PTR[eax]\n  mov [eax], edi\n  pop eax\n  ;lea edi, [edi].next ; Not needed [edi].next == edi\n  mov DWORD PTR[edi], eax\n  ASSUME edi:PTR NOTHING\n\nSTACK_ERR:\n  ret\n\npushstring endp\n\ngetuservariable proc varnum:DWORD\n\n  .if varnum < 0 || varnum >= __INST_LAST\n    xor eax, eax\n  .else\n    mov eax, varnum\n    imul eax, g_stringsize\n    add eax, g_variables\n  .endif\n  ret\n\ngetuservariable endp\n\nsetuservariable proc varnum:DWORD, var:DWORD\n\n  .if (var != NULL && varnum >= 0 && varnum < __INST_LAST)\n    mov eax, varnum\n    imul eax, g_stringsize\n    add eax, g_variables\n    invoke lstrcpy, eax, var\n  .endif\n  ret\n\nsetuservariable endp\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/nsis/api.h",
    "content": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2022 Nullsoft and Contributors\n * \n * Licensed under the zlib/libpng license (the \"License\");\n * you may not use this file except in compliance with the License.\n * \n * Licence details can be found in the file COPYING.\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n */\n\n#ifndef _NSIS_EXEHEAD_API_H_\n#define _NSIS_EXEHEAD_API_H_\n\n// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version\n// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))\n// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}\n\n#define NSISPIAPIVER_1_0 0x00010000\n#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0\n\n// NSIS Plug-In Callback Messages\nenum NSPIM \n{\n  NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup\n  NSPIM_GUIUNLOAD, // Called after .onGUIEnd\n};\n\n// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()\n// Return NULL for unknown messages\n// Should always be __cdecl for future expansion possibilities\ntypedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);\n\n// extra_parameters data structure containing other interesting stuff\n// besides the stack, variables and HWND passed on to plug-ins.\ntypedef struct\n{\n  int autoclose;          // SetAutoClose\n  int all_user_var;       // SetShellVarContext: User context = 0, Machine context = 1\n  int exec_error;         // IfErrors/ClearErrors/SetErrors\n  int abort;              // IfAbort\n  int exec_reboot;        // IfRebootFlag/SetRebootFlag (NSIS_SUPPORT_REBOOT)\n  int reboot_called;      // NSIS_SUPPORT_REBOOT\n  int XXX_cur_insttype;   // Deprecated\n  int plugin_api_version; // Plug-in ABI. See NSISPIAPIVER_CURR (Note: used to be XXX_insttype_changed)\n  int silent;             // IfSilent/SetSilent (NSIS_CONFIG_SILENT_SUPPORT)\n  int instdir_error;      // GetInstDirError\n  int rtl;                // IfRtlLanguage: 1 if $LANGUAGE is a RTL language\n  int errlvl;             // SetErrorLevel\n  int alter_reg_view;     // SetRegView: Default View = 0, Alternative View = (sizeof(void*) > 4 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY)\n  int status_update;      // SetDetailsPrint\n} exec_flags_t;\n\n#ifndef NSISCALL\n#  define NSISCALL __stdcall\n#endif\n#if !defined(_WIN32) && !defined(LPTSTR)\n#  define LPTSTR TCHAR*\n#endif\n\ntypedef struct {\n  exec_flags_t *exec_flags;\n  int (NSISCALL *ExecuteCodeSegment)(int, HWND);\n  void (NSISCALL *validate_filename)(LPTSTR);\n  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors\n} extra_parameters;\n\n// Definitions for page showing plug-ins\n// See Ui.c to understand better how they're used\n\n// sent to the outer window to tell it to go to the next inner window\n#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)\n\n// custom pages should send this message to let NSIS know they're ready\n#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)\n\n// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning\n#define NOTIFY_BYE_BYE 'x'\n\n#endif /* _NSIS_EXEHEAD_API_H_ */\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/nsis/nsis_tchar.h",
    "content": "/*\n * nsis_tchar.h\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2022 Nullsoft and Contributors\n * \n * This software is provided 'as-is', without any express or implied\n * warranty.\n *\n * For Unicode support by Jim Park -- 08/30/2007\n */\n\n// Jim Park: Only those we use are listed here.\n\n#pragma once\n\n#ifdef _UNICODE\n\n#ifndef _T\n#define __T(x)   L ## x\n#define _T(x)    __T(x)\n#define _TEXT(x) __T(x)\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\n#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)\ntypedef unsigned short TCHAR;\n#else\ntypedef wchar_t TCHAR;\n#endif\n#endif\n\n\n// program\n#define _tenviron   _wenviron\n#define __targv     __wargv\n\n// printfs\n#define _ftprintf   fwprintf\n#define _sntprintf  _snwprintf\n#if (defined(_MSC_VER) && (_MSC_VER<=1310||_MSC_FULL_VER<=140040310)) || defined(__MINGW32__)\n#\tdefine _stprintf   swprintf\n#else\n#\tdefine _stprintf   _swprintf\n#endif\n#define _tprintf    wprintf\n#define _vftprintf  vfwprintf\n#define _vsntprintf _vsnwprintf\n#if defined(_MSC_VER) && (_MSC_VER<=1310)\n#\tdefine _vstprintf  vswprintf\n#else\n#\tdefine _vstprintf  _vswprintf\n#endif\n\n// scanfs\n#define _tscanf     wscanf\n#define _stscanf    swscanf\n\n// string manipulations\n#define _tcscat     wcscat\n#define _tcschr     wcschr\n#define _tcsclen    wcslen\n#define _tcscpy     wcscpy\n#define _tcsdup     _wcsdup\n#define _tcslen     wcslen\n#define _tcsnccpy   wcsncpy\n#define _tcsncpy    wcsncpy\n#define _tcsrchr    wcsrchr\n#define _tcsstr     wcsstr\n#define _tcstok     wcstok\n\n// string comparisons\n#define _tcscmp     wcscmp\n#define _tcsicmp    _wcsicmp\n#define _tcsncicmp  _wcsnicmp\n#define _tcsncmp    wcsncmp\n#define _tcsnicmp   _wcsnicmp\n\n// upper / lower\n#define _tcslwr     _wcslwr\n#define _tcsupr     _wcsupr\n#define _totlower   towlower\n#define _totupper   towupper\n\n// conversions to numbers\n#define _tcstoi64   _wcstoi64\n#define _tcstol     wcstol\n#define _tcstoul    wcstoul\n#define _tstof      _wtof\n#define _tstoi      _wtoi\n#define _tstoi64    _wtoi64\n#define _ttoi       _wtoi\n#define _ttoi64     _wtoi64\n#define _ttol       _wtol\n\n// conversion from numbers to strings\n#define _itot       _itow\n#define _ltot       _ltow\n#define _i64tot     _i64tow\n#define _ui64tot    _ui64tow\n\n// file manipulations\n#define _tfopen     _wfopen\n#define _topen      _wopen\n#define _tremove    _wremove\n#define _tunlink    _wunlink\n\n// reading and writing to i/o\n#define _fgettc     fgetwc\n#define _fgetts     fgetws\n#define _fputts     fputws\n#define _gettchar   getwchar\n\n// directory\n#define _tchdir     _wchdir\n\n// environment\n#define _tgetenv    _wgetenv\n#define _tsystem    _wsystem\n\n// time\n#define _tcsftime   wcsftime\n\n#else // ANSI\n\n#ifndef _T\n#define _T(x)    x\n#define _TEXT(x) x\n#endif\n\n#ifndef _TCHAR_DEFINED\n#define _TCHAR_DEFINED\ntypedef char TCHAR;\n#endif\n\n// program\n#define _tenviron   environ\n#define __targv     __argv\n\n// printfs\n#define _ftprintf   fprintf\n#define _sntprintf  _snprintf\n#define _stprintf   sprintf\n#define _tprintf    printf\n#define _vftprintf  vfprintf\n#define _vsntprintf _vsnprintf\n#define _vstprintf  vsprintf\n\n// scanfs\n#define _tscanf     scanf\n#define _stscanf    sscanf\n\n// string manipulations\n#define _tcscat     strcat\n#define _tcschr     strchr\n#define _tcsclen    strlen\n#define _tcscnlen   strnlen\n#define _tcscpy     strcpy\n#define _tcsdup     _strdup\n#define _tcslen     strlen\n#define _tcsnccpy   strncpy\n#define _tcsrchr    strrchr\n#define _tcsstr     strstr\n#define _tcstok     strtok\n\n// string comparisons\n#define _tcscmp     strcmp\n#define _tcsicmp    _stricmp\n#define _tcsncmp    strncmp\n#define _tcsncicmp  _strnicmp\n#define _tcsnicmp   _strnicmp\n\n// upper / lower\n#define _tcslwr     _strlwr\n#define _tcsupr     _strupr\n\n#define _totupper   toupper\n#define _totlower   tolower\n\n// conversions to numbers\n#define _tcstol     strtol\n#define _tcstoul    strtoul\n#define _tstof      atof\n#define _tstoi      atoi\n#define _tstoi64    _atoi64\n#define _tstoi64    _atoi64\n#define _ttoi       atoi\n#define _ttoi64     _atoi64\n#define _ttol       atol\n\n// conversion from numbers to strings\n#define _i64tot     _i64toa\n#define _itot       _itoa\n#define _ltot       _ltoa\n#define _ui64tot    _ui64toa\n\n// file manipulations\n#define _tfopen     fopen\n#define _topen      _open\n#define _tremove    remove\n#define _tunlink    _unlink\n\n// reading and writing to i/o\n#define _fgettc     fgetc\n#define _fgetts     fgets\n#define _fputts     fputs\n#define _gettchar   getchar\n\n// directory\n#define _tchdir     _chdir\n\n// environment\n#define _tgetenv    getenv\n#define _tsystem    system\n\n// time\n#define _tcsftime   strftime\n\n#endif\n\n// is functions (the same in Unicode / ANSI)\n#define _istgraph   isgraph\n#define _istascii   __isascii\n\n#define __TFILE__ _T(__FILE__)\n#define __TDATE__ _T(__DATE__)\n#define __TTIME__ _T(__TIME__)\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/nsis/pluginapi.h",
    "content": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n#include \"nsis_tchar.h\" // BUGBUG: Why cannot our plugins use the compilers tchar.h?\n\n#ifndef NSISCALL\n#  define NSISCALL WINAPI\n#endif\n\n#define EXDLL_INIT()           {  \\\n        g_stringsize=string_size; \\\n        g_stacktop=stacktop;      \\\n        g_variables=variables; }\n\ntypedef struct _stack_t {\n  struct _stack_t *next;\n#ifdef UNICODE\n  WCHAR text[1]; // this should be the length of g_stringsize when allocating\n#else\n  char text[1];\n#endif\n} stack_t;\n\nenum\n{\nINST_0,         // $0\nINST_1,         // $1\nINST_2,         // $2\nINST_3,         // $3\nINST_4,         // $4\nINST_5,         // $5\nINST_6,         // $6\nINST_7,         // $7\nINST_8,         // $8\nINST_9,         // $9\nINST_R0,        // $R0\nINST_R1,        // $R1\nINST_R2,        // $R2\nINST_R3,        // $R3\nINST_R4,        // $R4\nINST_R5,        // $R5\nINST_R6,        // $R6\nINST_R7,        // $R7\nINST_R8,        // $R8\nINST_R9,        // $R9\nINST_CMDLINE,   // $CMDLINE\nINST_INSTDIR,   // $INSTDIR\nINST_OUTDIR,    // $OUTDIR\nINST_EXEDIR,    // $EXEDIR\nINST_LANG,      // $LANGUAGE\n__INST_LAST\n};\n\nextern unsigned int g_stringsize;\nextern stack_t **g_stacktop;\nextern LPTSTR g_variables;\n\nvoid NSISCALL pushstring(LPCTSTR str);\nvoid NSISCALL pushintptr(INT_PTR value);\n#define pushint(v) pushintptr((INT_PTR)(v))\nint NSISCALL popstring(LPTSTR str); // 0 on success, 1 on empty stack\nint NSISCALL popstringn(LPTSTR str, int maxlen); // with length limit, pass 0 for g_stringsize\nINT_PTR NSISCALL popintptr();\n#define popint() ( (int) popintptr() )\nint NSISCALL popint_or(); // with support for or'ing (2|4|8)\nINT_PTR NSISCALL nsishelper_str_to_ptr(LPCTSTR s);\n#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer\nunsigned int NSISCALL myatou(LPCTSTR s); // converts a string to an unsigned integer, decimal only\nint NSISCALL myatoi_or(LPCTSTR s); // with support for or'ing (2|4|8)\nLPTSTR NSISCALL getuservariable(const int varnum);\nvoid NSISCALL setuservariable(const int varnum, LPCTSTR var);\n\n#ifdef UNICODE\n#define PopStringW(x) popstring(x)\n#define PushStringW(x) pushstring(x)\n#define SetUserVariableW(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringA(LPSTR ansiStr);\nvoid NSISCALL PushStringA(LPCSTR ansiStr);\nvoid NSISCALL GetUserVariableW(const int varnum, LPWSTR wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, LPSTR ansiStr);\nvoid NSISCALL SetUserVariableA(const int varnum, LPCSTR ansiStr);\n\n#else\n// ANSI defs\n\n#define PopStringA(x) popstring(x)\n#define PushStringA(x) pushstring(x)\n#define SetUserVariableA(x,y) setuservariable(x,y)\n\nint  NSISCALL PopStringW(LPWSTR wideStr);\nvoid NSISCALL PushStringW(LPWSTR wideStr);\nvoid NSISCALL GetUserVariableW(const int varnum, LPWSTR wideStr);\nvoid NSISCALL GetUserVariableA(const int varnum, LPSTR ansiStr);\nvoid NSISCALL SetUserVariableW(const int varnum, LPCWSTR wideStr);\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif//!___NSIS_PLUGIN__H___\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Plugin/nsis.pas",
    "content": "{\n    Original Code from\n    (C) 2001 - Peter Windridge\n\n    Code in separate unit and some changes\n    2003 by Bernhard Mayer\n\n    Fixed and formatted by Brett Dever\n    http://editor.nfscheats.com/\n\n    simply include this unit in your plugin project and export\n    functions as needed\n}\n\nunit nsis;\n\ninterface\n\nuses\n  windows, SysUtils\n{$IFNDEF FPC}\n  ,CommCtrl\n{$ENDIF}\n{$IF FPC_FULLVERSION < 30000} ; This is probably wrong\n  ,CommCtrl\n{$ENDIF}\n  ;\n\n{$IFDEF UNICODE}\ntype NSISTString = System.WideString; // UnicodeString?\ntype NSISPTChar = PWideChar;\n{$ELSE}\ntype NSISTString = AnsiString;\ntype NSISPTChar = PAnsiChar;\n{$ENDIF}\n\ntype\n  VarConstants = (\n    INST_0,       // $0\n    INST_1,       // $1\n    INST_2,       // $2\n    INST_3,       // $3\n    INST_4,       // $4\n    INST_5,       // $5\n    INST_6,       // $6\n    INST_7,       // $7\n    INST_8,       // $8\n    INST_9,       // $9\n    INST_R0,      // $R0\n    INST_R1,      // $R1\n    INST_R2,      // $R2\n    INST_R3,      // $R3\n    INST_R4,      // $R4\n    INST_R5,      // $R5\n    INST_R6,      // $R6\n    INST_R7,      // $R7\n    INST_R8,      // $R8\n    INST_R9,      // $R9\n    INST_CMDLINE, // $CMDLINE\n    INST_INSTDIR, // $INSTDIR\n    INST_OUTDIR,  // $OUTDIR\n    INST_EXEDIR,  // $EXEDIR\n    INST_LANG,    // $LANGUAGE\n    __INST_LAST\n    );\n  TVariableList = INST_0..__INST_LAST;\n\ntype\n  PluginCallbackMessages = (\n    NSPIM_UNLOAD,   // This is the last message a plugin gets, do final cleanup\n    NSPIM_GUIUNLOAD // Called after .onGUIEnd\n    );\n  TNSPIM = NSPIM_UNLOAD..NSPIM_GUIUNLOAD;\n\n  //TPluginCallback = function (const NSPIM: Integer): Pointer; cdecl;\n\n  TExecuteCodeSegment = function (const funct_id: Integer; const parent: HWND): Integer;  stdcall;\n  Tvalidate_filename = procedure (const filename: NSISPTChar); stdcall;\n  TRegisterPluginCallback = function (const DllInstance: HMODULE; const CallbackFunction: Pointer): Integer; stdcall;\n\n  pexec_flags_t = ^exec_flags_t;\n  exec_flags_t = record\n    autoclose: Integer;\n    all_user_var: Integer;\n    exec_error: Integer;\n    abort: Integer;\n    exec_reboot: Integer;\n    reboot_called: Integer;\n    XXX_cur_insttype: Integer;\n    plugin_api_version: Integer;\n    silent: Integer;\n    instdir_error: Integer;\n    rtl: Integer;\n    errlvl: Integer;\n    alter_reg_view: Integer;\n    status_update: Integer;\n  end;\n\n  pextrap_t = ^extrap_t;\n  extrap_t = record\n    exec_flags: Pointer; // exec_flags_t;\n    exec_code_segment: TExecuteCodeSegment; //  TFarProc;\n    validate_filename: Pointer; // Tvalidate_filename;\n    RegisterPluginCallback: Pointer; //TRegisterPluginCallback;\n  end;\n\n  pstack_t = ^stack_t;\n  stack_t = record\n    next: pstack_t;\n    text: NSISPTChar;\n  end;\n\nvar\n  g_stringsize: integer;\n  g_stacktop: ^pstack_t;\n  g_variables: NSISPTChar;\n  g_hwndParent: HWND;\n  g_hwndList: HWND;\n  g_hwndLogList: HWND;\n  g_extraparameters: pextrap_t;\n\nprocedure Init(const hwndParent: HWND; const string_size: integer; const variables: NSISPTChar; const stacktop: pointer; const extraparameters: pointer = nil);\nfunction LogMessage(Msg : String): BOOL;\nfunction Call(NSIS_func : String) : Integer;\nfunction PopString(): NSISTString;\nprocedure PushString(const str: NSISTString='');\nfunction GetUserVariable(const varnum: TVariableList): NSISTString;\nprocedure SetUserVariable(const varnum: TVariableList; const value: NSISTString);\nprocedure NSISDialog(const text, caption: NSISTString; const buttons: integer);\n\nimplementation\n\nprocedure Init(const hwndParent: HWND; const string_size: integer; const variables: NSISPTChar; const stacktop: pointer; const extraparameters: pointer = nil);\nbegin\n  g_stringsize := string_size;\n  g_hwndParent := hwndParent;\n  g_stacktop   := stacktop;\n  g_variables  := variables;\n  g_hwndList   := FindWindowEx(FindWindowEx(g_hwndParent, 0, '#32770', nil), 0,'SysListView32', nil);\n  g_extraparameters := extraparameters;\nend;\n\n\nfunction Call(NSIS_func : String) : Integer;\nvar\n  codeoffset: Integer; //The ID of nsis function\nbegin\n  Result := 0;\n  codeoffset := StrToIntDef(NSIS_func, 0);\n  if (codeoffset <> 0) and (g_extraparameters <> nil) then\n    begin\n    codeoffset := codeoffset - 1;\n    Result := g_extraparameters.exec_code_segment(codeoffset, g_hwndParent);\n    end;\nend;\n\nfunction LogMessage(Msg : String): BOOL;\nvar\n  ItemCount : Integer;\n  item: TLVItem;\nbegin\n  Result := FAlse;\n  if g_hwndList = 0 then exit;\n  FillChar( item, sizeof(item), 0 );\n  ItemCount := SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);\n  item.iItem := ItemCount;\n  item.mask := LVIF_TEXT;\n  item.pszText := PChar(Msg); // Unicode bug?\n  ListView_InsertItem(g_hwndList, item);\n  ListView_EnsureVisible(g_hwndList, ItemCount, not 0);\nend;\n\nfunction PopString(): NSISTString;\nvar\n  th: pstack_t;\nbegin\n  if NativeUInt(g_stacktop^) <> 0 then begin\n    th := g_stacktop^;\n    Result := NSISPTChar(@th.text);\n    g_stacktop^ := th.next;\n    GlobalFree(HGLOBAL(th));\n  end;\nend;\n\nprocedure PushString(const str: NSISTString='');\nvar\n  th: pstack_t;\nbegin\n  if NativeUInt(g_stacktop) <> 0 then begin\n{$IFDEF UNICODE}\n    th := pstack_t(GlobalAlloc(GPTR, SizeOf(stack_t) + (g_stringsize * 2)));\n    lstrcpynW(@th.text, PWideChar(str), g_stringsize);\n{$ELSE}\n    th := pstack_t(GlobalAlloc(GPTR, SizeOf(stack_t) + (g_stringsize    )));\n    lstrcpynA(@th.text, PAnsiChar(str), g_stringsize);\n{$ENDIF}\n    th.next := g_stacktop^;\n    g_stacktop^ := th;\n  end;\nend;\n\nfunction GetUserVariable(const varnum: TVariableList): NSISTString;\nbegin\n  if (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then\n    Result := g_variables + integer(varnum) * g_stringsize\n  else\n    Result := '';\nend;\n\nprocedure SetUserVariable(const varnum: TVariableList; const value: NSISTString);\nbegin\n  if (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then\n{$IFDEF UNICODE}\n    lstrcpyW(g_variables + integer(varnum) * (g_stringsize), PWideChar(value))\n{$ELSE}\n    lstrcpyA(g_variables + integer(varnum) * (g_stringsize), PAnsiChar(value))\n{$ENDIF}\nend;\n\nprocedure NSISDialog(const text, caption: NSISTString; const buttons: integer);\nvar\n  hwndOwner: HWND;\nbegin\n  hwndOwner := g_hwndParent;\n  if not IsWindow(g_hwndParent) then hwndOwner := 0; // g_hwndParent is not valid in NSPIM_[GUI]UNLOAD\n{$IFDEF UNICODE}\n  MessageBoxW(hwndOwner, PWideChar(text), PWideChar(caption), buttons);\n{$ELSE}\n  MessageBoxA(hwndOwner, PAnsiChar(text), PAnsiChar(caption), buttons);\n{$ENDIF}\nend;\n\nbegin\n\nend.\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/SkinnedControls/Example.nsi",
    "content": "; example.nsi\n\n;--------------------------------\n;General\n\n  !define NAME \"SkinnedControls test\"\n\n;--------------------------------\n;Configuration\n\n  ; The name of the installer\n  Name \"${NAME}\"\n\n  ; The file to write\n  OutFile \"${NAME}.exe\"\n  \n  SetCompressor /FINAL /SOLID lzma\n\n  ;Windows vista compatibility\n  RequestExecutionLevel admin\n\n  BrandingText \"${NAME}\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\${NAME}\"\n\n  LicenseData \"..\\..\\Docs\\SkinnedControls\\license.txt\"\n\n;--------------------------------\n; Pages\n\n  Page license\n  Page components\n  Page directory\n  Page instfiles\n\n  UninstPage uninstConfirm\n  UninstPage instfiles\n\n;--------------------------------\n; The stuff to install\n\nSection \"${NAME}\"\n  SectionIn RO\n\n  SetOutPath $INSTDIR\n  WriteUninstaller \"uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n; Uninstaller\n\nSection \"Uninstall\"\n\n  RMDir /r \"$INSTDIR\"\n  \nSectionEnd\n\n;--------------------------------\n; Skin buttons and scrollbars\n\n; Workaround for unskinned Detail button in instfiles page\nChangeUI IDD_INSTFILES \"${NSISDIR}\\Contrib\\UIs\\default_sb.exe\"\n; XPStyle must not be set to On if you use the previous workaround otherwise the detail button will disappear\n\nFunction .onInit\n  InitPluginsDir\n  File \"/oname=$PLUGINSDIR\\button.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=$PLUGINSDIR\\scrollbar.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd\n\nFunction .onGUIInit\nPush \"test\"\n  ; start the plugin\n  ; the /disabledtextcolor, /selectedtextcolor and /textcolor parameters are optionnal\n  SkinnedControls::skinit \\\n        /disabledtextcolor=808080 \\\n        /selectedtextcolor=000080 \\\n        /textcolor=000000 \\\n        \"/scrollbar=$PLUGINSDIR\\scrollbar.bmp\" \\\n        \"/button=$PLUGINSDIR\\button.bmp\"\nFunctionEnd\n\nFunction un.onInit\n  InitPluginsDir\n  File \"/oname=$PLUGINSDIR\\button.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=$PLUGINSDIR\\scrollbar.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd\n\nFunction un.onGUIInit\n  ; start the plugin\n  ; the /disabledtextcolor, /selectedtextcolor and /textcolor parameters are optionnal\n  SkinnedControls::skinit \\\n        /disabledtextcolor=808080 \\\n        /selectedtextcolor=000080 \\\n        /textcolor=000000 \\\n        \"/scrollbar=$PLUGINSDIR\\scrollbar.bmp\" \\\n        \"/button=$PLUGINSDIR\\button.bmp\"\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/SkinnedControls/Example_MUI.nsi",
    "content": "; example_MUI.nsi\n\n;--------------------------------\n;General\n\n  !define NAME \"SkinnedControls test\"\n  \n;--------------------------------\n;Configuration\n\n  ; The name of the installer\n  Name \"${NAME}\"\n\n  ; The file to write\n  OutFile \"${NAME}.exe\"\n  \n  SetCompressor /FINAL /SOLID lzma\n  \n  ;Windows vista compatibility\n  RequestExecutionLevel admin\n\n  BrandingText \"${NAME}\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\${NAME}\"\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUI2.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n  !define MUI_COMPONENTSPAGE_NODESC\n  !define MUI_CUSTOMFUNCTION_GUIINIT myGUIInit\n  !define MUI_CUSTOMFUNCTION_UNGUIINIT un.myGUIInit\n  !define MUI_LICENSEPAGE_RADIOBUTTONS\n  !define MUI_HEADERIMAGE\n \n\n;--------------------------------\n;Pages\n\n  Var STARTMENU_FOLDER\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"..\\..\\Docs\\SkinnedControls\\license.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n    !define MUI_STARTMENUPAGE_DEFAULTFOLDER \"${NAME}\"\n  !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n    !define MUI_FINISHPAGE_SHOWREADME \"${NSISDIR}\\Docs\\SkinnedControls\\Readme.html\"\n    !define MUI_FINISHPAGE_LINK \"SkinnedControls Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n \n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n    !define MUI_FINISHPAGE_LINK \"SkinnedControls Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n; The stuff to install\n\nSection \"${NAME}\"\n  SectionIn RO\n\n  SetOutPath $INSTDIR\n  WriteUninstaller \"uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n; Uninstaller\n\nSection \"Uninstall\"\n\n  RMDir /r \"$INSTDIR\"\n  \nSectionEnd\n\n;--------------------------------\n; Skin buttons and scrollbars\n\n; Workaround for unskinned Detail button in instfiles page\nChangeUI IDD_INSTFILES \"${NSISDIR}\\Contrib\\UIs\\modern_sb.exe\"\n; XPStyle must be set to Off if you use the previous workaround otherwise the detail button will disappear\nXPStyle Off\n\nFunction .onInit\n  InitPluginsDir\n\n  File \"/oname=$PLUGINSDIR\\button.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=$PLUGINSDIR\\scrollbar.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd\n\nFunction myGUIInit\n  ; start the plugin\n  ; the /disabledtextcolor, /selectedtextcolor and /textcolor parameters are optionnal\n  SkinnedControls::skinit \\\n        /disabledtextcolor=808080 \\\n        /selectedtextcolor=000080 \\\n        /textcolor=000000 \\\n        \"/scrollbar=$PLUGINSDIR\\scrollbar.bmp\" \\\n        \"/button=$PLUGINSDIR\\button.bmp\"\nFunctionEnd\n\nFunction un.onInit\n  InitPluginsDir\n  File \"/oname=$PLUGINSDIR\\button.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  File \"/oname=$PLUGINSDIR\\scrollbar.bmp\" \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\nFunctionEnd\n\nFunction un.myGUIInit\n  ; start the plugin\n  ; the /disabledtextcolor, /selectedtextcolor and /textcolor parameters are optionnal\n  SkinnedControls::skinit \\\n        /disabledtextcolor=808080 \\\n        /selectedtextcolor=000080 \\\n        /textcolor=000000 \\\n        \"/scrollbar=$PLUGINSDIR\\scrollbar.bmp\" \\\n        \"/button=$PLUGINSDIR\\button.bmp\"\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/SkinnedControls/Example_MUIEx.nsi",
    "content": "; example_MUIEx.nsi\n\n;--------------------------------\n;General\n\n  !define NAME \"SkinnedControls test\"\n  \n;--------------------------------\n;Configuration\n\n  ; The name of the installer\n  Name \"${NAME}\"\n\n  ; The file to write\n  OutFile \"${NAME}.exe\"\n  \n  SetCompressor /FINAL /SOLID lzma\n  \n  ;Windows vista compatibility\n  RequestExecutionLevel admin\n\n  BrandingText \"${NAME}\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\${NAME}\"\n\n;--------------------------------\n;Registry Settings\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKLM\n  !define UMUI_PARAMS_REGISTRY_KEY \"${NAME}\"\n  \n  InstallDirRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"\"\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUIEx.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define MUI_COMPONENTSPAGE_NODESC\n\n  !define MUI_LICENSEPAGE_RADIOBUTTONS\n\n  !define MUI_HEADERIMAGE\n\n;--------------------------------\n; Skin buttons and scrollbars\n\n  !define UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  !define UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\n\n  !define UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n  !define UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n  !define UMUI_BUTTON_TEXT_COLOR 000000\n\n;--------------------------------\n;Pages\n\n  Var STARTMENU_FOLDER\n  \n  !insertmacro UMUI_PAGE_MULTILANGUAGE\n    !define UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"..\\..\\Docs\\SkinnedControls\\license.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n    !define MUI_STARTMENUPAGE_DEFAULTFOLDER \"NSIS\\Contrib\"\n  !insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU Application $STARTMENU_FOLDER\n  !insertmacro MUI_PAGE_DIRECTORY\n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n  !insertmacro MUI_PAGE_INSTFILES\n    !define MUI_FINISHPAGE_SHOWREADME \"${NSISDIR}\\Docs\\SkinnedControls\\Readme.html\"\n    !define MUI_FINISHPAGE_LINK \"SkinnedControls Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n    !define UMUI_ABORTPAGE_LINK \"SkinnedControls Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n \n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n    !define MUI_FINISHPAGE_LINK \"SkinnedControls Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n    !define UMUI_ABORTPAGE_LINK \"SkinnedControls Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT  \n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n  !insertmacro MUI_LANGUAGE \"French\"\n\n;--------------------------------\n; The stuff to install\n\nSection \"${NAME}\"\n  SectionIn RO\n\n  SetOutPath $INSTDIR\n  WriteUninstaller \"uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n; Uninstaller\n\nSection \"Uninstall\"\n\n  RMDir /r \"$INSTDIR\"\n  \nSectionEnd\n\n;--------------------------------------\n; Components and Confirm page functions\n\n\nFunction confirm_function\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  ;Only if StartMenu Floder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER)\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $STARTMENU_FOLDER\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n    ;ShellVarContext\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $1\n    StrCmp $1 \"all\" 0 current\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      Goto endsvc\n    current:\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    endsvc:\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  !insertmacro MUI_STARTMENU_WRITE_END\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      - ${NAME}\"\n\nFunctionEnd\n\n\n;-------------------------\n; Init functions\n\nFunction .onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd\n\nFunction un.onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/SkinnedControls/SkinnedControls.nsi",
    "content": "; o-----------------------------------------------------o\n; |   SkinnedControls 1.4                               |\n; (-----------------------------------------------------)\n; | Installer script.      / A plug-in for NSIS 2 and 3 |\n; |                       ------------------------------|\n; | By SuperPat                                         |\n; o-----------------------------------------------------o\n\n;--------------------------------\n;General\n\n  !define VERSION \"1.4\"\n  !define NAME \"NSIS SkinnedControls plugin\"\n\n  !define /date VERIPV \"1.4\"\n  VIProductVersion \"${VERIPV}.0.0\"\n  VIAddVersionKey \"ProductName\" \"SkinnedControls plugin for NSIS (Nullsoft Scriptable Install System).\"\n  VIAddVersionKey \"LegalTrademarks\" \"SkinnedControls is released under the zlib/libpng license\"\n  VIAddVersionKey \"LegalCopyright\" \"Copyright � 2005-2019 SuperPat, Based on wansis @ Saivert\"\n  VIAddVersionKey \"FileDescription\" \"SkinnedControls allow you to can skin all buttons and scroll bars of your installer.\"\n  VIAddVersionKey \"FileVersion\" \"${VERIPV}\"\n  \n;--------------------------------\n;Configuration\n\n  ; The name of the installer\n  Name \"${NAME} version ${VERSION}\"\n\n  ; The file to write\n  OutFile \"SkinnedControls${VERSION}.exe\"\n\n  ;Generate unicode installer\n  Unicode True\n\n  SetCompressor /FINAL /SOLID lzma\n  \n  ;Windows vista compatibility\n  RequestExecutionLevel admin\n\n  BrandingText \"${NAME} version ${VERSION}\"\n\n  ;Default installation folder\n  InstallDir $PROGRAMFILES\\NSIS\n\n;--------------------------------\n;Registry Settings\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKLM\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\NSIS\"\n  \n  InstallDirRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"\"\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUIEx.nsh\"\n  !include \"Sections.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_COMPONENTSPAGE_BIGDESC\n\n  !define MUI_LICENSEPAGE_RADIOBUTTONS\n\n  !define MUI_HEADERIMAGE\n\n;--------------------------------\n; Skin buttons and scrollbars\n\n  !define UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultbtn.bmp\"\n  !define UMUI_SCROLLBARIMAGE_BMP \"${NSISDIR}\\Contrib\\SkinnedControls\\skins\\defaultsb.bmp\"\n\n  !define UMUI_DISABLED_BUTTON_TEXT_COLOR 808080\n  !define UMUI_SELECTED_BUTTON_TEXT_COLOR 000080\n  !define UMUI_BUTTON_TEXT_COLOR 000000\n\n;--------------------------------\n;Pages\n\n  Var STARTMENU_FOLDER\n  \n  !insertmacro UMUI_PAGE_MULTILANGUAGE\n    !define UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"..\\..\\Docs\\SkinnedControls\\license.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n    !define MUI_STARTMENUPAGE_DEFAULTFOLDER \"NSIS\\Contrib\"\n  !insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU Application $STARTMENU_FOLDER\n;  !insertmacro MUI_PAGE_DIRECTORY\n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n  !insertmacro MUI_PAGE_INSTFILES\n    !define MUI_FINISHPAGE_SHOWREADME \"${NSISDIR}\\Docs\\SkinnedControls\\Readme.html\"\n    !define MUI_FINISHPAGE_LINK \"SkinnedControls Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n    !define UMUI_ABORTPAGE_LINK \"SkinnedControls Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n \n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n    !define MUI_FINISHPAGE_LINK \"SkinnedControls Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n    !define UMUI_ABORTPAGE_LINK \"SkinnedControls Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT  \n\n;--------------------------------\n;Languages\n\n ; first language is the default language if the system language is not in this list\n  !insertmacro MUI_LANGUAGE \"English\"\n\n; Other UMUI translated languages\n  !insertmacro MUI_LANGUAGE \"Bulgarian\"\n  !insertmacro MUI_LANGUAGE \"Czech\"\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"German\"\n  !insertmacro MUI_LANGUAGE \"Greek\"\n  !insertmacro MUI_LANGUAGE \"Hungarian\"\n  !insertmacro MUI_LANGUAGE \"Italian\"\n  !insertmacro MUI_LANGUAGE \"Japanese\"\n  !insertmacro MUI_LANGUAGE \"Lithuanian\"\n  !insertmacro MUI_LANGUAGE \"Polish\"\n  !insertmacro MUI_LANGUAGE \"Russian\"\n  !insertmacro MUI_LANGUAGE \"Slovenian\"\n  !insertmacro MUI_LANGUAGE \"Spanish\"\n  !insertmacro MUI_LANGUAGE \"Turkish\"\n; Other UMUI partially translated language\n  !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n\n; Other untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n  !insertmacro MUI_LANGUAGE \"SimpChinese\"\n  !insertmacro MUI_LANGUAGE \"TradChinese\"\n  !insertmacro MUI_LANGUAGE \"Korean\"\n  !insertmacro MUI_LANGUAGE \"Dutch\"\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro MUI_LANGUAGE \"Norwegian\"\n  !insertmacro MUI_LANGUAGE \"NorwegianNynorsk\"\n  !insertmacro MUI_LANGUAGE \"Finnish\"\n  !insertmacro MUI_LANGUAGE \"Portuguese\"\n  !insertmacro MUI_LANGUAGE \"Ukrainian\"\n  !insertmacro MUI_LANGUAGE \"Slovak\"\n  !insertmacro MUI_LANGUAGE \"Croatian\"\n  !insertmacro MUI_LANGUAGE \"Thai\"\n  !insertmacro MUI_LANGUAGE \"Romanian\"\n  !insertmacro MUI_LANGUAGE \"Latvian\"\n  !insertmacro MUI_LANGUAGE \"Macedonian\"\n  !insertmacro MUI_LANGUAGE \"Estonian\"\n  !insertmacro MUI_LANGUAGE \"Serbian\"\n  !insertmacro MUI_LANGUAGE \"SerbianLatin\"\n  !insertmacro MUI_LANGUAGE \"Arabic\"\n  !insertmacro MUI_LANGUAGE \"Farsi\"\n  !insertmacro MUI_LANGUAGE \"Hebrew\"\n  !insertmacro MUI_LANGUAGE \"Indonesian\"\n  !insertmacro MUI_LANGUAGE \"Mongolian\"\n  !insertmacro MUI_LANGUAGE \"Luxembourgish\"\n  !insertmacro MUI_LANGUAGE \"Albanian\"\n  !insertmacro MUI_LANGUAGE \"Breton\"\n  !insertmacro MUI_LANGUAGE \"Belarusian\"\n  !insertmacro MUI_LANGUAGE \"Icelandic\"\n  !insertmacro MUI_LANGUAGE \"Malay\"\n  !insertmacro MUI_LANGUAGE \"Bosnian\"\n  !insertmacro MUI_LANGUAGE \"Kurdish\"\n  !insertmacro MUI_LANGUAGE \"Irish\"\n  !insertmacro MUI_LANGUAGE \"Uzbek\"\n  !insertmacro MUI_LANGUAGE \"Galician\"\n  !insertmacro MUI_LANGUAGE \"Afrikaans\"\n  !insertmacro MUI_LANGUAGE \"Catalan\"\n  !insertmacro MUI_LANGUAGE \"Esperanto\"\n  !insertmacro MUI_LANGUAGE \"Asturian\"\n  !insertmacro MUI_LANGUAGE \"Basque\"\n  !insertmacro MUI_LANGUAGE \"Pashto\"\n  !insertmacro MUI_LANGUAGE \"ScotsGaelic\"\n  !insertmacro MUI_LANGUAGE \"Vietnamese\"\n  !insertmacro MUI_LANGUAGE \"Welsh\"\n  !insertmacro MUI_LANGUAGE \"Corsican\"\n  !insertmacro MUI_LANGUAGE \"Tatar\"\n\n; Other unicode only untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"Armenian\"\n  !insertmacro MUI_LANGUAGE \"Georgian\"\n  !insertmacro MUI_LANGUAGE \"Hindi\"\n\n;--------------------------------\n; The stuff to install\n\nSection \"${NAME}, examples & docs\" SecSC\n  SectionIn RO\n  \n  ReadRegDword $0 HKLM Software\\NSIS \"VersionMajor\"\n  StrCmp $0 3 0 +6\n    ; NSIS 3\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi\n    File \"..\\..\\Plugins\\x86-ansi\\SkinnedControls.dll\"\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\SkinnedControls.dll\"\n    Goto +3\n    \n    ; NSIS 2\n    SetOutPath $INSTDIR\\Plugins\n    File \"..\\..\\Plugins\\x86-ansi\\SkinnedControls.dll\"\n    \n  SetOutPath $INSTDIR\\Examples\\SkinnedControls\n  File \"*.nsi\"\n\n  SetOutPath $INSTDIR\\Contrib\\SkinnedControls\\skins\n  File \"..\\..\\Contrib\\SkinnedControls\\skins\\*.bmp\"\n  \n  SetOutPath $INSTDIR\\Docs\\SkinnedControls\n  File \"..\\..\\Docs\\SkinnedControls\\*.*\"\n  SetOutPath \"$INSTDIR\\Docs\\SkinnedControls\\images\\\"\n  File \"..\\..\\Docs\\SkinnedControls\\images\\*.png\"\n  File \"..\\..\\Docs\\SkinnedControls\\images\\*.gif\"\n\n  SetOutPath $INSTDIR\\Contrib\\UIs\n  File \"..\\..\\Contrib\\UIs\\modern_sb.exe\"\n  File \"..\\..\\Contrib\\UIs\\default_sb.exe\"\n\n  ; Write the uninstall keys for Windows\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayName\" \"${NAME}\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayIcon\" \"$INSTDIR\\uninstall_SkinnedControls.exe,0\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"UninstallString\" \"$INSTDIR\\uninstall_SkinnedControls.exe\"\n  WriteUninstaller \"uninstall_SkinnedControls.exe\"\n  \n  SetOutPath \"$SMPROGRAMS\\NSIS\\Contrib\\\"\n  CreateShortCut \"$SMPROGRAMS\\NSIS\\Contrib\\SkinnedControls Readme.lnk\" \"$INSTDIR\\Docs\\SkinnedControls\\Readme.html\"\n  CreateShortCut \"$SMPROGRAMS\\NSIS\\Contrib\\Uninstall SkinnedControls.lnk\" \"$INSTDIR\\uninstall_SkinnedControls.exe\"\n\nSectionEnd\n\nSection \"Source Code\" SecSrc\n    \n  SetOutPath $INSTDIR\\Contrib\\SkinnedControls\n  File \"..\\..\\Contrib\\SkinnedControls\\*.h\"\n  File \"..\\..\\Contrib\\SkinnedControls\\*.c\"\n  File \"..\\..\\Contrib\\SkinnedControls\\SkinnedControls.sln\"\n  File \"..\\..\\Contrib\\SkinnedControls\\SkinnedControls.vcproj\"\n  SetOutPath $INSTDIR\\Contrib\\SkinnedControls\\coolsb\n  File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\*.h\"\n  File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\*.c\"\n  File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\detours.lib\"\n  File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\coolsb.vcproj\"\n    \nSectionEnd\n\n;--------------------------------\n; Uninstaller\n\nSection \"Uninstall\"\n  \n  ; Remove registry keys\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\n  DeleteRegKey HKLM \"SOFTWARE\\NSIS\\${NAME}\"\n\n  Delete \"$INSTDIR\\Plugins\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\modern_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\default_sb.exe\"\n  RMDir /r \"$INSTDIR\\Contrib\\SkinnedControls\"\n  Delete \"$INSTDIR\\Docs\\SkinnedControls\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\SkinnedControls\"\n  Delete \"$INSTDIR\\Examples\\SkinnedControls\\*.nsi\"\n  RMDir \"$INSTDIR\\Examples\\SkinnedControls\"\n  \n  Delete \"$SMPROGRAMS\\NSIS\\Contrib\\SkinnedControls Readme.lnk\"\n  Delete \"$SMPROGRAMS\\NSIS\\Contrib\\Uninstall SkinnedControls.lnk\"\n  RMDir \"$SMPROGRAMS\\NSIS\\Contrib\"\n  RMDir \"$SMPROGRAMS\\NSIS\"\n  Delete \"$INSTDIR\\uninstall_SkinnedControls.exe\"\n  \nSectionEnd\n\n;--------------------------------------\n; Components and Confirm page functions\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSC} \"Install the ANSI and UNICODE version of the plugin, default images and the documentation and examples of the SkinnedControls NSIS plugin.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSrc} \"The Sources code of the SkinnedControls plugin.\"\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n\n!macro confirm_addline section\n\n  SectionGetFlags ${Sec${section}} $1\n  IntOp $1 $1 & ${SF_SELECTED}\n  IntCmp $1 ${SF_SELECTED} 0 n${section} n${section}\n    SectionGetText ${Sec${section}} $1\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"    - $1\"\n  n${section}:\n\n!macroend\n\nFunction confirm_function\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  ;Only if StartMenu Floder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER)\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $STARTMENU_FOLDER\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n    ;ShellVarContext\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $1\n    StrCmp $1 \"all\" 0 current\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      Goto endsvc\n    current:\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    endsvc:\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  !insertmacro MUI_STARTMENU_WRITE_END\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n\n  !insertmacro confirm_addline SC\n  !insertmacro confirm_addline Src\n\nFunctionEnd\n\n\n;-------------------------\n; Init functions\n\nFunction .onInit\n\n  ; Check NSIS Version\n  ReadRegDword $0 HKLM Software\\NSIS \"VersionMajor\"\n  StrCmp $0 3 okNSIS 0\n    StrCmp $0 2 0 +3\n      ReadRegDword $0 HKLM Software\\NSIS \"VersionMinor\"\n      IntCmp $0 42 okNSIS 0 okNSIS\n  \n        MessageBox MB_OK|MB_ICONSTOP \"NSIS version 2.42 or NSIS 3 are not installed on your computer.$\\r$\\nPlease, install NSIS (http://nsis.sourceforge.net) and then re-execute this install.$\\n$\\rThis install will stop.\"\n        Quit\n\n  okNSIS:\n  ClearErrors\n\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd\n\nFunction un.onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/Splash/Example.nsi",
    "content": "Name \"Splash.dll test\"\n\nOutFile \"Splash Test.exe\"\n\nXPStyle on\n\nFunction .onInit\n\t# the plugins dir is automatically deleted when the installer exits\n\tInitPluginsDir\n\tFile /oname=$PLUGINSDIR\\splash.bmp \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp\"\n\t#optional\n\t#File /oname=$PLUGINSDIR\\splash.wav \"C:\\myprog\\sound.wav\"\n\n\tsplash::show 1000 $PLUGINSDIR\\splash\n\n\tPop $0 ; $0 has '1' if the user closed the splash screen early,\n\t\t\t; '0' if everything closed normally, and '-1' if some error occurred.\nFunctionEnd\n\nSection\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/StartMenu/Example.nsi",
    "content": "Name \"StartMenu.dll test\"\n\nOutFile \"StartMenu Test.exe\"\n\nXPStyle on\n\nPage directory\nDirText \"This installer will create some shortcuts to MakeNSIS in the start menu.$\\nFor this it needs NSIS's path.\" \\\n  \"Please specify the path in which you have installed NSIS:\"\nInstallDir \"${NSISDIR}\"\nFunction .onVerifyInstDir\n\tIfFileExists $INSTDIR\\makensis.exe +2\n\t\tAbort\nFunctionEnd\n\nPage custom StartMenuGroupSelect \"\" \": Start Menu Folder\"\nFunction StartMenuGroupSelect\n\tPush $R1\n\n\tStartMenu::Select /checknoshortcuts \"Don't create a start menu folder\" /autoadd /lastused $R0 \"StartMenu.dll test\"\n\tPop $R1\n\n\tStrCmp $R1 \"success\" success\n\tStrCmp $R1 \"cancel\" done\n\t\t; error\n\t\tMessageBox MB_OK $R1\n\t\tStrCpy $R0 \"StartMenu.dll test\" # use default\n\t\tReturn\n\tsuccess:\n\tPop $R0\n\n\tdone:\n\tPop $R1\nFunctionEnd\n\nPage instfiles\nSection\n\t# this part is only necessary if you used /checknoshortcuts\n\tStrCpy $R1 $R0 1\n\tStrCmp $R1 \">\" skip\n\n\t\tCreateDirectory $SMPROGRAMS\\$R0\n\t\tCreateShortcut $SMPROGRAMS\\$R0\\MakeNSISw.lnk $INSTDIR\\makensisw.exe\n\n\t\tSetShellVarContext All\n\t\tCreateDirectory $SMPROGRAMS\\$R0\n\t\tCreateShortcut \"$SMPROGRAMS\\$R0\\All users MakeNSISw.lnk\" $INSTDIR\\makensisw.exe\n\n\tskip:\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/StrFunc.nsi",
    "content": "Name \"NSIS StrFunc Example\"\nOutFile \"StrFunc.exe\"\nShowInstDetails show\nShowUninstDetails show\nXPStyle on\nRequestExecutionLevel user\n\n!include \"StrFunc.nsh\"\n\n# Declare used functions\n${StrCase}\n${StrClb}\n${StrIOToNSIS}\n${StrLoc}\n${StrNSISToIO}\n${StrRep}\n${StrStr}\n${StrStrAdv}\n${StrTok}\n${StrTrimNewLines}\n${StrSort}\n\n${UnStrCase}\n${UnStrClb}\n${UnStrIOToNSIS}\n${UnStrLoc}\n${UnStrNSISToIO}\n${UnStrRep}\n${UnStrStr}\n${UnStrStrAdv}\n${UnStrTok}\n${UnStrTrimNewLines}\n${UnStrSort}\n\n\nVar SFPass\nVar SFTotl\n!macro EndStrFuncTestEx lbl name\n  IfErrors ${lbl}\n  DetailPrint \"PASSED ${name} test\"\n  IntOp $SFPass $SFPass + 1\n  IntOp $SFTotl $SFTotl + 1\n  Goto +3\n${lbl}:\n  DetailPrint \"FAILED ${name} test\"\n  IntOp $SFTotl $SFTotl + 1\n!macroend\n!macro EndStrFuncTest name\n  !insertmacro EndStrFuncTestEx \"${name}error\" \"${name}\"\n!macroend\n\nCompletedText \"Passed $SFPass of $SFTotl tests\"\n!macro CompletedAllTests\n  StrCmp $SFPass $SFTotl +2\n    SetErrorLevel 42\n!macroend\n\n!macro StackVerificationStart\n  StrCpy $0 S0\n  StrCpy $1 S1\n  StrCpy $2 S2\n  StrCpy $3 S3\n  StrCpy $4 S4\n  StrCpy $5 S5\n  StrCpy $6 S6\n  StrCpy $7 S7\n  StrCpy $8 S8\n  StrCpy $9 S9\n  StrCpy $R0 SR0\n  StrCpy $R1 SR1\n  StrCpy $R2 SR2\n  StrCpy $R3 SR3\n  StrCpy $R4 SR4\n  StrCpy $R5 SR5\n  StrCpy $R6 SR6\n  StrCpy $R7 SR7\n  StrCpy $R8 SR8\n  StrCpy $R9 SR9\n!macroend\n\n!macro StackVerificationEnd\n  ClearErrors\n  ${If} $1 != \"S1\"\n  ${OrIf} $2 != \"S2\"\n  ${OrIf} $3 != \"S3\"\n  ${OrIf} $4 != \"S4\"\n  ${OrIf} $5 != \"S5\"\n  ${OrIf} $6 != \"S6\"\n  ${OrIf} $7 != \"S7\"\n  ${OrIf} $8 != \"S8\"\n  ${OrIf} $9 != \"S9\"\n  ${OrIf} $R0 != \"SR0\"\n  ${OrIf} $R1 != \"SR1\"\n  ${OrIf} $R2 != \"SR2\"\n  ${OrIf} $R3 != \"SR3\"\n  ${OrIf} $R4 != \"SR4\"\n  ${OrIf} $R5 != \"SR5\"\n  ${OrIf} $R6 != \"SR6\"\n  ${OrIf} $R7 != \"SR7\"\n  ${OrIf} $R8 != \"SR8\"\n  ${OrIf} $R9 != \"SR9\"\n    SetErrors\n  ${EndIf}\n!macroend\n\nSection\n\n  # Test case conversion\n  !insertmacro StackVerificationStart\n  ${StrCase} $0 \"This is just an example. A very simple one.\" \"\"\n  StrCmp $0 \"This is just an example. A very simple one.\" 0 strcaseerror\n  ${StrCase} $0 \"THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.\" \"S\"\n  StrCmp $0 \"This is just an example. A very simple one.\" 0 strcaseerror\n  ${StrCase} $0 \"This is just an example. A very simple one.\" \"L\"\n  StrCmp $0 \"this is just an example. a very simple one.\" 0 strcaseerror\n  ${StrCase} $0 \"This is just an example. A very simple one.\" \"U\"\n  StrCmp $0 \"THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.\" 0 strcaseerror\n  ${StrCase} $0 \"This is just an example. A very simple one.\" \"T\"\n  StrCmp $0 \"This Is Just An Example. A Very Simple One.\" 0 strcaseerror\n  ${StrCase} $0 \"This is just an example. A very simple one.\" \"<>\"\n  StrCmp $0 \"tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE.\" 0 strcaseerror\n  ${StrCase} $0 \"123456789!@#%^&*()-_=+[]{};:,./<>?\" \"S\"\n  StrCmp $0 \"123456789!@#%^&*()-_=+[]{};:,./<>?\" 0 strcaseerror\n  ${StrCase} $0 \"123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?\" \"<>\"\n  StrCmp $0 \"123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?\" 0 strcaseerror\n  ${StrCase} $0 \"what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!\" \"S\"\n  StrCmp $0 \"What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!\" 0 strcaseerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrCase\n\n  # Test clipboard function\n  !insertmacro StackVerificationStart\n  !verbose push 4\n  ${StrClb} $0 \"StrFunc clipboard test\" \">\"\n  !verbose pop\n  StrCmp $0 \"\" 0 strclberror\n  ${StrClb} $0 \"StrFunc clipboard test #2\" \"<>\"\n  StrCmp $0 \"StrFunc clipboard test\" 0 strclberror\n  ${StrClb} $0 \"\" \"<\"\n  StrCmp $0 \"StrFunc clipboard test #2\" 0 strclberror\n  ${StrClb} $0 \"\" \"\"\n  StrCmp $0 \"\" 0 strclberror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrClb\n\n  # Test IO functions\n  !insertmacro StackVerificationStart\n  !macro testio str\n  ${StrNSISToIO} $0 \"${str}\"\n  ${StrIOToNSIS} $0 $0\n  StrCmp $0 \"${str}\" 0 ioerror\n  !macroend\n  !insertmacro testio \"$\\rtest$\\n\"\n  !insertmacro testio \"test$\\n\"\n  !insertmacro testio \"$\\rtest\"\n  !insertmacro testio \"test\"\n  !insertmacro testio \"$\\r\\$\\t$\\n\"\n  !insertmacro testio \"$\\r \\ $\\t $\\n $$\"\n  !insertmacro testio \"\"\n  !insertmacro testio \" \"\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTestEx ioerror \"StrNSISToIO/StrIOToNSIS\"\n \n  # Test string search functions\n  !insertmacro StackVerificationStart\n  ${StrLoc} $0 \"This is just an example\" \"just\" \"<\"\n  StrCmp $0 \"11\" 0 strlocerror\n  ${StrLoc} $0 a abc <\n  StrCmp $0 \"\" 0 strlocerror\n  ${StrLoc} $0 a abc >\n  StrCmp $0 \"\" 0 strlocerror\n  ${StrLoc} $0 abc a >\n  StrCmp $0 \"0\" 0 strlocerror\n  ${StrLoc} $0 abc b >\n  StrCmp $0 \"1\" 0 strlocerror\n  ${StrLoc} $0 abc c >\n  StrCmp $0 \"2\" 0 strlocerror\n  ${StrLoc} $0 abc a <\n  StrCmp $0 \"2\" 0 strlocerror\n  ${StrLoc} $0 abc b <\n  StrCmp $0 \"1\" 0 strlocerror\n  ${StrLoc} $0 abc c <\n  StrCmp $0 \"0\" 0 strlocerror\n  ${StrLoc} $0 abc d <\n  StrCmp $0 \"\" 0 strlocerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrLoc\n\n  # Test string replacement\n  !insertmacro StackVerificationStart\n  ${StrRep} $0 \"This is just an example\" \"an\" \"one\"\n  StrCmp $0 \"This is just one example\" 0 strreperror\n  ${StrRep} $0 \"test... test... 1 2 3...\" \"test\" \"testing\"\n  StrCmp $0 \"testing... testing... 1 2 3...\" 0 strreperror\n  ${StrRep} $0 \"\" \"test\" \"testing\"\n  StrCmp $0 \"\" 0 strreperror\n  ${StrRep} $0 \"test\" \"test\" \"testing\"\n  StrCmp $0 \"testing\" 0 strreperror\n  ${StrRep} $0 \"test\" \"test\" \"\"\n  StrCmp $0 \"\" 0 strreperror\n  ${StrRep} $0 \"test\" \"\" \"abc\"\n  StrCmp $0 \"test\" 0 strreperror\n  ${StrRep} $0 \"test\" \"\" \"\"\n  StrCmp $0 \"test\" 0 strreperror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrRep\n\n  # Test sorting\n  !insertmacro StackVerificationStart\n  ${StrSort} $0 \"This is just an example\" \"\" \" just\" \"ple\" \"0\" \"0\" \"0\"\n  StrCmp $0 \"This is an exam\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"j\" \" \" \"0\" \"\" \"0\"\n  StrCmp $0 \"just\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \"\" \"j\" \"\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"This is just an example\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"us\" \"\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"just an example\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \"\" \"u\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"This is just\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"just\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"just\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"t\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"This\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"le\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"example\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"le\" \" \" \"1\" \"0\" \"0\"\n  StrCmp $0 \" examp\" 0 strsorterror\n  ${StrSort} $0 \"an error has occurred\" \" \" \"e\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"error\" 0 strsorterror\n  ${StrSort} $0 \"\" \" \" \"something\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"j\" \" \" \"\" \"\" \"\"\n  StrCmp $0 \" just \" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"j\" \" \" \"1\" \"0\" \"1\"\n  StrCmp $0 \" ust \" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \"\" \"j\" \"\" \"0\" \"0\" \"1\"\n  StrCmp $0 \"This is ust an example\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"us\" \"\" \"1\" \"0\" \"0\"\n  StrCmp $0 \" jt an example\" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \"\" \"u\" \" \" \"0\" \"0\" \"1\"\n  StrCmp $0 \"This is jst \" 0 strsorterror\n  ${StrSort} $0 \"This is just an example\" \" \" \"just\" \" \" \"1\" \"0\" \"1\"\n  StrCmp $0 \"  \" 0 strsorterror\n  ${StrSort} $0 \"an error has occurred\" \" \" \"e\" \"h\" \"1\" \"0\" \"0\"\n  StrCmp $0 \" rror \" 0 strsorterror\n  ${StrSort} $0 \"\" \" \" \"something\" \" \" \"1\" \"0\" \"1\"\n  StrCmp $0 \"\" 0 strsorterror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrSort\n\n  !insertmacro StackVerificationStart\n  ${StrStr} $0 \"abcefghijklmnopqrstuvwxyz\" \"g\"\n  StrCmp $0 \"ghijklmnopqrstuvwxyz\" 0 strstrerror\n  ${StrStr} $0 \"abcefghijklmnopqrstuvwxyz\" \"ga\"\n  StrCmp $0 \"\" 0 strstrerror\n  ${StrStr} $0 \"abcefghijklmnopqrstuvwxyz\" \"\"\n  StrCmp $0 \"abcefghijklmnopqrstuvwxyz\" 0 strstrerror\n  ${StrStr} $0 \"a\" \"abcefghijklmnopqrstuvwxyz\"\n  StrCmp $0 \"\" 0 strstrerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrStr\n\n  !insertmacro StackVerificationStart\n  ${StrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"0\" \"0\"\n  StrCmp $0 \"abcabcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"1\" \"0\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"2\" \"0\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"3\" \"0\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"abc\" \">\" \"<\" \"1\" \"1\" \"0\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"abc\" \">\" \"<\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \"<\" \"1\" \"0\" \"0\"\n  StrCmp $0 \"abcabcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \"<\" \"0\" \"0\" \"0\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \">\" \"0\" \"0\" \"0\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${StrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \">\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"0\" \"1\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"1\" \"1\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"2\" \"1\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"3\" \"1\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"abc\" \">\" \"<\" \"1\" \"1\" \"1\"\n  StrCmp $0 \"ABCabcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"abc\" \">\" \"<\" \"0\" \"1\" \"1\"\n  StrCmp $0 \"ABCabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \"<\" \"1\" \"0\" \"1\"\n  StrCmp $0 \"ABCabcabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \"<\" \"0\" \"0\" \"1\"\n  StrCmp $0 \"ABCabc\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \">\" \"0\" \"0\" \"1\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${StrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \">\" \"0\" \"1\" \"1\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrStrAdv\n\n  # Test tokenizer\n  !insertmacro StackVerificationStart\n  ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"4\" \"1\"\n  StrCmp $0 \"not\" 0 strtokerror\n  ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"4\" \"0\"\n  StrCmp $0 \"is\" 0 strtokerror\n  ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"152\" \"0\"\n  StrCmp $0 \"\" 0 strtokerror\n  ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"\" \"0\"\n  StrCmp $0 \"example\" 0 strtokerror\n  ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"L\" \"0\"\n  StrCmp $0 \"example\" 0 strtokerror\n  ${StrTok} $0 \"This is, or is not, just an example\" \" ,\" \"0\" \"0\"\n  StrCmp $0 \"This\" 0 strtokerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrTok\n\n  # Test trim new lines\n  !insertmacro StackVerificationStart\n  ${StrTrimNewLines} $0 \"$\\r$\\ntest$\\r$\\ntest$\\r$\\n\"\n  StrCmp $0 \"$\\r$\\ntest$\\r$\\ntest\" 0 strtrimnewlineserror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrTrimNewlines\n\n  InitPluginsDir\n  WriteUninstaller $PluginsDir\\UnStrFunc.exe\n  ExecWait '\"$PluginsDir\\UnStrFunc.exe\" _?=$PluginsDir'\n\n  !insertmacro CompletedAllTests\nSectionEnd\n\nSection Uninstall\n\n  # Test case conversion\n  !insertmacro StackVerificationStart\n  ${UnStrCase} $0 \"This is just an example. A very simple one.\" \"\"\n  StrCmp $0 \"This is just an example. A very simple one.\" 0 strcaseerror\n  ${UnStrCase} $0 \"THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.\" \"S\"\n  StrCmp $0 \"This is just an example. A very simple one.\" 0 strcaseerror\n  ${UnStrCase} $0 \"This is just an example. A very simple one.\" \"L\"\n  StrCmp $0 \"this is just an example. a very simple one.\" 0 strcaseerror\n  ${UnStrCase} $0 \"This is just an example. A very simple one.\" \"U\"\n  StrCmp $0 \"THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.\" 0 strcaseerror\n  ${UnStrCase} $0 \"This is just an example. A very simple one.\" \"T\"\n  StrCmp $0 \"This Is Just An Example. A Very Simple One.\" 0 strcaseerror\n  ${UnStrCase} $0 \"This is just an example. A very simple one.\" \"<>\"\n  StrCmp $0 \"tHIS IS JUST AN EXAMPLE. a VERY SIMPLE ONE.\" 0 strcaseerror\n  ${UnStrCase} $0 \"123456789!@#%^&*()-_=+[]{};:,./<>?\" \"S\"\n  StrCmp $0 \"123456789!@#%^&*()-_=+[]{};:,./<>?\" 0 strcaseerror\n  ${UnStrCase} $0 \"123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#%^&*()abcdefghijklmnopqrstuvwxyz-_=+[]{};:,./<>?\" \"<>\"\n  StrCmp $0 \"123456789abcdefghijklmnopqrstuvwxyz!@#%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ-_=+[]{};:,./<>?\" 0 strcaseerror\n  ${UnStrCase} $0 \"what about taking a shower tomorrow? it's late to do so now! try to sleep now. Good Night!\" \"S\"\n  StrCmp $0 \"What about taking a shower tomorrow? It's late to do so now! Try to sleep now. Good night!\" 0 strcaseerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrCase\n\n  # Test clipboard function\n  !insertmacro StackVerificationStart\n  ${UnStrClb} $0 \"StrFunc clipboard test\" \">\"\n  StrCmp $0 \"\" 0 strclberror\n  ${UnStrClb} $0 \"StrFunc clipboard test #2\" \"<>\"\n  StrCmp $0 \"StrFunc clipboard test\" 0 strclberror\n  ${UnStrClb} $0 \"\" \"<\"\n  StrCmp $0 \"StrFunc clipboard test #2\" 0 strclberror\n  ${UnStrClb} $0 \"\" \"\"\n  StrCmp $0 \"\" 0 strclberror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrClb\n\n  # Test IO functions\n  !insertmacro StackVerificationStart\n  !macro untestio str\n  ${UnStrNSISToIO} $0 \"${str}\"\n  ${UnStrIOToNSIS} $0 $0\n  StrCmp $0 \"${str}\" 0 ioerror\n  !macroend\n  !insertmacro untestio \"$\\rtest$\\n\"\n  !insertmacro untestio \"test$\\n\"\n  !insertmacro untestio \"$\\rtest\"\n  !insertmacro untestio \"test\"\n  !insertmacro untestio \"$\\r\\$\\t$\\n\"\n  !insertmacro untestio \"$\\r \\ $\\t $\\n $$\"\n  !insertmacro untestio \"\"\n  !insertmacro untestio \" \"\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTestEx ioerror \"StrNSISToIO/StrIOToNSIS\"\n\n  # Test string search functions\n  !insertmacro StackVerificationStart\n  ${UnStrLoc} $0 \"This is just an example\" \"just\" \"<\"\n  StrCmp $0 \"11\" 0 strlocerror\n  ${UnStrLoc} $0 a abc <\n  StrCmp $0 \"\" 0 strlocerror\n  ${UnStrLoc} $0 a abc >\n  StrCmp $0 \"\" 0 strlocerror\n  ${UnStrLoc} $0 abc a >\n  StrCmp $0 \"0\" 0 strlocerror\n  ${UnStrLoc} $0 abc b >\n  StrCmp $0 \"1\" 0 strlocerror\n  ${UnStrLoc} $0 abc c >\n  StrCmp $0 \"2\" 0 strlocerror\n  ${UnStrLoc} $0 abc a <\n  StrCmp $0 \"2\" 0 strlocerror\n  ${UnStrLoc} $0 abc b <\n  StrCmp $0 \"1\" 0 strlocerror\n  ${UnStrLoc} $0 abc c <\n  StrCmp $0 \"0\" 0 strlocerror\n  ${UnStrLoc} $0 abc d <\n  StrCmp $0 \"\" 0 strlocerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrLoc\n\n  # Test string replacement\n  !insertmacro StackVerificationStart\n  ${UnStrRep} $0 \"This is just an example\" \"an\" \"one\"\n  StrCmp $0 \"This is just one example\" 0 strreperror\n  ${UnStrRep} $0 \"test... test... 1 2 3...\" \"test\" \"testing\"\n  StrCmp $0 \"testing... testing... 1 2 3...\" 0 strreperror\n  ${UnStrRep} $0 \"\" \"test\" \"testing\"\n  StrCmp $0 \"\" 0 strreperror\n  ${UnStrRep} $0 \"test\" \"test\" \"testing\"\n  StrCmp $0 \"testing\" 0 strreperror\n  ${UnStrRep} $0 \"test\" \"test\" \"\"\n  StrCmp $0 \"\" 0 strreperror\n  ${UnStrRep} $0 \"test\" \"\" \"abc\"\n  StrCmp $0 \"test\" 0 strreperror\n  ${UnStrRep} $0 \"test\" \"\" \"\"\n  StrCmp $0 \"test\" 0 strreperror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrRep\n\n  # Test sorting\n  !insertmacro StackVerificationStart\n  ${UnStrSort} $0 \"This is just an example\" \"\" \" just\" \"ple\" \"0\" \"0\" \"0\"\n  StrCmp $0 \"This is an exam\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"j\" \" \" \"0\" \"\" \"0\"\n  StrCmp $0 \"just\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \"\" \"j\" \"\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"This is just an example\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"us\" \"\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"just an example\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \"\" \"u\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"This is just\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"just\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"just\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"t\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"This\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"le\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"example\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"le\" \" \" \"1\" \"0\" \"0\"\n  StrCmp $0 \" examp\" 0 strsorterror\n  ${UnStrSort} $0 \"an error has occurred\" \" \" \"e\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"error\" 0 strsorterror\n  ${UnStrSort} $0 \"\" \" \" \"something\" \" \" \"0\" \"1\" \"0\"\n  StrCmp $0 \"\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"j\" \" \" \"\" \"\" \"\"\n  StrCmp $0 \" just \" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"j\" \" \" \"1\" \"0\" \"1\"\n  StrCmp $0 \" ust \" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \"\" \"j\" \"\" \"0\" \"0\" \"1\"\n  StrCmp $0 \"This is ust an example\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"us\" \"\" \"1\" \"0\" \"0\"\n  StrCmp $0 \" jt an example\" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \"\" \"u\" \" \" \"0\" \"0\" \"1\"\n  StrCmp $0 \"This is jst \" 0 strsorterror\n  ${UnStrSort} $0 \"This is just an example\" \" \" \"just\" \" \" \"1\" \"0\" \"1\"\n  StrCmp $0 \"  \" 0 strsorterror\n  ${UnStrSort} $0 \"an error has occurred\" \" \" \"e\" \"h\" \"1\" \"0\" \"0\"\n  StrCmp $0 \" rror \" 0 strsorterror\n  ${UnStrSort} $0 \"\" \" \" \"something\" \" \" \"1\" \"0\" \"1\"\n  StrCmp $0 \"\" 0 strsorterror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrSort\n\n  !insertmacro StackVerificationStart\n  ${UnStrStr} $0 \"abcefghijklmnopqrstuvwxyz\" \"g\"\n  StrCmp $0 \"ghijklmnopqrstuvwxyz\" 0 strstrerror\n  ${UnStrStr} $0 \"abcefghijklmnopqrstuvwxyz\" \"ga\"\n  StrCmp $0 \"\" 0 strstrerror\n  ${UnStrStr} $0 \"abcefghijklmnopqrstuvwxyz\" \"\"\n  StrCmp $0 \"abcefghijklmnopqrstuvwxyz\" 0 strstrerror\n  ${UnStrStr} $0 \"a\" \"abcefghijklmnopqrstuvwxyz\"\n  StrCmp $0 \"\" 0 strstrerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrStr\n\n  !insertmacro StackVerificationStart\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"0\" \"0\"\n  StrCmp $0 \"abcabcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"1\" \"0\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"2\" \"0\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"a\" \">\" \">\" \"1\" \"3\" \"0\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"abc\" \">\" \"<\" \"1\" \"1\" \"0\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"abc\" \">\" \"<\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \"<\" \"1\" \"0\" \"0\"\n  StrCmp $0 \"abcabcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \"<\" \"0\" \"0\" \"0\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \">\" \"0\" \"0\" \"0\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"abcabcabc\" \"abc\" \"<\" \">\" \"0\" \"1\" \"0\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"0\" \"1\"\n  StrCmp $0 \"abcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"1\" \"1\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"2\" \"1\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"a\" \">\" \">\" \"1\" \"3\" \"1\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"abc\" \">\" \"<\" \"1\" \"1\" \"1\"\n  StrCmp $0 \"ABCabcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"abc\" \">\" \"<\" \"0\" \"1\" \"1\"\n  StrCmp $0 \"ABCabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \"<\" \"1\" \"0\" \"1\"\n  StrCmp $0 \"ABCabcabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \"<\" \"0\" \"0\" \"1\"\n  StrCmp $0 \"ABCabc\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \">\" \"0\" \"0\" \"1\"\n  StrCmp $0 \"\" 0 strstradverror\n  ${UnStrStrAdv} $0 \"ABCabcabc\" \"abc\" \"<\" \">\" \"0\" \"1\" \"1\"\n  StrCmp $0 \"abc\" 0 strstradverror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrStrAdv\n\n  # Test tokenizer\n  !insertmacro StackVerificationStart\n  ${UnStrTok} $0 \"This is, or is not, just an example\" \" ,\" \"4\" \"1\"\n  StrCmp $0 \"not\" 0 strtokerror\n  ${UnStrTok} $0 \"This is, or is not, just an example\" \" ,\" \"4\" \"0\"\n  StrCmp $0 \"is\" 0 strtokerror\n  ${UnStrTok} $0 \"This is, or is not, just an example\" \" ,\" \"152\" \"0\"\n  StrCmp $0 \"\" 0 strtokerror\n  ${UnStrTok} $0 \"This is, or is not, just an example\" \" ,\" \"\" \"0\"\n  StrCmp $0 \"example\" 0 strtokerror\n  ${UnStrTok} $0 \"This is, or is not, just an example\" \" ,\" \"L\" \"0\"\n  StrCmp $0 \"example\" 0 strtokerror\n  ${UnStrTok} $0 \"This is, or is not, just an example\" \" ,\" \"0\" \"0\"\n  StrCmp $0 \"This\" 0 strtokerror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrTok\n\n  # Test trim new lines\n  !insertmacro StackVerificationStart\n  ${UnStrTrimNewLines} $0 \"$\\r$\\ntest$\\r$\\ntest$\\r$\\n\"\n  StrCmp $0 \"$\\r$\\ntest$\\r$\\ntest\" 0 strtrimnewlineserror\n  !insertmacro StackVerificationEnd\n  !insertmacro EndStrFuncTest StrTrimNewLines\n\n  !insertmacro CompletedAllTests\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/System/SysFunc.nsh",
    "content": "; Some useful functions based on System plugin\n; \n; (c) brainsucker, 2002\n; (r) BSForce\n\n\n!verbose push 3\n!ifndef SysFunc.NSH.Included\n!define SysFunc.NSH.Included\n\n!include \"System.nsh\"\n!include \"WinMessages.nsh\"\n\n; ================= GetInstallerExeName implementation =================\n\n; Adopted Get Parameter function -> now it gets full installer.exe path\n; input - nothing, output -> full path at the top of the stack\nFunction GetInstallerExeName\n   Push $R0\n   Push $R1\n   Push $R2\n   StrCpy $R0 $CMDLINE 1\n   StrCpy $R1 '\"'\n   StrCpy $R2 1\n   StrCmp $R0 '\"' loop\n     StrCpy $R1 ' ' ; we're scanning for a space instead of a quote\n   loop:\n     StrCpy $R0 $CMDLINE 1 $R2\n     StrCmp $R0 $R1 loop2\n     StrCmp $R0 \"\" loop2\n     IntOp $R2 $R2 + 1\n     Goto loop\n   loop2:\n\n   ; Ok, have we found last exename character or string end?\n   StrCmp $R0 \"\" \"\" +2\n        IntOp $R2 $R2 - 1       ; last exename char\n   StrCmp $R1 ' ' +3    ; was first character the '\"', or something other?\n        StrCpy $R1 1    ; it was quote\n        Goto +2\n        StrCpy $R1 0    \n   IntOp $R2 $R2 - $R1\n   StrCpy $R0 $CMDLINE $R2 $R1  \n\n   SearchPath $R0 $R0      ; expand file name to full path\n\n   Pop $R2\n   Pop $R1\n   Exch $R0\nFunctionEnd\n\n; ================= systemGetFileSysTime implementation =================\n\n!macro smGetFileSysTime FILENAME\n        Push ${FILENAME}\n        Call systemGetFileSysTime\n        Pop  $R0\n!macroend\n\n; -----------------------------------------------------------------\n; systemGetFileSysTime (params on stack):\n;       FILENAME        -       name of file to get file time\n; returns to stack (SYSTEMTIME struct addr)\n; -----------------------------------------------------------------\n\n; uses original method from NSIS\nFunction systemGetFileSysTime\n    System::Store \"s r1\"\n\n    StrCpy $R0 0     \n\n    ; create WIN32_FIND_DATA struct\n    System::Call '*${stWIN32_FIND_DATA} .r2'\n\n    ; Find file info\n    System::Call '${sysFindFirstFile}(r1, r2) .r3'\n\n    ; ok?\n    IntCmp $3 ${INVALID_HANDLE_VALUE} sgfst_exit\n\n    ; close file search\n    System::Call '${sysFindClose}(r3)'\n\n    ; Create systemtime struct for local time\n    System::Call '*${stSYSTEMTIME} .R0'\n\n    ; Get File time\n    System::Call '*$2${stWIN32_FIND_DATA} (,,, .r3)'\n\n    ; Convert file time (UTC) to local file time\n    System::Call '${sysFileTimeToLocalFileTime}(r3, .r1)'\n\n    ; Convert file time to system time\n    System::Call '${sysFileTimeToSystemTime}(r1, R0)'\n\nsgfst_exit:\n    ; free used memory for WIN32_FIND_DATA struct\n    System::Free $2    \n\n    System::Store \"P0 l\"\nFunctionEnd\n\n; ================= systemMessageBox implementation =================\n\n; return to $R0\n!macro smMessageBox MODULE MSG CAPTION STYLE ICON\n     Push \"${ICON}\"\n     Push \"${STYLE}\"\n     Push \"${CAPTION}\"\n     Push \"${MSG}\"\n     Push \"${MODULE}\"\n     Call systemMessageBox\n     Pop $R0\n!macroend\n\n; -----------------------------------------------------------------\n; systemMessageBox (params on stack):\n;       Module: either handle (\"i HANDLE\", HANDLE could be 0) or \"modulename\" \n;       Msg: text of message\n;       Caption: caption of message box window\n;       Style: style, buttons etc\n;       Icon: either icon handle (\"i HANDLE\") or resource name \n; returns to stack\n; -----------------------------------------------------------------\nFunction systemMessageBox\n     System::Store \"s r2r3r4r5r6\"\n\n     ; may be Module is module handle?\n     StrCpy $1 $2\n     IntCmp $1 0 0 smbnext smbnext\n\n\t ; Get module handle\n\t System::Call '${sysGetModuleHandle}($2) .r1'\n\t IntCmp $1 0 loadlib libnotloaded libnotloaded\n\nloadlib:\n     ; Load module and get handle\n     System::Call '${sysLoadLibrary}($2) .r1'\n     IntCmp $1 0 0 smbnext smbnext\n\nlibnotloaded:\n\t ; Indicate that LoadLibrary wasn't used\n\t StrCpy $2 1\n\nsmbnext:\n     ; Create MSGBOXPARAMS structure\n     System::Call '*${stMSGBOXPARAMS}(, $HWNDPARENT, r1, r3, r4, \"$5|${MB_USERICON}\", $6, _) .r0'\n     ; call MessageBoxIndirect\n     System::Call '${sysMessageBoxIndirect}(r0) .R0'\n     ; free MSGBOXPARAMS structure\n\n     System::Free $0\n\n     ; have we used load library at start?\n     IntCmp $2 0 0 smbskipfree smbskipfree\n     ; No, then free the module\n     System::Call '${sysFreeLibrary}(r1)'\n\nsmbskipfree:\n     System::Store \"P0 l\"   \nFunctionEnd\n\n; ================= systemSplash implementation =================\n\n; returns to $R0\n!macro smSystemSplash DELAY FILE\n    Push ${FILE}\n    Push ${DELAY}\n    call systemSplash\n    Pop $R0    \n!macroend\n\n; -----------------------------------------------------------------\n; systemSplash (params on stack):\n;       Delay - time in ms to show the splash\n;       File - bitmap (& audio) file name (without extension)\n; returns to stack\n; -----------------------------------------------------------------\n\nFunction _systemSplashWndCB\n   ; Callback receives 4 values\n   System::Store \"s r2r5r7r9\"\n\n   ; Message branching\n   IntCmp $5 ${WM_CLOSE} m_Close\n   IntCmp $5 ${WM_TIMER} m_Timer\n   IntCmp $5 ${WM_LBUTTONDOWN} m_Lbtn\n   IntCmp $5 ${WM_CREATE} m_Create\n   IntCmp $5 ${WM_PAINT} m_Paint\n   goto default\n\nm_Create:\n   ; Create structures\n   System::Call \"*${stRECT} (_) .R8\"\n   System::Call \"*${stBITMAP} (_, &l0 .R7) .R9\"\n\n   ; Get bitmap info\n   System::Call \"${sysGetObject} (r6, R7, R9)\" \n   \n   ; Get desktop info\n   System::Call \"${sysSystemParametersInfo} (${SPI_GETWORKAREA}, 0, R8, 0)\" \n\n   ; Style (callbacked)\n   System::Call \"${sysSetWindowLong} (r2, ${GWL_STYLE}, 0) .s\" \n   !insertmacro SINGLE_CALLBACK 5 $R7 1 _systemSplashWndCB\n\n   ; Calculate and set window pos\n\n   ; Get bmWidth(R2) and bmHeight(R3)\n   System::Call \"*$R9${stBITMAP} (,.R2,.R3)\"\n   ; Get left(R4), top(R5), right(R6), bottom(R7)\n   System::Call \"*$R8${stRECT} (.R4,.R5,.R6,.R7)\"\n\n   ; Left pos\n   IntOp $R0 $R6 - $R4\n   IntOp $R0 $R0 - $R2\n   IntOp $R0 $R0 / 2\n   IntOp $R0 $R0 + $R4\n\n   ; Top pos\n   IntOp $R1 $R7 - $R5\n   IntOp $R1 $R1 - $R3\n   IntOp $R1 $R1 / 2\n   IntOp $R1 $R1 + $R5\n\n   System::Call \"${sysSetWindowPos} (r2, 0, R0, R1, R2, R3, ${SWP_NOZORDER}) .s\" \n   !insertmacro SINGLE_CALLBACK 6 $R7 1 _systemSplashWndCB\n\n   ; Show window\n   System::Call \"${sysShowWindow} (r2, ${SW_SHOW}) .s\" \n   !insertmacro SINGLE_CALLBACK 7 $R7 1 _systemSplashWndCB\n\n   ; Set Timer\n   System::Call \"${sysSetTimer} (r2, 1, r8,)\"\n\n   ; Free used memory\n   System::Free $R8\n   System::Free $R9\n\n   StrCpy $R0 0\n   goto exit\n\nm_Paint:\n   ; Create structures\n   System::Call \"*${stRECT} (_) .R8\"\n   System::Call \"*${stPAINTSTRUCT} (_) .R9\"\n\n   ; Begin Paint\n   System::Call \"${sysBeginPaint} (r2, R9) .R7\"\n\n   ; CreateCompatibleDC\n   System::Call \"${sysCreateCompatibleDC} (R7) .R6\"\n\n   ; GetClientRect\n   System::Call \"${sysGetClientRect} (r2, R8)\"\n  \n   ; Select new bitmap\n   System::Call \"${sysSelectObject} (R6, r6) .R5\"\n\n   ; Get left(R0), top(R1), right(R2), bottom(R3)\n   System::Call \"*$R8${stRECT} (.R0,.R1,.R2,.R3)\"\n     \n   ; width=right-left  \n   IntOp $R2 $R2 - $R0\n   ; height=bottom-top\n   IntOp $R3 $R3 - $R1\n\n   System::Call \"${sysBitBlt} (R7, R0, R1, R2, R3, R6, 0, 0, ${SRCCOPY})\" \n\n   ; Select old bitmap\n   System::Call \"${sysSelectObject} (R6, R5)\"\n   \n   ; Delete compatible DC\n   System::Call \"${sysDeleteDC} (R6)\"\n\n   ; End Paint\n   System::Call \"${sysEndPaint} (r2, R9)\"\n\n   ; Free used memory\n   System::Free $R8\n   System::Free $R9\n\n   StrCpy $R0 0\n   goto exit\n\nm_Timer:\nm_Lbtn:\n   StrCpy $4 0\n   IntCmp $5 ${WM_TIMER} destroy\n        StrCpy $4 1\n\ndestroy:\n   System::Call \"${sysDestroyWindow} (r2) .s\"\n   !insertmacro SINGLE_CALLBACK 12 $R4 1 _systemSplashWndCB\n\ndefault:\n   ; Default\n   System::Call \"${sysDefWindowProc} (r2, r5, r7, r9) .s\"\n   !insertmacro SINGLE_CALLBACK 14 $R0 1 _systemSplashWndCB\n   goto exit\n\nm_Close:\n   StrCpy $R0 0\n   goto exit\n\nexit:\n   ; Restore\n   System::Store \"p4P0 l R0r4\"\n\n   ; Return from callback\n   System::Call \"$3\" $R0\nFunctionEnd\n\nFunction systemSplash\n\n   ; Save registers and get input \n   System::Store \"s r8r9\"\n\n   ; Get module instance\n   System::Call \"${sysGetModuleHandle} (p) .r7\"\n\n   ; Get arrow cursor\n   System::Call \"${sysLoadCursor} (0, p ${IDC_ARROW}) .R9\" \n\n   ; Get callback\n   System::Get \"${sysWNDPROC}\"\n   Pop $3\n\n   ; Create window class\n   System::Call \"*${stWNDCLASS} (0,r3,0,0,r7,0,R9,0,p 0,'_sp') .R9\"\n\n   ; Register window class\n   System::Call \"${sysRegisterClass} (R9) .R9\"\n   IntCmp $R9 0 errorexit ; Class registered ok?\n\n   ; Load Image (LR_CREATEDIBSECTION|LR_LOADFROMFILE = 0x2010)\n   System::Call '${sysLoadImage} (, s, ${IMAGE_BITMAP}, 0, 0, ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) .r6' \"$9.bmp\"\n   IntCmp $6 0 errorexit        ; Image loaded ok?\n\n   ; Start the sound (SND_ASYNC|SND_FILENAME|SND_NODEFAULT = 0x20003)\n   System::Call \"${sysPlaySound} (s,,${SND_ASYNC}|${SND_FILENAME}|${SND_NODEFAULT})\" \"$9.wav\" \n\n   ; Create window\n   System::Call \"${sysCreateWindowEx} (${WS_EX_TOOLWINDOW}, s, s,,,,,, $HWNDPARENT,,r7,) .s\" \"_sp\" \"_sp\" \n   !insertmacro SINGLE_CALLBACK 1 $5 1 _systemSplashWndCB\n\n   ; Create MSG struct\n   System::Call \"*${stMSG} (_) p.R9\"\n\n   ; -------------------------\nrepeat:\n        ; Check for window\n        System::Call \"${sysIsWindow} (r5) .s\"\n        !insertmacro SINGLE_CALLBACK 2 $R8 1 _systemSplashWndCB\n        IntCmp $R8 0 finish\n\n        ; Get message\n        System::Call \"${sysGetMessage} (R9, r5,_) .s\"\n        !insertmacro SINGLE_CALLBACK 3 $R8 1 _systemSplashWndCB\n        IntCmp $R8 0 finish\n\n        ; Dispatch message\n        System::Call \"${sysDispatchMessage} (R9) .s\"\n        !insertmacro SINGLE_CALLBACK 4 $R8 1 _systemSplashWndCB\n\n        ; Repeat dispatch cycle\n        goto repeat\n   ; -------------------------\n\nfinish:\n   ; Stop the sound\n   System::Call \"${sysPlaySound} (p 0, p 0, i 0)\"\n\n   ; Delete bitmap object\n   System::Call \"${sysDeleteObject} (r6)\"\n\n   ; Delete the callback queue\n   System::Free $3\n\n   ; Dialog return\n   StrCpy $R0 $4\n   goto exit\n\n; Exit in case of error\nerrorexit:\n   StrCpy $R0 -1\n   goto exit\n\nexit:\n   ; Restore register and put output\n   System::Store \"P0 l\"\nFunctionEnd\n\n!endif\n!verbose pop"
  },
  {
    "path": "setup/nsis/tools/Examples/System/System.nsh",
    "content": "; Some useful functions, structures, constants\n; \n; (c) brainsucker, 2002\n; (r) BSForce\n\n!verbose push 3\n!ifndef System.NSH.Included\n!define System.NSH.Included\n\n!include WinCore.nsh\n\n; ------------- Functions --------------\n\n; LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);\n!define sysWNDPROC \"(p.s, i.s, p.s, p.s) pss\"\n\n; LRESULT DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\n!define sysDefWindowProc \"user32::DefWindowProc(p, i, p, p) p\"\n\n!define sysMessageBox \"user32::MessageBox(p, t, t, i) i\"\n\n!define sysMessageBeep \"user32::MessageBeep(i) i\"\n\n!define sysMessageBoxIndirect 'user32::MessageBoxIndirect(p) i'\n\n; HMODULE GetModuleHandle(LPCTSTR lpModuleName); \n!define sysGetModuleHandle \"kernel32::GetModuleHandle(t) i\"\n\n; HMODULE LoadLibrary(LPCTSTR lpFileName);\n!define sysLoadLibrary \"kernel32::LoadLibrary(t) p\"\n\n; BOOL FreeLibrary(HMODULE hModule);\n!define sysFreeLibrary \"kernel32::FreeLibrary(p) i\"\n\n; HCURSOR LoadCursor(HINSTANCE hInstance, LPCTSTR lpCursorName);\n!define sysLoadCursor \"user32::LoadCursor(p, t) p\"\n\n; ATOM RegisterClass(CONST WNDCLASS *lpWndClass);\n!define sysRegisterClass \"user32::RegisterClass(p) i\"\n\n; HANDLE LoadImage(HINSTANCE hinst, LPCTSTR lpszName, UINT uType,\n;       int cxDesired, int cyDesired, UINT fuLoad);\n!define sysLoadImage \"user32::LoadImage(p, t, i, i, i, i) p\"\n\n; BOOL PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);\n!define sysPlaySound \"winmm.dll::PlaySound(t, p, i) i\"\n\n; HWND CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName,\n;       DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent,\n;       HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);\n!define sysCreateWindowEx \"user32::CreateWindowEx(i, t, t, i, i, i, i, i, p, p, p, p) p\"\n\n; BOOL IsWindow(HWND hWnd);\n!define sysIsWindow \"user32::IsWindow(p) i\"\n\n; LONG SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong);\n!define sysSetWindowLong \"user32::SetWindowLong(p, i, p) p\"\n\n; BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);\n!define sysSetWindowPos \"user32::SetWindowPos(p, p, i, i, i, i, i) i\"\n\n; BOOL ShowWindow(HWND hWnd, int nCmdShow);\n!define sysShowWindow \"user32::ShowWindow(p, i) i\"\n\n; BOOL DestroyWindow(HWND hWnd);\n!define sysDestroyWindow \"user32::DestroyWindow(p) i\"\n\n; BOOL GetClientRect(HWND hWnd, LPRECT lpRect);\n!define sysGetClientRect \"user32::GetClientRect(p, p) i\"\n\n; BOOL GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);\n!define sysGetMessage \"user32::GetMessage(p, p, i, i) i\"\n\n; LRESULT DispatchMessage(CONST MSG *lpmsg);\n!define sysDispatchMessage \"user32::DispatchMessage(p) p\"\n\n; BOOL DeleteObject(HGDIOBJ hObject);\n!define sysDeleteObject \"gdi32::DeleteObject(p) i\"\n\n; int GetObject(HGDIOBJ hgdiobj, int cbBuffer, LPVOID lpvObject);\n!define sysGetObject \"gdi32::GetObject(p, i, p) i\"\n\n; HGDIOBJ SelectObject(HDC hdc, HGDIOBJ hgdiobj);\n!define sysSelectObject \"gdi32::SelectObject(p, p) p\"\n\n; HDC CreateCompatibleDC(HDC hdc);\n!define sysCreateCompatibleDC \"gdi32::CreateCompatibleDC(p) p\"\n\n; BOOL DeleteDC(HDC hdc);\n!define sysDeleteDC \"gdi32::DeleteDC(p) i\"\n\n; BOOL BitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, \n;       HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop);\n!define sysBitBlt \"gdi32::BitBlt(p, i, i, i, i, p, i, i, i) i\"\n\n; proposed by abgandar\n; int AddFontResource(LPCTSTR lpszFilename);\n!define sysAddFontResource \"gdi32::AddFontResource(t) i\"\n\n; HDC BeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint);\n!define sysBeginPaint \"user32::BeginPaint(p, p) p\"\n\n; BOOL EndPaint(HWND hWnd, CONST PAINTSTRUCT *lpPaint);\n!define sysEndPaint \"user32::EndPaint(p, p) i\"\n\n; BOOL SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);\n!define sysSystemParametersInfo \"user32::SystemParametersInfo(i, i, p, i) i\"\n\n; UINT_PTR SetTimer(HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc);\n!define sysSetTimer \"user32::SetTimer(p, p, i, k) i\"\n\n; DWORD GetLogicalDriveStrings(DWORD nBufferLength, LPTSTR LpBuffer);\n!define sysGetLogicalDriveStrings 'kernel32::GetLogicalDriveStrings(i, p) i'\n\n!define sysGetDiskFreeSpaceEx 'kernel32::GetDiskFreeSpaceEx(t, *l, *l, *l) i'\n\n; UINT GetDriveType(LPCTSTR lpRootPathName);\n!define sysGetDriveType 'kernel32::GetDriveType(t) i'\n\n; HANDLE FindFirstFile(LPCTSTR lpFileName,LPWIN32_FIND_DATA lpFindFileData);\n!define sysFindFirstFile 'kernel32::FindFirstFile(t, p) p'\n\n; BOOL FindClose(HANDLE hFindFile);\n!define sysFindClose 'kernel32::FindClose(p) i'\n\n; BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, \n; LPSYSTEMTIME lpSystemTime);\n!define sysFileTimeToSystemTime 'kernel32::FileTimeToSystemTime(*l, p) i'\n\n; BOOL FileTimeToLocalFileTime(\n;       CONST FILETIME *lpFileTime, \n;       LPFILETIME lpLocalFileTime);\n!define sysFileTimeToLocalFileTime 'kernel32::FileTimeToLocalFileTime(*l, *l) i'\n\n; BOOL SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTimeZone, \n; LPSYSTEMTIME lpUniversalTime, LPSYSTEMTIME lpLocalTime);\n!define sysSystemTimeToTzSpecificLocalTime 'kernel32::SystemTimeToTzSpecificLocalTime(p, p, p) i'\n\n!define syslstrlen 'kernel32::lstrlen(t) i'\n\n; int wsprintf(LPTSTR lpOut, LPCTSTR lpFmt, ...);\n!define syswsprintf \"user32::wsprintf(t, t) i ? c\" \n\n; ------------- Structures --------------\n\n; typedef struct _WNDCLASS { \n;               UINT       style; \n;               WNDPROC    lpfnWndProc; \n;               int        cbClsExtra; \n;               int        cbWndExtra; \n;               HINSTANCE  hInstance; \n;               HICON      hIcon; \n;               HCURSOR    hCursor; \n;               HBRUSH     hbrBackground;\n;               LPCTSTR    lpszMenuName; \n;               LPCTSTR    lpszClassName; \n; } WNDCLASS, *PWNDCLASS; \n!define stWNDCLASS \"(i, k, i, i, p, p, p, p, t, t) p\"\n\n; typedef struct tagMSG {\n;   HWND   hwnd; \n;   UINT   message; \n;   WPARAM wParam; \n;   LPARAM lParam; \n;   DWORD  time; \n;   POINT  pt;  -> will be presented as two separate px and py\n; } MSG, *PMSG;\n!define stMSG \"(p, i, p, p, i, i, i) p\"\n\n; typedef struct tagBITMAP {\n;   LONG   bmType; \n;   LONG   bmWidth; \n;   LONG   bmHeight; \n;   LONG   bmWidthBytes; \n;   WORD   bmPlanes; \n;   WORD   bmBitsPixel; \n;   LPVOID bmBits; \n; } BITMAP, *PBITMAP; \n!define stBITMAP \"(i, i, i, i, i, i, p) p\"\n\n; typedef struct _RECT { \n;   LONG left; \n;   LONG top; \n;   LONG right; \n;   LONG bottom; \n; } RECT, *PRECT; \n!define stRECT \"(i, i, i, i) p\"\n\n; typedef struct tagPAINTSTRUCT { \n;   HDC  hdc; \n;   BOOL fErase; \n;   RECT rcPaint; (rcl, rct, rcr, rcb)\n;   BOOL fRestore; \n;   BOOL fIncUpdate; \n;   BYTE rgbReserved[32]; \n; } PAINTSTRUCT, *PPAINTSTRUCT; \n!define stPAINTSTRUCT \"(p, i, i, i, i, i, i, i, &v32) p\"\n\n; typedef struct { \n;  UINT      cbSize; \n;  HWND      hwndOwner; \n;  HINSTANCE hInstance; \n;  LPCTSTR   lpszText; \n;  LPCTSTR   lpszCaption; \n;  DWORD     dwStyle; \n;  LPCTSTR   lpszIcon; \n;  DWORD_PTR dwContextHelpId; \n;  MSGBOXCALLBACK lpfnMsgBoxCallback; \n;  DWORD     dwLanguageId; \n; } MSGBOXPARAMS, *PMSGBOXPARAMS; \n!define stMSGBOXPARAMS '(&l4, p, p, t, t, i, t, p, k, i) p'\n\n; typedef struct _SYSTEMTIME { \n;    WORD wYear; \n;    WORD wMonth; \n;    WORD wDayOfWeek; \n;    WORD wDay; \n;    WORD wHour; \n;    WORD wMinute; \n;    WORD wSecond; \n;    WORD wMilliseconds; \n; } SYSTEMTIME, *PSYSTEMTIME; \n!define stSYSTEMTIME '(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2) p'\n\n; Maximal windows path\n!define /ifndef MAX_PATH 260\n\n; typedef struct _WIN32_FIND_DATA {\n;  DWORD    dwFileAttributes; \n;  FILETIME ftCreationTime; \n;  FILETIME ftLastAccessTime; \n;  FILETIME ftLastWriteTime; \n;  DWORD    nFileSizeHigh; \n;  DWORD    nFileSizeLow; \n;  DWORD    dwReserved0; \n;  DWORD    dwReserved1; \n;  TCHAR    cFileName[ MAX_PATH ]; \n;  TCHAR    cAlternateFileName[ 14 ]; \n; } WIN32_FIND_DATA, *PWIN32_FIND_DATA; \n!define stWIN32_FIND_DATA '(i, l, l, l, i, i, i, i, &t${MAX_PATH}, &t14) p'\n\n; ------------- Constants --------------\n\n; == Other ==\n!define /ifndef INVALID_HANDLE_VALUE -1\n\n; == Sounds ==\n\n!define SND_SYNC            0x0000  \n!define SND_ASYNC           0x0001  \n!define SND_NODEFAULT       0x0002  \n!define SND_MEMORY          0x0004  \n!define SND_LOOP            0x0008  \n!define SND_NOSTOP          0x0010  \n\n!define SND_NOWAIT      0x00002000\n!define SND_ALIAS       0x00010000 \n!define SND_ALIAS_ID    0x00110000 \n!define SND_FILENAME    0x00020000\n!define SND_RESOURCE    0x00040004 \n!define SND_PURGE           0x0040  \n!define SND_APPLICATION     0x0080  \n\n; == Windows ==\n\n!define /ifndef WS_OVERLAPPED       0x00000000\n!define /ifndef WS_POPUP            0x80000000\n!define /ifndef WS_CHILD            0x40000000\n!define /ifndef WS_MINIMIZE         0x20000000\n!define /ifndef WS_VISIBLE          0x10000000\n!define /ifndef WS_DISABLED         0x08000000\n!define /ifndef WS_CLIPSIBLINGS     0x04000000\n!define /ifndef WS_CLIPCHILDREN     0x02000000\n!define /ifndef WS_MAXIMIZE         0x01000000\n!define /ifndef WS_CAPTION          0x00C00000\n!define /ifndef WS_BORDER           0x00800000\n!define /ifndef WS_DLGFRAME         0x00400000\n!define /ifndef WS_VSCROLL          0x00200000\n!define /ifndef WS_HSCROLL          0x00100000\n!define /ifndef WS_SYSMENU          0x00080000\n!define /ifndef WS_THICKFRAME       0x00040000\n!define /ifndef WS_GROUP            0x00020000\n!define /ifndef WS_TABSTOP          0x00010000\n!define /ifndef WS_MINIMIZEBOX      0x00020000\n!define /ifndef WS_MAXIMIZEBOX      0x00010000\n!define /ifndef WS_TILED            ${WS_OVERLAPPED}\n!define /ifndef WS_ICONIC           ${WS_MINIMIZE}\n!define /ifndef WS_SIZEBOX          ${WS_THICKFRAME}\n!define /ifndef WS_OVERLAPPEDWINDOW 0x00CF0000\n!define /ifndef WS_TILEDWINDOW      ${WS_OVERLAPPEDWINDOW}\n!define /ifndef WS_POPUPWINDOW      0x80880000\n!define /ifndef WS_CHILDWINDOW      ${WS_CHILD}\n!define /ifndef WS_EX_DLGMODALFRAME     0x00000001\n!define /ifndef WS_EX_NOPARENTNOTIFY    0x00000004\n!define /ifndef WS_EX_TOPMOST           0x00000008\n!define /ifndef WS_EX_ACCEPTFILES       0x00000010\n!define /ifndef WS_EX_TRANSPARENT       0x00000020\n!define /ifndef WS_EX_MDICHILD          0x00000040\n!define /ifndef WS_EX_TOOLWINDOW        0x00000080\n!define /ifndef WS_EX_WINDOWEDGE        0x00000100\n!define /ifndef WS_EX_CLIENTEDGE        0x00000200\n!define /ifndef WS_EX_CONTEXTHELP       0x00000400\n!define /ifndef WS_EX_RIGHT             0x00001000\n!define /ifndef WS_EX_LEFT              0x00000000\n!define /ifndef WS_EX_RTLREADING        0x00002000\n!define /ifndef WS_EX_LTRREADING        0x00000000\n!define /ifndef WS_EX_LEFTSCROLLBAR     0x00004000\n!define /ifndef WS_EX_RIGHTSCROLLBAR    0x00000000\n!define /ifndef WS_EX_CONTROLPARENT     0x00010000\n!define /ifndef WS_EX_STATICEDGE        0x00020000\n!define /ifndef WS_EX_APPWINDOW         0x00040000\n!define /ifndef WS_EX_OVERLAPPEDWINDOW  0x00000300\n!define /ifndef WS_EX_PALETTEWINDOW     0x00000188\n!define /ifndef WS_EX_LAYERED           0x00080000\n!define /ifndef WS_EX_NOINHERITLAYOUT   0x00100000 \n!define /ifndef WS_EX_LAYOUTRTL         0x00400000 \n!define /ifndef WS_EX_COMPOSITED        0x02000000\n!define /ifndef WS_EX_NOACTIVATE        0x08000000\n\n\n; == System Parameters Info ==\n\n!define SPI_GETWORKAREA             0x0030\n\n; == Window swap ==\n\n!define SWP_NOSIZE          0x0001\n!define SWP_NOMOVE          0x0002\n!define SWP_NOZORDER        0x0004\n!define SWP_NOREDRAW        0x0008\n!define SWP_NOACTIVATE      0x0010\n!define SWP_FRAMECHANGED    0x0020  \n!define SWP_SHOWWINDOW      0x0040\n!define SWP_HIDEWINDOW      0x0080\n!define SWP_NOCOPYBITS      0x0100\n!define SWP_NOOWNERZORDER   0x0200  \n!define SWP_NOSENDCHANGING  0x0400  \n\n!define SWP_DRAWFRAME       ${SWP_FRAMECHANGED}\n!define SWP_NOREPOSITION    ${SWP_NOOWNERZORDER}\n!define SWP_DEFERERASE      0x2000\n!define SWP_ASYNCWINDOWPOS  0x4000\n\n; == Bit Copy ==\n\n!define SRCCOPY             0x00CC0020 \n!define SRCPAINT            0x00EE0086 \n!define SRCAND              0x008800C6 \n!define SRCINVERT           0x00660046 \n!define SRCERASE            0x00440328 \n!define NOTSRCCOPY          0x00330008 \n!define NOTSRCERASE         0x001100A6 \n!define MERGECOPY           0x00C000CA \n!define MERGEPAINT          0x00BB0226 \n!define PATCOPY             0x00F00021 \n!define PATPAINT            0x00FB0A09 \n!define PATINVERT           0x005A0049 \n!define DSTINVERT           0x00550009 \n!define BLACKNESS           0x00000042 \n!define WHITENESS           0x00FF0062 \n\n; == Message Box ==\n\n!define MB_OK                       0x00000000\n!define MB_OKCANCEL                 0x00000001\n!define MB_ABORTRETRYIGNORE         0x00000002\n!define MB_YESNOCANCEL              0x00000003\n!define MB_YESNO                    0x00000004\n!define MB_RETRYCANCEL              0x00000005\n!define MB_CANCELTRYCONTINUE        0x00000006\n!define MB_ICONHAND                 0x00000010\n!define MB_ICONQUESTION             0x00000020\n!define MB_ICONEXCLAMATION          0x00000030\n!define MB_ICONASTERISK             0x00000040\n!define MB_USERICON                 0x00000080\n!define MB_ICONWARNING              ${MB_ICONEXCLAMATION}\n!define MB_ICONERROR                ${MB_ICONHAND}\n\n!define MB_ICONINFORMATION          ${MB_ICONASTERISK}\n!define MB_ICONSTOP                 ${MB_ICONHAND}\n\n!define MB_DEFBUTTON1               0x00000000\n!define MB_DEFBUTTON2               0x00000100\n!define MB_DEFBUTTON3               0x00000200\n!define MB_DEFBUTTON4               0x00000300\n\n!define MB_APPLMODAL                0x00000000\n!define MB_SYSTEMMODAL              0x00001000\n!define MB_TASKMODAL                0x00002000\n!define MB_HELP                     0x00004000\n\n!define MB_NOFOCUS                  0x00008000\n!define MB_SETFOREGROUND            0x00010000\n!define MB_DEFAULT_DESKTOP_ONLY     0x00020000\n\n!define MB_TOPMOST                  0x00040000\n!define MB_RIGHT                    0x00080000\n!define MB_RTLREADING               0x00100000\n\n\n; == Callbacks ==\n\n!macro SINGLE_CALLBACK CHKN RES INDEX FUNC\nCheckCB_${CHKN}:\n        Pop ${RES}\n        StrCmp ${RES} \"callback${INDEX}\" 0 ExitCB_${CHKN}\n        Call ${FUNC}\n        Goto CheckCB_${CHKN}\nExitCB_${CHKN}:\n!macroend\n\n!endif\n!verbose pop"
  },
  {
    "path": "setup/nsis/tools/Examples/System/System.nsi",
    "content": "; This is just an example of System Plugin\n; \n; (c) brainsucker, 2002\n; (r) BSForce\n\nName \"System Plugin Example\"\nOutFile \"System.exe\"\nRequestExecutionLevel User\nUnicode True\n\n!include \"SysFunc.nsh\"\n\nSection \"ThisNameIsIgnoredSoWhyBother?\"\n     SetOutPath $TEMP\n\n     ; ----- Sample 1 ----- Message box with custom icon -----\n\n     ; there are no default beeps for custom message boxes, use sysMessageBeep\n     ; in case you need it (see next message box example)\n     !insertmacro smMessageBox \"i 0\" \"Message box with custom icon!\" \"System Example 1a\" ${MB_OK} \"i 103\"\n     ; i 0 - installer exe as module\n     ; i 103 - icon ID\n\n     ; The same example but using icon from resource.dll.\n     ; You could use this dll for storing your resources, just replace FAR icon\n     ; with something you really need.   \n     File \"Resource.dll\"\n     System::Call '${sysMessageBeep} (${MB_ICONHAND})'  ; custom beep\n     !insertmacro smMessageBox \"`$TEMP\\resource.dll`\" \"Message box with custom icon from resource.dll!\" \"System Example 1b\" ${MB_OKCANCEL} \"i 103\"\n     Delete $TEMP\\resource.dll\n\n     ; ----- Sample 2 ----- Fixed disks size/space -----\n\n     StrCpy $7 '               Disk,                Size,                Free,                Free for user:$\\n$\\n'\n\n     ; Memory for paths   \n     System::StrAlloc 1024\n     Pop $1\n     ; Get drives   \n     System::Call '${sysGetLogicalDriveStrings}(1024, r1)'\nenumok:\n     ; One more drive?   \n     System::Call '${syslstrlen}(i r1) .r2'\n     IntCmp $2 0 enumex\n\n     ; Is it DRIVE_FIXED?\n     System::Call '${sysGetDriveType} (i r1) .r3'\n     StrCmp $3 ${DRIVE_FIXED} 0 enumnext\n\n     ; Drive space   \n     System::Call '${sysGetDiskFreeSpaceEx}(i r1, .r3, .r4, .r5)'\n\n     ; Pretty KBs will be saved on stack\n     System::Int64Op $3 / 1048576\n     System::Int64Op $5 / 1048576\n     System::Int64Op $4 / 1048576\n\n     ; Get pretty drive path string   \n     System::Call '*$1(&t1024 .r6)'\n     System::Call '${syswsprintf} (.r7, \"%s%20s    %20s mb    %20s mb    %20s mb$\\n\", tr7, tr6, ts, ts, ts)'\n\nenumnext:\n     ; Next drive path       \n     IntOp $2 $2 * ${NSIS_CHAR_SIZE}\n     IntOp $1 $1 + $2\n     IntOp $1 $1 + ${NSIS_CHAR_SIZE}\n     goto enumok   \nenumex: ; End of drives or user cancel\n     ; Free memory for paths   \n     System::Free $1   \n\n     ; Message box      \n     System::Call '${sysMessageBox}($HWNDPARENT, s, \"System Example 2\", ${MB_OKCANCEL})' \"$7\"\n\n     ; ----- Sample 3 ----- Direct proc definition -----\n\n     ; Direct specification demo\n     System::Call 'user32::MessageBox(p $HWNDPARENT, t \"Just direct MessageBox specification demo ;)\", t \"System Example 3\", i ${MB_OK}) i.s'\n     Pop $0\n\n     ; ----- Sample 4 ----- Int64, mixed definition demo -----\n\n     ; Long int demo\n     StrCpy $2 \"12312312\"\n     StrCpy $3 \"12345678903\"\n     System::Int64Op $2 \"*\" $3\n     Pop $4\n\n     ; Cdecl demo (uses 3 definitions (simple example))\n     System::Call \"${syswsprintf}(.R1, s,,, t, ir0) .R0 (,,tr2,tr3,$4_)\" \"Int64 ops and strange definition demo, %s x %s == %s, and previous msgbox result = %d\"\n     MessageBox MB_OKCANCEL \"Cool: '$R1'\"\n\n     ; ----- Sample 5 ----- Small structure example -----\n\n     ; Create & Fill structure\n     System::Call \"*(i 123123123, &t10 'Hello', &i1 0x123dd, &i2 0xffeeddccaa) i.s\"\n     Pop $1\n     ; Read data from structure   \n     System::Call \"*$1(i .r2, &t10 .r3, &i1 .r4, &i2 .r5, &l0 .r6)\"\n     ; Show data and delete structure\n     MessageBox MB_OK \"Structure example: $\\nint == $2 $\\nstring == $3 $\\nbyte == $4 $\\nshort == $5 $\\nsize == $6\"\n     System::Free $1\n\n     ; ----- Sample 6 ----- systemGetFileSysTime demo -----\n     Call       GetInstallerExeName\n     pop        $0\n\n     !insertmacro smGetFileSysTime $0\n     System::Call '*$R0${stSYSTEMTIME}(.r1, .r2, .r3, .r4, .r5, .r6, .r7, .r8)'\n \n     MessageBox MB_OK \"GetFileSysTime example: file '$0', year $1, month $2, dow $3, day $4, hour $5, min $6, sec $7, ms $8\"     \n\n     ; free memory from SYSTEMTIME\n     System::Free $R0   \n\n     ; ----- Sample 7 ----- systemSplash -> Callbacks demonstration -----\n\n     ; Logo\n     File /oname=spltmp.bmp \"${NSISDIR}\\Contrib\\Graphics\\Header\\orange-nsis.bmp\"\n;     File /oname=spltmp.wav \"d:\\Windows\\Media\\tada.wav\"\n\n     ; I. systemSplash variant\n     !insertmacro smSystemSplash 2000 \"$TEMP\\spltmp\"\n\n     ; II. Splash Plugin variant\n;    splash::show 2000 $TEMP\\spltmp\n;    Pop $R0 ; $R0 has '1' if the user closed the splash screen early,\n\n     ; remove logo\n     Delete $TEMP\\spltmp.bmp\n;     Delete $TEMP\\spltmp.wav\n\n     ; Display splash result\n     pop $0\n     MessageBox MB_OK \"Splash (callbacks) demo result $R0\"\n\nSectionEnd \n\n\nSection \"Quoted path\"\n\n  !define /IfNDef CSIDL_FONTS 0x14\n  StrCpy $9 \"$PluginsDir\\N(S # I)S\" ; Directory with '(', ' ', '#' or ')' needs to be quoted\n  CreateDirectory \"$9\"\n  CopyFiles /Silent /FilesOnly \"$sysdir\\shfolder.dll\" \"$9\\\" ; This could fail on 95 & NT4?\n\n  System::Call '\"$9\\shfolder.dll\"::SHGetFolderPathA(p $hWndParent, i ${CSIDL_FONTS}, p 0, i 0, m \"?\" r1) ?u'\n  DetailPrint Fonts=$1\n\nSectionEnd\n\n\nSection \"Ordinal\"\n\n  System::Call 'OLEAUT32::#2(w \"OLE string\")p.r0' ; SysAllocString\n  System::Call 'USER32::MessageBoxW(p $hWndParent, p r0, w \"OLE:\", i 0)'\n  System::Call 'OLEAUT32::#6(p r0)'\n\nSectionEnd\n\n; eof\n"
  },
  {
    "path": "setup/nsis/tools/Examples/TextFunc.ini",
    "content": "[Settings]\nNumFields=15\nNextButtonText=&Enter\n\n[Field 1]\nType=Droplist\nFlags=NOTIFY\nState=1. LineFind\nListItems=1. LineFind|2. LineRead|3. FileReadFromEnd|4. LineSum|5. FileJoin|6. TextCompare|7. ConfigRead|8. ConfigWrite|9. FileRecode\nLeft=44\nRight=139\nTop=9\nBottom=100\n\n[Field 2]\nType=FileRequest\nLeft=44\nRight=-17\nTop=30\nBottom=41\n\n[Field 3]\nType=FileRequest\nLeft=44\nRight=-17\nTop=46\nBottom=57\n\n[Field 4]\nType=FileRequest\nState=3:-1\nLeft=44\nRight=-17\nTop=62\nBottom=75\n\n[Field 5]\nType=Droplist\nFlags=NOTIFY\nState=Example1  (delete first two symbols)\nListItems=Example1  (delete first two symbols)|Example2  (show changed lines)|Example3  (delete lines)|Example4  (insert lines)|Example5  (replace in file - WordFunc.nsh required)|Example6  (line string to cut or delete)|Example7  (read lines)\nLeft=44\nRight=-36\nTop=81\nBottom=155\n\n[Field 6]\nType=Droplist\nFlags=NOTIFY\nState=Example1  (Different or Equal)\nListItems=Example1  (Different or Equal)|Example2  (Compare line-by-line - Different)|Example3  (Compare line-by-line - Equal)|Example4  (Compare all lines - Different)|Example5  (Compare all lines - Equal)\nLeft=44\nRight=-36\nTop=81\nBottom=140\n\n[Field 7]\nType=Droplist\nState=FileReadFromEndCallback\nListItems=FileReadFromEndCallback\nLeft=44\nRight=-36\nTop=81\nBottom=92\n\n[Field 8]\nType=Text\nFlags=READONLY\nLeft=9\nRight=-36\nTop=108\nBottom=120\n\n[Field 9]\nType=Button\nText=Edit\nFlags=NOTIFY\nLeft=234\nRight=256\nTop=81\nBottom=92\n\n[Field 10]\nType=Button\nText=Log\nFlags=NOTIFY|DISABLED\nLeft=234\nRight=256\nTop=108\nBottom=120\n\n[Field 11]\nType=Label\nText=InputFile\nLeft=10\nRight=43\nTop=32\nBottom=44\n\n[Field 12]\nType=Label\nText=OutputFile\nLeft=10\nRight=43\nTop=48\nBottom=60\n\n[Field 13]\nType=Label\nText=Range\nLeft=10\nRight=44\nTop=65\nBottom=75\n\n[Field 14]\nType=Label\nText=Function\nLeft=10\nRight=43\nTop=81\nBottom=92\n\n[Field 15]\nType=Label\nText=Result:\nLeft=10\nRight=229\nTop=97\nBottom=105\n"
  },
  {
    "path": "setup/nsis/tools/Examples/TextFunc.nsi",
    "content": ";_____________________________________________________________________________\n;\n;                          Text Functions\n;_____________________________________________________________________________\n;\n; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\nName \"Text Functions\"\nOutFile \"TextFunc.exe\"\nCaption \"$(^Name)\"\nXPStyle on\nRequestExecutionLevel user\n\n!include \"WinMessages.nsh\"\n!include \"TextFunc.nsh\"\n\nVar HWND\nVar INI\nVar LOG\nVar PROJECT\nVar CALLBACK\nVar VIEW\nVar FUNCTION\nVar LINEFIND1\nVar LINEFIND2\nVar LINEFIND3\nVar LINEREAD1\nVar LINEREAD2\nVar FILEREADFROMEND1\nVar LINESUM1\nVar FILEJOIN1\nVar FILEJOIN2\nVar FILEJOIN3\nVar TEXTCOMPARE1\nVar TEXTCOMPARE2\nVar TEXTCOMPARE3\nVar CONFIGREAD1\nVar CONFIGREAD2\nVar CONFIGWRITE1\nVar CONFIGWRITE2\nVar CONFIGWRITE3\nVar FILERECODE1\nVar FILERECODE2\n\nPage Custom ShowCustom LeaveCustom\n\nFunction ShowCustom\n\tInstallOptions::initDialog \"$INI\"\n\tPop $hwnd\n\tGetDlgItem $0 $HWND 1206\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1208\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1209\n\tShowWindow $0 0\n\tStrCpy $FUNCTION LineFind\n\tStrCpy $LINEREAD2 10\n\tStrCpy $TEXTCOMPARE3 FastDiff\n\tStrCpy $CONFIGREAD1 \"$WINDIR\\system.ini\"\n\tStrCpy $CONFIGREAD2 \"shell=\"\n\tStrCpy $FILERECODE2 CharToOem\n\tInstallOptions::show\n\tPop $0\nFunctionEnd\n\nFunction LeaveCustom\n\tReadINIStr $0 $INI \"Settings\" \"State\"\n \tReadINIStr $R0 $INI \"Field 1\" \"State\" \t\n\tReadINIStr $R1 $INI \"Field 2\" \"State\"\n \tReadINIStr $R2 $INI \"Field 3\" \"State\"\n \tReadINIStr $R3 $INI \"Field 4\" \"State\"\n \tReadINIStr $R4 $INI \"Field 5\" \"State\"\n \tReadINIStr $R5 $INI \"Field 6\" \"State\"\n\tStrCpy $R4 $R4 8\n\tStrCpy $R5 $R5 8\n\tStrCpy $6 0\n\tStrCpy $7 '$${'\n\tStrCpy $8 'r'\n\tStrCpy $9 'n'\n\n\tStrCmp $0 10 Log\n\tStrCmp $0 9 ViewOrEdit\n\tStrCmp $0 0 Enter\n\tgoto MainSend\n\n\tLog:\n\tExec 'notepad.exe $LOG'\n\tAbort\n\n\tViewOrEdit:\n\tStrCmp $FUNCTION FileReadFromEnd 0 Edit\n\tStrCmp $VIEW '' 0 ViewFileReadFromEndCallback\n\tGetTempFileName $VIEW $PLUGINSDIR\n\tStrCpy $7 '$$'\n\tFileOpen $0 $VIEW w\n\tFileWrite $0 `Function FileReadFromEndCallback$\\r$\\n`\n\tFileWrite $0 `\tMessageBox MB_OKCANCEL '$7$$9       \"Line\"=[$$9]$7\\$9$7$$8           \"#\"=[$$8]$7\\$9$7$$7          \"-#\"=[$$7]' IDOK +2$\\r$\\n`\n\tFileWrite $0 `\tStrCpy $$R0 StopFileReadFromEnd$\\r$\\n$\\r$\\n`\n\tFileWrite $0 `\tPush $$R0$\\r$\\n`\n\tFileWrite $0 `FunctionEnd$\\r$\\n`\n\tFileClose $0\n\tStrCpy $7 '$${'\n\tSetFileAttributes $VIEW READONLY\n\tViewFileReadFromEndCallback:\n\tExec 'notepad.exe $VIEW'\n\tAbort\n\n\tEdit:\n\tStrCmp $CALLBACK '' +5\n\tStrCmp $6$R6 '0$R0$R4$R5' showproject\n\tStrCmp $R6 '$R0$R4$R5' +3\n\tDelete $CALLBACK\n\tStrCpy $CALLBACK ''\n\tStrCpy $R6 '$R0$R4$R5'\n\n\t#Project#\n\tStrCmp $6$R0 \"01. LineFind\" 0 +5\n\tIfFileExists $CALLBACK +2\n\tGetTempFileName $CALLBACK $PLUGINSDIR\n\tFileOpen $0 $CALLBACK w\n\tgoto function\n\tIfFileExists $PROJECT +2\n\tGetTempFileName $PROJECT $PLUGINSDIR\n\tFileOpen $0 $PROJECT w\n\n\t#Name#\n\tFileWrite $0 'Name \"$FUNCTION\"$\\r$\\n'\n\tFileWrite $0 'OutFile \"$PROJECT.exe\"$\\r$\\n$\\r$\\n'\n\n\t#!include#\n\tStrCmp $R0$R4 '1. LineFindExample5' 0 TextFuncInclude\n\tIfFileExists '$EXEDIR\\WordFunc.nsh' 0 +3\n\tFileWrite $0 '!include \"$EXEDIR\\WordFunc.nsh\"$\\r$\\n'\n\tgoto +2\n\tFileWrite $0 '!include \"WordFunc.nsh\"$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordFind$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordFindS$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordFind2X$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordFind2XS$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordFind3X$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordFind3XS$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordReplace$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordReplaceS$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordAdd$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordAddS$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordInsert$\\r$\\n'\n\tFileWrite $0 '!insertmacro WordInsertS$\\r$\\n'\n\tFileWrite $0 '!insertmacro StrFilter$\\r$\\n'\n\tFileWrite $0 '!insertmacro StrFilterS$\\r$\\n'\n\tTextFuncInclude:\n\tIfFileExists '$EXEDIR\\TextFunc.nsh' 0 +3\n\tFileWrite $0 '!include \"$EXEDIR\\TextFunc.nsh\"$\\r$\\n'\n\tgoto +2\n\tFileWrite $0 '!include \"TextFunc.nsh\"$\\r$\\n'\n\tFileWrite $0 '!insertmacro $FUNCTION$\\r$\\n'\n\tStrCmp $FUNCTION TextCompare +2\n\tFileWrite $0 '!insertmacro TrimNewLines$\\r$\\n'\n\n\t#Section#\n\tFileWrite $0 '$\\r$\\nSection -empty$\\r$\\n'\n\tFileWrite $0 'SectionEnd$\\r$\\n$\\r$\\n'\n\n\t#Function .onInit#\n\tFileWrite $0 'Function .onInit$\\r$\\n'\n\tStrCmp $R0$R5 \"6. TextCompareExample1\" 0 TextCompareExample235\n\tFileWrite $0 '\tStrCpy $$R0 \"\"$\\r$\\n'\n\tFileWrite $0 '\t$7TextCompare} \"$R1\" \"$R2\" \"$R3\" \"$R5\"$\\r$\\n'\n\tFileWrite $0 '\tIfErrors error$\\r$\\n'\n\tFileWrite $0 '\tStrCmp $$R0 NotEqual 0 +2$\\r$\\n'\n\tFileWrite $0 '\tMessageBox MB_OK \"             Files differ\" IDOK +2$\\r$\\n'\n\tFileWrite $0 '\tMessageBox MB_OK \"           Files identical\"$\\r$\\n'\n\tFileWrite $0 '\tgoto end$\\r$\\n$\\r$\\n'\n\tgoto endoninit\n\tTextCompareExample235:\n\tStrCmp $R0$R5 \"6. TextCompareExample2\" +3\n\tStrCmp $R0$R5 \"6. TextCompareExample3\" +2\n\tStrCmp $R0$R5 \"6. TextCompareExample5\" 0 TextCompareExample4\n\tFileWrite $0 '\tStrCpy $$R0 \"$R1\"$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$R1 \"$R2\"$\\r$\\n$\\r$\\n'\n\tFileWrite $0 '\tGetTempFileName $$R2$\\r$\\n'\n\tFileWrite $0 '\tFileOpen $$R3 $$R2 w$\\r$\\n'\n\tFileWrite $0 '\tFileWrite $$R3 \"$$R0 | $$R1$$\\$8$$\\$9\"$\\r$\\n'\n\tFileWrite $0 '\t$7TextCompare} \"$$R0\" \"$$R1\" \"$R3\" \"$R5\"$\\r$\\n'\n\tFileWrite $0 '\tIfErrors error$\\r$\\n'\n\tFileWrite $0 '\tExec \"notepad.exe $$R2\"$\\r$\\n'\n\tFileWrite $0 '\tgoto end$\\r$\\n$\\r$\\n'\n\tgoto endoninit\n\tTextCompareExample4:\n\tStrCmp $R0$R5 \"6. TextCompareExample4\" 0 LineFindExample123456\n\tFileWrite $0 '\tStrCpy $$R0 \"$R1\"$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$R1 \"$R2\"$\\r$\\n$\\r$\\n'\n\tFileWrite $0 '\tGetTempFileName $$R2$\\r$\\n'\n\tFileWrite $0 '\tFileOpen $$R3 $$R2 w$\\r$\\n'\n\tFileWrite $0 '\tFileWrite $$R3 \"$$R0 | $$R1$$\\$8$$\\$9\"$\\r$\\n'\n\tFileWrite $0 '\t$7TextCompare} \"$$R0\" \"$$R1\" \"$R3\" \"$R5\"$\\r$\\n'\n\tFileWrite $0 '\tIfErrors error$\\r$\\n'\n\tFileWrite $0 '\tFileWrite $$R3 \"$$\\$8$$\\$9$$R1 | $$R0$$\\$8$$\\$9\"$\\r$\\n'\n\tFileWrite $0 '\t$7TextCompare} \"$$R1\" \"$$R0\" \"$R3\" \"$R5\"$\\r$\\n'\n\tFileWrite $0 '\tFileClose $$R3$\\r$\\n'\n\tFileWrite $0 '\tIfErrors error$\\r$\\n'\n\tFileWrite $0 '\tExec \"notepad.exe $$R2\"$\\r$\\n$\\r$\\n'\n\tFileWrite $0 '\tgoto end$\\r$\\n$\\r$\\n'\n\tgoto endoninit\n\tLineFindExample123456:\n\tFileWrite $0 '\t$7$FUNCTION} \"$R1\" \"$R2\" \"$R3\" \"$R4\"$\\r$\\n'\n\tFileWrite $0 '\tIfErrors error$\\r$\\n'\n\tFileWrite $0 '\tMessageBox MB_YESNO \"          Open output file?\" IDNO end$\\r$\\n'\n\tFileWrite $0 '\tStrCmp \"$R2\" \"\" 0 +3$\\r$\\n'\n\tFileWrite $0 `\tExec 'notepad.exe \"$R1\"'$\\r$\\n`\n\tFileWrite $0 '\tgoto end$\\r$\\n'\n\tFileWrite $0 '\tSearchPath $$R2 \"$R2\"$\\r$\\n'\n\tFileWrite $0 `\tExec 'notepad.exe \"$$R2\"'$\\r$\\n`\n\tFileWrite $0 '\tgoto end$\\r$\\n$\\r$\\n'\n\tendoninit:\n\tFileWrite $0 '\terror:$\\r$\\n'\n\tFileWrite $0 '\tMessageBox MB_OK \"Error\"$\\r$\\n$\\r$\\n'\n\tFileWrite $0 '\tend:$\\r$\\n'\n\tFileWrite $0 '\tQuit$\\r$\\n'\n\tFileWrite $0 'FunctionEnd$\\r$\\n$\\r$\\n'\n\t#FunctionEnd#\n\n\n\t#Function CallBack#\n\tStrCmp $CALLBACK '' 0 close\n\tfunction:\n\tStrCmp $R0 '1. LineFind' 0 +8\n\tFileWrite $0 'Function $R4$\\r$\\n'\n\tStrCmp $R4 \"Example1\" Example1LF\n\tStrCmp $R4 \"Example2\" Example2LF\n\tStrCmp $R4 \"Example3\" Example3LF\n\tStrCmp $R4 \"Example4\" Example4LF\n\tStrCmp $R4 \"Example5\" Example5LF\n\tStrCmp $R4 \"Example6\" Example6LF\n\n\tFileWrite $0 'Function $R5$\\r$\\n'\n\tStrCmp $R5 \"Example1\" Example1TC\n\tStrCmp $R5 \"Example2\" Example2TC\n\tStrCmp $R5 \"Example3\" Example3TC\n\tStrCmp $R5 \"Example4\" Example4TC\n\tStrCmp $R5 \"Example5\" Example3TC\n\n\tExample1LF:\n\tFileWrite $0 \"\t$7TrimNewLines} '$$R9' $$R9$\\r$\\n\"\n\tFileWrite $0 \"\tStrCpy $$R9 $$R9 '' 2       ;delete first two symbols$\\r$\\n\"\n\tFileWrite $0 \"\tStrCpy $$R9 '$$R9$$\\$8$$\\$9'$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample2LF:\n\tFileWrite $0 \"\t$7TrimNewLines} '$$R9' $$R9$\\r$\\n\"\n\tFileWrite $0 \"\tStrCpy $$R9 '$$R9   ~Changed line ($$R8)~$$\\$8$$\\$9'$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample3LF:\n\tFileWrite $0 \"\tStrCpy $$0 SkipWrite$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample4LF:\n\tFileWrite $0 \"\tFileWrite $$R4 '---First Line---$$\\$8$$\\$9'$\\r$\\n\"\n\tFileWrite $0 \"\tFileWrite $$R4 '---Second Line ...---$$\\$8$$\\$9'$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample5LF:\n\tFileWrite $0 \"\t; You can use:$\\r$\\n\"\n\tFileWrite $0 \"\t; $7WordFind}|$7WordFindS}|$7WordFind2X}|$7WordFind2XS}|$\\r$\\n\"\n\tFileWrite $0 \"\t; $7WordFind3X}|$7WordFind3XS}|$7WordReplace}|$7WordReplaceS}|$\\r$\\n\"\n\tFileWrite $0 \"\t; $7WordAdd}|$7WordAddS}|$7WordInsert}|$7WordInsertS}|$\\r$\\n\"\n\tFileWrite $0 \"\t; $7StrFilter}|$7StrFilterS}$\\r$\\n$\\r$\\n\"\n\tFileWrite $0 \"\t$7WordReplace} '$$R9' ' ' '_' '+*' $$R9$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample6LF:\n\tFileWrite $0 '\t;(Cut lines from a line to another line (also including that line))$\\r$\\n'\n\tFileWrite $0 '\tStrCmp $$R0 finish stop$\\r$\\n'\n\tFileWrite $0 '\tStrCmp $$R0 start finish$\\r$\\n'\n\tFileWrite $0 '\tStrCmp $$R9 \"Start Line$$\\$8$$\\$9\" 0 skip$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$R0 start$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$R1 $$R9$\\r$\\n'\n\tFileWrite $0 '\tgoto code$\\r$\\n'\n\tFileWrite $0 '\tfinish:$\\r$\\n'\n\tFileWrite $0 '\tStrCmp $$R9 \"Finish Line$$\\$8$$\\$9\" 0 code$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$R0 finish$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$R2 $$R8$\\r$\\n'\n\tFileWrite $0 '\tgoto code$\\r$\\n'\n\tFileWrite $0 '\tskip:$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$0 SkipWrite$\\r$\\n'\n\tFileWrite $0 '\tgoto output$\\r$\\n'\n\tFileWrite $0 '\tstop:$\\r$\\n'\n\tFileWrite $0 '\tStrCpy $$0 StopLineFind$\\r$\\n'\n\tFileWrite $0 '\tgoto output$\\r$\\n$\\r$\\n'\n\tFileWrite $0 '\t;;(Delete lines from a line to another line (also including that line))$\\r$\\n'\n\tFileWrite $0 '\t; StrCmp $$R0 finish code$\\r$\\n'\n\tFileWrite $0 '\t; StrCmp $$R0 start finish$\\r$\\n'\n\tFileWrite $0 '\t; StrCmp $$R9 \"Start Line$$\\$8$$\\$9\" 0 code$\\r$\\n'\n\tFileWrite $0 '\t; StrCpy $$R0 start$\\r$\\n'\n\tFileWrite $0 '\t; StrCpy $$R1 $$R8$\\r$\\n'\n\tFileWrite $0 '\t; goto skip$\\r$\\n'\n\tFileWrite $0 '\t; finish:$\\r$\\n'\n\tFileWrite $0 '\t; StrCmp $$R9 \"Finish Line$$\\$8$$\\$9\" 0 skip$\\r$\\n'\n\tFileWrite $0 '\t; StrCpy $$R0 finish$\\r$\\n'\n\tFileWrite $0 '\t; StrCpy $$R2 $$R8$\\r$\\n'\n\tFileWrite $0 '\t; skip:$\\r$\\n'\n\tFileWrite $0 '\t; StrCpy $$0 SkipWrite$\\r$\\n'\n\tFileWrite $0 '\t; goto output$\\r$\\n$\\r$\\n'\n\tFileWrite $0 '\tcode:$\\r$\\n'\n\tFileWrite $0 '\t;...$\\r$\\n$\\r$\\n'\n\tFileWrite $0 '\toutput:$\\r$\\n'\n\tgoto endwrite\n\tExample1TC:\n\tFileWrite $0 \"\tStrCpy $$R0 NotEqual$\\r$\\n\"\n\tFileWrite $0 \"\tStrCpy $$0 StopTextCompare$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample2TC:\n\tFileWrite $0 \"\tFileWrite $$R3 '$$8=$$9'$\\r$\\n\"\n\tFileWrite $0 \"\tFileWrite $$R3 '$$6=$$7$$\\$8$$\\$9'$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample3TC:\n\tFileWrite $0 \"\tFileWrite $$R3 '$$8|$$6=$$9'$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tExample4TC:\n\tFileWrite $0 \"\tFileWrite $$R3 '$$8=$$9'$\\r$\\n$\\r$\\n\"\n\tgoto endwrite\n\tendwrite:\n\tFileWrite $0 '\tPush $$0$\\r$\\n'\n\tFileWrite $0 'FunctionEnd$\\r$\\n'\n\tclose:\n\tFileClose $0\n\tgoto $6\n\t#FunctionEnd#\n\n\tshowproject:\n\tStrCmp $R0 '1. LineFind' 0 +3\n\tExecWait 'notepad.exe $CALLBACK'\n\tgoto +4\n\tSetFileAttributes $PROJECT READONLY\n\tExecWait 'notepad.exe $PROJECT'\n\tSetFileAttributes $PROJECT NORMAL\n\tAbort\n\n\tMainSend:\n\tGetDlgItem $0 $HWND 1210\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 1\n\tEnableWindow $0 1\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 1\n\tEnableWindow $0 1\n\tGetDlgItem $0 $HWND 1205\n\tEnableWindow $0 1\n\tGetDlgItem $0 $HWND 1206\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1207\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1208\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1209\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1211\n\tEnableWindow $0 1\n\n\tStrCmp $FUNCTION LineFind 0 +5\n\tStrCpy $LINEFIND1 $R1\n\tStrCpy $LINEFIND2 $R2\n\tStrCpy $LINEFIND3 $R3\n\tgoto LineFindSend\n\tStrCmp $FUNCTION LineRead 0 +4\n\tStrCpy $LINEREAD1 $R1\n\tStrCpy $LINEREAD2 $R2\n\tgoto LineFindSend\n\tStrCmp $FUNCTION FileReadFromEnd 0 +3\n\tStrCpy $FILEREADFROMEND1 $R1\n\tgoto LineFindSend\n\tStrCmp $FUNCTION LineSum 0 +3\n\tStrCpy $LINESUM1 $R1\n\tgoto LineFindSend\n\tStrCmp $FUNCTION FileJoin 0 +5\n\tStrCpy $FILEJOIN1 $R1\n\tStrCpy $FILEJOIN2 $R2\n\tStrCpy $FILEJOIN3 $R3\n\tgoto LineFindSend\n\tStrCmp $FUNCTION TextCompare 0 +5\n\tStrCpy $TEXTCOMPARE1 $R1\n\tStrCpy $TEXTCOMPARE2 $R2\n\tStrCpy $TEXTCOMPARE3 $R3\n\tgoto LineFindSend\n\tStrCmp $FUNCTION ConfigRead 0 +4\n\tStrCpy $CONFIGREAD1 $R1\n\tStrCpy $CONFIGREAD2 $R2\n\tgoto LineFindSend\n\tStrCmp $FUNCTION ConfigWrite 0 +5\n\tStrCpy $CONFIGWRITE1 $R1\n\tStrCpy $CONFIGWRITE2 $R2\n\tStrCpy $CONFIGWRITE3 $R3\n\tgoto LineFindSend\n\tStrCmp $FUNCTION FileRecode 0 +3\n\tStrCpy $FILERECODE1 $R1\n\tStrCpy $FILERECODE2 $R2\n\n\tLineFindSend:\n\tStrCmp $R0 \"1. LineFind\" 0 LineReadSend\n\tStrCmp $FUNCTION LineFind 0 LineFindSend2\n\tStrCmp $R4 \"Example1\" 0 +3\n\tStrCpy $LINEFIND3 \"3:-1\"\n\tgoto LineFindSend2\n\tStrCmp $R4 \"Example2\" 0 +3\n\tStrCpy $LINEFIND3 \"{5:12 15 -6:-5 -1}\"\n\tgoto LineFindSend2\n\tStrCmp $R4 \"Example3\" 0 +3\n\tStrCpy $LINEFIND3 \"2:3 10:-5 -3:-2\"\n\tgoto LineFindSend2\n\tStrCmp $R4 \"Example4\" 0 +3\n\tStrCpy $LINEFIND3 \"10\"\n\tgoto LineFindSend2\n\tStrCmp $R4 \"Example5\" 0 +3\n\tStrCpy $LINEFIND3 \"1:-1\"\n\tgoto LineFindSend2\n\tStrCmp $R4 \"Example6\" 0 +3\n\tStrCpy $LINEFIND3 \"\"\n\tgoto LineFindSend2\n\tStrCmp $R4 \"Example7\" 0 +2\n\tStrCpy $LINEFIND3 \"1:-1\"\n\n\tLineFindSend2:\n\tStrCpy $FUNCTION LineFind\n\tStrCmp $LINEFIND2 '/NUL' 0 +2\n\tStrCpy $LINEFIND2 ''\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$LINEFIND1\"\n\tGetDlgItem $0 $HWND 1203\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$LINEFIND2\"\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$LINEFIND3\"\n\tGetDlgItem $0 $HWND 1207\n\tShowWindow $0 1\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Edit\"\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 1\n\tStrCmp $LOG '' +2\n\tEnableWindow $0 1\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:OutputFile\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Range\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Function\"\n\n\tStrCmp $R4 \"Example7\" 0 +9\n\tGetDlgItem $0 $HWND 1203\n\tEnableWindow $0 0\n\tSendMessage $0 ${WM_ENABLE} 1 0\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:/NUL\"\n\tGetDlgItem $0 $HWND 1204\n\tEnableWindow $0 0\n\tGetDlgItem $0 $HWND 1211\n\tEnableWindow $0 0\n\tabort\n\n\n\tLineReadSend:\n\tStrCmp $R0 \"2. LineRead\" 0 FileReadFromEndSend\n\tStrCpy $FUNCTION LineRead\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$LINEREAD1\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$LINEREAD2\"\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Line #\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tAbort\n\n\tFileReadFromEndSend:\n\tStrCmp $R0 \"3. FileReadFromEnd\" 0 LineSumSend\n\tStrCpy $FUNCTION FileReadFromEnd\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$FILEREADFROMEND1\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1209\n\tShowWindow $0 1\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:View\"\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Function\"\n\tAbort\n\n\tLineSumSend:\n\tStrCmp $R0 \"4. LineSum\" 0 FileJoinSend\n\tStrCpy $FUNCTION LineSum\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$LINESUM1\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tAbort\n\n\tFileJoinSend:\n\tStrCmp $R0 \"5. FileJoin\" 0 TextCompareSend\n\tStrCpy $FUNCTION FileJoin\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$FILEJOIN1\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$FILEJOIN2\"\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 1\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 1\n\tEnableWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$FILEJOIN3\"\n\tGetDlgItem $0 $HWND 1206\n\tShowWindow $0 1\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile1\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile2\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:OutputFile\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tAbort\n\n\tTextCompareSend:\n\tStrCmp $R0 \"6. TextCompare\" 0 ConfigReadSend\n\tStrCmp $FUNCTION TextCompare 0 TextCompareSend2\n\tStrCmp $R5 \"Example1\" 0 +3\n\tStrCpy $TEXTCOMPARE3 \"FastDiff\"\n\tgoto TextCompareSend2\n\tStrCmp $R5 \"Example2\" 0 +3\n\tStrCpy $TEXTCOMPARE3 \"FastDiff\"\n\tgoto TextCompareSend2\n\tStrCmp $R5 \"Example3\" 0 +3\n\tStrCpy $TEXTCOMPARE3 \"FastEqual\"\n\tgoto TextCompareSend2\n\tStrCmp $R5 \"Example4\" 0 +3\n\tStrCpy $TEXTCOMPARE3 \"SlowDiff\"\n\tgoto TextCompareSend2\n\tStrCmp $R5 \"Example5\" 0 +2\n\tStrCpy $TEXTCOMPARE3 \"SlowEqual\"\n\n\tTextCompareSend2:\n\tStrCpy $FUNCTION TextCompare\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$TEXTCOMPARE1\"\n\tGetDlgItem $0 $HWND 1203\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$TEXTCOMPARE2\"\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 1\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 1\n\tEnableWindow $0 0\n\tSendMessage $0 ${WM_ENABLE} 1 0\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$TEXTCOMPARE3\"\n\tGetDlgItem $0 $HWND 1208\n\tShowWindow $0 1\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:View\"\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 1\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:TextFile1\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:TextFile2\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Option\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Function\"\n\tabort\n\n\tConfigReadSend:\n\tStrCmp $R0 \"7. ConfigRead\" 0 ConfigWriteSend\n\tStrCpy $FUNCTION ConfigRead\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$CONFIGREAD1\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$CONFIGREAD2\"\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Entry\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tAbort\n\n\tConfigWriteSend:\n\tStrCmp $R0 \"8. ConfigWrite\" 0 FileRecodeSend\n\tStrCpy $FUNCTION ConfigWrite\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$CONFIGWRITE1\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$CONFIGWRITE2\"\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$CONFIGWRITE3\"\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Entry\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Value\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tAbort\n\n\tFileRecodeSend:\n\tStrCmp $R0 \"9. FileRecode\" 0 Abort\n\tStrCpy $FUNCTION FileRecode\n\tGetDlgItem $0 $HWND 1201\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$FILERECODE1\"\n\tGetDlgItem $0 $HWND 1203\n\tShowWindow $0 1\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:$FILERECODE2\"\n\tGetDlgItem $0 $HWND 1204\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1205\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1211\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1212\n\tShowWindow $0 0\n\tGetDlgItem $0 $HWND 1213\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:InputFile\"\n\tGetDlgItem $0 $HWND 1214\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:Format\"\n\tGetDlgItem $0 $HWND 1215\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $0 $HWND 1216\n\tSendMessage $0 ${WM_SETTEXT} 1 \"STR:\"\n\tAbort\n\n;=Enter=\n\tEnter:\n\tStrCmp $R1 '' 0 +3\n\tStrCpy $0 'Choose InputFile'\n\tgoto send\n\tIfFileExists $R1 +3\n\tStrCpy $0 'InputFile is not exist'\n\tgoto send\n\n\tStrCmp $R0 \"1. LineFind\" LineFindRead\n\tStrCmp $R0 \"2. LineRead\" LineRead\n\tStrCmp $R0 \"3. FileReadFromEnd\" FileReadFromEnd\n\tStrCmp $R0 \"4. LineSum\" LineSum\n\tStrCmp $R0 \"5. FileJoin\" FileJoin\n\tStrCmp $R0 \"6. TextCompare\" LineFind-TextCompare\n\tStrCmp $R0 \"7. ConfigRead\" ConfigRead\n\tStrCmp $R0 \"8. ConfigWrite\" ConfigWrite\n\tStrCmp $R0 \"9. FileRecode\" FileRecode\n\tAbort\n\n\tLineFindRead:\n\tStrCmp $R4 \"Example7\" 0 LineFind-TextCompare\n\t${LineFind} '$R1' '/NUL' '$R3' LineFindCallback\n\tIfErrors error\n\tStrCmp $R0 StopLineFind 0 done\n\tStrCpy $0 'stopped'\n\tgoto send\n\n\tLineFind-TextCompare:\n\tGetLabelAddress $6 LineFindBack\n\tgoto Edit\n\tLineFindBack:\n\tFileClose $0\n\tStrCmp $R0 \"6. TextCompare\" Compile\n\tStrCmp $CALLBACK '' Compile\n\t${FileJoin} \"$PROJECT\" \"$CALLBACK\" \"\"\n\n\tCompile:\n\tStrCmp $LOG '' 0 +4\n\tGetTempFileName $LOG $PLUGINSDIR\n\tGetDlgItem $0 $HWND 1212\n\tEnableWindow $0 1\n\tReadRegStr $0 HKLM \"SOFTWARE\\NSIS\" \"\"\n\tIfErrors 0 +2\n\tStrCpy $0 \"${NSISDIR}\"\n\tnsExec::Exec '\"$0\\makensis.exe\" /O$LOG $PROJECT'\n\tPop $0\n\tStrCmp $0 0 0 +6\n\tExecWait '$PROJECT.exe' $0\n\tDelete $PROJECT\n\tDelete $PROJECT.exe\n\tStrCpy $PROJECT ''\n\tgoto done\n\tMessageBox MB_YESNO|MB_ICONEXCLAMATION \"Compile error. Open log?\" IDNO +2\n\tExec 'notepad.exe $LOG'\n\tStrCpy $0 \"Compile Error\"\n\tgoto send\n\n\tLineRead:\n\t${LineRead} \"$R1\" \"$R2\" $0\n\tIfErrors error send\n\n\tFileReadFromEnd:\n\t${FileReadFromEnd} \"$R1\" \"FileReadFromEndCallback\"\n\tIfErrors error\n\tStrCmp $R0 StopFileReadFromEnd 0 done\n\tStrCpy $0 'stopped'\n\tgoto send\n\n\tLineSum:\n\t${LineSum} \"$R1\" $0\n\tIfErrors error send\n\n\tFileJoin:\n\t${FileJoin} \"$R1\" \"$R2\" \"$R3\"\n\tIfErrors error\n\tMessageBox MB_YESNO \"          Open output file?\" IDNO done\n\tStrCmp $R3 '' 0 +3\n\tExec '\"notepad.exe\" \"$R1\"'\n\tgoto done\n\tExec '\"notepad.exe\" \"$R3\"'\n\tgoto done\n\n\tConfigRead:\n\t${ConfigRead} \"$R1\" \"$R2\" $0\n\tIfErrors error send\n\n\tConfigWrite:\n\t${ConfigWrite} \"$R1\" \"$R2\" \"$R3\" $0\n\tIfErrors error\n\tMessageBox MB_YESNO \"          Open output file?\" IDNO send\n\tExec '\"notepad.exe\" \"$R1\"'\n\tgoto send\n\n\tFileRecode:\n\t${FileRecode} \"$R1\" \"$R2\"\n\tIfErrors error\n\tMessageBox MB_YESNO \"          Open output file?\" IDNO done\n\tExec '\"notepad.exe\" \"$R1\"'\n\tgoto done\n\n\terror:\n\tStrCpy $0 'error'\n\tgoto send\n\n\tdone:\n\tStrCpy $0 'Done'\n\n\tsend:\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$0\"\n\n\tabort:\n\tAbort\nFunctionEnd\n\nFunction LineFindCallback\n\tMessageBox MB_OKCANCEL '$$R9       \"Line\"=[$R9]$\\n$$R8           \"#\"=[$R8]$\\n$$R7          \"-#\"=[$R7]$\\n$$R6   \"Range\"=[$R6]$\\n$$R5     \"Read\"=[$R5]$\\n$$R4     \"Write\"=[$R4]' IDOK +2\n\tStrCpy $R0 StopLineFind\n\n\tPush $R0\nFunctionEnd\n\nFunction FileReadFromEndCallback\n\tMessageBox MB_OKCANCEL '$$9       \"Line\"=[$9]$\\n$$8           \"#\"=[$8]$\\n$$7          \"-#\"=[$7]' IDOK +2\n\tStrCpy $R0 StopFileReadFromEnd\n\n\tPush $R0\nFunctionEnd\n\nFunction .onInit\n\tInitPluginsDir\n\tGetTempFileName $INI $PLUGINSDIR\n\tFile /oname=$INI \"TextFunc.ini\"\nFunctionEnd\n\nPage instfiles\n\nSection -Empty\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/TextFuncTest.nsi",
    "content": ";_____________________________________________________________________________\n;\n;                          Text Functions Test\n;_____________________________________________________________________________\n;\n; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\nName \"Text Functions Test\"\nOutFile \"TextFuncTest.exe\"\nCaption \"$(^Name)\"\nShowInstDetails show\nXPStyle on\nRequestExecutionLevel user\n\nVar FUNCTION\nVar TEMPFILE1\nVar TEMPFILE2\nVar TEMPFILE3\nVar HANDLE\nVar OUT\n\n!include \"TextFunc.nsh\"\n\n;############### INSTALL ###############\n\n!define StackVerificationStart `!insertmacro StackVerificationStart`\n!macro StackVerificationStart _FUNCTION\n\tStrCpy $FUNCTION ${_FUNCTION}\n\tCall StackVerificationStart\n!macroend\n\n!define StackVerificationEnd `!insertmacro StackVerificationEnd`\n!macro StackVerificationEnd\n\tCall StackVerificationEnd\n!macroend\n\nFunction StackVerificationStart\n\tStrCpy $0 !0\n\tStrCpy $1 !1\n\tStrCpy $2 !2\n\tStrCpy $3 !3\n\tStrCpy $4 !4\n\tStrCpy $5 !5\n\tStrCpy $6 !6\n\tStrCpy $7 !7\n\tStrCpy $8 !8\n\tStrCpy $9 !9\n\tStrCpy $R0 !R0\n\tStrCpy $R1 !R1\n\tStrCpy $R2 !R2\n\tStrCpy $R3 !R3\n\tStrCpy $R4 !R4\n\tStrCpy $R5 !R5\n\tStrCpy $R6 !R6\n\tStrCpy $R7 !R7\n\tStrCpy $R8 !R8\n\tStrCpy $R9 !R9\nFunctionEnd\n\nFunction StackVerificationEnd\n\tIfErrors +3\n\tDetailPrint 'PASSED $FUNCTION no errors'\n\tgoto +2\n\tDetailPrint 'FAILED   $FUNCTION error'\n\n\tStrCmp $0 '!0' 0 error\n\tStrCmp $1 '!1' 0 error\n\tStrCmp $2 '!2' 0 error\n\tStrCmp $3 '!3' 0 error\n\tStrCmp $4 '!4' 0 error\n\tStrCmp $5 '!5' 0 error\n\tStrCmp $6 '!6' 0 error\n\tStrCmp $7 '!7' 0 error\n\tStrCmp $8 '!8' 0 error\n\tStrCmp $9 '!9' 0 error\n\tStrCmp $R0 '!R0' 0 error\n\tStrCmp $R1 '!R1' 0 error\n\tStrCmp $R2 '!R2' 0 error\n\tStrCmp $R3 '!R3' 0 error\n\tStrCmp $R4 '!R4' 0 error\n\tStrCmp $R5 '!R5' 0 error\n\tStrCmp $R6 '!R6' 0 error\n\tStrCmp $R7 '!R7' 0 error\n\tStrCmp $R8 '!R8' 0 error\n\tStrCmp $R9 '!R9' 0 error\n\tDetailPrint 'PASSED $FUNCTION stack'\n\tgoto end\n\n\terror:\n\tDetailPrint 'FAILED   $FUNCTION stack'\n;\tMessageBox MB_OKCANCEL '$$0={$0}$\\n$$1={$1}$\\n$$2={$2}$\\n$$3={$3}$\\n$$4={$4}$\\n$$5={$5}$\\n$$6={$6}$\\n$$7={$7}$\\n$$8={$8}$\\n$$9={$9}$\\n$$R0={$R0}$\\n$$R1={$R1}$\\n$$R2={$R2}$\\n$$R3={$R3}$\\n$$R4={$R4}$\\n$$R5={$R5}$\\n$$R6={$R6}$\\n$$R7={$R7}$\\n$$R8={$R8}$\\n$$R9={$R9}' IDOK +2\n;\tquit\n\n\tend:\nFunctionEnd\n\n\n\nSection CreateTestFile\n\tGetTempFileName $TEMPFILE1\n\tFileOpen $HANDLE $TEMPFILE1 w\n\tFileWrite $HANDLE '1A=a$\\r$\\n'\n\tFileWrite $HANDLE '2B=b$\\r$\\n'\n\tFileWrite $HANDLE '3C=c$\\r$\\n'\n\tFileWrite $HANDLE '4D=d$\\r$\\n'\n\tFileWrite $HANDLE '5E=e$\\r$\\n'\n\tFileClose $HANDLE\n\tGetTempFileName $TEMPFILE2\n\tGetTempFileName $TEMPFILE3\nSectionEnd\n\n\nSection LineFind\n\t${StackVerificationStart} LineFind\n\n\t${LineFind} '$TEMPFILE1' '/NUL' '1:-4 3 -1' 'LineFindCallback1'\n\tIfErrors error\n\tStrCmp $OUT '|1:2|-5|1|1A=a$\\r$\\n|1:2|-4|2|2B=b$\\r$\\n|3:3|-3|3|3C=c$\\r$\\n' 0 error\n\n\tStrCpy $OUT ''\n\tSetDetailsPrint none\n\t${LineFind} '$TEMPFILE1' '$TEMPFILE2' '1:-1' 'LineFindCallback2'\n\tSetDetailsPrint both\n\tIfErrors error\n\tStrCmp $OUT '|1:-1||1|1A=a$\\r$\\n|1:-1||2|4D=d$\\r$\\n|1:-1||3|3C=c$\\r$\\n|1:-1||4|2B=B$\\r$\\n|1:-1||5|5E=e$\\r$\\n' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\nFunction LineFindCallback1\n\tStrCpy $OUT '$OUT|$R6|$R7|$R8|$R9'\n\tStrCmp $R8 3 0 +2\n\tStrCpy $0 StopLineFind\n\n\tPush $0\nFunctionEnd\n\nFunction LineFindCallback2\n\tStrCmp $R8 2 0 +2\n\tStrCpy $R9 '4D=d$\\r$\\n'\n\tStrCmp $R8 4 0 +2\n\tStrCpy $R9 '2B=B$\\r$\\n'\n\n\tStrCpy $OUT '$OUT|$R6|$R7|$R8|$R9'\n\n\tPush $0\nFunctionEnd\n\n\nSection LineRead\n\t${StackVerificationStart} LineRead\n\n\t${LineRead} '$TEMPFILE1' '-1' $OUT\n\tIfErrors error\n\tStrCmp $OUT '5E=e$\\r$\\n' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection FileReadFromEnd\n\t${StackVerificationStart} FileReadFromEnd\n\n\tStrCpy $OUT ''\n\t${FileReadFromEnd} '$TEMPFILE1' 'FileReadFromEndCallback'\n\tIfErrors error\n\tStrCmp $OUT '|-1|5|5E=e$\\r$\\n|-2|4|4D=d$\\r$\\n|-3|3|3C=c$\\r$\\n|-4|2|2B=b$\\r$\\n' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\nFunction FileReadFromEndCallback\n\tStrCpy $OUT '$OUT|$7|$8|$9'\n\tStrCmp $8 2 0 +2\n\tStrCpy $0 StopFileReadFromEnd\n\n\tPush $0\nFunctionEnd\n\n\nSection LineSum\n\t${StackVerificationStart} LineSum\n\n\t${LineSum} '$TEMPFILE1' $OUT\n\tIfErrors error\n\tStrCmp $OUT '5' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection FileJoin\n\t${StackVerificationStart} FileJoin\n\n\tSetDetailsPrint none\n\t${FileJoin} '$TEMPFILE1' '$TEMPFILE2' '$TEMPFILE3'\n\tSetDetailsPrint both\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection TextCompare\n\t${StackVerificationStart} TextCompare\n\n\tStrCpy $OUT ''\n\t${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'TextCompareCallback'\n\tStrCmp $OUT '|2|4D=d$\\r$\\n|2|2B=b$\\r$\\n|4|2B=B$\\r$\\n|4|4D=d$\\r$\\n' 0 error\n\n\tStrCpy $OUT ''\n\t${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastEqual' 'TextCompareCallback'\n\tStrCmp $OUT '|1|1A=a$\\r$\\n|1|1A=a$\\r$\\n|3|3C=c$\\r$\\n|3|3C=c$\\r$\\n|5|5E=e$\\r$\\n|5|5E=e$\\r$\\n' 0 error\n\n\tStrCpy $OUT ''\n\t${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'SlowDiff' 'TextCompareCallback'\n\tStrCmp $OUT '' 0 error\n\n\tStrCpy $OUT ''\n\t${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'SlowEqual' 'TextCompareCallback'\n\tStrCmp $OUT '|1|1A=a$\\r$\\n|1|1A=a$\\r$\\n|4|2B=B$\\r$\\n|2|2B=b$\\r$\\n|3|3C=c$\\r$\\n|3|3C=c$\\r$\\n|2|4D=d$\\r$\\n|4|4D=d$\\r$\\n|5|5E=e$\\r$\\n|5|5E=e$\\r$\\n' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\nSection TextCompareS\n\t${StackVerificationStart} TextCompareS\n\n\tStrCpy $OUT ''\n\t${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'SlowDiff' 'TextCompareCallback'\n\tStrCmp $OUT '|||2|2B=b$\\r$\\n' 0 error\n\n\tStrCpy $OUT ''\n\t${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'SlowEqual' 'TextCompareCallback'\n\tStrCmp $OUT '|1|1A=a$\\r$\\n|1|1A=a$\\r$\\n|3|3C=c$\\r$\\n|3|3C=c$\\r$\\n|2|4D=d$\\r$\\n|4|4D=d$\\r$\\n|5|5E=e$\\r$\\n|5|5E=e$\\r$\\n' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\nFunction TextCompareCallback\n\tStrCpy $OUT '$OUT|$6|$7|$8|$9'\n\n\tPush $0\nFunctionEnd\n\n\nSection ConfigRead\n\t${StackVerificationStart} ConfigRead\n\n\t${ConfigRead} '$TEMPFILE1' '3c=' $OUT\n\tStrCmp $OUT 'c' 0 error\n\n\t${ConfigRead} '$TEMPFILE1' '6F=' $OUT\n\tStrCmp $OUT '' 0 error\n\n\t${ConfigRead} '$TEMPFILE1' 'FF=' $OUT\n\tIfErrors 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection ConfigReadS\n\t${StackVerificationStart} ConfigReadS\n\n\t${ConfigReadS} '$TEMPFILE1' '3C=' $OUT\n\tStrCmp $OUT 'c' 0 error\n\n\t${ConfigReadS} '$TEMPFILE1' '3c=' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection ConfigWrite\n\t${StackVerificationStart} ConfigWrite\n\n\t${ConfigWrite} '$TEMPFILE1' '5E=' 'e**' $OUT\n\tStrCmp $OUT 'CHANGED' 0 error\n\n\t${ConfigWrite} '$TEMPFILE1' '2B=' '' $OUT\n\tStrCmp $OUT 'DELETED' 0 error\n\n\t${ConfigWrite} '$TEMPFILE1' '3c=' 'c' $OUT\n\tStrCmp $OUT 'SAME' 0 error\n\n\t${ConfigWrite} '$TEMPFILE1' '6F=' '*' $OUT\n\tStrCmp $OUT 'ADDED' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection ConfigWriteS\n\t${StackVerificationStart} ConfigWriteS\n\n\t${ConfigWriteS} '$TEMPFILE1' '5e=' 'e**' $OUT\n\tStrCmp $OUT 'ADDED' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection FileRecode\n\t${StackVerificationStart} FileRecode\n\n\t${FileRecode} '$TEMPFILE1' 'CharToOem'\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection TrimNewLines\n\t${StackVerificationStart} TrimNewLines\n\n\t${TrimNewLines} 'Text Line$\\r$\\n' $OUT\n\tStrCmp $OUT 'Text Line' 0 error\n\n\t${TrimNewLines} 'Text Line' $OUT\n\tStrCmp $OUT 'Text Line' 0 error\n\n\t${TrimNewLines} 'Text Line$\\n' $OUT\n\tStrCmp $OUT 'Text Line' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WriteUninstaller\n\tSetDetailsPrint none\n\tDelete $TEMPFILE1\n\tDelete $TEMPFILE2\n\tDelete $TEMPFILE3\n\tSetDetailsPrint both\n\tgoto +2\n\tWriteUninstaller '$EXEDIR\\un.TextFuncTest.exe'\nSectionEnd\n\n\n\n;############### UNINSTALL ###############\n\nSection un.Uninstall\n\t${LineFind} '$TEMPFILE1' '/NUL' '1:-1' 'un.LineFindCallback'\n\t${LineRead} '$TEMPFILE1' '-1' $OUT\n\t${FileReadFromEnd} '$TEMPFILE1' 'un.FileReadFromEndCallback'\n\t${LineSum} '$TEMPFILE1' $OUT\n\t${FileJoin} '$TEMPFILE1' '$TEMPFILE2' '$TEMPFILE3'\n\t${TextCompare} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'un.TextCompareCallback'\n\t${TextCompareS} '$TEMPFILE1' '$TEMPFILE2' 'FastDiff' 'un.TextCompareCallback'\n\t${ConfigRead} '$TEMPFILE1' '3c=' $OUT\n\t${ConfigReadS} '$TEMPFILE1' '3c=' $OUT\n\t${ConfigWrite} '$TEMPFILE1' '5E=' 'e**' $OUT\n\t${ConfigWriteS} '$TEMPFILE1' '5E=' 'e**' $OUT\n\t${FileRecode} '$TEMPFILE1' 'CharToOem'\n\t${TrimNewLines} 'Text Line$\\r$\\n' $OUT\nSectionEnd\n\nFunction un.LineFindCallback\n\tPush $0\nFunctionEnd\n\nFunction un.FileReadFromEndCallback\n\tPush $0\nFunctionEnd\n\nFunction un.TextCompareCallback\n\tPush $0\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/AdditionalTasks.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Additional Tasks Page Example Script\n;Written by SuperPat\n\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"AdditionalTasks.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;UltraModern Include\n\n!include \"UMUI.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"green\"\n\n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n  \n  !define UMUI_PARAMS_REGISTRY_ROOT HKCU\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI Test\"\n  \n  !define UMUI_INSTALLDIR_REGISTRY_VALUENAME \"InstallDir\"    ;Replace the InstallDirRegKey instruction and automatically save the $INSTDIR variable\n\n  !define UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME \"Tasks\"\n\n;--------------------------------\n;Pages\n\n  Var STARTMENU_FOLDER\n\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n\n  !insertmacro MUI_PAGE_COMPONENTS\n\n  !insertmacro MUI_PAGE_DIRECTORY\n\n    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n  !insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU \"Application\" $STARTMENU_FOLDER\n\n  !insertmacro UMUI_PAGE_ADDITIONALTASKS addtasks_function\n\n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n\n  !insertmacro MUI_PAGE_INSTFILES\n\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n\n\nFunction addtasks_function\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK DESKTOP 1 \"$(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK QUICK_LAUNCH 1 \"$(UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_EMPTYLINE\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK STARTUP 1 \"$(UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK ASSOCIATE 0 \"$(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH) .UMUI $(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LINE\n\n  ; only if a directory has been selected in the STARTMENU page\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n    UserInfo::GetAccountType\n    Pop $R0\n    StrCmp $R0 \"Guest\" 0 notLimited\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n      Goto endShellVarContext\n    notLimited:\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO ALL 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 0 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    endShellVarContext:\n  !insertmacro MUI_STARTMENU_WRITE_END\n\nFunctionEnd\n\nFunction confirm_function\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  \n  ;Only if StartMenu Folder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $STARTMENU_FOLDER\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  !insertmacro MUI_STARTMENU_WRITE_END\n \n  ;Only if one at least of the six checks is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP|QUICK_LAUNCH|STARTUP|ASSOCIATE|ALL|CURRENT\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_ADDITIONALTASKS_TITLE):\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if one at least of additional icon check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP|QUICK_LAUNCH\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if the first check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if the second check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED QUICK_LAUNCH\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_ADDITIONALTASKS_CREATE_QUICK_LAUNCH_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;Only if start programm at windows startup check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED STARTUP\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_ADDITIONALTASKS_ADVANCED_PARAMETERS)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_ADDITIONALTASKS_LAUNCH_PROGRAM_AT_WINDOWS_STARTUP)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n  ;Only if file association check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ASSOCIATE\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_ADDITIONALTASKS_FILE_ASSOCIATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH) .UMUI $(UMUI_TEXT_ADDITIONALTASKS_ASSOCIATE_WITH_END)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n  ; only if a directory has been selected in the STARTMENU page\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL|CURRENT\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if for all user radio is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if for current user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED CURRENT\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n\nFunctionEnd\n\n\n  \n;--------------------------------\n;Languages\n\n  !insertmacro MUI_LANGUAGE \"English\"\n  !insertmacro MUI_LANGUAGE \"French\"\n\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n\n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\n  ;Only if the first check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP\n\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n\n  ;Only if the second check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED QUICK_LAUNCH\n\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  \n  ;Only if the third check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED STARTUP\n\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  \n  \n  ;Only if the file association is checked\n  ;  For an exemple, see this page: http://nsis.sourceforge.net/FileAssoc\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ASSOCIATE\n  \n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n\n  \n  ;set shellvar context\n  ; only if all user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL\n    SetShellVarContext all\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if current user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED CURRENT\n    SetShellVarContext current\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  \n  ;After set shell var context, Only if StartMenu Folder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    ;create start menu and desktop shortsuts\n  !insertmacro MUI_STARTMENU_WRITE_END\n\n\nSectionEnd\n\nSection Uninstall\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n  RMDir \"$INSTDIR\"\n  \n  DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n  \nSectionEnd\n\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n  LangString DESC_SecDummy ${LANG_FRENCH} \"Une section de test.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/Basic.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Basic Example Script\n;Originally Written by Joost Verburg\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"Basic.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n  \n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n;  !include \"MUIEx.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n; !define UMUI_SKIN \"SoftRed\"\n \n !define MUI_ABORTWARNING\n !define MUI_UNABORTWARNING\n \n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n  \n  ;Sleep 5000\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/Confirm.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Confirmation Page Example Script\n;Written SuperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Confirm\"\n  OutFile \"Confirm.exe\"\n  SetCompressor /FINAL lzma\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;UltraModern Include\n\n!include \"UMUI.nsh\"\n!include \"WinMessages.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"red\"\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n;--------------------------------\n;Pages\n\n  Var STARTMENU_FOLDER\n\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n!insertmacro MUI_PAGE_COMPONENTS\n!insertmacro MUI_PAGE_DIRECTORY\n  !define UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n  !define MUI_STARTMENUPAGE_REGISTRY_ROOT \"HKCU\" \n  !define MUI_STARTMENUPAGE_REGISTRY_KEY \"Software\\UltraModernUI Test\" \n  !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n!insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU \"Application\" $STARTMENU_FOLDER\n\n  !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n!insertmacro UMUI_PAGE_CONFIRM\n\n!insertmacro MUI_PAGE_INSTFILES\n\n!insertmacro MUI_UNPAGE_CONFIRM\n!insertmacro UMUI_UNPAGE_CONFIRM\n!insertmacro MUI_UNPAGE_INSTFILES\n\n\nFunction confirm_function\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  \n  ;Only if StartMenu Folder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER)\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $STARTMENU_FOLDER\"\n\n    ;ShellVarContext\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $1\n    StrCmp $1 \"all\" 0 current\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      Goto endsvc\n    current:\n      !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    endsvc:\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  !insertmacro MUI_STARTMENU_WRITE_END\nFunctionEnd\n\n\n  \n;--------------------------------\n;Languages\n\n  !insertmacro MUI_LANGUAGE \"English\"\n  !insertmacro MUI_LANGUAGE \"French\"\n\n\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  sleep 1000\n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\UltraModernUI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\nSection Uninstall\n\n  DeleteRegKey HKCU \"Software\\UltraModernUI Test\"\n  \n  Delete \"$INSTDIR\\Uninstall.exe\"\n  RMDir \"$INSTDIR\"\n  Sleep 1000\nSectionEnd\n\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test Section.\"\n  LangString DESC_SecDummy ${LANG_FRENCH} \"Une section de test.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/FileDiskRequest.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;FileDiskRequest Page Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"FileDiskRequest.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n  \n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n;  !include \"MUIEx.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n !define UMUI_SKIN \"blue\"\n \n !define MUI_ABORTWARNING\n !define MUI_UNABORTWARNING\n \n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n  \n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_DIRECTORY\n  \n  var dir\n  !define UMUI_FILEDISKREQUESTPAGE_VARIABLE dir\n  !define UMUI_FILEDISKREQUESTPAGE_FILE_NAME \"FileDiskRequest.exe\" ; Want to seatch a file. \n  !insertmacro UMUI_PAGE_FILEDISKREQUEST\n  \n  var dir2\n  !define UMUI_FILEDISKREQUESTPAGE_VARIABLE dir2\n  !define UMUI_FILEDISKREQUESTPAGE_FILE_NAME \"FileDiskRequest.exe\"\n  !define UMUI_FILEDISKREQUESTPAGE_DISK_NAME \"CD 1\" ; Want to seatch the \"CD 1\" disk containing the this file\n  !insertmacro UMUI_PAGE_FILEDISKREQUEST\n\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  MessageBox MB_OK \"Your file was found in $dir\"\n  MessageBox MB_OK \"The CD 1 is in $dir2\"\n\nSectionEnd\n\n\n; Set the defaut directory\nFunction .onInit\n\n  StrCpy $dir $EXEDIR\n  StrCpy $dir2 $EXEDIR\n  \nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/HeaderBGImageEx.nsi",
    "content": ";NSIS Modern User Interface Extended\n;Header Background Image Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"Modern UI Extended Test\"\n  OutFile \"HeaderBGImage.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\Modern UI Extended Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\Modern UI Extended Test\" \"\"\n\n;--------------------------------\n;Interface Configuration\n\n  !define UMUI_HEADERBGIMAGE\n  ; If you want to change the header image\n;  !define MUI_HEADERBGIMAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\UltraModernUI\\HeaderBG.bmp\"\n\n  !define MUI_TEXTCOLOR FFFFFF\n  !define MUI_BGCOLOR 6783cf\n  !define UMUI_HEADERTEXT_COLOR 003366\n\n  ; If you want to change the WelcomeFinishAbort image\n;  !define MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n;  !define MUI_UNWELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\win.bmp\"\n\n  ; text and background colors for all Input,List,Treeview (except for licencepage and instfile page)\n  !define UMUI_TEXT_INPUTCOLOR 003366\n  !define UMUI_BGINPUTCOLOR F0F0FF\n  \n  !define MUI_LICENSEPAGE_BGCOLOR ${UMUI_BGINPUTCOLOR}\n  !define MUI_INSTFILESPAGE_COLORS \"${UMUI_TEXT_INPUTCOLOR} ${UMUI_BGINPUTCOLOR}\"\n  \n  ; Use skinned buttons\n  !define UMUI_DISABLED_BUTTON_TEXT_COLOR 666666\n  !define UMUI_SELECTED_BUTTON_TEXT_COLOR 000066\n  !define UMUI_BUTTON_TEXT_COLOR 003366\n  !define UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button.bmp\"\n  !define UMUI_UNBUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button.bmp\"\n  \n  \n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n  \n;--------------------------------\n;Include Modern UI\n\n  !include \"MUIEx.nsh\"\n  \n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_PAGE_FINISH\n  !insertmacro UMUI_PAGE_ABORT\n  \n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  !insertmacro MUI_UNPAGE_FINISH\n  !insertmacro UMUI_UNPAGE_ABORT\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/HeaderBitmapEx.nsi",
    "content": ";NSIS Modern User Interface Extended\n;Header Image Bitmap Example Script\n;Originally Written by Joost Verburg\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"MUIEx.nsh\"\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"ModernUIEx Test\"\n  OutFile \"HeaderBitmap.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\Modern UI Ex Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\Modern UI Ex Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n  \n;--------------------------------\n;Interface Configuration\n\n  !define MUI_HEADERIMAGE\n  !define MUI_HEADERIMAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp\" ; optional\n  !define MUI_ABORTWARNING\n\n  !define UMUI_BUTTONIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Button.bmp\"\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\Modern UI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/Information.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Information Page Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Generate unicode installer\n  Unicode True\n  \n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"Information.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"UMUI.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n  \n  !define UMUI_SKIN \"SoftBrown\"\n  \n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n;--------------------------------\n;Pages\n\n  !insertmacro UMUI_PAGE_MULTILANGUAGE\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  \n;  A first multi-language TXT information page:\n;  The * will be replaced by the language code\n;  \"information1033.txt\" for english \"information1036.txt\" for french.\n;  Optional \"information.txt\" for untranslated language files (if \"informationXXXX.txt\" not found)\n  !insertmacro UMUI_PAGE_INFORMATION \"information*.txt\"\n  \n;  An other english only RTF information page (InstallOptionsEx only)\n  !define UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT\n  !insertmacro UMUI_PAGE_INFORMATION \"${NSISDIR}\\Docs\\UltraModernUI\\ReadMe.rtf\"\n\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n;--------------------------------\n;Languages\n \n; first language is the default language if the system language is not in this list\n  !insertmacro MUI_LANGUAGE \"English\"\n\n; Other UMUI translated languages\n  !insertmacro MUI_LANGUAGE \"Bulgarian\"\n  !insertmacro MUI_LANGUAGE \"Czech\"\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"German\"\n  !insertmacro MUI_LANGUAGE \"Greek\"\n  !insertmacro MUI_LANGUAGE \"Hungarian\"\n  !insertmacro MUI_LANGUAGE \"Italian\"\n  !insertmacro MUI_LANGUAGE \"Japanese\"\n  !insertmacro MUI_LANGUAGE \"Lithuanian\"\n  !insertmacro MUI_LANGUAGE \"Polish\"\n  !insertmacro MUI_LANGUAGE \"Russian\"\n  !insertmacro MUI_LANGUAGE \"Slovenian\"\n  !insertmacro MUI_LANGUAGE \"Spanish\"\n  !insertmacro MUI_LANGUAGE \"Turkish\"\n; Other UMUI partially translated language\n  !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\Modern UI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\Modern UI Test\"\n\nSectionEnd\n\n\n;--------------------------------\n;Installer Functions\n\nFunction .onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd\n\n;--------------------------------\n;Uninstaller Functions\n\nFunction un.onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/InstallOptions.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;InstallOptionsEx and InstallOptions compatibility mode Example Script\n;Written by SyperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"InstallOptions.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n  \n  ;Active InstallOptionsEx\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define UMUI_SKIN \"blue\"\n  \n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE  \n  \n  \n;---------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"  \n\n\n;--------------------------------\n;Reserve Files\n  \n  ;These files should be inserted before other files in the data block\n  ;Keep these lines before any File command\n  ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)\n  \n  ReserveFile \"ioA.ini\"\n  ReserveFile \"ioB.ini\"\n  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\n  \n  \n;--------------------------------\n;Pages\n\n    !define MUI_LICENSEPAGE_TEXT_TOP \"All the action takes place on the next page...\"\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  Page custom CustomPageA\n  !insertmacro MUI_PAGE_COMPONENTS\n  Page custom CustomPageB\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro UMUI_PAGE_ABORT\n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n \nSectionEnd\n\n;--------------------------------\n;Installer Functions\n\nFunction .onInit\n\n  ;Extract InstallOptions INI files\n  !insertmacro MUI_INSTALLOPTIONS_EXTRACT \"ioA.ini\"\n  !insertmacro MUI_INSTALLOPTIONS_EXTRACT \"ioB.ini\"\n  \nFunctionEnd\n\nLangString TEXT_IO_TITLE ${LANG_ENGLISH} \"InstallOptions page\"\nLangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} \"This is a page created using the InstallOptions plug-in.\"\n\nFunction CustomPageA\n\n  ; Does not show page if setup cancelled, required only if UMUI_PAGE_ABORT inserted\n  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n  !insertmacro MUI_HEADER_TEXT \"$(TEXT_IO_TITLE)\" \"$(TEXT_IO_SUBTITLE)\"\n  !insertmacro INSTALLOPTIONS_DISPLAY \"ioA.ini\"\n\nFunctionEnd\n\nVar HWND\nFunction CustomPageB\n\n  ; Does not show page if setup cancelled, required only if UMUI_PAGE_ABORT inserted\n  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n  !insertmacro MUI_HEADER_TEXT \"$(TEXT_IO_TITLE)\" \"$(TEXT_IO_SUBTITLE)\"\n\n  !insertmacro MUI_INSTALLOPTIONS_INITDIALOG \"ioB.ini\"\n  Pop $HWND ;HWND of dialog\n  \n  !insertmacro UMUI_IOPAGEBGTRANSPARENT_INIT $HWND ; set page background color\n\n  GetDlgItem $0 $HWND 1200\n;  !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $0  ; set label colors\n  SetCtlColors $0 00FF00 \"transparent\"\n  \n  GetDlgItem $0 $HWND 1201\n  !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $0  ; set checkbox colors\n  \n  GetDlgItem $0 $HWND 1202\n  !insertmacro UMUI_IOPAGEINPUTCTL_INIT $0  ; set text colors\n  \n  !insertmacro MUI_INSTALLOPTIONS_SHOW\n\nFunctionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\UltraModernUI Test\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/Maintenance.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Maintenance Page Example Script\n;Written by SuperPat\n\n; How to test this example:\n; launch and install this example a first time\n; Relaunch this example again or laucnh the uninstaller, the maintnance page will appear\n\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"Maintenance.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"UMUI.nsh\"\n  ;!include \"MUIEx.nsh\"\n\n  !include \"Sections.nsh\"\n  \n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"blue2\"\n\n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKCU\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI Test\"\n  \n  !define UMUI_INSTALLDIR_REGISTRY_VALUENAME \"InstallDir\"    ;Replace the InstallDirRegKey instruction and automatically save the $INSTDIR variable\n    \n  !define UMUI_VERSION \"2.0 beta 1\"\n  !define /date UMUI_VERBUILD \"2.0_%Y-%m-%d\"\n\n  !define UMUI_VERSION_REGISTRY_VALUENAME \"Version\"\n  !define UMUI_VERBUILD_REGISTRY_VALUENAME \"VerBuild\"\n\n  !define UMUI_UNINSTALLPATH_REGISTRY_VALUENAME \"uninstallpath\"\n  !define UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME \"installpath\"\n  !define UMUI_UNINSTALL_FULLPATH \"$INSTDIR\\Uninstall.exe\"\n  !define UMUI_PREUNINSTALL_FUNCTION preuninstall_function\n\n;--------------------------------\n;Pages\n\n    !define UMUI_MAINTENANCEPAGE_MODIFY\n    !define UMUI_MAINTENANCEPAGE_REPAIR\n    !define UMUI_MAINTENANCEPAGE_REMOVE\n    !define UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_PAGE_MAINTENANCE\n  \n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  \n;    !define UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME \"insttype\"\n    !define UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME \"components\"  \n  !insertmacro MUI_PAGE_COMPONENTS\n\n  !insertmacro MUI_PAGE_DIRECTORY\n  \n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n\n  !insertmacro MUI_PAGE_INSTFILES\n  \n    !define UMUI_MAINTENANCEPAGE_MODIFY\n    !define UMUI_MAINTENANCEPAGE_REPAIR\n    !define UMUI_MAINTENANCEPAGE_REMOVE\n    !define UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_UNPAGE_MAINTENANCE\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n;--------------------------------\n;Languages\n\n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n   \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\nSection \"Dummy Section 2\" SecDummy2\n\n  SetOutPath \"$INSTDIR\"\n  \n  \n\nSectionEnd\n\n\n;--------------------------------\n; Pages functions\n\nFunction preuninstall_function\n\n  ; execute this function only in Modify, repair and update function\n  !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    ;ADD YOUR DELETE INSTRUCTION HERE...\n  \n    Delete \"$INSTDIR\\Uninstall.exe\"\n  \n    DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\n  !insertmacro UMUI_ENDIF_INSTALLFLAG\n\nFunctionEnd\n\n!macro confirm_addline section\n\n  SectionGetFlags ${Sec${section}} $1\n  IntOp $1 $1 & ${SF_SELECTED}\n  IntCmp $1 ${SF_SELECTED} 0 n${section} n${section}\n    SectionGetText ${Sec${section}} $1\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"    - $1\"\n  n${section}:\n\n!macroend\n\nFunction confirm_function\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n\n  !insertmacro confirm_addline Dummy\n  !insertmacro confirm_addline Dummy2\n\nFunctionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n  LangString DESC_SecDummy2 ${LANG_ENGLISH} \"An other test section.\"\n\n  ;Declare all the components (Needed by UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME)\n  !insertmacro UMUI_DECLARECOMPONENTS_BEGIN\n    !insertmacro UMUI_COMPONENT SecDummy\n    !insertmacro UMUI_COMPONENT SecDummy2\n  !insertmacro UMUI_DECLARECOMPONENTS_END\n\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy2} $(DESC_SecDummy2)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR DELETE INSTRUCTION HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/MultiLanguage.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Multilanguage Page Example Script\n;Written SuperPat\n\n;--------------------------------\n;General\n\n  ;Generate unicode installer\n  Unicode True\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"MultiLanguage.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n;  !include \"MUIEx.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define MUI_ABORTWARNING\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKCU \n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI Test\" \n  \n  !define UMUI_INSTALLDIR_REGISTRY_VALUENAME \"InstallDir\"    ;Replace the InstallDirRegKey instruction and automatically save the $INSTDIR variable\n  \n  !define UMUI_LANGUAGE_REGISTRY_VALUENAME \"Language\"\n\n  !define UMUI_USE_ALTERNATE_PAGE\n\n  ; always show the MultiLanguage page or the LangDLLDialog\n  ;!define UMUI_LANGUAGE_ALWAYSSHOW\n\n;--------------------------------\n;Pages\n    \n  !insertmacro UMUI_PAGE_MULTILANGUAGE\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro UMUI_UNPAGE_MULTILANGUAGE\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n\n;--------------------------------\n;Languages\n\n; first language is the default language if the system language is not in this list\n  !insertmacro MUI_LANGUAGE \"English\"\n\n; Other UMUI translated languages\n  !insertmacro MUI_LANGUAGE \"Bulgarian\"\n  !insertmacro MUI_LANGUAGE \"Czech\"\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"German\"\n  !insertmacro MUI_LANGUAGE \"Greek\"\n  !insertmacro MUI_LANGUAGE \"Hungarian\"\n  !insertmacro MUI_LANGUAGE \"Italian\"\n  !insertmacro MUI_LANGUAGE \"Japanese\"\n  !insertmacro MUI_LANGUAGE \"Lithuanian\"\n  !insertmacro MUI_LANGUAGE \"Polish\"\n  !insertmacro MUI_LANGUAGE \"Russian\"\n  !insertmacro MUI_LANGUAGE \"Slovenian\"\n  !insertmacro MUI_LANGUAGE \"Spanish\"\n  !insertmacro MUI_LANGUAGE \"Turkish\"\n; Other UMUI partially translated language\n  !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n\n; Other untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n  !insertmacro MUI_LANGUAGE \"SimpChinese\"\n  !insertmacro MUI_LANGUAGE \"TradChinese\"\n  !insertmacro MUI_LANGUAGE \"Korean\"\n  !insertmacro MUI_LANGUAGE \"Dutch\"\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro MUI_LANGUAGE \"Norwegian\"\n  !insertmacro MUI_LANGUAGE \"NorwegianNynorsk\"\n  !insertmacro MUI_LANGUAGE \"Finnish\"\n  !insertmacro MUI_LANGUAGE \"Portuguese\"\n  !insertmacro MUI_LANGUAGE \"Ukrainian\"\n  !insertmacro MUI_LANGUAGE \"Slovak\"\n  !insertmacro MUI_LANGUAGE \"Croatian\"\n  !insertmacro MUI_LANGUAGE \"Thai\"\n  !insertmacro MUI_LANGUAGE \"Romanian\"\n  !insertmacro MUI_LANGUAGE \"Latvian\"\n  !insertmacro MUI_LANGUAGE \"Macedonian\"\n  !insertmacro MUI_LANGUAGE \"Estonian\"\n  !insertmacro MUI_LANGUAGE \"Serbian\"\n  !insertmacro MUI_LANGUAGE \"SerbianLatin\"\n  !insertmacro MUI_LANGUAGE \"Arabic\"\n  !insertmacro MUI_LANGUAGE \"Farsi\"\n  !insertmacro MUI_LANGUAGE \"Hebrew\"\n  !insertmacro MUI_LANGUAGE \"Indonesian\"\n  !insertmacro MUI_LANGUAGE \"Mongolian\"\n  !insertmacro MUI_LANGUAGE \"Luxembourgish\"\n  !insertmacro MUI_LANGUAGE \"Albanian\"\n  !insertmacro MUI_LANGUAGE \"Breton\"\n  !insertmacro MUI_LANGUAGE \"Belarusian\"\n  !insertmacro MUI_LANGUAGE \"Icelandic\"\n  !insertmacro MUI_LANGUAGE \"Malay\"\n  !insertmacro MUI_LANGUAGE \"Bosnian\"\n  !insertmacro MUI_LANGUAGE \"Kurdish\"\n  !insertmacro MUI_LANGUAGE \"Irish\"\n  !insertmacro MUI_LANGUAGE \"Uzbek\"\n  !insertmacro MUI_LANGUAGE \"Galician\"\n  !insertmacro MUI_LANGUAGE \"Afrikaans\"\n  !insertmacro MUI_LANGUAGE \"Catalan\"\n  !insertmacro MUI_LANGUAGE \"Esperanto\"\n  !insertmacro MUI_LANGUAGE \"Asturian\"\n  !insertmacro MUI_LANGUAGE \"Basque\"\n  !insertmacro MUI_LANGUAGE \"Pashto\"\n  !insertmacro MUI_LANGUAGE \"ScotsGaelic\"\n  !insertmacro MUI_LANGUAGE \"Vietnamese\"\n  !insertmacro MUI_LANGUAGE \"Welsh\"\n  !insertmacro MUI_LANGUAGE \"Corsican\"\n  !insertmacro MUI_LANGUAGE \"Tatar\"\n\n; Other unicode only untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"Armenian\"\n  !insertmacro MUI_LANGUAGE \"Georgian\"\n  !insertmacro MUI_LANGUAGE \"Hindi\"\n\n  \n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n\n\n;--------------------------------\n;Descriptions\n\n  ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC\n\n  ;Assign descriptions to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} \"A test section.\"\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\nSectionEnd\n\n;--------------------------------\n;Installer Functions\n\nFunction .onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd\n\n;--------------------------------\n;Uninstaller Functions\n\nFunction un.onInit\n  !insertmacro UMUI_MULTILANG_GET\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/NSISUMUIMenu.nsi",
    "content": "OutFile \"NSISUMUI.exe\"\nName \"NSIS Menu with UMUI\"\nUnicode True\nRequestExecutionLevel User\nXPStyle On\nManifestDPIAware System\nSetCompressor LZMA\nChangeUI IDD_INST \"${NSISDIR}\\Contrib\\UIs\\modern_headerbmp.exe\"\nIcon \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis-menu.ico\"\nBrandingText \" \"\nMiscButtonText \" \" \" \" \" \" \" \"\nInstallButtonText \" \"\nCompletedText \" \"\nLangString ^ClickInstall 0 \" \"\nCaption \"$(^Name)\"\n\n!include nsDialogs.nsh\n!include WinMessages.nsh\n!include LogicLib.nsh\n!define /IfNDef IDC_CHILDRECT 1018\n!define QUIT_ON_EXECUTE\n!define PR $ExeDir ; Local root path\n!define PD \"Docs\" ; Local with WWW fallback (located at the same relative path)\n!define WWW \"http://nsis.sf.net\"\n\n!define CB_HEADER 0x755585\n!define UY_HEADER 28\n!define CB_PAGE 0xffffff\n!define CT_SECTION 0x666666\n!define CB_SECTION ${CB_PAGE}\n!define UY_SECTION 11 ; Height of a section\n!define UY_SECTIONBPAD 2 ; Extra padding on the bottom of section headers\n!define UY_TXT 9 ; Height of a normal item\n!define UY_TXTBPAD 0 ; Extra padding on the bottom of normal items\n!define UX_COLPAD 7 ; Spacing between columns\n!define UY_ROW2 104 ; Absolute position of the 2nd row\n!define CT_LINK 0x0c6e97 ; SYSCLR:HOTLIGHT\n!define /Math UX_PAGE 00 + ${UX_COLPAD}\n!define /Math UY_PAGE ${UY_HEADER} + 10\n!define UX ${UX_PAGE}\n\nFunction PageLeave\nSystem::Call 'USER32::GetFocus()p.r0'\nSystem::Call 'USER32::GetDlgCtrlID(pr0)i.r1'\nSystem::Call 'USER32::GetParent(pr0)p.r2'\nSendMessage $2 ${WM_COMMAND} $1 $0 ; Handle <ENTER> in dialog by pretending it was a click on the active control\nAbort\nFunctionEnd\n\nFunction PageCreate\nGetDlgItem $0 $hWndParent 1\nShowWindow $0 0\nGetDlgItem $0 $hWndParent 2\nShowWindow $0 0\n\nSystem::Call 'USER32::GetClientRect(p$hWndParent,@r0)'\nSystem::Call '*$0(i,i,i.r3,i.r4)'\nGetDlgItem $0 $hWndParent ${IDC_CHILDRECT}\nSystem::Call 'USER32::MoveWindow(pr0,i0,i0,ir3,ir4,i0)'\n\nnsDialogs::Create ${IDC_CHILDRECT}\nPop $R9\nSetCtlColors $R9 000000 ${CB_PAGE}\n\n!macro StartColumn W\n!define /ReDef UY ${UY_PAGE}\n!define /ReDef UX_W ${W}\n!ifdef UX_INTERNAL_PREV_W\n!define /ReDef /Math UX ${UX} + ${UX_INTERNAL_PREV_W}\n!define /ReDef /Math UX ${UX} + ${UX_COLPAD}\n!define /ReDef UX_INTERNAL_PREV_W ${UX_W}\n!else\n!define /Math UX_INTERNAL_PREV_W 0 + ${UX_W}\n!endif\n!macroend\n!macro CreateHeader Txt W\n!define /ReDef /Math W ${W} + 4 ; Make it slightly wider\n${NSD_CreateLabel} ${UX}u ${UY}u ${W}u ${UY_SECTION}u \"${Txt}\"\nPop $0\nSetCtlColors $0  ${CT_SECTION} transparent\nSendMessage $0 ${WM_SETFONT} ${HF_HEADER} 1\n!define /ReDef /Math UY ${UY} + ${UY_SECTION}\n!define /ReDef /Math UY ${UY} + ${UY_SECTIONBPAD}\n!macroend\n!macro CreateControl Class Txt W H\n${NSD_Create${Class}} ${UX}u ${UY}u ${W}u ${H}u \"${Txt}\"\n!define /ReDef /Math UY ${UY} + ${H}\n!define /ReDef /Math UY ${UY} + ${UY_TXTBPAD}\n!macroend\n!macro CreateSimpleLinkHelper Txt Url W\n!insertmacro CreateControl Link \"${Txt}|${Url}\" ${W} ${UY_TXT}\n!macroend\n!macro CreateSimpleLink Txt Url W\n!insertmacro CreateSimpleLinkHelper \"${Txt}\" \"${Url}\" ${W}\nCall ConfigureLink\n!macroend\n\n\n; --- Header ---\n!define HF_HEADER $R8\nCreateFont ${HF_HEADER} \"Arial\" ${UY_SECTION} 700\n\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE} ${__NSD_Label_EXSTYLE} 33u 0 -33u ${UY_HEADER}u \"\"\nPop $0\nSetCtlColors $0 0xffffff ${CB_HEADER} \n\nnsDialogs::CreateControl ${__NSD_Icon_CLASS} ${__NSD_Icon_STYLE}|${SS_CENTERIMAGE}|${SS_CENTER} ${__NSD_Icon_EXSTYLE} 0 0 33u ${UY_HEADER}u \"\"\nPop $0\nSetCtlColors $0 \"\" ${CB_HEADER}\n${NSD_SetIconFromInstaller} $0 $1\n\nReadRegDword $R0 HKLM Software\\NSIS \"VersionMajor\"\nIfErrors endVersion 0\n  ReadRegDword $R1 HKLM Software\\NSIS \"VersionMinor\"\n  IfErrors endVersion 0\n    IntCmp $R1 9 0 0 +3\n      StrCpy $R0 \"$R0.0$R1\"\n      Goto endVersion\n      StrCpy $R0 \"$R0.$R1\"\nendVersion:\n\nCreateFont $1 \"Trebuchet MS\" 17\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE}|${SS_CENTERIMAGE}|${SS_ENDELLIPSIS} ${__NSD_Label_EXSTYLE} 34u 1u -34u ${UY_HEADER}u \"nullsoft scriptable install system $R0\"\nPop $0\nSetCtlColors $0 0x3A2A42 transparent\nSendMessage $0 ${WM_SETFONT} $1 1\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE}|${SS_CENTERIMAGE}|${SS_ENDELLIPSIS} ${__NSD_Label_EXSTYLE} 33u 0 -33u ${UY_HEADER}u \"nullsoft scriptable install system $R0\"\nPop $0\nSetCtlColors $0 0xffffff transparent\nSendMessage $0 ${WM_SETFONT} $1 1\n\n\n; --- Page ---\n!insertmacro StartColumn 90\n!insertmacro CreateHeader \"Compiler\" ${UX_W}\n!insertmacro CreateSimpleLink \"Compile NSI scripts\" \"${PR}\\MakeNSISW\" ${UX_W}\n!insertmacro CreateSimpleLink \"Installer based on .ZIP file\" \"${PR}\\bin\\Zip2Exe\" ${UX_W}\n\n\n!define /ReDef UY ${UY_ROW2}\n!insertmacro CreateHeader \"Developer Center\" ${UX_W}\n!define /ReDef UY_MULTILINE 42\n!insertmacro CreateControl Label \"Many more examples, tutorials, plug-ins and NSIS-releted software are available at the online Developer Center.\" ${UX_W} ${UY_MULTILINE}\nPop $0\nSetCtlColors $0 00000000 ${CB_PAGE}\n\n\n!insertmacro StartColumn 80\n!insertmacro CreateHeader \"Documentation\" ${UX_W}\n!insertmacro CreateSimpleLink \"NSIS Users Manual\" \"${PR}\\NSIS.chm|${WWW}/Docs/\" ${UX_W}\n!insertmacro CreateSimpleLink \"Example scripts\" \"${PR}\\Examples|${WWW}/Examples\" ${UX_W}\n!insertmacro CreateSimpleLink \"Modern UI 2\" \"${PD}\\Modern UI 2\\Readme.html\" ${UX_W}\n!insertmacro CreateSimpleLink \"Ultra-Modern UI\" \"${PD}\\UltraModernUI\\Readme.html\" ${UX_W}\n\n\n!define /ReDef UY ${UY_ROW2}\n!insertmacro CreateHeader \"Online Help\" ${UX_W}\n!insertmacro CreateSimpleLink \"Developer Center\" \"${WWW}/Developer_Center\" ${UX_W}\n!insertmacro CreateSimpleLink \"FAQ\" \"${WWW}/FAQ\" ${UX_W}\n!insertmacro CreateSimpleLink \"Forum\" \"http://forums.winamp.com/forumdisplay.php?forumid=65\" ${UX_W}\n;\"Project Tracker\" \"http://sourceforge.net/tracker/?group_id=22049\"\n!insertmacro CreateSimpleLink \"Bug Tracker\" \"http://sourceforge.net/tracker/?group_id=22049&atid=373085\" ${UX_W}\n!insertmacro CreateSimpleLink \"Stackoverflow\" \"http://stackoverflow.com/questions/tagged/nsis\" ${UX_W}\n!insertmacro CreateSimpleLink \"Slack collaboration hub\" \"${WWW}/r/Slack\" ${UX_W}\n!insertmacro CreateSimpleLink \"IRC channel\" \"irc://irc.landoleet.org/nsis\" ${UX_W}\n;\"Pastebin\" \"http://nsis.pastebin.com/index/1FtyKP89\"\n;\"Search\" \"http://www.google.com/cse/home?cx=005317984255499820329:c_glv1-6a6a\"\n\n\n!insertmacro StartColumn 130\n!insertmacro CreateHeader \"Plug-ins\" ${UX_W}\n!macro CreatePluginLink Name Desc Url\n!define /ReDef SAVE_UY ${UY}\n!insertmacro CreateSimpleLinkHelper \"${Name}\" \"${Url}\" ${UX_W} ; AdjustLinkPair will configure this link\n!define /ReDef UY ${SAVE_UY}\n!insertmacro CreateControl Label \"${Name} - ${Desc}\" ${UX_W} ${UY_TXT}\nCall AdjustLinkPair\n!macroend\n!insertmacro CreatePluginLink \"AdvSplash\" \"splash with fade in/out\"     \"${PD}\\AdvSplash\\advsplash.txt\"\n!insertmacro CreatePluginLink \"Banner\"    \"banner with custom text\"     \"${PD}\\Banner\\Readme.txt\"\n!insertmacro CreatePluginLink \"BgImage\"   \"background image\"            \"${PD}\\BgImage\\BgImage.txt\"\n!insertmacro CreatePluginLink \"Dialer\"    \"internet connection\"         \"${PD}\\Dialer\\Dialer.txt\"\n!insertmacro CreatePluginLink \"Math\"      \"math operations\"             \"${PD}\\Math\\Math.txt\"\n!insertmacro CreatePluginLink \"nsDialogs\" \"custom wizard pages\"         \"${PD}\\nsDialogs\\Readme.html\"\n!insertmacro CreatePluginLink \"nsExec\"    \"launch command line tools\"   \"${PD}\\nsExec\\nsExec.txt\"\n!insertmacro CreatePluginLink \"NSISdl\"    \"download files\"              \"${PD}\\NSISdl\\Readme.txt\"\n!insertmacro CreatePluginLink \"Splash\"    \"splash screen\"               \"${PD}\\Splash\\splash.txt\"\n!insertmacro CreatePluginLink \"StartMenu\" \"Start Menu folder selection\" \"${PD}\\StartMenu\\Readme.txt\"\n!insertmacro CreatePluginLink \"System\"    \"Windows API calls\"           \"${PD}\\System\\System.html\"\n!insertmacro CreatePluginLink \"VPatch\"    \"update existing files\"       \"${PD}\\VPatch\\Readme.html\"\n\n!insertmacro CreatePluginLink \"InstallOptions\" \"custom wizard pages\"    \"${PD}\\InstallOptions\\Readme.html\"\n!insertmacro CreatePluginLink \"InstallOptionsEx\" \"custom wizard pages\"  \"${PD}\\InstallOptionsEx\\Readme.html\"\n!insertmacro CreatePluginLink \"nsArray\"   \"use arrays in scripts\"       \"${PD}\\nsArray\\Readme.txt\"\n!insertmacro CreatePluginLink \"SkinnedControls\" \"skin buttons/scrollbars\" \"${PD}\\SkinnedControls\\Readme.html\"\n\n; --- Footer ---\n${NSD_CreateLabel} 0 -22u 100% 1 \"\"\nPop $0\nSetCtlColors $0 000000 0xc4c4c4\n\nnsDialogs::CreateControl ${__NSD_Label_CLASS} ${__NSD_Label_STYLE}|${SS_CENTERIMAGE}|${SS_NOTIFY} ${__NSD_Label_EXSTYLE} -110u -20u 100% 20u \"nsis.sourceforge.net\"\nPop $0\nSetCtlColors $0 0xbbbbbb transparent\nSendMessage $0 ${WM_SETFONT} ${HF_HEADER} 1\nnsDialogs::SetUserData $0 \"http://nsis.sourceforge.net\"\n${NSD_OnClick} $0 OnLinkClick\n\nnsDialogs::Show\nFunctionEnd\n\nFunction OnLinkClick\nPop $1 ; HWND\nnsDialogs::GetUserData $1\nCall SplitPipe\nPop $0 ; First URL in UserData from SplitPipe\nStrCpy $3 \"\"\nStrCpy $1 $0 4 ; Copy length of ${PD}\n${IfThen} $1 == \"${PD}\" ${|} StrCpy $3 \"${PR}\\\" ${|}\n!ifdef QUIT_ON_EXECUTE\nSystem::Call 'USER32::GetKeyState(i0x11)i.r9' ; VK_CONTROL\n!endif\nClearErrors\nExecShell \"\" \"$3$0\"\nPop $1 ; ... the rest of SplitPipe ...\n${If} $1 != \"\"  ; ... might contain a fallback location\n\tStrCpy $0 $1\n\tStrCpy $3 \"\"\n${ElseIf} $3 != \"\" ; Local docs path failed, use WWW fallback\n\tStrCpy $3 0\n\tslashconvloop:\n\t\tStrCpy $2 $0 1 $3\n\t\t${If} $2 == \"\\\"\n\t\t\tStrCpy $2 $0 $3\n\t\t\tIntOp $3 $3 + 1\n\t\t\tStrCpy $0 $0 \"\" $3\n\t\t\tStrCpy $0 \"$2/$0\"\n\t\t${Else}\n\t\t\tIntOp $3 $3 + 1\n\t\t${EndIf}\n\t\tStrCmp $2 \"\" 0 slashconvloop\n\tStrCpy $3 \"${WWW}/\"\n${EndIf}\n${If} \"$3$1\" != \"\"\n${AndIf} ${Errors}\n\tExecShell \"\" \"$3$0\"\n${EndIf}\n${If} ${Errors}\n\t!ifdef QUIT_ON_EXECUTE\n\tStrCpy $9 0 ; Don't allow close\n\t!endif\n\tMessageBox MB_IconStop 'Error: Unable to open \"$0\"!'\n${EndIf}\n!ifdef QUIT_ON_EXECUTE\n${IfThen} $9 < 0 ${|} SendMessage $hWndParent ${WM_CLOSE} 0 0 ${|}\n!endif\nFunctionEnd\n\nFunction ConfigureLink\nPop $1 ; HWND\n${NSD_OnClick} $1 OnLinkClick\nSetCtlColors $1 ${CT_LINK} ${CB_PAGE}\n${NSD_GetText} $1 $4\nPush $4\nCall SplitPipe\nPop $4\nPop $2\n${NSD_SetText} $1 $4\nnsDialogs::SetUserData $1 $2\nSystem::Call 'USER32::GetDC(pr1)p.r3'\nSendMessage $1 ${WM_GETFONT} 0 0 $5\nSystem::Call 'GDI32::SelectObject(pr3,pr5)p.s'\nStrLen $5 $4\nSystem::Call 'GDI32::GetTextExtentPoint32(pr3,tr4,ir5,@r5)'\nSystem::Call '*$5(i.r6)'\nSystem::Call 'GDI32::SelectObject(pr3,ps)'\nSystem::Call 'USER32::ReleaseDC(pr1,pr3)'\nSystem::Call 'USER32::GetWindowRect(pr1,@r3)'\nSystem::Call '*$3(i,i.r5,i,i.r7)'\nIntOp $7 $7 - $5\nIntOp $6 $6 + 4 ; Padding for focus rect\nSystem::Call 'USER32::SetWindowPos(pr1,p,i,i,ir6,ir7,i0x16)'\nFunctionEnd\n\nFunction AdjustLinkPair\nPop $2 ; Label\nSetCtlColors $2 00000000 ${CB_PAGE}\nCall ConfigureLink\nFunctionEnd\n\nFunction SplitPipe\nExch $0\nPush $1\nPush $2\nStrCpy $2 0\nfindSep:\nStrCpy $1 $0 1 $2\nIntOp $2 $2 + 1\nStrCmp $1 \"\" +2\nStrCmp $1 \"|\" \"\" findSep\nStrCpy $1 $0 \"\" $2\nIntOp $2 $2 - 1\nStrCpy $0 $0 $2\nPop $2\nExch $1\nExch\nExch $0\nFunctionEnd\n\nSection\nSectionEnd\n\nPage Custom PageCreate PageLeave\n!pragma warning disable 8000 ; Page instfiles not used"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/NSISUltraModernUI.nsi",
    "content": "; o-----------------------------------------------o\n; | NSIS 3.03 + Ultra-Modern User Interface 2.0b5 |\n; (-----------------------------------------------)\n; | Installer script.                             |\n; | Written by SyperPat                           |\n; o-----------------------------------------------o\n\n;--------------------------------\n;General\n\n  !define /date NOW \"%Y-%m-%d\"\n  !define NAME \"UltraModernUI\"\n\n  !define UMUI_VERSION \"2.0b5\"\n  !define UMUI_VERBUILD \"2.0_${NOW}\"\n\n  !define VER_MAJOR 3\n  !define VER_MINOR 04\n  !define VER_REVISION 0\n  !define VER_BUILD 0\n  !define VER_REV_STR \"\"\n\n  !define VERSION \"${VER_MAJOR}.${VER_MINOR}${VER_REV_STR}\"\n  !if \"${NSIS_VERSION}\" != \"v${VERSION}\"\n    !error \"VER_MAJOR, VER_MINOR and VER_REV_STR defines does not match the current NSIS version: ${NSIS_VERSION}\"\n  !endif\n\n  !define /date VERIPV \"200.%Y.%m.%d\"\n  VIProductVersion \"${VERIPV}\"\n  VIAddVersionKey ProductName \"NSIS (Nullsoft Scriptable Install System) with the Ultra-Modern User Interface.\"\n  VIAddVersionKey ProductVersion \"${UMUI_VERSION}\"\n  VIAddVersionKey Comments \"This package also include some plugins used by UMUI to extend the possibilities of NSIS.\"\n  VIAddVersionKey LegalTrademarks \"NSIS and Ultra-Modern UI are released under the zlib/libpng license: http://nsis.sf.net/License\"\n  VIAddVersionKey LegalCopyright \"Copyright  2005-2019 SuperPat\"\n  VIAddVersionKey FileDescription \"NSIS (Nullsoft Scriptable Install System) with the Ultra-Modern User Interface.\"\n  VIAddVersionKey FileVersion \"${UMUI_VERBUILD}\"\n\n\n;--------------------------------\n;Configuration\n\n  ; The name of the installer\n  Name \"NSIS ${VERSION} and Ultra-Modern UI ${UMUI_VERSION}\"\n\n  ; The file to write\n  OutFile \"NSIS_${VERSION}_UltraModernUI_${UMUI_VERSION}.exe\"\n\n  SetCompressor /FINAL /SOLID lzma\n\n  ;Generate unicode installer\n  Unicode True\n\n  ;Windows vista compatibility\n  RequestExecutionLevel admin\n\n  BrandingText \"$(^NameDA)\"\n\n  ;Default installation folder\n  InstallDir \"$PROGRAMFILES\\NSIS\"\n\n\n;--------------------------------\n;Include Ultra-Modern UI between others\n\n  !include \"UMUI.nsh\"\n  !include \"Sections.nsh\"\n\n;--------------------------------\n;Definitions\n\n  !define SHCNE_ASSOCCHANGED 0x8000000\n  !define SHCNF_IDLIST 0\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"blue\"\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n  !define UMUI_USE_ALTERNATE_PAGE ; For Welcome finish abort pages\n  !define UMUI_USE_UNALTERNATE_PAGE\n\n  !define MUI_COMPONENTSPAGE_SMALLDESC\n\n  !define UMUI_DEFAULT_SHELLVARCONTEXT all\n \n  !define UMUI_ENABLE_DESCRIPTION_TEXT\n\n;--------------------------------\n;Registry Settings\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKLM\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\NSIS\"\n\n  !define UMUI_LANGUAGE_REGISTRY_VALUENAME \"UMUI_InstallerLanguage\"\n  !define UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME \"UMUI_ShellVarContext\"\n\n  !define UMUI_UNINSTALLPATH_REGISTRY_VALUENAME \"UMUI_UninstallPath\"\n  !define UMUI_UNINSTALL_FULLPATH \"$INSTDIR\\UninstallUMUI.exe\"\n  !define UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME \"UMUI_InstallPath\"\n\n  !define UMUI_VERSION_REGISTRY_VALUENAME \"UMUI_Version\"\n  !define UMUI_VERBUILD_REGISTRY_VALUENAME \"UMUI_VerBuild\"\n\n  !define UMUI_PREUNINSTALL_FUNCTION preuninstall_function\n\n  InstallDirRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"\"\n\n;--------------------------------\n;Reserve Files\n\n  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\n\n\n;--------------------------------\n;Pages\n\n  !insertmacro UMUI_PAGE_MULTILANGUAGE\n\n    !define UMUI_MAINTENANCEPAGE_MODIFY\n    !define UMUI_MAINTENANCEPAGE_REPAIR\n    !define UMUI_MAINTENANCEPAGE_REMOVE\n    !define UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_PAGE_MAINTENANCE\n\n    !define UMUI_UPDATEPAGE_REMOVE\n    !define UMUI_UPDATEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_PAGE_UPDATE\n\n    !define UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n  !insertmacro MUI_PAGE_WELCOME\n\n    !define MUI_LICENSEPAGE_CHECKBOX\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n\n    !define UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT\n  !insertmacro UMUI_PAGE_INFORMATION \"${NSISDIR}\\Docs\\UltraModernUI\\ReadMe.rtf\"\n\n    !define UMUI_SETUPTYPEPAGE_MINIMAL \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_STANDARD \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_COMPLETE \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_DEFAULTCHOICE ${UMUI_COMPLETE}\n    !define UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME \"UMUI_SetupType\"\n  !insertmacro UMUI_PAGE_SETUPTYPE\n\n    !define UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME \"UMUI_InstType\"\n    !define UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME \"UMUI_Components\"\n  !insertmacro MUI_PAGE_COMPONENTS\n\n  !insertmacro MUI_PAGE_DIRECTORY\n\n    !define UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME \"UMUI_Tasks\"\n  !insertmacro UMUI_PAGE_ADDITIONALTASKS addtasks_function\n\n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n\n  !insertmacro MUI_PAGE_INSTFILES\n\n    !define MUI_FINISHPAGE_SHOWREADME \"${NSISDIR}\\Docs\\UltraModernUI\\Readme.html\"\n    !define MUI_FINISHPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n\n    !define UMUI_ABORTPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n\n\n  !insertmacro UMUI_UNPAGE_MULTILANGUAGE\n\n    !define UMUI_MAINTENANCEPAGE_MODIFY\n    !define UMUI_MAINTENANCEPAGE_REPAIR\n    !define UMUI_MAINTENANCEPAGE_REMOVE\n    !define UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_UNPAGE_MAINTENANCE\n\n  !insertmacro MUI_UNPAGE_WELCOME\n\n  !insertmacro MUI_UNPAGE_CONFIRM\n\n  !insertmacro MUI_UNPAGE_INSTFILES\n\n    !define MUI_FINISHPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n\n    !define UMUI_ABORTPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT\n\n\n;--------------------------------\n;Languages\n\n; first language is the default language if the system language is not in this list\n  !insertmacro MUI_LANGUAGE \"English\"\n\n; Other UMUI translated languages\n  !insertmacro MUI_LANGUAGE \"Bulgarian\"\n  !insertmacro MUI_LANGUAGE \"Czech\"\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"German\"\n  !insertmacro MUI_LANGUAGE \"Greek\"\n  !insertmacro MUI_LANGUAGE \"Hungarian\"\n  !insertmacro MUI_LANGUAGE \"Italian\"\n  !insertmacro MUI_LANGUAGE \"Japanese\"\n  !insertmacro MUI_LANGUAGE \"Lithuanian\"\n  !insertmacro MUI_LANGUAGE \"Polish\"\n  !insertmacro MUI_LANGUAGE \"Russian\"\n  !insertmacro MUI_LANGUAGE \"Slovenian\"\n  !insertmacro MUI_LANGUAGE \"Spanish\"\n  !insertmacro MUI_LANGUAGE \"Turkish\"\n; Other UMUI partially translated language\n  !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n\n; Other untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n  !insertmacro MUI_LANGUAGE \"SimpChinese\"\n  !insertmacro MUI_LANGUAGE \"TradChinese\"\n  !insertmacro MUI_LANGUAGE \"Korean\"\n  !insertmacro MUI_LANGUAGE \"Dutch\"\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro MUI_LANGUAGE \"Norwegian\"\n  !insertmacro MUI_LANGUAGE \"NorwegianNynorsk\"\n  !insertmacro MUI_LANGUAGE \"Finnish\"\n  !insertmacro MUI_LANGUAGE \"Portuguese\"\n  !insertmacro MUI_LANGUAGE \"Ukrainian\"\n  !insertmacro MUI_LANGUAGE \"Slovak\"\n  !insertmacro MUI_LANGUAGE \"Croatian\"\n  !insertmacro MUI_LANGUAGE \"Thai\"\n  !insertmacro MUI_LANGUAGE \"Romanian\"\n  !insertmacro MUI_LANGUAGE \"Latvian\"\n  !insertmacro MUI_LANGUAGE \"Macedonian\"\n  !insertmacro MUI_LANGUAGE \"Estonian\"\n  !insertmacro MUI_LANGUAGE \"Serbian\"\n  !insertmacro MUI_LANGUAGE \"SerbianLatin\"\n  !insertmacro MUI_LANGUAGE \"Arabic\"\n  !insertmacro MUI_LANGUAGE \"Farsi\"\n  !insertmacro MUI_LANGUAGE \"Hebrew\"\n  !insertmacro MUI_LANGUAGE \"Indonesian\"\n  !insertmacro MUI_LANGUAGE \"Mongolian\"\n  !insertmacro MUI_LANGUAGE \"Luxembourgish\"\n  !insertmacro MUI_LANGUAGE \"Albanian\"\n  !insertmacro MUI_LANGUAGE \"Breton\"\n  !insertmacro MUI_LANGUAGE \"Belarusian\"\n  !insertmacro MUI_LANGUAGE \"Icelandic\"\n  !insertmacro MUI_LANGUAGE \"Malay\"\n  !insertmacro MUI_LANGUAGE \"Bosnian\"\n  !insertmacro MUI_LANGUAGE \"Kurdish\"\n  !insertmacro MUI_LANGUAGE \"Irish\"\n  !insertmacro MUI_LANGUAGE \"Uzbek\"\n  !insertmacro MUI_LANGUAGE \"Galician\"\n  !insertmacro MUI_LANGUAGE \"Afrikaans\"\n  !insertmacro MUI_LANGUAGE \"Catalan\"\n  !insertmacro MUI_LANGUAGE \"Esperanto\"\n  !insertmacro MUI_LANGUAGE \"Asturian\"\n  !insertmacro MUI_LANGUAGE \"Basque\"\n  !insertmacro MUI_LANGUAGE \"Pashto\"\n  !insertmacro MUI_LANGUAGE \"ScotsGaelic\"\n  !insertmacro MUI_LANGUAGE \"Vietnamese\"\n  !insertmacro MUI_LANGUAGE \"Welsh\"\n  !insertmacro MUI_LANGUAGE \"Corsican\"\n  !insertmacro MUI_LANGUAGE \"Tatar\"\n\n; Other unicode only untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"Armenian\"\n  !insertmacro MUI_LANGUAGE \"Georgian\"\n  !insertmacro MUI_LANGUAGE \"Hindi\"\n\n\n;--------------------------------\n;Installer Types\n\nInstType \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\n\n\n;--------------------------------\n;Installer Sections\n\nSectionGroup /e \"NSIS ${VERSION}\" SecNSIS\n\n!macro InstallStub stub\n    File ..\\..\\Stubs\\${stub}-x86-ansi\n    File ..\\..\\Stubs\\${stub}-x86-unicode\n!macroend\n\nSection \"NSIS Core Files (required)\" SecCore\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing NSIS Core Files...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1 2 3 RO\n  SetOutPath $INSTDIR\n  RMDir /r $SMPROGRAMS\\NSIS\n\n  IfFileExists $INSTDIR\\nsisconf.nsi \"\" +2\n  Rename $INSTDIR\\nsisconf.nsi $INSTDIR\\nsisconf.nsh\n  SetOverwrite off\n  File ..\\..\\nsisconf.nsh\n\n  SetOverwrite on\n  File ..\\..\\makensis.exe\n  File ..\\..\\makensisw.exe\n  File ..\\..\\COPYING\n  File ..\\..\\NSIS.chm\n  !pragma verifychm \"..\\..\\NSIS.chm\"\n  !if /FileExists \"..\\..\\NSIS.exe\"\n    !if /FileExists \"..\\..\\NSIS.exe.manifest\"\n      File \"..\\..\\NSIS.exe.manifest\"\n    !endif\n  !else\n    !define NO_NSISMENU_HTML 1\n    !makensis '-v2 \"NSISMenu.nsi\" \"-XOutFile ..\\..\\NSIS.exe\"' = 0\n  !endif\n  File ..\\..\\NSIS.exe\n\n  SetOutPath $INSTDIR\\Bin\n  File ..\\..\\Bin\\makensis.exe\n!ifdef USE_NEW_ZLIB\n  File ..\\..\\Bin\\zlib.dll\n!else\n  File ..\\..\\Bin\\zlib1.dll\n!endif\n\n  SetOutPath $INSTDIR\\Stubs\n  File ..\\..\\Stubs\\uninst\n  !insertmacro InstallStub bzip2\n  !insertmacro InstallStub bzip2_solid\n  !insertmacro InstallStub lzma\n  !insertmacro InstallStub lzma_solid\n  !insertmacro InstallStub zlib\n  !insertmacro InstallStub zlib_solid\n\n\n  SetOutPath $INSTDIR\\Include\n  File ..\\..\\Include\\WinMessages.nsh\n  File ..\\..\\Include\\Sections.nsh\n  File ..\\..\\Include\\Library.nsh\n  File ..\\..\\Include\\UpgradeDLL.nsh\n  File ..\\..\\Include\\LogicLib.nsh\n  File ..\\..\\Include\\StrFunc.nsh\n  File ..\\..\\Include\\Colors.nsh\n  File ..\\..\\Include\\FileFunc.nsh\n  File ..\\..\\Include\\TextFunc.nsh\n  File ..\\..\\Include\\WordFunc.nsh\n  File ..\\..\\Include\\WinVer.nsh\n  File ..\\..\\Include\\x64.nsh\n  File ..\\..\\Include\\Memento.nsh\n  File ..\\..\\Include\\LangFile.nsh\n  File ..\\..\\Include\\InstallOptions.nsh\n  File ..\\..\\Include\\MultiUser.nsh\n  File ..\\..\\Include\\VB6RunTime.nsh\n  File ..\\..\\Include\\Util.nsh\n  File ..\\..\\Include\\WinCore.nsh\n\n  SetOutPath $INSTDIR\\Include\\Win\n  File ..\\..\\Include\\Win\\WinDef.nsh\n  File ..\\..\\Include\\Win\\WinError.nsh\n  File ..\\..\\Include\\Win\\WinNT.nsh\n  File ..\\..\\Include\\Win\\WinUser.nsh\n  File ..\\..\\Include\\Win\\Propkey.nsh\n\n  SetOutPath $INSTDIR\\Docs\\StrFunc\n  File ..\\..\\Docs\\StrFunc\\StrFunc.txt\n\n  SetOutPath $INSTDIR\\Docs\\MultiUser\n  File ..\\..\\Docs\\MultiUser\\Readme.html\n\n  SetOutPath $INSTDIR\\Docs\\makensisw\n  File ..\\..\\Docs\\makensisw\\*.txt\n\n  !ifndef NO_NSISMENU_HTML\n    SetOutPath $INSTDIR\\Menu\n    File ..\\..\\Menu\\*.html\n    SetOutPath $INSTDIR\\Menu\\images\n    File ..\\..\\Menu\\images\\header.gif\n    File ..\\..\\Menu\\images\\line.gif\n    File ..\\..\\Menu\\images\\site.gif\n  !endif\n\n  Delete $INSTDIR\\makensis.htm\n  Delete $INSTDIR\\Docs\\*.html\n  Delete $INSTDIR\\Docs\\style.css\n  RMDir $INSTDIR\\Docs\n\n  SetOutPath $INSTDIR\\Bin\n  !if /FileExists \"..\\..\\Bin\\LibraryLocal.exe\"\n    File ..\\..\\Bin\\LibraryLocal.exe\n  !endif\n  !if /FileExists \"..\\..\\Bin\\RegTool-x86.bin\"\n    File ..\\..\\Bin\\RegTool-x86.bin\n  !else\n    File ..\\..\\Bin\\RegTool.bin\n  !endif\n\n  CreateDirectory $INSTDIR\\Plugins\\x86-ansi\n  CreateDirectory $INSTDIR\\Plugins\\x86-unicode\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\TypeLib.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\TypeLib.dll\n\n  ReadRegStr $R0 HKCR \".nsi\" \"\"\n  StrCmp $R0 \"NSISFile\" 0 +2\n    DeleteRegKey HKCR \"NSISFile\"\n\n  WriteRegStr HKCR \".nsi\" \"\" \"NSIS.Script\"\n  WriteRegStr HKCR \"NSIS.Script\" \"\" \"NSIS Script File\"\n  WriteRegStr HKCR \"NSIS.Script\\DefaultIcon\" \"\" \"$INSTDIR\\makensisw.exe,1\"\n  ReadRegStr $R0 HKCR \"NSIS.Script\\shell\\open\\command\" \"\"\n  StrCmp $R0 \"\" 0 no_nsiopen\n    WriteRegStr HKCR \"NSIS.Script\\shell\" \"\" \"open\"\n    WriteRegStr HKCR \"NSIS.Script\\shell\\open\\command\" \"\" 'notepad.exe \"%1\"'\n  no_nsiopen:\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile\" \"\" \"Compile NSIS Script\"\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile\\command\" \"\" '\"$INSTDIR\\makensisw.exe\" \"%1\"'\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile-compressor\" \"\" \"Compile NSIS Script (Choose Compressor)\"\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile-compressor\\command\" \"\" '\"$INSTDIR\\makensisw.exe\" /ChooseCompressor \"%1\"'\n\n  ReadRegStr $R0 HKCR \".nsh\" \"\"\n  StrCmp $R0 \"NSHFile\" 0 +2\n    DeleteRegKey HKCR \"NSHFile\"\n\n  WriteRegStr HKCR \".nsh\" \"\" \"NSIS.Header\"\n  WriteRegStr HKCR \"NSIS.Header\" \"\" \"NSIS Header File\"\n  WriteRegStr HKCR \"NSIS.Header\\DefaultIcon\" \"\" \"$INSTDIR\\makensisw.exe,1\"\n  ReadRegStr $R0 HKCR \"NSIS.Header\\shell\\open\\command\" \"\"\n  StrCmp $R0 \"\" 0 no_nshopen\n    WriteRegStr HKCR \"NSIS.Header\\shell\" \"\" \"open\"\n    WriteRegStr HKCR \"NSIS.Header\\shell\\open\\command\" \"\" 'notepad.exe \"%1\"'\n  no_nshopen:\n\n  System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'\n\nSectionEnd\n\nSection \"Script Examples\" SecExample\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Script Examples...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n  SetOutPath $INSTDIR\\Examples\n  File ..\\..\\Examples\\makensis.nsi\n  File ..\\..\\Examples\\example1.nsi\n  File ..\\..\\Examples\\example2.nsi\n  File ..\\..\\Examples\\viewhtml.nsi\n  File ..\\..\\Examples\\waplugin.nsi\n  File ..\\..\\Examples\\bigtest.nsi\n  File ..\\..\\Examples\\primes.nsi\n  File ..\\..\\Examples\\rtest.nsi\n  File ..\\..\\Examples\\gfx.nsi\n  File ..\\..\\Examples\\one-section.nsi\n  File ..\\..\\Examples\\languages.nsi\n  File ..\\..\\Examples\\Library.nsi\n  File ..\\..\\Examples\\VersionInfo.nsi\n  File ..\\..\\Examples\\UserVars.nsi\n  File ..\\..\\Examples\\LogicLib.nsi\n  File ..\\..\\Examples\\silent.nsi\n  File ..\\..\\Examples\\StrFunc.nsi\n  File ..\\..\\Examples\\FileFunc.nsi\n  File ..\\..\\Examples\\FileFunc.ini\n  File ..\\..\\Examples\\FileFuncTest.nsi\n  File ..\\..\\Examples\\TextFunc.nsi\n  File ..\\..\\Examples\\TextFunc.ini\n  File ..\\..\\Examples\\TextFuncTest.nsi\n  File ..\\..\\Examples\\WordFunc.nsi\n  File ..\\..\\Examples\\WordFunc.ini\n  File ..\\..\\Examples\\WordFuncTest.nsi\n  File ..\\..\\Examples\\Memento.nsi\n  File /nonfatal ..\\..\\Examples\\unicode.nsi\n  File /nonfatal ..\\..\\Examples\\NSISMenu.nsi\n\n  SetOutPath $INSTDIR\\Examples\\Plugin\n  File ..\\..\\Examples\\Plugin\\exdll.c\n  File ..\\..\\Examples\\Plugin\\exdll.dpr\n  File ..\\..\\Examples\\Plugin\\exdll.dsp\n  File ..\\..\\Examples\\Plugin\\exdll.dsw\n  File ..\\..\\Examples\\Plugin\\exdll_with_unit.dpr\n  File ..\\..\\Examples\\Plugin\\exdll-vs2008.sln\n  File ..\\..\\Examples\\Plugin\\exdll-vs2008.vcproj\n  File ..\\..\\Examples\\Plugin\\extdll.inc\n  File ..\\..\\Examples\\Plugin\\nsis.pas\n\n  SetOutPath $INSTDIR\\Examples\\Plugin\\nsis\n  File ..\\..\\Examples\\Plugin\\nsis\\pluginapi.h\n  File /nonfatal ..\\..\\Examples\\Plugin\\nsis\\pluginapi*.lib\n  File ..\\..\\Examples\\Plugin\\nsis\\api.h\n  File ..\\..\\Examples\\Plugin\\nsis\\nsis_tchar.h\n\nSectionEnd\n\nSectionGroup \"User Interfaces\" SecInterfaces\n\nSection \"Modern User Interface\" SecInterfacesModernUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing User Interfaces | Modern User Interface...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Examples\\Modern UI\"\n  File \"..\\..\\Examples\\Modern UI\\Basic.nsi\"\n  File \"..\\..\\Examples\\Modern UI\\HeaderBitmap.nsi\"\n  File \"..\\..\\Examples\\Modern UI\\MultiLanguage.nsi\"\n  File \"..\\..\\Examples\\Modern UI\\StartMenu.nsi\"\n  File \"..\\..\\Examples\\Modern UI\\WelcomeFinish.nsi\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Modern UI\"\n  File \"..\\..\\Contrib\\Modern UI\\System.nsh\"\n  File \"..\\..\\Contrib\\Modern UI\\ioSpecial.ini\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI\"\n  File \"..\\..\\Docs\\Modern UI\\Readme.html\"\n  File \"..\\..\\Docs\\Modern UI\\Changelog.txt\"\n  File \"..\\..\\Docs\\Modern UI\\License.txt\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI\\images\"\n  File \"..\\..\\Docs\\Modern UI\\images\\header.gif\"\n  File \"..\\..\\Docs\\Modern UI\\images\\screen1.png\"\n  File \"..\\..\\Docs\\Modern UI\\images\\screen2.png\"\n  File \"..\\..\\Docs\\Modern UI\\images\\open.gif\"\n  File \"..\\..\\Docs\\Modern UI\\images\\closed.gif\"\n\n  SetOutPath $INSTDIR\\Contrib\\UIs\n  File \"..\\..\\Contrib\\UIs\\modern.exe\"\n  File \"..\\..\\Contrib\\UIs\\modern_headerbmp.exe\"\n  File \"..\\..\\Contrib\\UIs\\modern_headerbmpr.exe\"\n  File \"..\\..\\Contrib\\UIs\\modern_nodesc.exe\"\n  File \"..\\..\\Contrib\\UIs\\modern_smalldesc.exe\"\n\n  SetOutPath $INSTDIR\\Include\n  File \"..\\..\\Include\\MUI.nsh\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Modern UI 2\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Deprecated.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Interface.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Localization.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\MUI2.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages.nsh\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Modern UI 2\\Pages\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\Components.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\Directory.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\Finish.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\InstallFiles.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\License.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\StartMenu.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\UninstallConfirm.nsh\"\n  File \"..\\..\\Contrib\\Modern UI 2\\Pages\\Welcome.nsh\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI 2\"\n  File \"..\\..\\Docs\\Modern UI 2\\Readme.html\"\n  File \"..\\..\\Docs\\Modern UI 2\\License.txt\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI 2\\images\"\n  File \"..\\..\\Docs\\Modern UI 2\\images\\header.gif\"\n  File \"..\\..\\Docs\\Modern UI 2\\images\\screen1.png\"\n  File \"..\\..\\Docs\\Modern UI 2\\images\\screen2.png\"\n  File \"..\\..\\Docs\\Modern UI 2\\images\\open.gif\"\n  File \"..\\..\\Docs\\Modern UI 2\\images\\closed.gif\"\n\n  SetOutPath $INSTDIR\\Include\n  File \"..\\..\\Include\\MUI2.nsh\"\n\nSectionEnd\n\nSection \"Default User Interface\" SecInterfacesDefaultUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing User Interfaces | Default User Interface...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\UIs\"\n  File \"..\\..\\Contrib\\UIs\\default.exe\"\n\nSectionEnd\n\nSection \"Tiny User Interface\" SecInterfacesTinyUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing User Interfaces | Tiny User Interface...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\UIs\"\n  File \"..\\..\\Contrib\\UIs\\sdbarker_tiny.exe\"\n\nSectionEnd\n\nSectionGroupEnd\n\nSection \"Graphics\" SecGraphics\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Graphics...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  RMDir $INSTDIR\\Contrib\\Icons\n  SetOutPath $INSTDIR\\Contrib\\Graphics\n  File /r \"..\\..\\Contrib\\Graphics\\*.ico\"\n  File /r \"..\\..\\Contrib\\Graphics\\*.bmp\"\nSectionEnd\n\nSection \"Language Files\" SecLangFiles\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Language Files...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n  File \"..\\..\\Contrib\\Language files\\*.nlf\"\n\n  SetOutPath $INSTDIR\\Bin\n  File ..\\..\\Bin\\MakeLangID.exe\n\n  !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui\n  mui:\n    SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n    File \"..\\..\\Contrib\\Language files\\*.nsh\"\n  nomui:\n\nSectionEnd\n\nSectionGroup \"Tools\" SecTools\n\nSection \"Zip2Exe\" SecToolsZ2E\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Tools | Zip2Exe...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Bin\n  File ..\\..\\Bin\\zip2exe.exe\n  SetOutPath $INSTDIR\\Contrib\\zip2exe\n  File ..\\..\\Contrib\\zip2exe\\Base.nsh\n  File ..\\..\\Contrib\\zip2exe\\Modern.nsh\n  File ..\\..\\Contrib\\zip2exe\\Classic.nsh\n\nSectionEnd\n\nSectionGroupEnd\n\nSectionGroup \"Plug-ins\" SecPluginsPlugins\n\nSection \"Banner plugin\" SecPluginsBanner\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Banner...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\Banner.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\Banner.dll\n  SetOutPath $INSTDIR\\Docs\\Banner\n  File ..\\..\\Docs\\Banner\\Readme.txt\n  SetOutPath $INSTDIR\\Examples\\Banner\n  File ..\\..\\Examples\\Banner\\Example.nsi\nSectionEnd\n\nSection \"Language DLL plugin\" SecPluginsLangDLL\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Language DLL...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\LangDLL.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\LangDLL.dll\nSectionEnd\n\nSection \"nsExec plugin\" SecPluginsnsExec\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | nsExec...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\nsExec.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\nsExec.dll\n  SetOutPath $INSTDIR\\Docs\\nsExec\n  File ..\\..\\Docs\\nsExec\\nsExec.txt\n  SetOutPath $INSTDIR\\Examples\\nsExec\n  File ..\\..\\Examples\\nsExec\\test.nsi\nSectionEnd\n\nSection \"Splash plugin\" SecPluginsSplash\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Splash...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\splash.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\splash.dll\n  SetOutPath $INSTDIR\\Docs\\Splash\n  File ..\\..\\Docs\\Splash\\splash.txt\n  SetOutPath $INSTDIR\\Examples\\Splash\n  File ..\\..\\Examples\\Splash\\Example.nsi\nSectionEnd\n\nSection \"AdvSplash plugin\" SecPluginsSplashT\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | AdvSplash...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\advsplash.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\advsplash.dll\n  SetOutPath $INSTDIR\\Docs\\AdvSplash\n  File ..\\..\\Docs\\AdvSplash\\advsplash.txt\n  SetOutPath $INSTDIR\\Examples\\AdvSplash\n  File ..\\..\\Examples\\AdvSplash\\Example.nsi\nSectionEnd\n\nSection \"BgImage plugin\" SecPluginsBgImage\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | BgImage...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\BgImage.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\BgImage.dll\n  SetOutPath $INSTDIR\\Docs\\BgImage\n  File ..\\..\\Docs\\BgImage\\BgImage.txt\n  SetOutPath $INSTDIR\\Examples\\BgImage\n  File ..\\..\\Examples\\BgImage\\Example.nsi\nSectionEnd\n\nSection \"InstallOptions plugin\" SecPluginsIO\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | InstallOptions...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\InstallOptions.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\InstallOptions.dll\n  SetOutPath $INSTDIR\\Docs\\InstallOptions\n  File ..\\..\\Docs\\InstallOptions\\Readme.html\n  File ..\\..\\Docs\\InstallOptions\\Changelog.txt\n  SetOutPath $INSTDIR\\Examples\\InstallOptions\n  File ..\\..\\Examples\\InstallOptions\\test.ini\n  File ..\\..\\Examples\\InstallOptions\\test.nsi\n  File ..\\..\\Examples\\InstallOptions\\testimgs.ini\n  File ..\\..\\Examples\\InstallOptions\\testimgs.nsi\n  File ..\\..\\Examples\\InstallOptions\\testlink.ini\n  File ..\\..\\Examples\\InstallOptions\\testlink.nsi\n  File ..\\..\\Examples\\InstallOptions\\testnotify.ini\n  File ..\\..\\Examples\\InstallOptions\\testnotify.nsi\nSectionEnd\n\nSection \"Math plugin\" SecPluginsMath\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Math...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\Math.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\Math.dll\n  SetOutPath $INSTDIR\\Docs\\Math\n  File ..\\..\\Docs\\Math\\Math.txt\n  SetOutPath $INSTDIR\\Examples\\Math\n  File ..\\..\\Examples\\Math\\math.nsi\n  File ..\\..\\Examples\\Math\\mathtest.txt\n  File ..\\..\\Examples\\Math\\mathtest.nsi\n  File ..\\..\\Examples\\Math\\mathtest.ini\n\nSectionEnd\n\nSection \"NSISdl plugin\" SecPluginsNSISDL\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | NSISdl...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\nsisdl.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\nsisdl.dll\n  SetOutPath $INSTDIR\\Docs\\NSISdl\n  File ..\\..\\Docs\\NSISdl\\ReadMe.txt\n  File ..\\..\\Docs\\NSISdl\\License.txt\nSectionEnd\n\nSection \"System plugin\" SecPluginsSystem\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | System...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\System.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\System.dll\n  SetOutPath $INSTDIR\\Docs\\System\n  File ..\\..\\Docs\\System\\System.html\n  File ..\\..\\Docs\\System\\WhatsNew.txt\n  SetOutPath $INSTDIR\\Examples\\System\n  File ..\\..\\Examples\\System\\Resource.dll\n  File ..\\..\\Examples\\System\\SysFunc.nsh\n  File ..\\..\\Examples\\System\\System.nsh\n  File ..\\..\\Examples\\System\\System.nsi\nSectionEnd\n\nSection \"nsDialogs plugin\" SecPluginsDialogs\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | nsDialogs...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\nsDialogs.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\nsDialogs.dll\n  SetOutPath $INSTDIR\\Examples\\nsDialogs\n  File ..\\..\\Examples\\nsDialogs\\example.nsi\n  File ..\\..\\Examples\\nsDialogs\\InstallOptions.nsi\n  File ..\\..\\Examples\\nsDialogs\\timer.nsi\n  File ..\\..\\Examples\\nsDialogs\\welcome.nsi\n  SetOutPath $INSTDIR\\Include\n  File ..\\..\\Include\\nsDialogs.nsh\n  SetOutPath $INSTDIR\\Docs\\nsDialogs\n  File ..\\..\\Docs\\nsDialogs\\Readme.html\n\nSectionEnd\n\nSection \"StartMenu plugin\" SecPluginsStartMenu\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | StartMenu...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\StartMenu.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\StartMenu.dll\n  SetOutPath $INSTDIR\\Docs\\StartMenu\n  File ..\\..\\Docs\\StartMenu\\Readme.txt\n  SetOutPath $INSTDIR\\Examples\\StartMenu\n  File ..\\..\\Examples\\StartMenu\\Example.nsi\nSectionEnd\n\nSection \"UserInfo plugin\" SecPluginsUserInfo\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | UserInfo...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\UserInfo.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\UserInfo.dll\n  SetOutPath $INSTDIR\\Examples\\UserInfo\n  File ..\\..\\Examples\\UserInfo\\UserInfo.nsi\nSectionEnd\n\nSection \"Dialer plugin\" SecPluginsDialer\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Dialer...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\Dialer.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\Dialer.dll\n  SetOutPath $INSTDIR\\Docs\\Dialer\n  File ..\\..\\Docs\\Dialer\\Dialer.txt\nSectionEnd\n\nSection \"VPatch plugin\" SecPluginsVPatch\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | VPatch...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath $INSTDIR\\Plugins\\x86-ansi\n  File ..\\..\\Plugins\\x86-ansi\\VPatch.dll\n  SetOutPath $INSTDIR\\Plugins\\x86-unicode\n  File ..\\..\\Plugins\\x86-unicode\\VPatch.dll\n  SetOutPath $INSTDIR\\Examples\\VPatch\n  File ..\\..\\Examples\\VPatch\\example.nsi\n  File ..\\..\\Examples\\VPatch\\oldfile.txt\n  File ..\\..\\Examples\\VPatch\\newfile.txt\n  File ..\\..\\Examples\\VPatch\\patch.pat\n  SetOutPath $INSTDIR\\Docs\\VPatch\n  File ..\\..\\Docs\\VPatch\\Readme.html\n  SetOutPath $INSTDIR\\Bin\n  File ..\\..\\Bin\\GenPat.exe\n  SetOutPath $INSTDIR\\Include\n  File ..\\..\\Include\\VPatchLib.nsh\nSectionEnd\n\nSectionGroupEnd\n\nSection -post\n\n  ; When Modern UI is installed:\n  ; * Always install the English language file\n  ; * Always install default icons / bitmaps\n\n  !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui\n\n    mui:\n\n    SetDetailsPrint textonly\n    DetailPrint \"Configuring Modern UI...\"\n    SetDetailsPrint listonly\n\n    !insertmacro SectionFlagIsSet ${SecLangFiles} ${SF_SELECTED} langfiles nolangfiles\n\n      nolangfiles:\n\n      SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n      File \"..\\..\\Contrib\\Language files\\English.nlf\"\n      SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n      File \"..\\..\\Contrib\\Language files\\English.nsh\"\n\n    langfiles:\n\n    !insertmacro SectionFlagIsSet ${SecGraphics} ${SF_SELECTED} graphics nographics\n\n      nographics:\n\n      SetOutPath $INSTDIR\\Contrib\\Graphics\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Checks\n      File \"..\\..\\Contrib\\Graphics\\Checks\\modern.bmp\"\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Icons\n      File \"..\\..\\Contrib\\Graphics\\Icons\\modern-install.ico\"\n      File \"..\\..\\Contrib\\Graphics\\Icons\\modern-uninstall.ico\"\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Header\n      File \"..\\..\\Contrib\\Graphics\\Header\\nsis.bmp\"\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Wizard\n      File \"..\\..\\Contrib\\Graphics\\Wizard\\win.bmp\"\n\n    graphics:\n\n  nomui:\n\n  SetDetailsPrint textonly\n  DetailPrint \"Creating Registry Keys...\"\n  SetDetailsPrint listonly\n\n  SetOutPath $INSTDIR\n\n  WriteRegStr HKLM \"Software\\NSIS\" \"\" $INSTDIR\n!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionMajor\" \"${VER_MAJOR}\"\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionMinor\" \"${VER_MINOR}\"\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionRevision\" \"${VER_REVISION}\"\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionBuild\" \"${VER_BUILD}\"\n!endif\n\n  WriteRegExpandStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"UninstallString\" \"$INSTDIR\\uninst-nsis.exe\"\n  ;WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"QuietUninstallString\" '\"$INSTDIR\\uninst-nsis.exe\" /S' ; Ideally WACK would use this\n  WriteRegExpandStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"InstallLocation\" \"$INSTDIR\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"DisplayName\" \"Nullsoft Install System\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"DisplayIcon\" \"$INSTDIR\\NSIS.exe,0\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"DisplayVersion\" \"${VERSION}\"\n!ifdef VER_MAJOR & VER_MINOR & VER_REVISION\n  WriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"VersionMajor\" \"${VER_MAJOR}\" ; Required by WACK\n  WriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"VersionMinor\" \"${VER_MINOR}.${VER_REVISION}\" ; Required by WACK\n!endif\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"Publisher\" \"Nullsoft and Contributors\" ; Required by WACK\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"URLInfoAbout\" \"http://nsis.sourceforge.net/\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"HelpLink\" \"http://nsis.sourceforge.net/Support\"\n  WriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"NoModify\" \"1\"\n  WriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\" \"NoRepair\" \"1\"\n\n  SetOutPath \"$INSTDIR\"\n  File ..\\..\\uninst-nsis.exe\n\n  SetDetailsPrint both\n\nSectionEnd\n\nSectionGroupEnd\n\n;--------------------------------\n; UMUI Sections\n\nSectionGroup /e \"NSIS Ultra-Modern User Interface ${UMUI_VERSION}\" SecUMUIG\n\nSection \"NSIS Ultra-Modern User Interface Core Files (required)\" SecUMUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Ultra-Modern UI...\"\n  SetDetailsPrint listonly\n\n  SectionIn RO\n\n  SectionIn 1 2 3\n\n  SetOutPath \"$INSTDIR\\\"\n  !if ! /FileExists \"..\\..\\NSISUMUI.exe\"\n    !makensis '-v2 \"NSISUMUIMenu.nsi\" \"-XOutFile ..\\..\\NSISUMUI.exe\"' = 0\n  !endif\n  File ..\\..\\NSISUMUI.exe\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\UMUI.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Ini\\*.ini\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Language files\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Language files\\*.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File /r \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\blue.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\blue2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\blue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Docs\\UltraModernUI\\\"\n  File \"..\\..\\Docs\\UltraModernUI\\*.*\"\n  SetOutPath \"$INSTDIR\\Docs\\UltraModernUI\\images\\\"\n  File \"..\\..\\Docs\\UltraModernUI\\images\\*.png\"\n  File \"..\\..\\Docs\\UltraModernUI\\images\\*.gif\"\n\n  SetOutPath \"$INSTDIR\\Examples\\UltraModernUI\\\"\n  File \"*.nsi\"\n  File \"*.ini\"\n  File \"*.txt\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\\"\n  File \"..\\..\\Contrib\\UIs\\UltraModernUI\\*.exe\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\\"\n  File \"..\\..\\Contrib\\Graphics\\UltraModernUI\\*.*\"\n\n  SetOutPath \"$INSTDIR\\Include\\\"\n  File \"..\\..\\Include\\UMUI.nsh\"\n  File \"..\\..\\Include\\MUIEx.nsh\"\n\n\n  ;CreateShortCuts\n  ; only if all user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL\n    SetShellVarContext all\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if current user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED CURRENT\n    SetShellVarContext current\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n\n  SetOutPath \"$INSTDIR\\\"\n  CreateShortCut \"$SMPROGRAMS\\NSIS.lnk\" \"$INSTDIR\\NSISUMUI.exe\"\n\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP\n    CreateShortCut \"$DESKTOP\\NSIS.lnk\" \"$INSTDIR\\NSISUMUI.exe\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n\n\n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\UninstallUMUI.exe\"\n\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayName\" \"$(^Name)\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayIcon\" \"$INSTDIR\\UninstallUMUI.exe,0\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"UninstallString\" \"$INSTDIR\\UninstallUMUI.exe\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"Publisher\" \"SuperPat\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"HelpLink\" \"http://ultramodernui.sourceforge.net/\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"URLInfoAbout\" \"http://ultramodernui.sourceforge.net/\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"URLUpdateInfo\" \"http://ultramodernui.sourceforge.net/\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"ModifyPath\" '\"$INSTDIR\\UninstallUMUI.exe\" /modify'\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayVersion\" \"${UMUI_VERSION}\"\n\nSectionEnd\n\nSection \"Skins for Ultra-Modern UI\" SecSkins\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Ultra-Modern UI | Skins...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\brown.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\brown2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\brown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\darkgreen.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\darkgreen2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\darkgreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\gray.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\gray2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\gray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\green.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\green2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\green\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\purple.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\purple2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\purple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\red.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\red2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\red\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBlue.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBrown.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGray.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGreen.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftPurple.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftRed.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftRed\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftRed\\*.bmp\"\n\nSectionEnd\n\nSection \"BackGround Skins for Ultra-Modern UI\" SecBGSkins\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Ultra-Modern UI | BackGround Skins...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\blue.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\blue2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\blue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\brown.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\brown2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\brown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\darkgreen.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\darkgreen2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\gray.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\gray2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\gray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\green.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\green2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\green\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\purple.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\purple2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\purple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\red.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\red2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\red\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGray.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftRed.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftRed\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftRed\\*.bmp\"\n\nSectionEnd\n\n\nSectionGroup /e \"Plugins\" SecGroupPlugins\n\n  Section \"SkinnedControls plugin version 1.4\" SecSkinnedControls\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | SkinnedControls...\"\n    SetDetailsPrint listonly\n\n    SectionIn RO\n\n    SectionIn 1 2 3\n\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi\n    File \"..\\..\\Plugins\\x86-ansi\\SkinnedControls.dll\"\n\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\SkinnedControls.dll\"\n\n    SetOutPath $INSTDIR\\Examples\\SkinnedControls\n    File \"..\\SkinnedControls\\*.nsi\"\n\n    SetOutPath $INSTDIR\\Contrib\\SkinnedControls\\skins\n    File \"..\\..\\Contrib\\SkinnedControls\\skins\\*.bmp\"\n\n    SetOutPath $INSTDIR\\Contrib\\UIs\n    File \"..\\..\\Contrib\\UIs\\modern_sb.exe\"\n    File \"..\\..\\Contrib\\UIs\\default_sb.exe\"\n\n    SetOutPath $INSTDIR\\Docs\\SkinnedControls\n    File \"..\\..\\Docs\\SkinnedControls\\*.*\"\n    SetOutPath \"$INSTDIR\\Docs\\SkinnedControls\\images\\\"\n    File \"..\\..\\Docs\\SkinnedControls\\images\\*.png\"\n    File \"..\\..\\Docs\\SkinnedControls\\images\\*.gif\"\n\n  SectionEnd\n\n  Section \"SkinnedControls plugin Sources Code\" SecSkinnedControlsSources\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | SkinnedControls Soucres Code...\"\n    SetDetailsPrint listonly\n\n    SectionIn 3\n\n    SetOutPath $INSTDIR\\Contrib\\SkinnedControls\n    File \"..\\..\\Contrib\\SkinnedControls\\*.h\"\n    File \"..\\..\\Contrib\\SkinnedControls\\*.c\"\n    File \"..\\..\\Contrib\\SkinnedControls\\SkinnedControls.sln\"\n    File \"..\\..\\Contrib\\SkinnedControls\\SkinnedControls.vcproj\"\n    SetOutPath $INSTDIR\\Contrib\\SkinnedControls\\coolsb\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\*.h\"\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\*.c\"\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\detours.lib\"\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\coolsb.vcproj\"\n\n  SectionEnd\n\n\n  Section \"InstallOptionsEx plugin version 2.4.5 beta 3\" SecInstallOptionsEx\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | InstallOptionsEx...\"\n    SetDetailsPrint listonly\n\n    SectionIn 2 3\n\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi\n    File \"..\\..\\Plugins\\x86-ansi\\InstallOptionsEx.dll\"\n\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\InstallOptionsEx.dll\"\n\n    SetOutPath $INSTDIR\\Examples\\InstallOptionsEx\n    File \"..\\InstallOptionsEx\\*.nsi\"\n    File \"..\\InstallOptionsEx\\*.ini\"\n\n    SetOutPath $INSTDIR\\Docs\\InstallOptionsEx\n    File \"..\\..\\Docs\\InstallOptionsEx\\*.*\"\n\n  SectionEnd\n\n  Section \"InstallOptionsEx plugin Sources Code\" SecInstallOptionsExSources\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | InstallOptionsEx Soucres Code...\"\n    SetDetailsPrint listonly\n\n    SectionIn 3\n\n  SetOutPath $INSTDIR\\Contrib\\InstallOptionsEx\n  File \"..\\..\\Contrib\\InstallOptionsEx\\*.cpp\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\*.c\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\*.h\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\ioptdll.rc\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\io.sln\"\n  File \"..\\..\\Contrib\\InstallOptionsEx\\io.vcproj\"\n  SetOutPath $INSTDIR\\Contrib\\InstallOptionsEx\\Controls\n  File \"..\\..\\Contrib\\InstallOptionsEx\\Controls\\*.h\"\n\n  SectionEnd\n\n\n  Section \"nsArray plugin version 1.1.1.7\" SecnsArray\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | nsArray...\"\n    SetDetailsPrint listonly\n\n    SectionIn 2 3\n\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi   \n    File \"..\\..\\Plugins\\x86-ansi\\nsArray.dll\"\n\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\nsArray.dll\"\n\n    SetOutPath $INSTDIR\\Include\n    File \"..\\..\\Include\\nsArray.nsh\"\n\n    SetOutPath $INSTDIR\\Docs\\nsArray\n    File \"..\\..\\Docs\\nsArray\\*.*\"\n\n    SetOutPath $INSTDIR\\Examples\\nsArray\n    File \"..\\nsArray\\*.nsi\"\n\n  SectionEnd\n\n  Section \"nsArray plugin Sources Code\" SecnsArraySources\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | nsArray Soucres Code...\"\n    SetDetailsPrint listonly\n\n    SectionIn 3\n\n    SetOutPath $INSTDIR\\Contrib\\nsArray\n    File \"..\\..\\Contrib\\nsArray\\*.*\"\n\n  SectionEnd\n\nSectionGroupEnd\n\nSectionGroupEnd\n\n\n;--------------------------------\n;Uninstall Section(s)\n\n!macro removeUMUIfiles\n\n  ;uninstall SkinnedControls Plugin\n  Delete \"$INSTDIR\\Plugins\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\modern_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\default_sb.exe\"\n  RMDir /r \"$INSTDIR\\Contrib\\SkinnedControls\"\n  Delete \"$INSTDIR\\Docs\\SkinnedControls\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\SkinnedControls\"\n  Delete \"$INSTDIR\\Examples\\SkinnedControls\\*.nsi\"\n  RMDir \"$INSTDIR\\Examples\\SkinnedControls\"\n\n  ;uninstall InstallOptionsEx Plugin\n  Delete \"$INSTDIR\\Plugins\\InstallOptionsEx*.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\InstallOptionsEx.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\InstallOptionsEx.dll\"\n  RMDir /r \"$INSTDIR\\Contrib\\InstallOptionsEx\"\n  Delete \"$INSTDIR\\Docs\\InstallOptionsEx\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\InstallOptionsEx\"\n  Delete \"$INSTDIR\\Examples\\InstallOptionsEx\\*.*\"\n  RMDir \"$INSTDIR\\Examples\\InstallOptionsEx\"\n\n  ;uninstall nsArray Plugin\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\nsArray.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\nsArray.dll\"\n  Delete \"$INSTDIR\\Include\\nsArray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\nsArray\\*.*\"\n  RMDir \"$INSTDIR\\Contrib\\nsArray\"\n  Delete \"$INSTDIR\\Docs\\nsArray\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\nsArray\"\n  Delete \"$INSTDIR\\Examples\\nsArray\\*.nsi\"\n  RMDir \"$INSTDIR\\Examples\\nsArray\"\n\n  ;uninstall NSISArray Plugin\n  IfFileExists $INSTDIR\\Plugins\\NSISArray.dll \"\" noNSISArray\n    Delete \"$INSTDIR\\Plugins\\NSISArray*.dll\"\n    Delete \"$INSTDIR\\Include\\NSISArray.nsh\"\n    Delete \"$INSTDIR\\Contrib\\NSISArray\\*.*\"\n    RMDir \"$INSTDIR\\Contrib\\NSISArray\"\n    Delete \"$INSTDIR\\Docs\\NSISArray\\*.*\"\n    RMDir \"$INSTDIR\\Docs\\NSISArray\"\n    Delete \"$INSTDIR\\Examples\\NSISArray\\*.nsi\"\n    RMDir \"$INSTDIR\\Examples\\NSISArray\"\n  noNSISArray:\n\n  Delete \"$INSTDIR\\Include\\UMUI.nsh\"\n  Delete \"$INSTDIR\\Include\\MUIEx.nsh\"\n  RMDir \"$INSTDIR\\Include\"\n\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AdditionalTasks.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternativeStartMenu.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternativeStartMenuApplication.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\Confirm.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\Information.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\ioSpecial.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\Maintenance.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\MaintenanceSetupType.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\MaintenanceUpdateSetupType.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\SerialNumber.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\"\n\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftRed\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftRed.nsh\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\"\n\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBlue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBrown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftPurple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftRed\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBlue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBrown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftPurple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftRed.nsh\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\"\n\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Language files\"\n\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\UMUI.nsh\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Contrib\"\n\n  RMDir /r \"$INSTDIR\\Docs\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Docs\"\n\n  RMDir /r \"$INSTDIR\\Examples\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Examples\"\n\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\modern_bigdesc.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\modern_headerbgimage.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\modern_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_bigdesc.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_nodesc.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_noleftimage.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_small.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_small_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_smalldesc.exe\"\n  RMDir \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Contrib\\UIs\"\n\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Complete.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\CompleteEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Continue.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\ContinueEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Custom.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\CustomEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\HeaderBG.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Minimal.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\MinimalEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Modify.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\ModifyEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Remove.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\RemoveEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Repair.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\RepairEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Standard.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\StandardEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Icon2.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\install.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\installEx.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\UnIcon2.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\uninstall.ico\"\n  RMDir \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Contrib\\Graphics\"\n\n  Delete \"$INSTDIR\\NSISUMUI.exe\"\n  Delete \"$INSTDIR\\UninstallUMUI.exe\"\n\n!macroend\n\n\nSection Uninstall\n\n  SetDetailsPrint textonly\n  DetailPrint \"Uninstalling NSIS and Ultra-Modern UI...\"\n  SetDetailsPrint listonly\n\n  IfFileExists $INSTDIR\\makensis.exe nsis_installed\n    MessageBox MB_YESNO \"It does not appear that NSIS is installed in the directory '$INSTDIR'.$\\r$\\nContinue anyway (not recommended)?\" IDYES nsis_installed\n    Abort \"Uninstall aborted by user\"\n  nsis_installed:\n\n  !insertmacro removeUMUIfiles\n\n  Delete \"$SMPROGRAMS\\NSIS.lnk\"\n  Delete \"$DESKTOP\\NSIS.lnk\"\n\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\n\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_SetupType\" ;\"${UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_InstType\" ;\"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_Components\" ;\"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERSION_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_UNINSTALLPATH_REGISTRY_VALUENAME}\"\n  DeleteRegKey /ifempty ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\n\n  SetDetailsPrint textonly\n  DetailPrint \"Uninstalling NSIS Development Shell Extensions...\"\n  SetDetailsPrint listonly\n\n  SetDetailsPrint textonly\n  DetailPrint \"Deleting Registry Keys...\"\n  SetDetailsPrint listonly\n\n  ReadRegStr $R0 HKCR \".nsi\" \"\"\n  StrCmp $R0 \"NSIS.Script\" 0 +2\n    DeleteRegKey HKCR \".nsi\"\n\n  ReadRegStr $R0 HKCR \".nsh\" \"\"\n  StrCmp $R0 \"NSIS.Header\" 0 +2\n    DeleteRegKey HKCR \".nsh\"\n\n  DeleteRegKey HKCR \"NSIS.Script\"\n  DeleteRegKey HKCR \"NSIS.Header\"\n\n  System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'\n\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\"\n  DeleteRegKey HKLM \"Software\\NSIS\"\n\n  SetDetailsPrint textonly\n  DetailPrint \"Deleting Files...\"\n  SetDetailsPrint listonly\n\n  Delete $INSTDIR\\makensis.exe\n  Delete $INSTDIR\\makensisw.exe\n  Delete $INSTDIR\\NSIS.exe\n  Delete $INSTDIR\\NSIS.exe.manifest\n  Delete $INSTDIR\\license.txt\n  Delete $INSTDIR\\COPYING\n  Delete $INSTDIR\\uninst-nsis.exe\n  Delete $INSTDIR\\nsisconf.nsi\n  Delete $INSTDIR\\nsisconf.nsh\n  Delete $INSTDIR\\NSIS.chm\n  RMDir /r $INSTDIR\\Bin\n  RMDir /r $INSTDIR\\Contrib\n  RMDir /r $INSTDIR\\Docs\n  RMDir /r $INSTDIR\\Examples\n  RMDir /r $INSTDIR\\Include\n  RMDir /r $INSTDIR\\Menu\n  RMDir /r $INSTDIR\\Plugins\n  RMDir /r $INSTDIR\\Stubs\n  RMDir /r $INSTDIR\n\n  SetDetailsPrint both\n\nSectionEnd\n\n\n;--------------------------------\n;Installer Sections Declaration dans Description\n\n!insertmacro UMUI_DECLARECOMPONENTS_BEGIN\n  !insertmacro UMUI_COMPONENT SecNSIS\n  !insertmacro UMUI_COMPONENT SecCore\n  !insertmacro UMUI_COMPONENT SecExample\n  !insertmacro UMUI_COMPONENT SecInterfaces\n  !insertmacro UMUI_COMPONENT SecInterfacesModernUI\n  !insertmacro UMUI_COMPONENT SecInterfacesDefaultUI\n  !insertmacro UMUI_COMPONENT SecInterfacesTinyUI\n  !insertmacro UMUI_COMPONENT SecTools\n  !insertmacro UMUI_COMPONENT SecToolsZ2E\n  !insertmacro UMUI_COMPONENT SecGraphics\n  !insertmacro UMUI_COMPONENT SecLangFiles\n  !insertmacro UMUI_COMPONENT SecPluginsPlugins\n  !insertmacro UMUI_COMPONENT SecPluginsBanner\n  !insertmacro UMUI_COMPONENT SecPluginsLangDLL\n  !insertmacro UMUI_COMPONENT SecPluginsnsExec\n  !insertmacro UMUI_COMPONENT SecPluginsSplash\n  !insertmacro UMUI_COMPONENT SecPluginsSplashT\n  !insertmacro UMUI_COMPONENT SecPluginsSystem\n  !insertmacro UMUI_COMPONENT SecPluginsMath\n  !insertmacro UMUI_COMPONENT SecPluginsDialer\n  !insertmacro UMUI_COMPONENT SecPluginsIO\n  !insertmacro UMUI_COMPONENT SecPluginsDialogs\n  !insertmacro UMUI_COMPONENT SecPluginsStartMenu\n  !insertmacro UMUI_COMPONENT SecPluginsBgImage\n  !insertmacro UMUI_COMPONENT SecPluginsUserInfo\n  !insertmacro UMUI_COMPONENT SecPluginsNSISDL\n  !insertmacro UMUI_COMPONENT SecPluginsVPatch\n\n  !insertmacro UMUI_COMPONENT SecUMUI\n  !insertmacro UMUI_COMPONENT SecSkins\n  !insertmacro UMUI_COMPONENT SecBGSkins\n  !insertmacro UMUI_COMPONENT SecSkinnedControls\n  !insertmacro UMUI_COMPONENT SecSkinnedControlsSources\n  !insertmacro UMUI_COMPONENT SecInstallOptionsEx\n  !insertmacro UMUI_COMPONENT SecInstallOptionsExSources\n  !insertmacro UMUI_COMPONENT SecnsArray\n  !insertmacro UMUI_COMPONENT SecnsArraySources\n!insertmacro UMUI_DECLARECOMPONENTS_END\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecNSIS} \"The NSIS package version ${VER_MAJOR}.${VER_MINOR}\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} \"The core files required to use NSIS (compiler etc.)\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} \"Example installation scripts that show you how to use NSIS\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfaces} \"User interface designs that can be used to change the installer look and feel\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesModernUI} \"A modern user interface like the wizards of recent Windows versions\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesDefaultUI} \"The default NSIS user interface which you can customize to make your own UI\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesTinyUI} \"A tiny version of the default user interface\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} \"Tools that help you with NSIS development\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} \"A utility that converts a ZIP file to a NSIS installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} \"Icons, checkbox images and other graphics\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} \"Language files used to support multiple languages in an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} \"Useful plugins that extend NSIS's functionality\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} \"Plugin that lets you show a banner before installation starts\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLL} \"Plugin that lets you add a language select dialog to your installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExec} \"Plugin that executes console programs and prints its output in the NSIS log window or hides it\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplash} \"Splash screen add-on that lets you add a splash screen to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashT} \"Splash screen add-on with transparency support that lets you add a splash screen to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystem} \"Plugin that lets you call Win32 API or external DLLs\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMath} \"Plugin that lets you evaluate complicated mathematical expressions\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialer} \"Plugin that provides internet connection functions\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIO} \"Plugin that lets you add custom pages to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialogs} \"Plugin that lets you add custom pages to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenu} \"Plugin that lets the user select the start menu folder\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImage} \"Plugin that lets you show a persistent background image plugin and play sounds\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfo} \"Plugin that that gives you the user name and the user account type\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDL} \"Plugin that lets you create a web based installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatch} \"Plugin that lets you create patches to upgrade older files\"\n\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecUMUI} \"The Utra-Modern User Interface for NSIS.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSkins} \"A lot of skins for the Utra-Modern User Interface.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecBGSkins} \"A lot of background skins for the Utra-Modern User Interface.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecGroupPlugins} \"Install very useful NSIS plugins used by Ultra-Modern UI to extend the possibilities of NSIS.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSkinnedControls} \"This NSIS plugin, writing by SuperPat, allow you to skin all buttons and scrollbars of your installer.$\\n$\\rIt's used by default with the UltraModern style.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSkinnedControlsSources} \"The Sources code of the SkinnedControls plugin.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInstallOptionsEx} \"This NSIS plugin, writing by deguix and SuperPat is an expanded version of the original InstallOptions plugin containing a lot of new features.$\\nThis plugin is supported natively by Ultra-Modern UI.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInstallOptionsExSources} \"The Sources code of the InstallOptionsEx plugin.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecnsArray} \"This NSIS plugin, writing by Afrow UK, add the support of the array in NSIS. It comes with plenty of functions for managing your arrays.$\\nThis plugin is used with the AlternativeStartMenu and MultiLanguages pages of Ultra-Modern UI.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecnsArraySources} \"The Sources code of the nsArray plugin.\"\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n\n;--------------------------------\n; Pages functions\n\nFunction addtasks_function\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK DESKTOP 1 \"$(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LINE\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n\n  UserInfo::GetAccountType\n  Pop $R0\n  StrCmp $R0 \"Guest\" 0 notLimited\n    !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    Goto endShellVarContext\n  notLimited:\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $R0\n    StrCmp $R0 \"current\" 0 allShellVarContext\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO ALL 0 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n      Goto endShellVarContext\n    allShellVarContext:\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO ALL 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 0 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n  endShellVarContext:\n  ClearErrors\n\nFunctionEnd\n\n!macro confirm_addline section\n\n  SectionGetFlags ${Sec${section}} $1\n  IntOp $1 $1 & ${SF_SELECTED}\n  IntCmp $1 ${SF_SELECTED} 0 n${section} n${section}\n    SectionGetText ${Sec${section}} $1\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"    - $1\"\n  n${section}:\n\n!macroend\n\nFunction confirm_function\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  ;For the setuptype page\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SETUPTYPE_TITLE):\"\n  !insertmacro UMUI_GET_CHOOSEN_SETUP_TYPE_TEXT\n  Pop $R0\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $R0\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n\n  !insertmacro confirm_addline NSIS\n  !insertmacro confirm_addline Core\n  !insertmacro confirm_addline Example\n  !insertmacro confirm_addline Interfaces\n  !insertmacro confirm_addline InterfacesModernUI\n  !insertmacro confirm_addline InterfacesDefaultUI\n  !insertmacro confirm_addline InterfacesTinyUI\n  !insertmacro confirm_addline Tools\n  !insertmacro confirm_addline ToolsZ2E\n  !insertmacro confirm_addline Graphics\n  !insertmacro confirm_addline LangFiles\n  !insertmacro confirm_addline PluginsBanner\n  !insertmacro confirm_addline PluginsLangDLL\n  !insertmacro confirm_addline PluginsnsExec\n  !insertmacro confirm_addline PluginsSplash\n  !insertmacro confirm_addline PluginsSplashT\n  !insertmacro confirm_addline PluginsSystem\n  !insertmacro confirm_addline PluginsMath\n  !insertmacro confirm_addline PluginsDialer\n  !insertmacro confirm_addline PluginsIO\n  !insertmacro confirm_addline PluginsDialogs\n  !insertmacro confirm_addline PluginsStartMenu\n  !insertmacro confirm_addline PluginsBgImage\n  !insertmacro confirm_addline PluginsUserInfo\n  !insertmacro confirm_addline PluginsNSISDL\n  !insertmacro confirm_addline PluginsVPatch\n\n  !insertmacro confirm_addline UMUI\n  !insertmacro confirm_addline Skins\n  !insertmacro confirm_addline BGSkins\n  !insertmacro confirm_addline SkinnedControls\n  !insertmacro confirm_addline SkinnedControlsSources\n  !insertmacro confirm_addline InstallOptionsEx\n  !insertmacro confirm_addline InstallOptionsExSources\n  !insertmacro confirm_addline nsArray\n  !insertmacro confirm_addline nsArraySources\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_ADDITIONALTASKS_TITLE):\"\n  ;Only if one at least of additional icon check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;ShellVarContext\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n  ; only if for all user radio is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if for current user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED CURRENT\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n\nFunctionEnd\n\nFunction preuninstall_function\n\n  IfFileExists $INSTDIR\\makensis.exe nsis_installed\n    MessageBox MB_YESNO \"It does not appear that NSIS is installed in the directory '$INSTDIR'.$\\r$\\nContinue anyway (not recommended)?\" IDYES nsis_installed\n    Abort \"Install aborted by user\"\n  nsis_installed:\n\n  SetDetailsPrint textonly\n  DetailPrint \"Uninstalling NSIS and Ultra-Modern UI...\"\n  SetDetailsPrint listonly\n\n  !insertmacro removeUMUIfiles\n\n  Delete \"$SMPROGRAMS\\NSIS.lnk\"\n  Delete \"$DESKTOP\\NSIS.lnk\"\n\n  ClearErrors\n  ReadRegStr $R0 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_StartMenuFolder\"\n  IfErrors checkNext 0\n    StrCpy $R1 $R0 \"\" -8 ; copy last height chars\n    StrCmpS $R1 \"\\Contrib\" 0 removeShortcuts\n      StrCpy $R0 $R0 -8  ; remove \\Contrib\n      Goto removeShortcuts\n  checkNext:\n    ReadRegStr $R0 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"StartMenuFolder\"\n    IfErrors noStartMenu removeShortcuts\n    removeShortcuts:\n      SetShellVarContext all   \n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\zip2exe (Create SFX).lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\AdvSplash Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Banner Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\BgImage Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptions Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\MakeNSISw Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Math Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Modern UI 2 Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Modern UI Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsDialogs Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsExec Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\NSISdl Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Splash Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\StartMenu Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\System Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\VPatch Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\NSISArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\UltraModernUI Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\SkinnedControls Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptionsEx Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptions Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Uninstall UltraModernUI.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\\Contrib\"\n      Delete \"$SMPROGRAMS\\$R0\\Uninstall NSIS.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Menu.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Examples Directory.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Documentation.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\MakeNSISW (Compiler GUI).lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Site.url\"\n      Delete \"$SMPROGRAMS\\$R0\\Uninstall UltraModernUI.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\"\n\n      SetShellVarContext current\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\zip2exe (Create SFX).lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\AdvSplash Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Banner Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\BgImage Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptions Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\MakeNSISw Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Math Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Modern UI 2 Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Modern UI Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsDialogs Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsExec Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\NSISdl Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Splash Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\StartMenu Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\System Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\VPatch Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\NSISArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\UltraModernUI Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\SkinnedControls Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptionsEx Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptions Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Uninstall UltraModernUI.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\\Contrib\"\n      Delete \"$SMPROGRAMS\\$R0\\Uninstall NSIS.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Menu.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Examples Directory.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Documentation.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\MakeNSISW (Compiler GUI).lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS Site.url\"\n      Delete \"$SMPROGRAMS\\$R0\\Uninstall UltraModernUI.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\"\n  noStartMenu:\n\n\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\n\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_SetupType\" ;\"${UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_InstType\" ;\"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_Components\" ;\"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERSION_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_UNINSTALLPATH_REGISTRY_VALUENAME}\"\n  ; No more used registry keys\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_StartMenuFolder\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"StartMenuFolder\"\n\n\n  ReadRegStr $R0 HKCR \".nsi\" \"\"\n  StrCmp $R0 \"NSIS.Script\" 0 +2\n    DeleteRegKey HKCR \".nsi\"\n\n  ReadRegStr $R0 HKCR \".nsh\" \"\"\n  StrCmp $R0 \"NSIS.Header\" 0 +2\n    DeleteRegKey HKCR \".nsh\"\n\n  DeleteRegKey HKCR \"NSIS.Script\"\n  DeleteRegKey HKCR \"NSIS.Header\"\n\n  System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'\n\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\"\n\n  Delete $INSTDIR\\makensis.exe\n  Delete $INSTDIR\\makensisw.exe\n  Delete $INSTDIR\\NSIS.exe\n  Delete $INSTDIR\\NSIS.exe.manifest\n  Delete $INSTDIR\\license.txt\n  Delete $INSTDIR\\COPYING\n  Delete $INSTDIR\\uninst-nsis.exe\n  Delete $INSTDIR\\NSIS.chm\n\n  RMDir /r $INSTDIR\\Stubs\n\n  Delete $INSTDIR\\Include\\WinMessages.nsh\n  Delete $INSTDIR\\Include\\Sections.nsh\n  Delete $INSTDIR\\Include\\Library.nsh\n  Delete $INSTDIR\\Include\\UpgradeDLL.nsh\n  Delete $INSTDIR\\Include\\LogicLib.nsh\n  Delete $INSTDIR\\Include\\StrFunc.nsh\n  Delete $INSTDIR\\Include\\Colors.nsh\n  Delete $INSTDIR\\Include\\FileFunc.nsh\n  Delete $INSTDIR\\Include\\TextFunc.nsh\n  Delete $INSTDIR\\Include\\WordFunc.nsh\n  Delete $INSTDIR\\Include\\WinVer.nsh\n  Delete $INSTDIR\\Include\\x64.nsh\n  Delete $INSTDIR\\Include\\Memento.nsh\n  Delete $INSTDIR\\Include\\LangFile.nsh\n  Delete $INSTDIR\\Include\\InstallOptions.nsh\n\n  RMDir /r $INSTDIR\\Docs\\StrFunc\n  RMDir /r $INSTDIR\\Docs\\makensisw\n  RMDir /r $INSTDIR\\Menu\n\n  RMDir /r $INSTDIR\\Bin\n\n  Delete $INSTDIR\\Examples\\makensis.nsi\n  Delete $INSTDIR\\Examples\\example1.nsi\n  Delete $INSTDIR\\Examples\\example2.nsi\n  Delete $INSTDIR\\Examples\\viewhtml.nsi\n  Delete $INSTDIR\\Examples\\waplugin.nsi\n  Delete $INSTDIR\\Examples\\bigtest.nsi\n  Delete $INSTDIR\\Examples\\primes.nsi\n  Delete $INSTDIR\\Examples\\rtest.nsi\n  Delete $INSTDIR\\Examples\\gfx.nsi\n  Delete $INSTDIR\\Examples\\one-section.nsi\n  Delete $INSTDIR\\Examples\\languages.nsi\n  Delete $INSTDIR\\Examples\\Library.nsi\n  Delete $INSTDIR\\Examples\\VersionInfo.nsi\n  Delete $INSTDIR\\Examples\\UserVars.nsi\n  Delete $INSTDIR\\Examples\\LogicLib.nsi\n  Delete $INSTDIR\\Examples\\silent.nsi\n  Delete $INSTDIR\\Examples\\StrFunc.nsi\n  Delete $INSTDIR\\Examples\\FileFunc.nsi\n  Delete $INSTDIR\\Examples\\FileFunc.ini\n  Delete $INSTDIR\\Examples\\FileFuncTest.nsi\n  Delete $INSTDIR\\Examples\\TextFunc.nsi\n  Delete $INSTDIR\\Examples\\TextFunc.ini\n  Delete $INSTDIR\\Examples\\TextFuncTest.nsi\n  Delete $INSTDIR\\Examples\\WordFunc.nsi\n  Delete $INSTDIR\\Examples\\WordFunc.ini\n  Delete $INSTDIR\\Examples\\WordFuncTest.nsi\n\n  RMDir /r \"$INSTDIR\\Examples\\Modern UI\"\n  RMDir /r \"$INSTDIR\\Contrib\\Modern UI\"\n  RMDir /r \"$INSTDIR\\Docs\\Modern UI\"\n  Delete $INSTDIR\\Include\\MUI.nsh\n\n  RMDir /r \"$INSTDIR\\Examples\\Modern UI 2\"\n  RMDir /r \"$INSTDIR\\Contrib\\Modern UI 2\"\n  RMDir /r \"$INSTDIR\\Docs\\Modern UI 2\"\n  Delete $INSTDIR\\Include\\MUI2.nsh\n\n  Delete $INSTDIR\\Contrib\\UIs\\default.exe\n  Delete $INSTDIR\\Contrib\\UIs\\modern.exe\n  Delete $INSTDIR\\Contrib\\UIs\\modern_headerbmp.exe\n  Delete $INSTDIR\\Contrib\\UIs\\modern_headerbmpr.exe\n  Delete $INSTDIR\\Contrib\\UIs\\modern_nodesc.exe\n  Delete $INSTDIR\\Contrib\\UIs\\modern_smalldesc.exe\n  Delete $INSTDIR\\Contrib\\UIs\\sdbarker_tiny.exe\n\n  RMDir /r $INSTDIR\\Contrib\\Graphics\n\n  RMDir /r \"$INSTDIR\\Contrib\\Language files\\\"\n\n  RMDir /r $INSTDIR\\Contrib\\zip2exe\n\n  Delete $INSTDIR\\Plugins\\Banner.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\Banner.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\Banner.dll\n  RMDir /r \"$INSTDIR\\Docs\\Banner\\\"\n  RMDir /r \"$INSTDIR\\Examples\\Banner\\\"\n\n  Delete $INSTDIR\\Plugins\\TypeLib.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\TypeLib.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\TypeLib.dll\n  \n  Delete $INSTDIR\\Plugins\\LangDLL.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\LangDLL.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\LangDLL.dll\n\n  Delete $INSTDIR\\Plugins\\nsExec.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\nsExec.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\nsExec.dll\n  RMDir /r $INSTDIR\\Docs\\nsExec\n  RMDir /r $INSTDIR\\Examples\\nsExec\n\n  Delete $INSTDIR\\Plugins\\splash.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\splash.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\splash.dll\n  RMDir /r $INSTDIR\\Docs\\Splash\n  RMDir /r $INSTDIR\\Examples\\Splash\n\n  Delete $INSTDIR\\Plugins\\advsplash.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\advsplash.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\advsplash.dll\n  RMDir /r $INSTDIR\\Docs\\AdvSplash\n  RMDir /r $INSTDIR\\Examples\\AdvSplash\n\n  Delete $INSTDIR\\Plugins\\BgImage.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\BgImage.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\BgImage.dll\n  RMDir /r $INSTDIR\\Docs\\BgImage\n  RMDir /r $INSTDIR\\Examples\\BgImage\n\n  Delete $INSTDIR\\Plugins\\InstallOptions.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\InstallOptions.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\InstallOptions.dll\n  RMDir /r $INSTDIR\\Docs\\InstallOptions\n  RMDir /r $INSTDIR\\Examples\\InstallOptions\n\n  Delete $INSTDIR\\Plugins\\Math.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\Math.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\Math.dll\n  RMDir /r $INSTDIR\\Docs\\Math\n  RMDir /r $INSTDIR\\Examples\\Math\n\n  Delete $INSTDIR\\Plugins\\nsisdl.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\nsisdl.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\nsisdl.dll\n  RMDir /r $INSTDIR\\Docs\\NSISdl\n\n  Delete $INSTDIR\\Plugins\\System.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\System.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\System.dll\n  RMDir /r $INSTDIR\\Docs\\System\n  RMDir /r $INSTDIR\\Examples\\System\n\n  Delete $INSTDIR\\Plugins\\nsDialogs.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\nsDialogs.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\nsDialogs.dll\n  RMDir /r $INSTDIR\\Examples\\nsDialogs\n  Delete $INSTDIR\\Include\\nsDialogs.nsh\n  RMDir /r $INSTDIR\\Docs\\nsDialogs\n\n  Delete $INSTDIR\\Plugins\\StartMenu.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\StartMenu.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\StartMenu.dll\n  RMDir /r $INSTDIR\\Docs\\StartMenu\n  RMDir /r $INSTDIR\\Examples\\StartMenu\n\n  Delete $INSTDIR\\Plugins\\UserInfo.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\UserInfo.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\UserInfo.dll\n  RMDir /r $INSTDIR\\Examples\n\n  Delete $INSTDIR\\Plugins\\Dialer.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\Dialer.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\Dialer.dll\n  RMDir /r $INSTDIR\\Docs\\Dialer\n\n  Delete $INSTDIR\\Plugins\\VPatch.dll\n  Delete $INSTDIR\\Plugins\\x86-ansi\\VPatch.dll\n  Delete $INSTDIR\\Plugins\\x86-unicode\\VPatch.dll\n  RMDir /r $INSTDIR\\Examples\\VPatch\n  RMDir /r $INSTDIR\\Docs\\VPatch\n  Delete $INSTDIR\\Include\\VPatchLib.nsh\n\n  RMDir \"$INSTDIR\"\n\n  SetDetailsPrint both\n\nFunctionEnd\n\n\n;--------------------------------\n;Init Functions\n\nFunction .onInit\n\n  !insertmacro UMUI_MULTILANG_GET\n\n  ; Change default InstallDir to C:\\ProgramData on Windows Vista and more\n  ClearErrors\n  IfFileExists $INSTDIR endCheckVersion 0\n    ReadRegStr $0 HKLM \"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\" CurrentVersion\n    IfErrors endCheckVersion 0 ; If not WinNT\n      IntCmp $0 6 0 endCheckVersion 0 ; If version >= 6\n        SetShellVarContext all\n        StrCpy $INSTDIR \"$APPDATA\\NSIS\"\n  endCheckVersion:\n\nFunctionEnd\n\nFunction un.onInit\n\n  !insertmacro UMUI_MULTILANG_GET\n\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/NoLeftImage.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;No Left Image Option Example Script\n;Written by Joost Verburg\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"NoLeftImage.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"SoftBlue\"\n  \n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n  !define UMUI_USE_ALTERNATE_PAGE\n  !define UMUI_USE_UNALTERNATE_PAGE\n  \n  !define UMUI_NOLEFTIMAGE  \n  \n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  \n  !define MUI_FINISHPAGE_RUN \"blabla.exe\"\n  !define MUI_FINISHPAGE_RUN_TEXT \"run blabla\"\n  !define MUI_FINISHPAGE_SHOWREADME \"blabla.htm\"\n  !define MUI_FINISHPAGE_SHOWREADME_TEXT \"blabla readme\"\n  !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n  !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n\n  !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n  !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n\n\n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n  !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n  !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n\n  !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n  !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n;  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n;  WriteRegStr HKCU \"Software\\UltraModernUI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\UltraModernUI Test\"\n\nSectionEnd  "
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/PageBG.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Background Image Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"PageBG.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n\n\n;--------------------------------\n;Interface Settings\n\n; A unique background image\n!define UMUI_UNIQUEBGIMAGE\n!define UMUI_UNUNIQUEBGIMAGE\n\n!define UMUI_PAGEBGIMAGE\n!define UMUI_UNPAGEBGIMAGE\n!define UMUI_PAGEBGIMAGE_BMP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\PageBG.bmp\"\n\n  \n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_USE_ALTERNATE_PAGE\n  !define UMUI_USE_UNALTERNATE_PAGE\n  \n  !define MUI_LICENSEPAGE_RADIOBUTTONS\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  \n  \n  Var STARTMENU_FOLDER\n  !insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU Application $STARTMENU_FOLDER\n\n!insertmacro UMUI_PAGE_CONFIRM\n\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  \n;  !define MUI_FINISHPAGE_RUN \"blabla.exe\"\n;  !define MUI_FINISHPAGE_RUN_TEXT \"run blabla\"\n  !define MUI_FINISHPAGE_SHOWREADME \"blabla.htm\"\n  !define MUI_FINISHPAGE_SHOWREADME_TEXT \"blabla readme\"\n  !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n  !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n\n  !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n  !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n\n\n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n  !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n  !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n\n  !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n  !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\UltraModernUI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\UltraModernUI Test\"\n\nSectionEnd  "
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/SerialNumber.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Serial Number Page Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"SerialNumber.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;UltraModern Include\n\n  !include \"UMUI.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"red\"\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n  \n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n  \n;--------------------------------\n;Registry Settings\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKLM\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI_Test\"\n\n;--------------------------------\n;Reserve Files\n\n  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\n  ReserveFile \"${NSISDIR}\\Contrib\\UltraModernUI\\Ini\\serialnumber.ini\"\n  \n;--------------------------------\n;Pages\n\n  !define MUI_PAGE_CUSTOMFUNCTION_LEAVE leave_serial_function\n!insertmacro UMUI_PAGE_SERIALNUMBER serial_function\n!insertmacro MUI_PAGE_DIRECTORY\n!insertmacro MUI_PAGE_INSTFILES\n!insertmacro UMUI_PAGE_ABORT\n\n\nFunction serial_function\n\n;Get the windows name and organisation\n!insertmacro UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_OWNER R0\n!insertmacro UMUI_SERIALNUMBERPAGE_GET_WINDOWS_REGISTRED_ORGANIZATION R1\n\nStrCpy $R2 \"11111-22222-33333-44444-55555\"\n\n; ID:        A unique identifiant for this serial number\n; STR:       555 for 3 inputs of 5 characters each, 0 for unlimited chars\n; FLAGS:     \"\", NODASHS, TOUPPER, TOLOWER, NUMBERS, CANBEEMPTY\n; DEFAULT:   The dfault value if not already saved in the registry XXXXX-XXXXX-XXXXX OR XXXXXXXXXXXXXXX\n; LABEL\n  !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME \"RegName\"\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL REGNAME       0     \"TOUPPER\"             $R0 \"$(UMUI_TEXT_SERIALNUMBER_NAME)\"\n  !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME \"Organisation\"\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL ORGANISATION   0     \"CANBEEMPTY|TOLOWER\"   $R1 \"$(UMUI_TEXT_SERIALNUMBER_ORGANIZATION)\"\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_HLINE\n  !define UMUI_SERIALNUMBERPAGE_SERIAL_REGISTRY_VALUENAME \"SerialNumber\"\n!insertmacro UMUI_SERIALNUMBERPAGE_ADD_LABELEDSERIAL SERIAL         55555 \"NUMBERS|NODASHS\"     $R2 \"$(UMUI_TEXT_SERIALNUMBER_SERIALNUMBER)\"\n\nFunctionEnd\n\n\nFunction leave_serial_function\n\n  !insertmacro UMUI_SERIALNUMBER_GET REGNAME R0\n  \n  StrLen $0 $R0\n  IntCmp $0 5 0 0 +3 \n    MessageBox MB_OK \"The size of name is not enough (must be > 5)\"\n    Abort\n\n; Apply a verification algorithm of the serial number and use Abort if error\n\nFunctionEnd\n  \n  \n;--------------------------------\n;Languages\n\n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  sleep 1000\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/SetupType.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Setup Type Page Example Script\n;Written by SuperPat\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"UMUI.nsh\"\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"SetupType.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Pages\n\n;  !define UMUI_SKIN \"purple\"\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n  !define UMUI_PAGEBGIMAGE\n  \n  !define UMUI_PARAMS_REGISTRY_ROOT HKCU\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI Test\"\n\n  !define UMUI_INSTALLDIR_REGISTRY_VALUENAME \"InstallDir\"    ;Replace the InstallDirRegKey instruction and automatically save the $INSTDIR variable\n\n  !define UMUI_COMPONENTSINSTTYPE_REGISTRY_VALUENAME \"insttype\"\n  !define UMUI_COMPONENTS_REGISTRY_VALUENAME \"components\"\n\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  \n    !define UMUI_SETUPTYPEPAGE_MINIMAL \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_STANDARD \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_COMPLETE \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_DEFAULTCHOICE ${UMUI_COMPLETE}\n    !define UMUI_SETUPTYPE_REGISTRY_VALUENAME \"SetupType\"\n  !insertmacro UMUI_PAGE_SETUPTYPE\n\n    !define UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME \"insttype\"\n    !define UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME \"components\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  \n  !insertmacro MUI_PAGE_DIRECTORY\n  \n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n \n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n\n;--------------------------------\n;Installer Types\n\nInstType \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\n\n\n;--------------------------------\n;Installer Sections\n\nSection \"Section 1\" SecS1\n  SectionIn RO\n  SectionIn 1 2 3\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n\nSection \"Section 2\" SecS2\n  SectionIn 2 3\n\nSectionEnd\n\nSection \"Section 3\" SecS3\n  SectionIn 3\n\nSectionEnd\n\n\n!insertmacro UMUI_DECLARECOMPONENTS_BEGIN\n  !insertmacro UMUI_COMPONENT SecS1\n  !insertmacro UMUI_COMPONENT SecS2\n  !insertmacro UMUI_COMPONENT SecS3\n!insertmacro UMUI_DECLARECOMPONENTS_END\n\n \n;--------------------------------\n;Confirm page function\n\n!include \"Sections.nsh\"\n  \n!macro confirm_addline section\n  SectionGetFlags ${Sec${section}} $1\n  IntOp $1 $1 & ${SF_SELECTED}\n  IntCmp $1 ${SF_SELECTED} 0 n${section} n${section}\n  SectionGetText ${Sec${section}} $1\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"   - $1\"\nn${section}:\n!macroend\n\nFunction confirm_function\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n  ;For the setuptype page\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SETUPTYPE_TITLE):\"\n  !insertmacro UMUI_GET_CHOOSEN_SETUP_TYPE_TEXT\n  Pop $R0\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $R0\"\n  \n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n\n  !insertmacro confirm_addline S1\n  !insertmacro confirm_addline S2\n  !insertmacro confirm_addline S3\nFunctionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecS1} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/StartMenu.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Alternative Start Menu Folder Selection Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Generate unicode installer\n  ;Unicode True\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"StartMenu.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n\n;--------------------------------\n;Variables\n\n  Var MUI_TEMP\n  Var STARTMENU_FOLDER\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKCU\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI Test\"\n  \n  !define UMUI_INSTALLDIR_REGISTRY_VALUENAME \"InstallDir\"    ;Replace the InstallDirRegKey instruction and automatically save the $INSTDIR variable\n\n  !define UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME \"UMUI ShellVarContext\" \n  !define UMUI_DEFAULT_SHELLVARCONTEXT all\n\n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_DIRECTORY\n  \n    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n    !define MUI_STARTMENUPAGE_DEFAULTFOLDER \"UltraModernUI Test\"\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT\n    !define UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW\n  !insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU Application $STARTMENU_FOLDER\n;  !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER\n   \n  !insertmacro MUI_PAGE_COMPONENTS\n  \n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n  \n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    \n    ;Create shortcuts\n    CreateDirectory \"$SMPROGRAMS\\$STARTMENU_FOLDER\"\n    CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\Uninstall.lnk\" \"$INSTDIR\\Uninstall.exe\"\n  \n  !insertmacro MUI_STARTMENU_WRITE_END\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n  \n  !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP\n \n  Delete \"$SMPROGRAMS\\$MUI_TEMP\\Uninstall.lnk\"\n  \n  ;Delete empty start menu parent diretories\n  StrCpy $MUI_TEMP \"$SMPROGRAMS\\$MUI_TEMP\"\n \n  startMenuDeleteLoop:\n  ClearErrors\n    RMDir $MUI_TEMP\n    GetFullPathName $MUI_TEMP \"$MUI_TEMP\\..\"\n    \n    IfErrors startMenuDeleteLoopDone\n  \n    StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop\n  startMenuDeleteLoopDone:\n\n  DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/UltraModernSmall.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;UltraModernUI Small Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"UltraModern Small.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n\n;--------------------------------\n;Interface Settings\n  \n  !define UMUI_SKIN \"Blue\"\n\n  !define UMUI_ULTRAMODERN_SMALL\n\n  ; If you want to change the left image:\n  ;!define MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Left.bmp\"\n  ;!define MUI_UNWELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\UltraModernUI\\Skins\\blue\\Left.bmp\"\n  \n  !define UMUI_WELCOMEFINISHABORTPAGE_USE_IMAGE\n  \n  !define UMUI_PAGEBGIMAGE\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_USE_ALTERNATE_PAGE\n  !define UMUI_USE_UNALTERNATE_PAGE\n  \n  \n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  \n  !define MUI_FINISHPAGE_RUN \"blabla.exe\"\n  !define MUI_FINISHPAGE_RUN_TEXT \"run blabla\"\n  !define MUI_FINISHPAGE_SHOWREADME \"blabla.htm\"\n  !define MUI_FINISHPAGE_SHOWREADME_TEXT \"blabla readme\"\n  !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n  !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n\n  !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n  !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n\n\n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n  !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n  !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n\n  !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n  !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\UltraModernUI Test\" \"\" $INSTDIR\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\UltraModernUI Test\"\n\nSectionEnd  "
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/UltraModernUI.nsi",
    "content": "; o----------------------------------------o\n; | NSIS Ultra-Modern User Interface 2.0b5 |\n; (----------------------------------------)\n; | Installer script.                      |\n; | Written by SyperPat                    |\n; o----------------------------------------o\n\n;--------------------------------\n;General\n\n  !define /date NOW \"%Y-%m-%d\"\n  !define NAME \"UltraModernUI\"\n\n  ; For language file selection\n  !define VER_MAJOR 3\n  !define VER_MINOR 04\n  !define VER_REV_STR \"\"\n\n  !if \"${NSIS_VERSION}\" != \"v${VER_MAJOR}.${VER_MINOR}${VER_REV_STR}\"\n    !error \"VER_MAJOR, VER_MINOR and VER_REV_STR defines does not match the current NSIS version: ${NSIS_VERSION}\"\n  !endif\n\n  !define UMUI_VERSION \"2.0b5\"\n  !define UMUI_VERBUILD \"2.0_${NOW}\"\n\n  !define /date VERIPV \"200.%Y.%m.%d\"\n  VIProductVersion \"${VERIPV}\"\n  VIAddVersionKey ProductName \"Ultra-Modern User Interface for NSIS (Nullsoft Scriptable Install System) version 3 x86 edition.\"\n  VIAddVersionKey ProductVersion \"${UMUI_VERSION}\"\n  VIAddVersionKey Comments \"A new User Interface for NSIS with a style like the most recent installers. This package also include some plugins used by UMUI to extend the possibilities of NSIS.\"\n  VIAddVersionKey LegalTrademarks \"Ultra-Modern UI is released under the zlib/libpng license: http://nsis.sf.net/License\"\n  VIAddVersionKey LegalCopyright \"Copyright  2005-2019 SuperPat\"\n  VIAddVersionKey FileDescription \"Ultra-Modern User Interface for NSIS (Nullsoft Scriptable Install System) version 3 x86 edition.\"\n  VIAddVersionKey FileVersion \"${UMUI_VERBUILD}\"\n\n\n;--------------------------------\n;Configuration\n\n  ; The name of the installer\n  Name \"NSIS Ultra-Modern User Interface ${UMUI_VERSION}\"\n\n  ; The file to write\n  OutFile \"UltraModernUI_${UMUI_VERSION}.exe\"\n\n  ;Generate unicode installer\n  Unicode True\n\n  SetCompressor /FINAL /SOLID lzma\n\n  ;Windows vista compatibility\n  RequestExecutionLevel admin\n\n  BrandingText \"$(^NameDA)\"\n\n  ;Default installation folder\n  InstallDir \"$PROGRAMFILES\\NSIS\"\n\n\n;--------------------------------\n;Include Ultra-Modern UI between others\n\n  !include \"UMUI.nsh\"\n\n  !include \"Sections.nsh\"\n\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"blue\"\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n  !define UMUI_USE_ALTERNATE_PAGE ; For Welcome finish abort pages\n  !define UMUI_USE_UNALTERNATE_PAGE\n\n  !define MUI_COMPONENTSPAGE_SMALLDESC\n\n  !define UMUI_DEFAULT_SHELLVARCONTEXT all\n\n  !define UMUI_ENABLE_DESCRIPTION_TEXT\n\n;--------------------------------\n;Registry Settings\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKLM\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\NSIS\"\n\n  !define UMUI_LANGUAGE_REGISTRY_VALUENAME \"UMUI_InstallerLanguage\"\n  !define UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME \"UMUI_ShellVarContext\"\n\n  !define UMUI_UNINSTALLPATH_REGISTRY_VALUENAME \"UMUI_UninstallPath\"\n  !define UMUI_UNINSTALL_FULLPATH \"$INSTDIR\\UninstallUMUI.exe\"\n  !define UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME \"UMUI_InstallPath\"\n\n  !define UMUI_VERSION_REGISTRY_VALUENAME \"UMUI_Version\"\n  !define UMUI_VERBUILD_REGISTRY_VALUENAME \"UMUI_VerBuild\"\n\n  !define UMUI_PREUNINSTALL_FUNCTION preuninstall_function\n\n  InstallDirRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"\"\n\n;--------------------------------\n;Reserve Files\n\n  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\n\n\n;--------------------------------\n;Pages\n\n  !insertmacro UMUI_PAGE_MULTILANGUAGE\n\n    !define UMUI_MAINTENANCEPAGE_MODIFY\n    !define UMUI_MAINTENANCEPAGE_REPAIR\n    !define UMUI_MAINTENANCEPAGE_REMOVE\n    !define UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_PAGE_MAINTENANCE\n\n    !define UMUI_UPDATEPAGE_REMOVE\n    !define UMUI_UPDATEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_PAGE_UPDATE\n\n    !define UMUI_WELCOMEPAGE_ALTERNATIVETEXT\n  !insertmacro MUI_PAGE_WELCOME\n\n    !define MUI_LICENSEPAGE_CHECKBOX\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n\n    !define UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT\n  !insertmacro UMUI_PAGE_INFORMATION \"${NSISDIR}\\Docs\\UltraModernUI\\ReadMe.rtf\"\n\n    !define UMUI_SETUPTYPEPAGE_MINIMAL \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_STANDARD \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_COMPLETE \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\n    !define UMUI_SETUPTYPEPAGE_DEFAULTCHOICE ${UMUI_COMPLETE}\n    !define UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME \"UMUI_SetupType\"\n  !insertmacro UMUI_PAGE_SETUPTYPE\n\n    !define UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME \"UMUI_InstType\"\n    !define UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME \"UMUI_Components\"\n  !insertmacro MUI_PAGE_COMPONENTS\n\n    !define UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME \"UMUI_Tasks\"\n  !insertmacro UMUI_PAGE_ADDITIONALTASKS addtasks_function\n\n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n\n  !insertmacro MUI_PAGE_INSTFILES\n\n    !define MUI_FINISHPAGE_SHOWREADME \"${NSISDIR}\\Docs\\UltraModernUI\\Readme.html\"\n    !define MUI_FINISHPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n\n    !define UMUI_ABORTPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n\n\n  !insertmacro UMUI_UNPAGE_MULTILANGUAGE\n\n    !define UMUI_MAINTENANCEPAGE_MODIFY\n    !define UMUI_MAINTENANCEPAGE_REPAIR\n    !define UMUI_MAINTENANCEPAGE_REMOVE\n    !define UMUI_MAINTENANCEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_UNPAGE_MAINTENANCE\n\n  !insertmacro MUI_UNPAGE_WELCOME\n\n  !insertmacro MUI_UNPAGE_CONFIRM\n\n  !insertmacro MUI_UNPAGE_INSTFILES\n\n    !define MUI_FINISHPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n\n    !define UMUI_ABORTPAGE_LINK \"Ultra-Modern UI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT\n\n\n;--------------------------------\n;Languages\n\n; first language is the default language if the system language is not in this list\n  !insertmacro MUI_LANGUAGE \"English\"\n\n; Other UMUI translated languages\n  !insertmacro MUI_LANGUAGE \"Bulgarian\"\n  !insertmacro MUI_LANGUAGE \"Czech\"\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"German\"\n  !insertmacro MUI_LANGUAGE \"Greek\"\n  !insertmacro MUI_LANGUAGE \"Hungarian\"\n  !insertmacro MUI_LANGUAGE \"Italian\"\n  !insertmacro MUI_LANGUAGE \"Japanese\"\n  !insertmacro MUI_LANGUAGE \"Lithuanian\"\n  !insertmacro MUI_LANGUAGE \"Polish\"\n  !insertmacro MUI_LANGUAGE \"Russian\"\n  !insertmacro MUI_LANGUAGE \"Slovenian\"\n  !insertmacro MUI_LANGUAGE \"Spanish\"\n  !insertmacro MUI_LANGUAGE \"Turkish\"\n; Other UMUI partially translated language\n  !insertmacro MUI_LANGUAGE \"PortugueseBR\"\n\n; Other untranslated languages but usable even so.\n/*\n  !insertmacro MUI_LANGUAGE \"SpanishInternational\"\n  !insertmacro MUI_LANGUAGE \"SimpChinese\"\n  !insertmacro MUI_LANGUAGE \"TradChinese\"\n  !insertmacro MUI_LANGUAGE \"Korean\"\n  !insertmacro MUI_LANGUAGE \"Dutch\"\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro MUI_LANGUAGE \"Norwegian\"\n  !insertmacro MUI_LANGUAGE \"NorwegianNynorsk\"\n  !insertmacro MUI_LANGUAGE \"Finnish\"\n  !insertmacro MUI_LANGUAGE \"Portuguese\"\n  !insertmacro MUI_LANGUAGE \"Ukrainian\"\n  !insertmacro MUI_LANGUAGE \"Slovak\"\n  !insertmacro MUI_LANGUAGE \"Croatian\"\n  !insertmacro MUI_LANGUAGE \"Thai\"\n  !insertmacro MUI_LANGUAGE \"Romanian\"\n  !insertmacro MUI_LANGUAGE \"Latvian\"\n  !insertmacro MUI_LANGUAGE \"Macedonian\"\n  !insertmacro MUI_LANGUAGE \"Estonian\"\n  !insertmacro MUI_LANGUAGE \"Serbian\"\n  !insertmacro MUI_LANGUAGE \"SerbianLatin\"\n  !insertmacro MUI_LANGUAGE \"Arabic\"\n  !insertmacro MUI_LANGUAGE \"Farsi\"\n  !insertmacro MUI_LANGUAGE \"Hebrew\"\n  !insertmacro MUI_LANGUAGE \"Indonesian\"\n  !insertmacro MUI_LANGUAGE \"Mongolian\"\n  !insertmacro MUI_LANGUAGE \"Luxembourgish\"\n  !insertmacro MUI_LANGUAGE \"Albanian\"\n  !insertmacro MUI_LANGUAGE \"Breton\"\n  !insertmacro MUI_LANGUAGE \"Belarusian\"\n  !insertmacro MUI_LANGUAGE \"Icelandic\"\n  !insertmacro MUI_LANGUAGE \"Malay\"\n  !insertmacro MUI_LANGUAGE \"Bosnian\"\n  !insertmacro MUI_LANGUAGE \"Kurdish\"\n  !insertmacro MUI_LANGUAGE \"Irish\"\n  !insertmacro MUI_LANGUAGE \"Uzbek\"\n  !insertmacro MUI_LANGUAGE \"Galician\"\n  !insertmacro MUI_LANGUAGE \"Afrikaans\"\n  !insertmacro MUI_LANGUAGE \"Catalan\"\n  !insertmacro MUI_LANGUAGE \"Esperanto\"\n  !insertmacro MUI_LANGUAGE \"Asturian\"\n  !insertmacro MUI_LANGUAGE \"Basque\"\n  !insertmacro MUI_LANGUAGE \"Pashto\"\n  !insertmacro MUI_LANGUAGE \"ScotsGaelic\"\n  !insertmacro MUI_LANGUAGE \"Vietnamese\"\n  !insertmacro MUI_LANGUAGE \"Welsh\"\n  !insertmacro MUI_LANGUAGE \"Corsican\"\n  !insertmacro MUI_LANGUAGE \"Tatar\"\n\n; Other unicode only untranslated languages but usable even so.\n  !insertmacro MUI_LANGUAGE \"Armenian\"\n  !insertmacro MUI_LANGUAGE \"Georgian\"\n  !insertmacro MUI_LANGUAGE \"Hindi\"\n*/\n\n;--------------------------------\n;Installer Types\n\nInstType \"$(UMUI_TEXT_SETUPTYPE_MINIMAL_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_STANDARD_TITLE)\"\nInstType \"$(UMUI_TEXT_SETUPTYPE_COMPLETE_TITLE)\"\n\n\n;--------------------------------\n;Installer Sections\n\nSection \"$(^NameDA)\" SecUMUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Ultra-Modern UI...\"\n  SetDetailsPrint listonly\n\n  SectionIn RO\n\n  SectionIn 1 2 3\n\n  SetOutPath \"$INSTDIR\"\n  !if ! /FileExists \"..\\..\\NSISUMUI.exe\"\n    !define NO_NSISMENU_HTML 1\n    !makensis '-v2 \"NSISUMUIMenu.nsi\" \"-XOutFile ..\\..\\NSISUMUI.exe\"' = 0\n  !endif\n  File ..\\..\\NSISUMUI.exe\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\UMUI.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Ini\\*.ini\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Language files\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Language files\\*.nsh\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\blue.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\blue2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\blue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Docs\\UltraModernUI\\\"\n  File \"..\\..\\Docs\\UltraModernUI\\*.*\"\n  SetOutPath \"$INSTDIR\\Docs\\UltraModernUI\\images\\\"\n  File \"..\\..\\Docs\\UltraModernUI\\images\\*.png\"\n  File \"..\\..\\Docs\\UltraModernUI\\images\\*.gif\"\n\n  SetOutPath \"$INSTDIR\\Examples\\UltraModernUI\\\"\n  File \"*.nsi\"\n  File \"*.ini\"\n  File \"*.txt\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\\"\n  File \"..\\..\\Contrib\\UIs\\UltraModernUI\\*.exe\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\\"\n  File \"..\\..\\Contrib\\Graphics\\UltraModernUI\\*.*\"\n\n  SetOutPath \"$INSTDIR\\Include\\\"\n  File \"..\\..\\Include\\UMUI.nsh\"\n  File \"..\\..\\Include\\MUIEx.nsh\"\n\n\n  ;CreateShortCuts\n  ; only if all user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL\n    SetShellVarContext all\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if current user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED CURRENT\n    SetShellVarContext current\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n\n  SetOutPath \"$INSTDIR\\\"\n  CreateShortCut \"$SMPROGRAMS\\NSIS.lnk\" \"$INSTDIR\\NSISUMUI.exe\"\n\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP\n    CreateShortCut \"$DESKTOP\\NSIS.lnk\" \"$INSTDIR\\NSISUMUI.exe\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n\n\n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\UninstallUMUI.exe\"\n\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayName\" \"$(^Name)\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayIcon\" \"$INSTDIR\\UninstallUMUI.exe,0\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"UninstallString\" \"$INSTDIR\\UninstallUMUI.exe\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"Publisher\" \"SuperPat\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"HelpLink\" \"http://ultramodernui.sourceforge.net/\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"URLInfoAbout\" \"http://ultramodernui.sourceforge.net/\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"URLUpdateInfo\" \"http://ultramodernui.sourceforge.net/\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"ModifyPath\" '\"$INSTDIR\\UninstallUMUI.exe\" /modify'\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\" \"DisplayVersion\" \"${UMUI_VERSION}\"\n\nSectionEnd\n\nSection \"Skins for Ultra-Modern UI\" SecSkins\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Ultra-Modern UI | Skins...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\brown.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\brown2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\brown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\darkgreen.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\darkgreen2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\darkgreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\gray.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\gray2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\gray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\green.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\green2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\green\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\purple.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\purple2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\purple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\red.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\red2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\red\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBlue.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBlue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBrown.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftBrown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGray.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGreen.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftGreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftPurple.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftPurple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftRed.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftRed\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\Skins\\SoftRed\\*.bmp\"\n\nSectionEnd\n\nSection \"BackGround Skins for Ultra-Modern UI\" SecBGSkins\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Ultra-Modern UI | BackGround Skins...\"\n  SetDetailsPrint listonly\n\n  SectionIn 2 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\blue.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\blue2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\blue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\brown.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\brown2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\brown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\darkgreen.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\darkgreen2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\gray.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\gray2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\gray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\green.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\green2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\green\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\purple.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\purple2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\purple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\red.nsh\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\red2.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\red\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGray.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGray\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGray\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple\\*.bmp\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftRed.nsh\"\n  SetOutPath \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftRed\\\"\n  File \"..\\..\\Contrib\\UltraModernUI\\BGSkins\\SoftRed\\*.bmp\"\n\nSectionEnd\n\n\nSectionGroup /e \"Plugins\" SecGroupPlugins\n\n  Section \"SkinnedControls plugin version 1.4\" SecSkinnedControls\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | SkinnedControls...\"\n    SetDetailsPrint listonly\n\n    SectionIn RO\n\n    SectionIn 1 2 3\n\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi\n    File \"..\\..\\Plugins\\x86-ansi\\SkinnedControls.dll\"\n\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\SkinnedControls.dll\"\n\n    SetOutPath $INSTDIR\\Examples\\SkinnedControls\n    File \"..\\SkinnedControls\\*.nsi\"\n\n    SetOutPath $INSTDIR\\Contrib\\SkinnedControls\\skins\n    File \"..\\..\\Contrib\\SkinnedControls\\skins\\*.bmp\"\n\n    SetOutPath $INSTDIR\\Contrib\\UIs\n    File \"..\\..\\Contrib\\UIs\\modern_sb.exe\"\n    File \"..\\..\\Contrib\\UIs\\default_sb.exe\"\n\n    SetOutPath $INSTDIR\\Docs\\SkinnedControls\n    File \"..\\..\\Docs\\SkinnedControls\\*.*\"\n    SetOutPath \"$INSTDIR\\Docs\\SkinnedControls\\images\\\"\n    File \"..\\..\\Docs\\SkinnedControls\\images\\*.png\"\n    File \"..\\..\\Docs\\SkinnedControls\\images\\*.gif\"\n\n  SectionEnd\n\n  Section \"SkinnedControls plugin Sources Code\" SecSkinnedControlsSources\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | SkinnedControls Soucres Code...\"\n    SetDetailsPrint listonly\n\n    SectionIn 3\n\n    SetOutPath $INSTDIR\\Contrib\\SkinnedControls\n    File \"..\\..\\Contrib\\SkinnedControls\\*.h\"\n    File \"..\\..\\Contrib\\SkinnedControls\\*.c\"\n    File \"..\\..\\Contrib\\SkinnedControls\\SkinnedControls.sln\"\n    File \"..\\..\\Contrib\\SkinnedControls\\SkinnedControls.vcproj\"\n    SetOutPath $INSTDIR\\Contrib\\SkinnedControls\\coolsb\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\*.h\"\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\*.c\"\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\detours.lib\"\n    File \"..\\..\\Contrib\\SkinnedControls\\coolsb\\coolsb.vcproj\"\n\n  SectionEnd\n\n\n  Section \"InstallOptionsEx plugin version 2.4.5 beta 3\" SecInstallOptionsEx\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | InstallOptionsEx...\"\n    SetDetailsPrint listonly\n\n    SectionIn 2 3\n\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi\n    File \"..\\..\\Plugins\\x86-ansi\\InstallOptionsEx.dll\"\n\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\InstallOptionsEx.dll\"\n\n    SetOutPath $INSTDIR\\Examples\\InstallOptionsEx\n    File \"..\\InstallOptionsEx\\*.nsi\"\n    File \"..\\InstallOptionsEx\\*.ini\"\n\n    SetOutPath $INSTDIR\\Docs\\InstallOptionsEx\n    File \"..\\..\\Docs\\InstallOptionsEx\\*.*\"\n\n  SectionEnd\n\n  Section \"InstallOptionsEx plugin Sources Code\" SecInstallOptionsExSources\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | InstallOptionsEx Soucres Code...\"\n    SetDetailsPrint listonly\n\n    SectionIn 3\n\n    SetOutPath $INSTDIR\\Contrib\\InstallOptionsEx\n    File \"..\\..\\Contrib\\InstallOptionsEx\\*.cpp\"\n    File \"..\\..\\Contrib\\InstallOptionsEx\\*.c\"\n    File \"..\\..\\Contrib\\InstallOptionsEx\\*.h\"\n    File \"..\\..\\Contrib\\InstallOptionsEx\\ioptdll.rc\"\n    File \"..\\..\\Contrib\\InstallOptionsEx\\io.sln\"\n    File \"..\\..\\Contrib\\InstallOptionsEx\\io.vcproj\"\n    SetOutPath $INSTDIR\\Contrib\\InstallOptionsEx\\Controls\n    File \"..\\..\\Contrib\\InstallOptionsEx\\Controls\\*.h\"\n\n  SectionEnd\n\n\n  Section \"nsArray plugin version 1.1.1.7\" SecnsArray\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | nsArray...\"\n    SetDetailsPrint listonly\n\n    SectionIn 2 3\n\n    SetOutPath $INSTDIR\\Plugins\\x86-ansi\n    File \"..\\..\\Plugins\\x86-ansi\\nsArray.dll\"\n\n    SetOutPath $INSTDIR\\Plugins\\x86-unicode\n    File \"..\\..\\Plugins\\x86-unicode\\nsArray.dll\"\n\n    SetOutPath $INSTDIR\\Include\n    File \"..\\..\\Include\\nsArray.nsh\"\n\n    SetOutPath $INSTDIR\\Docs\\nsArray\n    File \"..\\..\\Docs\\nsArray\\*.*\"\n\n    SetOutPath $INSTDIR\\Examples\\nsArray\n    File \"..\\nsArray\\*.nsi\"\n\n  SectionEnd\n\n  Section \"nsArray plugin Sources Code\" SecnsArraySources\n\n    SetDetailsPrint textonly\n    DetailPrint \"Installing Ultra-Modern UI | Plugins | nsArray Soucres Code...\"\n    SetDetailsPrint listonly\n\n    SectionIn 3\n\n    SetOutPath $INSTDIR\\Contrib\\nsArray\n    File \"..\\..\\Contrib\\nsArray\\*.*\"\n\n  SectionEnd\n\nSectionGroupEnd\n\n\nSection \"Updated Languages Files from NSIS ${NSIS_VERSION}\" SecNSISLanguagesFiles\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Updated Languages Files from NSIS ${NSIS_VERSION}...\"\n  SetDetailsPrint listonly\n\n  SectionIn 3\n\n  SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n  File \"..\\..\\Contrib\\Language files\\*.nsh\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n  File \"..\\..\\Contrib\\Language files\\*.nlf\"\n\nSectionEnd\n\n;--------------------------------\n;Uninstall Section(s)\n\n!macro removeUMUIfiles\n\n  ;uninstall SkinnedControls Plugin\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\SkinnedControls.dll\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\modern_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\default_sb.exe\"\n  RMDir /r \"$INSTDIR\\Contrib\\SkinnedControls\"\n  Delete \"$INSTDIR\\Docs\\SkinnedControls\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\SkinnedControls\"\n  Delete \"$INSTDIR\\Examples\\SkinnedControls\\*.nsi\"\n  RMDir \"$INSTDIR\\Examples\\SkinnedControls\"\n\n  ;uninstall InstallOptionsEx Plugin\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\InstallOptionsEx.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\InstallOptionsEx.dll\"\n  RMDir /r \"$INSTDIR\\Contrib\\InstallOptionsEx\"\n  Delete \"$INSTDIR\\Docs\\InstallOptionsEx\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\InstallOptionsEx\"\n  Delete \"$INSTDIR\\Examples\\InstallOptionsEx\\*.*\"\n  RMDir \"$INSTDIR\\Examples\\InstallOptionsEx\"\n\n  ;uninstall nsArray Plugin\n  Delete \"$INSTDIR\\Plugins\\x86-ansi\\nsArray.dll\"\n  Delete \"$INSTDIR\\Plugins\\x86-unicode\\nsArray.dll\"\n  Delete \"$INSTDIR\\Include\\nsArray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\nsArray\\*.*\"\n  RMDir \"$INSTDIR\\Contrib\\nsArray\"\n  Delete \"$INSTDIR\\Docs\\nsArray\\*.*\"\n  RMDir \"$INSTDIR\\Docs\\nsArray\"\n  Delete \"$INSTDIR\\Examples\\nsArray\\*.nsi\"\n  RMDir \"$INSTDIR\\Examples\\nsArray\"\n\n  ;uninstall NSISArray Plugin\n  IfFileExists $INSTDIR\\Plugins\\NSISArray.dll \"\" noNSISArray\n    Delete \"$INSTDIR\\Plugins\\NSISArray*.dll\"\n    Delete \"$INSTDIR\\Include\\NSISArray.nsh\"\n    Delete \"$INSTDIR\\Contrib\\NSISArray\\*.*\"\n    RMDir \"$INSTDIR\\Contrib\\NSISArray\"\n    Delete \"$INSTDIR\\Docs\\NSISArray\\*.*\"\n    RMDir \"$INSTDIR\\Docs\\NSISArray\"\n    Delete \"$INSTDIR\\Examples\\NSISArray\\*.nsi\"\n    RMDir \"$INSTDIR\\Examples\\NSISArray\"\n  noNSISArray:\n\n  Delete \"$INSTDIR\\Include\\UMUI.nsh\"\n  Delete \"$INSTDIR\\Include\\MUIEx.nsh\"\n  RMDir \"$INSTDIR\\Include\"\n\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AdditionalTasks.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbort.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternateWelcomeFinishAbortImage.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternativeStartMenu.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\AlternativeStartMenuApplication.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\Confirm.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\Information.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\ioSpecial.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\Maintenance.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\MaintenanceSetupType.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\MaintenanceUpdateSetupType.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\SerialNumber.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbort.ini\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\\WelcomeFinishAbortImage.ini\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\Ini\"\n\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftRed\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\blue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\brown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\darkgreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\gray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\green.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\purple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\red.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBlue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftBrown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftGreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftPurple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\\SoftRed.nsh\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\BGSkins\"\n\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBlue\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBrown\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGray\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGreen\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftPurple\"\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftRed\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\blue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\brown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\darkgreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\gray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\green.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\purple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red2.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\red.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBlue.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftBrown.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGray.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftGreen.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftPurple.nsh\"\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\\SoftRed.nsh\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\Skins\"\n\n  RMDir /r \"$INSTDIR\\Contrib\\UltraModernUI\\Language files\"\n\n  Delete \"$INSTDIR\\Contrib\\UltraModernUI\\UMUI.nsh\"\n  RMDir \"$INSTDIR\\Contrib\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Contrib\"\n\n  RMDir /r \"$INSTDIR\\Docs\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Docs\"\n\n  RMDir /r \"$INSTDIR\\Examples\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Examples\"\n\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\modern_bigdesc.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\modern_headerbgimage.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\modern_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_bigdesc.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_nodesc.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_noleftimage.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_small.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_small_sb.exe\"\n  Delete \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\UltraModern_smalldesc.exe\"\n  RMDir \"$INSTDIR\\Contrib\\UIs\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Contrib\\UIs\"\n\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Complete.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\CompleteEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Continue.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\ContinueEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Custom.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\CustomEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\HeaderBG.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Minimal.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\MinimalEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Modify.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\ModifyEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Remove.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\RemoveEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Repair.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\RepairEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Standard.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\StandardEx.bmp\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Icon2.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\install.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\installEx.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\UnIcon2.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\UnIcon.ico\"\n  Delete \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\uninstall.ico\"\n  RMDir \"$INSTDIR\\Contrib\\Graphics\\UltraModernUI\\\"\n  RMDir \"$INSTDIR\\Contrib\\Graphics\"\n\n  Delete \"$INSTDIR\\NSISUMUI.exe\"\n  Delete \"$INSTDIR\\UninstallUMUI.exe\"\n\n!macroend\n\nSection Uninstall\n\n  SetDetailsPrint textonly\n  DetailPrint \"Uninstalling Ultra-Modern UI...\"\n  SetDetailsPrint listonly\n\n  IfFileExists $INSTDIR\\NSISUMUI.exe umui_installed\n    MessageBox MB_YESNO \"It does not appear that Ultra-Modern UI is installed in the directory '$INSTDIR'.$\\r$\\nContinue anyway (not recommended)?\" IDYES umui_installed\n    Abort \"Uninstall aborted by user\"\n  umui_installed:\n\n  !insertmacro removeUMUIfiles\n\n  RMDir \"$INSTDIR\"\n\n  Delete \"$SMPROGRAMS\\NSIS.lnk\"\n  \n  StrCpy $R0 \"nok\"\n  IfFileExists \"$DESKTOP\\NSIS.lnk\" \"\" dektopNotExists\n    Delete \"$DESKTOP\\NSIS.lnk\"\n    StrCpy $R0 \"ok\"\n  dektopNotExists:\n\n  ; Recreate NSIS sortcuts\n  IfFileExists \"$INSTDIR\\NSIS.exe\" \"\" nsisRemoved\n    SetOutPath \"$INSTDIR\\\"\n    CreateShortCut \"$SMPROGRAMS\\NSIS.lnk\" \"$INSTDIR\\NSIS.exe\"\n    StrCmp $R0 \"ok\" \"\" nsisRemoved\n      CreateShortCut \"$DESKTOP\\NSIS.lnk\" \"$INSTDIR\\NSIS.exe\"\n  nsisRemoved:\n\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\n\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_SetupType\" ;\"${UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_InstType\" ;\"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_Components\" ;\"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERSION_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_UNINSTALLPATH_REGISTRY_VALUENAME}\"\n\n  DeleteRegKey /ifempty ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\nSectionEnd\n\n\n;--------------------------------\n;Installer Sections Declaration dans Description\n\n!insertmacro UMUI_DECLARECOMPONENTS_BEGIN\n  !insertmacro UMUI_COMPONENT SecUMUI\n  !insertmacro UMUI_COMPONENT SecSkins\n  !insertmacro UMUI_COMPONENT SecBGSkins\n  !insertmacro UMUI_COMPONENT SecSkinnedControls\n  !insertmacro UMUI_COMPONENT SecSkinnedControlsSources\n  !insertmacro UMUI_COMPONENT SecInstallOptionsEx\n  !insertmacro UMUI_COMPONENT SecInstallOptionsExSources\n  !insertmacro UMUI_COMPONENT SecnsArray\n  !insertmacro UMUI_COMPONENT SecnsArraySources\n  !insertmacro UMUI_COMPONENT SecNSISLanguagesFiles\n!insertmacro UMUI_DECLARECOMPONENTS_END\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecUMUI} \"The Utra-Modern User Interface for NSIS.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSkins} \"A lot of skins for the Utra-Modern User Interface.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecBGSkins} \"A lot of background skins for the Utra-Modern User Interface.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecGroupPlugins} \"Install very useful NSIS plugins used by Ultra-Modern UI to extend the possibilities of NSIS.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSkinnedControls} \"This NSIS plugin, writing by SuperPat, allow you to skin all buttons and scrollbars of your installer.$\\n$\\rIt's used by default with the UltraModern style.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecSkinnedControlsSources} \"The Sources code of the SkinnedControls plugin.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInstallOptionsEx} \"This NSIS plugin, writing by deguix and SuperPat is an expanded version of the original InstallOptions plugin containing a lot of new features.$\\nThis plugin is supported natively by Ultra-Modern UI.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInstallOptionsExSources} \"The Sources code of the InstallOptionsEx plugin.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecnsArray} \"This NSIS plugin, writing by Afrow UK, add the support of the array in NSIS. It comes with plenty of functions for managing your arrays.$\\nThis plugin is used with the AlternativeStartMenu and MultiLanguages pages of Ultra-Modern UI.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecnsArraySources} \"The Sources code of the nsArray plugin.\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecNSISLanguagesFiles} \"Update the NSIS language files of your installation by those of the version ${NSIS_VERSION} of NSIS.$\\nThese language files contain a lot of translation fix and add the lastest translated languages.\"\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n\n;--------------------------------\n; Pages functions\n\nFunction addtasks_function\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK DESKTOP 1 \"$(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LINE\n\n  !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_LABEL \"$(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n\n  UserInfo::GetAccountType\n  Pop $R0\n  StrCmp $R0 \"Guest\" 0 notLimited\n    !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n    Goto endShellVarContext\n  notLimited:\n    !insertmacro UMUI_GETSHELLVARCONTEXT\n    Pop $R0\n    StrCmp $R0 \"current\" 0 allShellVarContext\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO ALL 0 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n      Goto endShellVarContext\n    allShellVarContext:\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO ALL 1 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n      !insertmacro UMUI_ADDITIONALTASKSPAGE_ADD_TASK_RADIO CURRENT 0 \"$(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n  endShellVarContext:\n  ClearErrors\n\nFunctionEnd\n\n!macro confirm_addline section\n\n  SectionGetFlags ${Sec${section}} $1\n  IntOp $1 $1 & ${SF_SELECTED}\n  IntCmp $1 ${SF_SELECTED} 0 n${section} n${section}\n    SectionGetText ${Sec${section}} $1\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"    - $1\"\n  n${section}:\n\n!macroend\n\nFunction confirm_function\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n\n  ;For the setuptype page\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SETUPTYPE_TITLE):\"\n  !insertmacro UMUI_GET_CHOOSEN_SETUP_TYPE_TEXT\n  Pop $R0\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $R0\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n\n  !insertmacro confirm_addline UMUI\n  !insertmacro confirm_addline Skins\n  !insertmacro confirm_addline BGSkins\n  !insertmacro confirm_addline SkinnedControls\n  !insertmacro confirm_addline SkinnedControlsSources\n  !insertmacro confirm_addline InstallOptionsEx\n  !insertmacro confirm_addline InstallOptionsExSources\n  !insertmacro confirm_addline nsArray\n  !insertmacro confirm_addline nsArraySources\n  !insertmacro confirm_addline NSISLanguagesFiles\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_ADDITIONALTASKS_TITLE):\"\n  ;Only if one at least of additional icon check is checked  \n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED DESKTOP\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_ADDITIONALTASKS_ADDITIONAL_ICONS)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_ADDITIONALTASKS_CREATE_DESKTOP_ICON)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ;ShellVarContext\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $(UMUI_TEXT_SHELL_VAR_CONTEXT)\"\n  ; only if for all user radio is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED ALL\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_FOR_ALL_USERS)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF\n  ; only if for current user is selected\n  !insertmacro UMUI_ADDITIONALTASKS_IF_CKECKED CURRENT\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"            $(UMUI_TEXT_SHELL_VAR_CONTEXT_ONLY_FOR_CURRENT_USER)\"\n  !insertmacro UMUI_ADDITIONALTASKS_ENDIF \n\nFunctionEnd\n\n\nFunction preuninstall_function\n\n  IfFileExists $INSTDIR\\makensis.exe nsis_installed\n    MessageBox MB_YESNO \"It does not appear that NSIS is installed in the directory '$INSTDIR'.$\\r$\\nContinue anyway (not recommended)?\" IDYES nsis_installed\n    Abort \"Install aborted by user\"\n  nsis_installed:\n\n  SetDetailsPrint textonly\n  DetailPrint \"Uninstalling Ultra-Modern UI...\"\n  SetDetailsPrint none\n\n  !insertmacro removeUMUIfiles\n\n  Delete \"$SMPROGRAMS\\NSIS.lnk\"\n  Delete \"$DESKTOP\\NSIS.lnk\"\n\n  ClearErrors\n  ReadRegStr $R0 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_StartMenuFolder\"\n  IfErrors checkNext 0\n    StrCpy $R1 $R0 \"\" -8 ; copy last height chars\n    StrCmpS $R1 \"\\Contrib\" 0 removeShortcuts\n      StrCpy $R0 $R0 -8  ; remove \\Contrib\n      Goto removeShortcuts\n  checkNext:\n    ReadRegStr $R0 ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"StartMenuFolder\"\n    IfErrors noStartMenu removeShortcuts\n    removeShortcuts:\n      SetShellVarContext all\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\UltraModernUI Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\NSISArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\SkinnedControls Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptionsEx Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptions Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Uninstall UltraModernUI.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\\Contrib\"\n      Delete \"$SMPROGRAMS\\$R0\\Uninstall UltraModernUI.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\"\n\n      SetShellVarContext current\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\UltraModernUI Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\NSISArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\SkinnedControls Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\nsArray Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptionsEx Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\InstallOptions Readme.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\Contrib\\Uninstall UltraModernUI.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\\Contrib\"\n      Delete \"$SMPROGRAMS\\$R0\\Uninstall UltraModernUI.lnk\"\n      Delete \"$SMPROGRAMS\\$R0\\NSIS.lnk\"\n      RMDir \"$SMPROGRAMS\\$R0\"\n  noStartMenu:\n\n\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\n\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_SHELLVARCONTEXT_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_LANGUAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_SetupType\" ;\"${UMUI_SETUPTYPEPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_InstType\" ;\"${UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_Components\" ;\"${UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_ADDITIONALTASKS_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERSION_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_VERBUILD_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME}\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"${UMUI_UNINSTALLPATH_REGISTRY_VALUENAME}\"\n  ; No more used registry keys\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"UMUI_StartMenuFolder\"\n  DeleteRegValue ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\" \"StartMenuFolder\"\n\n  RMDir \"$INSTDIR\"\n\n  SetDetailsPrint both\n\nFunctionEnd\n\n\n;--------------------------------\n;Init Functions\n\nFunction .onInit\n\n  !insertmacro UMUI_MULTILANG_GET\n\n  ; Check NSIS Version\n  ClearErrors\n  ReadRegDword $0 HKLM Software\\NSIS \"VersionMajor\"\n  IfErrors errorNSIS 0\n    ReadRegDword $1 HKLM Software\\NSIS \"VersionMinor\"\n    IfErrors errorNSIS 0\n      StrCmp $0 3 okNSIS 0\n\n        errorNSIS:\n          MessageBox MB_OK|MB_ICONSTOP \"NSIS 3 is not installed on your computer.$\\r$\\nPlease, install NSIS (http://nsis.sourceforge.net) and then re-execute this install.$\\n$\\rThis install will stop.\"\n          Quit\n\n  okNSIS:\n\n  IntCmp $1 0 okNSISMin 0 okNSISMin\n    MessageBox MB_OK|MB_ICONSTOP \"Your version of NSIS is not compatible with Ultra-Modern UI.$\\r$\\nPlease, update NSIS (http://nsis.sourceforge.net) and then re-execute this install.$\\n$\\rThis install will stop.\"\n    Quit\n  okNSISMin:\n\n  ; ReadOnly Unselect if NSIS != VER_MAJOR && NSIS >= VER_MINOR\n  IntCmp $0 ${VER_MAJOR} 0 unselectROlangFiles unselectROlangFiles\n  IntCmp $1 ${VER_MINOR} unselectROlangFiles end1 unselectROlangFiles\n  unselectROlangFiles:\n    !insertmacro UnSelectSection ${SecNSISLanguagesFiles}\n    SectionGetFlags ${SecNSISLanguagesFiles} $2\n    IntOp $2 $2 | ${SF_RO}\n    SectionSetFlags ${SecNSISLanguagesFiles} $2\n    !insertmacro ClearSectionInInstType ${SecNSISLanguagesFiles} 4 ;4 complete\n  end1:\n\nFunctionEnd\n\nFunction un.onInit\n\n  !insertmacro UMUI_MULTILANG_GET\n\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/Update.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Update Example Script\n;Written by SuperPat\n\n; How to test this example:\n; 1. compile, launch and install this example a first time\n; 2. Recompile this example after changing the version ine the UMUI_VERBUILD define below (you can also wait the tomorrow's day to recompile)\n;    the UMUI_VERBUILD define is \"2.0_%Y-%m-%d\" %Y-%m-%d will be replaced by 2016-02-09 if you compile the February, 9th 2016 \n; 3. Relaunch this example, the update page will appear\n\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"Update.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include Modern UI\n\n  !include \"UMUI.nsh\"\n  ;!include \"MUIEx.nsh\"\n\n  !include \"Sections.nsh\"\n  \n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"SoftBlue\"\n\n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKCU\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI Test\"\n  \n  !define UMUI_INSTALLDIR_REGISTRY_VALUENAME \"InstallDir\"    ;Replace the InstallDirRegKey instruction and automatically save the $INSTDIR variable\n    \n  !define UMUI_VERSION \"2.0 beta 1\"\n  !define /date UMUI_VERBUILD \"2.0_%Y-%m-%d\"\n\n  !define UMUI_VERSION_REGISTRY_VALUENAME \"Version\"\n  !define UMUI_VERBUILD_REGISTRY_VALUENAME \"VerBuild\"\n\n  !define UMUI_UNINSTALLPATH_REGISTRY_VALUENAME \"uninstallpath\"\n  !define UMUI_INSTALLERFULLPATH_REGISTRY_VALUENAME \"installpath\"\n  !define UMUI_UNINSTALL_FULLPATH \"$INSTDIR\\Uninstall.exe\"\n  !define UMUI_PREUNINSTALL_FUNCTION preuninstall_function\n\n;  !define UMUI_INSTALL_FULLPATH \"$EXEDIR\\Update.exe\"  ;if you want to save the install file in a folder of your hard disk, change this value.\n\n;--------------------------------\n;Pages\n\n    !define UMUI_UPDATEPAGE_REMOVE\n    !define UMUI_UPDATEPAGE_CONTINUE_SETUP\n  !insertmacro UMUI_PAGE_UPDATE\n  \n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  \n;    !define UMUI_COMPONENTSPAGE_INSTTYPE_REGISTRY_VALUENAME \"insttype\"\n    !define UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME \"components\"  \n  !insertmacro MUI_PAGE_COMPONENTS\n  \n  !insertmacro MUI_PAGE_DIRECTORY\n  \n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n  !insertmacro MUI_PAGE_INSTFILES\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\nSection \"Dummy Section 2\" SecDummy2\n\n  SetOutPath \"$INSTDIR\"\n  \n  \n\nSectionEnd\n\n\n;--------------------------------\n; Pages functions\n\nFunction preuninstall_function\n\n  ; execute this function only in Modify, repair and update function\n  !insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_MODIFY}|${UMUI_REPAIR}|${UMUI_UPDATE}\n\n    ;ADD YOUR DELETE INSTRUCTION HERE...\n  \n    Delete \"$INSTDIR\\Uninstall.exe\"\n  \n    DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\n  !insertmacro UMUI_ENDIF_INSTALLFLAG\n\nFunctionEnd\n\n!macro confirm_addline section\n\n  SectionGetFlags ${Sec${section}} $1\n  IntOp $1 $1 & ${SF_SELECTED}\n  IntCmp $1 ${SF_SELECTED} 0 n${section} n${section}\n    SectionGetText ${Sec${section}} $1\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"    - $1\"\n  n${section}:\n\n!macroend\n\nFunction confirm_function\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n\n\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_COMPNENTS)\"\n\n  !insertmacro confirm_addline Dummy\n  !insertmacro confirm_addline Dummy2\n\nFunctionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n  LangString DESC_SecDummy2 ${LANG_ENGLISH} \"An other test section.\"\n\n  ;Declare all the components (Needed by UMUI_COMPONENTSPAGE_REGISTRY_VALUENAME)\n  !insertmacro UMUI_DECLARECOMPONENTS_BEGIN\n    !insertmacro UMUI_COMPONENT SecDummy\n    !insertmacro UMUI_COMPONENT SecDummy2\n  !insertmacro UMUI_DECLARECOMPONENTS_END\n\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy2} $(DESC_SecDummy2)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR DELETE INSTRUCTION HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/WelcomeFinishAbort.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Welcome/Finish/Abort Page Example Script\n;Written by SuperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"WelcomeFinishAbort.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"\n;  !include \"MUIEx.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n;  !define UMUI_SKIN \"SoftGreen\"\n  !define UMUI_SKIN \"blue2\"\n  \n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n;  !define UMUI_USE_INSTALLOPTIONSEX\n  \n  !define UMUI_USE_ALTERNATE_PAGE\n  !define UMUI_USE_UNALTERNATE_PAGE\n\n;        !define MUI_FINISHPAGE_TITLE_3LINES\n;          !define MUI_FINISHPAGE_TEXT_LARGE\n\n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE\n  \n;--------------------------------\n;Pages\n\n  !insertmacro MUI_PAGE_WELCOME\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  !insertmacro MUI_PAGE_COMPONENTS\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n    \n    !define MUI_FINISHPAGE_RUN \"blabla.exe\"\n    !define MUI_FINISHPAGE_RUN_TEXT \"run blabla\"\n    !define MUI_FINISHPAGE_SHOWREADME \"blabla.htm\"\n    !define MUI_FINISHPAGE_SHOWREADME_TEXT \"blabla readme\"\n    !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_PAGE_FINISH\n\n    !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_PAGE_ABORT\n\n\n  !insertmacro MUI_UNPAGE_WELCOME\n  !insertmacro MUI_UNPAGE_CONFIRM\n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n    !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro MUI_UNPAGE_FINISH\n\n    !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net/\"\n  !insertmacro UMUI_UNPAGE_ABORT\n  \n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  \n  ;Store installation folder\n  WriteRegStr HKCU \"Software\\UltraModernUI Test\" \"\" $INSTDIR\n\n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n \n;--------------------------------\n;Uninstaller Section\n\nSection \"Uninstall\"\n\n  ;ADD YOUR OWN FILES HERE...\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n\n  RMDir \"$INSTDIR\"\n\n  DeleteRegKey /ifempty HKCU \"Software\\UltraModernUI Test\"\n\nSectionEnd  "
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/bigtest.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;Big example Script\n;Originally Written by Joost Verburg\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"BigTest.exe\"\n  SetCompressor /FINAL lzma\n\n  BrandingText \"UltraModernUI for NSIS\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Inclusion\n\n  !include \"UMUI.nsh\"\n\n;--------------------------------\n;Interface Settings\n\n  !define UMUI_SKIN \"blue\"\n  !define UMUI_BGSKIN \"blue\"\n\n  !define UMUI_USE_INSTALLOPTIONSEX\n  \n;  !define MUI_COMPONENTSPAGE_NODESC\n  !define MUI_COMPONENTSPAGE_SMALLDESC\n  !define UMUI_NOLEFTIMAGE\n\n  !define MUI_ABORTWARNING\n  !define MUI_UNABORTWARNING\n\n  !define UMUI_USE_ALTERNATE_PAGE\n  !define UMUI_USE_UNALTERNATE_PAGE\n\n  !define UMUI_PARAMS_REGISTRY_ROOT HKCU\n  !define UMUI_PARAMS_REGISTRY_KEY \"Software\\UltraModernUI Test\"\n  \n  !define UMUI_INSTALLDIR_REGISTRY_VALUENAME \"InstallDir\"    ;Replace the InstallDirRegKey instruction and automatically save the $INSTDIR variable\n\n  ;Remember the installer language\n  !define UMUI_LANGUAGE_REGISTRY_VALUENAME \"Installer Language\"\n\n;--------------------------------\n;Pages\n\n  Var STARTMENU_FOLDER\n\n  !insertmacro MUI_PAGE_WELCOME\n\n  Page custom CustomPageA\n    \n    !define MUI_LICENSEPAGE_CHECKBOX\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n\n    !define UMUI_INFORMATIONPAGE_USE_RICHTEXTFORMAT\n  !insertmacro UMUI_PAGE_INFORMATION \"${NSISDIR}\\Docs\\UltraModernUI\\ReadMe.rtf\"\n;  !insertmacro UMUI_PAGE_INFORMATION \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n    \n  !insertmacro UMUI_PAGE_SETUPTYPE\n    \n  !insertmacro MUI_PAGE_COMPONENTS\n  \n  !insertmacro MUI_PAGE_DIRECTORY\n  \n    !define MUI_STARTMENUPAGE_REGISTRY_ROOT \"HKCU\" \n    !define MUI_STARTMENUPAGE_REGISTRY_KEY \"Software\\UltraModernUI Test\" \n    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME \"Start Menu Folder\"\n  !insertmacro UMUI_PAGE_ALTERNATIVESTARTMENU \"Application\" $STARTMENU_FOLDER\n  \n    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function\n  !insertmacro UMUI_PAGE_CONFIRM\n  \n    !define UMUI_INSTFILEPAGE_ENABLE_CANCEL_BUTTON cancel_function\n  !insertmacro MUI_PAGE_INSTFILES\n\n    !define MUI_FINISHPAGE_RUN \"C:\\Notepad.exe\"\n    !define MUI_FINISHPAGE_SHOWREADME \"C:\\Notepad.exe\"\n    !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net\"\n  !insertmacro MUI_PAGE_FINISH\n\n    !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net\"\n  !insertmacro UMUI_PAGE_ABORT\n\n  \n  !insertmacro MUI_UNPAGE_WELCOME\n  \n  !insertmacro MUI_UNPAGE_COMPONENTS\n  \n  !insertmacro MUI_UNPAGE_CONFIRM\n  \n  !insertmacro MUI_UNPAGE_INSTFILES\n  \n    !define MUI_FINISHPAGE_LINK \"UltraModernUI Home Page\"\n    !define MUI_FINISHPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net\"\n  !insertmacro MUI_UNPAGE_FINISH\n  \n    !define UMUI_ABORTPAGE_LINK \"UltraModernUI Home Page\"\n    !define UMUI_ABORTPAGE_LINK_LOCATION \"http://ultramodernui.sourceforge.net\"\n  !insertmacro UMUI_UNPAGE_ABORT\n\n\nFunction cancel_function\n  MessageBox MB_OK \"Delete all files\"\nFunctionEnd\n\nFunction confirm_function\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_DESTINATION_LOCATION)\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $INSTDIR\"\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  \n  ;Only if StartMenu Folder is selected\n  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_INSTCONFIRM_TEXTBOX_START_MENU_FOLDER)\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $STARTMENU_FOLDER\"\n    !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"\"\n  !insertmacro MUI_STARTMENU_WRITE_END\n\n  ;For the setuptype page\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"$(UMUI_TEXT_SETUPTYPE_TITLE):\"\n  !insertmacro UMUI_GET_CHOOSEN_SETUP_TYPE_TEXT\n  Pop $R0\n  !insertmacro UMUI_CONFIRMPAGE_TEXTBOX_ADDLINE \"      $R0\"\nFunctionEnd\n\n\n\nFunction CustomPageA\n  !insertmacro MUI_INSTALLOPTIONS_EXTRACT \"ioA.ini\"\n  !insertmacro MUI_HEADER_TEXT \"def\" \"abc\"\n  !insertmacro MUI_INSTALLOPTIONS_DISPLAY \"ioA.ini\"\nFunctionEnd\n\n\n;--------------------------------\n;Languages\n\n  !insertmacro MUI_LANGUAGE \"French\"\n  !insertmacro MUI_LANGUAGE \"English\"\n  !insertmacro MUI_RESERVEFILE_LANGDLL\n\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n  sleep 10000\n  \n  ; Write the uninstall keys for Windows\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BigNSISTest\" \"DisplayName\" \"$(^NameDA)\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BigNSISTest\" \"DisplayIcon\" \"$INSTDIR\\Uninstall.exe,0\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BigNSISTest\" \"UninstallString\" \"$INSTDIR\\Uninstall.exe\"\n  ;Create uninstaller\n  WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n\nSectionEnd\n\nSection Uninstall\n\n  DeleteRegKey ${UMUI_PARAMS_REGISTRY_ROOT} \"${UMUI_PARAMS_REGISTRY_KEY}\"\n    \n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BigNSISTest\"\n\n  Delete \"$INSTDIR\\Uninstall.exe\"\n  RMDir \"$INSTDIR\"\n  Sleep 1000\nSectionEnd\n\n\n;--------------------------------\n;Descriptions\n\n  ;Language strings\n  LangString DESC_SecDummy ${LANG_ENGLISH} \"A test section.\"\n  LangString DESC_SecDummy ${LANG_FRENCH} \"Une section de test.\"\n\n  ;Assign language strings to sections\n  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n    !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)\n  !insertmacro MUI_FUNCTION_DESCRIPTION_END\n\nFunction un.onInit\n\n  !insertmacro MUI_UNGETLANGUAGE\n  \nFunctionEnd\n\nFunction .onInit\n\n  !insertmacro MUI_LANGDLL_DISPLAY\n\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/information.txt",
    "content": "This is the default information for untranslated files of the Information.msi example."
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/information1033.txt",
    "content": "This is the content of the english information file for the Information.msi example."
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/information1036.txt",
    "content": "Voici le contenu du fichier d'information franais pour l'exemple Information.nsi"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/ioA.ini",
    "content": "[Settings]\nNumFields=5\n\n[Field 1]\nType=Label\nLeft=50\nRight=-10\nTop=0\nBottom=30\nText=This page convert a custom InstallOptions page into an InstalloptionsEx compatible page\n\n[Field 2]\nType=Icon\nLeft=10\nRight=42\nTop=0\nBottom=32\nText=C:\\Program Files\\NSIS\\Contrib\\Graphics\\UltraModernUI\\Icon.ico\nFlags=TRANSPARENT\n\n[Field 3]\nType=FileRequest\nState=C:\\poop.poop\nLeft=10\nRight=-10\nTop=56\nBottom=68\nFilter=Poop Files|*.poop|All files|*.*\nFlags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY\n\n[Field 4]\nType=DirRequest\nLeft=10\nRight=-10\nTop=73\nBottom=85\nText=Select a directory...\nState=C:\\Program Files\\NSIS\n\n[Field 5]\nType=Link\nLeft=10\nRight=-10\nTop=-20\nBottom=-10\nText=\"This is a link...\"\nFlags=NOTIFY\nState=\"http://nsis.sf.net\""
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/ioB.ini",
    "content": "[Settings]\nNumFields=3\n\n[Field 1]\nType=label\nText=Instal Options Page C\\ncolored manually\nLeft=0\nRight=-1\nTop=0\nBottom=15\n\n[Field 2]\nType=checkbox\nText=Display a MessageBox\nLeft=0\nRight=-1\nTop=30\nBottom=40\nState=1\n\n[Field 3]\nType=text\nState=An input text\nLeft=0\nRight=-10\nTop=56\nBottom=68"
  },
  {
    "path": "setup/nsis/tools/Examples/UltraModernUI/nsDialog.nsi",
    "content": ";NSIS Ultra Modern User Interface\n;InstallOptionsEx and InstallOptions compatibility mode Example Script\n;Written by SyperPat\n\n;--------------------------------\n;General\n\n  ;Name and file\n  Name \"UltraModernUI Test\"\n  OutFile \"nsDialogs.exe\"\n\n  ;Default installation folder\n  InstallDir \"$DESKTOP\\UltraModernUI Test\"\n  \n  ;Get installation folder from registry if available\n  InstallDirRegKey HKCU \"Software\\UltraModernUI Test\" \"\"\n\n  ;Request application privileges for Windows Vista\n  RequestExecutionLevel user\n\n;--------------------------------\n;Interface Settings\n\n  !define MUI_ABORTWARNING\n  \n  ;Active InstallOptionsEx\n  !define UMUI_USE_INSTALLOPTIONSEX\n\n  !define UMUI_SKIN \"blue2\"\n  \n  !define UMUI_PAGEBGIMAGE\n  !define UMUI_UNPAGEBGIMAGE  \n  \n  \n;---------------------\n;Include UltraModernUI\n\n  !include \"UMUI.nsh\"  \n  !include nsDialogs.nsh\n  !include LogicLib.nsh\n\n    !define MUI_LICENSEPAGE_TEXT_TOP \"All the action takes place on the next page...\"\n  !insertmacro MUI_PAGE_LICENSE \"${NSISDIR}\\Docs\\UltraModernUI\\License.txt\"\n  Page custom nsDialogsPage\n  !insertmacro MUI_PAGE_DIRECTORY\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro UMUI_PAGE_ABORT\n\n\n;--------------------------------\n;Languages\n \n  !insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Installer Sections\n\nSection \"Dummy Section\" SecDummy\n\n  SetOutPath \"$INSTDIR\"\n  \n  ;ADD YOUR OWN FILES HERE...\n \nSectionEnd\n\n;--------------------------------\n;Variables\n\nVar BUTTON\nVar EDIT\nVar CHECKBOX\n\n;--------------------------------\n;Installer Functions\n\nLangString TEXT_NSD_TITLE ${LANG_ENGLISH} \"nsDialog page\"\nLangString TEXT_NSD_SUBTITLE ${LANG_ENGLISH} \"This is a page created using the nsDialog plug-in.\"\n\nFunction nsDialogsPage\n\n  ; Does not show page if setup cancelled, required only if UMUI_PAGE_ABORT inserted\n  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}\n\n  !insertmacro MUI_HEADER_TEXT \"$(TEXT_NSD_TITLE)\" \"$(TEXT_NSD_SUBTITLE)\"\n\n  nsDialogs::Create 1018\n  Pop $0\n\n  !insertmacro UMUI_IOPAGEBGTRANSPARENT_INIT $0 ; set page background color\n\n  GetFunctionAddress $0 OnBack\n  nsDialogs::OnBack $0\n\n  ${NSD_CreateButton} 0 0 100% 12u Test\n  Pop $BUTTON\n  GetFunctionAddress $0 OnClick\n  nsDialogs::OnClick $BUTTON $0\n\n  ${NSD_CreateText} 0 35 100% 12u hello\n  Pop $EDIT\n  GetFunctionAddress $0 OnChange\n  nsDialogs::OnChange $EDIT $0\n\n  !insertmacro UMUI_IOPAGEINPUTCTL_INIT $EDIT ; set input text and background color\n  \n  ${NSD_CreateCheckbox} 0 -50 100% 8u Test\n  Pop $CHECKBOX\n  GetFunctionAddress $0 OnCheckbox\n  nsDialogs::OnClick $CHECKBOX $0\n\n  !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $CHECKBOX ; set checkbox and background color\n  \n  ${NSD_CreateLabel} 0 40u 75% 40u \"* Type `hello there` above.$\\n* Click the button.$\\n* Check the checkbox.$\\n* Hit the Back button.\"\n  Pop $0\n\n  !insertmacro UMUI_IOPAGECTLTRANSPARENT_INIT $0 ; set label and background color\n  \n\n  nsDialogs::Show\n\nFunctionEnd\n\nFunction OnClick\n\n  Pop $0 # HWND\n\n  MessageBox MB_OK clicky\n\nFunctionEnd\n\nFunction OnChange\n\n  Pop $0 # HWND\n\n  System::Call user32::GetWindowText(p$EDIT,t.r0,i${NSIS_MAX_STRLEN})\n\n  ${If} $0 == \"hello there\"\n    MessageBox MB_OK \"right back at ya\"\n  ${EndIf}\n\nFunctionEnd\n\nFunction OnBack\n\n  MessageBox MB_YESNO \"are you sure?\" IDYES +2\n  Abort\n\nFunctionEnd\n\nFunction OnCheckbox\n\n  Pop $0 # HWND\n\n  MessageBox MB_OK \"checkbox clicked\"\n\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/UserInfo/UserInfo.nsi",
    "content": "Name \"UserInfo.dll test\"\nOutFile UserInfo.exe\nRequestExecutionLevel Highest\n\n!define REALMSG \"$\\nOriginal non-restricted account type: $2\"\n\nSection\n\tClearErrors\n\tUserInfo::GetName\n\tIfErrors PluginFail\n\tPop $0\n\tStrCmp $0 \"\" 0 +2 ; GetName can return a empty string on Win9x\n\t\tStrCpy $0 \"?\"\n\tUserInfo::GetAccountType\n\tPop $1\n\t# GetOriginalAccountType will check the tokens of the original user of the\n\t# current thread/process. If the user tokens were elevated or limited for\n\t# this process, GetOriginalAccountType will return the non-restricted\n\t# account type.\n\t# On Vista with UAC, for example, this is not the same value when running\n\t# with `RequestExecutionLevel user`. GetOriginalAccountType will return\n\t# \"admin\" while GetAccountType will return \"user\".\n\tUserInfo::GetOriginalAccountType\n\tPop $2\n\tStrCmp $1 \"Admin\" 0 +3 ; Note: Win9x always returns \"Admin\"\n\t\tMessageBox MB_OK 'User \"$0\" is in the Administrators group${REALMSG}'\n\t\tGoto done\n\tStrCmp $1 \"Power\" 0 +3\n\t\tMessageBox MB_OK 'User \"$0\" is in the Power Users group${REALMSG}'\n\t\tGoto done\n\tStrCmp $1 \"User\" 0 +3\n\t\tMessageBox MB_OK 'User \"$0\" is just a regular user${REALMSG}'\n\t\tGoto done\n\tStrCmp $1 \"Guest\" 0 +3\n\t\tMessageBox MB_OK 'User \"$0\" is a guest${REALMSG}'\n\t\tGoto done\n\tMessageBox MB_OK \"Unknown error\"\n\tGoto done\n\n\tPluginFail:\n\t\tMessageBox MB_OK \"Error! Unable to call plug-in!\"\n\n\tdone:\nSectionEnd\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/UserVars.nsi",
    "content": "; UserVars.nsi\n;\n; This script shows you how to declare and user variables.\n\n;--------------------------------\n\n  Name \"User Variables Text\"\n  OutFile \"UserVars.exe\"\n  \n  InstallDir \"$PROGRAMFILES\\User Variables Test\"\n  \n  RequestExecutionLevel admin\n  \n;--------------------------------\n\n  ;Pages\n  Page directory\n  Page instfiles\n  \n  UninstPage uninstConfirm\n  UninstPage instfiles\n\n;--------------------------------\n; Declaration of user variables (Var command), allowed charaters for variables names : [a-z][A-Z][0-9] and '_'\n\n  Var \"Name\"\n  Var \"Serial\"\n  Var \"Info\"\n\n;--------------------------------\n; Installer\n\nSection \"Dummy Section\" SecDummy\n\n     StrCpy $0 \"Admin\"\n     StrCpy \"$Name\" $0\n     StrCpy \"$Serial\" \"12345\"\n     MessageBox MB_OK \"User Name: $Name $\\n$\\nSerial Number: $Serial\"\n\n     CreateDirectory $INSTDIR\n     WriteUninstaller \"$INSTDIR\\Uninst.exe\"\n     \nSectionEnd\n\nSection \"Another Section\"\n\n     Var /GLOBAL \"AnotherVar\"\n\n     StrCpy $AnotherVar \"test\"\n\nSectionEnd\n\n;--------------------------------\n; Uninstaller\n\nSection \"Uninstall\"\n\n     StrCpy $Info \"User variables test uninstalled successfully.\"\n     Delete \"$INSTDIR\\Uninst.exe\"\n     RmDir $INSTDIR\n\nSectionEnd\n\nFunction un.OnUninstSuccess\n\n     HideWindow\n     MessageBox MB_OK \"$Info\"\n     \nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/VPatch/example.nsi",
    "content": ";VPatch example\n;Written by Joost Verburg\n\n;--------------------------------\n\n; The name of the installer\nName \"VPatch Test\"\n\n; The file to write\nOutFile \"vpatchtest.exe\"\n\n; The default installation directory\nInstallDir \"$PROGRAMFILES\\VPatch Test\"\n\n; The text to prompt the user to enter a directory\nDirText \"Choose a folder in which to install the VPatch Test!\"\n\n; Show details\nShowInstDetails show\n\n;--------------------------------\n;  The normal way to use VPatch\n;--------------------------------\n!include \"VPatchLib.nsh\"\n\nSection \"Update file\"\n  ; Set output path to the installation directory\n  SetOutPath $INSTDIR\n\n  ; Extract the old file under name 'updatefile.txt'\n  File /oname=updatefile.txt oldfile.txt\n  \n  ; Update the file - it will be replaced with the new version\n  DetailPrint \"Updating updatefile.txt using patch...\"\n  !insertmacro VPatchFile \"patch.pat\" \"$INSTDIR\\updatefile.txt\" \"$INSTDIR\\temporaryfile.txt\"\n  \nSectionEnd\n\n;-------------------------------\n;  The hard way to use VPatch\n;-------------------------------\nSection \"New version in separate file\"\n\n  ; Set output path to the installation directory\n  SetOutPath $INSTDIR\n  \n  ; Extract the old file\n  File oldfile.txt\n \n  ; Extract the patch to the plug-ins folder (temporary)\n  InitPluginsDir\n  File /oname=$PLUGINSDIR\\patch.pat patch.pat\n  \n  ; Update the old file to the new file using the patch\n  DetailPrint \"Updating oldfile.txt using patch to newfile.txt...\"\n  vpatch::vpatchfile \"$PLUGINSDIR\\patch.pat\" \"$INSTDIR\\oldfile.txt\" \"$INSTDIR\\newfile.txt\"\n  \n  ; Show result\n  Pop $R0\n  DetailPrint \"Result: $R0\"\n  \nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/VPatch/newfile.txt",
    "content": "*** THIS IS A TEST FILE FOR THE VPATCH EXAMPLE ***\n*** COMPILE EXAMPLE.NSI TO TEST ***\n\nnewfile - vpatch\n\n67890 - GHIJKL"
  },
  {
    "path": "setup/nsis/tools/Examples/VPatch/oldfile.txt",
    "content": "*** THIS IS A TEST FILE FOR THE VPATCH EXAMPLE ***\n*** COMPILE EXAMPLE.NSI TO TEST ***\n\noldfile - vpatch\n\n12345 - ABCDEF"
  },
  {
    "path": "setup/nsis/tools/Examples/VersionInfo.nsi",
    "content": "; VersionInfo.nsi\n;\n; This script shows you how to add version information to an installer.\n; Windows shows this information on the Version tab of the File properties.\n\n;--------------------------------\n\nName \"Version Info\"\n\nOutFile \"VersionInfo.exe\"\n\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\English.nlf\"\n;--------------------------------\n;Version Information\n\n  VIProductVersion \"1.2.3.4\"\n  VIAddVersionKey /LANG=${LANG_ENGLISH} \"ProductName\" \"Test Application\"\n  VIAddVersionKey /LANG=${LANG_ENGLISH} \"Comments\" \"A test comment\"\n  VIAddVersionKey /LANG=${LANG_ENGLISH} \"CompanyName\" \"Fake company\"\n  VIAddVersionKey /LANG=${LANG_ENGLISH} \"LegalTrademarks\" \"Test Application is a trademark of Fake company\"\n  VIAddVersionKey /LANG=${LANG_ENGLISH} \"LegalCopyright\" \"Copyright Fake company\"\n  VIAddVersionKey /LANG=${LANG_ENGLISH} \"FileDescription\" \"Test Application\"\n  VIAddVersionKey /LANG=${LANG_ENGLISH} \"FileVersion\" \"1.2.3\"\n\n;--------------------------------\n\nSection \"\"\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/WordFunc.ini",
    "content": "[Settings]\nNumFields=13\nNextButtonText=&Enter\n\n[Field 1]\nType=Droplist\nFlags=NOTIFY\nState=1. WordFind        (Find word by number)\nListItems=1. WordFind        (Find word by number)|                           (Delimiter exclude)|                           (Sum of words)|                           (Sum of delimiters)|                           (Find word number)|                           ( }} )|                           ( {} )|                           ( *} )|2. WordFind2X|3. WordReplace (Replace)|                           (Delete)|                           (Multiple-replace)|4. WordAdd        (Add)|                           (Delete) |5. WordInsert|6. StrFilter           (UpperCase)|                           (LowerCase)|                           (Filter)|7. VersionCompare|8. VersionConvert\nLeft=44\nRight=190\nTop=10\nBottom=191\n\n[Field 2]\nType=Text\nState=C:\\io.sys|C:\\logo.sys|C:\\Program Files|C:\\WINDOWS\nLeft=44\nRight=-10\nTop=30\nBottom=41\n\n[Field 3]\nType=Text\nState=|C:\\\nLeft=44\nRight=-10\nTop=46\nBottom=59\n\n[Field 4]\nType=Text\nFlags=DISABLED\nLeft=44\nRight=-10\nTop=62\nBottom=75\n\n[Field 5]\nType=Text\nState=-4\nLeft=44\nRight=-10\nTop=80\nBottom=92\n\n[Field 6]\nType=Text\nLeft=10\nRight=-30\nTop=108\nBottom=120\n\n[Field 7]\nType=Text\nLeft=-22\nRight=-10\nTop=108\nBottom=120\n\n[Field 8]\nType=Label\nText=String\nLeft=10\nRight=43\nTop=32\nBottom=44\n\n[Field 9]\nType=Label\nText=Delimiter\nLeft=10\nRight=43\nTop=48\nBottom=60\n\n[Field 10]\nType=Label\nLeft=10\nRight=44\nTop=65\nBottom=76\n\n[Field 11]\nType=Label\nText=Word #\nLeft=10\nRight=43\nTop=81\nBottom=94\n\n[Field 12]\nType=Label\nText=Result (Word):\nLeft=10\nRight=236\nTop=97\nBottom=110\n\n[Field 13]\nType=Label\nText=EL\nLeft=-21\nRight=-10\nTop=97\nBottom=110\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/WordFunc.nsi",
    "content": ";_____________________________________________________________________________\n;\n;                          Word Functions\n;_____________________________________________________________________________\n;\n; 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\nName \"Word Functions\"\nOutFile \"WordFunc.exe\"\nCaption \"$(^Name)\"\nXPStyle on\nRequestExecutionLevel user\n\nVar INI\nVar HWND\nVar STATE\n\n!include \"WinMessages.nsh\"\n!include \"WordFunc.nsh\"\n\nPage Custom ShowCustom LeaveCustom\n\nFunction ShowCustom\n\tInstallOptions::initDialog \"$INI\"\n\tPop $hwnd\n\tInstallOptions::show\n\tPop $0\nFunctionEnd\n\nFunction LeaveCustom\n\tReadINIStr $0 $INI \"Settings\" \"State\"\n\tStrCmp $0 0 Enter\n\n\tGetDlgItem $1 $HWND 1202\n\tEnableWindow $1 1\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 1\n\tGetDlgItem $1 $HWND 1206\n\tEnableWindow $1 1\n\tGetDlgItem $1 $HWND 1205\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1206\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\n\tReadINIStr $0 $INI \"Field 1\" \"State\"\n\tStrCmp $0 \"1. WordFind        (Find word by number)\" 0 WordFind2Send\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|C:\\\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:-4\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Word):\"\n\tgoto WordFindSend\n\n\tWordFind2Send:\n\tStrCmp $0 \"                           (Delimiter exclude)\" 0 WordFind3Send\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|C:\\\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E-2{\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Before{ or }after delimiter):\"\n\tgoto WordFindSend\n\n\tWordFind3Send:\n\tStrCmp $0 \"                           (Sum of words)\" 0 WordFind4Send\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|C:\\\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:#\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Sum of words):\"\n\tgoto WordFindSend\n\n\tWordFind4Send:\n\tStrCmp $0 \"                           (Sum of delimiters)\" 0 WordFind5Send\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E*\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Option\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Sum of delimiters):\"\n\tgoto WordFindSend\n\n\tWordFind5Send:\n\tStrCmp $0 \"                           (Find word number)\" 0 WordFind6Send\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|C:\\\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:/Program Files\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:/Word\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Word #):\"\n\tgoto WordFindSend\n\n\tWordFind6Send:\n\tStrCmp $0 \"                           ( }} )\" 0 WordFind7Send\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|C:\\\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E+2}}\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Before{{ or }}after word):\"\n\tgoto WordFindSend\n\n\tWordFind7Send:\n\tStrCmp $0 \"                           ( {} )\" 0 WordFind8Send\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|C:\\\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:+2{}\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Without word):\"\n\tgoto WordFindSend\n\n\tWordFind8Send:\n\tStrCmp $0 \"                           ( *} )\" 0 WordFind2XSend\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|C:\\\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E+2*}\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Before{* or *}after word with word):\"\n\tgoto WordFindSend\n\n\tWordFind2XSend:\n\tStrCmp $0 \"2. WordFind2X\" 0 WordReplace1Send\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:[C:\\io.sys];[C:\\logo.sys];[C:\\WINDOWS]\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:[C:\\\"\n\tGetDlgItem $1 $HWND 1203\n\tEnableWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:];\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E+2\"\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:String\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Delimiter1\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Delimiter2\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (Word):\"\n\tabort\n\n\tWordReplace1Send:\n\tStrCmp $0 \"3. WordReplace (Replace)\" 0 WordReplace2Send\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:C:\\io.sys|C:\\logo.sys|C:\\WINDOWS\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:SYS\"\n\tGetDlgItem $1 $HWND 1203\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:bmp\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:+2\"\n\tgoto WordReplaceSend\n\n\tWordReplace2Send:\n\tStrCmp $0 \"                           (Delete)\" 0 WordReplace3Send\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:C:\\io.sys|C:\\logo.sys|C:\\WINDOWS\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:SYS\"\n\tGetDlgItem $1 $HWND 1203\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E+\"\n\tgoto WordReplaceSend\n\n\tWordReplace3Send:\n\tStrCmp $0 \"                           (Multiple-replace)\" 0 WordAdd1Send\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:C:\\io.sys||||||C:\\logo.sys|||C:\\WINDOWS\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|\"\n\tGetDlgItem $1 $HWND 1203\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:+1*\"\n\tgoto WordReplaceSend\n\n\tWordAdd1Send:\n\tStrCmp $0 \"4. WordAdd        (Add)\" 0 WordAdd2Send\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:+C:\\WINDOWS|C:\\config.sys|C:\\IO.SYS\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (String1 + String2):\"\n\tgoto WordAddSend\n\n\tWordAdd2Send:\n\tStrCmp $0 \"                           (Delete) \" 0 WordInsertSend\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E-C:\\WINDOWS|C:\\config.sys|C:\\IO.SYS\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (String1 - String2):\"\n\tgoto WordAddSend\n\n\tWordInsertSend:\n\tStrCmp $0 \"5. WordInsert\" 0 StrFilter1Send\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:C:\\io.sys|C:\\WINDOWS\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|\"\n\tGetDlgItem $1 $HWND 1203\n\tEnableWindow $1 1\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:C:\\logo.sys\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:E+2\"\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:String\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Delimiter\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result:\"\n\tabort\n\n\tStrFilter1Send:\n\tStrCmp $0 \"6. StrFilter           (UpperCase)\" 0 StrFilter2Send\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:123abc 456DEF 7890|%#\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:+\"\n\tGetDlgItem $1 $HWND 1203\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (String in uppercase):\"\n\tgoto StrFilterSend\n\n\tStrFilter2Send:\n\tStrCmp $0 \"                           (LowerCase)\" 0 StrFilter3Send\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:123abc 456DEF 7890|%#\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:-\"\n\tGetDlgItem $1 $HWND 1203\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:ef\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (String in lowercase except EF):\"\n\tgoto StrFilterSend\n\n\tStrFilter3Send:\n\tStrCmp $0 \"                           (Filter)\" 0 VersionCompareSend\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:123abc 456DEF 7890|%#\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:+12\"\n\tGetDlgItem $1 $HWND 1203\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:b\"\n\tGetDlgItem $1 $HWND 1204\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:def\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (String Digits + Letters + b - def):\"\n\tgoto StrFilterSend\n\n\tVersionCompareSend:\n\tStrCmp $0 \"7. VersionCompare\" 0 VersionConvertSend\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:1.1.1.9\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:1.1.1.01\"\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1206\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Version1\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Version2\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (0-equal 1-newer 2-older):\"\n\tabort\n\n\tVersionConvertSend:\n\tStrCmp $0 \"8. VersionConvert\" 0 Abort\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:9.0c\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1203\n\tShowWindow $1 0\n\tGetDlgItem $1 $HWND 1204\n\tShowWindow $1 0\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1206\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Version\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:CharList\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result (numerical version format):\"\n\tabort\n\n\tAbort:\n\tAbort\n\n\tWordFindSend:\n\tGetDlgItem $1 $HWND 1203\n\tEnableWindow $1 0\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:C:\\io.sys|C:\\logo.sys|C:\\Program Files|C:\\WINDOWS\"\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:String\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Delimiter\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tAbort\n\n\tWordReplaceSend:\n\tGetDlgItem $1 $HWND 1203\n\tEnableWindow $1 1\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:String\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Replace it\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:         with\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Word #\"\n\tGetDlgItem $1 $HWND 1211\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Result:\"\n\tAbort\n\n\tWordAddSend:\n\tGetDlgItem $1 $HWND 1203\n\tEnableWindow $1 0\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1201\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:C:\\io.sys|C:\\logo.sys|C:\\WINDOWS\"\n\tGetDlgItem $1 $HWND 1202\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:|\"\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:String1\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Delimiter\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:String2\"\n\tAbort\n\n\tStrFilterSend:\n\tGetDlgItem $1 $HWND 1203\n\tEnableWindow $1 1\n\tGetDlgItem $1 $HWND 1206\n\tEnableWindow $1 0\n\tGetDlgItem $1 $HWND 1207\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:String\"\n\tGetDlgItem $1 $HWND 1208\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Filter\"\n\tGetDlgItem $1 $HWND 1209\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Include\"\n\tGetDlgItem $1 $HWND 1210\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:Exclude\"\n\tAbort\n\n;=Enter=\n\tEnter:\n\tStrCpy $0 ''\n\tReadINIStr $STATE $INI \"Field 1\" \"State\"\n\tReadINIStr $R1 $INI \"Field 2\" \"State\"\n\tReadINIStr $R2 $INI \"Field 3\" \"State\"\n\tReadINIStr $R3 $INI \"Field 4\" \"State\"\n\tReadINIStr $R4 $INI \"Field 5\" \"State\"\n\n\tStrCmp $STATE \"1. WordFind        (Find word by number)\" WordFind\n\tStrCmp $STATE \"                           (Delimiter exclude)\" WordFind\n\tStrCmp $STATE \"                           (Find in string)\" WordFind\n\tStrCmp $STATE \"                           (Sum of words)\" WordFind\n\tStrCmp $STATE \"                           (Sum of delimiters)\" WordFind\n\tStrCmp $STATE \"                           (Find word number)\" WordFind\n\tStrCmp $STATE \"                           ( }} )\" WordFind\n\tStrCmp $STATE \"                           ( {} )\" WordFind\n\tStrCmp $STATE \"                           ( *} )\" WordFind\n\tStrCmp $STATE \"2. WordFind2X\" WordFind2X\n\tStrCmp $STATE \"3. WordReplace (Replace)\" WordReplace\n\tStrCmp $STATE \"                           (Delete)\" WordReplace\n\tStrCmp $STATE \"                           (Multiple-replace)\" WordReplace\n\tStrCmp $STATE \"4. WordAdd        (Add)\" WordAdd\n\tStrCmp $STATE \"                           (Delete) \" WordAdd\n\tStrCmp $STATE \"5. WordInsert\" WordInsert\n\tStrCmp $STATE \"6. StrFilter           (UpperCase)\" StrFilter\n\tStrCmp $STATE \"                           (LowerCase)\" StrFilter\n\tStrCmp $STATE \"                           (Filter)\" StrFilter\n\tStrCmp $STATE \"7. VersionCompare\" VersionCompare\n\tStrCmp $STATE \"8. VersionConvert\" VersionConvert\n\tAbort\n\n\tWordFind:\n\t${WordFind} \"$R1\" \"$R2\" \"$R4\" $R0\n\tIfErrors 0 Send\n\tStrCpy $0 $R0\n\tStrCmp $R0 3 0 +3\n\tStrCpy $3 '\"+1\" \"-1\" \"+1}\" \"+1{\" \"#\" \"/word\"'\n\tgoto error3\n\tStrCmp $R0 2 0 error1\n\tStrCpy $R4 $R4 '' 1\n\tStrCpy $1 $R4 1\n\tStrCmp $1 / 0 error2\n\tStrCpy $R4 $R4 '' 1\n\tStrCpy $R0 '\"$R4\" no such word.'\n\tgoto Send\n\n\tWordFind2X:\n\t${WordFind2X} \"$R1\" \"$R2\" \"$R3\" \"$R4\" $R0\n\tIfErrors 0 Send\n\tStrCpy $0 $R0\n\tStrCmp $R0 3 0 +3\n\tStrCpy $3 '\"+1\" \"-1\"'\n\tgoto error3\n\tStrCmp $R0 2 +3\n\tStrCpy $R0 '\"$R2...$R3\" no words found.'\n\tgoto Send\n\tStrCpy $R4 $R4 '' 1\n\tStrCpy $1 $R4 1\n\tStrCmp $1 / 0 +2\n\tStrCpy $R4 $R4 '' 1\n\tStrCpy $R0 '\"$R4\" no such word.'\n\tgoto Send\n\n\tWordReplace:\n\t${WordReplace} \"$R1\" \"$R2\" \"$R3\" \"$R4\" $R0\n\tIfErrors 0 Send\n\tStrCpy $0 $R0\n\tStrCmp $R0 3 0 +3\n\tStrCpy $3 '\"+1\" \"+1*\" \"+\" \"+*\" \"{}\"'\n\tgoto error3\n\tStrCmp $R0 2 0 error1\n\tStrCpy $R4 $R4 '' 1\n\tgoto error2\n\n\tWordAdd:\n\t${WordAdd} \"$R1\" \"$R2\" \"$R4\" $R0\n\tIfErrors 0 Send\n\tStrCpy $0 $R0\n\tStrCmp $R0 3 0 error1empty\n\tStrCpy $3 '\"+text\" \"-text\"'\n\tgoto error3\n\n\tWordInsert:\n\t${WordInsert} \"$R1\" \"$R2\" \"$R3\" \"$R4\" $R0\n\tIfErrors 0 Send\n\tStrCpy $0 $R0\n\tStrCmp $R0 3 0 +3\n\tStrCpy $3 '\"+1\" \"-1\"'\n\tgoto error3\n\tStrCmp $R0 2 0 error1empty\n\tStrCpy $R4 $R4 '' 1\n\tgoto error2\n\n\tStrFilter:\n\t${StrFilter} \"$R1\" \"$R2\" \"$R3\" \"$R4\" $R0\n\tIfErrors 0 Send\n\tStrCpy $R0 'Syntax error'\n\tgoto Send\n\n\tVersionCompare:\n\t${VersionCompare} \"$R1\" \"$R2\" $R0\n\tgoto Send\n\n\tVersionConvert:\n\t${VersionConvert} \"$R1\" \"$R2\" $R0\n\tgoto Send\n\n\terror3:\n\tStrCpy $R0 '\"$R4\" syntax error ($3)'\n\tgoto Send\n\terror2:\n\tStrCpy $R0 '\"$R4\" no such word number'\n\tgoto Send\n\terror1empty:\n\tStrCpy $R0 '\"$R2\" delimiter is empty'\n\tgoto Send\n\terror1:\n\tStrCpy $R0 '\"$R2\" delimiter not found in string'\n\tgoto Send\n\n\tSend:\n\tGetDlgItem $1 $HWND 1205\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$R0\"\n\tGetDlgItem $1 $HWND 1206\n\tSendMessage $1 ${WM_SETTEXT} 1 \"STR:$0\"\n\tabort\nFunctionEnd\n\nFunction .onInit\n\tInitPluginsDir\n\tGetTempFileName $INI $PLUGINSDIR\n\tFile /oname=$INI \"WordFunc.ini\"\nFunctionEnd\n\nPage instfiles\n\nSection \"Empty\"\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/WordFuncTest.nsi",
    "content": ";_____________________________________________________________________________\n;\n;                          Word Functions Test\n;_____________________________________________________________________________\n;\n; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\nName \"Word Functions Test\"\nOutFile \"WordFuncTest.exe\"\nCaption \"$(^Name)\"\nShowInstDetails show\nXPStyle on\nRequestExecutionLevel user\n\nVar FUNCTION\nVar OUT\n\n!include \"WordFunc.nsh\"\n\n;############### INSTALL ###############\n\n!define StackVerificationStart `!insertmacro StackVerificationStart`\n!macro StackVerificationStart _FUNCTION\n\tStrCpy $FUNCTION ${_FUNCTION}\n\tCall StackVerificationStart\n!macroend\n\n!define StackVerificationEnd `!insertmacro StackVerificationEnd`\n!macro StackVerificationEnd\n\tCall StackVerificationEnd\n!macroend\n\nFunction StackVerificationStart\n\tStrCpy $0 !0\n\tStrCpy $1 !1\n\tStrCpy $2 !2\n\tStrCpy $3 !3\n\tStrCpy $4 !4\n\tStrCpy $5 !5\n\tStrCpy $6 !6\n\tStrCpy $7 !7\n\tStrCpy $8 !8\n\tStrCpy $9 !9\n\tStrCpy $R0 !R0\n\tStrCpy $R1 !R1\n\tStrCpy $R2 !R2\n\tStrCpy $R3 !R3\n\tStrCpy $R4 !R4\n\tStrCpy $R5 !R5\n\tStrCpy $R6 !R6\n\tStrCpy $R7 !R7\n\tStrCpy $R8 !R8\n\tStrCpy $R9 !R9\nFunctionEnd\n\nFunction StackVerificationEnd\n\tIfErrors +3\n\tDetailPrint 'PASSED $FUNCTION no errors'\n\tgoto +2\n\tDetailPrint 'FAILED   $FUNCTION error'\n\n\tStrCmp $0 '!0' 0 error\n\tStrCmp $1 '!1' 0 error\n\tStrCmp $2 '!2' 0 error\n\tStrCmp $3 '!3' 0 error\n\tStrCmp $4 '!4' 0 error\n\tStrCmp $5 '!5' 0 error\n\tStrCmp $6 '!6' 0 error\n\tStrCmp $7 '!7' 0 error\n\tStrCmp $8 '!8' 0 error\n\tStrCmp $9 '!9' 0 error\n\tStrCmp $R0 '!R0' 0 error\n\tStrCmp $R1 '!R1' 0 error\n\tStrCmp $R2 '!R2' 0 error\n\tStrCmp $R3 '!R3' 0 error\n\tStrCmp $R4 '!R4' 0 error\n\tStrCmp $R5 '!R5' 0 error\n\tStrCmp $R6 '!R6' 0 error\n\tStrCmp $R7 '!R7' 0 error\n\tStrCmp $R8 '!R8' 0 error\n\tStrCmp $R9 '!R9' 0 error\n\tDetailPrint 'PASSED $FUNCTION stack'\n\tgoto end\n\n\terror:\n\tDetailPrint 'FAILED   $FUNCTION stack'\n;\tMessageBox MB_OKCANCEL '$$0={$0}$\\n$$1={$1}$\\n$$2={$2}$\\n$$3={$3}$\\n$$4={$4}$\\n$$5={$5}$\\n$$6={$6}$\\n$$7={$7}$\\n$$8={$8}$\\n$$9={$9}$\\n$$R0={$R0}$\\n$$R1={$R1}$\\n$$R2={$R2}$\\n$$R3={$R3}$\\n$$R4={$R4}$\\n$$R5={$R5}$\\n$$R6={$R6}$\\n$$R7={$R7}$\\n$$R8={$R8}$\\n$$R9={$R9}' IDOK +2\n;\tquit\n\n\tend:\nFunctionEnd\n\n\n\nSection WordFind\n\t${StackVerificationStart} WordFind\n\n\t${WordFind} '||io.sys|||Program Files|||WINDOWS' '||' '-02' $OUT\n\tStrCmp $OUT '|Program Files' 0 error\n\n\t${WordFind} '||io.sys||||Program Files||||WINDOWS' '||' '-2' $OUT\n\tStrCmp $OUT 'Program Files' 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys|||WINDOWS' '||' '-2}' $OUT\n\tStrCmp $OUT '|logo.sys|||WINDOWS' 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys|||WINDOWS' '||' '#' $OUT\n\tStrCmp $OUT '3' 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys|||WINDOWS' '||' '*' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\t${WordFind} 'C:\\io.sys|||Program Files|||WINDOWS' '||' '/|Program Files' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys|||WINDOWS' '||' '+2}}' $OUT\n\tStrCmp $OUT '|||WINDOWS' 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys|||WINDOWS' '||' '+2{}' $OUT\n\tStrCmp $OUT 'C:\\io.sys|||WINDOWS' 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys|||WINDOWS' '||' '+2*}' $OUT\n\tStrCmp $OUT '|logo.sys|||WINDOWS' 0 error\n\n\t${WordFind} 'C:\\\\Program Files\\\\NSIS\\\\NSIS.chm' '\\' '-2{*' $OUT\n\tStrCmp $OUT 'C:\\\\Program Files\\\\NSIS' 0 error\n\n\t${WordFind} 'C:\\io.sys|||Program Files|||WINDOWS|||' '||' '-1' $OUT\n\tStrCmp $OUT '|' 0 error\n\n\t${WordFind} '||C:\\io.sys|||logo.sys|||WINDOWS||' '||' '-1}' $OUT\n\tStrCmp $OUT '' 0 error\n\n\t${WordFind} '||C:\\io.sys|||logo.sys|||WINDOWS||' '||' '+1{' $OUT\n\tStrCmp $OUT '' 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys' '_' 'E+1' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT 1 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys|||' '\\' 'E+3' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT 2 0 error\n\n\t${WordFind} 'C:\\io.sys|||logo.sys' '\\' 'E1' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT 3 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordFindS\n\t${StackVerificationStart} WordFindS\n\n\t${WordFindS} 'C:\\io.sys|||Program Files|||WINDOWS' '||' '/|PROGRAM FILES' $OUT\n\tStrCmp $OUT 'C:\\io.sys|||Program Files|||WINDOWS' 0 error\n\n\t${WordFindS} 'C:\\io.sys|||Program Files|||WINDOWS' '||' '/|Program Files' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordFind2X\n\t${StackVerificationStart} WordFind2X\n\n\t${WordFind2X} '[C:\\io.sys];[C:\\logo.sys];[C:\\WINDOWS]' '[C:\\' '];' '+2' $OUT\n\tStrCmp $OUT 'logo.sys' 0 error\n\n\t${WordFind2X} 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' '\\' '.' '-1' $OUT\n\tStrCmp $OUT 'logo' 0 error\n\n\t${WordFind2X} 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' '\\' '.' '-1{{' $OUT\n\tStrCmp $OUT 'C:\\WINDOWS C:\\io.sys C:' 0 error\n\n\t${WordFind2X} 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' '\\' '.' '-1{}' $OUT\n\tStrCmp $OUT 'C:\\WINDOWS C:\\io.sys C:sys' 0 error\n\n\t${WordFind2X} 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' '\\' '.' '-1{*' $OUT\n\tStrCmp $OUT 'C:\\WINDOWS C:\\io.sys C:\\logo.' 0 error\n\n\t${WordFind2X} 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' '\\' '.' '/logo' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\t${WordFind2X} '||a||b||c' '||' '||' 'E+1' $OUT\n\tStrCmp $OUT 'a' 0 error\n\n\t${WordFind2X} '[io.sys];[C:\\logo.sys]' '\\' '];' 'E+1' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT 1 0 error\n\n\t${WordFind2X} '[io.sys];[C:\\logo.sys]' '[' '];' 'E+2' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT 2 0 error\n\n\t${WordFind2X} '[io.sys];[C:\\logo.sys]' '\\' '];' 'E2' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT 3 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordFind2XS\n\t${StackVerificationStart} WordFind2XS\n\n\t${WordFind2XS} 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' '\\' '.' '/LOGO' $OUT\n\tStrCmp $OUT 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' 0 error\n\n\t${WordFind2XS} 'C:\\WINDOWS C:\\io.sys C:\\logo.sys' '\\' '.' '/logo' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordFind3X\n\t${StackVerificationStart} WordFind3X\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT\n\tStrCmp $OUT '1.AAB' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1' $OUT\n\tStrCmp $OUT '2.BAA' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{{' $OUT\n\tStrCmp $OUT '[1.AAB];' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{}' $OUT\n\tStrCmp $OUT '[1.AAB];[3.BBB];' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '-1{*' $OUT\n\tStrCmp $OUT '[1.AAB];[2.BAA];' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.BAA' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'XX' '];' 'E+1' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '1' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' 'E+3' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '2' 0 error\n\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' 'E3' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '3' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordFind3XS\n\t${StackVerificationStart} WordFind3XS\n\n\t${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.baa' $OUT\n\tStrCmp $OUT '[1.AAB];[2.BAA];[3.BBB];' 0 error\n\n\t${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '/2.BAA' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordReplace\n\t${StackVerificationStart} WordReplace\n\n\t${WordReplace} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 'SYS' 'bmp' '+2' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.bmp C:\\WINDOWS' 0 error\n\n\t${WordReplace} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 'SYS' '' '+' $OUT\n\tStrCmp $OUT 'C:\\io. C:\\logo. C:\\WINDOWS' 0 error\n\n\t${WordReplace} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 'C:\\io.sys' '' '+' $OUT\n\tStrCmp $OUT ' C:\\logo.sys C:\\WINDOWS' 0 error\n\n\t${WordReplace} 'C:\\io.sys      C:\\logo.sys   C:\\WINDOWS' ' ' ' ' '+1*' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.sys   C:\\WINDOWS' 0 error\n\n\t${WordReplace} 'C:\\io.sys C:\\logo.sysSYSsys C:\\WINDOWS' 'sys' 'bmp' '+*' $OUT\n\tStrCmp $OUT 'C:\\io.bmp C:\\logo.bmp C:\\WINDOWS' 0 error\n\n\t${WordReplace} 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 'sys' '|' '{' $OUT\n\tStrCmp $OUT '||C:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 0 error\n\n\t${WordReplace} 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 'sys' '|' '}' $OUT\n\tStrCmp $OUT 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWS|||' 0 error\n\n\t${WordReplace} 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 'sys' '|' '{}' $OUT\n\tStrCmp $OUT '||C:\\io.sys C:\\logo.sys C:\\WINDOWS|||' 0 error\n\n\t${WordReplace} 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 'sys' '|' '{*' $OUT\n\tStrCmp $OUT '|C:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 0 error\n\n\t${WordReplace} 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 'sys' '|' '}*' $OUT\n\tStrCmp $OUT 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWS|' 0 error\n\n\t${WordReplace} 'SYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 'sys' '|' '{}*' $OUT\n\tStrCmp $OUT '|C:\\io.sys C:\\logo.sys C:\\WINDOWS|' 0 error\n\n\t${WordReplace} 'sysSYSsysC:\\io.sys C:\\logo.sys C:\\WINDOWSsysSYSsys' 'sys' '|' '{}*' $OUT\n\tStrCmp $OUT '|C:\\io.sys C:\\logo.sys C:\\WINDOWS|' 0 error\n\n\t${WordReplace} 'C:\\io.sys C:\\logo.sys' '#sys' '|sys|' 'E+1' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '1' 0 error\n\n\t${WordReplace} 'C:\\io.sys C:\\logo.sys' '.sys' '|sys|' 'E+3' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '2' 0 error\n\n\t${WordReplace} 'C:\\io.sys C:\\logo.sys' '.sys' '|sys|' 'E3' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '3' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordReplaceS\n\t${StackVerificationStart} WordReplaceS\n\n\t${WordReplaceS} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 'SYS' 'bmp' '+2' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 0 error\n\n\t${WordReplaceS} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 'sys' 'bmp' '+2' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.bmp C:\\WINDOWS' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordAdd\n\t${StackVerificationStart} WordAdd\n\n\t${WordAdd} 'C:\\io.sys C:\\WINDOWS' ' ' '+C:\\WINDOWS C:\\config.sys' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\WINDOWS C:\\config.sys' 0 error\n\n\t${WordAdd} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' ' ' '-C:\\WINDOWS C:\\config.sys C:\\IO.SYS' $OUT\n\tStrCmp $OUT 'C:\\logo.sys' 0 error\n\n\t${WordAdd} 'C:\\io.sys' ' ' '+C:\\WINDOWS C:\\config.sys C:\\IO.SYS' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\WINDOWS C:\\config.sys' 0 error\n\n\t${WordAdd} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' ' ' '-C:\\WINDOWS' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.sys' 0 error\n\n\t${WordAdd} 'C:\\io.sys C:\\logo.sys' ' ' '+C:\\logo.sys' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.sys' 0 error\n\n\t${WordAdd} 'C:\\io.sys C:\\logo.sys' ' ' 'E-' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.sys' 0 error\n\tIfErrors error\n\n\t${WordAdd} 'C:\\io.sys C:\\logo.sys' '' 'E-C:\\logo.sys' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '1' 0 error\n\n\t${WordAdd} 'C:\\io.sys C:\\logo.sys' '' 'EC:\\logo.sys' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '3' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordAddS\n\t${StackVerificationStart} WordAddS\n\n\t${WordAddS} 'C:\\io.sys C:\\WINDOWS' ' ' '+C:\\windows C:\\config.sys' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\WINDOWS C:\\windows C:\\config.sys' 0 error\n\n\t${WordAddS} 'C:\\io.sys C:\\WINDOWS' ' ' '+C:\\WINDOWS C:\\config.sys' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\WINDOWS C:\\config.sys' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordInsert\n\t${StackVerificationStart} WordInsert\n\n\t${WordInsert} 'C:\\io.sys C:\\WINDOWS' ' ' 'C:\\logo.sys' '-2' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 0 error\n\n\t${WordInsert} 'C:\\io.sys' ' ' 'C:\\WINDOWS' '+2' $OUT\n\tStrCmp $OUT 'C:\\io.sys C:\\WINDOWS' 0 error\n\n\t${WordInsert} '' ' ' 'C:\\WINDOWS' '+1' $OUT\n\tStrCmp $OUT 'C:\\WINDOWS ' 0 error\n\n\t${WordInsert} 'C:\\io.sys C:\\logo.sys' '' 'C:\\logo.sys' 'E+1' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '1' 0 error\n\n\t${WordInsert} 'C:\\io.sys C:\\logo.sys' ' ' 'C:\\logo.sys' 'E+4' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '2' 0 error\n\n\t${WordInsert} 'C:\\io.sys C:\\logo.sys' '' 'C:\\logo.sys' 'E1' $OUT\n\tIfErrors 0 error\n\tStrCmp $OUT '3' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WordInsertS\n\t${StackVerificationStart} WordInsertS\n\n\t${WordInsertS} 'C:\\io.sys x C:\\logo.sys' ' X ' 'C:\\NTLDR' '+2' $OUT\n\tStrCmp $OUT 'C:\\io.sys x C:\\logo.sys X C:\\NTLDR' 0 error\n\n\t${WordInsertS} 'C:\\io.sys x C:\\logo.sys' ' x ' 'C:\\NTLDR' '+2' $OUT\n\tStrCmp $OUT 'C:\\io.sys x C:\\NTLDR x C:\\logo.sys' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection StrFilter\n\t${StackVerificationStart} StrFilter\n\n\t${StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT\n\tIfErrors error\n\tStrCmp $OUT '123ABC 456DEF 7890|%#' 0 error\n\n\t${StrFilter} '123abc 456DEF 7890|%#' '-' 'ef' '' $OUT\n\tIfErrors error\n\tStrCmp $OUT '123abc 456dEF 7890|%#' 0 error\n\n\t${StrFilter} '123abc 456DEF 7890|%#' '2' '|%' '' $OUT\n\tIfErrors error\n\tStrCmp $OUT 'abcDEF|%' 0 error\n\n\t${StrFilter} '123abc 456DEF 7890|%#' '13' 'af' '4590' $OUT\n\tIfErrors error\n\tStrCmp $OUT '123a 6F 78|%#' 0 error\n\n\t${StrFilter} '123abc 456DEF 7890|%#' '+12' 'b' 'def' $OUT\n\tIfErrors error\n\tStrCmp $OUT '123AbC4567890' 0 error\n\n\t${StrFilter} '123abc 456DEF 7890|%#' '+12' 'b' 'def' $OUT\n\tIfErrors error\n\tStrCmp $OUT '123AbC4567890' 0 error\n\n\t${StrFilter} '123abc 456DEF 7890|%#' '123' 'b' 'def' $OUT\n\tIfErrors 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection StrFilterS\n\t${StackVerificationStart} StrFilterS\n\n\t${StrFilterS} '123abc 456DEF 7890|%#' '13' 'af' '4590' $OUT\n\tIfErrors error\n\tStrCmp $OUT '123a 6 78|%#' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection VersionCompare\n\t${StackVerificationStart} VersionCompare\n\n\t${VersionCompare} '1.1.1.9' '1.1.1.01' $OUT\n\tStrCmp $OUT '1' 0 error\n\n\t${VersionCompare} '1.1.1.1' '1.1.1.10' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\t${VersionCompare} '91.1.1.1' '101.1.1.9' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\t${VersionCompare} '1.1.1.1' '1.1.1.1' $OUT\n\tStrCmp $OUT '0' 0 error\n\n\t${VersionCompare} '1.1.1.9' '1.1.1.10' $OUT\n\tStrCmp $OUT '2' 0 error\n\n\t${VersionCompare} '1.1.1.0' '1.1.1' $OUT\n\tStrCmp $OUT '0' 0 error\n\n\t${VersionCompare} '1.1.0.0' '1.1' $OUT\n\tStrCmp $OUT '0' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection VersionConvert\n\t${StackVerificationStart} VersionConvert\n\n\t${VersionConvert} '9.0a' '' $OUT\n\tStrCmp $OUT '9.0.01' 0 error\n\n\t${VersionConvert} '9.0c' '' $OUT\n\tStrCmp $OUT '9.0.03' 0 error\n\n\t${VersionConvert} '0.15c-9m' '' $OUT\n\tStrCmp $OUT '0.15.03.9.13' 0 error\n\n\t${VersionConvert} '0.15c+' 'abcdefghijklmnopqrstuvwxyz+' $OUT\n\tStrCmp $OUT '0.15.0327' 0 error\n\n\t${VersionConvert} '0.0xa12.x.ax|.|.|x|a|.3|a.4.||5.|' '' $OUT\n\tStrCmp $OUT '0.0.2401.12.24.0124.24.01.3.01.4.5' 0 error\n\n\tgoto +2\n\terror:\n\tSetErrors\n\n\t${StackVerificationEnd}\nSectionEnd\n\n\nSection WriteUninstaller\n\tgoto +2\n\tWriteUninstaller '$EXEDIR\\un.WordFuncTest.exe'\nSectionEnd\n\n\n\n;############### UNINSTALL ###############\n\nSection un.Uninstall\n\t${WordFind} 'C:\\io.sys C:\\Program Files C:\\WINDOWS' ' C:\\' '-02' $OUT\n\t${WordFindS} 'C:\\io.sys C:\\Program Files C:\\WINDOWS' ' C:\\' '-02' $OUT\n\t${WordFind2X} '[C:\\io.sys];[C:\\logo.sys];[C:\\WINDOWS]' '[C:\\' '];' '+2' $OUT\n\t${WordFind2XS} '[C:\\io.sys];[C:\\logo.sys];[C:\\WINDOWS]' '[C:\\' '];' '+2' $OUT\n\t${WordFind3X} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT\n\t${WordFind3XS} '[1.AAB];[2.BAA];[3.BBB];' '[' 'AA' '];' '+1' $OUT\n\t${WordReplace} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 'SYS' 'bmp' '+2' $OUT\n\t${WordReplaceS} 'C:\\io.sys C:\\logo.sys C:\\WINDOWS' 'SYS' 'bmp' '+2' $OUT\n\t${WordAdd} 'C:\\io.sys C:\\WINDOWS' ' ' '+C:\\WINDOWS C:\\config.sys' $OUT\n\t${WordAddS} 'C:\\io.sys C:\\WINDOWS' ' ' '+C:\\WINDOWS C:\\config.sys' $OUT\n\t${WordInsert} 'C:\\io.sys C:\\WINDOWS' ' ' 'C:\\logo.sys' '-2' $OUT\n\t${WordInsertS} 'C:\\io.sys C:\\WINDOWS' ' ' 'C:\\logo.sys' '-2' $OUT\n\t${StrFilter} '123abc 456DEF 7890|%#' '+' '' '' $OUT\n\t${StrFilterS} '123abc 456DEF 7890|%#' '+' '' '' $OUT\n\t${VersionCompare} '1.1.1.9' '1.1.1.01' $OUT\n\t${VersionConvert} '9.0a' '' $OUT\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/bigtest.nsi",
    "content": "; bigtest.nsi\n;\n; This script attempts to test most of the functionality of the NSIS exehead.\n\n;--------------------------------\n\n!ifdef HAVE_UPX\n!packhdr tmp.dat \"upx\\upx -9 tmp.dat\"\n!endif\n\n!ifdef NOCOMPRESS\nSetCompress off\n!endif\n\n;--------------------------------\n\nName \"BigNSISTest\"\nCaption \"NSIS Big Test\"\nIcon \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis1-install.ico\"\nOutFile \"bigtest.exe\"\n\nSetDateSave on\nSetDatablockOptimize on\nCRCCheck on\nSilentInstall normal\nBGGradient 000000 800000 FFFFFF\nInstallColors FF8080 000030\nXPStyle on\n\nInstallDir \"$PROGRAMFILES\\NSISTest\\BigNSISTest\"\nInstallDirRegKey HKLM \"Software\\NSISTest\\BigNSISTest\" \"Install_Dir\"\n\nCheckBitmap \"${NSISDIR}\\Contrib\\Graphics\\Checks\\classic-cross.bmp\"\n\nLicenseText \"A test text, make sure it's all there\"\nLicenseData \"bigtest.nsi\"\n\nRequestExecutionLevel admin\nManifestSupportedOS all\n\n;--------------------------------\n\nPage license\nPage components\nPage directory\nPage instfiles\n\nUninstPage uninstConfirm\nUninstPage instfiles\n\n;--------------------------------\n\n!ifndef NOINSTTYPES ; only if not defined\n  InstType \"Most\"\n  InstType \"Full\"\n  InstType \"More\"\n  InstType \"Base\"\n  ;InstType /NOCUSTOM\n  ;InstType /COMPONENTSONLYONCUSTOM\n!endif\n\nAutoCloseWindow false\nShowInstDetails show\n\n;--------------------------------\n\nSection \"\" ; empty string makes it hidden, so would starting with -\n\n  ; write reg info\n  StrCpy $1 \"Hello World\"\n  DetailPrint \"I like to be able to see what is going on (debug) $1\"\n  WriteRegStr HKLM SOFTWARE\\NSISTest\\BigNSISTest \"Install_Dir\" \"$INSTDIR\"\n\n  ; write uninstall strings\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BigNSISTest\" \"DisplayName\" \"BigNSISTest (remove only)\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BigNSISTest\" \"UninstallString\" '\"$INSTDIR\\bt-uninst.exe\"'\n\n  SetOutPath $INSTDIR\n  File /a \"silent.nsi\"\n  CreateDirectory \"$INSTDIR\\MyProjectFamily\\MyProject\" ; 2 recursively create a directory for fun.\n  WriteUninstaller \"$INSTDIR\\bt-uninst.exe\"\n  \n  Nop ; for fun\n\nSectionEnd\n\nSection \"TempTest\"\n\nSectionIn 1 2 3\n  Start: MessageBox MB_OK \"Start:\"\n\n  MessageBox MB_YESNO \"Goto MyLabel\" IDYES MyLabel\n\n  MessageBox MB_OK \"Right before MyLabel:\"\n\n  MyLabel: MessageBox MB_OK \"MyLabel:\"\n  \n  MessageBox MB_OK \"Right after MyLabel:\"\n\n  MessageBox MB_YESNO \"Goto Start:?\" IDYES Start\n\nSectionEnd\n\nSectionGroup /e SectionGroup1\n\nSection \"Test Registry/INI functions\"\n\nSectionIn 1 4 3\n\n  WriteRegStr HKLM SOFTWARE\\NSISTest\\BigNSISTest \"StrTest_INSTDIR\" \"$INSTDIR\"\n  WriteRegDword HKLM SOFTWARE\\NSISTest\\BigNSISTest \"DwordTest_0xDEADBEEF\" 0xdeadbeef\n  WriteRegDword HKLM SOFTWARE\\NSISTest\\BigNSISTest \"DwordTest_123456\" 123456\n  WriteRegDword HKLM SOFTWARE\\NSISTest\\BigNSISTest \"DwordTest_0123\" 0123\n  WriteRegBin HKLM SOFTWARE\\NSISTest\\BigNSISTest \"BinTest_deadbeef01f00dbeef\" \"DEADBEEF01F00DBEEF\"\n  StrCpy $8 \"$SYSDIR\\IniTest\"\n  WriteINIStr \"$INSTDIR\\test.ini\"  \"MySection\" \"Value1\" $8\n  WriteINIStr \"$INSTDIR\\test.ini\"  \"MySectionIni\" \"Value1\" $8\n  WriteINIStr \"$INSTDIR\\test.ini\"  \"MySectionIni\" \"Value2\" $8\n  WriteINIStr \"$INSTDIR\\test.ini\"  \"IniOn\" \"Value1\" $8\n\n  Call MyFunctionTest\n\n  DeleteINIStr \"$INSTDIR\\test.ini\" \"IniOn\" \"Value1\"\n  DeleteINISec \"$INSTDIR\\test.ini\" \"MySectionIni\"\n\n  ReadINIStr $1 \"$INSTDIR\\test.ini\" \"MySectionIni\" \"Value1\"\n  StrCmp $1 \"\" INIDelSuccess\n    MessageBox MB_OK \"DeleteINISec failed\"\n  INIDelSuccess:\n\n  ClearErrors\n  ReadRegStr $1 HKCR \"software\\microsoft\" xyz_cc_does_not_exist\n  IfErrors 0 NoError\n    MessageBox MB_OK \"could not read from HKCR\\software\\microsoft\\xyz_cc_does_not_exist\"\n    Goto ErrorYay\n  NoError:\n    MessageBox MB_OK \"read '$1' from HKCR\\software\\microsoft\\xyz_cc_does_not_exist\"\n  ErrorYay:\n  \nSectionEnd\n\nSection \"Test CreateShortcut\"\n\n  SectionIn 1 2 3\n\n  Call CSCTest\n\nSectionEnd\n\nSectionGroup Group2\n\n!define ASSERT `!insertmacro ASSERT \"${U+24}{__FILE__}\" ${U+24}{__LINE__} `\n!macro ASSERT __file __line __xpr\n${__xpr} +2\nMessageBox MB_ICONSTOP `ASSERT: ${__xpr} (${__file}:${__line})`\n!macroend\n\nSection \"Integer\"\nIntOp $0 0xffffffff >> 31\n${ASSERT} `IntCmpU $0 -1`\nIntOp $0 0xffffffff >>> 31\n${ASSERT} `IntCmpU $0 1`\nIntOp $0 1 << 31\n${ASSERT} `IntCmpU $0 0x80000000`\nIntOp $0 0x80000000 ^ 0x40000000\n${ASSERT} `IntCmpU $0 0xC0000000`\nClearErrors\nIntOp $0 1 / 0\n${ASSERT} `IfErrors ` ; Division by zero must set the error flag\n${ASSERT} `IntCmpU $0 0` ; Unspecified result, hopefully it's zero\nSectionEnd\n\nSection \"Test Branching\" \n  \n  BeginTestSection:\n  SectionIn 1 2 3\n \n  SetOutPath $INSTDIR\n\n  IfFileExists \"$INSTDIR\\LogicLib.nsi\" 0 BranchTest69\n    \n    MessageBox MB_YESNO|MB_ICONQUESTION \"Would you like to overwrite $INSTDIR\\LogicLib.nsi?\" IDNO NoOverwrite ; skipped if file doesn't exist\n\n    BranchTest69:\n  \n    SetOverwrite ifnewer ; NOT AN INSTRUCTION, NOT COUNTED IN SKIPPINGS\n\n  NoOverwrite:\n\n  File \"LogicLib.nsi\" ; skipped if answered no\n  SetOverwrite try ; NOT AN INSTRUCTION, NOT COUNTED IN SKIPPINGS\n\n  MessageBox MB_YESNO|MB_ICONQUESTION \"Would you like to skip the rest of this section?\" IDYES EndTestBranch\n  MessageBox MB_YESNO|MB_ICONQUESTION \"Would you like to go back to the beginning of this section?\" IDYES BeginTestSection\n  MessageBox MB_YESNO|MB_ICONQUESTION \"Would you like to hide the installer and wait five seconds?\" IDNO NoHide\n\n    HideWindow\n    Sleep 5000\n    BringToFront\n\n  NoHide:\n\n  MessageBox MB_YESNO|MB_ICONQUESTION \"Would you like to call the function 5 times?\" IDNO NoRecurse\n\n    StrCpy $1 \"x\"\n\n  LoopTest: \n      \n    Call myfunc\n    StrCpy $1 \"x$1\"\n    StrCmp $1 \"xxxxxx\" 0 LoopTest\n      \n  NoRecurse:\n\n  EndTestBranch:\n\nSectionEnd\n\nSectionGroupEnd\n\nSection \"Test CopyFiles\"\n\n  SectionIn 1 2 3\n\n  SetOutPath $INSTDIR\\cpdest\n  CopyFiles \"$WINDIR\\*.ini\" \"$INSTDIR\\cpdest\" 0\n\nSectionEnd\n\nSectionGroupEnd\n\nSection \"Test Exec functions\" TESTIDX\n\n  SectionIn 1 2 3\n  \n  SearchPath $1 notepad.exe\n\n  MessageBox MB_OK \"notepad.exe=$1\"\n  Exec '\"$1\"'\n  ExecShell \"open\" '\"$INSTDIR\"'\n  Sleep 500\n  BringToFront\n\nSectionEnd\n\nSection \"Test ActiveX control registration\"\n\n  SectionIn 2\n\n  UnRegDLL \"$SYSDIR\\spin32.ocx\"\n  Sleep 1000\n  RegDLL \"$SYSDIR\\spin32.ocx\"\n  Sleep 1000\n  \nSectionEnd\n\n;--------------------------------\n\nFunction \"CSCTest\"\n  \n  CreateDirectory \"$SMPROGRAMS\\Big NSIS Test\"\n  SetOutPath $INSTDIR ; for working directory\n  CreateShortcut \"$SMPROGRAMS\\Big NSIS Test\\Uninstall BIG NSIS Test.lnk\" \"$INSTDIR\\bt-uninst.exe\" ; use defaults for parameters, icon, etc.\n  ; this one will use notepad's icon, start it minimized, and give it a hotkey (of Ctrl+Shift+Q)\n  CreateShortcut \"$SMPROGRAMS\\Big NSIS Test\\silent.nsi.lnk\" \"$INSTDIR\\silent.nsi\" \"\" \"$WINDIR\\notepad.exe\" 0 SW_SHOWMINIMIZED CONTROL|SHIFT|Q\n  CreateShortcut \"$SMPROGRAMS\\Big NSIS Test\\TheDir.lnk\" \"$INSTDIR\\\" \"\" \"\" 0 SW_SHOWMAXIMIZED CONTROL|SHIFT|Z\n\nFunctionEnd\n\nFunction myfunc\n\n  StrCpy $2 \"MyTestVar=$1\"\n  MessageBox MB_OK \"myfunc: $2\"\n\nFunctionEnd\n\nFunction MyFunctionTest\n\n  ReadINIStr $1 \"$INSTDIR\\test.ini\" \"MySectionIni\" \"Value1\"\n  StrCmp $1 $8 NoFailedMsg\n    MessageBox MB_OK \"WriteINIStr failed\"\n  \n  NoFailedMsg:\n\nFunctionEnd\n\nFunction .onSelChange\n\n  SectionGetText ${TESTIDX} $0\n  StrCmp $0 \"\" e\n    SectionSetText ${TESTIDX} \"\"\n  Goto e2\ne:\n  SectionSetText ${TESTIDX} \"TextInSection\"\ne2:\n\nFunctionEnd\n\n;--------------------------------\n\n; Uninstaller\n\nUninstallText \"This will uninstall example2. Hit next to continue.\"\nUninstallIcon \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis1-uninstall.ico\"\n\nSection \"Uninstall\"\n\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\BigNSISTest\"\n  DeleteRegKey HKLM \"SOFTWARE\\NSISTest\\BigNSISTest\"\n  Delete \"$INSTDIR\\silent.nsi\"\n  Delete \"$INSTDIR\\LogicLib.nsi\"\n  Delete \"$INSTDIR\\bt-uninst.exe\"\n  Delete \"$INSTDIR\\test.ini\"\n  Delete \"$SMPROGRAMS\\Big NSIS Test\\*.*\"\n  RMDir \"$SMPROGRAMS\\BiG NSIS Test\"\n  \n  MessageBox MB_YESNO|MB_ICONQUESTION \"Would you like to remove the directory $INSTDIR\\cpdest?\" IDNO NoDelete\n    Delete \"$INSTDIR\\cpdest\\*.*\"\n    RMDir \"$INSTDIR\\cpdest\" ; skipped if no\n  NoDelete:\n  \n  RMDir \"$INSTDIR\\MyProjectFamily\\MyProject\"\n  RMDir \"$INSTDIR\\MyProjectFamily\"\n  RMDir \"$INSTDIR\"\n\n  IfFileExists \"$INSTDIR\" 0 NoErrorMsg\n    MessageBox MB_OK \"Note: $INSTDIR could not be removed!\" IDOK 0 ; skipped if file doesn't exist\n  NoErrorMsg:\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/example1.nsi",
    "content": "; example1.nsi\n;\n; This script is perhaps one of the simplest NSIs you can make. All of the\n; optional settings are left to their default settings. The installer simply \n; prompts the user asking them where to install, and drops a copy of example1.nsi\n; there. \n;\n; example2.nsi expands on this by adding a uninstaller and start menu shortcuts.\n\n;--------------------------------\n\n; The name of the installer\nName \"Example1\"\n\n; The file to write\nOutFile \"example1.exe\"\n\n; Request application privileges for Windows Vista\nRequestExecutionLevel user\n\n; Build Unicode installer\nUnicode True\n\n; The default installation directory\nInstallDir $DESKTOP\\Example1\n\n;--------------------------------\n\n; Pages\n\nPage directory\nPage instfiles\n\n;--------------------------------\n\n; The stuff to install\nSection \"\" ;No components page, name is not important\n\n  ; Set output path to the installation directory.\n  SetOutPath $INSTDIR\n  \n  ; Put file there\n  File example1.nsi\n  \nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/example2.nsi",
    "content": "; example2.nsi\n;\n; This script is based on example1.nsi, but it remember the directory, \n; has uninstall support and (optionally) installs start menu shortcuts.\n;\n; It will install example2.nsi into a directory that the user selects.\n;\n; See install-shared.nsi for a more robust way of checking for administrator rights.\n; See install-per-user.nsi for a file association example.\n\n;--------------------------------\n\n; The name of the installer\nName \"Example2\"\n\n; The file to write\nOutFile \"example2.exe\"\n\n; Request application privileges for Windows Vista and higher\nRequestExecutionLevel admin\n\n; Build Unicode installer\nUnicode True\n\n; The default installation directory\nInstallDir $PROGRAMFILES\\Example2\n\n; Registry key to check for directory (so if you install again, it will \n; overwrite the old one automatically)\nInstallDirRegKey HKLM \"Software\\NSIS_Example2\" \"Install_Dir\"\n\n;--------------------------------\n\n; Pages\n\nPage components\nPage directory\nPage instfiles\n\nUninstPage uninstConfirm\nUninstPage instfiles\n\n;--------------------------------\n\n; The stuff to install\nSection \"Example2 (required)\"\n\n  SectionIn RO\n  \n  ; Set output path to the installation directory.\n  SetOutPath $INSTDIR\n  \n  ; Put file there\n  File \"example2.nsi\"\n  \n  ; Write the installation path into the registry\n  WriteRegStr HKLM SOFTWARE\\NSIS_Example2 \"Install_Dir\" \"$INSTDIR\"\n  \n  ; Write the uninstall keys for Windows\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Example2\" \"DisplayName\" \"NSIS Example2\"\n  WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Example2\" \"UninstallString\" '\"$INSTDIR\\uninstall.exe\"'\n  WriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Example2\" \"NoModify\" 1\n  WriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Example2\" \"NoRepair\" 1\n  WriteUninstaller \"$INSTDIR\\uninstall.exe\"\n  \nSectionEnd\n\n; Optional section (can be disabled by the user)\nSection \"Start Menu Shortcuts\"\n\n  CreateDirectory \"$SMPROGRAMS\\Example2\"\n  CreateShortcut \"$SMPROGRAMS\\Example2\\Uninstall.lnk\" \"$INSTDIR\\uninstall.exe\"\n  CreateShortcut \"$SMPROGRAMS\\Example2\\Example2 (MakeNSISW).lnk\" \"$INSTDIR\\example2.nsi\"\n\nSectionEnd\n\n;--------------------------------\n\n; Uninstaller\n\nSection \"Uninstall\"\n  \n  ; Remove registry keys\n  DeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Example2\"\n  DeleteRegKey HKLM SOFTWARE\\NSIS_Example2\n\n  ; Remove files and uninstaller\n  Delete $INSTDIR\\example2.nsi\n  Delete $INSTDIR\\uninstall.exe\n\n  ; Remove shortcuts, if any\n  Delete \"$SMPROGRAMS\\Example2\\*.lnk\"\n\n  ; Remove directories\n  RMDir \"$SMPROGRAMS\\Example2\"\n  RMDir \"$INSTDIR\"\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/gfx.nsi",
    "content": "; gfx.nsi\n;\n; This script shows some examples of using all of the new\n; graphic related additions introduced in NSIS 2\n;\n; Written by Amir Szkeley 22nd July 2002\n\n;--------------------------------\n\n!macro BIMAGE IMAGE PARMS\n\tPush $0\n\tGetTempFileName $0\n\tFile /oname=$0 \"${IMAGE}\"\n\tSetBrandingImage ${PARMS} $0\n\tDelete $0\n\tPop $0\n!macroend\n\n;--------------------------------\n\nName \"Graphical effects\"\n\nOutFile \"gfx.exe\"\n\n; Adds an XP manifest to the installer\nXPStyle on\n\n; Add branding image to the installer (an image placeholder on the side).\n; It is not enough to just add the placeholder, we must set the image too...\n; We will later set the image in every pre-page function.\n; We can also set just one persistent image in .onGUIInit\nAddBrandingImage left 100u\n\n; Sets the font of the installer\nSetFont \"Comic Sans MS\" 8\n\n; Just to make it three pages...\nSubCaption 0 \": Yet another page...\"\nSubCaption 2 \": Yet another page...\"\nLicenseText \"License page\"\nLicenseData \"gfx.nsi\"\nDirText \"Lets make a third page!\"\n\n; Install dir\nInstallDir \"${NSISDIR}\\Examples\"\n\n; Request application privileges for Windows Vista\nRequestExecutionLevel user\n\n;--------------------------------\n\n; Pages\nPage license licenseImage\nPage custom customPage\nPage directory dirImage\nPage instfiles instImage\n\n;--------------------------------\n\nSection \"\"\n\t; You can also use the BI_NEXT macro here...\n\tMessageBox MB_YESNO \"We can change the branding image from within a section too!$\\nDo you want me to change it?\" IDNO done\n\t\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis.bmp\" \"\"\n\tdone:\n\tWriteUninstaller $INSTDIR\\uninst.exe\nSectionEnd\n\n;--------------------------------\n\nFunction licenseImage\n\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis.bmp\" /RESIZETOFIT\n\tMessageBox MB_YESNO 'Would you like to skip the license page?' IDNO no\n\t\tAbort\n\tno:\nFunctionEnd\n\nFunction customPage\n\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\" /RESIZETOFIT\n\tMessageBox MB_OK 'This is a nice custom \"page\" with yet another image :P'\n\t#insert install options/start menu/<insert plugin name here> here\nFunctionEnd\n\nFunction dirImage\n\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Header\\win.bmp\" /RESIZETOFIT\nFunctionEnd\n\nFunction instImage\n\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\llama.bmp\" /RESIZETOFIT\nFunctionEnd\n\n;--------------------------------\n\n; Uninstall pages\n\nUninstPage uninstConfirm un.uninstImage\nUninstPage custom un.customPage\nUninstPage instfiles un.instImage\n\nFunction un.uninstImage\n\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Checks\\modern.bmp\" /RESIZETOFIT\nFunctionEnd\n\nFunction un.customPage\n\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Header\\win.bmp\" /RESIZETOFIT\n\tMessageBox MB_OK 'This is a nice uninstaller custom \"page\" with yet another image :P'\n\t#insert install options/start menu/<insert plugin name here> here\nFunctionEnd\n\nFunction un.instImage\n\t!insertmacro BIMAGE \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\llama.bmp\" /RESIZETOFIT\nFunctionEnd\n\n;--------------------------------\n\n; Uninstaller\n\n; Another page for uninstaller\nUninstallText \"Another page...\"\n\nSection uninstall\n\tMessageBox MB_OK \"Bla\"\nSectionEnd\n\n"
  },
  {
    "path": "setup/nsis/tools/Examples/install-per-user.nsi",
    "content": "/*\n\nThis example script installs a simple application for a single user.\n\nIf multiple users on the same machine run this installer, each user\nwill end up with a separate install that is not affected by\nupdate/removal operations performed by other users.\n\nPer-user installers should only write to HKCU and \nfolders inside the users profile.\n\n*/\n\n!define NAME \"Per-user example\"\n!define REGPATH_UNINSTSUBKEY \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\nName \"${NAME}\"\nOutFile \"Install ${NAME}.exe\"\nUnicode True\nRequestExecutionLevel User ; We don't need UAC elevation\nInstallDir \"\" ; Don't set a default $InstDir so we can detect /D= and InstallDirRegKey\nInstallDirRegKey HKCU \"${REGPATH_UNINSTSUBKEY}\" \"UninstallString\"\n\n!include LogicLib.nsh\n!include WinCore.nsh\n!include Integration.nsh\n\n\nPage Directory\nPage InstFiles\n\nUninstpage UninstConfirm\nUninstpage InstFiles\n\n\nFunction .onInit\n  SetShellVarContext Current\n\n  ${If} $InstDir == \"\" ; No /D= nor InstallDirRegKey?\n    GetKnownFolderPath $InstDir ${FOLDERID_UserProgramFiles} ; This folder only exists on Win7+\n    StrCmp $InstDir \"\" 0 +2 \n    StrCpy $InstDir \"$LocalAppData\\Programs\" ; Fallback directory\n\n    StrCpy $InstDir \"$InstDir\\$(^Name)\"\n  ${EndIf}\nFunctionEnd\n\nFunction un.onInit\n  SetShellVarContext Current\nFunctionEnd\n\n\nSection \"Program files (Required)\"\n  SectionIn Ro\n\n  SetOutPath $InstDir\n  WriteUninstaller \"$InstDir\\Uninst.exe\"\n  WriteRegStr HKCU \"${REGPATH_UNINSTSUBKEY}\" \"DisplayName\" \"${NAME}\"\n  WriteRegStr HKCU \"${REGPATH_UNINSTSUBKEY}\" \"DisplayIcon\" \"$InstDir\\MyApp.exe,0\"\n  WriteRegStr HKCU \"${REGPATH_UNINSTSUBKEY}\" \"UninstallString\" '\"$InstDir\\Uninst.exe\"'\n  WriteRegStr HKCU \"${REGPATH_UNINSTSUBKEY}\" \"QuietUninstallString\" '\"$InstDir\\Uninst.exe\" /S'\n  WriteRegDWORD HKCU \"${REGPATH_UNINSTSUBKEY}\" \"NoModify\" 1\n  WriteRegDWORD HKCU \"${REGPATH_UNINSTSUBKEY}\" \"NoRepair\" 1\n\n  !tempfile APP\n  !makensis '-v2 \"-DOUTFILE=${APP}\" \"-DNAME=NSISPerUserAppExample\" -DCOMPANY=Nullsoft \"AppGen.nsi\"' = 0\n  File \"/oname=$InstDir\\MyApp.exe\" \"${APP}\" ; Pretend that we have a real application to install\n  !delfile \"${APP}\"\nSectionEnd\n\nSection \"Start Menu shortcut\"\n  CreateShortcut /NoWorkingDir \"$SMPrograms\\${NAME}.lnk\" \"$InstDir\\MyApp.exe\"\nSectionEnd\n\n/*\nThis Section registers a fictional .test-nullsoft file extension and the Nullsoft.Test ProgId. \nProprietary file types are encouraged (by Microsoft) to use long file extensions and ProgIds that include the company name.\n\nWhen registering with \"Open With\" your executable should ideally have a somewhat unique name, \notherwise there could be a naming collision with a different application (with the same name) installed on the same machine.\n\nREGISTER_DEFAULTPROGRAMS is not defined because proprietary file types do not typically use the Default Programs functionality. \nIf your application registers a standard file type such as .mp3 or .html or a protocol like HTTP it should register as a Default Program. \nIt should also register as a client (https://docs.microsoft.com/en-us/windows/win32/shell/reg-middleware-apps#common-registration-elements-for-all-client-types).\n*/\n!define ASSOC_EXT \".test-nullsoft\"\n!define ASSOC_PROGID \"Nullsoft.Test\"\n!define ASSOC_VERB \"MyApp\"\n!define ASSOC_APPEXE \"MyApp.exe\"\nSection -ShellAssoc\n  # Register file type\n  WriteRegStr ShCtx \"Software\\Classes\\${ASSOC_PROGID}\\DefaultIcon\" \"\" \"$InstDir\\${ASSOC_APPEXE},0\"\n  ;WriteRegStr ShCtx \"Software\\Classes\\${ASSOC_PROGID}\\shell\\${ASSOC_VERB}\" \"\" \"Nullsoft Test App\" [Optional]\n  ;WriteRegStr ShCtx \"Software\\Classes\\${ASSOC_PROGID}\\shell\\${ASSOC_VERB}\" \"MUIVerb\" \"@$InstDir\\${ASSOC_APPEXE},-42\" ; WinXP+ [Optional] Localizable verb display name\n  WriteRegStr ShCtx \"Software\\Classes\\${ASSOC_PROGID}\\shell\\${ASSOC_VERB}\\command\" \"\" '\"$InstDir\\${ASSOC_APPEXE}\" \"%1\"'\n  WriteRegStr ShCtx \"Software\\Classes\\${ASSOC_EXT}\" \"\" \"${ASSOC_PROGID}\"\n\n  # Register \"Open With\" [Optional]\n  WriteRegNone ShCtx \"Software\\Classes\\${ASSOC_EXT}\\OpenWithList\" \"${ASSOC_APPEXE}\" ; Win2000+ [Optional]\n  ;WriteRegNone ShCtx \"Software\\Classes\\${ASSOC_EXT}\\OpenWithProgids\" \"${ASSOC_PROGID}\" ; WinXP+ [Optional]\n  WriteRegStr ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\\shell\\open\\command\" \"\" '\"$InstDir\\${ASSOC_APPEXE}\" \"%1\"'\n  WriteRegStr ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\" \"FriendlyAppName\" \"Nullsoft Test App\" ; [Optional]\n  WriteRegStr ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\" \"ApplicationCompany\" \"Nullsoft\" ; [Optional]\n  WriteRegNone ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\\SupportedTypes\" \"${ASSOC_EXT}\" ; [Optional] Only allow \"Open With\" with specific extension(s) on WinXP+\n\n  # Register \"Default Programs\" [Optional]\n  !ifdef REGISTER_DEFAULTPROGRAMS\n  WriteRegStr ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\\Capabilities\" \"ApplicationDescription\" \"Shell association example test application\"\n  WriteRegStr ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\\Capabilities\\FileAssociations\" \"${ASSOC_EXT}\" \"${ASSOC_PROGID}\"\n  WriteRegStr ShCtx \"Software\\RegisteredApplications\" \"Nullsoft Test App\" \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\\Capabilities\"\n  !endif\n\n  ${NotifyShell_AssocChanged}\nSectionEnd\n\n\nSection -un.ShellAssoc\n  # Unregister file type\n  ClearErrors\n  DeleteRegKey ShCtx \"Software\\Classes\\${ASSOC_PROGID}\\shell\\${ASSOC_VERB}\"\n  DeleteRegKey /IfEmpty ShCtx \"Software\\Classes\\${ASSOC_PROGID}\\shell\"\n  ${IfNot} ${Errors}\n    DeleteRegKey ShCtx \"Software\\Classes\\${ASSOC_PROGID}\\DefaultIcon\"\n  ${EndIf}\n  ReadRegStr $0 ShCtx \"Software\\Classes\\${ASSOC_EXT}\" \"\"\n  DeleteRegKey /IfEmpty ShCtx \"Software\\Classes\\${ASSOC_PROGID}\"\n  ${IfNot} ${Errors}\n  ${AndIf} $0 == \"${ASSOC_PROGID}\"\n    DeleteRegValue ShCtx \"Software\\Classes\\${ASSOC_EXT}\" \"\"\n    DeleteRegKey /IfEmpty ShCtx \"Software\\Classes\\${ASSOC_EXT}\"\n  ${EndIf}\n\n  # Unregister \"Open With\"\n  DeleteRegKey ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\"\n  DeleteRegValue ShCtx \"Software\\Classes\\${ASSOC_EXT}\\OpenWithList\" \"${ASSOC_APPEXE}\"\n  DeleteRegKey /IfEmpty ShCtx \"Software\\Classes\\${ASSOC_EXT}\\OpenWithList\"\n  DeleteRegValue ShCtx \"Software\\Classes\\${ASSOC_EXT}\\OpenWithProgids\" \"${ASSOC_PROGID}\"\n  DeleteRegKey /IfEmpty ShCtx \"Software\\Classes\\${ASSOC_EXT}\\OpenWithProgids\"\n  DeleteRegKey /IfEmpty  ShCtx \"Software\\Classes\\${ASSOC_EXT}\"\n\n  # Unregister \"Default Programs\"\n  !ifdef REGISTER_DEFAULTPROGRAMS\n  DeleteRegValue ShCtx \"Software\\RegisteredApplications\" \"Nullsoft Test App\"\n  DeleteRegKey ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\\Capabilities\"\n  DeleteRegKey /IfEmpty ShCtx \"Software\\Classes\\Applications\\${ASSOC_APPEXE}\"\n  !endif\n\n  # Attempt to clean up junk left behind by the Windows shell\n  DeleteRegValue HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Search\\JumplistData\" \"$InstDir\\${ASSOC_APPEXE}\"\n  DeleteRegValue HKCU \"Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\MuiCache\" \"$InstDir\\${ASSOC_APPEXE}.FriendlyAppName\"\n  DeleteRegValue HKCU \"Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\MuiCache\" \"$InstDir\\${ASSOC_APPEXE}.ApplicationCompany\"\n  DeleteRegValue HKCU \"Software\\Microsoft\\Windows\\ShellNoRoam\\MUICache\" \"$InstDir\\${ASSOC_APPEXE}\" ; WinXP\n  DeleteRegValue HKCU \"Software\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Compatibility Assistant\\Store\" \"$InstDir\\${ASSOC_APPEXE}\"\n  DeleteRegValue HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\ApplicationAssociationToasts\" \"${ASSOC_PROGID}_${ASSOC_EXT}\"\n  DeleteRegValue HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\ApplicationAssociationToasts\" \"Applications\\${ASSOC_APPEXE}_${ASSOC_EXT}\"\n  DeleteRegValue HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\${ASSOC_EXT}\\OpenWithProgids\" \"${ASSOC_PROGID}\"\n  DeleteRegKey /IfEmpty HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\${ASSOC_EXT}\\OpenWithProgids\"\n  DeleteRegKey /IfEmpty HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\${ASSOC_EXT}\\OpenWithList\"\n  DeleteRegKey /IfEmpty HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\${ASSOC_EXT}\"\n  ;DeleteRegKey HKCU \"Software\\Microsoft\\Windows\\Roaming\\OpenWith\\FileExts\\${ASSOC_EXT}\"\n  ;DeleteRegKey HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RecentDocs\\${ASSOC_EXT}\"\n\n  ${NotifyShell_AssocChanged}\nSectionEnd\n\n!macro DeleteFileOrAskAbort path\n  ClearErrors\n  Delete \"${path}\"\n  IfErrors 0 +3\n    MessageBox MB_ABORTRETRYIGNORE|MB_ICONSTOP 'Unable to delete \"${path}\"!' IDRETRY -3 IDIGNORE +2\n    Abort \"Aborted\"\n!macroend\n\nSection -Uninstall\n  !insertmacro DeleteFileOrAskAbort \"$InstDir\\MyApp.exe\"\n  Delete \"$InstDir\\Uninst.exe\"\n  RMDir \"$InstDir\"\n  DeleteRegKey HKCU \"${REGPATH_UNINSTSUBKEY}\"\n\n  ${UnpinShortcut} \"$SMPrograms\\${NAME}.lnk\"\n  Delete \"$SMPrograms\\${NAME}.lnk\"\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/install-shared.nsi",
    "content": "/*\n\nThis example script installs a simple application for all users on a machine.\n\nAll-users installers should only write to HKLM, $ProgramFiles, $CommonFiles and the \n\"All context\" versions of $LocalAppData, $Templates, $SMPrograms etc.\n\nIt should not write to HKCU nor any folders in the users profile!\nIf the application requires writable template data in $AppData it \nmust copy the required files from a shared location the \nfirst time a user launches the application.\n\n*/\n\n!define NAME \"All-users example\"\n!define REGPATH_UNINSTSUBKEY \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${NAME}\"\nName \"${NAME}\"\nOutFile \"Install ${NAME}.exe\"\nUnicode True\nRequestExecutionLevel Admin ; Request admin rights on WinVista+ (when UAC is turned on)\nInstallDir \"$ProgramFiles\\$(^Name)\"\nInstallDirRegKey HKLM \"${REGPATH_UNINSTSUBKEY}\" \"UninstallString\"\n\n!include LogicLib.nsh\n!include Integration.nsh\n\n\nPage Directory\nPage InstFiles\n\nUninstpage UninstConfirm\nUninstpage InstFiles\n\n\n!macro EnsureAdminRights\n  UserInfo::GetAccountType\n  Pop $0\n  ${If} $0 != \"admin\" ; Require admin rights on WinNT4+\n    MessageBox MB_IconStop \"Administrator rights required!\"\n    SetErrorLevel 740 ; ERROR_ELEVATION_REQUIRED\n    Quit\n  ${EndIf}\n!macroend\n\nFunction .onInit\n  SetShellVarContext All\n  !insertmacro EnsureAdminRights\nFunctionEnd\n\nFunction un.onInit\n  SetShellVarContext All\n  !insertmacro EnsureAdminRights\nFunctionEnd\n\n\nSection \"Program files (Required)\"\n  SectionIn Ro\n\n  SetOutPath $InstDir\n  WriteUninstaller \"$InstDir\\Uninst.exe\"\n  WriteRegStr HKLM \"${REGPATH_UNINSTSUBKEY}\" \"DisplayName\" \"${NAME}\"\n  WriteRegStr HKLM \"${REGPATH_UNINSTSUBKEY}\" \"DisplayIcon\" \"$InstDir\\MyApp.exe,0\"\n  WriteRegStr HKLM \"${REGPATH_UNINSTSUBKEY}\" \"UninstallString\" '\"$InstDir\\Uninst.exe\"'\n  WriteRegStr HKLM \"${REGPATH_UNINSTSUBKEY}\" \"QuietUninstallString\" '\"$InstDir\\Uninst.exe\" /S'\n  WriteRegDWORD HKLM \"${REGPATH_UNINSTSUBKEY}\" \"NoModify\" 1\n  WriteRegDWORD HKLM \"${REGPATH_UNINSTSUBKEY}\" \"NoRepair\" 1\n\n  !tempfile APP\n  !makensis '-v2 \"-DOUTFILE=${APP}\" \"-DNAME=NSISSharedAppExample\" -DCOMPANY=Nullsoft \"AppGen.nsi\"' = 0\n  File \"/oname=$InstDir\\MyApp.exe\" \"${APP}\" ; Pretend that we have a real application to install\n  !delfile \"${APP}\"\nSectionEnd\n\nSection \"Start Menu shortcut\"\n  CreateShortcut /NoWorkingDir \"$SMPrograms\\${NAME}.lnk\" \"$InstDir\\MyApp.exe\"\nSectionEnd\n\n\n!macro DeleteFileOrAskAbort path\n  ClearErrors\n  Delete \"${path}\"\n  IfErrors 0 +3\n    MessageBox MB_ABORTRETRYIGNORE|MB_ICONSTOP 'Unable to delete \"${path}\"!' IDRETRY -3 IDIGNORE +2\n    Abort \"Aborted\"\n!macroend\n\nSection -Uninstall\n  !insertmacro DeleteFileOrAskAbort \"$InstDir\\MyApp.exe\"\n  Delete \"$InstDir\\Uninst.exe\"\n  RMDir \"$InstDir\"\n  DeleteRegKey HKLM \"${REGPATH_UNINSTSUBKEY}\"\n\n  ${UnpinShortcut} \"$SMPrograms\\${NAME}.lnk\"\n  Delete \"$SMPrograms\\${NAME}.lnk\"\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/languages.nsi",
    "content": "; languages.nsi\n;\n; This is an example of a multilingual installer\n; The user can select the language on startup\n\n!pragma warning error all\n\n;--------------------------------\n\nOutFile languages.exe\n\nXPStyle on\n\nRequestExecutionLevel user\n\nUnicode True\n;--------------------------------\n\nPage license\nPage components\nPage instfiles\n\n;--------------------------------\n\n; First is default\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\English.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\Czech.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\Dutch.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\French.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\German.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\Korean.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\Russian.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\Spanish.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\Swedish.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\TradChinese.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\SimpChinese.nlf\"\nLoadLanguageFile \"${NSISDIR}\\Contrib\\Language files\\Slovak.nlf\"\n\n; License data\n; Not exactly translated, but it shows what's needed\nLicenseLangString myLicenseData ${LANG_ENGLISH} \"bigtest.nsi\"\nLicenseLangString myLicenseData ${LANG_CZECH} \"WordFuncTest.nsi\"\nLicenseLangString myLicenseData ${LANG_DUTCH} \"waplugin.nsi\"\nLicenseLangString myLicenseData ${LANG_FRENCH} \"example1.nsi\"\nLicenseLangString myLicenseData ${LANG_GERMAN} \"example2.nsi\"\nLicenseLangString myLicenseData ${LANG_KOREAN} \"gfx.nsi\"\nLicenseLangString myLicenseData ${LANG_RUSSIAN} \"languages.nsi\"\nLicenseLangString myLicenseData ${LANG_SPANISH} \"LogicLib.nsi\"\nLicenseLangString myLicenseData ${LANG_SWEDISH} \"makensis.nsi\"\nLicenseLangString myLicenseData ${LANG_TRADCHINESE} \"one-section.nsi\"\nLicenseLangString myLicenseData ${LANG_SIMPCHINESE} \"primes.nsi\"\nLicenseLangString myLicenseData ${LANG_SLOVAK} \"silent.nsi\"\n\nLicenseData $(myLicenseData)\n\n; Set name using the normal interface (Name command)\nLangString Name ${LANG_ENGLISH} \"English\"\nLangString Name ${LANG_CZECH} \"Czech\"\nLangString Name ${LANG_DUTCH} \"Dutch\"\nLangString Name ${LANG_FRENCH} \"French\"\nLangString Name ${LANG_GERMAN} \"German\"\nLangString Name ${LANG_KOREAN} \"Korean\"\nLangString Name ${LANG_RUSSIAN} \"Russian\"\nLangString Name ${LANG_SPANISH} \"Spanish\"\nLangString Name ${LANG_SWEDISH} \"Swedish\"\nLangString Name ${LANG_TRADCHINESE} \"Traditional Chinese\"\nLangString Name ${LANG_SIMPCHINESE} \"Simplified Chinese\"\nLangString Name ${LANG_SLOVAK} \"Slovak\"\n\nName $(Name)\n\n; Directly change the inner lang strings (Same as ComponentText)\nLangString ^ComponentsText ${LANG_ENGLISH} \"English component page\"\nLangString ^ComponentsText ${LANG_CZECH} \"Czech component page\"\nLangString ^ComponentsText ${LANG_DUTCH} \"Dutch component page\"\nLangString ^ComponentsText ${LANG_FRENCH} \"French component page\"\nLangString ^ComponentsText ${LANG_GERMAN} \"German component page\"\nLangString ^ComponentsText ${LANG_KOREAN} \"Korean component page\"\nLangString ^ComponentsText ${LANG_RUSSIAN} \"Russian component page\"\nLangString ^ComponentsText ${LANG_SPANISH} \"Spanish component page\"\nLangString ^ComponentsText ${LANG_SWEDISH} \"Swedish component page\"\nLangString ^ComponentsText ${LANG_TRADCHINESE} \"Traditional Chinese component page\"\nLangString ^ComponentsText ${LANG_SIMPCHINESE} \"Simplified Chinese component page\"\nLangString ^ComponentsText ${LANG_SLOVAK} \"Slovak component page\"\n\n; Set one text for all languages (simply don't use a LangString)\nCompletedText \"Languages example completed\"\n\n; A LangString for the section name\nLangString Sec1Name ${LANG_ENGLISH} \"English section #1\"\nLangString Sec1Name ${LANG_CZECH} \"Czech section #1\"\nLangString Sec1Name ${LANG_DUTCH} \"Dutch section #1\"\nLangString Sec1Name ${LANG_FRENCH} \"French section #1\"\nLangString Sec1Name ${LANG_GERMAN} \"German section #1\"\nLangString Sec1Name ${LANG_KOREAN} \"Korean section #1\"\nLangString Sec1Name ${LANG_RUSSIAN} \"Russian section #1\"\nLangString Sec1Name ${LANG_SPANISH} \"Spanish section #1\"\nLangString Sec1Name ${LANG_SWEDISH} \"Swedish section #1\"\nLangString Sec1Name ${LANG_TRADCHINESE} \"Traditional Chinese section #1\"\nLangString Sec1Name ${LANG_SIMPCHINESE} \"Simplified Chinese section #1\"\nLangString Sec1Name ${LANG_SLOVAK} \"Slovak section #1\"\n\n; A multilingual message\nLangString Message ${LANG_ENGLISH} \"English message\"\nLangString Message ${LANG_CZECH} \"Czech message\"\nLangString Message ${LANG_DUTCH} \"Dutch message\"\nLangString Message ${LANG_FRENCH} \"French message\"\nLangString Message ${LANG_GERMAN} \"German message\"\nLangString Message ${LANG_KOREAN} \"Korean message\"\nLangString Message ${LANG_RUSSIAN} \"Russian message\"\nLangString Message ${LANG_SPANISH} \"Spanish message\"\nLangString Message ${LANG_SWEDISH} \"Swedish message\"\nLangString Message ${LANG_TRADCHINESE} \"Traditional Chinese message\"\nLangString Message ${LANG_SIMPCHINESE} \"Simplified Chinese message\"\nLangString Message ${LANG_SLOVAK} \"Slovak message\"\n\n;--------------------------------\n\n;Section names set by Language strings\n;It works with ! too\nSection !$(Sec1Name) sec1\n\tMessageBox MB_OK $(Message)\nSectionEnd\n\n; The old, slow, wasteful way\n; Look at this section and see why LangString is so much easier\nSection \"Section number two\"\n\tStrCmp $LANGUAGE ${LANG_ENGLISH} 0 +2\n\t\tMessageBox MB_OK \"Installing English stuff\"\n\tStrCmp $LANGUAGE ${LANG_CZECH} 0 +2\n\t\tMessageBox MB_OK \"Installing Czech stuff\"\n\tStrCmp $LANGUAGE ${LANG_DUTCH} 0 +2\n\t\tMessageBox MB_OK \"Installing Dutch stuff\"\n\tStrCmp $LANGUAGE ${LANG_FRENCH} 0 +2\n\t\tMessageBox MB_OK \"Installing French stuff\"\n\tStrCmp $LANGUAGE ${LANG_GERMAN} 0 +2\n\t\tMessageBox MB_OK \"Installing German stuff\"\n\tStrCmp $LANGUAGE ${LANG_KOREAN} 0 +2\n\t\tMessageBox MB_OK \"Installing Korean stuff\"\n\tStrCmp $LANGUAGE ${LANG_RUSSIAN} 0 +2\n\t\tMessageBox MB_OK \"Installing Russian stuff\"\n\tStrCmp $LANGUAGE ${LANG_SPANISH} 0 +2\n\t\tMessageBox MB_OK \"Installing Spanish stuff\"\n\tStrCmp $LANGUAGE ${LANG_SWEDISH} 0 +2\n\t\tMessageBox MB_OK \"Installing Swedish stuff\"\n\tStrCmp $LANGUAGE ${LANG_TRADCHINESE} 0 +2\n\t\tMessageBox MB_OK \"Installing Traditional Chinese stuff\"\n\tStrCmp $LANGUAGE ${LANG_SIMPCHINESE} 0 +2\n\t\tMessageBox MB_OK \"Installing Simplified Chinese stuff\"\n\tStrCmp $LANGUAGE ${LANG_SLOVAK} 0 +2\n\t\tMessageBox MB_OK \"Installing Slovak stuff\"\nSectionEnd\n\n;--------------------------------\n\nFunction .onInit\n\n\t;Language selection dialog\n\n\tPush \"\"\n\tPush ${LANG_ENGLISH}\n\tPush English\n\tPush ${LANG_CZECH}\n\tPush Czech\n\tPush ${LANG_DUTCH}\n\tPush Dutch\n\tPush ${LANG_FRENCH}\n\tPush French\n\tPush ${LANG_GERMAN}\n\tPush German\n\tPush ${LANG_KOREAN}\n\tPush Korean\n\tPush ${LANG_RUSSIAN}\n\tPush Russian\n\tPush ${LANG_SPANISH}\n\tPush Spanish\n\tPush ${LANG_SWEDISH}\n\tPush Swedish\n\tPush ${LANG_TRADCHINESE}\n\tPush \"Traditional Chinese\"\n\tPush ${LANG_SIMPCHINESE}\n\tPush \"Simplified Chinese\"\n\tPush ${LANG_SLOVAK}\n\tPush Slovak\n\tPush A ; A means auto count languages\n\t       ; for the auto count to work the first empty push (Push \"\") must remain\n\tLangDLL::LangDialog \"Installer Language\" \"Please select the language of the installer\"\n\n\tPop $LANGUAGE\n\tStrCmp $LANGUAGE \"cancel\" 0 +2\n\t\tAbort\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/makensis.nsi",
    "content": ";NSIS Setup Script\n;--------------------------------\n\n!pragma warning error all\n!pragma warning warning 7010 ; File /NonFatal\n\n!ifdef VER_MAJOR & VER_MINOR\n  !define /ifndef VER_REVISION 0\n  !define /ifndef VER_BUILD 0\n!endif\n\n!define /ifndef VERSION 'anonymous-build'\n\n;--------------------------------\n;Configuration\n\n!if ${NSIS_PTR_SIZE} > 4\n  !define BITS 64\n  !define NAMESUFFIX \" (64 bit)\"\n!else\n  !define BITS 32\n  !define NAMESUFFIX \"\"\n!endif\n\n!ifndef OUTFILE\n  !define OUTFILE \"..\\nsis${BITS}-${VERSION}-setup.exe\"\n  !searchreplace OUTFILE \"${OUTFILE}\" nsis32 nsis\n!endif\n\nOutFile \"${OUTFILE}\"\nUnicode true\nSetCompressor /SOLID lzma\n\nInstType \"Full\"\nInstType \"Lite\"\nInstType \"Minimal\"\n\nInstallDir $PROGRAMFILES${BITS}\\NSIS\nInstallDirRegKey HKLM Software\\NSIS \"\"\n\nRequestExecutionLevel admin\n\n;--------------------------------\n;Header Files\n\n!include \"MUI2.nsh\"\n!include \"Sections.nsh\"\n!include \"LogicLib.nsh\"\n!include \"Memento.nsh\"\n!include \"WordFunc.nsh\"\n!include \"Util.nsh\"\n!include \"Integration.nsh\"\n\n;--------------------------------\n;Configuration\n\n;Names\nName \"NSIS\"\nCaption \"NSIS ${VERSION}${NAMESUFFIX} Setup\"\n\n!define REG_UNINST_KEY \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\NSIS\"\n\n;Memento Settings\n!define MEMENTO_REGISTRY_ROOT HKLM\n!define MEMENTO_REGISTRY_KEY \"${REG_UNINST_KEY}\"\n\n;Interface Settings\n!define MUI_ABORTWARNING\n\n!define MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis3-install.ico\"\n!define MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis3-uninstall.ico\"\n\n!define MUI_HEADERIMAGE\n!define MUI_HEADERIMAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Header\\nsis3-branding.bmp\"\n!define MUI_WELCOMEFINISHPAGE_BITMAP \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-branding.bmp\"\n\n!define MUI_COMPONENTSPAGE_SMALLDESC\n\n;Pages\n!define MUI_WELCOMEPAGE_TITLE \"Welcome to the NSIS ${VERSION} Setup Wizard\"\n!define MUI_WELCOMEPAGE_TEXT \"This wizard will guide you through the installation of NSIS (Nullsoft Scriptable Install System) ${VERSION}, the next generation of the Windows installer and uninstaller system that doesn't suck and isn't huge.$\\r$\\n$\\r$\\nNSIS includes a Modern User Interface, LZMA compression, support for multiple languages and an easy plug-in system.$\\r$\\n$\\r$\\n$_CLICK\"\n\n!insertmacro MUI_PAGE_WELCOME\n!insertmacro MUI_PAGE_LICENSE \"..\\COPYING\"\n!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD\nPage custom PageReinstall PageLeaveReinstall\n!endif\n!insertmacro MUI_PAGE_COMPONENTS\n!insertmacro MUI_PAGE_DIRECTORY\n!insertmacro MUI_PAGE_INSTFILES\n\n!define MUI_FINISHPAGE_LINK \"Visit the NSIS site for the latest news, FAQs and support\"\n!define MUI_FINISHPAGE_LINK_LOCATION \"http://nsis.sf.net/\"\n\n!define MUI_FINISHPAGE_RUN \"$INSTDIR\\NSIS.exe\"\n!define MUI_FINISHPAGE_NOREBOOTSUPPORT\n\n!define MUI_FINISHPAGE_SHOWREADME\n!define MUI_FINISHPAGE_SHOWREADME_TEXT \"Show release notes\"\n!define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReleaseNotes\n\n!insertmacro MUI_PAGE_FINISH\n\n!insertmacro MUI_UNPAGE_CONFIRM\n!insertmacro MUI_UNPAGE_INSTFILES\n\n;--------------------------------\n;Languages\n\n!insertmacro MUI_LANGUAGE \"English\"\n\n;--------------------------------\n;Version information\n\n!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD\nVIProductVersion ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}\nVIAddVersionKey \"FileVersion\" \"${VERSION}\"\nVIAddVersionKey \"FileDescription\" \"NSIS Setup\"\nVIAddVersionKey \"LegalCopyright\" \"http://nsis.sf.net/License\"\n!endif\n\n;--------------------------------\n;Installer Sections\n\n!macro InstallPlugin pi\n  !if ${BITS} >= 64\n    File \"/oname=$InstDir\\Plugins\\amd64-unicode\\${pi}.dll\" ..\\Plugins\\amd64-unicode\\${pi}.dll\n  !else\n    File \"/oname=$InstDir\\Plugins\\x86-ansi\\${pi}.dll\" ..\\Plugins\\x86-ansi\\${pi}.dll\n    File \"/oname=$InstDir\\Plugins\\x86-unicode\\${pi}.dll\" ..\\Plugins\\x86-unicode\\${pi}.dll\n  !endif\n!macroend\n\n!macro InstallStub stub\n  !if ${BITS} >= 64\n    File ..\\Stubs\\${stub}-amd64-unicode\n  !else\n    File ..\\Stubs\\${stub}-x86-ansi\n    File ..\\Stubs\\${stub}-x86-unicode\n  !endif\n!macroend\n\n${MementoSection} \"NSIS Core Files (required)\" SecCore\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing NSIS Core Files...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1 2 3 RO\n  SetOutPath $INSTDIR\n\n  IfFileExists $INSTDIR\\nsisconf.nsi \"\" +2\n  Rename $INSTDIR\\nsisconf.nsi $INSTDIR\\nsisconf.nsh\n  SetOverwrite off\n  File ..\\nsisconf.nsh\n\n  SetOverwrite on\n  File ..\\makensis.exe\n  File ..\\makensisw.exe\n  File ..\\COPYING\n  File ..\\NSIS.chm\n  !pragma verifychm \"..\\NSIS.chm\"\n  !if /FileExists \"..\\NSIS.exe\"\n    !if /FileExists \"..\\NSIS.exe.manifest\"\n      File \"..\\NSIS.exe.manifest\"\n    !endif\n  !else\n    !define NO_NSISMENU_HTML 1\n    !makensis '-v2 \"NSISMenu.nsi\" \"-XOutFile ..\\NSIS.exe\"' = 0\n  !endif\n  File ..\\NSIS.exe\n\n  SetOutPath $INSTDIR\\Bin\n  File ..\\Bin\\makensis.exe\n!ifdef USE_NEW_ZLIB\n  File ..\\Bin\\zlib.dll\n!else\n  File ..\\Bin\\zlib1.dll\n!endif\n\n  SetOutPath $INSTDIR\\Stubs\n  File ..\\Stubs\\uninst\n  !insertmacro InstallStub bzip2\n  !insertmacro InstallStub bzip2_solid\n  !insertmacro InstallStub lzma\n  !insertmacro InstallStub lzma_solid\n  !insertmacro InstallStub zlib\n  !insertmacro InstallStub zlib_solid\n  \n\n  SetOutPath $INSTDIR\\Include\n  File ..\\Include\\WinMessages.nsh\n  File ..\\Include\\Sections.nsh\n  File ..\\Include\\Library.nsh\n  File ..\\Include\\UpgradeDLL.nsh\n  File ..\\Include\\LogicLib.nsh\n  File ..\\Include\\StrFunc.nsh\n  File ..\\Include\\Colors.nsh\n  File ..\\Include\\FileFunc.nsh\n  File ..\\Include\\TextFunc.nsh\n  File ..\\Include\\WordFunc.nsh\n  File ..\\Include\\WinVer.nsh\n  File ..\\Include\\x64.nsh\n  File ..\\Include\\Memento.nsh\n  File ..\\Include\\LangFile.nsh\n  File ..\\Include\\InstallOptions.nsh\n  File ..\\Include\\MultiUser.nsh\n  File ..\\Include\\VB6RunTime.nsh\n  File ..\\Include\\Util.nsh\n  File ..\\Include\\Integration.nsh\n  File ..\\Include\\WinCore.nsh\n\n  SetOutPath $INSTDIR\\Include\\Win\n  File ..\\Include\\Win\\WinDef.nsh\n  File ..\\Include\\Win\\WinError.nsh\n  File ..\\Include\\Win\\WinNT.nsh\n  File ..\\Include\\Win\\WinUser.nsh\n  File ..\\Include\\Win\\COM.nsh\n  File ..\\Include\\Win\\Propkey.nsh\n  File ..\\Include\\Win\\RestartManager.nsh\n\n  SetOutPath $INSTDIR\\Docs\\StrFunc\n  File ..\\Docs\\StrFunc\\StrFunc.txt\n\n  SetOutPath $INSTDIR\\Docs\\MultiUser\n  File ..\\Docs\\MultiUser\\Readme.html\n\n  SetOutPath $INSTDIR\\Docs\\makensisw\n  File ..\\Docs\\makensisw\\*.txt\n\n  !ifndef NO_NSISMENU_HTML\n    SetOutPath $INSTDIR\\Menu\n    File ..\\Menu\\*.html\n    SetOutPath $INSTDIR\\Menu\\images\n    File ..\\Menu\\images\\header.gif\n    File ..\\Menu\\images\\line.gif\n    File ..\\Menu\\images\\site.gif\n  !endif\n\n  Delete $INSTDIR\\makensis.htm\n  Delete $INSTDIR\\Docs\\*.html\n  Delete $INSTDIR\\Docs\\style.css\n  RMDir $INSTDIR\\Docs\n\n  SetOutPath $INSTDIR\\Bin\n  !if ${BITS} >= 64\n    File /NonFatal  ..\\Bin\\RegTool-x86.bin\n    File            ..\\Bin\\RegTool-amd64.bin\n  !else\n    File            ..\\Bin\\RegTool-x86.bin\n    !if /FileExists ..\\Bin\\RegTool-amd64.bin ; It is unlikely that this exists, avoid the /NonFatal warning.\n      File          ..\\Bin\\RegTool-amd64.bin\n    !endif\n  !endif\n\n  CreateDirectory $INSTDIR\\Plugins\\x86-ansi\n  CreateDirectory $INSTDIR\\Plugins\\x86-unicode\n  !if ${BITS} >= 64\n    CreateDirectory $INSTDIR\\Plugins\\amd64-unicode\n  !endif\n  !insertmacro InstallPlugin TypeLib\n\n  ReadRegStr $R0 HKCR \".nsi\" \"\"\n  StrCmp $R0 \"NSISFile\" 0 +2\n    DeleteRegKey HKCR \"NSISFile\"\n\n  WriteRegStr HKCR \".nsi\" \"\" \"NSIS.Script\"\n  WriteRegStr HKCR \".nsi\" \"PerceivedType\" \"text\"\n  WriteRegStr HKCR \"NSIS.Script\" \"\" \"NSIS Script File\"\n  WriteRegStr HKCR \"NSIS.Script\\DefaultIcon\" \"\" \"$INSTDIR\\makensisw.exe,1\"\n  ReadRegStr $R0 HKCR \"NSIS.Script\\shell\\open\\command\" \"\"\n  ${If} $R0 == \"\"\n    WriteRegStr HKCR \"NSIS.Script\\shell\" \"\" \"open\"\n    WriteRegStr HKCR \"NSIS.Script\\shell\\open\\command\" \"\" 'notepad.exe \"%1\"'\n  ${EndIf}\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile\" \"\" \"Compile NSIS Script\"\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile\\command\" \"\" '\"$INSTDIR\\makensisw.exe\" \"%1\"'\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile-compressor\" \"\" \"Compile NSIS Script (Choose Compressor)\"\n  WriteRegStr HKCR \"NSIS.Script\\shell\\compile-compressor\\command\" \"\" '\"$INSTDIR\\makensisw.exe\" /ChooseCompressor \"%1\"'\n\n  ReadRegStr $R0 HKCR \".nsh\" \"\"\n  StrCmp $R0 \"NSHFile\" 0 +2\n    DeleteRegKey HKCR \"NSHFile\"\n\n  WriteRegStr HKCR \".nsh\" \"\" \"NSIS.Header\"\n  WriteRegStr HKCR \".nsh\" \"PerceivedType\" \"text\"\n  WriteRegStr HKCR \"NSIS.Header\" \"\" \"NSIS Header File\"\n  WriteRegStr HKCR \"NSIS.Header\\DefaultIcon\" \"\" \"$INSTDIR\\makensisw.exe,2\"\n  ReadRegStr $R0 HKCR \"NSIS.Header\\shell\\open\\command\" \"\"\n  ${If} $R0 == \"\"\n    WriteRegStr HKCR \"NSIS.Header\\shell\" \"\" \"open\"\n    WriteRegStr HKCR \"NSIS.Header\\shell\\open\\command\" \"\" 'notepad.exe \"%1\"'\n  ${EndIf}\n\n  ${NotifyShell_AssocChanged}\n\n${MementoSectionEnd}\n\n${MementoSection} \"Script Examples\" SecExample\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Script Examples...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1 2\n  SetOutPath $INSTDIR\\Examples\n  File ..\\Examples\\makensis.nsi\n  File ..\\Examples\\example1.nsi\n  File ..\\Examples\\example2.nsi\n  File ..\\Examples\\AppGen.nsi\n  File ..\\Examples\\install-per-user.nsi\n  File ..\\Examples\\install-shared.nsi\n  File ..\\Examples\\waplugin.nsi\n  File ..\\Examples\\bigtest.nsi\n  File ..\\Examples\\primes.nsi\n  File ..\\Examples\\rtest.nsi\n  File ..\\Examples\\gfx.nsi\n  File ..\\Examples\\one-section.nsi\n  File ..\\Examples\\languages.nsi\n  File ..\\Examples\\Library.nsi\n  File ..\\Examples\\VersionInfo.nsi\n  File ..\\Examples\\LogicLib.nsi\n  File ..\\Examples\\silent.nsi\n  File ..\\Examples\\StrFunc.nsi\n  File ..\\Examples\\FileFunc.nsi\n  File ..\\Examples\\FileFunc.ini\n  File ..\\Examples\\FileFuncTest.nsi\n  File ..\\Examples\\TextFunc.nsi\n  File ..\\Examples\\TextFunc.ini\n  File ..\\Examples\\TextFuncTest.nsi\n  File ..\\Examples\\WordFunc.nsi\n  File ..\\Examples\\WordFunc.ini\n  File ..\\Examples\\WordFuncTest.nsi\n  File ..\\Examples\\Memento.nsi\n  File ..\\Examples\\unicode.nsi\n  File ..\\Examples\\NSISMenu.nsi\n\n  SetOutPath $INSTDIR\\Examples\\Plugin\n  File ..\\Examples\\Plugin\\exdll.c\n  File ..\\Examples\\Plugin\\exdll.dpr\n  File ..\\Examples\\Plugin\\exdll.dsp\n  File ..\\Examples\\Plugin\\exdll.dsw\n  File ..\\Examples\\Plugin\\exdll_with_unit.dpr\n  File ..\\Examples\\Plugin\\exdll-vs2008.sln\n  File ..\\Examples\\Plugin\\exdll-vs2008.vcproj\n  File ..\\Examples\\Plugin\\extdll.inc\n  File ..\\Examples\\Plugin\\nsis.pas\n\n  SetOutPath $INSTDIR\\Examples\\Plugin\\nsis\n  File ..\\Examples\\Plugin\\nsis\\pluginapi.h\n  File /nonfatal ..\\Examples\\Plugin\\nsis\\pluginapi*.lib\n  File ..\\Examples\\Plugin\\nsis\\api.h\n  File ..\\Examples\\Plugin\\nsis\\nsis_tchar.h\n\n${MementoSectionEnd}\n\n${MementoSection} \"Start Menu Shortcut\" SecShortcuts\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Start Menu shortcut...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1 2\n  SetOutPath $INSTDIR\n  CreateShortcut \"$SMPROGRAMS\\NSIS${NAMESUFFIX}.lnk\" \"$INSTDIR\\NSIS.exe\"\n\n${MementoSectionEnd}\n\nSectionGroup \"User Interfaces\" SecInterfaces\n\n${MementoSection} \"Modern User Interface\" SecInterfacesModernUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing User Interfaces | Modern User Interface...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1 2\n\n  SetOutPath \"$INSTDIR\\Examples\\Modern UI\"\n  File \"..\\Examples\\Modern UI\\Basic.nsi\"\n  File \"..\\Examples\\Modern UI\\HeaderBitmap.nsi\"\n  File \"..\\Examples\\Modern UI\\MultiLanguage.nsi\"\n  File \"..\\Examples\\Modern UI\\StartMenu.nsi\"\n  File \"..\\Examples\\Modern UI\\WelcomeFinish.nsi\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Modern UI\"\n  File \"..\\Contrib\\Modern UI\\System.nsh\"\n  File \"..\\Contrib\\Modern UI\\ioSpecial.ini\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI\"\n  File \"..\\Docs\\Modern UI\\Readme.html\"\n  File \"..\\Docs\\Modern UI\\Changelog.txt\"\n  File \"..\\Docs\\Modern UI\\License.txt\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI\\images\"\n  File \"..\\Docs\\Modern UI\\images\\header.gif\"\n  File \"..\\Docs\\Modern UI\\images\\screen1.png\"\n  File \"..\\Docs\\Modern UI\\images\\screen2.png\"\n  File \"..\\Docs\\Modern UI\\images\\open.gif\"\n  File \"..\\Docs\\Modern UI\\images\\closed.gif\"\n\n  SetOutPath $INSTDIR\\Contrib\\UIs\n  File \"..\\Contrib\\UIs\\modern.exe\"\n  File \"..\\Contrib\\UIs\\modern_headerbmp.exe\"\n  File \"..\\Contrib\\UIs\\modern_headerbmpr.exe\"\n  File \"..\\Contrib\\UIs\\modern_nodesc.exe\"\n  File \"..\\Contrib\\UIs\\modern_smalldesc.exe\"\n\n  SetOutPath $INSTDIR\\Include\n  File \"..\\Include\\MUI.nsh\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Modern UI 2\"\n  File \"..\\Contrib\\Modern UI 2\\Deprecated.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Interface.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Localization.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\MUI2.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages.nsh\"\n\n  SetOutPath \"$INSTDIR\\Contrib\\Modern UI 2\\Pages\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\Components.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\Directory.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\Finish.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\InstallFiles.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\License.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\StartMenu.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\UninstallConfirm.nsh\"\n  File \"..\\Contrib\\Modern UI 2\\Pages\\Welcome.nsh\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI 2\"\n  File \"..\\Docs\\Modern UI 2\\Readme.html\"\n  File \"..\\Docs\\Modern UI 2\\License.txt\"\n\n  SetOutPath \"$INSTDIR\\Docs\\Modern UI 2\\images\"\n  File \"..\\Docs\\Modern UI 2\\images\\header.gif\"\n  File \"..\\Docs\\Modern UI 2\\images\\screen1.png\"\n  File \"..\\Docs\\Modern UI 2\\images\\screen2.png\"\n  File \"..\\Docs\\Modern UI 2\\images\\open.gif\"\n  File \"..\\Docs\\Modern UI 2\\images\\closed.gif\"\n\n  SetOutPath $INSTDIR\\Include\n  File \"..\\Include\\MUI2.nsh\"\n\n${MementoSectionEnd}\n\n${MementoSection} \"Default User Interface\" SecInterfacesDefaultUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing User Interfaces | Default User Interface...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  SetOutPath \"$INSTDIR\\Contrib\\UIs\"\n  File \"..\\Contrib\\UIs\\default.exe\"\n\n${MementoSectionEnd}\n\n${MementoSection} \"Tiny User Interface\" SecInterfacesTinyUI\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing User Interfaces | Tiny User Interface...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  SetOutPath \"$INSTDIR\\Contrib\\UIs\"\n  File \"..\\Contrib\\UIs\\sdbarker_tiny.exe\"\n\n${MementoSectionEnd}\n\nSectionGroupEnd\n\n${MementoSection} \"Graphics\" SecGraphics\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Graphics...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  Delete $INSTDIR\\Contrib\\Icons\\*.ico\n  Delete $INSTDIR\\Contrib\\Icons\\*.bmp\n  RMDir $INSTDIR\\Contrib\\Icons\n  SetOutPath $INSTDIR\\Contrib\\Graphics\n  File /r \"..\\Contrib\\Graphics\\*.ico\"\n  File /r \"..\\Contrib\\Graphics\\*.bmp\"\n${MementoSectionEnd}\n\n${MementoSection} \"Language Files\" SecLangFiles\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Language Files...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n  File \"..\\Contrib\\Language files\\*.nlf\"\n\n  SetOutPath $INSTDIR\\Bin\n  File ..\\Bin\\MakeLangID.exe\n\n  ${If} ${SectionIsSelected} ${SecInterfacesModernUI}\n    SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n    File \"..\\Contrib\\Language files\\*.nsh\"\n  ${EndIf}\n\n${MementoSectionEnd}\n\nSectionGroup \"Tools\" SecTools\n\n${MementoSection} \"Zip2Exe\" SecToolsZ2E\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Tools | Zip2Exe...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  SetOutPath $INSTDIR\\Bin\n  File ..\\Bin\\zip2exe.exe\n  SetOutPath $INSTDIR\\Contrib\\zip2exe\n  File ..\\Contrib\\zip2exe\\Base.nsh\n  File ..\\Contrib\\zip2exe\\Modern.nsh\n  File ..\\Contrib\\zip2exe\\Classic.nsh\n\n${MementoSectionEnd}\n\nSectionGroupEnd\n\nSectionGroup \"Plug-ins\" SecPluginsPlugins\n\n${MementoSection} \"Banner\" SecPluginsBanner\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Banner...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin Banner\n  SetOutPath $INSTDIR\\Docs\\Banner\n  File ..\\Docs\\Banner\\Readme.txt\n  SetOutPath $INSTDIR\\Examples\\Banner\n  File ..\\Examples\\Banner\\Example.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"Language DLL\" SecPluginsLangDLL\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Language DLL...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n  !insertmacro InstallPlugin LangDLL\n${MementoSectionEnd}\n\n${MementoSection} \"nsExec\" SecPluginsnsExec\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | nsExec...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin nsExec\n  SetOutPath $INSTDIR\\Docs\\nsExec\n  File ..\\Docs\\nsExec\\nsExec.txt\n  SetOutPath $INSTDIR\\Examples\\nsExec\n  File ..\\Examples\\nsExec\\test.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"Splash\" SecPluginsSplash\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Splash...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin splash\n  SetOutPath $INSTDIR\\Docs\\Splash\n  File ..\\Docs\\Splash\\splash.txt\n  SetOutPath $INSTDIR\\Examples\\Splash\n  File ..\\Examples\\Splash\\Example.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"AdvSplash\" SecPluginsSplashT\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | AdvSplash...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin advsplash\n  SetOutPath $INSTDIR\\Docs\\AdvSplash\n  File ..\\Docs\\AdvSplash\\advsplash.txt\n  SetOutPath $INSTDIR\\Examples\\AdvSplash\n  File ..\\Examples\\AdvSplash\\Example.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"BgImage\" SecPluginsBgImage\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | BgImage...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin BgImage\n  SetOutPath $INSTDIR\\Docs\\BgImage\n  File ..\\Docs\\BgImage\\BgImage.txt\n  SetOutPath $INSTDIR\\Examples\\BgImage\n  File ..\\Examples\\BgImage\\Example.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"InstallOptions\" SecPluginsIO\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | InstallOptions...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin InstallOptions\n  SetOutPath $INSTDIR\\Docs\\InstallOptions\n  File ..\\Docs\\InstallOptions\\Readme.html\n  File ..\\Docs\\InstallOptions\\Changelog.txt\n  SetOutPath $INSTDIR\\Examples\\InstallOptions\n  File ..\\Examples\\InstallOptions\\test.ini\n  File ..\\Examples\\InstallOptions\\test.nsi\n  File ..\\Examples\\InstallOptions\\testimgs.ini\n  File ..\\Examples\\InstallOptions\\testimgs.nsi\n  File ..\\Examples\\InstallOptions\\testlink.ini\n  File ..\\Examples\\InstallOptions\\testlink.nsi\n  File ..\\Examples\\InstallOptions\\testnotify.ini\n  File ..\\Examples\\InstallOptions\\testnotify.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"nsDialogs\" SecPluginsDialogs\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | nsDialogs...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin nsDialogs\n  SetOutPath $INSTDIR\\Examples\\nsDialogs\n  File ..\\Examples\\nsDialogs\\example.nsi\n  File ..\\Examples\\nsDialogs\\InstallOptions.nsi\n  File ..\\Examples\\nsDialogs\\timer.nsi\n  File ..\\Examples\\nsDialogs\\welcome.nsi\n  SetOutPath $INSTDIR\\Include\n  File ..\\Include\\nsDialogs.nsh\n  SetOutPath $INSTDIR\\Docs\\nsDialogs\n  File ..\\Docs\\nsDialogs\\Readme.html\n${MementoSectionEnd}\n\n${MementoSection} \"Math\" SecPluginsMath\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Math...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin Math\n  SetOutPath $INSTDIR\\Docs\\Math\n  File ..\\Docs\\Math\\Math.txt\n  SetOutPath $INSTDIR\\Examples\\Math\n  File ..\\Examples\\Math\\math.nsi\n  File ..\\Examples\\Math\\mathtest.txt\n  File ..\\Examples\\Math\\mathtest.nsi\n  File ..\\Examples\\Math\\mathtest.ini\n\n${MementoSectionEnd}\n\n${MementoSection} \"NSISdl\" SecPluginsNSISDL\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | NSISdl...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin nsisdl\n  SetOutPath $INSTDIR\\Docs\\NSISdl\n  File ..\\Docs\\NSISdl\\ReadMe.txt\n  File ..\\Docs\\NSISdl\\License.txt\n${MementoSectionEnd}\n\n${MementoSection} \"System\" SecPluginsSystem\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | System...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin System\n  SetOutPath $INSTDIR\\Docs\\System\n  File ..\\Docs\\System\\System.html\n  File ..\\Docs\\System\\WhatsNew.txt\n  SetOutPath $INSTDIR\\Examples\\System\n  File ..\\Examples\\System\\Resource.dll\n  File ..\\Examples\\System\\SysFunc.nsh\n  File ..\\Examples\\System\\System.nsh\n  File ..\\Examples\\System\\System.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"StartMenu\" SecPluginsStartMenu\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | StartMenu...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin StartMenu\n  SetOutPath $INSTDIR\\Docs\\StartMenu\n  File ..\\Docs\\StartMenu\\Readme.txt\n  SetOutPath $INSTDIR\\Examples\\StartMenu\n  File ..\\Examples\\StartMenu\\Example.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"UserInfo\" SecPluginsUserInfo\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | UserInfo...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin UserInfo\n  SetOutPath $INSTDIR\\Examples\\UserInfo\n  File ..\\Examples\\UserInfo\\UserInfo.nsi\n${MementoSectionEnd}\n\n${MementoSection} \"Dialer\" SecPluginsDialer\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | Dialer...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin Dialer\n  SetOutPath $INSTDIR\\Docs\\Dialer\n  File ..\\Docs\\Dialer\\Dialer.txt\n${MementoSectionEnd}\n\n${MementoSection} \"VPatch\" SecPluginsVPatch\n\n  SetDetailsPrint textonly\n  DetailPrint \"Installing Plug-ins | VPatch...\"\n  SetDetailsPrint listonly\n\n  SectionIn 1\n\n  !insertmacro InstallPlugin VPatch\n  SetOutPath $INSTDIR\\Examples\\VPatch\n  File ..\\Examples\\VPatch\\example.nsi\n  File ..\\Examples\\VPatch\\oldfile.txt\n  File ..\\Examples\\VPatch\\newfile.txt\n  File ..\\Examples\\VPatch\\patch.pat\n  SetOutPath $INSTDIR\\Docs\\VPatch\n  File ..\\Docs\\VPatch\\Readme.html\n  SetOutPath $INSTDIR\\Bin\n  File ..\\Bin\\GenPat.exe\n  SetOutPath $INSTDIR\\Include\n  File ..\\Include\\VPatchLib.nsh\n${MementoSectionEnd}\n\n${MementoSectionDone}\n\nSectionGroupEnd\n\nSection -post\n\n  ; When Modern UI is installed:\n  ; * Always install the English language file\n  ; * Always install default icons / bitmaps\n\n  ${If} ${SectionIsSelected} ${SecInterfacesModernUI}\n\n    SetDetailsPrint textonly\n    DetailPrint \"Configuring Modern UI...\"\n    SetDetailsPrint listonly\n\n    ${IfNot} ${SectionIsSelected} ${SecLangFiles}\n      SetOutPath \"$INSTDIR\\Contrib\\Language files\"\n      File \"..\\Contrib\\Language files\\English.nlf\"\n      File \"..\\Contrib\\Language files\\English.nsh\"\n    ${EndIf}\n\n    ${IfNot} ${SectionIsSelected} ${SecGraphics}\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Checks\n      File \"..\\Contrib\\Graphics\\Checks\\modern.bmp\"\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Icons\n      File \"..\\Contrib\\Graphics\\Icons\\modern-install.ico\"\n      File \"..\\Contrib\\Graphics\\Icons\\modern-uninstall.ico\"\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Header\n      File \"..\\Contrib\\Graphics\\Header\\nsis.bmp\"\n      SetOutPath $INSTDIR\\Contrib\\Graphics\\Wizard\n      File \"..\\Contrib\\Graphics\\Wizard\\win.bmp\"\n    ${EndIf}\n\n  ${EndIf}\n\n  SetDetailsPrint textonly\n  DetailPrint \"Creating Registry Keys...\"\n  SetDetailsPrint listonly\n\n  SetOutPath $INSTDIR\n\n  WriteRegStr HKLM \"Software\\NSIS\" \"\" $INSTDIR\n!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionMajor\" \"${VER_MAJOR}\"\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionMinor\" \"${VER_MINOR}\"\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionRevision\" \"${VER_REVISION}\"\n  WriteRegDword HKLM \"Software\\NSIS\" \"VersionBuild\" \"${VER_BUILD}\"\n!endif\n\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"UninstallString\" '\"$INSTDIR\\uninst-nsis.exe\"'\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"QuietUninstallString\" '\"$INSTDIR\\uninst-nsis.exe\" /S'\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"InstallLocation\" \"$INSTDIR\"\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"DisplayName\" \"Nullsoft Install System${NAMESUFFIX}\"\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"DisplayIcon\" \"$INSTDIR\\uninst-nsis.exe,0\"\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"DisplayVersion\" \"${VERSION}\"\n!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD\n  WriteRegDWORD HKLM \"${REG_UNINST_KEY}\" \"VersionMajor\" \"${VER_MAJOR}\" ; Required by WACK\n  WriteRegDWORD HKLM \"${REG_UNINST_KEY}\" \"VersionMinor\" \"${VER_MINOR}\" ; Required by WACK\n!endif\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"Publisher\" \"Nullsoft and Contributors\" ; Required by WACK\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"URLInfoAbout\" \"https://nsis.sourceforge.io/\"\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"HelpLink\" \"https://nsis.sourceforge.io/Support\"\n  WriteRegDWORD HKLM \"${REG_UNINST_KEY}\" \"NoModify\" \"1\"\n  WriteRegDWORD HKLM \"${REG_UNINST_KEY}\" \"NoRepair\" \"1\"\n  ${MakeARPInstallDate} $1\n  WriteRegStr HKLM \"${REG_UNINST_KEY}\" \"InstallDate\" $1\n\n  WriteUninstaller $INSTDIR\\uninst-nsis.exe\n\n  ${MementoSectionSave}\n\n  SetDetailsPrint both\n\nSectionEnd\n\n;--------------------------------\n;Descriptions\n\n!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} \"The core files required to use NSIS (compiler etc.)\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} \"Example installation scripts that show you how to use NSIS\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \"Add icon to your start menu for easy access\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfaces} \"User interface designs that can be used to change the installer look and feel\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesModernUI} \"A modern user interface like the wizards of recent Windows versions\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesDefaultUI} \"The default NSIS user interface which you can customize to make your own UI\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesTinyUI} \"A tiny version of the default user interface\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} \"Tools that help you with NSIS development\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} \"A utility that converts a ZIP file to a NSIS installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} \"Icons, checkbox images and other graphics\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} \"Language files used to support multiple languages in an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} \"Useful plugins that extend NSIS's functionality\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} \"Plugin that lets you show a banner before installation starts\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLL} \"Plugin that lets you add a language select dialog to your installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExec} \"Plugin that executes console programs and prints its output in the NSIS log window or hides it\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplash} \"Splash screen add-on that lets you add a splash screen to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashT} \"Splash screen add-on with transparency support that lets you add a splash screen to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystem} \"Plugin that lets you call Win32 API or external DLLs\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMath} \"Plugin that lets you evaluate complicated mathematical expressions\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialer} \"Plugin that provides internet connection functions\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIO} \"Plugin that lets you add custom pages to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialogs} \"Plugin that lets you add custom pages to an installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenu} \"Plugin that lets the user select the start menu folder\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImage} \"Plugin that lets you show a persistent background image plugin and play sounds\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfo} \"Plugin that that gives you the user name and the user account type\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDL} \"Plugin that lets you create a web based installer\"\n  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatch} \"Plugin that lets you create patches to upgrade older files\"\n!insertmacro MUI_FUNCTION_DESCRIPTION_END\n\n;--------------------------------\n;Installer Functions\n\nFunction .onInit\n\n  ${MementoSectionRestore}\n\nFunctionEnd\n\n!ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD\n\nVar ReinstallPageCheck\n\nFunction PageReinstall\n\n  ReadRegStr $R0 HKLM \"Software\\NSIS\" \"\"\n  ReadRegStr $R1 HKLM \"${REG_UNINST_KEY}\" \"UninstallString\"\n  ${IfThen} \"$R0$R1\" == \"\" ${|} Abort ${|}\n\n  StrCpy $R4 \"older\"\n  ReadRegDWORD $R0 HKLM \"Software\\NSIS\" \"VersionMajor\"\n  ReadRegDWORD $R1 HKLM \"Software\\NSIS\" \"VersionMinor\"\n  ReadRegDWORD $R2 HKLM \"Software\\NSIS\" \"VersionRevision\"\n  ReadRegDWORD $R3 HKLM \"Software\\NSIS\" \"VersionBuild\"\n  ${IfThen} $R0 = 0 ${|} StrCpy $R4 \"unknown\" ${|} ; Anonymous builds have no version number\n  StrCpy $R0 $R0.$R1.$R2.$R3\n\n  ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0\n  ${If} $R0 == 0\n    StrCpy $R1 \"NSIS ${VERSION} is already installed. Select the operation you want to perform and click Next to continue.\"\n    StrCpy $R2 \"Add/Reinstall components\"\n    StrCpy $R3 \"Uninstall NSIS\"\n    !insertmacro MUI_HEADER_TEXT \"Already Installed\" \"Choose the maintenance option to perform.\"\n    StrCpy $R0 \"2\"\n  ${ElseIf} $R0 == 1\n    StrCpy $R1 \"An $R4 version of NSIS is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue.\"\n    StrCpy $R2 \"Uninstall before installing\"\n    StrCpy $R3 \"Do not uninstall\"\n    !insertmacro MUI_HEADER_TEXT \"Already Installed\" \"Choose how you want to install NSIS.\"\n    StrCpy $R0 \"1\"\n  ${ElseIf} $R0 == 2\n    StrCpy $R1 \"A newer version of NSIS is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue.\"\n    StrCpy $R2 \"Uninstall before installing\"\n    StrCpy $R3 \"Do not uninstall\"\n    !insertmacro MUI_HEADER_TEXT \"Already Installed\" \"Choose how you want to install NSIS.\"\n    StrCpy $R0 \"1\"\n  ${Else}\n    Abort\n  ${EndIf}\n\n  nsDialogs::Create 1018\n  Pop $R4\n\n  ${NSD_CreateLabel} 0 0 100% 24u $R1\n  Pop $R1\n\n  ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2\n  Pop $R2\n  ${NSD_OnClick} $R2 PageReinstallUpdateSelection\n\n  ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3\n  Pop $R3\n  ${NSD_OnClick} $R3 PageReinstallUpdateSelection\n\n  ${If} $ReinstallPageCheck != 2\n    SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0\n  ${Else}\n    SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0\n  ${EndIf}\n\n  ${NSD_SetFocus} $R2\n\n  nsDialogs::Show\n\nFunctionEnd\n\nFunction PageReinstallUpdateSelection\n\n  Pop $R1\n\n  ${NSD_GetState} $R2 $R1\n\n  ${If} $R1 == ${BST_CHECKED}\n    StrCpy $ReinstallPageCheck 1\n  ${Else}\n    StrCpy $ReinstallPageCheck 2\n  ${EndIf}\n\nFunctionEnd\n\nFunction PageLeaveReinstall\n\n  ${NSD_GetState} $R2 $R1\n\n  StrCmp $R0 \"1\" 0 +2 ; Existing install is not the same version?\n    StrCmp $R1 \"1\" reinst_uninstall reinst_done\n\n  StrCmp $R1 \"1\" reinst_done ; Same version, skip to add/reinstall components?\n\n  reinst_uninstall:\n  ReadRegStr $R1 HKLM \"${REG_UNINST_KEY}\" \"UninstallString\"\n\n  ;Run uninstaller\n    HideWindow\n\n    ClearErrors\n    ExecWait '$R1 _?=$INSTDIR' $0\n\n    BringToFront\n\n    ${IfThen} ${Errors} ${|} StrCpy $0 2 ${|} ; ExecWait failed, set fake exit code\n\n    ${If} $0 <> 0\n    ${OrIf} ${FileExists} \"$INSTDIR\\Bin\\makensis.exe\"\n      ${If} $0 = 1 ; User aborted uninstaller?\n        StrCmp $R0 \"2\" 0 +2 ; Is the existing install the same version?\n          Quit ; ...yes, already installed, we are done\n        Abort\n      ${EndIf}\n      MessageBox MB_ICONEXCLAMATION \"Unable to uninstall!\"\n      Abort\n    ${Else}\n      StrCpy $0 $R1 1\n      ${IfThen} $0 == '\"' ${|} StrCpy $R1 $R1 -1 1 ${|} ; Strip quotes from UninstallString\n      Delete $R1\n      RMDir $INSTDIR\n    ${EndIf}\n\n  reinst_done:\n\nFunctionEnd\n\n!endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD\n\nFunction ShowReleaseNotes\n  StrCpy $0 $WINDIR\\hh.exe\n  ${IfNotThen} ${FileExists} $0 ${|} SearchPath $0 hh.exe ${|}\n  ${If} ${FileExists} $0\n    Exec '\"$0\" mk:@MSITStore:$INSTDIR\\NSIS.chm::/SectionF.1.html'\n  ${Else}\n    ExecShell \"\" \"https://nsis.sourceforge.io/Docs/AppendixF.html#F.1\"\n  ${EndIf}\nFunctionEnd\n\n;--------------------------------\n;Uninstaller Section\n\nSection Uninstall\n\n  SetDetailsPrint textonly\n  DetailPrint \"Uninstalling NSI Development Shell Extensions...\"\n  SetDetailsPrint listonly\n\n  IfFileExists $INSTDIR\\Bin\\makensis.exe nsis_installed\n    MessageBox MB_YESNO \"It does not appear that NSIS is installed in the directory '$INSTDIR'.$\\r$\\nContinue anyway (not recommended)?\" IDYES nsis_installed\n    Abort \"Uninstall aborted by user\"\n  nsis_installed:\n\n  SetDetailsPrint textonly\n  DetailPrint \"Deleting Registry Keys...\"\n  SetDetailsPrint listonly\n\n  !macro AssocDeleteFileExtAndProgId _hkey _dotext _pid\n  ReadRegStr $R0 ${_hkey} \"Software\\Classes\\${_dotext}\" \"\"\n  StrCmp $R0 \"${_pid}\" 0 +2\n    DeleteRegKey ${_hkey} \"Software\\Classes\\${_dotext}\"\n\n  DeleteRegKey ${_hkey} \"Software\\Classes\\${_pid}\"\n  !macroend\n\n  !insertmacro AssocDeleteFileExtAndProgId HKLM \".nsi\" \"NSIS.Script\"\n  !insertmacro AssocDeleteFileExtAndProgId HKLM \".nsh\" \"NSIS.Header\"\n\n  ${NotifyShell_AssocChanged}\n\n  DeleteRegKey HKLM \"${REG_UNINST_KEY}\"\n  DeleteRegKey HKLM \"Software\\NSIS\"\n\n  SetDetailsPrint textonly\n  DetailPrint \"Deleting Files...\"\n  SetDetailsPrint listonly\n\n  Delete \"$SMPROGRAMS\\NSIS${NAMESUFFIX}.lnk\"\n  Delete \"$DESKTOP\\NSIS${NAMESUFFIX}.lnk\" ; Remove legacy shortcut\n  Delete $INSTDIR\\makensis.exe\n  Delete $INSTDIR\\makensisw.exe\n  Delete $INSTDIR\\NSIS.exe\n  Delete $INSTDIR\\NSIS.exe.manifest\n  Delete $INSTDIR\\license.txt\n  Delete $INSTDIR\\COPYING\n  Delete $INSTDIR\\uninst-nsis.exe\n  Delete $INSTDIR\\nsisconf.nsi\n  Delete $INSTDIR\\nsisconf.nsh\n  Delete $INSTDIR\\NSIS.chm\n  RMDir /r $INSTDIR\\Bin\n  RMDir /r $INSTDIR\\Contrib\n  RMDir /r $INSTDIR\\Docs\n  RMDir /r $INSTDIR\\Examples\n  RMDir /r $INSTDIR\\Include\n  RMDir /r $INSTDIR\\Menu\n  RMDir /r $INSTDIR\\Plugins\n  RMDir /r $INSTDIR\\Stubs\n  RMDir $INSTDIR\n\n  SetDetailsPrint both\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/nsArray/nsArray.nsi",
    "content": "!include nsArray.nsh\n\nOutFile nsArray.exe\nName nsArray\nShowInstDetails show\nXPStyle on\nRequestExecutionLevel user\n\nPage Components\nPage InstFiles\n\nSection\n\n  nsArray::Split MyArray |hello|my|name |\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  nsArray::SetList MyArray 11 14 /key=4 meh blah /key=jajaj 9 /end\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  nsArray::Get MyArray 0\n  Pop $R0\n  DetailPrint `MyArray[0] is $R0`\n  nsArray::Get MyArray 1\n  Pop $R0\n  DetailPrint `MyArray[1] is $R0`\n  nsArray::Get MyArray 4\n  Pop $R0\n  DetailPrint `MyArray[4] is $R0`\n  nsArray::Get MyArray 5\n  Pop $R0\n  DetailPrint `MyArray[5] is $R0`\n  nsArray::Get MyArray jajaj\n  Pop $R0\n  DetailPrint `MyArray[jajaj] is $R0`\n\n  nsArray::Set MyArray /key=jajaj 22\n  DetailPrint `Set MyArray[jajaj] = 22`\n\n  nsArray::Get MyArray jajaj\n  Pop $R0\n  DetailPrint `MyArray[jajaj] is $R0`\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  nsArray::Length MyArray\n  Pop $R0\n  DetailPrint `MyArray length: $R0`\n\n  nsArray::Set MyArray /at=0 12\n  DetailPrint `Set MyArray+0 = 12`\n\n  nsArray::Set MyArray /at=1 13\n  DetailPrint `Set MyArray+1 = 13`\n\n  nsArray::Set MyArray /at=7 10\n  DetailPrint `Set MyArray+7 = 10`\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  ClearErrors\n  nsArray::Get MyArray 2\n  ${If} ${Errors}\n    DetailPrint `Error!`\n  ${Else}\n    Pop $R0\n  ${EndIf}\n\n  nsArray::SetList MyArray /key=hello 18 12 14 /end\n\n  nsArray::Length MyArray\n  Pop $R0\n  DetailPrint `MyArray length: $R0`\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  DetailPrint `Remove key \"hello\", value \"hello\", value \"18\" from MyArray`\n  ClearErrors\n  nsArray::RemoveList MyArray hello /val=hello /val=18 /end\n  ${If} ${Errors}\n    DetailPrint `Error!`\n  ${EndIf}\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  DetailPrint `Remove value \"22\", value \"blah\" from MyArray`\n  ClearErrors\n  nsArray::RemoveList MyArray /val=22 /val=blah /end\n  ${If} ${Errors}\n    DetailPrint `Error!`\n  ${EndIf}\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  DetailPrint `Remove first element from MyArray`\n  ClearErrors\n  nsArray::Remove MyArray /at=0\n  ${If} ${Errors}\n    DetailPrint `Error!`\n  ${EndIf}\n\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  nsArray::Length MyArray\n  Pop $R0\n  DetailPrint `MyArray length: $R0`\n\n  ${nsArray_Copy} MyArray MyArray2\n\n  DetailPrint `Before sorting...`\n  StrCpy $R1 0\n  ${DoWhile} $R1 < $R0\n    nsArray::Get MyArray2 /at=$R1\n    Pop $R2\n    Pop $R3\n    DetailPrint `($R1) MyArray2[$R2] is $R3`\n    IntOp $R1 $R1 + 1\n  ${Loop}\n\n  nsArray::Sort MyArray2 16\n\n  ${nsArray_ToString} MyArray2 $R0\n  DetailPrint `MyArray2 sorted without reordering keys/indices:`\n  DetailPrint $R0\n\n  nsArray::Sort MyArray2 2\n\n  ${nsArray_ToString} MyArray2 $R0\n  DetailPrint `MyArray2 values sorted numerically:`\n  DetailPrint $R0\n\n  nsArray::Sort MyArray2 8\n\n  ${nsArray_ToString} MyArray2 $R0\n  DetailPrint `MyArray2 sorted by keys:`\n  DetailPrint $R0\n\n  nsArray::SetList MyArray2 -1 `Hi there!` /end\n\n  ${nsArray_ToString} MyArray2 $R0\n  DetailPrint $R0\n\n  nsArray::Get MyArray2 0\n  ${If} ${Errors}\n    DetailPrint `MyArray2[0] is not set`\n  ${Else}\n    Pop $R0\n    DetailPrint `MyArray2[0] is $R0`\n  ${EndIf}\n  nsArray::Get MyArray2 1\n  ${If} ${Errors}\n    DetailPrint `MyArray2[1] is not set`\n  ${Else}\n    Pop $R0\n    DetailPrint `MyArray2[1] is $R0`\n  ${EndIf}\n\n  ${nsArray_ToString} MyArray2 $R0\n  DetailPrint $R0\n\n  nsArray::Length MyArray2\n  Pop $R0\n  DetailPrint `MyArray2 length: $R0`\n\n  StrCpy $R1 0\n  ${DoWhile} $R1 < $R0\n    nsArray::Get MyArray2 /at=$R1\n    Pop $R2\n    Pop $R3\n    DetailPrint `($R1) MyArray2[$R2] is $R3`\n    IntOp $R1 $R1 + 1\n  ${Loop}\n\n  StrCpy $R1 -1\n  ${DoUntil} $R1 < -$R0\n    nsArray::Get MyArray2 /at=$R1\n    Pop $R2\n    Pop $R3\n    DetailPrint `($R1) MyArray2[$R2] is $R3`\n    IntOp $R1 $R1 - 1\n  ${Loop}\n\n  ${nsArray_CopyKeys} MyArray2 MyArray2Keys\n\n  ${nsArray_ToString} MyArray2Keys $R0\n  DetailPrint $R0\n\n  nsArray::Clear MyArray2\n\n  nsArray::SetList MyArray2 /key=blah value1 value2 /key=2 value3 value4 /end\n\n  ${nsArray_ToString} MyArray2 $R0\n  DetailPrint $R0\n\n  ClearErrors\n  nsArray::Length MyArray2\n  ${IfNot} ${Errors}\n    Pop $R0\n    DetailPrint `MyArray2 length: $R0`\n  ${EndIf}\n\n  nsArray::SetList MyArray2 `` `` /end\n\n  ${ForEachIn} MyArray2 $R0 $R1\n   DetailPrint `MyArray2[$R0] => $R1`\n  ${Next}\n\n  ${ForEachInReverse} MyArray2 $R0 $R1\n   DetailPrint `MyArray2[$R0] => $R1`\n  ${Next}\n\n  nsArray::Join MyArray2 | /noempty\n  Pop $R0\n  DetailPrint $R0\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/nsArray/nsArrayHeader.nsi",
    "content": "!define LOGICLIB_VERBOSITY 4\n!include nsArray.nsh\n\nOutFile nsArray.exe\nName `nsArray.nsh Header Test`\nShowInstDetails show\nXPStyle on\nRequestExecutionLevel user\n\nPage InstFiles\n\nSection\n\n  nsArray::Split MyArray a|b|c|d|e|f |\n  ${nsArray_ToString} MyArray $R0\n  DetailPrint $R0\n\n  ${nsArray_Copy} MyArray MyArrayCopy\n  ${nsArray_ToString} MyArrayCopy $R0\n  DetailPrint $R0\n\n  ${nsArray_CopyKeys} MyArray MyArrayKeys\n  ${nsArray_ToString} MyArrayKeys $R0\n  DetailPrint $R0\n\n  ${ForEachIn} MyArray $R0 $R1\n    DetailPrint `MyArray[$R0] => $R1`\n  ${Next}\n\n  ${ForEachIn} MyArray99 $R0 $R1\n    DetailPrint `MyArray[$R0] => $R1`\n  ${Next}\n\n  ${ForEachInReverse} MyArray $R0 $R1\n    DetailPrint `MyArray[$R0] => $R1`\n  ${Next}\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/nsDialogs/InstallOptions.nsi",
    "content": "!include LogicLib.nsh\n!include WinMessages.nsh\n\nName \"nsDialogs IO\"\nOutFile \"nsDialogs IO.exe\"\n\nPage custom nsDialogsIO UpdateINIState\nPage instfiles\n\nXPStyle on\n\nShowInstDetails show\n\n!include nsDialogs.nsh\n!insertmacro NSD_FUNCTION_INIFILE\n\nFunction nsDialogsIO\n\n\tInitPluginsDir\n\tFile /oname=$PLUGINSDIR\\io.ini \"..\\InstallOptions\\test.ini\"\n\n\t${If} ${Cmd} `MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \"Test the right-to-left version?\" IDYES`\n\t\tWriteINIStr $PLUGINSDIR\\io.ini Settings RTL 1\n\t${EndIf}\n\n\tStrCpy $0 $PLUGINSDIR\\io.ini\n\n\tCall CreateDialogFromINI\n\nFunctionEnd\n\nSection\n\n  ReadINIStr $0 \"$PLUGINSDIR\\io.ini\" \"Field 2\" \"State\"\n  DetailPrint \"Install X=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\io.ini\" \"Field 3\" \"State\"\n  DetailPrint \"Install Y=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\io.ini\" \"Field 4\" \"State\"\n  DetailPrint \"Install Z=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\io.ini\" \"Field 5\" \"State\"\n  DetailPrint \"File=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\io.ini\" \"Field 6\" \"State\"\n  DetailPrint \"Dir=$0\"\n  ReadINIStr $0 \"$PLUGINSDIR\\io.ini\" \"Field 8\" \"State\"\n  DetailPrint \"Info=$0\"\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/nsDialogs/example.nsi",
    "content": "Name \"nsDialogs Example\"\nOutFile \"nsDialogs Example.exe\"\nCaption \"$(^Name)\"\n\nUnicode True\nXPStyle on\nRequestExecutionLevel user\n\n!include nsDialogs.nsh\n!include LogicLib.nsh\n!include WinCore.nsh ; MAKELONG\n\nLicenseText \"All the action takes place on the next page...\" \"Start\"\nSubCaption 0 \": Ready?\"\n\nPage license\nPage custom nsDialogsPage\nPage custom LBPage\nPage custom RangesPage\nPage custom NotifyPage\nPage custom RadioPage RadioLeave\n!pragma warning disable 8000 ; \"Page instfiles not used, no sections will be executed!\"\n\nVar BUTTON\nVar EDIT\nVar CHECKBOX\n\nFunction nsDialogsPage\n\tnsDialogs::Create 1018\n\tPop $0\n\n\tGetFunctionAddress $0 OnBack\n\tnsDialogs::OnBack $0\n\n\t${NSD_CreateButton} 0 0 100% 12u Test\n\tPop $BUTTON\n\tGetFunctionAddress $0 OnClick\n\tnsDialogs::OnClick $BUTTON $0\n\n\t${NSD_CreateText} 0 35 100% 12u hello\n\tPop $EDIT\n\tGetFunctionAddress $0 OnChange\n\tnsDialogs::OnChange $EDIT $0\n\t${NSD_Edit_SetCueBannerText} $EDIT 0 \"Type 'hello there' and get a free surprise\"\n\n\t${NSD_CreateCheckbox} 0 -50 100% 8u Test\n\tPop $CHECKBOX\n\tGetFunctionAddress $0 OnCheckbox\n\tnsDialogs::OnClick $CHECKBOX $0\n\n\t${NSD_CreateLabel} 0 40u 75% 40u \"* Type `hello there` above.$\\n* Click the button.$\\n* Check the checkbox.$\\n* Hit the Back button.\"\n\tPop $0\n\n\tnsDialogs::Show\nFunctionEnd\n\nFunction OnClick\n\tPop $0 # HWND\n\tMessageBox MB_OK clicky\nFunctionEnd\n\nFunction OnChange\n\tPop $0 # HWND\n\n\tSystem::Call user32::GetWindowText(p$EDIT,t.r0,i${NSIS_MAX_STRLEN})\n\t${If} $0 == \"hello there\"\n\t\tMessageBox MB_OK \"right back at ya\"\n\t${EndIf}\nFunctionEnd\n\nFunction OnBack\n\tMessageBox MB_YESNO \"are you sure?\" IDYES +2\n\tAbort\nFunctionEnd\n\nFunction OnCheckbox\n\tPop $0 # HWND\n\tMessageBox MB_OK \"checkbox clicked\"\nFunctionEnd\n\n!macro BeginControlsTestPage title\n\tnsDialogs::Create 1018\n\tPop $0\n\t${NSD_SetText} $hWndParent \"$(^Name): ${title}\"\n!macroend\n\n!macro CreateButton x y w h txt var handler data\n\t${NSD_CreateButton} ${x} ${y} ${w} ${h} \"${txt}\"\n\tPop ${var}\n\tnsDialogs::SetUserData ${var} ${data}\n\t${NSD_OnClick} ${var} ${handler}\n!macroend\n\n\nFunction LBPage\n\t!insertmacro BeginControlsTestPage \"ListBox\"\n\n\t${NSD_CreateSortedListBox} 1u 0 -2u 70u \"\"\n\tPop $1\n\t${NSD_LB_AddString} $1 \"Foo\"\n\t${NSD_LB_AddString} $1 \"Bar\"\n\n\tStrCpy $9 1\n\t${NSD_CreateText} 1u 75u -2u 12u \"New item #$9\"\n\tPop $EDIT\n\t!insertmacro CreateButton 1u 90u 50u 12u \"Add (&Sorted)\" $0 LBAction Add\n\t!insertmacro CreateButton 53u 90u 50u 12u \"&Prepend\" $0 LBAction Prepend\n\t!insertmacro CreateButton 105u 90u 50u 12u \"&Append\" $0 LBAction Append\n\t!insertmacro CreateButton 160u 90u 50u 12u \"&Delete Last\" $0 LBAction DL\n\t!insertmacro CreateButton 215u 90u 50u 12u \"&Clear\" $0 LBAction Clear\n\n\tnsDialogs::Show\nFunctionEnd\n\nFunction LBAction\n\tPop $0\n\tnsDialogs::GetUserData $0\n\tPop $0\n\t${NSD_GetText} $EDIT $8\n\n\t${Select} $0\n\t${Case} \"Add\"\n\t\t${NSD_LB_AddString} $1 $8\n\t${Case} \"Prepend\"\n\t\t${NSD_LB_PrependString} $1 $8\n\t${Case} \"Append\"\n\t\t${NSD_LB_AppendString} $1 $8\n\t${Case} \"DL\"\n\t\t${NSD_LB_GetCount} $1 $8\n\t\t${If} $8 U> 0\n\t\t\tIntOp $8 $8 - 1\n\t\t\t${NSD_LB_DelItem} $1 $8\n\t\t${EndIf}\n\t\tReturn\n\t${Case} \"Clear\"\n\t\t${NSD_LB_Clear} $1\n        Return\n\t${EndSelect}\n\n\tIntOp $9 $9 + 1\n\t${NSD_SetText} $EDIT \"New item #$9\"\nFunctionEnd\n\n\nFunction RangesPage\n\t!insertmacro BeginControlsTestPage \"Ranges\"\n\n\t${NSD_CreateHTrackBar} 1 0 -2 20u \"\"\n\tPop $1\n\t${NSD_TrackBar_SetRangeMax} $1 10\n\t${NSD_TrackBar_SetTicFreq} $1 1\n\t${NSD_TrackBar_SetPos} $1 3\n\n\tStrCpy $9 20 ; Progress pos\n\t${NSD_CreateProgressBar} 1 25u -2 8u \"\"\n\tPop $2\n\t${NSD_CreateTimer} RangesTimer 1000\n\n\t${NSD_CreateNumber} 1 40u 50u 12u \"42\"\n\tPop $3\n\t${NSD_CreateUpDown} 0 0 0 0 \"\"\n\tPop $4\n\t${NSD_UD_SetBuddy} $4 $3\n\t${MAKELONG} $5 $0 50 0 ; 0..50\n\t${NSD_UD_SetPackedRange} $4 $5\n\n\tnsDialogs::Show\nFunctionEnd\n\nFunction RangesTimer\n\tIntOp $9 $9 + 5\n\t${IfThen} $9 > 100 ${|} StrCpy $9 0 ${|}\n\t${NSD_ProgressBar_SetPos} $2 $9\nFunctionEnd\n\n\nFunction NotifyPage\n\t!insertmacro BeginControlsTestPage \"WM_NOTIFY\"\n\n\tnsDialogs::CreateControl \"${__NSD_RichEdit_CLASS_20A}\" \"${__NSD_RichEdit_STYLE}\" \"${__NSD_RichEdit_EXSTYLE}\" 1 1 -2 50u \"\" ; Forcing ANSI control, see forums.winamp.com/showthread.php?p=3169999\n\tPop $9\n\t${NSD_OnNotify} $9 OnNotify\n\tIntOp $8 ${ENM_LINK} | ${ENM_KEYEVENTS}\n\t${NSD_RichEd_SetEventMask} $9 $8\n\tSendMessage $9 ${EM_AUTOURLDETECT} 1 0\n\t${NSD_SetText} $9 \"{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard http://nsis.sf.net\\par {\\b Click the link!}\\par\\par Type something and I will block every other character...}\"\n\n\t${NSD_InitCommonControlsEx} ${ICC_DATE_CLASSES}\n\t${NSD_CreateDatePicker} 1% 55u 48% 12u \"\"\n\tPop $1\n\t${NSD_OnNotify} $1 onDateTimeNotify\n\t${NSD_CreateLabel} 51% 56u 48% 12u \"Change the date...\"\n\tPop $9\n\n\t/*\n\t${NSD_CreateCalendar} 1% 23% 150u 90u \"\"\n\tPop $1\n\t${NSD_AddStyle} $1 ${MCS_NOTODAY}\n\tSystem::Call 'USER32::SendMessage(p$1, i${MCM_GETMINREQRECT}, p0, @r2)'\n\tSystem::Call '*$2(i,i,i.r2,i.r3)'\n\t#System::Call 'USER32::SendMessage(p$1, i${MCM_GETMAXTODAYWIDTH}, p0, *i0r4)'\n\t#${IfThen} $4 > $2 ${|} StrCpy $2 $4 ${|}\n\tSystem::Call 'USER32::SetWindowPos(p$1,p0,i,i,ir2,ir3,i0x16)'\n\t*/\n\n\tnsDialogs::Show\nFunctionEnd\n\nFunction OnNotify\n\tPop $1 ; HWND\n\tPop $2 ; Code\n\tPop $3 ; NMHDR*\n\t${If} $2 = ${EN_LINK}\n\t\tSystem::Call '*$3(p,p,p,p.r2,p,p,i.r4,i.r5)' ; Extract from ENLINK*\n\t\t${IfThen} $2 <> ${WM_LBUTTONDOWN} ${|} Return ${|}\n\t\tIntOp $2 $5 - $4\n\t\tSystem::Call '*(ir4,ir5,l,&t$2,i)p.r2' ; Create TEXTRANGE and a text buffer\n\t\t${If} $2 P<> 0\n\t\t\tIntPtrOp $3 $2 + 16 ; Find buffer\n\t\t\tSystem::Call '*$2(i,i,p$3)' ; Set buffer in TEXTRANGE\n\t\t\tSendMessage $1 ${EM_GETTEXTRANGE} \"\" $2 $4\n\t\t\t${If} $4 <> 0\n\t\t\t\tSystem::Call 'SHELL32::ShellExecute(p$hWndParent, p0, pr3, p0, p0, i 1)'\n\t\t\t${EndIf}\n\t\t\tSystem::Free $2\n\t\t${EndIf}\n\t${ElseIf} $2 = ${EN_MSGFILTER}\n\t\tVar /Global Toggle\n\t\tSystem::Call '*$3(p,i,i,i.r4)' ; MSGFILTER->msg\n\t\t${If} $4 = ${WM_CHAR}\n\t\t\tIntOp $Toggle $Toggle ^ 1\n\t\t\t${If} $Toggle & 1\n\t\t\t\t${NSD_Return} 1\n\t\t\t${EndIf}\n\t\t${EndIf}\n\t${EndIf}\nFunctionEnd\n\nFunction onDateTimeNotify\nPop $1 ; HWND\nPop $2 ; Code\nPop $3 ; NMHDR*\n${If} $2 = ${DTN_DATETIMECHANGE}\n\tSystem::Call 'USER32::SendMessage(p$1, i${DTM_GETSYSTEMTIME}, p0, @r3)i.r0'\n\t${If} $0 = ${GDT_VALID}\n\t\tSystem::Call '*$3(&i2.R1, &i2.R2, &i2, &i2.R3, &i2, &i2, &i2, &i2)' ; SYSTEMTIME\n\t\tStrCpy $0 \"$R1/$R2/$R3\"\n\t${Else}\n\t\tStrCpy $0 \"N/A\"\n\t${EndIf}\n\t${NSD_SetText} $9 $0\n${EndIf}\nFunctionEnd\n\n\nFunction RadioPage\n\t!insertmacro BeginControlsTestPage \"Radio buttons\"\n\n\t; Group 1\n\t${NSD_CreateFirstRadioButton} 4u 0 40% 6% \"NPR\"\n\tPop $1\n\t${NSD_OnClick} $1 onStationChanged\n\t${NSD_CreateAdditionalRadioButton} 4u 12% 40% 6% \"BBC\"\n\tPop $2\n\t${NSD_OnClick} $2 onStationChanged\n\t${NSD_CreateLabel} 4u 30u 80% 12u \"\"\n\tPop $3\n\n\t; Group 2\n\t${NSD_CreateFirstRadioButton} 4u 50u 50% 12u \"FM\"\n\tPop $4\n\t${NSD_CreateAdditionalRadioButton} 4u 64u 50% 12u \"AM\"\n\tPop $5\n\n\tSendMessage $4 ${BM_CLICK} \"\" \"\" ; Must select a default\n\tSendMessage $2 ${BM_CLICK} \"\" \"\" ; Must select a default\n\tnsDialogs::Show\nFunctionEnd\n\nFunction onStationChanged\nPop $0\n${NSD_GetText} $0 $0\n${If} $0 == \"NPR\"\n\t${NSD_SetText} $3 \"America, f*(# yeah!\"\n${Else}\n\t${NSD_SetText} $3 \"Keep Calm and Carry On\"\n${EndIf}\nFunctionEnd\n\nFunction RadioLeave\n${NSD_GetChecked} $5 $0\n${If} $0 <> 0\n\tMessageBox MB_YESNO \"Are you sure you want to keep living in the past?\" IDYES +2\n\t\tAbort\n${EndIf}\nFunctionEnd\n\nSection\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/nsDialogs/timer.nsi",
    "content": "!include LogicLib.nsh\n!include nsDialogs.nsh\n!include WinMessages.nsh\n\nName \"nsDialogs Timer Example\"\nOutFile \"nsDialogs Timer Example.exe\"\nXPStyle on\nRequestExecutionLevel user\n\nVar DIALOG\nVar TEXT\nVar PROGBAR\nVar PROGBAR2\nVar PROGBAR3\nVar BUTTON\nVar BUTTON2\n\nPage custom nsDialogsPage\n!pragma warning disable 8000 ; \"Page instfiles not used, no sections will be executed!\"\n\nFunction OnTimer\n\n\tSendMessage $PROGBAR ${PBM_GETPOS} 0 0 $1\n\t${If} $1 = 100\n\t\tSendMessage $PROGBAR ${PBM_SETPOS} 0 0\n\t${Else}\n\t\tSendMessage $PROGBAR ${PBM_DELTAPOS} 10 0\n\t${EndIf}\n\nFunctionEnd\n\nFunction OnTimer2\n\n\tSendMessage $PROGBAR2 ${PBM_GETPOS} 0 0 $1\n\t${If} $1 = 100\n\t\tSendMessage $PROGBAR2 ${PBM_SETPOS} 0 0\n\t${Else}\n\t\tSendMessage $PROGBAR2 ${PBM_DELTAPOS} 5 0\n\t${EndIf}\n\nFunctionEnd\n\nFunction OnTimer3\n\n\tSendMessage $PROGBAR3 ${PBM_GETPOS} 0 0 $1\n\t${If} $1 >= 100\n\t\t${NSD_KillTimer} OnTimer3\n\t\tMessageBox MB_OK \"Timer 3 killed\"\n\t${Else}\n\t\tSendMessage $PROGBAR3 ${PBM_DELTAPOS} 2 0\n\t${EndIf}\n\nFunctionEnd\n\nFunction OnClick\n\n\tPop $0\n\n\t${NSD_KillTimer} OnTimer\n\nFunctionEnd\n\nFunction OnClick2\n\n\tPop $0\n\n\t${NSD_KillTimer} OnTimer2\n\nFunctionEnd\n\nFunction nsDialogsPage\n\n\tnsDialogs::Create 1018\n\tPop $DIALOG\n\n\t${NSD_CreateLabel} 0u 0u 100% 9u \"nsDialogs timer example\"\n\tPop $TEXT\n\n\t${NSD_CreateProgressBar} 0u 10u 100% 12u \"\"\n\tPop $PROGBAR\n\n\t${NSD_CreateButton} 0u 25u 100u 14u \"Kill Timer 1\"\n\tPop $BUTTON\n\t${NSD_OnClick} $BUTTON OnClick\n\n\t${NSD_CreateProgressBar} 0u 52u 100% 12u \"\"\n\tPop $PROGBAR2\n\tSendMessage $PROGBAR2 ${PBM_SETBARCOLOR} 0 0x0000FF ; No visual styles\n\tSendMessage $PROGBAR2 ${PBM_SETSTATE} ${PBST_ERROR} 0 ; Vista+\n\n\t${NSD_CreateButton} 0u 67u 100u 14u \"Kill Timer 2\"\n\tPop $BUTTON2\n\t${NSD_OnClick} $BUTTON2 OnClick2\n\n\t${NSD_CreateProgressBar} 0u 114u 100% 12u \"\"\n\tPop $PROGBAR3\n\n\t${NSD_CreateTimer} OnTimer 1000\n\t${NSD_CreateTimer} OnTimer2 100\n\t${NSD_CreateTimer} OnTimer3 200\n\n\tnsDialogs::Show\n\nFunctionEnd\n\nSection\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/nsDialogs/welcome.nsi",
    "content": "!include MUI.nsh\n!include LogicLib.nsh\n!include nsDialogs.nsh\n!include WinMessages.nsh\n!include FileFunc.nsh\n\nName \"nsDialogs Welcome\"\nOutFile \"nsDialogs Welcome.exe\"\n\nPage custom nsDialogsWelcome\nPage custom nsDialogsDirectory\n!insertmacro MUI_PAGE_INSTFILES\n\n!insertmacro MUI_LANGUAGE English\n\n\nVar DIALOG\nVar HEADLINE\nVar TEXT\nVar IMAGECTL\nVar IMAGE\nVar DIRECTORY\nVar FREESPACE\n\nVar HEADLINE_FONT\n\nFunction .onInit\n\n\tCreateFont $HEADLINE_FONT \"$(^Font)\" \"14\" \"700\"\n\n\tInitPluginsDir\n\tFile /oname=$PLUGINSDIR\\welcome.bmp \"${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp\"\n\nFunctionEnd\n\nFunction HideControls\n\n    LockWindow on\n    GetDlgItem $0 $HWNDPARENT 1028\n    ShowWindow $0 ${SW_HIDE}\n\n    GetDlgItem $0 $HWNDPARENT 1256\n    ShowWindow $0 ${SW_HIDE}\n\n    GetDlgItem $0 $HWNDPARENT 1035\n    ShowWindow $0 ${SW_HIDE}\n\n    GetDlgItem $0 $HWNDPARENT 1037\n    ShowWindow $0 ${SW_HIDE}\n\n    GetDlgItem $0 $HWNDPARENT 1038\n    ShowWindow $0 ${SW_HIDE}\n\n    GetDlgItem $0 $HWNDPARENT 1039\n    ShowWindow $0 ${SW_HIDE}\n\n    GetDlgItem $0 $HWNDPARENT 1045\n    ShowWindow $0 ${SW_NORMAL}\n    LockWindow off\n\nFunctionEnd\n\nFunction ShowControls\n\n    LockWindow on\n    GetDlgItem $0 $HWNDPARENT 1028\n    ShowWindow $0 ${SW_NORMAL}\n\n    GetDlgItem $0 $HWNDPARENT 1256\n    ShowWindow $0 ${SW_NORMAL}\n\n    GetDlgItem $0 $HWNDPARENT 1035\n    ShowWindow $0 ${SW_NORMAL}\n\n    GetDlgItem $0 $HWNDPARENT 1037\n    ShowWindow $0 ${SW_NORMAL}\n\n    GetDlgItem $0 $HWNDPARENT 1038\n    ShowWindow $0 ${SW_NORMAL}\n\n    GetDlgItem $0 $HWNDPARENT 1039\n    ShowWindow $0 ${SW_NORMAL}\n\n    GetDlgItem $0 $HWNDPARENT 1045\n    ShowWindow $0 ${SW_HIDE}\n    LockWindow off\n\nFunctionEnd\n\nFunction nsDialogsWelcome\n\n\tnsDialogs::Create 1044\n\tPop $DIALOG\n\n\tnsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_BITMAP} 0 0 0 109u 193u \"\"\n\tPop $IMAGECTL\n\n\tStrCpy $0 $PLUGINSDIR\\welcome.bmp\n\tSystem::Call 'user32::LoadImage(p 0, t r0, i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_LOADFROMFILE})p.s'\n\tPop $IMAGE\n\t\n\tSendMessage $IMAGECTL ${STM_SETIMAGE} ${IMAGE_BITMAP} $IMAGE\n\n\tnsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 10u -130u 20u \"Welcome to nsDialogs!\"\n\tPop $HEADLINE\n\n\tSendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0\n\n\tnsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 32u -130u -32u \"nsDialogs is the next generation of user interfaces in NSIS. It gives the developer full control over custom pages. Some of the features include control text containing variables, callbacks directly into script functions and creation of any type of control. Create boring old edit boxes or load some external library and create custom controls with no need of creating your own plug-in.$\\r$\\n$\\r$\\nUnlike InstallOptions, nsDialogs doesn't use INI files to communicate with the script. By interacting directly with the script, nsDialogs can perform much faster without the need of costly, old and inefficient INI operations. Direct interaction also allows direct calls to functions defined in the script and removes the need of conversion functions like Io2Nsis.$\\r$\\n$\\r$\\nHit the Next button to see how it all fits into a mock directory page.\"\n\tPop $TEXT\n\n\tSetCtlColors $DIALOG 0 0xffffff\n\tSetCtlColors $HEADLINE 0 0xffffff\n\tSetCtlColors $TEXT 0 0xffffff\n\n\tCall HideControls\n\n\tnsDialogs::Show\n\n\tCall ShowControls\n\n\tSystem::Call gdi32::DeleteObject(p$IMAGE)\n\nFunctionEnd\n\n!define SHACF_FILESYSTEM 1\n\nFunction nsDialogsDirectory\n\n\t!insertmacro MUI_HEADER_TEXT \"Choose Install Location\" \"Choose the folder in which to install $(^NameDA).\"\n\n\tGetDlgItem $0 $HWNDPARENT 1\n\tEnableWindow $0 0\n\n\tnsDialogs::Create 1018\n\tPop $DIALOG\n\n\tnsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_CENTER} 0 0 0 100% 30 \"Directory page\"\n\tPop $HEADLINE\n\n\tSendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0\n\n\tnsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 30 100% 40 \"Select the installation directory of NSIS to continue. $_CLICK\"\n\tPop $TEXT\n\n\tnsDialogs::CreateControl EDIT ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${ES_AUTOHSCROLL}|${WS_TABSTOP} ${WS_EX_CLIENTEDGE} 0 75 100% 12u \"\"\n\tPop $DIRECTORY\n\n\tSendMessage $HWNDPARENT ${WM_NEXTDLGCTL} $DIRECTORY 1\n\n\tGetFunctionAddress $0 DirChange\n\tnsDialogs::OnChange $DIRECTORY $0\n\n\tSystem::Call shlwapi::SHAutoComplete(p$DIRECTORY,i${SHACF_FILESYSTEM})\n\n\tnsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 0 -10u 100% 10u \"\"\n\tPop $FREESPACE\n\n\tCall UpdateFreeSpace\n\n\tnsDialogs::Show\n\nFunctionEnd\n\nFunction UpdateFreeSpace\n\n\t${GetRoot} $INSTDIR $0\n\tStrCpy $1 \" bytes\"\n\n\tSystem::Call kernel32::GetDiskFreeSpaceEx(tr0,*l,*l,*l.r0)\n\n\t${If} $0 > 1024\n\t${OrIf} $0 < 0\n\t\tSystem::Int64Op $0 / 1024\n\t\tPop $0\n\t\tStrCpy $1 \"kb\"\n\t\t${If} $0 > 1024\n\t\t${OrIf} $0 < 0\n\t\t\tSystem::Int64Op $0 / 1024\n\t\t\tPop $0\n\t\t\tStrCpy $1 \"mb\"\n\t\t\t${If} $0 > 1024\n\t\t\t${OrIf} $0 < 0\n\t\t\t\tSystem::Int64Op $0 / 1024\n\t\t\t\tPop $0\n\t\t\t\tStrCpy $1 \"gb\"\n\t\t\t${EndIf}\n\t\t${EndIf}\n\t${EndIf}\n\n\tSendMessage $FREESPACE ${WM_SETTEXT} 0 \"STR:Free space: $0$1\"\n\nFunctionEnd\n\nFunction DirChange\n\n\tPop $0 # dir hwnd\n\n\tGetDlgItem $0 $HWNDPARENT 1\n\n\tSystem::Call user32::GetWindowText(p$DIRECTORY,t.d,i${NSIS_MAX_STRLEN})\n\n\t${If} ${FileExists} $INSTDIR\\makensis.exe\n\t\tEnableWindow $0 1\n\t${Else}\n\t\tEnableWindow $0 0\n\t${EndIf}\n\n\tCall UpdateFreeSpace\n\nFunctionEnd\n\nSection\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/nsExec/test.nsi",
    "content": "Name \"nsExec Test\"\n\nOutFile \"nsExec Test.exe\"\n\nShowInstDetails show\n\nSection \"Silent MakeNSIS\"\n\tnsExec::Exec '\"${NSISDIR}\\makensis.exe\"'\n\tPop $0 # return value/error/timeout\n\tDetailPrint \"\"\n\tDetailPrint \"       Return value: $0\"\n\tDetailPrint \"\"\nSectionEnd\n\nSection \"MakeNSIS commands help\"\n\tnsExec::ExecToLog '\"${NSISDIR}\\makensis.exe\" /CMDHELP'\n\tPop $0 # return value/error/timeout\n\tDetailPrint \"\"\n\tDetailPrint \"       Return value: $0\"\n\tDetailPrint \"\"\nSectionEnd\n\nSection \"Output to variable\"\n\tnsExec::ExecToStack '\"${NSISDIR}\\makensis.exe\" /VERSION'\n\tPop $0 # return value/error/timeout\n\tPop $1 # printed text, up to ${NSIS_MAX_STRLEN}\n\tDetailPrint '\"${NSISDIR}\\makensis.exe\" /VERSION printed: $1'\n\tDetailPrint \"\"\n\tDetailPrint \"       Return value: $0\"\n\tDetailPrint \"\"\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/nsProcessTest.nsi",
    "content": "Name \"nsProcessTest\"\nOutFile \"nsProcessTest.exe\"\n\n!include \"nsProcess.nsh\"\n!include \"Sections.nsh\"\n\nVar RADIOBUTTON\n\nPage components\nPage instfiles\n\n\nSection \"Find process\" FindProcess\n\t${nsProcess::FindProcess} \"Calc.exe\" $R0\n\tMessageBox MB_OK \"nsProcess::FindProcess$\\n$\\n\\\n\t\t\tErrorlevel: [$R0]\"\n\n\t${nsProcess::Unload}\nSectionEnd\n\n\nSection /o \"Kill process\" KillProcess\n\tloop:\n\t${nsProcess::FindProcess} \"NoTePad.exe\" $R0\n\tStrCmp $R0 0 0 +2\n\tMessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'Close \"notepad\" before continue' IDOK loop IDCANCEL end\n\n\t${nsProcess::KillProcess} \"NoTePad.exe\" $R0\n\tMessageBox MB_OK \"nsProcess::KillProcess$\\n$\\n\\\n\t\t\tErrorlevel: [$R0]\"\n\n\tExec \"notepad.exe\"\n\tExec \"notepad.exe\"\n\tExec \"notepad.exe\"\n\tSleep 1000\n\tBringToFront\n\tMessageBox MB_OK \"Press OK and 3 notepad's windows will be closed (TERMINATED)\"\n\n\t${nsProcess::KillProcess} \"NoTePad.exe\" $R0\n\tMessageBox MB_OK \"nsProcess::KillProcess$\\n$\\n\\\n\t\t\tErrorlevel: [$R0]\"\n\n\tExec \"notepad.exe\"\n\tExec \"notepad.exe\"\n\tExec \"notepad.exe\"\n\tSleep 1000\n\tBringToFront\n\tMessageBox MB_OK \"Press OK and 3 notepad's windows will be CLOSED\"\n\n\t${nsProcess::CloseProcess} \"NoTePad.exe\" $R0\n\tMessageBox MB_OK \"nsProcess::CloseProcess$\\n$\\n\\\n\t\t\tErrorlevel: [$R0]\"\n\n\n\tend:\n\t${nsProcess::Unload}\nSectionEnd\n\n\nFunction .onInit\n\tStrCpy $RADIOBUTTON ${FindProcess}\nFunctionEnd\n\nFunction .onSelChange\n\t!insertmacro StartRadioButtons $RADIOBUTTON\n\t!insertmacro RadioButton ${FindProcess}\n\t!insertmacro RadioButton ${KillProcess}\n\t!insertmacro EndRadioButtons\nFunctionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/one-section.nsi",
    "content": "; one-section.nsi\n;\n; This example demonstrates how to control section selection.\n; It allows only one of the sections of a group to be selected.\n\n;--------------------------------\n\n; Section define/macro header file\n; See this header file for more info\n\n!include \"Sections.nsh\"\n\n;--------------------------------\n\nName \"One Section\"\nOutFile \"one-section.exe\"\nRequestExecutionLevel user\n\n;--------------------------------\n\n; Pages\n\nPage Components\nPage InstFiles\n\n;--------------------------------\n\n; Sections\n\nSection !Required\n  SectionIn RO\nSectionEnd\n\nSection \"Group 1 - Option 1\" g1o1\nSectionEnd\n\nSection /o \"Group 1 - Option 2\" g1o2\nSectionEnd\n\nSection /o \"Group 1 - Option 3\" g1o3\nSectionEnd\n\nSection \"Group 2 - Option 1\" g2o1\nSectionEnd\n\nSection /o \"Group 2 - Option 2\" g2o2\nSectionEnd\n\nSection /o \"Group 2 - Option 3\" g2o3\nSectionEnd\n\n;--------------------------------\n\n; Functions\n\n; $1 stores the status of group 1\n; $2 stores the status of group 2\n\nFunction .onInit\n\n  StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default\n  StrCpy $2 ${g2o1} ; Group 2 - Option 1 is selected by default\n\nFunctionEnd\n\nFunction .onSelChange\n\n  !insertmacro StartRadioButtons $1\n    !insertmacro RadioButton ${g1o1}\n    !insertmacro RadioButton ${g1o2}\n    !insertmacro RadioButton ${g1o3}\n  !insertmacro EndRadioButtons\n\n  !insertmacro StartRadioButtons $2\n    !insertmacro RadioButton ${g2o1}\n    !insertmacro RadioButton ${g2o2}\n    !insertmacro RadioButton ${g2o3}\n  !insertmacro EndRadioButtons\n\nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/primes.nsi",
    "content": "; primes.nsi\n;\n; This is an example of the possibilities of the NSIS Script language.\n; It calculates prime numbers.\n\n;--------------------------------\n\nName \"primes\"\nAllowRootDirInstall true\nOutFile \"primes.exe\"\nCaption \"Prime number generator\"\nShowInstDetails show\nAllowRootDirInstall true\nInstallDir \"$EXEDIR\"\nRequestExecutionLevel user\n\nDirText \"Select a directory to write primes.txt. $_CLICK\"\n\n;--------------------------------\n\n;Pages\n\nPage directory\nPage instfiles\n\n;--------------------------------\n\nSection \"\"\n  SetOutPath $INSTDIR\n  Call DoPrimes \nSectionEnd\n\n;--------------------------------\n\nFunction DoPrimes\n\n; we put this in here so it doesn't update the progress bar (faster)\n\n!define PPOS $0 ; position in prime searching\n!define PDIV $1 ; divisor\n!define PMOD $2 ; the result of the modulus\n!define PCNT $3 ; count of how many we've printed\n  FileOpen $9 $INSTDIR\\primes.txt w\n\n  DetailPrint \"2 is prime!\"\n  FileWrite $9 \"2 is prime!$\\r$\\n\"\n  DetailPrint \"3 is prime!\"\n  FileWrite $9 \"3 is prime!$\\r$\\n\"\n  Strcpy ${PPOS} 3\n  Strcpy ${PCNT} 2\nouterloop:\n   StrCpy ${PDIV} 3\n   innerloop:\n     IntOp ${PMOD} ${PPOS} % ${PDIV}\n     IntCmp ${PMOD} 0 notprime\n     IntOp ${PDIV} ${PDIV} + 2\n     IntCmp ${PDIV} ${PPOS} 0 innerloop 0\n       DetailPrint \"${PPOS} is prime!\"\n       FileWrite $9 \"${PPOS} is prime!$\\r$\\n\"\n       IntOp ${PCNT} ${PCNT} + 1\n       IntCmp ${PCNT} 100 0 innerloop\n       StrCpy ${PCNT} 0\n       MessageBox MB_YESNO \"Process more?\" IDNO stop\n     notprime:\n       IntOp ${PPOS} ${PPOS} + 2\n     Goto outerloop\n   stop:\n  FileClose $9\n  \nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/rtest.nsi",
    "content": "; rtest.nsi\n;\n; This script tests some advanced NSIS functions.\n\n;--------------------------------\n\nName \"rtest\"\nOutFile \"rtest.exe\"\n\nComponentText \"Select tests!\"\nShowInstDetails show\n\nRequestExecutionLevel user\n\n;--------------------------------\n\nSection \"Test 1\"\n\n  StrCpy $R0 \"a\"\n  \n  GetFunctionAddress $R1 test1\n  Call $R1\n  \n  StrCmp $R0 \"a182345678\" success\n  \n  DetailPrint \"Test 1 failed (output: $R0)\"\n  Goto end\n  \n  success:\n  DetailPrint \"Test 1 succeeded (output: $R0)\"\n  \n  end:\n  \nSectionEnd\n\nFunction test1\n\n  GetLabelAddress $9 skip\n  \n  IntOp $9 $9 - 1\n  StrCpy $R0 $R01\n  \n  Call $9\n  \n  StrCpy $R0 $R02\n  StrCpy $R0 $R03\n  StrCpy $R0 $R04\n  StrCpy $R0 $R05\n  StrCpy $R0 $R06\n  StrCpy $R0 $R07\n  StrCpy $R0 $R08\n  \n  skip:\n  \nFunctionEnd\n\n;--------------------------------\n\nSection \"Test 2\"\n\n  StrCpy $R0 \"0\"\n  StrCpy $R1 \"11\"\n  \n  Call test2\n  \n  StrCmp $R1 \"11,10,9,8,7,6,5,4,3,2,1\" success\n  \n  DetailPrint \"Test 2 failed (output: $R1)\"\n  Goto end\n  \n  success:\n  DetailPrint \"Test 2 succeeded (output: $R1)\"\n  \n  end:\n\nSectionEnd\n\nFunction test2\n\n  IntOp $R0 $R0 + 1\n  IntCmp $R0 10 done\n  \n  Push $R0\n  \n  GetFunctionAddress $R2 test2\n  Call $R2\n  \n  Pop $R0\n  \n  done:\n  StrCpy $R1 \"$R1,$R0\"\n  \nFunctionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/silent.nsi",
    "content": "# This example shows how to handle silent installers.\n# In short, you need IfSilent and the /SD switch for MessageBox to make your installer\n# really silent when the /S switch is used.\n\nName \"Silent\"\nOutFile \"silent.exe\"\nRequestExecutionLevel user\n\n# uncomment the following line to make the installer silent by default.\n; SilentInstall silent\n\nFunction .onInit\n  # `/SD IDYES' tells MessageBox to automatically choose IDYES if the installer is silent\n  # in this case, the installer can only be silent if the user used the /S switch or if\n  # you've uncommented line number 5\n  MessageBox MB_YESNO|MB_ICONQUESTION \"Would you like the installer to be silent from now on?\" \\\n    /SD IDYES IDNO no IDYES yes\n\n  # SetSilent can only be used in .onInit and doesn't work well along with `SetSilent silent'\n\n  yes:\n    SetSilent silent\n    Goto done\n  no:\n    SetSilent normal\n  done:\nFunctionEnd\n\nSection\n  IfSilent 0 +2\n    MessageBox MB_OK|MB_ICONINFORMATION 'This is a \"silent\" installer'\n\n  # there is no need to use IfSilent for this one because the /SD switch takes care of that\n  MessageBox MB_OK|MB_ICONINFORMATION \"This is not a silent installer\" /SD IDOK\n\n  # when `SetOverwrite on' (which is the default) is used, the installer will show a message\n  # if it can't open a file for writing. On silent installers, the ignore option will be\n  # automatically selected. if `AllowSkipFiles off' (default is on) was used, there is no\n  # ignore option and the cancel option will be automatically selected.\n\n  # on is default\n  ; AllowSkipFiles on\n\n  # lock file\n  FileOpen $0 $TEMP\\silentOverwrite w\n  # try to extract - will fail\n  File /oname=$TEMP\\silentOverwrite silent.nsi\n  # unlcok\n  FileClose $0\n\n  # this will always show on silent installers because ignore is the option automatically\n  # selected when a file can't be opened for writing on a silent installer\n  MessageBox MB_OK|MB_ICONINFORMATION \"This message box always shows if the installer is silent\"\n\n  AllowSkipFiles off\n\n  # lock file\n  FileOpen $0 $TEMP\\silentOverwrite w\n  # try to extract - will fail\n  File /oname=$TEMP\\silentOverwrite silent.nsi\n  # unlcok\n  FileClose $0\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/unicode.nsi",
    "content": "﻿; Unicode installers will not be able to run on Windows 9x!\nUnicode true\n\nName \"Unicode Games\"\nOutFile \"unicode.exe\"\nRequestExecutionLevel User\nShowInstDetails show\nXPStyle on\n\n\nSection \"Unicode in UI\"\n\n\tDetailPrint \"Hello World!\"\n\tDetailPrint \"שלום עולם!\"\n\tDetailPrint \"مرحبا العالم!\"\n\tDetailPrint \"こんにちは、世界！\"\n\tDetailPrint \"你好世界！\"\n\tDetailPrint \"привет мир!\"\n\tDetailPrint \"안녕하세요!\"\n\n\tDetailPrint \"${U+00A9}\" # arbitrary unicode chars\n\nSectionEnd\n\n\nSection \"Unicode in Files\"\n\n\tVar /Global Message\n\n\tInitPluginsDir\n\tFileOpen $0 \"$PluginsDir\\Test.txt\" w\n\tIfErrors done\n\tFileWriteUTF16LE /BOM $0 \"Hello World \"\n\tFileWriteWord $0 0xD83C # Manually write ${U+1F30D}\n\tFileWriteWord $0 0xDF0D # as surrogate-pair\n\tFileWriteUTF16LE $0 \" and Sun ${U+2600}$\\r$\\n\"\n\tFileClose $0\n\n\tFileOpen $0 \"$PluginsDir\\Test.txt\" r\n\tIfErrors done\n\tFileReadUTF16LE $0 $Message\n\tFileClose $0\n\n\tDetailPrint \"Message: $Message\"\n\tdone:\n\nSectionEnd\n"
  },
  {
    "path": "setup/nsis/tools/Examples/viewhtml.nsi",
    "content": "; viewhtml.nsi\n;\n; This script creates a silent installer which extracts one (or more) HTML\n; files to a temporary directory, opens Internet Explorer to view the file(s),\n; and when Internet Explorer has quit, deletes the file(s).\n\n;--------------------------------\n\n; The name of the installer (not really used in a silent install)\nName \"ViewHTML\"\n\n; Set to silent mode\nSilentInstall silent\n\n; The file to write\nOutFile \"viewhtml.exe\"\n\n; Request application privileges for Windows Vista\nRequestExecutionLevel user\n\n;--------------------------------\n\n; The stuff to install\nSection \"\"\n\n  ; Get a temporary filename (in the Windows Temp directory)\n  GetTempFileName $R0\n  \n  ; Extract file\n  ; Lets skip this one, it's not built to be showin in IE\n  ; File /oname=$R0 \"..\\Menu\\compiler.html\"\n  ; and write our own! :)\n  FileOpen $0 $R0 \"w\"\n  FileWrite $0 \"<HTML><BODY><H1>HTML page for viewhtml.nsi</H1></BODY></HTML>\"\n  FileClose $0\n  \n  ; View file\n  ExecWait '\"$PROGRAMFILES\\Internet Explorer\\iexplore.exe\" \"$R0\"'\n\n  ; Note: another way of doing this would be to use ExecShell, but then you\n  ; really couldn't get away with deleting the files. Here is the ExecShell\n  ; line that you would want to use:\n  ;\n  ; ExecShell \"open\" '\"$R0\"'\n  ;\n  ; The advantage of this way is that it would use the default browser to\n  ; open the HTML.\n  ;\n  \n  ; Delete the files (on reboot if file is in use)\n  Delete /REBOOTOK $R0\n\nSectionEnd"
  },
  {
    "path": "setup/nsis/tools/Examples/waplugin.nsi",
    "content": "; waplugin.nsi\n;\n; This script will generate an installer that installs a Winamp 2 plug-in.\n;\n; This installer will automatically alert the user that installation was\n; successful, and ask them whether or not they would like to make the \n; plug-in the default and run Winamp.\n\n;--------------------------------\n\n; Uncomment the next line to enable auto Winamp download\n; !define WINAMP_AUTOINSTALL\n\n; The name of the installer\nName \"TinyVis Plug-in\"\n\n; The file to write\nOutFile \"waplugin.exe\"\n\n; The default installation directory\nInstallDir $PROGRAMFILES\\Winamp\n\n; detect winamp path from uninstall string if available\nInstallDirRegKey HKLM \\\n                 \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Winamp\" \\\n                 \"UninstallString\"\n\n; The text to prompt the user to enter a directory\nDirText \"Please select your Winamp path below (you will be able to proceed when Winamp is detected):\"\n# currently doesn't work - DirShow hide\n\n; automatically close the installer when done.\nAutoCloseWindow true\n\n; hide the \"show details\" box\nShowInstDetails nevershow\n\n; Request application privileges for Windows Vista\nRequestExecutionLevel admin\n\n;--------------------------------\n\n;Pages\n\nPage directory\nPage instfiles\n\n;--------------------------------\n\n; The stuff to install\n\nSection \"\"\n\n!ifdef WINAMP_AUTOINSTALL\n  Call MakeSureIGotWinamp\n!endif\n\n  Call QueryWinampVisPath\n  SetOutPath $1\n\n  ; File to extract\n  #File \"C:\\program files\\winamp\\plugins\\vis_nsfs.dll\"\n  File /oname=vis_nsfs.dll \"${NSISDIR}\\Plugins\\x86-ansi\\TypeLib.dll\" # dummy plug-in\n\n  ; prompt user, and if they select no, go to NoWinamp\n  MessageBox MB_YESNO|MB_ICONQUESTION \\\n             \"The plug-in was installed. Would you like to run Winamp now with TinyVis as the default plug-in?\" \\\n             IDNO NoWinamp\n    WriteINIStr \"$INSTDIR\\Winamp.ini\" \"Winamp\" \"visplugin_name\" \"vis_nsfs.dll\"\n    WriteINIStr \"$INSTDIR\\Winamp.ini\" \"Winamp\" \"visplugin_num\" \"0\"\n    Exec '\"$INSTDIR\\Winamp.exe\"'\n  NoWinamp:\n  \nSectionEnd\n\n;--------------------------------\n\nFunction .onVerifyInstDir\n\n!ifndef WINAMP_AUTOINSTALL\n\n  ;Check for Winamp installation\n\n  IfFileExists $INSTDIR\\Winamp.exe Good\n    Abort\n  Good:\n\n!endif ; WINAMP_AUTOINSTALL\n\nFunctionEnd\n\nFunction QueryWinampVisPath ; sets $1 with vis path\n\n  StrCpy $1 $INSTDIR\\Plugins\n  ; use DSPDir instead of VISDir to get DSP plugins directory\n  ReadINIStr $9 $INSTDIR\\winamp.ini Winamp VisDir \n  StrCmp $9 \"\" End\n  IfFileExists $9 0 End\n    StrCpy $1 $9 ; update dir\n  End:\n  \nFunctionEnd\n\n!ifdef WINAMP_AUTOINSTALL\n\nFunction GetWinampInstPath\n\n  Push $0\n  Push $1\n  Push $2\n  ReadRegStr $0 HKLM \\\n     \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Winamp\" \\ \n     \"UninstallString\"\n  StrCmp $0 \"\" fin\n\n    StrCpy $1 $0 1 0 ; get firstchar\n    StrCmp $1 '\"' \"\" getparent \n      ; if first char is \", let's remove \"'s first.\n      StrCpy $0 $0 \"\" 1\n      StrCpy $1 0\n      rqloop:\n        StrCpy $2 $0 1 $1\n        StrCmp $2 '\"' rqdone\n        StrCmp $2 \"\" rqdone\n        IntOp $1 $1 + 1\n        Goto rqloop\n      rqdone:\n      StrCpy $0 $0 $1\n    getparent:\n    ; the uninstall string goes to an EXE, let's get the directory.\n    StrCpy $1 -1\n    gploop:\n      StrCpy $2 $0 1 $1\n      StrCmp $2 \"\" gpexit\n      StrCmp $2 \"\\\" gpexit\n      IntOp $1 $1 - 1\n      Goto gploop\n    gpexit:\n    StrCpy $0 $0 $1\n\n    StrCmp $0 \"\" fin\n    IfFileExists $0\\winamp.exe fin\n      StrCpy $0 \"\"\n  fin:\n  Pop $2\n  Pop $1\n  Exch $0\n  \nFunctionEnd\n\nFunction MakeSureIGotWinamp\n\n  Call GetWinampInstPath\n  \n  Pop $0\n  StrCmp $0 \"\" getwinamp\n    Return\n    \n  getwinamp:\n  \n  Call ConnectInternet ;Make an internet connection (if no connection available)\n  \n  StrCpy $2 \"$TEMP\\Winamp Installer.exe\"\n  NSISdl::download http://download.nullsoft.com/winamp/client/winamp281_lite.exe $2\n  Pop $0\n  StrCmp $0 success success\n    SetDetailsView show\n    DetailPrint \"download failed: $0\"\n    Abort\n  success:\n    ExecWait '\"$2\" /S'\n    Delete $2\n    Call GetWinampInstPath\n    Pop $0\n    StrCmp $0 \"\" skip\n    StrCpy $INSTDIR $0\n  skip:\n  \nFunctionEnd\n\nFunction ConnectInternet\n\n  Push $R0\n    \n    ClearErrors\n    Dialer::AttemptConnect\n    IfErrors noie3\n    \n    Pop $R0\n    StrCmp $R0 \"online\" connected\n      MessageBox MB_OK|MB_ICONSTOP \"Cannot connect to the internet.\"\n      Quit\n    \n    noie3:\n  \n    ; IE3 not installed\n    MessageBox MB_OK|MB_ICONINFORMATION \"Please connect to the internet now.\"\n    \n    connected:\n  \n  Pop $R0\n  \nFunctionEnd\n\n!endif ; WINAMP_AUTOINSTALL"
  },
  {
    "path": "setup/nsis/tools/Include/Colors.nsh",
    "content": "!ifndef COLORS_NSH\n!define COLORS_NSH\n\n!verbose push\n!verbose 3\n\n# Squad\n# Rob Segal\n# Joel\n# Yathosho\n\n\n# Predefined HTML Hex colors\n!define WHITE \"FFFFFF\"\n!define BLACK \"000000\"\n!define YELLOW \"FFFF00\"\n!define RED \"FF0000\"\n!define GREEN \"00FF00\"\n!define BLUE \"0000FF\"\n!define MAGENTA \"FF00FF\"\n!define CYAN \"00FFFF\"\n\n# Function to convert red , green and blue integer values to HTML Hex format\n!define RGB '!insertmacro rgb2hex'\n\n# Function to convert red, green and blue integer values to Hexadecimal (0xRRGGBB) format\n!define HEX '!insertmacro rgb2hex2'\n\n# Function to get the r value from a RGB number\n!define GetRvalue '!insertmacro redvalue'\n\n# Function to get the g value from a RGB number\n!define GetGvalue '!insertmacro greenvalue'\n\n# Function to get the b value from a RGB number\n!define GetBvalue '!insertmacro bluevalue'\n\n# Function to get the r value from a Hex number\n!define GetRvalueX '!insertmacro bluevalue'\n\n# Function to get the g value from a Hex number\n!define GetGvalueX '!insertmacro greenvalue'\n\n# Function to get the r value from a HEX number\n!define GetBvalueX '!insertmacro redvalue'\n\n!macro rgb2hex output R G B\nIntFmt \"${output}\" \"%02X\" \"${R}\"\nIntFmt \"${output}\" \"${output}%02X\" \"${G}\"\nIntFmt \"${output}\" \"${output}%02X\" \"${B}\"\n!macroend\n\n!macro rgb2hex2 output R G B\nIntFmt \"${output}\" \"%02X\" \"${B}\"\nIntFmt \"${output}\" \"${output}%02X\" \"${G}\"\nIntFmt \"${output}\" \"${output}%02X\" \"${R}\"\n!macroend\n\n!macro redvalue output hexval\nStrCpy ${output} ${hexval} 2 0\nIntFmt \"${output}\" \"%02i\" \"0x${output}\"\n!macroend\n\n!macro greenvalue output hexval\nStrCpy ${output} ${hexval} 2 2\nIntFmt \"${output}\" \"%02i\" \"0x${output}\"\n!macroend\n\n!macro bluevalue output hexval\nStrCpy ${output} ${hexval} 2 4\nIntFmt \"${output}\" \"%02i\" \"0x${output}\"\n!macroend\n\n!verbose pop\n!endif"
  },
  {
    "path": "setup/nsis/tools/Include/FileFunc.nsh",
    "content": "/*\n_____________________________________________________________________________\n\n                       File Functions Header v3.4\n_____________________________________________________________________________\n\n 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\n See documentation for more information about the following functions.\n\n Usage in script:\n 1. !include \"FileFunc.nsh\"\n 2. [Section|Function]\n      ${FileFunction} \"Param1\" \"Param2\" \"...\" $var\n    [SectionEnd|FunctionEnd]\n\n\n FileFunction=[Locate|GetSize|DriveSpace|GetDrives|GetTime|GetFileAttributes|\n               GetFileVersion|GetExeName|GetExePath|GetParameters|GetOptions|\n               GetOptionsS|GetRoot|GetParent|GetFileName|GetBaseName|GetFileExt|\n               BannerTrimPath|DirState|RefreshShellIcons]\n\n_____________________________________________________________________________\n\n                       Thanks to:\n_____________________________________________________________________________\n\nGetSize\n\tKiCHiK (Function \"FindFiles\")\nDriveSpace\n\tsunjammer (Function \"CheckSpaceFree\")\nGetDrives\n\tdeguix (Based on his idea of Function \"DetectDrives\")\nGetTime\n\tTakhir (Script \"StatTest\") and deguix (Function \"FileModifiedDate\")\nGetFileVersion\n\tKiCHiK (Based on his example for command \"GetDLLVersion\")\nGetParameters\n\tsunjammer (Based on his Function \"GetParameters\")\nGetRoot\n\tKiCHiK (Based on his Function \"GetRoot\")\nGetParent\n\tsunjammer (Based on his Function \"GetParent\")\nGetFileName\n\tKiCHiK (Based on his Function \"GetFileName\")\nGetBaseName\n\tcomperio (Based on his idea of Function \"GetBaseName\")\nGetFileExt\n\topher (author)\nRefreshShellIcons\n\tjerome tremblay (author)\n*/\n\n\n;_____________________________________________________________________________\n;\n;                         Macros\n;_____________________________________________________________________________\n;\n; Change log window verbosity (default: 3=no script)\n;\n; Example:\n; !include \"FileFunc.nsh\"\n; !insertmacro Locate\n; ${FILEFUNC_VERBOSE} 4   # all verbosity\n; !insertmacro VersionCompare\n; ${FILEFUNC_VERBOSE} 3   # no script\n\n!ifndef FILEFUNC_INCLUDED\n\n!verbose push 3\n!define /IfNDef _FILEFUNC_VERBOSE 3\n!verbose ${_FILEFUNC_VERBOSE}\n!define FILEFUNC_VERBOSE `!insertmacro FILEFUNC_VERBOSE`\n\n!define FILEFUNC_INCLUDED\n\n!include Util.nsh\n\n\n!macro FILEFUNC_VERBOSE _VERBOSE\n\t!verbose push 3\n\t!define /ReDef _FILEFUNC_VERBOSE ${_VERBOSE}\n\t!verbose pop\n!macroend\n\n!macro LocateCall _PATH _OPTIONS _FUNC\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush $0\n\tPush `${_PATH}`\n\tPush `${_OPTIONS}`\n\tGetFunctionAddress $0 `${_FUNC}`\n\tPush `$0`\n\t${CallArtificialFunction} Locate_\n\tPop $0\n\t!verbose pop\n!macroend\n\n!macro GetSizeCall _PATH _OPTIONS _RESULT1 _RESULT2 _RESULT3\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PATH}`\n\tPush `${_OPTIONS}`\n\t${CallArtificialFunction} GetSize_\n\tPop ${_RESULT1}\n\tPop ${_RESULT2}\n\tPop ${_RESULT3}\n\t!verbose pop\n!macroend\n\n!macro DriveSpaceCall _DRIVE _OPTIONS _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_DRIVE}`\n\tPush `${_OPTIONS}`\n\t${CallArtificialFunction} DriveSpace_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetDrivesCall _DRV _FUNC\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush $0\n\tPush `${_DRV}`\n\tGetFunctionAddress $0 `${_FUNC}`\n\tPush `$0`\n\t${CallArtificialFunction} GetDrives_\n\tPop $0\n\t!verbose pop\n!macroend\n\n!macro GetTimeCall _FILE _OPTION _RESULT1 _RESULT2 _RESULT3 _RESULT4 _RESULT5 _RESULT6 _RESULT7\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_FILE}`\n\tPush `${_OPTION}`\n\t${CallArtificialFunction} GetTime_\n\tPop ${_RESULT1}\n\tPop ${_RESULT2}\n\tPop ${_RESULT3}\n\tPop ${_RESULT4}\n\tPop ${_RESULT5}\n\tPop ${_RESULT6}\n\tPop ${_RESULT7}\n\t!verbose pop\n!macroend\n\n!macro GetFileAttributesCall _PATH _ATTR _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PATH}`\n\tPush `${_ATTR}`\n\t${CallArtificialFunction} GetFileAttributes_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetFileVersionCall _FILE _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_FILE}`\n\t${CallArtificialFunction} GetFileVersion_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetExeNameCall _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t${CallArtificialFunction} GetExeName_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetExePathCall _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t${CallArtificialFunction} GetExePath_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetParametersCall _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t${CallArtificialFunction} GetParameters_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetOptionsCall _PARAMETERS _OPTION _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PARAMETERS}`\n\tPush `${_OPTION}`\n\t${CallArtificialFunction} GetOptions_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetOptionsSCall _PARAMETERS _OPTION _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PARAMETERS}`\n\tPush `${_OPTION}`\n\t${CallArtificialFunction} GetOptionsS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetRootCall _FULLPATH _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_FULLPATH}`\n\t${CallArtificialFunction} GetRoot_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetParentCall _PATHSTRING _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PATHSTRING}`\n\t${CallArtificialFunction} GetParent_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetFileNameCall _PATHSTRING _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PATHSTRING}`\n\t${CallArtificialFunction} GetFileName_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetBaseNameCall _FILESTRING _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_FILESTRING}`\n\t${CallArtificialFunction} GetBaseName_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro GetFileExtCall _FILESTRING _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_FILESTRING}`\n\t${CallArtificialFunction} GetFileExt_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro BannerTrimPathCall _PATH _LENGHT _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PATH}`\n\tPush `${_LENGHT}`\n\t${CallArtificialFunction} BannerTrimPath_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro DirStateCall _PATH _RESULT\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\tPush `${_PATH}`\n\t${CallArtificialFunction} DirState_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro RefreshShellIconsCall\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t${CallArtificialFunction} RefreshShellIcons_\n\t!verbose pop\n!macroend\n\n!define Locate `!insertmacro LocateCall`\n!define un.Locate `!insertmacro LocateCall`\n\n!macro Locate\n!macroend\n\n!macro un.Locate\n!macroend\n\n!macro Locate_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\t\n\tExch $2\n\tExch\n\tExch $1\n\tExch\n\tExch 2\n\tExch $0\n\tExch 2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R6\n\tPush $R7\n\tPush $R8\n\tPush $R9\n\tClearErrors\n\n\tStrCpy $3 ''\n\tStrCpy $4 ''\n\tStrCpy $5 ''\n\tStrCpy $6 ''\n\tStrCpy $7 ''\n\tStrCpy $8 0\n\tStrCpy $R7 ''\n\n\tStrCpy $R9 $0 1 -1\n\tStrCmp $R9 '\\' 0 +3\n\tStrCpy $0 $0 -1\n\tgoto -3\n\tIfFileExists '$0\\*.*' 0 FileFunc_Locate_error\n\n\tFileFunc_Locate_option:\n\tStrCpy $R9 $1 1\n\tStrCpy $1 $1 '' 1\n\tStrCmp $R9 ' ' -2\n\tStrCmp $R9 '' FileFunc_Locate_sizeset\n\tStrCmp $R9 '/' 0 -4\n\tStrCpy $9 -1\n\tIntOp $9 $9 + 1\n\tStrCpy $R9 $1 1 $9\n\tStrCmp $R9 '' +2\n\tStrCmp $R9 '/' 0 -3\n\tStrCpy $R8 $1 $9\n\tStrCpy $R8 $R8 '' 2\n\tStrCpy $R9 $R8 '' -1\n\tStrCmp $R9 ' ' 0 +3\n\tStrCpy $R8 $R8 -1\n\tgoto -3\n\tStrCpy $R9 $1 2\n\tStrCpy $1 $1 '' $9\n\n\tStrCmp $R9 'L=' 0 FileFunc_Locate_mask\n\tStrCpy $3 $R8\n\tStrCmp $3 '' +6\n\tStrCmp $3 'FD' +5\n\tStrCmp $3 'F' +4\n\tStrCmp $3 'D' +3\n\tStrCmp $3 'DE' +2\n\tStrCmp $3 'FDE' 0 FileFunc_Locate_error\n\tgoto FileFunc_Locate_option\n\n\tFileFunc_Locate_mask:\n\tStrCmp $R9 'M=' 0 FileFunc_Locate_size\n\tStrCpy $4 $R8\n\tgoto FileFunc_Locate_option\n\n\tFileFunc_Locate_size:\n\tStrCmp $R9 'S=' 0 FileFunc_Locate_gotosubdir\n\tStrCpy $6 $R8\n\tgoto FileFunc_Locate_option\n\n\tFileFunc_Locate_gotosubdir:\n\tStrCmp $R9 'G=' 0 FileFunc_Locate_banner\n\tStrCpy $7 $R8\n\tStrCmp $7 '' +3\n\tStrCmp $7 '1' +2\n\tStrCmp $7 '0' 0 FileFunc_Locate_error\n\tgoto FileFunc_Locate_option\n\n\tFileFunc_Locate_banner:\n\tStrCmp $R9 'B=' 0 FileFunc_Locate_error\n\tStrCpy $R7 $R8\n\tStrCmp $R7 '' +3\n\tStrCmp $R7 '1' +2\n\tStrCmp $R7 '0' 0 FileFunc_Locate_error\n\tgoto FileFunc_Locate_option\n\n\tFileFunc_Locate_sizeset:\n\tStrCmp $6 '' FileFunc_Locate_default\n\tStrCpy $9 0\n\tStrCpy $R9 $6 1 $9\n\tStrCmp $R9 '' +4\n\tStrCmp $R9 ':' +3\n\tIntOp $9 $9 + 1\n\tgoto -4\n\tStrCpy $5 $6 $9\n\tIntOp $9 $9 + 1\n\tStrCpy $1 $6 1 -1\n\tStrCpy $6 $6 -1 $9\n\tStrCmp $5 '' +2\n\tIntOp $5 $5 + 0\n\tStrCmp $6 '' +2\n\tIntOp $6 $6 + 0\n\n\tStrCmp $1 'B' 0 +3\n\tStrCpy $1 1\n\tgoto FileFunc_Locate_default\n\tStrCmp $1 'K' 0 +3\n\tStrCpy $1 1024\n\tgoto FileFunc_Locate_default\n\tStrCmp $1 'M' 0 +3\n\tStrCpy $1 1048576\n\tgoto FileFunc_Locate_default\n\tStrCmp $1 'G' 0 FileFunc_Locate_error\n\tStrCpy $1 1073741824\n\n\tFileFunc_Locate_default:\n\tStrCmp $3 '' 0 +2\n\tStrCpy $3 'FD'\n\tStrCmp $4 '' 0 +2\n\tStrCpy $4 '*.*'\n\tStrCmp $7 '' 0 +2\n\tStrCpy $7 '1'\n\tStrCmp $R7 '' 0 +2\n\tStrCpy $R7 '0'\n\tStrCpy $7 'G$7B$R7'\n\n\tStrCpy $8 1\n\tPush $0\n\tSetDetailsPrint textonly\n\n\tFileFunc_Locate_nextdir:\n\tIntOp $8 $8 - 1\n\tPop $R8\n\n\tStrCpy $9 $7 2 2\n\tStrCmp $9 'B0' +3\n\tGetLabelAddress $9 FileFunc_Locate_findfirst\n\tgoto call\n\tDetailPrint 'Search in: $R8'\n\n\tFileFunc_Locate_findfirst:\n\tFindFirst $0 $R7 '$R8\\$4'\n\tIfErrors FileFunc_Locate_subdir\n\tStrCmp $R7 '.' 0 FileFunc_Locate_dir\n\tFindNext $0 $R7\n\tStrCmp $R7 '..' 0 FileFunc_Locate_dir\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_Locate_dir\n\tFindClose $0\n\tgoto FileFunc_Locate_subdir\n\n\tFileFunc_Locate_dir:\n\tIfFileExists '$R8\\$R7\\*.*' 0 FileFunc_Locate_file\n\tStrCpy $R6 ''\n\tStrCmp $3 'DE' +4\n\tStrCmp $3 'FDE' +3\n\tStrCmp $3 'FD' FileFunc_Locate_precall\n\tStrCmp $3 'F' FileFunc_Locate_findnext FileFunc_Locate_precall\n\tFindFirst $9 $R9 '$R8\\$R7\\*.*'\n\tStrCmp $R9 '.' 0 +4\n\tFindNext $9 $R9\n\tStrCmp $R9 '..' 0 +2\n\tFindNext $9 $R9\n\tFindClose $9\n\tIfErrors FileFunc_Locate_precall FileFunc_Locate_findnext\n\n\tFileFunc_Locate_file:\n\tStrCmp $3 'FDE' +3\n\tStrCmp $3 'FD' +2\n\tStrCmp $3 'F' 0 FileFunc_Locate_findnext\n\tStrCpy $R6 0\n\tStrCmp $5$6 '' FileFunc_Locate_precall\n\tFileOpen $9 '$R8\\$R7' r\n\tIfErrors +3\n\tFileSeek $9 0 END $R6\n\tFileClose $9\n\tSystem::Int64Op $R6 / $1\n\tPop $R6\n\tStrCmp $5 '' +2\n\tIntCmp $R6 $5 0 FileFunc_Locate_findnext\n\tStrCmp $6 '' +2\n\tIntCmp $R6 $6 0 0 FileFunc_Locate_findnext\n\n\tFileFunc_Locate_precall:\n\tStrCpy $9 0\n\tStrCpy $R9 '$R8\\$R7'\n\n\tcall:\n\tPush $0\n\tPush $1\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R7\n\tPush $R8\n\tStrCmp $9 0 +4\n\tStrCpy $R6 ''\n\tStrCpy $R7 ''\n\tStrCpy $R9 ''\n\tCall $2\n\tPop $R9\n\tPop $R8\n\tPop $R7\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\n\tIfErrors 0 +3\n\tFindClose $0\n\tgoto FileFunc_Locate_error\n\tStrCmp $R9 'StopLocate' 0 +3\n\tFindClose $0\n\tgoto FileFunc_Locate_clearstack\n\tgoto $9\n\n\tFileFunc_Locate_findnext:\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_Locate_dir\n\tFindClose $0\n\n\tFileFunc_Locate_subdir:\n\tStrCpy $9 $7 2\n\tStrCmp $9 'G0' FileFunc_Locate_end\n\tFindFirst $0 $R7 '$R8\\*.*'\n\tStrCmp $R7 '.' 0 FileFunc_Locate_pushdir\n\tFindNext $0 $R7\n\tStrCmp $R7 '..' 0 FileFunc_Locate_pushdir\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_Locate_pushdir\n\tFindClose $0\n\tStrCmp $8 0 FileFunc_Locate_end FileFunc_Locate_nextdir\n\n\tFileFunc_Locate_pushdir:\n\tIfFileExists '$R8\\$R7\\*.*' 0 +3\n\tPush '$R8\\$R7'\n\tIntOp $8 $8 + 1\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_Locate_pushdir\n\tFindClose $0\n\tStrCmp $8 0 FileFunc_Locate_end FileFunc_Locate_nextdir\n\n\tFileFunc_Locate_error:\n\tSetErrors\n\n\tFileFunc_Locate_clearstack:\n\tStrCmp $8 0 FileFunc_Locate_end\n\tIntOp $8 $8 - 1\n\tPop $R8\n\tgoto FileFunc_Locate_clearstack\n\n\tFileFunc_Locate_end:\n\tSetDetailsPrint both\n\tPop $R9\n\tPop $R8\n\tPop $R7\n\tPop $R6\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\n\t!verbose pop\n!macroend\n\n!define GetSize `!insertmacro GetSizeCall`\n!define un.GetSize `!insertmacro GetSizeCall`\n\n!macro GetSize\n!macroend\n\n!macro un.GetSize\n!macroend\n\n!macro GetSize_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R3\n\tPush $R4\n\tPush $R5\n\tPush $R6\n\tPush $R7\n\tPush $R8\n\tPush $R9\n\tClearErrors\n\n\tStrCpy $R9 $0 1 -1\n\tStrCmp $R9 '\\' 0 +3\n\tStrCpy $0 $0 -1\n\tgoto -3\n\tIfFileExists '$0\\*.*' 0 FileFunc_GetSize_error\n\n\tStrCpy $3 ''\n\tStrCpy $4 ''\n\tStrCpy $5 ''\n\tStrCpy $6 ''\n\tStrCpy $8 0\n\tStrCpy $R3 ''\n\tStrCpy $R4 ''\n\tStrCpy $R5 ''\n\n\tFileFunc_GetSize_option:\n\tStrCpy $R9 $1 1\n\tStrCpy $1 $1 '' 1\n\tStrCmp $R9 ' ' -2\n\tStrCmp $R9 '' FileFunc_GetSize_sizeset\n\tStrCmp $R9 '/' 0 -4\n\n\tStrCpy $9 -1\n\tIntOp $9 $9 + 1\n\tStrCpy $R9 $1 1 $9\n\tStrCmp $R9 '' +2\n\tStrCmp $R9 '/' 0 -3\n\tStrCpy $8 $1 $9\n\tStrCpy $8 $8 '' 2\n\tStrCpy $R9 $8 '' -1\n\tStrCmp $R9 ' ' 0 +3\n\tStrCpy $8 $8 -1\n\tgoto -3\n\tStrCpy $R9 $1 2\n\tStrCpy $1 $1 '' $9\n\n\tStrCmp $R9 'M=' 0 FileFunc_GetSize_size\n\tStrCpy $4 $8\n\tgoto FileFunc_GetSize_option\n\n\tFileFunc_GetSize_size:\n\tStrCmp $R9 'S=' 0 FileFunc_GetSize_gotosubdir\n\tStrCpy $6 $8\n\tgoto FileFunc_GetSize_option\n\n\tFileFunc_GetSize_gotosubdir:\n\tStrCmp $R9 'G=' 0 FileFunc_GetSize_error\n\tStrCpy $7 $8\n\tStrCmp $7 '' +3\n\tStrCmp $7 '1' +2\n\tStrCmp $7 '0' 0 FileFunc_GetSize_error\n\tgoto FileFunc_GetSize_option\n\n\tFileFunc_GetSize_sizeset:\n\tStrCmp $6 '' FileFunc_GetSize_default\n\tStrCpy $9 0\n\tStrCpy $R9 $6 1 $9\n\tStrCmp $R9 '' +4\n\tStrCmp $R9 ':' +3\n\tIntOp $9 $9 + 1\n\tgoto -4\n\tStrCpy $5 $6 $9\n\tIntOp $9 $9 + 1\n\tStrCpy $1 $6 1 -1\n\tStrCpy $6 $6 -1 $9\n\tStrCmp $5 '' +2\n\tIntOp $5 $5 + 0\n\tStrCmp $6 '' +2\n\tIntOp $6 $6 + 0\n\n\tStrCmp $1 'B' 0 +4\n\tStrCpy $1 1\n\tStrCpy $2 bytes\n\tgoto FileFunc_GetSize_default\n\tStrCmp $1 'K' 0 +4\n\tStrCpy $1 1024\n\tStrCpy $2 Kb\n\tgoto FileFunc_GetSize_default\n\tStrCmp $1 'M' 0 +4\n\tStrCpy $1 1048576\n\tStrCpy $2 Mb\n\tgoto FileFunc_GetSize_default\n\tStrCmp $1 'G' 0 FileFunc_GetSize_error\n\tStrCpy $1 1073741824\n\tStrCpy $2 Gb\n\n\tFileFunc_GetSize_default:\n\tStrCmp $4 '' 0 +2\n\tStrCpy $4 '*.*'\n\tStrCmp $7 '' 0 +2\n\tStrCpy $7 '1'\n\n\tStrCpy $8 1\n\tPush $0\n\tSetDetailsPrint textonly\n\n\tFileFunc_GetSize_nextdir:\n\tIntOp $8 $8 - 1\n\tPop $R8\n\tFindFirst $0 $R7 '$R8\\$4'\n\tIfErrors FileFunc_GetSize_show\n\tStrCmp $R7 '.' 0 FileFunc_GetSize_dir\n\tFindNext $0 $R7\n\tStrCmp $R7 '..' 0 FileFunc_GetSize_dir\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_GetSize_dir\n\tFindClose $0\n\tgoto FileFunc_GetSize_show\n\n\tFileFunc_GetSize_dir:\n\tIfFileExists '$R8\\$R7\\*.*' 0 FileFunc_GetSize_file\n\tIntOp $R5 $R5 + 1\n\tgoto FileFunc_GetSize_findnext\n\n\tFileFunc_GetSize_file:\n\tStrCpy $R6 0\n\tStrCmp $5$6 '' 0 +3\n\tIntOp $R4 $R4 + 1\n\tgoto FileFunc_GetSize_findnext\n\tFileOpen $9 '$R8\\$R7' r\n\tIfErrors +3\n\tFileSeek $9 0 END $R6\n\tFileClose $9\n\tStrCmp $5 '' +2\n\tIntCmp $R6 $5 0 FileFunc_GetSize_findnext\n\tStrCmp $6 '' +2\n\tIntCmp $R6 $6 0 0 FileFunc_GetSize_findnext\n\tIntOp $R4 $R4 + 1\n\tSystem::Int64Op $R3 + $R6\n\tPop $R3\n\n\tFileFunc_GetSize_findnext:\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_GetSize_dir\n\tFindClose $0\n\n\tFileFunc_GetSize_show:\n\tStrCmp $5$6 '' FileFunc_GetSize_nosize\n\tSystem::Int64Op $R3 / $1\n\tPop $9\n\tDetailPrint 'Size:$9 $2  Files:$R4  Folders:$R5'\n\tgoto FileFunc_GetSize_subdir\n\tFileFunc_GetSize_nosize:\n\tDetailPrint 'Files:$R4  Folders:$R5'\n\n\tFileFunc_GetSize_subdir:\n\tStrCmp $7 0 FileFunc_GetSize_preend\n\tFindFirst $0 $R7 '$R8\\*.*'\n\tStrCmp $R7 '.' 0 FileFunc_GetSize_pushdir\n\tFindNext $0 $R7\n\tStrCmp $R7 '..' 0 FileFunc_GetSize_pushdir\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_GetSize_pushdir\n\tFindClose $0\n\tStrCmp $8 0 FileFunc_GetSize_preend FileFunc_GetSize_nextdir\n\n\tFileFunc_GetSize_pushdir:\n\tIfFileExists '$R8\\$R7\\*.*' 0 +3\n\tPush '$R8\\$R7'\n\tIntOp $8 $8 + 1\n\tFindNext $0 $R7\n\tIfErrors 0 FileFunc_GetSize_pushdir\n\tFindClose $0\n\tStrCmp $8 0 FileFunc_GetSize_preend FileFunc_GetSize_nextdir\n\n\tFileFunc_GetSize_preend:\n\tStrCmp $R3 '' FileFunc_GetSize_nosizeend\n\tSystem::Int64Op $R3 / $1\n\tPop $R3\n\tFileFunc_GetSize_nosizeend:\n\tStrCpy $2 $R4\n\tStrCpy $1 $R5\n\tStrCpy $0 $R3\n\tgoto FileFunc_GetSize_end\n\n\tFileFunc_GetSize_error:\n\tSetErrors\n\tStrCpy $0 ''\n\tStrCpy $1 ''\n\tStrCpy $2 ''\n\n\tFileFunc_GetSize_end:\n\tSetDetailsPrint both\n\tPop $R9\n\tPop $R8\n\tPop $R7\n\tPop $R6\n\tPop $R5\n\tPop $R4\n\tPop $R3\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tExch $2\n\tExch\n\tExch $1\n\tExch 2\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define DriveSpace `!insertmacro DriveSpaceCall`\n!define un.DriveSpace `!insertmacro DriveSpaceCall`\n\n!macro DriveSpace\n!macroend\n\n!macro un.DriveSpace\n!macroend\n\n!macro DriveSpace_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tClearErrors\n\n\tStrCpy $2 $0 1 -1\n\tStrCmp $2 '\\' 0 +3\n\tStrCpy $0 $0 -1\n\tgoto -3\n\tIfFileExists '$0\\NUL' 0 FileFunc_DriveSpace_error\n\n\tStrCpy $5 ''\n\tStrCpy $6 ''\n\n\tFileFunc_DriveSpace_option:\n\tStrCpy $2 $1 1\n\tStrCpy $1 $1 '' 1\n\tStrCmp $2 ' ' -2\n\tStrCmp $2 '' FileFunc_DriveSpace_default\n\tStrCmp $2 '/' 0 -4\n\tStrCpy $3 -1\n\tIntOp $3 $3 + 1\n\tStrCpy $2 $1 1 $3\n\tStrCmp $2 '' +2\n\tStrCmp $2 '/' 0 -3\n\tStrCpy $4 $1 $3\n\tStrCpy $4 $4 '' 2\n\tStrCpy $2 $4 1 -1\n\tStrCmp $2 ' ' 0 +3\n\tStrCpy $4 $4 -1\n\tgoto -3\n\tStrCpy $2 $1 2\n\tStrCpy $1 $1 '' $3\n\n\tStrCmp $2 'D=' 0 FileFunc_DriveSpace_unit\n\tStrCpy $5 $4\n\tStrCmp $5 '' +4\n\tStrCmp $5 'T' +3\n\tStrCmp $5 'O' +2\n\tStrCmp $5 'F' 0 FileFunc_DriveSpace_error\n\tgoto FileFunc_DriveSpace_option\n\n\tFileFunc_DriveSpace_unit:\n\tStrCmp $2 'S=' 0 FileFunc_DriveSpace_error\n\tStrCpy $6 $4\n\tgoto FileFunc_DriveSpace_option\n\n\tFileFunc_DriveSpace_default:\n\tStrCmp $5 '' 0 +2\n\tStrCpy $5 'T'\n\tStrCmp $6 '' 0 +3\n\tStrCpy $6 '1'\n\tgoto FileFunc_DriveSpace_getspace\n\n\tStrCmp $6 'B' 0 +3\n\tStrCpy $6 1\n\tgoto FileFunc_DriveSpace_getspace\n\tStrCmp $6 'K' 0 +3\n\tStrCpy $6 1024\n\tgoto FileFunc_DriveSpace_getspace\n\tStrCmp $6 'M' 0 +3\n\tStrCpy $6 1048576\n\tgoto FileFunc_DriveSpace_getspace\n\tStrCmp $6 'G' 0 FileFunc_DriveSpace_error\n\tStrCpy $6 1073741824\n\n\tFileFunc_DriveSpace_getspace:\n\tSystem::Call 'kernel32::GetDiskFreeSpaceEx(t, *l, *l, *l)i(r0,.r2,.r3,.)'\n\n\tStrCmp $5 T 0 +3\n\tStrCpy $0 $3\n\tgoto FileFunc_DriveSpace_getsize\n\tStrCmp $5 O 0 +4\n\tSystem::Int64Op $3 - $2\n\tPop $0\n\tgoto FileFunc_DriveSpace_getsize\n\tStrCmp $5 F 0 +2\n\tStrCpy $0 $2\n\n\tFileFunc_DriveSpace_getsize:\n\tSystem::Int64Op $0 / $6\n\tPop $0\n\tgoto FileFunc_DriveSpace_end\n\n\tFileFunc_DriveSpace_error:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tFileFunc_DriveSpace_end:\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetDrives `!insertmacro GetDrivesCall`\n!define un.GetDrives `!insertmacro GetDrivesCall`\n\n!macro GetDrives\n!macroend\n\n!macro un.GetDrives\n!macroend\n\n!macro GetDrives_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $8\n\tPush $9\n\n\tSystem::StrAlloc 1024\n\tPop $2\n\tSystem::Call 'kernel32::GetLogicalDriveStrings(i,i) i(1024, r2)'\n\n\tStrCmp $0 ALL FileFunc_GetDrives_drivestring\n\tStrCmp $0 '' 0 FileFunc_GetDrives_typeset\n\tStrCpy $0 ALL\n\tgoto FileFunc_GetDrives_drivestring\n\n\tFileFunc_GetDrives_typeset:\n\tStrCpy $6 -1\n\tIntOp $6 $6 + 1\n\tStrCpy $8 $0 1 $6\n\tStrCmp $8$0 '' FileFunc_GetDrives_enumex\n\tStrCmp $8 '' +2\n\tStrCmp $8 '+' 0 -4\n\tStrCpy $8 $0 $6\n\tIntOp $6 $6 + 1\n\tStrCpy $0 $0 '' $6\n\n\tStrCmp $8 'FDD' 0 +3\n\tStrCpy $6 2\n\tgoto FileFunc_GetDrives_drivestring\n\tStrCmp $8 'HDD' 0 +3\n\tStrCpy $6 3\n\tgoto FileFunc_GetDrives_drivestring\n\tStrCmp $8 'NET' 0 +3\n\tStrCpy $6 4\n\tgoto FileFunc_GetDrives_drivestring\n\tStrCmp $8 'CDROM' 0 +3\n\tStrCpy $6 5\n\tgoto FileFunc_GetDrives_drivestring\n\tStrCmp $8 'RAM' 0 FileFunc_GetDrives_typeset\n\tStrCpy $6 6\n\n\tFileFunc_GetDrives_drivestring:\n\tStrCpy $3 $2\n\n\tFileFunc_GetDrives_enumok:\n\tSystem::Call 'kernel32::lstrlen(t) i(i r3) .r4'\n\tStrCmp $4$0 '0ALL' FileFunc_GetDrives_enumex\n\tStrCmp $4 0 FileFunc_GetDrives_typeset\n\tSystem::Call 'kernel32::GetDriveType(t) i(i r3) .r5'\n\n\tStrCmp $0 ALL +2\n\tStrCmp $5 $6 FileFunc_GetDrives_letter FileFunc_GetDrives_enumnext\n\tStrCmp $5 2 0 +3\n\tStrCpy $8 FDD\n\tgoto FileFunc_GetDrives_letter\n\tStrCmp $5 3 0 +3\n\tStrCpy $8 HDD\n\tgoto FileFunc_GetDrives_letter\n\tStrCmp $5 4 0 +3\n\tStrCpy $8 NET\n\tgoto FileFunc_GetDrives_letter\n\tStrCmp $5 5 0 +3\n\tStrCpy $8 CDROM\n\tgoto FileFunc_GetDrives_letter\n\tStrCmp $5 6 0 FileFunc_GetDrives_enumex\n\tStrCpy $8 RAM\n\n\tFileFunc_GetDrives_letter:\n\tSystem::Call '*$3(&t1024 .r9)'\n\n\tPush $0\n\tPush $1\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $8\n\tCall $1\n\tPop $9\n\tPop $8\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tStrCmp $9 'StopGetDrives' FileFunc_GetDrives_enumex\n\n\tFileFunc_GetDrives_enumnext:\n\tIntOp $4 $4 * ${NSIS_CHAR_SIZE}\n\tIntOp $3 $3 + $4\n\tIntOp $3 $3 + ${NSIS_CHAR_SIZE}\n\tgoto FileFunc_GetDrives_enumok\n\n\tFileFunc_GetDrives_enumex:\n\tSystem::Free $2\n\n\tPop $9\n\tPop $8\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\t\n\t!verbose pop\n!macroend\n\n!define GetTime `!insertmacro GetTimeCall`\n!define un.GetTime `!insertmacro GetTimeCall`\n\n!macro GetTime\n!macroend\n\n!macro un.GetTime\n!macroend\n\n!macro GetTime_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tClearErrors\n\n\tStrCmp $1 'L' FileFunc_GetTime_gettime\n\tStrCmp $1 'A' FileFunc_GetTime_getfile\n\tStrCmp $1 'C' FileFunc_GetTime_getfile\n\tStrCmp $1 'M' FileFunc_GetTime_getfile\n\tStrCmp $1 'LS' FileFunc_GetTime_gettime\n\tStrCmp $1 'AS' FileFunc_GetTime_getfile\n\tStrCmp $1 'CS' FileFunc_GetTime_getfile\n\tStrCmp $1 'MS' FileFunc_GetTime_getfile\n\tgoto FileFunc_GetTime_error\n\n\tFileFunc_GetTime_getfile:\n\tIfFileExists $0 0 FileFunc_GetTime_error\n\tSystem::Call '*(i,l,l,l,i,i,i,i,&t260,&t14) p .r6'\n\tSystem::Call 'kernel32::FindFirstFile(t,p)p(r0,r6) .r2'\n\tSystem::Call 'kernel32::FindClose(i)i(r2)'\n\n\tFileFunc_GetTime_gettime:\n\tSystem::Call '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2) p .r7'\n\tStrCmp $1 'L' 0 FileFunc_GetTime_systemtime\n\tSystem::Call 'kernel32::GetLocalTime(p)i(r7)'\n\tgoto FileFunc_GetTime_convert\n\tFileFunc_GetTime_systemtime:\n\tStrCmp $1 'LS' 0 FileFunc_GetTime_filetime\n\tSystem::Call 'kernel32::GetSystemTime(p)i(r7)'\n\tgoto FileFunc_GetTime_convert\n\n\tFileFunc_GetTime_filetime:\n\tSystem::Call '*$6(i,l,l,l,i,i,i,i,&t260,&t14)p(,.r4,.r3,.r2)'\n\tSystem::Free $6\n\tStrCmp $1 'A' 0 +3\n\tStrCpy $2 $3\n\tgoto FileFunc_GetTime_tolocal\n\tStrCmp $1 'C' 0 +3\n\tStrCpy $2 $4\n\tgoto FileFunc_GetTime_tolocal\n\tStrCmp $1 'M' FileFunc_GetTime_tolocal\n\n\tStrCmp $1 'AS' FileFunc_GetTime_tosystem\n\tStrCmp $1 'CS' 0 +3\n\tStrCpy $3 $4\n\tgoto FileFunc_GetTime_tosystem\n\tStrCmp $1 'MS' 0 +3\n\tStrCpy $3 $2\n\tgoto FileFunc_GetTime_tosystem\n\n\tFileFunc_GetTime_tolocal:\n\tSystem::Call 'kernel32::FileTimeToLocalFileTime(*l,*l)i(r2,.r3)'\n\tFileFunc_GetTime_tosystem:\n\tSystem::Call 'kernel32::FileTimeToSystemTime(*l,i)i(r3,r7)'\n\n\tFileFunc_GetTime_convert:\n\tSystem::Call '*$7(&i2.r5,&i2.r6,&i2.r4,&i2.r0,&i2.r3,&i2.r2,&i2.r1,&i2)'\n\tSystem::Free $7\n\n\tIntFmt $6 \"%.2u\" $6 ; Month\n\tIntFmt $0 \"%.2u\" $0 ; Day\n\tIntFmt $3 \"%.2u\" $3 ; Hour\n\tIntFmt $2 \"%.2u\" $2 ; Minute\n\tIntFmt $1 \"%.2u\" $1 ; Second\n\n\tStrCmp $4 0 0 +3\n\tStrCpy $4 Sunday\n\tgoto FileFunc_GetTime_end\n\tStrCmp $4 1 0 +3\n\tStrCpy $4 Monday\n\tgoto FileFunc_GetTime_end\n\tStrCmp $4 2 0 +3\n\tStrCpy $4 Tuesday\n\tgoto FileFunc_GetTime_end\n\tStrCmp $4 3 0 +3\n\tStrCpy $4 Wednesday\n\tgoto FileFunc_GetTime_end\n\tStrCmp $4 4 0 +3\n\tStrCpy $4 Thursday\n\tgoto FileFunc_GetTime_end\n\tStrCmp $4 5 0 +3\n\tStrCpy $4 Friday\n\tgoto FileFunc_GetTime_end\n\tStrCmp $4 6 0 FileFunc_GetTime_error\n\tStrCpy $4 Saturday\n\tgoto FileFunc_GetTime_end\n\n\tFileFunc_GetTime_error:\n\tSetErrors\n\tStrCpy $0 ''\n\tStrCpy $1 ''\n\tStrCpy $2 ''\n\tStrCpy $3 ''\n\tStrCpy $4 ''\n\tStrCpy $5 ''\n\tStrCpy $6 ''\n\n\tFileFunc_GetTime_end:\n\tPop $7\n\tExch $6\n\tExch\n\tExch $5\n\tExch 2\n\tExch $4\n\tExch 3\n\tExch $3\n\tExch 4\n\tExch $2\n\tExch 5\n\tExch $1\n\tExch 6\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetFileAttributes `!insertmacro GetFileAttributesCall`\n!define un.GetFileAttributes `!insertmacro GetFileAttributesCall`\n\n!macro GetFileAttributes\n!macroend\n\n!macro un.GetFileAttributes\n!macroend\n\n!macro GetFileAttributes_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\n\tSystem::Call 'kernel32::GetFileAttributes(t r0)i .r2'\n\tStrCmp $2 -1 FileFunc_GetFileAttributes_error\n\tStrCpy $3 ''\n\n\tIntOp $0 $2 & 0x4000\n\tIntCmp $0 0 +2\n\tStrCpy $3 'ENCRYPTED|'\n\n\tIntOp $0 $2 & 0x2000\n\tIntCmp $0 0 +2\n\tStrCpy $3 'NOT_CONTENT_INDEXED|$3'\n\n\tIntOp $0 $2 & 0x1000\n\tIntCmp $0 0 +2\n\tStrCpy $3 'OFFLINE|$3'\n\n\tIntOp $0 $2 & 0x0800\n\tIntCmp $0 0 +2\n\tStrCpy $3 'COMPRESSED|$3'\n\n\tIntOp $0 $2 & 0x0400\n\tIntCmp $0 0 +2\n\tStrCpy $3 'REPARSE_POINT|$3'\n\n\tIntOp $0 $2 & 0x0200\n\tIntCmp $0 0 +2\n\tStrCpy $3 'SPARSE_FILE|$3'\n\n\tIntOp $0 $2 & 0x0100\n\tIntCmp $0 0 +2\n\tStrCpy $3 'TEMPORARY|$3'\n\n\tIntOp $0 $2 & 0x0080\n\tIntCmp $0 0 +2\n\tStrCpy $3 'NORMAL|$3'\n\n\tIntOp $0 $2 & 0x0040\n\tIntCmp $0 0 +2\n\tStrCpy $3 'DEVICE|$3'\n\n\tIntOp $0 $2 & 0x0020\n\tIntCmp $0 0 +2\n\tStrCpy $3 'ARCHIVE|$3'\n\n\tIntOp $0 $2 & 0x0010\n\tIntCmp $0 0 +2\n\tStrCpy $3 'DIRECTORY|$3'\n\n\tIntOp $0 $2 & 0x0004\n\tIntCmp $0 0 +2\n\tStrCpy $3 'SYSTEM|$3'\n\n\tIntOp $0 $2 & 0x0002\n\tIntCmp $0 0 +2\n\tStrCpy $3 'HIDDEN|$3'\n\n\tIntOp $0 $2 & 0x0001\n\tIntCmp $0 0 +2\n\tStrCpy $3 'READONLY|$3'\n\n\tStrCpy $0 $3 -1\n\tStrCmp $1 '' FileFunc_GetFileAttributes_end\n\tStrCmp $1 'ALL' FileFunc_GetFileAttributes_end\n\n\tFileFunc_GetFileAttributes_attrcmp:\n\tStrCpy $5 0\n\tIntOp $5 $5 + 1\n\tStrCpy $4 $1 1 $5\n\tStrCmp $4 '' +2\n\tStrCmp $4 '|'  0 -3\n\tStrCpy $2 $1 $5\n\tIntOp $5 $5 + 1\n\tStrCpy $1 $1 '' $5\n\tStrLen $3 $2\n\tStrCpy $5 -1\n\tIntOp $5 $5 + 1\n\tStrCpy $4 $0 $3 $5\n\tStrCmp $4 '' FileFunc_GetFileAttributes_notfound\n\tStrCmp $4 $2 0 -3\n\tStrCmp $1 '' 0 FileFunc_GetFileAttributes_attrcmp\n\tStrCpy $0 1\n\tgoto FileFunc_GetFileAttributes_end\n\n\tFileFunc_GetFileAttributes_notfound:\n\tStrCpy $0 0\n\tgoto FileFunc_GetFileAttributes_end\n\n\tFileFunc_GetFileAttributes_error:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tFileFunc_GetFileAttributes_end:\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\t\t\n\t!verbose pop\n!macroend\n\n!define GetFileVersion `!insertmacro GetFileVersionCall`\n!define un.GetFileVersion `!insertmacro GetFileVersionCall`\n\n!macro GetFileVersion\n!macroend\n\n!macro un.GetFileVersion\n!macroend\n\n!macro GetFileVersion_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $0\n\tPush $1\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tClearErrors\n\n\tGetDllVersion '$0' $1 $2\n\tIfErrors FileFunc_GetFileVersion_error\n\tIntOp $3 $1 >> 16\n\tIntOp $3 $3 & 0x0000FFFF\n\tIntOp $4 $1 & 0x0000FFFF\n\tIntOp $5 $2 >> 16\n\tIntOp $5 $5 & 0x0000FFFF\n\tIntOp $6 $2 & 0x0000FFFF\n\tStrCpy $0 '$3.$4.$5.$6'\n\tgoto FileFunc_GetFileVersion_end\n\n\tFileFunc_GetFileVersion_error:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tFileFunc_GetFileVersion_end:\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetExeName `!insertmacro GetExeNameCall`\n!define un.GetExeName `!insertmacro GetExeNameCall`\n\n!macro GetExeName\n!macroend\n\n!macro un.GetExeName\n!macroend\n\n!macro GetExeName_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tPush $0\n\tPush $1\n\tPush $2\n\tSystem::Call 'kernel32::GetModuleFileName(p 0, t.r0, i ${NSIS_MAX_STRLEN})'\n\tSystem::Call 'kernel32::GetLongPathName(t r0, t.r1, i ${NSIS_MAX_STRLEN})i.r2'\n\tStrCmp $2 error +2\n\tStrCpy $0 $1\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetExePath `!insertmacro GetExePathCall`\n!define un.GetExePath `!insertmacro GetExePathCall`\n\n!macro GetExePath\n!macroend\n\n!macro un.GetExePath\n!macroend\n\n!macro GetExePath_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tPush $0\n\tPush $1\n\tPush $2\n\tStrCpy $0 $EXEDIR\n\tSystem::Call 'kernel32::GetLongPathName(t r0, t.r1, i ${NSIS_MAX_STRLEN})i.r2'\n\tStrCmp $2 error +2\n\tStrCpy $0 $1\n\tPop $2\n\tPop $1\n\tExch $0\n\t\n\t!verbose pop\n!macroend\n\n!define GetParameters `!insertmacro GetParametersCall`\n!define un.GetParameters `!insertmacro GetParametersCall`\n\n!macro GetParameters\n!macroend\n\n!macro un.GetParameters\n!macroend\n\n!macro GetParameters_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\t;cmdline-check\n\tStrCmp $CMDLINE \"\" 0 +3\n\tPush \"\"\n\tReturn\n\n\t;vars\n\tPush $0  ;tmp\n\tPush $1  ;length\n\tPush $2  ;parameter offset\n\tPush $3  ;separator\n\n\t;length/offset\n\tStrLen $1 $CMDLINE\n\tStrCpy $2 2  ;start with third character\n\n\t;separator\n\tStrCpy $3 $CMDLINE 1 ;first character\n\tStrCmp $3 '\"' +2\n\tStrCpy $3 ' '\n\n\tFileFunc_GetParameters_token:  ;finding second separator\n\tIntCmp $2 $1 FileFunc_GetParameters_strip 0 FileFunc_GetParameters_strip\n\tStrCpy $0 $CMDLINE 1 $2\n\tIntOp $2 $2 + 1\n\tStrCmp $3 $0 0 FileFunc_GetParameters_token\n\n\tFileFunc_GetParameters_strip:  ;strip white space\n\tIntCmp $2 $1 FileFunc_GetParameters_copy 0 FileFunc_GetParameters_copy\n\tStrCpy $0 $CMDLINE 1 $2\n\tStrCmp $0 ' ' 0 FileFunc_GetParameters_copy\n\tIntOp $2 $2 + 1\n\tGoto FileFunc_GetParameters_strip\n\n\tFileFunc_GetParameters_copy:\n\tStrCpy $0 $CMDLINE \"\" $2\n\n\t;strip white spaces from end\n\tFileFunc_GetParameters_rstrip:\n\tStrCpy $1 $0 1 -1\n\tStrCmp $1 ' ' 0 FileFunc_GetParameters_done\n\tStrCpy $0 $0 -1\n\tGoto FileFunc_GetParameters_rstrip\n\n\tFileFunc_GetParameters_done:\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!macro GetOptionsBody _FILEFUNC_S\n\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tClearErrors\n\n\tStrCpy $2 $1 '' 1\n\tStrCpy $1 $1 1\n\tStrLen $3 $2\n\tStrCpy $7 0\n\n\tFileFunc_GetOptions${_FILEFUNC_S}_begin:\n\tStrCpy $4 -1\n\tStrCpy $6 ''\n\n\tFileFunc_GetOptions${_FILEFUNC_S}_quote:\n\tIntOp $4 $4 + 1\n\tStrCpy $5 $0 1 $4\n\tStrCmp${_FILEFUNC_S} $5$7 '0' FileFunc_GetOptions${_FILEFUNC_S}_notfound\n\tStrCmp${_FILEFUNC_S} $5 '' FileFunc_GetOptions${_FILEFUNC_S}_trimright\n\tStrCmp${_FILEFUNC_S} $5 '\"' 0 +7\n\tStrCmp${_FILEFUNC_S} $6 '' 0 +3\n\tStrCpy $6 '\"'\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $6 '\"' 0 +3\n\tStrCpy $6 ''\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $5 `'` 0 +7\n\tStrCmp${_FILEFUNC_S} $6 `` 0 +3\n\tStrCpy $6 `'`\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $6 `'` 0 +3\n\tStrCpy $6 ``\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $5 '`' 0 +7\n\tStrCmp${_FILEFUNC_S} $6 '' 0 +3\n\tStrCpy $6 '`'\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $6 '`' 0 +3\n\tStrCpy $6 ''\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $6 '\"' FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $6 `'` FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $6 '`' FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $5 $1 0 FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tStrCmp${_FILEFUNC_S} $7 0 FileFunc_GetOptions${_FILEFUNC_S}_trimleft FileFunc_GetOptions${_FILEFUNC_S}_trimright\n\n\tFileFunc_GetOptions${_FILEFUNC_S}_trimleft:\n\tIntOp $4 $4 + 1\n\tStrCpy $5 $0 $3 $4\n\tStrCmp${_FILEFUNC_S} $5 '' FileFunc_GetOptions${_FILEFUNC_S}_notfound\n\tStrCmp${_FILEFUNC_S} $5 $2 0 FileFunc_GetOptions${_FILEFUNC_S}_quote\n\tIntOp $4 $4 + $3\n\tStrCpy $0 $0 '' $4\n\tStrCpy $4 $0 1\n\tStrCmp${_FILEFUNC_S} $4 ' ' 0 +3\n\tStrCpy $0 $0 '' 1\n\tgoto -3\n\tStrCpy $7 1\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_begin\n\n\tFileFunc_GetOptions${_FILEFUNC_S}_trimright:\n\tStrCpy $0 $0 $4\n\tStrCpy $4 $0 1 -1\n\tStrCmp${_FILEFUNC_S} $4 ' ' 0 +3\n\tStrCpy $0 $0 -1\n\tgoto -3\n\tStrCpy $3 $0 1\n\tStrCpy $4 $0 1 -1\n\tStrCmp${_FILEFUNC_S} $3 $4 0 FileFunc_GetOptions${_FILEFUNC_S}_end\n\tStrCmp${_FILEFUNC_S} $3 '\"' +3\n\tStrCmp${_FILEFUNC_S} $3 `'` +2\n\tStrCmp${_FILEFUNC_S} $3 '`' 0 FileFunc_GetOptions${_FILEFUNC_S}_end\n\tStrCpy $0 $0 -1 1\n\tgoto FileFunc_GetOptions${_FILEFUNC_S}_end\n\n\tFileFunc_GetOptions${_FILEFUNC_S}_notfound:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tFileFunc_GetOptions${_FILEFUNC_S}_end:\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n!macroend\n\n!define GetOptions `!insertmacro GetOptionsCall`\n!define un.GetOptions `!insertmacro GetOptionsCall`\n\n!macro GetOptions\n!macroend\n\n!macro un.GetOptions\n!macroend\n\n!macro GetOptions_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\n\t!insertmacro GetOptionsBody ''\n\n\t!verbose pop\n!macroend\n\n!define GetOptionsS `!insertmacro GetOptionsSCall`\n!define un.GetOptionsS `!insertmacro GetOptionsSCall`\n\n!macro GetOptionsS\n!macroend\n\n!macro un.GetOptionsS\n!macroend\n\n!macro GetOptionsS_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\n\t!insertmacro GetOptionsBody 'S'\n\n\t!verbose pop\n!macroend\n\n!define GetRoot `!insertmacro GetRootCall`\n!define un.GetRoot `!insertmacro GetRootCall`\n\n!macro GetRoot\n!macroend\n\n!macro un.GetRoot\n!macroend\n\n!macro GetRoot_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $0\n\tPush $1\n\tPush $2\n\tPush $3\n\n\tStrCpy $1 $0 2\n\tStrCmp $1 '\\\\' FileFunc_GetRoot_UNC\n\tStrCpy $2 $1 1 1\n\tStrCmp $2 ':' 0 FileFunc_GetRoot_empty\n\tStrCpy $0 $1\n\tgoto FileFunc_GetRoot_end\n\n\tFileFunc_GetRoot_UNC:\n\tStrCpy $2 1\n\tStrCpy $3 ''\n\n\tFileFunc_GetRoot_loop:\n\tIntOp $2 $2 + 1\n\tStrCpy $1 $0 1 $2\n\tStrCmp $1$3 '' FileFunc_GetRoot_empty\n\tStrCmp $1 '' +5\n\tStrCmp $1 '\\' 0 FileFunc_GetRoot_loop\n\tStrCmp $3 '1' +3\n\tStrCpy $3 '1'\n\tgoto FileFunc_GetRoot_loop\n\tStrCpy $0 $0 $2\n\tStrCpy $2 $0 1 -1\n\tStrCmp $2 '\\' 0 FileFunc_GetRoot_end\n\n\tFileFunc_GetRoot_empty:\n\tStrCpy $0 ''\n\n\tFileFunc_GetRoot_end:\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetParent `!insertmacro GetParentCall`\n!define un.GetParent `!insertmacro GetParentCall`\n\n!macro GetParent\n!macroend\n\n!macro un.GetParent\n!macroend\n\n!macro GetParent_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $0\n\tPush $1\n\tPush $2\n\n\tStrCpy $2 $0 1 -1\n\tStrCmp $2 '\\' 0 +3\n\tStrCpy $0 $0 -1\n\tgoto -3\n\n\tStrCpy $1 0\n\tIntOp $1 $1 - 1\n\tStrCpy $2 $0 1 $1\n\tStrCmp $2 '\\' +2\n\tStrCmp $2 '' 0 -3\n\tStrCpy $0 $0 $1\n\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetFileName `!insertmacro GetFileNameCall`\n!define un.GetFileName `!insertmacro GetFileNameCall`\n\n!macro GetFileName\n!macroend\n\n!macro un.GetFileName\n!macroend\n\n!macro GetFileName_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $0\n\tPush $1\n\tPush $2\n\n\tStrCpy $2 $0 1 -1\n\tStrCmp $2 '\\' 0 +3\n\tStrCpy $0 $0 -1\n\tgoto -3\n\n\tStrCpy $1 0\n\tIntOp $1 $1 - 1\n\tStrCpy $2 $0 1 $1\n\tStrCmp $2 '' FileFunc_GetFileName_end\n\tStrCmp $2 '\\' 0 -3\n\tIntOp $1 $1 + 1\n\tStrCpy $0 $0 '' $1\n\n\tFileFunc_GetFileName_end:\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetBaseName `!insertmacro GetBaseNameCall`\n!define un.GetBaseName `!insertmacro GetBaseNameCall`\n\n!macro GetBaseName\n!macroend\n\n!macro un.GetBaseName\n!macroend\n\n!macro GetBaseName_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $0\n\tPush $1\n\tPush $2\n\tPush $3\n\n\tStrCpy $1 0\n\tStrCpy $3 ''\n\n\tFileFunc_GetBaseName_loop:\n\tIntOp $1 $1 - 1\n\tStrCpy $2 $0 1 $1\n\tStrCmp $2 '' FileFunc_GetBaseName_trimpath\n\tStrCmp $2 '\\' FileFunc_GetBaseName_trimpath\n\tStrCmp $3 'noext' FileFunc_GetBaseName_loop\n\tStrCmp $2 '.' 0 FileFunc_GetBaseName_loop\n\tStrCpy $0 $0 $1\n\tStrCpy $3 'noext'\n\tStrCpy $1 0\n\tgoto FileFunc_GetBaseName_loop\n\n\tFileFunc_GetBaseName_trimpath:\n\tStrCmp $1 -1 FileFunc_GetBaseName_empty\n\tIntOp $1 $1 + 1\n\tStrCpy $0 $0 '' $1\n\tgoto FileFunc_GetBaseName_end\n\n\tFileFunc_GetBaseName_empty:\n\tStrCpy $0 ''\n\n\tFileFunc_GetBaseName_end:\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define GetFileExt `!insertmacro GetFileExtCall`\n!define un.GetFileExt `!insertmacro GetFileExtCall`\n\n!macro GetFileExt\n!macroend\n\n!macro un.GetFileExt\n!macroend\n\n!macro GetFileExt_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $0\n\tPush $1\n\tPush $2\n\n\tStrCpy $1 0\n\n\tFileFunc_GetFileExt_loop:\n\tIntOp $1 $1 - 1\n\tStrCpy $2 $0 1 $1\n\tStrCmp $2 '' FileFunc_GetFileExt_empty\n\tStrCmp $2 '\\' FileFunc_GetFileExt_empty\n\tStrCmp $2 '.' 0 FileFunc_GetFileExt_loop\n\n\tStrCmp $1 -1 FileFunc_GetFileExt_empty\n\tIntOp $1 $1 + 1\n\tStrCpy $0 $0 '' $1\n\tgoto FileFunc_GetFileExt_end\n\n\tFileFunc_GetFileExt_empty:\n\tStrCpy $0 ''\n\n\tFileFunc_GetFileExt_end:\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define BannerTrimPath `!insertmacro BannerTrimPathCall`\n!define un.BannerTrimPath `!insertmacro BannerTrimPathCall`\n\n!macro BannerTrimPath\n!macroend\n\n!macro un.BannerTrimPath\n!macroend\n\n!macro BannerTrimPath_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\n\tStrCpy $3 $1 1 -1\n\tIntOp $1 $1 + 0\n\tStrLen $2 $0\n\tIntCmp $2 $1 FileFunc_BannerTrimPath_end FileFunc_BannerTrimPath_end\n\tIntOp $1 $1 - 3\n\tIntCmp $1 0 FileFunc_BannerTrimPath_empty FileFunc_BannerTrimPath_empty\n\tStrCmp $3 'A' FileFunc_BannerTrimPath_A-trim\n\tStrCmp $3 'B' FileFunc_BannerTrimPath_B-trim\n\tStrCmp $3 'C' FileFunc_BannerTrimPath_C-trim\n\tStrCmp $3 'D' FileFunc_BannerTrimPath_D-trim\n\n\tFileFunc_BannerTrimPath_A-trim:\n\tStrCpy $3 $0 1 1\n\tStrCpy $2 0\n\tStrCmp $3 ':' 0 +2\n\tIntOp $2 $2 + 2\n\n\tFileFunc_BannerTrimPath_loopleft:\n\tIntOp $2 $2 + 1\n\tStrCpy $3 $0 1 $2\n\tStrCmp $2 $1 FileFunc_BannerTrimPath_C-trim\n\tStrCmp $3 '\\' 0 FileFunc_BannerTrimPath_loopleft\n\tStrCpy $3 $0 $2\n\tIntOp $2 $2 - $1\n\tIntCmp $2 0 FileFunc_BannerTrimPath_B-trim 0 FileFunc_BannerTrimPath_B-trim\n\n\tFileFunc_BannerTrimPath_loopright:\n\tIntOp $2 $2 + 1\n\tStrCpy $4 $0 1 $2\n\tStrCmp $2 0 FileFunc_BannerTrimPath_B-trim\n\tStrCmp $4 '\\' 0 FileFunc_BannerTrimPath_loopright\n\tStrCpy $4 $0 '' $2\n\tStrCpy $0 '$3\\...$4'\n\tgoto FileFunc_BannerTrimPath_end\n\n\tFileFunc_BannerTrimPath_B-trim:\n\tStrCpy $2 $1\n\tIntOp $2 $2 - 1\n\tStrCmp $2 -1 FileFunc_BannerTrimPath_C-trim\n\tStrCpy $3 $0 1 $2\n\tStrCmp $3 '\\' 0 -3\n\tStrCpy $0 $0 $2\n\tStrCpy $0 '$0\\...'\n\tgoto FileFunc_BannerTrimPath_end\n\n\tFileFunc_BannerTrimPath_C-trim:\n\tStrCpy $0 $0 $1\n\tStrCpy $0 '$0...'\n\tgoto FileFunc_BannerTrimPath_end\n\n\tFileFunc_BannerTrimPath_D-trim:\n\tStrCpy $3 -1\n\tIntOp $3 $3 - 1\n\tStrCmp $3 -$2 FileFunc_BannerTrimPath_C-trim\n\tStrCpy $4 $0 1 $3\n\tStrCmp $4 '\\' 0 -3\n\tStrCpy $4 $0 '' $3\n\tIntOp $3 $1 + $3\n\tIntCmp $3 2 FileFunc_BannerTrimPath_C-trim FileFunc_BannerTrimPath_C-trim\n\tStrCpy $0 $0 $3\n\tStrCpy $0 '$0...$4'\n\tgoto FileFunc_BannerTrimPath_end\n\n\tFileFunc_BannerTrimPath_empty:\n\tStrCpy $0 ''\n\n\tFileFunc_BannerTrimPath_end:\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define DirState `!insertmacro DirStateCall`\n!define un.DirState `!insertmacro DirStateCall`\n\n!macro DirState\n!macroend\n\n!macro un.DirState\n!macroend\n\n!macro DirState_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tExch $0\n\tPush $1\n\tClearErrors\n\n\tFindFirst $1 $0 '$0\\*.*'\n\tIfErrors 0 +3\n\tStrCpy $0 -1\n\tgoto FileFunc_DirState_end\n\tStrCmp $0 '.' 0 +4\n\tFindNext $1 $0\n\tStrCmp $0 '..' 0 +2\n\tFindNext $1 $0\n\tFindClose $1\n\tIfErrors 0 +3\n\tStrCpy $0 0\n\tgoto FileFunc_DirState_end\n\tStrCpy $0 1\n\n\tFileFunc_DirState_end:\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define RefreshShellIcons `!insertmacro RefreshShellIconsCall`\n!define un.RefreshShellIcons `!insertmacro RefreshShellIconsCall`\n\n!macro RefreshShellIcons\n!macroend\n\n!macro un.RefreshShellIcons\n!macroend\n\n!macro RefreshShellIcons_\n\t!verbose push\n\t!verbose ${_FILEFUNC_VERBOSE}\n\t\n\tSystem::Call 'shell32::SHChangeNotify(i 0x08000000, i 0, i 0, i 0)'\n\n\t!verbose pop\n!macroend\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/InstallOptions.nsh",
    "content": "/*\n\nInstallOptions.nsh\nMacros and conversion functions for InstallOptions\n\n*/\n\n!ifndef ___NSIS__INSTALL_OPTIONS__NSH___\n!define ___NSIS__INSTALL_OPTIONS__NSH___\n\n!include LogicLib.nsh\n\n!macro INSTALLOPTIONS_FUNCTION_READ_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_IO2NSIS \"\"\n!macroend\n\n!macro INSTALLOPTIONS_UNFUNCTION_READ_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_IO2NSIS un.\n!macroend\n\n!macro INSTALLOPTIONS_FUNCTION_WRITE_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_NSIS2IO \"\"\n!macroend\n\n!macro INSTALLOPTIONS_UNFUNCTION_WRITE_CONVERT\n  !insertmacro INSTALLOPTIONS_FUNCTION_NSIS2IO un.\n!macroend\n\n!macro INSTALLOPTIONS_FUNCTION_NSIS2IO UNINSTALLER_FUNCPREFIX\n\n  ; Convert an NSIS string to a form suitable for use by InstallOptions\n  ; Usage:\n  ;   Push <NSIS-string>\n  ;   Call Nsis2Io\n  ;   Pop <IO-string>\n\n  Function ${UNINSTALLER_FUNCPREFIX}Nsis2Io\n\n    Exch $0 ; The source\n    Push $1 ; The output\n    Push $2 ; Temporary char\n    Push $3 ; Length\n    Push $4 ; Loop index\n    StrCpy $1 \"\" ; Initialise the output\n\n    StrLen $3 $0\n    IntOp $3 $3 - 1\n\n    ${For} $4 0 $3\n      StrCpy $2 $0 1 $4\n      ${If}     $2 == '\\'\n        StrCpy $2 '\\\\'\n      ${ElseIf} $2 == '$\\r'\n        StrCpy $2 '\\r'\n      ${ElseIf} $2 == '$\\n'\n        StrCpy $2 '\\n'\n      ${ElseIf} $2 == '$\\t'\n        StrCpy $2 '\\t'\n      ${EndIf}\n      StrCpy $1 $1$2\n    ${Next}\n\n    StrCpy $0 $1\n    Pop $4\n    Pop $3\n    Pop $2\n    Pop $1\n    Exch $0\n\n  FunctionEnd\n\n!macroend\n\n!macro INSTALLOPTIONS_FUNCTION_IO2NSIS UNINSTALLER_FUNCPREFIX\n\n  ; Convert an InstallOptions string to a form suitable for use by NSIS\n  ; Usage:\n  ;   Push <IO-string>\n  ;   Call Io2Nsis\n  ;   Pop <NSIS-string>\n\n  Function ${UNINSTALLER_FUNCPREFIX}Io2Nsis\n\n    Exch $0 ; The source\n    Push $1 ; The output\n    Push $2 ; Temporary char\n    Push $3 ; Length\n    Push $4 ; Loop index\n    StrCpy $1 \"\" ; Initialise the output\n\n    StrLen $3 $0\n    IntOp $3 $3 - 1\n\n    ${For} $4 0 $3\n      StrCpy $2 $0 2 $4\n      ${If}     $2 == '\\\\'\n        StrCpy $2 '\\'\n        IntOp $4 $4 + 1\n      ${ElseIf} $2 == '\\r'\n        StrCpy $2 '$\\r'\n        IntOp $4 $4 + 1\n      ${ElseIf} $2 == '\\n'\n        StrCpy $2 '$\\n'\n        IntOp $4 $4 + 1\n      ${ElseIf} $2 == '\\t'\n        StrCpy $2 '$\\t'\n        IntOp $4 $4 + 1\n      ${EndIf}\n      StrCpy $2 $2 1\n      StrCpy $1 $1$2\n    ${Next}\n\n    StrCpy $0 $1\n    Pop $4\n    Pop $3\n    Pop $2\n    Pop $1\n    Exch $0\n\n  FunctionEnd\n\n!macroend\n\n!macro INSTALLOPTIONS_EXTRACT FILE\n\n  InitPluginsDir\n  File \"/oname=$PLUGINSDIR\\${FILE}\" \"${FILE}\"\n!ifdef NSIS_UNICODE\n  InstallOptions::make_unicode \"$PLUGINSDIR\\${FILE}\"\n!endif\n  !insertmacro INSTALLOPTIONS_WRITE \"${FILE}\" \"Settings\" \"RTL\" \"$(^RTL)\"\n\n!macroend\n\n!macro INSTALLOPTIONS_EXTRACT_AS FILE FILENAME\n\n  InitPluginsDir\n  File \"/oname=$PLUGINSDIR\\${FILENAME}\" \"${FILE}\"\n!ifdef NSIS_UNICODE\n  InstallOptions::make_unicode \"$PLUGINSDIR\\${FILENAME}\"\n!endif\n  !insertmacro INSTALLOPTIONS_WRITE \"${FILENAME}\" \"Settings\" \"RTL\" \"$(^RTL)\"\n\n!macroend\n\n!macro INSTALLOPTIONS_DISPLAY FILE\n\n  Push $0\n\n  InstallOptions::dialog \"$PLUGINSDIR\\${FILE}\"\n  Pop $0\n\n  Pop $0\n\n!macroend\n\n!macro INSTALLOPTIONS_DISPLAY_RETURN FILE\n\n  InstallOptions::dialog \"$PLUGINSDIR\\${FILE}\"\n\n!macroend\n\n!macro INSTALLOPTIONS_INITDIALOG FILE\n\n  InstallOptions::initDialog \"$PLUGINSDIR\\${FILE}\"\n\n!macroend\n\n!macro INSTALLOPTIONS_SHOW\n\n  Push $0\n\n  InstallOptions::show\n  Pop $0\n\n  Pop $0\n\n!macroend\n\n!macro INSTALLOPTIONS_SHOW_RETURN\n\n  InstallOptions::show\n\n!macroend\n\n!macro INSTALLOPTIONS_READ VAR FILE SECTION KEY\n\n  ReadIniStr ${VAR} \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\"\n\n!macroend\n\n!macro INSTALLOPTIONS_WRITE FILE SECTION KEY VALUE\n\n  WriteIniStr \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\" \"${VALUE}\"\n\n!macroend\n\n!macro INSTALLOPTIONS_READ_CONVERT VAR FILE SECTION KEY\n\n  ReadIniStr ${VAR} \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\"\n  Push ${VAR}\n  Call Io2Nsis\n  Pop ${VAR}\n\n!macroend\n\n!macro INSTALLOPTIONS_READ_UNCONVERT VAR FILE SECTION KEY\n\n  ReadIniStr ${VAR} \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\"\n  Push ${VAR}\n  Call un.Io2Nsis\n  Pop ${VAR}\n\n!macroend\n\n!macro INSTALLOPTIONS_WRITE_CONVERT FILE SECTION KEY VALUE\n\n  Push $0\n  StrCpy $0 \"${VALUE}\"\n  Push $0\n  Call Nsis2Io\n  Pop $0\n  \n  WriteIniStr \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\" $0\n\n  Pop $0\n\n!macroend\n  \n!macro INSTALLOPTIONS_WRITE_UNCONVERT FILE SECTION KEY VALUE\n\n  Push $0\n  StrCpy $0 \"${VALUE}\"\n  Push $0\n  Call un.Nsis2Io\n  Pop $0\n  \n  WriteIniStr \"$PLUGINSDIR\\${FILE}\" \"${SECTION}\" \"${KEY}\" $0\n\n  Pop $0\n\n!macroend\n\n!endif # ___NSIS__INSTALL_OPTIONS__NSH___\n"
  },
  {
    "path": "setup/nsis/tools/Include/Integration.nsh",
    "content": "!verbose push 3\n!ifndef INTEGRATION_INCLUDED\n!define INTEGRATION_INCLUDED 1\n\n!include \"Util.nsh\"\n\n\n!define NotifyShell_AssocChanged `System::Call 'SHELL32::SHChangeNotify(i0x8000000,i0,p0,p0)'` ; Notify the shell with SHCNE_ASSOCCHANGED\n\n\n!define UnpinShortcut \"!insertmacro UnpinShortcut \"\n!macro UnpinShortcut lnkpath\nPush \"${lnkpath}\"\n${CallArtificialFunction} UnpinShortcut_Implementation\n!macroend\n!macro UnpinShortcut_Implementation\n!include \"LogicLib.nsh\"\n!include \"Win\\COM.nsh\"\nExch $0\nPush $1\n!insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} ${IID_IStartMenuPinnedList} r1 \"\"\n${If} $1 P<> 0\n    System::Call 'SHELL32::SHCreateItemFromParsingName(wr0,p0,g\"${IID_IShellItem}\",*p0r0)'\n    ${If} $0 P<> 0\n        ${IStartMenuPinnedList::RemoveFromList} $1 '(r0)'\n        ${IUnknown::Release} $0 \"\"\n    ${EndIf}\n    ${IUnknown::Release} $1 \"\"\n!ifdef NSIS_IX86 | NSIS_AMD64\n${Else}\n  !insertmacro ComHlpr_CreateInProcInstance ${CLSID_StartMenuPin} \"{ec35e37a-6579-4f3c-93cd-6e62c4ef7636}\" r1 \"\"\n  ${If} $1 P<> 0\n    ExecShellWait /INVOKEIDLIST \"unpin\" $0 ; WinXP\n    ${IUnknown::Release} $1 \"\"\n  ${EndIf}\n!endif\n${EndIf}\nPop $1\nPop $0\n!macroend\n\n\n!endif #!INCLUDED\n!verbose pop\n"
  },
  {
    "path": "setup/nsis/tools/Include/LangFile.nsh",
    "content": "/*\n\nLangFile.nsh\n\nHeader file to create language files that can be\nincluded with a single command.\n\nCopyright 2008-2022 Joost Verburg, Anders Kjersem\n\n* Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT\n  can be called from the script to include a language file.\n\n  - LANGFILE_INCLUDE takes the language file name as parameter.\n  - LANGFILE_INCLUDE_WITHDEFAULT takes as additional second\n    parameter, the default language file to load missing strings from.\n\n* Language strings in the language file have the format:\n  ${LangFileString} LANGSTRING_NAME \"Text\"\n\n* There are two types of language header files:\n\n  - NSIS multi-lang support; these must start with the LANGFILE macro and \n    provide strings for features like MUI and MultiUser. If you are adding \n    support for a new language to NSIS you should make a copy of English.nsh \n    and translate this .nsh along with the .nlf.\n  - Custom installer strings; these must start with the LANGFILE_EXT macro and \n    contain translated versions of \n    custom strings used in a particular installer.\n    This is useful if you want to put the translations for each language in \n    their own separate file.\n\n* Example:\n\n  ; Setup.nsi\n  !include \"MUI.nsh\"\n  !insertmacro MUI_PAGE_INSTFILES\n  !insertmacro MUI_LANGUAGE \"Danish\"\n  !insertmacro LANGFILE_INCLUDE \"DanishExtra.nsh\"\n  !insertmacro MUI_LANGUAGE \"Swedish\"\n  !insertmacro LANGFILE_INCLUDE \"SwedishExtra.nsh\"\n  Section\n  MessageBox MB_OK \"$(myCustomString)\"\n  SectionEnd\n\n  ; SwedishExtra.nsh\n  !insertmacro LANGFILE_EXT Swedish\n  ${LangFileString} myCustomString \"Bork bork\"\n\n*/\n\n!ifndef LANGFILE_INCLUDED\n!define LANGFILE_INCLUDED\n\n!macro LANGFILE_INCLUDE FILENAME\n\n  ;Called from script: include a language file\n\n  !ifdef LangFileString\n    !undef LangFileString\n  !endif\n\n  !define LangFileString \"!insertmacro LANGFILE_SETSTRING\"\n\n  !define LANGFILE_SETNAMES\n  !include \"${FILENAME}\"\n  !undef LANGFILE_SETNAMES\n\n  ;Create language strings\n  !define /redef LangFileString \"!insertmacro LANGFILE_LANGSTRING\"\n  !include \"${FILENAME}\"\n\n!macroend\n\n!macro LANGFILE_INCLUDE_WITHDEFAULT FILENAME FILENAME_DEFAULT\n\n  ;Called from script: include a language file\n  ;Obtains missing strings from a default file\n\n  !ifdef LangFileString\n    !undef LangFileString\n  !endif\n\n  !define LangFileString \"!insertmacro LANGFILE_SETSTRING\"\n\n  !define LANGFILE_SETNAMES\n  !include \"${FILENAME}\"\n  !undef LANGFILE_SETNAMES\n\n  ;Include default language for missing strings\n  !define LANGFILE_PRIV_INCLUDEISFALLBACK \"${FILENAME_DEFAULT}\"\n  !include \"${FILENAME_DEFAULT}\"\n  !undef LANGFILE_PRIV_INCLUDEISFALLBACK\n\n  ;Create language strings\n  !define /redef LangFileString \"!insertmacro LANGFILE_LANGSTRING\"\n  !include \"${FILENAME_DEFAULT}\"\n\n!macroend\n\n!macro LANGFILE NLFID ENGNAME NATIVENAME NATIVEASCIINAME\n\n  ;Start of standard NSIS language file\n\n  ; NLFID: Must match the name of the .nlf file\n  ; ENGNAME: English name of language, \"=\" if it is the same as NLFID\n  ; NATIVENAME: Native name of language. (In Unicode)\n  ; NATIVEASCIINAME: Native name of language using only ASCII, \"=\" if it is the same as NATIVENAME\n\n  ; Example: LANGFILE \"Swedish\" = \"Svenska\" = (This is the same as LANGFILE \"Swedish\" \"Swedish\" \"Svenska\" \"Svenska\")\n  ; For more examples, see French.nsh, Greek.nsh and PortugueseBR.nsh\n\n  !ifdef LANGFILE_SETNAMES\n\n    !ifdef LANGFILE_IDNAME\n      !undef LANGFILE_IDNAME\n    !endif\n\n    !define LANGFILE_IDNAME \"${NLFID}\"\n\n    ; ModernUI or the .nsi can change LANGFILE_LANGDLL_FMT if desired\n    !ifndef LANGFILE_LANGDLL_FMT\n      !ifndef NSIS_UNICODE\n        !define LANGFILE_LANGDLL_FMT \"%ENGNAME% / %NATIVEASCIINAME%\"\n      !endif\n      !define /ifndef LANGFILE_LANGDLL_FMT \"%NATIVENAME%\"\n    !endif\n\n    !ifndef \"LANGFILE_${NLFID}_NAME\"\n      !if \"${ENGNAME}\" == \"=\"\n        !define /redef ENGNAME \"${NLFID}\"\n      !endif\n      !if \"${NATIVEASCIINAME}\" == \"=\"\n        !define /redef NATIVEASCIINAME \"${NATIVENAME}\"\n      !endif\n\n      !define \"LANGFILE_${NLFID}_ENGLISHNAME\" \"${ENGNAME}\"\n      !ifdef NSIS_UNICODE\n        !define \"LANGFILE_${NLFID}_NAME\" \"${NATIVENAME}\"\n      !else\n        !define \"LANGFILE_${NLFID}_NAME\" \"${NATIVEASCIINAME}\"\n      !endif\n\n      !searchreplace LANGFILE_${NLFID}_LANGDLL \"${LANGFILE_LANGDLL_FMT}\" %NATIVEASCIINAME% \"${NATIVEASCIINAME}\"\n      !searchreplace LANGFILE_${NLFID}_LANGDLL \"${LANGFILE_${NLFID}_LANGDLL}\" %NATIVENAME% \"${NATIVENAME}\"\n      !searchreplace LANGFILE_${NLFID}_LANGDLL \"${LANGFILE_${NLFID}_LANGDLL}\" %ENGNAME% \"${ENGNAME}\"\n\n    !endif\n\n  !endif\n\n!macroend\n\n!macro LANGFILE_EXT IDNAME\n\n  ;Start of installer language file\n  \n  !ifdef LANGFILE_SETNAMES\n\n    !ifdef LANGFILE_IDNAME\n      !undef LANGFILE_IDNAME\n    !endif\n\n    !define LANGFILE_IDNAME \"${IDNAME}\"\n\n  !endif\n\n!macroend\n\n!macro LANGFILE_SETSTRING NAME VALUE\n\n  ;Set define with translated string\n\n  !ifndef ${NAME}\n    !define \"${NAME}\" \"${VALUE}\"\n    !ifdef LANGFILE_PRIV_INCLUDEISFALLBACK\n      !warning 'LangString \"${NAME}\" for language ${LANGFILE_IDNAME} is missing, using fallback from \"${LANGFILE_PRIV_INCLUDEISFALLBACK}\"'\n    !endif\n  !endif\n\n!macroend\n\n!macro LANGFILE_LANGSTRING NAME DUMMY\n\n  ;Create a language string from a define and undefine\n\n  LangString \"${NAME}\" \"${LANG_${LANGFILE_IDNAME}}\" \"${${NAME}}\"\n  !undef \"${NAME}\"\n\n!macroend\n\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/Library.nsh",
    "content": "#\n# Library.nsh\n#\n# A system for the installation and uninstallation of dynamic\n# link libraries (DLL) and type libraries (TLB). Using this\n# system you can handle the complete setup with one single\n# line of code:\n#\n#  * File copying\n#  * File copying on reboot\n#  * Version checks\n#  * Registration and unregistration\n#  * Registration and unregistration on reboot\n#  * Shared DLL counting\n#  * Windows File Protection checks\n#\n# For more information, read appendix B in the documentation.\n#\n\n!verbose push\n!verbose 3\n\n!ifndef LIB_INCLUDED\n\n!define LIB_INCLUDED\n\n!ifndef SHCNE_ASSOCCHANGED\n  !define SHCNE_ASSOCCHANGED 0x08000000\n!endif\n!ifndef SHCNF_IDLIST\n  !define SHCNF_IDLIST 0x0000\n!endif\n\n!define REGTOOL_VERSION v3\n!define REGTOOL_KEY NSIS.Library.RegTool.${REGTOOL_VERSION}\n\n!include LogicLib.nsh\n!include x64.nsh\n\n### GetParent macro, don't pass $1 or $2 as INPUT or OUTPUT\n!macro __InstallLib_Helper_GetParent INPUT OUTPUT\n\n  # Copied from FileFunc.nsh\n\n  StrCpy ${OUTPUT} ${INPUT}\n\n  Push $1\n  Push $2\n\n  StrCpy $2 ${OUTPUT} 1 -1\n  StrCmp $2 '\\' 0 +3\n  StrCpy ${OUTPUT} ${OUTPUT} -1\n  goto -3\n\n  StrCpy $1 0\n  IntOp $1 $1 - 1\n  StrCpy $2 ${OUTPUT} 1 $1\n  StrCmp $2 '\\' +2\n  StrCmp $2 '' 0 -3\n  StrCpy ${OUTPUT} ${OUTPUT} $1\n\n  Pop $2\n  Pop $1\n\n!macroend\n\n### Initialize session id (GUID)\n!macro __InstallLib_Helper_InitSession\n\n  !ifndef __InstallLib_SessionGUID_Defined\n\n    !define __InstallLib_SessionGUID_Defined\n\n    Var /GLOBAL __INSTALLLLIB_SESSIONGUID\n\n  !endif\n\n  !define __InstallLib_Helper_InitSession_Label \"Library_${__FILE__}${__LINE__}\"\n\n  StrCmp $__INSTALLLLIB_SESSIONGUID '' 0 \"${__InstallLib_Helper_InitSession_Label}\"\n\n    System::Call 'ole32::CoCreateGuid(g .s)'\n    Pop $__INSTALLLLIB_SESSIONGUID\n\n  \"${__InstallLib_Helper_InitSession_Label}:\"\n\n  !undef __InstallLib_Helper_InitSession_Label\n\n!macroend\n\n### Add a RegTool entry to register after reboot\n!macro __InstallLib_Helper_AddRegToolEntry mode filename tempdir\n\n  Push $R0\n  Push $R1\n  Push $R2\n  Push $R3\n\n  ;------------------------\n  ;Copy the parameters\n\n  Push \"${filename}\"\n  Push \"${tempdir}\"\n\n  Pop $R2 ; temporary directory\n  Pop $R1 ; file name to register\n\n  ;------------------------\n  ;Initialize session id\n\n  !insertmacro __InstallLib_Helper_InitSession\n\n  ;------------------------\n  ;Advance counter\n\n  StrCpy $R0 0\n  ReadRegDWORD $R0 HKLM \"Software\\${REGTOOL_KEY}\\$__INSTALLLLIB_SESSIONGUID\" \"count\"\n  IntOp $R0 $R0 + 1\n  WriteRegDWORD HKLM \"Software\\${REGTOOL_KEY}\\$__INSTALLLLIB_SESSIONGUID\" \"count\" \"$R0\"\n\n  ;------------------------\n  ;Setup RegTool\n\n  !if ! /FileExists \"${NSISDIR}\\Bin\\RegTool-${NSIS_CPU}.bin\"\n    !error \"Missing RegTool for ${NSIS_CPU}!\"\n  !endif\n\n  ReadRegStr $R3 HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\" \"${REGTOOL_KEY}\"\n  StrCpy $R3 $R3 -4 1\n  IfFileExists $R3 +3\n\n    File /oname=$R2\\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe \"${NSISDIR}\\Bin\\RegTool-${NSIS_CPU}.bin\"\n    WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\" \\\n      \"${REGTOOL_KEY}\" '\"$R2\\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe\" /S'\n\n  ;------------------------\n  ;Add RegTool entry\n\n  WriteRegStr HKLM \"Software\\${REGTOOL_KEY}\\$__INSTALLLLIB_SESSIONGUID\" \"$R0.file\" \"$R1\"\n  WriteRegStr HKLM \"Software\\${REGTOOL_KEY}\\$__INSTALLLLIB_SESSIONGUID\" \"$R0.mode\" \"${mode}\"\n\n  Pop $R3\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n!macroend\n\n!macro __InstallLib_Helper_CmpPackedVer64 oldhi oldlo newhi newlo jeq jle jgt\n\n  IntCmpU ${oldhi} ${newhi} \"0\"      \"${jle}\" \"${jgt}\"\n  IntCmpU ${oldlo} ${newlo} \"${jeq}\" \"${jle}\" \"${jgt}\"\n\n!macroend\n\n### Get library version\n!macro __InstallLib_Helper_GetVersion TYPE FILE\n\n  !if \"${TYPE}\" == \"D\"\n   !getdllversion /NoErrors /Packed \"${FILE}\" LIBRARY_VERSION_\n  !else if \"${TYPE}\" == \"T\"\n    !gettlbversion /NoErrors /Packed \"${FILE}\" LIBRARY_VERSION_\n  !endif\n\n  ; Emulate the old LibraryLocal defines\n  !ifndef LIBRARY_VERSION_HIGH\n    !define LIBRARY_VERSION_FILENOTFOUND\n  !else if \"${LIBRARY_VERSION_HIGH}\" == \"\"\n    !define LIBRARY_VERSION_NONE\n    !undef LIBRARY_VERSION_HIGH\n    !undef LIBRARY_VERSION_LOW\n  !endif\n\n!macroend\n\n### Install library\n!macro InstallLib libtype shared install localfile destfile tempbasedir\n\n  !verbose push\n  !verbose 3\n\n  Push $R0\n  Push $R1\n  Push $R2\n  Push $R3\n  Push $R4\n  Push $R5\n\n  ;------------------------\n  ;Define\n\n  !define INSTALLLIB_UNIQUE \"${__FILE__}${__LINE__}\"\n\n  !define INSTALLLIB_LIBTYPE_${libtype}\n  !define INSTALLLIB_LIBTYPE_SET INSTALLLIB_LIBTYPE_${libtype}\n  !define INSTALLLIB_SHARED_${shared}\n  !define INSTALLLIB_SHARED_SET INSTALLLIB_SHARED_${shared}\n  !define INSTALLLIB_INSTALL_${install}\n  !define INSTALLLIB_INSTALL_SET INSTALLLIB_INSTALL_${install}\n\n  ;------------------------\n  ;Validate\n\n  !ifndef INSTALLLIB_LIBTYPE_DLL & INSTALLLIB_LIBTYPE_REGDLL & INSTALLLIB_LIBTYPE_TLB & \\\n    INSTALLLIB_LIBTYPE_REGDLLTLB & INSTALLLIB_LIBTYPE_REGEXE\n    !error \"InstallLib: Incorrect setting for parameter: libtype\"\n  !endif\n\n  !ifndef INSTALLLIB_INSTALL_REBOOT_PROTECTED & INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED & \\\n    INSTALLLIB_INSTALL_NOREBOOT_PROTECTED & INSTALLLIB_INSTALL_NOREBOOT_NOTPROTECTED\n    !error \"InstallLib: Incorrect setting for parameter: install\"\n  !endif\n\n  ;------------------------\n  ;x64 settings\n\n  !ifdef LIBRARY_X64\n\n    ${DisableX64FSRedirection}\n\n  !endif\n\n  ;------------------------\n  ;Copy the parameters used on run-time to a variable\n  ;This allows the usage of variables as parameter\n\n  StrCpy $R4 \"${destfile}\"\n  StrCpy $R5 \"${tempbasedir}\"\n\n  ;------------------------\n  ;Shared library count\n\n  !ifndef INSTALLLIB_SHARED_NOTSHARED\n\n    StrCmp ${shared} \"\" 0 \"installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}\"\n\n      !ifdef LIBRARY_X64\n\n        SetRegView 64\n\n      !endif\n\n      ReadRegDword $R0 HKLM Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs $R4\n      ClearErrors\n      IntOp $R0 $R0 + 1\n      WriteRegDWORD HKLM Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs $R4 $R0\n\n      !ifdef LIBRARY_X64\n\n        SetRegView lastused\n\n      !endif\n\n    \"installlib.noshareddllincrease_${INSTALLLIB_UNIQUE}:\"\n\n  !endif\n\n  ;------------------------\n  ;Check Windows File Protection\n\n  !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_PROTECTED\n\n    !define LIBRARY_DEFINE_DONE_LABEL\n\n    System::Call \"sfc::SfcIsFileProtected(i 0, w R4) i.R0\"\n\n      StrCmp $R0 \"error\" \"installlib.notprotected_${INSTALLLIB_UNIQUE}\"\n      StrCmp $R0 \"0\" \"installlib.notprotected_${INSTALLLIB_UNIQUE}\"\n\n    Goto \"installlib.done_${INSTALLLIB_UNIQUE}\"\n\n    \"installlib.notprotected_${INSTALLLIB_UNIQUE}:\"\n\n  !endif\n\n  ;------------------------\n  ;Check file\n\n  IfFileExists $R4 0 \"installlib.copy_${INSTALLLIB_UNIQUE}\"\n\n  ;------------------------\n  ;Get version information\n\n  !ifndef LIBRARY_IGNORE_VERSION\n\n    !insertmacro __InstallLib_Helper_GetVersion D \"${LOCALFILE}\"\n\n    !ifdef LIBRARY_VERSION_FILENOTFOUND\n      !error \"InstallLib: The library ${LOCALFILE} could not be found.\"\n    !endif\n\n    !ifndef LIBRARY_VERSION_NONE\n\n      !define LIBRARY_DEFINE_UPGRADE_LABEL\n      !define LIBRARY_DEFINE_REGISTER_LABEL\n\n      StrCpy $R0 ${LIBRARY_VERSION_HIGH}\n      StrCpy $R1 ${LIBRARY_VERSION_LOW}\n\n      GetDLLVersion $R4 $R2 $R3\n\n      !undef LIBRARY_VERSION_HIGH\n      !undef LIBRARY_VERSION_LOW\n\n      !ifndef INSTALLLIB_LIBTYPE_TLB & INSTALLLIB_LIBTYPE_REGDLLTLB\n\n        !ifdef LIBRARY_INSTALL_EQUAL_VERSION\n          !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 \"installlib.upgrade_${INSTALLLIB_UNIQUE}\" \\\n            \"installlib.register_${INSTALLLIB_UNIQUE}\" \"installlib.upgrade_${INSTALLLIB_UNIQUE}\"\n        !else\n          !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 \"installlib.register_${INSTALLLIB_UNIQUE}\" \\\n            \"installlib.register_${INSTALLLIB_UNIQUE}\" \"installlib.upgrade_${INSTALLLIB_UNIQUE}\"\n        !endif\n\n      !else\n\n        !insertmacro __InstallLib_Helper_GetVersion T \"${LOCALFILE}\"\n\n        !ifdef LIBRARY_VERSION_FILENOTFOUND\n          !error \"InstallLib: The library ${LOCALFILE} could not be found.\"\n        !endif\n\n        !ifndef LIBRARY_VERSION_NONE\n\n          !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 0 \\\n            \"installlib.register_${INSTALLLIB_UNIQUE}\" \"installlib.upgrade_${INSTALLLIB_UNIQUE}\"\n\n        !else\n\n          !ifdef LIBRARY_INSTALL_EQUAL_VERSION\n            !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 \"installlib.upgrade_${INSTALLLIB_UNIQUE}\" \\\n              \"installlib.register_${INSTALLLIB_UNIQUE}\" \"installlib.upgrade_${INSTALLLIB_UNIQUE}\"\n          !else\n            !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 \"installlib.register_${INSTALLLIB_UNIQUE}\" \\\n              \"installlib.register_${INSTALLLIB_UNIQUE}\" \"installlib.upgrade_${INSTALLLIB_UNIQUE}\"\n          !endif\n\n        !endif\n\n      !endif\n\n    !else\n\n      !undef LIBRARY_VERSION_NONE\n\n      !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB\n\n        !insertmacro __InstallLib_Helper_GetVersion T \"${LOCALFILE}\"\n\n      !endif\n\n    !endif\n\n    !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB\n\n      !ifndef LIBRARY_VERSION_NONE\n\n        !ifndef LIBRARY_DEFINE_UPGRADE_LABEL\n\n          !define LIBRARY_DEFINE_UPGRADE_LABEL\n\n        !endif\n\n        !ifndef LIBRARY_DEFINE_REGISTER_LABEL\n\n          !define LIBRARY_DEFINE_REGISTER_LABEL\n\n        !endif\n\n        StrCpy $R0 ${LIBRARY_VERSION_HIGH}\n        StrCpy $R1 ${LIBRARY_VERSION_LOW}\n\n        TypeLib::GetLibVersion $R4\n        Pop $R3\n        Pop $R2\n\n        !ifdef LIBRARY_INSTALL_EQUAL_VERSION\n          !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 \"installlib.upgrade_${INSTALLLIB_UNIQUE}\" \\\n            \"installlib.register_${INSTALLLIB_UNIQUE}\" \"installlib.upgrade_${INSTALLLIB_UNIQUE}\"\n        !else\n          !insertmacro __InstallLib_Helper_CmpPackedVer64 $R0 $R1 $R2 $R3 \"installlib.register_${INSTALLLIB_UNIQUE}\" \\\n            \"installlib.register_${INSTALLLIB_UNIQUE}\" \"installlib.upgrade_${INSTALLLIB_UNIQUE}\"\n        !endif\n\n        !undef LIBRARY_VERSION_HIGH\n        !undef LIBRARY_VERSION_LOW\n\n      !else\n\n        !undef LIBRARY_VERSION_NONE\n\n      !endif\n\n    !endif\n\n  !endif ;~LIBRARY_IGNORE_VERSION\n\n  ;------------------------\n  ;Upgrade\n\n  !ifdef LIBRARY_DEFINE_UPGRADE_LABEL\n\n    !undef LIBRARY_DEFINE_UPGRADE_LABEL\n\n    \"installlib.upgrade_${INSTALLLIB_UNIQUE}:\"\n\n  !endif\n\n  ;------------------------\n  ;Copy\n\n  !ifdef INSTALLLIB_INSTALL_NOREBOOT_PROTECTED | INSTALLLIB_INSTALL_NOREBOOT_NOTPROTECTED\n\n    \"installlib.copy_${INSTALLLIB_UNIQUE}:\"\n\n    StrCpy $R0 $R4\n    Call \":installlib.file_${INSTALLLIB_UNIQUE}\"\n\n  !else\n\n    !ifndef LIBRARY_DEFINE_REGISTER_LABEL\n\n      !define LIBRARY_DEFINE_REGISTER_LABEL\n\n    !endif\n\n    !ifndef LIBRARY_DEFINE_DONE_LABEL\n\n      !define LIBRARY_DEFINE_DONE_LABEL\n\n    !endif\n\n    ClearErrors\n\n    StrCpy $R0 $R4\n    Call \":installlib.file_${INSTALLLIB_UNIQUE}\"\n\n    IfErrors 0 \"installlib.register_${INSTALLLIB_UNIQUE}\"\n\n    SetOverwrite lastused\n\n    ;------------------------\n    ;Copy on reboot\n\n    GetTempFileName $R0 $R5\n    Call \":installlib.file_${INSTALLLIB_UNIQUE}\"\n    Rename /REBOOTOK $R0 $R4\n\n    ;------------------------\n    ;Register on reboot\n\n    Call \":installlib.regonreboot_${INSTALLLIB_UNIQUE}\"\n\n    Goto \"installlib.done_${INSTALLLIB_UNIQUE}\"\n\n    \"installlib.copy_${INSTALLLIB_UNIQUE}:\"\n      StrCpy $R0 $R4\n      Call \":installlib.file_${INSTALLLIB_UNIQUE}\"\n\n  !endif\n\n  ;------------------------\n  ;Register\n\n  !ifdef LIBRARY_DEFINE_REGISTER_LABEL\n\n    !undef LIBRARY_DEFINE_REGISTER_LABEL\n\n    \"installlib.register_${INSTALLLIB_UNIQUE}:\"\n\n  !endif\n\n  !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB | INSTALLLIB_LIBTYPE_REGEXE\n\n    !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED\n\n      IfRebootFlag 0 \"installlib.regnoreboot_${INSTALLLIB_UNIQUE}\"\n\n        Call \":installlib.regonreboot_${INSTALLLIB_UNIQUE}\"\n\n        Goto \"installlib.registerfinish_${INSTALLLIB_UNIQUE}\"\n\n      \"installlib.regnoreboot_${INSTALLLIB_UNIQUE}:\"\n\n    !endif\n\n    !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB\n\n      TypeLib::Register $R4\n\n    !endif\n\n    !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB\n\n      !ifndef LIBRARY_X64\n\n        RegDll $R4\n\n      !else\n\n        ExecWait '\"$SYSDIR\\regsvr32.exe\" /s \"$R4\"'\n\n      !endif\n\n    !endif\n\n    !ifdef INSTALLLIB_LIBTYPE_REGEXE\n\n      ExecWait '\"$R4\" /regserver'\n\n    !endif\n\n    !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED\n\n      \"installlib.registerfinish_${INSTALLLIB_UNIQUE}:\"\n\n    !endif\n\n  !endif\n\n  !ifdef LIBRARY_SHELL_EXTENSION\n\n    System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'\n\n  !endif\n\n  !ifdef LIBRARY_COM\n\n    System::Call 'Ole32::CoFreeUnusedLibraries()'\n\n  !endif\n\n  ;------------------------\n  ;Done\n\n  !ifdef LIBRARY_DEFINE_DONE_LABEL\n\n    !undef LIBRARY_DEFINE_DONE_LABEL\n\n  \"installlib.done_${INSTALLLIB_UNIQUE}:\"\n\n  !endif\n\n  Pop $R5\n  Pop $R4\n  Pop $R3\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n  ;------------------------\n  ;End\n\n  Goto \"installlib.end_${INSTALLLIB_UNIQUE}\"\n\n  ;------------------------\n  ;Extract\n\n  !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED\n\n    SetOverwrite try\n\n  !else\n\n    SetOverwrite on\n\n  !endif\n\n  \"installlib.file_${INSTALLLIB_UNIQUE}:\"\n    SetFileAttributes $R0 FILE_ATTRIBUTE_NORMAL\n    ClearErrors\n    File /oname=$R0 \"${LOCALFILE}\"\n    Return\n\n  SetOverwrite lastused\n\n  ;------------------------\n  ;Register on reboot\n\n  !ifdef INSTALLLIB_INSTALL_REBOOT_PROTECTED | INSTALLLIB_INSTALL_REBOOT_NOTPROTECTED\n\n    \"installlib.regonreboot_${INSTALLLIB_UNIQUE}:\"\n\n      !ifdef INSTALLLIB_LIBTYPE_REGDLL | INSTALLLIB_LIBTYPE_REGDLLTLB\n        !ifndef LIBRARY_X64\n          !insertmacro __InstallLib_Helper_AddRegToolEntry 'D' \"$R4\" \"$R5\"\n        !else\n          !insertmacro __InstallLib_Helper_AddRegToolEntry 'DX' \"$R4\" \"$R5\"\n        !endif\n      !endif\n\n      !ifdef INSTALLLIB_LIBTYPE_TLB | INSTALLLIB_LIBTYPE_REGDLLTLB\n        !insertmacro __InstallLib_Helper_AddRegToolEntry 'T' \"$R4\" \"$R5\"\n      !endif\n\n      !ifdef INSTALLLIB_LIBTYPE_REGEXE\n        !insertmacro __InstallLib_Helper_AddRegToolEntry 'E' \"$R4\" \"$R5\"\n      !endif\n\n      Return\n\n  !endif\n\n  ;------------------------\n  ;End label\n\n  \"installlib.end_${INSTALLLIB_UNIQUE}:\"\n\n  !ifdef LIBRARY_X64\n\n    ${EnableX64FSRedirection}\n\n  !endif\n\n  ;------------------------\n  ;Undefine\n\n  !undef INSTALLLIB_UNIQUE\n\n  !undef ${INSTALLLIB_LIBTYPE_SET}\n  !undef INSTALLLIB_LIBTYPE_SET\n  !undef ${INSTALLLIB_SHARED_SET}\n  !undef INSTALLLIB_SHARED_SET\n  !undef ${INSTALLLIB_INSTALL_SET}\n  !undef INSTALLLIB_INSTALL_SET\n\n  !verbose pop\n\n!macroend\n\n### Uninstall library\n!macro UnInstallLib libtype shared uninstall file\n\n  !verbose push\n  !verbose 3\n\n  Push $R0\n  Push $R1\n\n  ;------------------------\n  ;Define\n\n  !define UNINSTALLLIB_UNIQUE \"${__FILE__}${__LINE__}\"\n\n  !define UNINSTALLLIB_LIBTYPE_${libtype}\n  !define UNINSTALLLIB_LIBTYPE_SET UNINSTALLLIB_LIBTYPE_${libtype}\n  !define UNINSTALLLIB_SHARED_${shared}\n  !define UNINSTALLLIB_SHARED_SET UNINSTALLLIB_SHARED_${shared}\n  !define UNINSTALLLIB_UNINSTALL_${uninstall}\n  !define UNINSTALLLIB_UNINSTALL_SET UNINSTALLLIB_UNINSTALL_${uninstall}\n\n  ;------------------------\n  ;Validate\n\n  !ifndef UNINSTALLLIB_LIBTYPE_DLL & UNINSTALLLIB_LIBTYPE_REGDLL & UNINSTALLLIB_LIBTYPE_TLB & \\\n    UNINSTALLLIB_LIBTYPE_REGDLLTLB & UNINSTALLLIB_LIBTYPE_REGEXE\n    !error \"UnInstallLib: Incorrect setting for parameter: libtype\"\n  !endif\n\n  !ifndef UNINSTALLLIB_SHARED_NOTSHARED & UNINSTALLLIB_SHARED_SHARED\n    !error \"UnInstallLib: Incorrect setting for parameter: shared\"\n  !endif\n\n  !ifndef UNINSTALLLIB_UNINSTALL_NOREMOVE & UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED & \\\n    UNINSTALLLIB_UNINSTALL_REBOOT_NOTPROTECTED & UNINSTALLLIB_UNINSTALL_NOREBOOT_PROTECTED & \\\n    UNINSTALLLIB_UNINSTALL_NOREBOOT_NOTPROTECTED\n    !error \"UnInstallLib: Incorrect setting for parameter: uninstall\"\n  !endif\n\n  ;------------------------\n  ;x64 settings\n\n  !ifdef LIBRARY_X64\n\n    ${DisableX64FSRedirection}\n\n  !endif\n\n  ;------------------------\n  ;Copy the parameters used on run-time to a variable\n  ;This allows the usage of variables as parameter\n\n  StrCpy $R1 \"${file}\"\n\n  ;------------------------\n  ;Shared library count\n\n  !ifdef UNINSTALLLIB_SHARED_SHARED\n\n    !define UNINSTALLLIB_DONE_LABEL\n\n    !ifdef LIBRARY_X64\n\n      SetRegView 64\n\n    !endif\n\n    ReadRegDword $R0 HKLM Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs $R1\n    StrCmp $R0 \"\" \"uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}\"\n\n    IntOp $R0 $R0 - 1\n    IntCmp $R0 0 \"uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}\" \\\n      \"uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}\" \"uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}\"\n\n    \"uninstalllib.shareddllremove_${UNINSTALLLIB_UNIQUE}:\"\n      DeleteRegValue HKLM Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs $R1\n      !ifndef UNINSTALLLIB_SHARED_SHAREDNOREMOVE\n        Goto \"uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}\"\n      !endif\n\n    \"uninstalllib.shareddllinuse_${UNINSTALLLIB_UNIQUE}:\"\n      WriteRegDWORD HKLM Software\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs $R1 $R0\n\n        !ifdef LIBRARY_X64\n\n          SetRegView lastused\n\n        !endif\n\n      Goto \"uninstalllib.done_${UNINSTALLLIB_UNIQUE}\"\n\n    \"uninstalllib.shareddlldone_${UNINSTALLLIB_UNIQUE}:\"\n\n    !ifdef LIBRARY_X64\n\n      SetRegView lastused\n\n    !endif\n\n  !endif\n\n  ;------------------------\n  ;Remove\n\n  !ifndef UNINSTALLLIB_UNINSTALL_NOREMOVE\n\n    ;------------------------\n    ;Check Windows File Protection\n\n    !ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_NOREBOOT_PROTECTED\n\n      !ifndef UNINSTALLLIB_DONE_LABEL\n\n        !define UNINSTALLLIB_DONE_LABEL\n\n      !endif\n\n      System::Call \"sfc::SfcIsFileProtected(i 0, w $R1) i.R0\"\n\n        StrCmp $R0 \"error\" \"uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}\"\n        StrCmp $R0 \"0\" \"uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}\"\n\n      Goto \"uninstalllib.done_${UNINSTALLLIB_UNIQUE}\"\n\n      \"uninstalllib.notprotected_${UNINSTALLLIB_UNIQUE}:\"\n\n    !endif\n\n    ;------------------------\n    ;Unregister\n\n    !ifdef UNINSTALLLIB_LIBTYPE_REGDLL | UNINSTALLLIB_LIBTYPE_REGDLLTLB\n\n      !ifndef LIBRARY_X64\n\n        UnRegDLL $R1\n\n      !else\n\n        ExecWait '\"$SYSDIR\\regsvr32.exe\" /s /u \"$R1\"'\n\n      !endif\n\n    !endif\n\n    !ifdef UNINSTALLLIB_LIBTYPE_REGEXE\n\n      ExecWait '\"$R1\" /unregserver'\n\n    !endif\n\n    !ifdef UNINSTALLLIB_LIBTYPE_TLB | UNINSTALLLIB_LIBTYPE_REGDLLTLB\n\n      TypeLib::UnRegister $R1\n\n    !endif\n\n    !ifdef LIBRARY_SHELL_EXTENSION\n\n      System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'\n\n    !endif\n\n    !ifdef LIBRARY_COM\n\n      System::Call 'Ole32::CoFreeUnusedLibraries()'\n\n    !endif\n\n    ;------------------------\n    ;Delete\n\n    Delete $R1\n\n    !ifdef UNINSTALLLIB_UNINSTALL_REBOOT_PROTECTED | UNINSTALLLIB_UNINSTALL_REBOOT_NOTPROTECTED\n\n      ${If} ${FileExists} $R1\n        # File is in use, can't just delete.\n        # Move file to another location before using Delete /REBOOTOK. This way, if\n        #  the user installs a new version of the DLL, it won't be deleted after\n        #  reboot. See bug #1097642 for more information on this.\n\n        # Try moving to $TEMP.\n        GetTempFileName $R0\n        Delete $R0\n        Rename $R1 $R0\n\n        ${If} ${FileExists} $R1\n          # Still here, delete temporary file, in case the file was copied\n          #  and not deleted. This happens when moving from network drives,\n          #  for example.\n          Delete $R0\n\n          # Try moving to directory containing the file.\n          !insertmacro __InstallLib_Helper_GetParent $R1 $R0\n          GetTempFileName $R0 $R0\n          Delete $R0\n          Rename $R1 $R0\n\n          ${If} ${FileExists} $R1\n            # Still here, delete temporary file.\n            Delete $R0\n\n            # Give up moving, simply Delete /REBOOTOK the file.\n            StrCpy $R0 $R1\n          ${EndIf}\n        ${EndIf}\n\n        # Delete the moved file.\n        Delete /REBOOTOK $R0\n      ${EndIf}\n\n    !endif\n\n  !endif\n\n  ;------------------------\n  ;Done\n\n  !ifdef UNINSTALLLIB_DONE_LABEL\n\n    !undef UNINSTALLLIB_DONE_LABEL\n\n    \"uninstalllib.done_${UNINSTALLLIB_UNIQUE}:\"\n\n  !endif\n\n  !ifdef LIBRARY_X64\n\n    ${EnableX64FSRedirection}\n\n  !endif\n\n  Pop $R1\n  Pop $R0\n\n  ;------------------------\n  ;Undefine\n\n  !undef UNINSTALLLIB_UNIQUE\n\n  !undef ${UNINSTALLLIB_LIBTYPE_SET}\n  !undef UNINSTALLLIB_LIBTYPE_SET\n  !undef ${UNINSTALLLIB_SHARED_SET}\n  !undef UNINSTALLLIB_SHARED_SET\n  !undef ${UNINSTALLLIB_UNINSTALL_SET}\n  !undef UNINSTALLLIB_UNINSTALL_SET\n\n  !verbose pop\n\n!macroend\n\n!endif\n\n!verbose pop\n"
  },
  {
    "path": "setup/nsis/tools/Include/LogicLib.nsh",
    "content": "; NSIS LOGIC LIBRARY - LogicLib.nsh\n; Version 2.6 - 08/12/2007\n; By dselkirk@hotmail.com\n; and eccles@users.sf.net\n; with IfNot support added by Message\n;\n; Questions/Comments -\n; See http://forums.winamp.com/showthread.php?s=&postid=1116241\n;\n; Description:\n;   Provides the use of various logic statements within NSIS.\n;\n; Usage:\n;   The following \"statements\" are available:\n;       If|IfNot|Unless..{ElseIf|ElseIfNot|ElseUnless}..[Else]..EndIf|EndUnless\n;         - Conditionally executes a block of statements, depending on the value\n;           of an expression. IfNot and Unless are equivalent and\n;           interchangeable, as are ElseIfNot and ElseUnless.\n;       AndIf|AndIfNot|AndUnless|OrIf|OrIfNot|OrUnless\n;         - Adds any number of extra conditions to If, IfNot, Unless, ElseIf,\n;           ElseIfNot and ElseUnless statements.\n;       IfThen|IfNotThen..|..|\n;         - Conditionally executes an inline statement, depending on the value\n;           of an expression.\n;       IfCmd..||..|\n;         - Conditionally executes an inline statement, depending on a true\n;           value of the provided NSIS function.\n;       Select..{Case[2|3|4|5]}..[CaseElse|Default]..EndSelect\n;         - Executes one of several blocks of statements, depending on the value\n;           of an expression.\n;       Switch..{Case|CaseElse|Default}..EndSwitch\n;         - Jumps to one of several labels, depending on the value of an\n;           expression.\n;       Do[While|Until]..{ExitDo|Continue|Break}..Loop[While|Until]\n;         - Repeats a block of statements until stopped, or depending on the\n;           value of an expression.\n;       While..{ExitWhile|Continue|Break}..EndWhile\n;         - An alias for DoWhile..Loop (for backwards-compatibility)\n;       For[Each]..{ExitFor|Continue|Break}..Next\n;         - Repeats a block of statements varying the value of a variable.\n;\n;   The following \"expressions\" are available:\n;       Standard (built-in) string tests (which are case-insensitive):\n;         a == b; a != b\n;       Additional case-insensitive string tests (using System.dll):\n;         a S< b; a S>= b; a S> b; a S<= b\n;       Case-sensitive string tests:\n;         a S== b; a S!= b\n;       Standard (built-in) signed integer tests:\n;         a = b; a <> b; a < b; a >= b; a > b; a <= b; a & b\n;       Standard (built-in) unsigned integer tests:\n;         a U< b; a U>= b; a U> b; a U<= b\n;       64-bit integer tests (using System.dll):\n;         a L= b; a L<> b; a L< b; a L>= b; a L> b; a L<= b\n;       ptrdiff_t integer tests\n;         a P= b; a P<> b; a P< b; a P>= b; a P> b; a P<= b\n;       size_t integer tests\n;         a Z= b; a Z<> b; a Z< b; a Z>= b; a Z> b; a Z<= b\n;       Built-in NSIS flag tests:\n;         ${Abort}; ${Errors}; ${RebootFlag}; ${Silent}; ${RtlLanguage};\n;         ${ShellVarContextAll}\n;       Built-in NSIS other tests:\n;         ${FileExists} a\n;       Any conditional NSIS instruction test:\n;         ${Cmd} a\n;       Section flag tests:\n;         ${SectionIsSelected} a; ${SectionIsSectionGroup} a;\n;         ${SectionIsSectionGroupEnd} a; ${SectionIsBold} a;\n;         ${SectionIsReadOnly} a; ${SectionIsExpanded} a;\n;         ${SectionIsPartiallySelected} a\n;       Additional tests:\n;         HK RegKeyIsEmpty SubKey\n;\n; Examples:\n;   See LogicLib.nsi in the Examples folder for lots of example usage.\n\n!verbose push\n!verbose 3\n!ifndef LOGICLIB_VERBOSITY\n  !define LOGICLIB_VERBOSITY 3\n!endif\n!define _LOGICLIB_VERBOSITY ${LOGICLIB_VERBOSITY}\n!undef LOGICLIB_VERBOSITY\n!verbose ${_LOGICLIB_VERBOSITY}\n\n!ifndef LOGICLIB\n  !define LOGICLIB\n  !define | \"'\"\n  !define || \"' '\"\n  !define LOGICLIB_COUNTER 0\n\n  !include Sections.nsh\n\n  !macro _LOGICLIB_TEMP\n    !ifndef _LOGICLIB_TEMP\n      !define _LOGICLIB_TEMP\n      Var /GLOBAL _LOGICLIB_TEMP  ; Temporary variable to aid the more elaborate logic tests\n    !endif\n  !macroend\n\n  !macro LogicLib_JumpToBranch _Jump _Skip\n    !if `${_Jump}` != ``\n      StrCmp \"\" \"\" `${_Jump}` ${_Skip}\n    !endif\n  !macroend\n\n  !macro _IncreaseCounter\n    !define /redef /math LOGICLIB_COUNTER `${LOGICLIB_COUNTER}` + 1\n  !macroend\n\n  !macro _PushLogic\n    !insertmacro _PushScope Logic _LogicLib_Label_${LOGICLIB_COUNTER}\n    !insertmacro _IncreaseCounter\n  !macroend\n\n  !macro _PopLogic\n    !insertmacro _PopScope Logic\n  !macroend\n\n  !macro _PushScope Type label\n    !ifdef _${Type}                                       ; If we already have a statement\n      !define _Cur${Type} ${_${Type}}\n      !undef _${Type}\n      !define _${Type} ${label}\n      !define ${_${Type}}Prev${Type} ${_Cur${Type}}       ; Save the current logic\n      !undef _Cur${Type}\n    !else\n      !define _${Type} ${label}                           ; Initialise for first statement\n    !endif\n  !macroend\n\n  !macro _PopScope Type\n    !ifndef _${Type}\n      !error \"Cannot use _Pop${Type} without a preceding _Push${Type}\"\n    !endif\n    !ifdef ${_${Type}}Prev${Type}                         ; If a previous statement was active then restore it\n      !define _Cur${Type} ${_${Type}}\n      !undef _${Type}\n      !define _${Type} ${${_Cur${Type}}Prev${Type}}\n      !undef ${_Cur${Type}}Prev${Type}\n      !undef _Cur${Type}\n    !else\n      !undef _${Type}\n    !endif\n  !macroend\n\n  !macro _LogicLib_AlwaysTrue _a _b _t _f\n    !insertmacro LogicLib_JumpToBranch `${_t}` `${_f}`\n  !macroend\n  !macro _LogicLib_AlwaysFalse _a _b _t _f\n    !insertmacro LogicLib_JumpToBranch `${_f}` `${_t}`\n  !macroend\n\n  ; String tests\n  !macro _== _a _b _t _f\n    StrCmp `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _!= _a _b _t _f\n    !insertmacro _== `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  ; Case-sensitive string tests\n  !macro _S== _a _b _t _f\n    StrCmpS `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _S!= _a _b _t _f\n    !insertmacro _S== `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  ; Extra string tests (cannot do these case-sensitively - I tried and lstrcmp still ignored the case)\n  !macro _StrCmpI _a _b _e _l _m\n    !insertmacro _LOGICLIB_TEMP\n    System::Call `kernel32::lstrcmpi(ts, ts) i.s` `${_a}` `${_b}`\n    Pop $_LOGICLIB_TEMP\n    IntCmp $_LOGICLIB_TEMP 0 `${_e}` `${_l}` `${_m}`\n  !macroend\n\n  !macro _S< _a _b _t _f\n    !insertmacro _StrCmpI `${_a}` `${_b}` `${_f}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _S>= _a _b _t _f\n    !insertmacro _S< `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _S> _a _b _t _f\n    !insertmacro _StrCmpI `${_a}` `${_b}` `${_f}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _S<= _a _b _t _f\n    !insertmacro _S> `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  ; Integer tests\n  !macro _= _a _b _t _f\n    IntCmp `${_a}` `${_b}` `${_t}` `${_f}` `${_f}`\n  !macroend\n\n  !macro _<> _a _b _t _f\n    !insertmacro _= `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _< _a _b _t _f\n    IntCmp `${_a}` `${_b}` `${_f}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _>= _a _b _t _f\n    !insertmacro _< `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _> _a _b _t _f\n    IntCmp `${_a}` `${_b}` `${_f}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _<= _a _b _t _f\n    !insertmacro _> `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _& _a _b _t _f\n    !insertmacro _LOGICLIB_TEMP\n    IntOp $_LOGICLIB_TEMP `${_a}` & `${_b}`\n    !insertmacro _<> $_LOGICLIB_TEMP 0 `${_t}` `${_f}`\n  !macroend\n\n  ; Unsigned integer tests (NB: no need for extra equality tests)\n  !macro _U< _a _b _t _f\n    IntCmpU `${_a}` `${_b}` `${_f}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _U>= _a _b _t _f\n    !insertmacro _U< `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _U> _a _b _t _f\n    IntCmpU `${_a}` `${_b}` `${_f}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _U<= _a _b _t _f\n    !insertmacro _U> `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  ; Int64 tests\n  !macro _Int64Cmp _a _o _b _t _f\n    !insertmacro _LOGICLIB_TEMP\n    System::Int64Op `${_a}` `${_o}` `${_b}`\n    Pop $_LOGICLIB_TEMP\n    !insertmacro _= $_LOGICLIB_TEMP 0 `${_f}` `${_t}`\n  !macroend\n\n  !macro _L= _a _b _t _f\n    !insertmacro _Int64Cmp `${_a}` = `${_b}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _L<> _a _b _t _f\n    !insertmacro _L= `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _L< _a _b _t _f\n    !insertmacro _Int64Cmp `${_a}` < `${_b}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _L>= _a _b _t _f\n    !insertmacro _L< `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  !macro _L> _a _b _t _f\n    !insertmacro _Int64Cmp `${_a}` > `${_b}` `${_t}` `${_f}`\n  !macroend\n\n  !macro _L<= _a _b _t _f\n    !insertmacro _L> `${_a}` `${_b}` `${_f}` `${_t}`\n  !macroend\n\n  ; ptrdiff_t & size_t tests\n  !macro LogicLib_PtrDiffTest _o _a _b _t _f\n    !if \"${NSIS_PTR_SIZE}\" <= 4\n      !insertmacro _${_o} `${_a}` `${_b}` `${_t}` `${_f}`\n    !else\n      !insertmacro _L${_o} `${_a}` `${_b}` `${_t}` `${_f}`\n    !endif\n  !macroend\n  !macro _P= _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest = `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !macro _P<> _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest <> `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !macro _P< _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest < `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !macro _P>= _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest >= `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !macro _P> _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest > `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !macro _P<= _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest <= `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !include Util.nsh\n  !macro _Z= _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest = `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !macro _Z<> _a _b _t _f\n    !insertmacro LogicLib_PtrDiffTest <> `${_a}` `${_b}` `${_t}` `${_f}`\n  !macroend\n  !macro _Z< _a _b _t _f\n    !insertmacro IntPtrCmpU `${_a}` `${_b}` `${_f}` `${_t}` `${_f}`\n  !macroend\n  !macro _Z>= _a _b _t _f\n    !insertmacro IntPtrCmpU `${_a}` `${_b}` `${_t}` `${_f}` `${_t}`\n  !macroend\n  !macro _Z> _a _b _t _f\n    !insertmacro IntPtrCmpU `${_a}` `${_b}` `${_f}` `${_f}` `${_t}`\n  !macroend\n  !macro _Z<= _a _b _t _f\n    !insertmacro IntPtrCmpU `${_a}` `${_b}` `${_t}` `${_t}` `${_f}`\n  !macroend\n\n  ; Flag tests\n  !macro _Abort _a _b _t _f\n    IfAbort `${_t}` `${_f}`\n  !macroend\n  !define Abort `\"\" Abort \"\"`\n\n  !macro _Errors _a _b _t _f\n    IfErrors `${_t}` `${_f}`\n  !macroend\n  !define Errors `\"\" Errors \"\"`\n\n  !macro _FileExists _a _b _t _f\n    IfFileExists `${_b}` `${_t}` `${_f}`\n  !macroend\n  !define FileExists `\"\" FileExists`\n\n  !macro _RebootFlag _a _b _t _f\n    IfRebootFlag `${_t}` `${_f}`\n  !macroend\n  !define RebootFlag `\"\" RebootFlag \"\"`\n\n  !macro _Silent _a _b _t _f\n    IfSilent `${_t}` `${_f}`\n  !macroend\n  !define Silent `\"\" Silent \"\"`\n\n  !macro _ShellVarContextAll _a _b _t _f\n    IfShellVarContextAll `${_t}` `${_f}`\n  !macroend\n  !define ShellVarContextAll `\"\" ShellVarContextAll \"\"`\n\n  !macro _RtlLanguage _a _b _t _f\n    IfRtlLanguage `${_t}` `${_f}`\n  !macroend\n  !define RtlLanguage `\"\" RtlLanguage \"\"`\n\n  !macro _AltRegView _a _b _t _f\n    IfAltRegView `${_t}` `${_f}`\n  !macroend\n  !define AltRegView `\"\" AltRegView \"\"`\n\n  !macro _RegKeyIsEmpty _a _b _t _f\n    !insertmacro _LOGICLIB_TEMP\n    ClearErrors\n    EnumRegValue $_LOGICLIB_TEMP ${_a} `${_b}` \"\"\n    !if `${_f}` != ``\n    IfErrors \"\" `${_f}` ; Skip calls to EnumRegKey and _== if possible\n    !else\n    IfErrors +3\n    StrCpy $_LOGICLIB_TEMP \"1\" ; The default value is also named \"\", make sure we don't mistake it as empty\n    Goto +2\n    !endif\n    EnumRegKey $_LOGICLIB_TEMP ${_a} `${_b}` \"\"\n    !insertmacro _== $_LOGICLIB_TEMP \"\" `${_t}` `${_f}`\n  !macroend\n  !define RegKeyIsEmpty `RegKeyIsEmpty`\n\n  ; \"Any instruction\" test\n  !macro _Cmd _a _b _t _f\n    !define _t=${_t}\n    !ifdef _t=                                            ; If no true label then make one\n      !define __t _LogicLib_Label_${LOGICLIB_COUNTER}\n      !insertmacro _IncreaseCounter\n    !else\n      !define __t ${_t}\n    !endif\n    ${_b} ${__t}\n    !define _f=${_f}\n    !ifndef _f=                                           ; If a false label then go there\n      Goto ${_f}\n    !endif\n    !undef _f=${_f}\n    !ifdef _t=                                            ; If we made our own true label then place it\n      ${__t}:\n    !endif\n    !undef __t\n    !undef _t=${_t}\n  !macroend\n  !define Cmd `\"\" Cmd`\n\n  ; Section flag test\n  !macro _SectionFlagIsSet _a _b _t _f\n    !insertmacro _LOGICLIB_TEMP\n    SectionGetFlags `${_b}` $_LOGICLIB_TEMP\n    IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP & `${_a}`\n    !insertmacro _= $_LOGICLIB_TEMP `${_a}` `${_t}` `${_f}`\n  !macroend\n  !define SectionIsSelected `${SF_SELECTED} SectionFlagIsSet`\n  !define SectionIsSubSection `${SF_SUBSEC} SectionFlagIsSet`\n  !define SectionIsSubSectionEnd `${SF_SUBSECEND} SectionFlagIsSet`\n  !define SectionIsSectionGroup `${SF_SECGRP} SectionFlagIsSet`\n  !define SectionIsSectionGroupEnd `${SF_SECGRPEND} SectionFlagIsSet`\n  !define SectionIsBold `${SF_BOLD} SectionFlagIsSet`\n  !define SectionIsReadOnly `${SF_RO} SectionFlagIsSet`\n  !define SectionIsExpanded `${SF_EXPAND} SectionFlagIsSet`\n  !define SectionIsPartiallySelected `${SF_PSELECTED} SectionFlagIsSet`\n\n  !define IfCmd `!insertmacro _IfThen \"\" Cmd ${|}`\n\n  !macro _If _c _a _o _b\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !insertmacro _PushLogic\n    !define ${_Logic}If\n    !define ${_Logic}Else _LogicLib_ElseLabel_${LOGICLIB_COUNTER} ; Get a label for the Else\n    !insertmacro _IncreaseCounter\n    !define _c=${_c}\n    !ifdef _c=true                                        ; If is true\n      !insertmacro _${_o} `${_a}` `${_b}` \"\" ${${_Logic}Else}\n    !else                                                 ; If condition is false\n      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} \"\"\n    !endif\n    !undef _c=${_c}\n    !verbose pop\n  !macroend\n  !define If     `!insertmacro _If true`\n  !define Unless `!insertmacro _If false`\n  !define IfNot  `!insertmacro _If false`\n\n  !macro _And _c _a _o _b\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}If\n      !error \"Cannot use And without a preceding If or IfNot/Unless\"\n    !endif\n    !ifndef ${_Logic}Else\n      !error \"Cannot use And following an Else\"\n    !endif\n    !define _c=${_c}\n    !ifdef _c=true                                        ; If is true\n      !insertmacro _${_o} `${_a}` `${_b}` \"\" ${${_Logic}Else}\n    !else                                                 ; If condition is false\n      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} \"\"\n    !endif\n    !undef _c=${_c}\n    !verbose pop\n  !macroend\n  !define AndIf     `!insertmacro _And true`\n  !define AndUnless `!insertmacro _And false`\n  !define AndIfNot  `!insertmacro _And false`\n\n  !macro _Or _c _a _o _b\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}If\n      !error \"Cannot use Or without a preceding If or IfNot/Unless\"\n    !endif\n    !ifndef ${_Logic}Else\n      !error \"Cannot use Or following an Else\"\n    !endif\n    !define _label _LogicLib_Label_${LOGICLIB_COUNTER}    ; Skip this test as we already\n    !insertmacro _IncreaseCounter\n    Goto ${_label}                                        ; have a successful result\n    ${${_Logic}Else}:                                     ; Place the Else label\n    !undef ${_Logic}Else                                  ; and remove it\n    !define ${_Logic}Else _LogicLib_ElseLabel_${LOGICLIB_COUNTER} ; Get a label for the next Else and perform the new If\n    !insertmacro _IncreaseCounter\n    !define _c=${_c}\n    !ifdef _c=true                                        ; If is true\n      !insertmacro _${_o} `${_a}` `${_b}` \"\" ${${_Logic}Else}\n    !else                                                 ; If condition is false\n      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} \"\"\n    !endif\n    !undef _c=${_c}\n    ${_label}:\n    !undef _label\n    !verbose pop\n  !macroend\n  !define OrIf     `!insertmacro _Or true`\n  !define OrUnless `!insertmacro _Or false`\n  !define OrIfNot  `!insertmacro _Or false`\n\n  !macro _Else\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}If\n      !error \"Cannot use Else without a preceding If or IfNot/Unless\"\n    !endif\n    !ifndef ${_Logic}Else\n      !error \"Cannot use Else following an Else\"\n    !endif\n    !ifndef ${_Logic}EndIf                                ; First Else for this If?\n      !define ${_Logic}EndIf _LogicLib_EndIfLabel_${LOGICLIB_COUNTER} ; Get a label for the EndIf\n      !insertmacro _IncreaseCounter\n    !endif\n    Goto ${${_Logic}EndIf}                                ; Go to the EndIf\n    ${${_Logic}Else}:                                     ; Place the Else label\n    !undef ${_Logic}Else                                  ; and remove it\n    !verbose pop\n  !macroend\n  !define Else `!insertmacro _Else`\n\n  !macro _ElseIf _c _a _o _b\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${Else}                                               ; Perform the Else\n    !define ${_Logic}Else _LogicLib_ElseLabel_${LOGICLIB_COUNTER} ; Get a label for the next Else and perform the new If\n    !insertmacro _IncreaseCounter\n    !define _c=${_c}\n    !ifdef _c=true                                        ; If is true\n      !insertmacro _${_o} `${_a}` `${_b}` \"\" ${${_Logic}Else}\n    !else                                                 ; If condition is false\n      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}Else} \"\"\n    !endif\n    !undef _c=${_c}\n    !verbose pop\n  !macroend\n  !define ElseIf     `!insertmacro _ElseIf true`\n  !define ElseUnless `!insertmacro _ElseIf false`\n  !define ElseIfNot  `!insertmacro _ElseIf false`\n\n  !macro _EndIf _n\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}If\n      !error \"Cannot use End${_n} without a preceding If or IfNot/Unless\"\n    !endif\n    !ifdef ${_Logic}Else\n      ${${_Logic}Else}:                                   ; Place the Else label\n      !undef ${_Logic}Else                                ; and remove it\n    !endif\n    !ifdef ${_Logic}EndIf\n      ${${_Logic}EndIf}:                                  ; Place the EndIf\n      !undef ${_Logic}EndIf                               ; and remove it\n    !endif\n    !undef ${_Logic}If\n    !insertmacro _PopLogic\n    !verbose pop\n  !macroend\n  !define EndIf     `!insertmacro _EndIf If`\n  !define EndUnless `!insertmacro _EndIf Unless`\n\n  !macro _IfThen _a _o _b _t\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${If} `${_a}` `${_o}` `${_b}`\n      ${_t}\n    ${EndIf}\n    !verbose pop\n  !macroend\n  !define IfThen `!insertmacro _IfThen`\n\n  !macro _IfNotThen _a _o _b _t\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${IfNot} `${_a}` `${_o}` `${_b}`\n      ${_t}\n    ${EndIf}\n    !verbose pop\n  !macroend\n  !define IfNotThen `!insertmacro _IfNotThen`\n\n  !macro _ForEach _v _f _t _o _s\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    StrCpy \"${_v}\" \"${_f}\"                                ; Assign the initial value\n    Goto +2                                               ; Skip the loop expression for the first iteration\n    !define _DoLoopExpression `IntOp \"${_v}\" \"${_v}\" \"${_o}\" \"${_s}\"` ; Define the loop expression\n    !define _o=${_o}\n    !ifdef _o=+                                           ; Check the loop expression operator\n      !define __o >                                       ; to determine the correct loop condition\n    !else ifdef _o=-\n      !define __o <\n    !else\n      !error \"Unsupported ForEach step operator (must be + or -)\"\n    !endif\n    !undef _o=${_o}\n    !insertmacro _Do For false `${_v}` `${__o}` `${_t}`   ; Let Do do the rest\n    !undef __o\n    !verbose pop\n  !macroend\n  !define ForEach `!insertmacro _ForEach`\n\n  !macro _For _v _f _t\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${ForEach} `${_v}` `${_f}` `${_t}` + 1                ; Pass on to ForEach\n    !verbose pop\n  !macroend\n  !define For `!insertmacro _For`\n\n  !define ExitFor `!insertmacro _Goto ExitFor For`\n\n  !define Next      `!insertmacro _Loop For Next \"\" \"\" \"\" \"\"`\n\n  !define While     `!insertmacro _Do While true`\n\n  !define ExitWhile `!insertmacro _Goto ExitWhile While`\n\n  !define EndWhile  `!insertmacro _Loop While EndWhile \"\" \"\" \"\" \"\"`\n\n  !macro _Do _n _c _a _o _b\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !insertmacro _PushLogic\n    !define ${_Logic}${_n} _LogicLib_Label_${LOGICLIB_COUNTER} ; Get a label for the start of the loop\n    !insertmacro _IncreaseCounter\n    ${${_Logic}${_n}}:\n    !insertmacro _PushScope Exit${_n} _LogicLib_Label_${LOGICLIB_COUNTER} ; Get a label for the end of the loop\n    !insertmacro _IncreaseCounter\n    !insertmacro _PushScope Break ${_Exit${_n}}           ; Break goes to the end of the loop\n    !ifdef _DoLoopExpression\n      ${_DoLoopExpression}                                ; Special extra parameter for inserting code\n      !undef _DoLoopExpression                            ; between the Continue label and the loop condition\n    !endif\n    !define _c=${_c}\n    !ifdef _c=                                            ; No starting condition\n      !insertmacro _PushScope Continue _LogicLib_Label_${LOGICLIB_COUNTER} ; Get a label for Continue at the end of the loop\n      !insertmacro _IncreaseCounter\n    !else\n      !insertmacro _PushScope Continue ${${_Logic}${_n}}  ; Continue goes to the start of the loop\n      !ifdef _c=true                                      ; If is true\n        !insertmacro _${_o} `${_a}` `${_b}` \"\" ${_Exit${_n}}\n      !else                                               ; If condition is false\n        !insertmacro _${_o} `${_a}` `${_b}` ${_Exit${_n}} \"\"\n      !endif\n    !endif\n    !undef _c=${_c}\n    !define ${_Logic}Condition ${_c}                      ; Remember the condition used\n    !verbose pop\n  !macroend\n  !define Do      `!insertmacro _Do Do \"\" \"\" \"\" \"\"`\n  !define DoWhile `!insertmacro _Do Do true`\n  !define DoUntil `!insertmacro _Do Do false`\n\n  !macro _Goto _n _s\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _${_n}\n      !error \"Cannot use ${_n} without a preceding ${_s}\"\n    !endif\n    Goto ${_${_n}}\n    !verbose pop\n  !macroend\n  !define ExitDo   `!insertmacro _Goto ExitDo Do`\n\n  !macro _Loop _n _e _c _a _o _b\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}${_n}\n      !error \"Cannot use ${_e} without a preceding ${_n}\"\n    !endif\n    !define _c=${${_Logic}Condition}\n    !ifdef _c=                                            ; If Do had no condition place the Continue label\n      ${_Continue}:\n    !endif\n    !undef _c=${${_Logic}Condition}\n    !define _c=${_c}\n    !ifdef _c=                                            ; No ending condition\n      Goto ${${_Logic}${_n}}\n    !else ifdef _c=true                                   ; If condition is true\n      !insertmacro _${_o} `${_a}` `${_b}` ${${_Logic}${_n}} ${_Exit${_n}}\n    !else                                                 ; If condition is false\n      !insertmacro _${_o} `${_a}` `${_b}` ${_Exit${_n}} ${${_Logic}${_n}}\n    !endif\n    !undef _c=${_c}\n    Goto ${_Continue}                                     ; Just to ensure it is referenced at least once\n    Goto ${_Exit${_n}}                                    ; Just to ensure it is referenced at least once\n    ${_Exit${_n}}:                                        ; Place the loop exit point\n    !undef ${_Logic}Condition\n    !insertmacro _PopScope Continue\n    !insertmacro _PopScope Break\n    !insertmacro _PopScope Exit${_n}\n    !undef ${_Logic}${_n}\n    !insertmacro _PopLogic\n    !verbose pop\n  !macroend\n  !define Loop      `!insertmacro _Loop Do Loop \"\" \"\" \"\" \"\"`\n  !define LoopWhile `!insertmacro _Loop Do LoopWhile true`\n  !define LoopUntil `!insertmacro _Loop Do LoopUntil false`\n\n  !define Continue `!insertmacro _Goto Continue \"For or Do or While\"`\n  !define Break    `!insertmacro _Goto Break \"For or Do or While\"`\n\n  !macro _Select _a\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !insertmacro _PushLogic\n    !define ${_Logic}Select `${_a}`                       ; Remember the left hand side of the comparison\n    !verbose pop\n  !macroend\n  !define Select `!insertmacro _Select`\n\n  !macro _Select_CaseElse\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}Select\n      !error \"Cannot use Case without a preceding Select\"\n    !endif\n    !ifdef ${_Logic}EndSelect                             ; This is set only after the first case\n      !ifndef ${_Logic}Else\n        !error \"Cannot use Case following a CaseElse\"\n      !endif\n      Goto ${${_Logic}EndSelect}                          ; Go to EndSelect (Ends the previous Case)\n      !define /IfNDef _LogicLib_EndSelectLabelUsed_${_Logic}\n      ${${_Logic}Else}:                                   ; Place the Else label\n      !undef ${_Logic}Else                                ; and remove it\n    !else\n      !define ${_Logic}EndSelect _LogicLib_EndSelectLabel_${LOGICLIB_COUNTER} ; Get a label for the EndSelect\n      !insertmacro _IncreaseCounter\n    !endif\n    !verbose pop\n  !macroend\n  !define CaseElse `!insertmacro _CaseElse`\n  !define Case_Else `!insertmacro _CaseElse`              ; Compatibility with 2.2 and earlier\n  !define Default `!insertmacro _CaseElse`                ; For the C-minded\n\n  !macro _Select_Case _a\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${CaseElse}                                           ; Perform the CaseElse\n    !define ${_Logic}Else _LogicLib_NextSelectCaseLabel_${LOGICLIB_COUNTER} ; Get a label for the next Else and perform the new Case\n    !insertmacro _IncreaseCounter\n    !insertmacro _== `${${_Logic}Select}` `${_a}` \"\" ${${_Logic}Else}\n    !verbose pop\n  !macroend\n  !define Case `!insertmacro _Case`\n\n  !macro _Case2 _a _b\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${CaseElse}                                           ; Perform the CaseElse\n    !define ${_Logic}Else _LogicLib_NextSelectCaseLabel_${LOGICLIB_COUNTER} ; Get a label for the next Else and perform the new Case\n    !insertmacro _IncreaseCounter\n    !insertmacro _== `${${_Logic}Select}` `${_a}` +2 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_b}` \"\" ${${_Logic}Else}\n    !verbose pop\n  !macroend\n  !define Case2 `!insertmacro _Case2`\n\n  !macro _Case3 _a _b _c\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${CaseElse}                                           ; Perform the CaseElse\n    !define ${_Logic}Else _LogicLib_NextSelectCaseLabel_${LOGICLIB_COUNTER} ; Get a label for the next Else and perform the new Case\n    !insertmacro _IncreaseCounter\n    !insertmacro _== `${${_Logic}Select}` `${_a}` +3 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_b}` +2 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_c}` \"\" ${${_Logic}Else}\n    !verbose pop\n  !macroend\n  !define Case3 `!insertmacro _Case3`\n\n  !macro _Case4 _a _b _c _d\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${CaseElse}                                           ; Perform the CaseElse\n    !define ${_Logic}Else _LogicLib_NextSelectCaseLabel_${LOGICLIB_COUNTER} ; Get a label for the next Else and perform the new Case\n    !insertmacro _IncreaseCounter\n    !insertmacro _== `${${_Logic}Select}` `${_a}` +4 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_b}` +3 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_c}` +2 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_d}` \"\" ${${_Logic}Else}\n    !verbose pop\n  !macroend\n  !define Case4 `!insertmacro _Case4`\n\n  !macro _Case5 _a _b _c _d _e\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    ${CaseElse}                                           ; Perform the CaseElse\n    !define ${_Logic}Else _LogicLib_NextSelectCaseLabel_${LOGICLIB_COUNTER} ; Get a label for the next Else and perform the new Case\n    !insertmacro _IncreaseCounter\n    !insertmacro _== `${${_Logic}Select}` `${_a}` +5 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_b}` +4 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_c}` +3 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_d}` +2 \"\"\n    !insertmacro _== `${${_Logic}Select}` `${_e}` \"\" ${${_Logic}Else}\n    !verbose pop\n  !macroend\n  !define Case5 `!insertmacro _Case5`\n\n  !macro _EndSelect\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}Select\n      !error \"Cannot use EndSelect without a preceding Select\"\n    !endif\n    !ifdef ${_Logic}Else\n      ${${_Logic}Else}:                                   ; Place the Else label\n      !undef ${_Logic}Else                                ; and remove it\n    !endif\n    !ifdef ${_Logic}EndSelect                             ; This won't be set if there weren't any cases\n      !ifdef _LogicLib_EndSelectLabelUsed_${_Logic}                 ; There is no jump to ${${_Logic}EndSelect}: if there is only one Case\n        ${${_Logic}EndSelect}:                            ; Place the EndSelect\n        !undef _LogicLib_EndSelectLabelUsed_${_Logic}\n      !endif\n      !undef ${_Logic}EndSelect                           ; and remove it\n    !endif\n    !undef ${_Logic}Select\n    !insertmacro _PopLogic\n    !verbose pop\n  !macroend\n  !define EndSelect `!insertmacro _EndSelect`\n\n  !macro _Switch _a\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !insertmacro _PushLogic\n    !insertmacro _PushScope Switch ${_Logic}              ; Keep a separate stack for switch data\n    !insertmacro _PushScope Break _LogicLib_Label_${LOGICLIB_COUNTER} ; Get a label for beyond the end of the switch\n    !insertmacro _IncreaseCounter\n    !define ${_Switch}Var `${_a}`                         ; Remember the left hand side of the comparison\n    !tempfile ${_Switch}Tmp                               ; Create a temporary file\n    !define ${_Logic}Switch _LogicLib_Label_${LOGICLIB_COUNTER} ; Get a label for the end of the switch\n    !insertmacro _IncreaseCounter\n    Goto ${${_Logic}Switch}                               ; and go there\n    !verbose pop\n  !macroend\n  !define Switch `!insertmacro _Switch`\n\n  !macro _Case _a\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifdef _Logic & ${_Logic}Select                       ; Check for an active Select\n      !insertmacro _Select_Case `${_a}`\n    !else ifndef _Switch                                  ; If not then check for an active Switch\n      !error \"Cannot use Case without a preceding Select or Switch\"\n    !else\n      !define _label _LogicLib_Label_${LOGICLIB_COUNTER}  ; Get a label for this case,\n      !insertmacro _IncreaseCounter\n      ${_label}:                                          ; place it and add it's check to the temp file\n      !appendfile \"${${_Switch}Tmp}\" `!insertmacro _== $\\`${${_Switch}Var}$\\` $\\`${_a}$\\` ${_label} \"\"$\\n`\n      !undef _label\n    !endif\n    !verbose pop\n  !macroend\n\n  !macro _CaseElse\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifdef _Logic & ${_Logic}Select                       ; Check for an active Select\n      !insertmacro _Select_CaseElse\n    !else ifndef _Switch                                  ; If not then check for an active Switch\n      !error \"Cannot use Case without a preceding Select or Switch\"\n    !else ifdef ${_Switch}Else                            ; Already had a default case?\n      !error \"Cannot use CaseElse following a CaseElse\"\n    !else\n      !define ${_Switch}Else _LogicLib_Label_${LOGICLIB_COUNTER} ; Get a label for the default case,\n      !insertmacro _IncreaseCounter\n      ${${_Switch}Else}:                                  ; and place it\n    !endif\n    !verbose pop\n  !macroend\n\n  !macro _EndSwitch\n    !verbose push\n    !verbose ${LOGICLIB_VERBOSITY}\n    !ifndef _Logic | ${_Logic}Switch\n      !error \"Cannot use EndSwitch without a preceding Switch\"\n    !endif\n    Goto ${_Break}                                        ; Skip the jump table\n    ${${_Logic}Switch}:                                   ; Place the end of the switch\n    !undef ${_Logic}Switch\n    !include \"${${_Switch}Tmp}\"                           ; Include the jump table\n    !delfile \"${${_Switch}Tmp}\"                           ; and clear it up\n    !ifdef ${_Switch}Else                                 ; Was there a default case?\n      Goto ${${_Switch}Else}                              ; then go there if all else fails\n      !undef ${_Switch}Else\n    !endif\n    !undef ${_Switch}Tmp\n    !undef ${_Switch}Var\n    ${_Break}:                                            ; Place the break label\n    !insertmacro _PopScope Break\n    !insertmacro _PopScope Switch\n    !insertmacro _PopLogic\n    !verbose pop\n  !macroend\n  !define EndSwitch `!insertmacro _EndSwitch`\n\n!endif ; LOGICLIB\n!verbose 3\n!define LOGICLIB_VERBOSITY ${_LOGICLIB_VERBOSITY}\n!undef _LOGICLIB_VERBOSITY\n!verbose pop\n"
  },
  {
    "path": "setup/nsis/tools/Include/MUI.nsh",
    "content": "!include \"${NSISDIR}\\Contrib\\Modern UI\\System.nsh\""
  },
  {
    "path": "setup/nsis/tools/Include/MUI2.nsh",
    "content": "!include \"${NSISDIR}\\Contrib\\Modern UI 2\\MUI2.nsh\""
  },
  {
    "path": "setup/nsis/tools/Include/MUIEx.nsh",
    "content": "!define USE_MUIEx\n!include \"${NSISDIR}\\Contrib\\UltraModernUI\\UMUI.nsh\"\n"
  },
  {
    "path": "setup/nsis/tools/Include/Memento.nsh",
    "content": "!verbose push\n!verbose 3\n\n!include LogicLib.nsh\n!include Sections.nsh\n\n!ifndef ___MEMENTO_NSH___\n!define ___MEMENTO_NSH___\n\n#####################################\n### Memento                       ###\n#####################################\n\n/*\n\nMemento is a set of macros that allow installers to remember user selection\nacross separate runs of the installer. Currently, it can remember the state\nof sections and mark new sections as bold. In the future, it'll integrate\nInstallOptions and maybe even the Modern UI.\n\nA usage example can be found in `Examples\\Memento.nsi`.\n\n*/\n\n#####################################\n### Usage Instructions            ###\n#####################################\n\n/*\n\n1. Declare usage of Memento by including Memento.nsh at the top of the script.\n\n      !include Memento.nsh\n\n2. Define MEMENTO_REGISTRY_ROOT and MEMENTO_REGISTRY_KEY with the a registry key\n   where sections' state should be saved.\n\n      !define MEMENTO_REGISTRY_ROOT HKLM\n      !define MEMENTO_REGISTRY_KEY \\\n                Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MyProgram\n\n3. Replace Section with ${MementoSection} and SectionEnd with ${MementoSectionEnd}\n   for sections that whose state should be remembered by Memento.\n\n   For sections that should be unselected by default, use ${MementoSection}'s\n   brother - ${MementoUnselectedSection}.\n\n   Sections that don't already have an identifier must be assigned one.\n\n   Section identifiers must stay the same across different versions of the\n   installer or their state will be forgotten.\n\n4. Use ${MementoSectionDone} after the last ${MementoSection}.\n\n5. Add a call to ${MementoSectionRestore} to .onInit to restore the state\n   of all sections from the registry.\n\n      Function .onInit\n\n        ${MementoSectionRestore}\n\n      FunctionEnd\n\n6. Add a call to ${MementoSectionSave} to .onInstSuccess to save the state\n   of all sections to the registry.\n\n      Function .onInstSuccess\n\n        ${MementoSectionSave}\n\n      FunctionEnd\n\n7. Tattoo the location of the chosen registry key on your arm.\n\n*/\n\n#####################################\n### User API                      ###\n#####################################\n\n;\n; ${MementoSection}\n;\n;   Defines a section whose state is remembered by Memento.\n;\n;   Usage is similar to Section.\n;\n;     ${MementoSection} \"name\" \"some_id\"\n;\n\n!define MementoSection \"!insertmacro MementoSection\"\n\n;\n; ${MementoSectionEnd}\n;\n;   Ends a section previously opened using ${MementoSection}.\n;\n;   Usage is similar to SectionEnd.\n;\n;     ${MementoSection} \"name\" \"some_id\"\n;        # some code...\n;     ${MementoSectionEnd}\n;\n\n;\n; ${MementoUnselectedSection}\n;\n;   Defines a section whose state is remembered by Memento and is\n;   unselected by default.\n;\n;   Usage is similar to Section with the /o switch.\n;\n;     ${MementoUnselectedSection} \"name\" \"some_id\"\n;\n\n!define MementoUnselectedSection \"!insertmacro MementoUnselectedSection\"\n\n;\n; ${MementoSectionEnd}\n;\n;   Ends a section previously opened using ${MementoSection}.\n;\n;   Usage is similar to SectionEnd.\n;\n;     ${MementoSection} \"name\" \"some_id\"\n;        # some code...\n;     ${MementoSectionEnd}\n;\n\n!define MementoSectionEnd \"!insertmacro MementoSectionEnd\"\n\n;\n; ${MementoSectionDone}\n;\n;   Used after all ${MementoSection} have been set.\n;\n;     ${MementoSection} \"name1\" \"some_id1\"\n;        # some code...\n;     ${MementoSectionEnd}\n;\n;     ${MementoSection} \"name2\" \"some_id2\"\n;        # some code...\n;     ${MementoSectionEnd}\n;\n;     ${MementoSection} \"name3\" \"some_id3\"\n;        # some code...\n;     ${MementoSectionEnd}\n;\n;     ${MementoSectionDone}\n;\n\n!define MementoSectionDone \"!insertmacro MementoSectionDone\"\n\n;\n; ${MementoSectionRestore}\n;\n;   Restores the state of all Memento sections from the registry.\n;\n;   Commonly used in .onInit.\n;\n;     Function .onInit\n;\n;       ${MementoSectionRestore}\n;\n;     FunctionEnd\n;\n\n!define MementoSectionRestore \"!insertmacro MementoSectionRestore\"\n\n;\n; ${MementoSectionSave}\n;\n;   Saves the state of all Memento sections to the registry.\n;\n;   Commonly used in .onInstSuccess.\n;\n;     Function .onInstSuccess\n;\n;       ${MementoSectionSave}\n;\n;     FunctionEnd\n;\n\n!define MementoSectionSave \"!insertmacro MementoSectionSave\"\n\n;\n; MementoSection<ReadWrite><Int|Marker>\n;\n; Replaceable macros that allow custom storage methods to be used.\n;\n\n!ifmacrondef MementoSectionReadInt\n!define __MementoSectionStdRegReadWrite\n\n!macro MementoSectionReadInt outvar name\nReadRegDWord ${outvar} ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection${name}`\n!macroend\n\n!macro MementoSectionWriteInt name val\nWriteRegDWord ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection${name}` `${val}`\n!macroend\n\n!macro MementoSectionReadMarker outvar name\nReadRegStr ${outvar} ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection${name}`\n!macroend\n\n!macro MementoSectionWriteMarker name\nWriteRegStr ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection${name}` ``\n!macroend\n\n!endif\n\n#####################################\n### Internal Defines              ###\n#####################################\n\n!define __MementoSectionIndex 1\n\n#####################################\n### Internal Macros               ###\n#####################################\n\n!macro __MementoCheckSettings\n\n  !ifdef __MementoSectionStdRegReadWrite\n    !ifndef MEMENTO_REGISTRY_ROOT | MEMENTO_REGISTRY_KEY\n\n      !error \"MEMENTO_REGISTRY_ROOT and MEMENTO_REGISTRY_KEY must be defined before using any of Memento's macros\"\n\n    !endif\n  !endif\n\n!macroend\n\n!macro __MementoSection flags name id\n\n  !insertmacro __MementoCheckSettings\n\n  !ifndef __MementoSectionIndex\n\n    !error \"MementoSectionDone already used!\"\n\n  !endif\n\n  !define __MementoSectionLastSectionId `${id}`\n\n  !verbose pop\n\n  Section ${flags} `${name}` `${id}`\n\n  !verbose push\n  !verbose 3\n\n!macroend\n\n#####################################\n### User Macros                   ###\n#####################################\n\n!macro MementoSection name id\n\n  !verbose push\n  !verbose 3\n\n  !insertmacro __MementoSection \"\" `${name}` `${id}`\n\n  !verbose pop\n\n!macroend\n\n!macro MementoUnselectedSection name id\n\n  !verbose push\n  !verbose 3\n\n  !insertmacro __MementoSection /o `${name}` `${id}`\n\n  !define __MementoSectionUnselected\n\n  !verbose pop\n\n!macroend\n\n!macro MementoSectionEnd\n\n  SectionEnd\n\n  !verbose push\n  !verbose 3\n\n  !insertmacro __MementoCheckSettings\n\n  !ifndef __MementoSectionIndex\n\n    !error \"MementoSectionDone already used!\"\n\n  !endif\n\n  !define /MATH __MementoSectionIndexNext \\\n      ${__MementoSectionIndex} + 1\n\n  Function __MementoSectionMarkNew${__MementoSectionIndex}\n\n    ClearErrors\n    !insertmacro MementoSectionReadInt $0 `_${__MementoSectionLastSectionId}`\n\n    ${If} ${Errors}\n\n      !insertmacro SetSectionFlag `${${__MementoSectionLastSectionId}}` ${SF_BOLD}\n\n    ${EndIf}\n\n    GetFunctionAddress $0 __MementoSectionMarkNew${__MementoSectionIndexNext}\n    Goto $0\n\n  FunctionEnd\n\n  Function __MementoSectionRestoreStatus${__MementoSectionIndex}\n\n    ClearErrors\n    !insertmacro MementoSectionReadInt $0 `_${__MementoSectionLastSectionId}`\n\n    !ifndef __MementoSectionUnselected\n\n      ${If} ${Errors}\n      ${OrIf} $0 != 0\n\n        !insertmacro SelectSection `${${__MementoSectionLastSectionId}}`\n\n      ${Else}\n\n        !insertmacro UnselectSection `${${__MementoSectionLastSectionId}}`\n\n      ${EndIf}\n\n    !else\n\n      !undef __MementoSectionUnselected\n\n      ${If} ${Errors}\n      ${OrIf} $0 == 0\n\n        !insertmacro UnselectSection `${${__MementoSectionLastSectionId}}`\n\n      ${Else}\n\n        !insertmacro SelectSection `${${__MementoSectionLastSectionId}}`\n\n      ${EndIf}\n\n    !endif\n\n    GetFunctionAddress $0 __MementoSectionRestoreStatus${__MementoSectionIndexNext}\n    Goto $0\n\n  FunctionEnd\n\n  Function __MementoSectionSaveStatus${__MementoSectionIndex}\n\n    ${If} ${SectionIsSelected} `${${__MementoSectionLastSectionId}}`\n\n      !insertmacro MementoSectionWriteInt `_${__MementoSectionLastSectionId}` 1\n\n    ${Else}\n\n      !insertmacro MementoSectionWriteInt `_${__MementoSectionLastSectionId}` 0\n\n    ${EndIf}\n\n    GetFunctionAddress $0 __MementoSectionSaveStatus${__MementoSectionIndexNext}\n    Goto $0\n\n  FunctionEnd\n\n  !undef __MementoSectionIndex\n  !define __MementoSectionIndex ${__MementoSectionIndexNext}\n  !undef __MementoSectionIndexNext\n\n  !undef __MementoSectionLastSectionId\n\n  !verbose pop\n\n!macroend\n\n!macro MementoSectionDone\n\n  !verbose push\n  !verbose 3\n\n  !insertmacro __MementoCheckSettings\n\n  Function __MementoSectionMarkNew${__MementoSectionIndex}\n  FunctionEnd\n\n  Function __MementoSectionRestoreStatus${__MementoSectionIndex}\n  FunctionEnd\n\n  Function __MementoSectionSaveStatus${__MementoSectionIndex}\n  FunctionEnd\n\n  !undef __MementoSectionIndex\n\n  !verbose pop\n\n!macroend\n\n!macro MementoSectionRestore\n\n  !verbose push\n  !verbose 3\n\n  !insertmacro __MementoCheckSettings\n\n  Push $0\n  Push $1\n  Push $2\n  Push $3\n\n    # check for first usage\n\n    ClearErrors\n    !insertmacro MementoSectionReadMarker $0 `Used`\n\n    ${If} ${Errors}\n\n      # use script defaults on first run\n      Goto done\n\n    ${EndIf}\n\n    # mark new components in bold\n    \n    Call __MementoSectionMarkNew1\n\n    # mark section groups in bold\n\n    StrCpy $0 0\n    StrCpy $1 \"\"\n    StrCpy $2 \"\"\n    StrCpy $3 \"\"\n\n    loop:\n\n      ClearErrors\n\n      ${If} ${SectionIsBold} $0\n\n        ${If} $1 != \"\"\n\n          !insertmacro SetSectionFlag $1 ${SF_BOLD}\n\n        ${EndIf}\n\n        ${If} $2 != \"\"\n\n          !insertmacro SetSectionFlag $2 ${SF_BOLD}\n\n        ${EndIf}\n\n        ${If} $3 != \"\"\n\n          !insertmacro SetSectionFlag $3 ${SF_BOLD}\n\n        ${EndIf}\n\n      ${ElseIf} ${Errors}\n\n        Goto loop_end\n\n      ${EndIf}\n\n      ${If} ${SectionIsSectionGroup} $0\n\n        ${If} $1 == \"\"\n\n          StrCpy $1 $0\n\n        ${ElseIf} $2 == \"\"\n\n          StrCpy $2 $0\n\n        ${ElseIf} $3 == \"\"\n\n          StrCpy $3 $0\n\n        ${EndIf}\n\n      ${EndIf}\n\n      ${If} ${SectionIsSectionGroupEnd} $0\n\n        ${If} $3 != \"\"\n\n          StrCpy $3 \"\"\n\n        ${ElseIf} $2 != \"\"\n\n          StrCpy $2 \"\"\n\n        ${ElseIf} $1 != \"\"\n\n          StrCpy $1 \"\"\n\n        ${EndIf}\n\n      ${EndIf}\n\n      IntOp $0 $0 + 1\n\n    Goto loop\n    loop_end:\n\n    # restore sections' status\n\n    Call __MementoSectionRestoreStatus1\n\n  # all done\n\n  done:\n\n  Pop $3\n  Pop $2\n  Pop $1\n  Pop $0\n\n  !verbose pop\n\n!macroend\n\n!macro MementoSectionSave\n\n  !verbose push\n  !verbose 3\n\n  !insertmacro __MementoCheckSettings\n\n  Push $0\n\n    !insertmacro MementoSectionWriteMarker `Used`\n  \n    Call __MementoSectionSaveStatus1\n\n  Pop $0\n\n  !verbose pop\n\n!macroend\n\n\n\n!endif # ___MEMENTO_NSH___\n\n!verbose pop\n"
  },
  {
    "path": "setup/nsis/tools/Include/ModernXL.nsh",
    "content": "\n!ifdef MUI_INCLUDED\n!error '\"ModernXL.nsh\" must be included before \"MUI2.nsh\"'\n!endif\n\n!define /ifndef MUI_WELCOMEFINISHPAGE_BITMAP\t\t\"${NSISDIR}\\Contrib\\Graphics\\Wizard\\modern-xl-install.bmp\"\n!define /ifndef MUI_UNWELCOMEFINISHPAGE_BITMAP\t\t\"${NSISDIR}\\Contrib\\Graphics\\Wizard\\modern-xl-uninstall.bmp\"\n\n;!define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH\t\tNoStretchNoCrop\n;!define MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH\t\tNoStretchNoCrop\n\n!define /ifndef MUI_UI\t\t\t\t\t\t\t\t\"${NSISDIR}\\Contrib\\UIs\\xl.exe\"\n!define /ifndef MUI_UI_HEADERIMAGE\t\t\t\t\t\"${NSISDIR}\\Contrib\\UIs\\xl_headerbmp.exe\"\n!define /ifndef MUI_UI_HEADERIMAGE_RIGHT\t\t\t\"${NSISDIR}\\Contrib\\UIs\\xl_headerbmpr.exe\"\n\n!define /ifndef MUI_UI_COMPONENTSPAGE_SMALLDESC \t\"${NSISDIR}\\Contrib\\UIs\\xl_smalldesc.exe\"\n!define /ifndef MUI_UI_COMPONENTSPAGE_NODESC\t\t\"${NSISDIR}\\Contrib\\UIs\\xl_nodesc.exe\"\n"
  },
  {
    "path": "setup/nsis/tools/Include/ModernXXL.nsh",
    "content": "\n!ifdef MUI_INCLUDED\n!error '\"ModernXXL.nsh\" must be included before \"MUI2.nsh\"'\n!endif\n\n!define /ifndef MUI_WELCOMEFINISHPAGE_BITMAP\t\t\"${NSISDIR}\\Contrib\\Graphics\\Wizard\\modern-xxl-install.bmp\"\n!define /ifndef MUI_UNWELCOMEFINISHPAGE_BITMAP\t\t\"${NSISDIR}\\Contrib\\Graphics\\Wizard\\modern-xxl-uninstall.bmp\"\n\n;!define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH\t\tNoStretchNoCrop\n;!define MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH\t\tNoStretchNoCrop\n\n!define /ifndef MUI_UI\t\t\t\t\t\t\t\t\"${NSISDIR}\\Contrib\\UIs\\xxl.exe\"\n!define /ifndef MUI_UI_HEADERIMAGE\t\t\t\t\t\"${NSISDIR}\\Contrib\\UIs\\xxl_headerbmp.exe\"\n!define /ifndef MUI_UI_HEADERIMAGE_RIGHT\t\t\t\"${NSISDIR}\\Contrib\\UIs\\xxl_headerbmpr.exe\"\n\n!define /ifndef MUI_UI_COMPONENTSPAGE_SMALLDESC \t\"${NSISDIR}\\Contrib\\UIs\\xxl_smalldesc.exe\"\n!define /ifndef MUI_UI_COMPONENTSPAGE_NODESC\t\t\"${NSISDIR}\\Contrib\\UIs\\xxl_nodesc.exe\"\n"
  },
  {
    "path": "setup/nsis/tools/Include/MultiUser.nsh",
    "content": "/*\n\nMultiUser.nsh\n\nInstaller configuration for multi-user Windows environments\n\nCopyright 2008-2022 Joost Verburg\n\n*/\n\n!ifndef MULTIUSER_INCLUDED\n!define MULTIUSER_INCLUDED 20210216\n!verbose push 3\n\n;Standard NSIS header files\n\n!ifdef MULTIUSER_MUI\n  !include MUI2.nsh\n!endif\n!include LogicLib.nsh\n!include WinVer.nsh\n!include FileFunc.nsh\n\n!if ${NSIS_PTR_SIZE} > 4\n!define /IfNDef MULTIUSER_MINWIN 0x501\n!else\n!define /IfNDef MULTIUSER_MINWIN 0x400\n!endif\n\n;Variables\n\nVar MultiUser.Privileges\nVar MultiUser.InstallMode\n\n;Command line installation mode setting\n\n!ifdef MULTIUSER_INSTALLMODE_COMMANDLINE\n  !include StrFunc.nsh\n  ${Using:StrFunc} StrStr\n  !ifndef MULTIUSER_NOUNINSTALL\n    ${Using:StrFunc} UnStrStr\n  !endif\n\n  Var MultiUser.Parameters\n  Var MultiUser.Result\n!endif\n\n;Installation folder stored in registry\n\n!ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME\n  Var MultiUser.InstDir\n!endif\n\n!ifdef MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY & MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME\n  Var MultiUser.DefaultKeyValue\n!endif\n\n;Windows Vista UAC setting\n\n!if \"${MULTIUSER_EXECUTIONLEVEL}\" == Admin\n  RequestExecutionLevel admin\n  !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS\n!else if \"${MULTIUSER_EXECUTIONLEVEL}\" == Power\n  RequestExecutionLevel admin\n  !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS\n!else if \"${MULTIUSER_EXECUTIONLEVEL}\" == Highest\n  RequestExecutionLevel highest\n  !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS\n!else\n  RequestExecutionLevel user\n  !ifndef MULTIUSER_EXECUTIONLEVEL\n    !warning \"MULTIUSER_EXECUTIONLEVEL not set!\"\n  !endif\n!endif\n\n/*\n\nInstall modes\n\n*/\n\n!macro MULTIUSER_INSTALLMODE_ALLUSERS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX\n\n  ;Install mode initialization - per-machine\n\n  ${ifnot} ${IsNT}\n  ${orif} $MultiUser.Privileges == \"Admin\"\n  ${orif} $MultiUser.Privileges == \"Power\"\n\n    StrCpy $MultiUser.InstallMode AllUsers\n  \n    SetShellVarContext all\n  \n    !if \"${UNINSTALLER_PREFIX}\" != UN\n      ;Set default installation location for installer\n      !ifdef MULTIUSER_INSTALLMODE_INSTDIR\n        !ifdef MULTIUSER_USE_PROGRAMFILES64\n          StrCpy $INSTDIR \"$PROGRAMFILES64\\${MULTIUSER_INSTALLMODE_INSTDIR}\"\n        !else\n          StrCpy $INSTDIR \"$PROGRAMFILES\\${MULTIUSER_INSTALLMODE_INSTDIR}\"\n        !endif\n      !endif\n    !endif\n  \n    !ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME\n\n      ReadRegStr $MultiUser.InstDir HKLM \"${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY}\" \"${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME}\"\n  \n      ${if} $MultiUser.InstDir != \"\"\n        StrCpy $INSTDIR $MultiUser.InstDir\n      ${endif}\n\n    !endif\n\n    !ifdef MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION\n      Call \"${MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION}\"\n    !endif\n\n  ${endif}\n\n!macroend\n\n!macro MULTIUSER_INSTALLMODE_CURRENTUSER UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX\n\n  ;Install mode initialization - per-user\n\n  !if ${MULTIUSER_MINWIN} < 0x500\n  ${if} ${IsNT}\n  !endif\n\n    StrCpy $MultiUser.InstallMode CurrentUser\n    SetShellVarContext current\n\n    !if \"${UNINSTALLER_PREFIX}\" != UN\n      ;Set default installation location for installer\n      !ifdef MULTIUSER_INSTALLMODE_INSTDIR\n        !if ${MULTIUSER_MINWIN} < 0x490\n        ${if} ${AtLeastWin2000}\n        !endif\n          GetKnownFolderPath $INSTDIR {5CD7AEE2-2219-4A67-B85D-6C9CE15660CB} ; FOLDERID_UserProgramFiles\n          StrCmp $INSTDIR \"\" 0 +2\n          StrCpy $INSTDIR \"$LocalAppData\\Programs\" ; Fallback directory\n          StrCpy $INSTDIR \"$INSTDIR\\${MULTIUSER_INSTALLMODE_INSTDIR}\"\n        !if ${MULTIUSER_MINWIN} < 0x490\n        ${else}\n          StrCpy $INSTDIR \"$PROGRAMFILES\\${MULTIUSER_INSTALLMODE_INSTDIR}\"\n        ${endif}\n        !endif\n      !endif\n    !endif\n\n    !ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME\n      ReadRegStr $MultiUser.InstDir HKCU \"${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY}\" \"${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME}\"\n      ${if} $MultiUser.InstDir != \"\"\n        StrCpy $INSTDIR $MultiUser.InstDir\n      ${endif}\n    !endif\n\n    !ifdef MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION\n      Call \"${MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION}\"\n    !endif\n\n  !if ${MULTIUSER_MINWIN} < 0x500\n  ${endif}\n  !endif\n\n!macroend\n\nFunction MultiUser.InstallMode.AllUsers\n  !insertmacro MULTIUSER_INSTALLMODE_ALLUSERS \"\" \"\"\nFunctionEnd\n\nFunction MultiUser.InstallMode.CurrentUser\n  !insertmacro MULTIUSER_INSTALLMODE_CURRENTUSER \"\" \"\"\nFunctionEnd\n\n!ifndef MULTIUSER_NOUNINSTALL\n\nFunction un.MultiUser.InstallMode.AllUsers\n  !insertmacro MULTIUSER_INSTALLMODE_ALLUSERS UN .un\nFunctionEnd\n\nFunction un.MultiUser.InstallMode.CurrentUser\n  !insertmacro MULTIUSER_INSTALLMODE_CURRENTUSER UN .un\nFunctionEnd\n\n!endif\n\n/*\n\nInstaller/uninstaller initialization\n\n*/\n\n!macro MULTIUSER_INIT_QUIT UNINSTALLER_FUNCPREFIX\n\n  !ifdef MULTIUSER_INIT_${UNINSTALLER_FUNCPREFIX}FUNCTIONQUIT\n    Call \"${MULTIUSER_INIT_${UNINSTALLER_FUNCPREFIX}FUNCTIONQUIT}\"\n  !else\n    Quit\n  !endif\n\n!macroend\n\n!macro MULTIUSER_INIT_TEXTS UNINSTALLER_PREFIX\n\n  !if \"${UNINSTALLER_PREFIX}\" == \"\"\n    !define /ReDef MULTIUSER_TMPSTR_CAPTION \"$(^SetupCaption)\"\n  !else\n    !define /ReDef MULTIUSER_TMPSTR_CAPTION \"$(^Name)\"\n  !endif\n\n  !define /IfNDef MULTIUSER_INIT_TEXT_ADMINREQUIRED \"${MULTIUSER_TMPSTR_CAPTION} requires administrator privileges.\"\n  !define /IfNDef MULTIUSER_INIT_TEXT_POWERREQUIRED \"${MULTIUSER_TMPSTR_CAPTION} requires at least Power User privileges.\"\n  !define /IfNDef MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE \"Your user account does not have sufficient privileges to install $(^Name) for all users of this computer.\"\n\n  !undef MULTIUSER_TMPSTR_CAPTION\n\n!macroend\n\n!macro MULTIUSER_INIT_CHECKS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX\n\n  ;Installer initialization - check privileges and set install mode\n\n  !insertmacro MULTIUSER_INIT_TEXTS \"${UNINSTALLER_PREFIX}\"\n\n  UserInfo::GetAccountType\n  Pop $MultiUser.Privileges\n\n  !if ${MULTIUSER_MINWIN} < 0x500\n  ${if} ${IsNT}\n  !endif\n\n    ;Check privileges\n\n    !if \"${MULTIUSER_EXECUTIONLEVEL}\" == Admin\n\n      ${if} $MultiUser.Privileges != \"Admin\"\n        MessageBox MB_OK|MB_ICONSTOP \"${MULTIUSER_INIT_TEXT_ADMINREQUIRED}\"\n        !insertmacro MULTIUSER_INIT_QUIT \"${UNINSTALLER_FUNCPREFIX}\"\n      ${endif}\n\n    !else if \"${MULTIUSER_EXECUTIONLEVEL}\" == Power\n\n      ${if} $MultiUser.Privileges != \"Power\"\n      ${andif} $MultiUser.Privileges != \"Admin\"\n        ${if} ${AtMostWinXP}\n           MessageBox MB_OK|MB_ICONSTOP \"${MULTIUSER_INIT_TEXT_POWERREQUIRED}\"\n        ${else}\n           MessageBox MB_OK|MB_ICONSTOP \"${MULTIUSER_INIT_TEXT_ADMINREQUIRED}\"\n        ${endif}        \n        !insertmacro MULTIUSER_INIT_QUIT \"${UNINSTALLER_FUNCPREFIX}\"\n      ${endif}\n\n    !endif\n\n    !ifdef MULTIUSER_EXECUTIONLEVEL_ALLUSERS\n\n      ;Default to per-machine installation if possible\n\n      ${if} $MultiUser.Privileges == \"Admin\"\n      ${orif} $MultiUser.Privileges == \"Power\"\n        !ifndef MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER\n          Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers\n        !else\n          Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser\n        !endif\n\n        !ifdef MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY & MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME\n\n          ;Set installation mode to setting from a previous installation\n\n          !ifndef MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER\n            ReadRegStr $MultiUser.DefaultKeyValue HKLM \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}\" \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}\"\n            ${if} $MultiUser.DefaultKeyValue == \"\"\n              ReadRegStr $MultiUser.DefaultKeyValue HKCU \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}\" \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}\"\n              ${if} $MultiUser.DefaultKeyValue != \"\"\n                Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser\n              ${endif}\n            ${endif}\n          !else\n            ReadRegStr $MultiUser.DefaultKeyValue HKCU \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}\" \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}\"\n            ${if} $MultiUser.DefaultKeyValue == \"\"\n              ReadRegStr $MultiUser.DefaultKeyValue HKLM \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY}\" \"${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME}\"\n              ${if} $MultiUser.DefaultKeyValue != \"\"\n                Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers\n              ${endif}\n            ${endif}\n          !endif\n\n        !endif\n\n      ${else}\n        Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser\n      ${endif}\n\n    !else\n\n      Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser\n\n    !endif\n\n    !ifdef MULTIUSER_INSTALLMODE_COMMANDLINE\n\n      ;Check for install mode setting on command line\n\n      ${${UNINSTALLER_FUNCPREFIX}GetParameters} $MultiUser.Parameters\n\n      ${${UNINSTALLER_PREFIX}StrStr} $MultiUser.Result $MultiUser.Parameters \"/CurrentUser\"\n\n      ${if} $MultiUser.Result != \"\"\n        Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser\n      ${endif}\n\n      ${${UNINSTALLER_PREFIX}StrStr} $MultiUser.Result $MultiUser.Parameters \"/AllUsers\"\n\n      ${if} $MultiUser.Result != \"\"\n        ${if} $MultiUser.Privileges == \"Admin\"\n        ${orif} $MultiUser.Privileges == \"Power\"\n          Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers\n        ${else}\n          MessageBox MB_OK|MB_ICONSTOP \"${MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE}\"\n          !insertmacro MULTIUSER_INIT_QUIT \"${UNINSTALLER_FUNCPREFIX}\"\n        ${endif}\n      ${endif}\n\n    !endif\n\n  !if ${MULTIUSER_MINWIN} < 0x500\n  ${else}\n\n    ;Not running Windows NT, per-user installation not supported\n    Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers\n\n  ${endif}\n  !endif\n\n!macroend\n\n!macro MULTIUSER_INIT\n  !verbose push 3\n  !ifdef __UNINSTALL__\n    !insertmacro MULTIUSER_UNINIT\n  !else\n    !insertmacro MULTIUSER_INIT_CHECKS \"\" \"\"\n  !endif\n  !verbose pop\n!macroend\n\n!ifndef MULTIUSER_NOUNINSTALL\n!macro MULTIUSER_UNINIT\n  !verbose push 3\n  !insertmacro MULTIUSER_INIT_CHECKS Un un.\n  !verbose pop\n!macroend\n!endif\n\n/*\n\nMode selection page\n\n*/\n\n!macro MULTIUSER_PAGE_FUNCTION_CUSTOM TYPE\n  !ifmacrodef MUI_PAGE_FUNCTION_CUSTOM\n    !insertmacro MUI_PAGE_FUNCTION_CUSTOM \"${TYPE}\"\n  !endif\n  !ifdef MULTIUSER_PAGE_CUSTOMFUNCTION_${TYPE}\n    Call \"${MULTIUSER_PAGE_CUSTOMFUNCTION_${TYPE}}\"\n    !undef MULTIUSER_PAGE_CUSTOMFUNCTION_${TYPE}\n  !endif\n!macroend\n\n!macro MULTIUSER_INSTALLMODEPAGE_INTERFACE\n\n  !ifndef MULTIUSER_INSTALLMODEPAGE_INTERFACE\n    !define MULTIUSER_INSTALLMODEPAGE_INTERFACE\n    Var MultiUser.InstallModePage\n\n    Var MultiUser.InstallModePage.Text\n\n    Var MultiUser.InstallModePage.AllUsers\n    Var MultiUser.InstallModePage.CurrentUser\n\n  !endif\n\n!macroend\n\n!macro MULTIUSER_PAGEDECLARATION_INSTALLMODE UNPREFIX UNIQUEID\n\n  !define /ReDef MULTIUSER_${UNPREFIX}INSTALLMODEPAGE \"\" ; Unlock strings in the language file(s)\n  !insertmacro MULTIUSER_INSTALLMODEPAGE_INTERFACE\n\n  !define /IfNDef MULTIUSER_INSTALLMODEPAGE_TEXT_TOP \"$(MULTIUSER_INNERTEXT_INSTALLMODE_TOP)\"\n  !define /IfNDef MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS \"$(MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS)\"\n  !define /IfNDef MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER \"$(MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER)\"\n\n  PageEx custom\n\n    PageCallbacks MultiUser.InstallModePre_${UNIQUEID} MultiUser.InstallModeLeave_${UNIQUEID}\n\n    !define /IfNDef MULTIUSER_INSTALLMODEPAGE_CAPTION \" \"\n    Caption \"${MULTIUSER_INSTALLMODEPAGE_CAPTION}\"\n\n  PageExEnd\n\n  !insertmacro MULTIUSER_FUNCTION_INSTALLMODEPAGE MultiUser.InstallModePre_${UNIQUEID} MultiUser.InstallModeLeave_${UNIQUEID}\n\n  !undef MULTIUSER_INSTALLMODEPAGE_TEXT_TOP\n  !undef MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS\n  !undef MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER\n\n!macroend\n\n!macro MULTIUSER_PAGE_INSTALLMODE\n\n  !verbose push 3\n\n  !ifndef MULTIUSER_EXECUTIONLEVEL_ALLUSERS\n    !error \"A mixed-mode installation requires MULTIUSER_EXECUTIONLEVEL to be set to Admin, Power or Highest.\"\n  !endif\n\n  !ifmacrodef MUI_PAGE_INIT\n    !insertmacro MUI_PAGE_INIT\n  !endif\n  !insertmacro MULTIUSER_PAGEDECLARATION_INSTALLMODE \"\" ${__COUNTER__}\n\n  !verbose pop\n\n!macroend\n\n!macro MULTIUSER_FUNCTION_INSTALLMODEPAGE PRE LEAVE\n\n  !include nsDialogs.nsh\n\n  Function \"${PRE}\"\n\n    !if ${MULTIUSER_MINWIN} < 0x500\n    ${ifnot} ${IsNT}\n      Abort\n    ${endif}\n    !endif\n\n    ${if} $MultiUser.Privileges != \"Power\"\n    ${andif} $MultiUser.Privileges != \"Admin\"\n      Abort\n    ${endif}\n\n    !insertmacro MULTIUSER_PAGE_FUNCTION_CUSTOM PRE\n    !ifmacrodef MUI_HEADER_TEXT_PAGE\n      !insertmacro MUI_HEADER_TEXT_PAGE $(MULTIUSER_TEXT_INSTALLMODE_TITLE) $(MULTIUSER_TEXT_INSTALLMODE_SUBTITLE)\n    !endif\n\n    nsDialogs::Create 1018\n    Pop $MultiUser.InstallModePage\n\n    ${NSD_CreateLabel} 0 2u 100% 42u \"${MULTIUSER_INSTALLMODEPAGE_TEXT_TOP}\"\n    Pop $MultiUser.InstallModePage.Text\n\n    ${NSD_CreateRadioButton} 15u 50u -15u 10u \"${MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS}\"\n    Pop $MultiUser.InstallModePage.AllUsers\n\n    !ifdef MULTIUSER_INSTALLMODEPAGE_SHOWUSERNAME\n    !ifdef NOSYSTEMCALLS\n    ReadEnvStr $0 USERNAME\n    !else\n    System::Call 'ADVAPI32::GetUserName(t\"\"r0,*i${NSIS_MAX_STRLEN})'\n    !endif\n    StrCmp $0 \"\" +2\n      StrCpy $0 \" ($0)\"\n    ${NSD_CreateRadioButton} 15u 70u -15u 10u \"${MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER}$0\"\n    !else\n    ${NSD_CreateRadioButton} 15u 70u -15u 10u \"${MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER}\"\n    !endif\n    Pop $MultiUser.InstallModePage.CurrentUser\n\n    ${if} $MultiUser.InstallMode == \"AllUsers\"\n      SendMessage $MultiUser.InstallModePage.AllUsers ${BM_SETCHECK} ${BST_CHECKED} 0\n    ${else}\n      SendMessage $MultiUser.InstallModePage.CurrentUser ${BM_SETCHECK} ${BST_CHECKED} 0\n    ${endif}\n\n    !insertmacro MULTIUSER_PAGE_FUNCTION_CUSTOM SHOW\n    nsDialogs::Show\n    !insertmacro MULTIUSER_PAGE_FUNCTION_CUSTOM DESTROYED\n\n  FunctionEnd\n\n  Function \"${LEAVE}\"\n     SendMessage $MultiUser.InstallModePage.AllUsers ${BM_GETCHECK} 0 0 $0\n\n     ${if} $0 = ${BST_CHECKED}\n        Call MultiUser.InstallMode.AllUsers\n     ${else}\n        Call MultiUser.InstallMode.CurrentUser\n     ${endif}\n\n    !insertmacro MULTIUSER_PAGE_FUNCTION_CUSTOM LEAVE\n  FunctionEnd\n\n!macroend\n\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/Sections.nsh",
    "content": "; Sections.nsh\n;\n; Defines and macros for section control\n;\n; Include in your script using:\n; !include \"Sections.nsh\"\n\n;--------------------------------\n\n!ifndef SECTIONS_INCLUDED\n\n!define SECTIONS_INCLUDED\n\n;--------------------------------\n\n; Generic section defines\n\n# section or section group is selected\n!define SF_SELECTED   1\n# section group\n!define SF_SECGRP     2\n!define SF_SUBSEC     2  # deprecated\n# section group end marker\n!define SF_SECGRPEND  4\n!define SF_SUBSECEND  4  # deprecated\n# bold text (Section !blah)\n!define SF_BOLD       8\n# read only (SectionIn RO)\n!define SF_RO         16\n# expanded section group (SectionGroup /e blah)\n!define SF_EXPAND     32\n# section group is partially selected\n!define SF_PSELECTED  64  # internal\n# internal\n!define SF_TOGGLED    128 # internal\n!define SF_NAMECHG    256 # internal\n\n# mask to toggle off the selected flag\n!define SECTION_OFF   0xFFFFFFFE\n\n;--------------------------------\n\n; Select / unselect / reserve section\n\n!macro SelectSection SECTION\n\n  Push $0\n  Push $1\n    StrCpy $1 \"${SECTION}\"\n    SectionGetFlags $1 $0\n    IntOp $0 $0 | ${SF_SELECTED}\n    SectionSetFlags $1 $0\n  Pop $1\n  Pop $0\n\n!macroend\n\n!macro UnselectSection SECTION\n\n  Push $0\n  Push $1\n    StrCpy $1 \"${SECTION}\"\n    SectionGetFlags $1 $0\n    IntOp $0 $0 & ${SECTION_OFF}\n    SectionSetFlags $1 $0\n  Pop $1\n  Pop $0\n\n!macroend\n\n; If section selected, will unselect, if unselected, will select\n\n!macro ReverseSection SECTION\n\n  Push $0\n  Push $1\n    StrCpy $1 \"${SECTION}\"\n    SectionGetFlags $1 $0\n    IntOp $0 $0 ^ ${SF_SELECTED}\n    SectionSetFlags $1 $0\n  Pop $1\n  Pop $0\n\n!macroend\n\n;--------------------------------\n\n; Macros for mutually exclusive section selection\n; Written by Tim Gallagher\n;\n; See one-section.nsi for an example of usage\n\n; Starts the Radio Button Block\n; You should pass a variable that keeps the selected section\n; as the first parameter for this macro. This variable should\n; be initialized to the default section's index.\n;\n; As this macro uses $R0 and $R1 you can't use those two as the\n; variable which will keep the selected section.\n\n!macro StartRadioButtons var\n\n  !define StartRadioButtons_Var \"${var}\"\n\n  Push $R0\n  \n   SectionGetFlags \"${StartRadioButtons_Var}\" $R0\n   IntOp $R0 $R0 & ${SECTION_OFF}\n   SectionSetFlags \"${StartRadioButtons_Var}\" $R0\n   \n  Push $R1\n  \n    StrCpy $R1 \"${StartRadioButtons_Var}\"\n   \n!macroend\n\n; A radio button\n\n!macro RadioButton SECTION_NAME\n\n  SectionGetFlags ${SECTION_NAME} $R0\n  IntOp $R0 $R0 & ${SF_SELECTED}\n  IntCmp $R0 ${SF_SELECTED} 0 +2 +2\n  StrCpy \"${StartRadioButtons_Var}\" ${SECTION_NAME}\n\n!macroend\n\n; Ends the radio button block\n\n!macro EndRadioButtons\n  \n  StrCmp $R1 \"${StartRadioButtons_Var}\" 0 +4 ; selection hasn't changed\n    SectionGetFlags \"${StartRadioButtons_Var}\" $R0\n    IntOp $R0 $R0 | ${SF_SELECTED}\n    SectionSetFlags \"${StartRadioButtons_Var}\" $R0\n\n  Pop $R1\n  Pop $R0\n  \n  !undef StartRadioButtons_Var\n\n!macroend\n\n;--------------------------------\n\n; These are two macros you can use to set a Section in an InstType\n; or clear it from an InstType.\n;\n; Written by Robert Kehl\n;\n; For details, see https://nsis.sourceforge.io/wiki/SetSectionInInstType%2C_ClearSectionInInstType\n;\n; Use the defines below for the WANTED_INSTTYPE parameter.\n\n!define INSTTYPE_1 1\n!define INSTTYPE_2 2\n!define INSTTYPE_3 4\n!define INSTTYPE_4 8\n!define INSTTYPE_5 16\n!define INSTTYPE_6 32\n!define INSTTYPE_7 64\n!define INSTTYPE_8 128\n!define INSTTYPE_9 256\n!define INSTTYPE_10 512\n!define INSTTYPE_11 1024\n!define INSTTYPE_12 2048\n!define INSTTYPE_13 4096\n!define INSTTYPE_14 8192\n!define INSTTYPE_15 16384\n!define INSTTYPE_16 32768\n!define INSTTYPE_17 65536\n!define INSTTYPE_18 131072\n!define INSTTYPE_19 262144\n!define INSTTYPE_20 524288\n!define INSTTYPE_21 1048576\n!define INSTTYPE_22 2097152\n!define INSTTYPE_23 4194304\n!define INSTTYPE_24 8388608\n!define INSTTYPE_25 16777216\n!define INSTTYPE_26 33554432\n!define INSTTYPE_27 67108864\n!define INSTTYPE_28 134217728\n!define INSTTYPE_29 268435456\n!define INSTTYPE_30 536870912\n!define INSTTYPE_31 1073741824\n!define INSTTYPE_32 2147483648\n\n!macro SetSectionInInstType SECTION_NAME WANTED_INSTTYPE\n\n  Push $0\n  Push $1\n    StrCpy $1 \"${SECTION_NAME}\"\n    SectionGetInstTypes $1 $0\n    IntOp $0 $0 | ${WANTED_INSTTYPE}\n    SectionSetInstTypes $1 $0\n  Pop $1\n  Pop $0\n\n!macroend\n\n!macro ClearSectionInInstType SECTION_NAME WANTED_INSTTYPE\n\n  Push $0\n  Push $1\n  Push $2\n    StrCpy $2 \"${SECTION_NAME}\"\n    SectionGetInstTypes $2 $0\n    StrCpy $1 ${WANTED_INSTTYPE}\n    IntOp $1 $1 ~\n    IntOp $0 $0 & $1\n    SectionSetInstTypes $2 $0\n  Pop $2\n  Pop $1\n  Pop $0\n\n!macroend\n\n;--------------------------------\n\n; Set / clear / check bits in a section's flags\n; Written by derekrprice\n\n; Set one or more bits in a sections's flags\n\n!macro SetSectionFlag SECTION BITS\n\n  Push $R0\n  Push $R1\n    StrCpy $R1 \"${SECTION}\"\n    SectionGetFlags $R1 $R0\n    IntOp $R0 $R0 | \"${BITS}\"\n    SectionSetFlags $R1 $R0\n  Pop $R1\n  Pop $R0\n \n!macroend\n\n; Clear one or more bits in section's flags\n\n!macro ClearSectionFlag SECTION BITS\n\n  Push $R0\n  Push $R1\n  Push $R2\n    StrCpy $R2 \"${SECTION}\"\n    SectionGetFlags $R2 $R0\n    IntOp $R1 \"${BITS}\" ~\n    IntOp $R0 $R0 & $R1\n    SectionSetFlags $R2 $R0\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n!macroend\n\n; Check if one or more bits in section's flags are set\n; If they are, jump to JUMPIFSET\n; If not, jump to JUMPIFNOTSET\n\n!macro SectionFlagIsSet SECTION BITS JUMPIFSET JUMPIFNOTSET\n\tPush $R0\n\tSectionGetFlags \"${SECTION}\" $R0\n\tIntOp $R0 $R0 & \"${BITS}\"\n\tIntCmp $R0 \"${BITS}\" +3\n\tPop $R0\n\tStrCmp \"\" \"${JUMPIFNOTSET}\" +3 \"${JUMPIFNOTSET}\"\n\tPop $R0\n\tGoto \"${JUMPIFSET}\"\n!macroend\n\n;--------------------------------\n\n; Removes a section by unselecting and hiding it\n\n!macro RemoveSection SECTION\n\n  Push $R0\n  Push $R1\n    StrCpy $R1 `${SECTION}`\n    SectionGetFlags $R1 $R0\n    IntOp $R0 $R0 & ${SECTION_OFF}\n    SectionSetFlags $R1 $R0\n    SectionSetText $R1 ``\n  Pop $R1\n  Pop $R0\n\n!macroend\n\n; Undoes the RemoveSection action\n\n!macro UnremoveSection SECTION SECTION_TEXT\n\n  Push $R0\n  Push $R1\n  Push $R2\n    StrCpy $R1 `${SECTION}`\n    StrCpy $R2 `${SECTION_TEXT}`\n    SectionGetFlags $R1 $R0\n    IntOp $R0 $R0 | ${SF_SELECTED}\n    SectionSetFlags $R1 $R0\n    SectionSetText $R1 $R2\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n!macroend\n\n;--------------------------------\n\n!endif"
  },
  {
    "path": "setup/nsis/tools/Include/StrFunc.nsh",
    "content": "/*\no-----------------------------------------------------------------------------o\n|String Functions Header File 1.10                                            |\n(-----------------------------------------------------------------------------)\n| By deguix                                     / A Header file for NSIS 2.01 |\n| <cevo_deguix@yahoo.com.br>                   -------------------------------|\n|                                                                             |\n|    This header file contains NSIS functions for string manipulation.        |\n|                                                                    ---------|\n| !include \"StrFunc.nsh\"                                            / Example |\n| ${Using:StrFunc} StrRep                                          -----------|\n|                                                                             |\n| Section                                                                     |\n| ${StrRep} $0 \"Hello world!\" \"world\" \"everyone\"                              |\n| MessageBox mb_ok $0                                                         |\n| SectionEnd                                                                  |\n|                                                                             |\no-----------------------------------------------------------------------------o\n*/\n\n!verbose push 3\n!define /IfNDef STRFUNC_VERBOSITY 3\n!define /IfNDef _STRFUNC_VERBOSITY ${STRFUNC_VERBOSITY}\n!define /IfNDef _STRFUNC_CREDITVERBOSITY ${STRFUNC_VERBOSITY}\n!undef STRFUNC_VERBOSITY\n!verbose ${_STRFUNC_VERBOSITY}\n\n!include LogicLib.nsh\n\n!ifndef STRFUNC\n\n  !define /IfNDef FALSE 0\n  !define /IfNDef TRUE 1\n\n  ;Header File Identification\n\n  !define STRFUNC `String Functions Header File`\n  ;define STRFUNC_SHORT `StrFunc`\n  !define STRFUNC_CREDITS `2004 Diego Pedroso`\n\n  ;Header File Version\n\n  !define STRFUNC_VERMAJ 1\n  !define STRFUNC_VERMED 10\n ;!define STRFUNC_VERMIN 0\n ;!define STRFUNC_VERBLD 0\n\n  !define STRFUNC_VER `${STRFUNC_VERMAJ}.${STRFUNC_VERMED}`\n\n  ;Header File Init Message Prefix and Postfix\n\n  !define STRFUNC_INITMSGPRE `----------------------------------------------------------------------$\\r$\\n`\n  !define STRFUNC_INITMSGPOST `$\\r$\\n----------------------------------------------------------------------$\\r$\\n`\n\n  ;Header File Init Message\n\n  !verbose push ${_STRFUNC_CREDITVERBOSITY}\n  !echo `${STRFUNC_INITMSGPRE}NSIS ${STRFUNC} ${STRFUNC_VER} - Copyright ${STRFUNC_CREDITS}${STRFUNC_INITMSGPOST}`\n  !verbose pop\n\n  ;Header File Function Macros\n\n  !ifdef STRFUNC_USECALLARTIFICIALFUNCTION\n    !include Util.nsh\n  !endif\n\n  !define \"Using:StrFunc\" `!insertmacro STRFUNC_USING `\n  !macro STRFUNC_USING Name\n    !if \"${STRFUNC_VERBOSITY}\" > 4\n      !verbose push 4\n    !endif\n    !ifndef ${Name}_INCLUDED\n      !ifndef STRFUNC_USECALLARTIFICIALFUNCTION\n        ${${Name}} ; Invoke !insertmacro STRFUNC_MAKEFUNC\n      !endif\n    !endif\n    !if \"${STRFUNC_VERBOSITY}\" > 4\n      !verbose pop\n    !endif\n  !macroend\n\n  !macro STRFUNC_FUNCLIST_INSERT Name\n    !ifdef StrFunc_List\n      !define /ReDef StrFunc_List `${StrFunc_List}|${Name}`\n    !else\n      !define StrFunc_List `${Name}`\n    !endif\n  !macroend\n\n  !macro STRFUNC_DEFFUNC Name List TypeList\n    !insertmacro STRFUNC_FUNCLIST_INSERT ${Name}\n    !define `${Name}_List` `${List}`\n    !define `${Name}_TypeList` `${TypeList}`\n    !ifdef STRFUNC_USECALLARTIFICIALFUNCTION\n      !define `${Name}` `!insertmacro STRFUNC_CALL_${Name} \"\" `\n      !define `Un${Name}` `!insertmacro STRFUNC_CALL_${Name} Un `\n    !else\n      !define `${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} \"\" #`\n      !define `Un${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} Un #`\n    !endif\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC basename un\n    !ifndef __GLOBAL__\n      !error \"You forgot ${U+24}{Using:StrFunc} ${un}${basename}\"\n    !endif\n    !insertmacro STRFUNC_MAKEFUNC_${basename}\n  !macroend\n\n  !macro STRFUNC_BEGINFUNC basename un credits\n    !verbose push ${_STRFUNC_CREDITVERBOSITY}\n    !echo `${U+24}{${un}${basename}} - Copyright ${credits}`\n    !verbose pop\n    !define /IfNDef ${un}${basename}_INCLUDED\n    !ifndef STRFUNC_USECALLARTIFICIALFUNCTION\n      !define /ReDef ${un}${basename} `!insertmacro STRFUNC_CALL_${basename} \"${un}\" `\n      !if \"${un}\" != \"\"\n        Function un.${basename}\n      !else\n        Function ${basename}\n      !endif\n    !endif\n  !macroend\n  !macro STRFUNC_ENDFUNC\n    !ifndef STRFUNC_USECALLARTIFICIALFUNCTION\n      FunctionEnd\n    !endif\n  !macroend\n\n  !macro STRFUNC_CALL basename un\n    !ifdef STRFUNC_USECALLARTIFICIALFUNCTION\n      ${CallArtificialFunction} STRFUNC_MAKEFUNC_${basename}\n    !else\n      !if \"${un}\" != \"\"\n        Call un.${basename}\n      !else\n        Call ${basename}\n      !endif\n    !endif\n  !macroend\n\n\n  ############################################################################  \n  # StrCase\n  !insertmacro STRFUNC_DEFFUNC StrCase `ResultVar|String|Type` `Output|Text|Option  U L T S <>`\n\n  !macro STRFUNC_CALL_StrCase un ResultVar String Type\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrCase} \"${ResultVar}\" \"${String}\" \"${Type}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${Type}`\n    !insertmacro STRFUNC_CALL StrCase \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrCase\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by Dave Laundon`\n    /*After this point:\n      ------------------------------------------\n       $0 = String (input)\n       $1 = Type (input)\n       $2 = StrLength (temp)\n       $3 = StartChar (temp)\n       $4 = EndChar (temp)\n       $5 = ResultStr (temp)\n       $6 = CurrentChar (temp)\n       $7 = LastChar (temp)\n       $8 = Temp (temp)*/\n\n      ;Get input from user\n      Exch $1\n      Exch\n      Exch $0\n      Exch\n      Push $2\n      Push $3\n      Push $4\n      Push $5\n      Push $6\n      Push $7\n      Push $8\n\n      ;Initialize variables\n      StrCpy $2 \"\"\n      StrCpy $3 \"\"\n      StrCpy $4 \"\"\n      StrCpy $5 \"\"\n      StrCpy $6 \"\"\n      StrCpy $7 \"\"\n      StrCpy $8 \"\"\n\n      ;Upper and lower cases are simple to use\n      ${If} $1 == \"U\"\n\n        ;Upper Case System:\n        ;------------------\n        ; Convert all characters to upper case.\n\n        System::Call \"User32::CharUpper(t r0 r5)i\"\n        Goto StrCase_End\n      ${ElseIf} $1 == \"L\"\n\n        ;Lower Case System:\n        ;------------------\n        ; Convert all characters to lower case.\n\n        System::Call \"User32::CharLower(t r0 r5)i\"\n        Goto StrCase_End\n      ${EndIf}\n\n      ;For the rest of cases:\n      ;Get \"String\" length\n      StrLen $2 $0\n\n      ;Make a loop until the end of \"String\"\n      ${For} $3 0 $2\n        ;Add 1 to \"EndChar\" counter also\n        IntOp $4 $3 + 1\n\n        # Step 1: Detect one character at a time\n\n        ;Remove characters before \"StartChar\" except when\n        ;\"StartChar\" is the first character of \"String\"\n        ${If} $3 <> 0\n          StrCpy $6 $0 `` $3\n        ${EndIf}\n\n        ;Remove characters after \"EndChar\" except when\n        ;\"EndChar\" is the last character of \"String\"\n        ${If} $4 <> $2\n          ${If} $3 = 0\n            StrCpy $6 $0 1\n          ${Else}\n            StrCpy $6 $6 1\n          ${EndIf}\n        ${EndIf}\n\n        # Step 2: Convert to the advanced case user chose:\n\n        ${If} $1 == \"T\"\n\n          ;Title Case System:\n          ;------------------\n          ; Convert all characters after a non-alphabetic character to upper case.\n          ; Else convert to lower case.\n\n          ;Use \"IsCharAlpha\" for the job\n          System::Call \"*(&t1 r7) p .r8\"\n          System::Call \"*$8(&i1 .r7)\"\n          System::Free $8\n          System::Call \"user32::IsCharAlpha(i r7) i .r8\"\n          \n          ;Verify \"IsCharAlpha\" result and convert the character\n          ${If} $8 = 0\n            System::Call \"User32::CharUpper(t r6 r6)i\"\n          ${Else}\n            System::Call \"User32::CharLower(t r6 r6)i\"\n          ${EndIf}\n        ${ElseIf} $1 == \"S\"\n\n          ;Sentence Case System:\n          ;------------------\n          ; Convert all characters after a \".\", \"!\" or \"?\" character to upper case.\n          ; Else convert to lower case. Spaces or tabs after these marks are ignored.\n\n          ;Detect current characters and ignore if necessary\n          ${If} $6 == \" \"\n          ${OrIf} $6 == \"$\\t\"\n            Goto IgnoreLetter\n          ${EndIf}\n\n          ;Detect last characters and convert\n          ${If} $7 == \".\"\n          ${OrIf} $7 == \"!\"\n          ${OrIf} $7 == \"?\"\n          ${OrIf} $7 == \"\"\n            System::Call \"User32::CharUpper(t r6 r6)i\"\n          ${Else}\n            System::Call \"User32::CharLower(t r6 r6)i\"\n          ${EndIf}\n        ${ElseIf} $1 == \"<>\"\n\n          ;Switch Case System:\n          ;------------------\n          ; Switch all characters cases to their inverse case.\n\n          ;Use \"IsCharUpper\" for the job\n          System::Call \"*(&t1 r6) p .r8\"\n          System::Call \"*$8(&i1 .r7)\"\n          System::Free $8\n          System::Call \"user32::IsCharUpper(i r7) i .r8\"\n          \n          ;Verify \"IsCharUpper\" result and convert the character\n          ${If} $8 = 0\n            System::Call \"User32::CharUpper(t r6 r6)i\"\n          ${Else}\n            System::Call \"User32::CharLower(t r6 r6)i\"\n          ${EndIf}\n        ${EndIf}\n\n        ;Write the character to \"LastChar\"\n        StrCpy $7 $6\n\n        IgnoreLetter:\n        ;Add this character to \"ResultStr\"\n        StrCpy $5 `$5$6`\n      ${Next}\n\n      StrCase_End:\n\n    /*After this point:\n      ------------------------------------------\n       $0 = OutVar (output)*/\n\n      ; Copy \"ResultStr\" to \"OutVar\"\n      StrCpy $0 $5\n\n      ;Return output to user\n      Pop $8\n      Pop $7\n      Pop $6\n      Pop $5\n      Pop $4\n      Pop $3\n      Pop $2\n      Pop $1\n      Exch $0\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrClb\n  !insertmacro STRFUNC_DEFFUNC StrClb `ResultVar|String|Action` `Output|Text|Option  > < <>`\n\n  !macro STRFUNC_CALL_StrClb un ResultVar String Action\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrClb} \"${ResultVar}\" \"${String}\" \"${Action}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${Action}`\n    !insertmacro STRFUNC_CALL StrClb \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrClb\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by Nik Medved`\n\n    /*After this point:\n      ------------------------------------------\n       $0 = String (input)\n       $1 = Action (input)\n       $2 = Lock/Unlock (temp)\n       $3 = Temp (temp)\n       $4 = Temp2 (temp)*/\n\n      ;Get input from user\n\n      Exch $1\n      Exch\n      Exch $0\n      Exch\n      Push $2\n      Push $3\n      Push $4\n      \n      StrCpy $2 \"\"\n      StrCpy $3 \"\"\n      StrCpy $4 \"\"\n\n      ;Open the clipboard to do the operations the user chose (kichik's fix)\n      System::Call 'user32::OpenClipboard(p $HWNDPARENT)'\n\n      ${If} $1 == \">\" ;Set\n\n        ;Step 1: Clear the clipboard\n        System::Call 'user32::EmptyClipboard()'\n\n        ;Step 2: Allocate global heap\n        StrLen $2 $0\n        IntOp $2 $2 + 1\n        !if \"${NSIS_CHAR_SIZE}\" > 1\n        IntOp $2 $2 * ${NSIS_CHAR_SIZE}\n        !endif\n        System::Call 'kernel32::GlobalAlloc(i 2, i r2) p.r2'\n\n        ;Step 3: Lock the handle\n        System::Call 'kernel32::GlobalLock(p r2) i.r3'\n\n        ;Step 4: Copy the text to locked clipboard buffer\n        System::Call 'kernel32::lstrcpy(p r3, t r0)'\n\n        ;Step 5: Unlock the handle again\n        System::Call 'kernel32::GlobalUnlock(p r2)'\n\n        ;Step 6: Set the information to the clipboard\n        !if \"${NSIS_CHAR_SIZE}\" > 1\n        System::Call 'user32::SetClipboardData(i 13, p r2)'\n        !else\n        System::Call 'user32::SetClipboardData(i 1, p r2)'\n        !endif\n\n        StrCpy $0 \"\"\n\n      ${ElseIf} $1 == \"<\" ;Get\n\n        ;Step 1: Get clipboard data\n        !if \"${NSIS_CHAR_SIZE}\" > 1\n        System::Call 'user32::GetClipboardData(i 13)p.r2'\n        !else\n        System::Call 'user32::GetClipboardData(i 1)p.r2'\n        !endif\n\n        ;Step 2: Lock and copy data (kichik's fix)\n        System::Call 'kernel32::GlobalLock(p r2) t .r0'\n\n        ;Step 3: Unlock (kichik's fix)\n        System::Call 'kernel32::GlobalUnlock(p r2)'\n\n      ${ElseIf} $1 == \"<>\" ;Swap\n\n        ;Step 1: Get clipboard data\n        !if \"${NSIS_CHAR_SIZE}\" > 1\n        System::Call 'user32::GetClipboardData(i 13)p.r2'\n        !else\n        System::Call 'user32::GetClipboardData(i 1)p.r2'\n        !endif\n\n        ;Step 2: Lock and copy data (kichik's fix)\n        System::Call 'kernel32::GlobalLock(p r2) t .r4'\n\n        ;Step 3: Unlock (kichik's fix)\n        System::Call 'kernel32::GlobalUnlock(p r2)'\n\n        ;Step 4: Clear the clipboard\n        System::Call 'user32::EmptyClipboard()'\n\n        ;Step 5: Allocate global heap\n        StrLen $2 $0\n        IntOp $2 $2 + 1\n        !if \"${NSIS_CHAR_SIZE}\" > 1\n        IntOp $2 $2 * ${NSIS_CHAR_SIZE}\n        !endif\n        System::Call 'kernel32::GlobalAlloc(i 2, i r2) p.r2'\n\n        ;Step 6: Lock the handle\n        System::Call 'kernel32::GlobalLock(p r2) i.r3'\n\n        ;Step 7: Copy the text to locked clipboard buffer\n        System::Call 'kernel32::lstrcpy(p r3, t r0)'\n\n        ;Step 8: Unlock the handle again\n        System::Call 'kernel32::GlobalUnlock(p r2)'\n\n        ;Step 9: Set the information to the clipboard\n        !if \"${NSIS_CHAR_SIZE}\" > 1\n        System::Call 'user32::SetClipboardData(i 13, p r2)'\n        !else\n        System::Call 'user32::SetClipboardData(i 1, p r2)'\n        !endif\n        \n        StrCpy $0 $4\n      ${Else} ;Clear\n\n        ;Step 1: Clear the clipboard\n        System::Call 'user32::EmptyClipboard()'\n\n        StrCpy $0 \"\"\n      ${EndIf}\n\n      ;Close the clipboard\n      System::Call 'user32::CloseClipboard()'\n\n    /*After this point:\n      ------------------------------------------\n       $0 = OutVar (output)*/\n\n      ;Return result to user\n      Pop $4\n      Pop $3\n      Pop $2\n      Pop $1\n      Exch $0\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrIOToNSIS\n  !insertmacro STRFUNC_DEFFUNC StrIOToNSIS `ResultVar|String` `Output|Text`\n\n  !macro STRFUNC_CALL_StrIOToNSIS un ResultVar String\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrIOToNSIS} \"${ResultVar}\" \"${String}\"`\n    !verbose 2\n    Push `${String}`\n    !insertmacro STRFUNC_CALL StrIOToNSIS \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrIOToNSIS\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 \"bluenet\" - Based on functions by Amir Szekely, Joost Verburg, Dave Laundon and Diego Pedroso`\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = String (input/output)\n       $R1 = StartCharPos (temp)\n       $R2 = StrLen (temp)\n       $R3 = TempStr (temp)\n       $R4 = TempRepStr (temp)*/\n\n      ;Get input from user\n      Exch $R0\n      Push $R1\n      Push $R2\n      Push $R3\n      Push $R4\n      \n      ;Get \"String\" length\n      StrLen $R2 $R0\n\n      ;Loop until \"String\" end is reached\n      ${For} $R1 0 $R2\n        ;Get the next \"String\" characters\n        StrCpy $R3 $R0 2 $R1\n        \n        ;Detect if current character is:\n        ${If} $R3 == \"\\\\\" ;Back-slash\n          StrCpy $R4 \"\\\"\n        ${ElseIf} $R3 == \"\\r\" ;Carriage return\n          StrCpy $R4 \"$\\r\"\n        ${ElseIf} $R3 == \"\\n\" ;Line feed\n          StrCpy $R4 \"$\\n\"\n        ${ElseIf} $R3 == \"\\t\" ;Tab\n          StrCpy $R4 \"$\\t\"\n        ${Else} ;Anything else\n          StrCpy $R4 \"\"\n        ${EndIf}\n\n        ;Detect if \"TempRepStr\" is not empty\n        ${If} $R4 != \"\"\n          ;Replace the old characters with the new one\n          StrCpy $R3 $R0 $R1\n          IntOp $R1 $R1 + 2\n          StrCpy $R0 $R0 \"\" $R1\n          StrCpy $R0 \"$R3$R4$R0\"\n          IntOp $R2 $R2 - 1 ;Decrease \"StrLen\"\n          IntOp $R1 $R1 - 2 ;Go back to the next character\n        ${EndIf}\n      ${Next}\n      Pop $R4\n      Pop $R3\n      Pop $R2\n      Pop $R1\n      Exch $R0\n    !insertmacro STRFUNC_ENDFUNC\n  !macroend\n\n  ############################################################################  \n  # StrLoc\n  !insertmacro STRFUNC_DEFFUNC StrLoc `ResultVar|String|StrToSearchFor|CounterDirection` `Output|Text|Text|Option > <`\n\n  !macro STRFUNC_CALL_StrLoc un ResultVar String StrToSearchFor OffsetDirection\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrLoc} \"${ResultVar}\" \"${String}\" \"${StrToSearchFor}\" \"${OffsetDirection}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${StrToSearchFor}`\n    Push `${OffsetDirection}`\n    !insertmacro STRFUNC_CALL StrLoc \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrLoc\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = OffsetDirection (input)\n       $R1 = StrToSearch (input)\n       $R2 = String (input)\n       $R3 = StrToSearchLen (temp)\n       $R4 = StrLen (temp)\n       $R5 = StartCharPos (temp)\n       $R6 = TempStr (temp)*/\n\n      ;Get input from user\n      Exch $R0\n      Exch\n      Exch $R1\n      Exch 2\n      Exch $R2\n      Push $R3\n      Push $R4\n      Push $R5\n      Push $R6\n\n      ;Get \"String\" and \"StrToSearch\" length\n      StrLen $R3 $R1\n      StrLen $R4 $R2\n      ;Start \"StartCharPos\" counter\n      StrCpy $R5 0\n\n      ;Loop until \"StrToSearch\" is found or \"String\" reaches its end\n      ${Do}\n        ;Remove everything before and after the searched part (\"TempStr\")\n        StrCpy $R6 $R2 $R3 $R5\n\n        ;Compare \"TempStr\" with \"StrToSearch\"\n        ${If} $R6 == $R1\n          ${If} $R0 == `<`\n            IntOp $R6 $R3 + $R5\n            IntOp $R0 $R4 - $R6\n          ${Else}\n            StrCpy $R0 $R5\n          ${EndIf}\n          ${ExitDo}\n        ${EndIf}\n        ;If not \"StrToSearch\", this could be \"String\" end\n        ${If} $R5 >= $R4\n          StrCpy $R0 ``\n          ${ExitDo}\n        ${EndIf}\n        ;If not, continue the loop\n        IntOp $R5 $R5 + 1\n      ${Loop}\n\n      ;Return output to user\n      Pop $R6\n      Pop $R5\n      Pop $R4\n      Pop $R3\n      Pop $R2\n      Exch\n      Pop $R1\n      Exch $R0\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrNSISToIO\n  !insertmacro STRFUNC_DEFFUNC StrNSISToIO `ResultVar|String` `Output|Text`\n\n  !macro STRFUNC_CALL_StrNSISToIO un ResultVar String\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrNSISToIO} \"${ResultVar}\" \"${String}\"`\n    !verbose 2\n    Push `${String}`\n    !insertmacro STRFUNC_CALL StrNSISToIO \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrNSISToIO\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 \"bluenet\" - Based on functions by Amir Szekely, Joost Verburg, Dave Laundon and Diego Pedroso`\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = String (input/output)\n       $R1 = StartCharPos (temp)\n       $R2 = StrLen (temp)\n       $R3 = TempStr (temp)\n       $R4 = TempRepStr (temp)*/\n\n      ;Get input from user\n      Exch $R0\n      Push $R1\n      Push $R2\n      Push $R3\n      Push $R4\n      \n      ;Get \"String\" length\n      StrLen $R2 $R0\n\n      ;Loop until \"String\" end is reached\n      ${For} $R1 0 $R2\n        ;Get the next \"String\" character\n        StrCpy $R3 $R0 1 $R1\n\n        ;Detect if current character is:\n        ${If} $R3 == \"$\\r\" ;Back-slash\n          StrCpy $R4 \"\\r\"\n        ${ElseIf} $R3 == \"$\\n\" ;Carriage return\n          StrCpy $R4 \"\\n\"\n        ${ElseIf} $R3 == \"$\\t\" ;Line feed\n          StrCpy $R4 \"\\t\"\n        ${ElseIf} $R3 == \"\\\" ;Tab\n          StrCpy $R4 \"\\\\\"\n        ${Else} ;Anything else\n          StrCpy $R4 \"\"\n        ${EndIf}\n\n        ;Detect if \"TempRepStr\" is not empty\n        ${If} $R4 != \"\"\n          ;Replace the old character with the new ones\n          StrCpy $R3 $R0 $R1\n          IntOp $R1 $R1 + 1\n          StrCpy $R0 $R0 \"\" $R1\n          StrCpy $R0 \"$R3$R4$R0\"\n          IntOp $R2 $R2 + 1 ;Increase \"StrLen\"\n        ${EndIf}\n      ${Next}\n\n      ;Return output to user\n      Pop $R4\n      Pop $R3\n      Pop $R2\n      Pop $R1\n      Exch $R0\n    !insertmacro STRFUNC_ENDFUNC\n  !macroend\n\n  ############################################################################  \n  # StrRep\n  !insertmacro STRFUNC_DEFFUNC StrRep `ResultVar|String|StrToReplace|ReplacementString` `Output|Text|Text|Text`\n\n  !macro STRFUNC_CALL_StrRep un ResultVar String StringToReplace ReplacementString\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrRep} \"${ResultVar}\" \"${String}\" \"${StringToReplace}\" \"${ReplacementString}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${StringToReplace}`\n    Push `${ReplacementString}`\n    !insertmacro STRFUNC_CALL StrRep \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrRep\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by Hendri Adriaens`\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = ReplacementString (input)\n       $R1 = StrToSearch (input)\n       $R2 = String (input)\n       $R3 = RepStrLen (temp)\n       $R4 = StrToSearchLen (temp)\n       $R5 = StrLen (temp)\n       $R6 = StartCharPos (temp)\n       $R7 = TempStrL (temp)\n       $R8 = TempStrR (temp)*/\n\n      ;Get input from user\n      Exch $R0\n      Exch\n      Exch $R1\n      Exch\n      Exch 2\n      Exch $R2\n      Push $R3\n      Push $R4\n      Push $R5\n      Push $R6\n      Push $R7\n      Push $R8\n\n      ;Return \"String\" if \"StrToSearch\" is \"\"\n      ${IfThen} $R1 == \"\" ${|} Goto Done ${|}\n\n      ;Get \"ReplacementString\", \"String\" and \"StrToSearch\" length\n      StrLen $R3 $R0\n      StrLen $R4 $R1\n      StrLen $R5 $R2\n      ;Start \"StartCharPos\" counter\n      StrCpy $R6 0\n\n      ;Loop until \"StrToSearch\" is found or \"String\" reaches its end\n      ${Do}\n        ;Remove everything before and after the searched part (\"TempStrL\")\n        StrCpy $R7 $R2 $R4 $R6\n\n        ;Compare \"TempStrL\" with \"StrToSearch\"\n        ${If} $R7 == $R1\n          ;Split \"String\" to replace the string wanted\n          StrCpy $R7 $R2 $R6 ;TempStrL\n\n          ;Calc: \"StartCharPos\" + \"StrToSearchLen\" = EndCharPos\n          IntOp $R8 $R6 + $R4\n\n          StrCpy $R8 $R2 \"\" $R8 ;TempStrR\n\n          ;Insert the new string between the two separated parts of \"String\"\n          StrCpy $R2 $R7$R0$R8\n          ;Now calculate the new \"StrLen\" and \"StartCharPos\"\n          StrLen $R5 $R2\n          IntOp $R6 $R6 + $R3\n          ${Continue}\n        ${EndIf}\n\n        ;If not \"StrToSearch\", this could be \"String\" end\n        ${IfThen} $R6 >= $R5 ${|} ${ExitDo} ${|}\n        ;If not, continue the loop\n        IntOp $R6 $R6 + 1\n      ${Loop}\n\n      Done:\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = OutVar (output)*/\n\n      ;Return output to user\n      StrCpy $R0 $R2\n      Pop $R8\n      Pop $R7\n      Pop $R6\n      Pop $R5\n      Pop $R4\n      Pop $R3\n      Pop $R2\n      Pop $R1\n      Exch $R0\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrSort\n  !insertmacro STRFUNC_DEFFUNC StrSort `ResultVar|String|CenterStr|LeftStr|RightStr|IncludeLeftStr|IncludeCenterStr|IncludeRightStr` `Output|Text|Text|Text|Text|Option 1 0|Option 1 0|Option 1 0`\n\n  !macro STRFUNC_CALL_StrSort un ResultVar String CenterStr LeftStr RightStr IncludeCenterStr IncludeLeftStr IncludeRightStr\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrSort} \"${ResultVar}\" \"${String}\" \"${CenterStr}\" \"${LeftStr}\" \"${RightStr}\" \"${IncludeCenterStr}\" \"${IncludeLeftStr}\" \"${IncludeRightStr}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${CenterStr}`\n    Push `${LeftStr}`\n    Push `${RightStr}`\n    Push `${IncludeCenterStr}`\n    Push `${IncludeLeftStr}`\n    Push `${IncludeRightStr}`\n    !insertmacro STRFUNC_CALL StrSort \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrSort\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by Stuart Welch`\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = String (input)\n       $R1 = LeftStr (input)\n       $R2 = CenterStr (input)\n       $R3 = RightStr (input)\n       $R4 = IncludeLeftStr (input)\n       $R5 = IncludeCenterStr (input)\n       $R6 = IncludeRightStr (input)\n\n       $0 = StrLen (temp)\n       $1 = LeftStrLen (temp)\n       $2 = CenterStrLen (temp)\n       $3 = RightStrLen (temp)\n       $4 = StartPos (temp)\n       $5 = EndPos (temp)\n       $6 = StartCharPos (temp)\n       $7 = EndCharPos (temp)\n       $8 = TempStr (temp)*/\n\n      ;Get input from user\n      Exch $R6\n      Exch\n      Exch $R5\n      Exch\n      Exch 2\n      Exch $R4\n      Exch 2\n      Exch 3\n      Exch $R3\n      Exch 3\n      Exch 4\n      Exch $R2\n      Exch 4\n      Exch 5\n      Exch $R1\n      Exch 5\n      Exch 6\n      Exch $R0\n      Exch 6\n      Push $0\n      Push $1\n      Push $2\n      Push $3\n      Push $4\n      Push $5\n      Push $6\n      Push $7\n      Push $8\n\n      ;Parameter defaults\n      ${IfThen} $R4 == `` ${|} StrCpy $R4 `1` ${|}\n      ${IfThen} $R5 == `` ${|} StrCpy $R5 `1` ${|}\n      ${IfThen} $R6 == `` ${|} StrCpy $R6 `1` ${|}\n\n      ;Get \"String\", \"CenterStr\", \"LeftStr\" and \"RightStr\" length\n      StrLen $0 $R0\n      StrLen $1 $R1\n      StrLen $2 $R2\n      StrLen $3 $R3\n      ;Start \"StartCharPos\" counter\n      StrCpy $6 0\n      ;Start \"EndCharPos\" counter based on \"CenterStr\" length\n      IntOp $7 $6 + $2\n\n      ;Loop until \"CenterStr\" is found or \"String\" reaches its end\n      ${Do}\n        ;Remove everything before and after the searched part (\"TempStr\")\n        StrCpy $8 $R0 $2 $6\n\n        ;Compare \"TempStr\" with \"CenterStr\"\n        ${IfThen} $8 == $R2 ${|} ${ExitDo} ${|}\n        ;If not, this could be \"String\" end\n        ${IfThen} $7 >= $0 ${|} Goto Done ${|}\n        ;If not, continue the loop\n        IntOp $6 $6 + 1\n        IntOp $7 $7 + 1\n      ${Loop}\n\n      # \"CenterStr\" was found\n\n      ;Remove \"CenterStr\" from \"String\" if the user wants\n      ${If} $R5 = ${FALSE}\n        StrCpy $8 $R0 $6\n        StrCpy $R0 $R0 `` $7\n        StrCpy $R0 $8$R0\n      ${EndIf}\n\n      ;\"StartPos\" and \"EndPos\" will record \"CenterStr\" coordinates for now\n      StrCpy $4 $6\n      StrCpy $5 $7\n      ;\"StartCharPos\" and \"EndCharPos\" should be before \"CenterStr\"\n      IntOp $6 $6 - $1\n      IntOp $7 $6 + $1\n\n      ;Loop until \"LeftStr\" is found or \"String\" reaches its start\n      ${Do}\n        ;Remove everything before and after the searched part (\"TempStr\")\n        StrCpy $8 $R0 $1 $6\n\n        ;If \"LeftStr\" is empty\n        ${If} $R1 == ``\n          StrCpy $6 0\n          StrCpy $7 0\n          ${ExitDo}\n        ${EndIf}\n\n        ;Compare \"TempStr\" with \"LeftStr\"\n        ${IfThen} $8 == $R1 ${|} ${ExitDo} ${|}\n        ;If not, this could be \"String\" start\n        ${IfThen} $6 <= 0 ${|} ${ExitDo} ${|}\n        ;If not, continue the loop\n        IntOp $6 $6 - 1\n        IntOp $7 $7 - 1\n      ${Loop}\n\n      # \"LeftStr\" is found or \"String\" start was reached\n\n      ;Remove \"LeftStr\" from \"String\" if the user wants\n      ${If} $R4 = ${FALSE}\n        IntOp $6 $6 + $1\n      ${EndIf}\n\n      ;Record \"LeftStr\" first character position on \"TempStr\" (temporarily)\n      StrCpy $8 $6\n\n      ;\"StartCharPos\" and \"EndCharPos\" should be after \"CenterStr\"\n      ${If} $R5 = ${FALSE}\n        StrCpy $6 $4\n      ${Else}\n        IntOp $6 $4 + $2\n      ${EndIf}\n      IntOp $7 $6 + $3\n      \n      ;Record \"LeftStr\" first character position on \"StartPos\"\n      StrCpy $4 $8\n\n      ;Loop until \"RightStr\" is found or \"String\" reaches its end\n      ${Do}\n        ;Remove everything before and after the searched part (\"TempStr\")\n        StrCpy $8 $R0 $3 $6\n\n        ;If \"RightStr\" is empty\n        ${If} $R3 == ``\n          StrCpy $6 $0\n          StrCpy $7 $0\n          ${ExitDo}\n        ${EndIf}\n\n        ;Compare \"TempStr\" with \"RightStr\"\n        ${IfThen} $8 == $R3 ${|} ${ExitDo} ${|}\n        ;If not, this could be \"String\" end\n        ${IfThen} $7 >= $0 ${|} ${ExitDo} ${|}\n        ;If not, continue the loop\n        IntOp $6 $6 + 1\n        IntOp $7 $7 + 1\n      ${Loop}\n\n      ;Remove \"RightStr\" from \"String\" if the user wants\n      ${If} $R6 = ${FALSE}\n        IntOp $7 $7 - $3\n      ${EndIf}\n\n      ;Record \"RightStr\" last character position on \"StartPos\"\n      StrCpy $5 $7\n\n      ;As the positionment is relative...\n      IntOp $5 $5 - $4\n\n      ;Write the string and finish the job\n      StrCpy $R0 $R0 $5 $4\n      Goto +2\n\n      Done:\n      StrCpy $R0 ``\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = OutVar (output)*/\n\n      ;Return output to user\n      Pop $8\n      Pop $7\n      Pop $6\n      Pop $5\n      Pop $4\n      Pop $3\n      Pop $2\n      Pop $1\n      Pop $0\n      Pop $R6\n      Pop $R5\n      Pop $R4\n      Pop $R3\n      Pop $R2\n      Pop $R1\n      Exch $R0\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrStr\n  !insertmacro STRFUNC_DEFFUNC StrStr `ResultVar|String|StrToSearchFor` `Output|Text|Text`\n\n  !macro STRFUNC_CALL_StrStr un ResultVar String StrToSearchFor\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrStr} \"${ResultVar}\" \"${String}\" \"${StrToSearchFor}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${StrToSearchFor}`\n    !insertmacro STRFUNC_CALL StrStr \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrStr\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = StrToSearch (input)\n       $R1 = String (input)\n       $R2 = StrToSearchLen (temp)\n       $R3 = StrLen (temp)\n       $R4 = StartCharPos (temp)\n       $R5 = TempStr (temp)*/\n\n      ;Get input from user\n      Exch $R0\n      Exch\n      Exch $R1\n      Push $R2\n      Push $R3\n      Push $R4\n      Push $R5\n\n      ;Get \"String\" and \"StrToSearch\" length\n      StrLen $R2 $R0\n      StrLen $R3 $R1\n      ;Start \"StartCharPos\" counter\n      StrCpy $R4 0\n\n      ;Loop until \"StrToSearch\" is found or \"String\" reaches its end\n      ${Do}\n        ;Remove everything before and after the searched part (\"TempStr\")\n        StrCpy $R5 $R1 $R2 $R4\n\n        ;Compare \"TempStr\" with \"StrToSearch\"\n        ${IfThen} $R5 == $R0 ${|} ${ExitDo} ${|}\n        ;If not \"StrToSearch\", this could be \"String\" end\n        ${IfThen} $R4 >= $R3 ${|} ${ExitDo} ${|}\n        ;If not, continue the loop\n        IntOp $R4 $R4 + 1\n      ${Loop}\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = OutVar (output)*/\n\n      ;Remove part before \"StrToSearch\" on \"String\" (if there has one)\n      StrCpy $R0 $R1 `` $R4\n\n      ;Return output to user\n      Pop $R5\n      Pop $R4\n      Pop $R3\n      Pop $R2\n      Pop $R1\n      Exch $R0\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrStrAdv\n  !insertmacro STRFUNC_DEFFUNC StrStrAdv `ResultVar|String|StrToSearchFor|SearchDirection|ResultStrDirection|DisplayStrToSearch|Loops|CaseSensitive` `Output|Text|Text|Option > <|Option > <|Option 1 0|Text|Option 0 1`\n\n  !macro STRFUNC_CALL_StrStrAdv un ResultVar String StrToSearchFor SearchDirection ResultStrDirection DisplayStrToSearch Loops CaseSensitive\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrStrAdv} \"${ResultVar}\" \"${String}\" \"${StrToSearchFor}\" \"${SearchDirection}\" \"${ResultStrDirection}\" \"${DisplayStrToSearch}\" \"${Loops}\" \"${CaseSensitive}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${StrToSearchFor}`\n    Push `${SearchDirection}`\n    Push `${ResultStrDirection}`\n    Push `${DisplayStrToSearch}`\n    Push `${Loops}`\n    Push `${CaseSensitive}`\n    !insertmacro STRFUNC_CALL StrStrAdv \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrStrAdv\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2003-2004 Diego Pedroso`\n\n    /*After this point:\n      ------------------------------------------\n       $0 = String (input)\n       $1 = StringToSearch (input)\n       $2 = DirectionOfSearch (input)\n       $3 = DirectionOfReturn (input)\n       $4 = ShowStrToSearch (input)\n       $5 = NumLoops (input)\n       $6 = CaseSensitive (input)\n       $7 = StringLength (temp)\n       $8 = StrToSearchLength (temp)\n       $9 = CurrentLoop (temp)\n       $R0 = EndCharPos (temp)\n       $R1 = StartCharPos (temp)\n       $R2 = OutVar (output)\n       $R3 = Temp (temp)*/\n\n      ;Get input from user\n\n      Exch $6\n      Exch\n      Exch $5\n      Exch\n      Exch 2\n      Exch $4\n      Exch 2\n      Exch 3\n      Exch $3\n      Exch 3\n      Exch 4\n      Exch $2\n      Exch 4\n      Exch 5\n      Exch $1\n      Exch 5\n      Exch 6\n      Exch $0\n      Exch 6\n      Push $7\n      Push $8\n      Push $9\n      Push $R3\n      Push $R2\n      Push $R1\n      Push $R0\n\n      ; Clean $R0-$R3 variables\n      StrCpy $R0 \"\"\n      StrCpy $R1 \"\"\n      StrCpy $R2 \"\"\n      StrCpy $R3 \"\"\n\n      ; Verify if we have the correct values on the variables\n      ${If} $0 == ``\n        SetErrors ;AdvStrStr_StrToSearch not found\n        Goto AdvStrStr_End\n      ${EndIf}\n\n      ${If} $1 == ``\n        SetErrors ;No text to search\n        Goto AdvStrStr_End\n      ${EndIf}\n\n      ${If} $2 != <\n        StrCpy $2 >\n      ${EndIf}\n\n      ${If} $3 != <\n        StrCpy $3 >\n      ${EndIf}\n\n      ${If} $4 <> 0\n        StrCpy $4 1\n      ${EndIf}\n\n      ${If} $5 <= 0\n        StrCpy $5 0\n      ${EndIf}\n\n      ${If} $6 <> 1\n        StrCpy $6 0\n      ${EndIf}\n\n      ; Find \"AdvStrStr_String\" length\n      StrLen $7 $0\n\n      ; Then find \"AdvStrStr_StrToSearch\" length\n      StrLen $8 $1\n\n      ; Now set up basic variables\n\n      ${If} $2 == <\n        IntOp $R1 $7 - $8\n        StrCpy $R2 $7\n      ${Else}\n        StrCpy $R1 0\n        StrCpy $R2 $8\n      ${EndIf}\n\n      StrCpy $9 0 ; First loop\n\n      ;Let's begin the search\n\n      ${Do}\n        ; Step 1: If the starting or ending numbers are negative\n        ;         or more than AdvStrStr_StringLen, we return\n        ;         error\n\n        ${If} $R1 < 0\n          StrCpy $R1 ``\n          StrCpy $R2 ``\n          StrCpy $R3 ``\n          SetErrors ;AdvStrStr_StrToSearch not found\n          Goto AdvStrStr_End\n        ${ElseIf} $R2 > $7\n          StrCpy $R1 ``\n          StrCpy $R2 ``\n          StrCpy $R3 ``\n          SetErrors ;AdvStrStr_StrToSearch not found\n          Goto AdvStrStr_End\n        ${EndIf}\n\n        ; Step 2: Start the search depending on\n        ;         AdvStrStr_DirectionOfSearch. Chop down not needed\n        ;         characters.\n\n        ${If} $R1 <> 0\n          StrCpy $R3 $0 `` $R1\n        ${EndIf}\n\n        ${If} $R2 <> $7\n          ${If} $R1 = 0\n            StrCpy $R3 $0 $8\n          ${Else}\n            StrCpy $R3 $R3 $8\n          ${EndIf}\n        ${EndIf}\n\n        ; Step 3: Make sure that's the string we want\n\n        ; Case-Sensitive Support <- Use \"AdvStrStr_Temp\"\n        ; variable because it won't be used anymore\n\n        ${If} $6 == 1\n          System::Call `kernel32::lstrcmp(ts, ts) i.s` `$R3` `$1`\n          Pop $R3\n          ${If} $R3 = 0\n            StrCpy $R3 1 ; Continue\n          ${Else}\n            StrCpy $R3 0 ; Break\n          ${EndIf}\n        ${Else}\n          ${If} $R3 == $1\n            StrCpy $R3 1 ; Continue\n          ${Else}\n            StrCpy $R3 0 ; Break\n          ${EndIf}\n        ${EndIf}\n\n        ; After the comparasion, confirm that it is the\n        ; value we want.\n\n        ${If} $R3 = 1\n\n          ;We found it, return except if the user has set up to\n          ;search for another one:\n          ${If} $9 >= $5\n\n            ;Now, let's see if the user wants\n            ;AdvStrStr_StrToSearch to appear:\n            ${If} $4 == 0\n              ;Return depends on AdvStrStr_DirectionOfReturn\n              ${If} $3 == <\n                ; RTL\n                StrCpy $R0 $0 $R1\n              ${Else}\n                ; LTR\n                StrCpy $R0 $0 `` $R2\n              ${EndIf}\n              ${Break}\n            ${Else}\n              ;Return depends on AdvStrStr_DirectionOfReturn\n              ${If} $3 == <\n                ; RTL\n                StrCpy $R0 $0 $R2\n              ${Else}\n                ; LTR\n                StrCpy $R0 $0 `` $R1\n              ${EndIf}\n              ${Break}\n            ${EndIf}\n          ${Else}\n            ;If the user wants to have more loops, let's do it so!\n            IntOp $9 $9 + 1\n\n            ${If} $2 == <\n              IntOp $R1 $R1 - 1\n              IntOp $R2 $R2 - 1\n            ${Else}\n              IntOp $R1 $R1 + 1\n              IntOp $R2 $R2 + 1\n            ${EndIf}\n          ${EndIf}\n        ${Else}\n          ; Step 4: We didn't find it, so do steps 1 thru 3 again\n\n          ${If} $2 == <\n            IntOp $R1 $R1 - 1\n            IntOp $R2 $R2 - 1\n          ${Else}\n            IntOp $R1 $R1 + 1\n            IntOp $R2 $R2 + 1\n          ${EndIf}\n        ${EndIf}\n      ${Loop}\n\n      AdvStrStr_End:\n\n      ;Add 1 to AdvStrStr_EndCharPos to be supportable\n      ;by \"StrCpy\"\n\n      IntOp $R2 $R2 - 1\n\n      ;Return output to user\n\n      Exch $R0\n      Exch\n      Pop $R1\n      Exch\n      Pop $R2\n      Exch\n      Pop $R3\n      Exch\n      Pop $9\n      Exch\n      Pop $8\n      Exch\n      Pop $7\n      Exch\n      Pop $6\n      Exch\n      Pop $5\n      Exch\n      Pop $4\n      Exch\n      Pop $3\n      Exch\n      Pop $2\n      Exch\n      Pop $1\n      Exch\n      Pop $0\n\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrTok\n  !insertmacro STRFUNC_DEFFUNC StrTok `ResultVar|String|Separators|ResultPart|SkipEmptyParts` `Output|Text|Text|Mixed L|Option 1 0`\n\n  !macro STRFUNC_CALL_StrTok un ResultVar String Separators ResultPart SkipEmptyParts\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrTok} \"${ResultVar}\" \"${String}\" \"${Separators}\" \"${ResultPart}\" \"${SkipEmptyParts}\"`\n    !verbose 2\n    Push `${String}`\n    Push `${Separators}`\n    Push `${ResultPart}`\n    Push `${SkipEmptyParts}`\n    !insertmacro STRFUNC_CALL StrTok \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrTok\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by \"bigmac666\"`\n    /*After this point:\n      ------------------------------------------\n       $0 = SkipEmptyParts (input)\n       $1 = ResultPart (input)\n       $2 = Separators (input)\n       $3 = String (input)\n       $4 = StrToSearchLen (temp)\n       $5 = StrLen (temp)\n       $6 = StartCharPos (temp)\n       $7 = TempStr (temp)\n       $8 = CurrentLoop\n       $9 = CurrentSepChar\n       $R0 = CurrentSepCharNum\n       */\n\n      ;Get input from user\n      Exch $0\n      Exch\n      Exch $1\n      Exch\n      Exch 2\n      Exch $2\n      Exch 2\n      Exch 3\n      Exch $3\n      Exch 3\n      Push $4\n      Push $5\n      Push $6\n      Push $7\n      Push $8\n      Push $9\n      Push $R0\n\n      ;Parameter defaults\n      ${IfThen} $2 == `` ${|} StrCpy $2 `|` ${|}\n      ${IfThen} $1 == `` ${|} StrCpy $1 `L` ${|}\n      ${IfThen} $0 == `` ${|} StrCpy $0 `0` ${|}\n\n      ;Get \"String\" and \"StrToSearch\" length\n      StrLen $4 $2\n      StrLen $5 $3\n      ;Start \"StartCharPos\" and \"ResultPart\" counters\n      StrCpy $6 0\n      StrCpy $8 -1\n\n      ;Loop until \"ResultPart\" is met, \"StrToSearch\" is found or\n      ;\"String\" reaches its end\n      ResultPartLoop: ;\"CurrentLoop\" Loop\n\n        ;Increase \"CurrentLoop\" counter\n        IntOp $8 $8 + 1\n\n        StrSearchLoop:\n        ${Do} ;\"String\" Loop\n          ;Remove everything before and after the searched part (\"TempStr\")\n          StrCpy $7 $3 1 $6\n\n          ;Verify if it's the \"String\" end\n          ${If} $6 >= $5\n            ;If \"CurrentLoop\" is what the user wants, remove the part\n            ;after \"TempStr\" and itself and get out of here\n            ${If} $8 == $1\n            ${OrIf} $1 == `L`\n              StrCpy $3 $3 $6\n            ${Else} ;If not, empty \"String\" and get out of here\n              StrCpy $3 ``\n            ${EndIf}\n            StrCpy $R0 `End`\n            ${ExitDo}\n          ${EndIf}\n\n          ;Start \"CurrentSepCharNum\" counter (for \"Separators\" Loop)\n          StrCpy $R0 0\n\n          ${Do} ;\"Separators\" Loop\n            ;Use one \"Separators\" character at a time\n            ${If} $R0 <> 0\n              StrCpy $9 $2 1 $R0\n            ${Else}\n              StrCpy $9 $2 1\n            ${EndIf}\n\n            ;Go to the next \"String\" char if it's \"Separators\" end\n            ${IfThen} $R0 >= $4 ${|} ${ExitDo} ${|}\n\n            ;Or, if \"TempStr\" equals \"CurrentSepChar\", then...\n            ${If} $7 == $9\n              StrCpy $7 $3 $6\n\n              ;If \"String\" is empty because this result part doesn't\n              ;contain data, verify if \"SkipEmptyParts\" is activated,\n              ;so we don't return the output to user yet\n\n              ${If} $7 == ``\n              ${AndIf} $0 = ${TRUE}\n                IntOp $6 $6 + 1\n                StrCpy $3 $3 `` $6\n                StrCpy $6 0\n                Goto StrSearchLoop\n              ${ElseIf} $8 == $1\n                StrCpy $3 $3 $6\n                StrCpy $R0 \"End\"\n                ${ExitDo}\n              ${EndIf} ;If not, go to the next result part\n              IntOp $6 $6 + 1\n              StrCpy $3 $3 `` $6\n              StrCpy $6 0\n              Goto ResultPartLoop\n            ${EndIf}\n\n            ;Increase \"CurrentSepCharNum\" counter\n            IntOp $R0 $R0 + 1\n          ${Loop}\n          ${IfThen} $R0 == \"End\" ${|} ${ExitDo} ${|}\n          \n          ;Increase \"StartCharPos\" counter\n          IntOp $6 $6 + 1\n        ${Loop}\n\n    /*After this point:\n      ------------------------------------------\n       $3 = OutVar (output)*/\n\n      ;Return output to user\n\n      Pop $R0\n      Pop $9\n      Pop $8\n      Pop $7\n      Pop $6\n      Pop $5\n      Pop $4\n      Pop $0\n      Pop $1\n      Pop $2\n      Exch $3\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n  # StrTrimNewLines\n  !insertmacro STRFUNC_DEFFUNC StrTrimNewLines `ResultVar|String` `Output|Text`\n\n  !macro STRFUNC_CALL_StrTrimNewLines un ResultVar String\n    !verbose push ${STRFUNC_VERBOSITY}\n    !echo `${U+24}{${un}StrTrimNewLines} \"${ResultVar}\" \"${String}\"`\n    !verbose 2\n    Push `${String}`\n    !insertmacro STRFUNC_CALL StrTrimNewLines \"${un}\"\n    Pop ${ResultVar}\n    !verbose pop\n  !macroend\n\n  !macro STRFUNC_MAKEFUNC_StrTrimNewLines\n    !insertmacro STRFUNC_BEGINFUNC ${basename} `${un}` `2004 Diego Pedroso - Based on functions by Ximon Eighteen`\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = String (input)\n       $R1 = TrimCounter (temp)\n       $R2 = Temp (temp)*/\n\n      ;Get input from user\n      Exch $R0\n      Push $R1\n      Push $R2\n      \n      ;Initialize trim counter\n      StrCpy $R1 0\n\n      loop:\n        ;Subtract to get \"String\"'s last characters\n        IntOp $R1 $R1 - 1\n\n        ;Verify if they are either $\\r or $\\n\n        StrCpy $R2 $R0 1 $R1\n        ${If} $R2 == `$\\r`\n        ${OrIf} $R2 == `$\\n`\n          Goto loop\n        ${EndIf}\n\n      ;Trim characters (if needed)\n      IntOp $R1 $R1 + 1\n      ${If} $R1 < 0\n        StrCpy $R0 $R0 $R1\n      ${EndIf}\n\n    /*After this point:\n      ------------------------------------------\n       $R0 = OutVar (output)*/\n\n      ;Return output to user\n      Pop $R2\n      Pop $R1\n      Exch $R0\n    !insertmacro STRFUNC_ENDFUNC\n\n  !macroend\n\n  ############################################################################  \n\n!endif\n!verbose 3\n!define STRFUNC_VERBOSITY ${_STRFUNC_VERBOSITY}\n!undef _STRFUNC_VERBOSITY\n!verbose pop\n"
  },
  {
    "path": "setup/nsis/tools/Include/TextFunc.nsh",
    "content": "/*\n_____________________________________________________________________________\n\n                       Text Functions Header v2.4\n_____________________________________________________________________________\n\n 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\n See documentation for more information about the following functions.\n\n Usage in script:\n 1. !include \"TextFunc.nsh\"\n 2. [Section|Function]\n      ${TextFunction} \"File\" \"...\"  $var\n    [SectionEnd|FunctionEnd]\n\n\n TextFunction=[LineFind|LineRead|FileReadFromEnd|LineSum|FileJoin|\n               TextCompare|TextCompareS|ConfigRead|ConfigReadS|\n               ConfigWrite|ConfigWriteS|FileRecode|TrimNewLines]\n\n_____________________________________________________________________________\n\n                       Thanks to:\n_____________________________________________________________________________\n\nLineRead\n\tAfrow UK (Based on his idea of Function \"ReadFileLine\")\nLineSum\n\tAfrow UK (Based on his idea of Function \"LineCount\")\nFileJoin\n\tAfrow UK (Based on his idea of Function \"JoinFiles\")\nConfigRead\n\tvbgunz (His idea)\nConfigWrite\n\tvbgunz (His idea)\nTrimNewLines\n\tsunjammer (Based on his Function \"TrimNewLines\")\n*/\n\n\n;_____________________________________________________________________________\n;\n;                                   Macros\n;_____________________________________________________________________________\n;\n; Change log window verbosity (default: 3=no script)\n;\n; Example:\n; !include \"TextFunc.nsh\"\n; !insertmacro LineFind\n; ${TEXTFUNC_VERBOSE} 4   # all verbosity\n; !insertmacro LineSum\n; ${TEXTFUNC_VERBOSE} 3   # no script\n\n!ifndef TEXTFUNC_INCLUDED\n\n!verbose push 3\n!define /IfNDef _TEXTFUNC_VERBOSE 3\n!verbose ${_TEXTFUNC_VERBOSE}\n!define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE`\n\n!define TEXTFUNC_INCLUDED\n\n!include FileFunc.nsh\n!include Util.nsh\n\n\n!macro TEXTFUNC_VERBOSE _VERBOSE\n\t!verbose push 3\n\t!define /ReDef _TEXTFUNC_VERBOSE ${_VERBOSE}\n\t!verbose pop\n!macroend\n\n!macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush $0\n\tPush `${_INPUT}`\n\tPush `${_OUTPUT}`\n\tPush `${_RANGE}`\n\tGetFunctionAddress $0 `${_FUNC}`\n\tPush `$0`\n\t${CallArtificialFunction} LineFind_\n\tPop $0\n\t!verbose pop\n!macroend\n\n!macro LineReadCall _FILE _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} LineRead_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro FileReadFromEndCall _FILE _FUNC\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush $0\n\tPush `${_FILE}`\n\tGetFunctionAddress $0 `${_FUNC}`\n\tPush `$0`\n\t${CallArtificialFunction} FileReadFromEnd_\n\tPop $0\n\t!verbose pop\n!macroend\n\n!macro LineSumCall _FILE _RESULT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\t${CallArtificialFunction} LineSum_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro FileJoinCall _FILE1 _FILE2 _FILE3\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE1}`\n\tPush `${_FILE2}`\n\tPush `${_FILE3}`\n\t${CallArtificialFunction} FileJoin_\n\t!verbose pop\n!macroend\n\n!macro TextCompareCall _FILE1 _FILE2 _OPTION _FUNC\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush $0\n\tPush `${_FILE1}`\n\tPush `${_FILE2}`\n\tPush `${_OPTION}`\n\tGetFunctionAddress $0 `${_FUNC}`\n\tPush `$0`\n\t${CallArtificialFunction} TextCompare_\n\tPop $0\n\t!verbose pop\n!macroend\n\n!macro TextCompareSCall _FILE1 _FILE2 _OPTION _FUNC\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush $0\n\tPush `${_FILE1}`\n\tPush `${_FILE2}`\n\tPush `${_OPTION}`\n\tGetFunctionAddress $0 `${_FUNC}`\n\tPush `$0`\n\t${CallArtificialFunction} TextCompareS_\n\tPop $0\n\t!verbose pop\n!macroend\n\n!macro ConfigReadCall _FILE _ENTRY _RESULT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\tPush `${_ENTRY}`\n\t${CallArtificialFunction} ConfigRead_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro ConfigReadSCall _FILE _ENTRY _RESULT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\tPush `${_ENTRY}`\n\t${CallArtificialFunction} ConfigReadS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro ConfigWriteCall _FILE _ENTRY _VALUE _RESULT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\tPush `${_ENTRY}`\n\tPush `${_VALUE}`\n\t${CallArtificialFunction} ConfigWrite_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro ConfigWriteSCall _FILE _ENTRY _VALUE _RESULT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\tPush `${_ENTRY}`\n\tPush `${_VALUE}`\n\t${CallArtificialFunction} ConfigWriteS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro FileRecodeCall _FILE _FORMAT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\tPush `${_FORMAT}`\n\t${CallArtificialFunction} FileRecode_\n\t!verbose pop\n!macroend\n\n!macro TrimNewLinesCall _FILE _RESULT\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\tPush `${_FILE}`\n\t${CallArtificialFunction} TrimNewLines_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro _TextFunc_TempFileForFile _FILE _RESULT\n\t# XXX replace with GetParent\n\tPush `${_FILE}`\n\tExch $0\n\tPush $1\n\tPush $2\n\n\tStrCpy $2 $0 1 -1\n\tStrCmp $2 '\\' 0 +3\n\tStrCpy $0 $0 -1\n\tgoto -3\n\n\tStrCpy $1 0\n\tIntOp $1 $1 - 1\n\tStrCpy $2 $0 1 $1\n\tStrCmp $2 '\\' +2\n\tStrCmp $2 '' 0 -3\n\tStrCpy $0 $0 $1\n\n\tPop $2\n\tPop $1\n\tExch $0\n\tPop ${_RESULT}\n\t# XXX\n\tStrCmp ${_RESULT} \"\" 0 +2\n\t\tStrCpy ${_RESULT} $EXEDIR\n\tGetTempFileName ${_RESULT} ${_RESULT}\n\tStrCmp ${_RESULT} \"\" 0 +2\n\t\tGetTempFileName ${_RESULT}\n\tClearErrors\n!macroend\n\n!define LineFind `!insertmacro LineFindCall`\n!define un.LineFind `!insertmacro LineFindCall`\n\n!macro LineFind\n!macroend\n\n!macro un.LineFind\n!macroend\n\n!macro LineFind_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\tExch $3\n\tExch\n\tExch $2\n\tExch\n\tExch 2\n\tExch $1\n\tExch 2\n\tExch 3\n\tExch $0\n\tExch 3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R4\n\tPush $R5\n\tPush $R6\n\tPush $R7\n\tPush $R8\n\tPush $R9\n\tClearErrors\n\n\tIfFileExists '$0' 0 TextFunc_LineFind_error\n\tStrCmp $1 '/NUL' TextFunc_LineFind_begin\n\tStrCpy $8 0\n\tIntOp $8 $8 - 1\n\tStrCpy $9 $1 1 $8\n\tStrCmp $9 \\ +2\n\tStrCmp $9 '' +3 -3\n\tStrCpy $9 $1 $8\n\tIfFileExists '$9\\*.*' 0 TextFunc_LineFind_error\n\n\tTextFunc_LineFind_begin:\n\tStrCpy $4 1\n\tStrCpy $5 -1\n\tStrCpy $6 0\n\tStrCpy $7 0\n\tStrCpy $R4 ''\n\tStrCpy $R6 ''\n\tStrCpy $R7 ''\n\tStrCpy $R8 0\n\n\tStrCpy $8 $2 1\n\tStrCmp $8 '{' 0 TextFunc_LineFind_delspaces\n\tStrCpy $2 $2 '' 1\n\tStrCpy $8 $2 1 -1\n\tStrCmp $8 '}' 0 TextFunc_LineFind_delspaces\n\tStrCpy $2 $2 -1\n\tStrCpy $R6 TextFunc_LineFind_cut\n\n\tTextFunc_LineFind_delspaces:\n\tStrCpy $8 $2 1\n\tStrCmp $8 ' ' 0 +3\n\tStrCpy $2 $2 '' 1\n\tgoto -3\n\tStrCmp $2$7 '0' TextFunc_LineFind_file\n\tStrCpy $4 ''\n\tStrCpy $5 ''\n\tStrCmp $2 '' TextFunc_LineFind_writechk\n\n\tTextFunc_LineFind_range:\n\tStrCpy $8 0\n\tStrCpy $9 $2 1 $8\n\tStrCmp $9 '' +5\n\tStrCmp $9 ' ' +4\n\tStrCmp $9 ':' +3\n\tIntOp $8 $8 + 1\n\tgoto -5\n\tStrCpy $5 $2 $8\n\tIntOp $5 $5 + 0\n\tIntOp $8 $8 + 1\n\tStrCpy $2 $2 '' $8\n\tStrCmp $4 '' 0 +2\n\tStrCpy $4 $5\n\tStrCmp $9 ':' TextFunc_LineFind_range\n\n\tIntCmp $4 0 0 +2\n\tIntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp\n\tStrCmp $R7 '' 0 TextFunc_LineFind_minus2plus\n\tStrCpy $R7 0\n\tFileOpen $8 $0 r\n\tFileRead $8 $9\n\tIfErrors +3\n\tIntOp $R7 $R7 + 1\n\tGoto -3\n\tFileClose $8\n\n\tTextFunc_LineFind_minus2plus:\n\tIntCmp $4 0 +5 0 +5\n\tIntOp $4 $R7 + $4\n\tIntOp $4 $4 + 1\n\tIntCmp $4 0 +2 0 +2\n\tStrCpy $4 0\n\tIntCmp $5 -1 TextFunc_LineFind_goto 0 TextFunc_LineFind_growthcmp\n\tIntOp $5 $R7 + $5\n\tIntOp $5 $5 + 1\n\tTextFunc_LineFind_growthcmp:\n\tIntCmp $4 $5 TextFunc_LineFind_goto TextFunc_LineFind_goto\n\tStrCpy $5 $4\n\tTextFunc_LineFind_goto:\n\tgoto $7\n\n\tTextFunc_LineFind_file:\n\tStrCmp $1 '/NUL' TextFunc_LineFind_notemp\n\t!insertmacro _TextFunc_TempFileForFile $1 $R4\n\tPush $R4\n\tFileOpen $R4 $R4 w\n\tTextFunc_LineFind_notemp:\n\tFileOpen $R5 $0 r\n\tIfErrors TextFunc_LineFind_preerror\n\n\tTextFunc_LineFind_loop:\n\tIntOp $R8 $R8 + 1\n\tFileRead $R5 $R9\n\tIfErrors TextFunc_LineFind_handleclose\n\n\tTextFunc_LineFind_cmp:\n\tStrCmp $2$4$5 '' TextFunc_LineFind_writechk\n\tIntCmp $4 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_writechk\n\tStrCmp $5 -1 TextFunc_LineFind_call\n\tIntCmp $5 $R8 TextFunc_LineFind_call 0 TextFunc_LineFind_call\n\n\tGetLabelAddress $7 TextFunc_LineFind_cmp\n\tgoto TextFunc_LineFind_delspaces\n\n\tTextFunc_LineFind_call:\n\tStrCpy $7 $R9\n\tPush $0\n\tPush $1\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $R4\n\tPush $R5\n\tPush $R6\n\tPush $R7\n\tPush $R8\n\tStrCpy $R6 '$4:$5'\n\tStrCmp $R7 '' +3\n\tIntOp $R7 $R8 - $R7\n\tIntOp $R7 $R7 - 1\n\tCall $3\n\tPop $9\n\tPop $R8\n\tPop $R7\n\tPop $R6\n\tPop $R5\n\tPop $R4\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tIfErrors TextFunc_LineFind_preerror\n\tStrCmp $9 'StopLineFind' 0 +3\n\tIntOp $6 $6 + 1\n\tgoto TextFunc_LineFind_handleclose\n\tStrCmp $1 '/NUL' TextFunc_LineFind_loop\n\tStrCmp $9 'SkipWrite' 0 +3\n\tIntOp $6 $6 + 1\n\tgoto TextFunc_LineFind_loop\n\tStrCmp $7 $R9 TextFunc_LineFind_write\n\tIntOp $6 $6 + 1\n\tgoto TextFunc_LineFind_write\n\n\tTextFunc_LineFind_writechk:\n\tStrCmp $1 '/NUL' TextFunc_LineFind_loop\n\tStrCmp $R6 TextFunc_LineFind_cut 0 TextFunc_LineFind_write\n\tIntOp $6 $6 + 1\n\tgoto TextFunc_LineFind_loop\n\n\tTextFunc_LineFind_write:\n\tFileWrite $R4 $R9\n\tgoto TextFunc_LineFind_loop\n\n\tTextFunc_LineFind_preerror:\n\tSetErrors\n\n\tTextFunc_LineFind_handleclose:\n\tStrCmp $1 '/NUL' +3\n\tFileClose $R4\n\tPop $R4\n\tFileClose $R5\n\tIfErrors TextFunc_LineFind_error\n\n\tStrCmp $1 '/NUL' TextFunc_LineFind_end\n\tStrCmp $1 '' 0 +2\n\tStrCpy $1 $0\n\tStrCmp $6 0 0 TextFunc_LineFind_rename\n\tFileOpen $7 $0 r\n\tFileSeek $7 0 END $8\n\tFileClose $7\n\tFileOpen $7 $R4 r\n\tFileSeek $7 0 END $9\n\tFileClose $7\n\tIntCmp $8 $9 0 TextFunc_LineFind_rename\n\tDelete $R4\n\tStrCmp $1 $0 TextFunc_LineFind_end\n\tCopyFiles /SILENT $0 $1\n\tgoto TextFunc_LineFind_end\n\n\tTextFunc_LineFind_rename:\n\tDelete '$EXEDIR\\$1'\n\tRename $R4 '$EXEDIR\\$1'\n\tIfErrors 0 TextFunc_LineFind_end\n\tDelete $1\n\tRename $R4 $1\n\tIfErrors 0 TextFunc_LineFind_end\n\n\tTextFunc_LineFind_error:\n\tSetErrors\n\n\tTextFunc_LineFind_end:\n\tPop $R9\n\tPop $R8\n\tPop $R7\n\tPop $R6\n\tPop $R5\n\tPop $R4\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\n\t!verbose pop\n!macroend\n\n!define LineRead `!insertmacro LineReadCall`\n!define un.LineRead `!insertmacro LineReadCall`\n\n!macro LineRead\n!macroend\n\n!macro un.LineRead\n!macroend\n\n!macro LineRead_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tClearErrors\n\n\tIfFileExists $0 0 TextFunc_LineRead_error\n\tIntOp $1 $1 + 0\n\tIntCmp $1 0 TextFunc_LineRead_error 0 TextFunc_LineRead_plus\n\tStrCpy $4 0\n\tFileOpen $2 $0 r\n\tIfErrors TextFunc_LineRead_error\n\tFileRead $2 $3\n\tIfErrors +3\n\tIntOp $4 $4 + 1\n\tGoto -3\n\tFileClose $2\n\tIntOp $1 $4 + $1\n\tIntOp $1 $1 + 1\n\tIntCmp $1 0 TextFunc_LineRead_error TextFunc_LineRead_error\n\n\tTextFunc_LineRead_plus:\n\tFileOpen $2 $0 r\n\tIfErrors TextFunc_LineRead_error\n\tStrCpy $3 0\n\tIntOp $3 $3 + 1\n\tFileRead $2 $0\n\tIfErrors +4\n\tStrCmp $3 $1 0 -3\n\tFileClose $2\n\tgoto TextFunc_LineRead_end\n\tFileClose $2\n\n\tTextFunc_LineRead_error:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tTextFunc_LineRead_end:\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define FileReadFromEnd `!insertmacro FileReadFromEndCall`\n!define un.FileReadFromEnd `!insertmacro FileReadFromEndCall`\n\n!macro FileReadFromEnd\n!macroend\n\n!macro un.FileReadFromEnd\n!macroend\n\n!macro FileReadFromEnd_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $7\n\tPush $8\n\tPush $9\n\tClearErrors\n\n\tStrCpy $7 -1\n\tStrCpy $8 0\n\tIfFileExists $0 0 TextFunc_FileReadFromEnd_error\n\tFileOpen $0 $0 r\n\tIfErrors TextFunc_FileReadFromEnd_error\n\tFileRead $0 $9\n\tIfErrors +4\n\tPush $9\n\tIntOp $8 $8 + 1\n\tgoto -4\n\tFileClose $0\n\n\tTextFunc_FileReadFromEnd_nextline:\n\tStrCmp $8 0 TextFunc_FileReadFromEnd_end\n\tPop $9\n\tPush $1\n\tPush $7\n\tPush $8\n\tCall $1\n\tPop $0\n\tPop $8\n\tPop $7\n\tPop $1\n\tIntOp $7 $7 - 1\n\tIntOp $8 $8 - 1\n\tIfErrors TextFunc_FileReadFromEnd_error\n\tStrCmp $0 'StopFileReadFromEnd' TextFunc_FileReadFromEnd_clearstack TextFunc_FileReadFromEnd_nextline\n\n\tTextFunc_FileReadFromEnd_error:\n\tSetErrors\n\n\tTextFunc_FileReadFromEnd_clearstack:\n\tStrCmp $8 0 TextFunc_FileReadFromEnd_end\n\tPop $9\n\tIntOp $8 $8 - 1\n\tgoto TextFunc_FileReadFromEnd_clearstack\n\n\tTextFunc_FileReadFromEnd_end:\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $1\n\tPop $0\n\n\t!verbose pop\n!macroend\n\n!define LineSum `!insertmacro LineSumCall`\n!define un.LineSum `!insertmacro LineSumCall`\n\n!macro LineSum\n!macroend\n\n!macro un.LineSum\n!macroend\n\n!macro LineSum_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\tExch $0\n\tPush $1\n\tPush $2\n\tClearErrors\n\n\tIfFileExists $0 0 TextFunc_LineSum_error\n\tStrCpy $2 0\n\tFileOpen $0 $0 r\n\tIfErrors TextFunc_LineSum_error\n\tFileRead $0 $1\n\tIfErrors +3\n\tIntOp $2 $2 + 1\n\tGoto -3\n\tFileClose $0\n\tStrCpy $0 $2\n\tgoto TextFunc_LineSum_end\n\n\tTextFunc_LineSum_error:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tTextFunc_LineSum_end:\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define FileJoin `!insertmacro FileJoinCall`\n!define un.FileJoin `!insertmacro FileJoinCall`\n\n!macro FileJoin\n!macroend\n\n!macro un.FileJoin\n!macroend\n\n!macro FileJoin_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\tExch $2\n\tExch\n\tExch $1\n\tExch\n\tExch 2\n\tExch $0\n\tExch 2\n\tPush $3\n\tPush $4\n\tPush $5\n\tClearErrors\n\n\tIfFileExists $0 0 TextFunc_FileJoin_error\n\tIfFileExists $1 0 TextFunc_FileJoin_error\n\tStrCpy $3 0\n\tIntOp $3 $3 - 1\n\tStrCpy $4 $2 1 $3\n\tStrCmp $4 \\ +2\n\tStrCmp $4 '' +3 -3\n\tStrCpy $4 $2 $3\n\tIfFileExists '$4\\*.*' 0 TextFunc_FileJoin_error\n\n\tStrCmp $2 $0 0 +2\n\tStrCpy $2 ''\n\tStrCmp $2 '' 0 +3\n\tStrCpy $4 $0\n\tGoto TextFunc_FileJoin_notemp\n\t!insertmacro _TextFunc_TempFileForFile $2 $4\n\tCopyFiles /SILENT $0 $4\n\tTextFunc_FileJoin_notemp:\n\tFileOpen $3 $4 a\n\tIfErrors TextFunc_FileJoin_error\n\tFileSeek $3 -1 END\n\tFileRead $3 $5\n\tStrCmp $5 '$\\r' +3\n\tStrCmp $5 '$\\n' +2\n\tFileWrite $3 '$\\r$\\n'\n\n\t;FileWrite $3 '$\\r$\\n--Divider--$\\r$\\n'\n\n\tFileOpen $0 $1 r\n\tIfErrors TextFunc_FileJoin_error\n\tFileRead $0 $5\n\tIfErrors +3\n\tFileWrite $3 $5\n\tgoto -3\n\tFileClose $0\n\tFileClose $3\n\tStrCmp $2 '' TextFunc_FileJoin_end\n\tDelete '$EXEDIR\\$2'\n\tRename $4 '$EXEDIR\\$2'\n\tIfErrors 0 TextFunc_FileJoin_end\n\tDelete $2\n\tRename $4 $2\n\tIfErrors 0 TextFunc_FileJoin_end\n\n\tTextFunc_FileJoin_error:\n\tSetErrors\n\n\tTextFunc_FileJoin_end:\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\n\t!verbose pop\n!macroend\n\n!macro TextCompareBody _TEXTFUNC_S\n\tExch $3\n\tExch\n\tExch $2\n\tExch\n\tExch 2\n\tExch $1\n\tExch 2\n\tExch 3\n\tExch $0\n\tExch 3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tClearErrors\n\n\tIfFileExists $0 0 TextFunc_TextCompare${_TEXTFUNC_S}_error\n\tIfFileExists $1 0 TextFunc_TextCompare${_TEXTFUNC_S}_error\n\tStrCmp $2 'FastDiff' +5\n\tStrCmp $2 'FastEqual' +4\n\tStrCmp $2 'SlowDiff' +3\n\tStrCmp $2 'SlowEqual' +2\n\tgoto TextFunc_TextCompare${_TEXTFUNC_S}_error\n\n\tFileOpen $4 $0 r\n\tIfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error\n\tFileOpen $5 $1 r\n\tIfErrors TextFunc_TextCompare${_TEXTFUNC_S}_error\n\tSetDetailsPrint textonly\n\n\tStrCpy $6 0\n\tStrCpy $8 0\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_nextline:\n\tStrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_fast\n\tIntOp $8 $8 + 1\n\tFileRead $4 $9\n\tIfErrors 0 +4\n\tFileClose $4\n\tStrCpy $4 ''\n\tStrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_end\n\tStrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_fast\n\tStrCmp $2 'FastEqual' TextFunc_TextCompare${_TEXTFUNC_S}_fast TextFunc_TextCompare${_TEXTFUNC_S}_slow\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_fast:\n\tStrCmp${_TEXTFUNC_S} $5 '' TextFunc_TextCompare${_TEXTFUNC_S}_call\n\tIntOp $6 $6 + 1\n\tFileRead $5 $7\n\tIfErrors 0 +5\n\tFileClose $5\n\tStrCpy $5 ''\n\tStrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_end\n\tStrCmp $2 'FastDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_close\n\tStrCmp $2 'FastDiff' 0 +2\n\tStrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_call\n\tStrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_slow:\n\tStrCmp${_TEXTFUNC_S} $4 '' TextFunc_TextCompare${_TEXTFUNC_S}_close\n\tStrCpy $6 ''\n\tDetailPrint '$8. $9'\n\tFileSeek $5 0\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_slownext:\n\tFileRead $5 $7\n\tIfErrors 0 +2\n\tStrCmp $2 'SlowDiff' TextFunc_TextCompare${_TEXTFUNC_S}_call TextFunc_TextCompare${_TEXTFUNC_S}_nextline\n\tStrCmp $2 'SlowDiff' 0 +2\n\tStrCmp${_TEXTFUNC_S} $7 $9 TextFunc_TextCompare${_TEXTFUNC_S}_nextline TextFunc_TextCompare${_TEXTFUNC_S}_slownext\n\tIntOp $6 $6 + 1\n\tStrCmp${_TEXTFUNC_S} $7 $9 0 TextFunc_TextCompare${_TEXTFUNC_S}_slownext\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_call:\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tCall $3\n\tPop $0\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tStrCmp $0 'StopTextCompare' 0 TextFunc_TextCompare${_TEXTFUNC_S}_nextline\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_close:\n\tFileClose $4\n\tFileClose $5\n\tgoto TextFunc_TextCompare${_TEXTFUNC_S}_end\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_error:\n\tSetErrors\n\n\tTextFunc_TextCompare${_TEXTFUNC_S}_end:\n\tSetDetailsPrint both\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n!macroend\n\n!define TextCompare `!insertmacro TextCompareCall`\n!define un.TextCompare `!insertmacro TextCompareCall`\n\n!macro TextCompare\n!macroend\n\n!macro un.TextCompare\n!macroend\n\n!macro TextCompare_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\t!insertmacro TextCompareBody ''\n\n\t!verbose pop\n!macroend\n\n!define TextCompareS `!insertmacro TextCompareSCall`\n!define un.TextCompareS `!insertmacro TextCompareSCall`\n\n!macro TextCompareS\n!macroend\n\n!macro un.TextCompareS\n!macroend\n\n!macro TextCompareS_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\t!insertmacro TextCompareBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro ConfigReadBody _TEXTFUNC_S\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tClearErrors\n\n\tFileOpen $2 $0 r\n\tIfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error\n\tStrLen $0 $1\n\tStrCmp${_TEXTFUNC_S} $0 0 TextFunc_ConfigRead${_TEXTFUNC_S}_error\n\n\tTextFunc_ConfigRead${_TEXTFUNC_S}_readnext:\n\tFileRead $2 $3\n\tIfErrors TextFunc_ConfigRead${_TEXTFUNC_S}_error\n\tStrCpy $4 $3 $0\n\tStrCmp${_TEXTFUNC_S} $4 $1 0 TextFunc_ConfigRead${_TEXTFUNC_S}_readnext\n\tStrCpy $0 $3 '' $0\n\tStrCpy $4 $0 1 -1\n\tStrCmp${_TEXTFUNC_S} $4 '$\\r' +2\n\tStrCmp${_TEXTFUNC_S} $4 '$\\n' 0 TextFunc_ConfigRead${_TEXTFUNC_S}_close\n\tStrCpy $0 $0 -1\n\tgoto -4\n\n\tTextFunc_ConfigRead${_TEXTFUNC_S}_error:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tTextFunc_ConfigRead${_TEXTFUNC_S}_close:\n\tFileClose $2\n\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n!macroend\n\n!define ConfigRead `!insertmacro ConfigReadCall`\n!define un.ConfigRead `!insertmacro ConfigReadCall`\n\n!macro ConfigRead\n!macroend\n\n!macro un.ConfigRead\n!macroend\n\n!macro ConfigRead_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\t!insertmacro ConfigReadBody ''\n\n\t!verbose pop\n!macroend\n\n!define ConfigReadS `!insertmacro ConfigReadSCall`\n!define un.ConfigReadS `!insertmacro ConfigReadSCall`\n\n!macro ConfigReadS\n!macroend\n\n!macro un.ConfigReadS\n!macroend\n\n!macro ConfigReadS_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\t!insertmacro ConfigReadBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro ConfigWriteBody _TEXTFUNC_S\n\tExch $2\n\tExch\n\tExch $1\n\tExch\n\tExch 2\n\tExch $0\n\tExch 2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tClearErrors\n\n\tIfFileExists $0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_error\n\tFileOpen $3 $0 a\n\tIfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_error\n\n\tStrLen $0 $1\n\tStrCmp${_TEXTFUNC_S} $0 0 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext\n\tStrCpy $0 ''\n\tgoto TextFunc_ConfigWrite${_TEXTFUNC_S}_close\n\n\tTextFunc_ConfigWrite${_TEXTFUNC_S}_readnext:\n\tFileRead $3 $4\n\tIfErrors TextFunc_ConfigWrite${_TEXTFUNC_S}_add\n\tStrCpy $5 $4 $0\n\tStrCmp${_TEXTFUNC_S} $5 $1 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_readnext\n\n\tStrCpy $5 0\n\tIntOp $5 $5 - 1\n\tStrCpy $6 $4 1 $5\n\tStrCmp${_TEXTFUNC_S} $6 '$\\r' -2\n\tStrCmp${_TEXTFUNC_S} $6 '$\\n' -3\n\tStrCpy $6 $4\n\tStrCmp${_TEXTFUNC_S} $5 -1 +3\n\tIntOp $5 $5 + 1\n\tStrCpy $6 $4 $5\n\n\tStrCmp${_TEXTFUNC_S} $2 '' TextFunc_ConfigWrite${_TEXTFUNC_S}_change\n\tStrCmp${_TEXTFUNC_S} $6 '$1$2' 0 TextFunc_ConfigWrite${_TEXTFUNC_S}_change\n\tStrCpy $0 SAME\n\tgoto TextFunc_ConfigWrite${_TEXTFUNC_S}_close\n\n\tTextFunc_ConfigWrite${_TEXTFUNC_S}_change:\n\tFileSeek $3 0 CUR $5\n\tStrLen $4 $4\n\tIntOp $4 $5 - $4\n\tFileSeek $3 0 END $6\n\tIntOp $6 $6 - $5\n\n\tSystem::Alloc $6\n\tPop $0\n\tFileSeek $3 $5 SET\n\tSystem::Call 'kernel32::ReadFile(p r3, p r0, i $6, t.,)'\n\tFileSeek $3 $4 SET\n\tStrCmp${_TEXTFUNC_S} $2 '' +2\n\tFileWrite $3 '$1$2$\\r$\\n'\n\tSystem::Call 'kernel32::WriteFile(p r3, p r0, i $6, t.,)'\n\tSystem::Call 'kernel32::SetEndOfFile(p r3)'\n\tSystem::Free $0\n\tStrCmp${_TEXTFUNC_S} $2 '' +3\n\tStrCpy $0 CHANGED\n\tgoto TextFunc_ConfigWrite${_TEXTFUNC_S}_close\n\tStrCpy $0 DELETED\n\tgoto TextFunc_ConfigWrite${_TEXTFUNC_S}_close\n\n\tTextFunc_ConfigWrite${_TEXTFUNC_S}_add:\n\tStrCmp${_TEXTFUNC_S} $2 '' 0 +3\n\tStrCpy $0 SAME\n\tgoto TextFunc_ConfigWrite${_TEXTFUNC_S}_close\n\tFileSeek $3 -1 END\n\tFileRead $3 $4\n\tIfErrors +4\n\tStrCmp${_TEXTFUNC_S} $4 '$\\r' +3\n\tStrCmp${_TEXTFUNC_S} $4 '$\\n' +2\n\tFileWrite $3 '$\\r$\\n'\n\tFileWrite $3 '$1$2$\\r$\\n'\n\tStrCpy $0 ADDED\n\n\tTextFunc_ConfigWrite${_TEXTFUNC_S}_close:\n\tFileClose $3\n\tgoto TextFunc_ConfigWrite${_TEXTFUNC_S}_end\n\n\tTextFunc_ConfigWrite${_TEXTFUNC_S}_error:\n\tSetErrors\n\tStrCpy $0 ''\n\n\tTextFunc_ConfigWrite${_TEXTFUNC_S}_end:\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n!macroend\n\n!define ConfigWrite `!insertmacro ConfigWriteCall`\n!define un.ConfigWrite `!insertmacro ConfigWriteCall`\n\n!macro ConfigWrite\n!macroend\n\n!macro un.ConfigWrite\n!macroend\n\n!macro ConfigWrite_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\t!insertmacro ConfigWriteBody ''\n\n\t!verbose pop\n!macroend\n\n!define ConfigWriteS `!insertmacro ConfigWriteSCall`\n!define un.ConfigWriteS `!insertmacro ConfigWriteSCall`\n\n!macro ConfigWriteS\n!macroend\n\n!macro un.ConfigWriteS\n!macroend\n\n!macro ConfigWriteS_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\t!insertmacro ConfigWriteBody 'S'\n\n\t!verbose pop\n!macroend\n\n!define FileRecode `!insertmacro FileRecodeCall`\n!define un.FileRecode `!insertmacro FileRecodeCall`\n\n!macro FileRecode\n!macroend\n\n!macro un.FileRecode\n!macroend\n\n!macro FileRecode_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\n\tIfFileExists $0 0 TextFunc_FileRecode_error\n\tStrCmp $1 OemToChar +2\n\tStrCmp $1 CharToOem 0 TextFunc_FileRecode_error\n\n\tFileOpen $2 $0 a\n\tFileSeek $2 0 END $3\n\tSystem::Alloc $3\n\tPop $4\n\tFileSeek $2 0 SET\n\tSystem::Call 'kernel32::ReadFile(p r2, p r4, i $3, t.,)'\n\tSystem::Call 'user32::$1Buff(p r4, p r4, i $3)'\n\tFileSeek $2 0 SET\n\tSystem::Call 'kernel32::WriteFile(p r2, p r4, i $3, t.,)'\n\tSystem::Free $4\n\tFileClose $2\n\tgoto TextFunc_FileRecode_end\n\n\tTextFunc_FileRecode_error:\n\tSetErrors\n\n\tTextFunc_FileRecode_end:\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\n\t!verbose pop\n!macroend\n\n!define TrimNewLines `!insertmacro TrimNewLinesCall`\n!define un.TrimNewLines `!insertmacro TrimNewLinesCall`\n\n!macro TrimNewLines\n!macroend\n\n!macro un.TrimNewLines\n!macroend\n\n!macro TrimNewLines_\n\t!verbose push\n\t!verbose ${_TEXTFUNC_VERBOSE}\n\n\tExch $0\n\tPush $1\n\tPush $2\n\n\tStrCpy $1 0\n\tIntOp $1 $1 - 1\n\tStrCpy $2 $0 1 $1\n\tStrCmp $2 '$\\r' -2\n\tStrCmp $2 '$\\n' -3\n\tStrCmp $1 -1 +3\n\tIntOp $1 $1 + 1\n\tStrCpy $0 $0 $1\n\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/UMUI.nsh",
    "content": "!include \"${NSISDIR}\\Contrib\\UltraModernUI\\UMUI.nsh\"\n"
  },
  {
    "path": "setup/nsis/tools/Include/UpgradeDLL.nsh",
    "content": "/*\n\nNOTE:\n-----\nThis macro is provided for backwards compatibility with NSIS 2.0 scripts.\nIt's recommended you update your scripts to use the new Library.nsh macros.\n\n\nMacro - Upgrade DLL File\nWritten by Joost Verburg\n------------------------\n\nParameters:\nLOCALFILE\t\tLocation of the new DLL file (on the compiler system)\nDESTFILE\t\tLocation of the DLL file that should be upgraded (on the user's system)\nTEMPBASEDIR\t\tDirectory on the user's system to store a temporary file when the system has\n\t\t\t\tto be rebooted.\n\t\t\t\tFor Win9x/ME support, this should be on the same volume as DESTFILE.\n\t\t\t\tThe Windows temp directory could be located on any volume, so you cannot use\n\t\t\t\tthis directory.\n\nDefine UPGRADEDLL_NOREGISTER if you want to upgrade a DLL that does not have to be registered.\n\nNotes:\n\n* If you want to support Windows 9x/ME, you can only use short filenames (8.3).\n\n* This macro uses the GetDLLVersionLocal command to retrieve the version of local libraries.\n  This command is only supported when compiling on a Windows system.\n\n------------------------\n\nExample:\n\n!insertmacro UpgradeDLL \"dllname.dll\" \"$SYSDIR\\dllname.dll\" \"$SYSDIR\"\n\n*/\n\n!ifndef UPGRADEDLL_INCLUDED\n\n!define UPGRADEDLL_INCLUDED\n\n!macro __UpgradeDLL_Helper_AddRegToolEntry mode filename tempdir\n\n  Push $R0\n  Push $R1\n  Push $R2\n  Push $R3\n\n  ;------------------------\n  ;Copy the parameters\n\n  Push \"${filename}\"\n  Push \"${tempdir}\"\n\n  Pop $R2 ; temporary directory\n  Pop $R1 ; file name to register\n\n  ;------------------------\n  ;Advance counter\n\n  StrCpy $R0 0\n  ReadRegDWORD $R0 HKLM \"Software\\NSIS.Library.RegTool.v3\\UpgradeDLLSession\" \"count\"\n  IntOp $R0 $R0 + 1\n  WriteRegDWORD HKLM \"Software\\NSIS.Library.RegTool.v3\\UpgradeDLLSession\" \"count\" \"$R0\"\n\n  ;------------------------\n  ;Setup RegTool\n\n  !if ! /FileExists \"${NSISDIR}\\Bin\\RegTool-${NSIS_CPU}.bin\"\n    !error \"Missing RegTool for ${NSIS_CPU}!\"\n  !endif\n\n  ReadRegStr $R3 HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\" \"NSIS.Library.RegTool.v3\"\n  StrCpy $R3 $R3 -4 1\n  IfFileExists $R3 +3\n\n    File /oname=$R2\\NSIS.Library.RegTool.v3.$HWNDPARENT.exe \"${NSISDIR}\\Bin\\RegTool-${NSIS_CPU}.bin\"\n    WriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\" \\\n      \"NSIS.Library.RegTool.v3\" '\"$R2\\NSIS.Library.RegTool.v3.$HWNDPARENT.exe\" /S'\n\n  ;------------------------\n  ;Add RegTool entry\n\n  WriteRegStr HKLM \"Software\\NSIS.Library.RegTool.v3\\UpgradeDLLSession\" \"$R0.file\" \"$R1\"\n  WriteRegStr HKLM \"Software\\NSIS.Library.RegTool.v3\\UpgradeDLLSession\" \"$R0.mode\" \"${mode}\"\n\n  Pop $R3\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n!macroend\n\n!macro UpgradeDLL LOCALFILE DESTFILE TEMPBASEDIR\n\n  Push $R0\n  Push $R1\n  Push $R2\n  Push $R3\n  Push $R4\n  Push $R5\n\n  !define UPGRADEDLL_UNIQUE \"${__FILE__}${__LINE__}\"\n\n  SetOverwrite try\n\n  ;------------------------\n  ;Copy the macro parameters to a run-time to a variable, \n  ;this allows the usage of variables as parameter\n\n  StrCpy $R4 \"${DESTFILE}\"\n  StrCpy $R5 \"${TEMPBASEDIR}\"\n\n  ;------------------------\n  ;Get version information\n\n  IfFileExists $R4 0 \"upgradedll.copy_${UPGRADEDLL_UNIQUE}\"\n\n  ClearErrors\n    GetDLLVersionLocal \"${LOCALFILE}\" $R0 $R1\n    GetDLLVersion $R4 $R2 $R3\n  IfErrors \"upgradedll.upgrade_${UPGRADEDLL_UNIQUE}\"\n\n  IntCmpU $R0 $R2 0 \"upgradedll.done_${UPGRADEDLL_UNIQUE}\" \"upgradedll.upgrade_${UPGRADEDLL_UNIQUE}\"\n  IntCmpU $R1 $R3 \"upgradedll.done_${UPGRADEDLL_UNIQUE}\" \"upgradedll.done_${UPGRADEDLL_UNIQUE}\" \\\n    \"upgradedll.upgrade_${UPGRADEDLL_UNIQUE}\"\n\n  ;------------------------\n  ;Upgrade\n\n  \"upgradedll.upgrade_${UPGRADEDLL_UNIQUE}:\"\n    !ifndef UPGRADEDLL_NOREGISTER\n      ;Unregister the DLL\n      UnRegDLL $R4\n    !endif\n\n  ;------------------------\n  ;Copy\n\n  ClearErrors\n    StrCpy $R0 $R4\n    Call \":upgradedll.file_${UPGRADEDLL_UNIQUE}\"\n  IfErrors 0 \"upgradedll.noreboot_${UPGRADEDLL_UNIQUE}\"\n\n  ;------------------------\n  ;Copy on reboot\n\n  GetTempFileName $R0 $R5\n    Call \":upgradedll.file_${UPGRADEDLL_UNIQUE}\"\n  Rename /REBOOTOK $R0 $R4\n\n  ;------------------------\n  ;Register on reboot\n\n  !insertmacro __UpgradeDLL_Helper_AddRegToolEntry 'D' $R4 $R5\n\n  Goto \"upgradedll.done_${UPGRADEDLL_UNIQUE}\"\n\n  ;------------------------\n  ;DLL does not exist\n\n  \"upgradedll.copy_${UPGRADEDLL_UNIQUE}:\"\n    StrCpy $R0 $R4\n    Call \":upgradedll.file_${UPGRADEDLL_UNIQUE}\"\n\n  ;------------------------\n  ;Register\n\n  \"upgradedll.noreboot_${UPGRADEDLL_UNIQUE}:\"\n    !ifndef UPGRADEDLL_NOREGISTER\n      RegDLL $R4\n    !endif\n\n  ;------------------------\n  ;Done\n\n  \"upgradedll.done_${UPGRADEDLL_UNIQUE}:\"\n\n  Pop $R5\n  Pop $R4\n  Pop $R3\n  Pop $R2\n  Pop $R1\n  Pop $R0\n\n  ;------------------------\n  ;End\n\n  Goto \"upgradedll.end_${UPGRADEDLL_UNIQUE}\"\n\n  ;------------------------\n  ;Extract\n\n  \"upgradedll.file_${UPGRADEDLL_UNIQUE}:\"\n    File /oname=$R0 \"${LOCALFILE}\"\n    Return\n\n  \"upgradedll.end_${UPGRADEDLL_UNIQUE}:\"\n\n  SetOverwrite lastused\n  \n  !undef UPGRADEDLL_UNIQUE\n\n!macroend\n\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/Util.nsh",
    "content": "; ---------------------\n;       Util.nsh\n; ---------------------\n;\n; Voodoo macros to make end-user usage easier. This may be documented someday.\n\n!verbose push 3\n!ifndef ___UTIL__NSH___\n!define ___UTIL__NSH___\n\n# CallArtificialFunction, see WinVer.nsh and *Func.nsh for usage examples\n!macro CallArtificialFunctionHelper TYPE NAME\n  !verbose pop\n  Call :.${NAME}${TYPE}\n  !ifndef ${NAME}${TYPE}_DEFINED\n    !verbose push 2\n    Goto ${NAME}${TYPE}_DONE\n    !define ${NAME}${TYPE}_DEFINED\n    !verbose pop\n    .${NAME}${TYPE}:\n      !insertmacro ${NAME}\n      Return\n    ${NAME}${TYPE}_DONE:\n  !endif\n  !verbose push 2\n!macroend\n\n!macro CallArtificialFunction NAME\n  !verbose push 2\n  !ifdef __UNINSTALL__\n    !insertmacro CallArtificialFunctionHelper uninst ${NAME}\n  !else\n    !insertmacro CallArtificialFunctionHelper inst ${NAME}\n  !endif\n  !verbose pop\n!macroend\n!define CallArtificialFunction `!insertmacro CallArtificialFunction`\n\n!macro CallArtificialFunction2 NAME ; Retained for v2.4x..v3.0b0 compatibility\n  ${CallArtificialFunction} ${NAME}\n!macroend\n!define CallArtificialFunction2 `!insertmacro CallArtificialFunction`\n\n\n!define Int32Op '!insertmacro Int32Op '\n!define Int64Op '!insertmacro Int64Op '\n!define IntPtrOp '!insertmacro IntPtrOp '\n!macro Int32Op r a o b\nIntOp `${r}` `${a}` `${o}` ${b}\n!macroend\n!macro Int64Op r a o b\n!echo \"Int64Op ${r}=${a}${o}${b}\"\n!verbose push 2\nSystem::Int64Op `${a}` `${o}` ${b}\nPop ${r}\n!verbose pop\n!macroend\n!macro IntPtrOp r a o b\nIntPtrOp `${r}` `${a}` `${o}` `${b}`\n!macroend\n\n!define Int32Cmp '!insertmacro Int32Cmp '\n!define Int64Cmp '!insertmacro Int64Cmp '\n!define IntPtrCmp '!insertmacro IntPtrCmp '\n!macro Int32Cmp a b jeek jles jgtr\nIntCmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`\n!macroend\n!macro Int64Cmp a b jeek jles jgtr\n!if ${NSIS_PTR_SIZE} <= 4\n!ifmacrondef _LOGICLIB_TEMP\n!include LogicLib.nsh\n!endif\n!echo \"Int64Cmp ${a}:${b} =${jeek}, <${jles}, >${jgtr}\"\n!verbose push 2\n${IfThen} ${a} L= ${b} ${|} Goto ${jeek} ${|}\n!insertmacro _L< ${a} ${b} `${jles}` `${jgtr}`\n!verbose pop\n!else\nInt64Cmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`\n!endif\n!macroend\n!macro IntPtrCmp a b jeek jles jgtr\nIntPtrCmp `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`\n!macroend\n\n!define Int32CmpU '!insertmacro Int32CmpU '\n!define Int64CmpU '!insertmacro Int64CmpU '\n!define IntPtrCmpU '!insertmacro IntPtrCmpU '\n!macro Int32CmpU a b jeek jles jgtr\nIntCmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`\n!macroend\n!macro Int64CmpUHelper\n; This macro performs \"$_LOGICLIB_TEMP = a < b ? -1 : a > b ? 1 : 0\" but System::Int64Op does not support unsigned operations so we have to perform multiple steps\n!ifmacrondef _LOGICLIB_TEMP\n!include LogicLib.nsh\n!endif\n!insertmacro _LOGICLIB_TEMP\nExch $2 ; b\nExch\nExch $1 ; a\n; if (a == b) return 0;\n; if (a < 0)\n; {\n;   if (b >= 0) return 1\n; }\n; else\n; {\n;   if (b < 0) return -1\n; }\n; return a < b ? -1 : 1\nSystem::Int64Op $1 ^ $2 ; Using xor so $_LOGICLIB_TEMP ends up as 0 when they are equal\nPop $_LOGICLIB_TEMP\nStrCmp $_LOGICLIB_TEMP 0 ret ; NOTE: Must use StrCmp, IntCmp fails on \"0x8000000000000001 Z> 1\"\nSystem::Int64Op $1 < 0\nPop $_LOGICLIB_TEMP\nStrCmp $_LOGICLIB_TEMP 0 checkNegOther\nSystem::Int64Op $2 < 0 ; System::Int64Op does not support the >= operator so we invert the operation\nPop $_LOGICLIB_TEMP\nStrCmp $_LOGICLIB_TEMP 0 retPos finalCmp\nretPos:\nStrCpy $_LOGICLIB_TEMP \"1\"\nGoto ret\ncheckNegOther:\nSystem::Int64Op $2 < 0\nPop $_LOGICLIB_TEMP\nStrCmp $_LOGICLIB_TEMP 0 finalCmp retNeg\nretNeg:\nStrCpy $_LOGICLIB_TEMP \"-1\"\nGoto ret\nfinalCmp:\nSystem::Int64Op $1 < $2\nPop $_LOGICLIB_TEMP\nStrCmp $_LOGICLIB_TEMP 0 retPos retNeg\nret:\nPop $1\nPop $2\n!macroend\n!macro Int64CmpU a b jeek jles jgtr\n!if ${NSIS_PTR_SIZE} <= 4\n!echo \"Int64CmpU ${a}:${b} =${jeek}, <${jles}, >${jgtr}\"\n!verbose push 2\nPush `${a}`\nPush `${b}`\n!insertmacro CallArtificialFunction Int64CmpUHelper\nIntCmp $_LOGICLIB_TEMP 0 `${jeek}` `${jles}` `${jgtr}`\n!verbose pop\n!else\nInt64CmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`\n!endif\n!macroend\n!macro IntPtrCmpU a b jeek jles jgtr\nIntPtrCmpU `${a}` `${b}` `${jeek}` `${jles}` `${jgtr}`\n!macroend\n\n\n!define MakeARPInstallDate \"!insertmacro MakeARPInstallDate \"\n!macro MakeARPInstallDate _outvar\nSystem::Call 'KERNEL32::GetDateFormat(i0x409,i0,p0,t\"yyyyMMdd\",t.s,i${NSIS_MAX_STRLEN})'\nPop ${_outvar}\n!macroend\n\n\n!define /IfNDef SPI_GETHIGHCONTRAST 0x42\n!define /IfNDef HCF_HIGHCONTRASTON 0x01\n!define /IfNDef /math SYSSIZEOF_HIGHCONTRAST 8 + ${NSIS_PTR_SIZE}\n!define IsHighContrastModeActive '\"\" IsHighContrastModeActive \"\"'\n!macro _IsHighContrastModeActive _lhs _rhs _t _f\n!ifmacrondef _LOGICLIB_TEMP\n!include LogicLib.nsh\n!endif\n!insertmacro _LOGICLIB_TEMP\nPush $1\nSystem::Call '*(i${SYSSIZEOF_HIGHCONTRAST},i0,p)p.r1'\nSystem::Call 'USER32::SystemParametersInfo(i${SPI_GETHIGHCONTRAST},i${SYSSIZEOF_HIGHCONTRAST},pr1,i0)'\nSystem::Call '*$1(i,i.s)'\nPop $_LOGICLIB_TEMP\nSystem::Free $1\nPop $1\n!insertmacro _& $_LOGICLIB_TEMP ${HCF_HIGHCONTRASTON} `${_t}` `${_f}`\n!macroend\n\n\n!endif # !___UTIL__NSH___\n!verbose pop\n"
  },
  {
    "path": "setup/nsis/tools/Include/VB6RunTime.nsh",
    "content": "/*\n\nVB6RunTime.nsh\n\nSetup of Visual Basic 6.0 run-time files, including the Oleaut32.dll security update\n\nCopyright 2008-2022 Joost Verburg\n\nTo obtain the run-time files, download and extract\nhttps://nsis.sourceforge.io/vb6runtime.zip\n\nScript code for installation:\n\n!insertmacro InstallVB6RunTime FOLDER ALREADY_INSTALLED\n\nin which FOLDER is the location of the run-time files and ALREADY_INSTALLED is the\nname of a variable that is empty when the application is installed for the first time\nand non-empty otherwise\n\nScript code for uninstallation:\n\n!insertmacro UnInstallVB6RunTime\n\nRemarks:\n\n* You may have to install additional files for such Visual Basic application to work,\n  such as OCX files for user interface controls.\n  \n* Installation of the run-time files requires Administrator or Power User privileges.\n  Use the Multi-User header file to verify whether these privileges are available.\n\n* Add a Modern UI finish page or another check (see IfRebootFlag in the NSIS Users\n  Manual) to allow the user to restart the computer when necessary.\n\n*/\n\n!ifndef VB6_INCLUDED\n!define VB6_INCLUDED\n!verbose push\n!verbose 3\n\n!include Library.nsh\n!include WinVer.nsh\n\n!macro VB6RunTimeInstall FOLDER ALREADY_INSTALLED\n\n  !insertmacro InstallLib REGDLL \"${ALREADY_INSTALLED}\" REBOOT_PROTECTED \"${FOLDER}\\msvbvm60.dll\" \"$SYSDIR\\msvbvm60.dll\" \"$SYSDIR\"\n  \n  ;The files below will only be installed on Win9x/NT4\n  \n  !insertmacro InstallLib REGDLL \"${ALREADY_INSTALLED}\" REBOOT_PROTECTED    \"${FOLDER}\\olepro32.dll\" \"$SYSDIR\\olepro32.dll\" \"$SYSDIR\"\n  !insertmacro InstallLib REGDLL \"${ALREADY_INSTALLED}\" REBOOT_PROTECTED    \"${FOLDER}\\comcat.dll\"   \"$SYSDIR\\comcat.dll\"   \"$SYSDIR\"\n  !insertmacro InstallLib DLL    \"${ALREADY_INSTALLED}\" REBOOT_PROTECTED    \"${FOLDER}\\asycfilt.dll\" \"$SYSDIR\\asycfilt.dll\" \"$SYSDIR\"\n  !insertmacro InstallLib TLB    \"${ALREADY_INSTALLED}\" REBOOT_PROTECTED    \"${FOLDER}\\stdole2.tlb\"  \"$SYSDIR\\stdole2.tlb\"  \"$SYSDIR\"\n  \n  Push $R0\n  \n  ${if} ${IsNT}\n    ${if} ${IsWinNT4}\n      ReadRegStr $R0 HKLM \"System\\CurrentControlSet\\Control\" \"ProductOptions\"\n      ${if} $R0 == \"Terminal Server\"\n        !insertmacro InstallLib REGDLL \"${ALREADY_INSTALLED}\" REBOOT_NOTPROTECTED \"${FOLDER}\\NT4TS\\oleaut32.dll\" \"$SYSDIR\\oleaut32.dll\" \"$SYSDIR\"\n      ${else}\n        !insertmacro InstallLib REGDLL \"${ALREADY_INSTALLED}\" REBOOT_NOTPROTECTED \"${FOLDER}\\NT4\\oleaut32.dll\" \"$SYSDIR\\oleaut32.dll\" \"$SYSDIR\"\n      ${endif}\n    ${endif}\n  ${else}\n    ;No Oleaut32.dll with the security update has been released for Windows 9x.\n    ;The NT4 version is used because NT4 and Win9x used to share the same 2.40 version\n    ;and version 2.40.4519.0 is reported to work fine on Win9x.\n    !insertmacro InstallLib REGDLL \"${ALREADY_INSTALLED}\" REBOOT_NOTPROTECTED \"${FOLDER}\\NT4\\oleaut32.dll\" \"$SYSDIR\\oleaut32.dll\" \"$SYSDIR\"\n  ${endif}\n  \n  Pop $R0\n\n!macroend\n\n!macro VB6RunTimeUnInstall\n\n   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE \"$SYSDIR\\msvbvm60.dll\"\n   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE \"$SYSDIR\\oleaut32.dll\"\n   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE \"$SYSDIR\\olepro32.dll\"\n   !insertmacro UnInstallLib REGDLL SHARED NOREMOVE \"$SYSDIR\\comcat.dll\"\n   !insertmacro UnInstallLib DLL    SHARED NOREMOVE \"$SYSDIR\\asycfilt.dll\"\n   !insertmacro UnInstallLib TLB    SHARED NOREMOVE \"$SYSDIR\\stdole2.tlb\"\n\n!macroend\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/VPatchLib.nsh",
    "content": "; PatchLib v3.0\n; =============\n;\n; Library with macro for use with VPatch (DLL version) in NSIS 2.0.5+\n; Created by Koen van de Sande\n\n!include LogicLib.nsh\n\n!macro VPatchFile PATCHDATA SOURCEFILE TEMPFILE\n\n  Push $1\n  Push $2\n  Push $3\n  Push $4\n\n  Push ${SOURCEFILE}\n  Push ${TEMPFILE}\n\n  Pop $2 # temp file\n  Pop $3 # source file\n\n  InitPluginsDir\n  GetTempFileName $1 $PLUGINSDIR\n  File /oname=$1 ${PATCHDATA}\n\n  vpatch::vpatchfile $1 $3 $2\n  Pop $4\n  DetailPrint $4\n\n  StrCpy $4 $4 2\n  ${Unless} $4 == \"OK\"\n    SetErrors\n  ${EndIf}\n\n  ${If} ${FileExists} $2\n    Delete $3\n    Rename /REBOOTOK $2 $3\n  ${EndIf}\n\n  Delete $1\n\n  Pop $4\n  Pop $3\n  Pop $2\n  Pop $1\n\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Include/Win/COM.nsh",
    "content": "/*\n-------------\n   COM.nsh\n-------------\n\nCOM defines and helper macros\n\n; Example usage:\n!include LogicLib.nsh\n!include Win\\COM.nsh\n!include Win\\Propkey.nsh\n!insertmacro ComHlpr_CreateInProcInstance ${CLSID_ShellLink} ${IID_IShellLink} r0 \"\"\n${If} $0 P<> 0\n\t${IShellLink::SetPath} $0 '(\"%COMSPEC%\").r1'\n\t${IShellLink::SetArguments} $0 '(\"/k echo HelloWorld\").r2'\n\t${If} $1 = 0\n\t${AndIf} $2 = 0\n\t\t${IUnknown::QueryInterface} $0 '(\"${IID_IPropertyStore}\",.r1)'\n\t\t${If} $1 P<> 0\n\t\t\tSystem::Call '*${SYSSTRUCT_PROPERTYKEY}(${PKEY_AppUserModel_StartPinOption})p.r2'\n\t\t\tSystem::Call '*${SYSSTRUCT_PROPVARIANT}(${VT_UI4},,&i4 ${APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL})p.r3'\n\t\t\t${IPropertyStore::SetValue} $1 '($2,$3)'\n\n\t\t\t; Reuse the PROPERTYKEY & PROPVARIANT buffers to set another property\n\t\t\tSystem::Call '*$2${SYSSTRUCT_PROPERTYKEY}(${PKEY_AppUserModel_ExcludeFromShowInNewInstall})'\n\t\t\tSystem::Call '*$3${SYSSTRUCT_PROPVARIANT}(${VT_BOOL},,&i2 ${VARIANT_TRUE})'\n\t\t\t${IPropertyStore::SetValue} $1 '($2,$3)'\n\n\t\t\tSystem::Free $2\n\t\t\tSystem::Free $3\n\t\t\t${IPropertyStore::Commit} $1 \"\"\n\t\t\t${IUnknown::Release} $1 \"\"\n\t\t${EndIf}\n\t\t${IUnknown::QueryInterface} $0 '(\"${IID_IPersistFile}\",.r1)'\n\t\t${If} $1 P<> 0\n\t\t\t${IPersistFile::Save} $1 '(\"$SMPrograms\\nsis_test.lnk\",1)'\n\t\t\t${IUnknown::Release} $1 \"\"\n\t\t${EndIf}\n\t${EndIf}\n\t${IUnknown::Release} $0 \"\"\n${EndIf}\n\n*/\n\n\n!ifndef __WIN_COM__INC\n!define __WIN_COM__INC ${NSIS_CHAR_SIZE}\n!verbose push\n!verbose 3\n\n!define /ifndef STGM_READ 0\n!define /ifndef STGM_WRITE 1\n!define /ifndef STGM_READWRITE 2\n!define /ifndef STGM_SHARE_DENY_NONE  0x00000040\n!define /ifndef STGM_SHARE_DENY_READ  0x00000030\n!define /ifndef STGM_SHARE_DENY_WRITE 0x00000020\n!define /ifndef STGM_SHARE_EXCLUSIVE  0x00000010\n!define /ifndef STGM_PRIORITY         0x00040000\n!define /ifndef STGM_CREATE      0x00001000\n!define /ifndef STGM_CONVERT     0x00020000\n!define /ifndef STGM_FAILIFTHERE 0\n!define /ifndef STGM_DELETEONRELEASE 0x04000000\n\n!define /ifndef CLSCTX_INPROC_SERVER 0x1\n!define /ifndef CLSCTX_INPROC_HANDLER 0x2\n!define /ifndef CLSCTX_LOCAL_SERVER 0x4\n!define /ifndef CLSCTX_REMOTE_SERVER 0x10\n!define /ifndef CLSCTX_ACTIVATE_32_BIT_SERVER 0x40000\n!define /ifndef CLSCTX_ACTIVATE_64_BIT_SERVER 0x80000\n!define /ifndef CLSCTX_ENABLE_CLOAKING 0x100000\n\n!define NSISCOMCALL \"!insertmacro NSISCOMCALL \"\n!macro NSISCOMCALL vtblidx decl ptr params\n!if ${NSIS_CHAR_SIZE} <> ${__WIN_COM__INC}\n; Warn if QueryInterface() for IID_IShellLink etc will return the wrong interface\n!warning \"NSIS_CHAR_SIZE changed, existing defines and macros might not work correctly!\"\n!endif\nSystem::Call `${ptr}->${vtblidx}${decl}${params}`\n!macroend\n!define NSISCOMIFACEDECL \"!insertmacro NSISCOMIFACEDECL \"\n!macro NSISCOMIFACEDECL iface method vtblidx decl\n!define ${iface}::${method} `${NSISCOMCALL} ${vtblidx} ${decl} `\n!macroend\n\n!macro ComHlpr_CreateInstance clsid iid sysoutvarIFacePtr sysret\nSystem::Call 'OLE32::CoCreateInstance(g\"${clsid}\",i0,i23,g\"${iid}\",*p.${sysoutvarIFacePtr})i${sysret}'\n!macroend\n!macro ComHlpr_CreateInProcInstance clsid iid sysoutvarIFacePtr sysret\nSystem::Call 'OLE32::CoCreateInstance(g\"${clsid}\",i0,i${CLSCTX_INPROC_SERVER},g\"${iid}\",*p.${sysoutvarIFacePtr})i${sysret}'\n!macroend\n\n!macro ComHlpr_SafeRelease _p\n${If} ${_p} P<> 0\n\t${IUnknown::Release} ${_p} \"\"\n${EndIf}\n!macroend\n!macro ComHlpr_SafeReleaseAndNull _p\n${If} ${_p} P<> 0\n\t${IUnknown::Release} ${_p} \"\"\n\tStrCpy ${_p} 0\n${EndIf}\n!macroend\n\n\n!ifndef IID_IUnknown\n!define IID_IUnknown {00000000-0000-0000-C000-000000000046}\n${NSISCOMIFACEDECL}IUnknown QueryInterface 0 (g,*p)i\n${NSISCOMIFACEDECL}IUnknown AddRef 1 ()i\n${NSISCOMIFACEDECL}IUnknown Release 2 ()i\n!endif\n\n!ifndef IID_IPersist\n!define IID_IPersist {0000010c-0000-0000-C000-000000000046}\n${NSISCOMIFACEDECL}IPersist GetClassID 3 (g)i\n!endif\n\n!ifndef IID_IPersistStream\n!define IID_IPersistStream {00000109-0000-0000-C000-000000000046} ; IPersist>\n${NSISCOMIFACEDECL}IPersistStream IsDirty 4 ()i\n${NSISCOMIFACEDECL}IPersistStream Load 5 (p,i)i\n${NSISCOMIFACEDECL}IPersistStream Save 6 (p,i)i\n${NSISCOMIFACEDECL}IPersistStream GetSizeMax 7 (*l)i\n!endif\n!ifndef IID_IPersistStreamInit\n!define IID_IPersistStreamInit {7FD52380-4E07-101B-AE2D-08002B2EC713} ; IPersist>\n${NSISCOMIFACEDECL}IPersistStreamInit IsDirty 4 ()i\n${NSISCOMIFACEDECL}IPersistStreamInit Load 5 (p,i)i\n${NSISCOMIFACEDECL}IPersistStreamInit Save 6 (p,i)i\n${NSISCOMIFACEDECL}IPersistStreamInit GetSizeMax 7 (*l)i\n${NSISCOMIFACEDECL}IPersistStreamInit InitNew 8 ()i\n!endif\n\n!ifndef IID_IPersistFile\n!define IID_IPersistFile {0000010b-0000-0000-C000-000000000046} ; IPersist>\n${NSISCOMIFACEDECL}IPersistFile IsDirty 4 ()i\n${NSISCOMIFACEDECL}IPersistFile Load 5 (w,i)i\n${NSISCOMIFACEDECL}IPersistFile Save 6 (w,i)i\n${NSISCOMIFACEDECL}IPersistFile SaveCompleted 7 (w)i\n${NSISCOMIFACEDECL}IPersistFile GetCurFile 8 (*w)i\n!endif\n\n!ifndef CLSID_ShellLink\n!define CLSID_ShellLink {00021401-0000-0000-c000-000000000046}\n!endif\n!ifndef IID_IShellLink\n!define IID_IShellLinkA {000214ee-0000-0000-c000-000000000046}\n!define IID_IShellLinkW {000214f9-0000-0000-c000-000000000046}\n!ifdef NSIS_UNICODE\n!define IID_IShellLink ${IID_IShellLinkW}\n!else\n!define IID_IShellLink ${IID_IShellLinkA}\n!endif\n${NSISCOMIFACEDECL}IShellLink GetPath 3 (t,i,p,i)i\n${NSISCOMIFACEDECL}IShellLink GetIDList 4 (*p)i\n${NSISCOMIFACEDECL}IShellLink SetIDList 5 (p)i\n${NSISCOMIFACEDECL}IShellLink GetDescription 6 (t,i)i\n${NSISCOMIFACEDECL}IShellLink SetDescription 7 (t)i\n${NSISCOMIFACEDECL}IShellLink GetWorkingDirectory 8 (t,i)i\n${NSISCOMIFACEDECL}IShellLink SetWorkingDirectory 9 (t)i\n${NSISCOMIFACEDECL}IShellLink GetArguments 10 (t,i)i\n${NSISCOMIFACEDECL}IShellLink SetArguments 11 (t)i\n${NSISCOMIFACEDECL}IShellLink GetHotkey 12 (*i0)i\n${NSISCOMIFACEDECL}IShellLink SetHotkey 13 (&i2)i\n${NSISCOMIFACEDECL}IShellLink GetShowCmd 14 (*i)i\n${NSISCOMIFACEDECL}IShellLink SetShowCmd 15 (i)i\n${NSISCOMIFACEDECL}IShellLink GetIconLocation 16 (t,i,*i)i\n${NSISCOMIFACEDECL}IShellLink SetIconLocation 17 (t,i)i\n${NSISCOMIFACEDECL}IShellLink SetRelativePath 18 (t,i)i\n${NSISCOMIFACEDECL}IShellLink Resolve 19 (p,i)i\n${NSISCOMIFACEDECL}IShellLink SetPath 20 (t)i\n!endif\n\n!ifndef IID_IShellLinkDataList\n!define IID_IShellLinkDataList {45e2b4ae-b1c3-11d0-b92f-00a0c90312e1}\n${NSISCOMIFACEDECL}IShellLinkDataList AddDataBlock 3 (p)i\n${NSISCOMIFACEDECL}IShellLinkDataList CopyDataBlock 4 (i,*p)i\n${NSISCOMIFACEDECL}IShellLinkDataList RemoveDataBlock 5 (i)i\n${NSISCOMIFACEDECL}IShellLinkDataList GetFlags 6 (*i)i\n${NSISCOMIFACEDECL}IShellLinkDataList SetFlags 7 (i)i\n!endif\n!define /ifndef EXP_SZ_LINK_SIG         0xA0000001\n!define /ifndef NT_CONSOLE_PROPS_SIG    0xA0000002\n!define /ifndef NT_FE_CONSOLE_PROPS_SIG 0xA0000004\n!define /ifndef EXP_SPECIAL_FOLDER_SIG  0xA0000005\n!define /ifndef EXP_DARWIN_ID_SIG       0xA0000006\n!define /ifndef EXP_SZ_ICON_SIG         0xA0000007\n!define /ifndef EXP_PROPERTYSTORAGE_SIG 0xA0000009\n;SHELL_LINK_DATA_FLAGS\n!define /ifndef SLDF_HAS_ID_LIST                           0x00000001\n!define /ifndef SLDF_HAS_LINK_INFO                         0x00000002\n!define /ifndef SLDF_HAS_NAME                              0x00000004\n!define /ifndef SLDF_HAS_RELPATH                           0x00000008\n!define /ifndef SLDF_HAS_WORKINGDIR                        0x00000010\n!define /ifndef SLDF_HAS_ARGS                              0x00000020\n!define /ifndef SLDF_HAS_ICONLOCATION                      0x00000040\n!define /ifndef SLDF_UNICODE                               0x00000080\n!define /ifndef SLDF_FORCE_NO_LINKINFO                     0x00000100\n!define /ifndef SLDF_HAS_EXP_SZ                            0x00000200\n!define /ifndef SLDF_RUN_IN_SEPARATE                       0x00000400\n!define /ifndef SLDF_HAS_LOGO3ID                           0x00000800\n!define /ifndef SLDF_HAS_DARWINID                          0x00001000\n!define /ifndef SLDF_RUNAS_USER                            0x00002000\n!define /ifndef SLDF_HAS_EXP_ICON_SZ                       0x00004000\n!define /ifndef SLDF_NO_PIDL_ALIAS                         0x00008000\n!define /ifndef SLDF_FORCE_UNCNAME                         0x00010000\n!define /ifndef SLDF_RUN_WITH_SHIMLAYER                    0x00020000\n!define /ifndef SLDF_FORCE_NO_LINKTRACK                    0x00040000 ;[Vista+]\n!define /ifndef SLDF_ENABLE_TARGET_METADATA                0x00080000\n!define /ifndef SLDF_DISABLE_LINK_PATH_TRACKING            0x00100000 ;[Seven+]\n!define /ifndef SLDF_DISABLE_KNOWNFOLDER_RELATIVE_TRACKING 0x00200000\n!define /ifndef SLDF_NO_KF_ALIAS                           0x00400000\n!define /ifndef SLDF_ALLOW_LINK_TO_LINK                    0x00800000\n!define /ifndef SLDF_UNALIAS_ON_SAVE                       0x01000000\n!define /ifndef SLDF_PREFER_ENVIRONMENT_PATH               0x02000000\n!define /ifndef SLDF_KEEP_LOCAL_IDLIST_FOR_UNC_TARGET      0x04000000\n!define /ifndef SLDF_PERSIST_VOLUME_ID_RELATIVE            0x08000000 ;[Eight+]\n\n!ifndef IID_IShellItem\n!define IID_IShellItem {43826d1e-e718-42ee-bc55-a1e261c37bfe}\n${NSISCOMIFACEDECL}IShellItem BindToHandler 3 (p,g,g,*p)i\n${NSISCOMIFACEDECL}IShellItem GetParent 4 (*p)i\n${NSISCOMIFACEDECL}IShellItem GetDisplayName 5 (i,*p)i\n${NSISCOMIFACEDECL}IShellItem GetAttributes 6 (i,*i)i\n${NSISCOMIFACEDECL}IShellItem Compare 7 (p,i,*i)i\n!endif\n\n!ifndef CLSID_StartMenuPin\n!define CLSID_StartMenuPin {a2a9545d-a0c2-42b4-9708-a0b2badd77c8}\n!endif\n!ifndef IID_IStartMenuPinnedList\n!define IID_IStartMenuPinnedList {4CD19ADA-25A5-4A32-B3B7-347BEE5BE36B}\n${NSISCOMIFACEDECL}IStartMenuPinnedList RemoveFromList 3 (p)i\n!endif\n\n!ifndef CLSID_ApplicationDestinations\n!define CLSID_ApplicationDestinations {86c14003-4d6b-4ef3-a7b4-0506663b2e68}\n!endif\n!ifndef IID_IApplicationDestinations\n!define IID_IApplicationDestinations {12337D35-94C6-48A0-BCE7-6A9C69D4D600} ;[Seven+]\n${NSISCOMIFACEDECL}IApplicationDestinations SetAppID 3 (w)i\n${NSISCOMIFACEDECL}IApplicationDestinations RemoveDestination 4 (p)i ; IShellItem or IShellLink \n${NSISCOMIFACEDECL}IApplicationDestinations RemoveAllDestinations 5 ()i\n!endif\n\n!ifndef CLSID_DestinationList\n!define CLSID_DestinationList {77f10cf0-3db5-4966-b520-b7c54fd35ed6}\n!endif\n!ifndef IID_ICustomDestinationList\n!define IID_ICustomDestinationList {6332debf-87b5-4670-90c0-5e57b408a49e} ;[Seven+]\n${NSISCOMIFACEDECL}ICustomDestinationList SetAppID 3 (w)i\n${NSISCOMIFACEDECL}ICustomDestinationList BeginList 4 (*i,g,*p)i ; IObjectArray or IEnumObjects\n${NSISCOMIFACEDECL}ICustomDestinationList AppendCategory 5 (w,p)i ; IObjectArray*\n${NSISCOMIFACEDECL}ICustomDestinationList AppendKnownCategory 6 (i)i\n${NSISCOMIFACEDECL}ICustomDestinationList AddUserTasks 7 (p)i ; IObjectArray*\n${NSISCOMIFACEDECL}ICustomDestinationList CommitList 8 ()i\n${NSISCOMIFACEDECL}ICustomDestinationList GetRemovedDestinations 9 (g,*p)i ; IObjectCollection\n${NSISCOMIFACEDECL}ICustomDestinationList DeleteList 10 (w)i\n${NSISCOMIFACEDECL}ICustomDestinationList AbortList 11 ()i\n!endif\n\n!ifndef CLSID_EnumerableObjectCollection\n!define CLSID_EnumerableObjectCollection {2d3468c1-36a7-43b6-ac24-d3f02fd9607a}\n!endif\n!ifndef IID_IObjectArray\n!define IID_IObjectArray {92CA9DCD-5622-4bba-A805-5E9F541BD8C9}\n${NSISCOMIFACEDECL}IObjectArray GetCount 3 (*i)i\n${NSISCOMIFACEDECL}IObjectArray GetAt 4 (i,g,*p)i\n!endif\n\n!ifndef IID_IObjectCollection\n!define IID_IObjectCollection {5632b1a4-e38a-400a-928a-d4cd63230295} ; IObjectArray>\n${NSISCOMIFACEDECL}IObjectCollection AddObject 5 (p)i ; IUnknown*\n${NSISCOMIFACEDECL}IObjectCollection AddFromArray 6 (p)i ; IObjectArray*\n${NSISCOMIFACEDECL}IObjectCollection RemoveObjectAt 7 (i)i\n${NSISCOMIFACEDECL}IObjectCollection Clear 8 ()i\n!endif\n\n!ifndef IID_IEnumObjects\n!define IID_IEnumObjects {2c1c7e2e-2d0e-4059-831e-1e6f82335c2e}\n${NSISCOMIFACEDECL}IEnumObjects Next 3 (i,g,*p,*i)i\n${NSISCOMIFACEDECL}IEnumObjects Skip 4 (i)i\n${NSISCOMIFACEDECL}IEnumObjects Reset 5 ()i\n${NSISCOMIFACEDECL}IEnumObjects Clone 6 (*p)i\n!endif\n\n!ifndef IID_IEnumUnknown\n!define IID_IEnumUnknown {00000100-0000-0000-C000-000000000046}\n${NSISCOMIFACEDECL}IEnumUnknown Next 3 (i,*p,*i)i\n${NSISCOMIFACEDECL}IEnumUnknown Skip 4 (i)i\n${NSISCOMIFACEDECL}IEnumUnknown Reset 5 ()i\n${NSISCOMIFACEDECL}IEnumUnknown Clone 6 (*p)i\n!endif\n\n!ifndef IID_IPropertyStore\n!define IID_IPropertyStore {886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99}\n${NSISCOMIFACEDECL}IPropertyStore GetCount 3 (*i)i\n${NSISCOMIFACEDECL}IPropertyStore GetAt 4 (i,p)i\n${NSISCOMIFACEDECL}IPropertyStore GetValue 5 (p,p)i\n${NSISCOMIFACEDECL}IPropertyStore SetValue 6 (p,p)i\n${NSISCOMIFACEDECL}IPropertyStore Commit 7 ()i\n!endif\n\n!ifndef IID_IPropertyStorage\n!define IID_IPropertyStorage {00000138-0000-0000-C000-000000000046}\n${NSISCOMIFACEDECL}IPropertyStorage ReadMultiple 3 (i,p,p)i\n${NSISCOMIFACEDECL}IPropertyStorage WriteMultiple 4 (i,p,p,i)i\n${NSISCOMIFACEDECL}IPropertyStorage DeleteMultiple 5 (i,p)i\n${NSISCOMIFACEDECL}IPropertyStorage ReadPropertyNames 6 (p,p)i\n${NSISCOMIFACEDECL}IPropertyStorage WritePropertyNames 7 (i,p,p)i\n${NSISCOMIFACEDECL}IPropertyStorage DeletePropertyNames 8 (i,p)i\n${NSISCOMIFACEDECL}IPropertyStorage Commit 9 (i)i ; Note: Some implementations might return E_NOTIMPL\n${NSISCOMIFACEDECL}IPropertyStorage Revert 10 ()i\n${NSISCOMIFACEDECL}IPropertyStorage Enum 11 (*p)i\n${NSISCOMIFACEDECL}IPropertyStorage SetTimes 12 (p,p,p)i\n${NSISCOMIFACEDECL}IPropertyStorage SetClass 13 (g)i\n${NSISCOMIFACEDECL}IPropertyStorage Stat 14 (p)i\n!endif\n\n!ifndef IID_IPropertySetStorage\n!define IID_IPropertySetStorage {0000013A-0000-0000-C000-000000000046}\n${NSISCOMIFACEDECL}IPropertySetStorage Create 3 (g,g,i,i,*p)i\n${NSISCOMIFACEDECL}IPropertySetStorage Open 4 (g,i,*p)i\n${NSISCOMIFACEDECL}IPropertySetStorage Delete 5 (g)i\n${NSISCOMIFACEDECL}IPropertySetStorage Enum 6 (*p)i\n!endif\n\n!ifndef CLSID_ApplicationAssociationRegistration\n!define CLSID_ApplicationAssociationRegistration {591209c7-767b-42b2-9fba-44ee4615f2c7}\n!endif\n!ifndef IID_IApplicationAssociationRegistration\n!define IID_IApplicationAssociationRegistration {4e530b0a-e611-4c77-a3ac-9031d022281b} ;[Vista+]\n${NSISCOMIFACEDECL}IApplicationAssociationRegistration QueryCurrentDefault 3 (w,i,i,*p)i\n${NSISCOMIFACEDECL}IApplicationAssociationRegistration QueryAppIsDefault 4 (w,i,i,w,*i)i\n${NSISCOMIFACEDECL}IApplicationAssociationRegistration QueryAppIsDefaultAll 5 (i,w,*i)i\n${NSISCOMIFACEDECL}IApplicationAssociationRegistration SetAppAsDefault 6 (w,w,i)i\n${NSISCOMIFACEDECL}IApplicationAssociationRegistration SetAppAsDefaultAll 7 (w)i\n${NSISCOMIFACEDECL}IApplicationAssociationRegistration ClearUserAssociations 8 ()i\n!endif\n!ifndef CLSID_ApplicationAssociationRegistrationUI\n!define CLSID_ApplicationAssociationRegistrationUI {1968106d-f3b5-44cf-890e-116fcb9ecef1}\n!endif\n!ifndef IID_IApplicationAssociationRegistrationUI\n!define IID_IApplicationAssociationRegistrationUI {1f76a169-f994-40ac-8fc8-0959e8874710} ;[Vista+]\n${NSISCOMIFACEDECL}IApplicationAssociationRegistrationUI LaunchAdvancedAssociationUI 3 (w)i\n!endif\n\n!ifndef CLSID_GameExplorer\n!define CLSID_GameExplorer {9A5EA990-3034-4D6F-9128-01F3C61022BC}\n!endif\n!ifndef IID_IGameExplorer\n!define IID_IGameExplorer {E7B2FB72-D728-49B3-A5F2-18EBF5F1349E} ;[Vista+]\n${NSISCOMIFACEDECL}IGameExplorer AddGame 3 (p,p,i,g)i\n${NSISCOMIFACEDECL}IGameExplorer RemoveGame 4 (i,i,i,i)i ; The parameter is a GUID, not REFGUID so the 'g' type cannot be used!\n${NSISCOMIFACEDECL}IGameExplorer UpdateGame 5 (i,i,i,i)i\n${NSISCOMIFACEDECL}IGameExplorer VerifyAccess 6 (p,*i)i\n!endif\n!define /ifndef GIS_NOT_INSTALLED 1\n!define /ifndef GIS_CURRENT_USER 2\n!define /ifndef GIS_ALL_USERS 3\n!ifndef IID_IGameExplorer2\n!define IID_IGameExplorer2 {86874AA7-A1ED-450d-A7EB-B89E20B2FFF3} ;[Seven+]\n${NSISCOMIFACEDECL}IGameExplorer2 InstallGame 3 (w,w,i)i\n${NSISCOMIFACEDECL}IGameExplorer2 UninstallGame 4 (w)i\n${NSISCOMIFACEDECL}IGameExplorer2 CheckAccess 5 (w,*i)i\n!endif\n!ifndef CLSID_GameStatistics\n!define CLSID_GameStatistics {DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4}\n!endif\n!ifndef IID_IGameStatisticsMgr\n!define IID_IGameStatisticsMgr {AFF3EA11-E70E-407d-95DD-35E612C41CE2} ;[Seven+]\n${NSISCOMIFACEDECL}IGameStatisticsMgr GetGameStatistics 3 (w,i,*i,*p)i\n${NSISCOMIFACEDECL}IGameStatisticsMgr RemoveGameStatistics 4 (w)i\n!endif\n\n!ifndef CLSID_InternetShortcut\n!define CLSID_InternetShortcut {FBF23B40-E3F0-101B-8488-00AA003E56F8}\n!endif\n!ifndef IID_IUniformResourceLocator\n!define IID_IUniformResourceLocatorA {FBF23B80-E3F0-101B-8488-00AA003E56F8}\n!define IID_IUniformResourceLocatorW {CABB0DA0-DA57-11CF-9974-0020AFD79762}\n!ifdef NSIS_UNICODE\n!define IID_IUniformResourceLocator ${IID_IUniformResourceLocatorW}\n!else\n!define IID_IUniformResourceLocator ${IID_IUniformResourceLocatorA}\n!endif\n${NSISCOMIFACEDECL}IUniformResourceLocator SetURL 3 (t,i)i\n${NSISCOMIFACEDECL}IUniformResourceLocator GetURL 4 (*p)i\n${NSISCOMIFACEDECL}IUniformResourceLocator InvokeCommand 5 (p)i\n!endif\n\n!verbose pop\n!endif /* __WIN_COM__INC */\n"
  },
  {
    "path": "setup/nsis/tools/Include/Win/Propkey.nsh",
    "content": "!ifndef __WIN_PROPKEY__INC\n!define __WIN_PROPKEY__INC\n!verbose push\n!verbose 3 \n\n\n/**************************************************\nWTypes.h\n**************************************************/\n;NOTE: This list is incomplete\n!define VT_EMPTY     0\n!define VT_NULL      1\n!define VT_I2        2\n!define VT_I4        3\n!define VT_BSTR      8\n!define VT_BOOL      11\n!define VT_I1        16\n!define VT_UI1       17\n!define VT_UI2       18\n!define VT_UI4       19\n!define VT_I8        20\n!define VT_UI8       21\n!define VT_INT       22\n!define VT_UINT      23\n!define VT_HRESULT   25\n!define VT_PTR       26\n!define VT_SAFEARRAY 27\n!define VT_LPSTR     30 ; SHStrDupA\n!define VT_LPWSTR    31 ; SHStrDupW\n!define VT_FILETIME  64\n!define VT_STREAM    66\n!define VT_CLSID     72 ; Pointer to CoTaskMem allocated GUID\n!define VT_TYPEMASK 0xFFF\n!define VT_VECTOR  0x1000\n!define VT_ARRAY   0x2000\n!define VT_BYREF   0x4000\n\n!define /ifndef VARIANT_TRUE -1\n!define /ifndef VARIANT_FALSE 0\n\n!define SYSSIZEOF_PROPERTYKEY 20\n!define SYSSTRUCT_PROPERTYKEY (&g16,&i4) ;System.dll is buggy when it comes to g and forces us to specify the size\n\n!define STGC_DEFAULT 0\n!define STGC_OVERWRITE 1\n!define STGC_ONLYIFCURRENT 2\n!define STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE 4\n!define STGC_CONSOLIDATE 8\n\n\n/**************************************************\nOAIdl.h\n**************************************************/\n!if \"${NSIS_PTR_SIZE}\" > 4\n!define SYSSIZEOF_VARIANT 24\n!define SYSSTRUCT_VARIANT (&i2,&i6,&i8,&i8)\n!else\n!define SYSSIZEOF_VARIANT 16\n!define SYSSTRUCT_VARIANT (&i2,&i6,&i8)\n!endif\n\n\n/**************************************************\nPropIdl.h\n**************************************************/\n!if \"${NSIS_PTR_SIZE}\" > 4\n!define SYSSIZEOF_PROPVARIANT 24\n!define SYSSTRUCT_PROPVARIANT (&i2,&i6,&i8,&i8)\n!else\n!define SYSSIZEOF_PROPVARIANT 16\n!define SYSSTRUCT_PROPVARIANT (&i2,&i6,&i8)\n!endif\n\n!define PRSPEC_LPWSTR 0\n!define PRSPEC_PROPID 1\n!define SYSSTRUCT_PROPSPEC (p,p)\n\n\n/**************************************************\nPropkey.h\n**************************************************/\n!define PKEY_AppUserModel_RelaunchCommand             '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",2' ; VT_LPWSTR (SHGetPropertyStoreForWindow)\n!define PKEY_AppUserModel_RelaunchIconResource        '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",3' ; VT_LPWSTR (SHGetPropertyStoreForWindow, optional. Path to icon or module, with resource ID or index.)\n!define PKEY_AppUserModel_RelaunchDisplayNameResource '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",4' ; VT_LPWSTR (SHGetPropertyStoreForWindow. @ style indirect resource string or a plain string.)\n!define PKEY_AppUserModel_ID                          '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",5' ; VT_LPWSTR\n!define PKEY_AppUserModel_IsDestListSeparator         '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",6' ; VT_BOOL\n!define PKEY_AppUserModel_ExcludeFromShowInNewInstall '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",8' ; VT_BOOL\n!define PKEY_AppUserModel_PreventPinning              '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",9' ; VT_BOOL\n!define PKEY_AppUserModel_IsDualMode '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",11' ; [Eight+] VT_BOOL\n!define APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL 1\n!define APPUSERMODEL_STARTPINOPTION_USERPINNED 2\n!define PKEY_AppUserModel_StartPinOption '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",12' ; [Eight+] VT_UI4\n!define PKEY_AppUserModel_ToastActivatorCLSID '\"{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}\",26' ; [10FU1507+] VT_CLSID\n!define PKEY_EdgeGesture_DisableTouchWhenFullscreen '\"{32CE38B2-2C9A-41B1-9BC5-B3784394AA44}\",2' ; [Eight+] VT_BOOL (SHGetPropertyStoreForWindow)\n\n\n/**************************************************\nShlGuid.h & ShlObj.h\n**************************************************/\n!define FMTID_Intshcut {000214A0-0000-0000-C000-000000000046}\n!define PID_IS_URL 2 ; VT_LPWSTR\n!define PID_IS_HOTKEY 6 ; VT_UI2\n!define PID_IS_ICONINDEX 8 ; VT_I4\n!define PID_IS_ICONFILE 9 ; VT_LPWSTR\n!define PKEY_Intshcut_Url '\"${FMTID_Intshcut}\",${PID_IS_URL}' ; Undocumented\n!define FMTID_InternetSite {000214A1-0000-0000-C000-000000000046}\n!define PID_INTSITE_LASTVISIT 4 ; VT_FILETIME\n!define PID_INTSITE_VISITCOUNT 6 ; VT_UI4\n\n\n/**************************************************\nHelper macros\n**************************************************/\n!define V_GetVT '!insertmacro V_GetVT '\n!macro V_GetVT pPV sysdst\nSystem::Call '*${pPV}(&i2.${sysdst})'\n!macroend\n!define V_SetVT '!insertmacro V_SetVT '\n!macro V_SetVT pPV syssrc\nSystem::Call '*${pPV}(&i2 ${syssrc})'\n!macroend\n!macro V_GetHelper sysvaltyp pPV sysdst\nSystem::Call '*${pPV}(l,${sysvaltyp}.${sysdst})'\n!macroend\n!macro V_GenericSetHelper sysvaltyp pPV VT syssrc\n!if \"${VT}\" != \"\" ; Setting the VT is optional\n  System::Call '*${pPV}(&i2 ${VT},&i6,${sysvaltyp}${syssrc})'\n!else\n  System::Call '*${pPV}(l,${sysvaltyp}${syssrc})'\n!endif\n!macroend\n!macro V_SpecificSetHelper VT sysvaltyp pPV syssrc\nSystem::Call '*${pPV}(&i2 ${VT},&i6,${sysvaltyp}${syssrc})'\n!macroend\n!macro Make_V_GetterSetter name sysvaltyp setsep\n!define V_Get${name} '!insertmacro V_GetHelper \"${sysvaltyp}\" '\n!ifdef VT_${name}\n  !define V_Set${name} '!insertmacro V_SpecificSetHelper ${VT_${name}} \"${sysvaltyp}${setsep}\" '\n!else\n  !define V_Set${name} '!insertmacro V_GenericSetHelper \"${sysvaltyp}${setsep}\" '\n!endif\n!macroend\n!insertmacro Make_V_GetterSetter Int8 \"&i1\" \" \"  ; Generic\n!insertmacro Make_V_GetterSetter Int16 \"&i2\" \" \" ; Generic\n!insertmacro Make_V_GetterSetter Int32 \"i\" \"\"    ; Generic\n!insertmacro Make_V_GetterSetter Int64 \"l\" \"\"    ; Generic\n!insertmacro Make_V_GetterSetter Pointer \"p\" \"\"  ; Generic\n!insertmacro Make_V_GetterSetter I4 \"i\" \" \"\n!insertmacro Make_V_GetterSetter BOOL \"&i2\" \" \"\n!insertmacro Make_V_GetterSetter FILETIME \"l\" \"\"\n\n!macro VariantInit pV\n${V_SetVT} ${pV} ${VT_EMPTY}\n!macroend\n!macro VariantClear pV\nSystem::Call 'OLEAUT32::#9(p${pV})'\n!macroend\n!macro VariantCopy pDstV pSrcV sysretHR\nSystem::Call 'OLEAUT32::#10(p${pDstV},p${pSrcV})i.${sysretHR}' ; (Frees the destination variant before it copies the source)\n!macroend\n!macro VariantCopyInd pDstV pSrcV sysretHR\nSystem::Call 'OLEAUT32::#11(p${pDstV},p${pSrcV})i.${sysretHR}' ; (Frees the destination variant before it copies the source)\n!macroend\n!macro VariantChangeType pDstV pSrcV Flags VT sysretHR\nSystem::Call 'OLEAUT32::#12(p${pDstV},p${pSrcV},i${Flags},i${VT})i.${sysretHR}' ; (Might free the destination on success)\n!macroend\n\n\n!macro PropVariantClear pPV\nSystem::Call 'OLE32::PropVariantClear(p${pPV})' ; WinNT4.SP0+, Win98+, IE4+\n!macroend\n!macro PropVariantCopy pDstPV pSrcPV sysretHR\nSystem::Call 'OLE32::PropVariantCopy(p${pDstPV},p${pSrcPV})i.${sysretHR}' ; WinNT4.SP0+, Win98+, IE4+ (Does NOT free the destination before it copies the source)\n!macroend\n!macro PropVariantChangeType pDstPV pSrcPV VT sysretHR\n!ifdef NSIS_ARM | NSIS_ARM32 | NSIS_ARMNT | NSIS_ARM64\n  System::Call 'PROPSYS::PropVariantChangeType(p${pDstPV},p${pSrcPV},i0,i${VT})i.${sysretHR}'\n!else\n  Push \"${VT}\"\n  Push ${pSrcPV}\n  Push ${pDstPV}\n  !include Util.nsh\n  ${CallArtificialFunction} TryPropVariantChangeType\n  System::Call 'KERNEL32::SetLastError(is${sysretHR})' ; A hack to move the result from the stack to somewhere with System variable syntax\n!endif\n!macroend\n!macro TryPropVariantChangeType\nSystem::Store S\nSystem::Call 'PROPSYS::PropVariantChangeType(psr1,psr2,i0,isr3)i.r0' ; Vista+ (Source and destination cannot be the same address)\nStrCmp $0 error \"\" done\nSystem::Call 'OLE32::PropVariantChangeType(pr1,pr2,i0,i0,ir3})i.r0' ; 2000+ (Source and destination cannot be the same address)\n!if ${NSIS_PTR_SIZE} < 8\n  StrCmp $0 error \"\" done\n  !insertmacro VariantChangeType $1 $2 0 $3 r0 ; This is not really correct but there is no PROPVARIANT support on these platforms. Might free the destination!\n!endif\ndone:\nPush $0\nSystem::Store L\n!macroend\n\n\n!macro IPropertyStorage_ReadPropById pPS ID pPV sysoutHR\nSystem::Call '*(p${PRSPEC_PROPID},p${ID})p.s'\n${IPropertyStorage::ReadMultiple} ${pPS} '(1,pss,p${pPV})${sysoutHR}'\nSystem::Free\n!macroend\n\n!macro IPropertyStorage_WritePropById pPS ID pPV sysoutHR\nSystem::Call '*(p${PRSPEC_PROPID},p${ID})p.s'\n${IPropertyStorage::WriteMultiple} ${pPS} '(1,pss,p${pPV},2)${sysoutHR}'\nSystem::Free\n!macroend\n\n\n!verbose pop\n!endif /* __WIN_PROPKEY__INC */\n"
  },
  {
    "path": "setup/nsis/tools/Include/Win/WinDef.nsh",
    "content": "!ifndef __WIN_WINDEF__INC\n!define __WIN_WINDEF__INC\n!verbose push\n!verbose 3\n!ifndef __WIN_NOINC_WINDEF\n\n\n!define /ifndef MAX_PATH 260\n#define NULL 0\n\n\n!macro _Win_MINMAX _intcmp _j1 _j2 _outvar _a _b\n${_intcmp} \"${_a}\" \"${_b}\" ${_j1} ${_j1} ${_j2}\nStrCpy ${_outvar} \"${_a}\"\ngoto +2\nStrCpy ${_outvar} \"${_b}\"\n!macroend\n!ifndef __WIN_MS_NOMINMAX & min & max & min_u & max_u\n!define min \"!insertmacro _Win_MINMAX IntCmp +1 +3 \"\n!define max \"!insertmacro _Win_MINMAX IntCmp +3 +1 \"\n!define min_u \"!insertmacro _Win_MINMAX IntCmpU +1 +3 \"\n!define max_u \"!insertmacro _Win_MINMAX IntCmpU +3 +1 \"\n!endif\n\n!macro _Win_LOBYTE _outvar _in\nIntOp ${_outvar} \"${_in}\" & 0xFF\n!macroend\n!define LOBYTE \"!insertmacro _Win_LOBYTE \"\n\n!macro _Win_HIBYTE _outvar _in\nIntOp ${_outvar} \"${_in}\" >> 8\n${LOBYTE} ${_outvar} ${_outvar}\n!macroend\n!define HIBYTE \"!insertmacro _Win_HIBYTE \"\n\n!macro _Win_LOWORD _outvar _in\nIntOp ${_outvar} \"${_in}\" & 0xFFFF\n!macroend\n!define LOWORD \"!insertmacro _Win_LOWORD \"\n\n!macro _Win_HIWORD _outvar _in\nIntOp ${_outvar} \"${_in}\" >>> 16\n!macroend\n!define HIWORD \"!insertmacro _Win_HIWORD \"\n\n!macro _Win_MAKEWORD _outvar _tmpvar _lo _hi\n${LOBYTE} ${_outvar} \"${_hi}\"\n${LOBYTE} ${_tmpvar} \"${_lo}\"\nIntOp ${_outvar} ${_outvar} << 8\nIntOp ${_outvar} ${_outvar} | ${_tmpvar}\n!macroend\n!define MAKEWORD \"!insertmacro _Win_MAKEWORD \"\n\n!macro _Win_MAKELONG32 _outvar _tmpvar _wlo _whi\n${LOWORD} ${_outvar} \"${_wlo}\"\nIntOp ${_tmpvar} \"${_whi}\" << 16\nIntOp ${_outvar} ${_outvar} | ${_tmpvar}\n!macroend\n!define MAKELONG \"!insertmacro _Win_MAKELONG32 \"\n!define MAKEWPARAM \"${MAKELONG}\"\n!define MAKELPARAM \"${MAKELONG}\"\n!define MAKELRESULT \"${MAKELONG}\"\n\n\n!endif /* __WIN_NOINC_WINDEF */\n!verbose pop\n!endif /* __WIN_WINDEF__INC */"
  },
  {
    "path": "setup/nsis/tools/Include/Win/WinError.nsh",
    "content": "!ifndef __WIN_WINERROR__INC\n!define __WIN_WINERROR__INC\n!verbose push\n!verbose 3\n\n!ifndef __WIN_NOINC_WINERROR\n#define NO_ERROR 0\n!define ERROR_SUCCESS                 0\n!define ERROR_INVALID_FUNCTION        1\n!define ERROR_FILE_NOT_FOUND          2\n!define ERROR_PATH_NOT_FOUND          3\n!define ERROR_TOO_MANY_OPEN_FILES     4\n!define ERROR_ACCESS_DENIED           5\n!define ERROR_INVALID_HANDLE          6\n!define ERROR_ARENA_TRASHED           7\n!define ERROR_NOT_ENOUGH_MEMORY       8\n!define ERROR_INVALID_BLOCK           9\n!define ERROR_BAD_ENVIRONMENT         10\n!define ERROR_BAD_FORMAT              11\n!define ERROR_INVALID_ACCESS          12\n!define ERROR_INVALID_DATA            13\n!define ERROR_OUTOFMEMORY             14\n!define ERROR_INVALID_DRIVE           15\n!define ERROR_CURRENT_DIRECTORY       16\n!define ERROR_NOT_SAME_DEVICE         17\n!define ERROR_NO_MORE_FILES           18\n!define ERROR_WRITE_PROTECT           19\n!define ERROR_BAD_UNIT                20\n!define ERROR_NOT_READY               21\n!define ERROR_BAD_COMMAND             22\n!define ERROR_CRC                     23\n!define ERROR_BAD_LENGTH              24\n!define ERROR_SEEK                    25\n!define ERROR_NOT_DOS_DISK            26\n!define ERROR_SECTOR_NOT_FOUND        27\n!define ERROR_OUT_OF_PAPER            28\n!define ERROR_WRITE_FAULT             29\n!define ERROR_READ_FAULT              30\n!define ERROR_GEN_FAILURE             31\n!define ERROR_SHARING_VIOLATION       32\n!define ERROR_LOCK_VIOLATION          33\n!define ERROR_WRONG_DISK              34\n!define ERROR_SHARING_BUFFER_EXCEEDED 36\n!define ERROR_HANDLE_EOF              38\n!define ERROR_HANDLE_DISK_FULL        39\n!define ERROR_NOT_SUPPORTED           50\n!define ERROR_CANNOT_MAKE             82 ; \"The directory or file cannot be created\"\n!define ERROR_INVALID_PARAMETER       87\n!define ERROR_DISK_FULL               112\n!define ERROR_CALL_NOT_IMPLEMENTED    120 ; \"This function is not supported on this system\"\n!define ERROR_INSUFFICIENT_BUFFER     122\n!define ERROR_INVALID_NAME            123 ; \"The filename, directory name, or volume label syntax is incorrect\"\n!define ERROR_MOD_NOT_FOUND           126 ; \"The specified module could not be found\"\n!define ERROR_BAD_ARGUMENTS           160\n!define ERROR_BAD_PATHNAME            161\n!define ERROR_LOCK_FAILED             167 ; \"Unable to lock a region of a file\"\n!define ERROR_BUSY                    170 ; \"The requested resource is in use\"\n!define ERROR_ALREADY_EXISTS          183 ; \"Cannot create a file when that file already exists\"\n!define ERROR_FILENAME_EXCED_RANGE    206 ; \"The filename or extension is too long\"\n!define ERROR_EXE_MACHINE_TYPE_MISMATCH 216 ; \"This version of %1 is not compatible with the version of Windows you're running\"\n!define ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT 308\n!define ERROR_DATA_CHECKSUM_ERROR     323\n!define ERROR_ELEVATION_REQUIRED      740\n!define ERROR_SERVICE_DOES_NOT_EXIST  1060\n!define ERROR_NO_MEDIA_IN_DRIVE       1112\n!define ERROR_NO_UNICODE_TRANSLATION  1113\n!define ERROR_DLL_INIT_FAILED         1114\n!define ERROR_SHUTDOWN_IN_PROGRESS    1115\n!define ERROR_OLD_WIN_VERSION         1150 ; \"The specified program requires a newer version of Windows\"\n!define ERROR_APP_WRONG_OS            1151 ; \"The specified program is not a Windows or MS-DOS program\"\n!define ERROR_SINGLE_INSTANCE_APP     1152 ; \"Cannot start more than one instance of the specified program\"\n!define ERROR_RMODE_APP               1153 ; \"The specified program was written for an earlier version of Windows\"\n!define ERROR_INVALID_DLL             1154\n!define ERROR_NO_ASSOCIATION          1155\n!define ERROR_DDE_FAIL                1156\n!define ERROR_DLL_NOT_FOUND           1157\n!define ERROR_NOT_FOUND               1168 ; \"Element not found\"\n!define ERROR_NO_MATCH                1169  ; \"There was no match for the specified key in the index\"\n!define ERROR_NO_VOLUME_ID            1173\n!define ERROR_UNABLE_TO_REMOVE_REPLACED 1175 ; \"Unable to remove the file to be replaced\"\n!define ERROR_UNABLE_TO_MOVE_REPLACEMENT 1176\n!define ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 1177\n!define ERROR_SHUTDOWN_IS_SCHEDULED   1190\n!define ERROR_SHUTDOWN_USERS_LOGGED_ON 1191 ; \"The system shutdown cannot be initiated because there are other users logged on to the computer\"\n!define ERROR_NO_NETWORK              1222\n!define ERROR_CANCELLED               1223 ; \"The operation was canceled by the user\"\n!define ERROR_RETRY                   1237\n!define ERROR_SERVICE_NOT_FOUND       1243\n!define ERROR_NOT_AUTHENTICATED       1244\n!define ERROR_UNIDENTIFIED_ERROR      1287\n!define ERROR_PRIVILEGE_NOT_HELD      1314\n!define ERROR_LOGON_FAILURE           1326 ; \"The user name or password is incorrect\"\n!define ERROR_INTERNAL_ERROR          1359 ; \"An internal error occurred\"\n!define ERROR_FILE_CORRUPT            1392 ; \"The file or directory is corrupted and unreadable\"\n!define ERROR_INVALID_WINDOW_HANDLE   1400 ; \"Invalid window handle\"\n!define ERROR_INVALID_INDEX           1413\n!define ERROR_TIMEOUT                 1460\n!define ERROR_SYMLINK_NOT_SUPPORTED   1464\n!define ERROR_XML_PARSE_ERROR         1465\n!define ERROR_RESTART_APPLICATION     1467 ; \"This application must be restarted\"\n!define ERROR_INSTALL_USEREXIT        1602 ; \"User cancelled installation\"\n!define ERROR_INSTALL_FAILURE         1603 ; \"Fatal error during installation\"\n!define ERROR_INSTALL_SUSPEND         1604 ; \"Installation suspended, incomplete\"\n!define ERROR_UNKNOWN_PRODUCT         1605 ; \"This action is only valid for products that are currently installed\"\n!define ERROR_BAD_CONFIGURATION       1610\n!define ERROR_INSTALL_SOURCE_ABSENT   1612\n!define ERROR_PRODUCT_UNINSTALLED     1614\n!define ERROR_INSTALL_ALREADY_RUNNING 1618 ; \"Another installation is already in progress. Complete that installation before proceeding with this install.\"\n!define ERROR_INSTALL_PACKAGE_INVALID 1620\n!define ERROR_INSTALL_LOG_FAILURE     1622\n!define ERROR_INSTALL_LANGUAGE_UNSUPPORTED 1623\n!define ERROR_FUNCTION_FAILED         1627\n!define ERROR_DATATYPE_MISMATCH       1629\n!define ERROR_UNSUPPORTED_TYPE        1630\n!define ERROR_INSTALL_TEMP_UNWRITABLE 1632 ; \"The Temp folder is on a drive that is full or is inaccessible\"\n!define ERROR_INSTALL_PLATFORM_UNSUPPORTED 1633 ; \"This installation package is not supported by this processor type. Contact your product vendor.\"\n!define ERROR_PRODUCT_VERSION         1638 ; \"Another version of this product is already installed\"\n!define ERROR_SUCCESS_REBOOT_INITIATED 1641 ; \"The requested operation completed successfully. The system will be restarted so the changes can take effect.\"\n!define ERROR_INSTALL_REJECTED        1654 ; \"The app that you are trying to run is not supported on this version of Windows\"\n!define ERROR_TAG_NOT_FOUND           2012\n!define ERROR_BAD_USERNAME            2202 ; \"The user name or group name parameter is invalid\"\n!define ERROR_SUCCESS_REBOOT_REQUIRED 3010\n!define ERROR_SUCCESS_RESTART_REQUIRED 3011\n!define ERROR_INSTALL_INVALID_PACKAGE 15602\n!define ERROR_INSTALL_OUT_OF_DISK_SPACE 15604\n!define ERROR_INSTALL_CANCEL          15608 ; \"User cancelled the install request\"\n!define ERROR_INSTALL_FAILED          15609\n!define ERROR_REMOVE_FAILED           15610\n!define ERROR_NEEDS_REMEDIATION       15612 ; \"The application cannot be started. Try reinstalling the application to fix the problem.\"\n\n!define SEVERITY_SUCCESS 0\n!define SEVERITY_ERROR   1\n!define FACILITY_STORAGE 3\n!define FACILITY_WIN32 7\n!define FACILITY_SECURITY 9\n!define FACILITY_SETUPAPI 15\n!define FACILITY_SXS 23\n!define /IfNDef S_OK    0\n!define /IfNDef S_FALSE 1\n!define E_UNEXPECTED   0x8000FFFF\n!define E_NOTIMPL      0x80004001\n!define E_OUTOFMEMORY  0x8007000E\n!define E_INVALIDARG   0x80070057\n!define E_NOINTERFACE  0x80004002\n!define E_POINTER      0x80004003\n!define E_HANDLE       0x80070006\n!define E_ABORT        0x80004004\n!define E_FAIL         0x80004005\n!define E_ACCESSDENIED 0x80070005\n!define E_PENDING      0x8000000A\n\n!endif /* __WIN_NOINC_WINERROR */\n\n!verbose pop\n!endif /* __WIN_WINERROR__INC */\n"
  },
  {
    "path": "setup/nsis/tools/Include/Win/WinNT.nsh",
    "content": "!ifndef __WIN_WINNT__INC\n!define __WIN_WINNT__INC\n!verbose push\n!verbose 3\n!ifndef __WIN_NOINC_WINNT\n\n\n#define MINCHAR  0x80        \n#define MAXCHAR  0x7f        \n!define MINSHORT 0x8000      \n!define MAXSHORT 0x7fff      \n!define MINLONG  0x80000000  \n!define MAXLONG  0x7fffffff  \n!define MAXBYTE  0xff        \n!define MAXWORD  0xffff      \n!define MAXDWORD 0xffffffff  \n\n!ifndef WIN32_NO_STATUS \n!define STATUS_WAIT_0                    0x00000000\n!define STATUS_ABANDONED_WAIT_0          0x00000080\n!define STATUS_USER_APC                  0x000000C0\n!define STATUS_TIMEOUT                   0x00000102\n!define STATUS_PENDING                   0x00000103\n!define DBG_EXCEPTION_HANDLED            0x00010001\n!define DBG_CONTINUE                     0x00010002\n!define STATUS_SEGMENT_NOTIFICATION      0x40000005\n!define DBG_TERMINATE_THREAD             0x40010003\n!define DBG_TERMINATE_PROCESS            0x40010004\n!define DBG_CONTROL_C                    0x40010005\n!define DBG_CONTROL_BREAK                0x40010008\n!define DBG_COMMAND_EXCEPTION            0x40010009\n!define STATUS_GUARD_PAGE_VIOLATION      0x80000001\n!define STATUS_DATATYPE_MISALIGNMENT     0x80000002\n!define STATUS_BREAKPOINT                0x80000003\n!define STATUS_SINGLE_STEP               0x80000004\n!define DBG_EXCEPTION_NOT_HANDLED        0x80010001\n!define STATUS_ACCESS_VIOLATION          0xC0000005\n!define STATUS_IN_PAGE_ERROR             0xC0000006\n!define STATUS_INVALID_HANDLE            0xC0000008\n!define STATUS_NO_MEMORY                 0xC0000017\n!define STATUS_ILLEGAL_INSTRUCTION       0xC000001D\n!define STATUS_NONCONTINUABLE_EXCEPTION  0xC0000025\n!define STATUS_INVALID_DISPOSITION       0xC0000026\n!define STATUS_ARRAY_BOUNDS_EXCEEDED     0xC000008C\n!define STATUS_FLOAT_DENORMAL_OPERAND    0xC000008D\n!define STATUS_FLOAT_DIVIDE_BY_ZERO      0xC000008E\n!define STATUS_FLOAT_INEXACT_RESULT      0xC000008F\n!define STATUS_FLOAT_INVALID_OPERATION   0xC0000090\n!define STATUS_FLOAT_OVERFLOW            0xC0000091\n!define STATUS_FLOAT_STACK_CHECK         0xC0000092\n!define STATUS_FLOAT_UNDERFLOW           0xC0000093\n!define STATUS_INTEGER_DIVIDE_BY_ZERO    0xC0000094\n!define STATUS_INTEGER_OVERFLOW          0xC0000095\n!define STATUS_PRIVILEGED_INSTRUCTION    0xC0000096\n!define STATUS_STACK_OVERFLOW            0xC00000FD\n!define STATUS_CONTROL_C_EXIT            0xC000013A\n!define STATUS_FLOAT_MULTIPLE_FAULTS     0xC00002B4\n!define STATUS_FLOAT_MULTIPLE_TRAPS      0xC00002B5\n!define STATUS_REG_NAT_CONSUMPTION       0xC00002C9\n!define STATUS_SXS_EARLY_DEACTIVATION    0xC015000F\n!define STATUS_SXS_INVALID_DEACTIVATION  0xC0150010\n!endif /*WIN32_NO_STATUS*/\n\n#define MAXIMUM_WAIT_OBJECTS 64  \n\n!define DELETE                   0x00010000\n!define READ_CONTROL             0x00020000\n!define WRITE_DAC                0x00040000\n!define WRITE_OWNER              0x00080000\n!define SYNCHRONIZE              0x00100000\n!define STANDARD_RIGHTS_REQUIRED 0x000F0000\n!define STANDARD_RIGHTS_READ     ${READ_CONTROL}\n!define STANDARD_RIGHTS_WRITE    ${READ_CONTROL}\n!define STANDARD_RIGHTS_EXECUTE  ${READ_CONTROL}\n!define STANDARD_RIGHTS_ALL      0x001F0000\n!define SPECIFIC_RIGHTS_ALL      0x0000FFFF\n!define ACCESS_SYSTEM_SECURITY   0x01000000\n!define MAXIMUM_ALLOWED          0x02000000\n!define GENERIC_READ             0x80000000\n!define GENERIC_WRITE            0x40000000\n!define GENERIC_EXECUTE          0x20000000\n!define GENERIC_ALL              0x10000000\n\n!define SE_PRIVILEGE_ENABLED_BY_DEFAULT 0x00000001\n!define SE_PRIVILEGE_ENABLED            0x00000002\n!define SE_PRIVILEGE_REMOVED            0x00000004\n!define SE_PRIVILEGE_USED_FOR_ACCESS    0x80000000\n\n!define SE_CREATE_TOKEN_NAME        \"SeCreateTokenPrivilege\"\n!define SE_ASSIGNPRIMARYTOKEN_NAME  \"SeAssignPrimaryTokenPrivilege\"\n!define SE_LOCK_MEMORY_NAME         \"SeLockMemoryPrivilege\"\n!define SE_INCREASE_QUOTA_NAME      \"SeIncreaseQuotaPrivilege\"\n!define SE_UNSOLICITED_INPUT_NAME   \"SeUnsolicitedInputPrivilege\"\n!define SE_MACHINE_ACCOUNT_NAME     \"SeMachineAccountPrivilege\"\n!define SE_TCB_NAME                 \"SeTcbPrivilege\"\n!define SE_SECURITY_NAME            \"SeSecurityPrivilege\"\n!define SE_TAKE_OWNERSHIP_NAME      \"SeTakeOwnershipPrivilege\"\n!define SE_LOAD_DRIVER_NAME         \"SeLoadDriverPrivilege\"\n!define SE_SYSTEM_PROFILE_NAME      \"SeSystemProfilePrivilege\"\n!define SE_SYSTEMTIME_NAME          \"SeSystemtimePrivilege\"\n!define SE_PROF_SINGLE_PROCESS_NAME \"SeProfileSingleProcessPrivilege\"\n!define SE_INC_BASE_PRIORITY_NAME   \"SeIncreaseBasePriorityPrivilege\"\n!define SE_CREATE_PAGEFILE_NAME     \"SeCreatePagefilePrivilege\"\n!define SE_CREATE_PERMANENT_NAME    \"SeCreatePermanentPrivilege\"\n!define SE_BACKUP_NAME              \"SeBackupPrivilege\"\n!define SE_RESTORE_NAME             \"SeRestorePrivilege\"\n!define SE_SHUTDOWN_NAME            \"SeShutdownPrivilege\"\n!define SE_DEBUG_NAME               \"SeDebugPrivilege\"\n!define SE_AUDIT_NAME               \"SeAuditPrivilege\"\n!define SE_SYSTEM_ENVIRONMENT_NAME  \"SeSystemEnvironmentPrivilege\"\n!define SE_CHANGE_NOTIFY_NAME       \"SeChangeNotifyPrivilege\"\n!define SE_REMOTE_SHUTDOWN_NAME     \"SeRemoteShutdownPrivilege\"\n!define SE_UNDOCK_NAME              \"SeUndockPrivilege\"\n!define SE_SYNC_AGENT_NAME          \"SeSyncAgentPrivilege\"\n!define SE_ENABLE_DELEGATION_NAME   \"SeEnableDelegationPrivilege\"\n!define SE_MANAGE_VOLUME_NAME       \"SeManageVolumePrivilege\"\n!define SE_IMPERSONATE_NAME         \"SeImpersonatePrivilege\"\n!define SE_CREATE_GLOBAL_NAME       \"SeCreateGlobalPrivilege\"\n\n!define TOKEN_ASSIGN_PRIMARY    0x0001\n!define TOKEN_DUPLICATE         0x0002\n!define TOKEN_IMPERSONATE       0x0004\n!define TOKEN_QUERY             0x0008\n!define TOKEN_QUERY_SOURCE      0x0010\n!define TOKEN_ADJUST_PRIVILEGES 0x0020\n!define TOKEN_ADJUST_GROUPS     0x0040\n!define TOKEN_ADJUST_DEFAULT    0x0080\n!define TOKEN_ADJUST_SESSIONID  0x0100\n!define TOKEN_ALL_ACCESS_P     0xF00FF\n!define /math TOKEN_ALL_ACCESS  ${TOKEN_ALL_ACCESS_P} | ${TOKEN_ADJUST_SESSIONID}\n!define /math TOKEN_READ        ${STANDARD_RIGHTS_READ} | ${TOKEN_QUERY}\n!define TOKEN_WRITE      0x200E0 ;(STANDARD_RIGHTS_WRITE|TOKEN_ADJUST_PRIVILEGES|TOKEN_ADJUST_GROUPS|TOKEN_ADJUST_DEFAULT)\n!define TOKEN_EXECUTE    ${STANDARD_RIGHTS_EXECUTE}\n\n!define PROCESS_TERMINATE         0x0001\n!define PROCESS_CREATE_THREAD     0x0002\n!define PROCESS_SET_SESSIONID     0x0004\n!define PROCESS_VM_OPERATION      0x0008\n!define PROCESS_VM_READ           0x0010\n!define PROCESS_VM_WRITE          0x0020\n!define PROCESS_DUP_HANDLE        0x0040\n!define PROCESS_CREATE_PROCESS    0x0080\n!define PROCESS_SET_QUOTA         0x0100\n!define PROCESS_SET_INFORMATION   0x0200\n!define PROCESS_QUERY_INFORMATION 0x0400\n!define PROCESS_SUSPEND_RESUME    0x0800\n!define PROCESS_ALL_ACCESS      0x1F0FFF ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF)\n!define THREAD_TERMINATE               0x0001\n!define THREAD_SUSPEND_RESUME          0x0002\n!define THREAD_GET_CONTEXT             0x0008\n!define THREAD_SET_CONTEXT             0x0010\n!define THREAD_SET_INFORMATION         0x0020\n!define THREAD_QUERY_INFORMATION       0x0040\n!define THREAD_SET_THREAD_TOKEN        0x0080\n!define THREAD_IMPERSONATE             0x0100\n!define THREAD_DIRECT_IMPERSONATION    0x0200\n!define THREAD_ALL_ACCESS            0x1F03FF ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3FF)\n!define JOB_OBJECT_ASSIGN_PROCESS           0x0001\n!define JOB_OBJECT_SET_ATTRIBUTES           0x0002\n!define JOB_OBJECT_QUERY                    0x0004\n!define JOB_OBJECT_TERMINATE                0x0008\n!define JOB_OBJECT_SET_SECURITY_ATTRIBUTES  0x0010\n!define JOB_OBJECT_ALL_ACCESS             0x1F001F ;(STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1F )\n!define EVENT_MODIFY_STATE      0x0002  \n!define EVENT_ALL_ACCESS 0x1F0003 ;(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) \n!define MUTANT_QUERY_STATE      0x0001\n!define MUTANT_ALL_ACCESS 0x1F0001 ;(STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)\n\n!define FILE_SHARE_READ   0x00000001\n!define FILE_SHARE_WRITE  0x00000002\n!define FILE_SHARE_DELETE 0x00000004\n!define FILE_ATTRIBUTE_READONLY             0x00000001\n!define FILE_ATTRIBUTE_HIDDEN               0x00000002\n!define FILE_ATTRIBUTE_SYSTEM               0x00000004\n!define FILE_ATTRIBUTE_DIRECTORY            0x00000010\n!define FILE_ATTRIBUTE_ARCHIVE              0x00000020\n!define FILE_ATTRIBUTE_DEVICE               0x00000040\n!define FILE_ATTRIBUTE_NORMAL               0x00000080\n!define FILE_ATTRIBUTE_TEMPORARY            0x00000100\n!define FILE_ATTRIBUTE_SPARSE_FILE          0x00000200\n!define FILE_ATTRIBUTE_REPARSE_POINT        0x00000400\n!define FILE_ATTRIBUTE_COMPRESSED           0x00000800\n!define FILE_ATTRIBUTE_OFFLINE              0x00001000\n!define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  0x00002000\n!define FILE_ATTRIBUTE_ENCRYPTED            0x00004000\n\n!define DUPLICATE_CLOSE_SOURCE 0x00000001\n!define DUPLICATE_SAME_ACCESS  0x00000002\n\n!define /ifndef VER_PLATFORM_WIN32s         0\n!define /ifndef VER_PLATFORM_WIN32_WINDOWS  1\n!define /ifndef VER_PLATFORM_WIN32_NT       2\n\n!ifndef REG_SZ & NSIS_WINDOWS__NO_REGTYPES\n!define REG_NONE                 0\n!define REG_SZ                   1\n!define REG_EXPAND_SZ            2\n!define REG_BINARY               3\n!define REG_DWORD                4\n!define REG_DWORD_LITTLE_ENDIAN  4\n!define REG_DWORD_BIG_ENDIAN     5\n!define REG_LINK                 6\n!define REG_MULTI_SZ             7\n!endif\n\n!define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF\n!define PROCESSOR_ARCHITECTURE_INTEL          0 ; x86\n!define PROCESSOR_ARCHITECTURE_ARM            5\n!define PROCESSOR_ARCHITECTURE_IA64           6 ; Itanium\n!define PROCESSOR_ARCHITECTURE_AMD64          9 ; x86-64/x64\n!define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64  10\n!define PROCESSOR_ARCHITECTURE_ARM64          12\n!define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13\n\n!define IMAGE_FILE_MACHINE_UNKNOWN 0\n!define IMAGE_FILE_MACHINE_I386  332   ; x86\n!define IMAGE_FILE_MACHINE_ARMNT 452\n!define IMAGE_FILE_MACHINE_IA64  512   ; Itanium\n!define IMAGE_FILE_MACHINE_AMD64 34404 ; x86-64/x64\n!define IMAGE_FILE_MACHINE_ARM64 43620\n\n!endif /* __WIN_NOINC_WINNT */\n!verbose pop\n!endif /* __WIN_WINNT__INC */"
  },
  {
    "path": "setup/nsis/tools/Include/Win/WinUser.nsh",
    "content": "!ifndef __WIN_WINUSER__INC\n!define __WIN_WINUSER__INC\n!verbose push\n!verbose 3\n!ifndef __WIN_MS_NOUSER & __WIN_NOINC_WINUSER\n\n!ifndef __WIN_MS_NOVIRTUALKEYCODES\n!define VK_LBUTTON    0x01\n!define VK_RBUTTON    0x02\n!define VK_CANCEL     0x03\n!define VK_MBUTTON    0x04 /* NOT contiguous with L & RBUTTON */\n!define VK_XBUTTON1   0x05 /* NOT contiguous with L & RBUTTON */\n!define VK_XBUTTON2   0x06 /* NOT contiguous with L & RBUTTON */\n!define VK_BACK       0x08\n!define VK_TAB        0x09\n!define VK_CLEAR      0x0C\n!define VK_RETURN     0x0D\n!define VK_SHIFT      0x10\n!define VK_CONTROL    0x11\n!define VK_MENU       0x12\n!define VK_PAUSE      0x13\n!define VK_CAPITAL    0x14\n!define VK_ESCAPE     0x1B\n!define VK_CONVERT    0x1C\n!define VK_NONCONVERT 0x1D\n!define VK_ACCEPT     0x1E\n!define VK_MODECHANGE 0x1F\n!define VK_SPACE      0x20\n!define VK_PRIOR      0x21\n!define VK_NEXT       0x22\n!define VK_END        0x23\n!define VK_HOME       0x24\n!define VK_LEFT       0x25\n!define VK_UP         0x26\n!define VK_RIGHT      0x27\n!define VK_DOWN       0x28\n!define VK_SELECT     0x29\n!define VK_PRINT      0x2A\n!define VK_EXECUTE    0x2B\n!define VK_SNAPSHOT   0x2C\n!define VK_INSERT     0x2D\n!define VK_DELETE     0x2E\n!define VK_HELP       0x2F\n; VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)\n; VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)\n!define VK_LWIN           0x5B\n!define VK_RWIN           0x5C\n!define VK_APPS           0x5D\n!define VK_SLEEP          0x5F\n!define VK_NUMPAD0        0x60\n!define VK_NUMPAD1        0x61\n!define VK_NUMPAD2        0x62\n!define VK_NUMPAD3        0x63\n!define VK_NUMPAD4        0x64\n!define VK_NUMPAD5        0x65\n!define VK_NUMPAD6        0x66\n!define VK_NUMPAD7        0x67\n!define VK_NUMPAD8        0x68\n!define VK_NUMPAD9        0x69\n!define VK_MULTIPLY       0x6A\n!define VK_ADD            0x6B\n!define VK_SEPARATOR      0x6C\n!define VK_SUBTRACT       0x6D\n!define VK_DECIMAL        0x6E\n!define VK_DIVIDE         0x6F\n!define VK_F1             0x70\n!define VK_F2             0x71\n!define VK_F3             0x72\n!define VK_F4             0x73\n!define VK_F5             0x74\n!define VK_F6             0x75\n!define VK_F7             0x76\n!define VK_F8             0x77\n!define VK_F9             0x78\n!define VK_F10            0x79\n!define VK_F11            0x7A\n!define VK_F12            0x7B\n!define VK_NUMLOCK        0x90\n!define VK_SCROLL         0x91\n!define VK_OEM_NEC_EQUAL  0x92   ; '=' key on numpad\n!define VK_LSHIFT         0xA0\n!define VK_RSHIFT         0xA1\n!define VK_LCONTROL       0xA2\n!define VK_RCONTROL       0xA3\n!define VK_LMENU          0xA4\n!define VK_RMENU          0xA5\n!endif\n\n!ifndef __WIN_MS_NOWINOFFSETS\n!define /ifndef GWL_STYLE       -16\n!define /ifndef GWL_EXSTYLE     -20\n!define /ifndef GWLP_WNDPROC    -4\n!define /ifndef GWLP_HINSTANCE  -6\n!define /ifndef GWLP_HWNDPARENT -8\n!define /ifndef GWLP_USERDATA   -21\n!define /ifndef GWLP_ID         -12\n!define DWLP_MSGRESULT  0\n!define /math DWLP_DLGPROC ${DWLP_MSGRESULT} + ${NSIS_PTR_SIZE} ;DWLP_MSGRESULT + sizeof(LRESULT) \n!define /math DWLP_USER    ${DWLP_DLGPROC} + ${NSIS_PTR_SIZE} ;DWLP_DLGPROC + sizeof(DLGPROC)\n!endif\n\n!ifndef __WIN_MS_NONCMESSAGES\n!define HTERROR       -2\n!define HTTRANSPARENT -1\n!define HTNOWHERE     0\n!define HTCLIENT      1\n!define HTCAPTION     2\n!define HTSYSMENU     3\n!define HTGROWBOX     4\n!define HTSIZE        ${HTGROWBOX}\n!define HTMENU        5\n!define HTHSCROLL     6\n!define HTVSCROLL     7\n!define HTMINBUTTON   8\n!define HTMAXBUTTON   9\n!define HTLEFT        10\n!define HTRIGHT       11\n!define HTTOP         12\n!define HTTOPLEFT     13\n!define HTTOPRIGHT    14\n!define HTBOTTOM      15\n!define HTBOTTOMLEFT  16\n!define HTBOTTOMRIGHT 17\n!define HTBORDER      18\n!define HTREDUCE      ${HTMINBUTTON}\n!define HTZOOM        ${HTMAXBUTTON}\n!define HTSIZEFIRST   ${HTLEFT}\n!define HTSIZELAST    ${HTBOTTOMRIGHT}\n!define HTOBJECT      19\n!define HTCLOSE       20\n!define HTHELP        21\n!endif\n\n!ifndef __WIN_MS_NOSYSCOMMANDS\n!define SC_SIZE         0xF000\n!define SC_MOVE         0xF010\n!define SC_MINIMIZE     0xF020\n!define SC_MAXIMIZE     0xF030\n!define SC_NEXTWINDOW   0xF040\n!define SC_PREVWINDOW   0xF050\n!define SC_CLOSE        0xF060\n!define SC_VSCROLL      0xF070\n!define SC_HSCROLL      0xF080\n!define SC_MOUSEMENU    0xF090\n!define SC_KEYMENU      0xF100\n!define SC_ARRANGE      0xF110\n!define SC_RESTORE      0xF120\n!define SC_TASKLIST     0xF130\n!define SC_SCREENSAVE   0xF140\n!define SC_HOTKEY       0xF150\n!define SC_DEFAULT      0xF160\n!define SC_MONITORPOWER 0xF170\n!define SC_CONTEXTHELP  0xF180\n!define SC_SEPARATOR    0xF00F\n!endif\n\n!define /ifndef IDC_ARROW       32512\n!define /ifndef IDC_IBEAM       32513\n!define /ifndef IDC_WAIT        32514\n!define /ifndef IDC_CROSS       32515\n!define /ifndef IDC_UPARROW     32516\n!define /ifndef IDC_SIZE        32640\n!define /ifndef IDC_ICON        32641\n!define /ifndef IDC_SIZENWSE    32642\n!define /ifndef IDC_SIZENESW    32643\n!define /ifndef IDC_SIZEWE      32644\n!define /ifndef IDC_SIZENS      32645\n!define /ifndef IDC_SIZEALL     32646\n!define /ifndef IDC_NO          32648 \n!define /ifndef IDC_HAND        32649\n!define /ifndef IDC_APPSTARTING 32650 \n!define /ifndef IDC_HELP        32651\n\n!define /ifndef IMAGE_BITMAP        0\n!define /ifndef IMAGE_ICON          1\n!define /ifndef IMAGE_CURSOR        2\n!define /ifndef IMAGE_ENHMETAFILE   3\n\n!define /ifndef LR_DEFAULTCOLOR     0x0000\n!define /ifndef LR_MONOCHROME       0x0001\n!define /ifndef LR_COLOR            0x0002\n!define /ifndef LR_COPYRETURNORG    0x0004\n!define /ifndef LR_COPYDELETEORG    0x0008\n!define /ifndef LR_LOADFROMFILE     0x0010\n!define /ifndef LR_LOADTRANSPARENT  0x0020\n!define /ifndef LR_DEFAULTSIZE      0x0040\n!define /ifndef LR_VGACOLOR         0x0080\n!define /ifndef LR_LOADMAP3DCOLORS  0x1000\n!define /ifndef LR_CREATEDIBSECTION 0x2000\n!define /ifndef LR_COPYFROMRESOURCE 0x4000\n!define /ifndef LR_SHARED           0x8000\n\n!define GA_PARENT    1\n!define GA_ROOT      2\n!define GA_ROOTOWNER 3\n\n!endif /* __WIN_MS_NOUSER & __WIN_NOINC_WINUSER */\n!verbose pop\n!endif /* __WIN_WINUSER__INC */"
  },
  {
    "path": "setup/nsis/tools/Include/WinCore.nsh",
    "content": "/*\n\nWinCore.nsh & Win\\*.nsh - Collection of common windows defines\n\n!define __WIN_NOINC_xxx to exclude a windows header file\n!define __WIN_MS_xxx to exclude specific things (The original #ifdef xxx checks can be found in the official Microsoft headers)\n\n*/\n\n!ifndef __WIN_WINDOWS__INC\n!define __WIN_WINDOWS__INC\n!verbose push\n!verbose 3\n\n\n\n!include Win\\WinDef.nsh\n!include Win\\WinError.nsh\n!include Win\\WinNT.nsh\n!include Win\\WinUser.nsh\n\n!ifndef __WIN_MS_NOWINMESSAGES\n!include WinMessages.nsh\n!endif\n\n\n\n\n\n/**************************************************\nWinBase.h\n**************************************************/\n!ifndef __WIN_NOINC_WINBASE\n!define /ifndef INVALID_HANDLE_VALUE -1\n!define /ifndef INVALID_FILE_SIZE 0xFFFFFFFF\n!define /ifndef INVALID_SET_FILE_POINTER -1\n!define /ifndef INVALID_FILE_ATTRIBUTES -1\n\n!define WAIT_FAILED 0xFFFFFFFF\n!define WAIT_OBJECT_0       0 ;((STATUS_WAIT_0 ) + 0 )\n\n!define WAIT_ABANDONED         0x80 ;((STATUS_ABANDONED_WAIT_0 ) + 0 )\n!define WAIT_ABANDONED_0       0x80 ;((STATUS_ABANDONED_WAIT_0 ) + 0 )\n\n!define DRIVE_UNKNOWN     0\n!define DRIVE_NO_ROOT_DIR 1\n!define DRIVE_REMOVABLE   2\n!define DRIVE_FIXED       3\n!define DRIVE_REMOTE      4\n!define DRIVE_CDROM       5\n!define DRIVE_RAMDISK     6\n\n!define FILE_TYPE_UNKNOWN   0x0000\n!define FILE_TYPE_DISK      0x0001\n!define FILE_TYPE_CHAR      0x0002\n!define FILE_TYPE_PIPE      0x0003\n!define FILE_TYPE_REMOTE    0x8000\n\n!define STD_INPUT_HANDLE   -10\n!define STD_OUTPUT_HANDLE  -11\n!define STD_ERROR_HANDLE   -12\n\n#define IGNORE              0       ; Ignore signal\n!define INFINITE            0xFFFFFFFF  ; Infinite timeout\n\n!endif /* __WIN_NOINC_WINBASE */\n\n\n\n\n\n/**************************************************\nWinGDI.h\n**************************************************/\n!ifndef __WIN_MS_NOGDI & __WIN_NOINC_WINGDI\n!define HORZRES       8 \n!define VERTRES       10\n!define BITSPIXEL     12\n!define LOGPIXELSX    88\n!define LOGPIXELSY    90\n!define COLORRES     108\n!define VREFRESH     116\n!define DESKTOPVERTRES 117\n!define DESKTOPHORZRES 118\n!endif /* __WIN_MS_NOGDI & __WIN_NOINC_WINGDI */\n\n\n\n\n\n/**************************************************\nWinReg.h\n**************************************************/\n!ifndef __WIN_NOINC_WINREG\n!ifndef __WIN_NOHKEY & HKEY_CLASSES_ROOT & HKEY_CURRENT_USER & HKEY_LOCAL_MACHINE & HKEY_USERS\n!define HKEY_CLASSES_ROOT        0x80000000\n!define HKEY_CURRENT_USER        0x80000001\n!define HKEY_LOCAL_MACHINE       0x80000002\n!define HKEY_USERS               0x80000003\n!define HKEY_PERFORMANCE_DATA    0x80000004\n!define HKEY_PERFORMANCE_TEXT    0x80000050\n!define HKEY_PERFORMANCE_NLSTEXT 0x80000060\n!define HKEY_CURRENT_CONFIG      0x80000005\n!define HKEY_DYN_DATA            0x80000006\n!ifndef __WIN_NOSHORTHKEY & HKCR & HKCU & HKLM\n!define HKCR ${HKEY_CLASSES_ROOT}\n!define HKCU ${HKEY_CURRENT_USER}\n!define HKLM ${HKEY_LOCAL_MACHINE}\n!endif\n!endif\n!endif /* __WIN_NOINC_WINREG */\n\n\n\n\n\n/**************************************************\nWindowsX.h\n**************************************************/\n!ifndef __WIN_NOINC_WINDOWSX\n!ifndef GET_X_LPARAM & GET_Y_LPARAM\n!macro _Win_GET_X_LPARAM _outvar _in\nIntOp ${_outvar} \"${_in}\" << 16   ;We can't just use LOWORD, we need to keep the sign,\nIntOp ${_outvar} ${_outvar} >> 16 ;so we let NSIS sign extend for us\n!macroend\n!define GET_X_LPARAM \"!insertmacro _Win_GET_X_LPARAM \"\n!macro _Win_GET_Y_LPARAM _outvar _in\nIntOp ${_outvar} \"${_in}\" >> 16\n!macroend\n!define GET_Y_LPARAM \"!insertmacro _Win_GET_Y_LPARAM \"\n!endif\n!endif /* __WIN_NOINC_WINDOWSX */\n\n\n\n\n\n/**************************************************\nShlObj.h\n**************************************************/\n!ifndef __WIN_NOINC_SHLOBJ\n!ifndef __WIN_NOSHELLFOLDERCSIDL\n!define CSIDL_DESKTOP                 0x0000\n!define CSIDL_INTERNET                0x0001 ;Internet Explorer (icon on desktop)\n!define CSIDL_PROGRAMS                0x0002 ;Start Menu\\Programs\n!define CSIDL_CONTROLS                0x0003 ;My Computer\\Control Panel\n!define CSIDL_PRINTERS                0x0004 ;My Computer\\Printers\n!define CSIDL_PERSONAL                0x0005 ;My Documents\n!define CSIDL_FAVORITES               0x0006 ;<user name>\\Favorites\n!define CSIDL_STARTUP                 0x0007 ;Start Menu\\Programs\\Startup\n!define CSIDL_RECENT                  0x0008 ;<user name>\\Recent\n!define CSIDL_SENDTO                  0x0009 ;<user name>\\SendTo\n!define CSIDL_BITBUCKET               0x000a ;<desktop>\\Recycle Bin\n!define CSIDL_STARTMENU               0x000b ;<user name>\\Start Menu\n!define CSIDL_MYDOCUMENTS             0x000c ;logical \"My Documents\" desktop icon\n!define CSIDL_MYMUSIC                 0x000d ;\"My Music\" folder\n!define CSIDL_MYVIDEO                 0x000e ;\"My Videos\" folder\n!define CSIDL_DESKTOPDIRECTORY        0x0010 ;<user name>\\Desktop\n!define CSIDL_DRIVES                  0x0011 ;My Computer\n!define CSIDL_NETWORK                 0x0012 ;Network Neighborhood\n!define CSIDL_NETHOOD                 0x0013 ;<user name>\\nethood\n!define CSIDL_FONTS                   0x0014 ;windows\\fonts\n!define CSIDL_TEMPLATES               0x0015\n!define CSIDL_COMMON_STARTMENU        0x0016 ;All Users\\Start Menu\n!define CSIDL_COMMON_PROGRAMS         0x0017 ;All Users\\Start Menu\\Programs\n!define CSIDL_COMMON_STARTUP          0x0018 ;All Users\\Startup\n!define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 ;All Users\\Desktop\n!define CSIDL_APPDATA                 0x001a ;<user name>\\Application Data\n!define CSIDL_PRINTHOOD               0x001b ;<user name>\\PrintHood\n!define CSIDL_LOCAL_APPDATA           0x001c ;<user name>\\Local Settings\\Application Data (non roaming)\n!define CSIDL_ALTSTARTUP              0x001d ;non localized startup\n!define CSIDL_COMMON_ALTSTARTUP       0x001e ;non localized common startup\n!define CSIDL_COMMON_FAVORITES        0x001f\n!define CSIDL_INTERNET_CACHE          0x0020\n!define CSIDL_COOKIES                 0x0021\n!define CSIDL_HISTORY                 0x0022\n!define CSIDL_COMMON_APPDATA          0x0023 ;All Users\\Application Data\n!define CSIDL_WINDOWS                 0x0024 ;GetWindowsDirectory\n!define CSIDL_SYSTEM                  0x0025 ;GetSystemDirectory\n!define CSIDL_PROGRAM_FILES           0x0026 ;C:\\Program Files\n!define CSIDL_MYPICTURES              0x0027\n!define CSIDL_PROFILE                 0x0028 ;USERPROFILE\n!define CSIDL_SYSTEMX86               0x0029 ;x86 system directory on RISC\n!define CSIDL_PROGRAM_FILESX86        0x002a ;x86 C:\\Program Files on RISC\n!define CSIDL_PROGRAM_FILES_COMMON    0x002b ;C:\\Program Files\\Common\n!define CSIDL_PROGRAM_FILES_COMMONX86 0x002c ;x86 Program Files\\Common on RISC\n!define CSIDL_COMMON_TEMPLATES        0x002d ;All Users\\Templates\n!define CSIDL_COMMON_DOCUMENTS        0x002e ;All Users\\Documents\n!define CSIDL_COMMON_ADMINTOOLS       0x002f ;All Users\\Start Menu\\Programs\\Administrative Tools\n!define CSIDL_ADMINTOOLS              0x0030 ;<user name>\\Start Menu\\Programs\\Administrative Tools\n!define CSIDL_CONNECTIONS             0x0031 ;Network and Dial-up Connections\n!define CSIDL_COMMON_MUSIC            0x0035 ;All Users\\My Music\n!define CSIDL_COMMON_PICTURES         0x0036 ;All Users\\My Pictures\n!define CSIDL_COMMON_VIDEO            0x0037 ;All Users\\My Video\n!define CSIDL_RESOURCES               0x0038 ;Resource Directory\n!define CSIDL_RESOURCES_LOCALIZED     0x0039 ;Localized Resource Directory\n!define CSIDL_COMMON_OEM_LINKS        0x003a ;Links to All Users OEM specific apps\n!define CSIDL_CDBURN_AREA             0x003b ;USERPROFILE\\Local Settings\\Application Data\\Microsoft\\CD Burning\n!define CSIDL_COMPUTERSNEARME         0x003d ;Computers Near Me (computered from Workgroup membership)\n!define CSIDL_FLAG_CREATE             0x8000 ;combine with CSIDL_ value to force folder creation in SHGetFolderPath()\n!define CSIDL_FLAG_DONT_VERIFY        0x4000 ;combine with CSIDL_ value to return an unverified folder path\n!define CSIDL_FLAG_NO_ALIAS           0x1000 ;combine with CSIDL_ value to insure non-alias versions of the pidl\n!define CSIDL_FLAG_PER_USER_INIT      0x0800 ;combine with CSIDL_ value to indicate per-user init (eg. upgrade)\n!define CSIDL_FLAG_MASK               0xFF00\n!endif /* __WIN_NOSHELLFOLDERCSIDL */\n!endif /* __WIN_NOINC_SHLOBJ */\n\n\n\n\n\n/**************************************************\nShobjidl.h\n**************************************************/\n!ifndef __WIN_NOINC_SHOBJIDL\n; ASSOCIATIONLEVEL\n!define AL_MACHINE 0\n!define AL_EFFECTIVE 1\n!define AL_USER 2\n\n; ASSOCIATIONTYPE\n!define AT_FILEEXTENSION 0\n!define AT_URLPROTOCOL 1\n!define AT_STARTMENUCLIENT 2\n!define AT_MIMETYPE 3\n!endif /* __WIN_NOINC_SHOBJIDL */\n\n\n\n\n\n/**************************************************\nShlGuid.h\n**************************************************/\n!ifndef __WIN_NOINC_SHLGUID\n!define FOLDERID_Public {DFDF76A2-C82A-4D63-906A-5644AC457385} ; Vista+ Fixed=%SystemDrive%\\Users\\Public\n!define FOLDERID_Games {CAC52C1A-B53D-4edc-92D7-6B2E8AC19434} ; Vista+ && < 10 (1803) Virtual\n!define FOLDERID_SavedGames {4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4} ; Vista+ PerUser=%USERPROFILE%\\Saved Games\n!define FOLDERID_GameTasks {054FAE61-4DD8-4787-80B6-090220C4B700} ; Vista+ PerUser=%LOCALAPPDATA%\\Microsoft\\Windows\\GameExplorer\n!define FOLDERID_PublicGameTasks {DEBF2536-E1A8-4c59-B6A2-414586476AEA} ; Vista+ Common=%ALLUSERSPROFILE%\\Microsoft\\Windows\\GameExplorer\n!define FOLDERID_Contacts {56784854-C6CB-462b-8169-88E350ACB882} ; Vista+ PerUser=%USERPROFILE%\\Contacts\n!define FOLDERID_Downloads {374DE290-123F-4565-9164-39C4925E467B} ; Vista+ PerUser=%USERPROFILE%\\Downloads\n!define FOLDERID_PublicDownloads {3D644C9B-1FB8-4f30-9B45-F670235F79C0} ; Vista+ Common=%PUBLIC%\\Downloads\n!define FOLDERID_UserProfiles {0762D272-C50A-4BB0-A382-697DCD729B80} ; Vista+ Fixed=%SystemDrive%\\Users\n!define FOLDERID_UserProgramFiles {5CD7AEE2-2219-4A67-B85D-6C9CE15660CB} ; 7+ PerUser=%LOCALAPPDATA%\\Programs\n!define FOLDERID_UserProgramFilesCommon {BCBD3057-CA5C-4622-B42D-BC56DB0AE516} ; 7+ PerUser=%LOCALAPPDATA%\\Programs\\Common\n!define FOLDERID_PublicLibraries {48DAF80B-E6CF-4F4E-B800-0E69D84EE384} ; 7+ Common=%ALLUSERSPROFILE%\\Microsoft\\Windows\\Libraries\n!define FOLDERID_UserPinned {9E3995AB-1F9C-4F13-B827-48B24B6C7174} ; 7+ PerUser=%APPDATA%\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\n!define FOLDERID_ImplicitAppShortcuts {BCB5256F-79F6-4CEE-B725-DC34E402FD46} ; 7+ PerUser=%APPDATA%\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\ImplicitAppShortcuts\n!define FOLDERID_DeviceMetadataStore {5CE4A5E9-E4EB-479D-B89F-130C02886155} ; 7+ Common=%ALLUSERSPROFILE%\\Microsoft\\Windows\\DeviceMetadataStore\n!define FOLDERID_ApplicationShortcuts {A3918781-E5F2-4890-B3D9-A7E54332328C} ; 8.0+ PerUser=%LOCALAPPDATA%\\Microsoft\\Windows\\Application Shortcuts\n!define FOLDERID_RoamingTiles {00BCFC5A-ED94-4e48-96A1-3F6217F21990} ; 8.0+ PerUser=%LOCALAPPDATA%\\Microsoft\\Windows\\RoamingTiles\n!define FOLDERID_RoamedTileImages {AAA8D5A5-F1D6-4259-BAA8-78E7EF60835E} ; 8.0+ PerUser=%LOCALAPPDATA%\\Microsoft\\Windows\\RoamedTileImages\n!define FOLDERID_PublicUserTiles {0482af6c-08f1-4c34-8c90-e17ec98b1e17} ; 8.0+ Common=%PUBLIC%\\AccountPictures\n!define FOLDERID_AccountPictures {008ca0b1-55b4-4c56-b8a8-4de4b299d3be} ; 8.0+ PerUser=%APPDATA%\\Microsoft\\Windows\\AccountPictures\n!define FOLDERID_Screenshots {b7bede81-df94-4682-a7d8-57a52620b86f} ; 8.0+ PerUser=%USERPROFILE%\\Pictures\\Screenshots\n!define FOLDERID_SkyDrive {A52BBA46-E9E1-435f-B3D9-28DAA648C0F6} ; 8.1+ PerUser=%USERPROFILE%\\OneDrive\n!define FOLDERID_AppDataProgramData {559D40A3-A036-40FA-AF61-84CB430A4D34} ; 10 (1709)+ PerUser=%LOCALAPPDATA%\\ProgramData\n!endif /* __WIN_NOINC_SHLGUID */\n\n\n!verbose pop\n!endif /* __WIN_WINDOWS__INC */"
  },
  {
    "path": "setup/nsis/tools/Include/WinMessages.nsh",
    "content": "/*\n_____________________________________________________________________________\n\n                       List of common Windows Messages\n_____________________________________________________________________________\n\n 2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\n\nUsage example:\n---------------------------------------------------\nName \"Output\"\nOutFile \"Output.exe\"\n\n!include \"WinMessages.nsh\"\n\nSection\n\tFindWindow $0 '#32770' '' $HWNDPARENT\n\tGetDlgItem $1 $0 1027\n\tSendMessage $1 ${WM_SETTEXT} 0 'STR:MyText'\nSectionEnd\n---------------------------------------------------\n\n\nPrefix  Message category\n-------------------------\nSW      ShowWindow Commands\nCCM     Generic Common Control\nBM      Button control\nCB      Combo box control\nEM      Edit control\nLB      List box control\nWM      General window\nABM     Application desktop toolbar\nDBT     Device\nDM      Default push button control\nHDM     Header control\nLVM     List view control\nSB      Status bar window\nSBM     Scroll bar control\nSTM     Static control\nTCM     Tab control\nPBM     Progress bar\nACM     Animation control\nTBM     Track bar\nUDM     Up-down control\nHKM     Hot key control\nIPM     IP address control\nNCM     Network address control\n-----------------------------------\n\nNOT included messages (WM_USER + X)\n-----------------------------------\nCBEM    Extended combo box control\nCDM     Common dialog box\nDL      Drag list box\nPGM     Pager control\nPSM     Property sheet\nRB      Rebar control\nTB      Toolbar\nTTM     Tooltip control\nTVM     Tree-view control\n-----------------------------------\n*/\n\n\n!ifndef WINMESSAGES_INCLUDED\n!define WINMESSAGES_INCLUDED\n!verbose push\n!verbose 3\n\n!define _NSIS_DEFAW '!insertmacro _NSIS_DEFAW '\n!macro _NSIS_DEFAW d\n!ifdef NSIS_UNICODE\n!define ${d} \"${${d}W}\"\n!else\n!define ${d} \"${${d}A}\"\n!endif\n!macroend\n\n!define HWND_BROADCAST      0xFFFF\n\n#ShowWindow Commands#\n!define SW_HIDE             0\n!define SW_SHOWNORMAL       1\n!define SW_NORMAL           1\n!define SW_SHOWMINIMIZED    2\n!define SW_SHOWMAXIMIZED    3\n!define SW_MAXIMIZE         3\n!define SW_SHOWNOACTIVATE   4\n!define SW_SHOW             5\n!define SW_MINIMIZE         6\n!define SW_SHOWMINNOACTIVE  7\n!define SW_SHOWNA           8\n!define SW_RESTORE          9\n!define SW_SHOWDEFAULT      10\n!define SW_FORCEMINIMIZE    11\n!define SW_MAX              11\n\n#Generic Common Control Messages#\n!define CCM_FIRST 0x2000\n!define /math CCM_SETBKCOLOR       ${CCM_FIRST} + 0x1 ; IE4\n!define /math CCM_SETUNICODEFORMAT ${CCM_FIRST} + 0x5 \n!define /math CCM_GETUNICODEFORMAT ${CCM_FIRST} + 0x6\n!define /math CCM_SETVERSION       ${CCM_FIRST} + 0x7 ; IE5\n!define /math CCM_GETVERSION       ${CCM_FIRST} + 0x8\n!define /math CCM_SETWINDOWTHEME   ${CCM_FIRST} + 0xB ; WinXP\n!define /math CCM_DPISCALE         ${CCM_FIRST} + 0xC\n!define WM_USER 0x400\n\n!define CCS_TOP 1\n!define CCS_BOTTOM 3\n!define CCS_NODIVIDER 64\n!define CCS_LEFT 129\n!define CCS_RIGHT 131\n\n!define I_IMAGENONE -2\n\n#Button Control Messages#\n!define BM_CLICK           0x00F5\n!define BM_GETCHECK        0x00F0\n!define BM_GETIMAGE        0x00F6\n!define BM_GETSTATE        0x00F2\n!define BM_SETCHECK        0x00F1\n!define BM_SETIMAGE        0x00F7\n!define BM_SETSTATE        0x00F3\n!define BM_SETSTYLE        0x00F4\n!define BCM_SETSHIELD      0x160C ; WinVista + ComCtl32 v6\n\n!define BST_UNCHECKED      0\n!define BST_CHECKED        1\n!define BST_INDETERMINATE  2\n!define BST_PUSHED         4\n!define BST_FOCUS          8\n\n#Combo Box Messages#\n!define CB_ADDSTRING                0x0143\n!define CB_DELETESTRING             0x0144\n!define CB_DIR                      0x0145\n!define CB_FINDSTRING               0x014C\n!define CB_FINDSTRINGEXACT          0x0158\n!define CB_GETCOUNT                 0x0146\n!define CB_GETCURSEL                0x0147\n!define CB_GETDROPPEDCONTROLRECT    0x0152\n!define CB_GETDROPPEDSTATE          0x0157\n!define CB_GETDROPPEDWIDTH          0x015f\n!define CB_GETEDITSEL               0x0140\n!define CB_GETEXTENDEDUI            0x0156\n!define CB_GETHORIZONTALEXTENT      0x015d\n!define CB_GETITEMDATA              0x0150\n!define CB_GETITEMHEIGHT            0x0154\n!define CB_GETLBTEXT                0x0148\n!define CB_GETLBTEXTLEN             0x0149\n!define CB_GETLOCALE                0x015A\n!define CB_GETTOPINDEX              0x015b\n!define CB_INITSTORAGE              0x0161\n!define CB_INSERTSTRING             0x014A\n!define CB_LIMITTEXT                0x0141\n!define CB_MSGMAX                   0x015B  # 0x0162 0x0163\n!define CB_MULTIPLEADDSTRING        0x0163\n!define CB_RESETCONTENT             0x014B\n!define CB_SELECTSTRING             0x014D\n!define CB_SETCURSEL                0x014E\n!define CB_SETDROPPEDWIDTH          0x0160\n!define CB_SETEDITSEL               0x0142\n!define CB_SETEXTENDEDUI            0x0155\n!define CB_SETHORIZONTALEXTENT      0x015e\n!define CB_SETITEMDATA              0x0151\n!define CB_SETITEMHEIGHT            0x0153\n!define CB_SETLOCALE                0x0159\n!define CB_SETTOPINDEX              0x015c\n!define CB_SHOWDROPDOWN             0x014F\n!define CBM_FIRST                   0x1700 ; Vista+\n!define /math CB_SETMINVISIBLE ${CBM_FIRST} + 1\n!define /math CB_GETMINVISIBLE ${CBM_FIRST} + 2\n!define /math CB_SETCUEBANNER  ${CBM_FIRST} + 3\n!define /math CB_GETCUEBANNER  ${CBM_FIRST} + 4\n\n!define CB_ERR                      -1\n\n#Edit Control Messages#\n!define EM_CANUNDO              0x00C6\n!define EM_CHARFROMPOS          0x00D7\n!define EM_EMPTYUNDOBUFFER      0x00CD\n!define EM_FMTLINES             0x00C8\n!define EM_GETFIRSTVISIBLELINE  0x00CE\n!define EM_GETHANDLE            0x00BD\n!define EM_GETIMESTATUS         0x00D9\n!define EM_GETLIMITTEXT         0x00D5\n!define EM_GETLINE              0x00C4\n!define EM_GETLINECOUNT         0x00BA\n!define EM_GETMARGINS           0x00D4\n!define EM_GETMODIFY            0x00B8\n!define EM_GETPASSWORDCHAR      0x00D2\n!define EM_GETRECT              0x00B2\n!define EM_GETSEL               0x00B0\n!define EM_GETTHUMB             0x00BE\n!define EM_GETWORDBREAKPROC     0x00D1\n!define EM_LIMITTEXT            0x00C5\n!define EM_LINEFROMCHAR         0x00C9\n!define EM_LINEINDEX            0x00BB\n!define EM_LINELENGTH           0x00C1\n!define EM_LINESCROLL           0x00B6\n!define EM_POSFROMCHAR          0x00D6\n!define EM_REPLACESEL           0x00C2\n!define EM_SCROLL               0x00B5\n!define EM_SCROLLCARET          0x00B7\n!define EM_SETHANDLE            0x00BC\n!define EM_SETIMESTATUS         0x00D8\n!define EM_SETLIMITTEXT         0x00C5  # Same as EM_LIMITTEXT\n!define EM_SETMARGINS           0x00D3\n!define EM_SETMODIFY            0x00B9\n!define EM_SETPASSWORDCHAR      0x00CC\n!define EM_SETREADONLY          0x00CF\n!define EM_SETRECT              0x00B3\n!define EM_SETRECTNP            0x00B4\n!define EM_SETSEL               0x00B1\n!define EM_SETTABSTOPS          0x00CB\n!define EM_SETWORDBREAKPROC     0x00D0\n!define EM_UNDO                 0x00C7\n!define ECM_FIRST               0x1500 ; CC6+\n!define /math EM_SETCUEBANNER ${ECM_FIRST} + 1\n\n#RichEdit Messages#\n!define /math EM_EXGETSEL        ${WM_USER} + 52\n!define /math EM_EXLIMITTEXT     ${WM_USER} + 53\n!define /math EM_EXLINEFROMCHAR  ${WM_USER} + 54\n!define /math EM_GETEVENTMASK    ${WM_USER} + 59\n!define /math EM_GETOLEINTERFACE ${WM_USER} + 60\n!define /math EM_HIDESELECTION   ${WM_USER} + 63\n!define /math EM_SETBKGNDCOLOR   ${WM_USER} + 67\n!define /math EM_SETEVENTMASK    ${WM_USER} + 69\n!define /math EM_STREAMIN        ${WM_USER} + 73\n!define /math EM_STREAMOUT       ${WM_USER} + 74\n!define /math EM_GETTEXTRANGE    ${WM_USER} + 75\n!define /math EM_SETOPTIONS      ${WM_USER} + 77\n!define /math EM_GETOPTIONS      ${WM_USER} + 78\n!define /math EM_SETUNDOLIMIT    ${WM_USER} + 82 ; v2+\n!define /math EM_AUTOURLDETECT   ${WM_USER} + 91\n!define /Math EM_SETTEXTEX       ${WM_USER} + 97 ; v3+\n!define /math EM_SETEDITSTYLE    ${WM_USER} + 204\n!define /math EM_SETFONTSIZE     ${WM_USER} + 223\n\n!define EN_MSGFILTER 0x0700\n!define EN_SELCHANGE 0x0702\n!define EN_LINK      0x070b\n\n!define ENM_NONE         0x00000000\n!define ENM_CHANGE       0x00000001\n!define ENM_UPDATE       0x00000002\n!define ENM_SCROLL       0x00000004\n!define ENM_SCROLLEVENTS 0x00000008\n!define ENM_KEYEVENTS    0x00010000\n!define ENM_MOUSEEVENTS  0x00020000\n!define ENM_SELCHANGE    0x00080000\n!define ENM_LINK         0x04000000 ; v2+\n\n#Listbox Messages#\n!define LB_ADDFILE              0x0196\n!define LB_ADDSTRING            0x0180\n!define LB_DELETESTRING         0x0182\n!define LB_DIR                  0x018D\n!define LB_FINDSTRING           0x018F\n!define LB_FINDSTRINGEXACT      0x01A2\n!define LB_GETANCHORINDEX       0x019D\n!define LB_GETCARETINDEX        0x019F\n!define LB_GETCOUNT             0x018B\n!define LB_GETCURSEL            0x0188\n!define LB_GETHORIZONTALEXTENT  0x0193\n!define LB_GETITEMDATA          0x0199\n!define LB_GETITEMHEIGHT        0x01A1\n!define LB_GETITEMRECT          0x0198\n!define LB_GETLOCALE            0x01A6\n!define LB_GETSEL               0x0187\n!define LB_GETSELCOUNT          0x0190\n!define LB_GETSELITEMS          0x0191\n!define LB_GETTEXT              0x0189\n!define LB_GETTEXTLEN           0x018A\n!define LB_GETTOPINDEX          0x018E\n!define LB_INITSTORAGE          0x01A8\n!define LB_INSERTSTRING         0x0181\n!define LB_ITEMFROMPOINT        0x01A9\n!define LB_MSGMAX               0x01A8  # 0x01B0 0x01B1\n!define LB_MULTIPLEADDSTRING    0x01B1\n!define LB_RESETCONTENT         0x0184\n!define LB_SELECTSTRING         0x018C\n!define LB_SELITEMRANGE         0x019B\n!define LB_SELITEMRANGEEX       0x0183\n!define LB_SETANCHORINDEX       0x019C\n!define LB_SETCARETINDEX        0x019E\n!define LB_SETCOLUMNWIDTH       0x0195\n!define LB_SETCOUNT             0x01A7\n!define LB_SETCURSEL            0x0186\n!define LB_SETHORIZONTALEXTENT  0x0194\n!define LB_SETITEMDATA          0x019A\n!define LB_SETITEMHEIGHT        0x01A0\n!define LB_SETLOCALE            0x01A5\n!define LB_SETSEL               0x0185\n!define LB_SETTABSTOPS          0x0192\n!define LB_SETTOPINDEX          0x0197\n\n!define LB_ERR                  -1\n\n#Window Messages#\n!define WM_ACTIVATE                     0x0006\n!define WM_ACTIVATEAPP                  0x001C\n!define WM_AFXFIRST                     0x0360\n!define WM_AFXLAST                      0x037F\n!define WM_APP                          0x8000\n!define WM_APPCOMMAND                   0x0319\n!define WM_ASKCBFORMATNAME              0x030C\n!define WM_CANCELJOURNAL                0x004B\n!define WM_CANCELMODE                   0x001F\n!define WM_CAPTURECHANGED               0x0215\n!define WM_CHANGECBCHAIN                0x030D\n!define WM_CHANGEUISTATE                0x0127\n!define WM_CHAR                         0x0102\n!define WM_CHARTOITEM                   0x002F\n!define WM_CHILDACTIVATE                0x0022\n!define WM_CLEAR                        0x0303\n!define WM_CLOSE                        0x0010\n!define WM_COMMAND                      0x0111\n!define WM_COMMNOTIFY                   0x0044  # no longer supported\n!define WM_COMPACTING                   0x0041\n!define WM_COMPAREITEM                  0x0039\n!define WM_CONTEXTMENU                  0x007B\n!define WM_CONVERTREQUESTEX             0x108\n!define WM_COPY                         0x0301\n!define WM_COPYDATA                     0x004A\n!define WM_CREATE                       0x0001\n!define WM_CTLCOLOR                     0x0019\n!define WM_CTLCOLORBTN                  0x0135\n!define WM_CTLCOLORDLG                  0x0136\n!define WM_CTLCOLOREDIT                 0x0133\n!define WM_CTLCOLORLISTBOX              0x0134\n!define WM_CTLCOLORMSGBOX               0x0132\n!define WM_CTLCOLORSCROLLBAR            0x0137\n!define WM_CTLCOLORSTATIC               0x0138\n!define WM_CUT                          0x0300\n!define WM_DDE_FIRST                    0x3E0\n!define WM_DEADCHAR                     0x0103\n!define WM_DELETEITEM                   0x002D\n!define WM_DESTROY                      0x0002\n!define WM_DESTROYCLIPBOARD             0x0307\n!define WM_DEVICECHANGE                 0x0219\n!define WM_DEVMODECHANGE                0x001B\n!define WM_DISPLAYCHANGE                0x007E\n!define WM_DRAWCLIPBOARD                0x0308\n!define WM_DRAWITEM                     0x002B\n!define WM_DROPFILES                    0x0233\n!define WM_ENABLE                       0x000A\n!define WM_ENDSESSION                   0x0016\n!define WM_ENTERIDLE                    0x0121\n!define WM_ENTERMENULOOP                0x0211\n!define WM_ENTERSIZEMOVE                0x0231\n!define WM_ERASEBKGND                   0x0014\n!define WM_EXITMENULOOP                 0x0212\n!define WM_EXITSIZEMOVE                 0x0232\n!define WM_FONTCHANGE                   0x001D\n!define WM_GETDLGCODE                   0x0087\n!define WM_GETFONT                      0x0031\n!define WM_GETHOTKEY                    0x0033\n!define WM_GETICON                      0x007F\n!define WM_GETMINMAXINFO                0x0024\n!define WM_GETOBJECT                    0x003D\n!define WM_GETTEXT                      0x000D\n!define WM_GETTEXTLENGTH                0x000E\n!define WM_HANDHELDFIRST                0x0358\n!define WM_HANDHELDLAST                 0x035F\n!define WM_HELP                         0x0053\n!define WM_HOTKEY                       0x0312\n!define WM_HSCROLL                      0x0114\n!define WM_HSCROLLCLIPBOARD             0x030E\n!define WM_ICONERASEBKGND               0x0027\n!define WM_IME_CHAR                     0x0286\n!define WM_IME_COMPOSITION              0x010F\n!define WM_IME_COMPOSITIONFULL          0x0284\n!define WM_IME_CONTROL                  0x0283\n!define WM_IME_ENDCOMPOSITION           0x010E\n!define WM_IME_KEYDOWN                  0x0290\n!define WM_IME_KEYLAST                  0x010F\n!define WM_IME_KEYUP                    0x0291\n!define WM_IME_NOTIFY                   0x0282\n!define WM_IME_REQUEST                  0x0288\n!define WM_IME_SELECT                   0x0285\n!define WM_IME_SETCONTEXT               0x0281\n!define WM_IME_STARTCOMPOSITION         0x010D\n!define WM_INITDIALOG                   0x0110\n!define WM_INITMENU                     0x0116\n!define WM_INITMENUPOPUP                0x0117\n!define WM_INPUT                        0x00FF\n!define WM_INPUTLANGCHANGE              0x0051\n!define WM_INPUTLANGCHANGEREQUEST       0x0050\n!define WM_KEYDOWN                      0x0100\n!define WM_KEYFIRST                     0x0100\n!define WM_KEYLAST                      0x0108\n!define WM_KEYUP                        0x0101\n!define WM_KILLFOCUS                    0x0008\n!define WM_LBUTTONDBLCLK                0x0203\n!define WM_LBUTTONDOWN                  0x0201\n!define WM_LBUTTONUP                    0x0202\n!define WM_MBUTTONDBLCLK                0x0209\n!define WM_MBUTTONDOWN                  0x0207\n!define WM_MBUTTONUP                    0x0208\n!define WM_MDIACTIVATE                  0x0222\n!define WM_MDICASCADE                   0x0227\n!define WM_MDICREATE                    0x0220\n!define WM_MDIDESTROY                   0x0221\n!define WM_MDIGETACTIVE                 0x0229\n!define WM_MDIICONARRANGE               0x0228\n!define WM_MDIMAXIMIZE                  0x0225\n!define WM_MDINEXT                      0x0224\n!define WM_MDIREFRESHMENU               0x0234\n!define WM_MDIRESTORE                   0x0223\n!define WM_MDISETMENU                   0x0230\n!define WM_MDITILE                      0x0226\n!define WM_MEASUREITEM                  0x002C\n!define WM_MENUCHAR                     0x0120\n!define WM_MENUCOMMAND                  0x0126\n!define WM_MENUDRAG                     0x0123\n!define WM_MENUGETOBJECT                0x0124\n!define WM_MENURBUTTONUP                0x0122\n!define WM_MENUSELECT                   0x011F\n!define WM_MOUSEACTIVATE                0x0021\n!define WM_MOUSEFIRST                   0x0200\n!define WM_MOUSEHOVER                   0x02A1\n!define WM_MOUSELAST                    0x0209  # 0x020A 0x020D\n!define WM_MOUSELEAVE                   0x02A3\n!define WM_MOUSEMOVE                    0x0200\n!define WM_MOUSEWHEEL                   0x020A\n!define WM_MOVE                         0x0003\n!define WM_MOVING                       0x0216\n!define WM_NCACTIVATE                   0x0086\n!define WM_NCCALCSIZE                   0x0083\n!define WM_NCCREATE                     0x0081\n!define WM_NCDESTROY                    0x0082\n!define WM_NCHITTEST                    0x0084\n!define WM_NCLBUTTONDBLCLK              0x00A3\n!define WM_NCLBUTTONDOWN                0x00A1\n!define WM_NCLBUTTONUP                  0x00A2\n!define WM_NCMBUTTONDBLCLK              0x00A9\n!define WM_NCMBUTTONDOWN                0x00A7\n!define WM_NCMBUTTONUP                  0x00A8\n!define WM_NCMOUSEHOVER                 0x02A0\n!define WM_NCMOUSELEAVE                 0x02A2\n!define WM_NCMOUSEMOVE                  0x00A0\n!define WM_NCPAINT                      0x0085\n!define WM_NCRBUTTONDBLCLK              0x00A6\n!define WM_NCRBUTTONDOWN                0x00A4\n!define WM_NCRBUTTONUP                  0x00A5\n!define WM_NCXBUTTONDBLCLK              0x00AD\n!define WM_NCXBUTTONDOWN                0x00AB\n!define WM_NCXBUTTONUP                  0x00AC\n!define WM_NEXTDLGCTL                   0x0028\n!define WM_NEXTMENU                     0x0213\n!define WM_NOTIFY                       0x004E\n!define WM_NOTIFYFORMAT                 0x0055\n!define WM_NULL                         0x0000\n!define WM_PAINT                        0x000F\n!define WM_PAINTCLIPBOARD               0x0309\n!define WM_PAINTICON                    0x0026\n!define WM_PALETTECHANGED               0x0311\n!define WM_PALETTEISCHANGING            0x0310\n!define WM_PARENTNOTIFY                 0x0210\n!define WM_PASTE                        0x0302\n!define WM_PENWINFIRST                  0x0380\n!define WM_PENWINLAST                   0x038F\n!define WM_POWER                        0x0048\n!define WM_POWERBROADCAST               0x0218\n!define WM_PRINT                        0x0317\n!define WM_PRINTCLIENT                  0x0318\n!define WM_QUERYDRAGICON                0x0037\n!define WM_QUERYENDSESSION              0x0011\n!define WM_QUERYNEWPALETTE              0x030F\n!define WM_QUERYOPEN                    0x0013\n!define WM_QUERYUISTATE                 0x0129\n!define WM_QUEUESYNC                    0x0023\n!define WM_QUIT                         0x0012\n!define WM_RBUTTONDBLCLK                0x0206\n!define WM_RBUTTONDOWN                  0x0204\n!define WM_RBUTTONUP                    0x0205\n!define WM_RASDIALEVENT                 0xCCCD\n!define WM_RENDERALLFORMATS             0x0306\n!define WM_RENDERFORMAT                 0x0305\n!define WM_SETCURSOR                    0x0020\n!define WM_SETFOCUS                     0x0007\n!define WM_SETFONT                      0x0030\n!define WM_SETHOTKEY                    0x0032\n!define WM_SETICON                      0x0080\n!define WM_SETREDRAW                    0x000B\n!define WM_SETTEXT                      0x000C\n!define WM_SETTINGCHANGE                0x001A  # Same as WM_WININICHANGE\n!define WM_SHOWWINDOW                   0x0018\n!define WM_SIZE                         0x0005\n!define WM_SIZECLIPBOARD                0x030B\n!define WM_SIZING                       0x0214\n!define WM_SPOOLERSTATUS                0x002A\n!define WM_STYLECHANGED                 0x007D\n!define WM_STYLECHANGING                0x007C\n!define WM_SYNCPAINT                    0x0088\n!define WM_SYSCHAR                      0x0106\n!define WM_SYSCOLORCHANGE               0x0015\n!define WM_SYSCOMMAND                   0x0112\n!define WM_SYSDEADCHAR                  0x0107\n!define WM_SYSKEYDOWN                   0x0104\n!define WM_SYSKEYUP                     0x0105\n!define WM_TABLET_FIRST                 0x02C0\n!define WM_TABLET_LAST                  0x02DF\n!define WM_THEMECHANGED                 0x031A\n!define WM_TCARD                        0x0052\n!define WM_TIMECHANGE                   0x001E\n!define WM_TIMER                        0x0113\n!define WM_UNDO                         0x0304\n!define WM_UNICHAR                      0x0109\n!define WM_UNINITMENUPOPUP              0x0125\n!define WM_UPDATEUISTATE                0x0128\n!define WM_USERCHANGED                  0x0054\n!define WM_VKEYTOITEM                   0x002E\n!define WM_VSCROLL                      0x0115\n!define WM_VSCROLLCLIPBOARD             0x030A\n!define WM_WINDOWPOSCHANGED             0x0047\n!define WM_WINDOWPOSCHANGING            0x0046\n!define WM_WININICHANGE                 0x001A\n!define WM_WTSSESSION_CHANGE            0x02B1\n!define WM_XBUTTONDBLCLK                0x020D\n!define WM_XBUTTONDOWN                  0x020B\n!define WM_XBUTTONUP                    0x020C\n\n\n#Application desktop toolbar#\n!define ABM_ACTIVATE         0x00000006  # lParam == TRUE/FALSE means activate/deactivate\n!define ABM_GETAUTOHIDEBAR   0x00000007\n!define ABM_GETSTATE         0x00000004\n!define ABM_GETTASKBARPOS    0x00000005\n!define ABM_NEW              0x00000000\n!define ABM_QUERYPOS         0x00000002\n!define ABM_REMOVE           0x00000001\n!define ABM_SETAUTOHIDEBAR   0x00000008  # This can fail, you MUST check the result\n!define ABM_SETPOS           0x00000003\n!define ABM_WINDOWPOSCHANGED 0x0000009\n\n#Device#\n!define DBT_APPYBEGIN                   0x0000\n!define DBT_APPYEND                     0x0001\n!define DBT_CONFIGCHANGECANCELED        0x0019\n!define DBT_CONFIGCHANGED               0x0018\n!define DBT_CONFIGMGAPI32               0x0022\n!define DBT_CONFIGMGPRIVATE             0x7FFF\n!define DBT_CUSTOMEVENT                 0x8006  # User-defined event\n!define DBT_DEVICEARRIVAL               0x8000  # System detected a new device\n!define DBT_DEVICEQUERYREMOVE           0x8001  # Wants to remove, may fail\n!define DBT_DEVICEQUERYREMOVEFAILED     0x8002  # Removal aborted\n!define DBT_DEVICEREMOVECOMPLETE        0x8004  # Device is gone\n!define DBT_DEVICEREMOVEPENDING         0x8003  # About to remove, still avail.\n!define DBT_DEVICETYPESPECIFIC          0x8005  # Type specific event\n!define DBT_DEVNODES_CHANGED            0x0007\n!define DBT_DEVTYP_DEVICEINTERFACE      0x00000005  # Device interface class\n!define DBT_DEVTYP_DEVNODE              0x00000001  # Devnode number\n!define DBT_DEVTYP_HANDLE               0x00000006  # File system handle\n!define DBT_DEVTYP_NET                  0x00000004  # Network resource\n!define DBT_DEVTYP_OEM                  0x00000000  # Oem-defined device type\n!define DBT_DEVTYP_PORT                 0x00000003  # Serial, parallel\n!define DBT_DEVTYP_VOLUME               0x00000002  # Logical volume\n!define DBT_LOW_DISK_SPACE              0x0048\n!define DBT_MONITORCHANGE               0x001B\n!define DBT_NO_DISK_SPACE               0x0047\n!define DBT_QUERYCHANGECONFIG           0x0017\n!define DBT_SHELLLOGGEDON               0x0020\n!define DBT_USERDEFINED                 0xFFFF\n!define DBT_VOLLOCKLOCKFAILED           0x8043\n!define DBT_VOLLOCKLOCKRELEASED         0x8045\n!define DBT_VOLLOCKLOCKTAKEN            0x8042\n!define DBT_VOLLOCKQUERYLOCK            0x8041\n!define DBT_VOLLOCKQUERYUNLOCK          0x8044\n!define DBT_VOLLOCKUNLOCKFAILED         0x8046\n!define DBT_VPOWERDAPI                  0x8100  # VPOWERD API for Win95\n!define DBT_VXDINITCOMPLETE             0x0023\n\n#Default push button control#\n!define DM_BITSPERPEL       0x00040000\n!define DM_COLLATE          0x00008000\n!define DM_COLOR            0x00000800\n!define DM_COPIES           0x00000100\n!define DM_DEFAULTSOURCE    0x00000200\n!define DM_DISPLAYFLAGS     0x00200000\n!define DM_DISPLAYFREQUENCY 0x00400000\n!define DM_DITHERTYPE       0x04000000\n!define DM_DUPLEX           0x00001000\n!define DM_FORMNAME         0x00010000\n!define DM_GRAYSCALE        0x00000001  # This flag is no longer valid\n!define DM_ICMINTENT        0x01000000\n!define DM_ICMMETHOD        0x00800000\n!define DM_INTERLACED       0x00000002  # This flag is no longer valid\n!define DM_LOGPIXELS        0x00020000\n!define DM_MEDIATYPE        0x02000000\n!define DM_NUP              0x00000040\n!define DM_ORIENTATION      0x00000001\n!define DM_PANNINGHEIGHT    0x10000000\n!define DM_PANNINGWIDTH     0x08000000\n!define DM_PAPERLENGTH      0x00000004\n!define DM_PAPERSIZE        0x00000002\n!define DM_PAPERWIDTH       0x00000008\n!define DM_PELSHEIGHT       0x00100000\n!define DM_PELSWIDTH        0x00080000\n!define DM_POSITION         0x00000020\n!define DM_PRINTQUALITY     0x00000400\n!define DM_SCALE            0x00000010\n!define DM_SPECVERSION      0x0320       # 0x0400 0x0401\n!define DM_TTOPTION         0x00004000\n!define DM_YRESOLUTION      0x00002000\n\n#Header control#\n!define HDM_FIRST           0x1200\n\n#List view control#\n!define LVS_SINGLESEL           4\n!define LVS_SHOWSELALWAYS       8\n!define LVS_SORTASCENDING    0x10\n!define LVS_SORTDESCENDING   0x20\n!define LVS_SHAREIMAGELISTS  0x40\n!define LVS_EDITLABELS      0x200\n!define LVS_NOSCROLL       0x2000\n!define LVS_NOCOLUMNHEADER 0x4000\n!define LVS_NOSORTHEADER   0x8000\n!define LVS_ICON      0\n!define LVS_REPORT    1\n!define LVS_SMALLICON 2\n!define LVS_LIST      3\n!define LVS_EX_CHECKBOXES         4\n!define LVS_EX_FULLROWSELECT   0x20\n!define LVS_EX_INFOTIP        0x400\n!define LVS_EX_LABELTIP      0x4000\n!define LVS_EX_DOUBLEBUFFER 0x10000\n!define LVIF_TEXT  1\n!define LVIF_IMAGE 2\n!define LVIF_PARAM 4\n!define LVIF_STATE 8\n!define LVIS_STATEIMAGEMASK 0xF000\n!define LVCF_FMT     1\n!define LVCF_WIDTH   2\n!define LVCF_TEXT    4\n!define LVCF_SUBITEM 8\n!define SYSSTRUCT_LVITEM_V1 (i,i,i,i,&i${NSIS_PTR_SIZE},t,i,i,p)\n!define SYSSTRUCT_LVITEM_V2 (i,i,i,i,&i${NSIS_PTR_SIZE},t,i,i,p,i)           ; IE3\n!define SYSSTRUCT_LVITEM_V3 (i,i,i,i,&i${NSIS_PTR_SIZE},t,i,i,p,i,i,i,i)     ; WinXP + ComCtl32 v6\n!define SYSSTRUCT_LVITEM_V4 (i,i,i,i,&i${NSIS_PTR_SIZE},t,i,i,p,i,i,i,i,i,i) ; WinVista + ComCtl32 v6\n!define LVSCW_AUTOSIZE -1\n!define LVSCW_AUTOSIZE_USEHEADER -2\n!define LVM_FIRST                          0x00001000\n!define /math LVM_GETIMAGELIST             ${LVM_FIRST} +  2\n!define /math LVM_SETIMAGELIST             ${LVM_FIRST} +  3\n!define /math LVM_GETITEMCOUNT             ${LVM_FIRST} +  4\n!define /math LVM_GETITEMA                 ${LVM_FIRST} +  5\n!define /math LVM_SETITEMA                 ${LVM_FIRST} +  6\n!define /math LVM_INSERTITEMA              ${LVM_FIRST} +  7\n!define /math LVM_DELETEITEM               ${LVM_FIRST} +  8\n!define /math LVM_DELETEALLITEMS           ${LVM_FIRST} +  9\n!define /math LVM_INSERTCOLUMNA            ${LVM_FIRST} + 27\n!define /math LVM_SETCOLUMNWIDTH           ${LVM_FIRST} + 30\n!define /math LVM_SETITEMSTATE             ${LVM_FIRST} + 43\n!define /math LVM_GETITEMSTATE             ${LVM_FIRST} + 44\n!define /math LVM_GETITEMTEXTA             ${LVM_FIRST} + 45\n!define /math LVM_SETITEMTEXTA             ${LVM_FIRST} + 46\n!define /math LVM_SETITEMCOUNT             ${LVM_FIRST} + 47\n!define /math LVM_SORTITEMS                ${LVM_FIRST} + 48\n!define /math LVM_SETEXTENDEDLISTVIEWSTYLE ${LVM_FIRST} + 54\n!define /math LVM_GETEXTENDEDLISTVIEWSTYLE ${LVM_FIRST} + 55\n!define /math LVM_GETITEMW                 ${LVM_FIRST} + 75\n!define /math LVM_SETITEMW                 ${LVM_FIRST} + 76\n!define /math LVM_INSERTITEMW              ${LVM_FIRST} + 77\n!define /math LVM_INSERTCOLUMNW            ${LVM_FIRST} + 97\n!define /math LVM_GETITEMTEXTW             ${LVM_FIRST} + 115\n!define /math LVM_SETITEMTEXTW             ${LVM_FIRST} + 116\n!define /math LVM_SETSELECTEDCOLUMN        ${LVM_FIRST} + 140\n${_NSIS_DEFAW} LVM_GETITEM\n${_NSIS_DEFAW} LVM_SETITEM\n${_NSIS_DEFAW} LVM_INSERTITEM\n${_NSIS_DEFAW} LVM_INSERTCOLUMN\n${_NSIS_DEFAW} LVM_GETITEMTEXT\n${_NSIS_DEFAW} LVM_SETITEMTEXT\n\n#Status bar window#\n!define SB_SIMPLEID 0x00ff\n\n#Scroll bar control#\n!define SBM_ENABLE_ARROWS           0x00E4  # Not in win3.1\n!define SBM_GETPOS                  0x00E1  # Not in win3.1\n!define SBM_GETRANGE                0x00E3  # Not in win3.1\n!define SBM_GETSCROLLINFO           0x00EA\n!define SBM_SETPOS                  0x00E0  # Not in win3.1\n!define SBM_SETRANGE                0x00E2  # Not in win3.1\n!define SBM_SETRANGEREDRAW          0x00E6  # Not in win3.1\n!define SBM_SETSCROLLINFO           0x00E9\n\n#Static control#\n!define STM_SETICON                 0x0170\n!define STM_GETICON                 0x0171\n!define STM_SETIMAGE                0x0172\n!define STM_GETIMAGE                0x0173\n!define STM_MSGMAX                  0x0174\n\n#Tab control#\n!define TCS_SCROLLOPPOSITE 0x0001\n!define TCIF_TEXT  1\n!define TCIF_PARAM 8\n!define SYSSTRUCT_TCITEM (i,i,&i${NSIS_PTR_SIZE},t,i,i,p)\n!define TCM_FIRST             0x1300\n!define /math TCM_INSERTITEMA ${TCM_FIRST} + 7\n!define /math TCM_GETCURSEL   ${TCM_FIRST} + 11\n!define /math TCM_ADJUSTRECT  ${TCM_FIRST} + 40\n!define /math TCM_INSERTITEMW ${TCM_FIRST} + 62\n!define TCN_SELCHANGE   -551\n!define TCN_SELCHANGING -552\n${_NSIS_DEFAW} TCM_INSERTITEM\n\n#Progress bar control#\n!define PBM_SETRANGE    0x401\n!define PBM_SETPOS      0x402\n!define PBM_DELTAPOS    0x403\n!define PBM_SETSTEP     0x404\n!define PBM_STEPIT      0x405\n!define PBM_SETRANGE32  0x406 ; IE3 + ComCtl32 v4.70\n!define PBM_GETRANGE    0x407\n!define PBM_GETPOS      0x408\n!define PBM_SETBARCOLOR 0x409 ; IE4 + ComCtl32 v4.71\n!define PBM_SETBKCOLOR  ${CCM_SETBKCOLOR}\n!define PBM_SETMARQUEE  0x40A ; WinXP + ComCtl32 v6\n!define PBM_GETSTEP     0x40D ; WinVista\n!define PBM_GETBKCOLOR  0x40E\n!define PBM_GETBARCOLOR 0x40F\n!define PBM_SETSTATE    0x410\n!define PBM_GETSTATE    0x411\n\n!define PBST_NORMAL 1\n!define PBST_ERROR  2\n!define PBST_PAUSED 3\n\n#Animation control#\n!define /math ACM_OPENA ${WM_USER} + 100\n!define /math ACM_PLAY  ${WM_USER} + 101\n!define /math ACM_STOP  ${WM_USER} + 102\n!define /math ACM_OPENW ${WM_USER} + 103\n${_NSIS_DEFAW} ACM_OPEN\n\n#TrackBar control#\n!define /math TBM_GETPOS         ${WM_USER} + 0\n!define /math TBM_GETRANGEMIN    ${WM_USER} + 1\n!define /math TBM_GETRANGEMAX    ${WM_USER} + 2\n!define /math TBM_GETTIC         ${WM_USER} + 3\n!define /math TBM_SETTIC         ${WM_USER} + 4\n!define /math TBM_SETPOS         ${WM_USER} + 5\n!define /math TBM_SETRANGE       ${WM_USER} + 6\n!define /math TBM_SETRANGEMIN    ${WM_USER} + 7\n!define /math TBM_SETRANGEMAX    ${WM_USER} + 8\n!define /math TBM_CLEARTICS      ${WM_USER} + 9\n!define /math TBM_SETSEL         ${WM_USER} + 10\n!define /math TBM_SETSELSTART    ${WM_USER} + 11\n!define /math TBM_SETSELEND      ${WM_USER} + 12\n!define /math TBM_GETPTICS       ${WM_USER} + 14\n!define /math TBM_GETTICPOS      ${WM_USER} + 15\n!define /math TBM_GETNUMTICS     ${WM_USER} + 16\n!define /math TBM_GETSELSTART    ${WM_USER} + 17\n!define /math TBM_GETSELEND      ${WM_USER} + 18\n!define /math TBM_CLEARSEL       ${WM_USER} + 19\n!define /math TBM_SETTICFREQ     ${WM_USER} + 20 ; TBS_AUTOTICKS required\n!define /math TBM_SETPAGESIZE    ${WM_USER} + 21\n!define /math TBM_GETPAGESIZE    ${WM_USER} + 22\n!define /math TBM_SETLINESIZE    ${WM_USER} + 23\n!define /math TBM_GETLINESIZE    ${WM_USER} + 24\n!define /math TBM_GETTHUMBRECT   ${WM_USER} + 25\n!define /math TBM_GETCHANNELRECT ${WM_USER} + 26\n!define /math TBM_SETTHUMBLENGTH ${WM_USER} + 27\n!define /math TBM_GETTHUMBLENGTH ${WM_USER} + 28\n!define /math TBM_SETTOOLTIPS    ${WM_USER} + 29 ; IE3\n!define /math TBM_GETTOOLTIPS    ${WM_USER} + 30 ; IE3\n!define /math TBM_SETTIPSIDE     ${WM_USER} + 31 ; IE3\n!define /math TBM_SETBUDDY       ${WM_USER} + 32 ; IE3\n!define /math TBM_GETBUDDY       ${WM_USER} + 33 ; IE3\n!define TBM_SETUNICODEFORMAT     ${CCM_SETUNICODEFORMAT} ; IE4\n!define TBM_GETUNICODEFORMAT     ${CCM_GETUNICODEFORMAT} ; IE4\n!define /math TBM_SETPOSNOTIFY   ${WM_USER} + 34 ; 7?\n\n#UpDown controls#\n!define /math UDM_SETRANGE   ${WM_USER} + 101\n!define /math UDM_GETRANGE   ${WM_USER} + 102\n!define /math UDM_SETPOS     ${WM_USER} + 103\n!define /math UDM_GETPOS     ${WM_USER} + 104\n!define /math UDM_SETBUDDY   ${WM_USER} + 105\n!define /math UDM_GETBUDDY   ${WM_USER} + 106\n!define /math UDM_SETACCEL   ${WM_USER} + 107\n!define /math UDM_GETACCEL   ${WM_USER} + 108\n!define /math UDM_SETBASE    ${WM_USER} + 109\n!define /math UDM_GETBASE    ${WM_USER} + 110\n!define /math UDM_SETRANGE32 ${WM_USER} + 111 ; IE4\n!define /math UDM_GETRANGE32 ${WM_USER} + 112 ; IE4\n!define UDM_SETUNICODEFORMAT ${CCM_SETUNICODEFORMAT} ; IE4\n!define UDM_GETUNICODEFORMAT ${CCM_GETUNICODEFORMAT} ; IE4\n!define /math UDM_SETPOS32   ${WM_USER} + 113 ; IE5\n!define /math UDM_GETPOS32   ${WM_USER} + 114 ; IE5\n\n#HotKey control#\n!define /math HKM_SETHOTKEY ${WM_USER} + 1\n!define /math HKM_GETHOTKEY ${WM_USER} + 2\n!define /math HKM_SETRULES  ${WM_USER} + 3\n!define /IfNDef HOTKEYF_SHIFT   0x01\n!define /IfNDef HOTKEYF_CONTROL 0x02\n!define /IfNDef HOTKEYF_ALT     0x04\n!define /IfNDef HOTKEYF_EXT     0x08\n!define HKCOMB_NONE 0x01\n!define HKCOMB_S    0x02\n!define HKCOMB_C    0x04\n!define HKCOMB_A    0x08\n!define HKCOMB_SC   0x10\n!define HKCOMB_SA   0x20\n!define HKCOMB_CA   0x40\n!define HKCOMB_SCA  0x80\n\n#IPAddress control#\n!define /math IPM_CLEARADDRESS ${WM_USER} + 100\n!define /math IPM_SETADDRESS   ${WM_USER} + 101\n!define /math IPM_GETADDRESS   ${WM_USER} + 102\n!define /math IPM_SETRANGE     ${WM_USER} + 103\n!define /math IPM_SETFOCUS     ${WM_USER} + 104\n!define /math IPM_ISBLANK      ${WM_USER} + 105\n\n#NetworkAddress control#\n!define /math NCM_GETADDRESS ${WM_USER} + 1 ; Vista+\n!define /math NCM_SETALLOWTYPE ${WM_USER} + 2\n!define /math NCM_GETALLOWTYPE ${WM_USER} + 3\n!define /math NCM_DISPLAYERRORTIP ${WM_USER} + 4\n\n#Month calendar control#\n!define MCM_FIRST 0x1000\n!define /math MCM_GETCURSEL       ${MCM_FIRST} + 1\n!define /math MCM_SETCURSEL       ${MCM_FIRST} + 2\n!define /math MCM_GETMAXSELCOUNT  ${MCM_FIRST} + 3\n!define /math MCM_SETMAXSELCOUNT  ${MCM_FIRST} + 4\n!define /math MCM_GETSELRANGE     ${MCM_FIRST} + 5\n!define /math MCM_SETSELRANGE     ${MCM_FIRST} + 6\n!define /math MCM_GETMONTHRANGE   ${MCM_FIRST} + 7\n!define /math MCM_SETDAYSTATE     ${MCM_FIRST} + 8\n!define /math MCM_GETMINREQRECT   ${MCM_FIRST} + 9\n!define /math MCM_SETCOLOR            ${MCM_FIRST} + 10\n!define /math MCM_GETCOLOR            ${MCM_FIRST} + 11\n!define /math MCM_SETTODAY    ${MCM_FIRST} + 12\n!define /math MCM_GETTODAY    ${MCM_FIRST} + 13\n!define /math MCM_HITTEST          ${MCM_FIRST} + 14\n!define /math MCM_SETFIRSTDAYOFWEEK ${MCM_FIRST} + 15\n!define /math MCM_GETFIRSTDAYOFWEEK ${MCM_FIRST} + 16\n!define /math MCM_GETRANGE ${MCM_FIRST} + 17\n!define /math MCM_SETRANGE ${MCM_FIRST} + 18\n!define /math MCM_GETMONTHDELTA ${MCM_FIRST} + 19\n!define /math MCM_SETMONTHDELTA ${MCM_FIRST} + 20\n!define /math MCM_GETMAXTODAYWIDTH ${MCM_FIRST} + 21\n!define MCM_SETUNICODEFORMAT ${CCM_SETUNICODEFORMAT} ; IE4+\n!define MCM_GETUNICODEFORMAT ${CCM_SETUNICODEFORMAT} ; IE4+\n!define /math MCM_GETCURRENTVIEW ${MCM_FIRST} + 22 ; Vista+\n!define /math MCM_GETCALENDARCOUNT ${MCM_FIRST} + 23\n!define /math MCM_GETCALENDARGRIDINFO ${MCM_FIRST} + 24\n!define /math MCM_GETCALID ${MCM_FIRST} + 27\n!define /math MCM_SETCALID ${MCM_FIRST} + 28\n!define /math MCM_SIZERECTTOMIN ${MCM_FIRST} + 29\n!define /math MCM_SETCALENDARBORDER ${MCM_FIRST} + 30\n!define /math MCM_GETCALENDARBORDER ${MCM_FIRST} + 31\n!define /math MCM_SETCURRENTVIEW ${MCM_FIRST} + 32\n!define MCN_SELCHANGE   -749\n!define MCN_GETDAYSTATE -747\n!define MCN_SELECT      -746\n!define MCN_VIEWCHANGE  -750 ; Vista+?\n\n#DateTime control#\n!define DTM_FIRST 0x1000\n!define /math DTM_GETSYSTEMTIME ${DTM_FIRST} + 1\n!define /math DTM_SETSYSTEMTIME ${DTM_FIRST} + 2\n!define /math DTM_SETFORMATA ${DTM_FIRST} + 5\n!define /math DTM_SETFORMATW ${DTM_FIRST} + 50\n${_NSIS_DEFAW} DTM_SETFORMAT\n!define /math DTM_GETMONTHCAL ${DTM_FIRST} + 8\n!define /math DTM_SETMCFONT ${DTM_FIRST} + 9 ; IE4+?\n!define /math DTM_GETMCFONT ${DTM_FIRST} + 10 ; IE4+?\n!define /math DTM_SETMCSTYLE ${DTM_FIRST} + 11 ; Vista+?\n!define /math DTM_GETMCSTYLE ${DTM_FIRST} + 12 ; Vista+?\n!define /math DTM_CLOSEMONTHCAL ${DTM_FIRST} + 13 ; Vista+?\n!define DTN_DATETIMECHANGE -759\n!define /IfNDef GDT_ERROR -1\n!define /IfNDef GDT_VALID 0\n!define /IfNDef GDT_NONE 1\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/WinVer.nsh",
    "content": "; ---------------------\n;      WinVer.nsh\n; ---------------------\n;\n; LogicLib extensions for handling Windows versions and service packs.\n;\n; IsNT checks if the installer is running on Windows NT family (NT4, 2000, XP, etc.)\n;\n;   ${If} ${IsNT}\n;     DetailPrint \"Running on NT. Installing Unicode enabled application.\"\n;   ${Else}\n;     DetailPrint \"Not running on NT. Installing ANSI application.\"\n;   ${EndIf}\n;\n; IsServerOS checks if the installer is running on a server version of Windows (2000, 2003, 2008, etc.)\n; IsDomainController checks if the server is a domain controller\n;\n; AtLeastWin<version> checks if the installer is running on Windows version at least as specified.\n; IsWin<version> checks if the installer is running on Windows version exactly as specified.\n; AtMostWin<version> checks if the installer is running on Windows version at most as specified.\n; AtLeastBuild <number> checks if the installer is running on a Windows version with a minimum build number.\n; AtMostBuild <number> checks if the installer is running on a Windows version with a maximum build number.\n; AtLeastWaaS <name> and AtMostWaaS <name> checks Windows 10 \"friendly names\" against the build number.\n;\n; <version> can be replaced with the following values:\n;\n;   95\n;   98\n;   ME\n;\n;   NT4\n;   2000\n;   XP\n;   2003\n;   Vista\n;   2008\n;   7\n;   2008R2\n;   8\n;   2012\n;   8.1\n;   2012R2\n;   10\n;\n;   Note: Windows 8.1 and later will be detected as Windows 8 unless ManifestSupportedOS is set correctly!\n;\n; AtLeastServicePack checks if the installer is running on Windows service pack version at least as specified.\n; IsServicePack checks if the installer is running on Windows service pack version exactly as specified.\n; AtMostServicePack checks if the installer is running on Windows service version pack at most as specified.\n;\n; Usage examples:\n;\n;   ${If} ${IsNT}\n;   DetailPrint \"Running on NT family.\"\n;   DetailPrint \"Surely not running on 95, 98 or ME.\"\n;   ${AndIf} ${AtLeastWinNT4}\n;     DetailPrint \"Running on NT4 or better. Could even be 2003.\"\n;   ${EndIf}\n;\n;   ${If} ${AtLeastWinXP}\n;     DetailPrint \"Running on XP or better.\"\n;   ${EndIf}\n;\n;   ${If} ${IsWin2000}\n;     DetailPrint \"Running on 2000.\"\n;   ${EndIf}\n;\n;   ${If} ${IsWin2000}\n;   ${AndIf} ${AtLeastServicePack} 3\n;   ${OrIf} ${AtLeastWinXP}\n;     DetailPrint \"Running Win2000 SP3 or above\"\n;   ${EndIf}\n;\n;   ${If} ${AtMostWinXP}\n;     DetailPrint \"Running on XP or older. Surely not running on Vista. Maybe 98, or even 95.\"\n;   ${EndIf}\n;\n; Warning:\n;\n;   Windows 95 and NT both use the same version number. To avoid getting NT4 misidentified\n;   as Windows 95 and vice-versa or 98 as a version higher than NT4, always use IsNT to\n;   check if running on the NT family.\n;\n;     ${If} ${AtLeastWin95}\n;     ${AndIf} ${AtMostWinME}\n;       DetailPrint \"Running 95, 98 or ME.\"\n;       DetailPrint \"Actually, maybe it's NT4?\"\n;       ${If} ${IsNT}\n;         DetailPrint \"Yes, it's NT4! oops...\"\n;       ${Else}\n;         DetailPrint \"Nope, not NT4. phew...\"\n;       ${EndIf}\n;     ${EndIf}\n;\n;\n; Other useful extensions are:\n;\n;    * IsWin2003R2\n;    * IsStarterEdition\n;    * OSHasMediaCenter\n;    * OSHasTabletSupport\n;\n\n!verbose push\n!verbose 3\n\n!ifndef ___WINVER__NSH___\n!define ___WINVER__NSH___\n\n!include LogicLib.nsh\n!include Util.nsh\n\n# masks for our variables\n\n!define _WINVER_VERXBIT  0x00000001 ; Used to boost $__WINVERV\n!define _WINVER_MASKVMAJ 0x7F000000 ; $__WINVERV mask\n!define _WINVER_MASKVMIN 0x00FF0000 ; $__WINVERV mask\n!define _WINVER_NTMASK   0x7FFFFFFF ; $__WINVERV mask used by AtMost/AtLeast\n!define _WINVER_NTBIT    0x80000000 ; $__WINVERV bit used by Is and $__WINVERSP bit used by IsNT\n!define _WINVER_NTSRVBIT 0x40000000 ; $__WINVERSP bit for !VER_NT_WORKSTATION\n!define _WINVER_NTDCBIT  0x20000000 ; $__WINVERSP bit for VER_NT_DOMAIN_CONTROLLER\n!define _WINVER_MASKVBLD 0x0000FFFF ; $__WINVERSP mask for OS build number\n!define _WINVER_MASKSP   0x000F0000 ; $__WINVERSP mask for OS service pack\n\n# possible variable values for different versions\n\n!define WINVER_95_NT     0x04000000 ;4.00.0950\n!define WINVER_95        0x04000000 ;4.00.0950\n!define WINVER_98_NT     0x040a0000 ;4.10.1998\n!define WINVER_98        0x040a0000 ;4.10.1998\n;define WINVER_98SE      0x040a0000 ;4.10.2222\n!define WINVER_ME_NT     0x045a0000 ;4.90.3000\n!define WINVER_ME        0x045a0000 ;4.90.3000\n;define WINVER_NT3.51               ;3.51.1057\n!define WINVER_NT4_NT    0x84000000 ;4.00.1381\n!define WINVER_NT4       0x04000000 ;4.00.1381\n!define WINVER_2000_NT   0x85000000 ;5.00.2195\n!define WINVER_2000      0x05000000 ;5.00.2195\n!define WINVER_XP_NT     0x85010000 ;5.01.2600\n!define WINVER_XP        0x05010000 ;5.01.2600\n;define WINVER_XP64                 ;5.02.3790\n!define WINVER_2003_NT   0x85020000 ;5.02.3790\n!define WINVER_2003      0x05020000 ;5.02.3790\n!define WINVER_VISTA_NT  0x86000000 ;6.00.6000\n!define WINVER_VISTA     0x06000000 ;6.00.6000\n!define WINVER_2008_NT   0x86000001 ;6.00.6001\n!define WINVER_2008      0x06000001 ;6.00.6001\n!define WINVER_7_NT      0x86010000 ;6.01.7600\n!define WINVER_7         0x06010000 ;6.01.7600\n!define WINVER_2008R2_NT 0x86010001 ;6.01.7600\n!define WINVER_2008R2    0x06010001 ;6.01.7600\n!define WINVER_8_NT      0x86020000 ;6.02.9200\n!define WINVER_8         0x06020000 ;6.02.9200\n!define WINVER_2012_NT   0x86020001 ;6.02.9200\n!define WINVER_2012      0x06020001 ;6.02.9200\n!define WINVER_8.1_NT    0x86030000 ;6.03.9600\n!define WINVER_8.1       0x06030000 ;6.03.9600\n!define WINVER_2012R2_NT 0x86030001 ;6.03.9600\n!define WINVER_2012R2    0x06030001 ;6.03.9600\n!define WINVER_10_NT     0x8A000000 ;10.0.10240\n!define WINVER_10        0x0A000000 ;10.0.10240\n!define WINVER_2016_NT   0x8A000001 ;10.0.14393\n!define WINVER_2016      0x0A000001 ;10.0.14393\n\n\n# use this to make all nt > 9x\n\n!ifdef WINVER_NT4_OVER_W95\n  !define /redef /math WINVER_NT4 ${WINVER_NT4} | ${_WINVER_VERXBIT}\n!endif\n\n# some definitions from header files\n\n!define OSVERSIONINFOW_SIZE   276\n!define OSVERSIONINFOEXW_SIZE 284\n!define OSVERSIONINFOA_SIZE   148\n!define OSVERSIONINFOEXA_SIZE 156\n!define /ifndef VER_PLATFORM_WIN32_NT 2\n!define /ifndef VER_NT_WORKSTATION       1\n!define /ifndef VER_NT_DOMAIN_CONTROLLER 2\n!define /ifndef VER_NT_SERVER            3\n\n!define SM_TABLETPC    86\n!define SM_MEDIACENTER 87\n!define SM_STARTER     88\n!define SM_SERVERR2    89\n\n# variable declaration\n\n!macro __WinVer_DeclareVars\n\n  !ifndef __WINVER_VARS_DECLARED\n\n    !define __WINVER_VARS_DECLARED\n\n    Var /GLOBAL __WINVERV\n    Var /GLOBAL __WINVERSP\n\n  !endif\n\n!macroend\n\n!macro __WinVer_Optimize\n!ifndef __WINVER_NOOPTIMIZE\n!if \"${NSIS_CHAR_SIZE}\" > 1\n!define /ReDef AtMostWin95 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWin98 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWinME '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin95 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin98 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWinME '\"\" LogicLib_AlwaysFalse \"\"'\n!endif\n!if \"${NSIS_PTR_SIZE}\" > 4\n!define /ReDef AtMostWin95 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWin98 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWinME '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWinNT4 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin95 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin98 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWinME '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWinNT4 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtLeastWin95 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin98 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWinME '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWinNT4 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin2000 '\"\" LogicLib_AlwaysTrue \"\"'\n!endif\n!ifdef NSIS_ARM | NSIS_ARM32 | NSIS_ARMNT | NSIS_ARM64\n!define /ReDef AtMostWin2000 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWinXP '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWin2003 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWinVista '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtMostWin7 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin95 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin98 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWinME '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWinNT4 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin2000 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWinXP '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin2003 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWinVista '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin2008 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin7 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef IsWin2008R2 '\"\" LogicLib_AlwaysFalse \"\"'\n!define /ReDef AtLeastWin95 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin98 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWinME '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWinNT4 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin2000 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWinXP '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin2003 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWinVista '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin2008 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin7 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin2008R2 '\"\" LogicLib_AlwaysTrue \"\"'\n!define /ReDef AtLeastWin8 '\"\" LogicLib_AlwaysTrue \"\"'\n!endif\n!endif\n!macroend\n\n# lazy initialization macro\n\n!define /IfNDef __WinVer_GWV GetWinVer\n\n!macro __WinVer_InitVars_NEW\n  !insertmacro __WinVer_DeclareVars\n  !insertmacro __WinVer_Optimize\n\n  # only calculate version once\n  StrCmp $__WINVERV \"\" _winver_noveryet\n    Return\n  _winver_noveryet:\n\n  Push $0\n  ${__WinVer_GWV} $0 Product\n  ${__WinVer_GWV} $__WINVERV NTDDIMajMin\n  IntOp $__WINVERV $__WINVERV << 16 ; _WINVER_MASKVMAJ & _WINVER_MASKVMIN\n  IntOp $__WINVERSP $0 & 2\n  IntOp $__WINVERSP $__WINVERSP << 29 ; _WINVER_NTSRVBIT & _WINVER_NTDCBIT\n  !ifndef NSIS_ARM64\n  IntCmp $__WINVERSP 0 notServer\n    IntCmpU 0x06000000 $__WINVERV \"\" \"\" not2008 ; ${If} $__WINVERV U>= 0x06000000\n    IntCmpU 0x09000000 $__WINVERV not2008 not2008 \"\" ; ${AndIf} $__WINVERV U< 0x09000000\n      IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT} ; Extra bit so Server 2008 comes after Vista SP1 that has the same minor version, same for Win7 vs 2008R2\n    not2008:\n  Goto endServer\n  notServer:\n    IntCmp $__WINVERV 0x05020000 \"\" notXP64 notXP64\n      StrCpy $__WINVERV 0x05010000 ; Change XP 64-bit from 5.2 to 5.1 so it's still XP\n    notXP64:\n  endServer:\n  !endif\n\n  IntCmp $0 0 notNT\n!if \"${NSIS_PTR_SIZE}\" <= 4\n!ifdef WINVER_NT4_OVER_W95\n    IntCmp $__WINVERV 0x04000000 \"\" nt4eq95 nt4eq95\n      IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT} ; change NT 4.0.reserved.0 to 4.0.reserved.1\n    nt4eq95:\n!endif\n!endif\n    IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTBIT} ; _WINVER_NTBIT\n    IntOp $__WINVERV $__WINVERV | ${_WINVER_NTBIT}  ; _WINVER_NTBIT\n  notNT:\n\n  ${__WinVer_GWV} $0 Build\n  IntOp $__WINVERSP $__WINVERSP | $0 ; _WINVER_MASKVBLD\n  ${__WinVer_GWV} $0 ServicePack\n  IntOp $0 $0 << 16\n  IntOp $__WINVERSP $__WINVERSP | $0 ; _WINVER_MASKSP\n  Pop $0\n!macroend\n\n!ifmacrondef __WinVer_Call_GetVersionEx\n\n  !macro __WinVer_Call_GetVersionEx STRUCT_SIZE\n\n    System::Call '*$0(i ${STRUCT_SIZE})'\n    System::Call kernel32::GetVersionEx(pr0)i.r3\n\n  !macroend\n\n!endif\n\n!macro __WinVer_InitVars_OLD\n  # variables\n  !insertmacro __WinVer_DeclareVars\n  !insertmacro __WinVer_Optimize\n\n  # only calculate version once\n  StrCmp $__WINVERV \"\" _winver_noveryet\n    Return\n  _winver_noveryet:\n\n  # push used registers on the stack\n  Push $0\n  Push $1 ;maj\n  Push $2 ;min\n  Push $3 ;bld\n  Push $R0 ;temp\n\n  # a plugin call will lock the Unicode mode, it is now safe to set the struct size\n  !ifdef NSIS_UNICODE\n  !define /redef OSVERSIONINFO_SIZE ${OSVERSIONINFOW_SIZE}\n  !define /redef OSVERSIONINFOEX_SIZE ${OSVERSIONINFOEXW_SIZE}\n  !else\n  !define /redef OSVERSIONINFO_SIZE ${OSVERSIONINFOA_SIZE}\n  !define /redef OSVERSIONINFOEX_SIZE ${OSVERSIONINFOEXA_SIZE}\n  !endif\n\n  # allocate memory\n  System::Call '*(&i${OSVERSIONINFOEX_SIZE})p.r0'\n\n  # use OSVERSIONINFOEX\n  !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOEX_SIZE}\n\n  IntCmp $3 0 \"\" _winver_ex _winver_ex\n    # OSVERSIONINFOEX not allowed (Win9x or NT4 w/SP < 6), use OSVERSIONINFO\n    !insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFO_SIZE}\n  _winver_ex:\n\n  # get results from struct\n  System::Call '*$0(i.s,i.r1,i.r2,i.r3,i.s,&t128.s,&i2.s,&i2,&i2,&i1.s,&i1)'\n\n  # free struct\n  System::Free $0\n\n  # win9x has major and minor info in high word of dwBuildNumber - remove it\n  IntOp $3 $3 & 0xFFFF\n\n  # get dwOSVersionInfoSize\n  Pop $R0\n\n  # get dwPlatformId\n  Pop $0\n\n  # NT?\n  IntCmp $0 ${VER_PLATFORM_WIN32_NT} \"\" _winver_notnt _winver_notnt\n    IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTBIT}\n    IntOp $__WINVERV  $__WINVERV  | ${_WINVER_NTBIT}\n  _winver_notnt:\n!ifndef NSIS_UNICODE\n!if \"${NSIS_PTR_SIZE}\" <= 4\n  # get service pack information\n  IntCmp $0 ${VER_PLATFORM_WIN32_NT} _winver_nt \"\" _winver_nt  # win9x\n\n    # get szCSDVersion\n    Pop $0\n\n    # copy second char\n    StrCpy $0 $0 1 1\n\n    # discard invalid wServicePackMajor and wProductType\n    Pop $R0\n    Pop $R0\n\n    # switch\n    StrCmp $0 'A' \"\" +3\n      StrCpy $0 1\n      Goto _winver_sp_done\n    StrCmp $0 'B' \"\" +3\n      StrCpy $0 2\n      Goto _winver_sp_done\n    StrCmp $0 'C' \"\" +3\n      StrCpy $0 3\n      Goto _winver_sp_done\n    StrCpy $0 0\n    Goto _winver_sp_done\n\n  _winver_nt: # nt\n!endif #~ 32-bit\n!endif #~ ANSI\n    IntCmp $R0 ${OSVERSIONINFOEX_SIZE} \"\" _winver_sp_noex _winver_sp_noex\n\n      # discard szCSDVersion\n      Pop $0\n\n      # get wProductType\n      Exch\n      Pop $0\n\n      # is server?\n      IntCmp $0 ${VER_NT_WORKSTATION} _winver_nt_notsrv\n        IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTSRVBIT}\n        IntCmp $0 ${VER_NT_DOMAIN_CONTROLLER} \"\" _winver_nt_notdc _winver_nt_notdc\n          IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTDCBIT}\n        _winver_nt_notdc:\n      _winver_nt_notsrv:\n\n      # get wServicePackMajor\n      Pop $0\n\n      # done with sp\n      Goto _winver_sp_done\n\n    _winver_sp_noex: # OSVERSIONINFO, not OSVERSIONINFOEX\n\n      ####  TODO\n      ## For IsServerOS to support < NT4SP6, we need to check the registry\n      ## here to see if we are a server and/or DC\n\n      # get szCSDVersion\n      Pop $0\n\n      # discard invalid wServicePackMajor and wProductType\n      Pop $R0\n      Pop $R0\n\n      # get service pack number from text\n      StrCpy $R0 $0 13\n      StrCmp $R0 \"Service Pack \" \"\" +3\n        StrCpy $0 $0 \"\" 13 # cut \"Service Pack \"\n        Goto +2\n        StrCpy $0 0 # no service pack\n\n!ifdef WINVER_NT4_OVER_W95\n      IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT} ; change NT 4.0.reserved.0 to 4.0.reserved.1\n!endif\n\n  _winver_sp_done:\n\n  # store service pack\n  IntOp $0 $0 << 16\n  IntOp $__WINVERSP $__WINVERSP | $0\n\n  ### now for the version\n\n  # is server?\n  IntOp $0 $__WINVERSP & ${_WINVER_NTSRVBIT}\n\n  # windows xp x64?\n  IntCmp $0 0 \"\" _winver_not_xp_x64 _winver_not_xp_x64 # not server\n  IntCmp $1 5 \"\" _winver_not_xp_x64 _winver_not_xp_x64 # maj 5\n  IntCmp $2 2 \"\" _winver_not_xp_x64 _winver_not_xp_x64 # min 2\n    # change XP x64 from 5.2 to 5.1 so it's still XP\n    StrCpy $2 1\n  _winver_not_xp_x64:\n\n  # server 2008?\n  IntCmp $0 0 _winver_not_ntserver # server\n  IntCmp 6 $1 \"\" \"\" _winver_not_ntserver # maj 6\n    # extra bit so Server 2008 comes after Vista SP1 that has the same minor version, same for Win7 vs 2008R2\n    IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT}\n  _winver_not_ntserver:\n\n  # pack version\n  IntOp $1 $1 << 24 # VerMajor\n  IntOp $__WINVERV $__WINVERV | $1\n  IntOp $0 $2 << 16\n  IntOp $__WINVERV $__WINVERV | $0 # VerMinor\n  IntOp $__WINVERSP $__WINVERSP | $3 # VerBuild\n\n  # restore registers\n  Pop $R0\n  Pop $3\n  Pop $2\n  Pop $1\n  Pop $0\n\n!macroend\n\n!macro __WinVer_InitVars\n  !ifndef WinVer_v3_7\n  !insertmacro __WinVer_InitVars_NEW\n  !else\n  !insertmacro __WinVer_InitVars_OLD\n  !endif\n!macroend\n\n# version comparison LogicLib macros\n\n!macro _WinVerAtLeast _a _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${CallArtificialFunction} __WinVer_InitVars\n  IntOp $_LOGICLIB_TEMP $__WINVERV & ${_WINVER_NTMASK}\n  !insertmacro _>= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`\n!macroend\n!macro _WinVerIs _a _b _t _f\n  ${CallArtificialFunction} __WinVer_InitVars\n  !insertmacro _= $__WINVERV `${_b}` `${_t}` `${_f}`\n!macroend\n!macro _WinVerAtMost _a _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${CallArtificialFunction} __WinVer_InitVars\n  IntOp $_LOGICLIB_TEMP $__WINVERV & ${_WINVER_NTMASK}\n  !insertmacro _<= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`\n!macroend\n\n!macro __WinVer_DefineOSTest Test OS Suffix\n  !define ${Test}Win${OS} `\"\" WinVer${Test} ${WINVER_${OS}${Suffix}}`\n!macroend\n\n!macro __WinVer_DefineOSTests Test Suffix\n  !insertmacro __WinVer_DefineOSTest ${Test} 95     '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 98     '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} ME     '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} NT4    '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 2000   '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} XP     '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 2003   '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} VISTA  '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 2008   '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 7      '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 2008R2 '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 8      '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 2012   '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 8.1    '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 2012R2 '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 10     '${Suffix}'\n  !insertmacro __WinVer_DefineOSTest ${Test} 2016   '${Suffix}'\n!macroend\n\n!insertmacro __WinVer_DefineOSTests AtLeast \"\"\n!insertmacro __WinVer_DefineOSTests Is _NT\n!insertmacro __WinVer_DefineOSTests AtMost \"\"\n\n# version feature LogicLib macros\n\n!macro __WinVer_LL_IsBitSet _v _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${CallArtificialFunction} __WinVer_InitVars\n  IntOp $_LOGICLIB_TEMP ${_v} & ${_b}\n  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`\n!macroend\n\n!define IsNT `$__WINVERSP _WinVer_LL_IsBitSet ${_WINVER_NTBIT}`\n!define IsServerOS `$__WINVERSP _WinVer_LL_IsBitSet ${_WINVER_NTSRVBIT}`\n!define IsDomainController `$__WINVERSP _WinVer_LL_IsBitSet ${_WINVER_NTDCBIT}`\n\n# service pack macros\n\n!macro _WinVer_GetServicePackLevel OUTVAR\n  !ifndef WinVer_v3_7\n  ${__WinVer_GWV} ${OUTVAR} ServicePack\n  !else\n  ${CallArtificialFunction} __WinVer_InitVars\n  IntOp ${OUTVAR} $__WINVERSP & ${_WINVER_MASKSP}\n  IntOp ${OUTVAR} ${OUTVAR} >> 16\n  !endif\n!macroend\n!define WinVerGetServicePackLevel '!insertmacro _WinVer_GetServicePackLevel '\n\n!macro _AtLeastServicePack _a _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP\n  !insertmacro _>= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`\n!macroend\n!define AtLeastServicePack `\"\" AtLeastServicePack`\n\n!macro _AtMostServicePack _a _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP\n  !insertmacro _<= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`\n!macroend\n!define AtMostServicePack `\"\" AtMostServicePack`\n\n!macro _IsServicePack _a _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${WinVerGetServicePackLevel} $_LOGICLIB_TEMP\n  !insertmacro _= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`\n!macroend\n!define IsServicePack `\"\" IsServicePack`\n\n# special feature LogicLib macros\n\n!macro _WinVer_SysMetricCheck m _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  System::Call user32::GetSystemMetrics(i${m})i.s\n  pop $_LOGICLIB_TEMP\n  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`\n!macroend\n\n!define IsWin2003R2        `${SM_SERVERR2}    WinVer_SysMetricCheck \"\"`\n!define IsStarterEdition   `${SM_STARTER}     WinVer_SysMetricCheck \"\"`\n!define OSHasMediaCenter   `${SM_MEDIACENTER} WinVer_SysMetricCheck \"\"`\n!define OSHasTabletSupport `${SM_TABLETPC}    WinVer_SysMetricCheck \"\"`\n!define IsSafeBootMode     `67                WinVer_SysMetricCheck \"\"`\n\n# version retrieval macros\n\n!macro __WinVer_GetVer var rshift mask outvar\n  ${CallArtificialFunction} __WinVer_InitVars\n  !if \"${mask}\" != \"\"\n    IntOp ${outvar} ${var} & ${mask}\n    !if \"${rshift}\" != \"\"\n      IntOp ${outvar} ${outvar} >> ${rshift}\n    !endif\n  !else\n    IntOp ${outvar} ${var} >> ${rshift}\n  !endif\n!macroend\n\n!define WinVerGetMajor '!insertmacro __WinVer_GetVer $__WINVERV  24 ${_WINVER_MASKVMAJ}'\n!define WinVerGetMinor '!insertmacro __WinVer_GetVer $__WINVERV  16 ${_WINVER_MASKVMIN}'\n!ifndef WinVer_v3_7\n!macro __WinVer_GetVerBuild outvar\n  ${__WinVer_GWV} ${outvar} Build\n!macroend\n!define WinVerGetBuild '!insertmacro __WinVer_GetVerBuild '\n!else\n!define WinVerGetBuild '!insertmacro __WinVer_GetVer $__WINVERSP \"\" ${_WINVER_MASKVBLD}'\n!endif\n\n!macro _WinVer_BuildNumCheck op num _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${WinVerGetBuild} $_LOGICLIB_TEMP\n  !insertmacro _${op} $_LOGICLIB_TEMP ${num} `${_t}` `${_f}`\n!macroend\n!define AtLeastBuild `U>= WinVer_BuildNumCheck `\n!define AtMostBuild `U<= WinVer_BuildNumCheck `\n\n# Windows as a Service macros\n\n!macro WinVer_WaaS id build fu codename marketingname\n  !if \"${id}\" == \"?\"\n    # Ignore\n  !else if \"${id}\" == ${fu}\n    !define WinVer_WaaS_Build ${build}\n  !else if \"${id}\" == \"${codename}\"\n    !define WinVer_WaaS_Build ${build}\n  !else if \"${id}\" == \"${marketingname}\"\n    !define WinVer_WaaS_Build ${build}\n  !endif\n!macroend\n\n!macro _WinVer_WaaS op id _t _f\n  !insertmacro WinVer_WaaS \"${id}\" 10240 1507 \"Threshold\"   \"Windows 10\" ; 10240.16384\n  !insertmacro WinVer_WaaS \"${id}\" 10586 1511 \"Threshold 2\" \"November Update\" ; 10586.0?\n  !insertmacro WinVer_WaaS \"${id}\" 14393 1607 \"Redstone\"    \"Anniversary Update\" ; 14393.10\n  !insertmacro WinVer_WaaS \"${id}\" 15063 1703 \"Redstone 2\"  \"Creators Update\" ; 15063.13\n  !insertmacro WinVer_WaaS \"${id}\" 16299 1709 \"Redstone 3\"  \"Fall Creators Update\" ; 16299.19\n  !insertmacro WinVer_WaaS \"${id}\" 17134 1803 \"Redstone 4\"  \"April 2018 Update\" ; 17134.1\n  !insertmacro WinVer_WaaS \"${id}\" 17763 1809 \"Redstone 5\"  \"October 2018 Update\" ; 17763.1\n  !insertmacro WinVer_WaaS \"${id}\" 18362 1903 \"19H1\"        \"May 2019 Update\" ; 18362.116\n  !insertmacro WinVer_WaaS \"${id}\" 18363 1909 \"19H2\"        \"November 2019 Update\" ; 18363.418\n  !insertmacro WinVer_WaaS \"${id}\" 19041 2004 \"20H1\"        \"May 2020 Update\" ; 19041.264?\n  !insertmacro WinVer_WaaS \"${id}\" 19042 20H2 \"20H2\"        \"October 2020 Update\" ; 19042.572? A.K.A. 2009\n  !insertmacro WinVer_WaaS \"${id}\" 19043 21H1 \"21H1\"        \"May 2021 Update\" ; 19043.928\n  !insertmacro WinVer_WaaS \"${id}\" 19044 21H2 \"21H2\"        \"November 2021 Update \"\n  !insertmacro WinVer_WaaS \"${id}\" 22000 \"?\"  \"Sun Valley\"  \"Windows 11\" ; 10.0.22000.194 21H2\n\n  !ifmacrodef WinVerExternal_WaaS_MapToBuild\n    !insertmacro WinVerExternal_WaaS_MapToBuild ${op} \"${id}\" WinVer_WaaS_Build\n  !endif\n  !define /IfNDef WinVer_WaaS_Build 0\n  !if \"${WinVer_WaaS_Build}\" <= 9600\n    !error 'WinVer: Unknown WaaS name: ${id}'\n  !endif\n  !insertmacro _WinVer_BuildNumCheck ${op} ${WinVer_WaaS_Build} `${_t}` `${_f}`\n  !undef WinVer_WaaS_Build\n!macroend\n\n!define AtLeastWaaS `U>= WinVer_WaaS `\n!define AtMostWaaS `U<= WinVer_WaaS `\n\n!endif # !___WINVER__NSH___\n\n!verbose pop\n"
  },
  {
    "path": "setup/nsis/tools/Include/WordFunc.nsh",
    "content": "/*\n_____________________________________________________________________________\n\n                       Word Functions Header v3.3\n_____________________________________________________________________________\n\n 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)\n\n See documentation for more information about the following functions.\n\n Usage in script:\n 1. !include \"WordFunc.nsh\"\n 2. [Section|Function]\n      ${WordFunction} \"Param1\" \"Param2\" \"...\" $var\n    [SectionEnd|FunctionEnd]\n\n\n WordFunction=[WordFind|WordFindS|WordFind2X|WordFind2XS|WordFind3X|WordFind3XS|\n               WordReplace|WordReplaceS|WordAdd|WordAddS|WordInsert|WordInsertS|\n               StrFilter|StrFilterS|VersionCompare|VersionConvert]\n\n_____________________________________________________________________________\n\n                       Thanks to:\n_____________________________________________________________________________\n\nWordFind3X\n\tAfrow UK (Based on his idea of Function \"StrSortLR\")\nStrFilter\n\tsunjammer (Function \"StrUpper\")\nVersionCompare\n\tAfrow UK (Based on his Function \"VersionCheckNew2\")\nVersionConvert\n\tAfrow UK (Based on his idea of Function \"CharIndexReplace\")\n*/\n\n\n;_____________________________________________________________________________\n;\n;                         Macros\n;_____________________________________________________________________________\n;\n; Change log window verbosity (default: 3=no script)\n;\n; Example:\n; !include \"WordFunc.nsh\"\n; !insertmacro WordFind\n; ${WORDFUNC_VERBOSE} 4   # all verbosity\n; !insertmacro WordReplace\n; ${WORDFUNC_VERBOSE} 3   # no script\n\n!ifndef WORDFUNC_INCLUDED\n\n!verbose push 3\n!define /IfNDef _WORDFUNC_VERBOSE 3\n!verbose ${_WORDFUNC_VERBOSE}\n!define WORDFUNC_VERBOSE `!insertmacro WORDFUNC_VERBOSE`\n\n!define WORDFUNC_INCLUDED\n\n!include Util.nsh\n\n\n!macro WORDFUNC_VERBOSE _VERBOSE\n\t!verbose push 3\n\t!define /ReDef _WORDFUNC_VERBOSE ${_VERBOSE}\n\t!verbose pop\n!macroend\n\n\n!macro WordFindCall _ART _STRING _DELIMITER _OPTION _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER}`\n\tPush `${_OPTION}`\n\t${CallArtificialFunction}${_ART} WordFind_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordFindSCall _ART _STRING _DELIMITER _OPTION _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER}`\n\tPush `${_OPTION}`\n\t${CallArtificialFunction}${_ART} WordFindS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordFind2XCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER1}`\n\tPush `${_DELIMITER2}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordFind2X_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordFind2XSCall _STRING _DELIMITER1 _DELIMITER2 _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER1}`\n\tPush `${_DELIMITER2}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordFind2XS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordFind3XCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER1}`\n\tPush `${_CENTER}`\n\tPush `${_DELIMITER2}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordFind3X_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordFind3XSCall _STRING _DELIMITER1 _CENTER _DELIMITER2 _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER1}`\n\tPush `${_CENTER}`\n\tPush `${_DELIMITER2}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordFind3XS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordReplaceCall _STRING _WORD1 _WORD2 _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_WORD1}`\n\tPush `${_WORD2}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordReplace_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordReplaceSCall _STRING _WORD1 _WORD2 _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_WORD1}`\n\tPush `${_WORD2}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordReplaceS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordAddCall _STRING1 _DELIMITER _STRING2 _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING1}`\n\tPush `${_DELIMITER}`\n\tPush `${_STRING2}`\n\t${CallArtificialFunction} WordAdd_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordAddSCall _STRING1 _DELIMITER _STRING2 _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING1}`\n\tPush `${_DELIMITER}`\n\tPush `${_STRING2}`\n\t${CallArtificialFunction} WordAddS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordInsertCall _STRING _DELIMITER _WORD _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER}`\n\tPush `${_WORD}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordInsert_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordInsertSCall _STRING _DELIMITER _WORD _NUMBER _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_DELIMITER}`\n\tPush `${_WORD}`\n\tPush `${_NUMBER}`\n\t${CallArtificialFunction} WordInsertS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro StrFilterCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_FILTER}`\n\tPush `${_INCLUDE}`\n\tPush `${_EXCLUDE}`\n\t${CallArtificialFunction} StrFilter_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro StrFilterSCall _STRING _FILTER _INCLUDE _EXCLUDE _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_STRING}`\n\tPush `${_FILTER}`\n\tPush `${_INCLUDE}`\n\tPush `${_EXCLUDE}`\n\t${CallArtificialFunction} StrFilterS_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro VersionCompareCall _VER1 _VER2 _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_VER1}`\n\tPush `${_VER2}`\n\t${CallArtificialFunction} VersionCompare_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro VersionConvertCall _VERSION _CHARLIST _RESULT\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\tPush `${_VERSION}`\n\tPush `${_CHARLIST}`\n\t${CallArtificialFunction} VersionConvert_\n\tPop ${_RESULT}\n\t!verbose pop\n!macroend\n\n!macro WordFindBody _WORDFUNC_S\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tExch 2\n\tExch $R0\n\tExch 2\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R1\n\tPush $R2\n\tClearErrors\n\n\tStrCpy $9 ''\n\tStrCpy $2 $1 1\n\tStrCpy $1 $1 '' 1\n\tStrCmp $2 'E' 0 +3\n\tStrCpy $9 E\n\tgoto -4\n\n\tStrCpy $3 ''\n\tStrCmp${_WORDFUNC_S} $2 '+' +6\n\tStrCmp${_WORDFUNC_S} $2 '-' +5\n\tStrCmp${_WORDFUNC_S} $2 '/' WordFunc_WordFind${_WORDFUNC_S}_restart\n\tStrCmp${_WORDFUNC_S} $2 '#' WordFunc_WordFind${_WORDFUNC_S}_restart\n\tStrCmp${_WORDFUNC_S} $2 '*' WordFunc_WordFind${_WORDFUNC_S}_restart\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_error3\n\n\tStrCpy $4 $1 1 -1\n\tStrCmp${_WORDFUNC_S} $4 '*' +4\n\tStrCmp${_WORDFUNC_S} $4 '}' +3\n\tStrCmp${_WORDFUNC_S} $4 '{' +2\n\tgoto +4\n\tStrCpy $1 $1 -1\n\tStrCpy $3 '$4$3'\n\tgoto -7\n\tStrCmp${_WORDFUNC_S} $3 '*' WordFunc_WordFind${_WORDFUNC_S}_error3\n\tStrCmp${_WORDFUNC_S} $3 '**' WordFunc_WordFind${_WORDFUNC_S}_error3\n\tStrCmp${_WORDFUNC_S} $3 '}{' WordFunc_WordFind${_WORDFUNC_S}_error3\n\tIntOp $1 $1 + 0\n\tStrCmp${_WORDFUNC_S} $1 0 WordFunc_WordFind${_WORDFUNC_S}_error2\n\n\tWordFunc_WordFind${_WORDFUNC_S}_restart:\n\tStrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind${_WORDFUNC_S}_error1\n\tStrCpy $4 0\n\tStrCpy $5 0\n\tStrCpy $6 0\n\tStrLen $7 $0\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_loop\n\n\tWordFunc_WordFind${_WORDFUNC_S}_preloop:\n\tIntOp $6 $6 + 1\n\n\tWordFunc_WordFind${_WORDFUNC_S}_loop:\n\tStrCpy $8 $R0 $7 $6\n\tStrCmp${_WORDFUNC_S} $8$5 0 WordFunc_WordFind${_WORDFUNC_S}_error1\n\tStrLen $R2 $8\n\tIntCmp $R2 0 +2\n\tStrCmp${_WORDFUNC_S} $8 $0 +5 WordFunc_WordFind${_WORDFUNC_S}_preloop\n\tStrCmp${_WORDFUNC_S} $3 '{' WordFunc_WordFind${_WORDFUNC_S}_minus\n\tStrCmp${_WORDFUNC_S} $3 '}' WordFunc_WordFind${_WORDFUNC_S}_minus\n\tStrCmp${_WORDFUNC_S} $2 '*' WordFunc_WordFind${_WORDFUNC_S}_minus\n\tStrCmp${_WORDFUNC_S} $5 $6 WordFunc_WordFind${_WORDFUNC_S}_minus +5\n\tStrCmp${_WORDFUNC_S} $3 '{' +4\n\tStrCmp${_WORDFUNC_S} $3 '}' +3\n\tStrCmp${_WORDFUNC_S} $2 '*' +2\n\tStrCmp${_WORDFUNC_S} $5 $6 WordFunc_WordFind${_WORDFUNC_S}_nextword\n\tIntOp $4 $4 + 1\n\tStrCmp${_WORDFUNC_S} $2$4 +$1 WordFunc_WordFind${_WORDFUNC_S}_plus\n\tStrCmp${_WORDFUNC_S} $2 '/' 0 WordFunc_WordFind${_WORDFUNC_S}_nextword\n\tIntOp $8 $6 - $5\n\tStrCpy $8 $R0 $8 $5\n\tStrCmp${_WORDFUNC_S} $1 $8 0 WordFunc_WordFind${_WORDFUNC_S}_nextword\n\tStrCpy $R1 $4\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tWordFunc_WordFind${_WORDFUNC_S}_nextword:\n\tIntOp $6 $6 + $7\n\tStrCpy $5 $6\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_loop\n\n\tWordFunc_WordFind${_WORDFUNC_S}_minus:\n\tStrCmp${_WORDFUNC_S} $2 '-' 0 WordFunc_WordFind${_WORDFUNC_S}_sum\n\tStrCpy $2 '+'\n\tIntOp $1 $4 - $1\n\tIntOp $1 $1 + 1\n\tIntCmp $1 0 WordFunc_WordFind${_WORDFUNC_S}_error2 WordFunc_WordFind${_WORDFUNC_S}_error2 WordFunc_WordFind${_WORDFUNC_S}_restart\n\tWordFunc_WordFind${_WORDFUNC_S}_sum:\n\tStrCmp${_WORDFUNC_S} $2 '#' 0 WordFunc_WordFind${_WORDFUNC_S}_sumdelim\n\tStrCpy $R1 $4\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tWordFunc_WordFind${_WORDFUNC_S}_sumdelim:\n\tStrCmp${_WORDFUNC_S} $2 '*' 0 WordFunc_WordFind${_WORDFUNC_S}_error2\n\tStrCpy $R1 $4\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\n\tWordFunc_WordFind${_WORDFUNC_S}_plus:\n\tStrCmp${_WORDFUNC_S} $3 '' 0 +4\n\tIntOp $6 $6 - $5\n\tStrCpy $R1 $R0 $6 $5\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $3 '{' 0 +3\n\tStrCpy $R1 $R0 $6\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $3 '}' 0 +4\n\tIntOp $6 $6 + $7\n\tStrCpy $R1 $R0 '' $6\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $3 '{*' +2\n\tStrCmp${_WORDFUNC_S} $3 '*{' 0 +3\n\tStrCpy $R1 $R0 $6\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $3 '*}' +2\n\tStrCmp${_WORDFUNC_S} $3 '}*' 0 +3\n\tStrCpy $R1 $R0 '' $5\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $3 '}}' 0 +3\n\tStrCpy $R1 $R0 '' $6\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $3 '{{' 0 +3\n\tStrCpy $R1 $R0 $5\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $3 '{}' 0 WordFunc_WordFind${_WORDFUNC_S}_error3\n\tStrLen $3 $R0\n\tStrCmp${_WORDFUNC_S} $3 $6 0 +3\n\tStrCpy $0 ''\n\tgoto +2\n\tIntOp $6 $6 + $7\n\tStrCpy $8 $R0 '' $6\n\tStrCmp${_WORDFUNC_S} $4$8 1 +6\n\tStrCmp${_WORDFUNC_S} $4 1 +2 +7\n\tIntOp $6 $6 + $7\n\tStrCpy $3 $R0 $7 $6\n\tStrCmp${_WORDFUNC_S} $3 '' +2\n\tStrCmp${_WORDFUNC_S} $3 $0 -3 +3\n\tStrCpy $R1 ''\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $5 0 0 +3\n\tStrCpy $0 ''\n\tgoto +2\n\tIntOp $5 $5 - $7\n\tStrCpy $3 $R0 $5\n\tStrCpy $R1 '$3$0$8'\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_end\n\n\tWordFunc_WordFind${_WORDFUNC_S}_error3:\n\tStrCpy $R1 3\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_error\n\tWordFunc_WordFind${_WORDFUNC_S}_error2:\n\tStrCpy $R1 2\n\tgoto WordFunc_WordFind${_WORDFUNC_S}_error\n\tWordFunc_WordFind${_WORDFUNC_S}_error1:\n\tStrCpy $R1 1\n\tWordFunc_WordFind${_WORDFUNC_S}_error:\n\tStrCmp $9 'E' 0 +3\n\tSetErrors\n\n\tWordFunc_WordFind${_WORDFUNC_S}_end:\n\tStrCpy $R0 $R1\n\n\tPop $R2\n\tPop $R1\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tExch $R0\n!macroend\n\n!define WordFind `!insertmacro WordFindCall ''`\n!define un.WordFind `!insertmacro WordFindCall ''`\n\n!macro WordFind\n!macroend\n\n!macro un.WordFind\n!macroend\n\n!macro WordFind_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordFindBody ''\n\n\t!verbose pop\n!macroend\n\n!define WordFindS `!insertmacro WordFindSCall ''`\n!define un.WordFindS `!insertmacro WordFindSCall ''`\n\n!macro WordFindS\n!macroend\n\n!macro un.WordFindS\n!macroend\n\n!macro WordFindS_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordFindBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro WordFind2XBody _WORDFUNC_S\n\tExch $2\n\tExch\n\tExch $1\n\tExch\n\tExch 2\n\tExch $0\n\tExch 2\n\tExch 3\n\tExch $R0\n\tExch 3\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R1\n\tPush $R2\n\tClearErrors\n\n\tStrCpy $R2 ''\n\tStrCpy $3 $2 1\n\tStrCpy $2 $2 '' 1\n\tStrCmp $3 'E' 0 +3\n\tStrCpy $R2 E\n\tgoto -4\n\n\tStrCmp${_WORDFUNC_S} $3 '+' +5\n\tStrCmp${_WORDFUNC_S} $3 '-' +4\n\tStrCmp${_WORDFUNC_S} $3 '#' WordFunc_WordFind2X${_WORDFUNC_S}_restart\n\tStrCmp${_WORDFUNC_S} $3 '/' WordFunc_WordFind2X${_WORDFUNC_S}_restart\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_error3\n\n\tStrCpy $4 $2 2 -2\n\tStrCmp${_WORDFUNC_S} $4 '{{' +9\n\tStrCmp${_WORDFUNC_S} $4 '}}' +8\n\tStrCmp${_WORDFUNC_S} $4 '{*' +7\n\tStrCmp${_WORDFUNC_S} $4 '*{' +6\n\tStrCmp${_WORDFUNC_S} $4 '*}' +5\n\tStrCmp${_WORDFUNC_S} $4 '}*' +4\n\tStrCmp${_WORDFUNC_S} $4 '{}' +3\n\tStrCpy $4 ''\n\tgoto +2\n\tStrCpy $2 $2 -2\n\tIntOp $2 $2 + 0\n\tStrCmp${_WORDFUNC_S} $2 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_restart:\n\tStrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind2X${_WORDFUNC_S}_error1\n\tStrCpy $5 -1\n\tStrCpy $6 0\n\tStrCpy $7 ''\n\tStrLen $8 $0\n\tStrLen $9 $1\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_loop:\n\tIntOp $5 $5 + 1\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_delim1:\n\tStrCpy $R1 $R0 $8 $5\n\tStrCmp${_WORDFUNC_S} $R1$6 0 WordFunc_WordFind2X${_WORDFUNC_S}_error1\n\tStrCmp${_WORDFUNC_S} $R1 '' WordFunc_WordFind2X${_WORDFUNC_S}_minus\n\tStrCmp${_WORDFUNC_S} $R1 $0 +2\n\tStrCmp${_WORDFUNC_S} $7 '' WordFunc_WordFind2X${_WORDFUNC_S}_loop WordFunc_WordFind2X${_WORDFUNC_S}_delim2\n\tStrCmp${_WORDFUNC_S} $0 $1 0 +2\n\tStrCmp${_WORDFUNC_S} $7 '' 0 WordFunc_WordFind2X${_WORDFUNC_S}_delim2\n\tIntOp $7 $5 + $8\n\tStrCpy $5 $7\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_delim1\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_delim2:\n\tStrCpy $R1 $R0 $9 $5\n\tStrCmp${_WORDFUNC_S} $R1 $1 0 WordFunc_WordFind2X${_WORDFUNC_S}_loop\n\tIntOp $6 $6 + 1\n\tStrCmp${_WORDFUNC_S} $3$6 '+$2' WordFunc_WordFind2X${_WORDFUNC_S}_plus\n\tStrCmp${_WORDFUNC_S} $3 '/' 0 WordFunc_WordFind2X${_WORDFUNC_S}_nextword\n\tIntOp $R1 $5 - $7\n\tStrCpy $R1 $R0 $R1 $7\n\tStrCmp${_WORDFUNC_S} $R1 $2 0 +3\n\tStrCpy $R1 $6\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\tWordFunc_WordFind2X${_WORDFUNC_S}_nextword:\n\tIntOp $5 $5 + $9\n\tStrCpy $7 ''\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_delim1\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_minus:\n\tStrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordFind2X${_WORDFUNC_S}_sum\n\tStrCpy $3 +\n\tIntOp $2 $6 - $2\n\tIntOp $2 $2 + 1\n\tIntCmp $2 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2 WordFunc_WordFind2X${_WORDFUNC_S}_error2 WordFunc_WordFind2X${_WORDFUNC_S}_restart\n\tWordFunc_WordFind2X${_WORDFUNC_S}_sum:\n\tStrCmp${_WORDFUNC_S} $3 '#' 0 WordFunc_WordFind2X${_WORDFUNC_S}_error2\n\tStrCpy $R1 $6\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_plus:\n\tStrCmp${_WORDFUNC_S} $4 '' 0 +4\n\tIntOp $R1 $5 - $7\n\tStrCpy $R1 $R0 $R1 $7\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\tIntOp $5 $5 + $9\n\tIntOp $7 $7 - $8\n\tStrCmp${_WORDFUNC_S} $4 '{*' +2\n\tStrCmp${_WORDFUNC_S} $4 '*{' 0 +3\n\tStrCpy $R1 $R0 $5\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $4 '*}' +2\n\tStrCmp${_WORDFUNC_S} $4 '}*' 0 +3\n\tStrCpy $R1 $R0 '' $7\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $4 '}}' 0 +3\n\tStrCpy $R1 $R0 '' $5\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $4 '{{' 0 +3\n\tStrCpy $R1 $R0 $7\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $4 '{}' 0 WordFunc_WordFind2X${_WORDFUNC_S}_error3\n\tStrCpy $5 $R0 '' $5\n\tStrCpy $7 $R0 $7\n\tStrCpy $R1 '$7$5'\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_end\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_error3:\n\tStrCpy $R1 3\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_error\n\tWordFunc_WordFind2X${_WORDFUNC_S}_error2:\n\tStrCpy $R1 2\n\tgoto WordFunc_WordFind2X${_WORDFUNC_S}_error\n\tWordFunc_WordFind2X${_WORDFUNC_S}_error1:\n\tStrCpy $R1 1\n\tWordFunc_WordFind2X${_WORDFUNC_S}_error:\n\tStrCmp $R2 'E' 0 +3\n\tSetErrors\n\n\tWordFunc_WordFind2X${_WORDFUNC_S}_end:\n\tStrCpy $R0 $R1\n\n\tPop $R2\n\tPop $R1\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tExch $R0\n!macroend\n\n!define WordFind2X `!insertmacro WordFind2XCall`\n!define un.WordFind2X `!insertmacro WordFind2XCall`\n\n!macro WordFind2X\n!macroend\n\n!macro un.WordFind2X\n!macroend\n\n!macro WordFind2X_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordFind2XBody ''\n\n\t!verbose pop\n!macroend\n\n!define WordFind2XS `!insertmacro WordFind2XSCall`\n!define un.WordFind2XS `!insertmacro WordFind2XSCall`\n\n!macro WordFind2XS\n!macroend\n\n!macro un.WordFind2XS\n!macroend\n\n!macro WordFind2XS_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordFind2XBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro WordFind3XBody _WORDFUNC_S\n\tExch $3\n\tExch\n\tExch $2\n\tExch\n\tExch 2\n\tExch $1\n\tExch 2\n\tExch 3\n\tExch $0\n\tExch 3\n\tExch 4\n\tExch $R0\n\tExch 4\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R1\n\tPush $R2\n\tPush $R3\n\tPush $R4\n\tPush $R5\n\tClearErrors\n\n\tStrCpy $R5 ''\n\tStrCpy $4 $3 1\n\tStrCpy $3 $3 '' 1\n\tStrCmp $4 'E' 0 +3\n\tStrCpy $R5 E\n\tgoto -4\n\n\tStrCmp${_WORDFUNC_S} $4 '+' +5\n\tStrCmp${_WORDFUNC_S} $4 '-' +4\n\tStrCmp${_WORDFUNC_S} $4 '#' WordFunc_WordFind3X${_WORDFUNC_S}_restart\n\tStrCmp${_WORDFUNC_S} $4 '/' WordFunc_WordFind3X${_WORDFUNC_S}_restart\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_error3\n\n\tStrCpy $5 $3 2 -2\n\tStrCmp${_WORDFUNC_S} $5 '{{' +9\n\tStrCmp${_WORDFUNC_S} $5 '}}' +8\n\tStrCmp${_WORDFUNC_S} $5 '{*' +7\n\tStrCmp${_WORDFUNC_S} $5 '*{' +6\n\tStrCmp${_WORDFUNC_S} $5 '*}' +5\n\tStrCmp${_WORDFUNC_S} $5 '}*' +4\n\tStrCmp${_WORDFUNC_S} $5 '{}' +3\n\tStrCpy $5 ''\n\tgoto +2\n\tStrCpy $3 $3 -2\n\tIntOp $3 $3 + 0\n\tStrCmp${_WORDFUNC_S} $3 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_restart:\n\tStrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordFind3X${_WORDFUNC_S}_error1\n\tStrCpy $6 -1\n\tStrCpy $7 0\n\tStrCpy $8 ''\n\tStrCpy $9 ''\n\tStrLen $R1 $0\n\tStrLen $R2 $1\n\tStrLen $R3 $2\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_loop:\n\tIntOp $6 $6 + 1\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_delim1:\n\tStrCpy $R4 $R0 $R1 $6\n\tStrCmp${_WORDFUNC_S} $R4$7 0 WordFunc_WordFind3X${_WORDFUNC_S}_error1\n\tStrCmp${_WORDFUNC_S} $R4 '' WordFunc_WordFind3X${_WORDFUNC_S}_minus\n\tStrCmp${_WORDFUNC_S} $R4 $0 +2\n\tStrCmp${_WORDFUNC_S} $8 '' WordFunc_WordFind3X${_WORDFUNC_S}_loop WordFunc_WordFind3X${_WORDFUNC_S}_center\n\tStrCmp${_WORDFUNC_S} $0 $1 +2\n\tStrCmp${_WORDFUNC_S} $0 $2 0 +2\n\tStrCmp${_WORDFUNC_S} $8 '' 0 WordFunc_WordFind3X${_WORDFUNC_S}_center\n\tIntOp $8 $6 + $R1\n\tStrCpy $6 $8\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_delim1\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_center:\n\tStrCmp${_WORDFUNC_S} $9 '' 0 WordFunc_WordFind3X${_WORDFUNC_S}_delim2\n\tStrCpy $R4 $R0 $R2 $6\n\tStrCmp${_WORDFUNC_S} $R4 $1 0 WordFunc_WordFind3X${_WORDFUNC_S}_loop\n\tIntOp $9 $6 + $R2\n\tStrCpy $6 $9\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_delim1\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_delim2:\n\tStrCpy $R4 $R0 $R3 $6\n\tStrCmp${_WORDFUNC_S} $R4 $2 0 WordFunc_WordFind3X${_WORDFUNC_S}_loop\n\tIntOp $7 $7 + 1\n\tStrCmp${_WORDFUNC_S} $4$7 '+$3' WordFunc_WordFind3X${_WORDFUNC_S}_plus\n\tStrCmp${_WORDFUNC_S} $4 '/' 0 WordFunc_WordFind3X${_WORDFUNC_S}_nextword\n\tIntOp $R4 $6 - $8\n\tStrCpy $R4 $R0 $R4 $8\n\tStrCmp${_WORDFUNC_S} $R4 $3 0 +3\n\tStrCpy $R4 $7\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\tWordFunc_WordFind3X${_WORDFUNC_S}_nextword:\n\tIntOp $6 $6 + $R3\n\tStrCpy $8 ''\n\tStrCpy $9 ''\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_delim1\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_minus:\n\tStrCmp${_WORDFUNC_S} $4 '-' 0 WordFunc_WordFind3X${_WORDFUNC_S}_sum\n\tStrCpy $4 +\n\tIntOp $3 $7 - $3\n\tIntOp $3 $3 + 1\n\tIntCmp $3 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2 WordFunc_WordFind3X${_WORDFUNC_S}_error2 WordFunc_WordFind3X${_WORDFUNC_S}_restart\n\tWordFunc_WordFind3X${_WORDFUNC_S}_sum:\n\tStrCmp${_WORDFUNC_S} $4 '#' 0 WordFunc_WordFind3X${_WORDFUNC_S}_error2\n\tStrCpy $R4 $7\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_plus:\n\tStrCmp${_WORDFUNC_S} $5 '' 0 +4\n\tIntOp $R4 $6 - $8\n\tStrCpy $R4 $R0 $R4 $8\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\tIntOp $6 $6 + $R3\n\tIntOp $8 $8 - $R1\n\tStrCmp${_WORDFUNC_S} $5 '{*' +2\n\tStrCmp${_WORDFUNC_S} $5 '*{' 0 +3\n\tStrCpy $R4 $R0 $6\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $5 '*}' +2\n\tStrCmp${_WORDFUNC_S} $5 '}*' 0 +3\n\tStrCpy $R4 $R0 '' $8\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $5 '}}' 0 +3\n\tStrCpy $R4 $R0 '' $6\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $5 '{{' 0 +3\n\tStrCpy $R4 $R0 $8\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $5 '{}' 0 WordFunc_WordFind3X${_WORDFUNC_S}_error3\n\tStrCpy $6 $R0 '' $6\n\tStrCpy $8 $R0 $8\n\tStrCpy $R4 '$8$6'\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_end\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_error3:\n\tStrCpy $R4 3\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_error\n\tWordFunc_WordFind3X${_WORDFUNC_S}_error2:\n\tStrCpy $R4 2\n\tgoto WordFunc_WordFind3X${_WORDFUNC_S}_error\n\tWordFunc_WordFind3X${_WORDFUNC_S}_error1:\n\tStrCpy $R4 1\n\tWordFunc_WordFind3X${_WORDFUNC_S}_error:\n\tStrCmp $R5 'E' 0 +3\n\tSetErrors\n\n\tWordFunc_WordFind3X${_WORDFUNC_S}_end:\n\tStrCpy $R0 $R4\n\tPop $R5\n\tPop $R4\n\tPop $R3\n\tPop $R2\n\tPop $R1\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tExch $R0\n!macroend\n\n!define WordFind3X `!insertmacro WordFind3XCall`\n!define un.WordFind3X `!insertmacro WordFind3XCall`\n\n!macro WordFind3X\n!macroend\n\n!macro un.WordFind3X\n!macroend\n\n!macro WordFind3X_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordFind3XBody ''\n\n\t!verbose pop\n!macroend\n\n!define WordFind3XS `!insertmacro WordFind3XSCall`\n!define un.WordFind3XS `!insertmacro WordFind3XSCall`\n\n!macro WordFind3XS\n!macroend\n\n!macro un.WordFind3XS\n!macroend\n\n!macro WordFind3XS_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordFind3XBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro WordReplaceBody _WORDFUNC_S\n\tExch $2\n\tExch\n\tExch $1\n\tExch\n\tExch 2\n\tExch $0\n\tExch 2\n\tExch 3\n\tExch $R0\n\tExch 3\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R1\n\tClearErrors\n\n\tStrCpy $R1 $R0\n\tStrCpy $9 ''\n\tStrCpy $3 $2 1\n\tStrCpy $2 $2 '' 1\n\tStrCmp $3 'E' 0 +3\n\tStrCpy $9 E\n\tgoto -4\n\n\tStrCpy $4 $2 1 -1\n\tStrCpy $5 ''\n\tStrCpy $6 ''\n\tStrLen $7 $0\n\n\tStrCmp${_WORDFUNC_S} $7 0 WordFunc_WordReplace${_WORDFUNC_S}_error1\n\tStrCmp${_WORDFUNC_S} $R0 '' WordFunc_WordReplace${_WORDFUNC_S}_error1\n\tStrCmp${_WORDFUNC_S} $3 '{' WordFunc_WordReplace${_WORDFUNC_S}_beginning\n\tStrCmp${_WORDFUNC_S} $3 '}' WordFunc_WordReplace${_WORDFUNC_S}_ending WordFunc_WordReplace${_WORDFUNC_S}_errorchk\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_beginning:\n\tStrCpy $8 $R0 $7\n\tStrCmp${_WORDFUNC_S} $8 $0 0 +4\n\tStrCpy $R0 $R0 '' $7\n\tStrCpy $5 '$5$1'\n\tgoto -4\n\tStrCpy $3 $2 1\n\tStrCmp${_WORDFUNC_S} $3 '}' 0 WordFunc_WordReplace${_WORDFUNC_S}_merge\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_ending:\n\tStrCpy $8 $R0 '' -$7\n\tStrCmp${_WORDFUNC_S} $8 $0 0 +4\n\tStrCpy $R0 $R0 -$7\n\tStrCpy $6 '$6$1'\n\tgoto -4\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_merge:\n\tStrCmp${_WORDFUNC_S} $4 '*' 0 +5\n\tStrCmp${_WORDFUNC_S} $5 '' +2\n\tStrCpy $5 $1\n\tStrCmp${_WORDFUNC_S} $6 '' +2\n\tStrCpy $6 $1\n\tStrCpy $R0 '$5$R0$6'\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_end\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_errorchk:\n\tStrCmp${_WORDFUNC_S} $3 '+' +2\n\tStrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordReplace${_WORDFUNC_S}_error3\n\n\tStrCpy $5 $2 1\n\tIntOp $2 $2 + 0\n\tStrCmp${_WORDFUNC_S} $2 0 0 WordFunc_WordReplace${_WORDFUNC_S}_one\n\tStrCmp${_WORDFUNC_S} $5 0 WordFunc_WordReplace${_WORDFUNC_S}_error2\n\tStrCpy $3 ''\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_all:\n\tStrCpy $5 0\n\tStrCpy $2 $R0 $7 $5\n\tStrCmp${_WORDFUNC_S} $2 '' +4\n\tStrCmp${_WORDFUNC_S} $2 $0 +6\n\tIntOp $5 $5 + 1\n\tgoto -4\n\tStrCmp${_WORDFUNC_S} $R0 $R1 WordFunc_WordReplace${_WORDFUNC_S}_error1\n\tStrCpy $R0 '$3$R0'\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_end\n\tStrCpy $2 $R0 $5\n\tIntOp $5 $5 + $7\n\tStrCmp${_WORDFUNC_S} $4 '*' 0 +3\n\tStrCpy $6 $R0 $7 $5\n\tStrCmp${_WORDFUNC_S} $6 $0 -3\n\tStrCpy $R0 $R0 '' $5\n\tStrCpy $3 '$3$2$1'\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_all\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_one:\n\tStrCpy $5 0\n\tStrCpy $8 0\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_loop\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_preloop:\n\tIntOp $5 $5 + 1\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_loop:\n\tStrCpy $6 $R0 $7 $5\n\tStrCmp${_WORDFUNC_S} $6$8 0 WordFunc_WordReplace${_WORDFUNC_S}_error1\n\tStrCmp${_WORDFUNC_S} $6 '' WordFunc_WordReplace${_WORDFUNC_S}_minus\n\tStrCmp${_WORDFUNC_S} $6 $0 0 WordFunc_WordReplace${_WORDFUNC_S}_preloop\n\tIntOp $8 $8 + 1\n\tStrCmp${_WORDFUNC_S} $3$8 +$2 WordFunc_WordReplace${_WORDFUNC_S}_found\n\tIntOp $5 $5 + $7\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_loop\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_minus:\n\tStrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordReplace${_WORDFUNC_S}_error2\n\tStrCpy $3 +\n\tIntOp $2 $8 - $2\n\tIntOp $2 $2 + 1\n\tIntCmp $2 0 WordFunc_WordReplace${_WORDFUNC_S}_error2 WordFunc_WordReplace${_WORDFUNC_S}_error2 WordFunc_WordReplace${_WORDFUNC_S}_one\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_found:\n\tStrCpy $3 $R0 $5\n\tStrCmp${_WORDFUNC_S} $4 '*' 0 +5\n\tStrCpy $6 $3 '' -$7\n\tStrCmp${_WORDFUNC_S} $6 $0 0 +3\n\tStrCpy $3 $3 -$7\n\tgoto -3\n\tIntOp $5 $5 + $7\n\tStrCmp${_WORDFUNC_S} $4 '*' 0 +3\n\tStrCpy $6 $R0 $7 $5\n\tStrCmp${_WORDFUNC_S} $6 $0 -3\n\tStrCpy $R0 $R0 '' $5\n\tStrCpy $R0 '$3$1$R0'\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_end\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_error3:\n\tStrCpy $R0 3\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_error\n\tWordFunc_WordReplace${_WORDFUNC_S}_error2:\n\tStrCpy $R0 2\n\tgoto WordFunc_WordReplace${_WORDFUNC_S}_error\n\tWordFunc_WordReplace${_WORDFUNC_S}_error1:\n\tStrCpy $R0 1\n\tWordFunc_WordReplace${_WORDFUNC_S}_error:\n\tStrCmp $9 'E' +3\n\tStrCpy $R0 $R1\n\tgoto +2\n\tSetErrors\n\n\tWordFunc_WordReplace${_WORDFUNC_S}_end:\n\tPop $R1\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tExch $R0\n!macroend\n\n!define WordReplace `!insertmacro WordReplaceCall`\n!define un.WordReplace `!insertmacro WordReplaceCall`\n\n!macro WordReplace\n!macroend\n\n!macro un.WordReplace\n!macroend\n\n!macro WordReplace_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordReplaceBody ''\n\n\t!verbose pop\n!macroend\n\n!define WordReplaceS `!insertmacro WordReplaceSCall`\n!define un.WordReplaceS `!insertmacro WordReplaceSCall`\n\n!macro WordReplaceS\n!macroend\n\n!macro un.WordReplaceS\n!macroend\n\n!macro WordReplaceS_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordReplaceBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro WordAddBody _WORDFUNC_S\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tExch 2\n\tExch $R0\n\tExch 2\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $R1\n\tClearErrors\n\n\tStrCpy $7 ''\n\tStrCpy $2 $1 1\n\tStrCmp $2 'E' 0 +4\n\tStrCpy $7 E\n\tStrCpy $1 $1 '' 1\n\tgoto -4\n\n\tStrCpy $5 0\n\tStrCpy $R1 $R0\n\tStrCpy $2 $1 '' 1\n\tStrCpy $1 $1 1\n\tStrCmp${_WORDFUNC_S} $1 '+' +2\n\tStrCmp${_WORDFUNC_S} $1 '-' 0 WordFunc_WordAdd${_WORDFUNC_S}_error3\n\n\tStrCmp${_WORDFUNC_S} $0 '' WordFunc_WordAdd${_WORDFUNC_S}_error1\n\tStrCmp${_WORDFUNC_S} $2 '' WordFunc_WordAdd${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $R0 '' 0 +5\n\tStrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $1 '+' 0 +3\n\tStrCpy $R0 $2\n\tgoto WordFunc_WordAdd${_WORDFUNC_S}_end\n\n\tWordFunc_WordAdd${_WORDFUNC_S}_loop:\n\tIntOp $5 $5 + 1\n\t!insertmacro WordFind${_WORDFUNC_S}Call 2 $2 $0 E+$5 $3\n\tIfErrors 0 WordFunc_WordAdd${_WORDFUNC_S}_/word\n\tStrCmp${_WORDFUNC_S} $3 2 +4\n\tStrCmp${_WORDFUNC_S} $3$5 11 0 +3\n\tStrCpy $3 $2\n\tgoto WordFunc_WordAdd${_WORDFUNC_S}_/word\n\tStrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_end WordFunc_WordAdd${_WORDFUNC_S}_preend\n\n\tWordFunc_WordAdd${_WORDFUNC_S}_/word:\n\t!insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E/$3 $4\n\tIfErrors +2\n\tStrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_delete WordFunc_WordAdd${_WORDFUNC_S}_loop\n\tStrCmp${_WORDFUNC_S} $1$4 '-1' +2\n\tStrCmp${_WORDFUNC_S} $1 '-' WordFunc_WordAdd${_WORDFUNC_S}_loop +4\n\tStrCmp${_WORDFUNC_S} $R0 $3 0 WordFunc_WordAdd${_WORDFUNC_S}_loop\n\tStrCpy $R0 ''\n\tgoto WordFunc_WordAdd${_WORDFUNC_S}_end\n\tStrCmp${_WORDFUNC_S} $1$4 '+1' 0 +2\n\tStrCmp${_WORDFUNC_S} $R0 $3 WordFunc_WordAdd${_WORDFUNC_S}_loop\n\tStrCmp${_WORDFUNC_S} $R0 $R1 +3\n\tStrCpy $R1 '$R1$0$3'\n\tgoto WordFunc_WordAdd${_WORDFUNC_S}_loop\n\tStrLen $6 $0\n\tStrCpy $6 $R0 '' -$6\n\tStrCmp${_WORDFUNC_S} $6 $0 0 -4\n\tStrCpy $R1 '$R1$3'\n\tgoto WordFunc_WordAdd${_WORDFUNC_S}_loop\n\n\tWordFunc_WordAdd${_WORDFUNC_S}_delete:\n\t!insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E+$4{} $R0\n\tgoto WordFunc_WordAdd${_WORDFUNC_S}_/word\n\n\tWordFunc_WordAdd${_WORDFUNC_S}_error3:\n\tStrCpy $R1 3\n\tgoto WordFunc_WordAdd${_WORDFUNC_S}_error\n\tWordFunc_WordAdd${_WORDFUNC_S}_error1:\n\tStrCpy $R1 1\n\tWordFunc_WordAdd${_WORDFUNC_S}_error:\n\tStrCmp $7 'E' 0 WordFunc_WordAdd${_WORDFUNC_S}_end\n\tSetErrors\n\n\tWordFunc_WordAdd${_WORDFUNC_S}_preend:\n\tStrCpy $R0 $R1\n\n\tWordFunc_WordAdd${_WORDFUNC_S}_end:\n\tPop $R1\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tExch $R0\n!macroend\n\n!define WordAdd `!insertmacro WordAddCall`\n!define un.WordAdd `!insertmacro WordAddCall`\n\n!macro WordAdd\n!macroend\n\n!macro un.WordAdd\n!macroend\n\n!macro WordAdd_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordAddBody ''\n\n\t!verbose pop\n!macroend\n\n!define WordAddS `!insertmacro WordAddSCall`\n!define un.WordAddS `!insertmacro WordAddSCall`\n\n!macro WordAddS\n!macroend\n\n!macro un.WordAddS\n!macroend\n\n!macro WordAddS_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordAddBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro WordInsertBody _WORDFUNC_S\n\tExch $2\n\tExch\n\tExch $1\n\tExch\n\tExch 2\n\tExch $0\n\tExch 2\n\tExch 3\n\tExch $R0\n\tExch 3\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $8\n\tPush $9\n\tPush $R1\n\tClearErrors\n\n\tStrCpy $5 ''\n\tStrCpy $6 $0\n\tStrCpy $7 }\n\n\tStrCpy $9 ''\n\tStrCpy $R1 $R0\n\tStrCpy $3 $2 1\n\tStrCpy $2 $2 '' 1\n\tStrCmp $3 'E' 0 +3\n\tStrCpy $9 'E'\n\tgoto -4\n\n\tStrCmp${_WORDFUNC_S} $3 '+' +2\n\tStrCmp${_WORDFUNC_S} $3 '-' 0 WordFunc_WordInsert${_WORDFUNC_S}_error3\n\tIntOp $2 $2 + 0\n\tStrCmp${_WORDFUNC_S} $2 0 WordFunc_WordInsert${_WORDFUNC_S}_error2\n\tStrCmp${_WORDFUNC_S} $0 '' WordFunc_WordInsert${_WORDFUNC_S}_error1\n\n\tStrCmp${_WORDFUNC_S} $2 1 0 WordFunc_WordInsert${_WORDFUNC_S}_two\n\tGetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_oneback\n\tStrCmp${_WORDFUNC_S} $3 '+' WordFunc_WordInsert${_WORDFUNC_S}_call\n\tStrCpy $7 {\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_call\n\tWordFunc_WordInsert${_WORDFUNC_S}_oneback:\n\tIfErrors 0 +2\n\tStrCpy $4 $R0\n\tStrCmp${_WORDFUNC_S} $3 '+' 0 +3\n\tStrCpy $R0 '$1$0$4'\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_end\n\tStrCpy $R0 '$4$0$1'\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_end\n\n\tWordFunc_WordInsert${_WORDFUNC_S}_two:\n\tIntOp $2 $2 - 1\n\tGetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_twoback\n\tStrCmp${_WORDFUNC_S} $3 '+' 0 WordFunc_WordInsert${_WORDFUNC_S}_call\n\tStrCpy $7 {\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_call\n\tWordFunc_WordInsert${_WORDFUNC_S}_twoback:\n\tIfErrors 0 WordFunc_WordInsert${_WORDFUNC_S}_tree\n\tStrCmp${_WORDFUNC_S} $2$4 11 0 WordFunc_WordInsert${_WORDFUNC_S}_error2\n\tStrCmp${_WORDFUNC_S} $3 '+' 0 +3\n\tStrCpy $R0 '$R0$0$1'\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_end\n\tStrCpy $R0 '$1$0$R0'\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_end\n\n\tWordFunc_WordInsert${_WORDFUNC_S}_tree:\n\tStrCpy $7 }\n\tStrCpy $5 $4\n\tIntOp $2 $2 + 1\n\tGetLabelAddress $8 WordFunc_WordInsert${_WORDFUNC_S}_treeback\n\tStrCmp${_WORDFUNC_S} $3 '+' WordFunc_WordInsert${_WORDFUNC_S}_call\n\tStrCpy $7 {\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_call\n\tWordFunc_WordInsert${_WORDFUNC_S}_treeback:\n\tIfErrors 0 +3\n\tStrCpy $4 ''\n\tStrCpy $6 ''\n\tStrCmp${_WORDFUNC_S} $3 '+' 0 +3\n\tStrCpy $R0 '$5$0$1$6$4'\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_end\n\tStrCpy $R0 '$4$6$1$0$5'\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_end\n\n\tWordFunc_WordInsert${_WORDFUNC_S}_call:\n\t!insertmacro WordFind${_WORDFUNC_S}Call 2 $R0 $0 E$3$2*$7 $4\n\tgoto $8\n\n\tWordFunc_WordInsert${_WORDFUNC_S}_error3:\n\tStrCpy $R0 3\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_error\n\tWordFunc_WordInsert${_WORDFUNC_S}_error2:\n\tStrCpy $R0 2\n\tgoto WordFunc_WordInsert${_WORDFUNC_S}_error\n\tWordFunc_WordInsert${_WORDFUNC_S}_error1:\n\tStrCpy $R0 1\n\tWordFunc_WordInsert${_WORDFUNC_S}_error:\n\tStrCmp $9 'E' +3\n\tStrCpy $R0 $R1\n\tgoto +2\n\tSetErrors\n\n\tWordFunc_WordInsert${_WORDFUNC_S}_end:\n\tPop $R1\n\tPop $9\n\tPop $8\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tExch $R0\n!macroend\n\n!define WordInsert `!insertmacro WordInsertCall`\n!define un.WordInsert `!insertmacro WordInsertCall`\n\n!macro WordInsert\n!macroend\n\n!macro un.WordInsert\n!macroend\n\n!macro WordInsert_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordInsertBody ''\n\n\t!verbose pop\n!macroend\n\n\n!define WordInsertS `!insertmacro WordInsertSCall`\n!define un.WordInsertS `!insertmacro WordInsertSCall`\n\n!macro WordInsertS\n!macroend\n\n!macro un.WordInsertS\n!macroend\n\n!macro WordInsertS_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro WordInsertBody 'S'\n\n\t!verbose pop\n!macroend\n\n!macro StrFilterBody _WORDFUNC_S\n\tExch $2\n\tExch\n\tExch $1\n\tExch\n\tExch 2\n\tExch $0\n\tExch 2\n\tExch 3\n\tExch $R0\n\tExch 3\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\tPush $R1\n\tPush $R2\n\tPush $R3\n\tPush $R4\n\tPush $R5\n\tPush $R6\n\tPush $R7\n\tPush $R8\n\tClearErrors\n\n\tStrCpy $R2 $0 '' -3\n\tStrCmp $R2 \"eng\" WordFunc_StrFilter${_WORDFUNC_S}_eng\n\tStrCmp $R2 \"rus\" WordFunc_StrFilter${_WORDFUNC_S}_rus\n\tWordFunc_StrFilter${_WORDFUNC_S}_eng:\n\tStrCpy $4 65\n\tStrCpy $5 90\n\tStrCpy $6 97\n\tStrCpy $7 122\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_langend\n\tWordFunc_StrFilter${_WORDFUNC_S}_rus:\n\tStrCpy $4 192\n\tStrCpy $5 223\n\tStrCpy $6 224\n\tStrCpy $7 255\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_langend\n\t;...\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_langend:\n\tStrCpy $R7 ''\n\tStrCpy $R8 ''\n\n\tStrCmp${_WORDFUNC_S} $2 '' 0 WordFunc_StrFilter${_WORDFUNC_S}_begin\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_restart1:\n\tStrCpy $2 ''\n\tStrCpy $3 $0 1\n\tStrCmp${_WORDFUNC_S} $3 '+' +2\n\tStrCmp${_WORDFUNC_S} $3 '-' 0 +3\n\tStrCpy $0 $0 '' 1\n\tgoto +2\n\tStrCpy $3 ''\n\n\tIntOp $0 $0 + 0\n\tStrCmp${_WORDFUNC_S} $0 0 +5\n\tStrCpy $R7 $0 1 0\n\tStrCpy $R8 $0 1 1\n\tStrCpy $R2 $0 1 2\n\tStrCmp${_WORDFUNC_S} $R2 '' WordFunc_StrFilter${_WORDFUNC_S}_filter WordFunc_StrFilter${_WORDFUNC_S}_error\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_restart2:\n\tStrCmp${_WORDFUNC_S} $3 '' WordFunc_StrFilter${_WORDFUNC_S}_end\n\tStrCpy $R7 ''\n\tStrCpy $R8 '+-'\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_begin\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_filter:\n\tStrCmp${_WORDFUNC_S} $R7 '1' +3\n\tStrCmp${_WORDFUNC_S} $R7 '2' +2\n\tStrCmp${_WORDFUNC_S} $R7 '3' 0 WordFunc_StrFilter${_WORDFUNC_S}_error\n\n\tStrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_begin\n\tStrCmp${_WORDFUNC_S} $R7$R8 '23' +2\n\tStrCmp${_WORDFUNC_S} $R7$R8 '32' 0 +3\n\tStrCpy $R7 -1\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_begin\n\tStrCmp${_WORDFUNC_S} $R7$R8 '13' +2\n\tStrCmp${_WORDFUNC_S} $R7$R8 '31' 0 +3\n\tStrCpy $R7 -2\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_begin\n\tStrCmp${_WORDFUNC_S} $R7$R8 '12' +2\n\tStrCmp${_WORDFUNC_S} $R7$R8 '21' 0 WordFunc_StrFilter${_WORDFUNC_S}_error\n\tStrCpy $R7 -3\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_begin:\n\tStrCpy $R6 0\n\tStrCpy $R1 ''\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_loop:\n\tStrCpy $R2 $R0 1 $R6\n\tStrCmp${_WORDFUNC_S} $R2 '' WordFunc_StrFilter${_WORDFUNC_S}_restartchk\n\n\tStrCmp${_WORDFUNC_S} $2 '' +7\n\tStrCpy $R4 0\n\tStrCpy $R5 $2 1 $R4\n\tStrCmp${_WORDFUNC_S} $R5 '' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol\n\tStrCmp${_WORDFUNC_S} $R5 $R2 WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol\n\tIntOp $R4 $R4 + 1\n\tgoto -4\n\n\tStrCmp${_WORDFUNC_S} $1 '' +7\n\tStrCpy $R4 0\n\tStrCpy $R5 $1 1 $R4\n\tStrCmp${_WORDFUNC_S} $R5 '' +4\n\tStrCmp${_WORDFUNC_S} $R5 $R2 WordFunc_StrFilter${_WORDFUNC_S}_addsymbol\n\tIntOp $R4 $R4 + 1\n\tgoto -4\n\n\tStrCmp${_WORDFUNC_S} $R7 '1' +2\n\tStrCmp${_WORDFUNC_S} $R7 '-1' 0 +4\n\tStrCpy $R4 48\n\tStrCpy $R5 57\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_loop2\n\tStrCmp${_WORDFUNC_S} $R8 '+-' 0 +2\n\tStrCmp${_WORDFUNC_S} $3 '+' 0 +4\n\tStrCpy $R4 $4\n\tStrCpy $R5 $5\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_loop2\n\tStrCpy $R4 $6\n\tStrCpy $R5 $7\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_loop2:\n\tIntFmt $R3 '%c' $R4\n\tStrCmp $R2 $R3 WordFunc_StrFilter${_WORDFUNC_S}_found\n\tStrCmp $R4 $R5 WordFunc_StrFilter${_WORDFUNC_S}_notfound\n\tIntOp $R4 $R4 + 1\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_loop2\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_found:\n\tStrCmp${_WORDFUNC_S} $R8 '+-' WordFunc_StrFilter${_WORDFUNC_S}_setcase\n\tStrCmp${_WORDFUNC_S} $R7 '3' WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol\n\tStrCmp${_WORDFUNC_S} $R7 '-3' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol\n\tStrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_notfound:\n\tStrCmp${_WORDFUNC_S} $R8 '+-' WordFunc_StrFilter${_WORDFUNC_S}_addsymbol\n\tStrCmp${_WORDFUNC_S} $R7 '3' 0 +2\n\tStrCmp${_WORDFUNC_S} $R5 57 WordFunc_StrFilter${_WORDFUNC_S}_addsymbol +3\n\tStrCmp${_WORDFUNC_S} $R7 '-3' 0 +5\n\tStrCmp${_WORDFUNC_S} $R5 57 WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol\n\tStrCpy $R4 48\n\tStrCpy $R5 57\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_loop2\n\tStrCmp${_WORDFUNC_S} $R8 '' WordFunc_StrFilter${_WORDFUNC_S}_skipsymbol WordFunc_StrFilter${_WORDFUNC_S}_addsymbol\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_setcase:\n\tStrCpy $R2 $R3\n\tWordFunc_StrFilter${_WORDFUNC_S}_addsymbol:\n\tStrCpy $R1 $R1$R2\n\tWordFunc_StrFilter${_WORDFUNC_S}_skipsymbol:\n\tIntOp $R6 $R6 + 1\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_loop\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_error:\n\tSetErrors\n\tStrCpy $R0 ''\n\tgoto WordFunc_StrFilter${_WORDFUNC_S}_end\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_restartchk:\n\tStrCpy $R0 $R1\n\tStrCmp${_WORDFUNC_S} $2 '' 0 WordFunc_StrFilter${_WORDFUNC_S}_restart1\n\tStrCmp${_WORDFUNC_S} $R8 '+-' 0 WordFunc_StrFilter${_WORDFUNC_S}_restart2\n\n\tWordFunc_StrFilter${_WORDFUNC_S}_end:\n\tPop $R8\n\tPop $R7\n\tPop $R6\n\tPop $R5\n\tPop $R4\n\tPop $R3\n\tPop $R2\n\tPop $R1\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tPop $0\n\tExch $R0\n!macroend\n\n!define StrFilter `!insertmacro StrFilterCall`\n!define un.StrFilter `!insertmacro StrFilterCall`\n\n!macro StrFilter\n!macroend\n\n!macro un.StrFilter\n!macroend\n\n!macro StrFilter_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro StrFilterBody ''\n\n\t!verbose pop\n!macroend\n\n\n!define StrFilterS `!insertmacro StrFilterSCall`\n!define un.StrFilterS `!insertmacro StrFilterSCall`\n\n!macro StrFilterS\n!macroend\n\n!macro un.StrFilterS\n!macroend\n\n!macro StrFilterS_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\t!insertmacro StrFilterBody 'S'\n\n\t!verbose pop\n!macroend\n\n!define VersionCompare `!insertmacro VersionCompareCall`\n!define un.VersionCompare `!insertmacro VersionCompareCall`\n\n!macro VersionCompare\n!macroend\n\n!macro un.VersionCompare\n!macroend\n\n!macro VersionCompare_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\n\tWordFunc_VersionCompare_begin:\n\tStrCpy $2 -1\n\tIntOp $2 $2 + 1\n\tStrCpy $3 $0 1 $2\n\tStrCmp $3 '' +2\n\tStrCmp $3 '.' 0 -3\n\tStrCpy $4 $0 $2\n\tIntOp $2 $2 + 1\n\tStrCpy $0 $0 '' $2\n\n\tStrCpy $2 -1\n\tIntOp $2 $2 + 1\n\tStrCpy $3 $1 1 $2\n\tStrCmp $3 '' +2\n\tStrCmp $3 '.' 0 -3\n\tStrCpy $5 $1 $2\n\tIntOp $2 $2 + 1\n\tStrCpy $1 $1 '' $2\n\n\tStrCmp $4$5 '' WordFunc_VersionCompare_equal\n\n\tStrCpy $6 -1\n\tIntOp $6 $6 + 1\n\tStrCpy $3 $4 1 $6\n\tStrCmp $3 '0' -2\n\tStrCmp $3 '' 0 +2\n\tStrCpy $4 0\n\n\tStrCpy $7 -1\n\tIntOp $7 $7 + 1\n\tStrCpy $3 $5 1 $7\n\tStrCmp $3 '0' -2\n\tStrCmp $3 '' 0 +2\n\tStrCpy $5 0\n\n\tStrCmp $4 0 0 +2\n\tStrCmp $5 0 WordFunc_VersionCompare_begin WordFunc_VersionCompare_newer2\n\tStrCmp $5 0 WordFunc_VersionCompare_newer1\n\tIntCmp $6 $7 0 WordFunc_VersionCompare_newer1 WordFunc_VersionCompare_newer2\n\n\tStrCpy $4 '1$4'\n\tStrCpy $5 '1$5'\n\tIntCmp $4 $5 WordFunc_VersionCompare_begin WordFunc_VersionCompare_newer2 WordFunc_VersionCompare_newer1\n\n\tWordFunc_VersionCompare_equal:\n\tStrCpy $0 0\n\tgoto WordFunc_VersionCompare_end\n\tWordFunc_VersionCompare_newer1:\n\tStrCpy $0 1\n\tgoto WordFunc_VersionCompare_end\n\tWordFunc_VersionCompare_newer2:\n\tStrCpy $0 2\n\n\tWordFunc_VersionCompare_end:\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!define VersionConvert `!insertmacro VersionConvertCall`\n!define un.VersionConvert `!insertmacro VersionConvertCall`\n\n!macro VersionConvert\n!macroend\n\n!macro un.VersionConvert\n!macroend\n\n!macro VersionConvert_\n\t!verbose push\n\t!verbose ${_WORDFUNC_VERBOSE}\n\n\tExch $1\n\tExch\n\tExch $0\n\tExch\n\tPush $2\n\tPush $3\n\tPush $4\n\tPush $5\n\tPush $6\n\tPush $7\n\n\tStrCmp $1 '' 0 +2\n\tStrCpy $1 'abcdefghijklmnopqrstuvwxyz'\n\tStrCpy $1 $1 99\n\n\tStrCpy $2 0\n\tStrCpy $7 'dot'\n\tgoto WordFunc_VersionConvert_loop\n\n\tWordFunc_VersionConvert_preloop:\n\tIntOp $2 $2 + 1\n\n\tWordFunc_VersionConvert_loop:\n\tStrCpy $3 $0 1 $2\n\tStrCmp $3 '' WordFunc_VersionConvert_endcheck\n\tStrCmp $3 '.' WordFunc_VersionConvert_dot\n\tStrCmp $3 '0' WordFunc_VersionConvert_digit\n\tIntCmp $3 '0' WordFunc_VersionConvert_letter WordFunc_VersionConvert_letter WordFunc_VersionConvert_digit\n\n\tWordFunc_VersionConvert_dot:\n\tStrCmp $7 'dot' WordFunc_VersionConvert_replacespecial\n\tStrCpy $7 'dot'\n\tgoto WordFunc_VersionConvert_preloop\n\n\tWordFunc_VersionConvert_digit:\n\tStrCmp $7 'letter' WordFunc_VersionConvert_insertdot\n\tStrCpy $7 'digit'\n\tgoto WordFunc_VersionConvert_preloop\n\n\tWordFunc_VersionConvert_letter:\n\tStrCpy $5 0\n\tStrCpy $4 $1 1 $5\n\tIntOp $5 $5 + 1\n\tStrCmp $4 '' WordFunc_VersionConvert_replacespecial\n\tStrCmp $4 $3 0 -3\n\tIntCmp $5 9 0 0 +2\n\tStrCpy $5 '0$5'\n\n\tStrCmp $7 'letter' +2\n\tStrCmp $7 'dot' 0 +3\n\tStrCpy $6 ''\n\tgoto +2\n\tStrCpy $6 '.'\n\n\tStrCpy $4 $0 $2\n\tIntOp $2 $2 + 1\n\tStrCpy $0 $0 '' $2\n\tStrCpy $0 '$4$6$5$0'\n\tStrLen $4 '$6$5'\n\tIntOp $2 $2 + $4\n\tIntOp $2 $2 - 1\n\tStrCpy $7 'letter'\n\tgoto WordFunc_VersionConvert_loop\n\n\tWordFunc_VersionConvert_replacespecial:\n\tStrCmp $7 'dot' 0 +3\n\tStrCpy $6 ''\n\tgoto +2\n\tStrCpy $6 '.'\n\n\tStrCpy $4 $0 $2\n\tIntOp $2 $2 + 1\n\tStrCpy $0 $0 '' $2\n\tStrCpy $0 '$4$6$0'\n\tStrLen $4 $6\n\tIntOp $2 $2 + $4\n\tIntOp $2 $2 - 1\n\tStrCpy $7 'dot'\n\tgoto WordFunc_VersionConvert_loop\n\n\tWordFunc_VersionConvert_insertdot:\n\tStrCpy $4 $0 $2\n\tStrCpy $0 $0 '' $2\n\tStrCpy $0 '$4.$0'\n\tStrCpy $7 'dot'\n\tgoto WordFunc_VersionConvert_preloop\n\n\tWordFunc_VersionConvert_endcheck:\n\tStrCpy $4 $0 1 -1\n\tStrCmp $4 '.' 0 WordFunc_VersionConvert_end\n\tStrCpy $0 $0 -1\n\tgoto -3\n\n\tWordFunc_VersionConvert_end:\n\tPop $7\n\tPop $6\n\tPop $5\n\tPop $4\n\tPop $3\n\tPop $2\n\tPop $1\n\tExch $0\n\n\t!verbose pop\n!macroend\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/nsArray.nsh",
    "content": "/*\n  nsArray NSIS plug-in by Stuart Welch <afrowuk@afrowsoft.co.uk>\n  v1.1.1.4 - 3rd September 2012\n*/\n\n!ifndef __NsArray_H__\n!define __NsArray_H__\n\n!include LogicLib.nsh\n!include Util.nsh\n\n!macro __nsArray_Copy\nExch $R0\nExch\nExch $R1\nPush $R2\nPush $R3\n\n  ${Do}\n    ClearErrors\n    nsArray::Iterate $R1\n    ${If} ${Errors}\n      ${Break}\n    ${EndIf}\n    Pop $R2\n    Pop $R3\n    nsArray::Set $R0 /key=$R2 $R3\n  ${Loop}\n\nPop $R3\nPop $R2\nPop $R1\nPop $R0\n!macroend\n\n!macro _nsArray_Copy Src Dest\n  Push `${Src}`\n  Push `${Dest}`\n  ${CallArtificialFunction} __nsArray_Copy\n!macroend\n!define nsArray_Copy `!insertmacro _nsArray_Copy`\n\n!macro __nsArray_CopyKeys\nExch $R0\nExch\nExch $R1\nPush $R2\nPush $R3\n\n  ${Do}\n    ClearErrors\n    nsArray::Iterate $R1\n    ${If} ${Errors}\n      ${Break}\n    ${EndIf}\n    Pop $R2\n    Pop $R3\n    nsArray::Set $R0 $R2\n  ${Loop}\n\nPop $R3\nPop $R2\nPop $R1\nPop $R0\n!macroend\n\n!macro _nsArray_CopyKeys Src Dest\n  Push `${Src}`\n  Push `${Dest}`\n  ${CallArtificialFunction} __nsArray_CopyKeys\n!macroend\n!define nsArray_CopyKeys `!insertmacro _nsArray_CopyKeys`\n\n!macro __nsArray_ToString\nExch $R0\nPush $R1\nPush $R2\nPush $R3\n\n  StrCpy $R3 ``\n  ${Do}\n    ClearErrors\n    nsArray::Iterate $R0\n    ${If} ${Errors}\n      ${Break}\n    ${EndIf}\n    Pop $R1\n    Pop $R2\n    ${If} $R3 != ``\n      StrCpy $R3 `$R3, `\n    ${EndIf}\n    StrCpy $R3 `$R3$R1 => $R2`\n  ${Loop}\n\n  StrCpy $R0 `$R0 = {$R3}`\n\nPop $R3\nPop $R2\nPop $R1\nExch $R0\n!macroend\n\n!macro _nsArray_ToString Array OutVar\n  Push `${Array}`\n  ${CallArtificialFunction} __nsArray_ToString\n  Pop `${OutVar}`\n!macroend\n!define nsArray_ToString `!insertmacro _nsArray_ToString`\n\n!macro _ForEachIn _s _a _k _v\n  !verbose push\n  !verbose ${LOGICLIB_VERBOSITY}\n  !insertmacro _PushLogic\n  !define ${_Logic}For _LogicLib_Label_${LOGICLIB_COUNTER}\n  !insertmacro _IncreaseCounter\n  !insertmacro _PushScope ExitFor _LogicLib_Label_${LOGICLIB_COUNTER}\n  nsArray::Iterate `${_a}` /reset\n  ${${_Logic}For}:\n  !insertmacro _IncreaseCounter\n  !insertmacro _PushScope Break ${_ExitFor}\n  ClearErrors\n  !if `${_s}` == next\n  nsArray::Iterate `${_a}`\n  !else\n  nsArray::Iterate `${_a}` /prev\n  !endif\n  IfErrors ${_ExitFor}\n  Pop `${_k}`\n  Pop `${_v}`\n  !insertmacro _PushScope Continue ${${_Logic}For}\n  !define ${_Logic}Condition _\n  !verbose pop\n!macroend\n!define ForEachIn `!insertmacro _ForEachIn next`\n!define ForEachInReverse `!insertmacro _ForEachIn prev`\n\n!endif"
  },
  {
    "path": "setup/nsis/tools/Include/nsDialogs.nsh",
    "content": "/*\n\nnsDialogs.nsh\nHeader file for creating custom installer pages with nsDialogs\n\n*/\n\n!ifndef NSDIALOGS_INCLUDED\n!verbose push 2\n!define NSDIALOGS_INCLUDED\n!verbose 3\n\n!include LogicLib.nsh\n!include WinMessages.nsh\n\n!define /ifndef WS_EX_DLGMODALFRAME  0x00000001\n!define /ifndef WS_EX_NOPARENTNOTIFY 0x00000004\n!define /ifndef WS_EX_TOPMOST        0x00000008\n!define /ifndef WS_EX_ACCEPTFILES    0x00000010\n!define /ifndef WS_EX_TRANSPARENT    0x00000020\n!define /ifndef WS_EX_MDICHILD       0x00000040\n!define /ifndef WS_EX_TOOLWINDOW     0x00000080\n!define /ifndef WS_EX_WINDOWEDGE     0x00000100\n!define /ifndef WS_EX_CLIENTEDGE     0x00000200\n!define /ifndef WS_EX_CONTEXTHELP    0x00000400\n!define /ifndef WS_EX_RIGHT          0x00001000\n!define /ifndef WS_EX_LEFT           0x00000000\n!define /ifndef WS_EX_RTLREADING     0x00002000\n!define /ifndef WS_EX_LTRREADING     0x00000000\n!define /ifndef WS_EX_LEFTSCROLLBAR  0x00004000\n!define /ifndef WS_EX_RIGHTSCROLLBAR 0x00000000\n!define /ifndef WS_EX_CONTROLPARENT  0x00010000\n!define /ifndef WS_EX_STATICEDGE     0x00020000\n!define /ifndef WS_EX_APPWINDOW      0x00040000\n\n!define /ifndef WS_CHILD             0x40000000\n!define /ifndef WS_VISIBLE           0x10000000\n!define /ifndef WS_DISABLED          0x08000000\n!define /ifndef WS_CLIPSIBLINGS      0x04000000\n!define /ifndef WS_CLIPCHILDREN      0x02000000\n!define /ifndef WS_MAXIMIZE          0x01000000\n!define /ifndef WS_BORDER            0x00800000\n!define /ifndef WS_VSCROLL           0x00200000\n!define /ifndef WS_HSCROLL           0x00100000\n!define /ifndef WS_GROUP             0x00020000\n!define /ifndef WS_MINIMIZEBOX       0x00020000\n!define /ifndef WS_MAXIMIZEBOX       0x00010000\n!define /ifndef WS_TABSTOP           0x00010000\n\n!define ES_LEFT              0x00000000\n!define ES_CENTER            0x00000001\n!define ES_RIGHT             0x00000002\n!define ES_MULTILINE         0x00000004\n!define ES_UPPERCASE         0x00000008\n!define ES_LOWERCASE         0x00000010\n!define ES_PASSWORD          0x00000020\n!define ES_AUTOVSCROLL       0x00000040\n!define ES_AUTOHSCROLL       0x00000080\n!define ES_NOHIDESEL         0x00000100\n!define ES_OEMCONVERT        0x00000400\n!define ES_READONLY          0x00000800\n!define ES_WANTRETURN        0x00001000\n!define ES_NUMBER            0x00002000\n!define ES_SAVESEL           0x00008000\n\n!define SS_LEFT              0x00000000\n!define SS_CENTER            0x00000001\n!define SS_RIGHT             0x00000002\n!define SS_ICON              0x00000003\n!define SS_BLACKRECT         0x00000004\n!define SS_GRAYRECT          0x00000005\n!define SS_WHITERECT         0x00000006\n!define SS_BLACKFRAME        0x00000007\n!define SS_GRAYFRAME         0x00000008\n!define SS_WHITEFRAME        0x00000009\n!define SS_USERITEM          0x0000000A\n!define SS_SIMPLE            0x0000000B\n!define SS_LEFTNOWORDWRAP    0x0000000C\n!define SS_OWNERDRAW         0x0000000D\n!define SS_BITMAP            0x0000000E\n!define SS_ENHMETAFILE       0x0000000F\n!define SS_ETCHEDHORZ        0x00000010\n!define SS_ETCHEDVERT        0x00000011\n!define SS_ETCHEDFRAME       0x00000012\n!define SS_TYPEMASK          0x0000001F\n!define SS_REALSIZECONTROL   0x00000040\n!define SS_NOPREFIX          0x00000080\n!define SS_NOTIFY            0x00000100\n!define SS_CENTERIMAGE       0x00000200\n!define SS_RIGHTJUST         0x00000400\n!define SS_REALSIZEIMAGE     0x00000800\n!define SS_SUNKEN            0x00001000\n!define SS_EDITCONTROL       0x00002000\n!define SS_ENDELLIPSIS       0x00004000\n!define SS_PATHELLIPSIS      0x00008000\n!define SS_WORDELLIPSIS      0x0000C000\n!define SS_ELLIPSISMASK      0x0000C000\n\n!define BS_PUSHBUTTON        0x00000000\n!define BS_DEFPUSHBUTTON     0x00000001\n!define BS_CHECKBOX          0x00000002\n!define BS_AUTOCHECKBOX      0x00000003\n!define BS_RADIOBUTTON       0x00000004\n!define BS_3STATE            0x00000005\n!define BS_AUTO3STATE        0x00000006\n!define BS_GROUPBOX          0x00000007\n!define BS_USERBUTTON        0x00000008\n!define BS_AUTORADIOBUTTON   0x00000009\n!define BS_PUSHBOX           0x0000000A\n!define BS_OWNERDRAW         0x0000000B\n!define BS_TYPEMASK          0x0000000F\n!define BS_LEFTTEXT          0x00000020\n!define BS_TEXT              0x00000000\n!define BS_ICON              0x00000040\n!define BS_BITMAP            0x00000080\n!define BS_LEFT              0x00000100\n!define BS_RIGHT             0x00000200\n!define BS_CENTER            0x00000300\n!define BS_TOP               0x00000400\n!define BS_BOTTOM            0x00000800\n!define BS_VCENTER           0x00000C00\n!define BS_PUSHLIKE          0x00001000\n!define BS_MULTILINE         0x00002000\n!define BS_NOTIFY            0x00004000\n!define BS_FLAT              0x00008000\n!define BS_RIGHTBUTTON       ${BS_LEFTTEXT}\n\n!define CBS_SIMPLE            0x0001\n!define CBS_DROPDOWN          0x0002\n!define CBS_DROPDOWNLIST      0x0003\n!define CBS_OWNERDRAWFIXED    0x0010\n!define CBS_OWNERDRAWVARIABLE 0x0020\n!define CBS_AUTOHSCROLL       0x0040\n!define CBS_OEMCONVERT        0x0080\n!define CBS_SORT              0x0100\n!define CBS_HASSTRINGS        0x0200\n!define CBS_NOINTEGRALHEIGHT  0x0400\n!define CBS_DISABLENOSCROLL   0x0800\n!define CBS_UPPERCASE         0x2000\n!define CBS_LOWERCASE         0x4000\n\n!define LBS_NOTIFY            0x0001\n!define LBS_SORT              0x0002\n!define LBS_NOREDRAW          0x0004\n!define LBS_MULTIPLESEL       0x0008\n!define LBS_OWNERDRAWFIXED    0x0010\n!define LBS_OWNERDRAWVARIABLE 0x0020\n!define LBS_HASSTRINGS        0x0040\n!define LBS_USETABSTOPS       0x0080\n!define LBS_NOINTEGRALHEIGHT  0x0100\n!define LBS_MULTICOLUMN       0x0200\n!define LBS_WANTKEYBOARDINPUT 0x0400\n!define LBS_EXTENDEDSEL       0x0800\n!define LBS_DISABLENOSCROLL   0x1000\n!define LBS_NODATA            0x2000\n!define LBS_NOSEL             0x4000\n!define LBS_COMBOBOX          0x8000\n\n!define ACS_CENTER      0x0001\n!define ACS_TRANSPARENT 0x0002 ;  The parent of the animation control must not have the WS_CLIPCHILDREN style\n!define ACS_AUTOPLAY    0x0004\n!define ACS_TIMER       0x0008 ; < CC6\n\n!define TBS_AUTOTICKS        0x0001\n!define TBS_VERT             0x0002\n!define TBS_HORZ             0x0000\n!define TBS_TOP              0x0004\n!define TBS_BOTTOM           0x0000\n!define TBS_LEFT             0x0004\n!define TBS_RIGHT            0x0000\n!define TBS_BOTH             0x0008\n!define TBS_NOTICKS          0x0010\n!define TBS_ENABLESELRANGE   0x0020\n!define TBS_FIXEDLENGTH      0x0040\n!define TBS_NOTHUMB          0x0080\n!define TBS_TOOLTIPS         0x0100 ; IE3\n!define TBS_REVERSED         0x0200 ; IE5\n!define TBS_DOWNISLEFT       0x0400 ; _WIN32_IE >= 0x0501\n!define TBS_NOTIFYBEFOREMOVE 0x0800 ; IE6?\n!define TBS_TRANSPARENTBKGND 0x1000 ; Vista\n\n!define UDS_WRAP        0x0001\n!define UDS_SETBUDDYINT 0x0002\n!define UDS_ALIGNRIGHT  0x0004\n!define UDS_ALIGNLEFT   0x0008\n!define UDS_AUTOBUDDY   0x0010\n!define UDS_ARROWKEYS   0x0020\n!define UDS_HORZ        0x0040\n!define UDS_NOTHOUSANDS 0x0080\n!define UDS_HOTTRACK    0x0100 ; 98+\n\n!define MCS_DAYSTATE        0x0001\n!define MCS_MULTISELECT     0x0002\n!define MCS_WEEKNUMBERS     0x0004\n!define MCS_NOTODAYCIRCLE   0x0008\n!define MCS_NOTODAY         0x0010 ; IE4+?\n!define MCS_NOTRAILINGDATES  0x0040 ; Vista+\n!define MCS_SHORTDAYSOFWEEK  0x0080 ; Vista+\n!define MCS_NOSELCHANGEONNAV 0x0100 ; Vista+\n\n!define DTS_UPDOWN          0x01\n!define DTS_SHOWNONE        0x02\n!define DTS_SHORTDATEFORMAT 0x00\n!define DTS_LONGDATEFORMAT  0x04\n!define DTS_SHORTDATECENTURYFORMAT 0x0C\n!define DTS_TIMEFORMAT      0x09\n!define DTS_APPCANPARSE     0x10\n!define DTS_RIGHTALIGN      0x20\n\n!define /ifndef LR_DEFAULTCOLOR     0x0000\n!define /ifndef LR_MONOCHROME       0x0001\n!define /ifndef LR_COLOR            0x0002\n!define /ifndef LR_COPYRETURNORG    0x0004\n!define /ifndef LR_COPYDELETEORG    0x0008\n!define /ifndef LR_LOADFROMFILE     0x0010\n!define /ifndef LR_LOADTRANSPARENT  0x0020\n!define /ifndef LR_DEFAULTSIZE      0x0040\n!define /ifndef LR_VGACOLOR         0x0080\n!define /ifndef LR_LOADMAP3DCOLORS  0x1000\n!define /ifndef LR_CREATEDIBSECTION 0x2000\n!define /ifndef LR_COPYFROMRESOURCE 0x4000\n!define /ifndef LR_SHARED           0x8000\n\n!define /ifndef IMAGE_BITMAP        0\n!define /ifndef IMAGE_ICON          1\n!define /ifndef IMAGE_CURSOR        2\n!define /ifndef IMAGE_ENHMETAFILE   3\n\n!define /ifndef GWL_STYLE           -16\n!define /ifndef GWL_EXSTYLE         -20\n\n#define /ifndef ICC_LISTVIEW_CLASSES 0x0001 ; SysListView32 and SysHeader32\n#define /ifndef ICC_TREEVIEW_CLASSES 0x0002 ; SysTabControl32 and tooltips_class32\n#define /ifndef ICC_BAR_CLASSES      0x0004 ; ToolbarWindow32, msctls_statusbar32, msctls_trackbar32 and tooltips_class32\n#define /ifndef ICC_TAB_CLASSES      0x0008 ; SysTabControl32 and tooltips_class32\n#define /ifndef ICC_UPDOWN_CLASS     0x0010 ; msctls_updown32\n#define /ifndef ICC_PROGRESS_CLASS   0x0020 ; msctls_progress32\n#define /ifndef ICC_HOTKEY_CLASS     0x0040 ; msctls_hotkey32\n#define /ifndef ICC_ANIMATE_CLASS    0x0080 ; SysAnimate32\n#define /ifndef ICC_WIN95_CLASSES    0x00FF\n!define /ifndef ICC_DATE_CLASSES     0x0100 ; CC4.70+ (NT4+/IE3.1+/Win95 OSR2) SysDateTimePick32, SysMonthCal32 and CC6.10+(Vista+) DropDown\n!define /ifndef ICC_USEREX_CLASSES   0x0200 ; CC4.??+ (NT4+/IE3.?+/Win95 OSR2) ComboBoxEx32\n!define /ifndef ICC_COOL_CLASSES     0x0400 ; CC4.70+ (NT4+/IE3.1+/Win95 OSR2) ReBarWindow32\n!define /ifndef ICC_INTERNET_CLASSES 0x0800 ; CC4.71+ (IE4+) SysIPAddress32\n!define /ifndef ICC_PAGESCROLLER_CLASS 0x1000 ; CC4.71+ (IE4+) SysPager\n!define /ifndef ICC_NATIVEFNTCTL_CLASS 0x2000 ; CC4.71+ (IE4+) NativeFontCtl\n!define /ifndef ICC_STANDARD_CLASSES 0x4000 ; WinXP+ Button, Static, Edit, ListBox, ComboBox, ComboLBox, ScrollBar and ReaderModeCtl\n!define /ifndef ICC_LINK_CLASS       0x8000 ; WinXP+ SysLink\n\n\n!define DEFAULT_STYLES ${WS_CHILD}|${WS_VISIBLE}|${WS_CLIPSIBLINGS}\n\n!define __NSD_HLine_CLASS STATIC\n!define __NSD_HLine_STYLE ${DEFAULT_STYLES}|${SS_ETCHEDHORZ}|${SS_SUNKEN}\n!define __NSD_HLine_EXSTYLE ${WS_EX_TRANSPARENT}\n\n!define __NSD_VLine_CLASS STATIC\n!define __NSD_VLine_STYLE ${DEFAULT_STYLES}|${SS_ETCHEDVERT}|${SS_SUNKEN}\n!define __NSD_VLine_EXSTYLE ${WS_EX_TRANSPARENT}\n\n!define __NSD_Label_CLASS STATIC\n!define __NSD_Label_STYLE ${DEFAULT_STYLES}|${SS_NOTIFY}\n!define __NSD_Label_EXSTYLE ${WS_EX_TRANSPARENT}\n\n!define __NSD_Icon_CLASS STATIC\n!define __NSD_Icon_STYLE ${DEFAULT_STYLES}|${SS_ICON}|${SS_NOTIFY}\n!define __NSD_Icon_EXSTYLE 0\n\n!define __NSD_Bitmap_CLASS STATIC\n!define __NSD_Bitmap_STYLE ${DEFAULT_STYLES}|${SS_BITMAP}|${SS_NOTIFY}\n!define __NSD_Bitmap_EXSTYLE 0\n\n!define __NSD_BrowseButton_CLASS BUTTON\n!define __NSD_BrowseButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}\n!define __NSD_BrowseButton_EXSTYLE 0\n\n!define __NSD_Link_CLASS LINK\n!define __NSD_Link_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_OWNERDRAW}\n!define __NSD_Link_EXSTYLE 0\n\n!define __NSD_Button_CLASS BUTTON\n!define __NSD_Button_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}\n!define __NSD_Button_EXSTYLE 0\n\n!define __NSD_GroupBox_CLASS BUTTON\n!define __NSD_GroupBox_STYLE ${DEFAULT_STYLES}|${BS_GROUPBOX}\n!define __NSD_GroupBox_EXSTYLE ${WS_EX_TRANSPARENT}\n\n!define __NSD_CheckBox_CLASS BUTTON\n!define __NSD_CheckBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTOCHECKBOX}|${BS_MULTILINE}\n!define __NSD_CheckBox_EXSTYLE 0\n\n!define __NSD_RadioButton_CLASS BUTTON\n!define __NSD_RadioButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTORADIOBUTTON}|${BS_MULTILINE}\n!define __NSD_RadioButton_EXSTYLE 0\n\n!define __NSD_FirstRadioButton_CLASS ${__NSD_RadioButton_CLASS}\n!define __NSD_FirstRadioButton_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_GROUP}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTORADIOBUTTON}|${BS_MULTILINE}\n!define __NSD_FirstRadioButton_EXSTYLE ${__NSD_RadioButton_EXSTYLE}\n\n!define __NSD_AdditionalRadioButton_CLASS ${__NSD_RadioButton_CLASS}\n!define __NSD_AdditionalRadioButton_STYLE ${DEFAULT_STYLES}|${BS_TEXT}|${BS_VCENTER}|${BS_AUTORADIOBUTTON}|${BS_MULTILINE}\n!define __NSD_AdditionalRadioButton_EXSTYLE ${__NSD_RadioButton_EXSTYLE}\n\n!define __NSD_Text_CLASS EDIT\n!define __NSD_Text_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}\n!define __NSD_Text_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_MLText_CLASS EDIT\n!define __NSD_MLText_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_AUTOVSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${WS_HSCROLL}|${WS_VSCROLL}\n!define __NSD_MLText_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_Password_CLASS EDIT\n!define __NSD_Password_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_PASSWORD}\n!define __NSD_Password_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_Number_CLASS EDIT\n!define __NSD_Number_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_NUMBER}\n!define __NSD_Number_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_FileRequest_CLASS EDIT\n!define __NSD_FileRequest_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}\n!define __NSD_FileRequest_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_DirRequest_CLASS EDIT\n!define __NSD_DirRequest_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}\n!define __NSD_DirRequest_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_RichEdit_CLASS_10  \"RICHEDIT\"    ; 1.0 (Riched32.dll) Win95/NT4\n!define __NSD_RichEdit_CLASS_20A \"RICHEDIT20A\" ; 2.0 (Riched20.dll) Win98/NT4 (NSIS makes sure this is registered even on Windows 95)\n!define __NSD_RichEdit_CLASS_20W \"RICHEDIT20W\"\n!define __NSD_RichEdit_CLASS_41W \"RICHEDIT50W\" ; 4.1 (MsftEdit.DLL) WinXP.SP1\n!ifdef NSIS_UNICODE\n!define /ifndef __NSD_RichEdit_CLASS ${__NSD_RichEdit_CLASS_20W}\n!else\n!define /ifndef __NSD_RichEdit_CLASS ${__NSD_RichEdit_CLASS_20A}\n!endif\n!define __NSD_RichEdit_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_AUTOVSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}|${ES_SAVESEL}|${WS_HSCROLL}|${WS_VSCROLL}\n!define __NSD_RichEdit_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_ComboBox_CLASS COMBOBOX\n!define __NSD_ComboBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${WS_CLIPCHILDREN}|${CBS_AUTOHSCROLL}|${CBS_HASSTRINGS}|${CBS_DROPDOWN}\n!define __NSD_ComboBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_DropList_CLASS COMBOBOX\n!define __NSD_DropList_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${WS_CLIPCHILDREN}|${CBS_AUTOHSCROLL}|${CBS_HASSTRINGS}|${CBS_DROPDOWNLIST}\n!define __NSD_DropList_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_ListBox_CLASS LISTBOX\n!define __NSD_ListBox_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${WS_VSCROLL}|${LBS_DISABLENOSCROLL}|${LBS_HASSTRINGS}|${LBS_NOINTEGRALHEIGHT}|${LBS_NOTIFY}\n!define __NSD_ListBox_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_SortedListBox_CLASS LISTBOX\n!define __NSD_SortedListBox_STYLE ${__NSD_ListBox_STYLE}|${LBS_SORT}\n!define __NSD_SortedListBox_EXSTYLE ${__NSD_ListBox_EXSTYLE}\n\n!define __NSD_ProgressBar_CLASS msctls_progress32\n!define __NSD_ProgressBar_STYLE ${DEFAULT_STYLES}\n!define __NSD_ProgressBar_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_Animation_CLASS SysAnimate32\n!define __NSD_Animation_STYLE ${DEFAULT_STYLES}|${ACS_TRANSPARENT}|${ACS_AUTOPLAY}\n!define __NSD_Animation_EXSTYLE 0\n\n!define __NSD_HTrackBar_CLASS msctls_trackbar32\n!define __NSD_HTrackBar_STYLE ${DEFAULT_STYLES}|${TBS_HORZ}|${TBS_AUTOTICKS}|${TBS_TOOLTIPS}\n!define __NSD_HTrackBar_EXSTYLE 0\n\n!define __NSD_VTrackBar_CLASS msctls_trackbar32\n!define __NSD_VTrackBar_STYLE ${DEFAULT_STYLES}|${TBS_VERT}|${TBS_AUTOTICKS}|${TBS_TOOLTIPS}\n!define __NSD_VTrackBar_EXSTYLE 0\n\n!define __NSD_UpDown_CLASS msctls_updown32\n!define __NSD_UpDown_STYLE ${DEFAULT_STYLES}|${UDS_SETBUDDYINT}|${UDS_ARROWKEYS}|${UDS_NOTHOUSANDS}|${UDS_ALIGNRIGHT}\n!define __NSD_UpDown_EXSTYLE 0\n\n!define __NSD_AutoUpDown_CLASS msctls_updown32\n!define __NSD_AutoUpDown_STYLE ${__NSD_UpDown_STYLE}|${UDS_AUTOBUDDY}\n!define __NSD_AutoUpDown_EXSTYLE ${__NSD_UpDown_EXSTYLE}\n\n!define __NSD_HotKey_CLASS msctls_hotkey32\n!define __NSD_HotKey_STYLE ${DEFAULT_STYLES}\n!define __NSD_HotKey_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_Calendar_CLASS SysMonthCal32\n!define __NSD_Calendar_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}\n!define __NSD_Calendar_EXSTYLE 0\n\n!define __NSD_DatePicker_CLASS SysDateTimePick32\n!define __NSD_DatePicker_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}\n!define __NSD_DatePicker_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_TimePicker_CLASS SysDateTimePick32\n!define __NSD_TimePicker_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}|${DTS_TIMEFORMAT}\n!define __NSD_TimePicker_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n!define __NSD_IPAddress_CLASS SysIPAddress32 ; IE4+/CC4.71+\n!define __NSD_IPAddress_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}\n!define __NSD_IPAddress_EXSTYLE 0\n\n!define __NSD_NetAddress_CLASS msctls_netaddress ; Vista+\n!define __NSD_NetAddress_STYLE ${DEFAULT_STYLES}|${WS_TABSTOP}\n!define __NSD_NetAddress_EXSTYLE ${WS_EX_WINDOWEDGE}|${WS_EX_CLIENTEDGE}\n\n\n!macro __NSD_DefineControl NAME\n\t!define NSD_Create${NAME} \"nsDialogs::CreateControl ${__NSD_${Name}_CLASS} ${__NSD_${Name}_STYLE} ${__NSD_${Name}_EXSTYLE}\"\n!macroend\n!insertmacro __NSD_DefineControl HLine\n!insertmacro __NSD_DefineControl VLine\n!insertmacro __NSD_DefineControl Label\n!insertmacro __NSD_DefineControl Icon\n!insertmacro __NSD_DefineControl Bitmap\n!insertmacro __NSD_DefineControl BrowseButton\n!insertmacro __NSD_DefineControl Link\n!insertmacro __NSD_DefineControl Button\n!insertmacro __NSD_DefineControl GroupBox\n!insertmacro __NSD_DefineControl CheckBox\n!insertmacro __NSD_DefineControl RadioButton\n!insertmacro __NSD_DefineControl FirstRadioButton\n!insertmacro __NSD_DefineControl AdditionalRadioButton\n!insertmacro __NSD_DefineControl Text\n!insertmacro __NSD_DefineControl MLText\n!insertmacro __NSD_DefineControl Password\n!insertmacro __NSD_DefineControl Number\n!insertmacro __NSD_DefineControl FileRequest\n!insertmacro __NSD_DefineControl DirRequest\n!insertmacro __NSD_DefineControl RichEdit\n!insertmacro __NSD_DefineControl ComboBox\n!insertmacro __NSD_DefineControl DropList\n!insertmacro __NSD_DefineControl ListBox\n!insertmacro __NSD_DefineControl SortedListBox\n!insertmacro __NSD_DefineControl ProgressBar\n!insertmacro __NSD_DefineControl Animation\n!insertmacro __NSD_DefineControl HTrackBar\n!insertmacro __NSD_DefineControl VTrackBar\n!insertmacro __NSD_DefineControl UpDown\n!insertmacro __NSD_DefineControl AutoUpDown\n!insertmacro __NSD_DefineControl HotKey\n!insertmacro __NSD_DefineControl Calendar\n!insertmacro __NSD_DefineControl DatePicker\n!insertmacro __NSD_DefineControl TimePicker\n!insertmacro __NSD_DefineControl IPAddress\n!insertmacro __NSD_DefineControl NetAddress\n\n\n!macro __NSD_OnControlEvent EVENT HWND FUNCTION\n\tPush $0\n\tPush $1\n\n\tStrCpy $1 \"${HWND}\"\n\n\tGetFunctionAddress $0 \"${FUNCTION}\"\n\tnsDialogs::On${EVENT} $1 $0\n\n\tPop $1\n\tPop $0\n!macroend\n\n!macro __NSD_DefineControlCallback EVENT\n\t!define NSD_On${EVENT} `!insertmacro __NSD_OnControlEvent ${EVENT} `\n!macroend\n\n!macro __NSD_OnDialogEvent EVENT FUNCTION\n\tPush $0\n\n\tGetFunctionAddress $0 \"${FUNCTION}\"\n\tnsDialogs::On${EVENT} $0\n\n\tPop $0\n!macroend\n\n!macro __NSD_DefineDialogCallback EVENT\n\t!define NSD_On${EVENT} `!insertmacro __NSD_OnDialogEvent ${EVENT} `\n!macroend\n!insertmacro __NSD_DefineControlCallback Click\n!insertmacro __NSD_DefineControlCallback Change\n!insertmacro __NSD_DefineControlCallback Notify\n!insertmacro __NSD_DefineDialogCallback Back\n\n!define NSD_Return \"!insertmacro NSD_Return \"\n!macro NSD_Return val\nStrCpy $_OUTDIR ${val}\nSetSilent silent\nReturn\n!macroend\n\n\n!define __NSD_MkCtlCmd \"!insertmacro __NSD_MkCtlCmd \"\n!macro __NSD_MkCtlCmd msg wp lp hCtl\nSendMessage ${hCtl} ${${msg}} ${wp} ${lp}\n!macroend\n!define __NSD_MkCtlCmd_WP \"!insertmacro __NSD_MkCtlCmd_WP \"\n!macro __NSD_MkCtlCmd_WP msg lp hCtl wp\nSendMessage ${hCtl} ${${msg}} ${wp} ${lp}\n!macroend\n!define __NSD_MkCtlCmd_LP \"!insertmacro __NSD_MkCtlCmd_LP \"\n!macro __NSD_MkCtlCmd_LP msg wp hCtl lp\nSendMessage ${hCtl} ${${msg}} ${wp} ${lp}\n!macroend\n!define __NSD_MkCtlCmd_WPLP \"!insertmacro __NSD_MkCtlCmd_WPLP \"\n!macro __NSD_MkCtlCmd_WPLP msg hCtl wp lp\nSendMessage ${hCtl} ${${msg}} ${wp} ${lp}\n!macroend\n!define __NSD_MkCtlCmd_RV \"!insertmacro __NSD_MkCtlCmd_RV \"\n!macro __NSD_MkCtlCmd_RV msg wp lp hCtl VAR\nSendMessage ${hCtl} ${${msg}} ${wp} ${lp} ${VAR}\n!macroend\n\n\n!define NSD_InitCommonControlsEx \"!insertmacro __NSD_InitCommonControlsEx \"\n!macro __NSD_InitCommonControlsEx ICC\n!pragma warning push\n!pragma warning disable 7070 ; Invalid number\n!if ${ICC} <> 0\n!define /ReDef /IntFmt NSD_InitCommonControlsEx_TEMP \"0x%X\" ${ICC}\nSystem::Call 'COMCTL32::InitCommonControlsEx(*l${NSD_InitCommonControlsEx_TEMP}00000008)'\n!undef NSD_InitCommonControlsEx_TEMP\n!else\nSystem::Int64Op ${ICC} << 32\nSystem::Int64Op 8 | \nSystem::Call 'COMCTL32::InitCommonControlsEx(*ls)' ; INITCOMMONCONTROLSEX as UINT64\n!endif\n!pragma warning pop\n!macroend\n!define NSD_InitCommonControl_IPAddress `${NSD_InitCommonControlsEx} ${ICC_INTERNET_CLASSES}`\n!define NSD_InitCommonControl_NetAddress `System::Call SHELL32::InitNetworkAddressControl()i`\n!define NSD_InitCommonControl_SysLink `${NSD_InitCommonControlsEx} ${ICC_LINK_CLASS}`\n\n\n!define NSD_CreateTimer `!insertmacro _NSD_CreateTimer `\n!macro _NSD_CreateTimer FUNCTION INTERVAL\n\tPush $0\n\n\tGetFunctionAddress $0 \"${FUNCTION}\"\n\tnsDialogs::CreateTimer $0 \"${INTERVAL}\"\n\n\tPop $0\n!macroend\n\n\n!define NSD_KillTimer `!insertmacro _NSD_KillTimer `\n!macro _NSD_KillTimer FUNCTION\n\tPush $0\n\n\tGetFunctionAddress $0 \"${FUNCTION}\"\n\tnsDialogs::KillTimer $0\n\n\tPop $0\n!macroend\n\n\n!define NSD_AddStyle \"!insertmacro _NSD_GWLAddFlags ${GWL_STYLE} \"\n!define NSD_AddExStyle \"!insertmacro _NSD_GWLAddFlags ${GWL_EXSTYLE} \"\n!macro _NSD_GWLAddFlags GWL HWND DATA\n\tSystem::Call \"user32::GetWindowLong(p${HWND},i${GWL})p.s\"\n\tSystem::Int64Op \"${DATA}\" |\n\tSystem::Call \"user32::SetWindowLong(p${HWND},p${GWL},ps)\"\n!macroend\n\n!define NSD_RemoveStyle \"!insertmacro _NSD_GWLRemoveFlags ${GWL_STYLE} \" \n!define NSD_RemoveExStyle \"!insertmacro _NSD_GWLRemoveFlags ${GWL_EXSTYLE} \"\n!macro _NSD_GWLRemoveFlags GWL HWND DATA\nSystem::Call \"user32::GetWindowLong(p${HWND},i${GWL})p.s\"\nSystem::Int64Op \"${DATA}\" ~ & ; Perform ~ and prepare the stack for &\nSystem::Int64Op ; Perform &\nSystem::Call \"user32::SetWindowLong(p${HWND},i${GWL},ps)\"\n!macroend \n\n!define NSD_GetStyle \"!insertmacro _NSD_GWLGetFlags ${GWL_STYLE} \"\n!define NSD_GetExStyle \"!insertmacro _NSD_GWLGetFlags ${GWL_EXSTYLE} \"\n!macro _NSD_GWLGetFlags GWL HWND RET\nSystem::Call \"user32::GetWindowLong(p${HWND},i${GWL})p.s\"\nPop ${RET}\n!macroend\n\n!macro __NSD_GetStyleBit GWL BIT HWND RET\n!insertmacro _NSD_GWLGetFlags ${GWL} ${HWND} ${RET}\nIntOp ${RET} ${RET} & ${BIT}\n!macroend\n\n\n!define NSD_SetFocus `!insertmacro __NSD_SetFocus `\n!macro __NSD_SetFocus HWND\n\tSystem::Call \"user32::SetFocus(p${HWND})\"\n!macroend\n\n\n!define NSD_GetText \"!insertmacro __NSD_GetText \"\n!macro __NSD_GetText CONTROL VAR\n\tSystem::Call user32::GetWindowText(p${CONTROL},t.s,i${NSIS_MAX_STRLEN})\n\tPop ${VAR}\n!macroend\n\n\n!define NSD_SetText \"!insertmacro __NSD_SetText \"\n!macro __NSD_SetText CONTROL TEXT\n\tSendMessage ${CONTROL} ${WM_SETTEXT} 0 `STR:${TEXT}`\n!macroend\n\n\n### Edit ###\n\n!define NSD_Edit_GetTextLimit `${__NSD_MkCtlCmd_RV} EM_GETLIMITTEXT 0 0 `\n!define NSD_Edit_SetTextLimit `${__NSD_MkCtlCmd_WP} EM_SETLIMITTEXT 0 `\n!define NSD_Edit_SetPasswordChar `${__NSD_MkCtlCmd_WP} EM_SETPASSWORDCHAR 0 `\n!define NSD_Edit_GetReadOnly `!insertmacro __NSD_GetStyleBit ${GWL_STYLE} ${ES_READONLY} ` ; Non-zero if read-only\n!define NSD_Edit_SetReadOnly `${__NSD_MkCtlCmd_WP} EM_SETREADONLY 0 ` ; Toggles the ES_READONLY style\n!define NSD_Edit_GetModify `${__NSD_MkCtlCmd_RV} EM_GETMODIFY 0 0 `\n!define NSD_Edit_SetModify `${__NSD_MkCtlCmd_WP} EM_SETMODIFY 0 `\n!define NSD_Edit_EmptyUndoBuffer `${__NSD_MkCtlCmd} EM_EMPTYUNDOBUFFER 0 0 `\n!define NSD_Edit_CanUndo `${__NSD_MkCtlCmd_RV} EM_CANUNDO 0 0 `\n!define NSD_Edit_ScrollCaret `${__NSD_MkCtlCmd} EM_SCROLLCARET 0 0 `\n!define NSD_Edit_LineScroll `${__NSD_MkCtlCmd_WPLP} EM_LINESCROLL `\n!define NSD_Edit_SetSel `${__NSD_MkCtlCmd_WPLP} EM_SETSEL ` ; WP:Start LP:End\n\n!define NSD_Edit_SetCueBannerText \"!insertmacro __NSD_Edit_SetCueBannerText \" ; CC6+\n!macro __NSD_Edit_SetCueBannerText CONTROL SHOWWHENFOCUSED TEXT\n!if ${NSIS_CHAR_SIZE} > 1\n\tSendMessage ${CONTROL} ${EM_SETCUEBANNER} ${SHOWWHENFOCUSED} `STR:${TEXT}`\n!else\n\tSystem::Call 'USER32::SendMessage(p${CONTROL},i${EM_SETCUEBANNER},p${SHOWWHENFOCUSED},ws)' `${TEXT}` ; Must be PWSTR\n!endif\n!macroend\n\n!define NSD_Edit_GetLineCount `${__NSD_MkCtlCmd_RV} EM_GETLINECOUNT 0 0 `\n!define NSD_Edit_GetLine \"!insertmacro __NSD_Edit_GetLine \"\n!macro __NSD_Edit_GetLine CONTROL LINEINDEX OUTPUT\n\tSystem::Call '*(&i2 ${NSIS_MAX_STRLEN},&t${NSIS_MAX_STRLEN})p.s'\n\tSystem::Call 'USER32::SendMessage(p${CONTROL},i${EM_GETLINE},p${LINEINDEX},pss)'\n\tSystem::Call 'KERNEL32::lstrcpyn(t.s,pss,i${NSIS_MAX_STRLEN})'\n\tPop ${OUTPUT}\n\tSystem::Free\n!macroend\n\n!define NSD_SetTextLimit `${NSD_Edit_SetTextLimit} ` ; Legacy alias\n\n\n### RichEdit ###\n\n!define NSD_RichEd_SetTextLimit `${__NSD_MkCtlCmd_LP} EM_EXLIMITTEXT 0 `\n!define NSD_RichEd_GetEventMask `${__NSD_MkCtlCmd_RV} EM_GETEVENTMASK 0 0 `\n!define NSD_RichEd_SetEventMask `${__NSD_MkCtlCmd_LP} EM_SETEVENTMASK 0 ` ; LP:ENM_*\n!define NSD_RichEd_SetSystemBackgroundColor `${__NSD_MkCtlCmd} EM_SETBKGNDCOLOR 1 0 ` ; COLOR_WINDOW\n!define NSD_RichEd_SetCustomBackgroundColor `${__NSD_MkCtlCmd_LP} EM_SETBKGNDCOLOR 0 ` ; LP:COLORREF\n!define NSD_RichEd_SetHideSelection `${__NSD_MkCtlCmd_WP} EM_HIDESELECTION 0 ` ; WP(BOOL):HideSelWithoutFocus (Toggles ES_NOHIDESEL & TXTBIT_HIDESELECTION)\n\n\n### CheckBox ###\n\n!define NSD_GetState `!insertmacro __NSD_GetState `\n!macro __NSD_GetState CONTROL VAR\n\tSendMessage ${CONTROL} ${BM_GETCHECK} 0 0 ${VAR}\n!macroend\n\n\n!define NSD_SetState `!insertmacro __NSD_SetState `\n!macro __NSD_SetState CONTROL STATE\n\tSendMessage ${CONTROL} ${BM_SETCHECK} ${STATE} 0\n!macroend\n\n!define NSD_Check `!insertmacro __NSD_Check `\n!macro __NSD_Check CONTROL\n\t${NSD_SetState} ${CONTROL} ${BST_CHECKED}\n!macroend\n\n\n!define NSD_Uncheck `!insertmacro __NSD_Uncheck `\n!macro __NSD_Uncheck CONTROL\n\t${NSD_SetState} ${CONTROL} ${BST_UNCHECKED}\n!macroend\n\n!define NSD_GetChecked `!insertmacro __NSD_GetState `\n!define NSD_SetChecked `!insertmacro __NSD_SetState `\n\n\n### ComboBox ###\n\n!define NSD_CB_AddString \"!insertmacro _NSD_CB_AddString \"\n!macro _NSD_CB_AddString CONTROL STRING\n\tSendMessage ${CONTROL} ${CB_ADDSTRING} 0 `STR:${STRING}`\n!macroend\n\n\n!define NSD_CB_InsertString \"!insertmacro _NSD_CB_InsertString \"\n!macro _NSD_CB_InsertString CONTROL INDEX STRING\nSendMessage ${CONTROL} ${CB_INSERTSTRING} ${INDEX} `STR:${STRING}`\n!macroend\n\n!define NSD_CB_PrependString \"!insertmacro _NSD_CB_PrependString \"\n!macro _NSD_CB_PrependString CONTROL STRING\nSendMessage ${CONTROL} ${CB_INSERTSTRING} 0 `STR:${STRING}`\n!macroend\n\n!define NSD_CB_AppendString \"!insertmacro _NSD_CB_AppendString \"\n!macro _NSD_CB_AppendString CONTROL STRING\nSendMessage ${CONTROL} ${CB_INSERTSTRING} -1 `STR:${STRING}`\n!macroend\n\n\n!define NSD_CB_SelectString \"!insertmacro _NSD_CB_SelectString \"\n!macro _NSD_CB_SelectString CONTROL STRING\n\tSendMessage ${CONTROL} ${CB_SELECTSTRING} -1 `STR:${STRING}`\n!macroend\n\n\n!define NSD_CB_GetSelectionIndex `!insertmacro __NSD_CB_GetSelectionIndex `\n!macro __NSD_CB_GetSelectionIndex CONTROL VAR\n\tSendMessage ${CONTROL} ${CB_GETCURSEL} 0 0 ${VAR}\n!macroend\n\n\n!define NSD_CB_SetSelectionIndex `!insertmacro __NSD_CB_SetSelectionIndex `\n!macro __NSD_CB_SetSelectionIndex CONTROL INDEX\n\tSendMessage ${CONTROL} ${CB_SETCURSEL} ${INDEX} 0\n!macroend\n\n\n!define NSD_CB_GetItemData `!insertmacro __NSD_CB_GetItemData `\n!macro __NSD_CB_GetItemData CONTROL INDEX VAR\nSendMessage ${CONTROL} ${CB_GETITEMDATA} ${INDEX} 0 ${VAR}\n!macroend\n!define NSD_CB_SetItemData `${__NSD_MkCtlCmd_WPLP} CB_SETITEMDATA ` ; Index Data\n\n\n!define NSD_CB_DelItem `${__NSD_MkCtlCmd_WP} CB_DELETESTRING 0 `\n!define NSD_CB_LimitText `${__NSD_MkCtlCmd_WP} CB_LIMITTEXT 0 `\n!define /IfNDef NSD_CB_Clear `${__NSD_MkCtlCmd} CB_RESETCONTENT 0 0 `\n!define /IfNDef NSD_CB_GetCount `${__NSD_MkCtlCmd_RV} CB_GETCOUNT 0 0 `\n!ifndef NSD_CB_DelString\n!define NSD_CB_DelString `!insertmacro __NSD_CB_DelString `\n!macro __NSD_CB_DelString CONTROL STRING\n\tSystem::Call 'USER32::SendMessage(p${CONTROL},i${CB_FINDSTRINGEXACT},p-1,ts)p.s' `${STRING}`\n\tSystem::Call 'USER32::SendMessage(p${CONTROL},i${CB_DELETESTRING},ps,p0)'\n!macroend\n!endif\n;define /IfNDef NSD_CB_GetSelection\n\n\n### ListBox ###\n\n!define NSD_LB_AddString \"!insertmacro _NSD_LB_AddString \"\n!macro _NSD_LB_AddString CONTROL STRING\n\tSendMessage ${CONTROL} ${LB_ADDSTRING} 0 `STR:${STRING}`\n!macroend\n\n\n!define NSD_LB_InsertString \"!insertmacro _NSD_LB_InsertString \"\n!macro _NSD_LB_InsertString CONTROL INDEX STRING\nSendMessage ${CONTROL} ${LB_INSERTSTRING} ${INDEX} `STR:${STRING}`\n!macroend\n\n!define NSD_LB_PrependString \"!insertmacro _NSD_LB_PrependString \"\n!macro _NSD_LB_PrependString CONTROL STRING\nSendMessage ${CONTROL} ${LB_INSERTSTRING} 0 `STR:${STRING}`\n!macroend\n\n!define NSD_LB_AppendString \"!insertmacro _NSD_LB_AppendString \"\n!macro _NSD_LB_AppendString CONTROL STRING\nSendMessage ${CONTROL} ${LB_INSERTSTRING} -1 `STR:${STRING}`\n!macroend\n\n\n!define NSD_LB_DelString `!insertmacro __NSD_LB_DelString `\n!macro __NSD_LB_DelString CONTROL STRING\n\tSystem::Call 'USER32::SendMessage(p${CONTROL},i${LB_FINDSTRINGEXACT},p-1,ts)p.s' `${STRING}`\n\tSystem::Call 'USER32::SendMessage(p${CONTROL},i${LB_DELETESTRING},ps,p0)'\n!macroend\n\n\n!define NSD_LB_DelItem \"!insertmacro __NSD_LB_DelItem \"\n!macro __NSD_LB_DelItem CONTROL INDEX\n\tSendMessage ${CONTROL} ${LB_DELETESTRING} ${INDEX} 0\n!macroend\n\n\n!define NSD_LB_Clear `${__NSD_MkCtlCmd} LB_RESETCONTENT 0 0 `\n\n\n!define NSD_LB_GetCount `!insertmacro __NSD_LB_GetCount `\n!macro __NSD_LB_GetCount CONTROL VAR\n\tSendMessage ${CONTROL} ${LB_GETCOUNT} 0 0 ${VAR}\n!macroend\n\n\n!define NSD_LB_SelectString \"!insertmacro _NSD_LB_SelectString \"\n!macro _NSD_LB_SelectString CONTROL STRING\n\tSendMessage ${CONTROL} ${LB_SELECTSTRING} -1 `STR:${STRING}`\n!macroend\n\n\n!define NSD_LB_GetSelection `!insertmacro __NSD_LB_GetSelection `\n!macro __NSD_LB_GetSelection CONTROL VAR\n\tSendMessage ${CONTROL} ${LB_GETCURSEL} 0 0 ${VAR}\n\tSystem::Call 'user32::SendMessage(p ${CONTROL}, i ${LB_GETTEXT}, p ${VAR}, t .s)'\n\tPop ${VAR}\n!macroend\n\n\n!define NSD_LB_GetSelectionIndex `!insertmacro __NSD_LB_GetSelectionIndex `\n!macro __NSD_LB_GetSelectionIndex CONTROL VAR\n\tSendMessage ${CONTROL} ${LB_GETCURSEL} 0 0 ${VAR}\n!macroend\n\n\n!define NSD_LB_SetSelectionIndex `!insertmacro __NSD_LB_SetSelectionIndex `\n!macro __NSD_LB_SetSelectionIndex CONTROL INDEX\n\tSendMessage ${CONTROL} ${LB_SETCURSEL} ${INDEX} 0\n!macroend\n\n\n!define NSD_LB_GetSelectionCount `!insertmacro __NSD_LB_GetSelectionCount `\n!macro __NSD_LB_GetSelectionCount CONTROL VAR\n\tSendMessage ${CONTROL} ${LB_GETSELCOUNT} 0 0 ${VAR}\n!macroend\n\n\n!define NSD_LB_GetItemText `!insertmacro __NSD_LB_GetItemText `\n!macro __NSD_LB_GetItemText CONTROL INDEX VAR\n\tSystem::Call 'user32::SendMessage(p${CONTROL}, i${LB_GETTEXT}, p${INDEX}, t.s)'\n\tPop ${VAR}\n!macroend\n\n\n!define NSD_LB_GetItemData `!insertmacro __NSD_LB_GetItemData `\n!macro __NSD_LB_GetItemData CONTROL INDEX VAR\nSendMessage ${CONTROL} ${LB_GETITEMDATA} ${INDEX} 0 ${VAR}\n!macroend\n!define NSD_LB_SetItemData `${__NSD_MkCtlCmd_WPLP} LB_SETITEMDATA ` ; Index Data\n\n\n!define NSD_LB_FindStringPrefix `!insertmacro __NSD_LB_FindStringPrefix `\n!macro __NSD_LB_FindStringPrefix CONTROL STRING VAR\n\tSendMessage ${CONTROL} ${LB_FINDSTRING} -1 `STR:${STRING}` ${VAR}\n!macroend\n\n\n!define NSD_LB_FindStringExact `!insertmacro __NSD_LB_FindStringExact `\n!macro __NSD_LB_FindStringExact CONTROL STRING VAR\n\tSendMessage ${CONTROL} ${LB_FINDSTRINGEXACT} -1 `STR:${STRING}` ${VAR}\n!macroend\n\n\n### ProgressBar ###\n\n!define NSD_ProgressBar_SetPos `${__NSD_MkCtlCmd_WP} PBM_SETPOS 0 `\n!define NSD_ProgressBar_SetStep `${__NSD_MkCtlCmd_WP} PBM_SETSTEP 0 `\n!define NSD_ProgressBar_StepIt `${__NSD_MkCtlCmd} PBM_STEPIT 0 0 `\n!define NSD_ProgressBar_AdvanceBy `${__NSD_MkCtlCmd_WP} PBM_DELTAPOS 0 `\n!define NSD_ProgressBar_SetPackedRange `${__NSD_MkCtlCmd_LP} PBM_SETRANGE 0 ` ; LP(DWORD):MAKELONG(min,max)\n!define NSD_ProgressBar_SetRange32 `${__NSD_MkCtlCmd_WPLP} PBM_SETRANGE32 ` ; [IE3+] WP:min LP:max\n!define NSD_ProgressBar_GetPos `${__NSD_MkCtlCmd_RV} PBM_GETPOS 0 0 ` ; [IE3+]\n\n\n### Animation ###\n\n!define NSD_Anim_Close `${__NSD_MkCtlCmd} ACM_OPEN 0 0 `\n!define NSD_Anim_Play `${__NSD_MkCtlCmd} ACM_PLAY -1 0xFFFF0000 `\n!define NSD_Anim_PlayLoops `${__NSD_MkCtlCmd_WP} ACM_PLAY 0xFFFF0000 ` ; WP(UINT16):LoopCount\n!define NSD_Anim_Stop `${__NSD_MkCtlCmd} ACM_STOP 0 0 `\n!define NSD_Anim_IsPlaying `${__NSD_MkCtlCmd_RV} ACM_ISPLAYING 0 0 `\n\n!define NSD_Anim_OpenFile `!insertmacro __NSD_Anim_OpenFile `\n!macro __NSD_Anim_OpenFile CONTROL PATH\n\tSendMessage ${CONTROL} ${ACM_OPEN} 0 \"STR:${PATH}\"\n!macroend\n\n!define NSD_Anim_OpenResource `!insertmacro __NSD_Anim_OpenResource `\n!macro __NSD_Anim_OpenResource CONTROL HINSTANCE_CC471 RESID\n\tSendMessage ${CONTROL} ${ACM_OPEN} \"${HINSTANCE_CC471}\" \"${RESID}\"\n!macroend\n\n\n### TrackBar ###\n\n!define NSD_TrackBar_GetPos `${__NSD_MkCtlCmd_RV} TBM_GETPOS 0 0 `\n!define NSD_TrackBar_SetPos `${__NSD_MkCtlCmd_LP} TBM_SETPOS 1 `\n!define NSD_TrackBar_SetRangeMin `${__NSD_MkCtlCmd_LP} TBM_SETRANGEMIN 1 `\n!define NSD_TrackBar_SetRangeMax `${__NSD_MkCtlCmd_LP} TBM_SETRANGEMAX 1 `\n!define NSD_TrackBar_GetLineSize `${__NSD_MkCtlCmd_RV} TBM_GETLINESIZE 0 0 `\n!define NSD_TrackBar_SetLineSize `${__NSD_MkCtlCmd_LP} TBM_SETLINESIZE 0 `\n!define NSD_TrackBar_GetPageSize `${__NSD_MkCtlCmd_RV} TBM_GETPAGESIZE 0 0 `\n!define NSD_TrackBar_SetPageSize `${__NSD_MkCtlCmd_LP} TBM_SETPAGESIZE 0 `\n!define NSD_TrackBar_ClearTics `${__NSD_MkCtlCmd} TBM_CLEARTICS 0 0 `\n!define NSD_TrackBar_GetNumTics `${__NSD_MkCtlCmd_RV} TBM_GETNUMTICS 0 0 `\n!define NSD_TrackBar_SetTic `${__NSD_MkCtlCmd_LP} TBM_SETTIC 0 `\n!define NSD_TrackBar_SetTicFreq `${__NSD_MkCtlCmd_WP} TBM_SETTICFREQ 0 `\n!define NSD_TrackBar_GetThumbLength `${__NSD_MkCtlCmd_RV} TBM_GETTHUMBLENGTH 0 0 `\n!define NSD_TrackBar_SetBuddy `${__NSD_MkCtlCmd_WPLP} TBM_SETBUDDY ` ; WP(BOOL):Left/Right LP:HWND\n\n\n### UpDown ###\n\n!define NSD_UD_SetBuddy `${__NSD_MkCtlCmd_WP} UDM_SETBUDDY 0 `\n!define NSD_UD_GetPos `${__NSD_MkCtlCmd_RV} UDM_GETPOS 0 0 `\n!define NSD_UD_SetPos `${__NSD_MkCtlCmd_LP} UDM_SETPOS 0 `\n!define NSD_UD_GetPackedRange `${__NSD_MkCtlCmd_RV} UDM_GETRANGE 0 0 `\n!define NSD_UD_SetPackedRange `${__NSD_MkCtlCmd_LP} UDM_SETRANGE 0 ` ; LP(DWORD):MAKELONG(min,max)\n!define NSD_UD_GetPos32 `${__NSD_MkCtlCmd_RV} UDM_GETPOS32 0 0 `\n!define NSD_UD_SetPos32 `${__NSD_MkCtlCmd_LP} UDM_SETPOS32 0 `\n!define NSD_UD_SetRange32 `${__NSD_MkCtlCmd_WPLP} UDM_SETRANGE32 ` ; WP(INT32):min LP(INT32):max\n\n!define NSD_UD_GetRange32 `!insertmacro __NSD_UD_GetRange32 `\n!macro __NSD_UD_GetRange32 CONTROL OUTLO OUTHI\n\tSystem::Call 'USER32::SendMessage(p${CONTROL},i${UDM_GETRANGE32},*i.s,*i.s)'\n\tPop ${OUTLO}\n\tPop ${OUTHI}\n!macroend\n\n!define NSD_UD_SetStaticRange `!insertmacro __NSD_UD_SetStaticRange `\n!macro __NSD_UD_SetStaticRange CONTROL MI MA\n\t!define /redef /math MI ${MI} << 16\n\t!define /redef /math MA ${MA} & 0xffff\n\t!define /redef /math MA ${MI} | ${MA}\n\tSendMessage ${CONTROL} ${UDM_SETRANGE} 0 ${MA}\n!macroend\n\n\n### HotKey ###\n\n!define NSD_HK_GetHotKey `${__NSD_MkCtlCmd_RV} HKM_GETHOTKEY 0 0 ` ; RV(WORD):MAKEWORD(VK,HOTKEYF)\n!define NSD_HK_SetHotKey `${__NSD_MkCtlCmd_WP} HKM_SETHOTKEY 0 `\n!define NSD_HK_SetRules `${__NSD_MkCtlCmd_WPLP} HKM_SETRULES `\n\n\n### IP Address ###\n\n!define NSD_IPAddress_Clear `${__NSD_MkCtlCmd} IPM_CLEARADDRESS 0 0 `\n!define NSD_IPAddress_SetPackedIPv4 `${__NSD_MkCtlCmd_LP} IPM_SETADDRESS 0 `\n!define NSD_IPAddress_IsBlank `${__NSD_MkCtlCmd_RV} IPM_ISBLANK 0 0 `\n\n!define NSD_IPAddress_GetPackedIPv4 `!insertmacro __NSD_IPAddress_GetPackedIPv4 `\n!macro __NSD_IPAddress_GetPackedIPv4 CONTROL VAR\nSystem::Call 'USER32::SendMessage(p${CONTROL},i${IPM_GETADDRESS},p0,*i0s)'\nPop ${VAR}\n!macroend\n\n\n### Date ###\n!define NSD_Date_GetDateFields `!insertmacro __NSD_Date_GetDateFields `\n!macro __NSD_Date_GetDateFields CONTROL\nPush $0\nSystem::Call 'USER32::SendMessage(p${CONTROL},i${DTM_GETSYSTEMTIME},p0,@r0)'\nSystem::Call '*$0(&i2.s,&i2.s,&i2,&i2.s)'\nExch 3\nPop $0\n!macroend\n\n!define NSD_Time_GetTimeFields `!insertmacro __NSD_Time_GetTimeFields `\n!macro __NSD_Time_GetTimeFields CONTROL\nPush $0\nSystem::Call 'USER32::SendMessage(p${CONTROL},i${DTM_GETSYSTEMTIME},p0,@r0)'\nSystem::Call '*$0(&i2,&i2,&i2,&i2,&i2.s,&i2.s,&i2.s)'\nExch 3\nPop $0\nExch\n!macroend\n\n\n### Static ###\n\n!macro __NSD_LoadAndSetImage _LIHINSTMODE _IMGTYPE _LIHINSTSRC _LIFLAGS CONTROL IMAGE HANDLE\n\t!if \"${_LIHINSTMODE}\" == \"exeresource\"\n\t\tLoadAndSetImage /EXERESOURCE /STRINGID \"${CONTROL}\" ${_IMGTYPE} ${_LIFLAGS} \"${IMAGE}\" ${HANDLE}\n\t!else #if \"${_LIHINSTMODE}\" == \"file\"\n\t\tLoadAndSetImage /STRINGID \"${CONTROL}\" ${_IMGTYPE} ${_LIFLAGS} \"${IMAGE}\" ${HANDLE}\n\t!endif\n!macroend\n\n!macro __NSD_SetIconFromExeResource CONTROL IMAGE HANDLE\n\tLoadAndSetImage /EXERESOURCE /STRINGID \"${CONTROL}\" ${IMAGE_ICON} ${LR_DEFAULTSIZE} \"${IMAGE}\" ${HANDLE}\n!macroend\n\n!macro __NSD_SetIconFromInstaller CONTROL HANDLE\n\tLoadAndSetImage /EXERESOURCE \"${CONTROL}\" ${IMAGE_ICON} ${LR_DEFAULTSIZE} 103 ${HANDLE}\n!macroend\n\n!define NSD_SetImage `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_BITMAP} 0 \"${LR_LOADFROMFILE}\" `\n!define NSD_SetBitmap `${NSD_SetImage} `\n\n!define NSD_SetIcon `!insertmacro __NSD_LoadAndSetImage file ${IMAGE_ICON} 0 \"${LR_LOADFROMFILE}|${LR_DEFAULTSIZE}\" `\n!define NSD_SetIconFromExeResource `!insertmacro __NSD_SetIconFromExeResource `\n!define NSD_SetIconFromInstaller `!insertmacro __NSD_SetIconFromInstaller `\n\n\n!define NSD_SetStretchedImage `!insertmacro __NSD_SetStretchedImage `\n!define NSD_SetStretchedBitmap `!insertmacro __NSD_SetStretchedImage `\n!macro __NSD_SetStretchedImage CONTROL IMAGE HANDLE\n\tLoadAndSetImage /STRINGID /RESIZETOFIT \"${CONTROL}\" ${IMAGE_BITMAP} ${LR_LOADFROMFILE} \"${IMAGE}\" ${HANDLE}\n!macroend\n\n\n!define NSD_FreeImage `!insertmacro __NSD_FreeImage `\n!define NSD_FreeBitmap `${NSD_FreeImage} `\n!macro __NSD_FreeImage IMAGE\n\t${If} ${IMAGE} P<> 0\n\t\tSystem::Call gdi32::DeleteObject(ps) ${IMAGE}\n\t${EndIf}\n!macroend\n\n\n!define NSD_FreeIcon `!insertmacro __NSD_FreeIcon `\n!macro __NSD_FreeIcon IMAGE\n\tSystem::Call user32::DestroyIcon(ps) ${IMAGE}\n!macroend\n\n\n!define NSD_ClearImage `!insertmacro __NSD_ClearImage ${IMAGE_BITMAP} `\n!define NSD_ClearBitmap `${NSD_ClearImage} `\n!define NSD_ClearIcon  `!insertmacro __NSD_ClearImage ${IMAGE_ICON } `\n!macro __NSD_ClearImage _IMGTYPE CONTROL\n\tSendMessage ${CONTROL} ${STM_SETIMAGE} ${_IMGTYPE} 0\n!macroend\n\n\n### INI ###\n\n!define /IfNDef NSD_Debug `System::Call kernel32::OutputDebugString(ts)`\n\n!macro __NSD_ControlCase TYPE\n\t${Case} ${TYPE}\n\t\t${NSD_Create${TYPE}} $R3u $R4u $R5u $R6u $R7\n\t\tPop $R9\n\t\t${Break}\n!macroend\n\n!macro __NSD_ControlCaseEx TYPE\n\t${Case} ${TYPE}\n\t\tCall ${TYPE}\n\t\t${Break}\n!macroend\n\n!macro NSD_FUNCTION_INIFILE\n\t!insertmacro NSD_INIFILE \"\"\n!macroend\n\n!macro NSD_UNFUNCTION_INIFILE\n\t!insertmacro NSD_INIFILE un.\n!macroend\n\n!macro NSD_INIFILE UNINSTALLER_FUNCPREFIX\n\n\t;Functions to create dialogs based on old InstallOptions INI files\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}CreateDialogFromINI\n\n\t\t# $0 = ini\n\n\t\tReadINIStr $R0 $0 Settings RECT\n\t\t${If} $R0 == \"\"\n\t\t\tStrCpy $R0 1018\n\t\t${EndIf}\n\n\t\tnsDialogs::Create $R0\n\t\tPop $R9\n\n\t\tReadINIStr $R0 $0 Settings RTL\n\t\tnsDialogs::SetRTL $R0\n\n\t\tReadINIStr $R0 $0 Settings NumFields\n\n\t\t${NSD_Debug} \"NumFields = $R0\"\n\n\t\t${For} $R1 1 $R0\n\t\t\t${NSD_Debug} \"Creating field $R1\"\n\t\t\tReadINIStr $R2 $0 \"Field $R1\" Type\n\t\t\t${NSD_Debug} \"  Type = $R2\"\n\t\t\tReadINIStr $R3 $0 \"Field $R1\" Left\n\t\t\t${NSD_Debug} \"  Left = $R3\"\n\t\t\tReadINIStr $R4 $0 \"Field $R1\" Top\n\t\t\t${NSD_Debug} \"  Top = $R4\"\n\t\t\tReadINIStr $R5 $0 \"Field $R1\" Right\n\t\t\t${NSD_Debug} \"  Right = $R5\"\n\t\t\tReadINIStr $R6 $0 \"Field $R1\" Bottom\n\t\t\t${NSD_Debug} \"  Bottom = $R6\"\n\t\t\tIntOp $R5 $R5 - $R3\n\t\t\t${NSD_Debug} \"  Width = $R5\"\n\t\t\tIntOp $R6 $R6 - $R4\n\t\t\t${NSD_Debug} \"  Height = $R6\"\n\t\t\tReadINIStr $R7 $0 \"Field $R1\" Text\n\t\t\t${NSD_Debug} \"  Text = $R7\"\n\t\t\t${Switch} $R2\n\t\t\t\t!insertmacro __NSD_ControlCase   HLine\n\t\t\t\t!insertmacro __NSD_ControlCase   VLine\n\t\t\t\t!insertmacro __NSD_ControlCase   Label\n\t\t\t\t!insertmacro __NSD_ControlCase   Icon\n\t\t\t\t!insertmacro __NSD_ControlCase   Bitmap\n\t\t\t\t!insertmacro __NSD_ControlCaseEx Link\n\t\t\t\t!insertmacro __NSD_ControlCase   Button\n\t\t\t\t!insertmacro __NSD_ControlCase   GroupBox\n\t\t\t\t!insertmacro __NSD_ControlCase   CheckBox\n\t\t\t\t!insertmacro __NSD_ControlCase   RadioButton\n\t\t\t\t!insertmacro __NSD_ControlCase   Text\n\t\t\t\t!insertmacro __NSD_ControlCase   Password\n\t\t\t\t!insertmacro __NSD_ControlCaseEx FileRequest\n\t\t\t\t!insertmacro __NSD_ControlCaseEx DirRequest\n\t\t\t\t!insertmacro __NSD_ControlCase   ComboBox\n\t\t\t\t!insertmacro __NSD_ControlCase   DropList\n\t\t\t\t!insertmacro __NSD_ControlCase   ListBox\n\t\t\t${EndSwitch}\n\n\t\t\tWriteINIStr $0 \"Field $R1\" HWND $R9\n\t\t${Next}\n\n\t\tnsDialogs::Show\n\n\tFunctionEnd\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}UpdateINIState\n\n\t\t${NSD_Debug} \"Updating INI state\"\n\n\t\tReadINIStr $R0 $0 Settings NumFields\n\n\t\t${NSD_Debug} \"NumField = $R0\"\n\n\t\t${For} $R1 1 $R0\n\t\t\tReadINIStr $R2 $0 \"Field $R1\" HWND\n\t\t\tReadINIStr $R3 $0 \"Field $R1\" \"Type\"\n\t\t\t${Switch} $R3\n\t\t\t\t${Case} \"CheckBox\"\n\t\t\t\t${Case} \"RadioButton\"\n\t\t\t\t\t${NSD_Debug} \"  HWND = $R2\"\n\t\t\t\t\t${NSD_GetState} $R2 $R2\n\t\t\t\t\t${NSD_Debug} \"  Window selection = $R2\"\n\t\t\t\t${Break}\n\t\t\t\t${CaseElse}\n\t\t\t\t\t${NSD_Debug} \"  HWND = $R2\"\n\t\t\t\t\t${NSD_GetText} $R2 $R2\n\t\t\t\t\t${NSD_Debug} \"  Window text = $R2\"\n\t\t\t\t${Break}\n\t\t\t${EndSwitch}\n\t\t\tWriteINIStr $0 \"Field $R1\" STATE $R2\n\t\t${Next}\n\n\tFunctionEnd\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}FileRequest\n\n\t\tIntOp $R5 $R5 - 15\n\t\tIntOp $R8 $R3 + $R5\n\n\t\t${NSD_CreateBrowseButton} $R8u $R4u 15u $R6u ...\n\t\tPop $R8\n\n\t\tnsDialogs::SetUserData $R8 $R1 # remember field id\n\n\t\tWriteINIStr $0 \"Field $R1\" HWND2 $R8\n\n\t\t${NSD_OnClick} $R8 ${UNINSTALLER_FUNCPREFIX}OnFileBrowseButton\n\n\t\tReadINIStr $R9 $0 \"Field $R1\" State\n\n\t\t${NSD_CreateFileRequest} $R3u $R4u $R5u $R6u $R9\n\t\tPop $R9\n\n\tFunctionEnd\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}DirRequest\n\n\t\tIntOp $R5 $R5 - 15\n\t\tIntOp $R8 $R3 + $R5\n\n\t\t${NSD_CreateBrowseButton} $R8u $R4u 15u $R6u ...\n\t\tPop $R8\n\n\t\tnsDialogs::SetUserData $R8 $R1 # remember field id\n\n\t\tWriteINIStr $0 \"Field $R1\" HWND2 $R8\n\n\t\t${NSD_OnClick} $R8 ${UNINSTALLER_FUNCPREFIX}OnDirBrowseButton\n\n\t\tReadINIStr $R9 $0 \"Field $R1\" State\n\n\t\t${NSD_CreateFileRequest} $R3u $R4u $R5u $R6u $R9\n\t\tPop $R9\n\n\tFunctionEnd\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}OnFileBrowseButton\n\n\t\tPop $R0\n\n\t\tnsDialogs::GetUserData $R0\n\t\tPop $R1\n\n\t\tReadINIStr $R2 $0 \"Field $R1\" HWND\n\t\tReadINIStr $R4 $0 \"Field $R1\" Filter\n\n\t\t${NSD_GetText} $R2 $R3\n\n\t\tnsDialogs::SelectFileDialog save $R3 $R4\n\t\tPop $R3\n\n\t\t${If} $R3 != \"\"\n\t\t\tSendMessage $R2 ${WM_SETTEXT} 0 STR:$R3\n\t\t${EndIf}\n\n\tFunctionEnd\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}OnDirBrowseButton\n\n\t\tPop $R0\n\n\t\tnsDialogs::GetUserData $R0\n\t\tPop $R1\n\n\t\tReadINIStr $R2 $0 \"Field $R1\" HWND\n\t\tReadINIStr $R3 $0 \"Field $R1\" Text\n\n\t\t${NSD_GetText} $R2 $R4\n\n\t\tnsDialogs::SelectFolderDialog $R3 $R4\n\t\tPop $R3\n\n\t\t${If} $R3 != error\n\t\t\tSendMessage $R2 ${WM_SETTEXT} 0 STR:$R3\n\t\t${EndIf}\n\n\tFunctionEnd\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}Link\n\n\t\t${NSD_CreateLink} $R3u $R4u $R5u $R6u $R7\n\t\tPop $R9\n\n\t\tnsDialogs::SetUserData $R9 $R1 # remember field id\n\n\t\t${NSD_OnClick} $R9 ${UNINSTALLER_FUNCPREFIX}OnLink\n\n\tFunctionEnd\n\n\tFunction ${UNINSTALLER_FUNCPREFIX}OnLink\n\n\t\tPop $R0\n\n\t\tnsDialogs::GetUserData $R0\n\t\tPop $R1\n\n\t\tReadINIStr $R1 $0 \"Field $R1\" STATE\n\n\t\tExecShell \"\" $R1\n\n\tFunctionEnd\n\n!macroend\n\n!verbose pop\n!endif\n"
  },
  {
    "path": "setup/nsis/tools/Include/nsProcess.nsh",
    "content": "!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess`\n\n!macro nsProcess::FindProcess _FILE _ERR\n\tnsProcess::_FindProcess /NOUNLOAD `${_FILE}`\n\tPop ${_ERR}\n!macroend\n\n\n!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess`\n\n!macro nsProcess::KillProcess _FILE _ERR\n\tnsProcess::_KillProcess /NOUNLOAD `${_FILE}`\n\tPop ${_ERR}\n!macroend\n\n!define nsProcess::CloseProcess `!insertmacro nsProcess::CloseProcess`\n\n!macro nsProcess::CloseProcess _FILE _ERR\n\tnsProcess::_CloseProcess /NOUNLOAD `${_FILE}`\n\tPop ${_ERR}\n!macroend\n\n\n!define nsProcess::Unload `!insertmacro nsProcess::Unload`\n\n!macro nsProcess::Unload\n\tnsProcess::_Unload\n!macroend\n"
  },
  {
    "path": "setup/nsis/tools/Include/x64.nsh",
    "content": "; ---------------------\n;       x64.nsh\n; ---------------------\n;\n; A few simple macros to handle installations on x64 machines.\n;\n; RunningX64 checks if the installer is running on a 64-bit OS.\n; IsWow64 checks if the installer is a 32-bit application running on a 64-bit OS.\n;\n;   ${If} ${RunningX64}\n;     MessageBox MB_OK \"Running on 64-bit Windows\"\n;   ${EndIf}\n;\n; IsNative* checks the OS native CPU architecture.\n;\n;   ${If} ${IsNativeAMD64}\n;     ; Install AMD64 64-bit driver/library\n;   ${ElseIf} ${IsNativeARM64}\n;     ; Install ARM64 64-bit driver/library\n;   ${ElseIf} ${IsNativeIA32}\n;     ; Install i386 32-bit driver/library\n;   ${Else}\n;     Abort \"Unsupported CPU architecture!\"\n;   ${EndIf}\n;\n;   ${If} ${IsNativeAMD64}\n;       File \"amd64\\myapp.exe\"\n;   ${ElseIf} ${IsNativeIA32}\n;   ${OrIf} ${IsWow64}\n;       File \"x86\\myapp.exe\"\n;   ${Else}\n;       Abort \"Unsupported CPU architecture!\"\n;   ${EndIf}\n;\n; DisableX64FSRedirection disables file system redirection.\n; EnableX64FSRedirection enables file system redirection.\n;\n;   SetOutPath $SYSDIR\n;   ${DisableX64FSRedirection}\n;   File something.bin # extracts to C:\\Windows\\System32\n;   ${EnableX64FSRedirection}\n;   File something.bin # extracts to C:\\Windows\\SysWOW64\n;\n\n!ifndef ___X64__NSH___\n!define ___X64__NSH___\n\n!include LogicLib.nsh\n\n\n!define IsWow64 `\"\" IsWow64 \"\"`\n!macro _IsWow64 _a _b _t _f\n  !insertmacro _LOGICLIB_TEMP\n  System::Call kernel32::GetCurrentProcess()p.s\n  System::Call kernel32::IsWow64Process2(ps,*i0s,*i) ; [Win10.1511+] 0 if not WOW64\n  Push |\n  System::Call kernel32::IsWow64Process(p-1,*i0s) ; [WinXP+] FALSE for a 32-bit application on ARM64!\n  System::Int64Op\n  Pop $_LOGICLIB_TEMP\n  !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`\n!macroend\n\n\n!define RunningX64 `\"\" RunningX64 \"\"`\n!macro _RunningX64 _a _b _t _f \n  !if ${NSIS_PTR_SIZE} > 4\n    !insertmacro LogicLib_JumpToBranch `${_t}` `${_f}`\n  !else\n    !insertmacro _IsWow64 `${_a}` `${_b}` `${_t}` `${_f}`\n  !endif\n!macroend\n\n\n!define GetNativeMachineArchitecture \"!insertmacro GetNativeMachineArchitecture \"\n!macro GetNativeMachineArchitecture outvar\n  !define GetNativeMachineArchitecture_lbl lbl_GNMA_${__COUNTER__}\n  System::Call kernel32::GetCurrentProcess()p.s\n  System::Call kernel32::IsWow64Process2(ps,*i,*i0s)\n  Pop ${outvar}\n  IntCmp ${outvar} 0 \"\" ${GetNativeMachineArchitecture_lbl}_done ${GetNativeMachineArchitecture_lbl}_done\n    !if \"${NSIS_PTR_SIZE}\" <= 4\n    !if \"${NSIS_CHAR_SIZE}\" <= 1\n    System::Call 'USER32::CharNextW(w\"\")p.s'\n    Pop ${outvar}\n    IntPtrCmpU ${outvar} 0 \"\" ${GetNativeMachineArchitecture_lbl}_oldnt ${GetNativeMachineArchitecture_lbl}_oldnt\n      StrCpy ${outvar} 332 ; Always IMAGE_FILE_MACHINE_I386 on Win9x\n      Goto ${GetNativeMachineArchitecture_lbl}_done\n    ${GetNativeMachineArchitecture_lbl}_oldnt:\n    !endif\n    !endif\n    System::Call '*0x7FFE002E(&i2.s)'\n    Pop ${outvar}\n  ${GetNativeMachineArchitecture_lbl}_done:\n  !undef GetNativeMachineArchitecture_lbl\n!macroend\n\n!macro _IsNativeMachineArchitecture _ignore _arc _t _f\n  !insertmacro _LOGICLIB_TEMP\n  ${GetNativeMachineArchitecture} $_LOGICLIB_TEMP\n  !insertmacro _= $_LOGICLIB_TEMP ${_arc} `${_t}` `${_f}`\n!macroend\n\n!define IsNativeMachineArchitecture `\"\" IsNativeMachineArchitecture `\n!define IsNativeIA32 '${IsNativeMachineArchitecture} 332' ; Intel x86\n!define IsNativeAMD64 '${IsNativeMachineArchitecture} 34404' ; x86-64/x64\n!define IsNativeARM64 '${IsNativeMachineArchitecture} 43620'\n\n\n!define DisableX64FSRedirection \"!insertmacro DisableX64FSRedirection\"\n!macro DisableX64FSRedirection\n  System::Call kernel32::Wow64EnableWow64FsRedirection(i0)\n!macroend\n\n!define EnableX64FSRedirection \"!insertmacro EnableX64FSRedirection\"\n!macro EnableX64FSRedirection\n  System::Call kernel32::Wow64EnableWow64FsRedirection(i1)\n!macroend\n\n\n!endif # !___X64__NSH___\n"
  },
  {
    "path": "setup/nsis/tools/nsisconf.nsh",
    "content": ";------------------------\n;DEFAULT NSIS CONFIG FILE\n;------------------------\n\n;This header file will be included when compiling any NSIS installer,\n;you can use it to add script code to every installer you compile.\n\n;This file is treated as if it is in the directory of your script.\n;When using relative paths, the files have to be in your build directory.\n\n;------------------------\n;EXAMPLES\n;------------------------\n\n;Compress installer exehead with an executable compressor (such as UPX / Petite).\n\n;Paths should be absolute to allow building from any location.\n;Note that your executable compressor should not compress the first icon.\n\n;!packhdr temp.dat '\"C:\\Program Files\\upx\\upx\" -9 -q temp.dat'\n;!packhdr temp.dat '\"C:\\Program Files\\petite\\petite\" -9 -b0 -r** -p0 -y temp.dat'\n\n;------------------------\n\n;Set default compressor\n\n;SetCompressor bzip2\n\n;------------------------\n\n;Change the default icons\n\n;Icon \"${NSISDIR}\\Contrib\\Graphics\\Icons\\arrow-install.ico\"\n;UninstallIcon \"${NSISDIR}\\Contrib\\Graphics\\Icons\\arrow-uninstall.ico\"\n\n;------------------------\n\n;Define symbols\n\n;!define COMPANYNAME \"bla\"\n\n;------------------------\n;MODERN UI\n;------------------------\n\n;The Modern UI will insert the MUI_NSISCONF macro just before processing the settings.\n;Here you can set default settings for the Modern UI.\n\n;------------------------\n\n!define MUI_INSERT_NSISCONF\n\n!macro MUI_NSISCONF\n\n  ;Example: Change the default Modern UI icons\n  \n  ;!ifndef MUI_ICON & MUI_UNICON\n  ;  !define MUI_ICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\arrow-install.ico\"\n  ;  !define MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\arrow-uninstall.ico\"\n  ;!endif\n  \n!macroend"
  },
  {
    "path": "setup/nsis/wrap.cmd",
    "content": "@echo off\n\n:: Paths added during installation.\nset PATH=%APPDATA%\\npm;%PATH%\nset PATH=%JAVA_HOME%\\bin;%PATH%\nset PATH=%PROGRAMFILES%\\Git\\cmd;%PATH%\nset PATH=%PROGRAMFILES%\\nodejs;%PATH%\nset PATH=%PROGRAMW6432%\\Eclipse Adoptium\\jdk-11.0.16.101-hotspot\\bin;%PATH%\nset PATH=%PROGRAMW6432%\\Android\\Android Studio\\jre\\bin;%PATH%\nset PATH=%PROGRAMW6432%\\Git\\cmd;%PATH%\nset PATH=%PROGRAMW6432%\\Microsoft VS Code\\bin;%PATH%\nset PATH=%PROGRAMW6432%\\Sublime Text 3;%PATH%\nset PATH=%PROGRAMW6432%\\nodejs;%PATH%\n\n:: Run command.\n%*\n"
  },
  {
    "path": "setup/pkg/.gitignore",
    "content": "pkgs/\nroot/\n*.pkg\n"
  },
  {
    "path": "setup/pkg/Distribution.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<installer-gui-script minSpecVersion=\"2\">\n    \n    <title>fuse X</title>\n    <organization>com.fuse-x</organization>\n    <license file=\"license.html\" />\n\n    <domains enable_localSystem=\"true\"/>\n    <options customize=\"never\" require-scripts=\"true\" rootVolumeOnly=\"true\" />\n\n    <!--<app id=\"com.fuse-x.studio\"/>-->\n    <!--<app id=\"com.fuse-x.menu-bar\"/>-->\n\n    <allowed-os-versions>\n        <os-version min=\"10.10\" />\n    </allowed-os-versions>\n\n    <pkg-ref id=\"com.fuse-x.studio\"/>\n    \n    <choices-outline>\n        <line choice=\"default\">\n            <line choice=\"com.fuse-x.studio\"/>\n        </line>\n    </choices-outline>\n    \n    <choice id=\"default\"/>\n    \n    <choice id=\"com.fuse-x.studio\" visible=\"false\">\n        <pkg-ref id=\"com.fuse-x.studio\"/>\n    </choice>\n\n    <pkg-ref id=\"com.fuse-x.studio\" onConclusion=\"none\">fuse-studio.pkg</pkg-ref>\n\n</installer-gui-script>"
  },
  {
    "path": "setup/pkg/build.sh",
    "content": "#!/bin/bash\nset -e\ncd \"`dirname \"$0\"`\"\n\n# Clean up old stuff\nrm -rf pkgs *.pkg\n\n# Remove all .DS_Store files\nfind root -name \".DS_Store\" -depth -exec rm {} \\;\n\n# Make sure scripts are executable\nchmod +x scripts/* *.sh\n\n# Include installer scripts\ncp check-system.sh root/tmp/\ncp install-fuse.sh root/tmp/\ncp launch-fuse.sh root/tmp/\ncp *.js root/tmp/\n\nmkdir -p pkgs\npkgbuild --root root \\\n    --identifier com.fuse-x.studio \\\n    --version $VERSION \\\n    --ownership recommended \\\n    --scripts scripts \\\n    pkgs/fuse-studio.pkg\n\nproductbuild --distribution Distribution.xml \\\n    --package-path pkgs \\\n    --resources resources/ \\\n    fuse-unsigned.pkg\n"
  },
  {
    "path": "setup/pkg/check-system.sh",
    "content": "#!/bin/bash\nset -e\n\nMIN_MONO_VERSION=6.4\nMIN_NODE_VERSION=10.0\nMIN_NPM_VERSION=6.0\n\nROOT=`dirname \"$0\"`\n\n# Mono and NPM\nexport PATH=/usr/local/bin:/opt/local/bin:/opt/homebrew/bin:$PATH\nexport PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH\n\nfunction check-version {\n    # Test that command works\n    \"$1\" --version > /dev/null 2> /dev/null || return 1\n\n    local version=`\"$1\" --version | node \"$ROOT/get-version.js\"`\n    if [ -z \"$version\" ]; then\n        echo -e \"Failed to detect version of '$1'.\" >&2\n        return 0\n    fi\n\n    if node \"$ROOT/version-gte.js\" \"$version\" \"$2\"; then\n        echo \"using $1 version $version\"\n        return 0\n    fi\n\n    return 1\n}\n\nfunction error-dialog {\n    osascript -e \"tell application (path to frontmost application as text) to display dialog \\\"$1\\\" buttons {\\\"OK\\\"} with icon stop\"\n    exit 1\n}\n\nfunction check-version2 {\n    check-version \"$1\" \"$2\" || error-dialog \"This application requires '$1' version $2 or newer.\\\\n\\\\nPlease install the latest version of '$1' and try again.\\\\n\\\\n$3\"    \n}\n\ncheck-version2  mono    $MIN_MONO_VERSION   https://www.mono-project.com/download/\ncheck-version2  node    $MIN_NODE_VERSION   https://nodejs.org/en/download/\ncheck-version2  npm     $MIN_NPM_VERSION    https://nodejs.org/en/download/\n\nif [ -f ~/.dotnet-run/.bin/mono ]; then\n    check-version ~/.dotnet-run/.bin/mono $MIN_MONO_VERSION || rm -rf ~/.dotnet-run\nfi\n"
  },
  {
    "path": "setup/pkg/get-version.js",
    "content": "const fs = require('fs');\nconst data = fs.readFileSync(0, 'utf-8');\n\nfunction isPositiveInteger(x) {\n    // http://stackoverflow.com/a/1019526/11236\n    return /^\\d+$/.test(x);\n}\n\nfunction isVersionNumber(x) {\n    const parts = x.split('.');\n    for (var i = 0; i < parts.length; ++i) {\n        if (!isPositiveInteger(parts[i])) {\n            return false;\n        }\n    }\n    return true;\n}\n\nconst lines = data.split('\\n');\nconst words = lines[0].split(' ');\n\nfor (let i = 0; i < words.length; i++) {\n    let word = words[i].trim();\n\n    if (word.startsWith(\"v\"))\n        word = word.substring(1);\n\n    if (isVersionNumber(word)) {\n        console.log(word);\n        process.exit(0);\n    }\n}\n\nprocess.exit(1);\n"
  },
  {
    "path": "setup/pkg/install-fuse.sh",
    "content": "#!/bin/bash\nset -e\n\n# Mono and NPM\nexport PATH=/usr/local/bin:/opt/local/bin:/opt/homebrew/bin:$PATH\nexport PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH\n\n# Config\nTGZ=/tmp/fuse-x-studio-mac.tar\nPREFIX=/usr/local\nDST=$PREFIX/lib/node_modules/@fuse-x/studio-mac\nFUSE=$PREFIX/bin/fuse\nUNO=$PREFIX/bin/uno\n\n# Override tarball\nif [ -n \"$1\" ]; then\n    TGZ=$1\nfi\n\n# Debug\necho USER:  $USER\necho HOME:  $HOME\necho TGZ:   $TGZ\necho DST:   $DST\necho FUSE:  $FUSE\necho UNO:   $UNO\n\n# Install\nnpm install -g -f dotnet-run --prefix \"$PREFIX\"\nnpm install -g -f \"$TGZ\" --prefix \"$PREFIX\"\n\"$FUSE\" kill-all\n\n# Warm-up\n\"$UNO\" build \"$DST/empty\"\n"
  },
  {
    "path": "setup/pkg/launch-fuse.sh",
    "content": "#!/bin/bash\nset -e\n\n# Mono and NPM\nexport PATH=/usr/local/bin:/opt/local/bin:/opt/homebrew/bin:$PATH\nexport PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH\n\n# Restart fuse X\n/usr/local/bin/fuse kill-all\n/usr/local/bin/fuse\n"
  },
  {
    "path": "setup/pkg/resources/license.html",
    "content": "fuse X License Agreement\n\nThis License Agreement is made between BUILD AND RUN AS (the \"Company\") and the person (\"you\") who completes the installation of this version of the fuse X product (the \"Software\"). By clicking \"I accept\" or by installing or using the Software, you agree to have read and understood this License Agreement and to be bound by its terms and conditions.\n\n1.\tLicense: Provided that you otherwise comply with this License Agreement, you are granted a personal, non-exclusive, royalty-free, non-transferrable license to install, run and use the Software for any purpose, whether commercial or non-commercial.\n\n2.\tLicense Restrictions: You may not (a) assign, sublicense, sell, rent or otherwise distribute the Software and/or this License Agreement to any third party; (b) allow others to use, run or otherwise access the Software; (c) modify or otherwise create derivative works based on the Software; (d) decompile, reverse engineer, disassemble or otherwise reduce the object code parts of the Software to a human-perceivable form; (e) remove this License Agreement from the Software.\n\n3.\tThird Party Software: The Software, or the output generated by your use of the Software, may be subject to third party software licenses. By accepting this License Agreement, you are also accepting the additional terms and conditions, if any, as set forth in such third party software license terms. \n\n4.\tUse of Output: Provided that you otherwise comply with this License Agreement, You are free to use, sublicense, sell, rent or otherwise distribute the object code output generated by your use of the Software for any purpose, whether commercial or non-commercial.\n\n5.\tIntellectual Property Rights: You become the owner and copyright holder to code and other input created by you in the course of your use of the Software. The Company retains all other rights, title and interest, including the intellectual property rights, in and to the Software, and nothing in this License Agreement shall be construed as an assignment of such intellectual property rights. \n\n6.\tUsage Information: Any feedback you provide relating to your use of the Software may be used by the Company for the improvement and modification of the Software. In addition to usage information that you provide the Company directly the Software may also collect data such as Application usage statistics (for instance, if and when you experienced errors, and how often you use different features), operating system information (such as service pack, drivers and support DLLs such as DirectX version), information about hardware types as well as CPU information, which can be used by the Company as it sees fit.\n\n7.\tNo Maintenance or Support: The Company is not obliged to provide maintenance or support for the Software, nor to notify about or grant license to bug fixes, patches or upgrades or updates to the Software (if any). If the Company at its sole discretion choses to make a Software bug fix, patch, upgrade or update available to you, and the Company does not require that your use thereof shall be subject to a separate license agreement, then your use of such bug fix, patch, upgrade or update shall be deemed incorporated into the Software and subject to this License Agreement. \n\n8.\tNo Warranty: The Software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose (including fitness for a particular operating system or particular configurations) and non-infringement. \n\n9.\tLimitation of Liability: In no event shall the Company be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from or in connection with the Software, including but not limited to any indirect and consequential damages (such as damages for the loss of profits, loss of data, breach of contract, and the inability to use equipment or other software). \n\n10.\tBreach of License Agreement: In the event that you fail to comply with the terms of this License Agreement, the license(s) granted hereunder shall immediately cease, and you must upon the Company's request destroy all copies of the Software. \n\n11.\tGoverning Law and Dispute Resolution: The License Agreement is governed by the laws of Norway. Any disputes arising in connection with this License Agreement shall be referred to the courts of Oslo, Norway."
  },
  {
    "path": "setup/pkg/scripts/postinstall",
    "content": "#!/bin/sh\n\nif [ -n \"$SUDO_USER\" ]; then\n\texport USER=$SUDO_USER\nfi\n\nfunction clean_up {\n\trm -rf \"/tmp/fuse X.app\"\n\trm -rf /tmp/fuse-x-studio-mac.tar\n\trm -rf /tmp/install-fuse.sh\n\trm -rf /tmp/check-system.sh\n\trm -rf /tmp/launch-fuse.sh\n\trm -rf /tmp/get-version.js\n\trm -rf /tmp/version-gte.js\n}\n\nfunction error {\n\tcat /tmp/$1.log\n\tcat /tmp/$1.err\n\t#clean_up\n\texit 1\n}\n\nchown -R \"$USER\" /usr/local/bin\nchown -R \"$USER\" /usr/local/lib/node_modules\n\nsu \"$USER\" -c 'bash /tmp/check-system.sh' \\\n\t2> /tmp/check-system.err > /tmp/check-system.log || error check-system\n\nsu \"$USER\" -c 'bash /tmp/install-fuse.sh || bash /tmp/install-fuse.sh || bash /tmp/install-fuse.sh' \\\n\t2> /tmp/install-fuse.err > /tmp/install-fuse.log || error install-fuse\n\nmv \"/tmp/fuse X.app\" /Applications/ \\\n\t2> /tmp/fuse-app.err > /tmp/fuse-app.log || error fuse-app\n\n/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister \\\n\t-R -f \"/Applications/fuse X.app\" \\\n\t2> /tmp/register-fuse.err > /tmp/register-fuse.log || :\n\nsu \"$USER\" -c 'bash /tmp/launch-fuse.sh' \\\n\t2> /tmp/launch-fuse.err > /tmp/launch-fuse.log || error launch-fuse\n\necho Success\nclean_up\n"
  },
  {
    "path": "setup/pkg/scripts/preinstall",
    "content": "#!/bin/sh\n\n# Clean up any old install\nrm -rf /usr/local/share/uno/Packages            # Legacy\nrm -rf /usr/local/bin/fuse-x\nrm -rf /usr/local/bin/fuse\nrm -rf /usr/local/bin/uno\nrm -rf /usr/local/bin/unotest                   # Legacy\nrm -rf /Applications/Fuse.app                   # Legacy\nrm -rf \"/Applications/fuse X.app\"\nrm -rf /Applications/fuse-uri.app               # Legacy\nrm -rf \"/Applications/fuse X (uri-handler).app\" # Legacy\n\n# Old path\nrm -rf /usr/share/uno/Packages\nrm -rf /usr/bin/uno\nrm -rf /usr/bin/unotest\nrm -rf /usr/bin/fuse\n\n# Legacy\nrm -rf \"$HOME/Library/Application Support/Fusetools\"\nrm -rf /usr/local/share/uno/SDKs\nrm -rf /usr/share/uno/SDKs\n\n# Temp files\nrm -rf /tmp/get-version.js\nrm -rf /tmp/version-gte.js\nrm -rf /tmp/check-system.*\nrm -rf /tmp/install-fuse.*\nrm -rf /tmp/launch-fuse.*\nrm -rf /tmp/fuse-*.tgz\nrm -rf \"/tmp/fuse X.app\"\n"
  },
  {
    "path": "setup/pkg/version-gte.js",
    "content": "function isPositiveInteger(x) {\n    // http://stackoverflow.com/a/1019526/11236\n    return /^\\d+$/.test(x);\n}\n\n/**\n * Compare two software version numbers (e.g. 1.7.1)\n * Returns:\n *\n *  0 if they're identical\n *  negative if v1 < v2\n *  positive if v1 > v2\n *  Nan if they in the wrong format\n *\n *  E.g.:\n *\n *  assert(version_number_compare(\"1.7.1\", \"1.6.10\") > 0);\n *  assert(version_number_compare(\"1.7.1\", \"1.7.10\") < 0);\n *\n *  \"Unit tests\": http://jsfiddle.net/ripper234/Xv9WL/28/\n *\n *  Taken from http://stackoverflow.com/a/6832721/11236\n */\nfunction compareVersionNumbers(v1, v2){\n    var v1parts = v1.split('.');\n    var v2parts = v2.split('.');\n\n    // First, validate both numbers are true version numbers\n    function validateParts(parts) {\n        for (var i = 0; i < parts.length; ++i) {\n            if (!isPositiveInteger(parts[i])) {\n                return false;\n            }\n        }\n        return true;\n    }\n    if (!validateParts(v1parts) || !validateParts(v2parts)) {\n        return NaN;\n    }\n\n    for (var i = 0; i < v1parts.length; ++i) {\n        if (v2parts.length === i) {\n            return 1;\n        }\n\n        if (v1parts[i] === v2parts[i]) {\n            continue;\n        }\n        if (1 * v1parts[i] > 1 * v2parts[i]) {\n            return 1;\n        }\n        return -1;\n    }\n\n    if (v1parts.length != v2parts.length) {\n        return -1;\n    }\n\n    return 0;\n}\n\nconst gte = compareVersionNumbers(process.argv[2], process.argv[3]) >= 0;\nprocess.exit(gte ? 0 : 1);\n"
  },
  {
    "path": "setup/platypus/fuse X.platypus",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>AcceptsFiles</key>\n\t<false/>\n\t<key>AcceptsText</key>\n\t<false/>\n\t<key>Authentication</key>\n\t<false/>\n\t<key>Author</key>\n\t<string>Build &amp; Run</string>\n\t<key>BundledFiles</key>\n\t<array/>\n\t<key>Creator</key>\n\t<string>Platypus-5.4.1</string>\n\t<key>DeclareService</key>\n\t<false/>\n\t<key>Destination</key>\n\t<string>/Applications/fuse X.app</string>\n\t<key>DevelopmentVersion</key>\n\t<false/>\n\t<key>DocIconPath</key>\n\t<string></string>\n\t<key>Droppable</key>\n\t<true/>\n\t<key>ExecutablePath</key>\n\t<string>/usr/local/share/platypus/ScriptExec</string>\n\t<key>IconPath</key>\n\t<string>../../src/mac/studio/Resources/FuseBigSur.icns</string>\n\t<key>Identifier</key>\n\t<string>com.fuse-x.app</string>\n\t<key>InterfaceType</key>\n\t<string>Progress Bar</string>\n\t<key>InterpreterArgs</key>\n\t<array>\n\t\t<string>-l</string>\n\t</array>\n\t<key>InterpreterPath</key>\n\t<string>/bin/bash</string>\n\t<key>Name</key>\n\t<string>fuse X</string>\n\t<key>NibPath</key>\n\t<string>/usr/local/share/platypus/MainMenu.nib</string>\n\t<key>OptimizeApplication</key>\n\t<false/>\n\t<key>Overwrite</key>\n\t<false/>\n\t<key>PromptForFileOnLaunch</key>\n\t<false/>\n\t<key>RemainRunning</key>\n\t<true/>\n\t<key>RunInBackground</key>\n\t<false/>\n\t<key>ScriptArgs</key>\n\t<array/>\n\t<key>ScriptPath</key>\n\t<string>main.sh</string>\n\t<key>SendNotifications</key>\n\t<false/>\n\t<key>StatusItemDisplayType</key>\n\t<string>Text</string>\n\t<key>StatusItemIcon</key>\n\t<data></data>\n\t<key>StatusItemIconIsTemplate</key>\n\t<true/>\n\t<key>StatusItemTitle</key>\n\t<string>Title</string>\n\t<key>StatusItemUseSystemFont</key>\n\t<true/>\n\t<key>Suffixes</key>\n\t<array/>\n\t<key>TextBackground</key>\n\t<string>#ffffff</string>\n\t<key>TextFont</key>\n\t<string>Monaco</string>\n\t<key>TextForeground</key>\n\t<string>#000000</string>\n\t<key>TextSize</key>\n\t<real>13</real>\n\t<key>URISchemes</key>\n\t<array>\n\t\t<string>fuse-x</string>\n\t</array>\n\t<key>UniformTypes</key>\n\t<array>\n\t\t<string>public.item</string>\n\t\t<string>public.folder</string>\n\t</array>\n\t<key>Version</key>\n\t<string>VERSION_NUMBER</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "setup/platypus/main.sh",
    "content": "#!/bin/bash\n\nfunction error {\n    echo \"Report issues at https://github.com/fuse-x/studio/issues\"\n    echo \"ALERT:Something went wrong|See 'Details' for more information or try reinstalling the app.\"\n    exit 1\n}\n\nAPP=\"/usr/local/lib/node_modules/@fuse-x/studio-mac/bin/Release/fuse X.app\"\nPROC=$(ps aux | grep \"$APP\" | grep -v \"grep\")\n\nopen \"$APP\" || error\n\nif [ -z \"$PROC\" ]; then\n    echo \"Waiting for fuse X to open\"\n    sleep 4\nfi\n\nif [ -n \"$1\" ]; then\n    echo \"Running uri-handler\"\n    /usr/local/bin/fuse uri \"$1\" || error\nfi\n\necho \"QUITAPP\"\n"
  },
  {
    "path": "setup/staple.sh",
    "content": "#!/bin/bash\nSELF=`echo $0 | sed 's/\\\\\\\\/\\\\//g'`\ncd \"`dirname \"$SELF\"`/..\" || exit 1\nset -e\n\nexport VERSION=`bash scripts/get-version.sh`\n\nif [[ \"$OSTYPE\" != darwin* ]]; then\n    >&2 echo \"ERROR: This operation is only supported on macOS\"\n    exit 1\nfi\n\nxcrun stapler staple fuse-x-$VERSION-mac.pkg\nspctl --assess --type install -v fuse-x-$VERSION-mac.pkg\n\nxcrun stapler staple fuse-x-$VERSION-mac.dmg\nspctl -a -t open --context context:primary-signature -v fuse-x-$VERSION-mac.dmg\n\necho \"\"\necho \"All done - you can now distribute the signed, notarized and stapled installer or DMG!\"\n"
  },
  {
    "path": "setup/uninstall.sh",
    "content": "#!/bin/bash\nset -e\n\nif [[ \"$OSTYPE\" != darwin* ]]; then\n    >&2 echo \"This script needs to run on macOS\"\n    exit 1\nfi\n\nrm -rf \"/Applications/fuse X.app\" \\\n       \"/usr/local/lib/node_modules/@fuse-x\" \\\n       \"/usr/local/bin/fuse-x\" \\\n       \"/usr/local/bin/fuse\" \\\n       \"/usr/local/bin/uno\"\n\necho \"fuse X has been uninstalled\"\n"
  },
  {
    "path": "src/.gitignore",
    "content": "GlobalAssemblyInfo.Override.cs\n"
  },
  {
    "path": "src/GlobalAssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyCompany(\"Build & Run\")]\n[assembly: AssemblyProduct(\"fuse X\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2023 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n[assembly: AssemblyVersion(\"2.9.1.0\")]\n[assembly: AssemblyFileVersion(\"2.9.1.0\")]\n[assembly: AssemblyInformationalVersion(\"2.9.1-dev\")]\n[assembly: AssemblyConfiguration(\"N/A\")]\n"
  },
  {
    "path": "src/GlobalAssemblyInfo.targets",
    "content": "<Project ToolsVersion=\"14.0\" DefaultTargets=\"Compile\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Compile Condition=\"!Exists('$(MSBuildThisFileDirectory)\\GlobalAssemblyInfo.Override.cs')\" Include=\"$(MSBuildThisFileDirectory)\\GlobalAssemblyInfo.cs\">\n      <Link>Properties\\GlobalAssemblyInfo.cs</Link>\n    </Compile>\n    <Compile Condition=\"Exists('$(MSBuildThisFileDirectory)\\GlobalAssemblyInfo.Override.cs')\" Include=\"$(MSBuildThisFileDirectory)\\GlobalAssemblyInfo.Override.cs\">\n      <Link>Properties\\GlobalAssemblyInfo.Override.cs</Link>\n    </Compile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "src/common/core/ArgumentParseExtensions.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ArgumentParseExtensions\n\t{\n\t\tpublic static Optional<string> TryParse(this List<string> args, string optionName)\n\t\t{\n\t\t\tvar argIdx = args.FindIndex(s => s.StartsWith(\"--\" + optionName));\n\t\t\tif (argIdx >= 0)\n\t\t\t{\n\t\t\t\tvar result = args[argIdx]\n\t\t\t\t\t.Split(\"=\")[1]\n\t\t\t\t\t.Trim('\"');\n\t\t\t\targs.RemoveAt(argIdx);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\treturn Optional.None();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/IBehavior.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic interface IBehavior<out T> : IObservable<T>\n\t{\n\t\tT Value { get; }\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/IBehaviorSubject.cs",
    "content": "﻿using System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic interface IBehaviorSubject<T> : IBehavior<T>, ISubject<T>\n\t{\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/Operators/AsBehavior.cs",
    "content": "﻿using System;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static partial class Behavior\n\t{\n\t\tpublic static IBehaviorSubject<T> AsBehavior<T>(this BehaviorSubject<T> subject)\n\t\t{\n\t\t\treturn new BehaviorSubjectWrapper<T>(subject);\n\t\t}\n\n\t\tpublic class BehaviorSubjectWrapper<T> : IBehaviorSubject<T>\n\t\t{\n\t\t\treadonly BehaviorSubject<T> _subject;\n\n\t\t\tpublic BehaviorSubjectWrapper(BehaviorSubject<T> subject)\n\t\t\t{\n\t\t\t\t_subject = subject;\n\t\t\t}\n\n\t\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t\t{\n\t\t\t\treturn _subject.Subscribe(observer);\n\t\t\t}\n\n\t\t\tpublic T Value\n\t\t\t{\n\t\t\t\tget { return _subject.Value; }\n\t\t\t}\n\n\t\t\tpublic void OnNext(T value)\n\t\t\t{\n\t\t\t\t_subject.OnNext(value);\n\t\t\t}\n\n\t\t\tpublic void OnError(Exception error)\n\t\t\t{\n\t\t\t\t_subject.OnError(error);\n\t\t\t}\n\n\t\t\tpublic void OnCompleted()\n\t\t\t{\n\t\t\t\t_subject.OnCompleted();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/Operators/CombineLatest.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Behavior\n\t{\n\t\tpublic static IBehavior<TResult> CombineLatest<TSource1, TSource2, TResult>(\n\t\t\tthis IBehavior<TSource1> self,\n\t\t\tIBehavior<TSource2> other,\n\t\t\tFunc<TSource1, TSource2, TResult> selector)\n\t\t{\n\t\t\treturn new CombineLatestBehavior<TSource1, TSource2, TResult>(self, other, selector);\n\t\t}\n\t}\n\n\tclass CombineLatestBehavior<TSource1, TSource2, TResult> : IBehavior<TResult>\n\t{\n\t\treadonly IBehavior<TSource1> _behavior1;\n\t\treadonly IBehavior<TSource2> _behavior2;\n\t\treadonly Func<TSource1, TSource2, TResult> _selector;\n\t\treadonly IObservable<TResult> _combinedObservable;\n\n\t\tpublic CombineLatestBehavior(IBehavior<TSource1> behavior1, IBehavior<TSource2> behavior2, Func<TSource1, TSource2, TResult> selector)\n\t\t{\n\t\t\t_behavior1 = behavior1;\n\t\t\t_behavior2 = behavior2;\n\t\t\t_selector = selector;\n\t\t\tIObservable<TSource1> obs1 = _behavior1;\n\t\t\tIObservable<TSource2> obs2 = _behavior2;\n\t\t\t_combinedObservable = obs1.CombineLatest(obs2, selector);\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<TResult> observer)\n\t\t{\n\t\t\treturn _combinedObservable.Subscribe(observer);\n\t\t}\n\n\t\tpublic TResult Value\n\t\t{\n\t\t\tget { return _selector(_behavior1.Value, _behavior2.Value); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/Operators/DistinctUntilChanged.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks;\n\npublic static partial class Behavior\n{\n\tpublic static IBehavior<T> DistinctUntilChanged<T>(this IBehavior<T> self)\n\t{\n\t\treturn new DistinctUntilChangedBehavior<T>(self);\n\t}\n\n\tclass DistinctUntilChangedBehavior<T> : IBehavior<T>\n\t{\n\t\treadonly IBehavior<T> _behavior;\n\t\treadonly IObservable<T> _distinctObservable;\n\n\t\tpublic DistinctUntilChangedBehavior(IBehavior<T> behavior)\n\t\t{\n\t\t\t_behavior = behavior;\n\t\t\tIObservable<T> obs = behavior;\n\t\t\t_distinctObservable = obs.DistinctUntilChanged();\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _distinctObservable.Subscribe(observer);\n\t\t}\n\n\t\tpublic T Value\n\t\t{\n\t\t\tget { return _behavior.Value; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/Operators/Return.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic static partial class Behavior\n\t{\n\t\tpublic static IBehavior<T> Return<T>(T value)\n\t\t{\n\t\t\treturn new ConstantBehavior<T>(value);\n\t\t}\n\t}\n\n\tclass ConstantBehavior<T> : IBehavior<T>\n\t{\n\t\tpublic T Value { get; private set; }\n\n\t\tpublic ConstantBehavior(T value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\tobserver.OnNext(Value);\n\t\t\tobserver.OnCompleted();\n\t\t\treturn Disposable.Empty;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/Operators/Select.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Behavior\n\t{\n\t\tpublic static IBehavior<TResult> Select<TSource, TResult>(this IBehavior<TSource> self, Func<TSource, TResult> f)\n\t\t{\n\t\t\treturn new SelectBehavior<TSource, TResult>(self, f);\n\t\t}\n\t}\n\n\tclass SelectBehavior<TSource, TResult> : IBehavior<TResult>\n\t{\n\t\treadonly IBehavior<TSource> _behavior;\n\t\treadonly Func<TSource, TResult> _selector;\n\t\treadonly IObservable<TResult> _selectedObservable;\n\n\t\tpublic SelectBehavior(IBehavior<TSource> behavior, Func<TSource, TResult> selector)\n\t\t{\n\t\t\t_behavior = behavior;\n\t\t\t_selector = selector;\n\t\t\tIObservable<TSource> obs = _behavior;\n\t\t\t_selectedObservable = obs.Select(selector);\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<TResult> observer)\n\t\t{\n\t\t\treturn _selectedObservable.Subscribe(observer);\n\t\t}\n\n\t\tpublic TResult Value\n\t\t{\n\t\t\tget { return _selector(_behavior.Value); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Behaviors/Operators/Switch.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Behavior\n\t{\n\t\tpublic static IBehavior<T> Switch<T>(this IBehavior<IBehavior<T>> self)\n\t\t{\n\t\t\treturn new SwitchBehavior<T>(self);\n\t\t}\n\n\t\tpublic static IBehavior<TResult> Switch<TSource, TResult>(\n\t\t\tthis IBehavior<TSource> self,\n\t\t\tFunc<TSource, IBehavior<TResult>> f)\n\t\t{\n\t\t\treturn self.Select(f).Switch();\n\t\t}\n\t}\n\n\tclass SwitchBehavior<T> : IBehavior<T>\n\t{\n\t\treadonly IBehavior<IBehavior<T>> _behavior;\n\t\treadonly IObservable<T> _switchedObservable;\n\n\t\tpublic SwitchBehavior(IBehavior<IBehavior<T>> behavior)\n\t\t{\n\t\t\t_behavior = behavior;\n\t\t\tIObservable<IObservable<T>> obs = _behavior;\n\t\t\t_switchedObservable = obs.Switch();\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _switchedObservable.Subscribe(observer);\n\t\t}\n\n\t\tpublic T Value\n\t\t{\n\t\t\tget { return _behavior.Value.Value; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/ColoredTextWriter.cs",
    "content": "using System;\nusing System.IO;\nusing System.Security;\nusing System.Text;\n\nnamespace Outracks\n{\n\tpublic class ColoredTextWriter : TextWriter\n\t{\n\t\tpublic static ColoredTextWriter Out = new ColoredTextWriter(\n\t\t\tConsole.Out,\n\t\t\tc =>\n\t\t\t{\n\t\t\t\tif (c.HasValue)\n\t\t\t\t\tConsole.ForegroundColor = c.Value;\n\t\t\t\telse\n\t\t\t\t\tConsole.ResetColor();\n\t\t\t});\n\n\t\tpublic static ColoredTextWriter Error = new ColoredTextWriter(\n\t\t\tConsole.Error,\n\t\t\tc =>\n\t\t\t{\n\t\t\t\tif (c.HasValue)\n\t\t\t\t\tConsole.ForegroundColor = c.Value;\n\t\t\t\telse\n\t\t\t\t\tConsole.ResetColor();\n\t\t\t});\n\n\n\t\treadonly TextWriter _textWriter;\n\t\treadonly Action<ConsoleColor?> _setColor;\n\n\t\tConsoleColor? _currentColor;\n\n\t\tpublic ColoredTextWriter(TextWriter textWriter, Action<ConsoleColor?> setColor)\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_setColor = setColor;\n\t\t}\n\n\t\tpublic IDisposable PushColor(ConsoleColor? color)\n\t\t{\n\t\t\tvar oldColor = _currentColor;\n\t\t\t_setColor(color);\n\t\t\t_currentColor = color;\n\t\t\treturn Disposable.Create(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\t_setColor(oldColor);\n\t\t\t\t\t_currentColor = oldColor;\n\t\t\t\t});\n\t\t}\n\n\t\t#region Delegation to _textWriter\n\n\t\tpublic override void Write(string value)\n\t\t{\n\t\t\t_textWriter.Write(value);\n\t\t}\n\n\t\tpublic override void WriteLine()\n\t\t{\n\t\t\t_textWriter.WriteLine();\n\t\t}\n\n\t\tpublic override void WriteLine(char value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(char[] buffer)\n\t\t{\n\t\t\t_textWriter.WriteLine(buffer);\n\t\t}\n\n\t\tpublic override void WriteLine(char[] buffer, int index, int count)\n\t\t{\n\t\t\t_textWriter.WriteLine(buffer, index, count);\n\t\t}\n\n\t\tpublic override void WriteLine(bool value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(int value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(uint value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(long value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(ulong value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(float value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(double value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(decimal value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\t[SecuritySafeCritical]  // auto-generated\n\t\tpublic override void WriteLine(String value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(Object value)\n\t\t{\n\t\t\t_textWriter.WriteLine(value);\n\t\t}\n\n\t\tpublic override void WriteLine(String format, Object arg0)\n\t\t{\n\t\t\t_textWriter.WriteLine(String.Format(FormatProvider, format, arg0));\n\t\t}\n\n\t\tpublic override void WriteLine(String format, Object arg0, Object arg1)\n\t\t{\n\t\t\t_textWriter.WriteLine(String.Format(FormatProvider, format, arg0, arg1));\n\t\t}\n\n\t\tpublic override void WriteLine(String format, Object arg0, Object arg1, Object arg2)\n\t\t{\n\t\t\t_textWriter.WriteLine(String.Format(FormatProvider, format, arg0, arg1, arg2));\n\t\t}\n\n\t\tpublic override void WriteLine(String format, params Object[] arg)\n\t\t{\n\t\t\t_textWriter.WriteLine(String.Format(FormatProvider, format, arg));\n\t\t}\n\n\t\tpublic override void Flush()\n\t\t{\n\t\t\t_textWriter.Flush();\n\t\t}\n\n\t\tpublic override void Close()\n\t\t{\n\t\t\t_textWriter.Close();\n\t\t}\n\n\t\tpublic override void Write(char c)\n\t\t{\n\t\t\t_textWriter.Write(c);\n\t\t}\n\n\t\tpublic override Encoding Encoding\n\t\t{\n\t\t\tget { return _textWriter.Encoding; }\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "src/common/core/ConsoleExtensions.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic static class ConsoleExtensions\n\t{\n\t\tpublic static void RedirectStreamsToLogFiles(string programName)\n\t\t{\n\t\t\tfor (int i = 0; i < 64; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Redirect output streams to disk (one file per process).\n\t\t\t\t\tvar dir = Path.GetDirectoryName(typeof(ConsoleExtensions).Assembly.Location);\n\t\t\t\t\tConsole.SetError(new StreamWriter(new FileStream(Path.Combine(dir, $\"{programName}-stderr{i}.txt\"), FileMode.OpenOrCreate, FileAccess.Write)) { AutoFlush = true });\n\t\t\t\t\tConsole.SetOut(new StreamWriter(new FileStream(Path.Combine(dir, $\"{programName}-stdout{i}.txt\"), FileMode.OpenOrCreate, FileAccess.Write)) { AutoFlush = true });\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/DateFormat.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic static class DateFormat\n\t{\n\t\tpublic static string PeriodBetween(DateTime time, DateTime pastTime)\n\t\t{\n\t\t\tvar span = time.Subtract(pastTime);\n\t\t\t// Fallback in case pastTime is in the future\n\t\t\tif (span.Ticks < 0)\n\t\t\t{\n\t\t\t\tif (span.TotalDays >= -1)\n\t\t\t\t{\n\t\t\t\t\tvar hours = Math.Abs(span.Hours);\n\t\t\t\t\tvar minutes = Math.Abs(span.Minutes);\n\t\t\t\t\treturn \"Today in \" + hours + (hours == 1 ? \" hour \" : \" hours\")\n\t\t\t\t\t\t+ (minutes > 0 ? \" \" + minutes + (minutes == 1 ? \" minute\" : \" minutes\") : \"\");\n\t\t\t\t}\n\t\t\t\treturn \"In \" + Math.Floor(Math.Abs(span.TotalDays)) + \" days\";\n\t\t\t}\n\n\t\t\tif (span.TotalDays >= 365)\n\t\t\t{\n\t\t\t\tvar years = time.Year - pastTime.Year;\n\t\t\t\treturn \"About \" + (years == 1 ? \"a year\" : years + \" years\") + \" ago\";\n\t\t\t}\n\t\t\tif (span.TotalDays >= 28)\n\t\t\t{\n\t\t\t\tvar months = time.Month - pastTime.Month;\n\t\t\t\treturn \"About \" + (months <= 1 ? \"a month\" : months + \" months\") + \" ago\";\n\t\t\t}\n\n\t\t\tif (span.TotalDays < 1 && pastTime.Day == time.Day)\n\t\t\t\treturn \"Today at \" + pastTime.ToShortTimeString();\n\t\t\tif (span.TotalDays < 2 && time.Day - pastTime.Day == 1)\n\t\t\t\treturn \"Yesterday at \" + pastTime.ToShortTimeString();\n\t\t\tif (span.TotalDays < 7)\n\t\t\t\treturn Math.Ceiling(span.TotalDays) + \" days ago\";\n\t\t\tif (span.TotalDays < 28)\n\t\t\t{\n\t\t\t\tvar weeks = Convert.ToInt32(span.TotalDays / 7);\n\t\t\t\treturn weeks + \" \" + (weeks == 1 ? \"week\" : \"weeks\") + \" ago\";\n\t\t\t}\n\n\t\t\treturn \"N/A\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/AssemblyAnalyzer.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Outracks\n{\n\tpublic static class AssemblyAnalyzer\n\t{\n\t\tpublic static void EnsureSameArchitectureInLoadedNonMSILAssemblies()\n\t\t{\n\t\t\tAppDomain\n\t\t\t\t.CurrentDomain\n\t\t\t\t.GetAssemblies()\n\t\t\t\t.Where(IsArchitectureDependent)\n\t\t\t\t.EnsureSameArchitecture();\n\t\t}\n\n\t\tpublic static bool IsArchitectureDependent(this Assembly assembly)\n\t\t{\n\t\t\tvar architecture = assembly.GetArchitecture();\n\t\t\treturn architecture != ProcessorArchitecture.MSIL && architecture != ProcessorArchitecture.None;\n\t\t}\n\n\t\tpublic static void EnsureSameArchitecture(this IEnumerable<Assembly> assembliesu)\n\t\t{\n\t\t\tvar assemblies = assembliesu.ToArray();\n\t\t\tif (assemblies.Length < 2) return;\n\n\t\t\tvar referenceAssembly = assemblies[0];\n\t\t\tvar wantedArchitecture = referenceAssembly.GetArchitecture();\n\n\t\t\tvar assembliesWithWrongArchiecture =\n\t\t\t\tassemblies\n\t\t\t\t.Where(asm => asm.GetArchitecture() != wantedArchitecture)\n\t\t\t\t.ToArray();\n\n\t\t\tif (assembliesWithWrongArchiecture.Length != 0)\n\t\t\t\tthrow new Exception(\n\t\t\t\t\t\"The following assemblies was not built with same architecture as \" + referenceAssembly.FullName + \" (\" + wantedArchitecture + \"): \\n\" +\n\t\t\t\t\tassembliesWithWrongArchiecture.Select(asm => asm.FullName + \" (\" + asm.GetArchitecture() + \")\").Join(\"\\n\"));\n\t\t}\n\n\t\tpublic static ProcessorArchitecture GetArchitecture(this Assembly assembly)\n\t\t{\n\t\t\treturn assembly.GetName().ProcessorArchitecture;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/CallerInfo.cs",
    "content": "namespace Outracks\n{\n\tpublic class CallerInfo\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly string SourceFilePath;\n\t\tpublic readonly int SourceLineNumber;\n\n\t\tpublic CallerInfo(string name, string sourceFilePath, int sourceLineNumber)\n\t\t{\n\t\t\tName = name;\n\t\t\tSourceFilePath = sourceFilePath;\n\t\t\tSourceLineNumber = sourceLineNumber;\n\t\t}\n\n\t\tprotected bool Equals(CallerInfo other)\n\t\t{\n\t\t\treturn string.Equals(Name, other.Name) && SourceLineNumber == other.SourceLineNumber && string.Equals(SourceFilePath, other.SourceFilePath);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\tif (obj.GetType() != this.GetType()) return false;\n\t\t\treturn Equals((CallerInfo) obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tint hashCode = (Name != null ? Name.GetHashCode() : 0);\n\t\t\t\thashCode = (hashCode * 397) ^ SourceLineNumber;\n\t\t\t\thashCode = (hashCode * 397) ^ (SourceFilePath != null ? SourceFilePath.GetHashCode() : 0);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/ConsoleTraceExtensions.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static class ConsoleTraceExtensions\n\t{\n\t\t/// <summary>\n\t\t/// Logs activity of <paramref name=\"source\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"source\">The <see cref=\"IObservable{T}\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name of observable, to make it easier to locate in trace</param>\n\t\t/// <param name=\"toString\">Optional delegate to call when converting to string, to override <see cref=\"object.ToString()\"/></param>\n\t\tpublic static IObservable<T> ConsoleTrace<T>(\n\t\t\tthis IObservable<T> source,\n\t\t\tstring name = \"(anonymous)\",\n\t\t\tFunc<T, string> toString = null)\n\t\t{\n\t\t\ttoString = toString ?? (x => DefaultToStringShortened(x));\n\t\t\treturn new TraceOperator<T>(source, name, ObservableTraceLogger.Current, toString);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Logs activity of <paramref name=\"source\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"source\">The <see cref=\"IConnectableObservable{T}\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name of observable, to make it easier to locate in trace</param>\n\t\t/// <param name=\"toString\">Optional delegate to call when converting to string, to override <see cref=\"object.ToString()\"/></param>\n\t\tpublic static IConnectableObservable<T> ConsoleTrace<T>(\n\t\t\tthis IConnectableObservable<T> source,\n\t\t\tstring name = \"(anonymous)\",\n\t\t\tFunc<T, string> toString = null)\n\t\t{\n\t\t\ttoString = toString ?? (x => DefaultToStringShortened(x));\n\t\t\treturn new ConnectableTraceOperator<T>(source, name, ObservableTraceLogger.Current, toString);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Logs activity of <paramref name=\"subject\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"subject\">The <see cref=\"ISubject{T}\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name of observable, to make it easier to locate in trace</param>\n\t\t/// <param name=\"toString\">Optional delegate to call when converting to string, to override <see cref=\"object.ToString()\"/></param>\n\t\tpublic static ISubject<T> ConsoleTrace<T>(\n\t\t\tthis ISubject<T> subject,\n\t\t\tstring name = \"(anonymous)\",\n\t\t\tFunc<T, string> toString = null)\n\t\t{\n\t\t\ttoString = toString ?? (x => DefaultToStringShortened(x));\n\t\t\treturn new SubjectTraceOperator<T>(subject, name, ObservableTraceLogger.Current, toString);\n\t\t}\n\n\t\tstatic string DefaultToStringShortened(object item)\n\t\t{\n\t\t\tvar str = DefaultToString(item);\n\t\t\tif (str.Length > 40)\n\t\t\t\treturn str.Substring(0, 40) + \"..\";\n\t\t\treturn str;\n\t\t}\n\n\t\tstatic string DefaultToString(object item)\n\t\t{\n\t\t\tif (item != null)\n\t\t\t{\n\t\t\t\tvar type = item.GetType();\n\t\t\t\tif (type == typeof(string))\n\t\t\t\t{\n\t\t\t\t\t// Surround with quotes to make recognizable as strings. Don't care about escaping for now.\n\t\t\t\t\treturn string.Format(\"\\\"{0}\\\"\", item);\n\t\t\t\t}\n\t\t\t\tif (type.IsArray)\n\t\t\t\t{\n\t\t\t\t\treturn \"[\" + string.Join(\",\", ((IEnumerable) item).Cast<object>().Select(DefaultToString)) + \"]\";\n\t\t\t\t}\n\t\t\t\treturn item.ToString();\n\t\t\t}\n\t\t\treturn \"(null)\";\n\t\t}\n\n\t\tclass ConnectableTraceOperator<T> : TraceOperator<T>, IConnectableObservable<T>\n\t\t{\n\t\t\tpublic ConnectableTraceOperator(\n\t\t\t\tIConnectableObservable<T> source,\n\t\t\t\tstring name,\n\t\t\t\tIObservableTraceLogger logger,\n\t\t\t\tFunc<T, string> itemToString) :\n\t\t\t\tbase(source, name, logger, itemToString) { }\n\n\t\t\tpublic IDisposable Connect()\n\t\t\t{\n\t\t\t\tIDisposable wrappedDisposer = null;\n\t\t\t\tLoggedInvoke(\n\t\t\t\t\t\"Connect()\",\n\t\t\t\t\t() => wrappedDisposer = new ConnectDisposer(((IConnectableObservable<T>) Source).Connect(), this));\n\t\t\t\treturn wrappedDisposer;\n\t\t\t}\n\n\t\t\tclass ConnectDisposer : IDisposable\n\t\t\t{\n\t\t\t\treadonly IDisposable _inner;\n\t\t\t\treadonly ConnectableTraceOperator<T> _parent;\n\n\t\t\t\tpublic ConnectDisposer(IDisposable inner, ConnectableTraceOperator<T> parent)\n\t\t\t\t{\n\t\t\t\t\t_inner = inner;\n\t\t\t\t\t_parent = parent;\n\t\t\t\t}\n\n\t\t\t\tpublic void Dispose()\n\t\t\t\t{\n\t\t\t\t\t_parent.LoggedInvoke(\"Dispose (disconnect)\", () => _inner.Dispose());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclass SubjectTraceOperator<T> : TraceOperator<T>, ISubject<T>\n\t\t{\n\t\t\treadonly ISubject<T> _subject;\n\t\t\tpublic SubjectTraceOperator(ISubject<T> subject, string name, IObservableTraceLogger logger, Func<T, string> itemToString)\n\t\t\t\t: base(subject, name, logger, itemToString)\n\t\t\t{\n\t\t\t\t_subject = subject;\n\t\t\t}\n\n\t\t\tpublic void OnNext(T value)\n\t\t\t{\n\t\t\t\tLoggedInvoke(string.Format(\"{0}({1})\", \"OnNext\", _itemToString(value)), () => _subject.OnNext(value));\n\t\t\t}\n\n\t\t\tpublic void OnError(Exception error)\n\t\t\t{\n\t\t\t\tLoggedInvoke(string.Format(\"{0}({1})\", \"OnError\", error.GetType()), () => _subject.OnError(error));\n\t\t\t}\n\n\t\t\tpublic void OnCompleted()\n\t\t\t{\n\t\t\t\tLoggedInvoke(string.Format(\"{0}()\", \"OnCompleted\"), () => _subject.OnCompleted());\n\t\t\t}\n\n\t\t}\n\n\t\tclass TraceOperator<T> : IObservable<T>\n\t\t{\n\t\t\treadonly IObservableTraceLogger _logger;\n\t\t\tprotected  readonly Func<T, string> _itemToString;\n\t\t\treadonly string _name;\n\t\t\treadonly IObservable<T> _source;\n\n\t\t\tprotected IObservable<T> Source\n\t\t\t{\n\t\t\t\tget { return _source; }\n\t\t\t}\n\n\t\t\tpublic TraceOperator(IObservable<T> source, string name, IObservableTraceLogger logger, Func<T, string> itemToString)\n\t\t\t{\n\t\t\t\t_source = source;\n\t\t\t\t_name = name;\n\t\t\t\t_logger = logger;\n\t\t\t\t_itemToString = itemToString;\n\t\t\t}\n\n\t\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t\t{\n\t\t\t\tIDisposable wrappedDisposer = null;\n\t\t\t\tvar id = _logger.NewObserverId();\n\t\t\t\tLoggedInvoke(\n\t\t\t\t\tstring.Format(\"{0}(..) -> #{1}\", \"Subscribe\", id),\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\twrappedDisposer = new TraceDisposer(this, _source.Subscribe(new TraceObserver(this, observer, id)), id);\n\t\t\t\t\t});\n\t\t\t\treturn wrappedDisposer;\n\t\t\t}\n\n\t\t\tprotected void LoggedInvoke(string message, Action action)\n\t\t\t{\n\t\t\t\t_logger.Log(string.Format(\"{0} {1}\", _name, message), action);\n\t\t\t}\n\n\t\t\tclass TraceObserver : IObserver<T>\n\t\t\t{\n\t\t\t\treadonly int _id;\n\t\t\t\treadonly IObserver<T> _inner;\n\t\t\t\treadonly TraceOperator<T> _parent;\n\n\t\t\t\tpublic TraceObserver(TraceOperator<T> parent, IObserver<T> inner, int id)\n\t\t\t\t{\n\t\t\t\t\t_parent = parent;\n\t\t\t\t\t_inner = inner;\n\t\t\t\t\t_id = id;\n\t\t\t\t}\n\n\t\t\t\tpublic void OnNext(T value)\n\t\t\t\t{\n\t\t\t\t\tLoggedInvoke(string.Format(\"{0}({1})\", \"OnNext\", _parent._itemToString(value)), () => _inner.OnNext(value));\n\t\t\t\t}\n\n\t\t\t\tpublic void OnError(Exception error)\n\t\t\t\t{\n\t\t\t\t\tLoggedInvoke(string.Format(\"{0}({1})\", \"OnError\", error.GetType()), () => _inner.OnError(error));\n\t\t\t\t}\n\n\t\t\t\tpublic void OnCompleted()\n\t\t\t\t{\n\t\t\t\t\tLoggedInvoke(string.Format(\"{0}()\", \"OnCompleted\"), () => _inner.OnCompleted());\n\t\t\t\t}\n\n\t\t\t\tvoid LoggedInvoke(string message, Action action)\n\t\t\t\t{\n\t\t\t\t\t_parent.LoggedInvoke(string.Format(\"(#{0}) {1}\", _id, message), action);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclass TraceDisposer : IDisposable\n\t\t\t{\n\t\t\t\treadonly int _id;\n\t\t\t\treadonly IDisposable _inner;\n\t\t\t\treadonly TraceOperator<T> _parent;\n\n\t\t\t\tpublic TraceDisposer(TraceOperator<T> parent, IDisposable inner, int id)\n\t\t\t\t{\n\t\t\t\t\t_parent = parent;\n\t\t\t\t\t_inner = inner;\n\t\t\t\t\t_id = id;\n\t\t\t\t}\n\n\n\t\t\t\tpublic void Dispose()\n\t\t\t\t{\n\t\t\t\t\t_parent.LoggedInvoke(string.Format(\"(#{0}) {1}()\", _id, \"Dispose\"), () => _inner.Dispose());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/ManualProfiling.cs",
    "content": "﻿using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\n\nnamespace Outracks\n{\n\t/// <summary>\n\t/// Contains thread safe manual profiling functions.\n\t//\tWe can't make a calltree because of the fact that there are no way to get the parent thread.\n\t/// </summary>\n\tpublic static class ManualProfiling\n\t{\n\t\tstatic readonly ConcurrentBag<ProfilingEvent> _events = new ConcurrentBag<ProfilingEvent>();\n\n\t\tpublic static Func<T, T> Count<T>(string name)\n\t\t{\n\t\t\treturn t =>\n\t\t\t{\n\t\t\t\tCount(name);\n\t\t\t\treturn t;\n\t\t\t};\n\t\t}\n\n\t\tpublic static Func<T, T> Count<T>(string name, Func<T, bool> count)\n\t\t{\n\t\t\treturn t =>\n\t\t\t{\n\t\t\t\tCount(name, count(t));\n\t\t\t\treturn t;\n\t\t\t};\n\t\t}\n\n\t\tstatic readonly ConcurrentQueue<string> Counts = new ConcurrentQueue<string>();\n\n\t\tpublic static void Count(string name, bool count = true)\n\t\t{\n\t\t\tif (!count) return;\n\t\t\tCounts.Enqueue(name);\n\t\t}\n\n\t\tpublic static int GetCount(string name)\n\t\t{\n\t\t\treturn Counts.Count(c => c == name);\n\t\t}\n\n\n\t\tpublic static IDisposable Push(\n\t\t\t[CallerMemberName] string memberName = \"\",\n\t\t\t[CallerFilePath] string sourceFilePath = \"\",\n\t\t\t[CallerLineNumber] int sourceLineNumber = 0)\n\t\t{\n\t\t\tvar startEvent = ProfilingEvent.Push(\n\t\t\t\tThread.CurrentThread.ManagedThreadId,\n\t\t\t\tnew CallerInfo(memberName, sourceFilePath, sourceLineNumber),\n\t\t\t\tDateTime.Now.Ticks);\n\t\t\t_events.Add(startEvent);\n\n\t\t\treturn Disposable.Create(() => _events.Add(ProfilingEvent.Pop(startEvent, DateTime.Now.Ticks)));\n\t\t}\n\n\t\tpublic static T Profile<T>(Func<T> function,\n\t\t\t[CallerMemberName] string memberName = \"\",\n\t\t\t[CallerFilePath] string sourceFilePath = \"\",\n\t\t\t[CallerLineNumber] int sourceLineNumber = 0)\n\t\t{\n\t\t\tusing (Push(memberName, sourceFilePath, sourceLineNumber))\n\t\t\t\treturn function();\n\t\t}\n\n\t\tpublic static Dictionary<CallerInfo, List<ProfilingResult>> GetProfilingResults()\n\t\t{\n\t\t\tvar profilingResult = new Dictionary<CallerInfo, List<ProfilingResult>>();\n\t\t\tvar eventsAtCurrentTime = _events.ToArray();\n\t\t\tforeach (var popEvent in eventsAtCurrentTime.OfType<ProfilingEventPop>())\n\t\t\t{\n\t\t\t\tif(!profilingResult.ContainsKey(popEvent.CallerInfo))\n\t\t\t\t\tprofilingResult.Add(popEvent.CallerInfo, new List<ProfilingResult>());\n\n\t\t\t\tprofilingResult[popEvent.CallerInfo].Add(new ProfilingResult(popEvent.StartTime, popEvent.TimeSpan, popEvent.ThreadId));\n\t\t\t}\n\n\t\t\treturn profilingResult;\n\t\t}\n\n\t\tpublic static void DumpAverageAsCSV(StreamWriter writer)\n\t\t{\n\t\t\tvar results = GetProfilingResults();\n\t\t\twriter.WriteLine(\"MethodName,Source Path,Source Line,Average Time Used(seconds)\");\n\t\t\tforeach (var result in results)\n\t\t\t{\n\t\t\t\tvar callInfo = result.Key;\n\t\t\t\tvar avg = 0.0;\n\t\t\t\tforeach (var call in result.Value)\n\t\t\t\t{\n\t\t\t\t\tavg += call.TimeUsed.TotalSeconds;\n\t\t\t\t}\n\n\t\t\t\tavg /= result.Value.Count;\n\t\t\t\twriter.WriteLine(\"{0},{1},{2},{3}\",\n\t\t\t\t\tcallInfo.Name,\n\t\t\t\t\tcallInfo.SourceFilePath,\n\t\t\t\t\tcallInfo.SourceLineNumber,\n\t\t\t\t\tavg.ToString(new NumberFormatInfo()));\n\t\t\t}\n\t\t}\n\n\t\tpublic static void DumpCallCountAsCSV(StreamWriter writer)\n\t\t{\n\t\t\tvar results = GetProfilingResults();\n\t\t\twriter.WriteLine(\"MethodName,Source Path,Source Line,Call Count\");\n\t\t\tforeach (var result in results)\n\t\t\t{\n\t\t\t\tvar callInfo = result.Key;\n\t\t\t\twriter.WriteLine(\"{0},{1},{2},{3}\",\n\t\t\t\t\tcallInfo.Name,\n\t\t\t\t\tcallInfo.SourceFilePath,\n\t\t\t\t\tcallInfo.SourceLineNumber,\n\t\t\t\t\tresult.Value.Count);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void DumpTimeUsedIndependentAsCSV(StreamWriter writer)\n\t\t{\n\t\t\tvar results = GetProfilingResults();\n\t\t\twriter.WriteLine(\"MethodName,Source Path,Source Line,ThreadId,Started,Time Used\");\n\t\t\tforeach (var result in results)\n\t\t\t{\n\t\t\t\tvar callInfo = result.Key;\n\t\t\t\tforeach (var call in result.Value)\n\t\t\t\t{\n\t\t\t\t\twriter.WriteLine(\n\t\t\t\t\t\t\"{0},{1},{2},{3},{4},{5}\",\n\t\t\t\t\t\tcallInfo.Name,\n\t\t\t\t\t\tcallInfo.SourceFilePath,\n\t\t\t\t\t\tcallInfo.SourceLineNumber,\n\t\t\t\t\t\tcall.ThreadId,\n\t\t\t\t\t\tcall.Started.ToString(new DateTimeFormatInfo()),\n\t\t\t\t\t\tcall.TimeUsed.TotalSeconds.ToString(new NumberFormatInfo()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/core/Diagnostics/ObservableTraceLogger.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\n\nnamespace Outracks\n{\n\tpublic interface IObservableTraceLogger : IDisposable\n\t{\n\t\tint NewObserverId();\n\t\tvoid Log(string str, Action action);\n\t}\n\n\tpublic static class ObservableTraceLogger\n\t{\n\t\tstatic IObservableTraceLogger _current;\n\n\t\t/// <summary>\n\t\t/// Default <see cref=\"ObservableTraceLogger\"/> for current <see cref=\"System.Threading.Thread\"/>\n\t\t/// </summary>\n\t\tpublic static IObservableTraceLogger Current\n\t\t{\n\t\t\tget { return _current ?? (_current = new MultiThreadLogger(Console.Out)); }\n\t\t\tset { _current = value; }\n\t\t}\n\n\t\tpublic static IObservableTraceLogger Create(TextWriter writer, bool measure = true, bool lineBufferingEnabled = true, bool disposeWriter = false)\n\t\t{\n\t\t\treturn new MultiThreadLogger(writer, measure, lineBufferingEnabled, disposeWriter);\n\t\t}\n\n\t\tclass MultiThreadLogger : IObservableTraceLogger\n\t\t{\n\t\t\tint _observerIdCounter;\n\t\t\treadonly ThreadLocal<IObservableTraceLogger> _currentThreadLogger;\n\n\t\t\tpublic MultiThreadLogger(TextWriter writer, bool measure = true, bool lineBufferingEnabled = true, bool disposeWriter = false)\n\t\t\t{\n\t\t\t\t_currentThreadLogger = new ThreadLocal<IObservableTraceLogger>(() => new SingleThreadLogger(writer, measure, lineBufferingEnabled, disposeWriter));\n\t\t\t}\n\n\t\t\tpublic int NewObserverId()\n\t\t\t{\n\t\t\t\treturn Interlocked.Increment(ref _observerIdCounter);\n\t\t\t}\n\n\t\t\tpublic void Log(string str, Action action)\n\t\t\t{\n\t\t\t\t_currentThreadLogger.Value.Log(str, action);\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\t_currentThreadLogger.Dispose();\n\t\t\t}\n\t\t}\n\n\t\tclass SingleThreadLogger : IObservableTraceLogger\n\t\t{\n\t\t\treadonly TextWriter _writer;\n\t\t\treadonly bool _measure;\n\t\t\treadonly bool _lineBufferingEnabled;\n\t\t\treadonly bool _disposeWriter;\n\t\t\tint _logIndentCount;\n\t\t\tint _observerIdCounter;\n\t\t\tbool _pendingLineBreak;\n\t\t\treadonly StringBuilder _lineBuffer = new StringBuilder();\n\n\t\t\tpublic SingleThreadLogger(TextWriter writer, bool measure = true, bool lineBufferingEnabled = true, bool disposeWriter = false)\n\t\t\t{\n\t\t\t\t_writer = writer;\n\t\t\t\t_measure = measure;\n\t\t\t\t_lineBufferingEnabled = lineBufferingEnabled;\n\t\t\t\t_disposeWriter = disposeWriter;\n\t\t\t}\n\n\t\t\tpublic int NewObserverId()\n\t\t\t{\n\t\t\t\treturn _observerIdCounter++;\n\t\t\t}\n\n\t\t\tpublic void Log(string message, Action action)\n\t\t\t{\n\t\t\t\tvar sw = _measure ? Optional.Some(Stopwatch.StartNew()) : Optional.None();\n\t\t\t\tvar indent = String.Concat(Enumerable.Repeat(\"|   \", _logIndentCount));\n\t\t\t\t_logIndentCount++;\n\t\t\t\tException thrownException = null;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tEndLine();\n\t\t\t\t\tAppend(\"T{0} Enter  {1}{2}\", Thread.CurrentThread.ManagedThreadId, indent, message);\n\t\t\t\t\taction();\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tthrownException = ex;\n\t\t\t\t\tthrow;\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tvar writeExitLine = !_pendingLineBreak;\n\t\t\t\t\tif (writeExitLine)\n\t\t\t\t\t{\n\t\t\t\t\t\tAppend(\"T{0} Exit   {1}{2}\", Thread.CurrentThread.ManagedThreadId, indent, message);\n\t\t\t\t\t}\n\t\t\t\t\tif (thrownException != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tAppend(\" !!{0}({1})\", thrownException.GetType().Name, thrownException.Message);\n\t\t\t\t\t}\n\t\t\t\t\tif (sw.HasValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar ms = sw.Value.Elapsed.TotalMilliseconds;\n\t\t\t\t\t\tif (ms < 1)\n\t\t\t\t\t\t\tAppend(\" {0}μs\", ms * 1000.0);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tAppend(\" {0}ms\", ms);\n\t\t\t\t\t}\n\t\t\t\t\tEndLine();\n\t\t\t\t\t_logIndentCount--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid Append(string format, params object[] args)\n\t\t\t{\n\t\t\t\t_pendingLineBreak = true;\n\t\t\t\tif (_lineBufferingEnabled)\n\t\t\t\t{\n\t\t\t\t\t_lineBuffer.AppendFormat(format, args);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_writer.Write(format, args);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid EndLine()\n\t\t\t{\n\t\t\t\tif (_pendingLineBreak)\n\t\t\t\t{\n\t\t\t\t\t_writer.Write(_lineBuffer);\n\t\t\t\t\t_writer.WriteLine();\n\t\t\t\t\t_lineBuffer.Clear();\n\t\t\t\t\t_pendingLineBreak = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tif (_disposeWriter)\n\t\t\t\t\t_writer.Dispose();\n\t\t\t}\n\n\t\t}\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/Platform.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Runtime.InteropServices;\n\nnamespace Outracks.Diagnostics\n{\n\tpublic enum OS\n\t{\n\t\tWindows,\n\t\tMac,\n\t\tX11,\n\t\tOther\n\t}\n\n\tpublic static class Platform\n\t{\n\t\tpublic static readonly Version WindowsVista = new Version(6, 0);\n\t\tpublic static readonly Version Windows8_1 = new Version(6, 3);\n\t\tpublic static readonly Version ElCapitan = new Version(10, 11);\n\t\tpublic static readonly OS OperatingSystem;\n\t\tpublic static readonly Version OperatingSystemVersion;\n\t\tpublic static readonly bool IsMac;\n\t\tpublic static readonly bool IsWindows;\n\n\t\tstatic Platform ()\n\t\t{\n\t\t\tif (Path.DirectorySeparatorChar == '\\\\')\n\t\t\t{\n\t\t\t\tIsWindows = true;\n\t\t\t\tOperatingSystem = OS.Windows;\n\t\t\t\tOperatingSystemVersion = Environment.OSVersion.Version;\n\t\t\t}\n\t\t\telse if (IsRunningOnMac())\n\t\t\t{\n\t\t\t\tIsMac = true;\n\t\t\t\tOperatingSystem = OS.Mac;\n\t\t\t\tOperatingSystemVersion = GetOperatingSystemVersionOSX();\n\t\t\t}\n\t\t\telse if (Environment.OSVersion.Platform == PlatformID.Unix)\n\t\t\t{\n\t\t\t\tOperatingSystem = OS.X11;\n\t\t\t}\n\t\t\telse\n\t\t\t\tOperatingSystem = OS.Other;\n\t\t}\n\n\t\t[DllImport(\"libc\")]\n\t\tstatic extern int uname(IntPtr buf);\n\n\t\t// Copied from https://github.com/jpobst/Pinta/blob/master/Pinta.Core/Managers/SystemManager.cs\n\t\tstatic bool IsRunningOnMac ()\n\t\t{\n\t\t\tIntPtr buf = IntPtr.Zero;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbuf = Marshal.AllocHGlobal (8192);\n\t\t\t\t// This is a hacktastic way of getting sysname from uname ()\n\t\t\t\tif (uname (buf) == 0)\n\t\t\t\t{\n\t\t\t\t\tstring os = Marshal.PtrToStringAnsi (buf);\n\t\t\t\t\tif (os == \"Darwin\")\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tif (buf != IntPtr.Zero)\n\t\t\t\t\tMarshal.FreeHGlobal (buf);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static Version GetOperatingSystemVersionOSX()\n\t\t{\n\t\t\tvar swProductVersion = Process.Start(new ProcessStartInfo()\n\t\t\t{\n\t\t\t\tUseShellExecute = false,\n\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\tFileName = \"sw_vers\",\n\t\t\t\tArguments = \"-productVersion\",\n\t\t\t});\n\n\t\t\tvar version = swProductVersion.StandardOutput.ReadToEnd().TrimEnd();\n\n\t\t\treturn new Version(version);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Diagnostics/ProfilingEvent.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tabstract class ProfilingEvent\n\t{\n\t\tpublic readonly long Ticks;\n\t\tprotected ProfilingEvent(long ticks)\n\t\t{\n\t\t\tTicks = ticks;\n\t\t}\n\n\t\tpublic static ProfilingEventPush Push(int threadId, CallerInfo callerInfo, long startTicks)\n\t\t{\n\t\t\treturn new ProfilingEventPush(threadId, callerInfo, startTicks);\n\t\t}\n\n\t\tpublic static ProfilingEventPop Pop(ProfilingEventPush push, long endTicks)\n\t\t{\n\t\t\treturn new ProfilingEventPop(push, endTicks);\n\t\t}\n\t}\n\n\tclass ProfilingEventPush : ProfilingEvent\n\t{\n\t\tpublic readonly int ThreadId;\n\t\tpublic readonly CallerInfo CallerInfo;\n\n\t\tpublic ProfilingEventPush(int threadId, CallerInfo callerInfo, long ticks)\n\t\t\t: base(ticks)\n\t\t{\n\t\t\tThreadId = threadId;\n\t\t\tCallerInfo = callerInfo;\n\t\t}\n\t}\n\n\tclass ProfilingEventPop : ProfilingEvent\n\t{\n\t\treadonly ProfilingEventPush _push;\n\n\t\tpublic TimeSpan TimeSpan\n\t\t{\n\t\t\tget { return TimeSpan.FromTicks(Ticks - _push.Ticks); }\n\t\t}\n\n\t\tpublic CallerInfo CallerInfo\n\t\t{\n\t\t\tget { return _push.CallerInfo; }\n\t\t}\n\n\t\tpublic DateTime StartTime\n\t\t{\n\t\t\tget { return new DateTime(_push.Ticks); }\n\t\t}\n\n\t\tpublic int ThreadId\n\t\t{\n\t\t\tget { return _push.ThreadId; }\n\t\t}\n\n\t\tpublic ProfilingEventPop(ProfilingEventPush push, long ticks)\n\t\t\t: base(ticks)\n\t\t{\n\t\t\t_push = push;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/ProfilingResult.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic class ProfilingResult\n\t{\n\t\tpublic readonly DateTime Started;\n\t\tpublic readonly TimeSpan TimeUsed;\n\t\tpublic readonly int ThreadId;\n\n\t\tpublic ProfilingResult(DateTime started, TimeSpan timeUsed, int threadId)\n\t\t{\n\t\t\tStarted = started;\n\t\t\tTimeUsed = timeUsed;\n\t\t\tThreadId = threadId;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/Reactive/IObservableTraceHandler.cs",
    "content": "using System;\n\nnamespace Outracks.Diagnostics.Reactive\n{\n\tpublic interface IObservableTraceHandler\n\t{\n\t\tTOut Trace<TIn, TOut>(TIn source, Func<TIn, TOut> factory, ObservableTraceInfo info);\n\t}\n}"
  },
  {
    "path": "src/common/core/Diagnostics/Reactive/ObservableTraceInfo.cs",
    "content": "﻿using System.Diagnostics;\nusing System.Text;\n\nnamespace Outracks.Diagnostics.Reactive\n{\n\t[DebuggerDisplay(\"{_rxMethodName,nq} called from {_callerFilePath,nq}:{_callerLineNumber,nq}\")]\n\tpublic class ObservableTraceInfo\n\t{\n\t\tprotected bool Equals(ObservableTraceInfo other)\n\t\t{\n\t\t\treturn string.Equals(_rxMethodName, other._rxMethodName) && string.Equals(_callerFilePath, other._callerFilePath) &&\n\t\t\t\t_callerLineNumber == other._callerLineNumber;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\tif (obj.GetType() != GetType()) return false;\n\t\t\treturn Equals((ObservableTraceInfo) obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tvar hashCode = (_rxMethodName != null ? _rxMethodName.GetHashCode() : 0);\n\t\t\t\thashCode = (hashCode * 397) ^ (_callerFilePath != null ? _callerFilePath.GetHashCode() : 0);\n\t\t\t\thashCode = (hashCode * 397) ^ _callerLineNumber;\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(ObservableTraceInfo left, ObservableTraceInfo right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(ObservableTraceInfo left, ObservableTraceInfo right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\treadonly string _rxMethodName;\n\n\t\tpublic string MethodName\n\t\t{\n\t\t\tget { return _rxMethodName; }\n\t\t}\n\n\t\tpublic string CallerFilePath\n\t\t{\n\t\t\tget { return _callerFilePath; }\n\t\t}\n\n\t\tpublic int CallerLineNumber\n\t\t{\n\t\t\tget { return _callerLineNumber; }\n\t\t}\n\n\t\treadonly string _callerFilePath;\n\t\treadonly int _callerLineNumber;\n\n\t\tpublic ObservableTraceInfo(string rxMethodName, string callerFilePath, int callerLineNumber)\n\t\t{\n\t\t\t_rxMethodName = rxMethodName;\n\t\t\t_callerFilePath = callerFilePath;\n\t\t\t_callerLineNumber = callerLineNumber;\n\t\t}\n\n\t\tpublic void AppendString(StringBuilder stringBuilder)\n\t\t{\n\t\t\tstringBuilder.AppendFormat(\"{0} called from {1}:{2}\", _rxMethodName, _callerFilePath, _callerLineNumber);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tAppendString(sb);\n\t\t\treturn sb.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Disposable.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class Disposable\n\t{\n\t\tpublic static IDisposable Combine(IEnumerable<IDisposable> disposables)\n\t\t{\n\t\t\treturn Combine(disposables.ToArray());\n\t\t}\n\n\t\tpublic static IDisposable Combine(params IDisposable[] disposables)\n\t\t{\n\t\t\treturn Create(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tException exception = null;\n\t\t\t\t\tfor (int i = disposables.Length; i-- > 0; )\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisposables[i].Dispose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texception = e;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (exception != null)\n\t\t\t\t\t\texception.RethrowWithStackTrace();\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IDisposable Create(Action dispose)\n\t\t{\n\t\t\treturn System.Reactive.Disposables.Disposable.Create(dispose);\n\t\t}\n\n\t\tpublic static IDisposable Empty\n\t\t{\n\t\t\tget { return System.Reactive.Disposables.Disposable.Empty; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Either.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic class Either<TL, TR>\n\t{\n\t\treadonly TL _left;\n\t\treadonly TR _right;\n\n\t\treadonly bool _isLeft;\n\n\t\tpublic Either(TL left)\n\t\t{\n\t\t\t_isLeft = true;\n\t\t\t_left = left;\n\t\t}\n\n\t\tpublic Either(TR right)\n\t\t{\n\t\t\t_isLeft = false;\n\t\t\t_right = right;\n\t\t}\n\n\t\tpublic T Match<T>(Func<TL, T> onLeft, Func<TR, T> onRight)\n\t\t{\n\t\t\treturn _isLeft ? onLeft(_left) : onRight(_right);\n\t\t}\n\n\t\tpublic void Match(Action<TL> onLeft, Action<TR> onRight)\n\t\t{\n\t\t\tif (_isLeft)\n\t\t\t\tonLeft(_left);\n\t\t\telse\n\t\t\t\tonRight(_right);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/EqualityComparer.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Outracks\n{\n\tpublic static class EqualityComparer\n\t{\n\t\tpublic static IEqualityComparer<T> CreateDefault<T>(Func<T, object> getIdentity)\n\t\t{\n\t\t\treturn Create<T>((a, b) => getIdentity(a).Equals(getIdentity(b)), a => getIdentity(a).GetHashCode());\n\t\t}\n\n\t\tpublic static IEqualityComparer<T> Create<T>(Func<T, T, bool> equals, Func<T, int> getHashCode)\n\t\t{\n\t\t\treturn new AnonymousEqualityComparer<T>(equals, getHashCode);\n\t\t}\n\n\t}\n\n\tclass AnonymousEqualityComparer<T> : IEqualityComparer<T>\n\t{\n\t\treadonly Func<T, T, bool> _equals;\n\t\treadonly Func<T, int> _getHashCode;\n\t\tpublic AnonymousEqualityComparer(Func<T, T, bool> equals, Func<T, int> getHashCode)\n\t\t{\n\t\t\t_equals = equals;\n\t\t\t_getHashCode = getHashCode;\n\t\t}\n\n\t\tpublic bool Equals(T x, T y)\n\t\t{\n\t\t\treturn _equals(x, y);\n\t\t}\n\n\t\tpublic int GetHashCode(T obj)\n\t\t{\n\t\t\treturn _getHashCode(obj);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/BufferPrevious.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic class PreviousCurrentTuple<T>\n\t{\n\t\tpublic readonly T Previous;\n\t\tpublic readonly T Current;\n\n\t\tpublic PreviousCurrentTuple(T previous, T current)\n\t\t{\n\t\t\tPrevious = previous;\n\t\t\tCurrent = current;\n\t\t}\n\t}\n\n\tpublic class OptionalPreviousCurrentTuple<T>\n\t{\n\t\tpublic readonly Optional<T> Previous;\n\t\tpublic readonly T Current;\n\n\t\tpublic OptionalPreviousCurrentTuple(Optional<T> previous, T current)\n\t\t{\n\t\t\tPrevious = previous;\n\t\t\tCurrent = current;\n\t\t}\n\t}\n\n\tpublic static class BufferPreviousExtensions\n\t{\n\t\tpublic static IObservable<PreviousCurrentTuple<T>> BufferPrevious<T>(this IObservable<T> self, T seed)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.StartWith(seed)\n\t\t\t\t.Buffer(2, 1)\n\t\t\t\t.Where(l => l.Count == 2)\n\t\t\t\t.Select(list => new PreviousCurrentTuple<T>(list[0], list[1]));\n\t\t}\n\n\t\tpublic static IObservable<OptionalPreviousCurrentTuple<T>> BufferPrevious<T>(this IObservable<T> self)\n\t\t{\n\t\t\treturn Observable.Create<OptionalPreviousCurrentTuple<T>>(\n\t\t\t\tobserver =>\n\t\t\t\t{\n\t\t\t\t\tvar previous = Optional.None<T>();\n\t\t\t\t\treturn self\n\t\t\t\t\t\t.Select(current =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar ret = new OptionalPreviousCurrentTuple<T>(previous, current);\n\t\t\t\t\t\t\tprevious = current;\n\t\t\t\t\t\t\treturn ret;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.Subscribe(observer);\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static Optional<TResult> ChangesTo<TArgs, TResult>(\n\t\t\tthis OptionalPreviousCurrentTuple<TArgs> self,\n\t\t\tFunc<TArgs, TResult> select)\n\t\t{\n\t\t\tvar prev = self.Previous.Select(select);\n\t\t\tvar cur = select(self.Current);\n\t\t\tif (prev.Equals(cur))\n\t\t\t\treturn Optional.None();\n\t\t\treturn cur;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/EnumerableDiffing.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class EnumerableDiffing\n\t{\n\t\tpublic static IObservable<DiffSequenceResult<T>> DiffSequence<T>(this IObservable<IEnumerable<T>> self, IEqualityComparer<T> comparer = null)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.Select(ImmutableList.CreateRange)\n\t\t\t\t.DiffSequence(comparer);\n\t\t}\n\n\t\tpublic static IObservable<DiffSequenceResult<T>> DiffSequence<T>(this IObservable<IImmutableList<T>> self, IEqualityComparer<T> comparer = null)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.BufferPrevious(ImmutableList<T>.Empty)\n\t\t\t\t.Select(lists => lists.Current.DiffSequence(lists.Previous, comparer));\n\t\t}\n\n\t\tpublic static IObservable<DiffSetResult<T>> DiffSet<T>(this IObservable<IEnumerable<T>> self, IEqualityComparer<T> comparer = null)\n\t\t{\n\t\t\treturn DiffSet(self.Select(e => e.ToImmutableHashSet()), comparer);\n\t\t}\n\n\t\tpublic static IObservable<DiffSetResult<T>> DiffSet<T>(this IObservable<IImmutableSet<T>> self, IEqualityComparer<T> comparer = null)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.BufferPrevious(ImmutableHashSet<T>.Empty)\n\t\t\t\t.Select(diff => diff.Current.DiffWith(diff.Previous, comparer));\n\t\t}\n\n\n\t\tpublic static DiffSetResult<T> DiffWith<T>(this IImmutableSet<T> current, IImmutableSet<T> previous, IEqualityComparer<T> equalityComparer = null)\n\t\t{\n\t\t\tvar comparer = equalityComparer ?? EqualityComparer<T>.Default;\n\t\t\treturn new DiffSetResult<T>(\n\t\t\t\tcurrent.Except(previous, comparer).ToImmutableHashSet(),\n\t\t\t\tprevious.Except(current, comparer).ToImmutableHashSet(),\n\t\t\t\tcurrent);\n\t\t}\n\n\t\tpublic static DiffSequenceResult<T> DiffSequence<T>(this IImmutableList<T> current, IImmutableList<T> previous, IEqualityComparer<T> equalityComparer = null)\n\t\t{\n\t\t\tvar comparer = equalityComparer ?? EqualityComparer<T>.Default;\n\t\t\tvar previousSet = previous.ToImmutableHashSet();\n\t\t\tvar currentSet = current.ToImmutableHashSet();\n\t\t\treturn new DiffSequenceResult<T>(\n\t\t\t\tcurrent.RemoveAll(e => previousSet.Contains(e, comparer)).ToImmutableList(),\n\t\t\t\tprevious.RemoveAll(e => currentSet.Contains(e, comparer)).ToImmutableList(),\n\t\t\t\tcurrent,\n\t\t\t\tprevious);\n\t\t}\n\n\t}\n\n\tpublic sealed class DiffSequenceResult<T>\n\t{\n\t\tpublic readonly IImmutableList<T> Added;\n\n\t\tpublic readonly IImmutableList<T> Removed;\n\n\t\tpublic readonly IImmutableList<T> Current;\n\n\t\tpublic readonly IImmutableList<T> Previous;\n\n\t\tpublic DiffSequenceResult(IImmutableList<T> added, IImmutableList<T> removed, IImmutableList<T> current, IImmutableList<T> previous)\n\t\t{\n\t\t\tRemoved = removed;\n\t\t\tCurrent = current;\n\t\t\tPrevious = previous;\n\t\t\tAdded = added;\n\t\t}\n\t}\n\tpublic sealed class DiffSetResult<T>\n\t{\n\t\tpublic readonly IImmutableSet<T> Added;\n\n\t\tpublic readonly IImmutableSet<T> Removed;\n\n\t\tpublic readonly IImmutableSet<T> Current;\n\n\t\tpublic DiffSetResult(ImmutableHashSet<T> added, ImmutableHashSet<T> removed, IImmutableSet<T> current)\n\t\t{\n\t\t\tRemoved = removed;\n\t\t\tCurrent = current;\n\t\t\tAdded = added;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/core/Extensions/EnumerableExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class EachExtension\n    {\n\t\t// TODO: i'm considering inlining this, as it hides the loop-with-side-effects construct, which should be visible -L\n        public static void Each<T>(this IEnumerable<T> enumerable, Action<T> action)\n        {\n            foreach (T item in enumerable)\n                action(item);\n        }\n    }\n\n\tpublic static class EnumerableExtensions\n\t{\n\t\tpublic static T FirstOr<T>(this IEnumerable<T> self, T element)\n\t\t{\n\t\t\treturn self.FirstOrNone().Or(element);\n\t\t}\n\n\t\tpublic static T FirstOr<T>(this IEnumerable<T> self, Func<T> element)\n\t\t{\n\t\t\treturn self.FirstOrNone().Or(element);\n\t\t}\n\n\t\tpublic static Optional<T> FirstOrNone<T>(this IEnumerable<T> self, Func<T, bool> where)\n\t\t{\n\t\t\tvar it = self.Where(where).GetEnumerator();\n\t\t\treturn !it.MoveNext()\n\t\t\t\t? Optional.None<T>()\n\t\t\t\t: Optional.Some(it.Current);\n\t\t}\n\n\t\tpublic static Optional<T> FirstOrNone<T>(this IEnumerable<T> self)\n\t\t{\n\t\t\tvar it = self.GetEnumerator();\n\t\t\treturn !it.MoveNext()\n\t\t\t\t? Optional.None<T>()\n\t\t\t\t: Optional.Some(it.Current);\n\t\t}\n\n\t\tpublic static T LastOr<T>(this IEnumerable<T> self, T element)\n\t\t{\n\t\t\treturn self.LastOrNone().Or(element);\n\t\t}\n\n\t\tpublic static Optional<T> LastOrNone<T>(this IEnumerable<T> self)\n\t\t{\n\t\t\tvar it = self.GetEnumerator();\n\t\t\tvar current = Optional.None<T>();\n\t\t\twhile (it.MoveNext())\n\t\t\t\tcurrent = it.Current;\n\t\t\treturn current;\n\t\t}\n\n\t\tpublic static IEnumerable<T> Yield<T>(this T item)\n\t\t{\n\t\t\tyield return item;\n\t\t}\n\t}\n\n\tpublic static class EnumerableNullHandling\n\t{\n\t\tpublic static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> self)\n\t    {\n\t\t    return self ?? new T[0];\n\t    }\n\n        public static IEnumerable<T> NotNull<T>(this IEnumerable<T> self) where T : class\n        {\n            return self.Where(s => s != null);\n        }\n\n\t    public static T[] NullSafeToArray<T>(this IEnumerable<T> self)\n\t    {\n\t\t    return self == null ? new T[0] : self.ToArray();\n\t    }\n    }\n}\n"
  },
  {
    "path": "src/common/core/Extensions/EnumerableIndexing.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class EnumerableIndexing\n\t{\n\t\tpublic static int IndexOf<T>(this IEnumerable<T> items, T itemToFind)\n\t\t{\n\t\t\treturn items.IndexOfFirst<T>(item => item.Equals(itemToFind));\n\t\t}\n\n\t\tpublic static int IndexOfFirst<T>(this IEnumerable<T> items, Predicate<T> where)\n\t\t{\n\t\t\tvar i = 0;\n\t\t\tforeach (var item in items)\n\t\t\t{\n\t\t\t\tif (where(item))\n\t\t\t\t\treturn i;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic static bool None<T>(this IEnumerable<T> items, Func<T, bool> predicate)\n\t\t{\n\t\t\treturn !items.Any(predicate);\n\t\t}\n\n\t\tpublic static bool IsEmpty<T>(this IEnumerable<T> items)\n\t\t{\n\t\t\treturn !items.Any();\n\t\t}\n\n\t\tpublic static bool IsSingle<T>(this IEnumerable<T> items)\n\t\t{\n\t\t\treturn items.HasCount(1);\n\t\t}\n\n\t\tpublic static bool HasCount<T>(this IEnumerable<T> items, int count)\n\t\t{\n\t\t\tint c = 0;\n\t\t\tforeach (var item in items)\n\t\t\t{\n\t\t\t\tc++;\n\t\t\t\tif (c > count) return false;\n\t\t\t}\n\t\t\treturn c == count;\n\t\t}\n\n\t\tpublic static Optional<T> TryRemoveAt<T>(\n\t\t\tthis IList<T> args,\n\t\t\tint index)\n\t\t{\n\t\t\tif (args.Count <= index)\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar item = args[index];\n\t\t\targs.RemoveAt(index);\n\t\t\treturn item;\n\t\t}\n\n\t\tpublic static Optional<T> TryGetAt<T>(\n\t\t\tthis IEnumerable<T> args,\n\t\t\tint index)\n\t\t{\n\t\t\tvar enumerator = args.GetEnumerator();\n\n\t\t\tfor (int i = 0; i < index + 1; i++)\n\t\t\t\tif (!enumerator.MoveNext())\n\t\t\t\t\treturn Optional.None();\n\n\t\t\treturn enumerator.Current;\n\t\t}\n\n\n\t\tpublic static Optional<TResult> TryGetAt<TArgs, TResult>(\n\t\t\tthis IEnumerable<TArgs> args,\n\t\t\tint index,\n\t\t\tFunc<TArgs, TResult> transform)\n\t\t{\n\t\t\tvar enumerator = args.GetEnumerator();\n\n\t\t\tfor (int i = 0; i < index + 1; i++)\n\t\t\t\tif (!enumerator.MoveNext())\n\t\t\t\t\treturn Optional.None();\n\n\t\t\treturn transform(enumerator.Current);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/EnumerableJoin.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class EnumerableJoin\n\t{\n\t\tpublic static IEnumerable<T> Join<T>(this IEnumerable<IEnumerable<T>> groups)\n\t\t{\n\t\t\treturn groups.SelectMany(g => g);\n\t\t}\n\n\t\tpublic static IEnumerable<T> Join<T>(this IEnumerable<IEnumerable<T>> groups, params T[] seperatorElements)\n\t\t{\n\t\t\treturn Join(groups, () => seperatorElements);\n\t\t}\n\n\t\tpublic static IEnumerable<T> Join<T>(this IEnumerable<T> items, Func<T> seperatorElement)\n\t\t{\n\t\t\treturn Join(items.Select(i => (IEnumerable<T>)new [] { i }), () => new[] { seperatorElement() });\n\t\t}\n\n\t\tpublic static IEnumerable<T> Join<T>(this IEnumerable<IEnumerable<T>> groups, Func<T> seperatorElement)\n\t\t{\n\t\t\treturn Join(groups, () => new [] { seperatorElement() });\n\t\t}\n\n\t\tstatic IEnumerable<T> Join<T>(this IEnumerable<IEnumerable<T>> groups, Func<IEnumerable<T>> seperatorElements)\n\t\t{\n\t\t\tvar e = groups.GetEnumerator();\n\t\t\tif (!e.MoveNext())\n\t\t\t{\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar first = e.Current;\n\t\t\tif (!e.MoveNext())\n\t\t\t{\n\t\t\t\tforeach (var item in first)\n\t\t\t\t\tyield return item;\n\t\t\t\tyield break;\n\t\t\t}\n\n\t\t\tvar second = e.Current; // TODO: figure out a way to reuse these elements without enumerating the enumerable again\n\n\t\t\tforeach (var item in first)\n\t\t\t\tyield return item;\n\n\t\t\tforeach (var group in groups.Skip(1))\n\t\t\t{\n\t\t\t\tforeach (var sep in seperatorElements())\n\t\t\t\t\tyield return sep;\n\n\t\t\t\tforeach (var item in group)\n\t\t\t\t\tyield return item;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/EnumerableSetOperations.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class EnumerableSetOperations\n\t{\n\t\tpublic static bool SetEquals<T>(this IEnumerable<T> items, IEnumerable<T> others)\n\t\t{\n\t\t\treturn new HashSet<T>(items).SetEquals(others);\n\t\t}\n\n\t\tpublic static IEnumerable<T> Intersect<T>(this IEnumerable<T> self, T item)\n\t\t{\n\t\t\treturn self.Intersect(new[] { item });\n\t\t}\n\n\t\tpublic static IEnumerable<T> UnionOne<T>(this IEnumerable<T> self, T item)\n\t\t{\n\t\t\treturn self.Union(new[] { item });\n\t\t}\n\n\t\tpublic static IEnumerable<T> ExceptOne<T>(this IEnumerable<T> self, T item)\n\t\t{\n\t\t\treturn self.Except(new[] { item });\n\t\t}\n\n\t\tpublic static IEnumerable<T> ConcatOne<T>(this IEnumerable<T> self, T item)\n\t\t{\n\t\t\treturn self.Concat(new[] { item });\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/ImmutableDictionaryExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class ImmutableListExtensions\n\t{\n\t\tpublic static IImmutableList<T> Take<T>(this IImmutableList<T> self, int count)\n\t\t{\n\t\t\treturn Enumerable.Take(self, count).ToImmutableList();\n\t\t}\n\t}\n\n\tpublic static class ImmutableDictionaryExtensions\n\t{\n\t\tpublic static Optional<TValue> TryGetTarget<TValue>(this WeakReference<TValue> weakReference) where TValue : class\n\t\t{\n\t\t\tTValue value;\n\t\t\tif (weakReference.TryGetTarget(out value))\n\t\t\t\treturn value;\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tpublic static IImmutableSet<T> RemoveAll<T>(this IImmutableSet<T> set, Func<T, bool> predicate)\n\t\t{\n\t\t\treturn set.Except(set.Where(predicate));\n\t\t}\n\n\t\tpublic static IImmutableList<T> Where<T>(this IImmutableList<T> self, Func<T, bool> predicate)\n\t\t{\n\t\t\treturn self.RemoveAll(t => !predicate(t));\n\t\t}\n\n\t\tpublic static IImmutableDictionary<TKey, TValue> Replace<TKey, TValue>(\n\t\t\tthis IImmutableDictionary<TKey, TValue> self,\n\t\t\tTKey key,\n\t\t\tFunc<TValue, TValue> transform)\n\t\t{\n\t\t\tvar oldValue = self[key];\n\t\t\tvar newValue = transform(oldValue);\n\t\t\treturn self.SetItem(key, newValue);\n\t\t}\n\t\tpublic static IImmutableDictionary<TKey, TValue> ReplaceAll<TKey, TValue>(\n\t\t\tthis IImmutableDictionary<TKey, TValue> self,\n\t\t\tFunc<TValue, TValue> transform)\n\t\t{\n\t\t\tvar res = self;\n\t\t\tforeach (var key in res.Keys)\n\t\t\t\tres = res.Replace(key, transform);\n\t\t\treturn res;\n\t\t}\n\t\tpublic static IImmutableSet<TValue> Replace<TValue>(\n\t\t\tthis IImmutableSet<TValue> self,\n\t\t\tTValue value,\n\t\t\tTValue with)\n\t\t{\n\t\t\treturn self.Remove(value).Add(with);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/LiftedOperators/Cache.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class CacheExtensions\n\t{\n\t\tpublic static IObservable<IEnumerable<TValue>> CachePerElement<TDescriptor, TValue>(\n\t\t\tthis IObservable<IEnumerable<TDescriptor>> items,\n\t\t\tFunc<TDescriptor, TValue> getValue,\n\t\t\tAction<TValue> valueRemoved = null)\n\t\t{\n\t\t\treturn items.CachePerElement(d => d, getValue, valueRemoved);\n\t\t}\n\n\t\tpublic static IObservable<IEnumerable<TValue>> CachePerElement<TDescriptor, TKey, TValue>(\n\t\t\tthis IObservable<IEnumerable<TDescriptor>> items,\n\t\t\tFunc<TDescriptor, TKey> getKey,\n\t\t\tFunc<TDescriptor, TValue> getValue,\n\t\t\tAction<TValue> valueRemoved = null)\n\t\t{\n\t\t\treturn items\n\t\t\t\t.Scan(\n\t\t\t\t\tnew { cache = ImmutableDictionary<TKey, TValue>.Empty, list = Enumerable.Empty<TValue>() },\n\t\t\t\t\t(state, newDescriptors) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar oldCache = state.cache;\n\t\t\t\t\t\tvar newCache = ImmutableDictionary.CreateBuilder<TKey, TValue>();\n\t\t\t\t\t\tvar newItems = new List<TValue>();\n\t\t\t\t\t\tforeach (var descriptor in newDescriptors)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar key = getKey(descriptor);\n\t\t\t\t\t\t\tvar oldValue = oldCache.TryGetValue(key);\n\t\t\t\t\t\t\tvar value = oldValue.HasValue\n\t\t\t\t\t\t\t\t? oldValue.Value\n\t\t\t\t\t\t\t\t: getValue(descriptor);\n\t\t\t\t\t\t\tnewCache[key] = value;\n\t\t\t\t\t\t\tnewItems.Add(value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (valueRemoved != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (var cache in oldCache)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (newCache.ContainsKey(cache.Key) == false)\n\t\t\t\t\t\t\t\t\tvalueRemoved(cache.Value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new { cache = newCache.ToImmutable(), list = (IEnumerable<TValue>)newItems };\n\t\t\t\t\t})\n\t\t\t\t.Select(state => state.list)\n\t\t\t\t.Replay(1)\n\t\t\t\t.RefCount();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Extensions/LiftedOperators/Select.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class SelectExtension\n\t{\n\t\tpublic static IObservable<Optional<TResult>> SelectPerElement<TDescriptor, TResult>(\n\t\t\tthis IObservable<Optional<TDescriptor>> items,\n\t\t\tFunc<TDescriptor, TResult> calculateResult)\n\t\t{\n\t\t\treturn items.Select(i => i.Select(calculateResult));\n\t\t}\n\n\t\tpublic static IObservable<IEnumerable<TResult>> SelectPerElement<TDescriptor, TResult>(\n\t\t\tthis IObservable<IEnumerable<TDescriptor>> items,\n\t\t\tFunc<TDescriptor, TResult> calculateResult)\n\t\t{\n\t\t\treturn items.Select(i => i.Select(calculateResult));\n\t\t}\n\n\t\tpublic static IObservable<TOut> SelectSome<TIn, TOut>(this IObservable<TIn> self, Func<TIn, Optional<TOut>> transform)\n\t\t{\n\t\t\treturn self.Select(transform).NotNone();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Extensions/LiftedOperators/Where.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class WhereExtensions\n\t{\n\t\tpublic static IObservable<IEnumerable<T>> WhereEachElement<T>(\n\t\t\tthis IObservable<IEnumerable<T>> items,\n\t\t\tFunc<T, bool> predicate)\n\t\t{\n\t\t\treturn items.Where(elements => elements.All(predicate));\n\t\t}\n\n\t\tpublic static IObservable<IEnumerable<TDescriptor>> WherePerElement<TDescriptor>(\n\t\t\tthis IObservable<IEnumerable<TDescriptor>> items,\n\t\t\tFunc<TDescriptor, IObservable<bool>> calculateResult)\n\t\t{\n\t\t\treturn items\n\t\t\t\t.Switch(item =>\n\t\t\t\t\titem.Select(e => calculateResult(e).Select(r => r ? Optional.Some(e) : Optional.None()))\n\t\t\t\t\t\t.ToObservableEnumerable())\n\t\t\t\t.Select(item =>\n\t\t\t\t\titem.NotNone());\n\t\t}\n\n\t\tpublic static IObservable<IEnumerable<TDescriptor>> WherePerElement<TDescriptor>(\n\t\t\tthis IObservable<IEnumerable<TDescriptor>> items,\n\t\t\tFunc<TDescriptor, bool> calculateResult)\n\t\t{\n\t\t\treturn items.Select(i => i.Where(calculateResult));\n\t\t}\n\n\t\tpublic static IObservable<Optional<TDescriptor>> WherePerElement<TDescriptor>(\n\t\t\tthis IObservable<Optional<TDescriptor>> items,\n\t\t\tFunc<TDescriptor, bool> calculateResult)\n\t\t{\n\t\t\treturn items.Select(i => i.Where(calculateResult));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Extensions/ObjectExtensions.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic static class ObjectExtensions\n\t{\n\t\tpublic static void ThrowIfNull(this object self, string argument)\n\t\t{\n\t\t\tif (self == null) throw new ArgumentNullException(argument);\n\t\t}\n\n\t\tpublic static T ThrowIfNull<T>(this T self, Exception e) where T : class\n\t\t{\n\t\t\tif (self == null) throw e;\n\t\t\treturn self;\n\t\t}\n\n\t\tpublic static void DoIfNotNull<T>(this T t, Action<T> action) where T : class\n\t\t{\n\t\t\tif (ReferenceEquals(t, null)) return;\n\t\t\taction(t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/ObservableBooleans.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class ObservableBooleanExtensions\n\t{\n\t\tpublic static IObservable<bool> Or(this IObservable<bool> a, IObservable<bool> b)\n\t\t{\n\t\t\treturn a.CombineLatest(b, (ab, bb) => ab || bb).DistinctUntilChanged();\n\t\t}\n\n\t\tpublic static IObservable<bool> Or(this IObservable<bool> self, Func<IObservable<bool>> fallback)\n\t\t{\n\t\t\treturn self.Select(s => s\n\t\t\t\t\t? Observable.Return(true)\n\t\t\t\t\t: fallback())\n\t\t\t\t.Switch()\n\t\t\t\t.DistinctUntilChanged();\n\t\t}\n\n\t\tpublic static IObservable<bool> And(this IObservable<bool> a, IObservable<bool> b)\n\t\t{\n\t\t\treturn a.CombineLatest(b, (ab, bb) => ab && bb).DistinctUntilChanged();\n\t\t}\n\n\t\tpublic static IObservable<bool> And(this IObservable<bool> self, Func<IObservable<bool>> fallback)\n\t\t{\n\t\t\treturn self.Select(s => !s\n\t\t\t\t\t? Observable.Return(false)\n\t\t\t\t\t: fallback())\n\t\t\t\t.Switch()\n\t\t\t\t.DistinctUntilChanged();\n\t\t}\n\n\n\t\tpublic static IObservable<bool> IsFalse(this IObservable<bool> self)\n\t\t{\n\t\t\treturn self.Select(b => !b);\n\t\t}\n\n\t\tpublic static IObservable<bool> Is<T>(this IObservable<T> self, T value)\n\t\t{\n\t\t\treturn self.Select(s => s.Equals(value));\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Extensions/ObservableExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class ObservableBinaryMessage\n\t{\n\t\tpublic static IObservable<T> TryParse<T>(this IObservable<IBinaryMessage> messages, string type, Func<BinaryReader, T> reader)\n\t\t{\n\t\t\treturn messages\n\t\t\t\t.SelectSome(m => m.TryParse(type, reader))\n\t\t\t\t.Publish().RefCount();\n\t\t}\n\t}\n\n\tpublic static class ObservableExtensions\n\t{\n\t\tpublic static IObservable<IEnumerable<T>> OrEmpty<T>(this IObservable<Optional<IEnumerable<T>>> self)\n\t\t{\n\t\t\treturn self.Select(Optional.OrEmpty);\n\t\t}\n\n\t\tpublic static IImmutableSet<T> OrEmpty<T>(this Optional<IImmutableSet<T>> self)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? self.Value\n\t\t\t\t: ImmutableHashSet<T>.Empty;\n\t\t}\n\n\n\t\tpublic static IImmutableList<T> OrEmpty<T>(this Optional<IImmutableList<T>> self)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? self.Value\n\t\t\t\t: ImmutableList<T>.Empty;\n\t\t}\n\n\t\tpublic static IImmutableDictionary<TKey, TValue> OrEmpty<TKey, TValue>(\n\t\t\tthis Optional<IImmutableDictionary<TKey, TValue>> self)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? self.Value\n\t\t\t\t: ImmutableDictionary<TKey, TValue>.Empty;\n\t\t}\n\n\t\tpublic static IObservable<T> Or<T>(this IObservable<Optional<T>> self, IObservable<T> other)\n\t\t{\n\t\t\treturn self.CombineLatest(other, Optional.Or);\n\t\t}\n\n\t\tpublic static IObservable<T> ReplaceNone<T>(this IObservable<Optional<T>> self, Func<T> fallback)\n\t\t{\n\t\t\treturn self.Select(o => o.Or(fallback));\n\t\t}\n\n\t\tpublic static IObservable<Optional<T>> Or<T>(this IObservable<Optional<T>> self, IObservable<Optional<T>> other)\n\t\t{\n\t\t\treturn self.CombineLatest(other, Optional.Or);\n\t\t}\n\n\t\tpublic static IObservable<T> Or<T>(this IObservable<Optional<T>> self, T other)\n\t\t{\n\t\t\treturn self.Select(s => s.Or(other));\n\t\t}\n\n\t\tpublic static IObservable<T> Or<T>(this IObservable<Optional<T>> self, Func<IObservable<T>> fallback)\n\t\t{\n\t\t\treturn self.Select(s => s.HasValue\n\t\t\t\t\t? Observable.Return(s.Value)\n\t\t\t\t\t: fallback())\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tpublic static IObservable<T> ConnectWhile<T>(this IObservable<T> self, IObservable<bool> condition)\n\t\t{\n\t\t\treturn condition.DistinctUntilChanged().Switch(c => c ? self : Observable.Never<T>());\n\t\t}\n\n\t\tpublic static IObservable<T> While<T>(this IObservable<T> self, IObservable<bool> condition)\n\t\t{\n\t\t\treturn self.CombineLatest(condition, Tuple.Create).Where(t => t.Item2).Select(t => t.Item1);\n\t\t}\n\n\t\tpublic static IObservable<T> SampleWhile<T>(this IObservable<T> self, IObservable<bool> condition)\n\t\t{\n\t\t\treturn self.WithLatestFromBuffered(condition, Tuple.Create).Where(t => t.Item2).Select(t => t.Item1);\n\t\t}\n\n\t\tpublic static IDisposable SubscribeUsing<T>(this IObservable<T> self, Func<T, IDisposable> onNext)\n\t\t{\n\t\t\tvar previous = Disposable.Empty;\n\n\t\t\treturn Disposable.Combine(\n\t\t\t\tDisposable.Create(() => previous.Dispose()),\n\t\t\t\tself.Subscribe(\n\t\t\t\t\tonNext: t =>\n\t\t\t\t\t{\n\t\t\t\t\t\tprevious.Dispose();\n\t\t\t\t\t\tprevious = onNext(t);\n\t\t\t\t\t},\n\t\t\t\t\tonError: e => { },\n\t\t\t\t\tonCompleted: () => { }));\n\t\t}\n\n\t\tpublic static IObservable<TOut> Switch<TIn, TOut>(this IObservable<TIn> self, Func<TIn, IObservable<TOut>> selector)\n\t\t{\n\t\t\treturn self.Select(selector).Switch();\n\t\t}\n\n\t\tpublic static IObservable<T> NotNone<T>(this IObservable<Optional<T>> self)\n\t\t{\n\t\t\treturn self.SelectMany(o => o);\n\t\t}\n\n\t\tpublic static IEnumerable<T> NotNone<T>(this IEnumerable<Optional<T>> self)\n\t\t{\n\t\t\treturn self.SelectMany(o => o);\n\t\t}\n\n\t\tpublic static IObservable<T> CatchAndRetry<T>(this IObservable<T> source, TimeSpan delay, Action<Exception> onError = null, IScheduler scheduler = null)\n\t\t{\n\t\t\treturn source.Catch((Exception e) =>\n\t\t\t{\n\t\t\t\tif (onError != null) onError(e);\n\t\t\t\treturn Observable.Throw<T>(e).Delay(delay, scheduler ?? Scheduler.Default);\n\t\t\t}).Retry();\n\t\t}\n\n\t\tpublic static IObservable<Optional<T>> StartWithNone<T>(this IObservable<T> value)\n\t\t{\n\t\t\treturn value.Select(Optional.Some).StartWith(Optional.None());\n\t\t}\n\n\t\tpublic static IObservable<Optional<T>> StartWithNone<T>(this IObservable<Optional<T>> value)\n\t\t{\n\t\t\treturn value.StartWith(Optional.None());\n\t\t}\n\n\t\t/// <summary>\n\t\t///     Gets all values from observable that arrives synchronously when subscribing to it,\n\t\t///     then returns the last of those values.\n\t\t/// </summary>\n\t\tpublic static T LastNonBlocking<T>(this IObservable<T> source)\n\t\t{\n\t\t\tOptional<T> result = Optional.None();\n\t\t\tException exception = null;\n\t\t\tusing (source.Subscribe(v => result = v, ex => exception = ex)) { }\n\t\t\tif (exception != null)\n\t\t\t\tthrow new InvalidOperationException(\"Got error while trying to pull out last value\", exception);\n\t\t\treturn result.OrThrow(new InvalidOperationException(\"No pullable value\"));\n\t\t}\n\t}\n\n\tpublic static class BeyondTheObservableUniverse\n\t{\n\t\tpublic static IObservable<IEnumerable<T>> ToObservableEnumerable<T>(this IObservable<IEnumerable<IObservable<T>>> source)\n\t\t{\n\t\t\treturn source.Select(s => s.ToObservableEnumerable()).Switch();\n\t\t}\n\n\t\tpublic static IObservable<IEnumerable<T>> ToObservableEnumerable<T>(this IEnumerable<IObservable<T>> enumerable)\n\t\t{\n\t\t\tvar array = enumerable.ToArray();\n\t\t\treturn array.Any()\n\t\t\t\t? array.CombineLatest()\n\t\t\t\t: Observable.Return(new T[0]);\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/ObservableTuples.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class CombineExtensions\n\t{\n\t\tpublic static IObservable<Tuple<T1, T2>> CombineLatest<T1, T2>(this IObservable<T1> self, IObservable<T2> other)\n\t\t{\n\t\t\treturn self.CombineLatest(other, Tuple.Create);\n\t\t}\n\n\t\tpublic static IObservable<Tuple<T1, T2, T3>> CombineLatest<T1, T2, T3>(this IObservable<T1> self, IObservable<T2> other, IObservable<T3> other2)\n\t\t{\n\t\t\treturn self.CombineLatest(other, other2, Tuple.Create);\n\t\t}\n\n\t\tpublic static IObservable<Tuple<T1, T2, T3, T4>> CombineLatest<T1, T2, T3, T4>(this IObservable<T1> self, IObservable<T2> other, IObservable<T3> other2, IObservable<T4> other3)\n\t\t{\n\t\t\treturn self.CombineLatest(other, other2, other3, Tuple.Create);\n\t\t}\n\n\t\tpublic static IDisposable Subscribe<T1, T2>(this IObservable<Tuple<T1, T2>> self, Action<T1, T2> action)\n\t\t{\n\t\t\treturn self.Subscribe(t => action(t.Item1, t.Item2));\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Extensions/SelectWithState.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class SelectWithStateExtension\n\t{\n\t\tpublic static IObservable<TResult> SelectWithState<T, TState, TResult>(\n\t\t\tthis IObservable<T> self,\n\t\t\tTState initialState,\n\t\t\tFunc<T, TState, SelectResult<TResult, TState>> select)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.Scan(\n\t\t\t\t\tnew SelectResult<TResult, TState>(value: default(TResult), nextState: initialState),\n\t\t\t\t\t(acc, t) => select(t, acc.NextState))\n\t\t\t\t.Select(tp => tp.Value);\n\t\t}\n\n\t\tpublic static IObservable<TResult> SelectWithMutableState<TSource, TState, TResult>(\n\t\t\tthis IObservable<TSource> self,\n\t\t\tFunc<TState> initialState,\n\t\t\tFunc<TSource, TState, TResult> select)\n\t\t{\n\t\t\treturn Observable.Create<TResult>(\n\t\t\t\tobserver =>\n\t\t\t\t{\n\t\t\t\t\tvar state = initialState();\n\t\t\t\t\treturn self.Select(x => select(x, state)).Subscribe(observer);\n\t\t\t\t});\n\t\t}\n\t}\n\n\tpublic static class SelectResult\n\t{\n\t\tpublic static SelectResult<TValue, TState> Create<TValue, TState>(TValue value, TState nextState)\n\t\t{\n\t\t\treturn new SelectResult<TValue, TState>(value, nextState);\n\t\t}\n\t}\n\n\tpublic class SelectResult<TValue, TState>\n\t{\n\t\tpublic readonly TValue Value;\n\t\tpublic readonly TState NextState;\n\t\tpublic SelectResult(TValue value, TState nextState)\n\t\t{\n\t\t\tValue = value;\n\t\t\tNextState = nextState;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/StringExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace Outracks\n{\n\tpublic static class Base64StringTools\n\t{\n\t\tpublic static string Obfuscated(this string value)\n\t\t{\n\t\t\tvar sha512 = new SHA512Managed();\n\t\t\treturn BitConverter.ToString(sha512.ComputeHash(Encoding.UTF8.GetBytes(value)));\n\t\t}\n\n\t\tstatic public string ToBase64(this string toEncode)\n\t\t{\n\t\t\tbyte[] toEncodeAsBytes = Encoding.UTF8.GetBytes(toEncode);\n\t\t\treturn Convert.ToBase64String(toEncodeAsBytes);\n\t\t}\n\n\t\tstatic public Optional<string> FromBase64(this string encodedData)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbyte[] encodedDataAsBytes = Convert.FromBase64String(encodedData);\n\t\t\t\treturn Encoding.UTF8.GetString(encodedDataAsBytes);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\t}\n\n\n\tpublic static class StringCaptialization\n\t{\n\t\tpublic static string Capitalize(this string str)\n\t\t{\n\t\t\tif (String.IsNullOrEmpty(str) || Char.IsUpper(str, 0))\n\t\t\t\treturn str;\n\n\t\t\treturn Char.ToUpperInvariant(str[0]) + str.Substring(1);\n\t\t}\n\n\t\tpublic static string Uncapitalize(this string str)\n\t\t{\n\t\t\tif (String.IsNullOrEmpty(str) || Char.IsLower(str, 0))\n\t\t\t\treturn str;\n\n\t\t\treturn Char.ToLowerInvariant(str[0]) + str.Substring(1);\n\t\t}\n\t}\n\n\tpublic static class StringTrimming\n\t{\n\t\tpublic static string Indent(this string str)\n\t\t{\n\t\t\treturn str.Split('\\n').Select(s => \"\\t\" + s).Join(\"\\n\");\n\t\t}\n\n\t\tstatic readonly char[] Digits = new[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };\n\n\t\tpublic static string TrimEndDigits(this string str)\n\t\t{\n\t\t\treturn str.TrimEnd(Digits);\n\t\t}\n\n\t\tpublic static string StripSuffix(this string path, string suffix, StringComparison comparisonType = StringComparison.InvariantCulture)\n\t\t{\n\t\t\treturn path.EndsWith(suffix, comparisonType)\n\t\t\t\t? path.Substring(0, path.Length - suffix.Length)\n\t\t\t\t: path;\n\t\t}\n\n\t\tpublic static string StripPrefix(this string path, string prefix, StringComparison comparisonType = StringComparison.InvariantCulture)\n\t\t{\n\t\t\treturn path.StartsWith(prefix, comparisonType)\n\t\t\t\t? path.Substring(prefix.Length)\n\t\t\t\t: path;\n\t\t}\n\t}\n\n\tpublic static class StringSplitting\n\t{\n\t\tpublic static string AfterLastIfAny(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.LastIndexOf(seperator, StringComparison.Ordinal);\n\t\t\treturn index == -1 ? s : s.Substring(index + seperator.Length);\n\t\t}\n\n\t\tpublic static string AfterLast(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.LastIndexOf(seperator, StringComparison.Ordinal);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new ArgumentException();\n\t\t\treturn s.Substring(index + seperator.Length);\n\t\t}\n\n\t\tpublic static string BeforeLast(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.LastIndexOf(seperator, StringComparison.Ordinal);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new ArgumentException();\n\t\t\treturn s.Substring(0, index);\n\t\t}\n\n\t\tpublic static string AfterFirst(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.IndexOf(seperator, StringComparison.Ordinal);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new ArgumentException();\n\t\t\treturn s.Substring(index + seperator.Length);\n\t\t}\n\n\t\tpublic static string BeforeFirst(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.IndexOf(seperator, StringComparison.Ordinal);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new ArgumentException();\n\t\t\treturn s.Substring(0, index);\n\t\t}\n\n\t\tpublic static string[] Split(this string s, string seperator)\n        {\n            return s.Split(new[] { seperator }, StringSplitOptions.None);\n        }\n\n        public static string Join(this IEnumerable<string> si, string separator)\n        {\n            var s = si.ToArray();\n            if (s.HasCount(0)) return \"\";\n            if (s.HasCount(1)) return s.First();\n            return s.Aggregate((a, b) => a + separator + b);\n        }\n    }\n\n\tpublic static class FormatStringWith\n\t{\n\t\tpublic static string FormatWith(this string format, params object[] args)\n\t\t{\n\t\t\treturn string.Format(format, args);\n\t\t}\n\t}\n\n\tpublic static class StringWrapping\n\t{\n\t\tpublic static string Wrap(this string text, int length)\n\t\t{\n\t\t\tvar lines = new List<string>();\n\n\t\t\tforeach (var line in text.Split('\\n'))\n\t\t\t{\n\t\t\t\tvar words = new List<string>();\n\t\t\t\tvar cursor = 0;\n\n\t\t\t\tforeach (var word in line.Trim().Split(' '))\n\t\t\t\t{\n\t\t\t\t\twords.Add(word);\n\t\t\t\t\tcursor += word.Length + 1;\n\n\t\t\t\t\tif (cursor > length)\n\t\t\t\t\t{\n\t\t\t\t\t\tlines.Add(string.Join(\" \", words));\n\t\t\t\t\t\twords.Clear();\n\t\t\t\t\t\tcursor = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlines.Add(string.Join(\" \", words));\n\t\t\t}\n\n\t\t\treturn string.Join(\"\\n\", lines);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Extensions/TaskExtensions.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Outracks\n{\n\tpublic static class TaskExtensions\n\t{\n\t\t/// <exception cref=\"TimeoutException\"></exception>\n\t\tpublic static async Task<T> TimeoutAfter<T>(this Task<T> task, TimeSpan timeout)\n\t\t{\n\t\t\tif (await Task.WhenAny(task, Task.Delay(timeout)) == task)\n\t\t\t\treturn await task;\n\t\t\tthrow new TimeoutException(\"Task exceeded timeout of \" + timeout);\n\t\t}\n\n\t\tpublic static Optional<T> GetResultAndUnpackExceptions<T>(this Task<T> task, TimeSpan timeout)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn task.GetResult(timeout);\n\t\t\t}\n\t\t\tcatch (AggregateException e)\n\t\t\t{\n\t\t\t\te.InnerException.RethrowWithStackTrace();\n\t\t\t\tthrow e.InnerException;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Optional<T> GetResult<T>(this Task<T> task, TimeSpan timeout)\n\t\t{\n\t\t\treturn task.Wait(timeout)\n\t\t\t\t? Optional.Some(task.Result)\n\t\t\t\t: Optional.None<T>();\n\t\t}\n\n\t\tpublic static void WaitAndUnpackExceptions(this Task task)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\ttask.Wait();\n\t\t\t}\n\t\t\tcatch (AggregateException e)\n\t\t\t{\n\t\t\t\te.InnerException.RethrowWithStackTrace();\n\t\t\t\tthrow e.InnerException;\n\t\t\t}\n\t\t}\n\n\n\t\tpublic static T GetResultAndUnpackExceptions<T>(this Task<T> task)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn task.Result;\n\t\t\t}\n\t\t\tcatch (AggregateException e)\n\t\t\t{\n\t\t\t\te.InnerException.RethrowWithStackTrace();\n\t\t\t\tthrow e.InnerException;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/TestExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nnamespace Outracks\n{\n\tpublic static class TestExtensions\n\t{\n\t\tpublic static ObservableResults<T> Check<T>(this IObservable<T> o)\n\t\t{\n\t\t\tvar results = new ObservableResults<T>();\n\t\t\to.Check(results);\n\t\t\treturn results;\n\t\t}\n\n\t\tpublic static IObservable<T> Check<T>(this IObservable<T> o, ObservableResults<T> results)\n\t\t{\n\t\t\to.Subscribe(\n\t\t\t\tv => { results.Results.Add(v); },\n\t\t\t\te => { results.Error = e; },\n\t\t\t\t() => { results.Completed = true; });\n\t\t\treturn o;\n\t\t}\n\t}\n\n\tpublic class ObservableResults<T>\n\t{\n\t\tpublic readonly List<T> Results = new List<T>();\n\t\tpublic Exception Error;\n\t\tpublic bool Completed;\n\n\t\tpublic void AssertResult(bool completed, T singleResult, Exception error = null, Func<T, T, bool> resultComparer = null)\n\t\t{\n\t\t\tAssertResults(completed, new List<T> { singleResult }, error, resultComparer);\n\t\t}\n\n\t\tpublic void AssertResults(bool completed, IEnumerable<T> results, Exception error = null, Func<T, T, bool> resultComparer = null)\n\t\t{\n\t\t\tAssert.AreEqual(completed, Completed, \"Observable complete state differs from expected. Expected: \" + completed + \", but was \" + Completed);\n\t\t\tAssert.AreEqual(error, Error, \"Observable error state differs from expected. Expected: \" + error + \", but was \" + Error);\n\t\t\tif (resultComparer == null)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(results, Results);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar comparer = Comparer<T>.Create((x, y) => { return resultComparer(x, y) ? 0 : 1; });\n\t\t\t\tAssert.That(Results, Is.EqualTo(results).Using<T>(comparer));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Extensions/WithLatestFrom.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class WithLatestFromExtension\n\t{\n\t\t/// <summary>\n\t\t///\tCombines the latest from 'source' and 'that' using the combinator only when 'source' produces an element,\n\t\t/// as long as 'that' has a value.\n\t\t///\n\t\t/// The difference between this and the standard Observable.WithLatestFrom is that <see cref=\"WithLatestFromBuffered{TSource,TSampler,TResult}\"/>\n\t\t/// will hold on to the last element from `source` when no elements have yet been received from `that`, and will push a combined value\n\t\t/// when `that` receives its first element.\n\t\t/// </summary>\n\t\tpublic static IObservable<TResult> WithLatestFromBuffered<TSource, TSampler, TResult>(\n\t\t\tthis IObservable<TSource> source,\n\t\t\tIObservable<TSampler> that,\n\t\t\tFunc<TSource, TSampler, TResult> combinator)\n\t\t{\n\t\t\treturn Observable.Create(\n\t\t\t\t(IObserver<TResult> observer) =>\n\t\t\t\t{\n\t\t\t\t\tvar mutex = new object();\n\t\t\t\t\tvar pendingSource = default(Optional<TSource>);\n\t\t\t\t\tvar anySampler = default(Optional<TSampler>);\n\n\t\t\t\t\treturn Disposable.Combine(\n\t\t\t\t\t\tthat.Subscribe(\n\t\t\t\t\t\t\to =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlock (mutex)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (pendingSource.HasValue)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tobserver.OnNext(combinator(pendingSource.Value, o));\n\t\t\t\t\t\t\t\t\t\t\tpendingSource = Optional.None();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tanySampler = o;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tobserver.OnError(e);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tobserver.OnError),\n\t\t\t\t\t\tsource.Subscribe(\n\t\t\t\t\t\t\tv =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlock (mutex)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (anySampler.HasValue)\n\t\t\t\t\t\t\t\t\t\t\tobserver.OnNext(combinator(v, anySampler.Value));\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tpendingSource = v;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tobserver.OnError(e);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tobserver.OnError,\n\t\t\t\t\t\t\tobserver.OnCompleted));\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/ExternalApplications/AppBundle.cs",
    "content": "﻿using System.Diagnostics;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.IO\n{\n\tclass AppBundle : IExternalApplication\n\t{\n\t\treadonly IAbsolutePath _appBundle;\n\n\t\tpublic AppBundle(IAbsolutePath appBundle)\n\t\t{\n\t\t\t_appBundle = appBundle;\n\t\t}\n\n\t\tpublic Process Start(Optional<ProcessStartInfo> startInfo)\n\t\t{\n\t\t\tvar newStartInfo = startInfo.HasValue ? startInfo.Value : new ProcessStartInfo();\n\n\t\t\tnewStartInfo.FileName = \"open\";\n\t\t\tnewStartInfo.Arguments = _appBundle.NativePath.QuoteSpace() + \" --args \" + newStartInfo.Arguments;\n\n\t\t\treturn Process.Start(newStartInfo);\n\t\t}\n\n\t\tpublic Process Open(IAbsolutePath fileName, Optional<ProcessStartInfo> startInfo)\n\t\t{\n\t\t\tvar newStartInfo = startInfo.Or(new ProcessStartInfo());\n\n\t\t\tnewStartInfo.FileName = \"open\";\n\t\t\tnewStartInfo.Arguments = \"-a \" + _appBundle.NativePath.QuoteSpace() + \" \" + fileName.NativePath.QuoteSpace() + \" --args \" + newStartInfo.Arguments;\n\n\t\t\treturn Process.Start(newStartInfo);\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _appBundle.Name; }\n\t\t}\n\n\t\tpublic bool Exists\n\t\t{\n\t\t\tget { return Directory.Exists(_appBundle.NativePath); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/ExternalApplications/ExternalApplication.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic interface IExternalApplication\n\t{\n\t\tProcess Start(Optional<ProcessStartInfo> startInfo = default(Optional<ProcessStartInfo>));\n\n\t\tProcess Open(IAbsolutePath fileName, Optional<ProcessStartInfo> startInfo = default(Optional<ProcessStartInfo>));\n\n\t\tstring Name { get; }\n\n\t\tbool Exists { get; }\n\t}\n\n\tpublic static class ExternalApplication\n\t{\n\t\tpublic static Process Start(this IExternalApplication app, IEnumerable<string> args)\n\t\t{\n\t\t\treturn app.Start(new ProcessStartInfo { Arguments = args.Select(Uno.Extensions.QuoteSpace).Join(\" \") });\n\t\t}\n\n\t\tpublic static Process StartWithoutShellExecute(this IExternalApplication app, IEnumerable<string> args)\n\t\t{\n\t\t\treturn app.Start(new ProcessStartInfo\n\t\t\t{\n\t\t\t\tArguments = args.Select(Uno.Extensions.QuoteSpace).Join(\" \"),\n\t\t\t\tUseShellExecute = false,\n\t\t\t\tRedirectStandardInput = true,\n\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\tRedirectStandardError = true,\n\t\t\t\tCreateNoWindow = true\n\t\t\t});\n\t\t}\n\n\t\tpublic static IExternalApplication FromNativeExe(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn new NativeExe(path);\n\t\t}\n\n\t\t[Obsolete(\"Starting Mono does not work well in Xamarin.Mac apps.\")]\n\t\tpublic static IExternalApplication FromMonoExe(AbsoluteFilePath path, Optional<AbsoluteFilePath> mono)\n\t\t{\n\t\t\treturn new MonoExe(path, mono);\n\t\t}\n\n\t\tpublic static IExternalApplication FromAppBundle(IAbsolutePath path)\n\t\t{\n\t\t\treturn new AppBundle(path);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/ExternalApplications/MonoExe.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.IO\n{\n\t[Obsolete(\"Starting Mono does not work well in Xamarin.Mac apps.\")]\n\tclass MonoExe : IExternalApplication\n\t{\n\t\treadonly AbsoluteFilePath _exeFile;\n\t\treadonly Optional<AbsoluteFilePath> _mono;\n\n\t\tpublic MonoExe(AbsoluteFilePath exeFile, Optional<AbsoluteFilePath> mono)\n\t\t{\n\t\t\t_exeFile = exeFile;\n\t\t\t_mono = mono;\n\t\t}\n\n\t\tpublic Process Start(Optional<ProcessStartInfo> startInfo)\n\t\t{\n\t\t\tvar newStartInfo = startInfo.HasValue ? startInfo.Value : new ProcessStartInfo();\n\n\t\t\tnewStartInfo.FileName = _mono.Select(m => m.NativePath).Or(\"/Library/Frameworks/Mono.framework/Commands/mono\");\n\t\t\tnewStartInfo.Arguments = _exeFile.NativePath.QuoteSpace() + \" \" + newStartInfo.Arguments;\n\n\t\t\treturn Process.Start(newStartInfo);\n\t\t}\n\n\t\tpublic Process Open(IAbsolutePath fileName, Optional<ProcessStartInfo> startInfo)\n\t\t{\n\t\t\tvar newStartInfo = startInfo.Or(new ProcessStartInfo());\n\t\t\tnewStartInfo.Arguments = fileName.NativePath.QuoteSpace() + \" \" + newStartInfo.Arguments;\n\n\t\t\treturn Start(newStartInfo);\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _exeFile.Name.ToString(); }\n\t\t}\n\n\t\tpublic bool Exists\n\t\t{\n\t\t\tget { return File.Exists(_exeFile.NativePath); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/ExternalApplications/NativeExe.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.IO\n{\n\tclass NativeExe : IExternalApplication\n\t{\n\t\treadonly AbsoluteFilePath _exeFile;\n\n\t\tpublic NativeExe(AbsoluteFilePath exeFile)\n\t\t{\n\t\t\t_exeFile = exeFile;\n\t\t}\n\n\t\tpublic Process Start(Optional<ProcessStartInfo> startInfo)\n\t\t{\n#if DEBUG\n\t\t\tConsole.WriteLine(\"Starting \" + _exeFile.NativePath.QuoteSpace() + \" \" + startInfo.Select(s => s.Arguments).Or(\"\"));\n#endif\n\t\t\tvar newStartInfo = startInfo.Or(new ProcessStartInfo());\n\t\t\tnewStartInfo.FileName = _exeFile.NativePath;\n\t\t\treturn Process.Start(newStartInfo);\n\t\t}\n\n\t\tpublic Process Open(IAbsolutePath fileName, Optional<ProcessStartInfo> startInfo)\n\t\t{\n\t\t\tvar newStartInfo = startInfo.Or(new ProcessStartInfo());\n\t\t\tnewStartInfo.Arguments = fileName.NativePath.QuoteSpace() + \" \" + newStartInfo.Arguments;\n\n\t\t\treturn Start(newStartInfo);\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _exeFile.Name.ToString(); }\n\t\t}\n\n\t\tpublic bool Exists\n\t\t{\n\t\t\tget { return File.Exists(_exeFile.NativePath); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/FileOperations/BackupFile.cs",
    "content": "using System;\n\nnamespace Outracks.IO\n{\n\tpublic static class BackupFile\n\t{\n\t\tpublic static BackedUpFile BackupAndDeleteFile(this IFileSystem fileSystem, AbsoluteFilePath path)\n\t\t{\n\t\t\tvar backup = fileSystem.MakeUnique(path.AddExtension(\"bak\"));\n\t\t\tif (fileSystem.Exists(path))\n\t\t\t\tfileSystem.Move(path, backup);\n\n\t\t\treturn new BackedUpFile(fileSystem, path, backup);\n\t\t}\n\t}\n\n\tpublic class BackedUpFile : IDisposable\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly AbsoluteFilePath _original;\n\t\treadonly AbsoluteFilePath _backup;\n\n\t\tpublic BackedUpFile(IFileSystem fileSystem, AbsoluteFilePath original, AbsoluteFilePath backup)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_original = original;\n\t\t\t_backup = backup;\n\t\t}\n\n\t\tpublic void Restore()\n\t\t{\n\t\t\tif (_fileSystem.Exists(_backup))\n\t\t\t{\n\t\t\t\t_fileSystem.Delete(_original);\n\t\t\t\t_fileSystem.Move(_backup, _original);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif (_fileSystem.Exists(_backup))\n\t\t\t{\n\t\t\t\t_fileSystem.Delete(_backup);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/FileOperations/FileHelpers.cs",
    "content": "﻿using System.IO;\n\nnamespace Outracks\n{\n    public static class FileHelpers\n    {\n        public static long GetFileTime(string filename)\n        {\n            return File.GetLastWriteTime(filename).ToFileTime();\n        }\n\n        public static string ToUnixPath(this string str)\n        {\n            return str.Replace('\\\\', '/');\n        }\n    }\n}"
  },
  {
    "path": "src/common/core/FileOperations/FileSystemEventData.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic enum FileSystemEvent\n\t{\n\t\tRemoved,\n\t\tRenamed,\n\t\tChanged,\n\t\tCreated,\n\t}\n\n\tpublic class FileSystemEventData\n\t{\n\t\tpublic readonly AbsoluteFilePath File;\n\t\tpublic readonly FileSystemEvent Event;\n\t\tpublic readonly Optional<AbsoluteFilePath> OldFile;\n\n\t\tpublic FileSystemEventData(\n\t\t\tAbsoluteFilePath file,\n\t\t\tFileSystemEvent evt,\n\t\t\tOptional<AbsoluteFilePath> oldFile = default(Optional<AbsoluteFilePath>))\n\t\t{\n\t\t\tFile = file;\n\t\t\tEvent = evt;\n\t\t\tOldFile = oldFile;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/FileOperations/ForceWrite.cs",
    "content": "using System;\n\nnamespace Outracks.IO\n{\n\tpublic static class ForceWrite\n\t{\n\t\tpublic static void ForceWriteText(this IFileSystem fileSystem, AbsoluteFilePath dst, string contents)\n\t\t{\n\t\t\t// TODO: What does this do, or why?\n\t\t\tusing (var backup = fileSystem.BackupAndDeleteFile(dst))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tfileSystem.Create(dst.ContainingDirectory);\n\t\t\t\t\tfileSystem.WriteNewText(dst, contents);\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\tbackup.Restore();\n\t\t\t\t\tthrow;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/FileOperations/IFilePermission.cs",
    "content": "﻿using System;\n\nnamespace Outracks.IO\n{\n\t[Flags]\n\tpublic enum FileSystemPermission\n\t{\n\t\tRead = 1 << 0,\n\t\tWrite = 1 << 1,\n\t\tExecute = 1 << 2\n\t}\n\n\t[Flags]\n\tpublic enum FileSystemGroup\n\t{\n\t\tGroup = 1 << 0,\n\t\tUser = 1 << 1,\n\t\tOthers = 1 << 2,\n\t\tEveryone = Group | User | Others\n\t}\n\n}\n"
  },
  {
    "path": "src/common/core/FileOperations/IFileSystem.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reactive;\nusing System.Reflection;\nusing System.Security;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.IO\n{\n\tpublic class InvalidPath : ArgumentException\n\t{\n\t\tpublic readonly string Path;\n\t\tpublic InvalidPath(string path, Exception innerException = null)\n\t\t\t: base (\"Invalid path '\" + path + \"'\", innerException)\n\t\t{\n\t\t\tPath = path;\n\t\t}\n\t}\n\n\tpublic interface IFileSystem\n\t{\n\t\t/// <exception cref=\"InvalidPath\" />\n\t\t/// <exception cref=\"SecurityException\" />\n\t\tIAbsolutePath ResolveAbsolutePath(string nativePath);\n\n\t\t/// <exception cref=\"IOException\"><paramref name=\"path\"/> is a file name.-or-A network error has occurred. </exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\">The caller does not have the required permission. </exception>\n\t\t/// <exception cref=\"PathTooLongException\"/>\n\t\t/// <exception cref=\"DirectoryNotFoundException\">The specified path is invalid (for example, it is on an unmapped drive). </exception>\n\t\tIEnumerable<AbsoluteFilePath> GetFiles(AbsoluteDirectoryPath path);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tIEnumerable<AbsoluteFilePath> GetFiles(AbsoluteDirectoryPath path, string searchPattern);\n\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tIEnumerable<AbsoluteDirectoryPath> GetDirectories(AbsoluteDirectoryPath path);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tIEnumerable<AbsoluteDirectoryPath> GetDirectories(AbsoluteDirectoryPath path, string searchPattern);\n\n\t\tbool Exists(IAbsolutePath path);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tFileStream Open(AbsoluteFilePath path, FileMode mode, FileAccess access, FileShare share);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tStream OpenRead(AbsoluteFilePath path);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tStream OpenWrite(AbsoluteFilePath path);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tvoid Delete(IAbsolutePath path);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tvoid Copy(AbsoluteFilePath source, AbsoluteFilePath destination);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tvoid Move(AbsoluteFilePath source, AbsoluteFilePath destination);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\t/// TODO: this method should always throw if destination exists (without race condition)\n\t\tvoid Move(AbsoluteDirectoryPath source, AbsoluteDirectoryPath destination);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tvoid Create(AbsoluteDirectoryPath directory);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tStream Create(AbsoluteFilePath file);\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tStream CreateNew(AbsoluteFilePath file);\n\n\t\tIObservable<Unit> Watch(AbsoluteFilePath file);\n\n\t\tIObservable<FileSystemEventData> Watch(AbsoluteDirectoryPath path, Optional<string> filter = default(Optional<string>));\n\t}\n\n\tpublic static class AssemblyExtensions\n\t{\n\t\tpublic static AbsoluteFilePath GetCodeBaseFilePath(this Assembly assembly)\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t\treturn AbsoluteFilePath.Parse(assembly.CodeBase.StripPrefix(\"file:///\"));\n\t\t\telse\n\t\t\t\treturn AbsoluteFilePath.Parse(assembly.CodeBase.StripPrefix(\"file://\"));\n\t\t}\n\t}\n\n\tpublic static class FileSystemExtensions\n\t{\n\t\tpublic static Optional<IAbsolutePath> TryResolveAbsolutePath(this IFileSystem fs, string nativePath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Optional.Some(fs.ResolveAbsolutePath(nativePath));\n\t\t\t}\n\t\t\tcatch (InvalidPath)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t\tcatch (SecurityException)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Move(this IFileSystem fileSystem, IAbsolutePath source, IAbsolutePath destination)\n\t\t{\n\t\t\tsource.Do(\n\t\t\t\t(AbsoluteFilePath file) => fileSystem.Move(file, (AbsoluteFilePath) destination),\n\t\t\t\t(AbsoluteDirectoryPath dir) => fileSystem.Move(dir, (AbsoluteDirectoryPath) destination));\n\t\t}\n\n\t\tpublic static void CreateIfNotExists(this IFileSystem fileSystem, AbsoluteDirectoryPath dir)\n\t\t{\n\t\t\tif (!fileSystem.Exists(dir))\n\t\t\t\tfileSystem.Create(dir);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/FileOperations/IShell.cs",
    "content": "﻿namespace Outracks.IO\n{\n\tpublic interface IShell : IFileSystem\n\t{\n        string Name { get; }\n\n\t\tvoid OpenWithDefaultApplication(AbsoluteFilePath path);\n\t\tvoid OpenFolder(AbsoluteDirectoryPath path);\n\t\tvoid ShowInFolder(AbsoluteFilePath path);\n\t\tvoid OpenTerminal(AbsoluteDirectoryPath containingDirectory);\n\n\t\tvoid SetPermission(AbsoluteFilePath file, FileSystemPermission permission, FileSystemGroup group);\n\t\tvoid SetPermission(AbsoluteDirectoryPath dir, FileSystemPermission permission, FileSystemGroup group, bool recursive = false);\n\t}\n}\n"
  },
  {
    "path": "src/common/core/FileOperations/MakePathUnique.cs",
    "content": "using System;\nusing System.Globalization;\nusing System.IO;\nusing System.Threading;\n\nnamespace Outracks.IO\n{\n\tpublic static class MakePathUnique\n\t{\n\t\tpublic static AbsoluteFilePath MakeUnique(this IFileSystem fileSystem, AbsoluteFilePath path)\n\t\t{\n\t\t\treturn fileSystem.MakeUnique(path, i => path.Rename(CreateNumberName(path.Name, i)));\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath MakeUnique(this IFileSystem fileSystem, AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn fileSystem.MakeUnique(path, i => path.Rename(CreateNumberName(path.Name, i)));\n\t\t}\n\n\n\t\t/// <exception cref=\"FailedToCreateUniqueDirectory\"></exception>\n\t\tpublic static AbsoluteDirectoryPath CreateUniqueDirectory(\n\t\t\tthis IFileSystem fileSystem,\n\t\t\tAbsoluteDirectoryPath path,\n\t\t\tFunc<int, AbsoluteDirectoryPath> createName = null,\n\t\t\tFunc<int, TimeSpan> sleepTime = null,\n\t\t\tint maxTries = 10)\n\t\t{\n\t\t\tcreateName = createName ?? (no => path.Rename(CreateNumberName(path.Name, no)));\n\t\t\tsleepTime = sleepTime ?? (no => TimeSpan.FromMilliseconds(10));\n\n\t\t\tvar exception = Optional.None<Exception>();\n\t\t\tfor (int i = 0; i < maxTries; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar uniquePath = fileSystem.MakeUnique(path, createName);\n\t\t\t\t\tfileSystem.CreateNew(uniquePath);\n\t\t\t\t\tThread.Sleep(sleepTime(i));\n\t\t\t\t\treturn uniquePath;\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\texception = e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new FailedToCreateUniqueDirectory(path.ContainingDirectory.ToOptional(), exception);\n\t\t}\n\n\t\tstatic FileName CreateNumberName(FileName original, int number)\n\t\t{\n\t\t\treturn original\n\t\t\t\t.WithoutExtension\n\t\t\t\t.Add(number.ToString())\n\t\t\t\t.AddExtension(original.Extension);\n\t\t}\n\n\t\tpublic static DirectoryName CreateNumberName(DirectoryName original, int number)\n\t\t{\n\t\t\treturn original.Add(number.ToString(CultureInfo.InvariantCulture));\n\t\t}\n\n\t\tstatic void CreateNew(this IFileSystem fileSystem, AbsoluteDirectoryPath path)\n\t\t{\n\t\t\tvar tempDirectory = path.ContainingDirectory / DirectoryName.GetRandomDirectoryName();\n\t\t\tDirectory.CreateDirectory(tempDirectory.NativePath);\n\t\t\tfileSystem.Create(path.ContainingDirectory);\n\t\t\tfileSystem.Move(tempDirectory, path);\n\t\t}\n\n\t\tpublic static T MakeUnique<T>(this IFileSystem fileSystem, T path, Func<int, T> createName, Func<T, bool> condition = null) where T : IAbsolutePath\n\t\t{\n\t\t\tcondition = condition ?? (p => File.Exists(p.NativePath) || Directory.Exists(p.NativePath));\n\t\t\tint i = 1;\n\t\t\tvar uniqueFilePath = path;\n\t\t\twhile (condition(uniqueFilePath))\n\t\t\t{\n\t\t\t\tuniqueFilePath = createName(i);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn uniqueFilePath;\n\t\t}\n\t}\n\n\tpublic class FailedToCreateUniqueDirectory : IOException\n\t{\n\t\tpublic FailedToCreateUniqueDirectory(Optional<AbsoluteDirectoryPath> containingDir, Optional<Exception> innerException)\n\t\t\t: base(\"Failed to create a unique directory in \" + containingDir.Select(d => d.NativePath).Or(\"<root>\") + innerException.Select(e => \": \" + e.Message).Or(\"\"), innerException.OrDefault())\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/FileOperations/Reading.cs",
    "content": "using System;\nusing System.IO;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Outracks.IO\n{\n\tpublic static class Reading\n\t{\n\t\t/// <exception cref=\"AggregateException\"></exception>\n\t\tpublic static TextDocumentContent ReadTextDocument(this IFileSystem fileSystem, AbsoluteFilePath path, int maxAttempts)\n\t\t{\n\t\t\treturn new TextDocumentContent(path, fileSystem.ReadAllText(path, maxAttempts));\n\t\t}\n\n\t\t/// <exception cref=\"AggregateException\"></exception>\n\t\tpublic static string ReadAllText(this IFileSystem fileSystem, AbsoluteFilePath path, int maxAttempts)\n\t\t{\n\t\t\treturn RetryLoop.Try(\n\t\t\t\tmaxAttempts,\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tusing (var stream = fileSystem.OpenRead(path))\n\t\t\t\t\t\treturn stream.ReadToEnd();\n\t\t\t\t});\n\t\t}\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic static string ReadToEnd(this Stream stream)\n\t\t{\n\t\t\treturn new StreamReader(stream).ReadToEnd();\n\t\t}\n\n\t\t/// <exception cref=\"AggregateException\"></exception>\n\t\tpublic static byte[] ReadAllBytes(this IFileSystem fileSystem, AbsoluteFilePath path, int maxAttempts)\n\t\t{\n\t\t\treturn RetryLoop.Try(\n\t\t\t\tmaxAttempts,\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tusing (var stream = fileSystem.OpenRead(path))\n\t\t\t\t\t\treturn stream.ReadAllBytes();\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static Stream Read(this IFileSystem fileSystem, AbsoluteFilePath path, int maxAttempts)\n\t\t{\n\t\t\treturn RetryLoop.Try(\n\t\t\t\tmaxAttempts,\n\t\t\t\t() => fileSystem.OpenRead(path));\n\t\t}\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic static byte[] ReadAllBytes(this Stream stream)\n\t\t{\n\t\t\treturn new BinaryReader(stream).ReadAllBytes();\n\t\t}\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic static byte[] ReadAllBytes(this BinaryReader reader)\n\t\t{\n\t\t\tconst int bufferSize = 4096;\n\n\t\t\tusing (var ms = new MemoryStream())\n\t\t\t{\n\t\t\t\tbyte[] buffer;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tbuffer = reader.ReadBytes(bufferSize);\n\t\t\t\t\tms.Write(buffer, 0, buffer.Length);\n\t\t\t\t}\n\t\t\t\twhile (buffer.Length == bufferSize);\n\n\t\t\t\treturn ms.ToArray();\n\t\t\t}\n\t\t}\n\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic static async Task<byte[]> ReadAllBytesAsync(this Stream stream)\n\t\t{\n\t\t\tusing (var ms = new MemoryStream())\n\t\t\t{\n\t\t\t\tawait stream.CopyToAsync(ms);\n\t\t\t\treturn ms.ToArray();\n\t\t\t}\n\t\t}\n\n\t\tpublic static Task WriteAllBytesAsync(this Stream stream, byte[] bytes)\n\t\t{\n\t\t\treturn stream.WriteAsync(bytes, 0, bytes.Length, CancellationToken.None);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/core/FileOperations/RetryLoop.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Outracks.IO\n{\n\tpublic static class SleepFunctions\n\t{\n\t\tpublic static Func<int, TimeSpan> DiskRetry = i => TimeSpan.FromMilliseconds(1 << i);\n\t}\n\n\tpublic static class RetryLoop\n\t{\n\t\t/// <summary>\n\t\t/// Retries func until it succeeds or the specified maximum number of attempts is reached\n\t\t/// This function will sleep 2^i ms between each attempt.\n\t\t/// </summary>\n\t\t/// <exception cref=\"AggregateException\"></exception>\n\t\tpublic static T Try<T>(\n\t\t\tint maxAttempts,\n\t\t\tFunc<T> func,\n\t\t\tFunc<int, TimeSpan> sleepFunction = null)\n\t\t{\n\t\t\tsleepFunction = sleepFunction ?? SleepFunctions.DiskRetry;\n\n\t\t\treturn LoopUntilSuccess(_ => func(), sleepFunction, maxAttempts);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Retries func until it succeeds or the specified maximum number of attempts is reached\n\t\t/// </summary>\n\t\t/// <exception cref=\"AggregateException\"></exception>\n\t\tpublic static T LoopUntilSuccess<T>(\n\t\t\tFunc<int, T> func,\n\t\t\tFunc<int, TimeSpan> sleepFunction = null,\n\t\t\tint? maxAttempts = null)\n\t\t{\n\t\t\tsleepFunction = sleepFunction ?? SleepFunctions.DiskRetry;\n\n\t\t\tvar exceptions = new List<Exception>();\n\t\t\tfor (int i = 0; maxAttempts.HasValue == false || i < maxAttempts; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn func(i);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\texceptions.Add(e);\n\t\t\t\t}\n\t\t\t\tThread.Sleep(sleepFunction(i));\n\t\t\t}\n\t\t\tthrow new AggregateException(\"Retry count of \" + maxAttempts + \" exceeded\", exceptions.ToArray());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Retries func until it succeeds or the specified maximum number of attempts is reached\n\t\t/// </summary>\n\t\t/// <exception cref=\"AggregateException\"></exception>\n\t\tpublic static async Task<T> AsyncLoopUntilSuccess<T>(\n\t\t\tFunc<int, Task<T>> func,\n\t\t\tFunc<int, TimeSpan> sleepFunction = null,\n\t\t\tint? maxAttempts = null)\n\t\t{\n\t\t\tsleepFunction = sleepFunction ?? SleepFunctions.DiskRetry;\n\n\t\t\tvar exceptions = new List<Exception>();\n\t\t\tfor (int i = 0; maxAttempts.HasValue == false || i < maxAttempts; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn await func(i);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\texceptions.Add(e);\n\t\t\t\t}\n\t\t\t\tawait Task.Delay(sleepFunction(i));\n\t\t\t}\n\t\t\tthrow new AggregateException(\"Retry count of \" + maxAttempts + \" exceeded\", exceptions.ToArray());\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/common/core/FileOperations/ShellHelper.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace Outracks.IO\n{\n\tpublic static class ShellHelper\n\t{\n\t\tpublic static bool TryPureMove<T>(T source, T destination, Action<string, string> moveOp) where T : IAbsolutePath\n\t\t{\n\t\t\tif (!source.SharesRootWith(destination))\n\t\t\t\treturn false; // pure move does not work across volumes\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tmoveOp(source.NativePath, destination.NativePath);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tif ((UInt32)e.HResult == 0x800700B7) // Cannot create a file when that file already exists.\n\t\t\t\t\tthrow;\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\t// TODO: log this?\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs)\n\t\t{\n\t\t\t// Get the subdirectories for the specified directory.\n\t\t\tvar dir = new DirectoryInfo(sourceDirName);\n\n\t\t\tif (!dir.Exists)\n\t\t\t{\n\t\t\t\tthrow new DirectoryNotFoundException(\n\t\t\t\t\t\"Source directory does not exist or could not be found: \"\n\t\t\t\t\t+ sourceDirName);\n\t\t\t}\n\n\t\t\tvar dirs = dir.GetDirectories();\n\t\t\t// If the destination directory doesn't exist, create it.\n\t\t\tif (!Directory.Exists(destDirName))\n\t\t\t{\n\t\t\t\tDirectory.CreateDirectory(destDirName);\n\t\t\t}\n\n\t\t\t// Get the files in the directory and copy them to the new location.\n\t\t\tvar files = dir.GetFiles();\n\t\t\tforeach (var file in files)\n\t\t\t{\n\t\t\t\tvar temppath = Path.Combine(destDirName, file.Name);\n\t\t\t\tfile.CopyTo(temppath, false);\n\t\t\t}\n\n\t\t\t// If copying subdirectories, copy them and their contents to new location.\n\t\t\tif (copySubDirs)\n\t\t\t{\n\t\t\t\tforeach (var subdir in dirs)\n\t\t\t\t{\n\t\t\t\t\tstring temppath = Path.Combine(destDirName, subdir.Name);\n\t\t\t\t\tDirectoryCopy(subdir.FullName, temppath, copySubDirs);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/FileOperations/Writing.cs",
    "content": "using System.IO;\nusing System.Reactive;\n\nnamespace Outracks.IO\n{\n\tpublic static class Writing\n\t{\n\t\tpublic static void WriteNewText(this IFileSystem fileSystem, AbsoluteFilePath path, string text)\n\t\t{\n\t\t\tusing (var stream = fileSystem.CreateNew(path))\n\t\t\tusing (var writer = new StreamWriter(stream))\n\t\t\t\twriter.Write(text);\n\t\t}\n\n\t\tpublic static void ReplaceText(this IFileSystem fileSystem, AbsoluteFilePath path, string text)\n\t\t{\n\t\t\tusing (var stream = fileSystem.Create(path))\n\t\t\tusing (var writer = new StreamWriter(stream))\n\t\t\t\twriter.Write(text);\n\t\t}\n\n\t\tpublic static void ReplaceText(this IFileSystem fileSystem, AbsoluteFilePath path, string text, int attempts)\n\t\t{\n\t\t\tRetryLoop.Try(attempts,\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tfileSystem.ReplaceText(path, text);\n\t\t\t\t\treturn Unit.Default;\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/LineEndings.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic static class LineEndings\n\t{\n\t\tpublic static string NormalizeLineEndings(this string text)\n\t\t{\n\t\t\treturn text.Replace(\"\\r\\n\", \"\\n\").Replace(\"\\r\", \"\\n\");\n\t\t}\n\n\t\tpublic static string NormalizeLineEndings(this string text, string defaultLineEnding)\n\t\t{\n\t\t\treturn NormalizeLineEndings(text).Replace(\"\\n\", defaultLineEnding);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Logging/Formatter.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Threading;\n\nnamespace Outracks\n{\n\tstatic class Formatter {\n\t\t//Does not throw\n\t\tpublic static string Format(LogLevel level, object message, Exception exception)\n\t\t{\n\t\t\treturn FormattedNow() + \" \" +\n\t\t\t\tFormattedProcessAndThreadId() + \" \" +\n\t\t\t\tFormattedLevel(level) + \" \" +\n\t\t\t\tFormattedMessage(message) + FormattedException(exception);\n\t\t}\n\n\t\t//Does not throw\n\t\tstatic string FormattedLevel(LogLevel level)\n\t\t{\n\t\t\treturn level.ToString().ToUpper(CultureInfo.InvariantCulture);\n\t\t}\n\n\t\t//Does not throw\n\t\tstatic string FormattedProcessAndThreadId()\n\t\t{\n\t\t\treturn \"[\" + ProcessId() + \":\" + Thread.CurrentThread.ManagedThreadId + \"]\";\n\t\t}\n\n\t\t//Does not throw\n\t\tstatic int ProcessId()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Process.GetCurrentProcess().Id;\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\t//Does not throw\n\t\tstatic string FormattedMessage(object message)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn OnSingleLine(Convert.ToString(message));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\treturn \"(The log message was non-null, but '\" + message.GetType().Name + \".ToString()' threw an exception: \" + FormattedException(e) + \")\";\n\t\t\t}\n\t\t}\n\n\t\t//Does not throw\n\t\tstatic string FormattedNow()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn DateTime.Now.ToString(\"yyyy-MM-dd HH:mm:ss,fff\", CultureInfo.InvariantCulture);\n\t\t\t}\n\t\t\tcatch (ArgumentOutOfRangeException) //Could theoretically happen. FormatException can not happen.\n\t\t\t{\n\t\t\t\treturn \"0000-00-00 00:00:00,000 \";\n\t\t\t}\n\t\t}\n\n\t\t//Does not throw\n\t\tstatic string FormattedException(Exception exception)\n\t\t{\n\t\t\tif (exception == null)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\treturn \" Exception: \" + OnSingleLine(exception.ToString());\n\t\t}\n\n\t\t//Does not throw\n\t\tstatic string OnSingleLine(string message)\n\t\t{\n\t\t\treturn string.IsNullOrEmpty(message) ? \"\" : message.Replace(\"\\r\", \"\").Replace(\"\\n\", \"    \");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Logging/IReport.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic interface IReport\n\t{\n\t\tvoid Fatal(object o, Exception exception = null, ReportTo destination = ReportTo.Log);\n\t\tvoid Error(object o, ReportTo destination = ReportTo.Log);\n\t\tvoid Exception(object o, Exception e, ReportTo destination = ReportTo.Log);\n\t\tvoid Warn(object o, ReportTo destination = ReportTo.Log);\n\t\tvoid Info(object o, ReportTo destination = ReportTo.Log);\n\t\tvoid Debug(object o, ReportTo destination = ReportTo.Log);\n\t\tIReport ConfigureSync(bool reportSynchronously);\n\t}\n}"
  },
  {
    "path": "src/common/core/Logging/LogFactory.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading;\nusing log4net;\nusing log4net.Appender;\nusing log4net.Core;\nusing log4net.Layout;\nusing log4net.Repository.Hierarchy;\nusing Outracks.Diagnostics;\n\nnamespace Outracks\n{\n\tclass LogFactory\n\t{\n\t\tstatic bool _isSetup;\n\t\tstatic bool _isFailed;\n\n\t\tinternal static ILog GetLogger(string name)\n\t\t{\n\t\t\tSetup();\n\t\t\treturn _isFailed ? new NullLogger() : LogManager.GetLogger(name);\n\t\t}\n\n\t\tstatic void Setup()\n\t\t{\n\t\t\tif (_isSetup)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar random = new Random(Process.GetCurrentProcess().Id);\n\t\t\tvar stopwatch = Stopwatch.StartNew();\n\t\t\twhile (stopwatch.ElapsedMilliseconds < 1000)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tTrySetup();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\tThread.Sleep(TimeSpan.FromMilliseconds(100 + 100*random.NextDouble()));\n\t\t\t\t}\n\t\t\t}\n\t\t\t_isSetup = true;\n\t\t\t_isFailed = true;\n\t\t}\n\n\t\tstatic void TrySetup()\n\t\t{\n\t\t\tDirectory.CreateDirectory(LogDirectory);\n\t\t\tGlobalContext.Properties[\"pid\"] = Process.GetCurrentProcess().Id;\n\t\t\tvar hierarchy = (Hierarchy)LogManager.GetRepository();\n\n\t\t\tvar patternLayout = new PatternLayout\n\t\t\t{\n\t\t\t\tConversionPattern = \"%date{ISO8601} [%property{pid}:%thread] %-5level %logger - %message%newline\"\n\t\t\t};\n\t\t\tpatternLayout.ActivateOptions();\n\n\t\t\tvar roller = new RollingFileAppender\n\t\t\t{\n\t\t\t\tAppendToFile = true,\n\t\t\t\tFile = Path.Combine(LogDirectory, \"fuse.log\"),\n\t\t\t\tLayout = patternLayout,\n\t\t\t\tMaxSizeRollBackups = 5,\n\t\t\t\tMaximumFileSize = \"256KB\",\n\t\t\t\tRollingStyle = RollingFileAppender.RollingMode.Size,\n\t\t\t\tStaticLogFileName = true\n\t\t\t};\n\t\t\troller.ActivateOptions();\n\t\t\thierarchy.Root.AddAppender(roller);\n\n\t\t\thierarchy.Root.Level = Level.Info;\n\t\t\thierarchy.Configured = true;\n\t\t\t_isSetup = true;\n\t\t}\n\n\t\tpublic static void SetLogLevel(Level level)\n\t\t{\n\t\t\t((Hierarchy)LogManager.GetRepository()).Root.Level = level;\n\t\t\t((Hierarchy)LogManager.GetRepository()).RaiseConfigurationChanged(EventArgs.Empty);\n\t\t}\n\n\t\tprivate static string LogDirectory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tswitch (Platform.OperatingSystem)\n\t\t\t\t{\n\t\t\t\t\tcase OS.Windows: return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @\"\\fuse X\\logs\";\n\t\t\t\t\tcase OS.Mac: return Environment.GetEnvironmentVariable(\"HOME\") + \"/.fuse/logs\";\n\t\t\t\t}\n\t\t\t\tthrow new Exception(\"Unsupported platform\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Logging/NullLogger.cs",
    "content": "﻿using System;\nusing log4net;\nusing log4net.Core;\n\nnamespace Outracks\n{\n\tpublic class NullLogger : ILog\n\t{\n\t\tpublic static readonly NullLogger Instance = new NullLogger();\n\t\tpublic ILogger Logger { get; private set; }\n\t\tpublic void Debug(object message) {}\n\t\tpublic void Debug(object message, Exception exception) {}\n\t\tpublic void DebugFormat(string format, params object[] args) {}\n\t\tpublic void DebugFormat(string format, object arg0) {}\n\t\tpublic void DebugFormat(string format, object arg0, object arg1) {}\n\t\tpublic void DebugFormat(string format, object arg0, object arg1, object arg2) {}\n\t\tpublic void DebugFormat(IFormatProvider provider, string format, params object[] args) {}\n\t\tpublic void Info(object message) {}\n\t\tpublic void Info(object message, Exception exception) {}\n\t\tpublic void InfoFormat(string format, params object[] args) {}\n\t\tpublic void InfoFormat(string format, object arg0) {}\n\t\tpublic void InfoFormat(string format, object arg0, object arg1) {}\n\t\tpublic void InfoFormat(string format, object arg0, object arg1, object arg2) {}\n\t\tpublic void InfoFormat(IFormatProvider provider, string format, params object[] args) {}\n\t\tpublic void Warn(object message) {}\n\t\tpublic void Warn(object message, Exception exception) {}\n\t\tpublic void WarnFormat(string format, params object[] args) {}\n\t\tpublic void WarnFormat(string format, object arg0) {}\n\t\tpublic void WarnFormat(string format, object arg0, object arg1) {}\n\t\tpublic void WarnFormat(string format, object arg0, object arg1, object arg2) {}\n\t\tpublic void WarnFormat(IFormatProvider provider, string format, params object[] args) {}\n\t\tpublic void Error(object message) {}\n\t\tpublic void Error(object message, Exception exception) {}\n\t\tpublic void ErrorFormat(string format, params object[] args) {}\n\t\tpublic void ErrorFormat(string format, object arg0) {}\n\t\tpublic void ErrorFormat(string format, object arg0, object arg1) {}\n\t\tpublic void ErrorFormat(string format, object arg0, object arg1, object arg2) {}\n\t\tpublic void ErrorFormat(IFormatProvider provider, string format, params object[] args) {}\n\t\tpublic void Fatal(object message) {}\n\t\tpublic void Fatal(object message, Exception exception) {}\n\t\tpublic void FatalFormat(string format, params object[] args) {}\n\t\tpublic void FatalFormat(string format, object arg0) {}\n\t\tpublic void FatalFormat(string format, object arg0, object arg1) {}\n\t\tpublic void FatalFormat(string format, object arg0, object arg1, object arg2) {}\n\t\tpublic void FatalFormat(IFormatProvider provider, string format, params object[] args) {}\n\t\tpublic bool IsDebugEnabled { get; private set; }\n\t\tpublic bool IsInfoEnabled { get; private set; }\n\t\tpublic bool IsWarnEnabled { get; private set; }\n\t\tpublic bool IsErrorEnabled { get; private set; }\n\t\tpublic bool IsFatalEnabled { get; private set; }\n\t}\n}"
  },
  {
    "path": "src/common/core/Logging/Report.cs",
    "content": "﻿using System;\nusing log4net;\n\nnamespace Outracks\n{\n\tpublic class Report : IReport\n\t{\n\t\treadonly ILog _log;\n\t\treadonly ILogClient _logClient;\n\t\treadonly bool _synchronousCloudReporting;\n\t\tbool _hasReportedFailedLogging;\n\n\t\tinternal Report(ILog log, ILogClient logClient, bool synchronousCloudReporting = false)\n\t\t{\n\t\t\t_log = log;\n\t\t\t_logClient = logClient;\n\t\t\t_synchronousCloudReporting = synchronousCloudReporting;\n\t\t}\n\n\t\tpublic void Fatal(object o, Exception exception = null, ReportTo destination = ReportTo.Log)\n\t\t{\n\t\t\tSendReport(destination, LogLevel.Fatal, o, exception);\n\t\t}\n\n\t\tpublic void Error(object o, ReportTo destination = ReportTo.Log)\n\t\t{\n\t\t\tSendReport(destination, LogLevel.Error, o, null);\n\t\t}\n\n\t\tpublic void Exception(object o, Exception e, ReportTo destination = ReportTo.Log)\n\t\t{\n\t\t\tSendReport(destination, LogLevel.Error, o, e);\n\t\t}\n\n\t\tpublic void Warn(object o, ReportTo destination = ReportTo.Log)\n\t\t{\n\t\t\tSendReport(destination, LogLevel.Warning, o, null);\n\t\t}\n\n\t\tpublic void Info(object o, ReportTo destination = ReportTo.Log)\n\t\t{\n\t\t\tSendReport(destination, LogLevel.Info, o, null);\n\t\t}\n\n\t\tpublic void Debug(object o, ReportTo destination = ReportTo.Log)\n\t\t{\n\t\t\tSendReport(destination, LogLevel.Debug, o, null);\n\t\t}\n\n\t\tpublic IReport ConfigureSync(bool reportSynchronously)\n\t\t{\n\t\t\treturn new Report(_log, _logClient, reportSynchronously);\n\t\t}\n\n\t\tvoid SendReport(ReportTo destination, LogLevel level, object message, Exception exception)\n\t\t{\n\t\t\tif (destination.HasFlag(ReportTo.Log))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (_logClient != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_logClient.Send(Formatter.Format(level, message, exception));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch (level)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase LogLevel.Fatal: _log.Fatal(message, exception); break;\n\t\t\t\t\t\t\tcase LogLevel.Error: _log.Error(message, exception); break;\n\t\t\t\t\t\t\tcase LogLevel.Warning: _log.Warn(message, exception); break;\n\t\t\t\t\t\t\tcase LogLevel.Info: _log.Info(message, exception); break;\n\t\t\t\t\t\t\tcase LogLevel.Debug: _log.Debug(message, exception); break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tLoggingFailed(e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (destination.HasFlag(ReportTo.User))\n\t\t\t{\n\t\t\t\tif (level == LogLevel.Error || level == LogLevel.Fatal)\n\t\t\t\t{\n\t\t\t\t\tConsole.Error.WriteLine(message);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tConsole.Out.WriteLine(message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tvoid LoggingFailed(Exception exception)\n\t\t{\n\t\t\tif (_hasReportedFailedLogging)\n\t\t\t\treturn;\n\n\t\t\t_hasReportedFailedLogging = true;\n\t\t}\n\t}\n\n\tclass ErrorWithoutException : Exception\n\t{\n\t\tpublic ErrorWithoutException(string message) : base(message) { }\n\t}\n\n\tpublic interface ILogClient {\n\t\tvoid Send(string message);\n\t}\n\n\tpublic enum LogLevel\n\t{\n\t\tFatal,\n\t\tError,\n\t\tWarning,\n\t\tInfo,\n\t\tDebug\n\t}\n\n\t[Flags]\n\tpublic enum ReportTo\n\t{\n\t\tNone = 0,\n\n\t\tLog = 1 << 1,\n\t\tUser = 1 << 2,\n\t\tHeadquarters = 1 << 3,\n\n\t\tLogAndUser = Log | User,\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Logging/ReportFactory.cs",
    "content": "﻿using System;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Analytics;\n\nnamespace Outracks\n{\n\tpublic class ReportFactory\n\t{\n\t\tpublic static IReport GetReporter(Guid systemId, Guid sessionId, string name)\n\t\t{\n\t\t\treturn new Report(\n\t\t\t\tLogFactory.GetLogger(name),\n\t\t\t\tCreateClient());\n\t\t}\n\n\t\tpublic static readonly IReport FallbackReport;\n\n\t\tstatic ReportFactory()\n\t\t{\n\t\t\tFallbackReport = new NullReport(); //Protect against someone indirectly using `FallbackReport` during execution of `GetReporter()`\n\t\t\tFallbackReport = GetReporter(SystemGuidLoader.LoadOrCreateOrEmpty(), Guid.NewGuid(), \"fuse X\");\n\t\t}\n\n\t\tstatic ILogClient CreateClient()\n\t\t{\n\t\t\tbool useLogServer = false;\n\t\t\tif (!useLogServer)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tswitch (Platform.OperatingSystem)\n\t\t\t{\n\t\t\tcase OS.Windows:\n\t\t\t\treturn null;\n\t\t\tcase OS.Mac:\n\t\t\t\treturn new UnixSocketLogClient();\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(\"Unsupported platform\");\n\t\t\t}\n\t\t}\n\n\t\tprivate class NullReport : IReport\n\t\t{\n\t\t\tpublic void Fatal(object o, Exception exception = null, ReportTo destination = ReportTo.Log) { }\n\t\t\tpublic void Error(object o, ReportTo destination = ReportTo.Log) { }\n\t\t\tpublic void Exception(object o, Exception e, ReportTo destination = ReportTo.Log) { }\n\t\t\tpublic void Warn(object o, ReportTo destination = ReportTo.Log) { }\n\t\t\tpublic void Info(object o, ReportTo destination = ReportTo.Log) { }\n\t\t\tpublic void Debug(object o, ReportTo destination = ReportTo.Log) { }\n\t\t\tpublic IReport ConfigureSync(bool reportSynchronously) { return this; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Logging/UnhandledExceptionReporter.cs",
    "content": "﻿using System;\nusing Outracks.Diagnostics;\n\nnamespace Outracks\n{\n\tpublic static class UnhandledExceptionReporter\n\t{\n\t\tpublic static void ReportUnhandledExceptions(this AppDomain domain, IReport report)\n\t\t{\n\t\t\tdomain.UnhandledException += (sender, e) =>\n\t\t\t{\n\t\t\t\tvar exception = e.ExceptionObject as Exception;\n\t\t\t\tif (exception != null)\n\t\t\t\t{\n\t\t\t\t\treport.ConfigureSync(true).Fatal(\n\t\t\t\t\t\t\"Unhandled exception: \" + exception.Message,\n\t\t\t\t\t\texception,\n\t\t\t\t\t\tReportTo.Log | ReportTo.User | ReportTo.Headquarters);\n\n\t\t\t\t\tif (Platform.IsMac)\n\t\t\t\t\t\tEnvironment.ExitCode = 255;\n\t\t\t\t\telse\n\t\t\t\t\t\tEnvironment.Exit(255);\n\t\t\t\t}\n\t\t\t};\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Logging/UnixSocketLogClient.cs",
    "content": "﻿using System;\nusing System.Net.Sockets;\nusing System.Text;\nusing Mono.Unix;\n\nnamespace Outracks\n{\n\tclass UnixSocketLogClient : ILogClient\n\t{\n\t\tpublic void Send(string message)\n\t\t{\n\t\t\tusing (var sock = new Socket (AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified)) {\n\t\t\t\tvar logserver = Environment.GetEnvironmentVariable(\"HOME\") + \"/.fuse/logserver\";\n\t\t\t\tvar endpoint = new UnixEndPoint (logserver);\n\t\t\t\tsock.Connect (endpoint);\n\t\t\t\tsock.Send (Encoding.UTF8.GetBytes (message));\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "src/common/core/Lookups/DictionaryLookup.cs",
    "content": "using System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tclass DictionaryLookup<TKey, TValue, TValues> : ILookup<TKey, TValue> where TValues : IEnumerable<TValue>\n\t{\n\t\treadonly IDictionary<TKey, TValues> _dictionary;\n\n\t\treadonly IEnumerable<IGrouping<TKey, TValue>> _groups;\n\n\t\tpublic DictionaryLookup(IDictionary<TKey, TValues> dictionary)\n\t\t{\n\t\t\t_dictionary = dictionary;\n\t\t\t_groups = _dictionary.Select(k => (IGrouping<TKey, TValue>)new Grouping<TKey, TValues>(k.Key, new[] { k.Value }));\n\t\t}\n\n\t\tpublic IEnumerator<IGrouping<TKey, TValue>> GetEnumerator()\n\t\t{\n\t\t\treturn _groups.GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }\n\n\t\tpublic bool Contains(TKey key)\n\t\t{\n\t\t\treturn _dictionary.ContainsKey(key);\n\t\t}\n\n\t\tpublic int Count\n\t\t{\n\t\t\tget { return _dictionary.Count; }\n\t\t}\n\n\t\tpublic IEnumerable<TValue> this[TKey key]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tTValues value;\n\t\t\t\tif (_dictionary.TryGetValue(key, out value))\n\t\t\t\t\treturn value;\n\n\t\t\t\treturn Enumerable.Empty<TValue>();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Lookups/Grouping.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic class Grouping<TKey, TValue> : IGrouping<TKey, TValue>\n\t{\n\t\treadonly IEnumerable<TValue> _values;\n\n\t\tpublic TKey Key { get; private set; }\n\n\t\tpublic Grouping(TKey key, IEnumerable<TValue> values)\n\t\t{\n\t\t\tKey = key;\n\t\t\t_values = values;\n\t\t}\n\n\t\tpublic IEnumerator<TValue> GetEnumerator()\n\t\t{\n\t\t\treturn _values.GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }\n\t}\n}"
  },
  {
    "path": "src/common/core/Lookups/Lookup.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class Lookup\n\t{\n\t\tpublic static ILookup<TKey, TValue> Empty<TKey, TValue>()\n\t\t{\n\t\t\treturn Enumerable.Empty<KeyValuePair<TKey, IEnumerable<TValue>>>().ToLookup();\n\t\t}\n\n\t\tpublic static ILookup<TKey, TValue> ToLookup<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, ImmutableList<TValue>>> values)\n\t\t{\n\t\t\treturn new DictionaryLookup<TKey, TValue, ImmutableList<TValue>>(values.ToDictionary(kv => kv.Key, kv => kv.Value));\n\t\t}\n\n\t\tpublic static ILookup<TKey, TValue> ToLookup<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, IEnumerable<TValue>>> values)\n\t\t{\n\t\t\treturn new DictionaryLookup<TKey, TValue, IEnumerable<TValue>>(values.ToDictionary(kv => kv.Key, kv => kv.Value));\n\t\t}\n\n\t\tpublic static ILookup<TKey, TValue> ToLookup<TKey, TValue>(this IDictionary<TKey, ImmutableList<TValue>> dictionary)\n\t\t{\n\t\t\treturn new DictionaryLookup<TKey, TValue, ImmutableList<TValue>>(dictionary);\n\t\t}\n\n\t\tpublic static ILookup<TKey, TValue> ToLookup<TKey, TValue>(this IDictionary<TKey, IEnumerable<TValue>> dictionary)\n\t\t{\n\t\t\treturn new DictionaryLookup<TKey, TValue, IEnumerable<TValue>>(dictionary);\n\t\t}\n\n\t\tpublic static ILookup<TKey, TValue> ToLookup<TKey, TValue>(this IDictionary<TKey, ImmutableHashSet<TValue>> dictionary)\n\t\t{\n\t\t\treturn new DictionaryLookup<TKey, TValue, ImmutableHashSet<TValue>>(dictionary);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Matching/DoExtension.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic static class DoExtension\n\t{\n\t\tpublic static void Do<T1>(this IMatchTypes<T1> self, Action<T1> a1)\n\t\t\twhere T1 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t}\n\n\t\tpublic static void Do<T1, T2>(this IMatchTypes<T1, T2> self, Action<T1> a1, Action<T2> a2)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t}\n\n\t\tpublic static void Do<T1, T2, T3>(this IMatchTypes<T1, T2, T3> self, Action<T1> a1, Action<T2> a2, Action<T3> a3)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t}\n\n\t\tpublic static void Do<T1, T2, T3, T4>(this IMatchTypes<T1, T2, T3, T4> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5>(this IMatchTypes<T1, T2, T3, T4, T5> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t}\n\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6>(this IMatchTypes<T1, T2, T3, T4, T5, T6> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t}\n\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8, Action<T9> a9)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) a9(t9);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8, Action<T9> a9, Action<T10> a10)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) a10(t10);\n\t\t}\n\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8, Action<T9> a9, Action<T10> a10, Action<T11> a11, Action<T12> a12)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) a12(t12);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8, Action<T9> a9, Action<T10> a10, Action<T11> a11, Action<T12> a12, Action<T13> a13)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) a13(t13);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8, Action<T9> a9, Action<T10> a10, Action<T11> a11, Action<T12> a12, Action<T13> a13, Action<T14> a14)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t\twhere T14 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) a13(t13);\n\t\t\tvar t14 = self as T14; if (t14 != null) a14(t14);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8, Action<T9> a9, Action<T10> a10, Action<T11> a11, Action<T12> a12, Action<T13> a13, Action<T14> a14, Action<T15> a15)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t\twhere T14 : class\n\t\t\twhere T15 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) a13(t13);\n\t\t\tvar t14 = self as T14; if (t14 != null) a14(t14);\n\t\t\tvar t15 = self as T15; if (t15 != null) a15(t15);\n\t\t}\n\t\tpublic static void Do<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> self, Action<T1> a1, Action<T2> a2, Action<T3> a3, Action<T4> a4, Action<T5> a5, Action<T6> a6, Action<T7> a7, Action<T8> a8, Action<T9> a9, Action<T10> a10, Action<T11> a11, Action<T12> a12, Action<T13> a13, Action<T14> a14, Action<T15> a15, Action<T16> a16)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t\twhere T14 : class\n\t\t\twhere T15 : class\n\t\t\twhere T16 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) a13(t13);\n\t\t\tvar t14 = self as T14; if (t14 != null) a14(t14);\n\t\t\tvar t15 = self as T15; if (t15 != null) a15(t15);\n\t\t\tvar t16 = self as T16; if (t16 != null) a16(t16);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Matching/DoSomeExtension.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic static class DoSomeExtension\n\t{\n\t\tpublic static void DoSome<TArg, T1, T2>(\n\t\t\tthis TArg t,\n\t\t\tAction<T1> a1,\n\t\t\tAction<T2> a2)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t{\n\t\t\tif (t is T1) a1((T1)t);\n\t\t\tif (t is T2) a2((T2)t);\n\t\t}\n\t\tpublic static void DoSome<TArg, T1, T2, T3>(\n\t\t\tthis TArg t,\n\t\t\tAction<T1> a1,\n\t\t\tAction<T2> a2,\n\t\t\tAction<T3> a3)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t{\n\t\t\tif (t is T1) a1((T1)t);\n\t\t\tif (t is T2) a2((T2)t);\n\t\t\tif (t is T3) a3((T3)t);\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Matching/IMatchTypes.cs",
    "content": "﻿namespace Outracks\n{\n    public interface IMatchTypes<T1> { }\n    public interface IMatchTypes<T1, T2> { }\n    public interface IMatchTypes<T1, T2, T3> { }\n    public interface IMatchTypes<T1, T2, T3, T4> { }\n    public interface IMatchTypes<T1, T2, T3, T4, T5> { }\n    public interface IMatchTypes<T1, T2, T3, T4, T5, T6> { }\n    public interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7> { }\n    public interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> { }\n\tpublic interface IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> { }\n\n}\n"
  },
  {
    "path": "src/common/core/Matching/MatchSomeExtension.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic static class MatchSomeExtension\n\t{\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1)\n\t\t\twhere T1 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5, T6>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t\twhere T6 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\tif (t is T6) return a6((T6)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5, T6, T7>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t\twhere T6 : TArg\n\t\t\twhere T7 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\tif (t is T6) return a6((T6)t);\n\t\t\tif (t is T7) return a7((T7)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5, T6, T7, T8>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t\twhere T6 : TArg\n\t\t\twhere T7 : TArg\n\t\t\twhere T8 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\tif (t is T6) return a6((T6)t);\n\t\t\tif (t is T7) return a7((T7)t);\n\t\t\tif (t is T8) return a8((T8)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5, T6, T7, T8, T9>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t\twhere T6 : TArg\n\t\t\twhere T7 : TArg\n\t\t\twhere T8 : TArg\n\t\t\twhere T9 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\tif (t is T6) return a6((T6)t);\n\t\t\tif (t is T7) return a7((T7)t);\n\t\t\tif (t is T8) return a8((T8)t);\n\t\t\tif (t is T9) return a9((T9)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t\twhere T6 : TArg\n\t\t\twhere T7 : TArg\n\t\t\twhere T8 : TArg\n\t\t\twhere T9 : TArg\n\t\t\twhere T10 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\tif (t is T6) return a6((T6)t);\n\t\t\tif (t is T7) return a7((T7)t);\n\t\t\tif (t is T8) return a8((T8)t);\n\t\t\tif (t is T9) return a9((T9)t);\n\t\t\tif (t is T10) return a10((T10)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t\twhere T6 : TArg\n\t\t\twhere T7 : TArg\n\t\t\twhere T8 : TArg\n\t\t\twhere T9 : TArg\n\t\t\twhere T10 : TArg\n\t\t\twhere T11 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1)t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\tif (t is T6) return a6((T6)t);\n\t\t\tif (t is T7) return a7((T7)t);\n\t\t\tif (t is T8) return a8((T8)t);\n\t\t\tif (t is T9) return a9((T9)t);\n\t\t\tif (t is T10) return a10((T10)t);\n\t\t\tif (t is T11) return a11((T11)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t\tpublic static Optional<T> MatchSome<TArg, T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(\n\t\t\tthis TArg t,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11, Func<T12, T> a12)\n\t\t\twhere T1 : TArg\n\t\t\twhere T2 : TArg\n\t\t\twhere T3 : TArg\n\t\t\twhere T4 : TArg\n\t\t\twhere T5 : TArg\n\t\t\twhere T6 : TArg\n\t\t\twhere T7 : TArg\n\t\t\twhere T8 : TArg\n\t\t\twhere T9 : TArg\n\t\t\twhere T10 : TArg\n\t\t\twhere T11 : TArg\n\t\t\twhere T12 : TArg\n\t\t{\n\t\t\tif (t is T1) return a1((T1) t);\n\t\t\tif (t is T2) return a2((T2)t);\n\t\t\tif (t is T3) return a3((T3)t);\n\t\t\tif (t is T4) return a4((T4)t);\n\t\t\tif (t is T5) return a5((T5)t);\n\t\t\tif (t is T6) return a6((T6)t);\n\t\t\tif (t is T7) return a7((T7)t);\n\t\t\tif (t is T8) return a8((T8)t);\n\t\t\tif (t is T9) return a9((T9)t);\n\t\t\tif (t is T10) return a10((T10)t);\n\t\t\tif (t is T11) return a11((T11)t);\n\t\t\tif (t is T12) return a12((T12)t);\n\t\t\treturn Optional.None();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Matching/MatchWithExtension.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic static class MatchWithExtension\n\t{\n\t\tpublic static T MatchWith<T, T1>(this IMatchTypes<T1> self, Func<T1, T> a1)\n            where T1 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            throw new ArgumentException();\n        }\n\n\t\tpublic static T MatchWith<T, T1, T2>(this IMatchTypes<T1, T2> self, Func<T1, T> a1, Func<T2, T> a2)\n            where T1 : class\n            where T2 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            var t2 = self as T2; if (t2 != null) return a2(t2);\n            throw new ArgumentException();\n        }\n\n        public static T MatchWith<T, T1, T2, T3>(this IMatchTypes<T1, T2, T3> self, Func<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3)\n            where T1 : class\n            where T2 : class\n            where T3 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            var t2 = self as T2; if (t2 != null) return a2(t2);\n            var t3 = self as T3; if (t3 != null) return a3(t3);\n            throw new ArgumentException();\n        }\n\n        public static T MatchWith<T, T1, T2, T3, T4>(this IMatchTypes<T1, T2, T3, T4> self, Func<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4)\n            where T1 : class\n            where T2 : class\n            where T3 : class\n            where T4 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            var t2 = self as T2; if (t2 != null) return a2(t2);\n            var t3 = self as T3; if (t3 != null) return a3(t3);\n            var t4 = self as T4; if (t4 != null) return a4(t4);\n            throw new ArgumentException();\n        }\n\n        public static T MatchWith<T, T1, T2, T3, T4, T5>(this IMatchTypes<T1, T2, T3, T4, T5> self, Func<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5)\n            where T1 : class\n            where T2 : class\n            where T3 : class\n            where T4 : class\n            where T5 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            var t2 = self as T2; if (t2 != null) return a2(t2);\n            var t3 = self as T3; if (t3 != null) return a3(t3);\n            var t4 = self as T4; if (t4 != null) return a4(t4);\n            var t5 = self as T5; if (t5 != null) return a5(t5);\n            throw new ArgumentException();\n        }\n\n        public static T MatchWith<T, T1, T2, T3, T4, T5, T6>(this IMatchTypes<T1, T2, T3, T4, T5, T6> self, Func<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6)\n            where T1 : class\n            where T2 : class\n            where T3 : class\n            where T4 : class\n            where T5 : class\n            where T6 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            var t2 = self as T2; if (t2 != null) return a2(t2);\n            var t3 = self as T3; if (t3 != null) return a3(t3);\n            var t4 = self as T4; if (t4 != null) return a4(t4);\n            var t5 = self as T5; if (t5 != null) return a5(t5);\n            var t6 = self as T6; if (t6 != null) return a6(t6);\n            throw new ArgumentException();\n        }\n\n        public static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7> self, Func<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7)\n            where T1 : class\n            where T2 : class\n            where T3 : class\n            where T4 : class\n            where T5 : class\n            where T6 : class\n            where T7 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            var t2 = self as T2; if (t2 != null) return a2(t2);\n            var t3 = self as T3; if (t3 != null) return a3(t3);\n            var t4 = self as T4; if (t4 != null) return a4(t4);\n            var t5 = self as T5; if (t5 != null) return a5(t5);\n            var t6 = self as T6; if (t6 != null) return a6(t6);\n            var t7 = self as T7; if (t7 != null) return a7(t7);\n            throw new ArgumentException();\n        }\n\n        public static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8>(this IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8> self, Func<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8)\n            where T1 : class\n            where T2 : class\n            where T3 : class\n            where T4 : class\n            where T5 : class\n            where T6 : class\n            where T7 : class\n            where T8 : class\n        {\n            var t1 = self as T1; if (t1 != null) return a1(t1);\n            var t2 = self as T2; if (t2 != null) return a2(t2);\n            var t3 = self as T3; if (t3 != null) return a3(t3);\n            var t4 = self as T4; if (t4 != null) return a4(t4);\n            var t5 = self as T5; if (t5 != null) return a5(t5);\n            var t6 = self as T6; if (t6 != null) return a6(t6);\n            var t7 = self as T7; if (t7 != null) return a7(t7);\n            var t8 = self as T8; if (t8 != null) return a8(t8);\n            throw new ArgumentException();\n        }\n\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9>(\n\t\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9> self,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(\n\t\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> self,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) return a10(t10);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(\n\t\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> self,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) return a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) return a11(t11);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(\n\t\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> self,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11, Func<T12, T> a12)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) return a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) return a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) return a12(t12);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(\n\t\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> self,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11, Func<T12, T> a12, Func<T13, T> a13)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) return a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) return a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) return a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) return a13(t13);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(\n\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> self,\n\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11, Func<T12, T> a12, Func<T13, T> a13, Func<T14, T> a14)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t\twhere T14 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) return a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) return a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) return a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) return a13(t13);\n\t\t\tvar t14 = self as T14; if (t14 != null) return a14(t14);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(\n\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> self,\n\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11, Func<T12, T> a12, Func<T13, T> a13, Func<T14, T> a14, Func<T15, T> a15)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t\twhere T14 : class\n\t\t\twhere T15 : class\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) return a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) return a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) return a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) return a13(t13);\n\t\t\tvar t14 = self as T14; if (t14 != null) return a14(t14);\n\t\t\tvar t15 = self as T15; if (t15 != null) return a15(t15);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(\n\t\t\tthis IMatchTypes<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> self,\n\t\t\tFunc<T1, T> a1, Func<T2, T> a2, Func<T3, T> a3, Func<T4, T> a4, Func<T5, T> a5, Func<T6, T> a6, Func<T7, T> a7, Func<T8, T> a8, Func<T9, T> a9, Func<T10, T> a10, Func<T11, T> a11, Func<T12, T> a12, Func<T13, T> a13, Func<T14, T> a14, Func<T15, T> a15, Func<T16, T> a16)\n\t\t\twhere T1 : class\n\t\t\twhere T2 : class\n\t\t\twhere T3 : class\n\t\t\twhere T4 : class\n\t\t\twhere T5 : class\n\t\t\twhere T6 : class\n\t\t\twhere T7 : class\n\t\t\twhere T8 : class\n\t\t\twhere T9 : class\n\t\t\twhere T10 : class\n\t\t\twhere T11 : class\n\t\t\twhere T12 : class\n\t\t\twhere T13 : class\n\t\t\twhere T14 : class\n\t\t\twhere T15 : class\n\t\t\twhere T16 : class\n\n\t\t{\n\t\t\tvar t1 = self as T1; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as T2; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as T3; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as T4; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as T5; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as T6; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as T7; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as T8; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as T9; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as T10; if (t10 != null) return a10(t10);\n\t\t\tvar t11 = self as T11; if (t11 != null) return a11(t11);\n\t\t\tvar t12 = self as T12; if (t12 != null) return a12(t12);\n\t\t\tvar t13 = self as T13; if (t13 != null) return a13(t13);\n\t\t\tvar t14 = self as T14; if (t14 != null) return a14(t14);\n\t\t\tvar t15 = self as T15; if (t15 != null) return a15(t15);\n\t\t\tvar t16 = self as T16; if (t16 != null) return a16(t16);\n\t\t\tthrow new ArgumentException();\n\t\t}\n    }\n\n\n\n}\n"
  },
  {
    "path": "src/common/core/NetworkHelper.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Net;\nusing System.Net.NetworkInformation;\nusing System.Net.Sockets;\nusing System.Reactive;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.IPC\n{\n\tpublic class NetworkHelper\n\t{\n\t\t/// <exception cref=\"FailedToLoadTcpTable\"></exception>\n\t\tpublic static bool IsPortOpen(int port)\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t\treturn IsPortOpenWin(port);\n\t\t\telse if(Platform.IsMac)\n\t\t\t\treturn IsPortOpenOSX(port);\n\n\t\t\tthrow new PlatformNotSupportedException();\n\t\t}\n\n\t\tstatic bool IsPortOpenOSX(int port)\n\t\t{\n\t\t\tvar lsofStartupInfo = new ProcessStartInfo(\"sh\")\n\t\t\t{\n\t\t\t\tUseShellExecute = false,\n\t\t\t\tArguments = \"-c \\\"lsof -i tcp:\" + port + \" | grep LISTEN\\\"\"\n\t\t\t};\n\n\t\t\tvar p = Process.Start(lsofStartupInfo);\n\t\t\tp.WaitForExit();\n\t\t\treturn p.ExitCode == 1;\n\t\t}\n\n\t\tstatic bool IsPortOpenWin(int port)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar isAvailable = true;\n\n\t\t\t\t// Evaluate current system tcp connections. This is the same information provided\n\t\t\t\t// by the netstat command line application, just in .Net strongly-typed object\n\t\t\t\t// form.  We will look through the list, and if our port we would like to use\n\t\t\t\t// in our TcpClient is occupied, we will set isAvailable to false.\n\t\t\t\tvar ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties();\n\t\t\t\tvar tcpConnInfoArray = ipGlobalProperties.GetActiveTcpListeners();\n\n\t\t\t\tforeach (var tcpi in tcpConnInfoArray)\n\t\t\t\t{\n\t\t\t\t\tif (tcpi.Port == port)\n\t\t\t\t\t{\n\t\t\t\t\t\tisAvailable = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn isAvailable;\n\t\t\t}\n\t\t\tcatch (NetworkInformationException e)\n\t\t\t{\n\t\t\t\tthrow new FailedToLoadTcpTable(e);\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"UnableToResolveHostNameException\"></exception>\n\t\tpublic static IEnumerable<IPAddress> GetInterNetworkIps()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar hostNameOrAddress = Dns.GetHostName();\n\t\t\t\treturn GetIP(hostNameOrAddress);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tif (Platform.IsMac)\n\t\t\t\t\treturn GetIPFallbackSafe();\n\t\t\t\telse\n\t\t\t\t\tthrow new UnableToResolveHostNameException(e);\n\t\t\t}\n\t\t}\n\n\t\tstatic IEnumerable<IPAddress> GetIP(string hostNameOrAddress)\n\t\t{\n\t\t\tvar addressList = Dns.GetHostEntry(hostNameOrAddress).AddressList;\n\t\t\treturn\n\t\t\t\tnew[] { IPAddress.Loopback }\n\t\t\t\t\t.Union(\n\t\t\t\t\t\taddressList\n\t\t\t\t\t\t\t.Where(ip => ip.AddressFamily == AddressFamily.InterNetwork)\n\t\t\t\t\t\t\t.Reverse());\n\t\t}\n\n\t\tstatic IEnumerable<IPAddress> GetIPFallbackSafe()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn GetIpFallback();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new UnableToResolveHostNameException(e);\n\t\t\t}\n\t\t}\n\n\t\tstatic IEnumerable<IPAddress> GetIpFallback()\n\t\t{\n\t\t\tvar ifConfigInfo = new ProcessStartInfo()\n\t\t\t{\n\t\t\t\tFileName = \"ifconfig\",\n\t\t\t\tUseShellExecute = false,\n\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\tRedirectStandardError = true\n\t\t\t};\n\n\t\t\tvar ifConfig = Process.Start(ifConfigInfo);\n\t\t\tvar output = new StringBuilder();\n\t\t\tvar errors = new StringBuilder();\n\n\t\t\tifConfig.ConsumeOutAndErr(\n\t\t\t\tObserver.Create<string>(str => output.Append(str)),\n\t\t\t\tObserver.Create<string>(str => errors.Append(str)))\n\t\t\t\t.Wait();\n\n\t\t\tif (errors.Length > 0)\n\t\t\t\tthrow new IfConfigErrorException(errors.ToString());\n\n\t\t\treturn ExtractIpsFromIfconfigOutput(output.ToString());\n\t\t}\n\n\t\tinternal static IEnumerable<IPAddress> ExtractIpsFromIfconfigOutput(string ifconfigOutput)\n\t\t{\n\t\t\treturn Regex.Matches(ifconfigOutput, @\"inet\\s+(?<ip>\\d+\\.\\d+\\.\\d+\\.\\d+)\")\n\t\t\t\t.Cast<Match>()\n\t\t\t\t.Select(matchResult => IPAddress.Parse(matchResult.Groups[\"ip\"].Value));\n\t\t}\n\t}\n\n\tclass IfConfigErrorException : Exception\n\t{\n\t\tpublic IfConfigErrorException(string message)\n\t\t\t: base(message)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class UnableToResolveHostNameException : AggregateException\n\t{\n\t\tpublic UnableToResolveHostNameException()\n\t\t\t: base(\"Unable to resolve host name.\")\n\t\t{\n\t\t}\n\n\t\tpublic UnableToResolveHostNameException(Exception innerExceptions)\n\t\t\t: base(\"Unable to resolve host name.\", innerExceptions)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class FailedToLoadTcpTable : AggregateException\n\t{\n\t\tpublic FailedToLoadTcpTable(Exception innerException) : base(\"Unable to load TCP table information\", innerException)\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/ObservableStack.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic class ObservableStack<T>\n\t{\n\t\treadonly BehaviorSubject<IImmutableStack<T>> _stack = new BehaviorSubject<IImmutableStack<T>>(ImmutableStack<T>.Empty);\n\n\t\tpublic ObservableStack()\n\t\t{\n\t\t\tPeek = _stack.Select(s => s.FirstOrNone());\n\t\t\tPeekUnder = _stack.Select(s => s.Skip(1).FirstOrNone());\n\t\t}\n\n\t\tpublic T Value\n\t\t{\n\t\t\tget { return _stack.Value.Peek(); }\n\t\t}\n\n\t\tpublic void Push(T value)\n\t\t{\n\t\t\t_stack.OnNext(_stack.Value.Push(value));\n\t\t}\n\n\t\tpublic T Pop()\n\t\t{\n\t\t\tvar stack = _stack.Value;\n\t\t\t_stack.OnNext(stack.Pop());\n\t\t\treturn stack.Peek();\n\t\t}\n\n\t\tpublic void Replace(params T[] stack)\n\t\t{\n\t\t\t_stack.OnNext(ImmutableStack.CreateRange(stack));\n\t\t}\n\n\t\tpublic IObservable<Optional<T>> Peek { get; private set; }\n\t\tpublic IObservable<Optional<T>> PeekUnder { get; private set; }\n\t}\n}"
  },
  {
    "path": "src/common/core/OpenGlVersion.cs",
    "content": "﻿namespace Outracks\n{\n\tpublic class OpenGlVersion\n\t{\n\t\tpublic readonly string GlVersion;\n\t\tpublic readonly string GlVendor;\n\t\tpublic readonly string GlRenderer;\n\n\t\tpublic OpenGlVersion(string glVersion, string glVendor, string glRenderer)\n\t\t{\n\t\t\tGlVersion = glVersion;\n\t\t\tGlVendor = glVendor;\n\t\t\tGlRenderer = glRenderer;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Outracks.Core.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{196B010D-AD36-4947-95AA-14FC4A27BD18}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks</RootNamespace>\n    <AssemblyName>Outracks</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\log4net.2.0.12\\lib\\net45\\log4net.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Mono.Posix\">\n      <HintPath>..\\..\\..\\packages\\JetBrains.Mono.Posix.0.1\\lib\\net40\\Mono.Posix.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Web\" />\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Behaviors\\IBehavior.cs\" />\n    <Compile Include=\"Behaviors\\IBehaviorSubject.cs\" />\n    <Compile Include=\"Behaviors\\Operators\\AsBehavior.cs\" />\n    <Compile Include=\"Behaviors\\Operators\\CombineLatest.cs\" />\n    <Compile Include=\"Behaviors\\Operators\\DistinctUntilChanged.cs\" />\n    <Compile Include=\"Behaviors\\Operators\\Return.cs\" />\n    <Compile Include=\"Behaviors\\Operators\\Select.cs\" />\n    <Compile Include=\"Behaviors\\Operators\\Switch.cs\" />\n    <Compile Include=\"ColoredTextWriter.cs\" />\n    <Compile Include=\"Diagnostics\\Reactive\\IObservableTraceHandler.cs\" />\n    <Compile Include=\"Diagnostics\\Reactive\\ObservableTraceInfo.cs\" />\n    <Compile Include=\"Either.cs\" />\n    <Compile Include=\"Extensions\\BufferPrevious.cs\" />\n    <Compile Include=\"Diagnostics\\ObservableTraceLogger.cs\" />\n    <Compile Include=\"Diagnostics\\ConsoleTraceExtensions.cs\" />\n    <Compile Include=\"DateFormat.cs\" />\n    <Compile Include=\"Extensions\\TestExtensions.cs\" />\n    <Compile Include=\"Extensions\\ObservableTuples.cs\" />\n    <Compile Include=\"Extensions\\LiftedOperators\\Cache.cs\" />\n    <Compile Include=\"Extensions\\LiftedOperators\\Select.cs\" />\n    <Compile Include=\"Extensions\\LiftedOperators\\Where.cs\" />\n    <Compile Include=\"Extensions\\SelectWithState.cs\" />\n    <Compile Include=\"Extensions\\WithLatestFrom.cs\" />\n    <Compile Include=\"FileOperations\\FileSystemEventData.cs\" />\n    <Compile Include=\"Logging\\LogFactory.cs\" />\n    <Compile Include=\"OpenGlVersion.cs\" />\n    <Compile Include=\"SingleActionQueue.cs\" />\n    <Compile Include=\"ReplayQueueSubject.cs\" />\n    <Compile Include=\"TrySomethingExtension.cs\" />\n    <Compile Include=\"Lookups\\DictionaryLookup.cs\" />\n    <Compile Include=\"Pipes\\SocketWin32.cs\" />\n    <Compile Include=\"Matching\\DoSomeExtension.cs\" />\n    <Compile Include=\"ArgumentParseExtensions.cs\" />\n    <Compile Include=\"Diagnostics\\AssemblyAnalyzer.cs\" />\n    <Compile Include=\"Diagnostics\\CallerInfo.cs\" />\n    <Compile Include=\"Diagnostics\\Platform.cs\" />\n    <Compile Include=\"Diagnostics\\ProfilingEvent.cs\" />\n    <Compile Include=\"Diagnostics\\ProfilingResult.cs\" />\n    <Compile Include=\"Disposable.cs\" />\n    <Compile Include=\"EqualityComparer.cs\" />\n    <Compile Include=\"Extensions\\EnumerableDiffing.cs\" />\n    <Compile Include=\"Extensions\\EnumerableIndexing.cs\" />\n    <Compile Include=\"Extensions\\EnumerableJoin.cs\" />\n    <Compile Include=\"Extensions\\EnumerableSetOperations.cs\" />\n    <Compile Include=\"ObservableStack.cs\" />\n    <Compile Include=\"Matching\\MatchSomeExtension.cs\" />\n    <Compile Include=\"SetInvariantCultureExtension.cs\" />\n    <Compile Include=\"Extensions\\ImmutableDictionaryExtensions.cs\" />\n    <Compile Include=\"Extensions\\TaskExtensions.cs\" />\n    <Compile Include=\"Lookups\\Grouping.cs\" />\n    <Compile Include=\"Lookups\\Lookup.cs\" />\n    <Compile Include=\"Matching\\DoExtension.cs\" />\n    <Compile Include=\"ExternalApplications\\AppBundle.cs\" />\n    <Compile Include=\"ExternalApplications\\ExternalApplication.cs\" />\n    <Compile Include=\"ExternalApplications\\MonoExe.cs\" />\n    <Compile Include=\"ExternalApplications\\NativeExe.cs\" />\n    <Compile Include=\"FileOperations\\BackupFile.cs\" />\n    <Compile Include=\"FileOperations\\FileHelpers.cs\" />\n    <Compile Include=\"FileOperations\\ForceWrite.cs\" />\n    <Compile Include=\"FileOperations\\IFilePermission.cs\" />\n    <Compile Include=\"FileOperations\\IFileSystem.cs\" />\n    <Compile Include=\"FileOperations\\IShell.cs\" />\n    <Compile Include=\"LineEndings.cs\" />\n    <Compile Include=\"FileOperations\\MakePathUnique.cs\" />\n    <Compile Include=\"Paths\\AbsoluteDirectoryPath.cs\" />\n    <Compile Include=\"Paths\\AbsoluteFilePath.cs\" />\n    <Compile Include=\"Paths\\DirectoryName.cs\" />\n    <Compile Include=\"Paths\\DirectoryPath.cs\" />\n    <Compile Include=\"Paths\\FileName.cs\" />\n    <Compile Include=\"Paths\\FilePath.cs\" />\n    <Compile Include=\"Paths\\Interfaces\\IAbsolutePath.cs\" />\n    <Compile Include=\"Paths\\Interfaces\\IDirectoryPath.cs\" />\n    <Compile Include=\"Paths\\Interfaces\\IFilePath.cs\" />\n    <Compile Include=\"Paths\\Interfaces\\IName.cs\" />\n    <Compile Include=\"Paths\\Interfaces\\IPath.cs\" />\n    <Compile Include=\"Paths\\Interfaces\\IRelativePath.cs\" />\n    <Compile Include=\"Paths\\Operators\\BinarySerialization.cs\" />\n    <Compile Include=\"Paths\\Operators\\CombineWithName.cs\" />\n    <Compile Include=\"Paths\\Operators\\CombineWithRelativePath.cs\" />\n    <Compile Include=\"Paths\\Operators\\FindCommonAncestor.cs\" />\n    <Compile Include=\"Paths\\Operators\\IsRootedIn.cs\" />\n    <Compile Include=\"Paths\\Operators\\ParseNativePath.cs\" />\n    <Compile Include=\"Paths\\Operators\\PathJsonConverter.cs\" />\n    <Compile Include=\"Paths\\Operators\\RelativeTo.cs\" />\n    <Compile Include=\"Paths\\Operators\\Rename.cs\" />\n    <Compile Include=\"Paths\\RelativeDirectoryPath.cs\" />\n    <Compile Include=\"Paths\\RelativeFilePath.cs\" />\n    <Compile Include=\"FileOperations\\Reading.cs\" />\n    <Compile Include=\"FileOperations\\RetryLoop.cs\" />\n    <Compile Include=\"FileOperations\\ShellHelper.cs\" />\n    <Compile Include=\"StringToMemoryStream.cs\" />\n    <Compile Include=\"SystemGuidLoader.cs\" />\n    <Compile Include=\"SystemInfo\\SystemInfoFactory.cs\" />\n    <Compile Include=\"Text.cs\" />\n    <Compile Include=\"TextDocumentContent.cs\" />\n    <Compile Include=\"FileOperations\\Writing.cs\" />\n    <Compile Include=\"Pipes\\IPipeImpl.cs\" />\n    <Compile Include=\"Pipes\\NamedPipes.cs\" />\n    <Compile Include=\"NetworkHelper.cs\" />\n    <Compile Include=\"Pipes\\Pipe.cs\" />\n    <Compile Include=\"Pipes\\PipeName.cs\" />\n    <Compile Include=\"Pipes\\UnixSocketPipes.cs\" />\n    <Compile Include=\"Pipes\\UnixSocketStream.cs\" />\n    <Compile Include=\"Logging\\Formatter.cs\" />\n    <Compile Include=\"Logging\\IReport.cs\" />\n    <Compile Include=\"Logging\\NullLogger.cs\" />\n    <Compile Include=\"Logging\\Report.cs\" />\n    <Compile Include=\"Logging\\ReportFactory.cs\" />\n    <Compile Include=\"Logging\\UnhandledExceptionReporter.cs\" />\n    <Compile Include=\"Logging\\UnixSocketLogClient.cs\" />\n    <Compile Include=\"ProcessExtension.cs\" />\n    <Compile Include=\"Extensions\\ObjectExtensions.cs\" />\n    <Compile Include=\"Extensions\\ObservableBooleans.cs\" />\n    <Compile Include=\"Extensions\\ObservableExtensions.cs\" />\n    <Compile Include=\"RethrowExtension.cs\" />\n    <Compile Include=\"SequenceEqualityComparer.cs\" />\n    <Compile Include=\"SetEqualityComparer.cs\" />\n    <Compile Include=\"Serialization\\GuidSerializer.cs\" />\n    <Compile Include=\"Matching\\MatchWithExtension.cs\" />\n    <Compile Include=\"Matching\\IMatchTypes.cs\" />\n    <Compile Include=\"Extensions\\EnumerableExtensions.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Extensions\\StringExtensions.cs\" />\n    <Compile Include=\"Diagnostics\\ManualProfiling.cs\" />\n    <Compile Include=\"ValidationResult.cs\" />\n    <Compile Include=\"ConsoleExtensions.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/common/core/Outracks.Core.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Lookup/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Lookups/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/common/core/Paths/AbsoluteDirectoryPath.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic partial class AbsoluteDirectoryPath : IAbsolutePath, IDirectoryPath, IEquatable<AbsoluteDirectoryPath>\n\t{\n\t\tpublic AbsoluteDirectoryPath ContainingDirectory { get; private set; }\n\n\t\tpublic DirectoryName Name { get; private set; }\n\n\t\tstring IAbsolutePath.Name {  get { return Name.ToString(); } }\n\n\t\tinternal AbsoluteDirectoryPath(DirectoryName name, AbsoluteDirectoryPath basePath = null)\n\t\t{\n\t\t\tName = name;\n\t\t\tContainingDirectory = basePath;\n\t\t}\n\n\t\tpublic IEnumerable<DirectoryName> Parts\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn ContainingDirectory == null\n\t\t\t\t\t? new[] { Name }\n\t\t\t\t\t: ContainingDirectory.Parts.ConcatOne(Name);\n\t\t\t}\n\t\t}\n\n\t\tpublic string NativePath\n\t\t{\n\t\t\tget { return Path.Combine(Parts.Select(p => p.ToString()).ToArray()); }\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as AbsoluteDirectoryPath;\n\t\t\treturn other != null && Equals(other);\n\t\t}\n\n\t\tpublic bool Equals(AbsoluteDirectoryPath other)\n\t\t{\n\t\t\treturn ContainingDirectory == other.ContainingDirectory && Name == other.Name;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (ContainingDirectory == null ? 0 : ContainingDirectory.GetHashCode()) ^ Name.GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ContainingDirectory == null ? Name.ToString() : Path.Combine(ContainingDirectory.ToString(), Name.ToString());\n\t\t}\n\n\t\tpublic static bool operator ==(AbsoluteDirectoryPath a, AbsoluteDirectoryPath b)\n\t\t{\n\t\t\treturn ReferenceEquals(a, b) || (!ReferenceEquals(a, null) && !ReferenceEquals(b, null) && a.Equals(b));\n\t\t}\n\n\t\tpublic static bool operator !=(AbsoluteDirectoryPath a, AbsoluteDirectoryPath b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Paths/AbsoluteFilePath.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Outracks.IO\n{\n\tpublic partial class AbsoluteFilePath : IAbsolutePath, IFilePath, IEquatable<AbsoluteFilePath>\n\t{\n\t\tpublic AbsoluteDirectoryPath ContainingDirectory { get; private set; }\n\n\t\tpublic FileName Name { get; private set; }\n\t\tstring IAbsolutePath.Name { get { return Name.ToString(); } }\n\n\t\tinternal AbsoluteFilePath(FileName name, AbsoluteDirectoryPath containingDirectory)\n\t\t{\n\t\t\tContainingDirectory = containingDirectory;\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic IEnumerable<IName> Parts\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn ContainingDirectory == null\n\t\t\t\t\t? new[] { (IName)Name }\n\t\t\t\t\t: ContainingDirectory.Parts.ConcatOne((IName)Name);\n\t\t\t}\n\t\t}\n\t\tpublic string NativePath\n\t\t{\n\t\t\tget { return ToString(); }\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as AbsoluteFilePath;\n\t\t\treturn other != null && Equals(other);\n\t\t}\n\n\t\tpublic bool Equals(AbsoluteFilePath other)\n\t\t{\n\t\t\treturn ContainingDirectory == other.ContainingDirectory && Name == other.Name;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (ContainingDirectory == null ? 0 : ContainingDirectory.GetHashCode()) ^ Name.GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ContainingDirectory == null ? Name.ToString() : Path.Combine(ContainingDirectory.ToString(), Name.ToString());\n\t\t}\n\n\t\tpublic static bool operator ==(AbsoluteFilePath a, AbsoluteFilePath b)\n\t\t{\n\t\t\treturn ReferenceEquals(a, b) || (!ReferenceEquals(a, null) && !ReferenceEquals(b, null) && a.Equals(b));\n\t\t}\n\n\t\tpublic static bool operator !=(AbsoluteFilePath a, AbsoluteFilePath b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Paths/DirectoryName.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic class DirectoryName : IEquatable<DirectoryName>, IName, IComparable<DirectoryName>\n\t{\n\t\tpublic static DirectoryName ParentDirectory = new DirectoryName(\"..\");\n\t\tpublic static DirectoryName CurrentDirectory = new DirectoryName(\".\");\n\n\t\tpublic static IValidationResult<DirectoryName> Validate(string directoryName)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(directoryName))\n\t\t\t\treturn ValidationResult.Invalid<DirectoryName>(\"directory name is null or empty\");\n\n\t\t\tif (directoryName.Any(Path.GetInvalidPathChars().Contains))\n\t\t\t\treturn ValidationResult.Invalid<DirectoryName>(\"directory name contains invalid characters\");\n\n\t\t\treturn ValidationResult.Valid(new DirectoryName(directoryName));\n\t\t}\n\n\t\tpublic static DirectoryName GetRandomDirectoryName()\n\t\t{\n\t\t\treturn new DirectoryName(Path.GetRandomFileName());\n\t\t}\n\n\t\treadonly string _string;\n\n\t\tpublic DirectoryName(string directoryName)\n\t\t{\n\t\t\t_string = directoryName;\n\t\t}\n\n\t\tpublic bool IsParentDirectory\n\t\t{\n\t\t\tget { return this == ParentDirectory; }\n\t\t}\n\n\t\tpublic bool IsCurrentDirectory\n\t\t{\n\t\t\tget { return this == CurrentDirectory; }\n\t\t}\n\n\t\tpublic DirectoryName Add(string suffix)\n\t\t{\n\t\t\treturn new DirectoryName(_string + suffix);\n\t\t}\n\n\t\tpublic static implicit operator DirectoryName(string str)\n\t\t{\n\t\t\treturn new DirectoryName(str);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as DirectoryName;\n\t\t\treturn other != null && Equals(other);\n\t\t}\n\n\t\tpublic bool Equals(DirectoryName other)\n\t\t{\n\t\t\treturn _string == other._string;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (_string != null ? _string.GetHashCode() : 0);\n\t\t}\n\n\t\tpublic int CompareTo(DirectoryName other)\n\t\t{\n\t\t\treturn _string.CompareTo(other._string);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn _string;\n\t\t}\n\n\t\tpublic static bool operator ==(DirectoryName a, DirectoryName b)\n\t\t{\n\t\t\treturn ReferenceEquals(a, b) || (!ReferenceEquals(a, null) && !ReferenceEquals(b, null) && a.Equals(b));\n\t\t}\n\n\t\tpublic static bool operator !=(DirectoryName a, DirectoryName b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/DirectoryPath.cs",
    "content": "using System.IO;\n\nnamespace Outracks.IO\n{\n\tpublic static class DirectoryPath\n\t{\n\t\t/// <exception cref=\"System.UnauthorizedAccessException\" />\n\t\tpublic static AbsoluteDirectoryPath GetCurrentDirectory()\n\t\t{\n\t\t\treturn AbsoluteDirectoryPath.Parse(Directory.GetCurrentDirectory());\n\t\t}\n\n\t\t/// <exception cref=\"System.Security.SecurityException\" />\n\t\tpublic static AbsoluteDirectoryPath GetTempPath()\n\t\t{\n\t\t\treturn AbsoluteDirectoryPath.Parse(Path.GetTempPath());\n\t\t}\n\n\t\tpublic static IDirectoryPath Parse(string relativeOrAbsolutePath)\n\t\t{\n\t\t\treturn Path.IsPathRooted(relativeOrAbsolutePath)\n\t\t\t\t? (IDirectoryPath)AbsoluteDirectoryPath.Parse(relativeOrAbsolutePath)\n\t\t\t\t: (IDirectoryPath)RelativeDirectoryPath.Parse(relativeOrAbsolutePath);\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/FileName.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic static class AddExtensionExtension\n\t{\n\t\tpublic static AbsoluteFilePath AddExtension(this AbsoluteFilePath self, string extension)\n\t\t{\n\t\t\treturn self.ContainingDirectory / self.Name.AddExtension(extension);\n\t\t}\n\n\t\tpublic static RelativeFilePath AddExtension(this RelativeFilePath self, string extension)\n\t\t{\n\t\t\treturn self.BasePath / self.Name.AddExtension(extension);\n\t\t}\n\n\t\tpublic static AbsoluteFilePath RemoveExtension(this AbsoluteFilePath self, string extension)\n\t\t{\n\t\t\treturn self.ContainingDirectory / self.Name.RemoveExtension(extension);\n\t\t}\n\n\t\tpublic static RelativeFilePath RemoveExtension(this RelativeFilePath self, string extension)\n\t\t{\n\t\t\treturn self.BasePath / self.Name.RemoveExtension(extension);\n\t\t}\n\t}\n\n\n\tpublic class FileName : IEquatable<FileName>, IName, IComparable<FileName>\n\t{\n\t\treadonly string _string;\n\n\t\tpublic FileName(string fileName)\n\t\t{\n            if (fileName == null)\n                throw new ArgumentException(\"file name can not be null\");\n\n            if (fileName.IsEmpty())\n                throw new ArgumentException(\"file name can not be empty\");\n\n            if (fileName.Any(Path.GetInvalidFileNameChars().Contains))\n                throw new ArgumentException(\"file name '\" + fileName + \"' contains invalid characters\");\n\n\t\t\t_string = fileName;\n\t\t}\n\n\t\tpublic static IValidationResult<FileName> Validate(string fileName)\n\t\t{\n\t\t\tif(fileName == null)\n\t\t\t\treturn ValidationResult.Invalid<FileName>(\"file name can not be null\");\n\n\t\t\tif (fileName.IsEmpty())\n\t\t\t\treturn ValidationResult.Invalid<FileName>(\"file name can not be empty\");\n\n\t\t\tif (fileName.Any(Path.GetInvalidFileNameChars().Contains))\n\t\t\t\treturn ValidationResult.Invalid<FileName>(\"file name contains invalid characters\");\n\n\t\t\treturn ValidationResult.Valid(new FileName(fileName));\n\t\t}\n\n\t\tpublic static FileName GetRandomFileName()\n\t\t{\n\t\t\treturn new FileName(Path.GetRandomFileName());\n\t\t}\n\n\t\tpublic string Extension\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar dot = _string.LastIndexOf('.');\n\t\t\t\treturn dot == -1 ? String.Empty : _string.Substring(dot);\n\t\t\t}\n\t\t}\n\n\t\tpublic FileName WithoutExtension\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar dot = _string.LastIndexOf('.');\n\t\t\t\treturn new FileName(dot == -1 ? _string : _string.Substring(0, dot));\n\t\t\t}\n\t\t}\n\n\t\tpublic bool HasExtension(string extension)\n\t\t{\n\t\t\treturn String.Equals(Extension, EnsureHasDot(extension), StringComparison.CurrentCultureIgnoreCase);\n\t\t}\n\n\t\tpublic FileName StripExtension(string extension)\n\t\t{\n\t\t\treturn HasExtension(extension)\n\t\t\t\t? WithoutExtension\n\t\t\t\t: this;\n\t\t}\n\n\t\tpublic FileName AddExtension(string newExtension)\n\t\t{\n\t\t\treturn Add(EnsureHasDot(newExtension));\n\t\t}\n\n\t\tpublic FileName RemoveExtension(string oldExtension)\n\t\t{\n\t\t\treturn new FileName(_string.StripSuffix(\".\" + oldExtension));\n\t\t}\n\n\t\tpublic FileName Add(string suffix)\n\t\t{\n\t\t\treturn new FileName(_string + suffix);\n\t\t}\n\n\t\tpublic FileName Replace(string what, string with)\n\t\t{\n\t\t\treturn new FileName(_string.Replace(what, with));\n\t\t}\n\n\t\tpublic bool Contains(string what)\n\t\t{\n\t\t\treturn _string.Contains(what);\n\t\t}\n\n\t\tstatic string EnsureHasDot(string extension)\n\t\t{\n\t\t\tif (extension == null) throw new ArgumentNullException(\"extension\");\n\t\t\treturn extension.StartsWith(\".\") ? extension : \".\" + extension;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as FileName;\n\t\t\treturn other != null && Equals(other);\n\t\t}\n\n\t\tpublic bool Equals(FileName other)\n\t\t{\n\t\t\treturn _string == other._string;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (_string != null ? _string.GetHashCode() : 0);\n\t\t}\n\n\t\tpublic int CompareTo(FileName other)\n\t\t{\n\t\t\treturn _string.CompareTo(other._string);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn _string;\n\t\t}\n\n\t\tpublic static bool operator ==(FileName a, FileName b)\n\t\t{\n\t\t\treturn ReferenceEquals(a, b) || (!ReferenceEquals(a, null) && !ReferenceEquals(b, null) && a.Equals(b));\n\t\t}\n\n\t\tpublic static bool operator !=(FileName a, FileName b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Paths/FilePath.cs",
    "content": "using System.IO;\n\nnamespace Outracks.IO\n{\n\tpublic static class FilePath\n\t{\n\t\t/// <exception cref=\"System.IO.IOException\" />\n\t\tpublic static AbsoluteFilePath CreateTempFile()\n\t\t{\n\t\t\treturn AbsoluteFilePath.Parse(Path.GetTempFileName());\n\t\t}\n\n\t\tpublic static AbsoluteFilePath ParseAndMakeAbsolute(string path)\n\t\t{\n\t\t\treturn ParseAndMakeAbsolute(path, DirectoryPath.GetCurrentDirectory());\n\t\t}\n\n\t\tpublic static AbsoluteFilePath ParseAndMakeAbsolute(IFilePath path, AbsoluteDirectoryPath root)\n\t\t{\n\t\t\treturn path as AbsoluteFilePath ?? ParseAndMakeAbsolute(((RelativeFilePath) path).NativeRelativePath, root);\n\t\t}\n\n\t\tpublic static AbsoluteFilePath ParseAndMakeAbsolute(string path, AbsoluteDirectoryPath root)\n\t\t{\n\t\t\tvar filePath = Parse(path);\n\t\t\treturn filePath.MatchWith(\n\t\t\t\t(AbsoluteFilePath absolutePath) => absolutePath,\n\t\t\t\t(RelativeFilePath relativePath) => root / relativePath);\n\t\t}\n\n\t\tpublic static IFilePath Parse(string relativeOrAbsolutePath)\n\t\t{\n\t\t\treturn Path.IsPathRooted(relativeOrAbsolutePath)\n\t\t\t\t? (IFilePath) AbsoluteFilePath.Parse(relativeOrAbsolutePath)\n\t\t\t\t: (IFilePath) RelativeFilePath.Parse(relativeOrAbsolutePath);\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Interfaces/IAbsolutePath.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic interface IAbsolutePath : IPath, IMatchTypes<AbsoluteFilePath, AbsoluteDirectoryPath>\n\t{\n\t\tstring Name { get; }\n\n\t\tstring NativePath { get; }\n\n\t\tAbsoluteDirectoryPath ContainingDirectory { get; }\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Interfaces/IDirectoryPath.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic interface IDirectoryPath : IPath, IMatchTypes<AbsoluteDirectoryPath, RelativeDirectoryPath>\n\t{\n\t\t/*\n\t\tIDirectoryPath Combine(RelativeDirectoryPath path);\n\t\tIFilePath Combine(RelativeFilePath path);\n\n\t\tIDirectoryPath Combine(string pathName);\n\t\tIFilePath Combine(FileName name);\n\t\t*/\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Interfaces/IFilePath.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic interface IFilePath : IPath, IMatchTypes<AbsoluteFilePath, RelativeFilePath>\n\t{\n\t\tFileName Name { get; }\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Interfaces/IName.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic interface IName : IMatchTypes<FileName, DirectoryName>\n\t{\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Interfaces/IPath.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic interface IPath : IMatchTypes<IFilePath, IDirectoryPath>, IMatchTypes<IAbsolutePath, IRelativePath>\n\t{\n\t}\n\n}"
  },
  {
    "path": "src/common/core/Paths/Interfaces/IRelativePath.cs",
    "content": "namespace Outracks.IO\n{\n\tpublic interface IRelativePath : IPath, IMatchTypes<RelativeFilePath, RelativeDirectoryPath>\n\t{\n\t\tRelativeDirectoryPath BasePath { get; }\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Operators/BinarySerialization.cs",
    "content": "﻿using System.IO;\n\nnamespace Outracks.IO\n{\n\tpublic partial class AbsoluteFilePath\n\t{\n\t\tpublic static AbsoluteFilePath Read(BinaryReader reader)\n\t\t{\n\t\t\treturn Parse(reader.ReadString());\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, AbsoluteFilePath path)\n\t\t{\n\t\t\twriter.Write(path.NativePath);\n\t\t}\n\t}\n\n\tpublic partial class AbsoluteDirectoryPath\n\t{\n\t\tpublic static AbsoluteDirectoryPath Read(BinaryReader reader)\n\t\t{\n\t\t\treturn Parse(reader.ReadString());\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, AbsoluteDirectoryPath path)\n\t\t{\n\t\t\twriter.Write(path.NativePath);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Paths/Operators/CombineWithName.cs",
    "content": "﻿namespace Outracks.IO\n{\n\tpublic static class CombineWithName\n\t{\n\t\tpublic static AbsoluteFilePath Combine(this AbsoluteDirectoryPath basePath, FileName fileName)\n\t\t{\n\t\t\treturn new AbsoluteFilePath(fileName, basePath);\n\t\t}\n\n\t\tpublic static RelativeFilePath Combine(this RelativeDirectoryPath basePath, FileName fileName)\n\t\t{\n\t\t\treturn new RelativeFilePath(fileName, basePath);\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath Combine(this AbsoluteDirectoryPath basePath, DirectoryName directoryName)\n\t\t{\n\t\t\tif (directoryName.IsCurrentDirectory)\n\t\t\t\treturn basePath;\n\n\t\t\tif (directoryName.IsParentDirectory)\n\t\t\t\treturn basePath.ContainingDirectory;\n\n\t\t\treturn new AbsoluteDirectoryPath(directoryName, basePath);\n\t\t}\n\n\t\tpublic static RelativeDirectoryPath Combine(this RelativeDirectoryPath basePath, DirectoryName directoryName)\n\t\t{\n\t\t\tif (directoryName.IsCurrentDirectory)\n\t\t\t\treturn basePath;\n\n\t\t\tif (directoryName.IsParentDirectory && basePath.HasContainingDirectory())\n\t\t\t\treturn basePath.GetContainingDirectory();\n\n\t\t\treturn new RelativeDirectoryPath(directoryName, basePath);\n\t\t}\n\n\t\tstatic bool HasContainingDirectory(this RelativeDirectoryPath path)\n\t\t{\n\t\t\treturn path != null && !path.Name.IsParentDirectory;\n\t\t}\n\n\t\tstatic RelativeDirectoryPath GetContainingDirectory(this RelativeDirectoryPath path)\n\t\t{\n\t\t\treturn path.BasePath;\n\t\t}\n\t}\n\n\tpublic partial class AbsoluteDirectoryPath\n\t{\n\t\tpublic static AbsoluteFilePath operator /(AbsoluteDirectoryPath containingDir, FileName fileName)\n\t\t{\n\t\t\treturn containingDir.Combine(fileName);\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath operator /(AbsoluteDirectoryPath containingDir, DirectoryName fileName)\n\t\t{\n\t\t\treturn containingDir.Combine(fileName);\n\t\t}\n\t}\n\n\tpublic partial class RelativeDirectoryPath\n\t{\n\t\tpublic static RelativeFilePath operator /(RelativeDirectoryPath containingDir, FileName fileName)\n\t\t{\n\t\t\treturn containingDir.Combine(fileName);\n\t\t}\n\n\t\tpublic static RelativeDirectoryPath operator /(RelativeDirectoryPath containingDir, DirectoryName fileName)\n\t\t{\n\t\t\treturn containingDir.Combine(fileName);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/common/core/Paths/Operators/CombineWithRelativePath.cs",
    "content": "﻿namespace Outracks.IO\n{\n\tpublic static class CombineWithRelativePath\n\t{\n\t\tpublic static IAbsolutePath Combine(this AbsoluteDirectoryPath basePath, IRelativePath path)\n\t\t{\n\t\t\treturn path == null\n\t\t\t\t? basePath\n\t\t\t\t: path.MatchWith(\n\t\t\t\t\t(RelativeFilePath file) => (IAbsolutePath)basePath.Combine(file),\n\t\t\t\t\t(RelativeDirectoryPath dir) => (IAbsolutePath)basePath.Combine(dir));\n\t\t}\n\n\t\tpublic static IRelativePath Combine(this RelativeDirectoryPath basePath, IRelativePath path)\n\t\t{\n\t\t\treturn path == null\n\t\t\t\t? basePath\n\t\t\t\t: path.MatchWith(\n\t\t\t\t\t(RelativeFilePath file) => (IRelativePath)basePath.Combine(file),\n\t\t\t\t\t(RelativeDirectoryPath dir) => (IRelativePath)basePath.Combine(dir));\n\t\t}\n\n\t\tpublic static AbsoluteFilePath Combine(this AbsoluteDirectoryPath basePath, RelativeFilePath path)\n\t\t{\n\t\t\treturn basePath.Combine(path.BasePath).Combine(path.Name);\n\t\t}\n\n\t\tpublic static RelativeFilePath Combine(this RelativeDirectoryPath basePath, RelativeFilePath path)\n\t\t{\n\t\t\treturn basePath.Combine(path.BasePath).Combine(path.Name);\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath Combine(this AbsoluteDirectoryPath basePath, RelativeDirectoryPath relativePath)\n\t\t{\n\t\t\treturn relativePath == null ? basePath : basePath.Combine(relativePath.BasePath).Combine(relativePath.Name);\n\t\t}\n\n\t\tpublic static RelativeDirectoryPath Combine(this RelativeDirectoryPath basePath, RelativeDirectoryPath relativePath)\n\t\t{\n\t\t\treturn relativePath == null ? basePath : basePath.Combine(relativePath.BasePath).Combine(relativePath.Name);\n\t\t}\n\t}\n\n\tpublic partial class AbsoluteDirectoryPath\n\t{\n\t\tpublic static IAbsolutePath operator /(AbsoluteDirectoryPath containingDir, IRelativePath relativeFilePath)\n\t\t{\n\t\t\treturn containingDir.Combine(relativeFilePath);\n\t\t}\n\n\t\tpublic static AbsoluteFilePath operator /(AbsoluteDirectoryPath containingDir, RelativeFilePath relativeFilePath)\n\t\t{\n\t\t\treturn containingDir.Combine(relativeFilePath);\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath operator /(AbsoluteDirectoryPath containingDir, RelativeDirectoryPath relativeDirectoryPath)\n\t\t{\n\t\t\treturn containingDir.Combine(relativeDirectoryPath);\n\t\t}\n\t}\n\n\tpublic partial class RelativeDirectoryPath\n\t{\n\t\tpublic static IRelativePath operator /(RelativeDirectoryPath containingDir, IRelativePath relativeFilePath)\n\t\t{\n\t\t\treturn containingDir.Combine(relativeFilePath);\n\t\t}\n\n\t\tpublic static RelativeFilePath operator /(RelativeDirectoryPath containingDir, RelativeFilePath relativeFilePath)\n\t\t{\n\t\t\treturn containingDir.Combine(relativeFilePath);\n\t\t}\n\n\t\tpublic static RelativeDirectoryPath operator /(RelativeDirectoryPath containingDir, RelativeDirectoryPath relativeDirectoryPath)\n\t\t{\n\t\t\treturn containingDir.Combine(relativeDirectoryPath);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/common/core/Paths/Operators/FindCommonAncestor.cs",
    "content": "﻿using System;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic partial class AbsoluteDirectoryPath\n\t{\n\t\tpublic static AbsoluteDirectoryPath FindCommonAncestor(AbsoluteDirectoryPath path1, AbsoluteDirectoryPath path2)\n\t\t{\n\t\t\tvar orderedPaths = OrderByDepth(path1, path2);\n\t\t\tvar balancedPaths = Balance(orderedPaths);\n\t\t\tif (balancedPaths == null)\n\t\t\t\treturn null;\n\n\t\t\treturn FindCommonAncestorBalanced(balancedPaths.Item1, balancedPaths.Item2);\n\t\t}\n\n\t\tstatic Tuple<AbsoluteDirectoryPath, AbsoluteDirectoryPath> Balance(OrderedNodes paths)\n\t\t{\n\t\t\tvar tmpPath = paths.Longest;\n\t\t\tvar tmpDepth = paths.LongestDepth;\n\t\t\twhile (paths.ShortestDepth < tmpDepth)\n\t\t\t{\n\t\t\t\tif (tmpPath == null)\n\t\t\t\t\treturn null;\n\t\t\t\ttmpPath = tmpPath.ContainingDirectory;\n\t\t\t\ttmpDepth--;\n\t\t\t}\n\t\t\treturn Tuple.Create(paths.Shortest, tmpPath);\n\t\t}\n\n\t\tstatic OrderedNodes OrderByDepth(AbsoluteDirectoryPath left, AbsoluteDirectoryPath right)\n\t\t{\n\t\t\tint leftDepth = left.Depth;\n\t\t\tint rightDepth = right.Depth;\n\n\t\t\treturn leftDepth <= rightDepth\n\t\t\t\t? new OrderedNodes(left, leftDepth, right, rightDepth)\n\t\t\t\t: new OrderedNodes(right, rightDepth, left, leftDepth);\n\t\t}\n\n\t\tstatic AbsoluteDirectoryPath FindCommonAncestorBalanced(AbsoluteDirectoryPath left, AbsoluteDirectoryPath right)\n\t\t{\n\t\t\twhile (left != null && right != null)\n\t\t\t{\n\t\t\t\tif (left == right)\n\t\t\t\t\treturn left;\n\t\t\t\tleft = left.ContainingDirectory;\n\t\t\t\tright = right.ContainingDirectory;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tint Depth\n\t\t{\n\t\t\tget { return Parts.Count(); }\n\t\t}\n\t}\n\n\tstruct OrderedNodes\n\t{\n\t\tpublic readonly AbsoluteDirectoryPath Shortest;\n\t\tpublic readonly AbsoluteDirectoryPath Longest;\n\t\tpublic readonly int ShortestDepth;\n\t\tpublic readonly int LongestDepth;\n\t\tpublic OrderedNodes(AbsoluteDirectoryPath shortest, int shortestDepth, AbsoluteDirectoryPath longest, int longestDepth)\n\t\t{\n\t\t\tShortest = shortest;\n\t\t\tShortestDepth = shortestDepth;\n\t\t\tLongest = longest;\n\t\t\tLongestDepth = longestDepth;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/core/Paths/Operators/IsRootedIn.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic static class IsRootedInExtension\n\t{\n\t\tpublic static bool SharesRootWith(this IAbsolutePath self, IAbsolutePath other)\n\t\t{\n\t\t\treturn Equals(self.GetRoot(), other.GetRoot());\n\t\t}\n\n\t\tpublic static IAbsolutePath GetRoot(this IAbsolutePath self)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tif (self.ContainingDirectory == null)\n\t\t\t\t\treturn self;\n\n\t\t\t\tself = self.ContainingDirectory;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool IsRootOf(this IAbsolutePath self, IAbsolutePath other)\n\t\t{\n\t\t\treturn IsRootedIn(other, self);\n\t\t}\n\n\t\tpublic static bool IsRootedIn(this IAbsolutePath self, IAbsolutePath other)\n\t\t{\n\t\t\treturn !Equals(self, other) && IsOrIsRootedIn(self, other);\n\t\t}\n\n\t\tpublic static bool IsOrIsRootedIn(this IAbsolutePath self, IAbsolutePath other)\n\t\t{\n\t\t\treturn\n\t\t\t\tEquals(self, other) ||\n\t\t\t\t(self.ContainingDirectory != null && self.ContainingDirectory.IsOrIsRootedIn(other));\n\t\t}\n\n\n\t\tpublic static IEnumerable<IAbsolutePath> FindRoots(this IEnumerable<IAbsolutePath> paths)\n\t\t{\n\t\t\treturn paths.Where(path => paths.None(other => other.IsRootOf(path)));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Operators/ParseNativePath.cs",
    "content": "﻿using System;\nusing System.IO;\nusing Newtonsoft.Json;\n\nnamespace Outracks.IO\n{\n\t[JsonConverter(typeof(PathJsonConverter))]\n\tpublic partial class AbsoluteDirectoryPath\n\t{\n\t\tpublic static IValidationResult<AbsoluteDirectoryPath> Validate(string nativePath)\n\t\t{\n\t\t\treturn TryParse(nativePath).AsValidationResult(\"Invalid path\");\n\t\t}\n\n\t\tpublic static Optional<AbsoluteDirectoryPath> TryParse(string nativePath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Parse(nativePath);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"InvalidPath\"></exception>\n\t\t/// <exception cref=\"ArgumentException\"></exception>\n\t\tpublic static AbsoluteDirectoryPath Parse(string nativePath)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(nativePath))\n\t\t\t\treturn null;\n\n\t\t\t// Normalize drive letter to uppercase on Windows.\n\t\t\tif (Path.DirectorySeparatorChar == '\\\\' && nativePath.Length > 2 &&\n\t\t\t\t\t\tchar.IsLower(nativePath[0]) && nativePath[1] == ':' && nativePath[2] == '\\\\')\n\t\t\t\t\tnativePath = char.ToUpper(nativePath[0]) + nativePath.Substring(1);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar parent = Path.GetDirectoryName(nativePath);\n\t\t\t\tif (parent != null && Path.GetFileName(nativePath) == \"\")\n\t\t\t\t{\n\t\t\t\t\tnativePath = parent;\n\t\t\t\t\tparent = Path.GetDirectoryName(parent);\n\t\t\t\t}\n\n\t\t\t\treturn string.IsNullOrEmpty(parent)\n\t\t\t\t\t? new AbsoluteDirectoryPath(nativePath)\n\t\t\t\t\t: new AbsoluteDirectoryPath(\n\t\t\t\t\t\tPath.GetFileName(nativePath),\n\t\t\t\t\t\tParse(parent));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t[JsonConverter(typeof(PathJsonConverter))]\n\tpublic partial class RelativeDirectoryPath\n\t{\n\t\tpublic static Optional<RelativeDirectoryPath> TryParse(string nativePath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Parse(nativePath);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"InvalidPath\"></exception>\n\t\tpublic static RelativeDirectoryPath Parse(string nativePath)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(nativePath)) return null;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new RelativeDirectoryPath(\n\t\t\t\t\tnew DirectoryName(Path.GetFileName(nativePath)),\n\t\t\t\t\tParse(Path.GetDirectoryName(nativePath)));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t}\n\n\t}\n\n\t[JsonConverter(typeof(PathJsonConverter))]\n\tpublic partial class AbsoluteFilePath\n\t{\n\t\tpublic static Optional<AbsoluteFilePath> TryParse(string nativePath)\n\t\t{\n\t\t\t// Early out for common cases for now instead of fixing things\n\t\t\tif (string.IsNullOrWhiteSpace(nativePath))\n\t\t\t\treturn Optional.None();\n\n\t\t\tif (nativePath.IndexOf(Path.DirectorySeparatorChar) == -1 &&\n\t\t\t\tnativePath.IndexOf(Path.AltDirectorySeparatorChar) == -1)\n\t\t\t\treturn Optional.None();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Parse(nativePath);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"InvalidPath\"></exception>\n\t\t/// <exception cref=\"ArgumentException\"></exception>\n\t\tpublic static AbsoluteFilePath Parse(string nativePath)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(nativePath))\n\t\t\t\tthrow new ArgumentException(\"nativePath\");\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new AbsoluteFilePath(\n\t\t\t\t\tnew FileName(Path.GetFileName(nativePath)),\n\t\t\t\t\tAbsoluteDirectoryPath.Parse(Path.GetDirectoryName(nativePath)));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t[JsonConverter(typeof(PathJsonConverter))]\n\tpublic partial class RelativeFilePath\n\t{\n\t\tpublic static Optional<RelativeFilePath> TryParse(string nativePath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Parse(nativePath);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"InvalidPath\"></exception>\n\t\tpublic static RelativeFilePath Parse(string nativePath)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(nativePath)) return null;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new RelativeFilePath(\n\t\t\t\t\tnew FileName(Path.GetFileName(nativePath)),\n\t\t\t\t\tRelativeDirectoryPath.Parse(Path.GetDirectoryName(nativePath)));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static class UriExtensionMethods\n\t{\n\t\tpublic static AbsoluteFilePath ToAbsoluteFilePath(this Uri uri)\n\t\t{\n\t\t\treturn AbsoluteFilePath.Parse(Uri.UnescapeDataString(uri.AbsolutePath));\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath ToAbsoluteDirectoryPath(this Uri uri)\n\t\t{\n\t\t\treturn AbsoluteDirectoryPath.Parse(Uri.UnescapeDataString(uri.LocalPath));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Paths/Operators/PathJsonConverter.cs",
    "content": "﻿using System;\nusing Newtonsoft.Json;\n\nnamespace Outracks.IO\n{\n\tpublic class PathJsonConverter : JsonConverter\n\t{\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tif (value is AbsoluteFilePath) writer.WriteValue(((AbsoluteFilePath) value).NativePath);\n\t\t\telse if (value is RelativeFilePath)  writer.WriteValue(((RelativeFilePath)value).NativeRelativePath);\n\t\t\telse if (value is AbsoluteDirectoryPath)  writer.WriteValue(((AbsoluteDirectoryPath)value).NativePath);\n\t\t\telse if (value is RelativeDirectoryPath) writer.WriteValue(((RelativeDirectoryPath)value).NativeRelativePath);\n\t\t\telse throw new ArgumentException(\"The value '\" + value + \"' was not recognized by this converter\");\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tif (objectType == typeof(AbsoluteFilePath)) return AbsoluteFilePath.Parse((string)reader.Value);\n\t\t\tif (objectType == typeof(RelativeFilePath)) return RelativeFilePath.Parse((string)reader.Value);\n\t\t\tif (objectType == typeof (AbsoluteDirectoryPath)) return AbsoluteDirectoryPath.Parse((string)reader.Value);\n\t\t\tif (objectType == typeof(RelativeDirectoryPath)) return RelativeDirectoryPath.Parse((string)reader.Value);\n\t\t\tthrow new ArgumentException(\"The type '\" + objectType.FullName + \"' was not recognized by this converter\");\n\t\t}\n\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof (AbsoluteFilePath)\n\t\t\t\t|| objectType == typeof (RelativeFilePath)\n\t\t\t\t|| objectType == typeof (AbsoluteDirectoryPath)\n\t\t\t\t|| objectType == typeof (RelativeDirectoryPath);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/Operators/RelativeTo.cs",
    "content": "﻿namespace Outracks.IO\n{\n\tpublic static class RelativeToExtension\n\t{\n\t\tpublic static IAbsolutePath Rebase(this IAbsolutePath path, AbsoluteDirectoryPath from, AbsoluteDirectoryPath onto)\n\t\t{\n\t\t\treturn onto.Combine(path.RelativeTo(from));\n\t\t}\n\n\t\tpublic static AbsoluteFilePath Rebase(this AbsoluteFilePath path, AbsoluteDirectoryPath from, AbsoluteDirectoryPath onto)\n\t\t{\n\t\t\treturn onto / path.RelativeTo(from);\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath Rebase(this AbsoluteDirectoryPath path, AbsoluteDirectoryPath from, AbsoluteDirectoryPath onto)\n\t\t{\n\t\t\treturn onto / path.RelativeTo(from);\n\t\t}\n\n\t\tpublic static IRelativePath RelativeTo(this IAbsolutePath destination, AbsoluteDirectoryPath source)\n\t\t{\n\t\t\treturn destination.MatchWith(\n\t\t\t\t(AbsoluteFilePath file) => (IRelativePath)file.RelativeTo(source),\n\t\t\t\t(AbsoluteDirectoryPath dir) => (IRelativePath)dir.RelativeTo(source));\n\t\t}\n\n\t\tpublic static RelativeFilePath RelativeTo(this AbsoluteFilePath destination, AbsoluteDirectoryPath source)\n\t\t{\n\t\t\treturn destination.ContainingDirectory.RelativeTo(source) / destination.Name;\n\t\t}\n\n\t\tpublic static RelativeDirectoryPath RelativeTo(this AbsoluteDirectoryPath destination, AbsoluteDirectoryPath source)\n\t\t{\n\t\t\tvar commonAncestor = AbsoluteDirectoryPath.FindCommonAncestor(source, destination);\n\n\t\t\tvar sourceToAncestor = source.ToAncestor(commonAncestor);\n\n\t\t\tvar sourceToDestination = sourceToAncestor.ToLeaf(commonAncestor, destination);\n\n\t\t\treturn sourceToDestination;\n\t\t}\n\n\t\tstatic RelativeDirectoryPath ToAncestor(this AbsoluteDirectoryPath leaf, AbsoluteDirectoryPath ancestor)\n\t\t{\n\t\t\treturn leaf == ancestor ? null : new RelativeDirectoryPath(DirectoryName.ParentDirectory, leaf.ContainingDirectory.ToAncestor(ancestor));\n\t\t}\n\n\t\tstatic RelativeDirectoryPath ToLeaf(this RelativeDirectoryPath self, AbsoluteDirectoryPath ancestor, AbsoluteDirectoryPath leaf)\n\t\t{\n\t\t\treturn leaf == ancestor ? self : new RelativeDirectoryPath(leaf.Name, self.ToLeaf(ancestor, leaf.ContainingDirectory));\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/common/core/Paths/Operators/Rename.cs",
    "content": "﻿namespace Outracks.IO\n{\n\tpublic static class RenamePath\n\t{\n\t\tpublic static IAbsolutePath Rename(this IAbsolutePath path, string newName)\n\t\t{\n\t\t\treturn path.MatchWith(\n\t\t\t\t(AbsoluteFilePath file) => (IAbsolutePath)file.Rename(new FileName(newName)),\n\t\t\t\t(AbsoluteDirectoryPath dir) => (IAbsolutePath)dir.Rename(new DirectoryName(newName)));\n\t\t}\n\n\t\tpublic static IRelativePath Rename(this IRelativePath path, string newName)\n\t\t{\n\t\t\treturn path.MatchWith(\n\t\t\t\t(RelativeFilePath file) => (IRelativePath)file.Rename(new FileName(newName)),\n\t\t\t\t(RelativeDirectoryPath dir) => (IRelativePath)dir.Rename(new DirectoryName(newName)));\n\t\t}\n\n\t\tpublic static RelativeFilePath Rename(this RelativeFilePath path, FileName newName)\n\t\t{\n\t\t\treturn new RelativeFilePath(newName, path.BasePath);\n\t\t}\n\n\t\tpublic static AbsoluteFilePath Rename(this AbsoluteFilePath path, FileName newName)\n\t\t{\n\t\t\treturn new AbsoluteFilePath(newName, path.ContainingDirectory);\n\t\t}\n\n\t\tpublic static RelativeDirectoryPath Rename(this RelativeDirectoryPath path, DirectoryName newName)\n\t\t{\n\t\t\treturn new RelativeDirectoryPath(newName, path.BasePath);\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath Rename(this AbsoluteDirectoryPath path, DirectoryName newName)\n\t\t{\n\t\t\treturn new AbsoluteDirectoryPath(newName, path.ContainingDirectory);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Paths/RelativeDirectoryPath.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic partial class RelativeDirectoryPath : IRelativePath, IDirectoryPath, IEquatable<RelativeDirectoryPath>\n\t{\n\t\tpublic static RelativeDirectoryPath Empty\n\t\t{\n\t\t\tget { return null; } // we are using null for this for now, considering replacing\n\t\t}\n\n\t\tpublic RelativeDirectoryPath BasePath { get; private set; }\n\n\t\tpublic DirectoryName Name { get; private set; }\n\n\t\tinternal RelativeDirectoryPath(DirectoryName name, RelativeDirectoryPath basePath = null)\n\t\t{\n\t\t\tBasePath = basePath;\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic IEnumerable<DirectoryName> Parts\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn BasePath == null\n\t\t\t\t\t? new[] { Name }\n\t\t\t\t\t: BasePath.Parts.ConcatOne(Name);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as RelativeDirectoryPath;\n\t\t\treturn other != null && Equals(other);\n\t\t}\n\n\t\tpublic bool Equals(RelativeDirectoryPath other)\n\t\t{\n\t\t\treturn BasePath == other.BasePath && Name == other.Name;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (BasePath == null ? 0 : BasePath.GetHashCode()) ^ Name.GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn BasePath == null ? Name.ToString() : BasePath + \"/\" + Name;\n\t\t}\n\n\t\tpublic string NativeRelativePath\n\t\t{\n\t\t\tget { return Path.Combine(Parts.Select(p => p.ToString()).ToArray()); }\n\t\t}\n\n\t\tpublic static bool operator ==(RelativeDirectoryPath a, RelativeDirectoryPath b)\n\t\t{\n\t\t\treturn ReferenceEquals(a, b) || (!ReferenceEquals(a, null) && !ReferenceEquals(b, null) && a.Equals(b));\n\t\t}\n\n\t\tpublic static bool operator !=(RelativeDirectoryPath a, RelativeDirectoryPath b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Paths/RelativeFilePath.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic partial class RelativeFilePath : IRelativePath, IFilePath, IEquatable<RelativeFilePath>\n\t{\n\t\tpublic RelativeDirectoryPath BasePath { get; private set; }\n\n\t\tpublic FileName Name { get; private set; }\n\n\t\tinternal RelativeFilePath(FileName name, RelativeDirectoryPath basePath = null)\n\t\t{\n\t\t\tBasePath = basePath;\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic IEnumerable<IName> Parts\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn BasePath == null\n\t\t\t\t\t? new [] { (IName)Name }\n\t\t\t\t\t: BasePath.Parts.ConcatOne((IName)Name);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as RelativeFilePath;\n\t\t\treturn other != null && Equals(other);\n\t\t}\n\n\t\tpublic bool Equals(RelativeFilePath other)\n\t\t{\n\t\t\treturn BasePath == other.BasePath && Name == other.Name;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (BasePath == null ? 0 : BasePath.GetHashCode()) ^ Name.GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn BasePath == null ? Name.ToString() : BasePath + \"/\" + Name;\n\t\t}\n\n\t\tpublic string NativeRelativePath\n\t\t{\n\t\t\tget { return Path.Combine(Parts.Select(p => p.ToString()).ToArray()); }\n\t\t}\n\n\t\tpublic static bool operator ==(RelativeFilePath a, RelativeFilePath b)\n\t\t{\n\t\t\treturn ReferenceEquals(a, b) || (!ReferenceEquals(a, null) && !ReferenceEquals(b, null) && a.Equals(b));\n\t\t}\n\n\t\tpublic static bool operator !=(RelativeFilePath a, RelativeFilePath b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Pipes/IPipeImpl.cs",
    "content": "﻿using System.IO;\nusing System.Threading.Tasks;\n\nnamespace Outracks.IPC\n{\n\tpublic interface IPipeImpl\n\t{\n\t\tTask<Stream> Connect(PipeName name);\n\n\t\tTask<Stream> Host(PipeName name);\n\t}\n}"
  },
  {
    "path": "src/common/core/Pipes/NamedPipes.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.IO.Pipes;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Outracks.IPC\n{\n\tpublic class NamedPipes : IPipeImpl\n\t{\n\t\tpublic static bool AreSupported\n\t\t{\n\t\t\tget { return Environment.OSVersion.Platform == PlatformID.Win32NT; }\n\t\t}\n\n\t\tpublic Task<Stream> Connect(PipeName name)\n\t\t{\n\t\t\treturn Task.Run(() =>\n\t\t\t{\n\t\t\t\tvar pipeName = name.ToString();\n\t\t\t\tvar stream = new NamedPipeClientStream(pipeName);\n\n\t\t\t\twhile (NamedPipeDoesNotExist(pipeName))\n\t\t\t\t{\n\t\t\t\t\tThread.Sleep(10);\n\t\t\t\t}\n\n\t\t\t\tstream.Connect();\n\t\t\t\treturn (Stream)stream;\n\t\t\t});\n\t\t}\n\n\t\tpublic Task<Stream> Host(PipeName name)\n\t\t{\n\t\t\treturn Task.Run(() =>\n\t\t\t{\n\t\t\t\tvar stream = new NamedPipeServerStream(name.ToString());\n\t\t\t\tstream.WaitForConnection();\n\t\t\t\treturn (Stream)stream;\n\t\t\t});\n\t\t}\n\n\t\t[return: MarshalAs(UnmanagedType.Bool)]\n\t\t[DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n\t\tprivate static extern bool WaitNamedPipe(string name, int timeout);\n\n\n\t\t/// <summary>\n\t\t/// Provides an indication if the named pipe exists.\n\t\t/// This has to prove the pipe does not exist. If there is any doubt, this\n\t\t/// returns that it does exist and it is up to the caller to attempt to connect\n\t\t/// to that server. The means that there is a wide variety of errors that can occur that\n\t\t/// will be ignored - for example, a pipe name that contains invalid characters will result\n\t\t/// in a return value of false.\n\t\t///\n\t\t/// </summary>\n\t\t/// <param name=\"pipeName\">The pipe to connect to</param>\n\t\t/// <returns>false if it can be proven it does not exist, otherwise true</returns>\n\t\t/// <remarks>\n\t\t/// Attempts to check if the pipe server exists without incurring the cost\n\t\t/// of calling NamedPipeClientStream.Connect. This is because Connect either\n\t\t/// times out and throws an exception or goes into a tight spin loop burning\n\t\t/// up cpu cycles if the server does not exist.\n\t\t///\n\t\t/// Common Error codes from WinError.h\n\t\t/// ERROR_FILE_NOT_FOUND 2L\n\t\t/// ERROR_BROKEN_PIPE =  109 (0x6d)\n\t\t/// ERROR_BAD_PATHNAME  161L The specified path is invalid.\n\t\t/// ERROR_BAD_PIPE =  230  (0xe6) The pipe state is invalid.\n\t\t/// ERROR_PIPE_BUSY =  231 (0xe7) All pipe instances are busy.\n\t\t/// ERROR_NO_DATA =   232   (0xe8) the pipe is being closed\n\t\t/// ERROR_PIPE_NOT_CONNECTED 233L No process is on the other end of the pipe.\n\t\t/// ERROR_PIPE_CONNECTED        535L There is a process on other end of the pipe.\n\t\t/// ERROR_PIPE_LISTENING        536L Waiting for a process to open the other end of the pipe.\n\t\t///\n\t\t/// </remarks>\n\t\tstatic bool NamedPipeDoesNotExist(string pipeName)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar timeout = 0;\n\t\t\t\tvar normalizedPath = Path.GetFullPath(string.Format(@\"\\\\.\\pipe\\{0}\", pipeName));\n\t\t\t\tvar exists = WaitNamedPipe(normalizedPath, timeout);\n\n\t\t\t\tif (!exists)\n\t\t\t\t{\n\t\t\t\t\tvar error = Marshal.GetLastWin32Error();\n\n\t\t\t\t\tif (error == 0) // pipe does not exist\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif (error == 2) // win32 error code for file not found\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\t// TODO: Report to cortex here\n\t\t\t\treturn true; // assume it exists\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Pipes/Pipe.cs",
    "content": "﻿using System.IO;\nusing System.Threading.Tasks;\n\nnamespace Outracks.IPC\n{\n\tpublic static class Pipe\n\t{\n\t\tpublic static Task<Stream> Connect(PipeName name)\n\t\t{\n\t\t\treturn GetPipeImpl().Connect(name);\n\t\t}\n\n\t\tpublic static Task<Stream> Host(PipeName name)\n\t\t{\n\t\t\treturn GetPipeImpl().Host(name);\n\t\t}\n\n\t\tstatic IPipeImpl GetPipeImpl()\n\t\t{\n\t\t\tif (NamedPipes.AreSupported)\n\t\t\t\treturn new NamedPipes();\n\n\t\t\treturn new UnixSocketPipes();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Pipes/PipeName.cs",
    "content": "\nusing System;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Security.Permissions;\n\nnamespace Outracks.IPC\n{\n\t[Serializable]\n\tpublic struct PipeName : IEquatable<PipeName>, ISerializable\n\t{\n\t\tpublic static PipeName New()\n\t\t{\n\t\t\treturn new PipeName(Guid.NewGuid());\n\t\t}\n\t\tpublic static Optional<PipeName> TryParse(string nativePipe)\n\t\t{\n\t\t\treturn new PipeName(nativePipe);\n\t\t}\n\n\t\treadonly string _name;\n\n\t\tpublic PipeName(string name)\n\t\t{\n\t\t\t_name = name;\n\t\t}\n\n\t\tpublic PipeName(Guid guid)\n\t\t{\n\t\t\t_name = guid.ToString();\n\t\t}\n\n\t\tpublic static PipeName operator /(PipeName baseName, string subName)\n\t\t{\n\t\t\treturn new PipeName(baseName + \".\" + subName);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn _name;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _name.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is PipeName && Equals((PipeName)obj);\n\t\t}\n\n\t\tpublic bool Equals(PipeName other)\n\t\t{\n\t\t\treturn _name == other._name;\n\t\t}\n\n\t\tpublic static bool operator ==(PipeName left, PipeName right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(PipeName left, PipeName right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\t[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]\n\t\tPipeName(SerializationInfo info, StreamingContext context)\n\t\t{\n\t\t\t_name = info.GetString(\"_name\");\n\t\t}\n\n\t\tpublic void GetObjectData(SerializationInfo info, StreamingContext context)\n\t\t{\n\t\t\tif (info == null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentNullException(\"info\");\n\t\t\t}\n\n\t\t\tinfo.AddValue(\"_name\", _name);\n\t\t}\n\n\t\tpublic static PipeName Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new PipeName(reader.ReadString());\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, PipeName name)\n\t\t{\n\t\t\twriter.Write(name._name);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Pipes/SocketWin32.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Outracks\n{\n\tpublic static class SocketWin32\n\t{\n\t\t[DllImport(\"kernel32.dll\", SetLastError = true)]\n\t\tpublic static extern bool SetHandleInformation(IntPtr hObject, HANDLE_FLAGS dwMask, HANDLE_FLAGS dwFlags);\n\n\t\t[Flags]\n\t\tpublic enum HANDLE_FLAGS : uint\n\t\t{\n\t\t\tNone = 0,\n\t\t\tINHERIT = 1,\n\t\t\tPROTECT_FROM_CLOSE = 2\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Pipes/UnixSocketPipes.cs",
    "content": "﻿using System.IO;\nusing System.Threading.Tasks;\n\nnamespace Outracks.IPC\n{\n\tpublic class UnixSocketPipes : IPipeImpl\n\t{\n\t\tpublic Task<Stream> Connect(PipeName name)\n\t\t{\n            return Task.Run(() => (Stream)new UnixSocketStream(name, SocketUsage.Client));\n\t\t}\n\n\t\tpublic Task<Stream> Host(PipeName name)\n\t\t{\n            return Task.Run(() => (Stream)new UnixSocketStream(name, SocketUsage.Host));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/Pipes/UnixSocketStream.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Net.Sockets;\nusing System.Threading;\nusing Mono.Unix;\nusing Mono.Unix.Native;\n\nnamespace Outracks.IPC\n{\n\tpublic enum SocketUsage\n\t{\n\t\tHost,\n\t\tClient\n\t}\n\n\tpublic class UnixSocketStream : NetworkStream\n\t{\n\t\tpublic UnixSocketStream(PipeName pipeName, SocketUsage socketUsage)\n\t\t\t:base(\n\t\t\t\tInit(socketUsage, pipeName),\n\t\t\t\tFileAccess.ReadWrite,\n\t\t\t\ttrue)\n\t\t{}\n\n\t\tstatic Socket Init(SocketUsage socketUsage, PipeName pipeName)\n\t\t{\n\t\t\tswitch (socketUsage)\n\t\t\t{\n\t\t\t\tcase SocketUsage.Client:\n\t\t\t\t\treturn Connect(pipeName, isBlocking: true);\n\t\t\t\tcase SocketUsage.Host:\n\t\t\t\t\treturn Host(pipeName);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentException(\"socketUsage\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool SocketExists(PipeName pipeName)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (Connect(pipeName, isBlocking: false))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tstatic Socket Connect(PipeName pipeName, bool isBlocking)\n\t\t{\n\t\t\tvar endPoint = CreateEndPoint(pipeName);\n\t\t\tvar path = CreatePath(pipeName);\n\t\t\tvar socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);\n\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\tif (!File.Exists(path))\n\t\t\t\t{\n\t\t\t\t\tif (isBlocking)\n\t\t\t\t\t{\n\t\t\t\t\t\tThread.Sleep(1);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new FileNotFoundException(\"Failed to find Unix socket.\", path);\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tsocket.Connect(endPoint);\n\t\t\t\t\treturn socket;\n\t\t\t\t}\n\t\t\t\tcatch(SocketException)\n\t\t\t\t{\n\t\t\t\t\tif (isBlocking)\n\t\t\t\t\t\tThread.Sleep(10);\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic Socket Host(PipeName pipeName)\n\t\t{\n\t\t\tvar endPoint = CreateEndPoint(pipeName);\n\n\t\t\tusing(var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified))\n\t\t\t{\n\t\t\t\tsocket.Bind(endPoint);\n\t\t\t\tsocket.Listen(1);\n\n\t\t\t\tvar handler = socket.Accept();\n\t\t\t\treturn handler;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Unlink(PipeName pipeName)\n\t\t{\n\t\t\tvar endPoint = CreateEndPoint(pipeName);\n\t\t\tSyscall.unlink(endPoint.Filename);\n\t\t}\n\n\t\tstatic UnixEndPoint CreateEndPoint(PipeName pipeName)\n\t\t{\n\t\t\tvar path = CreatePath(pipeName);\n\t\t\tvar endPoint = new UnixEndPoint(path);\n\t\t\treturn endPoint;\n\t\t}\n\n\t\tstatic string CreatePath(PipeName pipeName)\n\t\t{\n\t\t\tvar path = SocketDirectory;\n\t\t\tDirectory.CreateDirectory(path);\n\t\t\treturn Path.Combine(path, pipeName.ToString());\n\t\t}\n\n\t\tpublic static string SocketDirectory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn \"/tmp/.fuse-\" + Environment.UserName;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/ProcessExtension.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Outracks\n{\n\tpublic static class ProcessExtension\n\t{\n\t\tpublic static void ReadCharacters(this StreamReader stream, IObserver<string> lines)\n\t\t{\n\t\t\tnew Thread(() =>\n\t\t\t{\n\t\t\t\tPushCharacterChunksToObserver(stream, lines);\n\t\t\t\tlines.OnCompleted();\n\t\t\t})\n\t\t\t{\n\t\t\t\tName = \"Consume characters from stream\",\n\t\t\t\tIsBackground = true,\n\t\t\t}.Start();\n\t\t}\n\n\t\tstatic void PushCharacterChunksToObserver(TextReader stream, IObserver<string> lines)\n\t\t{\n\t\t\tvar characters = new Subject<char>();\n\n\t\t\tcharacters\n\t\t\t\t.Buffer(timeSpan: TimeSpan.FromMilliseconds(50))\n\t\t\t\t.Where(l => !l.IsEmpty())\n\t\t\t\t.Subscribe(\n\t\t\t\t\tmsg =>\n\t\t\t\t\t{\n\t\t\t\t\t\tlines.OnNext(string.Concat(msg));\n\t\t\t\t\t});\n\n\t\t\tint character;\n\t\t\twhile ((character = stream.Read()) != -1)\n\t\t\t{\n\t\t\t\tcharacters.OnNext((char) character);\n\t\t\t}\n\t\t\tcharacters.OnCompleted();\n\t\t}\n\n\t\tpublic static Task ConsumeOutput(this Process process, IObserver<string> lines)\n\t\t{\n\t\t\treturn ConsumeReader(process.StandardOutput, lines);\n\t\t}\n\n\t\tpublic static Task ConsumeError(this Process process, IObserver<string> lines)\n\t\t{\n\t\t\treturn ConsumeReader(process.StandardError, lines);\n\t\t}\n\n\t\tpublic static Task ConsumeOutAndErr(this Process process,\n\t\t\tIObserver<string> outLines,\n\t\t\tIObserver<string> errLines)\n\t\t{\n\t\t\treturn Task.Run(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tvar waitOut = process.ConsumeOutput(outLines);\n\t\t\t\t\tvar waitErr = process.ConsumeError(errLines);\n\n\t\t\t\t\twaitOut.Wait();\n\t\t\t\t\twaitErr.Wait();\n\t\t\t\t});\n\t\t}\n\n\t\tstatic Task ConsumeReader(TextReader reader, IObserver<string> lines)\n\t\t{\n\t\t\treturn Task.Run(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tPushCharacterChunksToObserver(reader, lines);\n\t\t\t\t\tlines.OnCompleted();\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyTitle(\"Outracks\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: InternalsVisibleTo(\"Outracks.Tests\")]\n"
  },
  {
    "path": "src/common/core/ReplayQueueSubject.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic class ReplayQueueSubject<T> : ISubject<T>\n\t{\n\t\treadonly object _gate = new object();\n\t\treadonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>();\n\t\treadonly Subject<T> _subject = new Subject<T>();\n\n\t\tpublic void OnNext(T value)\n\t\t{\n\t\t\tlock (_gate)\n\t\t\t{\n\t\t\t\tif (!_subject.HasObservers)\n\t\t\t\t\t_queue.Enqueue(value);\n\t\t\t\telse\n\t\t\t\t\t_subject.OnNext(value);\n\t\t\t}\n\t\t}\n\n\t\tpublic void OnError(Exception error)\n\t\t{\n\t\t\tlock (_gate)\n\t\t\t{\n\t\t\t\t_subject.OnError(error);\n\t\t\t}\n\t\t}\n\n\t\tpublic void OnCompleted()\n\t\t{\n\t\t\tlock (_gate)\n\t\t\t{\n\t\t\t\t_subject.OnCompleted();\n\t\t\t}\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\tlock (_gate)\n\t\t\t{\n\t\t\t\tT replayedValue;\n\t\t\t\twhile (_queue.TryDequeue(out replayedValue))\n\t\t\t\t\tobserver.OnNext(replayedValue);\n\t\t\t\treturn _subject.Subscribe(observer);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/RethrowExtension.cs",
    "content": "using System;\nusing System.Runtime.ExceptionServices;\n\nnamespace Outracks\n{\n\tpublic static class RethrowExtension\n\t{\n\t\tpublic static void RethrowWithStackTrace(this Exception e)\n\t\t{\n\t\t\tExceptionDispatchInfo.Capture(e).Throw();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/SequenceEqualityComparer.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class SequenceEqualityComparer\n\t{\n\t\tpublic static IObservable<IEnumerable<T>> DistinctUntilSequenceChanged<T>(this IObservable<IEnumerable<T>> self)\n\t\t{\n\t\t\treturn self.DistinctUntilSequenceChangedInternal<IEnumerable<T>, T>();\n\t\t}\n\n\t\tpublic static IObservable<IImmutableList<T>> DistinctUntilSequenceChanged<T>(this IObservable<IImmutableList<T>> self)\n\t\t{\n\t\t\treturn self.DistinctUntilSequenceChangedInternal<IImmutableList<T>, T>();\n\t\t}\n\t\tpublic static IObservable<IImmutableSet<T>> DistinctUntilSequenceChanged<T>(this IObservable<IImmutableSet<T>> self)\n\t\t{\n\t\t\treturn self.DistinctUntilSequenceChangedInternal<IImmutableSet<T>, T>();\n\t\t}\n\n\t\tstatic IObservable<T> DistinctUntilSequenceChangedInternal<T, TElement>(this IObservable<T> self)\n\t\t\twhere T : IEnumerable<TElement>\n\t\t{\n\t\t\treturn self.DistinctUntilChanged(new SequenceEqualityComparer<T, TElement>());\n\t\t}\n\n\t\tpublic static IEqualityComparer<IEnumerable<T>> Create<T>()\n\t\t{\n\t\t\treturn new SequenceEqualityComparer<IEnumerable<T>, T>();\n\t\t}\n\t}\n\n\tclass SequenceEqualityComparer<T, TElement> : IEqualityComparer<T> where T : IEnumerable<TElement>\n\t{\n\t\tpublic bool Equals(T x, T y)\n\t\t{\n\t\t\treturn x.SequenceEqual(y);\n\t\t}\n\n\t\tpublic int GetHashCode(T obj)\n\t\t{\n\t\t\tconst int prime = 31;\n\t\t\tvar result = 1;\n\t\t\tforeach (var elm in obj)\n\t\t\t{\n\t\t\t\tresult = result * prime + elm.GetHashCode();\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/core/Serialization/GuidSerializer.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic static class GuidSerializer\n\t{\n\t\tpublic static void Write(this BinaryWriter writer, Guid guid)\n\t\t{\n\t\t\twriter.Write(guid.ToString());\n\t\t}\n\n\t\tpublic static Guid ReadGuid(this BinaryReader reader)\n\t\t{\n\t\t\treturn new Guid(reader.ReadString());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/SetEqualityComparer.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class SetEqualityComparer\n\t{\n\t\tpublic static IObservable<IEnumerable<T>> DistinctUntilSetChanged<T>(this IObservable<IEnumerable<T>> self)\n\t\t{\n\t\t\treturn self.DistinctUntilSetChangedInternal<IEnumerable<T>, T>();\n\t\t}\n\n\t\tpublic static IObservable<IImmutableList<T>> DistinctUntilSetChanged<T>(this IObservable<IImmutableList<T>> self)\n\t\t{\n\t\t\treturn self.DistinctUntilSetChangedInternal<IImmutableList<T>, T>();\n\t\t}\n\t\tpublic static IObservable<IImmutableSet<T>> DistinctUntilSetChanged<T>(this IObservable<IImmutableSet<T>> self)\n\t\t{\n\t\t\treturn self.DistinctUntilSetChangedInternal<IImmutableSet<T>, T>();\n\t\t}\n\n\t\tstatic IObservable<T> DistinctUntilSetChangedInternal<T, TElement>(this IObservable<T> self)\n\t\t\twhere T : IEnumerable<TElement>\n\t\t{\n\t\t\treturn self.DistinctUntilChanged(new SetEqualityComparer<T, TElement>());\n\t\t}\n\n\t\tpublic static IEqualityComparer<IEnumerable<T>> Create<T>()\n\t\t{\n\t\t\treturn new SetEqualityComparer<IEnumerable<T>, T>();\n\t\t}\n\t}\n\n\tclass SetEqualityComparer<T, TElement> : IEqualityComparer<T> where T : IEnumerable<TElement>\n\t{\n\t\tpublic bool Equals(T x, T y)\n\t\t{\n\t\t\treturn x.SetEquals(y);\n\t\t}\n\n\t\tpublic int GetHashCode(T obj)\n\t\t{\n\t\t\treturn obj.Count();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/core/SetInvariantCultureExtension.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing System.Threading;\n\nnamespace Outracks.Extensions\n{\n\tpublic static class SetInvariantCultureExtension\n\t{\n\t\tpublic static void SetInvariantCulture(this Thread thread)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;\n\t\t\t\tCultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;\n\t\t\t}\n\t\t\t// ReSharper disable once EmptyGeneralCatchClause\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\t//Not supported until mono 3.2.7\n\t\t\t}\n\n\t\t\tthread.CurrentCulture = CultureInfo.InvariantCulture;\n\t\t\tthread.CurrentUICulture = CultureInfo.InvariantCulture;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/SingleActionQueue.cs",
    "content": "﻿using System;\nusing System.Threading;\n\nnamespace Outracks\n{\n\tpublic class SingleActionQueue\n\t{\n\t\tOptional<Action> _nextAction = Optional.None();\n\t\treadonly object _lockObject = new object();\n\t\treadonly ManualResetEvent _itemEnqueued = new ManualResetEvent(false);\n\n\t\tpublic void Enqueue(Action a)\n\t\t{\n\t\t\tlock (_lockObject)\n\t\t\t{\n\t\t\t\t_nextAction = a;\n\t\t\t\t_itemEnqueued.Set();\n\t\t\t}\n\t\t}\n\n\t\tpublic Action Dequeue()\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\t_itemEnqueued.WaitOne();\n\t\t\t\tlock (_lockObject)\n\t\t\t\t{\n\t\t\t\t\t//Multiple threads could have been released from WaitOne(), only let one thread pick the action\n\t\t\t\t\tif (_nextAction.HasValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar value = _nextAction.Value;\n\t\t\t\t\t\t_nextAction = Optional.None();\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/StringToMemoryStream.cs",
    "content": "using System.IO;\n\nnamespace Outracks.IO\n{\n\tpublic static class StringToMemoryStream\n\t{\n\t\tpublic static Stream ToMemoryStream(this string data)\n\t\t{\n\t\t\tvar stream = new MemoryStream();\n\t\t\tvar writer = new StreamWriter(stream);\n\t\t\twriter.Write(data);\n\t\t\twriter.Flush();\n\t\t\tstream.Position = 0;\n\t\t\treturn stream;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/SystemGuidLoader.cs",
    "content": "﻿using System;\nusing System.IO;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Analytics\n{\n\tpublic class SystemGuidLoader\n\t{\n\t\tpublic static Guid LoadOrCreate()\n\t\t{\n\t\t\treturn LoadOrCreate(GetSystemGuidPath());\n\t\t}\n\n\n\t\tpublic static Guid LoadOrCreate(AbsoluteFilePath guidPath)\n\t\t{\n\t\t\treturn TryLoad(guidPath)\n\t\t\t\t.Or(() => Create(guidPath));\n\t\t}\n\n\t\tpublic static Guid LoadOrCreateOrEmpty()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn LoadOrCreate();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tReportFactory.GetReporter(Guid.Empty, Guid.NewGuid(), \"SystemGuidLoader\").Exception(\"Failed to load system guid\", e, ReportTo.Log | ReportTo.Headquarters);\n\t\t\t\treturn Guid.Empty;\n\t\t\t}\n\t\t}\n\n\t\tstatic Optional<Guid> TryLoad(AbsoluteFilePath guidPath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!File.Exists(guidPath.NativePath))\n\t\t\t\t\treturn Optional.None();\n\n\t\t\t\treturn Guid.Parse(ReadString(guidPath));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tWarn(\"Failed to load guid from disk\", e);\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tstatic string ReadString(AbsoluteFilePath guidPath)\n\t\t{\n\t\t\treturn RetryLoop.Try(5, () =>\n\t\t\t{\n\t\t\t\tusing (var stream = File.OpenRead(guidPath.NativePath))\n\t\t\t\t\treturn stream.ReadToEnd();\n\t\t\t});\n\t\t}\n\n\t\tstatic Guid Create(AbsoluteFilePath guidPath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tDirectory.CreateDirectory(guidPath.ContainingDirectory.NativePath);\n\t\t\t\tusing (var stream =  File.Open(guidPath.NativePath, FileMode.Create))\n\t\t\t\tusing (var streamWriter = new StreamWriter(stream))\n\t\t\t\t{\n\t\t\t\t\tvar guid = Guid.NewGuid();\n\t\t\t\t\tstreamWriter.Write(guid);\n\t\t\t\t\treturn guid;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t// Unidentifiable systems are treated as Guid.Empty\n\t\t\t\tWarn(\"Failed to save system guid to disk, using Guid.Empty\", e);\n\t\t\t\treturn Guid.Empty;\n\t\t\t}\n\t\t}\n\n\t\tpublic static AbsoluteFilePath GetSystemGuidPath()\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t{\n\t\t\t\treturn AbsoluteDirectoryPath.Parse(\n\t\t\t\t\tEnvironment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) / \"fuse X\" /\n\t\t\t\t\tnew FileName(\".user\");\n\t\t\t}\n\t\t\telse if (Platform.IsMac)\n\t\t\t{\n\t\t\t\treturn AbsoluteDirectoryPath.Parse(\n\t\t\t\t\tEnvironment.GetFolderPath (Environment.SpecialFolder.Personal)) / \".fuse\" /\n\t\t\t\t\tnew FileName(\".user\");\n\t\t\t}\n\n\t\t\tthrow new PlatformNotSupportedException(\"Not implemented on platform: \" + Platform.OperatingSystem);\n\t\t}\n\n\t\tstatic void Warn(string description, Exception e)\n\t\t{\n\t\t\t// TODO\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/SystemInfo/SystemInfoFactory.cs",
    "content": "﻿using System.Reflection;\n\nnamespace Outracks\n{\n\tpublic static class SystemInfoFactory\n\t{\n\t\tpublic static string GetBuildVersion(Assembly assembly)\n\t\t{\n\t\t\treturn assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? \"0.0.0-dev\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/Text.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class TextExtension\n\t{\n\t\tpublic static Text AsText(this IObservable<string> observable)\n\t\t{\n\t\t\treturn new Text(observable.Replay(1).RefCount());\n\t\t}\n\n\t\tpublic static Text Switch(this IObservable<Text> brush)\n\t\t{\n\t\t\treturn new Text(brush.Select(b => (IObservable<string>)b).Switch().Replay(1).RefCount());\n\t\t}\n\t}\n\n\tpublic struct Text : IObservable<string>\n\t{\n\t\tpublic static Text operator +(Text left, Text right)\n\t\t{\n\t\t\treturn new Text(Observable.CombineLatest(left, right, (l, r) => l + r));\n\t\t}\n\n\t\tpublic static implicit operator Text(string constant)\n\t\t{\n\t\t\treturn new Text(Observable.Return(constant));\n\t\t}\n\n\t\tpublic static Text Empty\n\t\t{\n\t\t\tget { return new Text(null); }\n\t\t}\n\n\t\treadonly IObservable<string> _observable;\n\n\t\tinternal Text(IObservable<string> observable)\n\t\t{\n\t\t\t_observable = observable;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true IFF this instance is default(Text), aka Text.Empty\n\t\t/// In this case Subscribe will always push an empty string\n\t\t/// </summary>\n\t\tpublic bool IsDefault\n\t\t{\n\t\t\tget { return _observable == null; }\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<string> observer)\n\t\t{\n\t\t\tif (_observable == null)\n\t\t\t{\n\t\t\t\tobserver.OnNext(\"\");\n\t\t\t\tobserver.OnCompleted();\n\t\t\t\treturn Disposable.Empty;\n\t\t\t}\n\n\t\t\treturn _observable.Subscribe(observer);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/core/TextDocumentContent.cs",
    "content": "using System.IO;\nusing Outracks.IO;\n\nnamespace Outracks\n{\n\tpublic class TextDocumentContent\n\t{\n\t\tpublic readonly AbsoluteFilePath Path;\n\t\tpublic readonly string Content;\n\n\t\tpublic TextDocumentContent(AbsoluteFilePath path, string content)\n\t\t{\n\t\t\tPath = path;\n\t\t\tContent = content;\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, TextDocumentContent c)\n\t\t{\n\t\t\tAbsoluteFilePath.Write(writer, c.Path);\n\t\t\twriter.Write(c.Content);\n\t\t}\n\n\t\tpublic static TextDocumentContent Read(BinaryReader r)\n\t\t{\n\t\t\treturn new TextDocumentContent(\n\t\t\t\tAbsoluteFilePath.Read(r),\n\t\t\t\tr.ReadString());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/TrySomethingExtension.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic static class TrySomethingExtension\n\t{\n\t\tpublic static void TrySomethingBlocking(this IReport errorHandler, Action action)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\taction();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\terrorHandler.Exception(\"Something failed: \" + e.Message, e);\n\t\t\t}\n\t\t}\n\n\t\tpublic static T Try<T>(this IReport errorHandler, Func<T> action, T defaultResult)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn action();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\terrorHandler.Exception(\"Something failed: \" + e.Message, e);\n\t\t\t\treturn defaultResult;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/core/ValidationResult.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic interface IValidationResult<out T>\n\t{\n\t\tbool HasValue { get; }\n\t\tT Value { get; }\n\t\tstring Error { get; }\n\t}\n\n\tpublic static class ValidationResult\n\t{\n\t\tpublic static IValidationResult<T> Valid<T>(T value)\n\t\t{\n\t\t\treturn new ValidationResult<T>\n\t\t\t{\n\t\t\t\tError = \"\",\n\t\t\t\tValue = value\n\t\t\t};\n\t\t}\n\t\tpublic static IValidationResult<T> Invalid<T>(string error)\n\t\t{\n\t\t\treturn new ValidationResult<T>\n\t\t\t{\n\t\t\t\tError = error,\n\t\t\t\tValue = Optional.None()\n\t\t\t};\n\t\t}\n\n\t\tpublic static IValidationResult<T> AsValidationResult<T>(this Optional<T> value, string error)\n\t\t{\n\t\t\treturn new ValidationResult<T>\n\t\t\t{\n\t\t\t\tError = error,\n\t\t\t\tValue = value\n\t\t\t};\n\t\t}\n\n\t\tpublic static TResult MatchWith<T, TResult>(\n\t\t\tthis IValidationResult<T> self,\n\t\t\tFunc<T, TResult> succsess,\n\t\t\tFunc<string, TResult> error)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? succsess(self.Value)\n\t\t\t\t: error(self.Error);\n\t\t}\n\t}\n\n\tclass ValidationResult<T> : IValidationResult<T>\n\t{\n\t\tpublic string Error { get; set; }\n\t\tpublic Optional<T> Value { get; set; }\n\t\tbool IValidationResult<T>.HasValue { get { return Value.HasValue; } }\n\t\tT IValidationResult<T>.Value { get { return Value.Value; } }\n\t}\n\n}\n"
  },
  {
    "path": "src/common/core/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"JetBrains.Mono.Posix\" version=\"0.1\" targetFramework=\"net45\" />\n  <package id=\"log4net\" version=\"2.0.12\" targetFramework=\"net46\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/common/math/Axis2D.cs",
    "content": "using System;\nusing Outracks.Diagnostics;\n\nnamespace Outracks\n{\n\tpublic enum Axis2D\n\t{\n\t\tHorizontal,\n\t\tVertical\n\t}\n\tpublic enum Direction2D\n\t{\n\t\tLeftToRight = RectangleEdge.Left,\n\t\tTopToBottom = RectangleEdge.Top,\n\t\tRightToLeft = RectangleEdge.Right,\n\t\tBottomToTop = RectangleEdge.Bottom,\n\t}\n\n\tpublic enum RectangleEdge\n\t{\n\t\tLeft = 0,\n\t\tTop = 1,\n\t\tRight = 2,\n\t\tBottom = 3,\n\t}\n\n\t[Flags]\n\tpublic enum RectangleEdges\n\t{\n\t\tNone = 0,\n\t\tLeft = 1 << 0,\n\t\tTop = 1 << 1,\n\t\tRight = 1 << 2,\n\t\tBottom = 1 << 3,\n\t\tAll = Left | Top | Right | Bottom,\n\t}\n\n\tpublic static class Axis2DExtensions\n\t{\n\t\tpublic static bool ShouldFlip = Platform.IsMac;\n\n\t\tpublic static Thickness<T> FlipVerticallyOnMac<T>(this Thickness<T> thickness)\n\t\t{\n\t\t\treturn Thickness.Create(edge => thickness[edge.FlipVerticallyOnMac()]);\n\t\t}\n\n\t\tpublic static RectangleEdge FlipVerticallyOnMac(this RectangleEdge edge)\n\t\t{\n\t\t\tif (edge == RectangleEdge.Top && ShouldFlip)\n\t\t\t\treturn RectangleEdge.Bottom;\n\n\t\t\tif (edge == RectangleEdge.Bottom && ShouldFlip)\n\t\t\t\treturn RectangleEdge.Top;\n\n\t\t\treturn edge;\n\t\t}\n\n\t\tpublic static RectangleEdges ToFlags(this RectangleEdge edge)\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn RectangleEdges.Right;\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn RectangleEdges.Left;\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn RectangleEdges.Bottom;\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn RectangleEdges.Top;\n\t\t\t}\n\t\t\treturn RectangleEdges.None;\n\t\t}\n\n\t\tpublic static Axis2D NormalAxis(this RectangleEdge _edge)\n\t\t{\n\t\t\treturn _edge == RectangleEdge.Left || _edge == RectangleEdge.Right\n\t\t\t\t? Axis2D.Horizontal\n\t\t\t\t: Axis2D.Vertical;\n\t\t}\n\n\t\tpublic static bool IsMinimal(this RectangleEdge _edge)\n\t\t{\n\t\t\treturn _edge == RectangleEdge.Left || _edge == RectangleEdge.Top;\n\t\t}\n\n\t\tpublic static double Sign(this RectangleEdge edge)\n\t\t{\n\t\t\treturn edge.IsMinimal() ? 1.0 : -1.0;\n\t\t}\n\t\tpublic static Direction2D DirectionToEdge(this RectangleEdge edge)\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn Direction2D.LeftToRight;\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn Direction2D.RightToLeft;\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn Direction2D.TopToBottom;\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn Direction2D.BottomToTop;\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\t\tpublic static Direction2D DirectionToOpposite(this RectangleEdge edge)\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn Direction2D.LeftToRight;\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn Direction2D.RightToLeft;\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn Direction2D.TopToBottom;\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn Direction2D.BottomToTop;\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\t\tpublic static RectangleEdge Opposite(this RectangleEdge edge)\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn RectangleEdge.Right;\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn RectangleEdge.Left;\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn RectangleEdge.Bottom;\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn RectangleEdge.Top;\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static Axis2D Opposite(this Axis2D axis)\n\t\t{\n\t\t\treturn axis == Axis2D.Horizontal ? Axis2D.Vertical : Axis2D.Horizontal;\n\t\t}\n\t}\n\n\n}"
  },
  {
    "path": "src/common/math/ContentFrame.cs",
    "content": "﻿namespace Outracks\n{\n\tpublic struct ContentFrame<T> where T : INumeric<T>\n\t{\n\t\tpublic readonly Rectangle<T> FrameBuonds;\n\t\tpublic readonly Rectangle<T> ContentBounds;\n\n\t\tpublic Rectangle<T> VisibleBounds\n\t\t{\n\t\t\tget { return FrameBuonds.Intersect(ContentBounds); }\n\t\t}\n\n\t\tpublic ContentFrame(Rectangle<T> frameBuonds, Rectangle<T> contentBounds)\n\t\t{\n\t\t\tFrameBuonds = frameBuonds;\n\t\t\tContentBounds = contentBounds;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{Frame = \"+FrameBuonds+\", Content = \"+ContentBounds+\"}\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Corners.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic enum Corner\n\t{\n\t\tLeftTop,\n\t\tRightTop,\n\t\tRightBottom,\n\t\tLeftBottom\n\t}\n\n\tpublic static class Corners\n\t{\n\t\tpublic static Corners<Points> Zero = new Corners<Points>(0);\n\n\t\tpublic static Corners<IObservable<T>> Transpose<T>(this IObservable<Corners<T>> self)\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tself.Select(s => s.LeftTop),\n\t\t\t\tself.Select(s => s.RightTop),\n\t\t\t\tself.Select(s => s.RightBottom),\n\t\t\t\tself.Select(s => s.LeftBottom));\n\t\t}\n\n\t\tpublic static Corners<IObservable<T>> Inverse<T>(this Corners<IObservable<T>> self)\n\t\t\twhere T: INumeric<T>\n\t\t{\n\t\t\treturn self.Select(t => t.Inverse());\n\t\t}\n\n\t\tpublic static IObservable<Corners<T>> Inverse<T>(this IObservable<Corners<T>> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(t => t.Inverse());\n\t\t}\n\n\t\tpublic static Corners<T> Inverse<T>(this Corners<T> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(t => t.Inverse());\n\t\t}\n\n\t\tpublic static IObservable<Corners<T>> Transpose<T>(this Corners<IObservable<T>> self)\n\t\t{\n\t\t\treturn Observable.CombineLatest(\n\t\t\t\tself.LeftTop,\n\t\t\t\tself.RightTop,\n\t\t\t\tself.RightBottom,\n\t\t\t\tself.LeftBottom,\n\t\t\t\tCreate);\n\t\t}\n\n\t\tpublic static Corners<T> Create<T>(T leftTop, T rightTop, T rightBottom, T leftBottom)\n\t\t{\n\t\t\treturn new Corners<T>(leftTop, rightTop, rightBottom, leftBottom);\n\t\t}\n\n\t\tpublic static Corners<T> Create<T>(Func<Corner, T> corner)\n\t\t{\n\t\t\treturn new Corners<T>(corner(Corner.LeftTop), corner(Corner.RightTop), corner(Corner.RightBottom), corner(Corner.LeftBottom));\n\t\t}\n\n\t\tpublic static Corners<TOut> Select<TIn, TOut>(this Corners<TIn> self, Func<TIn, TOut> transform)\n\t\t{\n\t\t\treturn new Corners<TOut>(\n\t\t\t\tleftTop: transform(self.LeftTop),\n\t\t\t\trightTop: transform(self.RightTop),\n\t\t\t\trightBottom: transform(self.RightBottom),\n\t\t\t\tleftBottom: transform(self.LeftBottom));\n\t\t}\n\n\t\tpublic static IEnumerable<Tuple<Corner, T>> Where<T>(this Corners<T> self, Func<Corner, T, bool> predicate)\n\t\t{\n\t\t\tif (predicate(Corner.LeftBottom, self.LeftBottom))\n\t\t\t\tyield return Tuple.Create(Corner.LeftBottom, self.LeftBottom);\n\t\t\tif (predicate(Corner.LeftTop, self.LeftTop))\n\t\t\t\tyield return Tuple.Create(Corner.LeftTop, self.LeftTop);\n\t\t\tif (predicate(Corner.RightBottom, self.RightBottom))\n\t\t\t\tyield return Tuple.Create(Corner.RightBottom, self.RightBottom);\n\t\t\tif (predicate(Corner.RightTop, self.RightTop))\n\t\t\t\tyield return Tuple.Create(Corner.RightTop, self.RightTop);\n\t\t}\n\n\t\tpublic static bool CornersAreEqual<T>(this Corners<T> self)\n\t\t{\n\t\t\treturn self.LeftBottom.Equals(self.LeftTop)\n\t\t\t\t&& self.LeftTop.Equals(self.RightBottom)\n\t\t\t\t&& self.RightBottom.Equals(self.RightTop);\n\t\t}\n\t}\n\tpublic sealed class Corners<T> : IEquatable<Corners<T>>\n\t{\n\t\tpublic readonly T LeftTop;\n\t\tpublic readonly T RightTop;\n\t\tpublic readonly T RightBottom;\n\t\tpublic readonly T LeftBottom;\n\n\t\tpublic Corners(T horizontal, T vertical)\n\t\t\t: this (horizontal, vertical, horizontal, vertical)\n\t\t{ }\n\n\t\tpublic Corners(T all)\n\t\t\t: this (all, all, all, all)\n\t\t{ }\n\n\t\tpublic Corners(T leftTop, T rightTop, T rightBottom, T leftBottom)\n\t\t{\n\t\t\tLeftTop = leftTop;\n\t\t\tRightTop = rightTop;\n\t\t\tRightBottom = rightBottom;\n\t\t\tLeftBottom = leftBottom;\n\t\t}\n\n\n\t\tpublic Corners<T> With(\n\t\t\tOptional<T> leftTop = default(Optional<T>),\n\t\t\tOptional<T> rightTop = default(Optional<T>),\n\t\t\tOptional<T> rightBottom = default(Optional<T>),\n\t\t\tOptional<T> leftBottom = default(Optional<T>))\n\t\t{\n\t\t\treturn new Corners<T>(\n\t\t\t\tleftTop.Or(LeftTop),\n\t\t\t\trightTop.Or(RightTop),\n\t\t\t\trightBottom.Or(RightBottom),\n\t\t\t\tleftBottom.Or(LeftBottom));\n\t\t}\n\n\t\tpublic Corners<T> With(Corners<bool> cornersToChange, T newValue)\n\t\t{\n\t\t\treturn new Corners<T>(\n\t\t\t\tcornersToChange.LeftTop ? newValue : LeftTop,\n\t\t\t\tcornersToChange.RightTop ? newValue : RightTop,\n\t\t\t\tcornersToChange.RightBottom ? newValue : RightBottom,\n\t\t\t\tcornersToChange.LeftBottom ? newValue : LeftBottom);\n\t\t}\n\n\t\tpublic Corners<T> With(Corner corner, Func<T, T> value)\n\t\t{\n\t\t\tswitch (corner)\n\t\t\t{\n\t\t\t\tcase Corner.LeftBottom:\n\t\t\t\t\treturn With(leftBottom: value(LeftBottom));\n\t\t\t\tcase Corner.LeftTop:\n\t\t\t\t\treturn With(leftTop: value(LeftTop));\n\t\t\t\tcase Corner.RightBottom:\n\t\t\t\t\treturn With(rightBottom: value(RightBottom));\n\t\t\t\tcase Corner.RightTop:\n\t\t\t\t\treturn With(rightTop: value(RightTop));\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidEnumArgumentException();\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Equals(Corners<T> other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn EqualityComparer<T>.Default.Equals(LeftTop, other.LeftTop) && EqualityComparer<T>.Default.Equals(RightTop, other.RightTop) && EqualityComparer<T>.Default.Equals(RightBottom, other.RightBottom) && EqualityComparer<T>.Default.Equals(LeftBottom, other.LeftBottom);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is Corners<T> && Equals((Corners<T>)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tvar hashCode = EqualityComparer<T>.Default.GetHashCode(LeftTop);\n\t\t\t\thashCode = (hashCode * 397) ^ EqualityComparer<T>.Default.GetHashCode(RightTop);\n\t\t\t\thashCode = (hashCode * 397) ^ EqualityComparer<T>.Default.GetHashCode(RightBottom);\n\t\t\t\thashCode = (hashCode * 397) ^ EqualityComparer<T>.Default.GetHashCode(LeftBottom);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(Corners<T> a, Corners<T> b)\n\t\t{\n\t\t\treturn Equals(a, b);\n\t\t}\n\n\t\tpublic static bool operator !=(Corners<T> a, Corners<T> b)\n\t\t{\n\t\t\treturn !Equals(a, b);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{\" + LeftTop + \", \" + RightTop + \", \" + RightBottom + \", \" + LeftBottom + \"}\";\n\t\t}\n\n\t\tpublic T this[Corner corner]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tswitch (corner)\n\t\t\t\t{\n\t\t\t\t\tcase Corner.LeftTop: return LeftTop;\n\t\t\t\t\tcase Corner.RightTop: return RightTop;\n\t\t\t\t\tcase Corner.LeftBottom: return LeftBottom;\n\t\t\t\t\tcase Corner.RightBottom: return RightBottom;\n\t\t\t\t}\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Discrete/CycleDetected.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic class CycleDetected : Exception\n\t{\n\t}\n\n\tpublic class BiCycleDetected : Exception // for completeness\n\t{\n\t}\n}"
  },
  {
    "path": "src/common/math/Discrete/GraphInversion.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static class GraphInversion\n\t{\n\t\tpublic static ILookup<T, T> ToChildLookup<T>(this IEnumerable<T> paths, Func<T, Optional<T>> selectParent)\n\t\t{\n\t\t\tvar dict = new ConcurrentDictionary<T, ImmutableHashSet<T>>();\n\n\t\t\tvar worklist = new ConcurrentQueue<T>(paths);\n\t\t\tT child;\n\t\t\twhile (worklist.TryDequeue(out child))\n\t\t\t{\n\t\t\t\tvar parent = selectParent(child);\n\t\t\t\tif (parent.HasValue)\n\t\t\t\t{\n\t\t\t\t\tdict.AddOrUpdate(\n\t\t\t\t\t\tkey: parent.Value,\n\t\t\t\t\t\taddValueFactory: (_) => ImmutableHashSet.Create(child),\n\t\t\t\t\t\tupdateValueFactory: (_, parentSet) => parentSet.Add(child));\n\n\t\t\t\t\tworklist.Enqueue(parent.Value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dict.ToLookup();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Discrete/ReachableSet.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\n\nnamespace Outracks\n{\n\tpublic static class ReachableSet\n\t{\n\t\tpublic static IDictionary<T, IImmutableSet<T>> CreateReachableSets<T>(\n\t\t\tthis IEnumerable<T> allElements,\n\t\t\tFunc<T, IEnumerable<T>> directlyReachable)\n\t\t{\n\t\t\tvar sets = new ConcurrentDictionary<T, IImmutableSet<T>>();\n\n\t\t\tforeach (var element in allElements)\n\t\t\t\tsets[element] = element.CreateReachableSet(directlyReachable);\n\n\t\t\treturn sets;\n\t\t}\n\n\t\tpublic static IImmutableSet<T> CreateReachableSet<T>(\n\t\t\tthis T seed,\n\t\t\tFunc<T, IEnumerable<T>> directlyReachable)\n\t\t{\n\t\t\tvar set = ImmutableHashSet.Create<T>();\n\n\t\t\tvar workList = new ConcurrentQueue<T>();\n\t\t\tworkList.Enqueue(seed);\n\n\t\t\tT current;\n\t\t\twhile (workList.TryDequeue(out current))\n\t\t\t{\n\t\t\t\tforeach (var other in directlyReachable(current))\n\t\t\t\t{\n\t\t\t\t\tif (set.Contains(other))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tset = set.Add(other);\n\t\t\t\t\tworkList.Enqueue(other);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn set;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Discrete/SetClosure.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\n\nnamespace Outracks\n{\n\tpublic static class SetClosure\n\t{\n\t\tpublic static IImmutableSet<T> ClosureSetOf<T>(this T seed, Func<T, IEnumerable<T>> operation)\n\t\t{\n\t\t\tvar set = ImmutableHashSet.Create<T>();\n\n\t\t\tvar workList = new ConcurrentQueue<T>();\n\t\t\tworkList.Enqueue(seed);\n\n\t\t\tT current;\n\t\t\twhile (workList.TryDequeue(out current))\n\t\t\t{\n\t\t\t\tif (set.Contains(current)) continue;\n\n\t\t\t\tset = set.Add(current);\n\t\t\t\tforeach (var other in operation(current))\n\t\t\t\t\tworkList.Enqueue(other);\n\t\t\t}\n\n\t\t\treturn set;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Discrete/TopologicalSort.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Outracks\n{\n\tpublic static class TopologicalSort\n\t{\n\t\t/// <exception cref=\"CycleDetected\"></exception>\n\t\tpublic static IEnumerable<T> OrderByTopology<T>(\n\t\t\tthis IEnumerable<T> nodes,\n\t\t\tFunc<T, IEnumerable<T>> getDependencies)\n\t\t{\n\t\t\tvar visited = new Dictionary<T, bool>();\n\t\t\tvar sorted = new List<T>();\n\n\t\t\tAction<T> visit = null;\n\t\t\tvisit = (item) =>\n\t\t\t{\n\t\t\t\tbool inProcess;\n\t\t\t\tvar alreadyVisited = visited.TryGetValue(item, out inProcess);\n\n\t\t\t\tif (alreadyVisited && inProcess)\n\t\t\t\t\tthrow new CycleDetected();\n\n\t\t\t\tif (!alreadyVisited)\n\t\t\t\t{\n\t\t\t\t\tvisited[item] = true;\n\n\t\t\t\t\tforeach (var dependency in getDependencies(item))\n\t\t\t\t\t\tvisit(dependency);\n\n\t\t\t\t\tvisited[item] = false;\n\t\t\t\t\tsorted.Add(item);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tforeach (var item in nodes)\n\t\t\t\tvisit(item);\n\n\t\t\treturn sorted;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/IGroup.cs",
    "content": "﻿namespace Outracks\n{\n\tpublic interface IGroup<T>\n\t{\n\t\tT Add(T other);\n\t\tT Inverse();\n\n\t\tT Zero { get; }\n\t}\n}"
  },
  {
    "path": "src/common/math/INumeric.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic interface INumeric<T> :\n\t\tIEquatable<T>,\n\t\tIComparable<T>,\n\t\tIRing<T>\n\t{\n\t\tT FromDouble(double value);\n\t\tdouble ToDouble();\n\t}\n}"
  },
  {
    "path": "src/common/math/IRing.cs",
    "content": "﻿namespace Outracks\n{\n\tpublic interface IRing<T> : IGroup<T>\n\t{\n\t\tT Mul(T other);\n\n\t\tT One { get; }\n\n\t\tT Reciprocal();\n\t}\n}"
  },
  {
    "path": "src/common/math/Interval.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Outracks\n{\n\tpublic struct Interval<T> : IEquatable<Interval<T>>\n\t{\n\t\tpublic readonly T Offset;\n\t\tpublic readonly T Length;\n\n\t\tpublic Interval(T offset, T length)\n\t\t{\n\t\t\tOffset = offset;\n\t\t\tLength = length;\n\t\t}\n\n\t\tpublic bool Equals(Interval<T> other)\n\t\t{\n\t\t\treturn\n\t\t\t\tEqualityComparer<T>.Default.Equals(Offset, other.Offset) &&\n\t\t\t\tEqualityComparer<T>.Default.Equals(Length, other.Length);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Interval<T> && Equals((Interval<T>)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (EqualityComparer<T>.Default.GetHashCode(Offset) * 397) ^ EqualityComparer<T>.Default.GetHashCode(Length);\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(Interval<T> left, Interval<T> right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Interval<T> left, Interval<T> right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Offset + \" (+ \" + Length + \")\";\n\t\t}\n\t}\n\n\tpublic static partial class Interval\n\t{\n\t\tpublic static IObservable<Points> Center(this Interval<IObservable<Points>> self)\n\t\t{\n\t\t\treturn self.Offset.Add(self.Length.Div(2));\n\t\t}\n\n\t\tpublic static Interval<T> FromOffsetLength<T>(T offset, T length)\n\t\t{\n\t\t\treturn new Interval<T>(offset, length);\n\t\t}\n\n\t\tpublic static Interval<double> FromMinMax(double min, double max)\n\t\t{\n\t\t\treturn new Interval<double>(min, max - min);\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>> FromMinMax<T>(IObservable<T> min, IObservable<T> max)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn new Interval<IObservable<T>>(min, max.Sub(min));\n\t\t}\n\n\t\tpublic static Interval<T> FromMinMax<T>(T min, T max)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn new Interval<T>(min, max.Sub(min));\n\t\t}\n\n\t\tpublic static bool Contains<T>(this Interval<T> interval, T n) where T : IComparable<T>, INumeric<T>\n\t\t{\n\t\t\t// Exploiting the fact that this 'offset >= n - length' is the same as 'offset + length <= n'\n\t\t\t// So that interval.Length can be PositiveInfinity and offset NegativeInfinity.\n\t\t\treturn interval.Offset.LessThanOrEquals(n) && interval.Offset.GreaterThanOrEquals(n.Sub(interval.Length));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Matrix.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class MatrixExtensions\n\t{\n\t\tpublic static void Write(BinaryWriter writer, Matrix matrix)\n\t\t{\n\t\t\twriter.Write(matrix.M11);\n\t\t\twriter.Write(matrix.M12);\n\t\t\twriter.Write(matrix.M13);\n\t\t\twriter.Write(matrix.M14);\n\n\t\t\twriter.Write(matrix.M21);\n\t\t\twriter.Write(matrix.M22);\n\t\t\twriter.Write(matrix.M23);\n\t\t\twriter.Write(matrix.M24);\n\n\t\t\twriter.Write(matrix.M31);\n\t\t\twriter.Write(matrix.M32);\n\t\t\twriter.Write(matrix.M33);\n\t\t\twriter.Write(matrix.M34);\n\n\t\t\twriter.Write(matrix.M41);\n\t\t\twriter.Write(matrix.M42);\n\t\t\twriter.Write(matrix.M43);\n\t\t\twriter.Write(matrix.M44);\n\t\t}\n\n\t\tpublic static Matrix Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new Matrix(\n\t\t\t\treader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble(),\n\t\t\t\treader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble(),\n\t\t\t\treader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble(),\n\t\t\t\treader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble(), reader.ReadDouble());\n\t\t}\n\n\t\tpublic static Point<T> Transform<T>(this Point<T> p, Matrix m) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn new Point<T>(\n\t\t\t\tnew T().FromDouble(p.X.ToDouble() * m.M11 + p.Y.ToDouble() * m.M21 + m.M41),\n\t\t\t\tnew T().FromDouble(p.X.ToDouble() * m.M12 + p.Y.ToDouble() * m.M22 + m.M42));\n\t\t}\n\t}\n\n\tpublic partial class Matrix\n\t{\n\t\tstatic Matrix()\n\t\t{\n\t\t\tAlgebras.Initialize();\n\t\t}\n\n\t\tpublic readonly double M11, M12, M13, M14;\n\t\tpublic readonly double M21, M22, M23, M24;\n\t\tpublic readonly double M31, M32, M33, M34;\n\t\tpublic readonly double M41, M42, M43, M44;\n\n\t\tpublic static Matrix Translate(double x = 0.0, double y = 0.0, double z = 0.0)\n\t\t{\n\t\t\treturn new Matrix(\n\t\t\t\t1, 0, 0, x,\n\t\t\t\t0, 1, 0, y,\n\t\t\t\t0, 0, 1, 0,\n\t\t\t\t0, 0, 0, 1);\n\t\t}\n\n\t\tpublic static Matrix Rotate(double theta)\n\t\t{\n\t\t\tvar cos = Math.Cos(theta);\n\t\t\tvar sin = Math.Sin(theta);\n\t\t\treturn new Matrix(\n\t\t\t\tcos, -sin, 0, 0,\n\t\t\t\tsin,  cos, 0, 0,\n\t\t\t\t  0,    0, 1, 0,\n\t\t\t\t  0,    0, 0, 1);\n\t\t}\n\n\t\tpublic static Matrix Multiply(params Matrix[] matrices)\n\t\t{\n\t\t\treturn matrices.Aggregate(Multiply);\n\t\t}\n\n\t\tpublic static Matrix Multiply(Matrix left, Matrix right)\n\t\t{\n\t\t\treturn new Matrix(\n\t\t\t\tDot(left.GetRow(1), right.GetColumn(1)),\n\t\t\t\tDot(left.GetRow(1), right.GetColumn(2)),\n\t\t\t\tDot(left.GetRow(1), right.GetColumn(3)),\n\t\t\t\tDot(left.GetRow(1), right.GetColumn(4)),\n\t\t\t\tDot(left.GetRow(2), right.GetColumn(1)),\n\t\t\t\tDot(left.GetRow(2), right.GetColumn(2)),\n\t\t\t\tDot(left.GetRow(2), right.GetColumn(3)),\n\t\t\t\tDot(left.GetRow(2), right.GetColumn(4)),\n\t\t\t\tDot(left.GetRow(3), right.GetColumn(1)),\n\t\t\t\tDot(left.GetRow(3), right.GetColumn(2)),\n\t\t\t\tDot(left.GetRow(3), right.GetColumn(3)),\n\t\t\t\tDot(left.GetRow(3), right.GetColumn(4)),\n\t\t\t\tDot(left.GetRow(4), right.GetColumn(1)),\n\t\t\t\tDot(left.GetRow(4), right.GetColumn(2)),\n\t\t\t\tDot(left.GetRow(4), right.GetColumn(3)),\n\t\t\t\tDot(left.GetRow(4), right.GetColumn(4)));\n\t\t}\n\n\t\tstatic double Dot(\n\t\t\tTuple<double, double, double, double> left,\n\t\t\tTuple<double, double, double, double> right)\n\t\t{\n\t\t\treturn left.Item1 * right.Item1\n\t\t\t\t+ left.Item2 * right.Item2\n\t\t\t\t+ left.Item3 * right.Item3\n\t\t\t\t+ left.Item4 * right.Item4;\n\t\t}\n\n\t\tpublic Matrix(\n\t\t\tdouble m11, double m12, double m13, double m14,\n\t\t\tdouble m21, double m22, double m23, double m24,\n\t\t\tdouble m31, double m32, double m33, double m34,\n\t\t\tdouble m41, double m42, double m43, double m44)\n\t\t{\n\t\t\tM11 = m11; M12 = m12; M13 = m13; M14 = m14;\n\t\t\tM21 = m21; M22 = m22; M23 = m23; M24 = m24;\n\t\t\tM31 = m31; M32 = m32; M33 = m33; M34 = m34;\n\t\t\tM41 = m41; M42 = m42; M43 = m43; M44 = m44;\n\t\t}\n\n\t\tpublic Tuple<double, double, double, double> GetColumn(int column)\n\t\t{\n\t\t\tif (column == 1) return Tuple.Create(M11, M21, M31, M41);\n\t\t\tif (column == 2) return Tuple.Create(M12, M22, M32, M42);\n\t\t\tif (column == 3) return Tuple.Create(M13, M23, M33, M43);\n\t\t\tif (column == 4) return Tuple.Create(M14, M24, M34, M44);\n\n\t\t\tthrow new ArgumentOutOfRangeException(\"column\", column, \"Row number was out of range. Range is [1,4].\");\n\t\t}\n\n\t\tpublic Tuple<double, double, double, double> GetRow(int row)\n\t\t{\n\t\t\tif (row == 1) return Tuple.Create(M11, M12, M13, M14);\n\t\t\tif (row == 2) return Tuple.Create(M21, M22, M23, M24);\n\t\t\tif (row == 3) return Tuple.Create(M31, M32, M33, M34);\n\t\t\tif (row == 4) return Tuple.Create(M41, M42, M43, M44);\n\n\t\t\tthrow new ArgumentOutOfRangeException(\"row\", row, \"Row number was out of range. Range is [1,4].\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Add.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Numeric\n\t{\n\t\tpublic static IObservable<T> Add<T>(this IObservable<T> left, IObservable<T> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn Observable.CombineLatest(left, right, (l, r) => l.Add(r));\n\t\t}\n\n\t\tpublic static IObservable<T> Add<T>(this IObservable<T> left, T right) where T : INumeric<T>\n\t\t{\n\t\t\treturn left.Select(l => l.Add(right));\n\t\t}\n\t}\n\n\tpublic partial struct Point<T>\n\t{\n\t\tpublic static Point<T> operator +(Point<T> self, Vector<T> vec)\n\t\t{\n\t\t\treturn new Point<T>(\n\t\t\t\tAlgebra<T>.Add(self.X, vec.X),\n\t\t\t\tAlgebra<T>.Add(self.Y, vec.Y));\n\t\t}\n\t}\n\n\tpublic partial struct Size<T>\n\t{\n\t\tpublic static Size<T> operator +(Size<T> left, Size<T> right)\n\t\t{\n\t\t\treturn new Size<T>(\n\t\t\t\tAlgebra<T>.Add(left.Width, right.Width),\n\t\t\t\tAlgebra<T>.Add(left.Height, right.Height));\n\t\t}\n\t}\n\n\tpublic static class SizeAddExtension\n\t{\n\t\tpublic static IObservable<Size<T>> Add<T>(this IObservable<Size<T>> left, Size<T> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn left.Select(l => l + right);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/Algebra.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class Algebra<T>\n\t{\n\t\tpublic static Func<T, T, T> Sub;\n\t\tpublic static Func<T, T, T> Add;\n\t}\n\n\tpublic static class Algebras\n\t{\n\t\tstatic bool _initialized = false;\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tif (_initialized) return;\n\n\t\t\tAlgebra<double>.Add = (a, b) => a + b;\n\t\t\tAlgebra<double>.Sub = (a, b) => a - b;\n\n\t\t\tAlgebra<int>.Add = (a, b) => a + b;\n\t\t\tAlgebra<int>.Sub = (a, b) => a - b;\n\n\t\t\tAlgebra<Points>.Add = (a, b) => a.Add(b);\n\t\t\tAlgebra<Points>.Sub = (a, b) => a.Sub(b);\n\n\t\t\tAlgebra<Pixels>.Add = (a, b) => a.Add(b);\n\t\t\tAlgebra<Pixels>.Sub = (a, b) => a.Sub(b);\n\n\t\t\tAlgebra<Inches>.Add = (a, b) => a.Add(b);\n\t\t\tAlgebra<Inches>.Sub = (a, b) => a.Sub(b);\n\n\t\t\tAlgebra<IObservable<Points>>.Add = (a, b) => a.CombineLatest(b, (a2, b2) => a2.Add(b2));\n\t\t\tAlgebra<IObservable<Points>>.Sub = (a, b) => a.CombineLatest(b, (a2, b2) => a2.Sub(b2));\n\n\t\t\tAlgebra<ClipSpaceUnits>.Add = (a, b) => a.Add(b);\n\t\t\tAlgebra<ClipSpaceUnits>.Sub = (a, b) => a.Sub(b);\n\n\t\t\t_initialized = true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/Clamp.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic static partial class Comparable\n\t{\n\t\tpublic static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>\n\t\t{\n\t\t\tif (val.CompareTo(min) < 0) return min;\n\t\t\tif (val.CompareTo(max) > 0) return max;\n\t\t\treturn val;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Div.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Numeric\n\t{\n\t\tpublic static IObservable<Ratio<TNum, TDenom>> Div<TNum, TDenom>(this IObservable<TNum> left, IObservable<TDenom> right)\n\t\t\twhere TNum : INumeric<TNum>, new()\n\t\t\twhere TDenom : INumeric<TDenom>, new()\n\t\t{\n\t\t\treturn left.CombineLatest(right, Div);\n\t\t}\n\n\t\tpublic static IObservable<TDenom> Div<TNum, TDenom>(this IObservable<TNum> left, IObservable<Ratio<TNum, TDenom>> right)\n\t\t\twhere TNum : INumeric<TNum>, new()\n\t\t\twhere TDenom : INumeric<TDenom>, new()\n\t\t{\n\t\t\treturn left.CombineLatest(right, Div);\n\t\t}\n\n\n\t\tpublic static IObservable<T> Div<T>(this IObservable<T> left, int right) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn left.Select(l => new T().FromDouble(l.ToDouble() / right));\n\t\t}\n\n\t\tpublic static TResult Div<T, TResult>(this T value, Ratio<T, TResult> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn value.Mul(ratio.Reciprocal());\n\t\t}\n\n\t\tpublic static Ratio<TNum, TDenom> Div<TNum, TDenom>(this TNum self, TDenom other)\n\t\t\twhere TNum : INumeric<TNum>, new()\n\t\t\twhere TDenom : INumeric<TDenom>, new()\n\t\t{\n\t\t\treturn self.ToDouble() / other.ToDouble();\n\t\t}\n\t}\n\n\tpublic static partial class ContentFrame\n\t{\n\t\tpublic static ContentFrame<TResult> Div<T, TResult>(this ContentFrame<T> frame, Ratio<T, TResult> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn frame.Mul(ratio.Reciprocal());\n\t\t}\n\t}\n\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static Rectangle<TResult> Div<T, TResult>(this Rectangle<T> rectangle, Ratio<T, TResult> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn rectangle.Mul(ratio.Reciprocal());\n\t\t}\n\t}\n\n\tpublic static partial class Vector\n\t{\n\t\tpublic static Vector<TResult> Div<T, TResult>(this Vector<T> point, Ratio<T, TResult> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn point.Mul(ratio.Reciprocal());\n\t\t}\n\t}\n\n\tpublic static partial class Point\n\t{\n\t\tpublic static Point<TResult> Div<T, TResult>(this Point<T> point, Ratio<T, TResult> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn point.Mul(ratio.Reciprocal());\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\tpublic static Size<TResult> Div<T, TResult>(this Size<T> size, Ratio<T, TResult> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn size.Mul(ratio.Reciprocal());\n\t\t}\n\t}\n\n\tpublic partial struct Ratio<TNum, TDenom>\n\t{\n\t\tpublic static Vector<TDenom> operator /(Vector<TNum> vec, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn vec.Div(ratio);\n\t\t}\n\n\t\tpublic static Size<TDenom> operator /(Size<TNum> size, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn size.Div(ratio);\n\t\t}\n\n\t\tpublic static Point<TDenom> operator /(Point<TNum> size, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn size.Div(ratio);\n\t\t}\n\n\t\tpublic static TDenom operator /(TNum num, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn num.Div(ratio);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/GreaterThan.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic static partial class Comparable\n\t{\n\t\tpublic static bool GreaterThanOrEquals<T>(this T value, T other) where T : IComparable<T>\n\t\t{\n\t\t\treturn value.CompareTo(other) >= 0;\n\t\t}\n\n\t\tpublic static bool GreaterThan<T>(this T value, T other) where T : IComparable<T>\n\t\t{\n\t\t\treturn value.CompareTo(other) > 0;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Inflate.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static IObservable<Rectangle<T>> Deflate<T>(this IObservable<Rectangle<T>> self, IObservable<Thickness<T>> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Inflate(thickness.Inverse());\n\t\t}\n\n\t\tpublic static Rectangle<T> Deflate<T>(this Rectangle<T> self, Thickness<T> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Inflate(thickness.Inverse());\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> Deflate<T>(this Rectangle<IObservable<T>> self, Thickness<T> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Inflate(thickness.Inverse());\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> Deflate<T>(this Rectangle<IObservable<T>> self, Thickness<IObservable<T>> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Inflate(thickness.Inverse());\n\t\t}\n\n\t\tpublic static IObservable<Rectangle<T>> Inflate<T>(this IObservable<Rectangle<T>> self, IObservable<Thickness<T>> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.CombineLatest(thickness, Inflate);\n\t\t}\n\n\t\tpublic static Rectangle<T> Inflate<T>(this Rectangle<T> self, Thickness<T> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tself.HorizontalInterval.Inflate(thickness.Left, thickness.Right),\n\t\t\t\tself.VerticalInterval.Inflate(thickness.Top, thickness.Bottom));\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> Inflate<T>(this Rectangle<IObservable<T>> self, Thickness<T> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tself.HorizontalInterval.Inflate(thickness.Left, thickness.Right),\n\t\t\t\tself.VerticalInterval.Inflate(thickness.Top, thickness.Bottom));\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> Inflate<T>(this Rectangle<IObservable<T>> self, Thickness<IObservable<T>> thickness)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tself.HorizontalInterval.Inflate(thickness.Left, thickness.Right),\n\t\t\t\tself.VerticalInterval.Inflate(thickness.Top, thickness.Bottom));\n\t\t}\n\t}\n\n\tpublic static partial class Interval\n\t{\n\t\tpublic static Interval<T> Inflate<T>(this Interval<T> self, T negative, T positive)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromOffsetLength(\n\t\t\t\tself.Offset.Sub(negative),\n\t\t\t\tself.Length.Add(negative).Add(positive));\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>> Inflate<T>(this Interval<IObservable<T>> self, T negative, T positive)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromOffsetLength(\n\t\t\t\tself.Offset.Sub(negative),\n\t\t\t\tself.Length.Add(negative).Add(positive));\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>> Inflate<T>(this Interval<IObservable<T>> self, IObservable<T> negative, IObservable<T> positive)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromOffsetLength(\n\t\t\t\tself.Offset.Sub(negative),\n\t\t\t\tself.Length.Add(negative).Add(positive));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Intersect.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static IObservable<Rectangle<T>> Intersect<T>(\n\t\t\tthis IObservable<Rectangle<T>> self,\n\t\t\tIObservable<Rectangle<T>> other)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.CombineLatest(other, Intersect);\n\t\t}\n\n\t\tpublic static Rectangle<T> Intersect<T>(this Rectangle<T> self, Rectangle<T> other)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\tvar left = self.Left().Max(other.Left());\n\t\t\tvar top = self.Top().Max(other.Top());\n\n\t\t\treturn FromSides(\n\t\t\t\tleft: left,\n\t\t\t\ttop: top,\n\t\t\t\tright: self.Right().Min(other.Right()).Max(left),\n\t\t\t\tbottom: self.Bottom().Min(other.Bottom()).Max(top));\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> Intersect<T>(this Rectangle<IObservable<T>> self, Rectangle<T> other)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\tvar left = self.Left().Max(other.Left());\n\t\t\tvar top = self.Top().Max(other.Top());\n\n\t\t\treturn FromSides(\n\t\t\t\tleft: left,\n\t\t\t\ttop: top,\n\t\t\t\tright: self.Right().Min(other.Right()).Max(left),\n\t\t\t\tbottom: self.Bottom().Min(other.Bottom()).Max(top));\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> Intersect<T>(this Rectangle<IObservable<T>> self, Rectangle<IObservable<T>> other)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\tvar left = self.Left().Max(other.Left());\n\t\t\tvar top = self.Top().Max(other.Top());\n\n\t\t\treturn FromSides(\n\t\t\t\tleft: left,\n\t\t\t\ttop: top,\n\t\t\t\tright: self.Right().Min(other.Right()).Max(left),\n\t\t\t\tbottom: self.Bottom().Min(other.Bottom()).Max(top));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/LessThan.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic static partial class Comparable\n\t{\n\t\tpublic static bool LessThanOrEquals<T>(this T value, T other) where T : IComparable<T>\n\t\t{\n\t\t\treturn value.CompareTo(other) <= 0;\n\t\t}\n\n\t\tpublic static bool LessThan<T>(this T value, T other) where T : IComparable<T>\n\t\t{\n\t\t\treturn value.CompareTo(other) < 0;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Max.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Comparable\n\t{\n\t\tpublic static T Max<T>(this T self, T other) where T : IComparable<T>\n\t\t{\n\t\t\treturn self.CompareTo(other) > 0\n\t\t\t\t? self\n\t\t\t\t: other;\n\t\t}\n\n\t\tpublic static Thickness<IObservable<T>> Max<T>(this Thickness<IObservable<T>> a, Thickness<T> b)\n\t\t\twhere T : IComparable<T>\n\t\t{\n\t\t\treturn a.Select((v, e) => v.Max(b[e]));\n\t\t}\n\n\t\tpublic static IObservable<Thickness<T>> Max<T>(this IObservable<Thickness<T>> a, Thickness<T> b)\n\t\t\twhere T : IComparable<T>\n\t\t{\n\t\t\treturn a.Select(t => t.Max(b));\n\t\t}\n\n\t\tpublic static Thickness<T> Max<T>(this Thickness<T> a, Thickness<T> b)\n\t\t\twhere T : IComparable<T>\n\t\t{\n\t\t\treturn Thickness.Create(a.Left.Max(b.Left), a.Top.Max(b.Top), a.Right.Max(b.Right), a.Bottom.Max(b.Bottom));\n\t\t}\n\n\t\tpublic static IObservable<T> Max<T>(this IObservable<T> left, T right)\n\t\t\twhere T : IComparable<T>\n\t\t{\n\t\t\treturn left.Select(l => l.Max(right));\n\t\t}\n\n\t\tpublic static IObservable<T> Max<T>(this IObservable<T> left, IObservable<T> right)\n\t\t\twhere T : IComparable<T>\n\t\t{\n\t\t\treturn left.CombineLatest(right, Max);\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\tpublic static Size<T> Max<T>(this Size<T> size, T minWidth, T minHeight)\n\t\t\twhere T : IComparable<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tsize.Width.Max(minWidth),\n\t\t\t\tsize.Height.Max(minHeight));\n\t\t}\n\n\t\tpublic static Size<IObservable<T>> Max<T>(this Size<IObservable<T>> left, Size<IObservable<T>> right)\n\t\t\twhere T : IComparable<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.Width.Max(right.Width),\n\t\t\t\tleft.Height.Max(right.Height));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/Min.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n    public static partial class Comparable\n    {\n\t\tpublic static T Min<T>(this T self, T other) where T : IComparable<T>\n\t\t{\n\t\t\treturn self.CompareTo(other) < 0\n\t\t\t\t? self\n\t\t\t\t: other;\n\t\t}\n\n\t\tpublic static IObservable<T> Min<T>(this IObservable<T> left, T right) where T : IComparable<T>\n\t\t{\n\t\t\treturn left.Select(l => l.Min(right));\n\t\t}\n\n\t\tpublic static IObservable<T> Min<T>(this IObservable<T> left, IObservable<T> right) where T : IComparable<T>\n\t\t{\n\t\t\treturn left.CombineLatest(right, Min);\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\tpublic static Size<T> Min<T>(this Size<T> size, T minWidth, T minHeight) where T : IComparable<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tsize.Width.Min(minWidth),\n\t\t\t\tsize.Height.Min(minHeight));\n\t\t}\n\n\t\tpublic static Size<IObservable<T>> Min<T>(this Size<IObservable<T>> left, Size<IObservable<T>> right) where T : IComparable<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.Width.Min(right.Width),\n\t\t\t\tleft.Height.Min(right.Height));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Mul.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Numeric\n\t{\n\t\tpublic static IObservable<TNum> Mul<TNum, TDenom>(this IObservable<TDenom> left, IObservable<Ratio<TNum, TDenom>> right)\n\t\t\twhere TNum : INumeric<TNum>, new()\n\t\t\twhere TDenom : INumeric<TDenom>, new()\n\t\t{\n\t\t\treturn left.CombineLatest(right, (l, r) => l.Mul(r));\n\t\t}\n\n\t\tpublic static IObservable<T> Mul<T>(this IObservable<T> left, IObservable<T> right) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn left.CombineLatest(right, (l, r) => l.Mul(r));\n\t\t}\n\n\t\tpublic static IObservable<T> Mul<T>(this IObservable<T> left, double right) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn left.Select(l => new T().FromDouble(l.ToDouble() * right));\n\t\t}\n\n\t\tpublic static IObservable<T> Mul<T>(this IObservable<T> left, IObservable<double> right) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn left.CombineLatest(right, Mul);\n\t\t}\n\n\t\tpublic static IObservable<T> Mul<T>(this T left, IObservable<double> right) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn right.Select(r => left.Mul(r));\n\t\t}\n\n\t\tpublic static T Mul<T>(this T left, double right) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn new T().FromDouble(left.ToDouble() * right);\n\t\t}\n\n\t\tpublic static IObservable<T> Mul<T>(this IObservable<T> left, T right) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn left.Select(l => l.Mul(right));\n\t\t}\n\n\t\tpublic static TResult Mul<T, TResult>(this T value, Ratio<TResult, T> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn new TResult().FromDouble(value.ToDouble() * ratio.Value);\n\t\t}\n\n\n\t}\n\n\tpublic static partial class ContentFrame\n\t{\n\t\tpublic static ContentFrame<TResult> Mul<T, TResult>(this ContentFrame<T> frame, Ratio<TResult, T> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn new ContentFrame<TResult>(\n\t\t\t\tframe.FrameBuonds.Mul(ratio),\n\t\t\t\tframe.ContentBounds.Mul(ratio));\n\t\t}\n\t}\n\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static Rectangle<TResult> Mul<T, TResult>(this Rectangle<T> rectangle, Ratio<TResult, T> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn FromPositionSize(\n\t\t\t\trectangle.Position.Mul(ratio),\n\t\t\t\trectangle.Size.Mul(ratio));\n\t\t}\n\t}\n\n\tpublic static partial class Point\n\t{\n\t\tpublic static Point<TResult> Mul<T, TResult>(this Point<T> point, Ratio<TResult, T> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tpoint.X.Mul(ratio),\n\t\t\t\tpoint.Y.Mul(ratio));\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\tpublic static Size<TResult> Mul<T, TResult>(this Size<T> size, Ratio<TResult, T> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tsize.Width.Mul(ratio),\n\t\t\t\tsize.Height.Mul(ratio));\n\t\t}\n\t}\n\n\tpublic static partial class Vector\n\t{\n\t\tpublic static Vector<TResult> Mul<T, TResult>(this Vector<T> size, Ratio<TResult, T> ratio)\n\t\t\twhere T : INumeric<T>, new()\n\t\t\twhere TResult : INumeric<TResult>, new()\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tsize.X.Mul(ratio),\n\t\t\t\tsize.Y.Mul(ratio));\n\t\t}\n\t}\n\n\tpublic partial struct Ratio<TNum, TDenom>\n\t{\n\t\tpublic static Size<TNum> operator *(Size<TDenom> size, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn size.Mul(ratio);\n\t\t}\n\n\t\tpublic static Point<TNum> operator *(Point<TDenom> point, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn point.Mul(ratio);\n\t\t}\n\n\t\tpublic static Vector<TNum> operator *(Vector<TDenom> vec, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn vec.Mul(ratio);\n\t\t}\n\n\t\tpublic static TNum operator *(TDenom value, Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn value.Mul(ratio);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/ReactiveExtensions.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static class ReactiveExtensions\n\t{\n\t\t// Switch\n\n\t\tpublic static Rectangle<IObservable<TOut>> Switch<TIn, TOut>(this IObservable<TIn> self, Func<TIn, Rectangle<IObservable<TOut>>> selector)\n\t\t{\n\t\t\treturn self.Select(selector).Switch();\n\t\t}\n\n\t\tpublic static Size<IObservable<TOut>> Switch<TIn, TOut>(this IObservable<TIn> self, Func<TIn, Size<IObservable<TOut>>> selector)\n\t\t{\n\t\t\treturn self.Select(selector).Switch();\n\t\t}\n\n\t\t// Switch2\n\n\t\tpublic static Rectangle<IObservable<T>> Switch<T>(this IObservable<Rectangle<IObservable<T>>> self)\n\t\t{\n\t\t\treturn new Rectangle<IObservable<T>>(\n\t\t\t\tself.Select(r => r.HorizontalInterval).Switch(),\n\t\t\t\tself.Select(r => r.VerticalInterval).Switch());\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>> Switch<T>(this IObservable<Interval<IObservable<T>>> self)\n\t\t{\n\t\t\treturn Interval.FromOffsetLength(\n\t\t\t\tself.Select(r => r.Offset).Switch(),\n\t\t\t\tself.Select(r => r.Length).Switch());\n\t\t}\n\n\t\tpublic static Size<IObservable<T>> Switch<T>(this IObservable<Size<IObservable<T>>> self)\n\t\t{\n\t\t\treturn new Size<IObservable<T>>(\n\t\t\t\tself.Select(r => r.Width).Switch(),\n\t\t\t\tself.Select(r => r.Height).Switch());\n\t\t}\n\n\t\t// Distinct until changed\n\n\t\tpublic static Rectangle<IObservable<T>> DistinctUntilChanged<T>(this Rectangle<IObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.DistinctUntilChanged());\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>> DistinctUntilChanged<T>(this Interval<IObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.DistinctUntilChanged());\n\t\t}\n\n\n\t\tpublic static Size<IObservable<T>> DistinctUntilChanged<T>(this Size<IObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.DistinctUntilChanged());\n\t\t}\n\n\t\t// Replay\n\n\t\tpublic static Rectangle<IConnectableObservable<T>> Replay<T>(this Rectangle<IObservable<T>> self, int bufferSize)\n\t\t{\n\t\t\treturn self.Select(c => c.Replay(bufferSize));\n\t\t}\n\n\t\tpublic static Interval<IConnectableObservable<T>> Replay<T>(this Interval<IObservable<T>> self, int bufferSize)\n\t\t{\n\t\t\treturn self.Select(c => c.Replay(bufferSize));\n\t\t}\n\n\t\tpublic static Size<IConnectableObservable<T>> Replay<T>(this Size<IObservable<T>> self, int bufferSize)\n\t\t{\n\t\t\treturn self.Select(c => c.Replay(bufferSize));\n\t\t}\n\n\t\t// Connect\n\n\t\tpublic static Rectangle<IDisposable> Connect<T>(this Rectangle<IConnectableObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.Connect());\n\t\t}\n\n\t\tpublic static Size<IDisposable> Connect<T>(this Size<IConnectableObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.Connect());\n\t\t}\n\n\t\t// RefCount\n\n\t\tpublic static Rectangle<IObservable<T>> RefCount<T>(this Rectangle<IConnectableObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.RefCount());\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>> RefCount<T>(this Interval<IConnectableObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.RefCount());\n\t\t}\n\n\t\tpublic static Size<IObservable<T>> RefCount<T>(this Size<IConnectableObservable<T>> self)\n\t\t{\n\t\t\treturn self.Select(c => c.RefCount());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/RelativeTo.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static IObservable<Rectangle<T>> RelativeTo<T>(this IObservable<Rectangle<T>> self, IObservable<Point<T>> position)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.CombineLatest(position, RelativeTo);\n\t\t}\n\n\t\tpublic static Rectangle<T> RelativeTo<T>(this Rectangle<T> self, Point<T> position)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromOffsetLength(self.HorizontalInterval.Offset.Sub(position.X), self.HorizontalInterval.Length),\n\t\t\t\tInterval.FromOffsetLength(self.VerticalInterval.Offset.Sub(position.Y), self.VerticalInterval.Length));\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> RelativeTo<T>(this Rectangle<IObservable<T>> self, Point<T> position)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromOffsetLength(self.HorizontalInterval.Offset.Sub(position.X), self.HorizontalInterval.Length),\n\t\t\t\tInterval.FromOffsetLength(self.VerticalInterval.Offset.Sub(position.Y), self.VerticalInterval.Length));\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> RelativeTo<T>(this Rectangle<IObservable<T>> self, Point<IObservable<T>> position)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromOffsetLength(self.HorizontalInterval.Offset.Sub(position.X), self.HorizontalInterval.Length),\n\t\t\t\tInterval.FromOffsetLength(self.VerticalInterval.Offset.Sub(position.Y), self.VerticalInterval.Length));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Round.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Numeric\n\t{\n\t\tpublic static IObservable<T> Round<T>(this IObservable<T> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Round);\n\t\t}\n\n\t\tpublic static T Round<T>(this T self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.FromDouble(Math.Round(self.ToDouble()));\n\t\t}\n\t}\n\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static IObservable<Rectangle<T>> Round<T>(this IObservable<Rectangle<T>> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Round);\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> Round<T>(this Rectangle<IObservable<T>> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\n\t\tpublic static Rectangle<T> Round<T>(this Rectangle<T> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\t}\n\n\tpublic static partial class Vector\n\t{\n\t\tpublic static Vector<IObservable<T>> Round<T>(this Vector<IObservable<T>> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\n\t\tpublic static Vector<T> Round<T>(this Vector<T> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\t}\n\n\tpublic static partial class Point\n\t{\n\t\tpublic static Point<IObservable<T>> Round<T>(this Point<IObservable<T>> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\n\t\tpublic static Point<T> Round<T>(this Point<T> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\tpublic static Size<IObservable<T>> Round<T>(this Size<IObservable<T>> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\n\t\tpublic static Size<T> Round<T>(this Size<T> self) where T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Numeric.Round);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/Select.cs",
    "content": "﻿using System;\n\nnamespace Outracks\n{\n\tpublic static partial class Point\n\t{\n\t\tpublic static Point<TDst> Select<TSrc, TDst>(this Point<TSrc> r, Func<TSrc, TDst> transform)\n\t\t{\n\t\t\treturn Create(transform(r.X), transform(r.Y));\n\t\t}\n\t}\n\n\tpublic static partial class Vector\n\t{\n\t\tpublic static Vector<TDst> Select<TSrc, TDst>(this Vector<TSrc> r, Func<TSrc, TDst> transform)\n\t\t{\n\t\t\treturn Create(transform(r.X), transform(r.Y));\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\tpublic static Size<TDst> Select<TSrc, TDst>(this Size<TSrc> r, Func<TSrc, TDst> transform)\n\t\t{\n\t\t\treturn Create(transform(r.Width), transform(r.Height));\n\t\t}\n\t}\n\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static Rectangle<TDst> Select<TSrc, TDst>(this Rectangle<TSrc> r, Func<TSrc, TDst> transform)\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tr.HorizontalInterval.Select(transform),\n\t\t\t\tr.VerticalInterval.Select(transform));\n\t\t}\n\t}\n\n\tpublic static partial class Interval\n\t{\n\t\tpublic static Interval<TDst> Select<TSrc, TDst>(this Interval<TSrc> r, Func<TSrc, TDst> transform)\n\t\t{\n\t\t\treturn FromOffsetLength(transform(r.Offset), transform(r.Length));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/Sub.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Numeric\n\t{\n\t\t// Numeric = Numeric - Numeric\n\n\t\tpublic static T Sub<T>(this T left, T right) where T : IGroup<T>\n\t\t{\n\t\t\treturn left.Add(right.Inverse());\n\t\t}\n\n\t\tpublic static IObservable<T> Sub<T>(this IObservable<T> left, IObservable<T> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn left.CombineLatest(right, Sub);\n\t\t}\n\n\t\tpublic static IObservable<T> Sub<T>(this IObservable<T> left, T right) where T: INumeric<T>\n\t\t{\n\t\t\treturn left.Select(l => l.Sub(right));\n\t\t}\n\n\t\tpublic static IObservable<T> Sub<T>(this T left, IObservable<T> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn right.Select(r => left.Sub(r));\n\t\t}\n\t}\n\n\tpublic static partial class Point\n\t{\n\t\t// Point = Point - Vector\n\n\t\tpublic static Point<T> Sub<T>(Point<T> self, Vector<T> vec)\n\t\t{\n\t\t\treturn new Point<T>(\n\t\t\t\tAlgebra<T>.Sub(self.X, vec.X),\n\t\t\t\tAlgebra<T>.Sub(self.Y, vec.Y));\n\t\t}\n\n\t\tpublic static Point<IObservable<T>> Sub<T>(Point<IObservable<T>> left, Vector<T> right)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.X.Sub(right.X),\n\t\t\t\tleft.Y.Sub(right.Y));\n\t\t}\n\n\t\tpublic static Point<IObservable<T>> Sub<T>(Point<T> left, Vector<IObservable<T>> right)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.X.Sub(right.X),\n\t\t\t\tleft.Y.Sub(right.Y));\n\t\t}\n\n\t}\n\n\tpublic static partial class Vector\n\t{\n\t\t// Vector = Vector - Vector\n\n\t\tpublic static Vector<T> Sub<T>(Vector<T> to, Vector<T> from)\n\t\t{\n\t\t\treturn new Vector<T>(\n\t\t\t\tAlgebra<T>.Sub(to.X, from.X),\n\t\t\t\tAlgebra<T>.Sub(to.Y, from.Y));\n\t\t}\n\n\t\tpublic static Vector<IObservable<T>> Sub<T>(this Vector<IObservable<T>> left, Vector<T> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.X.Sub(right.X),\n\t\t\t\tleft.Y.Sub(right.Y));\n\t\t}\n\n\t\tpublic static Vector<IObservable<T>> Sub<T>(this Vector<T> left, Vector<IObservable<T>> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.X.Sub(right.X),\n\t\t\t\tleft.Y.Sub(right.Y));\n\t\t}\n\n\t\t// Vector = Point - Point\n\n\t\tpublic static Vector<T> Sub<T>(Point<T> self, Point<T> vec)\n\t\t{\n\t\t\treturn new Vector<T>(\n\t\t\t\tAlgebra<T>.Sub(self.X, vec.X),\n\t\t\t\tAlgebra<T>.Sub(self.Y, vec.Y));\n\t\t}\n\n\t\tpublic static Vector<IObservable<T>> Sub<T>(Point<IObservable<T>> left, Point<T> right)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.X.Sub(right.X),\n\t\t\t\tleft.Y.Sub(right.Y));\n\t\t}\n\n\t\tpublic static Vector<IObservable<T>> Sub<T>(Point<T> left, Point<IObservable<T>> right)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.X.Sub(right.X),\n\t\t\t\tleft.Y.Sub(right.Y));\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\t// Size = Size - Size\n\n\t\tpublic static Size<T> Sub<T>(Size<T> left, Size<T> right)\n\t\t{\n\t\t\treturn new Size<T>(\n\t\t\t\tAlgebra<T>.Sub(left.Width, right.Width),\n\t\t\t\tAlgebra<T>.Sub(left.Height, right.Height));\n\t\t}\n\n\t\tpublic static Size<IObservable<T>> Sub<T>(this Size<IObservable<T>> left, Size<T> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.Width.Sub(right.Width),\n\t\t\t\tleft.Height.Sub(right.Height));\n\t\t}\n\n\t\tpublic static Size<IObservable<T>> Sub<T>(this Size<T> left, Size<IObservable<T>> right) where T : INumeric<T>\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tleft.Width.Sub(right.Width),\n\t\t\t\tleft.Height.Sub(right.Height));\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/common/math/Operators/Subdivide.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class SubdivideExtension\n\t{\n\t\t// Rectangle\n\n\t\tpublic static Rectangle<T>[] Subdivide<T>(this Rectangle<T> rect, Axis2D axis, int divisions) where T : INumeric<T>\n\t\t{\n\t\t\treturn rect.Subdivide(axis, Enumerable.Repeat(1.0, divisions));\n\t\t}\n\n\t\tpublic static Rectangle<T>[] Subdivide<T>(this Rectangle<T> rect, Axis2D axis, IEnumerable<double> divisions) where T : INumeric<T>\n\t\t{\n\t\t\treturn rect[axis]\n\t\t\t\t.Subdivide(divisions)\n\t\t\t\t.Select(interval =>\n\t\t\t\t\taxis == Axis2D.Horizontal\n\t\t\t\t\t\t? Rectangle.FromIntervals(interval, rect.VerticalInterval)\n\t\t\t\t\t\t: Rectangle.FromIntervals(rect.HorizontalInterval, interval))\n\t\t\t\t.ToArray();\n\t\t}\n\n\t\t// Interval\n\n\t\tpublic static Interval<T>[] Subdivide<T>(this Interval<T> interval, IEnumerable<double> divisions) where T : INumeric<T>\n\t\t{\n\t\t\tvar div = divisions.ToArray();\n\t\t\tvar intervals = new Interval<T>[div.Length];\n\n\t\t\tif (interval.Length.ToDouble() < double.Epsilon)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < div.Length; i++)\n\t\t\t\t\tintervals[i] = interval;\n\t\t\t\treturn intervals;\n\t\t\t}\n\n\t\t\tvar divSum = div.Sum();\n\t\t\tvar intervalLength = interval.Length;\n\n\t\t\tvar left = interval.Offset;\n\t\t\tfor (int i = 0; i < div.Length; i++)\n\t\t\t{\n\t\t\t\tvar division = div[i];\n\n\t\t\t\tvar elementLength = left.FromDouble(division / divSum * intervalLength.ToDouble());\n\t\t\t\tvar right = left.Add(elementLength);\n\n\t\t\t\tvar leftRounded = left.Round();\n\t\t\t\tintervals[i] = Interval.FromOffsetLength(leftRounded, right.Round().Sub(leftRounded));\n\n\t\t\t\tleft = right;\n\t\t\t}\n\n\t\t\treturn intervals;\n\t\t}\n\n\t\tpublic static Interval<T>[] Subdivide<T>(this Interval<T> interval, int divisions) where T : INumeric<T>\n\t\t{\n\t\t\tvar intervals = new Interval<T>[divisions];\n\n\t\t\tvar t = interval.Offset;\n\t\t\tvar lengthPerElement = t.FromDouble(interval.Length.ToDouble() / divisions);\n\n\t\t\tfor (int i = 0; i < divisions; i++)\n\t\t\t{\n\t\t\t\tintervals[i] = Interval.FromOffsetLength(\n\t\t\t\t\tinterval.Offset.Add(lengthPerElement.Mul(t.FromDouble(i))),\n\t\t\t\t\tlengthPerElement);\n\t\t\t}\n\n\t\t\treturn intervals;\n\t\t}\n\n\t\t// Size\n\n\t\tpublic static Size<T> Subdivide<T>(this Size<T> size, Axis2D axis, int divisions) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn axis == Axis2D.Horizontal\n\t\t\t\t? new Size<T>(new T().FromDouble(size.Width.ToDouble() / divisions), size.Height)\n\t\t\t\t: new Size<T>(size.Width, new T().FromDouble(size.Height.ToDouble() / divisions));\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>>[] Subdivide<T>(this Interval<IObservable<T>> interval, IEnumerable<double> divisions) where T : INumeric<T>, new()\n\t\t{\n\t\t\tvar div = divisions.ToArray();\n\n\t\t\tvar intervals = new Interval<IObservable<T>>[div.Length];\n\n\t\t\tvar transInterval = interval.Transpose().Select(t => t.Subdivide(div));\n\n\t\t\tfor (int i = 0; i < div.Length; i++)\n\t\t\t{\n\t\t\t\tvar ii = i;\n\t\t\t\tintervals[i] = transInterval.Select(t => t[ii]).Transpose();\n\t\t\t}\n\n\t\t\treturn intervals;\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/common/math/Operators/Transpose.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Point\n\t{\n\t\tpublic static Point<IObservable<T>> Transpose<T>(this IObservable<Point<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\tself = self.Replay(1).RefCount();\n\t\t\treturn Create(\n\t\t\t\tself.Select(i => i.X).DistinctUntilChanged(),\n\t\t\t\tself.Select(i => i.Y).DistinctUntilChanged());\n\t\t}\n\n\t\tpublic static IObservable<Point<T>> Transpose<T>(this Point<IObservable<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\treturn self.X.CombineLatest(self.Y, Create)\n\t\t\t\t//.Sample(TimeSpan.FromMilliseconds(1))\n\t\t\t\t;\n\t\t}\n\t}\n\n\tpublic static partial class Vector\n\t{\n\t\tpublic static Vector<IObservable<T>> Transpose<T>(this IObservable<Vector<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\tself = self.Replay(1).RefCount();\n\t\t\treturn Create(\n\t\t\t\tself.Select(i => i.X).DistinctUntilChanged(),\n\t\t\t\tself.Select(i => i.Y).DistinctUntilChanged());\n\t\t}\n\n\t\tpublic static IObservable<Vector<T>> Transpose<T>(this Vector<IObservable<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\treturn self.X.CombineLatest(self.Y, Create)\n\t\t\t\t//.Sample(TimeSpan.FromMilliseconds(1))\n\t\t\t\t;\n\t\t}\n\t}\n\n\tpublic static partial class Size\n\t{\n\t\tpublic static Size<IObservable<T>> Transpose<T>(this IObservable<Size<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\tself = self.Replay(1).RefCount();\n\t\t\treturn Create(\n\t\t\t\tself.Select(i => i.Width).DistinctUntilChanged(),\n\t\t\t\tself.Select(i => i.Height).DistinctUntilChanged());\n\t\t}\n\n\t\tpublic static IObservable<Size<T>> Transpose<T>(this Size<IObservable<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\treturn self.Width.CombineLatest(self.Height, Create)\n\t\t\t\t//.Sample(TimeSpan.FromMilliseconds(1))\n\t\t\t\t;\n\t\t}\n\t}\n\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static Rectangle<IObservable<T>> Transpose<T>(this IObservable<Rectangle<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\tself = self.Replay(1).RefCount();\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromOffsetLength(\n\t\t\t\t\tself.Select(r => r.HorizontalInterval.Offset).DistinctUntilChanged(),\n\t\t\t\t\tself.Select(r => r.HorizontalInterval.Length).DistinctUntilChanged()),\n\t\t\t\tInterval.FromOffsetLength(\n\t\t\t\t\tself.Select(r => r.VerticalInterval.Offset).DistinctUntilChanged(),\n\t\t\t\t\tself.Select(r => r.VerticalInterval.Length).DistinctUntilChanged()));\n\t\t}\n\n\t\tpublic static IObservable<Rectangle<T>> Transpose<T>(this Rectangle<IObservable<T>> self) where T : IComparable<T>\n\t\t{\n\t\t\treturn self.HorizontalInterval.Transpose()\n\t\t\t\t.CombineLatest(self.VerticalInterval.Transpose(), FromIntervals)\n\t\t\t\t//.Sample(TimeSpan.FromMilliseconds(1))\n\t\t\t\t;\n\t\t}\n\t}\n\n\tpublic static partial class Interval\n\t{\n\t\tpublic static IObservable<TResult> Combine<T, TResult>(this Interval<IObservable<T>> interval, Func<Interval<T>, TResult> combinator)\n\t\t{\n\t\t\treturn interval.Transpose().Select(combinator);\n\t\t}\n\n\t\tpublic static IObservable<Interval<T>> Transpose<T>(this Interval<IObservable<T>> self)\n\t\t{\n\t\t\treturn self.Offset.CombineLatest(self.Length, FromOffsetLength);\n\t\t}\n\n\t\tpublic static Interval<IObservable<T>> Transpose<T>(this IObservable<Interval<T>> self)\n\t\t{\n\t\t\treturn new Interval<IObservable<T>>(\n\t\t\t\tself.Select(s => s.Offset),\n\t\t\t\tself.Select(s => s.Length));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/math/Operators/Union.cs",
    "content": "﻿namespace Outracks\n{\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static Rectangle<T> Union<T>(this Rectangle<T> self, Rectangle<T> other)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromSides(\n\t\t\t\tleft: self.Left().Min(other.Left()),\n\t\t\t\ttop: self.Top().Min(other.Top()),\n\t\t\t\tright: self.Right().Max(other.Right()),\n\t\t\t\tbottom: self.Bottom().Max(other.Bottom()));\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/math/Outracks.Math.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{3C1C1047-8830-498E-882A-503C0956CBE3}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Math</RootNamespace>\n    <AssemblyName>Outracks.Math</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Matrix.cs\" />\n    <Compile Include=\"Operators\\Inflate.cs\" />\n    <Compile Include=\"Operators\\RelativeTo.cs\" />\n    <Compile Include=\"Operators\\Transpose.cs\" />\n    <Compile Include=\"Operators\\Select.cs\" />\n    <Compile Include=\"Operators\\Sub.cs\" />\n    <Compile Include=\"Operators\\Add.cs\" />\n    <Compile Include=\"Operators\\Algebra.cs\" />\n    <Compile Include=\"Axis2D.cs\" />\n    <Compile Include=\"Operators\\Round.cs\" />\n    <Compile Include=\"Operators\\Intersect.cs\" />\n    <Compile Include=\"Operators\\LessThan.cs\" />\n    <Compile Include=\"Operators\\Div.cs\" />\n    <Compile Include=\"Operators\\Mul.cs\" />\n    <Compile Include=\"Operators\\Min.cs\" />\n    <Compile Include=\"Operators\\Clamp.cs\" />\n    <Compile Include=\"Operators\\Max.cs\" />\n    <Compile Include=\"Operators\\GreaterThan.cs\" />\n    <Compile Include=\"ContentFrame.cs\" />\n    <Compile Include=\"Discrete\\CycleDetected.cs\" />\n    <Compile Include=\"Discrete\\GraphInversion.cs\" />\n    <Compile Include=\"Discrete\\ReachableSet.cs\" />\n    <Compile Include=\"Discrete\\SetClosure.cs\" />\n    <Compile Include=\"Discrete\\TopologicalSort.cs\" />\n    <Compile Include=\"IGroup.cs\" />\n    <Compile Include=\"Interval.cs\" />\n    <Compile Include=\"INumeric.cs\" />\n    <Compile Include=\"IRing.cs\" />\n    <Compile Include=\"Operators\\Subdivide.cs\" />\n    <Compile Include=\"Point.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Ratio.cs\" />\n    <Compile Include=\"Operators\\ReactiveExtensions.cs\" />\n    <Compile Include=\"Rectangle.cs\" />\n    <Compile Include=\"Operators\\Union.cs\" />\n    <Compile Include=\"Size.cs\" />\n    <Compile Include=\"Corners.cs\" />\n    <Compile Include=\"Thickness.cs\" />\n    <Compile Include=\"Units\\ClipSpaceUnits.cs\" />\n    <Compile Include=\"Units\\GlWindowPixels.cs\" />\n    <Compile Include=\"Units\\Inches.cs\" />\n    <Compile Include=\"Units\\Percentages.cs\" />\n    <Compile Include=\"Units\\Pixels.cs\" />\n    <Compile Include=\"Units\\Points.cs\" />\n    <Compile Include=\"Units\\TextureSpaceUnits.cs\" />\n    <Compile Include=\"Vector.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <ItemGroup />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/common/math/Point.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Outracks\n{\n\tpublic static partial class Point\n\t{\n\t\tpublic static Point<T> Create<T>(T u, T v, Axis2D firstAxis)\n\t\t{\n\t\t\treturn firstAxis == Axis2D.Horizontal ? Create(u, v) : Create(v, u);\n\t\t}\n\n\t\tpublic static Point<T> Create<T>(T x, T y)\n\t\t{\n\t\t\treturn new Point<T>(x, y);\n\t\t}\n\n\t\tpublic static Point<T> Zero<T>() where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn new Point<T>(new T().Zero, new T().Zero);\n\t\t}\n\n\t\tpublic static Point<T> WithAxis<T>(this Point<T> point, Axis2D axis, T value)\n\t\t{\n\t\t\treturn axis == Axis2D.Horizontal\n\t\t\t\t? new Point<T>(value, point.X)\n\t\t\t\t: new Point<T>(point.Y, value);\n\t\t}\n\n\t\tpublic static Point<T> WithAxis<T>(this Point<T> point, Axis2D axis, Func<T,T> transform)\n\t\t{\n\t\t\treturn axis == Axis2D.Horizontal\n\t\t\t\t? new Point<T>(transform(point.Y), point.X)\n\t\t\t\t: new Point<T>(point.Y, transform(point.X));\n\t\t}\n\t}\n\n\tpublic partial struct Point<T> : IEquatable<Point<T>> //where T : INumeric<T>\n\t{\n\t\tstatic Point()\n\t\t{\n\t\t\tAlgebras.Initialize();\n\t\t}\n\n\t\tpublic readonly T X;\n\t\tpublic readonly T Y;\n\n\t\tpublic Point(T x, T y)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{\"+X+\", \"+Y+\"}\";\n\t\t}\n\n\t\tpublic static bool operator ==(Point<T> left, Point<T> right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Point<T> left, Point<T> right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic bool Equals(Point<T> other)\n\t\t{\n\t\t\treturn EqualityComparer<T>.Default.Equals(X, other.X) && EqualityComparer<T>.Default.Equals(Y, other.Y);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Point<T> && Equals((Point<T>) obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (EqualityComparer<T>.Default.GetHashCode(X) * 397) ^ EqualityComparer<T>.Default.GetHashCode(Y);\n\t\t\t}\n\t\t}\n\n\t\tpublic Vector<T> ToVector()\n\t\t{\n\t\t\treturn new Vector<T>(X, Y);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Math\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/common/math/Ratio.cs",
    "content": "using System;\nusing System.Globalization;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic static class Ratio\n\t{\n\t\tpublic static Ratio<TNum, TDenom> Read<TNum, TDenom>(BinaryReader reader)\n\t\t\twhere TNum: INumeric<TNum>, new()\n\t\t\twhere TDenom: INumeric<TDenom>, new()\n\t\t{\n\t\t\treturn new Ratio<TNum, TDenom>(reader.ReadDouble());\n\t\t}\n\n\t\tpublic static void Write<TNum, TDenom>(BinaryWriter writer, Ratio<TNum, TDenom> size)\n\t\t\twhere TNum: INumeric<TNum>, new()\n\t\t\twhere TDenom: INumeric<TDenom>, new()\n\t\t{\n\t\t\twriter.Write(size.Value);\n\t\t}\n\t}\n\n\tpublic partial struct Ratio<TNum, TDenom> : IEquatable<Ratio<TNum, TDenom>>, IComparable<Ratio<TNum, TDenom>>\n\t\twhere TNum: INumeric<TNum>, new()\n\t\twhere TDenom: INumeric<TDenom>, new()\n\t{\n\t\tpublic readonly double Value;\n\t\tpublic Ratio(double value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic static implicit operator Ratio<TNum, TDenom>(double value)\n\t\t{\n\t\t\treturn new Ratio<TNum, TDenom>(value);\n\t\t}\n\n\t\tpublic static implicit operator double(Ratio<TNum, TDenom> ratio)\n\t\t{\n\t\t\treturn ratio.Value;\n\t\t}\n\n\t\tpublic bool Equals(Ratio<TNum, TDenom> other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value);\n\t\t}\n\n\t\tpublic int CompareTo(Ratio<TNum, TDenom> other)\n\t\t{\n\t\t\treturn Value.CompareTo(other.Value);\n\t\t}\n\n\t\tpublic Ratio<TDenom, TNum> Reciprocal()\n\t\t{\n\t\t\treturn new Ratio<TDenom, TNum>(1.0/Value);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Ratio<TNum, TDenom> && Equals((Ratio<TNum, TDenom>)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Value.GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value.ToString(CultureInfo.InvariantCulture);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/math/Rectangle.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Rectangle\n\t{\n\t\tpublic static IObservable<Rectangle<T>> Transform<T>(this IObservable<Rectangle<T>> rect, IObservable<Matrix> m)\n\t\t\twhere T : INumeric<T>, new()\n\t\t{\n\t\t\treturn rect.CombineLatest(m, Transform);\n\t\t}\n\n\t\tpublic static Rectangle<T> Transform<T>(this Rectangle<T> rect, Matrix m)\n\t\t\twhere T : INumeric<T>, new ()\n\t\t{\n\t\t\tvar p0 = rect.LeftTop();\n\t\t\tvar p1 = rect.RightTop();\n\t\t\tvar p2 = rect.LeftBottom();\n\t\t\tvar p3 = rect.RightBottom();\n\n\t\t\tvar tp0 = p0.Transform(m);\n\t\t\tvar tp1 = p1.Transform(m);\n\t\t\tvar tp2 = p2.Transform(m);\n\t\t\tvar tp3 = p3.Transform(m);\n\n\t\t\tvar minX = tp0.X.Min(tp1.X.Min(tp2.X.Min(tp3.X)));\n\t\t\tvar minY = tp0.Y.Min(tp1.Y.Min(tp2.Y.Min(tp3.Y)));\n\t\t\tvar maxX = tp0.X.Max(tp1.X.Max(tp2.X.Max(tp3.X)));\n\t\t\tvar maxY = tp0.Y.Max(tp1.Y.Max(tp2.Y.Max(tp3.Y)));\n\n\t\t\treturn FromSides(minX, minY, maxX, maxY);\n\t\t}\n\n\t\t// Constructors\n\n\t\tpublic static Rectangle<T> FromIntervals<T>(Interval<T> horizontalInterval, Interval<T> verticalInterval)\n\t\t{\n\t\t\treturn new Rectangle<T>(horizontalInterval, verticalInterval);\n\t\t}\n\n\t\tpublic static Rectangle<double> FromSides(double left, double top, double right, double bottom)\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromMinMax(left, right),\n\t\t\t\tInterval.FromMinMax(top, bottom));\n\t\t}\n\n\t\tpublic static Rectangle<T> FromSides<T>(T left, T top, T right, T bottom)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromMinMax(left, right),\n\t\t\t\tInterval.FromMinMax(top, bottom));\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> FromSides<T>(IObservable<T> left, IObservable<T> top, IObservable<T> right, IObservable<T> bottom)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromMinMax(left, right),\n\t\t\t\tInterval.FromMinMax(top, bottom));\n\t\t}\n\n\t\tpublic static Rectangle<T> ToRectangle<T>(this Size<T> size) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromOffsetLength(new T(), size.Width),\n\t\t\t\tInterval.FromOffsetLength(new T(), size.Height));\n\t\t}\n\n\t\tpublic static Rectangle<T> FromPositionSize<T>(Point<T> position, Size<T> size)\n\t\t{\n\t\t\treturn FromPositionSize(position.X, position.Y, size.Width, size.Height);\n\t\t}\n\n\t\tpublic static Rectangle<T> FromPositionSize<T>(T left, T top, T width, T height)\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromOffsetLength(left, width),\n\t\t\t\tInterval.FromOffsetLength(top, height));\n\t\t}\n\n\t\tpublic static Rectangle<T> Zero<T>() where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn FromPositionSize(Point.Zero<T>(), Outracks.Size.Zero<T>());\n\t\t}\n\n\t\tpublic static bool Contains<T>(this Rectangle<T> rect, Point<T> p) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn rect.HorizontalInterval.Contains(p.X) && rect.VerticalInterval.Contains(p.Y);\n\t\t}\n\n\n\t\t// Mutators\n\n\t\tpublic static Rectangle<IObservable<T>> With<T>(\n\t\t\tthis Rectangle<IObservable<T>> self,\n\t\t\tIObservable<T> left = null,\n\t\t\tIObservable<T> top = null,\n\t\t\tIObservable<T> right = null,\n\t\t\tIObservable<T> bottom = null)\n\t\t\twhere T : struct, INumeric<T>\n\t\t{\n\t\t\treturn FromSides(\n\t\t\t\tleft ?? self.Left(),\n\t\t\t\ttop ?? self.Top(),\n\t\t\t\tright ?? self.Right(),\n\t\t\t\tbottom ?? self.Bottom());\n\t\t}\n\n\t\tpublic static Rectangle<T> With<T>(\n\t\t\tthis Rectangle<T> self,\n\t\t\tT? left = null,\n\t\t\tT? top = null,\n\t\t\tT? right = null,\n\t\t\tT? bottom = null)\n\t\t\twhere T : struct, INumeric<T>\n\t\t{\n\t\t\treturn FromSides(\n\t\t\t\tleft ?? self.Left(),\n\t\t\t\ttop ?? self.Top(),\n\t\t\t\tright ?? self.Right(),\n\t\t\t\tbottom ?? self.Bottom());\n\t\t}\n\t\t/*\n\t\tpublic static Rectangle<T> With<T>(\n\t\t\tthis Rectangle<T> self,\n\t\t\tT left = default(T),\n\t\t\tT top = default(T),\n\t\t\tT right = default(T),\n\t\t\tT bottom = default(T))\n\t\t\twhere T : class\n\t\t{\n\t\t\treturn FromSides(\n\t\t\t\tleft ?? self.Left,\n\t\t\t\ttop ?? self.Top,\n\t\t\t\tright ?? self.Right,\n\t\t\t\tbottom ?? self.Bottom);\n\t\t}\n\n\t\tpublic static Rectangle<T> With<T>(\n\t\t\tthis Rectangle<T> self,\n\t\t\tAxis2D axis,\n\t\t\tT min = null,\n\t\t\tT max = null)\n\t\t\twhere T : class\n\t\t{\n\t\t\treturn self.WithAxis(axis, a => new Interval<T>(min ?? a.Min, max ?? a.Max));\n\t\t}\n\n\t\tpublic static Rectangle<T> With<T>(\n\t\t\tthis Rectangle<T> self,\n\t\t\tAxis2D axis,\n\t\t\tOptional<T> min = default(Optional<T>),\n\t\t\tOptional<T> max = default(Optional<T>))\n\t\t{\n\t\t\treturn self.WithAxis(axis, a => new Interval<T>(min.Or(a.Min), max.Or(a.Max)));\n\t\t}\n\t\t*/\n\t\tpublic static IObservable<Rectangle<T>> MoveTo<T>(this IObservable<Rectangle<T>> rect, IObservable<Point<T>> position) where T : INumeric<T>\n\t\t{\n\t\t\treturn rect.CombineLatest(position, MoveTo);\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> MoveTo<T>(this Rectangle<IObservable<T>> rect, Point<IObservable<T>> position) where T : INumeric<T>\n\t\t{\n\t\t\treturn FromIntervals(\n\t\t\t\tInterval.FromOffsetLength(rect.HorizontalInterval.Offset.Add(position.X), rect.Width),\n\t\t\t\tInterval.FromOffsetLength(rect.VerticalInterval.Offset.Add(position.Y), rect.Height));\n\t\t}\n\n\t\tpublic static Rectangle<T> MoveTo<T>(this Rectangle<T> rect, Point<T> position) where T : INumeric<T>\n\t\t{\n\t\t\treturn FromPositionSize(\n\t\t\t\tPoint.Create(\n\t\t\t\t\trect.Position.X.Add(position.X),\n\t\t\t\t\trect.Position.Y.Add(position.Y)),\n\t\t\t\trect.Size);\n\t\t}\n\n\t\tpublic static Rectangle<T> WithEdge<T>(this Rectangle<T> rect, RectangleEdge edge, T location)\n\t\t\twhere T : struct, INumeric<T>\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn rect.With(location, null, null, null);\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn rect.With(null, null, location, null);\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn rect.With(null, location, null, null);\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn rect.With(null, null, null, location);\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static Rectangle<IObservable<T>> WithEdge<T>(this Rectangle<IObservable<T>> rect, RectangleEdge edge, IObservable<T> location)\n\t\t\twhere T : struct, INumeric<T>\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn rect.With(location, null, null, null);\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn rect.With(null, null, location, null);\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn rect.With(null, location, null, null);\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn rect.With(null, null, null, location);\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static Rectangle<T> WithAxis<T>(this Rectangle<T> rect, Axis2D axis, Func<Interval<T>, Interval<T>> interval)\n\t\t{\n\t\t\treturn rect.WithAxis(axis, interval(rect[axis]));\n\t\t}\n\n\t\tpublic static Rectangle<T> WithAxis<T>(this Rectangle<T> rect, Axis2D axis, Interval<T> interval)\n\t\t{\n\t\t\treturn axis == Axis2D.Horizontal\n\t\t\t\t? new Rectangle<T>(interval, rect.VerticalInterval)\n\t\t\t\t: new Rectangle<T>(rect.HorizontalInterval, interval);\n\t\t}\n\n\t\tpublic static IObservable<Point<T>> Position<T>(this IObservable<Rectangle<T>> rectangle)\n\t\t{\n\t\t\treturn rectangle.Select(r => r.Position);\n\t\t}\n\t\tpublic static IObservable<Size<T>> Size<T>(this IObservable<Rectangle<T>> rectangle)\n\t\t{\n\t\t\treturn rectangle.Select(r => r.Size);\n\t\t}\n\n\t\tpublic static Point<IObservable<Points>> Center(this Rectangle<IObservable<Points>> self)\n\t\t{\n\t\t\treturn Point.Create(\n\t\t\t\tself.HorizontalInterval.Center(),\n\t\t\t\tself.VerticalInterval.Center());\n\t\t}\n\n\t\tpublic static Point<T> LeftTop<T>(this Rectangle<T> self)\n\t\t{\n\t\t\treturn Point.Create(self.Left(), self.Top());\n\t\t}\n\n\t\tpublic static Point<IObservable<T>> LeftTop<T>(this Rectangle<IObservable<T>> self)\n\t\t{\n\t\t\treturn Point.Create(self.Left(), self.Top());\n\t\t}\n\n\t\tpublic static Point<T> LeftBottom<T>(this Rectangle<T> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Point.Create(self.Left(), self.Bottom());\n\t\t}\n\n\t\tpublic static Point<IObservable<T>> LeftBottom<T>(this Rectangle<IObservable<T>> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Point.Create(self.Left(), self.Bottom());\n\t\t}\n\n\t\tpublic static Point<T> RightTop<T>(this Rectangle<T> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Point.Create(self.Right(), self.Top());\n\t\t}\n\n\t\tpublic static Point<IObservable<T>> RightTop<T>(this Rectangle<IObservable<T>> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Point.Create(self.Right(), self.Top());\n\t\t}\n\n\t\tpublic static Point<T> RightBottom<T>(this Rectangle<T> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Point.Create(self.Right(), self.Bottom());\n\t\t}\n\n\t\tpublic static Point<IObservable<T>> RightBottom<T>(this Rectangle<IObservable<T>> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Point.Create(self.Right(), self.Bottom());\n\t\t}\n\n\t\tpublic static T Left<T>(this Rectangle<T> self)\n\t\t{\n\t\t\treturn self.HorizontalInterval.Offset;\n\t\t}\n\n\t\tpublic static T Top<T>(this Rectangle<T> self)\n\t\t{\n\t\t\treturn self.VerticalInterval.Offset;\n\t\t}\n\n\t\tpublic static T Right<T>(this Rectangle<T> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.HorizontalInterval.Offset.Add(self.HorizontalInterval.Length);\n\t\t}\n\n\t\tpublic static IObservable<T> Right<T>(this Rectangle<IObservable<T>> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.HorizontalInterval.Offset.Add(self.HorizontalInterval.Length);\n\t\t}\n\n\t\tpublic static T Bottom<T>(this Rectangle<T> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.VerticalInterval.Offset.Add(self.VerticalInterval.Length);\n\t\t}\n\n\t\tpublic static IObservable<T> Bottom<T>(this Rectangle<IObservable<T>> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.VerticalInterval.Offset.Add(self.VerticalInterval.Length);\n\t\t}\n\n\n\t\tpublic static T GetEdge<T>(this Rectangle<T> self, RectangleEdge edge)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn self.Left();\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn self.Top();\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn self.Right();\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn self.Bottom();\n\t\t\t}\n\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t}\n\t\tpublic static IObservable<T> GetEdge<T>(this Rectangle<IObservable<T>> self, RectangleEdge edge)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\treturn self.Left();\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\treturn self.Top();\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\treturn self.Right();\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\treturn self.Bottom();\n\t\t\t}\n\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t}\n\t}\n\n\tpublic struct Rectangle<T> : IEquatable<Rectangle<T>>\n\t{\n\t\tpublic readonly Interval<T> HorizontalInterval;\n\t\tpublic readonly Interval<T> VerticalInterval;\n\n\t\tpublic Rectangle(Interval<T> horizontalInterval, Interval<T> verticalInterval)\n\t\t{\n\t\t\tHorizontalInterval = horizontalInterval;\n\t\t\tVerticalInterval = verticalInterval;\n\t\t}\n\n\t\tpublic Point<T> Position { get { return new Point<T>(HorizontalInterval.Offset, VerticalInterval.Offset); } }\n\t\tpublic Size<T> Size { get { return new Size<T>(Width, Height); } }\n\n\t\tpublic T Width { get { return HorizontalInterval.Length; } }\n\t\tpublic T Height { get { return VerticalInterval.Length; } }\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{Position = \" + Position + \", Size = \" + Size + \"}\";\n\t\t}\n\n\t\tpublic Interval<T> this[Axis2D axis]\n\t\t{\n\t\t\tget { return axis == Axis2D.Horizontal ? HorizontalInterval : VerticalInterval; }\n\t\t}\n\n\n\t\tpublic static bool operator ==(Rectangle<T> left, Rectangle<T> right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Rectangle<T> left, Rectangle<T> right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic bool Equals(Rectangle<T> other)\n\t\t{\n\t\t\treturn HorizontalInterval.Equals(other.HorizontalInterval) && VerticalInterval.Equals(other.VerticalInterval);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Rectangle<T> && Equals((Rectangle<T>)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (HorizontalInterval.GetHashCode() * 397) ^ VerticalInterval.GetHashCode();\n\t\t\t}\n\t\t}\n\t}\n\n\n}"
  },
  {
    "path": "src/common/math/Size.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic static partial class Size\n\t{\n\t\t// Constructors\n\t\tpublic static Size<T> Create<T>(T both)\n\t\t{\n\t\t\treturn new Size<T>(both, both);\n\t\t}\n\n\t\tpublic static Size<T> Create<T>(T width, T height)\n\t\t{\n\t\t\treturn new Size<T>(width, height);\n\t\t}\n\n\t\tpublic static Size<T> Create<T>(T u, T v, Axis2D firstAxis)\n\t\t{\n\t\t\treturn firstAxis == Axis2D.Horizontal ? Create(u, v) : Create(v, u);\n\t\t}\n\n\t\tpublic static Size<T> Read<T>(BinaryReader reader) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn new Size<T>(\n\t\t\t\tnew T().FromDouble(reader.ReadDouble()),\n\t\t\t\tnew T().FromDouble(reader.ReadDouble()));\n\t\t}\n\n\t\tpublic static void Write<T>(BinaryWriter writer, Size<T> size) where T : INumeric<T>\n\t\t{\n\t\t\twriter.Write(size.Width.ToDouble());\n\t\t\twriter.Write(size.Height.ToDouble());\n\t\t}\n\n\t\t// Transformers\n\n\t\tpublic static Size<T> WithAxis<T>(this Size<T> size, Axis2D axis, Func<T, T> value)\n\t\t{\n\t\t\treturn axis == Axis2D.Horizontal\n\t\t\t\t? new Size<T>(value(size.Width), size.Height)\n\t\t\t\t: new Size<T>(size.Width, value(size.Height));\n\t\t}\n\n\t\t// CanContain\n\n\t\tpublic static bool CanContain<T>(this Size<T> container, Size<T> content) where T : INumeric<T>\n\t\t{\n\t\t\treturn container.Width.GreaterThanOrEquals(content.Width) && container.Height.GreaterThanOrEquals(content.Height);\n\t\t}\n\n\t\tpublic static bool HasZeroArea<T>(this Size<T> size) where T : INumeric<T>\n\t\t{\n\t\t\treturn size.Width.Equals(size.Width.Zero)\n\t\t\t\t|| size.Height.Equals(size.Width.Zero);\n\t\t}\n\n\t\tpublic static Size<T> Zero<T>() where T : INumeric<T>, new ()\n\t\t{\n\t\t\treturn Create(new T().Zero);\n\t\t}\n\t}\n\n\tpublic partial struct Size<T> : IEquatable<Size<T>>\n\t{\n\t\tstatic Size()\n\t\t{\n\t\t\tAlgebras.Initialize();\n\t\t}\n\n\t\tpublic readonly T Width;\n\t\tpublic readonly T Height;\n\n\t\tpublic static implicit operator Vector<T>(Size<T> size)\n\t\t{\n\t\t\treturn size.ToVector();\n\t\t}\n\n\t\tpublic Vector<T> ToVector()\n\t\t{\n\t\t\treturn new Vector<T>(Width, Height);\n\t\t}\n\n\t\tpublic static implicit operator Size<T>(Vector<T> vector)\n\t\t{\n\t\t\treturn new Size<T>(vector);\n\t\t}\n\n\t\tpublic Size(Vector<T> vector)\n\t\t\t: this(vector.X, vector.Y)\n\t\t{ }\n\n\t\tpublic Size(T width, T height)\n\t\t{\n\t\t\tWidth = width;\n\t\t\tHeight = height;\n\t\t}\n\n\t\tpublic Size<T> SwapWidthAndHeight()\n\t\t{\n\t\t\treturn new Size<T>(Height, Width);\n\t\t}\n\n\t\tpublic T this[Axis2D axis]\n\t\t{\n\t\t\tget { return axis == Axis2D.Horizontal ? Width : Height; }\n\t\t}\n\n\t\tpublic static bool operator ==(Size<T> left, Size<T> right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Size<T> left, Size<T> right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Size<T> && Equals((Size<T>)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (EqualityComparer<T>.Default.GetHashCode(Width) * 397) ^ EqualityComparer<T>.Default.GetHashCode(Height);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Equals(Size<T> other)\n\t\t{\n\t\t\treturn\n\t\t\t\tWidth.Equals(other.Width) &&\n\t\t\t\t\tHeight.Equals(other.Height);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Width + \" x \" + Height;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Thickness.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static class Thickness\n\t{\n\t\tpublic static Thickness<Points> Zero = new Thickness<Points>(0);\n\n\t\tpublic static Thickness<IObservable<T>> Transpose<T>(this IObservable<Thickness<T>> self)\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tself.Select(s => s.Left),\n\t\t\t\tself.Select(s => s.Top),\n\t\t\t\tself.Select(s => s.Right),\n\t\t\t\tself.Select(s => s.Bottom));\n\t\t}\n\n\t\tpublic static Thickness<IObservable<T>> Inverse<T>(this Thickness<IObservable<T>> self)\n\t\t\twhere T: INumeric<T>\n\t\t{\n\t\t\treturn self.Select(Inverse);\n\t\t}\n\n\t\tpublic static IObservable<Thickness<T>> Inverse<T>(this IObservable<Thickness<T>> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(t => t.Inverse());\n\t\t}\n\n\t\tpublic static IObservable<T> Inverse<T>(this IObservable<T> self)\n\t\t\twhere T: INumeric<T>\n\t\t{\n\t\t\treturn self.Select(t => t.Inverse());\n\t\t}\n\n\t\tpublic static Thickness<T> Inverse<T>(this Thickness<T> self)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn self.Select(t => t.Inverse());\n\t\t}\n\n\t\tpublic static IObservable<Thickness<T>> Transpose<T>(this Thickness<IObservable<T>> self)\n\t\t{\n\t\t\treturn Observable.CombineLatest(\n\t\t\t\tself.Left,\n\t\t\t\tself.Top,\n\t\t\t\tself.Right,\n\t\t\t\tself.Bottom,\n\t\t\t\tCreate);\n\t\t}\n\t\tpublic static Thickness<T> Create<T>(Func<RectangleEdge, T> edgeFactory)\n\t\t{\n\t\t\treturn new Thickness<T>(\n\t\t\t\tedgeFactory(RectangleEdge.Left),\n\t\t\t\tedgeFactory(RectangleEdge.Top),\n\t\t\t\tedgeFactory(RectangleEdge.Right),\n\t\t\t\tedgeFactory(RectangleEdge.Bottom));\n\t\t}\n\n\t\tpublic static Thickness<T> Create<T>(T left, T top, T right, T bottom)\n\t\t{\n\t\t\treturn new Thickness<T>(left, top, right, bottom);\n\t\t}\n\t\tpublic static Thickness<TOut> Select<TIn, TOut>(this Thickness<TIn> self, Func<TIn, RectangleEdge, TOut> transform)\n\t\t{\n\t\t\treturn new Thickness<TOut>(\n\t\t\t\tleft: transform(self.Left, RectangleEdge.Left),\n\t\t\t\ttop: transform(self.Top, RectangleEdge.Top),\n\t\t\t\tright: transform(self.Right, RectangleEdge.Right),\n\t\t\t\tbottom: transform(self.Bottom, RectangleEdge.Bottom));\n\t\t}\n\t\tpublic static Thickness<TOut> Select<TIn, TOut>(this Thickness<TIn> self, Func<TIn, TOut> transform)\n\t\t{\n\t\t\treturn new Thickness<TOut>(\n\t\t\t\tleft: transform(self.Left),\n\t\t\t\ttop: transform(self.Top),\n\t\t\t\tright: transform(self.Right),\n\t\t\t\tbottom: transform(self.Bottom));\n\t\t}\n\n\t\tpublic static Thickness<Points> CollapseEdgesExcept(this Thickness<Points> self, RectangleEdges edges)\n\t\t{\n\t\t\treturn self.CollapseEdges(~edges);\n\t\t}\n\n\t\tpublic static Thickness<Points> CollapseEdges(this Thickness<Points> self, RectangleEdges edges)\n\t\t{\n\t\t\treturn self.With(\n\t\t\t\tleft: edges.HasFlag(RectangleEdges.Left) ? Optional.Some<Points>(0) : Optional.None(),\n\t\t\t\ttop: edges.HasFlag(RectangleEdges.Top) ? Optional.Some<Points>(0) : Optional.None(),\n\t\t\t\tright: edges.HasFlag(RectangleEdges.Right) ? Optional.Some<Points>(0) : Optional.None(),\n\t\t\t\tbottom: edges.HasFlag(RectangleEdges.Bottom) ? Optional.Some<Points>(0) : Optional.None());\n\t\t}\n\t}\n\tpublic sealed class Thickness<T> : IEquatable<Thickness<T>>\n\t{\n\t\tpublic readonly T Left;\n\t\tpublic readonly T Top;\n\t\tpublic readonly T Right;\n\t\tpublic readonly T Bottom;\n\n\t\tpublic Thickness(T horizontal, T vertical)\n\t\t\t: this (horizontal, vertical, horizontal, vertical)\n\t\t{ }\n\n\t\tpublic Thickness(T all)\n\t\t\t: this (all, all, all, all)\n\t\t{ }\n\n\t\tpublic Thickness(T left, T top, T right, T bottom)\n\t\t{\n\t\t\tLeft = left;\n\t\t\tTop = top;\n\t\t\tRight = right;\n\t\t\tBottom = bottom;\n\t\t}\n\n\t\tpublic T this[RectangleEdge edge]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tswitch (edge)\n\t\t\t\t{\n\t\t\t\t\tcase RectangleEdge.Left:\n\t\t\t\t\t\treturn Left;\n\t\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\t\treturn Top;\n\t\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\t\treturn Right;\n\t\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\t\treturn Bottom;\n\t\t\t\t}\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\n\t\tpublic Thickness<T> With(\n\t\t\tOptional<T> left = default(Optional<T>),\n\t\t\tOptional<T> top = default(Optional<T>),\n\t\t\tOptional<T> right = default(Optional<T>),\n\t\t\tOptional<T> bottom = default(Optional<T>))\n\t\t{\n\t\t\treturn new Thickness<T>(\n\t\t\t\tleft.Or(Left),\n\t\t\t\ttop.Or(Top),\n\t\t\t\tright.Or(Right),\n\t\t\t\tbottom.Or(Bottom));\n\t\t}\n\n\t\tpublic bool Equals(Thickness<T> other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn EqualityComparer<T>.Default.Equals(Left, other.Left) && EqualityComparer<T>.Default.Equals(Top, other.Top) && EqualityComparer<T>.Default.Equals(Right, other.Right) && EqualityComparer<T>.Default.Equals(Bottom, other.Bottom);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is Thickness<T> && Equals((Thickness<T>)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tvar hashCode = EqualityComparer<T>.Default.GetHashCode(Left);\n\t\t\t\thashCode = (hashCode * 397) ^ EqualityComparer<T>.Default.GetHashCode(Top);\n\t\t\t\thashCode = (hashCode * 397) ^ EqualityComparer<T>.Default.GetHashCode(Right);\n\t\t\t\thashCode = (hashCode * 397) ^ EqualityComparer<T>.Default.GetHashCode(Bottom);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(Thickness<T> left, Thickness<T> right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(Thickness<T> left, Thickness<T> right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{\" + Left + \", \" + Top + \", \" + Right + \", \" + Bottom + \"}\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Units/ClipSpaceUnits.cs",
    "content": "namespace Outracks\n{\n\tpublic struct ClipSpaceUnits : INumeric<ClipSpaceUnits>\n\t{\n\t\tpublic readonly double Value;\n\n\t\tpublic ClipSpaceUnits(double value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic static implicit operator ClipSpaceUnits(double value)\n\t\t{\n\t\t\treturn new ClipSpaceUnits(value);\n\t\t}\n\n\t\tpublic static explicit operator int(ClipSpaceUnits pixels)\n\t\t{\n\t\t\treturn (int)pixels.Value;\n\t\t}\n\t\tpublic static implicit operator float(ClipSpaceUnits pixels)\n\t\t{\n\t\t\treturn (float)pixels.Value;\n\t\t}\n\t\tpublic static bool operator ==(ClipSpaceUnits left, ClipSpaceUnits right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(ClipSpaceUnits left, ClipSpaceUnits right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is ClipSpaceUnits && Equals((ClipSpaceUnits)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Value.GetHashCode();\n\t\t}\n\n\t\tpublic bool Equals(ClipSpaceUnits other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value);\n\t\t}\n\t\tpublic int CompareTo(ClipSpaceUnits other)\n\t\t{\n\t\t\treturn Value.CompareTo(other);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value + \"c\";\n\t\t}\n\n\t\tpublic ClipSpaceUnits Add(ClipSpaceUnits other)\n\t\t{\n\t\t\treturn new ClipSpaceUnits(Value + other.Value);\n\t\t}\n\n\t\tpublic ClipSpaceUnits Inverse()\n\t\t{\n\t\t\treturn new ClipSpaceUnits(-Value);\n\t\t}\n\n\t\tpublic ClipSpaceUnits Zero\n\t\t{\n\t\t\tget { return new ClipSpaceUnits(0); }\n\t\t}\n\n\t\tpublic ClipSpaceUnits Mul(ClipSpaceUnits other)\n\t\t{\n\t\t\treturn new ClipSpaceUnits(Value * other.Value);\n\t\t}\n\n\t\tpublic ClipSpaceUnits One\n\t\t{\n\t\t\tget { return new ClipSpaceUnits(1);}\n\t\t}\n\n\t\tpublic ClipSpaceUnits Reciprocal()\n\t\t{\n\t\t\treturn new ClipSpaceUnits(1.0/Value);\n\t\t}\n\n\t\tpublic ClipSpaceUnits FromDouble(double value)\n\t\t{\n\t\t\treturn new ClipSpaceUnits(value);\n\t\t}\n\n\t\tpublic double ToDouble()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Units/GlWindowPixels.cs",
    "content": "namespace Outracks\n{\n\tpublic struct GlWindowPixels : INumeric<GlWindowPixels>\n\t{\n\t\tpublic readonly int Value;\n\n\t\tpublic GlWindowPixels(int value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic static implicit operator GlWindowPixels(int value)\n\t\t{\n\t\t\treturn new GlWindowPixels(value);\n\t\t}\n\n\t\tpublic static implicit operator int(GlWindowPixels pixels)\n\t\t{\n\t\t\treturn (int)pixels.Value;\n\t\t}\n\t\tpublic static bool operator ==(GlWindowPixels left, GlWindowPixels right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(GlWindowPixels left, GlWindowPixels right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is GlWindowPixels && Equals((GlWindowPixels)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Value.GetHashCode();\n\t\t}\n\n\t\tpublic bool Equals(GlWindowPixels other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value);\n\t\t}\n\t\tpublic int CompareTo(GlWindowPixels other)\n\t\t{\n\t\t\treturn Value.CompareTo(other);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value + \"c\";\n\t\t}\n\n\t\tpublic GlWindowPixels Add(GlWindowPixels other)\n\t\t{\n\t\t\treturn new GlWindowPixels(Value + other.Value);\n\t\t}\n\n\t\tpublic GlWindowPixels Inverse()\n\t\t{\n\t\t\treturn new GlWindowPixels(-Value);\n\t\t}\n\n\t\tpublic GlWindowPixels Zero\n\t\t{\n\t\t\tget { return new GlWindowPixels(0); }\n\t\t}\n\n\t\tpublic GlWindowPixels Mul(GlWindowPixels other)\n\t\t{\n\t\t\treturn new GlWindowPixels(Value * other.Value);\n\t\t}\n\n\t\tpublic GlWindowPixels One\n\t\t{\n\t\t\tget { return new GlWindowPixels(1); }\n\t\t}\n\n\t\tpublic GlWindowPixels Reciprocal()\n\t\t{\n\t\t\treturn new GlWindowPixels(1 / Value);\n\t\t}\n\n\t\tpublic GlWindowPixels FromDouble(double value)\n\t\t{\n\t\t\treturn new GlWindowPixels((int)value);\n\t\t}\n\n\t\tpublic double ToDouble()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Units/Inches.cs",
    "content": "namespace Outracks\n{\n\tpublic struct Inches : INumeric<Inches>\n\t{\n\t\tpublic readonly double Value;\n\n\t\tpublic Inches(double inches)\n\t\t{\n\t\t\tValue = inches;\n\t\t}\n\n\t\tpublic static implicit operator Inches(double value)\n\t\t{\n\t\t\treturn new Inches(value);\n\t\t}\n\n\t\tpublic bool Equals(Inches other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value);\n\t\t}\n\n\t\tpublic int CompareTo(Inches other)\n\t\t{\n\t\t\treturn Value.CompareTo(other);\n\t\t}\n\n\t\tpublic Inches Add(Inches other)\n\t\t{\n\t\t\treturn new Inches(Value + other.Value);\n\t\t}\n\n\t\tpublic Inches Inverse()\n\t\t{\n\t\t\treturn new Inches(-Value);\n\t\t}\n\n\t\tpublic Inches Zero { get { return new Inches(0); }  }\n\t\tpublic Inches Mul(Inches other)\n\t\t{\n\t\t\treturn new Inches(Value * other.Value);\n\t\t}\n\n\t\tpublic Inches One { get { return new Inches(1); } }\n\t\tpublic Inches Reciprocal()\n\t\t{\n\t\t\treturn new Inches(1.0/Value);\n\t\t}\n\n\t\tpublic Inches FromDouble(double value)\n\t\t{\n\t\t\treturn new Inches(value);\n\t\t}\n\n\t\tpublic double ToDouble()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Units/Percentages.cs",
    "content": "namespace Outracks\n{\n\tpublic struct Percentages : INumeric<Percentages>\n\t{\n\t\tpublic readonly double Value;\n\n\t\tpublic Percentages(double value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic static implicit operator Percentages(double value)\n\t\t{\n\t\t\treturn new Percentages(value);\n\t\t}\n\n\t\tpublic static explicit operator int(Percentages pixels)\n\t\t{\n\t\t\treturn (int)pixels.Value;\n\t\t}\n\n\t\tpublic static bool operator ==(Percentages left, Percentages right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Percentages left, Percentages right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Percentages && Equals((Percentages)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Value.GetHashCode();\n\t\t}\n\n\t\tpublic bool Equals(Percentages other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value);\n\t\t}\n\t\tpublic int CompareTo(Percentages other)\n\t\t{\n\t\t\treturn Value.CompareTo(other.Value);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value + \"%\";\n\t\t}\n\n\t\tpublic Percentages Add(Percentages other)\n\t\t{\n\t\t\treturn new Percentages(Value + other.Value);\n\t\t}\n\n\t\tpublic Percentages Inverse()\n\t\t{\n\t\t\treturn new Percentages(-Value);\n\t\t}\n\t\tpublic Percentages Zero\n\t\t{\n\t\t\tget { return new Percentages(0); }\n\t\t}\n\n\t\tpublic Percentages Mul(Percentages other)\n\t\t{\n\t\t\treturn new Percentages(Value * other.Value);\n\t\t}\n\n\t\tpublic Percentages One\n\t\t{\n\t\t\tget { return new Percentages(1); }\n\t\t}\n\n\t\tpublic Percentages Reciprocal()\n\t\t{\n\t\t\treturn new Percentages(1.0 / Value);\n\t\t}\n\n\t\tpublic Percentages FromDouble(double value)\n\t\t{\n\t\t\treturn new Percentages(value);\n\t\t}\n\n\t\tpublic double ToDouble()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Units/Pixels.cs",
    "content": "namespace Outracks\n{\n\tpublic struct Pixels : INumeric<Pixels>\n\t{\n\t\tpublic readonly double Value;\n\n\t\tpublic Pixels(double value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic static implicit operator Pixels(double value)\n\t\t{\n\t\t\treturn new Pixels(value);\n\t\t}\n\n\t\tpublic static explicit operator int(Pixels pixels)\n\t\t{\n\t\t\treturn (int)pixels.Value;\n\t\t}\n\n\t\tpublic static bool operator ==(Pixels left, Pixels right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Pixels left, Pixels right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Pixels && Equals((Pixels)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Value.GetHashCode();\n\t\t}\n\n\t\tpublic bool Equals(Pixels other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value);\n\t\t}\n\t\tpublic int CompareTo(Pixels other)\n\t\t{\n\t\t\treturn Value.CompareTo(other.Value);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value + \"px\";\n\t\t}\n\n\t\tpublic Pixels Add(Pixels other)\n\t\t{\n\t\t\treturn new Pixels(Value + other.Value);\n\t\t}\n\n\t\tpublic Pixels Inverse()\n\t\t{\n\t\t\treturn new Pixels(-Value);\n\t\t}\n\t\tpublic Pixels Zero\n\t\t{\n\t\t\tget { return new Pixels(0); }\n\t\t}\n\n\t\tpublic Pixels Mul(Pixels other)\n\t\t{\n\t\t\treturn new Pixels(Value * other.Value);\n\t\t}\n\n\t\tpublic Pixels One\n\t\t{\n\t\t\tget { return new Pixels(1); }\n\t\t}\n\n\t\tpublic Pixels Reciprocal()\n\t\t{\n\t\t\treturn new Pixels(1.0 / Value);\n\t\t}\n\n\t\tpublic Pixels FromDouble(double value)\n\t\t{\n\t\t\treturn new Pixels(value);\n\t\t}\n\n\t\tpublic double ToDouble()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Units/Points.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic struct Points : IEquatable<Points>, IComparable<Points>, INumeric<Points>\n\t{\n\t\tpublic readonly double Value;\n\n\t\tpublic Points(double value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\t// TODO: should this really be implicit?\n\t\tpublic static implicit operator Points(double value)\n\t\t{\n\t\t\treturn new Points(value);\n\t\t}\n\n\t\tpublic static explicit operator float(Points points)\n\t\t{\n\t\t\treturn (float)points.Value;\n\t\t}\n\n\t\tpublic static implicit operator double(Points points)\n\t\t{\n\t\t\treturn points.Value;\n\t\t}\n\n\t\tpublic static bool operator ==(Points left, Points right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Points left, Points right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic static Points operator +(Points left, Points right)\n\t\t{\n\t\t\treturn left.Add(right);\n\t\t}\n\t\tpublic static Points operator -(Points left, Points right)\n\t\t{\n\t\t\treturn left.Sub(right);\n\t\t}\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Points && Equals((Points)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn 0; // Don't bother\n\t\t}\n\n\t\tpublic bool Equals(Points other)\n\t\t{\n\t\t\treturn Math.Abs(Value - other.Value) < 0.1; // that's basically the same point if anyone cares\n\t\t}\n\n\t\tpublic int CompareTo(Points other)\n\t\t{\n\t\t\treturn Value.CompareTo(other.Value);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value + \"pt\";\n\t\t}\n\n\t\tpublic Points Add(Points other)\n\t\t{\n\t\t\treturn new Points(Value + other.Value);\n\t\t}\n\n\t\tpublic Points Inverse()\n\t\t{\n\t\t\treturn new Points(-Value);\n\t\t}\n\n\t\tpublic Points Zero\n\t\t{\n\t\t\tget { return new Points(0); }\n\t\t}\n\n\t\tpublic Points Mul(Points other)\n\t\t{\n\t\t\treturn new Points(Value * other.Value);\n\t\t}\n\n\t\tpublic Points One\n\t\t{\n\t\t\tget { return new Points(1); }\n\t\t}\n\n\t\tpublic Points Reciprocal()\n\t\t{\n\t\t\treturn new Points(1.0 / Value);\n\t\t}\n\n\t\tpublic Points FromDouble(double value)\n\t\t{\n\t\t\treturn new Points(value);\n\t\t}\n\n\t\tpublic double ToDouble()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Units/TextureSpaceUnits.cs",
    "content": "namespace Outracks\n{\n\tpublic struct TextureSpaceUnits : INumeric<TextureSpaceUnits>\n\t{\n\t\tpublic readonly double Value;\n\n\t\tpublic TextureSpaceUnits(double value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic static implicit operator TextureSpaceUnits(double value)\n\t\t{\n\t\t\treturn new TextureSpaceUnits(value);\n\t\t}\n\n\t\tpublic static implicit operator float(TextureSpaceUnits pixels)\n\t\t{\n\t\t\treturn (float)pixels.Value;\n\t\t}\n\t\tpublic static bool operator ==(TextureSpaceUnits left, TextureSpaceUnits right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(TextureSpaceUnits left, TextureSpaceUnits right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is TextureSpaceUnits && Equals((TextureSpaceUnits)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Value.GetHashCode();\n\t\t}\n\n\t\tpublic bool Equals(TextureSpaceUnits other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value);\n\t\t}\n\t\tpublic int CompareTo(TextureSpaceUnits other)\n\t\t{\n\t\t\treturn Value.CompareTo(other);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value + \"t\";\n\t\t}\n\n\t\tpublic TextureSpaceUnits Add(TextureSpaceUnits other)\n\t\t{\n\t\t\treturn new TextureSpaceUnits(Value + other.Value);\n\t\t}\n\n\t\tpublic TextureSpaceUnits Inverse()\n\t\t{\n\t\t\treturn new TextureSpaceUnits(-Value);\n\t\t}\n\n\t\tpublic TextureSpaceUnits Zero\n\t\t{\n\t\t\tget { return new TextureSpaceUnits(0); }\n\t\t}\n\n\t\tpublic TextureSpaceUnits Mul(TextureSpaceUnits other)\n\t\t{\n\t\t\treturn new TextureSpaceUnits(Value * other.Value);\n\t\t}\n\n\t\tpublic TextureSpaceUnits One\n\t\t{\n\t\t\tget { return new TextureSpaceUnits(1); }\n\t\t}\n\n\t\tpublic TextureSpaceUnits Reciprocal()\n\t\t{\n\t\t\treturn new TextureSpaceUnits(1.0 / Value);\n\t\t}\n\n\t\tpublic TextureSpaceUnits FromDouble(double value)\n\t\t{\n\t\t\treturn new TextureSpaceUnits(value);\n\t\t}\n\n\t\tpublic double ToDouble()\n\t\t{\n\t\t\treturn Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/Vector.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Outracks\n{\n\tpublic static partial class Vector\n\t{\n\t\t// Constructors\n\n\t\tpublic static Vector<T> Create<T>(T x, T y)\n\t\t{\n\t\t\treturn new Vector<T>(x, y);\n\t\t}\n\n\t\tpublic static Vector<T> Scale<T>(this Vector<T> vec, T scalar) where T : INumeric<T>\n\t\t{\n\t\t\treturn Create(vec.X.Mul(scalar), vec.Y.Mul(scalar));\n\t\t}\n\n\t\tpublic static Vector<double> RotateCCV(this Vector<double> vector)\n\t\t{\n\t\t\treturn Create(vector.Y, -vector.X);\n\t\t}\n\n\t\tpublic static Vector<T> RotateCCV<T>(this Vector<T> vector)\n\t\t\twhere T: INumeric<T>\n\t\t{\n\t\t\treturn Create(vector.Y, vector.X.Inverse());\n\t\t}\n\n\t\tpublic static Vector<IObservable<T>> RotateCCV<T>(this Vector<IObservable<T>> vector)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Create(x: vector.Y, y: vector.X.Inverse());\n\t\t}\n\n\t\tpublic static Vector<double> RotateCV(this Vector<double> vector)\n\t\t{\n\t\t\treturn Create(-vector.Y, vector.X);\n\t\t}\n\n\t\tpublic static Vector<T> RotateCV<T>(this Vector<T> vector)\n\t\t\twhere T: INumeric<T>\n\t\t{\n\t\t\treturn Create(vector.Y.Inverse(), vector.X);\n\t\t}\n\n\t\tpublic static Vector<IObservable<T>> RotateCV<T>(this Vector<IObservable<T>> vector)\n\t\t\twhere T : INumeric<T>\n\t\t{\n\t\t\treturn Create(x: vector.Y.Inverse(), y: vector.X);\n\t\t}\n\n\t\tpublic static T Length<T>(this Vector<T> vector) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn new T().FromDouble(Math.Sqrt(vector.LengthSquared().ToDouble()));\n\t\t}\n\n\t\tpublic static T LengthSquared<T>(this Vector<T> vector) where T : INumeric<T>\n\t\t{\n\t\t\treturn vector.X.RaisedToTwo().Add(vector.Y.RaisedToTwo());\n\t\t}\n\n\t\tpublic static T RaisedToTwo<T>(this T value) where T : IRing<T>\n\t\t{\n\t\t\treturn value.Mul(value);\n\t\t}\n\t}\n\n\tpublic partial struct Vector<T> : IEquatable<Vector<T>>\n\t{\n\t\tpublic readonly T X;\n\t\tpublic readonly T Y;\n\n\t\tpublic Vector(T x, T y)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{\"+X+\", \"+Y+\"}\";\n\t\t}\n\n\t\tpublic static bool operator ==(Vector<T> left, Vector<T> right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Vector<T> left, Vector<T> right)\n\t\t{\n\t\t\treturn !(left == right);\n\t\t}\n\n\t\tpublic bool Equals(Vector<T> other)\n\t\t{\n\t\t\treturn EqualityComparer<T>.Default.Equals(X, other.X) && EqualityComparer<T>.Default.Equals(Y, other.Y);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Vector<T> && Equals((Vector<T>) obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (EqualityComparer<T>.Default.GetHashCode(X) * 397) ^ EqualityComparer<T>.Default.GetHashCode(Y);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/math/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/common/testproc/Outracks.TestProcess.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{83411CE7-B65F-4EEE-9E9C-0A94A5007FC8}</ProjectGuid>\n    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.TestProcess</RootNamespace>\n    <AssemblyName>Outracks.TestProcess</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\core\\Outracks.Core.csproj\">\n      <Project>{196b010d-ad36-4947-95aa-14fc4a27bd18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/common/testproc/Program.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading.Tasks;\nusing Outracks.Diagnostics;\nusing Outracks.IPC;\n\nnamespace Outracks.TestProcess\n{\n\tinternal class Program\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tLog(string.Join(\",\", args.Select(s => \"'\" + s + \"'\")));\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFindAndRunMethod(args);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tif (e is TargetInvocationException)\n\t\t\t\t{\n\t\t\t\t\tLog(e.InnerException.ToString());\n\t\t\t\t\tthrow e.InnerException;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tLog(e.ToString());\n\t\t\t\t\tthrow;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog(\"Exiting\\n\");\n\t\t}\n\n\t\tprivate static void Log(string s)\n\t\t{\n\t\t\tFile.AppendAllText(Path.Combine(TmpDir, \"testprocess.log\"), DateTime.Now + \" : \" + s + \"\\n\");\n\t\t}\n\n\t\tstatic string TmpDir\n\t\t{\n\t\t\tget { return Platform.IsMac ? \"/tmp\" : Path.GetTempPath(); } //TODO maybe GetTempPath works cross platform\n\t\t}\n\n\t\tprivate static void FindAndRunMethod(string[] args)\n\t\t{\n\t\t\tif (args.Length < 1)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"args.Length must be at least 1, you gave \" + args.Length);\n\t\t\t}\n\n\t\t\tvar methodName = args[0];\n\n\t\t\tvar method = typeof(Program)\n\t\t\t\t.GetMethods(BindingFlags.NonPublic | BindingFlags.Static)\n\t\t\t\t.FirstOrDefault(m => m.Name == methodName);\n\t\t\tif (method == null)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Method '\" + methodName + \"' not found\");\n\t\t\t}\n\n\t\t\tmethod.Invoke(null, new object[] {args.Skip(1).ToArray()});\n\t\t}\n\n\t\tprivate static void CrashingClientMakesHostReadZeroBytes(string[] args)\n\t\t{\n\t\t\tvar pipeName = GetPipeNameOrThrow(args);\n\t\t\tvar client = Pipe.Connect(pipeName).Result;\n\t\t\tLog(\"Connected\");\n\t\t\tvar message = new byte[] {0x01};\n\t\t\tclient.Write(message, 0, 1);\n\t\t\tHangForever();\n\t\t}\n\n\t\tprivate static void CrashingHostMakesClientWritingThrow(string[] args)\n\t\t{\n\t\t\tvar pipeName = GetPipeNameOrThrow(args);\n\t\t\tvar host = Pipe.Host(pipeName).Result;\n\t\t\tLog(\"Connected\");\n\t\t\tvar buffer = new byte[1];\n\t\t\thost.Read(buffer, 0, 1);\n\t\t\tHangForever();\n\t\t}\n\n\t\tprivate static void CompletesWhenClientCrashes(string[] args)\n\t\t{\n\t\t\tvar pipeName = GetPipeNameOrThrow(args);\n\t\t\tvar client = Pipe.Connect(pipeName).Result;\n\t\t\tLog(\"Connected\");\n\t\t\tvar messageWithASingleInt42 = Convert.FromBase64String(\"A0ludAQAAAAqAAAA\"); //Compute this in the corresponding test method if the format changes\n\t\t\tclient.Write(messageWithASingleInt42, 0, messageWithASingleInt42.Length);\n\t\t\tHangForever();\n\t\t}\n\n\t\tprivate static void NotifiesCallbackWhenHostCrashes(string[] args)\n\t\t{\n\t\t\tvar pipeName = GetPipeNameOrThrow(args);\n\t\t\tvar client = Pipe.Host(pipeName).Result;\n\t\t\tLog(\"Connected\");\n\t\t\tvar messageWithASingleInt42 = Convert.FromBase64String(\"A0ludAQAAAAqAAAA\"); //Compute this in the corresponding test method if the format changes\n\t\t\tvar buffer = new byte[messageWithASingleInt42.Length];\n\t\t\tclient.Read(buffer, 0, buffer.Length);\n\t\t\tHangForever();\n\t\t}\n\n\t\tprivate static PipeName GetPipeNameOrThrow(string[] args)\n\t\t{\n\t\t\tif (args.Length != 1)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Expected 1 argument, got \" + args.Length);\n\t\t\t}\n\t\t\tvar pipeName = args[0];\n\t\t\tLog(\"Using pipe '\" + pipeName + \"'\");\n\t\t\treturn new PipeName(pipeName);\n\t\t}\n\n\t\tprivate static void HangForever()\n\t\t{\n\t\t\tnew TaskCompletionSource<bool>().Task.Wait();\n\t\t}\n\n\n\t\tprivate static void ReportsToCloudWhenProcessIsExiting(string[] args)\n\t\t{\n\t\t\tvar client = ReportFactory.GetReporter(new Guid(), new Guid(), \"name\");\n\t\t\tvar message = \"Test: ReportsToCloudWhenProcessIsExiting at '\" + DateTime.Now + \"'\";\n\t\t\tclient.Exception(message, new Exception(message), ReportTo.Headquarters);\n\t\t\t//And then we just exit without waiting\n\t\t}\n\n\t\tprivate static void ReportsToCloudFromUnhandledExceptionHandler(string[] args)\n\t\t{\n\t\t\tvar client = ReportFactory.GetReporter(new Guid(), new Guid(), \"name\");\n\t\t\tAppDomain.CurrentDomain.ReportUnhandledExceptions(client);\n\t\t\tvar message = \"Test: ReportsToCloudFromUnhandledExceptionHandler at '\" + DateTime.Now + \"'\";\n\t\t\tthrow new Exception(message);\n\t\t\t//And then we just exit without waiting\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/testproc/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Outracks.Fuse.TestProcess\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Outracks.Fuse.TestProcess\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"83411CE7-B65F-4EEE-9E9C-0A94A5007FC8\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "src/common/tests/DateFormatTests.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\t[TestFixture]\n\tpublic class DateFormatTests\n\t{\n\t\t[Test]\n\t\tpublic void SameDateReturnsTodayString()\n\t\t{\n\t\t\tvar time = DateTime.Parse(\"2017-06-30T14:00:00\");\n\t\t\tvar pastTime = DateTime.Parse(\"2017-06-30T13:37:00\");\n\n\t\t\tAssert.AreEqual(\"Today at \" + pastTime.ToShortTimeString(), DateFormat.PeriodBetween(time, pastTime));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OneDayBeforeReturnsYesterdayString()\n\t\t{\n\t\t\tvar time = DateTime.Parse(\"2017-06-30\");\n\t\t\tvar oneDayEarlier = DateTime.Parse(\"2017-06-29T13:37:00\");\n\t\t\tAssert.AreEqual(\n\t\t\t\t\"Yesterday at \" + oneDayEarlier.ToShortTimeString(),\n\t\t\t\tDateFormat.PeriodBetween(time, oneDayEarlier));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TheDayBeforeYesterdayIsNotYesterday()\n\t\t{\n\t\t\tvar time = DateTime.Parse(\"2017-06-30T15:00:00\");\n\t\t\tvar notYesterday = DateTime.Parse(\"2017-06-28T17:00:00\");\n\t\t\tAssert.AreEqual(\n\t\t\t\t\"2 days ago\",\n\t\t\t\tDateFormat.PeriodBetween(time, notYesterday));\n\t\t}\n\n\t\t[TestCase(\"2017-06-30\", \"2017-06-27\", \"3 days ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2017-06-24\", \"6 days ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2017-06-23\", \"1 week ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2017-06-16\", \"2 weeks ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2017-06-09\", \"3 weeks ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2017-06-02\", \"About a month ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2017-04-30\", \"About 2 months ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2016-06-30\", \"About a year ago\")]\n\t\t[TestCase(\"2017-06-30\", \"2012-06-30\", \"About 5 years ago\")]\n\t\t[Test]\n\t\tpublic void TimeSinceTodaySinceStringTest(string timeStr, string pastTimeStr, string expected)\n\t\t{\n\t\t\tvar time = DateTime.Parse(timeStr);\n\t\t\tvar pastTime = DateTime.Parse(pastTimeStr);\n\t\t\tAssert.AreEqual(expected, DateFormat.PeriodBetween(time, pastTime));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TimePeriodBetweenFutureTime()\n\t\t{\n\t\t\tvar time = DateTime.Parse(\"2017-07-27\");\n\t\t\tvar future = DateTime.Parse(\"2017-10-10\");\n\t\t\tAssert.AreEqual(\"In 75 days\", DateFormat.PeriodBetween(time, future));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TimePeriod2Hours15MinutesLaterTheSameDay()\n\t\t{\n\t\t\tvar time = DateTime.Parse(\"2017-07-27T12:00:00\");\n\t\t\tvar later = DateTime.Parse(\"2017-07-27T14:15:00\");\n\n\t\t\tAssert.AreEqual(\"Today in 2 hours 15 minutes\", DateFormat.PeriodBetween(time, later));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TimePeriod3HoursLaterTheSameDay()\n\t\t{\n\t\t\tvar time = DateTime.Parse(\"2017-07-27T12:00:00\");\n\t\t\tvar later = DateTime.Parse(\"2017-07-27T15:00:00\");\n\n\t\t\tAssert.AreEqual(\"Today in 3 hours\", DateFormat.PeriodBetween(time, later));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/Diagnostics/ConsoleTraceExtensionTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests.Diagnostics\n{\n\t// Single threaded, since we set a static global\n\t[SingleThreaded]\n\t[TestFixture]\n\tpublic class ConsoleTraceExtensionTests\n\t{\n\t\tStringWriter _trace;\n\t\tIObservableTraceLogger _originalLogger;\n\n\t\t[Test]\n\t\tpublic void ConsoleTrace_outputs_correct_log_when_subscribing_to_observable_return()\n\t\t{\n\t\t\tObservable.Return(1337).ConsoleTrace(\"elite\").Subscribe().Dispose();\n\n\t\t\tAssertLogEquals(\n\t\t\t\t@\"\tT{t} Enter  elite Subscribe(..) -> #{obs_id}\n\t\t\t\t\tT{t} Enter  |   elite (#{obs_id}) OnNext(1337)\n\t\t\t\t\tT{t} Enter  |   elite (#{obs_id}) OnCompleted()\n\t\t\t\t\tT{t} Exit   elite Subscribe(..) -> #{obs_id}\n\t\t\t\t\tT{t} Enter  elite (#{obs_id}) Dispose()\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConsoleTrace_is_prefixed_with_thread_id_when_calling_from_other_thread()\n\t\t{\n\t\t\tvar subject = new Subject<int>();\n\t\t\tvar waitHandle = new ManualResetEvent(false);\n\t\t\tusing (subject\n\t\t\t\t.ConsoleTrace(\"Subject\")\n\t\t\t\t.Select(x => x * 2)\n\t\t\t\t.Delay(TimeSpan.FromMilliseconds(100), NewThreadScheduler.Default)\n\t\t\t\t.ConsoleTrace(\"ObserveOn\")\n\t\t\t\t.Do(_ => waitHandle.Set())\n\t\t\t\t.Subscribe())\n\t\t\t{\n\t\t\t\tsubject.OnNext(333);\n\t\t\t\tAssert.IsTrue(waitHandle.WaitOne(1000), \"Timeout\");\n\t\t\t}\n\n\t\t\tAssertLogEquals(\n\t\t\t\t@\"\tT{t1} Enter  ObserveOn Subscribe(..) -> #1\n\t\t\t\t\tT{t1} Enter  |   Subject Subscribe(..) -> #2\n\t\t\t\t\tT{t1} Exit   ObserveOn Subscribe(..) -> #1\n\t\t\t\t\tT{t1} Enter  Subject (#2) OnNext(333)\n\t\t\t\t\tT{t2} Enter  ObserveOn (#1) OnNext(666)\n\t\t\t\t\tT{t1} Enter  ObserveOn (#1) Dispose()\n\t\t\t\t\tT{t1} Enter  |   Subject (#2) Dispose()\n\t\t\t\t\tT{t1} Exit   ObserveOn (#1) Dispose()\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConsoleTrace_makes_use_of_tostring_parameter_for_string_conversion()\n\t\t{\n\t\t\tvar obs = new Subject<int>();\n\t\t\tobs\n\t\t\t\t.ConsoleTrace(\"the name\", i => i.ToString(\"X\")) // -=> the name:'2A'\n\t\t\t\t.Subscribe(v => { });\n\t\t\tobs.OnNext(42);\n\n\t\t\tAssertLogEquals(\n\t\t\t\t@\"\tT{t} Enter  the name Subscribe(..) -> #1\n\t\t\t\t\tT{t} Enter  the name (#1) OnNext(2A)\");\n\t\t}\n\n\t\tvoid AssertLogEquals(string template)\n\t\t{\n\t\t\tAssertMatchTemplate(template, _trace.ToString());\n\t\t}\n\n\t\tstatic void AssertMatchTemplate(string template, string actual)\n\t\t{\n\t\t\tvar regex = new Regex(\"⦃(?<key>[^⦄]+)⦄\", RegexOptions.Multiline);\n\t\t\tvar regexTemplate = Regex.Replace(template, \"^\\\\s*\", \"\", RegexOptions.Multiline);\n\n\t\t\tregexTemplate = regexTemplate\n\t\t\t\t.Replace(\"\\r\\n\", \"\\n\")\n\t\t\t\t.Replace(\"{\", \"⦃\")\n\t\t\t\t.Replace(\"}\", \"⦄\")\n\t\t\t\t.Replace(\"⦃⦃\", \"{\")\n\t\t\t\t.Replace(\"⦄⦄\", \"}\");\n\n\t\t\tregexTemplate = Regex.Escape(regexTemplate);\n\n\t\t\tHashSet<string> keys = new HashSet<string>();\n\t\t\tregexTemplate = \"^\" + regex.Replace(\n\t\t\t\tregexTemplate,\n\t\t\t\tmatch => keys.Add(match.Value) ? match.Result(\"(?<${key}>.*?)\") : match.Result(\"\\\\k<${key}>\")) + \"$\";\n\n\t\t\tAssert.IsTrue(Regex.IsMatch(actual, regexTemplate), \"Does not match template \" + template);\n\t\t}\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_originalLogger = ObservableTraceLogger.Current;\n\t\t\t_trace = new StringWriter();\n\t\t\tObservableTraceLogger.Current =\n\t\t\t\tObservableTraceLogger.Create(\n\t\t\t\t\tTextWriter.Synchronized(new Tee(TestContext.Out, _trace) { NewLine = \"\\n\" }),\n\t\t\t\t\tmeasure: false);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tObservableTraceLogger.Current.Dispose();\n\t\t\tObservableTraceLogger.Current = _originalLogger;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Text writer that redirects to two writers, get text out in test for diagnostics purposes\n\t\t/// </summary>\n\t\tclass Tee : TextWriter\n\t\t{\n\t\t\treadonly TextWriter a;\n\t\t\treadonly TextWriter b;\n\n\t\t\tpublic Tee(TextWriter a, TextWriter b)\n\t\t\t{\n\t\t\t\tthis.a = a;\n\t\t\t\tthis.b = b;\n\t\t\t}\n\n\t\t\tpublic override IFormatProvider FormatProvider\n\t\t\t{\n\t\t\t\tget { return CultureInfo.InvariantCulture; }\n\t\t\t}\n\n\t\t\tpublic override Encoding Encoding\n\t\t\t{\n\t\t\t\tget { return a.Encoding; }\n\t\t\t}\n\n\t\t\tpublic override void Write(char value)\n\t\t\t{\n\t\t\t\ta.Write(value);\n\t\t\t\tb.Write(value);\n\t\t\t}\n\n\t\t\tpublic override void Write(char[] buffer, int index, int count)\n\t\t\t{\n\t\t\t\ta.Write(buffer, index, count);\n\t\t\t\tb.Write(buffer, index, count);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/DistinctUntilChanged.cs",
    "content": "﻿using System.Linq;\nusing System.Reactive.Linq;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tclass DistinctUntilChangedTest\n\t{\n\t\t[Test]\n\t\tpublic void RearrangeItemsInSet()\n\t\t{\n\t\t\tvar a = new[] { 1, 2, 3 };\n\t\t\tvar a2 = new[] { 1, 2, 3 };\n\t\t\tvar b = new[] { 1, 3, 2 };\n\t\t\tvar src = new[] { a, a2, b }.ToObservable();\n\n\t\t\tvar result = src.DistinctUntilSetChanged().ToEnumerable().ToArray();\n\n\t\t\tAssert.That(result.Length, Is.EqualTo(1));\n\t\t\tAssert.That(result[0], Is.EquivalentTo(a));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RearrangeItemsInSequence()\n\t\t{\n\t\t\tvar a = new[] { 1, 2, 3 };\n\t\t\tvar a2 = new[] { 1, 2, 3 };\n\t\t\tvar b = new[] { 1, 3, 2 };\n\t\t\tvar src = new[] { a, a2, b }.ToObservable();\n\n\t\t\tvar result = src.DistinctUntilSequenceChanged().ToEnumerable().ToArray();\n\n\t\t\tAssert.That(result.Length, Is.EqualTo(2));\n\t\t\tAssert.That(result[0], Is.EquivalentTo(a));\n\t\t\tAssert.That(result[1], Is.EquivalentTo(b));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/tests/Extensions/LiftedOperators/CacheExtensionTests.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests.Extensions.LiftedOperators\n{\n\t[TestFixture]\n\tpublic class CacheExtensionTests\n\t{\n\t\t[Test]\n\t\tpublic async Task CachePerElement_calls_valueRemoved_delegate_when_value_has_been_removed()\n\t\t{\n\t\t\tvar valueRemoved = Optional.None<char>();\n\t\t\tvar finalSequence =\n\t\t\t\tawait Observable.Return<IEnumerable<char>>(\"ABC\")\n\t\t\t\t\t.Concat(Observable.Return(\"AC\"))\n\t\t\t\t\t.CachePerElement(c => c, valueRemoved: c => valueRemoved = c)\n\t\t\t\t\t.Select(x => new string(x.ToArray()))\n\t\t\t\t\t.LastOrDefaultAsync();\n\n\t\t\tAssert.That(finalSequence, Is.EqualTo(\"AC\"));\n\t\t\tAssert.That(valueRemoved.HasValue, Is.True);\n\t\t\tAssert.That(valueRemoved.Value, Is.EqualTo('B'));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CachePerElement_returns_elements_in_same_order_as_source()\n\t\t{\n\t\t\tvar finalSequence =\n\t\t\t\tawait Observable.Return<IEnumerable<char>>(\"XYZ\")\n\t\t\t\t\t.Concat(Observable.Return(\"ZYXCBA\"))\n\t\t\t\t\t.CachePerElement(x => x)\n\t\t\t\t\t.Select(x => new string(x.ToArray()))\n\t\t\t\t\t.LastOrDefaultAsync();\n\n\t\t\tAssert.That(finalSequence, Is.EqualTo(\"ZYXCBA\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CachePerElement_using_overload_that_takes_keySelector_returns_cached_values()\n\t\t{\n\t\t\tvar finalSequence =\n\t\t\t\tawait Observable.Return<IEnumerable<char>>(\"ABCDEFG\")\n\t\t\t\t\t.Concat(Observable.Return(\"abcdefg\"))\n\t\t\t\t\t.CachePerElement(c => c, c => char.ToUpper(c))\n\t\t\t\t\t.Select(x => new string(x.ToArray()))\n\t\t\t\t\t.LastOrDefaultAsync();\n\n\t\t\tAssert.That(finalSequence, Is.EqualTo(\"ABCDEFG\"));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/FormatterTests.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing NUnit.Framework;\n\nnamespace Outracks.Fuse.Reporting.Tests\n{\n\tpublic class FormatterTests\n\t{\n\t\t[Test]\n\t\tpublic void SetsCorrectLevel()\n\t\t{\n\t\t\tAssert.AreEqual(\"DEBUG\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, \"foo\", null)).Level);\n\t\t\tAssert.AreEqual(\"INFO\", new ParsedLogMessage(Formatter.Format(LogLevel.Info, \"foo\", null)).Level);\n\t\t\tAssert.AreEqual(\"WARNING\", new ParsedLogMessage(Formatter.Format(LogLevel.Warning, \"foo\", null)).Level);\n\t\t\tAssert.AreEqual(\"ERROR\", new ParsedLogMessage(Formatter.Format(LogLevel.Error, \"foo\", null)).Level);\n\t\t\tAssert.AreEqual(\"FATAL\", new ParsedLogMessage(Formatter.Format(LogLevel.Fatal, \"foo\", null)).Level);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SetsCorrectPidAndThread()\n\t\t{\n\t\t\tvar expected = \"[\" + Process.GetCurrentProcess().Id + \":\" + Thread.CurrentThread.ManagedThreadId + \"]\";\n\t\t\tAssert.AreEqual(expected, new ParsedLogMessage(Formatter.Format(LogLevel.Info, \"foo\", null)).Pid);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SetsCorrectMessage()\n\t\t{\n\t\t\tAssert.AreEqual(\"foo\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, \"foo\", null)).Message);\n\t\t\tAssert.AreEqual(\"\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, \"\", null)).Message);\n\t\t\tAssert.AreEqual(\"42\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, 42, null)).Message);\n\t\t\tAssert.AreEqual(\"foo bar\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, \"foo bar\", null)).Message);\n\t\t\tAssert.AreEqual(\"foo    bar\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, \"foo\\nbar\", null)).Message);\n\t\t\tAssert.AreEqual(\"foo    bar\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, \"foo\\r\\nbar\", null)).Message);\n\t\t\tAssert.AreEqual(\"\", new ParsedLogMessage(Formatter.Format(LogLevel.Debug, null, null)).Message);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IncludesExceptions()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tThrowyFunction();\n\t\t\t\tthrow new Exception(\"Expected an exception to be thrown\");\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tvar msg = new ParsedLogMessage(Formatter.Format(LogLevel.Debug, \"foo\", e)).Message;\n\t\t\t\tStringAssert.StartsWith(\"foo Exception:\", msg);\n\t\t\t\tStringAssert.Contains(\"Something went wrong here\", msg);\n\t\t\t\tStringAssert.Contains(\"ThrowyFunction\", msg);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HandlesObjectsWithThrowingToString()\n\t\t{\n\t\t\tvar msg = new ParsedLogMessage(Formatter.Format(LogLevel.Debug, new Throwy(), null)).Message;\n\t\t\tStringAssert.Contains(\"The log message was non-null, but 'Throwy.ToString()' threw an exception\", msg);\n\t\t\tStringAssert.Contains(\"I'm sorry, Dave, I'm afraid I can't do that\", msg);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.NoInlining)]\n\t\tpublic void ThrowyFunction()\n\t\t{\n\t\t\tthrow new Exception(\"Something went wrong here\");\n\t\t}\n\t}\n\n\tclass Throwy\n\t{\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tthrow new Exception(\"I'm sorry, Dave, I'm afraid I can't do that\");\n\t\t}\n\t}\n\n\tclass ParsedLogMessage\n\t{\n\t\tpublic readonly DateTime DateAndTime;\n\t\tpublic readonly string Level;\n\t\tpublic readonly string Pid;\n\t\tpublic readonly string Message;\n\n\t\tpublic ParsedLogMessage(string mesasage)\n\t\t{\n\t\t\tvar regex = new Regex(@\"(?<datetime>\\S+ \\S+) (?<pid>\\S+) (?<level>\\S+) (?<mesage>.*)\");\n\t\t\tvar m = regex.Matches(mesasage)[0];\n\t\t\tDateAndTime = DateTime.ParseExact(m.Groups[\"datetime\"].Value, \"yyyy-MM-dd HH:mm:ss,fff\", CultureInfo.InvariantCulture);\n\t\t\tPid = m.Groups[\"pid\"].Value;\n\t\t\tLevel = m.Groups[\"level\"].Value;\n\t\t\tMessage = m.Groups[\"mesage\"].Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/Helpers.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection;\n\nnamespace Outracks.Tests\n{\n\tpublic static class Helpers\n\t{\n\t\tpublic static Process RunTestProcess(string argument, Assembly executingAssembly)\n\t\t{\n\t\t\tvar testDir = new FileInfo(new Uri(executingAssembly.CodeBase).LocalPath).Directory;\n\t\t\tvar testExe = Path.Combine(testDir.FullName, \"Outracks.TestProcess.exe\");\n\t\t\treturn Process.Start(testExe, argument);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/JsonPathTests.cs",
    "content": "using System;\nusing Newtonsoft.Json.Linq;\nusing NUnit.Framework;\n\nnamespace Outracks.IO\n{\n\t[TestFixture]\n\tpublic class JsonPathTests\n\t{\n\t\t[Test]\n\t\tpublic void JsonAbsoluteDirectoryPath()\n\t\t{\n\t\t\tvar path = DirectoryPath.GetTempPath();\n\t\t\tvar json = JToken.FromObject(path);\n\t\t\tvar path2 = json.ToObject<AbsoluteDirectoryPath>();\n\t\t\tAssert.AreEqual(path, path2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void JsonAbsoluteFilePath()\n\t\t{\n\t\t\tvar path = FilePath.CreateTempFile();\n\t\t\tvar json = JToken.FromObject(path);\n\t\t\tvar path2 = json.ToObject<AbsoluteFilePath>();\n\t\t\tAssert.AreEqual(path, path2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void JsonRelativeDirectoryPath()\n\t\t{\n\t\t\tvar path = RelativeDirectoryPath.Empty / \"..\" / \"Programs\" / \"Fuse\" / \"Data\";\n\t\t\tvar json = JToken.FromObject(path);\n\t\t\tvar path2 = json.ToObject<RelativeDirectoryPath>();\n\t\t\tAssert.AreEqual(path, path2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void JsonRelativeFilePath()\n\t\t{\n\t\t\tvar path = RelativeDirectoryPath.Empty / \"..\" / \"Programs\" / \"Fuse\" / new FileName(\"Data.dat\");\n\t\t\tvar json = JToken.FromObject(path);\n\t\t\tvar path2 = json.ToObject<RelativeFilePath>();\n\t\t\tAssert.AreEqual(path, path2);\n\t\t}\n\n\n\t\t//Unused method, but maybe someone wants it for manual testing or something?\n\t\t#pragma warning disable 0219\n\t\tpublic void Execute()\n\t\t{\n\t\t\tvar root = AbsoluteDirectoryPath.Parse(\"root\");\n\n\t\t\tvar file1 = root.Combine(\"templates\").Combine(\"Projects\").Combine(new FileName(\"example.exe\"));\n\n\t\t\tvar file2 = root / \"templates\" / \"projects\" / new FileName(\"example.exe\");\n\n\t\t\tIAbsolutePath absFileOrDirectory = file2;\n\n\t\t\tabsFileOrDirectory.Do(\n\t\t\t\t(AbsoluteFilePath file) => Console.Out.WriteLine(\"File \" + file),\n\t\t\t\t(AbsoluteDirectoryPath dir) => Console.Out.WriteLine(\"Dir \" + dir));\n\n\t\t\tIFilePath absOrRelFile = file2;\n\n\t\t\tabsOrRelFile.Do(\n\t\t\t\t(AbsoluteFilePath abs) => Console.Out.WriteLine(\"Abs \" + abs),\n\t\t\t\t(RelativeFilePath rel) => Console.Out.WriteLine(\"Rel \" + rel));\n\n\n\t\t\tvar relativePath = RelativeDirectoryPath.Empty / \"..\" / \"Programs\" / \"Fuse\" / \"Data\";\n\n\t\t\tvar rebased = root / relativePath;\n\n\t\t\tvar common = root / \"a\" / \"b\";\n\t\t\tvar nop = common.RelativeTo(common);\n\t\t\tvar downUp = (common / \"left\").RelativeTo(common / \"right\");\n\t\t\tvar downDownUpUp = (common / \"left\" / \"left2\").RelativeTo(common / \"right\" / \"right2\");\n\t\t\tvar downDownDownUpUpUp = (common / \"left\" / \"left2\" / \"left3\").RelativeTo(common / \"right\" / \"right2\" / \"right3\");\n\n\n\n\t\t\tvar left = common / \"lc\" / \"ld\";\n\t\t\tvar right = common / \"rc\" / \"rd\" / \"re\";\n\n\t\t\tvar rightToLeft = left.RelativeTo(right);\n\t\t\tvar leftToRight = right.RelativeTo(left);\n\t\t\tvar leftToLeft = left.RelativeTo(left);\n\n\t\t\tvar a = common / leftToLeft;\n\t\t\tvar b = a == common;\n\t\t}\n\t\t#pragma warning restore 0219\n\t}\n}"
  },
  {
    "path": "src/common/tests/MatchWithTest.cs",
    "content": "﻿namespace Outracks.Tests\n{\n    interface IFoo : IMatchTypes<Bar, Baz, Biz>\n    {\n        string InternalPrettyPrint();\n    }\n\n    class Bar : IFoo\n    {\n        public string bar = \"bar\";\n        public string InternalPrettyPrint() { return bar; }\n    }\n\n    class Baz : IFoo\n    {\n        public string baz = \"baz\";\n        public string InternalPrettyPrint() { return baz; }\n    }\n\n    class Biz : IFoo\n    {\n        public string biz = \"biz\";\n        public string InternalPrettyPrint() { return biz; }\n    }\n\n    static class ExternalPrettyPrintExtension\n    {\n        public static string ExternalPrettyPrint(this IFoo foo)\n        {\n            return foo.MatchWith(\n                bar => bar.bar,\n                baz => baz.baz,\n                biz => biz.biz);\n        }\n    }\n\n    class Test\n    {\n        //Unused method, but maybe someone wants it for manual testing or something?\n        public static void DoTest()\n        {\n            IFoo foo = new Bar();\n\n\t        #pragma warning disable 0219\n            var a = foo.InternalPrettyPrint();\n            var b = foo.ExternalPrettyPrint();\n\t        #pragma warning restore 0219\n        }\n    }\n\n}\n"
  },
  {
    "path": "src/common/tests/NetworkHelperTests.cs",
    "content": "﻿using System.Net;\nusing NUnit.Framework;\nusing Outracks.IPC;\n\nnamespace Outracks.Tests\n{\n\t[TestFixture]\n\tpublic class NetworkHelperTests\n\t{\n\t\t[Test]\n\t\tpublic void ExtractIpsFromIfconfigOutput_is_successful()\n\t\t{\n\t\t\tvar ips = NetworkHelper.ExtractIpsFromIfconfigOutput(_ifconfigOutput);\n\t\t\tCollectionAssert.AreEqual(ips, new[] { IPAddress.Parse(\"127.0.0.1\"), IPAddress.Parse(\"192.168.1.112\") });\n\t\t}\n\n\t\tstatic readonly string _ifconfigOutput = @\"\tlo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384\n\toptions=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>\n\tinet 127.0.0.1 netmask 0xff000000\n\tinet6 ::1 prefixlen 128\n\tinet6 fe80::1%lo0 prefixlen 64 scopeid 0x1\n\tnd6 options=201<PERFORMNUD,DAD>\ngif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280\nstf0: flags=0<> mtu 1280\nen0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500\n\toptions=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>\n\tether ac:87:a3:08:5b:2a\n\tinet6 fe80::e0:8f00:3d02:dc62%en0 prefixlen 64 secured scopeid 0x4\n\tinet 192.168.1.112 netmask 0xffffff00 broadcast 192.168.1.255\n\tnd6 options=201<PERFORMNUD,DAD>\n\tmedia: autoselect (1000baseT <full-duplex>)\n\tstatus: active\nen1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500\n\tether 88:63:df:c3:01:77\n\tnd6 options=201<PERFORMNUD,DAD>\n\tmedia: autoselect (<unknown type>)\n\tstatus: inactive\nen2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500\n\toptions=60<TSO4,TSO6>\n\tether 0a:00:00:29:9d:c0\n\tmedia: autoselect <full-duplex>\n\tstatus: inactive\nen3: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500\n\toptions=60<TSO4,TSO6>\n\tether 0a:00:00:29:9d:c1\n\tmedia: autoselect <full-duplex>\n\tstatus: inactive\nbridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500\n\toptions=63<RXCSUM,TXCSUM,TSO4,TSO6>\n\tether 0a:00:00:29:9d:c0\n\tConfiguration:\n\t\tid 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0\n\t\tmaxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200\n\t\troot id 0:0:0:0:0:0 priority 0 ifcost 0 port 0\n\t\tipfilter disabled flags 0x2\n\tmember: en2 flags=3<LEARNING,DISCOVER>\n\t        ifmaxaddr 0 port 6 priority 0 path cost 0\n\tmember: en3 flags=3<LEARNING,DISCOVER>\n\t        ifmaxaddr 0 port 7 priority 0 path cost 0\n\tnd6 options=201<PERFORMNUD,DAD>\n\tmedia: <unknown type>\n\tstatus: inactive\np2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304\n\tether 0a:63:df:c3:01:77\n\tmedia: autoselect\n\tstatus: inactive\nawdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484\n\tether 52:d7:0b:c9:85:c5\n\tinet6 fe80::50d7:bff:fec9:85c5%awdl0 prefixlen 64 scopeid 0xa\n\tnd6 options=201<PERFORMNUD,DAD>\n\tmedia: autoselect\n\tstatus: active\nutun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000\n\tinet6 fe80::de69:9795:36ad:6da%utun0 prefixlen 64 scopeid 0xb\n\tnd6 options=201<PERFORMNUD,DAD>\";\n\t}\n}"
  },
  {
    "path": "src/common/tests/ObservableStackTests.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tclass ObservableStackTests\n\t{\n\t\t[Test]\n\t\tpublic async Task EmptyStack()\n\t\t{\n\t\t\tvar stack = new ObservableStack<int>();\n\n\t\t\tAssert.Throws<InvalidOperationException>(() => { var a = stack.Value; });\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.PeekUnder.FirstAsync());\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task PushPopAndPushAgain()\n\t\t{\n\t\t\tvar stack = new ObservableStack<int>();\n\n\t\t\t// Push one element\n\t\t\tstack.Push(1);\n\t\t\tAssert.AreEqual(1, stack.Value);\n\t\t\tAssert.AreEqual(Optional.Some(1), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.PeekUnder.FirstAsync());\n\n\t\t\t// Pop it back to empty\n\t\t\tvar pop1 = stack.Pop();\n\t\t\tAssert.AreEqual(1, pop1);\n\t\t\tAssert.Throws<InvalidOperationException>(() => { var a = stack.Value; });\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.PeekUnder.FirstAsync());\n\n\t\t\t// Push two elements\n\t\t\tstack.Push(1);\n\t\t\tstack.Push(2);\n\t\t\tAssert.AreEqual(2, stack.Value);\n\t\t\tAssert.AreEqual(Optional.Some(2), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.Some(1), await stack.PeekUnder.FirstAsync());\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Replace()\n\t\t{\n\t\t\tvar stack = new ObservableStack<int>();\n\n\t\t\t// Initialize stack to be replaced\n\t\t\tstack.Push(13);\n\t\t\tstack.Push(37);\n\n\t\t\t// Replace all elements\n\t\t\tstack.Replace(1, 2, 3);\n\t\t\tAssert.AreEqual(Optional.Some(3), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.Some(2), await stack.PeekUnder.FirstAsync());\n\n\t\t\t// Pop them off again\n\t\t\tstack.Pop();\n\t\t\tAssert.AreEqual(Optional.Some(2), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.Some(1), await stack.PeekUnder.FirstAsync());\n\t\t\tstack.Pop();\n\t\t\tAssert.AreEqual(Optional.Some(1), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.PeekUnder.FirstAsync());\n\t\t\tstack.Pop();\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.PeekUnder.FirstAsync());\n\n\t\t\t// Push after it was cleared\n\t\t\tstack.Push(1);\n\t\t\tAssert.AreEqual(1, stack.Value);\n\t\t\tAssert.AreEqual(Optional.Some(1), await stack.Peek.FirstAsync());\n\t\t\tAssert.AreEqual(Optional.None<int>(), await stack.PeekUnder.FirstAsync());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/tests/Outracks.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{1A7CF40D-C7A7-4C85-A092-73142BB90B93}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Tests</RootNamespace>\n    <AssemblyName>Outracks.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Castle.Core.4.4.1\\lib\\net45\\Castle.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\log4net.2.0.12\\lib\\net45\\log4net.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"NSubstitute, Version=4.2.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NSubstitute.4.2.2\\lib\\net46\\NSubstitute.dll</HintPath>\n    </Reference>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.7.1\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Web\" />\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Diagnostics\\ConsoleTraceExtensionTests.cs\" />\n    <Compile Include=\"DistinctUntilChanged.cs\" />\n    <Compile Include=\"DateFormatTests.cs\" />\n    <Compile Include=\"Extensions\\LiftedOperators\\CacheExtensionTests.cs\" />\n    <Compile Include=\"Paths\\FileNameTest.cs\" />\n    <Compile Include=\"FormatterTests.cs\" />\n    <Compile Include=\"Helpers.cs\" />\n    <Compile Include=\"MatchWithTest.cs\" />\n    <Compile Include=\"NetworkHelperTests.cs\" />\n    <Compile Include=\"ObservableStackTests.cs\" />\n    <Compile Include=\"Paths\\FilePathTests.cs\" />\n    <Compile Include=\"Pipes\\UnixSocketStreamTests.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"RemoteTaskTest.cs\" />\n    <Compile Include=\"ReplayQueueSubjectTest.cs\" />\n    <Compile Include=\"ReportTest.cs\" />\n    <Compile Include=\"RestrictToAttribute.cs\" />\n    <Compile Include=\"SingleActionQueueTests.cs\" />\n    <Compile Include=\"SubscribeUsing.cs\" />\n    <Compile Include=\"JsonPathTests.cs\" />\n    <Compile Include=\"TextPositionTests.cs\" />\n    <Compile Include=\"WithLatestFrom.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\testproc\\Outracks.TestProcess.csproj\">\n      <Project>{83411ce7-b65f-4eee-9e9c-0a94a5007fc8}</Project>\n      <Name>Outracks.TestProcess</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\text\\Outracks.Text.csproj\">\n      <Project>{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}</Project>\n      <Name>Outracks.Text</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"TestResult.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"SystemInfo\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/common/tests/Paths/FileNameTest.cs",
    "content": "﻿using System;\nusing System.IO;\nusing NUnit.Framework;\n\nnamespace Outracks.IO.Tests\n{\n    class FileNameTest\n    {\n        [Test]\n        public void FileNameCannotBeNull()\n        {\n            var e = Assert.Throws<ArgumentException>(() => new FileName(null));\n            Assert.AreEqual(\"file name can not be null\", e.Message);\n        }\n\n        [Test]\n        public void FileNameCannotBeEmpty()\n        {\n            var e = Assert.Throws<ArgumentException>(() => new FileName(\"\"));\n            Assert.AreEqual(\"file name can not be empty\", e.Message);\n        }\n\n        [Test]\n        public void FileNameCannotContainInvalidCharacters()\n        {\n            var fileName = \"foo\" + Path.GetInvalidFileNameChars()[0];\n            var e = Assert.Throws<ArgumentException>(() =>\n            {\n                new FileName(fileName);\n            });\n            Assert.AreEqual(\"file name '\" + fileName +  \"' contains invalid characters\", e.Message);\n        }\n\n        [Test]\n        public void Extension()\n        {\n            Assert.AreEqual(\"\", new FileName(\"foo\").Extension);\n            Assert.AreEqual(\".\", new FileName(\"foo.\").Extension);\n            Assert.AreEqual(\".exe\", new FileName(\"foo.exe\").Extension);\n            Assert.AreEqual(\".bat\", new FileName(\"foo.exe.bat\").Extension);\n            Assert.AreEqual(\".exe\", new FileName(\".exe\").Extension);\n        }\n\n        [Test]\n        public void WithoutExtension()\n        {\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo\").WithoutExtension);\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo.\").WithoutExtension);\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo.exe\").WithoutExtension);\n            Assert.AreEqual(new FileName(\"foo.exe\"), new FileName(\"foo.exe.bat\").WithoutExtension);\n\n            //NOTE: This is just describing the current behaviour while adding tests, and\n            //is maybe not the best way of handling it.\n            //The point is that we have a class invariant disallowing empty file names, but\n            //there's no way of doing that in this case. Lorents suggested changing the property to use\n            //Optional, but that would require a lot of handling of Optional elsewhere in the code\n            Assert.Throws<ArgumentException>(() => { var v = new FileName(\".exe\").WithoutExtension; });\n        }\n\n        [Test]\n        public void HasExtension()\n        {\n            Assert.True(new FileName(\"foo.bar\").HasExtension(\".bar\"));\n            Assert.True(new FileName(\"foo.bar\").HasExtension(\"bar\"));\n            Assert.False(new FileName(\"foo.bar\").HasExtension(\"baz\"));\n\n            Assert.True(new FileName(\"foo.\").HasExtension(\"\"));\n            Assert.True(new FileName(\"foo.\").HasExtension(\".\"));\n            Assert.False(new FileName(\"foo.\").HasExtension(\"baz\"));\n\n            Assert.False(new FileName(\"foo\").HasExtension(\"\"));\n            Assert.False(new FileName(\"foo\").HasExtension(\".\"));\n            Assert.False(new FileName(\"foo\").HasExtension(\"baz\"));\n\n            Assert.True(new FileName(\".foo\").HasExtension(\"foo\"));\n            Assert.True(new FileName(\".foo\").HasExtension(\".foo\"));\n            Assert.False(new FileName(\".foo\").HasExtension(\".baz\"));\n        }\n\n        [Test]\n        public void StripExtension()\n        {\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo\").StripExtension(\"\"));\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo\").StripExtension(\".\"));\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo\").StripExtension(\"foo\"));\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo\").StripExtension(\".bar\"));\n\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo.\").StripExtension(\"\"));\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo.\").StripExtension(\".\"));\n            Assert.AreEqual(new FileName(\"foo.\"), new FileName(\"foo.\").StripExtension(\"foo\"));\n\n            Assert.AreEqual(new FileName(\"foo.bar\"), new FileName(\"foo.bar\").StripExtension(\"\"));\n            Assert.AreEqual(new FileName(\"foo.bar\"), new FileName(\"foo.bar\").StripExtension(\"foo\"));\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo.bar\").StripExtension(\"bar\"));\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo.bar\").StripExtension(\".bar\"));\n        }\n\n        [Test]\n        public void AddExtension()\n        {\n            Assert.AreEqual(new FileName(\"foo.bar\"), new FileName(\"foo\").AddExtension(\"bar\"));\n            Assert.AreEqual(new FileName(\"foo.bar\"), new FileName(\"foo\").AddExtension(\".bar\"));\n            Assert.AreEqual(new FileName(\"foo.\"), new FileName(\"foo\").AddExtension(\".\"));\n            Assert.AreEqual(new FileName(\"foo.\"), new FileName(\"foo\").AddExtension(\".\"));\n        }\n\n        [Test]\n        public void Add()\n        {\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo\").Add(\"\"));\n            Assert.AreEqual(new FileName(\"foobar\"), new FileName(\"foo\").Add(\"bar\"));\n            Assert.AreEqual(new FileName(\"foo.bar\"), new FileName(\"foo\").Add(\".bar\"));\n        }\n\n        [Test]\n        public void Replace()\n        {\n            Assert.AreEqual(new FileName(\"faa\"), new FileName(\"foo\").Replace(\"o\", \"a\"));\n            Assert.AreEqual(new FileName(\"foo\"), new FileName(\"foo\").Replace(\"X\", \"a\"));\n            Assert.AreEqual(new FileName(\"fo_ar\"), new FileName(\"foo.bar\").Replace(\"o.b\", \"_\"));\n        }\n\n        [Test]\n        public void Contains()\n        {\n            Assert.True(new FileName(\"foo.bar\").Contains(\"oo.ba\"));\n            Assert.False(new FileName(\"foo\").Contains(\"ooo\"));\n        }\n    }\n}\n"
  },
  {
    "path": "src/common/tests/Paths/FilePathTests.cs",
    "content": "﻿using NUnit.Framework;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Tests.Paths\n{\n\tclass FilePathTests\n\t{\n\t\t[Test]\n\t\tpublic void ParseAndMakeAbsolute_RelativeWithoutRoot()\n\t\t{\n\t\t\tAssert.That(\n\t\t\t\tFilePath.ParseAndMakeAbsolute(\"foo\"),\n\t\t\t\tIs.EqualTo(DirectoryPath.GetCurrentDirectory() / new FileName(\"foo\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseAndMakeAbsolute_AbsoluteWithoutRoot()\n\t\t{\n\t\t\tvar nativePath = Platform.IsWindows ? @\"C:\\foo\" : \"/foo\";\n\t\t\tAssert.That(\n\t\t\t\tFilePath.ParseAndMakeAbsolute(nativePath),\n\t\t\t\tIs.EqualTo(AbsoluteFilePath.Parse(nativePath)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseAndMakeAbsolute_RelativeWithRoot()\n\t\t{\n\t\t\tvar root = Platform.IsWindows ? @\"C:\\root\" : \"/root\";\n\t\t\tvar rootPath = AbsoluteDirectoryPath.Parse(root);\n\t\t\tAssert.That(\n\t\t\t\tFilePath.ParseAndMakeAbsolute(\"foo\", rootPath),\n\t\t\t\tIs.EqualTo(rootPath / new FileName(\"foo\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseAndMakeAbsolute_AbsoluteWithRoot()\n\t\t{\n\t\t\tvar root = Platform.IsWindows ? @\"C:\\root\" : \"/root\";\n\t\t\tvar foo = Platform.IsWindows ? @\"C:\\foo\" : \"/foo\";\n\t\t\tAssert.That(\n\t\t\t\tFilePath.ParseAndMakeAbsolute(foo, AbsoluteDirectoryPath.Parse(root)),\n\t\t\t\tIs.EqualTo(AbsoluteFilePath.Parse(foo)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/tests/Pipes/UnixSocketStreamTests.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing Outracks.Diagnostics;\nusing Outracks.IPC;\n\nnamespace Outracks.Tests.Pipes\n{\n\tpublic class UnixSocketStreamTests\n\t{\n\t\tprivate PipeName _pipeName;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_pipeName = new PipeName(Guid.NewGuid());\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tif (!Platform.IsMac)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tFile.Delete(Path.Combine(UnixSocketStream.SocketDirectory, _pipeName.ToString()));\n\t\t}\n\n\t\t[Test]\n\t\t[RestrictTo(OS.Mac)]\n\t\tpublic void SettingUpServerThenClientWorks()\n\t\t{\n\t\t\tvar host = Task.Run(() => { new UnixSocketStream(_pipeName, SocketUsage.Host); });\n\t\t\tvar client = Task.Delay(TimeSpan.FromSeconds(1))\n\t\t\t\t.ContinueWith(_ => { new UnixSocketStream(_pipeName, SocketUsage.Client); });\n\n\t\t\tTask.WaitAll(\n\t\t\t\tAwaitOrTimeOut(TimeSpan.FromSeconds(3), host, \"host\"),\n\t\t\t\tAwaitOrTimeOut(TimeSpan.FromSeconds(3), client, \"client\"));\n\t\t}\n\n\t\t[Test]\n\t\t[RestrictTo(OS.Mac)]\n\t\tpublic void SettingUpClientThenServerWorks()\n\t\t{\n\t\t\tvar client = Task.Run(() => { new UnixSocketStream(_pipeName, SocketUsage.Client); });\n\t\t\tvar host = Task.Delay(TimeSpan.FromSeconds(1))\n\t\t\t\t.ContinueWith(_ => new UnixSocketStream(_pipeName, SocketUsage.Host));\n\n\t\t\tTask.WaitAll(\n\t\t\t\tAwaitOrTimeOut(TimeSpan.FromSeconds(3), host, \"host\"),\n\t\t\t\tAwaitOrTimeOut(TimeSpan.FromSeconds(3), client, \"client\"));\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[RestrictTo(OS.Mac)]\n\t\tpublic async Task CanCommunicate()\n\t\t{\n\t\t\tvar message = new byte[] {0x01, 0x02, 0x03};\n\t\t\tvar receive = Task.Run(() =>\n\t\t\t{\n\t\t\t\tvar host = new UnixSocketStream(_pipeName, SocketUsage.Host);\n\t\t\t\tReadFromHostAndAssertMessageEquals(host, message);\n\t\t\t});\n\t\t\tvar sender = new UnixSocketStream(_pipeName, SocketUsage.Client);\n\t\t\tsender.Write(message, 0, message.Length);\n\t\t\tawait AwaitOrTimeOut(TimeSpan.FromSeconds(3), receive, \"receive\");\n\t\t}\n\n\t\t[Test]\n\t\t[RestrictTo(OS.Mac)]\n\t\t//Caracterization test written after the fact, assuming this is the correct behavior\n\t\tpublic void SettingUpClientWithoutServerBlocks()\n\t\t{\n\t\t\tvar returned = false;\n\t\t\tTask.Run(() =>\n\t\t\t{\n\t\t\t\tnew UnixSocketStream(_pipeName, SocketUsage.Client);\n\t\t\t\treturned = true;\n\t\t\t});\n\t\t\tThread.Sleep(TimeSpan.FromSeconds(1));\n\t\t\tif (returned)\n\t\t\t{\n\t\t\t\tAssert.Fail(\"Sender didn't block waiting for server\");\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[RestrictTo(OS.Mac)]\n\t\tpublic async Task ClosingClientMakesHostReadZeroBytes()\n\t\t{\n\t\t\tvar message = new byte[] {0x01, 0x02, 0x03};\n\t\t\tvar hostTask = Task.Run(() => { return new UnixSocketStream(_pipeName, SocketUsage.Host); });\n\t\t\tvar client = new UnixSocketStream(_pipeName, SocketUsage.Client);\n\t\t\tvar host = await hostTask;\n\t\t\tvar readTask = Task.Run(() => { ReadFromHostAndAssertMessageEquals(host, message); });\n\t\t\tclient.Write(message, 0, message.Length);\n\t\t\tawait readTask;\n\t\t\tclient.Close();\n\t\t\tvar buffer = new byte[1];\n\t\t\tAssert.AreEqual(0, host.Read(buffer, 0, 1));\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[RestrictTo(OS.Mac)]\n\t\tpublic async Task ClosingHostMakesClientWritingThrow()\n\t\t{\n\t\t\tvar message = new byte[] {0x01, 0x02, 0x03};\n\t\t\tvar hostTask = Task.Run(() => { return new UnixSocketStream(_pipeName, SocketUsage.Host); });\n\t\t\tvar client = new UnixSocketStream(_pipeName, SocketUsage.Client);\n\t\t\tvar host = await hostTask;\n\t\t\tvar readTask = Task.Run(() => { ReadFromHostAndAssertMessageEquals(host, message); });\n\t\t\tclient.Write(message, 0, message.Length);\n\t\t\tawait readTask;\n\t\t\thost.Close();\n\t\t\tvar buffer = new byte[1];\n\t\t\tAssert.Throws<IOException>(() => client.Write(buffer, 0, 1));\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[RestrictTo(OS.Mac)]\n\t\t//Characterization test\n\t\tpublic void CrashingClientMakesHostReadZeroBytes()\n\t\t{\n\t\t\tusing (var p = RunTestProcess(\"CrashingClientMakesHostReadZeroBytes \" + _pipeName))\n\t\t\t{\n\t\t\t\tvar message = new byte[] {0x01};\n\t\t\t\tvar host = new UnixSocketStream(_pipeName, SocketUsage.Host);\n\t\t\t\tReadFromHostAndAssertMessageEquals(host, message);\n\t\t\t\tp.Kill();\n\t\t\t\tvar buffer = new byte[1];\n\t\t\t\tvar count = host.Read(buffer, 0, 1);\n\t\t\t\tAssert.AreEqual(0, count);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[RestrictTo(OS.Mac)]\n\t\t//Characterization test\n\t\tpublic void CrashingHostMakesClientWritingThrow()\n\t\t{\n\t\t\tusing (var p = RunTestProcess(\"CrashingHostMakesClientWritingThrow \" + _pipeName))\n\t\t\t{\n\t\t\t\tvar client = new UnixSocketStream(_pipeName, SocketUsage.Client);\n\t\t\t\tvar message = new byte[] {0x01};\n\t\t\t\tclient.Write(message, 0, 1);\n\t\t\t\tp.Kill();\n\t\t\t\tp.WaitForExit();\n\t\t\t\tAssert.Throws<IOException>(() => client.Write(message, 0, 1));\n\t\t\t}\n\t\t}\n\n\t\tstatic Process RunTestProcess(string argument)\n\t\t{\n\t\t\treturn Helpers.RunTestProcess(argument, Assembly.GetExecutingAssembly());\n\n\t\t}\n\n\t\t[Test]\n\t\t[RestrictTo(OS.Mac)]\n\t\t[Timeout(10000)]\n\t\tpublic async Task HasCorrectCapabilities()\n\t\t{\n            var hostTask = Task.Run(() => { return new UnixSocketStream(_pipeName, SocketUsage.Host); });\n\t\t\tvar client =  new UnixSocketStream(_pipeName, SocketUsage.Client);\n\t\t\tvar host = await hostTask;\n\n            Assert.IsTrue(host.CanWrite);\n            Assert.IsTrue(client.CanWrite);\n\n            Assert.IsTrue(host.CanRead);\n            Assert.IsTrue(client.CanRead);\n\n            Assert.IsFalse(host.CanSeek);\n            Assert.IsFalse(client.CanSeek);\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                var l = host.Length;\n            });\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                var l = client.Length;\n            });\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                var p = host.Position;\n            });\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                var p = client.Position;\n            });\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                host.Position = 1;\n            });\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                client.Position = 1;\n            });\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                host.Seek(1, SeekOrigin.Begin);\n            });\n\n            Assert.Throws<NotSupportedException>(() =>\n            {\n                host.Seek(1, SeekOrigin.Begin);\n            });\n\n\t\t}\n\n\t\tprivate static void ReadFromHostAndAssertMessageEquals(Stream host, byte[] message)\n\t\t{\n\t\t\tvar count = message.Length;\n\t\t\tvar buffer = new byte[count];\n\t\t\tvar offset = 0;\n\t\t\twhile (offset < count)\n\t\t\t{\n\t\t\t\toffset += host.Read(buffer, offset, count);\n\t\t\t}\n\t\t\tAssert.AreEqual(message, buffer);\n\t\t}\n\n\n\t\tpublic async Task AwaitOrTimeOut(TimeSpan timeOut, Task task, string tag)\n\t\t{\n\t\t\tif (await Task.WhenAny(task, Task.Delay(timeOut)) != task)\n\t\t\t{\n\t\t\t\tAssert.Fail(\"Timed out after \" + timeOut + \" waiting for task '\" + tag + \"'\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/common/tests/RemoteTaskTest.cs",
    "content": "﻿using System;\n\nnamespace Outracks.IPC.Tests\n{\n\tclass RemoteTaskTest\n\t{\n\t\t/*[Test]\n\t\tpublic void HostExecutesClientInvokes()\n\t\t{\n\t\t\tRegisterSerializers();\n\n\t\t\tvar guid = Guid.NewGuid();\n\t\t    var name = new PipeName(guid);\n\t\t\tvar host = Task.Factory.StartNew(\n\t\t\t\t() =>\n\t\t\t\t{\n                    return RemoteTask.HostExecuter<TaskArgs, TaskResult>(name,\n\t\t\t\t\t\t(a, c) => Task.FromResult(new TaskResult(1337)));\n\t\t\t\t});\n\n            var client = RemoteTask.ConnectToExecuter<TaskArgs, TaskResult>(name);\n\n\t\t\tvar args = new TaskArgs();\n\t\t\tvar task = client.Run(args, CancellationToken.None);\n\t\t\tvar result = task.Result;\n\n\t\t\tAssert.AreEqual(result.Magic, 1337);\n\t\t\tclient.Dispose();\n\t\t\thost.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClientExecutesHostInvokes()\n\t\t{\n\t\t\tRegisterSerializers();\n\n\t\t\tvar guid = Guid.NewGuid();\n\t\t    var name = new PipeName(guid);\n            Task.Factory.StartNew(\n\t\t\t\t() =>\n\t\t\t\t{\n                    var host = RemoteTask.HostInvoker<TaskArgs, TaskResult>(name);\n\n\t\t\t\t\tvar args = new TaskArgs();\n\t\t\t\t\tvar task = host.Run(args, CancellationToken.None);\n\t\t\t\t\tvar result = task.Result;\n\n\t\t\t\t\tAssert.AreEqual(result.Magic, 1338);\n\t\t\t\t\thost.Dispose();\n\t\t\t\t});\n\n            var client = RemoteTask.ConnectToInvoker<TaskArgs, TaskResult>(name,\n\t\t\t\t(a, c) => Task.FromResult(new TaskResult(1338)));\n\n\t\t\tclient.Dispose();\n\t\t}\n\n\t\tstatic void RegisterSerializers()\n\t\t{\n\t\t\tBinarySerializer.Register((w, o) => { }, (r) => new TaskArgs());\n\t\t\tBinarySerializer.Register((w, o) => w.Write(o.Magic), (r) => new TaskResult(r.ReadInt32()));\n\t\t\tBinarySerializer.Register((w, o) => { }, (r) => new TaskException());\n\t\t}\n\t\t * */\n\t}\n\n\n\n\n\tclass TaskException : Exception\n\t{\n\t}\n\n\tclass TaskResult\n\t{\n\t\tpublic int Magic { get; private set; }\n\n\t\tpublic TaskResult(int magic)\n\t\t{\n\t\t\tMagic = magic;\n\t\t}\n\n\t}\n\n\tclass TaskArgs\n\t{\n\t}\n}\n"
  },
  {
    "path": "src/common/tests/ReplayQueueSubjectTest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tclass ReplayQueueSubjectTest\n\t{\n\t\t[Test]\n\t\tpublic void ReplayQueueSubject_Remembers()\n\t\t{\n\t\t\tvar subject = new ReplayQueueSubject<string>();\n\n\t\t\t// While no-one is listening, a tree or two falls in the forest\n\t\t\tvar firstTreeFalls = \"A tree falls in the forest\";\n\t\t\tsubject.OnNext(firstTreeFalls);\n\n\t\t\tvar secondTreeFalls = \"Another tree falls in the forest\";\n\t\t\tsubject.OnNext(secondTreeFalls);\n\n\t\t\t// An observer arrives\n\t\t\tvar firstList = new List<string>();\n\t\t\tvar firstObserver = subject.Subscribe(firstList.Add);\n\n\t\t\t// The observer, even though it was not present, can see that two tree clearly fell while no one was looking, and consumes them\n\t\t\tAssert.That(firstList, Is.EquivalentTo(new[] { firstTreeFalls, secondTreeFalls }));\n\n\t\t\t// Another observer arrives\n\t\t\tvar secondList = new List<string>();\n\t\t\tvar secondObserver = subject.Subscribe(secondList.Add);\n\n\t\t\t// Since the trees that fell was consumed by the first observer, this observer doesn't notice anything\n\t\t\tAssert.That(secondList, Is.Empty);\n\n\t\t\t// A tree falls while both are looking\n\t\t\tvar thirdTreeFalls = \"A third tree falls in the forest\";\n\t\t\tsubject.OnNext(thirdTreeFalls);\n\n\t\t\t// Both of them consume the third tree, since they were looking at the same time\n\t\t\tAssert.That(firstList, Is.EquivalentTo(new[] { firstTreeFalls, secondTreeFalls, thirdTreeFalls }));\n\t\t\tAssert.That(secondList, Is.EquivalentTo(new [] { thirdTreeFalls }));\n\n\t\t\t// The observers leave\n\t\t\tfirstObserver.Dispose();\n\t\t\tsecondObserver.Dispose();\n\n\t\t\tvar fouthTreeFalls = \"A fourth tree falls in the forest\";\n\t\t\tsubject.OnNext(fouthTreeFalls);\n\n\t\t\t// The observers that have left should not in any way be affected\n\t\t\tAssert.That(firstList, Is.EquivalentTo(new[] { firstTreeFalls, secondTreeFalls, thirdTreeFalls }));\n\t\t\tAssert.That(secondList, Is.EquivalentTo(new[] { thirdTreeFalls }));\n\n\t\t\t// However, a third observer arriving would consume the one tree that fell after the other observers left\n\t\t\tvar thirdList = new List<string>();\n\t\t\tvar thirdObserver = subject.Subscribe(thirdList.Add);\n\t\t\tAssert.That(thirdList, Is.EquivalentTo(new[] { fouthTreeFalls }));\n\n\t\t\t// The first two observers should be unaffected by the new observer arriving too\n\t\t\tAssert.That(firstList, Is.EquivalentTo(new[] { firstTreeFalls, secondTreeFalls, thirdTreeFalls }));\n\t\t\tAssert.That(secondList, Is.EquivalentTo(new[] { thirdTreeFalls }));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/tests/ReportTest.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection;\nusing log4net;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Tests;\n\nnamespace Outracks.Fuse.Reporting.Tests\n{\n\tpublic class ReportTest\n\t{\n\t\tILog _log;\n\t\tTextWriter _outWriter;\n\t\tTextWriter _errorWriter;\n\t\tTextWriter _consoleOut;\n\t\tTextWriter _consoleError;\n\t\tReport _report;\n\n\t\t[Test]\n\t\tpublic void ByDefaultReportsToLogOnly()\n\t\t{\n\t\t\t_report.Info(42);\n\t\t\t_log.Received(1).Info(42, Arg.Any<Exception>());\n\t\t\t_outWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsToBothLogAndUserSpecifiedOred()\n\t\t{\n\t\t\t_report.Info(42, ReportTo.Log | ReportTo.User);\n\t\t\t_log.Received(1).Info(42, Arg.Any<Exception>());\n\t\t\t_outWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsToBothLogAndUserSpecifiedWithLogAndUser()\n\t\t{\n\t\t\t_report.Info(42, ReportTo.LogAndUser);\n\t\t\t_log.Received(1).Info(42, Arg.Any<Exception>());\n\t\t\t_outWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsToJustLog()\n\t\t{\n\t\t\t// ReSharper disable once RedundantArgumentDefaultValue\n\t\t\t_report.Info(42, ReportTo.Log);\n\t\t\t_log.Received(1).Info(42, Arg.Any<Exception>());\n\t\t\t_outWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsToJustUser()\n\t\t{\n\t\t\t_report.Info(42, ReportTo.User);\n\t\t\t_log.DidNotReceive().Info(42, Arg.Any<Exception>());\n\t\t\t_outWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsToJustCloud()\n\t\t{\n\t\t\t_report.Info(42, ReportTo.Headquarters);\n\t\t\t_log.DidNotReceive().Info(Arg.Any<object>(), Arg.Any<Exception>());\n\t\t\t_outWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsFatal()\n\t\t{\n\t\t\t_report.Fatal(42, null, ReportTo.LogAndUser);\n\t\t\tReportedTo(\"Fatal\");\n\t\t\t_outWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t\t_errorWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsError()\n\t\t{\n\t\t\t_report.Error(42, ReportTo.LogAndUser);\n\t\t\tReportedTo(\"Error\");\n\t\t\t_outWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t\t_errorWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsWarn()\n\t\t{\n\t\t\t_report.Warn(42, ReportTo.LogAndUser);\n\t\t\tReportedTo(\"Warn\");\n\t\t\t_outWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t\t_errorWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsInfo()\n\t\t{\n\t\t\t_report.Info(42, ReportTo.LogAndUser);\n\t\t\tReportedTo(\"Info\");\n\t\t\t_outWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t\t_errorWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsDebug()\n\t\t{\n\t\t\t_report.Debug(42, ReportTo.LogAndUser);\n\t\t\tReportedTo(\"Debug\");\n\t\t\t_outWriter.Received(1).WriteLine(Arg.Any<object>());\n\t\t\t_errorWriter.DidNotReceive().WriteLine(Arg.Any<object>());\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing\")]\n\t\tpublic void ReportsToCloudWhenProcessIsExiting()\n\t\t{\n\t\t\tRunTestProcess(\"ReportsToCloudWhenProcessIsExiting\");\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing\")]\n\t\tpublic void ReportsToCloudInUnhandledExceptionCallBack()\n\t\t{\n\t\t\tRunTestProcess(\"ReportsToCloudWhenProcessIsExiting\");\n\t\t}\n\n\t\tvoid ReportedTo(string m)\n\t\t{\n\t\t\t_log.Received(m.Equals(\"Fatal\") ? 1 : 0).Fatal(Arg.Any<object>(), Arg.Any<Exception>());\n\t\t\t_log.Received(m.Equals(\"Error\") ? 1 : 0).Error(Arg.Any<object>(), Arg.Any<Exception>());\n\t\t\t_log.Received(m.Equals(\"Warn\") ? 1 : 0).Warn(Arg.Any<object>(), Arg.Any<Exception>());\n\t\t\t_log.Received(m.Equals(\"Info\") ? 1 : 0).Info(Arg.Any<object>(), Arg.Any<Exception>());\n\t\t\t_log.Received(m.Equals(\"Debug\") ? 1 : 0).Debug(Arg.Any<object>(), Arg.Any<Exception>());\n\t\t}\n\n\t\tstatic Process RunTestProcess(string argument)\n\t\t{\n\t\t\treturn Helpers.RunTestProcess(argument, Assembly.GetExecutingAssembly());\n\n\t\t}\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_log = Substitute.For<ILog>();\n\t\t\t_outWriter = Substitute.For<TextWriter>();\n\t\t\t_errorWriter = Substitute.For<TextWriter>();\n\t\t\t_consoleOut = Console.Out;\n\t\t\t_consoleError = Console.Error;\n\t\t\tConsole.SetOut(_outWriter);\n\t\t\tConsole.SetError(_errorWriter);\n\t\t\t_report = new Report(_log, null);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tConsole.SetOut(_consoleOut);\n\t\t\tConsole.SetError(_consoleError);\n\t\t}\n\t}\n\n\t//Kept separate from the old tests until we get rid of log4net, will merge then\n\tpublic class SelectsCorrectBackend\n\t{\n\t\t[Test]\n\t\tpublic void WhenInitialisedWithoutLogClientLogsToILog()\n\t\t{\n\t\t\tvar log = Substitute.For<ILog>();\n\t\t\tvar report = new Report(log, null);\n\t\t\treport.Info(42);\n\t\t\tlog.Received(1).Info(42, Arg.Any<Exception>());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WhenInitialisedWithLogCLientLogsToLogClientAndNotILog()\n\t\t{\n\t\t\tvar client = Substitute.For<ILogClient>();\n\t\t\tvar log = Substitute.For<ILog>();\n\t\t\tvar report = new Report(log, client);\n\t\t\treport.Info(42);\n\t\t\tlog.DidNotReceive().Info(Arg.Any<object>(), Arg.Any<Exception>());\n\t\t\tclient.Received(1).Send(Arg.Any<string>());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/common/tests/RestrictToAttribute.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\nusing NUnit.Framework.Interfaces;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.Tests\n{\n\tpublic class RestrictToAttribute : Attribute, ITestAction\n\t{\n\t\tprivate readonly OS _os;\n\n\t\tpublic RestrictToAttribute(OS os)\n\t\t{\n\t\t\t_os = os;\n\t\t}\n\n\t\tpublic void BeforeTest(ITest test)\n\t\t{\n\t\t\tif (Platform.OperatingSystem != _os)\n\t\t\t{\n\t\t\t\tAssert.Ignore(\"Ignoring on \" + Platform.OperatingSystem);\n\t\t\t}\n\t\t}\n\n\t\tpublic void AfterTest(ITest test) { }\n\n\t\tpublic ActionTargets Targets { get { return new ActionTargets(); } }\n\t}\n}"
  },
  {
    "path": "src/common/tests/SingleActionQueueTests.cs",
    "content": "﻿using System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tclass SingleActionQueueTests\n\t{\n\t\t[Test]\n\t\tpublic void EnqueuingBeforeDequeuing()\n\t\t{\n\t\t\tvar q = new SingleActionQueue();\n\t\t\tvar didAction = false;\n\t\t\tq.Enqueue(() => didAction = true);\n\t\t\tq.Dequeue()();\n\t\t\tAssert.That(didAction, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DequeuingBeforeEnqueuing()\n\t\t{\n\t\t\tvar q = new SingleActionQueue();\n\t\t\tvar didAction = false;\n\t\t\tvar dequeue = Task.Run(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tq.Dequeue()();\n\t\t\t\t});\n\t\t\tThread.Sleep(1000); //Sorry :( Need to give task time to start and block, to avoid false positives\n\t\t\tq.Enqueue(() => didAction = true);\n\t\t\tdequeue.Wait();\n\t\t\tAssert.That(didAction, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EnqueuingReplacesActionInQueue()\n\t\t{\n\t\t\tvar q = new SingleActionQueue();\n\t\t\tvar value = 0;\n\t\t\tq.Enqueue(() => { value = 1; });\n\t\t\tq.Enqueue(() => { value = 2; });\n\t\t\tq.Enqueue(() => { value = 3; });\n\t\t\tq.Dequeue()();\n\t\t\tAssert.That(value, Is.EqualTo(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnlyDequeuesActionOnce()\n\t\t{\n\t\t\tvar q = new SingleActionQueue();\n\t\t\tint dequeues = 0;\n\t\t\tTask.Run(() => q.Dequeue()());\n\t\t\tTask.Run(() => q.Dequeue()());\n\t\t\tq.Enqueue(() => Interlocked.Increment(ref dequeues));\n\t\t\tThread.Sleep(1000); //Again, sorry :(\n\t\t\tAssert.That(dequeues, Is.EqualTo(1));\n\t\t}\n\n\t\t//Should ideally have been tested more, but it's very hard to test concurrent stuff like this properly\n\t}\n}\n"
  },
  {
    "path": "src/common/tests/SubscribeUsing.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive.Subjects;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tclass SubscribeUsing\n\t{\n\t\t[Test]\n\t\tpublic void SubscribeUsingTest01()\n\t\t{\n\t\t\tvar foo = new Subject<int>();\n\t\t\tvar results = new List<int>();\n\t\t\tvar sub = foo.SubscribeUsing(\n\t\t\t\ti =>\n\t\t\t\t{\n\t\t\t\t\treturn Disposable.Create(() => results.Add(i));\n\t\t\t\t});\n\t\t\tfoo.OnNext(1);\n\t\t\tfoo.OnNext(2);\n\t\t\tfoo.OnNext(3);\n\t\t\tsub.Dispose();\n\n\t\t\tAssert.IsTrue(results.Contains(1), \"Expected first element to be disposed.\");\n\t\t\tAssert.IsTrue(results.Contains(2), \"Expected second element to be disposed.\");\n\t\t\tAssert.IsTrue(results.Contains(3), \"Expected third element to be disposed.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SubscribeUsingTest02()\n\t\t{\n\t\t\tvar foo = new Subject<int>();\n\t\t\tvar results = new List<int>();\n\t\t\tfoo.SubscribeUsing(\n\t\t\t\ti =>\n\t\t\t\t{\n\t\t\t\t\treturn Disposable.Create(() => results.Add(i));\n\t\t\t\t});\n\t\t\tfoo.OnNext(1);\n\t\t\tfoo.OnNext(2);\n\t\t\tfoo.OnNext(3);\n\n\t\t\tAssert.IsTrue(results.Contains(1), \"Expected first element to be disposed.\");\n\t\t\tAssert.IsTrue(results.Contains(2), \"Expected second element to be disposed.\");\n\t\t\tAssert.IsFalse(results.Contains(3), \"Didn't expect third element to be disposed.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SubscribeUsingTest03()\n\t\t{\n\t\t\tvar foo = new Subject<int>();\n\t\t\tvar results = new List<int>();\n\t\t\tfoo.SubscribeUsing(\n\t\t\t\ti =>\n\t\t\t\t{\n\t\t\t\t\treturn Disposable.Create(() => results.Add(i));\n\t\t\t\t});\n\t\t\tfoo.OnNext(1);\n\t\t\tfoo.OnNext(2);\n\t\t\tfoo.OnError(new Exception(\"Haha\"));\n\t\t\tfoo.OnNext(3);\n\n\t\t\tAssert.IsTrue(results.Contains(1), \"Expected first element to be disposed.\");\n\t\t\tAssert.IsFalse(results.Contains(2), \"Didn't expect second element to be disposed.\");\n\t\t\tAssert.IsFalse(results.Contains(3), \"Didn't expect third element to be disposed.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SubscribeUsingTest04()\n\t\t{\n\t\t\tvar foo = new Subject<int>();\n\t\t\tvar results = new List<int>();\n\t\t\tvar sub = foo.SubscribeUsing(\n\t\t\t\ti =>\n\t\t\t\t{\n\t\t\t\t\treturn Disposable.Create(() => results.Add(i));\n\t\t\t\t});\n\t\t\tfoo.OnNext(1);\n\t\t\tfoo.OnNext(2);\n\t\t\tfoo.OnError(new Exception(\"Haha\"));\n\t\t\tfoo.OnNext(3);\n\t\t\tsub.Dispose();\n\n\t\t\tAssert.IsTrue(results.Contains(1), \"Expected first element to be disposed.\");\n\t\t\tAssert.IsTrue(results.Contains(2), \"Expected second element to be disposed.\");\n\t\t\tAssert.IsFalse(results.Contains(3), \"Didn't expect third element to be disposed.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SubscribeUsingTest05()\n\t\t{\n\t\t\tvar foo = new Subject<int>();\n\t\t\tvar results = new List<int>();\n\t\t\tvar sub = foo.SubscribeUsing(\n\t\t\t\ti =>\n\t\t\t\t{\n\t\t\t\t\treturn Disposable.Create(() => results.Add(i));\n\t\t\t\t});\n\t\t\tfoo.OnNext(1);\n\t\t\tfoo.OnNext(2);\n\t\t\tfoo.OnCompleted();\n\t\t\tfoo.OnNext(3);\n\t\t\tsub.Dispose();\n\n\t\t\tAssert.IsTrue(results.Contains(1), \"Expected first element to be disposed.\");\n\t\t\tAssert.IsTrue(results.Contains(2), \"Expected second element to be disposed.\");\n\t\t\tAssert.IsFalse(results.Contains(3), \"Didn't expect third element to be disposed.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SubscribeUsingTest06()\n\t\t{\n\t\t\tvar foo = new Subject<int>();\n\t\t\tvar results = new List<int>();\n\t\t\tfoo.SubscribeUsing(\n\t\t\t\ti =>\n\t\t\t\t{\n\t\t\t\t\treturn Disposable.Create(() => results.Add(i));\n\t\t\t\t});\n\t\t\tfoo.OnNext(1);\n\t\t\tfoo.OnNext(2);\n\t\t\tfoo.OnCompleted();\n\t\t\tfoo.OnNext(3);\n\n\t\t\tAssert.IsTrue(results.Contains(1), \"Expected first element to be disposed.\");\n\t\t\tAssert.IsFalse(results.Contains(2), \"Didn't expect second element to be disposed.\");\n\t\t\tAssert.IsFalse(results.Contains(3), \"Didn't expect third element to be disposed.\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/TextPositionTests.cs",
    "content": "﻿using System;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tclass TextPositionTests\n\t{\n\t\t[Test]\n\t\tpublic void ToOffsetTest01()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\ne\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(1), new CharacterNumber(1));\n\n\t\t\tvar result = textPos.ToOffset(foo);\n\t\t\tAssert.IsTrue(result == 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest02()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\ne\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(2), new CharacterNumber(1));\n\n\t\t\tvar result = textPos.ToOffset(foo);\n\t\t\tAssert.IsTrue(result == 29);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest03()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\ne\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(2), new CharacterNumber(2));\n\n\t\t\tvar result = textPos.ToOffset(foo);\n\t\t\tAssert.IsTrue(result == 30);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest04()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\ne\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(3), new CharacterNumber(2));\n\n\t\t\tAssert.Throws<IndexOutOfRangeException>(() => textPos.ToOffset(foo));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest05()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\ne\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(2), new CharacterNumber(3));\n\n\t\t\tAssert.Throws<IndexOutOfRangeException>(() => textPos.ToOffset(foo));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest06()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\n\" +\n\t\t\t\t\"foo bar\\n\" +\n\t\t\t\t\"ehhe\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(3), new CharacterNumber(3));\n\n\t\t\tAssert.True(textPos.ToOffset(foo) == 39);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest07()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\n\" +\n\t\t\t\t\"foo bar\\n\" +\n\t\t\t\t\"ehhe\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(3), new CharacterNumber(5));\n\n\t\t\tAssert.True(textPos.ToOffset(foo) == 41);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest08()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\n\" +\n\t\t\t\t\"foo bar\\r\\n\" +\n\t\t\t\t\"ehhe\\r\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(3), new CharacterNumber(5));\n\n\t\t\tAssert.True(textPos.ToOffset(foo) == 41);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest09()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\n\" +\n\t\t\t\t\"foo bar\\r\\n\" +\n\t\t\t\t\"ehhe\\r\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(2), new CharacterNumber(8));\n\n\t\t\tAssert.True(textPos.ToOffset(foo) == 36);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest10()\n\t\t{\n\t\t\tvar foo = \"hahasd this is so funn......\\n\" +\n\t\t\t\t\"foo bar\\r\\n\" +\n\t\t\t\t\"ehhe\\r\";\n\t\t\tvar textPos = new TextPosition(new LineNumber(3), new CharacterNumber(6));\n\n\t\t\tAssert.Throws<IndexOutOfRangeException>(() => textPos.ToOffset(foo));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ToOffsetTest11()\n\t\t{\n\t\t\tvar fooNewLine = \"hahasd this is so funn......\\n\" +\n\t\t\t\t\"foo bar\\n\" +\n\t\t\t\t\"ehhe\";\n\n\t\t\tvar fooCariage = \"hahasd this is so funn......\\r\\n\" +\n\t\t\t\t\"foo bar\\r\\n\" +\n\t\t\t\t\"ehhe\\r\\n\";\n\n\t\t\tvar textPos = new TextPosition(new LineNumber(2), new CharacterNumber(4));\n\n\t\t\tvar onlyNewLine = textPos.ToOffset(fooNewLine);\n\t\t\tvar notNewline = textPos.ToOffset(fooCariage);\n\t\t\tAssert.True(onlyNewLine == notNewline);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/tests/WithLatestFrom.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tclass WithLatestFrom\n\t{\n\t\t[Test]\n\t\tpublic void ColdStreamAndColdSampler()\n\t\t{\n\t\t\tvar stream = Observable.Return(\"lick\");\n\t\t\tvar sampler = Observable.Return(\"tick\");\n\n\t\t\tvar results = new List<string>();\n\t\t\tvar errors = new List<Exception>();\n\t\t\tvar completed = new List<Unit>();\n\t\t\tstream.WithLatestFromBuffered(sampler, (a, b) => a).Subscribe(\n\t\t\t\tr =>\n\t\t\t\t\tresults.Add(r),\n\t\t\t\terrors.Add,\n\t\t\t\t() => completed.Add(Unit.Default));\n\n\t\t\tAssert.AreEqual(1, results.Count, \"OnNext\");\n\t\t\tAssert.AreEqual(0, errors.Count, \"OnError\");\n\t\t\tAssert.AreEqual(1, completed.Count, \"OnCompleted\");\n\n\t\t\tAssert.AreEqual(results[0], \"lick\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ColdStreamAndHotSampler()\n\t\t{\n\t\t\tvar stream = Observable.Return(\"lick\");\n\t\t\tvar sampler = new Subject<Unit>();\n\n\t\t\tvar results = new List<string>();\n\t\t\tvar errors = new List<Exception>();\n\t\t\tvar completed = new List<Unit>();\n\t\t\tstream.WithLatestFromBuffered(sampler, (a, b) => a).Subscribe(\n\t\t\t\tresults.Add,\n\t\t\t\terrors.Add,\n\t\t\t\t() => completed.Add(Unit.Default));\n\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tsampler.OnNext(Unit.Default);\n\n\t\t\tAssert.AreEqual(0, results.Count, \"OnNext\");\n\t\t\tAssert.AreEqual(0, errors.Count, \"OnError\");\n\n\t\t\tsampler.OnCompleted();\n\n\t\t\tAssert.AreEqual(1, completed.Count, \"OnCompleted\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HotStreamAndHotSampler()\n\t\t{\n\t\t\tvar stream = new Subject<string>();\n\t\t\tvar sampler = new Subject<Unit>();\n\n\t\t\tvar results = new List<string>();\n\t\t\tvar errors = new List<Exception>();\n\t\t\tvar completed = new List<Unit>();\n\t\t\tstream.WithLatestFromBuffered(sampler, (a, b) => a).Subscribe(\n\t\t\t\tresults.Add,\n\t\t\t\terrors.Add,\n\t\t\t\t() => completed.Add(Unit.Default));\n\n\t\t\tstream.OnNext(\"dropped\");\n\t\t\tstream.OnNext(\"emitted\");\n\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tsampler.OnNext(Unit.Default);\n\n\t\t\tAssert.AreEqual(1, results.Count, \"OnNext\");\n\t\t\tAssert.AreEqual(0, errors.Count, \"OnError\");\n\n\t\t\tstream.OnCompleted();\n\n\t\t\tAssert.AreEqual(1, completed.Count, \"OnCompleted\");\n\n\t\t\tAssert.AreEqual(\"emitted\", results[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HotStreamAndHotSampler2()\n\t\t{\n\t\t\tvar stream = new Subject<string>();\n\t\t\tvar sampler = new Subject<Unit>();\n\n\t\t\tvar results = new List<string>();\n\t\t\tvar errors = new List<Exception>();\n\t\t\tvar completed = new List<Unit>();\n\n\t\t\tstream.WithLatestFromBuffered(sampler, (a, b) => a).Subscribe(\n\t\t\t\tresults.Add,\n\t\t\t\terrors.Add,\n\t\t\t\t() => completed.Add(Unit.Default));\n\n\t\t\tstream.OnNext(\"emitted\");\n\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tAssert.AreEqual(1, results.Count, \"OnNext\");\n\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tAssert.AreEqual(1, results.Count, \"OnNext\");\n\n\t\t\tstream.OnNext(\"emitted2\");\n\t\t\tAssert.AreEqual(2, results.Count, \"OnNext\");\n\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tAssert.AreEqual(2, results.Count, \"OnNext\");\n\n\t\t\tstream.OnNext(\"emitted3\");\n\t\t\tAssert.AreEqual(3, results.Count, \"OnNext\");\n\n\t\t\tAssert.AreEqual(0, errors.Count, \"OnError\");\n\n\t\t\tstream.OnCompleted();\n\n\t\t\tAssert.AreEqual(1, completed.Count, \"OnCompleted\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HotStreamAndColdSampler()\n\t\t{\n\t\t\tvar stream = new Subject<string>();\n\t\t\tvar sampler = Observable.Return(\"tick\");\n\n\t\t\tvar results = new List<string>();\n\t\t\tvar errors = new List<Exception>();\n\t\t\tvar completed = new List<Unit>();\n\t\t\tstream.WithLatestFromBuffered(sampler, (a, b) => a).Subscribe(\n\t\t\t\tresults.Add,\n\t\t\t\terrors.Add,\n\t\t\t\t() => completed.Add(Unit.Default));\n\n\t\t\tstream.OnNext(\"emitted\");\n\n\t\t\tAssert.AreEqual(1, results.Count, \"OnNext\");\n\t\t\tAssert.AreEqual(0, errors.Count, \"OnError\");\n\n\t\t\tstream.OnCompleted();\n\n\t\t\tAssert.AreEqual(1, completed.Count, \"OnCompleted\");\n\n\t\t\tAssert.AreEqual(\"emitted\", results[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EmptyStreamAndHotSampler()\n\t\t{\n\t\t\tvar stream = Observable.Empty<string>();\n\t\t\tvar sampler = new Subject<Unit>();\n\n\t\t\tvar results = new List<string>();\n\t\t\tvar errors = new List<Exception>();\n\t\t\tvar completed = new List<Unit>();\n\t\t\tstream.WithLatestFromBuffered(sampler, (a, b) => a).Subscribe(\n\t\t\t\tresults.Add,\n\t\t\t\terrors.Add,\n\t\t\t\t() => completed.Add(Unit.Default));\n\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tsampler.OnNext(Unit.Default);\n\t\t\tsampler.OnNext(Unit.Default);\n\n\t\t\tAssert.AreEqual(0, results.Count, \"OnNext\");\n\t\t\tAssert.AreEqual(0, errors.Count, \"OnError\");\n\n\t\t\tsampler.OnCompleted();\n\n\t\t\tAssert.AreEqual(1, completed.Count, \"OnCompleted\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ColdStreamAndEmptySampler()\n\t\t{\n\t\t\tvar stream = Observable.Return(\"Hello World\");\n\t\t\tvar sampler = Observable.Empty<Unit>();\n\n\t\t\tvar results = new List<string>();\n\t\t\tvar errors = new List<Exception>();\n\t\t\tvar completed = new List<Unit>();\n\t\t\tstream.WithLatestFromBuffered(sampler, (a, b) => a).Subscribe(\n\t\t\t\tresults.Add,\n\t\t\t\terrors.Add,\n\t\t\t\t() => completed.Add(Unit.Default));\n\n\t\t\tAssert.AreEqual(0, results.Count, \"OnNext\");\n\t\t\tAssert.AreEqual(0, errors.Count, \"OnError\");\n\t\t\tAssert.AreEqual(1, completed.Count, \"OnCompleted\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/common/tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Threading.Tasks.Extensions\" publicKeyToken=\"cc7b13ffcd2ddd51\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.2.0.1\" newVersion=\"4.2.0.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Runtime.CompilerServices.Unsafe\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.6.0\" newVersion=\"4.0.6.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/common/tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Castle.Core\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"log4net\" version=\"2.0.12\" targetFramework=\"net46\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"NSubstitute\" version=\"4.2.2\" targetFramework=\"net46\" />\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.7.1\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net45\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/common/text/CharacterNumber.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\t/// <summary>\n\t/// 1-indexed column/character index.\n\t/// One tab advances one Character.\n\t/// One multi-byte character advances one Character.\n\t/// The first character of a line will always have Character == 1, indifferent of CR.\n\t/// </summary>\n\tpublic struct CharacterNumber : IComparable<CharacterNumber>, IEquatable<CharacterNumber>\n\t{\n\t\treadonly int _characterMinusOne;\n\n\t\tpublic CharacterNumber(int character)\n\t\t{\n\t\t\tif (character <= 0) throw new ArgumentOutOfRangeException(\"character\", \"CharacterNumber must be >= 1\");\n\t\t\t_characterMinusOne = character - 1;\n\t\t}\n\n\t\tpublic static implicit operator int(CharacterNumber line)\n\t\t{\n\t\t\treturn line._characterMinusOne + 1;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ((int) this).ToString();\n\t\t}\n\n\t\tpublic bool Equals(CharacterNumber other)\n\t\t{\n\t\t\treturn _characterMinusOne == other._characterMinusOne;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is CharacterNumber && Equals((CharacterNumber)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator ==(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator <(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne < right._characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne > right._characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator <=(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne <= right._characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >=(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne >= right._characterMinusOne;\n\t\t}\n\n\t\tpublic int CompareTo(CharacterNumber other)\n\t\t{\n\t\t\treturn _characterMinusOne.CompareTo(other._characterMinusOne);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/text/FilePosition.cs",
    "content": "using System;\nusing System.IO;\nusing Outracks.IO;\n\nnamespace Outracks\n{\n\tpublic struct FilePosition : IEquatable<FilePosition>\n\t{\n\t\tpublic readonly AbsoluteFilePath File;\n\t\tpublic readonly TextPosition Position;\n\n\t\tpublic FilePosition(AbsoluteFilePath file, TextPosition position)\n\t\t{\n\t\t\tPosition = position;\n\t\t\tFile = file;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is FilePosition && Equals((FilePosition) obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (File.GetHashCode() * 397) ^ Position.GetHashCode();\n\t\t}\n\n\t\tpublic bool Equals(FilePosition other)\n\t\t{\n\t\t\treturn File == other.File && Position == other.Position;\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, FilePosition position)\n\t\t{\n\t\t\tAbsoluteFilePath.Write(writer, position.File);\n\t\t\tTextPosition.Write(writer, position.Position);\n\t\t}\n\n\t\tpublic static FilePosition Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new FilePosition(\n\t\t\t\tAbsoluteFilePath.Read(reader),\n\t\t\t\tTextPosition.Read(reader));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/text/LineNumber.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\t/// <summary>\n\t/// 1-indexed line number\n\t/// </summary>\n\tpublic struct LineNumber : IComparable<LineNumber>, IEquatable<LineNumber>\n\t{\n\t\treadonly int _lineMinusOne;\n\n\t\tpublic LineNumber(int line)\n\t\t{\n\t\t\tif (line <= 0) throw new ArgumentOutOfRangeException(\"line\", \"LineNumber must be >= 1\");\n\t\t\t_lineMinusOne = line - 1;\n\t\t}\n\n\t\tpublic static implicit operator int(LineNumber line)\n\t\t{\n\t\t\treturn line._lineMinusOne + 1;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ((int)this).ToString();\n\t\t}\n\n\t\tpublic bool Equals(LineNumber other)\n\t\t{\n\t\t\treturn _lineMinusOne == other._lineMinusOne;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is LineNumber && Equals((LineNumber)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator ==(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator <(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne < right._lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne > right._lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator <=(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne <= right._lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >=(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne >= right._lineMinusOne;\n\t\t}\n\n\t\tpublic int CompareTo(LineNumber other)\n\t\t{\n\t\t\treturn _lineMinusOne.CompareTo(other._lineMinusOne);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/text/Outracks.Text.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Text</RootNamespace>\n    <AssemblyName>Outracks.Text</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"CharacterNumber.cs\" />\n    <Compile Include=\"FilePosition.cs\" />\n    <Compile Include=\"LineNumber.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"TextOffset.cs\" />\n    <Compile Include=\"TextOffsetConversion.cs\" />\n    <Compile Include=\"TextPosition.cs\" />\n    <Compile Include=\"TextRegion.cs\" />\n    <Compile Include=\"TextScanner.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/common/text/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Text\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/common/text/TextOffset.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic class TextOffset : IComparable<TextOffset>\n\t{\n\t\treadonly int _offset;\n\n\t\tpublic TextOffset(int offset)\n\t\t{\n\t\t\t_offset = offset;\n\t\t}\n\n\t\tpublic static implicit operator int(TextOffset d)\n\t\t{\n\t\t\treturn d._offset;\n\t\t}\n\n\t\tpublic int CompareTo(TextOffset other)\n\t\t{\n\t\t\treturn _offset.CompareTo(other._offset);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"@\"+_offset;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _offset.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is TextOffset && Equals((TextOffset)obj);\n\t\t}\n\n\t\tpublic bool Equals(TextOffset other)\n\t\t{\n\t\t\treturn _offset == other._offset;\n\t\t}\n\n\t\tpublic static bool operator ==(TextOffset a, TextOffset b)\n\t\t{\n\t\t\tif ((object)a == null)\n\t\t\t\treturn (object)b == null;\n\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic static bool operator !=(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\n\t\tpublic static bool operator <(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset < b._offset;\n\t\t}\n\n\t\tpublic static bool operator >(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset > b._offset;\n\t\t}\n\n\t\tpublic static bool operator <=(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset <= b._offset;\n\t\t}\n\n\t\tpublic static bool operator >=(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset >= b._offset;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/text/TextOffsetConversion.cs",
    "content": "using System;\nusing System.Diagnostics.Contracts;\n\nnamespace Outracks\n{\n\tpublic static class TextOffsetConversion\n\t{\n\t\t/// <summary>\n\t\t/// Returns the offset in the data string based on this text position.\n\t\t/// A multi-byte character advances the offset with one.\n\t\t/// A newline advances the offset with one, and offset is not affected by CR.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\t[Pure]\n\t\tpublic static TextOffset ToOffset(this TextPosition pos, string data)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(data))\n\t\t\t\tthrow new ArgumentNullException(data);\n\n\t\t\tvar lines = data.Split(\"\\n\");\n\t\t\tif (pos.Line < 1 || pos.Line > lines.Length)\n\t\t\t\tthrow new IndexOutOfRangeException(\"Text offset is out of range\");\n\n\t\t\tvar sizeOfDataBefore = 0;\n\t\t\tfor (var i = 0; i < pos.Line - 1; ++i)\n\t\t\t{\n\t\t\t\tsizeOfDataBefore += lines[i].Replace(\"\\r\", \"\").Length + 1;\n\t\t\t}\n\n\t\t\tvar line = lines[pos.Line - 1].Replace(\"\\r\", \"\");\n\t\t\tif (pos.Character < 1 || pos.Character - 1 > line.Length)\n\t\t\t\tthrow new IndexOutOfRangeException(\"Text offset is out of range\");\n\n\t\t\treturn new TextOffset(sizeOfDataBefore + pos.Character - 1);\n\t\t}\n\n\t\t[Pure]\n\t\tpublic static TextPosition ToPosition(this TextOffset offset, string data)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(data))\n\t\t\t\tthrow new ArgumentNullException(data);\n\n\t\t\tvar lines = data.Replace(\"\\r\", \"\").Split(\"\\n\");\n\t\t\tvar numLinesBeforeOffset = 0;\n\t\t\tvar pos = 0;\n\t\t\tfor (var i = 0; i < lines.Length; ++i)\n\t\t\t{\n\t\t\t\tif (offset < pos + lines[i].Length + 1)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t++numLinesBeforeOffset;\n\t\t\t\tpos += lines[i].Length + 1;\n\t\t\t}\n\n\t\t\tvar character = offset - pos;\n\n\t\t\treturn new TextPosition(\n\t\t\t\tnew LineNumber(numLinesBeforeOffset + 1),\n\t\t\t\tnew CharacterNumber(character + 1));\n\t\t}\n\n\t\t[Pure]\n\t\tpublic static TextPosition OffsetBy(this TextPosition pos, int characters, string code)\n\t\t{\n\t\t\treturn new TextOffset(pos.ToOffset(code) + characters).ToPosition(code);\n\t\t}\n\n\t\t[Pure]\n\t\tpublic static TextRegion OffsetBy(this TextRegion region, int characters, string code)\n\t\t{\n\t\t\treturn new TextRegion(\n\t\t\t\tregion.From.OffsetBy(characters, code),\n\t\t\t\tregion.To.OffsetBy(characters, code));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/text/TextPosition.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic struct TextPosition : IEquatable<TextPosition>\n\t{\n\t\tpublic readonly LineNumber Line;\n\t\tpublic readonly CharacterNumber Character;\n\n\t\tpublic TextPosition(LineNumber line, CharacterNumber character)\n\t\t{\n\t\t\tLine = line;\n\t\t\tCharacter = character;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Line + \":\" + Character;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Line.GetHashCode() ^ Character.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is TextPosition && Equals((TextPosition)obj);\n\t\t}\n\n\t\tpublic bool Equals(TextPosition other)\n\t\t{\n\t\t\treturn Line == other.Line && Character == other.Character;\n\t\t}\n\n\t\tpublic static bool operator ==(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic static bool operator !=(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\n\t\tpublic static bool operator <(TextPosition a, TextPosition b)\n\t\t{\n\t\t\tif (a.Line < b.Line) return true;\n\t\t\tif (a.Line > b.Line) return false;\n\t\t\treturn a.Character < b.Character;\n\t\t}\n\n\t\tpublic static bool operator >(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn a != b && !(a < b);\n\t\t}\n\n\t\tpublic static bool operator <=(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn  a == b || a < b;\n\t\t}\n\n\t\tpublic static bool operator >=(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn a == b || a > b;\n\t\t}\n\n\t\tpublic static TextPosition Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new TextPosition(\n\t\t\t\tnew LineNumber(reader.ReadInt32()),\n\t\t\t\tnew CharacterNumber(reader.ReadInt32()));\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, TextPosition value)\n\t\t{\n\t\t\twriter.Write(value.Line);\n\t\t\twriter.Write(value.Character);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/common/text/TextRegion.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic struct TextRegion : IEquatable<TextRegion>\n\t{\n\t\tpublic readonly TextPosition From;\n\t\tpublic readonly TextPosition To; // TODO: figure out if this should be inclusive or not\n\n\t\tpublic TextRegion(TextPosition from, TextPosition to)\n\t\t{\n\t\t\tif (from > to) throw new ArgumentException(\"from-position can not be after to-position\"); // TODO: potentially update this when figured out\n\t\t\tFrom = from;\n\t\t\tTo = to;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[\" + From + \", \" + To + \"] or >\"; // TODO: update this when figured out\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn From.GetHashCode() ^ To.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is TextRegion && Equals((TextRegion)obj);\n\t\t}\n\n\t\tpublic bool Equals(TextRegion other)\n\t\t{\n\t\t\treturn From == other.From && To == other.To;\n\t\t}\n\n\t\tpublic static bool operator ==(TextRegion a, TextRegion b)\n\t\t{\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic static bool operator !=(TextRegion a, TextRegion b)\n\t\t{\n\t\t\treturn !a.Equals(b);\n\t\t}\n\n\t\tpublic static TextRegion Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new TextRegion(TextPosition.Read(reader), TextPosition.Read(reader));\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, TextRegion value)\n\t\t{\n\t\t\tTextPosition.Write(writer, value.From);\n\t\t\tTextPosition.Write(writer, value.To);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/text/TextScanner.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic class Line\n\t{\n\t\tpublic readonly string Data;\n\t\tpublic readonly Interval<TextOffset> Span;\n\n\t\tpublic Line(string data, Interval<TextOffset> span)\n\t\t{\n\t\t\tData = data;\n\t\t\tSpan = span;\n\t\t}\n\t}\n\n\n\tpublic class TextScanner\n\t{\n\t\treadonly string _text;\n\n\t\tpublic TextOffset Position { get; private set; }\n\n\t\tpublic TextOffset End\n\t\t{\n\t\t\tget { return new TextOffset(_text.Length); }\n\t\t}\n\n\t\tpublic bool ReachedEnd { get { return Position >= End; } }\n\n\t\tpublic TextScanner(string text)\n\t\t{\n\t\t\t_text = text;\n\t\t\tPosition = new TextOffset(0);\n\t\t}\n\n\t\tpublic Optional<TextOffset> ScanTo(string pattern)\n\t\t{\n\t\t\tvar index = _text.IndexOf(pattern, Position, StringComparison.Ordinal);\n\t\t\tif (index == -1)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\n\t\t\tPosition = new TextOffset(index + pattern.Length);\n\t\t\treturn new TextOffset(index);\n\t\t}\n\n\t\tpublic bool IsNext(string pattern)\n\t\t{\n\t\t\tvar index = PeekTo(pattern);\n\t\t\treturn index == Position;\n\t\t}\n\n\t\tpublic Optional<TextOffset> ScanToAny(char []patterns)\n\t\t{\n\t\t\tvar index = _text.IndexOfAny(patterns, Position);\n\t\t\tif (index == -1)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\n\t\t\tPosition = new TextOffset(index + 1);\n\t\t\treturn new TextOffset(index);\n\t\t}\n\n\t\tpublic Optional<TextOffset> PeekTo(string pattern)\n\t\t{\n\t\t\tvar index = _text.IndexOf(pattern, Position, StringComparison.Ordinal);\n\t\t\tif (index == -1)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\n\t\t\treturn new TextOffset(index);\n\t\t}\n\n\t\tpublic Optional<TextOffset> PeekToAnyPattern(string[] patterns)\n\t\t{\n\t\t\tvar endIndex = new TextOffset(End + 1);\n\t\t\tvar currentIndex = endIndex;\n\t\t\tforeach (var pattern in patterns)\n\t\t\t{\n\t\t\t\tvar index = PeekTo(pattern);\n\t\t\t\tif (index.HasValue && index.Value < currentIndex)\n\t\t\t\t{\n\t\t\t\t\tcurrentIndex = index.Value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn currentIndex < endIndex ? Optional.Some(currentIndex) : Optional.None();\n\t\t}\n\n\t\tpublic string ReadTo(TextOffset end)\n\t\t{\n\t\t\tvar text = _text.Substring(Position, end - Position);\n\t\t\tPosition = new TextOffset(end);\n\n\t\t\treturn text;\n\t\t}\n\n\t\tpublic string GetLineContaining(TextOffset offset)\n\t\t{\n\t\t\tvar lastLineStart = 0;\n\t\t\tvar currentLineStart = 0;\n\t\t\tfor(var i = 0;i < _text.Length;++i)\n\t\t\t{\n\t\t\t\tif (_text[i] == '\\n')\n\t\t\t\t{\n\t\t\t\t\tlastLineStart = currentLineStart;\n\t\t\t\t\tcurrentLineStart = i;\n\t\t\t\t}\n\n\t\t\t\tif (offset <= currentLineStart && offset >= lastLineStart)\n\t\t\t\t{\n\t\t\t\t\treturn _text.Substring(lastLineStart, currentLineStart - lastLineStart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new ArgumentOutOfRangeException(\"offset\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/common/text/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/entrypoint/cli/Entrypoint.cs",
    "content": "using System;\nusing System.Linq;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class Entrypoint\n\t{\n\t\t[STAThread]\n\t\tpublic static int Main(string[] cmdArgs)\n\t\t{\n\t\t\treturn Program.Run(cmdArgs.ToList());\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/entrypoint/cli/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"fuse X\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/entrypoint/cli/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"NuGet.Packaging\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.5.0.4\" newVersion=\"4.5.0.4\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.7.0.0\" newVersion=\"4.7.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Runtime.CompilerServices.Unsafe\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.4.1\" newVersion=\"4.0.4.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Xml.XmlDocument\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/entrypoint/cli/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n  <assemblyIdentity version=\"1.0.0.0\" name=\"MyApplication.app\"/>\n  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n    <security>\n      <requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        <!-- UAC Manifest Options\n             If you want to change the Windows User Account Control level replace the \n             requestedExecutionLevel node with one of the following.\n\n        <requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n        <requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n            Specifying requestedExecutionLevel element will disable file and registry virtualization. \n            Remove this element if your application requires this virtualization for backwards\n            compatibility.\n        -->\n        <requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\" />\n      </requestedPrivileges>\n    </security>\n  </trustInfo>\n\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n    <application>\n      <!-- A list of the Windows versions that this application has been tested on and is\n           is designed to work with. Uncomment the appropriate elements and Windows will \n           automatically selected the most compatible environment. -->\n\n      <!-- Windows Vista -->\n      <supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\" />\n\n      <!-- Windows 7 -->\n      <supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\" />\n\n      <!-- Windows 8 -->\n      <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\" />\n\n      <!-- Windows 8.1 -->\n      <supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\" />\n\n      <!-- Windows 10 -->\n      <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\" />\n\n    </application>\n  </compatibility>\n\n  <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher\n       DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need \n       to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should \n       also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->\n  <!--\n  <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <windowsSettings>\n      <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>\n    </windowsSettings>\n  </application>\n  -->\n\n  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n  <!--\n  <dependency>\n    <dependentAssembly>\n      <assemblyIdentity\n          type=\"win32\"\n          name=\"Microsoft.Windows.Common-Controls\"\n          version=\"6.0.0.0\"\n          processorArchitecture=\"*\"\n          publicKeyToken=\"6595b64144ccf1df\"\n          language=\"*\"\n        />\n    </dependentAssembly>\n  </dependency>\n  -->\n\n</assembly>\n"
  },
  {
    "path": "src/entrypoint/cli/fuse.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\node_modules\\%40fuse-open\\xamarin-mac\\FuseOpen.Xamarin.Mac.props\" Condition=\"Exists('..\\..\\..\\node_modules\\%40fuse-open\\xamarin-mac\\FuseOpen.Xamarin.Mac.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{2FDE3363-73F5-433E-ADCF-1130658B5C52}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse</RootNamespace>\n    <AssemblyName>fuse</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>$(SolutionDir)bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>$(SolutionDir)bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>Outracks.Fuse.Entrypoint</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>Fuse.ico</ApplicationIcon>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\log4net.2.0.12\\lib\\net45\\log4net.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"System.Web\" />\n    <Reference Include=\"uno\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\uno.exe</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Entrypoint.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fuse\\command\\Outracks.Fuse.Command.csproj\">\n      <Project>{8B6673C5-58B8-4E5A-8369-2E21507F4131}</Project>\n      <Name>Outracks.Fuse.Command</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"app.manifest\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Fuse.ico\" />\n    <Content Include=\"fuse.js\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </Content>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/entrypoint/cli/fuse.js",
    "content": "#!/usr/bin/env node\nconst path = require('path');\nconst {spawn} = require('child_process');\n\nspawn(path.join(__dirname,\n            path.sep == '\\\\'\n                ? \"fuse.exe\"\n                : \"fuse\"),\n        process.argv.splice(2),\n        {stdio: 'inherit'})\n    .on('exit', process.exit);\n"
  },
  {
    "path": "src/entrypoint/cli/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"log4net\" version=\"2.0.12\" targetFramework=\"net46\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/entrypoint/code-assistance/CodeCompletionInstance.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.CodeCompletion;\nusing Outracks.CodeCompletionFactory;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\nusing Uno;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tpublic class CodeCompletionInstance : IDisposable\n\t{\n\t\treadonly IGotoDefinitionFactory _gotoDefinitionFactory;\n\t\treadonly ISuggestionsFactory _suggestionsFactory;\n\t\treadonly Engine _engine;\n\n\t\tpublic CodeCompletionInstance(ProjectDetector projectDetector)\n\t\t{\n\t\t\t_gotoDefinitionFactory = new GotoDefinitionFactory();\n\t\t\t_suggestionsFactory = new SuggestionsFactory();\n\t\t\t_engine = new Engine(projectDetector);\n\t\t}\n\n\t\tpublic GotoDefinitionResponse HandleGotoDefinition(GotoDefinitionRequest gotoDefinitionRequest)\n\t\t{\n\t\t\t// TODO: Refactor away this type of error handling...\n\t\t\tvar errors = new Subject<Error>();\n\t\t\terrors.Subscribe(e => { throw new Exception(e.Message); });\n\n\t\t\tvar source = ProcessGotoDefintion(gotoDefinitionRequest, errors);\n\t\t\tvar response = source.MatchWith(\n\t\t\t\ts => new GotoDefinitionResponse()\n\t\t\t\t{\n\t\t\t\t\tPath = s.FullPath,\n\t\t\t\t\tCaretPosition = new Protocol.Messages.TextPosition() { Line = s.Line, Character = s.Column }\n\t\t\t\t},\n\t\t\t\t() => new GotoDefinitionResponse());\n\n\t\t\treturn response;\n\t\t}\n\n\t\tOptional<Source> ProcessGotoDefintion(GotoDefinitionRequest gotoDefinitionRequest, IObserver<Error> errors)\n\t\t{\n\t\t\tvar path = TryCatchWithError(\n\t\t\t\terrors,\n\t\t\t\tErrorCode.InvalidData,\n\t\t\t\t\"Failed to parse path.\",\n\t\t\t\t() => AbsoluteFilePath.Parse(gotoDefinitionRequest.Path));\n\n\t\t\tif (!path.HasValue)\n\t\t\t\treturn Optional.None();\n\n\t\t\tCompile(gotoDefinitionRequest.Text, path.Value);\n\n\t\t\tvar source = GotoDefinitionFeature.TryGoToDefinition(\n\t\t\t\t_engine,\n\t\t\t\terrors,\n\t\t\t\t_gotoDefinitionFactory,\n\t\t\t\tgotoDefinitionRequest);\n\n\t\t\tsource.Do(s => {}, () => errors.OnNext(new Error(ErrorCode.Unknown, \"Failed to goto definition.\")));\n\n\t\t\treturn source;\n\t\t}\n\n\t\tpublic GetCodeSuggestionsResponse HandleGetCodeSuggestions(GetCodeSuggestionsRequest request)\n\t\t{\n\t\t\t// TODO: Refactor away this type of error handling...\n\t\t\tvar errors = new Subject<Error>();\n\t\t\terrors.Subscribe(e => { throw new Exception(e.Message); });\n\n\t\t\tvar suggestItems = ProcessCodeCompletion(request, errors);\n\t\t\tvar response = new GetCodeSuggestionsResponse()\n\t\t\t{\n\t\t\t\tIsUpdatingCache = _engine.Compiler == null,\n\t\t\t\tCodeSuggestions =\n\t\t\t\t\tEnumerable.ToList<CodeSuggestion>(suggestItems.Select(\n\t\t\t\t\t\t\ts => new CodeSuggestion()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSuggestion = s.Text,\n\t\t\t\t\t\t\t\tPreText = s.AutoCompletePreText == null ? \"\" : s.AutoCompletePreText(),\n\t\t\t\t\t\t\t\tPostText = s.AutoCompletePostText == null ? \"\" : s.AutoCompletePostText(),\n\t\t\t\t\t\t\t\tType = s.Type.ToString(),\n\t\t\t\t\t\t\t\tReturnType = s.AutoCompleteDescriptionText == null ? \"\" : s.AutoCompleteDescriptionText(),\n\t\t\t\t\t\t\t\tAccessModifiers = s.AutoCompleteAccessModifiers ?? new string[0],\n\t\t\t\t\t\t\t\tFieldModifiers = s.AutoCompleteFieldModifiers ?? new string[0],\n\t\t\t\t\t\t\t\tMethodArguments = s.AutoCompleteMethodArguments ?? new MethodArgument[0]\n\t\t\t\t\t\t\t}))\n\t\t\t};\n\n\t\t\treturn response;\n\t\t}\n\n\t\tIEnumerable<SuggestItem> ProcessCodeCompletion(GetCodeSuggestionsRequest request, IObserver<Error> errors)\n\t\t{\n\t\t\tIList<SuggestItem> suggestItems = new List<SuggestItem>();\n\t\t\tvar path = TryCatchWithError(errors, ErrorCode.InvalidData, \"Failed to parse path.\", () => AbsoluteFilePath.Parse(request.Path));\n\n\t\t\tif (!path.HasValue)\n\t\t\t\treturn suggestItems;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCompile(request.Text, path.Value);\n\n\t\t\t\tSuggestionsFeature.TryGetSuggestions(\n\t\t\t\t\terrors,\n\t\t\t\t\t_engine,\n\t\t\t\t\t_suggestionsFactory,\n\t\t\t\t\trequest,\n\t\t\t\t\tout suggestItems);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\terrors.OnNext(new Error(ErrorCode.InvalidOperation, e.Message));\n\t\t\t}\n\n\t\t\treturn suggestItems;\n\t\t}\n\n\t\tvoid Compile(string source, AbsoluteFilePath filePath)\n\t\t{\n\t\t\tvar logger = new Logger();\n\t\t\tif (!_engine.Compile(logger, source, Optional.Some(filePath)))\n\t\t\t\treturn;\n\t\t}\n\n\t\tstatic Optional<T> TryCatchWithError<T>(IObserver<Error> errors, ErrorCode code, string message, Func<T> func)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn func();\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\terrors.OnNext(new Error(code, message));\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_engine.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/CodeCompletionMessages.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.CodeCompletion;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\t[PayloadTypeName(\"Fuse.GetCodeSuggestions\")]\n\tpublic class GetCodeSuggestionsRequest : IRequestData<GetCodeSuggestionsResponse>\n\t{\n\t\t[PluginComment(\"Text contains all code that is present at the time of request inside the file asking for request.\", \"class Foo {};\")]\n\t\tpublic string Text;\n\n\t\t[PluginComment(\"Path to the file that asks for the request.\", @\"C:/Test.uno\")]\n\t\tpublic string Path;\n\n\t\t[PluginComment(\"Type of syntax, we support 'Uno' and 'UX'\", \"\")]\n\t\tpublic string SyntaxType;\n\n\t\t[PluginComment(\"Caret position\", \"{Line: 0, Character: 0}\")]\n\t\tpublic Protocol.Messages.TextPosition CaretPosition;\n\t}\n\n\tpublic class CodeSuggestion\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic string Suggestion { get; set; }\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string PreText { get; set; }\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string PostText { get; set; }\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string Type { get; set; }\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string ReturnType { get; set; }\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string[] AccessModifiers { get; set; }\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string[] FieldModifiers { get; set; }\n\n\t\t[PluginComment(\"\")]\n\t\tpublic MethodArgument[] MethodArguments { get; set; }\n\t}\n\n\t[PayloadTypeName(\"Fuse.GetCodeSuggestions\")]\n\tpublic class GetCodeSuggestionsResponse : IResponseData\n\t{\n\t\t[PluginComment(\"States if the cache is being rebuilt, so no/broken suggestions are only available\")]\n\t\tpublic bool IsUpdatingCache;\n\n\t\t[PluginComment(\"List of suggestions\")]\n\t\tpublic IList<CodeSuggestion> CodeSuggestions { get; set; }\n\t}\n\n\t[PayloadTypeName(\"Fuse.GotoDefinition\")]\n\tpublic class GotoDefinitionRequest : IRequestData<GotoDefinitionResponse>\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic string Path;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string Text;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string SyntaxType;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic Protocol.Messages.TextPosition CaretPosition;\n\t}\n\n\t[PayloadTypeName(\"Fuse.GotoDefinition\")]\n\tpublic class GotoDefinitionResponse : IResponseData\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic string Path;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic Protocol.Messages.TextPosition CaretPosition;\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/EditorManager.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing Outracks.IO;\nusing Outracks.UnoDevelop.CodeNinja;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tclass ChangedFile\n\t{\n\t\tpublic string Source { get; private set; }\n\t\tpublic AbsoluteFilePath FilePath { get; private set; }\n\t\tpublic DateTime Time { get; private set; }\n\n\t\tpublic ChangedFile(string source, AbsoluteFilePath filePath, DateTime time)\n\t\t{\n\t\t\tSource = source;\n\t\t\tFilePath = filePath;\n\t\t\tTime = time;\n\t\t}\n\n\t\tpublic void UpdateTime(DateTime time)\n\t\t{\n\t\t\tTime = time;\n\t\t}\n\t}\n\n\tpublic class EditorManager : IEditorManager\n\t{\n\t\tpublic DateTime GetLastWriteTime(AbsoluteFilePath filePath)\n\t\t{\n\t\t\tvar fileChanged = _filesChanged.FirstOrDefault(f => f.FilePath == filePath);\n\t\t\tvar lastWriteTime = File.GetLastWriteTime(filePath.NativePath);\n\t\t\tif (fileChanged != null)\n\t\t\t{\n\t\t\t\tif (lastWriteTime < fileChanged.Time)\n\t\t\t\t{\n\t\t\t\t\treturn fileChanged.Time;\n\t\t\t\t}\n\n\t\t\t\t_filesChanged.Remove(fileChanged);\n\t\t\t}\n\n\t\t\treturn lastWriteTime;\n\t\t}\n\n\t\tpublic bool IsOpen(AbsoluteFilePath filePath)\n\t\t{\n\t\t\treturn _filesChanged.Select(f => f.FilePath).Any(f => f == filePath);\n\t\t}\n\n\t\tpublic Stream OpenFileStream(AbsoluteFilePath filePath, FileAccess access = FileAccess.ReadWrite)\n\t\t{\n\t\t\tvar fileChanged = _filesChanged.FirstOrDefault(f => f.FilePath == filePath);\n\t\t\tif (fileChanged != null)\n\t\t\t{\n\t\t\t\tvar lastWriteTime = File.GetLastWriteTime(filePath.NativePath);\n\t\t\t\tif (lastWriteTime < fileChanged.Time)\n\t\t\t\t{\n\t\t\t\t\treturn new MemoryStream(Encoding.UTF8.GetBytes(fileChanged.Source));\n\t\t\t\t}\n\n\t\t\t\t_filesChanged.Remove(fileChanged);\n\t\t\t}\n\n\t\t\treturn File.Open(filePath.NativePath, FileMode.OpenOrCreate, access, access.HasFlag(FileAccess.Write) ? FileShare.Read : FileShare.ReadWrite);\n\t\t}\n\n\n\t\treadonly List<ChangedFile> _filesChanged = new List<ChangedFile>();\n\n\t\tpublic void AddChangedFile(string source, AbsoluteFilePath filePath)\n\t\t{\n\t\t\tvar found = _filesChanged.FirstOrDefault(f => f.FilePath == filePath);\n\t\t\tif (found != null)\n\t\t\t{\n\t\t\t\tfound.UpdateTime(DateTime.Now);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_filesChanged.Add(new ChangedFile(source, filePath, DateTime.Now));\n\t\t}\n\n\t\tpublic string ReadAllText(AbsoluteFilePath filePath)\n\t\t{\n\t\t\treturn OpenFileStream(filePath, FileAccess.Read).ReadToEnd();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/Engine.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Threading;\nusing Outracks.CodeCompletion;\nusing Outracks.IO;\nusing Outracks.UnoDevelop.CodeNinja;\nusing Uno.Build.Packages;\nusing Uno.Compiler;\nusing Uno.Compiler.Core;\nusing Uno.Logging;\nusing Uno.ProjectFormat;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tpublic class Engine : IEngine, IDisposable\n\t{\n\t\tProject _currentProject;\n\t\tCodeNinjaBuild _lastBuild;\n\t\treadonly EditorManager _editorManager = new EditorManager();\n\t\treadonly Thread _buildThread;\n\t\treadonly CancellationTokenSource _cancellationToken = new CancellationTokenSource();\n\t\treadonly AutoResetEvent _buildEvent = new AutoResetEvent(false);\n\t\treadonly ProjectDetector _projectDetector;\n\n\n\t\tpublic Compiler Compiler\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _lastBuild == null ? null : _lastBuild.Compiler;\n\t\t\t}\n\t\t}\n\n\t\tpublic SourcePackage MainPackage { get; private set; }\n\n\t\tpublic Engine(ProjectDetector projectDetector)\n\t\t{\n\t\t\t_projectDetector = projectDetector;\n\t\t\t_buildThread = new Thread(BuildThread) { Name = \"Codeninja build thread\", IsBackground = true };\n\t\t\t_buildThread.Start();\n\t\t}\n\n\t\tpublic bool Compile(Logger logger, string source, Optional<AbsoluteFilePath> filePath)\n\t\t{\n\t\t\tif (!filePath.HasValue)\n\t\t\t\treturn true;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar projectPath = _projectDetector.GetProject(filePath.Value);\n\t\t\t\tif (NeedsToChangeProject(projectPath))\n\t\t\t\t\treturn ChangeProject(projectPath.NativePath);\n\n\t\t\t\t_editorManager.AddChangedFile(source, filePath.Value);\n\t\t\t\tTriggerBuild();\n\t\t\t}\n\t\t\tcatch (Exception e) {\n                logger.TextWriter.WriteLine(e.ToString()); //This feels super weird but i need the error somehow\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool ChangeProject(string projectPath)\n\t\t{\n\t\t\t_currentProject = Project.Load(projectPath);\n\n\t\t\tnew Shell()\n\t\t\t\t.Watch(AbsoluteFilePath.Parse(projectPath).ContainingDirectory, \"*.unoproj\")\n\t\t\t\t.Where(e => e.Event == FileSystemEvent.Changed || e.Event == FileSystemEvent.Removed)\n\t\t\t\t.Subscribe(f => _currentProject = null);\n\n\t\t\tMainPackage = PackageCache.GetPackage(Log.Default, _currentProject);\n\t\t\tMainPackage.SetCacheDirectory((AbsoluteDirectoryPath.Parse(MainPackage.CacheDirectory) / new DirectoryName(\"CodeCompletion\")).NativePath);\n\n\t\t\tTriggerBuild();\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool NeedsToChangeProject(AbsoluteFilePath projectPath)\n\t\t{\n\t\t\treturn _currentProject == null || projectPath != AbsoluteFilePath.Parse(_currentProject.FullPath);\n\t\t}\n\n\t\tpublic void Invalidate()\n\t\t{\n\t\t\tTriggerBuild();\n\t\t}\n\n\t\tvoid TriggerBuild()\n\t\t{\n\t\t\t_buildEvent.Reset();\n\t\t\t_buildEvent.Set();\n\t\t}\n\n\t\tvoid BuildThread()\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\t_buildEvent.WaitOne();\n\n\t\t\t\tif (_cancellationToken.IsCancellationRequested)\n\t\t\t\t\treturn;\n\n\t\t\t\tBuild();\n\t\t\t}\n\t\t}\n\n\t\tvoid Build()\n\t\t{\n\t\t\tvar build = new CodeNinjaBuild(new Logger(), _currentProject, _editorManager, MainPackage, MainPackage.References.ToList());\n\t\t\tvar result = build.Execute();\n\t\t\tif (result == ExecuteStatus.NotDirty || result == ExecuteStatus.Fatal)\n\t\t\t\treturn;\n\n\t\t\t_lastBuild = build;\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> AllSourceFiles\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar filePaths = _lastBuild != null ? _lastBuild.FilePaths : new AbsoluteFilePath[0];\n\t\t\t\treturn !filePaths.Any() && _currentProject != null\n\t\t\t\t\t? _currentProject.GetFlattenedItems().Where(f => f.Type != IncludeItemType.Folder).Select(f => AbsoluteFilePath.Parse(f.Value))\n\t\t\t\t\t: filePaths;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_cancellationToken.Cancel();\n\t\t\t_buildEvent.Set();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/GoToDefinitionFeature.cs",
    "content": "﻿using System;\nusing Outracks.CodeCompletion;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\nusing Uno;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tclass GotoDefinitionFeature\n\t{\n\t\treadonly IEngine _engine;\n\t\treadonly IObserver<Error> _errors;\n\t\treadonly IGotoDefinitionFactory _gotoDefinitionFactory;\n\n\t\tGotoDefinitionFeature(IEngine engine, IObserver<Error> errors, IGotoDefinitionFactory gotoDefinitionFactory)\n\t\t{\n\t\t\t_engine = engine;\n\t\t\t_errors = errors;\n\t\t\t_gotoDefinitionFactory = gotoDefinitionFactory;\n\t\t}\n\n\t\tpublic static Optional<Source> TryGoToDefinition(IEngine engine, IObserver<Error> errors, IGotoDefinitionFactory gotoDefinitionFactory,\n\t\t\tGotoDefinitionRequest goToDefinition)\n\t\t{\n\t\t\treturn new GotoDefinitionFeature(engine, errors, gotoDefinitionFactory)\n\t\t\t\t.TryGoToDefinitionBasedOnType(goToDefinition);\n\t\t}\n\n\t\tOptional<Source> TryGoToDefinitionBasedOnType(GotoDefinitionRequest goToDefinition)\n\t\t{\n\t\t\tif (!ValidateData(goToDefinition))\n\t\t\t\treturn Optional.None();\n\n\t\t\tif (_engine.Compiler == null)\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar textPosition = new TextPosition(\n\t\t\t\tnew LineNumber(goToDefinition.CaretPosition.Line),\n\t\t\t\tnew CharacterNumber(goToDefinition.CaretPosition.Character));\n\n\t\t\tSource source;\n\t\t\tvar syntax = SyntaxLanguage.FromString(goToDefinition.SyntaxType).Syntax;\n\t\t\tvar normalizedText = goToDefinition.Text.NormalizeLineEndings();\n\t\t\tvar success = _gotoDefinitionFactory.TryGotoDefinitionBasedOnSyntax(\n\t\t\t\tsyntax,\n\t\t\t\tnew GotoDefinitionData(\n\t\t\t\t\t_engine.MainPackage,\n\t\t\t\t\t_engine.Compiler,\n\t\t\t\t\tAbsoluteFilePath.Parse(goToDefinition.Path),\n\t\t\t\t\tnormalizedText,\n\t\t\t\t\ttextPosition.ToOffset(normalizedText)),\n\t\t\t\tout source);\n\n\t\t\tif (success)\n\t\t\t\treturn source;\n\n\t\t\t_errors.OnNext(new Error(ErrorCode.InvalidData, string.Format(\"Tried to go to definition in unknown syntax code {0}\", goToDefinition.SyntaxType )));\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tbool ValidateData(GotoDefinitionRequest goToDefinition)\n\t\t{\n\t\t\tvar valid = true;\n\t\t\tif (goToDefinition.CaretPosition == null ||\n\t\t\t\tgoToDefinition.CaretPosition.Line <= 0 ||\n\t\t\t\tgoToDefinition.CaretPosition.Character <= 0)\n\t\t\t{\n\t\t\t\t_errors.OnNext(new Error(ErrorCode.InvalidData, \"The caret offset was invalid in code completion request.\"));\n\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\telse if (string.IsNullOrEmpty(goToDefinition.Text))\n\t\t\t{\n\t\t\t\t_errors.OnNext(new Error(ErrorCode.InvalidData, \"Text was empty or null in code completion request.\"));\n\t\t\t\tvalid = false;\n\t\t\t}\n\n\t\t\treturn valid;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/Logger.cs",
    "content": "﻿using System.IO;\nusing System.Text;\nusing Outracks.UnoDevelop.CodeNinja;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tpublic class Logger : ILog\n\t{\n\t\tpublic StringBuilder _sb = new StringBuilder();\n\t\tpublic void Clear() {}\n\n\t\tpublic TextWriter TextWriter\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new StringWriter(_sb);\n\t\t\t}\n\t\t}\n\n\t\tpublic string Text\n\t\t{\n\t\t\tget { return _sb.ToString(); }\n\t\t}\n\n\t\tpublic void Show() {}\n\t\tpublic void Mute() {}\n\t\tpublic void Unmute() {}\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/Program.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Threading;\nusing Outracks.Extensions;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tclass Program\n\t{\n\t\tstatic Program()\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n\t\t}\n\n\t\tstatic void Main(string[] argsArray)\n\t\t{\n\t\t\tvar run = true;\n\t\t\tvar args = argsArray.ToList();\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse-lang\", args);\n\t\t\tvar daemon = fuse.Connect(\"fuse-lang\", TimeSpan.FromSeconds(30));\n\t\t\tdaemon.ConnectionLost.Subscribe(d => run = false);\n\n\t\t\tvar codeCompletionInstance = new CodeCompletionInstance(new ProjectDetector(new Shell()));\n\t\t\tdaemon.Provide<GetCodeSuggestionsRequest, GetCodeSuggestionsResponse>(\n\t\t\t\tcodeCompletionInstance.HandleGetCodeSuggestions);\n\t\t\tdaemon.Provide<GotoDefinitionRequest, GotoDefinitionResponse>(codeCompletionInstance.HandleGotoDefinition);\n\n\t\t\twhile (run)\n\t\t\t{\n\t\t\t\tThread.Sleep(500);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/entrypoint/code-assistance/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"fuse-lang\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/entrypoint/code-assistance/SuggestionsFeature.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Outracks.CodeCompletion;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tclass SuggestionsFeature\n\t{\n\t\treadonly IObserver<Error> _errors;\n\t\treadonly IEngine _engine;\n\t\treadonly ISuggestionsFactory _suggestionFactory;\n\n\t\tSuggestionsFeature(IObserver<Error> errors, IEngine engine, ISuggestionsFactory suggestionFactory)\n\t\t{\n\t\t\t_errors = errors;\n\t\t\t_engine = engine;\n\t\t\t_suggestionFactory = suggestionFactory;\n\t\t}\n\n\t\tpublic static bool TryGetSuggestions(IObserver<Error> errors, IEngine engine, ISuggestionsFactory suggestionFactory, GetCodeSuggestionsRequest codeCompletion, out IList<SuggestItem> suggestItems)\n\t\t{\n\t\t\treturn new SuggestionsFeature(errors, engine, suggestionFactory).SuggestionsBasedOnSyntax(codeCompletion, out suggestItems);\n\t\t}\n\n\t\tbool SuggestionsBasedOnSyntax(GetCodeSuggestionsRequest codeCompletion, out IList<SuggestItem> suggestItems)\n\t\t{\n\t\t\tsuggestItems = new List<SuggestItem>();\n\n\t\t\tif (!ValidateData(codeCompletion))\n\t\t\t\treturn false;\n\n\t\t\tvar textPosition = new TextPosition(\n\t\t\t\tnew LineNumber(codeCompletion.CaretPosition.Line),\n\t\t\t\tnew CharacterNumber(codeCompletion.CaretPosition.Character));\n\n\t\t\tvar syntax = SyntaxLanguage.FromString(codeCompletion.SyntaxType).Syntax;\n\t\t\tvar normalizedText = codeCompletion.Text.NormalizeLineEndings();\n\t\t\tvar success = _suggestionFactory.SuggestionsBasedOnSyntax(\n\t\t\t\tsyntax,\n\t\t\t\tnew SuggestionDependentData(\n\t\t\t\t\t_engine.MainPackage,\n\t\t\t\t\t_engine.Compiler,\n\t\t\t\t\tAbsoluteFilePath.Parse(codeCompletion.Path),\n\t\t\t\t\tnormalizedText,\n\t\t\t\t\ttextPosition.ToOffset(normalizedText)),\n\t\t\t\t\tout suggestItems);\n\n\t\t\tif (success)\n\t\t\t\treturn true;\n\n\t\t\t_errors.OnNext(new Error(ErrorCode.InvalidData, string.Format(\"Tried to create suggestions for unknown syntax type {0}\", new[] { codeCompletion.SyntaxType })));\n\n\t\t\treturn false;\n\t\t}\n\n\t\tbool ValidateData(GetCodeSuggestionsRequest codeCompletion)\n\t\t{\n\t\t\tvar valid = true;\n\n\t\t\tif (codeCompletion.CaretPosition.Line <= 0 || codeCompletion.CaretPosition.Character <= 0)\n\t\t\t{\n\t\t\t\t_errors.OnNext(new Error(ErrorCode.InvalidData, \"The caret offset was invalid in code completion request.\"));\n\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\telse if (string.IsNullOrEmpty(codeCompletion.Text))\n\t\t\t{\n\t\t\t\t_errors.OnNext(new Error(ErrorCode.InvalidData, \"Text was empty or null in code completion request.\"));\n\t\t\t\tvalid = false;\n\t\t\t}\n\n\t\t\treturn valid;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/SyntaxLanguage.cs",
    "content": "using Outracks.CodeCompletion;\n\nnamespace Outracks.Fuse.CodeAssistance\n{\n\tclass SyntaxLanguage\n\t{\n\t\tstring Type { get; set; }\n\n\t\tpublic SyntaxLanguageType Syntax { get; private set; }\n\n\t\tSyntaxLanguage(string type)\n\t\t{\n\t\t\tType = type;\n\t\t\tSyntax = ParseTypeString(Type);\n\t\t}\n\n\t\tSyntaxLanguageType ParseTypeString(string type)\n\t\t{\n\t\t\tif(string.IsNullOrEmpty(type))\n\t\t\t\treturn SyntaxLanguageType.Unknown;\n\n\t\t\tvar loweredType = type.ToLower();\n\t\t\tswitch (loweredType)\n\t\t\t{\n\t\t\t\tcase \"ux\":\n\t\t\t\t\treturn SyntaxLanguageType.UX;\n\t\t\t\tcase \"uno\":\n\t\t\t\t\treturn SyntaxLanguageType.Uno;\n\t\t\t\tdefault:\n\t\t\t\t\treturn SyntaxLanguageType.Unknown;\n\t\t\t}\n\t\t}\n\n\t\tpublic static SyntaxLanguage FromString(string type)\n\t\t{\n\t\t\treturn new SyntaxLanguage(type);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/entrypoint/code-assistance/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/entrypoint/code-assistance/fuse-lang.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{338B4586-B3CC-4584-A026-E795B40D983A}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse.CodeAssistance</RootNamespace>\n    <AssemblyName>fuse-lang</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>$(SolutionDir)bin/$(Configuration)</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>$(SolutionDir)bin/$(Configuration)</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"Uno.Build\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Build.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Core\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.ProjectFormat\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.ProjectFormat.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"CodeCompletionInstance.cs\" />\n    <Compile Include=\"CodeCompletionMessages.cs\" />\n    <Compile Include=\"EditorManager.cs\" />\n    <Compile Include=\"Engine.cs\" />\n    <Compile Include=\"GoToDefinitionFeature.cs\" />\n    <Compile Include=\"Logger.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SuggestionsFeature.cs\" />\n    <Compile Include=\"SyntaxLanguage.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\ninja\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\ninja\\Outracks.CodeCompletion.NRefactoryInterop\\Outracks.CodeCompletion.NRefactoryInterop.csproj\">\n      <Project>{5A43F127-3217-4BEA-93F0-13903B240B5A}</Project>\n      <Name>Outracks.CodeCompletion.NRefactoryInterop</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\ninja\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\text\\Outracks.Text.csproj\">\n      <Project>{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}</Project>\n      <Name>Outracks.Text</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fuse\\Common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/entrypoint/code-assistance/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/entrypoint/uri-handler/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"fuse X\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/entrypoint/uri-handler/UriHandler.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Threading.Tasks;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class UriTool\n\t{\n\t\t[STAThread]\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse-uri\", new List<string>());\n\t\t\tvar task = fuse.ConnectOrSpawnAsync(\"fuse-uri\");\n\t\t\tvar daemon = task.ToObservable().Switch();\n\t\t\tnew UriHandler(fuse, daemon).OnUri(args.FirstOrDefault());\n\t\t\ttask.Wait();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/entrypoint/uri-handler/fuse-uri.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{9E26C610-B4BE-4548-82B0-70CFF33267C9}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse.UriHandler</RootNamespace>\n    <AssemblyName>fuse-uri</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <RestorePackages>true</RestorePackages>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>$(SolutionDir)bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>$(SolutionDir)bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject>Outracks.Fuse.UriTool</StartupObject>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>Fuse.ico</ApplicationIcon>\n  </PropertyGroup>\n  <PropertyGroup />\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"UriHandler.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Fuse.ico\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fuse\\Common\\Outracks.Fuse.csproj\">\n      <Project>{aa6dfb99-345f-4214-9a79-076829c0f777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fuse/command/CliCommand.cs",
    "content": "﻿using System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tpublic abstract class CliCommand\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly string Description;\n\t\tpublic readonly bool IsSecret;\n\t\tprotected CliCommand(string name, string description, bool isSecret = false)\n\t\t{\n\t\t\tName = name;\n\t\t\tDescription = description;\n\t\t\tIsSecret = isSecret;\n\t\t}\n\n\t\tpublic abstract void Help();\n\n\n\t\t/// <exception cref=\"ExitWithError\" />\n\t\tpublic abstract void Run(string[] args, CancellationToken ct);\n\n\t}\n\n\tpublic abstract class DefaultCliCommand : CliCommand\n\t{\n\t\tprotected DefaultCliCommand(string name, string description, bool isSecret = false) : base(name, description, isSecret) {}\n\n\t\tpublic abstract void RunDefault(string[] args, CancellationToken ct);\n\t}\n}"
  },
  {
    "path": "src/fuse/command/CliProgram.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tpublic class CliProgram\n\t{\n\t\treadonly ColoredTextWriter _error;\n\n\t\treadonly IReport _log;\n\t\treadonly string _programName;\n\t\treadonly DefaultCliCommand _defaultCommand;\n\t\treadonly Action _beforeRun;\n\t\treadonly List<CliCommand> _commands = new List<CliCommand>();\n\n\t\tpublic CliProgram(\n\t\t\tIReport log,\n\t\t\tColoredTextWriter outputWriter,\n\t\t\tColoredTextWriter errorWriter,\n\t\t\tstring programName,\n\t\t\tAction beforeRun,\n\t\t\tDefaultCliCommand defaultCommand,\n\t\t\tparams CliCommand[] otherCommands)\n\t\t{\n\t\t\t_log = log;\n\t\t\t_programName = programName;\n\t\t\t_defaultCommand = defaultCommand;\n\t\t\t_beforeRun = beforeRun;\n\t\t\t_error = errorWriter;\n\t\t\t_commands.Add(defaultCommand);\n\t\t\t_commands.AddRange(otherCommands);\n\t\t\t_commands.Add(new HelpCommand(outputWriter, _commands, programName));\n\t\t}\n\n\t\tpublic int Main(string[] args, CancellationToken ct)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_beforeRun();\n\t\t\t\targs.TryGetAt(0).Do(\n\t\t\t\t\tsome: arg => GetCommand(arg).Run(args.Skip(1).ToArray(), ct),\n\t\t\t\t\tnone: () => _defaultCommand.RunDefault(args, ct));\n\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tcatch (UnknownCommand e)\n\t\t\t{\n\t\t\t\t_log.Error(e.Command + \" is not a valid command.\");\n\t\t\t\tWriteErrorLine(\"'\" + e.Command + \"' is not a valid command. See '\" + _programName + \" help'.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tcatch (ExitWithError e)\n\t\t\t{\n\t\t\t\t_log.Error(e.ErrorOutput);\n\t\t\t\tWriteErrorLine(e.ErrorOutput);\n\t\t\t\treturn e.ExitCode;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tWriteErrorLine(\"unhandled exception: \" + e.Message);\n\n\t\t\t\tusing (_error.PushColor(ConsoleColor.Red))\n\t\t\t\t\t_error.WriteStackTraces(e);\n\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\tvoid WriteErrorLine(string error)\n\t\t{\n\t\t\tusing(_error.PushColor(ConsoleColor.Red))\n\t\t\t\t_error.WriteLine(_programName + \": \" + error);\n\t\t}\n\n\t\t/// <param name=\"name\"></param>\n\t\t/// <exception cref=\"UnknownCommand\"/>\n\t\t/// <returns></returns>\n\t\tCliCommand GetCommand(string name)\n\t\t{\n\t\t\treturn _commands.FirstOrNone(cmd => cmd.Name == name).OrThrow(new UnknownCommand(name));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/Commands/BuildCommand.cs",
    "content": "﻿using System.Linq;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tpublic class BuildCommand : CliCommand\n\t{\n\t\tpublic BuildCommand() : base(\"build\", \"Build a project\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tUno.CLI.Program.Main(\"build\", \"--help\");\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tUno.CLI.Program.Main(new []{\"build\"}.Concat(args).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/CleanCommand.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tpublic class CleanCommand : CliCommand\n\t{\n\t\tpublic CleanCommand() : base(\"clean\", \"Clean a project\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tUno.CLI.Program.Main(\"clean\", \"--help\");\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tUno.CLI.Program.Main(new []{\"clean\"}.Concat(args).ToArray());\n\t\t\tConsole.WriteLine(\"Clean completed\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/ConfigCommand.cs",
    "content": "﻿using System.Linq;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ConfigCommand : CliCommand\n\t{\n\t\tpublic ConfigCommand() : base(\"config\", \"Print configuration info\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tUno.CLI.Program.Main(\"config\", \"--help\");\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tUno.CLI.Program.Main(new []{\"config\"}.Concat(args).ToArray());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/CreateCommand.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Security;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Mono.Options;\nusing Outracks.Fuse.Templates;\nusing Outracks.IO;\nusing Uno.Configuration;\n\nnamespace Outracks.Fuse\n{\n\tpublic class CreateCommand : CliCommand\n\t{\n\t\tpublic static CreateCommand CreateCreateCommand()\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar coloredConsole = ColoredTextWriter.Out;\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\treturn new CreateCommand(\n\t\t\t\tshell,\n\t\t\t\t() => TemplateLoader.LoadTemplatesFrom(UnoConfig.Current.GetTemplatesDir() / \"projects\", shell),\n\t\t\t\t() => TemplateLoader.LoadTemplatesFrom(UnoConfig.Current.GetTemplatesDir() / \"files\", shell),\n\t\t\t\tcoloredConsole,\n\t\t\t\tfuse);\n\t\t}\n\n\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly Func<IEnumerable<Template>> _projectTemplates;\n\t\treadonly Func<IEnumerable<Template>> _fileTemplates;\n\t\treadonly ColoredTextWriter _textWriter;\n\t\treadonly IFuse _fuse;\n\t\treadonly OptionSet _optionSet;\n\n\t\tbool _shouldListPackages = false;\n\n\t\tpublic CreateCommand(\n\t\t\tIFileSystem shell,\n\t\t\tFunc<IEnumerable<Template>> projectTemplates,\n\t\t\tFunc<IEnumerable<Template>> fileTemplates,\n\t\t\tColoredTextWriter textWriter,\n\t\t\tIFuse fuse)\n\t\t\t: base(\"create\", \"Create a project or file from a template\")\n\t\t{\n\t\t\t_fileTemplates = fileTemplates;\n\t\t\t_textWriter = textWriter;\n\t\t\t_fuse = fuse;\n\t\t\t_projectTemplates = projectTemplates;\n\t\t\t_fileSystem = shell;\n\t\t\t_optionSet = new OptionSet()\n\t\t\t{\n\t\t\t\t{\"l|list\", \"List all available templates.\", s => { _shouldListPackages = true; }}\n\t\t\t};\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tvar templates = _projectTemplates().Concat(_fileTemplates());\n\n\t\t\t_textWriter.WriteHelp(new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse create\", Description),\n\t\t\t\tnew HelpSynopsis(Usage),\n\t\t\t\tnew HelpDetailedDescription(\n\t\t\t\t\t\"When creating a file, a project must be within reach from the destination folder.\\n\" +\n\t\t\t\t\t\"A project is within reach if current or any of the parent directories contains a project.\\n\" +\n\t\t\t\t\t\"NOTE: Files are added to the project within reach, and will be part of next build of project.\"),\n\t\t\t\tnew HelpOptions(new[]\n\t\t\t\t{\n\t\t\t\t\t_optionSet.ToTable(),\n\t\t\t\t\tnew Table(\"Templates\",\n\t\t\t\t\t\ttemplates\n\t\t\t\t\t\t\t.OrderByDescending(t => t.Priority)\n\t\t\t\t\t\t\t.Select(t => new Row(t.Alias.Or(\"\"), t.Name, t.Description)))\n\t\t\t\t})));\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tvar parsedArgs = _optionSet.Parse(args);\n\n\t\t\tif (_shouldListPackages)\n\t\t\t\tListPackages();\n\t\t\telse\n\t\t\t\tCreate(parsedArgs);\n\t\t}\n\n\t\tvoid ListPackages()\n\t\t{\n\t\t\tusing(_textWriter.PushColor(ConsoleColor.Yellow))\n\t\t\t\t_textWriter.WriteLine(\"Project Templates\");\n\t\t\t_projectTemplates()\n\t\t\t\t.OrderBy(p => p.Priority)\n\t\t\t\t.Each(p => _textWriter.WriteLine(p.Name));\n\n\t\t\t_textWriter.WriteLine();\n\n\t\t\tusing (_textWriter.PushColor(ConsoleColor.Yellow))\n\t\t\t\t_textWriter.WriteLine(\"File Templates\");\n\t\t\t_fileTemplates()\n\t\t\t\t.OrderBy(p => p.Priority)\n\t\t\t\t.Each(t => _textWriter.WriteLine(t.Name));\n\t\t}\n\n\t\tvoid Create(IList<string> args)\n\t\t{\n\t\t\tTask.Run(\n\t\t\t\t() => _fuse.ConnectOrSpawn(\"Fuse create\", Timeout.InfiniteTimeSpan));\n\n\t\t\tvar argIdx = 0;\n\t\t\tvar templateName = args.TryGetAt(argIdx++)\n\t\t\t\t.OrThrow(new ExitWithError(Usage));\n\n\t\t\tvar name = args.TryGetAt(argIdx++).Or(\"Untitled\");\n\n\t\t\tvar validatedName = FileName.Validate(name);\n\t\t\tif (!validatedName.HasValue)\n\t\t\t\tthrow new ExitWithError(validatedName.Error.Capitalize());\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar destPath = args.TryGetAt(argIdx++).Select(\n\t\t\t\t\tp => (_fileSystem.ResolveAbsolutePath(p) as AbsoluteDirectoryPath).ToOptional()\n\t\t\t\t\t\t.OrThrow(new ExitWithError(\"Invalid project path\" + \": \" + args[argIdx - 1])))\n\t\t\t\t\t.Or(DirectoryPath.GetCurrentDirectory());\n\n\t\t\t\tvar spawnTemplate = new SpawnTemplate(_fileSystem);\n\t\t\t\tvar projectTemplate = _projectTemplates().FirstOrDefault(t => TemplateNameEquals(t, templateName));\n\t\t\t\tvar fileTemplate = _fileTemplates().FirstOrDefault(t => TemplateNameEquals(t, templateName));\n\n\t\t\t\tif (projectTemplate == null && fileTemplate == null)\n\t\t\t\t\tthrow new ExitWithError(\"Unknown template name, see fuse help create for a list of valid template names.\");\n\n\t\t\t\tvar templateIsProjectTemplate = projectTemplate != null;\n\n\t\t\t\tif (templateIsProjectTemplate)\n\t\t\t\t{\n\t\t\t\t\tvar resultPath = spawnTemplate.CreateProject(name, projectTemplate, destPath);\n\t\t\t\t\tusing (_textWriter.PushColor(ConsoleColor.Green))\n\t\t\t\t\t\t_textWriter.WriteLine(\"Created project: '\" + name + \"' at '\" + resultPath.NativePath + \"'\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar resultPath = spawnTemplate.CreateFile(name, fileTemplate, destPath)\n\t\t\t\t\t\t.OrThrow(new FailedToCreateFileFromTemplate(\"Failed to create file from template (unknown reason)\"));\n\t\t\t\t\tusing (_textWriter.PushColor(ConsoleColor.Green))\n\t\t\t\t\t\t_textWriter.WriteLine(\"Created file at '\" + resultPath.NativePath + \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (ProjectNotFound)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Could not find a project to put the file in, please check if destination folder or its parents contains a project.\");\n\t\t\t}\n\t\t\tcatch (FileAlreadyExist e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (InvalidPath p)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Invalid project path\" + \": \" + p.Path);\n\t\t\t}\n\t\t\tcatch (SecurityException e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (DaemonException e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (FailedToCreateFileFromTemplate e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (ProjectFolderNotEmpty)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"A folder with that name already exists, and it is not empty.\");\n\t\t\t}\n\t\t\tcatch (UnauthorizedAccessException e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (FailedToAddProjectToRecentList e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t}\n\n\t\tpublic static string Usage\n\t\t{\n\t\t\tget { return \"fuse create <alias|template-name> [project-name] [destination-dir]\"; }\n\t\t}\n\n\t\tstatic bool TemplateNameEquals(Template template, string name)\n\t\t{\n\t\t\treturn template.Name == name || template.Alias == name;\n\t\t}\n\t}\n\n\tclass FailedToAddProjectToRecentList : Exception\n\t{\n\t\tpublic FailedToAddProjectToRecentList(string message) : base(message)\n\t\t{\n\t\t}\n\t}\n\n\tclass FailedToCreateFileFromTemplate : Exception\n\t{\n\t\tpublic FailedToCreateFileFromTemplate(string message) : base(message)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/DaemonClientCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Mono.Options;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse\n{\n\tpublic class DaemonClientCommand : CliCommand\n\t{\n\t\tpublic static CliCommand Create()\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"daemon-client\", new List<string>());\n\t\t\treturn new DaemonClientCommand(ColoredTextWriter.Out, fuse);\n\t\t}\n\n\t\treadonly ColoredTextWriter _textWriter;\n\t\treadonly IFuseLauncher _fuseLauncher;\n\t\treadonly OptionSet _optionSet;\n\t\tbool _noSpawnMode = false;\n\n\t\treadonly HelpSynopsis _helpSynopsis = new HelpSynopsis(\"fuse daemon-client <identifier>\");\n\n\t\tpublic DaemonClientCommand(ColoredTextWriter textWriter, IFuse fuse) : base(\"daemon-client\", \"Create a connection to a daemon.\")\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_fuseLauncher = fuse;\n\t\t\t_optionSet = CreateOptions();\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tvar helpArguments = new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\t_helpSynopsis,\n\t\t\t\tnew HelpDetailedDescription(\n\t\t\t\t\t\"Creates a new daemon if no daemon exists, unless --no-spawn option is used.\\n\"\n\t\t\t\t\t+ \"Send message to daemon by writing to stdin and receive message from daemon by reading from stdout.\"\n\t\t\t\t),\n\t\t\t\tnew HelpOptions(_optionSet.ToTable()));\n\n\t\t\t_textWriter.WriteHelp(helpArguments);\n\t\t}\n\n\t\t/// <exception cref=\"ExitWithError\" />\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tvar clientName = _optionSet.Parse(args)\n\t\t\t\t.TryGetAt(0)\n\t\t\t\t.OrThrow(new ExitWithError(\"Expected client identifier. Usage: \" + _helpSynopsis.Usage));\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar daemonConnection = ConnectToDaemon();\n\t\t\t\tvar outStream = Console.OpenStandardOutput(16384);\n\t\t\t\tvar inStream = Console.OpenStandardInput(16384);\n\n\t\t\t\tvar stream = daemonConnection.GetStream();\n\n\t\t\t\tSendHello(clientName, stream);\n\n\t\t\t\tvar readTask = Task.Run(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar availableBytes = Math.Max(1, daemonConnection.Available);\n\t\t\t\t\t\t\tvar buffer = new byte[availableBytes];\n\t\t\t\t\t\t\tvar bytesRead = stream.Read(buffer, 0, availableBytes);\n\t\t\t\t\t\t\tif(bytesRead == 0)\n\t\t\t\t\t\t\t\tthrow new Exception(\"Lost connection to daemon.\");\n\n\t\t\t\t\t\t\toutStream.Write(buffer, 0, bytesRead);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\tvar writeTask = Task.Run(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tHandleSend(inStream, stream);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tif (!daemonConnection.Connected)\n\t\t\t\t\t{\n\t\t\t\t\t\t// This should not happen, but better be safe.\n\t\t\t\t\t\tthrow new ExitWithError(\"Lost connection to daemon.\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (readTask.Exception != null)\n\t\t\t\t\t\tthrow new ExitWithError(readTask.Exception.InnerException.Message);\n\t\t\t\t\tif (writeTask.Exception != null)\n\t\t\t\t\t\tthrow new ExitWithError(writeTask.Exception.InnerException.Message);\n\n\t\t\t\t\tThread.Sleep(50);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (FailedToSpawnDaemon)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Failed to spawn daemon.\", 10);\n\t\t\t}\n\t\t\tcatch (FailedToConnectToDaemon)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Failed to connect to daemon.\", 10);\n\t\t\t}\n\t\t}\n\n\t\tstatic void SendHello(string clientName, NetworkStream stream)\n\t\t{\n\t\t\tvar helloPayload =\n\t\t\t\t\"{\" +\n\t\t\t\t\t\"\\\"Name\\\": \\\"Hello\\\", \" +\n\t\t\t\t\t\"\\\"Id\\\": 0, \" +\n\t\t\t\t\t\"\\\"Arguments\\\": \"\n\t\t\t\t\t+ \"{\"\n\t\t\t\t\t\t+ \"\\\"Identifier\\\": \\\"\" + clientName + \"\\\",\"\n\t\t\t\t\t\t+ \"\\\"DaemonKey\\\": \\\"\" + DaemonKey.GetDaemonKey() + \"\\\",\"\n\t\t\t\t\t\t+ \"\\\"EventFilter\\\": \\\"Strict\\\"\"\n\t\t\t\t\t+ \"}\" +\n\t\t\t\t\t\"}\";\n\n\t\t\tvar helloPayloadBytes = Encoding.UTF8.GetBytes(helloPayload);\n\t\t\tvar helloRequestHead = Encoding.UTF8.GetBytes(\"Request\\n\" + helloPayloadBytes.Length + \"\\n\");\n\t\t\tvar helloRequest = helloRequestHead.Concat(helloPayloadBytes).ToArray();\n\t\t\tstream.Write(helloRequest, 0, helloRequest.Length);\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvar reader = new BinaryReader(stream);\n\t\t\t\tvar messageType = Encoding.UTF8.GetString(reader.ReadLine());\n\t\t\t\tvar lengthBytes = Encoding.UTF8.GetString(reader.ReadLine());\n\n\t\t\t\tint length;\n\t\t\t\tif (!int.TryParse(lengthBytes, out length))\n\t\t\t\t\tthrow new ExitWithError(\"Failed to parse message length of expected Hello response.\");\n\n\t\t\t\t// We need to read all data, even if we don't care about other things than hello response.\n\t\t\t\treader.ReadBytes(length);\n\n\t\t\t\tif (messageType == \"Response\")\n\t\t\t\t{\n\t\t\t\t\t// TODO: We should probably verify that the response is a hello response.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic void HandleSend(Stream inStream, Stream outStream)\n\t\t{\n\t\t\tvar reader = new BinaryReader(inStream);\n\t\t\tvar messageType = reader\n\t\t\t\t.ReadLine()\n\t\t\t\t.Concat(new[] { (byte)'\\n' })\n\t\t\t\t.ToArray();\n\n\t\t\tvar lengthBytes = reader\n\t\t\t\t.ReadLine()\n\t\t\t\t.Concat(new[] { (byte)'\\n' })\n\t\t\t\t.ToArray();\n\n\t\t\tint length;\n\t\t\tif (!int.TryParse(Encoding.UTF8.GetString(lengthBytes), out length))\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"Failed to parse message length.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar payload = reader.ReadBytes(length);\n\t\t\toutStream.Write(messageType, 0, messageType.Length);\n\t\t\toutStream.Write(lengthBytes, 0, lengthBytes.Length);\n\t\t\toutStream.Write(payload, 0, payload.Length);\n\t\t\toutStream.Flush();\n\t\t}\n\n\t\tTcpClient ConnectToDaemon()\n\t\t{\n\t\t\tif (_noSpawnMode)\n\t\t\t{\n\t\t\t\treturn Connect();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn new TcpClient(IPAddress.Loopback.ToString(), 12122);\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\tvar p =_fuseLauncher.StartFuse(\"daemon\", new[] { \"-b\" });\n\t\t\t\t\tp.WaitForExit();\n\t\t\t\t\tif(p.ExitCode != 0)\n\t\t\t\t\t\tthrow new FailedToSpawnDaemon(p.ExitCode);\n\n\t\t\t\t\treturn Connect();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTcpClient Connect()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new TcpClient(IPAddress.Loopback.ToString(), 12122);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToConnectToDaemon(e);\n\t\t\t}\n\t\t}\n\n\t\tOptionSet CreateOptions()\n\t\t{\n\t\t\treturn new OptionSet()\n\t\t\t{\n\t\t\t\t{\"no-spawn\", \"Prevents spawning of a new daemon if no daemon exists.\\n\"\n\t\t\t\t+ \"An error is written to stderr if no daemon exists and process exits with none zero result.\", a => _noSpawnMode = true }\n\t\t\t};\n\t\t}\n\n\t}\n\n\tstatic class BinaryReaderExtensions\n\t{\n\t\tpublic static byte []ReadLine(this BinaryReader reader)\n\t\t{\n\t\t\tif(!reader.BaseStream.CanRead)\n\t\t\t\tthrow new ArgumentException(\"Reader don't have a readable stream.\");\n\n\t\t\tvar byteBuffer = new List<byte>(256);\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvar curByte = reader.ReadByte();\n\n\t\t\t\tif(curByte == '\\n')\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbyteBuffer.Add(curByte);\n\t\t\t}\n\n\t\t\treturn byteBuffer.Where(b => b != '\\r').ToArray();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/DaemonCommand.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Net.Sockets;\nusing System.Threading;\nusing Mono.Options;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Daemon;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic class DaemonArgs\n\t{\n\t\tpublic readonly bool Debug;\n\t\tpublic readonly bool IsMinimal;\n\n\t\tpublic DaemonArgs(bool debug, bool isMinimal)\n\t\t{\n\t\t\tDebug = debug;\n\t\t\tIsMinimal = isMinimal;\n\t\t}\n\t}\n\n\tpublic class DaemonCommand : CliCommand\n\t{\n\t\tpublic static DaemonCommand CreateDaemonCommand()\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar coloredConsole = ColoredTextWriter.Out;\n\t\t\tvar coloredErrorConsole = ColoredTextWriter.Error;\n\t\t\tvar fuse = FuseApi.Initialize(\"daemon\", new List<string>());\n\t\t\tvar daemonReport = fuse.Report;\n\t\t\tvar localSocketServer = new LocalSocketServer(daemonReport);\n\t\t\tvar serviceRunnerFactory = new ServiceRunnerFactory(\n\t\t\t\t  new Service(\"fuse-lang\", fuse.CodeAssistance)\n\t\t\t\t, new Service(\"fuse-tray\", fuse.Tray)\n\t\t\t\t);\n\n\t\t\tvar daemonSingleInstance = new EnsureSingleUser(\n\t\t\t\tcoloredErrorConsole,\n\t\t\t\tshell,\n\t\t\t\tuserFile: DaemonPossessionFile);\n\n\t\t\treturn new DaemonCommand(\n\t\t\t\tcoloredConsole,\n\t\t\t\tdaemonReport,\n\t\t\t\tdaemonSingleInstance,\n\t\t\t\tfuse,\n\t\t\t\t(a) => new DaemonRunner(\n\t\t\t\t\tdaemonSingleInstance,\n\t\t\t\t\tlocalSocketServer,\n\t\t\t\t\ta.Debug,\n\t\t\t\t\t!a.IsMinimal,\n\t\t\t\t\tfuse,\n\t\t\t\t\tserviceRunnerFactory,\n\t\t\t\t\tdaemonReport));\n\t\t}\n\n\t\tstatic AbsoluteFilePath DaemonPossessionFile\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (Platform.IsMac)\n\t\t\t\t{\n\t\t\t\t\treturn AbsoluteFilePath.Parse(\"/tmp/.daemonPossesion\");\n\t\t\t\t}\n\n\t\t\t\tif (Platform.IsWindows)\n\t\t\t\t{\n\t\t\t\t\treturn AbsoluteDirectoryPath.Parse(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData))\n\t\t\t\t\t\t/ new DirectoryName(\"fuse X\")\n\t\t\t\t\t\t/ new FileName(\".daemonPossesion\");\n\t\t\t\t}\n\n\t\t\t\tthrow new PlatformNotSupportedException(\"Not implemented on platform: \" + Platform.OperatingSystem);\n\t\t\t}\n\t\t}\n\n\t\treadonly ColoredTextWriter _textWriter; //TODO delete\n\t\treadonly IReport _report;\n\t\treadonly EnsureSingleUser _ensureSingleUser;\n\t\treadonly IFuse _fuse;\n\t\treadonly OptionSet _optionSet;\n\t\treadonly HelpArguments _helpArguments;\n\t\treadonly Func<DaemonArgs, DaemonRunner> _daemonRunner;\n\t\tbool _debug;\n\t\tbool _force;\n\t\tbool _isMinimal;\n\t\tbool _isBackground;\n\t\tbool _getKey;\n\n\t\tpublic DaemonCommand(\n\t\t\tColoredTextWriter textWriter,\n\t\t\tIReport report,\n\t\t\tEnsureSingleUser ensureSingleUser,\n\t\t\tIFuse fuseLauncher,\n\t\t\tFunc<DaemonArgs, DaemonRunner> daemonRunner)\n\t\t\t: base(\"daemon\", \"Start the fuse daemon\")\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_report = report;\n\t\t\t_ensureSingleUser = ensureSingleUser;\n\t\t\t_fuse = fuseLauncher;\n\t\t\t_optionSet = CreateOptions();\n\t\t\t_daemonRunner = daemonRunner;\n\t\t\t_helpArguments = new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\tnew HelpSynopsis(\"fuse daemon [options]\"),\n\t\t\t\tnew HelpDetailedDescription(\n@\"Fuse daemon starts a local server on port(12122).\nIt communicates over our own protocol, with a Plugin API built on top.\nDocumentation for the protocol and the API will be released later.\"),\n\t\t\t\tnew HelpOptions(_optionSet.ToTable()));\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\t_textWriter.WriteHelp(_helpArguments);\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\t_report.Info(\"Starting daemon with arguments '\" + string.Join(\" \", args) + \"'\");\n\t\t\t_optionSet.Parse(args);\n\n\t\t\tif (_force)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tnew FuseKiller(_fuse.Report, _fuse.FuseRoot).Execute(ColoredTextWriter.Out);\n\t\t\t\t}\n\t\t\t\tcatch\n\t\t\t\t{\n\t\t\t\t\t// ignored\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (_getKey)\n\t\t\t{\n\t\t\t\t_report.Info(_ensureSingleUser.GetDaemonKey(), ReportTo.LogAndUser);\n\t\t\t}\n\t\t\telse if (_isBackground)\n\t\t\t{\n\t\t\t\tStartChildDaemonAndWait(args);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t_daemonRunner(new DaemonArgs(_debug, _isMinimal)).Run();\n\t\t\t\t}\n\t\t\t\tcatch (SocketException e)\n\t\t\t\t{\n\t\t\t\t\t_report.Exception(\"Looks like another instance of Fuse is running. Try to kill the old process or pass the --force flag.\", e);\n\t\t\t\t\tthrow new ExitWithError(\"Looks like another instance of Fuse is running. Try to kill the old process or pass the --force flag.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid StartChildDaemonAndWait(IEnumerable<string> args)\n\t\t{\n\t\t\t_report.Info(\"Trying to start the daemon as a background process.\", ReportTo.LogAndUser);\n\n\t\t\tvar arguments = args.ToImmutableList();\n\t\t\tvar backgroundArgIdx = arguments.FindIndex(a => a.Contains(\"-b\") || a.Contains(\"--background\"));\n\t\t\tif(backgroundArgIdx >= 0)\n\t\t\t\targuments = arguments.RemoveAt(backgroundArgIdx);\n\n\t\t\tif (Platform.IsMac)\n\t\t\t{\n\t\t\t\t// Use shell-execute to start the daemon process.\n\t\t\t\t_fuse.StartFuse(\"daemon\", arguments.ToArray(), false);\n\n\t\t\t\t// Give daemon some time to start.\n\t\t\t\tThread.Sleep(2000);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar process = _fuse.StartFuse(\"daemon\", arguments.ToArray());\n\n\t\t\t\tif (process == null)\n\t\t\t\t\tthrow new ExitWithError(\"Couldn't start a background process of the daemon.\");\n\n\t\t\t\tif (!process.StandardOutput.ReadLinesUntil(\n\t\t\t\t\tline => {\n\t\t\t\t\t\tif (line.StartsWith(\"Running at \"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_report.Info(\"A daemon background process was successfully started.\", ReportTo.LogAndUser);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (line.StartsWith(\"Already running at \"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_report.Info(\"A daemon is already running.\", ReportTo.LogAndUser);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}))\n\t\t\t\t{\n\t\t\t\t\tthrow new ExitWithError(\"Couldn't start a background process of the daemon.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tOptionSet CreateOptions()\n\t\t{\n\t\t\treturn new OptionSet()\n\t\t\t{\n\t\t\t\t{ \"m|minimal\", \"In this mode, only the daemon is started without child processes.\", a => _isMinimal = true },\n\t\t\t\t{ \"d|debug\", \"In this mode all errors are written to console.\", a => _debug = true },\n\t\t\t\t{ \"b|background\", \"Start the daemon as a background process. This process will return when the background process has successfully started.\", a => _isBackground = true },\n\t\t\t\t{ \"f|force\", \"Force a restart by killing existing fuse processes.\", a => _force = true },\n\t\t\t\t{ \"get-key\", \"Returns a key that all clients should send when connecting.\", a => _getKey = true }\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/DashboardCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tclass DashboardCommand : DefaultCliCommand\n\t{\n\t\tpublic static DashboardCommand CreateDashboardCommand()\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\tvar Log = fuse.Report;\n\t\t\tvar shell = new Shell();\n\t\t\treturn new DashboardCommand(\n\t\t\t\tlog: Log,\n\t\t\t\tfuseVersion: fuse.Version,\n\t\t\t\tfs: shell,\n\t\t\t\tuserDataDir: fuse.UserDataDir,\n\t\t\t\tstudio: fuse.Studio,\n\t\t\t\tfuseKiller: new FuseKiller(Log, fuse.FuseRoot),\n\t\t\t\toutWriter: ColoredTextWriter.Out);\n\t\t}\n\n\t\treadonly string _fuseVersion;\n\t\treadonly IFileSystem _fs;\n\t\treadonly IReport _log;\n\t\treadonly IExternalApplication _studio;\n\t\treadonly IFuseKiller _fuseKiller;\n\t\treadonly ColoredTextWriter _outWriter;\n\t\treadonly AbsoluteFilePath _versionFile;\n\n\t\tpublic DashboardCommand(\n\t\t\tstring fuseVersion,\n\t\t\tIFileSystem fs,\n\t\t\tIReport log,\n\t\t\tIExternalApplication studio,\n\t\t\tIFuseKiller fuseKiller,\n\t\t\tAbsoluteDirectoryPath userDataDir,\n\t\t\tColoredTextWriter outWriter)\n\t\t\t: base(\"dashboard\", \"Fire up the dashboard\")\n\t\t{\n\t\t\t_fuseVersion = fuseVersion;\n\t\t\t_fs = fs;\n\t\t\t_log = log;\n\t\t\t_studio = studio;\n\t\t\t_fuseKiller = fuseKiller;\n\t\t\t_outWriter = outWriter;\n\t\t\t_versionFile = userDataDir / new FileName(\".fuseVersion\");\n\t\t}\n\n\t\tpublic override void Help() {}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tKillFuseInstancesIfNeccessary();\n\t\t\t_studio.Start();\n\t\t}\n\n\t\tpublic override void RunDefault(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tRun(args, ct);\n\t\t}\n\n\t\tvoid KillFuseInstancesIfNeccessary()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (ShouldKillFuse(_fuseVersion))\n\t\t\t\t{\n\t\t\t\t\tTryWriteCurrentVersion(_fuseVersion);\n\t\t\t\t\t_fuseKiller.Execute(_outWriter);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_log.Exception(\"Failed to kill fuse instances\", e);\n\t\t\t}\n\t\t}\n\n\t\tbool ShouldKillFuse(string version)\n\t\t{\n\t\t\tif (!Platform.IsMac)\n\t\t\t\treturn false;\n\n\t\t\tvar currentInstalledVersion = GetCurrentInstalledVersion().Or(\"0.0.0-dev\");\n\t\t\treturn currentInstalledVersion != version;\n\t\t}\n\n\t\tOptional<string> GetCurrentInstalledVersion()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn _fs.ReadAllText(_versionFile, 5);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_log.Exception(\"Failed to get current version\", e);\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tbool TryWriteCurrentVersion(string version)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_fs.ReplaceText(_versionFile, version, 5);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_log.Exception(\"Failed to write version to disk\", e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/EventViewerCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Net.Sockets;\nusing System.Reactive.Linq;\nusing System.Threading;\nusing Mono.Options;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Protocol.Messages;\n\nnamespace Outracks.Fuse\n{\n\tpublic class EventViewerCommand : CliCommand\n\t{\n\t\tpublic static CliCommand CreateEventViewerCommand()\n\t\t{\n\t\t\treturn new EventViewerCommand(ColoredTextWriter.Out, FuseApi.Initialize(\"fuse\", new List<string>()));\n\t\t}\n\n\t\treadonly IFuse _fuse;\n\t\treadonly HelpArguments _helpArguments;\n\t\treadonly ColoredTextWriter _textWriter;\n\t\treadonly OptionSet _optionSet;\n\t\treadonly IReport _report;\n\t\tbool _useColors = false;\n\t\tbool _extraLineSpace = false;\n\t\tstring _eventFilter = \".*\";\n\n\t\tpublic EventViewerCommand(ColoredTextWriter textWriter, IFuse fuse) : base(\"event-viewer\", \"Dump all events\", true)\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_fuse = fuse;\n\t\t\t_optionSet = CreateOptions();\n\t\t\t_report = _fuse.Report;\n\t\t\t_helpArguments = new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\tnew HelpSynopsis(\"fuse \" + Name + \" [options]\"),\n\t\t\t\tnew HelpDetailedDescription(\"Dumps all Fuse events to the console.\"),\n\t\t\t\tnew HelpOptions( new[]\n\t\t\t\t\t{\n\t\t\t\t\t\t_optionSet.ToTable(),\n\t\t\t\t\t}));\n\n\t\t}\n\n\t\tOptionSet CreateOptions()\n\t\t{\n\t\t\treturn new OptionSet()\n\t\t\t{\n\t\t\t\t{ \"c|color\", \"Distinguish different types of events with different colors.\", c => _useColors = true },\n\t\t\t\t{ \"s|space\", \"Print an extra line break between each line.\", s => _extraLineSpace = true },\n\t\t\t\t{ \"f|filter=\", \"Filter events using this regex.\", f => _eventFilter = f}\n\t\t\t};\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\t_textWriter.WriteHelp(_helpArguments);\n\t\t}\n\n\t\t/// <exception cref=\"ExitWithError\" />\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\t_optionSet.Parse(args);\n\n\t\t\tvar localSocketClient = new LocalSocketClient(new TcpClient(\"127.0.0.1\", 12122));\n\t\t\tlocalSocketClient.StartRead();\n\t\t\tvar serializer = new Serializer();\n\t\t\tvar client = new Client(localSocketClient, serializer);\n\n\t\t\tclient.Request(new HelloRequest()\n\t\t\t{\n\t\t\t\tIdentifier = \"Event Viewer\",\n\t\t\t}).Wait();\n\n\t\t\tclient.Request(new SubscribeRequest(_eventFilter, replay: true, subscriptionId: 0));\n\n\t\t\tvar messages = localSocketClient.IncomingMessages;\n\t\t\tmessages.TryDeserialize(serializer, _report).OfType<IEventMessage<UnresolvedMessagePayload>>().Subscribe(WriteEvent);\n\n\t\t\tvar run = true;\n\t\t\tlocalSocketClient.Disconnected.Subscribe(c => run = false);\n\t\t\t//TODO handle ctrl+c\n\n\t\t\twhile (run)\n\t\t\t{\n\t\t\t\tThread.Sleep(500);\n\t\t\t}\n\n\t\t}\n\n\t\tvoid WriteEvent(IEventMessage<UnresolvedMessagePayload> m)\n\t\t{\n\t\t\tvar output = m.Name + \": \" + m.Data;\n\t\t\tif (_useColors)\n\t\t\t\tusing (_textWriter.PushColor(ColorFor(m)))\n\t\t\t\t\t_textWriter.WriteLine(output);\n\t\t\telse\n\t\t\t\t_textWriter.WriteLine(output);\n\t\t\tif (_extraLineSpace)\n\t\t\t\t_textWriter.WriteLine();\n\t\t}\n\n\t\tConsoleColor ColorFor(IEventMessage<UnresolvedMessagePayload> m)\n\t\t{\n\t\t\tconst ConsoleColor defaultColor = ConsoleColor.Gray;\n\n\t\t\tvar name = m.Name;\n\n\t\t\tif (name.StartsWith(\"Fuse.Build\"))\n\t\t\t\treturn ConsoleColor.Cyan;\n\n\t\t\tif (IsOfPayloadType<SelectionChanged>(name))\n\t\t\t\treturn ConsoleColor.White;\n\t\t\tif (IsOfPayloadType<LogEvent>(name) || IsOfPayloadType<ExceptionEvent>(name))\n\t\t\t\treturn ConsoleColor.Yellow;\n\t\t\treturn defaultColor;\n\t\t}\n\n\t\tstatic bool IsOfPayloadType<T>(string name)\n\t\t{\n\t\t\treturn name == typeof (T).GetPayloadTypeName();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/HelpCommand.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tpublic class HelpCommand : CliCommand\n\t{\n\t\treadonly ColoredTextWriter _textWriter;\n\t\treadonly IEnumerable<CliCommand> _commands;\n\t\treadonly string _fuseProgramName;\n\n\t\tpublic HelpCommand(ColoredTextWriter textWriter, IEnumerable<CliCommand> commands, string fuseProgramName)\n\t\t\t: base(\"help\", \"Shows help for the specified command\")\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_commands = commands;\n\t\t\t_fuseProgramName = fuseProgramName;\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\t_textWriter.WriteHelp(new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\tnew HelpSynopsis(\"fuse help [command]\"),\n\t\t\t\tnew HelpDetailedDescription(\n\t\t\t\t\t\"You may find more information about fuse at our homepage.\\n\"  +\n\t\t\t\t\t\"Run 'fuse tutorial' command to quickly go there.\"),\n\t\t\t\tOptional.None()));\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tif (args.Length != 1)\n\t\t\t{\n\t\t\t\tWriteFuseUsage();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar firstArg = args[0];\n\n\t\t\tvar command =\n\t\t\t\t_commands\n\t\t\t\t\t.FirstOrNone(cmd => cmd.Name == firstArg)\n\t\t\t\t\t.OrThrow(new ExitWithError(\"'\" + firstArg + \"' is not a fuse command. See '\" + _fuseProgramName + \" help'.\"));\n\n\t\t\tcommand.Help();\n\t\t}\n\n\t\tvoid WriteFuseUsage()\n\t\t{\n\t\t\t_textWriter.WriteHelp(new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Optional.None()),\n\t\t\t\tnew HelpSynopsis(\"fuse [command] [arguments] [--version]\"),\n\t\t\t\tnew HelpDetailedDescription(\n\t\t\t\t\t\"Fuse consists of a set of tools that simplifies app development for a range of platforms and devices.\"),\n\t\t\t\tnew HelpOptions(\n\t\t\t\t\tnew Table(\"Commands\",\n\t\t\t\t\t\t_commands\n\t\t\t\t\t\t\t.Where(c => !c.IsSecret)\n\t\t\t\t\t\t\t.OrderBy(cmd => cmd.Name)\n\t\t\t\t\t\t\t.Select(cmd => new Row(cmd.Name, cmd.Description))))));\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/ImportCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Threading;\nusing Mono.Options;\nusing Outracks.Fuse.Import;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ImportCommand : CliCommand\n\t{\n\t\tpublic static ImportCommand CreateImportCommand()\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\tvar projectDetector = new ProjectDetector(shell);\n\n\t\t\tImportOperation[] importers = {\n\t\t\t\tnew SketchConversionOperation(\n\t\t\t\t\t\"sketch\",\n\t\t\t\t\t\"Import Sketch symbols from given sketch file or from <project>.sketchFiles\",\n\t\t\t\t\tshell,\n\t\t\t\t\tfuse.Report)\n\t\t\t};\n\n\t\t\treturn new ImportCommand(shell, projectDetector, importers);\n\t\t}\n\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly ProjectDetector _projectDetector;\n\t\treadonly ImportOperation[] _operations;\n\n\t\tpublic ImportCommand(\n\t\t\tIFileSystem fileSystem,\n\t\t\tProjectDetector projectDetector,\n\t\t\tparams ImportOperation[] availableOperations)\n\t\t\t: base(\"import\", \"Import a file to your fuse X project\")\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_projectDetector = projectDetector;\n\t\t\t_operations = availableOperations;\n\t\t}\n\n\t\t/// <exception cref=\"ExitWithError\" />\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar list = false;\n\t\t\t\tvar type = Optional.None<string>();\n\t\t\t\tvar maybeProject = Optional.None<IAbsolutePath>();\n\t\t\t\tvar options = CreateOptions(\n\t\t\t\t\ttype: s => type = s,\n\t\t\t\t\tproject: s => maybeProject = Optional.Some(_fileSystem.ResolveAbsolutePath(s)),\n\t\t\t\t\tlist: s => list = (s != null));\n\n\t\t\t\tvar remainingArgs = options.Parse(args);\n\n\t\t\t\tif (remainingArgs.Count < 1)\n\t\t\t\t{\n\t\t\t\t\tWriteUsage(Console.Error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar project = _projectDetector.GetCurrentProject(maybeProject);\n\t\t\t\tvar file = _fileSystem.ResolveAbsolutePath(remainingArgs[0]);\n\n\n\t\t\t\tif (list)\n\t\t\t\t{\n\t\t\t\t\tvar supportedOperations = _operations.Where(o => o.CanExecute(file, project)).ToArray();\n\t\t\t\t\tConsole.Out.WriteLine(\n\t\t\t\t\t\tsupportedOperations.Length == 0\n\t\t\t\t\t\t\t? \"This file can not be imported by Fuse\"\n\t\t\t\t\t\t\t: ListOperations(supportedOperations));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tImportOperation operation;\n\t\t\t\tif (type.HasValue)\n\t\t\t\t{\n\t\t\t\t\toperation = _operations\n\t\t\t\t\t\t.FirstOrNone(op => op.Name.Equals(type.Value, StringComparison.InvariantCultureIgnoreCase))\n\t\t\t\t\t\t.OrThrow(new ExitWithError(\"Unknown operation type \" + type.Value));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar supportedOperations = _operations.Where(o => o.CanExecute(file, project)).ToArray();\n\n\t\t\t\t\tif (supportedOperations.Length < 1)\n\t\t\t\t\t\tthrow new ExitWithError(\"This file can not be imported by Fuse\");\n\n\t\t\t\t\toperation = supportedOperations[0];\n\t\t\t\t}\n\n\t\t\t\toperation.Execute(file, project, remainingArgs);\n\t\t\t}\n\t\t\tcatch (ProjectNotFound)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Could not find destination project\");\n\t\t\t}\n\t\t\tcatch (ImportFailed p)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Import failed: \" + p.Message);\n\t\t\t}\n\t\t\tcatch (InvalidPath p)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"The path specified is invalid: \" + p.Path);\n\t\t\t}\n\t\t}\n\n\n\t\tstatic string ListOperations(IEnumerable<ImportOperation> operations)\n\t\t{\n\t\t\treturn \"The following import operations are supported for this file:\\n\"\n\t\t\t\t+ operations.Select(op => \"- \" + op.Description + \" (-t=\" + op.Name + \")\").Join(\"\\n\");\n\t\t}\n\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tWriteUsage (Console.Out);\n\t\t\tConsole.Out.WriteLine ();\n\t\t\tWriteOptions (Console.Out);\n\t\t}\n\n\t\tstatic void WriteUsage(TextWriter writer)\n\t\t{\n\t\t\twriter.WriteLine(\"Usage: fuse import <file> [options] \");\n\t\t}\n\n\t\tvoid WriteOptions(TextWriter writer)\n\t\t{\n\t\t\tvar options = CreateOptions(_ => { }, _ => { }, _ => { });\n\t\t\toptions.WriteOptionDescriptions(Console.Out);\n\n\t\t\tConsole.Out.WriteLine ();\n\n\t\t\tforeach (var operation in _operations)\n\t\t\t{\n\t\t\t\toperation.WriteOptions (Console.Out);\n\t\t\t}\n\t\t}\n\n\t\tOptionSet CreateOptions(Action<string> type, Action<string> project, Action<string> list)\n\t\t{\n\t\t\treturn new OptionSet()\n\t\t\t{\n\t\t\t\t{ \"p|project=\", \"Specify which project to import the file to. By default this is auto-detected based on working directory.\", project },\n\t\t\t\t{ \"l|list\", \"List the available import operations for the specified file\", list },\n\t\t\t\t{ \"t|type=\", \"Specify which import operation to perform. By default this is auto-detected based on file extension.\", type },\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/InstallCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading;\nusing Mono.Options;\nusing Outracks.Fuse.Components;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tenum InstallMode\n\t{\n\t\tInstall,\n\t\tCheckStatus,\n\t}\n\n\tpublic class InstallCommand : CliCommand\n\t{\n\t\tpublic static CliCommand CreateInstallCommand()\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\treturn new InstallCommand(\n\t\t\t\tColoredTextWriter.Out,\n\t\t\t\tfuse);\n\t\t}\n\n\t\treadonly ComponentInstallers _componentInstallers;\n\t\treadonly ColoredTextWriter _output;\n\t\treadonly OptionSet _options;\n\t\treadonly IFuse _fuse;\n\t\tInstallMode _mode = InstallMode.Install;\n\n\t\tpublic InstallCommand(\n\t\t\tColoredTextWriter output,\n\t\t\tIFuse fuse)\n\t\t\t: base(\"install\", \"Install an external component\")\n\t\t{\n\t\t\t_componentInstallers = new ComponentInstallers(fuse);\n\t\t\t_output = output;\n\t\t\t_fuse = fuse;\n\t\t\t_options = new OptionSet()\n\t\t\t{\n\t\t\t\t{ \"s|status\", \"Check install status of a package.\", a => _mode = InstallMode.CheckStatus }\n\t\t\t};\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tvar helpArguments = new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\tnew HelpSynopsis(\"fuse install [options] <component>\"),\n\t\t\t\tnew HelpDetailedDescription(\n@\"This command downloads and installs a component.\nNOTE: Network connection is required.\"),\n\t\t\t\tnew HelpOptions(\n\t\t\t\t\tnew[] {\n\t\t\t\t\t\t_options.ToTable(),\n\t\t\t\t\t\tnew Table(\"Components\",\n\t\t\t\t\t\t\tGetComponentInstallers())\n\t\t\t\t\t}));\n\t\t\t_output.WriteHelp(helpArguments);\n\t\t}\n\n\t\tIEnumerable<Row> GetComponentInstallers()\n\t\t{\n\t\t\treturn _componentInstallers\n\t\t\t\t.Components\n\t\t\t\t.Select(c => new Row(c.Name, c.Description));\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tVersionWriter.Write(_output, _fuse.Version);\n\n\t\t\tvar remainingArgs = _options.Parse(args).ToArray();\n\t\t\tvar packageName = remainingArgs.TryGetAt(0).OrThrow(new ExitWithError(\"Fuse install requires a valid component name. See 'fuse help install' for details.\"));\n\n\t\t\tvar component = _componentInstallers.Components.First(c => c.Name == packageName);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tswitch (_mode)\n\t\t\t\t{\n\t\t\t\t\tcase InstallMode.Install:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tusing (_output.PushColor(ConsoleColor.Yellow))\n\t\t\t\t\t\t\t\t_output.WriteLine(\"Starting \" + component.Name + \" installer\");\n\t\t\t\t\t\t\tcomponent.Install();\n\t\t\t\t\t\t\tusing (_output.PushColor(ConsoleColor.Yellow))\n\t\t\t\t\t\t\t\t_output.WriteLine(\"Done installing \" + component.Name);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase InstallMode.CheckStatus:\n\t\t\t\t\t\tif (component.Status == ComponentStatus.Installed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tusing (_output.PushColor(ConsoleColor.Green))\n\t\t\t\t\t\t\t\t_output.WriteLine(packageName + \" is installed.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (component.Status == ComponentStatus.UpdateAvailable)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new ExitWithError(\"An update is available to \" + packageName, (byte)ComponentStatus.UpdateAvailable);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new ExitWithError(packageName + \" is not installed.\", (byte)ComponentStatus.NotInstalled);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (PluginInstallerFailed e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/KillAllCommand.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tpublic class KillAllCommand : CliCommand\n    {\n\t\tpublic static KillAllCommand CreateKillAllCommand()\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\treturn new KillAllCommand(\n\t\t\t\tfuse,\n\t\t\t\tColoredTextWriter.Out,\n\t\t\t\tnew FuseKiller(fuse.Report, fuse.FuseRoot));\n\t\t}\n\n\t\treadonly IFuseKiller _killer;\n\t\treadonly IFuse _fuse;\n\t\treadonly ColoredTextWriter _coloredConsole;\n\n\t\tpublic KillAllCommand(IFuse fuse, ColoredTextWriter coloredConsole, IFuseKiller killer)\n\t\t\t: base(\"kill-all\", \"Kill all Fuse processes (even the daemon)\")\n\t\t{\n\t\t\t_fuse = fuse;\n\t\t\t_coloredConsole = coloredConsole;\n\t\t\t_killer = killer;\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\t_coloredConsole.WriteHelp(\n\t\t\t\tnew HelpArguments(\n\t\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\t\tnew HelpSynopsis(\"fuse \" + Name),\n\t\t\t\t\tnew HelpDetailedDescription(\"Kills all Fuse processes.\\nNOTE: It will also close all preview instances.\"),\n\t\t\t\t\tOptional.None()));\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tVersionWriter.Write(_coloredConsole, _fuse.Version);\n\t\t\t_killer.Execute(_coloredConsole);\n\t\t}\n    }\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/OpenCommand.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic class OpenCommand : DefaultCliCommand\n\t{\n\t\tpublic static CliCommand CreateOpenCommand()\n\t\t{\n\t\t\treturn new OpenCommand(new Shell(), FuseApi.Initialize(\"fuse\", new List<string>()));\n\t\t}\n\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly IFuse _fuse;\n\n\t\tpublic OpenCommand(IFileSystem fileSystem, IFuse fuse)\n\t\t\t: base(\"open\", \"Open fuse X project\")\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_fuse = fuse;\n\t\t}\n\n\t\tpublic override void Help() {}\n\n\t\tpublic override void RunDefault(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tRun(args, ct);\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tif (args.Length == 0)\n\t\t\t{\n\t\t\t\tLaunchFuseOpen(args);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar projectPath = new ProjectDetector(_fileSystem).GetProject(_fileSystem.ResolveAbsolutePath(args[0]));\n\t\t\t\t\tLaunchFuseOpen(args.Skip(1).ToArray(), projectPath);\n\t\t\t\t}\n\t\t\t\tcatch (ProjectNotFound)\n\t\t\t\t{\n\t\t\t\t\tthrow new ExitWithError(\"Project '\" + args[0] + \"' was not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void LaunchFuseOpen(string[] args, IAbsolutePath projectPath = null)\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t{\n\t\t\t\tvar actualArgs = new List<string> { \"--override-fuse-exe=\\\"\" + _fuse.FuseExe + \"\\\"\" };\n\t\t\t\tif (projectPath != null)\n\t\t\t\t{\n\t\t\t\t\tactualArgs.Add(projectPath.NativePath);\n\t\t\t\t}\n\t\t\t\tactualArgs.AddRange(args);\n\t\t\t\tStudio.Program.Main(actualArgs.ToArray());\n\t\t\t}\n\t\t\telse if (Platform.IsMac)\n\t\t\t{\n\t\t\t\tvar startInfo = new ProcessStartInfo()\n\t\t\t\t{\n\t\t\t\t\tArguments = args.Select(Uno.Extensions.QuoteSpace).Join(\" \"),\n\t\t\t\t};\n\t\t\t\tif (projectPath == null)\n\t\t\t\t\t_fuse.Studio.Start(startInfo);\n\t\t\t\telse\n\t\t\t\t\t_fuse.Studio.Open(_fileSystem.ResolveAbsolutePath(projectPath.NativePath), startInfo);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/Preview/ConsoleEventWriter.cs",
    "content": "using System;\nusing Fuse.Preview;\nusing Outracks.Simulator.Parser;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ConsoleEventWriter\n\t{\n\t\tpublic static void WriteRefreshFailed(this ColoredTextWriter output, UserCodeContainsErrors e)\n\t\t{\n\t\t\tusing (output.PushColor(ConsoleColor.Red))\n\t\t\t{\n\t\t\t\toutput.WriteLine(\"Refresh failed, see build log\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static void WriteRefreshFailed(this ColoredTextWriter output, Exception e)\n\t\t{\n\t\t\tusing (output.PushColor(ConsoleColor.DarkRed))\n\t\t\t{\n\t\t\t\toutput.WriteLine(\"Refresh failed: \" + e + \": \" + e.Message);\n\t\t\t\toutput.WriteLine(e.StackTrace);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void WriteBuildEvent(this ColoredTextWriter output, IBinaryMessage buildEvent)\n\t\t{\n\t\t\tbuildEvent.DoSome(\n\t\t\t\t(BuildLogged logEvent) =>\n\t\t\t\t{\n\t\t\t\t\tusing(output.PushColor(logEvent.Color == ConsoleColor.Red ? ConsoleColor.Red : (ConsoleColor?)null))\n\t\t\t\t\t\toutput.Write(logEvent.Text);\n\t\t\t\t},\n\t\t\t\t(BuildIssueDetected arg) =>\n\t\t\t\t{\n\t\t\t\t\tusing (output.PushColor(ToColor(arg.Severity)))\n\t\t\t\t\t{\n\t\t\t\t\t\toutput.WriteLine(arg.ToString().StripSuffix(\"\\n\"));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\tstatic ConsoleColor? ToColor(BuildIssueType type)\n\t\t{\n\t\t\tif (type == BuildIssueType.Error || type == BuildIssueType.FatalError)\n\t\t\t\treturn ConsoleColor.Red;\n\t\t\tif (type == BuildIssueType.Warning)\n\t\t\t\treturn ConsoleColor.Yellow;\n\t\t\treturn null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/Commands/Preview/ErrorHelpers/MissingRequiredPackageReferences.cs",
    "content": "using Fuse.Preview;\nusing Uno.Build;\n\nnamespace Outracks.Fuse\n{\n\tpublic class MissingRequiredPackageReferences : IErrorHelper\n\t{\n\t\tpublic void OnBuildFailed(BuildResult build)\n\t\t{\n\t\t\t/*\n\t\t\tvar errorSummary = build.Log.GetErrorSummary();\n\n\t\t\tvar isMissingApp =\n\t\t\t\t.OfType<BuildIssueDetected>()\n\t\t\t\t.Any(issue =>\n\t\t\t\t\tissue.Message.Contains(\"'Fuse' does not contain type or namespace 'App'\") ||\n\t\t\t\t\tissue.Message.Contains(\"There is no identifier named 'App' accessible in this scope.\"));\n\n\t\t\tvar requiredPackage =\n\t\t\t\tbuild.Target == BuildTarget.iOS ? \"Fuse.iOS\" :\n\t\t\t\tbuild.Target == BuildTarget.Android ? \"Fuse.Android\" :\n\t\t\t\t\"Fuse.Desktop\";\n\n\t\t\tvar isMissingPlatformPackage =\n\t\t\t\tbuild.HasPackageReference(requiredPackage) == false;\n\n\t\t\tif (isMissingApp && isMissingPlatformPackage)\n\t\t\t{\n\t\t\t\tbuild.AddError(\n\t\t\t\t\tcode: \"F1001\",\n\t\t\t\t\tmessage: \"The required package reference '\" + requiredPackage + \"' is missing from '\" + build.ProjectPath.NativePath + \"'\",\n\t\t\t\t\tsource: build.ProjectSource);\n\t\t\t}\n\t\t\t */\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/command/Commands/Preview/ExportTargetNotSupported.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ExportTargetNotSupported : Exception\n\t{\n\t\tpublic readonly string ExportTarget;\n\n\t\tpublic ExportTargetNotSupported(string exportTarget)\n\t\t\t: base(exportTarget + \" is not supported as a export target on this device.\")\n\t\t{\n\t\t\tExportTarget = exportTarget;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/Commands/Preview/PreviewArgumentResolver.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\t/// <summary>\n\t/// Figures out the project and optionally ux document to preview based argument\n\t/// </summary>\n\tpublic sealed class PreviewArgumentResolver\n\t{\n\t\treadonly ProjectDetector _projects;\n\t\treadonly IFileSystem _fileSystem;\n\n\t\tpublic PreviewArgumentResolver(ProjectDetector projects, IFileSystem fileSystem)\n\t\t{\n\t\t\t_projects = projects;\n\t\t\t_fileSystem = fileSystem;\n\t\t}\n\n\t\t/// <exception cref=\"InvalidPath\" />\n\t\t/// <exception cref=\"System.Security.SecurityException\" />\n\t\t/// <exception cref=\"ProjectNotFound\" />\n\t\tpublic PreviewArguments Resolve(List<string> mutableArgs)\n\t\t{\n\t\t\tvar compileOnly = mutableArgs\n\t\t\t\t.Remove(\"--compile-only\");\n\n\t\t\tvar directToDevice = mutableArgs\n\t\t\t\t.Remove(\"--direct-to-device\");\n\n\t\t\tvar quitAfterApkLaunch = mutableArgs\n\t\t\t\t.Remove(\"--quit-after-apk-launch\");\n\n\t\t\tvar project = mutableArgs\n\t\t\t\t.TryRemoveAt(0)\n\t\t\t\t.Select(_fileSystem.ResolveAbsolutePath);\n\n\t\t\tvar defines = mutableArgs\n\t\t\t\t.Where(a => a.StartsWith(\"-D\"))\n\t\t\t\t.Select(a => a.Substring(\"-D\".Length))\n\t\t\t\t.ToImmutableList();\n\n\t\t\tmutableArgs.RemoveAll(a => a.StartsWith(\"-D\"));\n\n\t\t\treturn new PreviewArguments(\n\t\t\t\tproject: _projects.GetCurrentProject(project),\n\t\t\t\tcompileOnly: compileOnly,\n\t\t\t\tdirectToDevice: directToDevice,\n\t\t\t\tdefines: defines,\n\t\t\t\tquitAfterApkLaunch: quitAfterApkLaunch);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/Commands/Preview/PreviewArguments.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Net;\nusing Fuse.Preview;\nusing Outracks.IO;\nusing Uno.Build;\n\nnamespace Outracks.Fuse\n{\n\tpublic sealed class PreviewArguments\n\t{\n\t\tpublic readonly AbsoluteFilePath Project;\n\t\tpublic readonly BuildTarget Target;\n\t\tpublic readonly IImmutableSet<IPEndPoint> Endpoints;\n\t\tpublic readonly Optional<string> BuildTag;\n\t\tpublic readonly bool CompileOnly;\n\t\tpublic readonly bool DirectToDevice;\n\t\tpublic readonly IImmutableList<string> Defines;\n\t\tpublic readonly bool IsVerboseBuild;\n\t\tpublic readonly bool BuildLibraries;\n\t\tpublic readonly bool QuitAfterApkLaunch;\n\t\tpublic readonly bool PrintUnoConfig;\n\n\t\tpublic PreviewArguments(AbsoluteFilePath project, Optional<BuildTarget> target = default(Optional<BuildTarget>),\n\t\t\tIImmutableSet<IPEndPoint> endpoints = null,\n\t\t\tOptional<string> buildTag = default(Optional<string>),\n\t\t\tbool compileOnly = false,\n\t\t\tbool directToDevice = false,\n\t\t\tIImmutableList<string> defines = null,\n\t\t\tbool isVerboseBuild = false,\n\t\t\tbool buildLibraries = false,\n\t\t\tbool quitAfterApkLaunch = false,\n\t\t\tbool printUnoConfig = false)\n\t\t{\n\t\t\tProject = project;\n\t\t\tTarget = target.Or(PreviewTarget.DotNet);\n\t\t\tBuildTag = buildTag;\n\t\t\tCompileOnly = compileOnly;\n\t\t\tDirectToDevice = directToDevice;\n\t\t\tEndpoints = endpoints ?? ImmutableHashSet<IPEndPoint>.Empty;\n\t\t\tDefines = defines ?? ImmutableList<string>.Empty;\n\t\t\tIsVerboseBuild = isVerboseBuild;\n\t\t\tBuildLibraries = buildLibraries;\n\t\t\tQuitAfterApkLaunch = quitAfterApkLaunch;\n\t\t\tPrintUnoConfig = printUnoConfig;\n\t\t}\n\n\t\tpublic PreviewArguments AddEndpoints(IEnumerable<IPEndPoint> endpoints)\n\t\t{\n\t\t\treturn With(endpoints: Endpoints.Union(endpoints));\n\t\t}\n\n\t\tpublic PreviewArguments With(\n\t\t\tOptional<AbsoluteFilePath> project = default (Optional<AbsoluteFilePath>),\n\t\t\tOptional<BuildTarget> target = default (Optional<BuildTarget>),\n\t\t\tIImmutableSet<IPEndPoint> endpoints = null,\n\t\t\tOptional<string> buildTag = default (Optional<string>),\n\t\t\tOptional<bool> compileOnly = default(Optional<bool>),\n\t\t\tOptional<bool> directToDevice = default(Optional<bool>),\n\t\t\tOptional<bool> isVerboseBuild = default(Optional<bool>),\n\t\t\tOptional<bool> buildLibraries = default(Optional<bool>),\n\t\t\tOptional<bool> quitAfterApkLaunch = default(Optional<bool>),\n\t\t\tOptional<bool> printUnoConfig = default(Optional<bool>))\n\t\t{\n\t\t\treturn new PreviewArguments(\n\t\t\t\tproject.Or(Project),\n\t\t\t\ttarget.Or(Target),\n\t\t\t\tendpoints ?? Endpoints,\n\t\t\t\tbuildTag.Or(BuildTag),\n\t\t\t\tcompileOnly.Or(CompileOnly),\n\t\t\t\tdirectToDevice.Or(DirectToDevice),\n\t\t\t\tDefines,\n\t\t\t\tisVerboseBuild.Or(IsVerboseBuild),\n\t\t\t\tbuildLibraries.Or(BuildLibraries),\n\t\t\t\tquitAfterApkLaunch.Or(QuitAfterApkLaunch),\n\t\t\t\tprintUnoConfig.Or(PrintUnoConfig));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/Preview/PreviewCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Globalization;\nusing System.IO;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Threading;\nusing Fuse.Preview;\nusing Mono.Options;\nusing Outracks.IO;\nusing Outracks.IPC;\nusing Outracks.Simulator;\nusing Uno.Build;\n\nnamespace Outracks.Fuse\n{\n\tpublic class PreviewCommand : CliCommand\n\t{\n\t\tpublic static PreviewCommand CreatePreviewCommand()\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar projectDetector = new ProjectDetector(shell);\n\t\t\tvar coloredConsole = ColoredTextWriter.Out;\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\n\t\t\treturn new PreviewCommand(\n\t\t\t\tcoloredConsole,\n\t\t\t\tnew PreviewArgumentResolver(\n\t\t\t\t\tprojectDetector,\n\t\t\t\t\tshell),\n\t\t\t\tnew PreviewMain(\n\t\t\t\t\tshell, fuse,\n\t\t\t\t\tnew PreviewExported(coloredConsole),\n\t\t\t\t\tcoloredConsole),\n\t\t\t\t\tfuse);\n\t\t}\n\n\t\treadonly PreviewArgumentResolver _argumentResolver;\n\t\treadonly ColoredTextWriter _textWriter;\n\t\treadonly PreviewMain _preview;\n\t\treadonly HelpArguments _helpArguments;\n\t\treadonly OptionSet _optionSet;\n\t\treadonly IFuse _fuse;\n\n\t\tbool _promtOnError = false;\n\t\tOptional<string> _buildTag;\n\t\tOptional<IPEndPoint> _endPoint;\n\t\tstring _previewTarget;\n\t\tbool _isVerboseBuild = false;\n\t\tbool _buildLibraries = false;\n\t\tbool _printUnoConfig = false;\n\n\t\tpublic PreviewCommand(ColoredTextWriter textWriter, PreviewArgumentResolver argumentResolver, PreviewMain preview, IFuse fuse)\n\t\t\t: base(\"preview\", \"Preview an app\")\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_preview = preview;\n\t\t\t_argumentResolver = argumentResolver;\n\t\t\t_fuse = fuse;\n\t\t\t_optionSet = CreateOptions();\n\t\t\t_helpArguments = new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\tnew HelpSynopsis(\"fuse preview [target] [options] [project-path]\"),\n\t\t\t\tnew HelpDetailedDescription(@\"Previews an app by using a simulator.\nYour app will instantly reload when there are any saved changes to an UX file.\n[project-path] can be a relative or an absolute path to a project file.\nIt can also be the relative or absolute path to the containing directory of the project.\nWorking directory is used as [project-path] if not specified otherwise.\n\nNOTE: The project must contain an UX file with an App tag for preview to work.\"),\n\t\t\t\tnew HelpOptions(new []\n\t\t\t\t{\n\t\t\t\t\t_optionSet.ToTable(),\n\t\t\t\t\tnew Table(\"Available preview targets\", new []\n\t\t\t\t\t{\n\t\t\t\t\t\tnew Row(\"dotnet\",\t\"Preview locally. (default)\"),\n\t\t\t\t\t\tnew Row(\"android\",\t\"Preview on an Android device.\"),\n \t\t\t\t\t\tnew Row(\"ios\",\t\t\"Preview on an iOS device. NOTE: Only macOS can target this device.\"),\n \t\t\t\t\t\tnew Row(\"native\",\t\"Preview locally (native).\")\n\t\t\t\t\t}),\n\t\t\t\t}));\n\t\t}\n\n\t\tOptionSet CreateOptions()\n\t\t{\n\t\t\tvar optionSet = new OptionSet()\n\t\t\t{\n\t\t\t\t{ \"t=|target=\", \"Preview target (see: Available preview targets)\", a => _previewTarget = a },\n\t\t\t\t{ \"endpoint=\", \"Custom endpoint to proxy server. Formatted as ADDRESS:PORT.\", a => _endPoint = ParseEndpoint(a) },\n\t\t\t\t{ \"n=|name=\", \"Identify the preview build with a name returned in the Fuse.BuildStarted event as a tag.\", a => _buildTag = NullToNone.ToOptional(a) },\n\t\t\t\t{ \"v|verbose\", \"Verbose output.\", a => _isVerboseBuild = true },\n\t\t\t\t{ \"l|libs\", \"Build libraries.\", a => _buildLibraries = true },\n\t\t\t\t{ \"prompt-on-error\", \"Console window will not close if there are build errors or fatal crashes in this mode.\", a => _promtOnError = true },\n\t\t\t\t{ \"print-unoconfig\", \"Print uno config before starting preview.\", a => _printUnoConfig = true },\n\t\t\t};\n\n\t\t\treturn optionSet;\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\t_textWriter.WriteHelp(_helpArguments);\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tRunInternal(args);\n\t\t\t}\n\t\t\tcatch (ExitWithError e)\n\t\t\t{\n\t\t\t\tif (_promtOnError)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"fuse: \" + e.ErrorOutput);\n\t\t\t\t\tConsole.WriteLine(\"Press any key to exit.\");\n\t\t\t\t\tConsole.ReadKey(true);\n\t\t\t\t}\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tif (_promtOnError)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"fuse: unhandled exception: \" + e.Message);\n\t\t\t\t\tConsole.WriteLine(e.StackTrace);\n\t\t\t\t\tConsole.WriteLine(\"Press any key to exit.\");\n\t\t\t\t\tConsole.ReadKey(true);\n\t\t\t\t}\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\tvoid RunInternal(string[] args)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tBuildTarget target;\n\t\t\t\tVersionWriter.Write(_textWriter, _fuse.Version);\n\t\t\t\tvar parsedArgs = _optionSet.Parse(args);\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Convert legacy name\n\t\t\t\t\tif (_previewTarget?.ToUpper() == \"LOCAL\")\n\t\t\t\t\t\t_previewTarget = \"dotnet\";\n\n\t\t\t\t\ttarget = BuildTargets.Get(_previewTarget, parsedArgs);\n\t\t\t\t}\n\t\t\t\tcatch (ArgumentException)\n\t\t\t\t{\n\t\t\t\t\tthrow new UnknownPreviewTarget(_previewTarget ?? \"dotnet\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar previewArgs = _argumentResolver\n\t\t\t\t\t.Resolve(parsedArgs)\n\t\t\t\t\t.With(\n\t\t\t\t\t\ttarget: target,\n\t\t\t\t\t\tbuildTag: _buildTag,\n\t\t\t\t\t\tisVerboseBuild: _isVerboseBuild,\n\t\t\t\t\t\tbuildLibraries: _buildLibraries,\n\t\t\t\t\t\tprintUnoConfig: _printUnoConfig);\n\n\t\t\t\tif (_endPoint.HasValue)\n\t\t\t\t\tpreviewArgs = previewArgs.With(endpoints: ImmutableHashSet.Create(_endPoint.Value));\n\n\t\t\t\t_preview.Preview(previewArgs);\n\t\t\t}\n\t\t\tcatch (InvalidPath e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\n\t\t\t\t\t\"The specified path '\" + e.Path + \"' is invalid\" +\n\t\t\t\t\t\t(e.InnerException != null ? \": \" + e.InnerException.Message : \"\"));\n\t\t\t}\n\t\t\tcatch (DaemonException e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (FailedToCreateUniqueDirectory e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (FailedToCreateOutputDir e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t\tcatch (BuildFailed)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Failed to compile project\");\n\t\t\t}\n\t\t\tcatch (ProjectNotFound)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Could not find a fuse X project to preview\");\n\t\t\t}\n\t\t\tcatch (UnknownPreviewTarget e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\n\t\t\t\t\t\"Unknown preview target \" + e.Target + \". Please run 'fuse help preview' for all available targets\");\n\t\t\t}\n\t\t\tcatch (FileNotFoundException)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Could not find the file specified\");\n\t\t\t}\n\t\t\tcatch (InvalidEndpointString)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\n\t\t\t\t\t\"Invalid endpoint string, excepted it to be formatted as [Address]:[Port]. For example 127.0.0.1:12124\");\n\t\t\t}\n\t\t\tcatch (SocketException e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\n\t\t\t\t\t\"A network error occurred: \" + e.Message + \"\\nPlease check your network setup and try again.\");\n\t\t\t}\n\t\t\tcatch (UnableToResolveHostNameException e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\n\t\t\t\t\t\"A network error occurred: \" + e.Message + \"\\nPlease check your network setup and try again.\");\n\t\t\t}\n\t\t\tcatch (ExportTargetNotSupported e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(\"Previewing of target \" + e.ExportTarget + \" is not supported on this operating system.\");\n\t\t\t}\n\t\t\tcatch (RunFailed e)\n\t\t\t{\n\t\t\t\tthrow new ExitWithError(e.Message);\n\t\t\t}\n\t\t}\n\n\t\tstatic IPEndPoint ParseEndpoint(string endpoint)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar ipPort = endpoint.Split(new[] { \":\" }, 2, StringSplitOptions.RemoveEmptyEntries);\n\t\t\t\treturn new IPEndPoint(IPAddress.Parse(ipPort[0]), ipPort.Length > 1 ? int.Parse(ipPort[1]) : 12124);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new InvalidEndpointString(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tclass InvalidEndpointString : Exception\n\t{\n\t\tpublic InvalidEndpointString(Exception innerException) : base(\"Invalid endpoint string\", innerException)\n\t\t{\n\t\t}\n\t}\n\n\tclass UnknownPreviewTarget : Exception\n\t{\n\t\tpublic readonly string Target;\n\n\t\tpublic UnknownPreviewTarget(string target)\n\t\t\t: base(\"Unknown target name: \" + target)\n\t\t{\n\t\t\tTarget = target;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/Preview/PreviewExported.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing Fuse.Preview;\nusing Outracks.Fuse.Live;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Protocol.Preview;\nusing Outracks.IO;\nusing Outracks.IPC;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Parser;\nusing Outracks.Simulator.Protocol;\nusing Uno.Build;\nusing Uno.Logging;\nusing BuildTarget = Outracks.Fuse.Protocol.BuildTarget;\n\nnamespace Outracks.Fuse\n{\n\tpublic class PreviewExported\n\t{\n\t\treadonly ColoredTextWriter _output;\n\t\tpublic PreviewExported(ColoredTextWriter output)\n\t\t{\n\t\t\t_output = output;\n\t\t}\n\n\t\t/// <exception cref=\"SocketException\" />\n\t\t/// <exception cref=\"UnableToResolveHostNameException\" />\n\t\t/// <exception cref=\"BuildFailed\" />\n\t\t/// <exception cref=\"RunFailed\" />\n\t\tpublic void BuildAndRunExported(PreviewArguments args, IMessagingService client, IFileSystem shell, IFuse fuse)\n\t\t{\n\t\t\tvar buildEvents = new Subject<IBinaryMessage>();\n\n\t\t\tvar builder = UnoBuildWrapper.Create(\n\t\t\t\tshell, fuse.Version, buildEvents, false,\n\t\t\t\tnew MissingRequiredPackageReferences());\n\n\t\t\tvar projectId = ProjectIdComputer.IdFor(args.Project);\n\n\t\t\tusing (PushEventsToDaemon.Start(buildEvents, client, args.Project, projectId, GetBuildTarget(args.Target)))\n\t\t\tusing (buildEvents.Subscribe(_output.WriteBuildEvent))\n\t\t\t{\n\t\t\t\tif (args.Endpoints.Count == 0)\n\t\t\t\t\targs = args.AddEndpoints(GetProxyEndPoints());\n\n\t\t\t\tvar build = builder\n\t\t\t\t\t.LoadOrBuildRunnable(args, CancellationToken.None)\n\t\t\t\t\t.GetResultAndUnpackExceptions();\n\n\t\t\t\tif (args.CompileOnly == false)\n\t\t\t\t\tbuild.Run(buildEvents.ToProgress());\n\t\t\t}\n\t\t}\n\n\t\tstatic BuildTarget GetBuildTarget(Uno.Build.BuildTarget target)\n\t\t{\n\t\t\treturn (BuildTarget) Enum.Parse(typeof(BuildTarget), target.ToString(), true);\n\t\t}\n\n\t\t/// <exception cref=\"UnableToResolveHostNameException\" />\n\t\tstatic IEnumerable<IPEndPoint> GetProxyEndPoints()\n\t\t{\n\t\t\treturn NetworkHelper\n\t\t\t\t.GetInterNetworkIps()\n\t\t\t\t.Select(ip => new IPEndPoint(ip, 12124)); // TODO: Remove localhost address from this list\n\t\t}\n\t}\n\n\tstatic class LegacyExtension\n\t{\n\t\tpublic static async System.Threading.Tasks.Task<ExportBuild> LoadOrBuildRunnable(this UnoBuildWrapper self, PreviewArguments args, CancellationToken cancellationToken)\n\t\t{\n\t\t\tvar id = Guid.NewGuid();\n\t\t\tvar buildResult = await self.BuildUno(id,\n\t\t\t\tnew BuildProject(\n\t\t\t\t\targs.Project.NativePath,\n\t\t\t\t\targs.Defines.ToImmutableList(),\n\t\t\t\t\targs.BuildLibraries,\n\t\t\t\t\targs.IsVerboseBuild),\n\t\t\t\targs.Target,\n\t\t\t\targs.DirectToDevice,\n\t\t\t\tcancellationToken,\n\t\t\t\targs.QuitAfterApkLaunch);\n\t\t\treturn new ExportBuild(buildResult, id);\n\t\t}\n\t}\n\n\tpublic class ExportBuild\n\t{\n\t\treadonly BuildResult _buildResult;\n\t\treadonly Guid _buildId;\n\n\t\tpublic ExportBuild(BuildResult buildResult, Guid buildId)\n\t\t{\n\t\t\t_buildResult = buildResult;\n\t\t\t_buildId = buildId;\n\t\t}\n\n\t\tpublic void Run(IProgress<IBinaryMessage> progress)\n\t\t{\n\t\t\t// TODO: Do something with our device simulator build...\n\t\t\tvar loggedEvents = new AccumulatingProgress<IBinaryMessage>(progress);\n\t\t\tvar textWriter = new TextWriterAdapter(_buildId, loggedEvents);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_buildResult.Run(new Log(textWriter));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new RunFailed(e);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/Preview/PreviewMain.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading.Tasks;\nusing Fuse.Preview;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Protocol.Messages;\nusing Outracks.Fuse.Protocol.Preview;\nusing Outracks.IO;\nusing Uno.Configuration;\n\nnamespace Outracks.Fuse\n{\n\tpublic sealed class PreviewMain\n\t{\n\t\treadonly PreviewExported _exportedPreview;\n\n\t\treadonly IFuse _fuse;\n\t\treadonly IFileSystem _shell;\n\t\treadonly ColoredTextWriter _textWriter;\n\n\t\tpublic PreviewMain(\n\t\t\tIFileSystem shell,\n\t\t\tIFuse fuse,\n\t\t\tPreviewExported exportedPreview,\n\t\t\tColoredTextWriter textWriter)\n\t\t{\n\t\t\t_fuse = fuse;\n\t\t\t_exportedPreview = exportedPreview;\n\t\t\t_textWriter = textWriter;\n\t\t\t_shell = shell;\n\t\t}\n\n\t\t/// <exception cref=\"FailedToSpawnDaemon\" />\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\t/// <exception cref=\"FailedToGreetDaemon\" />\n\t\t/// <exception cref=\"FailedToCreateOutputDir\"></exception>\n\t\tpublic void Preview(PreviewArguments args)\n\t\t{\n\t\t\tif (!_fuse.IsLicenseValid() && args.Target.Identifier != PreviewTarget.DotNet.Identifier)\n\t\t\t{\n\t\t\t\t_fuse.Report.Error(\"Please activate fuse X before using preview.\");\n\t\t\t\t_fuse.Report.Info(\"Open fuse X for activation instructions, or visit \" + WebLinks.Dashboard);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_fuse.Report.Info(\"Starting preview for \" + args.Project + \", target \" + args.Target, ReportTo.LogAndUser);\n\n\t\t\tif (args.PrintUnoConfig)\n\t\t\t{\n\t\t\t\tPrintUnoConfig(UnoConfig.Current, _textWriter);\n\t\t\t}\n\n\t\t\tif (args.Target.Identifier == PreviewTarget.DotNet.Identifier)\n\t\t\t{\n\t\t\t\tLaunchDesignerAndSubscribe(args).Wait();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar client = GetMessagingService(args).ToObservable().Switch();\n\n\t\t\t_exportedPreview.BuildAndRunExported(args, client, _shell, _fuse);\n\t\t}\n\n\t\tstatic void PrintUnoConfig(UnoConfig unoConfig, ColoredTextWriter coloredTextWriter)\n\t\t{\n\t\t\tusing (coloredTextWriter.PushColor(ConsoleColor.Green))\n\t\t\t{\n\t\t\t\tcoloredTextWriter.WriteLine(\"Uno settings\");\n\t\t\t}\n\t\t\tcoloredTextWriter.WriteLine(unoConfig.ToString());\n\t\t\tcoloredTextWriter.WriteLine();\n\t\t\tusing (coloredTextWriter.PushColor(ConsoleColor.Green))\n\t\t\t{\n\t\t\t\tcoloredTextWriter.WriteLine(\"Config files\");\n\t\t\t}\n\t\t\tforeach (var file in unoConfig.Files)\n\t\t\t{\n\t\t\t\tcoloredTextWriter.WriteLine(file);\n\t\t\t}\n\t\t}\n\n\t\tasync Task LaunchDesignerAndSubscribe(PreviewArguments args)\n\t\t{\n\t\t\tvar client = await GetMessagingService(args);\n\t\t\tvar projectId = ProjectIdComputer.IdFor(args.Project);\n\t\t\tvar closed = SubscribeForProjectClosed(client, projectId);\n\t\t\tSubscribeForBuildStarted(client, projectId);\n\t\t\tSubscribeForLog(client, projectId);\n\n\t\t\tvar openArgs = args.Project.ToString().Yield()\n\t\t\t\t.Concat(args.Defines.Select(d => \"-D\" + d))\n\t\t\t\t.Concat(args.IsVerboseBuild ? Optional.Some(\"-v\") : Optional.None())\n\t\t\t\t.ToArray();\n\n\t\t\t_fuse.Report.Info(\"Opening \" + string.Join(\",\", openArgs.Select(a => \"'\" + a + \"'\")), ReportTo.LogAndUser);\n\t\t\t_fuse.StartFuse(\"open\", openArgs);\n\t\t\tawait closed;\n\t\t}\n\n\t\tstatic async Task SubscribeForProjectClosed(IMessagingService client, Guid projectId)\n\t\t{\n\t\t\tvar firstAsync = client.BroadcastedEvents<ProjectClosed>(wantReplay: false).SubscribeOn(TaskPoolScheduler.Default)\n\t\t\t\t.FirstAsync(e => (e.ProjectId == projectId));\n\t\t\ttry\n\t\t\t{\n\t\t\t\tawait firstAsync;\n\t\t\t}\n\t\t\tcatch (InvalidOperationException)\n\t\t\t{\n\t\t\t\t//This can happen when the user presses Ctrl+C and the client shuts down, in which case we just want to exit cleanly\n\t\t\t}\n\t\t}\n\n\t\tvoid SubscribeForBuildStarted(IMessagingService client, Guid projectId)\n\t\t{\n\t\t\tclient.BroadcastedEvents<BuildStartedData>(wantReplay: false).SubscribeOn(TaskPoolScheduler.Default)\n\t\t\t\t.Subscribe(e =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (e.ProjectId == projectId && e.Target == BuildTarget.DotNet )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSubscribeForBuildLogged(client, e.BuildId);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\n\t\tvoid SubscribeForBuildLogged(IMessagingService client, Guid buildId)\n\t\t{\n\t\t\tclient.BroadcastedEvents<BuildLoggedData>(wantReplay: false).SubscribeOn(TaskPoolScheduler.Default)\n\t\t\t\t.Subscribe(e =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (e.BuildId == buildId)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_textWriter.WriteLine(e.Message.Trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\n\t\tvoid SubscribeForLog(IMessagingService client, Guid projectId)\n\t\t{\n\t\t\tclient.BroadcastedEvents<LogEvent>(wantReplay: false).SubscribeOn(TaskPoolScheduler.Default)\n\t\t\t\t.Subscribe(e =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (new Guid(e.ProjectId) == projectId && e.DeviceName == \"Viewport\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_textWriter.WriteLine(e.Message.Trim());\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\n\t\tTask<IMessagingService> GetMessagingService(PreviewArguments args)\n\t\t{\n\t\t\tif (args.CompileOnly)\n\t\t\t\treturn Task.FromResult((IMessagingService)new NullMessagingService());\n\n\t\t\treturn _fuse.ConnectOrSpawnAsync(\n\t\t\t\tidentifier: \"preview \" + args.Project.NativePath);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/Preview/ResetPreviewCliCommand.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ResetPreviewCliCommand : CliCommand\n\t{\n\t\tpublic static CliCommand CreateResetPreviewCommand()\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\treturn new ResetPreviewCliCommand(ColoredTextWriter.Out, fuse);\n\t\t}\n\n\t\treadonly IFuseLauncher _daemonSpawner;\n\t\treadonly ColoredTextWriter _textWriter;\n\t\treadonly HelpArguments _helpArguments;\n\n\t\tpublic ResetPreviewCliCommand(ColoredTextWriter textWriter, IFuseLauncher daemonSpawner)\n\t\t\t: base(\"reset-preview\", \"Causes all active previews to reset to the default state.\", true)\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_daemonSpawner = daemonSpawner;\n\t\t\t_helpArguments = new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\tnew HelpSynopsis(\"fuse reset-preview\"),\n\t\t\t\tnew HelpDetailedDescription(@\"Causes all active previews to reset to their default application state.\"),\n\t\t\t\tOptional.None());\n\t\t}\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tusing (var client =\n\t\t\t\t_daemonSpawner.ConnectOrSpawn(\n\t\t\t\t\tidentifier: \"PreviewReset\",\n\t\t\t\t\ttimeout: TimeSpan.FromMinutes(1)))\n\t\t\t{\n\t\t\t\tclient.Broadcast(new ResetPreviewEvent());\n\t\t\t}\n\t\t}\n\t\tpublic override void Help()\n\t\t{\n\t\t\t_textWriter.WriteHelp(_helpArguments);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/Preview/UnknownDocumentOrProjectType.cs",
    "content": "using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic sealed class UnknownDocumentOrProjectType : Exception\n\t{\n\t\tpublic readonly AbsoluteFilePath Path;\n\n\t\tpublic UnknownDocumentOrProjectType(AbsoluteFilePath path)\n\t\t{\n\t\t\tPath = path;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/Commands/TutorialCommand.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tclass TutorialCommand : CliCommand\n\t{\n\t\tpublic static CliCommand CreateTutorialCommand()\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\treturn new TutorialCommand(ColoredTextWriter.Out);\n\t\t}\n\n\t\treadonly ColoredTextWriter _textWriter;\n\t\treadonly HelpArguments _helpArguments;\n\n\t\tpublic TutorialCommand(ColoredTextWriter textWriter) : base(\"tutorial\", \"Go to tutorials and guides\")\n\t\t{\n\t\t\t_textWriter = textWriter;\n\t\t\t_helpArguments = new HelpArguments(\n\t\t\t\tnew HelpHeader(\"fuse \" + Name, Description),\n\t\t\t\tnew HelpSynopsis(\"fuse tutorial\"),\n\t\t\t\tnew HelpDetailedDescription(\n@\"Takes you to our landing page, using the default program set for opening HTTP URL's.\nNOTE: It require network connection.\"),\n\t\t\t\tOptional.None());\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\t_textWriter.WriteHelp(_helpArguments);\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tProcess.Start(WebLinks.Tutorial);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Commands/UriCommand.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse\n{\n\tpublic class UriCommand : CliCommand\n\t{\n\t\tpublic UriCommand() : base(\"uri\", \"Handles fuse-x:// links\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t}\n\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", new List<string>());\n\t\t\tvar task = fuse.ConnectOrSpawnAsync(\"fuse\");\n\t\t\tvar daemon = task.ToObservable().Switch();\n\t\t\tnew UriHandler(fuse, daemon).OnUri(args.FirstOrDefault());\n\t\t\ttask.Wait(ct);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/ExceptionWriter.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Fuse\n{\n\tstatic class ExceptionWriter\n\t{\n\t\tpublic static void WriteStackTraces(this TextWriter writer, Exception e)\n\t\t{\n\t\t\twriter.WriteLine(e.StackTrace);\n\t\t\twhile ((e = e.InnerException) != null)\n\t\t\t{\n\t\t\t\twriter.WriteLine(\"Inner exception: \" + e.Message);\n\t\t\t\twriter.WriteLine(e.StackTrace);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/ExitWithError.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ExitWithError : Exception\n\t{\n\t\tpublic readonly byte ExitCode;\n\t\tpublic readonly string ErrorOutput;\n\n\t\tpublic ExitWithError(string errorOutput, byte exitCode = 1)\n\t\t{\n\t\t\tExitCode = exitCode;\n\t\t\tErrorOutput = errorOutput;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/HelpTools.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Outracks.Fuse\n{\n\tpublic class HelpHeader\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly Optional<string> Description;\n\n\t\tpublic HelpHeader(string name, Optional<string> description)\n\t\t{\n\t\t\tName = name;\n\t\t\tDescription = description;\n\t\t}\n\t}\n\n\tpublic class HelpSynopsis\n\t{\n\t\tpublic readonly string Usage;\n\t\tpublic HelpSynopsis(string usage)\n\t\t{\n\t\t\tUsage = usage;\n\t\t}\n\t}\n\n\tpublic class HelpDetailedDescription\n\t{\n\t\tpublic readonly string Description;\n\t\tpublic HelpDetailedDescription(string description)\n\t\t{\n\t\t\tDescription = description;\n\t\t}\n\t}\n\n\tpublic class HelpOptions\n\t{\n\t\tpublic readonly List<Table> Tables = new List<Table>();\n\t\tpublic HelpOptions(Table table)\n\t\t{\n\t\t\tTables.Add(table);\n\t\t}\n\n\t\tpublic HelpOptions(IEnumerable<Table> tables)\n\t\t{\n\t\t\tTables.AddRange(tables);\n\t\t}\n\t}\n\n\tpublic class HelpArguments\n\t{\n\t\tpublic readonly HelpHeader HelpHeader;\n\t\tpublic readonly HelpSynopsis Synopsis;\n\t\tpublic readonly HelpDetailedDescription DetailedDescription;\n\t\tpublic readonly Optional<HelpOptions> Options;\n\n\t\tpublic HelpArguments(HelpHeader helpHeader, HelpSynopsis usage, HelpDetailedDescription detailedDescription, Optional<HelpOptions> options)\n\t\t{\n\t\t\tHelpHeader = helpHeader;\n\t\t\tSynopsis = usage;\n\t\t\tDetailedDescription = detailedDescription;\n\t\t\tOptions = options;\n\t\t}\n\t}\n\n\tpublic static class HelpWriterExtension\n\t{\n\t\tpublic static void WriteHelp(this ColoredTextWriter writer, HelpArguments arguments)\n\t\t{\n\t\t\tusing (writer.PushColor(ConsoleColor.Yellow))\n\t\t\t{\n\t\t\t\twriter.WriteLine(\"Usage: \" + arguments.Synopsis.Usage);\n\t\t\t\targuments.HelpHeader.Description.Do(writer.WriteLine);\n\t\t\t}\n\n\t\t\targuments.Options.Do(\n\t\t\t\toptions =>\n\t\t\t\t{\n\t\t\t\t\tforeach (var table in options.Tables)\n\t\t\t\t\t{\n\t\t\t\t\t\tusing (writer.PushColor(ConsoleColor.Green))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twriter.WriteLine(table.Name.ToUpper());\n\t\t\t\t\t\t}\n\t\t\t\t\t\twriter.WriteTable(table, indent: 4, columnPadding: 4);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\tusing (writer.PushColor(ConsoleColor.Green))\n\t\t\t\twriter.WriteLine(\"DESCRIPTION\");\n\t\t\twriter.WriteLine(arguments.DetailedDescription.Description);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/LazyCliCommand.cs",
    "content": "﻿using System;\nusing System.Threading;\n\nnamespace Outracks.Fuse\n{\n\tclass LazyCliCommand : CliCommand\n\t{\n\t\tpublic readonly Lazy<CliCommand> CliCommand;\n\n\t\tpublic LazyCliCommand(string name, string description, bool isSecret, Func<CliCommand> cliCommand)\n\t\t\t: base(name, description, isSecret)\n\t\t{\n\t\t\tCliCommand = new Lazy<CliCommand>(cliCommand);\n\t\t}\n\n\t\tpublic override void Help()\n\t\t{\n\t\t\tCliCommand.Value.Help();\n\t\t}\n\n\t\t/// <exception cref=\"ExitWithError\" />\n\t\tpublic override void Run(string[] args, CancellationToken ct)\n\t\t{\n\t\t\tCliCommand.Value.Run(args, ct);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/Outracks.Fuse.Command.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{8B6673C5-58B8-4E5A-8369-2E21507F4131}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse</RootNamespace>\n    <AssemblyName>Outracks.Fuse.Command</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"CommandLine, Version=2.8.0.0, Culture=neutral, PublicKeyToken=5a870481e358d379, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\CommandLineParser.2.8.0\\lib\\net45\\CommandLine.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Mono.Options\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Mono.Options.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"Uno.Build\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Build.dll</HintPath>\n    </Reference>\n    <Reference Include=\"uno\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\uno.exe</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Configuration\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Configuration.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8dfb02e0-acbf-4432-8dd9-56712e206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{e8884270-5f2c-4076-86d0-456b831be3e5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"CliCommand.cs\" />\n    <Compile Include=\"CliProgram.cs\" />\n    <Compile Include=\"Commands\\BuildCommand.cs\" />\n    <Compile Include=\"Commands\\CleanCommand.cs\" />\n    <Compile Include=\"Commands\\CreateCommand.cs\" />\n    <Compile Include=\"Commands\\DaemonCommand.cs\" />\n    <Compile Include=\"Commands\\DaemonClientCommand.cs\" />\n    <Compile Include=\"Commands\\DashboardCommand.cs\" />\n    <Compile Include=\"Commands\\ImportCommand.cs\" />\n    <Compile Include=\"Commands\\InstallCommand.cs\" />\n    <Compile Include=\"Commands\\KillAllCommand.cs\" />\n    <Compile Include=\"Commands\\OpenCommand.cs\" />\n    <Compile Include=\"Commands\\Preview\\ConsoleEventWriter.cs\" />\n    <Compile Include=\"Commands\\Preview\\ErrorHelpers\\MissingRequiredPackageReferences.cs\" />\n    <Compile Include=\"Commands\\Preview\\ExportTargetNotSupported.cs\" />\n    <Compile Include=\"Commands\\Preview\\PreviewArgumentResolver.cs\" />\n    <Compile Include=\"Commands\\Preview\\PreviewArguments.cs\" />\n    <Compile Include=\"Commands\\Preview\\PreviewCommand.cs\" />\n    <Compile Include=\"Commands\\Preview\\PreviewExported.cs\" />\n    <Compile Include=\"Commands\\Preview\\PreviewMain.cs\" />\n    <Compile Include=\"Commands\\Preview\\ResetPreviewCliCommand.cs\" />\n    <Compile Include=\"Commands\\Preview\\UnknownDocumentOrProjectType.cs\" />\n    <Compile Include=\"Commands\\TutorialCommand.cs\" />\n    <Compile Include=\"Commands\\EventViewerCommand.cs\" />\n    <Compile Include=\"Commands\\ConfigCommand.cs\" />\n    <Compile Include=\"Commands\\UriCommand.cs\" />\n    <Compile Include=\"ExceptionWriter.cs\" />\n    <Compile Include=\"ExitWithError.cs\" />\n    <Compile Include=\"Commands\\HelpCommand.cs\" />\n    <Compile Include=\"HelpTools.cs\" />\n    <Compile Include=\"LazyCliCommand.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Table.cs\" />\n    <Compile Include=\"TableWriter.cs\" />\n    <Compile Include=\"UnknownCommand.cs\" />\n    <Compile Include=\"UnoConfigExtensions.cs\" />\n    <Compile Include=\"VersionWriter.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3c1c1047-8830-498e-882a-503c0956cbe3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\daemon\\Outracks.Fuse.Daemon.csproj\">\n      <Project>{47D48240-F996-4E64-B70D-6AB2290DA8D4}</Project>\n      <Name>Outracks.Fuse.Daemon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\studio\\fuse-studio.csproj\">\n      <Project>{490EF7E5-46FF-4DF3-8342-530429CA65B5}</Project>\n      <Name>fuse-studio</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\preview\\service\\fuse-preview.csproj\">\n      <Project>{59E1073A-9B45-41F3-AB94-958A9D18FB72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fuse/command/Program.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading;\nusing Outracks.Diagnostics;\nusing Outracks.Extensions;\nusing Outracks.Fuse.Auth;\nusing Outracks.IO;\nusing Uno.Configuration;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class Program\n\t{\n\t\tstatic Program()\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n\t\t}\n\n\t\tpublic static string FuseCommandName\n\t\t{\n\t\t\tget { return \"fuse\"; }\n\t\t}\n\n\t\tstatic IReport Log { get; set; }\n\n\t\tpublic static int Run(List<string> args)\n\t\t{\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse\", args);\n\n\t\t\tLog = fuse.Report;\n\n\t\t\tLog.Info(\"Version \" + fuse.Version);\n\n\t\t\tif (args.Contains(\"--version\"))\n\t\t\t{\n\t\t\t\tConsole.Out.WriteVersion(fuse.Version, fuse.CommitSha);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// Launch services adds -psn_something to the programs argument list\n\t\t\t// After moving an app from a dmg, and then starting the app\n\t\t\tvar psnArgIdx = args.FindIndex(str => str.StartsWith(\"-psn\"));\n\t\t\tif (psnArgIdx >= 0)\n\t\t\t{\n\t\t\t\targs.RemoveAt(psnArgIdx);\n\t\t\t}\n\n\t\t\tif (Platform.IsMac)\n\t\t\t\tSetMinimumThreads(6); // For faster task creation in Mono. Mono doesn't have a good task system\n\n\t\t\tvar shell = new Shell();\n\t\t\tvar program =\n\t\t\t\tnew CliProgram(\n\t\t\t\t\tLog,\n\t\t\t\t\tColoredTextWriter.Out,\n\t\t\t\t\tColoredTextWriter.Error,\n\t\t\t\t\tFuseCommandName,\n\t\t\t\t\t() => {},\n\t\t\t\t\tDashboardCommand.CreateDashboardCommand(),\n\t\t\t\t\tOpenCommand.CreateOpenCommand(),\n\t\t\t\t\tnew LazyCliCommand(\"daemon\", \"Start the fuse daemon\", false, () => DaemonCommand.CreateDaemonCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"daemon-client\", \"Create a connection to a daemon.\", false, () => DaemonClientCommand.Create()),\n\t\t\t\t\tnew LazyCliCommand(\"preview\", \"Preview an app\", false, () => PreviewCommand.CreatePreviewCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"build\", \"Build a project\", false, () => new BuildCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"clean\", \"Clean a project\", false, () => new CleanCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"create\", \"Create a project or file from a template\", false, () => CreateCommand.CreateCreateCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"install\", \"Install an external component\", false, () => InstallCommand.CreateInstallCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"event-viewer\", \"Dump all events\", true, () => EventViewerCommand.CreateEventViewerCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"tutorial\", \"Go to tutorials and guides\", false, () => TutorialCommand.CreateTutorialCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"import\", \"Import a file to your fuse X project\", false, () => ImportCommand.CreateImportCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"reset-preview\", \"Causes all active previews to reset to the default state.\", true, () => ResetPreviewCliCommand.CreateResetPreviewCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"kill-all\", \"Kill all Fuse processes (even the daemon)\", false, () => KillAllCommand.CreateKillAllCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"killall\", \"Kill all Fuse processes (even the daemon)\", true, () => KillAllCommand.CreateKillAllCommand()),\t// Alias.\n\t\t\t\t\tnew LazyCliCommand(\"kill\", \"Kill all Fuse processes (even the daemon)\", true, () => KillAllCommand.CreateKillAllCommand()),\t\t// Alias.\n\t\t\t\t\tnew LazyCliCommand(\"uri\", \"Handle a link request\", true, () => new UriCommand()),\n\t\t\t\t\tnew LazyCliCommand(\"unoconfig\", \"Print configuration info\", true, () => new ConfigCommand()), // Deprecated.\n\t\t\t\t\tnew LazyCliCommand(\"config\", \"Print configuration info\", false, () => new ConfigCommand()));\n\n\t\t\tvar ctSource = new CancellationTokenSource();\n\t\t\tConsole.CancelKeyPress += (sender, eventArgs) => ctSource.Cancel();\n\n\t\t\treturn program.Main(args.ToArray(), ctSource.Token);\n\t\t}\n\n\t\tstatic void SetMinimumThreads(int numThreads)\n\t\t{\n\t\t\tint minWorker, minIOC;\n\t\t\tThreadPool.GetMinThreads(out minWorker, out minIOC);\n\t\t\tif (!ThreadPool.SetMinThreads(numThreads, minIOC))\n\t\t\t\tLog.Warn(\"Failed to set the minimum number of threads to \" + numThreads);\n\t\t}\n\n\t\tstatic void WriteVersion(this TextWriter writer, string version, string commit)\n\t\t{\n\t\t\twriter.WriteLine(\"fuse X version \" + version);\n\t\t\twriter.WriteLine(\"Copyright (C) 2018-2023 Build & Run\");\n\t\t\twriter.WriteLine();\n\t\t\twriter.WriteLine(\"SHA: \" + commit);\n\t\t\twriter.WriteLine(\"UID: \" + Hardware.UID);\n\t\t\twriter.WriteLine();\n\t\t\tUno.CLI.Program.Main(\"--version\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Fuse.Bootstrap\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/fuse/command/Table.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Mono.Options;\n\nnamespace Outracks.Fuse\n{\n\tpublic sealed class Table\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly IImmutableList<Row> Rows;\n\n\t\tpublic Table(string name, IEnumerable<Row> rows)\n\t\t\t: this(name, rows.ToImmutableList())\n\t\t{ }\n\n\t\tpublic Table(string name, IImmutableList<Row> rows)\n\t\t{\n\t\t\tName = name;\n\t\t\tRows = rows;\n\t\t}\n\t}\n\n\tpublic sealed class Row\n\t{\n\t\tpublic readonly IImmutableList<string> Cells;\n\n\t\tpublic Row(params string[] cells)\n\t\t\t: this(ImmutableList.Create(cells))\n\t\t{ }\n\n\t\tpublic Row(IImmutableList<string> cells)\n\t\t{\n\t\t\tCells = cells;\n\t\t}\n\t}\n\n\tpublic static class TableExtensions\n\t{\n\t\tpublic static Table ToTable(this OptionSet optionSet)\n\t\t{\n\t\t\treturn new Table(\n\t\t\t\t\"Options\",\n\t\t\t\toptionSet\n\t\t\t\t\t.Where(o => !o.Hidden)\n\t\t\t\t\t.Select(o => new Row(o.GetNames()\n\t\t\t\t\t\t\t\t.Select(s => s.Length == 1 ? \"-\" + s : \"--\" + s)\n\t\t\t\t\t\t\t\t.Select(s => o.Prototype.Contains(\"=\") ? s + \"=\" : s)\n\t\t\t\t\t\t\t\t.Join(\", \"),\n\t\t\t\t\t\t\to.Description)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/TableWriter.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class TableWriter\n\t{\n\t\tpublic static void WriteTable(this TextWriter writer, Table table, int indent, int columnPadding)\n\t\t{\n\t\t\tvar columnDefinitions = table.GetColumnDefinitions(columnPadding);\n\t\t\tforeach (var row in table.Rows)\n\t\t\t{\n\t\t\t\twriter.WriteSpaces(indent);\n\t\t\t\tfor (int i = 0; i < row.Cells.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tvar content = row.Cells[i];\n\t\t\t\t\tvar padding = columnDefinitions[i] - content.Length;\n\n\t\t\t\t\twriter.Write(content);\n\t\t\t\t\twriter.WriteSpaces(padding);\n\t\t\t\t}\n\t\t\t\twriter.WriteLine();\n\t\t\t}\n\t\t}\n\n\t\tpublic static void WriteSpaces(this TextWriter writer, int spaces)\n\t\t{\n\t\t\twriter.Write(new string(' ', spaces));\n\t\t}\n\n\t\tstatic int[] GetColumnDefinitions(this Table table, int columnPadding)\n\t\t{\n\t\t\tvar columnDefinitions = new int[table.Rows.Select(row => row.Cells.Count).Max()];\n\t\t\tforeach (var row in table.Rows)\n\t\t\t{\n\t\t\t\tint i = 0;\n\t\t\t\tforeach (var cell in row.Cells)\n\t\t\t\t{\n\t\t\t\t\tcolumnDefinitions[i] = Math.Max(columnDefinitions[i], cell.Length + columnPadding);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn columnDefinitions;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fuse/command/UnknownCommand.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic class UnknownCommand : Exception\n\t{\n\t\tpublic readonly string Command;\n\n\t\tpublic UnknownCommand(string command)\n\t\t{\n\t\t\tCommand = command;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/command/UnoConfigExtensions.cs",
    "content": "using Outracks.IO;\nusing Uno.Configuration;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class UnoConfigExtensions\n\t{\n        public static AbsoluteDirectoryPath GetTemplatesDir(this UnoConfig unoConfig)\n        {\n            return AbsoluteDirectoryPath.Parse(unoConfig.GetFullPath(\"Fuse.Templates\"));\n        }\n\t}\n}"
  },
  {
    "path": "src/fuse/command/VersionWriter.cs",
    "content": "﻿using System.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class VersionWriter\n\t{\n\t\tpublic static void Write(TextWriter textWriter, string version)\n\t\t{\n\t\t\ttextWriter.WriteLine(\"fuse X version {0}\", version);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/command/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.7.0.0\" newVersion=\"4.7.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Runtime.CompilerServices.Unsafe\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.4.1\" newVersion=\"4.0.4.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Xml.XmlDocument\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fuse/command/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"CommandLineParser\" version=\"2.8.0\" targetFramework=\"net46\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fuse/common/Auth/Hardware.cs",
    "content": "using Outracks.Fuse.Auth.Utilities;\nusing System;\nusing Uno.CLI;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Fuse.Auth\n{\n\tpublic static class Hardware\n\t{\n\t\tpublic static readonly string UID = GenerateUID();\n\n\t\tstatic string GenerateUID()\n\t\t{\n\t\t\tif (PlatformDetection.IsMac)\n\t\t\t{\n\t\t\t\treturn Shell.Default\n\t\t\t\t\t.GetOutput(\"system_profiler\", \"SPHardwareDataType\")\n\t\t\t\t\t.Grep(\"Hardware UUID:\")[0].Split(':')[1].Trim();\n\t\t\t}\n\t\t\telse if (PlatformDetection.IsWindows)\n\t\t\t{\n\t\t\t\treturn Win32HardwareInfo.GenerateUID(\"fuse X\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/ILicense.cs",
    "content": "using System;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Auth\n{\n\tpublic interface ILicense\n\t{\n\t\tbool IsValidValue { get; }\n\n\t\tbool IsRemote { get; }\n\t\tIObservable<bool> IsValid { get; }\n\t\tIObservable<bool> IsExpired { get; }\n\t\tIObservable<bool> IsRegistered { get; }\n\t\tIObservable<bool> IsTrial { get; }\n\t\tIObservable<int> DaysLeft { get; }\n\t\tIObservable<string> Status { get; }\n\t\tIObservable<string> Type { get; }\n\t\tIObservable<string> Name { get; }\n\t\tIObservable<string> Notification { get; }\n\t\tIObservable<string> Session { get; }\n\t\tIObservable<LicenseData> Data { get; }\n\n\t\tevent EventHandler<LicenseStatus> Updated;\n\t\tevent EventHandler Error;\n\n\t\tLicenseStatus ActivateLicense(string license, IMessagingService daemon);\n\t\tLicenseStatus ActivateSession(string session, IMessagingService daemon);\n\t\tvoid Deactivate(IMessagingService daemon);\n\n\t\tvoid Subscribe(AbsoluteFilePath fuse, IMessagingService daemon);\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/ILicenseState.cs",
    "content": "﻿namespace Outracks.Fuse.Auth\n{\n\tpublic interface ILicenseState\n\t{\n\t\tbool IsLicenseValid();\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/License.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Net;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Protocol.Auth;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Auth\n{\n\tpublic class License : ILicense\n\t{\n\t\treadonly BehaviorSubject<string> _notification = new BehaviorSubject<string>(null);\n\t\treadonly BehaviorSubject<string> _session = new BehaviorSubject<string>(null);\n\t\treadonly BehaviorSubject<LicenseStatus> _status = new BehaviorSubject<LicenseStatus>(LicenseStatus.Unregistered);\n\t\treadonly BehaviorSubject<LicenseData> _data = new BehaviorSubject<LicenseData>(LicenseData.Null);\n\t\treadonly Storage _storage;\n\n\t\tpublic bool IsValidValue => _status.Value.IsValid();\n\n\t\tpublic bool IsRemote { get; }\n\t\tpublic IObservable<bool> IsValid { get; }\n\t\tpublic IObservable<bool> IsExpired { get; }\n\t\tpublic IObservable<bool> IsRegistered { get; }\n\t\tpublic IObservable<bool> IsTrial { get; }\n\t\tpublic IObservable<int> DaysLeft { get; }\n\t\tpublic IObservable<string> Status { get; }\n\t\tpublic IObservable<string> Type { get; }\n\t\tpublic IObservable<string> Name { get; }\n\t\tpublic IObservable<string> Email { get; }\n\t\tpublic IObservable<string> Company { get; }\n\t\tpublic IObservable<string> Authority { get; }\n\t\tpublic IObservable<string> Expires { get; }\n\t\tpublic IObservable<string> Notification => _notification;\n\t\tpublic IObservable<string> Session => _session;\n\t\tpublic IObservable<LicenseData> Data => _data;\n\n\t\tpublic event EventHandler<LicenseStatus> Updated;\n\t\tpublic event EventHandler Error;\n\n\t\tpublic License(AbsoluteDirectoryPath userData, bool remote)\n\t\t{\n\t\t\t_storage = Storage.Get(userData);\n\t\t\tIsRemote = remote;\n\t\t\tIsValid = _status.Select(value => value.IsValid());\n\t\t\tIsExpired = _status.Select(value => value == LicenseStatus.Expired);\n\t\t\tIsRegistered = _data.Select(value => !string.IsNullOrEmpty(value.Name));\n\t\t\tIsTrial = _data.Select(value => value.License != null && value.License.Contains(\"Trial\"));\n\t\t\tDaysLeft = _data.Select(value => Math.Max(0, (int)((value.UtcExpires - DateTime.UtcNow).TotalDays + 0.5)));\n\t\t\tStatus = _status.Select(value => value == LicenseStatus.OK ? null : value.ToString().ToUpper());\n\t\t\tType = _status.CombineLatest(_data).Select(tuple => tuple.Item2.License + (\n\t\t\t\t\t\ttuple.Item1 == LicenseStatus.OK ? \"\" : \" [\" + tuple.Item1.ToString().ToUpper() + \"]\"));\n\t\t\tName = _data.Select(value => value.Name);\n\t\t\t_notification.Subscribe(s => {\n\t\t\t\tif (!string.IsNullOrEmpty(s))\n\t\t\t\t\tConsole.WriteLine(s);\n\t\t\t});\n\t\t\tLoad(comesFromBroadcast: false);\n\t\t}\n\n\t\tpublic LicenseStatus ActivateLicense(string license, IMessagingService daemon)\n\t\t{\n\t\t\t_storage.StoreSession(null);\n\t\t\treturn string.IsNullOrEmpty(license)\n\t\t\t\t? ActivateInner(null, daemon)\n\t\t\t\t: GetRemoteSession(license)\n\t\t\t\t\t.ContinueWith(remoteSession => {\n\t\t\t\t\t\tif (remoteSession.Exception != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tConsole.Error.WriteLine(remoteSession.Exception);\n\t\t\t\t\t\t\tdaemon.Broadcast(new LicenseEvent { Error = true });\n\t\t\t\t\t\t\treturn LicenseStatus.Expired;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar session = remoteSession.Result;\n\t\t\t\t\t\treturn ActivateSession(session, daemon);\n\t\t\t\t\t}).Result;\n\t\t}\n\n\t\tpublic LicenseStatus ActivateSession(string session, IMessagingService daemon)\n\t\t{\n\t\t\t_storage.StoreSession(session);\n\t\t\treturn string.IsNullOrEmpty(session)\n\t\t\t\t? ActivateInner(null, daemon)\n\t\t\t\t: GetRemoteLicense(session)\n\t\t\t\t\t.ContinueWith(remoteLicense => {\n\t\t\t\t\t\tif (remoteLicense.Exception != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tConsole.Error.WriteLine(remoteLicense.Exception);\n\t\t\t\t\t\t\tdaemon.Broadcast(new LicenseEvent { Error = true });\n\t\t\t\t\t\t\treturn LicenseStatus.Expired;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar license = remoteLicense.Result;\n\n\t\t\t\t\t\tif (string.IsNullOrEmpty(license))\n\t\t\t\t\t\t\treturn LicenseStatus.Expired;\n\n\t\t\t\t\t\treturn ActivateInner(license, daemon);\n\t\t\t\t\t}).Result;\n\t\t}\n\n\t\tpublic LicenseStatus ActivateInner(string license, IMessagingService daemon)\n\t\t{\n\t\t\tvar status = Verify(LicenseData.Decode(license), DateTime.UtcNow);\n\t\t\t_storage.StoreLicense(license);\n\t\t\tdaemon.Broadcast(new LicenseEvent());\n\t\t\treturn status;\n\t\t}\n\n\t\tpublic void Deactivate(IMessagingService daemon)\n\t\t{\n\t\t\t_storage.StoreSession(null);\n\t\t\t_storage.StoreLicense(null);\n\t\t\tdaemon.Broadcast(new LicenseEvent());\n\t\t}\n\n\t\tpublic void Subscribe(AbsoluteFilePath fuse, IMessagingService daemon)\n\t\t{\n\t\t\tUriHandler.Register(fuse);\n\t\t\tdaemon.BroadcastedEvents<LicenseEvent>(false)\n\t\t\t\t.Subscribe(e => {\n\t\t\t\t\tif (e.Error)\n\t\t\t\t\t{\n\t\t\t\t\t\tError?.Invoke(this, new EventArgs());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tLoad(comesFromBroadcast: true);\n\t\t\t\t});\n\t\t}\n\n\t\tvoid Load(bool comesFromBroadcast)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar session = _storage.LoadSession();\n\t\t\t\t_session.OnNext(session);\n\n\t\t\t\t// Sync license from remote server when signed in.\n\t\t\t\tif (IsRemote && !string.IsNullOrEmpty(session))\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine($\"Fetching license for session {session}\");\n\t\t\t\t\tGetRemoteLicense(session).ContinueWith(remoteLicense => {\n\t\t\t\t\t\tif (remoteLicense.Exception != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tConsole.Error.WriteLine(remoteLicense.Exception);\n\t\t\t\t\t\t\t_storage.StoreLicense(\"EXPIRED\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_storage.StoreLicense(remoteLicense.Result);\n\t\t\t\t\t\tLoadInner(remoteLicense.Result, comesFromBroadcast);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tvar license = _storage.LoadLicense();\n\t\t\t\tLoadInner(license, comesFromBroadcast);\n\n\t\t\t\t// Request a session anonymously (free trial period).\n\t\t\t\tif (IsRemote && string.IsNullOrEmpty(license) && string.IsNullOrEmpty(session))\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine($\"Fetching session for device {Hardware.UID}\");\n\t\t\t\t\tGetRemoteSession().ContinueWith(remoteSession => {\n\t\t\t\t\t\tif (remoteSession.Exception != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tConsole.Error.WriteLine(remoteSession.Exception);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsession = remoteSession.Result;\n\t\t\t\t\t\t_storage.StoreSession(session);\n\n\t\t\t\t\t\tif (!string.IsNullOrEmpty(session))\n\t\t\t\t\t\t\tLoad(comesFromBroadcast);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t}\n\t\t}\n\n\t\tbool _lastComesFromBroadcast;\n\t\tstring _lastLicense;\n\t\tDateTime _lastTime;\n\n\t\tvoid LoadInner(string license, bool comesFromBroadcast)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Early-out if we have recently checked the exact same license.\n\t\t\t\tif (_lastComesFromBroadcast == comesFromBroadcast &&\n\t\t\t\t\t_lastLicense == license &&\n\t\t\t\t\tDateTime.UtcNow.Subtract(_lastTime).TotalSeconds < 30)\n\t\t\t\t{\n\t\t\t\t\tif (IsRemote)\n\t\t\t\t\t\tConsole.WriteLine($\"Already checked license {license.GetHashCode()}\");\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (IsRemote)\n\t\t\t\t\tConsole.WriteLine($\"Checking license {license.GetHashCode()}\");\n\n\t\t\t\tvar isExpired = license == \"EXPIRED\";\n\t\t\t\tvar data = isExpired ? LicenseData.Null : LicenseData.Decode(license);\n\t\t\t\tvar status = isExpired ? LicenseStatus.Expired : Verify(data, DateTime.UtcNow);\n\t\t\t\t_data.OnNext(data);\n\t\t\t\t_status.OnNext(status);\n\n\t\t\t\t_lastLicense = license;\n\t\t\t\t_lastComesFromBroadcast = comesFromBroadcast;\n\t\t\t\t_lastTime = DateTime.UtcNow;\n\t\t\t\t\n\t\t\t\t// Not all instances need to ping the remote server.\n\t\t\t\tif (!IsRemote)\n\t\t\t\t\treturn;\n\n\t\t\t\tGetRemoteUtc(status).ContinueWith(utc => {\n\t\t\t\t\tif (utc.Exception != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (status == LicenseStatus.OK)\n\t\t\t\t\t\t\t_status.OnNext(status = LicenseStatus.Offline);\n\n\t\t\t\t\t\tConsole.Error.WriteLine(utc.Exception);\n\t\t\t\t\t}\n\t\t\t\t\telse if (utc.Result > data.UtcExpires || utc.Result < data.UtcIssued)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (status == LicenseStatus.OK)\n\t\t\t\t\t\t\t_status.OnNext(status = LicenseStatus.Expired);\n\t\t\t\t\t}\n\t\t\t\t\telse if (data != LicenseData.Null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (status == LicenseStatus.Expired)\n\t\t\t\t\t\t\t_status.OnNext(status = LicenseStatus.OK);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (comesFromBroadcast)\n\t\t\t\t\t{\n\t\t\t\t\t\t_notification.OnNext($\"License updated: {status}.\");\n\t\t\t\t\t\tUpdated?.Invoke(this, status);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_data.OnNext(LicenseData.Null);\n\t\t\t\t_status.OnNext(LicenseStatus.Unregistered);\n\t\t\t\t_notification.OnNext(\"An error occurred while updating license.\");\n\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t}\n\t\t}\n\n\t\tLicenseStatus Verify(LicenseData license, DateTime utcNow)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(license.Name))\n\t\t\t\treturn LicenseStatus.Unregistered;\n\n\t\t\tif (!string.IsNullOrEmpty(license.Device) && license.Device != Hardware.UID)\n\t\t\t\treturn LicenseStatus.Expired;\n\n\t\t\tif (utcNow > license.UtcExpires || utcNow < license.UtcIssued)\n\t\t\t\treturn LicenseStatus.Expired;\n\n\t\t\treturn LicenseStatus.OK;\n\t\t}\n\n\t\tasync Task<DateTime> GetRemoteUtc(LicenseStatus status)\n\t\t{\n\t\t\tusing (var client = new FuseWebClient(status))\n\t\t\t{\n\t\t\t\tvar body = await client.DownloadStringTaskAsync(WebLinks.Utc);\n\t\t\t\treturn DateTime.Parse(body);\n\t\t\t}\n\t\t}\n\n\t\tasync Task<string> GetRemoteLicense(string session)\n\t\t{\n\t\t\tusing (var client = new FuseWebClient(LicenseStatus.OK))\n\t\t\t{\n\t\t\t\tvar body = await client.DownloadStringTaskAsync(WebLinks.License +\n\t\t\t\t\t\"?session=\" + Uri.EscapeDataString(session) +\n\t\t\t\t\t\"&device=\" + Uri.EscapeDataString(Hardware.UID));\n\t\t\t\treturn body?.Trim();\n\t\t\t}\n\t\t}\n\n\t\tasync Task<string> GetRemoteSession(string license = null)\n\t\t{\n\t\t\tusing (var client = new FuseWebClient(LicenseStatus.OK))\n\t\t\t{\n\t\t\t\tvar body = await client.DownloadStringTaskAsync(WebLinks.Session +\n\t\t\t\t\t\"?device=\" + Uri.EscapeDataString(Hardware.UID) + (\n\t\t\t\t\t!string.IsNullOrEmpty(license)\n\t\t\t\t\t\t? \"&license=\" + Uri.EscapeDataString(license)\n\t\t\t\t\t\t: string.Empty\n\t\t\t\t\t));\n\t\t\t\treturn body?.Trim();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/LicenseData.cs",
    "content": "using System;\nusing System.IO;\nusing System.Security.Cryptography;\nusing System.Text;\nusing Newtonsoft.Json;\nusing Org.BouncyCastle.Crypto.Parameters;\nusing Org.BouncyCastle.OpenSsl;\nusing Org.BouncyCastle.Security;\nusing Outracks.Fuse.Auth.Utilities;\n\nnamespace Outracks.Fuse.Auth\n{\n\tpublic class LicenseData\n\t{\n\t\tpublic string License;\n\t\tpublic string Name;\n\t\tpublic string Email;\n\t\tpublic string Company;\n\t\tpublic string Device;\n\t\tpublic string Authority;\n\t\tpublic DateTime UtcIssued;\n\t\tpublic DateTime UtcExpires;\n\n\t\tpublic static LicenseData Null => new LicenseData();\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn JsonConvert.SerializeObject(this, Formatting.Indented);\n\t\t}\n\n\t\tpublic static LicenseData Decode(string data)\n\t\t{\n\t\t\treturn string.IsNullOrEmpty(data) ? Null : JsonConvert.DeserializeObject<LicenseData>(VerifyString(data, PUBLIC_KEY));\n\t\t}\n\n\t\tstatic string VerifyString(string data, string key)\n\t\t{\n\t\t\tvar stack = Convert.FromBase64String(data).DecompressGZip();\n\t\t\tvar sign = new byte[128];\n\t\t\tvar hash = GetSha256(stack, sign.Length, stack.Length - sign.Length);\n\t\t\tBuffer.BlockCopy(stack, 0, sign, 0, sign.Length);\n\n\t\t\tif (!ParsePem(key).VerifyHash(hash, sign, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1))\n\t\t\t\tthrow new InvalidOperationException(\"Invalid digital signature.\");\n\n\t\t\treturn Encoding.UTF8.GetString(stack, sign.Length, stack.Length - sign.Length);\n\t\t}\n\n\t\tstatic byte[] GetSha256(byte[] bytes, int offset, int count)\n\t\t{\n\t\t\tusing (var sha256 = SHA256.Create())\n\t\t\t\treturn sha256.ComputeHash(bytes, offset, count);\n\t\t}\n\n\t\tstatic RSACryptoServiceProvider ParsePem(string input)\n\t\t{\n\t\t\tvar rsa = new RSACryptoServiceProvider();\n\t\t\tvar pem = new PemReader(new StringReader(input));\n\t\t\tvar obj = pem.ReadObject();\n\n\t\t\tif (obj is RsaKeyParameters pk)\n\t\t\t\trsa.ImportParameters(DotNetUtilities.ToRSAParameters(pk));\n\t\t\telse\n\t\t\t\tthrow new InvalidOperationException();\n\n\t\t\treturn rsa;\n\t\t}\n\n\t\tconst string PUBLIC_KEY = @\"-----BEGIN PUBLIC KEY-----\nMIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgH8u56PcaQji0QtMQuBzpC4rIrsS\nhQqMh64/SdmVj+rLwNgYqet0PjYMDKdyGmPxG5+Y26aJ68i2HYl6Q88ExGd8C9qF\n8ybzhmmxQ2R7vm0ltPd10GdMWoi3w3oeDqiRxHf9TW4xJZLILRcngPD7wkWAL6/c\nfBQu3nHhh4d7W0E1AgMBAAE=\n-----END PUBLIC KEY-----\";\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/LicenseStatus.cs",
    "content": "namespace Outracks.Fuse.Auth\n{\n\tpublic enum LicenseStatus\n\t{\n\t\tOK,\n\t\tUnregistered,\n\t\tOffline,\n\t\tExpired,\n\t}\n\n\tpublic static class LicenseStatusExtensions\n\t{\n\t\tpublic static bool IsValid(this LicenseStatus status)\n\t\t{\n\t\t\treturn status == LicenseStatus.OK || status == LicenseStatus.Offline;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/Storage.cs",
    "content": "﻿using Microsoft.Win32;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\nusing System.IO;\n\nnamespace Outracks.Fuse.Auth\n{\n\tabstract class Storage\n\t{\n\t\tpublic abstract string LoadLicense();\n\t\tpublic abstract void StoreLicense(string data);\n\n\t\tpublic abstract string LoadSession();\n\t\tpublic abstract void StoreSession(string data);\n\n\t\tpublic static Storage Get(AbsoluteDirectoryPath userData)\n\t\t{\n\t\t\treturn Platform.IsMac\n\t\t\t\t? (Storage) new MacStorage(userData)\n\t\t\t\t:           new WindowsStorage();\n\t\t}\n\n\t\tclass MacStorage : Storage\n\t\t{\n\t\t\treadonly AbsoluteFilePath _license;\n\t\t\treadonly AbsoluteFilePath _session;\n\n\t\t\tpublic MacStorage(AbsoluteDirectoryPath userData)\n\t\t\t{\n\t\t\t\t_license = userData / new FileName(\"fuse.dat\");\n\t\t\t\t_session = userData / new FileName(\"session.dat\");\n\t\t\t}\n\n\t\t\tpublic override string LoadLicense()\n\t\t\t{\n\t\t\t\treturn File.Exists(_license.NativePath)\n\t\t\t\t\t? File.ReadAllText(_license.NativePath)\n\t\t\t\t\t: null;\n\t\t\t}\n\n\t\t\tpublic override void StoreLicense(string data)\n\t\t\t{\n\t\t\t\tFile.WriteAllText(_license.NativePath, data ?? \"\");\n\t\t\t}\n\n\t\t\tpublic override string LoadSession()\n\t\t\t{\n\t\t\t\treturn File.Exists(_session.NativePath)\n\t\t\t\t\t? File.ReadAllText(_session.NativePath)\n\t\t\t\t\t: null;\n\t\t\t}\n\n\t\t\tpublic override void StoreSession(string data)\n\t\t\t{\n\t\t\t\tFile.WriteAllText(_session.NativePath, data ?? \"\");\n\t\t\t}\n\t\t}\n\n\t\tclass WindowsStorage : Storage\n\t\t{\n\t\t\tpublic override string LoadLicense()\n\t\t\t{\n\t\t\t\tusing (var Software = Registry.CurrentUser.CreateSubKey(\"Software\"))\n\t\t\t\tusing (var Fuseapps = Software.CreateSubKey(\"Fuseapps\"))\n\t\t\t\tusing (var fuse_X = Fuseapps.CreateSubKey(\"fuse X\"))\n\t\t\t\t\treturn fuse_X.GetValue(\"data\") as string;\n\t\t\t}\n\n\t\t\tpublic override void StoreLicense(string data)\n\t\t\t{\n\t\t\t\tusing (var Software = Registry.CurrentUser.CreateSubKey(\"Software\"))\n\t\t\t\tusing (var Fuseapps = Software.CreateSubKey(\"Fuseapps\"))\n\t\t\t\tusing (var fuse_X = Fuseapps.CreateSubKey(\"fuse X\"))\n\t\t\t\t\tfuse_X.SetValue(\"data\", data ?? \"\");\n\t\t\t}\n\n\t\t\tpublic override string LoadSession()\n\t\t\t{\n\t\t\t\tusing (var Software = Registry.CurrentUser.CreateSubKey(\"Software\"))\n\t\t\t\tusing (var Fuseapps = Software.CreateSubKey(\"Fuseapps\"))\n\t\t\t\tusing (var fuse_X = Fuseapps.CreateSubKey(\"fuse X\"))\n\t\t\t\t\treturn fuse_X.GetValue(\"session\") as string;\n\t\t\t}\n\n\t\t\tpublic override void StoreSession(string data)\n\t\t\t{\n\t\t\t\tusing (var Software = Registry.CurrentUser.CreateSubKey(\"Software\"))\n\t\t\t\tusing (var Fuseapps = Software.CreateSubKey(\"Fuseapps\"))\n\t\t\t\tusing (var fuse_X = Fuseapps.CreateSubKey(\"fuse X\"))\n\t\t\t\t\tfuse_X.SetValue(\"session\", data ?? \"\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/UriHandler.cs",
    "content": "﻿using System;\nusing Microsoft.Win32;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Auth\n{\n\tpublic class UriHandler\n\t{\n\t\treadonly IFuse _fuse;\n\t\treadonly IMessagingService _daemon;\n\n\t\tpublic UriHandler(IFuse fuse, IMessagingService daemon)\n\t\t{\n\t\t\t_fuse = fuse;\n\t\t\t_daemon = daemon;\n\t\t}\n\n\t\tpublic void OnUri(string uri)\n\t\t{\n\t\t\tconst string protocol1 = \"fuse-x://\";\n\t\t\tconst string protocol2 = \"fusestudio://\";\t// Legacy.\n\t\t\tif (uri == null || (!uri.StartsWith(protocol1) && !uri.StartsWith(protocol2)))\n\t\t\t\tthrow new ArgumentException($\"Invalid {protocol1} URI.\", nameof(uri));\n\n\t\t\tif (uri.StartsWith(protocol1))\n\t\t\t\turi = uri.Substring(protocol1.Length);\n\t\t\telse if (uri.StartsWith(protocol2))\n\t\t\t\turi = uri.Substring(protocol2.Length);\n\n\t\t\tvar firstSeparator = uri.IndexOf('/');\n\t\t\tif (firstSeparator < 0)\n\t\t\t\tfirstSeparator = uri.Length;\n\n\t\t\tvar selector = uri.Substring(0, firstSeparator);\n\t\t\tvar data = firstSeparator < uri.Length ? uri.Substring(firstSeparator + 1) : null;\n\n\t\t\tswitch (selector)\n\t\t\t{\n\t\t\t\tcase \"activate\":\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(_fuse.License.ActivateSession(data, _daemon));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcase \"license\":\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(_fuse.License.ActivateLicense(data, _daemon));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcase \"deactivate\":\n\t\t\t\t{\n\t\t\t\t\t_fuse.License.Deactivate(_daemon);\n\t\t\t\t\tConsole.WriteLine(\"Deactivated.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new ArgumentException($\"Unsupported {protocol1} URI.\", nameof(uri));\n\t\t}\n\n\t\tinternal static bool Register(AbsoluteFilePath fuse)\n\t\t{\n\t\t\tif (!Platform.IsWindows)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"UriHandler is not supported.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (var Software = Registry.CurrentUser.CreateSubKey(\"Software\"))\n\t\t\t\tusing (var Classes = Software.CreateSubKey(\"Classes\"))\n\t\t\t\tusing (var fuse_x = Classes.CreateSubKey(\"fuse-x\"))\n\t\t\t\tusing (var DefaultIcon = fuse_x.CreateSubKey(\"DefaultIcon\"))\n\t\t\t\tusing (var shell = fuse_x.CreateSubKey(\"shell\"))\n\t\t\t\tusing (var open = shell.CreateSubKey(\"open\"))\n\t\t\t\tusing (var command = open.CreateSubKey(\"command\"))\n\t\t\t\t{\n\t\t\t\t\tfuse_x.SetValue(null, \"URL:fuse X\");\n\t\t\t\t\tfuse_x.SetValue(\"URL Protocol\", \"\");\n\t\t\t\t\tDefaultIcon.SetValue(null, $\"{fuse},1\");\n\t\t\t\t\tcommand.SetValue(null, $\"\\\"{fuse.ContainingDirectory}\\\\fuse-uri.exe\\\" \\\"%1\\\"\");\n\t\t\t\t}\n\n\t\t\t\t// Legacy\n\t\t\t\tusing (var Software = Registry.CurrentUser.CreateSubKey(\"Software\"))\n\t\t\t\tusing (var Classes = Software.CreateSubKey(\"Classes\"))\n\t\t\t\tusing (var fusestudio = Classes.CreateSubKey(\"fusestudio\"))\n\t\t\t\tusing (var DefaultIcon = fusestudio.CreateSubKey(\"DefaultIcon\"))\n\t\t\t\tusing (var shell = fusestudio.CreateSubKey(\"shell\"))\n\t\t\t\tusing (var open = shell.CreateSubKey(\"open\"))\n\t\t\t\tusing (var command = open.CreateSubKey(\"command\"))\n\t\t\t\t{\n\t\t\t\t\tfusestudio.SetValue(null, \"URL:fuse X\");\n\t\t\t\t\tfusestudio.SetValue(\"URL Protocol\", \"\");\n\t\t\t\t\tDefaultIcon.SetValue(null, $\"{fuse},1\");\n\t\t\t\t\tcommand.SetValue(null, $\"\\\"{fuse.ContainingDirectory}\\\\fuse-uri.exe\\\" \\\"%1\\\"\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/Utilities/BASE36.cs",
    "content": "﻿using System;\nusing System.Text;\n\n// This code was imported from QLicense.\nnamespace Outracks.Fuse.Auth.Utilities\n{\n    class BASE36\n    {\n        private const string _charList = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n        private static readonly char[] _charArray = _charList.ToCharArray();\n\n        public static long Decode(string input)\n        {\n            long _result = 0;\n            double _pow = 0;\n            for (int _i = input.Length - 1; _i >= 0; _i--)\n            {\n                char _c = input[_i];\n                int pos = _charList.IndexOf(_c);\n                if (pos > -1)\n                    _result += pos * (long)Math.Pow(_charList.Length, _pow);\n                else\n                    return -1;\n                _pow++;\n            }\n            return _result;\n        }\n\n        public static string Encode(ulong input)\n        {\n            StringBuilder _sb = new StringBuilder();\n            do\n            {\n                _sb.Append(_charArray[input % (ulong)_charList.Length]);\n                input /= (ulong)_charList.Length;\n            } while (input != 0);\n\n            return Reverse(_sb.ToString());\n        }\n\n        private static string Reverse(string s)\n        {\n            var charArray = s.ToCharArray();\n            Array.Reverse(charArray);\n            return new string(charArray);\n        }\n    }\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/Utilities/GZip.cs",
    "content": "using System.IO;\nusing System.IO.Compression;\n\nnamespace Outracks.Fuse.Auth.Utilities\n{\n\tpublic static class GZip\n\t{\n\t\tpublic static byte[] CompressGZip(this byte[] raw, CompressionLevel level = CompressionLevel.Fastest)\n\t\t{\n\t\t\tusing (var memory = new MemoryStream())\n\t\t\t{\n\t\t\t\tusing (var gzip = new GZipStream(memory, level, true))\n\t\t\t\t\tgzip.Write(raw, 0, raw.Length);\n\n\t\t\t\treturn memory.ToArray();\n\t\t\t}\n\t\t}\n\n\t\tpublic static byte[] DecompressGZip(this byte[] gzip)\n\t\t{\n\t\t\tusing (var stream = new GZipStream(new MemoryStream(gzip), CompressionMode.Decompress))\n\t\t\t{\n\t\t\t\tconst int size = 4096;\n\t\t\t\tvar buffer = new byte[size];\n\n\t\t\t\tusing (var memory = new MemoryStream())\n\t\t\t\t{\n\t\t\t\t\tint count;\n\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tcount = stream.Read(buffer, 0, size);\n\t\t\t\t\t\tif (count > 0)\n\t\t\t\t\t\t\tmemory.Write(buffer, 0, count);\n\t\t\t\t\t}\n\t\t\t\t\twhile (count > 0);\n\n\t\t\t\t\treturn memory.ToArray();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Auth/Utilities/Win32HardwareInfo.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Management;\nusing System.Security.Cryptography;\nusing Outracks.Diagnostics;\n\n// This code was imported from QLicense.\nnamespace Outracks.Fuse.Auth.Utilities\n{\n    class Win32HardwareInfo\n    {\n        /// <summary>\n        /// Get volume serial number of drive C\n        /// </summary>\n        /// <returns></returns>\n        private static string GetDiskVolumeSerialNumber()\n        {\n            try\n            {\n                ManagementObject _disk = new ManagementObject(@\"Win32_LogicalDisk.deviceid=\"\"c:\"\"\");\n                _disk.Get();\n                return _disk[\"VolumeSerialNumber\"].ToString();\n            }\n            catch\n            {\n                return string.Empty;\n            }\n        }\n\n        /// <summary>\n        /// Get CPU ID\n        /// </summary>\n        /// <returns></returns>\n        private static string GetProcessorId()\n        {\n            try\n            {\n                ManagementObjectSearcher _mbs = new ManagementObjectSearcher(\"Select ProcessorId From Win32_processor\");\n                ManagementObjectCollection _mbsList = _mbs.Get();\n                string _id = string.Empty;\n                foreach (ManagementObject _mo in _mbsList)\n                {\n                    _id= _mo[\"ProcessorId\"].ToString();\n                    break;\n                }\n\n                return _id;\n\n            }\n            catch\n            {\n                return string.Empty;\n            }\n        }\n\n        /// <summary>\n        /// Get motherboard serial number\n        /// </summary>\n        /// <returns></returns>\n        private static string GetMotherboardID()\n        {\n            try\n            {\n                ManagementObjectSearcher _mbs = new ManagementObjectSearcher(\"Select SerialNumber From Win32_BaseBoard\");\n                ManagementObjectCollection _mbsList = _mbs.Get();\n                string _id = string.Empty;\n                foreach (ManagementObject _mo in _mbsList)\n                {\n                    _id = _mo[\"SerialNumber\"].ToString();\n                    break;\n                }\n\n                return _id;\n            }\n            catch\n            {\n                return string.Empty;\n            }\n        }\n\n        /// <summary>\n        /// Combine CPU ID, Disk C Volume Serial Number and Motherboard Serial Number as device Id\n        /// </summary>\n        /// <returns></returns>\n        public static string GenerateUID(string appName)\n        {\n            //Combine the IDs and get bytes\n            string _id = string.Concat(appName, GetProcessorId(), GetMotherboardID(), GetDiskVolumeSerialNumber());\n            byte[] _byteIds = Encoding.UTF8.GetBytes(_id);\n\n            //Use MD5 to get the fixed length checksum of the ID string\n            MD5CryptoServiceProvider _md5 = new MD5CryptoServiceProvider();\n            byte[] _checksum = _md5.ComputeHash(_byteIds);\n\n            //Convert checksum into 4 ulong parts and use BASE36 to encode both\n            string _part1Id = BASE36.Encode(BitConverter.ToUInt32(_checksum, 0));\n            string _part2Id = BASE36.Encode(BitConverter.ToUInt32(_checksum, 4));\n            string _part3Id = BASE36.Encode(BitConverter.ToUInt32(_checksum, 8));\n            string _part4Id = BASE36.Encode(BitConverter.ToUInt32(_checksum, 12));\n\n            //Concat these 4 part into one string\n            return string.Format(\"{0}-{1}-{2}-{3}\", _part1Id, _part2Id, _part3Id, _part4Id);\n        }\n    }\n}\n"
  },
  {
    "path": "src/fuse/common/DefaultApplicationWin.cs",
    "content": "using System;\nusing Microsoft.Win32;\nusing Outracks.IO;\nusing Uno;\n\nnamespace Outracks.Fuse\n{\n\tclass DefaultApplicationWin\n\t{\n\t\tpublic void SetAsDefaultApplicationFor(AbsoluteFilePath exeFilePath, string extension)\n\t\t{\n\t\t\tusing (var extKey = CreateOrOpenKeyInClassesRoot(extension))\n\t\t\t{\n\t\t\t\tvar extType = extKey.GetValue(\"\");\n\t\t\t\tif (extType == null)\n\t\t\t\t{\n\t\t\t\t\textType = extension.TrimStart('.') + \"_file\";\n\t\t\t\t\textKey.SetValue(\"\", extType);\n\t\t\t\t}\n\n\t\t\t\tvar command = exeFilePath.NativePath.QuoteSpace() + \" \\\"%1\\\"\";\n\t\t\t\tvar extCommandKey = extType + @\"\\shell\\open\\command\";\n\t\t\t\tusing (var key = Registry.CurrentUser.CreateSubKey(@\"Software\\Classes\\\" + extCommandKey))\n\t\t\t\t{\n\t\t\t\t\tif (key == null)\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Couldn't create subkey\");\n\n\t\t\t\t\tkey.SetValue(\"\", command);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic RegistryKey CreateOrOpenKeyInClassesRoot(string key)\n\t\t{\n\t\t\tvar extKey = Registry.ClassesRoot.OpenSubKey(key);\n\t\t\tif (extKey == null)\n\t\t\t{\n\t\t\t\textKey = Registry.CurrentUser.CreateSubKey(@\"Software\\Classes\\\" + key, RegistryKeyPermissionCheck.ReadWriteSubTree);\n\t\t\t\tif (extKey == null)\n\t\t\t\t\tthrow new InvalidOperationException(\"Couldn't create key in register.\");\n\t\t\t}\n\n\t\t\treturn extKey;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/ExportTargetNotSupported.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Building\n{\n\tpublic class ExportTargetNotSupported : Exception\n\t{\n\t\tpublic readonly string ExportTarget;\n\n\t\tpublic ExportTargetNotSupported(string exportTarget)\n\t\t\t: base(exportTarget + \" is not supported as a export target on this device.\")\n\t\t{\n\t\t\tExportTarget = exportTarget;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/FileExtensions.cs",
    "content": "﻿using Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class FileExtensions\n\t{\n\t\tpublic static bool IsProjectFile(this IAbsolutePath path)\n\t\t{\n\t\t\treturn path.MatchWith(\n\t\t\t\t(AbsoluteFilePath file) => file.IsProjectFile(),\n\t\t\t\t(AbsoluteDirectoryPath dir) => false);\n\t\t}\n\n\t\tpublic static bool IsProjectFile(this AbsoluteFilePath f)\n\t\t{\n\t\t\treturn f.Name.HasExtension(\".unoproj\");\n\t\t}\n\n\t\tpublic static bool IsUnoFile(this AbsoluteFilePath f)\n\t\t{\n\t\t\treturn f.Name.HasExtension(\".uno\");\n\t\t}\n\n\t\tpublic static bool IsUxFile(this AbsoluteFilePath f)\n\t\t{\n\t\t\treturn f.Name.HasExtension(\".ux\");\n\t\t}\n\n\t\tpublic static bool IsExtensionFile(this AbsoluteFilePath f)\n\t\t{\n\t\t\treturn f.Name.HasExtension(\".uxl\");\n\t\t}\n\n\t\tpublic static bool IsOtherFile(this AbsoluteFilePath f)\n\t\t{\n\t\t\treturn !f.IsUnoFile() && !f.IsUxFile() && !f.IsExtensionFile();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/FileFilters.cs",
    "content": "﻿\nnamespace Outracks\n{\n\tpublic static class FileFilters\n\t{\n\t\tpublic static FileFilter UnoFiles\n\t\t{\n\t\t\tget { return new FileFilter(\"Uno file\", \"uno\"); }\n\t\t}\n\n\t\tpublic static FileFilter UxFiles\n\t\t{\n\t\t\tget { return new FileFilter(\"UX file\", \"ux\"); }\n\t\t}\n\n\t\tpublic static FileFilter UxlFiles\n\t\t{\n\t\t\tget { return new FileFilter(\"UXL file\", \"uxl\"); }\n\t\t}\n\n\t\tpublic static FileFilter SourceFiles\n\t\t{\n\t\t\tget { return FileFilter.Union(\"Source Files\", UnoFiles, UxFiles, UxlFiles); }\n\t\t}\n\n\t\tpublic static FileFilter UnoProjects\n\t\t{\n\t\t\tget { return new FileFilter(\"Uno Projects\", \"unoproj\", \"unosln\"); }\n\t\t}\n\n\t\tpublic static FileFilter AllFiles\n\t\t{\n\t\t\tget { return new FileFilter(\"All Files\"); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/FuseApi.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Analytics;\nusing Outracks.Fuse.Auth;\nusing Outracks.IO;\nusing Uno.Configuration;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Fuse\n{\n\tclass SpecialFoldersNotFound : Exception\n\t{\n\t\tpublic SpecialFoldersNotFound(IEnumerable<Environment.SpecialFolder> missingFolders)\n\t\t\t: base(\"The following special folder(s) are not set: \" + string.Join(\", \", missingFolders.Distinct().Select(f => \"'\" + f.ToString() + \"'\")) + \". Please make sure your OS is set up correctly.\")\n\t\t{\n\t\t}\n\t}\n\n\tpublic static class FuseApi\n\t{\n\t\tpublic static IFuse Initialize(string programName, List<string> args, bool remoteLicense = false)\n\t\t{\n\t\t\tvar systemId = SystemGuidLoader.LoadOrCreateOrEmpty();\n\t\t\tvar sessionId = Guid.NewGuid();\n\n\t\t\tvar report = ReportFactory.GetReporter(systemId, sessionId, programName);\n\t\t\tAppDomain.CurrentDomain.ReportUnhandledExceptions(report);\n\t\t\treport.Info(\"Initializing with arguments '\" + args.Join(\" \") + \"'\");\n\n\t\t\tif (MonoInfo.IsRunningMono)\n\t\t\t\treport.Info(\"Running with Mono version \" + MonoInfo.GetVersion());\n\n\t\t\tEnsureSpecialFoldersExist();\n\n\t\t\tvar userData = Platform.IsMac\n\t\t\t\t? AbsoluteDirectoryPath.Parse(Environment.GetFolderPath(Environment.SpecialFolder.Personal)) / \".fuse\"\n\t\t\t\t: AbsoluteDirectoryPath.Parse(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) / \"fuse X\";\n\n\t\t\tvar fuseExe = GetConfigFilePath(\"Fuse.Exe\");\n\n\t\t\tvar impl = new FuseImpl\n\t\t\t{\n\t\t\t\tFuseRoot = GetConfigDirectoryPath(\"Fuse.Bin\"),\n\t\t\t\tVersion = SystemInfoFactory.GetBuildVersion(typeof(FuseApi).Assembly),\n\n\t\t\t\tFuseExe = fuseExe,\n\n\t\t\t\tFuse = ExternalApplication.FromNativeExe(fuseExe),\n\n\t\t\t\t// Tools\n\n\t\t\t\tStudio = Platform.IsMac\n\t\t\t\t\t? ExternalApplication.FromAppBundle(GetConfigDirectoryPath(\"Fuse.Studio\"))\n\t\t\t\t\t: ExternalApplication.FromNativeExe(GetConfigFilePath(\"Fuse.Studio\")),\n\n\t\t\t\t// Services\n\n\t\t\t\tCodeAssistance = ExternalApplication.FromNativeExe(GetConfigFilePath(\"Fuse.CodeAssistance\")),\n\n\t\t\t\tTray = Platform.IsMac\n\t\t\t\t\t? ExternalApplication.FromNativeExe(GetConfigDirectoryPath(\"Fuse.Tray\") / \"Contents\" / \"MacOS\" / new FileName(\"fuse X (menu bar)\"))\n\t\t\t\t\t: ExternalApplication.FromNativeExe(GetConfigFilePath(\"Fuse.Tray\")),\n\n\t\t\t\tLogServer = Platform.IsMac\n\t\t\t\t\t? ExternalApplication.FromNativeExe(GetConfigFilePath(\"Fuse.LogServer\"))\n\t\t\t\t\t: null,\n\n\t\t\t\t// Uno\n\n\t\t\t\tUno = ExternalApplication.FromNativeExe(GetConfigFilePath(\"Uno.Command\")),\n\n\t\t\t\tUnoHost = Platform.IsMac\n\t\t\t\t\t? ExternalApplication.FromNativeExe(GetConfigDirectoryPath(\"Fuse.UnoHost\") / \"Contents\" / \"MacOS\" / new FileName(\"UnoHost\"))\n\t\t\t\t\t: ExternalApplication.FromNativeExe(GetConfigFilePath(\"Fuse.UnoHost\")),\n\n\t\t\t\t// System paths\n\n\t\t\t\tUserDataDir = userData,\n\n\t\t\t\tProjectsDir =\n\t\t\t\t\tAbsoluteDirectoryPath.Parse(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) / \"fuse X\",\n\n\t\t\t\tSystemId = systemId,\n\t\t\t\tSessionId = sessionId,\n\t\t\t\tReport = report,\n\t\t\t\tLicense = new License(userData, remoteLicense)\n\t\t\t};\n\n\t\t\t// Set global license flag\n\t\t\timpl.License.IsValid.Subscribe(value => FuseImpl._IsLicenseValid = value);\n\n\t\t\tvar partial = args.Remove(\"--partial\") | args.Remove(\"-p\");\n\t\t\tif (!partial)\n\t\t\t\timpl.CheckCompleteness();\n\n\t\t\treturn impl;\n\t\t}\n\n\t\tstatic FuseApi()\n\t\t{\n\t\t\t// Set assembly configuration for .unoconfig,\n\t\t\t// and be able to find correct bin/$(Configuration) directories.\n#if DEBUG\n\t\t\tUnoConfigFile.Constants[\"Configuration\"] = \"Debug\";\n#else\n\t\t\tUnoConfigFile.Constants[\"Configuration\"] = \"Release\";\n#endif\n\n\t\t\t// Define STUDIO for .unoconfig.\n\t\t\tUnoConfigFile.Defines.Add(\"STUDIO\");\n\t\t}\n\n\t\tstatic AbsoluteDirectoryPath GetConfigDirectoryPath(string key)\n\t\t{\n\t\t\treturn AbsoluteDirectoryPath.Parse(UnoConfig.Current.GetFullPath(key));\n\t\t}\n\n\t\tstatic AbsoluteFilePath GetConfigFilePath(string key)\n\t\t{\n\t\t\tvar absolute = UnoConfig.Current.GetFullPath(key);\n#if DEBUG\n\t\t\tvar relative = Path.Combine(Path.GetDirectoryName(typeof(FuseApi).Assembly.Location),\n\t\t\t\t\t\t\t\t\t\tPath.GetFileName(absolute));\n\n\t\t\t// Windows: Prefer services near the running module (npm run daemon).\n\t\t\treturn Platform.IsWindows && File.Exists(relative)\n\t\t\t\t? AbsoluteFilePath.Parse(relative)\n\t\t\t\t: AbsoluteFilePath.Parse(absolute);\n#else\n\t\t\treturn AbsoluteFilePath.Parse(absolute);\n#endif\n\t\t}\n\n\t\tstatic void EnsureSpecialFoldersExist()\n\t\t{\n\t\t\tvar requiredFolders = new[] { Environment.SpecialFolder.Personal, Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolder.MyDocuments };\n\t\t\tvar missingFolders = requiredFolders.Where((f) => Environment.GetFolderPath(f).IsEmpty()).ToArray();\n\t\t\tif (missingFolders.Any())\n\t\t\t{\n\t\t\t\tthrow new SpecialFoldersNotFound(missingFolders);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/FuseImpl.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Auth;\nusing Outracks.IO;\nusing Uno;\nusing Uno.Configuration;\n\nnamespace Outracks.Fuse\n{\n\tclass IncompleteInstallation : Exception\n\t{\n\t\tpublic ImmutableList<string> MissingComponents { get; private set; }\n\n\t\tpublic IncompleteInstallation(ImmutableList<string> missingComponents)\n\t\t\t: base(\"This installation of Fuse appears to be incomplete. The following components could not be found: \" + missingComponents.Join(\", \"))\n\t\t{\n\t\t\tMissingComponents = missingComponents;\n\t\t}\n\t}\n\n\tpublic class FuseImpl : IFuse\n\t{\n\t\t/**\n\t\t * The global license flag is managed by FuseApi\n\t\t * \n\t\t * NB: This field is read using reflection by ViewportController\n\t\t */\n\t\tinternal static bool _IsLicenseValid;\n\n\t\tpublic bool IsLicenseValid()\n\t\t{\n\t\t\treturn _IsLicenseValid;\n\t\t}\n\n\t\tpublic void CheckCompleteness()\n\t\t{\n\t\t\tvar requiredApps = new List<IExternalApplication>\n\t\t\t{\n\t\t\t\tFuse,\n\t\t\t\tCodeAssistance,\n\t\t\t\tTray,\n\t\t\t\tUno,\n\t\t\t\tUnoHost,\n\t\t\t\tStudio,\n\t\t\t};\n\n\t\t\tvar missingApps =\n\t\t\t\trequiredApps\n\t\t\t\t\t.Where(app => !app.Exists)\n\t\t\t\t\t.Select(app => app.Name)\n\t\t\t\t\t.ToImmutableList();\n\n\t\t\tif (missingApps.Count > 0)\n\t\t\t\tthrow new IncompleteInstallation(missingApps);\n\t\t}\n\n\t\tpublic Guid SessionId { get; set; }\n\t\tpublic Guid SystemId { get; set; }\n\t\tpublic string Version { get; set; }\n\n\t\tpublic string CommitSha\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar config = typeof(FuseImpl).Assembly.GetCustomAttributes(true)\n\t\t\t\t\t.OfType<AssemblyConfigurationAttribute>()\n\t\t\t\t\t.FirstOrDefault()?.Configuration;\n\t\t\t\treturn !string.IsNullOrEmpty(config)\n\t\t\t\t\t? config\n\t\t\t\t\t: \"N/A\";\n\t\t\t}\n\t\t}\n\n\t\tpublic AbsoluteDirectoryPath FuseRoot { get; set; }\n\t\tpublic AbsoluteDirectoryPath UserDataDir { get; set; }\n\t\tpublic AbsoluteDirectoryPath ProjectsDir { get; set; }\n\n\t\tpublic AbsoluteFilePath FuseExe { get; set; }\n\n\t\tpublic AbsoluteDirectoryPath ComponentsDir\n\t\t{\n\t\t\tget { return AbsoluteDirectoryPath.Parse(UnoConfig.Current.GetFullPath(\"Fuse.Components\")); }\n\t\t}\n\n\t\tpublic IExternalApplication Uno { get; set; }\n\t\tpublic IExternalApplication Fuse { get; set; }\n\t\tpublic IExternalApplication Tray { get; set; }\n\t\tpublic IExternalApplication Studio { get; set; }\n\t\tpublic IExternalApplication CodeAssistance { get; set; }\n\t\tpublic IExternalApplication LogServer { get; set; }\n\t\tpublic IExternalApplication UnoHost { get; set; }\n\n\t\tpublic Process StartFuse(string command, params string[] commandArgs)\n\t\t{\n#if DEBUG\n\t\t\tConsole.WriteLine(\"Starting fuse \" + command + \" \" + commandArgs.Select(global::Uno.Extensions.QuoteSpace).Join(\" \"));\n#endif\n\t\t\treturn Fuse.Start(\n\t\t\t\tnew ProcessStartInfo()\n\t\t\t\t{\n\t\t\t\t\tArguments = command + \" \" + commandArgs.Select(global::Uno.Extensions.QuoteSpace).Join(\" \"),\n\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\tCreateNoWindow = true,\n\t\t\t\t\tWindowStyle = ProcessWindowStyle.Hidden,\n\t\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\t\tRedirectStandardError = true,\n\t\t\t\t\tRedirectStandardInput = true\n\t\t\t\t});\n\t\t}\n\n\t\tpublic Process StartFuse(string command, string[] commandArguments, bool redirect, bool hide)\n\t\t{\n\t\t\treturn StartFuse(new[] { command }.Concat(commandArguments).ToArray(), redirect, hide);\n\t\t}\n\n\t\tpublic Process StartFuse(string[] arguments, bool redirect, bool hide)\n\t\t{\n#if DEBUG\n\t\t\tConsole.WriteLine(\"Starting fuse with arguments \" + arguments.Select(global::Uno.Extensions.QuoteSpace).Join(\" \"));\n#endif\n\t\t\treturn Fuse.Start(\n\t\t\t\tnew ProcessStartInfo\n\t\t\t\t{\n\t\t\t\t\tArguments = arguments.Select(global::Uno.Extensions.QuoteSpace).Join(\" \"),\n\t\t\t\t\tWindowStyle = hide ? ProcessWindowStyle.Hidden : ProcessWindowStyle.Normal,\n\t\t\t\t\tCreateNoWindow = hide,\n\t\t\t\t\tUseShellExecute = !redirect,\n\t\t\t\t\tRedirectStandardInput = redirect,\n\t\t\t\t\tRedirectStandardError = redirect,\n\t\t\t\t\tRedirectStandardOutput = redirect\n\t\t\t\t});\n\t\t}\n\n\t\tpublic void RestartFuse()\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t{\n\t\t\t\tvar file = Path.Combine(Path.GetTempPath(), \"restart-fuse.bat\");\n\t\t\t\tvar text = \"@echo off\\n\" +\n\t\t\t\t\t\t$\"\\\"{FuseExe}\\\" kill-all\\n\" +\n\t\t\t\t\t\t$\"\\\"{FuseExe}\\\"\";\n\t\t\t\tFile.WriteAllText(file, text);\n\t\t\t\tvar p = new Process();\n\t\t\t\tp.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;\n\t\t\t\tp.StartInfo.FileName = \"cmd.exe\";\n\t\t\t\tp.StartInfo.Arguments = \"/C \" + global::Uno.Extensions.QuoteSpace(file);\n\t\t\t\tp.Start();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar file = \"/tmp/restart-fuse.sh\";\n\t\t\t\tvar text = \"#!/bin/bash\\n\" +\n\t\t\t\t\t\t\"set -e\\n\" +\n\t\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\t\"# Mono and NPM\\n\" +\n\t\t\t\t\t\t\"export PATH=/usr/local/bin:/opt/local/bin:/opt/homebrew/bin:$PATH\\n\" +\n\t\t\t\t\t\t\"export PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH\\n\" +\n\t\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\t\"# Restart fuse X\\n\" +\n\t\t\t\t\t\t$\"\\\"{FuseExe}\\\" kill-all\\n\" +\n\t\t\t\t\t\t$\"\\\"{FuseExe}\\\"\\n\";\n\t\t\t\tFile.WriteAllText(file, text);\n\t\t\t\tProcess.Start(\"bash\", global::Uno.Extensions.QuoteSpace(file));\n\t\t\t}\n\t\t}\n\n\t\tpublic IReport Report { get; set; }\n\t\tpublic ILicense License { get; set; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/IFuse.cs",
    "content": "using System;\nusing Outracks.Fuse.Auth;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IFuse : IFuseLauncher, ILicenseState\n\t{\n\t\tstring Version { get; }\n\t\tstring CommitSha { get; }\n\n\t\tGuid SystemId { get; }\n\t\tGuid SessionId { get; }\n\n\t\tAbsoluteDirectoryPath FuseRoot { get; }\n\t\tAbsoluteDirectoryPath ComponentsDir { get; }\n\n\t\tAbsoluteFilePath FuseExe { get; }\n\n\t\tIExternalApplication Uno { get; }\n\t\tIExternalApplication Tray { get; }\n\t\tIExternalApplication Studio { get; }\n\n\t\tIExternalApplication CodeAssistance { get; }\n\t\tIExternalApplication LogServer { get; }\n\t\tIExternalApplication UnoHost { get; }\n\n\t\tAbsoluteDirectoryPath UserDataDir { get; }\n\t\tAbsoluteDirectoryPath ProjectsDir { get; }\n\t\tIReport Report { get; }\n\t\tILicense License { get; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/IFuseLauncher.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IFuseLauncher\n\t{\n\t\tProcess StartFuse(string command, params string[] commandArgs);\n\t\tProcess StartFuse(string command, string[] commandArgs, bool redirect, bool hide = true);\n\t\tvoid RestartFuse();\n\t}\n\n\t// TODO: merge below functions with main IFuseLauncher interface.\n\t// The code below was copied from dashboard code\n\n\tclass FuseProcessException : Exception\n\t{\n\t\tpublic FuseProcessException(string message)\n\t\t\t: base(message)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class FuseExitCode\n\t{\n\t\tpublic readonly int Code;\n\n\t\tpublic FuseExitCode(int code)\n\t\t{\n\t\t\tCode = code;\n\t\t}\n\n\t\tpublic bool Success { get { return Code == 0; } }\n\n\t\tpublic bool Failed { get { return Code != 0; } }\n\n\t\tpublic bool FatalCrash { get { return Code == 255; } }\n\t}\n\n\tpublic static class FuseLauncher\n\t{\n\t\tpublic static Task<FuseExitCode> RunFuse(\n\t\t\tthis IFuseLauncher fuseExe,\n\t\t\tstring command, string[] arguments,\n\t\t\tIObserver<string> stdout,\n\t\t\tIObserver<string> stderr = null,\n\t\t\tbool hide = true)\n\t\t{\n\t\t\treturn Task.Run(() =>\n\t\t\t{\n\t\t\t\tstderr = stderr ?? stdout;\n\n\t\t\t\tusing (var p = fuseExe.StartFuse(command, arguments, true, hide))\n\t\t\t\t{\n\t\t\t\t\tp.StandardOutput.ReadCharacters(stdout);\n\t\t\t\t\tp.StandardError.ReadCharacters(stderr);\n\n\t\t\t\t\tp.WaitForExit();\n\t\t\t\t\treturn new FuseExitCode(p.ExitCode);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Throws exceptions when errors.\n\t\t// TODO: handling errors from this function is hard due to some errors in Task and some from the call\n\t\tpublic static Task<Unit> RunFuseWithErrors(\n\t\t\tthis IFuseLauncher fuseExe,\n\t\t\tstring command,\n\t\t\tstring[] arguments,\n\t\t\tIObserver<string> outputLines,\n\t\t\tbool hide = true)\n\t\t{\n\t\t\tvar p = fuseExe.StartFuse(command, arguments, true, hide);\n\n\t\t\tvar errorQueue = new ConcurrentQueue<FuseProcessException>();\n\t\t\tvar errorLines = new Subject<string>();\n\n\t\t\terrorLines.Subscribe(line => errorQueue.Enqueue(new FuseProcessException(line.Replace(\"fuse:\", \"\").TrimStart())));\n\n\t\t\tp.ConsumeOutput(outputLines);\n\t\t\tp.ConsumeError(errorLines);\n\n\t\t\treturn Task.Run(() =>\n\t\t\t{\n\t\t\t\tp.WaitForExit();\n\t\t\t\tvar exitCode = new FuseExitCode(p.ExitCode);\n\t\t\t\tif (exitCode.Failed)\n\t\t\t\t{\n\t\t\t\t\tthrow new AggregateException(errorQueue.OfType<Exception>().ToArray());\n\t\t\t\t}\n\n\t\t\t\treturn Unit.Default;\n\t\t\t});\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/KillAll/FuseKiller.cs",
    "content": "﻿using System;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic class FuseKiller : IFuseKiller\n\t{\n\t\treadonly IFuseKiller _impl;\n\t\tpublic FuseKiller(IReport log, AbsoluteDirectoryPath fuseRoot)\n\t\t{\n\t\t\tif (Platform.IsMac)\n\t\t\t{\n\t\t\t\t_impl = new MacFuseKiller(log, fuseRoot);\n\t\t\t}\n\t\t\telse if(Platform.IsWindows)\n\t\t\t{\n\t\t\t\t_impl = new WinFuseKiller(log, fuseRoot);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new PlatformNotSupportedException();\n\t\t}\n\n\t\tpublic void Execute(ColoredTextWriter console)\n\t\t{\n\t\t\t_impl.Execute(console);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/KillAll/IFuseKiller.cs",
    "content": "﻿namespace Outracks.Fuse\n{\n\tpublic interface IFuseKiller\n\t{\n\t\tvoid Execute(ColoredTextWriter console);\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/KillAll/MacFuseKiller.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic class MacFuseKiller : IFuseKiller\n\t{\n\t\treadonly IReport _report;\n\t\treadonly AbsoluteDirectoryPath _fuseRoot;\n\n\t\tpublic MacFuseKiller(IReport report, AbsoluteDirectoryPath fuseRoot)\n\t\t{\n\t\t\t_report = report;\n\t\t\t_fuseRoot = fuseRoot;\n\t\t}\n\n\t\tpublic void Execute(ColoredTextWriter console)\n\t\t{\n\t\t\tvar fuseProcesses = Process.GetProcesses()\n\t\t\t\t.Where(ProcessIsRootedInFuseRoot)\n\t\t\t\t.Where(NotOurSelf);\n\n\t\t\tforeach (var p in fuseProcesses)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t_report.Info(\"Killing \" + ProcessDescription(p), ReportTo.LogAndUser);\n\t\t\t\t\tp.Kill();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\t_report.Error(\"Error killing '\" + ProcessDescription(p) + \"': \" + e.Message, ReportTo.LogAndUser);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static string ProcessDescription(Process p)\n\t\t{\n\t\t\tvar name = \"<unknown process name>\";\n\t\t\ttry\n\t\t\t{\n\t\t\t\tname = p.ProcessName;\n\t\t\t}\n\t\t\tcatch (InvalidOperationException)\n\t\t\t{\n\t\t\t}\n\t\t\treturn \"process \" + p.Id + \" - \" + name;\n\t\t}\n\n\t\tbool NotOurSelf(Process process)\n\t\t{\n\t\t\tif (process.Id == Process.GetCurrentProcess().Id)\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool ProcessIsRootedInFuseRoot(Process p)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tswitch (p.ProcessName)\n\t\t\t\t{\n\t\t\t\t\tcase \"fuse\":\n\t\t\t\t\tcase \"fuse X\":\n\t\t\t\t\tcase \"fuse X (menu bar)\":\n\t\t\t\t\tcase \"fuse-lang\":\n\t\t\t\t\tcase \"Fuse Studio\":\t// Legacy\n\t\t\t\t\tcase \"Fuse Tray\":\t// Legacy\n\t\t\t\t\tcase \"UnoHost\":\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar path = GetPathForPid(p.Id);\n\t\t\t\treturn path.IsOrIsRootedIn(_fuseRoot);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_report.Error(\"Error checking rooting of \" + p.Id + \": \" + e.Message);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tstatic AbsoluteFilePath GetPathForPid(int pid)\n\t\t{\n\t\t\tconst int maxPath = 1024 * 4;\n\t\t\tvar pathBuffer = new StringBuilder(maxPath);\n\t\t\tvar res = proc_pidpath(pid, pathBuffer, maxPath);\n\t\t\tif (res <= 0)\n\t\t\t\tthrow new FailedToAcquirePathForPid(res);\n\n\t\t\tvar path = AbsoluteFilePath.Parse(pathBuffer.ToString());\n\t\t\treturn path;\n\t\t}\n\n\t\t[DllImport(\"libproc\")]\n\t\textern static int proc_pidpath(int pid, StringBuilder buffer, int buffersize);\n\t}\n\n\tclass FailedToAcquirePathForPid : Exception\n\t{\n\t\tpublic readonly int Code;\n\n\t\tpublic FailedToAcquirePathForPid(int code) : base(\"Failed to acquire path for pid. Error code: \" + code)\n\t\t{\n\t\t\tCode = code;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/KillAll/WinFuseKiller.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic class WinFuseKiller : IFuseKiller\n\t{\n\t\treadonly IReport _report;\n\t\treadonly AbsoluteDirectoryPath _fuseRoot;\n\n\t\tpublic WinFuseKiller(IReport report, AbsoluteDirectoryPath fuseRoot)\n\t\t{\n\t\t\t_report = report;\n\t\t\t_fuseRoot = fuseRoot;\n\t\t}\n\n\t\tpublic void Execute(ColoredTextWriter console)\n\t\t{\n\t\t\tvar fuseProcesses = Process.GetProcesses()\n\t\t\t\t.Where(ProcessIsRootedInFuseRoot)\n\t\t\t\t.Where(NotOurSelf);\n\n\t\t\tforeach (var p in fuseProcesses)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tconsole.WriteLine(\"Killing \" + p.ProcessName);\n\t\t\t\t\tp.Kill();\n\t\t\t\t\tp.WaitForExit(5000);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\t_report.Error(e.Message, ReportTo.LogAndUser);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbool NotOurSelf(Process process)\n\t\t{\n\t\t\tif (process.Id == Process.GetCurrentProcess().Id)\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tbool ProcessIsRootedInFuseRoot(Process p)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tswitch (p.ProcessName)\n\t\t\t\t{\n\t\t\t\t\tcase \"fuse\":\n\t\t\t\t\tcase \"fuse-lang\":\n\t\t\t\t\tcase \"fuse-studio\":\n\t\t\t\t\tcase \"fuse-tray\":\n\t\t\t\t\tcase \"unohost\":\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar path = GetPathForProcess(p);\n\t\t\t\tif (path.IsOrIsRootedIn(_fuseRoot))\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcatch (Win32Exception e)\n\t\t\t{\n\t\t\t\tconst int accessDenied = -2147467259;\n\t\t\t\tif (e.HResult == accessDenied)\n\t\t\t\t{\n\t\t\t\t\tvar isLikelyAFuseProcess = p\n\t\t\t\t\t\t.ProcessName\n\t\t\t\t\t\t.ToUpper(CultureInfo.InvariantCulture)\n\t\t\t\t\t\t.Contains(\"FUSE\");\n\n\t\t\t\t\t// We only care about access denied if this is likely a fuse process.\n\t\t\t\t\tif (isLikelyAFuseProcess)\n\t\t\t\t\t\t_report.Error(p.ProcessName + \": \" + e.Message);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcatch (InvalidOperationException e)\n\t\t\t{\n\t\t\t\tconst int processHasExited = -2146233079;\n\t\t\t\tif (e.HResult != processHasExited)\n\t\t\t\t{\n\t\t\t\t\t_report.Error(p.ProcessName + \": \" + e.Message);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_report.Error(p.ProcessName + \": \" + e.Message);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tstatic AbsoluteFilePath GetPathForProcess(Process process)\n\t\t{\n\t\t\tint maxPath = 1024 * 4;\n\t\t\tvar exePath = new StringBuilder(maxPath);\n\t\t\tvar res = QueryFullProcessImageName(process.Handle, 0, exePath, ref maxPath);\n\t\t\tif (!res)\n\t\t\t{\n\t\t\t\tthrow new FailedToAcquirePathForPid(Marshal.GetLastWin32Error());\n\t\t\t}\n\n\t\t\tvar path = AbsoluteFilePath.Parse(exePath.ToString());\n\t\t\treturn path;\n\t\t}\n\n\t\t[DllImport(\"kernel32.dll\", SetLastError = true)]\n\t\tstatic extern bool QueryFullProcessImageName([In]IntPtr hProcess, [In]int dwFlags, [Out]StringBuilder lpExeName, ref int lpdwSize);\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Net/FuseWebClient.cs",
    "content": "﻿using Outracks.Fuse.Auth;\nusing System;\nusing System.IO;\nusing System.Net;\n\nnamespace Outracks.Fuse.Net\n{\n\tpublic class FuseWebClient : WebClient\n\t{\n\t\treadonly string UserAgent = \"fuse/\" +\n\t\t\tSystemInfoFactory.GetBuildVersion(typeof(FuseWebClient).Assembly) +\n\t\t\t\" (\" + Uno.Diagnostics.PlatformDetection.SystemString + \")\";\n\n\t\tpublic FuseWebClient()\n\t\t{\n\t\t\tCredentials = CredentialCache.DefaultCredentials;\n\t\t}\n\n\t\tpublic FuseWebClient(LicenseStatus status)\n\t\t\t: this()\n\t\t{\n\t\t\tif (status != LicenseStatus.OK)\n\t\t\t\tUserAgent += \" \" + status;\n\t\t}\n\n\t\tprotected override WebRequest GetWebRequest(Uri address)\n\t\t{\n#if DEBUG\n\t\t\tConsole.WriteLine(nameof(FuseWebClient) + \": \" + address);\n#endif\n\t\t\tvar request = (HttpWebRequest)WebRequest.Create(address);\n\t\t\trequest.AllowAutoRedirect = true;\n\t\t\trequest.UserAgent = UserAgent;\n\t\t\treturn request;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Outracks.Fuse.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{AA6DFB99-345F-4214-9A79-076829C0F777}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse</RootNamespace>\n    <AssemblyName>Outracks.Fuse</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942\">\n      <HintPath>..\\..\\..\\packages\\BouncyCastle.1.8.9\\lib\\BouncyCastle.Crypto.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Management\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Uno.Configuration\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Configuration.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.UX.Markup\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.UX.Markup.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Xamarin.Mac\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\xamarin-mac\\Xamarin.Mac.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Auth\\ILicenseState.cs\" />\n    <Compile Include=\"Auth\\Utilities\\Win32HardwareInfo.cs\" />\n    <Compile Include=\"Net\\FuseWebClient.cs\">\n      <SubType>Component</SubType>\n    </Compile>\n    <Compile Include=\"Protocol\\Auth\\LicenseEvent.cs\" />\n    <Compile Include=\"Auth\\Utilities\\GZip.cs\" />\n    <Compile Include=\"Auth\\Hardware.cs\" />\n    <Compile Include=\"Auth\\LicenseData.cs\" />\n    <Compile Include=\"Auth\\UriHandler.cs\" />\n    <Compile Include=\"Auth\\Utilities\\BASE36.cs\" />\n    <Compile Include=\"ExportTargetNotSupported.cs\" />\n    <Compile Include=\"DefaultApplicationWin.cs\" />\n    <Compile Include=\"FileExtensions.cs\" />\n    <Compile Include=\"FileFilters.cs\" />\n    <Compile Include=\"FuseApi.cs\" />\n    <Compile Include=\"FuseImpl.cs\" />\n    <Compile Include=\"IFuse.cs\" />\n    <Compile Include=\"IFuseLauncher.cs\" />\n    <Compile Include=\"Auth\\ILicense.cs\" />\n    <Compile Include=\"KillAll\\FuseKiller.cs\" />\n    <Compile Include=\"KillAll\\IFuseKiller.cs\" />\n    <Compile Include=\"KillAll\\MacFuseKiller.cs\" />\n    <Compile Include=\"KillAll\\WinFuseKiller.cs\" />\n    <Compile Include=\"Auth\\License.cs\" />\n    <Compile Include=\"Auth\\LicenseStatus.cs\" />\n    <Compile Include=\"Auth\\Storage.cs\" />\n    <Compile Include=\"UxExpression.cs\" />\n    <Compile Include=\"Parsed.cs\" />\n    <Compile Include=\"SourceFragment.cs\" />\n    <Compile Include=\"UxWriter.cs\" />\n    <Compile Include=\"UxSize.cs\" />\n    <Compile Include=\"ProjectDetector.cs\" />\n    <Compile Include=\"ProjectNotFound.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Protocol\\Building\\BuildEnded.cs\" />\n    <Compile Include=\"Protocol\\Building\\BuildIssueDetected.cs\" />\n    <Compile Include=\"Protocol\\Building\\BuildLogged.cs\" />\n    <Compile Include=\"Protocol\\Building\\BuildStarted.cs\" />\n    <Compile Include=\"Protocol\\Client.cs\" />\n    <Compile Include=\"Protocol\\ConnectAndGreet.cs\" />\n    <Compile Include=\"Protocol\\ConnectWithReconnect.cs\" />\n    <Compile Include=\"Protocol\\Core\\FocusDesignerRequest.cs\" />\n    <Compile Include=\"Protocol\\Core\\FocusDesignerResponse.cs\" />\n    <Compile Include=\"Protocol\\Core\\FocusEditorResponse.cs\" />\n    <Compile Include=\"Protocol\\Core\\FocusEditorRequest.cs\" />\n    <Compile Include=\"Protocol\\Core\\Hello.cs\" />\n    <Compile Include=\"Protocol\\Core\\KillRequest.cs\" />\n    <Compile Include=\"Protocol\\Core\\KillResponse.cs\" />\n    <Compile Include=\"Protocol\\Core\\ProjectClosed.cs\" />\n    <Compile Include=\"Protocol\\Core\\PublishService.cs\" />\n    <Compile Include=\"Protocol\\Core\\Subscribe.cs\" />\n    <Compile Include=\"Protocol\\Core\\Unsubscribe.cs\" />\n    <Compile Include=\"Protocol\\Core\\Welcome.cs\" />\n    <Compile Include=\"Protocol\\DaemonKey.cs\" />\n    <Compile Include=\"Protocol\\DaemonSpawner.cs\" />\n    <Compile Include=\"Protocol\\Event.cs\" />\n    <Compile Include=\"Protocol\\IMessage.cs\" />\n    <Compile Include=\"Protocol\\IMessagingService.cs\" />\n    <Compile Include=\"Protocol\\LocalSocketClient.cs\" />\n    <Compile Include=\"Protocol\\LocalSocketServer.cs\" />\n    <Compile Include=\"Protocol\\MessageManager.cs\" />\n    <Compile Include=\"Protocol\\NullObjects.cs\" />\n    <Compile Include=\"Protocol\\PayloadParserContext.cs\" />\n    <Compile Include=\"Protocol\\Preview\\ExceptionEvent.cs\" />\n    <Compile Include=\"Protocol\\Preview\\LogEvent.cs\" />\n    <Compile Include=\"Protocol\\Preview\\ProjectIdComputer.cs\" />\n    <Compile Include=\"Protocol\\Preview\\RegisterClientEvent.cs\" />\n    <Compile Include=\"Protocol\\Preview\\TextPosition.cs\" />\n    <Compile Include=\"Protocol\\Request.cs\" />\n    <Compile Include=\"Protocol\\RequestSender.cs\" />\n    <Compile Include=\"Protocol\\ResetPreviewEvent.cs\" />\n    <Compile Include=\"Protocol\\Response.cs\" />\n    <Compile Include=\"Protocol\\SelectionChanged.cs\" />\n    <Compile Include=\"Protocol\\Serializer.cs\" />\n    <Compile Include=\"Protocol\\SwitchingMessagingService.cs\" />\n    <Compile Include=\"WebLinks.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\text\\Outracks.Text.csproj\">\n      <Project>{d52bec1d-d0b3-4c44-956f-9747233cd6ca}</Project>\n      <Name>Outracks.Text</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{E8884270-5F2C-4076-86D0-456B831BE3E5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fuse/common/Outracks.Fuse.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Attribute/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Attribute_005CConverters/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Document/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Element/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Project/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Project_005CConverters/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/fuse/common/Parsed.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic class Parsed<T>\n\t{\n\t\tpublic Optional<T> Value { get; set; }\n\t\tpublic string String { get; set; }\n\n\t\tpublic static Parsed<T> operator |(Parsed<T> a, Parsed<T> b)\n\t\t{\n\t\t\treturn a.Or(b);\n\t\t}\n\n\t\tpublic static bool operator !(Parsed<T> result)\n\t\t{\n\t\t\treturn !result.Value.HasValue;\n\t\t}\n\n\t\tpublic static bool operator true(Parsed<T> result)\n\t\t{\n\t\t\treturn result.Value.HasValue;\n\t\t}\n\n\t\tpublic static bool operator false(Parsed<T> result)\n\t\t{\n\t\t\treturn !result.Value.HasValue;\n\t\t}\n\t}\n\n\tpublic static class Parsed\n\t{\n\t\tpublic static Parsed<T> Or<T>(this Parsed<T> left, Parsed<T> right)\n\t\t{\n\t\t\treturn left.Value.HasValue ? left : right;\n\t\t}\n\n\t\tpublic static Parsed<TOut> Select<TIn, TOut>(this Parsed<TIn> value, Func<TIn, TOut> convert)\n\t\t{\n\t\t\tif (!value.Value.HasValue)\n\t\t\t\treturn Failure<TOut>(value.String);\n\n\t\t\treturn Success(convert(value.Value.Value), value.String);\n\t\t}\n\n\t\tpublic static Parsed<T> Success<T>(T value, string stringValue)\n\t\t{\n\t\t\treturn new Parsed<T>\n\t\t\t{\n\t\t\t\tValue = value,\n\t\t\t\tString = stringValue,\n\t\t\t};\n\t\t}\n\n\t\tpublic static Parsed<T> Failure<T>(string strinvValue)\n\t\t{\n\t\t\treturn new Parsed<T>\n\t\t\t{\n\t\t\t\tValue = Optional.None(),\n\t\t\t\tString = strinvValue,\n\t\t\t};\n\t\t}\n\n\t\tpublic static Parsed<T> Create<T>(string stringValue, Optional<T> value)\n\t\t{\n\t\t\treturn new Parsed<T>\n\t\t\t{\n\t\t\t\tValue = value,\n\t\t\t\tString = stringValue,\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/ProjectDetector.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic sealed class ProjectDetector\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\n\t\tpublic ProjectDetector(IFileSystem fileSystem)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t}\n\n\t\t/// <exception cref=\"ProjectNotFound\" />\n\t\tpublic AbsoluteFilePath GetCurrentProject(Optional<IAbsolutePath> maybeProject)\n\t\t{\n\t\t\treturn GetProject(maybeProject.Or((IAbsolutePath)DirectoryPath.GetCurrentDirectory()));\n\t\t}\n\n\t\t/// <exception cref=\"ProjectNotFound\" />\n\t\tpublic AbsoluteFilePath GetProject(IAbsolutePath directoryOrFileInProject)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn GetProjects(directoryOrFileInProject).FirstOrNone().OrThrow(new ProjectNotFound());\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow new ProjectNotFound(e);\n\t\t\t}\n\t\t\tcatch (UnauthorizedAccessException e)\n\t\t\t{\n\t\t\t\tthrow new ProjectNotFound(e);\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"IOException\" />\n\t\t/// <exception cref=\"UnauthorizedAccessException\" />\n\t\tIEnumerable<AbsoluteFilePath> GetProjects(IAbsolutePath directoryOrFileInProject)\n\t\t{\n\t\t\tif (!_fileSystem.Exists(directoryOrFileInProject))\n\t\t\t\tthrow new FileNotFoundException(\n\t\t\t\t\t\"Could not find file or directory \" + directoryOrFileInProject.NativePath,\n\t\t\t\t\tdirectoryOrFileInProject.NativePath);\n\n\t\t\treturn directoryOrFileInProject.MatchWith(\n\t\t\t\t(AbsoluteFilePath file) => GetProjectsContaining(file),\n\t\t\t\t(AbsoluteDirectoryPath dir) => GetProjectsInOrContaining(dir));\n\t\t}\n\n\t\t/// <exception cref=\"IOException\" />\n\t\t/// <exception cref=\"UnauthorizedAccessException\" />\n\t\tIEnumerable<AbsoluteFilePath> GetProjectsContaining(AbsoluteFilePath fileInProject)\n\t\t{\n\t\t\tif (fileInProject.IsProjectFile())\n\t\t\t\treturn new[] { fileInProject };\n\n\t\t\treturn GetProjectsInOrContaining(fileInProject.ContainingDirectory); // TODO: maybe actually open the project to see if it contains the file\n\t\t}\n\n\t\t/// <exception cref=\"IOException\" />\n\t\t/// <exception cref=\"UnauthorizedAccessException\" />\n\t\tIEnumerable<AbsoluteFilePath> GetProjectsInOrContaining(AbsoluteDirectoryPath projectDirectory)\n\t\t{\n\t\t\tvar currentDirectory = projectDirectory;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tforeach (var file in GetProjectsIn(currentDirectory))\n\t\t\t\t\tyield return file;\n\n\t\t\t} while ((currentDirectory = currentDirectory.ContainingDirectory) != null);\n\t\t}\n\n\t\t/// <exception cref=\"IOException\" />\n\t\t/// <exception cref=\"UnauthorizedAccessException\" />\n\t\tIEnumerable<AbsoluteFilePath> GetProjectsIn(AbsoluteDirectoryPath dir)\n\t\t{\n\t\t\treturn _fileSystem.GetFiles(dir).Where(file => file.IsProjectFile());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/ProjectNotFound.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ProjectNotFound : Exception\n\t{\n\t\tpublic ProjectNotFound(Exception innerException = null)\n\t\t\t: base(\"Project not found\", innerException)\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyTitle(\"Outracks.FuseEditor\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: InternalsVisibleTo(\"Outracks.Fuse.Protocol.Tests\")]\n"
  },
  {
    "path": "src/fuse/common/Protocol/Auth/LicenseEvent.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol.Auth\n{\n\t[PayloadTypeName(\"License\")]\n\tpublic class LicenseEvent: IEventData\n\t{\n\t\tpublic bool Error = false;\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/Building/BuildEnded.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"Fuse.BuildEnded\")]\n\tpublic class BuildEndedData : IEventData\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic Guid BuildId;\n\n\t\tpublic BuildStatus Status;\n\n\t\t// output and stuff?\n\t}\n\n\tpublic enum BuildStatus\n\t{\n\t\tSuccess,\n\t\tError,\n\t\tInternalError,\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Building/BuildIssueDetected.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Protocol\n{\n\t// Be careful changing the names, it means the API changes!\n\tpublic enum BuildIssueTypeData\n\t{\n\t\tUnknown,\n\t\tFatalError,\n\t\tError,\n\t\tWarning,\n\t\tMessage,\n\t}\n\n\n\t[PayloadTypeName(\"Fuse.BuildIssueDetected\")]\n\tpublic class BuildIssueDetectedData : IEventData\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic Guid BuildId;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic BuildIssueTypeData IssueType;\n\n\t\t[PluginComment(\"Optional\")]\n\t\tpublic string Path;\n\n\t\t[PluginComment(\"Optional\")]\n\t\tpublic Messages.TextPosition StartPosition;\n\n\t\t[PluginComment(\"Optional\")]\n\t\tpublic Messages.TextPosition EndPosition;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string ErrorCode;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string Message;\n\t}\n\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Building/BuildLogged.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"Fuse.BuildLogged\")]\n\tpublic class BuildLoggedData : IEventData\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic Guid BuildId;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string Message;\n\t}\n\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Building/BuildStarted.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic enum BuildTypeData\n\t{\n\t\tFullCompile,\n\t\tLoadMarkup,\n\t}\n\n\tpublic enum BuildTarget\n\t{\n\t\tUnknown,\n\t\tDotNet,\n\t\tAndroid,\n\t\tiOS,\n\t\tNative\n\t}\n\n\t[PayloadTypeName(\"Fuse.BuildStarted\")]\n\tpublic class BuildStartedData : IEventData\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic BuildTypeData BuildType;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic Guid BuildId;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string BuildTag = \"\";\n\n\t\t[PluginComment(\"\")]\n\t\tpublic Guid ProjectId;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic string ProjectPath;\n\n\t\t[PluginComment(\"\")]\n\t\tpublic BuildTarget Target;\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/Client.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Analytics;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic class Client : IMessagingService\n\t{\n\t\treadonly IMessageConnection _client;\n\t\treadonly IObserver<IEventData> _eventBroadcaster;\n\t\treadonly RequestSender _requestSender;\n\t\treadonly ConcurrentBag<Type> _implements = new ConcurrentBag<Type>();\n\t\treadonly IRequestReceiver _receiver;\n\t\treadonly IObservable<IEventMessage<UnresolvedMessagePayload>> _broadcastedEvents;\n\t\tint _subscribtionId;\n\n\t\treadonly Subject<DateTime> _connectionLost = new Subject<DateTime>();\n\t\treadonly IReport _report;\n\n\t\tpublic IObservable<DateTime> ConnectionLost\n\t\t{\n\t\t\tget { return _connectionLost; }\n\t\t}\n\n\t\t/// <exception cref=\"System.TimeoutException\">Thrown when no response to publish service request.</exception>\n\t\t/// <exception cref=\"System.AggregateException\">Thrown if publish service request failed.</exception>\n\t\tpublic IObservable<T> BroadcastedEvents<T>(bool wantReplay) where T : IEventData\n\t\t{\n\t\t\treturn Observable.Create<T>(\n\t\t\t\tlistener =>\n\t\t\t\t{\n\t\t\t\t\tvar id = Interlocked.Increment(ref _subscribtionId);\n\n\t\t\t\t\tvar disposeMe = _broadcastedEvents\n\t\t\t\t\t\t.Where(m => m.SubscriptionId == id)\n\t\t\t\t\t\t.Deserialize<T>(_report)\n\t\t\t\t\t\t.Select(d => d.Data)\n\t\t\t\t\t\t.Subscribe(listener);\n\n\t\t\t\t\tvar payloadName = typeof(T).GetPayloadTypeName();\n\t\t\t\t\tif (!_requestSender.Send(new SubscribeRequest(payloadName, wantReplay, id))\n\t\t\t\t\t\t.Wait(TimeSpan.FromSeconds(10)))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new TimeoutException(\"Subscribe to event timed out.\");\n\t\t\t\t\t}\n\n\t\t\t\t\treturn disposeMe;\n\t\t\t\t});\n\t\t}\n\n\t\tpublic void Broadcast<T>(T theEvent) where T : IEventData\n\t\t{\n\t\t\t_eventBroadcaster.OnNext(theEvent);\n\t\t}\n\n\t\t/// <exception cref=\"System.TimeoutException\">Thrown when no response to publish service request.</exception>\n\t\t/// <exception cref=\"System.AggregateException\">Thrown if publish service request failed.</exception>\n\t\tpublic IDisposable ProvideOptionally<TRequest, TResponse>(Func<TRequest, Optional<TResponse>> func)\n\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\twhere TResponse : IResponseData\n\t\t{\n\t\t\tvar requestType = typeof (TRequest);\n\t\t\tif (!_implements.Contains(requestType))\n\t\t\t{\n\t\t\t\tvar publishServiceRequest = new PublishServiceRequest(new[] { requestType.GetPayloadTypeName() });\n\t\t\t\tif (!_requestSender.Send(publishServiceRequest)\n\t\t\t\t\t.Wait(TimeSpan.FromSeconds(30)))\n\t\t\t\t{\n\t\t\t\t\tthrow new TimeoutException(\"Publish service request timed out.\");\n\t\t\t\t}\n\n\t\t\t\t// This is a bit race condition prone, however does not matter.\n\t\t\t\t// There are no problems with sending publish service request more than one time.\n\t\t\t\t_implements.Add(requestType);\n\t\t\t}\n\n\t\t\treturn _receiver.SubscribeToRequest(func);\n\t\t}\n\n\t\t/// <exception cref=\"System.TimeoutException\">Thrown when no response to publish service request.</exception>\n\t\t/// <exception cref=\"System.AggregateException\">Thrown if publish service request failed.</exception>\n\t\tpublic IDisposable Provide<TRequest, TResponse>(Func<TRequest, TResponse> func)\n\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\twhere TResponse : IResponseData\n\t\t{\n\t\t\treturn ProvideOptionally<TRequest, TResponse>((req) => Optional.Some(func(req)));\n\t\t}\n\n\t\tpublic Task<TResponse> Request<TResponse>(IRequestData<TResponse> request) where TResponse : IResponseData\n\t\t{\n\t\t\treturn _requestSender.Send(request);\n\t\t}\n\n\t\tpublic Client(IMessageConnection client, ISerializer serializer)\n\t\t{\n\t\t\t_report = ReportFactory.GetReporter(SystemGuidLoader.LoadOrCreateOrEmpty(), Guid.NewGuid(), \"FuseProtocol\");\n\t\t\t_client = client;\n\t\t\tvar messagesOut = client.OutgoingMessages.Serialized(serializer);\n\n\t\t\t// TODO: Find a way to either log or do something about parse errors.\n\t\t\tvar messagesIn = client.IncomingMessages.TryDeserialize(serializer,\n\t\t\t\t_report);\n\n\t\t\tmessagesIn.Subscribe(a => { }, () => _connectionLost.OnNext(DateTime.Now));\n\n\t\t\t_requestSender = new RequestSender(_report, messagesIn, messagesOut);\n\t\t\t_receiver = new RequestReceiver(_report, messagesIn.OfType<IRequestMessage<UnresolvedMessagePayload>>(), messagesOut);\n\t\t\t_eventBroadcaster = Observer.Create<IEventData>(e => messagesOut.OnNext(Event.Create(e)));\n\t\t\t_broadcastedEvents = messagesIn.OfType<IEventMessage<UnresolvedMessagePayload>>();\n\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_requestSender.Dispose();\n\t\t\t_client.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/ConnectAndGreet.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ConnectAndGreet\n\t{\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\t/// <exception cref=\"FailedToGreetDaemon\" />\n\t\tpublic static async Task<IMessagingService> ConnectAsync(\n\t\t\tthis IFuseLauncher spawner,\n\t\t\tstring identifier)\n\t\t{\n\t\t\tvar client = await spawner.ConnectAsync();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tawait SendHelloRequestAsync(client, identifier, spawner.GetDaemonKey());\n\t\t\t\treturn client;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToGreetDaemon(e);\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\t/// <exception cref=\"FailedToGreetDaemon\" />\n\t\tpublic static IMessagingService Connect(\n\t\t\tthis IFuseLauncher spawner,\n\t\t\tstring identifier,\n\t\t\tTimeSpan timeout)\n\t\t{\n\t\t\tvar client = spawner.Connect();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tclient.SendHelloRequest(identifier, timeout, spawner.GetDaemonKey());\n\t\t\t\treturn client;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToGreetDaemon(e);\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"FailedToSpawnDaemon\" />\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\t/// <exception cref=\"FailedToGreetDaemon\" />\n\t\tpublic static async Task<IMessagingService> ConnectOrSpawnAsync(\n\t\t\tthis IFuseLauncher spawner,\n\t\t\tstring identifier)\n\t\t{\n\t\t\tvar client = await spawner.ConnectOrSpawnAsync();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tawait client.SendHelloRequestAsync(identifier, spawner.GetDaemonKey());\n\t\t\t\treturn client;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToGreetDaemon(e);\n\t\t\t}\n\t\t}\n\n\n\t\t/// <exception cref=\"FailedToSpawnDaemon\" />\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\t/// <exception cref=\"FailedToGreetDaemon\" />\n\t\tpublic static IMessagingService ConnectOrSpawn(\n\t\t\tthis IFuseLauncher spawner,\n\t\t\tstring identifier,\n\t\t\tTimeSpan timeout)\n\t\t{\n\t\t\tvar client = spawner.ConnectOrSpawn();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tSendHelloRequest(client, identifier, timeout, spawner.GetDaemonKey());\n\t\t\t\treturn client;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToGreetDaemon(e);\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"RequestFailed\"></exception>\n\t\t/// <exception cref=\"TimeoutException\"></exception>\n\t\tstatic void SendHelloRequest(\n\t\t\tthis IMessagingService client,\n\t\t\tstring identifier,\n\t\t\tTimeSpan timeout,\n\t\t\tDaemonKey daemonKey)\n\t\t{\n\t\t\tclient\n\t\t\t\t.SendHelloRequestAsync(identifier, daemonKey)\n\t\t\t\t.GetResultAndUnpackExceptions(timeout)\n\t\t\t\t.OrThrow(new TimeoutException(\"Daemon did not respond to handshake (Timeout = \" + timeout + \")\"));\n\t\t}\n\n\t\t/// <exception cref=\"RequestFailed\"></exception>\n\t\t/// <exception cref=\"TimeoutException\"></exception>\n\t\tstatic async Task<HelloResponse> SendHelloRequestAsync(\n\t\t\tthis IMessagingService client,\n\t\t\tstring identifier,\n\t\t\tDaemonKey daemonKey)\n\t\t{\n\t\t\treturn await client.Request(\n\t\t\t\tnew HelloRequest\n\t\t\t\t{\n\t\t\t\t\tIdentifier = identifier,\n\t\t\t\t\tDaemonKey = daemonKey.Serialize()\n\t\t\t\t});\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/ConnectWithReconnect.cs",
    "content": "using System;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ConnectWithReconnect\n\t{\n\t\tpublic static IObservable<Optional<IMessagingService>> ConnectRetry(\n\t\t\tthis IFuseLauncher spawner,\n\t\t\tstring identifier)\n\t\t{\n\t\t\tvar daemon = new BehaviorSubject<Optional<IMessagingService>>(Optional.None());\n\t\t\tTask.Run(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\twhile (true)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar daemonConnection = spawner.Connect(\n\t\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t\t\tTimeSpan.FromMinutes(1));\n\n\t\t\t\t\t\t\tdaemon.OnNext(Optional.Some(daemonConnection));\n\n\t\t\t\t\t\t\tvar waitForDone = new AutoResetEvent(false);\n\t\t\t\t\t\t\tdaemonConnection.ConnectionLost.Subscribe(d => waitForDone.Set());\n\t\t\t\t\t\t\twaitForDone.WaitOne();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.Sleep(TimeSpan.FromSeconds(10));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinally\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdaemon.OnNext(Optional.None());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\treturn daemon;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/FocusDesignerRequest.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"FocusDesigner\")]\n\tpublic class FocusDesignerRequest : IRequestData<FocusDesignerResponse>\n\t{\n\t\t[PluginComment(\"File path\")]\n\t\tpublic string File;\n\n\t\t[PluginComment(\"Cursor line\")]\n\t\tpublic int Line;\n\n\t\t[PluginComment(\"Cursor column\")]\n\t\tpublic int Column;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/FocusDesignerResponse.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"FocusDesigner\")]\n\tpublic class FocusDesignerResponse : IResponseData\n\t{\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/FocusEditorRequest.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"FocusEditor\")]\n\tpublic class FocusEditorRequest : IRequestData<FocusEditorResponse>\n\t{\n\t\t[PluginComment(\"File path\")]\n\t\tpublic string File;\n\n\t\t[PluginComment(\"Cursor line\")]\n\t\tpublic int Line;\n\n\t\t[PluginComment(\"Cursor column\")]\n\t\tpublic int Column;\n\n\t\t[PluginComment(\"Project file path\")]\n\t\tpublic string Project;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/FocusEditorResponse.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"FocusEditor\")]\n\tpublic class FocusEditorResponse : IResponseData\n\t{\n\t\t[PluginComment(\"Handle to focus, only used on Windows platform\")]\n\t\tpublic int? FocusHwnd;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/Hello.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"Hello\")]\n\tpublic sealed class HelloRequest : IRequestData<HelloResponse>\n\t{\n\t\t[PluginComment(\"A list of requests that you respond to.\"),\n\t\t Obsolete(\"This will be removed and replaced by PublishServiceRequest\")]\n\t\tpublic string []Implements;\n\n\t\t[PluginComment(\"A string consisting of a RegEx specifiying a filter for broadcasted events.\"),\n\t\t Obsolete(\"This will be removed and replaced by SubscribeRequest\")]\n\t\tpublic string EventFilter;\n\n\t\t[PluginComment(\"What you want to identify yourself as for the daemon.\")]\n\t\tpublic string Identifier;\n\n\t\t[PluginComment(\"Daemon key used to differentiate daemons between different local users. \" +\n\t\t\t\"Run `fuse daemon --get-key` to accuire this key\")]\n\t\tpublic string DaemonKey;\n\t}\n\n\t[PayloadTypeName(\"Hello\")]\n\tpublic sealed class HelloResponse : IResponseData\n\t{\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/KillRequest.cs",
    "content": "using Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.Daemon\n{\n\t[PayloadTypeName(\"Fuse.KillDaemon\")]\n\tpublic sealed class KillRequest : IRequestData<KillResponse>\n\t{\n\t\t[PluginComment(\"Reason for why you want to kill me.\")]\n\t\tpublic string Reason;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/KillResponse.cs",
    "content": "using Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.Daemon\n{\n\t[PayloadTypeName(\"Fuse.KillDaemon\")]\n\tpublic sealed class KillResponse : IResponseData\n\t{\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/ProjectClosed.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Protocol.Messages\n{\n\t[PayloadTypeName(\"Fuse.ProjectClosed\")]\n\tpublic class ProjectClosed : IEventData\n\t{\n\t\tpublic Guid ProjectId;\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/Core/PublishService.cs",
    "content": "namespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"PublishService\")]\n\tpublic sealed class PublishServiceRequest : IRequestData<PublishServiceResponse>\n\t{\n\t\t[PluginComment(\"A list of requests that you respond to.\")]\n\t\tpublic readonly string[] RequestNames;\n\n\t\tpublic PublishServiceRequest(string []requestNames)\n\t\t{\n\t\t\tRequestNames = requestNames;\n\t\t}\n\t}\n\n\t[PayloadTypeName(\"PublishService\")]\n\tpublic sealed class PublishServiceResponse : IResponseData\n\t{\n\t}\n\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/Subscribe.cs",
    "content": "namespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"Subscribe\")]\n\tpublic sealed class SubscribeRequest : IRequestData<SubscribeResponse>\n\t{\n\t\t[PluginComment(\"A string consisting of a RegEx specifiying a filter for broadcasted events.\")]\n\t\tpublic readonly string Filter;\n\n\t\t[PluginComment(\"Determins if the sender wants to get a replay of the stored buffer of events (before receieving currently broadcasted events)\")]\n\t\tpublic readonly bool Replay;\n\n\t\t[PluginComment(\"Id of subscription\")]\n\t\tpublic readonly int SubscriptionId;\n\n\t\tpublic SubscribeRequest(string filter, bool replay, int subscriptionId)\n\t\t{\n\t\t\tFilter = filter;\n\t\t\tReplay = replay;\n\t\t\tSubscriptionId = subscriptionId;\n\t\t}\n\t}\n\n\t[PayloadTypeName(\"Subscribe\")]\n\tpublic sealed class SubscribeResponse : IResponseData\n\t{\n\t}\n\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/Unsubscribe.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"Unsubscribe\")]\n\tpublic sealed class UnsubscribeRequest : IRequestData<SubscribeResponse>\n\t{\n\t\t[PluginComment(\"Id of subscription\")]\n\t\tpublic Guid SubscriptionId;\n\t}\n\n\t[PayloadTypeName(\"Unsubscribe\")]\n\tpublic sealed class UnsubscribeResponse : IResponseData\n\t{\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Core/Welcome.cs",
    "content": "using Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.Daemon\n{\n\t[PayloadTypeName(\"Welcome\")]\n\tpublic sealed class Welcome : IEventData\n\t{\n\t\t[PluginComment(\"A friendly message.\")]\n\t\tpublic string Message;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/DaemonKey.cs",
    "content": "using System;\nusing System.Diagnostics.Contracts;\nusing System.Globalization;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic class DaemonKey : IEquatable<DaemonKey>\n\t{\n\t\tpublic bool Equals(DaemonKey other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn Key.Equals(other.Key);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\tif (obj.GetType() != this.GetType()) return false;\n\t\t\treturn Equals((DaemonKey) obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Key.GetHashCode();\n\t\t}\n\n\t\tpublic static bool operator ==(DaemonKey left, DaemonKey right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(DaemonKey left, DaemonKey right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic readonly string Key;\n\n\t\tpublic DaemonKey(string key)\n\t\t{\n\t\t\tKey = key;\n\t\t}\n\n\t\tpublic string Serialize()\n\t\t{\n\t\t\treturn Key;\n\t\t}\n\n\t\tpublic static DaemonKey Deserialize(string data)\n\t\t{\n\t\t\treturn new DaemonKey(data);\n\t\t}\n\n\t\t[Pure]\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Key.ToString(CultureInfo.InvariantCulture);\n\t\t}\n\n\t\tpublic static DaemonKey GetDaemonKey()\n\t\t{\n\t\t\t// We have it here until, we have optimized fuse loading.\n\t\t\treturn new DaemonKey(Environment.UserName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/DaemonSpawner.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Net.Sockets;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IPC;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class DaemonSpawner\n\t{\n\t\t/// <exception cref=\"FailedToSpawnDaemon\" />\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\tpublic static Task<IMessagingService> ConnectOrSpawnAsync(this IFuseLauncher fuseLauncher)\n\t\t{\n\t\t\treturn Task.Run(() => fuseLauncher.ConnectOrSpawn());\n\t\t}\n\n\t\t/// <exception cref=\"FailedToSpawnDaemon\" />\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\tpublic static IMessagingService ConnectOrSpawn(this IFuseLauncher fuseLauncher)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn fuseLauncher.Connect();\n\t\t\t}\n\t\t\tcatch (FailedToConnectToDaemon)\n\t\t\t{\n\t\t\t\treturn fuseLauncher.ConnectForSure();\n\t\t\t}\n\t\t}\n\n\t\tstatic Optional<bool> IsPortOpen(int port)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn NetworkHelper.IsPortOpen(port);\n\t\t\t}\n\t\t\tcatch (FailedToLoadTcpTable e)\n\t\t\t{\n\t\t\t\tReportFactory.FallbackReport.Exception(\"Failed to load TCP table\", e);\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"FailedToSpawnDaemon\" />\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\tstatic IMessagingService ConnectForSure(this IFuseLauncher fuseLauncher)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tSpawnDaemon(fuseLauncher);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToSpawnDaemon(e);\n\t\t\t}\n\n\t\t\treturn fuseLauncher.Connect();\n\t\t}\n\n\t\tstatic void SpawnDaemon(IFuseLauncher fuseLauncher)\n\t\t{\n\t\t\tif (PlatformDetection.IsMac)\n\t\t\t{\n\t\t\t\t// Use shell-execute to start the daemon process.\n\t\t\t\tfuseLauncher.StartFuse(\"daemon\", new string[0], false);\n\n\t\t\t\t// Give daemon some time to start.\n\t\t\t\tThread.Sleep(2000);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// TODO: probably inspect the error more\n\t\t\t\tvar server = fuseLauncher.StartFuse(\"daemon\", \"-b\");\n\t\t\t\tserver.WaitForExit();\n\t\t\t\tif (server.ExitCode != 0)\n\t\t\t\t\tthrow new FailedToSpawnDaemon(server.ExitCode);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Task<IMessagingService> ConnectAsync(this IFuseLauncher fuseLauncher)\n\t\t{\n\t\t\treturn Task.Run(() => fuseLauncher.Connect());\n\t\t}\n\n\t\t/// <exception cref=\"FailedToConnectToDaemon\" />\n\t\tpublic static IMessagingService Connect(this IFuseLauncher fuseLauncher)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar tcpClient = new TcpClient(\"127.0.0.1\", 12122);\n\t\t\t\tvar client = new LocalSocketClient(tcpClient);\n\t\t\t\tclient.StartRead();\n\n\t\t\t\treturn new Client(\n\t\t\t\t\tclient,\n\t\t\t\t\tnew Serializer());\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToConnectToDaemon(e);\n\t\t\t}\n\t\t}\n\n\t\tpublic static DaemonKey GetDaemonKey(this IFuseLauncher fuseLauncher)\n\t\t{\n\t\t\t//var p = _fuseLauncher.Start(\"daemon\", new []{ \"--get-key\" });\n\n\t\t\t// Temporary workaround for slow startup.\n\t\t\treturn DaemonKey.GetDaemonKey();\n\t\t}\n\t}\n\n\tpublic abstract class DaemonException : Exception\n\t{\n\t\tprotected DaemonException(string message, Exception innerException)\n\t\t\t: base(message, innerException)\n\t\t{ }\n\n\t\tprotected DaemonException(string message)\n\t\t\t: base(message)\n\t\t{ }\n\t}\n\n\tpublic class FailedToConnectToDaemon : DaemonException\n\t{\n\t\tpublic FailedToConnectToDaemon(Exception innerException)\n\t\t\t: base(\"Failed to connect to daemon: \" + innerException.Message, innerException)\n\t\t{ }\n\t}\n\n\tpublic class FailedToSpawnDaemon : DaemonException\n\t{\n\t\tpublic FailedToSpawnDaemon(Exception innerException)\n\t\t\t: base(\"Failed to start daemon: \" + innerException.Message, innerException)\n\t\t{ }\n\n\t\tpublic FailedToSpawnDaemon(int exitCode)\n\t\t\t: base(\"Daemon exited with code \" + exitCode)\n\t\t{ }\n\t}\n\n\tpublic class FailedToGreetDaemon : DaemonException\n\t{\n\t\tpublic FailedToGreetDaemon(Exception innerException)\n\t\t\t: base(\"Daemon handshake failed: \" + innerException.Message, innerException)\n\t\t{ }\n\n\t\tpublic FailedToGreetDaemon(string message)\n\t\t\t: base(message)\n\t\t{ }\n\t}\n\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Event.cs",
    "content": "﻿using Newtonsoft.Json;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic sealed class Event<T> : IEventMessage<T> where T : IEventData\n\t{\n\t\t[JsonIgnore]\n\t\tpublic string MessageType { get { return \"Event\"; } }\n\n\t\tpublic string Name { get; private set; }\n\t\tpublic T Data { get; private set; }\n\n\t\t// SHOULD ONLY BE USED BY THE DAEMON\n\t\tpublic int SubscriptionId { get; private set; }\n\n\t\t[JsonConstructor]\n\t\tpublic Event(string name, T data, int subscriptionId = -1)\n\t\t{\n\t\t\tName = name;\n\t\t\tData = data;\n\t\t\tSubscriptionId = subscriptionId;\n\t\t}\n\t}\n\n\tpublic static class Event\n\t{\n\t\tpublic static Event<T> Create<T>(T data) where T : IEventData\n\t\t{\n\t\t\treturn new Event<T>(data.GetPayloadType(), data);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/IMessage.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Newtonsoft.Json;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic interface IEventMessage<out T> : IMessage where T : IEventData\n\t{\n\t\tstring Name { get; }\n\t\tT Data { get; }\n\t\tint SubscriptionId { get; }\n\t}\n\n\tpublic interface IRequestMessage<out T> : IMessage where T : IRequestData\n\t{\n\t\tint Id { get; }\n\t\tstring Name { get; }\n\t\tT Arguments { get; }\n\t}\n\n\tpublic interface IResponseMessage<out T> : IMessage where T : IResponseData\n\t{\n\t\tint Id { get; }\n\t\tStatus Status { get; }\n\t\tList<Error> Errors { get; }\n\t\tT Result { get; }\n\t}\n\n/*\tpublic interface IMessage<out T> : IMessage where T : IMessagePayload\n\t{\n\t\tstring Type { get; }\n\t\tT Data { get; }\n\t}*/\n\n\tpublic interface IMessagePayload\n\t{\n\t}\n\n\tpublic interface IEventData : IMessagePayload\n\t{\n\t}\n\n\tpublic interface IRequestData<out TResponse> : IRequestData\n\t{\n\t}\n\n\tpublic interface IRequestData : IMessagePayload\n\t{\n\t}\n\n\tpublic interface IResponseData : IMessagePayload\n\t{\n\t}\n\n\tpublic interface IMessage\n\t{\n\t\t[JsonIgnore]\n\t\tstring MessageType { get; }\n\t}\n\n\t[AttributeUsage(AttributeTargets.Class, Inherited = false)]\n\tpublic class PayloadTypeNameAttribute : Attribute\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic PayloadTypeNameAttribute(string name)\n\t\t{\n\t\t\tName = name;\n\t\t}\n\t}\n\n\tpublic static class PayloadMessageExtensions\n\t{\n\t\tpublic static string GetPayloadType<T>(this T type) where T : IMessagePayload\n\t\t{\n\t\t\tvar attrib = (PayloadTypeNameAttribute)Attribute.GetCustomAttribute(type.GetType(), typeof(PayloadTypeNameAttribute));\n\t\t\tif(attrib == null)\n\t\t\t\tthrow new InvalidOperationException(\"Expected message data to have PayloadTypeNameAttribute.\");\n\n\t\t\treturn attrib.Name;\n\t\t}\n\n\t\tpublic static string GetPayloadTypeName(this Type type)\n\t\t{\n\t\t\tvar attrib = (PayloadTypeNameAttribute)Attribute.GetCustomAttribute(type, typeof(PayloadTypeNameAttribute));\n\t\t\tif (attrib == null)\n\t\t\t\tthrow new InvalidOperationException(\"Expected message data to have PayloadTypeNameAttribute.\");\n\n\t\t\treturn attrib.Name;\n\t\t}\n\t}\n\n\t[AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field, Inherited = false)]\n\tpublic class PluginCommentAttribute : Attribute\n\t{\n\t\tpublic readonly string Comment;\n\t\tpublic readonly string Example;\n\t\tpublic readonly bool IsNumber;\n\n\t\tpublic PluginCommentAttribute(string comment, string example=\"\")\n\t\t{\n\t\t\tComment = comment;\n\t\t\tExample = example;\n\t\t\tIsNumber = false;\n\t\t}\n\n\t\tpublic PluginCommentAttribute(string comment, int example)\n\t\t{\n\t\t\tComment = comment;\n\t\t\tExample = example.ToString(CultureInfo.InvariantCulture);\n\t\t\tIsNumber = true;\n\t\t}\n\n\t\tpublic PluginCommentAttribute(string comment, float example)\n\t\t{\n\t\t\tComment = comment;\n\t\t\tExample = example.ToString(CultureInfo.InvariantCulture);\n\t\t\tIsNumber = true;\n\t\t}\n\n\t\tpublic PluginCommentAttribute(string comment, double example)\n\t\t{\n\t\t\tComment = comment;\n\t\t\tExample = example.ToString(CultureInfo.InvariantCulture);\n\t\t\tIsNumber = true;\n\t\t}\n\n\t\tinternal PluginCommentAttribute(string comment, string example, bool isNumber)\n\t\t{\n\t\t\tComment = comment;\n\t\t\tExample = example.ToString(CultureInfo.InvariantCulture);\n\t\t\tIsNumber = isNumber;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/IMessagingService.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic interface IMessagingService : IDisposable\n\t{\n\t\tIObservable<DateTime> ConnectionLost { get; }\n\n\t\tIObservable<T> BroadcastedEvents<T>(bool wantReplay)\n\t\t\twhere T : IEventData;\n\n\t\tvoid Broadcast<T>(T theEvent)\n\t\t\twhere T : IEventData;\n\n\t\tIDisposable ProvideOptionally<TRequest, TResponse>(Func<TRequest, Optional<TResponse>> func)\n\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\twhere TResponse : IResponseData;\n\n\n\t\tIDisposable Provide<TRequest, TResponse>(Func<TRequest, TResponse> func)\n\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\twhere TResponse : IResponseData;\n\n\t\tTask<TResponse> Request<TResponse>(IRequestData<TResponse> request)\n\t\t\twhere TResponse : IResponseData;\n\t}\n\n\tpublic interface IRequestSender\n\t{\n\t\t/// <exception cref=\"RequestFailed\" />\n\t\tTask<TResponse> Send<TResponse>(IRequestData<TResponse> request)\n\t\t\twhere TResponse : IResponseData;\n\t}\n\n\tpublic interface IRequestReceiver\n\t{\n\t\tIDisposable SubscribeToRequest<T, TResult>(Func<T, Optional<TResult>> transform)\n\t\t\twhere T : IRequestData<TResult>\n\t\t\twhere TResult : IResponseData;\n\n\t\t/*IDisposable SubscribeToRequest<T, TResult>(Func<T, IObserver<Error>, TResult> transform)\n\t\t\twhere T : IRequestData<TResult>\n\t\t\twhere TResult : IResponseData;*/\n\t}\n\n\tpublic class RequestReceiver : IRequestReceiver\n\t{\n\t\treadonly IReport _report;\n\t\treadonly IObservable<IRequestMessage<UnresolvedMessagePayload>> _requests;\n\t\treadonly IObserver<IResponseMessage<IResponseData>> _responses;\n\n\t\tpublic RequestReceiver(\n\t\t\tIReport report,\n\t\t\tIObservable<IRequestMessage<UnresolvedMessagePayload>> requests,\n\t\t\tIObserver<IResponseMessage<IResponseData>> responses)\n\t\t{\n\t\t\t_report = report;\n\t\t\t_requests = requests;\n\t\t\t_responses = responses;\n\t\t}\n\n\t\tpublic IDisposable SubscribeToRequest<T, TResult>(Func<T, Optional<TResult>> transform)\n\t\t\twhere T : IRequestData<TResult>\n\t\t\twhere TResult : IResponseData\n\t\t{\n\t\t\treturn _requests\n\t\t\t\t.Deserialize<T>(_report)\n\t\t\t\t// TODO: This is deadlock-prone!\n\t\t\t\t// I would have done something like .ObserveOn(TaskPool) to make sure that requests are -not- all handled\n\t\t\t\t// on the same thread, as this is deadlock-prone when a request handler sends a request that is handled\n\t\t\t\t// by the same client. However, we then need to go over all handlers to make sure that they are thread-safe.\n\t\t\t\t.Subscribe(\n\t\t\t\t\tr =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar request = (IRequestMessage<IRequestData>)r;\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar res = transform(r.Arguments);\n\t\t\t\t\t\t\tres.MatchWith(\n\t\t\t\t\t\t\t\tsome: d => _responses.OnNext(Response.CreateSuccess(request, (IResponseData)d)),\n\t\t\t\t\t\t\t\tnone: () => _responses.OnNext(Response.CreateUnhandled<IResponseData>(request, null, null)));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_responses.OnNext(Response.Create(\n\t\t\t\t\t\t\t\trequest,\n\t\t\t\t\t\t\t\tUnboxException(e).Select(exp => exp.ToError()),\n\t\t\t\t\t\t\t\t(IResponseData)null));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\n\t\tstatic IEnumerable<Exception> UnboxException(Exception e)\n\t\t{\n\t\t\tvar exceptions = new List<Exception>();\n\n\t\t\tif (e is AggregateException)\n\t\t\t{\n\t\t\t\tvar aggregateException = (AggregateException) e;\n\t\t\t\tforeach (var exeption in aggregateException.InnerExceptions)\n\t\t\t\t\texceptions.AddRange(UnboxException(exeption));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\texceptions.Add(e);\n\t\t\t}\n\n\t\t\treturn exceptions;\n\t\t}\n\t}\n\n\tstatic class ExceptionToErrorExtensions\n\t{\n\t\tpublic static Error ToError(this Exception e, ErrorCode errorCode = ErrorCode.Unknown)\n\t\t{\n\t\t\tif(e is FuseRequestErrorException)\n\t\t\t\treturn ((FuseRequestErrorException)e).Error;\n\t\t\telse\n\t\t\t\treturn new Error(errorCode, e.Message);\n\t\t}\n\t}\n\n\tpublic class FuseRequestErrorException : Exception\n\t{\n\t\tpublic readonly Error Error;\n\t\tpublic FuseRequestErrorException(ErrorCode errorCode, string message) : base(message)\n\t\t{\n\t\t\tError = new Error(errorCode, message);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Error.ToString();\n\t\t}\n\t}\n\n\tpublic class RequestFailed : Exception\n\t{\n\t\tpublic readonly ImmutableList<Error> Errors;\n\n\t\tpublic RequestFailed(IEnumerable<Error> errors)\n\t\t\t: base(\"Request failed: \" + errors.Select(e => e.ToString()).Join(\"\\n\"))\n\t\t{\n\t\t\tErrors = errors.ToImmutableList();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/LocalSocketClient.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Net.Sockets;\nusing System.Reactive.Subjects;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tclass ClientInfo\n\t{\n\t\tpublic readonly TcpClient Socket;\n\t\tpublic readonly NetworkStream Stream;\n\t\tpublic const int BufferSize = 4096;\n\t\tpublic byte[] Buffer = new byte[BufferSize];\n\t\tpublic List<byte> TempCache = new List<byte>();\n\n\t\tpublic ClientInfo(TcpClient socket)\n\t\t{\n\t\t\tSocket = socket;\n\t\t\tStream = socket.GetStream();\n\t\t}\n\t}\n\n\tpublic class Message\n\t{\n\t\tpublic readonly string MessageType;\n\t\tpublic readonly string Payload;\n\n\t\tpublic Message(string messageType, string payload)\n\t\t{\n\t\t\tMessageType = messageType;\n\t\t\tPayload = payload;\n\t\t}\n\t}\n\n\tpublic interface IMessageConnection : IDisposable\n\t{\n\t\tIObservable<Message> IncomingMessages { get; }\n\t\tIObserver<Message> OutgoingMessages { get; }\n\n\t\tIObservable<DateTime> Disconnected { get; }\n\t\tvoid StartRead();\n\t\tvoid Close();\n\t}\n\n\tpublic class LocalSocketClient : IMessageConnection\n\t{\n\t\treadonly Subject<Message> _incomingMessages = new Subject<Message>();\n\t\treadonly Subject<Message> _outgoingMessages = new Subject<Message>();\n\t\treadonly ConcurrentQueue<Message> _messageQueue = new ConcurrentQueue<Message>();\n\t\treadonly AutoResetEvent _messageIncomming = new AutoResetEvent(false);\n\t\treadonly object _closeMutex = new object();\n\n\t\tbool _isClosed = false;\n\t\treadonly IDisposable _outgoingMessagesSub;\n\n\t\tpublic IObservable<Message> IncomingMessages\n\t\t{\n\t\t\tget { return _incomingMessages; }\n\t\t}\n\n\t\tpublic IObserver<Message> OutgoingMessages\n\t\t{\n\t\t\tget { return _outgoingMessages; }\n\t\t}\n\n\t\treadonly ReplaySubject<DateTime> _disconnected = new ReplaySubject<DateTime>(1);\n\t\tpublic IObservable<DateTime> Disconnected { get { return _disconnected; } }\n\n\t\treadonly ClientInfo _clientInfo;\n\t\treadonly Action<LocalSocketClient> _close;\n\n\t\tpublic LocalSocketClient(TcpClient client)\n\t\t\t: this(client, _ => { })\n\t\t{ }\n\n\t\tinternal LocalSocketClient(TcpClient client, Action<LocalSocketClient> close)\n\t\t{\n\t\t\t_clientInfo = new ClientInfo(client);\n\t\t\t_close = close;\n\t\t\t_outgoingMessagesSub = _outgoingMessages.Subscribe(EnqueueMessage);\n\t\t\tvar pollAndSendThread = new Thread(PollAndSendThread) { IsBackground = true, Name = \"PollAndSend local socket client\" };\n\t\t\tpollAndSendThread.Start();\n\t\t}\n\n\t\tpublic void EnqueueMessage(Message message)\n\t\t{\n\t\t\tvar handler = _clientInfo != null ? _clientInfo.Socket : null;\n\t\t\tif (handler == null || !handler.Connected)\n\t\t\t\treturn;\n\n\t\t\t_messageQueue.Enqueue(message);\n\t\t\t_messageIncomming.Set();\n\t\t}\n\n\t\tvoid PollAndSendThread()\n\t\t{\n\t\t\twhile (!_isClosed)\n\t\t\t{\n\t\t\t\t_messageIncomming.WaitOne();\n\n\t\t\t\tMessage message;\n\t\t\t\twhile (_messageQueue.TryDequeue(out message))\n\t\t\t\t{\n\t\t\t\t\tReportFactory.FallbackReport.Trace(\"Sent message[\" + message.MessageType + \"]: \" + message.Payload);\n\t\t\t\t\tvar payloadInBytes = Encoding.UTF8.GetBytes(message.Payload);\n\t\t\t\t\tvar messageTypeInBytes = Encoding.UTF8.GetBytes(message.MessageType + \"\\n\");\n\n\t\t\t\t\tvar lengthInText = payloadInBytes.Length.ToString(CultureInfo.InvariantCulture);\n\t\t\t\t\tvar lengthInBytes = Encoding.UTF8.GetBytes(lengthInText + \"\\n\");\n\t\t\t\t\tvar finalBytes = messageTypeInBytes.Concat(lengthInBytes.Concat(payloadInBytes)).ToArray();\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t_clientInfo.Stream.Write(finalBytes, 0, finalBytes.Length);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t\tClose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Close()\n\t\t{\n\t\t\tlock (_closeMutex)\n\t\t\t{\n\t\t\t\tif (_isClosed)\n\t\t\t\t\treturn;\n\n\t\t\t\t_isClosed = true;\n\t\t\t}\n\n\t\t\t_outgoingMessagesSub.Dispose();\n\t\t\t_messageIncomming.Set();\n\t\t\tTask.Run(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\twhile (!_messageQueue.IsEmpty)\n\t\t\t\t\t{\n\t\t\t\t\t\tThread.Sleep(1);\n\t\t\t\t\t}\n\t\t\t\t}).Wait(TimeSpan.FromSeconds(5));\n\n\n\t\t\t_incomingMessages.OnCompleted();\n\t\t\t_incomingMessages.Dispose();\n\n\t\t\tvar isConnected = _clientInfo.Socket.Connected;\n\t\t\tif (isConnected)\n\t\t\t\t_clientInfo.Socket.Close();\n\n\t\t\t_disconnected.OnNext(DateTime.Now);\n\t\t\t_disconnected.Dispose();\n\n\t\t\t_close(this);\n\t\t}\n\n\t\tpublic void StartRead()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_clientInfo.Stream.BeginRead(_clientInfo.Buffer, 0, ClientInfo.BufferSize, Read, _clientInfo);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tClose();\n\t\t\t}\n\t\t}\n\n\t\tvoid Read(IAsyncResult ar)\n\t\t{\n\t\t\tvar clientInfo = (ClientInfo)ar.AsyncState;\n\t\t\tvar handler = clientInfo.Socket;\n\n\t\t\tif (!handler.Connected)\n\t\t\t\treturn;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar bytesRead = clientInfo.Stream.EndRead(ar);\n\t\t\t\tif (bytesRead > 0)\n\t\t\t\t{\n\t\t\t\t\tclientInfo.TempCache.AddRange(clientInfo.Buffer.Take(bytesRead));\n\t\t\t\t\tParseChunks(clientInfo);\n\t\t\t\t\tStartRead();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tClose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tClose();\n\t\t\t}\n\t\t}\n\n\t\tvoid ParseChunks(ClientInfo clientInfo)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint messageSize;\n\t\t\t\tstring messageType;\n\n\t\t\t\tvar messageTypeLength = ParseMessageType(clientInfo.TempCache, 0, out messageType) + 1;\n\t\t\t\tvar messageSizeLength = ParseMessageSize(clientInfo.TempCache, messageTypeLength, out messageSize) + 1;\n\n\t\t\t\tif (messageSizeLength > 0 && clientInfo.TempCache.Count >= messageTypeLength + messageSizeLength + messageSize)\n\t\t\t\t{\n\t\t\t\t\tclientInfo.TempCache.RemoveRange(0, messageTypeLength + messageSizeLength);\n\t\t\t\t\tvar message = Encoding.UTF8.GetString(clientInfo.TempCache.Take(messageSize).ToArray());\n\t\t\t\t\tclientInfo.TempCache.RemoveRange(0, messageSize);\n\n\t\t\t\t\tReportFactory.FallbackReport.Trace(\"Received message[\" + messageType + \"]: \" + message);\n\t\t\t\t\t_incomingMessages.OnNext(new Message(messageType, message));\n\n\t\t\t\t\tif (clientInfo.TempCache.Count > 0)\n\t\t\t\t\t\tParseChunks(clientInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tclientInfo.TempCache.Clear();\n\t\t\t}\n\t\t}\n\n\t\tint ParseMessageType(IReadOnlyList<byte> data, int offset, out string messageType)\n\t\t{\n\t\t\tmessageType = \"\";\n\t\t\tvar firstNewLine = data.Skip(offset).IndexOf((byte)'\\n');\n\t\t\tif(firstNewLine > 0)\n\t\t\t\tmessageType = Encoding.UTF8.GetString(data.Take(firstNewLine).ToArray());\n\n\t\t\treturn firstNewLine - offset;\n\t\t}\n\n\t\tint ParseMessageSize(IReadOnlyList<byte> data, int offset, out int messageSize)\n\t\t{\n\t\t\tfor (var i = offset; i < data.Count; ++i)\n\t\t\t{\n\t\t\t\tif (data[i] != '\\n') continue;\n\n\t\t\t\tif (!int.TryParse(Encoding.UTF8.GetString(data.Skip(offset).Take(i - offset).ToArray()), out messageSize))\n\t\t\t\t\tthrow new InvalidOperationException(\"This should never happen. unless the client sends invalid data.\");\n\n\t\t\t\treturn i - offset;\n\t\t\t}\n\n\t\t\tmessageSize = 0;\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tClose();\n\t\t}\n\t}\n\n\tstatic class ReportExtensions\n\t{\n\t\tpublic static void Trace(this IReport report, object o, ReportTo destination = ReportTo.Log)\n\t\t{\n#if TRACE_NETWORK\n\t\t\treport.Info(o, destination);\n#endif\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/LocalSocketServer.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Reactive.Subjects;\nusing System.Threading;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic class LocalSocketServer : IDisposable\n\t{\n\t\treadonly IReport _report;\n\t\treadonly Thread _listenerThread;\n\t\treadonly BehaviorSubject<ImmutableList<LocalSocketClient>> _clients =\n\t\t\tnew BehaviorSubject<ImmutableList<LocalSocketClient>>(ImmutableList<LocalSocketClient>.Empty);\n\t\treadonly AutoResetEvent _hasStoppedListening = new AutoResetEvent(false);\n\n\t\tTcpListener _listener;\n\t\tvolatile bool _continueListening;\n\t\tvolatile bool _isClosing;\n\t\treadonly object _closeMutex = new object();\n\n\t\tpublic readonly Subject<LocalSocketClient> ClientConnected = new Subject<LocalSocketClient>();\n\t\tpublic readonly Subject<LocalSocketClient> ClientDisconnected = new Subject<LocalSocketClient>();\n\n\t\tpublic LocalSocketServer(IReport report)\n\t\t{\n\t\t\t_report = report;\n\t\t\t_listenerThread = new Thread(Listen) { Name = \"Local socket server\", IsBackground = true };\n\t\t}\n\n\t\tpublic void Host(int port)\n\t\t{\n\t\t\tvar address = IPAddress.Loopback;\n\t\t\tvar endpoint = new IPEndPoint(address, port);\n\t\t\t_listener = new TcpListener(endpoint);\n\n\t\t\tif (Environment.OSVersion.Platform != PlatformID.Unix &&\n\t\t\t    Environment.OSVersion.Platform != PlatformID.MacOSX)\n\t\t\t{\n\t\t\t\t// Disable inheritance of server-socket, so child processes (like ADB) won't keep\n\t\t\t\t// a valid handle to that socket open until the child-process itself dies.\n\t\t\t\t//\n\t\t\t\t// This is needed due to the unfortunate combination of Process.Start enabling\n\t\t\t\t// handle-inheritance without providing an escape-hatch, and BCL deciding to\n\t\t\t\t// create all handles with inheritance enabled, again without any opt-out option.\n\t\t\t\t//\n\t\t\t\t// If this fails, there's little useful we can do.\n\n\t\t\t\tif (SocketWin32.SetHandleInformation(_listener.Server.Handle, SocketWin32.HANDLE_FLAGS.INHERIT, SocketWin32.HANDLE_FLAGS.None) == false)\n\t\t\t\t\tDebug.Write(\"Failed to disable handle-inheritance for socket!\");\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_listener.Start(20);\n\n\t\t\t\t_continueListening = true;\n\t\t\t\t_listenerThread.Start(_listener);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tClose();\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\tvoid Listen(object param)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar listener = (TcpListener) param;\n\t\t\t\twhile (_continueListening)\n\t\t\t\t{\n\t\t\t\t\tif (!listener.Pending())\n\t\t\t\t\t{\n\t\t\t\t\t\tThread.Sleep(50);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar client = new LocalSocketClient(listener.AcceptTcpClient(), CloseClient);\n\n\t\t\t\t\t\t_clients.OnNext(_clients.Value.Add(client));\n\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tClientConnected.OnNext(client);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO Log\n\t\t\t\t\t\t\t_report.Exception(\"Failed to handle client connection\", e);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InvalidOperationException e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Log\n\t\t\t\t\t\t_report.Exception(\"\", e);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (SocketException e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Log\n\t\t\t\t\t\t_report.Exception(\"\", e);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t// TODO: Log\n\t\t\t\t_report.Exception(\"\", e);\n\t\t\t\tClose();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\t_hasStoppedListening.Set();\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tClose();\n\t\t}\n\n\t\tvoid Close()\n\t\t{\n\t\t\tlock (_closeMutex)\n\t\t\t{\n\t\t\t\tif (_isClosing)\n\t\t\t\t\treturn;\n\n\t\t\t\t_isClosing = true;\n\t\t\t}\n\n\t\t\t_continueListening = false;\n\t\t\t_listener.Stop();\n\n\t\t\tvar clients = _clients.Value.ToArray();\n\t\t\tforeach (var clientInfo in clients)\n\t\t\t{\n\t\t\t\tclientInfo.Close();\n\t\t\t}\n\n\t\t\tClientConnected.Dispose();\n\t\t\tClientDisconnected.Dispose();\n\t\t\t_hasStoppedListening.WaitOne(500);\n\t\t}\n\n\t\tvoid CloseClient(LocalSocketClient client)\n\t\t{\n\t\t\tclient.Close();\n\t\t\t_clients.Update(l => l.Remove(client));\n\n\t\t\tClientDisconnected.OnNext(client);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/MessageManager.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic static class SerializerExtensions\n\t{\n\t\tpublic static IObserver<IMessage> Serialized(this IObserver<Message> messageJson, ISerializer serializer)\n\t\t{\n\t\t\treturn Observer.Create<IMessage>(s => messageJson.OnNext(serializer.Serialize(s)));\n\t\t}\n\n\t\tpublic static IObservable<IMessage> TryDeserialize(this IObservable<Message> messageJson, ISerializer serializer, IReport report)\n\t\t{\n\t\t\treturn messageJson.Select(json => serializer.TryDeserialize(json, report)).NotNone();\n\t\t}\n\n\t\tstatic Optional<IMessage> TryDeserialize(this ISerializer serializer, Message json, IReport report)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Optional.Some(serializer.Deserialize(json));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\treport.Error(\"Failed to deserialize \" + json.MessageType + \": \" + e.Message);\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic static IObservable<IEventMessage<TRet>> Deserialize<TRet>(this IObservable<IEventMessage<UnresolvedMessagePayload>> message, IReport report)\n\t\t\twhere TRet : IEventData\n\t\t{\n\t\t\treturn message\n\t\t\t\t.Where(m => m.Name == typeof (TRet).GetPayloadTypeName())\n\t\t\t\t.Select(m => m.Data.Deserialize<TRet>(report)\n\t\t\t\t\t.Select(d => new Event<TRet>(m.Name, d, m.SubscriptionId)))\n\t\t\t\t.NotNone();\n\t\t}\n\n\t\tpublic static IObservable<IRequestMessage<TRet>> Deserialize<TRet>(\n\t\t\tthis IObservable<IRequestMessage<UnresolvedMessagePayload>> message, IReport report)\n\t\t\twhere TRet : IRequestData\n\t\t{\n\t\t\treturn message\n\t\t\t\t.Where(m => m.Name == typeof(TRet).GetPayloadTypeName())\n\t\t\t\t.Select(m => m.Arguments.Deserialize<TRet>(report)\n\t\t\t\t\t.Select(d => new Request<TRet>(m.Id, m.Name, d)))\n\t\t\t\t.NotNone();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fuse/common/Protocol/NullObjects.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic class NullMessagingService : IMessagingService\n\t{\n\t\tpublic void Dispose() {}\n\n\t\tpublic IObservable<DateTime> ConnectionLost\n\t\t{\n\t\t\tget { return null; }\n\t\t}\n\n\t\tpublic IObservable<T> BroadcastedEvents<T>(bool wantReplay) where T : IEventData\n\t\t{\n\t\t\treturn Observable.Never<T>();\n\t\t}\n\n\t\tpublic void Broadcast<T>(T theEvent) where T : IEventData\n\t\t{\n\t\t}\n\n\t\tpublic IDisposable ProvideOptionally<TRequest, TResponse>(Func<TRequest, Optional<TResponse>> func) where TRequest : IRequestData<TResponse> where TResponse : IResponseData\n\t\t{\n\t\t\treturn Disposable.Create(() => {});\n\t\t}\n\n\t\tpublic IDisposable Provide<TRequest, TResponse>(Func<TRequest, TResponse> func)\n\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\twhere TResponse : IResponseData\n\t\t{\n\t\t\treturn Disposable.Create(() => { });\n\t\t}\n\n\t\tpublic Task<TResponse> Request<TResponse>(IRequestData<TResponse> request) where TResponse : IResponseData\n\t\t{\n\t\t\t//throw new RequestFailed(new Error[0]);\n\t\t\treturn new Task<TResponse>(() =>\n\t\t\t{\n\t\t\t\tthrow new RequestFailed( new Error[0]);\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/PayloadParserContext.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic interface IPayloadParserContext\n\t{\n\t\tOptional<Type> GetCommandType(string name, Type expectedDataInterface);\n\t}\n\n\tpublic class PayloadParserContext : IPayloadParserContext\n\t{\n\t\treadonly Dictionary<Type, string> _payloadTypes = new Dictionary<Type, string>();\n\n\t\tpublic PayloadParserContext(params Type []payloadTypes)\n\t\t{\n\t\t\tAddValidPayloadTypes(payloadTypes);\n\t\t}\n\n\t\tvoid AddValidPayloadTypes(IEnumerable<Type> payloadTypes)\n\t\t{\n\t\t\tforeach (var payloadType in payloadTypes)\n\t\t\t{\n\t\t\t\t_payloadTypes.Add(payloadType, payloadType.GetPayloadTypeName());\n\t\t\t}\n\t\t}\n\n\t\tpublic Optional<Type> GetCommandType(string name, Type expectedDataInterface)\n\t\t{\n\t\t\tforeach (var payloadType in _payloadTypes)\n\t\t\t{\n\t\t\t\tif(!payloadType.Key.GetInterfaces().Contains(expectedDataInterface))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif(EqualsTypeWithName(payloadType.Value, name))\n\t\t\t\t\treturn payloadType.Key;\n\t\t\t}\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tstatic bool EqualsTypeWithName(string typeName, string name)\n\t\t{\n\t\t\treturn typeName == name;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Preview/ExceptionEvent.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Protocol.Messages\n{\n\t[PayloadTypeName(\"Fuse.ExceptionEvent\")]\n\tpublic class ExceptionEvent : IEventData\n\t{\n\t\tpublic string DeviceId;\n\t\tpublic string DeviceName;\n\t\tpublic string ProjectId;\n\t\tpublic string Type;\n\t\tpublic string Message;\n\t\tpublic string StackTrace;\n\t\tpublic DateTime Timestamp;\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/Preview/LogEvent.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Protocol.Messages\n{\n\t// Be careful changing the names, it means the API changes!\n\tpublic enum ConsoleType\n\t{\n\t\tDebugLog,\n\t\tBuildLog\n\t}\n\n\t[PayloadTypeName(\"Fuse.LogEvent\")]\n\tpublic class LogEvent : IEventData\n\t{\n\t\tpublic string DeviceId;\n\t\tpublic string DeviceName;\n\t\tpublic string ProjectId;\n\t\tpublic string Message;\n\t\tpublic DateTime Timestamp;\n\n\t\tpublic ConsoleType ConsoleType;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Preview/ProjectIdComputer.cs",
    "content": "﻿using System;\nusing System.Security.Cryptography;\nusing System.Text;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Protocol.Preview\n{\n\tpublic static class ProjectIdComputer\n\t{\n\t\tpublic static Guid IdFor(IAbsolutePath projectPath)\n\t\t{\n\t\t\tusing (var md5Hash = MD5.Create())\n\t\t\t{\n\t\t\t\tvar data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(projectPath.NativePath));\n\t\t\t\tvar sBuilder = new StringBuilder();\n\t\t\t\tforeach (var t in data)\n\t\t\t\t{\n\t\t\t\t\tsBuilder.Append(t.ToString(\"x2\"));\n\t\t\t\t}\n\t\t\t\treturn new Guid(sBuilder.ToString());\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/Preview/RegisterClientEvent.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol.Messages\n{\n\t[PayloadTypeName(\"Fuse.RegisterClient\")]\n\tpublic class RegisterClientEvent : IEventData\n\t{\n\t\tpublic string DeviceId;\n\t\tpublic string DeviceName;\n\t\tpublic string ProjectId;\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/Preview/TextPosition.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol.Messages\n{\n\tpublic class TextPosition\n\t{\n\t\t[PluginComment(\"Line is expected to be 1 indexed.\")]\n\t\tpublic int Line;\n\n\t\t[PluginComment(\"Character is expected to be 1 indexed.\")]\n\t\tpublic int Character;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Request.cs",
    "content": "﻿using Newtonsoft.Json;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic sealed class Request<T> : IRequestMessage<T> where T : IRequestData\n\t{\n\t\t[JsonIgnore]\n\t\tpublic string MessageType { get { return \"Request\"; } }\n\n\t\tpublic int Id { get; private set; }\n\n\t\tpublic string Name { get; private set; }\n\n\t\tpublic T Arguments { get; private set; }\n\n\t\t[JsonConstructor]\n\t\tpublic Request(int id, string name, T arguments)\n\t\t{\n\t\t\tId = id;\n\t\t\tName = name;\n\t\t\tArguments = arguments;\n\t\t}\n\t}\n\n\tpublic static class Request\n\t{\n\t\tpublic static Request<T> Create<T>(int id, T arguments) where T : IRequestData\n\t\t{\n\t\t\treturn new Request<T>(id, arguments.GetPayloadType(), arguments);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/RequestSender.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Reactive.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tinterface IResponseTask\n\t{\n\t\tvoid SetResult(IResponseData response);\n\n\t\tvoid SetException(Exception e);\n\t}\n\n\tclass FailedToDeserializeException : Exception\n\t{\n\t\tpublic FailedToDeserializeException() : base(\"Failed to deserialize the response.\")\n\t\t{\n\t\t}\n\t}\n\n\tclass ResponseTask<TResponseData> : IResponseTask\n\t\twhere TResponseData : IResponseData\n\t{\n\t\treadonly IReport _report;\n\t\treadonly TaskCompletionSource<TResponseData> _tcs;\n\t\tpublic ResponseTask(IReport report, TaskCompletionSource<TResponseData> tcs)\n\t\t{\n\t\t\t_report = report;\n\t\t\t_tcs = tcs;\n\t\t}\n\n\t\tpublic void SetResult(IResponseData response)\n\t\t{\n\t\t\tvar unresolvedMessage = (UnresolvedMessagePayload)response;\n\t\t\tvar deserializedMsg = unresolvedMessage.Deserialize<TResponseData>(_report);\n\t\t\tif(deserializedMsg.HasValue)\n\t\t\t\t_tcs.SetResult(deserializedMsg.Value);\n\t\t\telse\n\t\t\t\tSetException(new FailedToDeserializeException());\n\t\t}\n\n\t\tpublic void SetException(Exception e)\n\t\t{\n\t\t\t_tcs.TrySetException(e);\n\t\t}\n\t}\n\n\tpublic class RequestSender : IDisposable, IRequestSender\n\t{\n\t\treadonly IReport _report;\n\t\treadonly IObserver<IMessage> _output;\n\t\treadonly IDisposable _inputSubscription;\n\n\t\treadonly ConcurrentDictionary<int, IResponseTask> _awaitingTasks = new ConcurrentDictionary<int, IResponseTask>();\n\n\t\tpublic RequestSender(IReport report, IObservable<IMessage> input, IObserver<IMessage> output)\n\t\t{\n\t\t\t_inputSubscription = input.OfType<IResponseMessage<IResponseData>>().Subscribe(OnResponse);\n\t\t\t_report = report;\n\t\t\t_output = output;\n\t\t}\n\n\t\tvoid OnResponse(IResponseMessage<IResponseData> response)\n\t\t{\n\t\t\tIResponseTask tcs;\n\t\t\tif (!_awaitingTasks.TryRemove(response.Id, out tcs))\n\t\t\t\treturn;\n\n\t\t\tif (response.Status == Status.Success)\n\t\t\t\ttcs.SetResult(response.Result);\n\t\t\telse\n\t\t\t\ttcs.SetException(new RequestFailed(response.Errors));\n\t\t}\n\n\t\tpublic Task<TResponse> Send<TResponse>(IRequestData<TResponse> request) where TResponse : IResponseData\n\t\t{\n\t\t\tvar id = NewRequestId();\n\t\t\tvar tcs = new TaskCompletionSource<TResponse>();\n\t\t\t_awaitingTasks[id] = new ResponseTask<TResponse>(_report, tcs);\n\t\t\t_output.OnNext(Request.Create(id, request));\n\t\t\treturn tcs.Task;\n\t\t}\n\n\t\tstatic int _id;\n\t\tint NewRequestId()\n\t\t{\n\t\t\treturn Interlocked.Increment(ref _id);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_inputSubscription.Dispose();\n\t\t}\n\t}\n\n\tpublic static class RequestSenderExtensions\n\t{\n\t\tpublic static Optional<T> TryRequestWithRetry<T>(\n\t\t\tthis IMessagingService sender,\n\t\t\tIRequestData<T> request,\n\t\t\tFunc<int, TimeSpan> tryTimeout = null,\n\t\t\tint? maxTries = null)\n\t\t\twhere T : IResponseData\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn sender.RequestWithRetry(request, tryTimeout, maxTries).GetResultAndUnpackExceptions();\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"AggregateException\"></exception>\n\t\tpublic static async Task<T> RequestWithRetry<T>(\n\t\t\tthis IMessagingService sender,\n\t\t\tIRequestData<T> request,\n\t\t\tFunc<int, TimeSpan> tryTimeout,\n\t\t\tint? maxTries = null)\n\t\t\twhere T : IResponseData\n\t\t{\n\t\t\tvar exceptions = new List<Exception>();\n\t\t\tfor (var i = 0; maxTries.HasValue == false || i < maxTries; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn await sender.Request(request)\n\t\t\t\t\t\t.TimeoutAfter(tryTimeout != null ? tryTimeout(i) : Timeout.InfiniteTimeSpan);\n\t\t\t\t}\n\t\t\t\tcatch (RequestFailed e)\n\t\t\t\t{\n\t\t\t\t\texceptions.Add(e);\n\t\t\t\t\tThread.Sleep(TimeSpan.FromMilliseconds(200));\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\texceptions.Add(e);\n\t\t\t\t\tbreak; // Something not expected happened lets forward this.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new AggregateException(\"Retry count of \" + (maxTries.HasValue ? maxTries.Value.ToString(CultureInfo.InvariantCulture.NumberFormat) : \"infinity\") + \" exceeded\", exceptions);\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/ResetPreviewEvent.cs",
    "content": "﻿namespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"Fuse.ResetPreview\")]\n\tpublic class ResetPreviewEvent : IEventData\n\t{\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/Protocol/Response.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic enum Status\n\t{\n\t\tSuccess,\n\t\tError,\n\t\tUnhandled\n\t}\n\n\tpublic enum ErrorCode\n\t{\n\t\tUnknown = 0,\n\t\tInvalidJson = 1,\n\t\tInvalidData = 2,\n\t\tInvalidOperation = 3,\n\t\tInvalidRequest = 4,\n\t\tLostConnection = 5,\n\t\tWrongDaemonKey = 6,\n\t}\n\n\tpublic sealed class Error\n\t{\n\t\tpublic readonly int Code;\n\t\tpublic readonly string Message;\n\n\t\tpublic Error(ErrorCode errorCode, string message)\n\t\t{\n\t\t\tCode = (int) errorCode;\n\t\t\tMessage = message;\n\t\t}\n\n\t\t[JsonConstructor]\n\t\tError(int code, string message)\n\t\t{\n\t\t\tCode = code;\n\t\t\tMessage = message;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns a string that represents the current object.\n\t\t/// </summary>\n\t\t/// <returns>\n\t\t/// A string that represents the current object.\n\t\t/// </returns>\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"(\" + Code + \")\" + \" - \" + Message;\n\t\t}\n\t}\n\n\tpublic sealed class Response<T> : IResponseMessage<T> where T : IResponseData\n\t{\n\t\t[JsonIgnore]\n\t\tpublic string MessageType { get { return \"Response\"; } }\n\n\t\tpublic int Id { get; private set; }\n\n\t\tpublic Status Status { get; private set; }\n\n\t\tpublic List<Error> Errors{ get; private set; }\n\n\t\tpublic T Result { get; private set; }\n\n\t\t[JsonConstructor]\n\t\tpublic Response(int id, Status status, List<Error> errors, T result)\n\t\t{\n\t\t\tId = id;\n\t\t\tResult = result;\n\t\t\tStatus = status;\n\t\t\tErrors = errors;\n\t\t}\n\t}\n\n\tpublic static class Response\n\t{\n\t\tpublic static Response<T> Create<T>(IRequestMessage<IRequestData> request, IEnumerable<Error> errors, T data) where T : IResponseData\n\t\t{\n\t\t\tvar errorsCopy = errors.ToList();\n\n\t\t\tvar status = Status.Success;\n\t\t\tif (!errorsCopy.IsEmpty())\n\t\t\t\tstatus = Status.Error;\n\n\t\t\treturn new Response<T>(request.Id, status, errorsCopy, data);\n\t\t}\n\n\t\tpublic static Response<T> CreateSuccess<T>(IRequestMessage<IRequestData> request, T data) where T : IResponseData\n\t\t{\n\t\t\treturn new Response<T>(request.Id, Status.Success, null, data);\n\t\t}\n\n\t\tpublic static Response<T> CreateUnhandled<T>(IRequestMessage<IRequestData> request, Error reason, T data) where T : IResponseData\n\t\t{\n\t\t\treturn new Response<T>(request.Id, Status.Unhandled, new List<Error>{ reason }, data);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/SelectionChanged.cs",
    "content": "\nnamespace Outracks.Fuse.Protocol\n{\n\t[PayloadTypeName(\"Fuse.Preview.SelectionChanged\")]\n\tpublic class SelectionChanged : IEventData\n\t{\n\t\t[PluginComment(\"\")]\n\t\tpublic string Path;\n\t\t[PluginComment(\"\")]\n\t\tpublic string Text;\n\t\t[PluginComment(\"\")]\n\t\tpublic Messages.TextPosition CaretPosition;\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/Serializer.cs",
    "content": "﻿using System;\nusing System.Net;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic interface ISerializer\n\t{\n\t\tIMessage Deserialize(Message message);\n\t\tMessage Serialize(IMessage cmd);\n\t}\n\n\tpublic class Serializer : ISerializer\n\t{\n\t\tpublic IMessage Deserialize(Message message)\n\t\t{\n\t\t\tvar parsedResult = JObject.Parse(message.Payload);\n\t\t\tvar messageType = message.MessageType;\n\n\t\t\tvar type = CommandTypeBasedOnName(messageType);\n\n\t\t\tvar instance = (IMessage)parsedResult.ToObject(type, FuseJsonSerializer.CreateDefault());\n\t\t\treturn instance;\n\t\t}\n\n\t\tType CommandTypeBasedOnName(string messageType)\n\t\t{\n\t\t\tswitch (messageType)\n\t\t\t{\n\t\t\t\tcase \"Request\":\n\t\t\t\t\treturn typeof(Request<>).MakeGenericType(typeof(UnresolvedMessagePayload));\n\t\t\t\tcase \"Response\":\n\t\t\t\t\treturn typeof(Response<>).MakeGenericType(typeof(UnresolvedMessagePayload));\n\t\t\t\tcase \"Event\":\n\t\t\t\t\treturn typeof(Event<>).MakeGenericType(typeof(UnresolvedMessagePayload));\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic Message Serialize(IMessage cmd)\n\t\t{\n\t\t\treturn new Message(cmd.MessageType, JsonConvert.SerializeObject(cmd, FuseJsonSerializer.Settings));\n\t\t}\n\t}\n\n\tpublic class UnresolvedMessagePayload : IEventData, IRequestData, IResponseData\n\t{\n\t\tpublic readonly Optional<JObject> Obj;\n\n\t\tpublic UnresolvedMessagePayload(Optional<JObject> obj)\n\t\t{\n\t\t\tObj = obj;\n\t\t}\n\n\t\tpublic Optional<T> Deserialize<T>(IReport report)\n\t\t{\n\t\t\treturn Obj.SelectMany(\n\t\t\t\to =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\treturn o.ToObject<T>(FuseJsonSerializer.CreateDefault());\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\treport.Error(\"Failed to deserialize: \" + e.Message);\n\t\t\t\t\t\treturn Optional.None<T>();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Obj.HasValue ? Obj.Value.ToString() : \"Failed to parse message, or unknown payload type\";\n\t\t}\n\t}\n\n\tpublic static class FuseJsonSerializer\n\t{\n\t\tpublic static readonly JsonSerializerSettings Settings;\n\n\t\tstatic FuseJsonSerializer()\n\t\t{\n\t\t\tSettings = new JsonSerializerSettings();\n\t\t\tSettings.Converters.Add(new StringEnumConverter());\n\t\t\tSettings.Converters.Add(new AbsoluteFilePathConverter());\n\t\t\tSettings.Converters.Add(new IPAddressConverter());\n\t\t\tSettings.Converters.Add(new IPEndPointConverter());\n\t\t\tSettings.Converters.Add(new UnresolvedMessagePayloadConverter());\n\t\t}\n\n\t\tpublic static JsonSerializer CreateDefault()\n\t\t{\n\t\t\treturn JsonSerializer.CreateDefault(Settings);\n\t\t}\n\t}\n\n\tclass AbsoluteFilePathConverter : JsonConverter\n\t{\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof(AbsoluteFilePath);\n\t\t}\n\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tvar ip = (AbsoluteFilePath)value;\n\t\t\twriter.WriteValue(ip.NativePath);\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tvar token = JToken.Load(reader);\n\t\t\treturn AbsoluteFilePath.Parse(token.Value<string>());\n\t\t}\n\t}\n\n\tclass IPAddressConverter : JsonConverter\n\t{\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof(IPAddress);\n\t\t}\n\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tvar ip = (IPAddress) value;\n\t\t\twriter.WriteValue(ip.ToString());\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tvar token = JToken.Load(reader);\n\t\t\treturn IPAddress.Parse(token.Value<string>());\n\t\t}\n\t}\n\n\n\tclass IPEndPointConverter : JsonConverter\n\t{\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof(IPEndPoint);\n\t\t}\n\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tvar ep = (IPEndPoint) value;\n\t\t\twriter.WriteStartObject();\n\t\t\twriter.WritePropertyName(\"Address\");\n\t\t\tserializer.Serialize(writer, ep.Address);\n\t\t\twriter.WritePropertyName(\"Port\");\n\t\t\twriter.WriteValue(ep.Port);\n\t\t\twriter.WriteEndObject();\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tvar jo = JObject.Load(reader);\n\t\t\tvar address = jo[\"Address\"].ToObject<IPAddress>(serializer);\n\t\t\tvar port = jo[\"Port\"].Value<int>();\n\t\t\treturn new IPEndPoint(address, port);\n\t\t}\n\t}\n\n\tclass UnresolvedMessagePayloadConverter : JsonConverter\n\t{\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tvar payload = (UnresolvedMessagePayload)value;\n\t\t\tpayload.Obj.Do(o => o.WriteTo(writer), writer.WriteNull);\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tif (reader.TokenType == JsonToken.Null)\n\t\t\t{\n\t\t\t\treturn new UnresolvedMessagePayload(Optional.None());\n\t\t\t}\n\n\t\t\tvar obj = JObject.Load(reader);\n\t\t\treturn new UnresolvedMessagePayload(obj);\n\t\t}\n\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof(UnresolvedMessagePayload);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/Protocol/SwitchingMessagingService.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse.Protocol\n{\n\tpublic static partial class MessagingService\n\t{\n\t\tpublic static IMessagingService Switch(this IObservable<IMessagingService> source, bool handleDispose = false)\n\t\t{\n\t\t\treturn new SwitchingMessagingService\n\t\t\t{\n\t\t\t\tCurrent = source,\n\t\t\t\tDisposable = handleDispose\n\t\t\t\t\t? source.SubscribeUsing(c => c)\n\t\t\t\t\t: Disposable.Empty,\n\t\t\t};\n\t\t}\n\n\t\tclass SwitchingMessagingService : IMessagingService\n\t\t{\n\t\t\tpublic IObservable<IMessagingService> Current;\n\t\t\tpublic IDisposable Disposable;\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tDisposable.Dispose();\n\t\t\t}\n\n\t\t\tpublic IObservable<DateTime> ConnectionLost\n\t\t\t{\n\t\t\t\tget { return Current.Switch(s => ConnectionLost); }\n\t\t\t}\n\n\t\t\tpublic IObservable<T> BroadcastedEvents<T>(bool wantReplay) where T : IEventData\n\t\t\t{\n\t\t\t\treturn Current.Switch(s => s.BroadcastedEvents<T>(wantReplay));\n\t\t\t}\n\n\t\t\tpublic void Broadcast<T>(T theEvent) where T : IEventData\n\t\t\t{\n\t\t\t\tCurrent.Take(1).Subscribe(s => s.Broadcast(theEvent));\n\t\t\t}\n\n\t\t\tpublic IDisposable ProvideOptionally<TRequest, TResponse>(Func<TRequest, Optional<TResponse>> func)\n\t\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\t\twhere TResponse : IResponseData\n\t\t\t{\n\t\t\t\treturn Current.SubscribeUsing(s => s.ProvideOptionally(func));\n\t\t\t}\n\n\t\t\tpublic IDisposable Provide<TRequest, TResponse>(Func<TRequest, TResponse> func)\n\t\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\t\twhere TResponse : IResponseData\n\t\t\t{\n\t\t\t\treturn Current.SubscribeUsing(s => s.Provide(func));\n\t\t\t}\n\n\t\t\tpublic async Task<TResponse> Request<TResponse>(IRequestData<TResponse> request)\n\t\t\t\twhere TResponse : IResponseData\n\t\t\t{\n\t\t\t\treturn await (await Current.FirstAsync()).Request(request);\n\t\t\t}\n\t\t}\n\t}\n\n\n}"
  },
  {
    "path": "src/fuse/common/SourceFragment.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing Outracks.IO;\nusing Uno.UX.Markup;\n\nnamespace Outracks.Fuse\n{\n\tsealed public class SourceFragment : IEquatable<SourceFragment>\n\t{\n\t\treadonly byte[] _data;\n\t\tpublic SourceFragment(byte[] data)\n\t\t{\n\t\t\t_data = data;\n\t\t}\n\n\t\t// byte[] <-> SourceFragment\n\n\t\tpublic static SourceFragment FromBytes(byte[] data)\n\t\t{\n\t\t\treturn new SourceFragment(data);\n\t\t}\n\n\t\tpublic byte[] ToBytes()\n\t\t{\n\t\t\treturn _data;\n\t\t}\n\n\t\t// String <-> SourceFragment\n\n\t\tpublic static SourceFragment FromString(string uxSourceCode)\n\t\t{\n\t\t\treturn new SourceFragment(Encoding.UTF8.GetBytes(uxSourceCode));\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Encoding.UTF8.GetString(_data);\n\t\t}\n\n\t\t// XElement <-> SourceFragment\n\n\t\tpublic static SourceFragment FromXml(XElement xElement)\n\t\t{\n\t\t\tusing (var file = new MemoryStream())\n\t\t\tusing (var writer = UxWriter.Create(file))\n\t\t\t{\n\t\t\t\tnew XDocument(xElement).Save(writer);\n\t\t\t\twriter.Flush();\n\t\t\t\tfile.Seek(0, SeekOrigin.Begin);\n\t\t\t\treturn new SourceFragment(file.ReadAllBytes());\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"XmlException\"></exception>\n\t\tpublic XElement ToXml()\n\t\t{\n\t\t\tusing (var stream = new MemoryStream(_data))\n\t\t\t{\n\t\t\t\tvar root = XmlHelpers.ReadAllXml(stream, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo, uxMode: true).Root;\n\t\t\t\troot.Remove();\n\t\t\t\treturn root;\n\t\t\t}\n\t\t}\n\n\t\t// Stream <-> SourceFragment\n\n\t\tpublic static SourceFragment ReadFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new SourceFragment(reader.ReadBytes(reader.ReadInt32()));\n\t\t}\n\n\t\tpublic void WriteTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(_data.Length);\n\t\t\twriter.Write(_data);\n\t\t}\n\n\t\tpublic static SourceFragment Empty = new SourceFragment(new byte[0]);\n\n\n\t\t// Equals\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn Equals((SourceFragment)obj);\n\t\t}\n\n\t\tpublic bool Equals(SourceFragment other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn _data.SequenceEqual(other._data);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _data.Length;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/UxExpression.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IExpression<T>\n\t{\n\t\tT Inherited { get; }\n\t\tOptional<Parsed<T>> Local { get; }\n\t\tOptional<string> Data { get; }\n\n\t\tOptional<string> Property { get; }\n\t}\n\n\n\tpublic static class UxExpression\n\t{\n\t\tpublic static IExpression<TOut> Select<TIn, TOut>(this IExpression<TIn> input, Func<TIn, TOut> convert, Func<TOut, string> stringify)\n\t\t{\n\t\t\treturn new MutableExpression<TOut>\n\t\t\t{\n\t\t\t\tInherited = convert(input.Inherited),\n\t\t\t\tData = input.Data,\n\t\t\t\tProperty = input.Property,\n\t\t\t\tLocal = input.Local.Select(pv =>\n\t\t\t\t\tnew Parsed<TOut>()\n\t\t\t\t\t{\n\t\t\t\t\t\tString = pv.Value.Select(v => stringify(convert(v))).Or(\"\"),\n\t\t\t\t\t\tValue = pv.Value.Select(convert)\n\t\t\t\t\t}),\n\t\t\t};\n\t\t}\n\n\t\tpublic static IExpression<T> Inherited<T>(T inherited)\n\t\t{\n\t\t\treturn new MutableExpression<T>\n\t\t\t{\n\t\t\t\tInherited = inherited,\n\t\t\t\tLocal = Optional.None(),\n\t\t\t\tData = Optional.None(),\n\t\t\t\tProperty = Optional.None(),\n\t\t\t};\n\t\t}\n\n\t\tpublic static IExpression<T> Local<T>(string local, Func<string, Parsed<T>> parse, T inherited)\n\t\t{\n\t\t\tvar expression = new MutableExpression<T>\n\t\t\t{\n\t\t\t\tInherited = inherited,\n\t\t\t\tLocal = Optional.Some(parse(local)),\n\t\t\t\tData = Optional.None(),\n\t\t\t\tProperty = Optional.None(),\n\t\t\t};\n\n\t\t\tvar p = local.TrimStart();\n\t\t\tif (!p.StartsWith(\"{\"))\n \t\t\t\treturn expression;\n\t\t\tp = p.StripPrefix(\"{\").TrimStart();\n\n\t\t\tif (!p.StartsWith(\"Property\"))\n\t\t\t\treturn expression;\n\t\t\tp = p.StripPrefix(\"Property\");\n\n\t\t\tp = p.TrimEnd().StripSuffix(\"}\");\n\n\t\t\texpression.Property = Optional.Some(p);\n\n\t\t\treturn expression;\n\t\t}\n\n\t\tpublic static IExpression<T> Data<T>(string data, T inherited)\n\t\t{\n\t\t\treturn new MutableExpression<T>\n\t\t\t{\n\t\t\t\tInherited = inherited,\n\t\t\t\tLocal = Optional.None(),\n\t\t\t\tData = Optional.Some(data),\n\t\t\t\tProperty = Optional.None(),\n\t\t\t};\n\t\t}\n\n\t\tpublic static IExpression<T> Property<T>(string property, T inherited)\n\t\t{\n\t\t\treturn new MutableExpression<T>\n\t\t\t{\n\t\t\t\tInherited = inherited,\n\t\t\t\tLocal = Optional.None(),\n\t\t\t\tData = Optional.None(),\n\t\t\t\tProperty = Optional.Some(property),\n\t\t\t};\n\t\t}\n\n\t\tclass MutableExpression<T> : IExpression<T>\n\t\t{\n\t\t\tpublic T Inherited { get; set; }\n\t\t\tpublic Optional<Parsed<T>> Local { get; set; }\n\t\t\tpublic Optional<string> Data { get; set; }\n\t\t\tpublic Optional<string> Property { get; set; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/UxSize.cs",
    "content": "namespace Outracks.Fuse\n{\n\tpublic struct UxSize\n\t{\n\t\tpublic static UxSize Points(Points value)\n\t\t{\n\t\t\treturn new UxSize\n\t\t\t{\n\t\t\t\tPointsValue = value,\n\t\t\t};\n\t\t}\n\t\tpublic static UxSize Pixels(Pixels value)\n\t\t{\n\t\t\treturn new UxSize\n\t\t\t{\n\t\t\t\tPixelsValue = value,\n\t\t\t};\n\t\t}\n\n\t\tpublic static UxSize Percentages(Percentages value)\n\t\t{\n\t\t\treturn new UxSize\n\t\t\t{\n\t\t\t\tPercentagesValue = value,\n\t\t\t};\n\t\t}\n\n\t\tpublic Optional<Points> PointsValue { get; private set; }\n\t\tpublic Optional<Pixels> PixelsValue { get; private set; }\n\t\tpublic Optional<Percentages> PercentagesValue { get; private set; }\n\t}\n}"
  },
  {
    "path": "src/fuse/common/UxWriter.cs",
    "content": "using System.IO;\nusing System.Xml;\nusing Outracks.IO;\nusing Uno.UX.Markup;\n\nnamespace Outracks.Fuse\n{\n\tpublic class UxWriter : XmlWriter\n\t{\n\t\treadonly MemoryStream _buffer = new MemoryStream();\n\t\treadonly XmlWriter _bufferWriter;\n\t\treadonly TextWriter _destinationWriter;\n\n\t\tbool _isDisposed;\n\n\t\tnew public static UxWriter Create(Stream stream)\n\t\t{\n\t\t\treturn new UxWriter(stream);\n\t\t}\n\n\t\tUxWriter(Stream destination)\n\t\t{\n\t\t\t_bufferWriter = Create(\n\t\t\t\t_buffer,\n\t\t\t\tnew XmlWriterSettings\n\t\t\t\t{\n\t\t\t\t\tOmitXmlDeclaration = true,\n\t\t\t\t\tIndent = false,\n\t\t\t\t});\n\t\t\t_destinationWriter = new StreamWriter(destination);\n\t\t}\n\n\t\tpublic override void WriteStartDocument()\n\t\t{\n\t\t\tWriteStartDocument(false);\n\t\t}\n\n\t\tpublic override void WriteStartDocument(bool standalone)\n\t\t{\n\t\t}\n\n\t\tpublic override void WriteEndDocument()\n\t\t{\n\t\t\t_bufferWriter.WriteEndDocument();\n\t\t}\n\n\t\tpublic override void WriteDocType(string name, string pubid, string sysid, string subset)\n\t\t{\n\t\t}\n\n\t\tpublic override void WriteStartElement(string prefix, string localName, string ns)\n\t\t{\n\t\t\tif (ns == Configuration.UXNamespace)\n\t\t\t{\n\t\t\t\tprefix = \"ux\";\n\t\t\t}\n\n\t\t\t_bufferWriter.WriteStartElement(prefix, localName, string.IsNullOrEmpty(prefix) ? \"\" : ns);\n\t\t}\n\n\t\tpublic override void WriteEndElement()\n\t\t{\n\t\t\t_bufferWriter.WriteEndElement();\n\t\t}\n\n\t\tpublic override void WriteFullEndElement()\n\t\t{\n\t\t\t_bufferWriter.WriteFullEndElement();\n\t\t}\n\n\t\tpublic override void WriteStartAttribute(string prefix, string localName, string ns)\n\t\t{\n\t\t\tif (ns == Configuration.UXNamespace)\n\t\t\t{\n\t\t\t\tprefix = \"ux\";\n\t\t\t}\n\n\t\t\t_bufferWriter.WriteStartAttribute(prefix, localName, ns);\n\t\t}\n\n\t\tpublic override void WriteEndAttribute()\n\t\t{\n\t\t\t_bufferWriter.WriteEndAttribute();\n\t\t}\n\n\t\tpublic override void WriteCData(string text)\n\t\t{\n\t\t\t_bufferWriter.WriteRaw(text);\n\t\t}\n\n\t\tpublic override void WriteComment(string text)\n\t\t{\n\t\t\t_bufferWriter.WriteComment(text);\n\t\t}\n\n\t\tpublic override void WriteProcessingInstruction(string name, string text)\n\t\t{\n\t\t\t_bufferWriter.WriteProcessingInstruction(name, text);\n\t\t}\n\n\t\tpublic override void WriteEntityRef(string name)\n\t\t{\n\t\t\t_bufferWriter.WriteEntityRef(name);\n\t\t}\n\n\t\tpublic override void WriteCharEntity(char ch)\n\t\t{\n\t\t\t_bufferWriter.WriteCharEntity(ch);\n\t\t}\n\n\t\tpublic override void WriteWhitespace(string ws)\n\t\t{\n\t\t\t_bufferWriter.WriteWhitespace(ws);\n\t\t}\n\n\t\tpublic override void WriteString(string text)\n\t\t{\n\t\t\t_bufferWriter.WriteString(text);\n\t\t}\n\n\t\tpublic override void WriteSurrogateCharEntity(char lowChar, char highChar)\n\t\t{\n\t\t\t_bufferWriter.WriteSurrogateCharEntity(lowChar, highChar);\n\t\t}\n\n\t\tpublic override void WriteChars(char[] buffer, int index, int count)\n\t\t{\n\t\t\t_bufferWriter.WriteChars(buffer, index, count);\n\t\t}\n\n\t\tpublic override void WriteRaw(char[] buffer, int index, int count)\n\t\t{\n\t\t\t_bufferWriter.WriteRaw(buffer, index, count);\n\t\t}\n\n\t\tpublic override void WriteRaw(string data)\n\t\t{\n\t\t\t_bufferWriter.WriteRaw(data);\n\t\t}\n\n\t\tpublic override void WriteBase64(byte[] buffer, int index, int count)\n\t\t{\n\t\t\t_bufferWriter.WriteBase64(buffer, index, count);\n\t\t}\n\n\t\tpublic override void Flush()\n\t\t{\n\t\t\t_bufferWriter.Flush();\n\t\t\t_buffer.Seek(0, SeekOrigin.Begin);\n\t\t\t_destinationWriter.Write(_buffer.ReadToEnd().Replace(\" xmlns:ux=\\\"http://schemas.fusetools.com/ux\\\"\", \"\"));\n\t\t\t_destinationWriter.Flush();\n\t\t\t_buffer.Seek(0, SeekOrigin.Begin);\n\t\t}\n\n\t\tpublic override string LookupPrefix(string ns)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (_isDisposed) return;\n\t\t\tFlush();\n\t\t\t_destinationWriter.Dispose();\n\t\t\t_bufferWriter.Dispose();\n\t\t\t_buffer.Dispose();\n\t\t\t_isDisposed = true;\n\t\t}\n\n\t\tpublic override WriteState WriteState\n\t\t{\n\t\t\tget { return _bufferWriter.WriteState; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/common/WebLinks.cs",
    "content": "﻿namespace Outracks.Fuse\n{\n\tpublic static class WebLinks\n\t{\n\t\t// About\n\t\tpublic const string Website = \"https://fuse-x.com/\";\n\n\t\t// Dashboard\n\t\tpublic const string Tutorial = \"https://fuse-x.com/tutorial/\";\n\t\tpublic const string Documentation = \"https://fuse-x.com/docs/\";\n\t\tpublic const string Community = \"https://fuse-x.com/community/\";\n\n\t\t// Help\n\t\tpublic const string Examples = \"https://fuse-x.com/examples/\";\n\t\tpublic const string Forums = \"https://fuse-x.com/forums/\";\n\t\tpublic const string Issues = \"https://fuse-x.com/issues/\";\n\n\t\t// Check for updates\n\t\tpublic const string Download = \"https://fuse-x.com/download/\";\n\n\t\t// User profile\n\t\tpublic const string SignIn = \"https://fuse-x.com/signin/\";\n\t\tpublic const string Dashboard = \"https://fuse-x.com/dashboard/\";\n\n\t\t// Session\n\t\tpublic const string Avatar = \"https://fuse-x.com/session/avatar/\";\n\t\tpublic const string License = \"https://fuse-x.com/session/license/\";\n\t\tpublic const string Session = \"https://fuse-x.com/session/get/\";\n\n\t\t// Remote timestamp\n\t\tpublic const string Utc = \"https://fuse-x.com/utc/\";\n\t}\n}\n"
  },
  {
    "path": "src/fuse/common/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fuse/common/packages.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"BouncyCastle\" version=\"1.8.9\" targetFramework=\"net46\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fuse/daemon/DaemonRunner.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Net.Sockets;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.Daemon\n{\n\tpublic class DaemonRunner\n\t{\n\t\treadonly EnsureSingleUser _ensureSingleUser;\n\n\t\tbool _isRunning = true;\n\n\t\treadonly IFuseLauncher _fuse;\n\t\treadonly LocalSocketServer _localServer;\n\t\treadonly bool _isDebug;\n\t\treadonly Subject<IEventMessage<IEventData>> _broadcastEvents;\n\t\treadonly IConnectableObservable<IEventMessage<IEventData>> _replayBroadcastEvents;\n\t\treadonly PluginClients _pluginClients;\n\t\treadonly ServiceRunnerFactory _serviceRunnerFactory;\n\t\tOptional<ServiceRunner> _serviceRunner;\n\t\treadonly bool _runServices;\n\t\treadonly IReport _report;\n\t\treadonly DaemonKey _daemonKey;\n\n\t\tconst string RunningAt = \"127.0.0.1 port 12122\";\n\n\t\tpublic DaemonRunner(\n\t\t\tEnsureSingleUser ensureSingleUser,\n\t\t\tLocalSocketServer localSocketServer,\n\t\t\tbool isDebug,\n\t\t\tbool startServices,\n\t\t\tIFuseLauncher fuse,\n\t\t\tServiceRunnerFactory serviceRunnerFactory,\n\t\t\tIReport report)\n\t\t{\n\t\t\t_ensureSingleUser = ensureSingleUser;\n\t\t\t_runServices = startServices;\n\t\t\t_fuse = fuse;\n\t\t\t_localServer = localSocketServer;\n\t\t\t_isDebug = isDebug;\n\t\t\t_daemonKey = ensureSingleUser.GetDaemonKey();\n\t\t\t_broadcastEvents = new Subject<IEventMessage<IEventData>>();\n\t\t\t_replayBroadcastEvents = _broadcastEvents.Replay(TimeSpan.FromMinutes(5));\n\t\t\t_pluginClients = new PluginClients();\n\t\t\t_serviceRunnerFactory = serviceRunnerFactory;\n\t\t\t_report = report;\n\t\t}\n\n\t\t/// <exception cref=\"SocketException\"></exception>\n\t\tpublic void Run()\n\t\t{\n\t\t\tusing (var ensureSingleInstance = EnsureSingleInstanceFactory.Create(\"Fuse.Daemon\", _report))\n\t\t\t{\n\t\t\t\tHandleMultipleUsers();\n\n\t\t\t\tif (ensureSingleInstance.IsAlreadyRunning())\n\t\t\t\t{\n\t\t\t\t\tvar alreadyRunning = \"Already running at \" + RunningAt;\n\t\t\t\t\t_report.Info(alreadyRunning, ReportTo.LogAndUser);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar serializer = new Serializer();\n\n\t\t\t\t\tvar clientConnected = _localServer.ClientConnected;\n\t\t\t\t\tvar clientDisconnected = _localServer.ClientDisconnected;\n\n\t\t\t\t\tif (_isDebug)\n\t\t\t\t\t{\n\t\t\t\t\t\tclientConnected.Subscribe(\n\t\t\t\t\t\t\tc => _report.Info(\"A client connected at: \" + DateTime.Now.ToShortTimeString(), ReportTo.LogAndUser));\n\t\t\t\t\t\tclientDisconnected.Subscribe(\n\t\t\t\t\t\t\tc => _report.Info(\"A client disconnected at: \" + DateTime.Now.ToShortTimeString(), ReportTo.LogAndUser));\n\t\t\t\t\t}\n\n\t\t\t\t\tclientConnected.Subscribe(\n\t\t\t\t\t\tasync c =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar disposables = new ConcurrentStack<IDisposable>();\n\t\t\t\t\t\t\tc.Disconnected.Subscribe(t => Dispose(disposables)); // Dispose client stuff on OnCompleted\n\n\t\t\t\t\t\t\tvar messagesOut = c.OutgoingMessages.Serialized(serializer);\n\t\t\t\t\t\t\tvar messagesIn = c.IncomingMessages.TryDeserialize(serializer, _report);\n\n\t\t\t\t\t\t\tvar requestReceiver = new RequestReceiver(\n\t\t\t\t\t\t\t\t_report,\n\t\t\t\t\t\t\t\tmessagesIn.OfType<IRequestMessage<UnresolvedMessagePayload>>(),\n\t\t\t\t\t\t\t\tmessagesOut);\n\n\t\t\t\t\t\t\t// Handle kill request\n\t\t\t\t\t\t\tdisposables.Push(\n\t\t\t\t\t\t\t\trequestReceiver.SubscribeToRequest<KillRequest, KillResponse>(HandleKillRequest));\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tawait Task.Run(() => HelloStep(requestReceiver, c, disposables, messagesIn, messagesOut));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t_report.Error(e);\n\t\t\t\t\t\t\t\tc.Close();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\tclientDisconnected.Subscribe(_pluginClients.Remove);\n\n\t\t\t\t\t_localServer.Host(12122);\n\t\t\t\t\tvar runningAt = \"Running at \" + RunningAt;\n\t\t\t\t\t_report.Info(runningAt, ReportTo.LogAndUser);\n\n\t\t\t\t\tif (_runServices)\n\t\t\t\t\t\tTask.Run(() => _serviceRunnerFactory.Start())\n\t\t\t\t\t\t\t.ContinueWith(t => _serviceRunner = t.Result);\n\n\t\t\t\t\t//Task.Run(() => Proxy.Initialize());\n\n\t\t\t\t\tConsole.CancelKeyPress += (sender, args) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tDoPreTermination();\n\t\t\t\t\t\tScheduleTerminate();\n\t\t\t\t\t\targs.Cancel = true;\n\t\t\t\t\t};\n\n\t\t\t\t\tusing(Observable.Interval(TimeSpan.FromMinutes(10)).Subscribe(duration =>\n\t\t\t\t\t\t_report.Info(\"Daemon is still running\")))\n\t\t\t\t\tusing (_replayBroadcastEvents.Connect())\n\t\t\t\t\tusing (_localServer)\n\t\t\t\t\t//using (simulatorProxyServer)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (_isRunning)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.Sleep(1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tDoPreTermination();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic void Dispose(ConcurrentStack<IDisposable> disposables)\n\t\t{\n\t\t\tIDisposable disposable;\n\t\t\twhile (disposables.TryPop(out disposable))\n\t\t\t\tdisposable.Dispose();\n\t\t}\n\n\t\tvoid HelloStep(\n\t\t\tRequestReceiver requestReceiver,\n\t\t\tIMessageConnection c,\n\t\t\tConcurrentStack<IDisposable>\n\t\t\tdisposables,\n\t\t\tIObservable<IMessage> messagesIn,\n\t\t\tIObserver<IMessage> messagesOut)\n\t\t{\n\t\t\tmessagesOut.OnNext(\n\t\t\t\tEvent.Create(new Welcome()\n\t\t\t\t{\n\t\t\t\t\tMessage = \"You have successfully connected to the Fuse Daemon. You can find API docs on our webpage.\"\n\t\t\t\t}));\n\n\t\t\tvar taskResult = new TaskCompletionSource<Unit>();\n\t\t\tusing(requestReceiver.SubscribeToRequest<HelloRequest, HelloResponse>(\n\t\t\t\thelloRequest =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tHandleHello(helloRequest, c, disposables, requestReceiver, messagesIn, messagesOut);\n\t\t\t\t\t\ttaskResult.SetResult(Unit.Default);\n\t\t\t\t\t\treturn new HelloResponse();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\ttaskResult.SetException(e);\n\t\t\t\t\t\tthrow;\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\t{\n\t\t\t\tc.StartRead();\n\t\t\t\ttaskResult.Task.Wait();\n\t\t\t}\n\t\t}\n\n\t\tvoid HandleHello(\n\t\t\tHelloRequest helloReq,\n\t\t\tIMessageConnection c,\n\t\t\tConcurrentStack<IDisposable> disposables,\n\t\t\tRequestReceiver requestReceiver,\n\t\t\tIObservable<IMessage> messagesIn,\n\t\t\tIObserver<IMessage> messagesOut)\n\t\t{\n\t\t\tif (helloReq == null)\n\t\t\t{\n\t\t\t\tthrow new FuseRequestErrorException(ErrorCode.InvalidData, \"Expected data to not be empty.\");\n\t\t\t}\n\n\t\t\t// TODO: Enforce daemonkey to be present in the future\n\t\t\tif (!string.IsNullOrWhiteSpace(helloReq.DaemonKey)\n\t\t\t\t&& DaemonKey.Deserialize(helloReq.DaemonKey) != _daemonKey)\n\t\t\t{\n\t\t\t\tthrow new FuseRequestErrorException(\n\t\t\t\t\t\tErrorCode.WrongDaemonKey,\n\t\t\t\t\t\t\"Daemon key was not right, maybe because daemon possesses wrong local user.\");\n\t\t\t}\n\n#pragma warning disable 0618\n\t\t\tvar pluginClient = new PluginClient(\n\t\t\t\tmessagesOut,\n\t\t\t\thelloReq.Identifier,\n\t\t\t\thelloReq.Implements,\n\t\t\t\thelloReq.EventFilter);\n#pragma warning restore 0618\n\n\t\t\t_pluginClients.Add(c, pluginClient);\n\n\t\t\t_report.Info(\"Client connected: \" + helloReq.Identifier, ReportTo.LogAndUser);\n\t\t\tc.Disconnected.Subscribe(d => _report.Info(\"Client disconnected: \" + helloReq.Identifier, ReportTo.LogAndUser));\n\n\t\t\t// Broadcast events to clients that wants the events.\n\t\t\tdisposables.Push(messagesIn.OfType<IEventMessage<IEventData>>().Subscribe(_broadcastEvents.OnNext));\n\t\t\tdisposables.Push(_broadcastEvents\n\t\t\t\t\t.Subscribe(pluginClient.HandleEvent));\n\n\t\t\t// Handle Subscribe to event request.\n\t\t\tdisposables.Push(\n\t\t\t\tmessagesIn\n\t\t\t\t.OfType<IRequestMessage<UnresolvedMessagePayload>>()\n\t\t\t\t.Deserialize<SubscribeRequest>(_report)\n\t\t\t\t.Subscribe(\n\t\t\t\t\tr => disposables.Push(\n\t\t\t\t\t\tpluginClient.SubscribeToEvent(\n\t\t\t\t\t\t\tr,\n\t\t\t\t\t\t\thotMessages: _broadcastEvents,\n\t\t\t\t\t\t\treplayMessages: _replayBroadcastEvents))\n\t\t\t\t));\n\n\t\t\tdisposables.Push(\n\t\t\t\trequestReceiver.SubscribeToRequest<PublishServiceRequest, PublishServiceResponse>(pluginClient.AppendSupportedRequests));\n\n\t\t\t// Send requests to clients that implements the request.\n\t\t\tdisposables.Push(\n\t\t\t\tmessagesIn.OfType<IRequestMessage<IRequestData>>()\n\t\t\t\t\t.Where(r => r.Name != \"Subscribe\" && r.Name != \"Fuse.KillDaemon\" && r.Name != \"PublishService\")\n\t\t\t\t\t.Subscribe(r => Task.Run(() => _pluginClients.PassRequestToAnImplementor(pluginClient, r))));\n\n\t\t\t// Handle the response from the one that implemented the request\n\t\t\tdisposables.Push(\n\t\t\t\tmessagesIn.OfType<IResponseMessage<IResponseData>>().Subscribe(pluginClient.HandleResponse));\n\t\t}\n\n\t\tOptional<KillResponse> HandleKillRequest(KillRequest k)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_report.Info(\"Shutting down because \" + k.Reason, ReportTo.LogAndUser);\n\n\t\t\t\tDoPreTermination();\n\n\t\t\t\treturn new KillResponse();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tScheduleTerminate();\n\t\t\t}\n\t\t}\n\n\t\tvoid ScheduleTerminate()\n\t\t{\n\t\t\t_isRunning = false;\n\t\t}\n\n\t\tvoid DoPreTermination()\n\t\t{\n\t\t\t_serviceRunner.Do(r => r.Dispose());\n\t\t}\n\n\t\tvoid HandleMultipleUsers()\n\t\t{\n\t\t\tvar currentUser = _ensureSingleUser.GetUserName();\n\t\t\tvar lastUserWhoRanDaemon = _ensureSingleUser.GetUserWhoRanDaemonLastTime();\n\t\t\tif (lastUserWhoRanDaemon != currentUser)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar client = _fuse.Connect();\n\n\t\t\t\t\tif (!client.Request(new KillRequest() { Reason = \"you are possessing wrong user\" })\n\t\t\t\t\t\t.Wait(10000))\n\t\t\t\t\t{\n\t\t\t\t\t\t_report.Error(\n\t\t\t\t\t\t\t\"Failed to kill daemon which possesses another user.\\n\" +\n\t\t\t\t\t\t\t\t\"Try to sign out from all users on your computer.\", ReportTo.LogAndUser);\n\t\t\t\t\t}\n\n\t\t\t\t\t// We must wait a bit since it takes time to kill a daemon.\n\t\t\t\t\tThread.Sleep(TimeSpan.FromSeconds(3));\n\t\t\t\t}\n\t\t\t\tcatch (AggregateException e)\n\t\t\t\t{\n\t\t\t\t\tif (e.InnerException is SocketException)\n\t\t\t\t\t{\n\t\t\t\t\t\t_report.Info(\"SocketException in HandleMultipleUsers '\" + e.Message + \"'\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_report.Info(e.InnerException.Message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\t_report.Info(e.Message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_ensureSingleUser.SetUserThatRunsDaemon(currentUser);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/daemon/EnsureSingleInstanceFactory.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Threading;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.Fuse.Daemon\n{\n\tinterface IEnsureSingleInstance : IDisposable\n\t{\n\t\tbool IsAlreadyRunning();\n\t}\n\n\tstatic class EnsureSingleInstanceFactory\n\t{\n\t\tpublic static IEnsureSingleInstance Create(string name, IReport report)\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t\treturn new EnsureSingleInstanceWin(name);\n\t\t\telse\n\t\t\t\treturn new EnsureSingleInstanceOSX(name, report);\n\t\t}\n\t}\n\n\tclass EnsureSingleInstanceWin : IEnsureSingleInstance\n\t{\n\t\treadonly Mutex _mutex;\n\t\treadonly bool _createdNew;\n\n\t\tpublic EnsureSingleInstanceWin(string name)\n\t\t{\n\t\t\t_mutex = new Mutex(true, name, out _createdNew);\n\t\t}\n\n\t\tpublic bool IsAlreadyRunning()\n\t\t{\n\t\t\treturn !_createdNew;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif(_createdNew)\n\t\t\t\t_mutex.ReleaseMutex();\n\t\t}\n\t}\n\n\tclass EnsureSingleInstanceOSX : IEnsureSingleInstance\n\t{\n\t\treadonly FileStream _stream;\n\t\treadonly bool _isSingle = true;\n\t\treadonly IReport _report;\n\n\t\tconst int FileLocked = -2147024863;\n\n\t\tpublic EnsureSingleInstanceOSX(string name, IReport report)\n\t\t{\n\t\t\t_report = report;\n\t\t\t_stream = File.OpenWrite (\"/tmp/\" + name + Environment.UserDomainName + \"_\" + Environment.UserName);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_stream.Lock (0, _stream.Length);\n\t\t\t\t_report.Info(\"Successfully locked\");\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t\tif (e.HResult == FileLocked)\n\t\t\t\t\t_isSingle = false;\n\t\t\t\telse\n\t\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAlreadyRunning()\n\t\t{\n\t\t\treturn !_isSingle;\n\t\t}\n\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\t_report.Info(\"Disposing lock\");\n\t\t\t_stream.Unlock (0, _stream.Length);\n\t\t\t_stream.Dispose ();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/daemon/EnsureSingleUser.cs",
    "content": "﻿using System;\nusing System.IO;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Daemon\n{\n\tpublic class EnsureSingleUser\n    {\n\t\treadonly TextWriter _errorWriter;\n\t\treadonly IShell _fs;\n\t\treadonly AbsoluteFilePath _userFile;\n\n\t\tpublic EnsureSingleUser(\n\t\t\tTextWriter errorWriter,\n\t\t\tIShell fs,\n\t\t\tAbsoluteFilePath userFile)\n\t\t{\n\t\t\t_errorWriter = errorWriter;\n\t\t\t_fs = fs;\n\t\t\t_userFile = userFile;\n\t\t}\n\n\t\tpublic string GetUserName()\n\t\t{\n\t\t\treturn Environment.UserName;\n\t\t}\n\n\t\tpublic string GetUserWhoRanDaemonLastTime()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!_fs.Exists(_userFile))\n\t\t\t\t\treturn GetUserName();\n\n\t\t\t\treturn _fs.ReadAllText(_userFile, 10);\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\t_errorWriter.WriteLine(e.InnerException);\n\t\t\t\treturn GetUserName();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_errorWriter.WriteLine(e);\n\t\t\t\treturn GetUserName();\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetUserThatRunsDaemon(string currentUser)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar isOwner = !_fs.Exists(_userFile);\n\n\t\t\t\tif (isOwner)\n\t\t\t\t\t_fs.CreateIfNotExists(_userFile.ContainingDirectory);\n\n\t\t\t\t_fs.ReplaceText(_userFile, currentUser);\n\n\t\t\t\t// We only have permission to set permission when we are owner.\n\t\t\t\tif (isOwner)\n\t\t\t\t{\n\t\t\t\t\t_fs.SetPermission(\n\t\t\t\t\t\t_userFile,\n\t\t\t\t\t\tFileSystemPermission.Read | FileSystemPermission.Write,\n\t\t\t\t\t\tFileSystemGroup.Everyone);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_errorWriter.WriteLine(e.ToString());\n\t\t\t}\n\t\t}\n\n\t\tpublic DaemonKey GetDaemonKey()\n\t\t{\n\t\t\treturn DaemonKey.GetDaemonKey();\n\t\t}\n    }\n}\n"
  },
  {
    "path": "src/fuse/daemon/ErrorListIntercepter.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.Daemon\n{\n\tclass ErrorListIntercepter : IDisposable\n\t{\n\t\tpublic readonly ConcurrentQueue<Error> Errors = new ConcurrentQueue<Error>();\n\t\treadonly IDisposable _errorSub;\n\n\t\tpublic ErrorListIntercepter(IObservable<Error> errors)\n\t\t{\n\t\t\t_errorSub = errors.Subscribe(e => Errors.Enqueue(e));\n\t\t}\n\n\t\tpublic bool HasErrors()\n\t\t{\n\t\t\treturn !Errors.IsEmpty;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_errorSub.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/daemon/Identity.cs",
    "content": "﻿using System;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tstatic class Identity\n\t{\n\t\tpublic static Identity<T> Create<T>(T initialValue)\n\t\t{\n\t\t\treturn new Identity<T>(initialValue);\n\t\t}\n\t}\n\n\tclass Identity<T> : IDisposable //where T : class\n    {\n\t\treadonly BehaviorSubject<T> _subject;\n\t\treadonly object _mutex = new object();\n\n\t\tT _ref;\n\n\t\tpublic T Value\n\t\t{\n\t\t\tget { return _subject.Value; }\n\t\t}\n\n\t\tpublic Identity(T initialValue)\n\t\t{\n\t\t\t_ref = initialValue;\n\t\t\t_subject = new BehaviorSubject<T>(initialValue);\n\t\t\t//_subject.Do(t => Console.WriteLine(Stopwatch.GetTimestamp() + \" Next: \" + t)).Subscribe();\n\t\t}\n\n\t\tpublic void Update(Func<T, T> transform)\n\t\t{\n\t\t\t_subject.OnNext(Apply(transform));\n\t\t}\n\n\t\tT Apply(Func<T, T> transform)\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t\treturn _ref = transform(_ref);\n\t\t}\n\n\t\t//int subscriptionCount = 0;\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\t//subscriptionCount++;\n\t\t\t//Console.WriteLine(GetHashCode().ToString(\"X\") + \" has \" + subscriptionCount + \" listeners\");\n\t\t    return //Disposable.Combine(\n\t\t\t\t_subject.Subscribe(observer)\n\t\t\t\t//, Disposable.Create(() => subscriptionCount--))\n\t\t\t\t;\n\t    }\n\n\t    public void Dispose()\n\t    {\n\t\t    _subject.Dispose();\n\t    }\n    }\n\n}\n"
  },
  {
    "path": "src/fuse/daemon/Outracks.Fuse.Daemon.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{47D48240-F996-4E64-B70D-6AB2290DA8D4}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse.Daemon</RootNamespace>\n    <AssemblyName>Outracks.Fuse.Daemon</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"DaemonRunner.cs\" />\n    <Compile Include=\"EnsureSingleInstanceFactory.cs\" />\n    <Compile Include=\"EnsureSingleUser.cs\" />\n    <Compile Include=\"ErrorListIntercepter.cs\" />\n    <Compile Include=\"PluginClient.cs\" />\n    <Compile Include=\"PluginClients.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Identity.cs\" />\n    <Compile Include=\"ReadUntilExtension.cs\" />\n    <Compile Include=\"ServiceRunner.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\preview\\service\\fuse-preview.csproj\">\n      <Project>{59E1073A-9B45-41F3-AB94-958A9D18FB72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/fuse/daemon/PluginClient.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.Daemon\n{\n\tclass PendingRequest\n\t{\n\t\tpublic readonly int Id;\n\t\tpublic readonly IRequestMessage<IRequestData> Request;\n\t\tpublic readonly PluginClient WhoRequested;\n\n\t\treadonly TaskCompletionSource<IResponseMessage<IResponseData>> _responseCompletion = new TaskCompletionSource<IResponseMessage<IResponseData>>();\n\t\tpublic Task<IResponseMessage<IResponseData>> Task { get { return _responseCompletion.Task; } }\n\n\t\tpublic PendingRequest(int id, IRequestMessage<IRequestData> request, PluginClient whoRequested)\n\t\t{\n\t\t\tId = id;\n\t\t\tRequest = request;\n\t\t\tWhoRequested = whoRequested;\n\t\t}\n\n\t\tpublic void SetResult(IResponseMessage<IResponseData> response)\n\t\t{\n\t\t\t_responseCompletion.SetResult(response);\n\t\t}\n\t}\n\n\tclass PluginClient : IDisposable\n\t{\n\t\treadonly IObserver<IMessage> _outStream;\n\t\treadonly Identity<ImmutableList<PendingRequest>> _pendingRequests = Identity.Create(ImmutableList<PendingRequest>.Empty);\n\t\treadonly Identity<ImmutableList<string>> _implements = new Identity<ImmutableList<string>>(ImmutableList<string>.Empty);\n\t\treadonly string _eventFilter;\n\t\tbool _isUsingOldEventSubscription = true;\n\n\t\tpublic readonly string Identifier;\n\n\t\tpublic PluginClient(\n\t\t\tIObserver<IMessage> outStream,\n\t\t\tstring identifier,\n\t\t\tstring []implements,\n\t\t\tstring eventFilter)\n\t\t{\n\t\t\t_outStream = outStream;\n\t\t\tIdentifier = identifier;\n\t\t\t_implements.Update(i => ImmutableList.Create(implements ?? new string[0]));\n\t\t\t_eventFilter = eventFilter;\n\t\t}\n\n\t\tpublic Task<IResponseMessage<IResponseData>> SendRequest(PluginClient whoRequested, int id, IRequestMessage<IRequestData> request)\n\t\t{\n\t\t\tvar pendingRequest = new PendingRequest(id, request, whoRequested);\n\t\t\t_pendingRequests.Update(l => l.Add(pendingRequest));\n\t\t\t_outStream.OnNext(request.ChangeId(id));\n\t\t\treturn pendingRequest.Task;\n\t\t}\n\n\t\tpublic void HandleResponse(IResponseMessage<IResponseData> response)\n\t\t{\n\t\t\tforeach (var pendingRequest in _pendingRequests.Value)\n\t\t\t{\n\t\t\t\tif (pendingRequest.Id == response.Id)\n\t\t\t\t{\n\t\t\t\t\tvar request = pendingRequest;\n\t\t\t\t\t_pendingRequests.Update(l => l.Remove(request));\n\t\t\t\t\trequest.SetResult(response);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void SendResponse(IResponseMessage<IResponseData> response)\n\t\t{\n\t\t\t_outStream.OnNext(response);\n\t\t}\n\n\t\tpublic IDisposable SubscribeToEvent(\n\t\t\tIRequestMessage<SubscribeRequest> subscribeRequest,\n\t\t\tIObservable<IEventMessage<IEventData>> hotMessages,\n\t\t\tIObservable<IEventMessage<IEventData>> replayMessages)\n\t\t{\n\t\t\t_isUsingOldEventSubscription = false;\n\n\t\t\tvar subscribeResponse = new SubscribeResponse();\n\t\t\t_outStream.OnNext(Response.CreateSuccess(subscribeRequest, subscribeResponse));\n\n\t\t\tvar subscribeArgs = subscribeRequest.Arguments;\n\t\t\tif (subscribeArgs.Replay)\n\t\t\t{\n\t\t\t\treturn replayMessages\n\t\t\t\t\t.Where(d => EventTypeMatchesFilter(d.Name, subscribeRequest.Arguments.Filter))\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\tdata => _outStream.OnNext(new Event<IEventData>(data.Name, data.Data, subscribeArgs.SubscriptionId)));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn hotMessages\n\t\t\t\t\t.Where(d => EventTypeMatchesFilter(d.Name, subscribeRequest.Arguments.Filter))\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\tdata => _outStream.OnNext(new Event<IEventData>(data.Name, data.Data, subscribeArgs.SubscriptionId)));\n\t\t\t}\n\t\t}\n\n\t\tpublic void HandleEvent(IEventMessage<IEventData> evt)\n\t\t{\n#pragma warning disable 0618\n\n\t\t\tif (_isUsingOldEventSubscription && EventTypeMatchesFilterOld(evt.Name))\n\t\t\t\t_outStream.OnNext(new Event<IEventData>(evt.Name, evt.Data));\n#pragma warning restore 0618\n\t\t}\n\n\t\t[Obsolete(\"Remove when we are going 100 % in for the new API\")]\n\t\tbool EventTypeMatchesFilterOld(string eventName)\n\t\t{\n\t\t\treturn string.IsNullOrEmpty(_eventFilter) || Regex.IsMatch(eventName, _eventFilter);\n\t\t}\n\n\t\tbool EventTypeMatchesFilter(string eventName, string filter)\n\t\t{\n\t\t\treturn Regex.IsMatch(eventName, filter);\n\t\t}\n\n\t\tpublic bool IsImlementorOf(string request)\n\t\t{\n\t\t\treturn _implements.Value.Contains(request);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tforeach (var pendingRequest in _pendingRequests.Value)\n\t\t\t{\n\t\t\t\tpendingRequest\n\t\t\t\t\t.WhoRequested\n\t\t\t\t\t.SendResponse(\n\t\t\t\t\t\tResponse.CreateUnhandled(\n\t\t\t\t\t\t\tpendingRequest.Request,\n\t\t\t\t\t\t\tnew Error(ErrorCode.LostConnection, \"Lost connection to implementor of \" + pendingRequest.Request.Name),\n\t\t\t\t\t\t\t(UnresolvedMessagePayload)null));\n\t\t\t}\n\t\t}\n\n\t\tpublic Optional<PublishServiceResponse> AppendSupportedRequests(PublishServiceRequest responseMessage)\n\t\t{\n\t\t\t_implements.Update(l => ImmutableList.Create(\n\t\t\t\tl.Union(responseMessage.RequestNames)\n\t\t\t\t.ToArray()));\n\t\t\treturn new PublishServiceResponse();\n\t\t}\n\t}\n\n\tstatic class RequestAndResponseExtensions\n\t{\n\t\tpublic static IRequestMessage<IRequestData> ChangeId(this IRequestMessage<IRequestData> request, int id)\n\t\t{\n\t\t\treturn new Request<IRequestData>(id, request.Name, request.Arguments);\n\t\t}\n\n\t\tpublic static IResponseMessage<IResponseData> ChangeId(this IResponseMessage<IResponseData> response, int id)\n\t\t{\n\t\t\treturn new Response<IResponseData>(id, response.Status, response.Errors, response.Result);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/daemon/PluginClients.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Linq;\nusing System.Threading;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.Fuse.Daemon\n{\n\tclass PluginClients\n\t{\n\t\treadonly ConcurrentDictionary<IMessageConnection, PluginClient> _clients = new ConcurrentDictionary<IMessageConnection, PluginClient>();\n\t\tint _currentGlobalRequestId = 0;\n\n\t\tpublic void Add(IMessageConnection socket, PluginClient client)\n\t\t{\n\t\t\t_clients.TryAdd(socket, client);\n\t\t}\n\n\t\tpublic void PassRequestToAnImplementor(PluginClient whoRequested, IRequestMessage<IRequestData> request)\n\t\t{\n\t\t\tvar clientsThatImplementsRequest = _clients.Values.Where(c => c.IsImlementorOf(request.Name));\n\t\t\tforeach (var client in clientsThatImplementsRequest)\n\t\t\t{\n\t\t\t\tvar responseTask = client.SendRequest(whoRequested, Interlocked.Increment(ref _currentGlobalRequestId), request);\n\t\t\t\tif (!responseTask.Wait(TimeSpan.FromMinutes(1)))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar response = responseTask.Result;\n\t\t\t\tif (response.Status == Status.Unhandled)\n\t\t\t\t\tcontinue;\n\n\t\t\t\twhoRequested.SendResponse(response.ChangeId(request.Id));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhoRequested.SendResponse(Response.CreateUnhandled(request, new Error(ErrorCode.InvalidRequest, \"Did not find an implementor for \" + request.Name), (UnresolvedMessagePayload)null));\n\t\t}\n\n\t\tpublic void Remove(LocalSocketClient socket)\n\t\t{\n\t\t\tPluginClient pluginClient;\n\t\t\t_clients.TryRemove(socket, out pluginClient);\n\t\t\tpluginClient.DoIfNotNull(c => c.Dispose());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/daemon/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Outracks.Fuse.Daemon\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/fuse/daemon/ReadUntilExtension.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ReadUntilExtension\n\t{\n\t\tpublic static bool ReadLinesUntil(this StreamReader reader, Func<string, bool> predicate)\n\t\t{\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvar line = reader.ReadLine();\n\t\t\t\tif (line == null)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (predicate(line))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/daemon/ServiceRunner.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reactive;\nusing System.Threading;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Daemon\n{\n\tclass ServiceProcess\n\t{\n\t\tpublic readonly Service Service;\n\t\tpublic readonly Process Process;\n\n\t\tpublic ServiceProcess(Service service, Process process)\n\t\t{\n\t\t\tService = service;\n\t\t\tProcess = process;\n\t\t}\n\n\t\tpublic bool IsRunning()\n\t\t{\n\t\t\treturn !Process.HasExited;\n\t\t}\n\t}\n\n\tpublic class Service\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly IExternalApplication Application;\n\n\t\tpublic Service(string name, IExternalApplication application)\n\t\t{\n\t\t\tName = name;\n\t\t\tApplication = application;\n\t\t}\n\t}\n\n\tpublic class ServiceRunnerFactory\n\t{\n\t\treadonly Service[] _services;\n\n\t\tpublic ServiceRunnerFactory(params Service[] services)\n\t\t{\n\t\t\t_services = services;\n\t\t}\n\n\t\tpublic ServiceRunner Start()\n\t\t{\n\t\t\treturn new ServiceRunner(_services);\n\t\t}\n\t}\n\n\tpublic class ServiceRunner : IDisposable\n\t{\n\t\tImmutableList<ServiceProcess> _serviceProcesses;\n\t\treadonly CancellationTokenSource _ctSource = new CancellationTokenSource();\n\t\treadonly Thread _thread;\n\t\tbool _isDisposed = false;\n\n\t\tpublic ServiceRunner(params Service[] services)\n\t\t{\n\t\t\t_serviceProcesses = StartAllServices(services);\n\n\t\t\t_thread = new Thread(Run) { IsBackground = true };\n\t\t\t_thread.Start(_ctSource.Token);\n\t\t}\n\n\t\tImmutableList<ServiceProcess> StartAllServices(IEnumerable<Service> services)\n\t\t{\n\t\t\treturn services.Select(StartService).ToImmutableList();\n\t\t}\n\n\t\tvoid Run(object data)\n\t\t{\n\t\t\tvar ct = (CancellationToken) data;\n\n\t\t\twhile (!ct.IsCancellationRequested)\n\t\t\t{\n\t\t\t\tvar cloneOfServices = _serviceProcesses.ToArray();\n\t\t\t\tforeach(var runningService in cloneOfServices)\n\t\t\t\t{\n\t\t\t\t\tif (!runningService.IsRunning())\n\t\t\t\t\t{\n\t\t\t\t\t\trunningService.Process.Dispose();\n\t\t\t\t\t\tConsole.Error.WriteLine(\"Service \" + runningService.Service.Name + \" died, attempting to restart...\");\n\t\t\t\t\t\t_serviceProcesses = _serviceProcesses.Replace(runningService, StartService(runningService.Service));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tThread.Sleep(100);\n\t\t\t}\n\t\t}\n\n\t\tServiceProcess StartService(Service service)\n\t\t{\n\t\t\tvar serviceProcess = service.Application.Start(\n\t\t\t\t\t\t\tnew ProcessStartInfo()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\t\t\t\tWindowStyle = ProcessWindowStyle.Hidden,\n\t\t\t\t\t\t\t\tCreateNoWindow = true,\n\t\t\t\t\t\t\t\tRedirectStandardError = true,\n\t\t\t\t\t\t\t\tRedirectStandardInput = true,\n\t\t\t\t\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\t\t\t\t});\n\n\t\t\tserviceProcess.ConsumeOutput(Observer.Create((string line) => {}));\n\t\t\tserviceProcess.ConsumeError(Observer.Create((string line) => {}));\n\n\t\t\treturn new ServiceProcess(service, serviceProcess);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif (_isDisposed)\n\t\t\t\treturn;\n\t\t\t_isDisposed = true;\n\t\t\t_ctSource.Cancel();\n\t\t\t_thread.Join();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/daemon/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Reactive\" publicKeyToken=\"94bc3704cddfc263\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.0.0\" newVersion=\"4.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fuse/daemon/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fuse/locale/LocaleCulture.cs",
    "content": "﻿using System.Globalization;\n\nnamespace Outracks.Fuse\n{\n\tpublic enum Language\n\t{\n\t\tEnglish,\n\t\tKorean,\n\t\tFrench,\n\t}\n\n\tpublic static class LocaleCulture\n\t{\n\t\tpublic static void Initialize(CultureInfo cultureInfo)\n\t\t{\n\t\t\tStrings.Culture = cultureInfo.GetLanguage().GetCulture();\n\t\t}\n\n\t\tpublic static Language GetLanguage(this CultureInfo cultureInfo)\n\t\t{\n\t\t\tswitch (cultureInfo.Name)\n\t\t\t{\n\t\t\t\tcase \"fr-FR\":\n\t\t\t\t\treturn Language.French;\n\t\t\t\tcase \"ko-KR\":\n\t\t\t\t\treturn Language.Korean;\n\t\t\t\tdefault:\n\t\t\t\t\treturn Language.English;\n\t\t\t}\n\t\t}\n\n\t\tpublic static CultureInfo GetCulture(this Language language)\n\t\t{\n\t\t\tswitch (language)\n\t\t\t{\n\t\t\t\tdefault:\n\t\t\t\t\treturn CultureInfo.GetCultureInfo(\"en-US\");\n\t\t\t\tcase Language.Korean:\n\t\t\t\t\treturn CultureInfo.GetCultureInfo(\"ko-KR\");\n\t\t\t\tcase Language.French:\n\t\t\t\t\treturn CultureInfo.GetCultureInfo(\"fr-FR\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/locale/Outracks.Fuse.Locale.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{0E454646-B607-4FED-AB02-BECBC5620FA3}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse</RootNamespace>\n    <AssemblyName>Outracks.Fuse.Locale</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <Deterministic>true</Deterministic>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"LocaleCulture.cs\" />\n    <Compile Include=\"Strings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DesignTime>True</DesignTime>\n      <DependentUpon>Strings.resx</DependentUpon>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Strings.fr-FR.resx\" />\n    <EmbeddedResource Include=\"Strings.ko-KR.resx\">\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n    <EmbeddedResource Include=\"Strings.resx\">\n      <Generator>PublicResXFileCodeGenerator</Generator>\n      <LastGenOutput>Strings.Designer.cs</LastGenOutput>\n      <SubType>Designer</SubType>\n    </EmbeddedResource>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n</Project>"
  },
  {
    "path": "src/fuse/locale/Strings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Outracks.Fuse {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    public class Strings {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Strings() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Outracks.Fuse.Strings\", typeof(Strings).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        public static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Authority: .\n        /// </summary>\n        public static string About_Authority {\n            get {\n                return ResourceManager.GetString(\"About_Authority\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Company: .\n        /// </summary>\n        public static string About_Company {\n            get {\n                return ResourceManager.GetString(\"About_Company\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Expires: .\n        /// </summary>\n        public static string About_Expires {\n            get {\n                return ResourceManager.GetString(\"About_Expires\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Issued: .\n        /// </summary>\n        public static string About_Issued {\n            get {\n                return ResourceManager.GetString(\"About_Issued\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to License: .\n        /// </summary>\n        public static string About_License {\n            get {\n                return ResourceManager.GetString(\"About_License\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to About.\n        /// </summary>\n        public static string About_Menu {\n            get {\n                return ResourceManager.GetString(\"About_Menu\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to For more information visit our .\n        /// </summary>\n        public static string About_MoreInfo1 {\n            get {\n                return ResourceManager.GetString(\"About_MoreInfo1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to website.\n        /// </summary>\n        public static string About_MoreInfo2 {\n            get {\n                return ResourceManager.GetString(\"About_MoreInfo2\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Not registered.\n        /// </summary>\n        public static string About_NotRegistered {\n            get {\n                return ResourceManager.GetString(\"About_NotRegistered\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Registered to.\n        /// </summary>\n        public static string About_RegisteredTo {\n            get {\n                return ResourceManager.GetString(\"About_RegisteredTo\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to About fuse X.\n        /// </summary>\n        public static string About_Title {\n            get {\n                return ResourceManager.GetString(\"About_Title\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Activate fuse X.\n        /// </summary>\n        public static string Activate_Button {\n            get {\n                return ResourceManager.GetString(\"Activate_Button\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Please enter your activation code..\n        /// </summary>\n        public static string Activate_FeedbackEmpty {\n            get {\n                return ResourceManager.GetString(\"Activate_FeedbackEmpty\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to This activation code is not valid..\n        /// </summary>\n        public static string Activate_FeedbackInvalid {\n            get {\n                return ResourceManager.GetString(\"Activate_FeedbackInvalid\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Enter activation code.\n        /// </summary>\n        public static string Activate_Title {\n            get {\n                return ResourceManager.GetString(\"Activate_Title\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to .\n        /// </summary>\n        public static string Auth_Text_LicensedTo1 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_LicensedTo1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to .\n        /// </summary>\n        public static string Auth_Text_LicensedTo2 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_LicensedTo2\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Your license has expired. Please .\n        /// </summary>\n        public static string Auth_Text_LicenseExpired1 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_LicenseExpired1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to sign in.\n        /// </summary>\n        public static string Auth_Text_LicenseExpired2 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_LicenseExpired2\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to  to reactivate..\n        /// </summary>\n        public static string Auth_Text_LicenseExpired3 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_LicenseExpired3\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Please .\n        /// </summary>\n        public static string Auth_Text_SignIn1 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_SignIn1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to sign in.\n        /// </summary>\n        public static string Auth_Text_SignIn2 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_SignIn2\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to  to activate fuse X.\n        /// </summary>\n        public static string Auth_Text_SignIn3 {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_SignIn3\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to trial day left.\n        /// </summary>\n        public static string Auth_Text_TrialDayLeft {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_TrialDayLeft\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to trial days left.\n        /// </summary>\n        public static string Auth_Text_TrialDaysLeft {\n            get {\n                return ResourceManager.GetString(\"Auth_Text_TrialDaysLeft\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Browse.\n        /// </summary>\n        public static string Button_Browse {\n            get {\n                return ResourceManager.GetString(\"Button_Browse\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cancel.\n        /// </summary>\n        public static string Button_Cancel {\n            get {\n                return ResourceManager.GetString(\"Button_Cancel\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Done.\n        /// </summary>\n        public static string Button_Done {\n            get {\n                return ResourceManager.GetString(\"Button_Done\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to OK.\n        /// </summary>\n        public static string Button_Ok {\n            get {\n                return ResourceManager.GetString(\"Button_Ok\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Devices.\n        /// </summary>\n        public static string CodeView_Devices {\n            get {\n                return ResourceManager.GetString(\"CodeView_Devices\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Connect this project to a device with the fuse X Preview app installed on it..\n        /// </summary>\n        public static string CodeView_ToolTip {\n            get {\n                return ResourceManager.GetString(\"CodeView_ToolTip\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Browse.\n        /// </summary>\n        public static string Dashboard_Button_Browse {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Button_Browse\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Create.\n        /// </summary>\n        public static string Dashboard_Button_Create {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Button_Create\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Open.\n        /// </summary>\n        public static string Dashboard_Button_Open {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Button_Open\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Community.\n        /// </summary>\n        public static string Dashboard_Community {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Community\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Made something cool? Join a thriving\n        ///community of Fuse enthusiasts.\n        /// </summary>\n        public static string Dashboard_Community_Text {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Community_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Description.\n        /// </summary>\n        public static string Dashboard_Description {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Description\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Docs.\n        /// </summary>\n        public static string Dashboard_Docs {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Docs\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Need some technical information?\n        ///Search the reference docs..\n        /// </summary>\n        public static string Dashboard_Docs_Text {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Docs_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Last opened.\n        /// </summary>\n        public static string Dashboard_LastOpened {\n            get {\n                return ResourceManager.GetString(\"Dashboard_LastOpened\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Learn.\n        /// </summary>\n        public static string Dashboard_Learn {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Learn\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to New to Fuse? Explore our Handbook,\n        ///Tutorials and Examples..\n        /// </summary>\n        public static string Dashboard_Learn_Text {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Learn_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Location.\n        /// </summary>\n        public static string Dashboard_Location {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Location\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to New.\n        /// </summary>\n        public static string Dashboard_New_Prefix {\n            get {\n                return ResourceManager.GetString(\"Dashboard_New_Prefix\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Open.\n        /// </summary>\n        public static string Dashboard_Open_Prefix {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Open_Prefix\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Remove from list.\n        /// </summary>\n        public static string Dashboard_Project_Remove {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Project_Remove\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Recent Projects.\n        /// </summary>\n        public static string Dashboard_Recent_Projects {\n            get {\n                return ResourceManager.GetString(\"Dashboard_Recent_Projects\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Setup guide.\n        /// </summary>\n        public static string Dialog_SetupGuide_Caption {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_Caption\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to A text editor is required to use fuse X..\n        /// </summary>\n        public static string Dialog_SetupGuide_Comment1 {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_Comment1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to We recommend .\n        /// </summary>\n        public static string Dialog_SetupGuide_Comment2_1 {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_Comment2_1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to  or .\n        /// </summary>\n        public static string Dialog_SetupGuide_Comment2_2 {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_Comment2_2\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to , and our accompanying plugins..\n        /// </summary>\n        public static string Dialog_SetupGuide_Comment2_3 {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_Comment2_3\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to This wizard will look for the software on your system and help you install or update our plugins..\n        /// </summary>\n        public static string Dialog_SetupGuide_Comment3 {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_Comment3\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to We also have a plugin for .\n        /// </summary>\n        public static string Dialog_SetupGuide_SeeAlso1 {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_SeeAlso1\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to ..\n        /// </summary>\n        public static string Dialog_SetupGuide_SeeAlso2 {\n            get {\n                return ResourceManager.GetString(\"Dialog_SetupGuide_SeeAlso2\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Select something to get started.\n        /// </summary>\n        public static string Inspector_SelectSomething {\n            get {\n                return ResourceManager.GetString(\"Inspector_SelectSomething\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Mac only.\n        /// </summary>\n        public static string Label_MacOnly {\n            get {\n                return ResourceManager.GetString(\"Label_MacOnly\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Your language preference was updated.\n        ///\n        ///The new language will come into full effect next time you start fuse X..\n        /// </summary>\n        public static string LanguageUpdated_Text {\n            get {\n                return ResourceManager.GetString(\"LanguageUpdated_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Something went wrong while checking your license.\n        ///\n        ///This might be a temporary loss of service caused by problems in the network.\n        ///\n        ///Please try again later..\n        /// </summary>\n        public static string License_Error_Text {\n            get {\n                return ResourceManager.GetString(\"License_Error_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to All Output.\n        /// </summary>\n        public static string LogView_AllOutput {\n            get {\n                return ResourceManager.GetString(\"LogView_AllOutput\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Clear.\n        /// </summary>\n        public static string LogView_Tab_Clear {\n            get {\n                return ResourceManager.GetString(\"LogView_Tab_Clear\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Log.\n        /// </summary>\n        public static string LogView_Tab_Log {\n            get {\n                return ResourceManager.GetString(\"LogView_Tab_Log\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Problems.\n        /// </summary>\n        public static string LogView_Tab_Problems {\n            get {\n                return ResourceManager.GetString(\"LogView_Tab_Problems\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Edit.\n        /// </summary>\n        public static string MainMenu_Edit {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Edit\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Element.\n        /// </summary>\n        public static string MainMenu_Element {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Element\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Export.\n        /// </summary>\n        public static string MainMenu_Export {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Export\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to File.\n        /// </summary>\n        public static string MainMenu_File {\n            get {\n                return ResourceManager.GetString(\"MainMenu_File\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Help.\n        /// </summary>\n        public static string MainMenu_Help {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Help\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Preview.\n        /// </summary>\n        public static string MainMenu_Preview {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Preview\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Project.\n        /// </summary>\n        public static string MainMenu_Project {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Project\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Tools.\n        /// </summary>\n        public static string MainMenu_Tools {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Tools\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Viewport.\n        /// </summary>\n        public static string MainMenu_Viewport {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Viewport\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Window.\n        /// </summary>\n        public static string MainMenu_Window {\n            get {\n                return ResourceManager.GetString(\"MainMenu_Window\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Enter code.\n        /// </summary>\n        public static string NagScreen_Button_EnterCode {\n            get {\n                return ResourceManager.GetString(\"NagScreen_Button_EnterCode\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Sign in.\n        /// </summary>\n        public static string NagScreen_Button_SignIn {\n            get {\n                return ResourceManager.GetString(\"NagScreen_Button_SignIn\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to This is an unregistered copy.\n        /// </summary>\n        public static string NagScreen_Caption {\n            get {\n                return ResourceManager.GetString(\"NagScreen_Caption\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Would you like to activate now?.\n        /// </summary>\n        public static string NagScreen_Question {\n            get {\n                return ResourceManager.GetString(\"NagScreen_Question\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Hello! Thanks for trying out fuse X.\n        ///\n        ///Activation is required to use this software.\n        ///\n        ///Free Trial available:\n        ///• Try all fuse X has to offer for one month.\n        ///• No credit card required..\n        /// </summary>\n        public static string NagScreen_Text {\n            get {\n                return ResourceManager.GetString(\"NagScreen_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Copy.\n        /// </summary>\n        public static string SubMenu_Edit_Copy {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Edit_Copy\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Cut.\n        /// </summary>\n        public static string SubMenu_Edit_Cut {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Edit_Cut\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Delete.\n        /// </summary>\n        public static string SubMenu_Edit_Delete {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Edit_Delete\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Paste.\n        /// </summary>\n        public static string SubMenu_Edit_Paste {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Edit_Paste\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Select All.\n        /// </summary>\n        public static string SubMenu_Edit_SelectAll {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Edit_SelectAll\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Deselect.\n        /// </summary>\n        public static string SubMenu_Element_Deselect {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Element_Deselect\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Locate in editor.\n        /// </summary>\n        public static string SubMenu_Element_LocateInEditor {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Element_LocateInEditor\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Remove element.\n        /// </summary>\n        public static string SubMenu_Element_Remove {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Element_Remove\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Clean build files.\n        /// </summary>\n        public static string SubMenu_Export_Clean {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Export_Clean\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Export for Android.\n        /// </summary>\n        public static string SubMenu_Export_ExportForAndroid {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Export_ExportForAndroid\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Export for Android Emulator.\n        /// </summary>\n        public static string SubMenu_Export_ExportForAndroidEmulator {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Export_ExportForAndroidEmulator\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Export for Desktop (.NET).\n        /// </summary>\n        public static string SubMenu_Export_ExportForDotNet {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Export_ExportForDotNet\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Export for iOS.\n        /// </summary>\n        public static string SubMenu_Export_ExportForiOS {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Export_ExportForiOS\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Export for iOS Simulator.\n        /// </summary>\n        public static string SubMenu_Export_ExportForiOSSimulator {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Export_ExportForiOSSimulator\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Export for Desktop (native).\n        /// </summary>\n        public static string SubMenu_Export_ExportForNative {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Export_ExportForNative\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Exit.\n        /// </summary>\n        public static string SubMenu_File_Exit {\n            get {\n                return ResourceManager.GetString(\"SubMenu_File_Exit\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to New....\n        /// </summary>\n        public static string SubMenu_File_New {\n            get {\n                return ResourceManager.GetString(\"SubMenu_File_New\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Open....\n        /// </summary>\n        public static string SubMenu_File_Open {\n            get {\n                return ResourceManager.GetString(\"SubMenu_File_Open\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Quit.\n        /// </summary>\n        public static string SubMenu_File_Quit {\n            get {\n                return ResourceManager.GetString(\"SubMenu_File_Quit\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Community.\n        /// </summary>\n        public static string SubMenu_Help_Community {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Help_Community\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Documentation.\n        /// </summary>\n        public static string SubMenu_Help_Documentation {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Help_Documentation\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Examples.\n        /// </summary>\n        public static string SubMenu_Help_Examples {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Help_Examples\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Forums.\n        /// </summary>\n        public static string SubMenu_Help_Forums {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Help_Forums\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Report issue.\n        /// </summary>\n        public static string SubMenu_Help_ReportIssue {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Help_ReportIssue\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Tutorial.\n        /// </summary>\n        public static string SubMenu_Help_Tutorial {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Help_Tutorial\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Preview on Android.\n        /// </summary>\n        public static string SubMenu_Preview_Android {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_Android\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Preview on Android Emulator.\n        /// </summary>\n        public static string SubMenu_Preview_AndroidEmulator {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_AndroidEmulator\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Build flags.\n        /// </summary>\n        public static string SubMenu_Preview_BuildFlags {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_BuildFlags\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Preview on iOS.\n        /// </summary>\n        public static string SubMenu_Preview_iOS {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_iOS\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Preview on iOS Simulator.\n        /// </summary>\n        public static string SubMenu_Preview_iOSSimulator {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_iOSSimulator\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Preview on Desktop (native).\n        /// </summary>\n        public static string SubMenu_Preview_Native {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_Native\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Rebuild.\n        /// </summary>\n        public static string SubMenu_Preview_Rebuild {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_Rebuild\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Reconnect USB (Android).\n        /// </summary>\n        public static string SubMenu_Preview_Reconnect {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_Reconnect\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Refresh.\n        /// </summary>\n        public static string SubMenu_Preview_Refresh {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Preview_Refresh\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Open Project Folder.\n        /// </summary>\n        public static string SubMenu_Project_OpenFolder {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Project_OpenFolder\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Open in Sublime Text 3.\n        /// </summary>\n        public static string SubMenu_Project_OpenSublime {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Project_OpenSublime\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Open in Terminal.\n        /// </summary>\n        public static string SubMenu_Project_OpenTerminal {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Project_OpenTerminal\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Open in Visual Studio Code.\n        /// </summary>\n        public static string SubMenu_Project_OpenVSCode {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Project_OpenVSCode\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Sketch Import.\n        /// </summary>\n        public static string SubMenu_Project_SketchImport {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Project_SketchImport\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Print Uno config.\n        /// </summary>\n        public static string SubMenu_Tools_Config {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Tools_Config\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Install Atom plugin.\n        /// </summary>\n        public static string SubMenu_Tools_InstallAtomPlugin {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Tools_InstallAtomPlugin\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Install Android SDK.\n        /// </summary>\n        public static string SubMenu_Tools_InstallSDK {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Tools_InstallSDK\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Install Sublime Text 3 plugin.\n        /// </summary>\n        public static string SubMenu_Tools_InstallSublimePlugin {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Tools_InstallSublimePlugin\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Install Visual Studio Code extension.\n        /// </summary>\n        public static string SubMenu_Tools_InstallVSCodeExtension {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Tools_InstallVSCodeExtension\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Setup guide.\n        /// </summary>\n        public static string SubMenu_Tools_Setup {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Tools_Setup\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Check automatically.\n        /// </summary>\n        public static string SubMenu_Updates_CheckAutomatically {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Updates_CheckAutomatically\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Check for updates.\n        /// </summary>\n        public static string SubMenu_Updates_CheckForUpdates {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Updates_CheckForUpdates\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Do you want to download the latest version now?.\n        /// </summary>\n        public static string SubMenu_Updates_DownloadLatestQuestion {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Updates_DownloadLatestQuestion\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to There&apos;s an update available.\n        /// </summary>\n        public static string SubMenu_Updates_UpdateAvailable {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Updates_UpdateAvailable\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Close Viewport.\n        /// </summary>\n        public static string SubMenu_Viewport_Close {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Viewport_Close\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Select device.\n        /// </summary>\n        public static string SubMenu_Viewport_Device {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Viewport_Device\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Flip aspect.\n        /// </summary>\n        public static string SubMenu_Viewport_FlipAspect {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Viewport_FlipAspect\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Go back.\n        /// </summary>\n        public static string SubMenu_Viewport_Goback {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Viewport_Goback\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to New Viewport.\n        /// </summary>\n        public static string SubMenu_Viewport_New {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Viewport_New\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Restart.\n        /// </summary>\n        public static string SubMenu_Viewport_Restart {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Viewport_Restart\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Selection.\n        /// </summary>\n        public static string SubMenu_Viewport_Selection {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Viewport_Selection\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Compact mode.\n        /// </summary>\n        public static string SubMenu_Window_CompactMode {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Window_CompactMode\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Dark theme.\n        /// </summary>\n        public static string SubMenu_Window_DarkTheme {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Window_DarkTheme\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Keep window on top.\n        /// </summary>\n        public static string SubMenu_Window_KeepWindowOnTop {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Window_KeepWindowOnTop\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Language.\n        /// </summary>\n        public static string SubMenu_Window_Language {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Window_Language\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Light theme.\n        /// </summary>\n        public static string SubMenu_Window_LightTheme {\n            get {\n                return ResourceManager.GetString(\"SubMenu_Window_LightTheme\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Compact.\n        /// </summary>\n        public static string Toolbar_Compact_Button {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Compact_Button\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Switch between normal and compact mode. Click to switch mode..\n        /// </summary>\n        public static string Toolbar_Compact_Tooltip {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Compact_Tooltip\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Selection.\n        /// </summary>\n        public static string Toolbar_Selection_Button {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Selection_Button\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Enable to select elements in the app..\n        /// </summary>\n        public static string Toolbar_Selection_Tooltip {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Selection_Tooltip\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Enable to select elements in the app. Disable to interact with the app..\n        /// </summary>\n        public static string Toolbar_Selection_Tooltip2 {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Selection_Tooltip2\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Touch.\n        /// </summary>\n        public static string Toolbar_Touch_Button {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Touch_Button\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Enable to intract with the app..\n        /// </summary>\n        public static string Toolbar_Touch_Tooltip {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Touch_Tooltip\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Add Viewport.\n        /// </summary>\n        public static string Toolbar_Viewport_Button {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Viewport_Button\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Click to add a new Viewport..\n        /// </summary>\n        public static string Toolbar_Viewport_Tooltip {\n            get {\n                return ResourceManager.GetString(\"Toolbar_Viewport_Tooltip\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Create a class from elements in the\n        ///hierarchy and it will appear here.\n        /// </summary>\n        public static string Toolbox_CreateAClass_Text {\n            get {\n                return ResourceManager.GetString(\"Toolbox_CreateAClass_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Drag classes into the hierarchy \n        ///to insert instances of them.\n        /// </summary>\n        public static string Toolbox_DragClassesInto_Text {\n            get {\n                return ResourceManager.GetString(\"Toolbox_DragClassesInto_Text\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Make class from selection.\n        /// </summary>\n        public static string Toolbox_MakeClassFromSelection {\n            get {\n                return ResourceManager.GetString(\"Toolbox_MakeClassFromSelection\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Search your classes.\n        /// </summary>\n        public static string Toolbox_SearchYourClasses {\n            get {\n                return ResourceManager.GetString(\"Toolbox_SearchYourClasses\", resourceCulture);\n            }\n        }\n        \n        /// <summary>\n        ///   Looks up a localized string similar to Your classes.\n        /// </summary>\n        public static string Toolbox_YourClasses {\n            get {\n                return ResourceManager.GetString(\"Toolbox_YourClasses\", resourceCulture);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/fuse/locale/Strings.fr-FR.resx",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"Button_Browse\" xml:space=\"preserve\">\n    <value>Naviguer</value>\n  </data>\n  <data name=\"Button_Cancel\" xml:space=\"preserve\">\n    <value>Annuler</value>\n  </data>\n  <data name=\"Dashboard_Button_Browse\" xml:space=\"preserve\">\n    <value>Naviguer</value>\n  </data>\n  <data name=\"Dashboard_Button_Create\" xml:space=\"preserve\">\n    <value>Nouveau</value>\n  </data>\n  <data name=\"Dashboard_Button_Open\" xml:space=\"preserve\">\n    <value>Ouvrir</value>\n  </data>\n  <data name=\"Dashboard_Community\" xml:space=\"preserve\">\n    <value>Community</value>\n  </data>\n  <data name=\"Dashboard_Community_Text\" xml:space=\"preserve\">\n    <value>Vous avez fait quelque chose de cool? Joignez-vous à un\ncommunauté enthousiaste de Fuse</value>\n  </data>\n  <data name=\"Dashboard_Docs\" xml:space=\"preserve\">\n    <value>Docs</value>\n  </data>\n  <data name=\"Dashboard_Docs_Text\" xml:space=\"preserve\">\n    <value>Besoin d'information technique?\nRechercher les documents de référence.</value>\n  </data>\n  <data name=\"Dashboard_Learn\" xml:space=\"preserve\">\n    <value>Apprendre</value>\n  </data>\n  <data name=\"Dashboard_Learn_Text\" xml:space=\"preserve\">\n    <value>Nouveau sur Fuse ? Découvrez notre manuel,\nTutoriels et Exemples.</value>\n  </data>\n  <data name=\"Dashboard_Project_Remove\" xml:space=\"preserve\">\n    <value>Retirer de la liste</value>\n  </data>\n  <data name=\"Dashboard_Recent_Projects\" xml:space=\"preserve\">\n    <value>Projets Récent</value>\n  </data>\n  <data name=\"Dashboard_LastOpened\" xml:space=\"preserve\">\n    <value>Dernière ouverture</value>\n  </data>\n  <data name=\"Dashboard_Location\" xml:space=\"preserve\">\n    <value>Emplacement</value>\n  </data>\n  <data name=\"Dashboard_Description\" xml:space=\"preserve\">\n    <value>La description</value>\n  </data>\n  <data name=\"Dashboard_New_Prefix\" xml:space=\"preserve\">\n    <value>New</value>\n  </data>\n  <data name=\"Dashboard_Open_Prefix\" xml:space=\"preserve\">\n    <value>Open</value>\n  </data>\n  <data name=\"MainMenu_Edit\" xml:space=\"preserve\">\n    <value>Editer</value>\n  </data>\n  <data name=\"MainMenu_Element\" xml:space=\"preserve\">\n    <value>Element</value>\n  </data>\n  <data name=\"MainMenu_Export\" xml:space=\"preserve\">\n    <value>Exporter</value>\n  </data>\n  <data name=\"MainMenu_File\" xml:space=\"preserve\">\n    <value>Fichier</value>\n  </data>\n  <data name=\"MainMenu_Help\" xml:space=\"preserve\">\n    <value>Aide</value>\n  </data>\n  <data name=\"MainMenu_Preview\" xml:space=\"preserve\">\n    <value>Aperçu</value>\n  </data>\n  <data name=\"MainMenu_Project\" xml:space=\"preserve\">\n    <value>Projet</value>\n  </data>\n  <data name=\"MainMenu_Tools\" xml:space=\"preserve\">\n    <value>Outils</value>\n  </data>\n  <data name=\"MainMenu_Viewport\" xml:space=\"preserve\">\n    <value>Fenêtre</value>\n  </data>\n  <data name=\"MainMenu_Window\" xml:space=\"preserve\">\n    <value>Fenêtre</value>\n  </data>\n  <data name=\"SubMenu_Edit_Copy\" xml:space=\"preserve\">\n    <value>Copier</value>\n  </data>\n  <data name=\"SubMenu_Edit_Cut\" xml:space=\"preserve\">\n    <value>Couper</value>\n  </data>\n  <data name=\"SubMenu_Edit_Delete\" xml:space=\"preserve\">\n    <value>Supprimer</value>\n  </data>\n  <data name=\"SubMenu_Edit_Paste\" xml:space=\"preserve\">\n    <value>Coller</value>\n  </data>\n  <data name=\"SubMenu_Edit_SelectAll\" xml:space=\"preserve\">\n    <value>Tout Selectionner</value>\n  </data>\n  <data name=\"SubMenu_Element_Deselect\" xml:space=\"preserve\">\n    <value>Déselectionner</value>\n  </data>\n  <data name=\"SubMenu_Element_LocateInEditor\" xml:space=\"preserve\">\n    <value>Localiser dans l'éditeur</value>\n  </data>\n  <data name=\"SubMenu_Element_Remove\" xml:space=\"preserve\">\n    <value>Supprimer l'élement</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForAndroid\" xml:space=\"preserve\">\n    <value>Exporter pour Android</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForAndroidEmulator\" xml:space=\"preserve\">\n    <value>Exporter pour l'Emulateur Android</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForiOS\" xml:space=\"preserve\">\n    <value>Exporter pour iOS</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForiOSSimulator\" xml:space=\"preserve\">\n    <value>Exporter pour le Simulateur iOS</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForDotNet\" xml:space=\"preserve\">\n    <value>Exporter pour le bureau (.NET)</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForNative\" xml:space=\"preserve\">\n    <value>Exporter pour le Bureau (natif)</value>\n  </data>\n  <data name=\"SubMenu_Export_Clean\" xml:space=\"preserve\">\n    <value>Clean build files</value>\n  </data>\n  <data name=\"SubMenu_File_New\" xml:space=\"preserve\">\n    <value>Nouveau...</value>\n  </data>\n  <data name=\"SubMenu_File_Open\" xml:space=\"preserve\">\n    <value>Ouvrir...</value>\n  </data>\n  <data name=\"SubMenu_File_Quit\" xml:space=\"preserve\">\n    <value>Quitter</value>\n  </data>\n  <data name=\"SubMenu_File_Exit\" xml:space=\"preserve\">\n    <value>Sortir</value>\n  </data>\n  <data name=\"SubMenu_Help_Community\" xml:space=\"preserve\">\n    <value>Community</value>\n  </data>\n  <data name=\"SubMenu_Help_Documentation\" xml:space=\"preserve\">\n    <value>Documentation</value>\n  </data>\n  <data name=\"SubMenu_Help_Examples\" xml:space=\"preserve\">\n    <value>Exemples</value>\n  </data>\n  <data name=\"SubMenu_Help_Tutorial\" xml:space=\"preserve\">\n    <value>Tutoriel</value>\n  </data>\n  <data name=\"SubMenu_Help_Forums\" xml:space=\"preserve\">\n    <value>Forums</value>\n  </data>\n  <data name=\"SubMenu_Help_ReportIssue\" xml:space=\"preserve\">\n    <value>Rapporter une erreur</value>\n  </data>\n  <data name=\"SubMenu_Updates_CheckForUpdates\" xml:space=\"preserve\">\n    <value>Vérifier les mises à jours</value>\n  </data>\n  <data name=\"SubMenu_Updates_CheckAutomatically\" xml:space=\"preserve\">\n    <value>Vérifier automatiquement</value>\n  </data>\n  <data name=\"SubMenu_Updates_UpdateAvailable\" xml:space=\"preserve\">\n    <value>Une mise à jour est disponible</value>\n  </data>\n  <data name=\"SubMenu_Updates_DownloadLatestQuestion\" xml:space=\"preserve\">\n    <value>Voulez-vous télécharger la dernière version maintenant?</value>\n  </data>\n  <data name=\"SubMenu_Preview_Android\" xml:space=\"preserve\">\n    <value>Aperçu sur Android</value>\n  </data>\n  <data name=\"SubMenu_Preview_AndroidEmulator\" xml:space=\"preserve\">\n    <value>Aperçu sur l'emulateur Android</value>\n  </data>\n  <data name=\"SubMenu_Preview_BuildFlags\" xml:space=\"preserve\">\n    <value>Build flags</value>\n  </data>\n  <data name=\"SubMenu_Preview_iOS\" xml:space=\"preserve\">\n    <value>Aperçu on iOS</value>\n  </data>\n  <data name=\"SubMenu_Preview_iOSSimulator\" xml:space=\"preserve\">\n    <value>Aperçu sur le Simulateur iOS</value>\n  </data>\n  <data name=\"SubMenu_Preview_Native\" xml:space=\"preserve\">\n    <value>Aperçu sur le PC (native)</value>\n  </data>\n  <data name=\"SubMenu_Preview_Rebuild\" xml:space=\"preserve\">\n    <value>Reconstruire</value>\n  </data>\n  <data name=\"SubMenu_Preview_Reconnect\" xml:space=\"preserve\">\n    <value>Reconnecter USB (Android)</value>\n  </data>\n  <data name=\"SubMenu_Preview_Refresh\" xml:space=\"preserve\">\n    <value>Rafraichir</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenFolder\" xml:space=\"preserve\">\n    <value>Ouvrir le Dossier du Projet</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenSublime\" xml:space=\"preserve\">\n    <value>Ouvrir dans Sublime Text 3</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenVSCode\" xml:space=\"preserve\">\n    <value>Ouvrir dans Visual Studio Code</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenTerminal\" xml:space=\"preserve\">\n    <value>Ouvrir dans le Terminal</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallSDK\" xml:space=\"preserve\">\n    <value>Installer le SDK AndroidK</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallAtomPlugin\" xml:space=\"preserve\">\n    <value>Installer le plugin Atom</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallSublimePlugin\" xml:space=\"preserve\">\n    <value>Installer le plugin Sublime Text 3</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallVSCodeExtension\" xml:space=\"preserve\">\n    <value>Installer l'extention Visual Studio Code</value>\n  </data>\n  <data name=\"SubMenu_Tools_Setup\" xml:space=\"preserve\">\n    <value>Guide d'installation</value>\n  </data>\n  <data name=\"SubMenu_Tools_Config\" xml:space=\"preserve\">\n    <value>Afficher Uno config</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Close\" xml:space=\"preserve\">\n    <value>Fermer la fenêtre</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Device\" xml:space=\"preserve\">\n    <value>Selectionner le terminal</value>\n  </data>\n  <data name=\"SubMenu_Viewport_FlipAspect\" xml:space=\"preserve\">\n    <value>Inverser l'aspect</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Goback\" xml:space=\"preserve\">\n    <value>Retour</value>\n  </data>\n  <data name=\"SubMenu_Viewport_New\" xml:space=\"preserve\">\n    <value>Nouvelle fenêtre</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Restart\" xml:space=\"preserve\">\n    <value>Redémarrer</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Selection\" xml:space=\"preserve\">\n    <value>Selectionner</value>\n  </data>\n  <data name=\"SubMenu_Window_CompactMode\" xml:space=\"preserve\">\n    <value>Mode compact</value>\n  </data>\n  <data name=\"SubMenu_Window_KeepWindowOnTop\" xml:space=\"preserve\">\n    <value>Garder la fenêtre au dessus</value>\n  </data>\n  <data name=\"SubMenu_Window_Language\" xml:space=\"preserve\">\n    <value>Langue</value>\n  </data>\n  <data name=\"SubMenu_Window_LightTheme\" xml:space=\"preserve\">\n    <value>Thème lumière</value>\n  </data>\n  <data name=\"SubMenu_Window_DarkTheme\" xml:space=\"preserve\">\n    <value>Thème sombre</value>\n  </data>\n  <data name=\"Button_Ok\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Caption\" xml:space=\"preserve\">\n    <value>Guide d'installation</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment1\" xml:space=\"preserve\">\n    <value>Un éditeur de texte est nécessaire pour utiliser fuse X.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_1\" xml:space=\"preserve\">\n    <value>Nous recommandons </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_2\" xml:space=\"preserve\">\n    <value> ou </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_3\" xml:space=\"preserve\">\n    <value>, et nos plugins d'accompagnement.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment3\" xml:space=\"preserve\">\n    <value>Cet assistant recherchera le logiciel sur votre système et vous aidera à installer ou à mettre à jour nos plugins.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_SeeAlso1\" xml:space=\"preserve\">\n    <value>Nous avons également un plugin pour </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_SeeAlso2\" xml:space=\"preserve\">\n    <value>.</value>\n  </data>\n  <data name=\"SubMenu_Project_SketchImport\" xml:space=\"preserve\">\n    <value>Importater Sketch</value>\n  </data>\n  <data name=\"Button_Done\" xml:space=\"preserve\">\n    <value>Fait</value>\n  </data>\n  <data name=\"LogView_Tab_Clear\" xml:space=\"preserve\">\n    <value>Effacer</value>\n  </data>\n  <data name=\"LogView_Tab_Log\" xml:space=\"preserve\">\n    <value>Journal</value>\n  </data>\n  <data name=\"LogView_Tab_Problems\" xml:space=\"preserve\">\n    <value>Problèmes</value>\n  </data>\n  <data name=\"Label_MacOnly\" xml:space=\"preserve\">\n    <value>Mac uniquement</value>\n  </data>\n  <data name=\"LanguageUpdated_Text\" xml:space=\"preserve\">\n    <value>Votre préférence linguistique a été mise à jour.\n\nLa nouvelle langue entrera pleinement en vigueur la prochaine fois que vous démarrerez fuse X.</value>\n  </data>\n  <data name=\"NagScreen_Caption\" xml:space=\"preserve\">\n    <value>Ceci est une copie non enregistrée</value>\n  </data>\n  <data name=\"NagScreen_Text\" xml:space=\"preserve\">\n    <value>Bonjour! Merci d'avoir essayé le fuse X.\n\nL'activation est nécessaire pour utiliser ce logiciel.\n\nEssai gratuit disponible :\n• Essayez tout ce que fuse X a à offrir pendant un mois.\n• Pas de carte de crédit nécessaire.</value>\n  </data>\n  <data name=\"NagScreen_Button_SignIn\" xml:space=\"preserve\">\n    <value>Se connecter</value>\n  </data>\n  <data name=\"NagScreen_Button_EnterCode\" xml:space=\"preserve\">\n    <value>Entrer le code</value>\n  </data>\n  <data name=\"NagScreen_Question\" xml:space=\"preserve\">\n    <value>Souhaitez-vous activer maintenant?</value>\n  </data>\n  <data name=\"Toolbar_Selection_Tooltip\" xml:space=\"preserve\">\n    <value>Activer pour sélectionner des éléments dans l'application.</value>\n  </data>\n  <data name=\"Toolbar_Selection_Tooltip2\" xml:space=\"preserve\">\n    <value>Activer pour sélectionner des éléments dans l'application. Désactiver pour interagir avec l'application.</value>\n  </data>\n  <data name=\"Toolbar_Selection_Button\" xml:space=\"preserve\">\n    <value>Selection</value>\n  </data>\n  <data name=\"Toolbar_Touch_Tooltip\" xml:space=\"preserve\">\n    <value>Activer pour interagir avec l'application.</value>\n  </data>\n  <data name=\"Toolbar_Touch_Button\" xml:space=\"preserve\">\n    <value>Toucher</value>\n  </data>\n  <data name=\"Toolbar_Viewport_Tooltip\" xml:space=\"preserve\">\n    <value>Cliquez pour ajouter une nouvelle fenêtre.</value>\n  </data>\n  <data name=\"Toolbar_Viewport_Button\" xml:space=\"preserve\">\n    <value>Ajouter une fenêtre</value>\n  </data>\n  <data name=\"Toolbar_Compact_Tooltip\" xml:space=\"preserve\">\n    <value>Basculer entre le mode normal et le mode compact. Cliquez pour changer de mode.</value>\n  </data>\n  <data name=\"Toolbar_Compact_Button\" xml:space=\"preserve\">\n    <value>Compact</value>\n  </data>\n  <data name=\"Auth_Text_LicensedTo1\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"Auth_Text_LicensedTo2\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"Auth_Text_TrialDayLeft\" xml:space=\"preserve\">\n    <value>jour d'essai restant</value>\n  </data>\n  <data name=\"Auth_Text_TrialDaysLeft\" xml:space=\"preserve\">\n    <value>jour d'essai restant</value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired1\" xml:space=\"preserve\">\n    <value>Votre licence a expirer?. S'il vous plait </value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired2\" xml:space=\"preserve\">\n    <value>se connecter</value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired3\" xml:space=\"preserve\">\n    <value> pour réactiver.</value>\n  </data>\n  <data name=\"Auth_Text_SignIn1\" xml:space=\"preserve\">\n    <value>S'il vous plait </value>\n  </data>\n  <data name=\"Auth_Text_SignIn2\" xml:space=\"preserve\">\n    <value>se connecter</value>\n  </data>\n  <data name=\"Auth_Text_SignIn3\" xml:space=\"preserve\">\n    <value> pour activer fuse X</value>\n  </data>\n  <data name=\"About_Title\" xml:space=\"preserve\">\n    <value>A propos de fuse X</value>\n  </data>\n  <data name=\"About_Menu\" xml:space=\"preserve\">\n    <value>A Propos</value>\n  </data>\n  <data name=\"About_RegisteredTo\" xml:space=\"preserve\">\n    <value>Enregistré à</value>\n  </data>\n  <data name=\"About_NotRegistered\" xml:space=\"preserve\">\n    <value>Pas enregistrer</value>\n  </data>\n  <data name=\"About_Company\" xml:space=\"preserve\">\n    <value>Compagnie: </value>\n  </data>\n  <data name=\"About_License\" xml:space=\"preserve\">\n    <value>License: </value>\n  </data>\n  <data name=\"About_Issued\" xml:space=\"preserve\">\n    <value>Delivré: </value>\n  </data>\n  <data name=\"About_Expires\" xml:space=\"preserve\">\n    <value>Expires: </value>\n  </data>\n  <data name=\"About_Authority\" xml:space=\"preserve\">\n    <value>Autorité: </value>\n  </data>\n  <data name=\"About_MoreInfo1\" xml:space=\"preserve\">\n    <value>Pour plus d'information visiter notre </value>\n  </data>\n  <data name=\"About_MoreInfo2\" xml:space=\"preserve\">\n    <value>site web</value>\n  </data>\n  <data name=\"Activate_Title\" xml:space=\"preserve\">\n    <value>Entrer le code d'activation</value>\n  </data>\n  <data name=\"Activate_Button\" xml:space=\"preserve\">\n    <value>Activer fuse X</value>\n  </data>\n  <data name=\"Activate_FeedbackEmpty\" xml:space=\"preserve\">\n    <value>Merci de saisir le code d'activation.</value>\n  </data>\n  <data name=\"Activate_FeedbackInvalid\" xml:space=\"preserve\">\n    <value>Ce code d'activation est invalide.</value>\n  </data>\n  <data name=\"License_Error_Text\" xml:space=\"preserve\">\n    <value>Une erreur s'est produite lors de la vérification de votre licence.\n\nIl peut s'agir d'une perte de service temporaire causée par des problèmes sur le réseau.\n\nVeuillez réessayer plus tard.</value>\n  </data>\n  <data name=\"Inspector_SelectSomething\" xml:space=\"preserve\">\n    <value>Sélectionnez quelque chose pour commencer</value>\n  </data>\n  <data name=\"Toolbox_MakeClassFromSelection\" xml:space=\"preserve\">\n    <value>Créer une classe à partir de la sélection</value>\n  </data>\n  <data name=\"Toolbox_YourClasses\" xml:space=\"preserve\">\n    <value>Vos classes</value>\n  </data>\n  <data name=\"Toolbox_SearchYourClasses\" xml:space=\"preserve\">\n    <value>Rechercher vos cours</value>\n  </data>\n  <data name=\"Toolbox_DragClassesInto_Text\" xml:space=\"preserve\">\n    <value>Faites glisser les classes dans la hiérarchie\npour en insérer des instances</value>\n  </data>\n  <data name=\"Toolbox_CreateAClass_Text\" xml:space=\"preserve\">\n    <value>Créer une classe à partir d'éléments dans le\nhiérarchie et il apparaîtra ici</value>\n  </data>\n  <data name=\"CodeView_Devices\" xml:space=\"preserve\">\n    <value>Dispositifs</value>\n  </data>\n  <data name=\"CodeView_ToolTip\" xml:space=\"preserve\">\n    <value>Connectez ce projet à un appareil sur lequel l'application fuse X Preview est installée.</value>\n  </data>\n  <data name=\"LogView_AllOutput\" xml:space=\"preserve\">\n    <value>Toutes les sorties</value>\n  </data>\n</root>"
  },
  {
    "path": "src/fuse/locale/Strings.ko-KR.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"Button_Browse\" xml:space=\"preserve\">\n    <value>폴더선택</value>\n  </data>\n  <data name=\"Button_Cancel\" xml:space=\"preserve\">\n    <value>취소</value>\n  </data>\n  <data name=\"Dashboard_Button_Browse\" xml:space=\"preserve\">\n    <value>프로젝트 찾기</value>\n  </data>\n  <data name=\"Dashboard_Button_Create\" xml:space=\"preserve\">\n    <value>프로젝트 생성</value>\n  </data>\n  <data name=\"Dashboard_Button_Open\" xml:space=\"preserve\">\n    <value>프로젝트 열기</value>\n  </data>\n  <data name=\"Dashboard_Community\" xml:space=\"preserve\">\n    <value>커뮤니티</value>\n  </data>\n  <data name=\"Dashboard_Community_Text1\" xml:space=\"preserve\">\n    <value>멋지게 만들었습니까?</value>\n  </data>\n  <data name=\"Dashboard_Community_Text2\" xml:space=\"preserve\">\n    <value>Fuse를 지지하는 커뮤니티에 가입하세요.</value>\n  </data>\n  <data name=\"Dashboard_Docs\" xml:space=\"preserve\">\n    <value>기술문서</value>\n  </data>\n  <data name=\"Dashboard_Docs_Text1\" xml:space=\"preserve\">\n    <value>기술적인 정보가 필요하십니까?</value>\n  </data>\n  <data name=\"Dashboard_Docs_Text2\" xml:space=\"preserve\">\n    <value>참조 문서를 검색해 보세요.</value>\n  </data>\n  <data name=\"Dashboard_Learn\" xml:space=\"preserve\">\n    <value>학습하기</value>\n  </data>\n  <data name=\"Dashboard_Learn_Text1\" xml:space=\"preserve\">\n    <value>퓨즈를 처음 사용하십니까? 기술문서,</value>\n  </data>\n  <data name=\"Dashboard_Learn_Text2\" xml:space=\"preserve\">\n    <value>튜토리얼 및 예제를 탐색해 보세요.</value>\n  </data>\n  <data name=\"Dashboard_Project_Remove\" xml:space=\"preserve\">\n    <value>목록에서 제거</value>\n  </data>\n  <data name=\"Dashboard_Recent_Projects\" xml:space=\"preserve\">\n    <value>최근 프로젝트</value>\n  </data>\n  <data name=\"Dashboard_LastOpened\" xml:space=\"preserve\">\n    <value>마지막으로 열림</value>\n  </data>\n  <data name=\"Dashboard_Location\" xml:space=\"preserve\">\n    <value>위치</value>\n  </data>\n  <data name=\"Dashboard_Description\" xml:space=\"preserve\">\n    <value>설명</value>\n  </data>\n  <data name=\"Dashboard_New_Prefix\" xml:space=\"preserve\">\n    <value>New</value>\n  </data>\n  <data name=\"Dashboard_Open_Prefix\" xml:space=\"preserve\">\n    <value>Open</value>\n  </data>\n  <data name=\"MainMenu_Edit\" xml:space=\"preserve\">\n    <value>편집</value>\n  </data>\n  <data name=\"MainMenu_Element\" xml:space=\"preserve\">\n    <value>구성요소</value>\n  </data>\n  <data name=\"MainMenu_Export\" xml:space=\"preserve\">\n    <value>내보내기</value>\n  </data>\n  <data name=\"MainMenu_File\" xml:space=\"preserve\">\n    <value>파일</value>\n  </data>\n  <data name=\"MainMenu_Help\" xml:space=\"preserve\">\n    <value>도움말</value>\n  </data>\n  <data name=\"MainMenu_Preview\" xml:space=\"preserve\">\n    <value>미리보기</value>\n  </data>\n  <data name=\"MainMenu_Project\" xml:space=\"preserve\">\n    <value>프로젝트</value>\n  </data>\n  <data name=\"MainMenu_Tools\" xml:space=\"preserve\">\n    <value>도구</value>\n  </data>\n  <data name=\"MainMenu_Viewport\" xml:space=\"preserve\">\n    <value>뷰포트</value>\n  </data>\n  <data name=\"MainMenu_Window\" xml:space=\"preserve\">\n    <value>윈도우</value>\n  </data>\n  <data name=\"SubMenu_Edit_Copy\" xml:space=\"preserve\">\n    <value>복사하기</value>\n  </data>\n  <data name=\"SubMenu_Edit_Cut\" xml:space=\"preserve\">\n    <value>잘라내기</value>\n  </data>\n  <data name=\"SubMenu_Edit_Delete\" xml:space=\"preserve\">\n    <value>삭제하기</value>\n  </data>\n  <data name=\"SubMenu_Edit_Paste\" xml:space=\"preserve\">\n    <value>붙여넣기</value>\n  </data>\n  <data name=\"SubMenu_Edit_SelectAll\" xml:space=\"preserve\">\n    <value>전체선택</value>\n  </data>\n  <data name=\"SubMenu_Element_Deselect\" xml:space=\"preserve\">\n    <value>선택 취소</value>\n  </data>\n  <data name=\"SubMenu_Element_LocateInEditor\" xml:space=\"preserve\">\n    <value>편집기에서 찾기</value>\n  </data>\n  <data name=\"SubMenu_Element_Remove\" xml:space=\"preserve\">\n    <value>구성요소 제거</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForAndroid\" xml:space=\"preserve\">\n    <value>안드로이드로 내보내기</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForAndroidEmulator\" xml:space=\"preserve\">\n    <value>Android Emulator로 내보내기</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForiOS\" xml:space=\"preserve\">\n    <value>iOS로 내보내기</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForiOSSimulator\" xml:space=\"preserve\">\n    <value>iOS Simulator로 내보내기</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForDotNet\" xml:space=\"preserve\">\n    <value>Desktop (.NET)로 내보내기</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForNative\" xml:space=\"preserve\">\n    <value>Desktop (native)로 내보내기</value>\n  </data>\n  <data name=\"SubMenu_Export_Clean\" xml:space=\"preserve\">\n    <value>Clean build files</value>\n  </data>\n  <data name=\"SubMenu_File_New\" xml:space=\"preserve\">\n    <value>새 프로젝트</value>\n  </data>\n  <data name=\"SubMenu_File_Open\" xml:space=\"preserve\">\n    <value>프로젝트 열기</value>\n  </data>\n  <data name=\"SubMenu_File_Quit\" xml:space=\"preserve\">\n    <value>그만두다</value>\n  </data>\n  <data name=\"SubMenu_File_Exit\" xml:space=\"preserve\">\n    <value>출구</value>\n  </data>\n  <data name=\"SubMenu_Help_Community\" xml:space=\"preserve\">\n    <value>커뮤니티</value>\n  </data>\n  <data name=\"SubMenu_Help_Documentation\" xml:space=\"preserve\">\n    <value>기술문서</value>\n  </data>\n  <data name=\"SubMenu_Help_Examples\" xml:space=\"preserve\">\n    <value>예제 둘러보기</value>\n  </data>\n  <data name=\"SubMenu_Help_Tutorial\" xml:space=\"preserve\">\n    <value>Tutorial 튜토리얼</value>\n  </data>\n  <data name=\"SubMenu_Help_Forums\" xml:space=\"preserve\">\n    <value>Forums 포럼</value>\n  </data>\n  <data name=\"SubMenu_Help_ReportIssue\" xml:space=\"preserve\">\n    <value>Report issue 문제보고</value>\n  </data>\n  <data name=\"SubMenu_Updates_CheckForUpdates\" xml:space=\"preserve\">\n    <value>업데이트 확인</value>\n  </data>\n  <data name=\"SubMenu_Updates_CheckAutomatically\" xml:space=\"preserve\">\n    <value>자동업데이트 확인</value>\n  </data>\n  <data name=\"SubMenu_Updates_UpdateAvailable\" xml:space=\"preserve\">\n    <value>유효한 업데이트가 있습니다.</value>\n  </data>\n  <data name=\"SubMenu_Updates_DownloadLatestQuestion\" xml:space=\"preserve\">\n    <value>지금 최신 버전을 다운로드하시겠습니까?</value>\n  </data>\n  <data name=\"SubMenu_Preview_Android\" xml:space=\"preserve\">\n    <value>안드로이드로 미리보기</value>\n  </data>\n  <data name=\"SubMenu_Preview_AndroidEmulator\" xml:space=\"preserve\">\n    <value>Android Emulator 미리보기</value>\n  </data>\n  <data name=\"SubMenu_Preview_BuildFlags\" xml:space=\"preserve\">\n    <value>Build flags</value>\n  </data>\n  <data name=\"SubMenu_Preview_iOS\" xml:space=\"preserve\">\n    <value>iOS로 미리보기</value>\n  </data>\n  <data name=\"SubMenu_Preview_iOSSimulator\" xml:space=\"preserve\">\n    <value>iOS Simulator 미리 보기</value>\n  </data>\n  <data name=\"SubMenu_Preview_Native\" xml:space=\"preserve\">\n    <value>Desktop (native)로 미리보기</value>\n  </data>\n  <data name=\"SubMenu_Preview_Rebuild\" xml:space=\"preserve\">\n    <value>다시 빌드</value>\n  </data>\n  <data name=\"SubMenu_Preview_Reconnect\" xml:space=\"preserve\">\n    <value>USB 다시 연결(Android)</value>\n  </data>\n  <data name=\"SubMenu_Preview_Refresh\" xml:space=\"preserve\">\n    <value>새로고침</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenFolder\" xml:space=\"preserve\">\n    <value>프로젝트 폴더 열기</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenSublime\" xml:space=\"preserve\">\n    <value>Sublime Text 3으로 열기</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenVSCode\" xml:space=\"preserve\">\n    <value>Visual Studio Code으로 열기</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenTerminal\" xml:space=\"preserve\">\n    <value>터미널에서 열기</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallSDK\" xml:space=\"preserve\">\n    <value>Android SDK 설치</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallAtomPlugin\" xml:space=\"preserve\">\n    <value>Atom plugin 설치</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallSublimePlugin\" xml:space=\"preserve\">\n    <value>Sublime Text 3 plugin 설치</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallVSCodeExtension\" xml:space=\"preserve\">\n    <value>Visual Studio Code extension 설치</value>\n  </data>\n  <data name=\"SubMenu_Tools_Setup\" xml:space=\"preserve\">\n    <value>설치 가이드</value>\n  </data>\n  <data name=\"SubMenu_Tools_Config\" xml:space=\"preserve\">\n    <value>Uno 환경 출력</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Close\" xml:space=\"preserve\">\n    <value>뷰포트 닫기</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Device\" xml:space=\"preserve\">\n    <value>Select device 디바이스 선택</value>\n  </data>\n  <data name=\"SubMenu_Viewport_FlipAspect\" xml:space=\"preserve\">\n    <value>Flip aspect</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Goback\" xml:space=\"preserve\">\n    <value>되돌리기</value>\n  </data>\n  <data name=\"SubMenu_Viewport_New\" xml:space=\"preserve\">\n    <value>새 뷰포트</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Restart\" xml:space=\"preserve\">\n    <value>재시작</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Selection\" xml:space=\"preserve\">\n    <value>선택모드</value>\n  </data>\n  <data name=\"SubMenu_Window_CompactMode\" xml:space=\"preserve\">\n    <value>축소모드</value>\n  </data>\n  <data name=\"SubMenu_Window_KeepWindowOnTop\" xml:space=\"preserve\">\n    <value>화면최상위유지</value>\n  </data>\n  <data name=\"SubMenu_Window_Language\" xml:space=\"preserve\">\n    <value>언어</value>\n  </data>\n  <data name=\"SubMenu_Window_LightTheme\" xml:space=\"preserve\">\n    <value>밝은 테마</value>\n  </data>\n  <data name=\"SubMenu_Window_DarkTheme\" xml:space=\"preserve\">\n    <value>어두운 테마</value>\n  </data>\n  <data name=\"Button_Ok\" xml:space=\"preserve\">\n    <value>확인</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Caption\" xml:space=\"preserve\">\n    <value>설치 가이드</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment1\" xml:space=\"preserve\">\n    <value>fuse X를 사용하려면 텍스트 편집기가 필요합니다.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_1\" xml:space=\"preserve\">\n    <value>We recommend </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_2\" xml:space=\"preserve\">\n    <value> or </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_3\" xml:space=\"preserve\">\n    <value>, and our accompanying plugins.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment3\" xml:space=\"preserve\">\n    <value>이 마법사는 시스템에서 소프트웨어를 찾고 플러그인 설치 또는 업데이트를 도와줍니다.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_SeeAlso1\" xml:space=\"preserve\">\n    <value>We also have a plugin for </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_SeeAlso2\" xml:space=\"preserve\">\n    <value>.</value>\n  </data>\n  <data name=\"SubMenu_Project_SketchImport\" xml:space=\"preserve\">\n    <value>Sketch 가져오기</value>\n  </data>\n  <data name=\"Button_Done\" xml:space=\"preserve\">\n    <value>실행</value>\n  </data>\n  <data name=\"LogView_Tab_Clear\" xml:space=\"preserve\">\n    <value>지우기</value>\n  </data>\n  <data name=\"LogView_Tab_Log\" xml:space=\"preserve\">\n    <value>로그</value>\n  </data>\n  <data name=\"LogView_Tab_Problems\" xml:space=\"preserve\">\n    <value>문제점</value>\n  </data>\n  <data name=\"Label_MacOnly\" xml:space=\"preserve\">\n    <value>Mac 만</value>\n  </data>\n  <data name=\"LanguageUpdated_Text\" xml:space=\"preserve\">\n    <value>언어 기본 설정이 업데이트되었습니다.\n\n새 언어는 다음에 fuse X를 시작할 때 완전히 적용됩니다.</value>\n  </data>\n  <data name=\"NagScreen_Caption\" xml:space=\"preserve\">\n    <value>등록되지 않은 프로그램입니다.</value>\n  </data>\n  <data name=\"NagScreen_Text\" xml:space=\"preserve\">\n    <value>퓨즈 X를 사용해 주셔서 감사합니다.\n\n이 소프트웨어를 사용하려면 활성화가 필요합니다.\n\n무료 평가판 사용 가능:\n• 한 달 동안 fuse X가 제공하는 모든 것을 사용해 보십시오.\n• 신용 카드가 필요하지 않습니다.</value>\n  </data>\n  <data name=\"NagScreen_Button_SignIn\" xml:space=\"preserve\">\n    <value>로그인</value>\n  </data>\n  <data name=\"NagScreen_Button_EnterCode\" xml:space=\"preserve\">\n    <value>코드 입력</value>\n  </data>\n  <data name=\"NagScreen_Question\" xml:space=\"preserve\">\n    <value>지금 활성화하시겠습니까?</value>\n  </data>\n  <data name=\"Toolbar_Selection_Tooltip\" xml:space=\"preserve\">\n    <value>앱에서 요소를 선택할 수 있습니다.</value>\n  </data>\n  <data name=\"Toolbar_Selection_Tooltip2\" xml:space=\"preserve\">\n    <value>앱에서 요소를 선택할 수 있습니다. 앱과 상호 작용할 수 없습니다.</value>\n  </data>\n  <data name=\"Toolbar_Selection_Button\" xml:space=\"preserve\">\n    <value>선택모드</value>\n  </data>\n  <data name=\"Toolbar_Touch_Tooltip\" xml:space=\"preserve\">\n    <value>앱과 상호 작용할 수 있습니다.</value>\n  </data>\n  <data name=\"Toolbar_Touch_Button\" xml:space=\"preserve\">\n    <value>실행모드</value>\n  </data>\n  <data name=\"Toolbar_Viewport_Tooltip\" xml:space=\"preserve\">\n    <value>새 뷰포트를 추가하려면 클릭하십시오.</value>\n  </data>\n  <data name=\"Toolbar_Viewport_Button\" xml:space=\"preserve\">\n    <value>새 뷰포트</value>\n  </data>\n  <data name=\"Toolbar_Compact_Tooltip\" xml:space=\"preserve\">\n    <value>일반 모드와 축소 모드 간을 전환합니다. 모드를 전환하려면 클릭하십시오.</value>\n  </data>\n  <data name=\"Toolbar_Compact_Button\" xml:space=\"preserve\">\n    <value>축소모드</value>\n  </data>\n  <data name=\"Auth_Text_LicensedTo1\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"Auth_Text_LicensedTo2\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"Auth_Text_TrialDayLeft\" xml:space=\"preserve\">\n    <value>일 남았습니다.</value>\n  </data>\n  <data name=\"Auth_Text_TrialDaysLeft\" xml:space=\"preserve\">\n    <value>일 남았습니다.</value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired1\" xml:space=\"preserve\">\n    <value>라이센스가 만료되었습니다.</value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired2\" xml:space=\"preserve\">\n    <value>로그인</value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired3\" xml:space=\"preserve\">\n    <value>재활성화</value>\n  </data>\n  <data name=\"Auth_Text_SignIn1\" xml:space=\"preserve\">\n    <value>fuse X 를 활성화하려면 </value>\n  </data>\n  <data name=\"Auth_Text_SignIn2\" xml:space=\"preserve\">\n    <value>로그인</value>\n  </data>\n  <data name=\"Auth_Text_SignIn3\" xml:space=\"preserve\">\n    <value>하세요.</value>\n  </data>\n  <data name=\"About_Title\" xml:space=\"preserve\">\n    <value>fuse X 정보</value>\n  </data>\n  <data name=\"About_Menu\" xml:space=\"preserve\">\n    <value>정보</value>\n  </data>\n  <data name=\"About_RegisteredTo\" xml:space=\"preserve\">\n    <value>Registered to</value>\n  </data>\n  <data name=\"About_NotRegistered\" xml:space=\"preserve\">\n    <value>Not registered</value>\n  </data>\n  <data name=\"About_Company\" xml:space=\"preserve\">\n    <value>회사: </value>\n  </data>\n  <data name=\"About_License\" xml:space=\"preserve\">\n    <value>라이센스: </value>\n  </data>\n  <data name=\"About_Issued\" xml:space=\"preserve\">\n    <value>Issued: </value>\n  </data>\n  <data name=\"About_Expires\" xml:space=\"preserve\">\n    <value>만료: </value>\n  </data>\n  <data name=\"About_Authority\" xml:space=\"preserve\">\n    <value>Authority: </value>\n  </data>\n  <data name=\"About_MoreInfo1\" xml:space=\"preserve\">\n    <value>자세한 내용은 방문하세요.</value>\n  </data>\n  <data name=\"About_MoreInfo2\" xml:space=\"preserve\">\n    <value>웹사이트</value>\n  </data>\n  <data name=\"Activate_Title\" xml:space=\"preserve\">\n    <value>활성화 코드 입력</value>\n  </data>\n  <data name=\"Activate_Button\" xml:space=\"preserve\">\n    <value>활성화 fuse X</value>\n  </data>\n  <data name=\"Activate_FeedbackEmpty\" xml:space=\"preserve\">\n    <value>활성화크드를 입력해주세요.</value>\n  </data>\n  <data name=\"Activate_FeedbackInvalid\" xml:space=\"preserve\">\n    <value>활성화 코드가 유효하지 않습니다.</value>\n  </data>\n  <data name=\"License_Error_Text\" xml:space=\"preserve\">\n    <value>라이선스를 확인하는 동안 문제가 발생했습니다.\n\n이는 네트워크 문제로 인한 일시적인 서비스 손실일 수 있습니다.\n\n나중에 다시 시도 해주십시오.</value>\n  </data>\n  <data name=\"Inspector_SelectSomething\" xml:space=\"preserve\">\n    <value>시작할 항목을 선택하세요</value>\n  </data>\n  <data name=\"Toolbox_MakeClassFromSelection\" xml:space=\"preserve\">\n    <value>선택에서 클래스 만들기</value>\n  </data>\n  <data name=\"Toolbox_YourClasses\" xml:space=\"preserve\">\n    <value>당신의 수업</value>\n  </data>\n  <data name=\"Toolbox_SearchYourClasses\" xml:space=\"preserve\">\n    <value>수업 검색</value>\n  </data>\n  <data name=\"Toolbox_DragClassesInto_Text\" xml:space=\"preserve\">\n    <value>클래스를 계층 구조로 드래그\n인스턴스를 삽입하려면</value>\n  </data>\n  <data name=\"Toolbox_CreateAClass_Text\" xml:space=\"preserve\">\n    <value>의 요소에서 클래스를 만듭니다\n계층 구조이며 여기에 표시됩니다</value>\n  </data>\n  <data name=\"CodeView_Devices\" xml:space=\"preserve\">\n    <value>장치</value>\n  </data>\n  <data name=\"CodeView_ToolTip\" xml:space=\"preserve\">\n    <value>fuse X Preview 앱이 설치된 장치에 이 프로젝트를 연결합니다.</value>\n  </data>\n  <data name=\"LogView_AllOutput\" xml:space=\"preserve\">\n    <value>모든 출력</value>\n  </data>\n</root>"
  },
  {
    "path": "src/fuse/locale/Strings.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <data name=\"Button_Browse\" xml:space=\"preserve\">\n    <value>Browse</value>\n  </data>\n  <data name=\"Button_Cancel\" xml:space=\"preserve\">\n    <value>Cancel</value>\n  </data>\n  <data name=\"Dashboard_Button_Browse\" xml:space=\"preserve\">\n    <value>Browse</value>\n  </data>\n  <data name=\"Dashboard_Button_Create\" xml:space=\"preserve\">\n    <value>Create</value>\n  </data>\n  <data name=\"Dashboard_Button_Open\" xml:space=\"preserve\">\n    <value>Open</value>\n  </data>\n  <data name=\"Dashboard_Community\" xml:space=\"preserve\">\n    <value>Community</value>\n  </data>\n  <data name=\"Dashboard_Community_Text\" xml:space=\"preserve\">\n    <value>Made something cool? Join a thriving\ncommunity of Fuse enthusiasts</value>\n  </data>\n  <data name=\"Dashboard_Docs\" xml:space=\"preserve\">\n    <value>Docs</value>\n  </data>\n  <data name=\"Dashboard_Docs_Text\" xml:space=\"preserve\">\n    <value>Need some technical information?\nSearch the reference docs.</value>\n  </data>\n  <data name=\"Dashboard_Learn\" xml:space=\"preserve\">\n    <value>Learn</value>\n  </data>\n  <data name=\"Dashboard_Learn_Text\" xml:space=\"preserve\">\n    <value>New to Fuse? Explore our Handbook,\nTutorials and Examples.</value>\n  </data>\n  <data name=\"Dashboard_Project_Remove\" xml:space=\"preserve\">\n    <value>Remove from list</value>\n  </data>\n  <data name=\"Dashboard_Recent_Projects\" xml:space=\"preserve\">\n    <value>Recent Projects</value>\n  </data>\n  <data name=\"Dashboard_LastOpened\" xml:space=\"preserve\">\n    <value>Last opened</value>\n  </data>\n  <data name=\"Dashboard_Location\" xml:space=\"preserve\">\n    <value>Location</value>\n  </data>\n  <data name=\"Dashboard_Description\" xml:space=\"preserve\">\n    <value>Description</value>\n  </data>\n  <data name=\"Dashboard_New_Prefix\" xml:space=\"preserve\">\n    <value>New</value>\n  </data>\n  <data name=\"Dashboard_Open_Prefix\" xml:space=\"preserve\">\n    <value>Open</value>\n  </data>\n  <data name=\"MainMenu_Edit\" xml:space=\"preserve\">\n    <value>Edit</value>\n  </data>\n  <data name=\"MainMenu_Element\" xml:space=\"preserve\">\n    <value>Element</value>\n  </data>\n  <data name=\"MainMenu_Export\" xml:space=\"preserve\">\n    <value>Export</value>\n  </data>\n  <data name=\"MainMenu_File\" xml:space=\"preserve\">\n    <value>File</value>\n  </data>\n  <data name=\"MainMenu_Help\" xml:space=\"preserve\">\n    <value>Help</value>\n  </data>\n  <data name=\"MainMenu_Preview\" xml:space=\"preserve\">\n    <value>Preview</value>\n  </data>\n  <data name=\"MainMenu_Project\" xml:space=\"preserve\">\n    <value>Project</value>\n  </data>\n  <data name=\"MainMenu_Tools\" xml:space=\"preserve\">\n    <value>Tools</value>\n  </data>\n  <data name=\"MainMenu_Viewport\" xml:space=\"preserve\">\n    <value>Viewport</value>\n  </data>\n  <data name=\"MainMenu_Window\" xml:space=\"preserve\">\n    <value>Window</value>\n  </data>\n  <data name=\"SubMenu_Edit_Copy\" xml:space=\"preserve\">\n    <value>Copy</value>\n  </data>\n  <data name=\"SubMenu_Edit_Cut\" xml:space=\"preserve\">\n    <value>Cut</value>\n  </data>\n  <data name=\"SubMenu_Edit_Delete\" xml:space=\"preserve\">\n    <value>Delete</value>\n  </data>\n  <data name=\"SubMenu_Edit_Paste\" xml:space=\"preserve\">\n    <value>Paste</value>\n  </data>\n  <data name=\"SubMenu_Edit_SelectAll\" xml:space=\"preserve\">\n    <value>Select All</value>\n  </data>\n  <data name=\"SubMenu_Element_Deselect\" xml:space=\"preserve\">\n    <value>Deselect</value>\n  </data>\n  <data name=\"SubMenu_Element_LocateInEditor\" xml:space=\"preserve\">\n    <value>Locate in editor</value>\n  </data>\n  <data name=\"SubMenu_Element_Remove\" xml:space=\"preserve\">\n    <value>Remove element</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForAndroid\" xml:space=\"preserve\">\n    <value>Export for Android</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForAndroidEmulator\" xml:space=\"preserve\">\n    <value>Export for Android Emulator</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForiOS\" xml:space=\"preserve\">\n    <value>Export for iOS</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForiOSSimulator\" xml:space=\"preserve\">\n    <value>Export for iOS Simulator</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForDotNet\" xml:space=\"preserve\">\n    <value>Export for Desktop (.NET)</value>\n  </data>\n  <data name=\"SubMenu_Export_ExportForNative\" xml:space=\"preserve\">\n    <value>Export for Desktop (native)</value>\n  </data>\n  <data name=\"SubMenu_Export_Clean\" xml:space=\"preserve\">\n    <value>Clean build files</value>\n  </data>\n  <data name=\"SubMenu_File_New\" xml:space=\"preserve\">\n    <value>New...</value>\n  </data>\n  <data name=\"SubMenu_File_Open\" xml:space=\"preserve\">\n    <value>Open...</value>\n  </data>\n  <data name=\"SubMenu_File_Quit\" xml:space=\"preserve\">\n    <value>Quit</value>\n  </data>\n  <data name=\"SubMenu_File_Exit\" xml:space=\"preserve\">\n    <value>Exit</value>\n  </data>\n  <data name=\"SubMenu_Help_Community\" xml:space=\"preserve\">\n    <value>Community</value>\n  </data>\n  <data name=\"SubMenu_Help_Documentation\" xml:space=\"preserve\">\n    <value>Documentation</value>\n  </data>\n  <data name=\"SubMenu_Help_Examples\" xml:space=\"preserve\">\n    <value>Examples</value>\n  </data>\n  <data name=\"SubMenu_Help_Tutorial\" xml:space=\"preserve\">\n    <value>Tutorial</value>\n  </data>\n  <data name=\"SubMenu_Help_Forums\" xml:space=\"preserve\">\n    <value>Forums</value>\n  </data>\n  <data name=\"SubMenu_Help_ReportIssue\" xml:space=\"preserve\">\n    <value>Report issue</value>\n  </data>\n  <data name=\"SubMenu_Updates_CheckForUpdates\" xml:space=\"preserve\">\n    <value>Check for updates</value>\n  </data>\n  <data name=\"SubMenu_Updates_CheckAutomatically\" xml:space=\"preserve\">\n    <value>Check automatically</value>\n  </data>\n  <data name=\"SubMenu_Updates_UpdateAvailable\" xml:space=\"preserve\">\n    <value>There's an update available</value>\n  </data>\n  <data name=\"SubMenu_Updates_DownloadLatestQuestion\" xml:space=\"preserve\">\n    <value>Do you want to download the latest version now?</value>\n  </data>\n  <data name=\"SubMenu_Preview_Android\" xml:space=\"preserve\">\n    <value>Preview on Android</value>\n  </data>\n  <data name=\"SubMenu_Preview_AndroidEmulator\" xml:space=\"preserve\">\n    <value>Preview on Android Emulator</value>\n  </data>\n  <data name=\"SubMenu_Preview_BuildFlags\" xml:space=\"preserve\">\n    <value>Build flags</value>\n  </data>\n  <data name=\"SubMenu_Preview_iOS\" xml:space=\"preserve\">\n    <value>Preview on iOS</value>\n  </data>\n  <data name=\"SubMenu_Preview_iOSSimulator\" xml:space=\"preserve\">\n    <value>Preview on iOS Simulator</value>\n  </data>\n  <data name=\"SubMenu_Preview_Native\" xml:space=\"preserve\">\n    <value>Preview on Desktop (native)</value>\n  </data>\n  <data name=\"SubMenu_Preview_Rebuild\" xml:space=\"preserve\">\n    <value>Rebuild</value>\n  </data>\n  <data name=\"SubMenu_Preview_Reconnect\" xml:space=\"preserve\">\n    <value>Reconnect USB (Android)</value>\n  </data>\n  <data name=\"SubMenu_Preview_Refresh\" xml:space=\"preserve\">\n    <value>Refresh</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenFolder\" xml:space=\"preserve\">\n    <value>Open Project Folder</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenSublime\" xml:space=\"preserve\">\n    <value>Open in Sublime Text 3</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenVSCode\" xml:space=\"preserve\">\n    <value>Open in Visual Studio Code</value>\n  </data>\n  <data name=\"SubMenu_Project_OpenTerminal\" xml:space=\"preserve\">\n    <value>Open in Terminal</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallSDK\" xml:space=\"preserve\">\n    <value>Install Android SDK</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallAtomPlugin\" xml:space=\"preserve\">\n    <value>Install Atom plugin</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallSublimePlugin\" xml:space=\"preserve\">\n    <value>Install Sublime Text 3 plugin</value>\n  </data>\n  <data name=\"SubMenu_Tools_InstallVSCodeExtension\" xml:space=\"preserve\">\n    <value>Install Visual Studio Code extension</value>\n  </data>\n  <data name=\"SubMenu_Tools_Setup\" xml:space=\"preserve\">\n    <value>Setup guide</value>\n  </data>\n  <data name=\"SubMenu_Tools_Config\" xml:space=\"preserve\">\n    <value>Print Uno config</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Close\" xml:space=\"preserve\">\n    <value>Close Viewport</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Device\" xml:space=\"preserve\">\n    <value>Select device</value>\n  </data>\n  <data name=\"SubMenu_Viewport_FlipAspect\" xml:space=\"preserve\">\n    <value>Flip aspect</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Goback\" xml:space=\"preserve\">\n    <value>Go back</value>\n  </data>\n  <data name=\"SubMenu_Viewport_New\" xml:space=\"preserve\">\n    <value>New Viewport</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Restart\" xml:space=\"preserve\">\n    <value>Restart</value>\n  </data>\n  <data name=\"SubMenu_Viewport_Selection\" xml:space=\"preserve\">\n    <value>Selection</value>\n  </data>\n  <data name=\"SubMenu_Window_CompactMode\" xml:space=\"preserve\">\n    <value>Compact mode</value>\n  </data>\n  <data name=\"SubMenu_Window_KeepWindowOnTop\" xml:space=\"preserve\">\n    <value>Keep window on top</value>\n  </data>\n  <data name=\"SubMenu_Window_Language\" xml:space=\"preserve\">\n    <value>Language</value>\n  </data>\n  <data name=\"SubMenu_Window_LightTheme\" xml:space=\"preserve\">\n    <value>Light theme</value>\n  </data>\n  <data name=\"SubMenu_Window_DarkTheme\" xml:space=\"preserve\">\n    <value>Dark theme</value>\n  </data>\n  <data name=\"Button_Ok\" xml:space=\"preserve\">\n    <value>OK</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Caption\" xml:space=\"preserve\">\n    <value>Setup guide</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment1\" xml:space=\"preserve\">\n    <value>A text editor is required to use fuse X.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_1\" xml:space=\"preserve\">\n    <value>We recommend </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_2\" xml:space=\"preserve\">\n    <value> or </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment2_3\" xml:space=\"preserve\">\n    <value>, and our accompanying plugins.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_Comment3\" xml:space=\"preserve\">\n    <value>This wizard will look for the software on your system and help you install or update our plugins.</value>\n  </data>\n  <data name=\"Dialog_SetupGuide_SeeAlso1\" xml:space=\"preserve\">\n    <value>We also have a plugin for </value>\n  </data>\n  <data name=\"Dialog_SetupGuide_SeeAlso2\" xml:space=\"preserve\">\n    <value>.</value>\n  </data>\n  <data name=\"SubMenu_Project_SketchImport\" xml:space=\"preserve\">\n    <value>Sketch Import</value>\n  </data>\n  <data name=\"Button_Done\" xml:space=\"preserve\">\n    <value>Done</value>\n  </data>\n  <data name=\"LogView_Tab_Clear\" xml:space=\"preserve\">\n    <value>Clear</value>\n  </data>\n  <data name=\"LogView_Tab_Log\" xml:space=\"preserve\">\n    <value>Log</value>\n  </data>\n  <data name=\"LogView_Tab_Problems\" xml:space=\"preserve\">\n    <value>Problems</value>\n  </data>\n  <data name=\"Label_MacOnly\" xml:space=\"preserve\">\n    <value>Mac only</value>\n  </data>\n  <data name=\"LanguageUpdated_Text\" xml:space=\"preserve\">\n    <value>Your language preference was updated.\n\nThe new language will come into full effect next time you start fuse X.</value>\n  </data>\n  <data name=\"NagScreen_Caption\" xml:space=\"preserve\">\n    <value>This is an unregistered copy</value>\n  </data>\n  <data name=\"NagScreen_Text\" xml:space=\"preserve\">\n    <value>Hello! Thanks for trying out fuse X.\n\nActivation is required to use this software.\n\nFree Trial available:\n• Try all fuse X has to offer for one month.\n• No credit card required.</value>\n  </data>\n  <data name=\"NagScreen_Button_SignIn\" xml:space=\"preserve\">\n    <value>Sign in</value>\n  </data>\n  <data name=\"NagScreen_Button_EnterCode\" xml:space=\"preserve\">\n    <value>Enter code</value>\n  </data>\n  <data name=\"NagScreen_Question\" xml:space=\"preserve\">\n    <value>Would you like to activate now?</value>\n  </data>\n  <data name=\"Toolbar_Selection_Tooltip\" xml:space=\"preserve\">\n    <value>Enable to select elements in the app.</value>\n  </data>\n  <data name=\"Toolbar_Selection_Tooltip2\" xml:space=\"preserve\">\n    <value>Enable to select elements in the app. Disable to interact with the app.</value>\n  </data>\n  <data name=\"Toolbar_Selection_Button\" xml:space=\"preserve\">\n    <value>Selection</value>\n  </data>\n  <data name=\"Toolbar_Touch_Tooltip\" xml:space=\"preserve\">\n    <value>Enable to intract with the app.</value>\n  </data>\n  <data name=\"Toolbar_Touch_Button\" xml:space=\"preserve\">\n    <value>Touch</value>\n  </data>\n  <data name=\"Toolbar_Viewport_Tooltip\" xml:space=\"preserve\">\n    <value>Click to add a new Viewport.</value>\n  </data>\n  <data name=\"Toolbar_Viewport_Button\" xml:space=\"preserve\">\n    <value>Add Viewport</value>\n  </data>\n  <data name=\"Toolbar_Compact_Tooltip\" xml:space=\"preserve\">\n    <value>Switch between normal and compact mode. Click to switch mode.</value>\n  </data>\n  <data name=\"Toolbar_Compact_Button\" xml:space=\"preserve\">\n    <value>Compact</value>\n  </data>\n  <data name=\"Auth_Text_LicensedTo1\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"Auth_Text_LicensedTo2\" xml:space=\"preserve\">\n    <value />\n  </data>\n  <data name=\"Auth_Text_TrialDayLeft\" xml:space=\"preserve\">\n    <value>trial day left</value>\n  </data>\n  <data name=\"Auth_Text_TrialDaysLeft\" xml:space=\"preserve\">\n    <value>trial days left</value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired1\" xml:space=\"preserve\">\n    <value>Your license has expired. Please </value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired2\" xml:space=\"preserve\">\n    <value>sign in</value>\n  </data>\n  <data name=\"Auth_Text_LicenseExpired3\" xml:space=\"preserve\">\n    <value> to reactivate.</value>\n  </data>\n  <data name=\"Auth_Text_SignIn1\" xml:space=\"preserve\">\n    <value>Please </value>\n  </data>\n  <data name=\"Auth_Text_SignIn2\" xml:space=\"preserve\">\n    <value>sign in</value>\n  </data>\n  <data name=\"Auth_Text_SignIn3\" xml:space=\"preserve\">\n    <value> to activate fuse X</value>\n  </data>\n  <data name=\"About_Title\" xml:space=\"preserve\">\n    <value>About fuse X</value>\n  </data>\n  <data name=\"About_Menu\" xml:space=\"preserve\">\n    <value>About</value>\n  </data>\n  <data name=\"About_RegisteredTo\" xml:space=\"preserve\">\n    <value>Registered to</value>\n  </data>\n  <data name=\"About_NotRegistered\" xml:space=\"preserve\">\n    <value>Not registered</value>\n  </data>\n  <data name=\"About_Company\" xml:space=\"preserve\">\n    <value>Company: </value>\n  </data>\n  <data name=\"About_License\" xml:space=\"preserve\">\n    <value>License: </value>\n  </data>\n  <data name=\"About_Issued\" xml:space=\"preserve\">\n    <value>Issued: </value>\n  </data>\n  <data name=\"About_Expires\" xml:space=\"preserve\">\n    <value>Expires: </value>\n  </data>\n  <data name=\"About_Authority\" xml:space=\"preserve\">\n    <value>Authority: </value>\n  </data>\n  <data name=\"About_MoreInfo1\" xml:space=\"preserve\">\n    <value>For more information visit our </value>\n  </data>\n  <data name=\"About_MoreInfo2\" xml:space=\"preserve\">\n    <value>website</value>\n  </data>\n  <data name=\"Activate_Title\" xml:space=\"preserve\">\n    <value>Enter activation code</value>\n  </data>\n  <data name=\"Activate_Button\" xml:space=\"preserve\">\n    <value>Activate fuse X</value>\n  </data>\n  <data name=\"Activate_FeedbackEmpty\" xml:space=\"preserve\">\n    <value>Please enter your activation code.</value>\n  </data>\n  <data name=\"Activate_FeedbackInvalid\" xml:space=\"preserve\">\n    <value>This activation code is not valid.</value>\n  </data>\n  <data name=\"License_Error_Text\" xml:space=\"preserve\">\n    <value>Something went wrong while checking your license.\n\nThis might be a temporary loss of service caused by problems in the network.\n\nPlease try again later.</value>\n  </data>\n  <data name=\"Inspector_SelectSomething\" xml:space=\"preserve\">\n    <value>Select something to get started</value>\n  </data>\n  <data name=\"Toolbox_MakeClassFromSelection\" xml:space=\"preserve\">\n    <value>Make class from selection</value>\n  </data>\n  <data name=\"Toolbox_YourClasses\" xml:space=\"preserve\">\n    <value>Your classes</value>\n  </data>\n  <data name=\"Toolbox_SearchYourClasses\" xml:space=\"preserve\">\n    <value>Search your classes</value>\n  </data>\n  <data name=\"Toolbox_DragClassesInto_Text\" xml:space=\"preserve\">\n    <value>Drag classes into the hierarchy \nto insert instances of them</value>\n  </data>\n  <data name=\"Toolbox_CreateAClass_Text\" xml:space=\"preserve\">\n    <value>Create a class from elements in the\nhierarchy and it will appear here</value>\n  </data>\n  <data name=\"CodeView_Devices\" xml:space=\"preserve\">\n    <value>Devices</value>\n  </data>\n  <data name=\"CodeView_ToolTip\" xml:space=\"preserve\">\n    <value>Connect this project to a device with the fuse X Preview app installed on it.</value>\n  </data>\n  <data name=\"LogView_AllOutput\" xml:space=\"preserve\">\n    <value>All Output</value>\n  </data>\n</root>"
  },
  {
    "path": "src/fuse/sandbox/.gitignore",
    "content": "Fuse Sandbox.app/\n"
  },
  {
    "path": "src/fuse/sandbox/AutoReloadContent.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class AutoReloadContent\n\t{\n\t\tpublic static IControl Create()\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tLabel.Create(\n\t\t\t\t\ttext: \"Open AutoReloadContent.cs, and put your content there\",\n\t\t\t\t\tfont: Font.SystemDefault(40),\n\t\t\t\t\tcolor: Theme.DefaultText).Center(),\n\t\t\t\tLabel.Create(\n\t\t\t\t\ttext: \"Enjoy autoreload! :)\",\n\t\t\t\t\tfont: Font.SystemDefault(30),\n\t\t\t\t\tcolor: Theme.DefaultText).Center())\n\t\t\t\t.Center()\n\t\t\t\t.WithBackground(Theme.WorkspaceBackground);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/sandbox/AutoReloadProgram.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reflection;\nusing System.Text;\nusing System.Threading;\nusing Outracks.Diagnostics;\nusing Outracks.Extensions;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\nusing Outracks.Fusion.AutoReload;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tstatic class AutoReloadProgram\n\t{\n\t\t[STAThread]\n\t\tpublic static void Main(string []argv)\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n\n\t\t\tApplication.Initialize(argv);\n\n\t\t\tvar log = new Subject<string>();\n\t\t\tvar shell = new Shell();\n\t\t\tvar writer = new ObservableStreamWriter();\n\t\t\twriter.Chunks.Subscribe(log);\n\t\t\tConsole.SetOut(writer);\n\n\t\t\tvar autoReloadFiles = new List<AbsoluteFilePath>();\n\n\t\t\tforeach (var arg in argv)\n\t\t\t{\n\t\t\t\tvar path = (AbsoluteFilePath)shell.ResolveAbsolutePath(arg);\n\t\t\t\tif (path.Name.Extension == \".cs\")\n\t\t\t\t{\n\t\t\t\t\tautoReloadFiles.Add(AbsoluteFilePath.Parse(arg));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"Invalid argument, expected filepaths which ends with '.cs'.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tUserSettings.Settings = PersistentSettings.Load(\n\t\t\t\tusersettingsfile: AbsoluteDirectoryPath.Parse(Environment.CurrentDirectory) / new FileName(\"autoreload-config.json\"));\n\n\t\t\tif (autoReloadFiles.Count == 0)\n\t\t\t{\n\t\t\t\tif (Platform.IsMac)\n\t\t\t\t\tautoReloadFiles.Add(AbsoluteFilePath.Parse(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + \"/../../../AutoReloadContent.cs\"));\n\t\t\t\telse\n\t\t\t\t\tautoReloadFiles.Add(AbsoluteFilePath.Parse(\"../../AutoReloadContent.cs\"));\n\t\t\t}\n\n\t\t\tvar createDebugWindow = new Action(() =>\n\t\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\t\tObservable.Return(true),\n\t\t\t\t\tdialog =>\n\t\t\t\t\t\tnew Window()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTitle = Observable.Return(\"Debug\"),\n\t\t\t\t\t\t\tSize = Property.Create<Optional<Size<Points>>>(new Size<Points>(600, 500)).ToOptional(),\n\t\t\t\t\t\t\tContent = Debugging.CreateDebugControl(),\n\t\t\t\t\t\t\tBackground = Theme.Background,\n\t\t\t\t\t\t\tBorder = Stroke.Create(1, Color.White),\n\t\t\t\t\t\t\tForeground = Color.White,\n\t\t\t\t\t\t}\n\t\t\t));\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: Observable.Return(true),\n\t\t\t\twindow: window =>\n\t\t\t\t{\n\t\t\t\t\treturn new Window\n\t\t\t\t\t{\n\t\t\t\t\t\tTitle = Observable.Return(\"Fuse - Autoreload\"),\n\t\t\t\t\t\tMenu = Menu.Item(\"Debug\", createDebugWindow) +\n\t\t\t\t\t\t\tMenu.Submenu(\"Themes\",\n\t\t\t\t\t\t\t\tMenu.Option(\n\t\t\t\t\t\t\t\t\tvalue: Themes.OriginalLight,\n\t\t\t\t\t\t\t\t\tname: \"Light theme\",\n\t\t\t\t\t\t\t\t\tproperty: Theme.CurrentTheme) +\n\t\t\t\t\t\t\t\tMenu.Option(\n\t\t\t\t\t\t\t\t\tvalue: Themes.OriginalDark,\n\t\t\t\t\t\t\t\t\tname: \"Dark theme\",\n\t\t\t\t\t\t\t\t\tproperty: Theme.CurrentTheme)),\n\t\t\t\t\t\tContent = Layout.Dock()\n\t\t\t\t\t\t\t.Bottom(\n\t\t\t\t\t\t\t\tLogView.Create(log.Select(s => s), Observable.Return(Color.Black))\n\t\t\t\t\t\t\t\t\t.WithHeight(200)\n\t\t\t\t\t\t\t\t\t.WithBackground(Color.White))\n\t\t\t\t\t\t\t.Fill(AutoreloadControl(shell, autoReloadFiles, log.ToProgress()).Switch()),\n\t\t\t\t\t\tBackground = Theme.Background,\n\t\t\t\t\t\tBorder = Stroke.Create(1, Color.White),\n\t\t\t\t\t\tForeground = Color.White,\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tApplication.Run();\n\t\t}\n\n\t\tclass ObservableStreamWriter : TextWriter\n\t\t{\n\t\t\treadonly Subject<string> _chunks = new Subject<string>();\n\n\t\t\tpublic override Encoding Encoding\n\t\t\t{\n\t\t\t\tget { return Encoding.UTF8; }\n\t\t\t}\n\n\t\t\tpublic IObservable<string> Chunks\n\t\t\t{\n\t\t\t\tget { return _chunks; }\n\t\t\t}\n\n\t\t\tpublic override void Write(char value)\n\t\t\t{\n\t\t\t\t_chunks.OnNext(value.ToString());\n\t\t\t}\n\t\t}\n\n\t\tstatic IObservable<IControl> AutoreloadControl(IFileSystem shell, IList<AbsoluteFilePath> filesToReload, IProgress<string> log)\n\t\t{\n\t\t\tvar currentAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);\n\n\t\t\tvar fuseDesignerPath = Path.Combine(currentAssemblyPath, \"fuse-studio.exe\");\n\n\t\t\tvar referencedAssemblies = new List<string>()\n\t\t\t{\n\t\t\t\t\"System.dll\",\n\t\t\t\t\"System.Runtime.dll\",\n\t\t\t\t\"System.Core.dll\",\n\t\t\t\t\"System.Xml.dll\",\n\t\t\t\t\"System.Xml.Linq.dll\",\n\t\t\t\tPath.Combine(currentAssemblyPath, \"Outracks.Fusion.dll\"),\n\t\t\t\tPath.Combine(currentAssemblyPath, \"Outracks.dll\"),\n\t\t\t\tPath.Combine(currentAssemblyPath, \"Outracks.Math.dll\"),\n\t\t\t\tPath.Combine(currentAssemblyPath, \"System.Reactive.dll\"),\n\t\t\t\tPath.Combine(currentAssemblyPath, \"System.Collections.Immutable.dll\"),\n\t\t\t\tPath.Combine(currentAssemblyPath, \"Outracks.Fuse.dll\"),\n\t\t\t\tPath.Combine(currentAssemblyPath, \"Outracks.Simulator.dll\"),\n\t\t\t\tfuseDesignerPath\n\t\t\t};\n\n\t\t\treturn filesToReload.Select(shell.Watch)\n\t\t\t\t.CombineLatest()\n\t\t\t\t.Select(x => Unit.Default)\n\t\t\t\t.Throttle(TimeSpan.FromMilliseconds(500))\n\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t.Select(_ => ControlFactory.Compile(filesToReload, log, referencedAssemblies))\n\t\t\t\t.NotNone()\n\t\t\t\t.Select(asm => ControlFactory.CreateControl(asm, \"Create\", new object[0], log))\n\t\t\t\t.NotNone();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/sandbox/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDisplayName</key>\n\t<string>Fuse Sandbox</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.fuse-x.FuseSandbox</string>\n\t<key>CFBundleName</key>\n\t<string>FusionAutoReload</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0.0</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>10.10</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0.0</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/fuse/sandbox/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\n\n[assembly: AssemblyTitle(\"Fusion-AutoReload\")]\n[assembly: AssemblyDescription(\"An auto-reload tool for fusion, see README.md for usage.\")]\n"
  },
  {
    "path": "src/fuse/sandbox/README.md",
    "content": "## AutoReload\n_AutoReload is a tool and library for iterating on Fusion UI by using JIT, so that changes can be reflected without having to rebuild._\n\n### Usage\n\n#### As standalone tool\n_AutoReload_ can be used as a standalone executable, and is called `Fuse Sandbox.exe` on Windows and `Fuse Sandbox.app` on macOS. On windows the output directory is `$(ProjectDir)bin/Debug`, on macOS it's `$(ProjectDir)`. To open it on macOS, run `open ./src/Fuse/Sandbox/Fuse\\ Sandbox.app` from the repository root directory.\n\nAs a start, it's recommended to just put all your code in `AutoReloadContent.cs` (In the `Outracks.Fuse.Sandbox` project). Every time you save that file, the `Fusion-AutoReload` window updates to reflect your changes. It is also possible to split your code into multiple files, in which case you need to specify those in the argument list.\n\n#### As a library\n\n_AutoReload_ can also be linked with a project, and used by adding `.AutoReload()` to an `IControl` eg.\n\n```csharp\nstatic class MyControl\n{\n\tpublic static IControl Create(MyData someData, MyDate otherData)\n\t{\n\t\treturn Control.Empty\n\t\t\t.AutoReload(new object[] { someData, otherData });\n\t}\n}\n```\n\nIf the method your're using `AutoReload` in takes arguments (like `someData` and `otherData` above), you need to specify those in the `new object[] {}` argument to `AutoReload()` as shown above.\n\nAs you see, the `AutoReload` method supports forwarding of parameters, so that you can use real data in your control, while doing reloading.\n\nLimitations with this approach are:\n* The method containing `AutoReload` has to be a static method of a static class.\n* Types from another file, referenced in the class or method, have to be public.\n\nSo basically you can have auto-reload support of existing controls, while your application is running. This gives you the ability to change the code, and see your changes immediately, without having to rebuild. \n\n#### Troubleshooting\n\n##### Referencing the AutoReload project\n\n###### Symptom\nWhen you try to add `AutoReload` to something, it says `Cannot resolve symbol AutoReload`\n\n###### Solution\n- Make sure the project containing the file you want to change references the `AutoReload` project. For instance in Rider, press `Shift+Alt+l` to jump to the file in the solution explorer, find `References` right below the project name, right click, select \"Add Reference\", search and ad the `AutoReload` project.\n- Also make sure you're `using` the correct namespace. Most IDEs will do this automatically, but make sure it says `using Outracks.Fusion.AutoReload;` near the top of the file you're adding `AutoReload()` in.\n"
  },
  {
    "path": "src/fuse/sandbox/Resources/DIR",
    "content": ""
  },
  {
    "path": "src/fuse/sandbox/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.7.0.0\" newVersion=\"4.7.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Runtime.CompilerServices.Unsafe\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.4.1\" newVersion=\"4.0.4.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Reactive\" publicKeyToken=\"94bc3704cddfc263\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.4.0.0\" newVersion=\"4.4.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Xml.XmlDocument\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fuse/sandbox/fuse-sandbox.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{B165DE3E-71DC-4C2F-915D-66FCE2D7B4D5}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse</RootNamespace>\n    <AssemblyName>fuse-sandbox</AssemblyName>\n    <OutputPath>bin\\$(Configuration)</OutputPath>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AutoReloadContent.cs\" />\n    <Compile Include=\"AutoReloadProgram.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3c1c1047-8830-498e-882a-503c0956cbe3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\studio\\fuse-studio.csproj\">\n      <Project>{490ef7e5-46ff-4df3-8342-530429ca65b5}</Project>\n      <Name>fuse-studio</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8dfb02e0-acbf-4432-8dd9-56712e206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fuse/sandbox/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fuse/studio/About.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reflection;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic class About\n\t{\n\t\tpublic About(string version, ILicense license, IMessagingService daemon, Debug debug, Activate activate)\n\t\t{\n\t\t\tvar showAboutDialog = new BehaviorSubject<bool>(false);\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: showAboutDialog,\n\t\t\t\twindow: dialog =>\n\t\t\t\t\tnew Window\n\t\t\t\t\t{\n\t\t\t\t\t\tTitle = Texts.About_Title,\n\t\t\t\t\t\tContent = Control.Lazy(() =>\n\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t.Top(LogoAndVersion.Create(version).WithMacWindowStyleCompensation())\n\t\t\t\t\t\t\t\t.Bottom(CreateOkButton(Command.Enabled(() => dialog.Close())))\n\t\t\t\t\t\t\t\t.Bottom(Separator.Medium)\n\t\t\t\t\t\t\t\t.Bottom(Label.Create(\"\"))\n\t\t\t\t\t\t\t\t.Bottom(Buttons.DefaultButtonPrimary(Texts.Activate_Title, Command.Enabled(activate.Show))\n\t\t\t\t\t\t\t\t\t\t.WithWidth(160)\n\t\t\t\t\t\t\t\t\t\t.CenterHorizontally())\n\t\t\t\t\t\t\t\t.Fill(Theme.Link.Select(linkColor =>\n\t\t\t\t\t\t\t\t\tLabel.FormattedText(font: Theme.DefaultFont, color:Theme.DefaultText, lineBreakMode: LineBreakMode.Wrap,\n\t\t\t\t\t\t\t\t\t\t\ttextParts: license.IsRegistered.CombineLatest(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlicense.Type, license.Data, license.Session, Tuple.Create).Select(tuple => {\n\t\t\t\t\t\t\t\t\t\t\t\tvar isRegistered = tuple.Item1;\n\t\t\t\t\t\t\t\t\t\t\t\tvar type = tuple.Item2;\n\t\t\t\t\t\t\t\t\t\t\t\tvar data = tuple.Item3;\n\t\t\t\t\t\t\t\t\t\t\t\tvar session = tuple.Item4;\n\t\t\t\t\t\t\t\t\t\t\t\treturn AttributedText.Parts()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"SHA: \" + CommitSha + \"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"UID: \" + Hardware.UID + \"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"------------------------------------------------------------------------\\n\", Color.FromRgb(0x7f7f7f))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"  \" + (isRegistered ? Strings.About_RegisteredTo : Strings.About_NotRegistered) + \"\\n\", Color.FromRgb(0x7f7f7f))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"------------------------------------------------------------------------\\n\", Color.FromRgb(0x7f7f7f))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"  \").Parts(GetRegisteredToParts(isRegistered, data.Name, data.Email, linkColor, session)).Text(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t//.Text(\"  \" + (isRegistered ? Strings.About_Company + data.Company : \"\") + \"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"  \" + (isRegistered ? Strings.About_License + type : \"\") + \"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"  \" + (isRegistered ? Strings.About_Issued + data.UtcIssued.ToLocalTime().ToString() : \"\") + \"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"  \" + (isRegistered ? Strings.About_Expires + data.UtcExpires.ToLocalTime().ToString() : \"\") + \"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"  \" + (isRegistered ? Strings.About_Authority + data.Authority : \"\") + \"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"------------------------------------------------------------------------\\n\", Color.FromRgb(0x7f7f7f))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Text(Strings.About_MoreInfo1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Link(Strings.About_MoreInfo2, WebLinks.Website, linkColor);\n\t\t\t\t\t\t\t\t\t\t\t}))).Switch()\n\t\t\t\t\t\t\t\t\t\t.OnMouse(debug.EnableDebugMenuByRapidClicking)\n\t\t\t\t\t\t\t\t\t\t.WithPadding(Thickness.Create(new Points(20), 10, 20, 10))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Stroke.Create(1, Theme.PanelBackground)))\n\t\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground)),\n\t\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.IsWindows ? 370 : 430,\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.IsWindows ? 480 : 560)))),\n\t\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\t\tStyle = WindowStyle.Sheet\n\t\t\t\t\t}\n\t\t\t);\n\n\t\t\tShow = () => showAboutDialog.OnNext(true);\n\t\t\tMenu = Menu.Item(Platform.IsWindows ? Strings.About_Menu : Strings.About_Title, Show);\n\t\t}\n\n\t\tstatic IList<TextPart> GetRegisteredToParts(bool isRegistered, string name, string email, Color linkColor, string session)\n\t\t{\n\t\t\treturn isRegistered\n\t\t\t\t? AttributedText.Parts()\n\t\t\t\t\t.Link($\"@{name}\", WebLinks.Dashboard + \"?session=\" + Uri.EscapeUriString(session), linkColor)\n\t\t\t\t\t.Text($\" ({email})\")\n\t\t\t\t: AttributedText.Parts()\n\t\t\t\t\t.Text(Strings.Auth_Text_SignIn1)\n\t\t\t\t\t.Link(Strings.Auth_Text_SignIn2, WebLinks.SignIn, linkColor)\n\t\t\t\t\t.Text(Strings.Auth_Text_SignIn3);\n\t\t}\n\n\t\tstatic IControl CreateOkButton(Command clicked)\n\t\t{\n\t\t\treturn Button.Create(\n\t\t\t\tclicked: clicked,\n\t\t\t\tcontent: bs => Layout.Dock()\n\t\t\t\t\t.Left(Fuse.Icons.Confirm(Theme.Active).CenterVertically())\n\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t.Fill(Label.Create(\n\t\t\t\t\t\ttext: Texts.Button_Ok,\n\t\t\t\t\t\tcolor: Theme.DefaultText))\n\t\t\t\t\t.Center())\n\t\t\t\t.WithHeight(45);\n\t\t}\n\n\t\tpublic Action Show { get; private set; }\n\t\tpublic Menu Menu { get; private set; }\n\n\t\tpublic static string CommitSha\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar config = GetAttribute<AssemblyConfigurationAttribute>()?.Configuration;\n\t\t\t\treturn !string.IsNullOrEmpty(config)\n\t\t\t\t\t? config\n\t\t\t\t\t: \"N/A\";\n\t\t\t}\n\t\t}\n\n\t\tstatic T GetAttribute<T>()\n\t\t{\n\t\t\treturn typeof(About).Assembly.GetCustomAttributes(true).OfType<T>()\n\t\t\t\t.FirstOrDefault();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Activate.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic class Activate\n\t{\n\t\tpublic Activate(ILicense license, IMessagingService daemon)\n\t\t{\n\t\t\tvar showActivateDialog = new BehaviorSubject<bool>(false);\n\t\t\tvar activationCode = new BehaviorSubject<string>(\"\");\n\t\t\tvar errorMessage = Property.Create(\"\");\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: showActivateDialog,\n\t\t\t\twindow: dialog =>\n\t\t\t\t\tnew Window {\n\t\t\t\t\t\tTitle = Texts.Activate_Title,\n\t\t\t\t\t\tContent = Control.Lazy(() =>\n\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t.Bottom(Buttons.DefaultButtonPrimary(Texts.Activate_Button, Command.Enabled(() => {\n\t\t\t\t\t\t\t\t\tvar code = activationCode.Value;\n\n\t\t\t\t\t\t\t\t\tif (string.IsNullOrEmpty(code))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\terrorMessage.Write(Strings.Activate_FeedbackEmpty);\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tnew Thread(() => {\n\t\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tLicenseData.Decode(code);\n\t\t\t\t\t\t\t\t\t\t\tlicense.ActivateLicense(code, daemon);\n\t\t\t\t\t\t\t\t\t\t\tshowActivateDialog.OnNext(false);\n\t\t\t\t\t\t\t\t\t\t\tactivationCode.OnNext(\"\");\n\t\t\t\t\t\t\t\t\t\t\terrorMessage.Write(\"\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t\t\t\t\t\t\t\t\terrorMessage.Write(Strings.Activate_FeedbackInvalid);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}).Start();\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t\t.WithWidth(160)\n\t\t\t\t\t\t\t\t\t.WithPadding(Thickness.Create(new Points(20), 0, 20, 20))\n\t\t\t\t\t\t\t\t\t.CenterHorizontally())\n\t\t\t\t\t\t\t\t.Fill(Layout.StackFromTop(\n\t\t\t\t\t\t\t\t\t\tTextBox.Create(Property.Create(activationCode), isMultiline: true, doWrap: true, foregroundColor: Theme.DefaultText)\n\t\t\t\t\t\t\t\t\t\t\t.WithHeight(130)\n\t\t\t\t\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Theme.FieldStroke))\n\t\t\t\t\t\t\t\t\t\t\t.WithBackground(Theme.PanelBackground),\n\t\t\t\t\t\t\t\t\t\terrorMessage\n\t\t\t\t\t\t\t\t\t\t\t.Select(error =>\n\t\t\t\t\t\t\t\t\t\t\t\tLabel.Create(error, Theme.DescriptorFont, color: Theme.FieldErrorStroke.Brush)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithHeight(15))\n\t\t\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t\t\t.WithPadding(Thickness.Create(new Points(20), 20, 20, 0))\n\t\t\t\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground))\n\t\t\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground)\n\t\t\t\t\t\t\t\t.WithMacWindowStyleCompensation()),\n\t\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.IsWindows ? 520 : 550,\n\t\t\t\t\t\t\t\t\t\t\t\t\tPlatform.IsWindows ? 220 : 250)))),\n\t\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\t\t\tStyle = WindowStyle.Fat\n\t\t\t\t\t}\n\t\t\t);\n\n\t\t\tShow = () => {\n\t\t\t\tshowActivateDialog.OnNext(true);\n\t\t\t\tactivationCode.OnNext(\"\");\n\t\t\t\terrorMessage.Write(\"\");\n\t\t\t};\n\t\t\tMenu = Menu.Item(Texts.Activate_Title, Show);\n\t\t}\n\n\t\tpublic Action Show { get; private set; }\n\t\tpublic Menu Menu { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n    <startup> \n        <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\n    </startup>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.7.0.0\" newVersion=\"4.7.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Runtime.CompilerServices.Unsafe\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.4.1\" newVersion=\"4.0.4.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Xml.XmlDocument\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fuse/studio/ApplicationPaths.cs",
    "content": "﻿using Outracks.Diagnostics;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ApplicationPaths\n\t{\n\t\tpublic static Optional<AbsoluteDirectoryPath> SublimeTextPath()\n\t\t{\n\t\t\treturn Platform.IsMac\n\t\t\t\t? MacEnvironment.GetPathToApplicationsThatContains(\"com.sublimetext.3\").FirstOrNone()\n\t\t\t\t: WindowsEnvironment.LookForPathInUninstall(\"Sublime Text 3\").FirstOrNone();\n\t\t}\n\n\t\tpublic static Optional<AbsoluteDirectoryPath> VsCodePath()\n\t\t{\n\t\t\treturn Platform.IsMac\n\t\t\t\t? MacEnvironment.GetPathToApplicationsThatContains(\"com.microsoft.VSCode\").FirstOrNone()\n\t\t\t\t: WindowsEnvironment.LookForPathInPATH(\"code.cmd\").FirstOrNone().Select(path => path.ContainingDirectory)\n\t\t\t\t\t.Or(() => WindowsEnvironment.LookForPathInUninstall(\"Microsoft Visual Studio Code\").FirstOrNone());\n\t\t}\n\n\t\tpublic static Optional<AbsoluteDirectoryPath> AtomPath()\n\t\t{\n\t\t\treturn Platform.IsMac\n\t\t\t\t? MacEnvironment.GetPathToApplicationsThatContains(\"com.github.atom\").FirstOrNone()\n\t\t\t\t: WindowsEnvironment.LookForPathInApplications(\"atom.exe\").FirstOrNone().Select(path => path.ContainingDirectory);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/BehaviorSubjectExtensions.cs",
    "content": "using System.Reactive.Subjects;\n\nnamespace Outracks.Fuse\n{\n\tstatic class BehaviorSubjectExtensions\n\t{\n\t\tpublic static void OnNextDistinct<T>(this BehaviorSubject<T> subject, T value)\n\t\t{\n\t\t\tif (!value.Equals(subject.Value))\n\t\t\t\tsubject.OnNext(value);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Build.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Fuse.Preview;\nusing Outracks.Fusion;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass Build\n\t{\n\t\tpublic Build(IProject project, ProjectPreview preview, PreviewOnDevice previewOnDevice, Command enableUsbMode, BuildArgs args, Export export)\n\t\t{\n\t\t\tvar buildLibraries = new BehaviorSubject<bool>(false);\n\n\t\t\tvar rebuilt = new Subject<object>();\n\t\t\tRebuilt = rebuilt;\n\n\t\t\tRebuild = Command.Enabled(() =>\n\t\t\t{\n\t\t\t\trebuilt.OnNext(new object());\n\t\t\t\tpreview.Rebuild();\n\t\t\t});\n\n\t\t\tRefresh = Command.Enabled(preview.Refresh);\n\n\t\t\tvar buildFlagsWindowVisible = new BehaviorSubject<bool>(false);\n\n\t\t\tBuildFlags = Command.Enabled(() => buildFlagsWindowVisible.OnNext(true));\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: buildFlagsWindowVisible,\n\t\t\t\twindow: window => BuildFlagsWindow.Create(buildFlagsWindowVisible, args));\n\n\t\t\tBuildArguments = Observable.CombineLatest(\n\t\t\t\targs.Defines, buildLibraries, args.Verbose, project.FilePath,\n\t\t\t\t(d, bl, vb, pp) => new BuildProject(pp.NativePath, List.Create(d.ToArray()), bl, vb));\n\n\t\t\tMenu = Menu.Item(Texts.SubMenu_Preview_Refresh, Refresh, hotkey: HotKey.Create(ModifierKeys.Meta, Key.R))\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_Rebuild, Rebuild, hotkey: HotKey.Create(ModifierKeys.Meta | ModifierKeys.Shift, Key.R))\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Export_Clean, export.Clean)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_Reconnect, enableUsbMode)\n\t\t\t\t + Menu.Separator\n\t\t\t\t + previewOnDevice.Menu\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_BuildFlags, BuildFlags);\n\t\t}\n\n\t\tpublic Menu Menu { get; private set; }\n\n\t\tpublic Command Refresh { get; private set; }\n\t\tpublic Command Rebuild { get; private set; }\n\t\tpublic Command BuildFlags { get; private set; }\n\n\t\tpublic IObservable<object> Rebuilt { get; private set; }\n\n\t\tpublic IObservable<BuildProject> BuildArguments { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/BuildArgs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Mono.Options;\n\nnamespace Outracks.Fuse\n{\n\tpublic struct BuildArgs\n\t{\n\t\tpublic readonly BehaviorSubject<ImmutableList<string>> All;\n\t\tpublic readonly IObservable<IImmutableList<string>> Defines;\n\t\tpublic readonly IObservable<bool> Verbose;\n\n\t\tpublic BuildArgs(IEnumerable<string> initialArgs)\n\t\t{\n\t\t\tvar buildArgs\n\t\t\t\t= GetDefines(initialArgs).Select(d => \"-D\" + d)\n\t\t\t\t.Concat(GetVerbose(initialArgs) ? Optional.Some(\"-v\") : Optional.None());\n\t\t\tAll = new BehaviorSubject<ImmutableList<string>>(buildArgs.ToImmutableList());\n\t\t\tDefines = All.Select(GetDefines).DistinctUntilSequenceChanged().Replay(1).RefCount();\n\t\t\tVerbose = All.Select(GetVerbose).DistinctUntilChanged().Replay(1).RefCount();\n\t\t}\n\n\t\tstatic ImmutableList<string> GetDefines(IEnumerable<string> args)\n\t\t{\n\t\t\treturn args.SelectMany(arg =>\n\t\t\t{\n\t\t\t\tvar trimmed = arg.Trim();\n\t\t\t\treturn trimmed.StartsWith(\"-D\")\n\t\t\t\t\t? Optional.Some(trimmed.Substring(\"-D\".Length))\n\t\t\t\t\t: Optional.None();\n\t\t\t}).ToImmutableList();\n\t\t}\n\n\t\tstatic bool GetVerbose(IEnumerable<string> args)\n\t\t{\n\t\t\treturn args.Any(arg => arg.Trim() == \"-v\");\n\t\t}\n\n\t\tpublic static ImmutableList<string> GetArgumentList(string args)\n\t\t{\n\t\t\tusing (var tr = new StringReader(args))\n\t\t\t\treturn ArgumentSource.GetArguments(tr).ToImmutableList();\n\t\t}\n\n\t\tpublic static string GetArgumentString(IEnumerable<string> args)\n\t\t{\n\t\t\treturn args.Select(Uno.Extensions.QuoteSpace).Join(\" \");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/BuildFlagsWindow.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Diagnostics;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class BuildFlagsWindow\n\t{\n\t\tpublic static Window Create(BehaviorSubject<bool> showWindow, BuildArgs args)\n\t\t{\n\t\t\treturn new Window\n\t\t\t{\n\t\t\t\tTitle = Observable.Return(\"Add build flags\"),\n\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(600, 280)))),\n\t\t\t\tContent = Control.Lazy(() => CreateContent(showWindow, args)),\n\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\tStyle = WindowStyle.Fat,\n\t\t\t};\n\t\t}\n\n\t\tstatic IControl CreateContent(BehaviorSubject<bool> showWindow, BuildArgs buildArgs)\n\t\t{\n\t\t\tvar editString = Property.Create(\"\");\n\t\t\tvar editArgs = editString.Convert(BuildArgs.GetArgumentList, BuildArgs.GetArgumentString);\n\n\t\t\tAction save = async () => buildArgs.All.OnNext(await editArgs.FirstAsync());\n\t\t\tbuildArgs.All.ConnectWhile(showWindow).Subscribe(args => editArgs.Write(args));\n\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Bottom(CreateButtons(showWindow, save: save))\n\t\t\t\t.Bottom(Separator.Medium)\n\t\t\t\t.Fill(\n\t\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\ttext: \"Separate flags with a space. Flags apply to all targets.\",\n\t\t\t\t\t\t\t\t\tcolor: Theme.DefaultText)\n\t\t\t\t\t\t\t\t.CenterHorizontally(),\n\t\t\t\t\t\t\tSpacer.Medim,\n\t\t\t\t\t\t\tThemedTextBox.Create(editString, doWrap: true),\n\t\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\ttext: \"Presets\",\n\t\t\t\t\t\t\t\tcolor: Theme.DefaultText),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\tCreateFlagCheckBox(showWindow, editArgs, \"-DCOCOAPODS\", \"Enable CocoaPods builds on iOS (-DCOCOAPODS)\"),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\tCreateFlagCheckBox(showWindow, editArgs, \"-DDEBUG_V8\", \"Enable the V8 debugger (-DDEBUG_V8)\"),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\tCreateFlagCheckBox(showWindow, editArgs, \"-f\", \"Build even if output is up-to-date (-f)\"),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\tCreateFlagCheckBox(showWindow, editArgs, \"-v\", \"Enable verbose build log (-v)\"))\n\t\t\t\t\t\t.WithMacWindowStyleCompensation()\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(45, 0, 45, 15)))\n\t\t\t\t.WithBackground(Theme.WorkspaceBackground);\n\t\t}\n\n\t\tstatic IControl CreateButtons(IObserver<bool> showWindow, Action save)\n\t\t{\n\t\t\tvar cancelButton = CreateButton(\n\t\t\t\ticon: Icons.Cancel(Theme.Cancel),\n\t\t\t\ttext: Texts.Button_Cancel,\n\t\t\t\tclicked: Command.Enabled(() => showWindow.OnNext(false)));\n\n\t\t\tvar doneButton = CreateButton(\n\t\t\t\ticon: Icons.Confirm(Theme.Active),\n\t\t\t\ttext: Texts.Button_Done,\n\t\t\t\tclicked: Command.Enabled(() =>\n\t\t\t\t{\n\t\t\t\t\tsave();\n\t\t\t\t\tshowWindow.OnNext(false);\n\t\t\t\t}));\n\n\t\t\tvar leftButton = Platform.IsMac ? cancelButton : doneButton;\n\t\t\tvar rightButton = Platform.IsMac ? doneButton : cancelButton;\n\n\t\t\treturn Layout.SubdivideHorizontally(\n\t\t\t\t\tLayout.Dock().Right(Separator.Medium).Fill(leftButton),\n\t\t\t\t\trightButton)\n\t\t\t\t.WithHeight(45);\n\t\t}\n\n\t\tstatic IControl CreateButton(IControl icon, Text text, Command clicked)\n\t\t{\n\t\t\treturn Button.Create(\n\t\t\t\tclicked: clicked,\n\t\t\t\tcontent: bs => Layout.Dock()\n\t\t\t\t\t.Left(icon.CenterVertically())\n\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t.Fill(Label.Create(\n\t\t\t\t\t\ttext: text,\n\t\t\t\t\t\tcolor: Theme.DefaultText))\n\t\t\t\t\t.Center());\n\t\t}\n\n\t\tstatic IControl CreateFlagCheckBox(\n\t\t\tIObservable<bool> showWindow,\n\t\t\tIProperty<ImmutableList<string>> editArgs,\n\t\t\tstring flag,\n\t\t\tstring text)\n\t\t{\n\t\t\tvar contains = editArgs.Contains(flag);\n\t\t\treturn Layout.StackFromLeft(\n\t\t\t\t\tCheckBox.Create(contains.And(showWindow), contains.Toggle()),\n\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\tLabel.Create(text: text, color: Theme.DefaultText).CenterVertically(),\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.OnMouse(pressed: contains.Toggle());\n\t\t}\n\n\t\tstatic IProperty<bool> Contains(this IProperty<ImmutableList<string>> self, string flag)\n\t\t{\n\t\t\treturn self.Convert(\n\t\t\t\tconvert: flags => flags.Contains(flag),\n\t\t\t\tconvertBack: (flags, shouldContain) => shouldContain\n\t\t\t\t\t? AddFlag(flags.Or(ImmutableList<string>.Empty), flag)\n\t\t\t\t\t: RemoveFlag(flags.Or(ImmutableList<string>.Empty), flag));\n\t\t}\n\n\t\tstatic ImmutableList<string> AddFlag(ImmutableList<string> flags, string flag)\n\t\t{\n\t\t\treturn flags.Contains(flag) ? flags : flags.ConcatOne(flag).ToImmutableList();\n\t\t}\n\n\t\tstatic ImmutableList<string> RemoveFlag(ImmutableList<string> flags, string flag)\n\t\t{\n\t\t\treturn flags.Where(f => f != flag).ToImmutableList();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/CodeView.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing System.Reactive.Linq;\nusing Fuse.Preview;\nusing Outracks.Fusion;\nusing QRCoder;\n\nnamespace Outracks.Fuse\n{\n\tclass CodeView\n\t{\n\t\treadonly Code _code;\n\t\treadonly Optional<IPAddress> _endpoint;\n\t\treadonly IControl _qrCode;\n\n\t\tpublic CodeView(Code code, IPAddress[] endpoints)\n\t\t{\n\t\t\t_code = code;\n\t\t\t_endpoint = endpoints.Where(address => address.Equals(IPAddress.Loopback) == false).LastOrNone();\n\t\t\t_qrCode = CreateQrCode(CreateCodeQrData(endpoints, code));\n\t\t}\n\n\t\tstatic string CreateCodeQrData(IEnumerable<IPAddress> endpoints, Code code)\n\t\t{\n\t\t\treturn string.Join(\"\\n\", endpoints) + \"\\nCode:\" + code;\n\t\t}\n\n\t\tpublic IControl Create(IPopover popover)\n\t\t{\n\t\t\treturn Create(popover, _code, _endpoint, _qrCode);\n\t\t}\n\n\t\tpublic static IControl Create(IPopover popover, Code code, Optional<IPAddress> endpoint, IControl qrCode)\n\t\t{\n\t\t\treturn popover.CreatePopover(\n\t\t\t\tRectangleEdge.Top,\n\t\t\t\tstate =>\n\t\t\t\t{\n\t\t\t\t\treturn\n\t\t\t\t\t\tButton.Create(state.IsVisible.Toggle(), s =>\n\t\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\t\tControl.Empty.WithWidth(4),\n\t\t\t\t\t\t\t\t\tIcons.DevicesIcon(),\n\t\t\t\t\t\t\t\t\tControl.Empty.WithWidth(4),\n\t\t\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\t\t\ttext: Texts.CodeView_Devices,\n\t\t\t\t\t\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\t\t\t\t\t\tfont: Theme.DescriptorFont)\n\t\t\t\t\t\t\t\t\t\t.CenterVertically(),\n\t\t\t\t\t\t\t\t\tControl.Empty.WithWidth(4))\n\t\t\t\t\t\t\t\t.SetToolTip(Texts.CodeView_ToolTip)\n\t\t\t\t\t\t\t\t.WithBackground(\n\t\t\t\t\t\t\t\t\tbackground: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\t\ts.IsEnabled, s.IsHovered,\n\t\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t\t? Theme.FaintBackground\n\t\t\t\t\t\t\t\t\t\t\t\t\t: Color.Transparent)\n\t\t\t\t\t\t\t\t\t\t.Switch()));\n\t\t\t\t},\n\t\t\t\tstate =>\n\t\t\t\t{\n\t\t\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\t\tqrCode,\n\t\t\t\t\t\tTextView(\"IP address:\", endpoint.Select(e => e.ToString()).Or(\"Failed to find IP\")),\n\t\t\t\t\t\tTextView(\"Code:\", code.ToString())\n\t\t\t\t\t)\n\t\t\t\t\t.WithWidth(200)\n\t\t\t\t\t.CenterHorizontally()\n\t\t\t\t\t.WithPadding(new Thickness<Points>(0,8,0,16))\n\t\t\t\t\t.WithWidth(250);\n\t\t\t\t});\n\t\t}\n\n\t\tstatic IControl TextView(string section, string data)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tLabel.Create(section, color: Theme.DefaultText).WithPadding(new Thickness<Points>(0, 8)),\n\t\t\t\t\tLabel.Create(data, font: Font.SystemDefault(20), color: Color.FromRgb(0x707aff), textAlignment: TextAlignment.Center)\n\t\t\t\t\t.WithPadding(new Thickness<Points>(16, 8))\n\t\t\t\t\t.WithOverlay(\n\t\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\t\tstroke: Stroke.Create(1, Theme.LineBrush),\n\t\t\t\t\t\t\tfill: Brush.Transparent,\n\t\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)))));\n\t\t}\n\n\t\tstatic IControl CreateQrCode(string data)\n\t\t{\n\t\t\tvar qrGenerator = new QRCodeGenerator();\n\t\t\tvar qrCodeData = qrGenerator.CreateQrCode(data, QRCodeGenerator.ECCLevel.Q);\n\t\t\tvar qrCode = new QRCode(qrCodeData);\n\t\t\tvar pixelSize = 3;\n\t\t\treturn Image.FromBitmaps(new[] { qrCode.GetGraphic(pixelSize), qrCode.GetGraphic(2 * pixelSize) });\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/AndroidBuildTools.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Components\n{\n\tclass AndroidBuildTools : ScriptInstaller\n\t{\n\t\tpublic AndroidBuildTools(AbsoluteDirectoryPath componentsDir)\n\t\t\t: base(\"android\", \"Install all required components to build for Android\", componentsDir)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/AtomPlugin.cs",
    "content": "﻿using System;\nusing System.Text.RegularExpressions;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Components\n{\n\tpublic class AtomPlugin : ComponentInstaller\n\t{\n\t\tpublic AtomPlugin() : base(\"atom-plugin\", \"Install Fuse plugin for Atom.\") {}\n\n\t\tpublic override void Install()\n\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar apmPath = GetApmPath();\n\t\t\t\t\tvar result = RunProcess(apmPath, \"install fuse\", TimeSpan.FromSeconds(60));\n\t\t\t\t\tif (result.ExitCode != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception(\"'\" + apmPath + \"' exited with code='\" + result.ExitCode + \"', stdout='\" + result.StdOut + \"', stderr='\" + result.StdErr + \"'\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tthrow new PluginInstallerFailed(e.Message);\n\t\t\t\t}\n\t\t}\n\n\t\tpublic override ComponentStatus Status\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar apmPath = GetApmPath();\n\t\t\t\t\tvar result = RunProcess(apmPath, \"list -i --bare\", TimeSpan.FromSeconds(10));\n\t\t\t\t\tif (result.ExitCode != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception(\"'\" + apmPath + \"' exited with code='\" + result.ExitCode + \"', stdout='\" + result.StdOut + \"', stderr='\" + result.StdErr + \"'\");\n\t\t\t\t\t}\n\t\t\t\t\treturn new Regex(\"(^|\\\\n)fuse@\").IsMatch(result.StdOut) ? ComponentStatus.Installed : ComponentStatus.NotInstalled;\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tthrow new PluginInstallerFailed(e.Message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic AbsoluteDirectoryPath GetApmPath()\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t{\n\t\t\t\tvar atomPath = ApplicationPaths.AtomPath();\n\t\t\t\tif (!atomPath.HasValue)\n\t\t\t\t{\n\t\t\t\t\t//It's not possible to detect the Atom path on Windows 7, so show a message in that case\n\t\t\t\t\tvar os = Environment.OSVersion;\n\t\t\t\t\tvar win7Info = (os.Platform == PlatformID.Win32NT && os.Version.Major == 6 && os.Version.Minor == 0)\n\t\t\t\t\t\t? \" Note that we are unable to detect the Atom installation path on Windows 7.\"\n\t\t\t\t\t\t: \"\";\n\t\t\t\t\tthrow new Exception(\"Failed to find Atom path. Is Atom installed?\" + win7Info);\n\t\t\t\t}\n\t\t\t\treturn atomPath.Value / \"..\" / \"bin\" / \"apm.cmd\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn AbsoluteDirectoryPath.Parse(\"apm\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/ComponentInstaller.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Text;\nusing Outracks.IO;\nusing Uno;\n\nnamespace Outracks.Fuse.Components\n{\n\tpublic abstract class ComponentInstaller\n\t{\n\t\tpublic abstract void Install(); //TODO should take some sort of text writer / logger to write output to. Conosle from `fuse install`, otherwise log window in Fuse if possible.\n\t\tpublic abstract ComponentStatus Status { get; }\n\n\t\tpublic readonly string Name;\n\t\tpublic readonly string Description;\n\t\tprotected ComponentInstaller(string name, string description)\n\t\t{\n\t\t\tName = name;\n\t\t\tDescription = description;\n\t\t}\n\n\t\tprotected static ProcessResult RunScript(IAbsolutePath path, string args, TimeSpan timeout, AbsoluteDirectoryPath workingDir = null)\n\t\t{\n\t\t\treturn RunProcess(AbsoluteFilePath.Parse(\"node\"), path.NativePath.QuoteSpace() + \" \" + args, timeout, workingDir);\n\t\t}\n\n\t\tprotected static ProcessResult RunProcess(IAbsolutePath path, string args, TimeSpan timeout, AbsoluteDirectoryPath workingDir = null )\n\t\t{\n\t\t\tvar stdout = new StringBuilder();\n\t\t\tvar stderr = new StringBuilder();\n\t\t\tvar p = new Process\n\t\t\t{\n\t\t\t\tStartInfo = new ProcessStartInfo\n\t\t\t\t{\n\t\t\t\t\tFileName = path.NativePath,\n\t\t\t\t\tArguments = args,\n\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\tCreateNoWindow = true,\n\t\t\t\t\tRedirectStandardError = true,\n\t\t\t\t\tRedirectStandardOutput = true\n\t\t\t\t}\n\t\t\t};\n\t\t\tif (workingDir != null)\n\t\t\t{\n\t\t\t\tp.StartInfo.WorkingDirectory = workingDir.NativePath;\n\t\t\t}\n\t\t\tp.OutputDataReceived += (s, e) => stdout.Append(e.Data + \"\\n\");\n\t\t\tp.ErrorDataReceived += (s, e) => stderr.Append(e.Data + \"\\n\");\n\t\t\tp.Start();\n\t\t\tp.BeginOutputReadLine();\n\t\t\tp.BeginErrorReadLine();\n\t\t\tvar exited = p.WaitForExit((int)timeout.TotalMilliseconds);\n\t\t\tif (!exited)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"'\" + p.StartInfo.FileName + \"' failed to exit\");\n\t\t\t}\n\t\t\treturn new ProcessResult(p.ExitCode, stdout.ToString(), stderr.ToString());\n\t\t}\n\t}\n\n\tpublic struct ProcessResult\n\t{\n\t\tpublic readonly int ExitCode;\n\t\tpublic readonly string StdOut;\n\t\tpublic readonly string StdErr;\n\t\tpublic ProcessResult(int exitCode, string stdOut, string stdErr)\n\t\t{\n\t\t\tExitCode = exitCode;\n\t\t\tStdOut = stdOut;\n\t\t\tStdErr = stdErr;\n\t\t}\n\t}\n\n\tpublic class PluginInstallerFailed : Exception\n\t{\n\t\tpublic PluginInstallerFailed(string msg) : base(msg) { }\n\t}\n\n\tpublic enum ComponentStatus\n\t{\n\t\tInstalled = 0,\n\t\tNotInstalled = 100,\n\t\tUpdateAvailable = 200\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/ComponentInstallers.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Outracks.Fuse.Components\n{\n    public class ComponentInstallers\n    {\n\t    public readonly List<ComponentInstaller> Components;\n\n\t    public ComponentInstallers(IFuse fuse)\n\t    {\n\t\t    Components = new List<ComponentInstaller>\n\t\t    {\n\t\t\t\tnew AndroidBuildTools(fuse.ComponentsDir),\n\t\t\t    new AtomPlugin(),\n\t\t\t\tnew VsCodeExtension(fuse.ComponentsDir),\n#pragma warning disable CS0612 // Type or member is obsolete\n\t\t\t\tnew VsCodePlugin(fuse.ComponentsDir),\n#pragma warning restore CS0612 // Type or member is obsolete\n\t\t\t\tnew SublimePlugin(fuse.ComponentsDir)\n\t\t    };\n\t    }\n    }\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/ScriptInstaller.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Components\n{\n\tabstract class ScriptInstaller : ComponentInstaller\n\t{\n\t\treadonly AbsoluteDirectoryPath _workingDir;\n\t\treadonly AbsoluteFilePath _install;\n\n\t\tprotected ScriptInstaller(string name, string description, AbsoluteDirectoryPath componentsDir, string componentName)\n\t\t\t: base(name, description)\n\t\t{\n\t\t\t_workingDir = componentsDir / componentName;\n\t\t\t_install = _workingDir / new FileName(\"install.js\");\n\t\t}\n\n\t\tprotected ScriptInstaller(string name, string description, AbsoluteDirectoryPath componentsDir)\n\t\t\t: this(name, description, componentsDir, name)\n\t\t{\n\t\t}\n\n\t\tpublic override void Install()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar result = RunScript(_install, \"\", TimeSpan.FromSeconds(60), _workingDir);\n\t\t\t\tif (result.ExitCode != 0)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"Installation script exited with code='\" + result.ExitCode + \"', stdout='\" + result.StdOut + \"', stderr='\" + result.StdErr + \"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new PluginInstallerFailed(e.Message);\n\t\t\t}\n\t\t}\n\n\t\tpublic override ComponentStatus Status\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar p = RunScript(_install, \"-s\", TimeSpan.FromSeconds(10), _workingDir);\n\t\t\t\t\tif (!Enum.IsDefined(typeof(ComponentStatus), p.ExitCode))\n\t\t\t\t\t\tthrow new PluginInstallerFailed(\"Unknown install status from \" + Name + \": exit code='\" + p.ExitCode + \"', stdout='\" + p.StdOut + \"', stderr='\" + p.StdErr + \"'\");\n\n\t\t\t\t\treturn (ComponentStatus)p.ExitCode;\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tthrow new PluginInstallerFailed(e.Message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/SublimePlugin.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Components\n{\n\tclass SublimePlugin : ScriptInstaller\n\t{\n\t\tpublic SublimePlugin(AbsoluteDirectoryPath componentsDir)\n\t\t\t: base(\"sublime-plugin\", \"Install Fuse plugin for Sublime Text 3\", componentsDir)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/VsCodeExtension.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Components\n{\n\tclass VsCodeExtension : ScriptInstaller\n\t{\n\t\tpublic VsCodeExtension(AbsoluteDirectoryPath componentsDir)\n\t\t\t: base(\"vscode-extension\", \"Install Fuse extension for Visual Studio Code\", componentsDir)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Components/VsCodePlugin.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Components\n{\n\t[Obsolete]\n\tclass VsCodePlugin : ScriptInstaller\n\t{\n\t\tpublic VsCodePlugin(AbsoluteDirectoryPath componentsDir)\n\t\t\t: base(\"vscode-plugin\", \"Install Fuse extension for Visual Studio Code (legacy)\", componentsDir, \"vscode-extension\")\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Controls/BrowseButton.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class BrowseButton\n\t{\n\t\tinternal static IControl Create(\n\t\t\tIProperty<string> property,\n\t\t\tIObservable<AbsoluteDirectoryPath> projectRoot,\n\t\t\tFileFilter[] fileFilters,\n\t\t\tText dialogCaption)\n\t\t{\n\t\t\tvar browseCommand = Command.Enabled(() => Task.Run(\n\t\t\t\tasync () =>\n\t\t\t\t{\n\t\t\t\t\tvar root = await projectRoot.FirstAsync();\n\t\t\t\t\tvar fn = await FileDialog.OpenFile(new FileDialogOptions(await dialogCaption.FirstAsync() ?? \"Open\", root, fileFilters));\n\t\t\t\t\tfn.Do(\n\t\t\t\t\t\tfdr =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Have tested that RelativeTo works on Windows for paths on different\n\t\t\t\t\t\t\t// drives; in that case it just gives us back the absolute path\n\t\t\t\t\t\t\tvar relPath = fdr.Path.RelativeTo(root).NativeRelativePath;\n\n\t\t\t\t\t\t\t// Replace backslash on Windows to make the path valid across platforms\n\t\t\t\t\t\t\tif (Path.DirectorySeparatorChar == '\\\\')\n\t\t\t\t\t\t\t\trelPath = relPath.Replace('\\\\', '/');\n\t\t\t\t\t\t\tproperty.Write(relPath, true);\n\t\t\t\t\t\t});\n\t\t\t\t}));\n\n\t\t\tvar arrowBrush = property.IsReadOnly.Select(ro => ro ? Theme.FieldStroke.Brush : Theme.Active).Switch();\n\t\t\tvar browseButtonCircles =\n\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\tEnumerable.Range(0, 3).Select(\n\t\t\t\t\t\t\ti => Shapes.Circle(fill: arrowBrush)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(2, 2))\n\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(1))))\n\t\t\t\t\t.WithPadding(new Thickness<Points>(3));\n\t\t\treturn browseButtonCircles\n\t\t\t\t.Center()\n\t\t\t\t.WithWidth(21)\n\t\t\t\t.WithBackground(Theme.WorkspaceBackground)\n\t\t\t\t.OnMouse(pressed: browseCommand);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Controls/ConfirmCancelControl.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n    public static class ConfirmCancelControl\n    {\n        public static IControl Create(\n            Command close,\n            Command confirm,\n            IControl fill,\n            Command? cancel,\n            Text? confirmText,\n            Text? cancelText,\n            Text? confirmTooltip)\n        {\n            var confirmButton = ThemedButton.Create(\n                command: confirm.Then(close),\n                label: confirmText ?? Texts.Button_Ok,\n                icon: Icons.Confirm(Theme.Active),\n                tooltip: confirmTooltip ?? default(Text),\n                hoverColor: Theme.Active);\n\n            var cancelButton = ThemedButton.Create(\n                command: (cancel ?? Command.Enabled(() => { }).Then(close)),\n                label: cancelText ?? Texts.Button_Cancel,\n                icon: Icons.Cancel(Theme.Cancel),\n                tooltip: null,\n                hoverColor: Theme.Cancel);\n\n            var buttons = Layout.Dock()\n                .Bottom(\n                    Layout.Dock()\n                        .Top(Separator.Medium)\n                        .Fill(Layout.SubdivideHorizontallyWithSeparator(Separator.Medium, cancelButton, confirmButton)))\n                .Fill(fill);\n            return buttons;\n        }\n    }\n}\n"
  },
  {
    "path": "src/fuse/studio/Controls/FilePathControl.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Inspector;\nusing Outracks.Fuse.Inspector.Editors;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class FilePathControl\n\t{\n\t\tinternal static IControl Create(\n\t\t\tIProperty<string> property,\n\t\t\tIObservable<AbsoluteDirectoryPath> projectRoot,\n\t\t\tFileFilter[] fileFilters,\n\t\t\tText placeholderText,\n\t\t\tText toolTip,\n\t\t\tText dialogCaption)\n\t\t{\n\t\t\tvar hidePlaceholder = property.Select(x => !string.IsNullOrEmpty(x));\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Right(BrowseButton.Create(property, projectRoot, fileFilters, dialogCaption))\n\t\t\t\t.Right(Separator.Line(Theme.FieldStroke))\n\t\t\t\t.Fill(\n\t\t\t\t\tTextBox.Create(\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tforegroundColor: Theme.DefaultText)\n\t\t\t\t\t\t.WithPlaceholderText(hidePlaceholder, placeholderText)\n\t\t\t\t\t\t.SetToolTip(toolTip))\n\t\t\t\t.WithBorderAndSize();\n\t\t}\n\n\t\tstatic IControl WithBorderAndSize(this IControl control)\n\t\t{\n\t\t\treturn control\n\t\t\t\t.WithPadding(new Thickness<Points>(1))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Theme.FieldStroke))\n\t\t\t\t.WithBackground(Shapes.Rectangle(fill: Theme.FieldBackground))\n\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight)\n\t\t\t\t.WithWidth(CellLayout.FullCellWidth);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Dashboard/CreateProject.cs",
    "content": "using System;\nusing System.IO;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fuse.Templates;\nusing Outracks.Fusion;\nusing Outracks.Fusion.Dialogs;\nusing Outracks.IO;\nusing Uno.Collections;\nusing Uno.Configuration;\n\nnamespace Outracks.Fuse.Dashboard\n{\n\tclass CreateProject\n\t{\n\t\treadonly Shell _shell;\n\t\treadonly IFuse _fuse;\n\n\t\tprivate static readonly Thickness<Points> LabelThickness = new Thickness<Points>(6, 0, 6, 0);\n\t\tprivate static readonly Thickness<Points> ControlPadding = new Thickness<Points>(8, 8, 8, 8);\n\n\t\tpublic CreateProject(IFuse fuse)\n\t\t{\n\t\t\t_fuse = fuse;\n\t\t\t_shell = new Shell();\n\t\t}\n\n\t\tpublic Task<bool> ShowDialog(Template template, IDialog<object> parent)\n\t\t{\n\t\t\treturn parent.ShowDialog<bool>(dialog =>\n\t\t\t\tnew Window\n\t\t\t\t{\n\t\t\t\t\tStyle = WindowStyle.Sheet,\n\t\t\t\t\tTitle = Observable.Return(\"New Project\"),\n\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(400, 275)))),\n\t\t\t\t\tContent = Control.Lazy(() => CreateContent(template, dialog)),\n\t\t\t\t});\n\t\t}\n\n\t\tIControl CreateContent(Template template, IDialog<bool> dialog)\n\t\t{\n\t\t\tvar projectLocation =\n\t\t\t\tUserSettings.Folder(\"MostRecentlyUsedFolder\")\n\t\t\t\t\t.Convert(v => v.Or(Optional.Some(_fuse.ProjectsDir)), d => d)\n\t\t\t\t\t.AutoInvalidate(TimeSpan.FromMilliseconds(100));\n\t\t\tvar validatedLocation = projectLocation.Validate(v => v.NativePath, ValidateExistingDirectory);\n\n\t\t\tvar projectName = Property.Create(\n\t\t\t\tOptional.Some(_shell.MakeUnique(projectLocation.Latest().First().Value / \"App\").Name));\n\t\t\tvar validatedName =\n\t\t\t\tprojectName.Validate(v => v.ToString(), DirectoryName.Validate);\n\n\t\t\tvar possibleProjectName = projectLocation.CombineLatest(\n\t\t\t\t\tprojectName,\n\t\t\t\t\t(loc, pro) => { return loc.SelectMany(l => pro.Select(n => l / n)); })\n\t\t\t\t.Select(\n\t\t\t\t\td => d.HasValue && Directory.Exists(d.Value.NativePath) ?\n\t\t\t\t\tOptional.Some(\"Project '\" + d.Value.Name + \"' already exists in \" + d.Value.ContainingDirectory.NativePath) :\n\t\t\t\t\tOptional.None());\n\n\t\t\tvar gitSupport = UserSettings.Bool(\"CreateProjectGitSupport\")\n\t\t\t\t.Convert(v => v.Or(false), v => v);\n\t\t\tvar typescriptSupport = UserSettings.Bool(\"CreateProjectTypeScriptSupport\")\n\t\t\t\t.Convert(v => v.Or(false), v => v);\n\t\t\tvar vscodeSupport = UserSettings.Bool(\"CreateProjectVSCodeSupport\")\n\t\t\t\t.Convert(v => v.Or(false), v => v);\n\n\t\t\treturn\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Bottom(Layout.Dock()\n\t\t\t\t\t\t.Right(\n\t\t\t\t\t\t\tButtons.DefaultButtonPrimary(\n\t\t\t\t\t\t\t\ttext: Texts.Dashboard_Button_Create,\n\t\t\t\t\t\t\t\tcmd: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\tprojectName, projectLocation, gitSupport, typescriptSupport, vscodeSupport,\n\t\t\t\t\t\t\t\t\t(name, location, git, typescript, vscode) =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar projectDirectory =\n\t\t\t\t\t\t\t\t\t\t\tlocation.SelectMany(l =>\n\t\t\t\t\t\t\t\t\t\t\t\tname.Select(n => l / n))\n\t\t\t\t\t\t\t\t\t\t\t.Where(d => !_shell.Exists(d));\n\n\t\t\t\t\t\t\t\t\t\treturn Command.Create(\n\t\t\t\t\t\t\t\t\t\t\tisEnabled: projectDirectory.HasValue,\n\t\t\t\t\t\t\t\t\t\t\taction: async () =>\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar spawnTemplate = new SpawnTemplate(_shell);\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar resultPath = spawnTemplate.CreateProject(name.Value.ToString(), template.Filter(git, typescript, vscode), location.Value);\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar projectPath = resultPath / new FileName(name.Value + \".unoproj\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tawait Application.OpenDocument(projectPath, showWindow: true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tdialog.Close(true);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t_fuse.Report.Exception(this, e);\n\t\t\t\t\t\t\t\t\t\t\t\t\tMessageBox.Show(\"Could not create a project.\\n\\n\" + e.Message, \"Error\", MessageBoxType.Error);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}).Switch())\n\t\t\t\t\t\t\t\t.WithWidth(104))\n\t\t\t\t\t\t.Right(Buttons.DefaultButton(text: Texts.Button_Cancel, cmd: Command.Enabled(() => dialog.Close(false)))\n\t\t\t\t\t\t\t.WithWidth(104)\n\t\t\t\t\t\t\t.WithPadding(right: new Points(16)))\n\t\t\t\t\t\t.Fill())\n\n\t\t\t\t\t.Fill(\n\t\t\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\t\tLabel.Create(\"Name\", color: Theme.DescriptorText)\n\t\t\t\t\t\t\t\t.WithPadding(LabelThickness),\n\t\t\t\t\t\t\tValidatedTextBox.Create(validatedName)\n\t\t\t\t\t\t\t\t.WithPadding(ControlPadding),\n\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithHeight(8),\n\t\t\t\t\t\t\tLabel.Create(\"Location\", color: Theme.DescriptorText)\n\t\t\t\t\t\t\t\t.WithPadding(LabelThickness),\n\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t.Right(\n\t\t\t\t\t\t\t\t\tButtons.DefaultButton(text: Texts.Button_Browse, cmd: Command.Enabled(async () =>\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tvar directory = await dialog.BrowseForDirectory(await projectLocation.FirstAsync().Or(DirectoryPath.GetCurrentDirectory()));\n\t\t\t\t\t\t\t\t\t\t\tif (directory.HasValue)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tprojectLocation.Write(directory.Value, save: true);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t\t.WithWidth(80)\n\t\t\t\t\t\t\t\t\t.WithHeight(22)\n\t\t\t\t\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t\t\t\t\t.WithPadding(LabelThickness)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.Fill(ValidatedTextBox.Create(validatedLocation)\n\t\t\t\t\t\t\t\t\t.WithPadding(ControlPadding)),\n\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithHeight(8),\n\t\t\t\t\t\t\tLabel.Create(\"Tooling\", color: Theme.DescriptorText)\n\t\t\t\t\t\t\t\t.WithPadding(LabelThickness),\n\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithHeight(6),\n\t\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\t\tSpacer.Small2,\n\t\t\t\t\t\t\t\t\tCheckBox.Create(gitSupport, gitSupport.Toggle(true)),\n\t\t\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\t\t\tLabel.Create(text: \"Git\", color: Theme.DescriptorText).CenterVertically(),\n\t\t\t\t\t\t\t\t\tSpacer.Medium)\n\t\t\t\t\t\t\t\t.OnMouse(gitSupport.Toggle(true)),\n\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithHeight(3),\n\t\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\t\tSpacer.Small2,\n\t\t\t\t\t\t\t\t\tCheckBox.Create(typescriptSupport, typescriptSupport.Toggle(true)),\n\t\t\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\t\t\tLabel.Create(text: \"TypeScript (package.json)\", color: Theme.DescriptorText).CenterVertically(),\n\t\t\t\t\t\t\t\t\tSpacer.Medium)\n\t\t\t\t\t\t\t\t.OnMouse(typescriptSupport.Toggle(true)),\n\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithHeight(3),\n\t\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\t\tSpacer.Small2,\n\t\t\t\t\t\t\t\t\tCheckBox.Create(vscodeSupport, vscodeSupport.Toggle(true)),\n\t\t\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\t\t\tLabel.Create(text: \"Visual Studio Code\", color: Theme.DescriptorText).CenterVertically(),\n\t\t\t\t\t\t\t\t\tSpacer.Medium)\n\t\t\t\t\t\t\t\t.OnMouse(vscodeSupport.Toggle(true)),\n\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithHeight(8),\n\t\t\t\t\t\t\tErrorLabel.Create(possibleProjectName)\n\t\t\t\t\t\t\t\t.WithPadding(ControlPadding)))\n\t\t\t\t\t.WithPadding(ControlPadding)\n\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground);\n\t\t}\n\n\t\tpublic static IValidationResult<AbsoluteDirectoryPath> ValidateExistingDirectory(string nativePath)\n\t\t{\n\t\t\tvar parsed = AbsoluteDirectoryPath.TryParse(nativePath);\n\t\t\tif (parsed.HasValue && !Directory.Exists(nativePath))\n\t\t\t{\n\t\t\t\treturn Optional.None<AbsoluteDirectoryPath>().AsValidationResult(\"No such directory\");\n\t\t\t}\n\t\t\treturn parsed.AsValidationResult(\"Invalid path\");\n\t\t}\n\n\t\tstatic class ValidatedTextBox\n\t\t{\n\t\t\tpublic static IControl Create(IValidatedProperty<string> value)\n\t\t\t{\n\t\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tTextBox.Create(value, foregroundColor: Theme.DefaultText)\n\t\t\t\t\t\t.WithHeight(20)\n\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Theme.FieldStroke))\n\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground), // TODO Should show full path on mouse over if truncated?\n\t\t\t\t\tErrorLabel.Create(value.ValidationError)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tstatic class ErrorLabel\n\t\t{\n\t\t\tpublic static IControl Create(IObservable<Optional<string>> error)\n\t\t\t{\n\t\t\t\treturn error.SelectPerElement(\n\t\t\t\t\t\tv => Label.Create(v, Theme.DescriptorFont, color: Theme.FieldErrorStroke.Brush)\n\t\t\t\t\t\t\t.WithHeight(15))\n\t\t\t\t\t.Or(Control.Empty).Switch();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static class UnoConfigExtensions\n\t{\n\t\tpublic static AbsoluteDirectoryPath GetTemplatesDir(this UnoConfig unoConfig)\n\t\t{\n\t\t\treturn AbsoluteDirectoryPath.Parse(unoConfig.GetFullPath(\"Fuse.Templates\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Dashboard/Dashboard.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Dashboard\n{\n\tclass Dashboard\n\t{\n\t\treadonly ISubject<bool> _isVisible = new BehaviorSubject<bool>(false);\n\n\t\tpublic Dashboard(CreateProject createProject, IFuse fuse, IMessagingService daemon, Activate activate)\n\t\t{\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: _isVisible,\n\t\t\t\twindow: window => new Window\n\t\t\t\t{\n\t\t\t\t\tStyle = WindowStyle.Fat,\n\t\t\t\t\tTitle = Observable.Return(\"fuse X\"),\n\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(970, 608)))),\n\t\t\t\t\tContent = Control.Lazy(() => CreateContent(createProject, window, fuse.Version, fuse.License, daemon, activate)),\n\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\t\t// Title clashes with Tabs on macOS.\n\t\t\t\t\tHideTitle = Platform.IsMac,\n\t\t\t\t});\n\t\t}\n\n\t\tpublic void Show()\n\t\t{\n\t\t\t_isVisible.OnNext(true);\n\t\t}\n\n\t\tIControl CreateContent(CreateProject createProject, IDialog<object> dialog, string fuseVersion, ILicense license, IMessagingService daemon, Activate activate)\n\t\t{\n\t\t\tvar versionStr = \"v\" + fuseVersion;\n\t\t\tvar projectList = new ProjectList(new Shell(), createProject, dialog);\n\t\t\tvar openProjectFromDialog =\n\t\t\t\tCommand.Enabled(() => Application.ShowOpenDocumentDialog(DocumentTypes.Project));\n\t\t\tvar openAboutDialog =\n\t\t\t\tCommand.Enabled(new About(fuseVersion, license, daemon, new Studio.Debug(null), activate).Show);\n\n\t\t\treturn Popover.Host(popover =>\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Top(CreateDashTopBar(license))\n\t\t\t\t\t\t.Top(Separator.Medium)\n\n\t\t\t\t\t\t.Right(Layout.StackFromTop(\n\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\t\tLayout.SubdivideVertically(\n\t\t\t\t\t\t\t\t\t\tInfoItem(Texts.Dashboard_Learn, Texts.Dashboard_Learn_Text, WebLinks.Tutorial, \"Outracks.Fuse.Icons.Dashboard.Learn.png\"),\n\t\t\t\t\t\t\t\t\t\tInfoItem(Texts.Dashboard_Docs, Texts.Dashboard_Docs_Text, WebLinks.Documentation, \"Outracks.Fuse.Icons.Dashboard.Docs.png\"),\n\t\t\t\t\t\t\t\t\t\tInfoItem(Texts.Dashboard_Community, Texts.Dashboard_Community_Text, WebLinks.Community, \"Outracks.Fuse.Icons.Dashboard.Community.png\" ))\n\t\t\t\t\t\t\t\t.WithPadding(\n\t\t\t\t\t\t\t\t\t\tleft: new Points(32),\n\t\t\t\t\t\t\t\t\t\ttop: new Points(40))\n\t\t\t\t\t\t\t\t.WithHeight(300)),\n\t\t\t\t\t\t\t\tLogoAndVersion.Logo()\n\t\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(336 * 0.5, 173 * 0.5))\n\t\t\t\t\t\t\t\t\t.WithPadding(top: new Points(51))\n\t\t\t\t\t\t\t\t\t.OnMouse(openAboutDialog),\n\t\t\t\t\t\t\t\tLabel.Create(versionStr,\n\t\t\t\t\t\t\t\t\t\tcolor: Theme.DescriptorText,\n\t\t\t\t\t\t\t\t\t\tfont: Theme.DefaultFont)\n\t\t\t\t\t\t\t\t\t.SetToolTip(\"Version \" + fuseVersion)\n\t\t\t\t\t\t\t\t\t.CenterHorizontally()\n\t\t\t\t\t\t\t\t\t.WithPadding(top: new Points(9), bottom: new Points(51))\n\t\t\t\t\t\t\t\t\t.OnMouse(openAboutDialog),\n\t\t\t\t\t\t\t\tCreateOpenButtons(openProjectFromDialog, projectList)\n\t\t\t\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground))\n\t\t\t\t\t\t\t.WithWidth(260)\n\t\t\t\t\t\t\t.WithHeight(600)\n\t\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground))\n\t\t\t\t\t\t.Fill(projectList.Page\n\t\t\t\t\t\t\t\t.WithPadding(\n\t\t\t\t\t\t\t\t\ttop: new Points(24),\n\t\t\t\t\t\t\t\t\tbottom: new Points(24)))\n\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground)\n\t\t\t\t\t\t.WithHeight(608)\n\t\t\t\t\t\t.WithWidth(970));\n\t\t}\n\n\t\tprivate static IControl InfoItem(Text title, Text message, string linkUrl, string icon)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\tImage.FromResource(icon, typeof(Dashboard).Assembly)\n\t\t\t\t\t\t\t.WithPadding(\n\t\t\t\t\t\t\t\t\tright: new Points(8)),\n\t\t\t\t\t\t\tButtons.TextButton(\n\t\t\t\t\t\t\t\ttext: title,\n\t\t\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\t\t\tfont: Theme.HeaderFont,\n\t\t\t\t\t\t\t\thoverColor: Theme.ActiveHover,\n\t\t\t\t\t\t\t\tcmd: Command.Enabled(action: () => Process.Start(linkUrl)))),\n\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tcolor: Theme.DescriptorText,\n\t\t\t\t\t\t\tfont: Theme.DescriptorFont)\n\t\t\t\t\t.WithPadding(top: new Points(8)));\n\t\t}\n\n\t\tprivate static IControl CreateOpenButtons(Command openProjectFromDialog, ProjectList projectList)\n\t\t{\n\t\t\treturn Layout.StackFromLeft(\n\t\t\t\t\tButtons.DefaultButton(\n\t\t\t\t\t\t\ttext: Texts.Dashboard_Button_Browse,\n\t\t\t\t\t\t\tcmd: openProjectFromDialog)\n\t\t\t\t\t\t.WithWidth(104),\n\t\t\t\t\tButtons.DefaultButtonPrimary(\n\t\t\t\t\t\t\ttext: projectList.DefaultMenuItemName.AsText(),\n\t\t\t\t\t\t\tcmd: projectList.DefaultCommand)\n\t\t\t\t\t\t.WithWidth(104)\n\t\t\t\t\t\t.WithPadding(\n\t\t\t\t\t\t\tleft: new Points(16)))\n\t\t\t\t.WithPadding(\n\t\t\t\t\ttop: new Points(16),\n\t\t\t\t\tright: new Points(16),\n\t\t\t\t\tleft: new Points(16),\n\t\t\t\t\tbottom: new Points(16));\n\t\t}\n\n\t\tprivate static IControl CreateDashTopBar(ILicense license)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t\t.Right(\n\t\t\t\t\t\tLayout.Dock().Right(\n\t\t\t\t\t\t\tLayout.StackFromRight(\n\t\t\t\t\t\t\t\tControl.Empty.WithWidth(16).ShowOnMac(),\n\t\t\t\t\t\t\t\tControl.Empty.WithWidth(8).ShowOnWindows()))\n\t\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\tLayout.StackFromRight(\n\t\t\t\t\t\t\t\tMainWindow.CreateLicenseStatus(license, TextAlignment.Right)))\n\t\t\t\t\t\t\t.CenterVertically())\n\n\t\t\t\t\t.Left(\n\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithWidth(80)\n\t\t\t\t\t\t\t\t.ShowOnMac(),\n\t\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t.WithWidth(16)\n\t\t\t\t\t\t\t\t.ShowOnWindows(),\n\t\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t\t.Bottom(\n\t\t\t\t\t\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\t\t\t\t\t\t\tfill: Theme.Active)\n\t\t\t\t\t\t\t\t\t\t.WithHeight(2))\n\t\t\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\t\t\t\tButtons.TextButton(\n\t\t\t\t\t\t\t\t\t\t\t\ttext: Texts.Dashboard_Recent_Projects,\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\t\t\t\t\thoverColor: Theme.ActiveHover,\n\t\t\t\t\t\t\t\t\t\t\t\tcmd: Command.Enabled())\n\t\t\t\t\t\t\t\t\t\t.CenterVertically()))\n\t\t\t\t\t\t\t\t\t.WithPadding(left: new Points(24))\n\t\t\t\t\t\t\t\t.WithHeight(38))\n\t\t\t\t\t.Fill()\n\t\t\t\t\t.WithBackground(Theme.PanelBackground)\n\t\t\t\t\t.WithHeight(38);\n\t\t}\n\t}\n\n\tstatic class Selectable\n\t{\n\t\tpublic static IControl Create<T>(\n\t\t\tISubject<T> selection,\n\t\t\tIObservable<T> data,\n\t\t\tFunc<SelectionState, IControl> control,\n\t\t\tMenu menu,\n\t\t\tCommand defaultCommand,\n\t\t\tText toolTip = default(Text))\n\t\t{\n\t\t\treturn control(\n\t\t\t\tnew SelectionState\n\t\t\t\t{\n\t\t\t\t\tIsSelected = selection.CombineLatest(data, (s, d) => s.Equals(d)).Replay(1).RefCount(),\n\t\t\t\t})\n\t\t\t\t.WithBackground(Color.AlmostTransparent)\n\t\t\t\t\t.OnMouse(\n\t\t\t\t\t\tpressed: data.Switch(selection.Update),\n\t\t\t\t\t\tdoubleClicked: defaultCommand)\n\t\t\t\t\t.SetContextMenu(menu)\n\t\t\t\t\t.SetToolTip(toolTip);\n\t\t}\n\t}\n\n\tpublic class SelectionState\n\t{\n\t\tpublic IObservable<bool> IsSelected { get; set; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Dashboard/ProjectList.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fuse.Templates;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Uno.Configuration;\n\nnamespace Outracks.Fuse.Dashboard\n{\n\tclass ProjectList\n\t{\n\t\treadonly IShell _shell;\n\t\treadonly ISubject<ProjectListItem> _selectedItem;\n\t\treadonly IObservable<IImmutableList<ProjectListItem>> _allProjectItems;\n\n\t\tpublic ProjectList(IShell shell, CreateProject createProject, IDialog<object> parent)\n\t\t{\n\t\t\t_shell = shell;\n\n\t\t\tvar recentProjectItems = RecentProjects.All\n\t\t\t\t.SelectPerElement(project =>\n\t\t\t\t\tnew ProjectListItem(\n\t\t\t\t\t\tmenuItemName: Strings.Dashboard_Button_Open,\n\t\t\t\t\t\ttitle: project.Name,\n\t\t\t\t\t\tdescriptionTitle: Strings.Dashboard_LastOpened,\n\t\t\t\t\t\tdescription: ProjectLastOpenedString(project),\n\t\t\t\t\t\tlocationTitle: Strings.Dashboard_Location,\n\t\t\t\t\t\tlocation: project.ProjectPath.NativePath,\n\t\t\t\t\t\tcommand: Command.Enabled(async () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tawait Application.OpenDocument(project.ProjectPath, showWindow: true);\n\t\t\t\t\t\t\tparent.Close();\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tthumbnail: Layout.Dock()\n\t\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\t\tIcons.ProjectIcon()\n\t\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(\n\t\t\t\t\t\t\t\t\t\tstroke: Stroke.Create(0.5, Theme.DescriptorText),\n\t\t\t\t\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2))\n\t\t\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\tprojectFile: project.ProjectPath));\n\n\t\t\tvar newProjectItems = TemplateLoader\n\t\t\t\t.LoadTemplatesFrom(UnoConfig.Current.GetTemplatesDir() / \"projects\", _shell)\n\t\t\t\t.Select(template =>\n\t\t\t\t\tnew ProjectListItem(\n\t\t\t\t\t\tmenuItemName: Strings.Dashboard_Button_Create,\n\t\t\t\t\t\ttitle: Strings.Dashboard_New_Prefix + \" \" + template.Name,\n\t\t\t\t\t\tdescriptionTitle: Strings.Dashboard_Description,\n\t\t\t\t\t\tdescription: template.Description,\n\t\t\t\t\t\tlocationTitle: String.Empty,\n\t\t\t\t\t\tlocation: String.Empty,\n\t\t\t\t\t\tcommand: Command.Enabled(async () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (await createProject.ShowDialog(template, parent))\n\t\t\t\t\t\t\t\tparent.Close();\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tthumbnail: Icon(Color.Transparent, fg => MainWindowIcons.AddIcon(Stroke.Create(1, fg)))))\n\t\t\t\t.ToImmutableList();\n\n\t\t\t_selectedItem = new BehaviorSubject<ProjectListItem>(newProjectItems.First());\n\n\t\t\t_allProjectItems = recentProjectItems\n\t\t\t\t.Select(newProjectItems.AddRange)\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\n\t\tstatic string ProjectLastOpenedString(ProjectData project)\n\t\t{\n\t\t\treturn project.LastOpened.HasValue ? DateFormat.PeriodBetween(DateTime.Now, project.LastOpened.Value) : \"N/A\";\n\t\t}\n\n\t\tstatic IControl Icon(Brush fill, Func<Brush, IControl> content)\n\t\t{\n\t\t\tBrush foreground = Theme.DisabledText;\n\t\t\treturn Shapes\n\t\t\t\t.Rectangle(\n\t\t\t\t\tfill: fill,\n\t\t\t\t\tstroke: Stroke.Create(0.5, foreground),\n\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)))\n\t\t\t\t.WithOverlay(\n\t\t\t\t\tcontent(foreground)\n\t\t\t\t\t\t.Center());\n\t\t}\n\n\t\tpublic Command DefaultCommand\n\t\t{\n\t\t\tget { return _selectedItem.Switch(item => item.Command); }\n\t\t}\n\n\t\tpublic IObservable<string> DefaultMenuItemName\n\t\t{\n\t\t\tget { return _selectedItem.Select(item => item.MenuItemName); }\n\t\t}\n\n\t\tpublic IControl Page\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _allProjectItems\n\t\t\t\t\t.PoolPerElement(item =>\n\t\t\t\t\t\tSelectable.Create(\n\t\t\t\t\t\t\tselection: _selectedItem,\n\t\t\t\t\t\t\tmenu: CreateProjectMenu(item),\n\t\t\t\t\t\t\tdata: item,\n\t\t\t\t\t\t\tdefaultCommand: item.Switch(i => i.Command),\n\t\t\t\t\t\t\tcontrol: state => ProjectListItemControl.Create(item, state),\n\t\t\t\t\t\t\ttoolTip: item.Select(i => Strings.Dashboard_Open_Prefix + \" \" + i.Title).AsText()))\n\t\t\t\t\t.SelectPerElement(elm => elm.WithPadding(new Thickness<Points>(0, 0, 32, 0)))\n\t\t\t\t\t.DirectionalGrid(Axis2D.Horizontal, 2)\n\t\t\t\t\t.WithPadding(left: new Points(40), right: new Points(20))\n\t\t\t\t\t.MakeScrollable(darkTheme: Observable.Return(false))\n\t\t\t\t\t.OnKeyPressed(ModifierKeys.None, Key.Left, MoveSelection(-1), isGlobal: true)\n\t\t\t\t\t.OnKeyPressed(ModifierKeys.None, Key.Right, MoveSelection(+1), isGlobal: true)\n\t\t\t\t\t.OnKeyPressed(ModifierKeys.None, Key.Up, MoveSelection(-3), isGlobal: true)\n\t\t\t\t\t.OnKeyPressed(ModifierKeys.None, Key.Down, MoveSelection(+3), isGlobal: true)\n\t\t\t\t\t;\n\t\t\t}\n\t\t}\n\n\t\tMenu CreateProjectMenu(IObservable<ProjectListItem> item)\n\t\t{\n\t\t\tvar project = item.Select(i => i.ProjectFile);\n\n\t\t\treturn Menu.Item(item.Select(i => i.MenuItemName).AsText(), item.Switch(i => i.Command), isDefault: true)\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ ProjectMenu.CommandItems(project, _shell)\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Item(Strings.Dashboard_Project_Remove, RemoveRecentProject(project));\n\t\t}\n\n\t\tstatic Command RemoveRecentProject(IObservable<Optional<AbsoluteFilePath>> path)\n\t\t{\n\t\t\treturn path.Switch(p =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: p.HasValue,\n\t\t\t\t\taction: () => { var ignore = RecentProjects.Remove(p.Value); }));\n\t\t}\n\n\t\tCommand MoveSelection(int delta)\n\t\t{\n\t\t\treturn _allProjectItems.Switch(currentItems =>\n\t\t\t\t_selectedItem.Switch(item =>\n\t\t\t\t{\n\t\t\t\t\tvar index = currentItems.IndexOf(item) + delta;\n\t\t\t\t\twhile (index < 0)\n\t\t\t\t\t\tindex += currentItems.Count;\n\t\t\t\t\twhile (index >= currentItems.Count)\n\t\t\t\t\t\tindex -= currentItems.Count;\n\n\t\t\t\t\treturn _selectedItem.Update(currentItems.TryGetAt(index).Or(currentItems[0]));\n\t\t\t\t}));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Dashboard/ProjectListItem.cs",
    "content": "using Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Dashboard\n{\n\tclass ProjectListItem\n\t{\n\t\tpublic readonly Optional<AbsoluteFilePath> ProjectFile;\n\t\tpublic readonly string MenuItemName;\n\t\tpublic readonly string Title;\n\t\tpublic readonly string Description;\n\t\tpublic readonly string DescriptionTitle;\n\t\tpublic readonly string Location;\n\t\tpublic readonly string LocationTitle;\n\t\tpublic readonly Command Command;\n\t\tpublic readonly IControl Thumbnail;\n\n\t\tpublic ProjectListItem(\n\t\t\tstring menuItemName,\n\t\t\tstring title,\n\t\t\tstring descriptionTitle,\n\t\t\tstring description,\n\t\t\tstring locationTitle,\n\t\t\tstring location,\n\t\t\tCommand command,\n\t\t\tIControl thumbnail,\n\t\t\tOptional<AbsoluteFilePath> projectFile = default(Optional<AbsoluteFilePath>))\n\t\t{\n\t\t\tMenuItemName = menuItemName;\n\t\t\tProjectFile = projectFile;\n\t\t\tTitle = title;\n\t\t\tDescriptionTitle = descriptionTitle;\n\t\t\tDescription = description;\n\t\t\tLocationTitle = locationTitle;\n\t\t\tLocation = location;\n\t\t\tCommand = command;\n\t\t\tThumbnail = thumbnail;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{ Title: \" + Title + \", Description: \" + Description + \" }\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Dashboard/ProjectListItemControl.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Dashboard\n{\n\tclass ProjectListItemControl\n\t{\n\t\tpublic static IControl Create(IObservable<ProjectListItem> item, SelectionState state)\n\t\t{\n\t\t\treturn Layout\n\t\t\t\t.StackFromLeft(\n\t\t\t\t\titem.Select(i => i.Thumbnail).Switch()\n\t\t\t\t\t.WithSize(Size.Create<Points>(80, 145))\n\t\t\t\t\t.WithOverlay(\n\t\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\t\tstroke: state.IsSelected.Select(c => c ? Stroke.Create(2, Theme.Active) : Stroke.Create(0, Color.Transparent)).Switch(),\n\t\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2))))\n\t\t\t\t\t.CenterHorizontally(),\n\t\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\titem.Select(i => i.Title).AsText(),\n\t\t\t\t\t\t\ttextAlignment: TextAlignment.Left,\n\t\t\t\t\t\t\tlineBreakMode: LineBreakMode.Wrap,\n\t\t\t\t\t\t\tcolor: state.IsSelected.Select(c => c ? Theme.Active : Theme.DefaultText).Switch(),\n\t\t\t\t\t\t\tfont: Font.SystemDefault(Observable.Return(19.0))),\n\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\ttext: item.Select(i => i.DescriptionTitle)\n\t\t\t\t\t\t\t\t.AsText(),\n\t\t\t\t\t\t\tcolor: Theme.DescriptorText,\n\t\t\t\t\t\t\tfont: Theme.DescriptorFont),\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\titem.Select(i => i.Description.Wrap(28) + \".\")\n\t\t\t\t\t\t\t\t.AsText(),\n\t\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\t\tlineBreakMode: LineBreakMode.Wrap,\t// FIXME: Doesn't work?\n\t\t\t\t\t\t\tfont: Theme.DescriptorFont),\n\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\ttext: item.Select(i => i.LocationTitle)\n\t\t\t\t\t\t\t\t.AsText(),\n\t\t\t\t\t\t\tcolor: Theme.DescriptorText,\n\t\t\t\t\t\t\tfont: Theme.DescriptorFont),\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\ttext:item.Select(i => i.Location)\n\t\t\t\t\t\t\t\t.AsText(),\n\t\t\t\t\t\t\tlineBreakMode: LineBreakMode.TruncateTail,\n\t\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\t\tfont: Theme.DescriptorFont))\n\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t.WithWidth(200)\n\t\t\t\t\t.WithPadding( left: new Points(16)))\n\t\t\t\t.WithPadding(new Thickness<Points>(0, 24));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/ElementContext.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ElementContext\n\t{\n\t\treadonly IContext _context;\n\t\treadonly IProject _project;\n\t\treadonly IMessagingService _daemon;\n\n\t\tpublic ElementContext(IContext context, IProject project, IMessagingService daemon)\n\t\t{\n\t\t\t_context = context;\n\t\t\t_project = project;\n\t\t\t_daemon = daemon;\n\t\t}\n\n\t\tpublic Menu CreateMenu(IElement element)\n\t\t{\n\t\t\treturn Menu.Item(\n\t\t\t\t\tname: Texts.SubMenu_Element_LocateInEditor,\n\t\t\t\t\tcommand: FocusEditorCommand.Create(_context, _project, _daemon),\n\t\t\t\t\thotkey: HotKey.Create(ModifierKeys.Meta | ModifierKeys.Alt, Key.L))\n\n\t\t\t\t+ Menu.Separator\n\n\t\t\t\t// Edit class element we're currently not editing\n\t\t\t\t+ Menu.Item(\n\t\t\t\t\t\tname: element.UxClass().Select(n => \"Edit \" + n.Or(\"class\")).AsText(),\n\t\t\t\t\t\tisDefault: true,\n\t\t\t\t\t\taction: async () => await _context.PushScope(element, element))\n\t\t\t\t\t.ShowWhen(element.UxClass().Select(n => n.HasValue)\n\t\t\t\t\t\t.And(_context.CurrentScope.IsSameAs(element).IsFalse()))\n\n\t\t\t\t// Edit base\n\t\t\t\t+ Menu.Item(\n\t\t\t\t\tname: element.Base.UxClass().Select(n => \"Edit \" + n.Or(\"class\")).AsText(),\n\t\t\t\t\tisEnabled: element.Base.IsReadOnly.IsFalse(),\n\t\t\t\t\taction: async () => await _context.PushScope(element.Base, element.Base))\n\n\t\t\t\t+ Menu.Item(\n\t\t\t\t\tname: Texts.SubMenu_Element_Deselect,\n\t\t\t\t\thotkey: HotKey.Create(ModifierKeys.Meta, Key.D),\n\t\t\t\t\taction: async () => await _context.Select(Element.Empty))\n\n\t\t\t\t+ Menu.Separator\n\n\t\t\t\t+ Menu.Item(\n\t\t\t\t\tname: Texts.SubMenu_Element_Remove,\n\t\t\t\t\tcommand: Command.Create(\n\t\t\t\t\t\telement.Parent\n\t\t\t\t\t\t\t\t.IsEmpty\n\t\t\t\t\t\t\t\t// Only allow removal of non-root elements for now\n\t\t\t\t\t\t\t\t// Removing a root element could mean\n\t\t\t\t\t\t\t\t.Select(isRoot => isRoot ?\n\t\t\t\t\t\t\t\t\tOptional.None<Action>() :\n\t\t\t\t\t\t\t\t\t(Action) (async () =>\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tawait element.Cut();\n\n\t\t\t\t\t\t\t\t\t\t\tif (await _context.IsSelected(element).FirstAsync())\n\t\t\t\t\t\t\t\t\t\t\t\tawait _context.Select(Element.Empty);\n\t\t\t\t\t\t\t\t\t\t}))));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Export.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Diagnostics;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass Export\n\t{\n\t\tpublic Export(IProject project, IFuse fuse, BuildArgs args)\n\t\t{\n\t\t\tvar output = new Subject<string>();\n\n\t\t\tLogMessages = output;\n\n\t\t\tExportForAndroid = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Enabled(\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"build\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=android\", \"--run\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tExportForAndroidEmulator = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Enabled(\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"build\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=android-emu\", \"--run\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tExportForIos =  project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: Platform.IsMac,\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"build\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=ios\", \"--debug\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tExportForIosSimulator =  project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: Platform.IsMac,\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"build\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=ios-sim\", \"--run\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tExportForDotNet = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Enabled(\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"build\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=dotnet\", \"--run\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tExportForNative = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Enabled(\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"build\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=native\", \"--run\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tClean = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Enabled(\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"clean\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-v\" },\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tMenu = Menu.Item(Texts.SubMenu_Export_ExportForAndroid, ExportForAndroid)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Export_ExportForAndroidEmulator, ExportForAndroidEmulator)\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Export_ExportForiOS + (!Platform.IsMac ? \" (\" + Texts.Label_MacOnly + \")\" : \"\"), ExportForIos)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Export_ExportForiOSSimulator + (!Platform.IsMac ? \" (\" + Texts.Label_MacOnly + \")\" : \"\"), ExportForIosSimulator)\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Export_ExportForDotNet, ExportForDotNet)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Export_ExportForNative, ExportForNative)\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Export_Clean, Clean);\n\t\t}\n\n\t\tpublic Menu Menu { get; private set; }\n\n\t\tpublic Command ExportForAndroid { get; private set; }\n\t\tpublic Command ExportForAndroidEmulator { get; private set; }\n\t\tpublic Command ExportForIos { get; private set; }\n\t\tpublic Command ExportForIosSimulator { get; private set; }\n\t\tpublic Command ExportForDotNet { get; private set; }\n\t\tpublic Command ExportForNative { get; private set; }\n\t\tpublic Command Clean { get; private set; }\n\t\tpublic IObservable<string> LogMessages { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/ExternalSelection.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Xml;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse\n{\n\tstatic class ExternalSelection\n\t{\n\t\tpublic static IDisposable UpdateProjectContext(IMessagingService daemon, IProject project, IScheduler scheduler = null)\n\t\t{\n\t\t\tscheduler = scheduler ?? Scheduler.Default;\n\n\t\t\tvar includedFiles = project.Documents.Select(docs =>\n\t\t\t\tdocs.Select(doc => doc.SimulatorIdPrefix).ToImmutableHashSet());\n\n\t\t\treturn daemon\n\t\t\t\t.BroadcastedEvents<SelectionChanged>(false)\n\n\t\t\t\t// BEGIN HACK: bug in atom plugin is giving invalid selection when reloading sometimes\n\t\t\t\t.Where(s => s.Text.Length > 0 && s.CaretPosition.Character != 1)\n\t\t\t\t.Throttle(TimeSpan.FromMilliseconds(50), scheduler)\n\t\t\t\t.ObserveOn(Application.MainThread)\n\t\t\t\t// END HACK\n\n\t\t\t\t.WithLatestFromBuffered(includedFiles, (args, files) =>\n\t\t\t\t\tfiles.Contains(args.Path)\n\t\t\t\t\t\t? Optional.Some(new ObjectIdentifier(args.Path, TryGetElementIndex(args.Text, args.CaretPosition)))\n\t\t\t\t\t\t: Optional.None())\n\t\t\t\t.NotNone()\n\n\t\t\t\t.Select(elementId =>\n\t\t\t\t\tObservable.FromAsync(async () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar element = project.GetElement(elementId);\n\t\t\t\t\t\tawait project.Context.Select(element);\n\t\t\t\t\t}))\n\t\t\t\t.Concat()\n\t\t\t\t.Subscribe();\n\t\t}\n\n\t\tinternal static int TryGetElementIndex(string xml, Protocol.Messages.TextPosition caretPosition)\n\t\t{\n\t\t\treturn TryGetElementIndex(xml, new Simulator.TextPosition(new Simulator.LineNumber(caretPosition.Line), new Simulator.CharacterNumber(caretPosition.Character)));\n\t\t}\n\n\t\tstatic int TryGetElementIndex(string xml, Simulator.TextPosition caretPosition)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar normalizedXml = xml.NormalizeLineEndings();\n\t\t\t\tvar offset = caretPosition.ToOffset(normalizedXml);\n\t\t\t\tvar parser = new AXmlParser();\n\t\t\t\tvar tagsoup = parser.ParseTagSoup(new StringTextSource(normalizedXml));\n\t\t\t\tvar elements = RemoveJavaScript(tagsoup.OfType<AXmlTag>());\n\n\t\t\t\treturn elements\n\t\t\t\t\t.Where(e => !e.IsEndTag && !e.IsComment && e.ClosingBracket != \"\")\n\t\t\t\t\t.IndexOfFirst(obj => obj.StartOffset <= offset && offset < obj.EndOffset);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tstatic IEnumerable<AXmlTag> RemoveJavaScript(IEnumerable<AXmlTag> elements)\n\t\t{\n\t\t\tvar skip = false;\n\n\t\t\tforeach (var element in elements)\n\t\t\t{\n\t\t\t\tif (element.Name == \"JavaScript\" && element.ClosingBracket == \">\")\n\t\t\t\t{\n\t\t\t\t\tskip = !skip;\n\t\t\t\t\tyield return element;\n\t\t\t\t}\n\t\t\t\telse if (!skip)\n\t\t\t\t{\n\t\t\t\t\tyield return element;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/FocusEditorCommand.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic static class FocusEditorCommand\n\t{\n\t\t[DllImport(\"user32.dll\")]\n\t\tpublic static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab);\n\n\t\tpublic static Command Create(IContext context, IProject project, IMessagingService daemon)\n\t\t{\n\t\t\treturn context.CurrentSelection\n\t\t\t\t.SourceReference\n\t\t\t\t.CombineLatest(project.FilePath, (maybeSrc, projectFile) =>\n\t\t\t\t\tmaybeSrc.SelectMany(src =>\n\t\t\t\t\t\tsrc.Location.Select(location =>\n\t\t\t\t\t\t\tnew FocusEditorRequest\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tFile = src.File,\n\t\t\t\t\t\t\t\tColumn = location.Character,\n\t\t\t\t\t\t\t\tLine = location.Line,\n\t\t\t\t\t\t\t\tProject = projectFile.NativePath\n\t\t\t\t\t\t\t})))\n\t\t\t\t.Switch(request =>\n\t\t\t\t\tCommand.Create(\n\t\t\t\t\t\tisEnabled: request.HasValue,\n\t\t\t\t\t\taction: () => SendRequest(daemon, request.Value)));\n\t\t}\n\n\t\tpublic static void SendRequest(IMessagingService daemon, FocusEditorRequest request)\n\t\t{\n\t\t\tTask.Run(\n\t\t\t\tasync () =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar response = await daemon.Request(request);\n\t\t\t\t\t\tif (response.FocusHwnd.HasValue && Environment.OSVersion.Platform == PlatformID.Win32NT)\n\t\t\t\t\t\t\tSwitchToThisWindow(new IntPtr(response.FocusHwnd.Value), true);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (RequestFailed)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Just ignore for now..\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/GlVersionParsing.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic static class GlVersionParsing\n\t{\n\t\tstatic readonly Version MinimumVersion = new Version(2, 1);\n\n\t\tpublic static IObservable<string> ToLogMessages(this IObservable<OpenGlVersion> version, IReport report)\n\t\t{\n\t\t\treturn version.SelectMany(v => GetLogMessages(v, report));\n\t\t}\n\n\t\tpublic static IEnumerable<string> GetLogMessages(OpenGlVersion glVersion, IReport report)\n\t\t{\n\t\t\tvar version = glVersion.ToVersion();\n\t\t\tif (version.HasValue)\n\t\t\t{\n\t\t\t\tif (!version.Value.IsSupported())\n\t\t\t\t{\n\t\t\t\t\tyield return \"OpenGL Version: \" + glVersion.GlVersion + \"\\n\";\n\t\t\t\t\tyield return \"OpenGL Vendor: \" + glVersion.GlVendor + \"\\n\";\n\t\t\t\t\tyield return \"OpenGL Renderer: \" + glVersion.GlRenderer + \"\\n\";\n\t\t\t\t\tvar message = \"Error: The required OpenGL version is \" + MinimumVersion;\n\t\t\t\t\treport.Error(message, ReportTo.Log);\n\t\t\t\t\tyield return message;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tyield return \"OpenGL Version: \" + glVersion.GlVersion + \"\\n\";\n\t\t\t\tyield return \"OpenGL Vendor: \" + glVersion.GlVendor + \"\\n\";\n\t\t\t\tyield return \"OpenGL Renderer: \" + glVersion.GlRenderer + \"\\n\";\n\t\t\t\treport.Warn(\"OpenGL parsing error: '\" + glVersion.GlVersion + \"'\", ReportTo.Headquarters | ReportTo.Log);\n\t\t\t\tyield return \"Warning: Failed to detect OpenGL version. The required version is \" + MinimumVersion;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Optional<Version> ToVersion(this OpenGlVersion version)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tconst string bol = \"^\";\n\t\t\t\tconst string optionalSpace = @\"\\s*\";\n\t\t\t\tconst string firstAndSecondComponent = @\"([0-9])+\\.([0-9])+\";\n\t\t\t\tconst string optionalThirdComponent = @\"(\\.([0-9])+)?\";\n\t\t\t\tconst string optionalStringIfStartingWithSpace = @\"(\\s.*)?\";\n\t\t\t\tconst string eol = \"$\";\n\t\t\t\tvar pattern = bol\n\t\t\t\t\t+ optionalSpace\n\t\t\t\t\t+ firstAndSecondComponent\n\t\t\t\t\t+ optionalThirdComponent\n\t\t\t\t\t+ optionalStringIfStartingWithSpace\n\t\t\t\t\t+ eol;\n\t\t\t\tvar regex = new Regex(pattern);\n\t\t\t\tvar match = regex.Match(version.GlVersion);\n\t\t\t\tvar major = int.Parse(match.Groups[1].Value);\n\t\t\t\tvar minor = int.Parse(match.Groups[2].Value);\n\t\t\t\treturn new Version(major, minor);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool IsSupported(this Version version)\n\t\t{\n\t\t\treturn version >= MinimumVersion;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Icons/AlignmentIcon.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tstatic class AlignmentIcon\n\t{\n\t\tpublic static IControl VerticalFill(Brush fill)\n\t\t{\n\t\t\treturn Layout.StackFromLeft(\n\t\t\t\tControl.Empty.WithWidth(3),\n\t\t\t\tShapes.Rectangle(fill: fill).WithWidth(7).WithHeight(13),\n\t\t\t\tControl.Empty.WithWidth(1),\n\t\t\t\tShapes.Rectangle(fill: fill).WithWidth(3).WithHeight(13),\n\t\t\t\tControl.Empty.WithWidth(3))\n\t\t\t\t.WithPadding(top: new Points(2), bottom: new Points(2))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithHeight(1).Dock(RectangleEdge.Top))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithHeight(1).Dock(RectangleEdge.Bottom))\n\t\t\t\t.WithPadding(new Thickness<Points>(1));\n\t\t}\n\n\t\tpublic static IControl HorizontalFill(Brush fill)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tControl.Empty.WithHeight(3),\n\t\t\t\tShapes.Rectangle(fill: fill).WithHeight(7).WithWidth(13),\n\t\t\t\tControl.Empty.WithHeight(1),\n\t\t\t\tShapes.Rectangle(fill: fill).WithHeight(3).WithWidth(13),\n\t\t\t\tControl.Empty.WithHeight(3))\n\t\t\t\t.WithPadding(left: new Points(2), right: new Points(2))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithWidth(1).Dock(RectangleEdge.Left))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithWidth(1).Dock(RectangleEdge.Right))\n\t\t\t\t.WithPadding(new Thickness<Points>(1));\n\t\t}\n\n\t\tpublic static IControl Vertical(RectangleEdge edge, Brush fill)\n\t\t{\n\t\t\treturn Layout.StackFromLeft(\n\t\t\t\tControl.Empty.WithWidth(3),\n\t\t\t\tShapes.Rectangle(fill: fill).WithWidth(7).WithHeight(7).Dock(edge, Control.Empty.WithHeight(13-7)),\n\t\t\t\tControl.Empty.WithWidth(1),\n\t\t\t\tShapes.Rectangle(fill: fill).WithWidth(3).WithHeight(13),\n\t\t\t\tControl.Empty.WithWidth(3))\n\t\t\t\t.WithPadding(top: new Points(2), bottom: new Points(2))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithHeight(1).Dock(edge))\n\t\t\t\t.WithPadding(new Thickness<Points>(1));\n\t\t}\n\n\t\tpublic static IControl Horizontal(RectangleEdge edge, Brush fill)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tControl.Empty.WithHeight(3),\n\t\t\t\tShapes.Rectangle(fill: fill).WithHeight(7).WithWidth(7).Dock(edge, Control.Empty.WithWidth(13 - 7)),\n\t\t\t\tControl.Empty.WithHeight(1),\n\t\t\t\tShapes.Rectangle(fill: fill).WithHeight(3).WithWidth(13),\n\t\t\t\tControl.Empty.WithHeight(3))\n\t\t\t\t.WithPadding(left: new Points(2), right: new Points(2))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithWidth(1).Dock(edge))\n\t\t\t\t.WithPadding(new Thickness<Points>(1));\n\t\t}\n\n\t\tpublic static IControl VerticalCenter(Brush fill)\n\t\t{\n\t\t\treturn Layout.StackFromLeft(\n\t\t\t\tControl.Empty.WithWidth(3),\n\t\t\t\tShapes.Rectangle(fill: fill).WithWidth(7).WithHeight(7).CenterVertically(),\n\t\t\t\tControl.Empty.WithWidth(1),\n\t\t\t\tShapes.Rectangle(fill: fill).WithWidth(3).WithHeight(13).CenterVertically(),\n\t\t\t\tControl.Empty.WithWidth(3))\n\t\t\t\t.WithPadding(top: new Points(2), bottom: new Points(2))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithHeight(1).CenterVertically())\n\t\t\t\t.WithPadding(new Thickness<Points>(1));\n\t\t}\n\n\t\tpublic static IControl HorizontalCenter(Brush fill)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tControl.Empty.WithHeight(3),\n\t\t\t\tShapes.Rectangle(fill: fill).WithHeight(7).WithWidth(7).CenterHorizontally(),\n\t\t\t\tControl.Empty.WithHeight(1),\n\t\t\t\tShapes.Rectangle(fill: fill).WithHeight(3).WithWidth(13).CenterHorizontally(),\n\t\t\t\tControl.Empty.WithHeight(3))\n\t\t\t\t.WithPadding(left: new Points(2), right: new Points(2))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: fill).WithWidth(1).CenterHorizontally())\n\t\t\t\t.WithPadding(new Thickness<Points>(1));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Icons/Icons.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reflection;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class Icons\n\t{\n\t\tpublic static Icon Folder { get; private set; }\n\n\t\tstatic Icons()\n\t\t{\n\t\t\tvar asm = Assembly.GetExecutingAssembly();\n\t\t\tFolder = new Icon(() => asm.GetManifestResourceStream(\"Outracks.Fuse.Icons.Folder.png\"));\n\t\t}\n\n\t\tpublic static Optional<Icon> GetFileIcon(AbsoluteFilePath f)\n\t\t{\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tpublic static IControl MediumIcon(this IElement element, Brush borderBrush, Brush boxBrush)\n\t\t{\n\t\t\treturn element.Name.Select(name => MediumIcon(name, borderBrush, boxBrush)).Switch();\n\t\t}\n\n\t\tpublic static IControl MediumIcon(string elementName, Brush borderBrush = default(Brush), Brush boxBrush = default(Brush))\n\t\t{\n\t\t\tvar svgResourceName = string.Format(\"Outracks.Fuse.Icons.Primitives.{0}.Active.svg\", elementName);\n\t\t\tif (Image.HasResource(svgResourceName, typeof(Icons).Assembly))\n\t\t\t{\n\t\t\t\tvar colorMap = !borderBrush.IsDefault ? borderBrush.Select(color => new SingleColorMap(color)) : null;\n\t\t\t\treturn FromResource(\n\t\t\t\t\t\tsvgResourceName,\n\t\t\t\t\t\tcolorMap: colorMap)\n\t\t\t\t\t.Center()\n\t\t\t\t\t.WithMediumSize();\n\t\t\t}\n\n\t\t\t// Just one SVG icon missing from set\n\t\t\tswitch (elementName)\n\t\t\t{\n\t\t\t\tcase \"App\": return App(borderBrush, boxBrush).WithMediumSize();\n\t\t\t}\n\n\t\t\treturn PanelBorder(borderBrush, Control.Empty).WithMediumSize();\n\t\t}\n\n\t\tpublic static IControl ProjectIcon()\n\t\t{\n\t\t\treturn Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.Dashboard.ProjectIcon_dark@2x.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.Dashboard.ProjectIcon_light@2x.png\"))\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tpublic static IControl LoggedOut()\n\t\t{\n\t\t\treturn  Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.Dashboard.LoggedOut_dark@2x.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.Dashboard.LoggedOut_light@2x.png\"))\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tpublic static IControl AddViewport()\n\t\t{\n\t\t\treturn  Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.AddViewport_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.AddViewport_light.png\"))\n\t\t\t\t.Switch()\n\t\t\t\t.WithSize(new Size<Points>(16,37));\n\t\t}\n\n\t\tpublic static IControl DevicesIcon()\n\t\t{\n\t\t\treturn  Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.Devices_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.Devices_light.png\"))\n\t\t\t\t.Switch()\n\t\t\t\t.WithSize(new Size<Points>(16,16));\n\t\t}\n\n\t\tpublic static IControl Community()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Dashboard.Community@2x.png\");\n\t\t}\n\n\t\tpublic static IControl ClassesSmall()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.ClassesSmall.png\")\n\t\t\t\t.WithSize(new Size<Points>(20,20));\n\t\t}\n\n\t\tpublic static IControl Docs()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Dashboard.Docs@2x.png\");\n\t\t}\n\n\t\tpublic static IControl DragIconSmall()\n\t\t{\n\t\t\treturn Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.DragIconSmallDark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.DragIconSmall.png\"))\n\t\t\t\t.Switch()\n\t\t\t\t.WithSize(new Size<Points>(24,15));\n\t\t}\n\n\t\tpublic static IControl ArrowIcon()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Arrow@2x.png\");\n\t\t}\n\t\tpublic static IControl Learn()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Dashboard.Learn@2x.png\");\n\t\t}\n\t\tpublic static IControl FontSize()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.FontSize.png\");\n\t\t}\n\t\tpublic static IControl CharacterLimit()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.CharacterLimit.png\");\n\t\t}\n\t\tpublic static IControl LineSpacing()\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.LineSpacing.png\");\n\t\t}\n\n\t\tpublic static IControl Confirm(Brush overlayColor = default(Brush))\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Confirm.png\", overlayColor);\n\t\t}\n\n\t\tpublic static IControl Cancel(Brush fg)\n\t\t{\n\t\t\tvar size = Size.Create<Points>(14, 14);\n\t\t\tvar stroke = Stroke.Create(1, fg);\n\n\t\t\treturn Layout.Layer(\n\t\t\t\tShapes.Line(\n\t\t\t\t\tstart: Point.Create<Points>(0, 0),\n\t\t\t\t\tend: Point.Create(size.Width, size.Height),\n\t\t\t\t\tstroke: stroke),\n\t\t\t\tShapes.Line(\n\t\t\t\t\tstart: Point.Create(size.Width, 0),\n\t\t\t\t\tend: Point.Create(0, size.Height),\n\t\t\t\t\tstroke: stroke))\n\t\t\t\t.WithSize(size);\n\t\t}\n\t\tpublic static IControl Wrap(Brush overlayColor = default(Brush))\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Wrap.Wrap.png\", overlayColor);\n\t\t}\n\t\tpublic static IControl NoWrap(Brush overlayColor = default(Brush))\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Wrap.NoWrap.png\", overlayColor);\n\t\t}\n\t\tpublic static IControl Checkmark(Brush overlayColor = default(Brush))\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Checkmark.png\", overlayColor);\n\t\t}\n\n\t\tpublic static IControl ExtractClass(IObservable<bool> enabled)\n\t\t{\n\t\t\treturn enabled\n\t\t\t\t.Select(\n\t\t\t\t\tx => x\n\t\t\t\t\t\t? FromResource(\"Outracks.Fuse.Icons.ExtractClassEnabled.png\")\n\t\t\t\t\t\t: FromResource(\"Outracks.Fuse.Icons.ExtractClassDisabled.png\"))\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tpublic static IControl CannotEditPlaceholder()\n\t\t{\n\t\t\treturn Theme.CurrentTheme.Select(\n\t\t\t\ttheme => FromResource(\n\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t? \"Outracks.Fuse.Icons.CannotEdit.Dark.png\"\n\t\t\t\t\t\t: \"Outracks.Fuse.Icons.CannotEdit.Light.png\"))\n\t\t\t\t.Switch();\n\t\t}\n\n\n\t\tstatic IControl WithMediumSize(this IControl control)\n\t\t{\n\t\t\treturn control.WithWidth(21).WithHeight(16);\n\t\t}\n\n\t\tstatic IControl App(Brush borderBrush, Brush brush)\n\t\t{\n\t\t\treturn PrimitivesIcon(\"AppIcon\", brush).Center();\n\t\t}\n\n\t\tstatic IControl Panel(Brush borderBrush, Brush boxBrush)\n\t\t{\n\t\t\treturn PanelBorder(\n\t\t\t\tborderBrush,\n\t\t\t\tBox(boxBrush));\n\t\t}\n\n\t\tstatic IControl StackPanel(Brush borderBrush, Brush boxBrush)\n\t\t{\n\t\t\treturn PanelBorder(\n\t\t\t\tborderBrush,\n\t\t\t\tLayout.SubdivideVertically(\n\t\t\t\t\tBox(boxBrush),\n\t\t\t\t\tBox(boxBrush)));\n\t\t}\n\n\t\tstatic IControl StackPanelHorizontal(Brush borderBrush, Brush boxBrush)\n\t\t{\n\t\t\treturn PanelBorder(\n\t\t\t\tborderBrush,\n\t\t\t\tLayout.SubdivideHorizontally(\n\t\t\t\t\tBox(boxBrush),\n\t\t\t\t\tBox(boxBrush)));\n\t\t}\n\n\t\tstatic IControl Grid(Brush borderBrush, Brush boxBrush)\n\t\t{\n\t\t\treturn PanelBorder(borderBrush,\n\t\t\t\tLayout.SubdivideVertically(\n\t\t\t\t\tLayout.SubdivideHorizontally(Box(boxBrush),Box(boxBrush),Box(boxBrush)),\n\t\t\t\t\tLayout.SubdivideHorizontally(Box(boxBrush),Box(boxBrush),Box(boxBrush))));\n\t\t}\n\n\t\tstatic IControl DockPanel(Brush borderBrush, Brush boxBrush)\n\t\t{\n\t\t\treturn PanelBorder(borderBrush, Box2(boxBrush).CenterHorizontally().DockTop());\n\t\t}\n\n\t\tstatic IControl WrapPanel(Brush borderBrush, Brush boxBrush)\n\t\t{\n\t\t\treturn PanelBorder(borderBrush,\n\t\t\t\tLayout.SubdivideVertically(\n\t\t\t\t\tLayout.SubdivideHorizontally(Box(boxBrush).Span(1), Box(boxBrush).Span(2)),\n\t\t\t\t\tLayout.SubdivideHorizontally(Box(boxBrush).Span(2), Control.Empty.Span(1))));\n\t\t}\n\n\t\tstatic IControl Each(Brush borderBrush, Brush brush)\n\t\t{\n\t\t\treturn PanelBorder(borderBrush,\n\t\t\t\tPrimitivesIcon(\"EachArrows\", brush).Center());\n\t\t}\n\n\t\tstatic IControl ScrollView(Brush borderBrush)\n\t\t{\n\t\t\treturn PanelBorder(\n\t\t\t\tborderBrush,\n\t\t\t\tPrimitivesIcon(\"ScrollViewArrows\", borderBrush).CenterVertically());\n\t\t}\n\n\t\tstatic IControl Rectangle(Brush fillBrush)\n\t\t{\n\t\t\treturn PanelBorder(\n\t\t\t\tBrush.Transparent,\n\t\t\t\tBox(fillBrush).WithWidth(21).WithHeight(6).Center());\n\t\t}\n\n\t\tstatic IControl Circle(Brush fillBrush)\n\t\t{\n\t\t\treturn PanelBorder(\n\t\t\t\tBrush.Transparent,\n\t\t\t\tShapes.Circle(fill: fillBrush).WithWidth(11).WithHeight(11).Center());\n\t\t}\n\n\t\tstatic IControl PanelBorder(Brush brush, IControl control)\n\t\t{\n\t\t\treturn control\n\t\t\t\t.WithPadding(new Thickness<Points>(1.5))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(Stroke.Create(1, brush, new StrokeDashArray(2, 1))));\n\t\t}\n\n\t\tstatic IControl Box(Brush fill)\n\t\t{\n\t\t\treturn Shapes\n\t\t\t\t.Rectangle(fill: fill, cornerRadius:Observable.Return(new CornerRadius(new Points(1))))\n\t\t\t\t.WithWidth(5).WithHeight(5)\n\t\t\t\t.WithPadding(new Thickness<Points>(0.5));\n\t\t}\n\n\t\tstatic IControl Box2(Brush fill)\n\t\t{\n\t\t\treturn Shapes\n\t\t\t\t.Rectangle(fill: fill, cornerRadius: Observable.Return(new CornerRadius(new Points(1))))\n\t\t\t\t.WithWidth(11).WithHeight(5)\n\t\t\t\t.WithPadding(new Thickness<Points>(0.5));\n\t\t}\n\n\t\tstatic IControl PrimitivesIcon(string name, Brush overlayColor = default(Brush))\n\t\t{\n\t\t\treturn FromResource(\"Outracks.Fuse.Icons.Primitives.\" + name + \".png\", overlayColor);\n\t\t}\n\n\t\tstatic IControl FromResource(string resourceName, Brush overlayColor = default(Brush), IObservable<IColorMap> colorMap = null)\n\t\t{\n\t\t\tcolorMap = colorMap ?? Theme.IconColorMap;\n\t\t\treturn overlayColor.IsDefault\n\t\t\t\t? Image.FromResource(resourceName, typeof(Icons).Assembly, colorMap: colorMap)\n\t\t\t\t: Image.FromResource(resourceName, typeof(Icons).Assembly, overlayColor, colorMap);\n\t\t}\n\n\t\tclass SingleColorMap : IColorMap\n\t\t{\n\t\t\tbool Equals(SingleColorMap other)\n\t\t\t{\n\t\t\t\treturn _singleColor.Equals(other._singleColor);\n\t\t\t}\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\t\tif (obj.GetType() != GetType()) return false;\n\t\t\t\treturn Equals((SingleColorMap)obj);\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\treturn _singleColor.GetHashCode();\n\t\t\t}\n\n\t\t\treadonly Color _singleColor;\n\n\t\t\tpublic SingleColorMap(Color singleColor)\n\t\t\t{\n\t\t\t\t_singleColor = singleColor;\n\t\t\t}\n\n\t\t\tpublic Color Map(Color color)\n\t\t\t{\n\t\t\t\treturn _singleColor;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Icons/MinimizeAndMaximizeIcon.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio.Icons\n{\n\tstatic class MinimizeAndMaximizeIcon\n\t{\n\t\tpublic static IControl Create(IObservable<Mode> mode)\n\t\t{\n\t\t\tvar minimize = Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => Image.FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.Minimize_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.Minimize_light.png\", typeof(MinimizeAndMaximizeIcon).Assembly))\n\t\t\t\t.Switch();\n\t\t\tvar maximize = Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => Image.FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.Maximize_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.Maximize_light.png\", typeof(MinimizeAndMaximizeIcon).Assembly))\n\t\t\t\t.Switch();\n\n\t\t\treturn mode.Select(m => m == Mode.Compact ?  maximize.WithSize(new Size<Points>(16,16)) : minimize.WithSize(new Size<Points>(15,15)))\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Icons/SelectionIcon.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio.Icons\n{\n\tclass SelectionIcon\n\t{\n\t\tpublic static IControl Create(IObservable<bool> isEnabled, bool isHittable = false)\n\t\t{\n\t\t\tvar enabledIcon = Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => Image.FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.SelectionOn_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.SelectionOn_light.png\", typeof(MinimizeAndMaximizeIcon).Assembly))\n\t\t\t\t.Switch();\n\t\t\tvar disabledIcon = Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => Image.FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.SelectionOff_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.SelectionOff_light.png\", typeof(MinimizeAndMaximizeIcon).Assembly))\n\t\t\t\t.Switch();\n\n\t\t\treturn isEnabled.Select(e => e ? enabledIcon : disabledIcon)\n\t\t\t\t.Switch()\n\t\t\t\t.WithBackground(Color.Transparent)\n\t\t\t\t.WithSize(new Size<Points>(11,37));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Icons/StackIcon.cs",
    "content": "using System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio.Inspector\n{\n\tstatic class StackIcon\n\t{\n\t\tpublic static IControl Create(Axis2D axis, Brush brush)\n\t\t{\n\t\t\tvar four = Observable.Return<Points>(3);\n\t\t\tvar two = Observable.Return<Points>(1);\n\t\t\tvar gentle = Observable.Return(new CornerRadius(1));\n\n\t\t\treturn Layout\n\t\t\t\t.Stack(\n\t\t\t\t\taxis == Axis2D.Horizontal ? Direction2D.LeftToRight : Direction2D.TopToBottom,\n\t\t\t\t\tShapes.Rectangle(fill: brush, cornerRadius: gentle).WithDimension(axis, four),\n\t\t\t\t\tControl.Empty.WithDimension(axis, two),\n\t\t\t\t\tShapes.Rectangle(fill: brush, cornerRadius: gentle).WithDimension(axis, four),\n\t\t\t\t\tControl.Empty.WithDimension(axis, two),\n\t\t\t\t\tShapes.Rectangle(fill: brush, cornerRadius: gentle).WithDimension(axis, four))\n\t\t\t\t.WithDimension(axis.Opposite(), Observable.Return<Points>(12))\n\t\t\t\t.Center()\n\t\t\t\t.WithSize(new Size<Points>(12,16))\n\t\t\t\t;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Icons/TextAlignmentIcon.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio.Inspector\n{\n\tpublic static class TextAlignmentIcon\n\t{\n\t\tpublic static IControl Create(TextAlignment alignment, Brush fill)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tControl.Empty.WithHeight(1).WithWidth(15),\n\t\t\t\tAlign(Shapes.Rectangle(fill: fill).WithWidth(13).WithHeight(1), alignment),\n\t\t\t\tControl.Empty.WithHeight(1),\n\t\t\t\tAlign(Shapes.Rectangle(fill: fill).WithWidth(11).WithHeight(1), alignment),\n\t\t\t\tControl.Empty.WithHeight(1),\n\t\t\t\tAlign(Shapes.Rectangle(fill: fill).WithWidth(13).WithHeight(1), alignment),\n\t\t\t\tControl.Empty.WithHeight(1),\n\t\t\t\tAlign(Shapes.Rectangle(fill: fill).WithWidth(7).WithHeight(1), alignment),\n\t\t\t\tControl.Empty.WithHeight(1),\n\t\t\t\tAlign(Shapes.Rectangle(fill: fill).WithWidth(11).WithHeight(1), alignment))\n\t\t\t\t.WithPadding(left: new Points(1), right: new Points(1));\n\t\t}\n\n\t\tstatic IControl Align(IControl self, TextAlignment alignment)\n\t\t{\n\t\t\tswitch (alignment)\n\t\t\t{\n\t\t\t\tcase TextAlignment.Left:\n\t\t\t\t\treturn self.Dock(RectangleEdge.Left);\n\t\t\t\tcase TextAlignment.Right:\n\t\t\t\t\treturn self.Dock(RectangleEdge.Right);\n\t\t\t\tdefault:\n\t\t\t\t\treturn self.CenterHorizontally();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Icons/TouchIcon.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio.Icons\n{\n\tclass TouchIcon\n\t{\n\t\tpublic static IControl Create(IObservable<bool> isEnabled, bool isHittable = false)\n\t\t{\n\t\t\tvar enabledIcon = Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => Image.FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.touchOn_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.touchOn_light.png\", typeof(MinimizeAndMaximizeIcon).Assembly))\n\t\t\t\t.Switch();\n\t\t\tvar disabledIcon = Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => Image.FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.HeaderBar.touchOff_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.HeaderBar.touchOff_light.png\", typeof(MinimizeAndMaximizeIcon).Assembly))\n\t\t\t\t.Switch();\n\n\t\t\treturn isEnabled.Select(e => e ? disabledIcon : enabledIcon)\n\t\t\t\t.Switch()\n\t\t\t\t.WithBackground(Color.Transparent)\n\t\t\t\t.WithSize(new Size<Points>(15,37));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Import/ImportFailed.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Import\n{\n\tpublic class ImportFailed : Exception\n\t{\n\t\tpublic ImportFailed(string message, Exception innerException = null)\n\t\t\t: base(message, innerException)\n\t\t{ }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Import/ImportOperation.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Outracks.Fuse.Studio;\nusing Outracks.IO;\nusing SketchConverter.API;\nusing Uno.Collections;\n\nnamespace Outracks.Fuse.Import\n{\n\tpublic abstract class ImportOperation\n\t{\n\t\tpublic string Name { get; private set; }\n\t\tpublic string Description { get; private set; }\n\n\t\tprotected ImportOperation(string name, string description)\n\t\t{\n\t\t\tName = name;\n\t\t\tDescription = description;\n\t\t}\n\n\t\tpublic abstract bool CanExecute(IAbsolutePath file, AbsoluteFilePath project);\n\n\t\t/// <exception cref=\"ImportFailed\"></exception>\n\t\tpublic abstract void Execute(IAbsolutePath file, AbsoluteFilePath project, IEnumerable<string> arguments);\n\n\t\tpublic abstract void WriteOptions(TextWriter output);\n\t}\n\n\tpublic class SketchConversionOperation : ImportOperation\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly IConverter _converter;\n\t\treadonly ReportLogger _reportLogger;\n\n\t\tpublic SketchConversionOperation(\n\t\t\tstring name,\n\t\t\tstring description,\n\t\t\tIFileSystem fileSystem,\n\t\t\tIReport report) : base(name, description)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_reportLogger = new ReportLogger(report);\n\t\t\t_converter = Factory.CreateConverterWithSymbolsUxBuilder(_reportLogger);\n\t\t}\n\n\n\t\tpublic override bool CanExecute(IAbsolutePath path, AbsoluteFilePath project)\n\t\t{\n\t\t\tvar file = path as AbsoluteFilePath;\n\t\t\tif (file == null) return false;\n\n\t\t\treturn _fileSystem.Exists(file) && _fileSystem.Exists(project) &&\n\t\t\t\t(SketchImportUtils.IsSketchFile(file) || file.Name.HasExtension(SketchImportUtils.SketchFilesExtension));\n\t\t}\n\n\n\t\tpublic override void Execute(IAbsolutePath path, AbsoluteFilePath project, IEnumerable<string> arguments)\n\t\t{\n\t\t\tvar file = path as AbsoluteFilePath;\n\n\t\t\tif (file == null) throw new ImportFailed(\"'\" + path + \"' does not appear to be a file\");\n\n\t\t\tvar outputDir = project.ContainingDirectory.Combine(SketchImportUtils.OutputDirName);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tDirectory.CreateDirectory(outputDir.NativePath);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_reportLogger.Error(\"Sketch importer error: \" + e.Message);\n\t\t\t}\n\n\t\t\tif (SketchImportUtils.IsSketchFile(file))\n\t\t\t{\n\t\t\t\tTryConvert(new[] { file.NativePath }, outputDir.NativePath);\n\t\t\t}\n\t\t\telse if (SketchImportUtils.IsSketchFilesFile(file))\n\t\t\t{\n\t\t\t\t// load sketch file paths from the json-file\n\t\t\t\tvar sketchFiles = SketchImportUtils.MakeAbsolute(\n\t\t\t\t\tSketchImportUtils.SketchFilePaths(SketchImportUtils.SketchListFilePath(project), _reportLogger),\n\t\t\t\t\tproject.ContainingDirectory).Select(f => f.NativePath).ToArray();\n\n\t\t\t\tTryConvert(sketchFiles, outputDir.NativePath);\n\t\t\t}\n\t\t}\n\n\n\t\tpublic override void WriteOptions(TextWriter output)\n\t\t{\n\t\t\toutput.WriteLine(\"Import Sketch Symbols some sketchy tips\");\n\t\t}\n\n\n\t\tvoid TryConvert(IEnumerable<string> inputFiles, string outputDirectory)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_converter.Convert(inputFiles, outputDirectory);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_reportLogger.Error(\"Sketch importer error: \" + e.Message);\n\t\t\t}\n\t\t}\n\n\t\tclass ReportLogger : ILogger\n\t\t{\n\t\t\treadonly IReport _report;\n\n\t\t\tpublic ReportLogger(IReport report) {_report = report;}\n\t\t\tpublic void Info(string info) { _report.Info(info, ReportTo.LogAndUser);}\n\t\t\tpublic void Warning(string warning) { _report.Warn(warning, ReportTo.LogAndUser);}\n\t\t\tpublic void Error(string error) { _report.Error(error);}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDisplayName</key>\n\t<string>fuse X</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.fuse-x.studio</string>\n\t<key>CFBundleName</key>\n\t<string>fuse X</string>\n\t<key>CFBundleVersion</key>\n\t<string>VERSION_NUMBER</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>10.7</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>CFBundleIconFile</key>\n\t<string>Fuse</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>VERSION_NUMBER</string>\n\t<key>MonoMinimumVersion</key>\n\t<string>6.4</string>\n\n\t<key>CFBundleDocumentTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeExtensions</key>\n\t\t\t<array>\n\t\t\t\t<string>unoproj</string>\n\t\t\t</array>\n\t\t\t<key>CFBundleTypeIconFile</key>\n\t\t\t<string>Unoproj</string>\n\t\t\t<key>CFBundleTypeName</key>\n\t\t\t<string>fuse X Project</string>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>NSDocumentClass</key>\n\t\t\t<string>ObservableNSDocument</string>\n\t\t\t<key>LSHandlerRank</key>\n\t\t\t<string>Owner</string>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/fuse/studio/LanguageMenu.cs",
    "content": "﻿using Outracks.Fusion;\nusing Outracks.Fusion.Dialogs;\nusing System;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class LanguageMenu\n\t{\n\t\tpublic static readonly IProperty<Language> CurrentLanguage = UserSettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.Enum<Language>(\"Language\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.Or(Strings.Culture.GetLanguage())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.AutoInvalidate();\n\n\t\tpublic static Menu Menu = Menu.Option(\n\t\t\t\t\t\t\t\t\tvalue: Language.English,\n\t\t\t\t\t\t\t\t\tname: \"English\",\n\t\t\t\t\t\t\t\t\tproperty: CurrentLanguage)\n\t\t\t\t\t\t\t\t+ Menu.Option(\n\t\t\t\t\t\t\t\t\tvalue: Language.French,\n\t\t\t\t\t\t\t\t\tname: \"Français\",\n\t\t\t\t\t\t\t\t\tproperty: CurrentLanguage)\n\t\t\t\t\t\t\t\t+ Menu.Option(\n\t\t\t\t\t\t\t\t\tvalue: Language.Korean,\n\t\t\t\t\t\t\t\t\tname: \"한국인\",\n\t\t\t\t\t\t\t\t\tproperty: CurrentLanguage);\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tvar firstInvoke = true;\n\n\t\t\tCurrentLanguage.Subscribe(lang => {\n\t\t\t\tStrings.Culture = lang.GetCulture();\n\t\t\t\tTexts.Update();\n\n\t\t\t\tif (firstInvoke)\n\t\t\t\t{\n\t\t\t\t\tfirstInvoke = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tMessageBox.BringToFront();\n\t\t\t\tMessageBox.Show(Strings.LanguageUpdated_Text, \"fuse X\", MessageBoxType.Information);\n\n\t\t\t\t// Avoid getting two popups in a row\n\t\t\t\tfirstInvoke = true;\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainMenu/CheckForUpdates.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Net;\nusing Outracks.Fusion;\nusing Outracks.Fusion.Dialogs;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass CheckForUpdates\n\t{\n\t\tpublic Menu Menu { get; private set; }\n\n\t\tpublic CheckForUpdates(string version)\n\t\t{\n\t\t\tvar checkForUpdates = CheckForUpdatesCommand(version);\n\t\t\tvar checkAutomatically = UserSettings.Bool(\"CheckForUpdates\").Or(true);\n\t\t\tInitCheckForUpdates(checkForUpdates, checkAutomatically);\n\n\t\t\tMenu = Menu.Item(Texts.SubMenu_Updates_CheckForUpdates, checkForUpdates)\n\t\t\t\t + Menu.Toggle(Texts.SubMenu_Updates_CheckAutomatically, checkAutomatically);\n\t\t}\n\n\t\tasync static void InitCheckForUpdates(Command checkForUpdates, IProperty<bool> checkAutomatically)\n\t\t{\n\t\t\tif (await checkAutomatically.FirstAsync())\n\t\t\t\t(await checkForUpdates.Action.FirstAsync()).Value.Invoke();\n\t\t}\n\n\t\tstatic Command CheckForUpdatesCommand(string version)\n\t\t{\n\t\t\treturn Command.Enabled(() => {\n\t\t\t\tConsole.WriteLine(\"Checking for updates...\");\n\t\t\t\tGetRemoteReleases().ContinueWith(task => {\n\t\t\t\t\tif (task.Exception != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.Error.WriteLine(\"Error checking for updates: \" + task.Exception);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar updateVersion = GetUpdateVersion(task.Result, version.TrimStart('v'));\n\n\t\t\t\t\t\tif (string.IsNullOrEmpty(updateVersion))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tConsole.WriteLine(\"No updates available for version \" + version + \".\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tConsole.WriteLine(\"Update available: \" + updateVersion);\n\n\t\t\t\t\t\tif (MessageBox.ShowConfirm(\n\t\t\t\t\t\t\t\tStrings.SubMenu_Updates_UpdateAvailable\n\t\t\t\t\t\t\t\t\t+ \": \" + updateVersion + \"\\n\\n\"\n\t\t\t\t\t\t\t\t\t+ Strings.SubMenu_Updates_DownloadLatestQuestion,\n\t\t\t\t\t\t\t\t\"fuse X\", MessageBoxType.Information))\n\t\t\t\t\t\t\tProcess.Start(WebLinks.Download);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tstatic string GetUpdateVersion(List<JObject> releases, string currentVersion)\n\t\t{\n\t\t\tvar currentIsPrerelease = currentVersion.IndexOf('-') != -1;\n\t\t\tstring foundVersion = null;\n\n\t\t\tforeach (var release in releases)\n\t\t\t{\n\t\t\t\tvar assets = (JArray)release[\"assets\"];\n\t\t\t\tvar prerelease = (bool)release[\"prerelease\"];\n\t\t\t\tvar tag_name = (string)release[\"tag_name\"];\n\t\t\t\tvar version = tag_name.TrimStart('v');\n\n\t\t\t\tif (version == currentVersion)\n\t\t\t\t\treturn foundVersion;\n\n\t\t\t\tif (!ContainsCompatibleInstaller(assets))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (foundVersion == null && (currentIsPrerelease || !prerelease))\n\t\t\t\t\tfoundVersion = version;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic bool ContainsCompatibleInstaller(JArray assets)\n\t\t{\n\t\t\tforeach (var asset in assets)\n\t\t\t{\n\t\t\t\tvar name = (string)asset[\"name\"];\n\n\t\t\t\tif (Platform.IsMac && name.EndsWith(\".dmg\") ||\n\t\t\t\t\tPlatform.IsMac && name.EndsWith(\".pkg\") ||\n\t\t\t\t\tPlatform.IsWindows && name.EndsWith(\".exe\") ||\n\t\t\t\t\tPlatform.IsWindows && name.EndsWith(\".msi\"))\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tasync static Task<List<JObject>> GetRemoteReleases()\n\t\t{\n\t\t\tusing (var client = new FuseWebClient())\n\t\t\t{\n\t\t\t\tvar body = await client.DownloadStringTaskAsync(\"https://api.github.com/repos/fuse-x/studio/releases\");\n\t\t\t\treturn JsonConvert.DeserializeObject<List<JObject>>(body);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainMenu/Help.cs",
    "content": "using System.Diagnostics;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass Help\n\t{\n\t\tpublic Menu Menu { get; private set; }\n\n\t\tpublic Help()\n\t\t{\n\t\t\tMenu =\n\t\t\t\t  Menu.Item(Texts.SubMenu_Help_Documentation, CreateUrlAction(WebLinks.Documentation))\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Help_Examples, CreateUrlAction(WebLinks.Examples))\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Help_Tutorial, CreateUrlAction(WebLinks.Tutorial))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Help_Community, CreateUrlAction(WebLinks.Community))\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Help_Forums, CreateUrlAction(WebLinks.Forums))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Help_ReportIssue, CreateUrlAction(WebLinks.Issues));\n\t\t}\n\n\t\tstatic Command CreateUrlAction(string url)\n\t\t{\n\t\t\treturn Command.Enabled(() => Process.Start(url));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainMenu/MainMenu.cs",
    "content": "using Outracks.Diagnostics;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Setup;\nusing Outracks.Fuse.Stage;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio\n{\n\tstatic class MainMenu\n\t{\n\t\tpublic static Menu Create(\n\t\t\tIFuse fuse,\n\t\t\tIMessagingService daemon,\n\t\t\tIShell shell,\n\t\t\tStageController stage,\n\t\t\tHelp help,\n\t\t\tMenu elementMenu,\n\t\t\tMenu projectMenu,\n\t\t\tBuild preview,\n\t\t\tExport export,\n\t\t\tSetupGuide setupGuide,\n\t\t\tCheckForUpdates checkForUpdates,\n\t\t\tMenu windowMenu,\n\t\t\tDebug debug,\n\t\t\tActivate activate)\n\t\t{\n\t\t\tvar about = new About(fuse.Version, fuse.License, daemon, debug, activate);\n\n\t\t\tvar menus\n\t\t\t\t= Menu.Submenu(Texts.MainMenu_File, CreateFileMenu())\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Edit, Application.EditMenu)\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Element, elementMenu)\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Project, projectMenu)\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Viewport, stage?.Menu ?? new Menu())\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Preview, preview?.Menu ?? new Menu())\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Export, export?.Menu ?? new Menu())\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Tools, setupGuide.Menu)\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Window, windowMenu)\n\t\t\t\t+ Menu.Submenu(Texts.MainMenu_Help, CreateHelpMenu(help, checkForUpdates, about, activate))\n\t\t\t\t+ (debug?.Menu ?? new Menu());\n\n\t\t\tif (Platform.IsMac)\n\t\t\t\treturn Menu.Submenu(\"fuse X\", CreateFuseMenu(checkForUpdates, about, activate))\n\t\t\t\t\t + menus;\n\n\t\t\treturn menus;\n\t\t}\n\n\t\tstatic Menu CreateHelpMenu(Help help, CheckForUpdates checkForUpdates, About about, Activate activate)\n\t\t{\n\t\t\treturn (Platform.IsWindows ? help.Menu + Menu.Separator + checkForUpdates.Menu + Menu.Separator + activate.Menu + Menu.Separator + about.Menu : help.Menu);\n\t\t}\n\n\t\tstatic Menu CreateFuseMenu(CheckForUpdates checkForUpdates, About about, Activate activate)\n\t\t{\n\t\t\treturn about.Menu\n\t\t\t\t + Menu.Separator\n\t\t\t\t + activate.Menu\n\t\t\t\t + Menu.Separator\n\t\t\t\t + checkForUpdates.Menu\n\t\t\t\t + Menu.Separator\n\t\t\t\t + CreateQuitItem();\n\t\t}\n\n\t\tstatic Menu CreateFileMenu()\n\t\t{\n\t\t\treturn CreateSplashScreenItem()\n\t\t\t\t+ CreateOpenItem()\n\t\t\t\t+ (Platform.IsWindows\n\t\t\t\t\t? Menu.Separator + CreateQuitItem()\n\t\t\t\t\t: Menu.Empty);\n\t\t}\n\n\t\tstatic Menu CreateSplashScreenItem()\n\t\t{\n\t\t\treturn Menu.Item(\n\t\t\t\tTexts.SubMenu_File_New,\n\t\t\t\thotkey: HotKey.Create(ModifierKeys.Meta, Key.N),\n\t\t\t\taction: () => Application.LaunchedWithoutDocuments());\n\t\t}\n\n\t\tstatic Menu CreateOpenItem()\n\t\t{\n\t\t\treturn Menu.Item(\n\t\t\t\tTexts.SubMenu_File_Open,\n\t\t\t\thotkey: HotKey.Create(ModifierKeys.Meta, Key.O),\n\t\t\t\taction: () => Application.ShowOpenDocumentDialog(new FileFilter(\"fuse X Project\", \"unoproj\")));\n\t\t}\n\n\t\tstatic Menu CreateQuitItem()\n\t\t{\n\t\t\tvar quitItem = Menu.Item(\n\t\t\t\tPlatform.IsMac ? Texts.SubMenu_File_Quit : Texts.SubMenu_File_Exit,\n\t\t\t\thotkey: Platform.IsWindows ? HotKey.Create(ModifierKeys.Alt, Key.F4) : HotKey.Create(ModifierKeys.Command, Key.Q),\n\t\t\t\taction: () => { Application.Exit(0); });\n\t\t\treturn quitItem;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainMenu/ProjectMenu.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ProjectMenu\n\t{\n\t\tpublic static Menu CommandItems(IObservable<Optional<AbsoluteFilePath>> project, IShell shell)\n\t\t{\n\t\t\treturn Menu.Item(Texts.SubMenu_Project_OpenFolder, OpenFolder.CreateCommand(shell, project))\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Project_OpenTerminal, OpenTerminal.CreateCommand(shell, project))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ OpenTextEditor.CreateMenu(project);\n\t\t}\n\n\t\tpublic static Menu FileItems(IProject project, IShell shell)\n\t\t{\n\t\t\treturn project\n\t\t\t\t.Documents\n\t\t\t\t.SelectPerElement(doc => doc.FilePath)\n\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t.CombineLatest(\n\t\t\t\t\tproject.FilePath,\n\t\t\t\t\t(uxFiles, projFile) =>\n\t\t\t\t\t\tCreateOpenMenuItems(projFile.ContainingDirectory, uxFiles.ConcatOne(projFile), shell))\n\t\t\t\t.Concat();\n\t\t}\n\n\t\tstatic IEnumerable<Menu> CreateOpenMenuItems(AbsoluteDirectoryPath root, IEnumerable<IAbsolutePath> filesAndFolders, IShell shell)\n\t\t{\n\t\t\tvar folderToFiles = filesAndFolders.ToChildLookup(path => path.ContainingDirectory.ToOptional<IAbsolutePath>());\n\t\t\treturn CreateItems(root, folderToFiles, shell);\n\t\t}\n\n\t\tstatic IEnumerable<Menu> CreateItems(AbsoluteDirectoryPath currentDir, ILookup<IAbsolutePath, IAbsolutePath> folderToFiles, IShell shell)\n\t\t{\n\t\t\tvar dirs = folderToFiles[currentDir].OfType<AbsoluteDirectoryPath>().OrderBy(f => f.Name);\n\t\t\tvar files = folderToFiles[currentDir].OfType<AbsoluteFilePath>().OrderBy(f => f.Name);\n\n\t\t\tforeach (var dir in dirs)\n\t\t\t{\n\t\t\t\tyield return Menu.Submenu(\n\t\t\t\t\tname: dir.Name.ToString() + Path.DirectorySeparatorChar,\n\t\t\t\t\ticon: Icons.Folder,\n\t\t\t\t\tsubmenu: CreateItems(dir, folderToFiles, shell).Concat());\n\t\t\t}\n\n\t\t\tforeach (var file in files)\n\t\t\t{\n\t\t\t\tvar f = file;\n\t\t\t\tyield return Menu.Item(\n\t\t\t\t\tname: file.Name.ToString(),\n\t\t\t\t\ticon: Icons.GetFileIcon(f),\n\t\t\t\t\taction: () => shell.OpenWithDefaultApplication(f));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Busy.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tstatic class Busy\n\t{\n\t\tpublic static IControl Create(string message, IObservable<Color> background, IObservable<Color> foreground)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Left(\n\t\t\t\t\tLabel.Create(message, font: Theme.DefaultFont, color: foreground.AsBrush())\n\t\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(8,0,0,0)))\n\t\t\t\t.Right(\n\t\t\t\t\tBusyIndicator(foreground)\n\t\t\t\t\t\t.WithHeight(8)\n\t\t\t\t\t\t.WithWidth(52)\n\t\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(0,0,8,0)))\n\t\t\t\t.Fill()\n\t\t\t\t.WithBackground(Shapes.Rectangle(fill: background.AsBrush()))\n\t\t\t\t.WithHeight(24)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Top, new[] { false, true }.ToObservable(), lazy: false);\n\t\t}\n\n\t\tstatic IControl BusyIndicator(IObservable<Color> overlaycolor)\n\t\t{\n\t\t\treturn Image.Animation(\"FuseBusyAnim\", typeof(LogoAndVersion).Assembly, TimeSpan.FromMilliseconds(1000), overlaycolor);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/DropPosition.cs",
    "content": "namespace Outracks.Fuse.Hierarchy\n{\n\tpublic enum DropPosition\n\t{\n\t\tBefore,\n\t\tAfter,\n\t\tInside\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/ITreeRowViewModel.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Hierarchy\n{\n\tpublic interface ITreeRowViewModel\n\t{\n\t\tIObservable<int> RowOffset { get; }\n\t\tIObservable<int> Depth { get; }\n\t\tIObservable<int> ExpandedDescendantCount { get; }\n\n\t\tCommand ExpandToggleCommand { get; }\n\t\tIObservable<bool> CanExpand { get; }\n\t\tIObservable<bool> IsExpanded { get; }\n\t\tIObservable<bool> IsSelected { get; }\n\n\t\tIObservable<bool> IsAncestorSelected { get; }\n\t\tCommand SelectCommand { get; }\n\t\tIObservable<bool> IsFaded { get; }\n\t\tCommand ScopeIntoClassCommand { get; }\n\n\t\tIObservable<string> HeaderText { get; }\n\t\tIObservable<string> ElementName { get; }\n\n\t\tMenu ContextMenu { get; }\n\n\t\tIObservable<object> DraggedObject { get; }\n\t\tvoid DragEnter(DropPosition position);\n\t\tvoid DragExit();\n\t\tbool CanDrop(DropPosition position, object dragged);\n\t\tvoid Drop(DropPosition position, object dragged);\n\n\t\tCommand EnterHoverCommand { get; }\n\t\tCommand ExitHoverCommand { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/ITreeViewModel.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Hierarchy\n{\n\tpublic interface ITreeViewModel\n\t{\n\t\tint VisibleRowCount { get; set; }\n\t\tint VisibleRowOffset { get; set; }\n\n\t\tIObservable<bool> HighlightSelectedElement { get; }\n\n\t\tIObservable<int> ScrollTarget { get; }\n\n\t\tIObservable<int> TotalRowCount { get; }\n\t\tIObservable<IEnumerable<ITreeRowViewModel>> VisibleRows { get; }\n\n\t\tCommand PopScopeCommand { get; }\n\t\tIObservable<string> PopScopeLabel { get; }\n\n\t\tIObservable<Optional<PendingDrop>> PendingDrop { get; }\n\n\t\tCommand NavigateUpCommand { get; }\n\t\tCommand NavigateDownCommand { get; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/InsertionRod.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Hierarchy\n{\n\tstatic class InsertionRod\n\t{\n\t\tpublic static IControl Create(IObservable<Optional<Point<IObservable<Points>>>> hoverIndicator)\n\t\t{\n\t\t\tvar color = Color.FromBytes(94, 184, 205);\n\n\t\t\tvar indicator = Layout.Dock()\n\t\t\t\t.Left(Shapes.Circle(Stroke.Create(2, color))\n\t\t\t\t\t.WithHeight(6).WithWidth(6))\n\t\t\t\t.Fill(Shapes.Rectangle(fill: color)\n\t\t\t\t\t.WithHeight(2).CenterVertically());\n\n\t\t\treturn indicator\n\t\t\t\t.WithPadding(\n\t\t\t\t\tleft: hoverIndicator.NotNone().Select(v => v.X.Sub(indicator.DesiredSize.Width).Sub(2)).Switch(),\n\t\t\t\t\ttop: hoverIndicator.NotNone().Select(v => v.Y).Switch().Sub(indicator.DesiredSize.Height.Div(2)))\n\t\t\t\t.DockTop()\n\t\t\t\t.ShowWhen(hoverIndicator\n\t\t\t\t\t.Select(i => i.HasValue)\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.Throttle(TimeSpan.FromSeconds(1.0 / 100.0))\n\t\t\t\t\t.ObserveOn(Application.MainThread));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/PendingDrop.cs",
    "content": "namespace Outracks.Fuse.Hierarchy\n{\n\tpublic class PendingDrop\n\t{\n\t\treadonly int _rowOffset;\n\t\treadonly DropPosition _dropPosition;\n\t\treadonly int _depth;\n\n\n\t\tpublic int RowOffset\n\t\t{\n\t\t\tget { return _rowOffset; }\n\t\t}\n\n\t\tpublic DropPosition DropPosition\n\t\t{\n\t\t\tget { return _dropPosition; }\n\t\t}\n\n\t\tpublic int Depth\n\t\t{\n\t\t\tget { return _depth; }\n\t\t}\n\n\t\tpublic PendingDrop(int rowOffset, DropPosition dropPosition, int depth)\n\t\t{\n\t\t\t_rowOffset = rowOffset;\n\t\t\t_dropPosition = dropPosition;\n\t\t\t_depth = depth;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/TreeRowView.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Hierarchy\n{\n\tclass TreeRowView\n\t{\n\t\treadonly ITreeRowViewModel _model;\n\n\t\treadonly IObservable<Points> _indentation;\n\n\t\tpublic IControl Background { get; private set; }\n\t\tpublic IControl Foreground { get; private set; }\n\t\tpublic IControl Overlay { get; private set; }\n\n\t\tpublic TreeRowView(ITreeRowViewModel model, Func<IObservable<int>, IObservable<Points>> rowOffsetToTop)\n\t\t{\n\t\t\t_model = model;\n\t\t\t_indentation = model.Depth.Select(GetIndentation).Replay(1).RefCount();\n\n\t\t\tvar top = RectangleEdge.Top.FlipVerticallyOnMac();\n\t\t\tvar down = Axis2DExtensions.ShouldFlip ? -1.0 : 1.0;\n\n\t\t\tvar frameVerticalInterval = rowOffsetToTop(model.RowOffset)\n\t\t\t\t.CombineLatest(\n\t\t\t\t\t_model.ExpandedDescendantCount,\n\t\t\t\t\t(rowTop, expandedDescendantCount) =>\n\t\t\t\t\t\tRectangle.Zero<Points>()\n\t\t\t\t\t\t\t.WithEdge(top, rowTop)\n\t\t\t\t\t\t\t.WithEdge(top.Opposite(), rowTop.Add((expandedDescendantCount + 1) * Height * down))\n\t\t\t\t\t\t\t.VerticalInterval)\n\t\t\t\t.Transpose()\n\t\t\t\t.Replay(1)\n\t\t\t\t.RefCount();\n\n\t\t\tBackground =\n\t\t\t\tVerticalLine(Theme.OutlineVerticalLineBackground)\n\t\t\t\t\t.WithFrame(x => x.WithAxis(Axis2D.Vertical, frameVerticalInterval));\n\n\t\t\tForeground =\n\t\t\t\tHeader()\n\t\t\t\t\t.WithBackground(HitRect())\n\t\t\t\t\t.WithBackground(SelectionIndicator())\n\t\t\t\t\t.DockTop()\n\t\t\t\t\t.WithFrame(x => x.WithAxis(Axis2D.Vertical, frameVerticalInterval));\n\n\t\t\tvar highlightBrush =\n\t\t\t\t_model.IsFaded.Select(isFaded => isFaded ? Theme.PanelBackground.WithAlpha(0.5f) : Color.Transparent).Switch();\n\n\t\t\tOverlay =\n\t\t\t\tVerticalLine(Color.FromBytes(255, 255, 255, 30))\n\t\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: highlightBrush).WithHeight(Height).DockTop())\n\t\t\t\t\t.WithFrame(x => x.WithAxis(Axis2D.Vertical, frameVerticalInterval));\n\t\t}\n\n\t\tIControl VerticalLine(Brush color)\n\t\t{\n\t\t\treturn Separator.HorizontalLine(color, new Points(1))\n\t\t\t\t.CenterHorizontally()\n\t\t\t\t.WithWidth(IconWidth)\n\t\t\t\t.WithPadding(left: Indentation, top: Observable.Return(Height - IconPadding), bottom: Observable.Return(IconPadding))\n\t\t\t\t.DockLeft();\n\t\t}\n\n\t\tIControl SelectionIndicator()\n\t\t{\n\t\t\treturn Shapes.Rectangle(\n\t\t\t\t\tfill: _model.IsSelected.Select(selected => selected ? Theme.Active : Theme.Active.WithAlpha(0.11f)).Switch())\n\t\t\t\t.ShowWhen(_model.IsSelected.Or(_model.IsAncestorSelected));\n\t\t}\n\n\t\tIControl Header()\n\t\t{\n\t\t\treturn Layout\n\t\t\t\t.StackFromLeft(\n\t\t\t\t\tElementIcon().CenterVertically(),\n\t\t\t\t\tSpacer.Small,\n\t\t\t\t\tLabel.Create(HeaderText.AsText(), HeaderTextFont, color: HeaderTextColor)\n\t\t\t\t\t\t.CenterVertically(),\n\t\t\t\t\tSpacer.Small,\n\t\t\t\t\tExpandCollapseButton())\n\t\t\t\t.WithPadding(left: Indentation)\n\t\t\t\t.WithHeight(Height);\n\t\t}\n\n\t\tIControl ElementIcon()\n\t\t{\n\t\t\treturn _model.ElementName.Where(x => x != \"\").StartWith(\"\").DistinctUntilChanged()\n\t\t\t\t.Select(x => Icons.MediumIcon(x, IconColor, IconColor)).Switch();\n\t\t}\n\n\t\tIControl ExpandCollapseButton()\n\t\t{\n\t\t\tvar expandedArrow = Arrow.WithoutShaft(RectangleEdge.Bottom, SymbolSize.Medium, ExpansionArrowColor)\n\t\t\t\t.Center()\n\t\t\t\t.WithSize(Size.Create<Points>(11, 11))\n\t\t\t\t.VisibleWhen(_model.IsExpanded);\n\n\t\t\tvar collapsedArrow = Arrow.WithoutShaft(RectangleEdge.Right, SymbolSize.Medium, ExpansionArrowColor)\n\t\t\t\t.Center()\n\t\t\t\t.WithSize(Size.Create<Points>(11, 11))\n\t\t\t\t.VisibleWhen(_model.IsExpanded.IsFalse());\n\n\t\t\tvar expandCollapseButton =\n\t\t\t\tnew[] { expandedArrow, collapsedArrow }.Layer()\n\t\t\t\t\t.WithSize(Size.Create<Points>(11, 11))\n\t\t\t\t\t.OnMouse(pressed: _model.ExpandToggleCommand)\n\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t.VisibleWhen(_model.ExpandToggleCommand.IsEnabled);\n\t\t\t//.ShowWhen(_model.ShowExpandArrow);\n\t\t\treturn expandCollapseButton;\n\t\t}\n\n\t\tIObservable<string> HeaderText\n\t\t{\n\t\t\tget { return _model.HeaderText; }\n\t\t}\n\n\t\tFont HeaderTextFont\n\t\t{\n\t\t\tget { return _model.Depth.Select(depth => depth == 0 ? Theme.DefaultFontBold : Theme.DefaultFont).Switch(); }\n\t\t}\n\n\t\tBrush HeaderTextColor\n\t\t{\n\t\t\tget { return _model.IsSelected.Select(s => s ? Color.White : Theme.DefaultText).Switch(); }\n\t\t}\n\n\t\tBrush ExpansionArrowColor\n\t\t{\n\t\t\tget { return _model.IsSelected.Select(s => s ? Color.White : Theme.Active).Switch(); }\n\t\t}\n\n\t\tBrush IconColor\n\t\t{\n\t\t\tget { return _model.IsSelected.Select(s => s ? Color.White : Theme.OutlineIcon).Switch(); }\n\t\t}\n\n\t\t// Input event handling (click/drag/hover)\n\t\tIControl HitRect()\n\t\t{\n\t\t\treturn Layout.SubdivideVertically(\n\t\t\t\tHitRectPart(DropPosition.Before),\n\t\t\t\tHitRectPart(DropPosition.Inside),\n\t\t\t\tHitRectPart(DropPosition.After));\n\t\t}\n\n\n\t\tIControl HitRectPart(DropPosition position)\n\t\t{\n\t\t\treturn Shapes.Rectangle()\n\t\t\t\t\t.OnDragOver(\n\t\t\t\t\t\tcanDrop: data => _model.CanDrop(position, data),\n\t\t\t\t\t\tenter: data => _model.DragEnter(position),\n\t\t\t\t\t\tleave: data => _model.DragExit(),\n\t\t\t\t\t\tdrop: data => _model.Drop(position, data))\n\t\t\t\t\t.OnMouse(\n\t\t\t\t\t\tentered: _model.EnterHoverCommand,\n\t\t\t\t\t\texited: _model.ExitHoverCommand,\n\t\t\t\t\t\tpressed: _model.SelectCommand,\n\t\t\t\t\t\tdragged: _model.DraggedObject,\n\t\t\t\t\t\tdoubleClicked: _model.ScopeIntoClassCommand)\n\t\t\t\t\t.SetContextMenu(_model.ContextMenu)\n\t\t\t\t;\n\t\t}\n\n\t\t// Metrics\n\n\t\tpublic static Points GetIndentation(int depth)\n\t\t{\n\t\t\treturn new Points(10 + depth * 25);\n\t\t}\n\n\t\tIObservable<Points> Indentation\n\t\t{\n\t\t\tget { return _indentation; }\n\t\t}\n\n\t\tpublic static readonly Points Height = new Points(23);\n\t\tstatic readonly Points IconPadding = new Points(5);\n\t\tstatic readonly Points IconWidth = new Points(21);\n\t}\n\n\tstatic class VisibleWhenExtension\n\t{\n\t\tpublic static IControl VisibleWhen(this IControl control, IObservable<bool> condition)\n\t\t{\n\t\t\treturn control.WithFrame(f => f.WithAxis(Axis2D.Horizontal, interval => Interval.FromOffsetLength(interval.Offset.CombineLatest(condition, (x, isVisible) => isVisible ? x : -10000), interval.Length)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/TreeView.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Hierarchy\n{\n\tpublic static class TreeView\n\t{\n\t\tstatic readonly bool ShouldFlip = Axis2DExtensions.ShouldFlip;\n\n\t\tpublic static IControl Create(ITreeViewModel model)\n\t\t{\n\t\t\tvar rowHeight = TreeRowView.Height;\n\t\t\tvar hoverIndicator = model.PendingDrop.SelectPerElement(\n\t\t\t\tx => Point.Create(\n\t\t\t\t\tObservable.Return(TreeRowView.GetIndentation(x.Depth + (x.DropPosition == DropPosition.Inside ? 1 : 0))),\n\t\t\t\t\tObservable.Return<Points>((x.RowOffset + (x.DropPosition != DropPosition.Before ? 1 : 0)) * rowHeight)));\n\n\t\t\tvar rowCount = model.TotalRowCount.Replay(1).RefCount();\n\n\t\t\tvar visibleHeight = new BehaviorSubject<Points>(0);\n\t\t\tvar contentHeight = visibleHeight.CombineLatest(rowCount, (vheight, rcount) => (Points)Math.Max(vheight, rcount * rowHeight)).Replay(1).RefCount();\n\n\t\t\tvar flipy = ShouldFlip ? ((Func<IObservable<Points>, IObservable<Points>>) (logicalY => logicalY.CombineLatest(contentHeight, (ly, ch) => ch - ly))) : (y => y);\n\n\t\t\tvar rowOffsetToTop = (Func<IObservable<int>, IObservable<Points>>)\n\t\t\t\t(rowOffset => flipy(\n\t\t\t\trowOffset.Select(offset => new Points(rowHeight.Value * offset))));\n\n\t\t\tvar top = RectangleEdge.Top.FlipVerticallyOnMac();\n\t\t\t//var down = ShouldFlip ? -1.0 : 1.0;\n\t\t\t//var scrollTargetRect =\n\t\t\t//\trowOffsetToTop(model.ScrollTarget)\n\t\t\t//\t.Select(rowTop =>\n\t\t\t//\t\tRectangle.FromPositionSize<Points>(0, 0, 50, 0)\n\t\t\t//\t\t.WithEdge(top, rowTop)\n\t\t\t//\t\t.WithEdge(top.Opposite(), rowTop + rowHeight * down));\n\n\t\t\tvar rowViews = model.VisibleRows\n\t\t\t\t.CachePerElement(rowModel => CreateRow(rowModel, rowOffsetToTop))\n\t\t\t\t.Replay(1)\n\t\t\t\t.RefCount();\n\n\t\t\tvar background =\n\t\t\t\trowViews.SelectPerElement(x => x.Background).Layer();\n\t\t\tvar foreground =\n\t\t\t\trowViews.SelectPerElement(x => x.Foreground).Layer();\n\t\t\tvar overlay =\n\t\t\t\trowViews.SelectPerElement(x => x.Overlay).Layer();\n\n\t\t\tvar width =\n\t\t\t\trowViews.Select(\n\t\t\t\t\trows => rows.Select(row => row.Foreground.DesiredSize.Width)\n\t\t\t\t\t\t\t\t.CombineLatest()\n\t\t\t\t\t\t\t\t.Select(widths => widths.ConcatOne(0).Max()))\n\t\t\t\t.Switch()\n\t\t\t\t.DistinctUntilChanged();\n\n\t\t\tvar treeView =\n\t\t\t\tLayout.Layer(background, foreground, overlay)\n\t\t\t\t\t.WithBackground(Theme.PanelBackground)\n\t\t\t\t\t.WithOverlay(InsertionRod.Create(hoverIndicator))\n\t\t\t\t\t.WithHeight(contentHeight)\n\t\t\t\t\t.WithWidth(width)\n\t\t\t\t\t.MakeScrollable(\n\t\t\t\t\t\tdarkTheme: Theme.IsDark,\n\t\t\t\t\t\t// scrollToRectangle: scrollTargetRect,\n\t\t\t\t\t\tonBoundsChanged: bounds =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar rowTop = bounds.Visible.GetEdge(top);\n\t\t\t\t\t\t\trowTop = ShouldFlip ? bounds.Content.Height - rowTop : rowTop;\n\t\t\t\t\t\t\tvar rowOffset = (int) Math.Floor(rowTop / rowHeight);\n\t\t\t\t\t\t\tmodel.VisibleRowOffset = rowOffset;\n\t\t\t\t\t\t\tvar maxVisibleRowCount = (int) Math.Ceiling(bounds.Visible.VerticalInterval.Length / rowHeight.Value) + 1;\n\t\t\t\t\t\t\tmodel.VisibleRowCount = maxVisibleRowCount;\n\t\t\t\t\t\t\tvisibleHeight.OnNext(bounds.Visible.Height);\n\t\t\t\t\t\t});\n\t\t\t\t\t// TODO: CAN'T GET LOCAL KEYS TO WORK PROPERLY\n\t\t\t\t\t//.OnKeyPressed(ModifierKeys.None, Key.Up, model.NavigateUpCommand, isGlobal: true)\n\t\t\t\t\t//.OnKeyPressed(ModifierKeys.None, Key.Down, model.NavigateDownCommand, isGlobal: true);\n\n\t\t\treturn CreatePopScopeButton(model).DockTop(fill: treeView);\n\t\t}\n\n\t\tstatic IControl CreatePopScopeButton(ITreeViewModel treeViewModel)\n\t\t{\n\t\t\tvar popScopeButton =\n\t\t\t\ttreeViewModel.PopScopeCommand.IsEnabled.Select(\n\t\t\t\t\tenabled => enabled\n\t\t\t\t\t\t? Button.Create(\n\t\t\t\t\t\t\ttreeViewModel.PopScopeCommand,\n\t\t\t\t\t\t\tstate => Layout.StackFromTop(\n\t\t\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\t\t\tArrow.WithShaft(RectangleEdge.Left, brush: Theme.Purple)\n\t\t\t\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(15, 7.5))\n\t\t\t\t\t\t\t\t\t\t\t.CenterVertically(),\n\t\t\t\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\t\t\t\ttext: treeViewModel.PopScopeLabel.AsText(),\n\t\t\t\t\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: Theme.DefaultText)\n\t\t\t\t\t\t\t\t\t\t\t.CenterVertically())\n\t\t\t\t\t\t\t\t\t.CenterHorizontally(),\n\t\t\t\t\t\t\t\tSpacer.Medium))\n\t\t\t\t\t\t: Spacer.Medim).Switch();\n\t\t\treturn popScopeButton;\n\t\t}\n\n\t\tstatic TreeRowView CreateRow(ITreeRowViewModel model, Func<IObservable<int>, IObservable<Points>> rowOffsetToTop)\n\t\t{\n\t\t\treturn new TreeRowView(model, rowOffsetToTop);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/TreeViewModel.RowModel.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Hierarchy\n{\n\tpublic partial class TreeViewModel\n\t{\n\t\tclass RowModel : ITreeRowViewModel\n\t\t{\n\t\t\treadonly BehaviorSubject<bool> _expandToggleEnabled;\n\t\t\treadonly BehaviorSubject<int> _depth = new BehaviorSubject<int>(0);\n\n\t\t\treadonly BehaviorSubject<Optional<ILiveElement>> _element =\n\t\t\t\tnew BehaviorSubject<Optional<ILiveElement>>(Optional.None<ILiveElement>());\n\n\t\t\treadonly Command _expandToggleCommand;\n\t\t\treadonly IObservable<string> _headerText;\n\n\t\t\treadonly IObservable<string> _iconName;\n\t\t\treadonly BehaviorSubject<bool> _isAncestorSelected;\n\n\t\t\treadonly BehaviorSubject<bool> _isExpanded;\n\t\t\treadonly BehaviorSubject<bool> _isSelected;\n\t\t\treadonly BehaviorSubject<int> _rowOffset = new BehaviorSubject<int>(-10);\n\t\t\treadonly Command _scopeIntoClassCommand;\n\t\t\treadonly Command _selectCommand;\n\t\t\treadonly TreeViewModel _tree;\n\t\t\tbool _isDescendantSelected;\n\t\t\treadonly BehaviorSubject<int> _expandedDescendantCount = new BehaviorSubject<int>(0);\n\t\t\treadonly IObservable<bool> _isFaded;\n\n\t\t\tpublic RowModel(TreeViewModel tree)\n\t\t\t{\n\t\t\t\t_tree = tree;\n\n\t\t\t\tvar elUxClass = ElementSwitch(el => el.UxClass());\n\t\t\t\t_iconName = ElementSwitch(el => el.Name, \"\");\n\n\t\t\t\t_isSelected = new BehaviorSubject<bool>(false);\n\t\t\t\t_isAncestorSelected = new BehaviorSubject<bool>(false);\n\n\t\t\t\t_expandToggleEnabled = new BehaviorSubject<bool>(false);\n\t\t\t\t_isExpanded = new BehaviorSubject<bool>(false);\n\n\t\t\t\t_selectCommand = Command.Create(\n\t\t\t\t\tElementSelect(el => Optional.Some((Action) (() => _tree._context.Select(el))), Optional.None<Action>()));\n\n\t\t\t\t_headerText = ElementSwitch(\n\t\t\t\t\tel => el.Name.CombineLatest(\n\t\t\t\t\t\tel.UxGlobal(),\n\t\t\t\t\t\tel.UxProperty(),\n\t\t\t\t\t\telUxClass,\n\t\t\t\t\t\tel.UxInnerClass(),\n\t\t\t\t\t\t(name, uxGlobal, uxProperty, uxClass, uxInnerClass) => uxGlobal.Or(uxProperty).Or(uxClass)\n\t\t\t\t\t\t\t.Or(uxInnerClass)\n\t\t\t\t\t\t\t.Select(uxAttrName => uxAttrName + \" (\" + name + \")\").Or(name)),\n\t\t\t\t\tstring.Empty);\n\n\t\t\t\t_scopeIntoClassCommand = Command.Create(\n\t\t\t\t\tElementSwitch(\n\t\t\t\t\t\tel => elUxClass\n\t\t\t\t\t\t\t.CombineLatest(_depth, (uxClass, depth) => uxClass.Where(_ => depth > 0) /* disallow scope into for root */)\n\t\t\t\t\t\t\t.SelectPerElement(_ => (Action) (() => _tree._context.PushScope(el, el)))));\n\n\t\t\t\t_expandToggleCommand = Command.Create(\n\t\t\t\t\tElementSwitch(\n\t\t\t\t\t\tel => _expandToggleEnabled.Select(\n\t\t\t\t\t\t\tcanExpand => canExpand\n\t\t\t\t\t\t\t\t? Optional.Some(\n\t\t\t\t\t\t\t\t\t(Action) (() =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (_isDescendantSelected)\n\t\t\t\t\t\t\t\t\t\t\t_tree._context.Select(el);\n\t\t\t\t\t\t\t\t\t\t_tree.SetElementExpanded(el, !_isExpanded.Value);\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t: Optional.None()),\n\t\t\t\t\t\tOptional.None<Action>()));\n\n\t\t\t\t_isFaded = _tree.HighlightSelectedElement.CombineLatest(\n\t\t\t\t\t_isSelected,\n\t\t\t\t\t_isAncestorSelected,\n\t\t\t\t\t(highlightSelectedElement, isSelected, isAncestorSelected) =>\n\t\t\t\t\t\thighlightSelectedElement && !(isSelected | isAncestorSelected));\n\t\t\t}\n\n\t\t\tpublic Optional<ILiveElement> Element\n\t\t\t{\n\t\t\t\tget { return _element.Value; }\n\t\t\t}\n\n\n\t\t\tpublic void DragEnter(DropPosition position)\n\t\t\t{\n\t\t\t\t_tree._pendingDrop.OnNext(new PendingDrop(_rowOffset.Value, position, _depth.Value));\n\t\t\t}\n\n\t\t\tpublic void DragExit()\n\t\t\t{\n\t\t\t\t_tree._pendingDrop.OnNext(Optional.None());\n\t\t\t}\n\n\t\t\tpublic bool CanDrop(DropPosition position, object dragged)\n\t\t\t{\n\t\t\t\treturn _element.Value.Select(el => GetDropAction(el, position, dragged).HasValue).Or(false);\n\t\t\t}\n\n\t\t\tpublic void Drop(DropPosition position, object dragged)\n\t\t\t{\n\t\t\t\t_element.Value.Do(element => GetDropAction(element, position, dragged).Do(dropAction => dropAction()));\n\t\t\t\tDragExit();\n\t\t\t}\n\n\t\t\tpublic void Update(\n\t\t\t\tILiveElement element,\n\t\t\t\tint depth,\n\t\t\t\tint rowOffset,\n\t\t\t\tint expandedDescendantCount,\n\t\t\t\tbool expandToggleEnabled,\n\t\t\t\tbool isExpanded,\n\t\t\t\tbool isSelected,\n\t\t\t\tbool isAncestorSelected,\n\t\t\t\tbool isDescendantSelected)\n\t\t\t{\n\t\t\t\t_element.OnNextDistinct(Optional.Some(element));\n\t\t\t\t_rowOffset.OnNextDistinct(rowOffset);\n\t\t\t\t_expandedDescendantCount.OnNextDistinct(expandedDescendantCount);\n\t\t\t\t_depth.OnNextDistinct(depth);\n\t\t\t\t_isExpanded.OnNextDistinct(isExpanded);\n\t\t\t\t_expandToggleEnabled.OnNextDistinct(expandToggleEnabled);\n\t\t\t\t_isSelected.OnNextDistinct(isSelected);\n\t\t\t\t_isAncestorSelected.OnNextDistinct(isAncestorSelected);\n\t\t\t\t_isDescendantSelected = isDescendantSelected;\n\t\t\t}\n\n\t\t\tpublic void Detach()\n\t\t\t{\n\t\t\t\t_element.OnNextDistinct(Optional.None<ILiveElement>());\n\t\t\t\t// Hide away outside visible area\n\t\t\t\t_rowOffset.OnNextDistinct(-10);\n\t\t\t\t_expandedDescendantCount.OnNextDistinct(0);\n\t\t\t}\n\n\t\t\tIObservable<T> ElementSwitch<T>(Func<ILiveElement, IObservable<T>> selector, T defaultValue)\n\t\t\t{\n\t\t\t\treturn _element.Switch(y => y.Select(selector).FirstOr(Observable.Return(defaultValue)));\n\t\t\t}\n\n\t\t\tIObservable<T> ElementSelect<T>(Func<ILiveElement, T> selector, T defaultValue)\n\t\t\t{\n\t\t\t\treturn _element.Select(el => el.Select(selector).Or(defaultValue));\n\t\t\t}\n\n\t\t\tIObservable<Optional<T>> ElementSwitch<T>(Func<ILiveElement, IObservable<Optional<T>>> selector)\n\t\t\t{\n\t\t\t\treturn _element.Switch(el => el.Select(selector).Or(Observable.Return(Optional.None<T>())));\n\t\t\t}\n\n\t\t\tOptional<Action> GetDropAction(ILiveElement thisElement, DropPosition position, object dragged)\n\t\t\t{\n\t\t\t\tvar draggedElement = dragged as ILiveElement;\n\t\t\t\tvar sourceFragment = dragged as SourceFragment;\n\t\t\t\tvar bytes = dragged as byte[];\n\n\t\t\t\tFunc<SourceFragment> cut;\n\t\t\t\tif (draggedElement != null)\n\t\t\t\t{\n\t\t\t\t\tvar node = thisElement;\n\t\t\t\t\twhile (node != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (node.Equals(draggedElement))\n\t\t\t\t\t\t\treturn Optional.None();\n\t\t\t\t\t\tnode = node.Parent as ILiveElement;\n\t\t\t\t\t}\n\n\t\t\t\t\tcut = () => draggedElement.Cut().Result;\n\t\t\t\t}\n\t\t\t\telse if (bytes != null)\n\t\t\t\t{\n\t\t\t\t\tcut = () => SourceFragment.FromBytes(bytes);\n\t\t\t\t}\n\t\t\t\telse if (sourceFragment != null)\n\t\t\t\t{\n\t\t\t\t\tcut = () => sourceFragment;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn Optional.None();\n\t\t\t\t}\n\n\t\t\t\tswitch (position)\n\t\t\t\t{\n\t\t\t\t\tcase DropPosition.Inside:\n\t\t\t\t\t\tif (!_isExpanded.Value)\n\t\t\t\t\t\t\treturn (Action) (\n\t\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar src = cut();\n\t\t\t\t\t\t\t\t\tvar element = thisElement.Paste(src);\n\t\t\t\t\t\t\t\t\t_tree._context.Select(element);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DropPosition.After:\n\t\t\t\t\tcase DropPosition.Before:\n\t\t\t\t\t\tif (_depth.Value > 0)\n\t\t\t\t\t\t\treturn (Action) (() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar src = cut();\n\t\t\t\t\t\t\t\tvar element = position == DropPosition.Before ? thisElement.PasteBefore(src) : thisElement.PasteAfter(src);\n\t\t\t\t\t\t\t\t_tree._context.Select(element);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\n\t\t\t#region ITreeRowViewModel implementation\n\n\t\t\tpublic IObservable<int> Depth { get { return _depth; } }\n\n\t\t\tpublic IObservable<int> ExpandedDescendantCount { get { return _expandedDescendantCount; } }\n\n\t\t\tpublic IObservable<bool> CanExpand { get { return _expandToggleEnabled; } }\n\t\t\tpublic IObservable<bool> IsExpanded { get { return _isExpanded; } }\n\t\t\tpublic IObservable<bool> IsSelected { get { return _isSelected; } }\n\t\t\tpublic Command ScopeIntoClassCommand { get { return _scopeIntoClassCommand; } }\n\t\t\tpublic IObservable<bool> IsAncestorSelected { get { return _isAncestorSelected; } }\n\t\t\tpublic IObservable<string> ElementName { get { return _iconName; } }\n\t\t\tpublic IObservable<string> HeaderText { get { return _headerText; } }\n\t\t\tpublic IObservable<int> RowOffset { get { return _rowOffset; } }\n\t\t\tpublic Command ExpandToggleCommand { get { return _expandToggleCommand; } }\n\t\t\tpublic Command SelectCommand { get { return _selectCommand; } }\n\t\t\tIObservable<bool> ITreeRowViewModel.IsFaded { get { return _isFaded; } }\n\n\t\t\tpublic Command EnterHoverCommand\n\t\t\t{\n\t\t\t\tget { return Command.Create(_element.SelectPerElement(el => (Action) (() => _tree._context.Preview(el)))); }\n\t\t\t}\n\n\t\t\tpublic Command ExitHoverCommand\n\t\t\t{\n\t\t\t\tget { return Command.Enabled(() => _tree._context.Preview(Fuse.Element.Empty)); }\n\t\t\t}\n\n\t\t\tpublic IObservable<object> DraggedObject\n\t\t\t{\n\t\t\t\tget { return _element.Select(el => el.FirstOrDefault()); }\n\t\t\t}\n\n\t\t\tpublic Menu ContextMenu\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn _tree._elementMenuFactory(_element.Select(el => el.FirstOr(Fuse.Element.Empty)).Switch());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Hierarchy/TreeViewModel.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Runtime.CompilerServices;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Hierarchy\n{\n\tpublic partial class TreeViewModel : ITreeViewModel\n\t{\n\t\treadonly IObservable<IEnumerable<ITreeRowViewModel>> _visibleRows;\n\t\treadonly IObservable<int> _totalRowCount;\n\n\t\treadonly IContext _context;\n\t\treadonly IObservable<bool> _highlightSelectedElement;\n\n\t\treadonly BehaviorSubject<int> _visibleRowCount = new BehaviorSubject<int>(1);\n\t\treadonly BehaviorSubject<int> _visibleRowOffset = new BehaviorSubject<int>(0);\n\t\treadonly Subject<int> _scrollTarget = new Subject<int>();\n\t\treadonly Func<IElement, Menu> _elementMenuFactory;\n\n\t\t// Using a ConditionalWeakTable for expand state. It's a bit dirty, but right now tracking aliveness of elements\n\t\t// is not trivial. That will hopefully be fixed at a later point, however this solution works and we have a test.\n\t\tclass ElementExpandState { public bool IsExpanded { get; set; } }\n\t\treadonly ConditionalWeakTable<ILiveElement, ElementExpandState> _expandMap = new ConditionalWeakTable<ILiveElement, ElementExpandState>();\n\n\t\treadonly BehaviorSubject<Unit> _expandToggled =\n\t\t\tnew BehaviorSubject<Unit>(Unit.Default);\n\n\t\treadonly BehaviorSubject<Optional<PendingDrop>> _pendingDrop =\n\t\t\tnew BehaviorSubject<Optional<PendingDrop>>(Optional.None<PendingDrop>());\n\n\t\treadonly Command _navigateUpCommand;\n\t\treadonly Command _navigateDownCommand;\n\n\t\tpublic TreeViewModel(\n\t\t\tIContext context,\n\t\t\tIObservable<bool> highlightSelectedElement,\n\t\t\tFunc<IElement, Menu> elementMenuFactory)\n\t\t{\n\t\t\t_elementMenuFactory = elementMenuFactory;\n\t\t\t_context = context;\n\t\t\t_highlightSelectedElement = highlightSelectedElement.Replay(1).RefCount();\n\n\t\t\tvar scopeElement = context.CurrentScope.LiveElement.Select(\n\t\t\t\tx => x.Select(\n\t\t\t\t\t\tel => el.Changed.StartWith(Unit.Default).Select(_ => Optional.Some(el)))\n\t\t\t\t\t.Or(Observable.Return(Optional.None<ILiveElement>())));\n\n\t\t\tvar moveToSelectedElement = false;\n\n\t\t\tvar inputs = scopeElement\n\t\t\t\t.Switch()\n\t\t\t\t.CombineLatest(\n\t\t\t\t\t_visibleRowCount.DistinctUntilChanged(),\n\t\t\t\t\t_visibleRowOffset.DistinctUntilChanged(),\n\t\t\t\t\t_expandToggled,\n\t\t\t\t\tcontext.CurrentSelection.LiveElement.Do(el => moveToSelectedElement = el.HasValue),\n\t\t\t\t\t(element, visibleRowCount, visibleRowOffset, expanded, selectedElement) =>\n\t\t\t\t\t\tnew { element, visibleRowCount, visibleRowOffset, expanded, selectedElement })\n\t\t\t\t.CombineLatest(\n\t\t\t\t\tObservable.Return<Optional<ILiveElement>>(Optional.None()),\n\t\t\t\t\t(x, previewElement) => new\n\t\t\t\t\t{\n\t\t\t\t\t\tx.element,\n\t\t\t\t\t\tx.visibleRowCount,\n\t\t\t\t\t\tx.visibleRowOffset,\n\t\t\t\t\t\tx.expanded,\n\t\t\t\t\t\tx.selectedElement,\n\t\t\t\t\t\tpreviewElement\n\t\t\t\t\t});\n\n\t\t\tvar state =\n\t\t\t\tinputs\n\t\t\t\t\t.Scan(\n\t\t\t\t\t\tnew State(this),\n\t\t\t\t\t\t(s, x) => s.Update(x.element, x.visibleRowCount, x.visibleRowOffset, x.selectedElement, x.previewElement))\n\t\t\t\t\t.Do(\n\t\t\t\t\t\tnextState =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (moveToSelectedElement)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmoveToSelectedElement = false;\n\t\t\t\t\t\t\t\tif (nextState.SelectedElementIsOutsideVisibleRange)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t_scrollTarget.OnNext(nextState.SelectedElementRowOffset.Value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t.Replay(1)\n\t\t\t\t\t.RefCount();\n\n\t\t\t_visibleRows = state.Select(x => x.VisibleRows).DistinctUntilChanged();\n\t\t\t_totalRowCount = state.Select(x => x.TotalRowCount).DistinctUntilChanged();\n\n\t\t\t_navigateUpCommand = Command.Create(\n\t\t\t\tstate.Select(x => x.ElementBeforeSelected.Select(el => (Action) (() => _context.Select(el)))));\n\t\t\t_navigateDownCommand = Command.Create(\n\t\t\t\tstate.Select(x => x.ElementAfterSelected.Select(el => (Action) (() => _context.Select(el)))));\n\t\t}\n\n\t\tvoid SetElementExpanded(ILiveElement element, bool expand)\n\t\t{\n\t\t\tvar expandState = _expandMap.GetOrCreateValue(element);\n\t\t\texpandState.IsExpanded = expand;\n\t\t\t_expandToggled.OnNext(Unit.Default);\n\t\t}\n\n\t\tbool GetElementExpanded(ILiveElement element, bool fallback)\n\t\t{\n\t\t\tElementExpandState expandState;\n\t\t\tif (_expandMap.TryGetValue(element, out expandState))\n\t\t\t\treturn expandState.IsExpanded;\n\n\t\t\treturn fallback;\n\t\t}\n\n\t\tpublic int VisibleRowCount\n\t\t{\n\t\t\tget { return _visibleRowCount.Value; }\n\t\t\tset { _visibleRowCount.OnNextDistinct(value); }\n\t\t}\n\n\t\tpublic int VisibleRowOffset\n\t\t{\n\t\t\tget { return _visibleRowOffset.Value; }\n\t\t\tset { _visibleRowOffset.OnNextDistinct(value); }\n\t\t}\n\n\t\tpublic IObservable<int> ScrollTarget\n\t\t{\n\t\t\tget { return _scrollTarget; }\n\t\t}\n\n\t\tpublic IObservable<int> TotalRowCount\n\t\t{\n\t\t\tget { return _totalRowCount; }\n\t\t}\n\n\t\tpublic IObservable<IEnumerable<ITreeRowViewModel>> VisibleRows\n\t\t{\n\t\t\tget { return _visibleRows; }\n\t\t}\n\n\t\tpublic Command PopScopeCommand\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Command.Create(\n\t\t\t\t\t_context.PreviousScope.IsEmpty.Select(\n\t\t\t\t\t\tisEmpty => isEmpty ? Optional.None<Action>() : Optional.Some((Action) (() => _context.PopScope()))));\n\t\t\t}\n\t\t}\n\n\t\tpublic IObservable<string> PopScopeLabel\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _context.PreviousScope.UxClass().Or(_context.PreviousScope.Name)\n\t\t\t\t\t.Select(name => \"Return to \\\"\" + name + \"\\\"\");\n\t\t\t}\n\t\t}\n\n\t\tpublic IObservable<bool> HighlightSelectedElement\n\t\t{\n\t\t\tget { return _highlightSelectedElement; }\n\t\t}\n\n\t\tpublic IObservable<Optional<PendingDrop>> PendingDrop\n\t\t{\n\t\t\tget { return _pendingDrop; }\n\t\t}\n\n\t\tpublic Command NavigateUpCommand\n\t\t{\n\t\t\tget { return _navigateUpCommand; }\n\t\t}\n\n\t\tpublic Command NavigateDownCommand\n\t\t{\n\t\t\tget { return _navigateDownCommand; }\n\t\t}\n\n\t\tclass State\n\t\t{\n\t\t\treadonly TreeViewModel _tree;\n\n\t\t\treadonly int _totalRowCount;\n\t\t\treadonly Func<IImmutableList<RowModel>, IImmutableList<RowModel>> _applyFunc;\n\t\t\treadonly Optional<int> _selectedElementRowOffset;\n\n\t\t\tpublic Optional<int> SelectedElementRowOffset\n\t\t\t{\n\t\t\t\tget { return _selectedElementRowOffset; }\n\t\t\t}\n\n\t\t\tpublic Optional<ILiveElement> ElementAfterSelected\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn _selectedElementRowOffset.Select(sel => _allExpandedElements.ElementAtOrDefault(sel + 1)).FirstOrNone();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Optional<ILiveElement> ElementBeforeSelected\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn _selectedElementRowOffset.Select(sel => _allExpandedElements.ElementAtOrDefault(sel - 1)).FirstOrNone();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treadonly int _visibleRowOffset;\n\t\t\treadonly int _visibleRowCount;\n\t\t\treadonly IList<ILiveElement> _allExpandedElements;\n\t\t\treadonly IImmutableList<RowModel> _visibleRows;\n\n\t\t\tpublic int TotalRowCount\n\t\t\t{\n\t\t\t\tget { return _totalRowCount; }\n\t\t\t}\n\n\t\t\tpublic IImmutableList<RowModel> VisibleRows\n\t\t\t{\n\t\t\t\tget { return _visibleRows; }\n\t\t\t}\n\n\t\t\tpublic bool SelectedElementIsOutsideVisibleRange\n\t\t\t{\n\t\t\t\tget\n\t\t\t\t{\n\t\t\t\t\treturn _selectedElementRowOffset\n\t\t\t\t\t\t.Select(sel => sel < _visibleRowOffset || sel >= (_visibleRowOffset + _visibleRowCount - 1)).Or(false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic State(TreeViewModel tree) : this(\n\t\t\t\ttree,\n\t\t\t\tImmutableList.Create<RowModel>(),\n\t\t\t\t0,\n\t\t\t\tx => x,\n\t\t\t\tOptional.None(),\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\tnew ILiveElement[] { }) { }\n\n\n\t\t\tState(\n\t\t\t\tTreeViewModel tree,\n\t\t\t\tIImmutableList<RowModel> visibleRows,\n\t\t\t\tint totalRowCount,\n\t\t\t\tFunc<IImmutableList<RowModel>, IImmutableList<RowModel>> applyFunc,\n\t\t\t\tOptional<int> selectedElementRowOffset,\n\t\t\t\tint visibleRowOffset,\n\t\t\t\tint visibleRowCount,\n\t\t\t\tIList<ILiveElement> allExpandedElements)\n\t\t\t{\n\t\t\t\t_tree = tree;\n\t\t\t\t_visibleRows = visibleRows;\n\t\t\t\t_totalRowCount = totalRowCount;\n\t\t\t\t_applyFunc = applyFunc;\n\t\t\t\t_selectedElementRowOffset = selectedElementRowOffset;\n\t\t\t\t_visibleRowOffset = visibleRowOffset;\n\t\t\t\t_visibleRowCount = visibleRowCount;\n\t\t\t\t_allExpandedElements = allExpandedElements;\n\t\t\t}\n\n\t\t\tpublic State Update(\n\t\t\t\tOptional<ILiveElement> root,\n\t\t\t\tint visibleRowCount,\n\t\t\t\tint visibleRowOffset,\n\t\t\t\tOptional<ILiveElement> selectedElement,\n\t\t\t\tOptional<ILiveElement> previewElement)\n\t\t\t{\n\t\t\t\treturn root.Select(\n\t\t\t\t\t\tel =>\n\t\t\t\t\t\t\tScanElementTree(el, visibleRowCount, visibleRowOffset, selectedElement, previewElement)\n\t\t\t\t\t\t\t.ApplyUpdates())\n\t\t\t\t\t.Or(() => new State(_tree));\n\t\t\t}\n\n\t\t\tState ApplyUpdates()\n\t\t\t{\n\t\t\t\treturn new State(\n\t\t\t\t\t_tree,\n\t\t\t\t\t_applyFunc(VisibleRows),\n\t\t\t\t\tTotalRowCount,\n\t\t\t\t\tx => x,\n\t\t\t\t\t_selectedElementRowOffset,\n\t\t\t\t\t_visibleRowOffset,\n\t\t\t\t\t_visibleRowCount,\n\t\t\t\t\t_allExpandedElements);\n\t\t\t}\n\n\t\t\tState ScanElementTree(\n\t\t\t\tILiveElement root,\n\t\t\t\tint visibleRowCount,\n\t\t\t\tint visibleRowOffset,\n\t\t\t\tOptional<ILiveElement> selectedElement,\n\t\t\t\tOptional<ILiveElement> previewElement)\n\t\t\t{\n\t\t\t\t// Update visible rows  ake sure we have enough\n\t\t\t\tvar updates = new Dictionary<ILiveElement, Action<RowModel>>();\n\t\t\t\tvar allExpandedElements = new List<ILiveElement>(_allExpandedElements.Count * 2);\n\n\t\t\t\tvar selectedElementRowOffset = Optional.None<int>();\n\t\t\t\tvar previewElementRowOffset = Optional.None<int>();\n\n\t\t\t\tScanElementTree(\n\t\t\t\t\ttreeModel: this._tree,\n\t\t\t\t\telement: root,\n\t\t\t\t\tupdates: updates,\n\t\t\t\t\tallExpandedElements: allExpandedElements,\n\t\t\t\t\tvisibleRowCount: visibleRowCount,\n\t\t\t\t\tvisibleRowOffset: visibleRowOffset,\n\t\t\t\t\tdepth: 0,\n\t\t\t\t\tselectionPath: GetSelectionPath(root, selectedElement),\n\t\t\t\t\tpreviewElement: previewElement,\n\t\t\t\t\tisAncestorSelected: false,\n\t\t\t\t\tselectedElementRowOffset: ref selectedElementRowOffset,\n\t\t\t\t\tpreviewElementRowOffset: ref previewElementRowOffset);\n\n\t\t\t\treturn new State(\n\t\t\t\t\t_tree,\n\t\t\t\t\tVisibleRows,\n\t\t\t\t\tallExpandedElements.Count,\n\t\t\t\t\tvisibleRows => UpdateRows(visibleRows, updates),\n\t\t\t\t\tselectedElementRowOffset,\n\t\t\t\t\tvisibleRowOffset,\n\t\t\t\t\tvisibleRowCount,\n\t\t\t\t\tallExpandedElements);\n\t\t\t}\n\n\t\t\tIImmutableList<RowModel> UpdateRows(\n\t\t\t\tIImmutableList<RowModel> visibleRows,\n\t\t\t\tDictionary<ILiveElement, Action<RowModel>> updates)\n\t\t\t{\n\t\t\t\t//while (visibleRows.Count < 30)\n\t\t\t\t//\tvisibleRows = visibleRows.Add(new RowModel(_tree));\n\n\t\t\t\t// First update all rows currently attached to an element\n\t\t\t\tQueue<RowModel> freeRows = new Queue<RowModel>();\n\t\t\t\tforeach (var rowModel in visibleRows)\n\t\t\t\t{\n\t\t\t\t\tvar rowModelLocal = rowModel; // Shouldn't be necesarry in C# 5 or higher, doing it just to be safe.\n\t\t\t\t\trowModel.Element.Do(\n\t\t\t\t\t\tel =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAction<RowModel> update;\n\t\t\t\t\t\t\tif (updates.TryGetValue(el, out update))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tupdate(rowModelLocal);\n\t\t\t\t\t\t\t\tupdates.Remove(el);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfreeRows.Enqueue(rowModelLocal);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => { freeRows.Enqueue(rowModelLocal); });\n\t\t\t\t}\n\n\t\t\t\t// Now update all remaining elements\n\t\t\t\tforeach (var update in updates.Values)\n\t\t\t\t{\n\t\t\t\t\tRowModel rowModel;\n\t\t\t\t\tif (freeRows.Count > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\trowModel = freeRows.Dequeue();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\trowModel = new RowModel(_tree);\n\t\t\t\t\t\tvisibleRows = visibleRows.Add(rowModel);\n\t\t\t\t\t}\n\t\t\t\t\tupdate(rowModel);\n\t\t\t\t}\n\n\t\t\t\t// And then detach any leftover rows\n\t\t\t\t// (we don't free row templates if tree is resized smaller)\n\t\t\t\twhile (freeRows.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tfreeRows.Dequeue().Detach();\n\t\t\t\t}\n\t\t\t\treturn visibleRows;\n\t\t\t}\n\n\n\t\t\t/// <summary>\n\t\t\t/// Walks through all expanded elements of tree, adding actions to updates for pending row updates.\n\t\t\t/// Returns index of selected element\n\t\t\t/// </summary>\n\t\t\tstatic void ScanElementTree(\n\t\t\t\tTreeViewModel treeModel,\n\t\t\t\tILiveElement element,\n\t\t\t\tDictionary<ILiveElement, Action<RowModel>> updates,\n\t\t\t\tList<ILiveElement> allExpandedElements,\n\t\t\t\tint visibleRowCount,\n\t\t\t\tint visibleRowOffset,\n\t\t\t\tint depth,\n\t\t\t\tILiveElement[] selectionPath,\n\t\t\t\tOptional<ILiveElement> previewElement,\n\t\t\t\tbool isAncestorSelected,\n\t\t\t\tref Optional<int> selectedElementRowOffset,\n\t\t\t\tref Optional<int> previewElementRowOffset)\n\t\t\t{\n\t\t\t\tvar rowOffset = allExpandedElements.Count;\n\t\t\t\tallExpandedElements.Add(element);\n\n\t\t\t\t// A node with children can expand, unless it has a \"ux:Class\" attribute\n\t\t\t\tvar canExpand = CanExpand(element, depth);\n\n\t\t\t\t// We expand up to 2 levels by default\n\t\t\t\tvar expandByDefault = depth < 2;\n\n\t\t\t\t// Check if this element is an ancestor of selection\n\t\t\t\tvar isDescendantSelected = depth < (selectionPath.Length - 1) && selectionPath[depth].Equals(element);\n\n\t\t\t\t// This is the selected element when we're at the end of the selection path\n\t\t\t\tvar isSelected = depth == (selectionPath.Length - 1) && selectionPath[depth].Equals(element);\n\n\t\t\t\tvar isExpanded = canExpand && (isDescendantSelected || treeModel.GetElementExpanded(element, expandByDefault));\n\n\t\t\t\tif (previewElement.Select(pe => pe == element).Or(false))\n\t\t\t\t\tpreviewElementRowOffset = rowOffset;\n\n\t\t\t\tif (isSelected)\n\t\t\t\t{\n\t\t\t\t\tselectedElementRowOffset = rowOffset;\n\t\t\t\t}\n\n\t\t\t\tvar children = element.Children.Value;\n\n\n\t\t\t\tif (isExpanded)\n\t\t\t\t{\n\t\t\t\t\tforeach (var child in children)\n\t\t\t\t\t{\n\t\t\t\t\t\tScanElementTree(\n\t\t\t\t\t\t\ttreeModel: treeModel,\n\t\t\t\t\t\t\telement: child,\n\t\t\t\t\t\t\tupdates: updates,\n\t\t\t\t\t\t\tallExpandedElements: allExpandedElements,\n\t\t\t\t\t\t\tvisibleRowCount: visibleRowCount,\n\t\t\t\t\t\t\tvisibleRowOffset: visibleRowOffset,\n\t\t\t\t\t\t\tdepth: depth + 1,\n\t\t\t\t\t\t\tselectionPath: selectionPath,\n\t\t\t\t\t\t\tpreviewElement: previewElement,\n\t\t\t\t\t\t\tisAncestorSelected: isSelected | isAncestorSelected,\n\t\t\t\t\t\t\tselectedElementRowOffset: ref selectedElementRowOffset,\n\t\t\t\t\t\t\tpreviewElementRowOffset: ref previewElementRowOffset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar lastDescendantRowOffset = allExpandedElements.Count - 1;\n\n\t\t\t\tif ((rowOffset >= visibleRowOffset && rowOffset < visibleRowOffset + visibleRowCount) ||\n\t\t\t\t\t(rowOffset < visibleRowOffset && lastDescendantRowOffset >= visibleRowOffset))\n\t\t\t\t{\n\t\t\t\t\tupdates[element] = rowModel => rowModel.Update(\n\t\t\t\t\t\telement: element,\n\t\t\t\t\t\tdepth: depth,\n\t\t\t\t\t\trowOffset: rowOffset,\n\t\t\t\t\t\texpandedDescendantCount: lastDescendantRowOffset - rowOffset,\n\t\t\t\t\t\texpandToggleEnabled: depth > 0 && canExpand, // Don't allow collapse of root\n\t\t\t\t\t\tisExpanded: isExpanded,\n\t\t\t\t\t\tisSelected: isSelected,\n\t\t\t\t\t\tisAncestorSelected: isAncestorSelected,\n\t\t\t\t\t\tisDescendantSelected: isDescendantSelected);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatic bool CanExpand(ILiveElement element, int depth)\n\t\t\t{\n\t\t\t\treturn element.Children.Value.Any() && (depth == 0 || !element.UxClass().Value.HasValue);\n\t\t\t}\n\n\t\t\tstatic ILiveElement[] GetSelectionPath(ILiveElement root, Optional<ILiveElement> selectedElement)\n\t\t\t{\n\t\t\t\tif (!selectedElement.HasValue)\n\t\t\t\t\treturn new ILiveElement[] { };\n\n\t\t\t\t// First we count depth and see if selection is descendant of our root\n\t\t\t\tvar selected = selectedElement.Value;\n\t\t\t\tvar current = selected;\n\t\t\t\tint depth = 0;\n\t\t\t\twhile (current != root)\n\t\t\t\t{\n\t\t\t\t\tvar liveParent = current.Parent as ILiveElement;\n\t\t\t\t\tif (liveParent == null)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new ILiveElement[] { };\n\t\t\t\t\t}\n\t\t\t\t\tdepth++;\n\t\t\t\t\tcurrent = liveParent;\n\t\t\t\t}\n\n\t\t\t\t// Then we walk down again and build the selection array\n\t\t\t\tvar selectionPath = new ILiveElement[depth + 1];\n\t\t\t\tcurrent = selected;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tselectionPath[depth] = current;\n\t\t\t\t\tcurrent = current.Parent as ILiveElement;\n\t\t\t\t} while (depth-- > 0);\n\n\t\t\t\treturn selectionPath;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/AttributeIntercepter.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Inspector\n{\n\tpublic class AttributeIntercepter : IEditorFactory\n\t{\n\t\tclass AttributeRecord\n\t\t{\n\t\t\tpublic IObservable<bool> HasValue;\n\t\t\tpublic IObservable<bool> IsReadOnly;\n\t\t}\n\n\t\treadonly BehaviorSubject<IImmutableSet<AttributeRecord>> _attributes = new BehaviorSubject<IImmutableSet<AttributeRecord>>(ImmutableHashSet<AttributeRecord>.Empty);\n\n\t\treadonly IEditorFactory _editorFactory;\n\n\t\tpublic AttributeIntercepter(IEditorFactory editorFactory)\n\t\t{\n\t\t\t_editorFactory = editorFactory;\n\n\t\t\tAllReadOnly = _attributes\n\t\t\t\t.Select(attributes =>\n\t\t\t\t\tattributes\n\t\t\t\t\t\t.Select(a => a.IsReadOnly)\n\t\t\t\t\t\t.Aggregate(Observable.Return(true), ObservableBooleanExtensions.And))\n\t\t\t\t.Switch()\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\tAnyHasValue = _attributes\n\t\t\t\t.Select(attributes =>\n\t\t\t\t\tattributes\n\t\t\t\t\t\t.Select(a => a.HasValue)\n\t\t\t\t\t\t.Aggregate(Observable.Return(false), ObservableBooleanExtensions.Or))\n\t\t\t\t.Switch()\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\n\t\tpublic IObservable<bool> AllReadOnly { get; private set; }\n\t\tpublic IObservable<bool> AnyHasValue { get; private set; }\n\n\t\tpublic IControl ElementList(Text name, IElement parent, SourceFragment prototype, Func<IElement, IControl> itemFactory)\n\t\t{\n\t\t\treturn _editorFactory.ElementList(name, parent, prototype, itemFactory);\n\t\t}\n\n\t\tpublic IControl Label<T>(Text name, params IAttribute<T>[] properties)\n\t\t{\n\t\t\tvar control = _editorFactory.Label(name, properties);\n\n\t\t\tforeach (var a in properties)\n\t\t\t\tIntercept(a, control);\n\n\t\t\treturn control;\n\t\t}\n\n\t\tpublic IControl Label(Text name, IAttribute<Points> attribute)\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.Label(name, attribute));\n\t\t}\n\n\t\tpublic IControl Label(Text name, IAttribute<UxSize> attribute)\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.Label(name, attribute));\n\t\t}\n\n\t\tpublic IEditorControl Field<T>(IAttribute<T> attribute, Text placeholderText = default(Text), Text toolTip = default(Text), bool deferEdit = false)\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.Field(attribute, placeholderText, toolTip, deferEdit));\n\t\t}\n\n\t\tpublic IControl Label(Text name, IProperty<Optional<string>> attributeData)\n\t\t{\n\t\t\treturn Intercept(attributeData, _editorFactory.Label(name, attributeData));\n\t\t}\n\n\t\tpublic IEditorControl Slider(IAttribute<double> attribute, double min, double max)\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.Slider(attribute, min, max));\n\t\t}\n\n\t\tpublic IEditorControl FilePath(IAttribute<string> attribute, IObservable<AbsoluteDirectoryPath> projectRoot, FileFilter[] fileFilters, Text placeholderText = default(Text), Text toolTip = default(Text))\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.FilePath(attribute, projectRoot, fileFilters, placeholderText, toolTip));\n\t\t}\n\n\t\tpublic IEditorControl Switch(IAttribute<bool> attribute)\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.Switch(attribute));\n\t\t}\n\n\t\tpublic IEditorControl Color(IAttribute<Color> color)\n\t\t{\n\t\t\treturn Intercept(color, _editorFactory.Color(color));\n\t\t}\n\n\t\tpublic IEditorControl Dropdown<T>(IAttribute<T> attribute) where T : struct\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.Dropdown(attribute));\n\t\t}\n\n\t\tpublic IRadioButton<T> RadioButton<T>(IAttribute<T> attribute)\n\t\t{\n\t\t\tvar control = _editorFactory.RadioButton(attribute);\n\t\t\tIntercept(attribute, control.Control);\n\t\t\treturn control;\n\t\t}\n\n\t\tpublic IControl ExpressionButton<T>(IAttribute<T> attribute)\n\t\t{\n\t\t\treturn Intercept(attribute, _editorFactory.ExpressionButton(attribute));\n\t\t}\n\n\t\tpublic TResult Intercept<T, TResult>(IAttribute<T> attribute, TResult control)\n\t\t\twhere TResult : IControl\n\t\t{\n\t\t\treturn Keep(control, new AttributeRecord\n\t\t\t{\n\t\t\t\tHasValue = attribute.HasLocalValue(),\n\t\t\t\tIsReadOnly = attribute.IsReadOnly,\n\t\t\t});\n\t\t}\n\n\t\tpublic TResult Intercept<T, TResult>(IProperty<T> property, TResult control)\n\t\t\twhere TResult : IControl\n\t\t{\n\t\t\treturn Keep(control, new AttributeRecord\n\t\t\t{\n\t\t\t\tHasValue = Observable.Return(false),\n\t\t\t\tIsReadOnly = property.IsReadOnly,\n\t\t\t});\n\t\t}\n\n\t\tTResult Keep<TResult>(TResult control, AttributeRecord record)\n\t\t\twhere TResult : IControl\n\t\t{\n\t\t\tcontrol.IsRooted.Subscribe(rooted =>\n\t\t\t\t_attributes.OnNext(rooted\n\t\t\t\t\t? _attributes.Value.Add(record)\n\t\t\t\t\t: _attributes.Value.Remove(record)));\n\n\t\t\treturn control;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/CellLayout.cs",
    "content": "namespace Outracks.Fuse.Inspector\n{\n\tpublic static class CellLayout\n\t{\n\t\tpublic static readonly Points DefaultCellHeight = new Points(20);\n\n\t\tpublic static readonly Points FullCellWidth = new Points(113);\n\t\tpublic static readonly Points HalfCellWidth = new Points((113-7)/(2));\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Color.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tstatic class ColorEditor\n\t{\n\t\tpublic static IControl Create(IAttribute<Color> property, IEditorFactory editors)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Right(editors.ExpressionButton(property))\n\t\t\t\t.Fill(\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(CreateWell(property))\n\t\t\t\t\t.Left(Separator.Line(Theme.FieldStroke))\n\t\t\t\t\t.Fill(TextBox.Create(\n\t\t\t\t\t\t\tproperty.StringValue,\n\t\t\t\t\t\t\tforegroundColor: Theme.DefaultText)\n\t\t\t\t\t\t.WithPlaceholderText(property.HasLocalValue())\n\t\t\t\t\t\t.WithBackground(Theme.FieldBackground))\n\t\t\t\t\t.WithPadding(new Thickness<Points>(1))\n\t\t\t\t\t.WithOverlay(Shapes.Rectangle(Theme.FieldStroke))\n\t\t\t\t\t.WithWidth(CellLayout.FullCellWidth)\n\t\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight));\n\t\t}\n\n\t\tstatic IControl CreateWell(IAttribute<Color> color)\n\t\t{\n\t\t\tvar length = CellLayout.DefaultCellHeight - 2;\n\n\t\t\tvar diagonalBrush = color.IsReadOnly\n\t\t\t\t.Select(ro => ro ? Theme.FieldStroke.Brush : Color.FromRgb(0xDB6868))\n\t\t\t\t.Switch();\n\n\t\t\tvar diagonal = Shapes.Line(\n\t\t\t\tPoint.Create(new Points(0), new Points(length)),\n\t\t\t\tPoint.Create(new Points(length), new Points(0)),\n\t\t\t\tStroke.Create(1, diagonalBrush));\n\n\t\t\treturn CreateWell(color, color.HasLocalValue())\n\t\t\t\t.WithPadding(new Thickness<Points>(1))\n\t\t\t\t.WithBackground(diagonal.HideWhen(color.HasLocalValue()))\n\t\t\t\t.WithSize(new Size<Points>(length, length))\n\t\t\t\t.Center();\n\t\t}\n\n\t\tstatic IControl CreateWell(\n\t\t\tIProperty<Color> value = null,\n\t\t\tIObservable<bool> hasValue = null,\n\t\t\tStroke stroke = null)\n\t\t{\n\t\t\tvar color = value ?? Property.Create(Color.Transparent);\n\t\t\treturn Shapes\n\t\t\t\t.Rectangle(fill: hasValue\n\t\t\t\t\t.Select(hasSetValue => hasSetValue ? color.AsBrush() : Color.Transparent)\n\t\t\t\t\t.Switch())\n\t\t\t\t.OnMouse(released: color.IsReadOnly.Switch(\n\t\t\t\t\tisReadOnly =>\n\t\t\t\t\tisReadOnly\n\t\t\t\t\t? Command.Disabled\n\t\t\t\t\t: ColorPicker.Open(color)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Dropdown.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tpublic class DropdownEditor\n\t{\n\t\tpublic static IControl Create<T>(IAttribute<T> property, IEditorFactory editors)\n\t\t\twhere T : struct\n\t\t{\n\t\t\tvar objectProperty = property.Convert(t => (object)t, s => (s is T ? (T)s : default(T)));\n\t\t\tvar objectValues = Observable.Return(Enum.GetValues(typeof(T)).OfType<object>());\n\t\t\tvar placeholderText = property.Select(v => v.ToString()).AsText();\n\t\t\treturn Create(property, objectProperty, objectValues, editors, placeholderText);\n\t\t}\n\n\t\tpublic static IControl Create(\n\t\t\tIAttribute<string> property,\n\t\t\tIObservable<string[]> values,\n\t\t\tIEditorFactory editors,\n\t\t\tText placeholderText = default(Text))\n\t\t{\n\t\t\tvar objectProperty = property.Convert(p => (object) p, o => (o as string) ?? \"\");\n\t\t\tvar objectValues = (IObservable<IEnumerable<object>>)values;\n\t\t\treturn Create(property, objectProperty, objectValues, editors, placeholderText);\n\t\t}\n\n\t\tstatic IControl Create<T>(\n\t\t\tIAttribute<T> attribute,\n\t\t\tIProperty<object> objectValue,\n\t\t\tIObservable<IEnumerable<object>> objectValues,\n\t\t\tIEditorFactory editors,\n\t\t\tText placeholderText = default(Text))\n\t\t{\n\t\t\tvar stroke = Theme.FieldStroke;\n\t\t\tvar arrowBrush = attribute.IsReadOnly.Select(ro => ro ? Theme.FieldStroke.Brush : Theme.Link).Switch();\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Right(editors.ExpressionButton(attribute))\n\t\t\t\t.Fill(DropDown.Create(objectValue, objectValues, nativeLook: false)\n\t\t\t\t\t.WithOverlay(\n\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t.Right(Arrow\n\t\t\t\t\t\t\t\t.WithoutShaft(RectangleEdge.Bottom, SymbolSize.Small, arrowBrush)\n\t\t\t\t\t\t\t\t.Center().WithWidth(21)\n\t\t\t\t\t\t\t\t.WithBackground(Theme.PanelBackground))\n\t\t\t\t\t\t\t.Right(Separator.Line(stroke))\n\t\t\t\t\t\t\t.Fill(TextBox.Create(\n\t\t\t\t\t\t\t\t\tattribute.StringValue,\n\t\t\t\t\t\t\t\t\tforegroundColor: Theme.DefaultText)\n\t\t\t\t\t\t\t\t.WithPlaceholderText(attribute.HasLocalValue(), placeholderText)\n\t\t\t\t\t\t\t\t.WithBackground(Theme.FieldBackground))\n\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(1))\n\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: stroke)))\n\t\t\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight)\n\t\t\t\t\t\t.WithWidth(CellLayout.FullCellWidth));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/EditorControl.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tclass EditorControl<T> : IEditorControl\n\t{\n\t\treadonly IEditorFactory _editors;\n\t\treadonly IAttribute<T> _attribute;\n\t\treadonly IControl _control;\n\n\t\tpublic EditorControl(IEditorFactory editors, IAttribute<T> attribute, IControl control)\n\t\t{\n\t\t\t_editors = editors;\n\t\t\t_attribute = attribute;\n\t\t\t_control = control;\n\t\t}\n\n\t\tpublic Action<IMountLocation> Mount\n\t\t{\n\t\t\tget { return _control.Mount; }\n\t\t}\n\n\t\tpublic Size<IObservable<Points>> DesiredSize\n\t\t{\n\t\t\tget { return _control.DesiredSize; }\n\t\t}\n\n\t\tpublic object NativeHandle\n\t\t{\n\t\t\tget { return _control.NativeHandle; }\n\t\t}\n\n\t\tpublic IObservable<bool> IsRooted\n\t\t{\n\t\t\tget { return _control.IsRooted; }\n\t\t}\n\n\t\tpublic IControl WithLabelAbove(Text description)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t_editors.Label(description, _attribute).DockBottom().WithHeight(20),\n\t\t\t\t_control);\n\t\t}\n\t\tpublic IControl WithLabel(Text description)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Right(_control)\n\t\t\t\t.Fill(_editors.Label(description, _attribute));\n\t\t}\n\n\t\tpublic IControl WithIcon(Text tooltip, IControl icon)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Left(tooltip.IsDefault ? icon : icon.MakeHittable().Control) // The icon has to be hittable for tooltips to work\n\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t.Fill(_control.CenterVertically())\n\t\t\t\t.WithHeight(_control.DesiredSize.Height)\n\t\t\t\t.WithWidth(_control.DesiredSize.Width)\n\t\t\t\t.WithBackground(Color.AlmostTransparent)\n\t\t\t\t.SetToolTip(tooltip);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Expression.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tstatic class ExpressionEditor\n\t{\n\t\tpublic static IControl CreateButton<T>(IObservable<object> elementChanged, IAttribute<T> property, IPopover popover)\n\t\t{\n\t\t\treturn popover.CreatePopover(\n\t\t\t\t\tRectangleEdge.Bottom,\n\t\t\t\t\tcontent: state =>\n\t\t\t\t\t\tButton.Create(clicked: state.IsVisible.Toggle(), content: button =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar circleColor = Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\tbutton.IsHovered,\n\t\t\t\t\t\t\t\t\tstate.IsVisible,\n\t\t\t\t\t\t\t\t\t(hovering, visible) =>\n\t\t\t\t\t\t\t\t\t\tvisible\n\t\t\t\t\t\t\t\t\t\t\t? Theme.Link\n\t\t\t\t\t\t\t\t\t\t\t: (hovering ? Theme.Link : Theme.FieldFocusStroke.Brush))\n\t\t\t\t\t\t\t\t.Switch();\n\n\t\t\t\t\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\t\t\t\t\tEnumerable.Range(0, 3).Select(\n\t\t\t\t\t\t\t\t\t\ti => Shapes.Circle(fill: circleColor)\n\t\t\t\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(2, 2))\n\t\t\t\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(1))))\n\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(3));\n\t\t\t\t\t\t}),\n\t\t\t\t\tpopover: state =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar result = Layout.Dock()\n\t\t\t\t\t\t\t.Bottom(Button.Create(state.IsVisible.Update(false), bs =>\n\t\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t\t.Left(Icons.Confirm(Theme.Link).CenterVertically())\n\t\t\t\t\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t\t\t\t\t.Fill(Theme.Header(\"Done\"))\n\t\t\t\t\t\t\t\t\t.Center()\n\t\t\t\t\t\t\t\t\t.WithHeight(30)))\n\t\t\t\t\t\t\t.Bottom(Separator.Medium)\n\t\t\t\t\t\t\t.Top(Spacer.Medium)\n\t\t\t\t\t\t\t.Top(Label.Create(\n\t\t\t\t\t\t\t\ttext: \"Expression Editor\",\n\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Center,\n\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\tcolor: Theme.DefaultText))\n\t\t\t\t\t\t\t.Top(Spacer.Small)\n\t\t\t\t\t\t\t.Top(Label.Create(\n\t\t\t\t\t\t\t\ttext: \"You can write expressions here instead \\n of using an explicit value\",\n\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Center,\n\t\t\t\t\t\t\t\tfont: Theme.DescriptorFont,\n\t\t\t\t\t\t\t\tcolor: Theme.DescriptorText))\n\t\t\t\t\t\t\t.Top(Spacer.Medium)\n\t\t\t\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t\t\t.Bottom(Spacer.Medium)\n\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\t\tTextBox.Create(\n\t\t\t\t\t\t\t\t\ttext: property.StringValue.Deferred(),\n\t\t\t\t\t\t\t\t\tforegroundColor: Theme.DefaultText,\n\t\t\t\t\t\t\t\t\tdoWrap: true)\n\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(1))\n\t\t\t\t\t\t\t\t.WithBackground(Theme.FieldBackground)\n\t\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Theme.FieldStroke))\n\t\t\t\t\t\t\t\t.WithHeight(74))\n\t\t\t\t\t\t\t.WithWidth(279);\n\n\t\t\t\t\t\telementChanged.ConnectWhile(result.IsRooted).Subscribe(id => state.IsVisible.OnNext(false));\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t})\n\t\t\t\t.CenterVertically();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Factory.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tpublic class Factory : IEditorFactory\n\t{\n\t\treadonly IObservable<object> _elementChanged;\n\t\treadonly IPopover _popover;\n\t\tpublic Factory(IObservable<object> elementChanged, IPopover popover)\n\t\t{\n\t\t\t_elementChanged = elementChanged;\n\t\t\t_popover = popover;\n\t\t}\n\n\t\tpublic IControl ElementList(Text name, IElement parent, SourceFragment prototype, Func<IElement, IControl> itemFactory)\n\t\t{\n\t\t\treturn ListEditor.Create(parent, name, prototype, itemFactory);\n\t\t}\n\n\t\tpublic IControl Label<T>(Text name, params IAttribute<T>[] properties)\n\t\t{\n\t\t\treturn LabelEditor.Create(name, properties);\n\t\t}\n\n\t\tpublic IControl Label(Text name, IAttribute<Points> attribute)\n\t\t{\n\t\t\treturn LabelEditor.Create(name, attribute);\n\t\t}\n\n\t\tpublic IControl Label(Text name, IAttribute<UxSize> attribute)\n\t\t{\n\t\t\treturn LabelEditor.Create(name, attribute);\n\t\t}\n\n\t\tpublic IControl Label(Text name, IProperty<Optional<string>> attributeData)\n\t\t{\n\t\t\treturn LabelEditor.Create(name, attributeData.Select(e => e.HasValue), attributeData.IsReadOnly, Command.Enabled(() => attributeData.Write(Optional.None())));\n\t\t}\n\n\t\tpublic IEditorControl Field<T>(IAttribute<T> attribute, Text placeholderText = default(Text), Text toolTip = default(Text), bool deferEdit = false)\n\t\t{\n\t\t\treturn Wrap(attribute, FieldEditor.Create(this, attribute, placeholderText: placeholderText, toolTip: toolTip, deferEdit: deferEdit));\n\t\t}\n\n\t\tpublic IEditorControl Switch(IAttribute<bool> attribute)\n\t\t{\n\t\t\treturn Wrap(attribute, Layout.StackFromLeft(\n\t\t\t\tSwitchEditor.Create(attribute)\n\t\t\t\t\t.CenterVertically(),\n\t\t\t\tSpacer.Medim,\n\t\t\t\tExpressionButton(attribute).WithPadding(right: new Points(1))\n\t\t\t\t\t.CenterVertically()));\n\t\t}\n\n\t\tpublic IEditorControl Color(IAttribute<Color> color)\n\t\t{\n\t\t\treturn Wrap(color, ColorEditor.Create(color, this));\n\t\t}\n\t\tpublic IEditorControl Slider(IAttribute<double> attribute, double min, double max)\n\t\t{\n\t\t\treturn Wrap(attribute, SliderEditor.Create(attribute, min, max));\n\t\t}\n\n\t\tpublic IEditorControl FilePath(IAttribute<string> attribute, IObservable<AbsoluteDirectoryPath> projectRoot, FileFilter[] fileFilters, Text placeholderText = default(Text), Text toolTip = default(Text))\n\t\t{\n\t\t\treturn Wrap(attribute, FilePathEditor.Create(this, attribute, projectRoot, fileFilters, placeholderText: placeholderText, toolTip: toolTip));\n\t\t}\n\n\t\tpublic IEditorControl Dropdown<T>(IAttribute<T> attribute) where T : struct\n\t\t{\n\t\t\treturn Wrap(attribute, DropdownEditor.Create(attribute, this));\n\t\t}\n\n\t\tIEditorControl Wrap<T>(IAttribute<T> property, IControl control)\n\t\t{\n\t\t\treturn new EditorControl<T>(this, property, control);\n\t\t}\n\n\t\tpublic IRadioButton<T> RadioButton<T>(IAttribute<T> attribute)\n\t\t{\n\t\t\treturn new RadioButtonCellBuilder<T>(attribute, this);\n\t\t}\n\n\t\tpublic IControl ExpressionButton<T>(IAttribute<T> attribute)\n\t\t{\n\t\t\treturn ExpressionEditor.CreateButton(_elementChanged, attribute, _popover);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Field.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tstatic class FieldEditor\n\t{\n\t\tpublic static IControl Create<T>(\n\t\t\tIEditorFactory editors,\n\t\t\tIAttribute<T> property,\n\t\t\tOptional<Command> onFocused = default(Optional<Command>),\n\t\t\tText placeholderText = default(Text),\n\t\t\tText toolTip = default(Text),\n\t\t\tbool deferEdit = false)\n\t\t{\n\t\t\tvar stringValue = property.StringValue;\n\t\t\tvar hasValue = property.HasLocalValue();\n\n\t\t\tif (deferEdit)\n\t\t\t{\n\t\t\t\tstringValue = stringValue.Deferred();\n\t\t\t\thasValue = stringValue.Select(s => s != \"\");\n\t\t\t}\n\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Right(editors.ExpressionButton(property))\n\t\t\t\t.Fill(TextBox.Create(\n\t\t\t\t\t\tstringValue,\n\t\t\t\t\t\tonFocused: onFocused,\n\t\t\t\t\t\tforegroundColor: Theme.DefaultText)\n\t\t\t\t\t.WithPlaceholderText(hasValue, placeholderText)\n\t\t\t\t\t.SetToolTip(toolTip).WithBorderAndSize())\n\t\t\t\t;\n\t\t}\n\n\t\tpublic static IControl Create(\n\t\t\tIEditorFactory editors,\n\t\t\tIProperty<Optional<string>> property,\n\t\t\tText placeholderText = default(Text),\n\t\t\tbool deferEdit = false)\n\t\t{\n\t\t\tproperty = deferEdit ? property.Deferred() : property;\n\n\t\t\tvar prop = property.OrEmpty();\n\t\t\treturn TextBox.Create(prop, foregroundColor: Theme.DefaultText)\n\t\t\t\t.WithPlaceholderText(property.Select(d => d.HasValue), placeholderText)\n\t\t\t\t.WithBorderAndSize().CenterVertically();\n\t\t}\n\n\t\tpublic static IControl WithPlaceholderText(this IControl control, IObservable<bool> hasValue, Text placeholderText = default(Text))\n\t\t{\n\t\t\tif (!placeholderText.IsDefault)\n\t\t\t\tcontrol = control.WithOverlay(\n\t\t\t\t\tLabel.Create(placeholderText.AsText(), Theme.DefaultFont, color: Theme.DescriptorText)\n\t\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t\t.HideWhen(hasValue)\n\t\t\t\t\t\t.WithPadding(left: new Points(3)));\n\n\t\t\treturn control.WithPadding(left: new Points(3));\n\t\t}\n\n\t\tstatic IControl WithBorderAndSize(this IControl control)\n\t\t{\n\t\t\treturn control\n\t\t\t\t.WithPadding(new Thickness<Points>(1))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Theme.FieldStroke))\n\t\t\t\t.WithBackground(Shapes.Rectangle(fill: Theme.FieldBackground))\n\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight)\n\t\t\t\t.WithWidth(CellLayout.FullCellWidth);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/FilePathEditor.cs",
    "content": "﻿using System;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tpublic static class FilePathEditor\n\t{\n\t\tpublic static IControl Create(\n\t\t\tIEditorFactory editors,\n\t\t\tIAttribute<string> property,\n\t\t\tIObservable<AbsoluteDirectoryPath> projectRoot,\n\t\t\tFileFilter[] fileFilters,\n\t\t\tText placeholderText = default(Text),\n\t\t\tText toolTip = default(Text),\n\t\t\tText dialogCaption = default(Text))\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Right(editors.ExpressionButton(property))\n\t\t\t\t.Fill(FilePathControl.Create(property.StringValue, projectRoot, fileFilters, placeholderText, toolTip, dialogCaption));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Label.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tclass LabelEditor\n\t{\n\t\tpublic static IControl Create<T>(Text text, params IAttribute<T>[] properties)\n\t\t{\n\t\t\tvar hasValue = Observable.Return(false);\n\t\t\tvar isReadOnly = Observable.Return(false);\n\t\t\tforeach (var property in properties)\n\t\t\t{\n\t\t\t\thasValue = hasValue.Or(property.HasLocalValue());\n\t\t\t\tisReadOnly = isReadOnly.Or(property.IsReadOnly);\n\t\t\t}\n\t\t\treturn Create(text, hasValue, isReadOnly);\n\t\t}\n\n\t\tpublic static IControl Create(Text text, IObservable<bool> hasValue, IObservable<bool> isReadOnly, bool isHittable = false)\n\t\t{\n\t\t\treturn Label\n\t\t\t\t.Create(\n\t\t\t\t\ttext: text,\n\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\ttextAlignment: TextAlignment.Left,\n\t\t\t\t\tcolor: isReadOnly.Select(r => !r ? Theme.DefaultText : Theme.DisabledText).Switch())\n\t\t\t\t.CenterVertically()\n\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight);\n\t\t}\n\n\t\tpublic static IControl Create<T>(Text text, IAttribute<T> property, IObservable<bool> hasValue = null)\n\t\t{\n\t\t\treturn Create(text, hasValue ?? property.HasLocalValue(), property.IsReadOnly, property.Clear, Property.Default<Points>());\n\t\t}\n\n\t\tpublic static IControl Create(Text text, IAttribute<Points> property, IObservable<bool> hasValue = null)\n\t\t{\n\t\t\treturn Create(text, hasValue ?? property.HasLocalValue(), property.IsReadOnly, property.Clear, property);\n\t\t}\n\n\t\tpublic static IControl Create(Text text, IAttribute<UxSize> property)\n\t\t{\n\t\t\tvar propertyInPoints = property.Focus<UxSize, Points>(s =>\n\t\t\t\t\ts.PointsValue.Select(p => p.ToDouble()).Or(() =>\n\t\t\t\t\ts.PixelsValue.Select(p => p.ToDouble()).Or(() =>\n\t\t\t\t\ts.PercentagesValue.Value.ToDouble())),\n\t\t\t\t(s, vv) =>\n\t\t\t\t\ts.PointsValue.HasValue\n\t\t\t\t\t\t? UxSize.Points(vv.ToDouble())\n\t\t\t\t\t\t: s.PixelsValue.HasValue\n\t\t\t\t\t\t\t? UxSize.Pixels(vv.ToDouble())\n\t\t\t\t\t\t\t: UxSize.Percentages(vv.ToDouble()),\n\t\t\t\tUxSizeParser.TryParsePoints,\n\t\t\t\tUxSizeParser.Serialize,\n\t\t\t\t0.0);\n\n\t\t\treturn Create(text, property.HasLocalValue(), property.IsReadOnly, property.Clear, propertyInPoints);\n\t\t}\n\n\t\tpublic static IControl Create(\n\t\t\tText text,\n\t\t\tIObservable<bool> hasValue,\n\t\t\tIObservable<bool> isDisabled,\n\t\t\tCommand clear,\n\t\t\tIProperty<Points> scrub = null)\n\t\t{\n\t\t\tvar label = Label\n\t\t\t\t.Create(\n\t\t\t\t\ttext: text,\n\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\ttextAlignment: TextAlignment.Left,\n\t\t\t\t\tcolor: isDisabled.Select(r => !r ? Theme.DefaultText : Theme.DisabledText).Switch())\n\t\t\t\t.CenterVertically()\n\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight)\n\t\t\t\t;\n\n\t\t\tif (scrub != null)\n\t\t\t\tlabel = label\n\t\t\t\t\t.WhileDraggingScrub(scrub)\n\t\t\t\t\t.SetCursor(isDisabled.Select(d => d ? Cursor.Normal : Cursor.ResizeHorizontally));\n\n\t\t\treturn label\n\t\t\t\t.SetContextMenu(Menu.Item(\"Clear\", clear));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/List.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tpublic static class ListEditor\n\t{\n\t\tpublic static IControl Create(IElement parent, Text name, SourceFragment fragment, Func<IElement, IControl> content)\n\t\t{\n\t\t\tvar type = fragment.ToXml().Name.LocalName;\n\t\t\tvar children = parent.Children\n\t\t\t\t.Where(e => e.Name.Is(type))\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\tvar hasContent = children.Select(c => c.Any());\n\n\t\t\tvar selectedChild = children.Select(c => c.LastOrNone().Or(Element.Empty)).Switch();\n\n\t\t\tvar stackedContent = children\n\t\t\t\t.PoolPerElement(e => content(e.Switch()))\n\t\t\t\t.StackFromTop(separator: () => Spacer.Medium);\n\n\t\t\tvar textColor =  parent.IsReadOnly().Select(ro => ro\n\t\t\t\t? Theme.DisabledText\n\t\t\t\t: Theme.DefaultText).Switch();\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tSeparator.Weak,\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(Label.Create(name, Theme.DefaultFont, color: textColor)\n\t\t\t\t\t\t.CenterVertically())\n\t\t\t\t\t.Right(ListButtons.AddButton(() => parent.Paste(fragment), isEnabled:  parent.IsReadOnly().IsFalse())\n\t\t\t\t\t\t.CenterVertically())\n\t\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t\t.Right(ListButtons.RemoveButton(() => selectedChild.Cut(), isEnabled: selectedChild.IsReadOnly().IsFalse())\n\t\t\t\t\t\t.CenterVertically())\n\t\t\t\t\t.Fill()\n\t\t\t\t\t.WithHeight(30)\n\t\t\t\t\t.WithInspectorPadding(),\n\t\t\t\tSeparator.Weak.ShowWhen(hasContent),\n\t\t\t\tSeparator.Weak.ShowWhen(hasContent),\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\tstackedContent,\n\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\tSeparator.Weak.ShowWhen(hasContent))\n\t\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, hasContent));\n\t\t}\n\n\t\t// TODO: make something proper\n\t\tstatic IObservable<bool> IsReadOnly(this IElement element)\n\t\t{\n\t\t\treturn element.SimulatorId.Select(id => id.Equals(ObjectIdentifier.None));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/ListButtons.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tstatic class ListButtons\n\t{\n\t\tpublic static IControl RemoveButton(Action clicked, IObservable<bool> isEnabled = null)\n\t\t{\n\t\t\tisEnabled = isEnabled ?? Observable.Return(true);\n\n\t\t\tvar command = Command.Create(isEnabled, clicked);\n\t\t\tvar stroke = IconStroke(isEnabled);\n\n\t\t\treturn Button.Create(command, state =>\n\t\t\t\tShapes.Line(\n\t\t\t\t\tnew Point<Points>(0, Width / 2),\n\t\t\t\t\tnew Point<Points>(Width, Width / 2),\n\t\t\t\t\tstroke: stroke)\n\t\t\t\t.WithWidth(Width)\n\t\t\t\t.WithHeight(Width));\n\t\t}\n\n\t\tpublic static IControl AddButton(Action clicked, IObservable<bool> isEnabled = null)\n\t\t{\n\t\t\tisEnabled = isEnabled ?? Observable.Return(true);\n\n\t\t\tvar command = isEnabled.Switch(e => Command.Create(e, clicked));\n\t\t\tvar stroke = IconStroke(isEnabled);\n\n\t\t\treturn Button.Create(command, state =>\n\t\t\t\tLayout.Layer(\n\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\tnew Point<Points>(Width / 2, 0),\n\t\t\t\t\t\tnew Point<Points>(Width / 2, Width),\n\t\t\t\t\t\tstroke: stroke),\n\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\tnew Point<Points>(0, Width / 2),\n\t\t\t\t\t\tnew Point<Points>(Width, Width / 2),\n\t\t\t\t\t\tstroke: stroke))\n\t\t\t\t\t.WithWidth(Width)\n\t\t\t\t\t.WithHeight(Width));\n\t\t}\n\n\t\tstatic readonly Points Width = 10.0;\n\n\t\tstatic Stroke IconStroke(IObservable<bool> isEnabled)\n\t\t{\n\t\t\treturn Stroke.Create(\n\t\t\t\tthickness: 2,\n\t\t\t\tbrush: isEnabled.Select(c => c\n\t\t\t\t\t? Theme.Link\n\t\t\t\t\t: Separator.WeakStroke.Brush).Switch());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/RadioButton.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tclass RadioButtonOption<T>\n\t{\n\t\tpublic T Value;\n\t\tpublic Text Tooltip;\n\t\tpublic Func<Brush, Brush, IControl> Icon;\n\t}\n\n\tpublic class RadioButtonCellBuilder<T> : IRadioButton<T>\n\t{\n\t\treadonly IEditorFactory _editors;\n\t\treadonly IAttribute<T> _property;\n\t\treadonly List<RadioButtonOption<T>> _options = new List<RadioButtonOption<T>>();\n\t\tpublic RadioButtonCellBuilder(IAttribute<T> property, IEditorFactory editors)\n\t\t{\n\t\t\t_property = property;\n\t\t\t_editors = editors;\n\t\t}\n\n\t\tpublic IRadioButton<T> Option(\n\t\t\tT value,\n\t\t\tFunc<Brush, Brush, IControl> icon,\n\t\t\tText tooltip)\n\t\t{\n\t\t\t_options.Add(new RadioButtonOption<T>()\n\t\t\t{\n\t\t\t\tValue = value,\n\t\t\t\tIcon = icon,\n\t\t\t\tTooltip = tooltip,\n\t\t\t});\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic IEditorControl Control\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new EditorControl<T>(_editors, _property,\n\t\t\t\t\tObservable.Return(\n\t\t\t\t\t\t_options.Select((v, i) =>\n\t\t\t\t\t\t\tButton.Create(\n\t\t\t\t\t\t\t\tCommand.Enabled(() => _property.Write(v.Value, save: true)),\n\t\t\t\t\t\t\t\tstate =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar colors = FindColors(\n\t\t\t\t\t\t\t\t\t\tisEnabled: state.IsEnabled,\n\t\t\t\t\t\t\t\t\t\tisDefaultValue: _property.Select(lv => lv.Equals(v.Value)),\n\t\t\t\t\t\t\t\t\t\tisSetValue: _property.LocalValue().Select(lv => lv.Equals(v.Value)),\n\t\t\t\t\t\t\t\t\t\tisHovered: state.IsHovered);\n\n\t\t\t\t\t\t\t\t\tvar stroke = Stroke.Create(1, colors.Stroke);\n\n\t\t\t\t\t\t\t\t\treturn v.Icon(colors.Foreground, colors.Background)\n\t\t\t\t\t\t\t\t\t\t.WithPadding(left: new Points(7), right: new Points(7))\n\t\t\t\t\t\t\t\t\t\t.Center()\n\t\t\t\t\t\t\t\t\t\t.WithBackground(\n\t\t\t\t\t\t\t\t\t\t\ti == 0 || i == _options.Count - 1\n\t\t\t\t\t\t\t\t\t\t\t\t? Shapes.Rectangle(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstroke: stroke,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill: colors.Background,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(4)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Scissor(i == 0 ? RectangleEdge.Right : RectangleEdge.Left, 4)\n\t\t\t\t\t\t\t\t\t\t\t\t: Layout.Dock()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Top(Separator.Line(stroke))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Bottom(Separator.Line(stroke))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Fill(Shapes.Rectangle(fill: colors.Background)));\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttoolTip: v.Tooltip)))\n\t\t\t\t\t.StackFromLeft(separator: () => Separator.Line(Stroke.Create(1, Theme.LineBrush)))\n\t\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight));\n\n\t\t\t}\n\t\t}\n\n\t\tColors FindColors(IObservable<bool> isEnabled, IObservable<bool> isDefaultValue, IObservable<bool> isSetValue, IObservable<bool> isHovered)\n\t\t{\n\t\t\tvar tmp = Observable.CombineLatest(isEnabled, isDefaultValue, isSetValue, isHovered, FindColors);\n\n\t\t\treturn new Colors\n\t\t\t{\n\t\t\t\tBackground = tmp.Select(t => t.Background).Switch(),\n\t\t\t\tForeground = tmp.Select(t => t.Foreground).Switch(),\n\t\t\t\tStroke = tmp.Select(t => t.Stroke).Switch(),\n\t\t\t};\n\t\t}\n\n\t\tColors FindColors(bool isEnabled, bool isDefaultValue, bool isSetValue, bool isHovered)\n\t\t{\n\t\t\tif (isEnabled)\n\t\t\t{\n\t\t\t\tif (isSetValue)\n\t\t\t\t\treturn new Colors\n\t\t\t\t\t{\n\t\t\t\t\t\tBackground = Theme.Link,\n\t\t\t\t\t\tForeground = Color.White,\n\t\t\t\t\t\tStroke = Theme.Link,\n\t\t\t\t\t};\n\n\t\t\t\tif (isDefaultValue)\n\t\t\t\t\treturn new Colors\n\t\t\t\t\t{\n\t\t\t\t\t\tBackground = Theme.LineBrush,\n\t\t\t\t\t\tForeground = isHovered ? Theme.Link : Theme.DefaultText,\n\t\t\t\t\t\tStroke = Theme.LineBrush,\n\t\t\t\t\t};\n\n\t\t\t\treturn new Colors\n\t\t\t\t{\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = isHovered ? Theme.Link : Theme.DefaultText,\n\t\t\t\t\tStroke = Theme.LineBrush,\n\t\t\t\t};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn new Colors\n\t\t\t\t{\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = Theme.DisabledText,\n\t\t\t\t\tStroke = Theme.DisabledText,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tstruct Colors\n\t\t{\n\t\t\tpublic Brush Background;\n\t\t\tpublic Brush Foreground;\n\t\t\tpublic Brush Stroke;\n\t\t}\n\t}\n\n\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Slider.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tstatic class SliderEditor\n\t{\n\t\tpublic static IControl Create(IAttribute<double> value, double min, double max)\n\t\t{\n\t\t\treturn Slider.Create(value, min, max)\n\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Editors/Switch.cs",
    "content": "using System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Editors\n{\n\tclass SwitchEditor\n\t{\n\t\tpublic static IControl Create(IProperty<bool> enabled)\n\t\t{\n\t\t\treturn Create(enabled, circleRadius: 18, additionalWidth: 11);\n\t\t}\n\n\t\tpublic static IControl CreateSmall(IProperty<bool> enabled)\n\t\t{\n\t\t\treturn Create(enabled, circleRadius: 15, additionalWidth: 10);\n\t\t}\n\n\t\tstatic IControl Create(IProperty<bool> enabled, Points circleRadius, Points additionalWidth)\n\t\t{\n\t\t\tdouble outlineThickness = 1;\n\t\t\tPoints backgroundPadding = 1;\n\n\t\t\tvar enabledValue = enabled.Select(isEnabled => isEnabled ? 1.0 : 0.0).LowPass(0.3);\n\n\t\t\tvar circleSize = Size.Create(circleRadius);\n\t\t\tvar cornerRadius = Observable.Return(new CornerRadius(circleRadius / 2.5));\n\t\t\tvar circle = Shapes.Circle(\n\t\t\t\t\tStroke.Create(1.0, Theme.SwitchThumbStroke),\n\t\t\t\t\tTheme.SwitchThumbFill)\n\t\t\t\t.WithSize(circleSize);\n\n\t\t\tvar foreground = circle.WithPadding(\n\t\t\t\tenabledValue.Select(v => Thickness.Create<Points>(v * additionalWidth, 0, (1 - v) * additionalWidth, 0)));\n\n\t\t\tvar backgroundStroke = Stroke.Create(\n\t\t\t\tObservable.Return(outlineThickness),\n\t\t\t\tTheme.SwitchInactiveStroke.Mix(Theme.SwitchActiveStroke, enabledValue),\n\t\t\t\tObservable.Return(StrokeDashArray.Solid));\n\t\t\tvar backgroundBrush = Theme.SwitchInactiveBackground.Mix(Theme.SwitchActiveBackground, enabledValue);\n\t\t\tvar background = Shapes.Rectangle(\n\t\t\t\tbackgroundStroke,\n\t\t\t\tbackgroundBrush,\n\t\t\t\tcornerRadius);\n\n\t\t\tvar content = foreground\n\t\t\t\t.WithBackground((background.WithPadding(new Thickness<Points>(backgroundPadding))));\n\t\t\treturn Button.Create(\n\t\t\t\tclicked: enabled.Toggle(),\n\t\t\t\tcontent: buttonStates => content);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/IEditorFactory.cs",
    "content": "﻿using System;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Inspector\n{\n\tpublic interface IEditorFactory\n\t{\n\t\tIControl ElementList(Text name, IElement parent, SourceFragment prototype, Func<IElement, IControl> itemFactory);\n\n\t\tIControl Label(Text name, IProperty<Optional<string>> attributeData);\n\n\t\tIControl Label<T>(Text name, params IAttribute<T>[] properties);\n\n\t\tIControl Label(Text name, IAttribute<Points> attribute);\n\n\t\tIControl Label(Text name, IAttribute<UxSize> attribute);\n\n\t\tIEditorControl Field<T>(IAttribute<T> attribute, Text placeholderText = default(Text), Text toolTip = default(Text), bool deferEdit = false);\n\n\t\tIEditorControl Color(IAttribute<Color> color);\n\n\t\tIEditorControl Switch(IAttribute<bool> attribute);\n\n\t\tIEditorControl Dropdown<T>(IAttribute<T> attribute) where T : struct;\n\n\t\tIEditorControl Slider(IAttribute<double> attribute, double min, double max);\n\n\t\tIEditorControl FilePath(IAttribute<string> attribute, IObservable<AbsoluteDirectoryPath> projectRoot, FileFilter[] fileFilters, Text placeholderText = default(Text), Text toolTip = default(Text));\n\n\t\tIRadioButton<T> RadioButton<T>(IAttribute<T> attribute);\n\n\t\tIControl ExpressionButton<T>(IAttribute<T> attribute);\n\t}\n\n\tpublic interface IRadioButton<in T>\n\t{\n\t\tIRadioButton<T> Option(T value, Func<Brush, Brush, IControl> icon, Text tooltip);\n\n\t\tIEditorControl Control { get; }\n\t}\n\n\tpublic interface IEditorControl : IControl\n\t{\n\t\tIControl WithIcon(Text tooltip, IControl icon);\n\n\t\tIControl WithLabel(Text description);\n\n\t\tIControl WithLabelAbove(Text description);\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Inspector.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Inspector.Editors;\nusing Outracks.Fuse.Inspector.Sections;\nusing Outracks.Fusion;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Inspector\n{\n\tpublic class Inspector\n\t{\n\t\tpublic static readonly string Title = \"Inspector\";\n\t\tpublic static readonly Points Width = 295;\n\n\t\tpublic static IControl Create(IProject project)\n\t\t{\n\t\t\tvar element = project.Context.CurrentSelection;\n\n\t\t\tvar nothingSelected = element.SimulatorId.Select(id => id == ObjectIdentifier.None);\n\n\t\t\tvar elementChanged = element.SimulatorId.Select(id => (object)id);\n\n\n\t\t\treturn Popover.Host(popover =>\n\t\t\t{\n\t\t\t\tvar uneditableElementMessage = UneditableElementMessage(project);\n\t\t\t\tvar uneditableElementIsSelected = uneditableElementMessage.Select(x => x.HasValue);\n\t\t\t\tvar uneditablePlaceholder = UneditablePlaceholder(uneditableElementMessage).ShowWhen(uneditableElementIsSelected);\n\n\t\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\t\tCommonSection.Create(element, project, new Factory(elementChanged, popover), popover),\n\t\t\t\t\t\tAdvancedSection.Create(element, new Factory(elementChanged, popover))\n\t\t\t\t\t\t\t.MakeCollapsable(RectangleEdge.Top, uneditableElementIsSelected.IsFalse(), animate: false))\n\t\t\t\t\t.WithWidth(Width)\n\t\t\t\t\t.DockLeft()\n\t\t\t\t\t.MakeScrollable(darkTheme: Theme.IsDark, horizontalScrollBarVisible: false)\n\t\t\t\t\t.WithBackground(uneditablePlaceholder.ShowWhen(uneditableElementIsSelected))\n\t\t\t\t\t.WithOverlay(Placeholder().ShowWhen(nothingSelected));\n\t\t\t});\n\t\t}\n\n\t\tstatic IControl Placeholder()\n\t\t{\n\t\t\tPoints rectangleWidth = 100;\n\t\t\tPoints rectangleHeight = 30;\n\n\t\t\tvar rectangles = Layout.StackFromTop(\n\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\tfill: Theme.Shadow,\n\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)))\n\t\t\t\t\t.WithSize(new Size<Points>(rectangleWidth * 0.8, rectangleHeight))\n\t\t\t\t\t.DockLeft(),\n\t\t\t\tSpacer.Small,\n\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\tstroke: Theme.SelectionStroke(Observable.Return(false), Observable.Return(true), Observable.Return(false)),\n\t\t\t\t\t\tfill: Theme.PanelBackground,\n\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)))\n\t\t\t\t\t.WithSize(new Size<Points>(rectangleWidth, rectangleHeight))\n\t\t\t\t\t.DockLeft(),\n\t\t\t\tSpacer.Small,\n\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\tfill: Theme.Shadow,\n\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)))\n\t\t\t\t\t.WithSize(new Size<Points>(rectangleWidth * 0.6, rectangleHeight))\n\t\t\t\t\t.DockLeft());\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\trectangles.CenterHorizontally()\n\t\t\t\t\t\t.WithOverlay(Arrow().WithPadding(new Thickness<Points>(rectangleWidth * 0.99, rectangleHeight * 1.3, 0, 0)).Center()),\n\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\tTexts.Inspector_SelectSomething,\n\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\tfont: Theme.DefaultFont))\n\t\t\t\t.Center()\n\t\t\t\t.WithBackground(Shapes.Rectangle(fill: Theme.PanelBackground))\n\t\t\t\t.MakeHittable()\n\t\t\t\t.Control;\n\t\t}\n\n\t\tstatic IObservable<Optional<string>> UneditableElementMessage(IProject project)\n\t\t{\n\t\t\treturn project.Context.CurrentSelection.Is(\"Fuse.Triggers.Trigger\")\n\t\t\t\t.CombineLatest(project.Context.CurrentSelection.Is(\"Fuse.Animations.Animator\"),\n\t\t\t\t\t(isTrigger, isAnimator) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (isTrigger || isAnimator)\n\t\t\t\t\t\t\treturn Optional.Some(string.Format(\"Currently you can't edit {0}.\\r\\nYou'll have to do it manually.\", isTrigger ? \"Triggers\" : \"Animators\"));\n\t\t\t\t\t\treturn Optional.None();\n\t\t\t\t\t})\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1)\n\t\t\t\t.RefCount();\n\t\t}\n\n\t\tstatic IControl UneditablePlaceholder(IObservable<Optional<string>> uneditableElementMessage)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tIcons.CannotEditPlaceholder().WithPadding(bottom: new Points(20)),\n\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\ttext: uneditableElementMessage.Select(x => x.OrDefault()).AsText(),\n\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\tcolor: Theme.DisabledText))\n\t\t\t\t.Center();\n\t\t}\n\n\t\tstatic IControl Arrow()\n\t\t{\n\t\t\tvar enabledIcon = Image.FromResource(\"Outracks.Fuse.Icons.selection_icon_on.png\", typeof(Inspector).Assembly, overlayColor: Theme.PanelBackground);\n\t\t\tvar disabledIcon = Image.FromResource(\"Outracks.Fuse.Icons.selection_icon_off.png\", typeof(Inspector).Assembly, overlayColor: Theme.FieldFocusStroke.Brush);\n\t\t\treturn disabledIcon.WithBackground(enabledIcon).WithSize(new Size<Points>(30, 30));\n\t\t}\n\n\t}\n\n\n\tstatic class Rows\n\t{\n\t\tpublic static IControl NameRow(this IEditorFactory editors, string name, IAttribute<string> property, bool deferEdit = false)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Left(editors.Label(name, property).WithWidth(CellLayout.FullCellWidth))\n\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t.Fill(editors.Field(property, placeholderText: \"Add name here\", deferEdit: deferEdit));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Attributes.cs",
    "content": "﻿using System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tpublic class AttributesSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn CreateAttributeEditorsForType(element, element.Base, editors);\n\t\t}\n\n\t\tstatic IControl CreateAttributeEditorsForType(IElement instance, IElement type, IEditorFactory editors)\n\t\t{\n\t\t\tvar attributes = type.Children\n\t\t\t\t.SelectPerElement(c => c.UxProperty().SelectPerElement(p => new { Name = p, Type = c.Name, }))\n\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t.Select(v => v.NotNone());\n\n\t\t\treturn type.UxClass()\n\t\t\t\t.Select(maybeClass =>\n\t\t\t\t\tmaybeClass.MatchWith(\n\t\t\t\t\t\tnone: () => Layout.StackFromTop(\n\t\t\t\t\t\t\tSpacer.Medim,\n\n\t\t\t\t\t\t\tLabel.Create(\"Unknown element type\",\n\t\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\t\tcolor: Theme.DisabledText,\n\t\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Center)\n\t\t\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\t\t\tSpacer.Medium),\n\n\t\t\t\t\t\tsome: className => Layout.StackFromTop(\n\t\t\t\t\t\t\tSeparator.Weak,\n\t\t\t\t\t\t\tSpacer.Medim,\n\n\t\t\t\t\t\t\tLabel.Create(className,\n\t\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Center),\n\n\t\t\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\t\t\tattributes.SelectPerElement(attribute =>\n\t\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t\t.Right(editors.Field(instance.GetString(attribute.Name, \"\"), placeholderText: attribute.Type.AsText()))\n\t\t\t\t\t\t\t\t\t.Fill(editors.Label(attribute.Name, instance[attribute.Name])))\n\t\t\t\t\t\t\t\t.StackFromTop(separator: () => Spacer.Small)\n\t\t\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\t\t\tLabel.Create(\"This class has no properties\",\n\t\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\t\tcolor: Theme.DisabledText,\n\t\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Center)\n\t\t\t\t\t\t\t\t.WithInspectorPadding()\n\t\t\t\t\t\t\t\t.ShowWhen(attributes.Select(a => a.IsEmpty())),\n\n\t\t\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\t\t\t// Recurse up the IElement.Base chain\n\t\t\t\t\t\t\ttype.Base.IsEmpty\n\t\t\t\t\t\t\t\t.Select(baseIsEmpty =>\n\t\t\t\t\t\t\t\t\tbaseIsEmpty\n\t\t\t\t\t\t\t\t\t\t? Control.Empty\n\t\t\t\t\t\t\t\t\t\t: Layout.StackFromTop(\n\t\t\t\t\t\t\t\t\t\t\tSeparator.Weak,\n\t\t\t\t\t\t\t\t\t\t\tCreateAttributeEditorsForType(instance, type.Base, editors)))\n\t\t\t\t\t\t\t\t.Switch())))\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Layout/AlignmentEditor.cs",
    "content": "﻿using Outracks.Fuse.Inspector.Editors;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tenum Alignment\n\t{\n\t\tDefault,\n\t\tLeft,\n\t\tHorizontalCenter,\n\t\tRight,\n\t\tTop,\n\t\tVerticalCenter,\n\t\tBottom,\n\t\tTopLeft,\n\t\tTopCenter,\n\t\tTopRight,\n\t\tCenterLeft,\n\t\tCenter,\n\t\tCenterRight,\n\t\tBottomLeft,\n\t\tBottomCenter,\n\t\tBottomRight,\n\t}\n\n\tclass AlignmentEditor\n\t{\n\t\tpublic static IEditorControl Create(IAttribute<Alignment> attribute, IEditorFactory editors)\n\t\t{\n\t\t\tvar smallPadding = Optional.Some(new Points(5.0));\n\t\t\tvar largePadding = Optional.Some(new Points(16.0));\n\n\t\t\treturn new EditorControl<Alignment>(\n\t\t\t\teditors,\n\t\t\t\tattribute,\n\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.Default,\n\t\t\t\t\t\t\t\"Alignment: Default\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) =>\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.Center,\n\t\t\t\t\t\t\t\"Alignment: Center\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).Center()))\n\t\t\t\t\t\t.WithPadding(right: largePadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.Bottom,\n\t\t\t\t\t\t\t\"Alignment: Bottom\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.ButtonDim, CustomRadioButton.SmallRectSize.Height)).DockBottom()))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.Top,\n\t\t\t\t\t\t\t\"Alignment: Top\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.ButtonDim, CustomRadioButton.SmallRectSize.Height)).DockTop()))\n\t\t\t\t\t\t.WithPadding(right: largePadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.Left,\n\t\t\t\t\t\t\t\"Alignment: Left\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.SmallRectSize.Height, CustomRadioButton.ButtonDim)).DockLeft()))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.Right,\n\t\t\t\t\t\t\t\"Alignment: Right\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.SmallRectSize.Height, CustomRadioButton.ButtonDim)).DockRight()))\n\t\t\t\t\t\t.WithPadding(right: largePadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.HorizontalCenter,\n\t\t\t\t\t\t\t\"Alignment: Horizontal center\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\t\tnew Point<Points>(0.0, 0.0),\n\t\t\t\t\t\t\t\t\tnew Point<Points>(0.0, CustomRadioButton.ButtonDim - 4.0),\n\t\t\t\t\t\t\t\t\tstroke)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(1.0, CustomRadioButton.ButtonDim - 4.0)).Center(),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).Center()))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.VerticalCenter,\n\t\t\t\t\t\t\t\"Alignment: Vertical center\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\t\tnew Point<Points>(0.0, 0.0),\n\t\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - 4.0, 0.0),\n\t\t\t\t\t\t\t\t\tstroke)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.ButtonDim - 4.0, 1.0)).Center(),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).Center())))\n\t\t\t\t\t.WithPadding(bottom: new Points(9.0)),\n\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.BottomCenter,\n\t\t\t\t\t\t\t\"Alignment: Bottom center\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockBottom().CenterHorizontally()))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.TopCenter,\n\t\t\t\t\t\t\t\"Alignment: Top center\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockTop().CenterHorizontally()))\n\t\t\t\t\t\t.WithPadding(right: largePadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.CenterLeft,\n\t\t\t\t\t\t\t\"Alignment: Center left\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockLeft().CenterVertically()))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.CenterRight,\n\t\t\t\t\t\t\t\"Alignment: Center right\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockRight().CenterVertically()))\n\t\t\t\t\t\t.WithPadding(right: largePadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.BottomLeft,\n\t\t\t\t\t\t\t\"Alignment: Bottom left\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockBottomLeft()))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.BottomRight,\n\t\t\t\t\t\t\t\"Alignment: Bottom right\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockBottomRight()))\n\t\t\t\t\t\t.WithPadding(right: largePadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.TopLeft,\n\t\t\t\t\t\t\t\"Alignment: Top left\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockTopLeft()))\n\t\t\t\t\t\t.WithPadding(right: smallPadding),\n\n\t\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\t\tattribute,\n\t\t\t\t\t\t\tAlignment.TopRight,\n\t\t\t\t\t\t\t\"Alignment: Top right\",\n\t\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\t\tCustomRadioButton.CreateSmallRect(color).DockTopRight()))))\n\t\t\t\t.CenterHorizontally()\n\t\t\t\t.WithBackground(editors.ExpressionButton(attribute).DockRight()));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Layout/CustomRadioButton.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tstatic class CustomRadioButton\n\t{\n\t\tpublic static readonly Points ButtonDim = new Points(20.0);\n\t\tpublic static readonly Size<Points> ButtonSize = new Size<Points>(ButtonDim, ButtonDim);\n\n\t\tpublic static readonly Size<Points> SmallRectSize = new Size<Points>(10.0, 4.0);\n\n\t\tpublic static IControl Create<T>(\n\t\t\tIAttribute<T> attribute,\n\t\t\tT value,\n\t\t\tText toolTip,\n\t\t\tFunc<Brush, Brush, Stroke, IControl> content)\n\t\t\twhere T: struct\n\t\t{\n\t\t\tvar isSelected = attribute.LocalValue()\n\t\t\t\t.Select(maybeValue => maybeValue.Equals(value))\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount();\n\n\n\t\t\treturn Button.Create(\n\t\t\t\t\t\tclicked: Command.Enabled(() => attribute.Write(value, save: true)),\n\t\t\t\t\t\tcontent: state =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar color = isSelected.Select(s => s ? Theme.Link : Theme.DisabledText).Switch();\n\t\t\t\t\t\t\tvar backgroundColor = isSelected.Select(s => s\n\t\t\t\t\t\t\t\t\t? Theme.PanelBackground.Mix(Theme.Link, Observable.Return(0.25))\n\t\t\t\t\t\t\t\t\t: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered,\n\t\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t\t? Theme.FaintBackground\n\t\t\t\t\t\t\t\t\t\t\t\t\t: Theme.PanelBackground)\n\t\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t\t.Switch();\n\n\t\t\t\t\t\t\tvar stroke = Stroke.Create(1.0, color);\n\n\t\t\t\t\t\t\treturn content(backgroundColor, color, stroke);\n\t\t\t\t\t\t})\n\t\t\t\t\t.WithSize(ButtonSize)\n\t\t\t\t\t.SetToolTip(toolTip);\n\t\t}\n\n\t\tpublic static IControl CreateBackgroundRect(Brush fillColor, Brush strokeColor)\n\t\t{\n\t\t\treturn Shapes.Rectangle(\n\t\t\t\tfill: fillColor,\n\t\t\t\tstroke: Stroke.Create(1.0, strokeColor));\n\t\t}\n\n\t\tpublic static IControl CreateSmallRect(Brush fillColor)\n\t\t{\n\t\t\treturn Shapes.Rectangle(fill: fillColor).WithSize(SmallRectSize);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Layout/DockEditor.cs",
    "content": "﻿using Outracks.Fuse.Inspector.Editors;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tenum Dock\n\t{\n\t\tLeft,\n\t\tRight,\n\t\tTop,\n\t\tBottom,\n\t\tFill,\n\t}\n\n\tclass DockEditor\n\t{\n\t\tpublic static IEditorControl Create(IAttribute<Dock> attribute, IEditorFactory editors)\n\t\t{\n\t\t\tvar padding = Optional.Some(new Points(18.0));\n\n\t\t\tvar diagonalArrowCenterMargin = 1.0;\n\t\t\tvar diagonalArrowEdgeMargin = 4.0;\n\t\t\tvar diagonalArrowTickOffset = 3.0;\n\n\t\t\tvar straightArrowLength = 10.0;\n\t\t\tvar straightArrowHalfLength = straightArrowLength / 2.0;\n\t\t\tvar straightArrowTickOffset = 2.0;\n\n\t\t\treturn new EditorControl<Dock>(\n\t\t\t\teditors,\n\t\t\t\tattribute,\n\n\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\tattribute,\n\t\t\t\t\t\tDock.Fill,\n\t\t\t\t\t\t\"Dock: Fill\",\n\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.ButtonDim - 4.0, CustomRadioButton.ButtonDim - 4.0)).Center(),\n\t\t\t\t\t\t\t// Upper-left arrow\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - diagonalArrowCenterMargin, CustomRadioButton.ButtonDim / 2.0 - diagonalArrowCenterMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin + diagonalArrowTickOffset, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, diagonalArrowEdgeMargin + diagonalArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\t// Upper-right arrow\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + diagonalArrowCenterMargin, CustomRadioButton.ButtonDim / 2.0 - diagonalArrowCenterMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin - diagonalArrowTickOffset, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, diagonalArrowEdgeMargin + diagonalArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\t// Lower-left arrow\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - diagonalArrowCenterMargin, CustomRadioButton.ButtonDim / 2.0 + diagonalArrowCenterMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin + diagonalArrowTickOffset, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin - diagonalArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\t// Lower-right arrow\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + diagonalArrowCenterMargin, CustomRadioButton.ButtonDim / 2.0 + diagonalArrowCenterMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin - diagonalArrowTickOffset, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin, CustomRadioButton.ButtonDim - diagonalArrowEdgeMargin - diagonalArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke)))\n\t\t\t\t\t.WithPadding(right: padding),\n\n\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\tattribute,\n\t\t\t\t\t\tDock.Left,\n\t\t\t\t\t\t\"Dock: Left\",\n\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.SmallRectSize.Height, CustomRadioButton.ButtonDim)).DockLeft(),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength + straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 - straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength + straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 + straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke)))\n\t\t\t\t\t.WithPadding(right: padding),\n\n\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\tattribute,\n\t\t\t\t\t\tDock.Bottom,\n\t\t\t\t\t\t\"Dock: Bottom\",\n\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.ButtonDim, CustomRadioButton.SmallRectSize.Height)).DockBottom(),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength - straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength - straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke)))\n\t\t\t\t\t.WithPadding(right: padding),\n\n\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\tattribute,\n\t\t\t\t\t\tDock.Top,\n\t\t\t\t\t\t\"Dock: Top\",\n\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.ButtonDim, CustomRadioButton.SmallRectSize.Height)).DockTop(),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength + straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0, CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength + straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke)))\n\t\t\t\t\t.WithPadding(right: padding),\n\n\t\t\t\t\tCustomRadioButton.Create(\n\t\t\t\t\t\tattribute,\n\t\t\t\t\t\tDock.Right,\n\t\t\t\t\t\t\"Dock: Right\",\n\t\t\t\t\t\t(backgroundColor, color, stroke) => Layout.Layer(\n\t\t\t\t\t\t\tCustomRadioButton.CreateBackgroundRect(backgroundColor, color),\n\t\t\t\t\t\t\tShapes.Rectangle(fill: color)\n\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(CustomRadioButton.SmallRectSize.Height, CustomRadioButton.ButtonDim)).DockRight(),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 - straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength - straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 - straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke),\n\t\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength, CustomRadioButton.ButtonDim / 2.0),\n\t\t\t\t\t\t\t\tnew Point<Points>(CustomRadioButton.ButtonDim / 2.0 + straightArrowHalfLength - straightArrowTickOffset, CustomRadioButton.ButtonDim / 2.0 + straightArrowTickOffset),\n\t\t\t\t\t\t\t\tstroke))))\n\t\t\t\t.CenterHorizontally()\n\t\t\t\t.WithBackground(editors.ExpressionButton(attribute).DockRight()));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Layout/ElementDockPanelExtensions.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tstatic class ElementDockPanelExtensions\n\t{\n\t\tpublic static IObservable<bool> IsInDockPanelContext(this IElement element)\n\t\t{\n\t\t\treturn element.IsChildOf(\"Fuse.Controls.DockPanel\")\n\t\t\t\t.Or(element.IsSiblingOf(\"Fuse.Layouts.DockLayout\"));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Layout/Spacing.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Inspector.Editors;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass SpacingSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar margin = element.GetThickness(\"Margin\", new Thickness<Points>(0, 0, 0, 0));\n\t\t\tvar padding = element.GetThickness(\"Padding\", new Thickness<Points>(0, 0, 0, 0));\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tThicknessEditor(margin, editors).WithLabel(\"Margin\"),\n\t\t\t\t\tSpacer.Small,\n\t\t\t\t\tThicknessEditor(padding, editors).WithLabel(\"Padding\"))\n\t\t\t\t.WithInspectorPadding();\n\t\t}\n\n\t\tstatic IEditorControl ThicknessEditor(IAttribute<Thickness<Points>> thickness, IEditorFactory editors)\n\t\t{\n\t\t\tvar expressions = Decompose(thickness);\n\t\t\tvar cells =\n\t\t\t\texpressions.Select(\n\t\t\t\t\t(prop, edge) =>\n\t\t\t\t\t\tTextBox.Create(\n\t\t\t\t\t\t\t\tprop.Convert(UxSizeParser.Serialize, s => s.TryParsePoints().Value.Or(new Points(0))),\n\t\t\t\t\t\t\t\tforegroundColor: Theme.DefaultText)\n\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(3,0,0,0))\n\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: Theme.FieldStroke.Brush).WithSize(new Size<Points>(2, 2)).Dock(edge))\n\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(Theme.FieldStroke))\n\t\t\t\t\t\t\t.WithBackground(Shapes.Rectangle(fill: Theme.FieldBackground))\n\t\t\t\t\t\t\t.WithWidth(28)\n\t\t\t\t\t\t\t.WithHeight(CellLayout.DefaultCellHeight)\n\t\t\t\t\t\t\t.SetToolTip(edge.ToString()));\n\n\t\t\treturn new EditorControl<Thickness<Points>>(\n\t\t\t\teditors, thickness,\n\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\tcells.Left, Spacer.Small,\n\t\t\t\t\tcells.Top, Spacer.Small,\n\t\t\t\t\tcells.Right, Spacer.Small,\n\t\t\t\t\tcells.Bottom,\n\t\t\t\t\tSpacer.Medim,\n\t\t\t\t\teditors.ExpressionButton(thickness).WithPadding(right: new Points(1))));\n\t\t}\n\n\t\tstatic Thickness<IAttribute<Points>> Decompose(IAttribute<Thickness<Points>> thickness)\n\t\t{\n\t\t\treturn new Thickness<IAttribute<Points>>(\n\t\t\t\tleft: Focus(thickness, t => t.Left, (t, v) => t.With(left: v)),\n\t\t\t\ttop: Focus(thickness, t => t.Top, (t,v) => t.With(top: v)),\n\t\t\t\tright: Focus(thickness, t => t.Right, (t, v) => t.With(right: v)),\n\t\t\t\tbottom: Focus(thickness, t => t.Bottom, (t, v) => t.With(bottom: v)));\n\t\t}\n\n\t\tprivate static IAttribute<Points> Focus(\n\t\t\tIAttribute<Thickness<Points>> thickness,\n\t\t\tFunc<Thickness<Points>, Points> convert,\n\t\t\tFunc<Thickness<Points>, Points, Thickness<Points>> combine)\n\t\t{\n\t\t\treturn thickness.Focus(\n\t\t\t\te => e.Select(convert, t => t.Value.ToString(\"0.##\")),\n\t\t\t\tconvert,\n\t\t\t\tcombine,\n\t\t\t\tCommand.Enabled(() => thickness.Take(1).Subscribe(lastValue => thickness.Write(combine(lastValue, new Points(0))))));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Layout.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass LayoutSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\telement = element.As(\"Fuse.Elements.Element\");\n\n\t\t\tvar alignment = element.GetEnum(\"Alignment\", Alignment.Default);\n\t\t\tvar dock = element.GetEnum(\"Dock\", Dock.Fill);\n\t\t\tvar layoutRole = element.GetEnum(\"LayoutRole\", LayoutRole.Standard);\n\t\t\tvar layer = element.GetEnum(\"Layer\", Layer.Layout);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tSeparator.Weak,\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tAlignmentEditor.Create(alignment, editors).WithInspectorPadding(),\n\n\t\t\t\tSpacer.Medium, Separator.Weak,\n\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\tDockEditor.Create(dock, editors).WithInspectorPadding(),\n\t\t\t\t\t\tSpacer.Medium, Separator.Weak)\n\t\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.IsInDockPanelContext()),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tSpacingSection.Create(element, editors),\n\n\t\t\t\tSpacer.Medium, Separator.Weak, Spacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Dropdown(layoutRole).WithLabelAbove(\"Layout Role\"))\n\t\t\t\t\t.Right(editors.Dropdown(layer).WithLabelAbove(\"Layer\"))\n\t\t\t\t\t.Fill()\n\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\tSpacer.Medium,\n\t\t\t\tSeparator.Weak);\n\t\t}\n\t}\n\n\tenum Layer\n\t{\n\t\tUnderlay,\n\t\tBackground,\n\t\tLayout,\n\t\tOverlay,\n\t}\n\n\tenum LayoutRole\n\t{\n\t\tStandard,\n\t\tPlaceholder,\n\t\tInert,\n\t\tIndependent,\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/SizePosition.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass SizePositionSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\telement = element.As(\"Fuse.Elements.Element\");\n\n\t\t\tvar x = element.GetSize(\"X\", UxSize.Points(0.0));\n\t\t\tvar y = element.GetSize(\"Y\", UxSize.Points(0.0));\n\n\t\t\t//var offset = element.GetSize2(\"Offset\", Size.Create(UxSize.Points(0.0), UxSize.Points(0.0))).Transpose(UxSize.Points(0.0));\n\n\t\t\tvar width = element.GetPoints(\"Width\", 0.0);\n\t\t\tvar height = element.GetPoints(\"Height\", 0.0);\n\t\t\tvar maxWidth = element.GetPoints(\"MaxWidth\", 0.0);\n\t\t\tvar maxHeight = element.GetPoints(\"MaxHeight\", 0.0);\n\t\t\tvar minWidth = element.GetPoints(\"MinWidth\", 0.0);\n\t\t\tvar minHeight = element.GetPoints(\"MinHeight\", 0.0);\n\n\t\t\treturn Layout.StackFromTop(\n\n\t\t\t\tSpacer.Medium,\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(Layout.StackFromTop(\n\t\t\t\t\t\t\teditors.Label(\" \", width, height),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\teditors.Label(\"Width\", width),\n\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\teditors.Label(\"Height\", height))\n\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t.Left(Layout.StackFromTop(\n\t\t\t\t\t\t\teditors.Label(\" \", width, height),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\teditors.Field(width, toolTip: \"Width\"),\n\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\teditors.Field(height, toolTip: \"Height\"))\n\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Layout.StackFromTop(\n\t\t\t\t\t\t\teditors.Label(\"Max\", maxWidth, maxHeight),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\teditors.Field(maxWidth, toolTip: \"Maximum width\"),\n\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\teditors.Field(maxHeight, toolTip: \"Maximum height\"))\n\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t\t.Right(Layout.StackFromTop(\n\t\t\t\t\t\t\teditors.Label(\"Min\", minWidth, minHeight),\n\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\teditors.Field(minWidth, toolTip: \"Minimum width\"),\n\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\teditors.Field(minHeight, toolTip: \"Minimum height\"))\n\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Fill(Spacer.Small)\n\t\t\t\t\t.WithInspectorPadding(),\n\t\t\t\tSpacer.Medium,\n\t\t\t\tSeparator.Weak,\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Fill(\n\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(editors.Label(\"X\", x)\n\t\t\t\t\t\t\t.WithWidth(26)\n\t\t\t\t\t\t\t.DockLeft(editors.Field(x)).WithWidth(CellLayout.FullCellWidth))\n\t\t\t\t\t\t.Right(editors.Label(\"Y\", y)\n\t\t\t\t\t\t\t.WithWidth(26)\n\t\t\t\t\t\t\t.DockLeft(editors.Field(y)).WithWidth(CellLayout.FullCellWidth))\n\t\t\t\t\t\t.Fill(Spacer.Medium))\n\n\t\t\t\t\t//.Right(Layout.StackFromTop(\n\t\t\t\t\t//\t\teditors.Label(\"\\u2194\", offset.Width)\n\t\t\t\t\t//\t\t\t.CenterHorizontally().WithWidth(26)\n\t\t\t\t\t//\t\t\t.DockLeft(editors.Field(offset.Width)),\n\t\t\t\t\t//\t\tSpacer.Small,\n\t\t\t\t\t//\t\teditors.Label(\"\\u2195\", offset.Height)\n\t\t\t\t\t//\t\t\t.CenterHorizontally().WithWidth(26)\n\t\t\t\t\t//\t\t\t.DockLeft(editors.Field(offset.Height)))\n\t\t\t\t\t//\t.WithWidth(CellLayout.FullCellWidth))\n\n\n\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\tSpacer.Medium, Separator.Weak);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Style/DropShadow.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tstatic class DropShadowSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn editors.ElementList(\n\t\t\t\t\"Shadow\", element,\n\t\t\t\tSourceFragment.FromString(\"<Shadow/>\"),\n\t\t\t\tshadow => CreateShadowRow(shadow, editors)\n\t\t\t\t\t.WithInspectorPadding());\n\t\t}\n\n\t\tstatic IControl CreateShadowRow(IElement shadow, IEditorFactory editors)\n\t\t{\n\t\t\tvar name = shadow.UxName();\n\t\t\tvar angle = shadow.GetAngle(\"Angle\", 90);\n\t\t\tvar color = shadow.GetColor(\"Color\", Color.Black);\n\t\t\tvar distance = shadow.GetPoints(\"Distance\", 0);\n\t\t\tvar size = shadow.GetPoints(\"Size\", 5);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\teditors.NameRow(\"Shadow Name\", name),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Color(color).WithLabelAbove(\"Color\"))\n\t\t\t\t\t// TODO: Changing from Background to PerPixel crashes fuselibs at runtime (09-05-2017)\n\t\t\t\t\t//.Right(editors.Dropdown(mode).WithLabelAbove(\"Mode\"))\n\t\t\t\t\t.Right(editors.Field(distance).WithLabelAbove(\"Distance\").WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t.Right(editors.Field(size).WithLabelAbove(\"Size\").WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Fill(Spacer.Medium),\n\n\t\t\t\tSpacer.Medium,\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Label(\"Angle\", angle))\n\t\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t\t.Right(editors.Field(angle).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t.Fill(editors.Slider(angle, min: 0.0, max: 360.0)));\n\t\t}\n\n\t\tenum ShadowMode\n\t\t{\n\t\t\tPerPixel,\n\t\t\tBackground\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Style/LinearGradient.cs",
    "content": "using System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tstatic class LinearGradientSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn editors.ElementList(\n\t\t\t\t\"Linear Gradient\", element,\n\t\t\t\tSourceFragment.FromString(\n\t\t\t\t\t\"<LinearGradient>\\n\" +\n\t\t\t\t\t\"\\t<GradientStop Offset=\\\"0\\\" Color=\\\"#ADDDAB\\\"/>\\n\" +\n\t\t\t\t\t\"\\t<GradientStop Offset=\\\"1\\\" Color=\\\"#6DC0D2\\\"/>\\n\" +\n\t\t\t\t\t\"</LinearGradient>\\n\"),\n\t\t\t\tlinearGradient => CreateGradientRow(linearGradient, editors)\n\t\t\t\t\t.WithInspectorPadding());\n\t\t}\n\n\t\tstatic IControl CreateGradientRow(IElement linearGradient, IEditorFactory editors)\n\t\t{\n\t\t\tvar name = linearGradient.UxName();\n\n\t\t\tvar stops = linearGradient.Children\n\t\t\t\t.Where(e => e.Is(\"Fuse.Drawing.GradientStop\"));\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\teditors.NameRow(\"Gradient Name\", name),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tstops\n\t\t\t\t\t.PoolPerElement((index, gradientStop) =>\n\t\t\t\t\t\tCreateGradientStopRow(index, gradientStop.Switch(), editors))\n\t\t\t\t\t.StackFromTop(separator: () => Spacer.Small),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tButtons.DefaultButton(\n\t\t\t\t\ttext:\"Remove Gradient Stop\",\n\t\t\t\t\tcmd: stops\n\t\t\t\t\t\t.Select(s =>\n\t\t\t\t\t\t\ts.LastOrNone().MatchWith(\n\t\t\t\t\t\t\t\tsome: stop => Command.Enabled(() => stop.Cut()),\n\t\t\t\t\t\t\t\tnone: () => Command.Disabled))\n\t\t\t\t\t\t.Switch()),\n\n\t\t\t\tSpacer.Small,\n\n\t\t\t\tButtons.DefaultButton(\n\t\t\t\t\ttext: \"Add Gradient Stop\",\n\t\t\t\t\tcmd: Command.Enabled(() => linearGradient.Paste(SourceFragment.FromString(\"<GradientStop Offset=\\\"1\\\"/>\")))));\n\t\t}\n\n\t\tstatic IControl CreateGradientStopRow(int index, IElement gradientStop, IEditorFactory editors)\n\t\t{\n\t\t\tvar stopName = gradientStop.UxName();\n\t\t\tvar stopOffset = gradientStop.GetDouble(\"Offset\", 0.0);\n\t\t\tvar stopColor = gradientStop.GetColor(\"Color\", Color.White);\n\n\t\t\tvar colorEditor = editors.Color(stopColor);\n\t\t\tvar offsetEditor = editors.Field(stopOffset, deferEdit: true);\n\t\t\tvar nameEditor = editors.Field(stopName, placeholderText: \"Stop name\");\n\n\t\t\tIControl colorControl = colorEditor;\n\t\t\tIControl offsetControl = offsetEditor;\n\t\t\tIControl nameControl = nameEditor;\n\n\t\t\tif (index == 0)\n\t\t\t{\n\t\t\t\tcolorControl = colorEditor.WithLabelAbove(\"Color\");\n\t\t\t\toffsetControl = offsetEditor.WithLabelAbove(\"Offset\");\n\t\t\t\tnameControl = nameEditor.WithLabelAbove(\"Name\");\n\t\t\t}\n\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Left(colorControl)\n\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t.Left(offsetControl.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t.Fill(nameControl);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Style/SolidColor.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tstatic class SolidColorSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn editors.ElementList(\n\t\t\t\t\"Solid Color\", element,\n\t\t\t\tSourceFragment.FromString(\"<SolidColor/>\"),\n\t\t\t\tsolidColor => CreateSolidColorRow(solidColor, editors)\n\t\t\t\t\t.WithInspectorPadding());\n\t\t}\n\n\t\tstatic IControl CreateSolidColorRow(IElement solidColor, IEditorFactory editors)\n\t\t{\n\t\t\tvar name = solidColor.UxName();\n\t\t\tvar color = solidColor.GetColor(\"Color\", Color.White);\n\t\t\tvar opacity = solidColor.GetDouble(\"Opacity\", 1.0);\n\t\t\t//var mode = solidColor.GetEnum(\"BlendMode\", BlendMode.Normal);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\teditors.NameRow(\"Brush Name\", name),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Color(color).WithLabelAbove(\"Color\"))\n\t\t\t\t\t//.Right(editors.Dropdown(mode).WithLabelAbove(\"Blend Mode\"))\n\t\t\t\t\t.Fill(Spacer.Medium),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Label(\"Opacity\", opacity))\n\t\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t\t.Right(editors.Field(opacity).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t.Fill(editors.Slider(opacity, min: 0.0, max: 1.0)));\n\t\t}\n\t}\n\n\tenum BlendMode\n\t{\n\t\tNormal,\n\t\tAdd,\n\t\tScreen,\n\t\tMultiply\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Style/Stroke.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tstatic class StrokeSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn editors.ElementList(\n\t\t\t\t\"Stroke\", element,\n\t\t\t\tSourceFragment.FromString(\"<Stroke Width=\\\"3\\\" Color=\\\"#f00\\\"/>\"),\n\t\t\t\tstroke => CreateStrokeRow(stroke, editors)\n\t\t\t\t\t.WithInspectorPadding())\n\t\t\t\t.MakeCollapsable(RectangleEdge.Top, element.Is(\"Fuse.Controls.Shape\"));\n\t\t}\n\n\t\tstatic IControl CreateStrokeRow(IElement stroke, IEditorFactory editors)\n\t\t{\n\t\t\tvar name = stroke.UxName();\n\t\t\tvar color = stroke.GetColor(\"Color\", Color.Black);\n\t\t\tvar alignment = stroke.GetEnum(\"Alignment\", StrokeAlignment.Inside);\n\t\t\tvar width = stroke.GetPoints(\"Width\", 1.0);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\teditors.NameRow(\"Stroke Name\", name),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Color(color).WithLabelAbove(\"Color\"))\n\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t.Right(\n\t\t\t\t\t\teditors.Field(width).WithLabelAbove(\"Width\")\n\t\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t\t.Fill(editors.Dropdown(alignment).WithLabelAbove(\"Alignment\")));\n\t\t}\n\t}\n\n\tenum StrokeAlignment\n\t{\n\t\tCenter,\n\t\tInside,\n\t\tOutside,\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Style.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass StyleSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\telement = element.As(\"Fuse.Elements.Element\");\n\n\t\t\tvar color = element.GetColor(\"Color\", Color.White);\n\t\t\tvar background = element.GetColor(\"Background\", new Color(1, 1, 1, 1));\n\t\t\tvar opacity = element.GetDouble(\"Opacity\", 1.0);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tSeparator.Weak,\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Color(color).WithLabelAbove(\"Color\"))\n\t\t\t\t\t.Right(editors.Color(background).WithLabelAbove(\"Background\"))\n\t\t\t\t\t.Fill()\n\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\tSpacer.Medium, Separator.Weak, Spacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Label(\"Opacity\", opacity))\n\t\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t\t.Right(editors.Field(opacity).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t\t.Fill(editors.Slider(opacity, min: 0.0, max: 1.0))\n\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\tSpacer.Medium,\n\t\t\t\tSeparator.Weak,\n\t\t\t\tSpacer.Medium,\n\t\t\t\tLabel.Create(\n\t\t\t\t\t\"Effects are added as \\n\" +\n\t\t\t\t\t\"children of the current element\",\n\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\tcolor: Theme.DescriptorText,\n\t\t\t\t\ttextAlignment: TextAlignment.Center),\n\t\t\t\tSpacer.Medium,\n\t\t\t\tStrokeSection.Create(element, editors),\n\t\t\t\tLinearGradientSection.Create(element, editors),\n\t\t\t\tSolidColorSection.Create(element, editors),\n\t\t\t\tDropShadowSection.Create(element, editors),\n\t\t\t\tSeparator.Weak);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Transform/Rotation.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tstatic class RotationSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn editors.ElementList(\n\t\t\t\t\"Rotation\", element,\n\t\t\t\tSourceFragment.FromString(\"<Rotation/>\"),\n\t\t\t\trotation => CreateRotationRow(rotation, editors)\n\t\t\t\t\t.WithInspectorPadding());\n\t\t}\n\n\t\tstatic IControl CreateRotationRow(IElement rotation, IEditorFactory editors)\n\t\t{\n\t\t\tvar name = rotation.UxName();\n\t\t\tvar degrees = rotation.GetDouble(\"Degrees\", 0.0);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\teditors.NameRow(\"Rotation Name\", name),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Label(\"Degrees\", degrees))\n\t\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t\t.Right(editors.Field(degrees).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t.Fill(editors.Slider(degrees, min: -180.0, max: 180.0)));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Transform.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tpublic class TransformSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\telement = element.As(\"Fuse.Elements.Element\");\n\n\t\t\tvar snapMin = element.GetBoolean(\"SnapMinTransform\", false);\n\t\t\tvar snapMax = element.GetBoolean(\"SnapMaxTransform\", false);\n\t\t\tvar origin = element.GetEnum(\"TransformOrigin\", TransformOrigin.Center);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tSeparator.Weak,\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\teditors.Dropdown(origin).WithLabel(\"Transform Origin\")\n\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\tSpacer.Medium,\n\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\teditors.Switch(snapMin).WithLabel(\"Snap to Min Transform\"),\n\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\teditors.Switch(snapMax).WithLabel(\"Snap to Max Transform\"),\n\t\t\t\t\t\tSpacer.Medium)\n\t\t\t\t\t.MakeCollapsable(RectangleEdge.Top, element.Is(\"Fuse.Controls.ScrollViewBase\"))\n\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\tRotationSection.Create(element, editors),\n\t\t\t\tSeparator.Weak);\n\t\t}\n\t}\n\n\t// Not really an enum, but from UX it looks like one so this should be fine\n\tenum TransformOrigin\n\t{\n\t\tAnchor,\n\t\tCenter,\n\t\tHorizontalBoxCenter,\n\t\tTopLeft,\n\t\tVerticalBoxCenter,\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced/Visibility.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass VisibilitySection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\telement = element.As(\"Fuse.Elements.Element\");\n\n\t\t\tvar visibility = element.GetEnum(\"Visibility\", Visibility.Visible);\n\t\t\tvar hitTestMode = element.GetEnum(\"HitTestMode\", HitTestMode.None);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tSeparator.Weak,\n\t\t\t\tSpacer.Medium,\n\t\t\t\teditors.Dropdown(visibility).WithLabel(\"Visibility\")\n\t\t\t\t\t.WithInspectorPadding(),\n\t\t\t\tSpacer.Medium,\n\t\t\t\teditors.Dropdown(hitTestMode).WithLabel(\"Hit Test Mode\")\n\t\t\t\t\t.WithInspectorPadding(),\n\t\t\t\tSpacer.Medium,\n\t\t\t\tSeparator.Weak);\n\t\t}\n\t}\n\n\tenum HitTestMode\n\t{\n\t\tNone,\n\t\tLocalVisual,\n\t\tLocalBounds,\n\t\tChildren,\n\t\tLocalVisualAndChildren,\n\t\tLocalBoundsAndChildren,\n\t}\n\n\tenum Visibility\n\t{\n\t\tVisible,\n\t\tHidden,\n\t\tCollapsed\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Advanced.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass AdvancedSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tSeparator.Shadow,\n\t\t\t\tSeparator.Weak,\n\t\t\t\tPane(\"Layout\", editors, e => LayoutSection.Create(element, e)),\n\t\t\t\tPane(\"Size / Position\", editors, e => SizePositionSection.Create(element, e)),\n\t\t\t\tPane(\"Style\", editors, e => StyleSection.Create(element, e)),\n\t\t\t\tPane(\"Transform\", editors, e => TransformSection.Create(element, e)),\n\t\t\t\tPane(\"Visibility\", editors, e => VisibilitySection.Create(element, e)),\n\t\t\t\tPane(\"Attributes\", editors, e => AttributesSection.Create(element, e), collapse: element.SimulatorId));\n\t\t}\n\n\t\tstatic IControl Pane(string name, IEditorFactory editorFactory, Func<IEditorFactory, IControl> content, IObservable<object> collapse)\n\t\t{\n\t\t\treturn Pane(name, editorFactory, content, lazy: true,\n\t\t\t\t// Create a new backing store for expanded value each time collapse emits a value\n\t\t\t\texpanded: collapse\n\t\t\t\t\t.Select(_ => Property.Create(false))\n\t\t\t\t\t.Switch());\n\t\t}\n\n\t\tstatic IControl Pane(string name, IEditorFactory editorFactory, Func<IEditorFactory, IControl> content)\n\t\t{\n\t\t\treturn Pane(name, editorFactory, content, lazy: false,\n\t\t\t\t// Store expanded state as \"Expand <name>\" : \"true\", remove from settings when false\n\t\t\t\texpanded: UserSettings\n\t\t\t\t\t.Bool(\"Expand \" + name)\n\t\t\t\t\t.OrFalse());\n\t\t}\n\n\t\tstatic IControl Pane(string name, IEditorFactory editorFactory, Func<IEditorFactory, IControl> content, bool lazy, IProperty<bool> expanded)\n\t\t{\n\t\t\tvar attributes = new AttributeIntercepter(editorFactory);\n\n\t\t\tvar labelColor = lazy\n\t\t\t\t? Theme.DefaultText\n\t\t\t\t: attributes.AllReadOnly\n\t\t\t\t\t.Select(r => r ? Theme.DisabledText : Theme.DefaultText)\n\t\t\t\t\t.Switch();\n\n\t\t\tvar height = new Points(31);\n\n\t\t\tvar label = Label.Create(name, font: Theme.DefaultFontBold, color: labelColor)\n\t\t\t\t.CenterVertically();\n\n\t\t\tvar expandedArrow = Arrow.WithoutShaft(RectangleEdge.Bottom, SymbolSize.Small);\n\t\t\tvar collapsedArrow = Arrow.WithoutShaft(RectangleEdge.Right, SymbolSize.Small);\n\n\t\t\tvar arrow = expanded\n\t\t\t\t.Select(expanded1 => expanded1 ? expandedArrow : collapsedArrow)\n\t\t\t\t.Switch()\n\t\t\t\t.Center()\n\t\t\t\t.WithSize(Size.Create<Points>(13, 13))\n\t\t\t\t.OnMouse(pressed: expanded.Toggle())\n\t\t\t\t.CenterVertically();\n\n\t\t\tvar circle = Shapes.Circle(fill: Theme.Link)\n\t\t\t\t.WithSize(Spacer.Small.DesiredSize)\n\t\t\t\t.CenterVertically()\n\t\t\t\t.ShowWhen(attributes.AnyHasValue);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tButton.Create(\n\t\t\t\t\tclicked: expanded.Toggle(),\n\t\t\t\t\tcontent: s =>\n\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t.Left(label)\n\t\t\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t\t\t.Left(\n\t\t\t\t\t\t\t\tcircle\n\t\t\t\t\t\t\t\t\t.WithHeight(height)\n\t\t\t\t\t\t\t\t\t.MakeCollapsable(RectangleEdge.Top, expanded.IsFalse(), lazy: false)\n\t\t\t\t\t\t\t\t\t.DockBottom())\n\t\t\t\t\t\t\t.Right(arrow)\n\t\t\t\t\t\t\t.Fill()\n\t\t\t\t\t\t\t.WithHeight(height)\n\t\t\t\t\t\t\t.WithInspectorPadding()),\n\t\t\t\tSeparator.Medium,\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\tcontent(attributes),\n\t\t\t\t\tSeparator.Medium)\n\t\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, expanded, lazy: lazy, unrootWhenCollapsed: lazy));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/Circle.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass CircleSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar startAngleRadians = element.GetAngle(\"StartAngle\", 0.0);\n\t\t\tvar startAngleDegrees = element.GetAngle(\"StartAngleDegrees\", 0.0);\n\n\t\t\tvar endAngleRadians = element.GetAngle(\"EndAngle\", 0.0);\n\t\t\tvar endAngleDegrees = element.GetAngle(\"EndAngleDegrees\", 0.0);\n\t\t\t//var endAngle = endAngleRadians.Or(endAngleDegrees);\n\n\t\t\tvar lengthAngleRadians = element.GetAngle(\"LengthAngle\", 0.0);\n\t\t\tvar lengthAngleDegrees = element.GetAngle(\"LengthAngleDegrees\", 0.0);\n\t\t\t//var lengthAngle = lengthAngleRadians.Or(lengthAngleDegrees);\n\n\t\t\t//lengthAngleRadians = lengthAngleRadians.And(endAngle.IsNotSet);\n\t\t\t//lengthAngleDegrees = lengthAngleDegrees.And(endAngle.IsNotSet);\n\t\t\t//lengthAngle = lengthAngle.And(endAngle.IsNotSet);\n\n\t\t\t//endAngleRadians = endAngleRadians.And(lengthAngle.IsNotSet);\n\t\t\t//endAngleDegrees = endAngleDegrees.And(lengthAngle.IsNotSet);\n\t\t\t//endAngle = endAngle.And(lengthAngle.IsNotSet);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Small,\n\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Right(editors.Label(\"Degrees\", startAngleDegrees).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t\t.Right(editors.Label(\"Radians\", startAngleRadians).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Fill().WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Smaller,\n\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(editors.Label(\"Start Angle\", startAngleRadians))\n\t\t\t\t\t\t.Right(editors.Field(startAngleDegrees).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t\t.Right(editors.Field(startAngleRadians).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Fill().WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Small,\n\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(editors.Label(\"End Angle\", endAngleRadians))\n\t\t\t\t\t\t.Right(editors.Field(endAngleDegrees).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t\t.Right(editors.Field(endAngleRadians).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Fill().WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Small,\n\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(editors.Label(\"Length Angle\", lengthAngleRadians))\n\t\t\t\t\t\t.Right(editors.Field(lengthAngleDegrees).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t\t.Right(editors.Field(lengthAngleRadians).WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.Fill().WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.Circle\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/Each.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass EachSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar items = element.GetString(\"Items\", \"\");\n\t\t\tvar count = element.GetDouble(\"Count\", 0);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\teditors.Field(items).WithLabelAbove(\"Items\"),\n\t\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\t\teditors.Field(count).WithLabelAbove(\"Count\"))\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Reactive.Each\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/Grid.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass GridSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar spacing = element.GetPoints(\"CellSpacing\", 0.0);\n\t\t\tvar order = element.GetEnum(\"ChildOrder\", GridChildOrder.RowMajor);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\teditors.Field(spacing).WithLabelAbove(\"Cell Spacing\"),\n\t\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\t\teditors.Dropdown(order).WithLabelAbove(\"Child Order\"))\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium, Separator.Weak, Spacer.Medium,\n\n\t\t\t\t\tDimension(element, editors, \"Row\"),\n\n\t\t\t\t\tSpacer.Medium, Separator.Weak, Spacer.Medium,\n\n\t\t\t\t\tDimension(element, editors, \"Column\"),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.Grid\"));\n\t\t}\n\n\t\tstatic IControl Dimension(IElement element, IEditorFactory editors, string name)\n\t\t{\n\t\t\tvar plural = name + \"s\";\n\t\t\tvar p = element.GetString(plural, \"\");\n\t\t\tvar count = element.GetString(name + \"Count\", \"\");\n\t\t\tvar def = element.GetString(\"Default\" + name, \"\");\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Right(editors.Field(def)\n\t\t\t\t\t\t.WithLabelAbove(\"Default\")\n\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t.Right(editors.Field(count)\n\t\t\t\t\t\t.WithLabelAbove(\"Count\")\n\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t.Fill(editors.Field(p).WithLabelAbove(plural))\n\t\t\t\t\t.WithInspectorPadding());\n\t\t}\n\t}\n\n\tenum GridChildOrder\n\t{\n\t\tRowMajor,\n\t\tColumnMajor,\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/Image.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass ImageSection\n\t{\n\t\tpublic static IControl Create(IProject project, IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar file = element.GetString(\"File\", \"\");\n\t\t\tvar stretchMode = element.GetEnum(\"StretchMode\", StretchMode.Uniform);\n\n\t\t\tvar stretchDirection = element.GetEnum(\"StretchDirection\", StretchDirection.Both);\n\t\t\tvar stretchSizing = element.GetEnum(\"StretchSizing\", StretchSizing.Zero);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\teditors.FilePath(\n\t\t\t\t\t\t\tattribute: file,\n\t\t\t\t\t\t\tprojectRoot: project.RootDirectory,\n\t\t\t\t\t\t\tfileFilters: new[] { new FileFilter(\"Image Files\", \".png\", \".jpg\", \".jpeg\")  },\n\t\t\t\t\t\t\tplaceholderText: \"Path to image file\")\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\teditors.Dropdown(stretchMode)\n\t\t\t\t\t\t.WithLabel(\"Stretch Mode\")\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(editors.Dropdown(stretchDirection).WithLabelAbove(\"Stretch Direction\"))\n\t\t\t\t\t\t.Right(editors.Dropdown(stretchSizing).WithLabelAbove(\"Stretch Sizing\"))\n\t\t\t\t\t\t.Fill().WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.Image\"));\n\t\t}\n\t}\n\n\tenum StretchMode\n\t{\n\t\tPointPrecise,\n\t\tPixelPrecise,\n\t\tPointPrefer,\n\t\tFill,\n\t\tScale9,\n\t\tUniform,\n\t\tUniformToFill,\n\t}\n\n\tenum StretchDirection\n\t{\n\t\tBoth,\n\t\tUpOnly,\n\t\tDownOnly,\n\t}\n\n\tenum StretchSizing\n\t{\n\t\tZero,\n\t\tNatural,\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/ScrollView.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass ScrollViewSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar scrollDirection = element.GetEnum(\"AllowedScrollDirections\", ScrollDirections.Vertical);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\teditors.Dropdown(scrollDirection)\n\t\t\t\t\t\t.WithLabel(\"Scroll Direction\")\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.ScrollView\"));\n\t\t}\n\t}\n\n\tpublic enum ScrollDirections\n\t{\n\t\tLeft,\n\t\tRight,\n\t\tUp,\n\t\tDown,\n\t\tHorizontal,\n\t\tVertical,\n\t\tBoth,\n\t\tAll\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/StackPanel.cs",
    "content": "﻿using Outracks.Fuse.Studio.Inspector;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass StackPanelSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar orientation = element.GetEnum(\"Orientation\", Orientation.Vertical);\n\t\t\tvar itemSpacing = element.GetDouble(\"ItemSpacing\", 0.0);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\teditors.RadioButton(orientation)\n\t\t\t\t\t\t\t\t.Option(Orientation.Horizontal, (fg, bg) => StackIcon.Create(Axis2D.Horizontal, fg), \"Orientation: Horizontal\")\n\t\t\t\t\t\t\t\t.Option(Orientation.Vertical, (fg, bg) => StackIcon.Create(Axis2D.Vertical, fg), \"Orientation: Vertical\")\n\t\t\t\t\t\t\t\t.Control.WithLabel(\"Orientation\"),\n\t\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\t\teditors.Label(\"Item Spacing\", itemSpacing),\n\t\t\t\t\t\t\teditors.Field(itemSpacing)\n\t\t\t\t\t\t\t\t.WithWidth(CellLayout.HalfCellWidth))\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.StackPanel\"));\n\t\t}\n\t}\n\tpublic enum Orientation\n\t{\n\t\tHorizontal,\n\t\tVertical\n\t}\n\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/Text.cs",
    "content": "﻿using System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio.Inspector;\nusing Outracks.Fuse.Inspector.Editors;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass TextSection\n\t{\n\t\tpublic static IControl Create(IProject project, IElement element, IEditorFactory editors)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\tCreateEditors(project, element, editors).WithInspectorPadding(),\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.TextControl\"));\n\t\t}\n\n\t\tpublic static IControl CreateEditors(IProject project, IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar value = Value(element);\n\t\t\tvar font = element.GetString(\"Font\", \"\");\n\t\t\tvar fontSize = element.GetPoints(\"FontSize\", 16);\n\t\t\tvar textAlignment = element.GetEnum(\"TextAlignment\", TextAlignment.Left);\n\t\t\tvar lineSpacing = element.GetPoints(\"LineSpacing\", 16);\n\t\t\tvar textWrapping = element.GetEnum(\"TextWrapping\", TextWrapping.NoWrap);\n\t\t\tvar textColor = element.GetColor(\"TextColor\", new Color(0, 0, 0, 1));\n\n\t\t\tvar fonts = project.GlobalElements\n\t\t\t\t.Where(e => e.Is(\"Fuse.Font\"))\n\t\t\t\t.SelectPerElement(e => e.UxGlobal().NotNone())\n\t\t\t\t.ToObservableEnumerable();\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\teditors.Field(value, placeholderText: \"Add Text Value here\").SetToolTip(\"Text value\"),\n\t\t\t\tSpacer.Medium,\n\t\t\t\tDropdownEditor.Create(font, fonts.Select(f => f.ToArray()), editors, placeholderText: \"Add Font here\").SetToolTip(\"Font\"),\n\t\t\t\tSpacer.Medium,\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.Color(textColor).WithWidth(new Points(100)).SetToolTip(\"Text color\"))\n\t\t\t\t\t.Right(editors.Field(lineSpacing).WithIcon(\"Line spacing\", Icons.LineSpacing()).WithWidth(new Points(70)))\n\t\t\t\t\t.Fill(editors.Field(fontSize).WithIcon(\"Font size\", Icons.FontSize()).WithWidth(new Points(70)).Center()),\n\t\t\t\tSpacer.Medium,\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Left(editors.RadioButton(textWrapping)\n\t\t\t\t\t\t.Option(TextWrapping.NoWrap, (fg, bg) => Icons.NoWrap(fg), \"Do not wrap text at end of line\")\n\t\t\t\t\t\t.Option(TextWrapping.Wrap, (fg, bg) => Icons.Wrap(fg), \"Wrap text at end of line\")\n\t\t\t\t\t\t.Control.CenterHorizontally())\n\t\t\t\t\t.Right(editors.RadioButton(textAlignment)\n\t\t\t\t\t\t.Option(TextAlignment.Left, (fg, bg) => TextAlignmentIcon.Create(TextAlignment.Left, fg), \"Text alignment: Left\")\n\t\t\t\t\t\t.Option(TextAlignment.Center, (fg, bg) => TextAlignmentIcon.Create(TextAlignment.Center, fg), \"Text alignment: Center\")\n\t\t\t\t\t\t.Option(TextAlignment.Right, (fg, bg) => TextAlignmentIcon.Create(TextAlignment.Right, fg), \"Text alignment: Right\")\n\t\t\t\t\t\t.Control.CenterHorizontally())\n\t\t\t\t\t.Fill());\n\t\t}\n\n\t\tpublic static IAttribute<string> Value(IElement element)\n\t\t{\n\t\t\tvar valueFromAttribute = element[\"Value\"];\n\t\t\tvar valueFromContent = element.Content;\n\n\t\t\treturn valueFromContent\n\t\t\t\t.Select(contentValue =>\n\t\t\t\t\tcontentValue.HasValue\n\t\t\t\t\t\t? valueFromContent\n\t\t\t\t\t\t: valueFromAttribute)\n\t\t\t\t.Switch()\n\t\t\t\t.Convert(s => Parsed.Success(s, s), s => s, \"\");\n\n\t\t}\n\t}\n\n\tpublic enum TextTruncation\n\t{\n\t\tStandard,\n\t\tNone,\n\t}\n\n\tpublic enum TextWrapping\n\t{\n\t\tNoWrap,\n\t\tWrap,\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/TextInput.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass TextInputSection\n\t{\n\t\tpublic static IControl Create(IProject project, IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar placeholder = element.GetString(\"PlaceholderText\", \"\");\n\t\t\tvar placeholdercolor = element.GetColor(\"PlaceholderColor\", Color.Black);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\tTextSection.CreateEditors(project, element, editors)\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\teditors.Field(placeholder)\n\t\t\t\t\t\t.WithLabel(\"Placeholder\")\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium,\n\n\t\t\t\t\teditors.Color(placeholdercolor)\n\t\t\t\t\t\t.WithLabel(\"Placeholder Color\")\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.TextInput\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common/WrapPanel.cs",
    "content": "﻿using Outracks.Fuse.Studio.Inspector;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass WrapPanelSection\n\t{\n\t\tpublic static IControl Create(IElement element, IEditorFactory editors)\n\t\t{\n\t\t\tvar orientation = element.GetEnum(\"Orientation\", Orientation.Vertical);\n\t\t\tvar flowDirection = element.GetEnum(\"FlowDirection\", FlowDirection.LeftToRight);\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\tSpacer.Small,\n\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\teditors.RadioButton(orientation)\n\t\t\t\t\t\t\t.Option(Orientation.Horizontal, (fg, bg) => StackIcon.Create(Axis2D.Horizontal, fg), \"Orientation: Horizontal\")\n\t\t\t\t\t\t\t.Option(Orientation.Vertical, (fg, bg) => StackIcon.Create(Axis2D.Vertical, fg), \"Orientation: Vertical\")\n\t\t\t\t\t\t\t.Control.WithLabelAbove(\"Orientation\"),\n\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\teditors.Dropdown(flowDirection)\n\t\t\t\t\t\t\t.WithLabelAbove(\"Flow Direction\"))\n\t\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\t\tSpacer.Medium)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Bottom, element.Is(\"Fuse.Controls.WrapPanel\"));\n\t\t}\n\t}\n\n\tenum FlowDirection\n\t{\n\t\tLeftToRight,\n\t\tRightToLeft,\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Inspector/Sections/Common.cs",
    "content": "﻿using System;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Inspector.Sections\n{\n\tclass CommonSection\n\t{\n\t\tpublic static IControl Create(IElement element, IProject project, IEditorFactory editors, IPopover popover)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tpopover.CreatePopover(RectangleEdge.Bottom,\n\t\t\t\t\tdialog => Button.Create(\n\t\t\t\t\t\tdialog.IsVisible.Toggle(),\n\t\t\t\t\t\tstate => Layout.StackFromTop(\n\t\t\t\t\t\t\tSpacer.Medium,\n\t\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\t\telement.MediumIcon(Theme.Link, Theme.IconSecondary)\n\t\t\t\t\t\t\t\t\t\t.CenterVertically(),\n\t\t\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\t\t\tLabel.Create(element.Name.AsText(), color: Theme.DefaultText, font: Theme.HeaderFont)\n\t\t\t\t\t\t\t\t\t\t.CenterVertically(),\n\t\t\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\t\t\t\t\t\tArrow.WithoutShaft(RectangleEdge.Top, SymbolSize.Small),\n\t\t\t\t\t\t\t\t\t\t\tSpacer.Smaller,\n\t\t\t\t\t\t\t\t\t\t\tArrow.WithoutShaft(RectangleEdge.Bottom, SymbolSize.Small))\n\t\t\t\t\t\t\t\t\t\t.CenterVertically())\n\t\t\t\t\t\t\t\t.CenterHorizontally(),\n\t\t\t\t\t\t\tSpacer.Medium)),\n\t\t\t\t\tdialog =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar result = Layout.Dock()\n\t\t\t\t\t\t\t.Bottom(Button.Create(Command.Enabled(() => dialog.IsVisible.OnNext(false)), bs =>\n\t\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t\t.Left(Icons.Confirm(Theme.Link).CenterVertically())\n\t\t\t\t\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t\t\t\t\t.Fill(Theme.Header(\"Done\"))\n\t\t\t\t\t\t\t\t\t.Center()\n\t\t\t\t\t\t\t\t\t.WithHeight(30)))\n\t\t\t\t\t\t\t.Bottom(Separator.Medium)\n\t\t\t\t\t\t\t.Top(Spacer.Medium)\n\t\t\t\t\t\t\t.Top(Label.Create(text: \"Replace element\", textAlignment: TextAlignment.Center, font: Theme.DefaultFont, color: Theme.DefaultText))\n\t\t\t\t\t\t\t.Top(Spacer.Small)\n\t\t\t\t\t\t\t.Top(Label.Create(text: \"Enter a new element type to replace \\n the current element type\", textAlignment: TextAlignment.Center, font: Theme.DescriptorFont, color: Theme.DescriptorText))\n\t\t\t\t\t\t\t.Top(Spacer.Medium)\n\t\t\t\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t\t\t\t.Right(Spacer.Medium)\n\t\t\t\t\t\t\t.Bottom(Spacer.Medium)\n\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\t\tTextBox.Create(\n\t\t\t\t\t\t\t\t\ttext: element.Name.Deferred(),\n\t\t\t\t\t\t\t\t\tforegroundColor: Theme.DefaultText)\n\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(1))\n\t\t\t\t\t\t\t\t.WithBackground(Theme.FieldBackground)\n\t\t\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Theme.FieldStroke)))\n\t\t\t\t\t\t\t.WithWidth(279);\n\n\t\t\t\t\t\tvar elementChanged = element.SimulatorId;\n\t\t\t\t\t\telementChanged.ConnectWhile(result.IsRooted).Subscribe(id => dialog.IsVisible.OnNext(false));\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}),\n\n\t\t\t\tSeparator.Weak, Spacer.Medium,\n\n\t\t\t\teditors.NameRow(\"Instance Name\", element.UxName(), deferEdit: true)\n\t\t\t\t\t.WithInspectorPadding(),\n\n\t\t\t\tSpacer.Medium, Separator.Weak,\n\n\t\t\t\tContextualSections(element, project, editors));\n\t\t}\n\n\t\tpublic static IControl ContextualSections(IElement element, IProject project, IEditorFactory editors)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tCircleSection.Create(element, editors),\n\t\t\t\tEachSection.Create(element, editors),\n\t\t\t\tGridSection.Create(element, editors),\n\t\t\t\tImageSection.Create(project, element, editors),\n\t\t\t\tScrollViewSection.Create(element, editors),\n\t\t\t\tStackPanelSection.Create(element, editors),\n\t\t\t\tTextSection.Create(project, element, editors),\n\t\t\t\tTextInputSection.Create(project, element, editors),\n\t\t\t\tWrapPanelSection.Create(element, editors));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/LogView/ErrorView.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Fuse.Preview;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass DiagnosticHeuristicComparer : IEqualityComparer<Diagnostic>\n\t{\n\t\tpublic bool Equals(Diagnostic x, Diagnostic y)\n\t\t{\n\t\t\tif (ReferenceEquals(x, y))\n\t\t\t\treturn true;\n\n\t\t\tif (ReferenceEquals(x, null) || ReferenceEquals(y, null))\n\t\t\t\treturn false;\n\n\t\t\treturn x.Message == y.Message\n\t\t\t\t&& x.SourceFile == y.SourceFile\n\t\t\t\t&& x.Type == y.Type\n\t\t\t\t&& x.Details == y.Details\n\t\t\t\t&& x.LineNumber == y.LineNumber\n\t\t\t\t&& x.ColumnNumber == y.ColumnNumber;\n\t\t}\n\n\t\tpublic int GetHashCode(Diagnostic obj)\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tvar hashCode = obj.Message != null ? obj.Message.GetHashCode() : 0;\n\t\t\t\thashCode = (hashCode * 397) ^ (obj.SourceFile != null ? obj.SourceFile.GetHashCode() : 0);\n\t\t\t\thashCode = (hashCode * 397) ^ (obj.Details != null ? obj.Details.GetHashCode() : 0);\n\t\t\t\thashCode = (hashCode * 397) ^ obj.Type.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ obj.LineNumber.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ obj.ColumnNumber.GetHashCode();\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class ErrorView : IDisposable\n\t{\n\t\treadonly IObservable<AbsoluteFilePath> _projectFile;\n\t\treadonly IMessagingService _daemon;\n\t\treadonly BehaviorSubject<ImmutableList<Diagnostic>> _diagnostics = new BehaviorSubject<ImmutableList<Diagnostic>>(ImmutableList<Diagnostic>.Empty);\n\t\treadonly IDisposable _disposables;\n\t\treadonly IObservableList<BuildIssueDetected> _errorMessages;\n\t\tpublic readonly IObservable<bool> NotifyUser;\n\n\t\tpublic ErrorView(\n\t\t\tIObservable<IBinaryMessage> simulatorMessages,\n\t\t\tIObservable<AbsoluteFilePath> projectFile,\n\t\t\tIMessagingService daemon,\n\t\t\tIObservable<string> serverClientRemoved)\n\t\t{\n\t\t\t_projectFile = projectFile;\n\t\t\t_daemon = daemon;\n\t\t\tvar diagnosticsStream = simulatorMessages.TryParse(Diagnostic.MessageType, Diagnostic.ReadDataFrom);\n\t\t\tvar dismissDiagnosticsStream = simulatorMessages.TryParse(DismissDiagnostic.MessageType, DismissDiagnostic.ReadDataFrom);\n\n\n\t\t\tvar buildIssues = ErrorMessageListener.ListenForBuildErrors(\n\t\t\t\t\tsimulatorMessages.TryParse(Started.MessageType, Started.ReadDataFrom),\n\t\t\t\t\tsimulatorMessages.TryParse(BuildIssueDetected.MessageType, BuildIssueDetected.ReadDataFrom),\n\t\t\t\t\tout _errorMessages);\n\n\t\t\tNotifyUser = _diagnostics\n\t\t\t\t.Throttle(TimeSpan.FromMilliseconds(100))\n\t\t\t\t.DistinctUntilSetChanged()\n\t\t\t\t.Select(l => l.IsEmpty() == false);\n\n\t\t\t_disposables = Disposable.Combine(\n\t\t\t\tdiagnosticsStream.Subscribe(\n\t\t\t\t\td => _diagnostics.OnNext(_diagnostics.Value.Add(d))), // Add diagnostics\n\t\t\t\tdismissDiagnosticsStream.Subscribe(\n\t\t\t\t\td => _diagnostics.OnNext(_diagnostics.Value.RemoveAll(a => a.DiagnosticId == d.DiagnosticId && a.DeviceId == d.DeviceId))), // Remove diagnostics based on diagnostic id\n\t\t\t\tserverClientRemoved.Subscribe(\n\t\t\t\t\tclientRemoved => _diagnostics.OnNext(_diagnostics.Value.RemoveAll(a => a.DeviceId == clientRemoved))), // Remove diagnostics when clients disconnect\n\t\t\t\tbuildIssues);\n\t\t}\n\n\t\t/*TODO: Currently we don't get the syntax errors from JS files going through ES6 transpiler. Not sure how to get access to them.*/\n\t\tpublic IControl Create()\n\t\t{\n\t\t\tvar buildErrorItems =\n\t\t\t\t_errorMessages.Select(MapBuildIssue);\n\n\t\t\tvar diagnosticErrorItems =\n\t\t\t\t_diagnostics.ObserveOn(Application.MainThread)\n\t\t\t\t\t.CombineLatest(\n\t\t\t\t\t\t_projectFile,\n\t\t\t\t\t\t(items, projFile) => items.Distinct(new DiagnosticHeuristicComparer()).Select(item => MapDiagnostic(item, projFile.ContainingDirectory)).ToImmutableList())\n\t\t\t\t.ToObservableList();\n\n\t\t\tvar combinedErrorItems =\n\t\t\t\tbuildErrorItems.Concat(diagnosticErrorItems);\n\n\t\t\treturn\n\t\t\t\tcombinedErrorItems\n\t\t\t\t\t.ToObservableImmutableList()\n\t\t\t\t\t.Throttle(TimeSpan.FromMilliseconds(100)) // To accommodate for when errors shortly disappear and then reappear\n\t\t\t\t\t.ObserveOn(Application.MainThread)\n\t\t\t\t\t.CachePerElement(CreateItemRow).StackFromTop()\n\t\t\t\t.WithPadding(new Thickness<Points>(10, 10))\n\t\t\t\t.MakeScrollable(darkTheme: Theme.IsDark);\n\t\t}\n\n\t\tIControl CreateItemRow(ErrorItem e)\n\t\t{\n\t\t\tvar locateInEditor = Command.Create(_projectFile.Select(\n\t\t\t\tprojFile => e.Source.Select(\n\t\t\t\t\tsource =>\n\t\t\t\t\t{\n\t\t\t\t\t\treturn (Action) (() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar request = new FocusEditorRequest()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tColumn = source.Column,\n\t\t\t\t\t\t\t\tLine = source.Line,\n\t\t\t\t\t\t\t\tFile = source.File.NativePath,\n\t\t\t\t\t\t\t\tProject = projFile.NativePath\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tFocusEditorCommand.SendRequest(_daemon, request);\n\t\t\t\t\t\t});\n\t\t\t\t\t})));\n\n\t\t\tvar tags =\n\t\t\t\tLayout.StackFromLeft(e.Tags.Select(\n\t\t\t\t\ttag => Layout.StackFromLeft(\n\t\t\t\t\t\tLabel.Create(tag.Name, font: Theme.DefaultFontBold)\n\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(4, 2))\n\t\t\t\t\t\t\t.WithBackground(\n\t\t\t\t\t\t\t\tShapes.Rectangle(fill: tag.Brush, cornerRadius: Observable.Return(new CornerRadius(10))))).WithPadding(right: new Points(4.0))));\n\n\t\t\tvar lineInfoControl = _projectFile.Select(projFile =>  e.Source.Select(\n\t\t\t\tsource =>\n\t\t\t\t{\n\t\t\t\t\treturn Layout.StackFromLeft(\n\t\t\t\t\t\tControl.Empty.WithWidth(16),\n\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\tLabel.Create(\"File: \", color: Theme.DescriptorText).CenterVertically(),\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\tsource.File.RelativeTo(projFile.ContainingDirectory).NativeRelativePath,\n\t\t\t\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\t\t\t\tlineBreakMode: LineBreakMode.TruncateHead)\n\t\t\t\t\t\t\t\t.CenterVertically().WithWidth(200)),\n\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\tLabel.Create(\"Line: \", color: Theme.DescriptorText).CenterVertically(),\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\tsource.Line.ToString() + \" : \" + source.Column.ToString(),\n\t\t\t\t\t\t\t\tcolor: Theme.DefaultText).CenterVertically(),\n\t\t\t\t\t\t\tButton.Create(\n\t\t\t\t\t\t\t\tclicked: locateInEditor,\n\t\t\t\t\t\t\t\tcontent: states =>\n\t\t\t\t\t\t\t\t\tLabel.Create(\"Locate\", color: Theme.Link)).WithPadding(new Thickness<Points>(10, 0)).CenterVertically()),\n\t\t\t\t\t\tControl.Empty.WithWidth(8));\n\t\t\t\t}).Or(() => Control.Empty));\n\n\t\t\treturn Layout.StackFromLeft(Layout.StackFromTop(\n\t\t\t\tControl.Empty.WithHeight(8),\n\t\t\t\tLabel.Create(\n\t\t\t\t\te.Title,\n\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t//lineBreakMode: LineBreakMode.Wrap,\n\t\t\t\t\tfont: Font.SystemDefault(Observable.Return(19.0))).CenterVertically(),\n\t\t\t\tControl.Empty.WithHeight(16),\n\t\t\t\tLayout.StackFromLeft(tags, lineInfoControl.Switch()),\n\t\t\t\tControl.Empty.WithHeight(8),\n\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\tLabel.Create(e.Message, lineBreakMode: LineBreakMode.Wrap, color: Theme.DescriptorText)\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(10, 20))).WithBackground(\n\t\t\t\t\tShapes.Rectangle(fill: Theme.FaintBackground, cornerRadius: Observable.Return(new CornerRadius(2))))));\n\t\t}\n\n\t\tErrorItem MapDiagnostic(Diagnostic diagnostic, AbsoluteDirectoryPath root)\n\t\t{\n\t\t\tvar sourceInfo =\n\t\t\t\tdiagnostic.SourceFile.ToOptional()\n\t\t\t\t\t.Where(sourceFile => !string.IsNullOrWhiteSpace(sourceFile))\n\t\t\t\t\t.Select(\n\t\t\t\t\t\tsourceFile => new ErrorSourceInfo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tColumn = diagnostic.ColumnNumber,\n\t\t\t\t\t\t\tLine = diagnostic.LineNumber,\n\t\t\t\t\t\t\tFile = FilePath.ParseAndMakeAbsolute(sourceFile, root)\n\t\t\t\t\t\t});\n\n\t\t\treturn new ErrorItem\n\t\t\t{\n\t\t\t\tMessage = diagnostic.Details,\n\t\t\t\tSource = sourceInfo,\n\t\t\t\tTags = new[]\n\t\t\t\t{\n\t\t\t\t\tnew ErrorTag { Brush = Theme.NotificationBarBackground, Name = \"JS\" },\n\t\t\t\t\tnew ErrorTag { Brush = Theme.ReifyBarBackground, Name = \"UX\" }\n\t\t\t\t},\n\t\t\t\tTitle = diagnostic.Message\n\t\t\t};\n\t\t}\n\n\t\tErrorItem MapBuildIssue(BuildIssueDetected buildIssue)\n\t\t{\n\t\t\tvar source = buildIssue.Source\n\t\t\t\t.Select(\n\t\t\t\t\ts => s.Location.Select(\n\t\t\t\t\t\tloc => new ErrorSourceInfo { Column = loc.Character, Line = loc.Line, File = AbsoluteFilePath.Parse(s.File) }))\n\t\t\t\t.SelectMany(x => x);\n\n\t\t\treturn new ErrorItem\n\t\t\t{\n\t\t\t\tMessage = buildIssue.Message,\n\t\t\t\tSource = source,\n\t\t\t\tTags = new[] { new ErrorTag { Brush = Theme.ErrorColor, Name = \"Build\" } },\n\t\t\t\tTitle =  buildIssue.Message.Contains(\" Line\") ? buildIssue.Message.BeforeFirst(\" Line\") : buildIssue.Message\n\t\t\t};\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_disposables.Dispose();\n\t\t\t_diagnostics.Dispose();\n\t\t}\n\n\t\tstatic class ErrorMessageListener\n\t\t{\n\t\t\tpublic static IDisposable ListenForBuildErrors(IObservable<Started> buildStarted, IObservable<BuildIssueDetected> issuesDetected, out IObservableList<BuildIssueDetected> issues)\n\t\t\t{\n\t\t\t\tvar errors = new ListBehaviorSubject<BuildIssueDetected>();\n\t\t\t\tissues = errors;\n\n\t\t\t\treturn Disposable.Combine(\n\t\t\t\t\tbuildStarted.Select(b => BinaryMessage.TryParse(b.Command, BuildProject.MessageType, BuildProject.ReadDataFrom))\n\t\t\t\t\t\t.NotNone()\n\t\t\t\t\t\t.Subscribe(_ => errors.OnClear()),\n\n\t\t\t\t\tbuildStarted.Select(b => BinaryMessage.TryParse(b.Command, GenerateBytecode.MessageType, GenerateBytecode.ReadDataFrom))\n\t\t\t\t\t\t.NotNone()\n\t\t\t\t\t\t.Subscribe(_ => errors.OnClear()),\n\n\t\t\t\t\tissuesDetected.Subscribe(\n\t\t\t\t\t\tissue =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrors.OnAdd(issue);\n\t\t\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\n\t\tclass ErrorSourceInfo\n\t\t{\n\t\t\tpublic int Column { get; set; }\n\t\t\tpublic int Line { get; set; }\n\t\t\tpublic AbsoluteFilePath File { get; set; }\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tvar info = obj as ErrorSourceInfo;\n\t\t\t\treturn info != null &&\n\t\t\t\t\t   Column == info.Column &&\n\t\t\t\t\t   Line == info.Line &&\n\t\t\t\t\t   EqualityComparer<AbsoluteFilePath>.Default.Equals(File, info.File);\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\tvar hashCode = 1944568825;\n\t\t\t\thashCode = hashCode * -1521134295 + Column.GetHashCode();\n\t\t\t\thashCode = hashCode * -1521134295 + Line.GetHashCode();\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<AbsoluteFilePath>.Default.GetHashCode(File);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tclass ErrorTag\n\t\t{\n\t\t\tpublic Brush Brush { get; set; }\n\t\t\tpublic string Name { get; set; }\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tvar tag = obj as ErrorTag;\n\t\t\t\treturn tag != null &&\n\t\t\t\t\t   EqualityComparer<Brush>.Default.Equals(Brush, tag.Brush) &&\n\t\t\t\t\t   Name == tag.Name;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\tvar hashCode = -534460015;\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<Brush>.Default.GetHashCode(Brush);\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tclass ErrorItem\n\t\t{\n\t\t\tpublic IReadOnlyList<ErrorTag> Tags { get; set; }\n\t\t\tpublic Optional<ErrorSourceInfo> Source { get; set; }\n\t\t\tpublic string Title { get; set; }\n\t\t\tpublic string Message { get; set; }\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tvar item = obj as ErrorItem;\n\t\t\t\treturn item != null &&\n\t\t\t\t\t   ((Tags != null && item.Tags != null && Tags.SequenceEqual(item.Tags)) || (Tags == null && item.Tags == null)) &&\n\t\t\t\t\t   Source.Equals(item.Source) &&\n\t\t\t\t\t   Title == item.Title &&\n\t\t\t\t\t   Message == item.Message;\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\tvar hashCode = -307112755;\n\t\t\t\tif (Tags != null)\n\t\t\t\t{\n\t\t\t\t\tforeach (var tag in Tags)\n\t\t\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<ErrorTag>.Default.GetHashCode(tag);\n\t\t\t\t}\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<Optional<ErrorSourceInfo>>.Default.GetHashCode(Source);\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Title);\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Message);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/LogView/LogView.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Fuse.Preview;\nusing Outracks.Fusion;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Studio\n{\n\tstatic class LogMessages\n\t{\n\t\tpublic static IObservable<string> ToLogMessages(this IObservable<IBinaryMessage> messages)\n\t\t{\n\t\t\treturn Observable.Merge(\n\t\t\t\tmessages.TryParse(DebugLog.MessageType, DebugLog.ReadDataFrom)\n\t\t\t\t\t.Select(o => { return CreateDebugLogPrefix(o) + o.Message + \"\\n\"; }),\n\t\t\t\t// We won't get fuselibs to not debug_log exceptions, so remove this to avoid duplicates.\n\t\t\t\t// See https://github.com/fusetools/Fuse/issues/2515#issuecomment-259435178\n\t\t\t\t//messages.TryParse(UnhandledException.MessageType, UnhandledException.ReadDataFrom)\n\t\t\t\t//\t.SelectMany(o => o.Message.ConcatOne('\\n')),\n\t\t\t\tmessages.TryParse(BuildLogged.MessageType, BuildLogged.ReadDataFrom)\n\t\t\t\t\t.Select(log => log.Text),\n\t\t\t\tmessages.TryParse(BuildIssueDetected.MessageType, BuildIssueDetected.ReadDataFrom)\n\t\t\t\t\t.Select(issue => issue.ToString()));\n\t\t}\n\n\t\tstatic string CreateDebugLogPrefix(DebugLog o)\n\t\t{\n\t\t\treturn \"[\" + o.DeviceName + \"]\" + \": \";\n\t\t}\n\t}\n\n\tclass LogView\n\t{\n\t\tpublic LogView(IObservable<string> mainLogStream, IObservable<IBinaryMessage> deviceMessages, ErrorView errorView)\n\t\t{\n\t\t\tvar showLog = UserSettings.Bool(\"ShowLog\").OrTrue();\n\n\t\t\tIsExpanded = showLog;\n\n\t\t\tvar logChanged = new Subject<Unit>();\n\t\t\tvar logTab = new LogViewTab(Texts.LogView_Tab_Log, CreateLogView(mainLogStream, deviceMessages, logChanged), logChanged.Select(_ => true));\n\t\t\tvar problemsTab = new LogViewTab(Texts.LogView_Tab_Problems, errorView.Create(), errorView.NotifyUser);\n\n\t\t\tvar activeTab = new BehaviorSubject<LogViewTab>(logTab);\n\t\t\tTabHeader = LogViewHeader.CreateHeader(new[] { logTab, problemsTab }, activeTab, showLog);\n\t\t\tTabContent = activeTab\n\t\t\t\t.Select(tab => tab.Content)\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tstatic IControl CreateLogView(IObservable<string> mainLogStream, IObservable<IBinaryMessage> deviceMessages, ISubject<Unit> changed)\n\t\t{\n// Keep a buffer of 10 tweets from the time before this control was mounted for the first time\n\t\t\tvar bufferedStream = mainLogStream.Replay(10);//10 * 140);\n\t\t\tbufferedStream.Connect();\n\n\t\t\tbufferedStream.Select(_ => Unit.Default).Subscribe(changed);\n\n\t\t\tvar clearLog = new Subject<Unit>();\n\t\t\tvar doClear = Command.Enabled(() => clearLog.OnNext(Unit.Default));\n\t\t\tvar mainLogView = Fusion.LogView.Create(stream: bufferedStream, color: Theme.DefaultText, linkColor: Theme.Link, clear: clearLog, darkTheme: Theme.IsDark)\n\t\t\t\t.WithPadding(new Thickness<Points>(5));\n\t\t\tvar deviceLogs = new List<DeviceLog>();\n\t\t\tvar activeLogView = new BehaviorSubject<IControl>(mainLogView);\n\t\t\tvar activeChanged = new Subject<Unit>();\n\t\t\tvar mainLogButton = CreateLogSelectButton(Texts.LogView_AllOutput, mainLogView, activeLogView, activeChanged, true);\n\t\t\tvar clearButton = Label.Create(Strings.LogView_Tab_Clear, color: Theme.Link)\n\t\t\t\t.OnMouse(pressed: doClear);\n\n\t\t\tvar buttons = new BehaviorSubject<IEnumerable<IControl>>(CreateButtonList(mainLogButton, deviceLogs));\n\n\t\t\tdeviceMessages.TryParse(DebugLog.MessageType, DebugLog.ReadDataFrom).Subscribe(\n\t\t\t\tl =>\n\t\t\t\t{\n\t\t\t\t\tvar device = deviceLogs.FirstOrDefault(d\n\t\t\t\t\t\t=> (d.DeviceId == l.DeviceId)\n\t\t\t\t\t\t|| (d.DeviceName == l.DeviceName && l.DeviceName == \"Viewport\"));\n\n\t\t\t\t\tif (device == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tdevice = new DeviceLog(l.DeviceId, l.DeviceName, activeLogView, activeChanged, clearLog);\n\t\t\t\t\t\tdeviceLogs.Add(device);\n\t\t\t\t\t\tbuttons.OnNext(CreateButtonList(mainLogButton, deviceLogs));\n\t\t\t\t\t}\n\t\t\t\t\tdevice.Write(l.Message);\n\t\t\t\t});\n\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Top(Layout.Dock()\n\t\t\t\t\t.Right(clearButton)\n\t\t\t\t\t.Left(buttons.StackFromLeft())\n\t\t\t\t\t.Fill()\n\t\t\t\t\t.WithPadding(new Thickness<Points>(10)))\n\t\t\t\t.Fill(activeLogView.Switch());\n\t\t}\n\n\t\tpublic static IControl CreateLogSelectButton(Text caption, IControl thisLogView, IObserver<IControl> activeLogView, ISubject<Unit> activeChanged, bool startActive)\n\t\t{\n\t\t\tvar iGotActivated = new Subject<Unit>();\n\t\t\tvar isActive = activeChanged.Select(_ => false).Merge(iGotActivated.Select(_ => true)).StartWith(startActive);\n\t\t\tvar font = Font.SystemDefault(Observable.Return(13.0), isActive);\n\t\t\tvar color = isActive.Select(a => a ? Theme.DefaultText : Theme.DisabledText).Switch();\n\t\t\tvar activateMainLog = Command.Enabled(() =>\n\t\t\t\t{\n\t\t\t\t\tactiveChanged.OnNext(Unit.Default);\n\t\t\t\t\tiGotActivated.OnNext(Unit.Default);\n\t\t\t\t\tactiveLogView.OnNext(thisLogView);\n\t\t\t\t});\n\n\t\t\treturn Label.Create(caption, font: font, color: color)\n\t\t\t\t.OnMouse(pressed: activateMainLog)\n\t\t\t\t.WithPadding(new Thickness<Points>(0, 0, 10, 0));\n\t\t}\n\n\t\tstatic IEnumerable<IControl> CreateButtonList(IControl mainLogButton, IEnumerable<DeviceLog> deviceLogs)\n\t\t{\n\t\t\tvar buttons = new List<IControl> {mainLogButton};\n\t\t\tbuttons.AddRange(deviceLogs.Select(d => d.Activate));\n\t\t\treturn buttons;\n\t\t}\n\n\t\tpublic IProperty<bool> IsExpanded { get; set; }\n\t\tpublic IControl TabHeader { get; set; }\n\t\tpublic IControl TabContent { get; set; }\n\t}\n\n\tclass DeviceLog\n\t{\n\t\tpublic readonly string DeviceId;\n\t\tpublic readonly string DeviceName;\n\t\tpublic readonly IControl Content;\n\t\tpublic readonly IControl Activate;\n\n\t\treadonly ISubject<string> _stream = new ReplayQueueSubject<string>();\n\t\tpublic DeviceLog(string deviceId, string deviceName, IObserver<IControl> activeLogView, ISubject<Unit> activeChanged, IObservable<Unit> clearLog)\n\t\t{\n\t\t\tDeviceId = deviceId;\n\t\t\tDeviceName = deviceName;\n\t\t\tContent = Fusion.LogView.Create(stream: _stream, color: Theme.DefaultText, linkColor: Theme.Link, clear: clearLog, darkTheme: Theme.IsDark)\n\t\t\t\t.WithPadding(new Thickness<Points>(5));\n\t\t\tActivate = LogView.CreateLogSelectButton(DeviceName, Content, activeLogView, activeChanged, false);\n\t\t}\n\n\t\tpublic void Write(string message)\n\t\t{\n\t\t\t_stream.OnNext(message + \"\\n\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/LogView/LogViewHeader.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tstatic class LogViewHeader\n\t{\n\t\tpublic static Points HeaderHeight = 24;\n\n\t\tpublic static IControl CreateHeader(IEnumerable<LogViewTab> tabs, ISubject<LogViewTab> activeTab, IProperty<bool> showLog )\n\t\t{\n\t\t\treturn  Shapes.Rectangle(fill: Theme.PanelBackground)\n\t\t\t\t\t\t.WithOverlay(\n\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t.Left(Layout.StackFromLeft(tabs.Select(tab =>\n\t\t\t\t\t\t\t\tCreateHeaderTitle(\n\t\t\t\t\t\t\t\t\ttab.Title,\n\t\t\t\t\t\t\t\t\tactiveTab.Select(t => t == tab),\n\t\t\t\t\t\t\t\t\tactiveTab.Select(t => t == tab)\n\t\t\t\t\t\t\t\t\t\t.CombineLatest(showLog, (isActive, show) => isActive && show)\n\t\t\t\t\t\t\t\t\t\t.Select(isRead => isRead ? Observable.Return(false) : tab.NotifyUser)\n\t\t\t\t\t\t\t\t\t\t.Switch()\n\t\t\t\t\t\t\t\t\t\t.DistinctUntilChanged(),\n\t\t\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tactiveTab.OnNext(tab);\n\t\t\t\t\t\t\t\t\t\tshowLog.Write(true, save: false);\n\t\t\t\t\t\t\t\t\t}))))\n\t\t\t\t\t\t\t.Right(\n\t\t\t\t\t\t\t\tButton.Create(\n\t\t\t\t\t\t\t\t\tshowLog.Toggle(),\n\t\t\t\t\t\t\t\t\tstates =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\treturn Layout.StackFromTop(\n\t\t\t\t\t\t\t\t\t\t\t\tShapes.Rectangle(fill: Theme.IconBrush)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(20, 1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(0, 2)),\n\t\t\t\t\t\t\t\t\t\t\t\tShapes.Rectangle(fill: Theme.IconBrush)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(20, 1))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(0, 2))\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(0, 0, 15, 0))\n\t\t\t\t\t\t\t\t\t\t\t.Center();\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.Fill()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t.WithHeight(HeaderHeight)\n\t\t\t\t\t\t.DockBottom()\n\n\t\t\t;\n\t\t}\n\n\t\tstatic IControl CreateHeaderTitle(Text title, IObservable<bool> isActive, IObservable<bool> unread, Action pressed)\n\t\t{\n\t\t\tisActive = isActive.StartWith(false);\n\t\t\treturn\n\t\t\t\tButton.Create(Command.Enabled(pressed),\n\t\t\t\t\tcontent: states =>\n\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tfont: Font.SystemDefault(Observable.Return(13.0), isActive),\n\t\t\t\t\t\t\t\tcolor: isActive.Select(active => active ? Theme.DefaultText : Theme.DisabledText).Switch()),\n\t\t\t\t\t\t\tunread.StartWith(false).Select(b => b == false\n\t\t\t\t\t\t\t\t? Control.Empty\n\t\t\t\t\t\t\t\t: Shapes.Circle(fill: Theme.NotificationBrush)\n\t\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(10,10))\n\t\t\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(10,0,0,0))\n\t\t\t\t\t\t\t\t\t.Center())\n\t\t\t\t\t\t\t\t.Switch()\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(30, 0))\n\t\t\t\t\t\t.CenterVertically());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/LogView/LogViewTab.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic class LogViewTab : IDisposable\n\t{\n\t\tpublic readonly Text Title;\n\t\tpublic readonly IControl Content;\n\t\tpublic readonly IObservable<bool> NotifyUser;\n\n\t\treadonly IDisposable _changeSub;\n\n\t\tpublic LogViewTab(Text title, IControl content, IObservable<bool> notifyUser)\n\t\t{\n\t\t\tTitle = title;\n\t\t\tContent = content;\n\t\t\tvar notify = notifyUser.Publish();\n\t\t\tNotifyUser = notify;\n\t\t\t_changeSub = notify.Connect();\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_changeSub.Dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/MainWindow.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fuse.Studio.Icons;\nusing Outracks.Fuse.Stage;\nusing Outracks.Fusion;\nusing Outracks.Diagnostics;\nusing System.Collections.Generic;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic interface IInspectorControl\n\t{\n\t\tIControl Create();\n\t}\n\n\tstatic class MainWindow\n\t{\n\t\tpublic static Points ResizeBorderSize = 2;\n\n\t\tpublic static Window Create(\n\t\t\tIObservable<string> projectName,\n\t\t\tIControl search,\n\t\t\tIControl outline,\n\t\t\tIControl bookmarks,\n\t\t\tStageController stage,\n\t\t\tIControl notifications,\n\t\t\tIControl inspector,\n\t\t\tIControl attributes,\n\t\t\tLogView logview,\n\t\t\tMenu menu,\n\t\t\tCommand closed,\n\t\t\tIProperty<bool> selectionEnabled,\n\t\t\tIObservable<bool> topMost,\n\t\t\tIProperty<Mode> mode,\n\t\t\tCommand mainWindowFocused,\n\t\t\tIContext context,\n\t\t\tCodeView codeView,\n\t\t\tILicense license)\n\t\t{\n\t\t\tIControl topBar = null;\n\n\t\t\tvar newView = stage.NewViewport;\n\n\t\t\tvar content =\n\t\t\t\tPopover.Host(\n\t\t\t\t\tpopover =>\n\t\t\t\t\t{\n\t\t\t\t\t\ttopBar = CreateTopBar(\n\t\t\t\t\t\t\tpopover,\n\t\t\t\t\t\t\tselectionEnabled: selectionEnabled,\n\t\t\t\t\t\t\tmode: mode,\n\t\t\t\t\t\t\taddViewport: newView,\n\t\t\t\t\t\t\tcodeView: codeView,\n\t\t\t\t\t\t\tlicense: license);\n\n\t\t\t\t\t\treturn CreateContent(\n\t\t\t\t\t\t\tlogview: logview,\n\t\t\t\t\t\t\toutline: outline,\n\t\t\t\t\t\t\tsearch: search,\n\t\t\t\t\t\t\tnotifications: notifications,\n\t\t\t\t\t\t\tattributes: attributes,\n\t\t\t\t\t\t\tbookmarks: bookmarks,\n\t\t\t\t\t\t\tinspector: inspector,\n\t\t\t\t\t\t\tstage: new StageView(stage, context, mode),\n\t\t\t\t\t\t\ttopBar: topBar,\n\t\t\t\t\t\t\tmode: mode);\n\t\t\t\t\t});\n\n\t\t\tvar mainWindowSize = UserSettings.Size(\"MainWindowSize\");\n\t\t\tvar mainWindowPosition = UserSettings.Position(\"MainWindowPosition\");\n\t\t\tvar mainWindowState = UserSettings.Settings.Property<WindowState>(\"MainWindowState\");\n\n\t\t\tvar compactSize = UserSettings.Size(\"CompactWindowSize\");\n\t\t\tvar compactPosition = UserSettings.Position(\"CompactWindowPosition\");\n\n\t\t\tvar compactContentSize =\n\t\t\t\tcompactSize.With(value:\n\t\t\t\t\tcompactSize.Merge(\n\t\t\t\t\t\tstage.DefaultViewportSize.Select(Optional.Some)\n\t\t\t\t\t\t\t.CombineLatest(\n\t\t\t\t\t\t\t\ttopBar.DesiredSize.Height,\n\t\t\t\t\t\t\t\t(deviceSize, topBarHeight) =>\n\t\t\t\t\t\t\t\t\tdeviceSize.Select(s =>\n\t\t\t\t\t\t\t\t\t\tSize.Create(\n\t\t\t\t\t\t\t\t\t\t\ts.Width + ResizeBorderSize * 2 /* padding */,\n\t\t\t\t\t\t\t\t\t\t\ts.Height + topBarHeight + ResizeBorderSize * 2 + LogViewHeader.HeaderHeight /* padding */)))));\n\n\t\t\tvar windowSize = mode.Select(x => x == Mode.Normal ? mainWindowSize : compactContentSize).Switch();\n\t\t\tvar windowState = mode.Select(x => x == Mode.Normal ? mainWindowState : Property.Constant(Optional.Some(WindowState.Normal))).Switch();\n\t\t\tvar windowPosition = mode.Select(x => x == Mode.Normal ? mainWindowPosition : compactPosition).Switch();\n\n\t\t\treturn new Window\n\t\t\t{\n\t\t\t\tClosed = closed,\n\t\t\t\tTitle = projectName.CombineLatest(license.Status)\n\t\t\t\t\t.Select(tuple => {\n\t\t\t\t\t\tvar title = \"fuse X\";\n\t\t\t\t\t\tif (!string.IsNullOrEmpty(tuple.Item1))\n\t\t\t\t\t\t\ttitle = tuple.Item1 + \" - \" + title;\n\t\t\t\t\t\tif (!string.IsNullOrEmpty(tuple.Item2))\n\t\t\t\t\t\t\ttitle = title + $\" [{tuple.Item2}]\";\n\t\t\t\t\t\treturn title;\n\t\t\t\t\t}),\n\t\t\t\tSize = Optional.Some(windowSize),\n\t\t\t\tPosition = Optional.Some(windowPosition),\n\t\t\t\tState = Optional.Some(windowState),\n\t\t\t\tMenu = menu,\n\t\t\t\tContent = content,\n\t\t\t\tTopMost = Optional.Some(topMost),\n\t\t\t\tHideMenu = Optional.Some((IObservable<bool>)mode.Convert(a => a == Mode.Compact, a => a ? Mode.Compact : Mode.Normal)),\n\t\t\t\tFocused = mainWindowFocused,\n\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\tStyle = WindowStyle.Fat\n\t\t\t};\n\t\t}\n\n\t\tpublic static IControl CreateContent(\n\t\t\tLogView logview,\n\t\t\tIControl outline,\n\t\t\tIControl search,\n\t\t\tIControl notifications,\n\t\t\tIControl attributes,\n\t\t\tIControl bookmarks,\n\t\t\tIControl inspector,\n\t\t\tStageView stage,\n\t\t\tIControl topBar,\n\t\t\tIObservable<Mode> mode)\n\t\t{\n\t\t\tPoints inspectorWidth = 295;\n\n\t\t\tvar right = Property.Constant(Fuse.Inspector.Inspector.Width);\n\t\t\tvar left = UserSettings.Point(\"LeftPanelWidth\").Or(new Points(260));\n\n\t\t\tvar inNormalMode = mode.Select(x => x == Mode.Normal);\n\n\t\t\treturn Layout.Layer(\n\t\t\t\tShapes.Rectangle(fill: Theme.WorkspaceBackground),\n\t\t\t\tLayout.Dock()\n\t\t\t\t\t.Top(topBar)\n\t\t\t\t\t.Top(Separator.Medium)\n\n\t\t\t\t\t.Panel(RectangleEdge.Right, right,\n\t\t\t\t\t\tinNormalMode,\n\t\t\t\t\t\tcontrol: inspector,\n\t\t\t\t\t\tminSize: inspectorWidth,\n\t\t\t\t\t\tresizable: false)\n\n\t\t\t\t\t.Panel(RectangleEdge.Left, left,\n\t\t\t\t\t\tinNormalMode,\n\t\t\t\t\t\tcontrol: outline,\n\t\t\t\t\t\tminSize: 10)\n\n\t\t\t\t\t.Fill(stage.CreateStage(logview, notifications)));\n\t\t}\n\n\t\tpublic static DockBuilder Panel(\n\t\t\tthis DockBuilder dock, RectangleEdge dockEdge, IProperty<Points> size,\n\t\t\tIObservable<bool> isExpanded,\n\t\t\tIControl control,\n\t\t\tPoints minSize,\n\t\t\tbool resizable = true)\n\t\t{\n\t\t\tvar availableSize = new BehaviorSubject<Size<IObservable<Points>>>(\n\t\t\t\tnew Size<IObservable<Points>>(Observable.Return<Points>(double.MaxValue), Observable.Return<Points>(double.MaxValue)));\n\t\t\tvar maxWidth = availableSize.Switch()[dockEdge.NormalAxis()];\n\n\t\t\tcontrol = control\n\t\t\t\t.WithBackground(Theme.PanelBackground)\n\t\t\t\t.WithFrame(f => f, a => a.WithAxis(dockEdge.NormalAxis(), s => size.Min(maxWidth)))\n\t\t\t\t.WithDimension(dockEdge.NormalAxis(), size.Min(maxWidth));\n\n\t\t\tcontrol = Layout.Dock()\n\t\t\t\t.Dock(edge: dockEdge, control: control)\n\t\t\t\t.Dock(edge: dockEdge, control: Separator.Medium)\n\t\t\t\t.Fill();\n\n\t\t\tif (resizable)\n\t\t\t\tcontrol = control.MakeResizable(dockEdge.Opposite(), size, minSize: minSize);\n\n\t\t\tcontrol = control.MakeCollapsable(dockEdge.Opposite(), isExpanded, lazy: false);\n\n\t\t\tcontrol = control.WithFrame(\n\t\t\t\tframe => frame,\n\t\t\t\tavailSize =>\n\t\t\t\t{\n\t\t\t\t\tavailableSize.OnNext(availSize);\n\t\t\t\t\treturn availSize;\n\t\t\t\t});\n\n\t\t\treturn dock.Dock(edge: dockEdge, control: control);\n\t\t}\n\n\t\tstatic IControl CreateHeaderControl(\n\t\t\tCommand command,\n\t\t\tstring buttonText,\n\t\t\tstring tooltipText,\n\t\t\tIControl icon,\n\t\t\tBrush labelColor)\n\t\t{\n\t\t\treturn\n\t\t\t\tButton.Create(command, state =>\n\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\tControl.Empty.WithWidth(4),\n\t\t\t\t\t\t\t\ticon,\n\t\t\t\t\t\t\t\tControl.Empty.WithWidth(4),\n\t\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\t\ttext: buttonText,\n\t\t\t\t\t\t\t\t\t\tcolor:labelColor,\n\t\t\t\t\t\t\t\t\t\tfont: Theme.DescriptorFont)\n\t\t\t\t\t\t\t\t\t.CenterVertically(),\n\t\t\t\t\t\t\t\tControl.Empty.WithWidth(4))\n\t\t\t\t\t\t\t.SetToolTip(tooltipText)\n\t\t\t\t\t\t\t.WithBackground(\n\t\t\t\t\t\t\t\tbackground: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered,\n\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t? Theme.FaintBackground\n\t\t\t\t\t\t\t\t\t\t\t\t: Color.Transparent)\n\t\t\t\t\t\t\t\t\t.Switch()));\n\t\t}\n\n\t\tstatic IControl CreateFullSelectionControl(\n\t\t\tIProperty<bool> selectionEnabled)\n\t\t{\n\t\t\treturn\n\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Bottom(\n\t\t\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\t\t\t\tfill: selectionEnabled.IsFalse()\n\t\t\t\t\t\t\t\t\t\t.Select(e => e ? Color.Transparent : Theme.Active)\n\t\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t\t.WithHeight(2))\n\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\tCreateHeaderControl(\n\t\t\t\t\t\t\t\ticon: SelectionIcon.Create(selectionEnabled, true),\n\t\t\t\t\t\t\t\ttooltipText: Strings.Toolbar_Selection_Tooltip,\n\t\t\t\t\t\t\t\tbuttonText : Strings.Toolbar_Selection_Button,\n\t\t\t\t\t\t\t\tlabelColor: selectionEnabled.IsFalse()\n\t\t\t\t\t\t\t\t\t.Select(e => e ? Theme.DescriptorText : Theme.DefaultText)\n\t\t\t\t\t\t\t\t\t.Switch(),\n\t\t\t\t\t\t\t\tcommand: selectionEnabled.Toggle())),\n\t\t\t\t\tControl.Empty.WithWidth(24),\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Bottom(\n\t\t\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\t\t\t\tfill: selectionEnabled.IsFalse()\n\t\t\t\t\t\t\t\t\t\t.Select(e => e ? Theme.Active : Color.Transparent)\n\t\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t\t.WithHeight(2))\n\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\tCreateHeaderControl(\n\t\t\t\t\t\t\t\ticon: TouchIcon.Create(selectionEnabled, true),\n\t\t\t\t\t\t\t\ttooltipText: Strings.Toolbar_Touch_Tooltip,\n\t\t\t\t\t\t\t\tbuttonText : Strings.Toolbar_Touch_Button,\n\t\t\t\t\t\t\t\tlabelColor: selectionEnabled\n\t\t\t\t\t\t\t\t\t.Select(e => e ? Theme.DescriptorText : Theme.DefaultText)\n\t\t\t\t\t\t\t\t\t.Switch(),\n\t\t\t\t\t\t\t\tcommand: selectionEnabled.Toggle())));\n\t\t}\n\n\t\tstatic IControl CreateCompactSelectionControl(\n\t\t\tIProperty<Mode> mode,\n\t\t\tIProperty<bool> selectionEnabled,\n\t\t\tCommand toggleMode)\n\t\t{\n\t\t\treturn\n\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\tButton.Create(selectionEnabled.Toggle(), state =>\n\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t.Bottom(\n\t\t\t\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\t\t\t\t\tfill: Theme.Active)\n\t\t\t\t\t\t\t\t\t.WithSize(new Size<Points>(1, 1)))\n\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\t\t\tSelectionIcon.Create(selectionEnabled, true)\n\t\t\t\t\t\t\t\t\t\t.OnMouse(pressed: selectionEnabled.Toggle())\n\t\t\t\t\t\t\t\t\t\t.ShowWhen(selectionEnabled),\n\t\t\t\t\t\t\t\t\tTouchIcon.Create(selectionEnabled, true)\n\t\t\t\t\t\t\t\t\t\t.Center()\n\t\t\t\t\t\t\t\t\t\t.OnMouse(pressed: selectionEnabled.Toggle())\n\t\t\t\t\t\t\t\t\t\t.ShowWhen(selectionEnabled.IsFalse())))\n\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(4, 0, 4, 0))\n\t\t\t\t\t\t\t.WithBackground(\n\t\t\t\t\t\t\t\tbackground: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered,\n\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t? Theme.FaintBackground\n\t\t\t\t\t\t\t\t\t\t\t\t: Color.Transparent)\n\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t.SetToolTip(Strings.Toolbar_Selection_Tooltip2)),\n\t\t\t\t\tControl.Empty.WithWidth(8),\n\t\t\t\t\tButton.Create(toggleMode, state =>\n\t\t\t\t\t\t\tMinimizeAndMaximizeIcon.Create(mode)\n\t\t\t\t\t\t\t.WithPadding(new Thickness<Points>(4, 0, 4, 0))\n\t\t\t\t\t\t\t.WithBackground(\n\t\t\t\t\t\t\t\tbackground: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered,\n\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t? Theme.FaintBackground\n\t\t\t\t\t\t\t\t\t\t\t\t: Color.Transparent)\n\t\t\t\t\t\t\t\t\t.Switch()))\n\t\t\t\t\t\t\t.SetToolTip(Strings.Toolbar_Compact_Tooltip));\n\t\t}\n\n\t\tstatic IControl CreateTopBar(\n\t\t\tIPopover popover,\n\t\t\tIProperty<bool> selectionEnabled,\n\t\t\tIProperty<Mode> mode,\n\t\t\tCommand addViewport,\n\t\t\tCodeView codeView,\n\t\t\tILicense license)\n\t\t{\n\t\t\tvar isCompact = mode.Convert(m => m == Mode.Compact, m => m ? Mode.Compact : Mode.Normal);\n\t\t\tvar toggleMode = isCompact.Toggle();\n\n\t\t\treturn\n\t\t\t\tLayout.Layer(\n\t\t\t\t\tLayout.StackFromLeft(CreateLicenseStatus(license, TextAlignment.Left))\n\t\t\t\t\t\t.WithPadding(Thickness.Create(new Points(0), 3, 0, 0))\n\t\t\t\t\t\t.DockLeft(),\n\t\t\t\t\tLayout\n\t\t\t\t\t\t.StackFromLeft(\n\t\t\t\t\t\t\tcodeView.Create(popover)\n\t\t\t\t\t\t\t\t.HideWhen(isCompact),\n\n\t\t\t\t\t\t\tControl.Empty.WithWidth(16),\n\n\t\t\t\t\t\t\tLayout\n\t\t\t\t\t\t\t\t.StackFromLeft(CreateHeaderControl(\n\t\t\t\t\t\t\t\t\ticon: Fuse.Icons.AddViewport(),\n\t\t\t\t\t\t\t\t\ttooltipText: Strings.Toolbar_Viewport_Tooltip,\n\t\t\t\t\t\t\t\t\tbuttonText: Strings.Toolbar_Viewport_Button,\n\t\t\t\t\t\t\t\t\tcommand: addViewport,\n\t\t\t\t\t\t\t\t\tlabelColor: Theme.DefaultText),\n\t\t\t\t\t\t\t\t\tControl.Empty.WithWidth(16))\n\t\t\t\t\t\t\t\t.HideWhen(isCompact),\n\n\t\t\t\t\t\t\tCreateHeaderControl(\n\t\t\t\t\t\t\t\t\ticon: MinimizeAndMaximizeIcon.Create(mode),\n\t\t\t\t\t\t\t\t\ttooltipText: Strings.Toolbar_Compact_Tooltip,\n\t\t\t\t\t\t\t\t\tbuttonText : Strings.Toolbar_Compact_Button,\n\t\t\t\t\t\t\t\t\tlabelColor: Theme.DefaultText,\n\t\t\t\t\t\t\t\t\tcommand: toggleMode)\n\t\t\t\t\t\t\t\t.HideWhen(isCompact),\n\n\t\t\t\t\t\t\tCreateCompactSelectionControl(mode, selectionEnabled, toggleMode)\n\t\t\t\t\t\t\t\t.ShowWhen(isCompact)\n\t\t\t\t\t\t\t\t.Center(),\n\n\t\t\t\t\t\t\tControl.Empty.WithWidth(4))\n\t\t\t\t\t\t.DockRight(),\n\t\t\t\t\t\tCreateFullSelectionControl(selectionEnabled)\n\t\t\t\t\t\t\t.HideWhen(isCompact)\n\t\t\t\t\t\t\t.CenterHorizontally())\n\t\t\t\t.WithHeight(38)\n\t\t\t\t.WithPadding(new Thickness<Points>(8, 0, 8, 0))\n\t\t\t\t.WithBackground(Theme.PanelBackground);\n\t\t}\n\n\t\tinternal static IControl CreateLicenseStatus(ILicense license, TextAlignment textAlignment)\n\t\t{\n\t\t\t// HACK: Hide on macOS.\n\t\t\tif (Platform.IsMac)\n\t\t\t\treturn Label.FormattedText(Observable.Never<IList<TextPart>>());\n\n\t\t\treturn Theme.Link.Select(linkColor =>\n\t\t\t\tLabel.FormattedText(font: Theme.DescriptorFont, color: Theme.DescriptorText,\n\t\t\t\t\tlineBreakMode: LineBreakMode.Clip, textAlignment: textAlignment,\n\t\t\t\t\ttextParts: license.IsValid.CombineLatest(license.IsExpired, license.Name,\n\t\t\t\t\t\t\tlicense.IsTrial.CombineLatest(license.DaysLeft, license.Session)).Select(tuple => {\n\t\t\t\t\t\tvar name = tuple.Item3;\n\t\t\t\t\t\tvar isLoggedIn = tuple.Item1 && !string.IsNullOrEmpty(name);\n\t\t\t\t\t\tvar isExpired = tuple.Item2;\n\t\t\t\t\t\tvar isTrial = tuple.Item4.Item1;\n\t\t\t\t\t\tvar daysLeft = tuple.Item4.Item2;\n\t\t\t\t\t\tvar session = tuple.Item4.Item3;\n\t\t\t\t\t\t\t\treturn isLoggedIn ?\n\t\t\t\t\t\t\t\tAttributedText.Parts()\n\t\t\t\t\t\t\t\t\t.Text(Strings.Auth_Text_LicensedTo1)\n\t\t\t\t\t\t\t\t\t.Link(\"@\" + name, WebLinks.Dashboard + \"?session=\" + Uri.EscapeUriString(session), linkColor)\n\t\t\t\t\t\t\t\t\t.Text(Strings.Auth_Text_LicensedTo2 + (\n\t\t\t\t\t\t\t\t\t\tisTrial\n\t\t\t\t\t\t\t\t\t\t\t? \" - \" + daysLeft + \" \" + (\n\t\t\t\t\t\t\t\t\t\t\t\tdaysLeft == 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t? Strings.Auth_Text_TrialDayLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t: Strings.Auth_Text_TrialDaysLeft\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t: isExpired ?\n\t\t\t\t\t\t\t\tAttributedText.Parts()\n\t\t\t\t\t\t\t\t\t.Text(Strings.Auth_Text_LicenseExpired1)\n\t\t\t\t\t\t\t\t\t.Link(Strings.Auth_Text_LicenseExpired2, WebLinks.SignIn, linkColor)\n\t\t\t\t\t\t\t\t\t.Text(Strings.Auth_Text_LicenseExpired3)\n\t\t\t\t\t\t\t:\n\t\t\t\t\t\t\t\tAttributedText.Parts()\n\t\t\t\t\t\t\t\t\t.Text(Strings.Auth_Text_SignIn1)\n\t\t\t\t\t\t\t\t\t.Link(Strings.Auth_Text_SignIn2, WebLinks.SignIn, linkColor)\n\t\t\t\t\t\t\t\t\t.Text(Strings.Auth_Text_SignIn3);\n\t\t\t\t\t}))\n\t\t\t\t\t.WithWidth(new Points(300))\n\t\t\t\t\t.WithPadding(\n\t\t\t\t\t\tleft: new Points(4),\n\t\t\t\t\t\tright: new Points(4),\n\t\t\t\t\t\tbottom: new Points(4))\n\t\t\t\t\t.CenterVertically())\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/MainWindowIcons.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tstatic class MainWindowIcons\n\t{\n\t\tpublic static IControl DockIcon(RectangleEdge edge, Brush brush)\n\t\t{\n\t\t\treturn Shapes.Rectangle(stroke: Stroke.Create(1, brush))\n\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: brush)\n\t\t\t\t\t.WithHeight(2)\n\t\t\t\t\t.WithWidth(2)\n\t\t\t\t\t.WithPadding(new Thickness<Points>(2))\n\t\t\t\t\t.Dock(edge))\n\t\t\t\t.WithWidth(20)\n\t\t\t\t.WithHeight(16)\n\t\t\t\t.Center();\n\t\t}\n\n\t\tpublic static IControl WindowIcon(Brush brush, Brush bg)\n\t\t{\n\t\t\tvar front =\n\t\t\t\tShapes.Rectangle(fill: bg, stroke: Stroke.Create(1, brush))\n\t\t\t\t\t.WithSize(new Size<Points>(16, 11))\n\t\t\t\t\t.DockRight()\n\t\t\t\t\t.DockTop();\n\n\t\t\tvar back =\n\t\t\t\tShapes.Rectangle(stroke: Stroke.Create(1, brush))\n\t\t\t\t\t.WithSize(new Size<Points>(16, 11))\n\t\t\t\t\t.DockLeft()\n\t\t\t\t\t.DockBottom();\n\n\t\t\treturn Control.Empty.WithSize(new Size<Points>(20, 16))\n\t\t\t\t.WithOverlay(back)\n\t\t\t\t.WithOverlay(front)\n\t\t\t\t.Center();\n\t\t}\n\n\t\tpublic static IControl CloseIcon(Points height, Stroke stroke)\n\t\t{\n\t\t\treturn Layout.Layer(\n\t\t\t\tShapes.Line(\n\t\t\t\t\tnew Point<Points>(0, 0),\n\t\t\t\t\tnew Point<Points>(height, height),\n\t\t\t\t\tstroke: stroke),\n\t\t\t\tShapes.Line(\n\t\t\t\t\tnew Point<Points>(0, height),\n\t\t\t\t\tnew Point<Points>(height, 0),\n\t\t\t\t\tstroke: stroke))\n\t\t\t\t.WithSize(new Size<Points>(height, height));\n\t\t}\n\n\n\t\tpublic static IControl AddIcon(Stroke stroke)\n\t\t{\n\t\t\tvar width = 17.0;\n\t\t\treturn Layout.Layer(\n\t\t\t\tShapes.Line(\n\t\t\t\t\tnew Point<Points>(width/2, 0),\n\t\t\t\t\tnew Point<Points>(width/2, width),\n\t\t\t\t\tstroke: stroke),\n\t\t\t\tShapes.Line(\n\t\t\t\t\tnew Point<Points>(0, width/2),\n\t\t\t\t\tnew Point<Points>(width, width/2),\n\t\t\t\t\tstroke: stroke))\n\t\t\t\t.WithSize(new Size<Points>(width, width));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Notification.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tstatic class Notification\n\t{\n\t\tpublic static IControl Create(string message, params Tuple<string, Command>[] commands)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t.Right(Observable.Return(\n\t\t\t\t\tcommands.Select(cmd =>\n\t\t\t\t\t\tButtons.NotificationButton(cmd.Item1, cmd.Item2, Theme.ErrorColor)\n\t\t\t\t\t\t\t.WithWidth(80)\n\t\t\t\t\t\t\t.WithHeight(18)\n\t\t\t\t\t\t\t.Center()))\n\t\t\t\t\t.StackFromLeft(separator: () => Spacer.Small))\n\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t.Right(Label.Create(message, Theme.DescriptorFont, color: Color.White)\n\t\t\t\t\t.CenterVertically())\n\t\t\t\t.Fill()\n\t\t\t\t.WithBackground(Shapes.Rectangle(fill: Theme.ErrorColor))\n\t\t\t\t.WithHeight(24)\n\t\t\t\t.MakeCollapsable(RectangleEdge.Top, new [] { false, true }.ToObservable(), lazy: false);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/FocusBox.cs",
    "content": "using System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Stage\n{\n\tstatic class FocusBox\n\t{\n\t\tpublic static IControl Create(IProperty<bool> enabled)\n\t\t{\n\t\t\tvar size = new Size<Points>(14, 14);\n\t\t\tvar innerPadding = new Thickness<Points>(1.5);\n\t\t\tconst float backgroundOpacity = 0.55f;\n\t\t\tvar innerCornerRadius = Observable.Return(new CornerRadius(3));\n\t\t\tvar outerCornerRadius = Observable.Return(new CornerRadius(4));\n\n\t\t\tvar enabledValue = enabled.Select(isEnabled => isEnabled ? 1.0 : 0.0).LowPass(0.3).Select(d => (float)d);\n\t\t\tvar backgroundOpacityValue = enabledValue.Select(v => v * backgroundOpacity);\n\n\t\t\tvar inactiveContent = Shapes.Rectangle(\n\t\t\t\tstroke: Theme.FieldStroke,\n\t\t\t\tcornerRadius: innerCornerRadius);\n\n\t\t\tvar content = Shapes.Rectangle(\n\t\t\t\t\tfill: Theme.Active.WithAlpha(enabledValue),\n\t\t\t\t\tcornerRadius: innerCornerRadius)\n\t\t\t\t.WithBackground(inactiveContent)\n\t\t\t\t.WithPadding(innerPadding)\n\t\t\t\t.WithSize(size)\n\t\t\t\t.WithBackground(Shapes.Rectangle(\n\t\t\t\t\tfill: Theme.Active.WithAlpha(backgroundOpacityValue),\n\t\t\t\t\tcornerRadius: outerCornerRadius));\n\n\t\t\tvar toolTip = enabled.Select(\n\t\t\t\tb => b\n\t\t\t\t\t? \"This is the currently active viewport.\"\n\t\t\t\t\t: \"Click to make this the currently active viewport.\");\n\n\t\t\treturn Button.Create(\n\t\t\t\tclicked: Command.Enabled(() => enabled.Write(true)),\n\t\t\t\tcontent: buttonState => content,\n\t\t\t\ttoolTip: toolTip.AsText());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/Gizmos/BoxFactory.cs",
    "content": "using System;\nusing System.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Stage\n{\n\tclass BoxFactory\n\t{\n\t\tpublic static IControl CreateSpacingBox(\n\t\t\tIObservable<Rectangle<Points>> bounds,\n\t\t\tIObservable<Thickness<Points>> margin,\n\t\t\tIObservable<Thickness<Points>> padding)\n\t\t{\n\t\t\treturn Layout.Layer(\n\t\t\t\tAcquireBox(\n\t\t\t\t\touter: bounds,\n\t\t\t\t\tinner: bounds.Deflate(padding/*.CombineLatest(_paddingCues, Thickness.CollapseEdgesExcept)*/.Max(Thickness.Zero)),\n\t\t\t\t\tcolor: Theme.Padding),\n\t\t\t\tAcquireBox(\n\t\t\t\t\touter: bounds.Inflate(margin/*.CombineLatest(_marginCues, Thickness.CollapseEdgesExcept)*/.Max(Thickness.Zero)),\n\t\t\t\t\tinner: bounds,\n\t\t\t\t\tcolor: Theme.Margin));\n\t\t}\n\n\t\tstatic IControl AcquireBox(IObservable<Rectangle<Points>> outer, IObservable<Rectangle<Points>> inner, Brush color)\n\t\t{\n\t\t\treturn CreateBox(outer.Transpose(), inner.Transpose(), color);\n\t\t}\n\n\t\tstatic IControl CreateBox(Rectangle<IObservable<Points>> outer, Rectangle<IObservable<Points>> inner, Brush color)\n\t\t{\n\t\t\tvar fills = new[]\n\t\t\t{\n\t\t\t\touter.With(left: inner.Right()),\n\t\t\t\touter.With(right: inner.Left()),\n\t\t\t\tinner.With(top: outer.Top(), bottom: inner.Top()),\n\t\t\t\tinner.With(bottom: outer.Bottom(), top: inner.Bottom()),\n\t\t\t\tinner.With(bottom: outer.Top()),\n\t\t\t};\n\n\t\t\tvar strokes = new[]\n\t\t\t{\n\t\t\t\tinner, outer,\n\t\t\t};\n\n\t\t\treturn fills\n\t\t\t\t.Select(fill => Shapes\n\t\t\t\t\t.Rectangle(fill: color.WithAlpha(0.2f))\n\t\t\t\t\t.WithFixedPosition(fill))\n\t\t\t\t.Concat(strokes\n\t\t\t\t\t.Select(stroke => Shapes\n\t\t\t\t\t\t.Rectangle(stroke: Stroke.Create(1, color))\n\t\t\t\t\t\t.WithFixedPosition(stroke)))\n\t\t\t\t.Layer();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/Gizmos/ChangeSelection.cs",
    "content": "using System.IO;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Stage\n{\n\tclass ChangeSelection : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"Select\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic ObjectIdentifier Id;\n\t\tpublic bool IsPreview;\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(IsPreview);\n\t\t\tObjectIdentifier.Write(Id, writer);\n\t\t}\n\t\tpublic static ChangeSelection ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new ChangeSelection\n\t\t\t{\n\t\t\t\tIsPreview = reader.ReadBoolean(),\n\t\t\t\tId = ObjectIdentifier.Read(reader)\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/Gizmos/ChangeTool.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Fuse.Stage\n{\n\tenum Tool\n\t{\n\t\tNone,\n\t\tSelect,\n\t}\n\n\tclass ChangeTool : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"ChangeTool\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic Tool Tool;\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(Tool.ToString());\n\t\t}\n\n\t\tpublic static ChangeTool ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new ChangeTool\n\t\t\t{\n\t\t\t\tTool = (Tool)Enum.Parse(typeof(Tool), reader.ReadString())\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/Gizmos/Gizmos.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\nusing Outracks.Simulator;\nusing Outracks.UnoHost;\n\nnamespace Outracks.Fuse.Stage\n{\n\tclass Gizmos : IPluginFactory\n\t{\n\t\tpublic static IDisposable Initialize(\n\t\t\tIUnoHostControl unoHost,\n\t\t\tIObservable<bool> selectionEnabled,\n\t\t\tIProject project)\n\t\t{\n\t\t\tvar context = project.Context;\n\n\t\t\tvar input = Observable.Merge<IBinaryMessage>(\n\t\t\t\tselectionEnabled.Select(select => new ChangeTool { Tool = select ? Tool.Select : Tool.None, }),\n\t\t\t\tcontext.CurrentSelection.SimulatorId.Select(id => new ChangeSelection { IsPreview = false, Id = id }),\n\t\t\t\tcontext.PreviewedSelection.SimulatorId.Select(id => new ChangeSelection { IsPreview = true, Id = id }));\n\n\t\t\tvar output = unoHost.LoadPlugin<Gizmos>(input);\n\n\t\t\treturn output\n\t\t\t\t.TryParse(ChangeSelection.MessageType, ChangeSelection.ReadDataFrom)\n\t\t\t\t.Select(msg =>\n\t\t\t\t\tObservable.FromAsync(async () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (msg.IsPreview)\n\t\t\t\t\t\t\tawait context.Preview(project.GetElement(msg.Id));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tawait context.Select(project.GetElement(msg.Id));\n\t\t\t\t\t}))\n\t\t\t\t.Concat()\n\t\t\t\t.Subscribe();\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This method is called by unoHost.LoadPlugin() in the UnoHost process, communication back and forth happens through IBinaryMessages\n\t\t/// </summary>\n\t\tpublic Plugin Create(PluginContext context)\n\t\t{\n\t\t\tvar output = new Subject<ChangeSelection>();\n\n\t\t\tvar actualSelection =\n\t\t\t\tcontext.Input.TryParse(ChangeSelection.MessageType, ChangeSelection.ReadDataFrom)\n\t\t\t\t\t.Merge(output)\n\t\t\t\t\t.Where(s => !s.IsPreview).Select(s => s.Id)\n\t\t\t\t\t.StartWith(ObjectIdentifier.None)\n\t\t\t\t\t.DistinctUntilChanged().Replay(1);\n\n\t\t\tvar previewSelection =\n\t\t\t\tcontext.Input.TryParse(ChangeSelection.MessageType, ChangeSelection.ReadDataFrom)\n\t\t\t\t\t.Merge(output)\n\t\t\t\t\t.Where(s => s.IsPreview).Select(s => s.Id)\n\t\t\t\t\t.StartWith(ObjectIdentifier.None)\n\t\t\t\t\t.DistinctUntilChanged().Replay(1);\n\n\t\t\tvar tool =\n\t\t\t\tcontext.Input\n\t\t\t\t\t.TryParse(ChangeTool.MessageType, ChangeTool.ReadDataFrom)\n\t\t\t\t\t.StartWith(new ChangeTool { Tool = Tool.None })\n\t\t\t\t\t.DistinctUntilChanged().Replay(1);\n\n\t\t\tactualSelection.Connect();\n\t\t\tpreviewSelection.Connect();\n\n\t\t\ttool.Connect();\n\n\t\t\tvar selectionEnabled = tool.Select(t => t.Tool == Tool.Select);\n\n\t\t\tvar actualSelectionVisible = selectionEnabled\n\t\t\t\t.Or(actualSelection\n\t\t\t\t\t.Select(_ => Observable.Timer(TimeSpan.FromSeconds(1))\n\t\t\t\t\t\t.ObserveOn(context.Dispatcher)\n\t\t\t\t\t\t.Select(__ => false).StartWith(true))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.StartWith(false));\n\n\t\t\tvar previewSelectionVisible = selectionEnabled\n\t\t\t\t.Or(previewSelection\n\t\t\t\t\t.Select(_ => Observable.Timer(TimeSpan.FromSeconds(1))\n\t\t\t\t\t\t.ObserveOn(context.Dispatcher)\n\t\t\t\t\t\t.Select(__ => false).StartWith(true))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.StartWith(false));\n\n\t\t\treturn new Plugin\n\t\t\t{\n\t\t\t\tOutput = output,\n\t\t\t\tOverlay =\n\t\t\t\t\tLayout.Layer(\n\t\t\t\t\t\tVisualizeSelection(context, actualSelection).ShowWhen(actualSelectionVisible),\n\t\t\t\t\t\tVisualizePreviewSelection(context, previewSelection).ShowWhen(previewSelectionVisible),\n\t\t\t\t\t\tHitBoxes.Create(actualSelection, output, context).ShowWhen(selectionEnabled))\n\t\t\t};\n\t\t}\n\n\t\tstatic IControl VisualizePreviewSelection(PluginContext context, IObservable<ObjectIdentifier> previewSelection)\n\t\t{\n\t\t\treturn previewSelection\n\t\t\t\t.Select(context.GetObjects)\n\t\t\t\t.Switch()\n\t\t\t\t.WherePerElement(o => (bool)context.Reflection.IsSubtype(o, \"Fuse.Visual\"))\n\t\t\t\t.PoolPerElement(oo =>\n\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\tstroke: Theme.SelectionStroke(\n\t\t\t\t\t\t\tisSelected: Observable.Return(false),\n\t\t\t\t\t\t\tisHovering: Observable.Return(true),\n\t\t\t\t\t\t\tshowOutline: Observable.Return(false)))\n\t\t\t\t\t\t.WithFixedPosition(context.GetBounds(oo).Transpose()))\n\t\t\t\t.Layer();\n\t\t}\n\n\t\tstatic IControl VisualizeSelection(PluginContext context, IObservable<ObjectIdentifier> selection)\n\t\t{\n\t\t\treturn selection\n\t\t\t\t.Select(context.GetObjects)\n\t\t\t\t.Switch()\n\t\t\t\t.WherePerElement(o => (bool)context.Reflection.IsSubtype(o, \"Fuse.Visual\"))\n\t\t\t\t.PoolPerElement(oo =>\n\t\t\t\t\tBoxFactory.CreateSpacingBox(\n\t\t\t\t\t\tcontext.GetBounds(oo),\n\t\t\t\t\t\tcontext.GetThickness(oo, \"Margin\"),\n\t\t\t\t\t\tcontext.GetThickness(oo, \"Padding\")))\n\t\t\t\t.Layer();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/Gizmos/HitBoxes.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Runtime;\nusing Outracks.UnoHost;\nusing Uno;\n\nnamespace Outracks.Fuse.Stage\n{\n\tstatic class HitBoxes\n\t{\n\t\tpublic static IControl Create(IObservable<ObjectIdentifier> selection, IObserver<ChangeSelection> nextSelection, PluginContext ctx)\n\t\t{\n\t\t\tvar ctrl = Shapes.Rectangle().MakeHittable();\n\n\t\t\tChangeSelectionOnClick(ctrl, selection, ctx).Subscribe(nextSelection.OnNext);\n\n\t\t\treturn ctrl.Control;\n\t\t}\n\n\t\tstatic IObservable<ChangeSelection> ChangeSelectionOnClick(Hittable ctrl, IObservable<ObjectIdentifier> selection, PluginContext ctx)\n\t\t{\n\t\t\treturn Observable.Merge(\n\t\t\t\tctrl.Moved\n\t\t\t\t\t.WithLatestFromBuffered(selection, (pos, currentSelection) =>\n\t\t\t\t\t\tnew ChangeSelection\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIsPreview = true,\n\t\t\t\t\t\t\tId = HitTest(pos, currentSelection, ctx),\n\t\t\t\t\t\t}),\n\n\t\t\t\tctrl.Pressed\n\t\t\t\t\t.WithLatestFromBuffered(selection, (pos, currentSelection) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newSelection = HitTest(pos, currentSelection, ctx);\n\t\t\t\t\t\tvar newPreviewSelection = HitTest(pos, newSelection, ctx);\n\t\t\t\t\t\treturn new { newSelection, newPreviewSelection };\n\t\t\t\t\t})\n\t\t\t\t\t.SelectMany(t => new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tnew ChangeSelection\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIsPreview = true,\n\t\t\t\t\t\t\tId = t.newPreviewSelection,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnew ChangeSelection\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIsPreview = false,\n\t\t\t\t\t\t\tId = t.newSelection,\n\t\t\t\t\t\t},\n\t\t\t\t\t}));\n\t\t}\n\n\t\tstatic ObjectIdentifier HitTest(Point<Points> point, ObjectIdentifier currentSelection, PluginContext ctx)\n\t\t{\n\t\t\tvar hitObjects = (IEnumerable<object>)ctx.Reflection.CallStatic(\"Outracks.UnoHost.FusionInterop\", \"HitTest\", new Float2((float)point.X, (float)point.Y));\n\n\t\t\tvar objectToId = (IDictionary<object, string>)ctx.Reflection.GetStaticPropertyOrFieldValue(typeof(ObjectTagRegistry).FullName, \"ObjectToTag\");\n\t\t\tvar hitIds = hitObjects\n\t\t\t\t.SelectMany(o => objectToId.TryGetValue(o))\n\t\t\t\t.Select(id => new ObjectIdentifier(Simulator.StringSplitting.BeforeLast(id, \"#\"), int.Parse(Simulator.StringSplitting.AfterLast(id, \"#\"))))\n\t\t\t\t.ToList();\n\n\t\t\treturn HitTest(hitIds, currentSelection);\n\t\t}\n\n\t\tstatic ObjectIdentifier HitTest(IList<ObjectIdentifier> hitObjects, ObjectIdentifier currentSelection)\n\t\t{\n\t\t\tvar selectIndex = hitObjects.IndexOf(currentSelection) + 1;\n\n\t\t\tif (hitObjects.Count == 0)\n\t\t\t\treturn ObjectIdentifier.None;\n\n\t\t\treturn hitObjects\n\t\t\t\t.Skip(selectIndex % hitObjects.Count)\n\t\t\t\t.First();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/Gizmos/PluginUnoHelpers.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Runtime;\nusing Outracks.UnoHost;\n\nnamespace Outracks.Fuse.Stage\n{\n\tstatic class PluginUnoHelpers\n\t{\n\t\tpublic static IObservable<Thickness<Points>> GetThickness(this PluginContext context, IObservable<object> observableUnoObject, string property)\n\t\t{\n\t\t\treturn context.ObservePerFrame(observableUnoObject, obj =>\n\t\t\t{\n\t\t\t\tvar vector = context.Reflection.GetPropertyValue(obj, property) as dynamic;\n\t\t\t\tfloat l = vector.X;\n\t\t\t\tfloat t = vector.Y;\n\t\t\t\tfloat r = vector.Z;\n\t\t\t\tfloat b = vector.W;\n\t\t\t\treturn Thickness.Create<Points>(l, t, r, b);\n\t\t\t})\n\t\t\t\t.Catch((Exception e) =>\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(e);\n\t\t\t\t\treturn Observable.Return(Thickness.Create<Points>(0, 0, 0, 0));\n\t\t\t\t})\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\n\t\tpublic static IObservable<Rectangle<Points>> GetBounds(this PluginContext context, IObservable<object> observableUnoObject)\n\t\t{\n\t\t\treturn context.ObservePerFrame(observableUnoObject, obj =>\n\t\t\t{\n\t\t\t\tfloat x = obj.WorldPosition.X + obj.LocalBounds.Minimum.X;\n\t\t\t\tfloat y = obj.WorldPosition.Y + obj.LocalBounds.Minimum.Y;\n\t\t\t\tfloat w = obj.LocalBounds.Maximum.X - obj.LocalBounds.Minimum.X;\n\t\t\t\tfloat h = obj.LocalBounds.Maximum.Y - obj.LocalBounds.Minimum.Y;\n\t\t\t\treturn Rectangle.FromPositionSize(\n\t\t\t\t\tPoint.Create<Points>(x, y),\n\t\t\t\t\tSize.Create<Points>(w, h));\n\t\t\t})\n\t\t\t\t.Catch((Exception e) =>\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(e);\n\t\t\t\t\treturn Observable.Return(Rectangle.FromPositionSize<Points>(0, 0, 0, 0));\n\t\t\t\t})\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\n\t\tstatic IObservable<T> ObservePerFrame<T>(this PluginContext context, IObservable<object> unoObject, Func<dynamic, T> readValue)\n\t\t{\n\t\t\treturn context.PerFrame.StartWith(0).CombineLatest(unoObject, (_, v) => readValue(v));\n\t\t}\n\n\t\tpublic static IObservable<IEnumerable<object>> GetObjects(this PluginContext context, ObjectIdentifier id)\n\t\t{\n\t\t\treturn context.PerFrame\n\t\t\t\t.StartWith(0)\n\t\t\t\t.Select(_ =>\n\t\t\t\t\t(IEnumerable<object>)context.Reflection.CallStatic(typeof(ObjectTagRegistry).FullName, \"GetObjectsWithTag\", id.ToString()));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/IStage.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Outracks.Fuse.Stage\n{\n\tinterface IStage\n\t{\n\t\tIObservable<IEnumerable<IViewport>> Viewports { get; }\n\n\t\tIObservable<Optional<IViewport>> FocusedViewport { get; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/IViewport.cs",
    "content": "using System.Reactive.Subjects;\nusing Outracks.Fusion;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic interface IViewport\n\t{\n\t\t/// <summary>\n\t\t/// Execute bytecode remotly.\n\t\t/// </summary>\n\t\tvoid Execute(Statement bytecode);\n\n\t\tBehaviorSubject<VirtualDevice> VirtualDevice { get; }\n\n\t\tIControl Control { get; }\n\n\t\tvoid Close();\n\n\t\tvoid Focus();\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/Primitives.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic static class Primitives\n\t{\n\t\tpublic static IControl Bar\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar primitiveElements = new[]\n\t\t\t\t{\n\t\t\t\t\t\"ClientPanel\",\n\t\t\t\t\t\"Panel\",\n\t\t\t\t\t\"StackPanel\",\n\t\t\t\t\t\"Grid\",\n\t\t\t\t\t\"DockPanel\",\n\t\t\t\t\t\"WrapPanel\",\n\t\t\t\t\t\"Each\",\n\t\t\t\t\t\"ScrollView\",\n\t\t\t\t\t\"Rectangle\",\n\t\t\t\t\t\"Circle\",\n\t\t\t\t\t\"Image\",\n\t\t\t\t\t\"Text\",\n\t\t\t\t\t\"TextInput\",\n\t\t\t\t\t\"Page\",\n\t\t\t\t\t\"PageControl\",\n\t\t\t\t\t\"Button\"\n\t\t\t\t};\n\n\t\t\t\tvar primitives = primitiveElements.Select(\n\t\t\t\t\telementName => new\n\t\t\t\t\t{\n\t\t\t\t\t\tIcon = (Func<IControl>)(() =>  Icons.MediumIcon(elementName)),\n\t\t\t\t\t\tSourceFragment = SourceFragment.FromString(string.Format(\"<{0} />\", elementName)),\n\t\t\t\t\t\tToolTip = elementName\n\t\t\t\t\t});\n\n\t\t\t\treturn Layout.Dock()\n\t\t\t\t\t.Top(Observable.Return(primitives.Select(primitive =>\n\t\t\t\t\t\t\t\tButton.Create(Command.Enabled(),\n\t\t\t\t\t\t\t\t\tstate =>\n\t\t\t\t\t\t\t\t\t\tShapes.Rectangle(\n\t\t\t\t\t\t\t\t\t\t\tfill: Observable.Select(\n\t\t\t\t\t\t\t\t\t\t\t\t\tstate.IsHovered,\n\t\t\t\t\t\t\t\t\t\t\t\t\t(hovering) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? Theme.FaintBackground\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: Theme.PanelBackground)\n\t\t\t\t\t\t\t\t\t\t\t\t.Switch()))\n\t\t\t\t\t\t\t\t.WithOverlay(primitive.Icon()\n\t\t\t\t\t\t\t\t\t\t.Center()\n\t\t\t\t\t\t\t\t\t\t.OnMouse(dragged: Observable.Return(primitive.SourceFragment)))\n\t\t\t\t\t\t\t\t.WithWidth(31)\n\t\t\t\t\t\t\t\t.WithHeight(31)\n\t\t\t\t\t\t\t\t.SetToolTip(primitive.ToolTip)).ToArray())\n\t\t\t\t\t\t.StackFromTop(separator: () => Spacer.Line))\n\t\t\t\t\t.Top(Spacer.Line)\n\t\t\t\t\t.Bottom(Spacer.Line)\n\t\t\t\t\t.Fill(Shapes.Rectangle(fill: Theme.PanelBackground));\n\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/StageController.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fusion;\nusing Outracks.Fusion.Dialogs;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Fuse.Stage\n{\n\tclass StageController : IStage, IDisposable\n\t{\n\t\treadonly BehaviorSubject<IImmutableList<IViewport>> _viewports = new BehaviorSubject<IImmutableList<IViewport>>(ImmutableList<IViewport>.Empty);\n\t\treadonly BehaviorSubject<Optional<IViewport>> _focusedViewport = new BehaviorSubject<Optional<IViewport>>(Optional.None());\n\n\t\treadonly ViewportFactory _viewportFactory;\n\t\treadonly PreviewDevices _previewDevices;\n\t\treadonly IProperty<VirtualDevice> _latestDevice;\n\n\t\treadonly IProperty<bool> _selectionEnabled;\n\t\treadonly ILicense _license;\n\n\t\tpublic StageController(\n\t\t\tViewportFactory viewportFactory,\n\t\t\tPreviewDevices previewDevices,\n\t\t\tIProperty<bool> selectionEnabled,\n\t\t\tILicense license)\n\t\t{\n\t\t\t_viewportFactory = viewportFactory;\n\t\t\t_previewDevices = previewDevices;\n\t\t\t_selectionEnabled = selectionEnabled;\n\n\t\t\t_license = license;\n\t\t\t_license.Updated += LicenseUpdated;\n\n\t\t\tvar fallbackDevice = previewDevices.DefaultDevice\n\t\t\t\t.Select(dev => new VirtualDevice(dev, dev.DefaultOrientation))\n\t\t\t\t.AsProperty();\n\n\t\t\tvar device = _focusedViewport\n\t\t\t\t.Select(mv => mv.Select(v => v.VirtualDevice.AsProperty()).Or(fallbackDevice))\n\t\t\t\t.Switch();\n\n\t\t\t_latestDevice = device;\n\t\t}\n\n\t\tpublic IObservable<IEnumerable<IViewport>> Viewports\n\t\t{\n\t\t\tget { return _viewports; }\n\t\t}\n\n\t\tpublic IObservable<Optional<IViewport>> FocusedViewport\n\t\t{\n\t\t\tget { return _focusedViewport; }\n\t\t}\n\n\t\tpublic IObservable<Size<Points>> DefaultViewportSize\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _latestDevice.Select(x => x.GetOrientedSizeInPoints());\n\t\t\t}\n\t\t}\n\n\t\tvoid OpenViewport(VirtualDevice virtualDevice)\n\t\t{\n\t\t\tvar viewport = CreateViewport(virtualDevice);\n\n\t\t\t_viewports.OnNext(_viewports.Value.Add(viewport));\n\t\t\t_focusedViewport.OnNext(Optional.Some(viewport));\n\t\t}\n\n\t\tvoid ViewportFocused(IViewport viewport)\n\t\t{\n\t\t\t_focusedViewport.OnNext(Optional.Some(viewport));\n\t\t}\n\n\t\tvoid ViewportClosed(IViewport viewport)\n\t\t{\n\t\t\tvar newViewports = _viewports.Value.Remove(viewport);\n\t\t\t_focusedViewport.OnNext(newViewports.LastOrNone());\n\t\t\t_viewports.OnNext(newViewports);\n\t\t}\n\n\t\tpublic Menu Menu\n\t\t{\n\t\t\tget { return CreateMenu(_focusedViewport); }\n\t\t}\n\n\t\tMenu CreateMenu(IObservable<Optional<IViewport>> viewport)\n\t\t{\n\t\t\treturn Menu.Toggle(Texts.SubMenu_Viewport_Selection, _selectionEnabled, HotKey.Create(ModifierKeys.Meta, Key.I))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Viewport_New, NewViewport, hotkey: HotKey.Create(ModifierKeys.Meta, Key.T))\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Viewport_Close, CloseFocusedViewport, hotkey: HotKey.Create(ModifierKeys.Meta, Key.W))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Viewport_Restart, RestartViewport(viewport))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ DevicesMenu.Create(Strings.SubMenu_Viewport_Device, _latestDevice, _previewDevices)\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Viewport_FlipAspect,\n\t\t\t\t\t\t// Moved here from DevicesMenu.\n\t\t\t\t\t\tcommand: Command.Enabled(() =>\n\t\t\t\t\t\t\t_latestDevice\n\t\t\t\t\t\t\t\t.Select(device => device.With(\n\t\t\t\t\t\t\t\t\torientation: device.Orientation == DeviceOrientation.Landscape\n\t\t\t\t\t\t\t\t\t\t? DeviceOrientation.Portrait\n\t\t\t\t\t\t\t\t\t\t: DeviceOrientation.Landscape))\n\t\t\t\t\t\t\t\t.Take(1)\n\t\t\t\t\t\t\t\t.Subscribe(device => _latestDevice.Write(device))),\n\t\t\t\t\t\thotkey: HotKey.Create(ModifierKeys.Meta, Key.F))\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Viewport_Goback, GoBack, hotkey: HotKey.Create(ModifierKeys.Meta, Key.B));\n\t\t}\n\n\t\tCommand RestartViewport(IObservable<Optional<IViewport>> viewport)\n\t\t{\n\t\t\treturn viewport.Switch(vp =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: vp.HasValue,\n\t\t\t\t\taction: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar index = _viewports.Value.IndexOf(vp.Value);\n\t\t\t\t\t\tif (index == -1)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tvar newViewport = CreateViewport(vp.Value.VirtualDevice.Value);\n\t\t\t\t\t\tvar newViewports = _viewports.Value.RemoveAt(index).Insert(index, newViewport);\n\n\t\t\t\t\t\t_viewports.OnNext(newViewports);\n\n\t\t\t\t\t\tif (_focusedViewport.Value == vp)\n\t\t\t\t\t\t\t_focusedViewport.OnNext(Optional.Some(newViewport));\n\n\t\t\t\t\t\tvp.Value.Close();\n\t\t\t\t\t}));\n\t\t}\n\n\t\tIViewport CreateViewport(VirtualDevice virtualDevice)\n\t\t{\n\t\t\treturn _viewportFactory.Create(\n\t\t\t\tinitialDevice: virtualDevice,\n\t\t\t\tonFocus: ViewportFocused,\n\t\t\t\tonClose: ViewportClosed,\n\t\t\t\tmenu: self => CreateMenu(Observable.Return(Optional.Some(self))));\n\t\t}\n\n\t\tpublic Command NewViewport\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _latestDevice.Switch(latestDevice =>\n\t\t\t\t\tCommand.Enabled(() => OpenViewport(latestDevice)));\n\t\t\t}\n\t\t}\n\n\t\tCommand CloseFocusedViewport\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _focusedViewport.Switch(vp =>\n\t\t\t\t\tCommand.Create(\n\t\t\t\t\t\tisEnabled: vp.HasValue,\n\t\t\t\t\t\taction: () => vp.Value.Close()));\n\t\t\t}\n\t\t}\n\n\t\tCommand GoBack\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _focusedViewport.Switch(viewport =>\n\t\t\t\t\tCommand.Create(\n\t\t\t\t\t\tisEnabled: viewport.HasValue,\n\t\t\t\t\t\taction: () => viewport.Value.Execute(\n\t\t\t\t\t\t\tnew CallStaticMethod(StaticMemberName.Parse(\"Fuse.Input.Keyboard.EmulateBackButtonTap\")))));\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_license.Updated -= LicenseUpdated;\n\n\t\t\tforeach (var viewport in _viewports.Value)\n\t\t\t{\n\t\t\t\tviewport.Close();\n\t\t\t}\n\t\t}\n\n\t\tvoid LicenseUpdated(object sender, LicenseStatus status)\n\t\t{\n\t\t\tApplication.MainThread.InvokeAsync(() => {\n\t\t\t\tConsole.WriteLine(\"License updated; restarting viewports\");\n\n\t\t\t\tfor (int i = 0; i < _viewports.Value.Count; i++)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar vp = _viewports.Value[i];\n\t\t\t\t\t\tvar newViewport = CreateViewport(vp.VirtualDevice.Value);\n\t\t\t\t\t\tvar newViewports = _viewports.Value.RemoveAt(i).Insert(i, newViewport);\n\t\t\t\t\t\t_viewports.OnNext(newViewports);\n\t\t\t\t\t\tif (_focusedViewport.Value.Value == vp)\n\t\t\t\t\t\t\t_focusedViewport.OnNext(Optional.Some(newViewport));\n\t\t\t\t\t\tvp.Close();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/StageView.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\nusing LogView = Outracks.Fuse.Studio.LogView;\n\nnamespace Outracks.Fuse.Stage\n{\n\tclass StageView\n\t{\n\t\treadonly IStage _stage;\n\t\treadonly IContext _context;\n\t\treadonly IObservable<Mode> _mode;\n\n\t\tpublic StageView(\n\t\t\tIStage stageController,\n\t\t\tIContext context,\n\t\t\tIObservable<Mode> mode)\n\t\t{\n\t\t\t_stage = stageController;\n\t\t\t_context = context;\n\t\t\t_mode = mode;\n\t\t}\n\n\t\tpublic IControl CreateStage(LogView logview, IControl notifications)\n\t\t{\n\t\t\tvar bottom = UserSettings.Point(\"BottomPanelHeight\").Or(new Points(200));\n\n\t\t\tvar inNormalMode = _mode.Select(x => x == Mode.Normal);\n\n\t\t\treturn inNormalMode.Select(normalMode =>\n\t\t\t\tnormalMode\n\t\t\t\t\t? Layout.Dock()\n\t\t\t\t\t\t.Bottom(notifications)\n\t\t\t\t\t\t.Panel(RectangleEdge.Bottom, bottom,\n\t\t\t\t\t\t\tlogview.IsExpanded,\n\t\t\t\t\t\t\tcontrol: logview.TabContent,\n\t\t\t\t\t\t\tminSize: 55)\n\t\t\t\t\t\t.Bottom(logview.TabHeader)\n\t\t\t\t\t\t.Left(Primitives.Bar.Clip())\n\t\t\t\t\t\t.Fill(StackedViewports.Clip())\n\t\t\t\t\t: Layout.Layer(CompactViewport\n\t\t\t\t\t\t.WithPadding(\n\t\t\t\t\t\t\tleft: MainWindow.ResizeBorderSize,\n\t\t\t\t\t\t\ttop: MainWindow.ResizeBorderSize,\n\t\t\t\t\t\t\tright: MainWindow.ResizeBorderSize,\n\t\t\t\t\t\t\tbottom: LogViewHeader.HeaderHeight))\n\t\t\t\t\t\t.WithBackground(Theme.Background)\n\t\t\t\t\t\t.WithNativeOverlay(\n\t\t\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t\t\t.Bottom(notifications)\n\t\t\t\t\t\t\t\t.Panel(RectangleEdge.Bottom, bottom,\n\t\t\t\t\t\t\t\t\tlogview.IsExpanded.Skip(1).StartWith(false),\n\t\t\t\t\t\t\t\t\tcontrol: logview.TabContent,\n\t\t\t\t\t\t\t\t\tminSize: 55)\n\t\t\t\t\t\t\t\t.Bottom(logview.TabHeader)\n\t\t\t\t\t\t\t\t.Fill()\n\t\t\t\t\t\t\t\t.WithPadding(\n\t\t\t\t\t\t\t\t\tleft: MainWindow.ResizeBorderSize,\n\t\t\t\t\t\t\t\t\ttop: new Points(0),\n\t\t\t\t\t\t\t\t\tright: MainWindow.ResizeBorderSize,\n\t\t\t\t\t\t\t\t\tbottom: MainWindow.ResizeBorderSize)))\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tIControl CompactViewport\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _stage.FocusedViewport\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.SelectPerElement(vp => vp.Control)\n\t\t\t\t\t.Or(Control.Empty)\n\t\t\t\t\t.Switch();\n\t\t\t}\n\t\t}\n\n\t\tIControl StackedViewports\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar deselectArea = Button.Create(\n\t\t\t\t\tclicked: Command.Enabled(() => _context.Select(Element.Empty)),\n\t\t\t\t\tcontent: _ => Shapes.Rectangle(fill: Theme.WorkspaceBackground));\n\n\t\t\t\treturn _stage.Viewports\n\t\t\t\t\t.SelectPerElement(EncapsulateView)\n\t\t\t\t\t.StackFromLeft()\n\t\t\t\t\t.CenterHorizontally()\n\t\t\t\t\t.DockTop()\n\t\t\t\t\t.WithBackground(deselectArea)\n\t\t\t\t\t.MakeScrollable(darkTheme: Theme.IsDark, supportsOpenGL: true, zoomAttributes: new ZoomAttributes(0.5f, 4.0f));\n\t\t\t}\n\t\t}\n\n\t\tIControl EncapsulateView(IViewport viewport)\n\t\t{\n\t\t\tvar deviceSize = viewport.VirtualDevice.Select(s => s.GetOrientedSizeInPoints()).Transpose();\n\t\t\tvar deviceNameLabel = Label.Create(\n\t\t\t\ttext: viewport.VirtualDevice.Select(d => d.Screen.Name).AsText(),\n\t\t\t\tfont: Theme.DescriptorFont,\n\t\t\t\tcolor: Theme.DescriptorText);\n\n\t\t\tvar focusedProperty = _stage.FocusedViewport\n\t\t\t\t.Select(maybeViewport => maybeViewport.Select(vp => vp == viewport).Or(false))\n\t\t\t\t.AsProperty(write: (b, save) => { if (b) viewport.Focus(); });\n\n\t\t\tvar view = Layout.StackFromTop(\n\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\tFocusBox.Create(focusedProperty).DockBottom(),\n\t\t\t\t\tSpacer.Small,\n\t\t\t\t\tdeviceNameLabel),\n\t\t\t\tviewport.Control.WithSize(deviceSize).DropShadow(\n\t\t\t\t\tcolor: Theme.Shadow,\n\t\t\t\t\tradius: Observable.Return(new Points(5)),\n\t\t\t\t\tdistance: Observable.Return(new Points(2))))\n\t\t\t\t.WithPadding(new Thickness<Points>(15));\n\n\t\t\treturn view;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/ViewportController.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Net;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reflection;\nusing Fuse.Preview;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Stage\n{\n\tclass ViewportController : IViewport\n\t{\n\t\tstatic Brush ViewportBackground => Theme.PanelBackground;\n\n\t\treadonly Action<IBinaryMessage> _send;\n\n\t\treadonly Action<ViewportController> _onClose;\n\t\treadonly Action<ViewportController> _onFocus;\n\n\t\treadonly IDisposable _subscription;\n\n\t\tpublic ViewportController(\n\t\t\tVirtualDevice initialDevice,\n\t\t\tAction<ViewportController> onFocus,\n\t\t\tAction<ViewportController> onClose,\n\t\t\tFunc<ViewportController, Menu> menu,\n\t\t\tProjectPreview preview,\n\t\t\tIObservable<AssemblyBuilt> assembly,\n\t\t\tint port,\n\t\t\tIFuse fuse,\n\t\t\tAction<IUnoHostControl> initialize,\n\t\t\tIObserver<OpenGlVersion> glVersion,\n\t\t\tAction enterCode)\n\t\t{\n\t\t\tVirtualDevice = new BehaviorSubject<VirtualDevice>(initialDevice);\n\t\t\t_onClose = onClose;\n\t\t\t_onFocus = onFocus;\n\n\t\t\tvar simulatorControl = assembly\n\t\t\t\t.Select(assemblyPath =>\n\t\t\t\t\tObservable.Start(() =>\n\t\t\t\t\t\tObservable.Using(() =>\n\t\t\t\t\t\t\tpreview.LockBuild(assemblyPath.BuildDirectory),\n\t\t\t\t\t\t\tassemblyLock => IsActivated()\n\t\t\t\t\t\t\t\t? Observable.Using(() =>\n\t\t\t\t\t\t\t\t\tSpawnUnoHost(assemblyPath, port, fuse, menu(this), initialize, glVersion),\n\t\t\t\t\t\t\t\t\tunoHost =>\n\t\t\t\t\t\t\t\t\t\tObservable\n\t\t\t\t\t\t\t\t\t\t\t// never end stream, we don't want to dispose until we've gotten a new one\n\t\t\t\t\t\t\t\t\t\t\t.Never<Optional<IUnoHostControl>>()\n\t\t\t\t\t\t\t\t\t\t\t.StartWith(Optional.Some(unoHost)))\n\t\t\t\t\t\t\t\t: Observable\n\t\t\t\t\t\t\t\t\t// never spawn unohost without a valid license\n\t\t\t\t\t\t\t\t\t.Never<Optional<IUnoHostControl>>()))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.StartWith(Optional.None<IUnoHostControl>()))\n\t\t\t\t.Switch()\n\t\t\t\t.Replay(1);\n\n\t\t\t_subscription = simulatorControl.Connect();\n\n\t\t\tControl = IsActivated()\n\t\t\t\t? simulatorControl\n\t\t\t\t\t.StartWith(Optional.None<IUnoHostControl>())\n\t\t\t\t\t.Select(c => c.Select(cc => cc.Control).Or(() => CreateLoadingIndicator()))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.WithBackground(ViewportBackground)\n\t\t\t\t: CreateActivateIndicator(enterCode);\n\n\t\t\tvar realControl = simulatorControl.NotNone().Replay(1).RefCount();\n\n\t\t\t_send = message => realControl.Take(1).Subscribe(unoHost => unoHost.MessagesTo.OnNext(message));\n\t\t}\n\n\t\tstatic IControl CreateActivateIndicator(Action enterCode)\n\t\t{\n\t\t\treturn Layout.Layer(\n\t\t\t\tShapes.Rectangle(fill: ViewportBackground),\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\tLogoAndVersion.Logo()\n\t\t\t\t\t\t.WithSize(new Size<Points>(336 * 0.5, 173 * 0.5)),\n\t\t\t\t\tLabel.Create(Strings.NagScreen_Text.Wrap(48),\n\t\t\t\t\t\t\t\t font: Theme.DefaultFont,\n\t\t\t\t\t\t\t\t color: Theme.DefaultText)\n\t\t\t\t\t\t.WithPadding(top: new Points(32), bottom: new Points(32))\n\t\t\t\t\t\t.Center(),\n\t\t\t\t\tButtons.DefaultButtonPrimary(\n\t\t\t\t\t\t\t\ttext: Texts.NagScreen_Button_SignIn,\n\t\t\t\t\t\t\t\tcmd: Command.Enabled(() => Process.Start(WebLinks.SignIn)))\n\t\t\t\t\t\t.WithWidth(128)\n\t\t\t\t\t\t.Center(),\n\t\t\t\t\tButtons.DefaultButton(\n\t\t\t\t\t\t\t\ttext: Texts.NagScreen_Button_EnterCode,\n\t\t\t\t\t\t\t\tcmd: Command.Enabled(enterCode))\n\t\t\t\t\t\t.WithPadding(top: new Points(8))\n\t\t\t\t\t\t.WithWidth(128)\n\t\t\t\t\t\t.Center())\n\t\t\t\t.Center());\n\t\t}\n\n\t\tstatic IControl CreateLoadingIndicator()\n\t\t{\n\t\t\treturn Layout.Layer(\n\t\t\t\tShapes.Rectangle(fill: ViewportBackground),\n\t\t\t\tLabel.Create(\"Building project...\", font: Theme.DefaultFont, color: Theme.DefaultText).Center());\n\t\t}\n\n\t\tIUnoHostControl SpawnUnoHost(AssemblyBuilt assemblyPath, int port, IFuse fuse, Menu menu, Action<IUnoHostControl> initialize, IObserver<OpenGlVersion> glVersion)\n\t\t{\n\t\t\tvar unoHost = UnoHostControl.Create(\n\t\t\t\tassemblyPath.Assembly,\n\t\t\t\tCommand.Enabled(Focus),\n\t\t\t\tmenu,\n\t\t\t\tfuse.UserDataDir / new FileName(\"studio-settings.json\"),\n\t\t\t\tfuse.UnoHost,\n\t\t\t\tinitialize,\n\t\t\t\tm =>\n\t\t\t\t{\n\t\t\t\t\tglVersion.OnNext(m);\n\t\t\t\t\tfuse.Report.Info(m.GlVersion, ReportTo.LogAndUser);\n\t\t\t\t},\n\n\t\t\t\t// args\n\t\t\t\t\"--host\",\n\t\t\t\tIPAddress.Loopback.ToString(),\n\t\t\t\tport.ToString(CultureInfo.InvariantCulture));\n\n\t\t\treturn unoHost;\n\t\t}\n\n\t\tpublic IControl Control\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic BehaviorSubject<VirtualDevice> VirtualDevice\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic void Focus()\n\t\t{\n\t\t\t_onFocus(this);\n\t\t}\n\n\t\tpublic void Close()\n\t\t{\n\t\t\t_onClose(this);\n\t\t\t_subscription.Dispose();\n\t\t}\n\n\t\tpublic void Execute(Statement bytecode)\n\t\t{\n\t\t\t_send(new[] { bytecode }.MakeExecute());\n\t\t}\n\n\t\tstatic bool IsActivated()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn (bool)typeof(FuseImpl)\n\t\t\t\t\t.GetField(\"_IsLicenseValid\", BindingFlags.Static | BindingFlags.NonPublic)\n\t\t\t\t\t.GetValue(null);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/ViewportFactory.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Fuse.Preview;\nusing Outracks.Fusion;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Stage\n{\n\tclass ViewportFactory\n\t{\n\t\treadonly ProjectPreview _preview;\n\t\treadonly IProperty<bool> _selectionEnabled;\n\t\treadonly IObservable<AssemblyBuilt> _assembly;\n\t\treadonly int _port;\n\t\treadonly IProject _project;\n\t\treadonly IFuse _fuse;\n\t\treadonly IObserver<OpenGlVersion> _glVersion;\n\t\treadonly Action _enterCode;\n\n\t\tpublic ViewportFactory(\n\t\t\tProjectPreview preview,\n\t\t\tIProperty<bool> selectionEnabled,\n\t\t\tint port,\n\t\t\tIProject project,\n\t\t\tIFuse fuse,\n\t\t\tIObserver<OpenGlVersion> glVersion,\n\t\t\tAction enterCode)\n\t\t{\n\t\t\t_preview = preview;\n\t\t\t_selectionEnabled = selectionEnabled;\n\t\t\t_assembly = preview.Assembly.Replay(1).RefCount();\n\t\t\t_port = port;\n\t\t\t_project = project;\n\t\t\t_fuse = fuse;\n\t\t\t_glVersion = glVersion;\n\t\t\t_enterCode = enterCode;\n\t\t}\n\n\t\tpublic IViewport Create(\n\t\t\tVirtualDevice initialDevice,\n\t\t\tAction<IViewport> onFocus,\n\t\t\tAction<IViewport> onClose,\n\t\t\tFunc<IViewport, Menu> menu)\n\t\t{\n\t\t\treturn new ViewportController(\n\t\t\t\tinitialDevice, onFocus, onClose, menu,\n\t\t\t\t_preview, _assembly, _port, _fuse,\n\t\t\t\tunoHost => Gizmos.Initialize(unoHost, _selectionEnabled, _project),\n\t\t\t\t_glVersion, _enterCode);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/VirtualDevices/DeviceScreen.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic enum DeviceOrientation\n\t{\n\t\tPortrait, Landscape\n\t}\n\n\tpublic sealed class DeviceScreen : IEquatable<DeviceScreen>\n\t{\n\t\tpublic readonly bool IsDefault;\n\n\t\tpublic readonly string Name;\n\n\t\treadonly Size<Points> _size;\n\t\tpublic Size<Points> SizeInPoints\n\t\t{\n\t\t\tget { return _size; }\n\t\t}\n\n\t\tpublic Size<Pixels> SizeInPixels\n\t\t{\n\t\t\tget { return _size.Mul(PixelsPerPoint); }\n\t\t}\n\n\t\tpublic Size<Inches> SizeInInches\n\t\t{\n\t\t\tget { return SizeInPixels.Mul(PhysicalPixelsPerPixel).Div(PhysicalPixelsPerInch); }\n\t\t}\n\n\t\tpublic readonly DeviceOrientation DefaultOrientation;\n\n\t\tpublic readonly Ratio<Pixels,Points> PixelsPerPoint;\n\t\tpublic readonly Ratio<Pixels,Pixels> PhysicalPixelsPerPixel;\n\t\tpublic readonly Ratio<Pixels,Inches> PhysicalPixelsPerInch;\n\n\t\tpublic DeviceScreen(\n\t\t\tstring name,\n\t\t\tSize<Pixels> size,\n\t\t\tRatio<Pixels,Points> pixelsPerPoint,\n\t\t\tRatio<Pixels,Inches> physicalPixelsPerInch,\n\t\t\tdouble physicalPixelsPerPixel = 1.0,\n\t\t\tDeviceOrientation defaultOrientation = DeviceOrientation.Portrait,\n\t\t\tbool isDefault = false)\n\t\t\t: this(\n\t\t\t\tname,\n\t\t\t\tsize.Div(pixelsPerPoint),\n\t\t\t\tpixelsPerPoint,\n\t\t\t\tphysicalPixelsPerInch,\n\t\t\t\tphysicalPixelsPerPixel,\n\t\t\t\tdefaultOrientation,\n\t\t\t\tisDefault)\n\t\t{ }\n\n\t\tpublic DeviceScreen(\n\t\t\tstring name,\n\t\t\tSize<Points> size,\n\t\t\tRatio<Pixels,Points> pixelsPerPoint,\n\t\t\tRatio<Pixels,Inches> physicalPixelsPerInch,\n\t\t\tRatio<Pixels,Pixels>? physicalPixelsPerPixel = null,\n\t\t\tDeviceOrientation defaultOrientation = DeviceOrientation.Portrait,\n\t\t\tbool isDefault = false)\n\t\t{\n\t\t\t_size = size;\n\t\t\tPixelsPerPoint = pixelsPerPoint;\n\t\t\tPhysicalPixelsPerPixel = physicalPixelsPerPixel ?? new Ratio<Pixels, Pixels>(1.0);\n\t\t\tDefaultOrientation = defaultOrientation;\n\t\t\tIsDefault = isDefault;\n\t\t\tPhysicalPixelsPerInch = physicalPixelsPerInch;\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic DeviceScreen With(\n\t\t\tstring name = null,\n\t\t\tSize<Points>? size = null,\n\t\t\tRatio<Pixels, Points>? pixelsPerPoint = null,\n\t\t\tRatio<Pixels, Inches>? physicalPixelsPerInch = null,\n\t\t\tdouble? physicalPixelsPerPixel = null,\n\t\t\tDeviceOrientation? defaultOrientation = null)\n\t\t{\n\t\t\treturn new DeviceScreen(\n\t\t\t\tname ?? Name,\n\t\t\t\tsize ?? SizeInPoints,\n\t\t\t\tpixelsPerPoint ?? PixelsPerPoint,\n\t\t\t\tphysicalPixelsPerInch ?? PhysicalPixelsPerInch,\n\t\t\t\tphysicalPixelsPerPixel ?? PhysicalPixelsPerPixel,\n\t\t\t\tdefaultOrientation ?? DefaultOrientation);\n\t\t}\n\n\t\tpublic bool Equals(DeviceScreen other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn string.Equals(Name, other.Name)\n\t\t\t\t&& _size.Equals(other._size)\n\t\t\t\t&& DefaultOrientation == other.DefaultOrientation\n\t\t\t\t&& PixelsPerPoint.Equals(other.PixelsPerPoint)\n\t\t\t\t&& PhysicalPixelsPerPixel.Equals(other.PhysicalPixelsPerPixel)\n\t\t\t\t&& PhysicalPixelsPerInch.Equals(other.PhysicalPixelsPerInch);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is DeviceScreen && Equals((DeviceScreen)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tvar hashCode = Name.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ _size.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ (int)DefaultOrientation;\n\t\t\t\thashCode = (hashCode * 397) ^ PixelsPerPoint.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ PhysicalPixelsPerPixel.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ PhysicalPixelsPerInch.GetHashCode();\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(DeviceScreen left, DeviceScreen right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(DeviceScreen left, DeviceScreen right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, DeviceScreen device)\n\t\t{\n\t\t\twriter.Write(device.Name);\n\t\t\tSize.Write(writer, device.SizeInPixels);\n\t\t\tRatio.Write(writer, device.PixelsPerPoint);\n\t\t\tRatio.Write(writer, device.PhysicalPixelsPerInch);\n\t\t\twriter.Write(device.PhysicalPixelsPerPixel);\n\t\t}\n\n\t\tpublic static DeviceScreen Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new DeviceScreen(\n\t\t\t\treader.ReadString(),\n\t\t\t\tSize.Read<Pixels>(reader),\n\t\t\t\tRatio.Read<Pixels, Points>(reader),\n\t\t\t\tRatio.Read<Pixels, Inches>(reader),\n\t\t\t\treader.ReadDouble());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/VirtualDevices/Devices.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic sealed class Devices\n\t{\n\t\tpublic static DeviceScreen Default\n\t\t{\n\t\t\tget { return LoadDefaultDevices()[0]; }\n\t\t}\n\n\t\tpublic static void SaveDefaultDevices(Stream dst)\n\t\t{\n\t\t\tusing (var src = GetDefaultDevicesStream())\n\t\t\t{\n\t\t\t\tsrc.CopyTo(dst);\n\t\t\t}\n\t\t}\n\n\t\tpublic static ImmutableList<DeviceScreen> LoadDefaultDevices()\n\t\t{\n\t\t\tusing (var stream = GetDefaultDevicesStream())\n\t\t\t{\n\t\t\t\treturn LoadDevicesFrom(stream);\n\t\t\t}\n\t\t}\n\n\t\tstatic Stream GetDefaultDevicesStream()\n\t\t{\n\t\t\tvar self = typeof (Devices);\n\t\t\tvar name = \"Outracks.Fuse.MainWindow.Stage.VirtualDevices.devices.json\";\n\t\t\tvar stream = self.Assembly.GetManifestResourceStream(name);\n\t\t\tif (stream == null)\n\t\t\t\tthrow new Exception(\"Could not find embedded resource '\" + name + \"' in assembly \" + self.Assembly.FullName);\n\n\t\t\treturn stream;\n\t\t}\n\n\t\t/// <exception cref=\"MalformedDeviceInfo\"></exception>\n\t\tpublic static ImmutableList<DeviceScreen> LoadDevicesFrom(Stream stream)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn DeviceJson\n\t\t\t\t\t.LoadFrom(stream)\n\t\t\t\t\t.Select(ToDeviceInfo)\n\t\t\t\t\t.ToImmutableList();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new MalformedDeviceInfo(e);\n\t\t\t}\n\t\t}\n\n\t\tstatic DeviceScreen ToDeviceInfo(DeviceJson json)\n\t\t{\n\t\t\treturn new DeviceScreen(\n\t\t\t\tjson.Name,\n\t\t\t\tnew Size<Pixels>(json.Width, json.Height),\n\t\t\t\tjson.PixelsPerPoint,\n\t\t\t\tjson.PhysicalPixelsPerInch,\n\t\t\t\tjson.PhysicalPixelsPerPixel,\n\t\t\t\tjson.DefaultOrientation.ToUpper() == \"LANDSCAPE\"\n\t\t\t\t\t? DeviceOrientation.Landscape\n\t\t\t\t\t: DeviceOrientation.Portrait,\n\t\t\t\tjson.IsDefault);\n\t\t}\n\t}\n\n\t// ReSharper disable once ClassNeverInstantiated.Local\n\tclass DeviceJson\n\t{\n\t\tpublic static IEnumerable<DeviceJson> LoadFrom(Stream stream)\n\t\t{\n\t\t\treturn JsonConvert.DeserializeObject<DeviceJson[]>(stream.ReadToEnd());\n\t\t}\n\n\t\tpublic string Name = \"Device\";\n\t\tpublic string DefaultOrientation = \"Portrait\";\n\t\tpublic int Width = 100;\n\t\tpublic int Height = 100;\n\t\tpublic float PixelsPerPoint = 1f;\n\t\tpublic float PhysicalPixelsPerPixel = 1f;\n\t\tpublic float PhysicalPixelsPerInch = 1f; //Nonsense default value really. Not sure what a good one is.\n\t\tpublic bool IsDefault = false;\n\t}\n\n}\n\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/VirtualDevices/DevicesMenu.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic static class DevicesMenu\n\t{\n\t\tpublic static Menu Create(\n\t\t\tstring localizedName,\n\t\t\tIProperty<VirtualDevice> currentDevice,\n\t\t\tPreviewDevices previewDevices)\n\t\t{\n\t\t\treturn Menu.Submenu(localizedName,\n\t\t\t\tpreviewDevices.Devicess.Select(devices => devices.Select((dev, j) =>\n\t\t\t\t\t\tMenu.Option(\n\t\t\t\t\t\t\tname: dev.Name,\n\t\t\t\t\t\t\tvalue: dev,\n\t\t\t\t\t\t\thotkey: GetHotKey(j),\n\t\t\t\t\t\t\tproperty: currentDevice.Convert(\n\t\t\t\t\t\t\t\tconvert: info => info.Screen,\n\t\t\t\t\t\t\t\tconvertBack: screen => new VirtualDevice(screen, screen.DefaultOrientation)))))\n\t\t\t\t\t.Concat()\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Item(\"Customize...\", previewDevices.CustomizeDevices()));\n\t\t}\n\n\t\tstatic HotKey GetHotKey(int index)\n\t\t{\n\t\t\tif (index > 9)\n\t\t\t\treturn HotKey.None;\n\n\t\t\treturn HotKey.Create(ModifierKeys.Meta, GetNumberKeyFromInt(index));\n\t\t}\n\n\t\tstatic Key GetNumberKeyFromInt(int idx)\n\t\t{\n\t\t\tswitch (idx)\n\t\t\t{\n\t\t\t\tdefault: return Key.D0;\n\t\t\t\tcase 1: return Key.D1;\n\t\t\t\tcase 2: return Key.D2;\n\t\t\t\tcase 3: return Key.D3;\n\t\t\t\tcase 4: return Key.D4;\n\t\t\t\tcase 5: return Key.D5;\n\t\t\t\tcase 6: return Key.D6;\n\t\t\t\tcase 7: return Key.D7;\n\t\t\t\tcase 8: return Key.D8;\n\t\t\t\tcase 9: return Key.D9;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/VirtualDevices/MalformedDeviceInfo.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic class MalformedDeviceInfo : Exception\n\t{\n\t\tpublic MalformedDeviceInfo(Exception innerException)\n\t\t\t: base(\"MalformedDeviceInfo\", innerException)\n\t\t{ }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/VirtualDevices/PreviewDevices.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Security;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic class PreviewDevices\n\t{\n\t\tpublic IObservable<string> LogMessages { get { return _logMessages; }}\n\t\treadonly ISubject<string> _logMessages = new Subject<string>();\n\t\treadonly IProject _project;\n\t\treadonly IShell _fileSystem;\n\n\t\tpublic PreviewDevices(\n\t\t\tIProject project,\n\t\t\tIShell fileSystem)\n\t\t{\n\t\t\t_project = project;\n\t\t\t_fileSystem = fileSystem;\n\t\t\tDevicess = project.RootDirectory.Switch(path => WatchDevicesList().StartWith(LoadDevicesForProject(path)));\n\t\t\tDefaultDevice = Devicess.Select(devices => devices.FirstOrNone(info => info.IsDefault).Or(Devices.Default));\n\t\t}\n\n\t\tpublic IObservable<DeviceScreen> DefaultDevice { get; private set; }\n\n\t\tpublic IObservable<IImmutableList<DeviceScreen>> Devicess { get; private set; }\n\n\t\tpublic IObservable<IImmutableList<DeviceScreen>> WatchDevicesList()\n\t\t{\n\t\t\treturn _project.RootDirectory.Switch(projDir =>\n\t\t\t\t_fileSystem.Watch(CustomDevicesFile(projDir))\n\t\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t\t.CatchAndRetry(delay: TimeSpan.FromSeconds(1))\n\t\t\t\t\t.Throttle(TimeSpan.FromSeconds(1.0 / 30.0))\n\t\t\t\t\t.Select(_ => LoadDevicesForProject(projDir)));\n\t\t}\n\n\t\tpublic IImmutableList<DeviceScreen> LoadDevicesForProject(AbsoluteDirectoryPath projDir)\n\t\t{\n\t\t\treturn TryLoadCustomDevices(projDir).Or(() => Devices.LoadDefaultDevices());\n\t\t}\n\n\t\tpublic Command CustomizeDevices()\n\t\t{\n\t\t\treturn _project.RootDirectory.Switch(projDir =>\n\t\t\t\tCommand.Enabled(() =>\n\t\t\t\t{\n\t\t\t\t\tif (!HasCustomDevicesFile(projDir))\n\t\t\t\t\t\tCreateCustomDevices(projDir);\n\n\t\t\t\t\tvar devicesFile = CustomDevicesFile(projDir);\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t_fileSystem.OpenWithDefaultApplication(devicesFile);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\t_logMessages.OnNext(\"Failed to open \" + devicesFile + \": \" + e.Message + \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t}\n\n\t\tOptional<ImmutableList<DeviceScreen>> TryLoadCustomDevices(AbsoluteDirectoryPath projDir)\n\t\t{\n\t\t\tif (!HasCustomDevicesFile(projDir))\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar devicesFile = CustomDevicesFile(projDir);\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn LoadCustomDevices(devicesFile);\n\t\t\t}\n\t\t\tcatch (MalformedDeviceInfo)\n\t\t\t{\n\t\t\t\t_logMessages.OnNext(\"Malformed \" + devicesFile + \"\\n\");\n\t\t\t}\n\t\t\tcatch (FileNotFoundException)\n\t\t\t{\n\t\t\t\t_logMessages.OnNext(\"Could not find \" + devicesFile + \"\\n\");\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_logMessages.OnNext(\"Failed to load \" + devicesFile + \" : \" + e.Message + \"\\n\");\n\t\t\t}\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\t/// <param name=\"devicesFile\"></param>\n\t\t/// <exception cref=\"MalformedDeviceInfo\" />\n\t\t/// <exception cref=\"IOException\" />\n\t\t/// <exception cref=\"UnauthorizedAccessException\" />\n\t\t/// <exception cref=\"SecurityException\" />\n\t\tImmutableList<DeviceScreen> LoadCustomDevices(AbsoluteFilePath devicesFile)\n\t\t{\n\t\t\tusing (var stream = _fileSystem.OpenRead(devicesFile))\n\t\t\t{\n\t\t\t\treturn Devices.LoadDevicesFrom(stream);\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"IOException\" />\n\t\t/// <exception cref=\"UnauthorizedAccessException\" />\n\t\tvoid CreateCustomDevices(AbsoluteDirectoryPath projDir)\n\t\t{\n\t\t\tusing (var stream = _fileSystem.Create(CustomDevicesFile(projDir)))\n\t\t\t{\n\t\t\t\tDevices.SaveDefaultDevices(stream);\n\t\t\t}\n\t\t}\n\n\t\tbool HasCustomDevicesFile(AbsoluteDirectoryPath projDir)\n\t\t{\n\t\t\treturn _fileSystem.Exists(CustomDevicesFile(projDir));\n\t\t}\n\n\t\tAbsoluteFilePath CustomDevicesFile(AbsoluteDirectoryPath projDir)\n\t\t{\n\t\t\treturn projDir / new FileName(\"devices.json\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/VirtualDevices/VirtualDevice.cs",
    "content": "﻿using System.IO;\n\nnamespace Outracks.Fuse.Stage\n{\n\tpublic class VirtualDevice\n\t{\n\t\tpublic readonly DeviceScreen Screen;\n\t\tpublic readonly DeviceOrientation Orientation;\n\n\t\tpublic VirtualDevice(DeviceScreen screen, DeviceOrientation orientation)\n\t\t{\n\t\t\tScreen = screen;\n\t\t\tOrientation = orientation;\n\t\t}\n\n\t\tpublic VirtualDevice With(\n\t\t\tOptional<DeviceScreen> screen = default(Optional<DeviceScreen>),\n\t\t\tOptional<DeviceOrientation> orientation = default (Optional<DeviceOrientation>))\n\t\t{\n\t\t\treturn new VirtualDevice(\n\t\t\t\tscreen.HasValue ? screen.Value : Screen,\n\t\t\t\torientation.HasValue ? orientation.Value : Orientation);\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, VirtualDevice virtualDevice)\n\t\t{\n\t\t\tDeviceScreen.Write(writer, virtualDevice.Screen);\n\t\t\twriter.Write((int)virtualDevice.Orientation);\n\t\t}\n\n\t\tpublic static VirtualDevice Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new VirtualDevice(\n\t\t\t\tDeviceScreen.Read(reader),\n\t\t\t\t(DeviceOrientation)reader.ReadInt32());\n\t\t}\n\t}\n\n\tpublic static class DeviceExtensions\n\t{\n\t\tpublic static VirtualDevice Resize(this VirtualDevice virtualDevice, Size<Points> newSize)\n\t\t{\n\t\t\tif (newSize == virtualDevice.GetOrientedSizeInPoints())\n\t\t\t\treturn virtualDevice;\n\n\t\t\treturn new VirtualDevice(\n\t\t\t\tvirtualDevice.Screen.With(\n\t\t\t\t\tname: newSize.Round().ToString(),\n\t\t\t\t\tsize: newSize,\n\t\t\t\t\tdefaultOrientation: virtualDevice.Orientation),\n\t\t\t\tvirtualDevice.Orientation);\n\t\t}\n\n\t\tpublic static Size<Pixels> GetOrientedSizeInPixels(this VirtualDevice virtualDevice)\n\t\t{\n\t\t\treturn virtualDevice.Orientation != virtualDevice.Screen.DefaultOrientation\n\t\t\t\t? virtualDevice.Screen.SizeInPixels.SwapWidthAndHeight()\n\t\t\t\t: virtualDevice.Screen.SizeInPixels;\n\t\t}\n\t\tpublic static Size<Points> GetOrientedSizeInPoints(this VirtualDevice virtualDevice)\n\t\t{\n\t\t\treturn virtualDevice.Orientation != virtualDevice.Screen.DefaultOrientation\n\t\t\t\t? virtualDevice.Screen.SizeInPoints.SwapWidthAndHeight()\n\t\t\t\t: virtualDevice.Screen.SizeInPoints;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/MainWindow/Stage/VirtualDevices/devices.json",
    "content": "[\n\t{\n\t\t\"Name\" : \"iPhone 11 Pro Max/Xs Max\",\n\t\t\"Width\" : 1242,\n\t\t\"Height\" : 2688,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\" : 458\n\t},\n\t{\n\t\t\"Name\" : \"iPhone 11/XR\",\n\t\t\"Width\" : 828,\n\t\t\"Height\" : 1792,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\" : 326\n\t},\n\t{\n\t\t\"Name\" : \"iPhone 11 Pro/X/Xs\",\n\t\t\"Width\" : 1125,\n\t\t\"Height\" : 2436,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\" : 458,\n\t\t\"IsDefault\" : true\n\t},\n\t{\n\t\t\"Name\" : \"iPhone 6+/6S+/7+/8+\",\n\t\t\"Width\" : 1242,\n\t\t\"Height\" : 2208,\n\t\t\"PixelsPerPoint\" : 3,\n\t\t\"PhysicalPixelsPerInch\" : 401,\n\t\t\"PhysicalPixelsPerPixel\" : 0.8695652173913\n\t},\n\t{\n\t\t\"Name\" : \"iPhone 6/6S/7/8\",\n\t\t\"Width\" : 750,\n\t\t\"Height\" : 1334,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\" : 326\n\t},\n\t{\n\t\t\"Name\" : \"iPhone 5/5S/5C/SE\",\n\t\t\"Width\" : 640,\n\t\t\"Height\" : 1136,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 326\n\t},\n\t{\n\t\t\"Name\" : \"iPhone 4/4S\",\n\t\t\"Width\" : 640,\n\t\t\"Height\" : 960,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 326\n\t},\n\t{\n\t\t\"Name\" : \"iPhone 2G/3G/3GS\",\n\t\t\"Width\" : 320,\n\t\t\"Height\" : 480,\n\t\t\"PixelsPerPoint\" : 1,\n\t\t\"PhysicalPixelsPerInch\" : 163\n\t},\n\t{\n\t\t\"Name\" : \"12.9 inch iPad Pro 1/2/3/4\",\n\t\t\"Width\" : 2732,\n\t\t\"Height\" : 2048,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 264,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"11 inch iPad Pro 1/2\",\n\t\t\"Width\" : 2388,\n\t\t\"Height\" : 1668,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 264,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"10.5 inch iPad Pro 1|iPad Air 3\",\n\t\t\"Width\" : 2224,\n\t\t\"Height\" : 1668,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 264,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"10.2 inch iPad 7\",\n\t\t\"Width\" : 2160,\n\t\t\"Height\" : 1620,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 264,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"9.7 inch iPad Pro 1|iPad Air 1/2|iPad 3/4/5/6\",\n\t\t\"Width\" : 2048,\n\t\t\"Height\" : 1536,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 264,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"iPad Mini 2/3/4/5\",\n\t\t\"Width\" : 2048,\n\t\t\"Height\" : 1536,\n\t\t\"PixelsPerPoint\" : 2,\n\t\t\"PhysicalPixelsPerInch\" : 326\n\t},\n\t{\n\t\t\"Name\" : \"iPad Mini 1\",\n\t\t\"Width\" : 1024,\n\t\t\"Height\" : 1536,\n\t\t\"PixelsPerPoint\" : 1,\n\t\t\"PhysicalPixelsPerInch\" : 163\n\t},\n\t{\n\t\t\"Name\" : \"iPad 1/2\",\n\t\t\"Width\" : 1024,\n\t\t\"Height\" : 768,\n\t\t\"PixelsPerPoint\" : 1,\n\t\t\"PhysicalPixelsPerInch\" : 132,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Android One\",\n\t\t\"Width\" : 480,\n\t\t\"Height\" : 854,\n\t\t\"PixelsPerPoint\": 1.5,\n\t\t\"PhysicalPixelsPerInch\": 218,\n\t},\n\t{\n\t\t\"Name\" : \"Dell Venue 8\",\n\t\t\"Width\" : 1600,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 359,\n\t},\n\t{\n\t\t\"Name\" : \"Google Pixel 4 XL\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3040,\n\t\t\"PixelsPerPoint\": 4.4,\n\t\t\"PhysicalPixelsPerInch\": 534,\n\t},\n\t{\n\t\t\"Name\" : \"Google Pixel 4\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2280,\n\t\t\"PixelsPerPoint\": 2.5,\n\t\t\"PhysicalPixelsPerInch\": 443,\n\t},\n\t{\n\t\t\"Name\" : \"Google Pixel 4a\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2340,\n\t\t\"PixelsPerPoint\": 2.5,\n\t\t\"PhysicalPixelsPerInch\": 444,\n\t},\n\t{\n\t\t\"Name\" : \"Google Pixel 3a\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2220,\n\t\t\"PixelsPerPoint\": 2.4,\n\t\t\"PhysicalPixelsPerInch\": 440,\n\t},\n\t{\n\t\t\"Name\" : \"Google Pixel XL\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 534,\n\t},\n\t{\n\t\t\"Name\" : \"Google Pixel\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 441,\n\t},\n\t{\n\t\t\"Name\" : \"HTC One M8/M9\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 441,\n\t},\n\t{\n\t\t\"Name\" : \"Huawei P40 Pro/P40 Pro+\",\n\t\t\"Width\" : 1200,\n\t\t\"Height\" : 2640,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 441,\n\t},\n\t{\n\t\t\"Name\" : \"Huawei P40/P30\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2340,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 422,\n\t},\n\t{\n\t\t\"Name\" : \"Huawei P40 lite\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2310,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 398,\n\t},\n\t{\n\t\t\"Name\" : \"Huawei Y7p\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1560,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 269,\n\t},\n\t{\n\t\t\"Name\" : \"Huawei Mate Xs Folded\",\n\t\t\"Width\" : 1148,\n\t\t\"Height\" : 2480,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 414,\n\t},\n\t{\n\t\t\"Name\" : \"Huawei Mate Xs Unfolded\",\n\t\t\"Width\" : 2200,\n\t\t\"Height\" : 2480,\n\t\t\"PixelsPerPoint\": 5.5,\n\t\t\"PhysicalPixelsPerInch\": 414,\n\t},\n\t{\n\t\t\"Name\" : \"LG G8 ThinQ|G7 ThinQ\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3120,\n\t\t\"PixelsPerPoint\": 4.5,\n\t\t\"PhysicalPixelsPerInch\": 563,\n\t},\n\t{\n\t\t\"Name\" : \"LG Q70\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2310,\n\t\t\"PixelsPerPoint\": 2.5,\n\t\t\"PhysicalPixelsPerInch\": 398,\n\t},\n\t{\n\t\t\"Name\" : \"LG Velvet|LG V60 ThinQ\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2460,\n\t\t\"PixelsPerPoint\": 2.6,\n\t\t\"PhysicalPixelsPerInch\": 395,\n\t},\n\t{\n\t\t\"Name\" : \"LG G2\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 424,\n\t},\n\t{\n\t\t\"Name\" : \"LG G3\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 534,\n\t},\n\t{\n\t\t\"Name\" : \"Moto G8 Power\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2300,\n\t\t\"PixelsPerPoint\": 2.5,\n\t\t\"PhysicalPixelsPerInch\": 397,\n\t},\n\t{\n\t\t\"Name\" : \"Moto G\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 326,\n\t},\n\t{\n\t\t\"Name\" : \"Moto X 2\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 424,\n\t},\n\t{\n\t\t\"Name\" : \"Moto X\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 312,\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 10\",\n\t\t\"Width\" : 2560,\n\t\t\"Height\" : 1600,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 299,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 9\",\n\t\t\"Width\" : 2048,\n\t\t\"Height\" : 1536,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 288,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 7 ('12)\",\n\t\t\"Width\" : 800,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 216\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 7 ('13)\",\n\t\t\"Width\" : 1200,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 323\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 6P\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 515\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 6\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 493\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 5X\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 424\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 5\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 445\n\t},\n\t{\n\t\t\"Name\" : \"Nexus 4\",\n\t\t\"Width\" : 768,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 318\n\t},\n\t{\n\t\t\"Name\" : \"OnePlus 8\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2400,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 402\n\t},\n\t{\n\t\t\"Name\" : \"OnePlus 8 Pro\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3168,\n\t\t\"PixelsPerPoint\": 4.6,\n\t\t\"PhysicalPixelsPerInch\": 513\n\t},\n\t{\n\t\t\"Name\" : \"Oppo A92\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2400,\n\t\t\"PixelsPerPoint\": 2.6,\n\t\t\"PhysicalPixelsPerInch\": 405\n\t},\n\t{\n\t\t\"Name\" : \"Oppo A37\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 294\n\t},\n\t{\n\t\t\"Name\" : \"Oppo A5 ('20)/A9/A31\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1600,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 270\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S20 Ultra\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3200,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 509\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S20+\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3200,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 524\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S20\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3200,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 566\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Z Flip\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2636,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 425\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S10+\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3040,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 526\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S10\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3040,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 551\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S9+\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2960,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 531\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S9\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2960,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 568\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S8+\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2960,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 531\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S8\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2960,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 568\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S7 Edge\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 534\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S6/S7\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 576\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy S5\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 432\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Note 10+\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 3040,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 495\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Note 10\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2280,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 401\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Note 9\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2960,\n\t\t\"PixelsPerPoint\": 4.2,\n\t\t\"PhysicalPixelsPerInch\": 514\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Note 8\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2960,\n\t\t\"PixelsPerPoint\": 4.2,\n\t\t\"PhysicalPixelsPerInch\": 523\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Note 4\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 515\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy J7 Prime\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 401\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy J7\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 267\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy J5\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 294\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy J2\",\n\t\t\"Width\" : 540,\n\t\t\"Height\" : 960,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 234\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Tab S6\",\n\t\t\"Width\" : 1600,\n\t\t\"Height\" : 2560,\n\t\t\"PixelsPerPoint\": 4,\n\t\t\"PhysicalPixelsPerInch\": 288\n\t},\n\t{\n\t\t\"Name\" : \"Samsung Galaxy Tab 10\",\n\t\t\"Width\" : 800,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 149\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia 1 I/II\",\n\t\t\"Width\" : 1644,\n\t\t\"Height\" : 3840,\n\t\t\"PixelsPerPoint\": 6.3,\n\t\t\"PhysicalPixelsPerInch\": 643\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia 10 II\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2520,\n\t\t\"PixelsPerPoint\": 2.7,\n\t\t\"PhysicalPixelsPerInch\": 457\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia L4\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1680,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 295\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia 5\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2520,\n\t\t\"PixelsPerPoint\": 2.7,\n\t\t\"PhysicalPixelsPerInch\": 449\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia C4\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 401\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia XZ\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 424\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia Z Ultra\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 344\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia Z1 Compact\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 342\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia Z2/3\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 3,\n\t\t\"PhysicalPixelsPerInch\": 424\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia Z3 Compact\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1280,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 319\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia Z3 Tablet\",\n\t\t\"Width\" : 1920,\n\t\t\"Height\" : 1200,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 283,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Sony Xperia Z4 Tablet\",\n\t\t\"Width\" : 2560,\n\t\t\"Height\" : 1600,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 299,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Poco F2 Pro|Redmi K30 5G Racing|Redmi Note 9 Pro|Redmi Note 9S\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2400,\n\t\t\"PixelsPerPoint\": 2.6,\n\t\t\"PhysicalPixelsPerInch\": 395\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Poco X2\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2400,\n\t\t\"PixelsPerPoint\": 2.6,\n\t\t\"PhysicalPixelsPerInch\": 395\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Pocophone F1\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2246,\n\t\t\"PixelsPerPoint\": 2.4,\n\t\t\"PhysicalPixelsPerInch\": 403\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Redmi Note 8 Pro\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2340,\n\t\t\"PixelsPerPoint\": 2.5,\n\t\t\"PhysicalPixelsPerInch\": 395\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Redmi Note 8\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2340,\n\t\t\"PixelsPerPoint\": 2.5,\n\t\t\"PhysicalPixelsPerInch\": 409\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Redmi Note 4/4X\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 1920,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 401\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Mi 10/10 Pro\",\n\t\t\"Width\" : 1080,\n\t\t\"Height\" : 2340,\n\t\t\"PixelsPerPoint\": 2.5,\n\t\t\"PhysicalPixelsPerInch\": 386\n\t},\n\t{\n\t\t\"Name\" : \"Xiaomi Redmi 9\",\n\t\t\"Width\" : 720,\n\t\t\"Height\" : 1600,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 266\n\t},\n\t{\n\t\t\"Name\" : \"Chromebook 11\",\n\t\t\"Width\" : 1366,\n\t\t\"Height\" : 768,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 135,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Chromebook Pixel\",\n\t\t\"Width\" : 2560,\n\t\t\"Height\" : 1700,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 239,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Chromebook 30\",\n\t\t\"Width\" : 2560,\n\t\t\"Height\" : 1600,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 101,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"iMac 27\",\n\t\t\"Width\" : 2560,\n\t\t\"Height\" : 1440,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 109,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"iMac 5K\",\n\t\t\"Width\" : 5120,\n\t\t\"Height\" : 2880,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 218,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"MacBook 12\",\n\t\t\"Width\" : 2304,\n\t\t\"Height\" : 1440,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 226,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"MacBook Air 11\",\n\t\t\"Width\" : 1366,\n\t\t\"Height\" : 768,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 135,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"MacBook Air 13\",\n\t\t\"Width\" : 1440,\n\t\t\"Height\" : 900,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 128,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"MacBook Pro 13\",\n\t\t\"Width\" : 2560,\n\t\t\"Height\" : 1600,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 227,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"MacBook Pro 15\",\n\t\t\"Width\" : 2880,\n\t\t\"Height\" : 1800,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 221,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Surface 1\",\n\t\t\"Width\" : 1366,\n\t\t\"Height\" : 768,\n\t\t\"PixelsPerPoint\": 1,\n\t\t\"PhysicalPixelsPerInch\": 148,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Surface 2/Pro\",\n\t\t\"Width\" : 1920,\n\t\t\"Height\" : 1080,\n\t\t\"PixelsPerPoint\": 1.5,\n\t\t\"PhysicalPixelsPerInch\": 208,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Surface 3\",\n\t\t\"Width\" : 1920,\n\t\t\"Height\" : 1080,\n\t\t\"PixelsPerPoint\": 1.5,\n\t\t\"PhysicalPixelsPerInch\": 204,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Surface Book\",\n\t\t\"Width\" : 3000,\n\t\t\"Height\" : 2000,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 267,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Surface Pro 3\",\n\t\t\"Width\" : 2160,\n\t\t\"Height\" : 1440,\n\t\t\"PixelsPerPoint\": 1.5,\n\t\t\"PhysicalPixelsPerInch\": 216,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t},\n\t{\n\t\t\"Name\" : \"Surface Pro 4\",\n\t\t\"Width\" : 2736,\n\t\t\"Height\" : 1824,\n\t\t\"PixelsPerPoint\": 2,\n\t\t\"PhysicalPixelsPerInch\": 265,\n\t\t\"DefaultOrientation\": \"Landscape\"\n\t}\n]\n"
  },
  {
    "path": "src/fuse/studio/MainWindow/Toolbox/Toolbox.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Inspector.Editors;\nusing Outracks.Fusion;\nusing Uno.Collections;\n\nnamespace Outracks.Fuse.Toolbox\n{\n\tpublic static class Toolbox\n\t{\n\t\tpublic static IControl Create(IProject project, ElementContext elementContext)\n\t\t{\n\t\t\tvar m = Spacer.Medium.DesiredSize.Width;\n\t\t\tvar s = Spacer.Small.DesiredSize.Width;\n\n\t\t\tvar hasClasses = project.Classes.Select(x => x.Any());\n\t\t\tvar searchString = Property.Create(\"\");\n\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Top(Layout.Dock()\n\t\t\t\t\t.Top(Separator.Medium)\n\t\t\t\t\t.Bottom(Separator.Weak)\n\t\t\t\t\t.Bottom(Separator.Medium)\n\t\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t\t.Left(Icons.ClassesSmall())\n\t\t\t\t\t.Left(Spacer.Small)\n\t\t\t\t\t.Left(Theme.Header(Texts.Toolbox_YourClasses))\n\t\t\t\t\t.Fill()\n\t\t\t\t\t.WithHeight(26))\n\t\t\t\t.Top(ThemedTextBox\n\t\t\t\t\t.Create(searchString)\n\t\t\t\t\t.WithPlaceholderText(searchString.Select(str => str != \"\"), Texts.Toolbox_YourClasses)\n\t\t\t\t\t.WithMediumPadding()\n\t\t\t\t\t.ShowWhen(hasClasses))\n\t\t\t\t.Top(\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\tIcons.DragIconSmall(),\n\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\tTexts.Toolbox_DragClassesInto_Text,\n\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\ttextAlignment: TextAlignment.Left,\n\t\t\t\t\t\t\tcolor: Theme.DescriptorText),\n\t\t\t\t\t\tSpacer.Medium)\n\t\t\t\t\t.ShowWhen(hasClasses)\n\t\t\t\t\t.CenterHorizontally())\n\t\t\t\t.Top(\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\tIcons.ExtractClass(hasClasses),\n\t\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\tTexts.Toolbox_CreateAClass_Text,\n\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Left,\n\t\t\t\t\t\t\t\tcolor: Theme.DescriptorText),\n\t\t\t\t\t\t\tSpacer.Medium)\n\t\t\t\t\t.WithMediumPadding()\n\t\t\t\t\t.HideWhen(hasClasses)\n\t\t\t\t\t.CenterHorizontally())\n\t\t\t\t.Fill(\n\t\t\t\tproject.Classes\n\t\t\t\t\t.CachePerElement(e => CreateClassItem(e, project.Context, elementContext, searchString))\n\t\t\t\t\t.StackFromTop()\n\t\t\t\t\t.WithPadding(left: m, top: s, right: m, bottom: s)\n\t\t\t\t\t.MakeScrollable(darkTheme: Theme.IsDark))\n\t\t\t\t.MakeResizable(RectangleEdge.Top, \"MyClassesHeight\");\n\t\t}\n\n\t\tstatic IControl CreateClassItem(\n\t\t\tIElement classElement,\n\t\t\tIContext context,\n\t\t\tElementContext elementContext,\n\t\t\tIObservable<string> searchString)\n\t\t{\n\t\t\tvar className = classElement[\"ux:Class\"].Or(\"\");\n\t\t\treturn Layout\n\t\t\t\t.StackFromLeft(\n\t\t\t\t\t\tclassElement.MediumIcon(Theme.Purple, Theme.IconSecondary).CenterVertically(),\n\t\t\t\t\t\tSpacer.Small,\n\t\t\t\t\t\tLabel.Create(className.AsText(), font:Theme.DefaultFont, color: Theme.DefaultText).CenterVertically())\n\t\t\t\t\t.WithPadding(new Thickness<Points>(5))\n\t\t\t\t.WithBackground(Shapes\n\t\t\t\t\t.Rectangle(\n\t\t\t\t\t\tfill: Color.FromRgb(0xaaaaaa).WithAlpha(a: 0.2f),\n\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)))\n\t\t\t\t\t.ShowWhen(context.IsSelected(classElement)))\n\t\t\t\t.DockLeft()\n\t\t\t\t.OnMouse(\n\t\t\t\t\tentered: Command.Enabled(() => context.Preview(classElement)),\n\t\t\t\t\texited: Command.Enabled(() => context.Preview(Element.Empty)),\n\t\t\t\t\tpressed: Command.Enabled(() => context.Select(classElement)),\n\t\t\t\t\tdragged: className.Select(er => SourceFragment.FromString(\"<\" + er + \"/>\")),\n\t\t\t\t\tdoubleClicked: Command.Enabled(() =>\n\t\t\t\t\t\tcontext.SetScope(root: classElement, selection: classElement)))\n\t\t\t\t.SetContextMenu(elementContext.CreateMenu(classElement))\n\t\t\t\t.WithHeight(26)\n\t\t\t\t.ShowWhen(\n\t\t\t\t\tObservable.CombineLatest(\n\t\t\t\t\t\tsearchString,\n\t\t\t\t\t\tclassName.AsText(),\n\t\t\t\t\t\t(search, name) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (search == \"\") return true;\n\t\t\t\t\t\t\treturn name.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0; // case insensitive comparison\n\t\t\t\t\t\t}));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/NagScreen.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fusion;\nusing Outracks.Fusion.Dialogs;\n\nnamespace Outracks.Fuse\n{\n\tstatic class NagScreen\n\t{\n\t\tstatic bool IsOpen;\n\t\tstatic int ReifyCount;\n\n\t\tstatic ILicenseState _state;\n\n\t\tpublic static void Initialize(ILicenseState state)\n\t\t{\n\t\t\t_state = state;\n\t\t}\n\n\t\tpublic static void Update()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!Condition())\n\t\t\t\t\treturn;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tIsOpen = true;\n\n\t\t\t\t\tif (MessageBox.ShowConfirm(Strings.NagScreen_Text + \"\\n\\n\" + \n\t\t\t\t\t\t                           Strings.NagScreen_Question,\n\t\t\t\t\t\t                       Strings.NagScreen_Caption,\n\t\t\t\t\t\t                       MessageBoxType.Information))\n\t\t\t\t\t\tProcess.Start(WebLinks.SignIn);\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tIsOpen = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t}\n\t\t}\n\n\t\tstatic bool Condition()\n\t\t{\n\t\t\tif (IsOpen)\n\t\t\t\treturn false;\n\n\t\t\treturn _state == null || ++ReifyCount % 8 == 3 && !_state.IsLicenseValid();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/OpenFolder.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio\n{\n\tstatic class OpenFolder\n\t{\n\t\tpublic static Command CreateCommand(IShell shell, IObservable<Optional<AbsoluteFilePath>> project)\n\t\t{\n\t\t\treturn project.Switch(file =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: file.HasValue,\n\t\t\t\t\taction: () => Task.Run(() => shell.ShowInFolder(file.Value))));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/OpenProject.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Fuse.Preview;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Hierarchy;\nusing Outracks.Fuse.Live;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Protocol.Messages;\nusing Outracks.Fuse.Protocol.Preview;\nusing Outracks.Fuse.Refactoring;\nusing Outracks.Fuse.Setup;\nusing Outracks.Fuse.Stage;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\nusing Outracks.Fusion.AutoReload;\nusing Outracks.IO;\nusing Outracks.IPC;\nusing Outracks.Simulator.Protocol;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass OpenProject\n\t{\n\t\treadonly IFuse _fuse;\n\t\treadonly IMessagingService _daemon;\n\t\treadonly IObservable<Exception> _errors;\n\t\treadonly Subject<string> _hostRequestMessages = new Subject<string>();\n\t\treadonly PreviewService _previewService;\n\t\treadonly IShell _shell;\n\t\treadonly SetupGuide _setupGuide;\n\t\treadonly CheckForUpdates _checkForUpdates;\n\t\treadonly Help _help;\n\t\treadonly Subject<Unit> _mainWindowFocused = new Subject<Unit>();\n\n\t\tpublic OpenProject(\n\t\t\tPreviewService previewService,\n\t\t\tIShell shell,\n\t\t\tIFuse fuse,\n\t\t\tIMessagingService daemon,\n\t\t\tIObservable<Exception> errors,\n\t\t\tActivate activate)\n\t\t{\n\t\t\t_previewService = previewService;\n\t\t\t_shell = shell;\n\t\t\t_fuse = fuse;\n\t\t\t_daemon = daemon;\n\t\t\t_errors = errors;\n\n\t\t\tvar doneLoading = _mainWindowFocused.FirstAsync();\n\t\t\t_setupGuide = new SetupGuide(fuse, doneLoading);\n\t\t\t_checkForUpdates = new CheckForUpdates(fuse.Version);\n\t\t\t_help = new Help();\n\n\t\t\t// Global default menu for macOS.\n\t\t\tApplication.DefaultMenu = MainMenu.Create(\n\t\t\t\t_fuse,\n\t\t\t\t_daemon,\n\t\t\t\t_shell,\n\t\t\t\tnull,\n\t\t\t\t_help,\n\t\t\t\tnew Menu(),\n\t\t\t\tnew Menu(),\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t_setupGuide,\n\t\t\t\t_checkForUpdates,\n\t\t\t\tnew Menu(),\n\t\t\t\tnew Debug(null),\n\t\t\t\tactivate);\n\n\t\t\tRespondToFocusRequests.Start(_daemon, _projectsOpen);\n\t\t}\n\n\t\treadonly BehaviorSubject<ImmutableList<ProjectHost>> _projectsOpen =\n\t\t\tnew BehaviorSubject<ImmutableList<ProjectHost>>(ImmutableList.Create<ProjectHost>());\n\n\n\t\tpublic Window Execute(Fusion.IDocument document, string[] args)\n\t\t{\n\t\t\tvar hack = new ReplaySubject<IObservable<BytecodeGenerated>>(1);\n\t\t\tvar project = new LiveProject(document, _shell, hack.Switch().ObserveOn(Application.MainThread));\n\t\t\tvar ignore = RecentProjects.Bump(document, project.Name.ObserveOn(Application.MainThread));\n\n\t\t\tvar preview = _previewService.StartPreview(project);\n\t\t\thack.OnNext(preview.Bytecode);\n\n\t\t\t#pragma warning disable 0219\n\t\t\tvar garbage = ExternalSelection.UpdateProjectContext(_daemon, project);\n\t\t\t#pragma warning restore 0219\n\n\t\t\tvar inspector = Fuse.Inspector.Inspector.Create(project);\n\n\t\t\tvar buildArgs = new BuildArgs(args);\n\t\t\tvar export = new Export(project, _fuse, buildArgs);\n\n\t\t\tvar usbMode = new USBMode(new AndroidPortReverser(), Observable.Return(preview.Port), _previewService);\n\t\t\tvar previewOnDevice = new PreviewOnDevice(_fuse, project, buildArgs);\n\t\t\tvar build = new Build(project, preview, previewOnDevice, usbMode.EnableUsbModeCommand, buildArgs, export);\n\n\t\t\tvar projHost = new ProjectHost(build.BuildArguments, preview, project, self =>\n\t\t\t\t_projectsOpen.OnNext(_projectsOpen.Value.Remove(self)));\n\t\t\t_projectsOpen.OnNext(_projectsOpen.Value.Add(projHost));\n\n\t\t\tvar codeView = new CodeView(preview.AccessCode, NetworkHelper\n\t\t\t\t.GetInterNetworkIps()\n\t\t\t\t.ToArray());\n\n\t\t\t// Viewport stuff\n\n\t\t\tvar selectionEnabled = Property.Create(false);\n\t\t\tvar activate = new Activate(_fuse.License, _daemon);\n\n\t\t\tvar glVersion = new Subject<OpenGlVersion>();\n\n\t\t\tvar viewport = new ViewportFactory(\n\t\t\t\tpreview,\n\t\t\t\tselectionEnabled,\n\t\t\t\tpreview.Port,\n\t\t\t\tproject,\n\t\t\t\t_fuse,\n\t\t\t\tglVersion,\n\t\t\t\tactivate.Show);\n\n\t\t\tvar mode = UserSettings.Enum<Mode>(\"WindowMode\").Or(Mode.Normal);\n\t\t\tvar previewDevices = new PreviewDevices(project, _shell);\n\t\t\tvar workspace = new StageController(\n\t\t\t\tviewport,\n\t\t\t\tpreviewDevices,\n\t\t\t\tselectionEnabled,\n\t\t\t\t_fuse.License);\n\n\t\t\tvar topMost = UserSettings.Bool(\"TopMost\").Or(false);\n\t\t\tvar windowMenu =\n\t\t\t\t  Menu.Toggle(\n\t\t\t\t\tname: Texts.SubMenu_Window_CompactMode,\n\t\t\t\t\ttoggle: mode.Convert(\n\t\t\t\t\t\tconvert: m => m == Mode.Compact,\n\t\t\t\t\t\tconvertBack: b => b ? Mode.Compact : Mode.Normal),\n\t\t\t\t\thotkey: HotKey.Create(ModifierKeys.Meta, Key.M))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Toggle(\n\t\t\t\t\tname: Texts.SubMenu_Window_KeepWindowOnTop,\n\t\t\t\t\ttoggle: topMost,\n\t\t\t\t\thotkey: HotKey.Create((Platform.IsWindows ? ModifierKeys.Shift : ModifierKeys.Alt) | ModifierKeys.Meta, Key.T))\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Submenu(Texts.SubMenu_Window_Language, LanguageMenu.Menu)\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Option(\n\t\t\t\t\tvalue: Themes.OriginalLight,\n\t\t\t\t\tname: Texts.SubMenu_Window_LightTheme,\n\t\t\t\t\tproperty: Theme.CurrentTheme)\n\t\t\t\t+ Menu.Option(\n\t\t\t\t\tvalue: Themes.OriginalDark,\n\t\t\t\t\tname: Texts.SubMenu_Window_DarkTheme,\n\t\t\t\t\tproperty: Theme.CurrentTheme);\n\n\t\t\tvar messages = preview.Messages.Replay(TimeSpan.FromSeconds(2)).RefCount();\n\n\t\t\tproject.FilePath.SubscribeUsing(projPath =>\n\t\t\t\tPushEventsToDaemon.Start(\n\t\t\t\t\tmessages: messages,\n\t\t\t\t\tdaemon: _daemon,\n\t\t\t\t\tprojectPath: projPath,\n\t\t\t\t\tprojectId: ProjectIdComputer.IdFor(projPath),\n\t\t\t\t\ttarget: BuildTarget.DotNet));\n\n\t\t\tvar sketchConverter = new SketchWatcher(_fuse.Report, _shell);\n\n\t\t\tvar classExtractor = new ClassExtractor(project);\n\n\t\t\tvar buildStartedOrLicenseChanged = project.FilePath\n\t\t\t\t.CombineLatest(build.Rebuilt.StartWith(Unit.Default));\n\n\t\t\tvar logMessages = new ReplayQueueSubject<string>();\n\n\t\t\tvar allLogMessages = messages.ToLogMessages()\n\t\t\t\t.Merge(logMessages)\n\t\t\t\t.Merge(_setupGuide.LogMessages)\n\t\t\t\t.Merge(export.LogMessages)\n\t\t\t\t.Merge(project.LogMessages)\n\t\t\t\t.Merge(previewOnDevice.LogMessages)\n\t\t\t\t.Merge(classExtractor.LogMessages)\n\t\t\t\t.Merge(_hostRequestMessages)\n\t\t\t\t.Merge(_errors.Select(e => e.Message))\n\t\t\t\t.Merge(AutoReload.Log.Select(msg => \"[Fusion AutoReload]: \" + msg)\n\t\t\t\t.Merge(glVersion.Take(1).ToLogMessages(_fuse.Report)))\n\t\t\t\t.Merge(preview.LogMessages)\n\t\t\t\t.Merge(_previewService.LogMessages)\n\t\t\t\t.Merge(sketchConverter.LogMessages)\n\t\t\t\t.Merge(previewDevices.LogMessages);\n\n\t\t\tlogMessages.OnNext(UnoVersion.LongHeader + \"\\n\" +\n\t\t\t\t\t\t\t   UnoVersion.Copyright.Replace(\"(C)\", \"©\") + \"\\n\\n\");\n\n\t\t\tvar stopPreview = preview.Start(build.BuildArguments);\n\n\t\t\t// start with a viewport\n\t\t\tworkspace.NewViewport.ExecuteOnce();\n\n\t\t\tvar projectMenu =\n\t\t\t\t  ProjectMenu.CommandItems(project.FilePath.Select(Optional.Some), _shell)\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ ProjectMenu.FileItems(project, _shell)\n\t\t\t\t+ Menu.Separator\n\t\t\t\t+ Menu.Item(Texts.SubMenu_Project_SketchImport, sketchConverter.ShowDialog());\n\n\t\t\tvar debug = new Debug(project);\n\n\t\t\tvar elementContext = new ElementContext(project.Context, project, _daemon);\n\n\t\t\tvar errorView = new ErrorView(messages, project.FilePath, _daemon, preview.ClientRemoved);\n\n\t\t\tvar logView = new LogView(allLogMessages, messages, errorView);\n\t\t\tvar sketchWatch = sketchConverter.Watch(project);\n\t\t\tvar window = MainWindow.Create(\n\t\t\t\tprojectName: project.Name,\n\t\t\t\tsearch: Control.Empty,//search.Control,\n\t\t\t\toutline: CreateLeftPane(project, elementContext, project.Context, _shell, classExtractor),\n\t\t\t\tbookmarks: Control.Empty,\n\t\t\t\tstage: workspace,\n\t\t\t\tnotifications: Layout.StackFromTop(\n\t\t\t\t\tSimulatorNotifications.CreateBusyIndicator(messages),\n\t\t\t\t\tSimulatorNotifications.Create(messages, build.Rebuild, logView.IsExpanded)),\n\t\t\t\tinspector: inspector,\n\t\t\t\tattributes: Control.Empty,//DataContext.Create(workspace.Viewport, selection.Element),\n\t\t\t\tlogview: logView,\n\t\t\t\tmenu: MainMenu.Create(\n\t\t\t\t\t_fuse,\n\t\t\t\t\t_daemon,\n\t\t\t\t\t_shell,\n\t\t\t\t\tworkspace,\n\t\t\t\t\t_help,\n\t\t\t\t\telementContext.CreateMenu(project.Context.CurrentSelection),\n\t\t\t\t\tprojectMenu,\n\t\t\t\t\tbuild,\n\t\t\t\t\texport,\n\t\t\t\t\t_setupGuide,\n\t\t\t\t\t_checkForUpdates,\n\t\t\t\t\twindowMenu,\n\t\t\t\t\tdebug,\n\t\t\t\t\tactivate),\n\t\t\t\tclosed: Command.Enabled(() =>\n\t\t\t\t{\n\t\t\t\t\tstopPreview.Dispose();\n\t\t\t\t\tpreview.Dispose();\n\t\t\t\t\tprojHost.Dispose();\n\t\t\t\t\tproject.FilePath.Take(1).Subscribe(path =>\n\t\t\t\t\t\t_daemon.Broadcast(new ProjectClosed { ProjectId = ProjectIdComputer.IdFor(path) }));\n\t\t\t\t\tproject.Dispose();\n\t\t\t\t\tworkspace.Dispose();\n\t\t\t\t\tsketchWatch.Dispose();\n\t\t\t\t}),\n\t\t\t\tselectionEnabled: selectionEnabled,\n\t\t\t\ttopMost: topMost,\n\t\t\t\tmode: mode,\n\t\t\t\tmainWindowFocused: _mainWindowFocused.Update(Unit.Default),\n\t\t\t\tcontext: project.Context,\n\t\t\t\tcodeView: codeView,\n\t\t\t\tlicense: _fuse.License);\n\n\t\t\treturn window;\n\t\t}\n\n\t\tIControl CreateLeftPane(\n\t\t\tLiveProject project,\n\t\t\tElementContext elementContext,\n\t\t\tIContext context,\n\t\t\tIShell fileSystem,\n\t\t\tIClassExtractor classExtractor)\n\t\t{\n\t\t\treturn Modal.Host(modalHost =>\n\t\t\t{\n\t\t\t\tvar makeClassViewModel = new ExtractClassButtonViewModel(\n\t\t\t\t\tproject,\n\t\t\t\t\tcontext,\n\t\t\t\t\tdialogModel => ExtractClassView.OpenDialog(modalHost, dialogModel),\n\t\t\t\t\tfileSystem,\n\t\t\t\t\tclassExtractor);\n\n\t\t\t\tvar hierarchy = TreeView.Create(\n\t\t\t\t\tnew TreeViewModel(\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tmakeClassViewModel.HighlightSelectedElement,\n\t\t\t\t\t\telementContext.CreateMenu));\n\n\t\t\t\treturn Layout.Dock()\n\t\t\t\t\t.Bottom(Toolbox.Toolbox.Create(project, elementContext))\n\t\t\t\t\t.Top(ExtractClassView.CreateButton(makeClassViewModel))\n\t\t\t\t\t.Fill(hierarchy);\n\t\t\t});\n\t\t}\n\t}\n\n\tenum Mode\n\t{\n\t\tNormal,\n\t\tCompact\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/OpenTerminal.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio\n{\n\tstatic class OpenTerminal\n\t{\n\t\tpublic static Command CreateCommand(IShell shell, IObservable<Optional<AbsoluteFilePath>> path)\n\t\t{\n\t\t\treturn path.Switch(file =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: file.HasValue,\n\t\t\t\t\taction: () => Task.Run(() => shell.OpenTerminal(file.Value.ContainingDirectory))));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/OpenTextEditor.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing Outracks.Diagnostics;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Uno;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic static class OpenTextEditor\n\t{\n\t\tpublic static Menu CreateMenu(IObservable<Optional<AbsoluteFilePath>> path)\n\t\t{\n\t\t\tvar sublimeTextPath = ApplicationPaths.SublimeTextPath();\n\t\t\tvar vsCodePath = ApplicationPaths.VsCodePath();\n\n\t\t\treturn path\n\t\t\t\t.SelectPerElement(project => project.ContainingDirectory)\n\t\t\t\t.Select(dir => new []\n\t\t\t\t{\n\t\t\t\t\tMenu.Item(\n\t\t\t\t\t\tname: Texts.SubMenu_Project_OpenSublime,\n\t\t\t\t\t\tcommand: Command.Create(\n\t\t\t\t\t\t\tisEnabled: dir.HasValue && sublimeTextPath.HasValue,\n\t\t\t\t\t\t\taction: () => Task.Run(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (Platform.IsMac)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tExternalApplication.FromAppBundle(sublimeTextPath.Value).Open(dir.Value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar ps = new ProcessStartInfo()\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tFileName = (sublimeTextPath.Value / new FileName(\"sublime_text.exe\")).NativePath,\n\t\t\t\t\t\t\t\t\t\tArguments = dir.Value.NativePath.QuoteSpace(),\n\t\t\t\t\t\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\t\t\t\t\t\tWindowStyle = ProcessWindowStyle.Hidden\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tps.UpdatePathEnvironment();\n\n\t\t\t\t\t\t\t\t\tProcess.Start(ps);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}))),\n\t\t\t\t\tMenu.Item(\n\t\t\t\t\t\tname: Texts.SubMenu_Project_OpenVSCode,\n\t\t\t\t\t\tcommand: Command.Create(\n\t\t\t\t\t\t\tisEnabled: dir.HasValue && vsCodePath.HasValue,\n\t\t\t\t\t\t\taction: () => Task.Run(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (Platform.IsMac)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar ps = new ProcessStartInfo()\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tFileName = (vsCodePath.Value / \"Contents\" / \"Resources\" / \"app\" / \"bin\" / new FileName(\"code\")).NativePath,\n\t\t\t\t\t\t\t\t\t\tArguments = dir.Value.NativePath.QuoteSpace(),\n\t\t\t\t\t\t\t\t\t\tUseShellExecute = false\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tProcess.Start(ps);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar ps = new ProcessStartInfo()\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tFileName = (vsCodePath.Value / \"bin\" / new FileName(\"code.cmd\")).NativePath,\n\t\t\t\t\t\t\t\t\t\tArguments = dir.Value.NativePath.QuoteSpace(),\n\t\t\t\t\t\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\t\t\t\t\t\tWindowStyle = ProcessWindowStyle.Hidden\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tps.UpdatePathEnvironment();\n\n\t\t\t\t\t\t\t\t\tProcess.Start(ps);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}))),\n\t\t\t\t})\n\t\t\t\t.Concat();\n\t\t}\n\n\t\tpublic static void UpdatePathEnvironment(this ProcessStartInfo ps)\n\t\t{\n\t\t\tps.EnvironmentVariables[\"Path\"] =\n\t\t\t\t(Environment.GetEnvironmentVariable(\"Path\", EnvironmentVariableTarget.Machine)) + \";\" +\n\t\t\t\t\t(Environment.GetEnvironmentVariable(\"Path\", EnvironmentVariableTarget.User));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/PreviewOnDevice.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Setup;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass PreviewOnDevice\n\t{\n\t\tpublic PreviewOnDevice(IFuse fuse, IProject project, BuildArgs args)\n\t\t{\n\t\t\tvar output = new Subject<string>();\n\n\t\t\tLogMessages = output;\n\n\t\t\tvar startedAndroidPreview = new Subject<Unit>();\n\t\t\tMissingAndroidNotification.Create(fuse, startedAndroidPreview);\n\n\t\t\tPreviewAndroidApp = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Enabled(\n\t\t\t\t\taction: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tstartedAndroidPreview.OnNext(Unit.Default);\n\t\t\t\t\t\tfuse.RunFuse(\n\t\t\t\t\t\t\t\"preview\",\n\t\t\t\t\t\t\tnew[] { path.NativePath, \"-t=android\", \"--quit-after-apk-launch\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\t\tObserver.Create<string>(output.OnNext));\n\t\t\t\t\t}))\n\t\t\t\t.Switch();\n\n\t\t\tPreviewAndroidEmulatorApp = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Enabled(\n\t\t\t\t\taction: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tstartedAndroidPreview.OnNext(Unit.Default);\n\t\t\t\t\t\tfuse.RunFuse(\n\t\t\t\t\t\t\t\"preview\",\n\t\t\t\t\t\t\tnew[] { path.NativePath, \"-t=android-emu\", \"--quit-after-apk-launch\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\t\tObserver.Create<string>(output.OnNext));\n\t\t\t\t\t}))\n\t\t\t\t.Switch();\n\n\t\t\tPreviewIosApp = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: Platform.IsMac,\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"preview\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=ios\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tPreviewIosSimulatorApp = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\tCommand.Create(\n\t\t\t\t\tisEnabled: Platform.IsMac,\n\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\"preview\",\n\t\t\t\t\t\tnew[] { path.NativePath, \"-t=ios-sim\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tPreviewNativeApp = project.FilePath.CombineLatest(args.All, (path, allArgs) =>\n\t\t\t\t\tCommand.Enabled(\n\t\t\t\t\t\taction: () => fuse.RunFuse(\n\t\t\t\t\t\t\t\"preview\",\n\t\t\t\t\t\t\tnew[] { path.NativePath, \"-t=native\" }.Concat(allArgs).ToArray(),\n\t\t\t\t\t\t\tObserver.Create<string>(output.OnNext))))\n\t\t\t\t.Switch();\n\n\t\t\tMenu = Menu.Item(Texts.SubMenu_Preview_Android, PreviewAndroidApp)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_iOS + (!Platform.IsMac ? \" (\" + Texts.Label_MacOnly + \")\" : \"\"), PreviewIosApp)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_Native, PreviewNativeApp);\n\t\t\tMenu = Menu.Item(Texts.SubMenu_Preview_Android, PreviewAndroidApp)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_AndroidEmulator, PreviewAndroidEmulatorApp)\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_iOS + (!Platform.IsMac ? \" (\" + Texts.Label_MacOnly + \")\" : \"\"), PreviewIosApp)\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_iOSSimulator + (!Platform.IsMac ? \" (\" + Texts.Label_MacOnly + \")\" : \"\"), PreviewIosSimulatorApp)\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Preview_Native, PreviewNativeApp);\n\n\t\t}\n\n\t\tpublic Menu Menu { get; private set; }\n\n\t\tpublic Command PreviewIosApp { get; private set; }\n\t\tpublic Command PreviewIosSimulatorApp { get; private set; }\n\t\tpublic Command PreviewAndroidApp { get; private set; }\n\t\tpublic Command PreviewAndroidEmulatorApp { get; private set; }\n\t\tpublic Command PreviewNativeApp { get; private set; }\n\t\tpublic IObservable<string> LogMessages { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Program.cs",
    "content": "using System;\nusing System.Globalization;\nusing System.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading;\nusing Fuse.Preview;\nusing Outracks.Diagnostics;\nusing Outracks.Extensions;\nusing Outracks.Fuse.Dashboard;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Testing;\nusing Outracks.Fusion;\nusing Outracks.Fusion.Dialogs;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic static class Program\n\t{\n\t\tstatic Program()\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n#if DEBUG\n\t\t\tConsoleExtensions.RedirectStreamsToLogFiles(\"fuse-studio\");\n#endif\n\t\t}\n\n\t\t[STAThread]\n\t\tpublic static void Main(string[] argsArray)\n\t\t{\n\t\t\tLocaleCulture.Initialize(CultureInfo.CurrentUICulture);\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n\n\t\t\t// This is required to get all required build tools in path\n\t\t\tif (Platform.IsMac)\n\t\t\t\tEnvironment.SetEnvironmentVariable(\"PATH\", \"/usr/local/bin:/opt/local/bin:/opt/homebrew/bin:\" + Environment.GetEnvironmentVariable(\"PATH\"));\n\n\t\t\tvar argumentList = argsArray.ToList();\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse-studio\", argumentList, remoteLicense: true);\n\t\t\tvar shell = new Shell();\n\t\t\tvar errors = new ReplaySubject<Exception>(1);\n\t\t\tNagScreen.Initialize(fuse);\n\n\t\t\tif (!Application.InitializeAsDocumentApp(argumentList, \"Fuse.Studio\"))\n\t\t\t\treturn;\n\n\t\t\t// Initialize console redirection early to show output during startup in debug window\n\t\t\tConsoleOutputWindow.InitializeConsoleRedirection();\n\n\t\t\tUserSettings.Settings = PersistentSettings.Load(\n\t\t\t\tusersettingsfile: fuse.UserDataDir / new FileName(\"studio-settings.json\"),\n\t\t\t\tonError: errors.OnNext);\n\n\t\t\tvar daemon = fuse.ConnectOrSpawnAsync(\"fuse-studio\").ToObservable().Switch();\n\t\t\tfuse.License.Subscribe(fuse.FuseExe, daemon);\n\n\t\t\tvar previewService = new PreviewService();\n\t\t\tApplication.Terminating += previewService.Dispose;\n\n\t\t\tvar activate = new Activate(fuse.License, daemon);\n\n\t\t\tvar openProject = new OpenProject(\n\t\t\t\tpreviewService,\n\t\t\t\tshell, fuse, daemon,\n\t\t\t\terrors, activate);\n\n\t\t\tvar createProject = new CreateProject(fuse);\n\t\t\tvar splashWindow = new Dashboard.Dashboard(createProject, fuse, daemon, activate);\n\n\t\t\tApplication.CreateDocumentWindow = document => openProject.Execute(document, argumentList.ToArray());\n\n\t\t\tvar launched = false;\n\t\t\tApplication.LaunchedWithoutDocuments = () => {\n\t\t\t\tif (!launched)\n\t\t\t\t{\n\t\t\t\t\tlaunched = true;\n\n\t\t\t\t\t// Bring to front (#124).\n\t\t\t\t\tApplication.MainThread.InvokeAsync(() => {\n\t\t\t\t\t\tConsole.WriteLine(\"Bringing to front\");\n\t\t\t\t\t\tMessageBox.BringToFront();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t});\n#if DEBUG\n\t\t\t\t\t// Start with a project open when DEBUG.\n\t\t\t\t\tApplication.OpenDocument(fuse.FuseRoot.ContainingDirectory.ContainingDirectory / \"empty\" / new FileName(\"app.unoproj\"), true);\n\t\t\t\t\tConsoleOutputWindow.Create();\n\t\t\t\t\treturn;\n#endif\n\t\t\t\t}\n\n\t\t\t\t// Start with dashboard.\n\t\t\t\tsplashWindow.Show();\n\t\t\t};\n\n\t\t\tvar errorDialogIsOpen = false;\n\t\t\tfuse.License.Error += (_, __) => {\n\t\t\t\tif (errorDialogIsOpen)\n\t\t\t\t\treturn;\n\n\t\t\t\terrorDialogIsOpen = true;\n\t\t\t\tMessageBox.BringToFront();\n\t\t\t\tMessageBox.Show(Strings.License_Error_Text, \"fuse X\", MessageBoxType.Error);\n\t\t\t\terrorDialogIsOpen = false;\n\t\t\t};\n\n\t\t\tLanguageMenu.Initialize();\n\t\t\tApplication.Run();\n\t\t}\n\t}\n\n\tstatic class DocumentTypes\n\t{\n\t\tpublic static readonly FileFilter Project = new FileFilter(\"fuse X Project\", \"unoproj\");\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Attribute.Convert.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ConvertProperty\n\t{\n\t\tpublic static IAttribute<TResult> ConvertExpression<TArgs, TResult>(\n\t\t\tthis IAttribute<TArgs> self,\n\t\t\tFunc<TArgs, TResult> convert,\n\t\t\tFunc<TResult, TArgs> convertBack)\n\t\t{\n\t\t\treturn Attribute.Create(\n\t\t\t\tself.Expression.Select(e => e.Select(convert, t => t.ToString())),\n\t\t\t\tself.Select(convert),\n\t\t\t\tself.Clear,\n\t\t\t\t(t, save) => self.Write(convertBack(t), save),\n\t\t\t\tself.IsReadOnly,\n\t\t\t\tself.StringValue);\n\t\t}\n\n\t\tpublic static IAttribute<TTo> Convert<TTo>(\n\t\t\tthis IProperty<Optional<string>> property,\n\t\t\tFunc<string, Parsed<TTo>> parse,\n\t\t\tFunc<TTo, string> serialize,\n\t\t\tTTo defaultValue)\n\t\t{\n\t\t\treturn Attribute.Create(\n\t\t\t\texpression: property.Select(v =>\n\t\t\t\t\tv.MatchWith(\n\t\t\t\t\t\tsome: value => UxExpression.Local(value, parse, defaultValue),\n\t\t\t\t\t\tnone: () => UxExpression.Inherited(defaultValue))),\n\t\t\t\tvalue: property.SelectSome(v =>\n\t\t\t\t\tv.MatchWith(\n\t\t\t\t\t\tsome: prop => parse(prop).Value,\n\t\t\t\t\t\tnone: () => Optional.Some(defaultValue))),\n\t\t\t\tclear: Command.Enabled(() => property.Write(Optional.None())),\n\t\t\t\twrite: (value, save) => property.Write(serialize(value), save),\n\t\t\t\tisReadOnly: property.IsReadOnly,\n\t\t\t\tstringValue: property.OrEmpty());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Attribute.Focus.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class FocusProperty\n\t{\n\t\tpublic static IAttribute<TOut> Focus<TIn, TOut>(\n\t\t\tthis IAttribute<TIn> property,\n\t\t\tFunc<TIn, TOut> select,\n\t\t\tFunc<TIn, TOut, TIn> combine,\n\t\t\tFunc<string, Parsed<TOut>> parse,\n\t\t\tFunc<TOut, string> serialize,\n\t\t\tTOut inheritedValue)\n\t\t{\n\t\t\treturn property.Focus(\n\t\t\t\tc => c.Local\n\t\t\t\t\t.SelectMany(l => l.Value)\n\t\t\t\t\t.MatchWith(\n\t\t\t\t\t\tsome: local => UxExpression.Local(serialize(select(local)), parse, inheritedValue),\n\t\t\t\t\t\tnone: () => UxExpression.Inherited(inheritedValue)),\n\t\t\t\tselect,\n\t\t\t\tcombine);\n\t\t}\n\n\t\tpublic static IAttribute<TOut> Focus<TIn, TOut>(\n\t\t\tthis IAttribute<TIn> property,\n\t\t\tFunc<IExpression<TIn>, IExpression<TOut>> selectExpression,\n\t\t\tFunc<TIn, TOut> select,\n\t\t\tFunc<TIn, TOut, TIn> combine,\n\t\t\tOptional<Command> clear = default(Optional<Command>))\n\t\t{\n\t\t\treturn Attribute.Create(\n\t\t\t\tproperty.Expression.Select(selectExpression),\n\t\t\t\tproperty.Select(@select),\n\t\t\t\tclear.Or(property.Clear),\n\t\t\t\t(value, save) => property.Take(1).Subscribe(lastValue => property.Write(combine(lastValue, value), save)),\n\t\t\t\tproperty.IsReadOnly,\n\t\t\t\tproperty.StringValue);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Attribute.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static partial class Attribute\n\t{\n\t\tpublic static IAttribute<T> Default<T>()\n\t\t{\n\t\t\treturn Create(\n\t\t\t\tObservable.Return(UxExpression.Inherited(default(T))),\n\t\t\t\tObservable.Return(default(T)),\n\t\t\t\tclear: Command.Disabled,\n\t\t\t\twrite: (t, save) => { },\n\t\t\t\tisReadOnly: Observable.Return(true),\n\t\t\t\tstringValue: Property.Constant(\"\"));\n\t\t}\n\n\t\tpublic static IObservable<bool> HasLocalValue<T>(this IAttribute<T> property)\n\t\t{\n\t\t\treturn property.Expression.Select(e => e.Local.HasValue);\n\t\t}\n\n\t\tpublic static IObservable<Optional<T>> LocalValue<T>(this IAttribute<T> property)\n\t\t{\n\t\t\treturn property.Expression.Select(e => e.Local.SelectMany(l => l.Value));\n\t\t}\n\n\t\tpublic static IAttribute<T> Create<T>(\n\t\t\tIObservable<IExpression<T>> expression,\n\t\t\tIObservable<T> value,\n\t\t\tCommand clear,\n\t\t\tAction<T, bool> write,\n\t\t\tIObservable<bool> isReadOnly,\n\t\t\tIProperty<string> stringValue)\n\t\t{\n\t\t\treturn new Implementation<T>\n\t\t\t{\n\t\t\t\tClear = clear,\n\t\t\t\tWriter = write,\n\t\t\t\tIsReadOnly = isReadOnly,\n\t\t\t\tExpression = expression,\n\t\t\t\tValue = value,\n\t\t\t\tStringValue = stringValue,\n\t\t\t};\n\t\t}\n\n\t\tclass Implementation<T> : IAttribute<T>\n\t\t{\n\t\t\tpublic IObservable<T> Value { get; set; }\n\n\t\t\tpublic IProperty<string> StringValue { get; set; }\n\t\t\tpublic IObservable<IExpression<T>> Expression { get; set; }\n\n\t\t\tpublic IObservable<bool> IsReadOnly { get; set; }\n\n\t\t\tpublic Command Clear { get; set; }\n\n\t\t\tpublic Action<T, bool> Writer { private get; set; }\n\n\t\t\tpublic void Write(T value, bool save)\n\t\t\t{\n\t\t\t\tWriter(value, save);\n\t\t\t}\n\n\t\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t\t{\n\t\t\t\treturn Value.Subscribe(observer);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/Angle.cs",
    "content": "namespace Outracks.Fuse\n{\n\tpublic static class AngleParser\n\t{\n\t\tpublic static IAttribute<double> GetAngle(this IElement element, string property, double defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseAngle,\n\t\t\t\tserialize: d => d.ToString(\"0\"),\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tstatic Parsed<double> TryParseAngle(string str)\n\t\t{\n\t\t\tdouble value;\n\t\t\tif (double.TryParse(str.StripSuffix(\"deg\"), out value))\n\t\t\t\treturn Parsed.Success(value, str);\n\n\t\t\treturn Parsed.Failure<double>(str);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/Boolean.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class BooleanParser\n\t{\n\t\tpublic static IAttribute<bool> GetBoolean(this IElement element, string property, bool defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseBoolean,\n\t\t\t\tserialize: t => t.ToString(),\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tstatic Parsed<bool> TryParseBoolean(string str)\n\t\t{\n\t\t\tbool value;\n\t\t\tif (Boolean.TryParse(str, out value))\n\t\t\t\treturn Parsed.Success(value, str);\n\n\t\t\treturn Parsed.Failure<bool>(str);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/Color.cs",
    "content": "using System;\nusing System.Globalization;\nusing System.Linq;\nusing Outracks.Fusion;\nusing Uno.UX.Markup;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ColorParser\n\t{\n\t\tpublic static IAttribute<Color> GetColor(this IElement element, string property, Color defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseColor,\n\t\t\t\tserialize: Serialize,\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\n\t\tpublic static string Serialize(Color color)\n\t\t{\n\t\t\treturn WriteHex(color.R, color.G, color.B, color.A);\n\t\t}\n\n\t\tpublic static string WriteHex(params double[] values)\n\t\t{\n\t\t\tvar fullHex = DumbWriteHex(values);\n\t\t\t// try to remove fourth FF component\n\t\t\tif (values.Length == 4 && fullHex.EndsWith(\"FF\"))\n\t\t\t\tfullHex = fullHex.StripSuffix(\"FF\");\n\n\t\t\t// try with short form\n\t\t\tvar shortHex = \"#\" + fullHex[1] + fullHex[3] + fullHex[5];\n\t\t\tvar shortHexValue = TryReadComponents(shortHex, 3).Or(new double[0]);\n\t\t\tvar shortHexAsFull = DumbWriteHex(shortHexValue);\n\t\t\tif (shortHexAsFull == fullHex)\n\t\t\t\treturn shortHex;\n\n\t\t\t// otherwise full hex (that might lack the last part)\n\t\t\treturn fullHex;\n\t\t}\n\n\t\tstatic string DumbWriteHex(double[] values)\n\t\t{\n\t\t\tvar s = \"#\";\n\t\t\tforeach (var value in values)\n\t\t\t\ts += ((int)(value * 255.0)).ToString(\"X2\");\n\t\t\treturn s;\n\t\t}\n\n\t\tpublic static string WriteComponents(double[] values)\n\t\t{\n\t\t\tif (values.Distinct().IsSingle())\n\t\t\t\treturn values.FirstOrDefault().ToString(\"0.##\", CultureInfo.InvariantCulture);\n\n\t\t\treturn values.Select(v => v.ToString(\"0.##\", CultureInfo.InvariantCulture)).Join(\", \");\n\t\t}\n\t\tpublic static Optional<double[]> TryReadComponents(string value, int componentCount)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar parsedeValue = AtomicValueParser.ParseFloatVector<float>(value, componentCount, FileSourceInfo.Unknown);\n\t\t\t\treturn parsedeValue.Components.Select(c => (double)c.Value).ToArray();\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t\t/*\n\t\t\tvar parts = value.Split(\",\");\n\t\t\tvar components = new double[parts.Length];\n\n\t\t\tfor (int i = 0; i < parts.Length; i++)\n\t\t\t{\n\t\t\t\tif (!double.TryParse(parts[i], NumberStyles.Any, CultureInfo.InvariantCulture, out components[i]))\n\t\t\t\t\treturn Optional.None();\n\t\t\t}\n\n\t\t\tif (components.Length == componentCount)\n\t\t\t\treturn components;\n\n\t\t\tif (components.Length == 1)\n\t\t\t{\n\t\t\t\tvar uniformResult = new double[componentCount];\n\t\t\t\tfor (int i = 0; i < componentCount; i++)\n\t\t\t\t\tuniformResult[i] = components[0];\n\t\t\t\treturn uniformResult;\n\t\t\t}\n\t\t\t*/\n\n\t\t}\n\t\tpublic static Parsed<Color> TryParseColor(string str)\n\t\t{\n\t\t\tif (str.StartsWith(\"#\"))\n\t\t\t\treturn new Parsed<Color>\n\t\t\t\t{\n\t\t\t\t\tString = str,\n\t\t\t\t\tValue = TryParseColorHex(str.AfterFirst(\"#\")),\n\t\t\t\t};\n\n\t\t\tvar vector = str.Split(\",\").Select(v => v.Trim()).ToArray();\n\t\t\tswitch (vector.Length)\n\t\t\t{\n\t\t\t\tcase 3:\n\t\t\t\t\treturn new Parsed<Color>\n\t\t\t\t\t{\n\t\t\t\t\t\tString = str,\n\t\t\t\t\t\tValue =\n\t\t\t\t\t\t\tScalarParser.TryParseFloat(vector[0]).Value.SelectMany(r =>\n\t\t\t\t\t\t\tScalarParser.TryParseFloat(vector[1]).Value.SelectMany(g =>\n\t\t\t\t\t\t\tScalarParser.TryParseFloat(vector[2]).Value.Select(b =>\n\t\t\t\t\t\t\t\tnew Color(r, g, b, 1))))\n\t\t\t\t\t};\n\t\t\t\tcase 4:\n\t\t\t\t\treturn new Parsed<Color>\n\t\t\t\t\t{\n\t\t\t\t\t\tString = str,\n\t\t\t\t\t\tValue =\n\t\t\t\t\t\t\tScalarParser.TryParseFloat(vector[0]).Value.SelectMany(r =>\n\t\t\t\t\t\t\tScalarParser.TryParseFloat(vector[1]).Value.SelectMany(g =>\n\t\t\t\t\t\t\tScalarParser.TryParseFloat(vector[2]).Value.SelectMany(b =>\n\t\t\t\t\t\t\tScalarParser.TryParseFloat(vector[3]).Value.Select(a =>\n\t\t\t\t\t\t\t\tnew Color(r, g, b, a)))))\n\t\t\t\t\t};\n\t\t\t}\n\t\t\treturn Parsed.Failure<Color>(str);\n\t\t}\n\n\t\tstatic Optional<Color> TryParseColorHex(string hex)\n\t\t{\n\t\t\tswitch (hex.Length)\n\t\t\t{\n\t\t\t\tcase 3: return TryParseColorHex111(hex);\n\t\t\t\tcase 4: return TryParseColorHex1111(hex);\n\t\t\t\tcase 6: return TryParseColorHex222(hex);\n\t\t\t\tcase 8: return TryParseColorHex2222(hex);\n\t\t\t\tdefault: return Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tstatic Optional<Color> TryParseColorHex2222(string hex)\n\t\t{\n\t\t\treturn\n\t\t\t\tScalarParser.ParseHex(hex.Substring(0, 2)).SelectMany(r =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(2, 2)).SelectMany(g =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(4, 2)).SelectMany(b =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(6, 2)).Select(a => new Color(r, g, b, a)))));\n\t\t}\n\n\n\t\tstatic Optional<Color> TryParseColorHex222(string hex)\n\t\t{\n\t\t\treturn\n\t\t\t\tScalarParser.ParseHex(hex.Substring(0, 2)).SelectMany(r =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(2, 2)).SelectMany(g =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(4, 2)).Select(b => new Color(r, g, b, 1))));\n\t\t}\n\n\t\tstatic Optional<Color> TryParseColorHex1111(string hex)\n\t\t{\n\t\t\treturn\n\t\t\t\tScalarParser.ParseHex(hex.Substring(0, 1)).SelectMany(r =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(1, 1)).SelectMany(g =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(2, 1)).SelectMany(b =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(3, 1)).Select(a => new Color(r, g, b, a)))));\n\t\t}\n\n\t\tstatic Optional<Color> TryParseColorHex111(string hex)\n\t\t{\n\t\t\treturn\n\t\t\t\tScalarParser.ParseHex(hex.Substring(0, 1)).SelectMany(r =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(1, 1)).SelectMany(g =>\n\t\t\t\tScalarParser.ParseHex(hex.Substring(2, 1)).Select(b => new Color(r, g, b, 1))));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/Enum.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class EnumParser\n\t{\n\t\tpublic static IAttribute<T> GetEnum<T>(this IElement element, string property, T defaultValue)\n\t\t\twhere T : struct\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseEnum<T>,\n\t\t\t\tserialize: t => t.ToString(),\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tstatic Parsed<T> TryParseEnum<T>(string str)\n\t\t\twhere T : struct\n\t\t{\n\t\t\tT value;\n\t\t\tif (Enum.TryParse(str, out value) && Enum.IsDefined(typeof(T), value))\n\t\t\t\treturn Parsed.Success(value, str);\n\n\t\t\treturn Parsed.Failure<T>(str);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/Scalar.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class ScalarParser\n\t{\n\t\tpublic static IAttribute<double> GetDouble(this IElement element, string property, double defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseDouble,\n\t\t\t\tserialize: d => d.ToString(\"0.###\"),\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tpublic static IAttribute<int> GetInt(this IElement element, string property, int defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseInt,\n\t\t\t\tserialize: d => d.ToString(),\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tpublic static Optional<float> ParseHex(string hex)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Convert.ToUInt32(hex, 16) / (float)Math.Pow(16, hex.Length);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic static Parsed<float> TryParseFloat(string str)\n\t\t{\n\t\t\tfloat value;\n\t\t\tif (float.TryParse(str, out value))\n\t\t\t\treturn Parsed.Success(value, str);\n\n\t\t\treturn Parsed.Failure<float>(str);\n\t\t}\n\n\t\tpublic static Parsed<double> TryParseDouble(string str)\n\t\t{\n\t\t\tdouble value;\n\t\t\tif (double.TryParse(str, out value))\n\t\t\t\treturn Parsed.Success(value, str);\n\n\t\t\treturn Parsed.Failure<double>(str);\n\t\t}\n\n\t\tpublic static Parsed<int> TryParseInt(string str)\n\t\t{\n\t\t\tint value;\n\t\t\tif (int.TryParse(str, out value))\n\t\t\t\treturn Parsed.Success(value, str);\n\n\t\t\treturn Parsed.Failure<int>(str);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/String.cs",
    "content": "namespace Outracks.Fuse\n{\n\tpublic static class StringParser\n\t{\n\t\tpublic static IAttribute<string> GetString(this IElement element, string property, string defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: p => Parsed.Success(p, p),\n\t\t\t\tserialize: d => d,\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/TimeSpan.cs",
    "content": "using System;\nusing System.Globalization;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class TimeSpanParser\n\t{\n\t\tpublic static IAttribute<TimeSpan> GetTimeSpan(this IElement element, string property, TimeSpan defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseTimeSpan,\n\t\t\t\tserialize: d => d.TotalSeconds.ToString(CultureInfo.InvariantCulture),\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tstatic Parsed<TimeSpan> TryParseTimeSpan(string str)\n\t\t{\n\t\t\tdouble value;\n\t\t\tif (double.TryParse(str.StripSuffix(\"s\"), out value))\n\t\t\t\treturn Parsed.Success(TimeSpan.FromSeconds(value), str);\n\n\t\t\treturn Parsed.Failure<TimeSpan>(str);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/UxSize.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class UxSizeParser\n\t{\n\t\tpublic static IAttribute<Size<UxSize>> GetSize2(this IElement element, string property, Size<UxSize> defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: VectorParser.CreateSizeParser(TryParseLength),\n\t\t\t\tserialize: VectorParser.CreateSizeSerializer(Serialize),\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tpublic static IAttribute<UxSize> GetSize(this IElement element, string property, UxSize defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseLength,\n\t\t\t\tserialize: Serialize,\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tpublic static IAttribute<Points> GetPoints(this IElement element, string property, Points defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParsePoints,\n\t\t\t\tserialize: Serialize,\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tpublic static IAttribute<Points> ToPoints(this IAttribute<double> property, double pointIncrement = 1.0)\n\t\t{\n\t\t\treturn property.ConvertExpression(t => new Points(t / pointIncrement), t => t.Value * pointIncrement);\n\t\t}\n\n\t\t// UxSize = Percentages | Points | Pixels\n\n\t\tpublic static Parsed<UxSize> TryParseLength(string str)\n\t\t{\n\t\t\treturn str.TryParsePoints().Select(UxSize.Points)\n\t\t\t\t|| str.TryParsePixels().Select(UxSize.Pixels)\n\t\t\t\t|| str.TryParsePercentages().Select(UxSize.Percentages);\n\t\t}\n\n\t\tpublic static string Serialize(UxSize len)\n\t\t{\n\t\t\treturn\n\t\t\t\tlen.PointsValue.Select(Serialize).Or(() =>\n\t\t\t\tlen.PixelsValue.Select(Serialize).Or(() =>\n\t\t\t\tlen.PercentagesValue.Select(Serialize).OrThrow()));\n\t\t}\n\n\t\t// Percentages\n\n\t\tpublic static Parsed<Percentages> TryParsePercentages(this string str)\n\t\t{\n\t\t\tif (!str.EndsWith(\"%\"))\n\t\t\t\treturn ScalarParser.TryParseDouble(str).Select(d => new Percentages(d));\n\n\t\t\tdouble value;\n\t\t\tif (double.TryParse(str.StripSuffix(\"%\"), out value))\n\t\t\t\treturn Parsed.Success(new Percentages(value), str);\n\n\t\t\treturn Parsed.Failure<Percentages>(str);\n\t\t}\n\n\t\tpublic static string Serialize(Percentages d)\n\t\t{\n\t\t\treturn (d.Value).ToString(\"0\") + \"%\";\n\t\t}\n\n\t\t// Points\n\n\t\tpublic static Parsed<Points> TryParsePoints(this string str)\n\t\t{\n\t\t\tdouble value;\n\t\t\tif (Double.TryParse(str.StripSuffix(\"pt\").StripSuffix(\"p\"), out value))\n\t\t\t\treturn Parsed.Success(new Points(value), str);\n\n\t\t\treturn Parsed.Failure<Points>(str);\n\t\t}\n\t\tpublic static string Serialize(Points points)\n\t\t{\n\t\t\treturn points.Value.ToString(\"0.#\");\n\t\t}\n\n\t\t// Pixels\n\n\t\tpublic static Parsed<Pixels> TryParsePixels(this string str)\n\t\t{\n\t\t\tdouble value;\n\t\t\tif (Double.TryParse(str.StripSuffix(\"px\"), out value))\n\t\t\t\treturn Parsed.Success(new Pixels(value), str);\n\n\t\t\treturn Parsed.Failure<Pixels>(str);\n\t\t}\n\n\t\tpublic static string Serialize(Pixels points)\n\t\t{\n\t\t\treturn points.Value.ToString(\"0.#\") + \"px\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Converters/Vector.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class VectorParser\n\t{\n\t\tpublic static IAttribute<Corners<Points>> GetCorners(this IElement element, string property, Corners<Points> defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseCornerRadius,\n\t\t\t\tserialize: SerializeCornerRadius,\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\tpublic static IAttribute<Thickness<Points>> GetThickness(this IElement element, string property, Thickness<Points> defaultValue)\n\t\t{\n\t\t\treturn element[property].Convert(\n\t\t\t\tparse: TryParseThickness,\n\t\t\t\tserialize: SerializeThickness,\n\t\t\t\tdefaultValue: defaultValue);\n\t\t}\n\n\t\t// Parse\n\n\t\tstatic Parsed<Corners<Points>> TryParseCornerRadius(string str)\n\t\t{\n\t\t\tvar parts = str.Split(\",\");\n\t\t\tswitch (parts.Length)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\treturn parts[0].TryParsePoints()\n\t\t\t\t\t\t.Select(all => new Corners<Points>(all));\n\n\t\t\t\tcase 2:\n\t\t\t\t\treturn Parsed.Create(\n\t\t\t\t\t\tstringValue: str,\n\t\t\t\t\t\tvalue: Optional.Combine(\n\t\t\t\t\t\t\tparts[0].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[1].TryParsePoints().Value,\n\t\t\t\t\t\t\t(h, v) => new Corners<Points>(h, v)));\n\n\t\t\t\tcase 4:\n\t\t\t\t\treturn Parsed.Create(\n\t\t\t\t\t\tstringValue: str,\n\t\t\t\t\t\tvalue: Optional.Combine(\n\t\t\t\t\t\t\tparts[0].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[1].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[2].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[3].TryParsePoints().Value,\n\t\t\t\t\t\t\t(l, t, r, b) => new Corners<Points>(l, t, r, b)));\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Parsed.Failure<Corners<Points>>(str);\n\t\t\t}\n\t\t}\n\n\t\tstatic Parsed<Thickness<Points>> TryParseThickness(string str)\n\t\t{\n\t\t\tvar parts = str.Split(\",\");\n\t\t\tswitch (parts.Length)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\treturn parts[0].TryParsePoints()\n\t\t\t\t\t\t.Select(all => new Thickness<Points>(all));\n\n\t\t\t\tcase 2:\n\t\t\t\t\treturn Parsed.Create(\n\t\t\t\t\t\tstringValue: str,\n\t\t\t\t\t\tvalue: Optional.Combine(\n\t\t\t\t\t\t\tparts[0].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[1].TryParsePoints().Value,\n\t\t\t\t\t\t\t(h, v) => new Thickness<Points>(h, v)));\n\n\t\t\t\tcase 4:\n\t\t\t\t\treturn Parsed.Create(\n\t\t\t\t\t\tstringValue: str,\n\t\t\t\t\t\tvalue: Optional.Combine(\n\t\t\t\t\t\t\tparts[0].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[1].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[2].TryParsePoints().Value,\n\t\t\t\t\t\t\tparts[3].TryParsePoints().Value,\n\t\t\t\t\t\t\t(l, t, r, b) => new Thickness<Points>(l, t, r, b)));\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Parsed.Failure<Thickness<Points>>(str);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Func<string, Parsed<Size<T>>> CreateSizeParser<T>(Func<string, Parsed<T>> tryParseLength)\n\t\t{\n\t\t\treturn value =>\n\t\t\t{\n\t\t\t\tvar parts = value.Split(\",\");\n\t\t\t\tif (parts.Length == 1)\n\t\t\t\t\treturn tryParseLength(parts[0]).Select(Size.Create);\n\n\t\t\t\tif (parts.Length == 2)\n\t\t\t\t\treturn Parsed.Create(value,\n\t\t\t\t\t\ttryParseLength(parts[0]).Value.SelectMany(x =>\n\t\t\t\t\t\t\ttryParseLength(parts[1]).Value.Select(y =>\n\t\t\t\t\t\t\t\tSize.Create(x, y))));\n\n\t\t\t\treturn Parsed.Failure<Size<T>>(value);\n\t\t\t};\n\t\t}\n\n\t\t// Serialize\n\n\t\tstatic string SerializeCornerRadius(Corners<Points> thickness)\n\t\t{\n\t\t\treturn new[]\n\t\t\t{\n\t\t\t\tthickness.LeftTop.Value.ToString(\"0.##\"),\n\t\t\t\tthickness.RightTop.Value.ToString(\"0.##\"),\n\t\t\t\tthickness.RightBottom.Value.ToString(\"0.##\"),\n\t\t\t\tthickness.LeftBottom.Value.ToString(\"0.##\"),\n\t\t\t}.Join(\", \");\n\t\t}\n\n\t\tstatic string SerializeThickness(Thickness<Points> thickness)\n\t\t{\n\t\t\treturn new[]\n\t\t\t{\n\t\t\t\tthickness.Left.Value.ToString(\"0.##\"),\n\t\t\t\tthickness.Top.Value.ToString(\"0.##\"),\n\t\t\t\tthickness.Right.Value.ToString(\"0.##\"),\n\t\t\t\tthickness.Bottom.Value.ToString(\"0.##\"),\n\t\t\t}.Join(\", \");\n\t\t}\n\n\t\tpublic static Func<Size<UxSize>, string> CreateSizeSerializer(Func<UxSize, string> serialize)\n\t\t{\n\t\t\treturn size => serialize(size.Width) + \", \" + serialize(size.Height);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Element.Empty.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse\n{\n\tpublic static partial class Element\n\t{\n\t\tstatic Element()\n\t\t{\n\t\t\tEmpty = new EmptyElement();\n\t\t}\n\n\t\tpublic static IElement Empty { get; private set; }\n\t}\n\n\tclass EmptyElement : IElement\n\t{\n\t\treadonly IProperty<Optional<string>> _property;\n\t\treadonly IObservable<bool> _false;\n\n\t\tpublic EmptyElement()\n\t\t{\n\t\t\t_false = Observable.Return(false);\n\t\t\t_property = Property.Default<Optional<string>>();\n\t\t\tChildren = Observable.Return(System.Collections.Immutable.ImmutableList<IElement>.Empty);\n\t\t\tName = Property.Constant(\"Unknown\");\n\t\t\tSimulatorId = Observable.Return(new ObjectIdentifier(\"N/A\", 0));\n\t\t}\n\n\t\tpublic IProperty<string> Name { get; private set; }\n\n\t\tpublic IObservable<IEnumerable<IElement>> Children { get; private set; }\n\n\t\t/// <exception cref=\"ElementIsEmpty\"></exception>\n\t\t/// <exception cref=\"ElementIsReadOnly\"></exception>\n\t\tpublic Task Replace(Func<SourceFragment, System.Threading.Tasks.Task<SourceFragment>> transform)\n\t\t{\n\t\t\tthrow new ElementIsEmpty();\n\t\t}\n\n\t\tpublic System.Threading.Tasks.Task<SourceFragment> Cut()\n\t\t{\n\t\t\tthrow new ElementIsEmpty();\n\t\t}\n\n\t\tpublic System.Threading.Tasks.Task<SourceFragment> Copy()\n\t\t{\n\t\t\tthrow new ElementIsEmpty();\n\t\t}\n\n\t\tpublic IElement Paste(SourceFragment fragment)\n\t\t{\n\t\t\tthrow new ElementIsReadOnly();\n\t\t}\n\n\t\tpublic IElement PasteAfter(SourceFragment fragment)\n\t\t{\n\t\t\tthrow new ElementIsReadOnly();\n\t\t}\n\n\t\tpublic IElement PasteBefore(SourceFragment fragment)\n\t\t{\n\t\t\tthrow new ElementIsReadOnly();\n\t\t}\n\n\t\tpublic IProperty<Optional<string>> Content\n\t\t{\n\t\t\tget { return _property; }\n\t\t}\n\n\t\tpublic IObservable<Optional<ILiveElement>> LiveElement\n\t\t{\n\t\t\tget { return Observable.Return(Optional.None<ILiveElement>()); }\n\t\t}\n\n\t\tpublic IObservable<bool> IsEmpty\n\t\t{\n\t\t\tget { return Observable.Return(true); }\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return Observable.Return(true); }\n\t\t}\n\n\t\tpublic IElement Parent\n\t\t{\n\t\t\tget { return Element.Empty; }\n\t\t}\n\n\t\tpublic IElement Base\n\t\t{\n\t\t\tget { return Element.Empty; }\n\t\t}\n\n\t\tpublic IObservable<ObjectIdentifier> SimulatorId { get; private set; }\n\n\t\tpublic IObservable<bool> Is(string elementType)\n\t\t{\n\t\t\treturn _false;\n\t\t}\n\n\t\tpublic IObservable<bool> IsChildOf(string elementType)\n\t\t{\n\t\t\treturn _false;\n\t\t}\n\n\t\tpublic IObservable<bool> IsSiblingOf(string elementType)\n\t\t{\n\t\t\treturn _false;\n\t\t}\n\n\t\tpublic IObservable<bool> IsDescendantOf(IElement element)\n\t\t{\n\t\t\treturn _false;\n\t\t}\n\n\t\tpublic IProperty<Optional<string>> this[string propertyName]\n\t\t{\n\t\t\tget { return _property; }\n\t\t}\n\n\t\tpublic IObservable<Optional<SourceReference>> SourceReference\n\t\t{\n\t\t\tget { return Observable.Return(new Optional<SourceReference>()); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Element.Subtree.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fuse\n{\n\tpublic static partial class Element\n\t{\n\t\tpublic static IObservable<IEnumerable<IElement>> Subtree(this IElement root)\n\t\t{\n\t\t\treturn root.Children.CachePerElement(Subtree)\n\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t.Select(e => e.Join())\n\t\t\t\t.Select(e => new[] { root }.Concat(e));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Element.Switch.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse\n{\n\tpublic static partial class Element\n\t{\n\t\tpublic static IElement ToElement<T>(this IObservable<T> source, Func<T, IElement> select)\n\t\t{\n\t\t\treturn new SwitchingElement(source.Select(@select));\n\t\t}\n\n\t\t/// <remarks>\n\t\t/// Note that queries on the result requring actual data might not push a value until the observable has pushed the first element.\n\t\t/// If it is desirable to to start with a specific element (for instance Element.Empty), use StartWith(intialElement) before Switch().\n\t\t/// </remarks>>\n\t\tpublic static IElement Switch(this IObservable<IElement> element)\n\t\t{\n\t\t\treturn new SwitchingElement(element);\n\t\t}\n\t}\n\n\tclass SwitchingElement : IElement\n\t{\n\t\treadonly IObservable<IElement> _current;\n\n\t\treadonly Lazy<IElement> _parent;\n\t\tpublic IElement Parent\n\t\t{\n\t\t\tget { return _parent.Value; }\n\t\t}\n\n\t\treadonly Lazy<IElement> _base;\n\t\tpublic IElement Base\n\t\t{\n\t\t\tget { return _base.Value; }\n\t\t}\n\n\t\tpublic SwitchingElement(IObservable<IElement> current)\n\t\t{\n\t\t\t_current = current\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\n\t\t\t_parent = new Lazy<IElement>(() =>\n\t\t\t\t_current.Select(c => c.Parent).Switch());\n\n\t\t\t_base = new Lazy<IElement>(() =>\n\t\t\t\t_current.Select(c => c.Base).Switch());\n\n\t\t\tName = _current.Select(e => e.Name).Switch()\n\t\t\t\t;\n\n\t\t\tContent = _current.Select(e => e.Content).Switch()\n\t\t\t\t;\n\n\t\t\tChildren = _current.Select(e => e.Children).Switch()\n\t\t\t\t.DistinctUntilSequenceChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\n\t\t\tIsEmpty = _current.Select(e => e.IsEmpty).Switch()\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\n\t\t\tIsReadOnly = _current.Select(e => e.IsReadOnly).Switch()\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\n\t\t\tSimulatorId = _current.Select(e => e.SimulatorId).Switch()\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\n\t\t\tSourceReference = _current.Select(e => e.SourceReference).Switch()\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\t\t}\n\n\t\tpublic IProperty<string> Name { get; private set; }\n\n\t\tpublic IProperty<Optional<string>> Content { get; private set; }\n\n\t\tpublic IObservable<IEnumerable<IElement>> Children { get; private set; }\n\n\t\tpublic IProperty<Optional<string>> this[string propertyName]\n\t\t{\n\t\t\tget { return _current.Select(c => c[propertyName]).Switch(); }\n\t\t}\n\n\t\tpublic IObservable<Optional<ILiveElement>> LiveElement { get { return _current.Switch(x => x.LiveElement); } }\n\t\tpublic IObservable<bool> IsEmpty { get; private set; }\n\n\t\tpublic IObservable<bool> IsReadOnly { get; private set; }\n\n\t\tpublic IObservable<ObjectIdentifier> SimulatorId { get; private set; }\n\n\t\tpublic IObservable<Optional<SourceReference>> SourceReference { get; private set; }\n\n\t\tpublic async Task Replace(Func<SourceFragment, System.Threading.Tasks.Task<SourceFragment>> transform)\n\t\t{\n\t\t\tawait (await _current.FirstAsync()).Replace(transform);\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task<SourceFragment> Cut()\n\t\t{\n\t\t\treturn await (await _current.FirstAsync()).Cut();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task<SourceFragment> Copy()\n\t\t{\n\t\t\treturn await (await _current.FirstAsync()).Copy();\n\t\t}\n\n\t\tpublic IElement Paste(SourceFragment fragment)\n\t\t{\n\t\t\tvar result = _current.FirstAsync().Select(c => c.Paste(fragment)).Replay(1);\n\t\t\tresult.Connect();\n\t\t\treturn result.Switch();\n\t\t}\n\n\t\tpublic IElement PasteAfter(SourceFragment fragment)\n\t\t{\n\t\t\tvar result = _current.FirstAsync().Select(c => c.PasteAfter(fragment)).Replay(1);\n\t\t\tresult.Connect();\n\t\t\treturn result.Switch();\n\t\t}\n\n\t\tpublic IElement PasteBefore(SourceFragment fragment)\n\t\t{\n\t\t\tvar result = _current.FirstAsync().Select(c => c.PasteBefore(fragment)).Replay(1);\n\t\t\tresult.Connect();\n\t\t\treturn result.Switch();\n\t\t}\n\n\n\t\tpublic IObservable<bool> Is(string elementType)\n\t\t{\n\t\t\treturn _current.Switch(c => c.Is(elementType)).DistinctUntilChanged();\n\t\t}\n\n\t\tpublic IObservable<bool> IsDescendantOf(IElement element)\n\t\t{\n\t\t\treturn _current.Select(c => c.IsDescendantOf(element)).Switch();\n\t\t}\n\n\t\tpublic IObservable<bool> IsChildOf(string elementType)\n\t\t{\n\t\t\treturn _current.Switch(c => c.IsChildOf(elementType)).DistinctUntilChanged();\n\t\t}\n\n\t\tpublic IObservable<bool> IsSiblingOf(string elementType)\n\t\t{\n\t\t\treturn _current.Switch(c => c.IsSiblingOf(elementType)).DistinctUntilChanged();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Element.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fuse\n{\n\tpublic static partial class Element\n\t{\n\t\tpublic static IObservable<bool> HasProperty(this IElement element, string property)\n\t\t{\n\t\t\treturn element[property].Select(v => v.HasValue);\n\t\t}\n\n\t\tpublic static IObservable<bool> IsSameAs(this IElement element, IElement other)\n\t\t{\n\t\t\treturn element.SimulatorId.CombineLatest(other.SimulatorId, (a, b) => a.Equals(b));\n\t\t}\n\n\t\tpublic static IElement As(this IElement element, string type)\n\t\t{\n\t\t\treturn element.Is(type)\n\t\t\t\t.Select(isType => isType ? element : Empty)\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/IAttribute.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IAttribute<T> : IProperty<T>\n\t{\n\t\tIProperty<string> StringValue { get; }\n\t\tIObservable<IExpression<T>> Expression { get; }\n\n\t\tCommand Clear { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/IContext.cs",
    "content": "using System;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IContext\n\t{\n\t\t// Selection\n\n\t\tIElement CurrentSelection { get; }\n\n\t\tIElement PreviewedSelection { get; }\n\n\t\tTask Select(IElement element);\n\n\t\tTask Preview(IElement element);\n\n\t\tIObservable<bool> IsSelected(IElement element);\n\t\tIObservable<bool> IsPreviewSelected(IElement element);\n\n\t\t// Scope\n\n\t\tIElement CurrentScope { get; }\n\n\t\tIElement PreviousScope { get; }\n\n\t\tTask SetScope(IElement root, IElement selection);\n\n\t\tTask PushScope(IElement root, IElement selection);\n\n\t\tTask PopScope();\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/IDocument.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IDocument : IDisposable\n\t{\n\t\tIObservable<Optional<Exception>> Errors { get; }\n\n\t\tIObservable<AbsoluteFilePath> FilePath { get; }\n\n\t\tstring SimulatorIdPrefix { get; }\n\n\t\tIElement Root { get; }\n\n\t\tIObservable<IEnumerable<IElement>> Elements { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/IElement.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse\n{\n\t/// <summary>\n\t/// An interface for observing and potentially editing a UX element/tag.\n\t///\n\t/// You should consider instances as observable query results, rather than (wrongly) assuming\n\t/// there a one-to-one mapping between IElement instances and the data it's an interface to.\n\t///\n\t/// (If you really care about element identity, observe SimulatorId. Don't rely on equality operators of IElement)\n\t/// </summary>\n\tpublic interface IElement\n\t{\n\t\tIObservable<Optional<ILiveElement>> LiveElement { get; }\n\n\t\tIObservable<bool> IsEmpty { get; }\n\t\tIObservable<bool> IsReadOnly { get; }\n\n\t\tIElement Parent { get; }\n\t\tIElement Base { get; }\n\n\t\tIObservable<ObjectIdentifier> SimulatorId { get; }\n\t\tIObservable<Optional<SourceReference>> SourceReference { get; }\n\n\t\tIProperty<string> Name { get; }\n\t\tIObservable<bool> Is(string elementType);\n\t\tIObservable<bool> IsChildOf(string elementType);\n\t\tIObservable<bool> IsSiblingOf(string elementType);\n\t\tIObservable<bool> IsDescendantOf(IElement element);\n\n\t\tIProperty<Optional<string>> this[string propertyName] { get; }\n\t\tIProperty<Optional<string>> Content { get; }\n\n\t\tIObservable<IEnumerable<IElement>> Children { get; }\n\n\t\t/// <exception cref=\"ElementIsEmpty\"></exception>\n\t\t/// <exception cref=\"ElementIsReadOnly\"></exception>\n\t\tTask Replace(Func<SourceFragment, System.Threading.Tasks.Task<SourceFragment>> transform);\n\n\t\t/// <exception cref=\"ElementIsEmpty\"></exception>\n\t\t/// <exception cref=\"ElementIsReadOnly\"></exception>\n\t\t/// <returns>The source fragment that was removed from the document</returns>\n\t\tSystem.Threading.Tasks.Task<SourceFragment> Cut();\n\n\t\t/// <exception cref=\"ElementIsEmpty\"></exception>\n\t\t/// <returns>A snapshot of the source fragment for this element</returns>\n\t\tSystem.Threading.Tasks.Task<SourceFragment> Copy();\n\n\t\t/// <exception cref=\"ElementIsReadOnly\"></exception>\n\t\t/// <returns>A snapshot of the source fragment for this element</returns>\n\t\tIElement Paste(SourceFragment fragment);\n\n\t\t/// <exception cref=\"ElementIsReadOnly\"></exception>\n\t\t/// <exception cref=\"ElementIsRoot\"></exception>\n\t\t/// <returns>A snapshot of the source fragment for this element</returns>\n\t\tIElement PasteAfter(SourceFragment fragment);\n\n\t\t/// <exception cref=\"ElementIsReadOnly\"></exception>\n\t\t/// <exception cref=\"ElementIsRoot\"></exception>\n\t\t/// <returns>An interface to the pasted element</returns>\n\t\tIElement PasteBefore(SourceFragment fragment);\n\t}\n\n\tpublic class ElementIsEmpty : InvalidOperationException\n\t{\n\t\tpublic override string Message\n\t\t{\n\t\t\tget { return \"Element is empty\"; }\n\t\t}\n\t}\n\n\tpublic class ElementIsReadOnly : InvalidOperationException\n\t{\n\t\tpublic override string Message\n\t\t{\n\t\t\tget { return \"Element is read-only\"; }\n\t\t}\n\t}\n\n\tpublic class ElementIsRoot : InvalidOperationException\n\t{\n\t\tpublic override string Message\n\t\t{\n\t\t\tget { return \"Element is root\"; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/ILiveElement.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive;\nusing Outracks.Fusion;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse\n{\n\t/// <summary>\n\t/// This interface represents an _actual_ element instance, as opposed to an <see cref=\"IElement\"/>\n\t/// which may also represent an actual element.\n\t/// </summary>\n\tpublic interface ILiveElement : IElement\n\t{\n\t\tIObservable<Unit> Changed { get; }\n\n\t\tnew IBehaviorProperty<string> Name { get; }\n\t\tnew IBehavior<ObjectIdentifier> SimulatorId { get; }\n\t\tnew IBehavior<IReadOnlyList<ILiveElement>> Children { get; }\n\t\tnew IBehaviorProperty<Optional<string>> this[string propertyName] { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/IProject.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Threading.Tasks;\nusing Outracks.IO;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IProject : IDisposable\n\t{\n\t\tIContext Context { get; }\n\n\t\tIObservable<AbsoluteFilePath> FilePath { get; }\n\n\t\tIObservable<IImmutableSet<AbsoluteFilePath>> BundleFiles { get; }\n\t\tIObservable<IImmutableSet<AbsoluteFilePath>> FuseJsFiles { get; }\n\n\t\tIObservable<IImmutableList<IDocument>> Documents { get; }\n\n\t\t/// <summary>\n\t\t/// Creates a new document in the project, and adds it to unoproj file.\n\t\t/// Also creates any missing directories in path.\n\t\t/// </summary>\n\t\tTask CreateDocument(RelativeFilePath relativePath, SourceFragment contents = null);\n\n\t\tIElement GetElement(ObjectIdentifier simulatorId);\n\n\t\tIObservable<IEnumerable<IElement>> Classes { get; }\n\n\t\tIObservable<IEnumerable<IElement>> GlobalElements { get; }\n\n\t\tIObservable<AbsoluteDirectoryPath> RootDirectory { get; }\n\t\tIObservable<string> LogMessages { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Live/Context.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Live\n{\n\tclass ContextState\n\t{\n\t\tpublic ObjectIdentifier Root;\n\t\tpublic ObjectIdentifier CurrentSelection;\n\t}\n\n\tclass Context : IContext\n\t{\n\t\tclass Scope\n\t\t{\n\t\t\tpublic IElement Root;\n\t\t\tpublic BehaviorSubject<IElement> PreviewedSelection;\n\t\t\tpublic BehaviorSubject<IElement> CurrentSelection;\n\t\t}\n\n\t\treadonly ObservableStack<Scope> _scope = new ObservableStack<Scope>();\n\t\treadonly ISubject<ContextState> _state = new Subject<ContextState>();\n\t\treadonly Scope _root;\n\t\treadonly Func<ObjectIdentifier, IElement> _getElement;\n\n\t\tpublic Context(IElement app, Func<ObjectIdentifier, IElement> getElement)\n\t\t{\n\t\t\t_getElement = getElement;\n\n\t\t\tCurrentSelection = _scope.Peek\n\t\t\t\t.Select(scope => scope.MatchWith(\n\t\t\t\t\tsome: s => s.CurrentSelection,\n\t\t\t\t\tnone: () => Observable.Return(Element.Empty)))\n\t\t\t\t.Switch()\n\t\t\t\t.Switch();\n\n\t\t\tPreviewedSelection = _scope.Peek\n\t\t\t\t.Select(scope => scope.MatchWith(\n\t\t\t\t\tsome: s => s.PreviewedSelection,\n\t\t\t\t\tnone: () => Observable.Return(Element.Empty)))\n\t\t\t\t.Switch()\n\t\t\t\t.Switch();\n\n\t\t\tCurrentScope = _scope.Peek\n\t\t\t\t.SelectPerElement(scope => scope.Root)\n\t\t\t\t.Or(Element.Empty).Switch();\n\n\t\t\tPreviousScope = _scope.PeekUnder\n\t\t\t\t.SelectPerElement(scope => scope.Root)\n\t\t\t\t.Or(Element.Empty).Switch();\n\n\t\t\t_scope.Replace(_root = new Scope\n\t\t\t{\n\t\t\t\tRoot = app,\n\t\t\t\tCurrentSelection = new BehaviorSubject<IElement>(Element.Empty),\n\t\t\t\tPreviewedSelection = new BehaviorSubject<IElement>(Element.Empty),\n\t\t\t});\n\t\t}\n\n\t\tpublic IObservable<ContextState> State\n\t\t{\n\t\t\tget { return _state; }\n\t\t}\n\n\t\t// Selection\n\n\t\tpublic IElement CurrentSelection { get; private set; }\n\n\t\tpublic IElement PreviewedSelection { get; private set; }\n\n\t\tpublic async Task Select(IElement element)\n\t\t{\n\t\t\tvar state = await RecordState(_scope.Value.Root, element);\n\t\t\t_scope.Value.CurrentSelection.OnNext(_getElement(state.CurrentSelection));\n\t\t}\n\n\t\tpublic Task Preview(IElement element)\n\t\t{\n\t\t\t_scope.Value.PreviewedSelection.OnNext(element);\n\t\t\treturn Task.FromResult(Unit.Default);\n\t\t}\n\n\t\tpublic IObservable<bool> IsSelected(IElement element)\n\t\t{\n\t\t\treturn CurrentSelection.IsSameAs(element);\n\t\t}\n\n\t\tpublic IObservable<bool> IsPreviewSelected(IElement element)\n\t\t{\n\t\t\treturn PreviewedSelection.IsSameAs(element);\n\t\t}\n\n\t\t// Scope\n\n\t\tpublic IElement CurrentScope { get; private set; }\n\n\t\tpublic IElement PreviousScope { get; private set; }\n\n\t\tpublic async Task PopScope()\n\t\t{\n\t\t\t_scope.Pop();\n\t\t\tvar scope = _scope.Value;\n\t\t\tawait RecordState(scope.Root, scope.CurrentSelection.Value);\n\t\t}\n\n\t\tpublic async Task PushScope(IElement root, IElement selection)\n\t\t{\n\t\t\tvar state = await RecordState(root, selection);\n\n\t\t\t_scope.Push(new Scope\n\t\t\t{\n\t\t\t\tRoot = _getElement(state.Root),\n\t\t\t\tCurrentSelection = new BehaviorSubject<IElement>(_getElement(state.CurrentSelection)),\n\t\t\t\tPreviewedSelection = new BehaviorSubject<IElement>(Element.Empty),\n\t\t\t});\n\t\t}\n\n\t\tpublic async Task SetScope(IElement root, IElement selection)\n\t\t{\n\t\t\tvar state = await RecordState(root, selection);\n\n\t\t\t_scope.Replace(_root, new Scope\n\t\t\t{\n\t\t\t\tRoot = _getElement(state.Root),\n\t\t\t\tCurrentSelection = new BehaviorSubject<IElement>(_getElement(state.CurrentSelection)),\n\t\t\t\tPreviewedSelection = new BehaviorSubject<IElement>(Element.Empty),\n\t\t\t});\n\t\t}\n\n\t\tasync System.Threading.Tasks.Task<ContextState> RecordState(IElement root, IElement selection)\n\t\t{\n\t\t\tvar state = new ContextState\n\t\t\t{\n\t\t\t\tRoot = await root.SimulatorId.FirstAsync(),\n\t\t\t\tCurrentSelection = await selection.SimulatorId.FirstAsync(),\n\t\t\t};\n\n\t\t\t_state.OnNext(state);\n\n\t\t\treturn state;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Live/FileWatchingDocument.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Live\n{\n\tinterface IDocument<T> : IDisposable\n\t{\n\t\tIObservable<Optional<Exception>> Errors { get; }\n\n\t\tIObservable<Optional<Exception>> ErrorsDuringLoading { get; }\n\n\t\t/// <summary>\n\t\t/// This observable emits the latest contents of the document.\n\t\t/// Upon subscription this observable replays one elements.\n\t\t/// </summary>\n\t\tIObservable<T> Contents { get; }\n\n\t\t/// <summary>\n\t\t/// This observable emits the latest contents read from disk, ignoring changes saved by invoking Save().\n\t\t/// Upon subscription this observable replays one elements.\n\t\t/// </summary>\n\t\tIObservable<T> ExternalChanges { get; }\n\n\t\tTask Save(T contents);\n\t}\n\n\tclass FileWatchingDocument : IDocument<byte[]>\n\t{\n\t\tpublic static readonly TimeSpan PreLogRetryInterval = TimeSpan.FromMilliseconds(100);\n\t\tpublic static readonly TimeSpan PostLogRetryInterval = TimeSpan.FromMilliseconds(1000);\n\t\tpublic static readonly TimeSpan RetryErrorMessageDelay = TimeSpan.FromSeconds(3);\n\n\t\treadonly IDisposable _garbage;\n\t\treadonly IFileSystem _fs;\n\t\treadonly AbsoluteFilePath _path;\n\t\treadonly BehaviorSubject<Optional<byte[]>> _lastKnownChanges = new BehaviorSubject<Optional<byte[]>>(Optional.None());\n\t\treadonly BehaviorSubject<Optional<Exception>> _errorsDuringSaving = new BehaviorSubject<Optional<Exception>>(Optional.None());\n\t\treadonly BehaviorSubject<Optional<Exception>> _errorsDuringLoading = new BehaviorSubject<Optional<Exception>>(Optional.None());\n\t\treadonly IScheduler _scheduler;\n\n\t\tpublic FileWatchingDocument(IFileSystem fs, AbsoluteFilePath path, IScheduler scheduler = null)\n\t\t{\n\t\t\t_fs = fs;\n\t\t\t_path = path;\n\t\t\t_scheduler = scheduler ?? Scheduler.Default;\n\n\t\t\tvar contents =\n\t\t\t\tfs.Watch(path)\n\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t.CatchAndRetry(delay: TimeSpan.FromSeconds(1), scheduler: _scheduler)\n\t\t\t\t.Throttle(TimeSpan.FromSeconds(1.0 / 30.0), _scheduler)\n\t\t\t\t.Select(\n\t\t\t\t\tnotifyTime => Observable.DeferAsync(\n\t\t\t\t\t\tasync token => Observable.Return(\n\t\t\t\t\t\t\tawait ReadAllBytesAndRetryOnError(token))))\n\t\t\t\t.Switch()\n\t\t\t\t.Replay(1);\n\n\t\t\tvar externalChanges = contents\n\t\t\t\t.Where(bytes => _lastKnownChanges.Value.Select(bytes.SequenceEqual).Or(false) == false)\n\t\t\t\t.Do(bytes => _lastKnownChanges.OnNext(bytes))\n\t\t\t\t.Replay(1);\n\n\t\t\t_garbage = Disposable.Combine(\n\t\t\t\texternalChanges.Connect(),\n\t\t\t\tcontents.Connect());\n\n\t\t\tContents = contents;\n\t\t\tExternalChanges = externalChanges;\n\t\t}\n\n\t\tpublic IObservable<Optional<Exception>> Errors\n\t\t{\n\t\t\tget { return _errorsDuringSaving.Merge(_errorsDuringLoading); }\n\t\t}\n\n\t\tpublic IObservable<Optional<Exception>> ErrorsDuringLoading\n\t\t{\n\t\t\tget { return _errorsDuringLoading; }\n\t\t}\n\n\t\tpublic IObservable<byte[]> Contents\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic IObservable<byte[]> ExternalChanges\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic async Task Save(byte[] contents)\n\t\t{\n\t\t\t_lastKnownChanges.OnNext(contents);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (var file = _fs.Open(_path, FileMode.Create, FileAccess.Write, FileShare.Read))\n\t\t\t\t{\n\t\t\t\t\tawait file.WriteAllBytesAsync(contents);\n\t\t\t\t}\n\t\t\t\t_errorsDuringSaving.OnNext(Optional.None());\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_errorsDuringSaving.OnNext(e);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_garbage.Dispose();\n\t\t}\n\n\t\tprivate async Task<byte[]> ReadAllBytesAndRetryOnError(CancellationToken token)\n\t\t{\n\t\t\tvar startTime = _scheduler.Now;\n\t\t\tstring lastErrorMessage = null;\n\t\t\tTimeSpan retryInterval = PreLogRetryInterval;\n\t\t\tvar tokenObservable = Observable.Create<long>(observer => token.Register(() => observer.OnNext(0)));\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\ttoken.ThrowIfCancellationRequested();\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tusing (var file = _fs.OpenRead(_path))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar bytes = await file.ReadAllBytesAsync();\n\t\t\t\t\t\t_errorsDuringLoading.OnNext(Optional.None());\n\t\t\t\t\t\treturn bytes;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception exception)\n\t\t\t\t{\n\t\t\t\t\ttoken.ThrowIfCancellationRequested();\n\n\t\t\t\t\tif (_scheduler.Now - startTime > RetryErrorMessageDelay && lastErrorMessage != exception.Message)\n\t\t\t\t\t{\n\t\t\t\t\t\t// After 3 seconds we only retry every second, to slow down IO hammering\n\t\t\t\t\t\tretryInterval = PostLogRetryInterval;\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new IOException(string.Format(exception.Message.TrimEnd('.') + \". Retrying in background until problem is resolved.\"), exception);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception wrappedException)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_errorsDuringLoading.OnNext(wrappedException);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastErrorMessage = exception.Message;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// We're using an Observable.Timer here to make this work with HistoricalScehduler in test.\n\t\t\t\tawait Observable\n\t\t\t\t\t.Timer(retryInterval, _scheduler)\n\t\t\t\t\t.Merge(tokenObservable).FirstAsync();\n\t\t\t}\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveDocument.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Xml.Linq;\nusing Fuse.Preview;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Live\n{\n\tpublic class LiveDocument : IDocument, IDocumentLike\n\t{\n\t\tpublic static LiveDocument Open(\n\t\t\tAbsoluteFilePath path,\n\t\t\tIFileSystem fs,\n\t\t\tIObservable<ILookup<ObjectIdentifier, ObjectIdentifier>> metadata,\n\t\t\tBehaviorSubject<Dictionary<ObjectIdentifier, IElement>> idToElement,\n\t\t\tIObserver<IBinaryMessage> mutations,\n\t\t\tIScheduler scheduler)\n\t\t{\n\t\t\tIDocument<byte[]> fileOnDisk = new FileWatchingDocument(fs, path);\n\n\n\t\t\tvar parsingErrors = new BehaviorSubject<Optional<Exception>>(Optional.None());\n\n\t\t\tvar invalidated = new Subject<Unit>();\n\n\t\t\tvar root = new LiveElement(\n\t\t\t\tfile: path,\n\t\t\t\tmetadata: metadata,\n\t\t\t\tisReadOnly: fileOnDisk.ErrorsDuringLoading.Or(parsingErrors)\n\t\t\t\t\t.Select(e => e.HasValue)\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.Replay(1).RefCount(),\n\t\t\t\tinvalidated: invalidated,\n\t\t\t\tmutations: mutations,\n\t\t\t\tgetElement: id =>\n\t\t\t\t\tidToElement.Value.TryGetValue(id).Or(Element.Empty));\n\n\t\t\tOptional<XElement> xElementForSaving = Optional.None<XElement>();\n\n\t\t\tvar allElements = root.Subtree().Replay(1);\n\n\t\t\tvar source = new ReplaySubject<SourceFragment>(1);\n\n\t\t\treturn new LiveDocument\n\t\t\t{\n\t\t\t\t_garbage = Disposable.Combine(\n\n\t\t\t\t\t// Save on internal changes\n\t\t\t\t\tinvalidated\n\t\t\t\t\t\t.Select(_ =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (xElementForSaving.HasValue)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar sourceFragment = SourceFragment.FromXml(xElementForSaving.Value);\n\t\t\t\t\t\t\t\tsource.OnNext(sourceFragment);\n\t\t\t\t\t\t\t\treturn Optional.Some(sourceFragment);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn Optional.None();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.NotNone()\n\t\t\t\t\t\t.Throttle(TimeSpan.FromSeconds(0.5), scheduler)\n\t\t\t\t\t\t.Select(sourceFragment =>\n\t\t\t\t\t\t\tObservable.FromAsync(async () =>\n\t\t\t\t\t\t\t\tawait fileOnDisk.Save(sourceFragment.ToBytes())))\n\t\t\t\t\t\t.Concat()\n\t\t\t\t\t\t.Subscribe(),\n\n\t\t\t\t\t// Load on external changes\n\t\t\t\t\tfileOnDisk.ExternalChanges\n\t\t\t\t\t\t.ObserveOn(Application.MainThread)\n\t\t\t\t\t\t.Subscribe(reload =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar sourceFragment = SourceFragment.FromBytes(reload);\n\t\t\t\t\t\t\t\tsource.OnNext(sourceFragment);\n\n\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar simulatorWasFaulted = parsingErrors.Value.HasValue;\n\n\t\t\t\t\t\t\t\t\tvar newDocument = sourceFragment.ToXml();\n\t\t\t\t\t\t\t\t\tparsingErrors.OnNext(Optional.None());\n\n\t\t\t\t\t\t\t\t\txElementForSaving = Optional.None();\n\t\t\t\t\t\t\t\t\tConsole.WriteLine(\"Reloading \" + path + \" from disk...\");\n\t\t\t\t\t\t\t\t\troot.UpdateFrom(newDocument); // no known reasons to throw\n\t\t\t\t\t\t\t\t\txElementForSaving = Optional.Some(newDocument);\n\n\t\t\t\t\t\t\t\t\t// hack to clear errors from the simulator,\n\t\t\t\t\t\t\t\t\t// since UpdateFrom() doesn't know that the simulator\n\t\t\t\t\t\t\t\t\t// have failed and will try to emit incremental updates\n\t\t\t\t\t\t\t\t\tif (simulatorWasFaulted)\n\t\t\t\t\t\t\t\t\t\tmutations.OnNext(new ReifyRequired());\n\n\t\t\t\t\t\t\t\t\tNagScreen.Update();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tparsingErrors.OnNext(e);\n\n\t\t\t\t\t\t\t\t\t// hack to get errors from the simulator\n\t\t\t\t\t\t\t\t\tmutations.OnNext(new ReifyRequired());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\n\t\t\t\t\t// Share subscription to Eleements\n\t\t\t\t\tallElements.Connect(),\n\n\t\t\t\t\t// Dispose fileOnDisk when disposed\n\t\t\t\t\tfileOnDisk),\n\n\t\t\t\tFilePath = Observable.Return(path),\n\n\t\t\t\tErrors = fileOnDisk.Errors.Or(parsingErrors),\n\n\t\t\t\tSimulatorIdPrefix = path.NativePath,\n\n\t\t\t\tSource = source,\n\n\t\t\t\tRoot = root,\n\t\t\t\tElements = allElements,\n\n\t\t\t\t_root = root,\n\t\t\t\t_path = path,\n\t\t\t\t_idToElement = idToElement,\n\t\t\t};\n\t\t}\n\n\t\tIDisposable _garbage;\n\n\t\tLiveElement _root;\n\t\tAbsoluteFilePath _path;\n\t\tBehaviorSubject<Dictionary<ObjectIdentifier, IElement>> _idToElement;\n\n\t\tpublic void UpdateSimulatorIds()\n\t\t{\n\t\t\tvar dict = _idToElement.Value;\n\t\t\tforeach (var kvp in dict.ToArray())\n\t\t\t{\n\t\t\t\tif (kvp.Key.Document == SimulatorIdPrefix)\n\t\t\t\t\tdict.Remove(kvp.Key);\n\t\t\t}\n\t\t\t_root.UpdateElementIds(_path.NativePath, 0, dict);\n\t\t\t_idToElement.OnNext(dict);\n\t\t}\n\n\t\tpublic IObservable<Optional<Exception>> Errors { get; private set; }\n\t\tpublic IObservable<AbsoluteFilePath> FilePath { get; private set; }\n\n\t\tpublic string SimulatorIdPrefix { get; private set; }\n\n\t\tpublic IElement Root { get; private set; }\n\n\t\tpublic IObservable<IEnumerable<IElement>> Elements { get; private set; }\n\n\t\tpublic IObservable<SourceFragment> Source { get; private set; }\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_garbage.Dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveElement.CutCopyPaste.cs",
    "content": "using System.Collections.Immutable;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse.Live\n{\n\tpartial class LiveElement\n\t{\n\t\tpublic async Task<SourceFragment> Cut()\n\t\t{\n\t\t\tvar fragment = await Copy();\n\n\t\t\tif (!_parent.HasValue)\n\t\t\t\tthrow new ElementIsRoot();\n\n\t\t\tUpdateXml(e => e.RemoveIndented());\n\t\t\t_parent.Value.UpdateChildren(c => c.Remove(this));\n\n\t\t\treturn fragment;\n\t\t}\n\n\t\tpublic Task<SourceFragment> Copy()\n\t\t{\n\t\t\tvar fragment = SourceFragment.FromXml(Element);\n\t\t\tstring elementIndent;\n\t\t\tif (Element.TryGetElementIndent(out elementIndent))\n\t\t\t{\n\t\t\t\tfragment = RemoveIndentFromDescendantNodes(fragment, elementIndent);\n\t\t\t}\n\t\t\treturn Task.FromResult(fragment);\n\t\t}\n\n\t\tstatic SourceFragment RemoveIndentFromDescendantNodes(SourceFragment fragment, string elementIndent)\n\t\t{\n\t\t\t// If all subsequent lines start with the indent specified, remove it\n\t\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\t\tbool isFirst = true;\n\t\t\tbool indentFixSuccess = true;\n\t\t\tforeach (var line in fragment.ToString().Split('\\n'))\n\t\t\t{\n\t\t\t\tif (isFirst)\n\t\t\t\t{\n\t\t\t\t\tisFirst = false;\n\t\t\t\t\tstringBuilder.Append(line);\n\t\t\t\t}\n\t\t\t\telse if (!line.StartsWith(elementIndent))\n\t\t\t\t{\n\t\t\t\t\tindentFixSuccess = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstringBuilder.Append('\\n');\n\t\t\t\t\tstringBuilder.Append(line.Substring(elementIndent.Length));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn indentFixSuccess ? SourceFragment.FromString(stringBuilder.ToString()) : fragment;\n\t\t}\n\n\t\tpublic IElement Paste(SourceFragment fragment)\n\t\t{\n\t\t\tvar child = CreateChildElement(fragment);\n\n\t\t\tUpdateXml(e => e.AddIndented(child.Element));\n\t\t\tUpdateChildren(c => c.Add(child));\n\n\t\t\treturn child;\n\t\t}\n\n\t\tpublic IElement PasteBefore(SourceFragment fragment)\n\t\t{\n\t\t\tif (!_parent.HasValue)\n\t\t\t\tthrow new ElementIsRoot();\n\n\t\t\tvar sibling  = _parent.Value.CreateChildElement(fragment);\n\n\t\t\tUpdateXml(e => e.AddBeforeSelfIndented(sibling.Element));\n\t\t\t_parent.Value.UpdateChildren(c => c.Insert(c.IndexOf(this), sibling));\n\n\t\t\treturn sibling;\n\t\t}\n\n\t\tpublic IElement PasteAfter(SourceFragment fragment)\n\t\t{\n\t\t\tif (!_parent.HasValue)\n\t\t\t\tthrow new ElementIsRoot();\n\n\t\t\tvar sibling = _parent.Value.CreateChildElement(fragment);\n\n\t\t\tUpdateXml(e => e.AddAfterSelfIndented(sibling.Element));\n\t\t\t_parent.Value.UpdateChildren(c => c.Insert(c.IndexOf(this) + 1, sibling));\n\n\t\t\treturn sibling;\n\t\t}\n\n\t\tLiveElement CreateChildElement(SourceFragment sourceFragment)\n\t\t{\n\t\t\tvar elm = new LiveElement(parent: this);\n\t\t\telm.UpdateFrom(sourceFragment.ToXml());\n\t\t\treturn elm;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveElement.Is.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Live\n{\n\tpartial class LiveElement\n\t{\n\t\tpublic IObservable<bool> Is(string elementType)\n\t\t{\n\t\t\treturn _metadata\n\t\t\t\t.Select(types =>\n\t\t\t\t\tIs(_elementId.Value, new ObjectIdentifier(elementType), types))\n\t\t\t\t.DistinctUntilChanged();\n\t\t}\n\n\t\tstatic bool Is(ObjectIdentifier type, ObjectIdentifier targetBaseType, ILookup<ObjectIdentifier, ObjectIdentifier> baseTypes)\n\t\t{\n\t\t\tif (type == targetBaseType)\n\t\t\t\treturn true;\n\n\t\t\tforeach (var baseType in baseTypes[type])\n\t\t\t\tif (Is(baseType, targetBaseType, baseTypes))\n\t\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveElement.IsChildOf.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fuse.Live\n{\n\tpartial class LiveElement\n\t{\n\t\tpublic IObservable<bool> IsChildOf(string type)\n\t\t{\n\t\t\treturn Parent.Is(type);\n\t\t}\n\n\t\tpublic IObservable<bool> IsDescendantOf(IElement element)\n\t\t{\n\t\t\treturn Parent.SimulatorId.CombineLatest(element.SimulatorId, (our, their) => our.Equals(their))\n\t\t\t\t.Or(Parent.IsDescendantOf(element));\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveElement.IsSiblingOf.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Live\n{\n\tpartial class LiveElement\n\t{\n\t\tpublic IObservable<bool> IsSiblingOf(string type)\n\t\t{\n\t\t\t// Here we exploit the fact that siblings of a LiveElement will always be a LiveElement\n\t\t\t// This is to avoid combining with all siblings.\n\t\t\tvar typeObjectIdentifier = new ObjectIdentifier(type);\n\t\t\treturn _parent.Select(\n\t\t\t\tparent => parent.Children.WherePerElement(x => x != this).CombineLatest(\n\t\t\t\t\t_metadata,\n\t\t\t\t\t(siblings, metadata) =>\n\t\t\t\t\t{\n\t\t\t\t\t\treturn siblings.OfType<LiveElement>()\n\t\t\t\t\t\t\t.Any(sibling => Is(sibling._elementId.Value, typeObjectIdentifier, metadata));\n\t\t\t\t\t})).Or(Observable.Return(false));\n\t\t}\n\n\t\tpublic IObservable<IEnumerable<IElement>> Siblings()\n\t\t{\n\t\t\treturn Parent.Children.Select(x => x.ExceptOne(this));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveElement.Update.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Threading.Tasks;\nusing System.Xml.Linq;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.UXIL;\n\nnamespace Outracks.Fuse.Live\n{\n\tpartial class LiveElement\n\t{\n\t\tpublic async Task Replace(Func<SourceFragment, System.Threading.Tasks.Task<SourceFragment>> transform)\n\t\t{\n\t\t\tvar newElement = (await transform(await Copy())).ToXml();\n\t\t\tif (Element.Parent != null)\n\t\t\t{\n\t\t\t\tElement.ReplaceWith(newElement);\n\t\t\t}\n\t\t\t_invalidated.OnNext(Unit.Default);\n\t\t\tUpdateFrom(newElement);\n\t\t}\n\n\t\tpublic void UpdateFrom(XElement newElement)\n\t\t{\n\t\t\tvar oldElement = Element;\n\t\t\tUpdateFrom(oldElement, newElement);\n\t\t\tElement = newElement;\n\t\t}\n\n\t\tvoid UpdateFrom(XElement oldElement, XElement newElement)\n\t\t{\n\t\t\tName.Write(newElement.Name.LocalName);\n\t\t\t_textPosition.OnNext(new SourceReference(_textPosition.Value.File, newElement.TryGetTextPosition()));\n\t\t\tUpdateAttributes(oldElement, newElement);\n\t\t\tUpdateValue(oldElement, newElement);\n\t\t\tUpdateChildren(newElement);\n\t\t}\n\n\t\tpublic int UpdateElementIds(string path, int startIndex, IDictionary<ObjectIdentifier, IElement> dict)\n\t\t{\n\t\t\tvar id = new ObjectIdentifier(path, startIndex);\n\t\t\tdict[id] = this;\n\t\t\t_elementId.OnNextDistinct(id);\n\n\t\t\tstartIndex++;\n\n\t\t\tforeach (var child in _children.Value)\n\t\t\t{\n\t\t\t\tstartIndex = child.UpdateElementIds(path, startIndex, dict);\n\t\t\t}\n\n\t\t\treturn startIndex;\n\t\t}\n\n\t\tvoid UpdateAttributes(XElement oldElement, XElement newElement)\n\t\t{\n\t\t\tvar prev = oldElement.Attributes().ToArray();\n\t\t\tvar next = newElement.Attributes().ToArray();\n\n\t\t\tvar prevSet = oldElement.Attributes().ToDictionary(k => k.Name, k => k);\n\t\t\tvar nextSet = newElement.Attributes().ToDictionary(k => k.Name, k => k);\n\n\t\t\tforeach (var prevAttr in prev)\n\t\t\t{\n\t\t\t\tvar name = prevAttr.Name;\n\t\t\t\tXAttribute newAttr;\n\t\t\t\tif (!nextSet.TryGetValue(name, out newAttr))\n\t\t\t\t\tthis[NameToKey(name)].Write(Optional.None());\n\t\t\t\telse if (newAttr.Value != prevAttr.Value)\n\t\t\t\t\tthis[NameToKey(name)].Write(newAttr.Value);\n\t\t\t}\n\n\t\t\tforeach (var newAttr in next)\n\t\t\t{\n\t\t\t\tvar name = newAttr.Name;\n\t\t\t\tif (!prevSet.ContainsKey(name))\n\t\t\t\t\tthis[NameToKey(name)].Write(newAttr.Value);\n\t\t\t}\n\t\t}\n\n\t\tvoid UpdateValue(XElement oldElement, XElement newElement)\n\t\t{\n\t\t\tif (newElement.HasElements || string.IsNullOrWhiteSpace(newElement.Value))\n\t\t\t{\n\t\t\t\tif (oldElement.HasElements || oldElement.Value == newElement.Value)\n\t\t\t\t\treturn;\n\n\t\t\t\tContent.Write(Optional.None());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!oldElement.HasElements && oldElement.Value == newElement.Value)\n\t\t\t\t\treturn;\n\n\t\t\t\tContent.Write(newElement.Value.ToOptional());\n\t\t\t}\n\t\t}\n\n\t\tvoid UpdateChildren(XElement newElement)\n\t\t{\n\t\t\tvar oldChildren = _children.Value;\n\n\t\t\tvar newChildren = newElement.Elements().ToList();\n\t\t\tif (oldChildren.Count == 0 && newChildren.Count == 0)\n\t\t\t\treturn;\n\n\t\t\tvar builder = new LiveElement[newChildren.Count];\n\n\t\t\t// We'll be using newChildren as a worklist, so let's take a note of the position of all the new children\n\t\t\tvar newChildrenLocation = newElement.Elements()\n\t\t\t\t.Select((e, i) => Tuple.Create(e, i))\n\t\t\t\t.ToDictionary(t => t.Item1, t => t.Item2);\n\n\n\t\t\tvar needsReify = newChildren.Count != oldChildren.Count;\n\n\t\t\t// Incrementally (eagerly) find a new child with same element type\n\t\t\t// Performance should be \"okay\" since we're scanning both lists from the start and removing children from the worklist as we find them\n\t\t\tforeach (var oldChildImpl in oldChildren)\n\t\t\t{\n\t\t\t\tforeach (var newChild in newChildren)\n\t\t\t\t{\n\t\t\t\t\t// If one of the new XElement children we got has the same name as one of our IElements\n\t\t\t\t\tif (oldChildImpl.Element.Name.LocalName == newChild.Name.LocalName)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Update the old IElement\n\t\t\t\t\t\tbuilder[newChildrenLocation[newChild]] = oldChildImpl;\n\t\t\t\t\t\toldChildImpl.UpdateFrom(newChild);\n\n\t\t\t\t\t\t// Remove the new child from the worklist and stop iterating over it\n\t\t\t\t\t\tnewChildren.Remove(newChild);\n\t\t\t\t\t\t// Breaking the loop here is important both for correctness and to avoid iterating over a changed collection\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// elements will be removed\n\t\t\t\t\tneedsReify = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tneedsReify |= newChildren.Any();\n\n\t\t\t// So, we've reused all the elements we can reuse, but we still might have some left in our newChildren worklist\n\t\t\tforeach (var newChild in newChildren)\n\t\t\t{\n\t\t\t\t// Fortunately we know where they go\n\t\t\t\tvar index = newChildrenLocation[newChild];\n\n\t\t\t\t// Since we're iterating through them from start to end the index should not be out of bounds\n\t\t\t\tvar childElement = CreateChildElement(SourceFragment.FromString(\"<\" + newChild.Name.LocalName + \"/>\"));\n\n\t\t\t\tchildElement.UpdateFrom(newChild);\n\n\t\t\t\tbuilder[index] = childElement;\n\t\t\t}\n\n\t\t\tif (needsReify)\n\t\t\t{\n\t\t\t\t_children.OnNext(ImmutableList.Create(builder));\n\t\t\t\t_mutations.OnNext(new ReifyRequired());\n\t\t\t}\n\t\t}\n\n\t\tvoid UpdateXml(Action<XElement> action)\n\t\t{\n\t\t\taction(Element);\n\t\t\t_invalidated.OnNext(Unit.Default);\n\t\t}\n\n\t\tvoid UpdateChildren(Func<IImmutableList<LiveElement>, IImmutableList<LiveElement>> children)\n\t\t{\n\t\t\t_children.OnNext(children(_children.Value));\n\t\t\t_mutations.OnNext(new ReifyRequired());\n\t\t\t_invalidated.OnNext(Unit.Default);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveElement.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Xml.Linq;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Live\n{\n\tpartial class LiveElement : ILiveElement\n\t{\n\t\treadonly Optional<LiveElement> _parent;\n\n\t\treadonly BehaviorSubject<XElement> _element;\n\n\t\tXElement Element\n\t\t{\n\t\t\tget { return _element.Value; }\n\t\t\tset { _element.OnNext(value); }\n\t\t}\n\n\t\treadonly BehaviorSubject<SourceReference> _textPosition;\n\t\treadonly BehaviorSubject<ObjectIdentifier> _elementId =\n\t\t\tnew BehaviorSubject<ObjectIdentifier>(new ObjectIdentifier(\"N/A\", 0));\n\n\t\treadonly ConcurrentDictionary<string, IBehaviorProperty<Optional<string>>> _properties =\n\t\t\tnew ConcurrentDictionary<string, IBehaviorProperty<Optional<string>>>();\n\n\t\treadonly BehaviorSubject<IImmutableList<LiveElement>> _children =\n\t\t\tnew BehaviorSubject<IImmutableList<LiveElement>>(System.Collections.Immutable.ImmutableList<LiveElement>.Empty);\n\n\t\treadonly IObservable<ILookup<ObjectIdentifier, ObjectIdentifier>> _metadata;\n\t\treadonly IObservable<bool> _isReadOnly;\n\n\t\treadonly ISubject<Unit> _invalidated;\n\t\treadonly IObserver<IBinaryMessage> _mutations;\n\t\treadonly Func<ObjectIdentifier, IElement> _getElement;\n\n\t\tpublic LiveElement(\n\t\t\tAbsoluteFilePath file,\n\t\t\tIObservable<ILookup<ObjectIdentifier, ObjectIdentifier>> metadata,\n\t\t\tIObservable<bool> isReadOnly,\n\t\t\tISubject<Unit> invalidated,\n\t\t\tIObserver<IBinaryMessage> mutations,\n\t\t\tFunc<ObjectIdentifier, IElement> getElement) : this()\n\t\t{\n\t\t\t_parent = Optional.None();\n\t\t\t_metadata = metadata;\n\t\t\t_isReadOnly = isReadOnly;\n\t\t\t_invalidated = invalidated;\n\t\t\t_mutations = mutations;\n\t\t\t_getElement = getElement;\n\n\t\t\t_textPosition = new BehaviorSubject<SourceReference>(new SourceReference(file.NativePath, Optional.None()));\n\n\t\t\tInit();\n\t\t}\n\n\t\tpublic LiveElement(LiveElement parent) : this()\n\t\t{\n\t\t\t_parent = parent;\n\t\t\t_invalidated = parent._invalidated;\n\t\t\t_mutations = parent._mutations;\n\t\t\t_metadata = parent._metadata;\n\t\t\t_isReadOnly = parent._isReadOnly;\n\t\t\t_getElement = parent._getElement;\n\n\t\t\t_textPosition = new BehaviorSubject<SourceReference>(new SourceReference(parent._textPosition.Value.File, Optional.None()));\n\n\t\t\tInit();\n\t\t}\n\n\t\tLiveElement()\n\t\t{\n\t\t\tvar xElement = new XElement(\"Unknown\");\n\t\t\txElement.AddAnnotation(this);\n\t\t\t_element = new BehaviorSubject<XElement>(xElement);\n\t\t}\n\n\t\tpublic void Init()\n\t\t{\n\t\t\tName = CreateNameProperty(Element.Name.LocalName);\n\n\t\t\tSourceReference = _textPosition\n\t\t\t\t.Select(Optional.Some)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\tBase = _metadata.Select(m => _getElement(m[_elementId.Value].FirstOr(ObjectIdentifier.None))).Switch();\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return _isReadOnly; }\n\t\t}\n\n\t\tIObservable<Optional<ILiveElement>> IElement.LiveElement { get { return Observable.Return(Optional.Some<ILiveElement>(this)); } }\n\n\t\tpublic IObservable<bool> IsEmpty\n\t\t{\n\t\t\tget { return Observable.Return(false); }\n\t\t}\n\n\t\tpublic IObservable<Optional<SourceReference>> SourceReference { get; private set; }\n\n\t\tpublic IBehavior<ObjectIdentifier> SimulatorId\n\t\t{\n\t\t\tget { return _elementId.AsBehavior(); }\n\t\t}\n\t\tIObservable<ObjectIdentifier> IElement.SimulatorId {  get { return _elementId; } }\n\n\t\tpublic IElement Base { get; private set; }\n\n\t\tpublic IElement Parent\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _parent.HasValue\n\t\t\t\t\t? _parent.Value\n\t\t\t\t\t: Fuse.Element.Empty;\n\t\t\t}\n\t\t}\n\n\t\tpublic IBehaviorProperty<string> Name { get; private set; }\n\n\t\tIProperty<string> IElement.Name { get { return Name; } }\n\n\t\tpublic IObservable<IEnumerable<IElement>> Children { get { return _children; }}\n\n\t\tpublic IProperty<Optional<string>> Content\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _properties.GetOrAdd(\"__Value__\", _ =>\n\t\t\t\t\tCreateProperty(\n\t\t\t\t\t\tinitialValue: Optional.None<string>(),\n\t\t\t\t\t\tisReadOnly: _children.Select(c => c.Count > 0),\n\t\t\t\t\t\tonSet: value =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (value.HasValue)\n\t\t\t\t\t\t\t\tElement.Value = value.Value;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tElement.RemoveNodes();\n\n\t\t\t\t\t\t\tvar id = _elementId.Value;\n\t\t\t\t\t\t\tif (!id.Equals(ObjectIdentifier.None))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t_invalidated.OnNext(Unit.Default);\n\t\t\t\t\t\t\t\t_mutations.OnNext(new UpdateAttribute(id, \"Value\", value, _textPosition.Value));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\tpublic IBehaviorProperty<Optional<string>> this[string propertyName]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _properties.GetOrAdd(propertyName, _ =>\n\t\t\t\t\tCreateProperty(KeyToName(propertyName)));\n\t\t\t}\n\t\t}\n\n\t\tIProperty<Optional<string>> IElement.this[string propertyName]\n\t\t{\n\t\t\tget { return this[propertyName]; }\n\t\t}\n\n\t\tIBehaviorProperty<string> CreateNameProperty(string initialName)\n\t\t{\n\t\t\treturn CreateProperty(\n\t\t\t\tinitialValue: initialName,\n\t\t\t\tonSet: value =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tElement.Name = value;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\t_invalidated.OnNext(Unit.Default);\n\t\t\t\t\t_mutations.OnNext(new ReifyRequired());\n\t\t\t\t});\n\t\t}\n\n\t\tIBehaviorProperty<Optional<string>> CreateProperty(XName name)\n\t\t{\n\t\t\tvar key = NameToKey(name);\n\n\t\t\treturn CreateProperty(\n\t\t\t\tinitialValue: Optional.None<string>(),\n\t\t\t\tonSet: value =>\n\t\t\t\t{\n\t\t\t\t\tElement.SetAttributeValue(name, value.OrDefault());\n\n\t\t\t\t\tvar id = _elementId.Value;\n\t\t\t\t\tif (!id.Equals(ObjectIdentifier.None))\n\t\t\t\t\t{\n\t\t\t\t\t\t_invalidated.OnNext(Unit.Default);\n\t\t\t\t\t\t_mutations.OnNext(new UpdateAttribute(id, key, value, _textPosition.Value));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\tIBehaviorProperty<T> CreateProperty<T>(T initialValue, Action<T> onSet, IObservable<bool> isReadOnly = null)\n\t\t{\n\t\t\tisReadOnly = isReadOnly ?? Observable.Return(false);\n\n\t\t\tvar subject = new BehaviorSubject<T>(initialValue);\n\n\t\t\tvar property = BehaviorProperty.Create(subject, _invalidated.Update(Unit.Default), isReadOnly);\n\n\t\t\tproperty.Skip(1)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Do(onSet)\n\t\t\t\t.Subscribe();\n\n\t\t\treturn property;\n\t\t}\n\n\t\tstatic string NameToKey(XName name)\n\t\t{\n\t\t\treturn (name.Namespace == XNamespace.Get(\"http://schemas.fusetools.com/ux\") ? \"ux:\" : \"\") + name.LocalName;\n\t\t}\n\n\t\tstatic XName KeyToName(string name)\n\t\t{\n\t\t\treturn name.StartsWith(\"ux:\")\n\t\t\t\t? XName.Get(name.StripPrefix(\"ux:\"), \"http://schemas.fusetools.com/ux\")\n\t\t\t\t: XName.Get(name);\n\t\t}\n\n\t\tpublic IObservable<Unit> Changed { get { return _invalidated.Merge(_element.Select(_ => Unit.Default)); }}\n\n\t\tIBehavior<IReadOnlyList<ILiveElement>> ILiveElement.Children\n\t\t{\n\t\t\tget { return _children.AsBehavior(); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Live/LiveProject.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing Fuse.Preview;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Protocol;\nusing Uno.ProjectFormat;\n\nnamespace Outracks.Fuse.Live\n{\n\tpublic class LiveProject : IProject, IProjectLike\n\t{\n\t\tpublic LiveProject(Fusion.IDocument fusionDocument, IFileSystem shell, IObservable<BytecodeGenerated> bytecodeGenerated, IScheduler scheduler = null)\n\t\t{\n\t\t\tscheduler = scheduler ?? Scheduler.Default;\n\t\t\t_shell = shell;\n\n\t\t\tvar mutations = new Subject<IBinaryMessage>();\n\n\t\t\tvar idToElement = new BehaviorSubject<Dictionary<ObjectIdentifier, IElement>>(new Dictionary<ObjectIdentifier, IElement>());\n\n\t\t\tvar metadata = bytecodeGenerated\n\t\t\t\t.Select(bc => bc.Bytecode.Metadata.ElementTypeHierarchy.ToLookup())\n\t\t\t\t.StartWith(Lookup.Empty<ObjectIdentifier, ObjectIdentifier>())\n\t\t\t\t.Replay(1);\n\n\t\t\t_idToElement = idToElement;\n\t\t\tmetadata.Connect();\n\n\t\t\tbytecodeGenerated.Subscribe(bc =>\n\t\t\t{\n\t\t\t\tvar elements = idToElement.Value;\n\n\t\t\t\tforeach (var type in bc.Bytecode.Metadata.PrecompiledElements)\n\t\t\t\t{\n\t\t\t\t\tIElement element;\n\t\t\t\t\tif (!elements.TryGetValue(type.Id, out element))\n\t\t\t\t\t\telements[type.Id] = element = new LiveElement(\n\t\t\t\t\t\t\tAbsoluteFilePath.Parse(\"N/A\"),\n\t\t\t\t\t\t\tmetadata,\n\t\t\t\t\t\t\tObservable.Return(true),\n\t\t\t\t\t\t\tnew Subject<Unit>(),\n\t\t\t\t\t\t\tObserver.Create<IBinaryMessage>(_ => { }),\n\t\t\t\t\t\t\tgetElement: GetElement);\n\n\t\t\t\t\telement.Replace(_ => Task.FromResult(SourceFragment.FromString(type.Source))).Wait();\n\t\t\t\t}\n\n\t\t\t\tidToElement.OnNext(elements);\n\t\t\t});\n\n\t\t\tvar unoProj = ProjectWatcher.Create(fusionDocument, shell, scheduler);\n\t\t\tName = unoProj.Name;\n\t\t\tPackageReferences = unoProj.PackageReferences;\n\t\t\tProjectReferences = unoProj.ProjectReferences;\n\t\t\tvar liveDocuments = unoProj.UxFiles\n\t\t\t\t.CachePerElement(e => LiveDocument.Open(e, shell, metadata, idToElement, mutations, scheduler), val => val.Dispose())\n\t\t\t\t.Select(ImmutableList.CreateRange)\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\tvar filePath = fusionDocument.FilePath.NotNone();\n\n\n\t\t\tFilePath = filePath;\n\t\t\tRootDirectory = filePath.Select(f => f.ContainingDirectory);\n\t\t\tBuildOutputDirectory = unoProj.BuildOutputDirectory;\n\n\t\t\t_liveDocuments = liveDocuments;\n\t\t\tMutations = mutations;\n\n\t\t\tBundleFiles = unoProj.BundleFiles;\n\t\t\tFuseJsFiles = unoProj.FuseJsFiles;\n\n\t\t\tDocuments = liveDocuments.Select(d => ImmutableList.ToImmutableList(d.Cast<IDocument>()));\n\n\t\t\tvar allElements = Documents\n\t\t\t\t.CachePerElement(doc => doc.Elements)\n\t\t\t\t.Select(docs => docs.ToObservableEnumerable()).Switch()\n\t\t\t\t.Select(e => e.Join().ToArray())\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\tvar classes = allElements\n\t\t\t\t.Where(e => e.HasProperty(\"ux:Class\"))\n\t\t\t\t.DistinctUntilSetChanged()\n\t\t\t\t.Replay(1);\n\n\t\t\tvar globals = allElements\n\t\t\t\t.Where(e => e.HasProperty(\"ux:Global\"))\n\t\t\t\t.DistinctUntilSetChanged()\n\t\t\t\t.Replay(1);\n\n\t\t\tClasses = classes;\n\t\t\tGlobalElements = globals;\n\n\t\t\tLogMessages = _liveDocuments.Switch(docs =>\n\t\t\t\tdocs.Select(doc => doc.Errors.NotNone().Select(o => doc.SimulatorIdPrefix + \": \" + o.Message))\n\t\t\t\t\t.Merge());\n\n\t\t\t_garbage = Disposable.Combine(\n\t\t\t\tclasses.Connect(),\n\t\t\t\tglobals.Connect(),\n\t\t\t\tDisposable.Create(() =>\n\t\t\t\t\tliveDocuments\n\t\t\t\t\t\t.FirstAsync()\n\t\t\t\t\t\t.Subscribe(documents => documents.Each(d => d.Dispose()))));\n\n\t\t\tvar app = Documents\n\t\t\t\t.SelectPerElement(d => d.Root)\n\t\t\t\t.WherePerElement(e => e.Name.Is(\"App\"))\n\t\t\t\t.Select(e => e.FirstOr(Element.Empty))\n\t\t\t\t.Switch();\n\n\t\t\tContext = new Context(app, GetElement);\n\t\t}\n\n\t\treadonly IDisposable _garbage;\n\t\treadonly IFileSystem _shell;\n\t\treadonly BehaviorSubject<Dictionary<ObjectIdentifier, IElement>> _idToElement;\n\t\treadonly IObservable<IImmutableList<LiveDocument>> _liveDocuments;\n\n\t\tpublic IObservable<IEnumerable<DocumentSource>> LatestSource\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _liveDocuments\n\t\t\t\t\t.SelectPerElement(liveDocument =>\n\t\t\t\t\t\tliveDocument.Source.Select(source => new DocumentSource\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLiveDocument = liveDocument,\n\t\t\t\t\t\t\tFileContents = new UxFileContents\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tContents = source.ToString(),\n\t\t\t\t\t\t\t\tPath = liveDocument.SimulatorIdPrefix\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}))\n\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t.Replay(1).RefCount();\n\t\t\t}\n\t\t}\n\n\t\tpublic IObservable<IImmutableList<IDocument>> Documents { get; private set; }\n\t\tpublic IObservable<IBinaryMessage> Mutations { get; private set; }\n\n\n\t\tpublic IContext Context { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<PackageReference>> PackageReferences { get; private set; }\n\t\tpublic IObservable<IImmutableSet<ProjectReference>> ProjectReferences { get; private set; }\n\t\tpublic IObservable<string> Name { get; private set; }\n\n\t\tpublic IObservable<AbsoluteFilePath> FilePath { get; private set; }\n\t\tpublic IObservable<AbsoluteDirectoryPath> RootDirectory { get; private set; }\n\t\tpublic IObservable<AbsoluteDirectoryPath> BuildOutputDirectory { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<AbsoluteFilePath>> BundleFiles { get; private set; }\n\t\tpublic IObservable<IImmutableSet<AbsoluteFilePath>> FuseJsFiles { get; private set; }\n\n\t\tpublic IObservable<IEnumerable<IElement>> GlobalElements { get; private set; }\n\n\t\tpublic IObservable<IEnumerable<IElement>> Classes { get; private set; }\n\n\t\tpublic IElement GetElement(ObjectIdentifier simulatorId)\n\t\t{\n\t\t\treturn _idToElement.Value.TryGetValue(simulatorId).Or(Element.Empty);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Creates a new document in the project, and adds it to unoproj file.\n\t\t/// Also creates any missing directories in path.\n\t\t/// </summary>\n\t\tpublic async Task CreateDocument(RelativeFilePath relativePath, SourceFragment contents = null)\n\t\t{\n\t\t\tcontents = contents ?? SourceFragment.Empty;\n\n\t\t\tvar rootDir = await RootDirectory.FirstAsync();\n\t\t\tvar newFilePath = rootDir.Combine(relativePath);\n\n\t\t\tvar containingDir = newFilePath.ContainingDirectory;\n\t\t\t_shell.Create(containingDir);\n\n\t\t\tusing (var stream = _shell.CreateNew(newFilePath))\n\t\t\t{\n\t\t\t\tvar bytes = contents.ToBytes();\n\t\t\t\tstream.Write(bytes, 0, bytes.Length);\n\t\t\t}\n\n\t\t\tvar projectFilePath = await FilePath.FirstAsync();\n\t\t\tvar project = Project.Load(projectFilePath.NativePath);\n\n\t\t\tif (project.AllFiles.None(item => item.UnixPath == relativePath.NativeRelativePath))\n\t\t\t{\n\t\t\t\tproject.MutableIncludeItems.Add(new IncludeItem(relativePath.NativeRelativePath));\n\t\t\t\tproject.Save();\n\t\t\t}\n\t\t}\n\t\tpublic IObservable<string> LogMessages { get; private set; }\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_garbage.Dispose();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fuse/studio/Project/Live/ProjectWatcher.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing Outracks.IO;\nusing Uno.ProjectFormat;\n\nnamespace Outracks.Fuse.Live\n{\n\tpublic class ProjectWatcher\n\t{\n\t\tpublic static ProjectWatcher Create(Fusion.IDocument document, IFileSystem fileSystem, IScheduler scheduler = null)\n\t\t{\n\t\t\tscheduler = scheduler ?? Scheduler.Default;\n\n\t\t\tvar projectSnapshots =\n\t\t\t\tdocument.FilePath.NotNone()\n\t\t\t\t\t.Select(projectPath =>\n\t\t\t\t\t\tfileSystem\n\t\t\t\t\t\t\t.Watch(projectPath)\n\t\t\t\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t\t\t\t.CatchAndRetry(delay: TimeSpan.FromSeconds(1), scheduler: scheduler)\n\t\t\t\t\t\t\t.Throttle(TimeSpan.FromSeconds(1.0 / 30.0), scheduler)\n\t\t\t\t\t\t\t.SelectSome(_ => Try(() => Project.Load(projectPath.NativePath)))\n\t\t\t\t\t\t\t.CombineLatest(Observable.Interval(TimeSpan.FromSeconds(2), scheduler).StartWith(0))\n\t\t\t\t\t\t\t.SelectSome(projectAndTime => Try(() => CreateSnapshot(projectAndTime.Item1, projectPath.ContainingDirectory))))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.Replay(1).RefCount();\n\n\t\t\treturn new ProjectWatcher()\n\t\t\t{\n\t\t\t\tName = projectSnapshots.Select(p => p.Name).DistinctUntilChanged().Replay(1).RefCount(),\n\t\t\t\tUxFiles = projectSnapshots.Select(p => p.UxFiles).DistinctUntilSetChanged().Replay(1).RefCount(),\n\t\t\t\tBundleFiles = projectSnapshots.Select(p => p.BundleFiles).DistinctUntilSetChanged().Replay(1).RefCount(),\n\t\t\t\tFuseJsFiles = projectSnapshots.Select(p => p.FuseJsFiles).DistinctUntilSetChanged().Replay(1).RefCount(),\n\t\t\t\tBuildOutputDirectory = projectSnapshots.Select(p => p.BuildOutputDirectory).DistinctUntilChanged().Replay(1).RefCount(),\n\t\t\t\tPackageReferences = projectSnapshots.Select(p => p.PackageReferences).DistinctUntilSetChanged().Replay(1).RefCount(),\n\t\t\t\tProjectReferences = projectSnapshots.Select(p => p.ProjectReferences).DistinctUntilSetChanged().Replay(1).RefCount()\n            };\n\t\t}\n\n\t\tpublic static ProjectSnapshot CreateSnapshot(AbsoluteFilePath projectPath)\n\t\t{\n\t\t\treturn CreateSnapshot(Project.Load(projectPath.NativePath), projectPath.ContainingDirectory);\n\t\t}\n\n\t\tpublic static ProjectSnapshot CreateSnapshot(Project project, AbsoluteDirectoryPath root)\n\t\t{\n\t\t\tproject.InvalidateItems();\n\t\t\treturn new ProjectSnapshot(\n\t\t\t\tname: project.Name,\n\t\t\t\tuxFiles:\n\t\t\t\t\tproject.UXFiles\n\t\t\t\t\t\t.Select(f => root / RelativeFilePath.Parse(f.UnixPath))\n\t\t\t\t\t\t.ToImmutableHashSet(),\n\t\t\t\tbundleFiles:\n\t\t\t\t\tproject.BundleFiles\n\t\t\t\t\t\t.Select(f => root / RelativeFilePath.Parse(f.UnixPath))\n\t\t\t\t\t\t.ToImmutableHashSet(),\n\t\t\t\tfuseJsFiles:\n\t\t\t\t\tproject.FuseJSFiles\n\t\t\t\t\t\t.Select(f => root / RelativeFilePath.Parse(f.UnixPath))\n\t\t\t\t\t\t.ToImmutableHashSet(),\n\t\t\t\tbuildOutputDirectory:\n\t\t\t\t\tAbsoluteDirectoryPath.TryParse(project.BuildDirectory).Or(root / new DirectoryName(\"build\")),\n\t\t\t\tpackageReferences: project.PackageReferences.ToImmutableHashSet(),\n\t\t\t\tprojectReferences: project.ProjectReferences.ToImmutableHashSet()\n\t\t\t);\n\t\t}\n\n\t\tstatic Optional<T> Try<T>(Func<T> func)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn func();\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\t// TODO: report this somewhere\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic IObservable<string> Name { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<AbsoluteFilePath>> UxFiles { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<AbsoluteFilePath>> BundleFiles { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<AbsoluteFilePath>> FuseJsFiles { get; private set; }\n\n\t\tpublic IObservable<AbsoluteDirectoryPath> BuildOutputDirectory { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<PackageReference>> PackageReferences { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<ProjectReference>> ProjectReferences { get; private set; }\n\n\t\tProjectWatcher() { }\n\n\t}\n\n\tpublic sealed class ProjectSnapshot\n\t{\n\t\tpublic readonly string Name;\n\n\t\tpublic readonly IImmutableSet<AbsoluteFilePath> UxFiles;\n\n\t\tpublic readonly IImmutableSet<AbsoluteFilePath> BundleFiles;\n\n\t\tpublic readonly IImmutableSet<AbsoluteFilePath> FuseJsFiles;\n\n\t\tpublic readonly AbsoluteDirectoryPath BuildOutputDirectory;\n\n\t\tpublic readonly IImmutableSet<PackageReference> PackageReferences;\n\n\t\tpublic readonly IImmutableSet<ProjectReference> ProjectReferences;\n\n\t\tpublic ProjectSnapshot(string name, IImmutableSet<AbsoluteFilePath> uxFiles, IImmutableSet<AbsoluteFilePath> bundleFiles, IImmutableSet<AbsoluteFilePath> fuseJsFiles, AbsoluteDirectoryPath buildOutputDirectory, IImmutableSet<PackageReference> packageReferences, IImmutableSet<ProjectReference> projectReferences)\n\t\t{\n\t\t\tName = name;\n\t\t\tUxFiles = uxFiles;\n\t\t\tBundleFiles = bundleFiles;\n\t\t\tFuseJsFiles = fuseJsFiles;\n\t\t\tBuildOutputDirectory = buildOutputDirectory;\n\t\t\tPackageReferences = packageReferences;\n\t\t\tProjectReferences = projectReferences;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fuse/studio/Project/Live/PushEventsToDaemon.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Fuse.Preview;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fuse.Protocol.Messages;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Protocol;\nusing BuildIssueTypeData = Outracks.Fuse.Protocol.BuildIssueTypeData;\n\nnamespace Outracks.Fuse.Live\n{\n\tpublic static class PushEventsToDaemon\n\t{\n\t\tpublic static IDisposable Start(\n\t\t\tIObservable<IBinaryMessage> messages,\n\t\t\tIMessagingService daemon,\n\t\t\tAbsoluteFilePath projectPath,\n\t\t\tGuid projectId,\n\t\t\tBuildTarget target)\n\t\t{\n\t\t\t// TODO: do something with reset from the daemon\n//\t\t\tvar reset = daemon.BroadcastedEvents<ResetPreviewEvent>(false);\n\n\t\t\tvar daemonEvents = Observable.Merge<IEventData>(\n\t\t\t\tmessages.TryParse(Started.MessageType, Started.ReadDataFrom).SelectSome(started =>\n\t\t\t\t\tBinaryMessage.TryParse(started.Command, BuildProject.MessageType, BuildProject.ReadDataFrom).Select(build =>\n\t\t\t\t\t\tnew BuildStartedData\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBuildId = build.Id,\n\t\t\t\t\t\t\tProjectPath = projectPath.NativePath,\n\t\t\t\t\t\t\tBuildType = BuildTypeData.FullCompile,\n\t\t\t\t\t\t\tProjectId = projectId,\n\t\t\t\t\t\t\tTarget = target,\n\t\t\t\t\t\t}).Or(\n\t\t\t\t\tBinaryMessage.TryParse(started.Command, GenerateBytecode.MessageType, GenerateBytecode.ReadDataFrom).Select(reify =>\n\t\t\t\t\t\tnew BuildStartedData\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBuildId = reify.Id,\n\t\t\t\t\t\t\tProjectPath = projectPath.NativePath,\n\t\t\t\t\t\t\tBuildType = BuildTypeData.LoadMarkup,\n\t\t\t\t\t\t\tProjectId = projectId,\n\t\t\t\t\t\t\tTarget = target,\n\t\t\t\t\t\t}))),\n\n\t\t\t\tmessages.TryParse(Ended.MessageType, Ended.ReadDataFrom).SelectSome(ended =>\n\t\t\t\t\tBinaryMessage.TryParse(ended.Command, BuildProject.MessageType, BuildProject.ReadDataFrom).Select(build =>\n\t\t\t\t\t\tnew BuildEndedData\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBuildId = build.Id,\n\t\t\t\t\t\t\tStatus = ended.Success ? BuildStatus.Success : BuildStatus.Error,\n\t\t\t\t\t\t}).Or(\n\t\t\t\t\tBinaryMessage.TryParse(ended.Command, GenerateBytecode.MessageType, GenerateBytecode.ReadDataFrom).Select(reify =>\n\t\t\t\t\t\tnew BuildEndedData\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBuildId = reify.Id,\n\t\t\t\t\t\t\tStatus = ended.Success ? BuildStatus.Success : BuildStatus.Error,\n\t\t\t\t\t\t}))),\n\n\t\t\t\tmessages\n\t\t\t\t\t.TryParse(BuildLogged.MessageType, BuildLogged.ReadDataFrom)\n\t\t\t\t\t.Select(e => new BuildLoggedData\n\t\t\t\t\t{\n\t\t\t\t\t\tBuildId = e.BuildId,\n\t\t\t\t\t\tMessage = e.Text,\n\t\t\t\t\t}),\n\n\t\t\t\tmessages\n\t\t\t\t\t.TryParse(BuildIssueDetected.MessageType, BuildIssueDetected.ReadDataFrom)\n\t\t\t\t\t.Select(e => new BuildIssueDetectedData\n\t\t\t\t\t{\n\t\t\t\t\t\tBuildId = e.BuildId,\n\t\t\t\t\t\tPath = e.Source.HasValue ? e.Source.Value.File : \"\",\n\t\t\t\t\t\tIssueType = e.Severity.ToPluginBuildEventType(),\n\t\t\t\t\t\tMessage = e.Message.Replace(\"\\r\", \"\\0\"),\n\t\t\t\t\t\tErrorCode = e.Code,\n\t\t\t\t\t\tStartPosition = e.Source.TryGetStartPosition().OrDefault(),\n\t\t\t\t\t\tEndPosition = e.Source.TryGetEndPosition().OrDefault(),\n\t\t\t\t\t}),\n\n\t\t\t\tmessages\n\t\t\t\t\t.TryParse(RegisterName.MessageType, RegisterName.ReadDataFrom)\n\t\t\t\t\t.Select(r => new RegisterClientEvent\n\t\t\t\t\t{\n\t\t\t\t\t\tDeviceId = r.DeviceId,\n\t\t\t\t\t\tDeviceName = r.DeviceName,\n\t\t\t\t\t\tProjectId = projectId.ToString()\n\t\t\t\t\t}),\n\n\t\t\t\tmessages\n\t\t\t\t\t.TryParse(DebugLog.MessageType, DebugLog.ReadDataFrom)\n\t\t\t\t\t.Select(l => new LogEvent\n\t\t\t\t\t{\n\t\t\t\t\t\tDeviceId = l.DeviceId,\n\t\t\t\t\t\tDeviceName = l.DeviceName,\n\t\t\t\t\t\tProjectId = projectId.ToString(),\n\t\t\t\t\t\tConsoleType = ConsoleType.DebugLog,\n\t\t\t\t\t\tMessage = l.Message,\n\t\t\t\t\t\tTimestamp = DateTime.Now\n\t\t\t\t\t}),\n\n\t\t\t\tmessages\n\t\t\t\t\t.TryParse(UnhandledException.MessageType, UnhandledException.ReadDataFrom)\n\t\t\t\t\t.Select(e => new ExceptionEvent\n\t\t\t\t\t{\n\t\t\t\t\t\tDeviceId = e.DeviceId,\n\t\t\t\t\t\tDeviceName = e.DeviceName,\n\t\t\t\t\t\tProjectId = projectId.ToString(),\n\t\t\t\t\t\tType = e.Type,\n\t\t\t\t\t\tMessage = e.Message,\n\t\t\t\t\t\tStackTrace = e.StackTrace,\n\t\t\t\t\t\tTimestamp = DateTime.Now\n\t\t\t\t\t}));\n\n\t\t\treturn daemonEvents.Subscribe(daemon.Broadcast);\n\t\t}\n\n\t\tpublic static BuildIssueTypeData ToPluginBuildEventType(this BuildIssueType type)\n\t\t{\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\t\tcase BuildIssueType.Error:\n\t\t\t\t\treturn BuildIssueTypeData.Error;\n\t\t\t\tcase BuildIssueType.FatalError:\n\t\t\t\t\treturn BuildIssueTypeData.FatalError;\n\t\t\t\tcase BuildIssueType.Message:\n\t\t\t\t\treturn BuildIssueTypeData.Message;\n\t\t\t\tcase BuildIssueType.Warning:\n\t\t\t\t\treturn BuildIssueTypeData.Warning;\n\t\t\t\tdefault:\n\t\t\t\t\treturn BuildIssueTypeData.Unknown;\n\t\t\t}\n\n\t\t}\n\n\t\tstatic Optional<Protocol.Messages.TextPosition> TryGetStartPosition(this Optional<SourceReference> source)\n\t\t{\n\t\t\treturn source\n\t\t\t\t.SelectMany(s => s.Location)\n\t\t\t\t.Select(s => new Protocol.Messages.TextPosition\n\t\t\t\t{\n\t\t\t\t\tLine = s.Line,\n\t\t\t\t\tCharacter = s.Character,\n\t\t\t\t});\n\t\t}\n\n\t\tstatic Optional<Protocol.Messages.TextPosition> TryGetEndPosition(this Optional<SourceReference> source)\n\t\t{\n\t\t\treturn Optional.None();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/Live/XElementExtensions.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Xml.Linq;\n\nnamespace Outracks.Fuse.Live\n{\n\tinternal static class XElementExtensions\n\t{\n\t\tpublic const string DefaultIndentStep = \"\\t\";\n\n\t\tpublic static bool TryGetElementIndent(this XNode element, out string lineIndent)\n\t\t{\n\t\t\tif (element.Parent == null)\n\t\t\t{\n\t\t\t\tlineIndent = string.Empty;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tvar prevNode = element.PreviousNode as XText;\n\t\t\tvar nextNode = element.NextNode as XText;\n\t\t\tif (prevNode != null && nextNode != null)\n\t\t\t{\n\t\t\t\tvar isLastElementOnLine = nextNode.Value.Contains(\"\\n\");\n\t\t\t\tvar lastNewLineIndex = prevNode.Value.LastIndexOf('\\n');\n\t\t\t\tif (isLastElementOnLine || lastNewLineIndex != -1)\n\t\t\t\t{\n\t\t\t\t\tvar lineStartIndex = lastNewLineIndex + 1;\n\t\t\t\t\tlineIndent = prevNode.Value.Substring(lineStartIndex);\n\t\t\t\t\treturn lineIndent.All(char.IsWhiteSpace);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlineIndent = null;\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static void AddBeforeSelfIndented(this XNode self, XElement addedElement)\n\t\t{\n\t\t\tstring selfIndent;\n\t\t\tif (TryGetElementIndent(self, out selfIndent))\n\t\t\t{\n\t\t\t\tIndentDescendantNodes(addedElement, selfIndent);\n\t\t\t\tvar newLineAndIndent = new XText(\"\\n\" + selfIndent);\n\t\t\t\tself.AddBeforeSelf(newLineAndIndent);\n\t\t\t\tnewLineAndIndent.AddBeforeSelf(addedElement);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Ignore indent\n\t\t\t\tself.AddBeforeSelf(addedElement);\n\t\t\t}\n\t\t}\n\n\t\tstatic void IndentDescendantNodes(XElement addedElement, string selfIndent)\n\t\t{\n\t\t\tforeach (var text in addedElement.DescendantNodes().OfType<XText>())\n\t\t\t{\n\t\t\t\ttext.Value = text.Value.Replace(\"\\n\", \"\\n\" + selfIndent);\n\t\t\t}\n\t\t}\n\n\n\t\tpublic static void AddAfterSelfIndented(this XNode self, XElement addedElement)\n\t\t{\n\t\t\tstring selfIndent;\n\t\t\tif (TryGetElementIndent(self, out selfIndent))\n\t\t\t{\n\t\t\t\tIndentDescendantNodes(addedElement, selfIndent);\n\t\t\t\tvar newLineAndIndent = new XText(\"\\n\" + selfIndent);\n\t\t\t\tself.AddAfterSelf(newLineAndIndent);\n\t\t\t\tnewLineAndIndent.AddAfterSelf(addedElement);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Ignore indent\n\t\t\t\tself.AddAfterSelf(addedElement);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AddIndented(this XElement self, XElement child)\n\t\t{\n\t\t\tvar nodeBefore = self\n\t\t\t\t.Nodes()\n\t\t\t\t.LastOrDefault(n => !(n is XText && string.IsNullOrWhiteSpace(((XText)n).Value)));\n\n\t\t\tif (nodeBefore != null)\n\t\t\t{\n\t\t\t\tnodeBefore.AddAfterSelfIndented(child);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstring selfIndent;\n\n\t\t\tif (TryGetElementIndent(self, out selfIndent) && self.Value.All(c => char.IsWhiteSpace(c) || c == '\\n'))\n\t\t\t{\n\t\t\t\t// Remove all existing nodes, known to be whitespace (due to check above)\n\t\t\t\t// This is to make stuff less complicated, only have to worry about one case\n\t\t\t\tforeach (var whitespaceNode in self.Nodes().ToArray())\n\t\t\t\t{\n\t\t\t\t\twhitespaceNode.Remove();\n\t\t\t\t}\n\t\t\t\tstring indentStep = DefaultIndentStep;\n\t\t\t\tif (self.Parent != null)\n\t\t\t\t{\n\t\t\t\t\tstring parentIndent;\n\t\t\t\t\tif (self.Parent.TryGetElementIndent(out parentIndent) && selfIndent.StartsWith(parentIndent))\n\t\t\t\t\t{\n\t\t\t\t\t\tindentStep = selfIndent.Substring(parentIndent.Length);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (selfIndent.Length > 0)\n\t\t\t\t{\n\t\t\t\t\tindentStep = selfIndent;\n\t\t\t\t}\n\n\t\t\t\tvar childIndent = selfIndent + indentStep;\n\t\t\t\tIndentDescendantNodes(child, childIndent);\n\n\t\t\t\tself.Add(new XText(\"\\n\" + childIndent));\n\t\t\t\tself.Add(child);\n\t\t\t\tself.Add(new XText(\"\\n\" + selfIndent));\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tself.Add(child);\n\t\t}\n\n\t\tpublic static void RemoveIndented(this XElement self)\n\t\t{\n\t\t\tvar prevNode = self.PreviousNode as XText;\n\t\t\tvar nextNode = self.NextNode as XText;\n\t\t\tif (prevNode != null &&\n\t\t\t\tnextNode != null &&\n\t\t\t\tprevNode.Value.Contains('\\n') &&\n\t\t\t\tnextNode.Value.Contains('\\n'))\n\t\t\t{\n\t\t\t\t// If self is the sole element on a line with only whitespace, remove the whole line\n\t\t\t\tprevNode.Value = prevNode.Value.TrimEnd('\\t', ' ');\n\t\t\t\tnextNode.Value = string.Join(\"\\n\", nextNode.Value.Split(new [] {'\\n'}, StringSplitOptions.None).Skip(1));\n\t\t\t\tif (nextNode.Value == string.Empty)\n\t\t\t\t\tnextNode.Remove();\n\t\t\t}\n\n\t\t\tvar parent = self.Parent;\n\t\t\tself.Remove();\n\t\t\tif (parent != null && parent.Nodes().All(n => n is XText) && parent.Value.All(c => \"\\n\\t \".Contains(c)))\n\t\t\t{\n\t\t\t\tparent.RemoveNodes();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Project/SpecialProperties.cs",
    "content": "﻿\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class SpecialProperties\n\t{\n\t\tpublic static IAttribute<string> UxName(this IElement element)\n\t\t{\n\t\t\treturn element.GetString(\"ux:Name\", \"\");\n\t\t}\n\n\t\tpublic static IProperty<Optional<string>> UxKey(this IElement element)\n\t\t{\n\t\t\treturn element[\"ux:Key\"];\n\t\t}\n\n\t\tpublic static IProperty<Optional<string>> UxProperty(this IElement element)\n\t\t{\n\t\t\treturn element[\"ux:Property\"];\n\t\t}\n\n\t\tpublic static IProperty<Optional<string>> UxValue(this IElement element)\n\t\t{\n\t\t\treturn element[\"ux:Value\"];\n\t\t}\n\n\t\tpublic static IProperty<Optional<string>> UxClass(this IElement element)\n\t\t{\n\t\t\treturn element[\"ux:Class\"];\n\t\t}\n\n\t\tpublic static IBehaviorProperty<Optional<string>> UxClass(this ILiveElement element)\n\t\t{\n\t\t\treturn element[\"ux:Class\"];\n\t\t}\n\n\t\tpublic static IProperty<Optional<string>> UxInnerClass(this IElement element)\n\t\t{\n\t\t\treturn element[\"ux:InnerClass\"];\n\t\t}\n\n\t\tpublic static IProperty<Optional<string>> UxGlobal(this IElement element)\n\t\t{\n\t\t\treturn element[\"ux:Global\"];\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Project/Where.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fuse\n{\n\tpublic static partial class Element\n\t{\n\t\tpublic static IObservable<IEnumerable<IElement>> Where(\n\t\t\tthis IObservable<IEnumerable<IElement>> self,\n\t\t\tFunc<IElement, IObservable<bool>> predicate)\n\t\t{\n\t\t\treturn self.Switch(elements =>\n\t\t\t\telements.Select(elm => predicate(elm).Select(passed => passed ? Optional.Some(elm) : Optional.None()))\n\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t.Select(elms => elms.NotNone()));\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/ProjectData.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass ProjectData : IEquatable<ProjectData>\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly AbsoluteFilePath ProjectPath;\n\t\tpublic readonly DateTime? LastOpened; //Optional doesn't work well with user settings, so use Nullable instead\n\n\t\tpublic ProjectData(string name, AbsoluteFilePath projectPath, DateTime? lastOpened)\n\t\t{\n\t\t\tName = name;\n\t\t\tProjectPath = projectPath;\n\t\t\tLastOpened = lastOpened;\n\t\t}\n\n\t\tpublic bool Equals(ProjectData other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn string.Equals(Name, other.Name)\n\t\t\t\t&& Equals(ProjectPath, other.ProjectPath)\n\t\t\t\t&& Equals(LastOpened, other.LastOpened);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\tif (obj.GetType() != this.GetType()) return false;\n\t\t\treturn Equals((ProjectData)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tvar hashCode = Name != null ? Name.GetHashCode() : 0;\n\t\t\t\thashCode = (hashCode * 397) ^ (ProjectPath != null ? ProjectPath.GetHashCode() : 0);\n\t\t\t\thashCode = (hashCode * 397) ^ (LastOpened == null ? LastOpened.GetHashCode() : 0);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(ProjectData left, ProjectData right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(ProjectData left, ProjectData right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\n\t\tpublic static ImmutableList<ProjectData> ExistingProjects(IEnumerable<ProjectData> pd)\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\treturn pd.Where(p => shell.Exists(p.ProjectPath)).ToImmutableList();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fuse/studio/ProjectHost.cs",
    "content": "using System;\nusing Fuse.Preview;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass ProjectHost : IDisposable, IProjectAndServer\n\t{\n\t\tpublic IObservable<BuildProject> BuildProject { get; private set; }\n\t\tpublic ProjectPreview Preview { get; private set; }\n\t\tpublic IProject Project { get; private set; }\n\t\treadonly Action<ProjectHost> _dispose;\n\n\t\tpublic ProjectHost(IObservable<BuildProject> buildProject, ProjectPreview preview, IProject project, Action<ProjectHost> dispose)\n\t\t{\n\t\t\tBuildProject = buildProject;\n\t\t\tPreview = preview;\n\t\t\tProject = project;\n\t\t\t_dispose = dispose;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_dispose(this);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyTitle(\"fuse-studio\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: InternalsVisibleTo(\"Outracks.Fuse.Protocol.Tests\")]\n[assembly: InternalsVisibleTo(\"DynamicProxyGenAssembly2\")]\n"
  },
  {
    "path": "src/fuse/studio/RecentProjects.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio\n{\n\tclass ProjectDataPathComparer : IEqualityComparer<ProjectData>\n\t{\n\t\tpublic bool Equals(ProjectData x, ProjectData y)\n\t\t{\n\t\t\tif (ReferenceEquals(x, y))\n\t\t\t\treturn true;\n\n\t\t\tif (ReferenceEquals(x, null) || ReferenceEquals(y, null))\n\t\t\t\treturn false;\n\n\t\t\treturn x.ProjectPath == y.ProjectPath;\n\t\t}\n\n\t\tpublic int GetHashCode(ProjectData obj)\n\t\t{\n\t\t\treturn obj.ProjectPath.GetHashCode();\n\t\t}\n\t}\n\n\tstatic class RecentProjects\n\t{\n\t\tstatic readonly IProperty<Optional<IEnumerable<ProjectData>>> UserSetting =\n\t\t\tUserSettings.List<ProjectData>(\"RecentProjects\");\n\n\t\tpublic static IObservable<ImmutableList<ProjectData>> All\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn UserSetting.OrEmpty()\n\t\t\t\t\t.Select(ProjectData.ExistingProjects)\n\t\t\t\t\t.Replay(1).RefCount();\n\t\t\t}\n\t\t}\n\n\t\tpublic static async Task Bump(Fusion.IDocument document, IObservable<string> projectName)\n\t\t{\n\t\t\tvar filePath = await document.FilePath.NotNone().FirstAsync();\n\t\t\tvar list = await All.FirstAsync();\n\t\t\tvar name = await projectName.FirstAsync();\n\n\t\t\tvar newList =\n\t\t\t\tlist.Insert(0, new ProjectData(name, filePath, DateTime.Now))\n\t\t\t\t\t.Distinct(new ProjectDataPathComparer());\n\n\t\t\tUserSetting.Write(Optional.Some(newList), save: true);\n\t\t}\n\n\t\tpublic static async Task Remove(IAbsolutePath path)\n\t\t{\n\t\t\tvar list = await All.FirstAsync();\n\t\t\tvar newList =\n\t\t\t\tlist.RemoveAll(item => item.ProjectPath.Equals(path))\n\t\t\t\t\t.Distinct(new ProjectDataPathComparer());\n\n\t\t\tUserSetting.Write(Optional.Some(newList), save: true);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Refactoring/ClassExtractor.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing System.Xml.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic class ClassExtractor : IClassExtractor\n\t{\n\t\treadonly IProject _project;\n\t\treadonly ISubject<string> _logMessages = new Subject<string>();\n\n\t\tpublic ClassExtractor(IProject project)\n\t\t{\n\t\t\t_project = project;\n\t\t}\n\n\t\tpublic IObservable<string> LogMessages\n\t\t{\n\t\t\tget { return _logMessages; }\n\t\t}\n\n\t\tpublic async Task ExtractClass(IElement element, string name, Optional<RelativeFilePath> fileName)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (fileName.HasValue)\n\t\t\t\t{\n\t\t\t\t\tawait ExtractClassToFile(element, name, fileName.Value);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\telement.UxClass().Write(name);\n\t\t\t\telement.PasteAfter(SourceFragment.FromString(string.Format(\"<{0} />\", name)));\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\t_logMessages.OnNext(string.Format(\"Error: Unable to create class. {0}\\r\\n\", ex.Message));\n\t\t\t}\n\t\t}\n\n\t\tasync Task ExtractClassToFile(IElement element, string name, RelativeFilePath fileName)\n\t\t{\n\t\t\tvar xml = (await element.Copy()).ToXml();\n\t\t\txml.SetAttributeValue(KeyToName(\"ux:Class\"), name);\n\t\t\tawait _project.CreateDocument(fileName, SourceFragment.FromXml(xml));\n\t\t\t// Don't replace original element before new class is loaded\n\t\t\tawait _project.Classes\n\t\t\t\t.WherePerElement(x => x.UxClass().Is(name))\n\t\t\t\t.Where(x => x.Any())\n\t\t\t\t.FirstAsync()\n\t\t\t\t.Timeout(TimeSpan.FromSeconds(2));\n\t\t\tawait element.Replace(_ => Task.FromResult(SourceFragment.FromString(string.Format(\"<{0} />\", name))));\n\t\t}\n\n\t\tstatic XName KeyToName(string name)\n\t\t{\n\t\t\treturn name.StartsWith(\"ux:\")\n\t\t\t\t? XName.Get(name.StripPrefix(\"ux:\"), \"http://schemas.fusetools.com/ux\")\n\t\t\t\t: XName.Get(name);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Refactoring/ExtractClassButtonViewModel.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic class ExtractClassButtonViewModel : IExtractClassButtonViewModel\n\t{\n\t\treadonly Command _command;\n\t\treadonly ISubject<bool> _hovering;\n\t\treadonly IObservable<bool> _highlightSelectedElement;\n\t\treadonly Subject<string> _log = new Subject<string>();\n\t\treadonly IList<string> _invalidUxClassNames = new List<string>()\n\t\t{\n\t\t\t\"JavaScript\",\n\t\t\t\"Include\"\n\t\t};\n\n\t\tpublic Command Command\n\t\t{\n\t\t\tget { return _command; }\n\t\t}\n\n\t\tpublic IObservable<bool> HighlightSelectedElement\n\t\t{\n\t\t\tget { return _highlightSelectedElement; }\n\t\t}\n\n\t\tpublic void HoverEnter()\n\t\t{\n\t\t\t_hovering.OnNext(true);\n\t\t}\n\n\t\tpublic void HoverExit()\n\t\t{\n\t\t\t_hovering.OnNext(false);\n\t\t}\n\n\t\tpublic IObservable<string> Log\n\t\t{\n\t\t\tget { return _log; }\n\t\t}\n\n\t\tpublic ExtractClassButtonViewModel(\n\t\t\tIProject project,\n\t\t\tIContext context,\n\t\t\tAction<IExtractClassViewModel> openDialogAction,\n\t\t\tIFileSystem fileSystem,\n\t\t\tIClassExtractor classExtractor)\n\t\t{\n\t\t\t_hovering = new BehaviorSubject<bool>(false);\n\n\t\t\tvar allClassNames = project.Classes.Select(\n\t\t\t\telements =>\n\t\t\t\t{\n\t\t\t\t\tvar elementList = elements as IList<IElement> ?? elements.ToList();\n\t\t\t\t\tif (!elementList.Any())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn Observable.Return(new List<Optional<string>>());\n\t\t\t\t\t}\n\t\t\t\t\treturn elementList.Select(el => el.UxClass()).CombineLatest();\n\t\t\t\t}).Switch().Select(x => new HashSet<string>(x.NotNone())).Replay(1).RefCount();\n\n\t\t\tvar canExtractSelectedElement = context.CurrentSelection.IsEmpty.IsFalse()\n\t\t\t\t.And(context.CurrentSelection.Parent.IsEmpty.IsFalse()) // Not the App(root) element\n\t\t\t\t// We can't extract an element which is already a class\n\t\t\t\t.And(context.CurrentSelection.UxClass().Is(Optional.None()))\n\t\t\t\t// Extracting classes listed in _invalidUxClassNames creates invalid UX\n\t\t\t\t.And(context.CurrentSelection.Name.Select(name => !_invalidUxClassNames.Contains(name)))\n\t\t\t\t.Replay(1)\n\t\t\t\t.RefCount();\n\n\t\t\t_highlightSelectedElement = _hovering.And(canExtractSelectedElement);\n\n\t\t\t_command = Command.Create(\n\t\t\t\tcanExtractSelectedElement,\n\t\t\t\tcontext.CurrentSelection.Name.CombineLatest(\n\t\t\t\t\tallClassNames,\n\t\t\t\t\t(selectedElementName, classNames) =>\n\t\t\t\t\t\t(Action) (() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\topenDialogAction(\n\t\t\t\t\t\t\t\t new ExtractClassViewModel(\n\t\t\t\t\t\t\t\tcontext: context,\n\t\t\t\t\t\t\t\tsuggestedName: GetClassNameSuggestion(selectedElementName, classNames),\n\t\t\t\t\t\t\t\tallClassNames: allClassNames,\n\t\t\t\t\t\t\t\tclassExtractor: classExtractor,\n\t\t\t\t\t\t\t\tfileSystem: fileSystem,\n\t\t\t\t\t\t\t\tproject: project));\n\t\t\t\t\t\t})));\n\t\t}\n\n\t\tstatic string GetClassNameSuggestion(string selectedElementName, HashSet<string> classNames)\n\t\t{\n\t\t\tvar primarySuggestion = \"My\" + selectedElementName;\n\t\t\tvar suggestion = primarySuggestion;\n\t\t\tvar suggestionCounter = 2;\n\t\t\twhile (classNames.Contains(suggestion))\n\t\t\t{\n\t\t\t\tsuggestion = primarySuggestion + suggestionCounter;\n\t\t\t\tsuggestionCounter++;\n\t\t\t}\n\t\t\treturn suggestion;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Refactoring/ExtractClassView.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic static class ExtractClassView\n\t{\n\t\tpublic static IControl CreateButton(IExtractClassButtonViewModel model)\n\t\t{\n\t\t\tvar command = model.Command;\n\t\t\tvar hoverColor = Theme.Purple;\n\t\t\tvar mouseEntered = Command.Enabled(model.HoverEnter);\n\t\t\tvar mouseExited = Command.Enabled(model.HoverExit);\n\t\t\treturn CreateButton(command, hoverColor, mouseEntered, mouseExited);\n\t\t}\n\n\t\tpublic static void OpenDialog(\n\t\t\tIModalHost modalHost,\n\t\t\tIExtractClassViewModel viewModel)\n\t\t{\n\t\t\tvar toggleCreateInNewFile = viewModel.CreateInNewFile.Toggle();\n\n\t\t\tvar errorMsg = Label.Create(\n\t\t\t\t\ttext: viewModel.UserInfo.AsText(),\n\t\t\t\t\tfont: Theme.DescriptorFont,\n\t\t\t\t\tcolor: Theme.ErrorColor,\n\t\t\t\t\tlineBreakMode: LineBreakMode.TruncateTail)\n\t\t\t\t.CenterVertically()\n\t\t\t\t.WithHeight(26);\n\n\t\t\tvar optionsPart =\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(CheckBox.Create(viewModel.CreateInNewFile, toggleCreateInNewFile)\n\t\t\t\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t\t\t\t.WithPadding(right: new Points(4), top: new Points(1)))\n\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\t\"Extract to new file\",\n\t\t\t\t\t\t\t\t\tTheme.DefaultFont,\n\t\t\t\t\t\t\t\t\tcolor: Theme.DefaultText)\n\t\t\t\t\t\t\t\t.OnMouse(pressed: toggleCreateInNewFile)\n\t\t\t\t\t\t\t\t.CenterVertically())\n\t\t\t\t\t\t.WithHeight(22),\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(Control.Empty.WithWidth(21))\n\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\t\"Create a new .ux file for the class\",\n\t\t\t\t\t\t\t\t\tTheme.DefaultFont,\n\t\t\t\t\t\t\t\t\tcolor: Theme.DescriptorText,\n\t\t\t\t\t\t\t\t\tlineBreakMode: LineBreakMode.TruncateTail))\n\t\t\t\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t\t.WithHeight(21),\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(Control.Empty.WithWidth(21))\n\t\t\t\t\t\t.Fill(ThemedTextBox.Create(viewModel.NewFileName))\n\t\t\t\t\t\t.WithPadding(top: new Points(6), bottom: new Points(3))\n\t\t\t\t);\n\n\t\t\tvar content =\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(\n\t\t\t\t\t\t\tLabel.Create(\"ux:Class\", Theme.DefaultFont, color: Theme.DefaultText)\n\t\t\t\t\t\t\t\t.CenterVertically().WithPadding(right: new Points(4)))\n\t\t\t\t\t\t.Fill(ThemedTextBox.Create(viewModel.ClassName))\n\t\t\t\t\t\t.WithPadding(bottom: new Points(23)),\n\t\t\t\t\toptionsPart,\n\t\t\t\t\terrorMsg)\n\t\t\t\t.WithPadding(left: new Points(15), top: new Points(15), right: new Points(15));\n\n\t\t\tmodalHost.Open(\n\t\t\t\tconfirm: viewModel.CreateCommand,\n\t\t\t\tfill: Layout.Dock()\n\t\t\t\t\t\t.Top(\n\t\t\t\t\t\t\t// Just use button as header for dialog\n\t\t\t\t\t\t\tCreateButton(Command.Enabled(() => {}), hoverColor: Theme.DefaultText))\n\t\t\t\t\t\t.Fill(content),\n\t\t\t\tconfirmText: \"Create class\",\n\t\t\t\tconfirmTooltip: \"Creates new UX class based on selected element\");\n\t\t}\n\n\t\tstatic IControl CreateButton(\n\t\t\tCommand command,\n\t\t\tBrush hoverColor = default(Brush),\n\t\t\tCommand mouseEntered = default(Command),\n\t\t\tCommand mouseExited = default(Command))\n\t\t{\n\t\t\treturn\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\tThemedButton.Create(\n\t\t\t\t\t\t\tcommand: command,\n\t\t\t\t\t\t\tlabel: Texts.Toolbox_MakeClassFromSelection,\n\t\t\t\t\t\t\ticon: Icons.ExtractClass(command.IsEnabled),\n\t\t\t\t\t\t\ttooltip: Texts.Toolbox_MakeClassFromSelection,\n\t\t\t\t\t\t\thoverColor: hoverColor)\n\t\t\t\t\t\t.WithHeight(45)\n\t\t\t\t\t\t.OnMouse(\n\t\t\t\t\t\t\tentered: mouseEntered,\n\t\t\t\t\t\t\texited: mouseExited),\n\t\t\t\t\tSeparator.Shadow);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Refactoring/ExtractClassViewModel.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Text.RegularExpressions;\nusing Castle.Core.Internal;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic class ExtractClassViewModel : IExtractClassViewModel\n\t{\n\t\t// Seems like uno identifiers can only contain ASCII characters, is that correct?\n\t\tstatic readonly Regex ClassNameValidationRegexp = new Regex(\"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$\", RegexOptions.Compiled);\n\n\t\treadonly Command _createCommand;\n\t\treadonly IProperty<string> _className;\n\t\treadonly IProperty<string> _newFileName;\n\t\treadonly IProperty<bool> _createInNewFile;\n\t\treadonly IObservable<string> _userInfo;\n\n\n\t\tpublic ExtractClassViewModel(\n\t\t\tIContext context,\n\t\t\tstring suggestedName,\n\t\t\tIObservable<HashSet<string>> allClassNames,\n\t\t\tIClassExtractor classExtractor,\n\t\t\tIFileSystem fileSystem,\n\t\t\tIProject project)\n\t\t{\n\t\t\t_className = Property.Create(suggestedName);\n\t\t\t_createInNewFile = Property.Create(false);\n\t\t\tvar newFileNameSubject = new BehaviorSubject<string>(\"\");\n\t\t\tvar hasEditedFileName = false;\n\n\t\t\t_newFileName = newFileNameSubject.AsProperty(\n\t\t\t\tisReadOnly:\n\t\t\t\t\t_createInNewFile.Select(check => check == false),\n\t\t\t\twrite: (name, save) =>\n\t\t\t\t{\n\t\t\t\t\thasEditedFileName = true;\n\t\t\t\t\tnewFileNameSubject.OnNext(name);\n\t\t\t\t});\n\n\t\t\t_className.Subscribe(\n\t\t\t\tname\n\t\t\t\t=>\n\t\t\t\t{\n\t\t\t\t\tif (!hasEditedFileName)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar filename = name.Replace(\".\", Path.DirectorySeparatorChar.ToString()) + \".ux\";\n\t\t\t\t\t\tnewFileNameSubject.OnNext(filename);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\tvar action = _className.CombineLatest(\n\t\t\t\t\tallClassNames,\n\t\t\t\t\t_createInNewFile,\n\t\t\t\t\t_newFileName,\n\t\t\t\t\tproject.RootDirectory,\n\t\t\t\t\t(name, allClasses, toNewFile, fileName, projectPath) =>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Don't care about whitespace at beginning or end\n\t\t\t\t\t\tname = name.Trim();\n\n\t\t\t\t\t\tif (name.IsNullOrEmpty())\n\t\t\t\t\t\t\treturn new ValidatedAction(\"\");\n\n\t\t\t\t\t\tif (name.Any(char.IsWhiteSpace))\n\t\t\t\t\t\t\treturn new ValidatedAction(\"Class name can't contain whitespaces\");\n\n\t\t\t\t\t\tif (!ClassNameValidationRegexp.IsMatch(name))\n\t\t\t\t\t\t\treturn new ValidatedAction(\"Class name is not valid\");\n\n\t\t\t\t\t\tif (allClasses.Contains(name))\n\t\t\t\t\t\t\treturn new ValidatedAction(\"Class name already in use\");\n\n\t\t\t\t\t\tif (toNewFile)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar relativePath = RelativeFilePath.TryParse(fileName);\n\t\t\t\t\t\t\tif (!relativePath.HasValue)\n\t\t\t\t\t\t\t\treturn new ValidatedAction(\"Not a valid filename\");\n\n\t\t\t\t\t\t\tif (!fileName.EndsWith(\".ux\"))\n\t\t\t\t\t\t\t\treturn new ValidatedAction(\"Filename must end in .ux\");\n\n\t\t\t\t\t\t\tif (fileSystem.Exists(projectPath.Combine(relativePath.Value)))\n\t\t\t\t\t\t\t\treturn new ValidatedAction(\"The file already exists\");\n\n\t\t\t\t\t\t\tif (fileName.IsNullOrEmpty())\n\t\t\t\t\t\t\t\treturn new ValidatedAction(\"Filename can not be empty\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new ValidatedAction(\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// A Task is returned by this method, however, we don't do anything with it\n\t\t\t\t\t\t\t\t// and just let it finish in the background\n\t\t\t\t\t\t\t\tclassExtractor.ExtractClass(\n\t\t\t\t\t\t\t\t\telement: context.CurrentSelection,\n\t\t\t\t\t\t\t\t\tname: name,\n\t\t\t\t\t\t\t\t\tfileName: toNewFile ? Optional.Some(RelativeFilePath.Parse(fileName)) : Optional.None());\n\t\t\t\t\t\t\t});\n\t\t\t\t\t})\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\t_userInfo = action.Select(x => x.Message);\n\n\t\t\t_createCommand = Command.Create(action.Select(x => x.Action));\n\t\t}\n\n\t\tclass ValidatedAction\n\t\t{\n\t\t\tpublic ValidatedAction(Action action)\n\t\t\t{\n\t\t\t\tAction = action;\n\t\t\t\tMessage = \"\";\n\t\t\t}\n\n\t\t\tpublic ValidatedAction(string errorMessage)\n\t\t\t{\n\t\t\t\tAction = Optional.None();\n\t\t\t\tMessage = errorMessage;\n\t\t\t}\n\n\t\t\tpublic override string ToString()\n\t\t\t{\n\t\t\t\treturn string.Format(\"({0}, {1})\", Action, Message);\n\t\t\t}\n\n\t\t\tpublic Optional<Action> Action { get; private set; }\n\t\t\tpublic string Message { get; private set; }\n\t\t}\n\n\n\t\tpublic Command CreateCommand\n\t\t{\n\t\t\tget { return _createCommand; }\n\t\t}\n\n\t\tpublic IProperty<string> ClassName\n\t\t{\n\t\t\tget { return _className; }\n\t\t}\n\n\t\tpublic IProperty<string> NewFileName\n\t\t{\n\t\t\tget { return _newFileName; }\n\t\t}\n\n\t\tpublic IProperty<bool> CreateInNewFile\n\t\t{\n\t\t\tget { return _createInNewFile; }\n\t\t}\n\n\t\tpublic IObservable<string> UserInfo\n\t\t{\n\t\t\tget { return _userInfo; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Refactoring/IClassExtractor.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic interface IClassExtractor\n\t{\n\t\tTask ExtractClass(IElement element, string name, Optional<RelativeFilePath> fileName);\n\t\tIObservable<string> LogMessages { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Refactoring/IExtractClassButtonViewModel.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic interface IExtractClassButtonViewModel\n\t{\n\t\tCommand Command { get; }\n\t\tIObservable<bool> HighlightSelectedElement { get; }\n\t\tvoid HoverEnter();\n\t\tvoid HoverExit();\n\t\tIObservable<string> Log { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Refactoring/IExtractClassViewModel.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic interface IExtractClassViewModel\n\t{\n\t\t/// <summary>\n\t\t/// Command to be invoked when the user clicks \"Create class\" button\n\t\t/// </summary>\n\t\tCommand CreateCommand { get; }\n\n\t\t/// <summary>\n\t\t/// The resulting class name, for binding to a textbox.\n\t\t/// A default suggested value is provided.\n\t\t/// </summary>\n\t\tIProperty<string> ClassName { get; }\n\n\t\t/// <summary>\n\t\t/// The name of the new file, for binding to a textbox with a \"browse..\" button on the left side\n\t\t/// Only enabled while CreateInNewFile is true.\n\t\t/// </summary>\n\t\tIProperty<string> NewFileName { get; }\n\n\t\t/// <summary>\n\t\t/// Controls hether to put the newly created class in a new file or not.\n\t\t/// </summary>\n\t\tIProperty<bool> CreateInNewFile { get; }\n\n\t\t/// <summary>\n\t\t/// A string that provides hints to the user. For example when something goes wrong.\n\t\t/// </summary>\n\t\tIObservable<string> UserInfo { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Refactoring/OverlayConfirmCancelDialog.cs",
    "content": "using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Refactoring\n{\n\tpublic static class OverlayConfirmCancelDialog\n\t{\n\t\tpublic static void Open(\n\t\t\tthis IModalHost modalHost,\n\t\t\tCommand confirm,\n\t\t\tIControl fill,\n\t\t\tCommand? cancel = null,\n\t\t\tText? confirmText = null,\n\t\t\tText? cancelText = null,\n\t\t\tText? confirmTooltip = null)\n\t\t{\n\t\t\tmodalHost.OpenModal(\n\t\t\t\tclose => Layout.Dock()\n\t\t\t\t\t.Top(\n\t\t\t\t\t\tConfirmCancelControl.Create(close, confirm, fill, cancel, confirmText, cancelText, confirmTooltip)\n\t\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground)\n\t\t\t\t\t\t\t.MakeHittable()\n\t\t\t\t\t\t\t.Control)\n\t\t\t\t\t.Fill(Control.Empty.WithBackground(Color.FromRgba(0x00000066))));\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/RespondToFocusRequests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio\n{\n\tinternal static class RespondToFocusRequests\n\t{\n\t\tprivate static IObservable<IEnumerable<KeyValuePair<AbsoluteFilePath, AbsoluteFilePath>>> ToProjectDocMap(\n\t\t\tProjectHost projectHost)\n\t\t{\n\t\t\tvar project = projectHost.Project;\n\t\t\tvar docs = project.Documents;\n\t\t\tvar docPaths = docs.Select(x => x.Select(y => y.FilePath).ToObservableEnumerable()).Switch();\n\t\t\tvar projectPath = project.FilePath;\n\t\t\treturn projectPath.CombineLatest(\n\t\t\t\tdocPaths,\n\t\t\t\t(pp, dp) => dp.Select(x => new KeyValuePair<AbsoluteFilePath, AbsoluteFilePath>(x, pp)));\n\t\t}\n\n\t\tpublic static IDisposable Start(\n\t\t\tIMessagingService daemon,\n\t\t\tIObservable<ImmutableList<ProjectHost>> projectHostListStream)\n\t\t{\n\t\t\treturn projectHostListStream\n\t\t\t\t.Select(\n\t\t\t\t\tprojectHosts =>\n\t\t\t\t\t\tprojectHosts\n\t\t\t\t\t\t\t.Select(ToProjectDocMap)\n\t\t\t\t\t\t\t.CombineLatest(projectDocMap => projectDocMap.SelectMany(mapEntry => mapEntry)))\n\t\t\t\t.Switch()\n\t\t\t\t.SubscribeUsing(\n\t\t\t\t\tdocToProjectMap =>\n\t\t\t\t\t{\n\t\t\t\t\t\treturn daemon.ProvideOptionally<FocusDesignerRequest, FocusDesignerResponse>(\n\t\t\t\t\t\t\tx =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar projectPath =\n\t\t\t\t\t\t\t\t\tdocToProjectMap.Where(\n\t\t\t\t\t\t\t\t\t\t\ty => string.Equals(y.Key.NativePath, x.File, StringComparison.OrdinalIgnoreCase))\n\t\t\t\t\t\t\t\t\t\t.Select(y => y.Value)\n\t\t\t\t\t\t\t\t\t\t.FirstOrDefault();\n\n\t\t\t\t\t\t\t\tif (projectPath != null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tApplication.OpenDocument(projectPath, true);\n\t\t\t\t\t\t\t\t\treturn new FocusDesignerResponse();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn new Optional<FocusDesignerResponse>();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Setup/InstallStatus.cs",
    "content": "using System;\nusing Outracks.Fuse.Components;\n\nnamespace Outracks.Fuse.Setup {\n\tpublic enum InstallStatus\n\t{\n\t\tUnknown,\n\t\tNotInstalled,\n\t\tUpdateAvailable,\n\t\tInstalled,\n\t\tInstalling\n\t}\n\n\tstatic class ComponentStatusExtensions\n\t{\n\t\tpublic static InstallStatus AsInstallStatus(this ComponentStatus status)\n\t\t{\n\t\t\tswitch (status)\n\t\t\t{\n\t\t\t\tcase ComponentStatus.NotInstalled:\n\t\t\t\t\treturn InstallStatus.NotInstalled;\n\t\t\t\tcase ComponentStatus.Installed:\n\t\t\t\t\treturn InstallStatus.Installed;\n\t\t\t\tcase ComponentStatus.UpdateAvailable:\n\t\t\t\t\treturn InstallStatus.UpdateAvailable;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception(\"Unknown ComponentStatus \" + status);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Setup/MissingAndroidNotification.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Components;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Setup\n{\n\tstatic class MissingAndroidNotification\n\t{\n\t\tpublic static void Create(IFuse fuse, Subject<Unit> startedAndroidPreview)\n\t\t{\n\t\t\tvar showNotification = new BehaviorSubject<bool>(false);\n\t\t\tvar dontCheckForAndroid = UserSettings.Bool(\"DontCheckForAndroid\").AutoInvalidate();\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: showNotification,\n\t\t\t\twindow: dialog => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Observable.Return(\"No Android tools detected\"),\n\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(600, 270)))),\n\t\t\t\t\tContent = Control.Lazy(() => CreateContent(showNotification, dontCheckForAndroid))\n\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground),\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\t});\n\n\t\t\tstartedAndroidPreview\n\t\t\t\t.Take(1)\n\t\t\t\t.WithLatestFromBuffered(dontCheckForAndroid.Select(v => v.Or(false)), (_, v) => v)\n\t\t\t\t.Where(v => !v)\n\t\t\t\t.SubscribeOn(TaskPoolScheduler.Default)\n\t\t\t\t.Subscribe(_ =>\n\t\t\t\t\tTask.Run(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (new AndroidBuildTools(fuse.ComponentsDir).Status == ComponentStatus.NotInstalled)\n\t\t\t\t\t\t\t\tshowNotification.OnNext(true);\n\t\t\t\t\t\t}));\n\t\t}\n\n\t\tpublic static IControl CreateContent(BehaviorSubject<bool> showSublimeNotification, IProperty<Optional<bool>> dontCheckForAndroid)\n\t\t{\n\t\t\treturn Layout.Dock()\n\n\t\t\t\t.Top(Label.Create(\n\t\t\t\t\ttext: \"You don't seem to have Android tools set up.\",\n\t\t\t\t\tcolor: Theme.DefaultText))\n\n\t\t\t\t.Top(Spacer.Medium)\n\n\t\t\t\t.Top(Label.Create(\n\t\t\t\t\ttext: \"Do you want help setting it up now?\",\n\t\t\t\t\tcolor: Theme.DefaultText))\n\n\t\t\t\t.Bottom(Layout.Dock()\n\t\t\t\t\t.Left(Buttons.DefaultButton(\n\t\t\t\t\t\t\ttext: \"Don't warn again\",\n\t\t\t\t\t\t\tcmd: Command.Enabled(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdontCheckForAndroid.Write(true);\n\t\t\t\t\t\t\t\tshowSublimeNotification.OnNext(false);\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.WithWidth(150))\n\n\t\t\t\t\t.Right(Buttons.DefaultButtonPrimary(\n\t\t\t\t\t\t\ttext: \"Get Android Tools\",\n\t\t\t\t\t\t\tcmd: Command.Enabled(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tProcess.Start(\"https://fuseopen.com/docs/basics/preview-and-export.html\");\n\t\t\t\t\t\t\t\tshowSublimeNotification.OnNext(false);\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.WithWidth(150))\n\n\t\t\t\t\t.Right(Spacer.Medium)\n\n\t\t\t\t\t.Right(Buttons.DefaultButton(\n\t\t\t\t\t\t\ttext: \"Remind Me Later\",\n\t\t\t\t\t\t\tcmd: Command.Enabled(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tshowSublimeNotification.OnNext(false);\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.WithWidth(150))\n\n\t\t\t\t\t.Fill())\n\n\t\t\t\t.Fill()\n\n\t\t\t\t.WithPadding(new Thickness<Points>(new Points(20)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Setup/MissingPluginNotification.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing Outracks.Fuse.Components;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Setup\n{\n\tpublic static class MissingPluginNotification\n\t{\n\t\tpublic static void Create(IFuse fuse, IObservable<Unit> doneLoadingMainWindow, BehaviorSubject<bool> showSetupGuide)\n\t\t{\n\t\t\tvar showSublimeNotification = new BehaviorSubject<bool>(false);\n\t\t\tvar dontCheckForSublimePlugin = UserSettings.Bool(\"DontCheckForSublimePlugin\").AutoInvalidate();\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: showSublimeNotification.CombineLatest(doneLoadingMainWindow, (show,_) => show),\n\t\t\t\twindow: dialog => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Observable.Return(\"No editor plugin detected\"),\n\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(600, 270)))),\n\t\t\t\t\tContent = Control.Lazy(() => CreateContent(showSublimeNotification, showSetupGuide, dontCheckForSublimePlugin))\n\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground),\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\t});\n\n\t\t\tdontCheckForSublimePlugin\n\t\t\t\t.Select(v => v.Or(false))\n\t\t\t\t.Where(v => !v)\n\t\t\t\t.Take(1)\n\t\t\t\t.SubscribeOn(TaskPoolScheduler.Default)\n\t\t\t\t.Subscribe(_ => Task.Run(() =>\n\t\t\t\t{\n\t\t\t\t\tif (new SublimePlugin(fuse.ComponentsDir).Status == ComponentStatus.NotInstalled &&\n\t\t\t\t\t\tnew VsCodeExtension(fuse.ComponentsDir).Status == ComponentStatus.NotInstalled)\n\t\t\t\t\t\tshowSublimeNotification.OnNext(true);\n\t\t\t\t}));\n\t\t}\n\n\t\tpublic static IControl CreateContent(BehaviorSubject<bool> showSublimeNotification, BehaviorSubject<bool> showSetupGuide, IProperty<Optional<bool>> dontCheckForSublimePlugin)\n\t\t{\n\t\t\treturn Layout.Dock()\n\n\t\t\t\t.Top(Label.Create(\n\t\t\t\t\ttext: \"You don't seem to have an editor plugin set up.\",\n\t\t\t\t\tcolor: Theme.DefaultText))\n\n\t\t\t\t.Top(Spacer.Medium)\n\n\t\t\t\t.Top(Label.Create(\n\t\t\t\t\ttext: \"Do you want help setting it up now?\",\n\t\t\t\t\tcolor: Theme.DefaultText))\n\n\t\t\t\t.Bottom(Layout.Dock()\n\t\t\t\t\t.Left(Buttons.DefaultButton(\n\t\t\t\t\t\t\ttext: \"Don't warn again\",\n\t\t\t\t\t\t\tcmd: Command.Enabled(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdontCheckForSublimePlugin.Write(true);\n\t\t\t\t\t\t\t\tshowSublimeNotification.OnNext(false);\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.WithWidth(150))\n\n\t\t\t\t\t.Right(Buttons.DefaultButtonPrimary(\n\t\t\t\t\t\t\ttext: \"Open Setup Guide\",\n\t\t\t\t\t\t\tcmd: Command.Enabled(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tshowSublimeNotification.OnNext(false);\n\t\t\t\t\t\t\t\tshowSetupGuide.OnNext(true);\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.WithWidth(150))\n\n\t\t\t\t\t.Right(Spacer.Medium)\n\n\t\t\t\t\t.Right(Buttons.DefaultButton(\n\t\t\t\t\t\t\ttext: \"Remind Me Later\",\n\t\t\t\t\t\t\tcmd: Command.Enabled(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tshowSublimeNotification.OnNext(false);\n\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.WithWidth(150))\n\n\t\t\t\t\t.Fill())\n\n\t\t\t\t.Fill()\n\n\t\t\t\t.WithPadding(new Thickness<Points>(new Points(20)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Setup/SetupGuide.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Setup\n{\n\tpublic class SetupGuide\n\t{\n\t\tpublic SetupGuide(IFuse fuse, IObservable<Unit> doneLoadingMainWindow)\n\t\t{\n\t\t\tvar output = new Subject<string>();\n\t\t\tLogMessages = output;\n\n\t\t\tvar report = fuse.Report;\n\t\t\tvar softwares = new SoftwareCollectionStatus(fuse);\n\n\t\t\tvar showSetupGuide = new BehaviorSubject<bool>(false);\n\t\t\tMissingPluginNotification.Create(fuse, doneLoadingMainWindow, showSetupGuide);\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: showSetupGuide.CombineLatest(doneLoadingMainWindow, (s, _) => s),\n\t\t\t\twindow: dialog => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Texts.Dialog_SetupGuide_Caption,\n\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(500, Platform.IsWindows ? 320 : 340)))),\n\t\t\t\t\tContent = Control.Lazy(() => Create(softwares, report, dialog).ShowWhen(showSetupGuide))\n\t\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground),\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\t\tStyle = WindowStyle.Fat,\n\t\t\t\t});\n\n\t\t\tMenu = Menu.Item(Texts.SubMenu_Tools_Setup, () => showSetupGuide.OnNext(true))\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Tools_InstallSDK, () => fuse.RunFuse(\"install\", new[] { \"android\" }, Observer.Create<string>(output.OnNext)))\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Tools_InstallAtomPlugin, () => fuse.RunFuse(\"install\", new[] { \"atom-plugin\" }, Observer.Create<string>(output.OnNext)))\n\t\t\t\t + Menu.Item(Texts.SubMenu_Tools_InstallSublimePlugin, () => fuse.RunFuse(\"install\", new[] { \"sublime-plugin\" }, Observer.Create<string>(output.OnNext)))\n\t\t\t\t + Menu.Item(Texts.SubMenu_Tools_InstallVSCodeExtension, () => fuse.RunFuse(\"install\", new[] { \"vscode-extension\" }, Observer.Create<string>(output.OnNext)))\n\t\t\t\t + Menu.Separator\n\t\t\t\t + Menu.Item(Texts.SubMenu_Tools_Config, () => fuse.RunFuse(\"config\", new string[0], Observer.Create<string>(output.OnNext)));\n\t\t}\n\n\t\tpublic IObservable<string> LogMessages { get; private set; }\n\n\t\tpublic Menu Menu { get; private set; }\n\n\t\tstatic IControl Create(SoftwareCollectionStatus softwares, IReport report, IDialog<object> dialog)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Top(CreateSublimeHeaderText().WithMacWindowStyleCompensation())\n\t\t\t\t.Top(Spacer.Medium)\n\t\t\t\t.Top(Layout.StackFromLeft(\n\t\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\tCreatePluginLine(softwares.SublimeApp, report),\n\t\t\t\t\t\tCreatePluginLine(softwares.SublimePlugin, report))\n\t\t\t\t\t\t.WithWidth(225),\n\t\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\tCreatePluginLine(softwares.VsCodeApp, report),\n\t\t\t\t\t\tCreatePluginLine(softwares.VsCodeExtension, report))))\n\t\t\t\t.Top(Spacer.Medium)\n\t\t\t\t.Top(CreateAtomHeaderText())\n\t\t\t\t.Bottom(\n\t\t\t\t\tButtons.DefaultButtonPrimary(text: Texts.Button_Ok, cmd: Command.Enabled(() => dialog.Close()))\n\t\t\t\t\t\t.WithWidth(100)\n\t\t\t\t\t\t.DockRight())\n\t\t\t\t.Bottom(Spacer.Medium)\n\t\t\t\t.Fill()\n\t\t\t\t.WithPadding(new Thickness<Points>(20))\n\t\t\t\t.WithBackground(Theme.WorkspaceBackground);\n\t\t}\n\n\t\tstatic IControl CreateSublimeHeaderText()\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tLabel.Create(Texts.Dialog_SetupGuide_Comment1,\n\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\tlineBreakMode: LineBreakMode.Wrap),\n\t\t\t\tTheme.Link.Select(linkColor =>\n\t\t\t\tLabel.FormattedText(\n\t\t\t\t\t\ttextParts: Observable.Return(\n\t\t\t\t\t\t\tAttributedText.Parts()\n\t\t\t\t\t\t\t\t.Text(Strings.Dialog_SetupGuide_Comment2_1)\n\t\t\t\t\t\t\t\t.Link(\"Sublime Text 3\", \"http://www.sublimetext.com/3\", linkColor)\n\t\t\t\t\t\t\t\t.Text(Strings.Dialog_SetupGuide_Comment2_2)\n\t\t\t\t\t\t\t\t.Link(\"Visual Studio Code\", \"https://code.visualstudio.com/\", linkColor)\n\t\t\t\t\t\t\t\t.Text(Strings.Dialog_SetupGuide_Comment2_3)),\n\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\tfont: Theme.DefaultFont))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.WithPadding(top: new Points(12)),\n\t\t\t\tLabel.Create(Texts.Dialog_SetupGuide_Comment3,\n\t\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\tlineBreakMode: LineBreakMode.Wrap)\n\t\t\t\t\t.WithPadding(top: new Points(12)));\n\t\t}\n\n\t\tstatic IControl CreateAtomHeaderText()\n\t\t{\n\t\t\treturn Theme.Link.Select(linkColor =>\n\t\t\t\tLabel.FormattedText(\n\t\t\t\t\ttextParts: Observable.Return(\n\t\t\t\t\t\tAttributedText.Parts()\n\t\t\t\t\t\t\t.Text(Strings.Dialog_SetupGuide_SeeAlso1)\n\t\t\t\t\t\t\t.Link(\"Atom\", \"https://atom.io/packages/fuse\", linkColor)\n\t\t\t\t\t\t\t.Text(Strings.Dialog_SetupGuide_SeeAlso2)),\n\t\t\t\t\tcolor: Theme.DefaultText,\n\t\t\t\t\tfont: Theme.DefaultFont)).Switch();\n\t\t}\n\n\t\tstatic IControl CreatePluginLine(SoftwareStatus software, IReport report)\n\t\t{\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Left(CreateIconForStatus(software, report)\n\t\t\t\t\t.WithWidth(25).WithHeight(25)\n\t\t\t\t\t.CenterVertically())\n\t\t\t\t.Left(Spacer.Medium)\n\t\t\t\t.Left(Label.Create(software.Name, color: Theme.DefaultText, font: Theme.DefaultFont)\n\t\t\t\t\t.CenterVertically())\n\t\t\t\t.Right(CreateInstallButton(software)\n\t\t\t\t\t.CenterVertically())\n\t\t\t\t.Fill()\n\t\t\t\t.WithMediumPadding();\n\t\t}\n\n\t\tstatic IControl CreateInstallButton(SoftwareStatus software)\n\t\t{\n\t\t\treturn software.Status\n\t\t\t\t.StartWith(InstallStatus.Unknown)\n\t\t\t\t.Select(s =>\n\t\t\t\t{\n\t\t\t\t\tswitch (s)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase InstallStatus.NotInstalled:\n\t\t\t\t\t\t\treturn Buttons.DefaultButton(\"Install\", cmd: Command.Enabled(software.Install)).WithWidth(100);\n\n\t\t\t\t\t\tcase InstallStatus.UpdateAvailable:\n\t\t\t\t\t\t\treturn Buttons.DefaultButton(\"Update\", cmd: Command.Enabled(software.Install)).WithWidth(100);\n\n\t\t\t\t\t\tcase InstallStatus.Installing:\n\t\t\t\t\t\t\treturn Label.Create(\"Installing...\", color: Theme.DefaultText, font: Theme.DefaultFont)\n\t\t\t\t\t\t\t\t.WithHeight(Buttons.DefaultButtonHeight);\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn Control.Empty\n\t\t\t\t\t\t\t\t.WithHeight(Buttons.DefaultButtonHeight);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tstatic IControl ImageFromResource(string resourceName)\n\t\t{\n\t\t\treturn Image.FromResource(resourceName, typeof(SetupGuide).Assembly);\n\t\t}\n\n\t\tstatic IControl CreateIconForStatus(SoftwareStatus software, IReport report)\n\t\t{\n\t\t\tvar iconPath = \"Outracks.Fuse.Icons.\";\n\t\t\tvar unknown = Layout.Layer();\n\t\t\tvar error = ImageFromResource(iconPath + \"Plugin_Error.png\");\n\t\t\tvar success = ImageFromResource(iconPath + \"Plugin_Success.png\");\n\t\t\tvar warning = ImageFromResource(iconPath + \"Plugin_Warning.png\");\n\t\t\treturn software.Status\n\t\t\t\t.Select(s =>\n\t\t\t\t{\n\t\t\t\t\tswitch (s)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase InstallStatus.Unknown:\n\t\t\t\t\t\t\treturn unknown;\n\t\t\t\t\t\tcase InstallStatus.NotInstalled:\n\t\t\t\t\t\t\treturn error;\n\t\t\t\t\t\tcase InstallStatus.Installed:\n\t\t\t\t\t\t\treturn success;\n\t\t\t\t\t\tcase InstallStatus.Installing:\n\t\t\t\t\t\tcase InstallStatus.UpdateAvailable:\n\t\t\t\t\t\t\treturn warning;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treport.Error(\"Unknown InstallStatus  \" + s, ReportTo.Headquarters);\n\t\t\t\t\t\t\treturn error;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.StartWith(unknown)\n\t\t\t\t.Switch();\n\t\t}\n\t}\n\n\tpublic class SoftwareCollectionStatus\n\t{\n\t\tpublic readonly SoftwareStatus SublimeApp;\n\t\tpublic readonly SoftwareStatus SublimePlugin;\n\t\tpublic readonly SoftwareStatus VsCodeApp;\n\t\tpublic readonly SoftwareStatus VsCodeExtension;\n\n\t\tpublic SoftwareCollectionStatus(IFuse fuse)\n\t\t{\n\t\t\tSublimeApp = new SublimeAppStatus(fuse.Report);\n\t\t\tSublimePlugin = new SublimePluginStatus(fuse);\n\t\t\tVsCodeApp = new VsCodeAppStatus(fuse.Report);\n\t\t\tVsCodeExtension = new VsCodeExtensionStatus(fuse);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Setup/SoftwareStatus.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fuse.Setup\n{\n\tpublic abstract class SoftwareStatus\n\t{\n\t\treadonly ISubject<InstallStatus> _status = new Subject<InstallStatus>();\n\t\treadonly IReport _report;\n\n\t\tpublic string Name { get; private set; }\n\n\t\tpublic IObservable<InstallStatus> Status { get; private set; }\n\n\t\tprotected SoftwareStatus(string name, IReport report)\n\t\t{\n\t\t\tName = name;\n\t\t\t_report = report;\n\t\t\tStatus = Observable\n\t\t\t\t.Defer(() => Observable\n\t\t\t\t\t.Start(() => CheckStatusSafe())\n\t\t\t\t\t.Concat(Observable.Empty<InstallStatus>().Delay(TimeSpan.FromSeconds(2))))\n\t\t\t\t.Repeat()\n\t\t\t\t.Merge(_status)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\n\t\tInstallStatus CheckStatusSafe()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn CheckStatus();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_report.Exception(\"Failed to check software status\", e, ReportTo.LogAndUser | ReportTo.Headquarters);\n\t\t\t\treturn InstallStatus.Unknown;\n\t\t\t}\n\t\t}\n\n\t\tprotected abstract InstallStatus CheckStatus();\n\n\t\tpublic void Install()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tTryInstall();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_report.Exception(\"Failed to install software\", e, ReportTo.LogAndUser | ReportTo.Headquarters);\n\t\t\t}\n\t\t}\n\n\t\tprotected abstract void TryInstall();\n\n\t\tprotected void SetStatus(InstallStatus status)\n\t\t{\n\t\t\t_status.OnNext(status);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Setup/SublimeAppStatus.cs",
    "content": "using System.Diagnostics;\n\nnamespace Outracks.Fuse.Setup\n{\n\tclass SublimeAppStatus : SoftwareStatus\n\t{\n\t\tpublic SublimeAppStatus(IReport report)\n\t\t\t: base(\"Sublime Text 3\", report)\n\t\t{\n\t\t}\n\n\t\tprotected override InstallStatus CheckStatus()\n\t\t{\n\t\t\treturn ApplicationPaths.SublimeTextPath().HasValue ? InstallStatus.Installed : InstallStatus.NotInstalled;\n\t\t}\n\n\t\tprotected override void TryInstall()\n\t\t{\n\t\t\tProcess.Start(\"http://www.sublimetext.com/3\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Setup/SublimePluginStatus.cs",
    "content": "using Outracks.Fuse.Components;\n\nnamespace Outracks.Fuse.Setup\n{\n\tclass SublimePluginStatus : SoftwareStatus\n\t{\n\t\treadonly object _fuseInstallLock = new object();\n\t\treadonly SublimePlugin _sublimePlugin;\n\n\t\tpublic SublimePluginStatus(IFuse fuse)\n\t\t\t: base(\"Sublime Fuse Plugin\", fuse.Report)\n\t\t{\n\t\t\t_sublimePlugin = new SublimePlugin(fuse.ComponentsDir);\n\t\t}\n\n\t\tprotected override InstallStatus CheckStatus()\n\t\t{\n\t\t\tlock (_fuseInstallLock)\n\t\t\t{\n\t\t\t\treturn _sublimePlugin.Status.AsInstallStatus();\n\t\t\t}\n\t\t}\n\n\t\tprotected override void TryInstall()\n\t\t{\n\t\t\tSetStatus(InstallStatus.Installing);\n\t\t\tlock (_fuseInstallLock)\n\t\t\t{\n\t\t\t\tSetStatus(InstallStatus.Installing); //Set it again, since a pending update might have changed it\n\t\t\t\t_sublimePlugin.Install();\n\t\t\t\tSetStatus(_sublimePlugin.Status.AsInstallStatus());\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Setup/VsCodeAppStatus.cs",
    "content": "﻿using System.Diagnostics;\n\nnamespace Outracks.Fuse.Setup\n{\n\tclass VsCodeAppStatus : SoftwareStatus\n\t{\n\t\tpublic VsCodeAppStatus(IReport report)\n\t\t\t: base(\"Visual Studio Code\", report)\n\t\t{\n\t\t}\n\n\t\tprotected override InstallStatus CheckStatus()\n\t\t{\n\t\t\treturn ApplicationPaths.VsCodePath().HasValue ? InstallStatus.Installed : InstallStatus.NotInstalled;\n\t\t}\n\n\t\tprotected override void TryInstall()\n\t\t{\n\t\t\tProcess.Start(\"https://code.visualstudio.com/\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Setup/VsCodeExtensionStatus.cs",
    "content": "﻿using Outracks.Fuse.Components;\n\nnamespace Outracks.Fuse.Setup\n{\n\tclass VsCodeExtensionStatus : SoftwareStatus\n\t{\n\t\treadonly object _fuseInstallLock = new object();\n\t\treadonly VsCodeExtension _vsCodeExtension;\n\n\t\tpublic VsCodeExtensionStatus(IFuse fuse)\n\t\t\t: base(\"Visual Studio Code Extension\", fuse.Report)\n\t\t{\n\t\t\t_vsCodeExtension = new VsCodeExtension(fuse.ComponentsDir);\n\t\t}\n\n\t\tprotected override InstallStatus CheckStatus()\n\t\t{\n\t\t\tlock (_fuseInstallLock)\n\t\t\t{\n\t\t\t\treturn _vsCodeExtension.Status.AsInstallStatus();\n\t\t\t}\n\t\t}\n\n\t\tprotected override void TryInstall()\n\t\t{\n\t\t\tSetStatus(InstallStatus.Installing);\n\t\t\tlock (_fuseInstallLock)\n\t\t\t{\n\t\t\t\tSetStatus(InstallStatus.Installing); //Set it again, since a pending update might have changed it\n\t\t\t\t_vsCodeExtension.Install();\n\t\t\t\tSetStatus(_vsCodeExtension.Status.AsInstallStatus());\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/SimulatorNotifications.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\nusing Outracks.Simulator.Protocol;\n\nnamespace Outracks.Fuse.Studio\n{\n\tstatic class SimulatorNotifications\n\t{\n\t\tpublic static IControl Create(IObservable<IBinaryMessage> fromSimulator, Command rebuild, IProperty<bool> logViewIsExpanded)\n\t\t{\n\t\t\t// The idea here is that we track the state of the project on disk, based on what the simulator tells us when things causes reify/rebuild/\n\n\t\t\tvar buildStarted = fromSimulator\n\t\t\t\t.TryParse(Started.MessageType, Started.ReadDataFrom)\n\t\t\t\t.Where(m => m.Command.Type == BuildProject.MessageType);\n\n\t\t\tvar buildEnded = fromSimulator\n\t\t\t\t.TryParse(Ended.MessageType, Ended.ReadDataFrom)\n\t\t\t\t.Where(m => m.Command.Type == BuildProject.MessageType);\n\n\t\t\tvar buildFailed = buildEnded.Where(s => s.Success == false);\n\t\t\tvar buildSucceeded = buildEnded.Where(s => s.Success == true);\n\n\t\t\tvar reifyStarted = fromSimulator\n\t\t\t\t.TryParse(Started.MessageType, Started.ReadDataFrom)\n\t\t\t\t.Where(m => m.Command.Type == GenerateBytecode.MessageType);\n\n\t\t\tvar reifyEnded = fromSimulator\n\t\t\t\t.TryParse(Ended.MessageType, Ended.ReadDataFrom)\n\t\t\t\t.Where(m => m.Command.Type == GenerateBytecode.MessageType);\n\n\t\t\tvar reifyFailed = reifyEnded.Where(s => s.Success == false);\n\t\t\tvar reifySucceeded = reifyEnded.Where(s => s.Success == true);\n\n\t\t\tvar buildRequired = fromSimulator\n\t\t\t\t.TryParse(RebuildRequired.MessageType, RebuildRequired.ReadDataFrom);\n\n//\t\t\tvar reifyRequired = fromSimulator\n//\t\t\t\t.TryParse(ReifyRequired.MessageType, ReifyRequired.ReadDataFrom);\n\n\t\t\t// What notifications and buttons should be shown in response to what\n\n\t\t\treturn Observable\n\t\t\t\t.Merge(\n\t\t\t\t\tbuildRequired.Select(_ => Notification.Create(\"Rebuild is required for changes to take effect\", Tuple.Create(\"Rebuild\", rebuild))),\n\t\t\t\t\tbuildFailed.Select(_ => Notification.Create(\"Build failed, see log for details\", Tuple.Create(\"Rebuild\", rebuild)).OnMouse(Command.Enabled(() => logViewIsExpanded.Write(true)))),\n\t\t\t\t\treifyFailed.Select(_ => Notification.Create(\"Auto reload failed, see log for details\").OnMouse(Command.Enabled(() => logViewIsExpanded.Write(true)))),\n\t\t\t\t\tbuildStarted.Select(_ => Control.Empty),\n\t\t\t\t\tbuildSucceeded.Select(_ => Control.Empty),\n\t\t\t\t\treifyStarted.Select(_ => Control.Empty),\n\t\t\t\t\treifySucceeded.Select(_ => Control.Empty))\n\t\t\t\t.StartWith(Control.Empty)\n\t\t\t\t.ObserveOn(Application.MainThread)\n\t\t\t\t.Switch();\n\t\t}\n\n\n\t\tpublic static IControl CreateBusyIndicator(IObservable<IBinaryMessage> fromSimulator)\n\t\t{\n\t\t\tvar buildIndicator = BuildIndicator(\n\t\t\t\tfromSimulator: fromSimulator,\n\t\t\t\tmessageType: BuildProject.MessageType,\n\t\t\t\ttitle: \"Building...\",\n\t\t\t\tforeground: Theme.BuildBarForeground,\n\t\t\t\tbackground: Theme.BuildBarBackground);\n\n\t\t\tvar reifyIndicator = BuildIndicator(\n\t\t\t\tfromSimulator: fromSimulator,\n\t\t\t\tmessageType: GenerateBytecode.MessageType,\n\t\t\t\ttitle: \"Reifying...\",\n\t\t\t\tforeground: Theme.ReifyBarForeground,\n\t\t\t\tbackground: Theme.ReifyBarBackground);\n\n\t\t\treturn Observable\n\t\t\t\t.Merge(\n\t\t\t\t\tbuildIndicator,\n\t\t\t\t\treifyIndicator)\n\t\t\t\t.StartWith(Control.Empty)\n\t\t\t\t.ObserveOn(Application.MainThread)\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tstatic IObservable<IControl> BuildIndicator(\n\t\t\tIObservable<IBinaryMessage> fromSimulator,\n\t\t\tstring messageType,\n\t\t\tstring title,\n\t\t\tIObservable<Color> foreground,\n\t\t\tIObservable<Color> background)\n\t\t{\n\t\t\tvar started = fromSimulator\n\t\t\t\t.TryParse(Started.MessageType, Started.ReadDataFrom)\n\t\t\t\t.Where(m => m.Command.Type == messageType).Select(_ => true);\n\n\t\t\tvar ended = fromSimulator\n\t\t\t\t.TryParse(Ended.MessageType, Ended.ReadDataFrom)\n\t\t\t\t.Where(m => m.Command.Type == messageType).Select(_ => false);\n\n\t\t\t// stream of bool that is true from 250 ms after messageType started and false when messageType ends\n\t\t\tvar indicator =\n\t\t\t\tstarted\n\t\t\t\t\t.Merge(ended)\n\t\t\t\t\t.Throttle(TimeSpan.FromMilliseconds(250))\n\t\t\t\t\t.Merge(ended)\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.Select(\n\t\t\t\t\t\tbuilding => building\n\t\t\t\t\t\t\t? Busy.Create(title, background, foreground)\n\t\t\t\t\t\t\t: Control.Empty);\n\t\t\treturn indicator;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Sketch/SketchLogWrapper.cs",
    "content": "using System;\nusing SketchConverter.API;\n\nnamespace Outracks.Fuse.Studio {\n\tclass SketchLogWrapper : ILogger\n\t{\n\t\treadonly IObserver<string> _logMessages;\n\t\treadonly IReport _log;\n\n\t\tpublic SketchLogWrapper(IObserver<string> logMessages, IReport log)\n\t\t{\n\t\t\t_logMessages = logMessages;\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic void Info(string info)\n\t\t{\n\t\t\t_logMessages.OnNext(info + \"\\n\");\n\t\t}\n\n\t\tpublic void Warning(string warning)\n\t\t{\n\t\t\t_logMessages.OnNext(warning + \"\\n\");\n\t\t}\n\n\t\tpublic void Error(string error)\n\t\t{\n\t\t\t_log.Error(error);\n\t\t\t_logMessages.OnNext(error + \"\\n\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Sketch/SketchWatchExtensions.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Studio {\n\tstatic class SketchWatchExtensions\n\t{\n\t\tpublic static IObservable<AbsoluteFilePath> WhenChangedOrStarted(this IObservable<AbsoluteFilePath> path, IFileSystem fileSystem)\n\t\t{\n\t\t\treturn path\n\t\t\t\t.Select(fileSystem.Watch)\n\t\t\t\t.CatchAndRetry(TimeSpan.FromSeconds(1))\n\t\t\t\t.Switch()\n\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t.CombineLatest(path, (_, p) => p)\n\t\t\t\t.Throttle(TimeSpan.FromSeconds(0.1));\n\t\t}\n\n\t\tpublic static IObservable<IEnumerable<AbsoluteFilePath>> WhenAnyChangedOrStarted(this IObservable<IEnumerable<AbsoluteFilePath>> paths, IFileSystem fileSystem)\n\t\t{\n\t\t\treturn paths\n\t\t\t\t.Select(ps =>\n\t\t\t\t\tps.Select(p =>\n\t\t\t\t\t\t\tfileSystem.Watch(p)\n\t\t\t\t\t\t\t\t.CatchAndRetry(TimeSpan.FromSeconds(1)))\n\t\t\t\t\t\t.Merge())\n\t\t\t\t.Switch()\n\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t.CombineLatest(paths, (_, p) => p)\n\t\t\t\t.Throttle(TimeSpan.FromSeconds(0.1));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Sketch/SketchWatcher.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing Newtonsoft.Json;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing SketchConverter.API;\n\nnamespace Outracks.Fuse.Studio\n{\n\tinternal static class SketchImportUtils\n\t{\n\t\tinternal static readonly string OutputDirName = \"SketchSymbols\";\n\t\tinternal static readonly string SketchFilesExtension = \".sketchFiles\";\n\t\tinternal static readonly string SketchExtention = \".sketch\";\n\n\t\tinternal static IEnumerable<IFilePath> SketchFilePaths(AbsoluteFilePath sketchListFilePath, ILogger logger)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn JsonConvert.DeserializeObject<List<string>>(File.ReadAllText(sketchListFilePath.NativePath))\n\t\t\t\t\t.Select(FilePath.Parse);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlogger.Error(\"Failed to parse list of sketch files from \" + sketchListFilePath + \". Please make sure it contains a valid json list. The error was: \" + e.Message);\n\t\t\t\treturn new List<IFilePath>();\n\t\t\t}\n\t\t}\n\n\t\tinternal static AbsoluteFilePath SketchListFilePath(AbsoluteFilePath projectFilePath)\n\t\t{\n\t\t\tif (!projectFilePath.NativePath.EndsWith(\".unoproj\"))\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(projectFilePath.NativePath + \" does not seem to be a .unoproj\");\n\t\t\t}\n\t\t\tvar regex = new Regex(@\"\\.unoproj$\");\n\t\t\treturn AbsoluteFilePath.Parse(regex.Replace(projectFilePath.NativePath, SketchFilesExtension));\n\t\t}\n\n\t\tinternal static IEnumerable<AbsoluteFilePath> MakeAbsolute(IEnumerable<IFilePath> filePaths, AbsoluteDirectoryPath rootDir)\n\t\t{\n\t\t\treturn filePaths.Select(file => FilePath.ParseAndMakeAbsolute(file, rootDir));\n\t\t}\n\n\t\tinternal static bool IsSketchFile(IFilePath path)\n\t\t{\n\t\t\treturn path.Name.HasExtension(SketchExtention);\n\t\t}\n\n\t\tinternal static bool IsSketchFilesFile(IFilePath path)\n\t\t{\n\t\t\treturn path.Name.HasExtension(SketchFilesExtension);\n\t\t}\n\n\t}\n\tclass SketchWatcher\n\t{\n\t\tpublic IObservable<string> LogMessages { get { return _logMessages; } }\n\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly ILogger _logger;\n\t\treadonly Subject<string> _logMessages = new Subject<string>();\n\t\treadonly IConverter _converter;\n\n\t\tpublic SketchWatcher(IReport log, IFileSystem fileSystem)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_logger = new SketchLogWrapper(_logMessages, log);\n\t\t\t_converter = Factory.CreateConverterWithSymbolsUxBuilder(_logger);\n\n\t\t}\n\n\t\tpublic IDisposable Watch(IProject project)\n\t\t{\n\t\t\tvar queue = new SingleActionQueue();\n\t\t\tvar subscription = project.FilePath\n\t\t\t\t.Select(SketchImportUtils.SketchListFilePath)\n\t\t\t\t.WhenChangedOrStarted(_fileSystem)\n\t\t\t\t.Where(path => File.Exists(path.NativePath))\n\t\t\t\t.Select(SketchFilePaths)\n\t\t\t\t.CombineLatest(project.RootDirectory, SketchImportUtils.MakeAbsolute)\n\t\t\t\t.WhenAnyChangedOrStarted(_fileSystem)\n\t\t\t\t.CombineLatest(project.RootDirectory) // todo redundant as we already combined with the root directory to make paths absolute\n\t\t\t\t.Subscribe(\n\t\t\t\t\tx => queue.Enqueue(() => Convert(x.Item1, x.Item2 / SketchImportUtils.OutputDirName)),\n\t\t\t\t\te => { _logger.Error(\"Sketch importer error: \" + e.Message); });\n\n\t\t\tvar tokenSource = new CancellationTokenSource();\n\t\t\tnew Thread(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\twhile (!tokenSource.Token.IsCancellationRequested)\n\t\t\t\t\t{\n\t\t\t\t\t\tqueue.Dequeue()();\n\t\t\t\t\t}\n\t\t\t\t\t_logger.Info(\"Stopping thread\");\n\t\t\t\t}){Name = \"Sketch conversion\", IsBackground = true}.Start();\n\n\t\t\tAction stopThread = () =>\n\t\t\t{\n\t\t\t\tqueue.Enqueue(() => { tokenSource.Cancel();});\n\t\t\t};\n\n\t\t\t// TODO: This is very messy, should extract dialog to its own class\n\t\t\tCreateDialog(project);\n\n\t\t\treturn Disposable.Combine(\n\t\t\t\tsubscription,\n\t\t\t\tDisposable.Create(stopThread));\n\t\t}\n\n\t\tvoid Convert(IEnumerable<AbsoluteFilePath> files, AbsoluteDirectoryPath outputDir)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tDirectory.CreateDirectory(outputDir.NativePath);\n\t\t\t\t_converter.Convert(files.ToList().Select(f => f.NativePath), outputDir.NativePath);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_logger.Error(\"Sketch importer error: \" + e.Message);\n\t\t\t}\n\t\t}\n\n\n\t\tinternal IEnumerable<IFilePath> SketchFilePaths(AbsoluteFilePath sketchListFilePath)\n\t\t{\n\t\t\treturn SketchImportUtils.SketchFilePaths(sketchListFilePath, _logger);\n\t\t}\n\n\n\n\t\tinternal void WriteSketchFilePaths(AbsoluteFilePath sketchListFilePath, IEnumerable<IFilePath> sketchFiles)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar settings = new JsonSerializerSettings();\n\t\t\t\tsettings.Converters.Add(new PathJsonConverter());\n\t\t\t\tFile.WriteAllText(\n\t\t\t\t\tsketchListFilePath.NativePath,\n\t\t\t\t\tJsonConvert.SerializeObject(sketchFiles, Formatting.Indented, settings));\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\t_logger.Error(\"Failed to write sketch list file: \" + e.Message);\n\t\t\t}\n\t\t}\n\n\t\t// Todo Move UI-stuff to separate file??\n\n\t\tconst int Width = 500;\n\t\tconst int Height = 250;\n\n\t\treadonly ISubject<bool> _isVisible = new BehaviorSubject<bool>(false);\n\n\t\tpublic IControl View(IProject project, IDialog<object> dialog)\n\t\t{\n\t\t\tvar newFile = Property.Create(\"\");\n\t\t\tvar files = new ListBehaviorSubject<IFilePath>();\n\n\t\t\tproject.FilePath.Select(SketchImportUtils.SketchListFilePath)\n\t\t\t\t.Where(path => File.Exists(path.NativePath))\n\t\t\t\t.Select(SketchFilePaths).Do(paths =>\n\t\t\t\t{\n\t\t\t\t\tforeach (var absoluteFilePath in paths)\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles.OnAdd(absoluteFilePath);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.Subscribe();\n\n\t\t\tvar addNewSketchFileCommand =\n\t\t\t\tCommand.Create(newFile\n\t\t\t\t\t.CombineLatest(project.RootDirectory,\n\t\t\t\t\t\t(pathString, rootDir) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!string.IsNullOrWhiteSpace(pathString))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar path = FilePath.Parse(pathString);\n\n\t\t\t\t\t\t\t\tif (_fileSystem.Exists((path as IAbsolutePath) ?? rootDir.Combine((RelativeFilePath)path)))\n\t\t\t\t\t\t\t\t\treturn Optional.Some(path);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn Optional.None();\n\t\t\t\t\t\t})\n\t\t\t\t\t.WherePerElement(path => SketchImportUtils.IsSketchFile(path) && !files.Value.Contains(path))\n\t\t\t\t\t.SelectPerElement(\n\t\t\t\t\t\tpath => (Action)(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_logger.Info(\"Adding sketch file to watch: \" + path);\n\t\t\t\t\t\t\tfiles.OnAdd(path);\n\t\t\t\t\t\t\tnewFile.Write(\"\");\n\t\t\t\t\t\t})));\n\n\t\t\tvar content = Layout.Dock()\n\t\t\t\t.Top(\n\t\t\t\t\tLayout.StackFromLeft(\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\"Add sketch files to import symbols from\",\n\t\t\t\t\t\t\t\tfont: Theme.DefaultFont,\n\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Left,\n\t\t\t\t\t\t\t\tcolor: Theme.DescriptorText))\n\t\t\t\t\t\t.CenterHorizontally())\n\t\t\t\t.Top(Spacer.Medium)\n\t\t\t\t.Bottom(\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Right(\n\t\t\t\t\t\t\tAddButton(addNewSketchFileCommand)\n\t\t\t\t\t\t\t\t.SetToolTip(\"Import sketch symbols from this file\")\n\t\t\t\t\t\t\t\t.Center())\n\t\t\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\tFilePathControl.Create(\n\t\t\t\t\t\t\t\t\tnewFile,\n\t\t\t\t\t\t\t\t\tproject.RootDirectory,\n\t\t\t\t\t\t\t\t\tnew[] { new FileFilter(\"Sketch files\", SketchImportUtils.SketchExtention) },\n\t\t\t\t\t\t\t\t\t\"Add sketch file\",\n\t\t\t\t\t\t\t\t\t\"Enter path of new sketch file to add here, or click browse button\",\n\t\t\t\t\t\t\t\t\t\"Open\")))\n\t\t\t\t.Fill(\n\t\t\t\t\tfiles\n\t\t\t\t\t\t.ToObservableImmutableList()\n\t\t\t\t\t\t.SelectPerElement(\n\t\t\t\t\t\t\tfilePath =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar highlightSketchFileControl = new BehaviorSubject<bool>(false);\n\t\t\t\t\t\t\t\tvar fileExists = project.RootDirectory.Select(\n\t\t\t\t\t\t\t\t\troot => File.Exists(FilePath.ParseAndMakeAbsolute(filePath, root).NativePath));\n\n\t\t\t\t\t\t\t\treturn highlightSketchFileControl\n\t\t\t\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t\t\t\t.CombineLatest(fileExists,\n\t\t\t\t\t\t\t\t\t\t(highlight, exists)  =>\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\treturn Layout.Dock()\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Bottom(Spacer.Smaller)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Right(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRemoveButton(Command.Enabled(() => { files.OnRemove(files.Value.IndexOf(filePath)); }))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.SetToolTip(\"Remove sketch file from watch list\"))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Right(Spacer.Small)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.Fill(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tObservable.Return(filePath.ToString()).AsText(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor: exists ? Theme.DefaultText : Theme.ErrorColor,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfont: Theme.DefaultFont)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.CenterVertically()).SetToolTip(exists ? default(Text) : \"Can't find file \" + filePath)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.OnMouse(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tentered: Command.Enabled(() => { highlightSketchFileControl.OnNext(true); }),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\texited: Command.Enabled(() => highlightSketchFileControl.OnNext(false)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithPadding(new Points(2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithBackground(highlight ? Theme.FaintBackground : Theme.PanelBackground);\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.Switch();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t.StackFromTop()\n\t\t\t\t\t\t.MakeScrollable());\n\n\t\t\treturn\n\t\t\t\tConfirmCancelControl.Create(\n\t\t\t\t\tclose: Command.Enabled(() => { _isVisible.OnNext(false); }),\n\t\t\t\t\tconfirm: Command.Enabled(\n\t\t\t\t\t\t() => { project.FilePath.Select(SketchImportUtils.SketchListFilePath).Do(path => { WriteSketchFilePaths(path, files.Value); }).Subscribe(); }),\n\t\t\t\t\tfill: content.WithMediumPadding(), cancel: null, confirmText: null, cancelText: null, confirmTooltip: null)\n\t\t\t\t\t.WithMacWindowStyleCompensation() // order of window style compensation and with background is important\n\t\t\t\t\t.WithBackground(Theme.WorkspaceBackground);\n\t\t}\n\n\t\tpublic void CreateDialog(IProject project)\n\t\t{\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\t_isVisible,\n\t\t\t\tdialog => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Observable.Return(\"Sketch import\"),\n\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(Width, Height)))),\n\t\t\t\t\tContent = View(project, dialog), // todo why does the content use the title space??\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\tBorder = Separator.MediumStroke,\n\t\t\t\t\tStyle = WindowStyle.Fat,\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IControl RemoveButton(Command command)\n\t\t{\n\t\t\tvar stroke = IconStroke(command.IsEnabled);\n\n\t\t\treturn Button.Create(command, state =>\n\t\t\t\tShapes.Line(\n\t\t\t\t\t\tnew Point<Points>(0, IconWidth / 2),\n\t\t\t\t\t\tnew Point<Points>(IconWidth, IconWidth / 2),\n\t\t\t\t\t\tstroke: stroke)\n\t\t\t\t\t.WithWidth(IconWidth)\n\t\t\t\t\t.WithHeight(IconWidth));\n\t\t}\n\n\t\tpublic static IControl AddButton(Command command)\n\t\t{\n\t\t\tvar stroke = IconStroke(command.IsEnabled);\n\n\t\t\treturn Button.Create(command, state =>\n\t\t\t\tLayout.Layer(\n\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\tnew Point<Points>(IconWidth / 2, 0),\n\t\t\t\t\t\t\tnew Point<Points>(IconWidth / 2, IconWidth),\n\t\t\t\t\t\t\tstroke: stroke),\n\t\t\t\t\t\tShapes.Line(\n\t\t\t\t\t\t\tnew Point<Points>(0, IconWidth / 2),\n\t\t\t\t\t\t\tnew Point<Points>(IconWidth, IconWidth / 2),\n\t\t\t\t\t\t\tstroke: stroke))\n\t\t\t\t\t.WithWidth(IconWidth)\n\t\t\t\t\t.WithHeight(IconWidth));\n\t\t}\n\n\t\tstatic readonly Points IconWidth = 15.0;\n\n\t\tstatic Stroke IconStroke(IObservable<bool> isEnabled)\n\t\t{\n\t\t\treturn Stroke.Create(\n\t\t\t\tthickness: 2,\n\t\t\t\tbrush: isEnabled.Select(c => c\n\t\t\t\t\t? Theme.Active\n\t\t\t\t\t: Separator.WeakStroke.Brush).Switch());\n\t\t}\n\n\n\t\tpublic Action ShowDialog()\n\t\t{\n\t\t\treturn () =>\n\t\t\t{\n\t\t\t\t_isVisible.OnNext(true);\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Templates/DirectoryToNamespace.cs",
    "content": "using System.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic static class DirectoryToNamespace\n\t{\n\t\tpublic static Optional<NamespaceName> ToNamespace(this RelativeDirectoryPath directoryPath, Optional<NamespaceName> rootNamespace)\n\t\t{\n\t\t\tif (directoryPath == null)\n\t\t\t\treturn rootNamespace;\n\n\t\t\tvar relativeNamespace = new NamespaceName(\n\t\t\t\tdirectoryPath.Parts\n\t\t\t\t\t.Select(p => p.ToString()\n\t\t\t\t\t\t.Replace(\".\", \"_\")\n\t\t\t\t\t\t.Replace(\" \", \"_\")).Join(\".\"));\n\n\t\t\treturn rootNamespace.MatchWith(\n\t\t\t\tsome: root => new NamespaceName(root.FullName + (root.FullName == \"\" ? \"\" : \".\") + relativeNamespace.FullName),\n\t\t\t\tnone: () => relativeNamespace);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Templates/FileAlreadyExist.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class FileAlreadyExist : Exception\n\t{\n\t\tpublic FileAlreadyExist(string message) : base(message)\n\t\t{ }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Templates/ITemplateVariableResolver.cs",
    "content": "namespace Outracks.Fuse.Templates\n{\n\tpublic interface ITemplateVariableResolver\n\t{\n\t\tstring ResolveVariable(string name);\n\t    bool HasVariable(string name);\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Templates/NamespaceName.cs",
    "content": "using System;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic sealed class NamespaceName : IEquatable<NamespaceName>\n\t{\n\t\tpublic readonly string FullName;\n\t\tpublic NamespaceName(string fullName)\n\t\t{\n\t\t\tFullName = fullName;\n\t\t}\n\n\t\tpublic bool Equals(NamespaceName other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn string.Equals(FullName, other.FullName);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is NamespaceName && Equals((NamespaceName)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (FullName != null ? FullName.GetHashCode() : 0);\n\t\t}\n\n\t\tpublic static bool operator ==(NamespaceName left, NamespaceName right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(NamespaceName left, NamespaceName right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Templates/ProjectFolderNotEmpty.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class ProjectFolderNotEmpty : Exception\n\t{\n\t\tpublic ProjectFolderNotEmpty(string path)\n\t\t\t: base(\"Destination folder is not empty: \" + path)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Templates/SpawnTemplate.cs",
    "content": "using System.Linq;\nusing Outracks.IO;\nusing Uno.ProjectFormat;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class SpawnTemplate\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\n\t\tpublic SpawnTemplate(IFileSystem fileSystem)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t}\n\n\t\tpublic AbsoluteDirectoryPath CreateProject(string name, Template template, AbsoluteDirectoryPath location)\n\t\t{\n\t\t\tvar projectDir = location / name;\n\n\t\t\tif (_fileSystem.Exists(projectDir) &&\n\t\t\t\t(_fileSystem.GetFiles(projectDir).Any() || _fileSystem.GetDirectories(projectDir).Any()))\n\t\t\t\tthrow new ProjectFolderNotEmpty(projectDir.NativePath);\n\n\t\t\tvar environment = new TemplateVariableResolver().With(\"filename\", name);\n\n\t\t\tTemplateSpawner.SpawnTemplate(template, projectDir, environment, _fileSystem);\n\n\t\t\treturn projectDir;\n\t\t}\n\n\t\tpublic Optional<AbsoluteFilePath> CreateFile(string name, Template template, AbsoluteDirectoryPath location)\n\t\t{\n\t\t\tvar fileName = location / new FileName(name);\n\t\t\tvar fileNameWithExt = template.FileExt.MatchWith(fileName.AddExtension, () => fileName);\n\n\t\t\tvar project = FindAndLoadProjectInDirectory(location);\n\n\t\t\tvar nss = new NamespaceName(project.GetString(\"RootNamespace\") ?? \"\");\n\n\t\t\tvar rootDir = location.ContainingDirectory;\n\t\t\tvar relativeDir = location.RelativeTo(rootDir);\n\t\t\tvar ns = relativeDir.ToNamespace(nss).Or(new NamespaceName(\"\"));\n\n\t\t\tvar fullTypeName = ns.FullName == \"\" ? fileName.Name.ToString() : ns.FullName + \".\" + fileName.Name;\n\n\t\t\tvar environment = new TemplateVariableResolver()\n\t\t\t\t.With(\"filename\", fileNameWithExt.Name.ToString())\n\t\t\t\t.With(\"typename\", fileName.Name.ToString())\n\t\t\t\t.With(\"fulltypename\", fullTypeName)\n\t\t\t\t.With(ns.FullName == \"\" ? \"exclude_namespace\" : \"include_namespace\", \"\") //we just check the existence of the key so no value is needed\n\t\t\t\t.With(\"namespace\", ns.FullName);\n\n\t\t\tvar result = TemplateSpawner.SpawnTemplate(template, location, environment, _fileSystem);\n\n\t\t\treturn result.SpawnedProjectFiles.FirstOrNone();\n\t\t}\n\n\t\tProject FindAndLoadProjectInDirectory(AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\tif(directory.ContainingDirectory == null)\n\t\t\t\tthrow new ProjectNotFound();\n\n\t\t\tvar projectPath = _fileSystem.GetFiles(directory).FirstOrDefault(f => f.Name.HasExtension(\"unoproj\"));\n\t\t\tif (projectPath == null)\n\t\t\t\treturn FindAndLoadProjectInDirectory(directory.ContainingDirectory);\n\n\t\t\tvar unoProj = Project.Load(projectPath.NativePath);\n\t\t\tunoProj.AddDefaults();\n\t\t\treturn unoProj;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Templates/Template.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class Template\n\t{\n\t\tpublic string Name;\n\t\tpublic string Description;\n\t\tpublic Optional<string> FileExt;\n\t\tpublic Optional<string> Alias;\n\t\tpublic Optional<AbsoluteFilePath> IconFile;\n\t\tpublic int Priority;\n\t\tpublic AbsoluteDirectoryPath BasePath;\n\t\tpublic readonly List<TemplateFile> TemplateFiles = new List<TemplateFile>();\n\n\t\tpublic AbsoluteFilePath ManifestFile\n\t\t{\n\t\t\tget { return BasePath / new FileName(\"manifest.xml\"); }\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> BannedFiles\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tyield return ManifestFile;\n\t\t\t\tif (IconFile.HasValue)\n\t\t\t\t\tyield return IconFile.Value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Name;\n\t\t}\n\n\t\tpublic Template Filter(bool git, bool typescript, bool vscode)\n\t\t{\n\t\t\tvar result = new Template {\n\t\t\t\tName = Name,\n\t\t\t\tDescription = Description,\n\t\t\t\tFileExt = FileExt,\n\t\t\t\tAlias = Alias,\n\t\t\t\tIconFile = IconFile,\n\t\t\t\tPriority = Priority,\n\t\t\t\tBasePath = BasePath,\n\t\t\t};\n\t\t\t\n\t\t\tforeach (var file in TemplateFiles)\n\t\t\t{\n\t\t\t\tvar name = file.Path.ToString();\n\n\t\t\t\tif (!git && (\n\t\t\t\t\t\tname == \".gitattributes\" ||\n\t\t\t\t\t\tname == \".gitignore\"\n\t\t\t\t\t) ||\n\t\t\t\t\t!typescript && (\n\t\t\t\t\t\tname == \"package.json\" ||\n\t\t\t\t\t\tname == \"tsconfig.json\"\n\t\t\t\t\t) ||\n\t\t\t\t\t!vscode && name.StartsWith(\".vscode/\"))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tresult.TemplateFiles.Add(file);\n\t\t\t}\n\t\t\t\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Templates/TemplateLoader.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class TemplateFile\n\t{\n\t\tpublic RelativeFilePath Path;\n\t}\n\n\tpublic class TemplateLoader\n\t{\n\t\tpublic static IEnumerable<Template> LoadTemplatesFrom(AbsoluteDirectoryPath baseDirectory, IFileSystem fileSystem)\n\t\t{\n\t\t\tforeach (var dir in fileSystem.GetDirectories(baseDirectory))\n\t\t\t{\n\t\t\t\tyield return LoadTemplateFrom(dir, fileSystem);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Template LoadTemplateFrom(AbsoluteDirectoryPath baseDir, IFileSystem fileSystem)\n\t\t{\n\t\t\treturn new TemplateLoader(baseDir, fileSystem).Load();\n\t\t}\n\n\t\treadonly Template _template;\n\t\treadonly IFileSystem _fileSystem;\n\n\t\tTemplateLoader(AbsoluteDirectoryPath baseDir, IFileSystem fileSystem)\n\t\t{\n\t\t\t_template = new Template() { BasePath = baseDir };\n\t\t\t_fileSystem = fileSystem;\n\t\t}\n\n\t\tTemplate Load()\n\t\t{\n\t\t\tApplyManifest(LoadManifest());\n\t\t\tLoadTemplateFiles(_template.BasePath);\n\t\t\treturn _template;\n\t\t}\n\n\t\tTemplateManifest LoadManifest()\n\t\t{\n\t\t\tusing (var fileRead = _fileSystem.OpenRead(_template.ManifestFile))\n\t\t\t\treturn TemplateManifestParser.Parse(fileRead);\n\t\t}\n\n\t\tvoid ApplyManifest(TemplateManifest manifest)\n\t\t{\n\t\t\t_template.Name = manifest.Name;\n\t\t\t_template.Description = manifest.Description;\n\t\t\t_template.IconFile = manifest.Icon != null ? Optional.Some(_template.ManifestFile.ContainingDirectory / new FileName(manifest.Icon)) : Optional.None();\n\t\t\t_template.Priority = manifest.Priority != null ? int.Parse (manifest.Priority) : 0;\n\t\t\t_template.FileExt = manifest.FileExt != null ? Optional.Some(manifest.FileExt) : Optional.None();\n\t\t\t_template.Alias = manifest.Alias != null ? Optional.Some(manifest.Alias) : Optional.None();\n\t\t}\n\n\t\tvoid LoadTemplateFiles(AbsoluteDirectoryPath directoryPath)\n\t\t{\n\t\t\tvar files = _fileSystem.GetFiles(directoryPath);\n\t\t\tforeach (var file in files)\n\t\t\t\tAddTemplateFile(file);\n\n\t\t\tvar directories = _fileSystem.GetDirectories(directoryPath);\n\t\t\tforeach (var dir in directories)\n\t\t\t\tLoadTemplateFiles(dir);\n\t\t}\n\n\t\tvoid AddTemplateFile(AbsoluteFilePath fileName)\n\t\t{\n\t\t\tif (_template.BannedFiles.Contains(fileName)) return;\n\n\t\t\tvar templateFile = new TemplateFile()\n\t\t\t{\n\t\t\t\tPath = fileName.RelativeTo(_template.BasePath)\n\t\t\t};\n\n\t\t\t_template.TemplateFiles.Add(templateFile);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Templates/TemplateManifestParser.cs",
    "content": "﻿using System.IO;\nusing System.Xml.Serialization;\n\nnamespace Outracks.Fuse.Templates\n{\n\t[XmlRoot(\"TemplateManifest\")]\n\tpublic class TemplateManifest\n\t{\n\t\t[XmlAttribute(\"Name\")] public string Name;\n\n\t\t[XmlElement(\"Description\")] public string Description;\n\n\t\t[XmlElement(\"Icon\")] public string Icon;\n\n\t\t[XmlAttribute(\"Priority\")] public string Priority;\n\n\t\t[XmlElement(\"FileExt\")] public string FileExt;\n\n\t\t[XmlElement(\"Alias\")] public string Alias;\n\n\t\tpublic static TemplateManifest Deserialize(Stream stream)\n\t\t{\n\t\t\tvar ret = (TemplateManifest)Serializer.Deserialize(stream);\n\t\t\treturn ret;\n\t\t}\n\n\t\tstatic XmlSerializer _serializer;\n\n\t\tstatic XmlSerializer Serializer\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _serializer ?? (_serializer = new XmlSerializer(typeof (TemplateManifest)));\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static class TemplateManifestParser\n\t{\n\t\tpublic static TemplateManifest Parse(Stream stream)\n\t\t{\n\t\t\treturn TemplateManifest.Deserialize(stream);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Templates/TemplateParseError.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class TemplateParseError : Exception\n\t{\n\t\tpublic readonly TextPosition Position;\n\n\t\tpublic TemplateParseError(string message, TextPosition position)\n\t\t\t: base(\"Failed to parse template: \" + message)\n\t\t{\n\t\t\tPosition = position;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Templates/TemplateParser.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class TemplateParser\n    {\n\t    readonly ITemplateVariableResolver _variableResolver;\n\n\t    const string StartRegion = \"_$$\";\n        const string EndRegion = \"$$_\";\n\n\t\tconst string StartTag = \"_$\";\n\t\tconst string EndTag = \"$_\";\n\n\t    public TemplateParser(ITemplateVariableResolver variableResolver)\n\t    {\n\t\t    _variableResolver = variableResolver;\n\t    }\n\n\t\t/// <exception cref=\"TemplateParseError\" />\n\t\tpublic string ReplaceVariables(string template)\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tforeach (var token in Parse(template))\n\t\t\t{\n\t\t\t\tsb.Append(token.MatchWith(\n\t\t\t\t\tvariable => _variableResolver.ResolveVariable(variable.Name),\n\t\t\t\t\ttext => text.Text));\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t    }\n\n\t    public string PreprocessIncludeRegions(string template)\n\t    {\n            //normalize line endings\n            template = template.Split(\"\\r\").Join(\"\\n\").Split(\"\\n\\n\").Join(\"\\n\");\n\n\t\t    var lines = template.Split(\"\\n\");\n\t\t    var source = \"\";\n\t\t    var level = 0;\n\t\t    foreach (var l in lines)\n\t\t    {\n\t\t\t    if (l.IndexOf(StartRegion, StringComparison.Ordinal) > -1)\n\t\t\t    {\n\t\t\t\t    var name = l.Substring(StartRegion.Length);\n\t\t\t\t    if (!_variableResolver.HasVariable(name))\n\t\t\t\t\t    level++;\n\t\t\t    }\n\t\t\t    else if (l.IndexOf(EndRegion, StringComparison.Ordinal) > -1)\n\t\t\t    {\n\t\t\t\t    if (level > 0)\n\t\t\t\t\t    level--;\n\t\t\t    }\n\t\t\t    else\n\t\t\t    {\n\t\t\t        if (level > 0)\n\t\t\t        {\n\t\t\t            continue;\n\t\t\t        }\n\t\t\t        source += l + \"\\n\";\n\t\t\t    }\n\t\t    }\n\t        return source;\n\t    }\n\n\t\tstatic IEnumerable<TemplateToken> Parse(string text)\n\t\t{\n\t\t\tvar scanner = new TextScanner(text);\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\t// Find the next start tag\n\t\t\t\tvar endOfLastToken = scanner.Position;\n\t\t\t\tvar startTag = scanner.ScanTo(StartTag);\n\t\t\t\tif (!startTag.HasValue)\n\t\t\t\t{\n\t\t\t\t\t// No more start tags found, emit remaining text token\n\t\t\t\t\tyield return new TemplateText(text, endOfLastToken, scanner.End);\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\n\t\t\t\t// Otherwise emit text between end of last token and the start tag\n\t\t\t\tyield return new TemplateText(text, endOfLastToken, startTag.Value);\n\n\t\t\t\t// Find the next end tag\n\t\t\t\tvar afterStartTag = scanner.Position;\n\t\t\t\tvar endTag = scanner.ScanTo(EndTag);\n\t\t\t\tif (!endTag.HasValue)\n\t\t\t\t\tthrow new TemplateParseError(\"Couldn't find closing '\" + EndTag + \"'\", startTag.Value.ToPosition(text));\n\n\t\t\t\t// emit the text between the start and end tag\n\t\t\t\tyield return new TemplateVariable(text.Substring(afterStartTag, endTag.Value - afterStartTag));\n\t\t\t}\n\t\t}\n    }\n\n\n}\n"
  },
  {
    "path": "src/fuse/studio/Templates/TemplateSpawner.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class SpawnedTemplate\n\t{\n\t\tpublic SpawnedTemplate(IEnumerable<AbsoluteFilePath> spawnedProjectFiles)\n\t\t{\n\t\t\tSpawnedProjectFiles = spawnedProjectFiles.ToArray();\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> SpawnedProjectFiles { get; private set; }\n\t}\n\n\tpublic class TemplateSpawner\n\t{\n\t\tpublic static SpawnedTemplate SpawnTemplate(Template template, AbsoluteDirectoryPath whereToSpawnTemplate, ITemplateVariableResolver variableResolver, IFileSystem fileSystem)\n\t\t{\n\t\t\tvar spawner = new TemplateSpawner(variableResolver, fileSystem);\n\t\t\treturn new SpawnedTemplate(spawner.Spawn(template, whereToSpawnTemplate));\n\t\t}\n\n\t\treadonly ITemplateVariableResolver _templateVariableResolver;\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly TemplateParser _templateParser;\n\n\t\tpublic TemplateSpawner(ITemplateVariableResolver templateVariableResolver, IFileSystem fileSystem)\n\t\t{\n\t\t\t_templateVariableResolver = templateVariableResolver;\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_templateParser = new TemplateParser(_templateVariableResolver);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> Spawn(Template template, AbsoluteDirectoryPath containingDir)\n\t\t{\n\t\t\t_fileSystem.CreateIfNotExists(containingDir);\n\n\t\t\treturn CopyTemplateFiles(template, _templateVariableResolver.ResolveVariable(\"filename\"), containingDir);\n\t\t}\n\n\t\tIEnumerable<AbsoluteFilePath> CopyTemplateFiles(Template template, string name, AbsoluteDirectoryPath containingDir)\n\t\t{\n\t\t\tforeach (var file in template.TemplateFiles)\n\t\t\t{\n\t\t\t\t// TODO: Make logic for undoing a template spawning if exceptions occurred during the process.\n\t\t\t\tvar newPath = RelativeFilePath.Parse(file.Path.NativeRelativePath.Replace(\"_filename_\", name));\n\t\t\t\tvar destinationFile = containingDir / newPath;\n\t\t\t\tvar sourceFile = template.BasePath / file.Path;\n\n\t\t\t\t_fileSystem.CreateIfNotExists(destinationFile.ContainingDirectory);\n\n\t\t\t\tif (_fileSystem.Exists(destinationFile))\n\t\t\t\t\tthrow new FileAlreadyExist(\"File {0} already exists.\".FormatWith(destinationFile.NativePath));\n\n\t\t\t\tif (ShouldReplaceVariables(destinationFile))\n\t\t\t\t\tCopyAndReplaceVariables(sourceFile, destinationFile);\n\t\t\t\telse\n\t\t\t\t\t_fileSystem.Copy(sourceFile, destinationFile);\n\n\t\t\t\tyield return destinationFile;\n\t\t\t}\n\t\t}\n\n\t\tvoid CopyAndReplaceVariables(AbsoluteFilePath src, AbsoluteFilePath dst)\n\t\t{\n\t\t\tusing (var backup = _fileSystem.BackupAndDeleteFile(dst))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar templateDocument = _fileSystem.ReadAllText(src, 5);\n\t\t\t\t    var newDocument = _templateParser.PreprocessIncludeRegions(templateDocument);\n                    newDocument = _templateParser.ReplaceVariables(newDocument);\n\t\t\t\t\t_fileSystem.WriteNewText(dst, newDocument);\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\tbackup.Restore();\n\t\t\t\t\tthrow;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool ShouldReplaceVariables(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn file.Name.HasExtension(\".ux\")\n\t\t\t\t|| file.Name.HasExtension(\".uno\")\n\t\t\t\t|| file.Name.HasExtension(\".unoproj\")\n\t\t\t\t|| file.Name.HasExtension(\".js\")\n\t\t\t\t|| file.Name.HasExtension(\".json\")\n\t\t\t\t|| file.Name.HasExtension(\".ts\");\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/fuse/studio/Templates/TemplateToken.cs",
    "content": "namespace Outracks.Fuse.Templates\n{\n\tabstract class TemplateToken : IMatchTypes<TemplateVariable, TemplateText>\n\t{\n\t}\n\n\tsealed class TemplateVariable : TemplateToken\n\t{\n\t\tpublic readonly string Name;\n\n\t\tpublic TemplateVariable(string name)\n\t\t{\n\t\t\tName = name;\n\t\t}\n\t}\n\n\tsealed class TemplateText : TemplateToken\n\t{\n\t\treadonly string _originalText;\n\t\treadonly TextOffset _offset;\n\t\treadonly int _length;\n\n\t\tpublic string Text\n\t\t{\n\t\t\tget { return _originalText.Substring(_offset, _length); }\n\t\t}\n\n\t\tpublic TemplateText(string originalText, TextOffset startOffset, TextOffset endOffset)\n\t\t{\n\t\t\t_originalText = originalText;\n\t\t\t_offset = startOffset;\n\t\t\t_length = endOffset - startOffset;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Templates/TemplateVariableResolver.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fuse.Templates\n{\n\tpublic class TemplateVariableResolver : ITemplateVariableResolver\n\t{\n\t\treadonly ITemplateVariableResolver _parentScope;\n\t\treadonly string _key;\n\t\treadonly string _value;\n\n\t\tpublic TemplateVariableResolver(ITemplateVariableResolver parentScope = null, string key = null, string value = null)\n\t\t{\n\t\t\t_parentScope = parentScope;\n\t\t\t_key = key;\n\t\t\t_value = value;\n\t\t}\n\n\t    public bool HasVariable(string name)\n\t    {\n\t        if (name == _key) return true;\n            return _parentScope!=null && _parentScope.HasVariable(name);\n\t    }\n\n\t\tpublic string ResolveVariable(string name)\n\t\t{\n\t\t\tname.ThrowIfNull(\"name\");\n\n\t\t\tif (name == _key)\n\t\t\t\treturn _value;\n\n\t\t\tif (_parentScope != null)\n\t\t\t\treturn _parentScope.ResolveVariable(name);\n\n\t\t\tthrow new ArgumentException(\"Invalid environment variable\", \"name\");\n\t\t}\n\t}\n\n\tpublic static class TemplateVariableResolverExtensions\n\t{\n\t\tpublic static ITemplateVariableResolver With(this ITemplateVariableResolver self, string key, string value)\n\t\t{\n\t\t\treturn new TemplateVariableResolver(self, key, value);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Testing/ConsoleOutputWindow.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Text;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Testing\n{\n\tpublic static class ConsoleOutputWindow\n\t{\n\t\tstatic readonly object _initLock = new object();\n\t\tstatic IObservable<string> _toLogView;\n\n\t\tpublic static void Create()\n\t\t{\n\t\t\tvar clear = new Subject<Unit>();\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tObservable.Return(true),\n\t\t\t\tdialog => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Observable.Return(\"Console output\"),\n\t\t\t\t\tSize = Property.Create<Optional<Size<Points>>>(new Size<Points>(600, 600)).ToOptional(),\n\t\t\t\t\tContent = LogView.Create(InitializeConsoleRedirection(), color: Theme.DefaultText, linkColor: Theme.Link, clear: clear, darkTheme: Theme.IsDark)\n\t\t\t\t\t\t\t\t.WithBackground(Theme.PanelBackground)\n\t\t\t\t\t\t\t\t.WithOverlay(ThemedButton.Create(Command.Enabled(() => clear.OnNext(Unit.Default)), \"Clear\").DockTopRight()),\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\tBorder = Separator.MediumStroke\n\t\t\t\t});\n\t\t}\n\n\t\tconst int MaxBufferLength = 10000;\n\n\t\tclass ObservableTextWriterWrapper : TextWriter, IObservable<string>\n\t\t{\n\t\t\treadonly TextWriter _original;\n\t\t\treadonly Subject<string> _subject = new Subject<string>();\n\n\t\t\tpublic ObservableTextWriterWrapper(TextWriter original)\n\t\t\t{\n\t\t\t\t_original = original;\n\t\t\t}\n\n\t\t\tpublic override Encoding Encoding\n\t\t\t{\n\t\t\t\tget { return _original.Encoding; }\n\t\t\t}\n\n\t\t\tpublic override void Write(char value)\n\t\t\t{\n\t\t\t\t_original.Write(value);\n\t\t\t\tlock (_subject)\n\t\t\t\t{\n\t\t\t\t\tif (_subject.HasObservers)\n\t\t\t\t\t\t_subject.OnNext(value.ToString());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic override void Write(char[] buffer, int index, int count)\n\t\t\t{\n\t\t\t\t_original.Write(buffer, index, count);\n\t\t\t\tlock (_subject)\n\t\t\t\t{\n\t\t\t\t\tif (_subject.HasObservers)\n\t\t\t\t\t\t_subject.OnNext(new string(buffer, index, count));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic IDisposable Subscribe(IObserver<string> observer)\n\t\t\t{\n\t\t\t\tlock (_subject)\n\t\t\t\t\treturn _subject.Subscribe(observer);\n\t\t\t}\n\t\t}\n\n\t\tpublic static IObservable<string> InitializeConsoleRedirection()\n\t\t{\n\t\t\tlock (_initLock)\n\t\t\t{\n\t\t\t\tif (_toLogView == null)\n\t\t\t\t{\n\t\t\t\t\tvar @out = new ObservableTextWriterWrapper(Console.Out);\n\t\t\t\t\tvar error = new ObservableTextWriterWrapper(Console.Error);\n\n\t\t\t\t\tvar connectableObservable =\n\t\t\t\t\t\t@out.Merge(error)\n\t\t\t\t\t\t\t// This may seem odd, but we want to buffer the log through the threadpool to avoid deadlocks\n\t\t\t\t\t\t\t.ObserveOn(ThreadPoolScheduler.Instance)\n\t\t\t\t\t\t\t// _then_ dispatch it on the main thread\n\t\t\t\t\t\t\t.ObserveOn(Application.MainThread)\n\t\t\t\t\t\t\t.Replay(MaxBufferLength);\n\n\t\t\t\t\tconnectableObservable.Connect();\n\n\t\t\t\t\tConsole.SetOut(@out);\n\t\t\t\t\tConsole.SetError(error);\n\t\t\t\t\t_toLogView = connectableObservable;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn _toLogView;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Testing/Debug.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Testing;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic class Debug\n\t{\n\t\tconst int EnableDebugMenuClickCount = 10;\n\n\t\treadonly IProject _project;\n\t\treadonly IProperty<Optional<bool>> _alwaysShowDebugMenuSetting;\n\n\t\tinternal Debug(IProject project)\n\t\t{\n\t\t\t_project = project;\n\t\t\t_alwaysShowDebugMenuSetting = UserSettings.Bool(\"AlwaysShowDebugMenu\");\n\t\t}\n\n\t\tpublic Menu Menu\n\t\t{\n\t\t\tget\n\t\t\t{\n#if DEBUG\n\t\t\t\treturn Menu.Submenu(\"Debug\", Create());\n#else\n\t\t\t\treturn Menu.Submenu(\"Debug\", Create()).ShowWhen(_alwaysShowDebugMenuSetting.Select(x => x.Or(false)));\n#endif\n\t\t\t}\n\t\t}\n\n\t\tpublic Command EnableDebugMenuByRapidClicking\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tList<DateTime> enableDebugMenuClicks = new List<DateTime>(EnableDebugMenuClickCount);\n\n\t\t\t\treturn\n\t\t\t\t\t_alwaysShowDebugMenuSetting\n\t\t\t\t\t\t.Select(configValue =>\n\t\t\t\t\t\t\tCommand.Enabled(() => _alwaysShowDebugMenuSetting.Write(!configValue.Or(false), save: true)))\n\t\t\t\t\t\t.Select(c =>\n\t\t\t\t\t\t\tCommand.Enabled(\n\t\t\t\t\t\t\t\tc.Execute.Select(\n\t\t\t\t\t\t\t\t\tsetAction => (Action) (() =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar now = DateTime.UtcNow;\n\t\t\t\t\t\t\t\t\t\tenableDebugMenuClicks.RemoveAll(x => x < now.AddSeconds(-4));\n\t\t\t\t\t\t\t\t\t\tenableDebugMenuClicks.Add(now);\n\t\t\t\t\t\t\t\t\t\tif (enableDebugMenuClicks.Count > 10)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tenableDebugMenuClicks.Clear();\n\t\t\t\t\t\t\t\t\t\t\tsetAction();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))))\n\t\t\t\t\t\t.Switch();\n\t\t\t}\n\t\t}\n\n\t\tMenu Create()\n\t\t{\n\t\t\tvar createDebugWindow = new Action(() =>\n\t\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\t\tObservable.Return(true),\n\t\t\t\t\tdialog =>\n\t\t\t\t\t\tnew Window()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTitle = Observable.Return(\"Debug\"),\n\t\t\t\t\t\t\tSize = Property.Create<Optional<Size<Points>>>(new Size<Points>(600, 500)).ToOptional(),\n\t\t\t\t\t\t\tContent = Control.Lazy(Debugging.CreateDebugControl),\n\t\t\t\t\t\t}\n\t\t\t\t));\n\n\t\t\treturn\n\t\t\t\t  Menu.Item(\"Open Debug Window\", action: createDebugWindow)\n\t\t\t\t+ Menu.Item(\"Random ux mutator\", action: () => RandomMutatorWindow.Create(_project))\n\t\t\t\t+ Menu.Item(\"Console output\", action: ConsoleOutputWindow.Create)\n\t\t\t\t+ Menu.Item(\"Icon viewer\", action: IconPreviewWindow.Create);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Testing/IconPreviewWindow.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Text;\nusing Outracks.Fuse.Studio;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Testing\n{\n\tpublic class IconPreviewWindow\n\t{\n\t\t//\n\t\tstatic readonly byte[] FallbackImage = Encoding.UTF8.GetBytes(\n\t\t\t\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"8\\\" height=\\\"8\\\" viewBox=\\\"0 0 8 8\\\">\\r\\n  <path d=\\\"M0 0v8h8v-8h-8zm1 1h6v3l-1-1-1 1 2 2v1h-1l-4-4-1 1v-3z\\\" />\\r\\n</svg>\");\n\n\t\tpublic static void Create()\n\t\t{\n\t\t\tvar lightTheme = new OriginalLightTheme();\n\t\t\tvar darkTheme = new OriginalDarkTheme();\n\n\t\t\tvar path = new BehaviorSubject<string>(string.Empty);\n\t\t\tvar refresh = new BehaviorSubject<Unit>(Unit.Default);\n\t\t\tvar image = path\n\t\t\t\t\t.CombineLatest(refresh, ((p, _) => p))\n\t\t\t\t\t.Select(p => AbsoluteFilePath.TryParse(p)\n\t\t\t\t\t.Where(f => File.Exists(f.NativePath))\n\t\t\t\t\t.Select(\n\t\t\t\t\t\tabsPath => absPath.NativePath.EndsWith(\".svg\")\n\t\t\t\t\t\t\t? (IImage) new SvgImage(() => File.OpenRead(absPath.NativePath))\n\t\t\t\t\t\t\t: new MultiResolutionImage(\n\t\t\t\t\t\t\t\tnew[] { new ImageStream(new Ratio<Pixels, Points>(1), () => File.OpenRead(absPath.NativePath)) }))\n\t\t\t\t\t.Or(() => (IImage)new SvgImage(() => new MemoryStream(FallbackImage))));\n\n\t\t\tvar content =\n\t\t\t\tLayout.Dock().Top(\n\t\t\t\t\tLayout.Dock()\n\t\t\t\t\t\t.Left(Label.Create(\"Path: \", font: Theme.DefaultFont, color: Theme.DefaultText).CenterVertically())\n\t\t\t\t\t\t.Right(Buttons.DefaultButton(\"Refresh\", Command.Enabled(() => refresh.OnNext(Unit.Default))))\n\t\t\t\t\t\t.Fill(ThemedTextBox.Create(path.AsProperty())))\n\t\t\t\t.Fill(Layout.SubdivideHorizontally(ImageVersionsRowForTheme(image, darkTheme), ImageVersionsRowForTheme(image, lightTheme)))\n\t\t\t\t.WithBackground(Theme.PanelBackground);\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tObservable.Return(true),\n\t\t\t\tdialog => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Observable.Return(\"Icon preview\"),\n\t\t\t\t\tSize = Property.Create<Optional<Size<Points>>>(new Size<Points>(600, 600)).ToOptional(),\n\t\t\t\t\tContent = content,\n\t\t\t\t\tBackground = Theme.PanelBackground,\n\t\t\t\t\tForeground = Theme.DefaultText,\n\t\t\t\t\tBorder = Separator.MediumStroke\n\t\t\t\t});\n\t\t}\n\n\t\tstatic IControl ImageVersionsRowForTheme(IObservable<IImage> image, ITheme theme)\n\t\t{\n\t\t\treturn Layout.SubdivideVertically(\n\t\t\t\t\tImage.FromImage(\n\t\t\t\t\t\timage,\n\t\t\t\t\t\tdpiOverride: Observable.Return(new Ratio<Pixels, Points>(1)),\n\t\t\t\t\t\tcolorMap: theme.IconColorMap),\n\t\t\t\t\tImage.FromImage(\n\t\t\t\t\t\timage,\n\t\t\t\t\t\tdpiOverride: Observable.Return(new Ratio<Pixels, Points>(2)),\n\t\t\t\t\t\tcolorMap: theme.IconColorMap))\n\t\t\t\t.WithBackground(theme.PanelBackground);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Testing/RandomMutatorWindow.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Testing\n{\n\tpublic class RandomMutatorWindow\n\t{\n\t\tprivate enum State\n\t\t{\n\t\t\tStopped,\n\t\t\tStarted,\n\t\t\tStopping\n\t\t}\n\n\t\tprivate readonly BehaviorSubject<State> _state = new BehaviorSubject<State>(State.Stopped);\n\t\tprivate readonly IObservable<Optional<AbsoluteFilePath>> _mainFile;\n\n\t\t//private Thread _thread;\n\t\t//private EventWaitHandle _stopSignal;\n\n\t\tpublic RandomMutatorWindow(IProject project)\n\t\t{\n\t\t\tvar mutator = new RandomUxMutator();\n\t\t\t_mainFile =\n\t\t\t\tproject.Documents\n\t\t\t\t\t.SelectPerElement(x => new { x.FilePath, x.Root })\n\t\t\t\t\t.WherePerElement(x => x.Root.Name.Is(\"App\"))\n\t\t\t\t\t.Select(\n\t\t\t\t\t\tx =>\n\t\t\t\t\t\t\tx.Select(y => y.FilePath.Select(z => z.ToOptional()))\n\t\t\t\t\t\t\t\t.FirstOr(() => Observable.Return(Optional.None<AbsoluteFilePath>())))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.Replay(1)\n\t\t\t\t\t.RefCount();\n\n\t\t\tObservable.Interval(TimeSpan.FromSeconds(1))\n\t\t\t\t.CombineLatest(_mainFile.NotNone(), (_, f) => f)\n\t\t\t\t.ConnectWhile(_state.Is(State.Started))\n\t\t\t\t.Subscribe(\n\t\t\t\t\tx =>\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmutator.Mutate(x, 10);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// ignored\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\n\t\tvoid CreateWindow()\n\t\t{\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tObservable.Return(true),\n\t\t\t\tdialog => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Observable.Return(\"Auto ux mutator\"),\n\t\t\t\t\tSize = Property.Create<Optional<Size<Points>>>(new Size<Points>(600, 260)).ToOptional(),\n\t\t\t\t\tContent = CreateContent()\n\t\t\t\t});\n\t\t}\n\n\t\tprivate IControl CreateContent()\n\t\t{\n\t\t\treturn\n\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t_mainFile\n\t\t\t\t\t\t\t\t.Select(x => x.Select(path => \"Start/stop random mutation of \" + path.NativePath))\n\t\t\t\t\t\t\t\t.Or(\"No file with <App> tag found.\")\n\t\t\t\t\t\t\t\t.AsText())\n\t\t\t\t\t\t.WithHeight(70)\n\t\t\t\t\t\t.Center(),\n\t\t\t\t\tButton.Create(clicked: _state.CombineLatest(_mainFile, CreateCommand).Switch())\n\t\t\t\t\t\t.Center(),\n\t\t\t\t\tLabel.Create(\"DANGER: This will overwrite stuff in your file!\")\n\t\t\t\t\t\t.WithHeight(70)\n\t\t\t\t\t\t.Center());\n\t\t}\n\n\t\tprivate Command CreateCommand(State state, Optional<AbsoluteFilePath> file)\n\t\t{\n\t\t\tswitch (state)\n\t\t\t{\n\t\t\t\tcase State.Stopping:\n\t\t\t\t\treturn Command.Disabled;\n\t\t\t\tcase State.Started:\n\t\t\t\t\treturn Command.Enabled(Stop);\n\t\t\t\tcase State.Stopped:\n\t\t\t\t\treturn Command.Create(isEnabled: file.HasValue, action: Start);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidOperationException(\"Unknown state \" + state);\n\t\t\t}\n\t\t}\n\n\t\tprivate void Start()\n\t\t{\n\t\t\t_state.OnNext(State.Started);\n\t\t}\n\n\t\tprivate void Stop()\n\t\t{\n\t\t\t_state.OnNext(State.Stopped);\n\t\t}\n\n\t\tpublic static void Create(IProject project)\n\t\t{\n\t\t\tnew RandomMutatorWindow(project).CreateWindow();\n\t\t}\n\n\t\t//async Task Run()\n\t\t//{\n\t\t//\tvar mutator = new RandomUxMutator();\n\t\t//}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Testing/RandomUxMutator.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Xml.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Testing\n{\n\tpublic class RandomUxMutator\n\t{\n\t\tprivate readonly Random _rng;\n\t\tprivate readonly int _maxElements = 200;\n\n\t\tprivate readonly string[] _colors =\n\t\t\t{ \"#c66029\", \"#e27043\", \"#ed830c\", \"#eba41e\", \"#eede83\", \"#91e11c\", \"#53bfdc\", \"#3963d3\", \"#e76b8f\" };\n\n\t\tpublic RandomUxMutator()\n\t\t{\n\t\t\t_rng = new Random();\n\t\t}\n\n\t\tpublic static int Depth(XElement element)\n\t\t{\n\t\t\treturn element.Parent == null ? 0 : Depth(element.Parent) + 1;\n\t\t}\n\n\t\tpublic void Mutate(AbsoluteFilePath file, int iterations)\n\t\t{\n\t\t\tvar element = SourceFragment.FromString(File.ReadAllText(file.NativePath)).ToXml();\n\t\t\tfor (int i = 0; i < iterations; i++)\n\t\t\t{\n\t\t\t\tMutate(element);\n\t\t\t}\n\t\t\tFile.WriteAllText(file.NativePath, SourceFragment.FromXml(element).ToString());\n\t\t}\n\n\t\tpublic void Mutate(XElement element)\n\t\t{\n\t\t\tvar descendants = element.Descendants().ToList();\n\t\t\tif ((descendants.Count < _maxElements / 2 || _rng.NextDouble() > descendants.Count / (double) _maxElements) &&\n\t\t\t\tdescendants.Count < _maxElements)\n\t\t\t{\n\t\t\t\tvar containers = descendants.Count > 0 ? descendants.Where(x => x.Name.LocalName == \"Grid\") : new[] { element };\n\t\t\t\tvar container = RandomItem(containers);\n\t\t\t\tvar existingChildCount = container.Elements().Count();\n\t\t\t\tvar insertPoint = _rng.Next(0, existingChildCount + 1);\n\n\t\t\t\tvar insertElement = SourceFragment.FromString(\n\t\t\t\t\t\tString.Format(\n\t\t\t\t\t\t\t\"<Grid ChildOrder=\\\"{0}\\\" Background=\\\"{1}\\\" />\",\n\t\t\t\t\t\t\tDepth(container) % 2 == 0 ? \"RowMajor\" : \"ColumnMajor\",\n\t\t\t\t\t\t\tRandomItem(_colors)))\n\t\t\t\t\t.ToXml();\n\n\t\t\t\tif (insertPoint == existingChildCount)\n\t\t\t\t{\n\t\t\t\t\tcontainer.Add(insertElement);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontainer.Elements().ElementAt(insertPoint).AddBeforeSelf(insertElement);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tRandomItem(descendants).Remove();\n\t\t\t}\n\t\t}\n\n\t\tprivate T RandomItem<T>(IEnumerable<T> items)\n\t\t{\n\t\t\tvar list = items as IList<T> ?? items.ToArray();\n\t\t\tif (list.Count == 0)\n\t\t\t\tthrow new InvalidOperationException(\"Need at least one item\");\n\n\t\t\treturn list[_rng.Next(0, list.Count)];\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Texts.cs",
    "content": "// Generated by texts-cs.js (DO NOT EDIT)\n\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fuse\n{\n    public static class Texts\n    {\n        /** Browse */\n        public static Text Button_Browse => _Button_Browse.AsText();\n        static readonly BehaviorSubject<string> _Button_Browse = new BehaviorSubject<string>(Strings.Button_Browse);\n\n        /** Cancel */\n        public static Text Button_Cancel => _Button_Cancel.AsText();\n        static readonly BehaviorSubject<string> _Button_Cancel = new BehaviorSubject<string>(Strings.Button_Cancel);\n\n        /** Browse */\n        public static Text Dashboard_Button_Browse => _Dashboard_Button_Browse.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Button_Browse = new BehaviorSubject<string>(Strings.Dashboard_Button_Browse);\n\n        /** Create */\n        public static Text Dashboard_Button_Create => _Dashboard_Button_Create.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Button_Create = new BehaviorSubject<string>(Strings.Dashboard_Button_Create);\n\n        /** Open */\n        public static Text Dashboard_Button_Open => _Dashboard_Button_Open.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Button_Open = new BehaviorSubject<string>(Strings.Dashboard_Button_Open);\n\n        /** Community */\n        public static Text Dashboard_Community => _Dashboard_Community.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Community = new BehaviorSubject<string>(Strings.Dashboard_Community);\n\n        /** Made something cool? Join a thriving\ncommunity of Fuse enthusiasts */\n        public static Text Dashboard_Community_Text => _Dashboard_Community_Text.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Community_Text = new BehaviorSubject<string>(Strings.Dashboard_Community_Text);\n\n        /** Docs */\n        public static Text Dashboard_Docs => _Dashboard_Docs.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Docs = new BehaviorSubject<string>(Strings.Dashboard_Docs);\n\n        /** Need some technical information?\nSearch the reference docs. */\n        public static Text Dashboard_Docs_Text => _Dashboard_Docs_Text.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Docs_Text = new BehaviorSubject<string>(Strings.Dashboard_Docs_Text);\n\n        /** Learn */\n        public static Text Dashboard_Learn => _Dashboard_Learn.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Learn = new BehaviorSubject<string>(Strings.Dashboard_Learn);\n\n        /** New to Fuse? Explore our Handbook,\nTutorials and Examples. */\n        public static Text Dashboard_Learn_Text => _Dashboard_Learn_Text.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Learn_Text = new BehaviorSubject<string>(Strings.Dashboard_Learn_Text);\n\n        /** Remove from list */\n        public static Text Dashboard_Project_Remove => _Dashboard_Project_Remove.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Project_Remove = new BehaviorSubject<string>(Strings.Dashboard_Project_Remove);\n\n        /** Recent Projects */\n        public static Text Dashboard_Recent_Projects => _Dashboard_Recent_Projects.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Recent_Projects = new BehaviorSubject<string>(Strings.Dashboard_Recent_Projects);\n\n        /** Last opened */\n        public static Text Dashboard_LastOpened => _Dashboard_LastOpened.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_LastOpened = new BehaviorSubject<string>(Strings.Dashboard_LastOpened);\n\n        /** Location */\n        public static Text Dashboard_Location => _Dashboard_Location.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Location = new BehaviorSubject<string>(Strings.Dashboard_Location);\n\n        /** Description */\n        public static Text Dashboard_Description => _Dashboard_Description.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Description = new BehaviorSubject<string>(Strings.Dashboard_Description);\n\n        /** New */\n        public static Text Dashboard_New_Prefix => _Dashboard_New_Prefix.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_New_Prefix = new BehaviorSubject<string>(Strings.Dashboard_New_Prefix);\n\n        /** Open */\n        public static Text Dashboard_Open_Prefix => _Dashboard_Open_Prefix.AsText();\n        static readonly BehaviorSubject<string> _Dashboard_Open_Prefix = new BehaviorSubject<string>(Strings.Dashboard_Open_Prefix);\n\n        /** Edit */\n        public static Text MainMenu_Edit => _MainMenu_Edit.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Edit = new BehaviorSubject<string>(Strings.MainMenu_Edit);\n\n        /** Element */\n        public static Text MainMenu_Element => _MainMenu_Element.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Element = new BehaviorSubject<string>(Strings.MainMenu_Element);\n\n        /** Export */\n        public static Text MainMenu_Export => _MainMenu_Export.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Export = new BehaviorSubject<string>(Strings.MainMenu_Export);\n\n        /** File */\n        public static Text MainMenu_File => _MainMenu_File.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_File = new BehaviorSubject<string>(Strings.MainMenu_File);\n\n        /** Help */\n        public static Text MainMenu_Help => _MainMenu_Help.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Help = new BehaviorSubject<string>(Strings.MainMenu_Help);\n\n        /** Preview */\n        public static Text MainMenu_Preview => _MainMenu_Preview.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Preview = new BehaviorSubject<string>(Strings.MainMenu_Preview);\n\n        /** Project */\n        public static Text MainMenu_Project => _MainMenu_Project.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Project = new BehaviorSubject<string>(Strings.MainMenu_Project);\n\n        /** Tools */\n        public static Text MainMenu_Tools => _MainMenu_Tools.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Tools = new BehaviorSubject<string>(Strings.MainMenu_Tools);\n\n        /** Viewport */\n        public static Text MainMenu_Viewport => _MainMenu_Viewport.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Viewport = new BehaviorSubject<string>(Strings.MainMenu_Viewport);\n\n        /** Window */\n        public static Text MainMenu_Window => _MainMenu_Window.AsText();\n        static readonly BehaviorSubject<string> _MainMenu_Window = new BehaviorSubject<string>(Strings.MainMenu_Window);\n\n        /** Copy */\n        public static Text SubMenu_Edit_Copy => _SubMenu_Edit_Copy.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Edit_Copy = new BehaviorSubject<string>(Strings.SubMenu_Edit_Copy);\n\n        /** Cut */\n        public static Text SubMenu_Edit_Cut => _SubMenu_Edit_Cut.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Edit_Cut = new BehaviorSubject<string>(Strings.SubMenu_Edit_Cut);\n\n        /** Delete */\n        public static Text SubMenu_Edit_Delete => _SubMenu_Edit_Delete.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Edit_Delete = new BehaviorSubject<string>(Strings.SubMenu_Edit_Delete);\n\n        /** Paste */\n        public static Text SubMenu_Edit_Paste => _SubMenu_Edit_Paste.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Edit_Paste = new BehaviorSubject<string>(Strings.SubMenu_Edit_Paste);\n\n        /** Select All */\n        public static Text SubMenu_Edit_SelectAll => _SubMenu_Edit_SelectAll.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Edit_SelectAll = new BehaviorSubject<string>(Strings.SubMenu_Edit_SelectAll);\n\n        /** Deselect */\n        public static Text SubMenu_Element_Deselect => _SubMenu_Element_Deselect.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Element_Deselect = new BehaviorSubject<string>(Strings.SubMenu_Element_Deselect);\n\n        /** Locate in editor */\n        public static Text SubMenu_Element_LocateInEditor => _SubMenu_Element_LocateInEditor.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Element_LocateInEditor = new BehaviorSubject<string>(Strings.SubMenu_Element_LocateInEditor);\n\n        /** Remove element */\n        public static Text SubMenu_Element_Remove => _SubMenu_Element_Remove.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Element_Remove = new BehaviorSubject<string>(Strings.SubMenu_Element_Remove);\n\n        /** Export for Android */\n        public static Text SubMenu_Export_ExportForAndroid => _SubMenu_Export_ExportForAndroid.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Export_ExportForAndroid = new BehaviorSubject<string>(Strings.SubMenu_Export_ExportForAndroid);\n\n        /** Export for Android Emulator */\n        public static Text SubMenu_Export_ExportForAndroidEmulator => _SubMenu_Export_ExportForAndroidEmulator.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Export_ExportForAndroidEmulator = new BehaviorSubject<string>(Strings.SubMenu_Export_ExportForAndroidEmulator);\n\n        /** Export for iOS */\n        public static Text SubMenu_Export_ExportForiOS => _SubMenu_Export_ExportForiOS.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Export_ExportForiOS = new BehaviorSubject<string>(Strings.SubMenu_Export_ExportForiOS);\n\n        /** Export for iOS Simulator */\n        public static Text SubMenu_Export_ExportForiOSSimulator => _SubMenu_Export_ExportForiOSSimulator.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Export_ExportForiOSSimulator = new BehaviorSubject<string>(Strings.SubMenu_Export_ExportForiOSSimulator);\n\n        /** Export for Desktop (.NET) */\n        public static Text SubMenu_Export_ExportForDotNet => _SubMenu_Export_ExportForDotNet.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Export_ExportForDotNet = new BehaviorSubject<string>(Strings.SubMenu_Export_ExportForDotNet);\n\n        /** Export for Desktop (native) */\n        public static Text SubMenu_Export_ExportForNative => _SubMenu_Export_ExportForNative.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Export_ExportForNative = new BehaviorSubject<string>(Strings.SubMenu_Export_ExportForNative);\n\n        /** Clean build files */\n        public static Text SubMenu_Export_Clean => _SubMenu_Export_Clean.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Export_Clean = new BehaviorSubject<string>(Strings.SubMenu_Export_Clean);\n\n        /** New... */\n        public static Text SubMenu_File_New => _SubMenu_File_New.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_File_New = new BehaviorSubject<string>(Strings.SubMenu_File_New);\n\n        /** Open... */\n        public static Text SubMenu_File_Open => _SubMenu_File_Open.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_File_Open = new BehaviorSubject<string>(Strings.SubMenu_File_Open);\n\n        /** Quit */\n        public static Text SubMenu_File_Quit => _SubMenu_File_Quit.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_File_Quit = new BehaviorSubject<string>(Strings.SubMenu_File_Quit);\n\n        /** Exit */\n        public static Text SubMenu_File_Exit => _SubMenu_File_Exit.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_File_Exit = new BehaviorSubject<string>(Strings.SubMenu_File_Exit);\n\n        /** Community */\n        public static Text SubMenu_Help_Community => _SubMenu_Help_Community.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Help_Community = new BehaviorSubject<string>(Strings.SubMenu_Help_Community);\n\n        /** Documentation */\n        public static Text SubMenu_Help_Documentation => _SubMenu_Help_Documentation.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Help_Documentation = new BehaviorSubject<string>(Strings.SubMenu_Help_Documentation);\n\n        /** Examples */\n        public static Text SubMenu_Help_Examples => _SubMenu_Help_Examples.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Help_Examples = new BehaviorSubject<string>(Strings.SubMenu_Help_Examples);\n\n        /** Tutorial */\n        public static Text SubMenu_Help_Tutorial => _SubMenu_Help_Tutorial.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Help_Tutorial = new BehaviorSubject<string>(Strings.SubMenu_Help_Tutorial);\n\n        /** Forums */\n        public static Text SubMenu_Help_Forums => _SubMenu_Help_Forums.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Help_Forums = new BehaviorSubject<string>(Strings.SubMenu_Help_Forums);\n\n        /** Report issue */\n        public static Text SubMenu_Help_ReportIssue => _SubMenu_Help_ReportIssue.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Help_ReportIssue = new BehaviorSubject<string>(Strings.SubMenu_Help_ReportIssue);\n\n        /** Check for updates */\n        public static Text SubMenu_Updates_CheckForUpdates => _SubMenu_Updates_CheckForUpdates.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Updates_CheckForUpdates = new BehaviorSubject<string>(Strings.SubMenu_Updates_CheckForUpdates);\n\n        /** Check automatically */\n        public static Text SubMenu_Updates_CheckAutomatically => _SubMenu_Updates_CheckAutomatically.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Updates_CheckAutomatically = new BehaviorSubject<string>(Strings.SubMenu_Updates_CheckAutomatically);\n\n        /** There's an update available */\n        public static Text SubMenu_Updates_UpdateAvailable => _SubMenu_Updates_UpdateAvailable.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Updates_UpdateAvailable = new BehaviorSubject<string>(Strings.SubMenu_Updates_UpdateAvailable);\n\n        /** Do you want to download the latest version now? */\n        public static Text SubMenu_Updates_DownloadLatestQuestion => _SubMenu_Updates_DownloadLatestQuestion.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Updates_DownloadLatestQuestion = new BehaviorSubject<string>(Strings.SubMenu_Updates_DownloadLatestQuestion);\n\n        /** Preview on Android */\n        public static Text SubMenu_Preview_Android => _SubMenu_Preview_Android.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_Android = new BehaviorSubject<string>(Strings.SubMenu_Preview_Android);\n\n        /** Preview on Android Emulator */\n        public static Text SubMenu_Preview_AndroidEmulator => _SubMenu_Preview_AndroidEmulator.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_AndroidEmulator = new BehaviorSubject<string>(Strings.SubMenu_Preview_AndroidEmulator);\n\n        /** Build flags */\n        public static Text SubMenu_Preview_BuildFlags => _SubMenu_Preview_BuildFlags.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_BuildFlags = new BehaviorSubject<string>(Strings.SubMenu_Preview_BuildFlags);\n\n        /** Preview on iOS */\n        public static Text SubMenu_Preview_iOS => _SubMenu_Preview_iOS.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_iOS = new BehaviorSubject<string>(Strings.SubMenu_Preview_iOS);\n\n        /** Preview on iOS Simulator */\n        public static Text SubMenu_Preview_iOSSimulator => _SubMenu_Preview_iOSSimulator.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_iOSSimulator = new BehaviorSubject<string>(Strings.SubMenu_Preview_iOSSimulator);\n\n        /** Preview on Desktop (native) */\n        public static Text SubMenu_Preview_Native => _SubMenu_Preview_Native.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_Native = new BehaviorSubject<string>(Strings.SubMenu_Preview_Native);\n\n        /** Rebuild */\n        public static Text SubMenu_Preview_Rebuild => _SubMenu_Preview_Rebuild.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_Rebuild = new BehaviorSubject<string>(Strings.SubMenu_Preview_Rebuild);\n\n        /** Reconnect USB (Android) */\n        public static Text SubMenu_Preview_Reconnect => _SubMenu_Preview_Reconnect.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_Reconnect = new BehaviorSubject<string>(Strings.SubMenu_Preview_Reconnect);\n\n        /** Refresh */\n        public static Text SubMenu_Preview_Refresh => _SubMenu_Preview_Refresh.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Preview_Refresh = new BehaviorSubject<string>(Strings.SubMenu_Preview_Refresh);\n\n        /** Open Project Folder */\n        public static Text SubMenu_Project_OpenFolder => _SubMenu_Project_OpenFolder.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Project_OpenFolder = new BehaviorSubject<string>(Strings.SubMenu_Project_OpenFolder);\n\n        /** Open in Sublime Text 3 */\n        public static Text SubMenu_Project_OpenSublime => _SubMenu_Project_OpenSublime.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Project_OpenSublime = new BehaviorSubject<string>(Strings.SubMenu_Project_OpenSublime);\n\n        /** Open in Visual Studio Code */\n        public static Text SubMenu_Project_OpenVSCode => _SubMenu_Project_OpenVSCode.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Project_OpenVSCode = new BehaviorSubject<string>(Strings.SubMenu_Project_OpenVSCode);\n\n        /** Open in Terminal */\n        public static Text SubMenu_Project_OpenTerminal => _SubMenu_Project_OpenTerminal.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Project_OpenTerminal = new BehaviorSubject<string>(Strings.SubMenu_Project_OpenTerminal);\n\n        /** Install Android SDK */\n        public static Text SubMenu_Tools_InstallSDK => _SubMenu_Tools_InstallSDK.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Tools_InstallSDK = new BehaviorSubject<string>(Strings.SubMenu_Tools_InstallSDK);\n\n        /** Install Atom plugin */\n        public static Text SubMenu_Tools_InstallAtomPlugin => _SubMenu_Tools_InstallAtomPlugin.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Tools_InstallAtomPlugin = new BehaviorSubject<string>(Strings.SubMenu_Tools_InstallAtomPlugin);\n\n        /** Install Sublime Text 3 plugin */\n        public static Text SubMenu_Tools_InstallSublimePlugin => _SubMenu_Tools_InstallSublimePlugin.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Tools_InstallSublimePlugin = new BehaviorSubject<string>(Strings.SubMenu_Tools_InstallSublimePlugin);\n\n        /** Install Visual Studio Code extension */\n        public static Text SubMenu_Tools_InstallVSCodeExtension => _SubMenu_Tools_InstallVSCodeExtension.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Tools_InstallVSCodeExtension = new BehaviorSubject<string>(Strings.SubMenu_Tools_InstallVSCodeExtension);\n\n        /** Setup guide */\n        public static Text SubMenu_Tools_Setup => _SubMenu_Tools_Setup.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Tools_Setup = new BehaviorSubject<string>(Strings.SubMenu_Tools_Setup);\n\n        /** Print Uno config */\n        public static Text SubMenu_Tools_Config => _SubMenu_Tools_Config.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Tools_Config = new BehaviorSubject<string>(Strings.SubMenu_Tools_Config);\n\n        /** Close Viewport */\n        public static Text SubMenu_Viewport_Close => _SubMenu_Viewport_Close.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Viewport_Close = new BehaviorSubject<string>(Strings.SubMenu_Viewport_Close);\n\n        /** Select device */\n        public static Text SubMenu_Viewport_Device => _SubMenu_Viewport_Device.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Viewport_Device = new BehaviorSubject<string>(Strings.SubMenu_Viewport_Device);\n\n        /** Flip aspect */\n        public static Text SubMenu_Viewport_FlipAspect => _SubMenu_Viewport_FlipAspect.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Viewport_FlipAspect = new BehaviorSubject<string>(Strings.SubMenu_Viewport_FlipAspect);\n\n        /** Go back */\n        public static Text SubMenu_Viewport_Goback => _SubMenu_Viewport_Goback.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Viewport_Goback = new BehaviorSubject<string>(Strings.SubMenu_Viewport_Goback);\n\n        /** New Viewport */\n        public static Text SubMenu_Viewport_New => _SubMenu_Viewport_New.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Viewport_New = new BehaviorSubject<string>(Strings.SubMenu_Viewport_New);\n\n        /** Restart */\n        public static Text SubMenu_Viewport_Restart => _SubMenu_Viewport_Restart.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Viewport_Restart = new BehaviorSubject<string>(Strings.SubMenu_Viewport_Restart);\n\n        /** Selection */\n        public static Text SubMenu_Viewport_Selection => _SubMenu_Viewport_Selection.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Viewport_Selection = new BehaviorSubject<string>(Strings.SubMenu_Viewport_Selection);\n\n        /** Compact mode */\n        public static Text SubMenu_Window_CompactMode => _SubMenu_Window_CompactMode.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Window_CompactMode = new BehaviorSubject<string>(Strings.SubMenu_Window_CompactMode);\n\n        /** Keep window on top */\n        public static Text SubMenu_Window_KeepWindowOnTop => _SubMenu_Window_KeepWindowOnTop.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Window_KeepWindowOnTop = new BehaviorSubject<string>(Strings.SubMenu_Window_KeepWindowOnTop);\n\n        /** Language */\n        public static Text SubMenu_Window_Language => _SubMenu_Window_Language.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Window_Language = new BehaviorSubject<string>(Strings.SubMenu_Window_Language);\n\n        /** Light theme */\n        public static Text SubMenu_Window_LightTheme => _SubMenu_Window_LightTheme.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Window_LightTheme = new BehaviorSubject<string>(Strings.SubMenu_Window_LightTheme);\n\n        /** Dark theme */\n        public static Text SubMenu_Window_DarkTheme => _SubMenu_Window_DarkTheme.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Window_DarkTheme = new BehaviorSubject<string>(Strings.SubMenu_Window_DarkTheme);\n\n        /** OK */\n        public static Text Button_Ok => _Button_Ok.AsText();\n        static readonly BehaviorSubject<string> _Button_Ok = new BehaviorSubject<string>(Strings.Button_Ok);\n\n        /** Setup guide */\n        public static Text Dialog_SetupGuide_Caption => _Dialog_SetupGuide_Caption.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_Caption = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_Caption);\n\n        /** A text editor is required to use fuse X. */\n        public static Text Dialog_SetupGuide_Comment1 => _Dialog_SetupGuide_Comment1.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_Comment1 = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_Comment1);\n\n        /** We recommend  */\n        public static Text Dialog_SetupGuide_Comment2_1 => _Dialog_SetupGuide_Comment2_1.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_Comment2_1 = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_Comment2_1);\n\n        /**  or  */\n        public static Text Dialog_SetupGuide_Comment2_2 => _Dialog_SetupGuide_Comment2_2.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_Comment2_2 = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_Comment2_2);\n\n        /** , and our accompanying plugins. */\n        public static Text Dialog_SetupGuide_Comment2_3 => _Dialog_SetupGuide_Comment2_3.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_Comment2_3 = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_Comment2_3);\n\n        /** This wizard will look for the software on your system and help you install or update our plugins. */\n        public static Text Dialog_SetupGuide_Comment3 => _Dialog_SetupGuide_Comment3.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_Comment3 = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_Comment3);\n\n        /** We also have a plugin for  */\n        public static Text Dialog_SetupGuide_SeeAlso1 => _Dialog_SetupGuide_SeeAlso1.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_SeeAlso1 = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_SeeAlso1);\n\n        /** . */\n        public static Text Dialog_SetupGuide_SeeAlso2 => _Dialog_SetupGuide_SeeAlso2.AsText();\n        static readonly BehaviorSubject<string> _Dialog_SetupGuide_SeeAlso2 = new BehaviorSubject<string>(Strings.Dialog_SetupGuide_SeeAlso2);\n\n        /** Sketch Import */\n        public static Text SubMenu_Project_SketchImport => _SubMenu_Project_SketchImport.AsText();\n        static readonly BehaviorSubject<string> _SubMenu_Project_SketchImport = new BehaviorSubject<string>(Strings.SubMenu_Project_SketchImport);\n\n        /** Done */\n        public static Text Button_Done => _Button_Done.AsText();\n        static readonly BehaviorSubject<string> _Button_Done = new BehaviorSubject<string>(Strings.Button_Done);\n\n        /** Clear */\n        public static Text LogView_Tab_Clear => _LogView_Tab_Clear.AsText();\n        static readonly BehaviorSubject<string> _LogView_Tab_Clear = new BehaviorSubject<string>(Strings.LogView_Tab_Clear);\n\n        /** Log */\n        public static Text LogView_Tab_Log => _LogView_Tab_Log.AsText();\n        static readonly BehaviorSubject<string> _LogView_Tab_Log = new BehaviorSubject<string>(Strings.LogView_Tab_Log);\n\n        /** Problems */\n        public static Text LogView_Tab_Problems => _LogView_Tab_Problems.AsText();\n        static readonly BehaviorSubject<string> _LogView_Tab_Problems = new BehaviorSubject<string>(Strings.LogView_Tab_Problems);\n\n        /** Mac only */\n        public static Text Label_MacOnly => _Label_MacOnly.AsText();\n        static readonly BehaviorSubject<string> _Label_MacOnly = new BehaviorSubject<string>(Strings.Label_MacOnly);\n\n        /** Your language preference was updated.\n\nThe new language will come into full effect next time you start fuse X. */\n        public static Text LanguageUpdated_Text => _LanguageUpdated_Text.AsText();\n        static readonly BehaviorSubject<string> _LanguageUpdated_Text = new BehaviorSubject<string>(Strings.LanguageUpdated_Text);\n\n        /** This is an unregistered copy */\n        public static Text NagScreen_Caption => _NagScreen_Caption.AsText();\n        static readonly BehaviorSubject<string> _NagScreen_Caption = new BehaviorSubject<string>(Strings.NagScreen_Caption);\n\n        /** Hello! Thanks for trying out fuse X.\n\nActivation is required to use this software.\n\nFree Trial available:\n• Try all fuse X has to offer for one month.\n• No credit card required. */\n        public static Text NagScreen_Text => _NagScreen_Text.AsText();\n        static readonly BehaviorSubject<string> _NagScreen_Text = new BehaviorSubject<string>(Strings.NagScreen_Text);\n\n        /** Sign in */\n        public static Text NagScreen_Button_SignIn => _NagScreen_Button_SignIn.AsText();\n        static readonly BehaviorSubject<string> _NagScreen_Button_SignIn = new BehaviorSubject<string>(Strings.NagScreen_Button_SignIn);\n\n        /** Enter code */\n        public static Text NagScreen_Button_EnterCode => _NagScreen_Button_EnterCode.AsText();\n        static readonly BehaviorSubject<string> _NagScreen_Button_EnterCode = new BehaviorSubject<string>(Strings.NagScreen_Button_EnterCode);\n\n        /** Would you like to activate now? */\n        public static Text NagScreen_Question => _NagScreen_Question.AsText();\n        static readonly BehaviorSubject<string> _NagScreen_Question = new BehaviorSubject<string>(Strings.NagScreen_Question);\n\n        /** Enable to select elements in the app. */\n        public static Text Toolbar_Selection_Tooltip => _Toolbar_Selection_Tooltip.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Selection_Tooltip = new BehaviorSubject<string>(Strings.Toolbar_Selection_Tooltip);\n\n        /** Enable to select elements in the app. Disable to interact with the app. */\n        public static Text Toolbar_Selection_Tooltip2 => _Toolbar_Selection_Tooltip2.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Selection_Tooltip2 = new BehaviorSubject<string>(Strings.Toolbar_Selection_Tooltip2);\n\n        /** Selection */\n        public static Text Toolbar_Selection_Button => _Toolbar_Selection_Button.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Selection_Button = new BehaviorSubject<string>(Strings.Toolbar_Selection_Button);\n\n        /** Enable to intract with the app. */\n        public static Text Toolbar_Touch_Tooltip => _Toolbar_Touch_Tooltip.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Touch_Tooltip = new BehaviorSubject<string>(Strings.Toolbar_Touch_Tooltip);\n\n        /** Touch */\n        public static Text Toolbar_Touch_Button => _Toolbar_Touch_Button.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Touch_Button = new BehaviorSubject<string>(Strings.Toolbar_Touch_Button);\n\n        /** Click to add a new Viewport. */\n        public static Text Toolbar_Viewport_Tooltip => _Toolbar_Viewport_Tooltip.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Viewport_Tooltip = new BehaviorSubject<string>(Strings.Toolbar_Viewport_Tooltip);\n\n        /** Add Viewport */\n        public static Text Toolbar_Viewport_Button => _Toolbar_Viewport_Button.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Viewport_Button = new BehaviorSubject<string>(Strings.Toolbar_Viewport_Button);\n\n        /** Switch between normal and compact mode. Click to switch mode. */\n        public static Text Toolbar_Compact_Tooltip => _Toolbar_Compact_Tooltip.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Compact_Tooltip = new BehaviorSubject<string>(Strings.Toolbar_Compact_Tooltip);\n\n        /** Compact */\n        public static Text Toolbar_Compact_Button => _Toolbar_Compact_Button.AsText();\n        static readonly BehaviorSubject<string> _Toolbar_Compact_Button = new BehaviorSubject<string>(Strings.Toolbar_Compact_Button);\n\n        /** undefined */\n        public static Text Auth_Text_LicensedTo1 => _Auth_Text_LicensedTo1.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_LicensedTo1 = new BehaviorSubject<string>(Strings.Auth_Text_LicensedTo1);\n\n        /** undefined */\n        public static Text Auth_Text_LicensedTo2 => _Auth_Text_LicensedTo2.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_LicensedTo2 = new BehaviorSubject<string>(Strings.Auth_Text_LicensedTo2);\n\n        /** trial day left */\n        public static Text Auth_Text_TrialDayLeft => _Auth_Text_TrialDayLeft.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_TrialDayLeft = new BehaviorSubject<string>(Strings.Auth_Text_TrialDayLeft);\n\n        /** trial days left */\n        public static Text Auth_Text_TrialDaysLeft => _Auth_Text_TrialDaysLeft.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_TrialDaysLeft = new BehaviorSubject<string>(Strings.Auth_Text_TrialDaysLeft);\n\n        /** Your license has expired. Please  */\n        public static Text Auth_Text_LicenseExpired1 => _Auth_Text_LicenseExpired1.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_LicenseExpired1 = new BehaviorSubject<string>(Strings.Auth_Text_LicenseExpired1);\n\n        /** sign in */\n        public static Text Auth_Text_LicenseExpired2 => _Auth_Text_LicenseExpired2.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_LicenseExpired2 = new BehaviorSubject<string>(Strings.Auth_Text_LicenseExpired2);\n\n        /**  to reactivate. */\n        public static Text Auth_Text_LicenseExpired3 => _Auth_Text_LicenseExpired3.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_LicenseExpired3 = new BehaviorSubject<string>(Strings.Auth_Text_LicenseExpired3);\n\n        /** Please  */\n        public static Text Auth_Text_SignIn1 => _Auth_Text_SignIn1.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_SignIn1 = new BehaviorSubject<string>(Strings.Auth_Text_SignIn1);\n\n        /** sign in */\n        public static Text Auth_Text_SignIn2 => _Auth_Text_SignIn2.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_SignIn2 = new BehaviorSubject<string>(Strings.Auth_Text_SignIn2);\n\n        /**  to activate fuse X */\n        public static Text Auth_Text_SignIn3 => _Auth_Text_SignIn3.AsText();\n        static readonly BehaviorSubject<string> _Auth_Text_SignIn3 = new BehaviorSubject<string>(Strings.Auth_Text_SignIn3);\n\n        /** About fuse X */\n        public static Text About_Title => _About_Title.AsText();\n        static readonly BehaviorSubject<string> _About_Title = new BehaviorSubject<string>(Strings.About_Title);\n\n        /** About */\n        public static Text About_Menu => _About_Menu.AsText();\n        static readonly BehaviorSubject<string> _About_Menu = new BehaviorSubject<string>(Strings.About_Menu);\n\n        /** Registered to */\n        public static Text About_RegisteredTo => _About_RegisteredTo.AsText();\n        static readonly BehaviorSubject<string> _About_RegisteredTo = new BehaviorSubject<string>(Strings.About_RegisteredTo);\n\n        /** Not registered */\n        public static Text About_NotRegistered => _About_NotRegistered.AsText();\n        static readonly BehaviorSubject<string> _About_NotRegistered = new BehaviorSubject<string>(Strings.About_NotRegistered);\n\n        /** Company:  */\n        public static Text About_Company => _About_Company.AsText();\n        static readonly BehaviorSubject<string> _About_Company = new BehaviorSubject<string>(Strings.About_Company);\n\n        /** License:  */\n        public static Text About_License => _About_License.AsText();\n        static readonly BehaviorSubject<string> _About_License = new BehaviorSubject<string>(Strings.About_License);\n\n        /** Issued:  */\n        public static Text About_Issued => _About_Issued.AsText();\n        static readonly BehaviorSubject<string> _About_Issued = new BehaviorSubject<string>(Strings.About_Issued);\n\n        /** Expires:  */\n        public static Text About_Expires => _About_Expires.AsText();\n        static readonly BehaviorSubject<string> _About_Expires = new BehaviorSubject<string>(Strings.About_Expires);\n\n        /** Authority:  */\n        public static Text About_Authority => _About_Authority.AsText();\n        static readonly BehaviorSubject<string> _About_Authority = new BehaviorSubject<string>(Strings.About_Authority);\n\n        /** For more information visit our  */\n        public static Text About_MoreInfo1 => _About_MoreInfo1.AsText();\n        static readonly BehaviorSubject<string> _About_MoreInfo1 = new BehaviorSubject<string>(Strings.About_MoreInfo1);\n\n        /** website */\n        public static Text About_MoreInfo2 => _About_MoreInfo2.AsText();\n        static readonly BehaviorSubject<string> _About_MoreInfo2 = new BehaviorSubject<string>(Strings.About_MoreInfo2);\n\n        /** Enter activation code */\n        public static Text Activate_Title => _Activate_Title.AsText();\n        static readonly BehaviorSubject<string> _Activate_Title = new BehaviorSubject<string>(Strings.Activate_Title);\n\n        /** Activate fuse X */\n        public static Text Activate_Button => _Activate_Button.AsText();\n        static readonly BehaviorSubject<string> _Activate_Button = new BehaviorSubject<string>(Strings.Activate_Button);\n\n        /** Please enter your activation code. */\n        public static Text Activate_FeedbackEmpty => _Activate_FeedbackEmpty.AsText();\n        static readonly BehaviorSubject<string> _Activate_FeedbackEmpty = new BehaviorSubject<string>(Strings.Activate_FeedbackEmpty);\n\n        /** This activation code is not valid. */\n        public static Text Activate_FeedbackInvalid => _Activate_FeedbackInvalid.AsText();\n        static readonly BehaviorSubject<string> _Activate_FeedbackInvalid = new BehaviorSubject<string>(Strings.Activate_FeedbackInvalid);\n\n        /** Something went wrong while checking your license.\n\nThis might be a temporary loss of service caused by problems in the network.\n\nPlease try again later. */\n        public static Text License_Error_Text => _License_Error_Text.AsText();\n        static readonly BehaviorSubject<string> _License_Error_Text = new BehaviorSubject<string>(Strings.License_Error_Text);\n\n        /** Select something to get started */\n        public static Text Inspector_SelectSomething => _Inspector_SelectSomething.AsText();\n        static readonly BehaviorSubject<string> _Inspector_SelectSomething = new BehaviorSubject<string>(Strings.Inspector_SelectSomething);\n\n        /** Make class from selection */\n        public static Text Toolbox_MakeClassFromSelection => _Toolbox_MakeClassFromSelection.AsText();\n        static readonly BehaviorSubject<string> _Toolbox_MakeClassFromSelection = new BehaviorSubject<string>(Strings.Toolbox_MakeClassFromSelection);\n\n        /** Your classes */\n        public static Text Toolbox_YourClasses => _Toolbox_YourClasses.AsText();\n        static readonly BehaviorSubject<string> _Toolbox_YourClasses = new BehaviorSubject<string>(Strings.Toolbox_YourClasses);\n\n        /** Search your classes */\n        public static Text Toolbox_SearchYourClasses => _Toolbox_SearchYourClasses.AsText();\n        static readonly BehaviorSubject<string> _Toolbox_SearchYourClasses = new BehaviorSubject<string>(Strings.Toolbox_SearchYourClasses);\n\n        /** Drag classes into the hierarchy \nto insert instances of them */\n        public static Text Toolbox_DragClassesInto_Text => _Toolbox_DragClassesInto_Text.AsText();\n        static readonly BehaviorSubject<string> _Toolbox_DragClassesInto_Text = new BehaviorSubject<string>(Strings.Toolbox_DragClassesInto_Text);\n\n        /** Create a class from elements in the\nhierarchy and it will appear here */\n        public static Text Toolbox_CreateAClass_Text => _Toolbox_CreateAClass_Text.AsText();\n        static readonly BehaviorSubject<string> _Toolbox_CreateAClass_Text = new BehaviorSubject<string>(Strings.Toolbox_CreateAClass_Text);\n\n        /** Devices */\n        public static Text CodeView_Devices => _CodeView_Devices.AsText();\n        static readonly BehaviorSubject<string> _CodeView_Devices = new BehaviorSubject<string>(Strings.CodeView_Devices);\n\n        /** Connect this project to a device with the fuse X Preview app installed on it. */\n        public static Text CodeView_ToolTip => _CodeView_ToolTip.AsText();\n        static readonly BehaviorSubject<string> _CodeView_ToolTip = new BehaviorSubject<string>(Strings.CodeView_ToolTip);\n\n        /** All Output */\n        public static Text LogView_AllOutput => _LogView_AllOutput.AsText();\n        static readonly BehaviorSubject<string> _LogView_AllOutput = new BehaviorSubject<string>(Strings.LogView_AllOutput);\n\n\n        public static void Update()\n        {\n            _Button_Browse.OnNext(Strings.Button_Browse);\n            _Button_Cancel.OnNext(Strings.Button_Cancel);\n            _Dashboard_Button_Browse.OnNext(Strings.Dashboard_Button_Browse);\n            _Dashboard_Button_Create.OnNext(Strings.Dashboard_Button_Create);\n            _Dashboard_Button_Open.OnNext(Strings.Dashboard_Button_Open);\n            _Dashboard_Community.OnNext(Strings.Dashboard_Community);\n            _Dashboard_Community_Text.OnNext(Strings.Dashboard_Community_Text);\n            _Dashboard_Docs.OnNext(Strings.Dashboard_Docs);\n            _Dashboard_Docs_Text.OnNext(Strings.Dashboard_Docs_Text);\n            _Dashboard_Learn.OnNext(Strings.Dashboard_Learn);\n            _Dashboard_Learn_Text.OnNext(Strings.Dashboard_Learn_Text);\n            _Dashboard_Project_Remove.OnNext(Strings.Dashboard_Project_Remove);\n            _Dashboard_Recent_Projects.OnNext(Strings.Dashboard_Recent_Projects);\n            _Dashboard_LastOpened.OnNext(Strings.Dashboard_LastOpened);\n            _Dashboard_Location.OnNext(Strings.Dashboard_Location);\n            _Dashboard_Description.OnNext(Strings.Dashboard_Description);\n            _Dashboard_New_Prefix.OnNext(Strings.Dashboard_New_Prefix);\n            _Dashboard_Open_Prefix.OnNext(Strings.Dashboard_Open_Prefix);\n            _MainMenu_Edit.OnNext(Strings.MainMenu_Edit);\n            _MainMenu_Element.OnNext(Strings.MainMenu_Element);\n            _MainMenu_Export.OnNext(Strings.MainMenu_Export);\n            _MainMenu_File.OnNext(Strings.MainMenu_File);\n            _MainMenu_Help.OnNext(Strings.MainMenu_Help);\n            _MainMenu_Preview.OnNext(Strings.MainMenu_Preview);\n            _MainMenu_Project.OnNext(Strings.MainMenu_Project);\n            _MainMenu_Tools.OnNext(Strings.MainMenu_Tools);\n            _MainMenu_Viewport.OnNext(Strings.MainMenu_Viewport);\n            _MainMenu_Window.OnNext(Strings.MainMenu_Window);\n            _SubMenu_Edit_Copy.OnNext(Strings.SubMenu_Edit_Copy);\n            _SubMenu_Edit_Cut.OnNext(Strings.SubMenu_Edit_Cut);\n            _SubMenu_Edit_Delete.OnNext(Strings.SubMenu_Edit_Delete);\n            _SubMenu_Edit_Paste.OnNext(Strings.SubMenu_Edit_Paste);\n            _SubMenu_Edit_SelectAll.OnNext(Strings.SubMenu_Edit_SelectAll);\n            _SubMenu_Element_Deselect.OnNext(Strings.SubMenu_Element_Deselect);\n            _SubMenu_Element_LocateInEditor.OnNext(Strings.SubMenu_Element_LocateInEditor);\n            _SubMenu_Element_Remove.OnNext(Strings.SubMenu_Element_Remove);\n            _SubMenu_Export_ExportForAndroid.OnNext(Strings.SubMenu_Export_ExportForAndroid);\n            _SubMenu_Export_ExportForAndroidEmulator.OnNext(Strings.SubMenu_Export_ExportForAndroidEmulator);\n            _SubMenu_Export_ExportForiOS.OnNext(Strings.SubMenu_Export_ExportForiOS);\n            _SubMenu_Export_ExportForiOSSimulator.OnNext(Strings.SubMenu_Export_ExportForiOSSimulator);\n            _SubMenu_Export_ExportForDotNet.OnNext(Strings.SubMenu_Export_ExportForDotNet);\n            _SubMenu_Export_ExportForNative.OnNext(Strings.SubMenu_Export_ExportForNative);\n            _SubMenu_Export_Clean.OnNext(Strings.SubMenu_Export_Clean);\n            _SubMenu_File_New.OnNext(Strings.SubMenu_File_New);\n            _SubMenu_File_Open.OnNext(Strings.SubMenu_File_Open);\n            _SubMenu_File_Quit.OnNext(Strings.SubMenu_File_Quit);\n            _SubMenu_File_Exit.OnNext(Strings.SubMenu_File_Exit);\n            _SubMenu_Help_Community.OnNext(Strings.SubMenu_Help_Community);\n            _SubMenu_Help_Documentation.OnNext(Strings.SubMenu_Help_Documentation);\n            _SubMenu_Help_Examples.OnNext(Strings.SubMenu_Help_Examples);\n            _SubMenu_Help_Tutorial.OnNext(Strings.SubMenu_Help_Tutorial);\n            _SubMenu_Help_Forums.OnNext(Strings.SubMenu_Help_Forums);\n            _SubMenu_Help_ReportIssue.OnNext(Strings.SubMenu_Help_ReportIssue);\n            _SubMenu_Updates_CheckForUpdates.OnNext(Strings.SubMenu_Updates_CheckForUpdates);\n            _SubMenu_Updates_CheckAutomatically.OnNext(Strings.SubMenu_Updates_CheckAutomatically);\n            _SubMenu_Updates_UpdateAvailable.OnNext(Strings.SubMenu_Updates_UpdateAvailable);\n            _SubMenu_Updates_DownloadLatestQuestion.OnNext(Strings.SubMenu_Updates_DownloadLatestQuestion);\n            _SubMenu_Preview_Android.OnNext(Strings.SubMenu_Preview_Android);\n            _SubMenu_Preview_AndroidEmulator.OnNext(Strings.SubMenu_Preview_AndroidEmulator);\n            _SubMenu_Preview_BuildFlags.OnNext(Strings.SubMenu_Preview_BuildFlags);\n            _SubMenu_Preview_iOS.OnNext(Strings.SubMenu_Preview_iOS);\n            _SubMenu_Preview_iOSSimulator.OnNext(Strings.SubMenu_Preview_iOSSimulator);\n            _SubMenu_Preview_Native.OnNext(Strings.SubMenu_Preview_Native);\n            _SubMenu_Preview_Rebuild.OnNext(Strings.SubMenu_Preview_Rebuild);\n            _SubMenu_Preview_Reconnect.OnNext(Strings.SubMenu_Preview_Reconnect);\n            _SubMenu_Preview_Refresh.OnNext(Strings.SubMenu_Preview_Refresh);\n            _SubMenu_Project_OpenFolder.OnNext(Strings.SubMenu_Project_OpenFolder);\n            _SubMenu_Project_OpenSublime.OnNext(Strings.SubMenu_Project_OpenSublime);\n            _SubMenu_Project_OpenVSCode.OnNext(Strings.SubMenu_Project_OpenVSCode);\n            _SubMenu_Project_OpenTerminal.OnNext(Strings.SubMenu_Project_OpenTerminal);\n            _SubMenu_Tools_InstallSDK.OnNext(Strings.SubMenu_Tools_InstallSDK);\n            _SubMenu_Tools_InstallAtomPlugin.OnNext(Strings.SubMenu_Tools_InstallAtomPlugin);\n            _SubMenu_Tools_InstallSublimePlugin.OnNext(Strings.SubMenu_Tools_InstallSublimePlugin);\n            _SubMenu_Tools_InstallVSCodeExtension.OnNext(Strings.SubMenu_Tools_InstallVSCodeExtension);\n            _SubMenu_Tools_Setup.OnNext(Strings.SubMenu_Tools_Setup);\n            _SubMenu_Tools_Config.OnNext(Strings.SubMenu_Tools_Config);\n            _SubMenu_Viewport_Close.OnNext(Strings.SubMenu_Viewport_Close);\n            _SubMenu_Viewport_Device.OnNext(Strings.SubMenu_Viewport_Device);\n            _SubMenu_Viewport_FlipAspect.OnNext(Strings.SubMenu_Viewport_FlipAspect);\n            _SubMenu_Viewport_Goback.OnNext(Strings.SubMenu_Viewport_Goback);\n            _SubMenu_Viewport_New.OnNext(Strings.SubMenu_Viewport_New);\n            _SubMenu_Viewport_Restart.OnNext(Strings.SubMenu_Viewport_Restart);\n            _SubMenu_Viewport_Selection.OnNext(Strings.SubMenu_Viewport_Selection);\n            _SubMenu_Window_CompactMode.OnNext(Strings.SubMenu_Window_CompactMode);\n            _SubMenu_Window_KeepWindowOnTop.OnNext(Strings.SubMenu_Window_KeepWindowOnTop);\n            _SubMenu_Window_Language.OnNext(Strings.SubMenu_Window_Language);\n            _SubMenu_Window_LightTheme.OnNext(Strings.SubMenu_Window_LightTheme);\n            _SubMenu_Window_DarkTheme.OnNext(Strings.SubMenu_Window_DarkTheme);\n            _Button_Ok.OnNext(Strings.Button_Ok);\n            _Dialog_SetupGuide_Caption.OnNext(Strings.Dialog_SetupGuide_Caption);\n            _Dialog_SetupGuide_Comment1.OnNext(Strings.Dialog_SetupGuide_Comment1);\n            _Dialog_SetupGuide_Comment2_1.OnNext(Strings.Dialog_SetupGuide_Comment2_1);\n            _Dialog_SetupGuide_Comment2_2.OnNext(Strings.Dialog_SetupGuide_Comment2_2);\n            _Dialog_SetupGuide_Comment2_3.OnNext(Strings.Dialog_SetupGuide_Comment2_3);\n            _Dialog_SetupGuide_Comment3.OnNext(Strings.Dialog_SetupGuide_Comment3);\n            _Dialog_SetupGuide_SeeAlso1.OnNext(Strings.Dialog_SetupGuide_SeeAlso1);\n            _Dialog_SetupGuide_SeeAlso2.OnNext(Strings.Dialog_SetupGuide_SeeAlso2);\n            _SubMenu_Project_SketchImport.OnNext(Strings.SubMenu_Project_SketchImport);\n            _Button_Done.OnNext(Strings.Button_Done);\n            _LogView_Tab_Clear.OnNext(Strings.LogView_Tab_Clear);\n            _LogView_Tab_Log.OnNext(Strings.LogView_Tab_Log);\n            _LogView_Tab_Problems.OnNext(Strings.LogView_Tab_Problems);\n            _Label_MacOnly.OnNext(Strings.Label_MacOnly);\n            _LanguageUpdated_Text.OnNext(Strings.LanguageUpdated_Text);\n            _NagScreen_Caption.OnNext(Strings.NagScreen_Caption);\n            _NagScreen_Text.OnNext(Strings.NagScreen_Text);\n            _NagScreen_Button_SignIn.OnNext(Strings.NagScreen_Button_SignIn);\n            _NagScreen_Button_EnterCode.OnNext(Strings.NagScreen_Button_EnterCode);\n            _NagScreen_Question.OnNext(Strings.NagScreen_Question);\n            _Toolbar_Selection_Tooltip.OnNext(Strings.Toolbar_Selection_Tooltip);\n            _Toolbar_Selection_Tooltip2.OnNext(Strings.Toolbar_Selection_Tooltip2);\n            _Toolbar_Selection_Button.OnNext(Strings.Toolbar_Selection_Button);\n            _Toolbar_Touch_Tooltip.OnNext(Strings.Toolbar_Touch_Tooltip);\n            _Toolbar_Touch_Button.OnNext(Strings.Toolbar_Touch_Button);\n            _Toolbar_Viewport_Tooltip.OnNext(Strings.Toolbar_Viewport_Tooltip);\n            _Toolbar_Viewport_Button.OnNext(Strings.Toolbar_Viewport_Button);\n            _Toolbar_Compact_Tooltip.OnNext(Strings.Toolbar_Compact_Tooltip);\n            _Toolbar_Compact_Button.OnNext(Strings.Toolbar_Compact_Button);\n            _Auth_Text_LicensedTo1.OnNext(Strings.Auth_Text_LicensedTo1);\n            _Auth_Text_LicensedTo2.OnNext(Strings.Auth_Text_LicensedTo2);\n            _Auth_Text_TrialDayLeft.OnNext(Strings.Auth_Text_TrialDayLeft);\n            _Auth_Text_TrialDaysLeft.OnNext(Strings.Auth_Text_TrialDaysLeft);\n            _Auth_Text_LicenseExpired1.OnNext(Strings.Auth_Text_LicenseExpired1);\n            _Auth_Text_LicenseExpired2.OnNext(Strings.Auth_Text_LicenseExpired2);\n            _Auth_Text_LicenseExpired3.OnNext(Strings.Auth_Text_LicenseExpired3);\n            _Auth_Text_SignIn1.OnNext(Strings.Auth_Text_SignIn1);\n            _Auth_Text_SignIn2.OnNext(Strings.Auth_Text_SignIn2);\n            _Auth_Text_SignIn3.OnNext(Strings.Auth_Text_SignIn3);\n            _About_Title.OnNext(Strings.About_Title);\n            _About_Menu.OnNext(Strings.About_Menu);\n            _About_RegisteredTo.OnNext(Strings.About_RegisteredTo);\n            _About_NotRegistered.OnNext(Strings.About_NotRegistered);\n            _About_Company.OnNext(Strings.About_Company);\n            _About_License.OnNext(Strings.About_License);\n            _About_Issued.OnNext(Strings.About_Issued);\n            _About_Expires.OnNext(Strings.About_Expires);\n            _About_Authority.OnNext(Strings.About_Authority);\n            _About_MoreInfo1.OnNext(Strings.About_MoreInfo1);\n            _About_MoreInfo2.OnNext(Strings.About_MoreInfo2);\n            _Activate_Title.OnNext(Strings.Activate_Title);\n            _Activate_Button.OnNext(Strings.Activate_Button);\n            _Activate_FeedbackEmpty.OnNext(Strings.Activate_FeedbackEmpty);\n            _Activate_FeedbackInvalid.OnNext(Strings.Activate_FeedbackInvalid);\n            _License_Error_Text.OnNext(Strings.License_Error_Text);\n            _Inspector_SelectSomething.OnNext(Strings.Inspector_SelectSomething);\n            _Toolbox_MakeClassFromSelection.OnNext(Strings.Toolbox_MakeClassFromSelection);\n            _Toolbox_YourClasses.OnNext(Strings.Toolbox_YourClasses);\n            _Toolbox_SearchYourClasses.OnNext(Strings.Toolbox_SearchYourClasses);\n            _Toolbox_DragClassesInto_Text.OnNext(Strings.Toolbox_DragClassesInto_Text);\n            _Toolbox_CreateAClass_Text.OnNext(Strings.Toolbox_CreateAClass_Text);\n            _CodeView_Devices.OnNext(Strings.CodeView_Devices);\n            _CodeView_ToolTip.OnNext(Strings.CodeView_ToolTip);\n            _LogView_AllOutput.OnNext(Strings.LogView_AllOutput);\n        }\n    }\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/Arrow.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic enum SymbolSize\n\t{\n\t\tSmall,\n\t\tMedium,\n\t\tLarge,\n\t\tContain,\n\t}\n\n\tpublic static class Arrow\n\t{\n\t\tpublic static IControl WithShaft(RectangleEdge edge, SymbolSize size = SymbolSize.Contain, Brush brush = default(Brush))\n\t\t{\n\t\t\tvar stroke = Stroke.Create(1.0, brush | Theme.Active);\n\n\t\t\treturn ResizeSymbol(edge, size, Control.BindNativeFrame(frame =>\n\t\t\t\tWithoutShaft(edge, brush, frame)\n\t\t\t\t\t.WithOverlay(\n\t\t\t\t\t\tedge.NormalAxis() == Axis2D.Horizontal\n\t\t\t\t\t\t\t? Shapes.Line(\n\t\t\t\t\t\t\t\tPoint.Create(frame.Left(), frame.Center().Y),\n\t\t\t\t\t\t\t\tPoint.Create(frame.Right(), frame.Center().Y),\n\t\t\t\t\t\t\t\tstroke)\n\t\t\t\t\t\t\t: Shapes.Line(\n\t\t\t\t\t\t\t\tPoint.Create(frame.Center().X, frame.Top()),\n\t\t\t\t\t\t\t\tPoint.Create(frame.Center().X, frame.Bottom()),\n\t\t\t\t\t\t\t\tstroke))))\n\t\t\t.WithBackground(Color.Transparent); // TODO: not sure why this is needed\n\t\t}\n\n\t\tpublic static IControl WithoutShaft(RectangleEdge edge, SymbolSize size = SymbolSize.Contain, Brush brush = default(Brush))\n\t\t{\n\t\t\treturn ResizeSymbol(edge, size, Control.BindNativeFrame(frame =>\n\t\t\t\tWithoutShaft(edge, brush, frame)))\n\t\t\t.WithBackground(Color.Transparent); // TODO: not sure why this is needed\n\t\t}\n\n\t\tstatic IControl ResizeSymbol(RectangleEdge edge, SymbolSize size, IControl control)\n\t\t{\n\t\t\tswitch (size)\n\t\t\t{\n\t\t\t\tcase SymbolSize.Small:\n\t\t\t\t\treturn control.WithSize(edge.NormalAxis() == Axis2D.Horizontal\n\t\t\t\t\t\t? Size.Create<Points>(4, 7)\n\t\t\t\t\t\t: Size.Create<Points>(7, 4));\n\t\t\t\tcase SymbolSize.Medium:\n\t\t\t\t\treturn control.WithSize(edge.NormalAxis() == Axis2D.Horizontal\n\t\t\t\t\t\t? Size.Create<Points>(5, 9)\n\t\t\t\t\t\t: Size.Create<Points>(9, 5));\n\t\t\t\tcase SymbolSize.Large:\n\t\t\t\t\treturn control.WithSize(edge.NormalAxis() == Axis2D.Horizontal\n\t\t\t\t\t\t? Size.Create<Points>(7, 13)\n\t\t\t\t\t\t: Size.Create<Points>(13, 7));\n\t\t\t\tdefault:\n\t\t\t\t\treturn control;\n\t\t\t}\n\t\t}\n\n\t\tstatic IControl WithoutShaft(RectangleEdge edge, Brush brush, Rectangle<IObservable<Points>> frame)\n\t\t{\n\t\t\tvar stroke = Stroke.Create(1.0, brush | Theme.Active);\n\n\t\t\tvar to = edge.NormalAxis() == Axis2D.Horizontal\n\t\t\t\t? Point.Create(frame.GetEdge(edge), frame.Center().Y)\n\t\t\t\t: Point.Create(frame.Center().X, frame.GetEdge(edge));\n\n\t\t\tvar width = frame[edge.NormalAxis().Opposite()].Length.Mul(0.5);\n\n\t\t\tvar bottom = Vector.Create(width, width);\n\t\t\tswitch (edge)\n\t\t\t{\n\t\t\t\tcase RectangleEdge.Bottom:\n\t\t\t\t\tbottom = bottom.RotateCCV();\n\t\t\t\t\tbreak;\n\t\t\t\tcase RectangleEdge.Right:\n\t\t\t\t\tbottom = bottom.RotateCCV().RotateCCV();\n\t\t\t\t\tbreak;\n\t\t\t\tcase RectangleEdge.Top:\n\t\t\t\t\tbottom = bottom.RotateCCV().RotateCCV().RotateCCV();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar top = bottom.RotateCCV();\n\n\t\t\treturn Layout.Layer(\n\t\t\t\tShapes.Line(to, to + top, stroke),\n\t\t\t\tShapes.Line(to, to + bottom, stroke));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Theming/Buttons.cs",
    "content": "using System.Reactive.Linq;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic static class Buttons\n\t{\n\t\tpublic static IControl CloseButton(\n\t\t\tCommand close,\n\t\t\tBrush idleColor,\n\t\t\tBrush pressedColor,\n\t\t\tint height = 11,\n\t\t\tint thickness = 1,\n\t\t\tint padding = 7)\n\t\t{\n\t\t\treturn Button.Create(\n\t\t\t\tclose,\n\t\t\t\tstates =>\n\t\t\t\t{\n\t\t\t\t\tvar color = states.IsPressed\n\t\t\t\t\t\t.Select(clicked => clicked ? pressedColor : idleColor)\n\t\t\t\t\t\t.Switch();\n\n\t\t\t\t\treturn MainWindowIcons\n\t\t\t\t\t\t.CloseIcon(new Points(height), Stroke.Create(thickness, color))\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(padding));\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IControl NotificationButton(Text text, Command cmd, Brush foreground)\n\t\t{\n\t\t\treturn SolidColorButton(text, cmd,\n\t\t\t\tforeground: foreground,\n\t\t\t\tbackground: Color.White,\n\t\t\t\thoverColor: Color.White,\n\t\t\t\taltTextColor: foreground);\n\t\t}\n\n\t\tpublic static IControl DefaultButtonPrimary(Text text, Command cmd)\n\t\t{\n\t\t\treturn SolidColorButton(text, cmd,\n\t\t\t\tforeground: Color.White,\n\t\t\t\tbackground: Theme.Active,\n\t\t\t\thoverColor: Theme.ActiveHover,\n\t\t\t\taltTextColor: Theme.Background);\n\t\t}\n\n\t\tpublic static IControl DefaultButton(Text text, Command cmd)\n\t\t{\n\t\t\treturn StrokeButton(text, cmd,\n\t\t\t\tforeground: Theme.Active,\n\t\t\t\tbackground: Color.Transparent,\n\t\t\t\thoverColor: Theme.ActiveHover);\n\t\t}\n\n\t\tstatic IControl SolidColorButton(Text text, Command cmd, Brush foreground, Brush background, Brush hoverColor, Brush altTextColor)\n\t\t{\n\t\t\treturn Button.Create(cmd,\n\t\t\t\t\tstate =>\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Center,\n\t\t\t\t\t\t\t\tfont: Theme.DescriptorFont,\n\t\t\t\t\t\t\t\tcolor: Theme.CurrentTheme.Select(theme => (\n\t\t\t\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t\t\t\t? Theme.DefaultText\n\t\t\t\t\t\t\t\t\t\t: foreground))\n\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t.Center()\n\t\t\t\t\t\t\t.WithBackground(Shapes.Rectangle(\n\t\t\t\t\t\t\t\tfill: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered,\n\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t? hoverColor\n\t\t\t\t\t\t\t\t\t\t\t\t: background)\n\t\t\t\t\t\t\t\t\t.Switch(),\n\t\t\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)))))\n\t\t\t\t\t.WithHeight(DefaultButtonHeight)\n\t\t\t\t\t.SetCursor(Cursor.Pointing);\n\n\t\t}\n\n\t\tstatic IControl StrokeButton(Text text, Command cmd, Brush foreground, Brush background, Brush hoverColor)\n\t\t{\n\t\t\treturn Button.Create(cmd,\n\t\t\t\t\t\tstate =>\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Center,\n\t\t\t\t\t\t\t\t\tfont: Theme.DescriptorFont,\n\t\t\t\t\t\t\t\t\tcolor: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered, Theme.CurrentTheme,\n\t\t\t\t\t\t\t\t\t\t\t(enabled, hovering, theme) =>\n\t\t\t\t\t\t\t\t\t\t\t\ttheme == Themes.OriginalDark && false\n\t\t\t\t\t\t\t\t\t\t\t\t\t? Theme.DefaultText\n\t\t\t\t\t\t\t\t\t\t\t\t\t: (hovering\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? hoverColor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: foreground))\n\t\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t\t.CenterVertically()\n\t\t\t\t\t\t\t\t.WithBackground(Shapes.Rectangle(\n\t\t\t\t\t\t\t\t\tfill: background,\n\t\t\t\t\t\t\t\t\tcornerRadius: Observable.Return(new CornerRadius(2)),\n\t\t\t\t\t\t\t\t\tstroke: Stroke.Create(1, Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered,\n\t\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t\t? hoverColor\n\t\t\t\t\t\t\t\t\t\t\t\t\t: foreground)\n\t\t\t\t\t\t\t\t\t\t.Switch()))))\n\t\t\t\t\t.WithHeight(DefaultButtonHeight)\n\t\t\t\t\t.SetCursor(Cursor.Pointing);\n\t\t}\n\n\t\tpublic static Points DefaultButtonHeight = 24;\n\n\t\tpublic static IControl TextButton(Text text, Command cmd, Brush color, Brush hoverColor, Font font)\n\t\t{\n\t\t\treturn Button.Create(cmd,\n\t\t\t\t\tstate =>\n\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t\t\ttextAlignment: TextAlignment.Left,\n\t\t\t\t\t\t\t\tfont: font,\n\t\t\t\t\t\t\t\tcolor: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\tstate.IsEnabled, state.IsHovered,\n\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\thovering\n\t\t\t\t\t\t\t\t\t\t\t\t? hoverColor\n\t\t\t\t\t\t\t\t\t\t\t\t: color)\n\t\t\t\t\t\t\t\t\t.Switch()))\n\t\t\t\t.SetCursor(Cursor.Pointing);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/CheckBox.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class CheckBox\n\t{\n\t\tpublic static IControl Create(IObservable<bool> enabled, Command toggle)\n\t\t{\n\t\t\tdouble outlineThickness = 1;\n\t\t\tvar cornerRadius = Observable.Return(new CornerRadius(3));\n\n\t\t\tvar enabledValue = enabled.Select(isEnabled => isEnabled ? 1.0 : 0.0).LowPass(0.3);\n\n\t\t\tvar foreground = Icons.Checkmark(Brush.Transparent.Mix(Theme.SwitchThumbFill, enabledValue)).Center();\n\n\t\t\tvar backgroundStroke = Stroke.Create(\n\t\t\t\tObservable.Return(outlineThickness),\n\t\t\t\tTheme.SwitchInactiveStroke.Mix(Theme.SwitchActiveStroke, enabledValue),\n\t\t\t\tObservable.Return(StrokeDashArray.Solid));\n\t\t\tvar backgroundBrush = Theme.SwitchInactiveBackground.Mix(Theme.SwitchActiveBackground, enabledValue);\n\t\t\tvar background =\n\t\t\t\tShapes.Rectangle(\n\t\t\t\t\tbackgroundStroke,\n\t\t\t\t\tbackgroundBrush,\n\t\t\t\t\tcornerRadius);\n\n\t\t\tvar content = foreground.WithBackground(background);\n\t\t\treturn Button.Create(\n\t\t\t\t\ttoggle,\n\t\t\t\t\tbuttonStates => content)\n\t\t\t\t.WithSize(new Size<Points>(17, 17));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Theming/LogoAndVersion.cs",
    "content": "using Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fuse.Studio\n{\n\tpublic static class LogoAndVersion\n\t{\n\t\tpublic static IControl Create(string fuseVersion)\n\t\t{\n\t\t\tvar versionStr = \"Version \" + fuseVersion;\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tLogo()\n\t\t\t\t\t.WithSize(new Size<Points>(336 * 0.75, 173 * 0.75))\n\t\t\t\t\t.WithPadding(top: new Points(20), bottom: new Points(5)),\n\t\t\t\tLabel.Create(\n\t\t\t\t\t\tversionStr,\n\t\t\t\t\t\tfont: Theme.DescriptorFont,\n\t\t\t\t\t\tcolor: Theme.DescriptorText,\n\t\t\t\t\t\ttextAlignment: TextAlignment.Center)\n\t\t\t\t\t.WithPadding(new Thickness<Points>(0, 0, 0, 10)));\n\t\t}\n\n\t\tpublic static IControl Logo()\n\t\t{\n\t\t\treturn Theme.CurrentTheme.Select(\n\t\t\t\t\ttheme => Image.FromResource(\n\t\t\t\t\t\ttheme == Themes.OriginalDark\n\t\t\t\t\t\t\t? \"Outracks.Fuse.Icons.FuseProLogo_dark.png\"\n\t\t\t\t\t\t\t: \"Outracks.Fuse.Icons.FuseProLogo_light.png\", typeof(LogoAndVersion).Assembly))\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/Modal.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic interface IModalHost\n\t{\n\t\tvoid OpenModal(Func<Command, IControl> show);\n\t}\n\n\tpublic static class Modal\n\t{\n\t\tpublic static IControl Host(Func<IModalHost, IControl> content)\n\t\t{\n\t\t\tvar modalHost = new Implementation();\n\t\t\treturn content(modalHost).WithNativeOverlay(modalHost.OverlayControls.Layer());\n\t\t}\n\n\t\tclass Implementation : IModalHost\n\t\t{\n\t\t\treadonly BehaviorSubject<IEnumerable<IControl>> overlayControls = new BehaviorSubject<IEnumerable<IControl>>(ImmutableList<IControl>.Empty);\n\n\t\t\tpublic IObservable<IEnumerable<IControl>> OverlayControls\n\t\t\t{\n\t\t\t\tget { return overlayControls; }\n\t\t\t}\n\n\t\t\tpublic void OpenModal(Func<Command, IControl> show)\n\t\t\t{\n\t\t\t\tIControl modalContent = null;\n\t\t\t\tvar closeCommand = Command.Enabled(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (modalContent != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.overlayControls.OnNext(new IControl[] {});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\tmodalContent = show(closeCommand);\n\t\t\t\tthis.overlayControls.OnNext(new [] { modalContent });\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Theming/Popover.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic class PopoverState\n\t{\n\t\tpublic BehaviorSubject<bool> IsVisible { get; set; }\n\t}\n\n\tpublic interface IPopover\n\t{\n\t\tIControl CreatePopover(\n\t\t\tRectangleEdge prefferedContentEdge,\n\t\t\tFunc<PopoverState, IControl> content,\n\t\t\tFunc<PopoverState, IControl> popover);\n\t}\n\n\tpublic static class Popover\n\t{\n\t\tpublic static IControl Host(Func<IPopover, IControl> content)\n\t\t{\n\t\t\treturn LayoutTracker.Create(tracker =>\n\t\t\t{\n\t\t\t\tvar hostFrame = new ReplaySubject<Rectangle<IObservable<Points>>>(1);\n\t\t\t\tvar host = new Implementation\n\t\t\t\t{\n\t\t\t\t\tLayoutTracker = tracker,\n\t\t\t\t\tPopovers = new BehaviorSubject<IImmutableList<IControl>>(ImmutableList<IControl>.Empty),\n\t\t\t\t\tHostFrame = hostFrame\n\t\t\t\t};\n\n\t\t\t\treturn content(host)\n\t\t\t\t\t.WithNativeOverlay(host.Popovers.Layer())\n\t\t\t\t\t.WithFrame(\n\t\t\t\t\t\tframe =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thostFrame.OnNext(frame);\n\t\t\t\t\t\t\treturn frame;\n\t\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tclass Implementation : IPopover\n\t\t{\n\t\t\tpublic ILayoutTracker LayoutTracker;\n\t\t\tpublic BehaviorSubject<IImmutableList<IControl>> Popovers;\n\t\t\tpublic IObservable<Rectangle<IObservable<Points>>> HostFrame;\n\n\t\t\tpublic IControl CreatePopover(\n\t\t\t\tRectangleEdge prefferedContentEdge,\n\t\t\t\tFunc<PopoverState, IControl> content,\n\t\t\t\tFunc<PopoverState, IControl> popover)\n\t\t\t{\n\t\t\t\tvar state = new PopoverState\n\t\t\t\t{\n\t\t\t\t\tIsVisible = new BehaviorSubject<bool>(false),\n\t\t\t\t};\n\n\t\t\t\tvar contentFrameState = new ReplaySubject<Rectangle<Points>>(1);\n\t\t\t\tvar contentFrame = contentFrameState.Transpose();\n\n\t\t\t\tvar center = contentFrame.Center();\n\n\t\t\t\tvar arrow = Shapes.Rectangle(fill: Theme.PanelBackground)\n\t\t\t\t\t.WithSize(new Size<Points>(13,13))\n\t\t\t\t\t.Rotate(Math.PI / 4)\n\t\t\t\t\t;\n\n\t\t\t\tvar popoverContent = Control.Lazy(() => popover(state));\n\n\t\t\t\tvar desiredContentEdge = contentFrame.GetEdge(prefferedContentEdge)\n\t\t\t\t\t.Add(popoverContent.DesiredSize.Height);\n\t\t\t\tvar desiredHostEdge = HostFrame.Switch().GetEdge(prefferedContentEdge);\n\n\t\t\t\tvar adjustedEdge = desiredContentEdge\n\t\t\t\t\t.CombineLatest(desiredHostEdge, (a, b) => a >= b)\n\t\t\t\t\t// Put popover on the opposite edge if there are not enough room for it on the preffered edge.\n\t\t\t\t\t.Select(opposite => opposite ? prefferedContentEdge.Opposite() : prefferedContentEdge);\n\n\t\t\t\tvar arrowStartOffsetY = adjustedEdge\n\t\t\t\t\t.Select(e =>\n\t\t\t\t\t\te.IsMinimal()\n\t\t\t\t\t\t? contentFrame.GetEdge(e).Sub(arrow.DesiredSize.Height)\n\t\t\t\t\t\t: contentFrame.GetEdge(e).Sub(4))\n\t\t\t\t\t.Switch();\n\n\t\t\t\tvar contentStartOffsetY = adjustedEdge\n\t\t\t\t\t.Select(e =>\n\t\t\t\t\t\te.IsMinimal()\n\t\t\t\t\t\t? contentFrame.GetEdge(e).Sub(popoverContent.DesiredSize.Height).Sub(arrow.DesiredSize.Height.Div(2))\n\t\t\t\t\t\t: contentFrame.GetEdge(e).Add(arrow.DesiredSize.Height.Div(2)).Sub(4))\n\t\t\t\t\t.Switch();\n\n\t\t\t\tvar close = Command.Enabled(() => state.IsVisible.OnNext(false));\n\n\t\t\t\tvar popoverControl = Control.Lazy(() =>\n\t\t\t\t\tLayout.Layer(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar widthInterval = Observable.CombineLatest(\n\t\t\t\t\t\t\tself.NativeFrame.Width,\n\t\t\t\t\t\t\tpopoverContent.DesiredSize.Width,\n\t\t\t\t\t\t\tcenter.X,\n\t\t\t\t\t\t\t(availableWidth, desiredWidth, desiredCenter) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdesiredWidth += 8;// dropshadow compensation\n\t\t\t\t\t\t\t\tvar halfWidth = desiredWidth / 2;\n\n\t\t\t\t\t\t\t\treturn Interval.FromOffsetLength(\n\t\t\t\t\t\t\t\t\toffset:\n\t\t\t\t\t\t\t\t\t\tdesiredCenter - halfWidth < 0\n\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t: desiredCenter + halfWidth > availableWidth\n\t\t\t\t\t\t\t\t\t\t\t\t? availableWidth - desiredWidth\n\t\t\t\t\t\t\t\t\t\t\t\t: desiredCenter - halfWidth,\n\t\t\t\t\t\t\t\t\tlength:\n\t\t\t\t\t\t\t\t\t\tavailableWidth.Min(desiredWidth));\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn Observable.Return(\n\t\t\t\t\t\t\tnew[]\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tShapes.Rectangle(fill: Color.AlmostTransparent).OnMouse(pressed: close),\n\t\t\t\t\t\t\t\tarrow\n\t\t\t\t\t\t\t\t\t.WithFixedPosition(\n\t\t\t\t\t\t\t\t\t\tRectangle.FromIntervals(\n\t\t\t\t\t\t\t\t\t\t\tInterval.FromOffsetLength(center.X.Sub(arrow.DesiredSize.Width.Div(2)).Sub(4), arrow.DesiredSize.Width),\n\t\t\t\t\t\t\t\t\t\t\tInterval.FromOffsetLength(arrowStartOffsetY, arrow.DesiredSize.Height))),\n\t\t\t\t\t\t\t\tpopoverContent\n\t\t\t\t\t\t\t\t\t.WithBackground(\n\t\t\t\t\t\t\t\t\t\tShapes.Rectangle(fill: Theme.PanelBackground, cornerRadius: Observable.Return(new CornerRadius(2))))\n\t\t\t\t\t\t\t\t\t.MakeHittable().Control\n\t\t\t\t\t\t\t\t\t.WithFixedPosition(\n\t\t\t\t\t\t\t\t\t\tRectangle.FromIntervals(\n\t\t\t\t\t\t\t\t\t\t\twidthInterval.Transpose(),\n\t\t\t\t\t\t\t\t\t\t\tInterval.FromOffsetLength(contentStartOffsetY, popoverContent.DesiredSize.Height)))\n\t\t\t\t\t\t\t});\n\t\t\t\t\t})\n\t\t\t\t\t.DropShadow(radius: Observable.Return(new Points(4)), distance: Observable.Return(new Points(0.5))));\n\n\t\t\t\tstate.IsVisible.SubscribeUsing(isVisible =>\n\t\t\t\t\tisVisible ? Popovers.AddTemporarily(popoverControl) : Disposable.Empty);\n\n\t\t\t\treturn LayoutTracker.TrackVisualBounds(contentFrameState.OnNext, content(state));\n\t\t\t}\n\t\t}\n\n\t\tstatic IControl Rotate(this IControl control, double t)\n\t\t{\n\t\t\treturn control.WithTransformation(Observable.Return(Matrix.Rotate(t)));\n\t\t}\n\n\t\tstatic IDisposable AddTemporarily(this BehaviorSubject<IImmutableList<IControl>> list, IControl control)\n\t\t{\n\t\t\tlist.OnNext(list.Value.Add(control));\n\t\t\treturn Disposable.Create(() => list.OnNext(list.Value.Remove(control)));\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/Separator.cs",
    "content": "using System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class Separator\n\t{\n\t\tpublic static Stroke WeakStroke\n\t\t{\n\t\t\tget { return Stroke.Create(1, Theme.WeakLineBrush); }\n\t\t}\n\n\t\tpublic static Stroke MediumStroke\n\t\t{\n\t\t\tget { return Stroke.Create(1, Theme.LineBrush); }\n\t\t}\n\n\t\tpublic static IControl Weak\n\t\t{\n\t\t\tget { return Line(WeakStroke); }\n\t\t}\n\t\tpublic static IControl Shadow\n\t\t{\n\t\t\tget { return Layout.StackFromTop(\n\t\t\t\tLine(MediumStroke),\n\t\t\t\tLine(WeakStroke)); }\n\t\t}\n\n\n\t\tpublic static IControl Medium\n\t\t{\n\t\t\tget { return Line(MediumStroke); }\n\t\t}\n\n\t\tpublic static IControl Field\n\t\t{\n\t\t\tget { return Line(Theme.FieldStroke); }\n\t\t}\n\n\t\tpublic static IControl HorizontalLine(Brush brush, Points thickness)\n\t\t{\n\t\t\treturn Shapes.Rectangle(fill: brush).WithHeight(thickness).WithWidth(thickness);\n\t\t}\n\n\t\tpublic static IControl Line(Stroke stroke)\n\t\t{\n\t\t\treturn Shapes.Rectangle(fill: stroke.Brush)\n\t\t\t\t.WithWidth(stroke.Thickness.Select(p => new Points(p)))\n\t\t\t\t.WithHeight(stroke.Thickness.Select(p => new Points(p)));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Theming/Spacer.cs",
    "content": "\nusing Outracks.Diagnostics;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class Spacer\n\t{\n\t\tpublic static IControl Line { get { return Control.Empty.WithSize(new Size<Points>(1, 1)); } }\n\t\tpublic static IControl Smaller { get { return Control.Empty.WithSize(new Size<Points>(3, 3)); } }\n\t\tpublic static IControl Small { get { return Control.Empty.WithSize(new Size<Points>(7, 7)); } }\n\t\tpublic static IControl Small2 { get { return Control.Empty.WithSize(new Size<Points>(9, 9)); } }\n\t\tpublic static IControl Medim { get { return Control.Empty.WithSize(new Size<Points>(13, 13)); } }\n\t\tpublic static IControl Medium { get { return Control.Empty.WithSize(new Size<Points>(15, 15)); } }\n\n\t\tpublic static IControl WithMediumPadding(this IControl control)\n\t\t{\n\t\t\treturn control.WithPadding(new Thickness<Points>(15));\n\t\t}\n\n\t\tpublic static IControl WithInspectorPadding(this IControl control)\n\t\t{\n\t\t\treturn control.WithPadding(new Thickness<Points>(15, 0, 16, 0));\n\t\t}\n\n\t\tpublic static IControl WithMacWindowStyleCompensation(this IControl control)\n\t\t{\n\t\t\treturn control.WithPadding(new Thickness<Points>(0, Platform.IsMac ? 37 : 0, 0, 0));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/Theme.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fuse.Theming.Themes;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic static class Theme\n\t{\n\t\tpublic static readonly IProperty<Themes> CurrentTheme =\n\t\t\tUserSettings\n\t\t\t\t.Enum<Themes>(\"Theme\")\n\t\t\t\t.Or(Themes.OriginalDark)\n\t\t\t\t.AutoInvalidate();\n\n\t\tpublic static Stroke SelectionStroke(IObservable<bool> isSelected, IObservable<bool> isHovering, IObservable<bool> showOutline)\n\t\t{\n\t\t\treturn Stroke.Create(\n\t\t\t\tisSelected.CombineLatest(isHovering, showOutline,\n\t\t\t\t\t(selected, hovering, outline) =>\n\t\t\t\t\t\t(hovering || selected ? 1.0 : 0.0) +\n\t\t\t\t\t\t(outline ? 1.0 : 0.0)),\n\t\t\t\tLink, // Edited for new logo, was: Active,\n\t\t\t\tisSelected.Select(selected => selected ? StrokeDashArray.Solid : new StrokeDashArray(4,4)));\n\t\t}\n\n\t\tpublic static IControl Header(Text text, IObservable<bool> isDisabled = null)\n\t\t{\n\t\t\tisDisabled = isDisabled ?? Observable.Return(false);\n\t\t\treturn Label\n\t\t\t\t.Create(text, font: DefaultFont, color: isDisabled.Select(d => d ? DisabledText : DefaultText).Switch())\n\t\t\t\t.CenterVertically();\n\t\t}\n\n\n\t\tpublic static Brush IconBrush\n\t\t{\n\t\t\tget { return Color.FromRgb(0x838994); }\n\t\t}\n\n\t\tpublic static Brush NotificationBrush\n\t\t{\n\t\t\tget { return Color.FromRgb(0xE35667); }\n\t\t}\n\t\tpublic static Brush NotificationBarBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x2377B3); }\n\t\t}\n\n\t\tpublic static Brush NotificationBarForground\n\t\t{\n\t\t\tget { return Color.White; }\n\t\t}\n\t\tpublic static Brush ErrorColor\n\t\t{\n\t\t\tget { return Color.FromRgb(0xBF504C); }\n\t\t}\n\n\t\tpublic static Brush BuildBarBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x8374D4); }\n\t\t}\n\n\t\tpublic static Brush BuildBarForeground\n\t\t{\n\t\t\tget { return Color.White; }\n\t\t}\n\n\t\tpublic static Brush ReifyBarBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x6CC4B4); }\n\t\t}\n\n\t\tpublic static Brush ReifyBarForeground\n\t\t{\n\t\t\tget { return Color.White; }\n\t\t}\n\n\t\tpublic static IObservable<bool> IsDark\n\t\t{\n\t\t\tget { return CurrentTheme.Select(t => t == Themes.OriginalDark).Replay(1).RefCount(); }\n\t\t}\n\n\t\tstatic Theme()\n\t\t{\n\t\t\tvar themeInstance =\n\t\t\t\tCurrentTheme.Select(theme =>\n\t\t\t\t{\n\t\t\t\t\tswitch (theme)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase Themes.OriginalLight:\n\t\t\t\t\t\t\treturn (ITheme)new OriginalLightTheme();\n\n\t\t\t\t\t\tcase Themes.OriginalDark:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn (ITheme)new OriginalDarkTheme();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\tLineBrush = themeInstance.Select(x => (Brush)x.LineBrush).Switch();\n\t\t\tWeakLineBrush = themeInstance.Select(x => x.WeakLineBrush).Switch();\n\t\t\tBackground = themeInstance.Select(x => x.Background).Switch();\n\t\t\tPanelBackground = themeInstance.Select(x => x.PanelBackground).Switch();\n\t\t\tWorkspaceBackground = themeInstance.Select(x => x.WorskpaceBackground).Switch();\n\t\t\tTopBarBackground = themeInstance.Select(x => x.TopBarBackground).Switch();\n\t\t\tDefaultText = themeInstance.Select(x => x.DefaultText).Switch();\n\t\t\tDisabledText = themeInstance.Select(x => x.DisabledText).Switch();\n\t\t\tDescriptorText = themeInstance.Select(x => x.DescriptorText).Switch();\n\t\t\tActive = themeInstance.Select(x => x.Active).AsBrush();\n\t\t\tActiveHover = themeInstance.Select(x => x.ActiveHover).Switch();\n\t\t\tPurple = themeInstance.Select(x => x.Purple).Switch();\n\t\t\tLink = themeInstance.Select(x => x.Link).Switch();\n\t\t\tMargin =  themeInstance.Select(x => x.Margin).Switch();\n\t\t\tPadding = themeInstance.Select(x => x.Padding).Switch();\n\t\t\tFieldBackground = themeInstance.Select(x => x.FieldBackground).Switch();\n\t\t\tFieldStroke =  themeInstance.Select(x => x.FieldStroke).Switch();\n\t\t\tFieldFocusStroke = themeInstance.Select(x => x.FieldFocusStroke).Switch();\n\t\t\tFieldErrorStroke = themeInstance.Select(x => x.FieldErrorStroke).Switch();\n\t\t\tShadow = themeInstance.Select(x => x.Shadow).Switch();\n\t\t\tDefaultFont = themeInstance.Select(x => x.DefaultFont).Switch();\n\t\t\tDefaultFontBold = themeInstance.Select(x => x.DefaultFontBold).Switch();\n\t\t\tDescriptorFont = themeInstance.Select(x => x.DescriptorFont).Switch();\n\t\t\tHeaderFont = themeInstance.Select(x => x.HeaderFont).Switch();\n\t\t\tSplashTextColor = themeInstance.Select(x => x.SplashTextColor).Switch();\n\t\t\tSplashSelectColor = themeInstance.Select(x => x.SplashSelectColor).Switch();\n\t\t\tIconPrimary = themeInstance.Select(x => x.IconPrimary).AsBrush();\n\t\t\tIconSecondary = themeInstance.Select(x => x.IconSecondary).AsBrush();\n\t\t\tOutlineVerticalLineBackground = themeInstance.Select(x => x.OutlineVerticalLineBackground).Switch();\n\t\t\tSplashBackground = themeInstance.Select(x => x.SplashBackground).Switch();\n\t\t\tSplashPanelBackground = themeInstance.Select(x => x.SplashPanelBackground).Switch();\n\t\t\tSplashLink = themeInstance.Select(x => x.SplashLink).Switch();\n\t\t\tSplashActive = themeInstance.Select(x => x.SplashActive).Switch();\n\t\t\tSwitchInactiveBackground = themeInstance.Select(x => x.SwitchInactiveBackground).Switch();\n\t\t\tSwitchInactiveStroke = themeInstance.Select(x => x.SwitchInactiveStroke).Switch();\n\t\t\tSwitchActiveBackground = themeInstance.Select(x => x.SwitchActiveBackground).Switch();\n\t\t\tSwitchActiveStroke = themeInstance.Select(x => x.SwitchActiveStroke).Switch();\n\t\t\tSwitchThumbFill = themeInstance.Select(x => x.SwitchThumbFill).Switch();\n\t\t\tSwitchThumbStroke =  themeInstance.Select(x => x.SwitchThumbStroke).Switch();\n\t\t\tOutlineIcon = themeInstance.Select(x => x.OutlineIcon).Switch();\n\t\t\tCancel = themeInstance.Select(x => x.Cancel).Switch();\n\t\t\tFaintBackground = themeInstance.Select(x => x.FaintBackground).Switch();\n\t\t\tExtremelyFaintBackground = themeInstance.Select(x => x.FaintBackground).Switch();\n\t\t\tIconColorMap = themeInstance.Select(x => x.IconColorMap).Switch();\n\t\t}\n\n\t\tpublic static Brush LineBrush { get; private set; }\n\t\tpublic static Brush WeakLineBrush { get; private set; }\n\t\tpublic static Brush Background { get; private set; }\n\t\tpublic static Brush PanelBackground { get; private set; }\n\t\tpublic static Brush WorkspaceBackground { get; private set; }\n\t\tpublic static Brush TopBarBackground { get; private set; }\n\t\tpublic static Brush DefaultText { get; private set; }\n\t\tpublic static Brush DisabledText { get; private set; }\n\t\tpublic static Brush DescriptorText { get; private set; }\n\t\tpublic static Brush Active { get; private set; }\n\t\tpublic static Brush ActiveHover { get; private set; }\n\t\tpublic static Brush Purple { get; private set; }\n\t\tpublic static Brush Link { get; private set; }\n\t\tpublic static Brush Margin { get; private set; }\n\t\tpublic static Brush Padding { get; private set; }\n\t\tpublic static Brush FieldBackground { get; private set; }\n\t\tpublic static Stroke FieldStroke { get; private set; }\n\t\tpublic static Stroke FieldFocusStroke { get; private set; }\n\t\tpublic static Stroke FieldErrorStroke { get; private set; }\n\t\tpublic static Brush Shadow { get; private set; }\n\t\tpublic static Font DefaultFont { get; private set; }\n\t\tpublic static Font DefaultFontBold { get; private set; }\n\t\tpublic static Font DescriptorFont { get; private set; }\n\t\tpublic static Font HeaderFont { get; private set; }\n\t\tpublic static Brush SplashTextColor { get; private set; }\n\t\tpublic static Brush SplashSelectColor { get; private set; }\n\t\tpublic static Brush IconPrimary { get; private set; }\n\t\tpublic static Brush IconSecondary { get; private set; }\n\t\tpublic static Brush OutlineVerticalLineBackground { get; private set; }\n\t\tpublic static Brush SplashBackground { get; private set; }\n\t\tpublic static Brush SplashPanelBackground { get; private set; }\n\t\tpublic static Brush SplashLink { get; private set; }\n\t\tpublic static Brush SplashActive { get; private set; }\n\t\tpublic static Brush SwitchInactiveBackground { get; private set; }\n\t\tpublic static Brush SwitchInactiveStroke { get; private set; }\n\t\tpublic static Brush SwitchActiveBackground { get; private set; }\n\t\tpublic static Brush SwitchActiveStroke { get; private set; }\n\t\tpublic static Brush SwitchThumbFill { get; private set; }\n\t\tpublic static Brush SwitchThumbStroke { get; private set; }\n\t\tpublic static Brush OutlineIcon { get; private set; }\n\t\tpublic static Brush Cancel { get; private set; }\n\t\tpublic static Brush FaintBackground { get; private set; }\n\t\tpublic static Brush ExtremelyFaintBackground { get; private set; }\n\t\tpublic static IObservable<IColorMap> IconColorMap { get; private set; }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/ThemedButton.cs",
    "content": "﻿using System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ThemedButton\n\t{\n\t\tpublic static IControl Create(\n\t\t\tCommand command,\n\t\t\tText label,\n\t\t\tIControl icon = null,\n\t\t\tText tooltip = default(Text),\n\t\t\tBrush hoverColor = default(Brush))\n\t\t{\n\t\t\ticon = icon ?? Control.Empty;\n\t\t\thoverColor = hoverColor | Theme.Purple;\n\t\t\treturn Button.Create(\n\t\t\t\t\tcommand,\n\t\t\t\t\tbs => Layout.StackFromLeft(\n\t\t\t\t\t\t\ticon.WithPadding(new Thickness<Points>(7, 0)).CenterVertically(),\n\t\t\t\t\t\t\tLabel.Create(\n\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\tTheme.DefaultFont,\n\t\t\t\t\t\t\t\t\tcolor: Observable.CombineLatest(\n\t\t\t\t\t\t\t\t\t\tbs.IsEnabled, bs.IsHovered,\n\t\t\t\t\t\t\t\t\t\t(enabled, hovering) =>\n\t\t\t\t\t\t\t\t\t\t\tenabled\n\t\t\t\t\t\t\t\t\t\t\t\t? (hovering ? hoverColor : Theme.DefaultText)\n\t\t\t\t\t\t\t\t\t\t\t\t: Theme.DisabledText)\n\t\t\t\t\t\t\t\t\t\t.Switch())\n\t\t\t\t\t\t\t\t.CenterVertically())\n\t\t\t\t\t\t.Center(),\n\t\t\t\t\ttooltip)\n\t\t\t\t.WithHeight(32);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Theming/ThemedTextBox.cs",
    "content": "﻿using System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tpublic class ThemedTextBox\n\t{\n\t\tpublic static IControl Create(IProperty<string> editString, bool doWrap = false)\n\t\t{\n\t\t\tvar isReadOnly = editString.IsReadOnly.Replay(1).RefCount();\n\n\t\t\treturn TextBox.Create(\n\t\t\t\t\ttext: editString,\n\t\t\t\t\tforegroundColor: isReadOnly.Select(\n\t\t\t\t\t\tro => ro\n\t\t\t\t\t\t\t? Theme.DescriptorText  // this looks correct, but maybe there should be an \"InactiveText\" property in theme too? */\n\t\t\t\t\t\t\t: Theme.DefaultText)\n\t\t\t\t\t\t.Switch(),\n\t\t\t\t\tdoWrap: doWrap)\n\t\t\t\t.WithPadding(new Thickness<Points>(6, 2))\n\t\t\t\t.WithBackground(isReadOnly.Select(ro => ro ? Brush.Transparent : Theme.FieldBackground).Switch())\n\t\t\t\t.WithOverlay(Shapes.Rectangle(stroke: Theme.FieldStroke))\n\t\t\t\t.WithHeight(21)\n\t\t\t\t.CenterVertically();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Theming/Themes/ColorMap.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Fuse.Theming.Themes\n{\n\tclass ColorMap : IColorMap\n\t{\n\t\tpublic static readonly ColorMap Singleton = new ColorMap();\n\n\t\tstatic readonly Color OldActive = Color.FromRgb(0x6dc0d2);\n\t\tstatic readonly Color LinkColor = Color.FromRgb(0x707aff);\n\n\t\tpublic Color Map(Color color)\n\t\t{\n\t\t\tif (color == OldActive)\n\t\t\t\treturn LinkColor;\n\n\t\t\treturn color;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/Themes/ITheme.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Theming.Themes\n{\n\tinternal interface ITheme\n\t{\n\t\tColor LineBrush { get; }\n\t\tBrush WeakLineBrush { get; }\n\t\tBrush Background { get; }\n\t\tBrush PanelBackground { get; }\n\t\tBrush WorskpaceBackground { get; }\n\t\tBrush TopBarBackground { get; }\n\t\tBrush DefaultText { get; }\n\t\tBrush DisabledText { get; }\n\t\tBrush DescriptorText { get; }\n\t\tColor Active { get; }\n\t\tBrush ActiveHover { get; }\n\t\tBrush Purple { get; }\n\t\tBrush Link { get; }\n\t\tBrush Margin { get; }\n\t\tBrush Padding { get; }\n\t\tBrush FieldBackground { get; }\n\t\tStroke FieldStroke { get; }\n\t\tStroke FieldFocusStroke { get; }\n\t\tStroke FieldErrorStroke { get; }\n\t\tBrush Shadow { get; }\n\t\tFont DefaultFont { get; }\n\t\tFont DefaultFontBold { get; }\n\t\tFont DescriptorFont { get; }\n\t\tFont HeaderFont { get; }\n\t\tBrush SplashTextColor { get; }\n\t\tBrush SplashSelectColor { get; }\n\t\tColor IconPrimary { get; }\n\t\tColor IconSecondary { get; }\n\t\tBrush OutlineVerticalLineBackground { get; }\n\t\tBrush SplashBackground { get; }\n\t\tBrush SplashPanelBackground { get; }\n\t\tBrush SplashLink { get; }\n\t\tBrush SplashActive { get; }\n\t\tBrush SwitchInactiveBackground { get; }\n\t\tBrush SwitchInactiveStroke { get; }\n\t\tBrush SwitchActiveBackground { get; }\n\t\tBrush SwitchActiveStroke { get; }\n\t\tBrush SwitchThumbFill { get; }\n\t\tBrush SwitchThumbStroke { get; }\n\t\tBrush OutlineIcon { get; }\n\t\tBrush Cancel { get; }\n\t\tBrush FaintBackground { get; }\n\t\tBrush ExtremelyFaintBackground { get; }\n\t\tIObservable<IColorMap> IconColorMap { get; }\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/Theming/Themes/OriginalDarkTheme.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Theming.Themes\n{\n\tinternal class OriginalDarkTheme : ITheme\n\t{\n\t\tpublic Color LineBrush\n\t\t{\n\t\t\tget { return Color.FromRgb(0x15191e); }\n\t\t}\n\n\t\tpublic Brush WeakLineBrush\n\t\t{\n\t\t\tget { return Color.FromRgb(0x2a2d33); }\n\t\t}\n\n\t\tpublic Brush Background\n\t\t{\n\t\t\tget { return Color.FromRgb(0x31343a); }\n\t\t}\n\n\t\tpublic Brush PanelBackground\n\t\t{\n\t\t\tget { return Background; }\n\t\t}\n\n\t\tpublic Brush WorskpaceBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x15191e); }\n\t\t}\n\n\t\tpublic Brush TopBarBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x31343a); }\n\t\t}\n\n\t\tpublic Brush DefaultText\n\t\t{\n\t\t\tget { return Color.FromRgb(0xe6e6e6); }\n\t\t}\n\n\t\tpublic Brush DisabledText\n\t\t{\n\t\t\tget { return Color.FromRgb(0x7f7f7f); }\n\t\t}\n\n\t\tpublic Brush DescriptorText\n\t\t{\n\t\t\tget { return Color.FromRgb(0x808080); }\n\t\t}\n\n\t\tpublic Color Active\n\t\t{\n\t\t\tget { return Color.FromRgb(0x4953d7); }\n\t\t}\n\n\t\tpublic Brush ActiveHover\n\t\t{\n\t\t\tget { return Color.FromRgb(0x5460fa); }\n\t\t}\n\n\t\tpublic Brush Purple\n\t\t{\n\t\t\tget { return Color.FromRgb(0xfd71ff); }\n\t\t}\n\n\t\tpublic Brush Link\n\t\t{\n\t\t\tget { return Color.FromRgb(0x707aff); }\n\t\t}\n\n\t\tpublic Brush Margin\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Brush Padding\n\t\t{\n\t\t\tget { return Color.FromRgb(0xda394c); }\n\t\t}\n\n\t\tpublic Brush FieldBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x2a2d33); }\n\t\t}\n\n\t\tpublic Stroke FieldStroke\n\t\t{\n\t\t\tget { return Stroke.Create(1, Color.FromRgb(0x5c5f66)); }\n\t\t}\n\n\t\tpublic Stroke FieldFocusStroke\n\t\t{\n\t\t\tget { return FieldStroke; }\n\t\t}\n\n\t\tpublic Stroke FieldErrorStroke\n\t\t{\n\t\t\tget { return Stroke.Create(1, Color.FromRgb(0xdd4a5c)); }\n\t\t}\n\n\t\tpublic Brush Shadow\n\t\t{\n\t\t\tget { return Color.FromRgb(0x111111); }\n\t\t}\n\n\t\tpublic Font DefaultFont\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 11.0);\n\t\t\t}\n\t\t}\n\t\tpublic Font DefaultFontBold\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 11.0, bold: true);\n\t\t\t}\n\t\t}\n\n\t\tpublic Font DescriptorFont\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 11.0);\n\t\t\t}\n\t\t}\n\n\t\tpublic Font HeaderFont\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 13.0);\n\t\t\t}\n\t\t}\n\n\t\tpublic Brush SplashTextColor\n\t\t{\n\t\t\tget { return Color.FromRgb(0x676767); }\n\t\t}\n\n\t\tpublic Brush SplashSelectColor\n\t\t{\n\t\t\tget { return Color.FromRgb(0xf2f2f2); }\n\t\t}\n\n\t\tpublic Color IconPrimary\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Color IconSecondary\n\t\t{\n\t\t\tget { return Color.FromRgb(0x999999); }\n\t\t}\n\n\t\tpublic Brush OutlineVerticalLineBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x343840); }\n\t\t}\n\n\t\tpublic Brush SplashBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x3F434B); }\n\t\t}\n\n\t\tpublic Brush SplashPanelBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0xFCFCFC); }\n\t\t}\n\n\t\tpublic Brush SplashLink\n\t\t{\n\t\t\tget { return Color.FromRgb(0x62a1b1); }\n\t\t}\n\n\t\tpublic Brush SplashActive\n\t\t{\n\t\t\tget { return Color.FromRgb(0x6dc0d2); }\n\t\t}\n\n\t\tpublic Brush SwitchInactiveBackground\n\t\t{\n\t\t\tget { return FieldBackground; }\n\t\t}\n\n\t\tpublic Brush SwitchInactiveStroke\n\t\t{\n\t\t\tget { return FieldStroke.Brush; }\n\t\t}\n\n\t\tpublic Brush SwitchActiveBackground\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Brush SwitchActiveStroke\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Brush SwitchThumbFill\n\t\t{\n\t\t\tget { return Color.FromRgb(0xf1f1f1); }\n\t\t}\n\n\t\tpublic Brush SwitchThumbStroke\n\t\t{\n\t\t\tget { return Color.FromRgb(0xc7c7c7); }\n\t\t}\n\n\t\tpublic Brush OutlineIcon\n\t\t{\n\t\t\tget { return Color.FromRgb(0x919191); }\n\t\t}\n\n\t\tpublic Brush Cancel\n\t\t{\n\t\t\tget { return Color.FromRgb(0xE35667); }\n\t\t}\n\t\tpublic Brush FaintBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x292B30); }\n\t\t}\n\t\tpublic Brush ExtremelyFaintBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x2F3138); }\n\t\t}\n\n\t\tpublic IObservable<IColorMap> IconColorMap { get { return Observable.Return(ColorMap.Singleton); } }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/Themes/OriginalLightTheme.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Theming.Themes\n{\n\tinternal class OriginalLightTheme : ITheme\n\t{\n\t\tpublic Color LineBrush\n\t\t{\n\t\t\tget { return Color.FromRgb(0xe0e0e0); }\n\t\t}\n\n\t\tpublic Brush WeakLineBrush\n\t\t{\n\t\t\tget { return Color.FromRgb(0xf1f1f1); }\n\t\t}\n\n\t\tpublic Brush Background\n\t\t{\n\t\t\tget { return Color.FromRgb(0x3F434B); }\n\t\t}\n\n\t\tpublic Brush PanelBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0xFCFCFC); }\n\t\t}\n\n\t\tpublic Brush WorskpaceBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0xF4F5F2); }\n\t\t}\n\n\t\tpublic Brush TopBarBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0x31343A); }\n\t\t}\n\n\t\tpublic Brush DefaultText\n\t\t{\n\t\t\tget { return Color.FromRgb(0x676767); }\n\t\t}\n\n\t\tpublic Brush DisabledText\n\t\t{\n\t\t\tget { return Color.FromRgb(0xc7c7c7); }\n\t\t}\n\n\t\tpublic Brush DescriptorText\n\t\t{\n\t\t\tget { return Color.FromRgb(0xa3a3a3); }\n\t\t}\n\n\t\tpublic Color Active\n\t\t{\n\t\t\tget { return Color.FromRgb(0x4953d7); }\n\t\t}\n\n\t\tpublic Brush ActiveHover\n\t\t{\n\t\t\tget { return Color.FromRgb(0x5460fa); }\n\t\t}\n\n\t\tpublic Brush Purple\n\t\t{\n\t\t\tget { return Color.FromRgb(0xfd71ff); }\n\t\t}\n\n\t\tpublic Brush Link\n\t\t{\n\t\t\tget { return Color.FromRgb(0x707aff); }\n\t\t}\n\n\t\tpublic Brush Margin\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Brush Padding\n\t\t{\n\t\t\tget { return Color.FromRgb(0xda394c); }\n\t\t}\n\n\t\tpublic Brush FieldBackground\n\t\t{\n\t\t\tget { return Color.White; }\n\t\t}\n\n\t\tpublic Stroke FieldStroke\n\t\t{\n\t\t\tget { return Stroke.Create(1, Color.FromRgb(0xE0E0E0)); }\n\t\t}\n\n\t\tpublic Stroke FieldFocusStroke\n\t\t{\n\t\t\tget { return Stroke.Create(1, Color.FromRgb(0x898e99)); }\n\t\t}\n\n\t\tpublic Stroke FieldErrorStroke\n\t\t{\n\t\t\tget { return Stroke.Create(1, Color.FromRgb(0xdd4a5c)); }\n\t\t}\n\n\t\tpublic Brush Shadow\n\t\t{\n\t\t\tget { return Color.FromRgb(0xcccccc); }\n\t\t}\n\n\t\tpublic Font DefaultFont\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 11.0);\n\t\t\t}\n\t\t}\n\t\tpublic Font DefaultFontBold\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 11.0, bold: true);\n\t\t\t}\n\t\t}\n\n\t\tpublic Font DescriptorFont\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 11.0);\n\t\t\t}\n\t\t}\n\n\t\tpublic Font HeaderFont\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn Font.SystemDefault(size: 13.0);\n\t\t\t}\n\t\t}\n\n\t\tpublic Brush SplashTextColor\n\t\t{\n\t\t\tget { return Color.FromRgb(0x676767); }\n\t\t}\n\n\t\tpublic Brush SplashSelectColor\n\t\t{\n\t\t\tget { return Color.FromRgb(0xf2f2f2); }\n\t\t}\n\n\t\tpublic Color IconPrimary\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Color IconSecondary\n\t\t{\n\t\t\tget { return Color.FromRgb(0xc7c7c7); }\n\t\t}\n\n\t\tpublic Brush OutlineVerticalLineBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0xefefef); }\n\t\t}\n\n\t\tpublic Brush SplashBackground\n\t\t{\n\t\t\tget { return Background; }\n\t\t}\n\n\t\tpublic Brush SplashPanelBackground\n\t\t{\n\t\t\tget { return PanelBackground; }\n\t\t}\n\n\t\tpublic Brush SplashLink\n\t\t{\n\t\t\tget { return Link; }\n\t\t}\n\n\t\tpublic Brush SplashActive\n\t\t{\n\t\t\tget { return Color.FromRgb(0x6dc0d2); }\n\t\t}\n\n\t\tpublic Brush SwitchInactiveBackground\n\t\t{\n\t\t\tget { return FieldBackground; }\n\t\t}\n\n\t\tpublic Brush SwitchInactiveStroke\n\t\t{\n\t\t\tget { return FieldStroke.Brush; }\n\t\t}\n\n\t\tpublic Brush SwitchActiveBackground\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Brush SwitchActiveStroke\n\t\t{\n\t\t\tget { return Active; }\n\t\t}\n\n\t\tpublic Brush SwitchThumbFill\n\t\t{\n\t\t\tget { return PanelBackground; }\n\t\t}\n\n\t\tpublic Brush SwitchThumbStroke\n\t\t{\n\t\t\tget { return FieldStroke.Brush; }\n\t\t}\n\n\t\tpublic Brush OutlineIcon\n\t\t{\n\t\t\tget { return Color.FromRgb(0xc7c7c7); }\n\t\t}\n\n\t\tpublic Brush Cancel\n\t\t{\n\t\t\tget { return Color.FromRgb(0xE35667); }\n\t\t}\n\t\tpublic Brush FaintBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0xF7F7F7); }\n\t\t}\n\t\tpublic Brush ExtremelyFaintBackground\n\t\t{\n\t\t\tget { return Color.FromRgb(0xFAFAFA); }\n\t\t}\n\n\t\tpublic IObservable<IColorMap> IconColorMap { get { return Observable.Return(ColorMap.Singleton); } }\n\t}\n}\n"
  },
  {
    "path": "src/fuse/studio/Theming/Themes/Themes.cs",
    "content": "namespace Outracks.Fuse.Theming.Themes\n{\n\tpublic enum Themes\n\t{\n\t\tOriginalLight,\n\t\tOriginalDark,\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/USBMode.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing Fuse.Preview;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse\n{\n\tclass USBMode\n\t{\n\t\treadonly AndroidPortReverser _portReverser;\n\t\treadonly IObservable<int> _port;\n\t\treadonly PreviewService _previewService;\n\n\t\tpublic Command EnableUsbModeCommand\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _port.Switch(p =>\n\t\t\t\t\tCommand.Enabled(action: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tEnableUsbMode(p);\n\t\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\tpublic USBMode(AndroidPortReverser portReverser, IObservable<int> port, PreviewService previewService)\n\t\t{\n\t\t\t_portReverser = portReverser;\n\t\t\t_port = port;\n\t\t\t_previewService = previewService;\n\t\t\t_port.ObserveOn(NewThreadScheduler.Default).Subscribe(EnableUsbMode);\n\t\t}\n\n\t\tvoid EnableUsbMode(int port)\n\t\t{\n\t\t\t_portReverser.ReversePortOrLogErrors(ReportFactory.FallbackReport, port, port);\n\t\t\t_previewService.UpdateReversedPorts(true);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/studio/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<asmv1:assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv1=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv2=\"urn:schemas-microsoft-com:asm.v2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n\t<assemblyIdentity version=\"1.0.0.0\" name=\"Outracks.Fuse.Studio\"/>\n\t<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n\t\t<security>\n\t\t\t<requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n\t\t\t\t<!-- UAC Manifest Options\n\t\t\t\t\t\tIf you want to change the Windows User Account Control level replace the \n\t\t\t\t\t\trequestedExecutionLevel node with one of the following.\n\n\t\t\t\t<requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n\t\t\t\t<requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n\t\t\t\t<requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n\t\t\t\t\t\tSpecifying requestedExecutionLevel node will disable file and registry virtualization.\n\t\t\t\t\t\tIf you want to utilize File and Registry Virtualization for backward \n\t\t\t\t\t\tcompatibility then delete the requestedExecutionLevel node.\n\t\t\t\t-->\n\t\t\t\t<requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\" />\n\t\t\t</requestedPrivileges>\n\t\t</security>\n\t</trustInfo>\n\n\t<compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n\t\t<application>\n\t\t\t<!-- A list of all Windows versions that this application is designed to work with. \n\t\t\tWindows will automatically select the most compatible environment.-->\n\n\t\t\t<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"></supportedOS>\n\n\t\t\t<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n\n\t\t\t<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"></supportedOS>\n\n\t\t\t<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"/>\n\n\t\t\t<!-- Windows 10 -->\n\t\t\t<supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n\t\t</application>\n\t</compatibility>\n\n\t<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n\t<!-- <dependency>\n\t\t<dependentAssembly>\n\t\t\t<assemblyIdentity\n\t\t\t\t\ttype=\"win32\"\n\t\t\t\t\tname=\"Microsoft.Windows.Common-Controls\"\n\t\t\t\t\tversion=\"6.0.0.0\"\n\t\t\t\t\tprocessorArchitecture=\"*\"\n\t\t\t\t\tpublicKeyToken=\"6595b64144ccf1df\"\n\t\t\t\t\tlanguage=\"*\"\n\t\t\t\t/>\n\t\t</dependentAssembly>\n\t</dependency>-->\n\n</asmv1:assembly>\n"
  },
  {
    "path": "src/fuse/studio/fuse-studio.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{490EF7E5-46FF-4DF3-8342-530429CA65B5}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse</RootNamespace>\n    <AssemblyName>fuse-studio</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath Condition=\" '$(OS)' != 'Windows_NT' \">bin\\$(Configuration)</OutputPath>\n    <OutputPath Condition=\" '$(OS)' == 'Windows_NT' \">$(SolutionDir)bin\\$(Configuration)</OutputPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>Fuse.ico</ApplicationIcon>\n  </PropertyGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\ClassesSmall.png\" />\n    <EmbeddedResource Include=\"Icons\\DragIconSmallDark.png\" />\n    <EmbeddedResource Include=\"Icons\\DragIconSmall.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\Devices_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\Devices_light.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\touchOff_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\touchOff_light.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\touchOn_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\touchOn_light.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\SelectionOff_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\SelectionOff_light.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\SelectionOn_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\SelectionOn_light.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\AddViewport_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\AddViewport_light.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\Maximize_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\Maximize_light.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\Minimize_dark.png\" />\n    <EmbeddedResource Include=\"Icons\\HeaderBar\\Minimize_light.png\" />\n    <EmbeddedResource Include=\"Icons\\FuseBusyAnim\\BusyIndicator_0.png\" />\n    <EmbeddedResource Include=\"Icons\\FuseBusyAnim\\BusyIndicator_1.png\" />\n    <EmbeddedResource Include=\"Icons\\FuseBusyAnim\\BusyIndicator_2.png\" />\n    <EmbeddedResource Include=\"Icons\\FuseBusyAnim\\BusyIndicator_3.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\LoggedOut_dark%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\LoggedOut_light%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\ProjectIcon_dark%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\ProjectIcon_light%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\Community.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\Community%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\Docs.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\Docs%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\Learn.png\" />\n    <EmbeddedResource Include=\"Icons\\Dashboard\\Learn%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\ExtractClassDisabled%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\ExtractClassDisabled.png\" />\n    <EmbeddedResource Include=\"Icons\\ExtractClassEnabled%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\ExtractClassEnabled.png\" />\n    <EmbeddedResource Include=\"Icons\\CannotEdit\\Dark%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\CannotEdit\\Dark.png\" />\n    <EmbeddedResource Include=\"Icons\\CannotEdit\\Light%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\CannotEdit\\Light.png\" />\n    <EmbeddedResource Include=\"Icons\\Checkmark%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Checkmark.png\" />\n    <EmbeddedResource Include=\"Icons\\Pro_Illustration%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Pro_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\Edit\\Active%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Edit\\Active.png\" />\n    <EmbeddedResource Include=\"Icons\\Edit\\InActive%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Edit\\InActive.png\" />\n    <EmbeddedResource Include=\"Icons\\Edit\\Small%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Edit\\Small.png\" />\n    <EmbeddedResource Include=\"Icons\\LogOut%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\LogOut.png\" />\n    <Reference Include=\"Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Castle.Core.4.4.1\\lib\\net45\\Castle.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"FSharp.Core, Version=4.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\FSharp.Core.4.7.1\\lib\\net45\\FSharp.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"ICSharpCode.NRefactory, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d4bfe873e7598c49, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\3rdparty\\ICSharpCode.NRefactory.dll</HintPath>\n    </Reference>\n    <Reference Include=\"ICSharpCode.NRefactory.Xml, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d4bfe873e7598c49, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\3rdparty\\ICSharpCode.NRefactory.Xml.dll</HintPath>\n    </Reference>\n    <Reference Include=\"ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpZipLib.1.3.3\\lib\\net45\\ICSharpCode.SharpZipLib.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Mono.Options\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Mono.Options.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Mono.Posix-4.5.4.5.0\\lib\\net45\\Mono.Posix.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"plist-cil, Version=2.1.0.0, Culture=neutral, PublicKeyToken=ec2cb9e1a719933d, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\plist-cil.2.1.0\\lib\\netstandard1.3\\plist-cil.dll</HintPath>\n    </Reference>\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"QRCoder, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\QRCoder.1.4.1\\lib\\net40\\QRCoder.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Buffers.4.4.0\\lib\\netstandard1.1\\System.Buffers.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.IO.FileSystem.4.3.0\\lib\\net46\\System.IO.FileSystem.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.IO.FileSystem.Primitives.4.3.0\\lib\\net46\\System.IO.FileSystem.Primitives.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Memory.4.5.0\\lib\\netstandard1.1\\System.Memory.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Numerics\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reflection.TypeExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reflection.TypeExtensions.4.3.0\\lib\\net46\\System.Reflection.TypeExtensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.Serialization\" />\n    <Reference Include=\"System.Runtime.Serialization.Formatters, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.Serialization.Formatters.4.3.0\\lib\\net46\\System.Runtime.Serialization.Formatters.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.Serialization.Primitives, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.Serialization.Primitives.4.3.0\\lib\\net46\\System.Runtime.Serialization.Primitives.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Xml.XmlDocument.4.3.0\\lib\\net46\\System.Xml.XmlDocument.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Collections\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Uno.Collections.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Configuration\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Configuration.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.ProjectFormat\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.ProjectFormat.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.UX.Markup\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.UX.Markup.dll</HintPath>\n    </Reference>\n    <Reference Include=\"UnoCore\">\n      <HintPath>..\\..\\simulator\\common\\bin\\UnoCore.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"About.cs\" />\n    <Compile Include=\"Activate.cs\" />\n    <Compile Include=\"ApplicationPaths.cs\" />\n    <Compile Include=\"BehaviorSubjectExtensions.cs\" />\n    <Compile Include=\"Components\\AndroidBuildTools.cs\" />\n    <Compile Include=\"Components\\ScriptInstaller.cs\" />\n    <Compile Include=\"Components\\VsCodeExtension.cs\" />\n    <Compile Include=\"Controls\\BrowseButton.cs\" />\n    <Compile Include=\"Controls\\ConfirmCancelControl.cs\" />\n    <Compile Include=\"Controls\\FilePathControl.cs\" />\n    <Compile Include=\"LanguageMenu.cs\" />\n    <Compile Include=\"MainMenu\\CheckForUpdates.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\FilePathEditor.cs\" />\n    <Compile Include=\"NagScreen.cs\" />\n    <Compile Include=\"Texts.cs\" />\n    <Compile Include=\"Setup\\VsCodeAppStatus.cs\" />\n    <Compile Include=\"Setup\\VsCodeExtensionStatus.cs\" />\n    <Compile Include=\"Testing\\IconPreviewWindow.cs\" />\n    <Compile Include=\"MainWindow\\Busy.cs\" />\n    <Compile Include=\"Components\\SublimePlugin.cs\" />\n    <Compile Include=\"GlVersionParsing.cs\" />\n    <Compile Include=\"Icons\\TouchIcon.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\DropPosition.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\TreeView.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\TreeRowView.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\ITreeRowViewModel.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\ITreeViewModel.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\PendingDrop.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\TreeViewModel.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\TreeViewModel.RowModel.cs\" />\n    <Compile Include=\"MainWindow\\Notification.cs\" />\n    <Compile Include=\"ProjectHost.cs\" />\n    <Compile Include=\"Project\\ILiveElement.cs\" />\n    <Compile Include=\"Setup\\InstallStatus.cs\" />\n    <Compile Include=\"Sketch\\SketchLogWrapper.cs\" />\n    <Compile Include=\"Sketch\\SketchWatcher.cs\" />\n    <Compile Include=\"Sketch\\SketchWatchExtensions.cs\" />\n    <Compile Include=\"Theming\\Arrow.cs\" />\n    <Compile Include=\"Build.cs\" />\n    <Compile Include=\"BuildArgs.cs\" />\n    <Compile Include=\"BuildFlagsWindow.cs\" />\n    <Compile Include=\"Theming\\Buttons.cs\" />\n    <Compile Include=\"Theming\\CheckBox.cs\" />\n    <Compile Include=\"CodeView.cs\" />\n    <Compile Include=\"Components\\AtomPlugin.cs\" />\n    <Compile Include=\"Components\\ComponentInstaller.cs\" />\n    <Compile Include=\"Components\\ComponentInstallers.cs\" />\n    <Compile Include=\"Components\\VsCodePlugin.cs\" />\n    <Compile Include=\"Import\\ImportFailed.cs\" />\n    <Compile Include=\"Import\\ImportOperation.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Layout\\ElementDockPanelExtensions.cs\" />\n    <Compile Include=\"MainWindow\\LogView\\ErrorView.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\AttributeIntercepter.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\CellLayout.cs\" />\n    <Compile Include=\"Testing\\Debug.cs\" />\n    <Compile Include=\"ElementContext.cs\" />\n    <Compile Include=\"Export.cs\" />\n    <Compile Include=\"ExternalSelection.cs\" />\n    <Compile Include=\"FocusEditorCommand.cs\" />\n    <Compile Include=\"MainMenu\\Help.cs\" />\n    <Compile Include=\"Dashboard\\CreateProject.cs\" />\n    <Compile Include=\"Icons\\AlignmentIcon.cs\" />\n    <Compile Include=\"Icons\\MinimizeAndMaximizeIcon.cs\" />\n    <Compile Include=\"Icons\\SelectionIcon.cs\" />\n    <Compile Include=\"Icons\\StackIcon.cs\" />\n    <Compile Include=\"Icons\\TextAlignmentIcon.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\EditorControl.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Color.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Dropdown.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Expression.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Factory.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Label.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Slider.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\List.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\RadioButton.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Switch.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Layout.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Layout\\AlignmentEditor.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Layout\\CustomRadioButton.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Layout\\DockEditor.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Layout\\Spacing.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\IEditorFactory.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\SizePosition.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Attributes.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Transform\\Rotation.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Style.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Style\\DropShadow.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Style\\LinearGradient.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Style\\SolidColor.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Style\\Stroke.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Transform.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Advanced\\Visibility.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\Circle.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\Each.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\Grid.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\Image.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\ScrollView.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\StackPanel.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\Text.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\TextInput.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Sections\\Common\\WrapPanel.cs\" />\n    <Compile Include=\"MainWindow\\LogView\\LogViewTab.cs\" />\n    <Compile Include=\"Theming\\Modal.cs\" />\n    <Compile Include=\"Project\\Attribute.Convert.cs\" />\n    <Compile Include=\"Project\\Attribute.cs\" />\n    <Compile Include=\"Project\\Attribute.Focus.cs\" />\n    <Compile Include=\"Project\\Converters\\Angle.cs\" />\n    <Compile Include=\"Project\\Converters\\Boolean.cs\" />\n    <Compile Include=\"Project\\Converters\\Color.cs\" />\n    <Compile Include=\"Project\\Converters\\Enum.cs\" />\n    <Compile Include=\"Project\\Converters\\Scalar.cs\" />\n    <Compile Include=\"Project\\Converters\\String.cs\" />\n    <Compile Include=\"Project\\Converters\\TimeSpan.cs\" />\n    <Compile Include=\"Project\\Converters\\UxSize.cs\" />\n    <Compile Include=\"Project\\Converters\\Vector.cs\" />\n    <Compile Include=\"Project\\Element.cs\" />\n    <Compile Include=\"Project\\Element.Empty.cs\" />\n    <Compile Include=\"Project\\Element.Subtree.cs\" />\n    <Compile Include=\"Project\\Element.Switch.cs\" />\n    <Compile Include=\"Project\\IAttribute.cs\" />\n    <Compile Include=\"Project\\IContext.cs\" />\n    <Compile Include=\"Project\\IDocument.cs\" />\n    <Compile Include=\"Project\\IElement.cs\" />\n    <Compile Include=\"Project\\IProject.cs\" />\n    <Compile Include=\"Project\\Live\\Context.cs\" />\n    <Compile Include=\"Project\\Live\\FileWatchingDocument.cs\" />\n    <Compile Include=\"Project\\Live\\LiveDocument.cs\" />\n    <Compile Include=\"Project\\Live\\LiveElement.cs\" />\n    <Compile Include=\"Project\\Live\\LiveElement.CutCopyPaste.cs\" />\n    <Compile Include=\"Project\\Live\\LiveElement.Is.cs\" />\n    <Compile Include=\"Project\\Live\\LiveElement.IsChildOf.cs\" />\n    <Compile Include=\"Project\\Live\\LiveElement.IsSiblingOf.cs\" />\n    <Compile Include=\"Project\\Live\\LiveElement.Update.cs\" />\n    <Compile Include=\"Project\\Live\\LiveProject.cs\" />\n    <Compile Include=\"Project\\Live\\ProjectWatcher.cs\" />\n    <Compile Include=\"Project\\Live\\PushEventsToDaemon.cs\" />\n    <Compile Include=\"Project\\Live\\XElementExtensions.cs\" />\n    <Compile Include=\"Project\\SpecialProperties.cs\" />\n    <Compile Include=\"Project\\Where.cs\" />\n    <Compile Include=\"Refactoring\\ClassExtractor.cs\" />\n    <Compile Include=\"Refactoring\\IClassExtractor.cs\" />\n    <Compile Include=\"Refactoring\\IExtractClassButtonViewModel.cs\" />\n    <Compile Include=\"Refactoring\\IExtractClassViewModel.cs\" />\n    <Compile Include=\"Refactoring\\ExtractClassButtonViewModel.cs\" />\n    <Compile Include=\"Refactoring\\ExtractClassViewModel.cs\" />\n    <Compile Include=\"Refactoring\\ExtractClassView.cs\" />\n    <Compile Include=\"Refactoring\\OverlayConfirmCancelDialog.cs\" />\n    <Compile Include=\"Setup\\MissingAndroidNotification.cs\" />\n    <Compile Include=\"Setup\\MissingPluginNotification.cs\" />\n    <Compile Include=\"Theming\\LogoAndVersion.cs\" />\n    <Compile Include=\"OpenTerminal.cs\" />\n    <Compile Include=\"OpenFolder.cs\" />\n    <Compile Include=\"OpenTextEditor.cs\" />\n    <Compile Include=\"MainWindow\\Hierarchy\\InsertionRod.cs\" />\n    <Compile Include=\"Setup\\SoftwareStatus.cs\" />\n    <Compile Include=\"Setup\\SublimeAppStatus.cs\" />\n    <Compile Include=\"Setup\\SublimePluginStatus.cs\" />\n    <Compile Include=\"Templates\\DirectoryToNamespace.cs\" />\n    <Compile Include=\"Templates\\FileAlreadyExist.cs\" />\n    <Compile Include=\"Templates\\ITemplateVariableResolver.cs\" />\n    <Compile Include=\"Templates\\NamespaceName.cs\" />\n    <Compile Include=\"Templates\\ProjectFolderNotEmpty.cs\" />\n    <Compile Include=\"Templates\\SpawnTemplate.cs\" />\n    <Compile Include=\"Templates\\Template.cs\" />\n    <Compile Include=\"Templates\\TemplateLoader.cs\" />\n    <Compile Include=\"Templates\\TemplateManifestParser.cs\" />\n    <Compile Include=\"Templates\\TemplateParseError.cs\" />\n    <Compile Include=\"Templates\\TemplateParser.cs\" />\n    <Compile Include=\"Templates\\TemplateSpawner.cs\" />\n    <Compile Include=\"Templates\\TemplateToken.cs\" />\n    <Compile Include=\"Templates\\TemplateVariableResolver.cs\" />\n    <Compile Include=\"Theming\\ThemedButton.cs\" />\n    <Compile Include=\"Theming\\ThemedTextBox.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\IStage.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\IViewport.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\StageView.cs\" />\n    <Compile Include=\"Testing\\ConsoleOutputWindow.cs\" />\n    <Compile Include=\"Testing\\RandomMutatorWindow.cs\" />\n    <Compile Include=\"Testing\\RandomUxMutator.cs\" />\n    <Compile Include=\"MainWindow\\LogView\\LogViewHeader.cs\" />\n    <Compile Include=\"Theming\\Themes\\ColorMap.cs\" />\n    <Compile Include=\"Theming\\Themes\\ITheme.cs\" />\n    <Compile Include=\"Theming\\Themes\\OriginalDarkTheme.cs\" />\n    <Compile Include=\"Theming\\Themes\\OriginalLightTheme.cs\" />\n    <Compile Include=\"Theming\\Themes\\Themes.cs\" />\n    <Compile Include=\"MainWindow\\Toolbox\\Toolbox.cs\" />\n    <Compile Include=\"Theming\\Popover.cs\" />\n    <Compile Include=\"PreviewOnDevice.cs\" />\n    <Compile Include=\"ProjectData.cs\" />\n    <Compile Include=\"Dashboard\\ProjectList.cs\" />\n    <Compile Include=\"Dashboard\\ProjectListItem.cs\" />\n    <Compile Include=\"Dashboard\\ProjectListItemControl.cs\" />\n    <Compile Include=\"RecentProjects.cs\" />\n    <Compile Include=\"RespondToFocusRequests.cs\" />\n    <Compile Include=\"Setup\\SetupGuide.cs\" />\n    <Compile Include=\"SimulatorNotifications.cs\" />\n    <Compile Include=\"Theming\\Spacer.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\Primitives.cs\" />\n    <Compile Include=\"USBMode.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\Gizmos\\ChangeSelection.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\Gizmos\\ChangeTool.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\FocusBox.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\Gizmos\\HitBoxes.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\Gizmos\\PluginUnoHelpers.cs\" />\n    <Compile Include=\"Icons\\Icons.cs\" />\n    <Compile Include=\"MainWindow\\LogView\\LogView.cs\" />\n    <Compile Include=\"MainMenu\\MainMenu.cs\" />\n    <Compile Include=\"OpenProject.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\Field.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Editors\\ListButtons.cs\" />\n    <Compile Include=\"MainWindow\\MainWindowIcons.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"MainMenu\\ProjectMenu.cs\" />\n    <Compile Include=\"Theming\\Separator.cs\" />\n    <Compile Include=\"Dashboard\\Dashboard.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\Gizmos\\BoxFactory.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\VirtualDevices\\VirtualDevice.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\VirtualDevices\\Devices.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\VirtualDevices\\DeviceScreen.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\VirtualDevices\\DevicesMenu.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\VirtualDevices\\MalformedDeviceInfo.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\VirtualDevices\\PreviewDevices.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\Gizmos\\Gizmos.cs\" />\n    <Compile Include=\"MainWindow\\Inspector\\Inspector.cs\" />\n    <Compile Include=\"MainWindow\\MainWindow.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Theming\\Theme.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\ViewportController.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\ViewportFactory.cs\" />\n    <Compile Include=\"MainWindow\\Stage\\StageController.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"App.config\" />\n    <None Include=\"app.manifest\" />\n    <None Include=\"packages.config\" />\n    <EmbeddedResource Include=\"MainWindow\\Stage\\VirtualDevices\\devices.json\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fuse\\locale\\Outracks.Fuse.Locale.csproj\">\n      <Project>{0e454646-b607-4fed-ab02-becbc5620fa3}</Project>\n      <Name>Outracks.Fuse.Locale</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196b010d-ad36-4947-95aa-14fc4a27bd18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\text\\Outracks.Text.csproj\">\n      <Project>{D52BEC1D-D0B3-4C44-956F-9747233CD6CA}</Project>\n      <Name>Outracks.Text</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\sketch2fuse\\SketchConverter\\SketchConverter.csproj\">\n      <Project>{b086e390-ce62-4c90-9214-9e828de7af33}</Project>\n      <Name>SketchConverter</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{E8884270-5F2C-4076-86D0-456B831BE3E5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\preview\\service\\fuse-preview.csproj\">\n      <Project>{59e1073a-9b45-41f3-ab94-958a9d18fb72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\unohost\\common\\Outracks.UnoHost.csproj\">\n      <Project>{F2AEB321-51E5-40B8-9CF0-53C930E631F0}</Project>\n      <Name>Outracks.UnoHost</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\unohost\\win\\unohost-win.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{dda536e3-a637-4a6d-b0f6-ea0bab92aff7}</Project>\n      <Name>unohost-win</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\**\\*.svg\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\Folder.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Fuse.ico\" />\n    <EmbeddedResource Include=\"Icons\\FuseProLogo_dark%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\FuseProLogo_light%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\CharacterLimit%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\CharacterLimit.png\" />\n    <EmbeddedResource Include=\"Icons\\Confirm%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Confirm.png\" />\n    <EmbeddedResource Include=\"Icons\\LineSpacing%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\LineSpacing.png\" />\n    <EmbeddedResource Include=\"Icons\\FontSize%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\FontSize.png\" />\n    <EmbeddedResource Include=\"Icons\\Wrap\\NoWrap%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Wrap\\NoWrap.png\" />\n    <EmbeddedResource Include=\"Icons\\Wrap\\Wrap%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Wrap\\Wrap.png\" />\n    <EmbeddedResource Include=\"Icons\\Arrow.png\" />\n    <EmbeddedResource Include=\"Icons\\Arrow%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\account%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\account.png\" />\n    <EmbeddedResource Include=\"Icons\\selection_icon_off%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\selection_icon_off.png\" />\n    <EmbeddedResource Include=\"Icons\\selection_icon_on%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\selection_icon_on.png\" />\n    <EmbeddedResource Include=\"Icons\\Maximize%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Maximize.png\" />\n    <EmbeddedResource Include=\"Icons\\Minimize%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Minimize.png\" />\n    <EmbeddedResource Include=\"Icons\\Plugin_Error%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Plugin_Error.png\" />\n    <EmbeddedResource Include=\"Icons\\Plugin_Success%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Plugin_Success.png\" />\n    <EmbeddedResource Include=\"Icons\\Plugin_Warning%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Plugin_Warning.png\" />\n    <EmbeddedResource Include=\"Icons\\Docs_Illustration%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Docs_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\Example_Illustration%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Example_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\Fuse_Symbol_BLK_WHT%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Fuse_Symbol_BLK_WHT.png\" />\n    <EmbeddedResource Include=\"Icons\\Newsletter_Illustration%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Newsletter_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\Tutorial_Illustration%402x.png\" />\n    <EmbeddedResource Include=\"Icons\\Tutorial_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\new-empty-project.png\" />\n    <EmbeddedResource Include=\"Icons\\project_dummy.png\" />\n    <EmbeddedResource Include=\"Icons\\Christmas\\Docs_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\Christmas\\Example_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\Christmas\\Newsletter_Illustration.png\" />\n    <EmbeddedResource Include=\"Icons\\Christmas\\Tutorial_Illustration.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Updates\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fuse/studio/fuse-studio.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=controls/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Icons/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CGadgets/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CSections_005CAdvanced/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CSections_005CAdvanced_005CLayout/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CSections_005CAdvanced_005CSizePosition/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CSections_005CAdvanced_005CStyle/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CSections_005CAdvanced_005CTransform/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CSections_005CCommon/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Inspector_005CSections_005CContextual/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow_005CInspector_005CSections_005CAdvanced/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow_005CInspector_005CSections_005CAdvanced_005CLayout/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow_005CInspector_005CSections_005CAdvanced_005CStyle/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow_005CInspector_005CSections_005CAdvanced_005CTransform/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow_005CInspector_005CSections_005CCommon/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow_005CStage_005CGizmos/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=MainWindow_005CStage_005CVirtualDevices/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Stage_005CGizmos/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Stage_005CVirtualDevices/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Workspace_005CDevices/@EntryIndexedValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Components_005CAndroid/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/fuse/studio/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Castle.Core\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"FSharp.Core\" version=\"4.7.1\" targetFramework=\"net45\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"Mono.Posix-4.5\" version=\"4.5.0\" targetFramework=\"net45\" />\n  <package id=\"plist-cil\" version=\"2.1.0\" targetFramework=\"net46\" />\n  <package id=\"QRCoder\" version=\"1.4.1\" targetFramework=\"net46\" />\n  <package id=\"SharpZipLib\" version=\"1.3.3\" targetFramework=\"net46\" />\n  <package id=\"System.Buffers\" version=\"4.4.0\" targetFramework=\"net46\" />\n  <package id=\"System.Diagnostics.Debug\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Globalization\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.IO.FileSystem\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.IO.FileSystem.Primitives\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Linq\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Memory\" version=\"4.5.0\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reflection\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Reflection.TypeExtensions\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Resources.ResourceManager\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Extensions\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Numerics\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Serialization.Formatters\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Serialization.Primitives\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Text.RegularExpressions\" version=\"4.3.1\" targetFramework=\"net46\" />\n  <package id=\"System.Threading\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n  <package id=\"System.Xml.XmlDocument\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Xml.XmlSerializer\" version=\"4.3.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fuse/system-test/FuseRunner.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Threading;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest {\n\tpublic class FuseRunner\n\t{\n\t\treadonly AbsoluteFilePath _fuse;\n\t\tpublic FuseRunner(AbsoluteFilePath fuse)\n\t\t{\n\t\t\t_fuse = fuse;\n\t\t}\n\n\t\tpublic Process Preview(AbsoluteFilePath unoProj, Optional<Action<string>> stdOutReceived)\n\t\t{\n\t\t\treturn Run(\"preview --print-unoconfig --verbose \" + unoProj.NativePath, stdOutReceived);\n\t\t}\n\n\t\tpublic Process KillAll()\n\t\t{\n\t\t\treturn Run(\"kill-all\", Optional.None());\n\t\t}\n\n\t\tpublic Process Run(string arguments, Optional<Action<string>> stdOutReceived)\n\t\t{\n\t\t\tConsole.WriteLine(\"Starting '\" + _fuse.NativePath + \"' with arguments '\" + arguments + \"'\");\n\t\t\tvar p = Process.Start(new ProcessStartInfo(_fuse.NativePath)\n\t\t\t{\n\t\t\t\tArguments = arguments,\n\t\t\t\tUseShellExecute = false,\n\t\t\t\tRedirectStandardError = true,\n\t\t\t\tRedirectStandardOutput = true\n\t\t\t});\n\n\t\t\tif (p == null)\n\t\t\t{\n\t\t\t\tthrow new TestFailure(\"Failed to start process\");\n\t\t\t}\n\n\t\t\tp.OutputDataReceived += (sender, args) =>\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"  >\" + args.Data);\n\t\t\t\tstdOutReceived.Do(a => {\n\t\t\t\t\tif (args.Data!= null)\n\t\t\t\t\t\ta(args.Data);\n\t\t\t\t});\n\t\t\t};\n\t\t\tp.ErrorDataReceived += (sender, args) =>\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"  >\" + args.Data);\n\t\t\t};\n\t\t\tp.BeginErrorReadLine();\n\t\t\tp.BeginOutputReadLine();\n\t\t\treturn p;\n\t\t}\n\n\t\tpublic void KillOrThrow()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Killing Fuse\");\n\t\t\t\tKillAll().WaitOrThrow(TimeSpan.FromSeconds(30));\n\t\t\t\t// We sometimes see sporadic failures on TC connecting to the daemon. My theory\n\t\t\t\t// is that the  previous kill-all didn't have time to properly shut everything down,\n\t\t\t\t// close pipes and file handles etc., before the next test starts. Let's give it\n\t\t\t\t// some more time to do that.\n\t\t\t\tvar wait = TimeSpan.FromSeconds(3);\n\t\t\t\tConsole.WriteLine(\"Fuse killed. Waiting for \" + wait + \" just to be on the safe side.\");\n\t\t\t\tThread.Sleep(wait);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new TestFailure(\"Failed to kill fuse! \" + e.Message);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/system-test/IOHelpers.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest {\n\tpublic static class IOHelpers\n\t{\n\t\tpublic static void ReplaceTextInFile(AbsoluteFilePath mainView, string oldValue, string newValue)\n\t\t{\n\t\t\tvar newText = File.ReadAllText(mainView.NativePath).Replace(oldValue, newValue);\n\t\t\tvar stopWatch = new Stopwatch();\n\t\t\tstopWatch.Start();\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tFile.WriteAllText(mainView.NativePath, newText);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\tThread.Sleep(Math.Max(stopWatch.Elapsed.Milliseconds, 100));\n\t\t\t\t\tif (stopWatch.Elapsed > TimeSpan.FromSeconds(5))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static void DeleteAndCopyDirectory(AbsoluteDirectoryPath source, AbsoluteDirectoryPath destination)\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tif (Directory.Exists(destination.NativePath))\n\t\t\t\tshell.Delete(destination);\n\t\t\tshell.Copy(source, destination);\n\t\t}\n\n\t\tpublic static void DeleteIfExistsAndCreateDirectory(this IShell shell, AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\tif (shell.Exists(directory))\n\t\t\t{\n\t\t\t\tshell.Delete(directory);\n\t\t\t}\n\t\t\tshell.Create(directory);\n\t\t}\n\n\t\tpublic static void WaitForFileToExist(AbsoluteFilePath file, TimeSpan timeout)\n\t\t{\n\t\t\tvar w = new Stopwatch();\n\t\t\tw.Start();\n\t\t\twhile (!File.Exists(file.NativePath))\n\t\t\t{\n\t\t\t\tif (w.Elapsed > timeout)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"Waited for \" + timeout + \", but '\" + file + \"' didn't appear.\");\n\t\t\t\t}\n\t\t\t\tThread.Sleep(TimeSpan.FromSeconds(0.1));\n\t\t\t}\n\t\t}\n\n\t\tpublic static void AssertExists(Shell shell, IAbsolutePath mainView)\n\t\t{\n\t\t\tif (!shell.Exists(mainView))\n\t\t\t{\n\t\t\t\tthrow new TestFailure(\"Expected to see '\" + mainView + \"', but it doesn't exist.\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/system-test/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Outracks.Fuse.SystemTest\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Outracks.Fuse.SystemTest\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"e4749d36-2611-4607-acd1-cc48fe66f31f\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "src/fuse/system-test/README.md",
    "content": "To run system tests, do `./scripts/system-test.sh` from the repo root. Run with `-h` to see all available options.\n\nTo debug system tests, set this project as the startup project, and pass `--fuse=<path to locally built fuse>`. For example macOS: `--fuse=\"<repo root>/bin/Debug/fuse X.app/Contents/MacOS/fuse X\"` and Windows: `--fuse=<repo root>\\bin\\Debug\\fuse.exe`.\n"
  },
  {
    "path": "src/fuse/system-test/ScreenCapture.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\nusing Uno;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tpublic static class ScreenCapture\n\t{\n\t\tpublic static void Shoot(string name)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar shell = new Shell();\n\n\t\t\t\tvar dir = AbsoluteDirectoryPath.Parse(Environment.CurrentDirectory).Combine(\"diagnostics\");\n\t\t\t\tshell.Create(dir);\n\t\t\t\tvar file = dir.Combine(new FileName(name));\n\n\t\t\t\t// Not taking screenshots on other platforms than Mac right now,\n\t\t\t\t// The preview tests running on Windows is not that unstable, so not currently important to do that.\n\t\t\t\tif (!Platform.IsMac)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar psi = new ProcessStartInfo(\"screencapture\", file.NativePath.QuoteSpace())\n\t\t\t\t{\n\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\tCreateNoWindow = true\n\t\t\t\t};\n\t\t\t\tvar p = Process.Start(psi);\n\t\t\t\tif (p == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new InvalidOperationException(\"Unable to start screencapture process\");\n\t\t\t\t}\n\n\t\t\t\tif (!p.WaitForExit(5000))\n\t\t\t\t{\n\t\t\t\t\tp.Kill();\n\t\t\t\t\tthrow new InvalidOperationException(\"Timeout while trying to take screenshot\");\n\t\t\t\t}\n\t\t\t\tif (p.ExitCode != 0)\n\t\t\t\t\tthrow new InvalidOperationException(\"Got exit code \" + p.ExitCode + \" while trying to take screenshot\");\n\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Unable to take screenshot, because: \" + e);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/system-test/SystemTest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tpublic class SystemTest\n\t{\n\t\tpublic static int Main(string[] args)\n\t\t{\n\t\t\tvar tests = new List<Test>\n\t\t\t{\n\t\t\t\tnew Test(\"preview\", PreviewTest.Run),\n\t\t\t\tnew Test(\"auto-test-app\", AutomaticTestApp.Run),\n\t\t\t\tnew Test(\"create\", FuseCreate.Run),\n\t\t\t\tnew Test(\"build\", FuseBuild.Run),\n\t\t\t\tnew Test(\"install-android\", FuseInstallAndroid.Run),\n\t\t\t};\n\n\t\t\tif (Platform.IsMac)\n\t\t\t{\n\t\t\t\ttests.Add(new Test(\"import\", FuseImport.Run));\n\t\t\t}\n\n\t\t\tif (args.Contains(\"--help\"))\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"USAGE: SystemTest.exe --fuse=<path to fuse.exe> [--skip=<test1>,<test2>...]\");\n\t\t\t\tConsole.WriteLine();\n\t\t\t\tConsole.WriteLine(\"Known tests:\");\n\t\t\t\tforeach (var test in tests)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"  \" + test.Name);\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar argList = args.ToList();\n\t\t\tvar shell = new Shell();\n\t\t\tvar fusePath = argList\n\t\t\t\t.TryParse(\"fuse\")\n\t\t\t\t.SelectMany(p => ResolveAbsolutePath(shell, p));\n\n\t\t\tif (!fusePath.HasValue)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Please specify '--fuse=<path to fuse.exe>'\");\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tvar skip = argList.TryParse(\"skip\").SelectMany(s => s.Split(\",\"));\n\n\t\t\tvar fuseRunner = new FuseRunner(fusePath.Value);\n\t\t\tvar root = AbsoluteDirectoryPath.Parse(Directory.GetCurrentDirectory());\n\n\t\t\tvar results = tests.Select(\n\t\t\t\tt =>\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine();\n\t\t\t\t\tif (skip.Contains(t.Name))\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(\"Skipping test:\" + t.Name);\n\t\t\t\t\t\treturn new TestResult(t, Result.Skipped);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(\"Running test: \" + t.Name);\n\t\t\t\t\t\treturn Run(t, root, fuseRunner);\n\t\t\t\t\t}\n\t\t\t\t}).ToImmutableList();\n\n\t\t\tConsole.WriteLine();\n\t\t\tConsole.WriteLine(\"Test results\");\n\t\t\tvar fmt = \"{0,-\" + tests.Select(t => t.Name.Length).Max() + \"} : {1}\";\n\t\t\tforeach (var testResult in results)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(fmt, testResult.Test.Name, testResult.Result);\n\t\t\t}\n\t\t\tConsole.WriteLine();\n\t\t\treturn results.Count(r => r.Result == Result.Failed) > 0 ? 1 : 0;\n\t\t}\n\n\t\tprivate static TestResult Run(Test t, AbsoluteDirectoryPath root, FuseRunner fuseRunner)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tt.Run(root, fuseRunner);\n\t\t\t\tConsole.WriteLine(t.Name + \" Passed\");\n\t\t\t\treturn new TestResult(t, Result.Passed);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(e.Message);\n\t\t\t\tConsole.WriteLine(t.Name + \" Failed\");\n\t\t\t\treturn new TestResult(t, Result.Failed);\n\t\t\t}\n\t\t}\n\n\n\t\tstatic Optional<AbsoluteFilePath> ResolveAbsolutePath(Shell shell, string nativePath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Optional.Some((AbsoluteFilePath)shell.ResolveAbsolutePath(nativePath));\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tclass Test\n\t\t{\n\t\t\tpublic readonly string Name;\n\t\t\tpublic readonly Action<AbsoluteDirectoryPath, FuseRunner> Run;\n\t\t\tpublic Test(string name, Action<AbsoluteDirectoryPath, FuseRunner> run)\n\t\t\t{\n\t\t\t\tName = name;\n\t\t\t\tRun = run;\n\t\t\t}\n\t\t}\n\n\t\tclass TestResult\n\t\t{\n\t\t\tpublic readonly Test Test;\n\t\t\tpublic readonly Result Result;\n\t\t\tpublic TestResult(Test test, Result result)\n\t\t\t{\n\t\t\t\tTest = test;\n\t\t\t\tResult = result;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class TestFailure : Exception\n\t{\n\t\tpublic TestFailure(string message ) : base(message)\n\t\t{\n\t\t}\n\t}\n\n\tpublic enum Result\n\t{\n\t\tPassed, Skipped, Failed\n\t}\n}\n"
  },
  {
    "path": "src/fuse/system-test/TestHelpers.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tpublic static class TestHelpers\n\t{\n\t\tpublic static Process WaitOrThrow(this Process process, TimeSpan timeout)\n\t\t{\n\t\t\tvar ms = timeout.TotalMilliseconds;\n\t\t\tif (ms > int.MaxValue)\n\t\t\t{\n\t\t\t\tthrow new TestFailure(\"Can't wait for more than \" + int.MaxValue + \"ms., you tried to wait for \" + ms + \" ms.\");\n\t\t\t}\n\t\t\tif (!process.WaitForExit((int)ms))\n\t\t\t{\n\t\t\t\tthrow new TestFailure(\"Waited \" + timeout + \" ms. for `fuse build`, timed out\");\n\t\t\t}\n\t\t\treturn process;\n\t\t}\n\n\t\tpublic static Process AssertExitCode(this Process process, int exitCode)\n\t\t{\n\t\t\tif (process.ExitCode != exitCode)\n\t\t\t{\n\t\t\t\tthrow new TestFailure(\"Process exited with code \" + process.ExitCode + \", expected \" + exitCode);\n\t\t\t}\n\t\t\treturn process;\n\t\t}\n\n\t\tpublic static IDisposable ChangeWorkingDirectory(AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\tvar current = Directory.GetCurrentDirectory();\n\t\t\tDirectory.SetCurrentDirectory(directory.NativePath);\n\t\t\treturn Disposable.Create(() => Directory.SetCurrentDirectory(current));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/system-test/Tests/AutomaticTestApp.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tclass AutomaticTestApp\n\t{\n\t\tpublic static void Run(AbsoluteDirectoryPath root, FuseRunner fuseRunner)\n\t\t{\n\t\t\tvar projectDir = root / \".generated\" / \"AutomaticTestApp\" / \"App\";\n\t\t\tvar project = projectDir / new FileName(\"App.unoproj\");\n\t\t\tvar timeout = TimeSpan.FromMinutes(3);\n\n\t\t\tConsole.WriteLine(\"Setting up project\");\n\t\t\tIOHelpers.DeleteAndCopyDirectory(root / \"Stuff\" / \"AutomatictestApp\" / \"App\", projectDir);\n\n\t\t\tvar testAppError = false;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar wait = new ManualResetEvent(false);\n\n\t\t\t\tConsole.WriteLine(\"Starting preview\");\n\t\t\t\tfuseRunner.Preview(project, Optional.Some<Action<string>>(\n\t\t\t\t\ts =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (s.Contains(\"TEST_APP_MSG:OK\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twait.Set();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (s.Contains(\"TEST_APP_MSG:ERROR\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttestAppError = true;\n\t\t\t\t\t\t\twait.Set();\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\tif (!wait.WaitOne(timeout))\n\t\t\t\t{\n\t\t\t\t\tthrow new TestFailure(\"Test timed out after \" + timeout);\n\t\t\t\t}\n\t\t\t\tif (testAppError)\n\t\t\t\t{\n\t\t\t\t\tthrow new TestFailure(\"Test app failed\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new TestFailure(e.Message);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tScreenCapture.Shoot(\"AutomaticTestApp-before-kill.png\");\n\t\t\t\tfuseRunner.KillOrThrow();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/system-test/Tests/FuseBuild.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tclass FuseBuild\n\t{\n\t\tpublic static void Run(AbsoluteDirectoryPath root, FuseRunner fuseRunner)\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar projectDir = root / \".generated\" / \"FuseBuild\";\n\t\t\tvar project = projectDir / new FileName(\"SystemTest1.unoproj\");\n\n\t\t\tConsole.WriteLine(\"Setting up project\");\n\t\t\tIOHelpers.DeleteAndCopyDirectory(root / \"projects\" / \"SystemTest1\", projectDir);\n\n\n\t\t\tConsole.WriteLine(\"Starting build\");\n\t\t\tfuseRunner.Run(\"build \" + project.NativePath, Optional.None())\n\t\t\t\t.WaitOrThrow(TimeSpan.FromMinutes(3))\n\t\t\t\t.AssertExitCode(0);\n\t\t\tIOHelpers.AssertExists(shell, projectDir / \"build\");\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/system-test/Tests/FuseCreate.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tpublic class FuseCreate\n\t{\n\t\tpublic static void Run(AbsoluteDirectoryPath root, FuseRunner fuseRunner)\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar testDir = root / \".generated\" / \"FuseCreate\";\n\t\t\tvar appDir = testDir / \"appname\";\n\t\t\tshell.DeleteIfExistsAndCreateDirectory(testDir);\n\t\t\tusing (TestHelpers.ChangeWorkingDirectory(testDir))\n\t\t\t{\n\t\t\t\tfuseRunner.Run(\"create app appname\", Optional.None())\n\t\t\t\t\t.WaitOrThrow(TimeSpan.FromSeconds(10))\n\t\t\t\t\t.AssertExitCode(0);\n\t\t\t\tIOHelpers.AssertExists(shell, appDir / new FileName(\"MainView.ux\"));\n\t\t\t\tIOHelpers.AssertExists(shell, appDir / new FileName(\"appname.unoproj\"));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/system-test/Tests/FuseImport.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tclass FuseImport\n\t{\n\t\tpublic static void Run(AbsoluteDirectoryPath root, FuseRunner fuseRunner)\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar projectDir = root / \".generated\" / \"FuseImport\";\n\n\t\t\tConsole.WriteLine(\"Setting up project\");\n\t\t\tIOHelpers.DeleteAndCopyDirectory(root / \"projects\" / \"SketchImportApp\", projectDir);\n\n\t\t\tConsole.WriteLine(\"Starting import\");\n\t\t\tusing (TestHelpers.ChangeWorkingDirectory(projectDir))\n\t\t\t{\n\t\t\t\tfuseRunner.Run(\"import Foo.sketch\", Optional.None())\n\t\t\t\t\t.WaitOrThrow(TimeSpan.FromMinutes(1))\n\t\t\t\t\t.AssertExitCode(0);\n\t\t\t\tIOHelpers.AssertExists(shell, projectDir / \"SketchSymbols\" / new FileName(\"Sketch.Fuse.ux\"));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/system-test/Tests/FuseInstallAndroid.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tclass FuseInstallAndroid\n\t{\n\t\tpublic static void Run(AbsoluteDirectoryPath root, FuseRunner fuseRunner)\n\t\t{\n\t\t\tvar exitCode = fuseRunner.Run(\"install -s android\", Optional.None())\n\t\t\t\t.WaitOrThrow(TimeSpan.FromMinutes(1))\n\t\t\t\t.ExitCode;\n\t\t\tconst int isInstalled = 0;\n\t\t\tconst int isNotInstalled = 100;\n\t\t\tconst int updateAvailable = 200;\n\t\t\tif (exitCode != isInstalled && exitCode != isNotInstalled && exitCode != updateAvailable)\n\t\t\t{\n\t\t\t\tthrow new TestFailure(\"Unexpected exit code \" + exitCode);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/system-test/Tests/PreviewTest.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.SystemTest\n{\n\tpublic class PreviewTest\n\t{\n\t\tpublic static void Run(AbsoluteDirectoryPath root, FuseRunner fuseRunner)\n\t\t{\n\t\t\tvar projectDir = root / \".generated\" / \"SystemTest1\";\n\t\t\tvar project = projectDir / new FileName(\"SystemTest1.unoproj\");\n\t\t\tvar mainView = projectDir / new FileName(\"MainView.ux\");\n\t\t\tvar dataDir = projectDir / \"build\" / \"dotnet\" / \"preview\" / \"fs_data\";\n\t\t\tvar timeout = TimeSpan.FromMinutes(3);\n\n\t\t\tConsole.WriteLine(\"Setting up project\");\n\t\t\tIOHelpers.DeleteAndCopyDirectory(root / \"projects\" / \"SystemTest1\", projectDir);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Starting preview\");\n\t\t\t\tfuseRunner.Preview(project, Optional.None());\n\t\t\t\tIOHelpers.WaitForFileToExist(dataDir / new FileName(\"output1\"), timeout);\n\t\t\t\tConsole.WriteLine(\"Replacing text\");\n\t\t\t\tIOHelpers.ReplaceTextInFile(mainView, \"output1\", \"output2\");\n\t\t\t\tIOHelpers.WaitForFileToExist(dataDir / new FileName(\"output2\"), timeout);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new TestFailure(e.Message);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tScreenCapture.Shoot(\"PreviewTestBeforeKill.png\");\n\t\t\t\tfuseRunner.KillOrThrow();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/system-test/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/fuse/system-test/system-test.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{B8F7AF2D-4009-4DFA-92C4-5F7E2491826E}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse.SystemTest</RootNamespace>\n    <AssemblyName>SystemTest</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ScreenCapture.cs\" />\n    <Compile Include=\"FuseRunner.cs\" />\n    <Compile Include=\"IOHelpers.cs\" />\n    <Compile Include=\"SystemTest.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"TestHelpers.cs\" />\n    <Compile Include=\"Tests\\AutomaticTestApp.cs\" />\n    <Compile Include=\"Tests\\FuseBuild.cs\" />\n    <Compile Include=\"Tests\\FuseCreate.cs\" />\n    <Compile Include=\"Tests\\FuseImport.cs\" />\n    <Compile Include=\"Tests\\FuseInstallAndroid.cs\" />\n    <Compile Include=\"Tests\\PreviewTest.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196b010d-ad36-4947-95aa-14fc4a27bd18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fuse/tests/ApplicationPathsTests.cs",
    "content": "﻿using NUnit.Framework;\nusing Outracks.Diagnostics;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Protocol.Tests\n{\n\tclass ApplicationPathsTests\n\t{\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tApplication.Initialize(new string[0]);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void Sublime_ManualTest()\n\t\t{\n\t\t\tvar path = ApplicationPaths.SublimeTextPath();\n\t\t\tif (Platform.IsWindows)\n\t\t\t\tAssert.AreEqual(@\"C:\\Program Files\\Sublime Text 3\", path.Value.NativePath);\n\t\t\telse\n\t\t\t\tAssert.AreEqual(@\"TODO\", path.Value.NativePath);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void VsCode_ManualTest()\n\t\t{\n\t\t\tvar path = ApplicationPaths.VsCodePath();\n\t\t\tif (Platform.IsWindows)\n\t\t\t\tAssert.AreEqual(@\"C:\\Program Files\\Microsoft VS Code\", path.Value.NativePath);\n\t\t\telse\n\t\t\t\tAssert.AreEqual(@\"TODO\", path.Value.NativePath);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void Atom_ManualTest()\n\t\t{\n\t\t\tvar path = ApplicationPaths.AtomPath();\n\t\t\tif (Platform.IsWindows)\n\t\t\t\tAssert.AreEqual(@\"C:\\Users\\knatten\\AppData\\Local\\atom\\app-1.19.4\", path.Value.NativePath);\n\t\t\telse\n\t\t\t\tAssert.AreEqual(@\"TODO\", path.Value.NativePath);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Common/ContextTests.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Fuse.Live;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Protocol.Tests.Common\n{\n\tpublic class ContextTests\n\t{\n\t\t[Test]\n\t\tpublic void NewContextHasCorrectScope()\n\t\t{\n\t\t\tvar element = ElementWithId(\"1\");\n\t\t\tvar context = new Context(element, i => ElementWithId(i.ToString()));\n\t\t\tAssertElementsEqualAsync(element, context.CurrentScope);\n\t\t\tAssertNoElement(context.PreviousScope);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task PushingAndPoppingScopeRetainsHistory()\n\t\t{\n\t\t\tvar e1 = ElementWithId(\"1\");\n\t\t\tvar e2 = ElementWithId(\"2\");\n\t\t\tvar e3 = ElementWithId(\"3\");\n\t\t\tvar context = new Context(e1, i => ElementWithId(i.ToString()));\n\t\t\tAssertElementsEqualAsync(e1, context.CurrentScope);\n\t\t\tAssertNoElement(context.PreviousScope);\n\n\t\t\tawait context.PushScope(e2, e2);\n\t\t\tAssertElementsEqualAsync(e2, context.CurrentScope);\n\t\t\tAssertElementsEqualAsync(e1, context.PreviousScope);\n\n\t\t\tawait context.PushScope(e3, e3);\n\t\t\tAssertElementsEqualAsync(e3, context.CurrentScope);\n\t\t\tAssertElementsEqualAsync(e2, context.PreviousScope);\n\n\t\t\tawait context.PopScope();\n\t\t\tAssertElementsEqualAsync(e2, context.CurrentScope);\n\t\t\tAssertElementsEqualAsync(e1, context.PreviousScope);\n\n\t\t\tawait context.PopScope();\n\t\t\tAssertElementsEqualAsync(e1, context.CurrentScope);\n\t\t\tAssertNoElement(context.PreviousScope);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ResetingScopeClearsHistory()\n\t\t{\n\t\t\tvar e1 = ElementWithId(\"1\");\n\t\t\tvar e2 = ElementWithId(\"2\");\n\t\t\tvar e3 = ElementWithId(\"3\");\n\t\t\tvar context = new Context(e1, i => ElementWithId(i.ToString()));\n\t\t\tAssertElementsEqualAsync(e1, context.CurrentScope);\n\t\t\tAssertNoElement(context.PreviousScope);\n\n\t\t\tawait context.PushScope(e2, e2);\n\t\t\tAssertElementsEqualAsync(e2, context.CurrentScope);\n\t\t\tAssertElementsEqualAsync(e1, context.PreviousScope);\n\n\t\t\tawait context.PushScope(e2, e2);\n\t\t\tAssertElementsEqualAsync(e2, context.CurrentScope);\n\t\t\tAssertElementsEqualAsync(e2, context.PreviousScope);\n\n\t\t\tawait context.SetScope(e3, e3);\n\t\t\tAssertElementsEqualAsync(e3, context.CurrentScope);\n\t\t\tAssertElementsEqualAsync(e1, context.PreviousScope);\n\t\t}\n\n\t\tstatic IElement ElementWithId(string id)\n\t\t{\n\t\t\tvar element1 = Substitute.For<IElement>();\n\t\t\telement1.SimulatorId.Returns(Observable.Return(new ObjectIdentifier(id)));\n\t\t\treturn element1;\n\t\t}\n\n\t\tstatic void AssertElementsEqualAsync(IElement element1, IElement element2)\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\telement1.SimulatorId.LastNonBlocking(),\n\t\t\t\telement2.SimulatorId.LastNonBlocking());\n\t\t}\n\n\t\tstatic void AssertNoElement(IElement element)\n\t\t{\n\t\t\tvar none = ObjectIdentifier.None;\n\t\t\telement.SimulatorId.Subscribe(id => none = id);\n\t\t\tAssert.AreEqual(ObjectIdentifier.None, none);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Components/ComponentInstallerTests.cs",
    "content": "﻿using System.Runtime.CompilerServices;\nusing NUnit.Framework;\nusing Outracks.Fuse.Components;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Protocol.Tests.Components\n{\n\tclass ComponentInstallerTests\n\t{\n\t\tstatic readonly AbsoluteDirectoryPath ComponentsPath = SetComponentsPath();\n\n\t\tstatic AbsoluteDirectoryPath SetComponentsPath([CallerFilePath] string thisFile = \"\")\n\t\t{\n\t\t\treturn AbsoluteFilePath.Parse(thisFile).ContainingDirectory / \"..\" / \"..\" / \"..\" / \"..\" / \"components\";\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void AtomPlugin_IsInstalled_ManualTest()\n\t\t{\n\t\t\tAssert.AreEqual(ComponentStatus.Installed, new AtomPlugin().Status);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void VsCodePlugin_IsInstalled_ManualTest()\n\t\t{\n\t\t\tAssert.AreEqual(ComponentStatus.Installed, new VsCodeExtension(ComponentsPath).Status);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void AtomPlugin_Install_ManualTest()\n\t\t{\n\t\t\tAssert.AreEqual(ComponentStatus.NotInstalled, new AtomPlugin().Status);\n\t\t\tnew AtomPlugin().Install();\n\t\t\tAssert.AreEqual(ComponentStatus.Installed, new AtomPlugin().Status);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void VsCodePlugin_Install_ManualTest()\n\t\t{\n\t\t\tAssert.AreEqual(ComponentStatus.NotInstalled, new VsCodeExtension(ComponentsPath).Status);\n\t\t\tnew VsCodeExtension(ComponentsPath).Install();\n\t\t\tAssert.AreEqual(ComponentStatus.NotInstalled, new VsCodeExtension(ComponentsPath).Status);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Just for manual testing while developing\")]\n\t\tpublic void SublimePlugin_Install_ManualTest()\n\t\t{\n\t\t\tAssert.AreEqual(ComponentStatus.NotInstalled, new SublimePlugin(ComponentsPath).Status);\n\t\t\tnew SublimePlugin(ComponentsPath).Install();\n\t\t\tAssert.AreEqual(ComponentStatus.Installed, new SublimePlugin(ComponentsPath).Status);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Create/ProjectAddRemoveCornerCaseTests.cs",
    "content": "﻿namespace Outracks.DomainModel.Tests\n{\n\t/*\n\t[TestFixture]\n\tpublic class ProjectAddRemoveCornerCaseTests\n\t{\n\t\treadonly AbsoluteDirectoryPath _projectDir = AbsoluteDirectoryPath.Parse(\"C:\\\\MyProject\");\n\t\treadonly AbsoluteFilePath _projectPath;\n\n\t\tpublic ProjectAddRemoveCornerCaseTests()\n\t\t{\n\t\t\t_projectPath = _projectDir / new FileName(\"some.unoproj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RemoveFolderContainingFiles()\n\t\t{\n\t\t\tvar folderPath = _projectDir / new DirectoryName(\"ThingsILike\");\n\t\t\tvar filePath = folderPath / new FileName(\"mystuff.uno\");\n\t\t\tvar proj = new Project(_projectPath, new[] { filePath });\n\n\t\t\tAssert.AreEqual(new Project(_projectPath), proj.RemoveFolder(folderPath));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RemoveLastFileInFolder()\n\t\t{\n\t\t\tvar folderPath = _projectDir / new DirectoryName(\"ThingsILike\");\n\t\t\tvar filePath = folderPath / new FileName(\"mystuff.uno\");\n\t\t\tvar proj = new Project(_projectPath, new[] { filePath });\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(\n\t\t\t\t\t_projectPath,\n\t\t\t\t\tnull,\n\t\t\t\t\tnew[] { folderPath }),\n\t\t\t\tproj.RemoveFile(filePath));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RemoveLastFileInProjectAndDontCreateFolder()\n\t\t{\n\t\t\tvar filePath = _projectDir / new FileName(\"I'm gonna win the gathering with this demo unless jake makes a snes demo. plus he's handsome.uno\");\n\t\t\tvar proj = new Project(_projectPath, new[] { filePath });\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(_projectPath),\n\t\t\t\tproj.RemoveFile(filePath));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RemoveFolderContainingOnlySingleEmptyFolder()\n\t\t{\n\t\t\tvar folderPath = _projectDir / new DirectoryName(\"ThingsILike\");\n\t\t\tvar nestedFolderPath = folderPath / new DirectoryName(\"NestedThingsILike\");\n\t\t\tvar proj = new Project(_projectPath, new AbsoluteFilePath[0], new[] { nestedFolderPath });\n\n\t\t\tAssert.AreEqual(new Project(_projectPath), proj.RemoveFolder(folderPath));\n\t\t}\n\t}\n\t * */\n}\n"
  },
  {
    "path": "src/fuse/tests/Create/ProjectMoveTests.cs",
    "content": "﻿namespace Outracks.DomainModel.Tests\n{\n\t/*\n\t[TestFixture]\n\tpublic class ProjectMoveTests : ProjectTest\n\t{\n\t\t[Test]\n\t\tpublic void MoveFile()\n\t\t{\n\t\t\tvar folderAPath = _projectDir / new DirectoryName(\"A\");\n\t\t\tvar folderBPath = _projectDir / new DirectoryName(\"B\");\n\t\t\tvar fileName = new FileName(\"mystuff.uno\");\n\t\t\tvar srcFilePath = folderAPath / fileName;\n\t\t\tvar dstFilePath = folderBPath / fileName;\n\t\t\tvar proj = new Project(_projectPath, new[] { srcFilePath }, new[] { folderBPath });\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(_projectPath, new[] { dstFilePath }, new[] { folderAPath }),\n\t\t\t\tproj.MoveFile(srcFilePath, dstFilePath));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MoveEmptyFolder()\n\t\t{\n\t\t\tvar folderAPath = _projectDir / new DirectoryName(\"A\");\n\t\t\tvar folderBPath = _projectDir / new DirectoryName(\"B\");\n\t\t\tvar proj = new Project(_projectPath, null, new[] { folderAPath });\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(_projectPath, null, new[] { folderBPath }),\n\t\t\t\tproj.MoveFolder(folderAPath, folderBPath));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MoveFolderWithContents()\n\t\t{\n\t\t\tvar folderAPath = _projectDir / new DirectoryName(\"A\");\n\t\t\tvar folderBPath = _projectDir / new DirectoryName(\"B\");\n\t\t\tvar fileName = new FileName(\"bestdemoever.uno\");\n\t\t\tvar srcFilePath = folderAPath / fileName;\n\t\t\tvar dstFilePath = folderBPath / fileName;\n\t\t\tvar proj = new Project(_projectPath, new[] { srcFilePath });\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(_projectPath, new[] { dstFilePath }),\n\t\t\t\tproj.MoveFolder(folderAPath, folderBPath));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MoveFolderWithNestedContents()\n\t\t{\n\t\t\tvar folderAPath = _projectDir / new DirectoryName(\"A\");\n\t\t\tvar folderBPath = _projectDir / new DirectoryName(\"B\");\n\t\t\tvar folderCName = new DirectoryName(\"C\");\n\t\t\tvar srcFolderCPath = folderAPath / folderCName;\n\t\t\tvar dstFolderCPath = folderBPath / folderCName;\n\t\t\tvar fileName1 = new FileName(\"file1.uno\");\n\t\t\tvar fileName2 = new FileName(\"file2.uno\");\n\t\t\tvar srcFilePath1 = folderAPath / fileName1;\n\t\t\tvar dstFilePath1 = folderBPath / fileName1;\n\t\t\tvar srcFilePath2 = srcFolderCPath / fileName2;\n\t\t\tvar dstFilePath2 = dstFolderCPath / fileName2;\n\t\t\tvar proj = new Project(_projectPath, new[] { srcFilePath1, srcFilePath2 });\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(_projectPath).With(files: ImmutableHashSet.Create(dstFilePath1, dstFilePath2)),\n\t\t\t\tproj.MoveFolder(folderAPath, folderBPath));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MoveFolderWithNestedEmptyFolders()\n\t\t{\n\t\t\tvar folderAPath = _projectDir / new DirectoryName(\"A\");\n\t\t\tvar folderBPath = _projectDir / new DirectoryName(\"B\");\n\t\t\tvar folderCName = new DirectoryName(\"C\");\n\t\t\tvar folderDName = new DirectoryName(\"D\");\n\t\t\tvar srcFolderCPath = folderAPath / folderCName;\n\t\t\tvar dstFolderCPath = folderBPath / folderCName;\n\t\t\tvar srcFolderDPath = folderAPath / folderDName;\n\t\t\tvar dstFolderDPath = folderBPath / folderDName;\n\t\t\tvar fileName1 = new FileName(\"file1.uno\");\n\t\t\tvar fileName2 = new FileName(\"file2.uno\");\n\t\t\tvar srcFilePath1 = folderAPath / fileName1;\n\t\t\tvar dstFilePath1 = folderBPath / fileName1;\n\t\t\tvar srcFilePath2 = srcFolderCPath / fileName2;\n\t\t\tvar dstFilePath2 = dstFolderCPath / fileName2;\n\t\t\tvar proj =\n\t\t\t\tnew Project(\n\t\t\t\t\t_projectPath,\n\t\t\t\t\tnew[] { srcFilePath1, srcFilePath2 },\n\t\t\t\t\tnew[] { srcFolderDPath });\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(\n\t\t\t\t\t_projectPath,\n\t\t\t\t\tnew[] { dstFilePath1, dstFilePath2 },\n\t\t\t\t\tnew[] { dstFolderDPath }),\n\t\t\t\tproj.MoveFolder(folderAPath, folderBPath));\n\t\t}\n\n\t}*/\n}\n"
  },
  {
    "path": "src/fuse/tests/Create/ProjectRedundancyEliminationTests.cs",
    "content": "﻿namespace Outracks.DomainModel.Tests\n{\n\t/*\n\t[TestFixture]\n\tpublic class ProjectRedundancyEliminationTests\n\t{\n\t\treadonly AbsoluteDirectoryPath _projectDir = AbsoluteDirectoryPath.Parse(\"C:\\\\MyProject\");\n\t\treadonly AbsoluteFilePath _projectPath;\n\n\t\tpublic ProjectRedundancyEliminationTests()\n\t\t{\n\t\t\t_projectPath = _projectDir / new FileName(\"some.unoproj\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddExistingFile()\n\t\t{\n\t\t\tvar filePath = _projectDir / new FileName(\"source.uno\");\n\t\t\tvar proj = new Project(\n\t\t\t\t_projectPath,\n\t\t\t\tnew[] { filePath });\n\n\t\t\tAssert.AreEqual(proj.AddFile(filePath), proj);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddExistingFolder()\n\t\t{\n\t\t\tvar folderPath = _projectDir / new DirectoryName(\"ImEmpty\");\n\t\t\tvar proj = new Project(\n\t\t\t\t_projectPath,\n\t\t\t\tnull,\n\t\t\t\tnew[] { folderPath });\n\n\t\t\tAssert.AreEqual(proj.AddFolder(folderPath), proj);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddRedundantFolder()\n\t\t{\n\t\t\tvar folderPath = _projectDir / new DirectoryName(\"Stuff\");\n\t\t\tvar proj = new Project(\n\t\t\t\t_projectPath,\n\t\t\t\tnew[] { folderPath / new FileName(\"awesomebindings.uxl\") });\n\n\t\t\tAssert.AreEqual(proj.AddFolder(folderPath), proj);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void AddAFileRemoveAFolder()\n\t\t{\n\t\t\tvar folderPath = _projectDir / new DirectoryName(\"Stuff\");\n\t\t\tvar filePath = folderPath / new FileName(\"awesomebindings.uxl\");\n\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew Project(\n\t\t\t\t\t_projectPath,\n\t\t\t\t\tnew[] { filePath }),\n\t\t\t\tnew Project(\n\t\t\t\t\t_projectPath,\n\t\t\t\t\tnull,\n\t\t\t\t\tnew[] { folderPath })\n\t\t\t\t.AddFile(filePath));\n\t\t}\n\t}*/\n}\n"
  },
  {
    "path": "src/fuse/tests/Create/ProjectTest.cs",
    "content": "﻿using Outracks.IO;\n\nnamespace Outracks.DomainModel.Tests\n{\n\tpublic abstract class ProjectTest\n\t{\n\t\tprotected readonly AbsoluteDirectoryPath _projectDir = AbsoluteDirectoryPath.Parse(\"C:\\\\MyProject\");\n\t\tprotected readonly AbsoluteFilePath _projectPath;\n\n\t\tprotected ProjectTest()\n\t\t{\n\t\t\t_projectPath = _projectDir / new FileName(\"some.unoproj\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Create/TemplateTest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing Outracks.Fuse.Templates;\nusing Outracks.IO;\n\nnamespace Outracks.Templates.Tests\n{\n    public class TemplateTest\n    {\n\t\t[Test]\n\t    public void Template01()\n\t    {\n\t\t    var resolver = new VariableResolverDummy(\n\t\t\t    new Dictionary<string, string>()\n\t\t\t    {\n\t\t\t\t    { \"DefaultNamespace\", \"Foo\" }\n\t\t\t    });\n\n\t\t\tvar result = new TemplateParser(resolver).ReplaceVariables(\"_$DefaultNamespace$_\");\n\t\t\tAssert.True(\"Foo\" == result);\n\t    }\n\n\t\t[Test]\n\t\tpublic void Template02()\n\t\t{\n\t\t\tvar resolver = new VariableResolverDummy(\n\t\t\t\tnew Dictionary<string, string>()\n\t\t\t    {\n\t\t\t\t    { \"DefaultNamespace\", \"Foo\" }\n\t\t\t    });\n\n\t\t\tvar result = new TemplateParser(resolver).ReplaceVariables(@\"using Uno;\n\nnamespace _$DefaultNamespace$_\n{\n\tclass App : Application\n\t{\n\t}\n}\");\n\t\t\tAssert.True(@\"using Uno;\n\nnamespace Foo\n{\n\tclass App : Application\n\t{\n\t}\n}\" == result);\n\t\t}\n\n\t\t[Ignore(\"Need to make a IFileSystem\")]\n\t\t[Test]\n\t\tpublic void Template03()\n\t\t{\n\t\t\tif (Directory.Exists(\"Foo\"))\n\t\t\t{\n\t\t\t\tDirectory.Delete(\"Foo\", true);\n\t\t\t}\n\n\t\t\tvar variableResolver = new VariableResolverDummy(\n\t\t\t\tnew Dictionary<string, string>()\n\t\t\t\t{\n\t\t\t\t\t{ \"namespace\", \"Test\" },\n\t\t\t\t\t{ \"filename\", \"Foo\" }\n\t\t\t\t});\n\n\t\t\tvar root = AbsoluteDirectoryPath.Parse(Directory.GetCurrentDirectory());\n\t\t\tIFileSystem fileSystem = null; // TODO\n\t\t\tvar templates = TemplateLoader.LoadTemplatesFrom(root / \"templates\" / \"projects\", fileSystem).ToList(); // TODO: real test fs\n\t\t\tvar templateSpawner = new TemplateSpawner(variableResolver, fileSystem);\n\n\t\t\ttemplateSpawner.Spawn(templates[2], root / \"Foo\");\n\t\t}\n    }\n}\n"
  },
  {
    "path": "src/fuse/tests/Create/TemplateVariableResolverDummy.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.Fuse.Templates;\n\nnamespace Outracks.Templates.Tests\n{\n\tpublic class VariableResolverDummy : ITemplateVariableResolver\n\t{\n\t\treadonly Dictionary<string, string> _variableNames;\n\n\t\tpublic VariableResolverDummy(Dictionary<string, string> variableNames)\n\t\t{\n\t\t\t_variableNames = variableNames;\n\t\t}\n\n\t\tpublic string ResolveVariable(string name)\n\t\t{\n\t\t\treturn _variableNames[name];\n\t\t}\n\n\t    public bool HasVariable(string name)\n\t    {\n\t        return _variableNames.ContainsKey(name);\n\t    }\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/EnvironmentTest.cs",
    "content": "﻿using System;\nusing System.Net.Sockets;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.EditorService.Tests\n{\n\tstatic class EnvironmentTest\n\t{\n\t\tstatic int Main()\n\t\t{\n\t\t\tvar tcpClient = new TcpClient(\"127.0.0.1\", 12122);\n\t\t\tvar client = new LocalSocketClient(tcpClient);\n\t\t\tclient.Disconnected.Subscribe(c => WriteColoredLine(\"Lost connnection\", ConsoleColor.DarkRed));\n\n\t\t\t//client.EnqueueMessage(\"{\\\"MessageType\\\":\\\"Request\\\", \\\"Type\\\":\\\"Hello\\\"}\");\n\t\t\tConsole.ReadLine();\n\n\t\t\t/*Console.Write(\"Your name: \");\n\t\t\tvar name = Console.ReadLine();\n\t\t\tConsole.Write(\"Do you want swear word protection? \");\n\t\t\tvar swearWordProtection = Console.ReadLine().ToUpper() == \"YES\";\n\n\t\t\tConsole.Write(\"Do you want to be an admin? \");\n\t\t\tvar isAdmin = Console.ReadLine().ToUpper() == \"YES\";\n\n\t\t\tvar serializer = new Serializer(new PayloadParserContext(\n\t\t\t\ttypeof(HelloRequest),\n\t\t\t\ttypeof(HelloResponse),\n\t\t\t\ttypeof(SendMessageToAdminRequest),\n\t\t\t\ttypeof(SendMessageToAdminResponse),\n\t\t\t\ttypeof(Message),\n\t\t\t\ttypeof(SwearMessage),\n\t\t\t\ttypeof(UserConnected)));\n\n\t\t\tvar messagesOut = client.OutgoingMessages.Serialized(serializer);\n\t\t\tvar messagesIn = client.IncomingMessages.TryDeserialize(serializer, null);\n\n\t\t\tmessagesIn\n\t\t\t\t.OfType<IEventMessage<UserConnected>>()\n\t\t\t\t.Subscribe(u => WriteColoredLine(u.Data.Name + \" has connected to Fuse group chat (\" + u.Data.DateTime.ToShortTimeString() + \")\", ConsoleColor.Cyan));\n\n\t\t\tmessagesIn\n\t\t\t\t.OfType<IEventMessage<Message>>()\n\t\t\t\t.Subscribe(m => WriteColoredLine(m.Data.Text, ConsoleColor.White));\n\n\t\t\tmessagesIn\n\t\t\t\t.OfType<IRequestMessage<SendMessageToAdminRequest>>()\n\t\t\t\t.Subscribe(\n\t\t\t\t\tr =>\n\t\t\t\t\t{\n\t\t\t\t\t\tWriteColoredLine(r.Data.Name + \" sent you a PM: \" + r.Data.Message, ConsoleColor.Yellow);\n\t\t\t\t\t\tmessagesOut.OnNext(Response.CreateSuccess(r, new SendMessageToAdminResponse() { Answer = \"I got the message.\" }));\n\t\t\t\t\t});\n\n\t\t\tmessagesIn\n\t\t\t\t.OfType<IResponseMessage<SendMessageToAdminResponse>>()\n\t\t\t\t.Subscribe(res => WriteColoredLine(\"Admin responded: \" + res.Data.Answer, ConsoleColor.DarkGreen));\n\n\t\t\tvar waitForHelloResponse = messagesIn\n\t\t\t\t.OfType<IResponseMessage<HelloResponse>>()\n\t\t\t\t.FirstAsync().ToTask();\n\n\t\t\tclient.StartRead();\n\n\t\t\tvar eventFilter = swearWordProtection ? \"^((?!SwearMessage).)*$\" : \"\";\n\t\t\tvar implements = isAdmin ? new List<string> { \"Fuse.Test.MessageToAdmin\" } : new List<string> { \"\" };\n\n\t\t\tmessagesOut.OnNext(Request.Create(0, new HelloRequest() { Identifier = name, EventFilter = eventFilter, Implements = implements }));\n\t\t\twaitForHelloResponse.Wait();\n\n\t\t\tmessagesOut.OnNext(Event.Create(new UserConnected() { Name = name, DateTime = DateTime.Now }));\n\n\t\t\tvar counter = 0;\n\t\t\twhile (tcpClient.Connected)\n\t\t\t{\n\t\t\t\tvar data = counter + \"\\n\";// Console.ReadLine();\n\t\t\t\tmessagesOut.OnNext(Event.Create(new Message() { Text = data }));\n\t\t\t\t++counter;\n\n\t\t\t\t/*if(data.StartsWith(\"/admin\"))\n\t\t\t\t\tmessagesOut.OnNext(Request.Create(0, new SendMessageToAdminRequest() { Message = data.Substring(7, data.Length - 7), Name = name }));\n\t\t\t\telse\n\t\t\t\t\tmessagesOut.OnNext(Event.Create(CreateMessage(name + \": \" + data)));\n\t\t\t}*/\n\n\t\t\treturn 0;\n\t\t}\n\n\t\tstatic IEventData CreateMessage(string message)\n\t\t{\n\t\t\tif (IsSwearWord(message))\n\t\t\t\treturn new SwearMessage() { Text = message };\n\t\t\telse\n\t\t\t\treturn new Message() { Text = message };\n\t\t}\n\n\t\tstatic bool IsSwearWord(string msg)\n\t\t{\n\t\t\tif (msg.ToUpper().Contains(\"FUCK\"))\n\t\t\t{\n\t\t\t\tWriteColoredLine(\"Warning Fuck is considered a swear word.\", ConsoleColor.Red);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (msg.ToUpper().Contains(\"VEGARD\"))\n\t\t\t{\n\t\t\t\tWriteColoredLine(\"Warning Vegard is considered a swear word.\", ConsoleColor.Red);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic void WriteColoredLine(string text, ConsoleColor color)\n\t\t{\n\t\t\tvar oldColor = Console.ForegroundColor;\n\t\t\tConsole.ForegroundColor = color;\n\t\t\tConsole.WriteLine(text);\n\t\t\tConsole.ForegroundColor = oldColor;\n\t\t}\n\t}\n\n\t[PayloadTypeName(\"Fuse.DebugLog\")]\n\tclass Message : IEventData\n\t{\n\t\tpublic string Text;\n\t}\n\n\t[PayloadTypeName(\"Fuse.Test.SwearMessage\")]\n\tclass SwearMessage : Message\n\t{\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/FailureClient.cs",
    "content": "﻿using System;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fuse.Protocol.Tests\n{\n\tpublic class FailureClient : IMessagingService\n\t{\n\t\t/// <summary>\n\t\t/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.\n\t\t/// </summary>\n\t\tpublic void Dispose() {}\n\t\tpublic IObservable<IEventData> BroadcastedEvents { get; private set; }\n\t\tpublic IObserver<IEventData> Events { get; private set; }\n\t\tpublic IRequestSender Requests { get; private set; }\n\t\tpublic IRequestReceiver Receiver { get; private set; }\n\n\t\tpublic FailureClient(IRequestSender requestSender)\n\t\t{\n\t\t\tRequests = requestSender;\n\t\t\tBroadcastedEvents = new Subject<IEventData>();\n\t\t\tEvents = new Subject<IEventData>();\n\t\t}\n\n\t\tpublic IObservable<DateTime> ConnectionLost { get; private set; }\n\t\tIObservable<T> IMessagingService.BroadcastedEvents<T>(bool wantReplay)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic void Broadcast<T>(T theEvent) where T : IEventData {}\n\t\tpublic IDisposable Provide<TRequest, TResponse>(Func<TRequest, TResponse> func) where TRequest : IRequestData<TResponse> where TResponse : IResponseData\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic IDisposable ProvideOptionally<TRequest, TResponse>(Func<TRequest, Optional<TResponse>> func)\n\t\t\twhere TRequest : IRequestData<TResponse>\n\t\t\twhere TResponse : IResponseData\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic Task<TResponse> Request<TResponse>(IRequestData<TResponse> request) where TResponse : IResponseData\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic class InfinityRequestSender : IRequestSender\n\t{\n\t\treadonly bool _supportHello;\n\n\t\tbool _run = true;\n\n\t\tpublic InfinityRequestSender(bool supportHello)\n\t\t{\n\t\t\t_supportHello = supportHello;\n\t\t}\n\n\t\tpublic Task<TResponse> Send<TResponse>(IRequestData<TResponse> request) where TResponse : IResponseData\n\t\t{\n\t\t\tif (_supportHello && request is HelloRequest)\n\t\t\t{\n\t\t\t\tIResponseData helloResponse = new HelloResponse();\n\t\t\t\treturn Task.FromResult((TResponse)helloResponse);\n\t\t\t}\n\n\t\t\treturn Task.Run(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\twhile (_run)\n\t\t\t\t\t{\n\t\t\t\t\t\tThread.Sleep(1000);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (TResponse) ((IResponseData) null);\n\t\t\t\t});\n\t\t}\n\t}\n\n\tpublic class ExceptionRequestSender : IRequestSender\n\t{\n\t\treadonly bool _supportHello;\n\t\tpublic ExceptionRequestSender(bool supportHello)\n\t\t{\n\t\t\t_supportHello = supportHello;\n\t\t}\n\n\t\tpublic async Task<TResponse> Send<TResponse>(IRequestData<TResponse> request) where TResponse : IResponseData\n\t\t{\n\t\t\tif (_supportHello && request is HelloRequest)\n\t\t\t{\n\t\t\t\tIResponseData helloResponse = new HelloResponse();\n\t\t\t\treturn await Task.FromResult((TResponse)helloResponse);\n\t\t\t}\n\n\t\t\tvar tcp = new TaskCompletionSource<TResponse>();\n\t\t\ttcp.SetException(new RequestFailed(new [] { new Error(ErrorCode.Unknown, \"Haha lol\")}));\n\t\t\treturn await tcp.Task;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/FileWatchingDocumentTest.cs",
    "content": "﻿using System;\nusing System.Diagnostics.CodeAnalysis;\nusing System.IO;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Text;\nusing System.Threading.Tasks;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Live;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Tests\n{\n\t[TestFixture]\n\tpublic class FileWatchingDocumentTest\n\t{\n\t\t[Test]\n\t\tpublic async Task Foo()\n\t\t{\n\t\t\tvar fs = new Shell();\n\t\t\tvar path = DirectoryPath.GetCurrentDirectory() / new FileName(Guid.NewGuid().ToString());\n\t\t\tvar doc = new FileWatchingDocument(fs, path);\n\n\t\t\tvar externalChanges = doc.ExternalChanges.FirstAsync().ToTask();\n\n\t\t\tawait doc.Save(new byte[] { 13, 37 });\n\n\t\t\tawait doc.Contents.FirstAsync();\n\t\t\tAssert.ThrowsAsync<TimeoutException>(async () =>\n\t\t\t\tawait externalChanges.ToObservable().Timeout(TimeSpan.FromSeconds(1)).FirstAsync());\n\n\t\t\tfs.ForceWriteText(path, \"trettentretisju\");\n\n\t\t\tawait externalChanges;\n\t\t}\n\n\t\t[Test]\n\t\t[SuppressMessage(\"ReSharper\", \"AccessToModifiedClosure\", Justification = \"Using closures for capturing observable changes\")]\n\t\tpublic async Task Retries_reading_of_file_when_getting_exception_until_successful()\n\t\t{\n\t\t\tvar testScheduler = new HistoricalScheduler(DateTimeOffset.Now);\n\n\t\t\tvar path = AbsoluteFilePath.Parse(Platform.IsWindows ? @\"c:\\trololol\\foobar.ux\" : @\"/trololol/foobar.ux\");\n\t\t\tvar fileNotifications = new Subject<Unit>();\n\t\t\tvar fs = Substitute.For<IFileSystem>();\n\t\t\tbool fileLocked = false;\n\t\t\tstring fileContent = \"abcd\";\n\t\t\tstring readContent = null;\n\t\t\tint readErrorCounter = 0;\n\t\t\tint errorsDuringLoadingCounter = 0;\n\t\t\tvar errorDuringLoading = Optional.None<Exception>();\n\n\t\t\tfs.Watch(path).Returns(fileNotifications);\n\t\t\tfs.OpenRead(path).Returns(_ =>\n\t\t\t{\n\t\t\t\tif (fileLocked)\n\t\t\t\t{\n\t\t\t\t\treadErrorCounter++;\n\t\t\t\t\tthrow new IOException(string.Format(\"The process cannot access the file '{0}' because it is being used by another process.\", path.NativePath));\n\t\t\t\t}\n\t\t\t\treturn new MemoryStream(Encoding.UTF8.GetBytes(fileContent));\n\t\t\t});\n\n\t\t\t// Start by opening FileWatchingDocument, reading unlocked file.\n\t\t\tvar doc = new FileWatchingDocument(fs, path, testScheduler);\n\n\t\t\tdoc.Contents.Subscribe(bytes => readContent = Encoding.UTF8.GetString(bytes));\n\t\t\tdoc.ErrorsDuringLoading.Subscribe(err =>\n\t\t\t{\n\t\t\t\tif (err.HasValue)\n\t\t\t\t\terrorsDuringLoadingCounter++;\n\t\t\t\terrorDuringLoading = err;\n\t\t\t});\n\n\t\t\tfileNotifications.OnNext(Unit.Default);\n\t\t\ttestScheduler.AdvanceBy(FileWatchingDocument.PreLogRetryInterval);\n\n\t\t\tAssert.That(readContent, Is.EqualTo(fileContent));\n\n\t\t\t// Now change and lock the file\n\t\t\tfileContent = \"1337\";\n\t\t\tfileLocked = true;\n\t\t\tfileNotifications.OnNext(Unit.Default);\n\n\t\t\tvar slightlyBeforeErrorMessage = FileWatchingDocument.RetryErrorMessageDelay - FileWatchingDocument.PreLogRetryInterval;\n\t\t\ttestScheduler.AdvanceBy(slightlyBeforeErrorMessage);\n\t\t\tAssert.That(readContent, Is.EqualTo(\"abcd\"));\n\t\t\tAssert.That(readErrorCounter, Is.EqualTo(slightlyBeforeErrorMessage.TotalSeconds / FileWatchingDocument.PreLogRetryInterval.TotalSeconds).Within(1.0));\n\n\t\t\t// Wait another long interval\n\t\t\treadErrorCounter = 0;\n\t\t\ttestScheduler.AdvanceBy(FileWatchingDocument.PostLogRetryInterval);\n\n\t\t\t// Check that we have the exception message ready now\n\t\t\tAssert.That(errorDuringLoading.HasValue, Is.True);\n\t\t\tAssert.That(errorDuringLoading.Value.Message, Is.EqualTo(string.Format(@\"The process cannot access the file '{0}' because it is being used by another process. Retrying in background until problem is resolved.\", path.NativePath)));\n\t\t\tAssert.That(errorsDuringLoadingCounter, Is.EqualTo(1));\n\t\t\tAssert.That(readErrorCounter, Is.GreaterThanOrEqualTo(1));\n\n\t\t\t// Check that error message is only output once\n\t\t\treadErrorCounter = 0;\n\t\t\ttestScheduler.AdvanceBy(FileWatchingDocument.PostLogRetryInterval);\n\t\t\tAssert.That(readErrorCounter, Is.GreaterThanOrEqualTo(1));\n\t\t\tAssert.That(errorsDuringLoadingCounter, Is.EqualTo(1));\n\n\t\t\tfileLocked = false;\n\t\t\ttestScheduler.AdvanceBy(TimeSpan.FromSeconds(FileWatchingDocument.PostLogRetryInterval.TotalSeconds * 1.1));\n\t\t\tAssert.That(errorDuringLoading.HasValue, Is.False);\n\n\t\t\t// HACK: I'm not completely sure why this is necesarry, I suspect it could be due to the use of Observable.DeferAsync?\n\t\t\t// Fix to work around HistoricalScheduler not playing nice with DeferAsync(?)\n\t\t\tawait Task.Delay(10);\n\n\t\t\tAssert.That(readContent, Is.EqualTo(fileContent));\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/Hierarchy/LiveElementExtensions.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Fuse.Live;\n\nnamespace Outracks.Fuse.Tests.Hierarchy\n{\n\tinternal static class LiveElementExtensions\n\t{\n\t\tpublic static IEnumerable<ILiveElement> DescendantsAndSelf(this ILiveElement element)\n\t\t{\n\t\t\tyield return element;\n\t\t\tforeach (var descendant in element.Children.Value.SelectMany(DescendantsAndSelf))\n\t\t\t\tyield return descendant;\n\t\t}\n\n\t\tpublic static void UpdateFrom(this LiveElement element, string xml)\n\t\t{\n\t\t\telement.UpdateFrom(SourceFragment.FromString(xml).ToXml());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/Hierarchy/TreeViewModelTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing Outracks.Fuse.Hierarchy;\nusing Outracks.Fuse.Live;\nusing Outracks.Fusion;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Tests.Hierarchy\n{\n\t[TestFixture]\n\tpublic class TreeViewModelTests\n\t{\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_path = \"/project/MainView.ux\";\n\t\t\tvar invalidated = new Subject<Unit>();\n\t\t\t_element = LiveElementFactory.CreateLiveElement(\"<App><StackPanel/></App>\", _path, invalidated);\n\t\t\tUpdateElementIds();\n\t\t\tinvalidated.Subscribe(_ => UpdateElementIds());\n\t\t\t_context = new Context(\n\t\t\t\t_element,\n\t\t\t\tid =>\n\t\t\t\t{\n\t\t\t\t\tUpdateElementIds();\n\t\t\t\t\treturn _element.DescendantsAndSelf().Where(x => x.SimulatorId.Value == id).FirstOr(Element.Empty);\n\t\t\t\t});\n\t\t\t//await _context.Select(_element);\n\t\t\t_highlightSelectedElement = new BehaviorSubject<bool>(true);\n\t\t\t_model = new TreeViewModel(\n\t\t\t\t_context,\n\t\t\t\t_highlightSelectedElement,\n\t\t\t\t_ => { throw new NotImplementedException(); });\n\n\t\t\t_lastTotalRowCount = null;\n\t\t\t_lastVisibleRows = null;\n\t\t\t_model.VisibleRowCount = 10;\n\t\t\t_model.TotalRowCount.Subscribe(v => _lastTotalRowCount = v);\n\t\t\t_model.VisibleRows.Subscribe(v => _lastVisibleRows = v);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\t_element = null;\n\t\t\t_context = null;\n\t\t\t_model = null;\n\t\t}\n\n\t\tLiveElement _element;\n\t\tContext _context;\n\t\tTreeViewModel _model;\n\n\t\tint? _lastTotalRowCount;\n\t\tIEnumerable<ITreeRowViewModel> _lastVisibleRows;\n\t\tstring _path;\n\t\tBehaviorSubject<bool> _highlightSelectedElement;\n\n\t\t[Test]\n\t\tpublic async Task Ancestors_should_automatically_expand_when_element_in_Ancestor_part_of_tree_is_selected()\n\t\t{\n\t\t\tUpdateXml(\n\t\t\t\t\"<App><Ancestor0><Ancestor1><Ancestor2><Ancestor3><Ancestor4><SelectedElement /></Ancestor4></Ancestor3></Ancestor2></Ancestor1></Ancestor0></App>\");\n\t\t\tvar selectedElement = GetElementByName(\"SelectedElement\");\n\t\t\tvar ancestor0Row = _lastVisibleRows.First(x => x.ElementName.LastNonBlocking() == \"Ancestor0\");\n\t\t\t// Make sure Ancestor0 is collapsed\n\t\t\tif (ancestor0Row.IsExpanded.LastNonBlocking())\n\t\t\t{\n\t\t\t\tawait ancestor0Row.ExpandToggleCommand.ExecuteOnceAsync();\n\t\t\t\tAssert.That(ancestor0Row.IsExpanded.LastNonBlocking(), Is.EqualTo(false));\n\t\t\t}\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(2));\n\t\t\tawait _context.Select(selectedElement);\n\t\t\tAssert.That(_context.CurrentSelection.LiveElement.LastNonBlocking(), Is.EqualTo(Optional.Some(selectedElement)));\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(7));\n\t\t\tAssert.That(_lastVisibleRows.FirstOrDefault(x => x.ElementName.LastNonBlocking() == \"SelectedElement\"), Is.Not.Null);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Non_root_ux_class_element_is_not_expandable()\n\t\t{\n\t\t\tUpdateXml(\"<App><StackPanel ux:Class='FooBar'><Panel/><Panel/></StackPanel></App>\");\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(2));\n\t\t\tvar classRowModel = GetRow(1);\n\t\t\tAssert.That(classRowModel.IsExpanded.LastNonBlocking(), Is.False);\n\t\t\tAssert.That(classRowModel.CanExpand.LastNonBlocking(), Is.False);\n\t\t\tAssert.That(classRowModel.ExpandToggleCommand.IsEnabled.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Faded_of_deselected_element_is_true_while_HighlightSelectedElement_is_true()\n\t\t{\n\t\t\tUpdateXml(\"<App><Selected/><Deselected/></App>\");\n\t\t\tawait _context.Select(GetElementByName(\"Selected\"));\n\t\t\tvar deselectedRow = GetRowByName(\"Deselected\");\n\t\t\t_highlightSelectedElement.OnNext(false);\n\t\t\tAssert.That(deselectedRow.IsFaded.LastNonBlocking(), Is.False);\n\t\t\t_highlightSelectedElement.OnNext(true);\n\t\t\tAssert.That(deselectedRow.IsFaded.LastNonBlocking(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Faded_of_selected_element_is_false_while_HighlightSelectedElement_is_true()\n\t\t{\n\t\t\tUpdateXml(\"<App><Selected/><Deselected/></App>\");\n\t\t\tawait _context.Select(GetElementByName(\"Selected\"));\n\t\t\tvar deselectedRow = GetRowByName(\"Selected\");\n\t\t\t_highlightSelectedElement.OnNext(false);\n\t\t\tAssert.That(deselectedRow.IsFaded.LastNonBlocking(), Is.False);\n\t\t\t_highlightSelectedElement.OnNext(true);\n\t\t\tAssert.That(deselectedRow.IsFaded.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Faded_of_selected_descendant_is_false_while_HighlightSelectedElement_is_true()\n\t\t{\n\t\t\tUpdateXml(\"<App><Selected><Descendant/></Selected><Deselected/></App>\");\n\t\t\tawait _context.Select(GetElementByName(\"Selected\"));\n\t\t\tvar deselectedRow = GetRowByName(\"Descendant\");\n\t\t\t_highlightSelectedElement.OnNext(false);\n\t\t\tAssert.That(deselectedRow.IsFaded.LastNonBlocking(), Is.False);\n\t\t\t_highlightSelectedElement.OnNext(true);\n\t\t\tAssert.That(deselectedRow.IsFaded.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Dropping_element_inside_itself_is_illegal()\n\t\t{\n\t\t\tUpdateXml(\"<App><Dragged/></App>\");\n\t\t\tvar draggedObject = GetRowByName(\"Dragged\").DraggedObject.LastNonBlocking();\n\t\t\tvar targetRow = GetRowByName(\"Dragged\");\n\t\t\tAssert.That(targetRow.CanDrop(DropPosition.Inside, draggedObject), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Dropping_ancestor_element_inside_descendant_is_illegal()\n\t\t{\n\t\t\tUpdateXml(\"<App><Dragged><Target/></Dragged></App>\");\n\t\t\tvar draggedObject = GetRowByName(\"Dragged\").DraggedObject.LastNonBlocking();\n\t\t\tvar targetRow = GetRowByName(\"Target\");\n\t\t\tAssert.That(targetRow.CanDrop(DropPosition.Inside, draggedObject), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Dragging_an_element_and_dropping_it_inside_another_is_successful()\n\t\t{\n\t\t\tUpdateXml(\"<App><Dragged/><Target/></App>\");\n\t\t\tvar draggedObject = GetRowByName(\"Dragged\").DraggedObject.LastNonBlocking();\n\t\t\tvar targetRow = GetRowByName(\"Target\");\n\t\t\ttargetRow.DragEnter(DropPosition.Inside);\n\t\t\tvar pendingDrop = _model.PendingDrop.LastNonBlocking();\n\t\t\tpendingDrop.Do(\n\t\t\t\tpd =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(pd.DropPosition, Is.EqualTo(DropPosition.Inside));\n\t\t\t\t\tAssert.That(pd.Depth, Is.EqualTo(1));\n\t\t\t\t\tAssert.That(pd.RowOffset, Is.EqualTo(targetRow.RowOffset.LastNonBlocking()));\n\t\t\t\t},\n\t\t\t\t() => Assert.Fail(\"Expected there to be a drop pending\"));\n\t\t\tAssert.That(targetRow.CanDrop(DropPosition.Inside, draggedObject), Is.True);\n\n\t\t\ttargetRow.Drop(DropPosition.Inside, draggedObject);\n\n\t\t\tAssert.That(GetRow(1).ElementName.LastNonBlocking(), Is.EqualTo(\"Target\"));\n\t\t\tAssert.That(GetRow(1).Depth.LastNonBlocking(), Is.EqualTo(1));\n\t\t\tAssert.That(GetRow(2).ElementName.LastNonBlocking(), Is.EqualTo(\"Dragged\"));\n\t\t\tAssert.That(GetRow(2).Depth.LastNonBlocking(), Is.EqualTo(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Dragging_an_element_and_dropping_it_before_another_is_successful()\n\t\t{\n\t\t\tUpdateXml(\"<App><Target/><Dragged/></App>\");\n\t\t\tvar draggedObject = GetRowByName(\"Dragged\").DraggedObject.LastNonBlocking();\n\t\t\tvar targetRow = GetRowByName(\"Target\");\n\t\t\tvar dropPosition = DropPosition.Before;\n\t\t\ttargetRow.DragEnter(dropPosition);\n\t\t\tvar pendingDrop = _model.PendingDrop.LastNonBlocking();\n\t\t\tpendingDrop.Do(\n\t\t\t\tpd =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(pd.DropPosition, Is.EqualTo(dropPosition));\n\t\t\t\t\tAssert.That(pd.Depth, Is.EqualTo(1));\n\t\t\t\t\tAssert.That(pd.RowOffset, Is.EqualTo(targetRow.RowOffset.LastNonBlocking()));\n\t\t\t\t},\n\t\t\t\t() => Assert.Fail(\"Expected there to be a drop pending\"));\n\t\t\tAssert.That(targetRow.CanDrop(dropPosition, draggedObject), Is.True);\n\n\t\t\ttargetRow.Drop(dropPosition, draggedObject);\n\n\t\t\tAssert.That(GetRow(1).ElementName.LastNonBlocking(), Is.EqualTo(\"Dragged\"));\n\t\t\tAssert.That(GetRow(1).Depth.LastNonBlocking(), Is.EqualTo(1));\n\t\t\tAssert.That(GetRow(2).ElementName.LastNonBlocking(), Is.EqualTo(\"Target\"));\n\t\t\tAssert.That(GetRow(2).Depth.LastNonBlocking(), Is.EqualTo(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Dragging_an_element_and_dropping_it_after_another_is_successful()\n\t\t{\n\t\t\tUpdateXml(\"<App><Dragged/><Target/></App>\");\n\t\t\tvar draggedObject = GetRowByName(\"Dragged\").DraggedObject.LastNonBlocking();\n\t\t\tvar targetRow = GetRowByName(\"Target\");\n\t\t\tvar dropPosition = DropPosition.After;\n\t\t\ttargetRow.DragEnter(dropPosition);\n\t\t\tvar pendingDrop = _model.PendingDrop.LastNonBlocking();\n\t\t\tpendingDrop.Do(\n\t\t\t\tpd =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(pd.DropPosition, Is.EqualTo(dropPosition));\n\t\t\t\t\tAssert.That(pd.Depth, Is.EqualTo(1));\n\t\t\t\t\tAssert.That(pd.RowOffset, Is.EqualTo(targetRow.RowOffset.LastNonBlocking()));\n\t\t\t\t},\n\t\t\t\t() => Assert.Fail(\"Expected there to be a drop pending\"));\n\t\t\tAssert.That(targetRow.CanDrop(dropPosition, draggedObject), Is.True);\n\n\t\t\ttargetRow.Drop(dropPosition, draggedObject);\n\n\t\t\tAssert.That(GetRow(1).ElementName.LastNonBlocking(), Is.EqualTo(\"Target\"));\n\t\t\tAssert.That(GetRow(1).Depth.LastNonBlocking(), Is.EqualTo(1));\n\t\t\tAssert.That(GetRow(2).ElementName.LastNonBlocking(), Is.EqualTo(\"Dragged\"));\n\t\t\tAssert.That(GetRow(2).Depth.LastNonBlocking(), Is.EqualTo(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task IsAncestorSelected_of_row_is_true_for_descendant_of_selected_element()\n\t\t{\n\t\t\tUpdateXml(\"<App><Selected><Descendant/></Selected></App>\");\n\t\t\tawait _context.Select(GetElementByName(\"Selected\"));\n\t\t\tAssert.That(GetRowByName(\"Descendant\").IsAncestorSelected.LastNonBlocking(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ScopeIntoClassCommand_is_disabled_for_non_class_element()\n\t\t{\n\t\t\tUpdateXml(\"<App><Panel/></App>\");\n\t\t\tvar row = GetRow(1);\n\t\t\tAssert.That(row.ScopeIntoClassCommand.IsEnabled.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ScopeIntoClassCommand_is_disabled_for_class_root_element()\n\t\t{\n\t\t\tUpdateXml(\"<Panel ux:Class='PoshAndIgnorantUpperClass'/>\");\n\t\t\tvar row = GetRow(0);\n\t\t\tAssert.That(row.ScopeIntoClassCommand.IsEnabled.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ScopeIntoClassCommand_for_class_element_scopes_into_class()\n\t\t{\n\t\t\tUpdateXml(\"<App><Panel ux:Class='PoshAndIgnorantUpperClass'/></App>\");\n\t\t\tvar row = GetRow(1);\n\t\t\tAssert.That(row.ScopeIntoClassCommand.IsEnabled.LastNonBlocking(), Is.True);\n\t\t\tawait row.ScopeIntoClassCommand.ExecuteOnceAsync();\n\n\t\t\t// Should be scoped into class now, having only one row\n\t\t\tAssert.That(_model.TotalRowCount.LastNonBlocking(), Is.EqualTo(1));\n\t\t\trow = GetRow(0);\n\t\t\tAssert.That(row.HeaderText.LastNonBlocking(), Is.EqualTo(\"PoshAndIgnorantUpperClass (Panel)\"));\n\t\t\tAssert.That(row.Depth.LastNonBlocking(), Is.EqualTo(0));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PopScopeCommand_is_disabled_when_scope_stack_is_empty()\n\t\t{\n\t\t\tAssert.That(_model.PopScopeCommand.IsEnabled.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task PopScopeCommand_is_enabled_and_works_when_there_are_scopes_to_pop()\n\t\t{\n\t\t\tUpdateXml(\"<App><Panel ux:Class='PoshAndIgnorantUpperClass'/></App>\");\n\t\t\tvar classElement = GetElementByName(\"Panel\");\n\t\t\tawait _context.PushScope(classElement, classElement);\n\t\t\tAssert.That(_model.PopScopeCommand.IsEnabled.LastNonBlocking(), Is.True);\n\t\t\tawait _model.PopScopeCommand.ExecuteOnceAsync();\n\t\t\tAssert.That(GetRow(0).ElementName.LastNonBlocking(), Is.EqualTo(\"App\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task IsSelected_of_row_for_selected_element_is_true()\n\t\t{\n\t\t\tUpdateXml(\"<App><Panel/><Selected/></App>\");\n\t\t\tawait _context.Select(GetElementByName(\"Selected\"));\n\t\t\tvar selectedRow = GetRowByName(\"Selected\");\n\t\t\tAssert.That(selectedRow.IsSelected.LastNonBlocking(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task IsSelected_of_row_for_not_selected_element_is_false()\n\t\t{\n\t\t\tUpdateXml(\"<App><Panel/><Selected/></App>\");\n\t\t\tawait _context.Select(GetElementByName(\"Selected\"));\n\t\t\tvar selectedRow = GetRowByName(\"Panel\");\n\t\t\tAssert.That(selectedRow.IsSelected.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HeaderText_of_row_for_instance_element_is_correct()\n\t\t{\n\t\t\tUpdateXml(\"<App><Panel/></App>\");\n\t\t\tAssert.That(GetRowByName(\"Panel\").HeaderText.LastNonBlocking(), Is.EqualTo(\"Panel\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HeaderText_of_row_for_ux_class_element_is_correct()\n\t\t{\n\t\t\tUpdateXml(\"<App><Panel ux:Class='MyFancyClass'/></App>\");\n\t\t\tAssert.That(GetRowByName(\"Panel\").HeaderText.LastNonBlocking(), Is.EqualTo(\"MyFancyClass (Panel)\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Selecting_an_element_outside_of_visible_rows_pushes_selected_element_to_ScrollTarget()\n\t\t{\n\t\t\t_model.VisibleRowCount = 2;\n\t\t\tUpdateXml(\"<App><N1/><N2/><N3/><N4/></App>\");\n\n\t\t\tint? scrollTarget = null;\n\t\t\t_model.ScrollTarget.Subscribe(v => scrollTarget = v);\n\t\t\tAssert.That(scrollTarget, Is.Null);\n\n\t\t\tawait _context.Select(GetElementByName(\"N4\"));\n\t\t\tAssert.That(scrollTarget, Is.EqualTo(4));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Model_will_not_keep_alive_elements_after_they_have_been_removed_from_tree()\n\t\t{\n\t\t\tUpdateXml(\"<App><StackPanel><FooBar/></StackPanel></App>\");\n\t\t\tvar row = GetRowByName(\"StackPanel\");\n\t\t\tvar elementWeakRef = GetElementWeakReferenceByName(\"StackPanel\");\n\t\t\tawait row.ExpandToggleCommand.ExecuteOnceAsync();\n\t\t\tUpdateXml(\"<App />\");\n\n\t\t\t// Do a double collect, for good measure.\n\t\t\tGC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true);\n\t\t\tThread.Sleep(100);\n\t\t\tGC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true);\n\n\t\t\tILiveElement _;\n\t\t\tAssert.That(elementWeakRef.TryGetTarget(out _), Is.False);\n\t\t\t// We have to be very careful to not keep a strong reference on the stack\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Elements_that_were_previously_visible_and_still_is_after_update_will_be_assigned_same_row_model()\n\t\t{\n\t\t\t// The point of this test is to make sure the assignment of elements to rows\n\t\t\t// is consistent over several scans, ie. reusing the same row for the same element.\n\n\t\t\tUpdateXml(\"<App><Pre/><Expandable><Inner/></Expandable><Post/></App>\");\n\t\t\tvar preRowBeforeExpandToggle = GetRowByName(\"Pre\");\n\t\t\tvar postRowBeforeExpandToggle = GetRowByName(\"Post\");\n\t\t\tvar expandableRow = GetRowByName(\"Expandable\");\n\t\t\tvar totalRowCountBefore = _lastTotalRowCount;\n\n\t\t\t// Toggling the expand state of the expandable row should either collapse or expand it,\n\t\t\t// either inserting or removing a row from the middle of the list.\n\t\t\tawait expandableRow.ExpandToggleCommand.ExecuteOnceAsync();\n\n\t\t\tAssert.That(_lastTotalRowCount, Is.Not.EqualTo(totalRowCountBefore));\n\t\t\tAssert.That(GetRowByName(\"Pre\"), Is.EqualTo(preRowBeforeExpandToggle));\n\t\t\tAssert.That(GetRowByName(\"Post\"), Is.EqualTo(postRowBeforeExpandToggle));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ExpandToggleCommand_of_expanded_row_collapses_it()\n\t\t{\n\t\t\t// Arrange\n\t\t\tUpdateXml(\"<App><StackPanel><Panel/></StackPanel></App>\");\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(3));\n\t\t\tvar stackRow = GetRow(1);\n\t\t\tAssert.That(stackRow.IsExpanded.LastNonBlocking(), Is.True);\n\n\t\t\t// Act\n\t\t\tawait stackRow.ExpandToggleCommand.ExecuteOnceAsync();\n\n\t\t\t// Assert\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(2));\n\t\t\tAssert.That(stackRow.IsExpanded.LastNonBlocking(), Is.False);\n\t\t\tawait stackRow.ExpandToggleCommand.ExecuteOnceAsync();\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(3));\n\t\t\tAssert.That(stackRow.IsExpanded.LastNonBlocking(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ExpandToggleCommand_of_expanded_row_collapses_it_and_selects_it_when_descendant_was_selected()\n\t\t{\n\t\t\t// Arrange\n\t\t\tUpdateXml(\"<App><StackPanel><Descendant/></StackPanel></App>\");\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(3));\n\t\t\tvar stackRow = GetRowByName(\"StackPanel\");\n\t\t\tAssert.That(stackRow.IsExpanded.LastNonBlocking(), Is.True);\n\t\t\tawait _context.Select(GetElementByName(\"Descendant\"));\n\n\t\t\t// Act\n\t\t\tawait stackRow.ExpandToggleCommand.ExecuteOnceAsync();\n\n\t\t\t//Assert\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(2));\n\t\t\tAssert.That(stackRow.IsSelected.LastNonBlocking(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Root_element_with_ux_class_element_is_expanded()\n\t\t{\n\t\t\tUpdateXml(\"<Panel ux:Class='TurboPanel'><Rectangle /></Panel>\");\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Setting_VisibleRowCount_will_add_new_rows_if_count_of_VisibleRows_is_less()\n\t\t{\n\t\t\tUpdateXml(\"<App><N1/><N2/><N3/><N4/><N5/><N6/><N7/><N8/><N9/><N10/><N11/></App>\");\n\t\t\t// Just checking that our default MaxVisibleRowCount small enough for the test data\n\t\t\tAssert.That(_lastTotalRowCount, Is.GreaterThan(_model.VisibleRowCount));\n\t\t\t_model.VisibleRowCount = 11;\n\t\t\tAssert.That(_lastVisibleRows.Count(), Is.EqualTo(11));\n\t\t\t_model.VisibleRowCount = 3;\n\t\t\t// Decreasing the visible rows isn't expected to reduce the capacity\n\t\t\tAssert.That(_lastVisibleRows.Count(), Is.EqualTo(11));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TotalRowCount_is_updated_when_child_is_added_or_removed_from_element()\n\t\t{\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(2));\n\t\t\tUpdateXml(\"<App><StackPanel><Panel/><Panel/></StackPanel></App>\");\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(4));\n\t\t\tUpdateXml(\"<App><StackPanel /></App>\");\n\t\t\tAssert.That(_lastTotalRowCount, Is.EqualTo(2));\n\t\t}\n\n\t\tvoid UpdateElementIds()\n\t\t{\n\t\t\tvar dict = new Dictionary<ObjectIdentifier, IElement>();\n\t\t\t// Need to update element id first\n\t\t\t_element.UpdateElementIds(_path, 0, dict);\n\t\t}\n\n\t\tITreeRowViewModel GetRow(int rowOffset)\n\t\t{\n\t\t\treturn GetRow(x => x.RowOffset, rowOffset);\n\t\t}\n\n\t\tITreeRowViewModel GetRowByName(string name)\n\t\t{\n\t\t\treturn GetRow(x => x.ElementName, name);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.NoInlining)]\n\t\tWeakReference<ILiveElement> GetElementWeakReferenceByName(string name)\n\t\t{\n\t\t\treturn new WeakReference<ILiveElement>(GetElementByName(name));\n\t\t}\n\n\t\tILiveElement GetElementByName(string name)\n\t\t{\n\t\t\treturn _element.DescendantsAndSelf().First(x => x.Name.Value == name);\n\t\t}\n\n\t\tITreeRowViewModel GetRow<TValue>(Func<ITreeRowViewModel, IObservable<TValue>> obsProp, TValue value)\n\t\t{\n\t\t\tAssert.That(_lastVisibleRows, Is.Not.Null);\n\t\t\tvar classRowModel =\n\t\t\t\t_lastVisibleRows.FirstOrDefault(row => obsProp(row).LastNonBlocking().Equals(value));\n\t\t\tAssert.That(classRowModel, Is.Not.Null);\n\t\t\treturn classRowModel;\n\t\t}\n\n\t\tvoid UpdateXml(string xml)\n\t\t{\n\t\t\t_element.UpdateFrom(xml);\n\t\t\tUpdateElementIds();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/LiveElementFactory.cs",
    "content": "﻿using System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fuse.Live;\nusing Outracks.IO;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Tests\n{\n\tinternal static class LiveElementFactory\n\t{\n\t\tinternal static LiveElement CreateLiveElement(\n\t\t\tstring xmlText,\n\t\t\tOptional<string> path = default(Optional<string>),\n\t\t\tOptional<ISubject<Unit>> invalidated = default(Optional<ISubject<Unit>>))\n\t\t{\n\t\t\tvar root = new LiveElement(\n\t\t\t\tAbsoluteFilePath.Parse(path.Or(\"/project/MainView.ux\")),\n\t\t\t\tObservable.Never<ILookup<ObjectIdentifier, ObjectIdentifier>>(),\n\t\t\t\tObservable.Return(true),\n\t\t\t\tinvalidated.Or(() => (ISubject<Unit>)new Subject<Unit>()),\n\t\t\t\tObserver.Create<IBinaryMessage>(msg => { }),\n\t\t\t\ts => Element.Empty);\n\n\t\t\t// Panel is an example of an instance\n\t\t\t// Circle is an example of a class (called MyClass)\n\t\t\troot.UpdateFrom(SourceFragment.FromString(xmlText).ToXml());\n\n\t\t\treturn root;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/Main/BuildArgsTests.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.Fuse.Tests\n{\n\t[TestFixture]\n\tclass BuildArgsTests\n\t{\n\t\tstatic string[] _argStrings = new[]\n\t\t{\n\t\t\t\"\",\n\t\t\t\"-DLOL1 -DLOL2\",\n\t\t\t\"  -DLOL1 -DLOL2  \",\n\t\t\t\" -DLOL1  \\\"quoted  string with spaces \\\" -DLOL2  \",\n\t\t};\n\n\t\tstatic string[][] _argLists = new[]\n\t\t{\n\t\t\tnew string[0],\n\t\t\tnew[] { \"-DLOL1\", \"-DLOL2\" },\n\t\t\tnew[] { \"-DLOL1\", \"-DLOL2\" },\n\t\t\tnew[] { \"-DLOL1\", \"quoted  string with spaces \", \"-DLOL2\" },\n\t\t};\n\n\t\t[Test]\n\t\tpublic void GetArgumentList()\n\t\t{\n\t\t\tfor (var i = 0; i < _argStrings.Length; ++i)\n\t\t\t\tCollectionAssert.AreEqual(_argLists[i], BuildArgs.GetArgumentList(_argStrings[i]));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ArgumentRoundTrip1()\n\t\t{\n\t\t\tforeach (var argList in _argLists)\n\t\t\t{\n\t\t\t\tvar argString = BuildArgs.GetArgumentString(argList);\n\t\t\t\tCollectionAssert.AreEqual(argList, BuildArgs.GetArgumentList(argString));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ArgumentRoundTrip2()\n\t\t{\n\t\t\tforeach (var argString in _argStrings)\n\t\t\t{\n\t\t\t\tvar argList = BuildArgs.GetArgumentList(argString);\n\t\t\t\tvar argString2 = BuildArgs.GetArgumentString(argList);\n\t\t\t\tCollectionAssert.AreEqual(argList, BuildArgs.GetArgumentList(argString2));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/Main/GlVersionParsingTests.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Fuse.Studio;\n\nnamespace Outracks.Fuse.Protocol.Tests.Main\n{\n\tclass GlVersionParsingTests\n\t{\n\t\tIReport _report;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_report = Substitute.For<IReport>();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReportsVersionAndVendorAndRenderer()\n\t\t{\n\t\t\tvar messages = GlVersionParsing.GetLogMessages(new OpenGlVersion(\"3.1\", \"Acme\", \"3Dfx Voodoo\"), _report).ToList();\n\t\t\tAssert.AreEqual(\"OpenGL Version: 3.1\\n\", messages[0]);\n\t\t\tAssert.AreEqual(\"OpenGL Vendor: Acme\\n\", messages[1]);\n\t\t\tAssert.AreEqual(\"OpenGL Renderer: 3Dfx Voodoo\\n\", messages[2]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WarnsWhenCantParseGlVersion()\n\t\t{\n\t\t\tvar messages = GlVersionParsing.GetLogMessages(new OpenGlVersion(\"lol.meh\", \"Acme\", \"3Dfx Voodoo\"), _report).ToList();\n\t\t\tAssert.Contains(\"Warning: Failed to detect OpenGL version. The required version is 2.1, your computer reports 'lol.meh'\", messages);\n\t\t\t_report.Received(1).Warn(\"OpenGL parsing error: 'lol.meh'\", ReportTo.Headquarters | ReportTo.Log);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ErrorsWhenOpenGlVersionIsNotSupported()\n\t\t{\n\t\t\tvar messages = GlVersionParsing.GetLogMessages(new OpenGlVersion(\"1.1.0\", \"Acme\", \"3Dfx Voodoo\"), _report).ToList();\n\t\t\tvar expected = \"Error: The required OpenGL version is 2.1, your computer reports '1.1.0'\";\n\t\t\t_report.Received(1).Error(expected, ReportTo.Log);\n\t\t\tAssert.Contains(expected, messages);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoErrorsOrWarningsWhenEverythingIsFine()\n\t\t{\n\t\t\tvar messages = GlVersionParsing.GetLogMessages(new OpenGlVersion(\"3.1\", \"Acme\", \"3Dfx Voodoo\"), _report).ToList();\n\t\t\tAssert.IsFalse(messages.Any(s => s.Contains(\"Warning\")));\n\t\t\tAssert.IsFalse(messages.Any(s => s.Contains(\"Error\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParsesExpectedStrings()\n\t\t{\n\t\t\tAssert.AreEqual(new Version(4, 5), CreateAndParse(\"4.5.0 NVIDIA 382.05\").Value);\n\t\t\tAssert.AreEqual(new Version(3, 1), CreateAndParse(\"3.1 blah 1.2\").Value);\n\t\t\tAssert.AreEqual(new Version(1, 1), CreateAndParse(\"1.1 foo\").Value);\n\t\t\tAssert.AreEqual(new Version(2, 3), CreateAndParse(\"  2.3 foo  \").Value);\n\t\t\tAssert.AreEqual(new Version(1, 5), CreateAndParse(\"1.5\").Value);\n\t\t\tAssert.AreEqual(new Version(2, 3), CreateAndParse(\"  2.3  \").Value);\n\t\t\tAssert.AreEqual(new Version(1, 1), CreateAndParse(\"1.1.0\").Value); //Gode gamle GDI Generic\n\t\t\tAssert.AreEqual(new Version(4, 4), CreateAndParse(\"4.4.12874 Compatibility Profile Context 14.100.0.0\").Value);\n\t\t}\n\n\t\t[Test]\n\t\t//These are too scary to rely on, better to fail than to get the wrong version\n\t\tpublic void FailsOnStringsWeCantRelyOn()\n\t\t{\n\t\t\tAssert.IsFalse(CreateAndParse(\"Blah 2.1\").HasValue);\n\t\t\tAssert.IsFalse(CreateAndParse(\"2.1lol\").HasValue);\n\t\t\tAssert.IsFalse(CreateAndParse(\"1.2.3.4\").HasValue);\n\t\t}\n\n\t\tstatic Optional<Version> CreateAndParse(string glVersion)\n\t\t{\n\t\t\treturn new OpenGlVersion(glVersion, \"\", \"\").ToVersion();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IsSupported()\n\t\t{\n\t\t\tAssert.IsTrue(new Version(2, 1).IsSupported());\n\t\t\tAssert.IsTrue(new Version(3, 2).IsSupported());\n\t\t\tAssert.IsFalse(new Version(2, 0).IsSupported());\n\t\t\tAssert.IsFalse(new Version(1, 0).IsSupported());\n\t\t\tAssert.IsFalse(new Version(0, 0).IsSupported());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Main/SelectionTests.cs",
    "content": "﻿using NUnit.Framework;\nusing Outracks.Fuse.Protocol.Messages;\n\nnamespace Outracks.Fuse.Tests\n{\n\t[TestFixture]\n\tclass SelectionTests\n\t{\n\t\t[Test]\n\t\tpublic void FindSelectionIndexWhenJavaScriptTagHasNoContent()\n\t\t{\n\t\t\tconst string xml = \"<App><JavaScript>function someFunction() {};</JavaScript><ClientPanel><DockPanel Height=\\\"56\\\" Dock=\\\"Top\\\" Background=\\\"#ffc\\\"><Text Background=\\\"#dfd\\\" Value=\\\"Some text\\\" Alignment=\\\"Center\\\" Color=\\\"#000\\\" FontSize=\\\"20\\\" ></Text></DockPanel></ClientPanel></App>\";\n\n\t\t\tAssert.AreEqual(2, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"ClientPanel\") }));\n\t\t\tAssert.AreEqual(3, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"DockPanel\") }));\n\t\t\tAssert.AreEqual(4, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"Text\") }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FindSelectionIndexWhenJavaScriptTagHasNoContentEmptyText()\n\t\t{\n\t\t\tconst string xml = \"<App><JavaScript>function someFunction() {};</JavaScript><ClientPanel><DockPanel Height=\\\"56\\\" Dock=\\\"Top\\\" Background=\\\"#ffc\\\"><Text Background=\\\"#dfd\\\" Value=\\\"Some text\\\" Alignment=\\\"Center\\\" Color=\\\"#000\\\" FontSize=\\\"20\\\" /></DockPanel></ClientPanel></App>\";\n\n\t\t\tAssert.AreEqual(2, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"ClientPanel\") }));\n\t\t\tAssert.AreEqual(3, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"DockPanel\") }));\n\t\t\tAssert.AreEqual(4, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"Text\") }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FindCorrectSelectionIndexWhenJavaScriptHasXmlSymbols()\n\t\t{\n\t\t\tconst string xml = \"<App><JavaScript>function someFunction() {for (var i = 0; i < 2; i++) {}}</JavaScript><ClientPanel><DockPanel Height=\\\"56\\\" Dock=\\\"Top\\\" Background=\\\"#ffc\\\"><Text Background=\\\"#dfd\\\" Value=\\\"Some text\\\" Alignment=\\\"Center\\\" Color=\\\"#000\\\" FontSize=\\\"20\\\" ></Text></DockPanel></ClientPanel></App>\"; ;\n\t\t\tAssert.AreEqual(2, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"ClientPanel\") }));\n\t\t\tAssert.AreEqual(3, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"DockPanel\") }));\n\t\t\tAssert.AreEqual(4, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"Text\") }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FindSelectionIndexForXmlWithJavaScriptEmptyTextTag()\n\t\t{\n\t\t\tconst string xml =\n\t\t\t\"<App><JavaScript>function someFunction() {for (var i = 0; i < 2; i++) {}}</JavaScript><ClientPanel><DockPanel Height=\\\"56\\\" Dock=\\\"Top\\\" Background=\\\"#ffc\\\"><Text Background=\\\"#dfd\\\" Value=\\\"Some text\\\" Alignment=\\\"Center\\\" Color=\\\"#000\\\" FontSize=\\\"20\\\" /></DockPanel></ClientPanel></App>\";\n\t\t\tAssert.AreEqual(2, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"ClientPanel\") }));\n\t\t\tAssert.AreEqual(3, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"DockPanel\") }));\n\t\t\tAssert.AreEqual(4, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"Text\") }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FindCorrectSelectionIndexWhenJavaScriptTagImportsFile()\n\t\t{\n\t\t\tconst string xml =\n\t\t\t\t\"<App><JavaScript File=\\\"dummy.js\\\"/><ClientPanel><JavaScript><remove-this-garbage></JavaScript><DockPanel><Text></Text></DockPanel></ClientPanel></App>\";\n\t\t\tAssert.AreEqual(4, ExternalSelection.TryGetElementIndex(xml, new TextPosition { Line = 1, Character = xml.IndexOf(\"DockPanel\") }));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Markup/ElementTest.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing System.Xml.Linq;\nusing NUnit.Framework;\nusing Outracks.Fuse.Live;\nusing Outracks.IO;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Markup\n{\n\t[TestFixture]\n\tclass ElementTest\n\t{\n\t\t[Test]\n\t\tpublic static async Task Replace()\n\t\t{\n\t\t\tvar element = CreateTree(\"<Parent><FirstChild><GrandChild /></FirstChild><SecondChild /></Parent>\");\n\t\t\tvar children = ImmutableList.ToImmutableList((await element.Children.FirstAsync()));\n\t\t\tvar child = children.First();\n\t\t\tvar copy = await child.Copy();\n\t\t\tvar newChildContent = SourceFragment.FromString(\"<ChangedChild><InnerChild /></ChangedChild>\");\n\t\t\tawait child.Replace(old =>\n\t\t\t{\n\t\t\t\tAssert.That(old, Is.EqualTo(copy));\n\t\t\t\treturn Task.FromResult(newChildContent);\n\t\t\t});\n\n\t\t\tvar newCopy = await child.Copy();\n\t\t\tAssert.That(newCopy, Is.EqualTo(newChildContent));\n\n\t\t\tvar newChildren = await element.Children.FirstAsync();\n\t\t\tAssert.That(newChildren, Is.EqualTo(children));\n\t\t\tAssert.That((await element.Copy()).ToString(), Is.EqualTo(\"<Parent><ChangedChild><InnerChild /></ChangedChild><SecondChild /></Parent>\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic static async Task Cut()\n\t\t{\n\t\t\tvar parent = CreateTree();\n\t\t\tvar siblings = ImmutableList.ToImmutableList((await parent.Children.FirstAsync()));\n\t\t\tvar copy = await siblings[0].Copy();\n\t\t\tvar cut = await siblings[0].Cut();\n\t\t\tAssert.That(cut, Is.EqualTo(copy));\n\n\t\t\tvar newSiblings = await parent.Children.FirstAsync();\n\t\t\tAssert.That(newSiblings, Is.EquivalentTo(siblings.RemoveAt(0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic static async Task Copy()\n\t\t{\n\t\t\tvar element = CreateTree();\n\t\t\tvar src = await element.Copy();\n\t\t\tAssert.That(src.ToString(), Is.EqualTo(\"<Parent><FirstChild /><SecondChild /></Parent>\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic static async Task Paste()\n\t\t{\n\t\t\tvar parent = CreateTree();\n\t\t\tvar siblings = ImmutableList.ToImmutableList((await parent.Children.FirstAsync()));\n\t\t\tvar childFragment = SourceFragment.FromString(\"<TheThing/>\");\n\t\t\tvar child = parent.Paste(childFragment);\n\n\t\t\tvar newSiblings = await parent.Children.FirstAsync();\n\t\t\tAssert.That(newSiblings, Is.EqualTo(siblings.Add(child)));\n\n\t\t\tvar src = await parent.Copy();\n\t\t\tAssert.That(src.ToString(), Is.EqualTo(\"<Parent><FirstChild /><SecondChild /><TheThing /></Parent>\"));\n\t\t}\n\n\t\t[Test]\n\t\t[TestCase(\n\t\t\t\"<App>\\n    <Parent>\\n        <Removed />\\n    </Parent>\\n</App>\",\n\t\t\t\"<App>\\n    <Parent />\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n    <Parent>\\n        <Keep />\\n        <Removed />\\n        <Keep />\\n    </Parent>\\n</App>\",\n\t\t\t\"<App>\\n    <Parent>\\n        <Keep />\\n        <Keep />\\n    </Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n    <Parent>\\n        <Removed />\\n        <Keep />\\n    </Parent>\\n</App>\",\n\t\t\t\"<App>\\n    <Parent>\\n        <Keep />\\n    </Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n    <Parent>\\n        <Keep />\\n        <Removed />\\n    </Parent>\\n</App>\",\n\t\t\t\"<App>\\n    <Parent>\\n        <Keep />\\n    </Parent>\\n</App>\")]\n\t\tpublic static async Task Cut_indents_surrounding_remaining_area(string initial, string expected)\n\t\t{\n\t\t\tConsole.WriteLine(\"Initial:\\n{0}\\n\", initial.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar root = (LiveElement) CreateTree();\n\t\t\troot.UpdateFrom(SourceFragment.FromString(initial).ToXml());\n\t\t\tvar parent = (await root.Children.FirstAsync()).First();\n\n\t\t\tvar removed = (await parent.Children.WherePerElement(x => x.Name.Is(\"Removed\")).FirstAsync()).First();\n\t\t\tawait removed.Cut();\n\n\t\t\tvar src = await root.Copy();\n\t\t\tConsole.WriteLine(\"Expected:\\n{0}\\n\", expected.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar actual = src.ToString();\n\t\t\tConsole.WriteLine(\"Actual:\\n{0}\\n\", actual.Replace(\"\\t\", \"⭾\"));\n\t\t\tAssert.That(actual, Is.EqualTo(expected.Replace(\"\\n\", Environment.NewLine)));\n\t\t}\n\n\t\t[Test]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<ExistingChild />\\n\\t\\t<Copied>\\n\\t\\t\\t<ThingChild />\\n\\t\\t</Copied>\\n\\t</Parent>\\n</App>\",\n\t\t\t\"<Copied>\\n\\t<ThingChild />\\n</Copied>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<ExistingChild />\\n\\t\\t<Copied>\\n\\t\\t\\t<ThingChild>\\n\\t\\t\\t\\t<GrandChild />\\n\\t\\t\\t</ThingChild>\\n\\t\\t</Copied>\\n\\t</Parent>\\n</App>\",\n\t\t\t\"<Copied>\\n\\t<ThingChild>\\n\\t\\t<GrandChild />\\n\\t</ThingChild>\\n</Copied>\")]\n\t\tpublic static async Task Copy_element_spanning_several_lines_removes_outer_indentation(string initial, string expected)\n\t\t{\n\t\t\tConsole.WriteLine(\"Initial:\\n{0}\\n\", initial.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar root = (LiveElement) CreateTree();\n\t\t\troot.UpdateFrom(SourceFragment.FromString(initial).ToXml());\n\t\t\tvar parent = (await root.Children.FirstAsync()).First();\n\t\t\tvar copied = (await parent.Children.WherePerElement(x => x.Name.Is(\"Copied\")).FirstAsync()).First();\n\t\t\tvar actual = (await copied.Copy()).ToString();\n\t\t\tConsole.WriteLine(\"Expected:\\n{0}\\n\", expected.Replace(\"\\t\", \"⭾\"));\n\t\t\tConsole.WriteLine(\"Actual:\\n{0}\\n\", actual.Replace(\"\\t\", \"⭾\"));\n\t\t\tAssert.That(actual, Is.EqualTo(expected.Replace(\"\\n\", Environment.NewLine)));\n\t\t}\n\n\t\t[Test]\n\t\t[TestCase(\n\t\t\t\"<App>\\n    <Parent/>\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n    <Parent>\\n        <TheThing />\\n    </Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent/>\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<TheThing />\\n\\t</Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent></Parent>\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<TheThing />\\n\\t</Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<!-- COMMENT -->\\n</Parent>\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<!-- COMMENT -->\\n\\t\\t<TheThing />\\n</Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t</Parent>\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<TheThing />\\n\\t</Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<ExistingChild />\\n\\t</Parent>\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<ExistingChild />\\n\\t\\t<TheThing />\\n\\t</Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<ExistingChild />\\n\\t</Parent>\\n</App>\",\n\t\t\t\"<TheThing>\\n\\t<ThingChild />\\n</TheThing>\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<ExistingChild />\\n\\t\\t<TheThing>\\n\\t\\t\\t<ThingChild />\\n\\t\\t</TheThing>\\n\\t</Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent />\\n</App>\",\n\t\t\t\"<TheThing>\\n\\t<ThingChild />\\n</TheThing>\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<TheThing>\\n\\t\\t\\t<ThingChild />\\n\\t\\t</TheThing>\\n\\t</Parent>\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n\\t<Parent />\\n</App>\",\n\t\t\t\"<TheThing>\\n\\t<ThingChild>\\n\\t\\t<GrandChild />\\n\\t</ThingChild>\\n</TheThing>\",\n\t\t\t\"<App>\\n\\t<Parent>\\n\\t\\t<TheThing>\\n\\t\\t\\t<ThingChild>\\n\\t\\t\\t\\t<GrandChild />\\n\\t\\t\\t</ThingChild>\\n\\t\\t</TheThing>\\n\\t</Parent>\\n</App>\")]\n\t\tpublic static async Task Paste_indents_element(string initial, string pasted, string expected)\n\t\t{\n\t\t\tConsole.WriteLine(\"Initial:\\n{0}\\n\", initial.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar root = (LiveElement) CreateTree();\n\t\t\troot.UpdateFrom(SourceFragment.FromString(initial).ToXml());\n\t\t\tvar parent = (await root.Children.FirstAsync()).First();\n\n\t\t\tvar childFragment = SourceFragment.FromString(pasted);\n\t\t\tparent.Paste(childFragment);\n\n\t\t\tvar src = await root.Copy();\n\t\t\tConsole.WriteLine(\"Expected:\\n{0}\\n\", expected.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar actual = src.ToString();\n\t\t\tConsole.WriteLine(\"Actual:\\n{0}\\n\", actual.Replace(\"\\t\", \"⭾\"));\n\t\t\tAssert.That(actual, Is.EqualTo(expected.Replace(\"\\n\", Environment.NewLine)));\n\t\t}\n\n\t\t[Test]\n\t\t[TestCase(\n\t\t\t\"<App>\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n\\t<TheThing />\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App />\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n\\t<TheThing />\\n</App>\")]\n\t\tpublic static async Task Paste_in_root_indents_element_using_tab_by_default(string initial, string pasted, string expected)\n\t\t{\n\t\t\tConsole.WriteLine(\"Initial:\\n{0}\\n\", initial.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar root = (LiveElement)CreateTree();\n\t\t\troot.UpdateFrom(SourceFragment.FromString(initial).ToXml());\n\n\t\t\tvar childFragment = SourceFragment.FromString(pasted);\n\t\t\troot.Paste(childFragment);\n\n\t\t\tvar src = await root.Copy();\n\t\t\tConsole.WriteLine(\"Expected:\\n{0}\\n\", expected.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar actual = src.ToString();\n\t\t\tConsole.WriteLine(\"Actual:\\n{0}\\n\", actual.Replace(\"\\t\", \"⭾\"));\n\t\t\tAssert.That(actual, Is.EqualTo(expected.Replace(\"\\n\", Environment.NewLine)));\n\t\t}\n\n\n\n\t\t[Test]\n\t\t[TestCase(\n\t\t\t\"<App>\\n  <Sibling />\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n  <Sibling />\\n  <TheThing />\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n  <First />\\n  <Sibling />\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n  <First />\\n  <Sibling />\\n  <TheThing />\\n</App>\")]\n\t\tpublic static async Task Paste_after_indents_element(string initial, string pasted, string expected)\n\t\t{\n\t\t\tConsole.WriteLine(\"Initial:\\n{0}\\n\", initial.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar root = (LiveElement) CreateTree();\n\t\t\troot.UpdateFrom(SourceFragment.FromString(initial).ToXml());\n\t\t\tvar parent = (await root.Children.WherePerElement(x => x.Name.Is(\"Sibling\")).FirstAsync()).First();\n\n\t\t\tvar pastedFragment = SourceFragment.FromString(pasted);\n\t\t\tparent.PasteAfter(pastedFragment);\n\n\t\t\tvar src = await root.Copy();\n\t\t\tConsole.WriteLine(\"Expected:\\n{0}\\n\", expected.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar actual = src.ToString();\n\t\t\tConsole.WriteLine(\"Actual:\\n{0}\\n\", actual.Replace(\"\\t\", \"⭾\"));\n\t\t\tAssert.That(actual, Is.EqualTo(expected.Replace(\"\\n\", Environment.NewLine)));\n\t\t}\n\n\t\t[Test]\n\t\t[TestCase(\n\t\t\t\"<App>\\n  <Sibling />\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n  <TheThing />\\n  <Sibling />\\n</App>\")]\n\t\t[TestCase(\n\t\t\t\"<App>\\n  <First />\\n  <Sibling />\\n</App>\",\n\t\t\t\"<TheThing />\",\n\t\t\t\"<App>\\n  <First />\\n  <TheThing />\\n  <Sibling />\\n</App>\")]\n\t\tpublic static async Task Paste_before_indents_element(string initial, string pasted, string expected)\n\t\t{\n\t\t\tConsole.WriteLine(\"Initial:\\n{0}\\n\", initial.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar root = (LiveElement) CreateTree();\n\t\t\troot.UpdateFrom(SourceFragment.FromString(initial).ToXml());\n\t\t\tvar parent = (await root.Children.WherePerElement(x => x.Name.Is(\"Sibling\")).FirstAsync()).First();\n\n\t\t\tvar pastedFragment = SourceFragment.FromString(pasted);\n\t\t\tparent.PasteBefore(pastedFragment);\n\n\t\t\tvar src = await root.Copy();\n\t\t\tConsole.WriteLine(\"Expected:\\n{0}\\n\", expected.Replace(\"\\t\", \"⭾\"));\n\t\t\tvar actual = src.ToString();\n\t\t\tConsole.WriteLine(\"Actual:\\n{0}\\n\", actual.Replace(\"\\t\", \"⭾\"));\n\t\t\tAssert.That(actual, Is.EqualTo(expected.Replace(\"\\n\", Environment.NewLine)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic static async Task PasteAfter()\n\t\t{\n\t\t\tvar parent = CreateTree();\n\t\t\tvar siblings = ImmutableList.ToImmutableList((await parent.Children.FirstAsync()));\n\n\t\t\tvar childFragment = SourceFragment.FromString(\"<TheThing/>\");\n\t\t\tvar child = siblings[0].PasteAfter(childFragment);\n\n\t\t\tvar newSiblings = await parent.Children.FirstAsync();\n\t\t\tAssert.That(newSiblings, Is.EqualTo(siblings.Insert(1, child)));\n\n\t\t\tvar src = await parent.Copy();\n\t\t\tAssert.That(src.ToString(), Is.EqualTo(\"<Parent><FirstChild /><TheThing /><SecondChild /></Parent>\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic static async Task PasteBefore()\n\t\t{\n\t\t\tvar parent = CreateTree();\n\t\t\tvar siblings = ImmutableList.ToImmutableList((await parent.Children.FirstAsync()));\n\n\t\t\tvar childFragment = SourceFragment.FromString(\"<TheThing/>\");\n\t\t\tvar child = siblings[0].PasteBefore(childFragment);\n\n\t\t\tvar newSiblings = await parent.Children.FirstAsync();\n\t\t\tAssert.That(newSiblings, Is.EqualTo(siblings.Insert(0, child)));\n\n\t\t\tvar src = await parent.Copy();\n\t\t\tAssert.That(src.ToString(), Is.EqualTo(\"<Parent><TheThing /><FirstChild /><SecondChild /></Parent>\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic static async Task UpdateFrom_gives_correct_children_ordering()\n\t\t{\n\t\t\tvar parent = (LiveElement) CreateTree();\n\t\t\tparent.UpdateFrom(XElement.Parse(@\"<App><Circle /><Text /></App>\"));\n\t\t\tparent.UpdateFrom(XElement.Parse(@\"<App><Text /><Circle /><Text /></App>\"));\n\t\t\tvar childElementNames =\n\t\t\t\tawait parent.Children.Select(\n\t\t\t\t\t\tchildren => children.Select(el => (IObservable<string>) el.Name)\n\t\t\t\t\t\t\t.CombineLatest())\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.FirstAsync();\n\n\t\t\tCollectionAssert.AreEqual(childElementNames, new [] { \"Text\", \"Circle\", \"Text\" });\n\t\t}\n\n\t\tstatic IElement CreateTree(string xmlText = \"<Parent><FirstChild /><SecondChild /></Parent>\")\n\t\t{\n\t\t\tvar parent = new LiveElement(\n\t\t\t\tAbsoluteFilePath.Parse(\"foo/bar\"),\n\t\t\t\tObservable.Never<ILookup<ObjectIdentifier, ObjectIdentifier>>(),\n\t\t\t\tObservable.Return(true),\n\t\t\t\tnew Subject<Unit>(),\n\t\t\t\tObserver.Create<IBinaryMessage>(msg => { }),\n\t\t\t\ts => Element.Empty);\n\n\t\t\tparent.UpdateFrom(SourceFragment.FromString(xmlText).ToXml());\n\n\t\t\treturn parent;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Markup/SourceFragmentTest.cs",
    "content": "﻿using System.IO;\nusing System.Xml;\nusing System.Xml.Linq;\nusing NUnit.Framework;\n\nnamespace Outracks.Fuse.Markup\n{\n\t[TestFixture]\n\tclass SourceFragmentTest\n\t{\n\t\tstatic readonly SourceFragment Fragment = SourceFragment.FromString(\"<App><DockPanel></DockPanel></App>\");\n\n\t\t[Test]\n\t\tpublic static void ToStringIsRoundtripInvariant()\n\t\t{\n\t\t\tvar fragmentString = Fragment.ToString();\n\t\t\tvar trippedFragment = SourceFragment.FromString(fragmentString);\n\t\t\tAssert.AreEqual(Fragment, trippedFragment);\n\t\t}\n\n\t\t[Test]\n\t\tpublic static void ToXmlIsRoundtripInvariant()\n\t\t{\n\t\t\tvar fragmentXml = Fragment.ToXml();\n\t\t\tvar trippedFragment = SourceFragment.FromXml(fragmentXml);\n\t\t\tAssert.AreEqual(Fragment, trippedFragment);\n\t\t}\n\n\t\t[Test]\n\t\tpublic static void ToXmlReturnsXElementWithNoParent()\n\t\t{\n\t\t\tAssert.AreEqual(null, Fragment.ToXml().Parent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic static void ToXmlReturnsXElementWithNoDocument()\n\t\t{\n\t\t\tAssert.AreEqual(null, Fragment.ToXml().Document);\n\t\t}\n\n\t\t[Test]\n\t\tpublic static void ToXmlReturnsNewXElement()\n\t\t{\n\t\t\tvar element = new XElement(\"Tjoho\");\n\t\t\tvar fragment = SourceFragment.FromXml(element);\n\t\t\tAssert.AreNotEqual(element, fragment.ToXml());\n\t\t}\n\n\t\t[Test]\n\t\tpublic static void ToXmlThrowsOnInvalidUx()\n\t\t{\n\t\t\tAssert.Throws<XmlException>(() => SourceFragment.FromString(\"<App><asdf</App>\").ToXml());\n\t\t}\n\n\t\t[Test]\n\t\tpublic static void WriteDataIsRoundtripInvariant()\n\t\t{\n\t\t\tusing (var stream = new MemoryStream())\n\t\t\tusing (var reader = new BinaryReader(stream))\n\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t{\n\t\t\t\tFragment.WriteTo(writer);\n\t\t\t\tstream.Seek(0, SeekOrigin.Begin);\n\t\t\t\tvar trippedFragment = SourceFragment.ReadFrom(reader);\n\t\t\t\tAssert.AreEqual(Fragment, trippedFragment);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/MessageDatabase.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\n\nnamespace Outracks.EditorService.Tests\n{\n\tclass MessageDatabase\n\t{\n\t\treadonly string _name;\n\t\treadonly List<MessageDatabaseItem> _messageDatabaseItems;\n\n\t\tMessageDatabase(string name, List<MessageDatabaseItem> messageDatabaseItems)\n\t\t{\n\t\t\t_name = name;\n\t\t\t_messageDatabaseItems = messageDatabaseItems;\n\t\t}\n\n\t\tpublic static bool IsEqualWhileIgnoreComments(MessageDatabase a, MessageDatabase b, IObserver<string> errors)\n\t\t{\n\t\t\tif (a._name != b._name)\n\t\t\t{\n\t\t\t\terrors.OnNext(string.Format(\"Message name differs, A = {0}, B = {1}\", a._name, b._name));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (a._messageDatabaseItems.Count != b._messageDatabaseItems.Count)\n\t\t\t{\n\t\t\t\terrors.OnNext(string.Format(\"Looks like you either have removed or added a new datafield\"));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tforeach (var aItem in a._messageDatabaseItems)\n\t\t\t{\n\t\t\t\tvar isEqual = b._messageDatabaseItems.FirstOrDefault(bItem => MessageDatabaseItem.IsEqualWhileIgnoreComments(aItem, bItem));\n\n\t\t\t\tif (isEqual == null)\n\t\t\t\t{\n\t\t\t\t\tvar errorStringBuilder = new StringBuilder();\n\t\t\t\t\terrorStringBuilder.Append(\"A property/field has changed, expected to find: \" + aItem.Name + \"\\nWidth: \");\n\t\t\t\t\tforeach (var child in aItem.Children)\n\t\t\t\t\t\terrorStringBuilder.Append(child.Name + \",\");\n\n\t\t\t\t\terrors.OnNext(errorStringBuilder.ToString());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void Dump(AbsoluteFilePath filePath)\n\t\t{\n\t\t\tDirectory.CreateDirectory(filePath.ContainingDirectory.NativePath);\n\n\t\t\tusing (var file = File.Open(filePath.NativePath, FileMode.Create))\n\t\t\tusing (var writer = new BinaryWriter(file))\n\t\t\t{\n\t\t\t\twriter.Write(_name);\n\t\t\t\twriter.Write(_messageDatabaseItems.Count);\n\t\t\t\tforeach (var messageDatabaseItem in _messageDatabaseItems)\n\t\t\t\t{\n\t\t\t\t\tMessageDatabaseItem.Write(messageDatabaseItem, writer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static MessageDatabase From(AbsoluteFilePath filePath)\n\t\t{\n\t\t\tusing(var file = File.Open(filePath.NativePath, FileMode.Open))\n\t\t\tusing (var reader = new BinaryReader(file))\n\t\t\t{\n\t\t\t\tvar databaseItems = new List<MessageDatabaseItem>();\n\t\t\t\tvar name = reader.ReadString();\n\t\t\t\tvar count = reader.ReadInt32();\n\t\t\t\tfor (var i = 0; i < count; ++i)\n\t\t\t\t{\n\t\t\t\t\tdatabaseItems.Add(MessageDatabaseItem.Read(reader));\n\t\t\t\t}\n\n\t\t\t\treturn new MessageDatabase(name, databaseItems);\n\t\t\t}\n\t\t}\n\n\t\tpublic static MessageDatabase From(IMessagePayload message)\n\t\t{\n\t\t\tvar databaseItems = new List<MessageDatabaseItem>();\n\t\t\tvar properties = message.GetType().GetPropertiesAndFields();\n\t\t\tforeach (var propertyInfo in properties)\n\t\t\t{\n\t\t\t\tCreateDatabaseItem(propertyInfo).Do(databaseItems.Add);\n\t\t\t}\n\n\t\t\treturn new MessageDatabase(message.GetPayloadType(), databaseItems);\n\t\t}\n\n\t\tstatic Optional<MessageDatabaseItem> CreateDatabaseItem(MemberInfo memberInfo)\n\t\t{\n\t\t\tvar attrib = (PluginCommentAttribute) Attribute.GetCustomAttribute(memberInfo, typeof (PluginCommentAttribute));\n\t\t\tif (attrib == null)\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar children = new List<MessageDatabaseItem>();\n\t\t\tvar underlyingType = memberInfo.GetUnderlyingType();\n\t\t\tvar genericArguments = underlyingType.GetGenericArguments();\n\t\t\tif (genericArguments.Length == 1)\n\t\t\t{\n\t\t\t\tunderlyingType = genericArguments[0];\n\t\t\t}\n\n\t\t\tforeach (var propertyChild in underlyingType.GetPropertiesAndFields())\n\t\t\t{\n\t\t\t\tCreateDatabaseItem(propertyChild).Do(children.Add);\n\t\t\t}\n\n\t\t\treturn new MessageDatabaseItem(memberInfo.Name, attrib, children);\n\t\t}\n\t}\n\n\tstatic class TypeHelper\n\t{\n\t\tpublic static IEnumerable<MemberInfo> GetPropertiesAndFields(this Type type)\n\t\t{\n\t\t\treturn type.GetProperties().OfType<MemberInfo>().Concat(type.GetFields());\n\t\t}\n\n\t\tpublic static Type GetUnderlyingType(this MemberInfo member)\n\t\t{\n\t\t\tswitch (member.MemberType)\n\t\t\t{\n\t\t\t\tcase MemberTypes.Event:\n\t\t\t\t\treturn ((EventInfo)member).EventHandlerType;\n\t\t\t\tcase MemberTypes.Field:\n\t\t\t\t\treturn ((FieldInfo)member).FieldType;\n\t\t\t\tcase MemberTypes.Method:\n\t\t\t\t\treturn ((MethodInfo)member).ReturnType;\n\t\t\t\tcase MemberTypes.Property:\n\t\t\t\t\treturn ((PropertyInfo)member).PropertyType;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new ArgumentException\n\t\t\t\t\t(\n\t\t\t\t\t \"Input MemberInfo must be if type EventInfo, FieldInfo, MethodInfo, or PropertyInfo\"\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/MessageDatabaseItem.cs",
    "content": "using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Outracks.Fuse.Protocol;\n\nnamespace Outracks.EditorService.Tests\n{\n\tclass MessageDatabaseItem\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly PluginCommentAttribute Comment;\n\t\tpublic readonly List<MessageDatabaseItem> Children;\n\n\t\tpublic MessageDatabaseItem(string name, PluginCommentAttribute comment, List<MessageDatabaseItem> children)\n\t\t{\n\t\t\tName = name;\n\t\t\tComment = comment;\n\t\t\tChildren = children;\n\t\t}\n\n\t\tpublic static bool IsEqualWhileIgnoreComments(MessageDatabaseItem a, MessageDatabaseItem b)\n\t\t{\n\t\t\tif (a.Name != b.Name)\n\t\t\t\treturn false;\n\n\t\t\tif (a.Children.Count != b.Children.Count)\n\t\t\t\treturn false;\n\n\t\t\tforeach (var childA in a.Children)\n\t\t\t{\n\t\t\t\tvar isEqual = b.Children.FirstOrDefault(childB => IsEqualWhileIgnoreComments(childA, childB));\n\t\t\t\tif (isEqual == null)\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static void Write(MessageDatabaseItem item, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(item.Name);\n\t\t\twriter.Write(item.Comment.Comment);\n\t\t\twriter.Write(item.Comment.Example);\n\t\t\twriter.Write(item.Comment.IsNumber);\n\t\t\twriter.Write(item.Children.Count);\n\n\t\t\tforeach (var child in item.Children)\n\t\t\t{\n\t\t\t\tWrite(child, writer);\n\t\t\t}\n\t\t}\n\n\t\tpublic static MessageDatabaseItem Read(BinaryReader reader)\n\t\t{\n\t\t\tvar name = reader.ReadString();\n\t\t\tvar comment = reader.ReadString();\n\t\t\tvar example = reader.ReadString();\n\t\t\tvar isNumber = reader.ReadBoolean();\n\t\t\tvar numChildren = reader.ReadInt32();\n\n\t\t\tvar children = new List<MessageDatabaseItem>();\n\t\t\tfor (var i = 0; i < numChildren; ++i)\n\t\t\t{\n\t\t\t\tchildren.Add(Read(reader));\n\t\t\t}\n\n\t\t\treturn new MessageDatabaseItem(name, new PluginCommentAttribute(comment, example, isNumber), children);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/MessageIntegrityTests.cs",
    "content": "﻿using System;\nusing System.Reactive.Subjects;\nusing NUnit.Framework;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\n\nnamespace Outracks.EditorService.Tests\n{\n\t[TestFixture]\n\tclass MessageIntegrityTests\n\t{\n\t\tstring BasePath;\n//\t\tstring GetCodeSuggestionsRequestDb;\n//\t\tstring GetCodeSuggestionResponseDb;\n//\t\tstring GotoDefinitionRequestDb;\n//\t\tstring GotoDefinitionResponseDb;\n\t\tstring HelloRequestDb;\n\t\tstring HelloResponseDb;\n\n\t\t[OneTimeSetUp]\n\t\tpublic void Init()\n\t\t{\n\t\t\tBasePath = TestContext.CurrentContext.TestDirectory + \"/Messages/\";\n//\t\t\tGetCodeSuggestionsRequestDb = BasePath + \"GetCodeSuggestionsRequest.msgDB\";\n//\t\t\tGetCodeSuggestionResponseDb = BasePath + \"GetCodeSuggestionResponse.msgDB\";\n//\t\t\tGotoDefinitionRequestDb = BasePath + \"GotoDefinitionRequest.msgDB\";\n//\t\t\tGotoDefinitionResponseDb = BasePath + \"GotoDefinitionResponse.msgDB\";\n\t\t\tHelloRequestDb = BasePath + \"HelloRequest.msgDB\";\n\t\t\tHelloResponseDb = BasePath + \"HelloResponse.msgDB\";\n\t\t}\n\n\t\t/*[Test]\n\t\tpublic void GetCodeSuggestionsRequest()\n\t\t{\n\t\t\tAssertIfDiffers(MessageDatabase.From(new GetCodeSuggestionsRequest()), GetCodeSuggestionsRequestDb);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetCodeSuggestionsResponse()\n\t\t{\n\t\t\tAssertIfDiffers(MessageDatabase.From(new GetCodeSuggestionsResponse()), GetCodeSuggestionResponseDb);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GotoDefinitionRequest()\n\t\t{\n\t\t\tAssertIfDiffers(MessageDatabase.From(new GotoDefinitionRequest()), GotoDefinitionRequestDb);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GotoDefinitionResponse()\n\t\t{\n\t\t\tAssertIfDiffers(MessageDatabase.From(new GotoDefinitionResponse()), GotoDefinitionResponseDb);\n\t\t}*/\n\n\t\t[Test]\n\t\tpublic void HelloRequest()\n\t\t{\n\t\t\tAssertIfDiffers(MessageDatabase.From(new HelloRequest()), HelloRequestDb);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HelloResponse()\n\t\t{\n\t\t\tAssertIfDiffers(MessageDatabase.From(new HelloResponse()), HelloResponseDb);\n\t\t}\n\n\t\tstatic void AssertIfDiffers(MessageDatabase database, string filePathStr)\n\t\t{\n#if DUMP_MODE\n\t\t\tvar relativePath = RelativeFilePath.Parse(filePathStr);\n\t\t\tvar dumpPath = AbsoluteDirectoryPath.Parse(\"../../\") / relativePath;\n\t\t\tdatabase.Dump(dumpPath);\n#endif\n\t\t\tvar filePath = AbsoluteFilePath.Parse(filePathStr);\n\t\t\tvar originalDatabase = MessageDatabase.From(filePath);\n\t\t\tMessageDatabase.From(filePath);\n\n\t\t\tvar errors = new Subject<string>();\n\t\t\terrors.Subscribe(Console.WriteLine);\n\t\t\tAssert.True(MessageDatabase.IsEqualWhileIgnoreComments(originalDatabase, database, errors), \"Looks like you have changed the plugin API\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/Outracks.Fuse.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{3921C434-B199-4A60-ADD2-192EB2AC4D76}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse.Protocol.Tests</RootNamespace>\n    <AssemblyName>Outracks.Fuse.Protocol.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Castle.Core.4.4.1\\lib\\net45\\Castle.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"Microsoft.Reactive.Testing, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Reactive.Testing.4.4.1\\lib\\net46\\Microsoft.Reactive.Testing.dll</HintPath>\n    </Reference>\n    <Reference Include=\"NSubstitute, Version=4.2.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NSubstitute.4.2.2\\lib\\net46\\NSubstitute.dll</HintPath>\n    </Reference>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.7.1\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ApplicationPathsTests.cs\" />\n    <Compile Include=\"Common\\ContextTests.cs\" />\n    <Compile Include=\"Create\\ProjectAddRemoveCornerCaseTests.cs\" />\n    <Compile Include=\"Create\\ProjectMoveTests.cs\" />\n    <Compile Include=\"Create\\ProjectRedundancyEliminationTests.cs\" />\n    <Compile Include=\"Create\\ProjectTest.cs\" />\n    <Compile Include=\"Create\\TemplateTest.cs\" />\n    <Compile Include=\"Create\\TemplateVariableResolverDummy.cs\" />\n    <Compile Include=\"EnvironmentTest.cs\" />\n    <Compile Include=\"FailureClient.cs\" />\n    <Compile Include=\"FileWatchingDocumentTest.cs\" />\n    <Compile Include=\"Hierarchy\\LiveElementExtensions.cs\" />\n    <Compile Include=\"Hierarchy\\TreeViewModelTests.cs\" />\n    <Compile Include=\"LiveElementFactory.cs\" />\n    <Compile Include=\"Components\\ComponentInstallerTests.cs\" />\n    <Compile Include=\"Main\\BuildArgsTests.cs\" />\n    <Compile Include=\"Main\\GlVersionParsingTests.cs\" />\n    <Compile Include=\"Main\\SelectionTests.cs\" />\n    <Compile Include=\"Markup\\ElementTest.cs\" />\n    <Compile Include=\"Markup\\SourceFragmentTest.cs\" />\n    <Compile Include=\"MessageDatabase.cs\" />\n    <Compile Include=\"MessageDatabaseItem.cs\" />\n    <Compile Include=\"MessageIntegrityTests.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Refactoring\\ClassExtractorTests.cs\" />\n    <Compile Include=\"Refactoring\\ExtractClassButtonViewModelTests.cs\" />\n    <Compile Include=\"Refactoring\\ExtractClassViewModelTests.cs\" />\n    <Compile Include=\"Setup\\ComponentStatusExetensionsTest.cs\" />\n    <Compile Include=\"Sketch\\SketchWatcherTests.cs\" />\n    <Compile Include=\"Solution\\NugetPackageElement.cs\" />\n    <Compile Include=\"Solution\\SolutionVersioningTests.cs\" />\n    <Compile Include=\"Solution\\SolutionTestsHelper.cs\" />\n    <Compile Include=\"VersionWriterTests.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"Messages\\GetCodeSuggestionResponse.msgDB\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Messages\\GetCodeSuggestionsRequest.msgDB\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Messages\\GotoDefinitionRequest.msgDB\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Messages\\GotoDefinitionResponse.msgDB\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Messages\\HelloRequest.msgDB\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"Messages\\HelloResponse.msgDB\">\n      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n    </None>\n    <None Include=\"packages.config\" />\n    <None Include=\"SublimeTest\\SublimeTest\\fe9b89d9-92a6-4d98-8b6e-f4ae020149bf.dmp\" />\n    <None Include=\"SublimeTest\\SublimeTest\\MyApp.ux\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\preview\\service\\fuse-preview.csproj\">\n      <Project>{59E1073A-9B45-41F3-AB94-958A9D18FB72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{e8884270-5f2c-4076-86d0-456b831be3e5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Command\\Outracks.Fuse.Command.csproj\">\n      <Project>{8b6673c5-58b8-4e5a-8369-2e21507f4131}</Project>\n      <Name>Outracks.Fuse.Command</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\studio\\fuse-studio.csproj\">\n      <Project>{490ef7e5-46ff-4df3-8342-530429ca65b5}</Project>\n      <Name>fuse-studio</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"SublimeTest\\SublimeTest.unosln\" />\n    <None Include=\"SublimeTest\\SublimeTest\\MyApp.ux.uno\" />\n    <None Include=\"SublimeTest\\SublimeTest\\SublimeTest.unoproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Command\\\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/fuse/tests/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Fuse.Protocol.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/fuse/tests/Refactoring/ClassExtractorTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Fuse.Live;\nusing Outracks.Fuse.Refactoring;\nusing Outracks.IO;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Protocol.Tests.Refactoring\n{\n\t// These tests should finish pretty fast as they involve no IO or CPU intensive work,\n\t// this timeout attribute is here to avoid waiting forever due to some async mistake\n\t[Timeout(3000)]\n\t[TestFixture]\n\tpublic class ClassExtractorTests\n\t{\n\t\tIElement _root;\n\n\t\t[Test]\n\t\tpublic async Task ExtractClass_turns_element_into_a_class_and_inserts_an_instance_of_that_class_beside_it()\n\t\t{\n\t\t\t_root = CreateRootElement();\n\t\t\tvar classExtractor = new ClassExtractor(Substitute.For<IProject>());\n\t\t\tawait classExtractor.ExtractClass(await GetTreeChild(\"Panel\"), \"CustomPanel\", Optional.None());\n\t\t\tvar uxClassAttribute = await (await GetTreeChild(\"Panel\")).UxClass().FirstAsync();\n\t\t\tAssert.That(uxClassAttribute, Is.EqualTo(Optional.Some(\"CustomPanel\")));\n\t\t\tAssert.That(await GetTreeChild(\"CustomPanel\"), Is.Not.Null);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ExtractClass_prints_message_to_logview_when_exception_is_thrown()\n\t\t{\n\t\t\t_root = CreateRootElement();\n\t\t\tvar projectClasses = new BehaviorSubject<IEnumerable<IElement>>(new IElement[] { });\n\t\t\tvar project = Substitute.For<IProject>();\n\n\t\t\tproject.Classes.ReturnsForAnyArgs(projectClasses);\n\n\t\t\tproject\n\t\t\t\t.CreateDocument(default(RelativeFilePath))\n\t\t\t\t.ReturnsForAnyArgs(_ =>\n\t\t\t\t\tTask.Run(() => { throw new IOException(\"Couldn't write a file, as the disk just imploded\"); }));\n\n\t\t\tvar classExtractor = new ClassExtractor(project);\n\t\t\tstring logMessage = null;\n\t\t\tusing (classExtractor.LogMessages.Subscribe(message => logMessage = message))\n\t\t\t{\n\t\t\t\tawait classExtractor.ExtractClass(await GetTreeChild(\"Panel\"), \"MyPanel\", RelativeFilePath.Parse(\"CustomPanel.ux\"));\n\t\t\t}\n\n\t\t\tAssert.That(logMessage, Is.EqualTo(\"Error: Unable to create class. Couldn't write a file, as the disk just imploded\\r\\n\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ExtractClass_with_filename_set_copies_element_to_new_file_and_inserts_ux_class_attribute()\n\t\t{\n\t\t\t// Setup\n\t\t\t_root = CreateRootElement();\n\t\t\tvar projectClasses = new BehaviorSubject<IEnumerable<IElement>>(new IElement[] {});\n\t\t\tvar project = Substitute.For<IProject>();\n\t\t\tIElement createdFileRoot = null;\n\n\t\t\tproject.Classes.ReturnsForAnyArgs(projectClasses);\n\n\t\t\tproject\n\t\t\t\t.CreateDocument(default(RelativeFilePath))\n\t\t\t\t.ReturnsForAnyArgs(\n\t\t\t\t\tci =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar fragment = ci.Arg<SourceFragment>();\n\t\t\t\t\t\tvar nativeRelativePath = ci.Arg<RelativeFilePath>().NativeRelativePath;\n\t\t\t\t\t\tcreatedFileRoot = CreateRootElement(fragment, nativeRelativePath);\n\t\t\t\t\t\tprojectClasses.OnNext(new[] { createdFileRoot });\n\t\t\t\t\t\treturn Task.FromResult(false); // no idea what i'm doing\n\t\t\t\t\t});\n\t\t\tvar classExtractor = new ClassExtractor(project);\n\n\t\t\t// Do\n\t\t\tawait classExtractor.ExtractClass(await GetTreeChild(\"Panel\"), \"MyPanel\", RelativeFilePath.Parse(\"CustomPanel.ux\"));\n\n\t\t\t// Assert\n\t\t\tAssert.That(createdFileRoot, Is.Not.Null);\n\t\t\tAssert.That(await createdFileRoot.Name.FirstAsync(), Is.EqualTo(\"Panel\"));\n\t\t\tAssert.That(await createdFileRoot.UxClass().FirstAsync(), Is.EqualTo(Optional.Some(\"MyPanel\")));\n\t\t\tAssert.That(await GetTreeChild(\"MyPanel\"), Is.Not.Null);\n\t\t}\n\n\t\tasync System.Threading.Tasks.Task<IElement> GetTreeChild(string name)\n\t\t{\n\t\t\treturn await _root.Children.Where(x => x.Name.Is(name)).Select(x => x.First()).FirstAsync();\n\t\t}\n\n\t\tIElement CreateRootElement()\n\t\t{\n\t\t\treturn CreateRootElement(SourceFragment.FromString(\"<App><Panel /><Circle ux:Class=\\\"MyCircle\\\" /></App>\"), \"MainView.ux\");\n\t\t}\n\n\t\tstatic IElement CreateRootElement(SourceFragment fragment, string filename)\n\t\t{\n\t\t\tvar parent = new LiveElement(\n\t\t\t\tAbsoluteFilePath.Parse(\"/project/\" + filename),\n\t\t\t\tObservable.Never<ILookup<ObjectIdentifier, ObjectIdentifier>>(),\n\t\t\t\tObservable.Return(true),\n\t\t\t\tnew Subject<Unit>(),\n\t\t\t\tObserver.Create<IBinaryMessage>(msg => { }),\n\t\t\t\ts => Element.Empty);\n\n\t\t\t// Panel is an example of an instance\n\t\t\t// Circle is an example of a class (called MyClass)\n\t\t\tparent.UpdateFrom(fragment.ToXml());\n\n\t\t\treturn parent;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/Refactoring/ExtractClassButtonViewModelTests.cs",
    "content": "﻿using System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Fuse.Live;\nusing Outracks.Fuse.Refactoring;\nusing Outracks.IO;\nusing Outracks.Simulator;\n\nnamespace Outracks.Fuse.Protocol.Tests.Refactoring\n{\n\t[TestFixture]\n\tpublic class ExtractClassButtonViewModelTests\n\t{\n\t\tIExtractClassButtonViewModel _model;\n\t\tBehaviorSubject<IElement> _currentSelection;\n\t\tIElement _root;\n\t\tIElement _classElement;\n\t\tIElement _instanceElement;\n\t\tbool _buttonClicked;\n\t\tIExtractClassViewModel _resultingViewModel;\n\t\tIElement _javaScriptElement;\n\t\tIElement _includeElement;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tvar project = Substitute.For<IProject>();\n\t\t\tproject.Classes.Returns(Observable.Return(new IElement[] { }));\n\t\t\tvar context = Substitute.For<IContext>();\n\t\t\t_currentSelection = new BehaviorSubject<IElement>(Element.Empty);\n\t\t\t_buttonClicked = false;\n\t\t\tcontext.CurrentSelection.Returns(_currentSelection.Switch());\n\t\t\t_model = new ExtractClassButtonViewModel(project, context,\n\t\t\t\tdialogViewModel =>\n\t\t\t\t{\n\t\t\t\t\t_buttonClicked = true;\n\t\t\t\t\t_resultingViewModel = dialogViewModel;\n\t\t\t\t}, new Shell(), Substitute.For<IClassExtractor>());\n\t\t\t_root = CreateTree(\"<App><JavaScript /><Include /><Panel /><Circle ux:Class=\\\"MyClass\\\" /></App>\");\n\n\t\t\t_classElement = GetTreeChild(\"Circle\");\n\t\t\t_instanceElement = GetTreeChild(\"Panel\");\n\t\t\t_javaScriptElement = GetTreeChild(\"JavaScript\");\n\t\t\t_includeElement = GetTreeChild(\"Include\");\n\t\t\tproject.Classes.Returns(Observable.Return(new[] { _classElement }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Button_is_disabled_while_nothing_is_selected()\n\t\t{\n\t\t\t_currentSelection.OnNext(Element.Empty);\n\t\t\tAssertButtonDisabled();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Button_is_disabled_while_selecting_element_that_is_already_a_class()\n\t\t{\n\t\t\t_currentSelection.OnNext(_classElement);\n\t\t\tAssertButtonDisabled();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Button_is_disabled_while_selecting_root()\n\t\t{\n\t\t\t_currentSelection.OnNext(_root);\n\t\t\tAssertButtonDisabled();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Button_is_disabled_while_javascript_selected()\n\t\t{\n\t\t\t_currentSelection.OnNext(_javaScriptElement);\n\t\t\tAssertButtonDisabled();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Button_is_disabled_while_include_element_selected()\n\t\t{\n\t\t\t_currentSelection.OnNext(_includeElement);\n\t\t\tAssertButtonDisabled();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Button_is_enabled_while_element_that_is_an_instance_is_selected()\n\t\t{\n\t\t\t_currentSelection.OnNext(_instanceElement);\n\t\t\tAssertButtonEnabled();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HighlightSelectedElement_is_true_after_HoverEnter_is_called_while_instance_element_is_selected()\n\t\t{\n\t\t\t_currentSelection.OnNext(_instanceElement);\n\t\t\t_model.HoverEnter();\n\t\t\tAssert.That(_model.HighlightSelectedElement.LastNonBlocking, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HighlightSelectedElement_is_false_after_HoverEnter_is_called_while_class_element_is_selected()\n\t\t{\n\t\t\t_currentSelection.OnNext(_classElement);\n\t\t\t_model.HoverEnter();\n\t\t\tAssert.That(_model.HighlightSelectedElement.LastNonBlocking(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void HighlightSelectedElement_is_cleared_after_HoverExit_is_called_while_instance_element_is_selected()\n\t\t{\n\t\t\t_currentSelection.OnNext(_instanceElement);\n\t\t\t_model.HoverEnter();\n\t\t\tAssert.That(_model.HighlightSelectedElement.LastNonBlocking(), Is.True);\n\t\t\t_model.HoverExit();\n\t\t\tAssert.That(_model.HighlightSelectedElement.LastNonBlocking, Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Clicking_button_invokes_and_passes_dialog_view_model_to_callback()\n\t\t{\n\t\t\t_currentSelection.OnNext(_instanceElement);\n\t\t\tvar action = _model.Command.Action.LastNonBlocking().Value;\n\t\t\taction();\n\t\t\tAssert.That(_buttonClicked, Is.True);\n\t\t\tAssert.That(_resultingViewModel, Is.Not.Null);\n\n\t\t\t// Just do some initial assertions that the dialog is in a state we expect\n\t\t\t// (more testing of the dialog in another fixture)\n\t\t\tAssert.That(_resultingViewModel.ClassName.LastNonBlocking(), Is.EqualTo(\"MyPanel\"));\n\t\t\tAssert.That(_resultingViewModel.CreateInNewFile.LastNonBlocking, Is.False);\n\t\t\tAssert.That(_resultingViewModel.CreateInNewFile.IsReadOnly.LastNonBlocking, Is.False);\n\t\t}\n\n\t\tIElement GetTreeChild(string name)\n\t\t{\n\t\t\treturn _root.Children.Where(x => x.Name.Is(name)).Select(x => x.First()).LastNonBlocking();\n\t\t}\n\n\t\tvoid AssertButtonDisabled()\n\t\t{\n\t\t\tAssert.That(_model.Command.Action.LastNonBlocking().HasValue, Is.False);\n\t\t}\n\n\t\tvoid AssertButtonEnabled()\n\t\t{\n\t\t\tAssert.That(_model.Command.Action.LastNonBlocking().HasValue, Is.True);\n\t\t}\n\n\t\tstatic IElement CreateTree(string uxSource)\n\t\t{\n\t\t\tvar parent = new LiveElement(\n\t\t\t\tAbsoluteFilePath.Parse(\"foo/bar\"),\n\t\t\t\tObservable.Never<ILookup<ObjectIdentifier, ObjectIdentifier>>(),\n\t\t\t\tObservable.Return(true),\n\t\t\t\tnew Subject<Unit>(),\n\t\t\t\tObserver.Create<IBinaryMessage>(msg => { }),\n\t\t\t\ts => Element.Empty);\n\n\t\t\t// Panel is an example of an instance\n\t\t\t// Circle is an example of a class (called MyClass)\n\t\t\tparent.UpdateFrom(SourceFragment.FromString(uxSource).ToXml());\n\n\t\t\treturn parent;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Refactoring/ExtractClassViewModelTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Fuse.Refactoring;\nusing Outracks.Fuse.Tests;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Protocol.Tests.Refactoring\n{\n\t// These tests should finish pretty fast as they involve no IO or CPU intensive work,\n\t// this timeout attribute is here to avoid waiting forever due to some async mistake\n\t[Timeout(3000)]\n\t[TestFixture]\n\tpublic class ExtractClassViewModelTests\n\t{\n\t\tIExtractClassViewModel _model;\n\t\tBehaviorSubject<IElement> _currentSelection;\n\t\tIElement _root;\n\t\tMockedClassExtractor _classExtractor;\n\t\tIFileSystem _fileSystem;\n\n\t\t[SetUp]\n\t\tpublic async Task SetUp()\n\t\t{\n\t\t\tvar project = Substitute.For<IProject>();\n\t\t\tproject.Classes.Returns(Observable.Return(new IElement[] { }));\n\t\t\tproject.RootDirectory.Returns(Observable.Return(AbsoluteDirectoryPath.Parse(\"/project\")));\n\n\t\t\tvar context = Substitute.For<IContext>();\n\t\t\t_root = CreateTree();\n\n\t\t\t_fileSystem = Substitute.For<IFileSystem>();\n\n\t\t\t_fileSystem.Exists(Arg.Any<AbsoluteFilePath>())\n\t\t\t\t.Returns(\n\t\t\t\t\tcallInfo =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar absoluteFilePath = callInfo.Arg<AbsoluteFilePath>();\n\t\t\t\t\t\tvar result = absoluteFilePath == AbsoluteFilePath.Parse(\"/project/MainView.ux\");\n\t\t\t\t\t\tConsole.WriteLine(\"FileSystem.Exists({0}) -> {1}\", absoluteFilePath, result);\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t});\n\n\t\t\tvar panel = await GetTreeChild(\"Panel\");\n\t\t\t_currentSelection = new BehaviorSubject<IElement>(panel);\n\t\t\tcontext.CurrentSelection.Returns(_currentSelection.Switch());\n\t\t\t_classExtractor = new MockedClassExtractor();\n\t\t\t_model = new ExtractClassViewModel(\n\t\t\t\tcontext: context,\n\t\t\t\tsuggestedName: \"MyPanel\",\n\t\t\t\tallClassNames: Observable.Return(new HashSet<string>(new[] { \"MyCircle\" })),\n\t\t\t\tclassExtractor: _classExtractor,\n\t\t\t\tfileSystem: _fileSystem,\n\t\t\t\tproject: project);\n\t\t\tproject.Classes.Returns(Observable.Return(new[] { await GetTreeChild(\"Circle\") }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ClassName_is_initially_set_to_name_suggestion_passed_to_constructor()\n\t\t{\n\t\t\tAssert.That(await _model.ClassName.FirstAsync(), Is.EqualTo(\"MyPanel\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CreateCommand_is_disabled_while_ClassName_is_set_to_name_of_already_existing_class()\n\t\t{\n\t\t\t_model.ClassName.Write(\"MyCircle\");\n\t\t\tAssert.That(await _model.CreateCommand.IsEnabled.FirstAsync(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CreateCommand_is_disabled_while_ClassName_contains_an_invalid_identifier()\n\t\t{\n\t\t\t// We don't allow spaces in the name\n\t\t\t_model.ClassName.Write(\"Super Duper\");\n\t\t\tAssert.That(await _model.CreateCommand.IsEnabled.FirstAsync(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CreateCommand_is_disabled_while_ClassName_is_empty()\n\t\t{\n\t\t\t_model.ClassName.Write(string.Empty);\n\t\t\tAssert.That(await _model.CreateCommand.IsEnabled.FirstAsync(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CreateCommand_is_disabled_while_NewFileName_does_not_end_in_ux()\n\t\t{\n\t\t\t_model.CreateInNewFile.Write(true);\n\t\t\t_model.NewFileName.Write(\"Nisse.jpg\");\n\t\t\tAssert.That(await _model.CreateCommand.IsEnabled.FirstAsync(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CreateCommand_is_disabled_while_NewFileName_is_not_a_valid_filename()\n\t\t{\n\t\t\t_model.CreateInNewFile.Write(true);\n\t\t\t_model.NewFileName.Write(\">??#@@;;\");\n\t\t\tAssert.That(await _model.CreateCommand.IsEnabled.FirstAsync(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CreateCommand_is_enabled_while_ClassName_is_valid_and_unique()\n\t\t{\n\t\t\t_model.ClassName.Write(\"SuperPanel\");\n\t\t\tAssert.That(await _model.CreateCommand.IsEnabled.FirstAsync(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task NewFileName_is_read_only_while_CreateInNewFile_is_false()\n\t\t{\n\t\t\t_model.CreateInNewFile.Write(false);\n\t\t\tAssert.That(await _model.NewFileName.IsReadOnly.FirstAsync(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task NewFileName_is_writable_while_CreateInNewFile_is_true()\n\t\t{\n\t\t\t_model.CreateInNewFile.Write(true);\n\t\t\tAssert.That(await _model.NewFileName.IsReadOnly.FirstAsync(), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CreateCommand_invokes_class_extractor_with_filename_set_to_none_if_CreateNewFile_is_false()\n\t\t{\n\t\t\t_model.CreateInNewFile.Write(false);\n\t\t\t_model.ClassName.Write(\"WeirdPanel\");\n\t\t\tvar action = await _model.CreateCommand.Action.FirstAsync();\n\t\t\tAssert.That(action.HasValue, Is.True);\n\t\t\taction.Value();\n\t\t\tAssert.That(_classExtractor.HasBeenCalled, Is.True);\n\t\t\tAssert.That(_classExtractor.ReceivedName, Is.EqualTo(\"WeirdPanel\"));\n\t\t\tAssert.That(_classExtractor.ReceivedFileName.HasValue, Is.False);\n\t\t\tAssert.That(await _classExtractor.ReceivedElement.IsSameAs(_currentSelection.Value).FirstAsync(), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Editing_class_name_suggests_filename()\n\t\t{\n\t\t\t_model.ClassName.Write(\"SomeName\");\n\t\t\tAssert.That(await _model.NewFileName.FirstAsync(), Is.EqualTo(\"SomeName.ux\"));\n\n\t\t\t_model.ClassName.Write(\"AnotherName\");\n\t\t\tAssert.That(await _model.NewFileName.FirstAsync(), Is.EqualTo(\"AnotherName.ux\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Editing_class_name_suggests_filename_in_folder_for_class_in_namespace()\n\t\t{\n\t\t\t_model.ClassName.Write(\"Lonely.Foo\");\n\t\t\tAssert.That(await _model.NewFileName.FirstAsync(), Is.EqualTo(\"Lonely\" + Path.DirectorySeparatorChar + \"Foo.ux\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Editing_class_name_after_editing_filename_does_not_overwrite_filename()\n\t\t{\n\t\t\t_model.NewFileName.Write(\"SomeFileName.ux\");\n\t\t\t_model.ClassName.Write(\"SomeClassName\");\n\t\t\tAssert.That(await _model.NewFileName.FirstAsync(), Is.EqualTo(\"SomeFileName.ux\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task Create_command_disabled_if_file_exist()\n\t\t{\n\t\t\tbool? isEnabled = null;\n\t\t\tstring userInfo = null;\n\n\t\t\tusing (_model.CreateCommand.IsEnabled.Subscribe(v => isEnabled = v))\n\t\t\tusing (_model.UserInfo.Subscribe(v => userInfo = v))\n\t\t\t{\n\t\t\t\tAssert.That(isEnabled, Is.EqualTo(true));\n\t\t\t\t_model.ClassName.Write(\"MainView\");\n\t\t\t\t_model.CreateInNewFile.Write(true);\n\t\t\t\tAssert.That(await _model.NewFileName.FirstAsync(), Is.EqualTo(\"MainView.ux\"));\n\t\t\t\tAssert.That(isEnabled, Is.EqualTo(false));\n\t\t\t\tAssert.That(userInfo, Is.EqualTo(\"The file already exists\"));\n\t\t\t}\n\t\t}\n\n\t\tclass MockedClassExtractor : IClassExtractor\n\t\t{\n\t\t\tpublic Task ExtractClass(IElement element, string name, Optional<RelativeFilePath> fileName)\n\t\t\t{\n\t\t\t\tHasBeenCalled = true;\n\t\t\t\tReceivedElement = element;\n\t\t\t\tReceivedName = name;\n\t\t\t\tReceivedFileName = fileName;\n\t\t\t\treturn Task.FromResult(new object());\n\t\t\t}\n\n\t\t\tpublic IObservable<string> LogMessages\n\t\t\t{\n\t\t\t\tget { throw new NotImplementedException(); }\n\t\t\t}\n\n\t\t\tpublic bool HasBeenCalled { get; set; }\n\n\t\t\tpublic Optional<RelativeFilePath> ReceivedFileName { get; set; }\n\n\t\t\tpublic string ReceivedName { get; set; }\n\n\t\t\tpublic IElement ReceivedElement { get; private set; }\n\t\t}\n\n\t\tasync Task<IElement> GetTreeChild(string name)\n\t\t{\n\t\t\treturn await _root.Children.Where(x => x.Name.Is(name)).Select(x => x.First()).FirstAsync();\n\t\t}\n\n\t\tstatic IElement CreateTree()\n\t\t{\n\t\t\treturn LiveElementFactory.CreateLiveElement(\"<App><Panel /><Circle ux:Class=\\\"MyCircle\\\" /></App>\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fuse/tests/Setup/ComponentStatusExetensionsTest.cs",
    "content": "﻿using NUnit.Framework;\nusing Outracks.Fuse.Components;\nusing Outracks.Fuse.Setup;\n\nnamespace Outracks.Fuse.Protocol.Tests.Setup\n{\n\tclass ComponentStatusExetensionsTest\n\t{\n\t\t[Test]\n\t\tpublic void SupportsAllValues()\n\t\t{\n\t\t\tforeach (var enumValue in typeof(ComponentStatus).GetEnumValues())\n\t\t\t{\n\t\t\t\t((ComponentStatus) enumValue).AsInstallStatus();\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TranslatesCorrectly()\n\t\t{\n\t\t\tAssert.AreEqual(InstallStatus.Installed, ComponentStatus.Installed.AsInstallStatus());\n\t\t\tAssert.AreEqual(InstallStatus.NotInstalled, ComponentStatus.NotInstalled.AsInstallStatus());\n\t\t\tAssert.AreEqual(InstallStatus.UpdateAvailable, ComponentStatus.UpdateAvailable.AsInstallStatus());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Sketch/SketchWatcherTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks.Diagnostics;\nusing Outracks.Fuse.Studio;\nusing Outracks.IO;\n\nnamespace Outracks.Fuse.Protocol.Tests.Sketch\n{\n\tclass SketchWatcherTests\n\t{\n\t\treadonly AbsoluteFilePath _sketchListFile = DirectoryPath.GetTempPath() / new FileName(new Guid() + \".sketchFiles\");\n\t\treadonly AbsoluteDirectoryPath _projectRoot = AbsoluteDirectoryPath.Parse(Platform.IsWindows ? @\"c:\\Project\" : \"/Project\");\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFile.Delete(_sketchListFile.NativePath);\n\t\t\t} catch (Exception) { }\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchListFilePathGetsCorrectPath()\n\t\t{\n\t\t\tvar projectFilePath = _projectRoot / new FileName(\"Project.unoproj\");\n\t\t\tvar sketchPath = SketchImportUtils.SketchListFilePath(projectFilePath);\n\t\t\tAssert.That(sketchPath, Is.EqualTo(_projectRoot / new FileName(\"Project.sketchFiles\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchListFilePath_OnlyReplacesAtEnd()\n\t\t{\n\t\t\tvar stupidProjectRoot = AbsoluteDirectoryPath.Parse(Platform.IsWindows ? @\"c:\\Project.unoproj\" : \"/Project.unoproj\");\n\t\t\tvar projectFilePath = stupidProjectRoot / new FileName(\"Project.unoproj\");\n\t\t\tvar sketchPath = SketchImportUtils.SketchListFilePath(projectFilePath);\n\t\t\tAssert.That(sketchPath, Is.EqualTo(stupidProjectRoot / new FileName(\"Project.sketchFiles\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchListFilePath_FailsIfDoesntEndWithUnoProj()\n\t\t{\n\t\t\tvar projectFilePath = _projectRoot / new FileName(\"Project.unicorn\");\n\t\t\tAssert.That(() => SketchImportUtils.SketchListFilePath(projectFilePath), Throws.ArgumentException.With.Message.Contains(\"does not seem to be a .unoproj\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchFilePaths_ParsesJson()\n\t\t{\n\t\t\tvar absPathFile = Platform.IsWindows ? @\"C:\\\\File2.sketch\" : @\"/File2.sketch\";\n\t\t\tvar relPathFile = Platform.IsWindows ? @\"SketchFiles\\\\File1.sketch\" : \"SketchFiles/File1.sketch\";\n\t\t\tvar content = \"[\\\"\" + relPathFile + \"\\\",\\\"\" + absPathFile + \"\\\"]\";\n\t\t\tFile.WriteAllText(_sketchListFile.NativePath, content);\n\t\t\tvar report = Substitute.For<IReport>();\n\t\t\tvar fs = Substitute.For<IFileSystem>();\n\t\t\tvar sketchFiles = new SketchWatcher(report, fs).SketchFilePaths(_sketchListFile);\n\n\t\t\tvar expected = new List<IFilePath>\n\t\t\t{\n\t\t\t\tRelativeFilePath.Parse(relPathFile),\n\t\t\t\tAbsoluteFilePath.Parse(absPathFile)\n\t\t\t};\n\t\t\tAssert.That(sketchFiles, Is.EqualTo(expected));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchFilePaths_MakePathsAbsolute()\n\t\t{\n\t\t\tvar relPathFile = Platform.IsWindows ? @\"SketchFiles\\\\File1.sketch\" : \"SketchFiles/File1.sketch\";\n\t\t\tvar absPathFile = Platform.IsWindows ? @\"C:\\\\File2.sketch\" : @\"/File2.sketch\";\n\t\t\tvar content = \"[\\\"\" + relPathFile + \"\\\",\\\"\" + absPathFile + \"\\\"]\";\n\t\t\tFile.WriteAllText(_sketchListFile.NativePath, content);\n\n\n\t\t\tvar report = Substitute.For<IReport>();\n\t\t\tvar fs = Substitute.For<IFileSystem>();\n\t\t\tvar sketchFiles = SketchImportUtils.MakeAbsolute(\n\t\t\t\tnew SketchWatcher(report, fs).SketchFilePaths(_sketchListFile),\n\t\t\t\t_sketchListFile.ContainingDirectory);\n\n\t\t\tvar expected = new List<AbsoluteFilePath>\n\t\t\t{\n\t\t\t\t_sketchListFile.ContainingDirectory / \"SketchFiles\" / new FileName(\"File1.sketch\"),\n\t\t\t\tAbsoluteFilePath.Parse(absPathFile)\n\t\t\t};\n\t\t\tAssert.That(sketchFiles, Is.EqualTo(expected));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchFilePaths_LogsAndReturnsEmptyOnError()\n\t\t{\n\t\t\tvar report = Substitute.For<IReport>();\n\t\t\tvar fs = Substitute.For<IFileSystem>();\n\t\t\tvar paths = new SketchWatcher(report, fs).SketchFilePaths(FilePath.ParseAndMakeAbsolute(\"doesntExist.sketchFiles\"));\n\t\t\tAssert.That(paths, Is.Empty);\n\t\t\treport.Received(1).Error(Arg.Any<string>());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Solution/NugetPackageElement.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.XPath;\n\nnamespace Outracks.Fuse.Tests.Solution\n{\n\tpublic class NugetPackageElement\n\t{\n\t\tprivate static readonly string[] knownFrameworkVersions = { \"net451\", \"net45\", \"net40\", \"net35\", \"net20\" };\n\t\tprivate static readonly string[] preferredFrameworkVersions = { \"net45\", \"net40\", \"net35\", \"net20\" };\n\t\tprivate readonly string projectFile;\n\t\tprivate readonly string solutionDirectoy;\n\t\tprivate string[] availableFrameworkVersions;\n\t\tprivate string fullPackagePath;\n\t\tprivate XDocument projectXmlDocument;\n\n\n\t\tpublic NugetPackageElement(\n\t\t\tstring project,\n\t\t\tXElement packagesConfigElement,\n\t\t\tstring solutionDirectoy,\n\t\t\tXDocument projectXmlDocument = null)\n\t\t{\n\t\t\tprojectFile = project;\n\t\t\tthis.solutionDirectoy = solutionDirectoy;\n\t\t\tthis.projectXmlDocument = projectXmlDocument;\n\t\t\tId = packagesConfigElement.Attribute(\"id\").Value;\n\t\t\tVersion = packagesConfigElement.Attribute(\"version\").Value;\n\t\t}\n\n\n\t\tpublic string AssumedPackagePath => AssumedPackagePathStart + Version;\n\n\t\tpublic string AssumedPackagePathStart => Path.Combine(RelativePackagesPath, Id + \".\");\n\n\t\tpublic string Id { get; }\n\n\t\tpublic string PreferredFrameworkVersion\n\t\t{\n\t\t\tget { return preferredFrameworkVersions.FirstOrDefault(x => AvailableFrameworkVersions.Contains(x)); }\n\t\t}\n\n\t\tpublic string ProjectDirectory => Path.GetDirectoryName(projectFile);\n\n\t\tpublic string ProjectName => Path.GetFileNameWithoutExtension(projectFile);\n\n\t\tpublic XDocument ProjectXmlDocument => projectXmlDocument ?? (projectXmlDocument = XDocument.Load(projectFile));\n\n\t\tpublic string RelativePackagesPath => GetRelativePath(\n\t\t\tPath.Combine(solutionDirectoy, \"packages\"),\n\t\t\tPath.GetDirectoryName(projectFile));\n\n\t\tpublic string Version { get; }\n\n\t\tprivate string[] AvailableFrameworkVersions\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn availableFrameworkVersions\n\t\t\t\t\t?? (availableFrameworkVersions =\n\t\t\t\t\t\tDirectory.GetDirectories(Path.Combine(FullPackagePath, \"lib\"))\n\t\t\t\t\t\t\t.Select(x => Path.GetFileName(x).ToLower())\n\t\t\t\t\t\t\t.Where(x => knownFrameworkVersions.Contains(x))\n\t\t\t\t\t\t\t.ToArray());\n\t\t\t}\n\t\t}\n\n\t\tprivate string FullPackagePath => fullPackagePath\n\t\t\t?? (fullPackagePath = Path.Combine(solutionDirectoy, \"packages\", Id + \".\" + Version));\n\n\n\t\tpublic static IEnumerable<NugetPackageElement> Load(string solutionDirectory)\n\t\t{\n\t\t\treturn Load(\n\t\t\t\tDirectory.EnumerateFiles(solutionDirectory, \"*.csproj\", SearchOption.AllDirectories),\n\t\t\t\tsolutionDirectory);\n\t\t}\n\n\n\t\tpublic static IEnumerable<NugetPackageElement> Load(IEnumerable<string> projects, string solutionDirectory)\n\t\t{\n\t\t\tforeach (var projectFile in projects)\n\t\t\t{\n\t\t\t\tvar projectLocal = projectFile;\n\t\t\t\tvar packagesXml = Path.Combine(Path.GetDirectoryName(projectFile), \"packages.config\");\n\t\t\t\tif (!File.Exists(packagesXml))\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"Project {0} has no packages.config; skipping.\", projectFile);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar projectXDoc = XDocument.Load(projectFile);\n\t\t\t\tforeach (\n\t\t\t\t\tvar item in\n\t\t\t\t\tXDocument.Load(packagesXml).Descendants(\"package\").Select(\n\t\t\t\t\t\tx => new NugetPackageElement(projectLocal, x, solutionDirectory, projectXDoc)))\n\t\t\t\t\tyield return item;\n\t\t\t}\n\t\t}\n\n\n\t\tpublic int ValidateHintPathReference(StringBuilder errorLog)\n\t\t{\n\t\t\tint errorCount = 0;\n\t\t\tif (!Directory.Exists(FullPackagePath))\n\t\t\t\tConsole.WriteLine(\"Warning: Could not find package directory \" + FullPackagePath);\n\n\t\t\tXNamespace ns = \"http://schemas.microsoft.com/developer/msbuild/2003\";\n\t\t\tvar nsManager = new XmlNamespaceManager(new NameTable());\n\t\t\tnsManager.AddNamespace(\"x\", ns.NamespaceName);\n\t\t\tvar assumedPackagePathStart = AssumedPackagePathStart;\n\t\t\tvar xpathPredicate =\n\t\t\t\tString.Format(\n\t\t\t\t\t\"//x:Project/x:ItemGroup/x:Reference[starts-with(x:HintPath,'{0}') and string-length(x:HintPath) > ({1} + 1) and string(number(substring(x:HintPath,{1},1))) != 'NaN']\",\n\t\t\t\t\tassumedPackagePathStart,\n\t\t\t\t\tassumedPackagePathStart.Length + 1);\n\t\t\tvar referencesGroupedByVersion =\n\t\t\t\tProjectXmlDocument.XPathSelectElements(xpathPredicate, nsManager).Select(\n\t\t\t\t\tx => new LibReference(assumedPackagePathStart, x, ns)).ToList().GroupBy(\n\t\t\t\t\tx => x.PathVersionPart).ToList();\n\t\t\tif (referencesGroupedByVersion.Count == 0)\n\t\t\t{\n\t\t\t\tif (Directory.Exists(fullPackagePath)\n\t\t\t\t\t&& Directory.EnumerateFiles(fullPackagePath, \"*.dll\", SearchOption.AllDirectories).Any())\n\t\t\t\t{\n\t\t\t\t\terrorLog.AppendFormat(\n\t\t\t\t\t\t\"Warning: Could not find any reference to {0} in {1}.\\r\\n    Suggestion: Update-Package -reinstall {0} -ProjectName {1}\\r\\n\",\n\t\t\t\t\t\tId,\n\t\t\t\t\t\tProjectName);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (referencesGroupedByVersion.Count > 1)\n\t\t\t{\n\t\t\t\terrorLog.AppendFormat(\n\t\t\t\t\t\"There are dll-references from {0} to multiple versions of {1} ({2})\\r\\n\",\n\t\t\t\t\tProjectName,\n\t\t\t\t\tId,\n\t\t\t\t\tString.Join(\", \", referencesGroupedByVersion.Select(x => x.Key)));\n\t\t\t\terrorCount++;\n\t\t\t}\n\n\t\t\tforeach (var refVerGroup in referencesGroupedByVersion)\n\t\t\t{\n\t\t\t\tif (!DirVersionMatches(Version, refVerGroup.Key))\n\t\t\t\t{\n\t\t\t\t\terrorLog.AppendFormat(\n\t\t\t\t\t\t\"Reference made from {0} to {1} got hintpath {2}, expected {3}\\\\???.\\r\\n    Suggestion: Update-Package –reinstall {1} -ProjectName {0}\\r\\n\",\n\t\t\t\t\t\tProjectName,\n\t\t\t\t\t\tId,\n\t\t\t\t\t\trefVerGroup.First().HintPath,\n\t\t\t\t\t\tAssumedPackagePath);\n\t\t\t\t\terrorCount++;\n\t\t\t\t}\n\n\t\t\t\tforeach (var item in refVerGroup.Where(x => x.TargetFrameworkVersion != PreferredFrameworkVersion))\n\t\t\t\t{\n\t\t\t\t\terrorLog.AppendFormat(\n\t\t\t\t\t\t\"Reference from {0} to {1} got hintpath {2} targeting wrong framework {3}, should be {4}.\\r\\n    Suggestion: Update-Package –reinstall {1} -ProjectName {0}\\r\\n\",\n\t\t\t\t\t\tProjectName,\n\t\t\t\t\t\tId,\n\t\t\t\t\t\titem.HintPath,\n\t\t\t\t\t\titem.TargetFrameworkVersion,\n\t\t\t\t\t\tPreferredFrameworkVersion);\n\t\t\t\t\terrorCount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn errorCount;\n\t\t}\n\n\n\t\tprivate static bool DirVersionMatches(string version, string dirVersion)\n\t\t{\n\t\t\tif (version == dirVersion)\n\t\t\t\treturn true;\n\n\t\t\t// Directory 1.8 matches version 1.8.0, so if last part of version is .0 we can remove it.\n\t\t\tif (ParseVersionParts(version).SequenceEqual(ParseVersionParts(dirVersion)))\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\n\n\t\tprivate string GetRelativePath(string filespec, string folder)\n\t\t{\n\t\t\tUri pathUri = new Uri(filespec);\n\t\t\t// Folders must end in a slash\n\t\t\tif (!folder.EndsWith(Path.DirectorySeparatorChar.ToString()))\n\t\t\t\tfolder += Path.DirectorySeparatorChar;\n\t\t\tUri folderUri = new Uri(folder);\n\t\t\treturn\n\t\t\t\tUri.UnescapeDataString(\n\t\t\t\t\tfolderUri.MakeRelativeUri(pathUri).ToString().Replace(\n\t\t\t\t\t\t'/',\n\t\t\t\t\t\tPath.DirectorySeparatorChar));\n\t\t}\n\n\n\t\tprivate static int[] ParseVersionParts(string version)\n\t\t{\n\t\t\tstring _;\n\t\t\treturn ParseVersionParts(version, out _);\n\t\t}\n\n\n\t\tprivate static int[] ParseVersionParts(string version, out string preReleasePart)\n\t\t{\n\t\t\tvar mainAndPreleaseParts = version.Split('-');\n\t\t\tif (mainAndPreleaseParts.Length > 1)\n\t\t\t\tpreReleasePart = mainAndPreleaseParts[1];\n\t\t\telse\n\t\t\t\tpreReleasePart = null;\n\t\t\treturn mainAndPreleaseParts[0].Split('.').Select(Int32.Parse).Pad(3, 0).ToArray();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Id + \".\" + Version;\n\t\t}\n\n\t\t#region Nested type: LibReference\n\n\t\tprivate class LibReference\n\t\t{\n\t\t\tpublic LibReference(string hintPathBeforePrefix, XElement element, XNamespace ns)\n\t\t\t{\n\t\t\t\tvar hintPathElement = element.Descendants(ns + \"HintPath\").First();\n\t\t\t\tHintPath = hintPathElement.Value;\n\t\t\t\tPathVersionPart = HintPath.Substring(\n\t\t\t\t\thintPathBeforePrefix.Length,\n\t\t\t\t\tHintPath.IndexOfAny(\n\t\t\t\t\t\tnew[] { '\\\\', '/' },\n\t\t\t\t\t\thintPathBeforePrefix.Length)\n\t\t\t\t\t- hintPathBeforePrefix.Length);\n\t\t\t\tvar packageRelativePath = HintPath.Substring(hintPathBeforePrefix.Length + PathVersionPart.Length + 1);\n\n\t\t\t\tvar pathSegments = packageRelativePath.Split(Path.DirectorySeparatorChar);\n\t\t\t\tif (pathSegments[0] == \"lib\")\n\t\t\t\t{\n\t\t\t\t\tTargetFrameworkVersion =\n\t\t\t\t\t\tpathSegments\n\t\t\t\t\t\t\t.Skip(1)\n\t\t\t\t\t\t\t.Take(1)\n\t\t\t\t\t\t\t.Where(x => knownFrameworkVersions.Contains(x, StringComparer.OrdinalIgnoreCase))\n\t\t\t\t\t\t\t.Select(x => x.ToLower())\n\t\t\t\t\t\t\t.FirstOrDefault();\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tpublic string HintPath { get; }\n\n\t\t\tpublic string PathVersionPart { get; }\n\n\t\t\tpublic string TargetFrameworkVersion { get; }\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Nested type: VersionComparer\n\n\t\tinternal class VersionComparer : StringComparer\n\t\t{\n\t\t\tpublic override int Compare(string x, string y)\n\t\t\t{\n\t\t\t\tstring xPreRelease;\n\t\t\t\tvar xParts = ParseVersionParts(x, out xPreRelease).Pad(4, 0).ToArray();\n\t\t\t\tstring yPreRelease;\n\t\t\t\tvar yParts = ParseVersionParts(y, out yPreRelease).Pad(4, 0).ToArray();\n\t\t\t\tif (xParts.SequenceEqual(yParts))\n\t\t\t\t{\n\t\t\t\t\tif (xPreRelease == null && yPreRelease == null)\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\tif (xPreRelease == null)\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\tif (yPreRelease == null)\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\treturn InvariantCultureIgnoreCase.Compare(xPreRelease, yPreRelease);\n\t\t\t\t}\n\n\t\t\t\treturn xParts.Zip(yParts, (xp, yp) => xp - yp).First(q => q != 0);\n\t\t\t}\n\n\n\t\t\tpublic override bool Equals(string x, string y)\n\t\t\t{\n\t\t\t\treturn Compare(x, y) == 0;\n\t\t\t}\n\n\n\t\t\tpublic override int GetHashCode(string obj)\n\t\t\t{\n\t\t\t\treturn obj.GetHashCode();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/Solution/SolutionTestsHelper.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing System.Xml.XPath;\nusing NUnit.Framework;\n\nnamespace Outracks.Fuse.Tests.Solution\n{\n    /// <summary>\n    /// Abstract base class for Visual Studio solution sanity checks.\n    /// </summary>\n    public static class SolutionTestsHelper\n    {\n        public static IEnumerable<string> FindCSharpSourceFiles(string path)\n        {\n            return FindSourceFiles(\"*.cs\", path);\n        }\n\n\t\tpublic static string GetPhysicalLocation(this Assembly assembly)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tthrow new ArgumentNullException(nameof(assembly));\n\n\t\t\tvar assemblyPath = assembly.Location;\n\n\t\t\tif (String.IsNullOrEmpty(assemblyPath))\n\t\t\t{\n\t\t\t\tvar uri = new UriBuilder(assembly.CodeBase);\n\t\t\t\tvar unescapeDataString = Uri.UnescapeDataString(uri.Path);\n\t\t\t\tassemblyPath = Path.GetFullPath(unescapeDataString);\n\t\t\t}\n\n\t\t\treturn assemblyPath;\n\t\t}\n\n\n\t\tpublic static IEnumerable<T> Pad<T>(this IEnumerable<T> source, int count, T paddingValue)\n\t\t{\n\t\t\tforeach (var item in source)\n\t\t\t{\n\t\t\t\tyield return item;\n\t\t\t\tcount--;\n\t\t\t}\n\n\t\t\twhile (count > 0)\n\t\t\t{\n\t\t\t\tyield return paddingValue;\n\t\t\t\tcount--;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Finds the physical path of the Visual Studio Project File the assembly is compiled from.\n\t\t/// </summary>\n\t\t/// <param name=\"assembly\">The assembly.</param>\n\t\t/// <returns>The physical path of the  Visual Studio Project File the assembly is compiled from.</returns>\n\t\tpublic static string FindProjectPathOf(Assembly assembly)\n        {\n            if (assembly == null)\n                throw new ArgumentNullException(nameof(assembly));\n\n            var assemblyPath = assembly.GetPhysicalLocation();\n\n            if (String.IsNullOrEmpty(assemblyPath))\n            {\n                throw new FileNotFoundException($\"Could not find a physical path for '{assembly}'.\");\n            }\n\n            FileInfo assemblyFile = new FileInfo(assemblyPath);\n            DirectoryInfo parentDirectory = assemblyFile.Directory;\n            string fileNotFoundMessage = $\"Couldn't find a Project file for '{assembly}'.\";\n            string projectFileName = Path.ChangeExtension(assemblyFile.Name, \"csproj\");\n\n            try\n            {\n                while ((parentDirectory = parentDirectory.Parent) != null)\n                {\n                    FileInfo[] solutionFiles = parentDirectory.GetFiles(projectFileName, SearchOption.AllDirectories);\n\n                    if (solutionFiles.Length > 0)\n                        return solutionFiles[0].FullName;\n                }\n            }\n            catch (Exception exception)\n            {\n                throw new FileNotFoundException(fileNotFoundMessage, exception);\n            }\n\n            throw new FileNotFoundException(fileNotFoundMessage);\n        }\n\n\n        /// <summary>\n        /// Finds the physical path to the Visual Studio Project File <typeparamref name=\"T\"/> is defined in.\n        /// </summary>\n        /// <typeparam name=\"T\">The type whose  Visual Studio Project File we should find the physical path to.</typeparam>\n        /// <returns>The physical path to the  Visual Studio Project File <typeparamref name=\"T\"/> is defined in.</returns>\n        public static string FindProjectPathOf<T>()\n        {\n            Assembly assembly = typeof(T).Assembly;\n            return FindProjectPathOf(assembly);\n        }\n\n\n        /// <summary>\n        /// Finds the physical path to the Visual Studio Solution File of the <see cref=\"Assembly\"/> <typeparamref name=\"T\"/> is defined in.\n        /// </summary>\n        /// <typeparam name=\"T\">The type whose <see cref=\"Assembly\"/> we should find the physical path to the Visual Studio Solution File of.</typeparam>\n        /// <returns>\n        /// The physical path to the Visual Studio Solution File of the <see cref=\"Assembly\"/> <typeparamref name=\"T\"/> is defined in.\n        /// </returns>\n        public static string FindSolutionPathOf<T>()\n        {\n            Assembly assembly = typeof(T).Assembly;\n            return FindSolutionPathOf(assembly);\n        }\n\n\n        /// <summary>\n        /// Finds the physical path to the Visual Studio Solution File of the <see cref=\"Assembly\"/> <paramref name=\"object\"/> is defined in.\n        /// </summary>\n        /// <param name=\"object\">The type whose <see cref=\"Assembly\"/> we should find the physical path to the Visual Studio Solution File of.</param>\n        /// <returns>\n        /// The physical path to the Visual Studio Solution File of the <see cref=\"Assembly\"/> <paramref name=\"object\"/> is defined in.\n        /// </returns>\n        public static string FindSolutionPathOf(object @object)\n        {\n            if (@object == null)\n                throw new ArgumentNullException(nameof(@object));\n\n            return FindSolutionPathOf(@object.GetType());\n        }\n\n\n        /// <summary>\n        /// Finds the physical path to the Visual Studio Solution File of the <see cref=\"Assembly\"/> <paramref name=\"type\"/> is defined in.\n        /// </summary>\n        /// <param name=\"type\">The type whose <see cref=\"Assembly\"/> we should find the physical path to the Visual Studio Solution File of.</param>\n        /// <returns>\n        /// The physical path to the Visual Studio Solution File of the <see cref=\"Assembly\"/> <paramref name=\"type\"/> is defined in.\n        /// </returns>\n        public static string FindSolutionPathOf(Type type)\n        {\n            if (type == null)\n                throw new ArgumentNullException(nameof(type));\n\n            return FindSolutionPathOf(type.Assembly);\n        }\n\n\n        /// <summary>\n        /// Finds the physical path to the Visual Studio Solution File of the <paramref name=\"assembly\"/>.\n        /// </summary>\n        /// <param name=\"assembly\">The assembly of which to find the physical Visual Studio Solution File path to.</param>\n        /// <returns>\n        /// The physical path to the Visual Studio Solution File of the <paramref name=\"assembly\"/>.\n        /// </returns>\n        public static string FindSolutionPathOf(Assembly assembly)\n        {\n\t\t\tvar assemblyPath = assembly.GetPhysicalLocation();\n\n\t\t\tif (String.IsNullOrEmpty(assemblyPath))\n\t\t\t{\n\t\t\t\tthrow new FileNotFoundException($\"Could not find a physical path for '{assembly}'.\");\n\t\t\t}\n\n\t\t\tFileInfo assemblyFile = new FileInfo(assemblyPath);\n\t\t\tDirectoryInfo parentDirectory = assemblyFile.Directory;\n\n            string fileNotFoundMessage = $\"Couldn't find a Solution file for '{assembly}'.\";\n\n            try\n            {\n                while ((parentDirectory = parentDirectory.Parent) != null)\n                {\n                    FileInfo[] solutionFiles = parentDirectory.GetFiles(\"*.sln\");\n\n                    if (solutionFiles.Length > 0)\n                        return solutionFiles[0].FullName;\n                }\n            }\n            catch (Exception exception)\n            {\n                throw new FileNotFoundException(fileNotFoundMessage, exception);\n            }\n\n            throw new FileNotFoundException(fileNotFoundMessage);\n        }\n\n\n        public static IEnumerable<string> FindSourceFiles(string searchPattern, string path)\n        {\n            var sourceCodeFiles = Directory.EnumerateFiles(path,\n                                                           searchPattern,\n                                                           SearchOption.AllDirectories)\n                                           .Where(x => !IsIgnoredPath(Path.GetDirectoryName(x)));\n            return sourceCodeFiles;\n        }\n\n\n\n        /// <summary>\n        /// Check all projects in solution at path for consistent nuget package references.\n        /// </summary>\n        /// <param name=\"solutionPath\">Path to .sln file.</param>\n        public static void VerifyNugetPackageReferences(string solutionPath, Func<NugetPackageElement, bool> filter)\n        {\n            filter = filter ?? (x => true);\n            var solutionDir = Path.GetDirectoryName(solutionPath);\n            //var solution = new ICSharpCode.NRefactory.ConsistencyCheck.Solution(solutionPath);\n            var packages = NugetPackageElement.Load(solutionDir).Where(filter).GroupBy(x => x.Id).ToList();\n            StringBuilder sb = new StringBuilder();\n            int errorCount = 0;\n            foreach (var package in packages)\n            {\n                var versions = package.GroupBy(x => x.Version).ToList();\n                if (versions.Count > 1)\n                {\n                    sb.AppendFormat(\"Found multiple versions of package {0}:\\r\\n{1}\",\n                                    package.Key,\n                                    String.Join(\"\",\n                                                versions.Select(\n                                                    x =>\n                                                        $\"    {x.Key}\\r\\n{String.Join(\"\", x.Select(y => $\"        {y.ProjectName}\\r\\n\"))}\")));\n\n                    errorCount++;\n\n                    var suggestedVersion =\n                        versions.Select(x => x.Key).OrderBy(x => x).Last();\n                    var suggestedUpgrades =\n                        versions.Where(x => x.Key != suggestedVersion).SelectMany(x => x);\n                    sb.AppendFormat(\"    Suggested version is {0}, install using:\\r\\n{1}\",\n                                    suggestedVersion,\n                                    String.Join(\"\",\n                                                suggestedUpgrades.Select(\n                                                    x =>\n                                                        $\"        Update-Package -Id {x.Id} -ProjectName {x.ProjectName} -Version {suggestedVersion}\\r\\n\")));\n                }\n            }\n            foreach (var item in packages.SelectMany(x => x))\n                errorCount += item.ValidateHintPathReference(sb);\n            Assert.That(errorCount, Is.EqualTo(0), \"Found package reference inconsitencies:\\r\\n\" + sb);\n        }\n\n\n        public static void VerifyProjectNoOrphanSourceCodeFiles(string projectPath)\n        {\n            XDocument project;\n            using (var f = File.OpenRead(projectPath))\n            {\n                project = XDocument.Load(f);\n            }\n            var projectDir = Path.GetDirectoryName(projectPath);\n            var xmlNamespaceManager = new XmlNamespaceManager(new NameTable());\n            xmlNamespaceManager.AddNamespace(\"pj\", project.Root.Name.NamespaceName);\n            var filesInProject =\n                ((IEnumerable)project.XPathEvaluate(\"/pj:Project/pj:ItemGroup/pj:Compile/@Include\", xmlNamespaceManager))\n                    .Cast<XAttribute>()\n                    .Select(x => x.Value)\n                    .Where(x => Path.GetExtension(x) == \".cs\")\n                    .Select(x => MakeRelative(Path.GetFullPath(Path.Combine(projectDir, x)), projectDir)).ToList();\n            var filesInDirectory =\n                FindCSharpSourceFiles(projectDir)\n                    .Select(x => MakeRelative(x, projectDir)).ToList();\n\n            var errorLog = new StringBuilder();\n            var filesNotIncludedInProject = filesInDirectory.Except(filesInProject, StringComparer.OrdinalIgnoreCase);\n            foreach (var orphanFile in filesNotIncludedInProject)\n                errorLog.AppendFormat(\"File \\\"{0}\\\" in project folder of {1} is not included.\", orphanFile, projectPath);\n\n            if (errorLog.Length > 0)\n                Assert.Fail(errorLog.ToString());\n        }\n\n\n        private static IEnumerable<string> GetSourceCodeFiles(string solutionDirectory,\n                                                              Func<string, bool> excludeFilter = null,\n                                                              string[] fileSearchPatterns = null)\n        {\n            fileSearchPatterns = fileSearchPatterns ?? new[] { \"*.cs\", \"*.csproj\", \"*.config\", \"*.xml\" };\n            excludeFilter = excludeFilter ?? IsIgnoredPath;\n            return\n                fileSearchPatterns.SelectMany(x => Directory.EnumerateFiles(solutionDirectory, x, SearchOption.AllDirectories)).Where(\n                    x => !excludeFilter(x));\n        }\n\n\n        private static IEnumerable<string> GetSourceCodeFilesThatShouldHaveUtf8Encoding(string solutionDirectory,\n                                                                                        Func<string, bool> excludeFilter = null,\n                                                                                        string[] fileSearchPatterns = null)\n        {\n            // Keeping this method in case we don't want certain files to be UTF-8\n            return GetSourceCodeFiles(solutionDirectory, excludeFilter, fileSearchPatterns);\n        }\n\n\n        private static bool IsIgnoredPath(string directoryName)\n        {\n            var slash = Path.DirectorySeparatorChar;\n            return directoryName.Contains(slash + \"obj\" + slash)\n                || directoryName.Contains(slash + \"bin\" + slash);\n        }\n\n\n        private static string MakeRelative(string filePath, string referencePath)\n        {\n            var fileUri = new Uri(filePath);\n            var referenceUri = new Uri(referencePath);\n            return referenceUri.MakeRelativeUri(fileUri).ToString().Replace(\"/\", Path.DirectorySeparatorChar.ToString());\n        }\n\n        #region Nested type: NugetPackageElement\n\n\t\t#endregion\n    }\n}\n"
  },
  {
    "path": "src/fuse/tests/Solution/SolutionVersioningTests.cs",
    "content": "﻿using System.IO;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace Outracks.Fuse.Tests.Solution\n{\n\t[TestFixture]\n\tpublic class SolutionVersioningTests\n\t{\n\t\tstatic string SolutionDirectory\n\t\t{\n\t\t\tget { return Path.GetDirectoryName(SolutionTestsHelper.FindSolutionPathOf<SolutionVersioningTests>()); }\n\t\t}\n\n\t\t[Test]\n\t\tpublic void All_packages_in_solution_have_same_version_and_references_are_correct()\n\t\t{\n\t\t\tvar excludedPackages = new[] { \"NUnit\", \"NSubstitute\", \"Castle.Core\" };\n\t\t\tSolutionTestsHelper.VerifyNugetPackageReferences(\n\t\t\t\tSolutionTestsHelper.FindSolutionPathOf(this),\n\t\t\t\tx => !excludedPackages.Contains(x.Id));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/SublimeTest/SublimeTest/MyApp.ux",
    "content": "<App xmlns:b=\"Outracks.UIThemes.MobileBlue\" ux:ClassName=\"MyApp\" ClearColor=\"1, 1, 1, 1\">\n  <Panel> \t\n    <Button ux:Name=\"hehe\">\n    \t<Rectangle CornerRadius=\"20\">\n    \t\t<SolidColor Opacity=\"0.5\" Color=\"1,0,0,1\" />\n    \t</Rectangle>\n    \t<Circle>\n    \t\t<LinearGradient>\n    \t\t\t<GradientStop Color=\"1,0,0,1\"/>\n                <GradientStop Color=\"0,0,0,1\"/>                \n    \t\t</LinearGradient>\n    \t\t<SolidColor>      \n            </SolidColor>\n    \t</Circle>\n    \t<Rectangle Margin=\"20\" />\n    </Button>    \n  </Panel>\t\n</App>"
  },
  {
    "path": "src/fuse/tests/SublimeTest/SublimeTest/MyApp.ux.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Fuse;\nusing Fuse.Controls;\n\npublic partial class MyApp\n{\n    public MyApp()\n    {\n        InitializeUX();\n        hehe.ToString();        \n        hehe.Margin=20;            \n        FrameTime = 20;   \n         \n    }\n\n    public List<int> Test()\n    {       \n    }\n\n    public App Foo()\n    {\n    }\n}     "
  },
  {
    "path": "src/fuse/tests/SublimeTest/SublimeTest/SublimeTest.unoproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Format=\"1.0\">\n    <BuildDir>.Build</BuildDir>\n    <CacheDir>.Cache</CacheDir>\n    <Copyright>Copyright (C) 2014</Copyright>\n    <DefaultNamespace>$(QIdentifier)</DefaultNamespace>\n    <Description></Description>\n    <Icon></Icon>\n    <Publisher>[Publisher]</Publisher>\n    <ReferenceUnoCore>True</ReferenceUnoCore>\n    <Title>$(Name)</Title>\n    <URL></URL>\n    <Version>0.0.0.0</Version>\n    <VersionCount>1</VersionCount>\n    <Android>\n        <ApplicationLabel>$(Title)</ApplicationLabel>\n        <Description>$(Description)</Description>\n        <Package>com.$(DefaultNamespace)</Package>\n        <VersionCode>$(VersionCount)</VersionCode>\n        <VersionName>$(Version)</VersionName>\n        <Icons>\n            <HDPI>$(Icon)</HDPI>\n            <LDPI>$(Icon)</LDPI>\n            <MDPI>$(Icon)</MDPI>\n            <XHDPI>$(Icon)</XHDPI>\n            <XXHDPI>$(Icon)</XXHDPI>\n            <XXXHDPI>$(Icon)</XXXHDPI>\n        </Icons>\n        <Key>\n            <Alias></Alias>\n            <AliasPassword></AliasPassword>\n            <Store></Store>\n            <StorePassword></StorePassword>\n        </Key>\n    </Android>\n    <HTML>\n        <Favicon>$(Icon)</Favicon>\n        <Title>$(Title)</Title>\n    </HTML>\n    <iOS>\n        <Icons>\n            <iPad_29_1x>$(Icon)</iPad_29_1x>\n            <iPad_29_2x>$(Icon)</iPad_29_2x>\n            <iPad_40_1x>$(Icon)</iPad_40_1x>\n            <iPad_40_2x>$(Icon)</iPad_40_2x>\n            <iPad_50_1x>$(Icon)</iPad_50_1x>\n            <iPad_50_2x>$(Icon)</iPad_50_2x>\n            <iPad_72_1x>$(Icon)</iPad_72_1x>\n            <iPad_72_2x>$(Icon)</iPad_72_2x>\n            <iPad_76_1x>$(Icon)</iPad_76_1x>\n            <iPad_76_2x>$(Icon)</iPad_76_2x>\n            <iPhone_29_1x>$(Icon)</iPhone_29_1x>\n            <iPhone_29_2x>$(Icon)</iPhone_29_2x>\n            <iPhone_40_2x>$(Icon)</iPhone_40_2x>\n            <iPhone_57_1x>$(Icon)</iPhone_57_1x>\n            <iPhone_57_2x>$(Icon)</iPhone_57_2x>\n            <iPhone_60_2x>$(Icon)</iPhone_60_2x>\n        </Icons>\n        <LaunchImages>\n            <iPad_Landscape_1x></iPad_Landscape_1x>\n            <iPad_Landscape_2x></iPad_Landscape_2x>\n            <iPad_Portrait_1x></iPad_Portrait_1x>\n            <iPad_Portrait_2x></iPad_Portrait_2x>\n            <iPhone_Portrait_2x></iPhone_Portrait_2x>\n            <iPhone_Portrait_R4></iPhone_Portrait_R4>\n        </LaunchImages>\n    </iOS>\n    <Mobile>\n        <KeepAlive>False</KeepAlive>\n        <Orientations>Auto</Orientations>\n        <RunsInBackground>True</RunsInBackground>\n        <ShowStatusbar>True</ShowStatusbar>\n    </Mobile>\n    <References>\n        <PackageReference Name=\"Fuse.Animations\" />\n        <PackageReference Name=\"Fuse.Controls\" />\n        <PackageReference Name=\"Fuse.Drawing\" />\n        <PackageReference Name=\"Fuse.Drawing.Primitives\" />\n        <PackageReference Name=\"Fuse.Elements\" />\n        <PackageReference Name=\"Fuse.Triggers\" />\n        <PackageReference Name=\"Fuse.Navigation\" />\n        <PackageReference Name=\"Fuse.Entities\" />\n        <PackageReference Name=\"Fuse.Shapes\" />\n        <PackageReference Name=\"FuseCore\" />\n        <PackageReference Name=\"Outracks.UIThemes.MobileBlue\" />\n    </References>\n    <Files>\n        <UXFile Path=\"MyApp.ux\" />\n        <SourceFile Path=\"MyApp.ux.uno\" />\n    </Files>\n</Project>\n"
  },
  {
    "path": "src/fuse/tests/SublimeTest/SublimeTest.unosln",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<Solution>\n  <Project Path=\"SublimeTest/SublimeTest.unoproj\" />\n</Solution>"
  },
  {
    "path": "src/fuse/tests/VersionWriterTests.cs",
    "content": "﻿using System.IO;\nusing NUnit.Framework;\nusing Outracks.Fuse;\n\nnamespace Outracks.CLI.Tests\n{\n\tclass VersionWriterTests\n\t{\n\t\t[Test]\n\t\tpublic void WritesVersion()\n\t\t{\n\t\t\tvar writer = new StringWriter() {  NewLine = \"\\n\" };\n\t\t\tVersionWriter.Write(writer, \"1.2.3-moo\");\n\t\t\tAssert.AreEqual(\"Fuse 1.2.3-moo\\n\", writer.ToString());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.7.0.0\" newVersion=\"4.7.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Threading.Tasks.Extensions\" publicKeyToken=\"cc7b13ffcd2ddd51\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.2.0.1\" newVersion=\"4.2.0.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Runtime.CompilerServices.Unsafe\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.6.0\" newVersion=\"4.0.6.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Xml.XmlDocument\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fuse/tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Castle.Core\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"Microsoft.Reactive.Testing\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"NSubstitute\" version=\"4.2.2\" targetFramework=\"net46\" />\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.7.1\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net45\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fuse/tray/Program.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Outracks.Diagnostics;\nusing Outracks.Extensions;\nusing Outracks.Fuse.Daemon;\nusing Outracks.Fuse.Protocol;\nusing Outracks.Fusion;\n\nnamespace Outracks.Fuse.Tray\n{\n\tpublic static class Program\n\t{\n\t\tstatic Program()\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n\t\t}\n\n\t\t[STAThread]\n\t\tstatic void Main()\n\t\t{\n\t\t\tStart(Icon.FromResource(\"Outracks.Fuse.Tray.Fuse.ico\"));\n\t\t}\n\n\t\tpublic static void Start(Icon icon)\n\t\t{\n\t\t\tvar args = Environment.GetCommandLineArgs().ToList();\n\n\t\t\tvar fuse = FuseApi.Initialize(\"fuse-tray\", args);\n\n\t\t\tvar log = fuse.Report;\n\n\t\t\tvar native = Application.Initialize(args);\n\n\t\t\tvar client = fuse.ConnectAsync(\"fuse-tray\");\n\n\t\t\tvar app = native.CreateTrayApplication(\n\t\t\t\tlog,\n\t\t\t\ttitle: Observable.Return(\"\"),\n\t\t\t\ticon: Observable.Return(icon),\n\t\t\t\tmenu:\n\t\t\t\t\tMenu.Item(\n\t\t\t\t\t\t\"fuse X v\" + fuse.Version,\n\t\t\t\t\t\tcommand: Command.Disabled)\n\t\t\t\t\t+ Menu.Separator\n\t\t\t\t\t+ Menu.Item(\n\t\t\t\t\t\tPlatform.IsMac ? \"Quit\" : \"Exit\",\n\t\t\t\t\t\tasync () => await Exit(fuse, client)));\n\n\t\t\t// Exit on connection lost\n\t\t\tclient.ToObservable().SelectMany(c => c.ConnectionLost).Subscribe(d => Application.Exit(0));\n\n\t\t\t// Start dashboard on click\n\t\t\tapp.UserClicked.Subscribe(clicks => fuse.Studio.Start());\n\n\t\t\tApplication.Run();\n\t\t}\n\n\t\tstatic async Task Exit(IFuse fuse, Task<IMessagingService> clientTask)\n\t\t{\n\t\t\tif (Platform.IsMac)\n\t\t\t{\n\t\t\t\t// HACK: Kill all processes immediately.\n\t\t\t\tnew FuseKiller(fuse.Report, fuse.FuseRoot).Execute(ColoredTextWriter.Out);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar client = await clientTask;\n\t\t\t\tawait client\n\t\t\t\t\t.Request(new KillRequest { Reason = \"User quit from tray menu\" })\n\t\t\t\t\t.TimeoutAfter(TimeSpan.FromSeconds(1));\n\t\t\t}\n\t\t\tcatch (TimeoutException)\n\t\t\t{\n\t\t\t\tvar processes = Process.GetProcessesByName(\"fuse\")\n\t\t\t\t\t\t.Concat(Process.GetProcessesByName(\"fuse X\"));\n\n\t\t\t\tforeach (var process in processes)\n\t\t\t\t\tprocess.Kill();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplication.Exit(0);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fuse/tray/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Fuse.TrayApplication\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/fuse/tray/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Outracks.Fuse.TrayApplication_Windows.Properties {\n\t/// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n\n        private static global::System.Resources.ResourceManager resourceMan;\n\n        private static global::System.Globalization.CultureInfo resourceCulture;\n\n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n\n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Outracks.Fuse.TrayApplication_Windows.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n\n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/fuse/tray/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "src/fuse/tray/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.34209\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Outracks.Fuse.Tray.Properties {\n\n\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"12.0.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n\n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n\n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n\n        [global::System.Configuration.UserScopedSettingAttribute()]\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n        public global::System.Collections.Specialized.StringCollection RecentProjects {\n            get {\n                return ((global::System.Collections.Specialized.StringCollection)(this[\"RecentProjects\"]));\n            }\n            set {\n                this[\"RecentProjects\"] = value;\n            }\n        }\n\n        [global::System.Configuration.UserScopedSettingAttribute()]\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n        [global::System.Configuration.DefaultSettingValueAttribute(\"True\")]\n        public bool ShowSplashScreen {\n            get {\n                return ((bool)(this[\"ShowSplashScreen\"]));\n            }\n            set {\n                this[\"ShowSplashScreen\"] = value;\n            }\n        }\n\n        [global::System.Configuration.UserScopedSettingAttribute()]\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n        [global::System.Configuration.DefaultSettingValueAttribute(\"True\")]\n        public bool ShouldUpgradeSettings {\n            get {\n                return ((bool)(this[\"ShouldUpgradeSettings\"]));\n            }\n            set {\n                this[\"ShouldUpgradeSettings\"] = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/fuse/tray/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\" GeneratedClassNamespace=\"Outracks.Fuse.TrayApplication_Windows.Properties\" GeneratedClassName=\"Settings\">\n  <Profiles />\n  <Settings>\n    <Setting Name=\"RecentProjects\" Type=\"System.Collections.Specialized.StringCollection\" Scope=\"User\">\n      <Value Profile=\"(Default)\" />\n    </Setting>\n    <Setting Name=\"ShowSplashScreen\" Type=\"System.Boolean\" Scope=\"User\">\n      <Value Profile=\"(Default)\">True</Value>\n    </Setting>\n    <Setting Name=\"ShouldUpgradeSettings\" Type=\"System.Boolean\" Scope=\"User\">\n      <Value Profile=\"(Default)\">True</Value>\n    </Setting>\n  </Settings>\n</SettingsFile>"
  },
  {
    "path": "src/fuse/tray/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fuse/tray/fuse-tray.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{A7F96918-8029-4EF4-A4EA-686A4B59FD61}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <RootNamespace>Outracks.Fuse.Tray</RootNamespace>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <OutputPath Condition=\" '$(OS)' != 'Windows_NT' \">bin\\$(Configuration)</OutputPath>\n    <OutputPath Condition=\" '$(OS)' == 'Windows_NT' \">$(SolutionDir)bin\\$(Configuration)</OutputPath>\n    <AssemblyName>fuse-tray</AssemblyName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <Optimize>false</Optimize>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <Optimize>true</Optimize>\n    <DebugType>pdbonly</DebugType>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <EmbeddedResource Include=\"Properties\\Resources.resx\" />\n    <EmbeddedResource Include=\"Fuse.ico\" />\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n      <DesignTime>True</DesignTime>\n    </Compile>\n    <None Include=\"app.config\" />\n    <None Include=\"Properties\\Settings.settings\">\n      <Generator>SettingsSingleFileGenerator</Generator>\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\n    </None>\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Settings.settings</DependentUpon>\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\n    </Compile>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3c1c1047-8830-498e-882a-503c0956cbe3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8dfb02e0-acbf-4432-8dd9-56712e206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "src/fuse/tray/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fusion/README.md",
    "content": "## Fusion\n\n_Fusion is a framework for cross-platform UI development, which uses the native UI framework to render its content. It's based on a reactive philosphy, where the UI is updated on demand compared to immediate UI mode frameworks._\n\n## Documentation\n\n* [Getting Started](Docs/GettingStarted.md)\n* [Auto-Reload](AutoReload/README.md)\n\n**TODO: Add documents for all controls etc.**\n"
  },
  {
    "path": "src/fusion/core/Animation.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Animation\n\t{\n\t\tpublic static Size<IObservable<Points>> LowPass(\n\t\t\tthis Size<IObservable<Points>> size,\n\t\t\tdouble amount = 0.5,\n\t\t\tdouble tolerance = double.Epsilon)\n\t\t{\n\t\t\treturn size\n\t\t\t\t.Select(component => component\n\t\t\t\t\t.Select(p => p.ToDouble())\n\t\t\t\t\t.LowPass(amount, tolerance)\n\t\t\t\t\t.Select(d => new Points(d)))\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\n\t\tpublic static IObservable<Points> LowPass(\n\t\t\tthis IObservable<Points> targets,\n\t\t\tdouble amount = 0.5,\n\t\t\tdouble tolerance = double.Epsilon)\n\t\t{\n\t\t\treturn targets\n\t\t\t\t.Select(t => t.ToDouble())\n\t\t\t\t.LowPass(amount, tolerance)\n\t\t\t\t.Select(d => new Points(d))\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\n\t\tpublic static IObservable<double> LowPass(\n\t\t\tthis IObservable<double> targets,\n\t\t\tdouble amount = 0.5,\n\t\t\tdouble tolerance = double.Epsilon)\n\t\t{\n\t\t\treturn targets.Animate((from, to) =>\n\t\t\t\tApplication\n\t\t\t\t\t.PerFrame\n\t\t\t\t\t.Scan(from, (current, frame) => to * (1 - amount) + current * amount)\n\t\t\t\t\t.TakeWhile(result =>  Math.Abs(result - to) > tolerance)\n\t\t\t\t\t.Concat(Observable.Return(to)));\n\t\t}\n\n\t\tpublic static IObservable<double> QuintEaseOut(\n\t\t\tthis IObservable<double> targets,\n\t\t\tTimeSpan duration)\n\t\t{\n\t\t\tconst double fps = 60.0;\n\t\t\tvar durationInFrames = (int)(duration.TotalSeconds * fps);\n\n\t\t\treturn targets.Animate((from, to) =>\n\t\t\t{\n\t\t\t\tvar easingFunc = QuintEaseOut(durationInFrames, from, to);\n\t\t\t\treturn Application\n\t\t\t\t\t.PerFrame\n\t\t\t\t\t.Select((i,j) => (long)j)\n\t\t\t\t\t.Take(durationInFrames)\n\t\t\t\t\t.Select(easingFunc)\n\t\t\t\t\t.Concat(Observable.Return(to));\n\t\t\t});\n\t\t}\n\n\t\tstatic Func<long, double> QuintEaseOut(long duration, double from, double to)\n\t\t{\n\t\t\treturn FlipArgumentsIfNeeded(OneWayQuintEaseOut, duration, from, to);\n\t\t}\n\n\t\tstatic Func<long, double> OneWayQuintEaseOut(long duration, double from, double to)\n\t\t{\n\t\t\treturn ti =>\n\t\t\t{\n\t\t\t\tvar t = (double)ti;\n\t\t\t\tvar d = (double)duration;\n\t\t\t\tvar b = from;\n\t\t\t\tvar c = to;\n\t\t\t\treturn c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n\t\t\t};\n\t\t}\n\n\t\t/// The easing functions you find online only works in one direction, so if you want to copy paste them you might want to call it through this thing\n\t\tstatic Func<long, double> FlipArgumentsIfNeeded(Func<long, double, double, Func<long, double>> easingFuncFactory, long duration, double from, double to)\n\t\t{\n\t\t\tif (to < from)\n\t\t\t{\n\t\t\t\treturn ti => from - easingFuncFactory(duration, to, from)(ti);\n\t\t\t}\n\n\t\t\treturn easingFuncFactory(duration, from, to);\n\t\t}\n\n\t\tpublic static IObservable<double> Animate(\n\t\t\tthis IObservable<double> destinations,\n\t\t\tFunc<double, double, IObservable<double>> animate)\n\t\t{\n\t\t\treturn Observable\n\t\t\t\t.Create<double>(observer =>\n\t\t\t\t{\n\t\t\t\t\tvar results = new BehaviorSubject<double>(double.NaN);\n\n\t\t\t\t\treturn Disposable.Combine(\n\t\t\t\t\t\tresults,\n\n\t\t\t\t\t\tresults.Skip(1).Subscribe(observer),\n\n\t\t\t\t\t\tdestinations.SubscribeUsing(destination =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar source = results.Value;\n\n\t\t\t\t\t\t\tif (double.IsNaN(source))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// No previous value, jump to destination\n\t\t\t\t\t\t\t\tresults.OnNext(destination);\n\t\t\t\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// we have a source and a destination, let's animate between them\n\t\t\t\t\t\t\t// and emit the results (until we're disposed by a new destination)\n\t\t\t\t\t\t\treturn animate(source, destination).Subscribe(results.OnNext);\n\t\t\t\t\t\t}));\n\t\t\t\t})\n\t\t\t\t.Replay(1).RefCount();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Application.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Concurrency;\nusing System.Threading.Tasks;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic class InitializationFailed : Exception\n\t{\n\t\tpublic InitializationFailed(Exception innerException)\n\t\t\t: base(\"Failed to initialize Native UI layer: \" + innerException.Message, innerException)\n\t\t{ }\n\t}\n\n\tpublic static class Application\n\t{\n\t\tpublic static event Action Terminating\n\t\t{\n\t\t\tadd { _implementation.Terminating += value; }\n\t\t\tremove { _implementation.Terminating -= value; }\n\t\t}\n\n\t\tpublic static Func<IDocument, Window> CreateDocumentWindow\n\t\t{\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic static Action LaunchedWithoutDocuments\n\t\t{\n\t\t\tget; set;\n\t\t}\n\n\t\tpublic static IObservable<Window> DocumentOpened\n\t\t{\n\t\t\tget { return _implementation.DocumentOpened; }\n\t\t}\n\n\t\tstatic Application()\n\t\t{\n\t\t\tCreateDocumentWindow = doc =>\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Application.CreateDocumentWindow should be set before calling Application.Run()\");\n\t\t\t};\n\n\t\t\tLaunchedWithoutDocuments = () =>\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Application.LaunchedWithoutDocuments should be set before calling Application.Run()\");\n\t\t\t};\n\t\t}\n\n\t\tstatic IApplication _implementation;\n\n\t\tpublic static IApplication Initialize(IList<string> args)\n\t\t{\n\t\t\t_implementation = ImplementationLocator.CreateInstance<IApplication>();\n\t\t\t_implementation.Initialize(args);\n\t\t\treturn _implementation;\n\t\t}\n\n\t\tpublic static bool InitializeAsDocumentApp(IList<string> args, string applicationName)\n\t\t{\n\t\t\t_implementation = ImplementationLocator.CreateInstance<IApplication>();\n\t\t\treturn _implementation.InitializeDocumentApp(args, applicationName);\n\t\t}\n\n\t\tpublic static void Run()\n\t\t{\n\t\t\tGetImplementationOrThrow().Run();\n\t\t}\n\n\t\tpublic static void Run(Window window)\n\t\t{\n\t\t\tGetImplementationOrThrow().Run(window);\n\t\t}\n\n\t\tpublic static void Exit(byte exitCode)\n\t\t{\n\t\t\tGetImplementationOrThrow().Exit(exitCode);\n\t\t}\n\n\t\tpublic static IDialog<object> Desktop\n\t\t{\n\t\t\tget { return GetImplementationOrThrow().Desktop; }\n\t\t}\n\n\t\tpublic static void ShowOpenDocumentDialog(params FileFilter[] documentTypes)\n\t\t{\n\t\t\tGetImplementationOrThrow().ShowOpenDialog(documentTypes);\n\t\t}\n\n\t\tpublic static Task<IDocument> OpenDocument(AbsoluteFilePath path, bool showWindow = false)\n\t\t{\n\t\t\treturn GetImplementationOrThrow().OpenDocument(path, showWindow);\n\t\t}\n\n\t\tpublic static Optional<Menu> DefaultMenu\n\t\t{\n\t\t\tget { return GetImplementationOrThrow().DefaultMenu; }\n\t\t\tset { GetImplementationOrThrow().DefaultMenu = value; }\n\t\t}\n\n\t\tpublic static Menu EditMenu\n\t\t{\n\t\t\tget { return GetImplementationOrThrow().EditMenu; }\n\t\t}\n\n\t\tpublic static IObservable<long> PerFrame { get; set; }\n\n\t\tpublic static IScheduler MainThread { get; set; }\n\n\t\tpublic static Task<T> InvokeAsync<T>(this IScheduler dispatcher, Func<T> func)\n\t\t{\n\t\t\tvar tcs = new TaskCompletionSource<T>();\n\n\t\t\tdispatcher.Schedule(() =>\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar result = func();\n\t\t\t\t\ttcs.SetResult(result);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\ttcs.SetException(e);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn tcs.Task;\n\t\t}\n\n\t\tstatic IApplication GetImplementationOrThrow()\n\t\t{\n\t\t\treturn _implementation.ThrowIfNull(new InvalidOperationException());\n\t\t}\n\t}\n\n\tpublic interface IApplication\n\t{\n\t\t// TODO: replace with static initialized NotificationIcon\n\t\tITrayApplication CreateTrayApplication(IReport errorHandler, IObservable<string> title, Menu menu, IObservable<Icon> icon);\n\n\t\tvoid Initialize(IList<string> args);\n\t\tbool InitializeDocumentApp(IList<string> args, string applicationName);\n\t\tvoid Run();\n\t\tvoid Run(Window window);\n\t\tvoid Exit(byte exitCode);\n\n\t\tvoid ShowOpenDialog(params FileFilter[] documentTypes);\n\t\tTask<IDocument> OpenDocument(AbsoluteFilePath path, bool giveFocus = false);\n\t\tIObservable<Window> DocumentOpened { get; }\n\n\t\tOptional<Menu> DefaultMenu { get; set; }\n\n\t\tIDialog<object> Desktop { get; }\n\t\tMenu EditMenu { get; }\n\n\t\tevent Action Terminating;\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/AutoReload/AutoReload.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.AutoReload\n{\n\tpublic static class AutoReloadExtensions\n\t{\n\t\tpublic static IControl AutoReload(\n\t\t\tthis IControl control,\n\t\t\tobject[] parameters,\n\t\t\t[CallerFilePath] string filepath = \"\",\n\t\t\t[CallerMemberName] string method = \"\",\n\t\t\tAssembly callingAssembly = null)\n\t\t{\n\t\t\treturn Fusion.AutoReload.AutoReload.Control(control, parameters, filepath, method, callingAssembly ?? Assembly.GetCallingAssembly());\n\t\t}\n\n\t\tpublic static IControl AutoReload(\n\t\t\tthis IControl control,\n\t\t\t[CallerFilePath] string filepath = \"\",\n\t\t\t[CallerMemberName] string method = \"\")\n\t\t{\n\t\t\treturn control.AutoReload(new object[0], filepath, method, Assembly.GetCallingAssembly());\n\t\t}\n\t}\n\n\tclass AutoReloadMethod\n\t{\n\t\tpublic readonly AbsoluteFilePath Path;\n\t\tpublic readonly string MethodName;\n\t\tpublic readonly IObservable<AutoReloadMethod> Changed;\n\n\t\tpublic AutoReloadMethod(AbsoluteFilePath path, string methodName, IFileSystem fs)\n\t\t{\n\t\t\tPath = path;\n\t\t\tMethodName = methodName;\n\t\t\tChanged = fs\n\t\t\t\t.Watch(path)\n\t\t\t\t.Select(x => this)\n\t\t\t\t.Throttle(TimeSpan.FromMilliseconds(500));\n\t\t}\n\t}\n\n\tpublic static class AutoReload\n\t{\n\t\tstatic readonly Subject<string> _log = new Subject<string>();\n\t\tpublic static IObservable<string> Log { get { return _log; } }\n\n\t\tpublic static IControl Control(\n\t\t\tIControl control,\n\t\t\tobject[] parameters,\n\t\t\t[CallerFilePath] string filepath = \"\",\n\t\t\t[CallerMemberName] string methodName = \"\",\n\t\t\tAssembly callingAssembly = null)\n\t\t{\n\t\t\tcallingAssembly = callingAssembly ?? Assembly.GetCallingAssembly();\n\t\t\tif (string.IsNullOrEmpty(callingAssembly.Location))\n\t\t\t\treturn control;\n\n\t\t\treturn new AutoReloadMethod(AbsoluteFilePath.Parse(filepath), methodName, new Shell())\n\t\t\t\t.Changed\n\t\t\t\t.Select(method => Reload(method, parameters, _log.ToProgress()))\n\t\t\t\t.NotNone()\n\t\t\t\t.StartWith(control)\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tstatic Optional<IControl> Reload(AutoReloadMethod method, object[] args, IProgress<string> log)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar referencedAssemblies = GetLoadedAssembliesPaths().Select(asm => asm.NativePath);\n\t\t\t\tvar asmOpt = ControlFactory.Compile(new[] { method.Path }, log, referencedAssemblies);\n\t\t\t\treturn asmOpt.SelectMany(asm => ControlFactory.CreateControl(asm, method.MethodName, args, log));\n\t\t\t}\n\t\t\tcatch (Exception ex)\n\t\t\t{\n\t\t\t\tlog.Report(\"Exception: \" + ex + \"\\n\");\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tprivate static IEnumerable<AbsoluteFilePath> GetLoadedAssembliesPaths()\n\t\t{\n\t\t\tvar l = new List<AbsoluteFilePath>();\n\t\t\tforeach (var loadedAsm in AppDomain.CurrentDomain.GetAssemblies())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tl.Add(loadedAsm.GetCodeBaseFilePath());\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn l;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/AutoReload/ControlFactory.cs",
    "content": "using System;\nusing System.CodeDom.Compiler;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing Microsoft.CSharp;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.AutoReload\n{\n\tpublic static class ControlFactory\n\t{\n\t\tpublic static Optional<Assembly> Compile(IEnumerable<AbsoluteFilePath> files, IProgress<string> log, IEnumerable<string> referencedAssemblies)\n\t\t{\n\t\t\tvar provider = new CSharpCodeProvider();\n\t\t\tvar parameters = new CompilerParameters();\n\n\t\t\tparameters.ReferencedAssemblies.AddRange(referencedAssemblies.ToArray());\n\t\t\tparameters.GenerateInMemory = true;\n\t\t\tparameters.GenerateExecutable = false;\n\n\t\t\tlog.Report(\"Begin auto-reload\\n\");\n\t\t\tvar results = provider.CompileAssemblyFromFile(parameters, files.Select(f => f.NativePath).ToArray());\n\t\t\tif (results.Errors.HasErrors)\n\t\t\t{\n\t\t\t\tforeach (var errors in results.Errors.OfType<CompilerError>())\n\t\t\t\t{\n\t\t\t\t\tlog.Report(\"Error at line \" + errors.Line + \": \" + errors.ErrorText + \"\\n\");\n\t\t\t\t}\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\n\t\t\treturn results.CompiledAssembly;\n\t\t}\n\n\t\tpublic static Optional<IControl> CreateControl(Assembly assembly, string factoryMethodName, object[] args, IProgress<string> log)\n\t\t{\n\t\t\tvar contentCreateMethod = assembly\n\t\t\t\t.GetTypes()\n\t\t\t\t.Select(x => x.GetMethod(factoryMethodName, BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic))\n\t\t\t\t.Where(x => x != null)\n\t\t\t\t.FirstOrDefault(x => x.ReturnType == typeof(IControl));\n\n\t\t\tif (contentCreateMethod == null)\n\t\t\t{\n\t\t\t\tlog.Report(\"Unable to find class that has a public static '\" + factoryMethodName + \"' method\\n\");\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t\tlog.Report(\"Loading type \" + contentCreateMethod.DeclaringType.FullName + \"\\n\");\n\n\t\t\tvar content = (IControl)contentCreateMethod\n\t\t\t\t.Invoke(null, args);\n\n\t\t\treturn Optional.Some(content);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/BehaviorProperty.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class BehaviorProperty\n\t{\n\t\tpublic static IBehaviorProperty<T> Create<T>(\n\t\t\tBehaviorSubject<T> subject,\n\t\t\tOptional<Command> invalidate = default(Optional<Command>),\n\t\t\tIObservable<bool> isReadOnly = null)\n\t\t{\n\t\t\treturn new BehaviorSubjectWrapper<T>(subject, invalidate, isReadOnly ?? Observable.Return(false));\n\t\t}\n\n\t\tclass BehaviorSubjectWrapper<T> : IBehaviorProperty<T>\n\t\t{\n\t\t\treadonly BehaviorSubject<T> _subject;\n\t\t\treadonly Command _invalidate;\n\t\t\treadonly IObservable<bool> _isReadOnly;\n\n\t\t\tpublic BehaviorSubjectWrapper(\n\t\t\t\tBehaviorSubject<T> subject,\n\t\t\t\tOptional<Command> invalidate,\n\t\t\t\tIObservable<bool> isReadOnly)\n\t\t\t{\n\t\t\t\t_subject = subject;\n\t\t\t\t_invalidate = invalidate.Or(Command.Disabled);\n\t\t\t\t_isReadOnly = isReadOnly;\n\t\t\t}\n\n\t\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t\t{\n\t\t\t\treturn _subject.Subscribe(observer);\n\t\t\t}\n\n\t\t\tpublic T Value\n\t\t\t{\n\t\t\t\tget { return _subject.Value; }\n\t\t\t}\n\n\t\t\tpublic IObservable<bool> IsReadOnly\n\t\t\t{\n\t\t\t\tget { return _isReadOnly; }\n\t\t\t}\n\n\t\t\tpublic void Write(T value, bool save)\n\t\t\t{\n\t\t\t\t_subject.OnNext(value);\n\t\t\t\tif (save)\n\t\t\t\t\t_invalidate.ExecuteOnce();\n\t\t\t}\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Brush.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ToBrushExtension\n\t{\n\t\tpublic static Brush AsBrush(this IObservable<Color> color)\n\t\t{\n\t\t\treturn new Brush(color.Replay(1).RefCount());\n\t\t}\n\n\t\tpublic static Brush Switch(this IObservable<Brush> brush)\n\t\t{\n\t\t\treturn new Brush(brush.Select(b => (IObservable<Color>)b).Switch().Replay(1).RefCount());\n\t\t}\n\t}\n\n\tpublic struct Brush : IObservable<Color>\n\t{\n\t\tpublic static Brush operator |(Brush left, Brush right)\n\t\t{\n\t\t\treturn left.IsDefault ? right : left;\n\t\t}\n\n\t\tpublic static implicit operator Brush(Color color)\n\t\t{\n\t\t\treturn new Brush(Observable.Return(color));\n\t\t}\n\n\t\tpublic static Brush Transparent\n\t\t{\n\t\t\tget { return new Brush(null); }\n\t\t}\n\n\t\treadonly IObservable<Color> _color;\n\n\t\tinternal Brush(IObservable<Color> color)\n\t\t{\n\t\t\t_color = color;\n\t\t}\n\n\t\tpublic bool IsDefault\n\t\t{\n\t\t\tget { return _color == null; }\n\t\t}\n\n\t\tpublic Brush Mix(Brush other, IObservable<double> amount)\n\t\t{\n\t\t\treturn this.CombineLatest(other, amount, (a, b, v) => a.Mix(b, (float)v)).AsBrush();\n\t\t}\n\n\t\tpublic Brush WithAlpha(float alpha)\n\t\t{\n\t\t\tif (IsDefault)\n\t\t\t\treturn default(Brush);\n\n\t\t\treturn _color.Select(c => c.WithAlpha(a: alpha)).AsBrush();\n\t\t}\n\n\t\tpublic Brush WithAlpha(IObservable<float> alpha)\n\t\t{\n\t\t\tif (IsDefault)\n\t\t\t\treturn default(Brush);\n\n\t\t\treturn _color.CombineLatest(alpha, (c, a) => c.WithAlpha(a: a)).AsBrush();\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<Color> observer)\n\t\t{\n\t\t\tif (_color == null)\n\t\t\t{\n\t\t\t\tobserver.OnNext(Color.Transparent);\n\t\t\t\tobserver.OnCompleted();\n\t\t\t\treturn Disposable.Empty;\n\t\t\t}\n\n\t\t\treturn _color.Subscribe(observer);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Clipping.cs",
    "content": "using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Clipping\n\t{\n\t\tstatic Func<IControl,bool, IControl> _clip = (c, b) => c;\n\n\t\tpublic static void Initialize(Func<IControl, bool, IControl> clip)\n\t\t{\n\t\t\t_clip = clip;\n\t\t}\n\n\t\tpublic static IControl Clip(this IControl control)\n\t\t{\n\t\t\treturn _clip(control, true);\n\t\t}\n\n\t\tpublic static IControl Overflow(this IControl control)\n\t\t{\n\t\t\treturn _clip(control, false);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Color.cs",
    "content": "using System;\nusing System.Globalization;\n\nnamespace Outracks.Fusion\n{\n\tpublic sealed class Color : IEquatable<Color>\n\t{\n\t\tpublic static readonly Color AlmostTransparent = new Color(0, 0, 0, 1/255.0f);\n\t\tpublic static readonly Color Transparent = new Color(0, 0, 0, 0);\n\t\tpublic static readonly Color Black = new Color(0, 0, 0, 1);\n\t\tpublic static readonly Color White = new Color(1, 1, 1, 1);\n\n\t\tpublic bool IsTransparent\n\t\t{\n\t\t\tget { return ReferenceEquals(this, Transparent) || Math.Abs(A) < float.Epsilon; }\n\t\t}\n\n\t\tpublic readonly float R;\n\t\tpublic readonly float G;\n\t\tpublic readonly float B;\n\t\tpublic readonly float A;\n\n\t\tpublic static Color FromBytes(int r, int g, int b, int a = 255)\n\t\t{\n\t\t\treturn new Color(r / 255.0f, g / 255.0f, b /255.0f, a / 255.0f);\n\t\t}\n\n\t\tpublic static Color FromRgb(int rgb)\n\t\t{\n\t\t\tvar rgba = (rgb << 8) | 0xff;\n\t\t\treturn FromRgba((uint)rgba);\n\t\t}\n\n\t\tpublic static Color FromRgba(uint rgba)\n\t\t{\n\t\t\tvar r = (rgba >> 24) & 0xff;\n\t\t\tvar g = (rgba >> 16) & 0xff;\n\t\t\tvar b = (rgba >> 8) & 0xff;\n\t\t\tvar a = rgba & 0xff;\n\t\t\treturn FromBytes((int)r, (int)g, (int)b, (int)a);\n\t\t}\n\n\t\tpublic Color(float r, float g, float b, float a)\n\t\t{\n\t\t\tR = r;\n\t\t\tG = g;\n\t\t\tB = b;\n\t\t\tA = a;\n\t\t}\n\n\t\tpublic bool Equals(Color other)\n\t\t{\n\t\t\treturn R.Equals(other.R) && G.Equals(other.G) && A.Equals(other.A) && B.Equals(other.B);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Color && Equals((Color)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tvar hashCode = R.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ G.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ A.GetHashCode();\n\t\t\t\thashCode = (hashCode * 397) ^ B.GetHashCode();\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(Color left, Color right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Color left, Color right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{\" + R.ToString(CultureInfo.InvariantCulture) + \", \" + G.ToString(CultureInfo.InvariantCulture) + \", \" + B.ToString(CultureInfo.InvariantCulture) + \", \" + A.ToString(CultureInfo.InvariantCulture) + \"}\";\n\t\t}\n\n\t\tpublic Color WithAlpha(float a)\n\t\t{\n\t\t\treturn new Color(R, G, B, a);\n\t\t}\n\n\t\tpublic Color Mix(Color other, float amount)\n\t\t{\n\t\t\treturn new Color(\n\t\t\t\tR + (other.R - R) * amount,\n\t\t\t\tG + (other.G - G) * amount,\n\t\t\t\tB + (other.B - B) * amount,\n\t\t\t\tA + (other.A - A) * amount);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Command.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Commands\n\t{\n\t\tpublic static Command Then(this Command first, Command next)\n\t\t{\n\t\t\treturn Command.Create(first.Action.CombineLatest(next.Action, (o1, o2) =>\n\t\t\t{\n\t\t\t\treturn Optional.Combine(o1, o2, (a1, a2) => a1 + a2);\n\t\t\t}));\n\t\t}\n\n\t\tpublic static Command Switch(this IObservable<Command> self)\n\t\t{\n\t\t\treturn Command.Create(self.Switch(cmd => cmd.Action));\n\t\t}\n\n\t\tpublic static Command Switch<T>(this IObservable<T> self, Func<T, Command> f)\n\t\t{\n\t\t\treturn Command.Create(self.Switch(t => f(t).Action));\n\t\t}\n\n\t\tpublic static Command SelectMany<T>(this IObservable<T> self, Func<T, Command> f)\n\t\t{\n\t\t\treturn Command.Create(self.SelectMany(t => f(t).Action));\n\t\t}\n\n\t\tpublic static async Task ExecuteOnceAsync(this Command self)\n\t\t{\n\t\t\t(await self.Execute.FirstAsync())();\n\t\t}\n\n\t\tpublic static IObservable<bool> DoExecuteOnce(this Command self)\n\t\t{\n\t\t\treturn self.Action.Take(1).Do(e => e.Do(f => f())).Select(e => e.HasValue);\n\t\t}\n\n\t\tpublic static IDisposable ExecuteOnce(this Command self)\n\t\t{\n\t\t\treturn self.Execute.Take(1).Subscribe(e => e());\n\t\t}\n\t}\n\n\tpublic struct Command : IEquatable<Command>\n\t{\n\t\tpublic static Command Create(bool isEnabled, Action action = null)\n\t\t{\n\t\t\treturn isEnabled\n\t\t\t\t? Enabled(action)\n\t\t\t\t: Disabled;\n\t\t}\n\n\t\tpublic static Command Create(IObservable<bool> isEnabled, Action action = null)\n\t\t{\n\t\t\taction = action ?? _noop;\n\t\t\treturn Create(isEnabled.Select(b => b ? Optional.Some(action) : Optional.None()));\n\t\t}\n\n\t\tpublic static Command Create(IObservable<bool> isEnabled, IObservable<Action> action)\n\t\t{\n\t\t\treturn Create(isEnabled.CombineLatest(\n\t\t\t\taction,\n\t\t\t\t(enabled, act) => enabled ? Optional.Some(act) : Optional.None()));\n\t\t}\n\n\t\tpublic static Command Create(IObservable<Optional<Action>> action)\n\t\t{\n\t\t\treturn new Command(action);\n\t\t}\n\n\t\tpublic static Command Enabled(Action action = null)\n\t\t{\n\t\t\treturn action == null ? _enabledNoop : new Command(Observable.Return(Optional.Some(action)));\n\t\t}\n\n\t\tpublic static Command Enabled(IObservable<Action> action)\n\t\t{\n\t\t\treturn new Command(action.Select(Optional.Some));\n\t\t}\n\n\t\tpublic override bool Equals(object o)\n\t\t{\n\t\t\treturn o is Command && Equals((Command)o);\n\t\t}\n\n\t\tpublic bool Equals(Command other)\n\t\t{\n\t\t\treturn _action == other._action;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Action.GetHashCode();\n\t\t}\n\n\t\tpublic static bool operator ==(Command lhs, Command rhs)\n\t\t{\n\t\t\treturn lhs.Equals(rhs);\n\t\t}\n\n\t\tpublic static bool operator !=(Command lhs, Command rhs)\n\t\t{\n\t\t\treturn !lhs.Equals(rhs);\n\t\t}\n\n\t\tCommand(IObservable<Optional<Action>> action)\n\t\t{\n\t\t\t_action = action;\n\t\t}\n\n\t\treadonly IObservable<Optional<Action>> _action;\n\n\t\tpublic IObservable<Optional<Action>> Action\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _action ?? _disabled;\n\t\t\t}\n\t\t}\n\n\t\tpublic IObservable<Action> Execute\n\t\t{\n\t\t\tget { return Action.Select(o => o.Or(_noop)); }\n\t\t}\n\n\t\tpublic IObservable<bool> IsEnabled\n\t\t{\n\t\t\tget { return Action.Select(o => o.HasValue); }\n\t\t}\n\n\t\tstatic Command()\n\t\t{\n\t\t\t_noop = () => { };\n\t\t\t_enabledNoop = Create(Observable.Return(Optional.Some(_noop)));\n\t\t\t_disabled = Observable.Return(Optional.None<Action>());\n\t\t}\n\n\t\tpublic static Command Disabled\n\t\t{\n\t\t\tget { return new Command(); }\n\t\t}\n\n\t\tstatic readonly Action _noop;\n\t\tstatic readonly Command _enabledNoop;\n\t\tstatic readonly IObservable<Optional<Action>> _disabled;\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ContextMenu.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ContextMenu\n\t{\n\t\tpublic static IControl SetContextMenu(this IControl control, Optional<Menu> menu)\n\t\t{\n\t\t\treturn Implementation.Set(control, menu);\n\t\t}\n\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IControl, Optional<Menu>, IControl> Set;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Control.Bind.cs",
    "content": "using System;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Control\n\t{\n\t\tpublic static IControl BindAvailableSize(Func<Size<IObservable<Points>>, IControl> content)\n\t\t{\n\t\t\treturn Bind(self => content(self.AvailableSize));\n\t\t}\n\n\t\tpublic static IControl BindNativeFrame(Func<Rectangle<IObservable<Points>>, IControl> content)\n\t\t{\n\t\t\treturn Bind(self => content(self.NativeFrame));\n\t\t}\n\n\t\tpublic static IControl Bind(Func<IMountLocation, IControl> content)\n\t\t{\n\t\t\treturn new BindControl(content);\n\t\t}\n\t}\n\n\tclass BindControl : IControl\n\t{\n\t\treadonly BehaviorSubject<IMountLocation> _location = new BehaviorSubject<IMountLocation>(MountLocation.Unmounted);\n\t\treadonly IControl _control;\n\n\t\tpublic BindControl(Func<IMountLocation, IControl> content)\n\t\t{\n\t\t\t_control = content(_location.Switch());\n\t\t}\n\n\t\tpublic Action<IMountLocation> Mount\n\t\t{\n\t\t\tget { return _location.OnNext + _control.Mount; }\n\t\t}\n\n\t\tpublic Size<IObservable<Points>> DesiredSize\n\t\t{\n\t\t\tget { return _control.DesiredSize; }\n\t\t}\n\n\t\tpublic object NativeHandle\n\t\t{\n\t\t\tget { return _control.NativeHandle; }\n\t\t}\n\n\t\tpublic IObservable<bool> IsRooted\n\t\t{\n\t\t\tget { return _control.IsRooted; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Control.Empty.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Control\n\t{\n\t\tpublic static readonly IControl Empty = new EmptyControl();\n\t}\n\n\tclass EmptyControl : IControl\n\t{\n\t\tpublic Action<IMountLocation> Mount\n\t\t{\n\t\t\tget { return _ => { }; }\n\t\t}\n\n\t\tpublic IObservable<bool> IsRooted\n\t\t{\n\t\t\tget { return Observable.Return(false); }\n\t\t}\n\n\t\tpublic Size<IObservable<Points>> DesiredSize\n\t\t{\n\t\t\tget { return ObservableMath.ZeroSize; }\n\t\t}\n\n\t\tpublic object NativeHandle\n\t\t{\n\t\t\tget { return null; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Control.Lazy.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Control\n\t{\n\t\tpublic static IControl Lazy(Func<IControl> content)\n\t\t{\n\t\t\tvar resultObs = new BehaviorSubject<IControl>(Empty);\n\t\t\tvar result = resultObs.Switch();\n\n\t\t\tresult\n\t\t\t\t.IsRooted\n\t\t\t\t.Where(b => b)\n\t\t\t\t.Take(1)\n\t\t\t\t.Subscribe(_ => resultObs.OnNext(content()));\n\n\t\t\treturn result;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Control.WithFrame.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Control\n\t{\n\t\tpublic static IControl WithFrame(this IControl control, Rectangle<Points> frame, Size<IObservable<Points>>? availableSize = null)\n\t\t{\n\t\t\treturn control.WithFrame(Observable.Return(frame).Transpose(), availableSize);\n\t\t}\n\n\t\tpublic static IControl WithFrame(\n\t\t\tthis IControl control,\n\t\t\tRectangle<IObservable<Points>> frame,\n\t\t\tSize<IObservable<Points>>? availableSize = null)\n\t\t{\n\t\t\treturn control.WithFrame(_ => frame.MoveTo(_.Position), _ => availableSize ?? _);\n\t\t}\n\n\t\tpublic static IControl WithFrame(\n\t\t\tthis IControl control,\n\t\t\tFunc<Rectangle<IObservable<Points>>, Rectangle<IObservable<Points>>> frame,\n\t\t\tFunc<Size<IObservable<Points>>, Size<IObservable<Points>>> availableSize = null)\n\t\t{\n\t\t\treturn control.WithMountLocation(prev =>\n\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t{\n\t\t\t\t\tIsRooted = prev.IsRooted,\n\t\t\t\t\tNativeFrame = frame(prev.NativeFrame),\n\t\t\t\t\tAvailableSize = availableSize != null\n\t\t\t\t\t\t? availableSize(prev.AvailableSize)\n\t\t\t\t\t\t: prev.AvailableSize,\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IControl WithMountLocation(\n\t\t\tthis IControl control,\n\t\t\tFunc<IMountLocation, IMountLocation> transform)\n\t\t{\n\t\t\treturn new ControlWithMountLocation(control, transform);\n\t\t}\n\t}\n\n\tclass ControlWithMountLocation : IControl\n\t{\n\t\treadonly IControl _control;\n\t\treadonly Func<IMountLocation, IMountLocation> _transform;\n\n\t\tpublic ControlWithMountLocation(IControl control, Func<IMountLocation, IMountLocation> transform)\n\t\t{\n\t\t\t_control = control;\n\t\t\t_transform = transform;\n\t\t}\n\n\t\tpublic Action<IMountLocation> Mount\n\t\t{\n\t\t\tget { return location => _control.Mount(_transform(location)); }\n\t\t}\n\n\t\tpublic Size<IObservable<Points>> DesiredSize\n\t\t{\n\t\t\tget { return _control.DesiredSize; }\n\t\t}\n\n\t\tpublic object NativeHandle\n\t\t{\n\t\t\tget { return _control.NativeHandle; }\n\t\t}\n\n\t\tpublic IObservable<bool> IsRooted\n\t\t{\n\t\t\tget { return _control.IsRooted; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Control.WithSize.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Control\n\t{\n\t\t// Override width\n\n\t\tpublic static IControl WithWidth(this IControl control, Points width)\n\t\t{\n\t\t\treturn control.WithWidth(Observable.Return(width));\n\t\t}\n\t\tpublic static IControl WithWidth(this IControl control, Func<IControl, IObservable<Points>> width)\n\t\t{\n\t\t\treturn control.WithWidth(width(control));\n\t\t}\n\t\tpublic static IControl WithWidth(this IControl control, IObservable<Points> width)\n\t\t{\n\t\t\treturn control.WithDimension(Axis2D.Horizontal, width);\n\t\t}\n\n\n\t\t// Override height\n\n\t\tpublic static IControl WithHeight(this IControl control, Points height)\n\t\t{\n\t\t\treturn control.WithHeight(Observable.Return(height));\n\t\t}\n\n\t\tpublic static IControl WithHeight(this IControl control, Func<IControl, IObservable<Points>> height)\n\t\t{\n\t\t\treturn control.WithHeight(height(control));\n\t\t}\n\n\t\tpublic static IControl WithHeight(this IControl control, IObservable<Points> height)\n\t\t{\n\t\t\treturn control.WithDimension(Axis2D.Vertical, height);\n\t\t}\n\n\n\t\t// Override dimension\n\n\t\tpublic static IControl WithDimension(this IControl control, Axis2D axis, Func<IControl, IObservable<Points>> size)\n\t\t{\n\t\t\treturn control.WithDimension(axis, size(control));\n\t\t}\n\n\t\tpublic static IControl WithDimension(this IControl control, Axis2D axis, IObservable<Points> size)\n\t\t{\n\t\t\treturn control.WithSize(control.DesiredSize.WithAxis(axis, _ => size));\n\t\t}\n\n\t\t// Override size\n\n\t\tpublic static IControl WithSize(this IControl control, Size<Points> size)\n\t\t{\n\t\t\treturn control.WithSize(\n\t\t\t\tSize.Create(\n\t\t\t\t\tObservable.Return(size.Width),\n\t\t\t\t\tObservable.Return(size.Height)));\n\t\t}\n\n\t\tpublic static IControl WithSize(this IControl control, Size<IObservable<Points>> desiredSize)\n\t\t{\n\t\t\treturn new ControlWithSize(control, desiredSize);\n\t\t}\n\t}\n\n\tclass ControlWithSize : IControl\n\t{\n\t\treadonly IControl _control;\n\n\t\tpublic ControlWithSize(IControl control, Size<IObservable<Points>> desiredSize)\n\t\t{\n\t\t\t_control = control;\n\t\t\tDesiredSize = desiredSize;\n\t\t}\n\n\t\tpublic Action<IMountLocation> Mount\n\t\t{\n\t\t\tget { return _control.Mount; }\n\t\t}\n\n\t\tpublic Size<IObservable<Points>> DesiredSize\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic object NativeHandle\n\t\t{\n\t\t\tget { return _control.NativeHandle; }\n\t\t}\n\n\t\tpublic IObservable<bool> IsRooted\n\t\t{\n\t\t\tget { return _control.IsRooted; }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Control.cs",
    "content": "using System;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\t/// <summary>\n\t/// A control represents a rectangular area on the screen where user interaction happens.\n\t/// Controls are typically composed in a tree, where each parent control fully encapsulate its children.\n\t/// All non-empty controls can typically only have one parent at any given time.\n\t///\n\t/// This interface is meant for consuption by the direct parent/owner of the control it encapsulates,\n\t/// all control-specific parameters and callbacks should be passed in to the control during creation.\n\t/// </summary>\n\t/// <remarks>\n\t/// IControl implementations should _only_ observe their respective external data sources while rooted.\n\t/// Failure to do this results in memory leaks and bad performance over time because the data sources are\n\t/// updating unreachable controls that are only kept alive by said subscriptions.\n\t/// The data sources always have equal or longer life-time than the controls observing them.\n\t/// </remarks>\n\tpublic interface IControl\n\t{\n\t\t/// <summary>\n\t\t/// The act of making a control part of a bigger hierarchy is called \"mounting\".\n\t\t/// When a control is part of a window's control hierarchy it is said to be \"rooted\".\n\t\t///\n\t\t/// The parent control is responsible for invoking the Mount delegate of its children, passing down the\n\t\t/// information needed for them to do local layout and knowing when they are rooted (for subscription management)\n\t\t/// </summary>\n\t\tAction<IMountLocation> Mount { get; }\n\n\t\t/// <summary>\n\t\t/// Desired size is expressed in terms of available size, passed to Mount as part of IMountLocation.\n\t\t/// </summary>\n\t\tSize<IObservable<Points>> DesiredSize { get; }\n\n\t\t/// <summary>\n\t\t/// The underlying native control where you'll find the contents of this IControl\n\t\t/// Needs to be accessed on the main thread\n\t\t/// </summary>\n\t\tobject NativeHandle { get; }\n\n\t\tIObservable<bool> IsRooted { get; }\n\t}\n\n\tpublic static partial class Control\n\t{\n\t\tpublic static IControl Create(Func<IMountLocation, object> factory)\n\t\t{\n\t\t\treturn new NativeControl(factory);\n\t\t}\n\t}\n\n\tclass NativeControl : IControl\n\t{\n\t\treadonly ISubject<IMountLocation> _mountLocation = new ReplaySubject<IMountLocation>(1);\n\t\treadonly IMountLocation _currentMountLocation;\n\t\treadonly Func<IMountLocation, object> _factory;\n\n\t\tobject _nativeHandle;\n\n\t\tpublic NativeControl(Func<IMountLocation, object> factory)\n\t\t{\n\t\t\t_factory = factory;\n\t\t\t_currentMountLocation = _mountLocation.Switch();\n\t\t}\n\n\t\tpublic Action<IMountLocation> Mount\n\t\t{\n\t\t\tget { return _mountLocation.OnNext; }\n\t\t}\n\n\t\tpublic Size<IObservable<Points>> DesiredSize\n\t\t{\n\t\t\tget { return ObservableMath.ZeroSize; }\n\t\t}\n\n\t\tpublic object NativeHandle\n\t\t{\n\t\t\tget { return _nativeHandle ?? (_nativeHandle = _factory(_currentMountLocation)); }\n\t\t}\n\n\t\tpublic IObservable<bool> IsRooted\n\t\t{\n\t\t\tget { return _currentMountLocation.IsRooted; }\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/fusion/core/Controls/Button.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic class ButtonStates\n\t{\n\t\tpublic static ButtonStates Unrooted = new ButtonStates(Observable.Return(false), Observable.Return(false), Observable.Return(false));\n\n\t\tpublic readonly IObservable<bool> IsPressed;\n\t\tpublic readonly IObservable<bool> IsHovered;\n\t\tpublic readonly IObservable<bool> IsEnabled;\n\n\t\tpublic ButtonStates(IObservable<bool> isPressed, IObservable<bool> isHovered, IObservable<bool> isEnabled)\n\t\t{\n\t\t\tIsPressed = isPressed;\n\t\t\tIsHovered = isHovered;\n\t\t\tIsEnabled = isEnabled;\n\t\t}\n\t}\n\n\tpublic static class Button\n\t{\n\t\tpublic static ButtonStates Switch(this IObservable<ButtonStates> states)\n\t\t{\n\t\t\treturn new ButtonStates(\n\t\t\t\tstates.Select(s => s.IsPressed).Switch(),\n\t\t\t\tstates.Select(s => s.IsHovered).Switch(),\n\t\t\t\tstates.Select(s => s.IsEnabled).Switch());\n\t\t}\n\n\t\tpublic static IControl Create(\n\t\t\tCommand clicked = default(Command),\n\t\t\tFunc<ButtonStates, IControl> content = null,\n\t\t\tText text = default(Text),\n\t\t\tText toolTip = default(Text),\n\t\t\tbool isDefault = false)\n\t\t{\n\t\t\treturn Implementation.Factory(clicked, content, text, isDefault).SetToolTip(toolTip);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<Command, Func<ButtonStates, IControl>, Text, bool, IControl> Factory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/CachedImageBase.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic abstract class CachedImageBase : IImage\n\t{\n\t\treadonly ConcurrentDictionary<CacheKey, object> _cache = new ConcurrentDictionary<CacheKey, object>(1, 1);\n\n\t\t#region Cache key\n\t\tstruct CacheKey\n\t\t{\n\t\t\treadonly Type _platformImageType;\n\t\t\treadonly Optional<IColorMap> _colorMap;\n\t\t\treadonly Ratio<Pixels, Points> _scaleFactor;\n\n\t\t\tpublic CacheKey(Type platformImageType, Optional<IColorMap> colorMap, Ratio<Pixels, Points> scaleFactor) : this()\n\t\t\t{\n\t\t\t\t_platformImageType = platformImageType;\n\t\t\t\t_colorMap = colorMap;\n\t\t\t\t_scaleFactor = scaleFactor;\n\t\t\t}\n\n\t\t\tpublic override bool Equals(object obj)\n\t\t\t{\n\t\t\t\tif (!(obj is CacheKey))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar key = (CacheKey)obj;\n\t\t\t\treturn EqualityComparer<Type>.Default.Equals(_platformImageType, key._platformImageType) &&\n\t\t\t\t\t   EqualityComparer<Optional<IColorMap>>.Default.Equals(_colorMap, key._colorMap) &&\n\t\t\t\t\t   _scaleFactor.Equals(key._scaleFactor);\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode()\n\t\t\t{\n\t\t\t\tvar hashCode = 2127219917;\n\t\t\t\thashCode = hashCode * -1521134295 + base.GetHashCode();\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<Type>.Default.GetHashCode(_platformImageType);\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<Optional<IColorMap>>.Default.GetHashCode(_colorMap);\n\t\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<Ratio<Pixels, Points>>.Default.GetHashCode(_scaleFactor);\n\t\t\t\treturn hashCode;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic ImageVersion<T> Load<T>(Ratio<Pixels, Points> optimalScaleFactor = default(Ratio<Pixels, Points>), Optional<IColorMap> colorMap = default(Optional<IColorMap>), bool cache = true)\n\t\t{\n\t\t\toptimalScaleFactor = optimalScaleFactor.Value == default(double) ? new Ratio<Pixels, Points>(1) : optimalScaleFactor;\n\n\t\t\tif (!cache || typeof(T) == typeof(Stream))\n\t\t\t{\n\t\t\t\tRatio<Pixels, Points> imageScaleRatio;\n\t\t\t\tvar image = OnLoad<T>(optimalScaleFactor, colorMap, out imageScaleRatio);\n\t\t\t\treturn new ImageVersion<T>(imageScaleRatio, image);\n\t\t\t}\n\n\t\t\tvar cacheKey = new CacheKey(typeof(T), colorMap, optimalScaleFactor);\n\t\t\treturn (ImageVersion<T>)_cache.GetOrAdd(cacheKey, _ => Load<T>(optimalScaleFactor, colorMap, cache: false));\n\t\t}\n\n\t\tT OnLoad<T>(Ratio<Pixels, Points> optimalScaleFactor, Optional<IColorMap> colorMap, out Ratio<Pixels, Points> imageScaleFactor)\n\t\t{\n\t\t\t// For testing purposes\n\t\t\tif (typeof(T) == typeof(Stream))\n\t\t\t{\n\t\t\t\treturn (T)(object)OnCreatePngStream(optimalScaleFactor, colorMap, out imageScaleFactor);\n\t\t\t}\n\n\t\t\tvar fromStream = Image.Implementation.Loader<T>.FromStream;\n\n\t\t\tif (fromStream == null)\n\t\t\t\tthrow new InvalidOperationException(\"Image loader for \" + typeof(T).FullName + \" is not registered\");\n\n\t\t\tusing (Stream stream = OnCreatePngStream(optimalScaleFactor, colorMap, out imageScaleFactor))\n\t\t\t{\n\t\t\t\treturn fromStream(stream);\n\t\t\t}\n\t\t}\n\n\t\tprotected abstract Stream OnCreatePngStream(Ratio<Pixels, Points> scaleFactor, Optional<IColorMap> colorMap, out Ratio<Pixels, Points> imageScaleFactor);\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/ColorPicker.cs",
    "content": "using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ColorPicker\n\t{\n\t\tpublic static Command Open(IProperty<Color> value)\n\t\t{\n\t\t\treturn Implementation.OpenCommand(value);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IProperty<Color>, Command> OpenCommand;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/DropDown.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class DropDown\n\t{\n\t\tpublic static IControl Create<T>(IProperty<T> selection = null, IObservable<IEnumerable<T>> values = null, bool nativeLook = true)\n\t\t{\n\t\t\tselection = selection ?? Property.Create(default(T));\n\t\t\tvalues = values ?? Observable.Return(Enumerable.Empty<T>());\n\t\t\treturn Create(\n\t\t\t\tselection.Convert(\n\t\t\t\t\tconvert: v => (object)v,\n\t\t\t\t\tconvertBack: v => (T)v),\n\t\t\t\tvalues.SelectPerElement(v => (object)v),\n\t\t\t\tnativeLook);\n\t\t}\n\n\t\tpublic static IControl Create(IProperty<object> selection = null, IObservable<IEnumerable<object>> values = null, bool nativeLook = true)\n\t\t{\n\t\t\treturn Implementation.Factory(\n\t\t\t\tselection ?? Property.Create(new object()),\n\t\t\t\tvalues ?? Observable.Return(Enumerable.Empty<object>()),\n\t\t\t\tnativeLook);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IProperty<object>, IObservable<IEnumerable<object>>, bool, IControl> Factory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/IColorMap.cs",
    "content": "namespace Outracks.Fusion\n{\n\tpublic interface IColorMap\n\t{\n\t\tColor Map(Color color);\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/IImage.cs",
    "content": "namespace Outracks.Fusion\n{\n\tpublic class ImageVersion<T>\n\t{\n\t\tpublic ImageVersion(Ratio<Pixels, Points> scaleFactor, T image)\n\t\t{\n\t\t\tScaleFactor = scaleFactor;\n\t\t\tImage = image;\n\t\t}\n\n\t\tpublic Ratio<Pixels, Points> ScaleFactor { get; private set; }\n\t\tpublic T Image { get; private set; }\n\t}\n\n\tpublic interface IImage\n\t{\n\t\t/// <summary>\n\t\t/// Loads an appropriate version of the image using scaleFactor and colorMap\n\t\t/// </summary>\n\t\tImageVersion<T> Load<T>(\n\t\t\tRatio<Pixels, Points> optimalScaleFactor = default(Ratio<Pixels, Points>),\n\t\t\tOptional<IColorMap> colorMap = default(Optional<IColorMap>),\n\t\t\tbool cache = true);\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/Image.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Drawing.Imaging;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Reactive.Linq;\nusing System.Reflection;\nusing System.Text.RegularExpressions;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Image\n\t{\n\t\tstatic readonly ConcurrentDictionary<string, IImage> _imageCache = new ConcurrentDictionary<string, IImage>();\n\t\tstatic readonly ConcurrentDictionary<Assembly, ImmutableHashSet<string>> _resourceCaches = new ConcurrentDictionary<Assembly, ImmutableHashSet<string>>();\n\n\t\tstatic Optional<Func<Stream>> GetResource(string resourceName, Assembly assembly)\n\t\t{\n\t\t\tvar resourceNames = _resourceCaches.GetOrAdd(assembly, a => a.GetManifestResourceNames().ToImmutableHashSet());\n\t\t\tif (!resourceNames.Contains(resourceName))\n\t\t\t\treturn Optional.None();\n\n\t\t\treturn Optional.Some<Func<Stream>>(() => assembly.GetManifestResourceStream(resourceName));\n\t\t}\n\n\t\tstatic Optional<ImageStream> GetImageStreamFromResource(string resourceName, Assembly assembly, int scaleFactor)\n\t\t{\n\t\t\treturn GetResource(resourceName, assembly).Select(s => new ImageStream(scaleFactor, s));\n\t\t}\n\n\t\tpublic static bool HasResource(string resourceName, Assembly assembly)\n\t\t{\n\t\t\treturn GetImageStreamFromResource(resourceName, assembly, 1).HasValue;\n\t\t}\n\n\t\tpublic static IControl FromImage(IObservable<IImage> image, IObservable<IColorMap> colorMap = null, IObservable<Ratio<Pixels, Points>> dpiOverride = null)\n\t\t{\n\t\t\treturn Implementation.Factory(\n\t\t\t\timage,\n\t\t\t\tOptional.None(),\n\t\t\t\tcolorMap.ToOptional(),\n\t\t\t\tdpiOverride.ToOptional());\n\t\t}\n\n\t\tpublic static IImage GetImageFromResource(string resourceName, Assembly assembly)\n\t\t{\n\t\t\treturn _imageCache.GetOrAdd(\n\t\t\t\tstring.Format(\"{0}%{1}\", assembly.FullName, resourceName),\n\t\t\t\t_ =>\n\t\t\t\t{\n\t\t\t\t\tif (resourceName.EndsWith(\".svg\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar resourceStreamFactory = GetResource(resourceName, assembly);\n\t\t\t\t\t\tif (!resourceStreamFactory.HasValue)\n\t\t\t\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\t\t\t\"Resource '\" + resourceName + \"' not found in assembly \" + assembly.GetName().FullName);\n\n\t\t\t\t\t\treturn new SvgImage(resourceStreamFactory.Value);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar streams = new List<ImageStream>();\n\t\t\t\t\tGetImageStreamFromResource(resourceName, assembly, 1).Do(streams.Add);\n\t\t\t\t\tvar highDpiImageName = Path.GetFileNameWithoutExtension(resourceName) + \"@2x.png\";\n\t\t\t\t\tGetImageStreamFromResource(highDpiImageName, assembly, 2).Do(streams.Add);\n\n\t\t\t\t\tif (streams.IsEmpty())\n\t\t\t\t\t\tthrow new ArgumentException(\n\t\t\t\t\t\t\t\"Resource '\" + resourceName + \"' or with postfix ('@2x') not found in assembly \" + assembly.GetName().FullName);\n\t\t\t\t\treturn new MultiResolutionImage(streams);\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IControl FromResource(string resourceName, Assembly assembly, IObservable<Color> overlayColor = null, IObservable<IColorMap> colorMap = null)\n\t\t{\n\t\t\treturn Implementation.Factory(Observable.Return(GetImageFromResource(resourceName, assembly)), overlayColor.ToOptional(), colorMap.ToOptional(), Optional.None());\n\t\t}\n\n\t\tclass AnimationImageNameComparer : IComparer<string>\n\t\t{\n\t\t\treadonly string filenamePattern = @\"^(?<prefix>.*?)(?<number>\\d+)(?<suffix>\\D*)$\";\n\t\t\tpublic int Compare(string x, string y)\n\t\t\t{\n\t\t\t\tif (x == y) return 0;\n\t\t\t\tvar xMatch = Regex.Match(x, filenamePattern);\n\t\t\t\tvar yMatch = Regex.Match(y, filenamePattern);\n\t\t\t\tvar prefix = Comparer<string>.Default.Compare(\n\t\t\t\t\txMatch.Groups[\"prefix\"].Value,\n\t\t\t\t\tyMatch.Groups[\"prefix\"].Value);\n\t\t\t\tif (prefix != 0) return prefix;\n\t\t\t\tvar number = Comparer<int>.Default.Compare(\n\t\t\t\t\tint.Parse(xMatch.Groups[\"number\"].Value),\n\t\t\t\t\tint.Parse(yMatch.Groups[\"number\"].Value));\n\t\t\t\tif (number != 0) return number;\n\t\t\t\treturn Comparer<string>.Default.Compare(\n\t\t\t\t\txMatch.Groups[\"suffix\"].Value,\n\t\t\t\t\tyMatch.Groups[\"suffix\"].Value);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t///\t\tGathers all images under the given resource directory and plays them over the given duration.\n\t\t///\t\tAssumes that images are named on the form Foo-1.png, Foo-2.png, ...., Foo-n.png\n\t\t///\t\t<todo>Probably need some more error handling. </todo>\n\t\t/// </summary>\n\t\t/// <param name=\"resourceDirectoryName\">Where to look for images</param>\n\t\t/// <param name=\"assembly\">Assembly to find the embeded images resources</param>\n\t\t/// <param name=\"duration\">How long one loop lasts</param>\n\t\t/// <param name=\"overlayColor\">Tint all images with the provided color.</param>\n\t\t/// <returns></returns>\n\t\tpublic static IControl Animation(string resourceDirectoryName, Assembly assembly, TimeSpan duration, IObservable<Color> overlayColor = null)\n\t\t{\n\t\t\tvar resourceCache = _resourceCaches.GetOrAdd(assembly, a => a.GetManifestResourceNames().ToImmutableHashSet());\n\t\t\tvar resources = resourceCache\n\t\t\t\t.Where(k => k.Contains(resourceDirectoryName))\n\t\t\t\t.ToImmutableSortedSet(new AnimationImageNameComparer())\n\t\t\t\t.Select(resource => new ImageStream(scaleFactor: 1, create: () => assembly.GetManifestResourceStream(resource)))\n\t\t\t\t.ToList();\n\t\t\treturn Implementation.Animate(resources, duration, overlayColor);\n\t\t}\n\n\n\t\tpublic static Optional<IControl> FromUrl(Uri url, IObservable<Color> tint = null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbyte[] imageData;\n\n\t\t\t\tusing (var wc = new WebClient())\n\t\t\t\t\timageData = wc.DownloadData(url);\n\t\t\t\tvar imageStream = new ImageStream(scaleFactor: 1, create: () => new MemoryStream(imageData));\n\n\t\t\t\treturn Optional.Some(Implementation.Factory(\n\t\t\t\t\tObservable.Return<IImage>(new MultiResolutionImage(new[] { imageStream })),\n\t\t\t\t\ttint.ToOptional(),\n\t\t\t\t\tOptional.None(),\n\t\t\t\t\tOptional.None()));\n\t\t\t}\n\t\t\tcatch (WebException)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"Failed to download \" + url);\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic static IControl FromBitmaps(System.Drawing.Image[] bitmaps, IObservable<Color> tint = null)\n\t\t{\n\t\t\tvar streams = bitmaps\n\t\t\t\t.Select((bitmap, index) =>\n\t\t\t\t\tnew ImageStream(scaleFactor: new Ratio<Pixels, Points>(index), create: bitmap.CreatePngStreamFromBitmap));\n\n\t\t\treturn Implementation.Factory(\n\t\t\t\tObservable.Return<IImage>(new MultiResolutionImage(streams)),\n\t\t\t\ttint.ToOptional(),\n\t\t\t\tOptional.None<IObservable<IColorMap>>(),\n\t\t\t\tOptional.None());\n\t\t}\n\n\t\tstatic Stream CreatePngStreamFromBitmap(this System.Drawing.Image bitmap)\n\t\t{\n\t\t\tvar memoryStream = new MemoryStream();\n\t\t\tbitmap.Save(memoryStream, ImageFormat.Png);\n\t\t\tmemoryStream.Seek(0, SeekOrigin.Begin);\n\t\t\treturn memoryStream;\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static class Loader<TImage>\n\t\t\t{\n\t\t\t\tpublic static Func<Stream, TImage> FromStream;\n\t\t\t}\n\n\t\t\tpublic static Func<IObservable<IImage>, Optional<IObservable<Color>>, Optional<IObservable<IColorMap>>, Optional<IObservable<Ratio<Pixels, Points>>>, IControl> Factory;\n\n\t\t\tpublic static Func<IList<ImageStream>, TimeSpan, IObservable<Color>, IControl> Animate;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Controls/Label.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic class TextPart\n\t{\n\t\tpublic string Text { get; set; }\n\t\t// font\n\t\t// color\n\t\tpublic Optional<Color> ForegroundColor { get; set; }\n\t}\n\n\tpublic class Url : TextPart\n\t{\n\t\tpublic Uri Uri { get; set; }\n\t}\n\n\tpublic static class AttributedText\n\t{\n\t\tpublic static IList<TextPart> Parts()\n\t\t{\n\t\t\treturn new List<TextPart>();\n\t\t}\n\n\t\tpublic static IList<TextPart> Parts(this IList<TextPart> self, IList<TextPart> parts)\n\t\t{\n\t\t\tforeach (var part in parts)\n\t\t\t\tself.Add(part);\n\t\t\t\n\t\t\treturn self;\n\t\t}\n\n\t\tpublic static IList<TextPart> Text(this IList<TextPart> self, string element, Color color = null)\n\t\t{\n\t\t\tself.Add(new TextPart\n\t\t\t{\n\t\t\t\tText = element,\n\t\t\t    ForegroundColor = color ?? Optional.None<Color>()\n\t\t\t});\n\t\t\treturn self;\n\t\t}\n\n\t\tpublic static IList<TextPart> Link(this IList<TextPart> self, string name, string url, Color color = null)\n\t\t{\n\t\t\tself.Add(new Url\n\t\t\t{\n\t\t\t\tText = name,\n\t\t\t    ForegroundColor = color ?? Optional.None<Color>(),\n\t\t\t\tUri = new Uri(url)\n\t\t\t});\n\t\t\treturn self;\n\t\t}\n\t}\n\n\tpublic enum LineBreakMode\n\t{\n\t\t/// <summary>\n\t\t/// Lines are simply not drawn past the edge of the text container.\n\t\t/// </summary>\n\t\tClip,\n\n\t\t/// <summary>\n\t\t/// Wrapping occurs at word boundaries, unless the word itself doesn�t fit on a single line.\n\t\t/// </summary>\n\t\tWrap,\n\n\t\t/// <summary>\n\t\t/// The line is displayed so that the end fits in the container and the missing text at the beginning of the line is indicated by an ellipsis glyph.\n\t\t/// </summary>\n\t\tTruncateHead,\n\n\t\t///<summary>\n\t\t/// The line is displayed so that the beginning fits in the container and the missing text at the end of the line is indicated by an ellipsis glyph.\n\t\t/// </summary>\n\t\tTruncateTail\n\t}\n\n\tpublic static class Label\n\t{\n\t\tpublic static IControl Create(\n\t\t\tText text = default(Text),\n\t\t\tFont font = null,\n\t\t\tTextAlignment textAlignment = TextAlignment.Left,\n\t\t\tBrush color = default(Brush),\n\t\t\tLineBreakMode lineBreakMode = LineBreakMode.Clip)\n\t\t{\n\t\t\treturn Implementation.Factory(\n\t\t\t\tfont ?? Font.Default,\n\t\t\t\ttext,\n\t\t\t\tObservable.Return(textAlignment),\n\t\t\t\tcolor | new Color(1, 1, 1, 1),\n\t\t\t\tlineBreakMode);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<Font, Text, IObservable<TextAlignment>, Brush, LineBreakMode, IControl> Factory;\n\t\t\tpublic static Func<IObservable<IEnumerable<TextPart>>, Font, IObservable<TextAlignment>, Brush, LineBreakMode, IControl> Formatted;\n\t\t}\n\n\t\tpublic static IControl FormattedText(\n\t\t\tIObservable<IEnumerable<TextPart>> textParts,\n\t\t\tFont font = null,\n\t\t\tTextAlignment textAlignment = TextAlignment.Left,\n\t\t\tBrush color = default(Brush),\n\t\t\tLineBreakMode lineBreakMode = LineBreakMode.Clip)\n\t\t{\n\t\t\treturn Implementation.Formatted(\n\t\t\t\ttextParts,\n\t\t\t\tfont ?? Font.Default,\n\t\t\t\tObservable.Return(textAlignment),\n\t\t\t\tcolor | Color.FromBytes(255, 0, 0),\n\t\t\t\tlineBreakMode);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Controls/LogView.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class LogView\n\t{\n\t\t/// <param name=\"stream\">\n\t\t/// An observable sequence of characters to append to the end of the log, where '\\n' moves to the next line.\n\t\t/// The caller is responsible for ending this stream when the view is no longer in use.\n\t\t/// </param>\n\t\tpublic static IControl Create(IObservable<string> stream = null, IObservable<Color> color = null, IObservable<Color> linkColor = null, IObservable<Unit> clear = null, IObservable<bool> darkTheme = null)\n\t\t{\n\t\t\treturn Implementation.Factory(\n\t\t\t\tstream ?? Observable.Never<string>(),\n\t\t\t\tcolor ?? Observable.Return(Color.White),\n\t\t\t\tlinkColor ?? Observable.Return(Color.Black),\n\t\t\t\tclear ?? Observable.Never<Unit>(),\n\t\t\t\tdarkTheme ?? Observable.Return(false));\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IObservable<string>, IObservable<Color>, IObservable<Color>, IObservable<Unit>, IObservable<bool>, IControl> Factory;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Controls/MountLocation.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\t/// <summary>\n\t/// IMountLocation is an observable data structure that defines the information passed from parent to children in the control hierarchy.\n\t/// The information passed in the opposite direction, from child to parent, is exposed as part of IControl.\n\t/// </summary>\n\tpublic interface IMountLocation\n\t{\n\t\t/// <summary>\n\t\t/// Whether this control is currently part of the control hierarchy of a visible window.\n\t\t/// This can be used to connect subscriptions and manage other resources to avoid leaks when a control is either removed from its parent or the window is hidden.\n\t\t/// </summary>\n\t\tIObservable<bool> IsRooted { get; }\n\n\t\t/// <summary>\n\t\t/// The size should only be used as an aid in calculating the DesiredSize of the IControl\n\t\t/// It depends on the parent control's layout rules whether the NativeFrame of the IControl ends up being this size.\n\t\t/// </summary>\n\t\tSize<IObservable<Points>> AvailableSize { get; }\n\n\t\t/// <summary>\n\t\t/// The actual size and position of the native control placed in its parent container control.\n\t\t/// Do not use this to calculate the DesiredSize of the IControl, as that can cause feedback loops, unstable layout or just nothing showing up.\n\t\t/// </summary>\n\t\tRectangle<IObservable<Points>> NativeFrame { get; }\n\t}\n\n\tpublic static class MountLocation\n\t{\n\t\tpublic class Mutable : IMountLocation\n\t\t{\n\t\t\tpublic IObservable<bool> IsRooted { get; set; }\n\n\t\t\tpublic Size<IObservable<Points>> AvailableSize { get; set; }\n\n\t\t\tpublic Rectangle<IObservable<Points>> NativeFrame { get; set; }\n\t\t}\n\n\t\tpublic static readonly IMountLocation Unmounted = new Mutable\n\t\t{\n\t\t\tIsRooted = Observable.Return(false),\n\t\t\tAvailableSize = ObservableMath.NeverSize,\n\t\t\tNativeFrame = ObservableMath.NeverRectangle,\n\t\t};\n\n\t\tpublic static IMountLocation Switch(this IObservable<IMountLocation> self)\n\t\t{\n\t\t\treturn new Mutable\n\t\t\t{\n\t\t\t\tIsRooted = self\n\t\t\t\t\t.Select(s => s.IsRooted).Switch()\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.Replay(1).RefCount(),\n\n\t\t\t\tAvailableSize = self\n\t\t\t\t\t.Select(s => s.AvailableSize).Switch()\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.Replay(1).RefCount(),\n\n\t\t\t\tNativeFrame = self\n\t\t\t\t\t.Select(s => s.NativeFrame).Switch()\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.Replay(1).RefCount(),\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Controls/MultiResolutionImage.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic class MultiResolutionImage : CachedImageBase\n\t{\n\t\treadonly IImmutableSet<ImageStream> _differentResolutions;\n\n\t\tpublic MultiResolutionImage(IEnumerable<ImageStream> differentResolutions)\n\t\t{\n\t\t\t_differentResolutions = differentResolutions\n\t\t\t\t.ToImmutableSortedSet(new ImageStreamComparer());\n\t\t}\n\n\t\tImageStream GetImageFromScaleFactor(Ratio<Pixels, Points> scaleFactor)\n\t\t{\n\t\t\tforeach (var img in _differentResolutions)\n\t\t\t{\n\t\t\t\tif (img.ScaleFactor >= scaleFactor)\n\t\t\t\t\treturn img;\n\t\t\t}\n\n\t\t\treturn _differentResolutions.Last();\n\t\t}\n\n\t\tprotected override Stream OnCreatePngStream(Ratio<Pixels, Points> scaleFactor, Optional<IColorMap> colorMap, out Ratio<Pixels, Points> imageScaleFactor)\n\t\t{\n\t\t\tvar imageStream = GetImageFromScaleFactor(scaleFactor);\n\t\t\timageScaleFactor = imageStream.ScaleFactor;\n\t\t\treturn imageStream.Create();\n\t\t}\n\n\t\tclass ImageStreamComparer : IComparer<ImageStream>\n\t\t{\n\t\t\tpublic int Compare(ImageStream x, ImageStream y)\n\t\t\t{\n\t\t\t\treturn (int)(Math.Round(x.ScaleFactor - y.ScaleFactor, MidpointRounding.AwayFromZero));\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class ImageStream\n\t{\n\t\tpublic readonly Ratio<Pixels, Points> ScaleFactor;\n\t\tpublic readonly Func<Stream> Create;\n\n\t\tpublic ImageStream(Ratio<Pixels, Points> scaleFactor, Func<Stream> create)\n\t\t{\n\t\t\tScaleFactor = scaleFactor;\n\t\t\tCreate = create;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/NativeControl.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reflection;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ImplementationLocator\n\t{\n\t\tstatic readonly object Mutex = new object();\n\n\t\tstatic bool _isLoaded;\n\n\t\tpublic static T CreateInstance<T>()\n\t\t{\n\t\t\tLoadImplementation();\n\n\t\t\tforeach (var ass in AppDomain.CurrentDomain.GetAssemblies())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (ass.IsDynamic)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tforeach (var t in ass.GetExportedTypes())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (t.IsClass && t.GetInterface(typeof(T).FullName) != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn (T) Activator.CreateInstance(t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new NotImplementedException(\n\t\t\t\t\"Native control factory '\" + typeof(T).FullName + \"' not found in assemblies: \" +\n\t\t\t\tAppDomain.CurrentDomain.GetAssemblies().Select(a => a.ToString()).Join(\", \"));\n\t\t}\n\n\t\tstatic void LoadImplementation()\n\t\t{\n\t\t\tlock (Mutex)\n\t\t\t{\n\t\t\t\tif (_isLoaded) return;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tswitch (Platform.OperatingSystem)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase OS.Mac: Assembly.Load(\"Outracks.Fusion.Mac\"); return;\n\t\t\t\t\t\tcase OS.Windows: Assembly.Load(\"Outracks.Fusion.Windows\"); return;\n\t\t\t\t\t\tdefault: throw new PlatformNotSupportedException();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tthrow new InitializationFailed(e);\n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\t_isLoaded = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/Shapes.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Shapes\n\t{\n\t\tpublic static IControl Rectangle(Stroke stroke = null, Brush fill = default(Brush), IObservable<CornerRadius> cornerRadius = null)\n\t\t{\n\t\t\treturn Implementation.RectangleFactory(stroke ?? Stroke.Empty, fill, cornerRadius.ToOptional());\n\t\t}\n\n\t\tpublic static IControl Circle(Stroke stroke = null, Brush fill = default(Brush))\n\t\t{\n\t\t\treturn Implementation.CircleFactory(stroke ?? Stroke.Empty, fill);\n\t\t}\n\n\t\tpublic static IControl Line(Point<Points> start, Point<Points> end, Stroke stroke)\n\t\t{\n\t\t\treturn Line(start.Select(Observable.Return), end.Select(Observable.Return), stroke);\n\t\t}\n\n\t\tpublic static IControl Line(Point<IObservable<Points>> start, Point<IObservable<Points>> end, Stroke stroke)\n\t\t{\n\t\t\treturn Implementation.LineFactory(start, end, stroke);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<Stroke, Brush, IControl> CircleFactory;\n\n\t\t\tpublic static Func<Stroke, Brush, Optional<IObservable<CornerRadius>>, IControl> RectangleFactory;\n\n\t\t\tpublic static Func<Point<IObservable<Points>>, Point<IObservable<Points>>, Stroke, IControl> LineFactory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/Slider.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Slider\n\t{\n\t\tpublic static IControl Create(IProperty<double> value = null, double min = 0.0, double max = 1.0)\n\t\t{\n\t\t\treturn Implementation.Factory(value ?? Property.Create(0.0), Observable.Return(min), Observable.Return(max));\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IProperty<double>, IObservable<double>, IObservable<double>, IControl> Factory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/SvgImage.cs",
    "content": "using System;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Drawing.Imaging;\nusing System.Drawing.Text;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text.RegularExpressions;\nusing System.Xml;\nusing Outracks.Diagnostics;\nusing Svg;\n\nnamespace Outracks.Fusion\n{\n\tpublic class SvgImage : CachedImageBase\n\t{\n\t\treadonly Func<Stream> _svgStreamFactory;\n\n\t\tpublic SvgImage(Func<Stream> svgStreamFactory)\n\t\t{\n\t\t\t_svgStreamFactory = svgStreamFactory;\n\t\t}\n\n\t\tprotected override Stream OnCreatePngStream(Ratio<Pixels, Points> scaleFactor, Optional<IColorMap> colorMap, out Ratio<Pixels, Points> imageScaleFactor)\n\t\t{\n\t\t\timageScaleFactor = scaleFactor;\n\t\t\treturn ConvertToPng(scaleFactor, colorMap);\n\t\t}\n\n\n\t\tstatic readonly Regex _hexColorMatchRegex = new Regex(\n\t\t\t\"#(?<color>[0-9a-fA-F]{6}|[0-9a-fA-F]{3})\\\\b\",\n\t\t\tRegexOptions.Compiled);\n\n\t\t// NOTE: This expects colors in SVGs to be specified with hex triplets to be recognized\n\t\tstatic void ApplyColorMap(XmlDocument xmlDocument, IColorMap colorMap)\n\t\t{\n\t\t\tforeach (var attr in xmlDocument\n\t\t\t\t.SelectNodes(\"//*\")\n\t\t\t\t.OfType<XmlElement>()\n\t\t\t\t.SelectMany(x => x.Attributes.Cast<XmlAttribute>()))\n\t\t\t{\n\t\t\t\tvar attrValue = attr.Value;\n\t\t\t\tforeach (var match in _hexColorMatchRegex.Matches(attrValue).Cast<Match>().Reverse())\n\t\t\t\t{\n\t\t\t\t\tvar matchGroup = match.Groups[\"color\"];\n\t\t\t\t\tvar origHexColor = matchGroup.Value;\n\t\t\t\t\tif (origHexColor.Length == 3)\n\t\t\t\t\t{\n\t\t\t\t\t\torigHexColor = string.Format(\"{0}{0}{1}{1}{2}{2}\", origHexColor[0], origHexColor[1], origHexColor[2]);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar origColor = Color.FromRgb(Convert.ToInt32(origHexColor, 16));\n\t\t\t\t\tvar newColor = colorMap.Map(origColor);\n\t\t\t\t\tif (origColor != newColor)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newHexColor = string.Format(\n\t\t\t\t\t\t\t\"{0:x2}{1:x2}{2:x2}\",\n\t\t\t\t\t\t\t(int) Math.Round(newColor.R * 255.0f),\n\t\t\t\t\t\t\t(int) Math.Round(newColor.G * 255.0f),\n\t\t\t\t\t\t\t(int) Math.Round(newColor.B * 255.0f));\n\t\t\t\t\t\tattrValue = attrValue.Remove(matchGroup.Index, matchGroup.Length).Insert(matchGroup.Index, newHexColor);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tattr.Value = attrValue;\n\t\t\t}\n\t\t}\n\n\n\t\tStream ConvertToPng(Ratio<Pixels, Points> scaleFactor, Optional<IColorMap> colorMap)\n\t\t{\n\t\t\tusing (var s = _svgStreamFactory())\n\t\t\t{\n\t\t\t\t// Started out with 16x16 oversampling here, but that's just ridiculous and too expensive.\n\t\t\t\t// Setting to 4x4 as I'm not able to notice a difference going above that.\n\t\t\t\tvar oversampling = 4;\n\t\t\t\tvar xmlDocument = new XmlDocument();\n\t\t\t\txmlDocument.Load(s);\n\t\t\t\tcolorMap.Do(cm => ApplyColorMap(xmlDocument, cm));\n\t\t\t\tvar svgDoc = SvgDocument.Open(xmlDocument);\n\t\t\t\tusing (var bitmap = RenderSvg(svgDoc, scaleFactor.Value, oversampling))\n\t\t\t\tusing (var scaledBitmap = DownscaleByFactor(bitmap, oversampling))\n\t\t\t\t{\n\t\t\t\t\tvar memoryStream = new MemoryStream();\n\t\t\t\t\tscaledBitmap.Save(memoryStream, ImageFormat.Png);\n\t\t\t\t\tmemoryStream.Seek(0, SeekOrigin.Begin);\n\t\t\t\t\treturn memoryStream;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic Bitmap RenderSvg(SvgDocument svgDoc, double scaleFactor, int oversampling)\n\t\t{\n\t\t\tvar dimensions = svgDoc.GetDimensions();\n\t\t\tvar finalWidth = (int)Math.Round(dimensions.Width * scaleFactor);\n\t\t\tvar finalHeight = (int)Math.Round(dimensions.Height * scaleFactor);\n\n\t\t\tvar renderWidth = finalWidth * oversampling;\n\t\t\tvar renderHeight = finalHeight * oversampling;\n\n\t\t\tvar bitmap = new Bitmap(\n\t\t\t\trenderWidth,\n\t\t\t\trenderHeight,\n\t\t\t\tPixelFormat.Format32bppArgb);\n\t\t\tusing (Graphics g = Graphics.FromImage(bitmap))\n\t\t\t{\n\t\t\t\tg.TextRenderingHint = TextRenderingHint.AntiAlias;\n\t\t\t\tg.PixelOffsetMode = PixelOffsetMode.Half;\n\t\t\t\tg.TextContrast = 1;\n\t\t\t\tg.SmoothingMode = SmoothingMode.None;\n\t\t\t\tg.CompositingQuality = CompositingQuality.HighQuality;\n\t\t\t\tg.InterpolationMode = InterpolationMode.Default;\n\t\t\t\tusing (var renderer = new SvgRendererWithNoSmoothControl(SvgRenderer.FromImage(bitmap)))\n\t\t\t\t{\n\t\t\t\t\trenderer.SetBoundable(\n\t\t\t\t\t\tnew GenericBoundable(0.0f, 0.0f, bitmap.Width, bitmap.Height));\n\t\t\t\t\trenderer.ScaleTransform(\n\t\t\t\t\t\tbitmap.Width / dimensions.Width,\n\t\t\t\t\t\tbitmap.Height / dimensions.Height,\n\t\t\t\t\t\tMatrixOrder.Append);\n\t\t\t\t\tsvgDoc.Overflow = SvgOverflow.Auto;\n\t\t\t\t\tsvgDoc.RenderElement(renderer);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn bitmap;\n\t\t}\n\n\t\tstatic Bitmap DownscaleByFactor(Bitmap bitmap, int downscaleFactor)\n\t\t{\n\t\t\tint[] sourcePixels = GetIntPixelArray(bitmap);\n\n\t\t\tif (bitmap.PixelFormat != PixelFormat.Format32bppArgb)\n\t\t\t\tthrow new ArgumentException(\"Only works 32bpp ARGB format\");\n\t\t\tif (bitmap.Height % downscaleFactor != 0 || bitmap.Width % downscaleFactor != 0)\n\t\t\t\tthrow new ArgumentException(\"Width and height of bitmap must be dividable by downscaleFactor\", \"downscaleFactor\");\n\n\t\t\tvar dw = bitmap.Width / downscaleFactor;\n\t\t\tvar dh = bitmap.Height / downscaleFactor;\n\n\t\t\tvar destPixels = new int[dw * dh];\n\t\t\tvar gamma = 2.2;\n\t\t\tvar toLinearLut = Enumerable.Range(0, 256).Select(x => Math.Pow(x / 255.0, gamma)).ToArray();\n\n\t\t\tfor (int dy = 0; dy < dh; dy++)\n\t\t\t{\n\t\t\t\t// Scale down every AA block\n\t\t\t\tfor (int dx = 0; dx < dw; dx++)\n\t\t\t\t{\n\t\t\t\t\tdouble a = 0, r = 0, g = 0, b = 0, pixelCount = 0;\n\t\t\t\t\tfor (int suby = 0; suby < downscaleFactor; suby++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar soffset = ((dy * downscaleFactor + suby) * (dw * downscaleFactor)) + dx * downscaleFactor;\n\t\t\t\t\t\tfor (int subx = 0; subx < downscaleFactor; subx++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar sourcePixel = sourcePixels[soffset + subx];\n\t\t\t\t\t\t\tvar pa = ((sourcePixel >> 24) & 0xff) / 255.0;\n\t\t\t\t\t\t\tif (pa > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpixelCount += 1;\n\t\t\t\t\t\t\t\ta += pa;\n\n\t\t\t\t\t\t\t\tvar pr = (sourcePixel >> 16) & 0xff;\n\t\t\t\t\t\t\t\tvar pg = (sourcePixel >> 8) & 0xff;\n\t\t\t\t\t\t\t\tvar pb = (sourcePixel & 0xff);\n\n\t\t\t\t\t\t\t\tif (Platform.IsMac && pa < 1.0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Workaround for annoying problem with mono libgdiplus\n\t\t\t\t\t\t\t\t\t// Our pixels are premultiplied, but not treated as such :/\n\t\t\t\t\t\t\t\t\tpr = (int) Math.Min(255, pr / pa);\n\t\t\t\t\t\t\t\t\tpg = (int) Math.Min(255, pg / pa);\n\t\t\t\t\t\t\t\t\tpb = (int) Math.Min(255, pb / pa);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tr += toLinearLut[pr];\n\t\t\t\t\t\t\t\tg += toLinearLut[pg];\n\t\t\t\t\t\t\t\tb += toLinearLut[pb];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tint destPixel = 0;\n\t\t\t\t\tif (a > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar da = (int) Math.Round(a / (downscaleFactor * downscaleFactor) * 255.0);\n\t\t\t\t\t\tFunc<double, int> fromLinear = x => (int) Math.Round(Math.Pow(x / pixelCount, 1 / gamma) * 255.0);\n\t\t\t\t\t\tvar dr = fromLinear(r);\n\t\t\t\t\t\tvar dg = fromLinear(g);\n\t\t\t\t\t\tvar db = fromLinear(b);\n\t\t\t\t\t\tdestPixel = (da << 24) | (dr << 16) | (dg << 8) | db;\n\t\t\t\t\t}\n\n\t\t\t\t\tdestPixels[dy * dw + dx] = destPixel;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar scaledBitmap = new Bitmap(dw, dh, PixelFormat.Format32bppArgb);\n\t\t\tvar rect = new System.Drawing.Rectangle(0, 0, dw, dh);\n\t\t\tBitmapData bdata = scaledBitmap.LockBits(rect, ImageLockMode.ReadWrite, scaledBitmap.PixelFormat);\n\t\t\tIntPtr ptr = bdata.Scan0;\n\t\t\tMarshal.Copy(destPixels, 0, ptr, destPixels.Length);\n\t\t\tscaledBitmap.UnlockBits(bdata);\n\t\t\treturn scaledBitmap;\n\t\t}\n\n\t\tstatic int[] GetIntPixelArray(Bitmap bitmap)\n\t\t{\n\t\t\tvar rect = new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height);\n\t\t\tBitmapData bdata = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tbdata = bitmap.LockBits(rect, ImageLockMode.ReadWrite, bitmap.PixelFormat);\n\t\t\t\tif (bdata.Stride != bitmap.Width * 4)\n\t\t\t\t{\n\t\t\t\t\tthrow new NotImplementedException(\"Assumes stride equal to width and 4 bytes per pixel\");\n\t\t\t\t}\n\t\t\t\tIntPtr ptr = bdata.Scan0;\n\t\t\t\tvar pixels = new int[Math.Abs(bdata.Stride) / sizeof(int) * bitmap.Height];\n\t\t\t\tMarshal.Copy(ptr, pixels, 0, pixels.Length);\n\t\t\t\treturn pixels;\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tif (bdata != null)\n\t\t\t\t\tbitmap.UnlockBits(bdata);\n\t\t\t}\n\t\t}\n\n\t\t#region Svg renderer for rendering with AA disabled\n\n\t\tclass GenericBoundable : ISvgBoundable\n\t\t{\n\t\t\tpublic GenericBoundable(RectangleF rect)\n\t\t\t{\n\t\t\t\tBounds = rect;\n\t\t\t}\n\n\t\t\tpublic GenericBoundable(float x, float y, float width, float height)\n\t\t\t{\n\t\t\t\tBounds = new RectangleF(x, y, width, height);\n\t\t\t}\n\n\t\t\tpublic PointF Location\n\t\t\t{\n\t\t\t\tget { return Bounds.Location; }\n\t\t\t}\n\n\t\t\tpublic SizeF Size\n\t\t\t{\n\t\t\t\tget { return Bounds.Size; }\n\t\t\t}\n\n\t\t\tpublic RectangleF Bounds { get; set; }\n\t\t}\n\n\t\tclass SvgRendererWithNoSmoothControl : ISvgRenderer\n\t\t{\n\t\t\treadonly ISvgRenderer _svgRendererImplementation;\n\n\t\t\tpublic SvgRendererWithNoSmoothControl(ISvgRenderer svgRendererImplementation)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation = svgRendererImplementation;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.Dispose();\n\t\t\t}\n\n\t\t\tpublic void DrawImage(System.Drawing.Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit graphicsUnit)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.DrawImage(image, destRect, srcRect, graphicsUnit);\n\t\t\t}\n\n\t\t\tpublic void DrawImageUnscaled(System.Drawing.Image image, System.Drawing.Point location)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.DrawImageUnscaled(image, location);\n\t\t\t}\n\n\t\t\tpublic void DrawPath(Pen pen, GraphicsPath path)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.DrawPath(pen, path);\n\t\t\t}\n\n\t\t\tpublic void FillPath(System.Drawing.Brush brush, GraphicsPath path)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.FillPath(brush, path);\n\t\t\t}\n\n\t\t\tpublic ISvgBoundable GetBoundable()\n\t\t\t{\n\t\t\t\treturn _svgRendererImplementation.GetBoundable();\n\t\t\t}\n\n\t\t\tpublic Region GetClip()\n\t\t\t{\n\t\t\t\treturn _svgRendererImplementation.GetClip();\n\t\t\t}\n\n\t\t\tpublic ISvgBoundable PopBoundable()\n\t\t\t{\n\t\t\t\treturn _svgRendererImplementation.PopBoundable();\n\t\t\t}\n\n\t\t\tpublic void RotateTransform(float fAngle, MatrixOrder order = MatrixOrder.Append)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.RotateTransform(fAngle, order);\n\t\t\t}\n\n\t\t\tpublic void ScaleTransform(float sx, float sy, MatrixOrder order = MatrixOrder.Append)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.ScaleTransform(sx, sy, order);\n\t\t\t}\n\n\t\t\tpublic void SetBoundable(ISvgBoundable boundable)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.SetBoundable(boundable);\n\t\t\t}\n\n\t\t\tpublic void SetClip(Region region, CombineMode combineMode = CombineMode.Replace)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.SetClip(region, combineMode);\n\t\t\t}\n\n\t\t\tpublic void TranslateTransform(float dx, float dy, MatrixOrder order = MatrixOrder.Append)\n\t\t\t{\n\t\t\t\t_svgRendererImplementation.TranslateTransform(dx, dy, order);\n\t\t\t}\n\n\t\t\tpublic float DpiY\n\t\t\t{\n\t\t\t\tget { return _svgRendererImplementation.DpiY; }\n\t\t\t}\n\n\t\t\t// Make smoothing mode do nothing\n\t\t\tpublic SmoothingMode SmoothingMode { get; set; }\n\n\t\t\tpublic System.Drawing.Drawing2D.Matrix Transform\n\t\t\t{\n\t\t\t\tget { return _svgRendererImplementation.Transform; }\n\t\t\t\tset { _svgRendererImplementation.Transform = value; }\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/TextBox.cs",
    "content": "using System;\n\nnamespace Outracks.Fusion\n{\n\t[Flags]\n\tpublic enum StyleFlags\n\t{\n\t\tNone = 0,\n\t\tInvalidValue = 1<<0,\n\t}\n\n\tpublic static class TextBox\n\t{\n\t\tpublic static IControl Create(\n\t\t\tIProperty<string> text = null,\n\t\t\tbool isMultiline = false,\n\t\t\tbool doWrap = false,\n\t\t\tOptional<Command> onFocused = default(Optional<Command>),\n\t\t\tBrush foregroundColor = default(Brush))\n\t\t{\n\t\t\treturn Implementation.Factory(\n\t\t\t\ttext ?? Property.Create(\"\"),\n\t\t\t\tisMultiline,\n\t\t\t\tdoWrap,\n\t\t\t\tonFocused,\n\t\t\t\tforegroundColor | Color.White);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IProperty<string>, bool, bool, Optional<Command>, Brush, IControl> Factory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Controls/WebView.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class WebView\n\t{\n\t\tpublic static IControl Create(Uri uri, Action<Navigating> onNavigating = null)\n\t\t{\n\t\t\treturn Implementation.UrlFactory(uri, onNavigating ?? (_ => { }));\n\t\t}\n\n\t\tpublic static IControl Create(IObservable<string> content)\n\t\t{\n\t\t\treturn Implementation.StringFactory(content);\n\t\t}\n\n\t\tpublic static IControl Create(string content)\n\t\t{\n\t\t\treturn Implementation.StringFactory(Observable.Return(content));\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<Uri, Action<Navigating>, IControl> UrlFactory;\n\t\t\tpublic static Func<IObservable<string>, IControl> StringFactory;\n\t\t}\n\t}\n\n\n\tpublic class Navigating\n\t{\n\t\tpublic Navigating(Uri destination)\n\t\t{\n\t\t\tDestination = destination;\n\t\t}\n\n\t\tpublic Uri Destination { get; private set; }\n\t\tpublic bool Cancel { get; set; }\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/CornerRadius.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic class CornerRadius : IEquatable<CornerRadius>\n\t{\n\t\tpublic static CornerRadius None = new CornerRadius(0, 0);\n\t\tpublic readonly Points RadiusX;\n\t\tpublic readonly Points RadiusY;\n\n\t\tpublic CornerRadius(Points radiusX, Points radiusY)\n\t\t{\n\t\t\tRadiusX = radiusX;\n\t\t\tRadiusY = radiusY;\n\t\t}\n\n\t\tpublic CornerRadius(Points uniformRadius)\n\t\t{\n\t\t\tRadiusX = uniformRadius;\n\t\t\tRadiusY = uniformRadius;\n\t\t}\n\n\t\tpublic bool Equals(CornerRadius other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn RadiusX.Equals(other.RadiusX) && RadiusY.Equals(other.RadiusY);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\tif (obj.GetType() != this.GetType()) return false;\n\t\t\treturn Equals((CornerRadius)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (RadiusX.GetHashCode() * 397) ^ RadiusY.GetHashCode();\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(CornerRadius left, CornerRadius right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(CornerRadius left, CornerRadius right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\t}\n\n\tpublic static class CornerRadiusExtensions\n\t{\n\t\tpublic static IObservable<CornerRadius> ToCornerRadius(this IObservable<Points> radius)\n\t\t{\n\t\t\treturn radius.Select(p => new CornerRadius(p));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Cursor.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic enum Cursor\n\t{\n\t\tNormal,\n\t\tResizeVertically,\n\t\tResizeHorizontally,\n\t\tGrab,\n\t\tGrabbing,\n\t\tPointing,\n\t\tText,\n\t}\n\n\tpublic static class Cursors\n\t{\n\t\tpublic static IControl SetCursor(this IControl control, Cursor color)\n\t\t{\n\t\t\treturn control.SetCursor(Observable.Return(color));\n\t\t}\n\n\t\tpublic static IControl SetCursor(this IControl control, Func<IControl, IObservable<Cursor>> color)\n\t\t{\n\t\t\treturn control.SetCursor(color(control));\n\t\t}\n\n\t\tpublic static IControl SetCursor(this IControl control, IObservable<Cursor> color)\n\t\t{\n\t\t\treturn Implementation.Set(control, color);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IControl, IObservable<Cursor>, IControl> Set;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/DebugControl.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Runtime.CompilerServices;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tclass DebugControl\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly IControl Control;\n\t\tpublic readonly Rectangle<IObservable<Points>> Frame;\n\t\tpublic readonly Size<IObservable<Points>> AvailableSize;\n\t\tpublic readonly AbsoluteFilePath FilePath;\n\t\tpublic readonly int LineNumber;\n\n\t\tpublic DebugControl(string name, IControl control, Rectangle<IObservable<Points>> frame, Size<IObservable<Points>> availableSize, AbsoluteFilePath filePath, int lineNumber)\n\t\t{\n\t\t\tName = name;\n\t\t\tControl = control;\n\t\t\tFrame = frame;\n\t\t\tAvailableSize = availableSize;\n\t\t\tFilePath = filePath;\n\t\t\tLineNumber = lineNumber;\n\t\t}\n\t}\n\n\tpublic static class Debugging\n\t{\n\t\tstatic readonly BehaviorSubject<ImmutableDictionary<string, DebugControl>> DebugControls\n\t\t\t= new BehaviorSubject<ImmutableDictionary<string, DebugControl>>(ImmutableDictionary<string, DebugControl>.Empty);\n\t\tstatic readonly BehaviorSubject<Optional<string>> SelectedControl = new BehaviorSubject<Optional<string>>(Optional.None());\n\n\t\tpublic static IControl Debug(this IControl ctrl, string name, [CallerFilePath] string filepath = \"\", [CallerLineNumber]int lineNumber = 0)\n\t\t{\n#if DEBUG\n\t\t\tvar location = new ReplaySubject<IMountLocation>(1);\n\t\t\tctrl = ctrl.WithMountLocation(\n\t\t\t\toldLocation =>\n\t\t\t\t{\n\t\t\t\t\tlocation.OnNext(oldLocation);\n\t\t\t\t\treturn oldLocation;\n\t\t\t\t});\n\n\t\t\tvar debugCtrl = new DebugControl(\n\t\t\t\tname,\n\t\t\t\tctrl,\n\t\t\t\tlocation.Select(l => l.NativeFrame).Switch(),\n\t\t\t\tlocation.Select(l => l.AvailableSize).Switch(),\n\t\t\t\tAbsoluteFilePath.Parse(filepath),\n\t\t\t\tlineNumber);\n\n\t\t\tDebugControls.OnNext(DebugControls.Value.SetItem(debugCtrl.Name, debugCtrl));\n\n\t\t\tvar selected = Command.Enabled(action: () => SelectedControl.OnNext(name));\n\n\t\t\treturn ctrl.WithOverlay(\n\t\t\t\tSelectedControl.StartWithNone()\n\t\t\t\t\t.Select(selCtrl => selCtrl.MatchWith(n => n == name, () => false))\n\t\t\t\t\t.Select(isSelected => isSelected\n\t\t\t\t\t\t? Shapes.Rectangle(stroke: Stroke.Create(2, Color.FromBytes(0x6d, 0xc0, 0xd2)), fill: Color.FromBytes(0x6d, 0xc0, 0xd2, 50))\n\t\t\t\t\t\t: Shapes.Rectangle().OnMouse(pressed: selected))\n\t\t\t\t\t.Switch()\n\t\t\t);\n#else\n\t\t\treturn ctrl;\n#endif\n\t\t}\n\n\t\tpublic static IControl CreateDebugControl()\n\t\t{\n\t\t\tvar debugControls = DebugControls\n\t\t\t\t.Throttle(TimeSpan.FromMilliseconds(10));\n\t\t\tvar controls = debugControls\n\t\t\t\t.CachePerElement(getKey: ctrl => ctrl.Value, getValue: ctrl => ctrl.Value.Name)\n\t\t\t\t.SelectPerElement(name =>\n\t\t\t\t\tCreateDebugItem(name, Command.Enabled(action: () => SelectedControl.OnNext(name))));\n\n\t\t\tvar infoPanel = SelectedControl\n\t\t\t\t.CombineLatest(debugControls, (sel, ctrls) => sel.HasValue ? CreateInfoPanel(ctrls[sel.Value]) : CreateNothingSelected())\n\t\t\t\t.Switch();\n\n\t\t\treturn Layout.Dock()\n\t\t\t\t.Left(\n\t\t\t\t\tLayout.Dock().Top(Header(\"Debug Controls\"))\n\t\t\t\t\t.Fill(controls.StackFromTop().MakeScrollable())\n\t\t\t\t\t.WithWidth(200)\n\t\t\t\t\t.WithPadding(new Thickness<Points>(10))\n\t\t\t\t)\n\t\t\t\t.Left(\n\t\t\t\t\tLayout.StackFromTop(\n\t\t\t\t\t\tHeader(\"Mount Info\"),\n\t\t\t\t\t\tinfoPanel\n\t\t\t\t\t).WithPadding(new Thickness<Points>(10))\n\t\t\t\t)\n\t\t\t\t.Fill()\n\t\t\t\t.WithPadding(new Thickness<Points>(10));\n\t\t}\n\n\t\tstatic IControl CreateDebugItem(string name, Command selected)\n\t\t{\n\t\t\tvar isSelected = SelectedControl.NotNone().Select(sel => sel == name);\n\t\t\treturn Button.Create(\n\t\t\t\ttext: name,\n\t\t\t\tclicked: selected,\n\t\t\t\tcontent: states =>\n\t\t\t\t\tLabel.Create(name, color: states.IsHovered.Select(hovered => hovered ? Color.FromBytes(0x6d, 0xc0, 0xd2) : Color.White).AsBrush())\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(10, 5, 10, 5))\n\t\t\t\t\t\t.WithOverlay(Shapes.Rectangle(fill: isSelected.Select(hovered => hovered ? Color.FromBytes(0x6d, 0xc0, 0xd2, 100) : Color.Transparent).AsBrush()))\n\t\t\t)\n\t\t\t.SetContextMenu(Menu.Item(\"Open in Text Editor\", () => new Shell().OpenWithDefaultApplication(DebugControls.Value[name].FilePath)));\n\t\t}\n\n\t\tstatic IControl CreateInfoPanel(DebugControl selCtrl)\n\t\t{\n\t\t\tvar rooted = selCtrl.Control.IsRooted;\n\t\t\tvar desiredSize = selCtrl.Control.DesiredSize.Transpose();\n\t\t\tvar nativeFrame = selCtrl.Frame.Transpose();\n\t\t\tvar availableSize = selCtrl.AvailableSize.Transpose();\n\t\t\tvar actualSize = nativeFrame.Size();\n\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tCreateProperty(\"IsRooted\", rooted, r => r.ToString()),\n\t\t\t\tCreateProperty(\"Desired Size\", desiredSize, d => d.Format()),\n\t\t\t\tCreateProperty(\"Actual Size\", actualSize, a => a.Format()),\n\t\t\t\tCreateProperty(\"Available Size\", availableSize, a => a.Format()),\n\t\t\t\tCreateProperty(\"Native Frame\", nativeFrame, f => f.Format()).WithPadding(new Thickness<Points>(0, 20, 0, 0))\n\t\t\t)\n\t\t\t.WithPadding(new Thickness<Points>(0, 5, 0, 0));\n\t\t}\n\n\t\tstatic IControl CreateNothingSelected()\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tLabel.Create(\"Nothing selected\")\n\t\t\t)\n\t\t\t.WithPadding(new Thickness<Points>(0, 5, 0, 0));\n\t\t}\n\n\t\tstatic IControl Header(string header)\n\t\t{\n\t\t\treturn Layout.StackFromTop(\n\t\t\t\tLabel.Create(header, Font.SystemDefault(15)),\n\t\t\t\tShapes.Rectangle(fill: Color.FromRgb(0xffffff)).WithHeight(1).WithPadding(new Thickness<Points>(0, 5, 0, 5))\n\t\t\t);\n\t\t}\n\n\t\tstatic IControl CreateProperty<T>(string propertyName, IObservable<T> value, Func<T, string> converter)\n\t\t{\n\t\t\tvar prefix = propertyName + \": \";\n\t\t\treturn Label.Create(\n\t\t\t\tvalue.StartWithNone()\n\t\t\t\t\t.Select(val => val.MatchWith(\n\t\t\t\t\t\tsome: v => prefix + converter(v),\n\t\t\t\t\t\tnone: () => prefix + \" - \"))\n\t\t\t\t\t.AsText());\n\t\t}\n\n\t\tstatic string Format(this Rectangle<Points> rect)\n\t\t{\n\t\t\treturn \"\\n{\\n    Position: \" + rect.Position.Format() + \"\\n    Size: \" + rect.Size.Format() + \"\\n}\";\n\t\t}\n\n\t\tstatic string Format(this Point<Points> pos)\n\t\t{\n\t\t\treturn pos.X.ToDouble().ToString(\"F\") + \"pt, \" + pos.Y.ToDouble().ToString(\"F\") + \"pt\";\n\t\t}\n\n\t\tstatic string Format(this Size<Points> size)\n\t\t{\n\t\t\treturn size.Width.ToDouble().ToString(\"F\") + \"pt x \" + size.Height.ToDouble().ToString(\"F\") + \"pt\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Diagnostics/ConsoleTraceExtensions.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ConsoleTraceExtensions\n\t{\n\t\t/// <summary>\n\t\t/// Logs activity of observables contained in <paramref name=\"source\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"source\">The <see cref=\"Rectangle\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name of observable, to make it easier to locate in trace</param>\n\t\t/// <param name=\"toString\">Optional delegate to call when converting to string, to override <see cref=\"object.ToString()\"/></param>\n\t\tpublic static Size<IObservable<T>> ConsoleTrace<T>(\n\t\t\tthis Size<IObservable<T>> source,\n\t\t\tstring name = \"(anonymous size)\",\n\t\t\tFunc<T, string> toString = null)\n\t\t{\n\t\t\treturn Size.Create(\n\t\t\t\tsource.Width.ConsoleTrace(name + \".Width\", toString),\n\t\t\t\tsource.Height.ConsoleTrace(name + \".Height\", toString));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Logs activity of observables contained in <paramref name=\"source\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"source\">The <see cref=\"Rectangle\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name prefix for observables, to make it easier to locate in trace</param>\n\t\t/// <param name=\"toString\">Optional delegate to call when converting to string, to override <see cref=\"object.ToString()\"/></param>\n\t\tpublic static Interval<IObservable<T>> ConsoleTrace<T>(\n\t\t\tthis Interval<IObservable<T>> source,\n\t\t\tstring name = \"(anonymous interval)\",\n\t\t\tFunc<T, string> toString = null)\n\t\t{\n\t\t\treturn Interval.FromOffsetLength(\n\t\t\t\tsource.Offset.ConsoleTrace(name + \".Offset\", toString),\n\t\t\t\tsource.Length.ConsoleTrace(name + \".Length\", toString));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Logs activity of observables contained in <paramref name=\"source\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"source\">The <see cref=\"Rectangle\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name prefix for observables, to make it easier to locate in trace</param>\n\t\t/// <param name=\"toString\">Optional delegate to call when converting to string, to override <see cref=\"object.ToString()\"/></param>\n\t\tpublic static Rectangle<IObservable<T>> ConsoleTrace<T>(\n\t\t\tthis Rectangle<IObservable<T>> source,\n\t\t\tstring name = \"(anonymous rectangle)\",\n\t\t\tFunc<T, string> toString = null)\n\t\t{\n\t\t\treturn Rectangle.FromPositionSize(\n\t\t\t\tsource.Left().ConsoleTrace(name + \".Left\", toString),\n\t\t\t\tsource.Top().ConsoleTrace(name + \".Top\", toString),\n\t\t\t\tsource.Width.ConsoleTrace(name + \".Width\", toString),\n\t\t\t\tsource.Height.ConsoleTrace(name + \".Height\", toString));\n\t\t}\n\n\n\t\t/// <summary>\n\t\t/// Logs activity of observables contained in <paramref name=\"source\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"source\">The <see cref=\"Rectangle\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name prefix for observables, to make it easier to locate in trace</param>\n\t\tpublic static IControl ConsoleTrace(this IControl source, string name = \"(anonymous control)\")\n\t\t{\n\t\t\treturn new TraceControl(source, name);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Logs activity of observables contained in <paramref name=\"source\"/> to stdout.\n\t\t/// </summary>\n\t\t/// <param name=\"source\">The <see cref=\"Rectangle\"/> to trace</param>\n\t\t/// <param name=\"name\">Optional name prefix for observables, to make it easier to locate in trace</param>\n\t\tpublic static IMountLocation ConsoleTrace(this IMountLocation source, string name = \"(anonymous mount location)\")\n\t\t{\n\t\t\treturn new MountLocation.Mutable\n\t\t\t{\n\t\t\t\tIsRooted = source.IsRooted.ConsoleTrace(name + \".IsRooted\"),\n\t\t\t\tAvailableSize = source.AvailableSize.ConsoleTrace(name + \".AvailableSize\"),\n\t\t\t\tNativeFrame = source.NativeFrame.ConsoleTrace(name + \".NativeFrame\")\n\t\t\t};\n\t\t}\n\t}\n\n\tclass TraceControl : IControl\n\t{\n\t\treadonly IControl _source;\n\n\t\tpublic TraceControl(IControl source, string name )\n\t\t{\n\t\t\t_source = source;\n\t\t\tvar mount = source.Mount;\n\t\t\tDesiredSize = source.DesiredSize.ConsoleTrace(name + \".DesiredSize\");\n\t\t\tIsRooted = source.IsRooted.ConsoleTrace(name + \".IsRooted\");\n\t\t\tMount = mountLocation => mount(mountLocation.ConsoleTrace(name + \".MountLocation\"));\n\t\t}\n\n\t\tpublic object NativeHandle\n\t\t{\n\t\t\tget { return _source.NativeHandle; }\n\t\t}\n\n\t\tpublic Action<IMountLocation> Mount { get; private set; }\n\n\t\tpublic Size<IObservable<Points>> DesiredSize { get; private set; }\n\n\t\tpublic IObservable<bool> IsRooted { get; private set; }\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Dialogs/FileDialog.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class FileDialog\n\t{\n\t\tpublic static Task<Optional<FileDialogResult>> OpenFile(FileDialogOptions options, Optional<IControl> windowControl = default(Optional<IControl>))\n\t\t{\n\t\t\treturn Implementation(windowControl).OpenFile(options);\n\t\t}\n\t\tpublic static Func<Optional<IControl>, IFileDialogImplementation> Implementation;\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Dialogs/MessageBox.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion.Dialogs\n{\n\tpublic static class MessageBox\n\t{\n\t\tpublic static IMessageBox Implementation { get; set; }\n\n\t\tpublic static void BringToFront()\n\t\t{\n\t\t\tif (Implementation == null)\n\t\t\t\tthrow new NotImplementedException();\n\n\t\t\tImplementation.BringToFront();\n\t\t}\n\n\t\tpublic static bool ShowConfirm(string text, string caption, MessageBoxType type)\n\t\t{\n\t\t\tif (Implementation == null)\n\t\t\t\tthrow new NotImplementedException();\n\n\t\t\treturn Implementation.ShowConfirm(text, caption, type);\n\t\t}\n\n\t\tpublic static void Show(string text, string caption, MessageBoxType type)\n\t\t{\n\t\t\tif (Implementation == null)\n\t\t\t\tthrow new NotImplementedException();\n\n\t\t\tImplementation.Show(text, caption, type);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Document.cs",
    "content": "﻿using System;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface IDocument\n\t{\n\t\tIObservable<Optional<AbsoluteFilePath>> FilePath { get; }\n\n\t\t//IObservable<double> Progress { get; }\n\n\t\tIObservable<byte[]> Content { get; }\n\n\t\tvoid Write(byte[] content);\n\n\t\tIDialog<object> Window { get; }\n\t\t//void Rename(FileName name);\n\t\t//void Move(DocumentLocation location);\n\t\t//void Delete();\n\n\t\t//void Bookmark();\n\t}\n\n\t/*\n\tclass Bookmark\n\t{\n\t\tIObservable<string> DisplayName { get; }\n\t\tIObservable<string> DisplayLocation { get; }\n\n\t\tIDocument Open();\n\n\t\tvoid Remove();\n\t}\n\t*/\n}\n"
  },
  {
    "path": "src/fusion/core/Dragging.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Dragging\n\t{\n\t\tpublic static IControl OnDragOver(this IControl self, Func<object, bool> canDrop, Action<object> drop, Action<object> enter = null, Action<object> leave = null)\n\t\t{\n\t\t\tdrop = drop ?? (t => { });\n\t\t\tenter = enter ?? (t => { });\n\t\t\tleave = leave ?? (t => { });\n\t\t\treturn Implementation.OnDragOver(self, Observable.Return(canDrop), o => drop(o), o => enter(o), o => leave(o));\n\t\t}\n\n\t\tpublic static IControl OnDragOver<T>(this IControl self, Action<T> drop, Action<T> enter = null, Action<T> leave = null)\n\t\t{\n\t\t\tdrop = drop ?? (t => { });\n\t\t\tenter = enter ?? (t => { });\n\t\t\tleave = leave ?? (t => { });\n\t\t\treturn Implementation.OnDragOver(self, Observable.Return<Func<object, bool>>(o => o is T), o => drop((T)o), o => enter((T)o), o => leave((T)o));\n\t\t}\n\n\t\tpublic static IControl WhileDraggingScrub(\n\t\t\tthis IControl control,\n\t\t\tIProperty<Points> property,\n\t\t\tDirection2D direction = Direction2D.LeftToRight)\n\t\t{\n\t\t\tvar unsavedValue = Optional.None<Points>();\n\t\t\treturn control.WhileDragging(\n\t\t\t\tvalue: property,\n\t\t\t\thandler: (initial, current) =>\n\t\t\t\t{\n\t\t\t\t\tvar newValue =\n\t\t\t\t\t\tdirection == Direction2D.LeftToRight ? initial.Value + CalculateDelta(initial.Position.X, current.Position.X) :\n\t\t\t\t\t\tdirection == Direction2D.TopToBottom ? initial.Value + CalculateDelta(initial.Position.Y, current.Position.Y) :\n\t\t\t\t\t\tdirection == Direction2D.RightToLeft ? initial.Value - CalculateDelta(initial.Position.X, current.Position.X) :\n\t\t\t\t\t\t\tinitial.Value - CalculateDelta(initial.Position.Y, current.Position.Y);\n\n\t\t\t\t\treturn Command.Enabled(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tproperty.Write(newValue, save: false);\n\t\t\t\t\t\tunsavedValue = newValue;\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.OnMouse(released:\n\t\t\t\t\tCommand.Enabled(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!unsavedValue.HasValue) return;\n\n\t\t\t\t\t\tproperty.Write(unsavedValue.Value, save: true);\n\t\t\t\t\t\tunsavedValue = Optional.None<Points>();\n\t\t\t\t\t}))\n\t\t\t\t.Control;\n\t\t}\n\n\t\tstatic double CalculateDelta(double a, double b)\n\t\t{\n\t\t\treturn Math.Floor(b) - Math.Floor(a);\n\t\t}\n\n\t\tpublic static Hittable WhileDragging<T>(\n\t\t\tthis IControl control,\n\t\t\tIObservable<T> value,\n\t\t\tFunc<Positioned<T>, Positioned<T>, Command> handler)\n\t\t{\n\t\t\tvar hittable = control.MakeHittable(space: Space.Window);\n\n\t\t\thittable.Pressed\n\t\t\t\t.WithLatestFromBuffered(value.ConnectWhile(hittable.Control.IsRooted), Positioned.Create)\n\t\t\t\t.Switch(pressed =>\n\t\t\t\t\thittable.Moved\n\t\t\t\t\t\t//.Sample(Application.PerFrame)\n\t\t\t\t\t\t.WithLatestFromBuffered(value.ConnectWhile(hittable.Control.IsRooted), Positioned.Create)\n\t\t\t\t\t\t.SelectMany(moved => handler(pressed, moved).Execute.FirstAsync())\n\t\t\t\t\t\t.TakeUntil(hittable.Released.Select(_ => Unit.Default)\n\t\t\t\t\t\t\t.Merge(hittable.LostFocus)))\n\t\t\t\t.Subscribe(action => action());\n\n\t\t\treturn hittable;\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IControl, IObservable<Func<object, bool>>, Action<object>, Action<object>, Action<object>, IControl> OnDragOver;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/DropOperation.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic class DropOperation\n\t{\n\t\tpublic static DropOperation None\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new DropOperation()\n\t\t\t\t{\n\t\t\t\t\tCanDrop = _ => false,\n\t\t\t\t\tDrop = _ => { },\n\t\t\t\t\tOnError = Observer.Create<string>(_ => { }),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tpublic static DropOperation Create(Func<AbsoluteFilePath, bool> canDrop, Action<AbsoluteFilePath> drop, IObserver<string> onError)\n\t\t{\n\t\t\treturn new DropOperation\n\t\t\t{\n\t\t\t\tCanDrop = canDrop,\n\t\t\t\tDrop = drop,\n\t\t\t\tOnError = onError\n\t\t\t};\n\t\t}\n\n\t\tpublic Func<AbsoluteFilePath, bool> CanDrop {get; private set;}\n\t\tpublic Action<AbsoluteFilePath> Drop {get; private set;}\n\t\tpublic IObserver<string> OnError { get; private set; }\n\n\t}\n}\n\n"
  },
  {
    "path": "src/fusion/core/Effects.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Effects\n\t{\n\t\tpublic static IControl DropShadow(\n\t\t\tthis IControl control,\n\t\t\tBrush color = default(Brush),\n\t\t\tIObservable<Points> radius = null,\n\t\t\tIObservable<double> angle = null,\n\t\t\tIObservable<Points> distance = null)\n\t\t{\n\t\t\treturn Implementation.DropShadow(control,\n\t\t\t\tcolor | Color.Black.WithAlpha(a: 0.4f),\n\t\t\t\tradius ?? Observable.Return<Points>(15),\n\t\t\t\tangle ?? Observable.Return(-90.0),\n\t\t\t\tdistance ?? Observable.Return<Points>(2));\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<\n\t\t\t\tIControl,\n\t\t\t\tBrush,\n\t\t\t\tIObservable<Points>,\n\t\t\t\tIObservable<double>,\n\t\t\t\tIObservable<Points>,\n\t\t\t\tIControl> DropShadow;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Environments/MacEnvironment.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class MacEnvironment\n\t{\n\t\tstatic IMacEnvironmentImpl _implementation;\n\n\t\tstatic IMacEnvironmentImpl Implementation\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_implementation == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new InvalidOperationException(\"Mac specific bindings not initialized or available.\");\n\t\t\t\t}\n\n\t\t\t\treturn _implementation;\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<AbsoluteDirectoryPath> GetPathToApplicationsThatContains(string name)\n\t\t{\n\t\t\treturn Implementation.GetPathToApplicationsThatContains(name);\n\t\t}\n\n\t\tpublic static IEnumerable<AbsoluteDirectoryPath> GetApplications(string identifier)\n\t\t{\n\t\t\treturn Implementation.GetApplications(identifier);\n\t\t}\n\n\t\tpublic static void Initialize(IMacEnvironmentImpl impl)\n\t\t{\n\t\t\t_implementation = impl;\n\t\t}\n\t}\n\n\tpublic interface IMacEnvironmentImpl\n\t{\n\t\tIEnumerable<AbsoluteDirectoryPath> GetPathToApplicationsThatContains(string name);\n\t\tIEnumerable<AbsoluteDirectoryPath> GetApplications(string identifier);\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Environments/WindowsEnvironment.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing Microsoft.Win32;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic class WindowsEnvironment\n\t{\n\t\tpublic Optional<AbsoluteFilePath> GetDefaultApplicationForFile(AbsoluteFilePath fileName)\n\t\t{\n\t\t\tvar pathRes = new StringBuilder();\n\t\t\tvar res = FindExecutable(fileName.ToString(), null, pathRes);\n\t\t\treturn res > 32 ? Optional.Some(AbsoluteFilePath.Parse(pathRes.ToString())) : Optional.None<AbsoluteFilePath>();\n\t\t}\n\n\t\t[DllImport(\"shell32.dll\")]\n\t\tstatic extern int FindExecutable(string lpFile, string lpDirectory, [Out] StringBuilder lpResult);\n\n\n\t\tpublic static IEnumerable<AbsoluteDirectoryPath> LookForPathInUninstall(string partOfName)\n\t\t{\n\t\t\tvar registryKey = @\"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\";\n\t\t\tvar key = Registry.LocalMachine.OpenSubKey(registryKey);\n\t\t\tif (key != null)\n\t\t\t{\n\t\t\t\tforeach (var subkey in key.GetSubKeyNames().Select(keyName => key.OpenSubKey(keyName)))\n\t\t\t\t{\n\t\t\t\t\tvar displayName = subkey.GetValue(\"DisplayName\") as string;\n\t\t\t\t\tif (displayName != null && displayName.Contains(partOfName))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar installLocation = subkey.GetValue(\"InstallLocation\") as string;\n\t\t\t\t\t\tyield return AbsoluteDirectoryPath.Parse(installLocation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tkey.Close();\n\t\t\t}\n\n\t\t\tregistryKey = @\"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\";\n\t\t\tkey = Registry.LocalMachine.OpenSubKey(registryKey);\n\t\t\tif (key != null)\n\t\t\t{\n\t\t\t\tforeach (var subkey in key.GetSubKeyNames().Select(keyName => key.OpenSubKey(keyName)))\n\t\t\t\t{\n\t\t\t\t\tvar displayName = subkey.GetValue(\"DisplayName\") as string;\n\t\t\t\t\tif (displayName != null && displayName.Contains(partOfName))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar installLocation = subkey.GetValue(\"InstallLocation\") as string;\n\t\t\t\t\t\tyield return AbsoluteDirectoryPath.Parse(installLocation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tkey.Close();\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<AbsoluteDirectoryPath> LookForPathInApplications(string fullName)\n\t\t{\n\t\t\tvar applications = Registry.ClassesRoot.OpenSubKey(\"Applications\");\n\t\t\tif (applications != null)\n\t\t\t{\n\t\t\t\tforeach (var application in applications.GetSubKeyNames().Select(keyName => applications.OpenSubKey(keyName)))\n\t\t\t\t{\n\t\t\t\t\tif (application.Name.EndsWith(fullName))\n\t\t\t\t\t{\n\t\t\t\t\t\tapplication.GetSubKeyNames().Select(keyName => application.OpenSubKey(keyName));\n\t\t\t\t\t\tvar kjell = application.OpenSubKey(\"shell\");\n\t\t\t\t\t\tvar open = kjell.OpenSubKey(\"open\");\n\t\t\t\t\t\tvar command = open.OpenSubKey(\"command\");\n\t\t\t\t\t\tvar command_string = (string)command.GetValue(\"\");\n\t\t\t\t\t\tvar exe_path = command_string.Split(\" \")[0].Trim('\"');\n\t\t\t\t\t\tyield return AbsoluteDirectoryPath.Parse(exe_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tapplications.Close();\n\t\t\t};\n\t\t}\n\n\t\tpublic static IEnumerable<AbsoluteDirectoryPath> LookForPathInPATH(string file)\n\t\t{\n\t\t\tforeach (var part in Environment.GetEnvironmentVariable(\"PATH\", EnvironmentVariableTarget.Process).Split(';'))\n\t\t\t{\n\t\t\t\tvar path = Path.Combine(part, file);\n\t\t\t\tif (File.Exists(path))\n\t\t\t\t\tyield return AbsoluteDirectoryPath.Parse(part);\n\t\t\t}\n\n\t\t\tforeach (var part in Environment.GetEnvironmentVariable(\"PATH\", EnvironmentVariableTarget.User).Split(';'))\n\t\t\t{\n\t\t\t\tvar path = Path.Combine(part, file);\n\t\t\t\tif (File.Exists(path))\n\t\t\t\t\tyield return AbsoluteDirectoryPath.Parse(part);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Font.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ToFontExtension\n\t{\n\t\tpublic static Font Switch(this IObservable<Font> font)\n\t\t{\n\t\t\t// TODO: This won't be correct when introducing other fonts than just the system default like we have now,\n\t\t\t//  but should be correct for the current implementation.\n\t\t\treturn Font.SystemDefault(font.Select(f => f.Size).Switch().Replay(1).RefCount(), font.Select(f => f.Bold).Switch().Replay(1).RefCount());\n\t\t}\n\t}\n\n\tpublic sealed class Font\n\t{\n\t\tpublic static Font SystemDefault(double size, bool bold = false)\n\t\t{\n\t\t\treturn new Font\n\t\t\t{\n\t\t\t\tSize = Observable.Return(size),\n\t\t\t\tBold = Observable.Return(bold),\n\t\t\t};\n\t\t}\n\n\t\tpublic static Font SystemDefault(IObservable<double> size, IObservable<bool> bold = null)\n\t\t{\n\t\t\treturn new Font\n\t\t\t{\n\t\t\t\tSize = size,\n\t\t\t\tBold = bold ?? Observable.Return(false),\n\t\t\t};\n\t\t}\n\n\t\tpublic static Font Default\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Font\n\t\t\t\t{\n\t\t\t\t\tSize = Observable.Return(13.0),\n\t\t\t\t\tBold = Observable.Return(false),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tpublic IObservable<bool> Bold { get; private set; }\n\n\t\tpublic IObservable<double> Size { get; private set; }\n\t}\n\n\tpublic enum TextAlignment\n\t{\n\t\tLeft,\n\t\tRight,\n\t\tCenter\n\t}\n}"
  },
  {
    "path": "src/fusion/core/FpsProfiler.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tpublic class FpsProfiler\n\t{\n\t\treadonly Subject<TimeSpan> _samples = new Subject<TimeSpan>();\n\n\t\tpublic IObservable<int> GetAverageFramesPerSecond(int numSamples)\n\t\t{\n\t\t\treturn GetSumOfFps(numSamples)\n\t\t\t\t.Select(sumOfTime => (int)Math.Round(sumOfTime / numSamples));\n\t\t}\n\n\t\tpublic IObservable<double> GetAverageFrameTime(int numSamples)\n\t\t{\n\t\t\treturn GetSumOfSamples(numSamples)\n\t\t\t\t.Select(sumTime => sumTime / (double)numSamples);\n\t\t}\n\n\t\tIObservable<double> GetSumOfFps(int numSamples)\n\t\t{\n\t\t\treturn _samples\n\t\t\t\t.Buffer(numSamples)\n\t\t\t\t.Select(timespans => timespans.Sum(span => 1.0 / span.TotalSeconds));\n\t\t}\n\n\t\tIObservable<double> GetSumOfSamples(int numSamples)\n\t\t{\n\t\t\treturn _samples\n\t\t\t\t.Buffer(numSamples)\n\t\t\t\t.Select(timespans => timespans.Sum(span => span.TotalSeconds));\n\t\t}\n\n\t\tpublic void Profile(Action profileMe)\n\t\t{\n\t\t\tvar stopwatch = Stopwatch.StartNew();\n\t\t\tprofileMe();\n\t\t\t_samples.OnNext(stopwatch.Elapsed);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/HotKey.cs",
    "content": "using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic struct HotKey : IEquatable<HotKey>\n\t{\n\t\tpublic static HotKey None\n\t\t{\n\t\t\tget { return default(HotKey); }\n\t\t}\n\n\t\tpublic static HotKey Create(ModifierKeys modifier, Key key)\n\t\t{\n\t\t\treturn new HotKey\n\t\t\t{\n\t\t\t\tModifier = modifier,\n\t\t\t\tKey = key,\n\t\t\t};\n\t\t}\n\n\t\tpublic ModifierKeys Modifier { get; private set; }\n\t\tpublic Key Key { get; private set; }\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Modifier != ModifierKeys.None\n\t\t\t\t? Modifier + \" \" + Key\n\t\t\t\t: Key.ToString();\n\t\t}\n\n\t\tpublic bool Equals(HotKey other)\n\t\t{\n\t\t\treturn Modifier == other.Modifier && Key == other.Key;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is HotKey && Equals((HotKey)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn ((int)Modifier * 397) ^ (int)Key;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(HotKey left, HotKey right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(HotKey left, HotKey right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fusion/core/IBehaviorProperty.cs",
    "content": "﻿namespace Outracks.Fusion\n{\n\tpublic interface IBehaviorProperty<T> : IBehavior<T>, IProperty<T> { }\n}"
  },
  {
    "path": "src/fusion/core/IDialog.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface IDialog<in T>\n\t{\n\t\tvoid Focus();\n\t\tvoid Close(T result = default(T));\n\t\tvoid CloseWithError(Exception e);\n\n\t\tvoid CreateSingletonWindow(IObservable<bool> isVisible, Func<IDialog<object>, Window> window);\n\n\t\tTask<TU> ShowDialog<TU>(Func<IDialog<TU>, Window> window);\n\n\t\tTask<Optional<AbsoluteDirectoryPath>> BrowseForDirectory(AbsoluteDirectoryPath directory);\n\t\tTask<Optional<AbsoluteFilePath>> BrowseForFile(AbsoluteDirectoryPath directory, params FileFilter[] filters);\n\n\t\t//IControl BrowseForDirectoryControl(AbsoluteDirectoryPath directory);\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Icon.cs",
    "content": "using System;\nusing System.IO;\nusing System.Reflection;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n    public class Icon\n    {\n\t    public static Icon FromFile(AbsoluteFilePath path)\n\t    {\n\t\t    return new Icon(() => File.OpenRead(path.NativePath));\n\t    }\n\n\t    public static Icon FromResource(string resourceName, Assembly assembly = null)\n\t\t{\n\t\t\tif (assembly == null)\n\t\t\t\tassembly = Assembly.GetCallingAssembly();\n\n\t\t    return new Icon(\n\t\t\t    () =>\n\t\t\t    {\n\t\t\t\t\tvar stream = assembly.GetManifestResourceStream(resourceName);\n\t\t\t\t\tif (stream == null)\n\t\t\t\t\t\tthrow new ArgumentException(\"Resource '\"+resourceName+\"' not found in assembly \" + assembly.GetName().FullName);\n\t\t\t\t\treturn stream;\n\t\t\t    });\n\t    }\n\n\t    readonly Func<Stream> _getStream;\n\n\t    public Icon(Func<Stream> getStream)\n        {\n\t        _getStream = getStream;\n        }\n\n\t    public Stream GetStream()\n\t    {\n\t\t    return _getStream();\n\t    }\n    }\n}"
  },
  {
    "path": "src/fusion/core/Key.cs",
    "content": "namespace Outracks.Fusion\n{\n\tpublic enum Key\n\t{\n\t\tNone,\n\t\tBackspace = 8,\n\t\tTab = 9,\n\t\tEnter = 13,\n\t\tCapsLock = 20,\n\t\tEscape = 27,\n\t\tSpace = 32,\n\t\tPageUp = 33,\n\t\tPageDown = 34,\n\t\tEnd = 35,\n\t\tHome = 36,\n\t\tLeft = 37,\n\t\tUp = 38,\n\t\tRight = 39,\n\t\tDown = 40,\n\t\tInsert = 45,\n\t\tDelete = 46,\n\t\tD0 = 48,\n\t\tD1 = 49,\n\t\tD2 = 50,\n\t\tD3 = 51,\n\t\tD4 = 52,\n\t\tD5 = 53,\n\t\tD6 = 54,\n\t\tD7 = 55,\n\t\tD8 = 56,\n\t\tD9 = 57,\n\t\tPlus = 58,\n\t\tMinus = 59,\n\t\tA = 65,\n\t\tB = 66,\n\t\tC = 67,\n\t\tD = 68,\n\t\tE = 69,\n\t\tF = 70,\n\t\tG = 71,\n\t\tH = 72,\n\t\tI = 73,\n\t\tJ = 74,\n\t\tK = 75,\n\t\tL = 76,\n\t\tM = 77,\n\t\tN = 78,\n\t\tO = 79,\n\t\tP = 80,\n\t\tQ = 81,\n\t\tR = 82,\n\t\tS = 83,\n\t\tT = 84,\n\t\tU = 85,\n\t\tV = 86,\n\t\tW = 87,\n\t\tX = 88,\n\t\tY = 89,\n\t\tZ = 90,\n\t\tNumPad0 = 96,\n\t\tNumPad1 = 97,\n\t\tNumPad2 = 98,\n\t\tNumPad3 = 99,\n\t\tNumPad4 = 100,\n\t\tNumPad5 = 101,\n\t\tNumPad6 = 102,\n\t\tNumPad7 = 103,\n\t\tNumPad8 = 104,\n\t\tNumPad9 = 105,\n\t\tF1 = 112,\n\t\tF2 = 113,\n\t\tF3 = 114,\n\t\tF4 = 115,\n\t\tF5 = 116,\n\t\tF6 = 117,\n\t\tF7 = 118,\n\t\tF8 = 119,\n\t\tF9 = 120,\n\t\tF10 = 121,\n\t\tF11 = 122,\n\t\tF12 = 123,\n\t\tLeftShift = 116,\n\t\tRightShift = 117,\n\t\tLeftCtrl = 118,\n\t\tRightCtrl = 119,\n\t\tLeftAlt = 120,\n\t\tRightAlt = 121,\n\t\tMenuButton = 200,\n\t\tBackButton = 201,\n\t\tOSKey = 202,\n\t\tMetaKey = 203,\n\n\n\t\tAdd = 206,\n\t\tSubtract = 207\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Keyboard.cs",
    "content": "using System;\nusing System.Reactive;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Keyboard\n\t{\n\t\tpublic static T OnKeyPressed<T>(this T control, ModifierKeys modifier, Key key, Optional<Command> handler = default(Optional<Command>), bool isGlobal = false)\n\t\t\twhere T : IControl\n\t\t{\n\t\t\tif (handler.HasValue)\n\t\t\t\tPressed(control, modifier, key, isGlobal)\n\t\t\t\t\t.WithLatestFromBuffered(handler.Value.Execute.ConnectWhile(control.IsRooted), (_, c) => c)\n\t\t\t\t\t.ConnectWhile(control.IsRooted)\n\t\t\t\t\t.Subscribe(c => c());\n\t\t\treturn control;\n\t\t}\n\n\t\tpublic static T OnKeyReleased<T>(this T control, ModifierKeys modifier, Key key, Optional<Command> handler = default(Optional<Command>), bool isGlobal = false)\n\t\t\twhere T : IControl\n\t\t{\n\t\t\tif (handler.HasValue)\n\t\t\t\tReleased(control, modifier, key, isGlobal)\n\t\t\t\t\t.WithLatestFromBuffered(handler.Value.Execute.ConnectWhile(control.IsRooted), (_, c) => c)\n\t\t\t\t\t.ConnectWhile(control.IsRooted)\n\t\t\t\t\t.Subscribe(c => c());\n\t\t\treturn control;\n\t\t}\n\n\t\tpublic static IObservable<Unit> Pressed(IControl control, ModifierKeys modifier, Key key, bool isGlobal)\n\t\t{\n\t\t\treturn isGlobal ? Implementation.GlobalPressed(control, modifier, key) : Implementation.Pressed(control, modifier, key);\n\t\t}\n\n\t\tpublic static IObservable<Unit> Released(IControl control, ModifierKeys modifier, Key key, bool isGlobal)\n\t\t{\n\t\t\treturn isGlobal ? Implementation.GlobalReleased(control, modifier, key) : Implementation.Released(control, modifier, key);\n\t\t}\n\n\t\tpublic static Command GiveFocusTo(IControl control)\n\t\t{\n\t\t\treturn Implementation.GiveFocusTo(control);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IControl, ModifierKeys, Key, IObservable<Unit>> Pressed;\n\t\t\tpublic static Func<IControl, ModifierKeys, Key, IObservable<Unit>> Released;\n\n\t\t\tpublic static Func<IControl, ModifierKeys, Key, IObservable<Unit>> GlobalPressed;\n\t\t\tpublic static Func<IControl, ModifierKeys, Key, IObservable<Unit>> GlobalReleased;\n\t\t\tpublic static Func<IControl, Command> GiveFocusTo;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/Center.cs",
    "content": "using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl Center(this IControl control)\n\t\t{\n\t\t\treturn control.CenterHorizontally().CenterVertically();\n\t\t}\n\n\t\tpublic static IControl CenterHorizontally(this IControl control)\n\t\t{\n\t\t\treturn Center(control, Axis2D.Horizontal);\n\t\t}\n\n\t\tpublic static IControl CenterVertically(this IControl control)\n\t\t{\n\t\t\treturn Center(control, Axis2D.Vertical);\n\t\t}\n\n\t\tpublic static IControl Center(this IControl node, Axis2D axis)\n\t\t{\n\t\t\treturn node.WithFrame(frame =>\n\t\t\t\tframe.WithAxis(axis, a => a.ShrinkTo(node.DesiredSize[axis])));\n\t\t}\n\n\t\tstatic Interval<IObservable<T>> ShrinkTo<T>(this Interval<IObservable<T>> interval, IObservable<T> length) where T : INumeric<T>, new()\n\t\t{\n\t\t\treturn Interval.FromOffsetLength(\n\t\t\t\toffset: interval.Offset.Add(interval.Length.Sub(length).Div(2)).Round(),\n\t\t\t\tlength: length);\n\t\t}\n\t}\n\n\n}"
  },
  {
    "path": "src/fusion/core/Layout/Collapsable.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Collapsable\n\t{\n\t\tpublic static IControl MakeCollapsable(\n\t\t\tthis IControl content,\n\t\t\tRectangleEdge edge,\n\t\t\tIObservable<bool> expanded,\n\t\t\tbool lazy = true,\n\t\t\tbool unrootWhenCollapsed = false,\n\t\t\tbool animate = true)\n\t\t{\n\t\t\tedge = edge.FlipVerticallyOnMac();\n\t\t\tvar expandedValueStep = expanded.Select(isExpanded => isExpanded ? 1.0 : 0.0);\n\t\t\tvar expandedValue = animate ? expandedValueStep.LowPass() : expandedValueStep;\n\n\t\t\tvar u = edge.NormalAxis();\n\t\t\tvar v = edge.NormalAxis().Opposite();\n\n\t\t\tvar lazyContent = lazy == false\n\t\t\t\t? content\n\t\t\t\t: expanded\n\t\t\t\t\t.SkipWhile(e => e == false).Take(1)\n\t\t\t\t\t.Select(isExpanded => content)\n\t\t\t\t\t.StartWith(Control.Empty)\n\t\t\t\t\t.Switch()\n\t\t\t\t\t;\n\n\t\t\tif (unrootWhenCollapsed)\n\t\t\t\tlazyContent = lazyContent.HideWhen(expandedValue.Select(ev => ev < 0.01));\n\n\t\t\treturn Layout\n\t\t\t\t.Layer(self => new[]\n\t\t\t\t{\n\t\t\t\t\tlazyContent\n\t\t\t\t\t\t.Clip()\n\t\t\t\t\t\t.WithFrame(parentFrame =>\n\t\t\t\t\t\t\tRectangle\n\t\t\t\t\t\t\t\t.FromPositionSize(\n\t\t\t\t\t\t\t\t\tposition: edge.GetOffsetPosition(lazyContent.DesiredSize[u], expandedValue),\n\t\t\t\t\t\t\t\t\tsize: Size.Create(\n\t\t\t\t\t\t\t\t\t\tlazyContent.DesiredSize[u],\n\t\t\t\t\t\t\t\t\t\tparentFrame.Size[v],\n\t\t\t\t\t\t\t\t\t\tfirstAxis: u))\n\t\t\t\t\t\t\t\t.MoveTo(parentFrame.Position))\n\t\t\t\t\t\t.Clip()\n\t\t\t\t})\n\t\t\t\t.WithSize(desiredSize: Size.Create(\n\t\t\t\t\tlazyContent.DesiredSize[u].Mul(expandedValue),\n\t\t\t\t\texpanded.Switch(e => e ? lazyContent.DesiredSize[v] : ObservableMath.Zero),\n\t\t\t\t\tfirstAxis: u));\n\t\t}\n\n\t\tpublic static Point<IObservable<Points>> GetOffsetPosition(this RectangleEdge edge, IObservable<Points> width,  IObservable<double> expandedValue)\n\t\t{\n\t\t\tif (edge.IsMinimal())\n\t\t\t\treturn ObservableMath.ZeroPoint;\n\n\t\t\tvar negativeWidth = width.Select(w => 0 - w);\n\t\t\tvar collapsedValue = expandedValue.Select(v => 1 - v);\n\n\t\t\treturn Point.Create(\n\t\t\t\tnegativeWidth.Mul(collapsedValue),\n\t\t\t\tObservableMath.Zero,\n\t\t\t\tfirstAxis: edge.NormalAxis());\n\t\t}\n\n\t\tpublic static IControl ShowOnWindows(this IControl self)\n\t\t{\n\t\t\treturn self.ShowWhen(Observable.Return(Platform.IsWindows));\n\t\t}\n\n\t\tpublic static IControl ShowOnMac(this IControl self)\n\t\t{\n\t\t\treturn self.ShowWhen(Observable.Return(Platform.IsMac));\n\t\t}\n\n\t\tpublic static IControl ShowWhen(this IControl control, IObservable<bool> condition)\n\t\t{\n\t\t\tvar empty = Control.Empty;\n\t\t\treturn condition.ToControl(c => c ? control : empty);\n\t\t}\n\n\t\tpublic static IControl HideOnWindows(this IControl self)\n\t\t{\n\t\t\treturn self.HideWhen(Observable.Return(Platform.IsWindows));\n\t\t}\n\n\t\tpublic static IControl HideOnMac(this IControl self)\n\t\t{\n\t\t\treturn self.HideWhen(Observable.Return(Platform.IsMac));\n\t\t}\n\n\t\tpublic static IControl HideWhen(this IControl control, IObservable<bool> condition)\n\t\t{\n\t\t\tvar empty = Control.Empty;\n\t\t\treturn condition.ToControl(c => c ? empty : control);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Layout/Dock.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl DockTopLeft(this IControl dockedControl)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Left).Dock(RectangleEdge.Top);\n\t\t}\n\n\t\tpublic static IControl DockTopRight(this IControl dockedControl)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Right).Dock(RectangleEdge.Top);\n\t\t}\n\n\t\tpublic static IControl DockBottomLeft(this IControl dockedControl)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Left).Dock(RectangleEdge.Bottom);\n\t\t}\n\n\t\tpublic static IControl DockBottomRight(this IControl dockedControl)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Right).Dock(RectangleEdge.Bottom);\n\t\t}\n\n\t\tpublic static IControl DockLeft(this IControl dockedControl, IControl fill = null)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Left, fill);\n\t\t}\n\n\t\tpublic static IControl DockRight(this IControl dockedControl, IControl fill = null)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Right, fill);\n\t\t}\n\n\t\tpublic static IControl DockBottom(this IControl dockedControl, IControl fill = null)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Bottom, fill);\n\t\t}\n\n\t\tpublic static IControl DockTop(this IControl dockedControl, IControl fill = null)\n\t\t{\n\t\t\treturn dockedControl.Dock(RectangleEdge.Top, fill);\n\t\t}\n\n\t\tpublic static IControl Dock(this IControl dockedControl, RectangleEdge location, IControl fillControl = null)\n\t\t{\n\t\t\treturn Dock(location, dockedControl, fillControl);\n\t\t}\n\n\t\tpublic static IControl Dock(RectangleEdge edge, IControl dockedControl, IControl fillControl = null)\n\t\t{\n\t\t\treturn fillControl == null\n\t\t\t\t? dockedControl.WithFrame(old => DockArea(old, edge.FlipVerticallyOnMac(), dockedControl.DesiredSize))\n\t\t\t\t: Dock().Dock(dockedControl, edge).Fill(fillControl);\n\t\t}\n\n\t\tstatic Rectangle<IObservable<Points>> DockArea(\n\t\t\tRectangle<IObservable<Points>> old,\n\t\t\tRectangleEdge edge,\n\t\t\tSize<IObservable<Points>> desiredSize)\n\t\t{\n\t\t\tvar desiredLength = desiredSize[edge.NormalAxis()];\n\n\t\t\treturn edge.NormalAxis() == Axis2D.Horizontal\n\t\t\t\t? Rectangle.FromIntervals(\n\t\t\t\t\tedge.IsMinimal()\n\t\t\t\t\t\t? Interval.FromOffsetLength(old.Left(), desiredLength)\n\t\t\t\t\t\t: Interval.FromOffsetLength(old.Right().Sub(desiredLength), desiredLength),\n\t\t\t\t\told.VerticalInterval)\n\t\t\t\t: Rectangle.FromIntervals(\n\t\t\t\t\told.HorizontalInterval,\n\t\t\t\t\tedge.IsMinimal()\n\t\t\t\t\t\t? Interval.FromOffsetLength(old.Top(), desiredLength)\n\t\t\t\t\t\t: Interval.FromOffsetLength(old.Bottom().Sub(desiredLength), desiredLength));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/DockBuilder.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static DockBuilder Dock()\n\t\t{\n\t\t\treturn DockBuilder.Empty;\n\t\t}\n\t}\n\n\tpublic class DockBuilder\n\t{\n\t\tpublic static DockBuilder Empty\n\t\t{\n\t\t\tget { return new DockBuilder(); }\n\t\t}\n\n\t\tpublic DockBuilder Left(IControl control)\n\t\t{\n\t\t\treturn Dock(control, RectangleEdge.Left);\n\t\t}\n\n\t\tpublic DockBuilder Right(IControl control)\n\t\t{\n\t\t\treturn Dock(control, RectangleEdge.Right);\n\t\t}\n\n\t\tpublic DockBuilder Top(IControl control)\n\t\t{\n\t\t\treturn Dock(control, RectangleEdge.Top);\n\t\t}\n\n\t\tpublic DockBuilder Bottom(IControl control)\n\t\t{\n\t\t\treturn Dock(control, RectangleEdge.Bottom);\n\t\t}\n\t\tpublic DockBuilder Dock(IControl control, RectangleEdge edge)\n\t\t{\n\t\t\treturn new DockBuilder(this, control, edge);\n\t\t}\n\n\t\treadonly Optional<DockBuilder> _parent;\n\t\treadonly Optional<IControl> _control;\n\t\treadonly RectangleEdge _edge;\n\n\t\tDockBuilder(DockBuilder parent = null, IControl control = null, RectangleEdge edge = default(RectangleEdge))\n\t\t{\n\t\t\t_parent = parent.ToOptional();\n\t\t\t_control = control.ToOptional();\n\t\t\t_edge = edge.FlipVerticallyOnMac();\n\t\t}\n\t\t/*\n\tpublic IControl Fill(IControl fill = null)\n\t{\n\t\tvar self = _control.Select(c => c.Dock(_edge, fill)).Or(fill);\n\t\tvar root = _parent.Select(p => p.Fill(self)).Or(self);\n\t\treturn root ?? Control.Empty;\n\t}\n\t*/\n\tpublic IControl Fill(IControl fill = null)\n\t{\n\t\tvar stack = new Stack<DockBuilder>();\n\t\tvar db = Optional.Some(this);\n\t\twhile (db.HasValue)\n\t\t{\n\t\t\tstack.Push(db.Value);\n\t\t\tdb = db.Value._parent;\n\t\t}\n\n\t\treturn Layout.Layer(\n\t\t\t(isRooted, availableSize, parentFrame) =>\n\t\t\t{\n\t\t\t\tvar frame = ObservableMath.RectangleWithSize(parentFrame.Size);\n\n\t\t\t\tvar controls = new List<IControl>();\n\t\t\t\twhile (stack.Count != 0)\n\t\t\t\t{\n\t\t\t\t\tvar dock = stack.Pop();\n\t\t\t\t\tif (!dock._control.HasValue)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tvar axis = dock._edge.NormalAxis();\n\t\t\t\t\tvar isMinimal = dock._edge.IsMinimal();\n\t\t\t\t\tvar desired = dock._control.Value.DesiredSize[axis];\n\n\t\t\t\t\tvar total = frame[axis]\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tvar left = total.Offset\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tvar right = total.Offset.Add(total.Length)\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tvar dockedLength = desired.Min(total.Length)\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tvar dockedOffset = (isMinimal ? left : right.Sub(dockedLength))\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tvar filledLength = total.Length.Sub(dockedLength)\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tvar filledOffset = (isMinimal ? left.Add(dockedLength) : left)\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tcontrols.Add(dock._control.Value\n\t\t\t\t\t\t.WithFrame(\n\t\t\t\t\t\t\tframe: frame.WithAxis(axis, old => Interval.FromOffsetLength(dockedOffset, dockedLength))\n\t\t\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t\t\t.Replay(1).RefCount(),\n\t\t\t\t\t\t\tavailableSize: availableSize));\n\n\t\t\t\t\tframe = frame\n\t\t\t\t\t\t.WithAxis(axis, old => Interval.FromOffsetLength(filledOffset, filledLength))\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\n\t\t\t\t\tavailableSize = availableSize\n\t\t\t\t\t\t.WithAxis(axis, old => old.Sub(dockedLength))\n\t\t\t\t\t\t.Max(ObservableMath.ZeroSize)\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t\t\t;\n\t\t\t\t}\n\n\t\t\t\tif (fill != null)\n\t\t\t\t\tcontrols.Add(fill.WithFrame(frame, availableSize));\n\n\t\t\t\treturn controls;\n\t\t\t}).WithSize(DesiredSize(\n\t\t\t\tfill == null\n\t\t\t\t\t? ObservableMath.ZeroSize\n\t\t\t\t\t: fill.DesiredSize));\n\t}\n\t\tSize<IObservable<Points>> DesiredSize(Size<IObservable<Points>> fillSize)\n\t\t{\n\t\t\tvar u = _edge.NormalAxis();\n\t\t\tvar v = u.Opposite();\n\n\t\t\tif (!_control.HasValue)\n\t\t\t\treturn fillSize;\n\n\t\t\tfillSize = Size.Create(\n\t\t\t\t_control.Value.DesiredSize[u].Add(fillSize[u]),\n\t\t\t\t_control.Value.DesiredSize[v].Max(fillSize[v]),\n\t\t\t\tfirstAxis: u);\n\n\t\t\tif (!_parent.HasValue)\n\t\t\t\treturn fillSize;\n\n\t\t\treturn _parent.Value.DesiredSize(fillSize);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/Grid.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl DirectionalGrid(this IObservable<IEnumerable<IControl>> controls, Axis2D axis, int numSegments)\n\t\t{\n\t\t\tif(numSegments <= 0)\n\t\t\t\tthrow new ArgumentException(\"Segment count must higher than '0'\", \"numSegments\");\n\n\t\t\treturn controls.Select(\n\t\t\t\t\tctrls =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar segments = new List<IControl>[numSegments];\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\tforeach (var item in ctrls)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar idx = i % numSegments;\n\t\t\t\t\t\t\tif (segments[idx] == null)\n\t\t\t\t\t\t\t\tsegments[idx] = new List<IControl>();\n\t\t\t\t\t\t\tsegments[idx].Add(item);\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar stacks = segments.Select(\n\t\t\t\t\t\t\tl => l == null\n\t\t\t\t\t\t\t\t? Control.Empty\n\t\t\t\t\t\t\t\t: Stack(axis == Axis2D.Horizontal ? Direction2D.TopToBottom : Direction2D.LeftToRight, l)\n\t\t\t\t\t\t).ToImmutableList();\n\n\t\t\t\t\t\treturn Subdivide(axis, stacks);\n\t\t\t\t\t})\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Layout/Layer.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Overlay\n\t{\n\t\tpublic static IControl WithBackground(this IControl control, Brush background)\n\t\t{\n\t\t\treturn control.WithBackground(Shapes.Rectangle(fill: background));\n\t\t}\n\n\t\tpublic static IControl WithBackground(this IControl foreground, IControl background)\n\t\t{\n\t\t\treturn Layout\n\t\t\t\t.Layer(background, foreground)\n\t\t\t\t.WithSize(foreground.DesiredSize);\n\t\t}\n\n\t\tpublic static IControl WithOverlay(this IControl background, IControl foreground)\n\t\t{\n\t\t\treturn Layout\n\t\t\t\t.Layer(background, foreground)\n\t\t\t\t.WithSize(background.DesiredSize);\n\t\t}\n\n\t\tstatic Func<IControl, IControl, IControl> _factory;\n\n\t\tpublic static void Initialize(Func<IControl, IControl, IControl> factory)\n\t\t{\n\t\t\t_factory = factory;\n\t\t}\n\n\t\tpublic static IControl WithNativeOverlay(this IControl background, IControl foreground)\n\t\t{\n\t\t\treturn (_factory ?? WithOverlay)(background, foreground);\n\t\t}\n\t}\n\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl Layer(params IControl[] layers)\n\t\t{\n\t\t\treturn Layer((IEnumerable<IControl>) layers);\n\t\t}\n\n\t\tpublic static IControl Layer(this IEnumerable<IControl> layers)\n\t\t{\n\t\t\treturn Implementation.LayerControls(_ => Observable.Return(layers.ToImmutableList()));\n\t\t}\n\n\t\tpublic static IControl Layer(this IObservable<IEnumerable<IControl>> layers)\n\t\t{\n\t\t\treturn Implementation.LayerControls(_ => layers.Select(ImmutableList.ToImmutableList));\n\t\t}\n\n\t\tpublic static IControl Layer(this Func<IMountLocation, IObservable<IEnumerable<IControl>>> layers)\n\t\t{\n\t\t\treturn Implementation.LayerControls(self => layers(self).Select(ImmutableList.ToImmutableList));\n\t\t}\n\n\t\tpublic static IControl Layer(Func<IMountLocation, IEnumerable<IControl>> layers)\n\t\t{\n\t\t\treturn Implementation.LayerControls(self => Observable.Return(layers(self).ToImmutableList()));\n\t\t}\n\n\t\tpublic static IControl Layer(Func<IObservable<bool>, Size<IObservable<Points>>, Rectangle<IObservable<Points>>, IEnumerable<IControl>> layers)\n\t\t{\n\t\t\treturn Implementation.LayerControls(self => Observable.Return(layers(self.IsRooted, self.AvailableSize, self.NativeFrame).ToImmutableList()));\n\t\t}\n\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<Func<IMountLocation,  IObservable<IImmutableList<IControl>>>, IControl> LayerControls;\n\n\t\t\tstatic Implementation()\n\t\t\t{\n\t\t\t\tLayerControls = layers => Control.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tlayers(self).DiffSequence().Subscribe(\n\t\t\t\t\t\tdiff =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach (var child in diff.Removed.Reverse())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchild.Mount(MountLocation.Unmounted);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach (var child in diff.Added)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchild.Mount(self);\n\n\t\t\t\t\t\t\t\tvar lol = child.NativeHandle;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\treturn null;\n\t\t\t\t});\n\n\t\t\t}\n\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/LayoutTracker.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class LayoutTracker\n\t{\n\t\tpublic static IControl Create(Func<ILayoutTracker, IControl> content)\n\t\t{\n\t\t\treturn Implementation(content);\n\t\t}\n\n\t\tpublic static Func<Func<ILayoutTracker,IControl>,IControl> Implementation;\n\t}\n\n\tpublic interface ILayoutTracker\n\t{\n\t\t/// <summary>\n\t\t/// Wraps the content parameter to notify the frame parameter of where\n\t\t/// it is on the screen, relative to this LayoutTracker\n\t\t/// </summary>\n\t\tIControl TrackVisualBounds(Action<Rectangle<Points>> frame, IControl content);\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/ObservableMath.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ObservableMath\n\t{\n\t\tpublic static Rectangle<IObservable<Points>> RectangleWithSize(Size<IObservable<Points>> size)\n\t\t{\n\t\t\treturn Rectangle.FromPositionSize(Zero,Zero, size.Width, size.Height);\n\t\t}\n\n\t\t//public static IObservable<Points> Cycle(double from, double to)\n\t\t//{\n\t\t//\tvar len = (to - from);\n\t\t//\treturn Application.PerFrame.Select(t => new Points(Math.Sin(t * 100.0f) * len + len / 2.0));\n\t\t//}\n\n\t\tpublic static readonly IObservable<Points> Zero = Observable.Return(new Points(0));\n\t\tpublic static readonly Point<IObservable<Points>> ZeroPoint = Point.Create(Zero, Zero);\n\t\tpublic static readonly Size<IObservable<Points>> ZeroSize = Size.Create(Zero, Zero);\n\t\tpublic static readonly Rectangle<IObservable<Points>> ZeroRectangle = Rectangle.FromPositionSize(Zero, Zero, Zero, Zero);\n\n\t\tpublic static readonly IObservable<Points> Never = Observable.Never<Points>();\n\t\tpublic static readonly Point<IObservable<Points>> NeverPoint = Point.Create(Never, Never);\n\t\tpublic static readonly Size<IObservable<Points>> NeverSize = Size.Create(Never, Never);\n\t\tpublic static readonly Rectangle<IObservable<Points>> NeverRectangle = Rectangle.FromPositionSize(Never, Never, Never, Never);\n\n\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/Scissor.cs",
    "content": "namespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl ScissorLeft(this IControl content, Points points)\n\t\t{\n\t\t\treturn content.Scissor(RectangleEdge.Left, points);\n\t\t}\n\n\t\tpublic static IControl ScissorRight(this IControl content, Points points)\n\t\t{\n\t\t\treturn content.Scissor(RectangleEdge.Right, points);\n\t\t}\n\n\t\tpublic static IControl ScissorTop(this IControl content, Points points)\n\t\t{\n\t\t\treturn content.Scissor(RectangleEdge.Top, points);\n\t\t}\n\n\t\tpublic static IControl ScissorBottom(this IControl content, Points points)\n\t\t{\n\t\t\treturn content.Scissor(RectangleEdge.Bottom, points);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Cuts away a part of the control\n\t\t/// </summary>\n\t\t/// <param name=\"content\">The content to cut from</param>\n\t\t/// <param name=\"edge\">From which side of the content to cut from</param>\n\t\t/// <param name=\"points\">How much to cut, measured as the dimension of the cut away area orthogonal to edge</param>\n\t\t/// <returns>A visually clipped control (desiring points less size)</returns>\n\t\tpublic static IControl Scissor(this IControl content, RectangleEdge edge, Points points)\n\t\t{\n\t\t\tedge = edge.FlipVerticallyOnMac();\n\n\t\t\treturn content\n\t\t\t\t.WithFrame(f => f.WithEdge(edge, f.GetEdge(edge).Add(edge.IsMinimal() ? new Points(-points) : points)))\n\t\t\t\t.Clip()\n\t\t\t\t.WithDimension(edge.NormalAxis(), content.DesiredSize[edge.NormalAxis()].Sub(points))\n\t\t\t\t;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/Stack.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl StackFromTop(this IObservable<IEnumerable<IControl>> controls, Func<IControl> separator = null)\n\t\t{\n\t\t\tif (separator != null) controls = controls.Select(c => c.Join(separator));\n\t\t\treturn Stack(Direction2D.TopToBottom, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromTop(IEnumerable<IControl> controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.TopToBottom, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromTop(params IControl[] controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.TopToBottom, controls);\n\t\t}\n\n\n\t\tpublic static IControl StackFromBottom(this IObservable<IEnumerable<IControl>> controls, Func<IControl> separator = null)\n\t\t{\n\t\t\tif (separator != null) controls = controls.Select(c => c.Join(separator));\n\t\t\treturn Stack(Direction2D.BottomToTop, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromBottom(IEnumerable<IControl> controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.BottomToTop, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromBottom(params IControl[] controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.BottomToTop, controls);\n\t\t}\n\n\n\t\tpublic static IControl StackFromLeft(this IObservable<IEnumerable<IControl>> controls, Func<IControl> separator = null)\n\t\t{\n\t\t\tif (separator != null) controls = controls.Select(c => c.Join(separator));\n\t\t\treturn Stack(Direction2D.LeftToRight, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromLeft(IEnumerable<IControl> controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.LeftToRight, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromLeft(params IControl[] controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.LeftToRight, controls);\n\t\t}\n\n\n\t\tpublic static IControl StackFromRight(this IObservable<IEnumerable<IControl>> controls, Func<IControl> separator = null)\n\t\t{\n\t\t\tif (separator != null) controls = controls.Select(c => c.Join(separator));\n\t\t\treturn Stack(Direction2D.RightToLeft, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromRight(IEnumerable<IControl> controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.RightToLeft, controls);\n\t\t}\n\n\t\tpublic static IControl StackFromRight(params IControl[] controls)\n\t\t{\n\t\t\treturn Stack(Direction2D.RightToLeft, controls);\n\t\t}\n\n\n\t\tpublic static IControl Stack(Direction2D direction, IEnumerable<IControl> controls)\n\t\t{\n\t\t\treturn Stack(direction, controls.ToArray());\n\t\t}\n\n\t\tpublic static IControl Stack(Direction2D direction, params IControl[] controls)\n\t\t{\n\t\t\treturn Stack(direction, Observable.Return(controls));\n\t\t}\n\n\t\tpublic static IControl Stack(Direction2D direction, IObservable<IEnumerable<IControl>> controls)\n\t\t{\n\t\t\treturn Stack(direction, controls.Select(d => d.ToArray()));\n\t\t}\n\n\t\tpublic static IControl Stack(Direction2D direction, IObservable<IControl[]> controls)\n\t\t{\n\t\t\tcontrols = controls.Replay(1).RefCount();\n\n\t\t\tvar edge = (RectangleEdge) direction;\n\t\t\tedge = edge.FlipVerticallyOnMac();\n\n\t\t\tvar u = edge.NormalAxis();\n\t\t\tvar v = u.Opposite();\n\n\t\t\treturn Layer(self =>\n\t\t\t\t{\n\t\t\t\t\treturn controls\n\t\t\t\t\t\t.Scan(\n\t\t\t\t\t\t\tnew { framedControls = (IControl[]) null, cache = ImmutableDictionary<IControl, StackItem>.Empty },\n\t\t\t\t\t\t\t(state, currentControls) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar frame = ObservableMath.RectangleWithSize(self.NativeFrame.Size);\n\n\t\t\t\t\t\t\t\tvar top = frame.GetEdge(edge);\n\n\t\t\t\t\t\t\t\tvar newCache = ImmutableDictionary.CreateBuilder<IControl, StackItem>();\n\t\t\t\t\t\t\t\tvar framedControls = new IControl[currentControls.Length];\n\t\t\t\t\t\t\t\tfor (int i = 0; i < currentControls.Length; i++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar c = currentControls[i];\n\t\t\t\t\t\t\t\t\tStackItem stackItem;\n\t\t\t\t\t\t\t\t\tif (!state.cache.TryGetValue(c, out stackItem))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstackItem = new StackItem(c, frame, u);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnewCache.Add(c, stackItem);\n\n\t\t\t\t\t\t\t\t\tvar bottom = edge.IsMinimal()\n\t\t\t\t\t\t\t\t\t\t? top.Add(c.DesiredSize[u])\n\t\t\t\t\t\t\t\t\t\t: top.Sub(c.DesiredSize[u]);\n\n\t\t\t\t\t\t\t\t\tbottom = bottom\n\t\t\t\t\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t\t\t\t\t.Replay(1).RefCount();\n\n\t\t\t\t\t\t\t\t\tvar res = edge.IsMinimal()\n\t\t\t\t\t\t\t\t\t\t? Interval.FromOffsetLength(top, c.DesiredSize[u])\n\t\t\t\t\t\t\t\t\t\t: Interval.FromOffsetLength(bottom, c.DesiredSize[u]);\n\n\t\t\t\t\t\t\t\t\tstackItem.UpdateUAxis(res);\n\n\t\t\t\t\t\t\t\t\ttop = bottom;\n\n\t\t\t\t\t\t\t\t\tframedControls[i] = stackItem.Control;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn new { framedControls, cache = newCache.ToImmutable() };\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.Select(x => x.framedControls)\n\t\t\t\t\t\t\t.Replay(1)\n\t\t\t\t\t\t\t.RefCount();\n\t\t\t\t})\n\t\t\t\t.WithSize(desiredSize:\n\t\t\t\t\tSize.Create(\n\t\t\t\t\t\tcontrols.Select(s => s.Select(ss => ss.DesiredSize[u]))\n\t\t\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t\t\t.Select(l => new Points(l.ConcatOne(0).Sum(p => p.Value))),\n\t\t\t\t\t\tcontrols.Select(s => s.Select(ss => ss.DesiredSize[v]))\n\t\t\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t\t\t.Select(l => new Points(l.ConcatOne(0).Max(p => p.Value))),\n\t\t\t\t\t\tfirstAxis: u));\n\n\t\t}\n\n\t\tclass StackItem\n\t\t{\n\t\t\treadonly IControl _control;\n\t\t\treadonly Interval<ReplaySubject<IObservable<Points>>> _frameUAxis;\n\n\t\t\tpublic IControl Control\n\t\t\t{\n\t\t\t\tget { return _control; }\n\t\t\t}\n\n\t\t\tpublic void UpdateUAxis(Interval<IObservable<Points>> res)\n\t\t\t{\n\t\t\t\t_frameUAxis.Offset.OnNext(res.Offset);\n\t\t\t\t_frameUAxis.Length.OnNext(res.Length);\n\t\t\t}\n\n\t\t\tpublic StackItem(IControl control, Rectangle<IObservable<Points>> stackFrame, Axis2D u)\n\t\t\t{\n\t\t\t\t_frameUAxis = new Interval<ReplaySubject<IObservable<Points>>>(\n\t\t\t\t\tnew ReplaySubject<IObservable<Points>>(1),\n\t\t\t\t\tnew ReplaySubject<IObservable<Points>>(1));\n\n\t\t\t\tvar frameUAxisSwitched = _frameUAxis.Select(x => x.Switch().DistinctUntilChanged().Replay(1).RefCount());\n\t\t\t\t_control = control.WithFrame(stackFrame.WithAxis(u, frameUAxisSwitched));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/Subdivide.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl Subdivide(Axis2D axis, params IControl[] divisions)\n\t\t{\n\t\t\treturn Subdivide(axis, divisions.Select(d => new Subdivision(d, 1)).ToImmutableList());\n\t\t}\n\n\t\tpublic static IControl Subdivide(Axis2D axis, IImmutableList<IControl> divisions)\n\t\t{\n\t\t\treturn Subdivide(axis, divisions.Select(d => new Subdivision(d, 1)).ToImmutableList());\n\t\t}\n\n\t\tpublic static IControl SubdivideHorizontally(IObservable<IEnumerable<IControl>> divisions)\n\t\t{\n\t\t\treturn divisions.Select(d => Subdivide(Axis2D.Horizontal, d.ToImmutableList())).Switch();\n\t\t}\n\n\t\tpublic static IControl SubdivideHorizontally(params IControl[] divisions)\n\t\t{\n\t\t\treturn Subdivide(Axis2D.Horizontal, divisions.ToImmutableList());\n\t\t}\n\n\t\tpublic static IControl SubdivideHorizontally(params Subdivision[] divisions)\n\t\t{\n\t\t\treturn Subdivide(Axis2D.Horizontal, divisions.ToImmutableList());\n\t\t}\n\n\t\tpublic static IControl SubdivideHorizontallyWithSeparator(IControl separator, params IControl[] divisions)\n\t\t{\n\t\t\tvar divs = new IControl[divisions.Length];\n\t\t\tfor (var d = 0; d < divisions.Length - 1; ++d)\n\t\t\t{\n\t\t\t\tdivs[d] = Dock().Right(separator).Fill(divisions[d]);\n\t\t\t}\n\t\t\tdivs[divisions.Length - 1] = divisions[divisions.Length - 1];\n\t\t\treturn SubdivideHorizontally(divs);\n\t\t}\n\n\t\tpublic static IControl SubdivideVertically(params IControl[] divisions)\n\t\t{\n\t\t\treturn Subdivide(Axis2D.Vertical, divisions.ToImmutableList());\n\t\t}\n\n\t\tpublic static IControl SubdivideVertically(params Subdivision[] divisions)\n\t\t{\n\t\t\treturn Subdivide(Axis2D.Vertical, divisions.ToImmutableList());\n\t\t}\n\n\t\tpublic static IControl Subdivide(Axis2D axis, params Subdivision[] divisions)\n\t\t{\n\t\t\treturn Subdivide(axis, divisions.ToImmutableList());\n\t\t}\n\n\t\tpublic static IControl Subdivide(Axis2D axis, IImmutableList<Subdivision> divisions)\n\t\t{\n\t\t    if (axis == Axis2D.Vertical && Platform.IsMac)\n\t\t        divisions = divisions.Reverse().ToImmutableList();\n\n\t\t\tvar u = axis;\n\t\t\tvar v = axis.Opposite();\n\n\t\t\tvar sizesV = divisions.Select(d => d.Control.DesiredSize[v]);\n\n\t\t\treturn Layer((isRooted, availableSize, parentFrame) =>\n\t\t\t\t{\n\t\t\t\t\tvar frame = ObservableMath.RectangleWithSize(parentFrame.Size);\n\n\t\t\t\t\tvar columns = divisions.Select(d => d.Span).ToArray();\n\t\t\t\t\tvar intervals = frame[axis].Subdivide(columns);\n\t\t\t\t\tvar columnCount = columns.Sum();\n\n\t\t\t\t\tvar tmp = new IControl[intervals.Length];\n\t\t\t\t\tfor (int i = 0; i < intervals.Length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar span = divisions[i].Span;\n\t\t\t\t\t\tvar ratio = span / columnCount;\n\t\t\t\t\t\tvar node = divisions[i].Control;\n\t\t\t\t\t\ttmp[i] = node.WithFrame(\n\t\t\t\t\t\t\tframe.WithAxis(axis, intervals[i]),\n\t\t\t\t\t\t\tavailableSize.WithAxis(axis, ov => ov.Mul(ratio)));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn tmp;\n\t\t\t\t})\n\t\t\t\t.WithSize(desiredSize: Size.Create(\n\t\t\t\t\tObservable.Return<Points>(0),\n\t\t\t\t\tsizesV.Aggregate(Observable.Return<Points>(0), (a, b) => a.Max(b)),\n\t\t\t\t\tfirstAxis: u));\n\t\t}\n\n\t\tpublic static Subdivision Span(this IControl control, double span)\n\t\t{\n\t\t\treturn new Subdivision(control, span);\n\t\t}\n\t}\n\n\tpublic sealed class Subdivision\n\t{\n\t\tpublic readonly IControl Control;\n\t\tpublic readonly double Span;\n\n\t\tpublic Subdivision(IControl control, double span)\n\t\t{\n\t\t\tControl = control;\n\t\t\tSpan = span;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/Switch.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl ToControl<T>(this IObservable<T> content, Func<T, IControl> select)\n\t\t{\n\t\t\treturn content.DistinctUntilChanged().Select(select).Switch();\n\t\t}\n\n\t\tpublic static IControl Switch(this IObservable<IControl> content)\n\t\t{\n\t\t\tcontent = content\n\t\t\t\t//.StartWith(Control.Empty)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\n\t\t\tvar size = content\n\t\t\t\t.Switch(n => n.DesiredSize)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1).RefCount()\n\t\t\t\t;\n\n\t\t\treturn Layer(content.Select(ImmutableList.Create)).WithSize(size);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/WithFixedPosition.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Transformation\n\t{\n\t\tpublic static IControl WithFixedPosition(this IControl control, Rectangle<IObservable<Points>> frame)\n\t\t{\n\t\t\tif (_withFixedPositionFactory != null)\n\t\t\t\treturn _withFixedPositionFactory(control, frame);\n\n\t\t\treturn control.WithFrame(frame);\n\t\t}\n\n\t\tstatic Func<IControl, Rectangle<IObservable<Points>>, IControl> _withFixedPositionFactory;\n\t\tpublic static void Initialize(Func<IControl, Rectangle<IObservable<Points>>, IControl> factory)\n\t\t{\n\t\t\t_withFixedPositionFactory = factory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/WithPadding.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl WithPadding(\n\t\t\tthis IControl control,\n\t\t\tIObservable<Thickness<Points>> frame)\n\t\t{\n\t\t\treturn control.WithPadding(\n\t\t\t\tframe.Select(f => f.Left),\n\t\t\t\tframe.Select(f => f.Top),\n\t\t\t\tframe.Select(f => f.Right),\n\t\t\t\tframe.Select(f => f.Bottom));\n\t\t}\n\n\t\tpublic static IControl WithPadding(\n\t\t\tthis IControl control,\n\t\t\tThickness<Points> thickness)\n\t\t{\n\t\t\treturn control.WithPadding(\n\t\t\t\tthickness.Left,\n\t\t\t\tthickness.Top,\n\t\t\t\tthickness.Right,\n\t\t\t\tthickness.Bottom);\n\t\t}\n\n\t\tpublic static IControl WithPadding(\n\t\t\tthis IControl control,\n\t\t\tOptional<Points> left = default(Optional<Points>),\n\t\t\tOptional<Points> top = default(Optional<Points>),\n\t\t\tOptional<Points> right = default(Optional<Points>),\n\t\t\tOptional<Points> bottom = default(Optional<Points>))\n\t\t{\n\t\t\treturn control.WithPadding(\n\t\t\t\tleft.Select(Observable.Return).OrDefault(),\n\t\t\t\ttop.Select(Observable.Return).OrDefault(),\n\t\t\t\tright.Select(Observable.Return).OrDefault(),\n\t\t\t\tbottom.Select(Observable.Return).OrDefault());\n\t\t}\n\n\t\tpublic static IControl WithPadding(\n\t\t\tthis IControl control,\n\t\t\tFunc<IControl, IObservable<Points>> left = null,\n\t\t\tFunc<IControl, IObservable<Points>> top = null,\n\t\t\tFunc<IControl, IObservable<Points>> right = null,\n\t\t\tFunc<IControl, IObservable<Points>> bottom = null)\n\t\t{\n\t\t\treturn control.WithPadding(\n\t\t\t\tleft == null ? null : left(control),\n\t\t\t\ttop == null ? null : top(control),\n\t\t\t\tright == null ? null : right(control),\n\t\t\t\tbottom == null ? null : bottom(control));\n\t\t}\n\n\t\tpublic static IControl WithPadding(\n\t\t\tthis IControl control,\n\t\t\tIObservable<Points> left = null,\n\t\t\tIObservable<Points> top = null,\n\t\t\tIObservable<Points> right = null,\n\t\t\tIObservable<Points> bottom = null)\n\t\t{\n\t\t\tvar tmp = Thickness\n\t\t\t\t.Create(left, top, right, bottom)\n\t\t\t\t.FlipVerticallyOnMac();\n\n\t\t\tleft = tmp.Left;\n\t\t\ttop = tmp.Top;\n\t\t\tright = tmp.Right;\n\t\t\tbottom = tmp.Bottom;\n\n\t\t\tcontrol = control.WithFrame(\n\t\t\t\tframe =>\n\t\t\t\t{\n\t\t\t\t\tif (left != null)   frame = Rectangle.FromPositionSize(frame.Position.X.Add(left), frame.Position.Y,          frame.Width.Sub(left),  frame.Height);\n\t\t\t\t\tif (top != null)    frame = Rectangle.FromPositionSize(frame.Position.X,           frame.Position.Y.Add(top), frame.Width,            frame.Height.Sub(top));\n\t\t\t\t\tif (right != null)  frame = Rectangle.FromPositionSize(frame.Position.X,           frame.Position.Y,          frame.Width.Sub(right), frame.Height);\n\t\t\t\t\tif (bottom != null) frame = Rectangle.FromPositionSize(frame.Position.X,           frame.Position.Y,          frame.Width,            frame.Height.Sub(bottom));\n\t\t\t\t\treturn frame;\n\t\t\t\t},\n\t\t\t\tavailableSize =>\n\t\t\t\t{\n\t\t\t\t\tif (left != null)   availableSize = availableSize.WithAxis(Axis2D.Horizontal, p => p.Sub(left));\n\t\t\t\t\tif (top != null)    availableSize = availableSize.WithAxis(Axis2D.Vertical,   p => p.Sub(top));\n\t\t\t\t\tif (right != null)  availableSize = availableSize.WithAxis(Axis2D.Horizontal, p => p.Sub(right));\n\t\t\t\t\tif (bottom != null) availableSize = availableSize.WithAxis(Axis2D.Vertical,   p => p.Sub(bottom));\n\t\t\t\t\treturn availableSize;\n\t\t\t\t});\n\n\t\t\tvar desiredSize = control.DesiredSize;\n\n\t\t\tif (left != null)   desiredSize = desiredSize.WithAxis(Axis2D.Horizontal, p => p.Add(left));\n\t\t\tif (top != null)    desiredSize = desiredSize.WithAxis(Axis2D.Vertical,   p => p.Add(top));\n\t\t\tif (right != null)  desiredSize = desiredSize.WithAxis(Axis2D.Horizontal, p => p.Add(right));\n\t\t\tif (bottom != null) desiredSize = desiredSize.WithAxis(Axis2D.Vertical,   p => p.Add(bottom));\n\n\t\t\treturn control.WithSize(desiredSize);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/WithTransformation.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Transformation\n\t{\n\t\tpublic static IControl WithTransformation(this IControl control, IObservable<Matrix> matrix)\n\t\t{\n\t\t\treturn _withTransformationFactory(control, matrix);\n\t\t}\n\n\t\tstatic Func<IControl, IObservable<Matrix>, IControl> _withTransformationFactory;\n\t\tpublic static void Initialize(Func<IControl, IObservable<Matrix>, IControl> factory)\n\t\t{\n\t\t\t_withTransformationFactory = factory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Layout/Wrap.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Layout\n\t{\n\t\tpublic static IControl WrapInReadingOrder(this IObservable<IEnumerable<IControl>> controlsObservable, Func<IObservable<IEnumerable<IControl>>, IControl> rowFactory = null)\n\t\t{\n\t\t\treturn Control.BindAvailableSize(size =>\n\t\t\t{\n\t\t\t\tvar rowsObservable = controlsObservable.Switch(ctrls =>\n\t\t\t\t{\n\t\t\t\t\tvar controls = ctrls.ToArray();\n\n\t\t\t\t\tvar widthsObservable = controls\n\t\t\t\t\t\t.Select(c => c.DesiredSize.Width)\n\t\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t\t.Select(e => e.ToArray());\n\n\t\t\t\t\treturn Observable.CombineLatest(\n\t\t\t\t\t\twidthsObservable,\n\t\t\t\t\t\tsize.Width,\n\t\t\t\t\t\t(widths, availableWidth) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar rows = new List<List<IControl>>();\n\n\t\t\t\t\t\t\trows.Add(new List<IControl>());\n\t\t\t\t\t\t\tvar width = new Points(0);\n\n\t\t\t\t\t\t\tfor (int i = 0; i < controls.Length; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar row = rows[rows.Count - 1];\n\n\t\t\t\t\t\t\t\twidth += widths[i];\n\n\t\t\t\t\t\t\t\tvar wrap = (row.Count > 0) && (width > availableWidth);\n\t\t\t\t\t\t\t\tif (wrap)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\trows.Add(new List<IControl>());\n\t\t\t\t\t\t\t\t\twidth = new Points(0);\n\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\trow.Add(controls[i]);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn rows;\n\t\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\treturn StackFromTop(rowsObservable.PoolPerElement(rowFactory ?? (a => StackFromLeft(a))));\n\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// A two-dimensional grid layout whose number of columns is determined by the maximum width of the input controls.\n\t\t/// </summary>\n\t\tpublic static IControl GridWrap(this IObservable<IEnumerable<IControl>> controlsObservable)\n\t\t{\n\t\t\treturn Control.BindAvailableSize(size =>\n\t\t\t{\n\t\t\t\tvar columnsObservable = controlsObservable.Select(ctrls =>\n\t\t\t\t{\n\t\t\t\t\tvar controls = ctrls as IControl[] ?? ctrls.ToArray();\n\t\t\t\t\tvar maxWidth = controls\n\t\t\t\t\t\t.Select(c => c.DesiredSize.Width)\n\t\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t\t.Select(l => Math.Max(1, l.IsEmpty() ? 1 : l.Max()))\n\t\t\t\t\t\t.DistinctUntilChanged();\n\n\t\t\t\t\tvar controlsPerRow = Observable.CombineLatest(\n\t\t\t\t\t\tmaxWidth,\n\t\t\t\t\t\tsize.Width,\n\t\t\t\t\t\t(maxWidths, availableWidth) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar divisor = Math.Max(1, (int) (availableWidth / maxWidths));\n\t\t\t\t\t\t\treturn (controls.Length + (divisor-1)) / divisor;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.DistinctUntilChanged();\n\n\t\t\t\t\treturn controlsPerRow.Select(ctrlsPerRow => controls.Batch(ctrlsPerRow));\n\t\t\t\t})\n\t\t\t\t.Switch();\n\n\t\t\t\treturn SubdivideHorizontally(\n\t\t\t\t\tcolumnsObservable.SelectPerElement(StackFromTop));\n\t\t\t});\n\t\t}\n\n\t\tpublic static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> source, int batchSize)\n\t\t{\n\t\t\tusing (var enumerator = source.GetEnumerator())\n\t\t\t\twhile (enumerator.MoveNext())\n\t\t\t\t\tyield return YieldBatchElements(enumerator, batchSize);\n\t\t}\n\n\t\tprivate static IEnumerable<T> YieldBatchElements<T>(IEnumerator<T> source, int batchSize)\n\t\t{\n\t\t\tyield return source.Current;\n\t\t\tfor (int i = 1; i < batchSize && source.MoveNext(); ++i)\n\t\t\t\tyield return source.Current;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/Menus/Menu.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic struct Menu : IEquatable<Menu>\n\t{\n\t\tpublic static readonly Menu Empty = new Menu(ObservableList.Empty<MenuItem>());\n\n\t\tpublic static Menu operator +(Menu top, Menu bottom)\n\t\t{\n\t\t\tif (bottom._items == null)\n\t\t\t\treturn top;\n\n\t\t\treturn top._items.Match(\n\t\t\t\ttopList => bottom._items.Match(\n\t\t\t\t\tbottomList => new Menu(topList.AddRange(bottomList)),\n\t\t\t\t\tbottomObsList => new Menu(top.Items.Concat(bottomObsList))),\n\t\t\t\ttopObsList => new Menu(topObsList.Concat(bottom.Items)));\n\t\t}\n\n\t\tpublic static Menu Separator\n\t\t{\n\t\t\tget { return FromItem(MenuItem.CreateSeparator()); }\n\t\t}\n\n\t\tpublic static Menu Item(\n\t\t\tText name = default(Text),\n\t\t\tAction action = null,\n\t\t\tIObservable<bool> isEnabled = null,\n\t\t\tHotKey hotkey = default(HotKey),\n\t\t\tOptional<Icon> icon = default(Optional<Icon>),\n\t\t\tbool isDefault = false)\n\t\t{\n\t\t\treturn Item(name: name, command: Command.Create(isEnabled ?? Observable.Return(true), action), hotkey: hotkey, icon: icon, isDefault: isDefault);\n\t\t}\n\n\t\tpublic static Menu Item(\n\t\t\tText name = default(Text),\n\t\t\tOptional<Command> command = default(Optional<Command>),\n\t\t\tHotKey hotkey = default(HotKey),\n\t\t\tOptional<Icon> icon = default(Optional<Icon>),\n\t\t\tbool isDefault = false)\n\t\t{\n\t\t\treturn FromItem(MenuItem.Create(name: name, command: command, hotkey: hotkey, icon: Observable.Return(icon), isDefault: isDefault));\n\t\t}\n\n\t\tpublic static Menu Toggle(\n\t\t\tText name = default(Text),\n\t\t\tIProperty<bool> toggle = null,\n\t\t\tHotKey hotkey = default(HotKey),\n\t\t\tOptional<Icon> icon = default(Optional<Icon>),\n\t\t\tIObservable<bool> isEnabled = null)\n\t\t{\n\t\t\ttoggle = toggle ?? Property.Create(false);\n\t\t\treturn FromItem(MenuItem.Create(name: name, command: toggle.Toggle(), hotkey: hotkey, isToggled: toggle));\n\t\t}\n\n\t\tpublic static Menu Option<T>(\n\t\t\tT value,\n\t\t\tText name = default(Text),\n\t\t\tIProperty<T> property = null,\n\t\t\tHotKey hotkey = default(HotKey),\n\t\t\tIObservable<bool> isEnabled = null)\n\t\t{\n\t\t\tproperty = property ?? Property.Create(value);\n\t\t\treturn FromItem(MenuItem.Create(\n\t\t\t\t\tname: name,\n\t\t\t\t\tcommand: Command.Enabled(() => property.Write(value)),\n\t\t\t\t\thotkey: hotkey,\n\t\t\t\t\tisToggled: property.Select(p => p.Equals(value))));\n\t\t}\n\n\t\tpublic static Menu Submenu(\n\t\t\tText name,\n\t\t\tMenu submenu,\n\t\t\tOptional<Icon> icon = default(Optional<Icon>))\n\t\t{\n\t\t\treturn FromItem(MenuItem.Create(name: name, menu: submenu, icon: icon));\n\t\t}\n\n\t\tstatic Menu FromItem(MenuItem item)\n\t\t{\n\t\t\treturn new Menu(ImmutableList.Create(item));\n\t\t}\n\n\t\tinternal Menu(IObservableList<MenuItem> items)\n\t\t{\n\t\t\t_items = new Either<ImmutableList<MenuItem>, IObservableList<MenuItem>>(items);\n\t\t}\n\n\t\tinternal Menu(ImmutableList<MenuItem> items)\n\t\t{\n\t\t\t_items = new Either<ImmutableList<MenuItem>, IObservableList<MenuItem>>(items);\n\t\t}\n\n\t\treadonly Either<ImmutableList<MenuItem>, IObservableList<MenuItem>> _items;\n\n\t\tpublic IObservableList<MenuItem> Items\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _items == null\n\t\t\t\t\t? Empty.Items\n\t\t\t\t\t: _items.Match(ObservableList.Return, ol => ol);\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Equals(object o)\n\t\t{\n\t\t\treturn o is Menu && Equals((Menu)o);\n\t\t}\n\n\t\tpublic bool Equals(Menu other)\n\t\t{\n\t\t\treturn Items == other.Items;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Items.GetHashCode();\n\t\t}\n\n\t\tpublic static bool operator ==(Menu lhs, Menu rhs)\n\t\t{\n\t\t\treturn lhs.Equals(rhs);\n\t\t}\n\n\t\tpublic static bool operator !=(Menu lhs, Menu rhs)\n\t\t{\n\t\t\treturn !lhs.Equals(rhs);\n\t\t}\n\t}\n\n\tpublic static class MenuExtensions\n\t{\n\t\tpublic static Menu ConnectWhile(this Menu self, IObservable<bool> condition)\n\t\t{\n\t\t\treturn new Menu(self.Items.ConnectWhile(condition));\n\t\t}\n\n\t\tpublic static Menu ShowWhen(this Menu self, IObservable<bool> condition)\n\t\t{\n\t\t\treturn new Menu(condition.Switch(c => c ? self.Items : Menu.Empty.Items));\n\t\t}\n\n\t\tpublic static Menu Switch(this IObservable<Menu> menu)\n\t\t{\n\t\t\treturn new Menu(menu.Switch(m => m.Items));\n\t\t}\n\n\t\tpublic static Menu Concat(this IEnumerable<Menu> menus)\n\t\t{\n\t\t\treturn menus.Aggregate(Menu.Empty, (m1, m2) => m1 + m2);\n\t\t}\n\n\t\tpublic static Menu Concat(this IObservable<IEnumerable<Menu>> obsMenus)\n\t\t{\n\t\t\treturn obsMenus.Select(Concat).Switch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Menus/MenuItem.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic sealed class MenuItem\n\t{\n\t\tinternal static MenuItem CreateSeparator()\n\t\t{\n\t\t\treturn new MenuItem\n\t\t\t{\n\t\t\t\tName = \"-\",\n\t\t\t\tCommand = Command.Enabled(),\n\t\t\t\tMenu = Optional.None<Menu>(),\n\t\t\t\tIsToggled = Observable.Return(false),\n\t\t\t\tIsDefault = false,\n\t\t\t\tIsSeparator = true,\n\t\t\t};\n\t\t}\n\n\t\tinternal static MenuItem Create(\n\t\t\tText name,\n\t\t\tOptional<Command> command = default(Optional<Command>),\n\t\t\tHotKey hotkey = default(HotKey),\n\t\t\tIObservable<Optional<Icon>> icon = null,\n\t\t\tIObservable<bool> isToggled = null,\n\t\t\tbool isDefault = false)\n\t\t{\n\t\t\treturn new MenuItem\n\t\t\t{\n\t\t\t\tName = name,\n\t\t\t\tCommand = command.Or(Command.Enabled()),\n\t\t\t\tHotkey = hotkey,\n\t\t\t\tIcon = icon ?? Observable.Return(Optional.None<Icon>()),\n\t\t\t\tIsToggled = isToggled ?? Observable.Return(false),\n\t\t\t\tIsDefault = isDefault,\n\t\t\t};\n\t\t}\n\n\t\tinternal static MenuItem Create(\n\t\t\tText name,\n\t\t\tMenu menu,\n\t\t\tOptional<Icon> icon = default(Optional<Icon>))\n\t\t{\n\t\t\treturn new MenuItem\n\t\t\t{\n\t\t\t\tName = name,\n\t\t\t\tCommand = Command.Enabled(),\n\t\t\t\tHotkey = HotKey.None,\n\t\t\t\tIcon = Observable.Return(icon),\n\t\t\t\tMenu = Optional.Some(menu),\n\t\t\t\tIsToggled = Observable.Return(false),\n\t\t\t\tIsDefault = false\n\t\t\t};\n\t\t}\n\n\t\tMenuItem() { }\n\n\t\tpublic Text Name { get; private set; }\n\n\t\tpublic Command Command { get; private set; }\n\n\t\tpublic HotKey Hotkey { get; private set; }\n\n\t\tpublic IObservable<Optional<Icon>> Icon { get; private set; }\n\n\t\tpublic Optional<Menu> Menu { get; private set; }\n\n\t\tpublic bool IsDefault { get; private set; }\n\n\t\tpublic bool IsSeparator { get; private set; }\n\n\t\tpublic IObservable<bool> IsToggled { get; private set; }\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ModifierKeys.cs",
    "content": "using System;\n\nnamespace Outracks.Fusion\n{\n\t[Flags]\n\tpublic enum ModifierKeys\n\t{\n\t\tNone = 0,\n\t\tAlt = 1 << 0,\n\t\tControl = 1 << 1,\n\t\tShift = 1 << 2,\n\t\tWindows = 1 << 3,\n\t\tCommand = 1 << 3,\n\t\tMeta = 1 << 4,\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/ObservableList/IConnectableObservableList.cs",
    "content": "﻿using System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface IConnectableObservableList<out T> : IObservableList<T>, IConnectableObservable<ListChange<T>>\n\t{\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/IListBehavior.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface IListBehavior<out T> : IObservableList<T>\n\t{\n\t\tIReadOnlyList<T> Value { get; }\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/IListObserver.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface IListObserver<in T> : IObserver<ListChange<T>>\n\t{\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/IListSubject.cs",
    "content": "﻿namespace Outracks.Fusion\n{\n\tpublic interface IListSubject<T> : IListObserver<T>, IObservableList<T>\n\t{\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/IObservableList.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface IObservableList<out T> : IObservable<ListChange<T>>\n\t{\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/ListBehaviorSubject.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic class ListBehaviorSubject<T> : IListSubject<T>, IDisposable, IListBehavior<T>\n\t{\n\t\treadonly object _mutex = new object();\n\t\tImmutableList<T> _value;\n\t\tpublic IReadOnlyList<T> Value\n\t\t{\n\t\t\tget { return _value; }\n\t\t}\n\t\treadonly Subject<ListChange<T>> _subject;\n\n\t\tpublic ListBehaviorSubject()\n\t\t{\n\t\t\t_value = ImmutableList<T>.Empty;\n\t\t\t_subject = new Subject<ListChange<T>>();\n\t\t}\n\n\t\tpublic ListBehaviorSubject(IEnumerable<T> value)\n\t\t\t: this()\n\t\t{\n\t\t\tvar change = ListChange.Combine(value.Select((item, index) => ListChange.Insert(index, item)).ToArray());\n\t\t\tOnNext(change);\n\t\t}\n\n\t\tpublic void OnNext(ListChange<T> change)\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t{\n\t\t\t\t_value = change.Apply(_value);\n\t\t\t\t_subject.OnNext(change);\n\t\t\t}\n\t\t}\n\n\t\tpublic void OnInsert(int index, T item)\n\t\t{\n\t\t\tOnNext(ListChange.Insert(index, item));\n\t\t}\n\n\t\tpublic T this[int i]\n\t\t{\n\t\t\tget { return _value[i]; }\n\t\t\tset { OnNext(ListChange.Replace(i, value)); }\n\t\t}\n\n\t\tpublic void OnAdd(T item)\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t\tOnNext(ListChange.Insert(_value.Count, item));\n\t\t}\n\n\t\tpublic void OnRemove(int index)\n\t\t{\n\t\t\tOnNext(ListChange.Remove<T>(index));\n\t\t}\n\n\t\tpublic void OnReplace(int index, T item)\n\t\t{\n\t\t\tOnNext(ListChange.Replace(index, item));\n\t\t}\n\n\t\tpublic void OnClear()\n\t\t{\n\t\t\tOnNext(ListChange.Clear<T>());\n\t\t}\n\n\t\tpublic void OnError(Exception error)\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t\t_subject.OnError(error);\n\t\t}\n\n\t\tpublic void OnCompleted()\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t\t_subject.OnCompleted();\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t{\n\t\t\t\tvar change = ListChange.Combine(_value.Select((item, index) => ListChange.Insert(index, item)).ToArray());\n\t\t\t\tobserver.OnNext(change);\n\n\t\t\t\treturn _subject.Subscribe(observer);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t\t_subject.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/ListChange.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic delegate void ListChange<out T>(Action<int, T> insert, Action<int, T> replace, Action<int> remove, Action clear);\n\n\tpublic static class ListChange\n\t{\n\t\tpublic static ListChange<T> None<T>()\n\t\t{\n\t\t\treturn (insert, replace, remove, clear) => { };\n\t\t}\n\n\t\tpublic static ListChange<T> Insert<T>(int index, T item)\n\t\t{\n\t\t\treturn (insert, replace, remove, clear) => insert(index, item);\n\t\t}\n\n\t\tpublic static ListChange<T> Replace<T>(int index, T item)\n\t\t{\n\t\t\treturn (insert, replace, remove, clear) => replace(index, item);\n\t\t}\n\n\t\tpublic static ListChange<T> Remove<T>(int index)\n\t\t{\n\t\t\treturn (insert, replace, remove, clear) => remove(index);\n\t\t}\n\n\t\tpublic static ListChange<T> Clear<T>()\n\t\t{\n\t\t\treturn (insert, replace, remove, clear) => clear();\n\t\t}\n\n\t\tpublic static ListChange<T> Combine<T>(IEnumerable<ListChange<T>> changes)\n\t\t{\n\t\t\treturn Combine(changes.ToArray());\n\t\t}\n\n\t\tpublic static ListChange<T> Combine<T>(params ListChange<T>[] changes)\n\t\t{\n\t\t\tif (changes.Length == 0)\n\t\t\t\treturn None<T>();\n\t\t\tif (changes.Length == 1)\n\t\t\t\treturn changes[0];\n\t\t\treturn (insert, replace, remove, clear) =>\n\t\t\t{\n\t\t\t\tforeach (var change in changes)\n\t\t\t\t\tchange(insert, replace, remove, clear);\n\t\t\t};\n\t\t}\n\n\t\tpublic static ListChange<TResult> Select<TSource, TResult>(this ListChange<TSource> self, Func<TSource, TResult> select)\n\t\t{\n\t\t\treturn (insert, replace, remove, clear) =>\n\t\t\t\tself(\n\t\t\t\t\tinsert: (i, x) => insert(i, select(x)),\n\t\t\t\t\treplace: (i, x) => replace(i, select(x)),\n\t\t\t\t\tremove: remove,\n\t\t\t\t\tclear: clear);\n\t\t}\n\n\t\tpublic static string ToString<T>(this ListChange<T> self)\n\t\t{\n\t\t\tvar results = new List<string>();\n\n\t\t\tself(\n\t\t\t\tinsert: (index, item) => results.Add(\"ListChange.Insert(\" + index + \", \" + item + \")\"),\n\t\t\t\treplace: (index, item) => results.Add(\"ListChange.Replace(\" + index + \", \" + item + \")\"),\n\t\t\t\tremove: index => results.Add(\"ListChange.Remove(\" + index + \")\"),\n\t\t\t\tclear: () => results.Add(\"ListChange.Clear()\"));\n\n\t\t\tif (results.Count == 0)\n\t\t\t\treturn \"ListChange.None()\";\n\t\t\tif (results.Count == 1)\n\t\t\t\treturn results[0];\n\t\t\treturn \"ListChange.Combine(\" + results.Join(\", \") + \")\";\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the changes, if any, necessary to perform on oldElements to get it\n\t\t/// to the same shape as newList, using the update function to check and\n\t\t/// perform updates to the old list elements using the new elements, and\n\t\t/// using the create function to create new elements from the new.\n\t\t/// </summary>\n\t\t/// <param name=\"oldElements\"></param>\n\t\t/// <param name=\"newList\"></param>\n\t\t/// <param name=\"update\">\n\t\t/// Should return true when the T can be updated from TNew and, if necessary,\n\t\t/// update (by mutation) the T using TNew\n\t\t/// </param>\n\t\t/// <param name=\"create\">\n\t\t/// Creates a T element from a TNew element in newList for which no matching\n\t\t/// element was found in oldElements.\n\t\t/// </param>\n\t\tpublic static Optional<ListChange<T>> IncrementalChanges<T, TNew>(\n\t\t\tIEnumerable<T> oldElements,\n\t\t\tIReadOnlyList<TNew> newList,\n\t\t\tFunc<T, TNew, bool> update,\n\t\t\tFunc<TNew, T> create)\n\t\t{\n\t\t\tvar oldList = oldElements.ToList();\n\n\t\t\tif (!oldList.IsEmpty() && newList.IsEmpty())\n\t\t\t\treturn Clear<T>();\n\n\t\t\tvar updates = new BitArray(newList.Count);\n\n\t\t\tvar result = new List<ListChange<T>>();\n\n\t\t\t{\n\t\t\t\tvar oldIndex = 0;\n\t\t\t\tvar newIndex = 0;\n\t\t\t\twhile (oldIndex < oldList.Count)\n\t\t\t\t{\n\t\t\t\t\tvar found = false;\n\t\t\t\t\tfor (var i = newIndex; i < newList.Count; ++i)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar didUpdate = update(oldList[oldIndex], newList[i]);\n\n\t\t\t\t\t\t// Matching element found: Keep it\n\t\t\t\t\t\tif (didUpdate)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tupdates[i] = true;\n\t\t\t\t\t\t\tnewIndex = i + 1;\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (found)\n\t\t\t\t\t{\n\t\t\t\t\t\t++oldIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// No element found: Remove it\n\t\t\t\t\t\tresult.Add(Remove<T>(oldIndex));\n\t\t\t\t\t\toldList.RemoveAt(oldIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add all new elements\n\t\t\tfor (var i = 0; i < updates.Count; ++i)\n\t\t\t{\n\t\t\t\tif (!updates[i])\n\t\t\t\t{\n\t\t\t\t\tresult.Add(Insert(i, create(newList[i])));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result.Count > 0\n\t\t\t\t? Combine(result)\n\t\t\t\t: Optional.None<ListChange<T>>();\n\t\t}\n\n\t\tpublic static Optional<ListChange<T>> IncrementalChanges<T>(\n\t\t\tIEnumerable<T> oldElements,\n\t\t\tIReadOnlyList<T> newList)\n\t\t{\n\t\t\treturn IncrementalChanges(oldElements, newList, (x, y) => x.Equals(y), t => t);\n\t\t}\n\n\t\tpublic static ImmutableList<T> Apply<T>(this ListChange<T> changes, ImmutableList<T> list)\n\t\t{\n\t\t\tvar result = list;\n\t\t\tchanges(\n\t\t\t\tinsert: (i, x) => result = result.Insert(i, x),\n\t\t\t\treplace: (i, x) => result = result.SetItem(i, x),\n\t\t\t\tremove: i => result = result.RemoveAt(i),\n\t\t\t\tclear: () => result = ImmutableList<T>.Empty);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static SumTree<T> Apply<T>(this ListChange<T> changes, SumTree<T> tree)\n\t\t{\n\t\t\tvar result = tree;\n\t\t\tchanges(\n\t\t\t\tinsert: (i, x) => result = result.Insert(i, x),\n\t\t\t\treplace: (i, x) => result = result.ReplaceAt(i, x),\n\t\t\t\tremove: i => result = result.RemoveAt(i),\n\t\t\t\tclear: () => result = result.Clear());\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static void Apply<T>(this ListChange<T> changes, IList<T> list)\n\t\t{\n\t\t\tchanges(\n\t\t\t\tinsert: list.Insert,\n\t\t\t\treplace: (i, x) => list[i] = x,\n\t\t\t\tremove: list.RemoveAt,\n\t\t\t\tclear: list.Clear);\n\t\t}\n\n\t\tpublic static void ApplyLegacy<T>(this ListChange<T> changes, IList list)\n\t\t{\n\t\t\tchanges(\n\t\t\t\tinsert: (i, x) => list.Insert(i, x),\n\t\t\t\treplace: (i, x) => list[i] = x,\n\t\t\t\tremove: list.RemoveAt,\n\t\t\t\tclear: list.Clear);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/AggregateAssoc.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservable<T> AggregateAssoc<T>(\n\t\t\tthis IObservableList<T> self,\n\t\t\tT seed,\n\t\t\tFunc<T, T, T> associativeAccumulator)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.Scan(\n\t\t\t\t\tSumTree<T>.Empty(seed, associativeAccumulator),\n\t\t\t\t\t(tree, changes) => changes.Apply(tree))\n\t\t\t\t.Select(tree => tree.Sum());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Concat.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> Concat<T>(this IObservableList<T> left, IObservableList<T> right)\n\t\t{\n\t\t\treturn new ConcatObservableLists<T>(left, right);\n\t\t}\n\t}\n\n\tclass ConcatObservableLists<T> : IObservableList<T>\n\t{\n\t\treadonly IObservableList<T> _left;\n\t\treadonly IObservableList<T> _right;\n\n\t\tpublic ConcatObservableLists(IObservableList<T> left, IObservableList<T> right)\n\t\t{\n\t\t\t_left = left;\n\t\t\t_right = right;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\treturn new Subscription(this, observer);\n\t\t}\n\n\t\tclass Subscription : IDisposable\n\t\t{\n\t\t\treadonly IObserver<ListChange<T>> _observer;\n\n\t\t\treadonly object _gate = new object();\n\t\t\tint _leftCount;\n\t\t\tint _rightCount;\n\t\t\tbool _leftCompleted;\n\t\t\tbool _rightCompleted;\n\n\t\t\treadonly IDisposable _dispose;\n\n\t\t\tpublic Subscription(ConcatObservableLists<T> parent, IObserver<ListChange<T>> observer)\n\t\t\t{\n\t\t\t\t_observer = observer;\n\t\t\t\t_dispose = Disposable.Combine(\n\t\t\t\t\tparent._left.Subscribe(LeftObserver()),\n\t\t\t\t\tparent._right.Subscribe(RightObserver()));\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\t_dispose.Dispose();\n\t\t\t}\n\n\t\t\tIObserver<ListChange<T>> LeftObserver()\n\t\t\t{\n\t\t\t\treturn Observer.Create<ListChange<T>>(\n\t\t\t\t\tonNext: changes =>\n\t\t\t\t\t{\n\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar newChanges = new List<ListChange<T>>();\n\t\t\t\t\t\t\tchanges(\n\t\t\t\t\t\t\t\tinsert: (index, item) =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Insert(index, item));\n\t\t\t\t\t\t\t\t\t++_leftCount;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\treplace: (index, item) => { newChanges.Add(ListChange.Replace(index, item)); },\n\t\t\t\t\t\t\t\tremove: index =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(index));\n\t\t\t\t\t\t\t\t\t--_leftCount;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tclear: () =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (_rightCount == 0)\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Clear<T>());\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tfor (var i = _leftCount - 1; i >= 0; --i)\n\t\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(i));\n\n\t\t\t\t\t\t\t\t\t_leftCount = 0;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (newChanges.Count > 0)\n\t\t\t\t\t\t\t\t_observer.OnNext(ListChange.Combine(newChanges));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonCompleted: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (_rightCompleted)\n\t\t\t\t\t\t\t\t_observer.OnCompleted();\n\n\t\t\t\t\t\t\t_leftCompleted = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: e =>\n\t\t\t\t\t{\n\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t_observer.OnError(e);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\tIObserver<ListChange<T>> RightObserver()\n\t\t\t{\n\t\t\t\treturn Observer.Create<ListChange<T>>(\n\t\t\t\t\t\tonNext: changes =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar newChanges = new List<ListChange<T>>();\n\t\t\t\t\t\t\t\tchanges(\n\t\t\t\t\t\t\t\t\tinsert: (index, item) =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar newIndex = index + _leftCount;\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Insert(newIndex, item));\n\t\t\t\t\t\t\t\t\t\t++_rightCount;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\treplace: (index, item) =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar newIndex = index + _leftCount;\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Replace(newIndex, item));\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tremove: index =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar newIndex = index + _leftCount;\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(newIndex));\n\t\t\t\t\t\t\t\t\t\t--_rightCount;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tclear: () =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (_leftCount == 0)\n\t\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Clear<T>());\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tfor (var i = _rightCount - 1; i >= 0; --i)\n\t\t\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(i + _leftCount));\n\n\t\t\t\t\t\t\t\t\t\t_rightCount = 0;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tif (newChanges.Count > 0)\n\t\t\t\t\t\t\t\t\t_observer.OnNext(ListChange.Combine(newChanges));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonCompleted: () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (_leftCompleted)\n\t\t\t\t\t\t\t\t\t_observer.OnCompleted();\n\n\t\t\t\t\t\t\t\t_rightCompleted = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError: e =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t\t_observer.OnError(e);\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/ConnectWhile.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> ConnectWhile<T>(this IObservableList<T> self, IObservable<bool> pred)\n\t\t{\n\t\t\treturn ((IObservable<ListChange<T>>) self).ConnectWhile(pred).UnsafeAsObservableList();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Count.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservable<int> Count<T>(this IObservableList<T> self)\n\t\t{\n\t\t\treturn self.Scan(0,\n\t\t\t\t(count, change) =>\n\t\t\t\t{\n\t\t\t\t\tchange(\n\t\t\t\t\t\tinsert: (i, item) => ++count,\n\t\t\t\t\t\treplace: (i, item) => { },\n\t\t\t\t\t\tremove: i => --count,\n\t\t\t\t\t\tclear: () => count = 0);\n\t\t\t\t\treturn count;\n\t\t\t\t}).DistinctUntilChanged();\n\t\t}\n\n\t\tpublic static IObservable<bool> IsEmpty<T>(this IObservableList<T> self)\n\t\t{\n\t\t\treturn self.Count().Select(c => c == 0).DistinctUntilChanged();\n\t\t}\n\n\t\tpublic static IObservable<bool> IsNonEmpty<T>(this IObservableList<T> self)\n\t\t{\n\t\t\treturn self.Count().Select(c => c > 0).DistinctUntilChanged();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Create.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> Empty<T>()\n\t\t{\n\t\t\treturn new ConstantObservableList<T>(ImmutableList<T>.Empty);\n\t\t}\n\n\t\tpublic static IObservableList<T> Return<T>(IEnumerable<T> elements)\n\t\t{\n\t\t\treturn new ConstantObservableList<T>(elements.ToImmutableList());\n\t\t}\n\n\t\tpublic static IObservableList<T> Create<T>(Func<IObserver<ListChange<T>>, IDisposable> subscribe)\n\t\t{\n\t\t\treturn new ObservableListFromDelegate<T>(subscribe);\n\t\t}\n\n\t\tpublic static IObservableList<T> UnsafeAsObservableList<T>(this IObservable<ListChange<T>> self)\n\t\t{\n\t\t\treturn Create<T>(self.Subscribe);\n\t\t}\n\t}\n\n\tclass ConstantObservableList<T> : IObservableList<T>\n\t{\n\t\treadonly ImmutableList<T> _value;\n\t\tListChange<T> _changes;\n\t\tpublic Optional<ImmutableList<T>> ConstantValue\n\t\t{\n\t\t\tget { return _value; }\n\t\t}\n\n\t\tpublic ConstantObservableList(ImmutableList<T> value)\n\t\t{\n\t\t\t_value = value;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\tif (_changes == null)\n\t\t\t\t_changes = ListChange.Combine(_value.Select((t, i) => ListChange.Insert(i, t)));\n\t\t\tobserver.OnNext(_changes);\n\t\t\tobserver.OnCompleted();\n\t\t\treturn Disposable.Empty;\n\t\t}\n\t}\n\n\tclass ObservableListFromDelegate<T> : IObservableList<T>\n\t{\n\t\treadonly Func<IObserver<ListChange<T>>, IDisposable> _subscribe;\n\n\t\tpublic ObservableListFromDelegate(Func<IObserver<ListChange<T>>, IDisposable> subscribe)\n\t\t{\n\t\t\t_subscribe = subscribe;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\treturn _subscribe(observer);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/DisposeElements.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> DisposeElements<T>(this IObservableList<T> self) where T : IDisposable\n\t\t{\n\t\t\treturn self.DisposeElements(x => x);\n\t\t}\n\n\t\tpublic static IObservableList<T> DisposeElements<T>(this IObservableList<T> self, Func<T, IDisposable> getDisposable)\n\t\t{\n\t\t\treturn new DisposeElementsObservableList<T>(self, getDisposable);\n\t\t}\n\t}\n\n\tclass DisposeElementsObservableList<T> : IObservableList<T>\n\t{\n\t\treadonly IObservableList<T> _source;\n\t\treadonly Func<T, IDisposable> _getDisposable;\n\n\t\tpublic DisposeElementsObservableList(IObservableList<T> source, Func<T, IDisposable> getDisposable)\n\t\t{\n\t\t\t_source = source;\n\t\t\t_getDisposable = getDisposable;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\tvar gate = new object();\n\t\t\tvar items = new List<IDisposable>();\n\t\t\tAction clear = () =>\n\t\t\t{\n\t\t\t\tDisposable.Combine(items).Dispose();\n\t\t\t\titems.Clear();\n\t\t\t};\n\n\t\t\treturn Disposable.Combine(\n\t\t\t\t_source.Subscribe(\n\t\t\t\t\tObserver.Create<ListChange<T>>(\n\t\t\t\t\t\tonNext: changes =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobserver.OnNext(changes);\n\t\t\t\t\t\t\t\tchanges(\n\t\t\t\t\t\t\t\t\tinsert: (index, item) => items.Insert(index, _getDisposable(item)),\n\t\t\t\t\t\t\t\t\tremove: index =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titems[index].Dispose();\n\t\t\t\t\t\t\t\t\t\titems.RemoveAt(index);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\treplace: (index, item) =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titems[index].Dispose();\n\t\t\t\t\t\t\t\t\t\titems[index] = _getDisposable(item);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tclear: clear);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError: error =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tobserver.OnError(error);\n\t\t\t\t\t\t\t\tclear();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonCompleted: () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (gate)\n\t\t\t\t\t\t\t\tobserver.OnCompleted();\n\t\t\t\t\t\t})),\n\t\t\t\tDisposable.Create(clear));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Join.cs",
    "content": "﻿namespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> Join<T>(this IObservableList<IObservableList<T>> self)\n\t\t{\n\t\t\treturn self.AggregateAssoc(Empty<T>(), Concat).Switch();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Observable.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservable<ImmutableList<T>> ToObservableImmutableList<T>(this IObservableList<T> self)\n\t\t{\n\t\t\treturn self.Scan(\n\t\t\t\tImmutableList<T>.Empty,\n\t\t\t\t(list, changes) => changes.Apply(list));\n\t\t}\n\n\t\tpublic static IObservableList<T> ToObservableList<T>(this IObservable<IImmutableList<T>> self)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.Scan(\n\t\t\t\t\tnew\n\t\t\t\t\t{\n\t\t\t\t\t\tPrevList = (IImmutableList<T>)ImmutableList<T>.Empty,\n\t\t\t\t\t\tChanges = Optional.None<ListChange<T>>()\n\t\t\t\t\t},\n\t\t\t\t\t(acc, newList) => new\n\t\t\t\t\t{\n\t\t\t\t\t\tPrevList = newList,\n\t\t\t\t\t\tChanges = ListChange.IncrementalChanges(acc.PrevList, newList),\n\t\t\t\t\t})\n\t\t\t\t.SelectMany(acc => acc.Changes)\n\t\t\t\t.UnsafeAsObservableList();\n\t\t}\n\n\t\tpublic static IObservable<Optional<T>> FirstOrNone<T>(this IObservableList<T> self)\n\t\t{\n\t\t\treturn self.ToObservableImmutableList().Select(list => list.FirstOrNone());\n\t\t}\n\n\t\tpublic static IObservable<Optional<T>> LastOrNone<T>(this IObservableList<T> self)\n\t\t{\n\t\t\treturn self.ToObservableImmutableList().Select(list => list.LastOrNone());\n\t\t}\n\n\t\tpublic static IObservable<T> FirstOr<T>(this IObservableList<T> self, T element)\n\t\t{\n\t\t\treturn self.ToObservableImmutableList().Select(list => list.FirstOr(element));\n\t\t}\n\n\t\tpublic static IObservable<T> LastOr<T>(this IObservableList<T> self, T element)\n\t\t{\n\t\t\treturn self.ToObservableImmutableList().Select(list => list.LastOr(element));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/RefCount.cs",
    "content": "﻿using System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> RefCount<T>(this IConnectableObservableList<T> self)\n\t\t{\n\t\t\treturn ((IConnectableObservable<ListChange<T>>)self).RefCount().UnsafeAsObservableList();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Replay.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IConnectableObservableList<T> Replay<T>(this IObservableList<T> self)\n\t\t{\n\t\t\treturn new ReplayObservableList<T>(self);\n\t\t}\n\t}\n\n\tclass ReplayObservableList<T> : IConnectableObservableList<T>\n\t{\n\t\tenum State\n\t\t{\n\t\t\tUnconnected,\n\t\t\tConnected,\n\t\t\tError,\n\t\t\tCompleted\n\t\t}\n\n\t\treadonly object _gate = new object();\n\t\treadonly IObservableList<T> _source;\n\n\t\tState _state;\n\t\tImmutableList<IObserver<ListChange<T>>> _observers = ImmutableList<IObserver<ListChange<T>>>.Empty;\n\t\tImmutableList<T> _value = ImmutableList<T>.Empty;\n\t\tException _error;\n\n\t\tpublic ReplayObservableList(IObservableList<T> source)\n\t\t{\n\t\t\t_source = source;\n\t\t}\n\n\t\tpublic IDisposable Connect()\n\t\t{\n\t\t\tlock (_gate)\n\t\t\t{\n\t\t\t\tif (_state != State.Unconnected)\n\t\t\t\t\tthrow new Exception(\"Can't connect an already connected ReplayObservableList\");\n\n\t\t\t\t_state = State.Connected;\n\n\t\t\t\tvar subscription = _source.Subscribe(\n\t\t\t\t\tObserver.Create<ListChange<T>>(\n\t\t\t\t\t\tonNext: change =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t_value = change.Apply(_value);\n\n\t\t\t\t\t\t\t\tforeach (var observer in _observers)\n\t\t\t\t\t\t\t\t\tobserver.OnNext(change);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError: error =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t_state = State.Error;\n\t\t\t\t\t\t\t\t_error = error;\n\n\t\t\t\t\t\t\t\tforeach (var observer in _observers)\n\t\t\t\t\t\t\t\t\tobserver.OnError(error);\n\t\t\t\t\t\t\t\t_observers = ImmutableList<IObserver<ListChange<T>>>.Empty;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonCompleted: () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t_state = State.Completed;\n\n\t\t\t\t\t\t\t\tforeach (var observer in _observers)\n\t\t\t\t\t\t\t\t\tobserver.OnCompleted();\n\t\t\t\t\t\t\t\t_observers = ImmutableList<IObserver<ListChange<T>>>.Empty;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\n\t\t\t\treturn Disposable.Combine(\n\t\t\t\t\tsubscription,\n\t\t\t\t\tDisposable.Create(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_state = State.Unconnected;\n\t\t\t\t\t\t\t_value = ImmutableList<T>.Empty;\n\t\t\t\t\t\t\t_observers = ImmutableList<IObserver<ListChange<T>>>.Empty;\n\t\t\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\tlock (_gate)\n\t\t\t{\n\t\t\t\tif (_value.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tvar changes = ListChange.Combine(_value.Select((item, index) => ListChange.Insert(index, item)));\n\t\t\t\t\tobserver.OnNext(changes);\n\t\t\t\t}\n\n\t\t\t\tswitch (_state)\n\t\t\t\t{\n\t\t\t\t\tcase State.Unconnected:\n\t\t\t\t\tcase State.Connected:\n\t\t\t\t\t\t_observers = _observers.Add(observer);\n\t\t\t\t\t\treturn Disposable.Create(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t\t_observers = _observers.Remove(observer);\n\t\t\t\t\t\t});\n\t\t\t\t\tcase State.Completed:\n\t\t\t\t\t\tobserver.OnCompleted();\n\t\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t\tcase State.Error:\n\t\t\t\t\t\tobserver.OnError(_error);\n\t\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Exception(\"ReplayObservableList.Subscribe: Impossible\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Select.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<TResult> Select<TSource, TResult>(\n\t\t\tthis IObservableList<TSource> self,\n\t\t\tFunc<TSource, TResult> selector)\n\t\t{\n\t\t\treturn self.Select(change => change.Select(selector)).UnsafeAsObservableList();\n\t\t}\n\n\t\tpublic static IObservableList<TResult> SelectMany<TSource, TResult>(\n\t\t\tthis IObservableList<TSource> self,\n\t\t\tFunc<TSource, IObservableList<TResult>> selector)\n\t\t{\n\t\t\treturn self.Select(selector).Join();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/SeparateBy.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> SeparateBy<T>(this IObservableList<T> self, Func<T> separator)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.SelectWithState(\n\t\t\t\t\t0,\n\t\t\t\t\t(changes, res) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newChanges = new List<ListChange<T>>();\n\t\t\t\t\t\tvar count = res;\n\t\t\t\t\t\tchanges(\n\t\t\t\t\t\t\tinsert: (i, item) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (i == count) // inserting at the end\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (count == 0) // inserting first element: skip the separator\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Insert(0, item));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse // add separator before item\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Insert(i * 2 - 1, separator()));\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Insert(i * 2, item));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse // add separator after item\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Insert(i * 2, item));\n\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Insert(i * 2 + 1, separator()));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t++count;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\treplace: (i, item) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Replace(i * 2, item));\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tremove: i =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (i == count - 1) // removing at the end\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (i == 0) // removing first element: no separator to remove\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(0));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse  // remove separator before item\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(i * 2));\n\t\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(i * 2 - 1));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse // remove separator after item\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(i * 2 + 1));\n\t\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Remove<T>(i * 2));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t--count;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tclear: () =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewChanges.Add(ListChange.Clear<T>());\n\t\t\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn SelectResult.Create(ListChange.Combine(newChanges), count);\n\t\t\t\t\t})\n\t\t\t\t.UnsafeAsObservableList();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Switch.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Disposables;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> Switch<T>(this IObservable<IObservableList<T>> self)\n\t\t{\n\t\t\treturn self.Select(ol => ol.StartWith(ListChange.Clear<T>())).Switch().UnsafeAsObservableList();\n\t\t}\n\n\t\tpublic static IObservableList<T> Switch<T>(this IObservableList<IObservable<T>> self)\n\t\t{\n\t\t\treturn new SwitchObservableListObservable<T>(self);\n\t\t}\n\n\t\tpublic static IObservableList<TResult> Switch<TSource, TResult>(\n\t\t\tthis IObservable<TSource> self,\n\t\t\tFunc<TSource, IObservableList<TResult>> func)\n\t\t{\n\t\t\treturn self.Select(func).Switch();\n\t\t}\n\t}\n\n\tclass SwitchObservableListObservable<T> : IObservableList<T>\n\t{\n\t\treadonly IObservableList<IObservable<T>> _sources;\n\n\t\tpublic SwitchObservableListObservable(IObservableList<IObservable<T>> sources)\n\t\t{\n\t\t\t_sources = sources;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\treturn _sources.Subscribe(new Obs(observer));\n\t\t}\n\n\t\tclass Obs : IObserver<ListChange<IObservable<T>>>\n\t\t{\n\t\t\treadonly IObserver<ListChange<T>> _observer;\n\t\t\treadonly IndexTrackerList<SingleAssignmentDisposable> _innerSubscriptions\n\t\t\t\t= new IndexTrackerList<SingleAssignmentDisposable>();\n\t\t\treadonly WhereChangeMapper _changeMapper\n\t\t\t\t= new WhereChangeMapper();\n\n\t\t\treadonly object _gate = new object();\n\n\t\t\tbool _outerCompleted;\n\t\t\tSumTree<bool> _innerCompleted\n\t\t\t\t= SumTree<bool>.Empty(false, (d1, d2) => d1 && d2);\n\n\t\t\tpublic Obs(IObserver<ListChange<T>> observer)\n\t\t\t{\n\t\t\t\t_observer = observer;\n\t\t\t}\n\n\t\t\tpublic void OnNext(ListChange<IObservable<T>> changes)\n\t\t\t{\n\t\t\t\tlock (_gate)\n\t\t\t\t{\n\t\t\t\t\tchanges(\n\t\t\t\t\t\tinsert: (index, obs) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar indexedItem = new IndexTrackerList<SingleAssignmentDisposable>.IndexedItem(new SingleAssignmentDisposable());\n\t\t\t\t\t\t\t_innerSubscriptions.Insert(index, indexedItem);\n\t\t\t\t\t\t\t_changeMapper.InsertFalse(index);\n\t\t\t\t\t\t\t_innerCompleted = _innerCompleted.Insert(index, false);\n\n\t\t\t\t\t\t\tindexedItem.Value.Disposable = SubscribeInner(obs, indexedItem);\n\t\t\t\t\t\t},\n\t\t\t\t\t\treplace: (index, obs) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_innerSubscriptions[index].Dispose();\n\t\t\t\t\t\t\tvar indexedItem = new IndexTrackerList<SingleAssignmentDisposable>.IndexedItem(new SingleAssignmentDisposable());\n\t\t\t\t\t\t\t_innerSubscriptions.Replace(index, indexedItem);\n\t\t\t\t\t\t\t_innerCompleted = _innerCompleted.ReplaceAt(index, false);\n\n\t\t\t\t\t\t\tindexedItem.Value.Disposable = SubscribeInner(obs, indexedItem);\n\t\t\t\t\t\t\t// The new observable hasn't produced any values left, so remove any leftover old values\n\t\t\t\t\t\t\tforeach (var change in _changeMapper.ReplaceFalse<T>(index))\n\t\t\t\t\t\t\t\t_observer.OnNext(change);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremove: (index) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_innerSubscriptions[index].Dispose();\n\t\t\t\t\t\t\t_innerSubscriptions.Remove(index);\n\t\t\t\t\t\t\t_innerCompleted = _innerCompleted.RemoveAt(index);\n\t\t\t\t\t\t\tforeach (var change in _changeMapper.Remove<T>(index))\n\t\t\t\t\t\t\t\t_observer.OnNext(change);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclear: () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tDisposable.Combine(_innerSubscriptions).Dispose();\n\t\t\t\t\t\t\t_innerSubscriptions.Clear();\n\t\t\t\t\t\t\t_innerCompleted = SumTree<bool>.Empty(false, (d1, d2) => d1 && d2);\n\t\t\t\t\t\t\tforeach (var change in _changeMapper.Clear<T>())\n\t\t\t\t\t\t\t\t_observer.OnNext(change);\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIDisposable SubscribeInner(IObservable<T> obs, IndexTrackerList<SingleAssignmentDisposable>.IndexedItem indexedItem)\n\t\t\t{\n\t\t\t\treturn obs.Subscribe(\n\t\t\t\t\tObserver.Create<T>(\n\t\t\t\t\t\tonNext: item =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t\tforeach (var currentIndex in indexedItem.Index)\n\t\t\t\t\t\t\t\t\tforeach (var change in _changeMapper.Replace(currentIndex, item, true))\n\t\t\t\t\t\t\t\t\t\t_observer.OnNext(change);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError: OnError,\n\t\t\t\t\t\tonCompleted: () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlock (_gate)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach (var currentIndex in indexedItem.Index)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t_innerSubscriptions[currentIndex].Dispose();\n\t\t\t\t\t\t\t\t\t_innerCompleted = _innerCompleted.ReplaceAt(currentIndex, true);\n\t\t\t\t\t\t\t\t\tif (_outerCompleted && _innerCompleted.Sum())\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tDisposable.Combine(_innerSubscriptions).Dispose();\n\t\t\t\t\t\t\t\t\t\t_innerSubscriptions.Clear();\n\t\t\t\t\t\t\t\t\t\t_observer.OnCompleted();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t}\n\n\t\t\tpublic void OnError(Exception error)\n\t\t\t{\n\t\t\t\tlock (_gate)\n\t\t\t\t{\n\t\t\t\t\t_observer.OnError(error);\n\t\t\t\t\tDisposable.Combine(_innerSubscriptions).Dispose();\n\t\t\t\t\t_innerSubscriptions.Clear();\n\t\t\t\t\t_innerCompleted = SumTree<bool>.Empty(false, (d1, d2) => d1 && d2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void OnCompleted()\n\t\t\t{\n\t\t\t\tlock (_gate)\n\t\t\t\t{\n\t\t\t\t\t_outerCompleted = true;\n\t\t\t\t\tif (_innerCompleted.Sum())\n\t\t\t\t\t{\n\t\t\t\t\t\tDisposable.Combine(_innerSubscriptions).Dispose();\n\t\t\t\t\t\t_innerSubscriptions.Clear();\n\t\t\t\t\t\t_observer.OnCompleted();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tclass IndexTrackerList<T> : IEnumerable<T>\n\t{\n\t\tpublic class IndexedItem\n\t\t{\n\t\t\tpublic Optional<int> Index;\n\t\t\tpublic T Value;\n\n\t\t\tpublic IndexedItem(T value)\n\t\t\t{\n\t\t\t\tValue = value;\n\t\t\t}\n\t\t}\n\n\t\treadonly List<IndexedItem> _items = new List<IndexedItem>();\n\n\t\tpublic T this[int index]\n\t\t{\n\t\t\tget { return _items[index].Value; }\n\t\t}\n\n\t\tpublic void Insert(int index, IndexedItem item)\n\t\t{\n\t\t\t_items.Insert(index, item);\n\t\t\tInvalidateFrom(index);\n\t\t}\n\n\t\tpublic void Replace(int index, IndexedItem item)\n\t\t{\n\t\t\t_items[index].Index = Optional.None<int>();\n\t\t\titem.Index = index;\n\t\t\t_items[index] = item;\n\t\t}\n\n\t\tpublic void Remove(int index)\n\t\t{\n\t\t\t_items[index].Index = Optional.None<int>();\n\t\t\t_items.RemoveAt(index);\n\t\t\tInvalidateFrom(index);\n\t\t}\n\n\t\tpublic void Clear()\n\t\t{\n\t\t\tforeach (var item in _items)\n\t\t\t\titem.Index = Optional.None<int>();\n\t\t\t_items.Clear();\n\t\t}\n\n\t\tvoid InvalidateFrom(int fromIndex)\n\t\t{\n\t\t\tfor (var i = fromIndex; i < _items.Count; ++i)\n\t\t\t\t_items[i].Index = i;\n\t\t}\n\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\treturn _items.Select(item => item.Value).GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/Operators/Where.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class ObservableList\n\t{\n\t\tpublic static IObservableList<T> Where<T>(this IObservableList<T> self, Predicate<T> predicate)\n\t\t{\n\t\t\treturn new WhereObservableList<T>(self, predicate);\n\t\t}\n\n\t\tpublic static IObservableList<T> Where<T>(this IObservableList<T> self, Func<T, IObservable<bool>> predicate)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.Select(item => predicate(item).Select(p => new { Item = item, Pred = p }))\n\t\t\t\t.Switch()\n\t\t\t\t.Where(x => x.Pred)\n\t\t\t\t.Select(x => x.Item);\n\t\t}\n\n\t\tpublic static IObservableList<T> NotNone<T>(this IObservableList<Optional<T>> self)\n\t\t{\n\t\t\treturn self.Where(x => x.HasValue).Select(x => x.Value);\n\t\t}\n\t}\n\n\tclass WhereObservableList<T> : IObservableList<T>\n\t{\n\t\treadonly IObservableList<T> _source;\n\t\treadonly Predicate<T> _predicate;\n\n\t\tpublic WhereObservableList(IObservableList<T> source, Predicate<T> predicate)\n\t\t{\n\t\t\t_source = source;\n\t\t\t_predicate = predicate;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<ListChange<T>> observer)\n\t\t{\n\t\t\tvar mapper = new WhereChangeMapper();\n\t\t\tvar gate = new object();\n\t\t\treturn _source.Subscribe(\n\t\t\t\tObserver.Create<ListChange<T>>(\n\t\t\t\t\tonNext: change =>\n\t\t\t\t\t{\n\t\t\t\t\t\tlock (gate)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar newChanges = new List<ListChange<T>>();\n\n\t\t\t\t\t\t\tchange(\n\t\t\t\t\t\t\t\tinsert: (index, item) => newChanges.AddRange(mapper.Insert(index, item, _predicate(item))),\n\t\t\t\t\t\t\t\treplace: (index, item) => newChanges.AddRange(mapper.Replace(index, item, _predicate(item))),\n\t\t\t\t\t\t\t\tremove: index => newChanges.AddRange(mapper.Remove<T>(index)),\n\t\t\t\t\t\t\t\tclear: () => newChanges.AddRange(mapper.Clear<T>()));\n\n\t\t\t\t\t\t\tif (newChanges.Count > 0)\n\t\t\t\t\t\t\t\tobserver.OnNext(ListChange.Combine(newChanges));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonCompleted: observer.OnCompleted,\n\t\t\t\t\tonError: observer.OnError));\n\t\t}\n\t}\n\n\tclass WhereChangeMapper\n\t{\n\t\tSumTree<int> _items = SumTree<int>.Empty(0, (x, y) => x + y);\n\n\t\tpublic Optional<ListChange<T>> Insert<T>(int index, T item, bool predicateTrue)\n\t\t{\n\t\t\tvar toIndex = _items.Sum(index);\n\n\t\t\t_items = _items.Insert(index, predicateTrue ? 1 : 0);\n\n\t\t\treturn predicateTrue\n\t\t\t\t? ListChange.Insert(toIndex, item)\n\t\t\t\t: Optional.None<ListChange<T>>();\n\t\t}\n\n\t\tpublic void InsertFalse(int index)\n\t\t{\n\t\t\t_items = _items.Insert(index, 0);\n\t\t}\n\n\t\tpublic Optional<ListChange<T>> Replace<T>(int index, T item, bool predicateTrue)\n\t\t{\n\t\t\tvar toIndex = _items.Sum(index);\n\n\t\t\tvar oldPredicateTrue = _items[index] == 1;\n\n\t\t\t_items = _items.ReplaceAt(index, predicateTrue ? 1 : 0);\n\n\t\t\tif (predicateTrue)\n\t\t\t{\n\t\t\t\treturn oldPredicateTrue\n\t\t\t\t\t? ListChange.Replace(toIndex, item)\n\t\t\t\t\t: ListChange.Insert(toIndex, item);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn oldPredicateTrue\n\t\t\t\t\t? ListChange.Remove<T>(toIndex)\n\t\t\t\t\t: Optional.None<ListChange<T>>();\n\t\t\t}\n\t\t}\n\n\t\tpublic Optional<ListChange<T>> ReplaceFalse<T>(int index)\n\t\t{\n\t\t\tvar toIndex = _items.Sum(index);\n\n\t\t\tvar oldPredicateTrue = _items[index] == 1;\n\n\t\t\t_items = _items.ReplaceAt(index, 0);\n\n\t\t\treturn oldPredicateTrue\n\t\t\t\t? ListChange.Remove<T>(toIndex)\n\t\t\t\t: Optional.None<ListChange<T>>();\n\t\t}\n\n\t\tpublic Optional<ListChange<T>> Remove<T>(int index)\n\t\t{\n\t\t\tvar toIndex = _items.Sum(index);\n\t\t\tvar predicateTrue = _items[index] == 1;\n\n\t\t\t_items = _items.RemoveAt(index);\n\n\t\t\treturn predicateTrue\n\t\t\t\t? ListChange.Remove<T>(toIndex)\n\t\t\t\t: Optional.None<ListChange<T>>();\n\t\t}\n\n\t\tpublic Optional<ListChange<T>> Clear<T>()\n\t\t{\n\t\t\tvar oldTrueCount = _items.Sum();\n\t\t\t_items = _items.Clear();\n\n\t\t\treturn oldTrueCount == 0\n\t\t\t\t? Optional.None<ListChange<T>>()\n\t\t\t\t: ListChange.Clear<T>();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ObservableList/SumTree.Operations.cs",
    "content": "﻿using System;\nusing Outracks.Fusion.Fenwick;\n\nnamespace Outracks.Fusion\n{\n\tpublic partial class SumTree<T>\n\t{\n\t\t/// <summary>\n\t\t/// Return a new tree with no nodes and the same operations as this tree. O(1).\n\t\t/// </summary>\n\t\tpublic SumTree<T> Clear()\n\t\t{\n\t\t\treturn Empty(_unit, _operation);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the element at index. O(log n).\n\t\t/// </summary>\n\t\tpublic T this[int index]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (index < 0 || index >= Count)\n\t\t\t\t\tthrow new IndexOutOfRangeException(\"index\");\n\n\t\t\t\treturn _tree.MatchWith(tree => GetInner(0, tree, index),\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception(\"SumTree.Get: Impossible\");\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tstatic T GetInner(int leftIndex, Tree<T> tree, int index)\n\t\t{\n\t\t\treturn tree.Match(\n\t\t\t\tleaf: leafValue => leafValue,\n\t\t\t\tnode: (left, leftLength, nodeValue, right) =>\n\t\t\t\t{\n\t\t\t\t\tvar rightIndex = leftIndex + leftLength;\n\t\t\t\t\treturn index < rightIndex\n\t\t\t\t\t\t? GetInner(leftIndex, left, index)\n\t\t\t\t\t\t: GetInner(rightIndex, right, index);\n\t\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new tree with value inserted at index. O(log n).\n\t\t/// </summary>\n\t\tpublic SumTree<T> Insert(int index, T value)\n\t\t{\n\t\t\tif (index < 0 || index > Count)\n\t\t\t\tthrow new IndexOutOfRangeException(\"index\");\n\n\t\t\treturn _tree.MatchWith(\n\t\t\t\ttree => NonEmpty(InsertInner(0, tree, Count, index, value), Count + 1),\n\t\t\t\t() => NonEmpty(Tree.Leaf(value), 1));\n\t\t}\n\n\t\tTree<T> InsertInner(int leftIndex, Tree<T> tree, int length, int index, T value)\n\t\t{\n\t\t\treturn tree.Match(\n\t\t\t\tleaf: leafValue => index == leftIndex\n\t\t\t\t\t? Tree.Node(\n\t\t\t\t\t\tTree.Leaf(value),\n\t\t\t\t\t\t1,\n\t\t\t\t\t\t_operation(value, leafValue),\n\t\t\t\t\t\ttree)\n\t\t\t\t\t: Tree.Node(\n\t\t\t\t\t\ttree,\n\t\t\t\t\t\t1,\n\t\t\t\t\t\t_operation(leafValue, value),\n\t\t\t\t\t\tTree.Leaf(value)),\n\t\t\t\tnode: (left, leftLength, nodeValue, right) =>\n\t\t\t\t{\n\t\t\t\t\tvar rightLength = length - leftLength;\n\t\t\t\t\tvar rightIndex = leftIndex + leftLength;\n\t\t\t\t\tif (index < rightIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newLeft = InsertInner(leftIndex, left, leftLength, index, value);\n\t\t\t\t\t\treturn BalanceNode(newLeft, leftLength + 1, right, rightLength);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newRight = InsertInner(rightIndex, right, rightLength, index, value);\n\t\t\t\t\t\treturn BalanceNode(left, leftLength, newRight, rightLength + 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new tree with the value at index removed. O(log n).\n\t\t/// </summary>\n\t\tpublic SumTree<T> RemoveAt(int index)\n\t\t{\n\t\t\tif (index < 0 || index >= Count)\n\t\t\t\tthrow new IndexOutOfRangeException(\"index\");\n\n\t\t\treturn _tree.MatchWith(\n\t\t\t\ttree => FromOptional(RemoveAtInner(0, tree, Count, index), Count - 1),\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"SumTree.Remove: Impossible\");\n\t\t\t\t});\n\t\t}\n\n\t\tOptional<Tree<T>> RemoveAtInner(int leftIndex, Tree<T> tree, int length, int index)\n\t\t{\n\t\t\treturn tree.Match(\n\t\t\t\tleaf: leafValue => Optional.None<Tree<T>>(),\n\t\t\t\tnode: (left, leftLength, nodeValue, right) =>\n\t\t\t\t{\n\t\t\t\t\tvar rightLength = length - leftLength;\n\t\t\t\t\tvar rightIndex = leftIndex + leftLength;\n\t\t\t\t\tif (index < rightIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maybeNewLeft = RemoveAtInner(leftIndex, left, leftLength, index);\n\t\t\t\t\t\treturn maybeNewLeft.MatchWith(\n\t\t\t\t\t\t\tnewLeft => BalanceNode(newLeft, leftLength + 1, right, rightLength),\n\t\t\t\t\t\t\t() => right);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maybeNewRight = RemoveAtInner(rightIndex, right, rightLength, index);\n\t\t\t\t\t\treturn maybeNewRight.MatchWith(\n\t\t\t\t\t\t\tnewRight => BalanceNode(left, leftLength, newRight, rightLength + 1),\n\t\t\t\t\t\t\t() => left);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Return a new tree with the value at index replaced with value. O(log n).\n\t\t/// </summary>\n\t\tpublic SumTree<T> ReplaceAt(int index, T value)\n\t\t{\n\t\t\tif (index < 0 || index >= Count)\n\t\t\t\tthrow new IndexOutOfRangeException(\"index\");\n\n\t\t\treturn _tree.MatchWith(\n\t\t\t\ttree => NonEmpty(ReplaceAtInner(0, tree, Count, index, value), Count),\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"SumTree.ReplaceAt: Impossible\");\n\t\t\t\t});\n\t\t}\n\n\t\tTree<T> ReplaceAtInner(int leftIndex, Tree<T> tree, int length, int index, T value)\n\t\t{\n\t\t\treturn tree.Match(\n\t\t\t\tleaf: leafValue => Tree.Leaf(value),\n\t\t\t\tnode: (left, leftLength, nodeValue, right) =>\n\t\t\t\t{\n\t\t\t\t\tvar rightLength = length - leftLength;\n\t\t\t\t\tvar rightIndex = leftIndex + leftLength;\n\t\t\t\t\tif (index < rightIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newLeft = ReplaceAtInner(leftIndex, left, leftLength, index, value);\n\t\t\t\t\t\treturn Tree.Node(newLeft, leftLength, _operation(newLeft.Value, right.Value), right);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newRight = ReplaceAtInner(rightIndex, right, rightLength, index, value);\n\t\t\t\t\t\treturn Tree.Node(left, leftLength, _operation(left.Value, newRight.Value), newRight);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the sum of all the elements in this tree. O(1).\n\t\t/// </summary>\n\t\tpublic T Sum()\n\t\t{\n\t\t\treturn _tree.MatchWith(tree => tree.Value, () => _unit);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Get the prefix sum up to (but not including) index. O(log n).\n\t\t/// </summary>\n\t\tpublic T Sum(int index)\n\t\t{\n\t\t\tif (index < 0 || index > Count)\n\t\t\t\tthrow new IndexOutOfRangeException(\"index\");\n\n\t\t\treturn _tree.MatchWith(\n\t\t\t\ttree => SumInner(0, tree, Count, index),\n\t\t\t\t() => _unit);\n\t\t}\n\n\t\tT SumInner(int leftIndex, Tree<T> tree, int length, int index)\n\t\t{\n\t\t\treturn tree.Match(\n\t\t\t\tleaf: leafValue => index == leftIndex\n\t\t\t\t\t? _unit\n\t\t\t\t\t: leafValue,\n\t\t\t\tnode: (left, leftLength, nodeValue, right) =>\n\t\t\t\t{\n\t\t\t\t\tvar rightIndex = leftIndex + leftLength;\n\t\t\t\t\tvar rightLength = length - leftLength;\n\n\t\t\t\t\tif (index == leftIndex + length)\n\t\t\t\t\t\treturn nodeValue;\n\t\t\t\t\telse if (index < rightIndex)\n\t\t\t\t\t\treturn SumInner(leftIndex, left, leftLength, index);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn _operation(left.Value, SumInner(rightIndex, right, rightLength, index));\n\n\t\t\t\t});\n\t\t}\n\n\t\t// Create a new balanced node from the left and right subtrees. O(1).\n\t\t//\n\t\t// As long as the left and right subtrees maintain the following invariant,\n\t\t// the resulting tree node will also maintain it:\n\t\t//\n\t\t// rightLength <= leftLength * 2\n\t\t// leftLength <= rightLength * 2\n\t\tTree<T> BalanceNode(Tree<T> left, int leftLength, Tree<T> right, int rightLength)\n\t\t{\n\t\t\tif (rightLength > leftLength * 2)\n\t\t\t\treturn RotateLeft(left, leftLength, right);\n\t\t\tif (leftLength > rightLength * 2)\n\t\t\t\treturn RotateRight(left, leftLength, right);\n\t\t\treturn Tree.Node(left, leftLength, _operation(left.Value, right.Value), right);\n\t\t}\n\n\t\tTree<T> RotateLeft(Tree<T> left, int leftLength, Tree<T> r)\n\t\t{\n\t\t\treturn r.Match(\n\t\t\t\tleaf: rightValue => Tree.Node(left, leftLength, _operation(left.Value, rightValue), r),\n\t\t\t\tnode: (mid, midLength, midRightValue, right) =>\n\t\t\t\t{\n\t\t\t\t\tvar leftMidLength = leftLength + midLength;\n\t\t\t\t\tvar leftMidValue = _operation(left.Value, mid.Value);\n\t\t\t\t\treturn Tree.Node(\n\t\t\t\t\t\tTree.Node(left, leftLength, leftMidValue, mid),\n\t\t\t\t\t\tleftMidLength,\n\t\t\t\t\t\t_operation(left.Value, midRightValue),\n\t\t\t\t\t\tright);\n\t\t\t\t});\n\t\t}\n\n\t\tTree<T> RotateRight(Tree<T> l, int lLength, Tree<T> right)\n\t\t{\n\t\t\treturn l.Match(\n\t\t\t\tleaf: leftValue => Tree.Node(l, lLength, _operation(leftValue, right.Value), right),\n\t\t\t\tnode: (left, leftLength, leftMidValue, mid) =>\n\t\t\t\t{\n\t\t\t\t\tvar leftMidLength = lLength;\n\t\t\t\t\tvar midLength = leftMidLength - leftLength;\n\t\t\t\t\tvar midRightValue = _operation(mid.Value, right.Value);\n\t\t\t\t\treturn Tree.Node(\n\t\t\t\t\t\tleft,\n\t\t\t\t\t\tleftLength,\n\t\t\t\t\t\t_operation(leftMidValue, right.Value),\n\t\t\t\t\t\tTree.Node(mid, midLength, midRightValue, right));\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/ObservableList/SumTree.cs",
    "content": "﻿using System;\nusing Outracks.Fusion.Fenwick;\n\nnamespace Outracks.Fusion\n{\n\t/// <summary>\n\t/// An indexed (as in array) immutable data structure that offers log-time\n\t/// insertion, removal, prefix sum, and constant time total sum of elements.\n\t///\n\t/// Parameterised by a domain T and a binary operation on T.\n\t/// Assumes that the operation is associative and has a unit\n\t/// (i.e. forms a monoid).\n\t///\n\t/// Implemented as a self-balancing Fenwick tree.\n\t/// </summary>\n\tpublic partial class SumTree<T>\n\t{\n\t\treadonly T _unit;\n\t\treadonly Func<T, T, T> _operation;\n\t\treadonly Optional<Tree<T>> _tree;\n\t\tpublic readonly int Count;\n\n\t\tSumTree(T unit, Func<T, T, T> associativeOperation, Optional<Tree<T>> tree, int count)\n\t\t{\n\t\t\t_unit = unit;\n\t\t\t_operation = associativeOperation;\n\t\t\t_tree = tree;\n\t\t\tCount = count;\n\t\t}\n\n\t\tpublic static SumTree<T> Empty(T unit, Func<T, T, T> associativeOperation)\n\t\t{\n\t\t\treturn new SumTree<T>(unit, associativeOperation, Optional.None<Tree<T>>(), 0);\n\t\t}\n\n\t\tSumTree<T> NonEmpty(Tree<T> tree, int length)\n\t\t{\n\t\t\treturn new SumTree<T>(_unit, _operation, tree, length);\n\t\t}\n\n\t\tSumTree<T> FromOptional(Optional<Tree<T>> maybeTree, int length)\n\t\t{\n\t\t\treturn maybeTree.MatchWith(tree => NonEmpty(tree, length), Clear);\n\t\t}\n\t}\n\n\tnamespace Fenwick\n\t{\n\t\tclass Tree<T>\n\t\t{\n\t\t\tpublic readonly T Value;\n\t\t\tpublic readonly Optional<Leaves<T>> Leaves;\n\n\t\t\tpublic Tree(T value, Optional<Leaves<T>> leaves)\n\t\t\t{\n\t\t\t\tValue = value;\n\t\t\t\tLeaves = leaves;\n\t\t\t}\n\n\t\t\tpublic TResult Match<TResult>(Func<T, TResult> leaf, Func<Tree<T>, int, T, Tree<T>, TResult> node)\n\t\t\t{\n\t\t\t\treturn Leaves.HasValue\n\t\t\t\t\t? node(Leaves.Value.Left, Leaves.Value.LeftLength, Value, Leaves.Value.Right)\n\t\t\t\t\t: leaf(Value);\n\t\t\t}\n\t\t}\n\n\t\tstruct Leaves<T>\n\t\t{\n\t\t\tpublic readonly Tree<T> Left;\n\t\t\tpublic readonly int LeftLength;\n\t\t\tpublic readonly Tree<T> Right;\n\n\t\t\tpublic Leaves(Tree<T> left, int leftLength, Tree<T> right)\n\t\t\t{\n\t\t\t\tLeft = left;\n\t\t\t\tLeftLength = leftLength;\n\t\t\t\tRight = right;\n\t\t\t}\n\t\t}\n\n\t\tstatic class Tree\n\t\t{\n\t\t\tpublic static Tree<T> Leaf<T>(T value)\n\t\t\t{\n\t\t\t\treturn new Tree<T>(value, Optional.None<Leaves<T>>());\n\t\t\t}\n\n\t\t\tpublic static Tree<T> Node<T>(Tree<T> left, int leftLength, T value, Tree<T> right)\n\t\t\t{\n\t\t\t\treturn new Tree<T>(value, new Leaves<T>(left, leftLength, right));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Outracks.Fusion.Core.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fusion</RootNamespace>\n    <AssemblyName>Outracks.Fusion</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"Svg, Version=2.2.1.23048, Culture=neutral, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\FuseOpen.Svg.2.3.1\\lib\\net45\\Svg.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.XML\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Animation.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Control.Empty.cs\" />\n    <Compile Include=\"Control.Lazy.cs\" />\n    <Compile Include=\"BehaviorProperty.cs\" />\n    <Compile Include=\"Controls\\IColorMap.cs\" />\n    <Compile Include=\"Controls\\IImage.cs\" />\n    <Compile Include=\"Controls\\MultiResolutionImage.cs\" />\n    <Compile Include=\"Controls\\SvgImage.cs\" />\n    <Compile Include=\"Dialogs\\FileDialog.cs\" />\n    <Compile Include=\"Dialogs\\MessageBox.cs\" />\n    <Compile Include=\"FpsProfiler.cs\" />\n    <Compile Include=\"Shell.cs\" />\n    <Compile Include=\"Environments\\MacEnvironment.cs\" />\n    <Compile Include=\"Environments\\WindowsEnvironment.cs\" />\n    <Compile Include=\"AutoReload\\AutoReload.cs\" />\n    <Compile Include=\"AutoReload\\ControlFactory.cs\" />\n    <Compile Include=\"Brush.cs\" />\n    <Compile Include=\"Diagnostics\\ConsoleTraceExtensions.cs\" />\n    <Compile Include=\"Control.Bind.cs\" />\n    <Compile Include=\"CornerRadius.cs\" />\n    <Compile Include=\"Controls\\CachedImageBase.cs\" />\n    <Compile Include=\"Controls\\NativeControl.cs\" />\n    <Compile Include=\"DebugControl.cs\" />\n    <Compile Include=\"HotKey.cs\" />\n    <Compile Include=\"IDialog.cs\" />\n    <Compile Include=\"IBehaviorProperty.cs\" />\n    <Compile Include=\"Layout\\Grid.cs\" />\n    <Compile Include=\"Layout\\LayoutTracker.cs\" />\n    <Compile Include=\"Layout\\Scissor.cs\" />\n    <Compile Include=\"Layout\\Stack.cs\" />\n    <Compile Include=\"Layout\\Wrap.cs\" />\n    <Compile Include=\"ObservableList\\IConnectableObservableList.cs\" />\n    <Compile Include=\"ObservableList\\IListBehavior.cs\" />\n    <Compile Include=\"ObservableList\\IListObserver.cs\" />\n    <Compile Include=\"ObservableList\\IListSubject.cs\" />\n    <Compile Include=\"ObservableList\\IObservableList.cs\" />\n    <Compile Include=\"ObservableList\\ListBehaviorSubject.cs\" />\n    <Compile Include=\"ObservableList\\ListChange.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\AggregateAssoc.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Concat.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\ConnectWhile.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Count.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Create.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\DisposeElements.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Join.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Observable.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\RefCount.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Replay.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Select.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\SeparateBy.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Switch.cs\" />\n    <Compile Include=\"ObservableList\\Operators\\Where.cs\" />\n    <Compile Include=\"ObservableList\\SumTree.Operations.cs\" />\n    <Compile Include=\"ObservableList\\SumTree.cs\" />\n    <Compile Include=\"PropertyBindingExtensions.cs\" />\n    <Compile Include=\"PoolPerElement.cs\" />\n    <Compile Include=\"Control.WithSize.cs\" />\n    <Compile Include=\"Control.WithFrame.cs\" />\n    <Compile Include=\"Controls\\LogView.cs\" />\n    <Compile Include=\"Controls\\MountLocation.cs\" />\n    <Compile Include=\"Controls\\WebView.cs\" />\n    <Compile Include=\"Document.cs\" />\n    <Compile Include=\"Layout\\Collapsable.cs\" />\n    <Compile Include=\"ContextMenu.cs\" />\n    <Compile Include=\"Keyboard.cs\" />\n    <Compile Include=\"Layout\\WithFixedPosition.cs\" />\n    <Compile Include=\"Layout\\WithTransformation.cs\" />\n    <Compile Include=\"Property\\Operators\\ConnectWhile.cs\" />\n    <Compile Include=\"Property\\Sources\\Constant.cs\" />\n    <Compile Include=\"Property\\IProperty.cs\" />\n    <Compile Include=\"Property\\Sources\\Mutable.cs\" />\n    <Compile Include=\"Property\\Sources\\Observable.cs\" />\n    <Compile Include=\"Property\\Operators\\PreventFeedback.cs\" />\n    <Compile Include=\"Property\\Operators\\AutoInvalidate.cs\" />\n    <Compile Include=\"Property\\Operators\\Or.cs\" />\n    <Compile Include=\"Property\\Operators\\Convert.cs\" />\n    <Compile Include=\"Property\\Operators\\Switch.cs\" />\n    <Compile Include=\"Property\\Operators\\Deferred.cs\" />\n    <Compile Include=\"Property\\Operators\\Distinct.cs\" />\n    <Compile Include=\"Property\\SubscriberTrackingObservable.cs\" />\n    <Compile Include=\"Property\\SubscriberTrackingProperty.cs\" />\n    <Compile Include=\"ScrollBounds.cs\" />\n    <Compile Include=\"Threading\\DispatcherBase.cs\" />\n    <Compile Include=\"Threading\\DispatcherQueue.cs\" />\n    <Compile Include=\"Threading\\PollingDispatcher.cs\" />\n    <Compile Include=\"Threading\\QueuedDispatcher.cs\" />\n    <Compile Include=\"Threading\\SingleThreadDispatcherBase.cs\" />\n    <Compile Include=\"ToolTip.cs\" />\n    <Compile Include=\"UserSettings\\FusionJsonSerializer.cs\" />\n    <Compile Include=\"UserSettings\\PersistentProperty.cs\" />\n    <Compile Include=\"UserSettings\\PersistentSettings.cs\" />\n    <Compile Include=\"Scrolling.cs\" />\n    <Compile Include=\"Controls\\ColorPicker.cs\" />\n    <Compile Include=\"Controls\\DropDown.cs\" />\n    <Compile Include=\"Controls\\Slider.cs\" />\n    <Compile Include=\"Cursor.cs\" />\n    <Compile Include=\"Dragging.cs\" />\n    <Compile Include=\"Font.cs\" />\n    <Compile Include=\"Effects.cs\" />\n    <Compile Include=\"Controls\\Button.cs\" />\n    <Compile Include=\"Color.cs\" />\n    <Compile Include=\"Controls\\Image.cs\" />\n    <Compile Include=\"Controls\\Label.cs\" />\n    <Compile Include=\"Controls\\Shapes.cs\" />\n    <Compile Include=\"Layout\\Switch.cs\" />\n    <Compile Include=\"Property\\Operators\\With.cs\" />\n    <Compile Include=\"Pointer.cs\" />\n    <Compile Include=\"Positioned.cs\" />\n    <Compile Include=\"Resizable.cs\" />\n    <Compile Include=\"Stroke.cs\" />\n    <Compile Include=\"Controls\\TextBox.cs\" />\n    <Compile Include=\"Application.cs\" />\n    <Compile Include=\"Key.cs\" />\n    <Compile Include=\"Clipping.cs\" />\n    <Compile Include=\"Layout\\DockBuilder.cs\" />\n    <Compile Include=\"Command.cs\" />\n    <Compile Include=\"ModifierKeys.cs\" />\n    <Compile Include=\"Layout\\ObservableMath.cs\" />\n    <Compile Include=\"Layout\\Center.cs\" />\n    <Compile Include=\"Control.cs\" />\n    <Compile Include=\"Layout\\Dock.cs\" />\n    <Compile Include=\"Layout\\WithPadding.cs\" />\n    <Compile Include=\"Layout\\Layer.cs\" />\n    <Compile Include=\"Layout\\Subdivide.cs\" />\n    <Compile Include=\"TogglePropertyCommand.cs\" />\n    <Compile Include=\"UpdateSubjectCommand.cs\" />\n    <Compile Include=\"UserSettings\\UserSettings.cs\" />\n    <Compile Include=\"ValidatedProperty.cs\" />\n    <Compile Include=\"Window.cs\" />\n    <Compile Include=\"Platform\\FileFilter.cs\" />\n    <Compile Include=\"Platform\\IFileDialogs.cs\" />\n    <Compile Include=\"Platform\\IMessageBox.cs\" />\n    <Compile Include=\"Platform\\INotifier.cs\" />\n    <Compile Include=\"Platform\\ITrayApplication.cs\" />\n    <Compile Include=\"Icon.cs\" />\n    <Compile Include=\"Menus\\MenuItem.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Menus\\Menu.cs\" />\n    <Compile Include=\"DropOperation.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/fusion/core/Outracks.Fusion.Core.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ApplicationDetection/@EntryIndexedValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Controls/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=diagnostics/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=dialogs/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Environment/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Environments/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Input/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Layout/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Menus/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=usersettings/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/fusion/core/Platform/FileFilter.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Outracks\n{\n\tpublic struct FileFilter\n\t{\n\t\tpublic readonly string Label;\n\t\tpublic readonly string[] Extensions;\n\n\t\tpublic FileFilter(string label, params string[] extensions)\n\t\t{\n\t\t\tLabel = label;\n\t\t\tExtensions = extensions;\n\t\t}\n\n\t\tpublic static FileFilter Union(string label, FileFilter a, params FileFilter []sets)\n\t\t{\n\t\t\tvar extensions = new List<string>();\n\t\t\textensions.AddRange(a.Extensions);\n\t\t\tforeach (var set in sets)\n\t\t\t{\n\t\t\t\textensions.AddRange(set.Extensions);\n\t\t\t}\n\n\t\t\treturn new FileFilter(label, extensions.ToArray());\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar extsString = \"\";\n\t\t\tvar first = true;\n\t\t\tforeach(var s in Extensions){\n\t\t\t\tif(first) first = false;\n\t\t\t\telse extsString+=\", \";\n\t\t\t\textsString += s;\n\t\t\t}\n\t\t\treturn \"FileFilter(\" + Label + \", \" + extsString + \")\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Platform/IFileDialogs.cs",
    "content": "﻿using System.Threading.Tasks;\nusing Outracks.IO;\n\nnamespace Outracks\n{\n\tpublic interface IFileDialogImplementation\n\t{\n\t\t// NOTE: There are more methods for different kinds of file browsing dialogs\n\t\t//\t\t in the implementations, we can expose them here as we need them\n\n\t\tTask<Optional<FileDialogResult>> SaveFile(FileDialogOptions options);\n\t\tTask<Optional<FileDialogResult>> OpenFile(FileDialogOptions options);\n\t}\n\n\tpublic struct FileDialogResult{\n\t\tpublic AbsoluteFilePath Path;\n\t\tpublic FileFilter Filter;\n\t\tpublic FileDialogResult(AbsoluteFilePath path, FileFilter filter){\n\t\t\tthis.Path = path;\n\t\t\tthis.Filter = filter;\n\t\t}\n\t}\n\n\tpublic class DirectoryDialogOptions\n\t{\n\t\tpublic string Caption { get; private set; }\n\t\tpublic AbsoluteDirectoryPath Directory { get; private set; }\n\n\t\tpublic DirectoryDialogOptions(string caption, AbsoluteDirectoryPath directory = null)\n\t\t{\n\t\t\tDirectory = directory;\n\t\t\tCaption = caption;\n\t\t}\n\t}\n\n\tpublic class FileDialogOptions\n\t{\n\t\tpublic string Caption { get; private set; }\n\t\tpublic AbsoluteDirectoryPath Directory { get; private set; }\n\t\tpublic FileFilter[] Filters { get; private set; }\n\n\t\tpublic FileDialogOptions(string caption, params FileFilter[] filters)\n\t\t\t: this (caption, null, filters)\n\t\t{ }\n\n\t\tpublic FileDialogOptions(string caption, AbsoluteDirectoryPath directory, params FileFilter[] filters)\n\t\t{\n\t\t\tCaption = caption;\n\t\t\tFilters = filters;\n\t\t\tDirectory = directory;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Platform/IMessageBox.cs",
    "content": "﻿namespace Outracks.Fusion\n{\n\tpublic enum DialogResult\n\t{\n\t\tNone = 0,\n\t\tOk = 1,\n\t\tCancel = 2,\n\t\tYes = 6,\n\t\tNo = 7,\n\t\t//Abort,\n\t\t//Ignore,\n\t\t//Retry,\n\t}\n\n\tpublic enum MessageBoxButtons\n\t{\n\t\tOk = 0,\n\t\tOkCancel = 1,\n\t\tYesNoCancel = 3,\n\t\tYesNo = 4,\n\t}\n\n\tpublic enum MessageBoxType\n\t{\n\t\tInformation,\n\t\tError\n\t}\n\n\tpublic enum MessageBoxDefaultButton\n\t{\n\t\tDefault,\n\t\tCancel,\n\t\tOk,\n\t\tNo,\n\t\tYes\n\t}\n\n\tpublic interface IMessageBox\n\t{\n\t\tvoid BringToFront();\n\n\t\tbool ShowConfirm(string text, string caption, MessageBoxType type);\n\t\tvoid Show(string text, string caption, MessageBoxType type);\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Platform/INotifier.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface INotifier : IDisposable\n\t{\n\t\tTask<NotificationFeedback> Show(Notification notification);\n\t}\n\n\tpublic enum NotifyType\n\t{\n\t\tError,\n\t\tInfo\n\t}\n\n\tpublic class Notification\n\t{\n\t\tpublic NotifyType Type { get; set; }\n\t\tpublic Optional<string> PrimaryAction { get; set; }\n\t\tpublic string Title { get; set; }\n\t\tpublic string Description { get; set; }\n\n\t\tpublic Optional<TimeSpan> Timeout { get; set; }\n\n\t\tpublic Notification()\n\t\t{\n\t\t\tTitle = \"Hi there\";\n\t\t\tDescription = \"Have a nice day!\";\n\t\t\tTimeout = Optional.None();\n\t\t}\n\t}\n\n\tpublic enum NotificationFeedback\n\t{\n\t\tPrimaryActionTaken,\n\t\tDismissed,\n\t\t//DismissedByTimeout\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/Platform/ITrayApplication.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface ITrayApplication : INotifier\n\t{\n\t\tIObservable<int> UserClicked { get; }\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/Pointer.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic enum Space\n\t{\n\t\tLocal,\n\t\tWindow,\n\t}\n\n\tpublic static class Pointer\n\t{\n\t\tpublic static Hittable MakeHittable(this IControl control, IObservable<object> dragData = null, Space space = Space.Local)\n\t\t{\n\t\t\tdragData = dragData ?? Observable.Empty<object>();\n\n\t\t\tvar latestData = Optional.None<object>();\n\t\t\tdragData.ConnectWhile(control.IsRooted)\n\t\t\t\t.Subscribe(d => latestData = d);\n\n\t\t\tvar onPressed = new Subject<OnPressedArgs>();\n\t\t\tvar released = new Subject<Unit>();\n\t\t\tvar entered = new Subject<Point<Points>>();\n\t\t\tvar exited = new Subject<Point<Points>>();\n\t\t\tvar moved = new Subject<Point<Points>>();\n\t\t\tvar gotFocus = new Subject<Unit>();\n\t\t\tvar lostFocus = new Subject<Unit>();\n\n\t\t\tvar callbacks = new Callbacks()\n\t\t\t{\n\t\t\t\tOnPressed = onPressed.OnNext,\n\t\t\t\tOnReleased = () => released.OnNext(Unit.Default),\n\t\t\t\tOnEntered = entered.OnNext,\n\t\t\t\tOnExited = exited.OnNext,\n\t\t\t\tOnMoved = moved.OnNext,\n\t\t\t\tOnDragged = () => latestData,\n\t\t\t\tOnGotFocus = () => gotFocus.OnNext(Unit.Default),\n\t\t\t\tOnLostFocus = () => lostFocus.OnNext(Unit.Default),\n\t\t\t};\n\n\t\t\tvar hittableControl = Implementation.MakeHittable(control, space, callbacks);\n\n\t\t\tvar pressed = onPressed.Publish().RefCount();\n\n\t\t\treturn new Hittable()\n\t\t\t{\n\t\t\t\tControl = hittableControl,\n\t\t\t\tPressed = pressed.Select(a => a.Position),\n\t\t\t\tReleased = released.Publish().RefCount(),\n\t\t\t\tDoubleClicked = pressed.SelectSome(a => a.ClickCount == 2 ? Optional.Some(a.Position) : Optional.None()),\n\t\t\t\tEntered = entered.Publish().RefCount(),\n\t\t\t\tExited = exited.Publish().RefCount(),\n\t\t\t\tMoved = moved.Publish().RefCount(),\n\t\t\t\tGotFocus = gotFocus.Publish().RefCount(),\n\t\t\t\tLostFocus = lostFocus.Publish().RefCount(),\n\t\t\t};\n\t\t}\n\n\t\tpublic static Hittable OnMouse(\n\t\t\tthis Hittable hittable,\n\t\t\tOptional<Command> pressed = default(Optional<Command>),\n\t\t\tOptional<Command> released = default(Optional<Command>),\n\t\t\tOptional<Command> doubleClicked = default(Optional<Command>),\n\t\t\tOptional<Command> entered = default(Optional<Command>),\n\t\t\tOptional<Command> exited = default(Optional<Command>))\n\t\t{\n\t\t\tExecCommandWhileRooted(hittable.Pressed, pressed, hittable.Control);\n\t\t\tExecCommandWhileRooted(hittable.Released, released, hittable.Control);\n\t\t\tExecCommandWhileRooted(hittable.DoubleClicked, doubleClicked, hittable.Control);\n\t\t\tExecCommandWhileRooted(hittable.Entered, entered, hittable.Control);\n\t\t\tExecCommandWhileRooted(hittable.Exited, exited, hittable.Control);\n\n\t\t\treturn hittable;\n\t\t}\n\n\t\tpublic static IControl OnMouse(\n\t\t\tthis IControl control,\n\t\t\tOptional<Command> pressed = default(Optional<Command>),\n\t\t\tOptional<Command> released = default(Optional<Command>),\n\t\t\tOptional<Command> doubleClicked = default(Optional<Command>),\n\t\t\tOptional<Command> entered = default(Optional<Command>),\n\t\t\tOptional<Command> exited = default(Optional<Command>),\n\t\t\tIObservable<object> dragged = null)\n\t\t{\n\t\t\tvar hittableControl = control.MakeHittable(dragData: dragged);\n\t\t\treturn hittableControl.OnMouse(pressed, released, doubleClicked, entered, exited).Control;\n\t\t}\n\n\t\tstatic void ExecCommandWhileRooted<T>(IObservable<T> obs, Optional<Command> command, IControl control)\n\t\t{\n\t\t\tif (command.HasValue)\n\t\t\t\tobs\n\t\t\t\t\t.WithLatestFromBuffered(command.Value.Execute.ConnectWhile(control.IsRooted), (_, c) => c)\n\t\t\t\t\t.Subscribe(c => c());\n\t\t}\n\n\t\tpublic static IObservable<bool> IsPressed(this Hittable control)\n\t\t{\n\t\t\treturn Observable\n\t\t\t\t.Merge(\n\t\t\t\t\tcontrol.Pressed.Select(_ => true),\n\t\t\t\t\tcontrol.Released.Select(_ => false),\n\t\t\t\t\tcontrol.LostFocus.Select(_ => false))\n\t\t\t\t.StartWith(false);\n\t\t}\n\n\t\tpublic static IObservable<bool> IsHovering(this Hittable control)\n\t\t{\n\t\t\treturn Observable\n\t\t\t\t.Merge(\n\t\t\t\t\tcontrol.Entered.Select(_ => true),\n\t\t\t\t\tcontrol.Exited.Select(_ => false))\n\t\t\t\t.StartWith(false);\n\t\t}\n\n\t\tpublic struct Callbacks\n\t\t{\n\t\t\tpublic Action<OnPressedArgs> OnPressed;\n\t\t\tpublic Action OnReleased;\n\t\t\tpublic Action<Point<Points>> OnEntered;\n\t\t\tpublic Action<Point<Points>> OnExited;\n\t\t\tpublic Action<Point<Points>> OnMoved;\n\t\t\tpublic Func<Optional<object>> OnDragged;\n\t\t\tpublic Action OnGotFocus;\n\t\t\tpublic Action OnLostFocus;\n\t\t}\n\n\t\tpublic struct OnPressedArgs\n\t\t{\n\t\t\tpublic readonly Point<Points> Position;\n\t\t\tpublic readonly int ClickCount;\n\n\t\t\tpublic OnPressedArgs(Point<Points> position, int clickCount)\n\t\t\t{\n\t\t\t\tPosition = position;\n\t\t\t\tClickCount = clickCount;\n\t\t\t}\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IControl, Space, Callbacks, IControl> MakeHittable;\n\t\t}\n\t}\n\n\tpublic struct Hittable\n\t{\n\t\tpublic IControl Control;\n\t\tpublic IObservable<Point<Points>> Pressed;\n\t\tpublic IObservable<Unit> Released;\n\t\tpublic IObservable<Point<Points>> DoubleClicked;\n\t\tpublic IObservable<Point<Points>> Entered;\n\t\tpublic IObservable<Point<Points>> Exited;\n\t\tpublic IObservable<Point<Points>> Moved;\n\t\tpublic IObservable<Unit> GotFocus;\n\t\tpublic IObservable<Unit> LostFocus;\n\t}\n}"
  },
  {
    "path": "src/fusion/core/PoolPerElement.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static partial class Control\n\t{\n\t\tpublic static IObservable<IImmutableList<TItem>> PoolPerElement<TOwner, TItem>(\n\t\t\tthis IObservable<IEnumerable<TOwner>> owners,\n\t\t\tFunc<int, IObservable<TOwner>, TItem> createNewItem)\n\t\t{\n\t\t\treturn Observable.Defer(() =>\n\t\t\t{\n\t\t\t\tvar pool = ImmutableList<Tuple<BehaviorSubject<TOwner>, TItem>>.Empty;\n\n\t\t\t\treturn owners.Select(o =>\n\t\t\t\t{\n\t\t\t\t\tvar ownersArray = o.ToArray();\n\n\t\t\t\t\tvar split = Math.Min(ownersArray.Length, pool.Count);\n\n\t\t\t\t\tfor (int i = 0; i < split; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tpool[i].Item1.OnNext(ownersArray[i]);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = split; i < ownersArray.Length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar owner = new BehaviorSubject<TOwner>(ownersArray[i]);\n\t\t\t\t\t\tvar item = createNewItem(i, owner.DistinctUntilChanged());\n\t\t\t\t\t\tpool = pool.Add(Tuple.Create(owner, item));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn pool\n\t\t\t\t\t\t.Select(p => p.Item2)\n\t\t\t\t\t\t.Take(ownersArray.Length)\n\t\t\t\t\t\t.ToImmutableList();\n\t\t\t\t});\n\t\t\t})\n\t\t\t.DistinctUntilChanged(list => list.Count);\n\t\t}\n\n\t\tpublic static IObservable<IImmutableList<TItem>> PoolPerElement<TOwner, TItem>(\n\t\t\tthis IObservable<IEnumerable<TOwner>> owners,\n\t\t\tFunc<IObservable<TOwner>, TItem> createNewItem)\n\t\t{\n\t\t\treturn PoolPerElement(owners, (index, owner) => createNewItem(owner));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Positioned.cs",
    "content": "namespace Outracks.Fusion\n{\n\tpublic static class Positioned\n\t{\n\t\tpublic static Positioned<T> Create<T>(Point<Points> position, T value)\n\t\t{\n\t\t\treturn new Positioned<T>(position, value);\n\t\t}\n\t}\n\n\tpublic class Positioned<T>\n\t{\n\t\tpublic Point<Points> Position { get; private set; }\n\t\tpublic T Value { get; private set; }\n\n\t\tpublic Positioned(Point<Points> position, T value)\n\t\t{\n\t\t\tPosition = position;\n\t\t\tValue = value;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Controls\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/fusion/core/Property/IProperty.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic interface IProperty<T> : IObservable<T>\n\t{\n\t\tIObservable<bool> IsReadOnly { get; }\n\n\t\t/// <summary>\n\t\t/// Write value to the source of this property.\n\t\t/// The save flag indicates that the user is done editing this field for now (e.g. at the end of scrubbing a value),\n\t\t/// so the source may perform heavier tasks like saving to disk in response.\n\t\t/// The source may also just ignore the save flag in many cases.\n\t\t/// </summary>\n\t\tvoid Write(T value, bool save = false);\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/AutoInvalidate.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<T> AutoInvalidate<T>(this IProperty<T> self, Optional<TimeSpan> throttle = default (Optional<TimeSpan>))\n\t\t{\n\t\t\treturn new AutoInvalidateProperty<T>(self, throttle);\n\t\t}\n\t}\n\n\tclass AutoInvalidateProperty<T> : IProperty<T>\n\t{\n\t\treadonly Subject<T> _subject = new Subject<T>();\n\t\treadonly IProperty<T> _source;\n\n\t\tpublic AutoInvalidateProperty(IProperty<T> source, Optional<TimeSpan> throttle = default (Optional<TimeSpan>))\n\t\t{\n\t\t\t_source = source;\n\n\t\t\tthrottle\n\t\t\t\t.Select(t => _subject.Throttle(t))\n\t\t\t\t.Or((IObservable<T>) _subject)\n\t\t\t\t.Subscribe(v => source.Write(v, save: true));\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _source.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return _source.IsReadOnly; }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t_source.Write(value, save);\n\t\t\t_subject.OnNext(value);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/ConnectWhile.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<T> ConnectWhile<T>(this IProperty<T> self, IObservable<bool> condition)\n\t\t{\n\t\t\treturn AsProperty(\n\t\t\t\tvalue: ((IObservable<T>) self).ConnectWhile(condition),\n\t\t\t\twrite: self.Write,\n\t\t\t\tisReadOnly: self.IsReadOnly.ConnectWhile(condition));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/Convert.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<TResult> Convert<TArgs, TResult>(\n\t\t\tthis IProperty<TArgs> self,\n\t\t\tFunc<TArgs, TResult> convert,\n\t\t\tFunc<TResult, TArgs> convertBack)\n\t\t{\n\t\t\treturn new ConvertedProperty<TArgs, TResult>(self, convert, (oldValue, newValue) => convertBack(newValue));\n\t\t}\n\n\t\tpublic static IProperty<TResult> Convert<TArgs, TResult>(\n\t\t\tthis IProperty<TArgs> self,\n\t\t\tFunc<TArgs, TResult> convert,\n\t\t\tFunc<Optional<TArgs>, TResult, TArgs> convertBack)\n\t\t{\n\t\t\treturn new ConvertedProperty<TArgs, TResult>(self, convert, convertBack);\n\t\t}\n\t}\n\n\tclass ConvertedProperty<TArgs, TResult> : IProperty<TResult>\n\t{\n\t\tOptional<TArgs> _lastValue;\n\n\t\treadonly IObservable<TResult> _value;\n\t\treadonly IProperty<TArgs> _source;\n\t\treadonly Func<Optional<TArgs>, TResult, TArgs> _convertBack;\n\n\t\tpublic ConvertedProperty(\n\t\t\tIProperty<TArgs> source,\n\t\t\tFunc<TArgs, TResult> convert,\n\t\t\tFunc<Optional<TArgs>, TResult, TArgs> convertBack)\n\t\t{\n\t\t\t_source = source;\n\t\t\t_convertBack = convertBack;\n\t\t\t_value = source.Do(value => _lastValue = value).Select(convert);\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<TResult> observer)\n\t\t{\n\t\t\treturn _value.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return _source.IsReadOnly; }\n\t\t}\n\n\t\tpublic void Write(TResult value, bool save)\n\t\t{\n\t\t\t_source.Write(_convertBack(_lastValue, value), save);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/Deferred.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\t/// <summary>\n\t\t/// `prop.Deferred()` returns a property that remembers its last set value but defers pushing it to `prop` until invalidated.\n\t\t/// </summary>\n\t\tpublic static IProperty<T> Deferred<T>(this IProperty<T> self)\n\t\t{\n\t\t\treturn new DeferredProperty<T>(self);\n\t\t}\n\t}\n\n\tclass DeferredProperty<T> : IProperty<T>\n\t{\n\t\treadonly IProperty<T> _source;\n\t\treadonly BehaviorSubject<Optional<T>> _maybeSetValue = new BehaviorSubject<Optional<T>>(Optional.None<T>());\n\n\t\treadonly IObservable<T> _realtimeValue;\n\n\t\tpublic DeferredProperty(IProperty<T> source)\n\t\t{\n\t\t\t_source = source;\n\n\t\t\t_realtimeValue = Observable.Merge(\n\t\t\t\t_maybeSetValue.NotNone(),\n\t\t\t\tsource.Do(_ => _maybeSetValue.OnNext(Optional.None<T>())));\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _realtimeValue.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return _source.IsReadOnly; }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t_maybeSetValue.OnNext(value);\n\t\t\tif (save)\n\t\t\t\t_source.Write(value, save: true);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/Distinct.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<T> DistinctUntilChangedOrSet<T>(this IProperty<T> self)\n\t\t{\n\t\t\tvar userSet = new Subject<Optional<T>>();\n\t\t\treturn self\n\t\t\t\t.With(value:\n\t\t\t\t\tself.Select(Optional.Some)\n\t\t\t\t\t\t.Merge(userSet)\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.NotNone())\n\t\t\t\t.Intercept(onWrite: value =>\n\t\t\t\t\tuserSet.OnNext(Optional.None()));\n\t\t}\n\n\t\tpublic static IProperty<T> Intercept<T>(this IProperty<T> self, Action<T> onWrite)\n\t\t{\n\t\t\treturn new InterceptingProperty<T>(self, onWrite);\n\t\t}\n\t}\n\n\tclass InterceptingProperty<T> : IProperty<T>\n\t{\n\t\treadonly IProperty<T> _source;\n\t\treadonly Action<T> _onWrite;\n\n\t\tpublic InterceptingProperty(IProperty<T> source, Action<T> onWrite)\n\t\t{\n\t\t\t_source = source;\n\t\t\t_onWrite = onWrite;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _source.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return _source.IsReadOnly; }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t_source.Write(value, save);\n\t\t\t_onWrite(value);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/Or.cs",
    "content": "namespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<string> OrEmpty(this IProperty<Optional<string>> property)\n\t\t{\n\t\t\treturn property.Convert(\n\t\t\t\tconvert: p => p.Or(\"\"),\n\t\t\t\tconvertBack: s => string.IsNullOrEmpty(s) ? Optional.None() : Optional.Some(s));\n\t\t}\n\n\t\tpublic static IProperty<bool> OrFalse(this IProperty<Optional<bool>> property)\n\t\t{\n\t\t\treturn property.Convert(\n\t\t\t\tconvert: a => a.Or(false),\n\t\t\t\tconvertBack: b => b ? Optional.Some(true) : Optional.None());\n\t\t}\n\n\t\tpublic static IProperty<bool> OrTrue(this IProperty<Optional<bool>> property)\n\t\t{\n\t\t\treturn property.Convert(\n\t\t\t\tconvert: b => b.Or(true),\n\t\t\t\tconvertBack: b => b ? Optional.None() : Optional.Some(false));\n\t\t}\n\n\t\tpublic static IProperty<T> Or<T>(this IProperty<Optional<T>> property, T value)\n\t\t{\n\t\t\treturn property.Convert(\n\t\t\t\tconvert: v => v.Or(value),\n\t\t\t\tconvertBack: Optional.Some);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/PreventFeedback.cs",
    "content": "using System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<T> PreventFeedback<T>(this IProperty<T> self)\n\t\t{\n\t\t\tbool setByUs = false;\n\t\t\treturn self.Where(_ => !setByUs).AsProperty(\n\t\t\t\tisReadOnly: self.IsReadOnly,\n\t\t\t\twrite: (v, save) =>\n\t\t\t\t{\n\t\t\t\t\tsetByUs = true;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tself.Write(v, save);\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tsetByUs = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/Switch.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<T> Switch<T>(this IObservable<IProperty<T>> self)\n\t\t{\n\t\t\treturn new SwitchProperty<T>(self);\n\t\t}\n\t}\n\n\tsealed class SwitchProperty<T> : IProperty<T>\n\t{\n\t\treadonly IObservable<IProperty<T>> _source;\n\t\treadonly IObservable<T> _value;\n\t\treadonly IObservable<bool> _isReadOnly;\n\n\t\tpublic SwitchProperty(IObservable<IProperty<T>> source)\n\t\t{\n\t\t\t_source = source.Replay(1).RefCount();\n\n\t\t\t_value = ((IObservable<IObservable<T>>)_source).Switch().DistinctUntilChanged();\n\t\t\t_isReadOnly = _source.Select(p => p.IsReadOnly).Switch().DistinctUntilChanged();\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _value.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return _isReadOnly; }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t_source.Take(1).Subscribe(property => property.Write(value, save));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Operators/With.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<TResult> With<TResult>(\n\t\t\tthis IProperty<TResult> self,\n\t\t\tIObservable<TResult> value = null,\n\t\t\tAction<TResult, bool> write = null,\n\t\t\tIObservable<bool> isReadOnly = null)\n\t\t{\n\t\t\treturn AsProperty(\n\t\t\t\tvalue ?? self,\n\t\t\t\twrite ?? self.Write,\n\t\t\t\tisReadOnly ?? self.IsReadOnly);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Sources/Constant.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<T> Default<T>()\n\t\t{\n\t\t\treturn Constant(default(T));\n\t\t}\n\n\t\tpublic static IProperty<T> Constant<T>(T value)\n\t\t{\n\t\t\treturn new ConstantProperty<T>(value);\n\t\t}\n\t}\n\n\tsealed class ConstantProperty<T> : IProperty<T>\n\t{\n\t\treadonly T _value;\n\n\t\tpublic ConstantProperty(T value)\n\t\t{\n\t\t\t_value = value;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\tobserver.OnNext(_value);\n\t\t\tobserver.OnCompleted();\n\t\t\treturn Disposable.Empty;\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return Observable.Return(true); }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t// Writing to read only property is NOP\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/Sources/Mutable.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\tpublic static IProperty<T> Create<T>(T initialValue)\n\t\t{\n\t\t\treturn new MutableProperty<T>(initialValue);\n\t\t}\n\n\t\tpublic static IProperty<T> Create<T>(BehaviorSubject<T> subject)\n\t\t{\n\t\t\treturn new MutableProperty<T>(subject);\n\t\t}\n\t}\n\n\tpublic class MutableProperty<T> : IProperty<T>\n\t{\n\t\treadonly BehaviorSubject<T> _subject;\n\t\treadonly IObservable<T> _distinctValue;\n\n\t\tpublic MutableProperty(T initialValue)\n\t\t{\n\t\t\t_subject = new BehaviorSubject<T>(initialValue);\n\t\t\t_distinctValue = _subject.DistinctUntilChanged();\n\t\t}\n\n\t\tpublic MutableProperty(BehaviorSubject<T> subject)\n\t\t{\n\t\t\t_subject = subject;\n\t\t\t_distinctValue = _subject.DistinctUntilChanged();\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _distinctValue.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return Observable.Return(false); }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t_subject.OnNext(value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Property/Sources/Observable.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks\n{\n\tpublic static partial class Property\n\t{\n\t\t/// <summary>\n\t\t/// This overload exists as a NOP to avoid Property.Create().AsProperty() becoming read-only due to ending up in the IObservable overload\n\t\t/// </summary>\n\t\tpublic static IProperty<T> AsProperty<T>(this IProperty<T> value)\n\t\t{\n\t\t\treturn value;\n\t\t}\n\n\t\tpublic static IProperty<T> AsProperty<T>(this IObservable<T> value)\n\t\t{\n\t\t\treturn new ObservableProperty<T>(value);\n\t\t}\n\n\t\tpublic static IProperty<T> AsProperty<T>(\n\t\t\tthis ISubject<T, T> self,\n\t\t\tIObservable<bool> isReadOnly = null)\n\t\t{\n\t\t\treturn new WritableObservableProperty<T>(\n\t\t\t\tself,\n\t\t\t\t(v, save) => self.OnNext(v),\n\t\t\t\tisReadOnly ?? Observable.Return(false));\n\t\t}\n\n\t\tpublic static IProperty<T> AsProperty<T>(\n\t\t\tthis IObservable<T> value,\n\t\t\tAction<T, bool> write,\n\t\t\tIObservable<bool> isReadOnly = null)\n\t\t{\n\t\t\treturn new WritableObservableProperty<T>(\n\t\t\t\tvalue,\n\t\t\t\twrite,\n\t\t\t\tisReadOnly ?? Observable.Return(false));\n\t\t}\n\t}\n\n\tsealed class ObservableProperty<T> : IProperty<T>\n\t{\n\t\treadonly IObservable<T> _observable;\n\n\t\tpublic ObservableProperty(IObservable<T> observable)\n\t\t{\n\t\t\t_observable = observable;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _observable.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return Observable.Return(true); }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t// NOP\n\t\t}\n\t}\n\n\tpublic class WritableObservableProperty<T> : IProperty<T>\n\t{\n\t\treadonly IObservable<T> _value;\n\t\treadonly IObservable<bool> _isReadOnly;\n\t\treadonly Action<T, bool> _write;\n\n\t\tpublic WritableObservableProperty(IObservable<T> value, Action<T, bool> write, IObservable<bool> isReadOnly)\n\t\t{\n\t\t\t_value = value;\n\t\t\t_isReadOnly = isReadOnly;\n\t\t\t_write = write;\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return _isReadOnly; }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t_write(value, save);\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _value.Subscribe(observer);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/fusion/core/Property/SubscriberTrackingObservable.cs",
    "content": "using System;\n\nnamespace Outracks\n{\n\tpublic class SubscriberTrackingObservable<T> : IObservable<T>\n\t{\n\t\treadonly Action<int> _report;\n\t\treadonly IObservable<T> _observable;\n\n\t\tint _count;\n\n\t\tpublic SubscriberTrackingObservable(IObservable<T> observable, Action<int> report)\n\t\t{\n\t\t\t_observable = observable;\n\t\t\t_report = report;\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\t_count++;\n\t\t\t_report(_count);\n\t\t\treturn Disposable.Combine(\n\t\t\t\t_observable.Subscribe(observer),\n\t\t\t\tDisposable.Create(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\t_count--;\n\t\t\t\t\t\t_report(_count);\n\t\t\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Property/SubscriberTrackingProperty.cs",
    "content": "using System;\nusing Outracks.Fusion;\n\nnamespace Outracks\n{\n\tpublic class SubscriberTrackingProperty<T> : IProperty<T>\n\t{\n\t\treadonly IProperty<T> _property;\n\t\treadonly string _name;\n\t\tpublic SubscriberTrackingProperty(IProperty<T> property, string name)\n\t\t{\n\t\t\t_property = property;\n\t\t\t_name = name;\n\t\t}\n\n\t\tpublic IObservable<T> Value\n\t\t{\n\t\t\tget { return Track((IObservable<T>)_property, \"Value\"); }\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return Track(_property.IsReadOnly, \"IsReadOnly\"); }\n\t\t}\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\t_property.Write(value, save);\n\t\t}\n\n\t\tIObservable<TU> Track<TU>(IObservable<TU> observable, string name)\n\t\t{\n\t\t\treturn new SubscriberTrackingObservable<TU>(observable, count =>\n\t\t\t\tConsole.WriteLine(_name + \".\" + name + \" has \" + count + \" observers\"));\n\t\t}\n\n\t\tCommand Track(Command cmd, string name)\n\t\t{\n\t\t\treturn Command.Create(new SubscriberTrackingObservable<Optional<Action>>(cmd.Action, count =>\n\t\t\t\tConsole.WriteLine(_name + \".\" + name + \" has \" + count + \" observers\")));\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn _property.Subscribe(observer);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/PropertyBindingExtensions.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class PropertyBindingExtensions\n\t{\n\t\tpublic static IDisposable Subscribe<T>(this IObservable<T> self, IProperty<T> property)\n\t\t{\n\t\t\treturn self.Subscribe(v => property.Write(v, save: false));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Binds an observable to an update handler while control is rooted.\n\t\t/// </summary>\n\t\t/// <typeparam name=\"TValue\">Type value bound</typeparam>\n\t\tpublic class OneWayPropertyBinding<TValue>\n\t\t{\n\t\t\tprivate readonly IObservable<TValue> _value;\n\t\t\tprivate IDisposable _valueSubscription;\n\t\t\tprivate Optional<TValue> _lastValue;\n\t\t\tprivate readonly IScheduler _dispatcher;\n\t\t\tprivate readonly Action<TValue> _update;\n\n\t\t\tprivate OneWayPropertyBinding(IObservable<TValue> value, IScheduler dispatcher, Action<TValue> update)\n\t\t\t{\n\t\t\t\t_value = value;\n\t\t\t\t_dispatcher = dispatcher;\n\t\t\t\t_update = update;\n\t\t\t}\n\n\t\t\tprivate void IsRootedChanged(bool b)\n\t\t\t{\n\t\t\t\tif (b)\n\t\t\t\t{\n\t\t\t\t\tif (_valueSubscription == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_valueSubscription = _value.Subscribe(OnValueChanged);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (_valueSubscription != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t_valueSubscription.Dispose();\n\t\t\t\t\t\t_valueSubscription = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate void OnValueChanged(TValue v)\n\t\t\t{\n\t\t\t\tif (_lastValue.HasValue && Equals(_lastValue.Value, v))\n\t\t\t\t\treturn;\n\n\t\t\t\t//Console.WriteLine(_name + \" changed from \" + _lastValue + \" to \" + v);\n\t\t\t\t_lastValue = v;\n\t\t\t\t_dispatcher.Schedule(Update);\n\t\t\t}\n\n\t\t\tvoid Update()\n\t\t\t{\n\t\t\t\t_update(_lastValue.Value);\n\t\t\t}\n\n\t\t\tpublic static void Bind(\n\t\t\t\tIObservable<bool> isRooted,\n\t\t\t\tIScheduler dispatcher,\n\t\t\t\tIObservable<TValue> value,\n\t\t\t\tAction<TValue> update,\n\t\t\t\tstring name)\n\t\t\t{\n\t\t\t\tisRooted.Subscribe(new OneWayPropertyBinding<TValue>(value, dispatcher, update).IsRootedChanged);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TValue>(\n\t\t\tIObservable<bool> isRooted,\n\t\t\tIScheduler dispatcher,\n\t\t\tstring name,\n\t\t\tIObservable<TValue> value,\n\t\t\tAction<TValue> update)\n\t\t{\n\t\t\tOneWayPropertyBinding<TValue>.Bind(isRooted, dispatcher, value, update, name);\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TValue>(\n\t\t\tthis IMountLocation control,\n\t\t\tIScheduler dispatcher,\n\t\t\tstring name,\n\t\t\tIObservable<TValue> value,\n\t\t\tAction<TValue> update)\n\t\t{\n\t\t\tBindNativeProperty(control.IsRooted, dispatcher, name, value, update);\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TValue>(\n\t\t\tthis IMountLocation control,\n\t\t\tIScheduler dispatcher,\n\t\t\tstring name,\n\t\t\tOptional<IObservable<TValue>> value,\n\t\t\tAction<TValue> update)\n\t\t{\n\t\t\tvalue.Do(v => BindNativeProperty(control.IsRooted, dispatcher, name, v, update));\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TValue>(\n\t\t\tthis IControl control,\n\t\t\tIScheduler dispatcher,\n\t\t\tstring name,\n\t\t\tIObservable<TValue> value,\n\t\t\tAction<TValue> update)\n\t\t{\n\t\t\tBindNativeProperty(control.IsRooted, dispatcher, name, value, update);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Resizable.cs",
    "content": "using System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class Resizable\n\t{\n\t\tpublic static IControl MakeResizable(this IControl self, RectangleEdge edge, string name)\n\t\t{\n\t\t\tvar property = Property.Create(new Points(280)); //.Settings.GetPointsProperty(name + \".Width\");\n\t\t\treturn self\n\t\t\t\t.WithDimension(edge.NormalAxis(), property)\n\t\t\t\t.MakeResizable(edge, property);\n\t\t}\n\n\t\tpublic static IControl MakeResizable(this IControl self, RectangleEdge edge, IProperty<Points> property, bool invert = false, Points minSize = default(Points))\n\t\t{\n\t\t\tvar restrictedSize = property.Convert(v => v, v => v.Max(minSize));\n\t\t\treturn self\n\t\t\t\t.WithOverlay(\n\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t.WithDimension(edge.NormalAxis(), _ => Observable.Return<Points>(5))\n\t\t\t\t\t\t.WhileDraggingScrub(restrictedSize, invert ? edge.DirectionToOpposite() : edge.DirectionToEdge())\n\t\t\t\t\t\t.SetCursor(edge.NormalAxis() == Axis2D.Horizontal ? Cursor.ResizeHorizontally : Cursor.ResizeVertically)\n\t\t\t\t\t\t.Dock(edge));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ScrollBounds.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Outracks.Fusion\n{\n\tpublic class ScrollBounds\n\t{\n\t\treadonly Rectangle<Points> _visible;\n\n\t\tpublic Rectangle<Points> Visible\n\t\t{\n\t\t\tget { return _visible; }\n\t\t}\n\n\t\treadonly Rectangle<Points> _content;\n\n\t\tpublic Rectangle<Points> Content\n\t\t{\n\t\t\tget { return _content; }\n\t\t}\n\n\t\tpublic ScrollBounds(Rectangle<Points> visible, Rectangle<Points> content)\n\t\t{\n\t\t\t_visible = visible;\n\t\t\t_content = content;\n\t\t}\n\n\t\tpublic static ScrollBounds Zero\n\t\t{\n\t\t\tget { return new ScrollBounds(Rectangle.Zero<Points>(), Rectangle.Zero<Points>()); }\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar bounds = obj as ScrollBounds;\n\t\t\treturn bounds != null &&\n\t\t\t\t   _visible.Equals(bounds._visible) &&\n\t\t\t\t   _content.Equals(bounds._content);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tvar hashCode = -1109539441;\n\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<Rectangle<Points>>.Default.GetHashCode(_visible);\n\t\t\thashCode = hashCode * -1521134295 + EqualityComparer<Rectangle<Points>>.Default.GetHashCode(_content);\n\t\t\treturn hashCode;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Scrolling.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic class ZoomAttributes\n\t{\n\t\tpublic readonly float MinZoom;\n\t\tpublic readonly float MaxZoom;\n\n\t\tpublic ZoomAttributes(float minZoom, float maxZoom)\n\t\t{\n\t\t\tMinZoom = minZoom;\n\t\t\tMaxZoom = maxZoom;\n\t\t}\n\t}\n\n\tpublic static class Scrolling\n\t{\n\t\tpublic static IControl MakeScrollable(\n\t\t\tthis IControl control,\n\t\t\tIObservable<bool> darkTheme = null,\n\t\t\tbool supportsOpenGL = false,\n\t\t\tZoomAttributes zoomAttributes = null,\n\t\t\tIProperty<Points> verticalOffset = null,\n\t\t\tIProperty<Points> horizontalOffset = null,\n\t\t\tAction<ScrollBounds> onBoundsChanged = null,\n\t\t\tIObservable<Rectangle<Points>> scrollToRectangle = null,\n\t\t\tbool verticalScrollBarVisible = true,\n\t\t\tbool horizontalScrollBarVisible = true)\n\t\t{\n\t\t\treturn Implementation.Factory(\n\t\t\t\tcontrol,\n\t\t\t\tdarkTheme ?? Observable.Return(false),\n\t\t\t\tsupportsOpenGL,\n\t\t\t\tzoomAttributes.ToOptional(),\n\t\t\t\tonBoundsChanged.ToOptional(),\n\t\t\t\tscrollToRectangle.ToOptional(),\n\t\t\t\tverticalScrollBarVisible,\n\t\t\t\thorizontalScrollBarVisible);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IControl, IObservable<bool>, bool, Optional<ZoomAttributes>, Optional<Action<ScrollBounds>>, Optional<IObservable<Rectangle<Points>>>, bool, bool, IControl> Factory;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Shell.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reactive;\nusing System.Security;\nusing Outracks.Fusion;\n\nnamespace Outracks.IO\n{\n\tpublic interface IOldShell : IFileSystem\n\t{\n\t\tstring Name { get; }\n\n\t\tvoid OpenWithDefaultApplication(AbsoluteFilePath path);\n\t\tvoid OpenFolder(AbsoluteDirectoryPath path);\n\t\tvoid ShowInFolder(AbsoluteFilePath path);\n\t\tvoid OpenTerminal(AbsoluteDirectoryPath containingDirectory);\n\t}\n\n\tpublic interface IFilePermission\n\t{\n\t\tvoid SetPermission(AbsoluteFilePath file, FileSystemPermission permission, FileSystemGroup group);\n\n\t\tvoid SetPermission(\n\t\t\tAbsoluteDirectoryPath dir,\n\t\t\tFileSystemPermission permission,\n\t\t\tFileSystemGroup group,\n\t\t\tbool recursive = false);\n\t}\n\n\tpublic class Shell : IShell\n\t{\n\t\treadonly IOldShell _shellImpl;\n\t\treadonly IFilePermission _filePermissionImpl;\n\n\t\tpublic Shell()\n\t\t{\n\t\t\t_shellImpl = ImplementationLocator.CreateInstance<IOldShell>();\n\t\t\t_filePermissionImpl = ImplementationLocator.CreateInstance<IFilePermission>();\n\t\t}\n\n\t\t/// <exception cref=\"InvalidPath\" />\n\t\t/// <exception cref=\"SecurityException\" />\n\t\tpublic IAbsolutePath ResolveAbsolutePath(string nativePath)\n\t\t{\n\t\t\treturn _shellImpl.ResolveAbsolutePath(nativePath);\n\t\t}\n\n\t\t/// <exception cref=\"IOException\"><paramref name=\"path\"/> is a file name.-or-A network error has occurred. </exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\">The caller does not have the required permission. </exception>\n\t\t/// <exception cref=\"PathTooLongException\"/>\n\t\t/// <exception cref=\"DirectoryNotFoundException\">The specified path is invalid (for example, it is on an unmapped drive). </exception>\n\t\tpublic IEnumerable<AbsoluteFilePath> GetFiles(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn _shellImpl.GetFiles(path);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetDirectories(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn _shellImpl.GetDirectories(path);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> GetFiles(AbsoluteDirectoryPath path, string searchPattern)\n\t\t{\n\t\t\treturn _shellImpl.GetFiles(path, searchPattern);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetDirectories(AbsoluteDirectoryPath path, string searchPattern)\n\t\t{\n\t\t\treturn _shellImpl.GetDirectories(path, searchPattern);\n\t\t}\n\n\t\tpublic FileStream Open(AbsoluteFilePath path, FileMode mode, FileAccess access, FileShare share)\n\t\t{\n\t\t\treturn File.Open(path.NativePath, mode, access, share);\n\t\t}\n\n\t\tpublic Stream OpenRead(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn _shellImpl.OpenRead(path);\n\t\t}\n\n\t\tpublic Stream OpenWrite(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn _shellImpl.OpenWrite(path);\n\t\t}\n\n\t\tpublic void Delete(IAbsolutePath path)\n\t\t{\n\t\t\t_shellImpl.Delete(path);\n\t\t}\n\n\t\tpublic bool Exists(IAbsolutePath path)\n\t\t{\n\t\t\treturn _shellImpl.Exists(path);\n\t\t}\n\n\t\tpublic void Copy(AbsoluteFilePath source, AbsoluteFilePath destination)\n\t\t{\n\t\t\t_shellImpl.Copy(source, destination);\n\t\t}\n\n\t\tpublic void Copy(AbsoluteDirectoryPath source, AbsoluteDirectoryPath destination)\n\t\t{\n\t\t\tDirectory.CreateDirectory(destination.NativePath);\n\t\t\tforeach (var fileInfo in new DirectoryInfo(source.NativePath).GetFiles())\n\t\t\t{\n\t\t\t\tfileInfo.CopyTo((destination / fileInfo.Name).NativePath, true);\n\t\t\t}\n\t\t\tforeach (var directoryInfo in new DirectoryInfo(source.NativePath).GetDirectories())\n\t\t\t{\n\t\t\t\tvar sourceDir = (source / directoryInfo.Name);\n\t\t\t\tvar destDir = (destination / directoryInfo.Name);\n\t\t\t\tCopy(sourceDir, destDir);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Move(AbsoluteFilePath source, AbsoluteFilePath destination)\n\t\t{\n\t\t\t_shellImpl.Move(source, destination);\n\t\t}\n\n\t\tpublic void Move(AbsoluteDirectoryPath source, AbsoluteDirectoryPath destination)\n\t\t{\n\t\t\t_shellImpl.Move(source, destination);\n\t\t}\n\n\t\tpublic void Create(AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\t_shellImpl.Create(directory);\n\t\t}\n\n\t\tpublic Stream Create(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn _shellImpl.Create(file);\n\t\t}\n\n\t\tpublic Stream CreateNew(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn _shellImpl.CreateNew(file);\n\t\t}\n\n\t\tpublic IObservable<Unit> Watch(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn _shellImpl.Watch(file);\n\t\t}\n\n\t\tpublic string Name { get { return _shellImpl.Name; } }\n\n\t\tpublic void OpenWithDefaultApplication(AbsoluteFilePath path)\n\t\t{\n\t\t\t_shellImpl.OpenWithDefaultApplication(path);\n\t\t}\n\n\t\tpublic void OpenFolder(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\t//TODO: is this needed ? ps.UpdatePathEnvironment();\n\t\t\t_shellImpl.OpenFolder(path);\n\t\t}\n\n\t\tpublic void ShowInFolder(AbsoluteFilePath path)\n\t\t{\n\t\t\t_shellImpl.ShowInFolder(path);\n\t\t}\n\n\t\tpublic void OpenTerminal(AbsoluteDirectoryPath containingDirectory)\n\t\t{\n\t\t\t_shellImpl.OpenTerminal(containingDirectory);\n\t\t}\n\n\t\tpublic void SetPermission(AbsoluteFilePath file, FileSystemPermission permission, FileSystemGroup group)\n\t\t{\n\t\t\t_filePermissionImpl.SetPermission(file, permission, group);\n\t\t}\n\n\t\tpublic void SetPermission(\n\t\t\tAbsoluteDirectoryPath dir,\n\t\t\tFileSystemPermission permission,\n\t\t\tFileSystemGroup group,\n\t\t\tbool recursive = false)\n\t\t{\n\t\t\t_filePermissionImpl.SetPermission(dir, permission, group, recursive);\n\t\t}\n\n\t\tpublic IObservable<FileSystemEventData> Watch(AbsoluteDirectoryPath path, Optional<string> filter = default(Optional<string>))\n\t\t{\n\t\t\treturn _shellImpl.Watch(path, filter);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Stroke.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ToStrokeExtension\n\t{\n\t\tpublic static Stroke Switch(this IObservable<Stroke> s)\n\t\t{\n\t\t\treturn Stroke.Create(\n\t\t\t\tbrush: s.Select(x => x.Brush).Switch(),\n\t\t\t\tthickness: s.Select(x => x.Thickness).Switch().Replay(1).RefCount(),\n\t\t\t\tdashArray: s.Select(x => x.DashArray).Switch().Replay(1).RefCount());\n\t\t}\n\t}\n\n\tpublic class StrokeDashArray\n\t{\n\t\tpublic readonly static StrokeDashArray Solid = new StrokeDashArray();\n\n\t\tpublic readonly double[] Data;\n\n\t\tpublic StrokeDashArray(params double[] data)\n\t\t{\n\t\t\tData = data;\n\t\t}\n\t}\n\n\tpublic class Stroke\n\t{\n\t\tpublic static readonly Stroke Empty = Create(0, Brush.Transparent);\n\n\t\tpublic readonly Brush Brush;\n\t\tpublic readonly IObservable<double> Thickness;\n\t\tpublic readonly IObservable<StrokeDashArray> DashArray;\n\n\t\tStroke(Brush brush, IObservable<double> thickness, IObservable<StrokeDashArray> dashArray)\n\t\t{\n\t\t\tBrush = brush;\n\t\t\tThickness = thickness;\n\t\t\tDashArray = dashArray;\n\t\t}\n\n\t\tpublic static Stroke Create(double thickness, Brush brush)\n\t\t{\n\t\t\treturn new Stroke(brush, Observable.Return(thickness), Observable.Return(StrokeDashArray.Solid));\n\t\t}\n\n\t\tpublic static Stroke Create(IObservable<double> thickness, Brush brush, IObservable<StrokeDashArray> dashArray)\n\t\t{\n\t\t\treturn new Stroke(brush, thickness, dashArray);\n\t\t}\n\n\t\tpublic static Stroke Create(double thickness, Color color, StrokeDashArray dashArray)\n\t\t{\n\t\t\treturn new Stroke(color, Observable.Return(thickness), Observable.Return(dashArray));\n\t\t}\n\t\tpublic static Stroke Create(double thickness, Brush color, StrokeDashArray dashArray)\n\t\t{\n\t\t\treturn new Stroke(color, Observable.Return(thickness), Observable.Return(dashArray));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Threading/DispatcherBase.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Disposables;\n\nnamespace Outracks.Fusion.Threading\n{\n\tpublic abstract class DispatcherBase : IScheduler\n\t{\n\t\tpublic abstract void Enqueue(Action action);\n\n\t\tpublic IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)\n\t\t{\n\t\t\tvar disposable = new SingleAssignmentDisposable();\n\t\t\tEnqueue(() => { disposable.Disposable = action(this, state); });\n\t\t\treturn disposable;\n\t\t}\n\n\t\tpublic IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)\n\t\t{\n\t\t\tif (Scheduler.Normalize(dueTime).Ticks == 0)\n\t\t\t\treturn Schedule(state, action);\n\t\t\treturn Scheduler.Default.Schedule(state, dueTime, (sched, s) => Schedule(state, action));\n\t\t}\n\n\t\tpublic IDisposable Schedule<TState>(\n\t\t\tTState state,\n\t\t\tDateTimeOffset dueTime,\n\t\t\tFunc<IScheduler, TState, IDisposable> action)\n\t\t{\n\t\t\treturn Scheduler.Default.Schedule(state, dueTime, (sched, s) => Schedule(state, action));\n\t\t}\n\n\t\tpublic DateTimeOffset Now\n\t\t{\n\t\t\tget { return Scheduler.Default.Now; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Threading/DispatcherQueue.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Diagnostics;\nusing System.Threading;\n\nnamespace Outracks\n{\n\tpublic class DispatcherQueue<T>\n\t{\n\t\treadonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>();\n\t\treadonly AutoResetEvent _signal = new AutoResetEvent(false);\n\n\t\tpublic void Dispatch(Action<T> action, CancellationToken ct)\n\t\t{\n\t\t\tct.Register(() => _signal.Set());\n\t\t\twhile (!ct.IsCancellationRequested)\n\t\t\t{\n\t\t\t\tDispatchCurrent(action);\n\t\t\t\t_signal.WaitOne();\n\t\t\t}\n\t\t}\n\n\t\tpublic void DispatchCurrent(Action<T> action, Optional<TimeSpan> timeout = default(Optional<TimeSpan>))\n\t\t{\n\t\t\tvar watch = Stopwatch.StartNew();\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\tT message;\n\t\t\t\tif (!_queue.TryDequeue(out message))\n\t\t\t\t\treturn;\n\n\t\t\t\taction(message);\n\t\t\t}\n\t\t\twhile (timeout.Select(t => watch.Elapsed < t).Or(true));\n\t\t\tConsole.WriteLine(\"Timeout!\");\n\t\t}\n\n\t\tpublic void Enqueue(T value)\n\t\t{\n\t\t\t_queue.Enqueue(value);\n\t\t\t_signal.Set();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Threading/PollingDispatcher.cs",
    "content": "using System;\nusing System.Threading;\nusing Outracks.Fusion.Threading;\n\nnamespace Outracks\n{\n\tpublic class PollingDispatcher : DispatcherBase\n\t{\n\t\treadonly Thread _mainThread;\n\t\treadonly DispatcherQueue<Action> _queue = new DispatcherQueue<Action>();\n\n\t\tpublic PollingDispatcher(Thread mainThread)\n\t\t{\n\t\t\t_mainThread = mainThread;\n\t\t}\n\n\t\tpublic void DispatchCurrent()\n\t\t{\n\t\t\t_queue.DispatchCurrent(a => a());\n\t\t}\n\n\t\tpublic override void Enqueue(Action action)\n\t\t{\n\t\t\t_queue.Enqueue(action);\n\t\t\tif (Thread.CurrentThread == _mainThread)\n\t\t\t\tDispatchCurrent();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Threading/QueuedDispatcher.cs",
    "content": "using System;\nusing System.Threading;\nusing Outracks.Fusion.Threading;\n\nnamespace Outracks\n{\n\tpublic class QueuedDispatcher : DispatcherBase\n\t{\n\t\treadonly DispatcherQueue<Action> _queue;\n\t\treadonly Thread _dispatchThread;\n\n\t\tpublic QueuedDispatcher(CancellationToken token = default(CancellationToken))\n\t\t{\n\t\t\t_queue = new DispatcherQueue<Action>();\n\t\t\tvar thread = new Thread(() => _queue.Dispatch(a => a(), token))\n\t\t\t{\n\t\t\t\tIsBackground = true,\n\t\t\t};\n\t\t\tthread.Start();\n\t\t}\n\n\t\tpublic QueuedDispatcher(DispatcherQueue<Action> queue, Thread dispatchThread)\n\t\t{\n\t\t\t_queue = queue;\n\t\t\t_dispatchThread = dispatchThread;\n\t\t}\n\n\t\tpublic override void Enqueue(Action action)\n\t\t{\n\t\t\t_queue.Enqueue(action);\n\t\t\tif (Thread.CurrentThread == _dispatchThread)\n\t\t\t\t_queue.DispatchCurrent(a => a());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/Threading/SingleThreadDispatcherBase.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Diagnostics;\nusing System.Threading;\nusing Outracks.Fusion.Threading;\n\nnamespace Outracks\n{\n\tpublic abstract class SingleThreadDispatcherBase : DispatcherBase\n\t{\n\t\tstatic readonly TimeSpan BusyLogThreshold = TimeSpan.FromSeconds(0.5);\n\t\treadonly Thread _thread;\n\t\tint _drainDepth;\n\n\t\treadonly ConcurrentQueue<Action> _queue = new ConcurrentQueue<Action>();\n\n\t\tprotected SingleThreadDispatcherBase(Thread thread)\n\t\t{\n\t\t\t_thread = thread;\n\t\t}\n\n\t\tprotected bool RunningOnDispatcherThread { get { return _thread == Thread.CurrentThread; } }\n\n\t\tpublic override void Enqueue(Action action)\n\t\t{\n\t\t\t_queue.Enqueue(action);\n\t\t\tFlush();\n\t\t}\n\n\t\tprotected abstract void Flush();\n\n\t\tprotected void Drain()\n\t\t{\n\t\t\tStopwatch stopwatch = _drainDepth == 0 ? Stopwatch.StartNew() : null;\n\t\t\t_drainDepth++;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tAction action;\n\t\t\t\twhile (_queue.TryDequeue(out action))\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\taction();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(\"Exception from CatchAll: \" + e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\t_drainDepth--;\n\t\t\t\tif (stopwatch != null)\n\t\t\t\t{\n\t\t\t\t\tstopwatch.Stop();\n\t\t\t\t\tif (stopwatch.Elapsed > BusyLogThreshold)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(\"Dispatcher busy for {0} seconds (UI unresponsive)\", stopwatch.Elapsed.TotalSeconds);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/TogglePropertyCommand.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class TogglePropertyCommand\n\t{\n\t\tpublic static Command Toggle(this IProperty<bool> self, bool save = false)\n\t\t{\n\t\t\treturn Command.Enabled(() => self.Take(1).Subscribe(v => self.Write(!v, save: save)));\n\t\t}\n\n\t\tpublic static Command Toggle(this BehaviorSubject<bool> self)\n\t\t{\n\t\t\treturn Command.Enabled(() => self.OnNext(!self.Value));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/ToolTip.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class ToolTip\n\t{\n\t\tpublic static IControl SetToolTip(this IControl control, Text toolTip)\n\t\t{\n\t\t\tif (toolTip.IsDefault)\n\t\t\t\treturn control;\n\n\t\t\treturn Implementation.Set(control, toolTip);\n\t\t}\n\n\t\tpublic static class Implementation\n\t\t{\n\t\t\tpublic static Func<IControl, Text, IControl> Set;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/UpdateSubjectCommand.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.Fusion;\n\nnamespace Outracks\n{\n\tpublic static class UpdateSubjectCommand\n\t{\n\t\tpublic static Command Update<T>(this IObserver<T> self, T value)\n\t\t{\n\t\t\treturn Command.Enabled(() => self.OnNext(value));\n\t\t}\n\n\t\tpublic static Command Update<T>(this ISubject<T, T> self, Func<T, T> transform)\n\t\t{\n\t\t\treturn self.DistinctUntilChanged().Switch(value =>\n\t\t\t\tCommand.Enabled(() => self.OnNext(transform(value))));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/UserSettings/FusionJsonSerializer.cs",
    "content": "using System;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class FusionJsonSerializer\n\t{\n\t\tpublic static readonly JsonSerializerSettings Settings;\n\n\t\tstatic FusionJsonSerializer()\n\t\t{\n\t\t\tSettings = new JsonSerializerSettings();\n\t\t\tSettings.Converters.Add(new PointsConverter());\n\t\t\tSettings.Converters.Add(new SizeConverter<Points>());\n\t\t\tSettings.Converters.Add(new PointConverter<Points>());\n\t\t\tSettings.Converters.Add(new PathJsonConverter());\n\t\t\tSettings.Converters.Add(new StringEnumConverter());\n\t\t}\n\n\t\tpublic static JsonSerializer CreateDefault()\n\t\t{\n\t\t\treturn JsonSerializer.Create(Settings);\n\t\t}\n\t}\n\n\tpublic class PointsConverter : JsonConverter\n\t{\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tvar points = (Points)value;\n\t\t\twriter.WriteValue(points.ToDouble());\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tvar token = JToken.Load(reader);\n\t\t\tvar value = token.Value<double>();\n\n\t\t\treturn new Points(value);\n\t\t}\n\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof(Points);\n\t\t}\n\t}\n\n\tpublic class SizeConverter<T> : JsonConverter\n\t{\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tvar size = (Size<T>)value;\n\n\t\t\twriter.WriteStartArray();\n\t\t\tJToken.FromObject(size.Width, serializer).WriteTo(writer);\n\t\t\tJToken.FromObject(size.Height, serializer).WriteTo(writer);\n\t\t\twriter.WriteEndArray();\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tvar children = JToken.Load(reader);\n\t\t\tvar width = children[0].ToObject<T>(serializer);\n\t\t\tvar height = children[1].ToObject<T>(serializer);\n\t\t\treturn new Size<T>(width, height);\n\t\t}\n\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof(Size<T>);\n\t\t}\n\t}\n\n\tpublic class PointConverter<T> : JsonConverter\n\t{\n\t\tpublic override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)\n\t\t{\n\t\t\tvar point = (Point<T>)value;\n\n\t\t\twriter.WriteStartArray();\n\t\t\tJToken.FromObject(point.X, serializer).WriteTo(writer);\n\t\t\tJToken.FromObject(point.Y, serializer).WriteTo(writer);\n\t\t\twriter.WriteEndArray();\n\t\t}\n\n\t\tpublic override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)\n\t\t{\n\t\t\tvar children = JToken.Load(reader);\n\t\t\tvar x = children[0].ToObject<T>(serializer);\n\t\t\tvar y = children[1].ToObject<T>(serializer);\n\t\t\treturn new Point<T>(x, y);\n\t\t}\n\n\t\tpublic override bool CanConvert(Type objectType)\n\t\t{\n\t\t\treturn objectType == typeof(Point<T>);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/UserSettings/PersistentProperty.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tclass PersistentProperty<T> : IProperty<Optional<T>>\n\t{\n\t\treadonly PersistentSettings _settings;\n\n\t\treadonly string _name;\n\t\treadonly BehaviorSubject<Optional<T>> _value;\n\n\t\tpublic PersistentProperty( PersistentSettings settings, string name, Optional<T> value)\n\t\t{\n\t\t\t_settings = settings;\n\t\t\t_name = name;\n\t\t\t_value = new BehaviorSubject<Optional<T>>(value);\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<Optional<T>> observer)\n\t\t{\n\t\t\treturn _value.Subscribe(observer);\n\t\t}\n\n\t\tpublic IObservable<bool> IsReadOnly\n\t\t{\n\t\t\tget { return Observable.Return(false); }\n\t\t}\n\n\t\tpublic void Write(Optional<T> value, bool save)\n\t\t{\n\t\t\t_value.OnNext(value);\n\t\t\t_settings.Write(_name, value);\n\t\t\tif (save) _settings.SaveSettings();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/UserSettings/PersistentSettings.cs",
    "content": "using System;\nusing System.IO;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface ISettings\n\t{\n\t\tIProperty<Optional<T>> Property<T>(string name);\n\t}\n\n\tpublic class EmptySettings : ISettings\n\t{\n\t\tpublic IProperty<Optional<T>> Property<T>(string name)\n\t\t{\n\t\t\treturn Outracks.Property.Create(Optional.None<T>());\n\t\t}\n\t}\n\n\tpublic class PersistentSettings : ISettings\n\t{\n\t\tpublic static ISettings Load(\n\t\t\tAbsoluteFilePath usersettingsfile,\n\t\t\tIFileSystem filesystem = null,\n\t\t\tISettings fallback = null,\n\t\t\tAction<Exception> onError = null)\n\t\t{\n\t\t\treturn new PersistentSettings\n\t\t\t{\n\t\t\t\t_onError = onError ?? Console.Error.WriteLine,\n\t\t\t\t_properties = LoadUserSettings(usersettingsfile, onError ?? Console.Error.WriteLine),\n\t\t\t\t_settingsFile = usersettingsfile,\n\t\t\t\t_fileSystem = filesystem ?? new Shell(),\n\t\t\t\t_fallbackSettings = fallback ?? new EmptySettings(),\n\t\t\t};\n\t\t}\n\n\t\tstatic JObject LoadUserSettings(AbsoluteFilePath usersettingsfile, Action<Exception> onError)\n\t\t{\n\t\t\tif (File.Exists(usersettingsfile.NativePath))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// TODO Use FileSystem methods, make method non-static\n\t\t\t\t\tusing (var loadfile = File.OpenRead(usersettingsfile.NativePath))\n\t\t\t\t\tusing (var filereader = new StreamReader(loadfile))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar json = filereader.ReadToEnd();\n\t\t\t\t\t\tif (!json.IsEmpty())\n\t\t\t\t\t\t\treturn JObject.Parse(json); // FuseSettingsSerializerSettings());\n\t\t\t\t\t\t// TODO try-catch in case deserialization doesn't work\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tonError(e);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new JObject();\n\t\t}\n\n\t\treadonly JsonSerializer _jsonSerializer = FusionJsonSerializer.CreateDefault();\n\n\t\tJObject _properties;\n\t\tAbsoluteFilePath _settingsFile;\n\t\tIFileSystem _fileSystem;\n\t\tISettings _fallbackSettings;\n\t\tAction<Exception> _onError;\n\t\treadonly object _lock = new object();\n\n\t\tpublic IProperty<Optional<T>> Property<T>(string name)\n\t\t{\n\t\t\tvar value = _properties.TryGetValue(name).SelectMany(TryParse<T>);\n\t\t\tvar ownProperty = new PersistentProperty<T>(this, name, value);\n\t\t\tvar fallbackProperty = _fallbackSettings.Property<T>(name);\n\t\t\treturn ownProperty.With(value: ownProperty.Or(fallbackProperty));\n\t\t}\n\n\t\tpublic void Write<T>(string name, Optional<T> value)\n\t\t{\n\t\t\tlock (_lock)\n\t\t\t{\n\t\t\t\tif (!value.HasValue)\n\t\t\t\t{\n\t\t\t\t\t_properties.Remove(name);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_properties[name] = JToken.FromObject(value.Value, _jsonSerializer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpublic void SaveSettings()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlock (_lock)\n\t\t\t\t{\n\t\t\t\t\tDirectory.CreateDirectory(_settingsFile.ContainingDirectory.NativePath);\n\t\t\t\t\t_fileSystem.ReplaceText(_settingsFile, _properties.ToString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_onError(e);\n\t\t\t}\n\t\t}\n\n\t\tOptional<T> TryParse<T>(JToken token)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn token.ToObject<T>(_jsonSerializer);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_onError(e);\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n\n"
  },
  {
    "path": "src/fusion/core/UserSettings/UserSettings.cs",
    "content": "using System.Collections.Generic;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class UserSettings\n\t{\n\t\tpublic static ISettings Settings { get; set; }\n\n\t\tpublic static IProperty<Optional<bool>> Bool(string name)\n\t\t{\n\t\t\treturn Settings.Property<bool>(name);\n\t\t}\n\n\t\tpublic static IProperty<Optional<Size<Points>>> Size(string name)\n\t\t{\n\t\t\treturn Settings.Property<Size<Points>>(name);\n\t\t}\n\n\t\tpublic static IProperty<Optional<Points>> Point(string name)\n\t\t{\n\t\t\treturn Settings.Property<Points>(name);\n\t\t}\n\n\t\tpublic static IProperty<Optional<Point<Points>>> Position(string name)\n\t\t{\n\t\t\treturn Settings.Property<Point<Points>>(name);\n\t\t}\n\n\t\tpublic static IProperty<Optional<IEnumerable<T>>> List<T>(string name)\n\t\t{\n\t\t\treturn Settings.Property<IEnumerable<T>>(name);\n\t\t}\n\n\t\tpublic static IProperty<Optional<AbsoluteDirectoryPath>> Folder(string name)\n\t\t{\n\t\t\treturn Settings.Property<AbsoluteDirectoryPath>(name);\n\t\t}\n\n\t\tpublic static IProperty<Optional<T>> Enum<T>(string name)\n\t\t{\n\t\t\treturn Settings.Property<T>(name);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/core/ValidatedProperty.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\n\nnamespace Outracks.Fusion\n{\n\tpublic interface IValidatedProperty<T> : IProperty<T>\n\t{\n\t\tIObservable<Optional<string>> ValidationError { get; }\n\t}\n\n\tpublic static class ValidatedProperty\n\t{\n\t\tpublic static IValidatedProperty<string> Validate<T>(\n\t\t\tthis IProperty<Optional<T>> self,\n\t\t\tFunc<T, string> toString,\n\t\t\tFunc<string, IValidationResult<T>> fromString)\n\t\t{\n\t\t\tvar validationError = new BehaviorSubject<Optional<string>>(Optional.None());\n\t\t\treturn new ValidatedProperty<string>\n\t\t\t{\n\t\t\t\tValue = self.SelectPerElement(toString).Or(\"\"),\n\t\t\t\tIsReadOnly = self.IsReadOnly,\n\t\t\t\tValidationError = validationError.Merge(self.Select(v => Optional.None<string>())),\n\t\t\t\tWriter = (v, save) => fromString(v).MatchWith(\n\t\t\t\t\t(T t) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tself.Write(Optional.Some(t));\n\t\t\t\t\t\tvalidationError.OnNext(Optional.None<string>());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t\t(string e) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tself.Write(Optional.None());\n\t\t\t\t\t\tvalidationError.OnNext(Optional.Some(e));\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}),\n\t\t\t};\n\t\t}\n\t}\n\n\tclass ValidatedProperty<T> : IValidatedProperty<T>\n\t{\n\t\tpublic IObservable<T> Value { get; set; }\n\t\tpublic IObservable<bool> IsReadOnly { get; set; }\n\t\tpublic IObservable<Optional<string>> ValidationError { get; set; }\n\t\tpublic Action<T, bool> Writer { get; set; }\n\n\t\tpublic void Write(T value, bool save)\n\t\t{\n\t\t\tWriter(value, save);\n\t\t}\n\n\t\tpublic IDisposable Subscribe(IObserver<T> observer)\n\t\t{\n\t\t\treturn Value.Subscribe(observer);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/Window.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion\n{\n\tpublic enum WindowState\n\t{\n\t\tNormal,\n\t\tMaximized\n\t}\n\n\tpublic enum WindowStyle\n\t{\n\t\tRegular, Sheet, None, Fat\n\t}\n\n\tpublic class Window\n\t{\n\t\tpublic WindowStyle Style { get; set; }\n\t\tpublic IObservable<string> Title { get; set; }\n\t\tpublic Optional<IObservable<Icon>> Icon { get; set; }\n\n\t\tpublic Optional<Menu> Menu { get; set; }\n\t\tpublic IControl Content { get; set; }\n\n\t\tpublic Command Closed { get; set; }\n\n\t\tpublic Optional<IProperty<Optional<Size<Points>>>> Size { get; set; }\n\t\tpublic Optional<IProperty<Optional<Point<Points>>>> Position { get; set; }\n\t\tpublic Optional<IProperty<Optional<WindowState>>> State { get; set; }\n\n\t\tpublic Optional<IObservable<bool>> TopMost { get; set; }\n\t\tpublic Optional<IObservable<bool>> HideMenu { get; set; }\n\n\t\tpublic Optional<DropOperation> DragOperation { get; set; }\n\t\tpublic Command Focused { get; set; }\n\n\t\tpublic Stroke Border { get; set; }\n\t\tpublic Brush Background { get; set; }\n\t\tpublic Brush Foreground { get; set; }\n\t\tpublic bool HideTitle { get; set; }\n\n\t\tpublic Window()\n\t\t{\n\t\t\tStyle = WindowStyle.Regular;\n\t\t\tTitle = Observable.Return(\"\");\n\t\t\tContent = Control.Empty;\n\t\t\tClosed = Command.Disabled;\n\t\t\tFocused = Command.Disabled;\n\t\t\tBorder = Stroke.Empty;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/core/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"FuseOpen.Svg\" version=\"2.3.1\" targetFramework=\"net45\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fusion/docs/GettingStarted.md",
    "content": "# Fusion - Getting Started\n_Fusion is a framework for cross-platform UI development, which uses the native UI framework to render its content. It's based on a reactive philosphy, where the UI is updated on demand compared to immediate UI mode frameworks._\n\n## Creating your first view\nA view in _Fusion_ is a composition of `IControl`'s that are put together to create a view.\n\nHere is an example showing two labels stacked on each other:\n\n```csharp\nLayout.StackFromTop(\n\tLabel.Create(\"My first text\"),\n    Label.Create(\"My second text\")\n);\n```\n\n\nThis will show two labels stacked on top of each other. So in this example, we make two `IControl`'s representing the two labels in the view, and then those are composited by the `Layout.StackFromTop` which in turn creates a new `IControl` consisting of the two `IControl`'s stacked on top of each other.\n\nHere is a new example showing a more advanced example, where the label text is dynamic:\n```csharp\nvar watch = Observable.Interval(TimeSpan.FromSeconds(1))\n\t.Select(time => time + 1)\n\t.StartWith(0);\n\nreturn Layout.StackFromTop(\n    Label.Create(watch.Select(time => time.ToString()), Font.SystemDefault(20))\n).Center();\n```\n\nThe label's text subscribes to the `IObservable`, where the source is a timer that ticks every second, starting from 0. The `Font.SystemDefault` method is used to get a system font with a specific size. So the font will differ between Windows and macOS. Also the last line says `.Center()`, which centers the stackpanel inside its parent frame.\n\nSo now we have shown that you can have static text and dynamic text, but you can also have dynamic layout:\n```csharp\nvar watch = Observable.Interval(TimeSpan.FromSeconds(1))\n\t.Select(time => time + 1)\n\t.StartWith(0);\n\nvar shapeBasedOnTime = watch\n        .Select(time => (time % 2) == 0) // Check if even number\n        .Select(isEven => isEven\n            ? Shapes.Rectangle(fill: Brush.SolidColor(Color.FromRgb(0x2255ff)))\n            : Shapes.Circle(fill: Brush.SolidColor(Color.FromRgb(0x2255ff))))\n        .Switch();\n\nreturn Layout.StackFromTop(\n    Label.Create(watch.Select(time => time.ToString()), Font.SystemDefault(100), TextAlignment.Center),\n    shapeBasedOnTime.WithSize(new Size<Points>(100,100))\n).Center();\n```\n\nSo this example uses the `watch` to switch between two shapes, based on if the watch time is even or not. The interesting part here is that a `IObservable<IControl>` can be converted to a `IControl` by doing a `.Switch()` on the type as on line 10. This behaviour, is as you would expect a `Switch()` on a `IObservable<IObservable<OfSomething>>` would do. What that tells us is that `IControl` is what we call an _Observable interface_, in the sense that its backing field data is observable.\n\n## Layout\n**TODO: Show some examples of how to do layout, and how to use padding etc.**\n\n## Understanding databindings in Fusion\nThere is mainly three ways the data is passed between the declaration of the UI and Fusion. As shown below:\n* `IObservable` - Is used for read-only bindings between the data and the view. Which means that the view listens for changes to this variable, and where the view isn't allowed to change it.\n* `IProperty` - Is used for two-way bindings between the data and the view, for example in an editable textbox.\n* `Command` _(Note: Subject to change)_ - Is used for events triggered by the view. For example when a button is clicked, the command is executed. In other words, `Command` suits only as a contract between the decleration and the view, and there are no data flow going on here.\n\nLets look at an example which shows the use of `IProperty`:\n```csharp\nvar text = Property.Create(\"Type here\");\nreturn Layout.StackFromTop(\n    TextBox.Create(text).WithWidth(150),\n    Label.Create(text.Skip(1).StartWith(\"\"))\n).Center();\n```\nFirst we create a property to be used as our backing storage for our user input(`TextBox`). This property is then bound to `TextBox` and `Label`, which in effect cause the `Label` to change in response to `TextBox` changes.\n\n** TODO: Write something about ICommand and IObservable input (mention Observable.Return eg.) **\n\n\n\n\n\n"
  },
  {
    "path": "src/fusion/docs/Reference.md",
    "content": "# Fusion - Reference\n\nThis reference aims to introduce the most important elements of Fusion. To learn Fusion, we recommend starting by reading [Getting Started](GettingStarted.md), and using [AutoReload](../AutoReload/README.md) to experiment.\n\n## Table of contents\n\n- [Layout](#layout)\n  - [Stack](#stack)\n  - [Dock](#dock)\n  - [Composing](#composing)\n  - [Centering](#centering)\n  - [Padding / Margin](#padding--margin)\n  - [Height / Width](#height--width)\n  - [Scrolling](#scrolling)\n\n## Layout\n\nIn Fusion, almost everything is built up by composing stack and dock layouts.\n\nAll controls default to fill their available space, unless otherwise specified.\n\n### Stack\nTo create a stacking layout, use these:\n\n- `Layout.StackFromTop`\n- `Layout.StackFromBottom`\n- `Layout.StackFromLeft`\n- `Layout.StackFromRight`\n\n#### Example\n\n```cs\nLayout.StackFromTop(\n\tLabel.Create(\"foo\"),\n\tLabel.Create(\"bar\"));\n```\n\n![](images/StackFromTop.png)\n\n```cs\nLayout.StackFromRight(\n\tLabel.Create(\"foo\"),\n\tLabel.Create(\"bar\"));\n```\n\n![](images/StackFromRight.png)\n\n### Dock\nTo create a docking layout, use `Layout.Dock()`, followed by any of these:\n\n- `Left()`\n- `Right()`\n- `Top()`\n- `Bottom()`\n\nAnd finally `Fill()` to fill the remaining space. (Note that the final `Fill()` is mandatory, but you can use `Fill()` with no parameters.)\n\n#### Example:\n\n```cs\nreturn Layout.Dock()\n\t.Left(Label.Create(\"left\"))\n\t.Right(Label.Create(\"right\"))\n\t.Fill(Label.Create(\"middle\", textAlignment:TextAlignment.Center));\n```\n\n![](images/Dock.png)\n\nYou can also dock several things to the same side:\n\n```cs\nreturn Layout.Dock()\n\t.Left(Label.Create(\"left\"))\n\t.Left(Label.Create(\"left2\")) //Notice \"Left\" again\n\t.Fill(Label.Create(\"fill\"));\n```\n\n![](images/DockTwice.png)\n\n#### Dock shortcuts\n\nWe have a set of shortcuts that put a control inside a dock panel and dock it to a specific place. These are convenient when you just want to dock something to one side, rather than having a full dock panel with other content for `Fill`.\n\n- `DockLeft`\n- `DockRight`\n- `DockBottom`\n- `DockTop`\n- `DockTopLeft`\n- `DockTopRight`\n- `DockBottomLeft`\n- `DockBottomRight`\n\n#### Example\n\nDocking something to top right:\n```cs\nLabel.Create(\"hi\")\n\t.WithBackground(Color.FromRgb(0xff0000))\n\t.DockTopRight()\n\t.WithBackground(Color.FromRgb(0x00ff00));\n```\n\nHere we create a label, give it a red background, dock that to the top right, and then give the encapsulating dock panel a green background.\n\n![](images/DockTopRight.png)\n\n### Composing\n\nLayouts can of course also be composed.\n\n#### Example:\n\n```cs\nLayout.Dock()\n\t.Left(Label.Create(\"left\"))\n\t.Right(Label.Create(\"right\"))\n\t.Fill(Layout.StackFromTop(\n\t\tLabel.Create(\"1\"),\n\t\tLabel.Create(\"2\")));\n```\n\n![](images/Compose.png)\n\n### Centering\nThere are three methods of centering a component within its parent:\n\n- `Center`\n- `CenterHorizontally`\n- `CenterVertially`\n\n#### Example:\n\n```cs\nLabel.Create(\"foo\");\n```\n\n![](images/NoCenter.png)\n\n```cs\nLabel.Create(\"foo\").Center()\n```\n\n![](images/Center.png)\n\n```cs\nLabel.Create(\"foo\").CenterHorizontally();\n```\n\n![](images/CenterHorizontally.png)\n\n```cs\nLabel.Create(\"foo\").CenterVertically();\n```\n\n![](images/CenterVertically.png)\n\n### Padding / Margin\nWe only have a concept of `Padding`. This adds padding *around* the element it's applied to. If you're coming from CSS, it helps to think of our padding as a margin in CSS.\n\n`Padding` can be specified with a `Thickness<Points>` for all the edges, or individual `Optional<Points>` for each edge.\n\n#### Example:\n\nSpecifying a general `Thickness<Points>`:\n\n```cs\nLabel.Create(\"hi\")\n\t.WithBackground(Color.FromRgb(0xff0000))\n\t.WithPadding(new Thickness<Points>(10))\n\t.WithBackground(Color.FromRgb(0x00ff00))\n\t.Center();\n```\n\n![](images/Padding.png)\n\nSpecifying `Optional<Points>`:\n\n```cs\nLabel.Create(\"hi\")\n\t.WithBackground(Color.FromRgb(0xff0000))\n\t.WithPadding(new Points(5), new Points(10), new Points(15), new Points(20))\n\t.WithBackground(Color.FromRgb(0x00ff00))\n\t.Center();\n```\n\n![](images/PaddingPoints.png)\n\nThis is a good point to note that both `WithBackground` and `WithPadding`, like most functions in Fusion, return an `IControl`. This is why it's so easy to compose things, and chain menthod calls like in the example above.\n\n### Height / Width\nYou can use `WithWidth`, `WithHeight` and `WithSize` to control the width and height of a control\n\nNote that these functions have no effect unless the control is inside another control which is allows it to use a non-full size, such as a `Stack` or `Dock`.\n\n#### Example:\n\nSpecifying a width:\n\n```cs\nreturn Label.Create(\"hi\")\n\t.WithBackground(Color.FromRgb(0xff0000))\n\t.WithWidth(new Points(42))\n\t.DockLeft(); //To allow the layout to collapse down to 42 points\n```\n\n![](images/WithWidth.png)\n\nSpecifying a size:\n\n```cs\nreturn Label.Create(\"hi\")\n\t.WithBackground(Color.FromRgb(0xff0000))\n\t.WithSize(new Size<Points>(42, 42))\n\t.DockLeft(); //To allow the layout to collapse down\n```\n\n![](images/WithSize.png)\n\n## Scrolling\n\nUse `MakeScrollable` to add scrolling capabilities to content that doesn't fit in its containing control:\n\n```cs\nreturn Layout.StackFromTop(\n\tLabel.Create(\"1\").WithHeight(new Points(20)),\n\tLabel.Create(\"2\").WithHeight(new Points(20)),\n\tLabel.Create(\"3\").WithHeight(new Points(20)))\n\t.MakeScrollable()\n\t.WithHeight(new Points(40))\n\t.DockTop();\n```\n\n![](images/MakeScrollable.gif)\n\n## TODO\n- Buttons, Labels, TextInput\n- Panes, resizable stuff (MakeResizable)\n- Brushes\n- Fonts\n- Icons\n- Colours\n- Background\n- Context menu (SetContextMenu)\n"
  },
  {
    "path": "src/fusion/integration-tests/.gitignore",
    "content": "fusion-integrations.app\n"
  },
  {
    "path": "src/fusion/integration-tests/ControlLeakTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Subjects;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing NUnit.Framework;\nusing NUnit.Framework.Internal;\n\nnamespace Outracks.Fusion.IntegrationTests\n{\n\t[Apartment(ApartmentState.STA)]\n\t[TestFixture]\n\t[Ignore(\"Tests are failing on TC, and has to be investigated.\")]\n\tpublic class ControlLeakTests\n\t{\n\t\tinternal static IApplication _application;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tConsole.WriteLine(\"Thread \" + Thread.CurrentThread.ManagedThreadId);\n\t\t\tif (_application == null)\n\t\t\t{\n\t\t\t\t_application = Application.Initialize(new List<string>());\n\t\t\t}\n\t\t}\n\n\t\tstatic void RunInMainThread(Action action)\n\t\t{\n\t\t\tManualResetEvent waitHandle = new ManualResetEvent(false);\n\t\t\tException innerException = null;\n\t\t\tvar outerContext = TestExecutionContext.CurrentContext;\n\n\t\t\tApplication.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tif (TestExecutionContext.CurrentContext == null)\n\t\t\t\t{\n\t\t\t\t\tvar innerContext = new TestExecutionContext(outerContext);\n\t\t\t\t\tinnerContext.EstablishExecutionEnvironment();\n\t\t\t\t}\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\taction();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tinnerException = e;\n\t\t\t\t}\n\t\t\t\twaitHandle.Set();\n\t\t\t});\n\t\t\twaitHandle.WaitOne();\n\t\t\tif (innerException != null)\n\t\t\t{\n\t\t\t\tthrow new InvalidOperationException(\"Got exception while running in main thread\", innerException);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Rectangle_is_unsubscribed_after()\n\t\t{\n\t\t\tRunInMainThread(() =>\n\t\t\t{\n\t\t\t\tvar stroke = new BehaviorSubject<Stroke>(Stroke.Empty);\n\t\t\t\tvar brush = new BehaviorSubject<Brush>(Brush.Transparent);\n\t\t\t\tvar cornerRadius = new BehaviorSubject<CornerRadius>(CornerRadius.None);\n\n\t\t\t\tvar rectangle = Shapes.Rectangle(stroke.Switch(), brush.Switch(), cornerRadius);\n\t\t\t\tAssert.That(stroke.HasObservers, Is.False);\n\t\t\t\tAssert.That(brush.HasObservers, Is.False);\n\t\t\t\tAssert.That(cornerRadius.HasObservers, Is.False);\n\t\t\t\trectangle.MountRoot();\n\t\t\t\tAssert.That(stroke.HasObservers, Is.True);\n\t\t\t\tAssert.That(brush.HasObservers, Is.True);\n\t\t\t\tAssert.That(cornerRadius.HasObservers, Is.True);\n\t\t\t\trectangle.Mount(MountLocation.Unmounted);\n\t\t\t\tAssert.That(brush.HasObservers, Is.False);\n\t\t\t\tAssert.That(stroke.HasObservers, Is.False);\n\t\t\t\tAssert.That(cornerRadius.HasObservers, Is.False);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Label_is_unsubscribed_after()\n\t\t{\n\t\t\tRunInMainThread(() =>\n\t\t\t{\n\t\t\t\tvar text = new BehaviorSubject<string>(\"boom\");\n\t\t\t\tvar label = Label.Create(text.AsText());\n\t\t\t\tAssert.That(text.HasObservers, Is.False);\n\t\t\t\tlabel.MountRoot();\n\t\t\t\tAssert.That(text.HasObservers, Is.True);\n\t\t\t\tlabel.Mount(MountLocation.Unmounted);\n\t\t\t\tAssert.That(text.HasObservers, Is.False);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Button_is_unsubscribed_after()\n\t\t{\n\t\t\tRunInMainThread(() =>\n\t\t\t{\n\t\t\t\tvar command = new BehaviorSubject<Command>(Command.Enabled(action: () => { }));\n\t\t\t\tvar button = Button.Create(command.Switch());\n\t\t\t\tAssert.That(command.HasObservers, Is.False);\n\t\t\t\tbutton.MountRoot();\n\t\t\t\tAssert.That(command.HasObservers, Is.True);\n\t\t\t\tbutton.Mount(MountLocation.Unmounted);\n\t\t\t\tAssert.That(command.HasObservers, Is.False);\n\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void LayoutTracker_leak_test()\n\t\t{\n\t\t\tRunInMainThread(() =>\n\t\t\t{\n\t\t\t\tAssertIsGarbageCollected(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tBehaviorSubject<IEnumerable<IControl>> innerControls =\n\t\t\t\t\t\t\tnew BehaviorSubject<IEnumerable<IControl>>(Enumerable.Empty<IControl>());\n\t\t\t\t\t\tvar container = LayoutTracker.Create(\n\t\t\t\t\t\t\tx => innerControls.CachePerElement(y => x.TrackVisualBounds(frame => { }, y)).StackFromLeft());\n\t\t\t\t\t\tcontainer.MountRoot();\n\t\t\t\t\t\treturn new { innerControls, container };\n\t\t\t\t\t},\n\t\t\t\t\tenv =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar innerControls = env.innerControls;\n\t\t\t\t\t\tvar rectangleHeight = new BehaviorSubject<Points>(33);\n\t\t\t\t\t\tvar rectangle = Shapes.Rectangle(fill: Brush.Transparent).WithWidth(rectangleHeight);\n\t\t\t\t\t\tAssert.That(rectangleHeight.HasObservers, Is.False);\n\t\t\t\t\t\tinnerControls.OnNext(new[] { rectangle });\n\t\t\t\t\t\tAssert.That(rectangleHeight.HasObservers, Is.True);\n\t\t\t\t\t\tinnerControls.OnNext(Enumerable.Empty<IControl>());\n\t\t\t\t\t\tAssert.That(rectangleHeight.HasObservers, Is.False);\n\t\t\t\t\t\treturn rectangle;\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void Stack_leak_test()\n\t\t{\n\t\t\tRunInMainThread(() =>\n\t\t\t{\n\t\t\t\tAssertIsGarbageCollected(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tBehaviorSubject<IEnumerable<IControl>> innerControls =\n\t\t\t\t\t\t\tnew BehaviorSubject<IEnumerable<IControl>>(Enumerable.Empty<IControl>());\n\t\t\t\t\t\tvar container = innerControls.StackFromLeft();\n\t\t\t\t\t\tcontainer.MountRoot();\n\t\t\t\t\t\treturn new { innerControls, container };\n\t\t\t\t\t},\n\t\t\t\t\tx =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar innerControls = x.innerControls;\n\t\t\t\t\t\tvar rectangleHeight = new BehaviorSubject<Points>(33);\n\t\t\t\t\t\tvar rectangle = Shapes.Rectangle(fill: Brush.Transparent);\n\t\t\t\t\t\trectangle = rectangle.WithWidth(rectangleHeight);\n\t\t\t\t\t\tAssert.That(rectangleHeight.HasObservers, Is.False);\n\t\t\t\t\t\tinnerControls.OnNext(new[] { rectangle });\n\t\t\t\t\t\tAssert.That(rectangleHeight.HasObservers, Is.True);\n\t\t\t\t\t\tinnerControls.OnNext(Enumerable.Empty<IControl>());\n\t\t\t\t\t\tAssert.That(rectangleHeight.HasObservers, Is.False);\n\t\t\t\t\t\treturn rectangle;\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.NoInlining)]\n\t\tstatic WeakReference InvokeAndReturnWeakRef<TEnv>(TEnv env, Func<TEnv, object> func)\n\t\t{\n\t\t\treturn new WeakReference(func(env));\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Check that the object returned from the <paramref name=\"garbageFunc\"/> delegate do not outlive\n\t\t/// environment set up by <paramref name=\"environmentFactory\"/>\n\t\t/// </summary>\n\t\t/// <typeparam name=\"TEnv\">Type of environment</typeparam>\n\t\t/// <param name=\"environmentFactory\">Environment, which is kept alive while during forced GC</param>\n\t\t/// <param name=\"garbageFunc\">Object that we will assert whether it gets garbage collected or not</param>\n\t\t[MethodImpl(MethodImplOptions.NoInlining)]\n\t\tstatic void AssertIsGarbageCollected<TEnv>(Func<TEnv> environmentFactory, Func<TEnv, object> garbageFunc)\n\t\t{\n\t\t\tAssert.That(\n\t\t\t\tgarbageFunc.Target.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Length,\n\t\t\t\tIs.EqualTo(0),\n\t\t\t\t\"Delegate should not capture anything\");\n\n\t\t\tvar env = environmentFactory();\n\t\t\tAssertIsGarbageCollected(env, garbageFunc);\n\t\t\tGC.KeepAlive(env);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.NoInlining)]\n\t\tstatic void AssertIsGarbageCollected<TEnv>(TEnv env, Func<TEnv, object> func)\n\t\t{\n\t\t\t// We don't have control over (temporary) local variables in function\n\t\t\t// so we have to make and return the weak reference from another method.\n\t\t\tvar weakref = InvokeAndReturnWeakRef(env, func);\n\t\t\tGC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true);\n\t\t\tThread.Sleep(100);\n\t\t\tGC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true);\n\t\t\tAssert.That(weakref.IsAlive, Is.False, \"Object that was expected collected survied. It should have DIED!\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/integration-tests/ControlTestExtensions.cs",
    "content": "using System.Reactive.Linq;\n\nnamespace Outracks.Fusion.IntegrationTests\n{\n\tstatic class ControlTestExtensions\n\t{\n\t\tpublic static void MountRoot(this IControl control)\n\t\t{\n\t\t\tvar size = Size.Create(Observable.Return(new Points(4)), Observable.Return(new Points(4)));\n\t\t\tcontrol.Mount(\n\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t{\n\t\t\t\t\tIsRooted = Observable.Return(true),\n\t\t\t\t\tAvailableSize = size,\n\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(size)\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/integration-tests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDisplayName</key>\n\t<string>fusion-integrations</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.fuse-x.FusionIntegrationTests</string>\n\t<key>CFBundleName</key>\n\t<string>FusionIntegrationTests</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0.0</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>10.10</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0.0</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/fusion/integration-tests/Program.cs",
    "content": "// ***********************************************************************\n// Copyright (c) 2015 Charlie Poole\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// ***********************************************************************\n\nusing System;\nusing System.IO;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Text;\nusing System.Threading;\nusing NUnit.Common;\nusing Outracks.Extensions;\nusing Outracks.Fusion;\nusing Outracks.Fusion.IntegrationTests;\n\nnamespace NUnitLite.Tests\n{\n\tpublic class Program\n\t{\n\t\tclass ConsoleAndDialogLogWriter : TextWriter\n\t\t{\n\t\t\treadonly Subject<string> _chunks = new Subject<string>();\n\t\t\treadonly TextWriter _consoleOut;\n\t\t\treadonly object _lock = new object();\n\n\t\t\tpublic ConsoleAndDialogLogWriter(TextWriter consoleOut)\n\t\t\t{\n\t\t\t\t_consoleOut = consoleOut;\n\t\t\t}\n\n\t\t\tpublic override Encoding Encoding\n\t\t\t{\n\t\t\t\tget { return Encoding.UTF8; }\n\t\t\t}\n\n\t\t\tpublic IObservable<string> Chunks\n\t\t\t{\n\t\t\t\tget { return _chunks; }\n\t\t\t}\n\n\t\t\tpublic override void Write(char[] buffer, int index, int count)\n\t\t\t{\n\t\t\t\t_consoleOut.Write(buffer, index, count);\n\t\t\t\tlock (_lock)\n\t\t\t\t\t_chunks.OnNext(new string(buffer, index, count));\n\t\t\t}\n\n\t\t\tpublic override void Write(char value)\n\t\t\t{\n\t\t\t\t_consoleOut.Write(value);\n\t\t\t\tlock (_lock)\n\t\t\t\t\t_chunks.OnNext(value.ToString());\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// The main program executes the tests. Output may be routed to\n\t\t/// various locations, depending on the arguments passed.\n\t\t/// </summary>\n\t\t/// <remarks>Run with --help for a full list of arguments supported</remarks>\n\t\t/// <param name=\"args\"></param>\n\t\t[STAThread]\n\t\tpublic static int Main(string[] args)\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n\n\t\t\tControlLeakTests._application = Application.Initialize(args);\n\n\t\t\tvar log = new ReplaySubject<string>();\n\t\t\tvar writer = new ConsoleAndDialogLogWriter(Console.Out);\n\t\t\twriter.Chunks.Subscribe(log);\n\t\t\tConsole.SetOut(writer);\n\n\t\t\tint returnValue = -1;\n\n\t\t\tApplication.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: Observable.Return(true),\n\t\t\t\twindow: window =>\n\t\t\t\t{\n\t\t\t\t\tThreadPool.QueueUserWorkItem(\n\t\t\t\t\t\t_ =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.Sleep(300);\n\t\t\t\t\t\t\treturnValue = new AutoRun().Execute(args, new ExtendedTextWrapper(writer), Console.In);\n\t\t\t\t\t\t\tApplication.Exit((byte)returnValue);\n\t\t\t\t\t\t});\n\t\t\t\t\treturn new Window\n\t\t\t\t\t{\n\t\t\t\t\t\tTitle = Observable.Return(\"Integration tests\"),\n\t\t\t\t\t\t//Menu = Menu.Create(MenuItem.Create(\"Debug\", createDebugWindow)),\n\t\t\t\t\t\tContent = LogView.Create(log.Select(s => s), Observable.Return(Color.Black))\n\t\t\t\t\t\t\t.WithHeight(200)\n\t\t\t\t\t\t\t.WithBackground(Color.White)\n\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tApplication.Run();\n\t\t\treturn returnValue;\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/integration-tests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Outracks.Fusion.IntegrationTests\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/fusion/integration-tests/Resources/DIR",
    "content": ""
  },
  {
    "path": "src/fusion/integration-tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"nunit.framework\" publicKeyToken=\"2638cd05610744eb\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-3.7.1.0\" newVersion=\"3.7.1.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Reactive\" publicKeyToken=\"94bc3704cddfc263\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.4.0.0\" newVersion=\"4.4.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/fusion/integration-tests/integration-tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{580BA299-ADAD-43C1-86A7-63E60F345F28}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fusion.IntegrationTests</RootNamespace>\n    <AssemblyName>fusion-integrations</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile />\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"nunitlite, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnitLite.3.12.0\\lib\\net45\\nunitlite.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ControlLeakTests.cs\" />\n    <Compile Include=\"ControlTestExtensions.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\">\n      <SubType>Designer</SubType>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n</Project>"
  },
  {
    "path": "src/fusion/integration-tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"NUnitLite\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fusion/mac/AppDelegate.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Subjects;\nusing AppKit;\nusing Foundation;\n\nnamespace Outracks.Fusion\n{\n\tclass ShutdownException : Exception\n\t{\n\t}\n\n\tpublic class AppDelegate : NSApplicationDelegate\n\t{\n\t\tpublic static bool ThrowOnTerminate { get; set; }\n\n\t\treadonly Subject<Unit> _terminates = new Subject<Unit>();\n\t\tpublic IObservable<Unit> Terminates\n\t\t{\n\t\t\tget { return _terminates; }\n\t\t}\n\n\t\treadonly bool _isDocumentApp;\n\t\tpublic AppDelegate(bool isDocumentApp)\n\t\t{\n\t\t\t_isDocumentApp = isDocumentApp;\n\t\t}\n\n\t\tpublic AppDelegate(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic override void WillTerminate(NSNotification notification)\n\t\t{\n\t\t\t_terminates.OnNext(Unit.Default);\n\t\t}\n\n\t\tpublic override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool ApplicationShouldOpenUntitledFile(NSApplication sender)\n\t\t{\n\t\t\tif(_isDocumentApp)\n\t\t\t\tApplication.LaunchedWithoutDocuments();\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override NSApplicationTerminateReply ApplicationShouldTerminate (NSApplication sender)\n\t\t{\n\t\t\tif (!ThrowOnTerminate)\n\t\t\t\treturn NSApplicationTerminateReply.Now;\n\n\t\t\tApplication.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tthrow new ShutdownException();\n\t\t\t});\n\n\t\t\treturn NSApplicationTerminateReply.Later;\n\t\t}\n\t}\n\n\t/*\n\t *\n\t *\n\t\t\tvoid SetWindowSize(Size<Points> windowSize)\n\t\t{\n\t\t\tvar currentFrame = _window.Frame;\n\t\t\tvar origin = new PointF(currentFrame.X, currentFrame.Y + currentFrame.Height);\n\n\t\t\tvar titleBarHeight = currentFrame.Height - _window.ContentView.Frame.Height;\n\n\t\t\tvar sizeWithBar = new SizeF((float)windowSize.Width, (float)windowSize.Height + titleBarHeight);\n\t\t\torigin.Y -= sizeWithBar.Height;\n\n\t\t\t_resizeNotDoneByUser = true;\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_window.SetFrame(new RectangleF(origin, sizeWithBar), true, true);\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\t_resizeNotDoneByUser = false;\n\t\t\t}\n\t\t}\n\t *\n\t *\n\tpublic partial class AppDelegate : NSApplicationDelegate, IMainThread\n\t{\n\t\tvoid Initialize()\n        {\n        }\n\n        partial void HandleFileOpen(NSObject sender)\n        {\n            var dialog = new NSOpenPanel()\n            {\n                Title = \"Select your .unoproj\",\n                Prompt = \"Build & Run\",\n                AllowedFileTypes = new[] { \"unoproj\" },\n            };\n\n            dialog.Begin(result => {\n            });\n        }\n\n        partial void HandleFileClose(NSObject sender)\n        {\n            var keyWindow = NSApplication.SharedApplication.KeyWindow;\n\n            if (keyWindow != null)\n                keyWindow.Close();\n        }\n\n        partial void HandleViewRefresh(NSObject sender)\n        {\n        }\n\n        partial void HandleViewEnableFullscreen(NSObject sender)\n        {\n        }\n\n        partial void HandleWindowOutput(NSObject sender)\n        {\n        }\n\n        public override void FinishedLaunching(NSObject notification)\n        {\n            Initialize();\n        }\n\n        public override void WillTerminate(NSNotification notification)\n        {\n        }\n\n        public override bool OpenFile(NSApplication sender, string filename)\n        {\n            return true;\n        }\n\n        void IMainThread.EnsureMainThread()\n        {\n            NSApplication.EnsureUIThread();\n        }\n    }\n    */\n}\n"
  },
  {
    "path": "src/fusion/mac/AppDelegate.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\n\nnamespace Outracks.Fuse\n{\n\t[Register (\"AppDelegate\")]\n\tpartial class AppDelegate\n\t{\n\t\t/*[Action (\"HandleFileClose:\")]\n\t\tpartial void HandleFileClose (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleFileOpen:\")]\n\t\tpartial void HandleFileOpen (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleViewEnableFullscreen:\")]\n\t\tpartial void HandleViewEnableFullscreen (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleViewRefresh:\")]\n\t\tpartial void HandleViewRefresh (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleWindowOutput:\")]\n\t\tpartial void HandleWindowOutput (Foundation.NSObject sender);*/\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Application.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing AppKit;\nusing Foundation;\nusing ObjCRuntime;\nusing Outracks.Fuse;\nusing Outracks.Fuse.Analytics;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.Mac\n{\n\t//using UnoHost;\n\n\tpublic class Application : IApplication\n\t{\n\t\tpublic ITrayApplication CreateTrayApplication(IReport errorHandler, IObservable<string> title, Menu menu, IObservable<Icon> icon)\n\t\t{\n\t\t\treturn new MonoMacTrayApplication(errorHandler, icon, title, menu);\n\t\t}\n\n\t\tpublic bool InitializeDocumentApp(IList<string> args, string applicationName)\n\t\t{\n\t\t\tInitialize(args, true);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic void Initialize(IList<string> args)\n\t\t{\n\t\t\tInitialize(args, false);\n\t\t}\n\n\t\tIScheduler _dispatcher;\n\n\t\tpublic void Initialize(IList<string> args, bool isDocumentApp)\n\t\t{\n\t\t\tConsole.CancelKeyPress += (sender, e) => Exit(0);\n\n\t\t\tNSApplication.Init();\n\n\t\t\t_dispatcher = _dispatcher ??  new Dispatcher(Thread.CurrentThread);\n\t\t\tFusion.Application.MainThread = _dispatcher;\n\n\t\t\tFusion.Application.PerFrame = Observable.Interval(\n\t\t\t\tTimeSpan.FromSeconds(1.0 / 60.0),\n\t\t\t\tnew SynchronizationContextScheduler(SynchronizationContext.Current));\n\n\t\t\tvar app = new AppDelegate(isDocumentApp);\n\t\t\tNSApplication.SharedApplication.Delegate = app;\n\n\t\t\t//TODO do we really need to retain this object?\n\t\t\t#pragma warning disable 0219\n\t\t\tvar documentController = new NSDocumentController();\n\t\t\t#pragma warning restore 0219\n\n\t\t\tNSApplication.CheckForIllegalCrossThreadCalls = false;\n\t\t\tAppDelegate.ThrowOnTerminate = false;\n\n\t\t\tDesktop = new MacDialog<object>();\n\n\t\t\tEffectsImplementation.Initialize(_dispatcher);\n\n\t\t\t// Make so that the window popups with focus.\n\t\t\tNSApplication.SharedApplication.ActivateIgnoringOtherApps(true);\n\n\t\t\tMacEnvironment.Initialize(new MacEnvironmentImpl());\n\t\t\tDraggingImplementation.Initialize(_dispatcher);\n\t\t\tMenuBuilder.Initialize(_dispatcher);\n\t\t\tLayeringImplementation.Initialize(_dispatcher);\n\t\t\tLabelImplementation.Initialize(_dispatcher);\n\t\t\tSliderImplementation.Initialize(_dispatcher);\n\t\t\tLineImplementation.Initialize(_dispatcher);\n\t\t\tCircleImplementation.Initialize(_dispatcher);\n\t\t\tRectangleImplementation.Initialize(_dispatcher);\n\t\t\tTextBoxImplementation.Initialize(_dispatcher);\n\t\t\tCursorsImplementation.Initialize(_dispatcher);\n\t\t\tToolTipImplementation.Initialize(_dispatcher);\n\t\t\tContextMenuImplementation.Initialize(_dispatcher);\n\t\t\tDropDownImplementation.Initialize(_dispatcher);\n\t\t\tButtonImplementation.Initialize(_dispatcher);\n\t\t\tColorPickerImplementation.Initialize(_dispatcher);\n\t\t\tScrollingImplementation.Initialize(_dispatcher);\n\t\t\tLogViewImplementation.Initialize(_dispatcher);\n\t\t\tTransformation.Initialize();\n\t\t\tImageImplementation.Initialize(_dispatcher);\n\t\t\tOverlayImplementation.Initialize(_dispatcher);\n\t\t\tPointerImplementation.Initialize(_dispatcher);\n\t\t\tKeyboardImplementation.Initialize(_dispatcher);\n\t\t\tWebViewImplementation.Initialize(_dispatcher);\n\t\t\tLayoutTrackerImplementation.Initialize();\n\t\t\tMessageBoxImplementation.Initialize();\n\t\t\tFileDialogs.Initialize();\n\n\t\t\t// TODO: Fix this!!!\n\t\t\tClipping.Initialize((control, clip) => control);\n\n\t\t\t// This notification occurs a _lot_, but is the most specific one I was able to find that would\n\t\t\t//  allow us to be notified when the first responder changes consistently\n\t\t\tNSNotificationCenter.DefaultCenter.AddObserver(new NSString(\"NSApplicationDidUpdateNotification\"), _ => {\n\t\t\t\tvar keyWindow = NSApplication.SharedApplication.KeyWindow;\n\t\t\t\t_firstResponder.OnNext(keyWindow != null ? keyWindow.FirstResponder : null);\n\t\t\t});\n\n\t\t\tapp.Terminates.Subscribe(_ =>\n\t\t\t{\n\t\t\t\tif (Terminating != null) Terminating();\n\t\t\t});\n\n\t\t\tEditMenu =\n\t\t\t\t  /*CreateFirstResponderMenuItem(name: \"Undo\", hotkey: HotKey.Create(Fusion.ModifierKeys.Meta, Key.Z), selectorName: \"undo:\")\n\t\t\t\t+ CreateFirstResponderMenuItem(name: \"Redo\", hotkey: HotKey.Create(Fusion.ModifierKeys.Meta | Fusion.ModifierKeys.Shift, Key.Z), selectorName: \"redo:\")\n\t\t\t\t+ MenuItem.CreateSeparator()\n\t\t\t\t+ */CreateFirstResponderMenuItem(name: Strings.SubMenu_Edit_Cut, hotkey: HotKey.Create(ModifierKeys.Meta, Key.X), selectorName: \"cut:\")\n\t\t\t\t+ CreateFirstResponderMenuItem(name: Strings.SubMenu_Edit_Copy, hotkey: HotKey.Create(ModifierKeys.Meta, Key.C), selectorName: \"copy:\")\n\t\t\t\t+ CreateFirstResponderMenuItem(name: Strings.SubMenu_Edit_Paste, hotkey: HotKey.Create(ModifierKeys.Meta, Key.V), selectorName: \"paste:\")\n\t\t\t\t+ CreateFirstResponderMenuItem(name: \"Paste and Match Style\", hotkey: HotKey.Create(ModifierKeys.Meta | ModifierKeys.Shift, Key.V), selectorName: \"pasteAsPlainText:\")\n\t\t\t\t+ CreateFirstResponderMenuItem(name: Strings.SubMenu_Edit_Delete, hotkey: HotKey.Create(ModifierKeys.Meta, Key.Backspace), selectorName: \"delete:\")\n\t\t\t\t+ CreateFirstResponderMenuItem(name: Strings.SubMenu_Edit_SelectAll, hotkey: HotKey.Create(ModifierKeys.Meta, Key.A), selectorName: \"selectAll:\");\n\t\t}\n\n\t\tISubject<NSResponder> _firstResponder = new BehaviorSubject<NSResponder>(null);\n\n\t\tMenu CreateFirstResponderMenuItem(string name, HotKey hotkey, string selectorName)\n\t\t{\n\t\t\tvar selector = new Selector(selectorName);\n\t\t\tvar command = _firstResponder\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Switch(r =>\n\t\t\t\t\tCommand.Create(\n\t\t\t\t\t\taction: () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: This is supposed to take an argument which I believe is the native\n\t\t\t\t\t\t\t//  NSMenuItem handle, but it appears to work fine without it. Though, when\n\t\t\t\t\t\t\t//  we have that available we should definitely pass it in here.\n\t\t\t\t\t\t\tMessaging.void_objc_msgSend(r.Handle, selector.Handle);\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// TODO: This is not strictly correct, but we need the native NSMenuItem instance\n\t\t\t\t\t\t//  in order to implement the proper enabling procedure. For more info on how this\n\t\t\t\t\t\t//  is supposed to work, see:\n\t\t\t\t\t\t//  https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MenuList/Articles/EnablingMenuItems.html#//apple_ref/doc/uid/20000261-74653-BAJBGJHB\n\t\t\t\t\t\tisEnabled: r != null && r.RespondsToSelector(selector)));\n\t\t\treturn Menu.Item(name, command, hotkey: hotkey);\n\t\t}\n\n\t\tpublic event Action Terminating;\n\n\t\tpublic Task<IDocument> OpenDocument(AbsoluteFilePath path, bool giveFocus = false)\n\t\t{\n\t\t\treturn ObservableNSDocument.Open(path, giveFocus);\n\t\t}\n\n\t\tpublic IObservable<Window> DocumentOpened\n\t\t{\n\t\t\tget { return ObservableNSDocument.DocumentOpened; }\n\t\t}\n\n\t\tinternal static NSMenu GlobalMenu;\n\n\t\tOptional<Menu> _defaultMenu;\n\t\tpublic Optional<Menu> DefaultMenu\n\t\t{\n\t\t\tget { return _defaultMenu; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_defaultMenu = value;\n\t\t\t\tvar systemId = SystemGuidLoader.LoadOrCreateOrEmpty();\n\t\t\t\t_defaultMenu.Do(menu =>\n\t\t\t\t\tMenuBuilder\n\t\t\t\t\t\t.CreateMenu(menu, ReportFactory.GetReporter(systemId, Guid.NewGuid(), \"Menu\"))\n\t\t\t\t\t\t.ToObservable()\n\t\t\t\t\t\t.Subscribe(m =>\n\t\t\t\t\t\t\tGlobalMenu = m));\n\t\t\t}\n\t\t}\n\n\t\tpublic IDialog<object> Desktop { get; private set; }\n\t\tpublic Menu EditMenu { get; private set; }\n\n\n\t\tpublic void Run()\n\t\t{\n\t\t\tNSApplication.SharedApplication.Run();\n\t\t}\n\n\t\tpublic void Run(Window window)\n\t\t{\n\t\t\tNSApplication.SharedApplication.Run();\n\t\t}\n\n\t\tpublic void Exit(byte exitCode)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// HACK: Kill the current process immediately.\n\t\t\t\tConsole.WriteLine(\"Killing current process...\");\n\t\t\t\tSystem.Diagnostics.Process.GetCurrentProcess().Kill();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t}\n\n\t\t\t// TODO: The following hangs for a long period of time, using 100% CPU.\n\t\t\t_dispatcher.Schedule(() => NSApplication.SharedApplication.Terminate(NSApplication.SharedApplication));\n\t\t}\n\n\t\tpublic void ShowOpenDialog(FileFilter[] documentTypes)\n\t\t{\n\t\t\t_dispatcher.Schedule(() => NSDocumentController.SharedDocumentController.OpenDocument(null));\n\t\t}\n\t}\n\n\tclass MacDialog<T> : IDialog<T>\n\t{\n\t\tpublic static void ShowDocumentWindow(ObservableNSDocument document, Func<IDialog<object>, Window> window)\n\t\t{\n\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tvar childWindow = new MacDialog<object>();\n\n\t\t\t\tvar handle = WindowImplementation.Create(window(childWindow), Optional.Some(document));\n\n\t\t\t\tchildWindow._parent = handle;\n\t\t\t\tchildWindow._onClose = () =>\n\t\t\t\t\tFusion.Application.MainThread.Schedule(document.Close);\n\n\t\t\t\tdocument.AddWindowController(new DocumentWindowController(handle));\n\t\t\t});\n\t\t}\n\n\t\treadonly ISubject<T> _result = new ReplaySubject<T>(1);\n\t\tAction _onClose = () => { };\n\t\tOptional<NSWindow> _parent;\n\n\t\tpublic void Focus()\n\t\t{\n\t\t\t_parent.Do(window =>\n\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\twindow.MakeKeyAndOrderFront(window)));\n\t\t}\n\n\t\tpublic void Close(T result = default(T))\n\t\t{\n\t\t\t_onClose();\n\t\t\t_result.OnNext(result);\n\t\t}\n\n\t\tpublic void CloseWithError(Exception e)\n\t\t{\n\t\t\t_onClose();\n\t\t\t_result.OnError(e);\n\t\t}\n\n\t\tpublic void CreateSingletonWindow(IObservable<bool> isVisible, Func<IDialog<object>, Window> window)\n\t\t{\n\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tvar childWindow = new MacDialog<object>();\n\n\t\t\t\tvar handle = WindowImplementation.Create(window(childWindow), Optional.None());\n\t\t\t\thandle.ReleasedWhenClosed = false;\n\n\t\t\t\tvar close = new Subject<bool>();\n\t\t\t\tchildWindow._parent = handle;\n\t\t\t\tchildWindow._onClose = () => close.OnNext(false);\n\n\t\t\t\tisVisible.Merge(close).Subscribe(vis =>\n\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (vis)\n\t\t\t\t\t\t\thandle.MakeKeyAndOrderFront(handle);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\thandle.OrderOut(handle);\n\t\t\t\t\t}));\n\t\t\t});\n\t\t}\n\n\t\tpublic async Task<TU> ShowDialog<TU>(Func<IDialog<TU>, Window> window)\n\t\t{\n\t\t\treturn await await Fusion.Application.MainThread.InvokeAsync(() =>\n\t\t\t\t{\n\t\t\t\t\tvar childWindow = new MacDialog<TU>();\n\n\t\t\t\t\tvar model = window(childWindow);\n\t\t\t\t\tvar handle = WindowImplementation.Create(model, Optional.None());\n\n\t\t\t\t\tchildWindow._parent = handle;\n\t\t\t\t\tchildWindow._onClose = () =>\n\t\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (model.Style == WindowStyle.Sheet)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tNSApplication.SharedApplication.EndSheet(handle);\n\t\t\t\t\t\t\t\thandle.OrderOut(handle);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\thandle.Close();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\tif (model.Style == WindowStyle.Sheet)\n\t\t\t\t\t\tNSApplication.SharedApplication.BeginSheet(handle, _parent.Value);\n\t\t\t\t\telse\n\t\t\t\t\t\thandle.MakeKeyAndOrderFront(handle);\n\n\t\t\t\t\treturn childWindow._result.FirstAsync();\n\t\t\t\t});\n\t\t}\n\n\t\tpublic Task<Optional<AbsoluteDirectoryPath>> BrowseForDirectory(AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\tvar dialogs = new FileDialogs(_parent.OrDefault());\n\t\t\treturn dialogs.SelectDirectory(new DirectoryDialogOptions(\"Browse\", directory));\n\t\t}\n\n\t\tpublic async Task<Optional<AbsoluteFilePath>> BrowseForFile(AbsoluteDirectoryPath directory, params FileFilter[] filters)\n\t\t{\n\t\t\tvar dialogs = new FileDialogs(_parent.OrDefault());\n\t\t\treturn from dialogResult in await dialogs.OpenFile(new FileDialogOptions(\"Browse\", directory, filters))\n\t\t\t\tselect dialogResult.Path;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/ButtonImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass ButtonImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tButton.Implementation.Factory = (command, contentFactory, text, isDefault) =>\n\t\t\t{\n\t\t\t\tif (contentFactory != null)\n\t\t\t\t{\n\t\t\t\t\tvar states = new BehaviorSubject<ButtonStates>(ButtonStates.Unrooted);\n\n\t\t\t\t\tvar content = contentFactory(states.Switch());\n\n\t\t\t\t\tvar hittableContent = content.MakeHittable();\n\n\t\t\t\t\tstates.OnNext(new ButtonStates(\n\t\t\t\t\t\tisPressed: hittableContent.IsPressed(),\n\t\t\t\t\t\tisHovered: hittableContent.IsHovering(),\n\t\t\t\t\t\tisEnabled: command.IsEnabled));\n\n\t\t\t\t\thittableContent.Pressed.WithLatestFromBuffered(command.Execute, (evt, c) => c)\n\t\t\t\t\t\t.ConnectWhile(content.IsRooted)\n\t\t\t\t\t\t.Subscribe(action => dispatcher.Schedule(action));\n\n\t\t\t\t\treturn hittableContent.Control;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar width = new ReplaySubject<Points>(1);\n\n\t\t\t\t\treturn Control.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tAction action = () => { };\n\n\n\t\t\t\t\t\tvar b = new ObservableButton()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBezelStyle = NSBezelStyle.Rounded,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tb.Activated += (s, a) => action();\n\n\t\t\t\t\t\tif (isDefault)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tb.WindowObservable\n\t\t\t\t\t\t\t\t.Where(window => window != null)\n\t\t\t\t\t\t\t\t.Subscribe(window =>\n\t\t\t\t\t\t\t\t\tFusion.Application.MainThread.InvokeAsync(() => window.DefaultButtonCell = b.Cell));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcommand.Action\n\t\t\t\t\t\t\t.CombineLatest(text)\n\t\t\t\t\t\t\t.Take(1)\n\t\t\t\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\t\t\tcmdText =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tUpdateButtonFields(b, cmdText.Item1.HasValue, cmdText.Item2, width);\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\"command\",\n\t\t\t\t\t\t\tcommand.Action.CombineLatest(text),\n\t\t\t\t\t\t\tcmdText =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUpdateButtonFields(b, cmdText.Item1.HasValue, cmdText.Item2, width);\n\t\t\t\t\t\t\t\taction = () => cmdText.Item1.Do(x => x());\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeDefaults(b, dispatcher);\n\n\t\t\t\t\t\treturn b;\n\t\t\t\t\t})\n\t\t\t\t\t.WithHeight(32)\n\t\t\t\t\t.WithWidth(width);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tstatic void UpdateButtonFields(ObservableButton b, bool enabled, string text, IObserver<Points> width)\n\t\t{\n\t\t\tb.Enabled = enabled;\n\t\t\tb.Title = text;\n\t\t\tb.Font = NSFont.SystemFontOfSize(0.0f);\n\t\t\twidth.OnNext((double)b.FittingSize.Width);\n\t\t}\n\t}\n\n\tclass ObservableButton : NSButton\n\t{\n\t\tpublic ReplaySubject<NSWindow> WindowObservable = new ReplaySubject<NSWindow>(1);\n\n\t\tpublic ObservableButton()\n\t\t{\n\t\t}\n\n\t\tpublic ObservableButton(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic override void ViewDidMoveToWindow()\n\t\t{\n\t\t\tWindowObservable.OnNext(Window);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/Controls/ColorPickerImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing AppKit;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class ColorPickerImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tvar defaultColor = Optional.None<IProperty<Color>>();\n\n\t\t\tvar panelVisible = Property.Create(false);\n\n\t\t\tvar currentColor = new BehaviorSubject<Optional<IProperty<Color>>>(defaultColor);\n\n\t\t\tvar editingColor =\n\t\t\t\tcurrentColor\n\t\t\t\t\t.ReplaceNone(() => Property.AsProperty(Observable.Never<Color>()))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.PreventFeedback()\n\t\t\t\t\t.AutoInvalidate(TimeSpan.FromMilliseconds(200));\n\n\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tvar colorPanel = NSColorPanel.SharedColorPanel;\n\t\t\t\tcolorPanel.ShowsAlpha = true;\n\t\t\t\tcolorPanel.WillClose += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tcurrentColor.OnNext(defaultColor);\n\t\t\t\t\tpanelVisible.Write(false);\n\t\t\t\t};\n\n\t\t\t\tvar colorUpdated = new Subject<Color>();\n\t\t\t\tNSNotificationCenter.DefaultCenter.AddObserver(\n\t\t\t\t\tnew NSString(\"NSColorPanelColorDidChangeNotification\"),\n\t\t\t\t\tnotification => { colorUpdated.OnNext(colorPanel.Color.ToColor()); },\n\t\t\t\t\tcolorPanel);\n\n\t\t\t\tvar setByUs = false;\n\t\t\t\teditingColor.ObserveOn(dispatcher).Subscribe(c =>\n\t\t\t\t{\n\t\t\t\t\tsetByUs = true;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tcolorPanel.Color = c.ToNSColor();\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tsetByUs = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tcolorUpdated.Subscribe(color =>\n\t\t\t\t{\n\t\t\t\t\tif (!setByUs)\n\t\t\t\t\t\teditingColor.Write(color);\n\t\t\t\t});\n\n\t\t\t\tpanelVisible.ObserveOn(dispatcher).Subscribe(visible => colorPanel.IsVisible = visible);\n\t\t\t});\n\n\t\t\tColorPicker.Implementation.OpenCommand = (color) =>\n\t\t\t\tCommand.Enabled(() =>\n\t\t\t\t{\n\t\t\t\t\tif (currentColor.Value == Optional.Some(color))\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentColor.OnNext(defaultColor);\n\t\t\t\t\t\tpanelVisible.Write(false);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentColor.OnNext(Optional.Some(color));\n\t\t\t\t\t\tpanelVisible.Write(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/ContextMenuImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic static class ContextMenuImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tContextMenu.Implementation.Set = (self, menu) =>\n\t\t\t{\n\t\t\t\tself.IsRooted\n\t\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t\t.Select(isRooted =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar view = self.NativeHandle as NSView;\n\t\t\t\t\t\tif (view == null)\n\t\t\t\t\t\t\treturn Disposable.Empty;\n\n\t\t\t\t\t\treturn AddMenuTemporarily(view, menu.Select(x => x.ConnectWhile(self.IsRooted)), dispatcher);\n\t\t\t\t\t})\n\t\t\t\t\t.SubscribeUsing(disposable => disposable);\n\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\n\t\tpublic static IDisposable AddMenuTemporarily(NSView view, Optional<Menu> menu, IScheduler dispatcher)\n\t\t{\n\t\t\tif (!menu.HasValue)\n\t\t\t{\n\t\t\t\tview.Menu = null;\n\t\t\t\treturn Disposable.Empty;\n\t\t\t}\n\n\t\t\tview.Menu = new DataBoundNSMenu(menu.Value, ReportFactory.FallbackReport, populateLazily: true);\n\t\t\treturn view.Menu;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/DelegateObserver.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing AppKit;\nusing Foundation;\nusing ObjCRuntime;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class Target\n\t{\n\t\tpublic static IObservable<object> WhenChanged(this NSControl control)\n\t\t{\n\t\t\treturn Observable.Create<object>(observer =>\n\t\t\t{\n\t\t\t\tcontrol.Action = Selector;\n\t\t\t\tcontrol.Target = Create(changed: () =>\n\t\t\t\t\tobserver.OnNext(control.ObjectValue));\n\n\t\t\t\treturn Disposable.Create(() =>\n\t\t\t\t{\n\t\t\t\t\tcontrol.Action = null;\n\t\t\t\t\tcontrol.Target = null;\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tpublic static readonly Selector Selector = new Selector(\"valueChange:\");\n\n\t\tpublic static NSObject Create(Action changed)\n\t\t{\n\t\t\treturn new DelegateObserver(changed);\n\t\t}\n\t}\n\n\tclass DelegateObserver : NSObject\n\t{\n\t\treadonly Action _changed;\n\n\t\tpublic DelegateObserver(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic DelegateObserver(Action changed)\n\t\t{\n\t\t\t_changed = changed;\n\t\t}\n\t\t[Action(\"colorUpdate:\")]\n\t\tpublic void ColorUpdate(NSObject sender)\n\t\t{\n\t\t\t_changed();\n\t\t}\n\t\t[Action(\"valueChange:\")]\n\t\tpublic void ValueChange(NSObject sender)\n\t\t{\n\t\t\t_changed();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/DropDownImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass DropDownImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tDropDown.Implementation.Factory = (value, items, nativeLook) =>\n\t\t\t\tControl.Create(mountLocation =>\n\t\t\t\t{\n\t\t\t\t\tvalue = value\n\t\t\t\t\t\t.ConnectWhile(mountLocation.IsRooted)\n\t\t\t\t\t\t.AutoInvalidate();\n\n\t\t\t\t\tvar view = new NSPopUpButton();\n\t\t\t\t\tvar c = nativeLook ? new NSPopUpButtonCell()\n\t\t\t\t\t{\n\t\t\t\t\t\tBezelStyle = NSBezelStyle.Rounded,\n\t\t\t\t\t} : new CustomPopUpButtonCell();\n\t\t\t\t\tview.Cell = c;\n\n\t\t\t\t\tmountLocation.BindNativeDefaults(view, dispatcher);\n\n\t\t\t\t\t// Disable control if list is empty\n\t\t\t\t\tvar isDisabled = value.IsReadOnly.Or(items.Select(x => x.IsEmpty()));\n\t\t\t\t\tmountLocation.BindNativeProperty(dispatcher, \"Enabled\", isDisabled, isReadOnly => view.Enabled = !isReadOnly);\n\n\t\t\t\t\tmountLocation.BindNativeProperty(dispatcher, \"items\", items, tmpItems =>\n\t\t\t\t\t{\n\t\t\t\t\t\tview.RemoveAllItems();\n\t\t\t\t\t\tforeach (var i in tmpItems)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp = i;\n\t\t\t\t\t\t\tview.Menu.AddItem(new NSMenuItem(i.ToString(), (s, a) => value.Write(tmp)));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\treturn view;\n\t\t\t\t})\n\t\t\t\t.WithHeight(30);\n\n\n\t\t}\n\t}\n\n\tclass CustomPopUpButtonCell : NSPopUpButtonCell\n\t{\n\t\tpublic CustomPopUpButtonCell()\n\t\t{\n\t\t}\n\n\t\tpublic CustomPopUpButtonCell(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic override void DrawBezelWithFrame(CGRect frame, NSView controlView)\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/Controls/ImageImplementation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Runtime.InteropServices;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass TintedImage : NSDefaultView\n\t{\n\t\tOptional<NSImage> _currentImage;\n\t\treadonly NSImageView _imageView;\n\n\t\tOptional<NSColor> _tintColor = Optional.None();\n\t\treadonly bool _cloneOnTint;\n\n\t\tpublic Optional<NSColor> TintColor\n\t\t{\n\t\t\tget { return _tintColor; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_tintColor = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic Optional<NSImage> CurrentImage\n\t\t{\n\t\t\tget { return _currentImage; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (_currentImage == value)\n\t\t\t\t\treturn;\n\n\t\t\t\t_currentImage = value;\n\t\t\t\t_currentImage.Do(image => _imageView.Image = image);\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic TintedImage(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic TintedImage(Optional<NSImage> nsImage = default(Optional<NSImage>), bool cloneOnTint = true)\n\t\t{\n\t\t\t_cloneOnTint = cloneOnTint;\n\n\t\t\t_imageView = new NSImageView()\n\t\t\t{\n\t\t\t\tImageScaling = NSImageScale.ProportionallyDown\n\t\t\t};\n\n\t\t\tAddSubview(_imageView);\n\t\t\tnsImage.Do(img => CurrentImage = img);\n\t\t}\n\n\t\tpublic override void DrawRect(CGRect dirtyRect)\n\t\t{\n\t\t\t_imageView.Frame = Bounds;\n\n\t\t\t_tintColor.Do(tintColor => _currentImage.Do(\n\t\t\t\tcurrentImage =>\n\t\t\t\t{\n\t\t\t\t\tvar image = _cloneOnTint ? new NSImage(currentImage.CGImage.Clone(), currentImage.Size) : currentImage;\n\t\t\t\t\timage.LockFocus();\n\t\t\t\t\ttintColor.SetFill();\n\t\t\t\t\tRectFillUsingOperation(new CGRect(0, 0, image.Size.Width, image.Size.Height), NSCompositingOperation.SourceIn);\n\t\t\t\t\timage.UnlockFocus();\n\t\t\t\t\tif (_cloneOnTint) _imageView.Image = image;\n\t\t\t\t}));\n\n\t\t\tbase.DrawRect(dirtyRect);\n\t\t}\n\n\t\t[DllImport(\"/System/Library/Frameworks/AppKit.framework/AppKit\", EntryPoint = \"NSRectFillUsingOperation\")]\n\t\tpublic static extern void RectFillUsingOperation(CGRect rect, NSCompositingOperation operation);\n\t}\n\n\tclass DpiAwareView : NSView\n\t{\n\t\treadonly ReplaySubject<Ratio<Pixels, Points>> _density = new ReplaySubject<Ratio<Pixels, Points>>(1);\n\n\t\tpublic DpiAwareView() { }\n\n\t\tpublic DpiAwareView(IntPtr handle) : base(handle) { }\n\n\t\t[Export(\"viewDidChangeBackingProperties\")]\n\t\tpublic void ViewDidChangeBackingProperties()\n\t\t{\n\t\t\t_density.OnNext(GetDensity());\n\t\t}\n\n\t\tRatio<Pixels, Points> GetDensity()\n\t\t{\n\t\t\treturn new Ratio<Pixels, Points>(ConvertSizeToBacking(new CGSize(1, 1)).Width);\n\t\t}\n\n\t\tpublic IObservable<Ratio<Pixels, Points>> GetDpi()\n\t\t{\n\t\t\treturn _density.DistinctUntilChanged();\n\t\t}\n\t}\n\n\tstatic class ImageImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tImage.Implementation.Factory = (streams, overlayColor, colorMap, dpiOverride) => ImageImpl(dispatcher, streams, overlayColor, colorMap, dpiOverride);\n\t\t\tImage.Implementation.Animate =\n\t\t\t\t(imageStreams, duration, overlayColor) => AnimateImpl(imageStreams, duration, overlayColor, dispatcher);\n\t\t\tImage.Implementation.Loader<NSImage>.FromStream = NSImage.FromStream;\n\t\t}\n\n\t\tstatic IControl ImageImpl(\n\t\t\tIScheduler dispatcher,\n\t\t\tIObservable<IImage> streams,\n\t\t\tOptional<IObservable<Color>> overlayColor,\n\t\t\tOptional<IObservable<IColorMap>> colorMap,\n\t\t\tOptional<IObservable<Ratio<Pixels, Points>>> dpiOverride)\n\t\t{\n\t\t\tBehaviorSubject<Size<Points>> desiredSize = new BehaviorSubject<Size<Points>>(Size.Zero<Points>());\n\t\t\treturn Control.Create(\n\t\t\t\tctrl =>\n\t\t\t\t{\n\t\t\t\t\tvar dummyControl = new DpiAwareView()\n\t\t\t\t\t{\n\t\t\t\t\t\tAutoresizesSubviews = true\n\t\t\t\t\t};\n\n\t\t\t\t\tctrl.BindNativeDefaults(dummyControl, dispatcher);\n\n\t\t\t\t\tvar tintedImage = new TintedImage()\n\t\t\t\t\t{\n\t\t\t\t\t\tAutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable\n\t\t\t\t\t};\n\t\t\t\t\tdummyControl.AddSubview(tintedImage);\n\n\t\t\t\t\tctrl.BindNativeProperty(dispatcher, \"image\", dpiOverride.Or(dummyControl.GetDpi())\n\t\t\t\t\t\t\t.CombineLatest(streams, colorMap.Select(x => x.Select(Optional.Some)).Or(Observable.Return<Optional<IColorMap>>(Optional.None())),\n\t\t\t\t\t\t\t(dpi, imgStreams, cm) => new {dpi, imgStreams, colorMap = cm}),\n\t\t\t\t\t\tx =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar iv = x.imgStreams.Load<NSImage>(x.dpi, x.colorMap);\n\t\t\t\t\t\t\ttintedImage.CurrentImage = iv.Image;\n\t\t\t\t\t\t\ttintedImage.SetFrameSize(dummyControl.Frame.Size);\n\t\t\t\t\t\t\tvar size = Size.Create<Pixels>((double)iv.Image.Size.Width, (double)iv.Image.Size.Height) / iv.ScaleFactor;\n\t\t\t\t\t\t\tdesiredSize.OnNext(size);\n\t\t\t\t\t\t});\n\n\t\t\t\t\toverlayColor.Do(\n\t\t\t\t\t\tcolorObs =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tctrl.BindNativeProperty(\n\t\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\t\"tintColor\",\n\t\t\t\t\t\t\t\tcolorObs,\n\t\t\t\t\t\t\t\tcolor => tintedImage.TintColor = color.ToNSColor());\n\n\t\t\t\t\t\t});\n\n\t\t\t\t\treturn dummyControl;\n\t\t\t\t}).WithSize(desiredSize.Transpose());\n\t\t}\n\n\t\tstatic IControl AnimateImpl(IList<ImageStream> streams, TimeSpan duration, IObservable<Color> overlayColor, IScheduler dispatcher)\n\t\t{\n\t\t\tvar imgSize = new Size<Points>(0, 0);\n\n\t\t\treturn Control.Create(\n\t\t\t\t\tctrl =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar nsimages = new List<NSImage>();\n\n\t\t\t\t\t\tforeach (var imageStream in streams)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar img = NSImage.FromStream(imageStream.Create());\n\t\t\t\t\t\t\timgSize = imgSize.Max((double)img.Size.Width, (double)img.Size.Height);\n\t\t\t\t\t\t\tnsimages.Add(img);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar timePerImage = duration.TotalMilliseconds / nsimages.Count;\n\t\t\t\t\t\tvar images = Observable.Interval(TimeSpan.FromMilliseconds((int)timePerImage))\n\t\t\t\t\t\t\t.Select(f => nsimages[(int)f % nsimages.Count]);\n\n\t\t\t\t\t\tvar dummyControl = new DpiAwareView()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAutoresizesSubviews = true\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tdummyControl\n\t\t\t\t\t\t\t.GetDpi()\n\t\t\t\t\t\t\t.ConnectWhile(ctrl.IsRooted)\n\t\t\t\t\t\t\t.Select(\n\t\t\t\t\t\t\t\tdpi => Observable.FromAsync(\n\t\t\t\t\t\t\t\t\tasync () =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar tintedImage = await Fusion.Application.MainThread.InvokeAsync(\n\t\t\t\t\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t\t\t\t\tnew TintedImage(nsimages[0], false)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tAutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\tctrl.BindNativeProperty(\n\t\t\t\t\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\t\t\t\t\"currImage\",\n\t\t\t\t\t\t\t\t\t\t\timages,\n\t\t\t\t\t\t\t\t\t\t\timage => tintedImage.CurrentImage = image);\n\t\t\t\t\t\t\t\t\t\tctrl.BindNativeProperty(\n\t\t\t\t\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\t\t\t\t\"tintColor\",\n\t\t\t\t\t\t\t\t\t\t\toverlayColor,\n\t\t\t\t\t\t\t\t\t\t\tcolor => tintedImage.TintColor = color.ToNSColor());\n\n\n\t\t\t\t\t\t\t\t\t\tawait Fusion.Application.MainThread.InvokeAsync(\n\t\t\t\t\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (dummyControl.Subviews.IsEmpty() == false)\n\t\t\t\t\t\t\t\t\t\t\t\t\tdummyControl.Subviews.Last().RemoveFromSuperview();\n\n\t\t\t\t\t\t\t\t\t\t\t\ttintedImage.SetFrameSize(dummyControl.Frame.Size);\n\t\t\t\t\t\t\t\t\t\t\t\tdummyControl.AddSubview(tintedImage);\n\n\t\t\t\t\t\t\t\t\t\t\t\treturn Unit.Default;\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\treturn Unit.Default;\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.Concat()\n\t\t\t\t\t\t\t.Subscribe();\n\n\t\t\t\t\t\tctrl.BindNativeDefaults(dummyControl, dispatcher);\n\n\t\t\t\t\t\treturn dummyControl;\n\t\t\t\t\t}).WithSize(imgSize);\n\t\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/LabelImplementation.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing AppKit;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass LabelImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tLabel.Implementation.Factory = (font, text, textAlignment, color, lineBreakMode) =>\n\t\t\t{\n\t\t\t\tvar desiredSize = new ReplaySubject<Size<Points>>(1);\n\t\t\t\treturn Control.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar field = new NSTextField\n\t\t\t\t\t{\n\t\t\t\t\t\t// AcceptsMouseEvents = true,\n\t\t\t\t\t\tCell = new NSTextFieldCell()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tFont = NSFont.SystemFontOfSize(NSFont.SystemFontSize),\n\t\t\t\t\t\t\tTextColor = NSColor.FromCatalogName(\"System\", \"labelColor\"),\n\t\t\t\t\t\t\tBackgroundColor = NSColor.FromCatalogName(\"System\", \"controlColor\"),\n\t\t\t\t\t\t\tLineBreakMode = lineBreakMode.ToNSLineBreakMode()\n\t\t\t\t\t\t},\n\t\t\t\t\t\tWantsLayer = true\n\t\t\t\t\t};\n\n\t\t\t\t\tvar availSize = field.Cell.LineBreakMode != NSLineBreakMode.Clipping\n\t\t\t\t\t\t? self.AvailableSize.Width.StartWith(99999)\n\t\t\t\t\t\t: Observable.Return<Points>(0);\n\n\t\t\t\t\tvar labelArgs = Observable.CombineLatest(\n\t\t\t\t\t\ttext, font.Size, font.Bold, availSize,\n\t\t\t\t\t\t(val, size, bold, maxWidth) => new\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tText = val,\n\t\t\t\t\t\t\tSize = size,\n\t\t\t\t\t\t\tBold = bold,\n\t\t\t\t\t\t\tMaxWidth = maxWidth\n\t\t\t\t\t\t});\n\n\t\t\t\t\t// Calulate initial desired size\n\t\t\t\t\tlabelArgs\n\t\t\t\t\t\t.Take(1)\n\t\t\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t.Subscribe(args => { UpdateField(field, args.Text, args.Bold, args.Size, args.MaxWidth, desiredSize); });\n\n\t\t\t\t\tself.BindNativeDefaults(field, dispatcher);\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\"labelArgs\",\n\t\t\t\t\t\tlabelArgs,\n\t\t\t\t\t\targs => { UpdateField(field, args.Text, args.Bold, args.Size, args.MaxWidth, desiredSize); });\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"textAlignment\", textAlignment, (x) => field.Cell.Alignment = x.ToNSTextAlignment());\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"color\", color, (x) => field.TextColor = x.ToNSColor());\n\n\t\t\t\t\treturn field;\n\t\t\t\t})\n\t\t\t\t.WithSize(desiredSize.Transpose().Round())\n\t\t\t\t.WithPadding(right: new Points(3)); // Make things symmetrical, NSTextField automatically adds padding on left side\n\t\t\t};\n\n\n\t\t\tLabel.Implementation.Formatted = (textParts, font, textAlignment, color, lineBreakMode) =>\n\t\t\tControl.Create(self =>\n\t\t\t{\n\t\t\t\tvar field = new NSTextField\n\t\t\t\t{\n\t\t\t\t\tCell = new NSTextFieldCell()\n\t\t\t\t\t{\n\t\t\t\t\t\tFont = NSFont.SystemFontOfSize(NSFont.SystemFontSize),\n\t\t\t\t\t\tAllowsEditingTextAttributes = true,\n\t\t\t\t\t\tSelectable = true,\n\t\t\t\t\t\tFocusRingType = NSFocusRingType.None,\n\t\t\t\t\t\tEditable = false\n\t\t\t\t\t},\n\t\t\t\t\tWantsLayer = true\n\t\t\t\t};\n\n\t\t\t\tvar attrStr = textParts\n\t\t\t\t\t.CombineLatest(\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfont.Size,\n\t\t\t\t\t\tfont.Bold,\n\t\t\t\t\t\t(t, c, fs, fb) => t.Select(part => ToNsMutabeAttributedString(part, c.ToNSColor(), fs, fb)))\n\t\t\t\t\t.Select(\n\t\t\t\t\t\tmutableParts =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp = new NSMutableAttributedString();\n\t\t\t\t\t\t\tforeach (var part in mutableParts)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttmp.Append(part);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn tmp;\n\t\t\t\t\t\t});\n\n\t\t\t\tself.BindNativeDefaults(field, dispatcher);\n\t\t\t\tself.BindNativeProperty(dispatcher, \"fontSize\", font.Size, size => field.Font = NSFont.SystemFontOfSize((float)size));\n\t\t\t\tself.BindNativeProperty(dispatcher, \"fontBold\", font.Bold, bold => field.Font = bold ? NSFont.BoldSystemFontOfSize(field.Font.PointSize) : NSFont.SystemFontOfSize(field.Font.PointSize));\n\t\t\t\tself.BindNativeProperty(dispatcher, \"textAlignment\", textAlignment, x => field.Alignment = x.ToNSTextAlignment());\n\t\t\t\tself.BindNativeProperty(dispatcher, \"color\", color, x => field.TextColor = x.ToNSColor());\n\t\t\t\tself.BindNativeProperty(dispatcher, \"text\", attrStr, x => field.AttributedStringValue = x);\n\n\t\t\t\t// TODO: wrap lines\n\n\t\t\t\treturn field;\n\t\t\t})\n\t\t\t.WithHeight(font.Size.Select(s => new Points(s * 1.25)).Round());\n\t\t}\n\n\t\tstatic void UpdateField(NSTextField field, string text, bool fontBold, double fontSize, Points maxWidth, IObserver<Size<Points>> desiredSize)\n\t\t{\n\t\t\tfield.Cell.Font = fontBold\n\t\t\t\t? NSFont.BoldSystemFontOfSize((float) fontSize)\n\t\t\t\t: NSFont.SystemFontOfSize((float)fontSize);\n\t\t\tfield.StringValue = text;\n\t\t\tif (field.Cell.LineBreakMode != NSLineBreakMode.Clipping)\n\t\t\t\tfield.PreferredMaxLayoutWidth = (nfloat)maxWidth.Value;\n\t\t\tdesiredSize.OnNext(field.FittingSize.ToFusion());\n\t\t\tfield.NeedsDisplay = true;\n\t\t}\n\n\t\tprivate static NSMutableAttributedString ToNsMutabeAttributedString(TextPart textPart, NSColor foreground, double fontSize, bool bold)\n\t\t{\n\t\t\tvar attrStr = new NSMutableAttributedString(textPart.Text);\n\t\t\tvar range = new NSRange(0, textPart.Text.Count());\n\n\t\t\tattrStr.BeginEditing();\n\n\t\t\tvar url = textPart as Url;\n\t\t\tif (url != null)\n\t\t\t{\n\t\t\t\tattrStr.AddAttribute(NSStringAttributeKey.Link, new NSUrl(url.Uri.AbsoluteUri), range);\n\t\t\t\tattrStr.AddAttribute(NSStringAttributeKey.UnderlineStyle, new NSNumber(1), range);\n\t\t\t\tattrStr.AddAttribute(NSStringAttributeKey.Cursor, Cursor.Pointing.ToCocoa(), range);\n\t\t\t}\n\n\t\t\tattrStr.AddAttribute(\n\t\t\t\t\tNSStringAttributeKey.BackgroundColor,\n\t\t\t\t\tNSColor.Clear,\n\t\t\t\t\trange);\n\n\t\t\tattrStr.AddAttribute(\n\t\t\t\tNSStringAttributeKey.ForegroundColor,\n\t\t\t\ttextPart.ForegroundColor.HasValue ? textPart.ForegroundColor.Value.ToNSColor() : foreground,\n\t\t\t\trange);\n\n\t\t\t// Fixes #2681 Setting the font size and weight for each part prevents the text formatting to change when\n\t\t\t// a link is clicked.\n\t\t\tattrStr.AddAttribute(\n\t\t\t\tNSStringAttributeKey.Font,\n\t\t\t\tbold ? NSFont.BoldSystemFontOfSize((float)fontSize) : NSFont.SystemFontOfSize((float)fontSize),\n\t\t\t\trange);\n\n\t\t\tattrStr.EndEditing();\n\t\t\treturn attrStr;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/LayoutTrackerImplementation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading.Tasks;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass LayoutTrackerImplementation\n\t{\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tFusion.LayoutTracker.Implementation = trackerFunc =>\n\t\t\t{\n\t\t\t\tvar child = new ReplaySubject<IEnumerable<IControl>>(1);\n\t\t\t\tvar layer = child.Layer();\n\t\t\t\tvar layerElm = Fusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => layer.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.Select(elm => (NSView)elm);\n\n\t\t\t\tvar content = trackerFunc(new LayoutTracker(layerElm));\n\t\t\t\tchild.OnNext(new[] { content });\n\t\t\t\treturn layer.WithSize(content.DesiredSize);\n\t\t\t};\n\t\t}\n\n\t\tclass LayoutTracker : ILayoutTracker\n\t\t{\n\t\t\treadonly IObservable<NSView> _toElement;\n\n\t\t\tpublic LayoutTracker(IObservable<NSView> toElement)\n\t\t\t{\n\t\t\t\t_toElement = toElement;\n\t\t\t}\n\n\t\t\tpublic IControl TrackVisualBounds(Action<Rectangle<Points>> frame, IControl content)\n\t\t\t{\n\t\t\t\tcontent = Layout.Layer(content)\n\t\t\t\t\t.WithSize(content.DesiredSize);\n\n\t\t\t\tvar fromElement = Fusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => content.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.Select(elm => (NSView)elm);\n\n\t\t\t\tObservable.CombineLatest(fromElement, _toElement, CalculateRelativeFrame)\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.ConnectWhile(content.IsRooted)\n\t\t\t\t\t.Subscribe(frame);\n\n\t\t\t\treturn content;\n\t\t\t}\n\n\t\t\tprivate static IObservable<Rectangle<Points>> CalculateRelativeFrame(NSView from, NSView to)\n\t\t\t{\n\t\t\t\treturn Observable.Interval(TimeSpan.FromMilliseconds(100))\n\t\t\t\t\t.Select(_ => RelativeFrame(from: from, to: to))\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.DistinctUntilChanged();\n\t\t\t}\n\n\t\t\tstatic Task<Rectangle<Points>> RelativeFrame(NSView from, NSView to)\n\t\t\t{\n\t\t\t\treturn Fusion.Application.MainThread.InvokeAsync(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar translation = from.ConvertPointToView(new CGPoint(from.Bounds.Left, from.Bounds.Height), to).ToFusion();\n\n\t\t\t\t\t\treturn Rectangle.FromPositionSize(\n\t\t\t\t\t\t\tleft: translation.X,\n\t\t\t\t\t\t\ttop: new Points(to.Frame.Height) - translation.Y,\n\t\t\t\t\t\t\twidth: new Points(from.Frame.Width),\n\t\t\t\t\t\t\theight: new Points(from.Frame.Height));\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/Controls/LogViewImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing AppKit;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass LogViewImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tLogView.Implementation.Factory = (stream, color, linkColor, clear, darktheme) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar textView = new NSTextView()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tEditable = false,\n\t\t\t\t\t\t\tDrawsBackground = false,\n\t\t\t\t\t\t\tVerticallyResizable = true,\n\t\t\t\t\t\t\tAutoresizingMask = NSViewResizingMask.WidthSizable,\n\t\t\t\t\t\t\tTextContainer =\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tWidthTracksTextView = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tvar ctrl = new NSScrollView()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tDocumentView = textView,\n\t\t\t\t\t\t\tDrawsBackground = false,\n\t\t\t\t\t\t\tHasVerticalScroller = true,\n\t\t\t\t\t\t\tAutohidesScrollers = true\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"darktheme\", darktheme, dark => ctrl.ScrollerKnobStyle = dark ? NSScrollerKnobStyle.Light : NSScrollerKnobStyle.Dark);\n\n\t\t\t\t\t\tself.BindNativeDefaults(ctrl, dispatcher);\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"color\", color,\n\t\t\t\t\t\t\tvalue =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar area = new NSRange(0, textView.TextStorage.Length);\n\t\t\t\t\t\t\t\ttextView.TextStorage.BeginEditing();\n\t\t\t\t\t\t\t\ttextView.TextStorage.RemoveAttribute(NSStringAttributeKey.ForegroundColor, area);\n\t\t\t\t\t\t\t\ttextView.TextStorage.AddAttribute(NSStringAttributeKey.ForegroundColor, value.ToNSColor(), area);\n\t\t\t\t\t\t\t\ttextView.TextStorage.EndEditing();\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"linkColor\", color,\n\t\t\t\t\t\t\tvalue => {\n\t\t\t\t\t\t\t\tvar area = new NSRange(0, textView.TextStorage.Length);\n\t\t\t\t\t\t\t\ttextView.TextStorage.BeginEditing();\n\t\t\t\t\t\t\t\ttextView.TextStorage.RemoveAttribute(NSStringAttributeKey.Link, area);\n\t\t\t\t\t\t\t\ttextView.TextStorage.AddAttribute(NSStringAttributeKey.Link, value.ToNSColor(), area);\n\t\t\t\t\t\t\t\ttextView.TextStorage.EndEditing();\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tclear.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t\t.Subscribe(_ =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextView.TextStorage.MutableString.SetString(new NSString());\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tstream.Buffer(TimeSpan.FromSeconds(1.0 / 30.0))\n\t\t\t\t\t\t\t.Where(c => c.Count > 0)\n\t\t\t\t\t\t\t.WithLatestFromBuffered(color, (msgsToAdd, col) => new { MessagesToAdd = msgsToAdd, Color = col })\n\t\t\t\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t\t.Subscribe(data =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar scrollToBottom = ctrl.DocumentVisibleRect.Y + ctrl.DocumentVisibleRect.Height + 10 >= textView.Frame.Height;\n\n\t\t\t\t\t\t\t\ttextView.TextStorage.BeginEditing();\n\t\t\t\t\t\t\t\tforeach (var msg in data.MessagesToAdd)\n\t\t\t\t\t\t\t\t\ttextView.TextStorage.MutableString.Append(new NSString(msg));\n\t\t\t\t\t\t\t\ttextView.TextStorage.AddAttribute(NSStringAttributeKey.ForegroundColor, data.Color.ToNSColor(), textView.TextStorage.EditedRange);\n\t\t\t\t\t\t\t\ttextView.TextStorage.EndEditing();\n\n\t\t\t\t\t\t\t\tif (scrollToBottom)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttextView.ScrollRangeToVisible(new NSRange(textView.TextStorage.Length, 1));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn ctrl;\n\t\t\t\t\t});\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/ScrollingImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\nusing ObjCRuntime;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass DocumentViewForOpenGL : NSView\n\t{\n\t\tpublic DocumentViewForOpenGL()\n\t\t{\n\t\t}\n\n\t\tpublic DocumentViewForOpenGL(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic new static bool IsCompatibleWithResponsiveScrolling\n\t\t{\n\t\t\t[Export(\"isCompatibleWithResponsiveScrolling\")]\n\t\t\tget { return false; }\n\t\t}\n\t}\n\n\tstatic class ScrollingImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tScrolling.Implementation.Factory = (content, darkTheme, supportsOpenGL, zoomAttribs, onBoundsChanged, scrollToRectangle, verticalScrollBarVisible, horizontalScrollBarVisible) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar documentView = supportsOpenGL\n\t\t\t\t\t\t? new DocumentViewForOpenGL()\n\t\t\t\t\t\t: new NSView();\n\n\t\t\t\t\tvar view = new NSScrollView\n\t\t\t\t\t{\n\t\t\t\t\t\tContentView = new NSFlippedClipView(),\n\t\t\t\t\t\tDocumentView = documentView,\n\t\t\t\t\t\tDrawsBackground = false,\n\t\t\t\t\t\tHasVerticalScroller = verticalScrollBarVisible,\n\t\t\t\t\t\tHasHorizontalScroller = horizontalScrollBarVisible,\n\t\t\t\t\t\tAutohidesScrollers = true\n\t\t\t\t\t};\n\n\t\t\t\t\tvar scrollBounds =\n\t\t\t\t\t\tObservable.Create<Unit>(\n\t\t\t\t\t\t\tobserver =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint recursionDetector = 0;\n\t\t\t\t\t\t\t\tAction updateAction = () =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// NOTE: At some point while implementing this I got problems with infinite recursion\n\t\t\t\t\t\t\t\t\t\t// I managed to avoid that; however to be on the safe side I'm keeping this check here\n\t\t\t\t\t\t\t\t\t\t// just in case.\n\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t// - karsten\n\t\t\t\t\t\t\t\t\t\trecursionDetector++;\n\n\t\t\t\t\t\t\t\t\t\tif (recursionDetector > 10)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tConsole.WriteLine(\"ERROR: Aborting recursion in ScrollingImplementation to avoid stack overflow.\");\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tobserver.OnNext(Unit.Default);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfinally\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\trecursionDetector--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\treturn Disposable.Combine(\n\t\t\t\t\t\t\t\t\tNSView.Notifications.ObserveBoundsChanged(view.ContentView, (s, e) => updateAction()),\n\t\t\t\t\t\t\t\t\tNSView.Notifications.ObserveFrameChanged(view.ContentView, (s, e) => updateAction()),\n\t\t\t\t\t\t\t\t\tNSView.Notifications.ObserveBoundsChanged(documentView, (s, e) => updateAction()),\n\t\t\t\t\t\t\t\t\tNSView.Notifications.ObserveFrameChanged(documentView, (s, e) => updateAction()),\n\t\t\t\t\t\t\t\t\tNSView.Notifications.ObserveFrameChanged(view, (s, e) => updateAction())\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t\t\t.Select(_ => new ScrollBounds(ConvertRectangle(view.DocumentVisibleRect), ConvertRectangle(documentView.Frame)))\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1)\n\t\t\t\t\t\t.RefCount();\n\n\t\t\t\t\tvar documentVisibleSize = scrollBounds.Select(x => x.Visible.Size).Transpose();\n\t\t\t\t\tvar contentNativeFrame = ObservableMath.RectangleWithSize(content.DesiredSize.Max(documentVisibleSize));\n\n\t\t\t\t\tcontent.Mount(new MountLocation.Mutable\n\t\t\t\t\t{\n\t\t\t\t\t\tIsRooted = self.IsRooted,\n\t\t\t\t\t\tNativeFrame = contentNativeFrame,\n\t\t\t\t\t\tAvailableSize = documentVisibleSize\n\t\t\t\t\t});\n\n\t\t\t\t\tself.BindNativeDefaults(view, dispatcher);\n\n\t\t\t\t\tvar subview = content.NativeHandle as NSView;\n\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"theme\", darkTheme, isDark =>\n\t\t\t\t\t\t\tview.ScrollerKnobStyle = isDark ? NSScrollerKnobStyle.Light : NSScrollerKnobStyle.Dark);\n\n\t\t\t\t\t// HACK:\n\t\t\t\t\t// To work around layout feedback problems we set the size of the view to 1 pixel less than the\n\t\t\t\t\t// actual available space. See https://github.com/fusetools/Fuse/pull/4703 for details\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"containerSize\", contentNativeFrame.Size.Transpose(), size =>\n\t\t\t\t\t\tdocumentView.SetFrameSize(new CGSize(Math.Max(0.0, size.Width - 1), Math.Max(0.0, size.Height - 1))));\n\n\t\t\t\t\tif (subview != null)\n\t\t\t\t\t\tdispatcher.Schedule(() => documentView.AddSubview(subview));\n\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\"scrollTarget\",\n\t\t\t\t\t\tscrollToRectangle,\n\t\t\t\t\t\tr =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar nsrect = new CGRect(r.Position.X, r.Position.Y, r.Size.Width, r.Size.Height);\n\t\t\t\t\t\t\tdocumentView.ScrollRectToVisible(nsrect);\n\t\t\t\t\t\t});\n\n\t\t\t\t\tonBoundsChanged.Do(\n\t\t\t\t\t\thandler =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tscrollBounds\n\t\t\t\t\t\t\t\t.ConnectWhile(self.IsRooted)\n\t\t\t\t\t\t\t\t.Subscribe(handler);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t// Zoom is disabled until we have more time to implement it properly (with zoom controls and shortcuts etc)\n\t\t\t\t\t// See https://github.com/fusetools/Fuse/issues/2643\n\t\t\t\t\t//zoomAttribs.Do(attribs => EnableMagnification(view, attribs));\n\n\t\t\t\t\treturn view;\n\t\t\t\t});\n\t\t}\n\n\t\tstatic Rectangle<Points> ConvertRectangle(CGRect nsrect)\n\t\t{\n\t\t\treturn Rectangle.FromPositionSize<Points>(\n\t\t\t\tleft: (double) nsrect.X,\n\t\t\t\ttop: (double) nsrect.Y,\n\t\t\t\twidth: (double) nsrect.Width,\n\t\t\t\theight: (double) nsrect.Height);\n\t\t}\n\n\n\t\tstatic readonly IntPtr SelAllowsMagnification = Selector.GetHandle(\"setAllowsMagnification:\");\n\t\tstatic readonly IntPtr SelSetMinMagnification = Selector.GetHandle(\"setMinMagnification:\");\n\t\tstatic readonly IntPtr SelSetMaxMagnification = Selector.GetHandle(\"setMaxMagnification:\");\n\n\t\tstatic void EnableMagnification(NSScrollView view, ZoomAttributes attribs)\n\t\t{\n\t\t\tMessaging.void_objc_msgSend_bool(view.Handle, SelAllowsMagnification, true);\n\t\t\tMessaging.void_objc_msgSend_float(view.Handle, SelSetMinMagnification, attribs.MinZoom);\n\t\t\tMessaging.void_objc_msgSend_float(view.Handle, SelSetMaxMagnification, attribs.MaxZoom);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/CircleImplementation.cs",
    "content": "using System.Reactive.Concurrency;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass CircleImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tShapes.Implementation.CircleFactory = (strokeF, fillF) =>\n\t\t\t\tControl.Create(mountLocation =>\n\t\t\t\t{\n\t\t\t\t\tvar view = new NSCircle();\n\n\t\t\t\t\tmountLocation.BindShapeProperties(view, dispatcher, fillF, strokeF);\n\t\t\t\t\tmountLocation.BindNativeDefaults(view, dispatcher);\n\n\t\t\t\t\treturn view;\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/LineImplementation.cs",
    "content": "﻿using System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class LineImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tShapes.Implementation.LineFactory = (from, to, stroke) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar control = new NSLine();\n\n\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"x1\", from.X, v => control.Start = new CGPoint(v, control.Start.Y));\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"y1\", from.Y.CombineLatest(self.NativeFrame.Height, (y, height) => height - y), v => control.Start = new CGPoint(control.Start.X, v));\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"x2\", to.X, v => control.End = new CGPoint(v, control.End.Y));\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"y2\", to.Y.CombineLatest(self.NativeFrame.Height, (y, height) => height - y), v => control.End = new CGPoint(control.End.X, v));\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"stroke.thickness\", stroke.Thickness, thickness => control.LineThickness = (float)thickness);\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"stroke.brush\", stroke.Brush, color => control.StrokeColor = color.ToNSColor());\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"stroke.dasharray\", stroke.DashArray, array => control.LineDash = array.ToLineDash());\n\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\t\t}\n\t}\n\n\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/NSCircle.cs",
    "content": "using System;\nusing System.Linq;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass NSCircle : NSShape\n\t{\n\t\tpublic NSCircle()\n\t\t{\n\t\t}\n\n\t\tpublic NSCircle(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic override void DrawRect(CGRect dirtyRect)\n\t\t{\n\t\t\tbase.DrawRect(dirtyRect);\n\n\t\t\tFillColor.SetFill();\n\t\t\tNSBezierPath.FromOvalInRect(Bounds).Fill();\n\n\t\t\tif(LineThickness > 0)\n\t\t\t{\n\t\t\t\tStrokeColor.SetStroke();\n\t\t\t\tvar halfLineThickness = LineThickness * 0.5f;\n\t\t\t\tvar path = NSBezierPath.FromOvalInRect(CGRect.Inflate(Bounds, -halfLineThickness, -halfLineThickness));\n\t\t\t\tpath.LineWidth = LineThickness;\n\t\t\t\tif(LineDash.Length > 0) // The API doesn't expect an empty line dash array (for some reason)\n\t\t\t\t\tpath.SetLineDash(LineDash.Select(w => w * LineThickness).ToArray(), 0);\n\n\t\t\t\tpath.Stroke();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/NSLine.cs",
    "content": "using System;\nusing System.Linq;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass NSLine : NSDefaultView\n\t{\n\t\tpublic NSLine()\n\t\t{\n\t\t}\n\n\t\tpublic NSLine(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tNSColor _strokeColor = NSColor.Clear;\n\t\tpublic NSColor StrokeColor\n\t\t{\n\t\t\tget { return _strokeColor; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_strokeColor = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tnfloat _lineThickness = 0;\n\t\tpublic nfloat LineThickness\n\t\t{\n\t\t\tget { return _lineThickness; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_lineThickness = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tnfloat[] _lineDash = new nfloat[0];\n\t\tpublic nfloat[] LineDash\n\t\t{\n\t\t\tget { return _lineDash; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_lineDash = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tCGPoint _start;\n\t\tpublic CGPoint Start\n\t\t{\n\t\t\tget { return _start; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_start = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tCGPoint _end;\n\t\tpublic CGPoint End\n\t\t{\n\t\t\tget { return _end; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_end = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void DrawRect(CGRect dirtyRect)\n\t\t{\n\t\t\tbase.DrawRect(dirtyRect);\n\n\t\t\tStrokeColor.SetStroke();\n\t\t\tvar path = new NSBezierPath();\n\t\t\tpath.MoveTo(Start);\n\t\t\tpath.LineTo(End);\n\n\t\t\tpath.LineWidth = LineThickness;\n\t\t\tif (LineDash.Length > 0)\n\t\t\t\tpath.SetLineDash(LineDash.Select(w => w * LineThickness).ToArray(), 0);\n\t\t\tpath.Stroke();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/NSRectangle.cs",
    "content": "using System;\nusing System.Linq;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass NSRectangle : NSShape\n\t{\n\t\tpublic NSRectangle()\n\t\t{\n\t\t}\n\n\t\tpublic NSRectangle(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tCornerRadius _cornerRadius = CornerRadius.None;\n\t\tpublic CornerRadius CornerRadius\n\t\t{\n\t\t\tget { return _cornerRadius; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_cornerRadius = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void DrawRect(CGRect dirtyRect)\n\t\t{\n\t\t\tbase.DrawRect(dirtyRect);\n\n\t\t\tvar rectFactory = CreateRectFactory(CornerRadius);\n\t\t\tif (!IsHidden(FillColor))\n\t\t\t{\n\t\t\t\tFillColor.SetFill();\n\t\t\t\trectFactory(Bounds).Fill();\n\t\t\t}\n\n\t\t\tif(LineThickness > 0 && !IsHidden(StrokeColor))\n\t\t\t{\n\t\t\t\tStrokeColor.SetStroke();\n\t\t\t\tvar halfLineThickness = LineThickness * 0.5f;\n\t\t\t\tvar path = rectFactory(CGRect.Inflate(Bounds, -halfLineThickness, -halfLineThickness));\n\t\t\t\tpath.LineWidth = LineThickness;\n\t\t\t\tif(LineDash.Length > 0) // The API doesn't expect an empty line dash array (for some reason)\n\t\t\t\t\tpath.SetLineDash(LineDash.Select(w => w * LineThickness).ToArray(), 0);\n\n\t\t\t\tpath.Stroke();\n\t\t\t}\n\t\t}\n\n\t\tstatic Func<CGRect, NSBezierPath> CreateRectFactory(CornerRadius cornerRadius)\n\t\t{\n\t\t\tif (cornerRadius == CornerRadius.None)\n\t\t\t{\n\t\t\t\treturn NSBezierPath.FromRect;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn rect => NSBezierPath.FromRoundedRect(rect, (float)cornerRadius.RadiusX, (float)cornerRadius.RadiusY);\n\t\t\t}\n\t\t}\n\n\t\tbool IsHidden(NSColor color)\n\t\t{\n\t\t\treturn color.AlphaComponent < 0.05;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/NSShape.cs",
    "content": "using System;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass NSShape : NSDefaultView\n\t{\n\t\tpublic NSShape()\n\t\t{\n\t\t}\n\n\t\tpublic NSShape(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tNSColor _fillColor = NSColor.Clear;\n\t\tpublic NSColor FillColor\n\t\t{\n\t\t\tget { return _fillColor; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_fillColor = value;\n\t\t\t\t//if(_fillColor.AlphaComponent < 1)\n\t\t\t\t\t//_isOpaque = false;\n\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\t//bool _isOpaque = true;\n\t\tpublic override bool IsOpaque\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tNSColor _strokeColor = NSColor.Clear;\n\t\tpublic NSColor StrokeColor\n\t\t{\n\t\t\tget { return _strokeColor; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_strokeColor = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tnfloat _lineThickness = 0;\n\t\tpublic nfloat LineThickness\n\t\t{\n\t\t\tget { return _lineThickness; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_lineThickness = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\n\t\tnfloat[] _lineDash = new nfloat[0];\n\t\tpublic nfloat[] LineDash\n\t\t{\n\t\t\tget { return _lineDash; }\n\t\t\tset\n\t\t\t{\n\t\t\t\t_lineDash = value;\n\t\t\t\tNeedsDisplay = true;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/RectangleImplementation.cs",
    "content": "﻿using System.Reactive.Concurrency;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass RectangleImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tShapes.Implementation.RectangleFactory = (strokeF, fillF, cornerRadius) =>\n\t\t\t\tControl.Create(location =>\n\t\t\t\t{\n\t\t\t\t\tvar control = new NSRectangle();\n\n\t\t\t\t\tif (cornerRadius.HasValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tlocation.BindNativeProperty(\n\t\t\t\t\t\t\tdispatcher, \"radius\",\n\t\t\t\t\t\t\tcornerRadius.Value,\n\t\t\t\t\t\t\tv => control.CornerRadius = v);\n\t\t\t\t\t}\n\n\t\t\t\t\tlocation.BindShapeProperties(control, dispatcher, fillF, strokeF);\n\t\t\t\t\tlocation.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/Controls/Shapes/ShapeControl.cs",
    "content": "using System.Reactive.Concurrency;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class ShapeControl\n\t{\n\t\tpublic static void BindShapeProperties(this IMountLocation self, NSShape control, IScheduler dispatcher, Brush fill, Stroke stroke)\n\t\t{\n\t\t\tself.BindNativeProperty(dispatcher, \"fill.Color\", fill, f => control.FillColor = f.ToNSColor());\n\n\t\t\tself.BindNativeProperty(dispatcher, \"stroke.Brush.Color\", stroke.Brush, s => control.StrokeColor = s.ToNSColor());\n\t\t\tself.BindNativeProperty(dispatcher, \"stroke.Thickness\", stroke.Thickness, s => control.LineThickness = (float)s);\n\t\t\tself.BindNativeProperty(dispatcher, \"stroke.DashArray\", stroke.DashArray, s => control.LineDash = s.ToLineDash());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/SliderImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class SliderImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tSlider.Implementation.Factory = (value, min, max) =>\n\t\t\t{\n\t\t\t\tvalue = value\n\t\t\t\t\t.PreventFeedback()\n\t\t\t\t\t.AutoInvalidate(TimeSpan.FromMilliseconds(200));\n\n\t\t\t\treturn Control\n\t\t\t\t\t.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar s = new NSSlider();\n\n\t\t\t\t\t\tself.BindNativeDefaults(s, dispatcher);\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Minimum\", min, (v) => s.MinValue = v);\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Maximum\", max, (v) => s.MaxValue = v);\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Enabled\", value.IsReadOnly, (e) => s.Enabled = !e);\n\n\t\t\t\t\t\tself.BindNativeProperty(s, slider => slider.DoubleValue, s.WhenChanged(), value);\n\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t});\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/TextBoxImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Subjects;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class TextBoxImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tTextBox.Implementation.Factory = (value, isMultiLine, doWrap, onFocused, foregroundColor) =>\n\t\t\t{\n\t\t\t\tvalue = value.PreventFeedback();\n\n\t\t\t\treturn Control\n\t\t\t\t\t.Create(self =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar ctrl = new NSCustomCaretColorTextField()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tEditable = true,\n\t\t\t\t\t\t\t\tBordered = false,\n\t\t\t\t\t\t\t\tCell = doWrap\n\t\t\t\t\t\t\t\t\t?  new NSTextFieldCell()\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tFont = NSFont.SystemFontOfSize(11),\n\t\t\t\t\t\t\t\t\t\t\tWraps = doWrap,\n\t\t\t\t\t\t\t\t\t\t\tEditable = true,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t: new VerticallyCenteredTextFieldCell()\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tFont = NSFont.SystemFontOfSize(11),\n\t\t\t\t\t\t\t\t\t\t\tWraps = doWrap,\n\t\t\t\t\t\t\t\t\t\t\tEditable = true,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tFocusRingType = NSFocusRingType.None\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tonFocused.Do(handler =>\n\t\t\t\t\t\t\t\t((IObservableResponder)ctrl).GotFocus\n\t\t\t\t\t\t\t\t\t.WithLatestFromBuffered(handler.Execute.ConnectWhile(self.IsRooted), (_, h) => h)\n\t\t\t\t\t\t\t\t\t.Subscribe(c => c()));\n\n\t\t\t\t\t\t\tself.BindNativeDefaults(ctrl, dispatcher);\n\t\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Enabled\", value.IsReadOnly, isReadOnly => ctrl.Enabled = !isReadOnly);\n\n\t\t\t\t\t\t\tctrl.BindStringValue(value, self.IsRooted);\n\n\t\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"foreground\", foregroundColor,\n\t\t\t\t\t\t\t\tfg =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tctrl.TextColor = ctrl.CaretColor = fg.ToNSColor();\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn ctrl;\n\t\t\t\t\t\t})\n\t\t\t\t\t.WithHeight(20);\n\t\t\t};\n\t\t}\n\n\t\tstatic void BindStringValue(\n\t\t\tthis NSCustomCaretColorTextField control,\n\t\t\tIProperty<string> value,\n\t\t\tIObservable<bool> isRooted)\n\t\t{\n\t\t\tvar setByUser = false;\n\t\t\tvar hasUnsavedChanges = false;\n\n\t\t\tvalue = value\n\t\t\t\t.ConnectWhile(isRooted)\n\t\t\t\t.DistinctUntilChangedOrSet();\n\n\t\t\tDataBinding\n\t\t\t\t.ObservableFromNativeEvent<EventArgs>(control, \"Changed\")\n\t\t\t\t.Subscribe(_ =>\n\t\t\t\t{\n\t\t\t\t\tif (!setByUser)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\thasUnsavedChanges = true;\n\t\t\t\t\tvalue.Write(control.StringValue, save: false);\n\t\t\t\t});\n\n\t\t\tvalue.Subscribe(v =>\n\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t{\n\t\t\t\t\tsetByUser = false;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tcontrol.StringValue = v;\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tsetByUser = true;\n\t\t\t\t\t}\n\t\t\t\t}));\n\n\t\t\t((IObservableResponder)control).LostFocus.Subscribe(_ =>\n\t\t\t{\n\t\t\t\tif (!hasUnsavedChanges)\n\t\t\t\t\treturn;\n\n\t\t\t\tvalue.Write(control.StringValue, save: true);\n\t\t\t\thasUnsavedChanges = false;\n\t\t\t});\n\t\t}\n\t}\n\n\tclass NSCustomCaretColorTextField : NSMouseTrackingTextField\n\t{\n\t\tpublic NSColor CaretColor { get; set; }\n\n\t\tpublic NSCustomCaretColorTextField()\n\t\t{\n\t\t}\n\n\t\tpublic NSCustomCaretColorTextField(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic override void MouseEntered(NSEvent theEvent)\n\t\t{\n\t\t\tbase.MouseEntered(theEvent);\n\n\t\t\tSetNativeCaretColor();\n\t\t}\n\n\t\tpublic override bool BecomeFirstResponder()\n\t\t{\n\t\t\tvar success = base.BecomeFirstResponder();\n\n\t\t\tif (success)\n\t\t\t\tSetNativeCaretColor();\n\n\t\t\treturn success;\n\t\t}\n\n\t\tvoid SetNativeCaretColor()\n\t\t{\n\t\t\tvar textView = (NSTextView)Window.FieldEditor(true, this);\n\t\t\ttextView.InsertionPointColor = CaretColor;\n\t\t}\n\t}\n\n\tclass NSMouseTrackingTextField : NSTextField, IObservableResponder\n\t{\n\t\treadonly NSTrackingArea _trackingArea;\n\n\t\tpublic override bool AcceptsFirstResponder()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic NSMouseTrackingTextField(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic NSMouseTrackingTextField()\n\t\t{\n\t\t\t_trackingArea = new NSTrackingArea(\n\t\t\t\tnew CGRect(),\n\t\t\t\tNSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect |\n\t\t\t\tNSTrackingAreaOptions.MouseMoved | NSTrackingAreaOptions.MouseEnteredAndExited,\n\t\t\t\tthis,\n\t\t\t\tnull);\n\t\t\tAddTrackingArea(_trackingArea);\n\t\t}\n\n\t\tpublic Action<NSView> ResetCursorRectsHandler { get; set; }\n\n\t\tpublic override void ResetCursorRects()\n\t\t{\n\t\t\tbase.ResetCursorRects();\n\t\t\tif (ResetCursorRectsHandler != null)\n\t\t\t\tResetCursorRectsHandler(this);\n\t\t}\n\n\t\treadonly Subject<object> _gotFocus = new Subject<object>();\n\t\treadonly Subject<object> _lostFocus = new Subject<object>();\n\n\t\tIObservable<object> IObservableResponder.GotFocus { get { return _gotFocus; } }\n\t\tIObservable<object> IObservableResponder.LostFocus { get { return _lostFocus; } }\n\n\t\tbool _hasFocus;\n\t\tNSObject _notificationToken;\n\n\t\tpublic override void ViewWillMoveToSuperview(NSView newSuperview)\n\t\t{\n\t\t\tif (newSuperview != null)\n\t\t\t{\n\t\t\t\t_notificationToken = NSNotificationCenter.DefaultCenter.AddObserver(new NSString(CustomWindowNotifications.WindowMakeFirstResponder), notification =>\n\t\t\t\t{\n\t\t\t\t\tvar view = notification.Object as NSView;\n\n\t\t\t\t\tif (view == null) return;\n\t\t\t\t\tview = view.Superview;\n\n\t\t\t\t\tif (view == null) return;\n\t\t\t\t\tview = view.Superview;\n\n\t\t\t\t\tif (view == this && !_hasFocus)\n\t\t\t\t\t{\n\t\t\t\t\t\t_hasFocus = true;\n\t\t\t\t\t\t_gotFocus.OnNext(new object());\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_notificationToken.Dispose();\n\t\t\t}\n\t\t}\n\n\t\tpublic override void DidEndEditing(NSNotification notification)\n\t\t{\n\t\t\tbase.DidEndEditing(notification);\n\n\t\t\tif (_hasFocus)\n\t\t\t{\n\t\t\t\t_hasFocus = false;\n\t\t\t\t_lostFocus.OnNext(new object());\n\t\t\t}\n\t\t}\n\n\t\treadonly Subject<NSEvent> _keyDown = new Subject<NSEvent>();\n\t\treadonly Subject<NSEvent> _keyUp = new Subject<NSEvent>();\n\n\t\tIObservable<NSEvent> IObservableResponder.KeyDown { get { return _keyDown; } }\n\t\tIObservable<NSEvent> IObservableResponder.KeyUp { get { return _keyUp; } }\n\n\t\tpublic override void KeyDown(NSEvent theEvent)\n\t\t{\n\t\t\t_keyDown.OnNext(theEvent);\n\t\t\tbase.KeyDown(theEvent);\n\t\t}\n\n\t\tpublic override void KeyUp(NSEvent theEvent)\n\t\t{\n\t\t\t_keyUp.OnNext(theEvent);\n\t\t\tbase.KeyUp(theEvent);\n\t\t}\n\t}\n\n\tclass VerticallyCenteredTextFieldCell : NSTextFieldCell\n\t{\n\t\tbool _isEditing;\n\t\tbool _isSelecting;\n\n\t\tpublic VerticallyCenteredTextFieldCell()\n\t\t{\n\t\t}\n\n\t\tpublic VerticallyCenteredTextFieldCell(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic override CGRect DrawingRectForBounds(CGRect theRect)\n\t\t{\n\t\t\tvar baseRect = base.DrawingRectForBounds(theRect);\n\n\t\t\tif (_isEditing == false && _isSelecting == false)\n\t\t\t{\n\t\t\t\tvar textSize = CellSizeForBounds(theRect);\n\n\t\t\t\tif (textSize.Height < baseRect.Height)\n\t\t\t\t\treturn new CGRect(\n\t\t\t\t\t\tbaseRect.X, baseRect.Y + (theRect.Height - textSize.Height) / 2,\n\t\t\t\t\t\tbaseRect.Width, textSize.Height);\n\t\t\t}\n\n\t\t\treturn baseRect;\n\t\t}\n\n\t\tpublic override void SelectWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength)\n\t\t{\n\t\t\tvar actualRect = DrawingRectForBounds(aRect);\n\t\t\t_isSelecting = true;\n\t\t\tbase.SelectWithFrame(actualRect, inView, editor, delegateObject, selStart, selLength);\n\t\t\t_isSelecting = false;\n\t\t}\n\n\t\tpublic override void EditWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent)\n\t\t{\n\t\t\tvar actualRect = DrawingRectForBounds(aRect);\n\t\t\t_isEditing = true;\n\t\t\tbase.EditWithFrame(actualRect, inView, editor, delegateObject, theEvent);\n\t\t\t_isEditing = false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Controls/WebViewImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Web.Util;\nusing Foundation;\nusing ObjCRuntime;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass WebViewImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\t// Need to initialize HttpEncoder.Current because it doesn't default to HttpEncoder.Default.\n\t\t\t// See #3385 for more details.\n\t\t\tHttpEncoder.Current = HttpEncoder.Default;\n\n\t\t\tWebView.Implementation.UrlFactory = (uri, onNavigating) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar webView = new WebKit.WebView();\n\n\t\t\t\t\twebView.DecidePolicyForNavigation += (sender, eventArgs) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar listener = new WebPolicyListener(eventArgs.DecisionToken.Handle);\n\t\t\t\t\t\tlistener.Use();\n\n\t\t\t\t\t\tvar navigatingArgs = new Navigating(new Uri(eventArgs.Request.Url.AbsoluteString));\n\t\t\t\t\t\tonNavigating(navigatingArgs);\n\n\t\t\t\t\t\tif (navigatingArgs.Cancel)\n\t\t\t\t\t\t\tlistener.Ignore();\n\t\t\t\t\t};\n\n\t\t\t\t\twebView.MainFrame.LoadRequest(new NSUrlRequest(new NSUrl(uri.AbsoluteUri)));\n\n\t\t\t\t\tself.BindNativeDefaults(webView, dispatcher);\n\n\t\t\t\t\treturn webView;\n\t\t\t\t});\n\n\t\t\tWebView.Implementation.StringFactory = (content) =>\n\t\t\t\tControl.Create (self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar webView = new WebKit.WebView();\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"content\", content, c => webView.MainFrame.LoadHtmlString(c, new NSUrl(\"\")));\n\t\t\t\t\t\tself.BindNativeDefaults(webView, dispatcher);\n\n\t\t\t\t\t\treturn webView;\n\t\t\t\t\t});\n\t\t}\n\t}\n\n\tclass WebPolicyListener : NSObject\n\t{\n\t\tstatic readonly IntPtr SelUseHandle = Selector.GetHandle(\"use\");\n\t\tstatic readonly IntPtr SelIgnoreHandle = Selector.GetHandle(\"ignore\");\n\n\t\tpublic WebPolicyListener(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{ }\n\n\t\tpublic void Use()\n\t\t{\n\t\t\tMessaging.IntPtr_objc_msgSend(Handle, SelUseHandle);\n\t\t}\n\n\t\tpublic void Ignore()\n\t\t{\n\t\t\tMessaging.IntPtr_objc_msgSend(Handle, SelIgnoreHandle);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/CursorsImplementation.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Reactive.Concurrency;\nusing AppKit;\n\n//using Outracks.UnoHost.Mac.FusionSupport;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic interface ICursorRectControl\n\t{\n\t\tAction<NSView> ResetCursorRectsHandler { set; }\n\t}\n\n\tstatic class CursorsImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tCursors.Implementation.Set = (self, cursor) =>\n\t\t\t{\n\t\t\t\tself.BindNativeProperty(dispatcher, \"cursor\", cursor, (NSView view, Cursor value) =>\n\t\t\t\t{\n\t\t\t\t\tvar responder = view as IObservableResponder;\n\n\t\t\t\t\tif (responder != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tresponder.ResetCursorRectsHandler = v => v.AddCursorRect(v.Bounds, value.ToCocoa());\n\t\t\t\t\t}\n\t\t\t\t\telse if (view is ICursorRectControl)\n\t\t\t\t\t{\n\t\t\t\t\t\t((ICursorRectControl)view).ResetCursorRectsHandler = v => v.AddCursorRect(v.Bounds, value.ToCocoa());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (view.Window != null)\n\t\t\t\t\t\tview.Window.InvalidateCursorRectsForView(view);\n\t\t\t\t});\n\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\n\t\tpublic static NSCursor ToCocoa(this Cursor self)\n\t\t{\n\t\t\tswitch (self)\n\t\t\t{\n\t\t\t\tcase Cursor.Normal:\n\t\t\t\t\treturn NSCursor.ArrowCursor;\n\t\t\t\tcase Cursor.ResizeVertically:\n\t\t\t\t\treturn NSCursor.ResizeUpDownCursor;\n\t\t\t\tcase Cursor.ResizeHorizontally:\n\t\t\t\t\treturn NSCursor.ResizeLeftRightCursor;\n\t\t\t\tcase Cursor.Grab:\n\t\t\t\t\treturn NSCursor.OpenHandCursor;\n\t\t\t\tcase Cursor.Grabbing:\n\t\t\t\t\treturn NSCursor.ClosedHandCursor;\n\t\t\t\tcase Cursor.Pointing:\n\t\t\t\t\treturn NSCursor.PointingHandCursor;\n\t\t\t\tcase Cursor.Text:\n\t\t\t\t\treturn NSCursor.IBeamCursor;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidEnumArgumentException(\"self\", (int)self, typeof(Cursor));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/DataBinding.cs",
    "content": "﻿using System;\nusing System.Linq.Expressions;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reflection;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic static class DataBinding\n\t{\n\t\tpublic static void BindNativeDefaults(this IMountLocation self, NSView element, IScheduler dispatcher)\n\t\t{\n\t\t\tvar frame = self.NativeFrame;\n\n\t\t\tself.BindNativeProperty(dispatcher, \"position\", frame.Position.Transpose(), position =>\n\t\t\t{\n\t\t\t\telement.SetFrameOrigin(position.ToPoint());\n\t\t\t\telement.NeedsDisplay = true;\n\t\t\t});\n\n\t\t\tself.BindNativeProperty(dispatcher, \"size\", frame.Size.Transpose(), size =>\n\t\t\t{\n\t\t\t\telement.SetFrameSize(size.Max(0, 0).ToSize());\n\t\t\t\telement.NeedsDisplay = true;\n\t\t\t});\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TElement, TValue>(\n\t\t\tthis IControl control,\n\t\t\tIScheduler dispatcher,\n\t\t\tstring name,\n\t\t\tIObservable<TValue> value,\n\t\t\tAction<TElement, TValue> update)\n\t\t{\n\t\t\tvalue\n\t\t\t\t.ConnectWhile(control.IsRooted)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Subscribe(v =>\n\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (control.NativeHandle is TElement)\n\t\t\t\t\t\t\tupdate((TElement) control.NativeHandle, v);\n\t\t\t\t\t}));\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TValue, TSome>(\n\t\t\tthis IMountLocation fusionControl,\n\t\t\tNSControl nativeControl,\n\t\t\tExpression<Func<NSControl, TValue>> propertyExpression,\n\t\t\tIObservable<TSome> onChange,\n\t\t\tIProperty<TValue> sourceProperty)\n\t\t{\n\t\t\tvar memberExpression = propertyExpression.Body as MemberExpression;\n\t\t\tPropertyInfo nativeProperty = null;\n\t\t\tif (memberExpression != null)\n\t\t\t{\n\t\t\t\tnativeProperty = memberExpression.Member as PropertyInfo;\n\t\t\t}\n\t\t\tif (nativeProperty == null)\n\t\t\t\tthrow new ArgumentException(\"Unable to extract property name from expression\");\n\n\t\t\tsourceProperty = sourceProperty\n\t\t\t\t.ConnectWhile(fusionControl.IsRooted)\n\t\t\t\t.DistinctUntilChangedOrSet();\n\n\t\t\tvar propertyGetter = propertyExpression.Compile();\n\n\t\t\tvar setByUser = false;\n\n\t\t\tonChange\n\t\t\t\t.Select(_ => propertyGetter(nativeControl))\n\t\t\t\t.Where(_ => setByUser)\n\t\t\t\t.Subscribe(sourceProperty);\n\n\t\t\tsourceProperty\n\t\t\t\t.Select(\n\t\t\t\t\tv => (Action) (() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tsetByUser = false;\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnativeProperty.SetValue(nativeControl, v);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinally\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsetByUser = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}))\n\t\t\t\t.Subscribe(action => {\n\t\t\t\t\t\t\t\t\t\tFusion.Application.MainThread.Schedule(action);\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IObservable<T> ObservableFromNativeEvent<T>(object nativeControl, string name)\n\t\t{\n\t\t\treturn Observable.Create<T>(async observer =>\n\t\t\t\tawait Fusion.Application.MainThread.InvokeAsync(() =>\n\t\t\t\t\tObservable.FromEventPattern<T>(nativeControl, name)\n\t\t\t\t\t\t.Subscribe(pattern =>\n\t\t\t\t\t\t\tobserver.OnNext(pattern.EventArgs))));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/Dispatcher.cs",
    "content": "﻿using System.Threading;\nusing CoreFoundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic class Dispatcher : SingleThreadDispatcherBase\n\t{\n\t\tpublic Dispatcher(Thread thread) : base(thread)\t{ }\n\n\t\tprotected override void Flush()\n\t\t{\n\t\t\tif (RunningOnDispatcherThread)\n\t\t\t\tDrain();\n\t\t\telse\n\t\t\t\tDispatchQueue.MainQueue.DispatchAsync(Drain);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/DraggingImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass DragSource : NSDraggingSource\n\t{\n\t\treadonly NSView _originView;\n\t\treadonly Space _space;\n\t\treadonly Pointer.Callbacks _callbacks;\n\t\tpublic readonly object Data;\n\n\t\tpublic DragSource(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic DragSource(NSView originView, Space space, Pointer.Callbacks callbacks, object data)\n\t\t{\n\t\t\t_originView = originView;\n\t\t\t_space = space;\n\t\t\t_callbacks = callbacks;\n\t\t\tData = data;\n\t\t}\n\n\t\t[Action(\"draggingSession:sourceOperationMaskForDraggingContext:\")]\n\t\tpublic NSDragOperation DraggingSessionSourceOperationMask(NSDraggingSession session, NSDraggingContext context)\n\t\t{\n\t\t\tif (context == NSDraggingContext.WithinApplication)\n\t\t\t{\n\t\t\t\treturn NSDragOperation.Private;\n\t\t\t}\n\n\t\t\treturn NSDragOperation.None;\n\t\t}\n\n\t\t[Action(\"draggingSession:endedAtPoint:operation:\")]\n\t\tpublic void DraggingSessionEnded(NSDraggingSession session, CGPoint screenPoint, NSDragOperation operation)\n\t\t{\n\t\t\t_callbacks.OnReleased();\n\t\t}\n\n\t\t[Action(\"draggingSession:movedToPoint:\")]\n\t\tpublic void DraggingSessionMoved(NSDraggingSession session, CGPoint screenPoint)\n\t\t{\n\t\t\tToPoint(screenPoint).Do(_callbacks.OnMoved);\n\t\t}\n\n\t\t[Action(\"draggingSession:willBeginAtPoint:\")]\n\t\tpublic void DraggingSessionWillBegin(NSDraggingSession session, CGPoint screenPoint)\n\t\t{\n\t\t}\n\n\t\tOptional<Point<Points>> ToPoint(CGPoint screenPoint)\n\t\t{\n\t\t\tvar window = _originView.Window;\n\t\t\tif (window == null)\n\t\t\t{\n\t\t\t\t// The view isn't in any window, so there's nothing sensible to return.\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t\tvar windowPoint = window.ConvertRectFromScreen(new CGRect(screenPoint, new CGSize(0, 0))).Location;\n\n\t\t\tif (_space == Space.Local)\n\t\t\t{\n\t\t\t\tvar localPointCocoa = _originView.ConvertPointFromView(windowPoint, null);\n\t\t\t\treturn Point.Create<Points>((double)localPointCocoa.X, (double)(_originView.Frame.Height - localPointCocoa.Y));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Point.Create<Points>((double)windowPoint.X, (double)(window.Frame.Height - windowPoint.Y));\n\t\t\t}\n\t\t}\n\t}\n\n\tclass DragDestinationView : NSView\n\t{\n\t\treadonly Func<object, bool> _canDrop;\n\t\tpublic Action<object> OnDrop { get; set; }\n\t\tpublic Action<object> OnEnter { get; set; }\n\t\tpublic Action<object> OnExit { get; set; }\n\n\t\tpublic DragDestinationView(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic DragDestinationView(Func<object, bool> canDrop)\n\t\t{\n\t\t\t_canDrop = canDrop;\n\t\t\tbase.RegisterForDraggedTypes(new []\n\t\t\t{\n\t\t\t\t\"public.data\"\n\t\t\t});\n\t\t}\n\n\t\tpublic override NSDragOperation DraggingEntered(NSDraggingInfo sender)\n\t\t{\n\t\t\tvar data = sender.DraggingPasteboard.GetStringForType(\"public.data\");\n\t\t\tif (data != \"fuse-drag-n-drop\")\n\t\t\t\treturn NSDragOperation.None;\n\n\t\t\tvar source = (DragSource) sender.DraggingSource;\n\t\t\tif (_canDrop(source.Data) == false)\n\t\t\t\treturn NSDragOperation.None;\n\n\t\t\tOnEnter(source.Data);\n\n\t\t\treturn NSDragOperation.Private;\n\t\t}\n\n\t\tpublic override void DraggingExited(NSDraggingInfo sender)\n\t\t{\n\t\t\tvar data = sender.DraggingPasteboard.GetStringForType(\"public.data\");\n\t\t\tif (data != \"fuse-drag-n-drop\")\n\t\t\t\treturn;\n\n\t\t\tvar source = (DragSource)sender.DraggingSource;\n\t\t\tif (_canDrop(source.Data) == false)\n\t\t\t\treturn;\n\n\t\t\tOnExit(source.Data);\n\n\t\t\tbase.DraggingExited(sender);\n\t\t}\n\n\t\tpublic override bool PerformDragOperation(NSDraggingInfo sender)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar source = (DragSource)sender.DraggingSource;\n\t\t\t\tOnDrop(source.Data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic class DraggingImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tDragging.Implementation.OnDragOver = (control, canDrop, drop, enter, leave) =>\n\t\t\t{\n\t\t\t\tcontrol = Layout.Layer(control).WithSize(control.DesiredSize);\n\t\t\t\treturn Control.Create(location =>\n\t\t\t\t{\n\t\t\t\t\tcontrol.Mount(\n\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAvailableSize = location.AvailableSize,\n\t\t\t\t\t\t\tIsRooted = location.IsRooted,\n\t\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(location.NativeFrame.Size),\n\t\t\t\t\t\t});\n\n\t\t\t\t\tFunc<object, bool> canDropNow = o => false;\n\t\t\t\t\tcontrol.BindNativeProperty(Fusion.Application.MainThread, \"canDrop\", canDrop, c => canDropNow = c);\n\n\t\t\t\t\tvar nativeHandle = (NSView)control.NativeHandle;\n\n\t\t\t\t\tvar view = new DragDestinationView(o => canDropNow(o))\n\t\t\t\t\t{\n\t\t\t\t\t\tOnDrop = drop,\n\t\t\t\t\t\tOnEnter = enter,\n\t\t\t\t\t\tOnExit = leave\n\t\t\t\t\t};\n\n\t\t\t\t\tview.AddSubview(nativeHandle);\n\n\t\t\t\t\tlocation.BindNativeDefaults(view, dispatcher);\n\n\t\t\t\t\treturn view;\n\t\t\t\t}).WithSize(control.DesiredSize);\n\t\t\t};\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/EffectsImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class EffectsImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tEffects.Implementation.DropShadow = (content, color, radius, angle, distance) =>\n\t\t\t{\n\t\t\t\tradius = radius.Select(r => new Points(r * 1.0/3.0));\n\t\t\t\tvar offset = angle\n\t\t\t\t\t.Select(d => Math.PI * d / 180.0)\n\t\t\t\t\t.CombineLatest(distance, (r, d) =>\n\t\t\t\t\t\tnew CGSize(Math.Cos(r) * d, Math.Sin(r) * d));\n\n\t\t\t\tvar extrudeSize = offset\n\t\t\t\t\t.CombineLatest(radius, (off, rad) =>\n\t\t\t\t\t\tnew Size<Points>(Math.Abs(off.Width) + rad*2.0, Math.Abs(off.Height) + rad*2.0))\n\t\t\t\t\t.Select(s => new Thickness<Points>(s.Width.Round(), s.Height.Round()));\n\n\t\t\t\tcontent = content.WithPadding(extrudeSize);\n\t\t\t\tvar self = Layout.Layer(content).WithSize(content.DesiredSize);\n\n\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t{\n\t\t\t\t\tvar contentView = self.NativeHandle as NSView;\n\t\t\t\t\tif (contentView == null)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tcontentView.WantsLayer = true;\n\n\t\t\t\t\tvar effect = new NSShadow();\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"color\", color, c =>\n\t\t\t\t\t{\n\t\t\t\t\t\teffect.ShadowColor = c.ToNSColor().ShadowWithLevel(0.5f);\n\t\t\t\t\t\tcontentView.Shadow = effect;\n\t\t\t\t\t});\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"radius\", radius, c =>\n\t\t\t\t\t{\n\t\t\t\t\t\teffect.ShadowBlurRadius = (float)c;\n\t\t\t\t\t\tcontentView.Shadow = effect;\n\t\t\t\t\t});\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"offset\", offset, c =>\n\t\t\t\t\t{\n\t\t\t\t\t\teffect.ShadowOffset = c;\n\t\t\t\t\t\tcontentView.Shadow = effect;\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/FileDialogs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\nusing ObjCRuntime;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic class FileDialogs : IFileDialogImplementation\n\t{\n\t\treadonly NSWindow _window;\n\t\tpublic FileDialogs(NSWindow window)\n\t\t{\n\t\t\t_window = window;\n\t\t}\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tFileDialog.Implementation = windowControl =>\n\t\t\t{\n\t\t\t\tvar window =\n\t\t\t\t\twindowControl.Select(control => control.NativeHandle)\n\t\t\t\t\t\t.As<NSView>()\n\t\t\t\t\t\t.Select(nativeHandle => nativeHandle.Window);\n\t\t\t\treturn new FileDialogs(window.OrDefault());\n\t\t\t};\n\t\t}\n\n\t\tpublic Task<Optional<FileDialogResult>> SaveFile (FileDialogOptions options)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread.InvokeAsync(() => SaveFileSync(options));\n\t\t}\n\n\t\tpublic Task<Optional<FileDialogResult>> OpenFile (FileDialogOptions options)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread.InvokeAsync(() => OpenFileSync(options));\n\t\t}\n\n\t\tpublic Task<Optional<IEnumerable<FileDialogResult>>> OpenFiles (FileDialogOptions options)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread.InvokeAsync(() => OpenFilesSync(options));\n\t\t}\n\n\t\tpublic Task<Optional<AbsoluteDirectoryPath>> SelectDirectory (DirectoryDialogOptions options)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread.InvokeAsync(() => SelectDirectorySync (options));\n\t\t}\n\n\t\tOptional<FileDialogResult> SaveFileSync(FileDialogOptions options)\n\t\t{\n\t\t\tvar dialog = new SaveDialog (options.Filters)\n\t\t\t{\n\t\t\t\tTitle = options.Caption,\n\t\t\t};\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tdialog.Directory = options.Directory;\n\n\t\t\tvar success = dialog.Run(_window);\n\n\t\t\tFileDialogResult result = new FileDialogResult();\n\t\t\tif (success)\n\t\t\t{\n\t\t\t\tresult = new FileDialogResult (dialog.FilePath, dialog.CurrentFilter);\n\t\t\t}\n\n\t\t\treturn success\n\t\t\t\t? Optional.Some(result)\n\t\t\t\t: Optional.None<FileDialogResult>();\n\t\t}\n\n\t\tOptional<FileDialogResult> OpenFileSync(FileDialogOptions options)\n\t\t{\n\t\t\tvar dialog = new OpenDialog (options.Filters)\n\t\t\t{\n\t\t\t\tTitle = options.Caption,\n\t\t\t\tMultiselect = false\n\t\t\t};\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tdialog.Directory = options.Directory;\n\n\t\t\tvar success = dialog.Run();\n\n\t\t\tFileDialogResult result = new FileDialogResult();\n\t\t\tif (success)\n\t\t\t{\n\t\t\t\tresult = new FileDialogResult (dialog.FilePath, dialog.CurrentFilter);\n\t\t\t}\n\n\t\t\treturn success\n\t\t\t\t? Optional.Some(result)\n\t\t\t\t: Optional.None<FileDialogResult>();\n\t\t}\n\n\t\tOptional<IEnumerable<FileDialogResult>> OpenFilesSync(FileDialogOptions options)\n\t\t{\n\t\t\tvar dialog = new OpenDialog (options.Filters)\n\t\t\t{\n\t\t\t\tTitle = options.Caption,\n\t\t\t\tMultiselect = true\n\t\t\t};\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tdialog.Directory = options.Directory;\n\n\t\t\tvar success = dialog.Run();\n\n\t\t\tIEnumerable<FileDialogResult> result = null;\n\t\t\tif (success)\n\t\t\t{\n\t\t\t\tresult = dialog.FilePaths.Select(f => new FileDialogResult (f, dialog.CurrentFilter));\n\t\t\t}\n\n\t\t\treturn success\n\t\t\t\t? Optional.Some(result)\n\t\t\t\t: Optional.None<IEnumerable<FileDialogResult>>();\n\t\t}\n\n\t\tOptional<AbsoluteDirectoryPath> SelectDirectorySync(DirectoryDialogOptions options)\n\t\t{\n\t\t\tvar ofd = new OpenDialog()\n\t\t\t{\n\t\t\t\tTitle = options.Caption,\n\t\t\t\tCanChooseDirectories = true,\n\t\t\t\tCanCreateDirectories = true,\n\t\t\t\tCanChooseFiles = false\n\t\t\t};\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tofd.Directory = options.Directory;\n\n\t\t\tvar success = ofd.Run();\n\t\t\tvar path = ofd.Directory;\n\n\t\t\treturn success\n\t\t\t\t? Optional.Some(path)\n\t\t\t\t: Optional.None<AbsoluteDirectoryPath>();\n\t\t}\n\t}\n\n\tclass Dialog\n\t{\n\t\tprotected readonly FileFilter[] _filters;\n\t\tprotected readonly NSSavePanel _panel;\n\n\t\tprotected Dialog(NSSavePanel panel, FileFilter []filters)\n\t\t{\n\t\t\t_filters = filters;\n\t\t\t_panel = panel;\n\t\t\tCreateFilters(filters);\n\t\t}\n\n\t\tvoid CreateFilters(FileFilter []filters)\n\t\t{\n\t\t\tif (filters.Any ())\n\t\t\t{\n\t\t\t\tvar label = new NSTextField ();\n\t\t\t\tvar fileTypes = new NSPopUpButton ();\n\t\t\t\tfileTypes.AddItems (filters.Select (f => f.Label).ToArray ());\n\n\t\t\t\tvar fileTypeView = new NSView ();\n\t\t\t\tfileTypeView.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;\n\t\t\t\tconst int padding = 15;\n\n\t\t\t\tlabel.StringValue = \"Show Files\";\n\t\t\t\tlabel.DrawsBackground = false;\n\t\t\t\tlabel.Bordered = false;\n\t\t\t\tlabel.Bezeled = false;\n\t\t\t\tlabel.Editable = false;\n\t\t\t\tlabel.Selectable = false;\n\t\t\t\tlabel.SizeToFit ();\n\t\t\t\tfileTypeView.AddSubview (label);\n\n\t\t\t\tfileTypes.SizeToFit ();\n\t\t\t\tfileTypes.Activated += (sender, e) =>\n\t\t\t\t{\n\t\t\t\t\tvar currentFilter = filters.FirstOrDefault (f => f.Label == fileTypes.TitleOfSelectedItem);\n\t\t\t\t\tSetCurrentItem (currentFilter);\n\n\t\t\t\t\t// THIS DOES NOT WORK ON MAC OS FROM MAVERICS TO YOSEMITE\n\t\t\t\t\t// There exists hacks, however they are dependent on OS X version\n\t\t\t\t\t// I have filed bug as many others, but I guess this will never be fixed\n\t\t\t\t\t_panel.ValidateVisibleColumns ();\n\t\t\t\t\t_panel.Update ();\n\t\t\t\t};\n\t\t\t\tfileTypeView.AddSubview (fileTypes);\n\t\t\t\tfileTypes.SetFrameOrigin (new CGPoint(label.Frame.Width + 10, padding));\n\n\t\t\t\tlabel.SetFrameOrigin (new CGPoint(0, padding + (fileTypes.Frame.Height - label.Frame.Height) / 2));\n\n\t\t\t\tfileTypeView.Frame = new CGRect (0, 0, fileTypes.Frame.Width + label.Frame.Width + 10, fileTypes.Frame.Height + padding * 2);\n\n\t\t\t\t_panel.AccessoryView = fileTypeView;\n\t\t\t\tif (filters.Any ())\n\t\t\t\t\tSetCurrentItem (filters.First ());\n\t\t\t}\n\t\t\telse\n\t\t\t\t_panel.AccessoryView = null;\n\t\t}\n\n\t\tpublic string Title\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _panel.Title;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_panel.Title = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic AbsoluteFilePath FilePath\n\t\t{\n\t\t\tget { return _panel.Url.ToAbsoluteFilePath(); }\n\t\t}\n\n\t\tpublic AbsoluteDirectoryPath Directory\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _panel.DirectoryUrl.ToAbsoluteDirectoryPath ();\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\t_panel.DirectoryUrl = value.ToNSUrl ();\n\t\t\t}\n\t\t}\n\n\t\tpublic bool CanCreateDirectories\n\t\t{\n\t\t\tget { return _panel.CanCreateDirectories; }\n\t\t\tset { _panel.CanCreateDirectories = value; }\n\t\t}\n\n\t\tpublic FileFilter CurrentFilter { get; private set; }\n\n\t\tvoid SetCurrentItem(FileFilter filter)\n\t\t{\n\t\t\tCurrentFilter = filter;\n\n\t\t\tvar macfilters = new List<string> ();\n\t\t\tforeach (var filterext in filter.Extensions)\n\t\t\t{\n\t\t\t\tmacfilters.Add (filterext.TrimStart ('*', '.'));\n\t\t\t}\n\n\t\t\t_panel.AllowsOtherFileTypes = false;\n\t\t\tSetAllowedFileTypes(_panel, macfilters.Distinct().ToArray ());\n\t\t}\n\n\t\tpublic bool Run(Optional<NSWindow> window = default(Optional<NSWindow>))\n\t\t{\n\t\t\tif (window.HasValue) {\n\t\t\t\t_panel.BeginSheet (window.Value, result => NSApplication.SharedApplication.StopModalWithCode (result));\n\t\t\t\treturn NSApplication.SharedApplication.RunModalForWindow (window.Value) == 1;\n\t\t\t} else {\n\t\t\t\treturn _panel.RunModal() == 1;\n\t\t\t}\n\t\t}\n\n\t\tstatic readonly IntPtr selSetAllowedFileTypes_Handle = Selector.GetHandle(\"setAllowedFileTypes:\");\n\n\t\tstatic void SetAllowedFileTypes(NSSavePanel openPanel, string []extensions)\n\t\t{\n\t\t\tif (extensions.Length == 0)\n\t\t\t{\n\t\t\t\tMessaging.void_objc_msgSendSuper_IntPtr (openPanel.SuperHandle, selSetAllowedFileTypes_Handle, IntPtr.Zero);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tNSArray array = NSArray.FromStrings (extensions);\n\t\t\t\tMessaging.void_objc_msgSendSuper_IntPtr (openPanel.SuperHandle, selSetAllowedFileTypes_Handle, array.Handle);\n\t\t\t}\n\t\t}\n\t}\n\n\tclass SaveDialog : Dialog\n\t{\n\t\tpublic SaveDialog(Optional<IEnumerable<FileFilter>> filters = default(Optional<IEnumerable<FileFilter>>))\n\t\t\t: base(new NSSavePanel(), filters.HasValue ? filters.Value.ToArray() : new FileFilter[0])\n\t\t{\n\t\t}\n\t}\n\n\tclass OpenDialog : Dialog\n\t{\n\t\treadonly NSOpenPanel _nsOpenPanel;\n\n\t\tpublic OpenDialog(Optional<IEnumerable<FileFilter>> filters = default(Optional<IEnumerable<FileFilter>>))\n\t\t\t: base(new NSOpenPanel(), filters.HasValue ? filters.Value.ToArray() : new FileFilter[0])\n\t\t{\n\t\t\t_nsOpenPanel = (NSOpenPanel)_panel;\n\t\t}\n\n\t\tpublic bool Multiselect\n\t\t{\n\t\t\tget { return _nsOpenPanel.AllowsMultipleSelection; }\n\t\t\tset { _nsOpenPanel.AllowsMultipleSelection = value; }\n\t\t}\n\n\t\tpublic bool CanChooseDirectories\n\t\t{\n\t\t\tget { return _nsOpenPanel.CanChooseDirectories; }\n\t\t\tset { _nsOpenPanel.CanChooseDirectories = value; }\n\t\t}\n\n\t\tpublic bool CanChooseFiles\n\t\t{\n\t\t\tget { return _nsOpenPanel.CanChooseFiles; }\n\t\t\tset { _nsOpenPanel.CanChooseFiles = value; }\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> FilePaths\n\t\t{\n\t\t\tget { return _nsOpenPanel.Urls.Select (s => s.ToAbsoluteFilePath ()); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/KeyboardImplementation.cs",
    "content": "using System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class KeyboardImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tKeyboard.Implementation.GiveFocusTo = (control) => Command.Disabled;\n\n\t\t\tKeyboard.Implementation.Pressed = (self, modifier, key) =>\n\t\t\t\tFusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => self.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.OfType<IObservableResponder>()\n\t\t\t\t\t.Select(view => view.KeyDown).Switch()\n\t\t\t\t\t.Where(evt => evt.CharactersIgnoringModifiers == key.ToKeyEquivalent()\n\t\t\t\t\t\t&& evt.ModifierFlags.HasFlag(modifier.ToNSEventModifierMask()))\n\t\t\t\t\t.Select(c => Unit.Default);\n\n\t\t\tKeyboard.Implementation.Released = (self, modifier, key) =>\n\t\t\t\tFusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => self.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.OfType<IObservableResponder>()\n\t\t\t\t\t.Select(view => view.KeyUp).Switch()\n\t\t\t\t\t.Where(evt => evt.CharactersIgnoringModifiers == key.ToKeyEquivalent()\n\t\t\t\t\t\t&& evt.ModifierFlags.HasFlag(modifier.ToNSEventModifierMask()))\n\t\t\t\t\t.Select(c => Unit.Default);\n\n\t\t\tKeyboard.Implementation.GlobalPressed = (self, modifier, key) =>\n\t\t\t{\n\t\t\t\tvar keyDown = new Subject<NSEvent>();\n\n\t\t\t\tNSEvent.AddLocalMonitorForEventsMatchingMask(NSEventMask.KeyDown,\n\t\t\t\t\tevt =>\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyDown.OnNext(evt);\n\t\t\t\t\t\treturn evt;\n\t\t\t\t\t});\n\n\t\t\t\treturn keyDown\n\t\t\t\t\t.Where(evt => evt.CharactersIgnoringModifiers == key.ToKeyEquivalent()\n\t\t\t\t\t\t&& evt.ModifierFlags.HasFlag(modifier.ToNSEventModifierMask()))\n\t\t\t\t\t.Select(c => Unit.Default);\n\t\t\t};\n\n\t\t\tKeyboard.Implementation.GlobalReleased = (self, modifier, key) =>\n\t\t\t{\n\t\t\t\tvar keyUp = new Subject<NSEvent>();\n\n\t\t\t\tNSEvent.AddLocalMonitorForEventsMatchingMask(NSEventMask.KeyUp,\n\t\t\t\t\tevt =>\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyUp.OnNext(evt);\n\t\t\t\t\t\treturn evt;\n\t\t\t\t\t});\n\n\t\t\t\treturn keyUp\n\t\t\t\t\t.Where(evt => evt.CharactersIgnoringModifiers == key.ToKeyEquivalent()\n\t\t\t\t\t\t&& evt.ModifierFlags.HasFlag(modifier.ToNSEventModifierMask()))\n\t\t\t\t\t.Select(c => Unit.Default);\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/LayeringImplementation.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Text;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class LayeringImplementation\n\t{\n\t\tpublic static void DebugWriteNSTree(NSView childContainer)\n\t\t{\n\t\t\tvar root = childContainer;\n\t\t\twhile (root.Superview != null)\n\t\t\t{\n\t\t\t\troot = root.Superview;\n\t\t\t}\n\n\t\t\tvar sb = new StringBuilder();\n\t\t\tStack<Tuple<NSView,int>> toVisit = new Stack<Tuple<NSView,int>>();\n\n\t\t\ttoVisit.Push(Tuple.Create(root,0));\n\t\t\twhile (!toVisit.IsEmpty())\n\t\t\t{\n\t\t\t\tvar current = toVisit.Pop();\n\n\t\t\t\tsb.Append('\\t',current.Item2);\n\t\t\t\tsb.Append(current.Item1 + \" : \" + current.Item1.Frame + \"\\n\");\n\n\t\t\t\tforeach (var chi in current.Item1.Subviews)\n\t\t\t\t\ttoVisit.Push(Tuple.Create(chi,current.Item2+1));\n\t\t\t}\n\n\t\t\tConsole.Write(sb.ToString());\n\t\t}\n\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tLayout.Implementation.LayerControls = (childFactory) =>\n\t\t\t\tControl.Create(ctrl =>\n\t\t\t\t{\n\t\t\t\t\tvar element = new NSView();\n\t\t\t\t\telement.Hidden = true;\n\n\t\t\t\t\tctrl.BindNativeDefaults(element, dispatcher);\n\n\t\t\t\t\tchildFactory(ctrl)\n\t\t\t\t\t\t// IMPORTANT: ConnectWhile has to be done first since else we'll lose all changes done to the children list while the ctrl is unrooted.\n\t\t\t\t\t\t// which breaks diffing, and we get dangling views (views that aren't removed).\n\t\t\t\t\t\t.ConnectWhile(ctrl.IsRooted)\n\t\t\t\t\t\t.DiffSequence()\n\t\t\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t.Subscribe(children =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telement.Hidden = children.Current.Count == 0;\n\t\t\t\t\t\t\tforeach (var child in children.Removed)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar nativeChild = child.NativeHandle as NSView;\n\t\t\t\t\t\t\t\tif (nativeChild != null)\n\t\t\t\t\t\t\t\t\tnativeChild.RemoveFromSuperview();\n\n\t\t\t\t\t\t\t\tchild.Mount(MountLocation.Unmounted);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach (var child in children.Added)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchild.Mount(\n\t\t\t\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tIsRooted = ctrl.IsRooted,\n\t\t\t\t\t\t\t\t\t\tAvailableSize = ctrl.AvailableSize,\n\t\t\t\t\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(ctrl.NativeFrame.Size),\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tvar nativeChild = child.NativeHandle as NSView;\n\t\t\t\t\t\t\t\tif (nativeChild == null)\n\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\tif (nativeChild.Superview != null)\n\t\t\t\t\t\t\t\t\tnativeChild.RemoveFromSuperview();\n\n\t\t\t\t\t\t\t\tNSView nativeChildBelow = null;\n\t\t\t\t\t\t\t\tfor (int i = children.Current.IndexOf(child) - 1; i >= 0; i--)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnativeChildBelow = children.Current[i].NativeHandle as NSView;\n\t\t\t\t\t\t\t\t\tif (nativeChildBelow != null)\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (nativeChildBelow != null)\n\t\t\t\t\t\t\t\t\telement.AddSubview(nativeChild, NSWindowOrderingMode.Above, nativeChildBelow);\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\telement.AddSubview(nativeChild);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\treturn element;\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/MacEnvironmentImpl.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing CoreServices;\nusing Foundation;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass MacEnvironmentImpl : IMacEnvironmentImpl\n\t{\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetPathToApplicationsThatContains(string name)\n\t\t{\n\t\t\tforeach (var app in GetApplications(name))\n\t\t\t\tyield return app;\n\n\t\t\tvar directories = Directory.GetDirectories(\"/Applications\");\n\t\t\tforeach (var directory in directories)\n\t\t\t{\n\t\t\t\tif (directory.Contains(name))\n\t\t\t\t\tyield return AbsoluteDirectoryPath.Parse(directory);\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetApplications(string identifier)\n\t\t{\n\t\t\tvar appUrls = LaunchServices.GetApplicationUrlsForBundleIdentifier(new NSString(identifier));\n\t\t\tif (appUrls == null)\n\t\t\t\treturn Enumerable.Empty<AbsoluteDirectoryPath>();\n\t\t\treturn appUrls.Select(p => AbsoluteDirectoryPath.Parse(p.Path));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/MainThread.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Threading.Tasks;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic static class MainThread\n\t{\n\t\tpublic static Task BeginInvoke(Action operation)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread.InvokeAsync(() =>\n\t\t\t{\n\t\t\t\toperation();\n\t\t\t\treturn Unit.Default;\n\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/Marshalling.cs",
    "content": "﻿using System;\nusing System.ComponentModel;\nusing System.Linq;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic static class Marshalling\n\t{\n\t\tpublic static NSEventModifierMask ToNSEventModifierMask(this ModifierKeys keys)\n\t\t{\n\t\t\tvar mask = (NSEventModifierMask)0;\n\n\t\t\tif (keys.HasFlag (ModifierKeys.Alt))\n\t\t\t\tmask |= NSEventModifierMask.AlternateKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Command))\n\t\t\t\tmask |= NSEventModifierMask.CommandKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Control))\n\t\t\t\tmask |= NSEventModifierMask.ControlKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Shift))\n\t\t\t\tmask |= NSEventModifierMask.ShiftKeyMask;\n\t\t\tif(keys.HasFlag(ModifierKeys.Meta))\n\t\t\t\tmask |= NSEventModifierMask.CommandKeyMask;\n\n\t\t\treturn mask;\n\t\t}\n\n\t\tpublic static string ToKeyEquivalent (this Key key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase Key.None: return \"\";\n\t\t\t\tcase Key.Space: return \" \";\n\t\t\t\tcase Key.D0: return \"0\";\n\t\t\t\tcase Key.D1: return \"1\";\n\t\t\t\tcase Key.D2: return \"2\";\n\t\t\t\tcase Key.D3: return \"3\";\n\t\t\t\tcase Key.D4: return \"4\";\n\t\t\t\tcase Key.D5: return \"5\";\n\t\t\t\tcase Key.D6: return \"6\";\n\t\t\t\tcase Key.D7: return \"7\";\n\t\t\t\tcase Key.D8: return \"8\";\n\t\t\t\tcase Key.D9: return \"9\";\n\t\t\t\tcase Key.Plus: return \"+\";\n\t\t\t\tcase Key.Minus: return \"-\";\n\t\t\t\tcase Key.NumPad0: return \"0\";\n\t\t\t\tcase Key.NumPad1: return \"1\";\n\t\t\t\tcase Key.NumPad2: return \"2\";\n\t\t\t\tcase Key.NumPad3: return \"3\";\n\t\t\t\tcase Key.NumPad4: return \"4\";\n\t\t\t\tcase Key.NumPad5: return \"5\";\n\t\t\t\tcase Key.NumPad6: return \"6\";\n\t\t\t\tcase Key.NumPad7: return \"7\";\n\t\t\t\tcase Key.NumPad8: return \"8\";\n\t\t\t\tcase Key.NumPad9: return \"9\";\n\t\t\t\tcase Key.Add: return \"+\";\n\t\t\t\tcase Key.Subtract: return \"-\";\n\t\t\t}\n\t\t\treturn key.ToString ().ToLower ();\n\t\t}\n\n\t\tpublic static Color ToColor(this NSColor value)\n\t\t{\n\t\t\tif(value == null)\n\t\t\t\treturn new Color(0,0,0,1);\n\n\t\t\tvar calibratedColor = value.UsingColorSpace(NSColorSpace.DeviceRGBColorSpace);\n\t\t\treturn new Color((float)calibratedColor.RedComponent, (float)calibratedColor.GreenComponent, (float)calibratedColor.BlueComponent, (float)calibratedColor.AlphaComponent);\n\t\t}\n\n\t\tpublic static NSColor ToNSColor(this Color value)\n\t\t{\n\t\t\treturn NSColor.FromColorSpace(NSColorSpace.SRGBColorSpace, new nfloat[] { value.R, value.G, value.B, value.A });\n\t\t}\n\n\t\tpublic static nfloat[] ToLineDash(this StrokeDashArray value)\n\t\t{\n\t\t\treturn value.Data.Select(v => (nfloat)v).ToArray();\n\t\t}\n\n\t\tpublic static NSTextAlignment ToNSTextAlignment(this TextAlignment alignment)\n\t\t{\n\t\t\tswitch (alignment)\n\t\t\t{\n\t\t\t\tcase TextAlignment.Left:\n\t\t\t\t\treturn NSTextAlignment.Left;\n\t\t\t\tcase TextAlignment.Center:\n\t\t\t\t\treturn NSTextAlignment.Center;\n\t\t\t\tcase TextAlignment.Right:\n\t\t\t\t\treturn NSTextAlignment.Right;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidEnumArgumentException(\"alignment\", (int)alignment, typeof(TextAlignment));\n\t\t\t}\n\t\t}\n\t\tpublic static Point<Points> ToFusion(this CGPoint p)\n\t\t{\n\t\t\treturn Point.Create<Points>((double)p.X, (double)p.Y);\n\t\t}\n\n\t\tpublic static Size<Points> ToFusion(this CGSize size)\n\t\t{\n\t\t\treturn Size.Create<Points>((double)size.Width, (double)size.Height);\n\t\t}\n\n\t\tpublic static CGSize ToSize(this Size<Points> size)\n\t\t{\n\t\t\treturn new CGSize(size.Width, size.Height);\n\t\t}\n\n\t\tpublic static CGPoint ToPoint(this Point<Points> p)\n\t\t{\n\t\t\treturn new CGPoint(p.X, p.Y);\n\t\t}\n\n\t\tpublic static AbsoluteFilePath ToAbsoluteFilePath(this NSUrl url)\n\t\t{\n\t\t\treturn AbsoluteFilePath.Parse(url.Path);\n\t\t}\n\n\t\tpublic static AbsoluteDirectoryPath ToAbsoluteDirectoryPath(this NSUrl url)\n\t\t{\n\t\t\treturn AbsoluteDirectoryPath.Parse(url.Path);\n\t\t}\n\n\t\tpublic static NSUrl ToNSUrl(this AbsoluteFilePath path)\n\t\t{\n\t\t\treturn new NSUrl(new Uri(path.NativePath).AbsoluteUri);\n\t\t}\n\n\t\tpublic static NSUrl ToNSUrl(this AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn new NSUrl(new Uri(path.NativePath).AbsoluteUri);\n\t\t}\n\n\t\tpublic static NSLineBreakMode ToNSLineBreakMode(this LineBreakMode lineBreakMode)\n\t\t{\n\t\t\tswitch (lineBreakMode)\n\t\t\t{\n\t\t\t\tcase LineBreakMode.Clip:\n\t\t\t\t\treturn NSLineBreakMode.Clipping;\n\t\t\t\tcase LineBreakMode.Wrap:\n\t\t\t\t\treturn NSLineBreakMode.ByWordWrapping;\n\t\t\t\tcase LineBreakMode.TruncateHead:\n\t\t\t\t\treturn NSLineBreakMode.TruncatingHead;\n\t\t\t\tcase LineBreakMode.TruncateTail:\n\t\t\t\t\treturn NSLineBreakMode.TruncatingTail;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new InvalidEnumArgumentException(\"lineBreakMode\", (int)lineBreakMode, typeof(LineBreakMode));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/MenuBuilder.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading.Tasks;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic class MenuBuilder\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t}\n\n\t\tpublic static async Task<DataBoundNSMenu> CreateMenu(Menu menu, IReport log, IObservable<string> title = null)\n\t\t{\n\t\t\treturn await Fusion.Application.MainThread.InvokeAsync(() => new DataBoundNSMenu(menu, log, populateLazily: false, title: title));\n\t\t}\n\t}\n\n\tpublic class DataBoundNSMenu : NSMenu\n\t{\n\t\treadonly IScheduler _dispatcher;\n\t\treadonly IReport _log;\n\t\tIDisposable _subscription = Disposable.Empty;\n\n\t\tpublic DataBoundNSMenu(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic DataBoundNSMenu(Menu menu, IReport log, bool populateLazily, IObservable<string> title = null)\n\t\t{\n\t\t\ttitle = title ?? Observable.Never<string>();\n\t\t\t_dispatcher = Fusion.Application.MainThread;\n\t\t\t_log = log;\n\t\t\tbase.AutoEnablesItems = false;\n\n\t\t\tif (populateLazily)\n\t\t\t{\n\t\t\t\tDelegate = new DataBoundNSMenuDelegate(\n\t\t\t\t\tmenuWillOpen: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\t_subscription.Dispose();\n\t\t\t\t\t\tRemoveAllItems();\n\t\t\t\t\t\t_subscription = Populate(title, menu);\n\t\t\t\t\t},\n\t\t\t\t\tmenuDidClose: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\t_subscription.Dispose();\n\t\t\t\t\t\tRemoveAllItems();\n\t\t\t\t\t\t_subscription = Disposable.Empty;\n\t\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_subscription = Populate(title, menu);\n\t\t\t}\n\t\t}\n\n\t\tIDisposable Populate(IObservable<string> title, Menu menu)\n\t\t{\n\t\t\treturn Disposable.Combine(\n\t\t\t\ttitle.Subscribe(t => Title = t),\n\t\t\t\tmenu.Items\n\t\t\t\t\t.ObserveOn(_dispatcher)\n\t\t\t\t\t.UnsafeAsObservableList()\n\t\t\t\t\t.Select(CreateItem)\n\t\t\t\t\t.DisposeElements()\n\t\t\t\t\t.Subscribe(change =>\n                        _log.TrySomethingBlocking(() =>\n                        {\n                            change(\n                                insert: (i, x) => InsertItem(x, i),\n                                replace: (i, x) =>\n                                {\n                                    RemoveItemAt(i);\n                                    InsertItem(x, i);\n                                },\n                                remove: i => RemoveItemAt(i),\n                                clear: RemoveAllItems);\n                        })));\n\t\t}\n\n\t\tNSMenuItem CreateItem(MenuItem item)\n\t\t{\n\t\t\tif (item.IsSeparator)\n\t\t\t\treturn (NSMenuItem)NSMenuItem.SeparatorItem.Copy();\n\n\t\t\treturn new DataBoundNSMenuItem(_dispatcher, item, _log);\n\t\t}\n\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing)\n\t\t\t\t_subscription.Dispose();\n\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\n\t\tclass DataBoundNSMenuDelegate : NSMenuDelegate\n\t\t{\n\t\t\treadonly Action _menuWillOpen;\n\t\t\treadonly Action _menuDidClose;\n\n\t\t\tpublic DataBoundNSMenuDelegate(IntPtr handle)\n\t\t\t\t: base(handle)\n\t\t\t{ }\n\n\t\t\tpublic DataBoundNSMenuDelegate(Action menuWillOpen, Action menuDidClose)\n\t\t\t{\n\t\t\t\t_menuWillOpen = menuWillOpen;\n\t\t\t\t_menuDidClose = menuDidClose;\n\t\t\t}\n\n\t\t\tpublic override void MenuWillOpen(NSMenu menu)\n\t\t\t{\n\t\t\t\t_menuWillOpen();\n\t\t\t}\n\n\t\t\tpublic override void MenuDidClose(NSMenu menu)\n\t\t\t{\n\t\t\t\t_menuDidClose();\n\t\t\t}\n\n\t\t\tpublic override void MenuWillHighlightItem(NSMenu menu, NSMenuItem item) { }\n\t\t}\n\t}\n\n\tclass DataBoundNSMenuItem : NSMenuItem\n\t{\n\t\treadonly IDisposable _subscription;\n\n\t\tpublic DataBoundNSMenuItem(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic DataBoundNSMenuItem(IScheduler dispatcher, MenuItem item, IReport log)\n\t\t{\n\t\t\titem.Menu.Do(submenu =>\n\t\t\t\tMenuBuilder.CreateMenu(submenu, log, item.Name)\n\t\t\t\t\t.ToObservable().Subscribe(t =>\n\t\t\t\t\t\tFusion.Application.MainThread.InvokeAsync(() => Submenu = t)));\n\n\t\t\tAction click = () => { };\n\n\t\t\t_subscription = Disposable.Combine\n\t\t\t(\n\t\t\t\titem.Command.Action.CombineLatest(item.Name).Subscribe(cmdName =>\n\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cmd = cmdName.Item1;\n\t\t\t\t\t\tvar name = cmdName.Item2;\n\t\t\t\t\t\tTitle = name;\n\t\t\t\t\t\tEnabled = cmd.HasValue;\n\t\t\t\t\t\tclick = () => log.TrySomethingBlocking(() => cmd.Do(x => x()));\n\t\t\t\t\t\tif (item.Hotkey != HotKey.None)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKeyEquivalentModifierMask = item.Hotkey.Modifier.ToNSEventModifierMask();\n\t\t\t\t\t\t\tKeyEquivalent = item.Hotkey.Key.ToKeyEquivalent();\n\t\t\t\t\t\t}\n\t\t\t\t\t})),\n\n\t\t\t\titem.IsToggled.Subscribe(isToggled =>\n\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t\tState = isToggled ? NSCellStateValue.On : NSCellStateValue.Off)),\n\n\t\t\t\tDisposable.Create(() => item.Menu.Do(_ => Submenu.Dispose()))\n\t\t\t);\n\n\t\t\tActivated += (s, a) => click();\n\t\t}\n\n\t\tprotected override void Dispose(bool disposing)\n\t\t{\n\t\t\tif (disposing)\n\t\t\t\t_subscription.Dispose();\n\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/MessageBox.cs",
    "content": "﻿using System;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic class MessageBox\n\t{\n\t\treadonly NSAlert _alert;\n\t\treadonly MessageBoxButtons _buttons;\n\t\treadonly MessageBoxDefaultButton _defaultButton;\n\n\t\tMessageBox(\n\t\t\tstring text,\n\t\t\tstring caption,\n\t\t\tMessageBoxButtons buttons,\n\t\t\tMessageBoxType type,\n\t\t\tMessageBoxDefaultButton defaultButton)\n\t\t{\n\t\t\t_buttons = buttons;\n\t\t\t_defaultButton = defaultButton;\n\n\t\t\t_alert = new NSAlert ();\n\t\t\tAddButtons (_alert);\n\t\t\t_alert.AlertStyle = Convert (type);\n\t\t\t_alert.MessageText = caption ?? string.Empty;\n\t\t\t_alert.InformativeText = text ?? string.Empty;\n\t\t}\n\n\t\tpublic static DialogResult ShowMessageBox(string text,\n\t\t\tstring caption,\n\t\t\tMessageBoxButtons buttons,\n\t\t\tMessageBoxType type,\n\t\t\tMessageBoxDefaultButton defaultButton)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread.InvokeAsync(() => new MessageBox (text, caption, buttons, type, defaultButton).Show()).Result;\n\t\t}\n\n\t\tDialogResult Show()\n\t\t{\n\t\t\tvar ret = (int)_alert.RunModal ();\n\t\t\tswitch (_buttons)\n\t\t\t{\n\t\t\tcase MessageBoxButtons.Ok:\n\t\t\t\treturn DialogResult.Ok;\n\t\t\tcase MessageBoxButtons.OkCancel:\n\t\t\t\treturn (ret == 1000) ? DialogResult.Ok : DialogResult.Cancel;\n\t\t\tcase MessageBoxButtons.YesNo:\n\t\t\t\treturn (ret == 1000) ? DialogResult.Yes : DialogResult.No;\n\t\t\tcase MessageBoxButtons.YesNoCancel:\n\t\t\t\treturn (ret == 1000) ? DialogResult.Yes : (ret == 1001) ? DialogResult.No : DialogResult.Cancel;\n\t\t\tdefault:\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\tvoid AddButtons(NSAlert alert)\n\t\t{\n\t\t\tswitch (_buttons)\n\t\t\t{\n\t\t\tcase MessageBoxButtons.Ok:\n\t\t\t\talert.AddButton (\"Ok\");\n\t\t\t\tbreak;\n\t\t\tcase MessageBoxButtons.OkCancel:\n\t\t\t\t{\n\t\t\t\t\tvar ok = alert.AddButton (\"Ok\");\n\t\t\t\t\tvar cancel = alert.AddButton (\"Cancel\");\n\t\t\t\t\tswitch (_defaultButton) {\n\t\t\t\t\tcase MessageBoxDefaultButton.Ok:\n\t\t\t\t\t\tok.BecomeFirstResponder ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MessageBoxDefaultButton.Cancel:\n\t\t\t\t\tcase MessageBoxDefaultButton.Default:\n\t\t\t\t\t\tcancel.BecomeFirstResponder ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase MessageBoxButtons.YesNo:\n\t\t\t\t{\n\t\t\t\t\tvar yes = alert.AddButton (\"Yes\");\n\t\t\t\t\tvar no = alert.AddButton (\"No\");\n\t\t\t\t\tswitch (_defaultButton) {\n\t\t\t\t\tcase MessageBoxDefaultButton.Yes:\n\t\t\t\t\t\tyes.BecomeFirstResponder ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MessageBoxDefaultButton.No:\n\t\t\t\t\tcase MessageBoxDefaultButton.Default:\n\t\t\t\t\t\tno.BecomeFirstResponder ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase MessageBoxButtons.YesNoCancel:\n\t\t\t\t{\n\t\t\t\t\tvar yes = alert.AddButton (\"Yes\");\n\t\t\t\t\tvar no = alert.AddButton (\"No\");\n\t\t\t\t\tvar cancel = alert.AddButton (\"Cancel\");\n\t\t\t\t\tswitch (_defaultButton) {\n\t\t\t\t\tcase MessageBoxDefaultButton.Yes:\n\t\t\t\t\t\tyes.BecomeFirstResponder ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MessageBoxDefaultButton.No:\n\t\t\t\t\t\tno.BecomeFirstResponder ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MessageBoxDefaultButton.Cancel:\n\t\t\t\t\tcase MessageBoxDefaultButton.Default:\n\t\t\t\t\t\tcancel.BecomeFirstResponder ();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\n\t\tstatic NSAlertStyle Convert(MessageBoxType type)\n\t\t{\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\tcase MessageBoxType.Error:\n\t\t\t\treturn NSAlertStyle.Critical;\n\t\t\tcase MessageBoxType.Information:\n\t\t\t\treturn NSAlertStyle.Informational;\n\t\t\tdefault:\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "src/fusion/mac/MessageBoxImplementation.cs",
    "content": "using AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass MessageBoxImplementation : IMessageBox\n\t{\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tDialogs.MessageBox.Implementation = new MessageBoxImplementation();\n\t\t}\n\n\t\tpublic void BringToFront()\n\t\t{\n\t\t\tNSApplication app = NSApplication.SharedApplication;\n\t\t\tapp.ActivateIgnoringOtherApps(true);\n\n\t\t\t// FIXME: Enumerate windows and give focus?\n\t\t}\n\n\t\tpublic bool ShowConfirm(string text, string caption, MessageBoxType type)\n\t\t{\n            return MessageBox.ShowMessageBox(text, caption,\n\t\t\t\t\tMessageBoxButtons.YesNo,\n\t\t\t\t\tMessageBoxType.Information,\n\t\t\t\t\tMessageBoxDefaultButton.Yes)\n\t\t\t\t== DialogResult.Yes;\n\t\t}\n\n\t\tpublic void Show(string text, string caption, MessageBoxType type)\n\t\t{\n\t\t\tMessageBox.ShowMessageBox(text, caption,\n\t\t\t\t\tMessageBoxButtons.Ok,\n\t\t\t\t\tMessageBoxType.Information,\n\t\t\t\t\tMessageBoxDefaultButton.Ok);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/MonoMacGraphicsContext.cs",
    "content": "﻿using System;\nusing System.Drawing;\nusing Foundation;\nusing AppKit;\nusing ObjCRuntime;\nusing OpenGL;\n\nnamespace Outracks.UnoCore.MonoMacSupport\n{\n    class MonoMacGraphicsContext : Uno.Runtime.Implementation.GraphicsContextHandle\n    {\n        UnoGLView _view;\n\n        public MonoMacGraphicsContext(UnoGLView view)\n        {\n            _view = view;\n        }\n\n        public override int GetBackbufferGLHandle()\n        {\n            return 0;\n        }\n\n        public override Uno.Int2 GetBackbufferSize()\n        {\n            return _view.DrawableSize;\n        }\n\n        public override Uno.Int2 GetBackbufferOffset()\n        {\n            return new Uno.Int2(0, 0);\n        }\n\n        public override Uno.Recti GetBackbufferScissor()\n        {\n            return new Uno.Recti(new Uno.Int2(0, 0), _view.DrawableSize);\n        }\n\n        public override int GetRealBackbufferHeight()\n        {\n            return _view.DrawableSize.Y;\n        }\n    }\n}\n\n"
  },
  {
    "path": "src/fusion/mac/MonoMacNotifier.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading.Tasks;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass MonoMacNotifier : INotifier\n\t{\n\t\treadonly Subject<IImmutableSet<Guid>> _currentNotifications = new Subject<IImmutableSet<Guid>>();\n\t\treadonly Subject<Guid> _notificationActivated = new Subject<Guid>();\n\t\treadonly NSTimer _timer;\n\t\treadonly NSUserNotificationCenter _center;\n\t\treadonly IReport _report;\n\n\t\tpublic MonoMacNotifier(NSUserNotificationCenter center, IReport report)\n\t\t{\n\t\t\t_center = center;\n\t\t\t_report = report;\n\t\t\t_center.ShouldPresentNotification = (c, n) => true; // Show notification even if app is TopMost.\n\t\t\t_center.DidActivateNotification += (s, a) =>\n\t\t\t\t_notificationActivated.OnNext(GetId(a.Notification));\n\n\t\t\t_timer = NSTimer.CreateRepeatingScheduledTimer(\n\t\t\t\tTimeSpan.FromMilliseconds(500),\n\t\t\t\ttimer =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar currentNotifications =\n\t\t\t\t\t\t\t_center.DeliveredNotifications.Select(GetId).ToImmutableHashSet();\n\n\t\t\t\t\t\t_currentNotifications.OnNext(currentNotifications);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\t_report.Exception(\"Updating current notifications failed\", e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_timer.Invalidate();\n\t\t\t\t_timer.Dispose();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_report.Exception(\"MonoMacNotifier.Dispose()\", e);\n\t\t\t}\n\t\t}\n\n\t\tpublic async Task<NotificationFeedback> Show(Notification notification)\n\t\t{\n\t\t\tvar guid = Guid.NewGuid();\n\t\t\tvar not = new NSUserNotification\n\t\t\t{\n\t\t\t\tTitle = notification.Title,\n\t\t\t\tInformativeText = notification.Description,\n\t\t\t\tDeliveryDate = NSDate.Now,\n\t\t\t\tSoundName = NSUserNotification.NSUserNotificationDefaultSoundName,\n\t\t\t\tActionButtonTitle = notification.PrimaryAction.Or(\"\"),\n\t\t\t\tHasActionButton = notification.PrimaryAction.HasValue,\n\t\t\t\tUserInfo = NSDictionary.FromObjectAndKey(new NSString(guid.ToString()), Key),\n\t\t\t};\n\n\t\t\t// Approach described by http://stackoverflow.com/questions/21110714/mac-os-x-nsusernotificationcenter-notification-get-dismiss-event-callback/21365269#21365269\n\t\t\tvar dismissed = _currentNotifications\n\t\t\t\t.SkipWhile(s => !s.Contains(guid))\n\t\t\t\t.SkipWhile(s => s.Contains(guid))\n\t\t\t\t.Take(1);\n\n\t\t\tvar activated = _notificationActivated\n\t\t\t\t.Where(n => n.Equals(guid));\n\n\t\t\tvar status = Observable.Merge(\n\t\t\t\tdismissed.Select(_ => NotificationFeedback.Dismissed),\n\t\t\t\tactivated.Select(_ => NotificationFeedback.PrimaryActionTaken));\n\n\t\t\tvar task = status.FirstAsync().ToTask();\n\n\t\t\tawait MainThread.BeginInvoke(() => _center.DeliverNotification(not));\n\n\t\t\treturn await task;\n\t\t}\n\n\t\tstatic Guid GetId(NSUserNotification notification)\n\t\t{\n\t\t\tvar userInfo = notification.UserInfo;\n\t\t\tif (userInfo == null)\n\t\t\t\treturn Guid.NewGuid();\n\n\t\t\tNSObject value;\n\t\t\tif (!userInfo.TryGetValue(Key, out value))\n\t\t\t\treturn Guid.NewGuid();\n\n\t\t\treturn Guid.Parse((NSString)value);\n\t\t}\n\n\t\tstatic readonly NSString Key = new NSString(\"FuseNotificationId\");\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/MonoMacTrayApplication.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading.Tasks;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic class MonoMacTrayApplication : ITrayApplication\n\t{\n\t\treadonly NSStatusItem _item;\n\t\treadonly MonoMacNotifier _notifier;\n\n\t\tpublic MonoMacTrayApplication(IReport errorHandler, IObservable<Icon> icon, IObservable<string> title, Menu menu)\n\t\t{\n\t\t\t// Display tray icon in upper-right-hand corner of the screen\n\t\t\t_item = NSStatusBar.SystemStatusBar.CreateStatusItem(NSStatusItemLength.Square);\n\t\t\t_item.HighlightMode = true;\n\n\t\t\t// Remove the system tray icon from upper-right hand corner of the screen\n\t\t\t// (works without adjusting the LSUIElement setting in Info.plist)\n\t\t\tNSApplication.SharedApplication.ActivationPolicy = NSApplicationActivationPolicy.Accessory;\n\n\t\t\t_notifier = new MonoMacNotifier(NSUserNotificationCenter.DefaultUserNotificationCenter, errorHandler);\n\n\t\t\tUserClicked = DataBinding.ObservableFromNativeEvent<EventArgs>(_item, \"DoubleClick\").Select(_ => 1);\n\n\t\t\tif (menu != default(Menu))\n\t\t\t\tMenuBuilder.CreateMenu(menu, errorHandler).ToObservable().Subscribe(m =>\n\t\t\t\t\tFusion.Application.MainThread.InvokeAsync(() => _item.Menu = m));\n\n\t\t\tif (icon != null)\n\t\t\t\ticon.Subscribe(i => MainThread.BeginInvoke(() => SetIcon(i)));\n\n\t\t\tif (title != null)\n\t\t\t\ttitle.Subscribe(t => MainThread.BeginInvoke(() => SetTitle(t)));\n\n\t\t\t((AppDelegate)NSApplication.SharedApplication.Delegate).Terminates.Subscribe(_ => Dispose());\n\t\t}\n\n\t\tvoid SetIcon(Icon icon)\n\t\t{\n\t\t\tusing (var stream = icon.GetStream())\n\t\t\t{\n\t\t\t\t// Fun song and dance to avoid using the default 256/256 rep\n\t\t\t\tvar icn = NSImage.FromStream(stream).BestRepresentation(new CGRect(0, 0, 32, 32), null, null);\n\t\t\t\ticn.Size = new CGSize(16, 16);\n\t\t\t\tvar image = new NSImage(icn.Size);\n\t\t\t\timage.AddRepresentation(icn);\n\t\t\t\timage.Template = true;\n\t\t\t\t_item.Image = image;\n\t\t\t}\n\t\t}\n\n\t\tvoid SetTitle(string title)\n\t\t{\n\t\t\t_item.Title = title;\n\t\t}\n\n\t\tpublic IObservable<int> UserClicked { get; private set; }\n\n\t\tpublic Task<NotificationFeedback> Show(Notification notification)\n\t\t{\n\t\t\treturn _notifier.Show(notification);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tMainThread.BeginInvoke(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\t_notifier.Dispose();\n\t\t\t\t\tNSStatusBar.SystemStatusBar.RemoveStatusItem(_item);\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/NSDefaultView.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Subjects;\nusing AppKit;\nusing CoreFoundation;\nusing Foundation;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.Mac\n{\n\tinterface IObservableResponder\n\t{\n\t\tIObservable<object> GotFocus { get; }\n\t\tIObservable<object> LostFocus { get; }\n\n\t\tIObservable<NSEvent> KeyDown { get; }\n\t\tIObservable<NSEvent> KeyUp { get; }\n\n\t\tAction<NSView> ResetCursorRectsHandler { get; set; }\n\t}\n\n\tclass NSFlippedClipView : NSClipView\n\t{\n\t\tpublic override bool IsFlipped\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\t\tpublic override bool IsOpaque\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic NSFlippedClipView()\n\t\t{\n\t\t\tbase.AutoresizesSubviews = false;\n\t\t}\n\n\t\tpublic NSFlippedClipView(IntPtr handle) : base(handle)\n\t\t{\n\t\t\tbase.AutoresizesSubviews = false;\n\t\t}\n\t}\n\n\n\tclass NSDefaultView : NSView, IObservableResponder\n\t{\n\t\tpublic override bool AcceptsFirstResponder()\n\t\t{\n\t\t\treturn _keyDown.HasObservers || _keyUp.HasObservers;\n\t\t}\n\n\t\tpublic override bool IsOpaque\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override bool MouseDownCanMoveWindow\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic NSDefaultView()\n\t\t{\n\t\t\tbase.AutoresizesSubviews = false;\n\t\t}\n\n\t\tpublic NSDefaultView(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic Action<NSView> ResetCursorRectsHandler { get; set; }\n\n\t\tpublic override void ResetCursorRects()\n\t\t{\n\t\t\tif (ResetCursorRectsHandler != null)\n\t\t\t\tResetCursorRectsHandler(this);\n\t\t}\n\n\n\t\treadonly Subject<object> _gotFocus = new Subject<object>();\n\t\treadonly Subject<object> _lostFocus = new Subject<object>();\n\n\t\tIObservable<object> IObservableResponder.GotFocus { get { return _gotFocus; } }\n\t\tIObservable<object> IObservableResponder.LostFocus { get { return _lostFocus; } }\n\n\t\tpublic override bool BecomeFirstResponder()\n\t\t{\n\t\t\t_gotFocus.OnNext(new object());\n\t\t\treturn base.BecomeFirstResponder();\n\t\t}\n\n\t\tpublic override bool ResignFirstResponder()\n\t\t{\n\t\t\t_lostFocus.OnNext(new object());\n\t\t\treturn base.ResignFirstResponder();\n\t\t}\n\n\n\t\treadonly Subject<NSEvent> _keyDown = new Subject<NSEvent>();\n\t\treadonly Subject<NSEvent> _keyUp = new Subject<NSEvent>();\n\n\t\tIObservable<NSEvent> IObservableResponder.KeyDown { get { return _keyDown; } }\n\t\tIObservable<NSEvent> IObservableResponder.KeyUp { get { return _keyUp; } }\n\n\t\tpublic override void KeyDown(NSEvent theEvent)\n\t\t{\n\t\t\t_keyDown.OnNext(theEvent);\n\t\t\tbase.KeyDown(theEvent);\n\t\t}\n\n\t\tpublic override void KeyUp(NSEvent theEvent)\n\t\t{\n\t\t\t_keyUp.OnNext(theEvent);\n\t\t\tbase.KeyUp(theEvent);\n\t\t}\n\n\t\tpublic override NSDragOperation DraggingEntered(NSDraggingInfo sender)\n\t\t{\n\t\t\tif (AcceptDragSource(sender))\n\t\t\t\treturn NSDragOperation.Generic;\n\n\t\t\treturn NSDragOperation.None;\n\t\t}\n\n\n\t\tDropOperation _dropOperation = null;\n\t\tAbsoluteFilePath _droppedFile;\n\n\t\tpublic void AddDropOperation(DropOperation op)\n\t\t{\n\t\t\t_dropOperation = op;\n\t\t}\n\n\t\tbool AcceptDragSource(NSDraggingInfo sender)\n\t\t{\n\t\t\tif (_dropOperation == null) return false;\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check correct file type\n\t\t\t\tvar pasteboard = sender.DraggingPasteboard;\n\n\t\t\t\tif (!pasteboard.Types.Contains(NSPasteboard.NSFilenamesType))\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar data = pasteboard.GetPropertyListForType(NSPasteboard.NSFilenamesType) as NSArray;\n\t\t\t\tif (data == null || data.Count < 1)\n\t\t\t\t\treturn false;\n\n\t\t\t\tvar pathString = CFString.FromHandle(data.ValueAt(0));\n\n\t\t\t\t_droppedFile = AbsoluteFilePath.Parse(pathString);\n\t\t\t\tif (!File.Exists(_droppedFile.NativePath))\n\t\t\t\t{\n\t\t\t\t\t_dropOperation.OnError.OnNext(\"Dragged file not found: \" + _droppedFile.NativePath);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn _dropOperation.CanDrop(_droppedFile);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_dropOperation.OnError.OnNext(e.Message);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\n\t\tpublic override bool PerformDragOperation(NSDraggingInfo sender)\n\t\t{\n\t\t\tif (_dropOperation == null) return false;\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_dropOperation.Drop(_droppedFile);\n\t\t\t\treturn base.PerformDragOperation(sender);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_dropOperation.OnError.OnNext(\"Drop operation failed: \" + e.Message);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\n\t\tpublic override void ConcludeDragOperation(NSDraggingInfo sender)\n\t\t{\n\t\t\t_droppedFile = null;\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/ObjCRuntime/Messaging.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\nusing AppKit;\nusing AudioToolbox;\nusing AudioUnit;\nusing AVFoundation;\nusing CoreAnimation;\nusing CoreGraphics;\nusing CoreLocation;\nusing CoreMedia;\nusing CoreVideo;\nusing Foundation;\nusing GameplayKit;\nusing MapKit;\nusing Metal;\nusing ModelIO;\nusing OpenTK;\nusing QTKit;\nusing SceneKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic static class Messaging\n\t{\n\t\tinternal const string LIBOBJC_DYLIB = \"/usr/lib/libobjc.dylib\";\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSend_stret(out CMTime retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSendSuper_stret(out CMTime retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGAffineTransform CGAffineTransform_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGAffineTransform CGAffineTransform_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGAffineTransform_objc_msgSend_stret(out CGAffineTransform retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGAffineTransform_objc_msgSendSuper_stret(out CGAffineTransform retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CMTimeRange CMTimeRange_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CMTimeRange CMTimeRange_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CMTimeRange_objc_msgSend_stret(out CMTimeRange retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CMTimeRange_objc_msgSendSuper_stret(out CMTimeRange retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CMTimeRange(IntPtr receiver, IntPtr selector, CMTimeRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CMTimeRange(IntPtr receiver, IntPtr selector, CMTimeRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CMTime_out_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, out CMTime arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CMTime_out_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, out CMTime arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSend_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSendSuper_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSend_stret_CMTime(out CMTime retval, IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSendSuper_stret_CMTime(out CMTime retval, IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CMTimeMapping CMTimeMapping_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CMTimeMapping CMTimeMapping_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CMTimeMapping_objc_msgSend_stret(out CMTimeMapping retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CMTimeMapping_objc_msgSendSuper_stret(out CMTimeMapping retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGAffineTransform(IntPtr receiver, IntPtr selector, CGAffineTransform arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGAffineTransform(IntPtr receiver, IntPtr selector, CGAffineTransform arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float(IntPtr receiver, IntPtr selector, float arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float(IntPtr receiver, IntPtr selector, float arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CMTime(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CMTime(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Vector3 Vector3_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Vector3 Vector3_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void Vector3_objc_msgSend_stret(out Vector3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void Vector3_objc_msgSendSuper_stret(out Vector3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AudioStreamPacketDescription AudioStreamPacketDescription_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AudioStreamPacketDescription AudioStreamPacketDescription_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AudioStreamPacketDescription_objc_msgSend_stret(out AudioStreamPacketDescription retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AudioStreamPacketDescription_objc_msgSendSuper_stret(out AudioStreamPacketDescription retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVAudioConverterPrimeInfo AVAudioConverterPrimeInfo_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVAudioConverterPrimeInfo AVAudioConverterPrimeInfo_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_AVAudioConverterPrimeInfo(IntPtr receiver, IntPtr selector, AVAudioConverterPrimeInfo arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_AVAudioConverterPrimeInfo(IntPtr receiver, IntPtr selector, AVAudioConverterPrimeInfo arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, nuint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, nuint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVAudio3DVectorOrientation AVAudio3DVectorOrientation_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVAudio3DVectorOrientation AVAudio3DVectorOrientation_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_AVAudio3DVectorOrientation(IntPtr receiver, IntPtr selector, AVAudio3DVectorOrientation arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_AVAudio3DVectorOrientation(IntPtr receiver, IntPtr selector, AVAudio3DVectorOrientation arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVAudio3DAngularOrientation AVAudio3DAngularOrientation_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVAudio3DAngularOrientation AVAudio3DAngularOrientation_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AVAudio3DAngularOrientation_objc_msgSend_stret(out AVAudio3DAngularOrientation retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AVAudio3DAngularOrientation_objc_msgSendSuper_stret(out AVAudio3DAngularOrientation retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_AVAudio3DAngularOrientation(IntPtr receiver, IntPtr selector, AVAudio3DAngularOrientation arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_AVAudio3DAngularOrientation(IntPtr receiver, IntPtr selector, AVAudio3DAngularOrientation arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AudioStreamBasicDescription AudioStreamBasicDescription_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AudioStreamBasicDescription AudioStreamBasicDescription_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AudioStreamBasicDescription_objc_msgSend_stret(out AudioStreamBasicDescription retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AudioStreamBasicDescription_objc_msgSendSuper_stret(out AudioStreamBasicDescription retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_ref_AudioStreamBasicDescription(IntPtr receiver, IntPtr selector, ref AudioStreamBasicDescription arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_ref_AudioStreamBasicDescription(IntPtr receiver, IntPtr selector, ref AudioStreamBasicDescription arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_ref_AudioStreamBasicDescription_IntPtr(IntPtr receiver, IntPtr selector, ref AudioStreamBasicDescription arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_ref_AudioStreamBasicDescription_IntPtr(IntPtr receiver, IntPtr selector, ref AudioStreamBasicDescription arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_UInt32(IntPtr receiver, IntPtr selector, double arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_UInt32(IntPtr receiver, IntPtr selector, double arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_IntPtr(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_IntPtr(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_Double_UInt32_bool(IntPtr receiver, IntPtr selector, uint arg1, double arg2, uint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_Double_UInt32_bool(IntPtr receiver, IntPtr selector, uint arg1, double arg2, uint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_Double_UInt32_bool(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, uint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_Double_UInt32_bool(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, uint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, double arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, double arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CMTime_ref_Single_ref_Single_ref_CMTimeRange(IntPtr receiver, IntPtr selector, CMTime arg1, ref float arg2, ref float arg3, ref CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CMTime_ref_Single_ref_Single_ref_CMTimeRange(IntPtr receiver, IntPtr selector, CMTime arg1, ref float arg2, ref float arg3, ref CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_Double(IntPtr receiver, IntPtr selector, float arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_Double(IntPtr receiver, IntPtr selector, float arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Int64_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, uint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Int64_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, uint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_nint_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_nint_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_ref_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_ref_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_Double_ref_IntPtr(IntPtr receiver, IntPtr selector, double arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_Double_ref_IntPtr(IntPtr receiver, IntPtr selector, double arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AudioTimeStamp AudioTimeStamp_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AudioTimeStamp AudioTimeStamp_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AudioTimeStamp_objc_msgSend_stret(out AudioTimeStamp retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AudioTimeStamp_objc_msgSendSuper_stret(out AudioTimeStamp retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_ref_AudioTimeStamp_Double(IntPtr receiver, IntPtr selector, ref AudioTimeStamp arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_ref_AudioTimeStamp_Double(IntPtr receiver, IntPtr selector, ref AudioTimeStamp arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_Double(IntPtr receiver, IntPtr selector, long arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_Double(IntPtr receiver, IntPtr selector, long arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_Int64_Double(IntPtr receiver, IntPtr selector, ulong arg1, long arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_Int64_Double(IntPtr receiver, IntPtr selector, ulong arg1, long arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AudioComponentDescription AudioComponentDescription_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AudioComponentDescription AudioComponentDescription_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AudioComponentDescription_objc_msgSend_stret(out AudioComponentDescription retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AudioComponentDescription_objc_msgSendSuper_stret(out AudioComponentDescription retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_AudioComponentDescription_UInt32_IntPtr(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_AudioComponentDescription_UInt32_IntPtr(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_AudioComponentDescription(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_AudioComponentDescription(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_byte_byte_byte(IntPtr receiver, IntPtr selector, byte arg1, byte arg2, byte arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_byte_byte_byte(IntPtr receiver, IntPtr selector, byte arg1, byte arg2, byte arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_byte_byte(IntPtr receiver, IntPtr selector, byte arg1, byte arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_byte_byte(IntPtr receiver, IntPtr selector, byte arg1, byte arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt16_byte(IntPtr receiver, IntPtr selector, ushort arg1, byte arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt16_byte(IntPtr receiver, IntPtr selector, ushort arg1, byte arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_byte_byte_byte_byte(IntPtr receiver, IntPtr selector, byte arg1, byte arg2, byte arg3, byte arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_byte_byte_byte_byte(IntPtr receiver, IntPtr selector, byte arg1, byte arg2, byte arg3, byte arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_byte_byte_byte_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, byte arg2, byte arg3, byte arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_byte_byte_byte_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, byte arg2, byte arg3, byte arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_float(IntPtr receiver, IntPtr selector, int arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_float(IntPtr receiver, IntPtr selector, int arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_float(IntPtr receiver, IntPtr selector, long arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_float(IntPtr receiver, IntPtr selector, long arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret(out CGRect retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret(out CGRect retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_CMTimeRange_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, CMTimeRange arg3, CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_CMTimeRange_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, CMTimeRange arg3, CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CMTimeRange(IntPtr receiver, IntPtr selector, CMTimeRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CMTimeRange(IntPtr receiver, IntPtr selector, CMTimeRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVBeatRange AVBeatRange_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVBeatRange AVBeatRange_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AVBeatRange_objc_msgSend_stret(out AVBeatRange retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AVBeatRange_objc_msgSendSuper_stret(out AVBeatRange retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_AVBeatRange(IntPtr receiver, IntPtr selector, AVBeatRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_AVBeatRange(IntPtr receiver, IntPtr selector, AVBeatRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_float_CMTimeRange(IntPtr receiver, IntPtr selector, float arg1, float arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_float_CMTimeRange(IntPtr receiver, IntPtr selector, float arg1, float arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_CMTime(IntPtr receiver, IntPtr selector, float arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_CMTime(IntPtr receiver, IntPtr selector, float arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CMTimeRange_IntPtr_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, CMTimeRange arg1, IntPtr arg2, CMTime arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CMTimeRange_IntPtr_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, CMTimeRange arg1, IntPtr arg2, CMTime arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CMTimeRange_CMTime(IntPtr receiver, IntPtr selector, CMTimeRange arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CMTimeRange_CMTime(IntPtr receiver, IntPtr selector, CMTimeRange arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CMTime arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CMTime arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_out_CMTime_out_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, out CMTime arg2, out CMTime arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_out_CMTime_out_CMTime_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, out CMTime arg2, out CMTime arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CMTimeRange_CMTimeRange(IntPtr receiver, IntPtr selector, CMTimeRange arg1, CMTimeRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CMTimeRange_CMTimeRange(IntPtr receiver, IntPtr selector, CMTimeRange arg1, CMTimeRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CMTimeRange_IntPtr_CMTime_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, CMTimeRange arg1, IntPtr arg2, CMTime arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CMTimeRange_IntPtr_CMTime_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, CMTimeRange arg1, IntPtr arg2, CMTime arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGAffineTransform_CGAffineTransform_CMTimeRange(IntPtr receiver, IntPtr selector, CGAffineTransform arg1, CGAffineTransform arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGAffineTransform_CGAffineTransform_CMTimeRange(IntPtr receiver, IntPtr selector, CGAffineTransform arg1, CGAffineTransform arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGAffineTransform_CMTime(IntPtr receiver, IntPtr selector, CGAffineTransform arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGAffineTransform_CMTime(IntPtr receiver, IntPtr selector, CGAffineTransform arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGRect_CMTimeRange(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGRect_CMTimeRange(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CMTime(IntPtr receiver, IntPtr selector, CGRect arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CMTime(IntPtr receiver, IntPtr selector, CGRect arg1, CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CMTime_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CMTime_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CMTime_CMTime_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1, CMTime arg2, CMTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CMTime_CMTime_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1, CMTime arg2, CMTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CMTime_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CMTime_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CMTime_CMTime_CMTime_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, CMTime arg2, CMTime arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CMTime_CMTime_CMTime_IntPtr(IntPtr receiver, IntPtr selector, CMTime arg1, CMTime arg2, CMTime arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_CMTime_CMTime(IntPtr receiver, IntPtr selector, float arg1, CMTime arg2, CMTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_CMTime_CMTime(IntPtr receiver, IntPtr selector, float arg1, CMTime arg2, CMTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_CMTime(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CMTime arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_CMTime(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CMTime arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSend_stret_Double(out CMTime retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSendSuper_stret_Double(out CMTime retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSend_stret_Int64(out CMTime retval, IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSendSuper_stret_Int64(out CMTime retval, IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CMTime_ref_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1, ref CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CMTime_ref_CMTime(IntPtr receiver, IntPtr selector, CMTime arg1, ref CMTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CMTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVSampleCursorSyncInfo AVSampleCursorSyncInfo_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVSampleCursorSyncInfo AVSampleCursorSyncInfo_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AVSampleCursorSyncInfo_objc_msgSend_stret(out AVSampleCursorSyncInfo retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AVSampleCursorSyncInfo_objc_msgSendSuper_stret(out AVSampleCursorSyncInfo retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVSampleCursorStorageRange AVSampleCursorStorageRange_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVSampleCursorStorageRange AVSampleCursorStorageRange_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AVSampleCursorStorageRange_objc_msgSend_stret(out AVSampleCursorStorageRange retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AVSampleCursorStorageRange_objc_msgSendSuper_stret(out AVSampleCursorStorageRange retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVSampleCursorChunkInfo AVSampleCursorChunkInfo_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVSampleCursorChunkInfo AVSampleCursorChunkInfo_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AVSampleCursorChunkInfo_objc_msgSend_stret(out AVSampleCursorChunkInfo retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AVSampleCursorChunkInfo_objc_msgSendSuper_stret(out AVSampleCursorChunkInfo retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSend_CMTime_out_Boolean(IntPtr receiver, IntPtr selector, CMTime arg1, out bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CMTime CMTime_objc_msgSendSuper_CMTime_out_Boolean(IntPtr receiver, IntPtr selector, CMTime arg1, out bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSend_stret_CMTime_out_Boolean(out CMTime retval, IntPtr receiver, IntPtr selector, CMTime arg1, out bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CMTime_objc_msgSendSuper_stret_CMTime_out_Boolean(out CMTime retval, IntPtr receiver, IntPtr selector, CMTime arg1, out bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTimeRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTimeRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CMTimeRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTimeRange arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CMTimeRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTimeRange arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CMTime_ref_CGAffineTransform_ref_CGAffineTransform_ref_CMTimeRange(IntPtr receiver, IntPtr selector, CMTime arg1, ref CGAffineTransform arg2, ref CGAffineTransform arg3, ref CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CMTime_ref_CGAffineTransform_ref_CGAffineTransform_ref_CMTimeRange(IntPtr receiver, IntPtr selector, CMTime arg1, ref CGAffineTransform arg2, ref CGAffineTransform arg3, ref CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CMTime_ref_CGRect_ref_CGRect_ref_CMTimeRange(IntPtr receiver, IntPtr selector, CMTime arg1, ref CGRect arg2, ref CGRect arg3, ref CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CMTime_ref_CGRect_ref_CGRect_ref_CMTimeRange(IntPtr receiver, IntPtr selector, CMTime arg1, ref CGRect arg2, ref CGRect arg3, ref CMTimeRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVPixelAspectRatio AVPixelAspectRatio_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVPixelAspectRatio AVPixelAspectRatio_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern AVEdgeWidths AVEdgeWidths_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern AVEdgeWidths AVEdgeWidths_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void AVEdgeWidths_objc_msgSend_stret(out AVEdgeWidths retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void AVEdgeWidths_objc_msgSendSuper_stret(out AVEdgeWidths retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTimeRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CMTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CMTimeRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGPoint_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGPoint arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGPoint_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGPoint arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_UInt64(IntPtr receiver, IntPtr selector, double arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_UInt64(IntPtr receiver, IntPtr selector, double arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_UInt32_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_UInt32_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_UInt64_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_UInt64_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGSize_UInt32_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGSize_UInt32_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGSize_UInt32_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGSize_UInt32_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGSize_UInt64_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGSize_UInt64_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGSize_UInt64_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGSize_UInt64_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_nfloat_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_nfloat_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_out_nint_out_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, out nint arg2, out nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_out_nint_out_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, out nint arg2, out nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nint_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nint_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_nfloat_nfloat_nfloat_bool(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, nfloat arg3, nfloat arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_nfloat_nfloat_nfloat_bool(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, nfloat arg3, nfloat arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGPoint_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGPoint_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_nfloat_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_nfloat_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_nint_nint_nint_bool_bool_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5, bool arg6, bool arg7, IntPtr arg8, nint arg9, nint arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_nint_bool_bool_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5, bool arg6, bool arg7, IntPtr arg8, nint arg9, nint arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_nint_nint_nint_bool_bool_IntPtr_UInt32_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5, bool arg6, bool arg7, IntPtr arg8, uint arg9, nint arg10, nint arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_nint_bool_bool_IntPtr_UInt32_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5, bool arg6, bool arg7, IntPtr arg8, uint arg9, nint arg10, nint arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_nint_nint_nint_bool_bool_IntPtr_UInt64_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5, bool arg6, bool arg7, IntPtr arg8, ulong arg9, nint arg10, nint arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_nint_bool_bool_IntPtr_UInt64_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5, bool arg6, bool arg7, IntPtr arg8, ulong arg9, nint arg10, nint arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_NSTiffCompression_out_Single(IntPtr receiver, IntPtr selector, out NSTiffCompression arg1, out float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_NSTiffCompression_out_Single(IntPtr receiver, IntPtr selector, out NSTiffCompression arg1, out float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_float(IntPtr receiver, IntPtr selector, uint arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_float(IntPtr receiver, IntPtr selector, uint arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_float(IntPtr receiver, IntPtr selector, ulong arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_float(IntPtr receiver, IntPtr selector, ulong arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_float(IntPtr receiver, IntPtr selector, uint arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_float(IntPtr receiver, IntPtr selector, uint arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_float(IntPtr receiver, IntPtr selector, ulong arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_float(IntPtr receiver, IntPtr selector, ulong arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_float(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_float(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_float(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_float(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_nint(out CGRect retval, IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_nint(out CGRect retval, IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_CGRect(IntPtr receiver, IntPtr selector, nint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_CGRect(IntPtr receiver, IntPtr selector, nint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_nint_nint(out CGRect retval, IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_nint_nint(out CGRect retval, IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_out_nint_out_nint_CGPoint(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2, CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_out_nint_out_nint_CGPoint(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2, CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_nint(IntPtr receiver, IntPtr selector, nfloat arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_nint(IntPtr receiver, IntPtr selector, nfloat arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_bool(IntPtr receiver, IntPtr selector, uint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_bool(IntPtr receiver, IntPtr selector, uint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_bool(IntPtr receiver, IntPtr selector, ulong arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_bool(IntPtr receiver, IntPtr selector, ulong arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_nint_bool_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, bool arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_nint_bool_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, bool arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_IntPtr_ref_nint_ref_nint_ref_NSBrowserDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref nint arg4, ref NSBrowserDropOperation arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_IntPtr_ref_nint_ref_nint_ref_NSBrowserDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref nint arg4, ref NSBrowserDropOperation arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_IntPtr_ref_nint_ref_nint_ref_NSBrowserDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref nint arg4, ref NSBrowserDropOperation arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_IntPtr_ref_nint_ref_nint_ref_NSBrowserDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref nint arg4, ref NSBrowserDropOperation arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_nint_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_nint_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_ref_Single_ref_Single(IntPtr receiver, IntPtr selector, ref float arg1, ref float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_ref_Single_ref_Single(IntPtr receiver, IntPtr selector, ref float arg1, ref float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_Single_out_Single(IntPtr receiver, IntPtr selector, out float arg1, out float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_Single_out_Single(IntPtr receiver, IntPtr selector, out float arg1, out float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_CGRect_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_CGRect_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_int_bool_bool(IntPtr receiver, IntPtr selector, CGSize arg1, int arg2, bool arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_int_bool_bool(IntPtr receiver, IntPtr selector, CGSize arg1, int arg2, bool arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nint(IntPtr receiver, IntPtr selector, uint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nint(IntPtr receiver, IntPtr selector, uint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nint(IntPtr receiver, IntPtr selector, ulong arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nint(IntPtr receiver, IntPtr selector, ulong arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_CGRect_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_CGRect_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGPoint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGPoint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGPoint_IntPtr_bool(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGPoint_IntPtr_bool(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGRect_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGRect_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSEdgeInsets NSEdgeInsets_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSEdgeInsets NSEdgeInsets_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void NSEdgeInsets_objc_msgSend_stret(out NSEdgeInsets retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void NSEdgeInsets_objc_msgSendSuper_stret(out NSEdgeInsets retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSEdgeInsets(IntPtr receiver, IntPtr selector, NSEdgeInsets arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSEdgeInsets(IntPtr receiver, IntPtr selector, NSEdgeInsets arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_ref_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_ref_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGPoint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGPoint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGPoint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGPoint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGPoint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGPoint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_IntPtr_ref_nint_ref_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_IntPtr_ref_nint_ref_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_IntPtr_ref_nint_ref_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_IntPtr_ref_nint_ref_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref nint arg3, ref NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_ref_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_ref_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_IntPtr_ref_IntPtr_out_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, out NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_IntPtr_ref_IntPtr_out_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, out NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_IntPtr_ref_IntPtr_out_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, out NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_IntPtr_ref_IntPtr_out_NSCollectionViewDropOperation(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, out NSCollectionViewDropOperation arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_CGPoint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_CGPoint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_CGPoint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_CGPoint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSEdgeInsets NSEdgeInsets_objc_msgSend_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSEdgeInsets NSEdgeInsets_objc_msgSendSuper_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void NSEdgeInsets_objc_msgSend_stret_IntPtr_IntPtr_nint(out NSEdgeInsets retval, IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void NSEdgeInsets_objc_msgSendSuper_stret_IntPtr_IntPtr_nint(out NSEdgeInsets retval, IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern nfloat xamarin_nfloat_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern nfloat xamarin_nfloat_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4, nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4, nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_nfloat_out_nfloat_out_nfloat_out_nfloat(IntPtr receiver, IntPtr selector, out nfloat arg1, out nfloat arg2, out nfloat arg3, out nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_nfloat_out_nfloat_out_nfloat_out_nfloat(IntPtr receiver, IntPtr selector, out nfloat arg1, out nfloat arg2, out nfloat arg3, out nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_nfloat_out_nfloat(IntPtr receiver, IntPtr selector, out nfloat arg1, out nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_nfloat_out_nfloat(IntPtr receiver, IntPtr selector, out nfloat arg1, out nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_nfloat_out_nfloat_out_nfloat_out_nfloat_out_nfloat(IntPtr receiver, IntPtr selector, out nfloat arg1, out nfloat arg2, out nfloat arg3, out nfloat arg4, out nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_nfloat_out_nfloat_out_nfloat_out_nfloat_out_nfloat(IntPtr receiver, IntPtr selector, out nfloat arg1, out nfloat arg2, out nfloat arg3, out nfloat arg4, out nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nfloat arg3, nfloat arg4, nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nfloat arg3, nfloat arg4, nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_NSRange_ref_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, NSRange arg4, ref nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_NSRange_ref_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, NSRange arg4, ref nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_bool_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_bool_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_ref_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_ref_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt32_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt32_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt64_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt64_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_UInt32(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_UInt32(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_UInt64(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_UInt64(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ushort UInt16_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ushort UInt16_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern short short_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern short short_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Double_Double(IntPtr receiver, IntPtr selector, double arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Double_Double(IntPtr receiver, IntPtr selector, double arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_CGPoint_UInt32_Double_nint_IntPtr_nint_nint_float(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, float arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_CGPoint_UInt32_Double_nint_IntPtr_nint_nint_float(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, float arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_CGPoint_UInt64_Double_nint_IntPtr_nint_nint_float(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, float arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_CGPoint_UInt64_Double_nint_IntPtr_nint_nint_float(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, float arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_CGPoint_UInt32_Double_nint_IntPtr_IntPtr_IntPtr_bool_UInt16(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, bool arg9, ushort arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_CGPoint_UInt32_Double_nint_IntPtr_IntPtr_IntPtr_bool_UInt16(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, bool arg9, ushort arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_CGPoint_UInt64_Double_nint_IntPtr_IntPtr_IntPtr_bool_UInt16(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, bool arg9, ushort arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_CGPoint_UInt64_Double_nint_IntPtr_IntPtr_IntPtr_bool_UInt16(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, bool arg9, ushort arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_CGPoint_UInt32_Double_nint_IntPtr_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_CGPoint_UInt32_Double_nint_IntPtr_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_CGPoint_UInt64_Double_nint_IntPtr_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_CGPoint_UInt64_Double_nint_IntPtr_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, nint arg7, nint arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_CGPoint_UInt32_Double_nint_IntPtr_short_nint_nint(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, short arg7, nint arg8, nint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_CGPoint_UInt32_Double_nint_IntPtr_short_nint_nint(IntPtr receiver, IntPtr selector, uint arg1, CGPoint arg2, uint arg3, double arg4, nint arg5, IntPtr arg6, short arg7, nint arg8, nint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_CGPoint_UInt64_Double_nint_IntPtr_short_nint_nint(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, short arg7, nint arg8, nint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_CGPoint_UInt64_Double_nint_IntPtr_short_nint_nint(IntPtr receiver, IntPtr selector, ulong arg1, CGPoint arg2, ulong arg3, double arg4, nint arg5, IntPtr arg6, short arg7, nint arg8, nint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, nfloat arg2, nfloat arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, nfloat arg2, nfloat arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, nfloat arg2, nfloat arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, nfloat arg2, nfloat arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGSize_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGSize_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGSize_UInt32_IntPtr_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGSize_UInt32_IntPtr_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGSize_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGSize_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGSize_UInt64_IntPtr_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGSize_UInt64_IntPtr_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_UInt32(out CGRect retval, IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_UInt32(out CGRect retval, IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_nint_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_nint_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_nint_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_nint_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_bool_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_bool_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt32_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt32_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt64_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt64_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_ref_nuint_ref_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ref nuint arg3, ref nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_ref_nuint_ref_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ref nuint arg3, ref nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_UInt32_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_UInt32_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_UInt64_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_UInt64_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGPoint_UInt32(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGPoint_UInt32(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGPoint_UInt64(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGPoint_UInt64(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_nfloat_CGPoint_nfloat_UInt32(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, CGPoint arg3, nfloat arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_nfloat_CGPoint_nfloat_UInt32(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, CGPoint arg3, nfloat arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_nfloat_CGPoint_nfloat_UInt64(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, CGPoint arg3, nfloat arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_nfloat_CGPoint_nfloat_UInt64(IntPtr receiver, IntPtr selector, CGPoint arg1, nfloat arg2, CGPoint arg3, nfloat arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGPoint(IntPtr receiver, IntPtr selector, CGRect arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGPoint(IntPtr receiver, IntPtr selector, CGRect arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_ref_IntPtr_out_nfloat_nint(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out nfloat arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_ref_IntPtr_out_nfloat_nint(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out nfloat arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_UInt32(IntPtr receiver, IntPtr selector, int arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_UInt32(IntPtr receiver, IntPtr selector, int arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_UInt64(IntPtr receiver, IntPtr selector, long arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_UInt64(IntPtr receiver, IntPtr selector, long arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize(IntPtr receiver, IntPtr selector, CGSize arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGRect_UInt32_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, uint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGRect_UInt32_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, uint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGRect_UInt64_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, ulong arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGRect_UInt64_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, ulong arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGRect_UInt32_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, uint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGRect_UInt32_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, uint arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGRect_UInt64_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, ulong arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGRect_UInt64_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, ulong arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGRect_UInt32_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, uint arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGRect_UInt32_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, uint arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGRect_UInt64_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, ulong arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGRect_UInt64_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, ulong arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_ref_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ref CGRect arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_ref_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ref CGRect arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGRect_CGRect_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3, IntPtr arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGRect_CGRect_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3, IntPtr arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGRect_CGRect_UInt32_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, uint arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGRect_CGRect_UInt32_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, uint arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGRect_CGRect_UInt64_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, ulong arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGRect_CGRect_UInt64_nfloat_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, ulong arg3, nfloat arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_nfloat_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_nfloat_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_int_IntPtr_int_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, IntPtr arg4, int arg5, nfloat arg6, nfloat arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_int_IntPtr_int_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, IntPtr arg4, int arg5, nfloat arg6, nfloat arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Int64_Int64_IntPtr_Int64_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, long arg3, IntPtr arg4, long arg5, nfloat arg6, nfloat arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Int64_Int64_IntPtr_Int64_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, long arg3, IntPtr arg4, long arg5, nfloat arg6, nfloat arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nfloat_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_NSRange_nint_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, nint arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_NSRange_nint_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, nint arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_NSRange_nint_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, nint arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_NSRange_nint_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, nint arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nint_nint(IntPtr receiver, IntPtr selector, uint arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nint_nint(IntPtr receiver, IntPtr selector, uint arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_UInt32(IntPtr receiver, IntPtr selector, nint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_UInt32(IntPtr receiver, IntPtr selector, nint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_nint_ref_Boolean(IntPtr receiver, IntPtr selector, nint arg1, ref bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_nint_ref_Boolean(IntPtr receiver, IntPtr selector, nint arg1, ref bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_NSRange_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_NSRange_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_NSRange_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_NSRange_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_NSRange_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, NSRange arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_NSRange_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, NSRange arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_NSRange(IntPtr receiver, IntPtr selector, CGPoint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_NSRange(IntPtr receiver, IntPtr selector, CGPoint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_nint(IntPtr receiver, IntPtr selector, bool arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_nint(IntPtr receiver, IntPtr selector, bool arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGSize_NSRange(IntPtr receiver, IntPtr selector, CGSize arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGSize_NSRange(IntPtr receiver, IntPtr selector, CGSize arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_ref_nuint_ref_nuint(IntPtr receiver, IntPtr selector, ref nuint arg1, ref nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_ref_nuint_ref_nuint(IntPtr receiver, IntPtr selector, ref nuint arg1, ref nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_NSRange_IntPtr_out_nuint(IntPtr receiver, IntPtr selector, NSRange arg1, NSRange arg2, IntPtr arg3, out nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_NSRange_IntPtr_out_nuint(IntPtr receiver, IntPtr selector, NSRange arg1, NSRange arg2, IntPtr arg3, out nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_NSRange_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_NSRange_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_CGPoint_IntPtr_ref_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, ref nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_CGPoint_IntPtr_ref_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, ref nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_nuint_bool_bool_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_nuint_bool_bool_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_CGPoint(IntPtr receiver, IntPtr selector, NSRange arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_CGPoint(IntPtr receiver, IntPtr selector, NSRange arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_NSRange_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_NSRange_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ushort UInt16_objc_msgSend_nuint_out_Boolean(IntPtr receiver, IntPtr selector, nuint arg1, out bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ushort UInt16_objc_msgSendSuper_nuint_out_Boolean(IntPtr receiver, IntPtr selector, nuint arg1, out bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ushort UInt16_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ushort UInt16_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_NSRange_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, NSRange arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_NSRange_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, NSRange arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_bool_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3, nint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_bool_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3, nint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, NSRange arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, NSRange arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_nuint_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_nuint_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_int_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_int_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_Int64_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_Int64_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_nuint_IntPtr_CGRect_CGPoint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, CGRect arg4, CGPoint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_nuint_IntPtr_CGRect_CGPoint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, CGRect arg4, CGPoint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_nuint_IntPtr_CGRect_CGPoint_nuint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, CGRect arg4, CGPoint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_nuint_IntPtr_CGRect_CGPoint_nuint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, CGRect arg4, CGPoint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_nint_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_nint_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_nint_out_nint(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_nint_out_nint(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_out_nint_out_nint_IntPtr(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_out_nint_out_nint_IntPtr(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_nint_nint(IntPtr receiver, IntPtr selector, bool arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_nint_nint(IntPtr receiver, IntPtr selector, bool arg1, nint arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_UInt32_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, uint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_UInt32_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, uint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_UInt64_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, ulong arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_UInt64_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, ulong arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_NSRange(IntPtr receiver, IntPtr selector, uint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_NSRange(IntPtr receiver, IntPtr selector, uint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_NSRange(IntPtr receiver, IntPtr selector, ulong arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_NSRange(IntPtr receiver, IntPtr selector, ulong arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_NSRange(IntPtr receiver, IntPtr selector, int arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_NSRange(IntPtr receiver, IntPtr selector, int arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_NSRange(IntPtr receiver, IntPtr selector, long arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_NSRange(IntPtr receiver, IntPtr selector, long arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_int_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_int_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_IntPtr_int(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_IntPtr_int(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_int_int(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, int arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_int_int(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, int arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_Double_ref_CVTimeStamp(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, ref CVTimeStamp arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_Double_ref_CVTimeStamp(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, ref CVTimeStamp arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_Double_ref_CVTimeStamp(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, ref CVTimeStamp arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_Double_ref_CVTimeStamp(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, ref CVTimeStamp arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_UInt32_int_int_int(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, int arg3, int arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_UInt32_int_int_int(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, int arg3, int arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_ref_Int32_UInt32_int(IntPtr receiver, IntPtr selector, ref int arg1, uint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_ref_Int32_UInt32_int(IntPtr receiver, IntPtr selector, ref int arg1, uint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_ref_CGRect_IntPtr_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref CGRect arg3, IntPtr arg4, IntPtr arg5, CGPoint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_ref_CGRect_IntPtr_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref CGRect arg3, IntPtr arg4, IntPtr arg5, CGPoint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_bool(IntPtr receiver, IntPtr selector, CGRect arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_bool(IntPtr receiver, IntPtr selector, CGRect arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_UInt32(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_UInt32(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_UInt64(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_UInt64(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_UInt32_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_UInt32_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_UInt64_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_UInt64_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_UInt32_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, uint arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_UInt32_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, uint arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_UInt64_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, ulong arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_UInt64_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, ulong arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nfloat_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nfloat_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nfloat_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nfloat arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nfloat_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nfloat arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect_Int64(IntPtr receiver, IntPtr selector, CGRect arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect_Int64(IntPtr receiver, IntPtr selector, CGRect arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect_Int64(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect_Int64(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_CGSize_bool_bool_UInt32(IntPtr receiver, IntPtr selector, CGSize arg1, bool arg2, bool arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_CGSize_bool_bool_UInt32(IntPtr receiver, IntPtr selector, CGSize arg1, bool arg2, bool arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_CGSize_bool_bool_UInt64(IntPtr receiver, IntPtr selector, CGSize arg1, bool arg2, bool arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_CGSize_bool_bool_UInt64(IntPtr receiver, IntPtr selector, CGSize arg1, bool arg2, bool arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_CGSize_IntPtr_IntPtr_UInt32_UInt32_int(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2, IntPtr arg3, uint arg4, uint arg5, int arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_CGSize_IntPtr_IntPtr_UInt32_UInt32_int(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2, IntPtr arg3, uint arg4, uint arg5, int arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_CGSize_IntPtr_IntPtr_UInt64_UInt64_Int64(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2, IntPtr arg3, ulong arg4, ulong arg5, long arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_CGSize_IntPtr_IntPtr_UInt64_UInt64_Int64(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2, IntPtr arg3, ulong arg4, ulong arg5, long arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_CGPoint(IntPtr receiver, IntPtr selector, nfloat arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_CGPoint(IntPtr receiver, IntPtr selector, nfloat arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_UInt64(out CGRect retval, IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_UInt64(out CGRect retval, IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_bool(IntPtr receiver, IntPtr selector, CGRect arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_bool(IntPtr receiver, IntPtr selector, CGRect arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_UInt32_int(IntPtr receiver, IntPtr selector, uint arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_UInt32_int(IntPtr receiver, IntPtr selector, uint arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_UInt64_Int64(IntPtr receiver, IntPtr selector, ulong arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_UInt64_Int64(IntPtr receiver, IntPtr selector, ulong arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_int(IntPtr receiver, IntPtr selector, nint arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_int(IntPtr receiver, IntPtr selector, nint arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_Int64(IntPtr receiver, IntPtr selector, nint arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_Int64(IntPtr receiver, IntPtr selector, nint arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGRect_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGRect_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_bool(out CGRect retval, IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_bool(out CGRect retval, IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_CGRect_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_CGRect_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, CGRect arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_ref_CGRect_ref_NSRectEdge(IntPtr receiver, IntPtr selector, IntPtr arg1, ref CGRect arg2, ref NSRectEdge arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_ref_CGRect_ref_NSRectEdge(IntPtr receiver, IntPtr selector, IntPtr arg1, ref CGRect arg2, ref NSRectEdge arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_Double_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, double arg1, double arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_Double_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, double arg1, double arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_short(IntPtr receiver, IntPtr selector, IntPtr arg1, short arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_short(IntPtr receiver, IntPtr selector, IntPtr arg1, short arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr_nint_IntPtr_bool_nint_out_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, bool arg4, nint arg5, out nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr_nint_IntPtr_bool_nint_out_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, bool arg4, nint arg5, out nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr_nint_IntPtr_bool_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, bool arg4, nint arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr_nint_IntPtr_bool_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, bool arg4, nint arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_NSRange_UInt64_IntPtr_nint_ref_IntPtr_out_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, nint arg5, ref IntPtr arg6, out nint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_NSRange_UInt64_IntPtr_nint_ref_IntPtr_out_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, nint arg5, ref IntPtr arg6, out nint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_NSRange_UInt64_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, nint arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_NSRange_UInt64_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, nint arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CGPoint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CGPoint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_NSRange_IntPtr_UInt64_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ulong arg3, IntPtr arg4, nint arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_NSRange_IntPtr_UInt64_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ulong arg3, IntPtr arg4, nint arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_IntPtr_IntPtr_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, CGRect arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_IntPtr_IntPtr_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, CGRect arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_IntPtr_IntPtr_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, CGRect arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_IntPtr_IntPtr_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, CGRect arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_nint(IntPtr receiver, IntPtr selector, float arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_nint(IntPtr receiver, IntPtr selector, float arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_nfloat_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_nfloat_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_CGRect_CGRect_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_CGRect_CGRect_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_CGRect_CGRect_nint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_CGRect_CGRect_nint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_nint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_nint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern float float_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern float float_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_int(IntPtr receiver, IntPtr selector, float arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_int(IntPtr receiver, IntPtr selector, float arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_Int64(IntPtr receiver, IntPtr selector, float arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_Int64(IntPtr receiver, IntPtr selector, float arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_CGRect(IntPtr receiver, IntPtr selector, bool arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_CGRect(IntPtr receiver, IntPtr selector, bool arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_bool(IntPtr receiver, IntPtr selector, bool arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_bool_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, bool arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_bool_nint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, bool arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_UInt64(IntPtr receiver, IntPtr selector, nint arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_UInt64(IntPtr receiver, IntPtr selector, nint arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_nint_IntPtr_bool(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_nint_IntPtr_bool(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_bool(IntPtr receiver, IntPtr selector, nint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_IntPtr_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_IntPtr_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_IntPtr_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_IntPtr_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_nint_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_ref_CGRect_IntPtr_nint_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref CGRect arg3, IntPtr arg4, nint arg5, CGPoint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_ref_CGRect_IntPtr_nint_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref CGRect arg3, IntPtr arg4, nint arg5, CGPoint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_nuint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_nuint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_nuint_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, nuint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_nuint_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, nuint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGRect_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGRect_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGRect_IntPtr_nuint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGRect_IntPtr_nuint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_CGRect_CGPoint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGPoint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_CGRect_CGPoint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGPoint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_CGRect_CGPoint_nuint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGPoint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_CGRect_CGPoint_nuint(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGPoint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_IntPtr_nuint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_IntPtr_nuint(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt32_UInt32(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt32_UInt32(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt64_UInt64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt64_UInt64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt32(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt32(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt32_int_UInt32(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2, int arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt32_int_UInt32(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2, int arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt64_Int64_UInt64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2, long arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt64_Int64_UInt64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2, long arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt32_int(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt32_int(IntPtr receiver, IntPtr selector, nfloat arg1, uint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_UInt64_Int64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_UInt64_Int64(IntPtr receiver, IntPtr selector, nfloat arg1, ulong arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_int_UInt32(IntPtr receiver, IntPtr selector, int arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_int_UInt32(IntPtr receiver, IntPtr selector, int arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_Int64_UInt64(IntPtr receiver, IntPtr selector, long arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_Int64_UInt64(IntPtr receiver, IntPtr selector, long arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_int_UInt32(IntPtr receiver, IntPtr selector, int arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_int_UInt32(IntPtr receiver, IntPtr selector, int arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_Int64_UInt64(IntPtr receiver, IntPtr selector, long arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_Int64_UInt64(IntPtr receiver, IntPtr selector, long arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGPoint_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGPoint_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGPoint_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGPoint_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, CGRect arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect_nuint_int_ref_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, int arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect_nuint_int_ref_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, int arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect_nuint_int_ref_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, int arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect_nuint_int_ref_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, int arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect_nuint_Int64_ref_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, long arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect_nuint_Int64_ref_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, long arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect_nuint_Int64_ref_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, long arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect_nuint_Int64_ref_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, nuint arg2, long arg3, ref CGRect arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_ref_NSRange_bool(IntPtr receiver, IntPtr selector, nuint arg1, ref NSRange arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_ref_NSRange_bool(IntPtr receiver, IntPtr selector, nuint arg1, ref NSRange arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_ref_NSRange(IntPtr receiver, IntPtr selector, nuint arg1, ref NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_ref_NSRange(IntPtr receiver, IntPtr selector, nuint arg1, ref NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_NSRange_out_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_NSRange_out_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, NSRange arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_NSRange_nint(IntPtr receiver, IntPtr selector, nuint arg1, NSRange arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_NSRange_nint(IntPtr receiver, IntPtr selector, nuint arg1, NSRange arg2, nint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_NSRange_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_NSRange_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_NSRange_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_NSRange_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_nfloat_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_nfloat_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_nfloat_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_nfloat_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_nfloat(IntPtr receiver, IntPtr selector, uint arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_nfloat(IntPtr receiver, IntPtr selector, uint arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_nfloat(IntPtr receiver, IntPtr selector, ulong arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_nfloat(IntPtr receiver, IntPtr selector, ulong arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_CGPoint_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_CGPoint_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_CGPoint_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_CGPoint_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_CGRect_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_CGRect_CGRect_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_CGRect_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_CGRect_CGRect_IntPtr_NSRange(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3, IntPtr arg4, NSRange arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGRect_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, NSRange arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGRect_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, NSRange arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_IntPtr_bool(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_IntPtr_bool(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_NSRange_UInt32(IntPtr receiver, IntPtr selector, NSRange arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_NSRange_UInt32(IntPtr receiver, IntPtr selector, NSRange arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_NSRange_UInt64(IntPtr receiver, IntPtr selector, NSRange arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_NSRange_UInt64(IntPtr receiver, IntPtr selector, NSRange arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_out_nint(IntPtr receiver, IntPtr selector, NSRange arg1, out nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_out_nint(IntPtr receiver, IntPtr selector, NSRange arg1, out nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_nint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_nint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, nint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_UInt32_bool(IntPtr receiver, IntPtr selector, NSRange arg1, uint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_UInt32_bool(IntPtr receiver, IntPtr selector, NSRange arg1, uint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_UInt64_bool(IntPtr receiver, IntPtr selector, NSRange arg1, ulong arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_UInt64_bool(IntPtr receiver, IntPtr selector, NSRange arg1, ulong arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nint_NSRange(IntPtr receiver, IntPtr selector, nint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nint_NSRange(IntPtr receiver, IntPtr selector, nint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_UInt64_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_UInt64_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_UInt64_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, IntPtr arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_UInt64_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, IntPtr arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_CGRect_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_CGRect_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr_NSRange_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr_NSRange_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_NSRange_ref_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, NSRange arg3, ref nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_NSRange_ref_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, NSRange arg3, ref nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_nint_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_nint_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_NSRange_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_NSRange_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_NSRange_UInt64_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, nint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_NSRange_UInt64_IntPtr_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, nint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_int_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, int arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_int_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, int arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_Int64_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, long arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_Int64_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, long arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_ref_CGPoint(IntPtr receiver, IntPtr selector, ref CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_ref_CGPoint(IntPtr receiver, IntPtr selector, ref CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_nuint_CGRect(IntPtr receiver, IntPtr selector, nuint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_nuint_CGRect(IntPtr receiver, IntPtr selector, nuint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_CGRect_out_CGRect_NSRange_CGPoint(IntPtr receiver, IntPtr selector, out CGRect arg1, out CGRect arg2, NSRange arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_CGRect_out_CGRect_NSRange_CGPoint(IntPtr receiver, IntPtr selector, out CGRect arg1, out CGRect arg2, NSRange arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_NSRange(IntPtr receiver, IntPtr selector, bool arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_NSRange(IntPtr receiver, IntPtr selector, bool arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_out_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, out nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_out_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, out nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_NSRange_IntPtr_nuint(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_NSRange_IntPtr_nuint(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_IntPtr_NSRange_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_IntPtr_NSRange_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_ref_CGRect_NSRange_ref_CGRect_ref_nfloat(IntPtr receiver, IntPtr selector, ref CGRect arg1, NSRange arg2, ref CGRect arg3, ref nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_ref_CGRect_NSRange_ref_CGRect_ref_nfloat(IntPtr receiver, IntPtr selector, ref CGRect arg1, NSRange arg2, ref CGRect arg3, ref nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_nuint_IntPtr_CGRect_CGPoint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, CGRect arg3, CGPoint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_nuint_IntPtr_CGRect_CGPoint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, CGRect arg3, CGPoint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_nuint_IntPtr_CGRect_CGPoint_nuint(out CGRect retval, IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, CGRect arg3, CGPoint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_nuint_IntPtr_CGRect_CGPoint_nuint(out CGRect retval, IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, CGRect arg3, CGPoint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_NSRange_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_NSRange_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_CGRect_out_CGRect_out_CGRect_nuint_CGRect_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, out CGRect arg1, out CGRect arg2, out CGRect arg3, nuint arg4, CGRect arg5, nfloat arg6, nfloat arg7, nfloat arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_CGRect_out_CGRect_out_CGRect_nuint_CGRect_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, out CGRect arg1, out CGRect arg2, out CGRect arg3, nuint arg4, CGRect arg5, nfloat arg6, nfloat arg7, nfloat arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_NSRange_CGRect_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, NSRange arg2, CGRect arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_NSRange_CGRect_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, NSRange arg2, CGRect arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_IntPtr_NSRange(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_CGSize_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_CGSize_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_CGSize(IntPtr receiver, IntPtr selector, CGRect arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_CGSize(IntPtr receiver, IntPtr selector, CGRect arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CGPoint_CGRect(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CGPoint_CGRect(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_CGRect_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_CGRect_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGPoint_CGSize_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGSize arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, bool arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGPoint_CGSize_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGSize arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, bool arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGRect_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGRect_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_CGRect_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_CGRect_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_ref_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, ref nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_ref_nfloat_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, ref nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_NSRange(IntPtr receiver, IntPtr selector, ref NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_NSRange(IntPtr receiver, IntPtr selector, ref NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGPoint_CGRect(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGPoint_CGRect(IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGPoint_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGPoint_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, CGPoint arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGRect_IntPtr_nuint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGRect_IntPtr_nuint_int(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGRect_IntPtr_nuint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4, long arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGRect_IntPtr_nuint_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, IntPtr arg3, nuint arg4, long arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect_UInt32(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect_UInt32(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect_UInt32(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect_UInt32(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGRect_UInt64(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGRect_UInt64(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGRect_UInt64(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGRect_UInt64(out CGRect retval, IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt32_UInt32_bool(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, uint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt32_UInt32_bool(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, uint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt64_UInt64_bool(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, ulong arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt64_UInt64_bool(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, ulong arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt32_UInt32_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, uint arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt32_UInt32_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2, uint arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_UInt64_UInt64_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, ulong arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_UInt64_UInt64_bool_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2, ulong arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_bool_bool(IntPtr receiver, IntPtr selector, CGRect arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_bool_bool(IntPtr receiver, IntPtr selector, CGRect arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_UInt32(IntPtr receiver, IntPtr selector, bool arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_UInt32(IntPtr receiver, IntPtr selector, bool arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_UInt64(IntPtr receiver, IntPtr selector, bool arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_UInt64(IntPtr receiver, IntPtr selector, bool arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_nint(IntPtr receiver, IntPtr selector, int arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_nint(IntPtr receiver, IntPtr selector, int arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_nint(IntPtr receiver, IntPtr selector, long arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_nint(IntPtr receiver, IntPtr selector, long arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_UInt32(IntPtr receiver, IntPtr selector, uint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_UInt32(IntPtr receiver, IntPtr selector, uint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_UInt64(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_UInt64(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_CGPoint_nint(IntPtr receiver, IntPtr selector, CGPoint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_CGPoint_nint(IntPtr receiver, IntPtr selector, CGPoint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_int(IntPtr receiver, IntPtr selector, int arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_int(IntPtr receiver, IntPtr selector, int arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_Int64(IntPtr receiver, IntPtr selector, long arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_Int64(IntPtr receiver, IntPtr selector, long arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_IntPtr_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_IntPtr_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_IntPtr_IntPtr_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_IntPtr_IntPtr_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSend_IntPtr_CGSize_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGSize CGSize_objc_msgSendSuper_IntPtr_CGSize_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_out_Boolean_out_Boolean_out_Boolean_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, out bool arg2, out bool arg3, out bool arg4, ref IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_out_Boolean_out_Boolean_out_Boolean_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, out bool arg2, out bool arg3, out bool arg4, ref IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_out_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, out nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_out_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, out nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_AudioComponentDescription_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, AudioComponentDescription arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_AudioComponentDescription_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, AudioComponentDescription arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_AudioComponentDescription_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1, uint arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_AudioComponentDescription_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1, uint arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_AudioComponentDescription_ref_IntPtr(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_AudioComponentDescription_ref_IntPtr(IntPtr receiver, IntPtr selector, AudioComponentDescription arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_nuint_ref_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_nuint_ref_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_IntPtr_UInt64(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_IntPtr_UInt64(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_ref_Single(IntPtr receiver, IntPtr selector, ref float arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_ref_Single(IntPtr receiver, IntPtr selector, ref float arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_IntPtr_UInt64_UInt32(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, ulong arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_IntPtr_UInt64_UInt32(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, ulong arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_UInt32_UInt32(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_UInt32_UInt32(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64_float_float_int_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, float arg4, float arg5, int arg6, IntPtr arg7, uint arg8, IntPtr arg9, IntPtr arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64_float_float_int_IntPtr_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, float arg4, float arg5, int arg6, IntPtr arg7, uint arg8, IntPtr arg9, IntPtr arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_IntPtr_int_nfloat_nfloat(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3, nfloat arg4, nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_IntPtr_int_nfloat_nfloat(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3, nfloat arg4, nfloat arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_IntPtr_int_nfloat(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_IntPtr_int_nfloat(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_IntPtr_int(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_IntPtr_int(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CATransform3D CATransform3D_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CATransform3D CATransform3D_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CATransform3D_objc_msgSend_stret(out CATransform3D retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CATransform3D_objc_msgSendSuper_stret(out CATransform3D retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CATransform3D(IntPtr receiver, IntPtr selector, CATransform3D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CATransform3D(IntPtr receiver, IntPtr selector, CATransform3D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern double Double_objc_msgSend_Double_IntPtr(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern double Double_objc_msgSendSuper_Double_IntPtr(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float_float_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2, float arg3, float arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float_float_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2, float arg3, float arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, ref IntPtr arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, ref IntPtr arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, nfloat arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_nfloat(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_nfloat_IntPtr(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CGRect arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_CGRect_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, CGRect arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGPoint_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGPoint_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGRect_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGRect_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGRect_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGRect_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGRect_int_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, int arg3, IntPtr arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGRect_int_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2, int arg3, IntPtr arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nint_CGRect_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, CGRect arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nint_CGRect_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, CGRect arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_int_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3, IntPtr arg4, IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_int_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3, IntPtr arg4, IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGAffineTransform_bool(IntPtr receiver, IntPtr selector, CGAffineTransform arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGAffineTransform_bool(IntPtr receiver, IntPtr selector, CGAffineTransform arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_int(IntPtr receiver, IntPtr selector, int arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_int(IntPtr receiver, IntPtr selector, int arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_CGSize_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, CGSize arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_CGSize_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, CGSize arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_CGSize_bool_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, CGSize arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_CGSize_bool_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, CGSize arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_CGSize_bool_IntPtr(IntPtr receiver, IntPtr selector, int arg1, CGSize arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_CGSize_bool_IntPtr(IntPtr receiver, IntPtr selector, int arg1, CGSize arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGAffineTransform(IntPtr receiver, IntPtr selector, CGAffineTransform arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGAffineTransform(IntPtr receiver, IntPtr selector, CGAffineTransform arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGAffineTransform CGAffineTransform_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGAffineTransform CGAffineTransform_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGAffineTransform_objc_msgSend_stret_int(out CGAffineTransform retval, IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGAffineTransform_objc_msgSendSuper_stret_int(out CGAffineTransform retval, IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_nuint_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, int arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_nuint_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, int arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_int(IntPtr receiver, IntPtr selector, CGRect arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_int(IntPtr receiver, IntPtr selector, CGRect arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_int_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_int_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_CGRect(IntPtr receiver, IntPtr selector, IntPtr arg1, CGRect arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_int_IntPtr_CGRect(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_int_IntPtr_CGRect(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_int_IntPtr_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_int_IntPtr_CGRect(out CGRect retval, IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, CGRect arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_nuint_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5, nuint arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_nuint_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5, nuint arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CLLocationCoordinate2D CLLocationCoordinate2D_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CLLocationCoordinate2D CLLocationCoordinate2D_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CLLocationCoordinate2D_objc_msgSend_stret(out CLLocationCoordinate2D retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CLLocationCoordinate2D_objc_msgSendSuper_stret(out CLLocationCoordinate2D retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D_Double_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_Double_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_Double(IntPtr receiver, IntPtr selector, double arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_Double(IntPtr receiver, IntPtr selector, double arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D_Double_Double_Double_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, double arg3, double arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_Double_Double_Double_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, double arg3, double arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D_Double_Double_Double_Double_Double_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, double arg3, double arg4, double arg5, double arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_Double_Double_Double_Double_Double_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, double arg3, double arg4, double arg5, double arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt32_nint_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt32_nint_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt64_nint_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt64_nint_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt32_nuint_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nuint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt32_nuint_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nuint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_UInt64_nuint_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nuint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_UInt64_nuint_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nuint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_int_ref_IntPtr(IntPtr receiver, IntPtr selector, int arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_int_ref_IntPtr(IntPtr receiver, IntPtr selector, int arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_Int64_ref_IntPtr(IntPtr receiver, IntPtr selector, long arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_Int64_ref_IntPtr(IntPtr receiver, IntPtr selector, long arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_int_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_int_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_Int64_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_Int64_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, bool arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_nint_IntPtr(IntPtr receiver, IntPtr selector, int arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_nint_IntPtr(IntPtr receiver, IntPtr selector, int arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_nint_IntPtr(IntPtr receiver, IntPtr selector, long arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_nint_IntPtr(IntPtr receiver, IntPtr selector, long arg1, nint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_nint_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, nint arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_nint_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, nint arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_nint_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, nint arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_nint_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, nint arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8, IntPtr arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_Double_ref_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, double arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_Double_ref_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, double arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_Double_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_Double_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, double arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_UInt32(IntPtr receiver, IntPtr selector, uint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_UInt32(IntPtr receiver, IntPtr selector, uint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_out_NSRange(IntPtr receiver, IntPtr selector, nint arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_out_NSRange(IntPtr receiver, IntPtr selector, nint arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_out_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, out NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_out_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, out NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_out_NSRange_NSRange(IntPtr receiver, IntPtr selector, nint arg1, out NSRange arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_out_NSRange_NSRange(IntPtr receiver, IntPtr selector, nint arg1, out NSRange arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_out_NSRange_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, out NSRange arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_out_NSRange_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, out NSRange arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_UInt32_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_UInt32_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_UInt32(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_UInt32(IntPtr receiver, IntPtr selector, CGRect arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_UInt64(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_UInt64(IntPtr receiver, IntPtr selector, CGRect arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_nuint_NSRange(IntPtr receiver, IntPtr selector, nuint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_nuint_NSRange(IntPtr receiver, IntPtr selector, nuint arg1, NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_nuint_bool(IntPtr receiver, IntPtr selector, nuint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_nuint_bool(IntPtr receiver, IntPtr selector, nuint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_out_NSRange(IntPtr receiver, IntPtr selector, nuint arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_out_NSRange(IntPtr receiver, IntPtr selector, nuint arg1, out NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_NSRange(IntPtr receiver, IntPtr selector, NSRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGSize_UInt32(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGSize_UInt32(IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGSize_UInt32(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGSize_UInt32(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_CGSize_UInt64(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_CGSize_UInt64(IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_CGSize_UInt64(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_CGSize_UInt64(out CGRect retval, IntPtr receiver, IntPtr selector, CGSize arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_int(IntPtr receiver, IntPtr selector, long arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_int(IntPtr receiver, IntPtr selector, long arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_Int64(IntPtr receiver, IntPtr selector, long arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_Int64(IntPtr receiver, IntPtr selector, long arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_nint_IntPtr_UInt32(IntPtr receiver, IntPtr selector, uint arg1, nint arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_nint_IntPtr_UInt32(IntPtr receiver, IntPtr selector, uint arg1, nint arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_nint_IntPtr_UInt64(IntPtr receiver, IntPtr selector, ulong arg1, nint arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_nint_IntPtr_UInt64(IntPtr receiver, IntPtr selector, ulong arg1, nint arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nint_nint_IntPtr_UInt32(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nint_nint_IntPtr_UInt32(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nint_nint_IntPtr_UInt64(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nint_nint_IntPtr_UInt64(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nint_nint_nint_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, nint arg4, nint arg5, nint arg6, nint arg7, nint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nint_nint_nint_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, nint arg4, nint arg5, nint arg6, nint arg7, nint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_nint_out_nint_out_nint_out_nint_IntPtr(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2, out nint arg3, out nint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_nint_out_nint_out_nint_out_nint_IntPtr(IntPtr receiver, IntPtr selector, out nint arg1, out nint arg2, out nint arg3, out nint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSend_IntPtr_nint_nint_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, uint arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, uint arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSend_IntPtr_nint_nint_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, ulong arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSendSuper_IntPtr_nint_nint_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4, ulong arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSend_IntPtr_UInt32_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3, uint arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSendSuper_IntPtr_UInt32_nint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nint arg3, uint arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSend_IntPtr_UInt64_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nint arg3, ulong arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_IntPtr_objc_msgSendSuper_IntPtr_UInt64_nint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nint arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_IntPtr_out_Double_UInt32_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out double arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_IntPtr_out_Double_UInt32_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out double arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_IntPtr_out_Double_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out double arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_IntPtr_out_Double_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out double arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_IntPtr_out_Double_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out double arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_IntPtr_out_Double_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out double arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, uint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_UInt64(IntPtr receiver, IntPtr selector, ulong arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_UInt64_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_UInt64_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_UInt64_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_UInt64_UInt64_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_UInt32_ref_IntPtr_out_Double_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, ref IntPtr arg2, out double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_UInt32_ref_IntPtr_out_Double_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, ref IntPtr arg2, out double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_UInt64_ref_IntPtr_out_Double_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ref IntPtr arg2, out double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_UInt64_ref_IntPtr_out_Double_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ref IntPtr arg2, out double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nuint_nuint_nuint_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5, nuint arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nuint_nuint_nuint_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5, nuint arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nint_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, nint arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nint_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, nint arg3, nint arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_Char(IntPtr receiver, IntPtr selector, char arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_Char(IntPtr receiver, IntPtr selector, char arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_byte(IntPtr receiver, IntPtr selector, byte arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_byte(IntPtr receiver, IntPtr selector, byte arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Double_IntPtr(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Double_IntPtr(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_out_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, out nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_out_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, out nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_out_nuint(IntPtr receiver, IntPtr selector, out nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_out_nuint(IntPtr receiver, IntPtr selector, out nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64_UInt64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ulong arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64_UInt64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ulong arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_nint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSend_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSRange NSRange_objc_msgSendSuper_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSDecimal NSDecimal_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSDecimal NSDecimal_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void NSDecimal_objc_msgSend_stret(out NSDecimal retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void NSDecimal_objc_msgSendSuper_stret(out NSDecimal retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_short_bool(IntPtr receiver, IntPtr selector, long arg1, short arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_short_bool(IntPtr receiver, IntPtr selector, long arg1, short arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSDecimal(IntPtr receiver, IntPtr selector, NSDecimal arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSDecimal(IntPtr receiver, IntPtr selector, NSDecimal arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_short(IntPtr receiver, IntPtr selector, short arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_short(IntPtr receiver, IntPtr selector, short arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_short_IntPtr(IntPtr receiver, IntPtr selector, short arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_short_IntPtr(IntPtr receiver, IntPtr selector, short arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, uint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, ulong arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_int(IntPtr receiver, IntPtr selector, double arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_int(IntPtr receiver, IntPtr selector, double arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_Int64(IntPtr receiver, IntPtr selector, double arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_Int64(IntPtr receiver, IntPtr selector, double arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_out_NSEnergyFormatterUnit(IntPtr receiver, IntPtr selector, double arg1, out NSEnergyFormatterUnit arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_out_NSEnergyFormatterUnit(IntPtr receiver, IntPtr selector, double arg1, out NSEnergyFormatterUnit arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_IntPtr_UInt32_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, uint arg4, ref IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_IntPtr_UInt32_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, uint arg4, ref IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_IntPtr_UInt64_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ulong arg4, ref IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_IntPtr_UInt64_ref_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, ulong arg4, ref IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_bool(IntPtr receiver, IntPtr selector, int arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_bool(IntPtr receiver, IntPtr selector, int arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_bool_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_bool_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_ref_Boolean(IntPtr receiver, IntPtr selector, IntPtr arg1, ref bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_ref_Boolean(IntPtr receiver, IntPtr selector, IntPtr arg1, ref bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_UInt32_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_UInt32_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_UInt64_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_UInt64_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt32_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4, ref IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt32_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4, ref IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt64_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4, ref IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt64_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4, ref IntPtr arg5, ref IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_bool_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_bool_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, bool arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ref IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_out_NSUrlRelationship_UInt32_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, out NSUrlRelationship arg1, uint arg2, uint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_out_NSUrlRelationship_UInt32_UInt32_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, out NSUrlRelationship arg1, uint arg2, uint arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_out_NSUrlRelationship_UInt64_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, out NSUrlRelationship arg1, ulong arg2, ulong arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_out_NSUrlRelationship_UInt64_UInt64_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, out NSUrlRelationship arg1, ulong arg2, ulong arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_out_NSUrlRelationship_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, out NSUrlRelationship arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_out_NSUrlRelationship_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, out NSUrlRelationship arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_IntPtr_out_NSRange_IntPtr_NSRange_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out NSRange arg2, IntPtr arg3, NSRange arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_IntPtr_out_NSRange_IntPtr_NSRange_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, out NSRange arg2, IntPtr arg3, NSRange arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_ref_NSLengthFormatterUnit(IntPtr receiver, IntPtr selector, double arg1, ref NSLengthFormatterUnit arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_ref_NSLengthFormatterUnit(IntPtr receiver, IntPtr selector, double arg1, ref NSLengthFormatterUnit arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_ref_NSRange(IntPtr receiver, IntPtr selector, nint arg1, ref NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_ref_NSRange(IntPtr receiver, IntPtr selector, nint arg1, ref NSRange arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_nint(IntPtr receiver, IntPtr selector, NSRange arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_nint(IntPtr receiver, IntPtr selector, NSRange arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_IntPtr_ref_NSRange_ref_NSRange(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, ref NSRange arg3, ref NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_IntPtr_ref_NSRange_ref_NSRange(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, ref NSRange arg3, ref NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_IntPtr_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_IntPtr_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_IntPtr_ref_NSRange_ref_NSRange_ref_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, ref NSRange arg3, ref NSRange arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_IntPtr_ref_NSRange_ref_NSRange_ref_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, ref NSRange arg3, ref NSRange arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_UInt64(IntPtr receiver, IntPtr selector, uint arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_UInt64(IntPtr receiver, IntPtr selector, uint arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_ref_NSMassFormatterUnit(IntPtr receiver, IntPtr selector, double arg1, ref NSMassFormatterUnit arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_ref_NSMassFormatterUnit(IntPtr receiver, IntPtr selector, double arg1, ref NSMassFormatterUnit arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_NSRange_IntPtr_nuint(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_NSRange_IntPtr_nuint(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_nint(IntPtr receiver, IntPtr selector, nuint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_nint(IntPtr receiver, IntPtr selector, nuint arg1, nint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_bool_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, NSRange arg3, out NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_bool_NSRange_out_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, NSRange arg3, out NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, ref IntPtr arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern sbyte SByte_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern sbyte SByte_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern byte byte_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern byte byte_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_SByte(IntPtr receiver, IntPtr selector, sbyte arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_SByte(IntPtr receiver, IntPtr selector, sbyte arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_byte(IntPtr receiver, IntPtr selector, byte arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_byte(IntPtr receiver, IntPtr selector, byte arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt16(IntPtr receiver, IntPtr selector, ushort arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt16(IntPtr receiver, IntPtr selector, ushort arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float(IntPtr receiver, IntPtr selector, float arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float(IntPtr receiver, IntPtr selector, float arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_Double_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_Double_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Int64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Int64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_nuint_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_nuint_IntPtr_IntPtr_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSOperatingSystemVersion NSOperatingSystemVersion_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSOperatingSystemVersion NSOperatingSystemVersion_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void NSOperatingSystemVersion_objc_msgSend_stret(out NSOperatingSystemVersion retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void NSOperatingSystemVersion_objc_msgSendSuper_stret(out NSOperatingSystemVersion retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_NSOperatingSystemVersion(IntPtr receiver, IntPtr selector, NSOperatingSystemVersion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_NSOperatingSystemVersion(IntPtr receiver, IntPtr selector, NSOperatingSystemVersion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_IntPtr_Int64(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_IntPtr_Int64(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, uint arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ulong arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr_UInt32_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr_UInt32_UInt32_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_IntPtr_IntPtr_UInt64_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ulong arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_IntPtr_IntPtr_UInt64_UInt64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ulong arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_ref_NSPropertyListFormat_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref NSPropertyListFormat arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_ref_NSPropertyListFormat_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref NSPropertyListFormat arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_ref_NSPropertyListFormat_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref NSPropertyListFormat arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_ref_NSPropertyListFormat_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref NSPropertyListFormat arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, ref IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, ref IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nint_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nint_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern char Char_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern char Char_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_IntPtr_UInt32_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_IntPtr_UInt64_NSRange_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nuint nuint_objc_msgSend_IntPtr_IntPtr_ref_IntPtr_out_Boolean(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, out bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nuint nuint_objc_msgSendSuper_IntPtr_IntPtr_ref_IntPtr_out_Boolean(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ref IntPtr arg3, out bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_out_nuint_out_nuint_out_nuint_NSRange(IntPtr receiver, IntPtr selector, out nuint arg1, out nuint arg2, out nuint arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_out_nuint_out_nuint_out_nuint_NSRange(IntPtr receiver, IntPtr selector, out nuint arg1, out nuint arg2, out nuint arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_NSRange_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_NSRange_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, NSRange arg1, IntPtr arg2, IntPtr arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, double arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, double arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, double arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Double_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, bool arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Double_IntPtr_IntPtr_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, bool arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Double_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, bool arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_out_Boolean_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, out bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_IntPtr_out_Boolean_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, out bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_IntPtr_out_Boolean_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, out bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_IntPtr_out_Boolean_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, out bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nint_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nint_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Int64_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, long arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Int64_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, long arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_Int64_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3, long arg4, long arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_Int64_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3, long arg4, long arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_Int64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3, long arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_nuint_Double_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_nuint_Double_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, double arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Double_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Double_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern SCNVector3 SCNVector3_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern SCNVector3 SCNVector3_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void SCNVector3_objc_msgSend_stret(out SCNVector3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void SCNVector3_objc_msgSendSuper_stret(out SCNVector3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern SCNVector4 SCNVector4_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern SCNVector4 SCNVector4_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void SCNVector4_objc_msgSend_stret(out SCNVector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void SCNVector4_objc_msgSendSuper_stret(out SCNVector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern SCNMatrix4 SCNMatrix4_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern SCNMatrix4 SCNMatrix4_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void SCNMatrix4_objc_msgSend_stret(out SCNMatrix4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void SCNMatrix4_objc_msgSendSuper_stret(out SCNMatrix4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CMTimeMapping(IntPtr receiver, IntPtr selector, CMTimeMapping arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CMTimeMapping(IntPtr receiver, IntPtr selector, CMTimeMapping arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_MKCoordinateSpan(IntPtr receiver, IntPtr selector, MKCoordinateSpan arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_MKCoordinateSpan(IntPtr receiver, IntPtr selector, MKCoordinateSpan arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CATransform3D(IntPtr receiver, IntPtr selector, CATransform3D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CATransform3D(IntPtr receiver, IntPtr selector, CATransform3D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_SCNVector3(IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_SCNVector3(IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_SCNVector4(IntPtr receiver, IntPtr selector, SCNVector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_SCNVector4(IntPtr receiver, IntPtr selector, SCNVector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_SCNMatrix4(IntPtr receiver, IntPtr selector, SCNMatrix4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_SCNMatrix4(IntPtr receiver, IntPtr selector, SCNMatrix4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Vector4 Vector4_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Vector4 Vector4_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void Vector4_objc_msgSend_stret(out Vector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void Vector4_objc_msgSendSuper_stret(out Vector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void IntPtr_objc_msgSend_stret(IntPtr retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void IntPtr_objc_msgSendSuper_stret(IntPtr retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Matrix3 Matrix3_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Matrix3 Matrix3_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void Matrix3_objc_msgSend_stret(out Matrix3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void Matrix3_objc_msgSendSuper_stret(out Matrix3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Matrix4 Matrix4_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Matrix4 Matrix4_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void Matrix4_objc_msgSend_stret(out Matrix4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void Matrix4_objc_msgSendSuper_stret(out Matrix4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Matrix4(IntPtr receiver, IntPtr selector, Matrix4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Matrix4(IntPtr receiver, IntPtr selector, Matrix4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_UInt32(IntPtr receiver, IntPtr selector, nuint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_UInt32(IntPtr receiver, IntPtr selector, nuint arg1, uint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_UInt64(IntPtr receiver, IntPtr selector, nuint arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_UInt64(IntPtr receiver, IntPtr selector, nuint arg1, ulong arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Matrix3(IntPtr receiver, IntPtr selector, Matrix3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Matrix3(IntPtr receiver, IntPtr selector, Matrix3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nfloat_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nfloat_IntPtr_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, IntPtr arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nfloat_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nfloat_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Vector3d Vector3d_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Vector3d Vector3d_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void Vector3d_objc_msgSend_stret(out Vector3d retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void Vector3d_objc_msgSendSuper_stret(out Vector3d retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Quaterniond Quaterniond_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Quaterniond Quaterniond_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void Quaterniond_objc_msgSend_stret(out Quaterniond retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void Quaterniond_objc_msgSendSuper_stret(out Quaterniond retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, bool arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_int_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_int_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, int arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_Int64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_Int64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, long arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_int_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_int_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_Int64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_Int64_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_Double_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, double arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_Double_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, double arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2 xamarin_simd__Vector2_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2 xamarin_simd__Vector2_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSend_stret(out Vector3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSendSuper_stret(out Vector3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix3 xamarin_simd__Matrix3_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix3 xamarin_simd__Matrix3_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix3_objc_msgSend_stret(out Matrix3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix3_objc_msgSendSuper_stret(out Matrix3 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Matrix3(IntPtr receiver, IntPtr selector, Matrix3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Matrix3(IntPtr receiver, IntPtr selector, Matrix3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_nint_Double_Double_int(IntPtr receiver, IntPtr selector, double arg1, nint arg2, double arg3, double arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_nint_Double_Double_int(IntPtr receiver, IntPtr selector, double arg1, nint arg2, double arg3, double arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Double_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Double_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, bool arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2i xamarin_simd__Vector2i_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2i xamarin_simd__Vector2i_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector2i_int_int_bool(IntPtr receiver, IntPtr selector, Vector2i arg1, int arg2, int arg3, bool arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector2i_int_int_bool(IntPtr receiver, IntPtr selector, Vector2i arg1, int arg2, int arg3, bool arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector2i_int_int_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector2i arg1, int arg2, int arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector2i_int_int_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector2i arg1, int arg2, int arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_Vector2_Vector2_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, Vector2 arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_Vector2_Vector2_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, Vector2 arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_Vector2_Vector2(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_Vector2_Vector2(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern GKTriangle xamarin_simd__GKTriangle_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern GKTriangle xamarin_simd__GKTriangle_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__GKTriangle_objc_msgSend_stret_nuint(out GKTriangle retval, IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__GKTriangle_objc_msgSendSuper_stret_nuint(out GKTriangle retval, IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern float xamarin_simd__float_objc_msgSend_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern float xamarin_simd__float_objc_msgSendSuper_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Double_Double_int_int(IntPtr receiver, IntPtr selector, double arg1, double arg2, int arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Double_Double_int_int(IntPtr receiver, IntPtr selector, double arg1, double arg2, int arg3, int arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Vector3d(IntPtr receiver, IntPtr selector, Vector3d arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Vector3d(IntPtr receiver, IntPtr selector, Vector3d arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2d xamarin_simd__Vector2d_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2d xamarin_simd__Vector2d_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector2d_objc_msgSend_stret(out Vector2d retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector2d_objc_msgSendSuper_stret(out Vector2d retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Vector2d_Vector2d_Vector2i_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2d arg2, Vector2d arg3, Vector2i arg4, bool arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Vector2d_Vector2d_Vector2i_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2d arg2, Vector2d arg3, Vector2i arg4, bool arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern float xamarin_simd__float_objc_msgSend_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern float xamarin_simd__float_objc_msgSendSuper_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_float_Vector2i(IntPtr receiver, IntPtr selector, float arg1, Vector2i arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_float_Vector2i(IntPtr receiver, IntPtr selector, float arg1, Vector2i arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_float_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_float_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, IntPtr arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern GKBox xamarin_simd__GKBox_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern GKBox xamarin_simd__GKBox_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__GKBox_objc_msgSend_stret(out GKBox retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__GKBox_objc_msgSendSuper_stret(out GKBox retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_GKBox_float(IntPtr receiver, IntPtr selector, GKBox arg1, float arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_GKBox_float(IntPtr receiver, IntPtr selector, GKBox arg1, float arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector3 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector3 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_GKBox(IntPtr receiver, IntPtr selector, IntPtr arg1, GKBox arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_GKBox(IntPtr receiver, IntPtr selector, IntPtr arg1, GKBox arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_GKBox(IntPtr receiver, IntPtr selector, GKBox arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_GKBox(IntPtr receiver, IntPtr selector, GKBox arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_float_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, float arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_float_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, float arg3, bool arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2 xamarin_simd__Vector2_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2 xamarin_simd__Vector2_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSend_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSendSuper_nuint(IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSend_stret_nuint(out Vector3 retval, IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSendSuper_stret_nuint(out Vector3 retval, IntPtr receiver, IntPtr selector, nuint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_GKQuad_float(IntPtr receiver, IntPtr selector, GKQuad arg1, float arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_GKQuad_float(IntPtr receiver, IntPtr selector, GKQuad arg1, float arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_GKQuad(IntPtr receiver, IntPtr selector, IntPtr arg1, GKQuad arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_GKQuad(IntPtr receiver, IntPtr selector, IntPtr arg1, GKQuad arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_GKQuad(IntPtr receiver, IntPtr selector, GKQuad arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_GKQuad(IntPtr receiver, IntPtr selector, GKQuad arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern GKQuad xamarin_simd__GKQuad_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern GKQuad xamarin_simd__GKQuad_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__GKQuad_objc_msgSend_stret(out GKQuad retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__GKQuad_objc_msgSendSuper_stret(out GKQuad retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_IntPtr_Vector2_Vector2_int(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2, Vector2 arg3, int arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_IntPtr_Vector2_Vector2_int(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2, Vector2 arg3, int arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_IntPtr_Vector2_Vector2_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2, Vector2 arg3, long arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_IntPtr_Vector2_Vector2_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2, Vector2 arg3, long arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_IntPtr_Vector2_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_IntPtr_Vector2_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector2_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1, Vector2 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector2_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1, Vector2 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_nint_Double_int(IntPtr receiver, IntPtr selector, double arg1, nint arg2, double arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_nint_Double_int(IntPtr receiver, IntPtr selector, double arg1, nint arg2, double arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_float(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_Double_bool_int(IntPtr receiver, IntPtr selector, double arg1, double arg2, bool arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_Double_bool_int(IntPtr receiver, IntPtr selector, double arg1, double arg2, bool arg3, int arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, int arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, int arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, long arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, long arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_IntPtr_IntPtr_UInt32(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Int64_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Int64_IntPtr_IntPtr_UInt64(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt32_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt32_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, uint arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_UInt64_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_UInt64_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ulong arg4, IntPtr arg5, IntPtr arg6, IntPtr arg7, IntPtr arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, int arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, long arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_bool_bool(IntPtr receiver, IntPtr selector, bool arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_bool_bool(IntPtr receiver, IntPtr selector, bool arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSend_stret(out MKMapRect retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSendSuper_stret(out MKMapRect retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D_Double(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_Double(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKCoordinateRegion MKCoordinateRegion_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKCoordinateRegion MKCoordinateRegion_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKCoordinateRegion_objc_msgSend_stret(out MKCoordinateRegion retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKCoordinateRegion_objc_msgSendSuper_stret(out MKCoordinateRegion retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKCoordinateRegion(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKCoordinateRegion(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D_CLLocationCoordinate2D_Double(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, CLLocationCoordinate2D arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_CLLocationCoordinate2D_Double(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, CLLocationCoordinate2D arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D_Double_nfloat_Double(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, nfloat arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_Double_nfloat_Double(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, double arg2, nfloat arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_CLLocationCoordinate2D(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKCoordinateRegion_bool(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKCoordinateRegion_bool(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CLLocationCoordinate2D_bool(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CLLocationCoordinate2D_bool(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKCoordinateRegion MKCoordinateRegion_objc_msgSend_MKCoordinateRegion(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKCoordinateRegion MKCoordinateRegion_objc_msgSendSuper_MKCoordinateRegion(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKCoordinateRegion_objc_msgSend_stret_MKCoordinateRegion(out MKCoordinateRegion retval, IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKCoordinateRegion_objc_msgSendSuper_stret_MKCoordinateRegion(out MKCoordinateRegion retval, IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_CLLocationCoordinate2D_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_CLLocationCoordinate2D_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CLLocationCoordinate2D CLLocationCoordinate2D_objc_msgSend_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CLLocationCoordinate2D CLLocationCoordinate2D_objc_msgSendSuper_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CLLocationCoordinate2D_objc_msgSend_stret_CGPoint_IntPtr(out CLLocationCoordinate2D retval, IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CLLocationCoordinate2D_objc_msgSendSuper_stret_CGPoint_IntPtr(out CLLocationCoordinate2D retval, IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_MKCoordinateRegion_IntPtr(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_MKCoordinateRegion_IntPtr(IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_MKCoordinateRegion_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_MKCoordinateRegion_IntPtr(out CGRect retval, IntPtr receiver, IntPtr selector, MKCoordinateRegion arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKCoordinateRegion MKCoordinateRegion_objc_msgSend_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKCoordinateRegion MKCoordinateRegion_objc_msgSendSuper_CGRect_IntPtr(IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKCoordinateRegion_objc_msgSend_stret_CGRect_IntPtr(out MKCoordinateRegion retval, IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKCoordinateRegion_objc_msgSendSuper_stret_CGRect_IntPtr(out MKCoordinateRegion retval, IntPtr receiver, IntPtr selector, CGRect arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSend_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSendSuper_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSend_stret_MKMapRect(out MKMapRect retval, IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSendSuper_stret_MKMapRect(out MKMapRect retval, IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKMapRect_NSEdgeInsets_bool(IntPtr receiver, IntPtr selector, MKMapRect arg1, NSEdgeInsets arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKMapRect_NSEdgeInsets_bool(IntPtr receiver, IntPtr selector, MKMapRect arg1, NSEdgeInsets arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKMapRect_bool(IntPtr receiver, IntPtr selector, MKMapRect arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKMapRect_bool(IntPtr receiver, IntPtr selector, MKMapRect arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSend_MKMapRect_NSEdgeInsets(IntPtr receiver, IntPtr selector, MKMapRect arg1, NSEdgeInsets arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSendSuper_MKMapRect_NSEdgeInsets(IntPtr receiver, IntPtr selector, MKMapRect arg1, NSEdgeInsets arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSend_stret_MKMapRect_NSEdgeInsets(out MKMapRect retval, IntPtr receiver, IntPtr selector, MKMapRect arg1, NSEdgeInsets arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSendSuper_stret_MKMapRect_NSEdgeInsets(out MKMapRect retval, IntPtr receiver, IntPtr selector, MKMapRect arg1, NSEdgeInsets arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt64_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, ulong arg3, ulong arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_MKMapPoint(IntPtr receiver, IntPtr selector, MKMapPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_MKMapPoint(IntPtr receiver, IntPtr selector, MKMapPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKMapPoint MKMapPoint_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKMapPoint MKMapPoint_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKMapPoint_objc_msgSend_stret_CGPoint(out MKMapPoint retval, IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKMapPoint_objc_msgSendSuper_stret_CGPoint(out MKMapPoint retval, IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_MKMapRect(IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_MKMapRect(out CGRect retval, IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_MKMapRect(out CGRect retval, IntPtr receiver, IntPtr selector, MKMapRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSend_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MKMapRect MKMapRect_objc_msgSendSuper_CGRect(IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSend_stret_CGRect(out MKMapRect retval, IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MKMapRect_objc_msgSendSuper_stret_CGRect(out MKMapRect retval, IntPtr receiver, IntPtr selector, CGRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_MKMapRect_nfloat(IntPtr receiver, IntPtr selector, MKMapRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_MKMapRect_nfloat(IntPtr receiver, IntPtr selector, MKMapRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKMapRect_nfloat_IntPtr(IntPtr receiver, IntPtr selector, MKMapRect arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKMapRect_nfloat_IntPtr(IntPtr receiver, IntPtr selector, MKMapRect arg1, nfloat arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKMapRect_nfloat(IntPtr receiver, IntPtr selector, MKMapRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKMapRect_nfloat(IntPtr receiver, IntPtr selector, MKMapRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CLLocationCoordinate2D_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_IntPtr(IntPtr receiver, IntPtr selector, CLLocationCoordinate2D arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_MKTileOverlayPath(IntPtr receiver, IntPtr selector, MKTileOverlayPath arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_MKTileOverlayPath(IntPtr receiver, IntPtr selector, MKTileOverlayPath arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MKTileOverlayPath_IntPtr(IntPtr receiver, IntPtr selector, MKTileOverlayPath arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MKTileOverlayPath_IntPtr(IntPtr receiver, IntPtr selector, MKTileOverlayPath arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_MTLOrigin(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_MTLOrigin(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_nuint_MTLSize_IntPtr_nuint_nuint_MTLOrigin(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_nuint_MTLSize_IntPtr_nuint_nuint_MTLOrigin(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_nuint_MTLSize_IntPtr_nuint_nuint_MTLOrigin_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9, uint arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_nuint_MTLSize_IntPtr_nuint_nuint_MTLOrigin_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9, uint arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_nuint_MTLSize_IntPtr_nuint_nuint_MTLOrigin_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9, ulong arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_nuint_MTLSize_IntPtr_nuint_nuint_MTLOrigin_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, nuint arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, MTLOrigin arg9, ulong arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_nuint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9, uint arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_nuint_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9, uint arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_nuint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9, ulong arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_MTLOrigin_MTLSize_IntPtr_nuint_nuint_nuint_UInt64(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLOrigin arg4, MTLSize arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9, ulong arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_NSRange_byte(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, byte arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_NSRange_byte(IntPtr receiver, IntPtr selector, IntPtr arg1, NSRange arg2, byte arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, nuint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, nuint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_float_float_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, float arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_float_float_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, float arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MTLSize_MTLSize(IntPtr receiver, IntPtr selector, MTLSize arg1, MTLSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MTLSize_MTLSize(IntPtr receiver, IntPtr selector, MTLSize arg1, MTLSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_MTLSize(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, MTLSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_MTLSize(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, MTLSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MTLRegion(IntPtr receiver, IntPtr selector, MTLRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MTLRegion(IntPtr receiver, IntPtr selector, MTLRegion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MTLSize MTLSize_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MTLSize MTLSize_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MTLSize_objc_msgSend_stret(out MTLSize retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MTLSize_objc_msgSendSuper_stret(out MTLSize retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ulong arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_ref_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, ref IntPtr arg3, ref IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_NSRange(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, NSRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MTLViewport(IntPtr receiver, IntPtr selector, MTLViewport arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MTLViewport(IntPtr receiver, IntPtr selector, MTLViewport arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MTLScissorRect(IntPtr receiver, IntPtr selector, MTLScissorRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MTLScissorRect(IntPtr receiver, IntPtr selector, MTLScissorRect arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_float_float_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2, float arg3, float arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_float_float_float_float(IntPtr receiver, IntPtr selector, float arg1, float arg2, float arg3, float arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nuint_UInt32_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, uint arg3, IntPtr arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nuint_UInt32_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, uint arg3, IntPtr arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nuint_UInt64_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, ulong arg3, IntPtr arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nuint_UInt64_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, ulong arg3, IntPtr arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nuint_UInt32_IntPtr_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, uint arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nuint_UInt32_IntPtr_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, uint arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nuint_UInt64_IntPtr_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, ulong arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nuint_UInt64_IntPtr_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, ulong arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nuint_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nuint_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nuint_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nuint_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3, nuint arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_nuint_UInt32_IntPtr_nuint_nuint_nint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, uint arg3, IntPtr arg4, nuint arg5, nuint arg6, nint arg7, nuint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_nuint_UInt32_IntPtr_nuint_nuint_nint_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, uint arg3, IntPtr arg4, nuint arg5, nuint arg6, nint arg7, nuint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_nuint_UInt64_IntPtr_nuint_nuint_nint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, ulong arg3, IntPtr arg4, nuint arg5, nuint arg6, nint arg7, nuint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_nuint_UInt64_IntPtr_nuint_nuint_nint_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, ulong arg3, IntPtr arg4, nuint arg5, nuint arg6, nint arg7, nuint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_IntPtr_nuint(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_IntPtr_nuint(IntPtr receiver, IntPtr selector, uint arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_IntPtr_nuint(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_IntPtr_nuint(IntPtr receiver, IntPtr selector, ulong arg1, IntPtr arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_UInt32_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3, nuint arg4, IntPtr arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_UInt32_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3, nuint arg4, IntPtr arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt64_UInt64_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3, nuint arg4, IntPtr arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt64_UInt64_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, IntPtr arg3, nuint arg4, IntPtr arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_nuint_nuint_IntPtr_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, nuint arg3, IntPtr arg4, nuint arg5, nuint arg6, nuint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_nuint_nuint_IntPtr_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, nuint arg3, IntPtr arg4, nuint arg5, nuint arg6, nuint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, nuint arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, nuint arg3, IntPtr arg4, nuint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_nuint_nuint_IntPtr_nuint_IntPtr_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, nuint arg3, IntPtr arg4, nuint arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_nuint_nuint_IntPtr_nuint_IntPtr_nuint_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, nuint arg3, IntPtr arg4, nuint arg5, IntPtr arg6, nuint arg7, nuint arg8, nuint arg9);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_IntPtr_nuint_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, nuint arg3, IntPtr arg4, nuint arg5, IntPtr arg6, nuint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_IntPtr_nuint_IntPtr_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, nuint arg1, IntPtr arg2, nuint arg3, IntPtr arg4, nuint arg5, IntPtr arg6, nuint arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MTLClearColor MTLClearColor_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MTLClearColor MTLClearColor_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MTLClearColor_objc_msgSend_stret(out MTLClearColor retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MTLClearColor_objc_msgSendSuper_stret(out MTLClearColor retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MTLClearColor(IntPtr receiver, IntPtr selector, MTLClearColor arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MTLClearColor(IntPtr receiver, IntPtr selector, MTLClearColor arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_UInt32_NSRange_NSRange(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, NSRange arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_UInt32_NSRange_NSRange(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, NSRange arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_UInt64_NSRange_NSRange(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, NSRange arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_UInt64_NSRange_NSRange(IntPtr receiver, IntPtr selector, ulong arg1, ulong arg2, NSRange arg3, NSRange arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_nuint_MTLRegion_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLRegion arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_nuint_MTLRegion_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, MTLRegion arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nuint_MTLRegion_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, MTLRegion arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nuint_MTLRegion_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, MTLRegion arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MTLRegion_nuint_nuint_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, MTLRegion arg1, nuint arg2, nuint arg3, IntPtr arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MTLRegion_nuint_nuint_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, MTLRegion arg1, nuint arg2, nuint arg3, IntPtr arg4, nuint arg5, nuint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MTLRegion_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, MTLRegion arg1, nuint arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MTLRegion_nuint_IntPtr_nuint(IntPtr receiver, IntPtr selector, MTLRegion arg1, nuint arg2, IntPtr arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_nuint_nuint_bool(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_nuint_nuint_bool(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, nuint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_nuint_nuint_bool(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_nuint_nuint_bool(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, nuint arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_nuint_bool(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_nuint_bool(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_nuint_bool(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_nuint_bool(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nfloat_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nfloat_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox MDLAxisAlignedBoundingBox_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox MDLAxisAlignedBoundingBox_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MDLAxisAlignedBoundingBox_objc_msgSend_stret(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MDLAxisAlignedBoundingBox_objc_msgSendSuper_stret(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_bool_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, bool arg4, ref IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSend_stret_Double(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSendSuper_stret_Double(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float_int_IntPtr(IntPtr receiver, IntPtr selector, float arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float_int_IntPtr(IntPtr receiver, IntPtr selector, float arg1, int arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float_Int64_IntPtr(IntPtr receiver, IntPtr selector, float arg1, long arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float_Int64_IntPtr(IntPtr receiver, IntPtr selector, float arg1, long arg2, IntPtr arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix4 xamarin_simd__Matrix4_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix4 xamarin_simd__Matrix4_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix4_objc_msgSend_stret(out Matrix4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix4_objc_msgSendSuper_stret(out Matrix4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_MDLAxisAlignedBoundingBox_bool(IntPtr receiver, IntPtr selector, MDLAxisAlignedBoundingBox arg1, bool arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_MDLAxisAlignedBoundingBox_bool(IntPtr receiver, IntPtr selector, MDLAxisAlignedBoundingBox arg1, bool arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Vector3_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Vector3_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSend_Vector2i_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1, Vector2i arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSendSuper_Vector2i_Vector2i(IntPtr receiver, IntPtr selector, Vector2i arg1, Vector2i arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSend_stret_Vector2i_Vector2i(out Vector3 retval, IntPtr receiver, IntPtr selector, Vector2i arg1, Vector2i arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSendSuper_stret_Vector2i_Vector2i(out Vector3 retval, IntPtr receiver, IntPtr selector, Vector2i arg1, Vector2i arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_bool_IntPtr_Vector2i_nint_nuint_int_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, Vector2i arg4, nint arg5, nuint arg6, int arg7, bool arg8);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_bool_IntPtr_Vector2i_nint_nuint_int_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, Vector2i arg4, nint arg5, nuint arg6, int arg7, bool arg8);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_bool_IntPtr_Vector2i_nint_nuint_Int64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, Vector2i arg4, nint arg5, nuint arg6, long arg7, bool arg8);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_bool_IntPtr_Vector2i_nint_nuint_Int64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, Vector2i arg4, nint arg5, nuint arg6, long arg7, bool arg8);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_IntPtr_Vector2i_int_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, int arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_IntPtr_Vector2i_int_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, int arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_IntPtr_Vector2i_int_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, long arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_IntPtr_Vector2i_int_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, long arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_float_IntPtr_Vector2i(IntPtr receiver, IntPtr selector, float arg1, float arg2, IntPtr arg3, Vector2i arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_float_IntPtr_Vector2i(IntPtr receiver, IntPtr selector, float arg1, float arg2, IntPtr arg3, Vector2i arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr_Vector2i(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, Vector2i arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_Vector2i(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, Vector2i arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_IntPtr_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_MDLAxisAlignedBoundingBox(IntPtr receiver, IntPtr selector, MDLAxisAlignedBoundingBox arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_MDLAxisAlignedBoundingBox(IntPtr receiver, IntPtr selector, MDLAxisAlignedBoundingBox arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector4 xamarin_simd__Vector4_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector4 xamarin_simd__Vector4_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector4_objc_msgSend_stret(out Vector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector4_objc_msgSendSuper_stret(out Vector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Matrix4(IntPtr receiver, IntPtr selector, Matrix4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Matrix4(IntPtr receiver, IntPtr selector, Matrix4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt32_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt32_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt64_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt64_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Vector2 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt32_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Vector3 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt32_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Vector3 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt64_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Vector3 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt64_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Vector3 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt32_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Vector4 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt32_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Vector4 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt64_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Vector4 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt64_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Vector4 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt32_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Matrix4 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt32_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, Matrix4 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_UInt64_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Matrix4 arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_UInt64_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, Matrix4 arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSend_stret(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSendSuper_stret(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_IntPtr_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4, nint arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt32_IntPtr_IntPtr_nint_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4, nint arg5, double arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt32_IntPtr_IntPtr_nint_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, IntPtr arg4, nint arg5, double arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_IntPtr_IntPtr_nint_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4, nint arg5, double arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_IntPtr_IntPtr_nint_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, IntPtr arg4, nint arg5, double arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector3i_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, bool arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector3i_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, bool arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector3i_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, bool arg3, long arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector3i_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, bool arg3, long arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, long arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, long arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_bool_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_bool_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_bool_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, long arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_bool_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, long arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_bool_bool_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, bool arg5, int arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_bool_bool_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, bool arg5, int arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_bool_bool_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, bool arg5, long arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_bool_bool_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, bool arg3, bool arg4, bool arg5, long arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_int_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, int arg3, bool arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_int_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, int arg3, bool arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_int_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, int arg3, bool arg4, long arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_int_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, int arg3, bool arg4, long arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector2i_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector2i_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector2i arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, bool arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_bool_int_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, bool arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, bool arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, bool arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_int_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_int_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, uint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector3i_int_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, int arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector3i_int_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, int arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_Vector3i_Int64_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, long arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_Vector3i_Int64_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, Vector3i arg2, long arg3, bool arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector2_Vector2i_int_IntPtr(IntPtr receiver, IntPtr selector, Vector2 arg1, Vector2i arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector2_Vector2i_int_IntPtr(IntPtr receiver, IntPtr selector, Vector2 arg1, Vector2i arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector2_Vector2i_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector2 arg1, Vector2i arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector2_Vector2i_Int64_IntPtr(IntPtr receiver, IntPtr selector, Vector2 arg1, Vector2i arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_nuint_nuint_int_bool_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, nuint arg2, nuint arg3, int arg4, bool arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_nuint_nuint_int_bool_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, nuint arg2, nuint arg3, int arg4, bool arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector3_nuint_nuint_Int64_bool_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, nuint arg2, nuint arg3, long arg4, bool arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector3_nuint_nuint_Int64_bool_bool_IntPtr(IntPtr receiver, IntPtr selector, Vector3 arg1, nuint arg2, nuint arg3, long arg4, bool arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_Vector2_nuint_nuint_int_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, int arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_Vector2_nuint_nuint_int_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, int arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_Vector2_nuint_nuint_Int64_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, long arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_Vector2_nuint_nuint_Int64_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, long arg5, bool arg6, IntPtr arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_Vector2_nuint_nuint_nuint_int_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, nuint arg5, int arg6, bool arg7, IntPtr arg8);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_Vector2_nuint_nuint_nuint_int_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, nuint arg5, int arg6, bool arg7, IntPtr arg8);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_Vector2_nuint_nuint_nuint_Int64_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, nuint arg5, long arg6, bool arg7, IntPtr arg8);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_Vector2_nuint_nuint_nuint_Int64_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, Vector2 arg2, nuint arg3, nuint arg4, nuint arg5, long arg6, bool arg7, IntPtr arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float_bool_IntPtr(IntPtr receiver, IntPtr selector, float arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float_bool_int_IntPtr(IntPtr receiver, IntPtr selector, float arg1, bool arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float_bool_int_IntPtr(IntPtr receiver, IntPtr selector, float arg1, bool arg2, int arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, float arg1, bool arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float_bool_Int64_IntPtr(IntPtr receiver, IntPtr selector, float arg1, bool arg2, long arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern bool xamarin_simd__bool_objc_msgSend_Vector2i_nint_float_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, Vector2i arg1, nint arg2, float arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern bool xamarin_simd__bool_objc_msgSendSuper_Vector2i_nint_float_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, Vector2i arg1, nint arg2, float arg3, IntPtr arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_float_float_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, float arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_float_float_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, float arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_nint_float_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, float arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_nint_float_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, float arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_float_float_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, float arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_float_float_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, float arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern bool xamarin_simd__bool_objc_msgSend_Vector2i_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, Vector2i arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern bool xamarin_simd__bool_objc_msgSendSuper_Vector2i_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, Vector2i arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_float_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_float_IntPtr_IntPtr_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt32_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt32_nuint(IntPtr receiver, IntPtr selector, uint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt64_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt64_nuint(IntPtr receiver, IntPtr selector, ulong arg1, nuint arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_IntPtr_Vector2i_int(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_IntPtr_Vector2i_int(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_IntPtr_Vector2i_Int64(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, long arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_IntPtr_Vector2i_Int64(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, long arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_IntPtr_Vector2i_int_int_bool(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, int arg5, bool arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_IntPtr_Vector2i_int_int_bool(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, int arg5, bool arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_float_IntPtr_Vector2i_int_Int64_bool(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, long arg5, bool arg6);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_float_IntPtr_Vector2i_int_Int64_bool(IntPtr receiver, IntPtr selector, float arg1, IntPtr arg2, Vector2i arg3, int arg4, long arg5, bool arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, float arg3, float arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, float arg3, float arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_ref_Boolean(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_ref_Boolean(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, ref bool arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_int_Vector2i_float_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, Vector2i arg3, float arg4, float arg5, float arg6, float arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_int_Vector2i_float_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, Vector2i arg3, float arg4, float arg5, float arg6, float arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Int64_Vector2i_float_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, Vector2i arg3, float arg4, float arg5, float arg6, float arg7);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Int64_Vector2i_float_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, Vector2i arg3, float arg4, float arg5, float arg6, float arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nuint_UInt32_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, uint arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nuint_UInt32_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, uint arg4, int arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nuint_UInt64_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, ulong arg4, long arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nuint_UInt64_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, ulong arg4, long arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_UInt32_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, uint arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_UInt32_int_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, uint arg3, int arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_UInt64_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ulong arg3, long arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_UInt64_Int64_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, ulong arg3, long arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nuint_UInt32_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, uint arg4, int arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nuint_UInt32_int_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, uint arg4, int arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nuint_UInt64_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, ulong arg4, long arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nuint_UInt64_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, ulong arg4, long arg5, IntPtr arg6, IntPtr arg7);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_int(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_int(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, long arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_IntPtr_Vector2i(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, Vector2i arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_IntPtr_Vector2i(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, Vector2i arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_IntPtr_Vector2i_float(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, Vector2i arg3, float arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_IntPtr_Vector2i_float(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, Vector2i arg3, float arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Matrix4(IntPtr receiver, IntPtr selector, Matrix4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Matrix4(IntPtr receiver, IntPtr selector, Matrix4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Matrix4_bool(IntPtr receiver, IntPtr selector, Matrix4 arg1, bool arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Matrix4_bool(IntPtr receiver, IntPtr selector, Matrix4 arg1, bool arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSend_stret_Double(out Vector3 retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSendSuper_stret_Double(out Vector3 retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix4 xamarin_simd__Matrix4_objc_msgSend_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix4 xamarin_simd__Matrix4_objc_msgSendSuper_Double(IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix4_objc_msgSend_stret_Double(out Matrix4 retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix4_objc_msgSendSuper_stret_Double(out Matrix4 retval, IntPtr receiver, IntPtr selector, double arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Vector3_Double(IntPtr receiver, IntPtr selector, Vector3 arg1, double arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Vector3_Double(IntPtr receiver, IntPtr selector, Vector3 arg1, double arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Matrix4_Double(IntPtr receiver, IntPtr selector, Matrix4 arg1, double arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Matrix4_Double(IntPtr receiver, IntPtr selector, Matrix4 arg1, double arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix4 xamarin_simd__Matrix4_objc_msgSend_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix4 xamarin_simd__Matrix4_objc_msgSendSuper_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix4_objc_msgSend_stret_IntPtr_Double(out Matrix4 retval, IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix4_objc_msgSendSuper_stret_IntPtr_Double(out Matrix4 retval, IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern MDLVoxelIndexExtent2 MDLVoxelIndexExtent_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern MDLVoxelIndexExtent2 MDLVoxelIndexExtent_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void MDLVoxelIndexExtent_objc_msgSend_stret(out MDLVoxelIndexExtent2 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void MDLVoxelIndexExtent_objc_msgSendSuper_stret(out MDLVoxelIndexExtent2 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_int_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, int arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_int_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, int arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3, float arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3, float arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_MDLAxisAlignedBoundingBox_float(IntPtr receiver, IntPtr selector, IntPtr arg1, MDLAxisAlignedBoundingBox arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_MDLAxisAlignedBoundingBox_float(IntPtr receiver, IntPtr selector, IntPtr arg1, MDLAxisAlignedBoundingBox arg2, float arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern bool xamarin_simd__bool_objc_msgSend_Vector4i_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, Vector4i arg1, bool arg2, bool arg3, bool arg4, bool arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern bool xamarin_simd__bool_objc_msgSendSuper_Vector4i_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, Vector4i arg1, bool arg2, bool arg3, bool arg4, bool arg5);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Vector4i(IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Vector4i(IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_int_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, int arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_int_int_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, int arg3, int arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3, float arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_float_float_float(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, float arg3, float arg4, float arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_MDLVoxelIndexExtent(IntPtr receiver, IntPtr selector, MDLVoxelIndexExtent2 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_MDLVoxelIndexExtent(IntPtr receiver, IntPtr selector, MDLVoxelIndexExtent2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector4i xamarin_simd__Vector4i_objc_msgSend_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector4i xamarin_simd__Vector4i_objc_msgSendSuper_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector4i_objc_msgSend_stret_Vector3(out Vector4i retval, IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector4i_objc_msgSendSuper_stret_Vector3(out Vector4i retval, IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSend_Vector4i(IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSendSuper_Vector4i(IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSend_stret_Vector4i(out Vector3 retval, IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSendSuper_stret_Vector4i(out Vector3 retval, IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSend_Vector4i(IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern MDLAxisAlignedBoundingBox xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSendSuper_Vector4i(IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSend_stret_Vector4i(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__MDLAxisAlignedBoundingBox_objc_msgSendSuper_stret_Vector4i(out MDLAxisAlignedBoundingBox retval, IntPtr receiver, IntPtr selector, Vector4i arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, IntPtr arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_byte(IntPtr receiver, IntPtr selector, IntPtr arg1, byte arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_byte(IntPtr receiver, IntPtr selector, IntPtr arg1, byte arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nuint_nuint_IntPtr(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_bool(IntPtr receiver, IntPtr selector, nuint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_bool(IntPtr receiver, IntPtr selector, nuint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern NSEdgeInsets NSEdgeInsets_objc_msgSend_NSEdgeInsets(IntPtr receiver, IntPtr selector, NSEdgeInsets arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern NSEdgeInsets NSEdgeInsets_objc_msgSendSuper_NSEdgeInsets(IntPtr receiver, IntPtr selector, NSEdgeInsets arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void NSEdgeInsets_objc_msgSend_stret_NSEdgeInsets(out NSEdgeInsets retval, IntPtr receiver, IntPtr selector, NSEdgeInsets arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void NSEdgeInsets_objc_msgSendSuper_stret_NSEdgeInsets(out NSEdgeInsets retval, IntPtr receiver, IntPtr selector, NSEdgeInsets arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGPoint_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, IntPtr arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGPoint_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, IntPtr arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nint_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nint_IntPtr_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, nint arg2, IntPtr arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_int(IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_int(out CGRect retval, IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_int(out CGRect retval, IntPtr receiver, IntPtr selector, int arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSend_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGRect CGRect_objc_msgSendSuper_Int64(IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSend_stret_Int64(out CGRect retval, IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void CGRect_objc_msgSendSuper_stret_Int64(out CGRect retval, IntPtr receiver, IntPtr selector, long arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_int(IntPtr receiver, IntPtr selector, CGRect arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_int(IntPtr receiver, IntPtr selector, CGRect arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGRect_Int64(IntPtr receiver, IntPtr selector, CGRect arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGRect_Int64(IntPtr receiver, IntPtr selector, CGRect arg1, long arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_int_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_int_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_Int64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_Int64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern int int_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern int int_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern long Int64_objc_msgSend_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern long Int64_objc_msgSendSuper_CGPoint(IntPtr receiver, IntPtr selector, CGPoint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_int(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_int(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, int arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_Int64(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, long arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_bool(IntPtr receiver, IntPtr selector, CGPoint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_bool(IntPtr receiver, IntPtr selector, CGPoint arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSend_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nfloat nfloat_objc_msgSendSuper_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGSize_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGSize_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern QTTime QTTime_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern QTTime QTTime_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void QTTime_objc_msgSend_stret(out QTTime retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void QTTime_objc_msgSendSuper_stret(out QTTime retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_QTTime(IntPtr receiver, IntPtr selector, QTTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_QTTime(IntPtr receiver, IntPtr selector, QTTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_QTTimeRange_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_QTTimeRange_ref_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_QTTimeRange_ref_IntPtr(IntPtr receiver, IntPtr selector, QTTimeRange arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_QTTimeRange_ref_IntPtr(IntPtr receiver, IntPtr selector, QTTimeRange arg1, ref IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_QTTime(IntPtr receiver, IntPtr selector, QTTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_QTTime(IntPtr receiver, IntPtr selector, QTTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_QTTime_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, QTTime arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_QTTime_IntPtr_ref_IntPtr(IntPtr receiver, IntPtr selector, QTTime arg1, IntPtr arg2, ref IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_QTTimeRange(IntPtr receiver, IntPtr selector, QTTimeRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_QTTimeRange(IntPtr receiver, IntPtr selector, QTTimeRange arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_QTTimeRange_QTTime(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_QTTimeRange_QTTime(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_QTTimeRange_QTTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_QTTimeRange_QTTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_QTTimeRange_QTTime(IntPtr receiver, IntPtr selector, QTTimeRange arg1, QTTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_QTTimeRange_QTTime(IntPtr receiver, IntPtr selector, QTTimeRange arg1, QTTime arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_QTTime_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTime arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_QTTime_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTime arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_QTTimeRange_QTTime(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_QTTimeRange_QTTime(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTime arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_QTTimeRange_QTTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_QTTimeRange_QTTimeRange(IntPtr receiver, IntPtr selector, IntPtr arg1, QTTimeRange arg2, QTTimeRange arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern QTTime QTTime_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern QTTime QTTime_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void QTTime_objc_msgSend_stret_nint(out QTTime retval, IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void QTTime_objc_msgSendSuper_stret_nint(out QTTime retval, IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern nint nint_objc_msgSend_QTTime(IntPtr receiver, IntPtr selector, QTTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern nint nint_objc_msgSendSuper_QTTime(IntPtr receiver, IntPtr selector, QTTime arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGSize_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGSize_IntPtr(IntPtr receiver, IntPtr selector, CGSize arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_nfloat_Double(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_nfloat_Double(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_SCNVector3_Double(IntPtr receiver, IntPtr selector, SCNVector3 arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_SCNVector3_Double(IntPtr receiver, IntPtr selector, SCNVector3 arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_SCNVector3_Double(IntPtr receiver, IntPtr selector, nfloat arg1, SCNVector3 arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_SCNVector3_Double(IntPtr receiver, IntPtr selector, nfloat arg1, SCNVector3 arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_nfloat_Double_bool(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, double arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_nfloat_Double_bool(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, nfloat arg3, double arg4, bool arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_SCNVector4_Double(IntPtr receiver, IntPtr selector, SCNVector4 arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_SCNVector4_Double(IntPtr receiver, IntPtr selector, SCNVector4 arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_Double(IntPtr receiver, IntPtr selector, nfloat arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_Double(IntPtr receiver, IntPtr selector, nfloat arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_SCNVector3_ref_SCNVector3(IntPtr receiver, IntPtr selector, ref SCNVector3 arg1, ref SCNVector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_SCNVector3_ref_SCNVector3(IntPtr receiver, IntPtr selector, ref SCNVector3 arg1, ref SCNVector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_ref_SCNVector3_ref_SCNVector3(IntPtr receiver, IntPtr selector, ref SCNVector3 arg1, ref SCNVector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_ref_SCNVector3_ref_SCNVector3(IntPtr receiver, IntPtr selector, ref SCNVector3 arg1, ref SCNVector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_ref_SCNVector3_ref_nfloat(IntPtr receiver, IntPtr selector, ref SCNVector3 arg1, ref nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_ref_SCNVector3_ref_nfloat(IntPtr receiver, IntPtr selector, ref SCNVector3 arg1, ref nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_SCNMatrix4(IntPtr receiver, IntPtr selector, SCNMatrix4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_SCNMatrix4(IntPtr receiver, IntPtr selector, SCNMatrix4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Int64_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Int64_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, nint arg3, nint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nint_bool_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, bool arg4, nint arg5, nint arg6, nint arg7, nint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nint_bool_nint_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nint arg3, bool arg4, nint arg5, nint arg6, nint arg7, nint arg8);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, nint arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_IntPtr_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, nint arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt64_IntPtr_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, nint arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt64_IntPtr_nint_nint_nint(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, IntPtr arg3, nint arg4, nint arg5, nint arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_SCNVector3(IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_SCNVector3(IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern SCNVector3 SCNVector3_objc_msgSend_SCNVector3(IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern SCNVector3 SCNVector3_objc_msgSendSuper_SCNVector3(IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void SCNVector3_objc_msgSend_stret_SCNVector3(out SCNVector3 retval, IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void SCNVector3_objc_msgSendSuper_stret_SCNVector3(out SCNVector3 retval, IntPtr receiver, IntPtr selector, SCNVector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_nfloat_nuint(IntPtr receiver, IntPtr selector, nfloat arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_nfloat_nuint(IntPtr receiver, IntPtr selector, nfloat arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_SCNVector4(IntPtr receiver, IntPtr selector, SCNVector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_SCNVector4(IntPtr receiver, IntPtr selector, SCNVector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern SCNQuaternion SCNQuaternion_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern SCNQuaternion SCNQuaternion_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void SCNQuaternion_objc_msgSend_stret(out SCNQuaternion retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void SCNQuaternion_objc_msgSendSuper_stret(out SCNQuaternion retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_SCNQuaternion(IntPtr receiver, IntPtr selector, SCNQuaternion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_SCNQuaternion(IntPtr receiver, IntPtr selector, SCNQuaternion arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern SCNVector3 SCNVector3_objc_msgSend_SCNVector3_IntPtr(IntPtr receiver, IntPtr selector, SCNVector3 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern SCNVector3 SCNVector3_objc_msgSendSuper_SCNVector3_IntPtr(IntPtr receiver, IntPtr selector, SCNVector3 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void SCNVector3_objc_msgSend_stret_SCNVector3_IntPtr(out SCNVector3 retval, IntPtr receiver, IntPtr selector, SCNVector3 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void SCNVector3_objc_msgSendSuper_stret_SCNVector3_IntPtr(out SCNVector3 retval, IntPtr receiver, IntPtr selector, SCNVector3 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern SCNMatrix4 SCNMatrix4_objc_msgSend_SCNMatrix4_IntPtr(IntPtr receiver, IntPtr selector, SCNMatrix4 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern SCNMatrix4 SCNMatrix4_objc_msgSendSuper_SCNMatrix4_IntPtr(IntPtr receiver, IntPtr selector, SCNMatrix4 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void SCNMatrix4_objc_msgSend_stret_SCNMatrix4_IntPtr(out SCNMatrix4 retval, IntPtr receiver, IntPtr selector, SCNMatrix4 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void SCNMatrix4_objc_msgSendSuper_stret_SCNMatrix4_IntPtr(out SCNMatrix4 retval, IntPtr receiver, IntPtr selector, SCNMatrix4 arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_SCNVector3_SCNVector3_IntPtr(IntPtr receiver, IntPtr selector, SCNVector3 arg1, SCNVector3 arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_SCNVector3_SCNVector3_IntPtr(IntPtr receiver, IntPtr selector, SCNVector3 arg1, SCNVector3 arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_SCNVector3_IntPtr_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2, IntPtr arg3, SCNVector3 arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_SCNVector3_IntPtr_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2, IntPtr arg3, SCNVector3 arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_SCNVector3_bool(IntPtr receiver, IntPtr selector, SCNVector3 arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_SCNVector3_bool(IntPtr receiver, IntPtr selector, SCNVector3 arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_SCNVector3_SCNVector3_bool(IntPtr receiver, IntPtr selector, SCNVector3 arg1, SCNVector3 arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_SCNVector3_SCNVector3_bool(IntPtr receiver, IntPtr selector, SCNVector3 arg1, SCNVector3 arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_SCNVector4_bool(IntPtr receiver, IntPtr selector, SCNVector4 arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_SCNVector4_bool(IntPtr receiver, IntPtr selector, SCNVector4 arg1, bool arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_SCNVector3_SCNVector3_IntPtr_SCNVector3_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2, SCNVector3 arg3, IntPtr arg4, SCNVector3 arg5, SCNVector3 arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_SCNVector3_SCNVector3_IntPtr_SCNVector3_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2, SCNVector3 arg3, IntPtr arg4, SCNVector3 arg5, SCNVector3 arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_SCNVector3_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2, SCNVector3 arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_SCNVector3_SCNVector3(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNVector3 arg2, SCNVector3 arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_SCNMatrix4_SCNMatrix4_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNMatrix4 arg2, SCNMatrix4 arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_SCNMatrix4_SCNMatrix4_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNMatrix4 arg2, SCNMatrix4 arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_IntPtr_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_IntPtr_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, uint arg3, uint arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_CGSize_UInt32(IntPtr receiver, IntPtr selector, double arg1, CGSize arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_CGSize_UInt32(IntPtr receiver, IntPtr selector, double arg1, CGSize arg2, uint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Double_CGSize_UInt64(IntPtr receiver, IntPtr selector, double arg1, CGSize arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Double_CGSize_UInt64(IntPtr receiver, IntPtr selector, double arg1, CGSize arg2, ulong arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Double_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, double arg1, CGRect arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Double_CGRect_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, double arg1, CGRect arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_SCNMatrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNMatrix4 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_SCNMatrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, SCNMatrix4 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Int64_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSend_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector3 xamarin_simd__Vector3_objc_msgSendSuper_Vector3(IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSend_stret_Vector3(out Vector3 retval, IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Vector3_objc_msgSendSuper_stret_Vector3(out Vector3 retval, IntPtr receiver, IntPtr selector, Vector3 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_nfloat_Double(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_nfloat_Double(IntPtr receiver, IntPtr selector, nfloat arg1, nfloat arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGVector_Double(IntPtr receiver, IntPtr selector, CGVector arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGVector_Double(IntPtr receiver, IntPtr selector, CGVector arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_Double(IntPtr receiver, IntPtr selector, CGPoint arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_Double(IntPtr receiver, IntPtr selector, CGPoint arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_Double_bool(IntPtr receiver, IntPtr selector, nfloat arg1, double arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_Double_bool(IntPtr receiver, IntPtr selector, nfloat arg1, double arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_Double(IntPtr receiver, IntPtr selector, CGSize arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_Double(IntPtr receiver, IntPtr selector, CGSize arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Double_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, bool arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Double_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2, bool arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nfloat_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nfloat_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_bool_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_bool_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, double arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_bool_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_bool_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_IntPtr_Double(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_IntPtr_Double(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_IntPtr_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_IntPtr_nfloat(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_float_Double(IntPtr receiver, IntPtr selector, float arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_float_Double(IntPtr receiver, IntPtr selector, float arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGVector_CGPoint_Double(IntPtr receiver, IntPtr selector, CGVector arg1, CGPoint arg2, double arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGVector_CGPoint_Double(IntPtr receiver, IntPtr selector, CGVector arg1, CGPoint arg2, double arg3);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGPoint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGPoint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, IntPtr arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGVector CGVector_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGVector CGVector_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGVector(IntPtr receiver, IntPtr selector, CGVector arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGVector(IntPtr receiver, IntPtr selector, CGVector arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector4 xamarin_vector_float3__Vector4_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector4 xamarin_vector_float3__Vector4_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_vector_float3__Vector4_objc_msgSend_stret(out Vector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_vector_float3__Vector4_objc_msgSendSuper_stret(out Vector4 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_vector_float3__void_objc_msgSend_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_vector_float3__void_objc_msgSendSuper_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_Vector4(IntPtr receiver, IntPtr selector, Vector4 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_nfloat_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_nfloat_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, nfloat arg2, nuint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_CGPoint(IntPtr receiver, IntPtr selector, nfloat arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_CGPoint(IntPtr receiver, IntPtr selector, nfloat arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_CGPoint(IntPtr receiver, IntPtr selector, CGSize arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_CGPoint(IntPtr receiver, IntPtr selector, CGSize arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGVector_CGPoint(IntPtr receiver, IntPtr selector, CGVector arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGVector_CGPoint(IntPtr receiver, IntPtr selector, CGVector arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_float_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_float_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, float arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_CGPoint_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, CGPoint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_CGPoint_CGVector(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, CGVector arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_CGPoint_CGVector(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGPoint arg3, CGVector arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_CGPoint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_CGPoint_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, CGPoint arg1, CGPoint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGRect_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGRect_nfloat(IntPtr receiver, IntPtr selector, CGRect arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_CGSize_nfloat(IntPtr receiver, IntPtr selector, CGSize arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_CGSize_nfloat(IntPtr receiver, IntPtr selector, CGSize arg1, nfloat arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_ref_CGPoint_nuint(IntPtr receiver, IntPtr selector, ref CGPoint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_ref_CGPoint_nuint(IntPtr receiver, IntPtr selector, ref CGPoint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGSize arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGSize_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, uint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGSize_UInt32_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, uint arg3, uint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_CGSize(IntPtr receiver, IntPtr selector, nfloat arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_CGSize(IntPtr receiver, IntPtr selector, nfloat arg1, CGSize arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nfloat_CGSize_bool(IntPtr receiver, IntPtr selector, nfloat arg1, CGSize arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nfloat_CGSize_bool(IntPtr receiver, IntPtr selector, nfloat arg1, CGSize arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGSize_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGSize_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_CGSize_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_CGSize_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, CGSize arg2, nfloat arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_IntPtr_CGSize_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGSize arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_IntPtr_CGSize_nfloat(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, CGSize arg3, nfloat arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_nuint_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, CGSize arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_nuint_CGSize(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, CGSize arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_nuint_CGSize_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, CGSize arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_nuint_CGSize_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, CGSize arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_nuint_nuint(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, nuint arg3, nuint arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSend_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern CGPoint CGPoint_objc_msgSendSuper_nuint_nuint(IntPtr receiver, IntPtr selector, nuint arg1, nuint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_nuint_nuint_CGSize_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, CGSize arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_nuint_nuint_CGSize_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, nuint arg2, nuint arg3, CGSize arg4, IntPtr arg5, IntPtr arg6);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_Double(IntPtr receiver, IntPtr selector, int arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_Double(IntPtr receiver, IntPtr selector, int arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Vector2 Vector2_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Vector2 Vector2_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Vector2(IntPtr receiver, IntPtr selector, Vector2 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern Matrix2 Matrix2_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern Matrix2 Matrix2_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend_stret\")]\n\t\tpublic static extern void Matrix2_objc_msgSend_stret(out Matrix2 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper_stret\")]\n\t\tpublic static extern void Matrix2_objc_msgSendSuper_stret(out Matrix2 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_Matrix2(IntPtr receiver, IntPtr selector, Matrix2 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_Matrix2(IntPtr receiver, IntPtr selector, Matrix2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix2 xamarin_simd__Matrix2_objc_msgSend(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Matrix2 xamarin_simd__Matrix2_objc_msgSendSuper(IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix2_objc_msgSend_stret(out Matrix2 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__Matrix2_objc_msgSendSuper_stret(out Matrix2 retval, IntPtr receiver, IntPtr selector);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSend_Matrix2(IntPtr receiver, IntPtr selector, Matrix2 arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern void xamarin_simd__void_objc_msgSendSuper_Matrix2(IntPtr receiver, IntPtr selector, Matrix2 arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Vector2(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector2 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Vector3(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector4 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector4 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector4 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Vector4(IntPtr receiver, IntPtr selector, IntPtr arg1, Vector4 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Matrix2(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix2 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Matrix2(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix2 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Matrix2(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix2 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Matrix2(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix2 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Matrix3(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Matrix3(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix3 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Matrix3(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix3 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Matrix3(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix3 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix4 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix4 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSend_IntPtr_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix4 arg2);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern IntPtr xamarin_simd__IntPtr_objc_msgSendSuper_IntPtr_Matrix4(IntPtr receiver, IntPtr selector, IntPtr arg1, Matrix4 arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_Double(IntPtr receiver, IntPtr selector, IntPtr arg1, double arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_nint_nint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_nint_nint_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, nint arg1, nint arg2, IntPtr arg3, IntPtr arg4);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2 xamarin_simd__Vector2_objc_msgSend_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"__Internal\")]\n\t\tpublic static extern Vector2 xamarin_simd__Vector2_objc_msgSendSuper_nint(IntPtr receiver, IntPtr selector, nint arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt32_UInt32_IntPtr(IntPtr receiver, IntPtr selector, uint arg1, uint arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_UInt32_IntPtr_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, uint arg2, IntPtr arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_bool_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, IntPtr arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt16(IntPtr receiver, IntPtr selector, ushort arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt16(IntPtr receiver, IntPtr selector, ushort arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_IntPtr_UInt32_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, IntPtr arg5, uint arg6, bool arg7, bool arg8, bool arg9, bool arg10);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_bool_IntPtr_int_int_int_int_int_bool_bool_bool_bool_UInt16_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5, int arg6, int arg7, int arg8, int arg9, bool arg10, bool arg11, bool arg12, bool arg13, ushort arg14, IntPtr arg15);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_int_int_int_int_int_bool_bool_bool_bool_UInt16_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5, int arg6, int arg7, int arg8, int arg9, bool arg10, bool arg11, bool arg12, bool arg13, ushort arg14, IntPtr arg15);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_bool_IntPtr_int_int_int_int_int_bool_bool_bool_bool_UInt16_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5, int arg6, int arg7, int arg8, int arg9, bool arg10, bool arg11, bool arg12, bool arg13, ushort arg14, IntPtr arg15);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_int_int_int_int_int_bool_bool_bool_bool_UInt16_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5, int arg6, int arg7, int arg8, int arg9, bool arg10, bool arg11, bool arg12, bool arg13, ushort arg14, IntPtr arg15);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ushort UInt16_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ushort UInt16_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern short short_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern short short_objc_msgSendSuper_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_UInt16_bool_bool(IntPtr receiver, IntPtr selector, ushort arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_UInt16_bool_bool(IntPtr receiver, IntPtr selector, ushort arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_UInt16_bool_bool(IntPtr receiver, IntPtr selector, ushort arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_UInt16_bool_bool(IntPtr receiver, IntPtr selector, ushort arg1, bool arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern short short_objc_msgSend_UInt16_IntPtr(IntPtr receiver, IntPtr selector, ushort arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern short short_objc_msgSendSuper_UInt16_IntPtr(IntPtr receiver, IntPtr selector, ushort arg1, IntPtr arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern short short_objc_msgSend_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern short short_objc_msgSendSuper_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_bool_bool_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_bool_bool_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_bool_bool_IntPtr_int(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, IntPtr arg4, int arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_int_int_IntPtr_int_int_int_int_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, int arg1, int arg2, IntPtr arg3, int arg4, int arg5, int arg6, int arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_int_int_IntPtr_int_int_int_int_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, int arg1, int arg2, IntPtr arg3, int arg4, int arg5, int arg6, int arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_int_int_IntPtr_int_int_int_int_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, int arg1, int arg2, IntPtr arg3, int arg4, int arg5, int arg6, int arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_int_int_IntPtr_int_int_int_int_bool_bool_bool_bool(IntPtr receiver, IntPtr selector, int arg1, int arg2, IntPtr arg3, int arg4, int arg5, int arg6, int arg7, bool arg8, bool arg9, bool arg10, bool arg11);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_int_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_int_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, int arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSend_IntPtr_Int64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern IntPtr IntPtr_objc_msgSendSuper_IntPtr_Int64_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, long arg2, bool arg3);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_IntPtr_Double_IntPtr_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, double arg3, IntPtr arg4, IntPtr arg5);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern uint UInt32_objc_msgSend_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern uint UInt32_objc_msgSendSuper_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern ulong UInt64_objc_msgSend_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern ulong UInt64_objc_msgSendSuper_IntPtr_CGPoint(IntPtr receiver, IntPtr selector, IntPtr arg1, CGPoint arg2);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern void void_objc_msgSend_IntPtr_UInt64_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern void void_objc_msgSendSuper_IntPtr_UInt64_CGPoint_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1, ulong arg2, CGPoint arg3, IntPtr arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSend\")]\n\t\tpublic static extern bool bool_objc_msgSend_IntPtr_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, bool arg4);\n\n\t\t[DllImport(\"/usr/lib/libobjc.dylib\", EntryPoint = \"objc_msgSendSuper\")]\n\t\tpublic static extern bool bool_objc_msgSendSuper_IntPtr_bool_bool_bool(IntPtr receiver, IntPtr selector, IntPtr arg1, bool arg2, bool arg3, bool arg4);\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/ObservableNSDocument.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing AppKit;\nusing Foundation;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.Mac\n{\n\t[Register(\"ObservableNSDocument\")]\n\tpublic class ObservableNSDocument : NSDocument, IDocument\n\t{\n\t\t#region Static interface\n\n\t\tpublic static readonly ISubject<Window> DocumentOpened = new Subject<Window>();\n\n\t\tpublic static Task<IDocument> Open(AbsoluteFilePath path, bool giveFocus = false)\n\t\t{\n\t\t\tvar tcs = new TaskCompletionSource<IDocument>();\n\n\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tif (giveFocus)\n\t\t\t\t\tNSRunningApplication.CurrentApplication.Activate(NSApplicationActivationOptions.ActivateAllWindows | NSApplicationActivationOptions.ActivateIgnoringOtherWindows);\n\n\t\t\t\tvar controller = (NSDocumentController)NSDocumentController.SharedDocumentController;\n\t\t\t\tcontroller.OpenDocument(path.ToNSUrl(), giveFocus,\n\t\t\t\t\t(document, wasAlreadyOpen, error) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (error != null)\n\t\t\t\t\t\t\ttcs.TrySetException(new Exception(error.Description));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttcs.TrySetResult((ObservableNSDocument)document);\n\t\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn tcs.Task;\n\t\t}\n\n\t\t#endregion\n\n\t\treadonly Subject<byte[]> _content = new Subject<byte[]>();\n\t\tpublic IObservable<byte[]> Content\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\treadonly Subject<AbsoluteFilePath> _filePath = new Subject<AbsoluteFilePath>();\n\t\tpublic IObservable<Optional<AbsoluteFilePath>> FilePath\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\t// Called from cocoa in response to open and new\n\t\tpublic ObservableNSDocument(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{\n\t\t\tConsole.WriteLine(\"new ObservableNSDocument()\");\n\n\t\t\tvar contentObs = _content.Replay(1);\n\t\t\tContent = contentObs;\n\t\t\tcontentObs.Connect();\n\n\t\t\tvar filePath = _filePath.Select(Optional.Some).Replay(1);\n\t\t\tFilePath = filePath;\n\t\t\tfilePath.Connect();\n\t\t}\n\n\t\t// Called from cocoa during init\n\t\tNSUrl _fileUrl;\n\t\tpublic override NSUrl FileUrl\n\t\t{\n\t\t\tget { return _fileUrl; } // TODO: what i'm guessing is a bug in MonoMac causes the consistentncy check to fail on cocoa's own call to this method when we call base\n\t\t\tset\n\t\t\t{\n\t\t\t\t_filePath.OnNext(value.AbsoluteUrl.ToAbsoluteFilePath());\n\t\t\t\tbase.FileUrl = _fileUrl = value;\n\t\t\t}\n\t\t}\n\n\n\t\tbyte[] _dataWaitingForWrite = new byte[0];\n\n\t\tpublic void Write(byte[] content)\n\t\t{\n\t\t\t_dataWaitingForWrite = content;\n\t\t\tUpdateChangeCount(NSDocumentChangeType.Autosaved);\n\t\t}\n\n\t\tpublic IDialog<object> Window { get; private set; }\n\n\t\t// Called from cocoa during save (in response to UpdateChangeCount)\n\t\tpublic override NSData GetAsData(string documentType, out NSError outError)\n\t\t{\n\t\t\tConsole.WriteLine(\"GetAsData(\" + documentType + \")\");\n\t\t\toutError = null;//NSError.FromDomain (NSError.OsStatusErrorDomain, -4);\n\t\t\treturn NSData.FromArray(_dataWaitingForWrite);\n\t\t}\n\n\n\t\t// Called from cocoa during open and reload\n\t\tpublic override bool ReadFromData(NSData data, string typeName, out NSError outError)\n\t\t{\n\t\t\tConsole.WriteLine(\"ReadFromData(\" + typeName + \")\");\n\t\t\toutError = null;//NSError.FromDomain (NSError.OsStatusErrorDomain, -4);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_content.OnNext(data.AsStream().ReadAllBytes());\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(\"ReadFromData failed: \" + e);\n\t\t\t\toutError = new NSError(new NSString(\"com.fuse-x.studio\"), 1, new NSMutableDictionary()\n\t\t\t\t{\n\t\t\t\t\t{ new NSString(\"ExceptionString\"), new NSString(e.ToString()) }\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Called from cocoa during init (iff opened with create window)\n\t\tpublic override void MakeWindowControllers()\n\t\t{\n\t\t\tConsole.WriteLine(\"Getting window\");\n\t\t\tMacDialog<Unit>.ShowDocumentWindow(this, window =>\n\t\t\t{\n\t\t\t\tWindow = window;\n\t\t\t\tvar content = Fusion.Application.CreateDocumentWindow(this);\n\t\t\t\tConsole.WriteLine(\"Got window\");\n\t\t\t\tDocumentOpened.OnNext(content);\n\t\t\t\tConsole.WriteLine(\"Will show!\");\n\t\t\t\treturn content;\n\t\t\t});\n\t\t}\n\n\t\tpublic override void WindowControllerDidLoadNib (NSWindowController windowController)\n\t\t{\n\t\t\tConsole.WriteLine(\"WindowControllerDidLoadNib()\");\n\t\t\tbase.WindowControllerDidLoadNib (windowController);\n\t\t\t// Add code to here after the controller has loaded the document window\n\t\t}\n\n\t\tpublic override bool ValidateUserInterfaceItem(NSObject anItem)\n\t\t{\n\t\t\tConsole.WriteLine(\"ValidateUserInterfaceItem()\");\n\t\t\treturn base.ValidateUserInterfaceItem(anItem);\n\t\t}\n\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Outracks.Fusion.Mac.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fusion.Mac</RootNamespace>\n    <AssemblyName>Outracks.Fusion.Mac</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <UseVSHostingProcess>true</UseVSHostingProcess>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Mono.Posix-4.5.4.5.0\\lib\\net45\\Mono.Posix.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Web\" />\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"Xamarin.Mac\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\xamarin-mac\\Xamarin.Mac.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Controls\\ColorPickerImplementation.cs\" />\n    <Compile Include=\"Controls\\ContextMenuImplementation.cs\" />\n    <Compile Include=\"Controls\\DelegateObserver.cs\" />\n    <Compile Include=\"Controls\\DropDownImplementation.cs\" />\n    <Compile Include=\"Controls\\ButtonImplementation.cs\" />\n    <Compile Include=\"Controls\\LabelImplementation.cs\" />\n    <Compile Include=\"Controls\\LogViewImplementation.cs\" />\n    <Compile Include=\"Controls\\ScrollingImplementation.cs\" />\n    <Compile Include=\"Controls\\Shapes\\NSLine.cs\" />\n    <Compile Include=\"Controls\\Shapes\\NSRectangle.cs\" />\n    <Compile Include=\"Controls\\Shapes\\ShapeControl.cs\" />\n    <Compile Include=\"Controls\\WebViewImplementation.cs\" />\n    <Compile Include=\"Dispatcher.cs\" />\n    <Compile Include=\"DraggingImplementation.cs\" />\n    <Compile Include=\"EffectsImplementation.cs\" />\n    <Compile Include=\"Controls\\ImageImplementation.cs\" />\n    <Compile Include=\"Controls\\Shapes\\LineImplementation.cs\" />\n    <Compile Include=\"Controls\\Shapes\\RectangleImplementation.cs\" />\n    <Compile Include=\"Controls\\TextBoxImplementation.cs\" />\n    <Compile Include=\"DataBinding.cs\" />\n    <Compile Include=\"KeyboardImplementation.cs\" />\n    <Compile Include=\"Controls\\LayoutTrackerImplementation.cs\" />\n    <Compile Include=\"MacEnvironmentImpl.cs\" />\n    <Compile Include=\"MainThread.cs\" />\n    <Compile Include=\"Marshalling.cs\" />\n    <Compile Include=\"ObjCRuntime\\Messaging.cs\" />\n    <Compile Include=\"MonoMacNotifier.cs\" />\n    <Compile Include=\"MonoMacTrayApplication.cs\" />\n    <Compile Include=\"Application.cs\" />\n    <Compile Include=\"NSDefaultView.cs\" />\n    <Compile Include=\"ObservableNSDocument.cs\" />\n    <Compile Include=\"OverlayImplementation.cs\" />\n    <Compile Include=\"PermissionOSX.cs\" />\n    <Compile Include=\"PointerImplementation.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"MenuBuilder.cs\" />\n    <Compile Include=\"FileDialogs.cs\" />\n    <Compile Include=\"MessageBox.cs\" />\n    <Compile Include=\"MessageBoxImplementation.cs\" />\n    <Compile Include=\"AppDelegate.cs\" />\n    <Compile Include=\"AppDelegate.designer.cs\">\n      <DependentUpon>AppDelegate.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"ShellOSX.cs\" />\n    <Compile Include=\"ToolTipImplementation.cs\" />\n    <Compile Include=\"WindowImplementation.cs\" />\n    <Compile Include=\"LayeringImplementation.cs\" />\n    <Compile Include=\"Controls\\SliderImplementation.cs\" />\n    <Compile Include=\"Controls\\Shapes\\NSCircle.cs\" />\n    <Compile Include=\"Controls\\Shapes\\NSShape.cs\" />\n    <Compile Include=\"Controls\\Shapes\\CircleImplementation.cs\" />\n    <Compile Include=\"CursorsImplementation.cs\" />\n    <Compile Include=\"Transformation.cs\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fuse\\locale\\Outracks.Fuse.Locale.csproj\">\n      <Project>{0e454646-b607-4fed-ab02-becbc5620fa3}</Project>\n      <Name>Outracks.Fuse.Locale</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <None Include=\"packages.config\" />\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/fusion/mac/Outracks.Fusion.Mac.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Controls/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Controls_005CShapes/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Controls_005CTreeView/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/fusion/mac/OverlayImplementation.cs",
    "content": "using System.Reactive.Concurrency;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic static class OverlayImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tOverlay.Initialize((background, foreground) =>\n\t\t\t\tLayout.Layer(background, foreground)\n\t\t\t\t\t.WithSize(background.DesiredSize));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/PermissionOSX.cs",
    "content": "﻿using System.IO;\nusing Mono.Unix.Native;\n\nnamespace Outracks.IO\n{\n\tpublic class PermissionOSX : IFilePermission\n\t{\n\t\tpublic void SetPermission(\n\t\t\tAbsoluteFilePath file,\n\t\t\tFileSystemPermission permission,\n\t\t\tFileSystemGroup group)\n\t\t{\n\t\t\tvar permissionWithGroupBits = GetPermissionBits(permission, @group);\n\n\t\t\tSyscall.chmod(file.NativePath, (FilePermissions)permissionWithGroupBits);\n\t\t}\n\n\t\tpublic void SetPermission(\n\t\t\tAbsoluteDirectoryPath dir,\n\t\t\tFileSystemPermission permission,\n\t\t\tFileSystemGroup group,\n\t\t\tbool recursive)\n\t\t{\n\t\t\tvar permissionBits = GetPermissionBits(permission, group);\n\t\t\tSyscall.chmod(dir.NativePath, (FilePermissions)permissionBits);\n\n\t\t\tif (recursive)\n\t\t\t{\n\t\t\t\tforeach (var file in Directory.GetFiles(dir.NativePath))\n\t\t\t\t{\n\t\t\t\t\tvar filePermission = (int)permission &~ (int)FileSystemPermission.Execute;\n\t\t\t\t\tSetPermission(AbsoluteFilePath.Parse(file), (FileSystemPermission)filePermission, group);\n\t\t\t\t}\n\n\t\t\t\tforeach (var directory in Directory.GetDirectories(dir.NativePath))\n\t\t\t\t{\n\t\t\t\t\tSetPermission(AbsoluteDirectoryPath.Parse(directory), permission, group, recursive);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic int GetPermissionBits(FileSystemPermission permission, FileSystemGroup @group)\n\t\t{\n\t\t\tvar permissionBits = 0;\n\t\t\tif (permission.HasFlag(FileSystemPermission.Execute))\n\t\t\t\tpermissionBits |= (int)FilePermissions.S_IXOTH;\n\t\t\tif (permission.HasFlag(FileSystemPermission.Read))\n\t\t\t\tpermissionBits |= (int)FilePermissions.S_IROTH;\n\t\t\tif (permission.HasFlag(FileSystemPermission.Write))\n\t\t\t\tpermissionBits |= (int)FilePermissions.S_IWOTH;\n\n\t\t\tvar permissionWithGroupBits = 0;\n\t\t\tif (group.HasFlag(FileSystemGroup.Others))\n\t\t\t\tpermissionWithGroupBits |= permissionBits;\n\n\t\t\tif (group.HasFlag(FileSystemGroup.Group))\n\t\t\t\tpermissionWithGroupBits |= permissionBits << 3;\n\n\t\t\tif (group.HasFlag(FileSystemGroup.User))\n\t\t\t\tpermissionWithGroupBits |= permissionBits << 6;\n\n\t\t\treturn permissionWithGroupBits;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/PointerImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class PointerImplementation\n\t{\n\t\tstatic IScheduler _dispatcher;\n\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\t_dispatcher = dispatcher;\n\n\t\t\tPointer.Implementation.MakeHittable = MakeHittable;\n\t\t}\n\n\t\tstatic IControl MakeHittable(IControl control, Space space, Pointer.Callbacks callbacks)\n\t\t{\n\t\t\treturn Control.Create(location =>\n\t\t\t\t{\n\t\t\t\t\tcontrol.Mount(\n\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAvailableSize = location.AvailableSize,\n\t\t\t\t\t\t\tIsRooted = location.IsRooted,\n\t\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(location.NativeFrame.Size),\n\t\t\t\t\t\t});\n\n\t\t\t\t\tvar nativeHandle = control.NativeHandle as NSView;\n\n\t\t\t\t\tvar view = new HittableView(space, callbacks);\n\t\t\t\t\tif (nativeHandle != null)\n\t\t\t\t\t\tview.AddSubview(nativeHandle);\n\n\t\t\t\t\tlocation.BindNativeDefaults(view, _dispatcher);\n\n\t\t\t\t\treturn view;\n\t\t\t\t}).WithSize(control.DesiredSize);\n\t\t}\n\t}\n\n\tclass HittableView : NSDefaultView\n\t{\n\t\treadonly Space _space;\n\t\treadonly Pointer.Callbacks _callbacks;\n\n\t\tpublic HittableView(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic HittableView(Space space, Pointer.Callbacks callbacks)\n\t\t{\n\t\t\t_space = space;\n\t\t\t_callbacks = callbacks;\n\t\t\tbase.AutoresizesSubviews = false;\n\n\t\t\tvar trackingArea = new NSTrackingArea(\n\t\t\t\tnew CGRect(),\n\t\t\t\tNSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect |\n\t\t\t\tNSTrackingAreaOptions.MouseMoved | NSTrackingAreaOptions.MouseEnteredAndExited,\n\t\t\t\tthis,\n\t\t\t\tnull);\n\n\t\t\tAddTrackingArea(trackingArea);\n\t\t}\n\n\t\tpublic override bool BecomeFirstResponder()\n\t\t{\n\t\t\t_callbacks.OnGotFocus();\n\t\t\treturn base.BecomeFirstResponder();\n\t\t}\n\n\t\tpublic override bool ResignFirstResponder()\n\t\t{\n\t\t\t_callbacks.OnLostFocus();\n\t\t\treturn base.ResignFirstResponder();\n\t\t}\n\n\t\tpublic override void MouseDown(NSEvent ev)\n\t\t{\n\t\t\t_callbacks.OnPressed(new Pointer.OnPressedArgs(ToPoint(ev), (int)ev.ClickCount));\n\t\t}\n\n\t\tpublic override void MouseUp(NSEvent ev)\n\t\t{\n\t\t\t_callbacks.OnReleased();\n\t\t}\n\n\t\tpublic override void MouseDragged(NSEvent ev)\n\t\t{\n\t\t\t_callbacks.OnDragged().MatchWith(\n\t\t\t\tdata =>\n\t\t\t\t{\n\t\t\t\t\tvar pasteBoardItem = new NSPasteboardItem();\n\t\t\t\t\tpasteBoardItem.SetStringForType(\"fuse-drag-n-drop\", \"public.data\");\n\t\t\t\t\tvar draggingItem = new NSDraggingItem(pasteBoardItem);\n\n\t\t\t\t\tvar imgCache = BitmapImageRepForCachingDisplayInRect(Bounds);\n\t\t\t\t\tCacheDisplay(Bounds, imgCache);\n\t\t\t\t\tvar img = new NSImage(imgCache.Size);\n\t\t\t\t\timg.LockFocus();\n\t\t\t\t\timgCache.DrawInRect(Bounds, Bounds, NSCompositingOperation.Copy, 0.5f, true, new NSDictionary());\n\t\t\t\t\timg.UnlockFocus();\n\n\t\t\t\t\tdraggingItem.SetDraggingFrame(new CGRect(Bounds.Location, img.Size), img);\n\n\t\t\t\t\tBeginDraggingSession(new[] { draggingItem }, ev, new DragSource(this, _space, _callbacks, data));\n\t\t\t\t},\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tBeginDraggingSession(new NSDraggingItem[0], ev, new DragSource(this, _space, _callbacks, null));\n\t\t\t\t});\n\t\t}\n\n\t\tpublic override void MouseEntered(NSEvent ev)\n\t\t{\n\t\t\t_callbacks.OnEntered(ToPoint(ev));\n\t\t}\n\n\t\tpublic override void MouseExited(NSEvent ev)\n\t\t{\n\t\t\t_callbacks.OnExited(ToPoint(ev));\n\t\t}\n\n\t\tpublic override void MouseMoved(NSEvent ev)\n\t\t{\n\t\t\t_callbacks.OnMoved(ToPoint(ev));\n\t\t}\n\n\t\tPoint<Points> ToPoint(NSEvent ev)\n\t\t{\n\t\t\tif (_space == Space.Local)\n\t\t\t{\n\t\t\t\tvar localPointCocoa = ConvertPointFromView(ev.LocationInWindow, null);\n\t\t\t\treturn Point.Create<Points>((double)localPointCocoa.X, (double)(Frame.Height - localPointCocoa.Y));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Point.Create<Points>((double)ev.LocationInWindow.X, (double)(ev.Window.Frame.Height - ev.LocationInWindow.Y));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Fuse.Native-OSX\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/fusion/mac/ShellOSX.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing AppKit;\nusing Foundation;\nusing Outracks.Fusion;\n\nnamespace Outracks.IO.Native\n{\n\tpublic class ShellOSX : IOldShell\n\t{\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn \"Finder\";\n\t\t\t}\n\t\t}\n\n\t\tpublic void OpenWithDefaultApplication(AbsoluteFilePath path)\n\t\t{\n\t\t\tvar task = Application.MainThread.InvokeAsync(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tif (!NSWorkspace.SharedWorkspace.OpenFile(path.NativePath))\n\t\t\t\t\t\tthrow new Exception(\"No default application found for \" + path.NativePath);\n\t\t\t\t\treturn new object();\n\t\t\t\t});\n\n\t\t\ttask.Wait();\n\t\t}\n\n\t\tpublic FileStream Open(AbsoluteFilePath path, FileMode mode, FileAccess access, FileShare share)\n\t\t{\n\t\t\treturn File.Open(path.NativePath, mode, access, share);\n\t\t}\n\n\t\tpublic Stream OpenRead(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn File.OpenRead(path.NativePath);\n\t\t}\n\n\t\tpublic Stream OpenWrite(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn File.OpenWrite(path.NativePath);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> GetFiles(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn Directory.GetFiles(path.NativePath).Select(AbsoluteFilePath.Parse);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetDirectories(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn Directory.GetDirectories(path.NativePath).Select(AbsoluteDirectoryPath.Parse);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> GetFiles (AbsoluteDirectoryPath path, string searchPattern)\n\t\t{\n\t\t\treturn Directory.GetFiles(path.NativePath, searchPattern).Select(AbsoluteFilePath.Parse);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetDirectories (AbsoluteDirectoryPath path, string searchPattern)\n\t\t{\n\t\t\treturn Directory.GetDirectories(path.NativePath, searchPattern).Select(AbsoluteDirectoryPath.Parse);\n\t\t}\n\n\t\tpublic IAbsolutePath ResolveAbsolutePath(string nativePath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar absPath = Path.IsPathRooted(nativePath)\n\t\t\t\t\t? nativePath\n\t\t\t\t\t: Path.GetFullPath(nativePath);\n\n\t\t\t\tvar isDirectory = Directory.Exists(nativePath);\n\n\t\t\t\treturn isDirectory\n\t\t\t\t\t? (IAbsolutePath)AbsoluteDirectoryPath.Parse(absPath)\n\t\t\t\t\t: (IAbsolutePath)AbsoluteFilePath.Parse(absPath);\n\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t\tcatch (NotSupportedException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t\tcatch (PathTooLongException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Delete(IAbsolutePath path)\n\t\t{\n\t\t\tpath.Do(\n\t\t\t\t(AbsoluteFilePath file) => File.Delete(file.NativePath),\n\t\t\t\t(AbsoluteDirectoryPath directory) => Directory.Delete(directory.NativePath, true));\n\t\t}\n\n\t\tpublic bool Exists(IAbsolutePath path)\n\t\t{\n\t\t\treturn path.MatchWith(\n\t\t\t\t(AbsoluteFilePath file) => File.Exists(file.NativePath),\n\t\t\t\t(AbsoluteDirectoryPath directory) => Directory.Exists(directory.NativePath));\n\t\t}\n\n\t\tpublic void Copy(AbsoluteFilePath source, AbsoluteFilePath dest)\n\t\t{\n\t\t\tFile.Copy(source.NativePath, dest.NativePath);\n\t\t}\n\n\t\tpublic void Move(AbsoluteFilePath source, AbsoluteFilePath destination)\n\t\t{\n\t\t\tif (!ShellHelper.TryPureMove(source, destination, File.Move))\n\t\t\t{\n\t\t\t\tFile.Copy(source.NativePath, destination.NativePath);\n\t\t\t\tFile.Delete(source.NativePath);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Move(AbsoluteDirectoryPath source, AbsoluteDirectoryPath destination)\n\t\t{\n\t\t\tif (!ShellHelper.TryPureMove(source, destination, Directory.Move))\n\t\t\t{\n\t\t\t\tShellHelper.DirectoryCopy(source.NativePath, destination.NativePath, copySubDirs: true);\n\t\t\t\tDirectory.Delete(source.NativePath, recursive: true);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Create(AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\tDirectory.CreateDirectory(directory.NativePath);\n\t\t}\n\n\t\tpublic Stream Create(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn File.Open(file.NativePath, FileMode.Create);\n\t\t}\n\n\t\tpublic Stream CreateNew(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn File.Open(file.NativePath, FileMode.CreateNew);\n\t\t}\n\n\t\tpublic IObservable<Unit> Watch(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn Observable.Create<Unit>(observer =>\n\t\t\t{\n\t\t\t\tif (!Exists(path.ContainingDirectory))\n\t\t\t\t{\n\t\t\t\t\tobserver.OnError(new FileNotFoundException(\"Directory not found\", path.ContainingDirectory.NativePath));\n\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t}\n\n\t\t\t\tvar fsw = new FileSystemWatcher(path.ContainingDirectory.NativePath, path.Name.ToString())\n\t\t\t\t{\n\t\t\t\t\tNotifyFilter = NotifyFilters.CreationTime\n\t\t\t\t\t\t| NotifyFilters.FileName\n\t\t\t\t\t\t| NotifyFilters.LastWrite\n\t\t\t\t\t\t| NotifyFilters.Size,\n\t\t\t\t};\n\n\t\t\t\tvar garbage = Disposable.Combine(\n\t\t\t\t\tfsw,\n\t\t\t\t\tObservable.FromEventPattern<ErrorEventArgs>(fsw, \"Error\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnError(_.EventArgs.GetException())),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Created\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Changed\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Renamed\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Deleted\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)));\n\n\t\t\t\tfsw.EnableRaisingEvents = true;\n\n\t\t\t\treturn garbage;\n\t\t\t});\n\t\t}\n\n\t\tpublic void OpenFolder(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\tProcess.Start(path.NativePath);\n\t\t}\n\n\t\tpublic void ShowInFolder(AbsoluteFilePath path)\n\t\t{\n\t\t\tvar urls = new [] { new NSUrl(new Uri(path.NativePath).AbsoluteUri) };\n\t\t\tvar workspace = NSWorkspace.SharedWorkspace;\n\t\t\tworkspace.BeginInvokeOnMainThread(() => workspace.ActivateFileViewer (urls));\n\t\t}\n\n\t\tpublic void OpenTerminal(AbsoluteDirectoryPath containingDirectory)\n\t\t{\n\t\t\tvar t = new NSTask();\n\t\t\tt.LaunchPath = \"/usr/bin/osascript\";\n\t\t\tt.Arguments = new [] {\"-e\", \"tell application \\\"Terminal\\\"\\ndo script \\\"cd \\\\\\\"\"+containingDirectory.NativePath+\"\\\\\\\"\\\"\\nactivate\\nend tell\" };\n\t\t\tt.Launch();\n\t\t}\n\n\t\tpublic IObservable<FileSystemEventData> Watch(AbsoluteDirectoryPath path, Optional<string> filter = default(Optional<string>))\n\t\t{\n\t\t\treturn Observable.Create<FileSystemEventData>(observer =>\n\t\t\t{\n\t\t\t\tif (!Exists(path))\n\t\t\t\t{\n\t\t\t\t\tobserver.OnError(new FileNotFoundException(\"Directory not found\", path.ContainingDirectory.NativePath));\n\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t}\n\n\t\t\t\tvar fsw = filter.Select(f => new FileSystemWatcher(path.NativePath, f)).Or(new FileSystemWatcher(path.NativePath));\n\t\t\t\tfsw.IncludeSubdirectories = false;\n\t\t\t\tfsw.NotifyFilter = NotifyFilters.CreationTime\n\t\t\t\t\t| NotifyFilters.FileName\n\t\t\t\t\t| NotifyFilters.LastWrite\n\t\t\t\t\t| NotifyFilters.Size;\n\n\t\t\t\tvar garbage = Disposable.Combine(\n\t\t\t\t\tfsw,\n\t\t\t\t\tObservable.FromEventPattern<ErrorEventArgs>(fsw, \"Error\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnError(_.EventArgs.GetException())),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Changed\")\n\t\t\t\t\t\t.Subscribe(e => observer.OnNext(new FileSystemEventData(AbsoluteFilePath.Parse(e.EventArgs.FullPath), FileSystemEvent.Changed))),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Created\")\n\t\t\t\t\t\t.Subscribe(e => observer.OnNext(new FileSystemEventData(AbsoluteFilePath.Parse(e.EventArgs.FullPath), FileSystemEvent.Created))),\n\t\t\t\t\tObservable.FromEventPattern<RenamedEventArgs>(fsw, \"Renamed\")\n\t\t\t\t\t\t.Subscribe(e =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tobserver.OnNext(new FileSystemEventData(\n\t\t\t\t\t\t\t\tAbsoluteFilePath.Parse(e.EventArgs.FullPath),\n\t\t\t\t\t\t\t\tFileSystemEvent.Renamed,\n\t\t\t\t\t\t\t\tAbsoluteFilePath.Parse(e.EventArgs.OldFullPath)));\n\t\t\t\t\t\t}),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Deleted\")\n\t\t\t\t\t\t.Subscribe(e => observer.OnNext(new FileSystemEventData(AbsoluteFilePath.Parse(e.EventArgs.FullPath), FileSystemEvent.Removed))));\n\n\t\t\t\tfsw.EnableRaisingEvents = true;\n\n\t\t\t\treturn garbage;\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/ToolTipImplementation.cs",
    "content": "﻿using System.Reactive.Concurrency;\nusing AppKit;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class ToolTipImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tToolTip.Implementation.Set = (self, toolTip) =>\n\t\t\t{\n\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\tdispatcher,\n\t\t\t\t\t\"tooltip\", toolTip,\n\t\t\t\t\t(NSView view, string value) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (value == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tview.RemoveAllToolTips();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tview.ToolTip = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/Transformation.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tclass TransformerView : NSView\n\t{\n\t\tpublic TransformerView(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{\n\t\t}\n\n\t\tCGAffineTransform _currentTransform = CGAffineTransform.MakeIdentity();\n\n\t\tpublic override bool WantsUpdateLayer\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic TransformerView()\n\t\t{\n\t\t\tbase.WantsLayer = true;\n\t\t}\n\n\t\tpublic void ApplyTransformation(Matrix matrix)\n\t\t{\n\t\t\tmatrix = Matrix.Multiply(\n\t\t\t\tMatrix.Translate(Frame.Width / 2, Frame.Height / 2),\n\t\t\t\tmatrix,\n\t\t\t\tMatrix.Translate(-Frame.Width / 2, -Frame.Height / 2));\n\n\t\t\tvar xAxis = matrix.GetRow(1);\n\t\t\tvar yAxis = matrix.GetRow(2);\n\n\t\t\t_currentTransform = new CGAffineTransform(\n\t\t\t\t(float)xAxis.Item1,\n\t\t\t\t(float)yAxis.Item1,\n\t\t\t\t(float)xAxis.Item2,\n\t\t\t\t(float)yAxis.Item2,\n\t\t\t\t(float)xAxis.Item4,\n\t\t\t\t(float)yAxis.Item4);\n\t\t\tNeedsDisplay = true;\n\t\t}\n\n\t\tpublic override void UpdateLayer()\n\t\t{\n\t\t\tLayer.AffineTransform = _currentTransform;\n\t\t}\n\t}\n\n\tclass Transformation\n\t{\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tFusion.Transformation.Initialize(FixedPositionFactory);\n\t\t\tFusion.Transformation.Initialize(Transform);\n\t\t}\n\n\t\tstatic IControl Transform(IControl ctrl, IObservable<Matrix> matrix)\n\t\t{\n\t\t\treturn Control.Create(location =>\n\t\t\t{\n\t\t\t\tctrl.Mount(\n\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t{\n\t\t\t\t\t\tAvailableSize = location.AvailableSize,\n\t\t\t\t\t\tIsRooted = location.IsRooted,\n\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(ctrl.DesiredSize),\n\t\t\t\t\t});\n\n\t\t\t\tvar nativeHandle = ctrl.NativeHandle as NSView;\n\t\t\t\tvar containerView = new TransformerView();\n\t\t\t\tcontainerView.AddSubview(nativeHandle);\n\n\t\t\t\tlocation.BindNativeDefaults(containerView, Fusion.Application.MainThread);\n\t\t\t\tlocation.BindNativeProperty(Fusion.Application.MainThread, \"transformation\", matrix,\n\t\t\t\t\tmat =>\n\t\t\t\t\t{\n\t\t\t\t\t\tcontainerView.ApplyTransformation(mat);\n\t\t\t\t\t});\n\n\t\t\t\treturn containerView;\n\t\t\t})\n\t\t\t.WithSize(\n\t\t\t\tObservableMath\n\t\t\t\t\t.RectangleWithSize(ctrl.DesiredSize)\n\t\t\t\t\t.Transpose()\n\t\t\t\t\t.Transform(matrix)\n\t\t\t\t\t.Transpose()\n\t\t\t\t\t.Size);\n\t\t}\n\n\t\tstatic IControl FixedPositionFactory(IControl ctrl, Rectangle<IObservable<Points>> frame)\n\t\t{\n\t\t\treturn Control.Create(\n\t\t\t\t\tmount =>\n\t\t\t\t\t{\n\t\t\t\t\t\tctrl.Mount(new MountLocation.Mutable()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIsRooted = mount.IsRooted,\n\t\t\t\t\t\t\tAvailableSize = mount.AvailableSize,\n\t\t\t\t\t\t\tNativeFrame = Rectangle.FromPositionSize(\n\t\t\t\t\t\t\t\tframe.Position.X,\n\t\t\t\t\t\t\t\tmount.NativeFrame.Height\n\t\t\t\t\t\t\t\t\t.CombineLatest(frame.Position.Y, frame.Height)\n\t\t\t\t\t\t\t\t\t.Select(t => t.Item1 - t.Item2 - t.Item3), // Flip Y position\n\t\t\t\t\t\t\t\tframe.Width,\n\t\t\t\t\t\t\t\tframe.Height)\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn ctrl.NativeHandle;\n\t\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/mac/WindowImplementation.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing AppKit;\nusing CoreGraphics;\nusing Foundation;\nusing Outracks.Fuse.Analytics;\n\nnamespace Outracks.Fusion.Mac\n{\n\tstatic class CustomWindowNotifications\n\t{\n\t\tpublic static string WindowMakeFirstResponder { get { return \"WindowMakeFirstResponder\"; } }\n\t}\n\n\tpublic class CustomWindow : NSWindow\n\t{\n\t\treadonly Subject<Unit> _focused = new Subject<Unit>();\n\n\t\treadonly BehaviorSubject<bool> _isShowing = new BehaviorSubject<bool>(true);\n\t\tpublic IObservable<bool> IsShowing { get { return _isShowing; }}\n\n\t\tpublic CustomWindow(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic CustomWindow(Command focused)\n\t\t{\n\t\t\tfocused.Execute.Sample(_focused).Subscribe(c => c());\n\t\t}\n\n\t\tpublic override bool MakeFirstResponder(NSResponder aResponder)\n\t\t{\n\t\t\tvar result = base.MakeFirstResponder(aResponder);\n\t\t\tif (result)\n\t\t\t{\n\t\t\t\tvar notification = NSNotification.FromName(CustomWindowNotifications.WindowMakeFirstResponder, aResponder);\n\t\t\t\tNSNotificationCenter.DefaultCenter.PostNotification(notification);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic override bool CanBecomeKeyWindow\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\t// Updated by the window controller when a window title is requested for the document name\n\t\t//  Note that this may not actually happen if our window doesn't have a document, but that's\n\t\t//  not really a case we care about.\n\t\tpublic readonly ISubject<string> DocumentTitle = new BehaviorSubject<string>(\"\");\n\n\t\tpublic readonly ISubject<NSButton> DocumentIconButton = new ReplaySubject<NSButton>(1);\n\n\n\t\tpublic override void MakeKeyAndOrderFront(NSObject sender)\n\t\t{\n\t\t\tNSApplication.SharedApplication.ActivateIgnoringOtherApps(true);\n\t\t\tbase.MakeKeyAndOrderFront(sender);\n\n\t\t\t// This icon never seems to be available at window creation; it gets created sometime later, but\n\t\t\t//  before MakeKeyAndOrderFront is called it seems\n\t\t\tvar button = StandardWindowButton(NSWindowButton.DocumentIconButton);\n\n\t\t\t// Hide title bar (note that other elements like the traffic light buttons will still be shown)\n\t\t\t//  This must be done _after_ we grab the DocumentIconButton from the window, otherwise we're unable\n\t\t\t//  to get a reference to it in the first place.\n\t\t\tTitleVisibility = NSWindowTitleVisibility.Hidden;\n\n\t\t\tif (button != null) // This shouldn't happen for a document window, but can happen.\n\t\t\t\tDocumentIconButton.OnNext(button);\n\n\t\t\t_focused.OnNext(Unit.Default);\n\t\t\t_isShowing.OnNext(true);\n\t\t}\n\n\t\tpublic override void OrderOut(NSObject sender)\n\t\t{\n\t\t\tbase.OrderOut(sender);\n\t\t\t_isShowing.OnNext(false);\n\t\t}\n\n\t\tpublic readonly ISubject<bool> IsRooted = new ReplaySubject<bool>(1);\n\t}\n\n\tclass DocumentWindowController : NSWindowController\n\t{\n\t\tpublic DocumentWindowController(CustomWindow window)\n\t\t\t: base(window)\n\t\t{\n\t\t}\n\n\t\tpublic DocumentWindowController(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic override string WindowTitleForDocumentDisplayName(string displayName)\n\t\t{\n\t\t\tvar res = base.WindowTitleForDocumentDisplayName(displayName);\n\n\t\t\tvar window = (CustomWindow)Window;\n\t\t\twindow.DocumentTitle.OnNext(res);\n\n\t\t\treturn res;\n\t\t}\n\t}\n\n\tpublic static class WindowImplementation\n\n\t{\n\t\tstatic int _WindowCount = 0;\n\n\t\tpublic static CustomWindow Create(Window model, Optional<ObservableNSDocument> document)\n\t\t{\n\t\t\tvar dispatcher = Fusion.Application.MainThread;\n\n\t\t\tmodel.Title = model.Title.Select(title => model.HideTitle ? \"\" : title);\n\n\t\t\tvar sizeFeedback = model.Size\n\t\t\t\t.Or(Property.Create(Optional.None<Size<Points>>()))\n\t\t\t\t.Or(Size.Create<Points>(800, 600))\n\t\t\t\t.AutoInvalidate(TimeSpan.FromSeconds(2));\n\n\t\t\tvar size = sizeFeedback.PreventFeedback();\n\n\t\t\tvar content = new NSDefaultView();\n\n\t\t\tif (model.DragOperation.HasValue)\n\t\t\t{\n\t\t\t\tcontent.RegisterForDraggedTypes(new string[] { NSPasteboard.NSFilenamesType });\n\t\t\t\tcontent.AddDropOperation(model.DragOperation.Value);\n\t\t\t}\n\n\t\t\tvar window = new CustomWindow(model.Focused)\n\t\t\t{\n\t\t\t\tBackgroundColor = Color.FromBytes(0x31,0x34,0x3a).ToNSColor(),\n\t\t\t\tContentView = content,\n\t\t\t\tStyleMask = NSWindowStyle.TexturedBackground | /*NSWindowStyle.Utility |*/ NSWindowStyle.Titled | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Resizable,\n\t\t\t\tHidesOnDeactivate = false,\n\t\t\t\tRestorable = false,\n\t\t\t};\n\n\t\t\twindow.IsOpaque = false;\n\t\t\tcontent.WantsLayer = true;\n\n\t\t\tvar fusionContent = model.Content;\n\t\t\tvar desiredTitleBarHeight = new ReplaySubject<IObservable<Points>>(1);\n\n\t\t\tswitch (model.Style)\n\t\t\t{\n\t\t\t\tcase WindowStyle.Regular:\n\t\t\t\t\t// Render window content beneath title bar area\n\t\t\t\t\twindow.StyleMask |= NSWindowStyle.FullSizeContentView;\n\n\t\t\t\t\t// Make title bar transparent\n\t\t\t\t\twindow.TitlebarAppearsTransparent = true;\n\n\t\t\t\t\t// Build custom title bar content and dock it on top of existing fusionContent\n\t\t\t\t\tvar titleTextColor = Color.White;\n\n\t\t\t\t\tvar titleBarContent = document.MatchWith(_ =>\n\t\t\t\t\t{\n\t\t\t\t\t\t// If we have a document, we'll create a container to hijack the window's DocumentIconButton later\n\t\t\t\t\t\tvar titleText = Label.Create(text: window.DocumentTitle.AsText(), color: titleTextColor);\n\t\t\t\t\t\tvar documentIconButtonContainer = DocumentIconButtonContainer.Create(window).WithPadding(right: Optional.Some<Points>(4));\n\t\t\t\t\t\treturn Layout.StackFromLeft(documentIconButtonContainer, titleText);\n\t\t\t\t\t},\n\t\t\t\t\t() => Label.Create(text: model.Title.AsText(), color: titleTextColor));\n\n\t\t\t\t\tAction zoom = () =>\n\t\t\t\t\t\tFusion.Application.MainThread.Schedule(() => window.Zoom(window));\n\n\t\t\t\t\ttitleBarContent = titleBarContent\n\t\t\t\t\t\t.WithPadding(top: Optional.Some<Points>(2), bottom: Optional.Some<Points>(3))\n\t\t\t\t\t\t.CenterHorizontally();\n\n\t\t\t\t\tdesiredTitleBarHeight.OnNext(titleBarContent.DesiredSize.Height);\n\n\t\t\t\t\tfusionContent = Layout.DockTop(\n\t\t\t\t\t\ttitleBarContent,\n\t\t\t\t\t\tfusionContent\n\t\t\t\t\t).OnMouse(doubleClicked: Command.Enabled(zoom));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WindowStyle.Fat:\n\t\t\t\t\t// Render window content beneath title bar area\n\t\t\t\t\twindow.StyleMask |= NSWindowStyle.FullSizeContentView;\n\n\t\t\t\t\t//Create a toolbar\n\t\t\t\t\twindow.Toolbar = new NSToolbar(\"toolbar\");\n\n\t\t\t\t\t// Make title bar transparent\n\t\t\t\t\twindow.TitlebarAppearsTransparent = true;\n\n\t\t\t\t\twindow.Toolbar.ShowsBaselineSeparator = false;\n\n\t\t\t\t\twindow.WillUseFullScreenPresentationOptions = (nsWindow, options) => options | NSApplicationPresentationOptions.AutoHideToolbar;\n\n\t\t\t\t\t// Build custom title bar content and dock it on top of existing fusionContent\n\t\t\t\t\tvar titleTextColorFat = model.Foreground;\n\n\t\t\t\t\tvar titleBarContentFat = document.MatchWith(_ =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// If we have a document, we'll create a container to hijack the window's DocumentIconButton later\n\t\t\t\t\t\t\tvar titleText = Label.Create(\n\t\t\t\t\t\t\t\t\ttext: window.DocumentTitle.AsText(),\n\t\t\t\t\t\t\t\t\tcolor: titleTextColorFat,\n\t\t\t\t\t\t\t\t\tfont: Font.SystemDefault(11),\n\t\t\t\t\t\t\t\t\tlineBreakMode: LineBreakMode.TruncateTail)\n\t\t\t\t\t\t\t\t.WithWidth(140)\n\t\t\t\t\t\t\t\t.Center();// Ensures the doc name can never run over the controls in compact mode\n\n\t\t\t\t\t\t\treturn  titleText;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t() => Label.Create(text: model.Title.AsText(), color: titleTextColorFat));\n\n\t\t\t\t\t// For some reason the toolbar sometimes causes double zoom events, this is a workaround\n\t\t\t\t\tbool zoomExpected = false;\n\t\t\t\t\tAction zoomFat = () =>\n\t\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tzoomExpected = true;\n\t\t\t\t\t\t\t\twindow.Zoom(window);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfinally\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tzoomExpected = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\twindow.ShouldZoom = (_, __) => zoomExpected;\n\n\n\t\t\t\t\ttitleBarContentFat = Layout.StackFromLeft(\n\t\t\t\t\t\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithWidth(80)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.HideOnWindows(),\n\t\t\t\t\t\t\t\t\t\t\t\tControl.Empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t.WithWidth(16)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.HideOnMac(),\n\t\t\t\t\t\t\t\t\t\t\t\ttitleBarContentFat)\n\t\t\t\t\t\t\t\t\t\t\t.WithPadding(top: Optional.Some<Points>(12))\n\t\t\t\t\t\t\t\t\t\t\t.DockTopLeft();\n\n\t\t\t\t\tdesiredTitleBarHeight.OnNext(Observable.Return<Points>(0.0));\n\n\t\t\t\t\tfusionContent = fusionContent.OnMouse(doubleClicked: Command.Enabled(zoomFat)).WithOverlay(titleBarContentFat);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WindowStyle.None:\n\t\t\t\t\twindow.StyleMask = NSWindowStyle.TexturedBackground | NSWindowStyle.Borderless;\n\t\t\t\t\twindow.MovableByWindowBackground = true;\n\t\t\t\t\twindow.BackgroundColor = NSColor.Clear;\n\n\t\t\t\t\tdesiredTitleBarHeight.OnNext(Observable.Return<Points>(0.0));\n\n\t\t\t\t\tcontent.Layer.Frame = content.Frame;\n\t\t\t\t\tcontent.Layer.CornerRadius = 5.0f;\n\t\t\t\t\tcontent.Layer.MasksToBounds = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase WindowStyle.Sheet:\n\t\t\t\t\tdesiredTitleBarHeight.OnNext(Observable.Return<Points>(0.0));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\n\t\t\tmodel.Size.Do(s =>\n\t\t\t\ts.IsReadOnly.ObserveOn(dispatcher).Subscribe(isReadOnly =>\n\t\t\t\t{\n\t\t\t\t\tif (isReadOnly)\n\t\t\t\t\t\twindow.StyleMask &= ~NSWindowStyle.Resizable;\n\t\t\t\t\telse\n\t\t\t\t\t\twindow.StyleMask |= NSWindowStyle.Resizable;\n\t\t\t\t}));\n\n\t\t\tvar sizeFeedbackObservable = sizeFeedback.AsObservable();\n\t\t\tvar sizeObservable = size.AsObservable();\n\n\t\t\tmodel.Title.ObserveOn(dispatcher).Subscribe(title => window.Title = title);\n\t\t\tsizeObservable.CombineLatest(\n\t\t\t\tdesiredTitleBarHeight.Switch(),\n\t\t\t\t(s,h) => new Size<Points>(s.Width, s.Height + h)).ObserveOn(dispatcher).Subscribe(s => window.SetContentSize(s.ToSize()));\n\n\t\t\twindow.WillClose += (sender, args) =>\n\t\t\t{\n\t\t\t\t// HACK: Kill the current process immediately.\n\t\t\t\tif (--_WindowCount == 0)\n\t\t\t\t\tFusion.Application.Exit(0);\n#if false\n\t\t\t\t// TODO: The following hangs for a long period of time, using 100% CPU.\n\t\t\t\tmodel.Closed.ExecuteOnce();\n#endif\n\t\t\t}; // Window closed by user\n\n\t\t\tvar observer = new WindowObserver();\n\t\t\tobserver.DangerousRetain();\n\t\t\twindow.AddObserver(observer, new NSString(\"visible\"), NSKeyValueObservingOptions.New, IntPtr.Zero);\n\n\t\t\twindow.DidResize += (s, a) => desiredTitleBarHeight.Switch()\n                .Subscribe(titleBarHeight =>\n                \tsize.Write((content.Frame.Size - new CGSize(0, (float)titleBarHeight)).ToFusion()));\n\n\t\t\tvar transize = sizeFeedbackObservable.CombineLatest(\n\t\t\t\tdesiredTitleBarHeight.Switch(),\n\t\t\t\t(s,h) => new Size<Points>(s.Width, s.Height + h)).Transpose();\n\t\t\tfusionContent.Mount(new MountLocation.Mutable\n\t\t\t{\n\t\t\t\tAvailableSize = transize,\n\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(transize),\n\t\t\t\tIsRooted = window.IsShowing\n\t\t\t});\n\n\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tvar nativeContent = fusionContent.NativeHandle as NSView;\n\t\t\t\tif (nativeContent != null)\n\t\t\t\t{\n\t\t\t\t\tcontent.AddSubview(nativeContent);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar systemId = SystemGuidLoader.LoadOrCreateOrEmpty();\n\t\t\tmodel.Menu.Do(menu =>\n\t\t\t\tMenuBuilder\n\t\t\t\t\t.CreateMenu(menu, ReportFactory.GetReporter(systemId, Guid.NewGuid(), \"Menu\"))\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.Subscribe(m =>\n\t\t\t\t\t\twindow.Menu = m));\n\n\t\t\twindow.Center();\n\t\t\tvar centerposition = new Point<Points>((double)window.Frame.X, (double)window.Frame.Y);\n\t\t\tvar position = model.Position\n\t\t\t\t.Or(Property.Create(Optional.None<Point<Points>>()))\n\t\t\t\t.Or(centerposition)\n\t\t\t\t.AutoInvalidate(TimeSpan.FromSeconds(2))\n\t\t\t\t.PreventFeedback();\n\n\t\t\tmodel.TopMost.Do(topMost =>\n\t\t\t\ttopMost.Subscribe(t =>\n\t\t\t\t\t{\n\t\t\t\t\t\twindow.Level = t ? NSWindowLevel.Floating : NSWindowLevel.Normal;\n\t\t\t\t\t}));\n\n\t\t\tposition.ObserveOn(dispatcher).Subscribe(p =>\n\t\t\t{\n\t\t\t\twindow.SetFrameOrigin(new CGPoint(p.X, p.Y));\n\t\t\t});\n\t\t\twindow.DidMove += (s, a) =>\n\t\t\t{\n\t\t\t\tposition.Write(new Point<Points>((double)window.Frame.Left, (double)window.Frame.Top));\n\t\t\t};\n\n\t\t\twindow.DidBecomeMain += (s, a) => {\n\t\t\t\tif (window.Menu != null)\n\t\t\t\t\tNSApplication.SharedApplication.MainMenu = window.Menu;\n\t\t\t\telse\n\t\t\t\t\tNSApplication.SharedApplication.MainMenu = Application.GlobalMenu ?? new NSMenu();\n\t\t\t};\n\n\t\t\t_WindowCount++;\n\t\t\treturn window;\n\t\t}\n\t}\n\n\t// This container will hijack the window's existing DocumentIconButton and place it inside here. This assumes there\n\t//  will always be _exactly one_ of these per window and that the window will actually have a DocumentIconButton\n\t//  when this factory creates the container view. It should _not_ be created if the window isn't expected to have\n\t//  a document associated with it.\n\tstatic class DocumentIconButtonContainer\n\t{\n\t\tpublic static IControl Create(CustomWindow window)\n\t\t{\n\t\t\treturn Control.Empty; // TODO\n\t\t\t/*\n\t\t\tvar size = new BehaviorSubject<Size<IObservable<Points>>>(ObservableMath.ZeroSize);\n\t\t\treturn Control.Create(self =>\n\t\t\t{\n\t\t\t\tvar button = window.DocumentIconButton.FirstAsync().Subscribe(s =>\n\n\t\t\t\tvar container = Fusion.Dispatcher.MainThread.InvokeAsync(() =>\n\t\t\t\t{\n\t\t\t\t\tsize.OnNext(Size.Create(Observable.Return<Points>((double)button.Bounds.Width), Observable.Return<Points>((double)button.Bounds.Height)));\n\n\t\t\t\t\treturn new DocumentIconButtonContainerView(button);\n\t\t\t\t});\n\n\t\t\t\tself.BindNativeDefaults(container, Fusion.Dispatcher.MainThread);\n\n\t\t\t\treturn container;\n\t\t\t})\n\t\t\t.WithSize(size.Switch());\n\t\t\t*/\n\t\t}\n\t}\n\n\tclass DocumentIconButtonContainerView : NSView\n\t{\n\t\treadonly NSButton _documentIconButton;\n\n\t\tpublic DocumentIconButtonContainerView(IntPtr handle) : base(handle)\n\t\t{\n\t\t}\n\n\t\tpublic DocumentIconButtonContainerView(NSButton documentIconButton)\n\t\t{\n\t\t\t_documentIconButton = documentIconButton;\n\n\t\t\tvar resizeMessages = new[] {\n\t\t\t\t\"NSWindowDidResizeNotification\",\n\t\t\t\t\"NSWindowDidMoveNotification\",\n\t\t\t};\n\t\t\tforeach (var message in resizeMessages)\n\t\t\t{\n\t\t\t\t// TODO: Leaky\n\t\t\t\tNSNotificationCenter.DefaultCenter.AddObserver(new NSString(message), _ => HijackDocumentIconButton());\n\t\t\t}\n\t\t}\n\n\t\tpublic override void ViewWillDraw()\n\t\t{\n\t\t\tHijackDocumentIconButton();\n\n\t\t\tbase.ViewWillDraw();\n\t\t}\n\n\t\tvoid HijackDocumentIconButton()\n\t\t{\n\t\t\tAddSubview(_documentIconButton);\n\t\t\t_documentIconButton.SetFrameOrigin(new CGPoint());\n\t\t}\n\t}\n\n\tclass WindowObserver : NSObject\n\t{\n\t\tpublic WindowObserver(IntPtr handle) : base(handle)\n\t\t{ }\n\n\t\tpublic WindowObserver()\n\t\t{ }\n\n\t\tpublic override void ObserveValue(NSString keyPath, NSObject ofObject, NSDictionary change, IntPtr context)\n\t\t{\n\t\t\tvar customWindow = ofObject as CustomWindow;\n\t\t\tif (customWindow != null && keyPath == \"visible\")\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tcustomWindow.IsRooted.OnNext(customWindow.IsVisible);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/mac/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"Mono.Posix-4.5\" version=\"4.5.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fusion/tests/CenterTest.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class CenterTest\n\t{\n\t\treadonly TestControl _control = new TestControl(\"centered control\", 2, 2);\n\t\t[Test]\n\t\tpublic void CenterHorizontally()\n\t\t{\n\t\t\tvar root = _control.CenterHorizontally();\n\t\t\troot.AssertDesiredSize(\"root control\", 2, 2);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(left: 1, top: 0, right: 3, bottom: 4);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CenterVertically()\n\t\t{\n\t\t\tvar root = _control.CenterVertically();\n\t\t\troot.AssertDesiredSize(\"root control\", 2, 2);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(left: 0, top: 1, right: 4, bottom: 3);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Center()\n\t\t{\n\t\t\tvar root = _control.Center();\n\t\t\troot.AssertDesiredSize(\"root control\", 2, 2);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(left: 1, top: 1, right: 3, bottom: 3);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CenterHorizontallyCollapseFill()\n\t\t{\n\t\t\tvar root = _control.WithWidth(10).Center(/*fillMin: _min, fillMax: _max,*/ axis: Axis2D.Horizontal);\n\t\t\troot.MountRoot();\n\n\t\t\t/*\n\t\t\t_min.AssertAvailableSize(0, 4);\n\t\t\t_min.AssertFrame(0-3, 0, 0-3, 4);\n\n\t\t\t_max.AssertAvailableSize(0, 4);\n\t\t\t_max.AssertFrame(4+3, 0, 4+3, 4);\n\t\t\t*/\n\n\t\t\t_control.AssertAvailableSize(4, 4);\n\t\t\t_control.AssertFrame(0 - 3, 0, 4 + 3, 4);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void CenterVerticallyCollapseFill()\n\t\t{\n\t\t\tvar root = _control.WithHeight(10).Center(/*fillMin: _min, fillMax: _max,*/ axis: Axis2D.Vertical);\n\t\t\troot.MountRoot();\n\n\t\t\t/*\n\t\t\t_min.AssertAvailableSize(4, 0);\n\t\t\t_min.AssertFrame(0, 0-3, 4, 0-3);\n\n\t\t\t_max.AssertAvailableSize(4, 0);\n\t\t\t_max.AssertFrame(0, 4+3, 4, 4+3);\n\t\t\t*/\n\n\t\t\t_control.AssertAvailableSize(4, 4);\n\t\t\t_control.AssertFrame(0, 0 - 3, 4, 4 + 3);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/ControlMemoryOverheadTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\tpublic class ControlMemoryOverheadTests\n\t{\n\t\tprivate double MemBenchmark<T>(Func<T> func, int iterations = 128)\n\t\t{\n\t\t\treturn MemBenchmark(() => (object) null, _ => func(), iterations);\n\t\t}\n\n\t\tprivate double MemBenchmark<TInit, T>(Func<TInit> initFunc, Func<TInit, T> func, int iterations = 1024)\n\t\t{\n\t\t\tvar instances = new List<T>(iterations + 1) { func(initFunc()) };\n\t\t\tvar initials = Enumerable.Range(0, iterations).Select(_ => initFunc()).ToList();\n\t\t\tvar preMemory = GC.GetTotalMemory(true);\n\t\t\tfor (int i = 0; i < iterations; i++)\n\t\t\t\tinstances.Add(func(initials[i]));\n\t\t\tvar memIncrease = (GC.GetTotalMemory(true) - preMemory) / (double) iterations;\n\t\t\tConsole.WriteLine(\"Size of each instance is around \" + memIncrease);\n\t\t\tAssert.That(instances, Is.Not.Null); // Just to pin instances until measure is complete\n\t\t\treturn memIncrease;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BindNativeProperty_memory_usage()\n\t\t{\n\t\t\tAssert.That(MemBenchmark(() =>\n\t\t\t\t{\n\t\t\t\t\tvar isRooted = Observable.Return(true);\n\t\t\t\t\tvar source = new BehaviorSubject<int>(1234);\n\t\t\t\t\tvar dispatcher = new PollingDispatcher(Thread.CurrentThread);\n\t\t\t\t\tvar mountLocation = CreateMountLocation();\n\t\t\t\t\treturn new { isRooted, source, dispatcher, mountLocation };\n\t\t\t\t},\n\t\t\t\tx =>\n\t\t\t\t{\n\t\t\t\t\tPropertyBindingExtensions.BindNativeProperty(x.isRooted, x.dispatcher, String.Empty, x.source, v => { /*Console.WriteLine(\"Got update \" + v);*/ });\n\t\t\t\t\treturn x;\n\t\t\t\t}), Is.LessThan(1500));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ControlCreate_and_mount_memory_usage()\n\t\t{\n\t\t\tMemBenchmark(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tvar control = Control.Create(ml => null);\n\t\t\t\t\tcontrol.Mount(\n\t\t\t\t\t\tCreateMountLocation());\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\t\t}\n\n\t\tprivate static MountLocation.Mutable CreateMountLocation()\n\t\t{\n\t\t\treturn new MountLocation.Mutable\n\t\t\t{\n\t\t\t\tAvailableSize = Size.Create(Observable.Return(new Points(123)), Observable.Return(new Points(30))),\n\t\t\t\tIsRooted = Observable.Return(true),\n\t\t\t\tNativeFrame = CreateNativeFrame()\n\t\t\t};\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ControlCreate_no_mount_memory_usage()\n\t\t{\n\t\t\tMemBenchmark(() => Control.Create(ml => null));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StackPanel_with_different_number_of_items_memory_usage()\n\t\t{\n\t\t\t// This reflects _just_ the overhead of keeping the controls in the stack, as the controls are created before measuring begins\n\t\t\tvar emptyStackSize = MemBenchmark(() => new IControl[] { }, Layout.StackFromLeft);\n\t\t\tConsole.WriteLine(\"Empty stack size: \" + emptyStackSize);\n\t\t\tvar stackWithOneElementSize = MemBenchmark(\n\t\t\t\t() => Enumerable.Range(0, 1).Select(_ => Control.Create(ml => null)).ToArray(),\n\t\t\t\tLayout.StackFromLeft);\n\t\t\tvar firstElementStackPanelOverhead = stackWithOneElementSize - emptyStackSize;\n\t\t\tConsole.WriteLine(\"Stack with 1 element: {0} (+{1})\", stackWithOneElementSize, firstElementStackPanelOverhead);\n\t\t\tvar stackWithTwoElementsSize = MemBenchmark(\n\t\t\t\t() => Enumerable.Range(0, 2).Select(_ => Control.Create(ml => null)).ToArray(),\n\t\t\t\tLayout.StackFromLeft);\n\t\t\tConsole.WriteLine(\n\t\t\t\t\"Stack with 2 element: {0} (+{1})\",\n\t\t\t\tstackWithTwoElementsSize,\n\t\t\t\tstackWithTwoElementsSize - stackWithOneElementSize);\n\t\t\tAssert.That(stackWithTwoElementsSize, Is.LessThan(7000));\n\t\t\tvar stackWithThreeElementsSize = MemBenchmark(\n\t\t\t\t() => Enumerable.Range(0, 3).Select(_ => Control.Create(ml => null)).ToArray(),\n\t\t\t\tLayout.StackFromLeft);\n\t\t\tConsole.WriteLine(\n\t\t\t\t\"Stack with 3 element: {0} (+{1})\",\n\t\t\t\tstackWithThreeElementsSize,\n\t\t\t\tstackWithThreeElementsSize - stackWithTwoElementsSize);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WithPadding_all_sides_memory_usage()\n\t\t{\n\t\t\tMemBenchmark(\n\t\t\t\t() => Control.Create(ml => null),\n\t\t\t\tc => c.WithPadding(new Thickness<Points>(40)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Control_switch_memory_usage()\n\t\t{\n\t\t\tMemBenchmark(() => Observable.Return(Control.Create(ml => null)), c => c.Switch());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Control_switch_mount_memory_usage()\n\t\t{\n\t\t\tMemBenchmark(\n\t\t\t\t() => Observable.Return(Control.Create(ml => null)).Switch(),\n\t\t\t\tc =>\n\t\t\t\t{\n\t\t\t\t\tc.Mount(CreateMountLocation());\n\t\t\t\t\treturn c;\n\t\t\t\t});\n\t\t}\n\n\t\tprivate static Rectangle<IObservable<Points>> CreateNativeFrame()\n\t\t{\n\t\t\treturn Rectangle.FromPositionSize(\n\t\t\t\tObservable.Return(new Points(4)),\n\t\t\t\tObservable.Return(new Points(5)),\n\t\t\t\tObservable.Return(new Points(100)),\n\t\t\t\tObservable.Return(new Points(100)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/CopyTests.cs",
    "content": "﻿using System;\nusing System.IO;\nusing NUnit.Framework;\nusing Outracks.IO;\n\nnamespace Outracks.Tests.FileOperations\n{\n\tpublic class CopyTests\n\t{\n\t\tAbsoluteDirectoryPath _dir;\n\t\tShell _shell = new Shell();\n\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_dir = DirectoryPath.GetCurrentDirectory() / new DirectoryName(Guid.NewGuid().ToString());\n\t\t\tDirectory.CreateDirectory(_dir.NativePath);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tif (Directory.Exists(_dir.NativePath))\n\t\t\t{\n\t\t\t\t//Commented out due to #4225 (It makes FileWatchingTest.DirDeleted fail for some weird reason)\n\t\t\t\t//Directory.Delete(_dir.NativePath, true);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CopyDirectory()\n\t\t{\n\t\t\tDirectory.CreateDirectory((_dir / \"source\" / \"subdir\").NativePath);\n\t\t\tFile.WriteAllText((_dir / \"source\" / \"subdir\" / \"file.txt\").NativePath, \"Hack the planet!\");\n\t\t\t_shell.Copy(_dir / \"source\", _dir / \"target\");\n\t\t\tAssert.AreEqual(\"Hack the planet!\", File.ReadAllText((_dir / \"target\" / \"subdir\" / \"file.txt\").NativePath));\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/DefaultControl.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class DefaultControl\n\t{\n\t\t[Test]\n\t\tpublic void ShouldDesireZeroSize()\n\t\t{\n\t\t\tvar root = Control.Create(_ => null);\n\t\t\troot.AssertDesiredSize(\"Default control\", 0, 0);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/DispatcherBaseTests.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Threading;\nusing NUnit.Framework;\nusing Outracks.Fusion.Threading;\n\nnamespace Outracks.Tests\n{\n\t[TestFixture]\n\tpublic class DispatcherBaseTests\n\t{\n\t\tclass TestDispatcher : DispatcherBase\n\t\t{\n\t\t\tpublic override void Enqueue(Action action)\n\t\t\t{\n\t\t\t\taction();\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Schedule_with_state_and_action()\n\t\t{\n\t\t\tvar dispatcher = new TestDispatcher();\n\t\t\tbool disposeCalled = false;\n\n\t\t\tusing (dispatcher.Schedule(1337, (sched, state) =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(state, Is.EqualTo(1337));\n\t\t\t\t\tAssert.That(sched, Is.EqualTo(dispatcher));\n\t\t\t\t\treturn Disposable.Create(() => disposeCalled = true);\n\t\t\t\t}))\n\t\t\t{\n\t\t\t\t// Should be scheduled immediately\n\t\t\t\tAssert.That(disposeCalled, Is.False);\n\t\t\t}\n\n\t\t\tAssert.That(disposeCalled, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Fails (very) randomly on AppVeyor\")]\n\t\tpublic void Schedule_in_future_using_TimeSpan_invokes_Enqueue_in_background_on_threadpool()\n\t\t{\n\t\t\tvar dispatcher = new TestDispatcher();\n\t\t\tbool disposeCalled = false;\n\t\t\tvar eventWaitHandle = new ManualResetEvent(false);\n\t\t\tint? statePassedToCallback = null;\n\t\t\tIScheduler schedulerPassedToCallback = null;\n\t\t\tusing (dispatcher.Schedule(1337, TimeSpan.FromMilliseconds(15), (sched, state) =>\n\t\t\t\t{\n\t\t\t\t\tstatePassedToCallback = state;\n\t\t\t\t\tschedulerPassedToCallback = sched;\n\t\t\t\t\teventWaitHandle.Set();\n\t\t\t\t\treturn Disposable.Create(() => disposeCalled = true);\n\t\t\t\t}))\n\t\t\t{\n\t\t\t\tAssert.That(eventWaitHandle.WaitOne(1000), Is.True, \"Timed out waiting for action to get invoked in background\");\n\t\t\t\tAssert.That(disposeCalled, Is.False);\n\t\t\t}\n\n\t\t\tAssert.That(statePassedToCallback, Is.EqualTo(1337));\n\t\t\tAssert.That(schedulerPassedToCallback, Is.EqualTo(dispatcher));\n\t\t\tAssert.That(disposeCalled, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Schedule_in_future_using_DateTimeOffset_invokes_Enqueue_in_background_on_threadpool()\n\t\t{\n\t\t\tvar dispatcher = new TestDispatcher();\n\t\t\tbool disposeCalled = false;\n\t\t\tvar eventWaitHandle = new ManualResetEvent(false);\n\t\t\tvar dueTime = DateTimeOffset.Now.AddMilliseconds(100);\n\t\t\tint? statePassedToCallback = null;\n\t\t\tIScheduler schedulerPassedToCallback = null;\n\t\t\tusing (dispatcher.Schedule(1337, dueTime, (sched, state) =>\n\t\t\t\t{\n\t\t\t\t\tstatePassedToCallback = state;\n\t\t\t\t\tschedulerPassedToCallback = sched;\n\t\t\t\t\teventWaitHandle.Set();\n\t\t\t\t\treturn Disposable.Create(() => disposeCalled = true);\n\t\t\t\t}))\n\t\t\t{\n\t\t\t\tAssert.That(eventWaitHandle.WaitOne(1000), Is.True, \"Timed out waiting for action to get invoked in background\");\n\t\t\t\tAssert.That(disposeCalled, Is.False);\n\t\t\t}\n\n\t\t\tAssert.That(statePassedToCallback, Is.EqualTo(1337));\n\t\t\tAssert.That(schedulerPassedToCallback, Is.EqualTo(dispatcher));\n\t\t\tAssert.That(disposeCalled, Is.True);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/DockBuilderTest.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class DockBuilderTest\n\t{\n\t\treadonly TestControl _d = new TestControl(\"docked control\", 1, 1);\n\t\treadonly TestControl _r = new TestControl(\"right control\", 2, 2);\n\t\treadonly TestControl _f = new TestControl(\"filled control\", 4, 4);\n\n\t\t[Test]\n\t\tpublic void BuildHorizontally()\n\t\t{\n\t\t\tvar root = Layout\n\t\t\t\t.Dock()\n\t\t\t\t.Left(_d)\n\t\t\t\t.Right(_r)\n\t\t\t\t.Fill(_f);\n\n\t\t\troot.AssertDesiredSize(\"dock\", 7, 4);\n\t\t\troot.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 1, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_r.AssertFrame(left: 2, top: 0, right: 4, bottom: 4);\n\t\t\t_r.AssertAvailableSize(width: 4 - 1, height: 4);\n\t\t\t_r.AssertHasNativeParent();\n\n\t\t\t_f.AssertFrame(left: 1, top: 0, right: 2, bottom: 4);\n\t\t\t_f.AssertAvailableSize(width: 4 - 1 - 2, height: 4);\n\t\t\t_f.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BuildVertically()\n\t\t{\n\t\t\tvar root = Layout\n\t\t\t\t.Dock()\n\t\t\t\t.Top(_d)\n\t\t\t\t.Bottom(_r)\n\t\t\t\t.Fill(_f);\n\n\t\t\troot.AssertDesiredSize(\"dock\", 4, 7);\n\t\t\troot.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 4, bottom: 1);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_r.AssertFrame(left: 0, top: 2, right: 4, bottom: 4);\n\t\t\t_r.AssertAvailableSize(width: 4, height: 4 - 1);\n\t\t\t_r.AssertHasNativeParent();\n\n\t\t\t_f.AssertFrame(left: 0, top: 1, right: 4, bottom: 2);\n\t\t\t_f.AssertAvailableSize(width: 4, height: 4 - 1 - 2);\n\t\t\t_f.AssertHasNativeParent();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/DockTest.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class DockTest\n\t{\n\t\treadonly TestControl _d = new TestControl(\"docked control\", 1, 1);\n\t\treadonly TestControl _r = new TestControl(\"right control\", 2, 2);\n\t\treadonly TestControl _f = new TestControl(\"filled control\", 4, 4);\n\n\n\t\t[Test]\n\t\tpublic void StackNone()\n\t\t{\n\t\t\tvar a = Layout.StackFromLeft();\n\t\t\ta.AssertDesiredSize(\"a\", 0, 0);\n\t\t\ta.MountRoot();\n\n\t\t\tvar b = Layout.StackFromTop();\n\t\t\tb.AssertDesiredSize(\"b\", 0, 0);\n\t\t\tb.MountRoot();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StackSingleFromLeft()\n\t\t{\n\t\t\tvar dockLeft = Layout.StackFromLeft(_d);\n\t\t\tdockLeft.AssertDesiredSize(\"dock\", 1, 1);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 1, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StackMultipleFromLeft()\n\t\t{\n\t\t\tvar dockLeft = Layout.StackFromLeft(_d, _r);\n\t\t\tdockLeft.AssertDesiredSize(\"dock\", 3, 2);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 1, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_r.AssertFrame(left: 1, top: 0, right: 3, bottom: 4);\n\t\t\t//_r.AssertAvailableSize(width: 3, height: 4);\n\t\t\t_r.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StackSingleFromTop()\n\t\t{\n\t\t\tvar dockLeft = Layout.StackFromTop(_d);\n\t\t\tdockLeft.AssertDesiredSize(\"dock\", 1, 1);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 4, bottom: 1);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StackMultipleFromTop()\n\t\t{\n\t\t\tvar dockLeft = Layout.StackFromTop(_d, _r);\n\t\t\tdockLeft.AssertDesiredSize(\"dock\", 2, 3);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 4, bottom: 1);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_r.AssertFrame(left: 0, top: 1, right: 4, bottom: 3);\n\t\t\t//_r.AssertAvailableSize(width: 4, height: 3);\n\t\t\t_r.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StackSingleFromBottom()\n\t\t{\n\t\t\tvar dockLeft = Layout.StackFromBottom(_d);\n\t\t\tdockLeft.AssertDesiredSize(\"dock\", 1, 1);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 3, right: 4, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StackMultipleFromBottom()\n\t\t{\n\t\t\tvar dockLeft = Layout.StackFromBottom(_d, _r);\n\t\t\tdockLeft.AssertDesiredSize(\"dock\", 2, 3);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 3, right: 4, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_r.AssertFrame(left: 0, top: 1, right: 4, bottom: 3);\n\t\t\t//_r.AssertAvailableSize(width: 4, height: 3);\n\t\t\t_r.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockLeft()\n\t\t{\n\t\t\tvar dockLeft = Layout.Dock(RectangleEdge.Left, _d, _f);\n\t\t\tdockLeft.AssertDesiredSize(\"dock\", 5, 4);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 1, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_f.AssertFrame(left: 1, top: 0, right: 4, bottom: 4);\n\t\t\t_f.AssertAvailableSize(width: 4 - 1, height: 4);\n\t\t\t_f.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockLeftCollapseFill()\n\t\t{\n\t\t\tvar dockLeft = Layout.Dock(RectangleEdge.Left, _d.WithWidth(100), _f);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_f.AssertAvailableSize(width: 0, height: 4);\n\t\t\t_f.AssertFrame(left: 4, top: 0, right: 4, bottom: 4);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockRight()\n\t\t{\n\t\t\tvar dockRight = Layout.Dock(RectangleEdge.Right, _d, _f);\n\t\t\tdockRight.AssertDesiredSize(\"dock\", 5, 4);\n\t\t\tdockRight.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 3, top: 0, right: 4, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_f.AssertFrame(left: 0, top: 0, right: 3, bottom: 4);\n\t\t\t_f.AssertAvailableSize(width: 4 - 1, height: 4);\n\t\t\t_f.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockRightCollapseFill()\n\t\t{\n\t\t\tvar dockLeft = Layout.Dock(RectangleEdge.Right, _d.WithWidth(100), _f);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_f.AssertAvailableSize(width: 0, height: 4);\n\t\t\t_f.AssertFrame(left: 0, top: 0, right: 0, bottom: 4);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockTop()\n\t\t{\n\t\t\tvar dockTop = Layout.Dock(RectangleEdge.Top, _d, _f);\n\t\t\tdockTop.AssertDesiredSize(\"dock\", 4, 5);\n\t\t\tdockTop.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 4, bottom: 1);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_f.AssertFrame(left: 0, top: 1, right: 4, bottom: 4);\n\t\t\t_f.AssertAvailableSize(width: 4, height: 4 - 1);\n\t\t\t_f.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockTopCollapseFill()\n\t\t{\n\t\t\tvar dockLeft = Layout.Dock(RectangleEdge.Top, _d.WithHeight(100), _f);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_f.AssertAvailableSize(width: 4, height: 0);\n\t\t\t_f.AssertFrame(left: 0, top: 4, right: 4, bottom: 4);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockBottom()\n\t\t{\n\t\t\tvar dockBottom = Layout.Dock(RectangleEdge.Bottom, _d, _f);\n\t\t\tdockBottom.AssertDesiredSize(\"dock\", 4, 5);\n\t\t\tdockBottom.MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 3, right: 4, bottom: 4);\n\t\t\t_d.AssertAvailableSize(width: 4, height: 4);\n\t\t\t_d.AssertHasNativeParent();\n\n\t\t\t_f.AssertFrame(left: 0, top: 0, right: 4, bottom: 3);\n\t\t\t_f.AssertAvailableSize(width: 4, height: 4 - 1);\n\t\t\t_f.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DockBottomCollapseFill()\n\t\t{\n\t\t\tvar dockLeft = Layout.Dock(RectangleEdge.Bottom, _d.WithHeight(100), _f);\n\t\t\tdockLeft.MountRoot();\n\n\t\t\t_f.AssertAvailableSize(width: 4, height: 0);\n\t\t\t_f.AssertFrame(left: 0, top: 0, right: 4, bottom: 0);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/FileWatchingTest.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.IO.Tests\n{\n\t// This is an exception to the no IO rule when doing unit tests.\n\tpublic class FileWatchingTest\n\t{\n\t\treadonly IFileSystem _fs = new Shell();\n\t\tAbsoluteDirectoryPath _dir;\n\t\tAbsoluteFilePath _file;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_dir = DirectoryPath.GetCurrentDirectory() / new DirectoryName(Guid.NewGuid().ToString());\n\t\t\t_file = _dir / new FileName(\"foobar.txt\");\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tfor (int i = 0; i < 5; i++)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (Directory.Exists(_dir.NativePath))\n\t\t\t\t\t\tDirectory.Delete(_dir.NativePath, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcatch (Exception exception)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(exception);\n\t\t\t\t\tThread.Sleep(100);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task FileCreated()\n\t\t{\n\t\t\t_fs.Create(_dir);\n\t\t\tvar unit = _fs.Watch(_file).FirstAsync().ToTask();\n\n\t\t\t_fs.Create(_file).Dispose();\n\n\t\t\tAssert.AreEqual(Unit.Default, await unit.TimeoutAfter(TimeSpan.FromSeconds(2)), \"Did not get file created event!\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task FileChanged()\n\t\t{\n\t\t\t_fs.Create(_dir);\n\t\t\tusing (var stream = _fs.Create(_file))\n\t\t\t{\n\t\t\t\tawait stream.FlushAsync();\n\n\t\t\t\tvar unit = _fs.Watch(_file).FirstAsync().ToTask();\n\n\t\t\t\tusing (var streamWriter = new StreamWriter(stream))\n\t\t\t\t{\n\t\t\t\t\tstreamWriter.Write(\"Foo\");\n\t\t\t\t}\n\n\t\t\t\tAssert.AreEqual(Unit.Default, await unit.TimeoutAfter(TimeSpan.FromSeconds(0.5)), \"Did not get file changed event!\");\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task FileDeleted()\n\t\t{\n\t\t\t_fs.Create(_dir);\n\t\t\t_fs.Create(_file).Dispose();\n\n\t\t\tvar unit = _fs.Watch(_file).FirstAsync().ToTask();\n\n\t\t\t_fs.Delete(_file);\n\n\t\t\tAssert.AreEqual(Unit.Default, await unit.TimeoutAfter(TimeSpan.FromSeconds(0.5)), \"Did not get file deleted event!\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task DirDeleted()\n\t\t{\n\t\t\t_fs.Create(_dir);\n\t\t\t_fs.Create(_file).Dispose();\n\n\t\t\tvar watcher = _fs.Watch(_file);\n\n\t\t\tvar deletedEvent = watcher.FirstAsync().ToTask();\n\t\t\t_fs.Delete(_dir);\n\t\t\tAssert.AreEqual(Unit.Default, await deletedEvent.TimeoutAfter(TimeSpan.FromSeconds(2)), \"Did not get file deleted event!\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task FileRenamed()\n\t\t{\n\t\t\t_fs.Create(_dir);\n\t\t\t_fs.Create(_file).Dispose();\n\t\t\tvar tmpFile = _file.Rename(Guid.NewGuid() + \".txt\");\n\n\t\t\tvar renamed = _fs.Watch(_file).Take(1).ToTask();\n\t\t\t_fs.Move(_file, tmpFile);\n\t\t\tAssert.AreEqual(Unit.Default, await renamed.TimeoutAfter(TimeSpan.FromSeconds(2)), \"Did not get file moved event!\");\n\n\t\t\tvar renamedBack = _fs.Watch(_file).Take(1).ToTask();\n\t\t\t_fs.Move(tmpFile, _file);\n\t\t\tAssert.AreEqual(Unit.Default, await renamedBack.TimeoutAfter(TimeSpan.FromSeconds(2)), \"Did not get file moved event!\");\n\t\t}\n\n\t\t[Test]\n\t\t[Ignore(\"Under investigation, seems to have passed by mistake randomly\")]\n\t\tpublic async Task WithCatchAndRetry()\n\t\t{\n\t\t\t_fs.Create(_dir);\n\t\t\tvar file = _fs.Watch(_file).StartWith(Unit.Default).CatchAndRetry(TimeSpan.Zero).Publish();\n\n\t\t\tfile.Connect();\n\n\t\t\tvar created = file.FirstAsync().ToTask();\n\t\t\t_fs.Create(_file);\n\t\t\tAssert.AreEqual(Unit.Default, await created.TimeoutAfter(TimeSpan.FromSeconds(0.5)), \"Did not get file created event!\");\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_fs.Delete(_dir); // this causes errors in the watcher, but we're using CatchAndRetry so we should be good\n\n\t\t\t\tvar createdAgain = file.FirstAsync().ToTask();\n\t\t\t\t_fs.Create(_dir);\n\t\t\t\tAssert.AreEqual(Unit.Default, await createdAgain.TimeoutAfter(TimeSpan.FromSeconds(0.5)), \"Did not get file created event!\");\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(OS.Windows, Platform.OperatingSystem, \"Deleting watched folder is assumed only to throw on Windows\");\n\t\t\t}\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/FrameTest.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class FrameTest\n\t{\n\t\treadonly TestControl _control = new TestControl(\"centered control\", 0, 0);\n\n\t\t[Test]\n\t\tpublic void FrameLeft()\n\t\t{\n\t\t\tvar root = _control.WithPadding(left: new Points(1));\n\t\t\troot.AssertDesiredSize(\"root control\", 1, 0);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(1, 0, 4, 4);\n\t\t\t_control.AssertAvailableSize(width: 4-1, height: 4);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FrameRight()\n\t\t{\n\t\t\tvar root = _control.WithPadding(right: new Points(1));\n\t\t\troot.AssertDesiredSize(\"root control\", 1, 0);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(0, 0, 3, 4);\n\t\t\t_control.AssertAvailableSize(width: 4 - 1, height: 4);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FrameTop()\n\t\t{\n\t\t\tvar root = _control.WithPadding(top: new Points(1));\n\t\t\troot.AssertDesiredSize(\"root control\", 0, 1);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(0, 1, 4, 4);\n\t\t\t_control.AssertAvailableSize(width: 4, height: 4 - 1);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FrameBottom()\n\t\t{\n\t\t\tvar root = _control.WithPadding(bottom: new Points(1));\n\t\t\troot.AssertDesiredSize(\"root control\", 0, 1);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(0, 0, 4, 3);\n\t\t\t_control.AssertAvailableSize(width: 4, height: 4 - 1);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FrameAll()\n\t\t{\n\t\t\tvar root = _control.WithPadding(new Thickness<Points>(1, 1, 2, 2));\n\t\t\troot.AssertDesiredSize(\"root control\", 3, 3);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertFrame(1, 1, 2, 2);\n\t\t\t_control.AssertAvailableSize(width: 4 - 1 - 2, height: 4 - 1 - 2);\n\t\t\t_control.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FrameVertically()\n\t\t{\n\t\t\tvar root = _control.WithPadding(top: new Points(1), bottom: new Points(2));\n\t\t\troot.AssertDesiredSize(\"root control\", 0, 3);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertHasNativeParent();\n\t\t\t_control.AssertFrame(0, 1, 4, 2);\n\t\t\t_control.AssertAvailableSize(width: 4, height: 4 - 1 - 2);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/ImageTests.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class ImageTests\n\t{\n\t\t[Test]\n\t\tpublic void GetImageFromResource_given_resource_name_with_svg_extension_returns_SvgImage()\n\t\t{\n\t\t\tvar image = Image.GetImageFromResource(\n\t\t\t\ttypeof(ImageTests).Namespace + \".Images.\" + \"GreenBox.svg\",\n\t\t\t\ttypeof(ImageTests).Assembly);\n\t\t\tAssert.That(image, Is.TypeOf<SvgImage>());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/LazyTest.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class LazyTest\n\t{\n\t\t[Test]\n\t\tpublic void Lazy_is_not_forced_until_mounted()\n\t\t{\n\t\t\tvar ran = false;\n\n\t\t\tvar lazyControl = Control.Lazy(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tran = true;\n\t\t\t\t\treturn Control.Empty;\n\t\t\t\t}).WithSize(Size.Create<Points>(100, 100));\n\n\t\t\tlazyControl.AssertDesiredSize(\"lazy control\", 100, 100);\n\t\t\tAssert.False(ran);\n\t\t\tlazyControl.MountRoot();\n\t\t\tAssert.True(ran);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Lazy_is_not_forced_more_than_once()\n\t\t{\n\t\t\tvar ran = 0;\n\n\t\t\tvar lazyControl = Control.Lazy(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\t++ran;\n\t\t\t\t\treturn Control.Empty;\n\t\t\t\t}).WithSize(Size.Create<Points>(100, 100));\n\n\t\t\tlazyControl.AssertDesiredSize(\"lazy control\", 100, 100);\n\t\t\tAssert.AreEqual(0, ran);\n\t\t\tlazyControl.MountRoot();\n\t\t\tAssert.AreEqual(1, ran);\n\t\t\tlazyControl.MountRoot();\n\t\t\tAssert.AreEqual(1, ran);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/ListChange.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class ListChangeTests\n\t{\n\t\tvoid OrderedCombinations(int length, List<ImmutableList<int>> result)\n\t\t{\n\t\t\tif (length == 0)\n\t\t\t{\n\t\t\t\tresult.Add(ImmutableList<int>.Empty);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tOrderedCombinations(length - 1, result);\n\n\t\t\tforeach (var list in result.ToList())\n\t\t\t{\n\t\t\t\tresult.Add(list.Add(length));\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns all ordered combinations of elements from the set {1,...,length}\n\t\t/// </summary>\n\t\tList<ImmutableList<int>> OrderedCombinations(int length)\n\t\t{\n\t\t\tvar result = new List<ImmutableList<int>>();\n\t\t\tOrderedCombinations(length, result);\n\t\t\treturn result;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IncrementalUpdate_returns_None_on_identical_lists()\n\t\t{\n\t\t\tvar lists = OrderedCombinations(4);\n\n\t\t\tforeach (var list in lists)\n\t\t\t{\n\t\t\t\tAssert.IsFalse(ListChange.IncrementalChanges(list, list).HasValue);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Applying_IncrementalUpdate_returns_correct_result()\n\t\t{\n\t\t\tvar lists = OrderedCombinations(5);\n\n\t\t\tforeach (var oldList in lists)\n\t\t\tforeach (var newList in lists)\n\t\t\t{\n\t\t\t\tvar maybeChanges = ListChange.IncrementalChanges(oldList, newList);\n\n\t\t\t\tvar result = oldList;\n\n\t\t\t\tforeach (var changes in maybeChanges)\n\t\t\t\t{\n\t\t\t\t\tresult = changes.Apply(result);\n\t\t\t\t}\n\t\t\t\tCollectionAssert.AreEqual(newList, result);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Applying_IncrementalUpdate_on_List_returns_correct_result()\n\t\t{\n\t\t\tvar lists = OrderedCombinations(5);\n\n\t\t\tforeach (var oldList in lists)\n\t\t\tforeach (var newList in lists)\n\t\t\t{\n\t\t\t\tvar maybeChanges = ListChange.IncrementalChanges(oldList, newList);\n\n\t\t\t\tvar result = oldList.ToList();\n\n\t\t\t\tforeach (var changes in maybeChanges)\n\t\t\t\t{\n\t\t\t\t\tchanges.Apply(result);\n\t\t\t\t}\n\t\t\t\tCollectionAssert.AreEqual(newList, result);\n\t\t\t}\n\t\t}\n\n\t\tint CountChanges<T>(ListChange<T> changes)\n\t\t{\n\t\t\tvar count = 0;\n\t\t\tchanges(\n\t\t\t\tinsert: (index, item) => ++count,\n\t\t\t\treplace: (index, item) => ++count,\n\t\t\t\tremove: index => ++count,\n\t\t\t\tclear: () => ++count);\n\t\t\treturn count;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IncrementalUpdate_makes_correct_number_of_changes()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\t2,\n\t\t\t\tCountChanges(\n\t\t\t\t\tListChange.IncrementalChanges(\n\t\t\t\t\t\tnew[] { 1, 2, 3 },\n\t\t\t\t\t\tnew[] { 1, 2, 3, 4, 5 }).Or(ListChange.None<int>())));\n\n\t\t\tAssert.AreEqual(\n\t\t\t\t2,\n\t\t\t\tCountChanges(\n\t\t\t\t\tListChange.IncrementalChanges(\n\t\t\t\t\t\tnew[] { 1, 2, 5 },\n\t\t\t\t\t\tnew[] { 1, 2, 3, 4, 5 }).Or(ListChange.None<int>())));\n\n\t\t\tAssert.AreEqual(\n\t\t\t\t2,\n\t\t\t\tCountChanges(\n\t\t\t\t\tListChange.IncrementalChanges(\n\t\t\t\t\t\tnew[] { 1, 2, 3, 4, 5 },\n\t\t\t\t\t\tnew[] { 1, 2, 3 }).Or(ListChange.None<int>())));\n\n\t\t\tAssert.AreEqual(\n\t\t\t\t2,\n\t\t\t\tCountChanges(\n\t\t\t\t\tListChange.IncrementalChanges(\n\t\t\t\t\t\tnew[] { 1, 2, 3, 4, 5 },\n\t\t\t\t\t\tnew[] { 1, 2, 5 }).Or(ListChange.None<int>())));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/MultiResolutionImageTests.cs",
    "content": "﻿using System.IO;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class MultiResolutionImageTests\n\t{\n\t\t[Test]\n\t\tpublic void Load_returns_correct_image_version_for_various_optimal_scale_factors()\n\t\t{\n\t\t\tvar x1Stream = new MemoryStream();\n\t\t\tvar x2Stream = new MemoryStream();\n\t\t\tvar multiResImage = new MultiResolutionImage(\n\t\t\t\tnew[]\n\t\t\t\t{\n\t\t\t\t\tnew ImageStream(1.0, () => x1Stream),\n\t\t\t\t\tnew ImageStream(2.0, () => x2Stream)\n\t\t\t\t});\n\t\t\tvar iv0_5 = multiResImage.Load<Stream>(0.5, cache: false);\n\t\t\tAssert.That(iv0_5.ScaleFactor.Value, Is.EqualTo(1.0));\n\t\t\tAssert.That(ReferenceEquals(iv0_5.Image, x1Stream));\n\n\t\t\tvar iv1 = multiResImage.Load<Stream>(1, cache: false);\n\t\t\tAssert.That(iv1.ScaleFactor.Value, Is.EqualTo(1.0));\n\t\t\tAssert.That(ReferenceEquals(iv1.Image, x1Stream));\n\n\t\t\tvar iv1_5 = multiResImage.Load<Stream>(1.5, cache: false);\n\t\t\tAssert.That(iv1_5.ScaleFactor.Value, Is.EqualTo(2.0));\n\t\t\tAssert.That(ReferenceEquals(iv1_5.Image, x2Stream));\n\n\t\t\tvar iv2 = multiResImage.Load<Stream>(2, cache: false);\n\t\t\tAssert.That(iv2.ScaleFactor.Value, Is.EqualTo(2.0));\n\t\t\tAssert.That(ReferenceEquals(iv2.Image, x2Stream));\n\n\t\t\tvar iv3 = multiResImage.Load<Stream>(3, cache: false);\n\t\t\tAssert.That(iv3.ScaleFactor.Value, Is.EqualTo(2.0));\n\t\t\tAssert.That(ReferenceEquals(iv3.Image, x2Stream));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/NSObjectTest.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reflection;\n//using Foundation;\n//using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t// FIXME: Move to Mac-specific test project.\n\n\t/*[TestFixture]\n\tpublic class NSObjectTest\n\t{\n\t\t[Test]\n\t\tpublic void TestIfAllNSObjectsGotAnIntPtrConstructor()\n\t\t{\n\t\t\tvar fusionAsm = Assembly.Load(\"Outracks.Fusion.Mac\");\n\t\t\tbool failedOnce = false;\n\t\t\tforeach (var type in fusionAsm.GetTypes())\n\t\t\t{\n\t\t\t\t// If the type derives from a NSObject, it should have a IntPtr constructor.\n\t\t\t\tif (type.IsSubclassOf(typeof(NSObject)) && type.GotAnIntPtrConstructor() == false)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"Type: \" + type + \" derives a NSObject however doesn't have an IntPtr constructor.\");\n\t\t\t\t\tfailedOnce = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tAssert.False(failedOnce);\n\t\t}\n\t}*/\n\n\tpublic static class ReflectionExtensions\n\t{\n\t\tpublic static bool GotAnIntPtrConstructor(this Type type)\n\t\t{\n\t\t\tvar constructors = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);\n\t\t\treturn constructors.Any(\n\t\t\t\tconstructor =>\n\t\t\t\t{\n\t\t\t\t\tvar parameters = constructor.GetParameters();\n\t\t\t\t\tif (parameters.Length != 1)\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\tvar firstParam = parameters[0];\n\t\t\t\t\treturn firstParam.ParameterType == typeof(IntPtr);\n\t\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/ObservableList/ConcatTest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Reactive;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class ConcatTest\n\t{\n\t\t[Test]\n\t\tpublic void Add()\n\t\t{\n\t\t\tvar left = new ListBehaviorSubject<int>();\n\t\t\tvar right = new ListBehaviorSubject<int>();\n\n\t\t\tleft.OnAdd(1);\n\t\t\tleft.OnAdd(2);\n\n\t\t\tright.OnAdd(4);\n\t\t\tright.OnAdd(5);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = left.Concat(right).Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 4, 5 }, list);\n\n\t\t\tleft.OnAdd(3);\n\t\t\tright.OnAdd(6);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6 }, list);\n\n\t\t\tsub.Dispose();\n\n\t\t\tleft.OnAdd(100);\n\t\t\tright.OnAdd(200);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6 }, list);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Remove()\n\t\t{\n\t\t\tvar left = new ListBehaviorSubject<int>();\n\t\t\tvar right = new ListBehaviorSubject<int>();\n\n\t\t\tleft.OnAdd(1);\n\t\t\tleft.OnAdd(2);\n\t\t\tleft.OnAdd(3);\n\n\t\t\tright.OnAdd(4);\n\t\t\tright.OnAdd(5);\n\t\t\tright.OnAdd(6);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = left.Concat(right).Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6 }, list);\n\n\t\t\tleft.OnRemove(2);\n\t\t\tright.OnRemove(2);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 4, 5 }, list);\n\n\t\t\tleft.OnRemove(0);\n\t\t\tright.OnRemove(0);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 2, 5 }, list);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Replace()\n\t\t{\n\t\t\tvar left = new ListBehaviorSubject<int>();\n\t\t\tvar right = new ListBehaviorSubject<int>();\n\n\t\t\tleft.OnAdd(1);\n\t\t\tleft.OnAdd(2);\n\t\t\tleft.OnAdd(3);\n\n\t\t\tright.OnAdd(4);\n\t\t\tright.OnAdd(5);\n\t\t\tright.OnAdd(6);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = left.Concat(right).Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6 }, list);\n\n\t\t\tleft.OnReplace(0, 100);\n\t\t\tright.OnReplace(0, 200);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 100, 2, 3, 200, 5, 6 }, list);\n\n\t\t\tleft.OnReplace(2, 0);\n\t\t\tright.OnReplace(2, 0);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 100, 2, 0, 200, 5, 0 }, list);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Clear()\n\t\t{\n\t\t\tvar left = new ListBehaviorSubject<int>();\n\t\t\tvar right = new ListBehaviorSubject<int>();\n\n\t\t\tleft.OnAdd(1);\n\t\t\tleft.OnAdd(2);\n\t\t\tleft.OnAdd(3);\n\n\t\t\tright.OnAdd(4);\n\t\t\tright.OnAdd(5);\n\t\t\tright.OnAdd(6);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = left.Concat(right).Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6 }, list);\n\n\t\t\tleft.OnClear();\n\n\t\t\tCollectionAssert.AreEqual(new[] { 4, 5, 6 }, list);\n\n\t\t\tright.OnClear();\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\n\t\t\tleft.OnAdd(1);\n\t\t\tleft.OnAdd(2);\n\t\t\tleft.OnAdd(3);\n\n\t\t\tright.OnAdd(4);\n\t\t\tright.OnAdd(5);\n\t\t\tright.OnAdd(6);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4, 5, 6 }, list);\n\n\t\t\tright.OnClear();\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list);\n\n\t\t\tleft.OnClear();\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Completed1()\n\t\t{\n\t\t\tvar left = new ListBehaviorSubject<int>();\n\t\t\tvar right = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tbool completed = false;\n\n\t\t\tvar sub = left.Concat(right)\n\t\t\t\t.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list), () => completed = true));\n\n\t\t\tleft.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tright.OnCompleted();\n\t\t\tAssert.IsTrue(completed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Completed2()\n\t\t{\n\t\t\tvar left = new ListBehaviorSubject<int>();\n\t\t\tvar right = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tbool completed = false;\n\n\t\t\tvar sub = left.Concat(right)\n\t\t\t\t.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list), () => completed = true));\n\n\t\t\tright.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tleft.OnCompleted();\n\t\t\tAssert.IsTrue(completed);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/ObservableList/CountTest.cs",
    "content": "﻿using System.Reactive;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class CountTest\n\t{\n\t\t[Test]\n\t\tpublic void Count_reflects_changes()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<int>();\n\n\t\t\tlbs.OnAdd(1);\n\t\t\tlbs.OnAdd(2);\n\t\t\tlbs.OnAdd(3);\n\n\t\t\tvar count = 0;\n\n\t\t\tvar sub = lbs.Count().Subscribe(Observer.Create<int>(newCount => count = newCount));\n\n\t\t\tAssert.AreEqual(3, count);\n\n\t\t\tlbs.OnRemove(0);\n\n\t\t\tAssert.AreEqual(2, count);\n\n\t\t\tlbs[0] = 5;\n\n\t\t\tAssert.AreEqual(2, count);\n\n\t\t\tlbs.OnClear();\n\n\t\t\tAssert.AreEqual(0, count);\n\n\t\t\tsub.Dispose();\n\n\t\t\tlbs.OnAdd(41);\n\n\t\t\tAssert.AreEqual(0, count);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/ObservableList/DisposeElementsTest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class DisposeElementsTest\n\t{\n\t\t[Test]\n\t\tpublic void DisposeElements_disposes_elements()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<MyDisposable>();\n\n\t\t\tvar d1 = new MyDisposable();\n\t\t\tvar d2 = new MyDisposable();\n\t\t\tvar d3 = new MyDisposable();\n\t\t\tvar d4 = new MyDisposable();\n\n\t\t\tlbs.OnAdd(d1);\n\t\t\tlbs.OnAdd(d2);\n\t\t\tlbs.OnAdd(d3);\n\n\t\t\tvar list = new List<MyDisposable>();\n\n\t\t\tvar sub = lbs.DisposeElements().Subscribe(change => change.Apply(list));\n\n\t\t\tCollectionAssert.AreEqual(new[] { d1, d2, d3 }, list);\n\n\t\t\tAssert.AreEqual(0, d1.DisposeCount);\n\t\t\tAssert.AreEqual(0, d2.DisposeCount);\n\t\t\tAssert.AreEqual(0, d3.DisposeCount);\n\t\t\tAssert.AreEqual(0, d4.DisposeCount);\n\n\t\t\tlbs.OnRemove(1);\n\n\t\t\tCollectionAssert.AreEqual(new [] { d1, d3 }, list);\n\n\t\t\tAssert.AreEqual(0, d1.DisposeCount);\n\t\t\tAssert.AreEqual(1, d2.DisposeCount);\n\t\t\tAssert.AreEqual(0, d3.DisposeCount);\n\t\t\tAssert.AreEqual(0, d4.DisposeCount);\n\n\t\t\tlbs.OnReplace(1, d4);\n\n\t\t\tCollectionAssert.AreEqual(new [] { d1, d4 }, list);\n\n\t\t\tAssert.AreEqual(0, d1.DisposeCount);\n\t\t\tAssert.AreEqual(1, d2.DisposeCount);\n\t\t\tAssert.AreEqual(1, d3.DisposeCount);\n\t\t\tAssert.AreEqual(0, d4.DisposeCount);\n\n\t\t\tlbs.OnClear();\n\n\t\t\tCollectionAssert.AreEqual(new MyDisposable[] { }, list);\n\n\t\t\tAssert.AreEqual(1, d1.DisposeCount);\n\t\t\tAssert.AreEqual(1, d2.DisposeCount);\n\t\t\tAssert.AreEqual(1, d3.DisposeCount);\n\t\t\tAssert.AreEqual(1, d4.DisposeCount);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\tclass MyDisposable : IDisposable\n\t\t{\n\t\t\tpublic int DisposeCount;\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\t++DisposeCount;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/ObservableList/ListBehaviorSubjectTest.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Reactive;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class ListBehaviorSubjectTest\n\t{\n\t\t[Test]\n\t\tpublic void ListBehaviorSubject_Subscribe_reflects_changes()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<int>();\n\n\t\t\tlbs.OnAdd(1);\n\t\t\tlbs.OnAdd(2);\n\t\t\tlbs.OnAdd(3);\n\n\t\t\tvar list = new List<int>();\n\t\t\tvar sub = lbs.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list);\n\n\t\t\tlbs.OnAdd(4);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4 }, list);\n\n\t\t\tlbs.OnInsert(0, 0);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 0, 1, 2, 3, 4 }, list);\n\n\t\t\tlbs.OnRemove(1);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 0, 2, 3, 4 }, list);\n\n\t\t\tlbs.OnClear();\n\n\t\t\tCollectionAssert.AreEqual(new int[] {}, list);\n\n\t\t\tsub.Dispose();\n\n\t\t\tlbs.OnAdd(41);\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/ObservableList/ReplayTest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class ReplayTest\n\t{\n\t\t[Test]\n\t\tpublic void Replay_doesnt_emit_until_connected()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<int>();\n\n\t\t\tlbs.OnAdd(1);\n\n\t\t\tvar replay = lbs.Replay();\n\n\t\t\tlbs.OnAdd(2);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\n\t\t\tvar conn = replay.Connect();\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list);\n\n\t\t\tlbs.OnAdd(3);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list);\n\n\t\t\tsub.Dispose();\n\t\t\tconn.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Replay_handles_multiple_subscriptions()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<int>();\n\n\t\t\tlbs.OnAdd(1);\n\n\t\t\tvar replay = lbs.Replay();\n\n\t\t\tlbs.OnAdd(2);\n\n\t\t\tvar list = new List<int>();\n\t\t\tvar list2 = new List<int>();\n\n\t\t\tvar sub = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\t\t\tvar sub2 = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list2)));\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list2);\n\n\t\t\tvar conn = replay.Connect();\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list);\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list2);\n\n\t\t\tlbs.OnAdd(3);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list);\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list2);\n\n\t\t\tsub.Dispose();\n\t\t\tsub2.Dispose();\n\t\t\tconn.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Replay_handles_subscription_after_connect()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<int>();\n\n\t\t\tlbs.OnAdd(1);\n\n\t\t\tvar replay = lbs.Replay();\n\n\t\t\tlbs.OnAdd(2);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\n\t\t\tvar conn = replay.Connect();\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list);\n\n\t\t\tvar list2 = new List<int>();\n\t\t\tvar sub2 = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list2)));\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list2);\n\n\t\t\tlbs.OnAdd(3);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list);\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list2);\n\n\t\t\tsub2.Dispose();\n\n\t\t\tlbs.OnAdd(4);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 4 }, list);\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list2);\n\n\t\t\tsub.Dispose();\n\t\t\tconn.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Replay_handles_completion()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<int>();\n\n\t\t\tlbs.OnAdd(1);\n\n\t\t\tvar replay = lbs.Replay();\n\n\t\t\tlbs.OnAdd(2);\n\n\t\t\tvar list = new List<int>();\n\t\t\tvar completed = false;\n\t\t\tvar sub = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list), () => completed = true));\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\n\t\t\tvar conn = replay.Connect();\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list);\n\n\t\t\tAssert.IsFalse(completed);\n\n\t\t\tlbs.OnCompleted();\n\n\t\t\tAssert.IsTrue(completed);\n\n\t\t\tvar list2 = new List<int>();\n\t\t\tvar completed2 = false;\n\t\t\tvar sub2 = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list2), () => completed2 = true));\n\n\t\t\tAssert.IsTrue(completed2);\n\n\t\t\tsub2.Dispose();\n\t\t\tsub.Dispose();\n\t\t\tconn.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Replay_handles_errors()\n\t\t{\n\t\t\tvar lbs = new ListBehaviorSubject<int>();\n\n\t\t\tlbs.OnAdd(1);\n\n\t\t\tvar replay = lbs.Replay();\n\n\t\t\tlbs.OnAdd(2);\n\n\t\t\tvar list = new List<int>();\n\t\t\tException error = null;\n\t\t\tvar sub = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list), e => error = e));\n\n\t\t\tCollectionAssert.AreEqual(new int[] { }, list);\n\n\t\t\tvar conn = replay.Connect();\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list);\n\n\t\t\tAssert.IsNull(error);\n\n\t\t\tvar sourceError = new Exception(\"Actual\");\n\n\t\t\tlbs.OnError(sourceError);\n\n\t\t\tAssert.AreEqual(sourceError, error);\n\n\t\t\tvar list2 = new List<int>();\n\t\t\tException error2 = null;\n\t\t\tvar sub2 = replay.Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list2), e => error2 = e));\n\n\t\t\tAssert.AreEqual(sourceError, error2);\n\n\t\t\tsub2.Dispose();\n\t\t\tsub.Dispose();\n\t\t\tconn.Dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/ObservableList/SeparateByTest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class SeparateByTest\n\t{\n\t\t[Test]\n\t\tpublic void Basics()\n\t\t{\n\t\t\tvar src = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = src.SeparateBy(() => -1).Subscribe(change => change.Apply(list));\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tfor (var i = 0; i < 3; ++i)\n\t\t\t\tsrc.OnAdd(i);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 0, -1, 1, -1, 2 }, list);\n\n\t\t\tsrc.OnRemove(0);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, -1, 2 }, list);\n\n\t\t\tsrc.OnRemove(1);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1 }, list);\n\n\t\t\tsrc.OnInsert(0, 4);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 4, -1, 1 }, list);\n\n\t\t\tsrc.OnAdd(5);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 4, -1, 1, -1, 5 }, list);\n\n\t\t\tsrc.OnReplace(1, 11);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 4, -1, 11, -1, 5 }, list);\n\n\t\t\tsrc.OnClear();\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnComplete()\n\t\t{\n\t\t\tvar src = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar completed = false;\n\n\t\t\tvar sub = src.SeparateBy(() => -1).Subscribe(change => change.Apply(list), () => completed = true);\n\n\t\t\tAssert.IsFalse(completed);\n\n\t\t\tsrc.OnCompleted();\n\n\t\t\tAssert.IsTrue(completed);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnError()\n\t\t{\n\t\t\tvar src = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tException error = null;\n\n\t\t\tvar sub = src.SeparateBy(() => -1).Subscribe(change => change.Apply(list), e => error = e);\n\n\t\t\tAssert.IsNull(error);\n\n\t\t\tvar ex = new Exception(\"AAa\");\n\n\t\t\tsrc.OnError(ex);\n\n\t\t\tAssert.AreEqual(ex, error);\n\n\t\t\tsub.Dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/ObservableList/SwitchTest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class SwitchTest1\n\t{\n\t\t[Test]\n\t\tpublic void Basics()\n\t\t{\n\t\t\tvar lbs1 = new ListBehaviorSubject<int>();\n\t\t\tvar lbs2 = new ListBehaviorSubject<int>();\n\n\t\t\tlbs1.OnAdd(1);\n\t\t\tlbs1.OnAdd(2);\n\n\t\t\tlbs2.OnAdd(4);\n\t\t\tlbs2.OnAdd(5);\n\n\t\t\tvar source = new BehaviorSubject<IObservableList<int>>(lbs1);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = source.Switch().Subscribe(Observer.Create<ListChange<int>>(change => change.Apply(list)));\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list);\n\n\t\t\tlbs1.OnAdd(3);\n\t\t\tlbs1.OnAdd(6);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3, 6 }, list);\n\n\t\t\tsource.OnNext(lbs2);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 4, 5 }, list);\n\n\t\t\tsource.OnNext(lbs2);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 4, 5 }, list);\n\n\t\t\tlbs2.OnRemove(0);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 5 }, list);\n\n\t\t\tlbs2.OnReplace(0, 41);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 41 }, list);\n\n\t\t\tlbs2.OnClear();\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tlbs2.OnAdd(4);\n\t\t\tlbs2.OnAdd(5);\n\n\t\t\tsub.Dispose();\n\n\t\t\tlbs1.OnAdd(100);\n\t\t\tlbs2.OnAdd(200);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 4, 5 }, list);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnComplete()\n\t\t{\n\t\t\tvar lbs1 = new ListBehaviorSubject<int>();\n\t\t\tvar lbs2 = new ListBehaviorSubject<int>();\n\n\t\t\tlbs1.OnAdd(1);\n\t\t\tlbs1.OnAdd(2);\n\n\t\t\tlbs2.OnAdd(3);\n\t\t\tlbs2.OnAdd(4);\n\n\t\t\tvar source = new BehaviorSubject<IObservableList<int>>(lbs1);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar completed = false;\n\n\t\t\tvar sub = source\n\t\t\t\t.Switch()\n\t\t\t\t.Subscribe(\n\t\t\t\t\tObserver.Create<ListChange<int>>(\n\t\t\t\t\t\tchange => change.Apply(list),\n\t\t\t\t\t\t() => completed = true));\n\n\t\t\tlbs1.OnCompleted();\n\n\t\t\t// Inner completion doesn't imply completion until outer is complete\n\t\t\tAssert.IsFalse(completed);\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2 }, list);\n\n\t\t\tsource.OnNext(lbs2);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 3, 4 }, list);\n\n\t\t\tsource.OnCompleted();\n\n\t\t\t// Outer completion implies completion when last inner is complete\n\t\t\tAssert.IsFalse(completed);\n\n\t\t\tlbs2.OnCompleted();\n\n\t\t\tAssert.IsTrue(completed);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 3, 4 }, list);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnInnerError()\n\t\t{\n\t\t\tvar lbs1 = new ListBehaviorSubject<int>();\n\n\t\t\tlbs1.OnAdd(1);\n\t\t\tlbs1.OnAdd(2);\n\n\t\t\tvar source = new BehaviorSubject<IObservableList<int>>(lbs1);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar completed = false;\n\t\t\tException error = null;\n\n\t\t\tvar sub = source\n\t\t\t\t.Switch()\n\t\t\t\t.Subscribe(\n\t\t\t\t\tObserver.Create<ListChange<int>>(\n\t\t\t\t\t\tchange => change.Apply(list),\n\t\t\t\t\t\te => error = e,\n\t\t\t\t\t\t() => completed = true));\n\n\t\t\tvar ex = new Exception(\"AAAAAA\");\n\n\t\t\tlbs1.OnError(ex);\n\n\t\t\tAssert.AreEqual(ex, error);\n\t\t\tAssert.IsFalse(completed);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnOuterError()\n\t\t{\n\t\t\tvar lbs1 = new ListBehaviorSubject<int>();\n\n\t\t\tlbs1.OnAdd(1);\n\t\t\tlbs1.OnAdd(2);\n\n\t\t\tvar source = new BehaviorSubject<IObservableList<int>>(lbs1);\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar completed = false;\n\t\t\tException error = null;\n\n\t\t\tvar sub = source\n\t\t\t\t.Switch()\n\t\t\t\t.Subscribe(\n\t\t\t\t\tObserver.Create<ListChange<int>>(\n\t\t\t\t\t\tchange => change.Apply(list),\n\t\t\t\t\t\te => error = e,\n\t\t\t\t\t\t() => completed = true));\n\n\t\t\tvar ex = new Exception(\"AAAAAA\");\n\n\t\t\tsource.OnError(ex);\n\n\t\t\tAssert.AreEqual(ex, error);\n\t\t\tAssert.IsFalse(completed);\n\n\t\t\tsub.Dispose();\n\t\t}\n\t}\n\n\t[TestFixture]\n\tpublic class SwitchTest2\n\t{\n\t\t[Test]\n\t\tpublic void Basics()\n\t\t{\n\t\t\tvar src1 = new Subject<int>();\n\t\t\tvar src2 = new Subject<int>();\n\t\t\tvar src3 = new Subject<int>();\n\n\t\t\tvar src = new ListBehaviorSubject<IObservable<int>>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = src.Switch().Subscribe(change => change.Apply(list));\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tsrc.OnAdd(src1);\n\t\t\tsrc.OnAdd(src2);\n\t\t\tsrc.OnAdd(src3);\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tsrc1.OnNext(1);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1 }, list);\n\n\t\t\tsrc3.OnNext(3);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 3 }, list);\n\n\t\t\tsrc2.OnNext(2);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 1, 2, 3 }, list);\n\n\t\t\tsrc1.OnNext(11);\n\t\t\tsrc2.OnNext(22);\n\t\t\tsrc3.OnNext(33);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 11, 22, 33 }, list);\n\n\t\t\tsrc.OnRemove(1);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 11, 33 }, list);\n\n\t\t\tsrc.OnReplace(1, src2);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 11 }, list);\n\n\t\t\tsrc2.OnNext(22);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 11, 22 }, list);\n\n\t\t\tsrc.OnClear();\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnCompleteOuterFirst()\n\t\t{\n\t\t\tvar src1 = new Subject<int>();\n\t\t\tvar src2 = new Subject<int>();\n\t\t\tvar src3 = new Subject<int>();\n\n\t\t\tvar src = new ListBehaviorSubject<IObservable<int>>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tbool completed = false;\n\n\t\t\tvar sub = src.Switch().Subscribe(change => change.Apply(list), () => completed = true);\n\n\t\t\tsrc.OnAdd(src1);\n\t\t\tsrc.OnAdd(src2);\n\t\t\tsrc.OnAdd(src3);\n\n\t\t\tsrc.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tsrc1.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tsrc3.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tsrc2.OnCompleted();\n\t\t\tAssert.IsTrue(completed);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnCompleteInnerFirst()\n\t\t{\n\t\t\tvar src1 = new Subject<int>();\n\t\t\tvar src2 = new Subject<int>();\n\t\t\tvar src3 = new Subject<int>();\n\n\t\t\tvar src = new ListBehaviorSubject<IObservable<int>>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tbool completed = false;\n\n\t\t\tvar sub = src.Switch().Subscribe(change => change.Apply(list), () => completed = true);\n\n\t\t\tsrc.OnAdd(src1);\n\t\t\tsrc.OnAdd(src2);\n\t\t\tsrc.OnAdd(src3);\n\n\t\t\tsrc1.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tsrc3.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tsrc2.OnCompleted();\n\t\t\tAssert.IsFalse(completed);\n\t\t\tsrc.OnCompleted();\n\t\t\tAssert.IsTrue(completed);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnOuterError()\n\t\t{\n\t\t\tvar src1 = new Subject<int>();\n\t\t\tvar src2 = new Subject<int>();\n\t\t\tvar src3 = new Subject<int>();\n\n\t\t\tvar src = new ListBehaviorSubject<IObservable<int>>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tException error = null;\n\n\t\t\tvar sub = src.Switch().Subscribe(change => change.Apply(list), e => error = e);\n\n\t\t\tsrc.OnAdd(src1);\n\t\t\tsrc.OnAdd(src2);\n\t\t\tsrc.OnAdd(src3);\n\n\t\t\tvar ex = new Exception(\"AAAAAAAaa\");\n\n\t\t\tsrc.OnError(ex);\n\n\t\t\tAssert.AreEqual(ex, error);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnInnerError()\n\t\t{\n\t\t\tvar src1 = new Subject<int>();\n\t\t\tvar src2 = new Subject<int>();\n\t\t\tvar src3 = new Subject<int>();\n\n\t\t\tvar src = new ListBehaviorSubject<IObservable<int>>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tException error = null;\n\n\t\t\tvar sub = src.Switch().Subscribe(change => change.Apply(list), e => error = e);\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tsrc.OnAdd(src1);\n\t\t\tsrc.OnAdd(src2);\n\t\t\tsrc.OnAdd(src3);\n\n\t\t\tvar ex = new Exception(\"AAAAAAAaa\");\n\n\t\t\tsrc2.OnError(ex);\n\n\t\t\tAssert.AreEqual(ex, error);\n\n\t\t\tsub.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/ObservableList/WhereTest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests.ObservableList\n{\n\t[TestFixture]\n\tpublic class WhereTest\n\t{\n\t\t[Test]\n\t\tpublic void Basics()\n\t\t{\n\t\t\tvar src = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar sub = src.Where(i => i % 2 == 0).Subscribe(change => change.Apply(list));\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tfor (var i = 0; i < 6; ++i)\n\t\t\t\tsrc.OnAdd(i);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 0, 2, 4 }, list);\n\n\t\t\tsrc.OnRemove(1);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 0, 2, 4 }, list);\n\n\t\t\tsrc.OnReplace(1, 4);\n\n\t\t\tCollectionAssert.AreEqual(new[] { 0, 4, 4 }, list);\n\n\t\t\tsrc.OnInsert(0, -2);\n\n\t\t\tCollectionAssert.AreEqual(new[] { -2, 0, 4, 4 }, list);\n\n\t\t\tsrc.OnClear();\n\n\t\t\tCollectionAssert.IsEmpty(list);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnComplete()\n\t\t{\n\t\t\tvar src = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tvar completed = false;\n\n\t\t\tvar sub = src.Where(i => i > 2).Subscribe(change => change.Apply(list), () => completed = true);\n\n\t\t\tAssert.IsFalse(completed);\n\n\t\t\tsrc.OnCompleted();\n\n\t\t\tAssert.IsTrue(completed);\n\n\t\t\tsub.Dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OnError()\n\t\t{\n\t\t\tvar src = new ListBehaviorSubject<int>();\n\n\t\t\tvar list = new List<int>();\n\n\t\t\tException error = null;\n\n\t\t\tvar sub = src.Where(i => i > 2).Subscribe(change => change.Apply(list), e => error = e);\n\n\t\t\tAssert.IsNull(error);\n\n\t\t\tvar ex = new Exception(\"AAa\");\n\n\t\t\tsrc.OnError(ex);\n\n\t\t\tAssert.AreEqual(ex, error);\n\n\t\t\tsub.Dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/ObserveOnTest.cs",
    "content": "﻿using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing NUnit.Framework;\nusing Outracks.Fusion;\n\nnamespace Outracks.Tests\n{\n\tclass YieldingDispatcher : IDispatcher\n\t{\n\t\treadonly ConcurrentQueue<Action> _queue = new ConcurrentQueue<Action>();\n\t\treadonly EventWaitHandle _flushEvt = new AutoResetEvent(false);\n\t\treadonly EventWaitHandle _doneFlush = new AutoResetEvent(false);\n\t\treadonly Thread _thread;\n\n\t\tpublic YieldingDispatcher(CancellationToken ct)\n\t\t{\n\t\t\t_thread = new Thread(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\twhile (ct.IsCancellationRequested == false)\n\t\t\t\t\t{\n\t\t\t\t\t\t_flushEvt.WaitOne();\n\t\t\t\t\t\tDrain();\n\t\t\t\t\t\t_doneFlush.Set();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t_thread.Start();\n\t\t}\n\n\t\tpublic void Flush()\n\t\t{\n\t\t\t_flushEvt.Set();\n\t\t\t_doneFlush.WaitOne();\n\t\t}\n\n\t\tpublic void FlushNoneBlocking()\n\t\t{\n\t\t\t_flushEvt.Set();\n\t\t}\n\n\t\tpublic void Enqueue(Action action)\n\t\t{\n\t\t\t_queue.Enqueue(action);\n\t\t\tif(_thread == Thread.CurrentThread)\n\t\t\t\tDrain();\n\t\t}\n\n\t\tvoid Drain()\n\t\t{\n\t\t\tAction action;\n\t\t\twhile (_queue.TryDequeue(out action))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\taction();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"CatchAll failed with: \" + e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t[TestFixture]\n\tpublic class ObserveOnTest\n\t{\n\t\t[Test]\n\t\tpublic static void TestYieldNormalSequence()\n\t\t{\n\t\t\tvar ctSource = new CancellationTokenSource();\n\t\t\tvar dispatcher = new YieldingDispatcher(ctSource.Token);\n\n\t\t\tvar sub = new Subject<int>();\n\t\t\tvar obs = sub.ObserveOn(dispatcher);\n\t\t\tTestSequenceOrder(dispatcher, sub, obs);\n\n\t\t\tctSource.Cancel();\n\t\t}\n\n\t\t[Test]\n\t\tpublic static void TestYieldConnectableSequence()\n\t\t{\n\t\t\tvar ctSource = new CancellationTokenSource();\n\t\t\tvar dispatcher = new YieldingDispatcher(ctSource.Token);\n\n\t\t\tvar sub = new Subject<int>();\n\t\t\tvar obs = sub.Publish().ObserveOn(dispatcher);\n\t\t\tobs.Connect();\n\n\t\t\tTestSequenceOrder(dispatcher, sub, obs);\n\n\t\t\tctSource.Cancel();\n\t\t}\n\n\t\tstatic void TestSequenceOrder(YieldingDispatcher dispatcher, ISubject<int> sub, IObservable<int> obs)\n\t\t{\n\t\t\tIList<int> result = null;\n\t\t\tobs.SelectMany(i => Observable.FromAsync(() => dispatcher.InvokeAsync(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tThread.Sleep(100);\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t})))\n\t\t\t\t.Buffer(2)\n\t\t\t\t.Subscribe(\n\t\t\t\t\tl =>\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = l;\n\t\t\t\t\t});\n\n\t\t\tsub.OnNext(1);\n\t\t\tdispatcher.FlushNoneBlocking(); // This is the key here, we start processing item '1' before we add item '2'\n\t\t\tsub.OnNext(2);\n\n\t\t\twhile (result == null)\n\t\t\t{\n\t\t\t\tdispatcher.Flush();\n\t\t\t\tThread.Sleep(1);\n\t\t\t}\n\n\t\t\tAssert.True(result.Count == 2, \"Unexpected number of items in observable sequence. Was expecting 2\");\n\t\t\tAssert.True(result[0] == 1, \"Unexpected observable sequence order. Was expecting 1\");\n\t\t\tAssert.True(result[1] == 2, \"Unexpected observable sequence order. Was expecting 2\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/Outracks.Fusion.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{80455EED-7647-4BBF-9779-62413D846ACA}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fusion.Tests</RootNamespace>\n    <AssemblyName>Outracks.Fusion.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <VisualStudioVersion Condition=\"'$(VisualStudioVersion)' == ''\">10.0</VisualStudioVersion>\n    <VSToolsPath Condition=\"'$(VSToolsPath)' == ''\">$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)</VSToolsPath>\n    <ReferencePath>$(ProgramFiles)\\Common Files\\microsoft shared\\VSTT\\$(VisualStudioVersion)\\UITestExtensionPackages</ReferencePath>\n    <IsCodedUITest>False</IsCodedUITest>\n    <TestProjectType>UnitTest</TestProjectType>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ControlMemoryOverheadTests.cs\" />\n    <Compile Include=\"CopyTests.cs\" />\n    <Compile Include=\"DefaultControl.cs\" />\n    <Compile Include=\"DispatcherBaseTests.cs\" />\n    <Compile Include=\"DockBuilderTest.cs\" />\n    <Compile Include=\"CenterTest.cs\" />\n    <Compile Include=\"FileWatchingTest.cs\" />\n    <Compile Include=\"ObservableList\\ConcatTest.cs\" />\n    <Compile Include=\"MultiResolutionImageTests.cs\" />\n    <Compile Include=\"ObservableList\\DisposeElementsTest.cs\" />\n    <Compile Include=\"ObservableList\\ListBehaviorSubjectTest.cs\" />\n    <Compile Include=\"ObservableList\\CountTest.cs\" />\n    <Compile Include=\"ImageTests.cs\" />\n    <Compile Include=\"ObservableList\\ReplayTest.cs\" />\n    <Compile Include=\"ObservableList\\SeparateByTest.cs\" />\n    <Compile Include=\"ObservableList\\SwitchTest.cs\" />\n    <Compile Include=\"ObservableList\\WhereTest.cs\" />\n    <Compile Include=\"SumTree.cs\" />\n    <Compile Include=\"ListChange.cs\" />\n    <Compile Include=\"PropertyBindingExtensionsTests.cs\" />\n    <Compile Include=\"NSObjectTest.cs\" />\n    <Compile Include=\"PropertyTests.cs\" />\n    <Compile Include=\"ScissorTest.cs\" />\n    <Compile Include=\"DockTest.cs\" />\n    <Compile Include=\"FrameTest.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SubdivideTest.cs\" />\n    <Compile Include=\"SvgTests.cs\" />\n    <Compile Include=\"TestControl.cs\" />\n    <Compile Include=\"UserSettingsSerializationTest.cs\" />\n    <Compile Include=\"UserSettingsTest.cs\" />\n    <Compile Include=\"LazyTest.cs\" />\n    <Compile Include=\"WithSizeTest.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Images\\HalfTransparentBox.svg\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Images\\GreenHalfPixel.svg\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Images\\GreenBox.svg\" />\n  </ItemGroup>\n  <Import Project=\"$(VSToolsPath)\\TeamTest\\Microsoft.TestTools.targets\" Condition=\"Exists('$(VSToolsPath)\\TeamTest\\Microsoft.TestTools.targets')\" />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fusion/tests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Outracks.Fusion.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Outracks.Fusion.Tests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"4e3c8a63-f04e-4091-9861-6d865df06fe9\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "src/fusion/tests/PropertyBindingExtensionsTests.cs",
    "content": "﻿using System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class PropertyBindingExtensionsTests\n\t{\n\t\t[Test]\n\t\tpublic void BindNativeProperty_invokes_update_action_while_is_rooted_is_true()\n\t\t{\n\t\t\tvar isRooted = new BehaviorSubject<bool>(false);\n\t\t\tvar value = new BehaviorSubject<int>(1337);\n\t\t\tvar mountLocation = new MountLocation.Mutable { IsRooted = isRooted };\n\t\t\tint lastUpdatedValue = -1;\n\t\t\tmountLocation.BindNativeProperty(\n\t\t\t\tnew PollingDispatcher(Thread.CurrentThread),\n\t\t\t\tstring.Empty,\n\t\t\t\tvalue,\n\t\t\t\tv => lastUpdatedValue = v);\n\t\t\tAssert.That(value.HasObservers, Is.False);\n\t\t\tisRooted.OnNext(true);\n\t\t\tAssert.That(value.HasObservers, Is.True);\n\t\t\tAssert.That(lastUpdatedValue, Is.EqualTo(1337));\n\t\t\tisRooted.OnNext(false);\n\t\t\tAssert.That(value.HasObservers, Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BindNativeProperty_only_propagates_changed_values()\n\t\t{\n\t\t\tvar value = new Subject<int>();\n\t\t\tvar mountLocation = new MountLocation.Mutable { IsRooted = Observable.Return(true) };\n\t\t\tint lastUpdatedValue = -1;\n\t\t\tint updateCount = 0;\n\t\t\tmountLocation.BindNativeProperty(\n\t\t\t\tnew PollingDispatcher(Thread.CurrentThread),\n\t\t\t\tstring.Empty,\n\t\t\t\tvalue,\n\t\t\t\tv =>\n\t\t\t\t{\n\t\t\t\t\tupdateCount++;\n\t\t\t\t\tlastUpdatedValue = v;\n\t\t\t\t});\n\t\t\tvalue.OnNext(1337);\n\t\t\tAssert.That(lastUpdatedValue, Is.EqualTo(1337));\n\t\t\tAssert.That(updateCount, Is.EqualTo(1));\n\t\t\tvalue.OnNext(1337);\n\t\t\tAssert.That(updateCount, Is.EqualTo(1));\n\t\t\tvalue.OnNext(200);\n\t\t\tAssert.That(lastUpdatedValue, Is.EqualTo(200));\n\t\t\tAssert.That(updateCount, Is.EqualTo(2));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/PropertyTests.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class PropertyTests\n\t{\n\t\t[Test]\n\t\tpublic async Task Switch_remembers_set_value()\n\t\t{\n\t\t\tvar obs = Observable\n\t\t\t\t.Return(true)\n\t\t\t\t.Select(_ => Property.Create(\"initial\"))\n\t\t\t\t.Switch();\n\n\t\t\tobs.Write(\"second\");\n\t\t\tAssert.That(await obs.FirstAsync(), Is.EqualTo(\"second\"));\n\t\t\tAssert.That(await obs.FirstAsync(), Is.EqualTo(\"second\"));\n\n\t\t\tobs.Write(\"third\");\n\t\t\tAssert.That(await obs.FirstAsync(), Is.EqualTo(\"third\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IProperty_Deferred_doesnt_defer_inner_Set()\n\t\t{\n\t\t\tvar value = \"initial\";\n\t\t\tvar prop = MakeProperty(value, t => value = t);\n\n\t\t\tvar deferredProp = prop.Deferred();\n\n\t\t\tvar deferredValue = \"\";\n\n\t\t\tusing (deferredProp.Subscribe(newValue => deferredValue = newValue))\n\t\t\t{\n\t\t\t\tprop.Write(\"first\");\n\t\t\t\tprop.Write(\"second\");\n\n\t\t\t\tAssert.That(value, Is.EqualTo(\"second\"));\n\t\t\t\tAssert.That(deferredValue, Is.EqualTo(\"second\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IProperty_Deferred_defers_Set()\n\t\t{\n\t\t\tvar value = \"initial\";\n\t\t\tvar prop = MakeProperty(value, t => value = t);\n\n\t\t\tvar deferredProp = prop.Deferred();\n\n\t\t\tvar deferredValue = \"\";\n\n\t\t\tusing (deferredProp.Subscribe(newValue => deferredValue = newValue))\n\t\t\t{\n\t\t\t\tdeferredProp.Write(\"first\");\n\t\t\t\tdeferredProp.Write(\"second\");\n\n\t\t\t\tAssert.That(value, Is.EqualTo(\"initial\"));\n\t\t\t\tAssert.That(deferredValue, Is.EqualTo(\"second\"));\n\n\t\t\t\tdeferredProp.Write(\"second\", save: true);\n\n\t\t\t\tAssert.That(value, Is.EqualTo(\"second\"));\n\t\t\t\tAssert.That(deferredValue, Is.EqualTo(\"second\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IProperty_With_defaults_to_source_invalidate_command()\n\t\t{\n\t\t\tvar sourceInvalidateCalled = false;\n\n\t\t\tvar sourceProp = Observable.Return(42).AsProperty((v, save) => sourceInvalidateCalled |= save);\n\n\t\t\tsourceProp.With().Write(1337, save: true);\n\t\t\tAssert.That(sourceInvalidateCalled, Is.True);\n\t\t}\n\n\t\tstatic IProperty<T> MakeProperty<T>(T value, Action<T> onSet)\n\t\t{\n\t\t\tvar prop = Property.Create(value);\n\t\t\tprop.Subscribe(onSet);\n\t\t\treturn prop;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/ScissorTest.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class ScissorTest\n\t{\n\t\treadonly TestControl _d = new TestControl(\"scissored control\", 3, 3);\n\n\t\t[Test]\n\t\tpublic void ScissorLeft()\n\t\t{\n\t\t\tvar cut = _d.ScissorLeft(1);\n\t\t\tcut.AssertDesiredSize(\"cut\", 3 - 1, 3);\n\n\t\t\tcut.CenterHorizontally().MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 3, bottom: 4);\n\t\t\t_d.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ScissorRight()\n\t\t{\n\t\t\tvar cut = _d.ScissorRight(1);\n\t\t\tcut.AssertDesiredSize(\"cut\", 3 - 1, 3);\n\n\t\t\tcut.CenterHorizontally().MountRoot();\n\n\t\t\t_d.AssertFrame(left: 1, top: 0, right: 4, bottom: 4);\n\t\t\t_d.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ScissorTop()\n\t\t{\n\t\t\tvar cut = _d.ScissorTop(1);\n\t\t\tcut.AssertDesiredSize(\"cut\", 3, 3 - 1);\n\n\t\t\tcut.CenterVertically().MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 0, right: 4, bottom: 3);\n\t\t\t_d.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ScissorBottom()\n\t\t{\n\t\t\tvar cut = _d.ScissorBottom(1);\n\t\t\tcut.AssertDesiredSize(\"cut\", 3, 3 - 1);\n\n\t\t\tcut.CenterVertically().MountRoot();\n\n\t\t\t_d.AssertFrame(left: 0, top: 1, right: 4, bottom: 4);\n\t\t\t_d.AssertHasNativeParent();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/SubdivideTest.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class SubdivideTest\n\t{\n\t\treadonly TestControl _a = new TestControl(\"control a\", 1, 1);\n\t\treadonly TestControl _b = new TestControl(\"control b\", 2, 2);\n\t\treadonly TestControl _c = new TestControl(\"control c\", 3, 3);\n\n\t\t[Test]\n\t\tpublic void SubdivideHorizontally()\n\t\t{\n\t\t\tvar root = Layout.Subdivide(Axis2D.Horizontal, _a.Span(1), _b.Span(2), _c.Span(1));\n\t\t\troot.AssertDesiredSize(\"root control\", 0, 3);\n\t\t\troot.MountRoot();\n\n\t\t\t_a.AssertFrame(left: 0, top: 0, right: 1, bottom: 4);\n\t\t\t_a.AssertAvailableSize(1, 4);\n\t\t\t_a.AssertHasNativeParent();\n\n\t\t\t_b.AssertFrame(left: 1, top: 0, right: 3, bottom: 4);\n\t\t\t_b.AssertAvailableSize(2, 4);\n\t\t\t_b.AssertHasNativeParent();\n\n\t\t\t_c.AssertFrame(left: 3, top: 0, right: 4, bottom: 4);\n\t\t\t_c.AssertAvailableSize(1, 4);\n\t\t\t_c.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SubdivideVertically()\n\t\t{\n\t\t\tvar root = Layout.Subdivide(Axis2D.Vertical, _a.Span(1), _b.Span(2), _c.Span(1));\n\t\t\troot.AssertDesiredSize(\"root control\", 3, 0);\n\t\t\troot.MountRoot();\n\n\t\t\t_a.AssertFrame(left: 0, top: 0, right: 4, bottom: 1);\n\t\t\t_a.AssertAvailableSize(4, 1);\n\t\t\t_a.AssertHasNativeParent();\n\n\t\t\t_b.AssertFrame(left: 0, top: 1, right: 4, bottom: 3);\n\t\t\t_b.AssertAvailableSize(4, 2);\n\t\t\t_b.AssertHasNativeParent();\n\n\t\t\t_c.AssertFrame(left: 0, top: 3, right: 4, bottom: 4);\n\t\t\t_c.AssertAvailableSize(4, 1);\n\t\t\t_c.AssertHasNativeParent();\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Subdivide_SnapsToPoints()\n\t\t{\n\t\t\tvar root = Layout.Subdivide(Axis2D.Horizontal, _a.Span(1.25), _b.Span(1.75), _c.Span(1)).WithWidth(8);\n\t\t\troot.AssertDesiredSize(\"root control\", 8, 3);\n\t\t\troot.MountRoot();\n\n\t\t\t_a.AssertFrame(left: 0, top: 0, right: 1, bottom: 4);\n\t\t\t_a.AssertAvailableSize(1.25, 4);\n\t\t\t_a.AssertHasNativeParent();\n\n\t\t\t_b.AssertFrame(left: 1, top: 0, right: 3, bottom: 4);\n\t\t\t_b.AssertAvailableSize(1.75, 4);\n\t\t\t_b.AssertHasNativeParent();\n\n\t\t\t_c.AssertFrame(left: 3, top: 0, right: 4, bottom: 4);\n\t\t\t_c.AssertAvailableSize(1, 4);\n\t\t\t_c.AssertHasNativeParent();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/SumTree.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class SumTreeTests\n\t{\n\t\t// Lists are the free monoid, so if stuff works for lists it works for any monoid\n\t\tSumTree<ImmutableList<T>> Empty<T>()\n\t\t{\n\t\t\treturn SumTree<ImmutableList<T>>.Empty(ImmutableList<T>.Empty, (x, y) => x.Concat(y).ToImmutableList());\n\t\t}\n\n\t\tSumTree<ImmutableList<T>> FromEnumerable<T>(IEnumerable<T> items)\n\t\t{\n\t\t\tvar result = Empty<T>();\n\t\t\tforeach (var item in items)\n\t\t\t\tresult = result.Insert(result.Count, new [] { item }.ToImmutableList());\n\t\t\treturn result;\n\t\t}\n\n\t\treadonly IReadOnlyList<int>[] _testLists =\n\t\t{\n\t\t\tnew int[] { },\n\t\t\tnew [] { 1 },\n\t\t\tnew [] { 1, 2 },\n\t\t\tnew [] { 1, 2, 3 },\n\t\t};\n\n\t\t[Test]\n\t\tpublic void Sum_of_Clear_returns_unit()\n\t\t{\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tCollectionAssert.AreEqual(ImmutableList<int>.Empty, FromEnumerable(list).Clear().Sum());\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Get_matches_list()\n\t\t{\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var i = 0; i < list.Count; ++i)\n\t\t\t\t{\n\t\t\t\t\tCollectionAssert.AreEqual(new[] { list[i] }.ToImmutableList(), tree[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Insert_matches_list()\n\t\t{\n\t\t\tvar item = new[] { 0 }.ToImmutableList();\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var index = 0; index <= list.Count; ++index)\n\t\t\t\t{\n\t\t\t\t\tvar mlist = list.ToList();\n\t\t\t\t\tmlist.Insert(index, 0);\n\t\t\t\t\tvar mtree = tree.Insert(index, item);\n\t\t\t\t\tfor (var i = 0; i < mlist.Count; ++i)\n\t\t\t\t\t\tCollectionAssert.AreEqual(new[] { mlist[i] }.ToImmutableList(), mtree[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Sum_after_Insert_matches_list()\n\t\t{\n\t\t\tvar item = new[] { 10 }.ToImmutableList();\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var index = 0; index <= list.Count; ++index)\n\t\t\t\t{\n\t\t\t\t\tvar mlist = list.ToList();\n\t\t\t\t\tmlist.Insert(index, 10);\n\t\t\t\t\tvar mtree = tree.Insert(index, item);\n\n\t\t\t\t\tCollectionAssert.AreEqual(mlist.ToImmutableList(), mtree.Sum());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RemoveAt_matches_list()\n\t\t{\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var index = 0; index < list.Count; ++index)\n\t\t\t\t{\n\t\t\t\t\tvar mlist = list.ToList();\n\t\t\t\t\tmlist.RemoveAt(index);\n\t\t\t\t\tvar mtree = tree.RemoveAt(index);\n\t\t\t\t\tfor (var i = 0; i < mlist.Count; ++i)\n\t\t\t\t\t\tCollectionAssert.AreEqual(new[] { mlist[i] }.ToImmutableList(), mtree[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Sum_after_RemoveAt_matches_list()\n\t\t{\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var index = 0; index < list.Count; ++index)\n\t\t\t\t{\n\t\t\t\t\tvar mlist = list.ToList();\n\t\t\t\t\tmlist.RemoveAt(index);\n\t\t\t\t\tvar mtree = tree.RemoveAt(index);\n\n\t\t\t\t\tCollectionAssert.AreEqual(mlist.ToImmutableList(), mtree.Sum());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReplaceAt_matches_list()\n\t\t{\n\t\t\tvar item = new[] { 10 }.ToImmutableList();\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var index = 0; index < list.Count; ++index)\n\t\t\t\t{\n\t\t\t\t\tvar mlist = list.ToList();\n\t\t\t\t\tmlist[index] = 10;\n\t\t\t\t\tvar mtree = tree.ReplaceAt(index, item);\n\t\t\t\t\tfor (var i = 0; i < mlist.Count; ++i)\n\t\t\t\t\t\tCollectionAssert.AreEqual(new[] { mlist[i] }.ToImmutableList(), mtree[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Sum_after_ReplaceAt_matches_list()\n\t\t{\n\t\t\tvar item = new[] { 10 }.ToImmutableList();\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var index = 0; index < list.Count; ++index)\n\t\t\t\t{\n\t\t\t\t\tvar mlist = list.ToList();\n\t\t\t\t\tmlist[index] = 10;\n\t\t\t\t\tvar mtree = tree.ReplaceAt(index, item);\n\n\t\t\t\t\tCollectionAssert.AreEqual(mlist.ToImmutableList(), mtree.Sum());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Prefix_sum_matches_list_prefix_sum()\n\t\t{\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tfor (var index = 0; index < list.Count; ++index)\n\t\t\t\t{\n\t\t\t\t\tCollectionAssert.AreEqual(list.Take(index).ToImmutableList(), tree.Sum(index));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void out_of_bounds_operations_throw()\n\t\t{\n\t\t\tvar item = new[] { 10 }.ToImmutableList();\n\t\t\tforeach (var list in _testLists)\n\t\t\t{\n\t\t\t\tvar tree = FromEnumerable(list);\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.Insert(-1, item));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.Insert(tree.Count + 1, item));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.RemoveAt(-1));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.RemoveAt(tree.Count));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.ReplaceAt(-1, item));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.ReplaceAt(tree.Count, item));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.Sum(-1));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() => tree.Sum(tree.Count + 1));\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() =>\n\t\t\t\t{\n\t\t\t\t\tvar unused = tree[-1];\n\t\t\t\t});\n\t\t\t\tAssert.Throws<IndexOutOfRangeException>(() =>\n\t\t\t\t{\n\t\t\t\t\tvar unused = tree[tree.Count];\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/SvgTests.cs",
    "content": "﻿using System;\nusing System.Drawing;\nusing System.IO;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class SvgImageTests\n\t{\n\t\t[Test]\n\t\tpublic void Loads_image_with_specified_color_map()\n\t\t{\n\t\t\t// With no color map defined\n\t\t\tLoadAndAssertTestImage(\n\t\t\t\t\"GreenBox.svg\",\n\t\t\t\tb =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(b.Height, Is.EqualTo(4));\n\t\t\t\t\tAssert.That(b.Width, Is.EqualTo(4));\n\t\t\t\t\tAssertPixelEqualWithinTolerance(b, 1, 1, Color.FromRgba(0x00ff00ff));\n\t\t\t\t});\n\t\t\t// With red color map defined\n\t\t\tLoadAndAssertTestImage(\n\t\t\t\t\"GreenBox.svg\",\n\t\t\t\tb =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(b.Height, Is.EqualTo(4));\n\t\t\t\t\tAssert.That(b.Width, Is.EqualTo(4));\n\t\t\t\t\tAssertPixelEqualWithinTolerance(b, 1, 1, Color.FromRgba(0xff0000ff));\n\t\t\t\t},\n\t\t\t\tcolorMap: new AlwaysRedColorMap());\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Loads_image_with_specified_scale_factor()\n\t\t{\n\t\t\tLoadAndAssertTestImage(\n\t\t\t\t\"HalfTransparentBox.svg\",\n\t\t\t\tb =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(b.Height, Is.EqualTo(8));\n\t\t\t\t\tAssert.That(b.Width, Is.EqualTo(8));\n\t\t\t\t},\n\t\t\t\tscaleFactor: new Ratio<Pixels, Points>(2));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void Blending_of_half_pixel_against_background()\n\t\t{\n\t\t\tLoadAndAssertTestImage(\n\t\t\t\t\"GreenHalfPixel.svg\",\n\t\t\t\tb =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(b.Height, Is.EqualTo(1));\n\t\t\t\t\tAssert.That(b.Width, Is.EqualTo(1));\n\t\t\t\t\tAssertPixelEqualWithinTolerance(b, 0, 0, Color.FromRgba(0x00FF0080));\n\t\t\t\t});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Alpha_blending_on_transparent_background()\n\t\t{\n\t\t\tLoadAndAssertTestImage(\n\t\t\t\t\"HalfTransparentBox.svg\",\n\t\t\t\tb =>\n\t\t\t\t{\n\t\t\t\t\tAssert.That(b.Height, Is.EqualTo(4));\n\t\t\t\t\tAssert.That(b.Width, Is.EqualTo(4));\n\t\t\t\t\tAssertPixelEqualWithinTolerance(b, 2, 2, Color.FromRgba(0xc7c7c77f));\n\t\t\t\t});\n\t\t}\n\n\t\tstatic void AssertPixelEqualWithinTolerance(Bitmap b, int x, int y, Color expected)\n\t\t{\n\t\t\tvar pixel = b.GetPixel(x, y);\n\t\t\tvar actual = Color.FromBytes(pixel.R, pixel.G, pixel.B, pixel.A);\n\t\t\tvar tolerance = 2 / 255.0;\n\t\t\tAssert.That(actual.R, Is.EqualTo(expected.R).Within(tolerance));\n\t\t\tAssert.That(actual.G, Is.EqualTo(expected.G).Within(tolerance));\n\t\t\tAssert.That(actual.B, Is.EqualTo(expected.B).Within(tolerance));\n\t\t\tAssert.That(actual.A, Is.EqualTo(expected.A).Within(tolerance));\n\t\t}\n\n\t\tstatic void LoadAndAssertTestImage(\n\t\t\tstring resourceName,\n\t\t\tAction<Bitmap> assertions,\n\t\t\tRatio<Pixels, Points> scaleFactor = default(Ratio<Pixels, Points>),\n\t\t\tOptional<IColorMap> colorMap = default(Optional<IColorMap>))\n\t\t{\n\t\t\tvar image = Image.GetImageFromResource(\n\t\t\t\ttypeof(ImageTests).Namespace + \".Images.\" + resourceName,\n\t\t\t\ttypeof(ImageTests).Assembly);\n\t\t\tusing (var s = image.Load<Stream>(scaleFactor, colorMap, cache: false).Image)\n\t\t\t{\n\t\t\t\tusing (var bitmap = new Bitmap(s))\n\t\t\t\t{\n\t\t\t\t\tassertions(bitmap);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tclass AlwaysRedColorMap : IColorMap\n\t\t{\n\t\t\tpublic Color Map(Color color)\n\t\t\t{\n\t\t\t\treturn Color.FromRgb(0xff0000);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/TestControl.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing NUnit.Framework;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.Fusion.Tests\n{\n\tpublic class TestControl : IControl\n\t{\n\t\treadonly string _name;\n\n\t\tpublic TestControl(string name, Points width, Points height)\n\t\t{\n\t\t\t_name = name;\n\t\t\tvar mountLocation = new ReplaySubject<IMountLocation>(1);\n\n\t\t\tMount = mountLocation.OnNext;\n\t\t\tIsRooted = mountLocation.Switch(p => p.IsRooted);\n\t\t\tNativeHandle = null;\n\t\t\tDesiredSize = Size.Create(\n\t\t\t\tObservable.Return(new Points(width)),\n\t\t\t\tObservable.Return(new Points(height)));\n\n\t\t\tmountLocation.Switch(p => p.AvailableSize)\n\t\t\t\t.Transpose().Subscribe(r => _available = r);\n\t\t\tmountLocation.Switch(p => p.NativeFrame)\n\t\t\t\t.Transpose().Subscribe(r => _rectangle = r);\n\t\t}\n\n\t\tpublic Rectangle<IObservable<Points>> NativeFrame { get; set; }\n\n\n\t\tpublic Action<IMountLocation> Mount { get; private set; }\n\t\tpublic IObservable<bool> IsRooted { get; private set; }\n\n\n\t\tpublic Size<IObservable<Points>> DesiredSize { get; set; }\n\t\tpublic object NativeHandle { get; private set; }\n\n\t\tOptional<Rectangle<Points>> _rectangle = Optional.None();\n\t\tOptional<Size<Points>> _available = Optional.None();\n\n\t\tpublic void AssertAvailableSize(Points width, Points height)\n\t\t{\n\t\t\tAssert.IsTrue(_available.HasValue, _name.Capitalize() + \" have not receieved an available size\");\n\t\t\tAssert.AreEqual(width, _available.Value.Width, _name.Capitalize() + \" got wrong available width\");\n\t\t\tAssert.AreEqual(height, _available.Value.Height, _name.Capitalize() + \" got wrong available height\");\n\n\t\t}\n\n\t\tpublic void AssertFrame(Points left, Points top, Points right, Points bottom)\n\t\t{\n\t\t\tvar actualTop = _rectangle.Value.Top();\n\t\t\tvar actualBottom = _rectangle.Value.Bottom();\n\n\t\t\tif (Platform.IsMac)\n\t\t\t{\n\t\t\t\tactualTop = 4 - _rectangle.Value.Bottom();\n\t\t\t\tactualBottom = 4 - _rectangle.Value.Top();\n\t\t\t}\n\n\t\t\tAssert.IsTrue(_rectangle.HasValue, _name.Capitalize() + \" has not receieved a frame\");\n\t\t\tAssert.AreEqual(left, _rectangle.Value.Left(), _name.Capitalize() + \" has wrong Left value\");\n\t\t\tAssert.AreEqual(top, actualTop, _name.Capitalize() + \" has wrong Top, value\");\n\t\t\tAssert.AreEqual(right, _rectangle.Value.Right(), _name.Capitalize() + \" has wrong Right value\");\n\t\t\tAssert.AreEqual(bottom, actualBottom, _name.Capitalize() + \" has wrong Bottom value\");\n\t\t}\n\n\n\n\t}\n\n\tstatic class NodeExtensions\n\t{\n\t\t/*public static void AssertVisualSelf(this IControl control, IControl visualSelf)\n\t\t{\n\t\t\tAssert.AreEqual(visualSelf, control.VisualSelf.FirstAsync().ToTask().Result);\n\t\t}\n\n\t\tpublic static void AssertVisualParent(this IControl control, Optional<IControl> visualParent)\n\t\t{\n\t\t\tAssert.AreEqual(visualParent, control.VisualParent.FirstAsync().ToTask().Result);\n\t\t}*/\n\n\t\tpublic static void MountRoot(this IControl control)\n\t\t{\n\t\t\tvar size = Size.Create(Observable.Return(new Points(4)), Observable.Return(new Points(4)));\n\t\t\tcontrol.Mount(\n\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t{\n\t\t\t\t\tIsRooted = Observable.Return(true),\n\t\t\t\t\tAvailableSize = size,\n\t\t\t\t\tNativeFrame= ObservableMath.RectangleWithSize(size),\n\t\t\t\t});\n\n\t\t\tvar foo = control.NativeHandle;\n\t\t}\n\n\t\tpublic static void AssertHasNativeParent(this TestControl control)\n\t\t{\n\t\t\t//Assert.AreEqual(NativeParent, control.NativeParent().FirstAsync().ToTask().GetResultAndUnpackExceptions().Value);\n\t\t}\n\n\t\tpublic static void AssertDesiredSize(this IControl control, string name, Points width, Points height)\n\t\t{\n\t\t\tAssert.AreEqual(width, control.DesiredSize.Width.FirstAsync().ToTask().GetResultAndUnpackExceptions(), name.Capitalize() + \" has wrong desired width\");\n\t\t\tAssert.AreEqual(height, control.DesiredSize.Height.FirstAsync().ToTask().GetResultAndUnpackExceptions(), name.Capitalize() + \" has wrong desired height\");\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/UserSettingsSerializationTest.cs",
    "content": "﻿using Newtonsoft.Json;\nusing NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tclass UserSettingsSerializationTest\n\t{\n\t\t[Test]\n\t\tpublic void ReadCurrentPointsFormat()\n\t\t{\n\t\t\tvar s = JsonConvert.DeserializeObject<Points>(\"1337\", FusionJsonSerializer.Settings);\n\t\t\tAssert.AreEqual(new Points(1337), s);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConvertPoints()\n\t\t{\n\t\t\tvar s = new Points(2);\n\t\t\tvar json = JsonConvert.SerializeObject(s, Formatting.Indented, FusionJsonSerializer.Settings);\n\t\t\tvar s2 = JsonConvert.DeserializeObject<Points>(json, FusionJsonSerializer.Settings);\n\t\t\tAssert.AreEqual(s, s2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConvertPointOfPoints()\n\t\t{\n\t\t\tvar p = new Point<Points>(1, 2);\n\n\t\t\tvar json = JsonConvert.SerializeObject(p, Formatting.Indented, FusionJsonSerializer.Settings);\n\t\t\tvar p2 = JsonConvert.DeserializeObject<Point<Points>>(json, FusionJsonSerializer.Settings);\n\t\t\tAssert.AreEqual(p, p2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReadCurrentPointOfPointsFormat()\n\t\t{\n\t\t\tvar p = JsonConvert.DeserializeObject<Point<Points>>(\"[2,3]\", FusionJsonSerializer.Settings);\n\t\t\tAssert.AreEqual(new Point<Points>(2, 3), p);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConvertSizeOfPoints()\n\t\t{\n\t\t\tvar s = new Size<Points>(2, 3);\n\t\t\tvar json = JsonConvert.SerializeObject(s, Formatting.Indented, FusionJsonSerializer.Settings);\n\t\t\tvar s2 = JsonConvert.DeserializeObject<Size<Points>>(json, FusionJsonSerializer.Settings);\n\t\t\tAssert.AreEqual(s, s2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReadCurrentSizeOfPointsFormat()\n\t\t{\n\t\t\tvar s = JsonConvert.DeserializeObject<Size<Points>>(\"[2,  3]\", FusionJsonSerializer.Settings);\n\t\t\tAssert.AreEqual(new Size<Points>(2, 3), s);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/tests/UserSettingsTest.cs",
    "content": "﻿//using System;\n//using System.IO;\n//using System.Reactive.Linq;\n//using System.Runtime.CompilerServices;\n//using NUnit.Framework;\n\n\n//namespace Outracks.Fusion.Tests\n//{\n//\t[TestFixture]\n//\tclass UserSettingsTest\n//\t{\n//\t\tclass SettingsStub\n//\t\t{\n//\t\t\tpublic bool BoolSetting { get; set; }\n//\t\t\tpublic Size<Points> SizeSetting { get; set; }\n//\t\t}\n\n//\t\tstatic Action<SettingsStub> DummyWriter()\n//\t\t{\n//\t\t\treturn (s) => { };\n//\t\t}\n\n\n//\t\t//[Test]\n//\t\t//public void AskingForNonExistingPropertyReturnsOptionalNone()\n//\t\t//{\n//\t\t//\tvar settings = PersistantSettings<SettingsStub>.Create(new object(), (_) => { });\n//\t\t//\tvar notPersistantSetting = settings.Setting<bool>(\"Foo\");\n\n//\t\t//\tvar optional = notPersistantSetting.Value.Select(v => v.Equals(Optional.None<bool>()));\n\n//\t\t//\tConsole.WriteLine(\"foobar\");\n//\t\t//\t//Assert.That(() => { }, Throws.TypeOf<PropertyNotFoundException>()); // No setting called \"Foo\" causes runtime exception\n//\t\t//}\n\n\n//\t\t[Test]\n//\t\tpublic void RequestingSettingsOfWrongTypeThrows()\n//\t\t{\n//\t\t\tvar settings = PersistantSettings<SettingsStub>.Create(new SettingsStub(), DummyWriter());\n//\t\t\tAssert.That(() => { settings.Setting<int>(\"BoolSetting\"); }, Throws.TypeOf<InvalidCastException>());\n//\t\t}\n\n//\t\t[Test]\n//\t\tpublic void BehaviorSubjectFromUserSettingsHasExpectedDefaultValue()\n//\t\t{\n//\t\t\tvar settingsdata = new SettingsStub\n//\t\t\t{\n//\t\t\t\tBoolSetting = true\n//\t\t\t};\n//\t\t\tvar settings = PersistantSettings<SettingsStub>.Create(settingsdata, DummyWriter());\n//\t\t\tvar boolsettingsub = settings.Setting<bool>(\"BoolSetting\");\n\n//\t\t\tAssert.NotNull(boolsettingsub);\n//\t\t\t//Assert.True(boolsettingsub.Value.Value);\n//\t\t}\n\n\n//\t\t[Test]\n//\t\tpublic void ChangingBehaviorSubjectUpdatesSettings()\n//\t\t{\n//\t\t\t//dynamic settingsdata = new ExpandoObject(); // Fails to extract properties by name\n//\t\t\t//settingsdata.BoolSetting = true;\n//\t\t\t// not anonymus object has readonly properties\n//\t\t\tvar settingsdata = new SettingsStub{ BoolSetting = true };\n\n//\t\t\tvar settings = PersistantSettings<SettingsStub>.Create(settingsdata, DummyWriter());\n//\t\t\tvar boolsettingsub = settings.Setting<bool>(\"BoolSetting\");\n//\t\t\tvar initialValue = boolsettingsub.Value;\n\n//\t\t\t/*boolsettingsub.OnNext(!initialValue.Value);\n\n//\t\t\tAssert.That(boolsettingsub.Value == false);\n//\t\t\tAssert.False(settingsdata.BoolSetting);*/\n//\t\t}\n\n\n//\t\t[Test]\n//\t\tpublic void SizeSettingHasExpecteDefaultValue()\n//\t\t{\n//\t\t\tvar settingsdata = new SettingsStub\n//\t\t\t{\n//\t\t\t\tSizeSetting = new Size<Points>(123, 456)\n//\t\t\t};\n\n//\t\t\tvar settings = PersistantSettings<SettingsStub>.Create(settingsdata, DummyWriter());\n//\t\t\tvar sizeSetting = settings.Setting<Size<Points>>(\"SizeSetting\");\n\n//\t\t\t//Assert.AreEqual(new Points(123), sizeSetting.Value.Value.Width);\n//\t\t\t//Assert.AreEqual(new Points(456), sizeSetting.Value.Value.Height);\n//\t\t}\n\n\n//\t\t[Test]\n//\t\tpublic void UpdatingSizeBehaviorSubjectUpdatesSettings()\n//\t\t{\n//\t\t\tvar settingsdata = new SettingsStub\n//\t\t\t{\n//\t\t\t\tSizeSetting = new Size<Points>(123, 456)\n//\t\t\t};\n\n//\t\t\tvar settings = PersistantSettings<SettingsStub>.Create(settingsdata, DummyWriter());\n//\t\t\tvar sizeSetting = settings.Setting<Size<Points>>(\"SizeSetting\");\n//\t\t\tvar editedSize = new Size<Points>(100, 100);\n//\t\t\t//sizeSetting.Value.OnNext(editedSize);\n\n//\t\t\tAssert.AreEqual(editedSize, settingsdata.SizeSetting);\n//\t\t}\n\n//\t\t[Test]\n//\t\tpublic void WriteTofile()\n//\t\t{\n//\t\t\tvar settingsdata = new SettingsStub\n//\t\t\t{\n//\t\t\t\tSizeSetting = new Size<Points>(123, 456)\n//\t\t\t};\n\n//\t\t\tvar tmpfilename = Path.GetTempFileName();\n//\t\t\tConsole.WriteLine(tmpfilename);\n\n//\t\t\tvar settings = PersistantSettings<SettingsStub>.Create(settingsdata,\n//\t\t\t\t(s) =>\n//\t\t\t\t{\n//\t\t\t\t\tusing (var f = File.Open(tmpfilename, FileMode.OpenOrCreate, FileAccess.Write))\n//\t\t\t\t\tusing (var sw = new StreamWriter(f))\n//\t\t\t\t\t{\n//\t\t\t\t\t\tsw.WriteLine(s);\n//\t\t\t\t\t}\n//\t\t\t\t});\n//\t\t\tvar sizeSetting = settings.Setting<Size<Points>>(\"SizeSetting\");\n\n//\t\t}\n\n//\t\t// TODO Should this test be here?\n//\t\t[Test]\n//\t\tpublic void PropertyOfOptionalValue()\n//\t\t{\n//\t\t\tvar optional = Optional.Some<bool>(true);\n//\t\t\tAssert.That(optional.HasValue);\n//\t\t\tvar none = Optional.None<bool>();\n//\t\t\tAssert.False(none.HasValue);\n\n//\t\t\tvar prop = Property.Create<Optional<int>>(32);\n//\t\t\tvar f = prop.Value.Select(p => p.HasValue ? p.Value : -2);\n\n//\t\t\tvar fv = f.Select(v => v);\n//\t\t\tAssert.AreEqual(32, fv);\n\n//\t\t\tvar nonoptionalprop = prop.Convert(optional1 => optional1.Or(-3), Optional.Some);\n\n//\t\t\tvar g = nonoptionalprop.Value.Select(p => p);\n//\t\t\tAssert.AreEqual(32, g);\n\n//\t\t}\n\n\n//\t}\n//}\n"
  },
  {
    "path": "src/fusion/tests/WithSizeTest.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.Fusion.Tests\n{\n\t[TestFixture]\n\tpublic class WithSizeTest\n\t{\n\t\treadonly TestControl _control = new TestControl(\"sized control\", 100, 100);\n\n\t\t[Test]\n\t\tpublic void WithSize()\n\t\t{\n\t\t\tvar root = _control.WithSize(Size.Create<Points>(2,4));\n\t\t\troot.AssertDesiredSize(\"root control\", 2,4);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertHasNativeParent();\n\t\t\t_control.AssertFrame(0,0,4,4);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WithHeight()\n\t\t{\n\t\t\tvar root = _control.WithHeight(2);\n\t\t\troot.AssertDesiredSize(\"root control\", 100, 2);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertHasNativeParent();\n\t\t\t_control.AssertFrame(0, 0, 4, 4);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WithWidth()\n\t\t{\n\t\t\tvar root = _control.WithWidth(2);\n\t\t\troot.AssertDesiredSize(\"root control\", 2, 100);\n\t\t\troot.MountRoot();\n\n\t\t\t_control.AssertHasNativeParent();\n\t\t\t_control.AssertFrame(0, 0, 4, 4);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/fusion/win/Application.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing Outracks.Fuse;\nusing Outracks.Fusion.Windows.Controls;\nusing Outracks.IO;\nusing Outracks.UnoHost.Windows;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class Application : IApplication\n\t{\n\t\tpublic static bool MonitorAware = false;\n\n\t\tstatic Application()\n\t\t{\n\t\t\tif (MonitorAware)\n\t\t\t\tDpiAwareness.SetDpiAware(DpiAwareness.ProcessDpiAwareness.MonitorAware);\n\t\t\telse\n\t\t\t\tDpiAwareness.SetDpiAware(DpiAwareness.ProcessDpiAwareness.SystemAware);\n\t\t}\n\n\t\tSystem.Windows.Application _app;\n\t\tOptional<DocumentAppHandler> _documentApp;\n\t\tDispatcher _dispatcher;\n\n\t\tpublic bool InitializeDocumentApp(IList<string> args, string applicationName)\n\t\t{\n\t\t\t_dispatcher = _dispatcher ?? new Dispatcher(Thread.CurrentThread);\n\n\t\t\tvar documentApp = new DocumentAppHandler(ReportFactory.FallbackReport, applicationName, args.ToArray());\n\t\t\t_documentApp = documentApp;\n\t\t\tif (documentApp.IsOnlyInstance())\n\t\t\t{\n\t\t\t\tInitialize(args);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tdocumentApp.RunClient();\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void Initialize(IList<string> args)\n\t\t{\n\t\t\t_dispatcher = _dispatcher ?? new Dispatcher(Thread.CurrentThread);\n\t\t\tFusion.Application.PerFrame = _dispatcher.PerFrame;\n\t\t\tFusion.Application.MainThread = _dispatcher;\n\n\t\t\tDesktop = new WindowsDialog<object>();\n\n\t\t\tDraggingImplementation.Initialize(_dispatcher);\n\t\t\tLabelImplementation.Initialize(_dispatcher, Observable.Return(new Ratio<Pixels, Points>(1.0)));\n\t\t\t//ListBoxImplementation.Initialize(dispatcher);\n\t\t\tTextBoxImplementation.Initialize(_dispatcher);\n\t\t\tClippingImplementation.Initialize(_dispatcher);\n\t\t\tScrollingImplementation.Initialize(_dispatcher);\n\t\t\tEffectsImplementation.Initialize(_dispatcher);\n\t\t\tContextMenuImplementation.Initialize(_dispatcher);\n\t\t\tCursorsImplementation.Initialize(_dispatcher);\n\t\t\tToolTipImplementation.Initialize(_dispatcher);\n\t\t\tButtonImplementation.Initialize(_dispatcher);\n\t\t\tRectangleImplementation.Initialize(_dispatcher);\n\t\t\tCircleImplementation.Initialize(_dispatcher);\n\t\t\tImageImplementation.Initialize(_dispatcher);\n\t\t\tOverlayImplementation.Initialize(_dispatcher);\n\t\t\tLineImplementation.Initialize(_dispatcher);\n\t\t\tDropDownImplementation.Initialize(_dispatcher);\n\t\t\tSliderImplementation.Initialize(_dispatcher);\n\t\t\tColorPickerImplementation.Initialize(_dispatcher);\n\t\t\tWebViewImplementation.Initialize(_dispatcher);\n\t\t\tKeyboardImplementation.Initialize(_dispatcher);\n\t\t\tLogViewImplementation.Initialize(_dispatcher);\n\t\t\tPointerImplementation.Initialize(_dispatcher);\n\t\t\tTransformation.Initialize(_dispatcher);\n\t\t\tLayoutTrackerImplementation.Initialize();\n\t\t\tFileDialogs.Initialize();\n\t\t\tWinFormsMessageBox.Initialize();\n\n\t\t\t_app = new System.Windows.Application();\n\t\t\t_app.ShutdownMode = ShutdownMode.OnLastWindowClose;\n\t\t\t_app.Exit += (s, a) =>\n\t\t\t{\n\t\t\t\tif (Terminating != null) Terminating();\n\t\t\t};\n\n\t\t\tEditMenu =\n\t\t\t\t  /*FromWpfCommand(ApplicationCommands.Undo)\n\t\t\t\t+ FromWpfCommand(ApplicationCommands.Redo)\n\t\t\t\t+ MenuItem.CreateSeparator()\n\t\t\t\t+ */FromWpfCommand(Strings.SubMenu_Edit_Cut, ApplicationCommands.Cut)\n\t\t\t\t+ FromWpfCommand(Strings.SubMenu_Edit_Copy, ApplicationCommands.Copy)\n\t\t\t\t+ FromWpfCommand(Strings.SubMenu_Edit_Paste, ApplicationCommands.Paste)\n\t\t\t\t+ FromWpfCommand(Strings.SubMenu_Edit_Delete, ApplicationCommands.Delete)\n\t\t\t\t+ FromWpfCommand(Strings.SubMenu_Edit_SelectAll, ApplicationCommands.SelectAll);\n\t\t}\n\n\t\tstatic Menu FromWpfCommand(string commandText, RoutedUICommand command)\n\t\t{\n\t\t\treturn Menu.Item(commandText, Observable\n\t\t\t\t\t.FromEventPattern(command,\"CanExecuteChanged\")\n\t\t\t\t\t.Select(_ => Unit.Default)\n\t\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t\t.Select(_ => command.CanExecute(null, null))\n\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t.Switch(canExecute => Command.Create(\n\t\t\t\t\t\tisEnabled: canExecute,\n\t\t\t\t\t\taction: () => command.Execute(null, null))),\n\t\t\t\thotkey: command.InputGestures.ToHotKey());\n\t\t}\n\n\t\tpublic void Run()\n\t\t{\n\t\t\t_documentApp.Do(d => d.RunHost());\n\t\t\t_app.Run();\n\t\t}\n\n\t\tpublic void Run(Window window)\n\t\t{\n\t\t\t_documentApp.Do(d => d.RunHost());\n\t\t\t_app.Run();\n\t\t}\n\n\t\tpublic void Exit(byte exitCode)\n\t\t{\n\t\t\tif (System.Windows.Forms.Application.MessageLoop)\n\t\t\t{\n\t\t\t\tEnvironment.ExitCode = exitCode;\n\t\t\t\tSystem.Windows.Forms.Application.Exit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_app.Dispatcher.Invoke(() => _app.Shutdown(exitCode));\n\t\t\t}\n\t\t}\n\n\t\tpublic void ShowOpenDialog(FileFilter[] fileFilters)\n\t\t{\n\t\t\tTask.Run(\n\t\t\t\tasync () =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar fileDialogs = new FileDialogs(FocusedWindow);\n\n\t\t\t\t\t\tvar result = await fileDialogs.OpenFile(new FileDialogOptions(\"Open\", fileFilters));\n\t\t\t\t\t\tif (!result.HasValue)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait OpenDocument(result.Value.Path, true);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tReportFactory.FallbackReport.Exception(\"Failed to open file with file dialog.\", e);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\tSystem.Windows.Window FocusedWindow\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _app.Dispatcher.Invoke(() =>\n\t\t\t\t{\n\t\t\t\t\tforeach (var windowObject in _app.Windows)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar window = windowObject as System.Windows.Window;\n\t\t\t\t\t\tif (window == null) continue;\n\n\t\t\t\t\t\tif (window.IsActive)\n\t\t\t\t\t\t\treturn window;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tpublic IObservable<Window> DocumentOpened\n\t\t{\n\t\t\tget { return _documentApp.Value.DocumentOpened; }\n\t\t}\n\n\t\t// Not used on Windows.\n\t\tpublic Optional<Menu> DefaultMenu { get; set; }\n\n\t\tpublic IDialog<object> Desktop { get; private set; }\n\t\tpublic Menu EditMenu { get; private set; }\n\n\t\tpublic event Action Terminating;\n\n\t\tpublic async Task<IDocument> OpenDocument(AbsoluteFilePath path, bool showWindow)\n\t\t{\n\t\t\tif(!_documentApp.HasValue)\n\t\t\t\tthrow new NotImplementedException(\"Only document apps supports Open Document\");\n\n\t\t\tvar documentApp = _documentApp.Value;\n\t\t\treturn await documentApp.OpenDocumentWindow(path);\n\t\t}\n\n\t\t// Legacy\n\t\tpublic ITrayApplication CreateTrayApplication(IReport errorHandler, IObservable<string> title, Menu menu, IObservable<Icon> icon)\n\t\t{\n\t\t\treturn new WindowsTrayApplication(title, menu, icon);\n\t\t}\n\t}\n\n\tclass WindowsDialog<T> : IDialog<T>\n\t{\n\t\treadonly ISubject<T> _result = new ReplaySubject<T>(1);\n\t\tAction _onClose;\n\t\tOptional<System.Windows.Window> _parent;\n\t\tBehaviorSubject<IImmutableList<IControl>> _modalDialogs;\n\n\t\tpublic void Focus()\n\t\t{\n\t\t\t_parent.Do(win =>\n\t\t\t\twin.Dispatcher.InvokeAsync(() =>\n\t\t\t\t{\n\t\t\t\t\tif (win.WindowState == System.Windows.WindowState.Minimized)\n\t\t\t\t\t{\n\t\t\t\t\t\twin.WindowState = System.Windows.WindowState.Normal;\n\t\t\t\t\t}\n\t\t\t\t\twin.Activate();\n\t\t\t\t}));\n\t\t}\n\n\t\tpublic void Close(T result = default(T))\n\t\t{\n\t\t\t_onClose();\n\t\t\t_result.OnNext(result);\n\t\t}\n\n\t\tpublic void CloseWithError(Exception e)\n\t\t{\n\t\t\t_onClose();\n\t\t\t_result.OnError(e);\n\t\t}\n\n\t\tpublic void CreateSingletonWindow(IObservable<bool> isVisible, Func<IDialog<object>, Window> window)\n\t\t{\n\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t{\n\t\t\t\tvar modalDialogs = new BehaviorSubject<IImmutableList<IControl>>(ImmutableList<IControl>.Empty);\n\n\t\t\t\tvar childWindow = new WindowsDialog<object>();\n\n\t\t\t\tvar model = OverlayModalDialogs(window(childWindow), modalDialogs);\n\n\t\t\t\tvar wnd = WindowImplementation.Initialize(model);\n\n\t\t\t\tchildWindow._modalDialogs = modalDialogs;\n\t\t\t\tchildWindow._parent = wnd;\n\t\t\t\tchildWindow._onClose = () =>\n\t\t\t\t\tFusion.Application.MainThread.Schedule(wnd.Hide);\n\n\t\t\t\twnd.Closing += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\ta.Cancel = true;\n\t\t\t\t\twnd.Hide();\n\t\t\t\t};\n\n\t\t\t\tisVisible.Subscribe(vis =>\n\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (vis)\n\t\t\t\t\t\t\twnd.Show();\n\t\t\t\t\t\tif (!vis)\n\t\t\t\t\t\t\twnd.Hide();\n\t\t\t\t\t}));\n\t\t\t});\n\t\t}\n\n\n\t\tpublic async Task<TU> ShowDialog<TU>(Func<IDialog<TU>, Window> window)\n\t\t{\n\t\t\treturn await await Fusion.Application.MainThread.InvokeAsync(() =>\n\t\t\t\t{\n\t\t\t\t\tvar childWindow = new WindowsDialog<TU>();\n\n\t\t\t\t\tvar model = window(childWindow);\n\n\t\t\t\t\tif (model.Style == WindowStyle.Sheet)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar content = model.Size.HasValue\n\t\t\t\t\t\t\t? model.Content.WithSize(model.Size.Value.NotNone().Transpose())\n\t\t\t\t\t\t\t: model.Content;\n\n\t\t\t\t\t\tchildWindow._modalDialogs = _modalDialogs;\n\t\t\t\t\t\tchildWindow._parent = _parent;\n\t\t\t\t\t\tchildWindow._onClose = () =>\n\t\t\t\t\t\t\t_modalDialogs.OnNext(_modalDialogs.Value.Remove(content));\n\n\t\t\t\t\t\t_modalDialogs.OnNext(_modalDialogs.Value.Add(content));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar modalDialogs = new BehaviorSubject<IImmutableList<IControl>>(ImmutableList<IControl>.Empty);\n\n\t\t\t\t\t\tvar wnd = WindowImplementation.Initialize(OverlayModalDialogs(model, modalDialogs));\n\n\t\t\t\t\t\tchildWindow._modalDialogs = modalDialogs;\n\t\t\t\t\t\tchildWindow._parent = wnd;\n\t\t\t\t\t\tchildWindow._onClose = () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tFusion.Application.MainThread.Schedule(wnd.Close);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\twnd.Show();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn childWindow._result.FirstAsync();\n\t\t\t\t});\n\t\t}\n\n\t\tstatic Window OverlayModalDialogs(Window model, IObservable<IImmutableList<IControl>> modalDialogs)\n\t\t{\n\t\t\tmodel.Content = model.Content.WithNativeOverlay(\n\t\t\t\tmodalDialogs\n\t\t\t\t\t.Select(dialogs =>\n\t\t\t\t\t\tdialogs.LastOrNone()\n\t\t\t\t\t\t\t.Select(dialog => dialog.Center().WithBackground(Color.Black.WithAlpha(a: 0.8f)))\n\t\t\t\t\t\t\t.Or(Control.Empty))\n\t\t\t\t\t.Switch());\n\n\t\t\treturn model;\n\t\t}\n\n\t\tpublic Task<Optional<AbsoluteDirectoryPath>> BrowseForDirectory(AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\tvar dialogs = new FileDialogs(_parent.OrDefault());\n\t\t\treturn dialogs.SelectDirectory(new DirectoryDialogOptions(\"Browse\", directory));\n\t\t}\n\n\t\tpublic async Task<Optional<AbsoluteFilePath>> BrowseForFile(AbsoluteDirectoryPath directory, params FileFilter[] filters)\n\t\t{\n\t\t\tvar dialogs = new FileDialogs(_parent.OrDefault());\n\t\t\treturn from dialogResult in await dialogs.OpenFile(new FileDialogOptions(\"Browse\", directory, filters))\n\t\t\t\tselect dialogResult.Path;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/BalloonNotifier.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nnamespace Outracks.Fusion.Windows\n{\n\tclass ShowingNotification\n\t{\n\t\tpublic readonly TaskCompletionSource<NotificationFeedback> TaskCompletionSource = new TaskCompletionSource<NotificationFeedback>();\n\t\tpublic readonly Notification Notification;\n\n\t\t//public Optional<DateTime> ShownAt;\n\n\t\tpublic ShowingNotification(Notification notification)\n\t\t{\n\t\t\tNotification = notification;\n\t\t}\n\t}\n\tclass BalloonNotifier : INotifier, IDisposable\n\t{\n\t\treadonly NotifyIcon _icon;\n\t\treadonly IDisposable[] _subscriptions;\n\n\t\treadonly BehaviorSubject<IImmutableList<ShowingNotification>> _notifications = new BehaviorSubject<IImmutableList<ShowingNotification>>(ImmutableList<ShowingNotification>.Empty);\n\n\t\tpublic BalloonNotifier(NotifyIcon icon, System.Windows.Threading.Dispatcher scheduler)\n\t\t{\n\t\t\t_icon = icon;\n\n\t\t\tvar clicked = DataBinding.ObservableFromNativeEvent<EventArgs>(_icon, \"BalloonTipClicked\");\n\t\t\tvar closed = DataBinding.ObservableFromNativeEvent<EventArgs>(_icon, \"BalloonTipClosed\");\n\n\t\t\tvar current = _notifications.Select(n => n.LastOrNone()).NotNone();\n\n\t\t\t_subscriptions = new[]\n\t\t\t{\n\t\t\t\tcurrent\n\t\t\t\t\t.ObserveOn(scheduler)\n\t\t\t\t\t.Subscribe(n =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar timeout = n.Notification.Timeout.Or(TimeSpan.FromHours(3));\n\t\t\t\t\t\t_icon.ShowBalloonTip(\n\t\t\t\t\t\t\t(int)timeout.TotalMilliseconds,\n\t\t\t\t\t\t\tn.Notification.Title,\n\t\t\t\t\t\t\tn.Notification.Description,\n\t\t\t\t\t\t\tn.Notification.Type == NotifyType.Error ? ToolTipIcon.Error :\n\t\t\t\t\t\t\tn.Notification.Type == NotifyType.Info ? ToolTipIcon.Info :\n\t\t\t\t\t\t\tToolTipIcon.None);\n\t\t\t\t\t}),\n\n\t\t\t\tclicked.WithLatestFromBuffered(current, (_, c) => c)\n\t\t\t\t\t.ObserveOn(TaskPoolScheduler.Default)\n\t\t\t\t\t.Subscribe(c =>\n\t\t\t\t\t{\n\t\t\t\t\t\t_notifications.OnNext(_notifications.Value.Remove(c));\n\t\t\t\t\t\tc.TaskCompletionSource.TrySetResult(NotificationFeedback.PrimaryActionTaken);\n\t\t\t\t\t}),\n\n\t\t\t\tclosed.WithLatestFromBuffered(current, (_, c) => c)\n\t\t\t\t\t.ObserveOn(TaskPoolScheduler.Default)\n\t\t\t\t\t.Subscribe(c =>\n\t\t\t\t\t{\n\t\t\t\t\t\t_notifications.OnNext(_notifications.Value.Remove(c));\n\t\t\t\t\t\tc.TaskCompletionSource.TrySetResult(NotificationFeedback.Dismissed);\n\t\t\t\t\t}),\n\t\t\t};\n\n\t\t}\n\n\t\tpublic Task<NotificationFeedback> Show(Notification notification)\n\t\t{\n\t\t\tvar sn = new ShowingNotification(notification);\n\t\t\t_notifications.OnNext(_notifications.Value.Add(sn));\n\t\t\treturn sn.TaskCompletionSource.Task;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tforeach (var sub in _subscriptions.Reverse())\n\t\t\t\tsub.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/ContextMenuImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Windows;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class ContextMenuImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler dispatcher)\n\t\t{\n\t\t\tContextMenu.Implementation.Set = (self, menu) =>\n\t\t\t{\n\t\t\t\tself.IsRooted\n\t\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t\t.Select(isRooted =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar element = self.NativeHandle as FrameworkElement;\n\t\t\t\t\t\tif (element == null)\n\t\t\t\t\t\t\treturn Disposable.Empty;\n\n\t\t\t\t\t\treturn AddMenuTemporarily(element, menu.Select(x => x.ConnectWhile(self.IsRooted)), dispatcher);\n\t\t\t\t\t})\n\t\t\t\t\t.SubscribeUsing(disposable => disposable);\n\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\n\t\tpublic static IDisposable AddMenuTemporarily(FrameworkElement element, Optional<Menu> menu, IScheduler dispatcher)\n\t\t{\n\t\t\tif (!menu.HasValue)\n\t\t\t{\n\t\t\t\telement.ContextMenu = null;\n\t\t\t\treturn Disposable.Empty;\n\t\t\t}\n\n\t\t\telement.ContextMenu = new System.Windows.Controls.ContextMenu();\n\n\t\t\tvar dispose = Disposable.Empty;\n\n\t\t\telement.ContextMenu.IsVisibleChanged += (sender, e) =>\n\t\t\t{\n\t\t\t\tif ((bool)e.NewValue)\n\t\t\t\t{\n\t\t\t\t\tdispose.Dispose();\n\t\t\t\t\telement.ContextMenu.Items.Clear();\n\t\t\t\t\tdispose = WindowsMenuBuilder.PopulateContextMenu(menu.Value, element.ContextMenu, null, dispatcher);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdispose.Dispose();\n\t\t\t\t\telement.ContextMenu.Items.Clear();\n\t\t\t\t\tdispose = Disposable.Empty;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn Disposable.Create(() => dispose.Dispose());\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/Controls/ButtonImplementation.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tclass CustomButton : ButtonBase\n\t{\n\t}\n\n\tstatic class ButtonImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tButton.Implementation.Factory = (command, contentFactory, text, isDefault) =>\n\t\t\t{\n\t\t\t\tif (contentFactory != null)\n\t\t\t\t{\n\t\t\t\t\tvar states = new BehaviorSubject<ButtonStates>(ButtonStates.Unrooted);\n\n\t\t\t\t\tvar content = contentFactory(states.Switch());\n\n\t\t\t\t\treturn Control.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tAction action = () => { };\n\t\t\t\t\t\tvar button = new CustomButton();\n\t\t\t\t\t\t\tbutton.Click += (s, a) => action();\n\n\t\t\t\t\t\tstates.OnNext(new ButtonStates(\n\t\t\t\t\t\t\tisPressed: button.ObserveDependencyProperty(instance => instance.IsPressed, ButtonBase.IsPressedProperty),\n\t\t\t\t\t\t\tisHovered: button.ObserveDependencyProperty(instance => instance.IsMouseOver, ButtonBase.IsMouseOverProperty),\n\t\t\t\t\t\t\tisEnabled: button.ObserveDependencyProperty(instance => instance.IsEnabled, ButtonBase.IsEnabledProperty)));\n\n\t\t\t\t\t\tcontent.Mount(\n\t\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(self.NativeFrame.Size),\n\t\t\t\t\t\t\t\tAvailableSize = self.AvailableSize,\n\t\t\t\t\t\t\t\tIsRooted = self.IsRooted,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tvar child = content.NativeHandle as UIElement;\n\t\t\t\t\t\tif (child != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar grid = new Grid();\n\t\t\t\t\t\t\tgrid.Children.Add(\n\t\t\t\t\t\t\t\tnew System.Windows.Shapes.Rectangle()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tFill = new SolidColorBrush(Colors.Transparent)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tgrid.Children.Add(child);\n\t\t\t\t\t\t\tbutton.Content = grid;\n\t\t\t\t\t\t};\n\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"command\", command.Action, cmd =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbutton.IsEnabled = cmd.HasValue;\n\t\t\t\t\t\t\taction = () => cmd.Do(x => x());\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeDefaults(button, dispatcher);\n\n\t\t\t\t\t\treturn button;\n\t\t\t\t\t})\n\t\t\t\t\t.WithSize(content.DesiredSize);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar width = new ReplaySubject<Points>(1);\n\n\t\t\t\t\treturn Control.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tAction action = () => { };\n\t\t\t\t\t\tvar button = new System.Windows.Controls.Button();\n\t\t\t\t\t\tbutton.Click += (s, a) => action();\n\n\n\t\t\t\t\t\tcommand\n\t\t\t\t\t\t\t.Action\n\t\t\t\t\t\t\t.CombineLatest(text)\n\t\t\t\t\t\t\t.Take(1)\n\t\t\t\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\t\t\tcmdText =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tUpdateButtonFields(button, cmdText.Item1.HasValue, cmdText.Item2, width);\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"command\", command.Action.CombineLatest(text), cmdText =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tUpdateButtonFields(button, cmdText.Item1.HasValue, cmdText.Item2, width);\n\t\t\t\t\t\t\taction = () => cmdText.Item1.Do(x => x());\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeDefaults(button, dispatcher);\n\n\t\t\t\t\t\treturn button;\n\t\t\t\t\t})\n\t\t\t\t\t.WithHeight(20)\n\t\t\t\t\t.WithWidth(width)\n\t\t\t\t\t.WithPadding(new Thickness<Points>(6));\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tstatic void UpdateButtonFields(System.Windows.Controls.Button button, bool enabled, string text, IObserver<Points> width)\n\t\t{\n\t\t\tbutton.Content = text;\n\t\t\tbutton.IsEnabled = enabled;\n\t\t\tbutton.Measure(new System.Windows.Size(double.MaxValue, double.MaxValue));\n\t\t\twidth.OnNext(button.DesiredSize.Width);\n\t\t}\n\n\t\tstatic IObservable<TOut> ObserveDependencyProperty<TIn, TOut>(\n\t\t\tthis TIn instance,\n\t\t\tFunc<TIn, TOut> getValue,\n\t\t\tDependencyProperty dep)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread\n\t\t\t\t.InvokeAsync(() =>\n\t\t\t\t{\n\t\t\t\t\tvar observable = new BehaviorSubject<TOut>(getValue(instance));\n\t\t\t\t\tDependencyPropertyDescriptor.FromProperty(dep, typeof (TIn))\n\t\t\t\t\t\t.AddValueChanged(instance, (sender, args) => observable.OnNext(getValue(instance)));\n\t\t\t\t\treturn observable;\n\t\t\t\t})\n\t\t\t\t.ToObservable()\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/CircleImplementation.cs",
    "content": "using System.Windows.Shapes;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class CircleImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tShapes.Implementation.CircleFactory = (strokeF, fillF) =>\n\t\t\t\t Control\n\t\t\t\t\t.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar control = new Ellipse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIsHitTestVisible = false\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tself.BindShapeProperties(control, dispatcher, fillF, strokeF);\n\t\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\t\treturn control;\n\t\t\t\t\t});\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/ClippingImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class ClippingImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tLayout.Implementation.LayerControls = (childFactory) =>\n\t\t\t\tControl.Create(\n\t\t\t\t\tctrl =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar element = new Canvas();\n\n\t\t\t\t\t\tctrl.BindNativeDefaults(element, dispatcher);\n\n\t\t\t\t\t\tchildFactory(ctrl)\n\t\t\t\t\t\t\t// IMPORTANT: ConnectWhile has to be done first since else we'll lose all changes done to the children list while the ctrl is unrooted.\n\t\t\t\t\t\t\t// which breaks diffing, and we get dangling views (views that aren't removed).\n\t\t\t\t\t\t\t.ConnectWhile(ctrl.IsRooted)\n\t\t\t\t\t\t\t.DiffSequence()\n\t\t\t\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t\t.Subscribe(children =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach (var child in children.Removed)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar nativeChild = child.NativeHandle as FrameworkElement;\n\t\t\t\t\t\t\t\t\tif (nativeChild != null)\n\t\t\t\t\t\t\t\t\t\t\telement.Children.Remove(nativeChild);\n\n\t\t\t\t\t\t\t\t\tchild.Mount(MountLocation.Unmounted);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tforeach (var child in children.Added)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchild.Mount(new MountLocation.Mutable\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tIsRooted = ctrl.IsRooted,\n\t\t\t\t\t\t\t\t\t\tAvailableSize = ctrl.AvailableSize,\n\t\t\t\t\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(ctrl.NativeFrame.Size),\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\tvar nativeChild = child.NativeHandle as FrameworkElement;\n\t\t\t\t\t\t\t\t\tif (nativeChild == null)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t\t\t\tvar parent = nativeChild.Parent as Canvas;\n\t\t\t\t\t\t\t\t\tif (parent != null)\n\t\t\t\t\t\t\t\t\t\tparent.Children.Remove(nativeChild);\n\n\t\t\t\t\t\t\t\t\telement.Children.Add(nativeChild);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn element;\n\t\t\t\t\t});\n\n\t\t\tClipping.Initialize(\n\t\t\t\t(content, clipToBounds) =>\n\t\t\t\t{\n\t\t\t\t\tvar container = Layout.Layer(content);\n\n\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar elm = (FrameworkElement)container.NativeHandle;\n\t\t\t\t\t\telm.ClipToBounds = clipToBounds;\n\t\t\t\t\t});\n\n\t\t\t\t\treturn container.WithSize(content.DesiredSize);\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/ColorPickerImplementation.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing ColorPickerControls.Pickers;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class ColorPickerImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tvar editingColorSubject = new BehaviorSubject<Optional<IProperty<Color>>>(Optional.None<IProperty<Color>>());\n\n\t\t\tvar editingColor = editingColorSubject\n\t\t\t\t.ReplaceNone(() => Property.AsProperty(Observable.Never<Color>()))\n\t\t\t\t.Switch()\n\t\t\t\t.PreventFeedback()\n\t\t\t\t.AutoInvalidate(TimeSpan.FromMilliseconds(200));\n\n\t\t\tFusion.Application.Desktop.CreateSingletonWindow(\n\t\t\t\tisVisible: editingColorSubject.Select(e => e.HasValue),\n\t\t\t\twindow: window => new Window\n\t\t\t\t{\n\t\t\t\t\tTitle = Observable.Return(\"Color\"),\n\t\t\t\t\tClosed = editingColorSubject.Update(Optional.None<IProperty<Color>>()),\n\t\t\t\t\tSize = Optional.Some(Property.Constant(Optional.Some(new Size<Points>(560, 300)))),\n\t\t\t\t\tBackground = Color.FromRgb(0xFCFCFC),\n\t\t\t\t\tForeground =  Color.FromRgb(0x676767),\n\t\t\t\t\tBorder = Stroke.Create(1, Color.FromRgb(0xe0e0e0)),\n\t\t\t\t\tContent = Control\n\t\t\t\t\t\t.Create(self =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar dialog = new ColorPickerFullWithAlpha();\n\n\t\t\t\t\t\t\tdialog.UserChangedColor\n\t\t\t\t\t\t\t\t.Select(_ => dialog.SelectedColor.ToFusion())\n\t\t\t\t\t\t\t\t.Subscribe(editingColor);\n\n\t\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"color\", editingColor, c => dialog.SelectedColor = c.ToColor());\n\t\t\t\t\t\t\tself.BindNativeDefaults(dialog, dispatcher);\n\n\t\t\t\t\t\t\treturn dialog;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.WithPadding(new Thickness<Points>(10))\n\t\t\t\t\t\t.WithBackground(Color.FromRgb(0xFCFCFC)),\n\t\t\t\t});\n\n\t\t\tColorPicker.Implementation.OpenCommand = (color) =>\n\t\t\t\teditingColorSubject.Update(\n\t\t\t\t\told =>\n\t\t\t\t\t\told == Optional.Some(color)\n\t\t\t\t\t\t\t? Optional.None<IProperty<Color>>()\n\t\t\t\t\t\t\t: Optional.Some(color));\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/DropDownImplementation.cs",
    "content": "using System.Reactive.Linq;\nusing System.Windows.Controls;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class DropDownImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tDropDown.Implementation.Factory = (value, items, nativeLook) =>\n\t\t\t\tControl\n\t\t\t\t\t.Create(self =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value\n\t\t\t\t\t\t\t\t.ConnectWhile(self.IsRooted)\n\t\t\t\t\t\t\t\t.PreventFeedback()\n\t\t\t\t\t\t\t\t.AutoInvalidate();\n\n\t\t\t\t\t\t\tvar control = new ComboBox\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tPadding = new System.Windows.Thickness(1),\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tif (!nativeLook)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontrol.BorderBrush = null;\n\t\t\t\t\t\t\t\tcontrol.Background = null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Disable control if list is empty\n\t\t\t\t\t\t\tvar isDisabled = value.IsReadOnly.Or(items.Select(x => x.IsEmpty()));\n\n\t\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Disabled\", isDisabled, v =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontrol.IsReadOnly = v;\n\t\t\t\t\t\t\t\tcontrol.IsEnabled = !v;\n\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"items\", items, i => control.ItemsSource = i);\n\t\t\t\t\t\t\tself.BindNativeProperty(control, c => c.SelectedItem, value, eventName: \"SelectionChanged\");\n\t\t\t\t\t\t\treturn control;\n\t\t\t\t\t\t})\n\t\t\t\t\t.WithHeight(30);\n\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/ImageImplementation.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class ImageImplementation\n\t{\n\t\tstatic readonly Ratio<Pixels, Points> OneToOnePixelToPoints = new Ratio<Pixels, Points>(1.0);\n\n\t\t// Default to loading last seen dpi image\n\t\tstatic Ratio<Pixels, Points> _lastSeenDpi = new Ratio<Pixels, Points>(1.0);\n\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tImage.Implementation.Factory = (streams, overlayColor, colorMap, dpiOverrride) => ImageImpl(dispatcher, streams, overlayColor, colorMap, dpiOverrride);\n\t\t\tImage.Implementation.Animate = (images, duration, overlayColor) =>\n\t\t\t{\n\t\t\t\tvar totalSize = new Size<Pixels>();\n\n\t\t\t\treturn Control.Create(\n\t\t\t\t\tself =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar imgBrushes = new List<ImageBrush>();\n\n\t\t\t\t\t\tforeach (var imageStream in images)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar bitmap = DecodeImage(imageStream.Create());\n\t\t\t\t\t\t\ttotalSize = totalSize.Max(bitmap.Width, bitmap.Height);\n\t\t\t\t\t\t\timgBrushes.Add(new ImageBrush(bitmap) { Stretch = Stretch.Uniform });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar timePerImage = duration.TotalMilliseconds / images.Count;\n\t\t\t\t\t\tvar imgStream = Observable.Interval(TimeSpan.FromMilliseconds((int) timePerImage))\n\t\t\t\t\t\t\t.Select(\n\t\t\t\t\t\t\t\tf =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar index = (int) f % imgBrushes.Count;\n\t\t\t\t\t\t\t\t\treturn imgBrushes[index];\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tvar content = new ContentControl { IsHitTestVisible = false };\n\t\t\t\t\t\tcontent.GetDpi()\n\t\t\t\t\t\t\t.ConnectWhile(self.IsRooted)\n\t\t\t\t\t\t\t.Subscribe(dpi =>\n\t\t\t\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t\t\t\t\tcontent.Content = Rectangle(self, imgStream, totalSize, overlayColor, dispatcher)));\n\n\t\t\t\t\t\tself.BindNativeDefaults(content, dispatcher);\n\n\t\t\t\t\t\treturn content;\n\t\t\t\t\t}).WithSize(totalSize/OneToOnePixelToPoints);\n\t\t\t};\n\t\t\tImage.Implementation.Loader<BitmapImage>.FromStream = DecodeImage;\n\t\t}\n\n\t\tstatic IControl ImageImpl(\n\t\t\tDispatcher dispatcher,\n\t\t\tIObservable<IImage> imageStreams,\n\t\t\tOptional<IObservable<Color>> overlayColor,\n\t\t\tOptional<IObservable<IColorMap>> colorMap,\n\t\t\tOptional<IObservable<Ratio<Pixels, Points>>> dpiOverride)\n\t\t{\n\t\t\tBehaviorSubject<Ratio<Pixels, Points>> controlDpi = new BehaviorSubject<Ratio<Pixels, Points>>(_lastSeenDpi);\n\t\t\tvar image = dpiOverride.Or((IObservable<Ratio<Pixels, Points>>)controlDpi)\n\t\t\t\t.CombineLatest(\n\t\t\t\t\timageStreams,\n\t\t\t\t\tcolorMap.Select(x => x.Select(y => y.ToOptional())).Or(Observable.Return<Optional<IColorMap>>(Optional.None())),\n\t\t\t\t\t(dpi, streams, cmap) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar iv = streams.Load<BitmapImage>(dpi, cmap);\n\t\t\t\t\t\tBitmapImage bitmap = iv.Image;\n\t\t\t\t\t\treturn new { bitmap, size = new Size<Pixels>(bitmap.PixelWidth, bitmap.PixelHeight) / iv.ScaleFactor };\n\t\t\t\t\t})\n\t\t\t\t.Replay(1)\n\t\t\t\t.RefCount();\n\n\t\t\treturn Control.Create(\n\t\t\t\tself =>\n\t\t\t\t{\n\t\t\t\t\tvar dummyControl = new ContentControl { IsHitTestVisible = false };\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"dpi\", dummyControl.GetDpi(),\n\t\t\t\t\t\tdpi =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!dpi.Equals(controlDpi.Value))\n\t\t\t\t\t\t\t\tcontrolDpi.OnNext(dpi);\n\t\t\t\t\t\t\t_lastSeenDpi = dpi;\n\n\t\t\t\t\t\t});\n\t\t\t\t\tdummyControl.Content = Rectangle(\n\t\t\t\t\t\tself,\n\t\t\t\t\t\timage.Select(x => x.bitmap),\n\t\t\t\t\t\toverlayColor,\n\t\t\t\t\t\tdispatcher);\n\t\t\t\t\tself.BindNativeDefaults(dummyControl, dispatcher);\n\t\t\t\t\treturn dummyControl;\n\n\t\t\t\t}).WithSize(image.Select(x => x.size).Transpose());\n\t\t}\n\n\n\t\tstatic FrameworkElement Rectangle(\n\t\t\tIMountLocation model,\n\t\t\tIObservable<ImageBrush> imgStream,\n\t\t\tSize<Pixels> totalSize,\n\t\t\tIObservable<Color> overlayColor,\n\t\t\tIScheduler dispatcher)\n\t\t{\n\t\t\tvar rect = new System.Windows.Shapes.Rectangle\n\t\t\t{\n\t\t\t\tMaxWidth = totalSize.Width.Value,\n\t\t\t\tMaxHeight = totalSize.Height.Value\n\t\t\t};\n\t\t\tif (overlayColor != null)\n\t\t\t{\n\t\t\t\timgStream\n\t\t\t\t\t.CombineLatest(overlayColor.DistinctUntilChanged())\n\t\t\t\t\t.ConnectWhile(model.IsRooted)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\tt =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trect.OpacityMask = t.Item1;\n\t\t\t\t\t\t\t\trect.Fill = new SolidColorBrush(t.Item2.ToColor());\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\timgStream\n\t\t\t\t\t.ConnectWhile(model.IsRooted)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\timg =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trect.OpacityMask = img;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t\treturn rect;\n\t\t}\n\n\n\t\tstatic FrameworkElement Rectangle(\n\t\t\tIMountLocation model,\n\t\t\tIObservable<BitmapImage> imageStream,\n\t\t\tOptional<IObservable<Color>> overlayColor,\n\t\t\tDispatcher dispatcher)\n\t\t{\n\t\t\treturn overlayColor.Select(\n\t\t\t\tcolor =>\n\t\t\t\t{\n\t\t\t\t\tvar rect = new System.Windows.Shapes.Rectangle();\n\n\t\t\t\t\tmodel.BindNativeProperty(dispatcher, \"image\", imageStream,\n\t\t\t\t\t\tbitmap =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar imgBrush = new ImageBrush(bitmap)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tStretch = Stretch.Uniform,\n\t\t\t\t\t\t\t\tImageSource = bitmap,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\trect.OpacityMask = imgBrush;\n\t\t\t\t\t\t\trect.MaxWidth = imgBrush.ImageSource.Width;\n\t\t\t\t\t\t\trect.MaxHeight = imgBrush.ImageSource.Height;\n\t\t\t\t\t\t});\n\n\t\t\t\t\tmodel.BindNativeProperty(dispatcher, \"overlayColor\", color, c => rect.Fill = new SolidColorBrush(c.ToColor()));\n\t\t\t\t\treturn (FrameworkElement)rect;\n\t\t\t\t}).Or(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tvar imageControl = new System.Windows.Controls.Image()\n\t\t\t\t\t{\n\t\t\t\t\t\tStretchDirection = StretchDirection.DownOnly\n\t\t\t\t\t};\n\t\t\t\t\tmodel.BindNativeProperty(dispatcher, \"image\", imageStream,\n\t\t\t\t\t\tbitmap =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timageControl.Source = bitmap;\n\t\t\t\t\t\t});\n\t\t\t\t\tRenderOptions.SetBitmapScalingMode(imageControl, BitmapScalingMode.HighQuality);\n\t\t\t\t\treturn (FrameworkElement)imageControl;\n\t\t\t\t});\n\t\t}\n\n\t\tstatic BitmapImage DecodeImage(Stream stream)\n\t\t{\n\t\t\tvar bitmap = new BitmapImage();\n\t\t\tbitmap.BeginInit();\n\t\t\tbitmap.StreamSource = stream;\n\t\t\tbitmap.CacheOption = BitmapCacheOption.OnLoad;\n\t\t\tbitmap.EndInit();\n\t\t\tbitmap.Freeze();\n\t\t\treturn bitmap;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/LabelImplementation.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Text.RegularExpressions;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Documents;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class LabelImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher, IObservable<Ratio<Pixels, Points>> density)\n\t\t{\n\t\t\tLabel.Implementation.Factory = (font, text, textAlignment, color, lineBreakMode) =>\n\t\t\t{\n\t\t\t\tvar availableSize = new Size<IObservable<Points>>();\n\t\t\t\tvar recalculateDesiredSize = new Subject<Unit>();\n\t\t\t\tvar ctrl = Control.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar control = new TextBlock\n\t\t\t\t\t{\n\t\t\t\t\t\tTextWrapping = lineBreakMode == LineBreakMode.Wrap ? TextWrapping.Wrap : TextWrapping.NoWrap,\n\t\t\t\t\t\tTextTrimming = lineBreakMode == LineBreakMode.TruncateTail ? TextTrimming.WordEllipsis : TextTrimming.None,\n\t\t\t\t\t\tIsHitTestVisible = false\n\t\t\t\t\t};\n\n\t\t\t\t\tvar actualWidth = self.NativeFrame.Width;\n\t\t\t\t\tavailableSize = self.AvailableSize;\n\n\t\t\t\t\tvar labelArgs = Observable.CombineLatest(text, font.Size, font.Bold, actualWidth,\n\t\t\t\t\t\t(val, size, bold, aw) => new\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tText = val,\n\t\t\t\t\t\t\tSize = size,\n\t\t\t\t\t\t\tBold = bold,\n\t\t\t\t\t\t\tActualWidth = aw\n\t\t\t\t\t\t});\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"labelArgs\", labelArgs,\n\t\t\t\t\t\targs =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontrol.Text = lineBreakMode == LineBreakMode.TruncateHead\n\t\t\t\t\t\t\t\t? TruncateHead(\n\t\t\t\t\t\t\t\t\ttext: args.Text,\n\t\t\t\t\t\t\t\t\twidthConstraint: args.ActualWidth,\n\t\t\t\t\t\t\t\t\tmeasureStringSize: str => MeasureString(control, str, control.FontSize, control.FontWeight == FontWeights.ExtraBlack))\n\t\t\t\t\t\t\t\t: args.Text;\n\t\t\t\t\t\t\tcontrol.FontSize = args.Size;\n\t\t\t\t\t\t\tcontrol.FontWeight = args.Bold ? FontWeights.Bold : FontWeights.Normal;\n\t\t\t\t\t\t\trecalculateDesiredSize.OnNext(Unit.Default);\n\t\t\t\t\t\t});\n\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\"color\",\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tvalue => control.Foreground = new SolidColorBrush(value.ToColor()));\n\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\"textAlignment\",\n\t\t\t\t\t\ttextAlignment,\n\t\t\t\t\t\tvalue => control.TextAlignment = value.ToWpf());\n\n\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\n\t\t\t\treturn ctrl\n\t\t\t\t\t.WithSize(\n\t\t\t\t\t\tFusion.Application.MainThread\n\t\t\t\t\t\t\t.InvokeAsync(() => ctrl.NativeHandle)\n\t\t\t\t\t\t\t.ToObservable()\n\t\t\t\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t\t.Select(handle => MeasureString(dispatcher, (TextBlock)handle, recalculateDesiredSize, availableSize))\n\t\t\t\t\t\t\t.Switch()\n\t\t\t\t\t\t\t.Replay(1)\n\t\t\t\t\t\t\t.RefCount()\n\t\t\t\t\t\t\t.Transpose())\n\t\t\t\t\t.WithPadding(left: new Points(3), right: new Points(3));\n\t\t\t};\n\n\t\t\tLabel.Implementation.Formatted =\n\t\t\t\t(textElements, font, textAlignment, color, lineBreakMode) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar control = new TextBlock\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tTextWrapping = lineBreakMode == LineBreakMode.Wrap ? TextWrapping.Wrap : TextWrapping.NoWrap,\n\t\t\t\t\t\t\t\tTextTrimming = lineBreakMode == LineBreakMode.TruncateTail ? TextTrimming.WordEllipsis : TextTrimming.None,\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"font.Size\", font.Size, value => control.FontSize = value);\n\t\t\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\t\"font.Bold\",\n\t\t\t\t\t\t\t\tfont.Bold,\n\t\t\t\t\t\t\t\tvalue => control.FontWeight = value ? FontWeights.Bold : FontWeights.Normal);\n\n\t\t\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\t\"color\",\n\t\t\t\t\t\t\t\tcolor,\n\t\t\t\t\t\t\t\tvalue => control.Foreground = new SolidColorBrush(value.ToColor()));\n\n\t\t\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\t\"textAlignment\",\n\t\t\t\t\t\t\t\ttextAlignment,\n\t\t\t\t\t\t\t\tvalue => control.TextAlignment = value.ToWpf());\n\n\t\t\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t\t\t\"text\",\n\t\t\t\t\t\t\t\ttextElements,\n\t\t\t\t\t\t\t\telements =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontrol.Inlines.Clear();\n\t\t\t\t\t\t\t\t\tforeach (var element in elements)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar inline = ToInline(element);\n\t\t\t\t\t\t\t\t\t\tif (element.ForegroundColor.HasValue)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tinline.Foreground = new SolidColorBrush(element.ForegroundColor.Value.ToColor());\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tcontrol.Inlines.Add(inline);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn control;\n\t\t\t\t\t\t})\n\t\t\t\t\t.WithHeight(font.Size.Select(s => new Points(s * 1.25)))\n\t\t\t\t\t.WithWidth(70);\n\t\t}\n\n\t\tstatic Inline ToInline(TextPart part)\n\t\t{\n\t\t\tif (part is Url)\n\t\t\t{\n\t\t\t\tvar l = (Url)part;\n\t\t\t\tvar link = new Hyperlink(new Run(l.Text)) { NavigateUri = l.Uri };\n\n\t\t\t\tlink.RequestNavigate += (sender, args) =>\n\t\t\t\t{\n\t\t\t\t\tProcess.Start(new ProcessStartInfo(args.Uri.AbsoluteUri));\n\t\t\t\t\targs.Handled = true;\n\t\t\t\t};\n\t\t\t\treturn link;\n\t\t\t}\n\n\t\t\treturn new Run(part.Text);\n\t\t}\n\n\t\tstatic string TruncateHead(string text, Points widthConstraint, Func<string, Size<Points>> measureStringSize)\n\t\t{\n\t\t\tvar textSize = measureStringSize(text);\n\t\t\tvar ellipsisWidth = measureStringSize(\"...\").Width;\n\t\t\tvar desiredWidth = textSize.Width + ellipsisWidth;\n\n\t\t\tif (desiredWidth <= widthConstraint)\n\t\t\t\treturn text; // Early out test\n\t\t\tif (ellipsisWidth > widthConstraint)\n\t\t\t\treturn \"\";\n\n\t\t\tvar diff = desiredWidth - widthConstraint;\n\t\t\tvar words = Regex.Matches(text, @\"\\w(?<!\\d)[\\w'-]*\");\n\t\t\tvar currentReduction = new Points(0);\n\t\t\tvar wordToBreakOn = new Optional<Match>();\n\n\t\t\tfor (var i = 0; i < words.Count; ++i)\n\t\t\t{\n\t\t\t\tvar word = words[i];\n\n\t\t\t\tvar wordSize = measureStringSize(word.Value);\n\t\t\t\tcurrentReduction += wordSize.Width;\n\t\t\t\tif (currentReduction >= diff)\n\t\t\t\t{\n\t\t\t\t\tif (i + 1 < words.Count)\n\t\t\t\t\t\twordToBreakOn = words[i + 1];\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn \"...\" + wordToBreakOn.Select(w => text.Substring(w.Index, text.Length - w.Index)).Or(\"\");\n\t\t}\n\n\t\tstatic IObservable<Size<Points>> MeasureString(\n\t\t\tDispatcher dispatcher,\n\t\t\tTextBlock prototype,\n\t\t\tIObservable<Unit> recalculateDesiredSize,\n\t\t\tSize<IObservable<Points>> availableSize)\n\t\t{\n\t\t\tvar availS = prototype.TextWrapping != TextWrapping.NoWrap\n\t\t\t\t? availableSize.Transpose().StartWith(new Size<Points>(double.PositiveInfinity, double.PositiveInfinity))\n\t\t\t\t: Observable.Return(new Size<Points>(double.PositiveInfinity, double.PositiveInfinity));\n\t\t\treturn availS.CombineLatest(recalculateDesiredSize.StartWith(Unit.Default), (a,d) => a)\n\t\t\t\t.Select(availSize =>\n\t\t\t\t\tdispatcher.InvokeAsync(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar oldW = prototype.Width; var oldH = prototype.Height;\n\t\t\t\t\t\tprototype.Width = double.NaN; prototype.Height = double.NaN;\n\t\t\t\t\t\tprototype.Measure(availSize.Max(0,0).ToWpf());\n\t\t\t\t\t\tprototype.Width = oldW; prototype.Height = oldH;\n\t\t\t\t\t\treturn prototype.DesiredSize.ToFusion();\n\t\t\t\t\t}))\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tstatic Size<Points> MeasureString(\n\t\t\tTextBlock prototype,\n\t\t\tstring text, double size, bool bold)\n\t\t{\n\t\t\tvar formattedText = new FormattedText(\n\t\t\t\ttext,\n\t\t\t\tCultureInfo.CurrentUICulture,\n\t\t\t\tFlowDirection.LeftToRight,\n\t\t\t\tnew Typeface(\n\t\t\t\t\tprototype.FontFamily,\n\t\t\t\t\tprototype.FontStyle,\n\t\t\t\t\tbold ? FontWeights.ExtraBlack : FontWeights.Normal,\n\t\t\t\t\tprototype.FontStretch),\n\t\t\t\tsize,\n\t\t\t\tBrushes.Black);\n\n\t\t\treturn new Size<Points>(formattedText.Width, formattedText.Height);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/LayoutTrackerImplementation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Windows;\n\nnamespace Outracks.Fusion.Windows.Controls\n{\n\tclass LayoutTrackerImplementation\n\t{\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tFusion.LayoutTracker.Implementation = trackerFunc =>\n\t\t\t{\n\t\t\t\tvar child = new ReplaySubject<IEnumerable<IControl>>(1);\n\t\t\t\tvar layer = child.Layer();\n\t\t\t\tvar layerElm = Fusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => layer.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.Select(elm => (FrameworkElement) elm);\n\n\t\t\t\tvar content = trackerFunc(new LayoutTracker(layerElm));\n\t\t\t\tchild.OnNext(new[] { content });\n\t\t\t\treturn layer.WithSize(content.DesiredSize);\n\t\t\t};\n\t\t}\n\n\t\tclass LayoutTracker : ILayoutTracker\n\t\t{\n\t\t\treadonly IObservable<FrameworkElement> _toElement;\n\n\t\t\tpublic LayoutTracker(IObservable<FrameworkElement> toElement)\n\t\t\t{\n\t\t\t\t_toElement = toElement;\n\t\t\t}\n\n\t\t\tpublic IControl TrackVisualBounds(Action<Rectangle<Points>> frame, IControl content)\n\t\t\t{\n\t\t\t\tcontent = Layout.Layer(content)\n\t\t\t\t\t.WithSize(content.DesiredSize);\n\n\t\t\t\tvar fromElement = Fusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => content.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.Select(elm => (FrameworkElement)elm);\n\n\t\t\t\tObservable.CombineLatest(fromElement, _toElement, CalculateRelativeFrame)\n\t\t\t\t\t.Switch()\n\t\t\t\t\t.ConnectWhile(content.IsRooted)\n\t\t\t\t\t.Subscribe(frame);\n\n\t\t\t\treturn content;\n\t\t\t}\n\n\t\t\tprivate static IObservable<Rectangle<Points>> CalculateRelativeFrame(FrameworkElement from, FrameworkElement to)\n\t\t\t{\n\t\t\t\treturn Observable.Interval(TimeSpan.FromMilliseconds(100), new DispatcherScheduler(from.Dispatcher))\n\t\t\t\t\t.Select(_ => RelativeFrame(from: from, to: to))\n\t\t\t\t\t.DistinctUntilChanged();\n\t\t\t}\n\n\t\t\tstatic Rectangle<Points> RelativeFrame(FrameworkElement from, FrameworkElement to)\n\t\t\t{\n\t\t\t\tvar translation = from.TranslatePoint(new System.Windows.Point(), to);\n\t\t\t\treturn Rectangle.FromPositionSize(Point.Create<Points>(translation.X, translation.Y), new Size<Points>(from.ActualWidth, from.ActualHeight));\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/LineImplementation.cs",
    "content": "﻿using System.Windows.Media;\nusing System.Windows.Shapes;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class LineImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tShapes.Implementation.LineFactory = (from, to, stroke) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar control = new Line()\n\t\t\t\t\t{\n\t\t\t\t\t\tIsHitTestVisible = false,\n\t\t\t\t\t};\n\n\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"x1\", from.X, (v) => control.X1 = v);\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"y1\", from.Y, (v) => control.Y1 = v);\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"x2\", to.X, v => control.X2 = v);\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"y2\", to.Y, v => control.Y2 = v);\n\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tdispatcher, \"stroke.thickness\", stroke.Thickness,\n\t\t\t\t\t\tthickness => control.StrokeThickness = thickness);\n\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tdispatcher, \"stroke.brush\", stroke.Brush,\n\t\t\t\t\t\tbrush => control.Stroke = new SolidColorBrush(brush.ToColor()));\n\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tdispatcher, \"stroke.dasharray\", stroke.DashArray,\n\t\t\t\t\t\tdashArray => control.StrokeDashArray = dashArray.ToDashArray()); ;\n\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/LogViewImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit;\n\nnamespace Outracks.Fusion.Windows\n{\n\tclass LogViewImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tLogView.Implementation.Factory = (stream, color, linkColor, clear, dark) =>\n\t\t\t{\n\t\t\t\tTextEditor textBox = null;\n\n\t\t\t\treturn Control.Create(self =>\n\t\t\t\t{\n\t\t\t\t\ttextBox = new TextEditor()\n\t\t\t\t\t{\n\t\t\t\t\t\tIsReadOnly = true,\n\t\t\t\t\t\tBackground = Brushes.Transparent,\n\t\t\t\t\t\tVerticalScrollBarVisibility = ScrollBarVisibility.Auto,\n\t\t\t\t\t\tHorizontalScrollBarVisibility = ScrollBarVisibility.Auto\n\t\t\t\t\t};\n\n\t\t\t\t\ttextBox.SizeChanged += (sender, args) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar scrollToEnd = args.PreviousSize.Height + textBox.VerticalOffset + 20 >= textBox.ExtentHeight;\n\t\t\t\t\t\tif (scrollToEnd)\n\t\t\t\t\t\t\ttextBox.ScrollToEnd();\n\t\t\t\t\t};\n\n\t\t\t\t\tstream.Buffer(TimeSpan.FromSeconds(1.0 / 30.0))\n\t\t\t\t\t\t.Where(c => c.Count > 0)\n\t\t\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t.Subscribe(msgsToAdd =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar shouldScrollToEnd = textBox.ViewportHeight + textBox.VerticalOffset + 20 >= textBox.ExtentHeight;\n\n\t\t\t\t\t\t\ttextBox.BeginChange();\n\t\t\t\t\t\t\tforeach(var msg in msgsToAdd)\n\t\t\t\t\t\t\t\ttextBox.AppendText(msg);\n\t\t\t\t\t\t\ttextBox.EndChange();\n\n\t\t\t\t\t\t\tif (shouldScrollToEnd)\n\t\t\t\t\t\t\t\ttextBox.ScrollToVerticalOffset(double.MaxValue);\n\t\t\t\t\t\t});\n\n\t\t\t\t\tclear.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t\t\t.Subscribe(_ => textBox.Clear());\n\n\t\t\t\t\tself.BindNativeDefaults(textBox, dispatcher);\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"color\", color,\n\t\t\t\t\t\tvalue =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttextBox.Foreground = new SolidColorBrush(value.ToColor());\n\t\t\t\t\t\t});\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"linkColor\", linkColor,\n\t\t\t\t\t\tvalue => {\n\t\t\t\t\t\t\ttextBox.TextArea.TextView.LinkTextForegroundBrush = new SolidColorBrush(value.ToColor());\n\t\t\t\t\t\t});\n\n\t\t\t\t\treturn textBox;\n\t\t\t\t}).SetContextMenu(\n\t\t\t\t\tMenu.Item(name: \"Copy\", command: Command.Enabled(() => textBox.Copy()))\n\t\t\t\t\t+ Menu.Item(name: \"Select All\", command: Command.Enabled(() => textBox.SelectAll()))\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/Controls/RectangleImplementation.cs",
    "content": "namespace Outracks.Fusion.Windows\n{\n\tstatic class RectangleImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tShapes.Implementation.RectangleFactory = (strokeF, fillF, cornerRadius) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar control = new System.Windows.Shapes.Rectangle\n\t\t\t\t\t{\n\t\t\t\t\t\tIsHitTestVisible = false,\n\t\t\t\t\t};\n\n\t\t\t\t\tif (cornerRadius.HasValue)\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"radius\", cornerRadius.Value, v =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontrol.RadiusX = v.RadiusX;\n\t\t\t\t\t\t\tcontrol.RadiusY = v.RadiusY;\n\t\t\t\t\t\t});\n\n\t\t\t\t\tself.BindShapeProperties(control, dispatcher, fillF, strokeF);\n\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/ShapeControl.cs",
    "content": "using System.Windows.Media;\nusing System.Windows.Shapes;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class ShapeControl\n\t{\n\t\tpublic static void BindShapeProperties(this IMountLocation self, Shape control, Dispatcher dispatcher, Brush fill, Stroke stroke)\n\t\t{\n\t\t\tself.BindNativeProperty(dispatcher, \"fill.Color\", fill, f => control.Fill = new SolidColorBrush(f.ToColor()));\n\n\t\t\tself.BindNativeProperty(dispatcher, \"stroke.Brush.Color\", stroke.Brush, s => control.Stroke = new SolidColorBrush(s.ToColor()));\n\t\t\tself.BindNativeProperty(dispatcher, \"stroke.Thickness\", stroke.Thickness, s => control.StrokeThickness = s);\n\t\t\tself.BindNativeProperty(dispatcher, \"stroke.DashArray\", stroke.DashArray, s => control.StrokeDashArray = s.ToDashArray());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/SliderImplementation.cs",
    "content": "using System;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class SliderImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tSlider.Implementation.Factory = (value, min, max) =>\n\t\t\t{\n\t\t\t\tvalue = value\n\t\t\t\t\t.PreventFeedback()\n\t\t\t\t\t.AutoInvalidate(TimeSpan.FromMilliseconds(200));\n\n\t\t\t\treturn Control\n\t\t\t\t\t.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar control = new System.Windows.Controls.Slider\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPadding = new System.Windows.Thickness(1)\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Disabled\", value.IsReadOnly, v => control.IsEnabled = !v);\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Minimum\", min, v => control.Minimum = v);\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Maximum\", max, v => control.Maximum = v);\n\n\t\t\t\t\t\tself.BindNativeProperty(control, d => d.Value, value);\n\n\t\t\t\t\t\treturn control;\n\t\t\t\t\t})\n\t\t\t\t\t.WithHeight(30);\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Controls/TextBoxImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Windows;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class TextBoxImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tTextBox.Implementation.Factory = (value, isMultiline, doWrap, maybeOnFocused, foregroundColor) =>\n\t\t\t{\n\t\t\t\treturn Control.Create(self =>\n\t\t\t\t\t{\n\t\t\t\t\t\t// In the simple test this didn't do anything, possibly because we're not subscribing until we try to set something.. should try it in bindnativeproperty afterwards, first i'm going to see how everything runs atm\n\t\t\t\t\t\tvalue = value.PreventFeedback();\n\n\t\t\t\t\t\tvar control = new System.Windows.Controls.TextBox\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBackground = Brushes.Transparent,\n\t\t\t\t\t\t\tPadding = new System.Windows.Thickness(3),\n\t\t\t\t\t\t\tTextWrapping = doWrap ? TextWrapping.Wrap : TextWrapping.NoWrap,\n\t\t\t\t\t\t\tVerticalContentAlignment = doWrap ? VerticalAlignment.Top : VerticalAlignment.Center,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (isMultiline == false)\n\t\t\t\t\t\t\tcontrol.MaxLines = 1;\n\n\t\t\t\t\t\tcontrol.BindText(value, self.IsRooted, isMultiline);\n\n\t\t\t\t\t\tmaybeOnFocused.Do(onFocused =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAction action = () => { };\n\n\t\t\t\t\t\t\tonFocused.Execute\n\t\t\t\t\t\t\t\t.ConnectWhile(self.IsRooted)\n\t\t\t\t\t\t\t\t.Subscribe(e => action = e);\n\n\t\t\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t\t\t\tcontrol.GotKeyboardFocus += (s, a) => action());\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"foreground\", foregroundColor,\n\t\t\t\t\t\t\tforeground =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontrol.Foreground = control.CaretBrush = new SolidColorBrush(foreground.ToColor());\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\tself.BindNativeDefaults(control, dispatcher);\n\n\t\t\t\t\t\tself.BindNativeProperty(dispatcher, \"Disabled\", value.IsReadOnly, v =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontrol.IsReadOnly = v;\n\t\t\t\t\t\t\tcontrol.IsEnabled = !v;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn control;\n\t\t\t\t\t})\n\t\t\t\t\t.WithHeight(isMultiline ? 130 : 20).CenterVertically();\n\t\t\t};\n\t\t}\n\n\t\tstatic void BindText(\n\t\t\tthis System.Windows.Controls.TextBox control,\n\t\t\tIProperty<string> value,\n\t\t\tIObservable<bool> isRooted,\n\t\t\tbool isMultiline)\n\t\t{\n\t\t\tbool valueSetByUser = true;\n\t\t\tbool hasUnsavedChanges = false;\n\n\t\t\tvalue = value\n\t\t\t\t.ConnectWhile(isRooted)\n\t\t\t\t.DistinctUntilChangedOrSet();\n\n\t\t\tDataBinding\n\t\t\t\t.ObservableFromNativeEvent<EventArgs>(control, \"TextChanged\")\n\t\t\t\t.Subscribe(_ =>\n\t\t\t\t{\n\t\t\t\t\tif (!valueSetByUser)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\thasUnsavedChanges = true;\n\t\t\t\t\tvalue.Write(control.Text, save: false);\n\t\t\t\t});\n\n\t\t\tvalue.Subscribe(v =>\n\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t{\n\t\t\t\t\tvalueSetByUser = false;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tcontrol.Text = v;\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tvalueSetByUser = true;\n\t\t\t\t\t}\n\t\t\t\t}));\n\n\t\t\tcontrol.LostKeyboardFocus += (s, a) =>\n\t\t\t{\n\t\t\t\tif (!hasUnsavedChanges)\n\t\t\t\t\treturn;\n\n\t\t\t\tvalue.Write(control.Text, save: true);\n\t\t\t\thasUnsavedChanges = false;\n\t\t\t};\n\n\t\t\tif (isMultiline == false)\n\t\t\t{\n\t\t\t\tcontrol.KeyDown += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tif (a.Key != System.Windows.Input.Key.Return)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tif (!hasUnsavedChanges)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tvalue.Write(control.Text, save: true);\n\t\t\t\t\thasUnsavedChanges = false;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/Controls/WebViewImplementation.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Windows.Controls;\nusing mshtml;\n\nnamespace Outracks.Fusion.Windows\n{\n\tclass WebViewImplementation\n\t{\n\t\tpublic static void Initialize(IScheduler scheduler)\n\t\t{\n\t\t\tWebView.Implementation.UrlFactory += (uri, onNavigating) =>\n\t\t\t\tControl.Create(control =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar webBrowser = new WebBrowser();\n\n\t\t\t\t\t\twebBrowser.Navigating += (sender, args) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar navigatingArgs = new Navigating(args.Uri);\n\t\t\t\t\t\t\tonNavigating(navigatingArgs);\n\t\t\t\t\t\t\targs.Cancel = navigatingArgs.Cancel;\n\t\t\t\t\t\t};\n\n\n\t\t\t\t\t\tDataBinding.ObservableFromNativeEvent<EventArgs>(webBrowser, \"LoadCompleted\")\n\t\t\t\t\t\t\t.CombineLatest(webBrowser.GetDpi(), Tuple.Create)\n\t\t\t\t\t\t\t.Subscribe((_, density) => webBrowser.SetZoom(density));\n\n\t\t\t\t\t\tscheduler.Schedule(() => webBrowser.Navigate(uri));\n\n\t\t\t\t\t\tcontrol.BindNativeDefaults(webBrowser, scheduler);\n\n\t\t\t\t\t\treturn webBrowser;\n\t\t\t\t\t});\n\n\t\t\tWebView.Implementation.StringFactory += (content) =>\n\t\t\t\tControl.Create(control =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar webBrowser = new WebBrowser();\n\t\t\t\t\t\tcontent.Subscribe( c =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!string.IsNullOrEmpty(c))\n\t\t\t\t\t\t\t\tscheduler.Schedule(() =>  webBrowser.NavigateToString(c));\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontrol.BindNativeDefaults(webBrowser, scheduler);\n\t\t\t\t\t\treturn webBrowser;\n\t\t\t\t\t});\n\n\t\t}\n\t}\n\n\tstatic class WebBrowserExtensions\n\t{\n\t\tpublic static void SetZoom(this WebBrowser webBrowser, double zoom)\n\t\t{\n\t\t\tif (zoom <= 1)\n\t\t\t\treturn;\n\n\t\t\tvar doc = webBrowser.Document as IHTMLDocument2;\n\t\t\tdoc.parentWindow.execScript(\n\t\t\t\t\"if(document != null && document.body != null) {\"\n\t\t\t\t\t+ \"document.body.className = document.body.className + \\\" hdpi\\\";\"\n\t\t\t\t+ \"}\");\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/fusion/win/Controls/WindowFromControl.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Windows;\nusing System.Windows.Interop;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class WindowFromControl\n\t{\n\t\tpublic static IObservable<Optional<IntPtr>> GetWindowHandle(this IObservable<System.Windows.Window> window)\n\t\t{\n\t\t\treturn window.Select(currentWindow =>\n\t\t\t\t\tFusion.Application.MainThread.InvokeAsync(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hwndSource = (HwndSource)PresentationSource.FromVisual(currentWindow);\n\t\t\t\t\t\tif (hwndSource == null)\n\t\t\t\t\t\t\treturn Optional.None();\n\n\t\t\t\t\t\treturn Optional.Some(hwndSource.Handle);\n\t\t\t\t\t}))\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tpublic static IObservable<Optional<T>> GetWindow<T>(this FrameworkElement dummyElement)\n\t\t\twhere T : System.Windows.Window\n\t\t{\n\t\t\t// TODO: this might be expensive\n\t\t\treturn DataBinding.ObservableFromNativeEvent<object>(dummyElement, \"LayoutUpdated\")\n\t\t\t\t.StartWith(new object())\n\t\t\t\t.Select(_ =>\n\t\t\t\t\tFusion.Application.MainThread.InvokeAsync(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hwndSource = PresentationSource.FromVisual(dummyElement);\n\t\t\t\t\t\tif (hwndSource == null)\n\t\t\t\t\t\t\treturn Optional.None();\n\n\t\t\t\t\t\tvar window = hwndSource.RootVisual as T;\n\t\t\t\t\t\tif (window == null)\n\t\t\t\t\t\t\treturn Optional.None();\n\n\t\t\t\t\t\treturn Optional.Some(window);\n\t\t\t\t\t}))\n\t\t\t\t.Switch()\n\t\t\t\t.DistinctUntilChanged();\n\t\t}\n\n\t\tpublic static IObservable<Ratio<Pixels, Points>> GetDpi(this FrameworkElement dummyElement)\n\t\t{\n\t\t\treturn GetWindow<DpiAwareWindow>(dummyElement)\n\t\t\t\t.Select(win => win\n\t\t\t\t\t.Select(w => w.DensityFactor))\n\t\t\t\t.NotNone()\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/CursorsImplementation.cs",
    "content": "using System.Windows;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class CursorsImplementation\n\t{\n\t\tstatic readonly System.Windows.Input.Cursor GrabCursor = null;\n\t\tstatic readonly System.Windows.Input.Cursor GrabbingCursor = null;\n\n\t\tstatic CursorsImplementation()\n\t\t{\n\t\t\tusing (var stream = NativeResources.GetGrabCursor())\n\t\t\t\tGrabCursor = new System.Windows.Input.Cursor(stream);\n\t\t\tusing (var stream = NativeResources.GetGrabbingCursor())\n\t\t\t\tGrabbingCursor = new System.Windows.Input.Cursor(stream);\n\t\t}\n\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tCursors.Implementation.Set = (self, cursor) =>\n\t\t\t{\n\t\t\t\tself.BindNativeProperty(dispatcher, \"cursor\", cursor, (FrameworkElement e, Cursor t) => e.Cursor = t.ToWpf());\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\n\t\tpublic static System.Windows.Input.Cursor ToWpf(this Cursor cursor)\n\t\t{\n\t\t\tswitch (cursor)\n\t\t\t{\n\t\t\t\tcase Cursor.Grab:\n\t\t\t\t\treturn GrabCursor;\n\t\t\t\tcase Cursor.Grabbing:\n\t\t\t\t\treturn GrabbingCursor;\n\t\t\t\tcase Cursor.Pointing:\n\t\t\t\t\treturn System.Windows.Input.Cursors.Hand;\n\t\t\t\tcase Cursor.ResizeHorizontally:\n\t\t\t\t\treturn System.Windows.Input.Cursors.SizeWE;\n\t\t\t\tcase Cursor.ResizeVertically:\n\t\t\t\t\treturn System.Windows.Input.Cursors.SizeNS;\n\t\t\t\tcase Cursor.Text:\n\t\t\t\t\treturn System.Windows.Input.Cursors.IBeam;\n\t\t\t\tcase Cursor.Normal:\n\t\t\t\tdefault:\n\t\t\t\t\treturn System.Windows.Input.Cursors.Arrow;\n\t\t\t}\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "src/fusion/win/CustomTitlebar.cs",
    "content": "﻿using System.Windows;\nusing System.Windows.Input;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class CustomTitlebar\n    {\n        public static void ApplyTo(System.Windows.Window window)\n        {\n\t        CanExecuteRoutedEventHandler onCanResizeWindow = (sender, e) =>\n\t        {\n\t\t\t\te.CanExecute =\n\t\t\t\t\twindow.ResizeMode == ResizeMode.CanResize ||\n\t\t\t\t\twindow.ResizeMode == ResizeMode.CanResizeWithGrip;\n\t        };\n\n\t\t\tCanExecuteRoutedEventHandler onCanMinimizeWindow = (sender, e) =>\n\t\t\t{\n\t\t\t\te.CanExecute = window.ResizeMode != ResizeMode.NoResize;\n\t\t\t};\n\n\t\t\tExecutedRoutedEventHandler onCloseWindow = (sender, e) => SystemCommands.CloseWindow(window);\n\t\t\tExecutedRoutedEventHandler onMaximizeWindow = (sender, e) =>\n\t\t\t{\n\t\t\t\tSystemCommands.MaximizeWindow(window);\n\n\t\t\t};\n\t\t\tExecutedRoutedEventHandler onMinimizeWindow = (sender, e) => SystemCommands.MinimizeWindow(window);\n\t\t\tExecutedRoutedEventHandler onRestoreWindow = (sender, e) =>\n\t\t\t{\n\t\t\t\tSystemCommands.RestoreWindow(window);\n\t\t\t};\n\n\t\t\twindow.CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, onCloseWindow));\n\t\t\twindow.CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, onMaximizeWindow, onCanResizeWindow));\n\t\t\twindow.CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, onMinimizeWindow, onCanMinimizeWindow));\n\t\t\twindow.CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, onRestoreWindow, onCanResizeWindow));\n        }\n\n    }\n}\n"
  },
  {
    "path": "src/fusion/win/DataBinding.cs",
    "content": "using System;\nusing System.Linq.Expressions;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Reflection;\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class DataBinding\n\t{\n\t\tpublic static void BindNativeDefaults(this IMountLocation self, FrameworkElement element, IScheduler dispatcher)\n\t\t{\n\t\t\tvar frame = self.NativeFrame;\n\n\t\t\tself.BindNativeProperty(\n\t\t\t\tdispatcher, \"left\", frame.Left(),\n\t\t\t\tposition =>\n\t\t\t\t{\n\t\t\t\t\tif (!double.IsInfinity(position))\n\t\t\t\t\t\tCanvas.SetLeft(element, position);\n\t\t\t\t});\n\t\t\tself.BindNativeProperty(\n\t\t\t\tdispatcher, \"top\", frame.Top(),\n\t\t\t\tposition =>\n\t\t\t\t{\n\t\t\t\t\tif (!double.IsInfinity(position))\n\t\t\t\t\t\tCanvas.SetTop(element, position);\n\t\t\t\t});\n\t\t\tself.BindNativeProperty(\n\t\t\t\tdispatcher, \"height\", frame.Height,\n\t\t\t\theight =>\n\t\t\t\t{\n\t\t\t\t\tif (!double.IsInfinity(height))\n\t\t\t\t\t\telement.Height = Math.Max(0, (height));\n\t\t\t\t});\n\t\t\tself.BindNativeProperty(\n\t\t\t\tdispatcher, \"width\", frame.Width,\n\t\t\t\twidth =>\n\t\t\t\t{\n\t\t\t\t\tif (!double.IsInfinity(width))\n\t\t\t\t\t\telement.Width = Math.Max(0, (width));\n\t\t\t\t});\n\t\t}\n\t\tpublic static void BindNativeProperty<TElement, TValue>(\n\t\t\tthis IControl control,\n\t\t\tIScheduler dispatcher,\n\t\t\tstring name,\n\t\t\tIObservable<TValue> value,\n\t\t\tAction<TElement, TValue> update)\n\t\t{\n\t\t\tvalue\n\t\t\t\t.ConnectWhile(control.IsRooted)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Subscribe(v =>\n\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (control.NativeHandle is TElement)\n\t\t\t\t\t\t\tupdate((TElement)control.NativeHandle, v);\n\t\t\t\t\t}));\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TWpfControl, TValue>(\n\t\t\tthis IMountLocation fusionControl,\n\t\t\tTWpfControl wpfControl,\n\t\t\tExpression<Func<TWpfControl, TValue>> propertyExpression,\n\t\t\tIProperty<TValue> sourceProperty,\n\t\t\tstring eventName = null)\n\t\t\twhere TWpfControl : System.Windows.Controls.Control\n\t\t{\n\t\t\tvar memberExpression = propertyExpression.Body as MemberExpression;\n\t\t\tPropertyInfo wpfProperty = null;\n\t\t\tif (memberExpression != null)\n\t\t\t{\n\t\t\t\twpfProperty = memberExpression.Member as PropertyInfo;\n\t\t\t}\n\t\t\tif (wpfProperty == null)\n\t\t\t\tthrow new ArgumentException(\"Unable to extract property name from expression\");\n\t\t\tif (wpfProperty.SetMethod == null || !wpfProperty.SetMethod.IsPublic)\n\t\t\t\tthrow new ArgumentException(\"Property does not have a public setter\");\n\n\t\t\tsourceProperty = sourceProperty\n\t\t\t\t.ConnectWhile(fusionControl.IsRooted)\n\t\t\t\t.DistinctUntilChangedOrSet();\n\n\t\t\tvar propertyGetter = propertyExpression.Compile();\n\n\t\t\tbool valueSetByUser = true;\n\n\t\t\tObservableFromNativeEvent<EventArgs>(wpfControl, eventName ?? (wpfProperty.Name + \"Changed\"))\n\t\t\t\t.Select(_ => propertyGetter(wpfControl))\n\t\t\t\t.Where(v => valueSetByUser)\n\t\t\t\t.Subscribe(sourceProperty);\n\n\t\t\tsourceProperty\n\t\t\t\t.Select(v => new Action(() =>\n\t\t\t\t{\n\t\t\t\t\tvalueSetByUser = false;\n\t\t\t\t\ttry { wpfProperty.SetValue(wpfControl, v); }\n\t\t\t\t\tfinally { valueSetByUser = true; }\n\t\t\t\t}))\n\t\t\t\t.Subscribe(action => Fusion.Application.MainThread.Schedule(action));\n\t\t}\n\n\t\tpublic static IObservable<T> ObservableFromNativeEvent<T>(object nativeControl, string name)\n\t\t{\n\t\t\treturn Observable.Create<T>(async observer =>\n\t\t\t\tawait Fusion.Application.MainThread.InvokeAsync(() =>\n\t\t\t\t\tObservable.FromEventPattern<T>(nativeControl, name)\n\t\t\t\t\t\t.Subscribe(pattern =>\n\t\t\t\t\t\t\tobserver.OnNext(pattern.EventArgs))));\n\t\t}\n\n\t\tpublic static IObservable<Optional<FrameworkElement>> GetNativeControlWhileMounted(this IControl self)\n\t\t{\n\t\t\treturn Fusion.Application.MainThread\n\t\t\t\t.InvokeAsync(() => self.NativeHandle)\n\t\t\t\t.ToObservable()\n\t\t\t\t.OfType<FrameworkElement>()\n\t\t\t\t.Select(element =>\n\t\t\t\t\tself.IsRooted.Select(isRooted =>\n\t\t\t\t\t\tisRooted\n\t\t\t\t\t\t\t? Optional.Some(element)\n\t\t\t\t\t\t\t: Optional.None()))\n\t\t\t\t.Switch();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Dispatcher.cs",
    "content": "using System;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Windows.Threading;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class Dispatcher : SingleThreadDispatcherBase\n\t{\n\t\treadonly IObservable<long> _perFrame;\n\t\treadonly DispatcherTimer _timer = new DispatcherTimer(DispatcherPriority.Render)\n\t\t{\n\t\t\tInterval = TimeSpan.FromSeconds(1.0 / 60.0)\n\t\t};\n\n\t\tpublic IObservable<long> PerFrame\n\t\t{\n\t\t\tget { return _perFrame; }\n\t\t}\n\n\t\tpublic Dispatcher(Thread thread) : base(thread)\n\t\t{\n\t\t\tvar perFrame = new Subject<long>();\n\t\t\tlong i = 0;\n\t\t\t_timer.Tick += (s, a) =>\n\t\t\t{\n\t\t\t\tDrain();\n\t\t\t\tperFrame.OnNext(i++);\n\t\t\t};\n\t\t\t_timer.Start();\n\t\t\t_perFrame = perFrame;\n\t\t}\n\n\t\tprotected override void Flush()\n\t\t{\n\t\t\tif (RunningOnDispatcherThread)\n\t\t\t\tDrain();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/DocumentAppHandler.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.IO.Pipes;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing Outracks.IO;\nusing Outracks.IPC;\n\nnamespace Outracks.Fusion.Windows\n{\n\tclass Document\n\t{\n\t\tpublic readonly AbsoluteFilePath ProjectPath;\n\t\tpublic readonly IDialog<object> Window;\n\n\t\tpublic Document(AbsoluteFilePath projectPath, IDialog<object> dialog)\n\t\t{\n\t\t\tProjectPath = projectPath;\n\t\t\tWindow = dialog;\n\t\t}\n\t}\n\n\tclass ObservableDocument : IDocument\n\t{\n\t\tpublic ObservableDocument(AbsoluteFilePath path)\n\t\t{\n\t\t\tFilePath = Observable.Return(Optional.Some(path));\n\t\t}\n\n\t\tpublic IObservable<Optional<AbsoluteFilePath>> FilePath { get; private set; }\n\t\tpublic IObservable<byte[]> Content { get; private set; }\n\t\tpublic void Write(byte[] content) { }\n\t\tpublic IDialog<object> Window { get; set; }\n\t}\n\n\tclass DocumentAppHandler\n\t{\n\t\treadonly IReport _reporter;\n\t\treadonly string[] _args;\n\n\t\t// DON'T REMOVE: We have to keep a reference to prevent GC collection\n\t\t// ReSharper disable once NotAccessedField.Local\n\t\tMutex _mutex;\n\t\treadonly PipeName _pipeName;\n\t\treadonly List<Document> _projects = new List<Document>();\n\n\t\tpublic DocumentAppHandler(IReport reporter, string applicationName, string[] args)\n\t\t{\n\t\t\t_reporter = reporter;\n\t\t\t_args = args;\n\t\t\t_pipeName = new PipeName(applicationName);\n\t\t}\n\n\t\tpublic readonly ISubject<Window> DocumentOpened = new Subject<Window>();\n\n\t\tpublic bool IsOnlyInstance()\n\t\t{\n\t\t\tbool isOnlyInstance;\n\t\t\t_mutex = new Mutex(true, _pipeName.ToString(), out isOnlyInstance);\n\t\t\treturn isOnlyInstance;\n\t\t}\n\n\t\tpublic void RunClient()\n\t\t{\n\t\t\tvar createClient = Pipe.Connect(_pipeName);\n\t\t\tif (!createClient.Wait(TimeSpan.FromSeconds(6)))\n\t\t\t{\n\t\t\t\tvar errorMessage = \"Unable to create Fuse document client. Please try again.\";\n\t\t\t\tMessageBox.Show(errorMessage, \"Error\", MessageBoxButton.OK, MessageBoxImage.Error);\n\t\t\t\t_reporter.Error(errorMessage, ReportTo.Log | ReportTo.Headquarters);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tusing (var client = createClient.Result)\n\t\t\tusing (var streamWriter = new StreamWriter(client))\n\t\t\t{\n\t\t\t\tforeach (var arg in _args)\n\t\t\t\t{\n\t\t\t\t\tstreamWriter.WriteLine(arg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void RunHost()\n\t\t{\n\t\t\tif (_args.IsEmpty())\n\t\t\t{\n\t\t\t\tFusion.Application.LaunchedWithoutDocuments();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach (var arg in _args)\n\t\t\t\t\tOpenDocumentWindow(arg);\n\t\t\t}\n\n\t\t\tvar thread = new Thread(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\twhile (true)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar projectPaths = new List<string>();\n\t\t\t\t\t\t\tusing (var host = (NamedPipeServerStream)Pipe.Host(_pipeName).Result)\n\t\t\t\t\t\t\tusing (var reader = new StreamReader(host))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstring line;\n\t\t\t\t\t\t\t\twhile((line = reader.ReadLine()) != null)\n\t\t\t\t\t\t\t\t\tprojectPaths.Add(line);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (projectPaths.IsEmpty())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Then focus the last opened Window if we have one\n\t\t\t\t\t\t\t\t_projects.LastOrNone().Do(doc => doc.Window.Focus());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach (var project in projectPaths)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tOpenDocumentWindow(project);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_reporter.Exception(\"Failed to host document app.\", e, ReportTo.Log | ReportTo.Headquarters);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t{\n\t\t\t\tIsBackground = true\n\t\t\t};\n\t\t\tthread.Start();\n\t\t}\n\n\t\tvoid OpenDocumentWindow(string projectPath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar projPath = AbsoluteFilePath.Parse(projectPath);\n\t\t\t\tOpenDocumentWindow(projPath);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_reporter.Exception(\"Failed to load project '\" + projectPath + \"'\", e, ReportTo.Log | ReportTo.Headquarters);\n\t\t\t}\n\t\t}\n\n\t\tpublic Task<ObservableDocument> OpenDocumentWindow(AbsoluteFilePath projectPath)\n\t\t{\n\t\t\tvar tcs = new TaskCompletionSource<ObservableDocument>();\n\t\t\tvar observableDoc = new ObservableDocument(projectPath);\n\t\t\tvar existingDocument = _projects.FirstOrNone(project => project.ProjectPath == projectPath);\n\t\t\tif (existingDocument.HasValue)\n\t\t\t{\n\t\t\t\texistingDocument.Value.Window.Focus();\n\t\t\t\ttcs.SetResult(observableDoc);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar dummyWindow = new WindowsDialog<object>();\n\t\t\t\tdummyWindow.ShowDialog<object>(self =>\n\t\t\t\t{\n\t\t\t\t\tobservableDoc.Window = self;\n\t\t\t\t\tvar window = Fusion.Application.CreateDocumentWindow(observableDoc);\n\t\t\t\t\tvar document = new Document(projectPath, self);\n\t\t\t\t\twindow.Closed = window.Closed.Then(Command.Enabled(() =>\n\t\t\t\t\t\t_projects.Remove(document)));\n\t\t\t\t\t_projects.Add(document);\n\t\t\t\t\tDocumentOpened.OnNext(window);\n\t\t\t\t\twindow.Content.IsRooted.Take(1).Subscribe(_ =>\n\t\t\t\t\t\ttcs.SetResult(observableDoc));\n\t\t\t\t\treturn window;\n\t\t\t\t}).ContinueWith(e => { });\n\t\t\t}\n\t\t\treturn tcs.Task;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/DpiAwareForm.cs",
    "content": "﻿using System;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Security;\nusing System.Threading;\nusing System.Windows.Forms;\nusing System.Windows.Interop;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tpublic class DpiChangedArgs\n\t{\n\t\tpublic readonly int NewDpi;\n\t\tpublic DpiChangedArgs(int newDpi)\n\t\t{\n\t\t\tNewDpi = newDpi;\n\t\t}\n\t}\n\n\t[StructLayout(LayoutKind.Sequential)]\n\tstruct RectWin\n\t{\n\t\tpublic int Left;\n\t\tpublic int Top;\n\t\tpublic int Right;\n\t\tpublic int Bottom;\n\t}\n\n\tpublic class DpiAwareForm : Form\n\t{\n\t\tpublic readonly FpsProfiler FpsProfiler = new FpsProfiler();\n\t\treadonly CancellationTokenSource _quitSource = new CancellationTokenSource();\n\t\treadonly IVSyncContext _vsyncContext;\n\n\t\tSizeF _currentScale = new SizeF(1.0f, 1.0f);\n\t\tpublic SizeF ScaleFactor\n\t\t{\n\t\t\tget { return _currentScale; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tvar scaleDelta = new SizeF(value.Width / _currentScale.Width, value.Height / _currentScale.Height);\n\t\t\t\tScaleControl(scaleDelta, BoundsSpecified.Width | BoundsSpecified.Height);\n\t\t\t}\n\t\t}\n\n\t\tpublic event Action Restored;\n\t\tpublic event EventHandler<DpiChangedArgs> DpiChanged;\n\n\t\tpublic Ratio<Pixels, Points> Density\n\t\t{\n\t\t\tget { return DpiAwareness.GetDpi(Handle); }\n\t\t}\n\n\t\tpublic DpiAwareForm()\n\t\t{\n\t\t\t_vsyncContext = VerticalSynchronization.CreateContext();\n\t\t}\n\n\t\tprotected override void ScaleControl(SizeF factor, BoundsSpecified specified)\n\t\t{\n\t\t\tbase.ScaleControl(factor, specified);\n\t\t\t_currentScale = new SizeF(_currentScale.Width * factor.Width, _currentScale.Height * factor.Height);\n\t\t}\n\n\t\tpublic void MainLoop(Action onRender)\n\t\t{\n\t\t\twhile (!_quitSource.IsCancellationRequested)\n\t\t\t{\n\t\t\t\tFpsProfiler.Profile(() =>\n\t\t\t\t{\n\t\t\t\t\tNativeMethods.SetWindowLong(Handle, NativeMethods.GWL_EXSTYLE, NativeMethods.WS_EX_TOOLWINDOW);\n\t\t\t\t\tvar msg = new MSG();\n\t\t\t\t\twhile (NativeMethods.PeekMessage(ref msg, IntPtr.Zero, 0, 0, 0x0001))\n\t\t\t\t\t{\n\t\t\t\t\t\tNativeMethods.TranslateMessage(ref msg);\n\t\t\t\t\t\tNativeMethods.DispatchMessage(ref msg);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_quitSource.IsCancellationRequested)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t_vsyncContext.WaitForVBlank();\n\t\t\t\t\tonRender();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tpublic void Exit(int exitCode)\n\t\t{\n\t\t\t_quitSource.Cancel();\n\t\t\tEnvironment.Exit(exitCode);\n\t\t}\n\n\t\tprotected override void WndProc(ref Message m)\n\t\t{\n\t\t\tbase.WndProc(ref m);\n\n\t\t\tconst int WM_DPICHANGED = 0x02E0;\n\t\t\tconst int WM_SYSCOMMAND = 0x0112;\n\t\t\tconst int SC_RESTORE = 0xF120;\n\t\t\tconst int WM_QUIT = 0x0012;\n\t\t\tconst int WM_CLOSE = 0x0010;\n\t\t\tconst int WM_DESTROY = 0x0002;\n\n\t\t\tswitch (m.Msg)\n\t\t\t{\n\t\t\t\tcase WM_DPICHANGED:\n\t\t\t\t\t{\n\t\t\t\t\t\tvar rect = (RectWin)Marshal.PtrToStructure(m.LParam, typeof(RectWin));\n\n\t\t\t\t\t\tNativeMethods.SetWindowPos(\n\t\t\t\t\t\t\tHandle,\n\t\t\t\t\t\t\tIntPtr.Zero,\n\t\t\t\t\t\t\trect.Left,\n\t\t\t\t\t\t\trect.Top,\n\t\t\t\t\t\t\trect.Right - rect.Left,\n\t\t\t\t\t\t\trect.Bottom - rect.Top,\n\t\t\t\t\t\t\tSetWindowPosFlags.SWP_NOZORDER | SetWindowPosFlags.SWP_NOOWNERZORDER | SetWindowPosFlags.SWP_NOACTIVATE);\n\n\t\t\t\t\t\tvar newDpi = GetLoWord(m.WParam);\n\t\t\t\t\t\tif (DpiChanged != null)\n\t\t\t\t\t\t\tDpiChanged(this, new DpiChangedArgs(newDpi));\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase WM_SYSCOMMAND:\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((int) m.WParam == SC_RESTORE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (Restored != null)\n\t\t\t\t\t\t\t\tRestored();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase WM_CLOSE:\n\t\t\t\tcase WM_QUIT:\n\t\t\t\tcase WM_DESTROY:\n\t\t\t\t\t_quitSource.Cancel();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tint GetLoWord(IntPtr _xy)\n\t\t{\n\t\t\tuint xy = unchecked(IntPtr.Size == 8 ? (uint)_xy.ToInt64() : (uint)_xy.ToInt32());\n\t\t\tint x = unchecked((short)xy);\n\t\t\treturn x;\n\t\t}\n\t}\n\n\tstatic class NativeMethods\n\t{\n\t\t[DllImport(\"user32.dll\", SetLastError = true)]\n\t\tpublic static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);\n\n\t\t[SuppressUnmanagedCodeSecurity]\n\t\t[DllImport(\"user32.dll\")]\n\t\tpublic static extern bool PeekMessage(ref MSG msg, IntPtr hWnd, int messageFilterMin, int messageFilterMax, int flags);\n\n\t\t[SuppressUnmanagedCodeSecurity]\n\t\t[DllImport(\"user32.dll\")]\n\t\tpublic static extern bool TranslateMessage(ref MSG msg);\n\n\t\t[SuppressUnmanagedCodeSecurity]\n\t\t[DllImport(\"user32.dll\")]\n\t\tpublic static extern bool DispatchMessage(ref MSG msg);\n\n\t\tpublic const int GWL_STYLE = -16;\n\t\tpublic const int GWL_EXSTYLE = -20;\n\t\tpublic const int WS_EX_TOOLWINDOW = 0x00000080;\n\n\t\t[DllImport(\"user32.dll\")]\n\t\tpublic static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);\n\t}\n\n\t[Flags]\n\tenum SetWindowPosFlags : uint\n\t{\n\t\t// ReSharper disable InconsistentNaming\n\n\t\t/// <summary>\n\t\t///     If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.\n\t\t/// </summary>\n\t\tSWP_ASYNCWINDOWPOS = 0x4000,\n\n\t\t/// <summary>\n\t\t///     Prevents generation of the WM_SYNCPAINT message.\n\t\t/// </summary>\n\t\tSWP_DEFERERASE = 0x2000,\n\n\t\t/// <summary>\n\t\t///     Draws a frame (defined in the window's class description) around the window.\n\t\t/// </summary>\n\t\tSWP_DRAWFRAME = 0x0020,\n\n\t\t/// <summary>\n\t\t///     Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.\n\t\t/// </summary>\n\t\tSWP_FRAMECHANGED = 0x0020,\n\n\t\t/// <summary>\n\t\t///     Hides the window.\n\t\t/// </summary>\n\t\tSWP_HIDEWINDOW = 0x0080,\n\n\t\t/// <summary>\n\t\t///     Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).\n\t\t/// </summary>\n\t\tSWP_NOACTIVATE = 0x0010,\n\n\t\t/// <summary>\n\t\t///     Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.\n\t\t/// </summary>\n\t\tSWP_NOCOPYBITS = 0x0100,\n\n\t\t/// <summary>\n\t\t///     Retains the current position (ignores X and Y parameters).\n\t\t/// </summary>\n\t\tSWP_NOMOVE = 0x0002,\n\n\t\t/// <summary>\n\t\t///     Does not change the owner window's position in the Z order.\n\t\t/// </summary>\n\t\tSWP_NOOWNERZORDER = 0x0200,\n\n\t\t/// <summary>\n\t\t///     Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.\n\t\t/// </summary>\n\t\tSWP_NOREDRAW = 0x0008,\n\n\t\t/// <summary>\n\t\t///     Same as the SWP_NOOWNERZORDER flag.\n\t\t/// </summary>\n\t\tSWP_NOREPOSITION = 0x0200,\n\n\t\t/// <summary>\n\t\t///     Prevents the window from receiving the WM_WINDOWPOSCHANGING message.\n\t\t/// </summary>\n\t\tSWP_NOSENDCHANGING = 0x0400,\n\n\t\t/// <summary>\n\t\t///     Retains the current size (ignores the cx and cy parameters).\n\t\t/// </summary>\n\t\tSWP_NOSIZE = 0x0001,\n\n\t\t/// <summary>\n\t\t///     Retains the current Z order (ignores the hWndInsertAfter parameter).\n\t\t/// </summary>\n\t\tSWP_NOZORDER = 0x0004,\n\n\t\t/// <summary>\n\t\t///     Displays the window.\n\t\t/// </summary>\n\t\tSWP_SHOWWINDOW = 0x0040,\n\n\t\t// ReSharper restore InconsistentNaming\n\t}\n}"
  },
  {
    "path": "src/fusion/win/DpiAwareWindow.cs",
    "content": "﻿using System;\nusing System.Reactive.Subjects;\nusing System.Windows;\nusing System.Windows.Interop;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class DpiAwareWindow : System.Windows.Window\n\t{\n\t\treadonly ReplaySubject<Ratio<Pixels, Points>> _dpi = new ReplaySubject<Ratio<Pixels, Points>>(1);\n\n\t\tpublic IObservable<Ratio<Pixels, Points>> DensityFactor\n\t\t{\n\t\t\tget { return _dpi; }\n\t\t}\n\n\t\tpublic DpiAwareWindow()\n\t\t{\n\t\t\tLoaded += OnLoaded;\n\t\t}\n\n\t\tvoid OnLoaded(object sender, RoutedEventArgs routedEventArgs)\n\t\t{\n\t\t\tvar source = (HwndSource)PresentationSource.FromVisual(this);\n\t\t\t_dpi.OnNext(source.CompositionTarget.TransformToDevice.M11);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/DpiAwareness.cs",
    "content": "using System;\nusing System.Runtime.InteropServices;\nusing Outracks.Diagnostics;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tpublic static class DpiAwareness\n\t{\n\t\tpublic static void SetDpiAware(ProcessDpiAwareness value)\n\t\t{\n\t\t\tif (Platform.IsWindows)\n\t\t\t{\n\t\t\t\tif (Platform.OperatingSystemVersion >= Platform.Windows8_1)\n\t\t\t\t{\n\t\t\t\t\tvar result = NativeMethods.SetProcessDpiAwareness(value);\n\t\t\t\t\tif (result != HRESULT.Ok)\n\t\t\t\t\t\tConsole.WriteLine(\"Failed to set application to be DPI aware: \" + result);\n\t\t\t\t}\n\t\t\t\telse if (Platform.OperatingSystemVersion >= Platform.WindowsVista)\n\t\t\t\t{\n\t\t\t\t\t// This platform only supports system dpi awareness.\n\t\t\t\t\tif (!NativeMethods.SetProcessDPIAware())\n\t\t\t\t\t\tConsole.WriteLine(\"Failed to set application to be DPI aware.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tConsole.WriteLine(\"This platform does not support DPI awareness.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic static double GetDpi(IntPtr hWnd)\n\t\t{\n\t\t\tif (Environment.OSVersion.Version >= Platform.Windows8_1)\n\t\t\t{\n\t\t\t\t// Return per monitor dpi\n\t\t\t\tvar monitor = NativeMethods.MonitorFromWindow(hWnd, 0x00000002 /* MONITOR_DEFAULTTONEAREST */);\n\t\t\t\tuint dpiX, dpiY;\n\t\t\t\tNativeMethods.GetDpiForMonitor(monitor, 0, out dpiX, out dpiY);\n\t\t\t\treturn (double)dpiX / 96.0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Return system dpi\n\t\t\t\tvar hDC = NativeMethods.GetDC(IntPtr.Zero);\n\t\t\t\tvar dpiX = NativeMethods.GetDeviceCaps(hDC, DeviceCap.LOGPIXELSX);\n\t\t\t\tNativeMethods.ReleaseDC(IntPtr.Zero, hDC);\n\t\t\t\treturn (double)dpiX / 96.0;\n\t\t\t}\n\t\t}\n\n\t\tstatic class NativeMethods\n\t\t{\n\t\t\t[DllImport(\"user32.dll\")]\n\t\t\tpublic static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags);\n\n\t\t\t[DllImport(\"user32.dll\", SetLastError = true)]\n\t\t\tpublic static extern IntPtr GetDC(IntPtr hWnd);\n\n\t\t\t[DllImport(\"user32.dll\")]\n\t\t\tpublic static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDC);\n\n\t\t\t[DllImport(\"gdi32.dll\")]\n\t\t\tpublic static extern int GetDeviceCaps(IntPtr hdc, DeviceCap nIndex);\n\n\t\t\t[DllImport(\"Shcore.dll\")]\n\t\t\tpublic static extern HRESULT GetDpiForMonitor(IntPtr hmonitor, uint dpiType, out uint dpiX, out uint dpiY);\n\n\t\t\t[DllImport(\"user32.dll\")]\n\t\t\tpublic static extern bool SetProcessDPIAware();\n\n\t\t\t[DllImport(\"Shcore.dll\")]\n\t\t\tpublic static extern HRESULT SetProcessDpiAwareness(ProcessDpiAwareness value);\n\n\t\t\t[DllImport(\"Shcore.dll\")]\n\t\t\tpublic static extern HRESULT GetProcessDpiAwareness(IntPtr hprocess, out ProcessDpiAwareness value);\n\t\t}\n\n\t\tenum HRESULT : uint\n\t\t{\n\t\t\tOk = 0,\n\t\t\tInvalidArg = 0x80070057,\n\t\t\tAccessDenied = 0x80070005\n\t\t}\n\n\t\tpublic enum ProcessDpiAwareness\n\t\t{\n\t\t\tUnaware = 0,\n\t\t\tSystemAware = 1,\n\t\t\tMonitorAware = 2\n\t\t}\n\n\t\tenum DeviceCap\n\t\t{\n\t\t\t/// <summary>\n\t\t\t/// Device driver version\n\t\t\t/// </summary>\n\t\t\tDRIVERVERSION = 0,\n\t\t\t/// <summary>\n\t\t\t/// Device classification\n\t\t\t/// </summary>\n\t\t\tTECHNOLOGY = 2,\n\t\t\t/// <summary>\n\t\t\t/// Horizontal size in millimeters\n\t\t\t/// </summary>\n\t\t\tHORZSIZE = 4,\n\t\t\t/// <summary>\n\t\t\t/// Vertical size in millimeters\n\t\t\t/// </summary>\n\t\t\tVERTSIZE = 6,\n\t\t\t/// <summary>\n\t\t\t/// Horizontal width in pixels\n\t\t\t/// </summary>\n\t\t\tHORZRES = 8,\n\t\t\t/// <summary>\n\t\t\t/// Vertical height in pixels\n\t\t\t/// </summary>\n\t\t\tVERTRES = 10,\n\t\t\t/// <summary>\n\t\t\t/// Number of bits per pixel\n\t\t\t/// </summary>\n\t\t\tBITSPIXEL = 12,\n\t\t\t/// <summary>\n\t\t\t/// Number of planes\n\t\t\t/// </summary>\n\t\t\tPLANES = 14,\n\t\t\t/// <summary>\n\t\t\t/// Number of brushes the device has\n\t\t\t/// </summary>\n\t\t\tNUMBRUSHES = 16,\n\t\t\t/// <summary>\n\t\t\t/// Number of pens the device has\n\t\t\t/// </summary>\n\t\t\tNUMPENS = 18,\n\t\t\t/// <summary>\n\t\t\t/// Number of markers the device has\n\t\t\t/// </summary>\n\t\t\tNUMMARKERS = 20,\n\t\t\t/// <summary>\n\t\t\t/// Number of fonts the device has\n\t\t\t/// </summary>\n\t\t\tNUMFONTS = 22,\n\t\t\t/// <summary>\n\t\t\t/// Number of colors the device supports\n\t\t\t/// </summary>\n\t\t\tNUMCOLORS = 24,\n\t\t\t/// <summary>\n\t\t\t/// Size required for device descriptor\n\t\t\t/// </summary>\n\t\t\tPDEVICESIZE = 26,\n\t\t\t/// <summary>\n\t\t\t/// Curve capabilities\n\t\t\t/// </summary>\n\t\t\tCURVECAPS = 28,\n\t\t\t/// <summary>\n\t\t\t/// Line capabilities\n\t\t\t/// </summary>\n\t\t\tLINECAPS = 30,\n\t\t\t/// <summary>\n\t\t\t/// Polygonal capabilities\n\t\t\t/// </summary>\n\t\t\tPOLYGONALCAPS = 32,\n\t\t\t/// <summary>\n\t\t\t/// Text capabilities\n\t\t\t/// </summary>\n\t\t\tTEXTCAPS = 34,\n\t\t\t/// <summary>\n\t\t\t/// Clipping capabilities\n\t\t\t/// </summary>\n\t\t\tCLIPCAPS = 36,\n\t\t\t/// <summary>\n\t\t\t/// Bitblt capabilities\n\t\t\t/// </summary>\n\t\t\tRASTERCAPS = 38,\n\t\t\t/// <summary>\n\t\t\t/// Length of the X leg\n\t\t\t/// </summary>\n\t\t\tASPECTX = 40,\n\t\t\t/// <summary>\n\t\t\t/// Length of the Y leg\n\t\t\t/// </summary>\n\t\t\tASPECTY = 42,\n\t\t\t/// <summary>\n\t\t\t/// Length of the hypotenuse\n\t\t\t/// </summary>\n\t\t\tASPECTXY = 44,\n\t\t\t/// <summary>\n\t\t\t/// Shading and Blending caps\n\t\t\t/// </summary>\n\t\t\tSHADEBLENDCAPS = 45,\n\n\t\t\t/// <summary>\n\t\t\t/// Logical pixels inch in X\n\t\t\t/// </summary>\n\t\t\tLOGPIXELSX = 88,\n\t\t\t/// <summary>\n\t\t\t/// Logical pixels inch in Y\n\t\t\t/// </summary>\n\t\t\tLOGPIXELSY = 90,\n\n\t\t\t/// <summary>\n\t\t\t/// Number of entries in physical palette\n\t\t\t/// </summary>\n\t\t\tSIZEPALETTE = 104,\n\t\t\t/// <summary>\n\t\t\t/// Number of reserved entries in palette\n\t\t\t/// </summary>\n\t\t\tNUMRESERVED = 106,\n\t\t\t/// <summary>\n\t\t\t/// Actual color resolution\n\t\t\t/// </summary>\n\t\t\tCOLORRES = 108,\n\n\t\t\t// Printing related DeviceCaps. These replace the appropriate Escapes\n\t\t\t/// <summary>\n\t\t\t/// Physical Width in device units\n\t\t\t/// </summary>\n\t\t\tPHYSICALWIDTH = 110,\n\t\t\t/// <summary>\n\t\t\t/// Physical Height in device units\n\t\t\t/// </summary>\n\t\t\tPHYSICALHEIGHT = 111,\n\t\t\t/// <summary>\n\t\t\t/// Physical Printable Area x margin\n\t\t\t/// </summary>\n\t\t\tPHYSICALOFFSETX = 112,\n\t\t\t/// <summary>\n\t\t\t/// Physical Printable Area y margin\n\t\t\t/// </summary>\n\t\t\tPHYSICALOFFSETY = 113,\n\t\t\t/// <summary>\n\t\t\t/// Scaling factor x\n\t\t\t/// </summary>\n\t\t\tSCALINGFACTORX = 114,\n\t\t\t/// <summary>\n\t\t\t/// Scaling factor y\n\t\t\t/// </summary>\n\t\t\tSCALINGFACTORY = 115,\n\n\t\t\t/// <summary>\n\t\t\t/// Current vertical refresh rate of the display device (for displays only) in Hz\n\t\t\t/// </summary>\n\t\t\tVREFRESH = 116,\n\t\t\t/// <summary>\n\t\t\t/// Vertical height of entire desktop in pixels\n\t\t\t/// </summary>\n\t\t\tDESKTOPVERTRES = 117,\n\t\t\t/// <summary>\n\t\t\t/// Horizontal width of entire desktop in pixels\n\t\t\t/// </summary>\n\t\t\tDESKTOPHORZRES = 118,\n\t\t\t/// <summary>\n\t\t\t/// Preferred blt alignment\n\t\t\t/// </summary>\n\t\t\tBLTALIGNMENT = 119\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/DraggingImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class DraggingImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tDragging.Implementation.OnDragOver = (control, canDrop, drop, enter, leave) =>\n\t\t\t{\n\t\t\t\tvar layer = Layout.Layer(control).WithSize(control.DesiredSize);\n\n\t\t\t\tTask.Run(async () =>\n\t\t\t\t{\n\t\t\t\t\tvar view = (Canvas)await Fusion.Application.MainThread.InvokeAsync(() => layer.NativeHandle);\n\n\n\t\t\t\t\tFunc<object, bool> canDropNow = o => false;\n\t\t\t\t\tlayer.BindNativeProperty(Fusion.Application.MainThread, \"canDrop\", canDrop, c => canDropNow = c);\n\n\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tview.AllowDrop = true;\n\t\t\t\t\t\tview.Background = Brushes.Transparent;\n\n\t\t\t\t\t\tview.Drop += (s, a) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (a.Data.GetDataPresent(typeof(DragData)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar d = (DragData)a.Data.GetData(typeof(DragData));\n\t\t\t\t\t\t\t\tif (!canDropNow(d.Data))\n\t\t\t\t\t\t\t\t\treturn;\n\n\n\t\t\t\t\t\t\t\tdrop(d.Data);\n\t\t\t\t\t\t\t\ta.Handled = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tvar data = Optional.None<Object>();\n\n\t\t\t\t\t\tview.DragLeave += (s, a) => data.Do(leave);\n\n\t\t\t\t\t\tview.DragOver += (s, a) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (a.Data.GetDataPresent(typeof(DragData)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar d = (DragData)a.Data.GetData(typeof(DragData));\n\t\t\t\t\t\t\t\tif (!canDropNow(d.Data))\n\t\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t\tdata = d.Data;\n\t\t\t\t\t\t\t\ta.Effects = DragDropEffects.All;\n\t\t\t\t\t\t\t\ta.Handled = true;\n\t\t\t\t\t\t\t\tdata.Do(enter);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\treturn layer;\n\t\t\t};\n\t\t}\n\n\t\tpublic class DragData\n\t\t{\n\t\t\tpublic readonly object Data;\n\n\t\t\tpublic DragData(object data)\n\t\t\t{\n\t\t\t\tData = data;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/EffectsImplementation.cs",
    "content": "using System;\nusing System.Drawing;\nusing System.Reactive.Linq;\nusing System.Windows;\nusing System.Windows.Media.Effects;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class EffectsImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tEffects.Implementation.DropShadow = (content, color, radius, angle, distance) =>\n\t\t\t{\n\t\t\t\tvar offset = angle\n\t\t\t\t\t.Select(d => Math.PI * d / 180.0)\n\t\t\t\t\t.CombineLatest(distance, (r, d) =>\n\t\t\t\t\t\tnew SizeF((float)(Math.Cos(r) * d), (float)(Math.Sin(r) * d)));\n\n\t\t\t\tvar extrudeSize = offset\n\t\t\t\t\t.CombineLatest(radius, (off, rad) =>\n\t\t\t\t\t\tnew Size<Points>(Math.Abs(off.Width) + rad, Math.Abs(off.Height) + rad))\n\t\t\t\t\t.Select(s => new Thickness<Points>(s.Width, s.Height));\n\n\t\t\t\tcontent = content.WithPadding(extrudeSize);\n\t\t\t\tvar self = Layout.Layer(content).WithSize(content.DesiredSize);\n\n\t\t\t\tdispatcher.Enqueue(() =>\n\t\t\t\t{\n\t\t\t\t\tvar effect = new DropShadowEffect();\n\t\t\t\t\tvar control = self.NativeHandle as FrameworkElement;\n\t\t\t\t\tif (control == null)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"color\", color, c => effect.Color = c.ToColor());\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"color.a\", color, c => effect.Opacity = c.A);\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"radius\", radius, c => effect.BlurRadius = c);\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"angle\", angle, c => effect.Direction = c);\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"distance\", distance, c => effect.ShadowDepth = c);\n\n\t\t\t\t\tcontrol.Effect = effect;\n\t\t\t\t});\n\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/FancyWindow.xaml",
    "content": "﻿<windows:WindowWithOverlays x:Class=\"Outracks.Fusion.Windows.FancyWindow\"\n        xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n\t\txmlns:windows=\"clr-namespace:Outracks.Fusion.Windows\"\n\t\tTitle=\"fuse X\"\n\t\tWindowStartupLocation=\"CenterOwner\"\n\t\tBorderThickness=\"0\">\n\t\n\t<windows:WindowWithOverlays.Resources>\n\t\t<ResourceDictionary>\n\t\t\t<ResourceDictionary.MergedDictionaries>\n\t\t\t\t<ResourceDictionary Source=\"StyleResources.xaml\"></ResourceDictionary>\n\t\t\t</ResourceDictionary.MergedDictionaries>\n\t\t</ResourceDictionary>\t\t\n\t</windows:WindowWithOverlays.Resources>\t\n\t<!--WindowTitleBrush=\"{StaticResource TitleBrush}\"\n\t\tGlowBrush=\"{StaticResource TitleBrush}\"-->\n\n</windows:WindowWithOverlays>\n"
  },
  {
    "path": "src/fusion/win/FancyWindow.xaml.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic partial class FancyWindow\n\t{\n\t\tpublic System.Windows.Controls.Menu Menu { get; } = new System.Windows.Controls.Menu();\n\n\t\tpublic FancyWindow(bool hasTitleBar)\n\t\t{\n\t\t\tCustomTitlebar.ApplyTo(this);\n\n\t\t\tInitializeComponent();\n\t\t\tif (hasTitleBar)\n\t\t\t\tStyle = (Style) Resources[\"FancyWindowStyle\"];\n\t\t\telse\n\t\t\t{\n\t\t\t\tWindowStyle = System.Windows.WindowStyle.None;\n\t\t\t\tStyle = (Style) Resources[\"NoTitlebar\"];\n\t\t\t}\n\n\t\t\tMouseDown += OnMouseDown;\n\t\t\tSizeChanged += OnSizeChanged;\n\t\t}\n\n\t\tvoid OnMouseDown(object sender, MouseButtonEventArgs e)\n\t\t{\n\t\t\tif (e.ChangedButton == MouseButton.Left)\n\t\t\t\tDragMove();\n\t\t}\n\n\t\tvoid OnSizeChanged(object sender, SizeChangedEventArgs e)\n\t\t{\n\t\t\tif (Template.FindName(\"WindowTitleTextBlock\", this) is TextBlock title)\n\t\t\t\ttitle.Opacity = Math.Max(0, Math.Min(1, (ActualWidth * .5 - Menu.ActualWidth - title.ActualWidth * .5 - 28) / (title.ActualWidth * .5)));\n\t\t}\n\n\t\tpublic override void OnApplyTemplate()\n\t\t{\n\t\t\tbase.OnApplyTemplate();\n\t\t\tvar container = Template.FindName(\"MenuContainer\", this) as StackPanel;\n\t\t\tcontainer?.Children.Add(Menu);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/FileDialogs.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing Microsoft.Win32;\nusing Ookii.Dialogs.Wpf;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class FileDialogs : IFileDialogImplementation\n\t{\n\t    readonly System.Windows.Window _window;\n\t\treadonly System.Windows.Threading.Dispatcher _dispatcher;\n\t\treadonly Action _focus;\n\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tFileDialog.Implementation = windowControl =>\n\t\t\t{\n\t\t\t\tvar window = windowControl.Select(x => x.NativeHandle).As<FrameworkElement>()\n\t\t\t\t\t.SelectMany(\n\t\t\t\t\t\tx =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar hwndSource = PresentationSource.FromVisual(x);\n\t\t\t\t\t\t\tif (hwndSource == null)\n\t\t\t\t\t\t\t\treturn Optional.None();\n\n\t\t\t\t\t\t\tvar w = hwndSource.RootVisual as System.Windows.Window;\n\t\t\t\t\t\t\tif (w == null)\n\t\t\t\t\t\t\t\treturn Optional.None();\n\n\t\t\t\t\t\t\treturn Optional.Some(w);\n\t\t\t\t\t\t});\n\t\t\t\treturn new FileDialogs(window.OrDefault());\n\t\t\t};\n\t\t}\n\n\t\tpublic FileDialogs(System.Windows.Window window)\n\t    {\n\t\t    _window = window;\n\t\t    _dispatcher = _window == null\n\t\t\t\t? System.Windows.Application.Current.Dispatcher\n\t\t\t\t: _window.Dispatcher;\n\n\t\t\t_focus = _window == null\n\t\t\t\t? new Action(() => { })\n\t\t\t\t: (() => _window.Focus());\n\t    }\n\n\t    public Task<Optional<FileDialogResult>> SaveFile(FileDialogOptions options)\n\t    {\n\t\t\treturn _dispatcher.InvokeAsync(() => SaveFileSync(options)).Task;\n\t\t}\n\n\t\tpublic Task<Optional<FileDialogResult>> OpenFile(FileDialogOptions options)\n\t\t{\n\t\t\treturn _dispatcher.InvokeAsync(() => OpenFileSync(options)).Task;\n\t\t}\n\n\t\tpublic Task<Optional<IEnumerable<FileDialogResult>>> OpenFiles(FileDialogOptions options)\n\t\t{\n\t\t\treturn _dispatcher.InvokeAsync(() => OpenFilesSync(options)).Task;\n\t\t}\n\n\t\tpublic Task<Optional<AbsoluteDirectoryPath>> SelectDirectory(DirectoryDialogOptions options)\n\t\t{\n\t\t\treturn _dispatcher.InvokeAsync(() => SelectDirectorySync(options)).Task;\n\t\t}\n\n\t\tOptional<FileDialogResult> SaveFileSync(FileDialogOptions options)\n\t\t{\n\t\t\tvar ofd = new SaveFileDialog\n\t\t\t{\n\t\t\t\tTitle = options.Caption,\n\t\t\t\tFilter = options.Filters.CreateFilterString(),\n\t\t\t\tOverwritePrompt = true,\n\t\t\t};\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tofd.InitialDirectory = options.Directory.NativePath;\n\n\t\t\tvar success = _window == null ? ofd.ShowDialog() : ofd.ShowDialog(_window);\n\t\t\tvar filename = ofd.FileName;\n\t\t\tvar result = new FileDialogResult();\n\t\t\tif (success.Value)\n\t\t\t{\n\t\t\t\tresult.Path = AbsoluteFilePath.Parse(ofd.FileName);\n\t\t\t\tresult.Filter = FilterAtIndex(ofd.Filter, ofd.FilterIndex);\n\t\t\t}\n\t\t\tFocus();\n\n\t\t\treturn success.Value\n\t\t\t\t? Optional.Some(result)\n\t\t\t\t: Optional.None<FileDialogResult>();\n\t\t}\n\n\t\tOptional<FileDialogResult> OpenFileSync(FileDialogOptions options)\n\t\t{\n\t\t\tvar ofd = new OpenFileDialog\n\t\t\t{\n\t\t\t\tTitle = options.Caption,\n\t\t\t\tFilter = options.Filters.CreateFilterString(),\n\t\t\t\tCheckPathExists = true,\n\t\t\t\tCheckFileExists = true,\n\t\t\t};\n\n\t\t\tFilterString.Parse(ofd.Filter).Each(f => Console.WriteLine(f));\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tofd.InitialDirectory = options.Directory.NativePath;\n\n\t\t\tvar success = _window == null ? ofd.ShowDialog() : ofd.ShowDialog(_window);\n\t\t\tvar filename = ofd.FileName;\n\t\t\tvar result = new FileDialogResult();\n\t\t\tif (success.Value)\n\t\t\t{\n\t\t\t\tresult.Path = AbsoluteFilePath.Parse(ofd.FileName);\n\t\t\t\tresult.Filter = FilterAtIndex(ofd.Filter, ofd.FilterIndex);\n\t\t\t}\n\n\t\t\tFocus();\n\n\t\t\treturn success.Value\n\t\t\t\t? Optional.Some(result)\n\t\t\t\t: Optional.None<FileDialogResult>();\n\t\t}\n\n\t\tOptional<IEnumerable<FileDialogResult>> OpenFilesSync(FileDialogOptions options)\n\t    {\n\t\t\tvar ofd = new OpenFileDialog\n\t\t\t{\n\t\t\t\tTitle = options.Caption,\n\t\t\t\tFilter = options.Filters.CreateFilterString(),\n\t\t\t\tCheckPathExists = true,\n\t\t\t\tCheckFileExists = true,\n\t\t\t\tMultiselect = true,\n\t\t\t};\n\n\t\t\tConsole.WriteLine(FilterString.Parse(ofd.Filter));\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tofd.InitialDirectory = options.Directory.NativePath;\n\n\t\t\tvar success = _window == null ? ofd.ShowDialog() : ofd.ShowDialog(_window);\n\t\t\tvar filenames = ofd.FileNames;\n\n\t\t\tfilenames.Select(AbsoluteFilePath.Parse);\n\t\t\tIEnumerable<FileDialogResult> results = null;\n\t\t\tif (success.Value)\n\t\t\t{\n\t\t\t\tvar f = FilterAtIndex(ofd.Filter, ofd.FilterIndex);\n\t\t\t\tresults = ofd.FileNames.Select(\n\t\t\t\t\tp => new FileDialogResult(AbsoluteFilePath.Parse(p), f)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tFocus();\n\n\t\t\treturn success.Value\n\t\t\t\t? Optional.Some(results)\n\t\t\t\t: Optional.None<IEnumerable<FileDialogResult>>();\n\t    }\n\n\t\tOptional<AbsoluteDirectoryPath> SelectDirectorySync(DirectoryDialogOptions options)\n\t\t{\n\t\t\tvar ofd = new VistaFolderBrowserDialog\n\t\t\t{\n\t\t\t\tDescription = options.Caption,\n\t\t\t\tShowNewFolderButton = true,\n\t\t\t\tUseDescriptionForTitle = true,\n\t\t\t};\n\n\t\t\tif (options.Directory != null)\n\t\t\t\tofd.SelectedPath = options.Directory.NativePath;\n\n\t\t\tvar success = _window == null ? ofd.ShowDialog() : ofd.ShowDialog(_window);\n\t\t\tvar path = ofd.SelectedPath;\n\n\t\t\treturn success.HasValue && success.Value\n\t\t\t\t? Optional.Some(AbsoluteDirectoryPath.Parse(path))\n\t\t\t\t: Optional.None<AbsoluteDirectoryPath>();\n\t\t}\n\n\t    void Focus()\n\t    {\n\t\t\t_focus();\n\t    }\n\n\t\tstatic FileFilter FilterAtIndex(string filterStr, int idx){\n\t\t\tidx--; //Filters start at 1 for whatever reason\n\t\t\tvar a = FilterString.Parse(filterStr);\n\t\t\treturn a[idx];\n\t\t}\n\n\n    }\n}\n"
  },
  {
    "path": "src/fusion/win/FilterString.cs",
    "content": "﻿using System.Linq;\nusing System.Text;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class FilterString\n\t{\n\t\tpublic static string CreateFilterString(this FileFilter[] filters)\n\t\t{\n\t\t\tif (filters == null || filters.Length == 0)\n\t\t\t\treturn \"All Files (*.*)|*.*\";\n\n\t\t\tvar sb = new StringBuilder();\n\n\t\t\tforeach (var f in filters)\n\t\t\t{\n\t\t\t\tif (sb.Length > 0)\n\t\t\t\t\tsb.Append('|');\n\n\t\t\t\tsb.Append(f.Label);\n\n\t\t\t\tsb.Append(\"|\");\n\n\t\t\t\t//No need to fill in the parentheses according to MS examples. It does so automatically apparently.\n\n\t\t\t\tif (f.Extensions == null || f.Extensions.Length == 0)\n\t\t\t\t{\n\t\t\t\t\tsb.Append(\"*.*\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < f.Extensions.Length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (i > 0)\n\t\t\t\t\t\t\tsb.Append(\";\");\n\n\t\t\t\t\t\tsb.Append(\"*.\" + f.Extensions[i].Trim('.', '*'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tpublic static FileFilter[] Parse(string filters)\n\t\t{\n\t\t\tvar a = filters.Split(\"|\");\n\t\t\tvar b = a.Where((v, i) => i % 2 == 0);\n\t\t\tvar c = a.Where((v, i) => i % 2 == 1);\n\n\t\t\treturn b.Zip(c,\n\t\t\t\t(first, second) =>\n\t\t\t\t\tnew FileFilter(first,\n\t\t\t\t\t\tsecond.Split(\";\").Select(s =>\n\t\t\t\t\t\t\ts.TrimStart('*', '.')\n\t\t\t\t\t\t).ToArray()\n\t\t\t\t\t)\n\t\t\t\t).ToArray();\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "src/fusion/win/KeyboardImplementation.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class KeyboardImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tKeyboard.Implementation.GiveFocusTo = control =>\n\t\t\t\tFusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => control.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.OfType<FrameworkElement>()\n\t\t\t\t\t.Switch(element =>\n\t\t\t\t\t\tCommand.Enabled(() =>\n\t\t\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\telement.Focus();\n\t\t\t\t\t\t\t\tSystem.Windows.Input.Keyboard.Focus(element);\n\t\t\t\t\t\t\t})));\n\n\t\t\tKeyboard.Implementation.Pressed = CreateHandler((e, h) => e.KeyDown += h, (e, h) => e.KeyDown -= h);\n\t\t\tKeyboard.Implementation.Released = CreateHandler((e, h) => e.KeyUp += h, (e, h) => e.KeyUp -= h);\n\n\t\t\tKeyboard.Implementation.GlobalPressed = CreateHandlerGlobal(dispatcher, (e, h) => e.PreviewKeyDown += h, (e, h) => e.PreviewKeyDown -= h);\n\t\t\tKeyboard.Implementation.GlobalReleased = CreateHandlerGlobal(dispatcher, (e, h) => e.PreviewKeyUp += h, (e, h) => e.PreviewKeyUp -= h);\n\t\t}\n\n\t\tstatic Func<IControl, ModifierKeys, Key, IObservable<Unit>> CreateHandler(\n\t\t\tAction<FrameworkElement, KeyEventHandler> addHandler,\n\t\t\tAction<FrameworkElement, KeyEventHandler> removeHandler)\n\t\t{\n\t\t\treturn (self, modifier, key) =>\n\t\t\t\tself.GetNativeControlWhileMounted() // The observable sequence is scheduled on the main-thread so it's safe\n\t\t\t\t\t.Switch(me => me.MatchWith(\n\t\t\t\t\t\tnone: Observable.Never<Unit>,\n\t\t\t\t\t\tsome: e => Observable\n\t\t\t\t\t\t\t.FromEventPattern<KeyEventHandler, KeyEventArgs>(h => addHandler(e, h), h => removeHandler(e, h))\n\t\t\t\t\t\t\t.Where(a => a.EventArgs.Key == key.ToWpfKey() && System.Windows.Input.Keyboard.Modifiers == modifier.ToWpfModifierKeys())\n\t\t\t\t\t\t\t.Select(_ => Unit.Default)));\n\t\t}\n\n\t\tstatic Func<IControl, ModifierKeys, Key, IObservable<Unit>> CreateHandlerGlobal(\n\t\t\tDispatcher dispatcher,\n\t\t\tAction<System.Windows.Window, KeyEventHandler> addHandler,\n\t\t\tAction<System.Windows.Window, KeyEventHandler> removeHandler)\n\t\t{\n\t\t\treturn (self, modifier, key) =>\n\t\t\t\tFusion.Application.MainThread\n\t\t\t\t\t.InvokeAsync(() => self.NativeHandle)\n\t\t\t\t\t.ToObservable()\n\t\t\t\t\t.OfType<FrameworkElement>()\n\t\t\t\t\t.Select(element =>\n\t\t\t\t\t\telement.GetWindow<System.Windows.Window>()\n\t\t\t\t\t\t\t.NotNone()\n\t\t\t\t\t\t\t.Switch(w => Observable\n\t\t\t\t\t\t\t\t.FromEventPattern<KeyEventHandler, KeyEventArgs>(h => addHandler(w, h), h => removeHandler(w, h))\n\t\t\t\t\t\t\t\t.Where(a => a.EventArgs.Key == key.ToWpfKey() && System.Windows.Input.Keyboard.Modifiers == modifier.ToWpfModifierKeys())\n\t\t\t\t\t\t\t\t.Select(_ => Unit.Default)))\n\t\t\t\t\t.Switch();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Marshalling.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing WpfKey = System.Windows.Input.Key;\nusing WpfModifier = System.Windows.Input.ModifierKeys;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class Marshalling\n\t{\n\t\tpublic static Point<Points> ToFusion(this System.Windows.Point point)\n\t\t{\n\t\t\treturn new Point<Points>(point.X, point.Y);\n\t\t}\n\n\t\tpublic static Size<Points> ToFusion(this System.Windows.Size size)\n\t\t{\n\t\t\treturn Size.Create<Points>(size.Width, size.Height);\n\t\t}\n\n\t\tpublic static System.Windows.Size ToWpf(this Size<Points> size)\n\t\t{\n\t\t\treturn new System.Windows.Size(size.Width, size.Height);\n\t\t}\n\n\t\tpublic static System.Windows.TextAlignment ToWpf(this TextAlignment textAlignment)\n\t\t{\n\t\t\tswitch (textAlignment)\n\t\t\t{\n\t\t\t\tcase TextAlignment.Left: return System.Windows.TextAlignment.Left;\n\t\t\t\tcase TextAlignment.Right: return System.Windows.TextAlignment.Right;\n\t\t\t\tcase TextAlignment.Center: return System.Windows.TextAlignment.Center;\n\t\t\t}\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static Transform ToWpfScaleRotation(this Matrix matrix)\n\t\t{\n\t\t\treturn new MatrixTransform(matrix.M11, matrix.M12, matrix.M21, matrix.M22, 0, 0);\n\t\t}\n\n\t\t/*\n\t\tpublic static IObservable<Brush> ToBrush(this Fusion.Brush brush, Dispatcher dispatcher)\n\t\t{\n\t\t\treturn brush.Color.Switch(color => dispatcher.InvokeAsync(() => new SolidColorBrush(color.ToColor())));\n\t\t}\n\t\t*/\n\n\t\tpublic static System.Windows.Media.Color ToColor(this Color value)\n\t\t{\n\t\t\treturn new System.Windows.Media.Color()\n\t\t\t{\n\t\t\t\tR = (byte) (value.R * 255),\n\t\t\t\tG = (byte) (value.G * 255),\n\t\t\t\tB = (byte) (value.B * 255),\n\t\t\t\t//A = (byte) (value.A * 254 + 1) // Using opacity of 0 in WPF seems to cause different click-through behavior when in a transparent vs opaque window\n\t\t\t\tA = (byte) (value.A * 255)\n\t\t\t};\n\t\t}\n\t\tpublic static Color ToFusion(this System.Windows.Media.Color value)\n\t\t{\n\t\t\treturn Color.FromBytes(\n\t\t\t\tr: value.R,\n\t\t\t\tg: value.G,\n\t\t\t\tb: value.B,\n\t\t\t\ta: value.A);\n\t\t}\n\n\t\tpublic static DoubleCollection ToDashArray(this StrokeDashArray value)\n\t\t{\n\t\t\tvar result = new DoubleCollection(value.Data.Length);\n\t\t\tforeach(var val in value.Data)\n\t\t\t\tresult.Add(val);\n\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static HotKey ToHotKey(this InputGestureCollection gestures)\n\t\t{\n\t\t\tif (gestures.Count < 1)\n\t\t\t\treturn HotKey.None;\n\n\t\t\tvar gesture = gestures[0] as KeyGesture;\n\t\t\tif (gesture == null)\n\t\t\t\treturn HotKey.None;\n\n\t\t\treturn HotKey.Create(gesture.Modifiers.ToFusion(), gesture.Key.ToFusion());\n\t\t}\n\n\t\tpublic static KeyGesture ToWpfGesture(this HotKey hotkey)\n\t\t{\n\t\t\tvar key = hotkey.Key.ToWpfKey();\n\t\t\tvar modiferKeys = hotkey.Modifier.ToWpfModifierKeys();\n\t\t\treturn new KeyGesture(key.Value, modiferKeys, key.Value.ToShortcutString(modiferKeys));\n\t\t}\n\n\t\tpublic static ModifierKeys ToFusion(this WpfModifier modifier)\n\t\t{\n\t\t\tvar key = ModifierKeys.None;\n\t\t\tif (modifier.HasFlag(WpfModifier.Alt)) key |= ModifierKeys.Alt;\n\t\t\tif (modifier.HasFlag(WpfModifier.Control)) key |= ModifierKeys.Control;\n\t\t\tif (modifier.HasFlag(WpfModifier.Shift)) key |= ModifierKeys.Shift;\n\t\t\tif (modifier.HasFlag(WpfModifier.Windows)) key |= ModifierKeys.Windows; //throw new NotImplementedException(\"Windows modifier key\"); // key |= EtoKey.Windows;\n\t\t\treturn key;\n\t\t}\n\n\t\tpublic static WpfModifier ToWpfModifierKeys(this ModifierKeys keys)\n\t\t{\n\t\t\tvar key = WpfModifier.None;\n\t\t\tif (keys.HasFlag(ModifierKeys.Alt)) key |= WpfModifier.Alt;\n\t\t\tif (keys.HasFlag(ModifierKeys.Control)) key |= WpfModifier.Control;\n\t\t\tif (keys.HasFlag(ModifierKeys.Shift)) key |= WpfModifier.Shift;\n\t\t\tif (keys.HasFlag(ModifierKeys.Windows)) key |= WpfModifier.Windows; //throw new NotImplementedException(\"Windows modifier key\"); // key |= EtoKey.Windows;\n\t\t\tif (keys.HasFlag(ModifierKeys.Command)) key |= WpfModifier.Windows; //throw new NotImplementedException(\"Command modifier key\"); // key |= EtoKey.Command;\n\t\t\tif (keys.HasFlag(ModifierKeys.Meta)) key |= WpfModifier.Control;\n\t\t\treturn key;\n\t\t}\n\n\t\tpublic static Optional<WpfKey> ToWpfKey(this Key key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase Key.Backspace: return WpfKey.Back;\n\n\t\t\t\tcase Key.Tab: return WpfKey.Tab;\n\t\t\t\tcase Key.Enter: return WpfKey.Enter;\n\n\t\t\t\tcase Key.LeftShift: return WpfKey.LeftShift;\n\t\t\t\tcase Key.RightShift: return WpfKey.RightShift;\n\t\t\t\tcase Key.LeftCtrl: return WpfKey.LeftCtrl;\n\t\t\t\tcase Key.RightCtrl: return WpfKey.RightCtrl;\n\t\t\t\tcase Key.LeftAlt: return WpfKey.LeftAlt;\n\t\t\t\tcase Key.RightAlt: return WpfKey.RightAlt;\n\n\t\t\t\tcase Key.CapsLock: return WpfKey.CapsLock;\n\t\t\t\tcase Key.Escape: return WpfKey.Escape;\n\t\t\t\tcase Key.Space: return WpfKey.Space;\n\t\t\t\tcase Key.PageUp: return WpfKey.PageUp;\n\t\t\t\tcase Key.PageDown: return WpfKey.PageDown;\n\t\t\t\tcase Key.End: return WpfKey.End;\n\t\t\t\tcase Key.Home: return WpfKey.Home;\n\n\t\t\t\tcase Key.Left: return WpfKey.Left;\n\t\t\t\tcase Key.Up: return WpfKey.Up;\n\t\t\t\tcase Key.Right: return WpfKey.Right;\n\t\t\t\tcase Key.Down: return WpfKey.Down;\n\n\t\t\t\tcase Key.Insert: return WpfKey.Insert;\n\t\t\t\tcase Key.Delete: return WpfKey.Delete;\n\n\t\t\t\tcase Key.Plus: return WpfKey.OemPlus;\n\t\t\t\tcase Key.Minus: return WpfKey.OemMinus;\n\n\t\t\t\tcase Key.Add: return WpfKey.Add;\n\t\t\t\tcase Key.Subtract: return WpfKey.Subtract;\n\t\t\t}\n\n\t\t\tif (Key.D0 <= key && key <= Key.D9)\n\t\t\t\treturn WpfKey.D0 + (key - Key.D0);\n\n\t\t\tif (Key.A <= key && key <= Key.Z)\n\t\t\t\treturn WpfKey.A + (key - Key.A);\n\n\t\t\tif (Key.NumPad0 <= key && key <= Key.NumPad9)\n\t\t\t\treturn Optional.None();\n\n\t\t\tif (Key.F1 <= key && key <= Key.F12)\n\t\t\t\treturn WpfKey.F1 + (key - Key.F1);\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tpublic static Key ToFusion(this WpfKey key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase WpfKey.Back: return Key.Backspace;\n\n\t\t\t\tcase WpfKey.Tab: return Key.Tab;\n\t\t\t\tcase WpfKey.Enter: return Key.Enter;\n\n\t\t\t\tcase WpfKey.LeftShift: return Key.LeftShift;\n\t\t\t\tcase WpfKey.RightShift: return Key.RightShift;\n\t\t\t\tcase WpfKey.LeftCtrl: return Key.LeftCtrl;\n\t\t\t\tcase WpfKey.RightCtrl: return Key.RightCtrl;\n\t\t\t\tcase WpfKey.LeftAlt: return Key.LeftAlt;\n\t\t\t\tcase WpfKey.RightAlt: return Key.RightAlt;\n\n\t\t\t\tcase WpfKey.CapsLock: return Key.CapsLock;\n\t\t\t\tcase WpfKey.Escape: return Key.Escape;\n\t\t\t\tcase WpfKey.Space: return Key.Space;\n\t\t\t\tcase WpfKey.PageUp: return Key.PageUp;\n\t\t\t\tcase WpfKey.PageDown: return Key.PageDown;\n\t\t\t\tcase WpfKey.End: return Key.End;\n\t\t\t\tcase WpfKey.Home: return Key.Home;\n\n\t\t\t\tcase WpfKey.Left: return Key.Left;\n\t\t\t\tcase WpfKey.Up: return Key.Up;\n\t\t\t\tcase WpfKey.Right: return Key.Right;\n\t\t\t\tcase WpfKey.Down: return Key.Down;\n\n\t\t\t\tcase WpfKey.Insert: return Key.Insert;\n\t\t\t\tcase WpfKey.Delete: return Key.Delete;\n\n\t\t\t\tcase WpfKey.OemPlus: return Key.Plus;\n\t\t\t\tcase WpfKey.OemMinus: return Key.Minus;\n\n\t\t\t\tcase WpfKey.Add: return Key.Add;\n\t\t\t\tcase WpfKey.Subtract: return Key.Subtract;\n\t\t\t}\n\n\t\t\tif (WpfKey.D0 <= key && key <= WpfKey.D9)\n\t\t\t\treturn Key.D0 + (key - WpfKey.D0);\n\n\t\t\tif (WpfKey.A <= key && key <= WpfKey.Z)\n\t\t\t\treturn Key.A + (key - WpfKey.A);\n\n\t\t\tif (WpfKey.NumPad0 <= key && key <= WpfKey.NumPad9)\n\t\t\t\treturn Key.D0 + (key - WpfKey.D0);\n\n\t\t\tif (WpfKey.F1 <= key && key <= WpfKey.F12)\n\t\t\t\treturn Key.F1 + (key - WpfKey.F1);\n\n\t\t\treturn Key.None;\n\t\t}\n\n\t\tstatic void AppendSeparator(StringBuilder sb, string separator, string value)\n\t\t{\n\t\t\tif (sb.Length > 0)\n\t\t\t\tsb.Append(separator);\n\t\t\tsb.Append(value);\n\t\t}\n\n\t\tstatic readonly Dictionary<WpfKey, string> keymap = new Dictionary<WpfKey, string> {\n\t\t\t{ WpfKey.D0, \"0\" },\n\t\t\t{ WpfKey.D1, \"1\" },\n\t\t\t{ WpfKey.D2, \"2\" },\n\t\t\t{ WpfKey.D3, \"3\" },\n\t\t\t{ WpfKey.D4, \"4\" },\n\t\t\t{ WpfKey.D5, \"5\" },\n\t\t\t{ WpfKey.D6, \"6\" },\n\t\t\t{ WpfKey.D7, \"7\" },\n\t\t\t{ WpfKey.D8, \"8\" },\n\t\t\t{ WpfKey.D9, \"9\" },\n\n\t\t\t{ WpfKey.Subtract, \"-\" },\n\t\t\t{ WpfKey.Add, \"+\" },\n\t\t\t{ WpfKey.OemPlus, \"+\" },\n\t\t\t{ WpfKey.OemMinus, \"-\" },\n\t\t\t{ WpfKey.Divide, \"/\" },\n\t\t\t{ WpfKey.OemPeriod, \".\" },\n\t\t\t{ WpfKey.OemBackslash, \"\\\\\" },\n\n\t\t\t{ WpfKey.OemSemicolon, \";\" }\n\t\t};\n\n\t\tpublic static string ToShortcutString(this WpfKey key, WpfModifier modifier, string separator = \"+\")\n\t\t{\n\t\t\tvar sb = new StringBuilder();\n\t\t\tif (modifier.HasFlag(WpfModifier.Control))\n\t\t\t\tAppendSeparator(sb, separator, \"Ctrl\");\n\t\t\tif (modifier.HasFlag(WpfModifier.Shift))\n\t\t\t\tAppendSeparator(sb, separator, \"Shift\");\n\t\t\tif (modifier.HasFlag(WpfModifier.Alt))\n\t\t\t\tAppendSeparator(sb, separator, \"Alt\");\n\n\t\t\tstring val;\n\t\t\tif (keymap.TryGetValue(key, out val))\n\t\t\t\tAppendSeparator(sb, separator, val);\n\t\t\telse\n\t\t\t\tAppendSeparator(sb, separator, key.ToString());\n\n\t\t\treturn sb.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Outracks.Fusion.Windows.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{55C9979B-C90E-426F-8C75-DCCE6F193D23}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fusion.Windows</RootNamespace>\n    <AssemblyName>Outracks.Fusion.Windows</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"ColorPicker, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\3rdparty\\ColorPicker.dll</HintPath>\n    </Reference>\n    <Reference Include=\"ColorPickerControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\3rdparty\\ColorPickerControls.dll</HintPath>\n    </Reference>\n    <Reference Include=\"ICSharpCode.AvalonEdit, Version=6.0.1.278, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\AvalonEdit.6.0.1\\lib\\net45\\ICSharpCode.AvalonEdit.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n      <EmbedInteropTypes>True</EmbedInteropTypes>\n    </Reference>\n    <Reference Include=\"Ookii.Dialogs.Wpf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=66aa232afad40158, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Ookii.Dialogs.Wpf.3.0.1\\lib\\net45\\Ookii.Dialogs.Wpf.dll</HintPath>\n    </Reference>\n    <Reference Include=\"OpenTK, Version=3.2.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\opentk\\OpenTK.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpDX.4.2.0\\lib\\net45\\SharpDX.dll</HintPath>\n    </Reference>\n    <Reference Include=\"SharpDX.Direct3D9, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpDX.Direct3D9.4.2.0\\lib\\net45\\SharpDX.Direct3D9.dll</HintPath>\n    </Reference>\n    <Reference Include=\"SharpDX.Mathematics, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpDX.Mathematics.4.2.0\\lib\\net45\\SharpDX.Mathematics.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Design\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Security\" />\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"UnoCore\">\n      <HintPath>..\\..\\simulator\\common\\bin\\UnoCore.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Application.cs\" />\n    <Compile Include=\"BalloonNotifier.cs\" />\n    <Compile Include=\"Controls\\CircleImplementation.cs\" />\n    <Compile Include=\"Controls\\LayoutTrackerImplementation.cs\" />\n    <Compile Include=\"Controls\\LogViewImplementation.cs\" />\n    <Compile Include=\"Controls\\ShapeControl.cs\" />\n    <Compile Include=\"Controls\\WindowFromControl.cs\" />\n    <Compile Include=\"CursorsImplementation.cs\" />\n    <Compile Include=\"ContextMenuImplementation.cs\" />\n    <Compile Include=\"DocumentAppHandler.cs\" />\n    <Compile Include=\"DataBinding.cs\" />\n    <Compile Include=\"DpiAwareForm.cs\" />\n    <Compile Include=\"DpiAwareness.cs\" />\n    <Compile Include=\"DpiAwareWindow.cs\" />\n    <Compile Include=\"KeyboardImplementation.cs\" />\n    <Compile Include=\"DraggingImplementation.cs\" />\n    <Compile Include=\"PermissionWin.cs\" />\n    <Compile Include=\"Resources\\NativeResources.cs\" />\n    <Compile Include=\"ScrollingImplementation.cs\" />\n    <Compile Include=\"Controls\\ColorPickerImplementation.cs\" />\n    <Compile Include=\"Dispatcher.cs\" />\n    <Compile Include=\"Controls\\SliderImplementation.cs\" />\n    <Compile Include=\"Controls\\DropDownImplementation.cs\" />\n    <Compile Include=\"EffectsImplementation.cs\" />\n    <Compile Include=\"Controls\\ButtonImplementation.cs\" />\n    <Compile Include=\"Controls\\ImageImplementation.cs\" />\n    <Compile Include=\"Controls\\LabelImplementation.cs\" />\n    <Compile Include=\"Controls\\LineImplementation.cs\" />\n    <Compile Include=\"Controls\\ClippingImplementation.cs\" />\n    <Compile Include=\"PointerImplementation.cs\" />\n    <Compile Include=\"OverlayForm.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n    <Compile Include=\"Controls\\RectangleImplementation.cs\" />\n    <Compile Include=\"Controls\\TextBoxImplementation.cs\" />\n    <Compile Include=\"CustomTitlebar.cs\" />\n    <Compile Include=\"Marshalling.cs\" />\n    <Compile Include=\"OverlayImplementation.cs\" />\n    <Compile Include=\"OverlayWindow.xaml.cs\">\n      <DependentUpon>OverlayWindow.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"FancyWindow.xaml.cs\">\n      <DependentUpon>FancyWindow.xaml</DependentUpon>\n    </Compile>\n    <Compile Include=\"Controls\\WebViewImplementation.cs\" />\n    <Compile Include=\"ShellWin.cs\" />\n    <Compile Include=\"ToolTipImplementation.cs\" />\n    <Compile Include=\"Transformation.cs\" />\n    <Compile Include=\"VerticalSynchronization.cs\" />\n    <Compile Include=\"WinApi.cs\" />\n    <Compile Include=\"WindowImplementation.cs\" />\n    <Compile Include=\"WindowPlacement.cs\" />\n    <Compile Include=\"WindowsTrayApplication.cs\" />\n    <Compile Include=\"WindowWithOverlays.cs\" />\n    <Compile Include=\"WinFormMenuBuilder.cs\" />\n    <Compile Include=\"WinFormMenuShortcutExtensions.cs\" />\n    <Compile Include=\"FileDialogs.cs\" />\n    <Compile Include=\"FilterString.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"WindowsMenuBuilder.cs\" />\n    <Compile Include=\"WinFormsMessageBox.cs\" />\n    <Compile Include=\"WpfCommand.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fuse\\locale\\Outracks.Fuse.Locale.csproj\">\n      <Project>{0e454646-b607-4fed-ab02-becbc5620fa3}</Project>\n      <Name>Outracks.Fuse.Locale</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Page Include=\"OverlayWindow.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"FancyWindow.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n    <Page Include=\"ScrollBar.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n      <SubType>Designer</SubType>\n    </Page>\n    <Page Include=\"StyleResources.xaml\">\n      <Generator>MSBuild:Compile</Generator>\n    </Page>\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Resources\\grab.cur\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Resources\\grabbing.cur\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Resource Include=\"Fuse.ico\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/fusion/win/Outracks.Fusion.Windows.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Controls/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=UnoHostControl/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/fusion/win/OverlayForm.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Forms;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class OverlayForm : Form\n\t{\n\t\tpublic OverlayForm()\n\t\t{\n\t\t\tWinApi.SetWindowLong(Handle, WinApi.GWL_STYLE, WinApi.WS_CLIPCHILDREN);\n\t\t\tWinApi.SetWindowLong(Handle, WinApi.GWL_EXSTYLE, 0);\n\t\t}\n\n\t\t/// <param name=\"m\">The Windows <see cref=\"T:System.Windows.Forms.Message\"/> to process. </param>\n\t\tprotected override void WndProc(ref Message m)\n\t\t{\n\t\t\tconst int WM_ERASEBKGND = 0x0014;\n\n\t\t\tswitch (m.Msg)\n\t\t\t{\n\t\t\t\tcase WM_ERASEBKGND:\n\t\t\t\t\tm.Result = new IntPtr(1);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tm.Result = WinApi.DefWindowProcW(m.HWnd, (uint)m.Msg, m.WParam, m.LParam);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Main thread\n\t\tpublic IDisposable BindTo(IntPtr unoHostHwnd, IntPtr controlHwnd, IControl control, IObservable<Ratio<Pixels, Points>> density)\n\t\t{\n\t\t\tvar element = control.NativeHandle as FrameworkElement;\n\t\t\tif (element == null)\n\t\t\t\tthrow new InvalidOperationException(\"Can't bind to an empty control\");\n\n\t\t\tvar frames = DataBinding\n\t\t\t\t.ObservableFromNativeEvent<object>(element, \"LayoutUpdated\")\n\t\t\t\t.StartWith(new object())\n\t\t\t\t.Select(_ =>\n\t\t\t\t{\n\t\t\t\t\tvar r = element.GetScreenRect();\n\n\t\t\t\t\treturn new ClipResult\n\t\t\t\t\t{\n\t\t\t\t\t\tBoundsInIntersection = r.Item1.RelativeTo(r.Item2.Position),\n\t\t\t\t\t\tIntersectionInParent = r.Item2\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tWinApi.SetWindowParent(unoHostHwnd, Handle);\n\t\t\tWinApi.SetWindowParent(Handle, controlHwnd);\n\t\t\tWinApi.ShowWindow(unoHostHwnd, WinApi.ShowWindowEnum.ShowNoActivate);\n\n\t\t\tvar flags = WinApi.SWP_NOZORDER | WinApi.SWP_NOACTIVATE;\n\n\t\t\treturn Disposable.Combine\n\t\t\t\t(\n\t\t\t\t\tDisposable.Create(() => Invoke(new Action(Hide))),\n\n\t\t\t\t\tframes.BufferPrevious().WithLatestFromBuffered(density, Tuple.Create).Subscribe(\n\t\t\t\t\t\t(f, d) => Fusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tWinApi.SetWindowPos(\n\t\t\t\t\t\t\t\tHandle,\n\t\t\t\t\t\t\t\tf.Current.IntersectionInParent.Position * d, // Bug in Window chrome, where position must be set once more, even though it has been set.\n\t\t\t\t\t\t\t\tf.ChangesTo(fr => fr.IntersectionInParent.Size * d),\n\t\t\t\t\t\t\t\tf.Current.IntersectionInParent.Size.HasZeroArea(),\n\t\t\t\t\t\t\t\tflags);\n\n\t\t\t\t\t\t\tWinApi.SetWindowPos(\n\t\t\t\t\t\t\t\tunoHostHwnd,\n\t\t\t\t\t\t\t\tf.ChangesTo(fr => fr.BoundsInIntersection.Position * d),\n\t\t\t\t\t\t\t\tf.ChangesTo(fr => fr.BoundsInIntersection.Size * d),\n\t\t\t\t\t\t\t\tf.Current.BoundsInIntersection.Size.HasZeroArea(),\n\t\t\t\t\t\t\t\tflags | WinApi.SWP_ASYNCWINDOWPOS);\n\t\t\t\t\t\t}))\n\t\t\t);\n\t\t}\n\n\n\t}\n\n\tclass ClipResult\n\t{\n\t\tpublic Rectangle<Points> IntersectionInParent { get; set; }\n\t\tpublic Rectangle<Points> BoundsInIntersection { get; set; }\n\t}\n\n\tstatic class ClipToExtension\n\t{\n\t\tpublic static IObservable<Tuple<Rectangle<Points>, Rectangle<Points>>> ScreenRect(this FrameworkElement self, Dispatcher dispatcher)\n\t\t{\n\t\t\treturn DataBinding\n\t\t\t\t.ObservableFromNativeEvent<EventArgs>(self, \"LayoutUpdated\")\n\t\t\t\t.Select(_ => Unit.Default)\n\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t.SubscribeOn(self.Dispatcher)\n\t\t\t\t.Select(_ => dispatcher.InvokeAsync(() => self.GetScreenRect2()))\n\t\t\t\t.Switch();\n\n\t\t\t//.ObserveOn(self.Dispatcher);\n\t\t}\n\t\tpublic static Tuple<Rectangle<Points>, Rectangle<Points>> GetScreenRect(this FrameworkElement self)\n\t\t{\n\t\t\t// TODO: this can throw NRE\n\t\t\tvar hwndSource = PresentationSource.FromVisual(self);\n\t\t\tif (hwndSource == null)\n\t\t\t\treturn Tuple.Create(Rectangle.FromPositionSize<Points>(0, 0, 0, 0), Rectangle.FromPositionSize<Points>(0, 0, 0, 0));\n\n\t\t\tvar rootVisual = hwndSource.RootVisual;\n\t\t\tvar selfToRoot = self.TransformToAncestor(rootVisual);\n\n\t\t\tvar unclippedRect = new Rect(\n\t\t\t\tselfToRoot.Transform(new System.Windows.Point(0, 0)),\n\t\t\t\tselfToRoot.Transform(new System.Windows.Point(self.ActualWidth, self.ActualHeight)));\n\n\t\t\tvar clippedRect = unclippedRect;\n\n\t\t\tvar parent = VisualTreeHelper.GetParent(self);\n\n\t\t\twhile (parent != null)\n\t\t\t{\n\t\t\t\tvar visual = parent as Visual;\n\t\t\t\tvar control = parent as Canvas;\n\t\t\t\tvar scrollView = parent as ScrollViewer;\n\n\t\t\t\tvar availableSize = Optional.None<System.Windows.Point>();\n\t\t\t\tif (control != null && control.ClipToBounds)\n\t\t\t\t\tavailableSize = new System.Windows.Point(control.ActualWidth, control.ActualHeight);\n\t\t\t\telse if (scrollView != null && scrollView.ClipToBounds)\n\t\t\t\t\tavailableSize = new System.Windows.Point(\n\t\t\t\t\t\tscrollView.ViewportWidth\n\t\t\t\t\t\t\t- (scrollView.ComputedVerticalScrollBarVisibility == Visibility.Visible ? 15 : 0),\n\t\t\t\t\t\tscrollView.ViewportHeight\n\t\t\t\t\t\t\t- (scrollView.ComputedHorizontalScrollBarVisibility == Visibility.Visible ? 15 : 0));\n\n\t\t\t\tif (visual != null && availableSize.HasValue)\n\t\t\t\t{\n\t\t\t\t\tvar visualToRoot = visual.TransformToAncestor(rootVisual);\n\n\t\t\t\t\tvar pointAncestorTopLeft = visualToRoot.Transform(new System.Windows.Point(0, 0));\n\t\t\t\t\tvar pointAncestorBottomRight = visualToRoot.Transform(availableSize.Value);\n\t\t\t\t\tvar ancestorRect = new Rect(pointAncestorTopLeft, pointAncestorBottomRight);\n\n\t\t\t\t\tclippedRect.Intersect(ancestorRect);\n\t\t\t\t}\n\n\t\t\t\tparent = VisualTreeHelper.GetParent(parent);\n\t\t\t}\n\n\t\t\treturn Tuple.Create(\n\t\t\t\tRectangle.FromSides<Points>(unclippedRect.Left, unclippedRect.Top, unclippedRect.Right, unclippedRect.Bottom),\n\t\t\t\tRectangle.FromSides<Points>(clippedRect.Left, clippedRect.Top, clippedRect.Right, clippedRect.Bottom));\n\n\t\t}\n\n\t\tpublic static Tuple<Rectangle<Points>, Rectangle<Points>> GetScreenRect2(this FrameworkElement self)\n\t\t{\n\t\t\t// TODO: this can throw NRE\n\t\t\tvar hwndSource = PresentationSource.FromVisual(self);\n\t\t\tif (hwndSource == null)\n\t\t\t\treturn Tuple.Create(Rectangle.FromSides<Points>(0, 0, 0, 0), Rectangle.FromSides<Points>(0, 0, 0, 0));\n\n\t\t\tvar rootVisual = hwndSource.RootVisual;\n\t\t\tvar selfToRoot = self.TransformToAncestor(rootVisual);\n\n\t\t\tvar unclippedRect = new Rect(\n\t\t\t\tselfToRoot.Transform(new System.Windows.Point(0, 0)),\n\t\t\t\tselfToRoot.Transform(new System.Windows.Point(self.ActualWidth, self.ActualHeight)));\n\n\t\t\tvar clippedRect = new Rect(0, 0, double.PositiveInfinity, double.PositiveInfinity);\n\n\t\t\tvar parent = VisualTreeHelper.GetParent(self);\n\n\t\t\twhile (parent != null)\n\t\t\t{\n\t\t\t\tvar visual = parent as Visual;\n\t\t\t\tvar control = parent as Canvas;\n\t\t\t\tvar scrollView = parent as ScrollViewer;\n\n\t\t\t\tvar availableSize = Optional.None<System.Windows.Point>();\n\t\t\t\tif (control != null && control.ClipToBounds)\n\t\t\t\t\tavailableSize = new System.Windows.Point(control.ActualWidth, control.ActualHeight);\n\t\t\t\telse if (scrollView != null && scrollView.ClipToBounds)\n\t\t\t\t\tavailableSize = new System.Windows.Point(scrollView.ViewportWidth, scrollView.ViewportHeight);\n\n\t\t\t\tif (visual != null && availableSize.HasValue)\n\t\t\t\t{\n\t\t\t\t\tvar visualToRoot = visual.TransformToAncestor(rootVisual);\n\n\t\t\t\t\tvar pointAncestorTopLeft = visualToRoot.Transform(new System.Windows.Point(0, 0));\n\t\t\t\t\tvar pointAncestorBottomRight = visualToRoot.Transform(availableSize.Value);\n\t\t\t\t\tvar ancestorRect = new Rect(pointAncestorTopLeft, pointAncestorBottomRight);\n\n\t\t\t\t\tclippedRect.Intersect(ancestorRect);\n\t\t\t\t}\n\n\t\t\t\tparent = VisualTreeHelper.GetParent(parent);\n\t\t\t}\n\n\t\t\treturn Tuple.Create(\n\t\t\t\tRectangle.FromSides<Points>(unclippedRect.Left, unclippedRect.Top, unclippedRect.Right, unclippedRect.Bottom),\n\t\t\t\tRectangle.FromSides<Points>(clippedRect.Left, clippedRect.Top, clippedRect.Right, clippedRect.Bottom));\n\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/OverlayImplementation.cs",
    "content": "using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class OverlayImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tOverlay.Initialize((background, foreground) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar canvas = (FrameworkElement)foreground.NativeHandle;\n\n\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (canvas.Parent != null)\n\t\t\t\t\t\t\t((Canvas) canvas.Parent).Children.Remove(canvas);\n\t\t\t\t\t});\n\n\t\t\t\t\tvar foregroundWindow = new OverlayWindow\n\t\t\t\t\t{\n\t\t\t\t\t\tContent = new Canvas\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tChildren = { canvas }\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tvar backgroundElement = background.NativeHandle as FrameworkElement;\n\t\t\t\t\tif (backgroundElement != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tbackground.Mount(self);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar dummy = Shapes.Rectangle();\n\t\t\t\t\t\tdummy.Mount(self);\n\t\t\t\t\t\tbackgroundElement = (FrameworkElement)dummy.NativeHandle;\n\t\t\t\t\t}\n\n\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tforegroundWindow.KeyDown += (sender, args) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar visual = PresentationSource.FromVisual(backgroundElement);\n\t\t\t\t\t\t\tif (visual == null)\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\tif (args.Key == System.Windows.Input.Key.DeadCharProcessed)\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\tbackgroundElement.RaiseEvent(new KeyEventArgs(System.Windows.Input.Keyboard.PrimaryDevice, visual, 0, args.Key)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tRoutedEvent = System.Windows.Input.Keyboard.PreviewKeyDownEvent,\n\t\t\t\t\t\t\t\tSource = backgroundElement,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tforegroundWindow.KeyUp += (sender, args) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar visual = PresentationSource.FromVisual(backgroundElement);\n\t\t\t\t\t\t\tif (visual == null)\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\tif (args.Key == System.Windows.Input.Key.DeadCharProcessed)\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\tbackgroundElement.RaiseEvent(new KeyEventArgs(System.Windows.Input.Keyboard.PrimaryDevice, visual, 0, args.Key)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tRoutedEvent = System.Windows.Input.Keyboard.PreviewKeyUpEvent,\n\t\t\t\t\t\t\t\tSource = backgroundElement,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\n\t\t\t\t\tvar windowFrames = backgroundElement.ScreenRect(dispatcher);\n\t\t\t\t\tvar intersection = windowFrames.Select(f => f.Item2);\n\t\t\t\t\tvar frame = windowFrames.Select(f => f.Item1);\n\t\t\t\t\tvar bounds = frame.RelativeTo(intersection.Position()).Replay(1).RefCount();\n\n\t\t\t\t\tforeground.Mount(\n\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIsRooted = self.IsRooted,\n\t\t\t\t\t\t\tAvailableSize = self.AvailableSize,\n\t\t\t\t\t\t\tNativeFrame = bounds.Transpose(),\n\t\t\t\t\t\t});\n\n\t\t\t\t\tvar parentWindow =\n\t\t\t\t\t\tself.IsRooted.Switch(isRooted =>\n\t\t\t\t\t\t\tisRooted == false\n\t\t\t\t\t\t\t\t? Observable.Return(Optional.None<WindowWithOverlays>())\n\t\t\t\t\t\t\t\t: backgroundElement.GetWindow<WindowWithOverlays>());\n\n\t\t\t\t\tparentWindow.SubscribeUsing(tmp =>\n\t\t\t\t\t\t\ttmp.MatchWith(\n\t\t\t\t\t\t\t\tnone: () => Disposable.Empty,\n\t\t\t\t\t\t\t\tsome: backgroundWindow =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar windowLocation = DataBinding.ObservableFromNativeEvent<object>(backgroundWindow, \"LocationChanged\")\n\t\t\t\t\t\t\t\t\t\t.StartWith(new object())\n\t\t\t\t\t\t\t\t\t\t.Select(_ => dispatcher.InvokeAsync(() => new Point<Points>(backgroundWindow.Left, backgroundWindow.Top)))\n\t\t\t\t\t\t\t\t\t\t.Switch();\n\n\t\t\t\t\t\t\t\t\tdispatcher.Schedule(() =>\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforegroundWindow.ShowActivated = false;\n\t\t\t\t\t\t\t\t\t\tforegroundWindow.Show();\n\t\t\t\t\t\t\t\t\t\tforegroundWindow.Owner = backgroundWindow;\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\treturn Disposable.Combine(\n\t\t\t\t\t\t\t\t\t\tbackgroundWindow.AddOverlay(\"name\", foregroundWindow),\n\n\t\t\t\t\t\t\t\t\t\tDisposable.Create(() => dispatcher.Schedule(foregroundWindow.Hide)),\n\n\t\t\t\t\t\t\t\t\t\tintersection.MoveTo(windowLocation)/*.Sample(Fusion.Application.PerFrame)*/\n\t\t\t\t\t\t\t\t\t\t\t.Subscribe(s => dispatcher.Schedule(() =>\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (!double.IsInfinity(s.Left()))\n\t\t\t\t\t\t\t\t\t\t\t\t\tforegroundWindow.Left = s.Left();\n\t\t\t\t\t\t\t\t\t\t\t\tif (!double.IsInfinity(s.Top()))\n\t\t\t\t\t\t\t\t\t\t\t\t\tforegroundWindow.Top = s.Top();\n\t\t\t\t\t\t\t\t\t\t\t\tif (!double.IsInfinity(s.Width))\n\t\t\t\t\t\t\t\t\t\t\t\t\tforegroundWindow.Width = s.Width.Max(0);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!double.IsInfinity(s.Height))\n\t\t\t\t\t\t\t\t\t\t\t\t\tforegroundWindow.Height = s.Height.Max(0);\n\t\t\t\t\t\t\t\t\t\t\t})));\n\t\t\t\t\t\t\t\t}));\n\n\t\t\t\t\treturn backgroundElement;\n\t\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/OverlayWindow.xaml",
    "content": "﻿<windows:WindowWithOverlays x:Class=\"Outracks.Fusion.Windows.OverlayWindow\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:windows=\"clr-namespace:Outracks.Fusion.Windows\"\n    Background = \"Transparent\"\n\tWindowStyle = \"None\"\n\tAllowsTransparency = \"True\"\n\tShowInTaskbar =\"False\">\n\n\t<windows:WindowWithOverlays.Resources>\n\t\t<ResourceDictionary>\n\t\t\t<ResourceDictionary.MergedDictionaries>\n\t\t\t\t<ResourceDictionary Source=\"StyleResources.xaml\"></ResourceDictionary>\n\t\t\t</ResourceDictionary.MergedDictionaries>\n\t\t</ResourceDictionary>\n\t</windows:WindowWithOverlays.Resources>\n\n</windows:WindowWithOverlays>\n"
  },
  {
    "path": "src/fusion/win/OverlayWindow.xaml.cs",
    "content": "﻿namespace Outracks.Fusion.Windows\n{\n\tpartial class OverlayWindow : WindowWithOverlays\n\t{\n\t\tpublic OverlayWindow()\n\t\t{\n\t\t\tInitializeComponent();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/PermissionWin.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\n\nnamespace Outracks.IO\n{\n\tpublic class PermissionWin : IFilePermission\n\t{\n\t\tpublic void SetPermission(AbsoluteFilePath file, FileSystemPermission permission, FileSystemGroup group)\n\t\t{\n\t\t\tvar identity = GetIdentity(group);\n\n\t\t\tvar fileSecurity = new FileSecurity();\n\t\t\tfileSecurity.SetAccessRule(new FileSystemAccessRule(\n\t\t\t\t\t\tidentity,\n\t\t\t\t\t\tCreateSystemRightsFile(permission),\n\t\t\t\t\t\tAccessControlType.Allow));\n\n\t\t\tFile.SetAccessControl(file.NativePath, fileSecurity);\n\t\t}\n\n\t\tstatic IdentityReference GetIdentity(FileSystemGroup group)\n\t\t{\n\t\t\tIdentityReference identity;\n\t\t\tif (group.HasFlag(FileSystemGroup.Everyone))\n\t\t\t\tidentity = new SecurityIdentifier(WellKnownSidType.WorldSid, null);\n\t\t\telse if (group.HasFlag(FileSystemGroup.User))\n\t\t\t\tidentity = WindowsIdentity.GetCurrent().User;\n\t\t\telse\n\t\t\t\tthrow new NotImplementedException(\"Be free to implement it.\");\n\t\t\treturn identity;\n\t\t}\n\n\t\tFileSystemRights CreateSystemRightsFile(FileSystemPermission permission)\n\t\t{\n\t\t\tvar fileSystemRights = FileSystemRights.Synchronize;\n\n\t\t\tif (permission.HasFlag(FileSystemPermission.Read))\n\t\t\t\tfileSystemRights |= FileSystemRights.Read;\n\n\t\t\tif (permission.HasFlag(FileSystemPermission.Write))\n\t\t\t{\n\t\t\t\tfileSystemRights |= FileSystemRights.Write;\n\t\t\t}\n\n\t\t\tif (permission.HasFlag(FileSystemPermission.Execute))\n\t\t\t{\n\t\t\t\tfileSystemRights |= FileSystemRights.ExecuteFile;\n\t\t\t}\n\n\t\t\treturn fileSystemRights;\n\t\t}\n\n\t\tpublic void SetPermission(\n\t\t\tAbsoluteDirectoryPath dir,\n\t\t\tFileSystemPermission permission,\n\t\t\tFileSystemGroup group,\n\t\t\tbool recursive)\n\t\t{\n\t\t\tvar dInfo = new DirectoryInfo(dir.NativePath);\n\t\t\tvar dSec = new DirectorySecurity();\n\t\t\tdSec.AddAccessRule(new FileSystemAccessRule(\n\t\t\t\t\t\tGetIdentity(group),\n\t\t\t\t\t\tCreateSystemRightsFile(permission),\n\t\t\t\t\t\tAccessControlType.Allow));\n\t\t\tdInfo.SetAccessControl(dSec);\n\n\t\t\tif(recursive)\n\t\t\t\tReplaceAllDescendantPermissionsFromObject(dInfo, dSec, permission, group);\n\t\t}\n\n\t\tvoid ReplaceAllDescendantPermissionsFromObject(\n\t\t\tDirectoryInfo dInfo,\n\t\t\tDirectorySecurity dSecurity,\n\t\t\tFileSystemPermission fileSystemPermission,\n\t\t\tFileSystemGroup group)\n\t\t{\n\t\t\tdInfo.SetAccessControl(dSecurity);\n\n\t\t\tforeach (FileInfo fi in dInfo.GetFiles())\n\t\t\t{\n\t\t\t\tSetPermission(AbsoluteFilePath.Parse(fi.FullName), fileSystemPermission, group);\n\t\t\t}\n\n\t\t\tdInfo.GetDirectories().ToList()\n\t\t\t\t.ForEach(d => ReplaceAllDescendantPermissionsFromObject(d, dSecurity, fileSystemPermission, group));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/PointerImplementation.cs",
    "content": "using System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class PointerImplementation\n\t{\n\t\tstatic Dispatcher _dispatcher;\n\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\t_dispatcher = dispatcher;\n\n\t\t\tPointer.Implementation.MakeHittable = MakeHittable;\n\t\t}\n\n\t\tstatic IControl MakeHittable(IControl control, Space space, Pointer.Callbacks callbacks)\n\t\t{\n\t\t\treturn Control.Create(location =>\n\t\t\t{\n\t\t\t\tvar view = new Canvas()\n\t\t\t\t{\n\t\t\t\t\tBackground = Brushes.Transparent,\n\t\t\t\t};\n\n\t\t\t\tview.MouseDown += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tview.CaptureMouse();\n\t\t\t\t\tcallbacks.OnPressed(new Pointer.OnPressedArgs(ToPoint(a, view, space), a.ClickCount));\n\t\t\t\t\ta.Handled = true;\n\t\t\t\t};\n\n\t\t\t\tview.MouseUp += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tcallbacks.OnReleased();\n\t\t\t\t\ta.Handled = true;\n\t\t\t\t\tview.ReleaseMouseCapture();\n\n\t\t\t\t\tif (a.ChangedButton == MouseButton.Right)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (view.ContextMenu == null) return;\n\t\t\t\t\t\tview.ContextMenu.IsOpen = true;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tview.MouseMove += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tcallbacks.OnMoved(ToPoint(a, view, space));\n\t\t\t\t\ta.Handled = true;\n\n\t\t\t\t\tif (view.IsMouseCaptured && a.LeftButton == MouseButtonState.Pressed)\n\t\t\t\t\t{\n\t\t\t\t\t\tcallbacks.OnDragged().Do(data =>\n\t\t\t\t\t\t\tDragDrop.DoDragDrop(view, new DraggingImplementation.DragData(data), DragDropEffects.All));\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tview.MouseEnter += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tcallbacks.OnEntered(ToPoint(a, view, space));\n\t\t\t\t\ta.Handled = true;\n\t\t\t\t};\n\n\t\t\t\tview.MouseLeave += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tcallbacks.OnExited(ToPoint(a, view, space));\n\t\t\t\t\ta.Handled = true;\n\t\t\t\t};\n\n\t\t\t\tview.GotMouseCapture += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tcallbacks.OnGotFocus();\n\t\t\t\t\ta.Handled = true;\n\t\t\t\t};\n\n\t\t\t\tview.LostMouseCapture += (s, a) =>\n\t\t\t\t{\n\t\t\t\t\tcallbacks.OnLostFocus();\n\t\t\t\t\ta.Handled = true;\n\t\t\t\t};\n\n\t\t\t\tlocation.BindNativeDefaults(view, _dispatcher);\n\n\t\t\t\tcontrol.Mount(\n\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t{\n\t\t\t\t\t\tAvailableSize = location.AvailableSize,\n\t\t\t\t\t\tIsRooted = location.IsRooted,\n\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(location.NativeFrame.Size),\n\t\t\t\t\t});\n\n\t\t\t\tvar contentHandle = control.NativeHandle as FrameworkElement;\n\t\t\t\tif (contentHandle != null)\n\t\t\t\t\t_dispatcher.Enqueue(() => view.Children.Add(contentHandle));\n\n\t\t\t\treturn view;\n\t\t\t}).WithSize(control.DesiredSize);\n\t\t}\n\n\t\tpublic static Point<Points> ToPoint(MouseEventArgs args, IInputElement element, Space space)\n\t\t{\n\t\t\tvar p = space == Space.Local ? args.GetPosition(element) : args.GetPosition(null);\n\t\t\treturn p.ToFusion();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Windows.Media;\n\n[assembly: AssemblyTitle(\"Outracks.Fuse.Native-Windows\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: DisableDpiAwareness]\n"
  },
  {
    "path": "src/fusion/win/Resources/NativeResources.cs",
    "content": "using System.IO;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class NativeResources\n\t{\n\t\tpublic static Stream GetGrabCursor()\n\t\t{\n\t\t\tvar assembly = typeof(NativeResources).Assembly;\n\t\t\treturn assembly.GetManifestResourceStream(\"Outracks.Fusion.Windows.Resources.grab.cur\");\n\t\t}\n\n\t\tpublic static Stream GetGrabbingCursor()\n\t\t{\n\t\t\tvar assembly = typeof(NativeResources).Assembly;\n\t\t\treturn assembly.GetManifestResourceStream(\"Outracks.Fusion.Windows.Resources.grabbing.cur\");\n\t\t}\n\n\t\tpublic static System.Windows.Forms.Cursor GrabCursor { get; private set; }\n\t\tpublic static System.Windows.Forms.Cursor GrabbingCursor { get; private set; }\n\n\t\tpublic static void Load()\n\t\t{\n\t\t\tusing (var stream = GetGrabCursor())\n\t\t\t\tGrabCursor = new System.Windows.Forms.Cursor(stream);\n\n\t\t\tusing (var stream = GetGrabbingCursor())\n\t\t\t\tGrabbingCursor = new System.Windows.Forms.Cursor(stream);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/ScrollBar.xaml",
    "content": "﻿<ResourceDictionary\n\txmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" \n\txmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:Microsoft_Windows_Themes=\"clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna\">\n    <!-- Resource dictionary entries should be defined here. -->\n\n\t<SolidColorBrush x:Key=\"StandardBorderBrush\" Color=\"Gray\" Opacity=\"0.4\"></SolidColorBrush>\n\t<SolidColorBrush x:Key=\"StandardBrush\" Color=\"Gray\" Opacity=\"0.4\"></SolidColorBrush>\n\t<SolidColorBrush x:Key=\"PressedBrush\" Color=\"Gray\"></SolidColorBrush>\n\t<SolidColorBrush x:Key=\"HoverBrush\" Color=\"Gray\" Opacity=\"0.8\"></SolidColorBrush>\n\t<SolidColorBrush x:Key=\"GlyphBrush\" Color=\"Gray\" Opacity=\"0.4\"></SolidColorBrush>\n\t<SolidColorBrush x:Key=\"BackgroundBrush\" Color=\"Transparent\"></SolidColorBrush>\n\n    <Style x:Key=\"VerticalScrollBarThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"IsTabStop\" Value=\"False\"/>\n        <Setter Property=\"Focusable\" Value=\"False\"/>\n        <Setter Property=\"Margin\" Value=\"1,0,1,0\" />\n        <Setter Property=\"BorderBrush\" Value=\"{StaticResource StandardBorderBrush}\" />\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Rectangle Width=\"9\" Name=\"ellipse\" StrokeThickness=\"0\" Stroke=\"{StaticResource StandardBorderBrush}\"\n\t\t\t\t\t\tFill=\"{StaticResource StandardBrush}\"\n\t\t\t\t\t\t\t   RadiusX=\"1\" RadiusY=\"1\"></Rectangle>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter TargetName=\"ellipse\" Property=\"Fill\" Value=\"{StaticResource HoverBrush}\"></Setter>\n                        </Trigger>\n                        <Trigger Property=\"IsDragging\" Value=\"True\">\n                            <Setter TargetName=\"ellipse\" Property=\"Fill\" Value=\"{StaticResource PressedBrush}\"></Setter>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"HorizontalScrollBarThumbStyle\" TargetType=\"{x:Type Thumb}\">\n        <Setter Property=\"IsTabStop\" Value=\"False\"/>\n        <Setter Property=\"Focusable\" Value=\"False\"/>\n        <Setter Property=\"Margin\" Value=\"0,1,0,1\" />\n        <Setter Property=\"BorderBrush\" Value=\"{StaticResource StandardBorderBrush}\" />\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Thumb}\">\n                    <Rectangle Height=\"9\" Name=\"ellipse\" StrokeThickness=\"0\" Stroke=\"{StaticResource StandardBorderBrush}\"\n\t\t\t\t\t\tFill=\"{StaticResource StandardBrush}\"\n\t\t\t\t\t\t\t   RadiusX=\"1\" RadiusY=\"1\"></Rectangle>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter TargetName=\"ellipse\" Property=\"Fill\" Value=\"{StaticResource HoverBrush}\"></Setter>\n                        </Trigger>\n                        <Trigger Property=\"IsDragging\" Value=\"True\">\n                            <Setter TargetName=\"ellipse\" Property=\"Fill\" Value=\"{StaticResource PressedBrush}\"></Setter>\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"LineButtonUpStyle\" TargetType=\"{x:Type RepeatButton}\">\n        <Setter Property=\"Focusable\" Value=\"False\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n                    <Grid Margin=\"1\" Height=\"15\" >\n                        <Rectangle Fill=\"Transparent\" />\n                        <Path Stretch=\"None\" HorizontalAlignment=\"Center\"\n\t\t\t\t\t\t\t  VerticalAlignment=\"Center\" Name=\"Path\"  Fill=\"{StaticResource StandardBrush}\"\n\t\t\t\t\t\t\t\t\tData=\"M 0 7 L 9 7 L 4.5 -1 Z\"></Path>\n                    </Grid>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource HoverBrush}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsPressed\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource PressedBrush}\" />\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"LineButtonDownStyle\" TargetType=\"{x:Type RepeatButton}\">\n        <Setter Property=\"Focusable\" Value=\"False\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n                    <Grid Margin=\"1\" Height=\"15\">\n                        <Rectangle Fill=\"Transparent\" />\n                        <Path Stretch=\"None\" HorizontalAlignment=\"Center\"\n\t\t\t\t\t\t\t  VerticalAlignment=\"Center\" Name=\"Path\"  Fill=\"{StaticResource StandardBrush}\"\n\t\t\t\t\t\t\t\t\tData=\"M 0 0 L 4.5 9 L 9 0 Z\"></Path>\n                    </Grid>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource HoverBrush}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsPressed\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource PressedBrush}\" />\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"LineButtonLeftStyle\" TargetType=\"{x:Type RepeatButton}\">\n        <Setter Property=\"Focusable\" Value=\"False\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n                    <Grid Margin=\"1\" Width=\"15\" >\n                        <Rectangle Fill=\"Transparent\" />\n                        <Path Stretch=\"None\" HorizontalAlignment=\"Center\"\n\t\t\t\t\t\t\t  VerticalAlignment=\"Center\" Name=\"Path\"  Fill=\"{StaticResource StandardBrush}\"\n\t\t\t\t\t\t\t\t\tData=\"M 5 0 L -3 4.5 L 5 9 Z\"></Path>\n                    </Grid>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource HoverBrush}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsPressed\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource PressedBrush}\" />\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"LineButtonRightStyle\" TargetType=\"{x:Type RepeatButton}\">\n        <Setter Property=\"Focusable\" Value=\"False\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n                    <Grid IsHitTestVisible=\"True\" Margin=\"1\" Width=\"15\" >\n                        <Rectangle Fill=\"Transparent\" />\n                        <Path Stretch=\"None\" HorizontalAlignment=\"Center\"\n\t\t\t\t\t\t\t  VerticalAlignment=\"Center\" Name=\"Path\"  Fill=\"{StaticResource StandardBrush}\"\n\t\t\t\t\t\t\t\t\tData=\"M 0 0 L 9 4.5 L 0 9 Z\"></Path>\n                    </Grid>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource HoverBrush}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsPressed\" Value=\"true\">\n                            <Setter TargetName=\"Path\" Property=\"Fill\"\n\t\t\t\t\t\t\t\t\tValue=\"{StaticResource PressedBrush}\" />\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <Style x:Key=\"ScrollBarPageButtonStyle\" TargetType=\"{x:Type RepeatButton}\">\n        <Setter Property=\"IsTabStop\" Value=\"False\"/>\n        <Setter Property=\"Focusable\" Value=\"False\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n                    <Border Background=\"Transparent\" />\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n    <ControlTemplate x:Key=\"VerticalScrollBar\" TargetType=\"{x:Type ScrollBar}\">\n\t\t<Grid Background=\"{StaticResource BackgroundBrush}\">\n\t\t\t<Grid.RowDefinitions>\n\t\t\t\t<RowDefinition MaxHeight=\"15\"/>\n\t\t\t\t<RowDefinition Height=\"*\"/>\n\t\t\t\t<RowDefinition MaxHeight=\"15\"/>\n\t\t\t</Grid.RowDefinitions>\n\t\t\t<RepeatButton Grid.Row=\"0\" Height=\"15\"\n\t\t\t\tStyle=\"{StaticResource LineButtonUpStyle}\"\n\t\t\t\tCommand=\"ScrollBar.LineUpCommand\" >\n\n            </RepeatButton>\n\n            <Track Name=\"PART_Track\" Grid.Row=\"1\" IsDirectionReversed=\"True\" >\n                <Track.DecreaseRepeatButton>\n                    <RepeatButton Command=\"ScrollBar.PageUpCommand\"\n\t\t\t\t\t\tStyle=\"{StaticResource ScrollBarPageButtonStyle}\">\n                    </RepeatButton>\n                </Track.DecreaseRepeatButton>\n                <Track.Thumb>\n                    <Thumb Style=\"{StaticResource VerticalScrollBarThumbStyle}\">\n                    </Thumb>\n                </Track.Thumb>\n                <Track.IncreaseRepeatButton>\n                    <RepeatButton Command=\"ScrollBar.PageDownCommand\"\n\t\t\t\t\t\tStyle=\"{StaticResource ScrollBarPageButtonStyle}\">\n                    </RepeatButton>\n                </Track.IncreaseRepeatButton>\n            </Track>\n\n            <RepeatButton Grid.Row=\"2\" Height=\"15\"\n\t\t\t\tStyle=\"{StaticResource LineButtonDownStyle}\"\n\t\t\t\tCommand=\"ScrollBar.LineDownCommand\">\n            </RepeatButton>\n        </Grid>\n    </ControlTemplate>\n    <ControlTemplate x:Key=\"HorizontalScrollBar\" TargetType=\"{x:Type ScrollBar}\">\n\t\t<Grid Background=\"{StaticResource BackgroundBrush}\">\n\t\t\t<Grid.ColumnDefinitions>\n\t\t\t\t<ColumnDefinition MaxWidth=\" 15\"></ColumnDefinition>\n\t\t\t\t<ColumnDefinition Width=\"*\"></ColumnDefinition>\n\t\t\t\t<ColumnDefinition MaxWidth=\" 15\"></ColumnDefinition>\n\t\t\t</Grid.ColumnDefinitions>\n\t\t\t<RepeatButton Grid.Column=\"0\" Width=\"15\"\n\t\t\t\tStyle=\"{StaticResource LineButtonLeftStyle}\"\n\t\t\t\tCommand=\"ScrollBar.LineLeftCommand\" >\n            </RepeatButton>\n\n            <Track Name=\"PART_Track\" Grid.Column=\"1\" IsDirectionReversed=\"False\" >\n                <Track.DecreaseRepeatButton>\n                    <RepeatButton Command=\"ScrollBar.PageLeftCommand\"\n\t\t\t\t\t\tStyle=\"{StaticResource ScrollBarPageButtonStyle}\">\n                    </RepeatButton>\n                </Track.DecreaseRepeatButton>\n                <Track.Thumb>\n                    <Thumb Style=\"{StaticResource HorizontalScrollBarThumbStyle}\">\n                    </Thumb>\n                </Track.Thumb>\n                <Track.IncreaseRepeatButton>\n                    <RepeatButton Command=\"ScrollBar.PageRightCommand\"\n\t\t\t\t\t\tStyle=\"{StaticResource ScrollBarPageButtonStyle}\">\n                    </RepeatButton>\n                </Track.IncreaseRepeatButton>\n            </Track>\n            <RepeatButton Grid.Column=\"2\" Width=\"15\"\n\t\t\t\tStyle=\"{StaticResource LineButtonRightStyle}\"\n\t\t\t\tCommand=\"ScrollBar.LineRightCommand\">\n            </RepeatButton>\n        </Grid>\n    </ControlTemplate>\n    <Style TargetType=\"{x:Type ScrollBar}\">\n        <Setter Property=\"SnapsToDevicePixels\" Value=\"True\"/>\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n        <Style.Triggers>\n            <Trigger Property=\"Orientation\" Value=\"Vertical\">\n                <Setter Property=\"Width\" Value=\"15\"/>\n                <Setter Property=\"Height\" Value=\"Auto\" />\n                <Setter Property=\"Template\" Value=\"{StaticResource VerticalScrollBar}\" />\n            </Trigger>\n            <Trigger Property=\"Orientation\" Value=\"Horizontal\">\n                <Setter Property=\"Width\" Value=\"Auto\"/>\n                <Setter Property=\"Height\" Value=\"15\" />\n                <Setter Property=\"Template\" Value=\"{StaticResource HorizontalScrollBar}\" />\n            </Trigger>\n        </Style.Triggers>\n    </Style>\n    <Style TargetType=\"{x:Type ScrollViewer}\">\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type ScrollViewer}\">\n\t\t\t\t\t<Grid >\n\t\t\t\t\t\t<ScrollContentPresenter CanContentScroll=\"True\" />\n\t\t\t\t\t\t<Grid>\n\t\t\t\t\t\t\t<Grid.ColumnDefinitions>\n\t\t\t\t\t\t\t\t<ColumnDefinition/>\n\t\t\t\t\t\t\t\t<ColumnDefinition Width=\"Auto\"/>\n\t\t\t\t\t\t\t</Grid.ColumnDefinitions>\n\t\t\t\t\t\t\t<Grid.RowDefinitions>\n\t\t\t\t\t\t\t\t<RowDefinition/>\n\t\t\t\t\t\t\t\t<RowDefinition Height=\"Auto\"/>\n\t\t\t\t\t\t\t</Grid.RowDefinitions>\n\t\t\t\t\t\t\t<ScrollBar x:Name=\"PART_VerticalScrollBar\" Grid.Row=\"0\" Grid.Column=\"1\" Value=\"{TemplateBinding VerticalOffset}\" Maximum=\"{TemplateBinding ScrollableHeight}\" ViewportSize=\"{TemplateBinding ViewportHeight}\" Visibility=\"{TemplateBinding ComputedVerticalScrollBarVisibility}\"/>\n\t\t\t\t\t\t\t<ScrollBar x:Name=\"PART_HorizontalScrollBar\" Orientation=\"Horizontal\" Grid.Row=\"1\" Grid.Column=\"0\" Value=\"{TemplateBinding HorizontalOffset}\" Maximum=\"{TemplateBinding ScrollableWidth}\" ViewportSize=\"{TemplateBinding ViewportWidth}\" Visibility=\"{TemplateBinding ComputedHorizontalScrollBarVisibility}\"/>\n\t\t\t\t\t\t\t<Rectangle Grid.Row=\"1\" Grid.Column=\"1\" Fill=\"{StaticResource BackgroundBrush}\" />\n\t\t\t\t\t\t</Grid>\n\t\t\t\t\t</Grid>\n\t\t\t\t</ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>"
  },
  {
    "path": "src/fusion/win/ScrollingImplementation.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class ScrollingImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tScrolling.Implementation.Factory = (content, darkTheme, supportsOpenGL, zooomAttribs, onBoundsChanged, scrollToRectangle, verticalScrollBarVisible, horizontalScrollBarVisible) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar contentNativeFrame = ObservableMath.RectangleWithSize(content.DesiredSize.Max(self.NativeFrame.Size));\n\n\t\t\t\t\tcontent.Mount(\n\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIsRooted = self.IsRooted,\n\t\t\t\t\t\t\tNativeFrame = contentNativeFrame,\n\t\t\t\t\t\t\tAvailableSize = self.NativeFrame.Size,\n\t\t\t\t\t\t});\n\n\t\t\t\t\tvar dummyControl = new Canvas();\n\t\t\t\t\tvar view = new ScrollViewer()\n\t\t\t\t\t{\n\t\t\t\t\t\tClipToBounds = true,\n\t\t\t\t\t\tContent = new ContentControl()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tVerticalAlignment = VerticalAlignment.Top,\n\t\t\t\t\t\t\tHorizontalAlignment = HorizontalAlignment.Left,\n\t\t\t\t\t\t\tContent = dummyControl,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tHorizontalScrollBarVisibility = horizontalScrollBarVisible ? ScrollBarVisibility.Auto : ScrollBarVisibility.Hidden,\n\t\t\t\t\t\tVerticalScrollBarVisibility = verticalScrollBarVisible ? ScrollBarVisibility.Auto : ScrollBarVisibility.Hidden,\n\t\t\t\t\t};\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"containerWidth\", contentNativeFrame.Size.Width, width => dummyControl.Width = Math.Max(0.0, width));\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"containerHeight\", contentNativeFrame.Size.Height, height => dummyControl.Height = Math.Max(0.0, height));\n\n\t\t\t\t\tself.BindNativeProperty(dispatcher, \"scrollTarget\", scrollToRectangle,\n\t\t\t\t\t\tr =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdummyControl.BringIntoView(new Rect(r.Left(), r.Top(), r.Width, r.Height));\n\t\t\t\t\t\t});\n\n\t\t\t\t\tonBoundsChanged.Do(handler =>\n\t\t\t\t\t{\n\t\t\t\t\t\tDataBinding.ObservableFromNativeEvent<EventArgs>(view, \"ScrollChanged\")\n\t\t\t\t\t\t\t.CombineLatest(\n\t\t\t\t\t\t\t\tcontentNativeFrame.Transpose().DistinctUntilChanged(),\n\t\t\t\t\t\t\t\t(_, contentFrame) => new ScrollBounds(\n\t\t\t\t\t\t\t\t\tRectangle.FromPositionSize<Points>(\n\t\t\t\t\t\t\t\t\t\tview.HorizontalOffset,\n\t\t\t\t\t\t\t\t\t\tview.VerticalOffset,\n\t\t\t\t\t\t\t\t\t\tview.ViewportWidth,\n\t\t\t\t\t\t\t\t\t\tview.ViewportHeight),\n\t\t\t\t\t\t\t\t\tcontentFrame))\n\t\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t\t.Subscribe(handler);\n\t\t\t\t\t});\n\n\t\t\t\t\tself.BindNativeDefaults(view, dispatcher);\n\n\t\t\t\t\tvar child = (FrameworkElement) content.NativeHandle;\n\n\t\t\t\t\tdummyControl.Children.Add(child);\n\n\t\t\t\t\treturn view;\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/ShellWin.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\n\nnamespace Outracks.IO\n{\n\tpublic class ShellWin : IOldShell\n\t{\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn \"File Explorer\";\n\t\t\t}\n\t\t}\n\n\t\tpublic IAbsolutePath ResolveAbsolutePath(string nativePath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar absPath = Path.IsPathRooted(nativePath)\n\t\t\t\t\t? nativePath\n\t\t\t\t\t: Path.GetFullPath(nativePath);\n\n\t\t\t\tvar isDirectory = Directory.Exists(nativePath);\n\n\t\t\t\treturn isDirectory\n\t\t\t\t\t? (IAbsolutePath) AbsoluteDirectoryPath.Parse(absPath)\n\t\t\t\t\t: (IAbsolutePath) AbsoluteFilePath.Parse(absPath);\n\n\t\t\t}\n\t\t\tcatch (ArgumentException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t\tcatch (NotSupportedException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t\tcatch (PathTooLongException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidPath(nativePath, e);\n\t\t\t}\n\t\t}\n\n\t\tpublic FileStream Open(AbsoluteFilePath path, FileMode mode, FileAccess access, FileShare share)\n\t\t{\n\t\t\treturn File.Open(path.NativePath, mode, access, share);\n\t\t}\n\n\t\tpublic Stream OpenRead(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn File.OpenRead(path.NativePath);\n\t\t}\n\n\t\tpublic Stream OpenWrite(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn File.OpenWrite(path.NativePath);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> GetFiles(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn Directory.GetFiles(path.NativePath).Select(AbsoluteFilePath.Parse);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetDirectories(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\treturn Directory.GetDirectories(path.NativePath).Select(AbsoluteDirectoryPath.Parse);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> GetFiles(AbsoluteDirectoryPath path, string searchPattern)\n\t\t{\n\t\t\treturn Directory.GetFiles(path.NativePath, searchPattern).Select(AbsoluteFilePath.Parse);\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteDirectoryPath> GetDirectories(AbsoluteDirectoryPath path, string searchPattern)\n\t\t{\n\t\t\treturn Directory.GetDirectories(path.NativePath, searchPattern).Select(AbsoluteDirectoryPath.Parse);\n\t\t}\n\n\t\tpublic void Delete(IAbsolutePath path)\n\t\t{\n\t\t\tpath.Do(\n\t\t\t\t(AbsoluteFilePath file) => File.Delete(file.NativePath),\n\t\t\t\t(AbsoluteDirectoryPath directory) => Directory.Delete(directory.NativePath, true));\n\t\t}\n\n\t\tpublic bool Exists(IAbsolutePath path)\n\t\t{\n\t\t\treturn path.MatchWith(\n\t\t\t\t(AbsoluteFilePath file) => File.Exists(file.NativePath),\n\t\t\t\t(AbsoluteDirectoryPath directory) => Directory.Exists(directory.NativePath));\n\t\t}\n\n\t\tpublic void Copy(AbsoluteFilePath source, AbsoluteFilePath dest)\n\t\t{\n\t\t\tFile.Copy(source.NativePath, dest.NativePath);\n\t\t}\n\n\t\tpublic void Move(AbsoluteFilePath source, AbsoluteFilePath destination)\n\t\t{\n\t\t\tif (!ShellHelper.TryPureMove(source, destination, File.Move))\n\t\t\t{\n\t\t\t\tFile.Copy(source.NativePath, destination.NativePath);\n\t\t\t\tFile.Delete(source.NativePath);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Move(AbsoluteDirectoryPath source, AbsoluteDirectoryPath destination)\n\t\t{\n\t\t\tif (!ShellHelper.TryPureMove(source, destination, Directory.Move))\n\t\t\t{\n\t\t\t\tShellHelper.DirectoryCopy(source.NativePath, destination.NativePath, copySubDirs: true);\n\t\t\t\tDirectory.Delete(source.NativePath, recursive: true);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Create(AbsoluteDirectoryPath directory)\n\t\t{\n\t\t\tDirectory.CreateDirectory(directory.NativePath);\n\t\t}\n\n\t\tpublic Stream Create(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn File.Open(file.NativePath, FileMode.Create);\n\t\t}\n\n\t\tpublic Stream CreateNew(AbsoluteFilePath file)\n\t\t{\n\t\t\treturn File.Open(file.NativePath, FileMode.CreateNew);\n\t\t}\n\n\t\tpublic IObservable<Unit> Watch(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn Observable.Create<Unit>(observer =>\n\t\t\t{\n\t\t\t\tif (!Exists(path.ContainingDirectory))\n\t\t\t\t{\n\t\t\t\t\tobserver.OnError(new FileNotFoundException(\"Directory not found\", path.ContainingDirectory.NativePath));\n\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t}\n\n\t\t\t\tvar fsw = new FileSystemWatcher(path.ContainingDirectory.NativePath, path.Name.ToString())\n\t\t\t\t{\n\t\t\t\t\tNotifyFilter = NotifyFilters.CreationTime\n\t\t\t\t\t\t| NotifyFilters.FileName\n\t\t\t\t\t\t| NotifyFilters.LastWrite\n\t\t\t\t\t\t| NotifyFilters.Size,\n\t\t\t\t};\n\n\t\t\t\tvar garbage = Disposable.Combine(\n\t\t\t\t\tfsw,\n\t\t\t\t\tObservable.FromEventPattern<ErrorEventArgs>(fsw, \"Error\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnError(_.EventArgs.GetException())),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Changed\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Created\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Renamed\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Deleted\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnNext(Unit.Default)));\n\n\t\t\t\tfsw.EnableRaisingEvents = true;\n\n\t\t\t\treturn garbage;\n\t\t\t});\n\t\t}\n\n\t\tpublic void OpenWithDefaultApplication(AbsoluteFilePath path)\n\t\t{\n\t\t\tProcess.Start((string) path.NativePath);\n\t\t}\n\n\t\tpublic void OpenFolder(AbsoluteDirectoryPath path)\n\t\t{\n\t\t\tProcess.Start((string) path.NativePath);\n\t\t}\n\n\t\tpublic void ShowInFolder(AbsoluteFilePath path)\n\t\t{\n\t\t\tProcess.Start(\"explorer.exe\", string.Format((string) \"/select,\\\"{0}\\\"\", (object) path.NativePath));\n\t\t}\n\n\t\tpublic void OpenTerminal(AbsoluteDirectoryPath containingDirectory)\n\t\t{\n\t\t\tvar ps = new ProcessStartInfo(\"cmd.exe\", \"/K \\\"cd /d \" + containingDirectory.NativePath + \"\\\"\")\n\t\t\t{\n\t\t\t\tUseShellExecute = true\n\t\t\t};\n\t\t\t//TODO: do we need this? ps.UpdatePathEnvironment();\n\t\t\tProcess.Start(ps);\n\t\t}\n\n\n\t\tpublic IObservable<FileSystemEventData> Watch(AbsoluteDirectoryPath path, Optional<string> filter = default(Optional<string>))\n\t\t{\n\t\t\treturn Observable.Create<FileSystemEventData>(observer =>\n\t\t\t{\n\t\t\t\tif (!Exists(path))\n\t\t\t\t{\n\t\t\t\t\tobserver.OnError(new FileNotFoundException(\"Directory not found\", path.ContainingDirectory.NativePath));\n\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t}\n\n\t\t\t\tvar fsw = filter.Select(f => new FileSystemWatcher(path.NativePath, f)).Or(new FileSystemWatcher(path.NativePath));\n\t\t\t\tfsw.IncludeSubdirectories = false;\n\t\t\t\tfsw.NotifyFilter = NotifyFilters.CreationTime\n\t\t\t\t\t| NotifyFilters.FileName\n\t\t\t\t\t| NotifyFilters.LastWrite\n\t\t\t\t\t| NotifyFilters.Size;\n\n\t\t\t\tvar garbage = Disposable.Combine(\n\t\t\t\t\tfsw,\n\t\t\t\t\tObservable.FromEventPattern<ErrorEventArgs>(fsw, \"Error\")\n\t\t\t\t\t\t.Subscribe(_ => observer.OnError(_.EventArgs.GetException())),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Changed\")\n\t\t\t\t\t\t.Subscribe(e => observer.OnNext(new FileSystemEventData(AbsoluteFilePath.Parse(e.EventArgs.FullPath), FileSystemEvent.Changed))),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Created\")\n\t\t\t\t\t\t.Subscribe(e => observer.OnNext(new FileSystemEventData(AbsoluteFilePath.Parse(e.EventArgs.FullPath), FileSystemEvent.Created))),\n\t\t\t\t\tObservable.FromEventPattern<RenamedEventArgs>(fsw, \"Renamed\")\n\t\t\t\t\t\t.Subscribe(e =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tobserver.OnNext(new FileSystemEventData(\n\t\t\t\t\t\t\t\tAbsoluteFilePath.Parse(e.EventArgs.FullPath),\n\t\t\t\t\t\t\t\tFileSystemEvent.Renamed,\n\t\t\t\t\t\t\t\tAbsoluteFilePath.Parse(e.EventArgs.OldFullPath)));\n\t\t\t\t\t\t}),\n\t\t\t\t\tObservable.FromEventPattern<FileSystemEventArgs>(fsw, \"Deleted\")\n\t\t\t\t\t\t.Subscribe(e => observer.OnNext(new FileSystemEventData(AbsoluteFilePath.Parse(e.EventArgs.FullPath), FileSystemEvent.Removed))));\n\n\t\t\t\tfsw.EnableRaisingEvents = true;\n\n\t\t\t\treturn garbage;\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/StyleResources.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n\t\t\t\t\txmlns:windows=\"clr-namespace:Outracks.Fusion.Windows\">\n\t<ResourceDictionary.MergedDictionaries>\n\t\t<ResourceDictionary Source=\"ScrollBar.xaml\"></ResourceDictionary>\n\t</ResourceDictionary.MergedDictionaries>\n    <BooleanToVisibilityConverter x:Key=\"bool2VisibilityConverter\" />\n\n\t<Color x:Key=\"WindowBackgroundColor\">#31343a</Color>\n    <Color x:Key=\"HighlightColorDark\">#383A4</Color>\n    <Color x:Key=\"HighlightColor\">#000</Color>\n    <Color x:Key=\"HighlightColor2\">#585A67</Color>\n    <Color x:Key=\"BlueColor\">#787A87</Color>\n    <Color x:Key=\"ForegroundColor\">#FFF4F4F5</Color>\n\n    <SolidColorBrush x:Key=\"WindowBackgroundColorBrush\" Color=\"{StaticResource WindowBackgroundColor}\"/>\n    <SolidColorBrush x:Key=\"HighlightColorBrushDark\" Color=\"{StaticResource HighlightColorDark}\"/>\n    <SolidColorBrush x:Key=\"HighlightColorBrush\" Color=\"{StaticResource HighlightColor}\" Opacity=\"0.2\"/>\n    <SolidColorBrush x:Key=\"HighlightColorBrush2\" Color=\"{StaticResource HighlightColor2}\"/>\n    <SolidColorBrush x:Key=\"BlueColorBrush\" Color=\"{StaticResource BlueColor}\"/>\n\t<SolidColorBrush x:Key=\"ForegroundColorBrush\" Color=\"{StaticResource ForegroundColor}\"/>\n\n\t<Thickness x:Key=\"FocusBorderThickness\" Left=\"1\" Top=\"1\" Right=\"1\" Bottom=\"1\" />\n\n\t<Style x:Key=\"WindowButtonStyle\" TargetType=\"{x:Type Button}\">\n\t\t<Setter Property=\"Foreground\" Value=\"{DynamicResource ForegroundColorBrush}\" />\n\t\t<Setter Property=\"Background\" Value=\"Transparent\" />\n\t\t<Setter Property=\"HorizontalContentAlignment\" Value=\"Center\" />\n\t\t<Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n\t\t<Setter Property=\"Padding\" Value=\"1\" />\n\t\t<Setter Property=\"Template\">\n\t\t\t<Setter.Value>\n\t\t\t\t<ControlTemplate TargetType=\"{x:Type Button}\">\n\t\t\t\t\t<Grid Background=\"{TemplateBinding Background}\">\n\t\t\t\t\t\t<ContentPresenter x:Name=\"contentPresenter\"\n                          HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n                          VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\"\n                          SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\"\n                          Margin=\"{TemplateBinding Padding}\"\n                          RecognizesAccessKey=\"True\" />\n\t\t\t\t\t</Grid>\n\t\t\t\t\t<ControlTemplate.Triggers>\n\t\t\t\t\t\t<Trigger Property=\"IsMouseOver\" Value=\"True\">\n                            <Setter Property=\"Background\" Value=\"{StaticResource HighlightColorBrush}\"  />\n                        </Trigger>\n\t\t\t\t\t\t<Trigger Property=\"IsPressed\" Value=\"True\">\n\t\t\t\t\t\t\t<Setter Property=\"Background\" Value=\"{DynamicResource BlueColorBrush}\" />\n\t\t\t\t\t\t</Trigger>\n\t\t\t\t\t\t<Trigger Property=\"IsEnabled\" Value=\"false\">\n\t\t\t\t\t\t\t<Setter TargetName=\"contentPresenter\" Property=\"Opacity\" Value=\".5\" />\n\t\t\t\t\t\t</Trigger>\n\t\t\t\t\t</ControlTemplate.Triggers>\n\t\t\t\t</ControlTemplate>\n\t\t\t</Setter.Value>\n\t\t</Setter>\n\t</Style>\n\n\t<Style TargetType=\"{x:Type TextBox}\">\n\t\t<Setter Property=\"SnapsToDevicePixels\" Value=\"True\" />\n\t\t<Setter Property=\"OverridesDefaultStyle\" Value=\"True\" />\n\t\t<Setter Property=\"BorderThickness\" Value=\"1\" />\n\t\t<Setter Property=\"Padding\" Value=\"1\" />\n\t\t<Setter Property=\"AllowDrop\" Value=\"True\" />\n\t\t<Setter Property=\"FocusVisualStyle\" Value=\"{x:Null}\" />\n\t\t<Setter Property=\"KeyboardNavigation.TabNavigation\" Value=\"None\" />\n\t\t<Setter Property=\"MinWidth\" Value=\"20\" />\n\t\t<Setter Property=\"MinHeight\" Value=\"20\" />\n\t\t<Setter Property=\"Template\">\n\t\t\t<Setter.Value>\n\t\t\t\t<ControlTemplate TargetType=\"{x:Type TextBox}\">\n\t\t\t\t\t<Border x:Name=\"border\" Background=\"{TemplateBinding Background}\">\n\t\t\t\t\t\t<ScrollViewer x:Name=\"PART_ContentHost\" Margin=\"0\" />\n\t\t\t\t\t</Border>\n\n\t\t\t\t</ControlTemplate>\n\t\t\t</Setter.Value>\n\t\t</Setter>\n\t</Style>\n\t\n\t<Style TargetType=\"{x:Type Slider}\">\n\t\t<Setter Property=\"Template\">\n\t\t\t<Setter.Value>\n\t\t\t\t<ControlTemplate TargetType=\"{x:Type Slider}\">\n\t\t\t\t\t<Border VerticalAlignment=\"Center\" Background=\"{TemplateBinding Background}\" BorderBrush=\"{TemplateBinding BorderBrush}\" BorderThickness=\"{TemplateBinding BorderThickness}\">\n\t\t\t\t\t\t<Grid>\n\t\t\t\t\t\t\t<Grid.RowDefinitions>\n\t\t\t\t\t\t\t\t<RowDefinition Height=\"Auto\"/>\n\t\t\t\t\t\t\t\t<RowDefinition Height=\"Auto\" MinHeight=\"{TemplateBinding MinHeight}\"/>\n\t\t\t\t\t\t\t\t<RowDefinition Height=\"Auto\"/>\n\t\t\t\t\t\t\t</Grid.RowDefinitions>\n\t\t\t\t\t\t\t<Rectangle x:Name=\"TrackBackground\" Fill=\"#cccccc\" RadiusX=\"2\" RadiusY=\"2\" VerticalAlignment=\"Center\" Height=\"3\" Grid.Row=\"1\" />\n\t\t\t\t\t\t\t<Track x:Name=\"PART_Track\" Grid.Row=\"1\">\n\t\t\t\t\t\t\t\t<Track.DecreaseRepeatButton>\n\t\t\t\t\t\t\t\t\t<RepeatButton Command=\"{x:Static Slider.DecreaseLarge}\">\n\t\t\t\t\t\t\t\t\t\t<RepeatButton.Template>\n\t\t\t\t\t\t\t\t\t\t\t<ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Grid>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Transparent rect used for hit testing -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Rectangle Fill=\"Transparent\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Rectangle Fill=\"#37b4dc\" RadiusX=\"2\" RadiusY=\"2\" VerticalAlignment=\"Center\" Height=\"3\" Margin=\"0,0,-5,0\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t\t</ControlTemplate>\n\t\t\t\t\t\t\t\t\t\t</RepeatButton.Template>\n\t\t\t\t\t\t\t\t\t</RepeatButton>\n\t\t\t\t\t\t\t\t</Track.DecreaseRepeatButton>\n\t\t\t\t\t\t\t\t<Track.IncreaseRepeatButton>\n\t\t\t\t\t\t\t\t\t<RepeatButton Command=\"{x:Static Slider.IncreaseLarge}\"/>\n\t\t\t\t\t\t\t\t</Track.IncreaseRepeatButton>\n\t\t\t\t\t\t\t\t<Track.Thumb>\n\t\t\t\t\t\t\t\t\t<Thumb x:Name=\"Thumb\" />\n\t\t\t\t\t\t\t\t</Track.Thumb>\n\t\t\t\t\t\t\t</Track>\n\t\t\t\t\t\t</Grid>\n\t\t\t\t\t</Border>\n\t\t\t\t</ControlTemplate>\n\t\t\t</Setter.Value>\n\t\t</Setter>\n\t</Style>\n\t<Style TargetType=\"{x:Type Thumb}\">\n\t\t<Setter Property=\"OverridesDefaultStyle\" Value=\"True\"/>\n\t\t<Setter Property=\"Template\">\n\t\t\t<Setter.Value>\n\t\t\t\t<ControlTemplate TargetType=\"{x:Type Thumb}\">\n\t\t\t\t\t<Ellipse Fill=\"#ffffff\" Stroke=\"#e0e0df\" Height=\"15\" Width=\"15\"/>\n\t\t\t\t</ControlTemplate>\n\t\t\t</Setter.Value>\n\t\t</Setter>\n\t</Style>\n\t<Style TargetType=\"{x:Type RepeatButton}\">\n\t\t<Setter Property=\"OverridesDefaultStyle\" Value=\"true\"/>\n\t\t<Setter Property=\"IsTabStop\" Value=\"false\"/>\n\t\t<Setter Property=\"Focusable\" Value=\"false\"/>\n\t\t<Setter Property=\"Template\">\n\t\t\t<Setter.Value>\n\t\t\t\t<ControlTemplate TargetType=\"{x:Type RepeatButton}\">\n\t\t\t\t\t<Rectangle Fill=\"Transparent\"/>\n\t\t\t\t</ControlTemplate>\n\t\t\t</Setter.Value>\n\t\t</Setter>\n\t</Style>\n\n\t<Style x:Key=\"FancyWindowStyle\" TargetType=\"windows:FancyWindow\">\n        <Setter Property=\"ResizeMode\" Value=\"CanResizeWithGrip\" />\n\t\t<Setter Property=\"UseLayoutRounding\" Value=\"True\" />\n\t\t<Setter Property=\"WindowStyle\" Value=\"SingleBorderWindow\" />\n\t\t<Setter Property=\"Template\">\n            <Setter.Value>\n\t\t\t\t<ControlTemplate TargetType=\"windows:FancyWindow\">\n                    <Border x:Name=\"WindowBorder\">\n                        <Grid>\n\t\t\t\t\t\t\t<!-- FIXME: Hardcoded border style. -->\n\t\t\t\t\t\t\t<!-- It would be better to add a way to set individual styles per window. -->\n\t\t\t\t\t\t\t<Border BorderThickness=\"1\" BorderBrush=\"#31343a\">\n\t\t\t\t\t\t\t<!-- <Border BorderBrush=\"{Binding BorderBrush, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\" BorderThickness=\"{Binding BorderThickness, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\"> -->\n\t\t\t\t\t\t\t\t<AdornerDecorator>\n\t\t\t\t\t\t\t\t\t<Grid x:Name=\"LayoutRoot\">\n\t\t\t\t\t\t\t\t\t\t<Grid.RowDefinitions>\n\t\t\t\t\t\t\t\t\t\t\t<RowDefinition Height=\"28\" />\n\t\t\t\t\t\t\t\t\t\t\t<RowDefinition Height=\"*\" />\n\t\t\t\t\t\t\t\t\t\t\t<RowDefinition Height=\"15\" />\n\t\t\t\t\t\t\t\t\t\t</Grid.RowDefinitions>\n\t\t\t\t\t\t\t\t\t\t<ContentPresenter Grid.Row=\"1\" Grid.RowSpan=\"2\" />\n\n                                        <Rectangle x:Name=\"HeaderBackground\" Height=\"28\" Fill=\"{Binding Background, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\" VerticalAlignment=\"Top\" Grid.Row=\"0\"/>\n\n                                        <StackPanel Orientation=\"Horizontal\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Top\" WindowChrome.IsHitTestVisibleInChrome=\"True\" Grid.Row=\"0\">\n\t\t\t\t\t\t\t\t\t\t\t<Button Command=\"{Binding Source={x:Static SystemCommands.MinimizeWindowCommand}}\" ToolTip=\"Minimize\" Style=\"{StaticResource WindowButtonStyle}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Grid Width=\"30\" Height=\"25\" RenderTransform=\"1,0,0,1,0,1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Path Data=\"M0,6 L8,6 Z\" Width=\"8\" Height=\"7\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"\n                                                        Stroke=\"{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\" StrokeThickness=\"1\"  />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t\t\t</Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t<Grid Margin=\"1,0,1,0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Button x:Name=\"Restore\" Command=\"{Binding Source={x:Static SystemCommands.RestoreWindowCommand}}\" ToolTip=\"Restore\" Visibility=\"Collapsed\" Style=\"{StaticResource WindowButtonStyle}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Grid Width=\"30\" Height=\"28\" UseLayoutRounding=\"True\" RenderTransform=\"1,0,0,1,.5,1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Path Data=\"M2,0 L8,0 L8,6 M0,3 L6,3 M0,2 L6,2 L6,8 L0,8 Z\" Width=\"8\" Height=\"8\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"\n                                                            Stroke=\"{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\" StrokeThickness=\"1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Path.RenderTransform>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ScaleTransform CenterX=\"4\" CenterY=\"4\" ScaleX=\"1.3\" ScaleY=\"1.3\"></ScaleTransform>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Path.RenderTransform>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t\t<Button x:Name=\"Maximize\" Command=\"{Binding Source={x:Static SystemCommands.MaximizeWindowCommand}}\" ToolTip=\"Maximize\" Visibility=\"Collapsed\" Style=\"{StaticResource WindowButtonStyle}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Grid Width=\"30\" Height=\"28\" UseLayoutRounding=\"True\" RenderTransform=\"1,0,0,1,.5,1.8\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Path Data=\"M0,0 L10,0 L10,10 L0,10 L0,0 Z\" Width=\"10\" Height=\"10\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"\n                                                            Stroke=\"{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\" StrokeThickness=\"1\"  />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t\t\t</Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t<Button Command=\"{Binding Source={x:Static SystemCommands.CloseWindowCommand}}\" ToolTip=\"Close\"  Style=\"{StaticResource WindowButtonStyle}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Grid Width=\"30\" Height=\"28\" RenderTransform=\"1,0,0,1,0,1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Path Data=\"M0,0 L8,7 M8,0 L0,7 Z\" Width=\"8\" Height=\"7\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"\n                                                        Stroke=\"{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\" StrokeThickness=\"1\"  />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t\t\t</Button.Content>\n\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t</StackPanel>\n\t\t\t\t\t\t\t\t\t\t<StackPanel Height=\"28\" Orientation=\"Horizontal\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Top\" WindowChrome.IsHitTestVisibleInChrome=\"True\" Grid.Row=\"0\">\n\t\t\t\t\t\t\t\t\t\t\t<Image Width=\"16\" Height=\"16\" Margin=\"6 0 0 0\" VerticalAlignment=\"Center\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Image.InputBindings>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MouseBinding MouseAction=\"LeftDoubleClick\" Command=\"{Binding Source={x:Static SystemCommands.CloseWindowCommand}}\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</Image.InputBindings>\n\t\t\t\t\t\t\t\t\t\t\t\t<Image.Source>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<BitmapImage DecodePixelWidth=\"16\" UriSource=\"pack://application:,,,/Outracks.Fusion.Windows;component/Fuse.ico\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</Image.Source>\n\t\t\t\t\t\t\t\t\t\t\t</Image>\n\t\t\t\t\t\t\t\t\t\t</StackPanel>\n\n\t\t\t\t\t\t\t\t\t\t<TextBlock x:Name=\"WindowTitleTextBlock\" Grid.Row=\"0\" Text=\"{TemplateBinding Title}\" HorizontalAlignment=\"Center\" TextTrimming=\"CharacterEllipsis\" VerticalAlignment=\"Center\" Margin=\"8 0 0 0\" FontSize=\"14\" Foreground=\"{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}\" />\n\t\t\t\t\t\t\t\t\t\t<StackPanel WindowChrome.IsHitTestVisibleInChrome=\"True\" Grid.Row=\"0\" Margin=\"28 0 0 0\" Orientation=\"Horizontal\" VerticalAlignment=\"Center\" x:Name=\"MenuContainer\" />\n\n\t\t\t\t\t\t\t\t\t\t<Grid Grid.Row=\"2\">\n\t\t\t\t\t\t\t\t\t\t\t<Path x:Name=\"ResizeGrip\" Visibility=\"Collapsed\" Width=\"12\" Height=\"12\" Margin=\"1\" HorizontalAlignment=\"Right\"\n                                        Stroke=\"{StaticResource BlueColorBrush}\" StrokeThickness=\"1\" Stretch=\"None\" Data=\"F1 M1,10 L3,10 M5,10 L7,10 M9,10 L11,10 M2,9 L2,11 M6,9 L6,11 M10,9 L10,11 M5,6 L7,6 M9,6 L11,6 M6,5 L6,7 M10,5 L10,7 M9,2 L11,2 M10,1 L10,3\" />\n\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t</AdornerDecorator>\n\t\t\t\t\t\t\t</Border>\n\t\t\t\t\t\t</Grid>\n                    </Border>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"WindowState\" Value=\"Maximized\">\n                            <Setter TargetName=\"Restore\" Property=\"Visibility\" Value=\"Visible\" />\n\t\t\t\t\t\t\t<Setter TargetName=\"Maximize\" Property=\"Visibility\" Value=\"Collapsed\" />\n                            <Setter TargetName=\"LayoutRoot\" Property=\"Margin\" Value=\"7\" />\n                        </Trigger>\n                        <Trigger Property=\"WindowState\" Value=\"Normal\">\n                            <Setter TargetName=\"Restore\" Property=\"Visibility\" Value=\"Collapsed\" />\n\t\t\t\t\t\t\t<Setter TargetName=\"Maximize\" Property=\"Visibility\" Value=\"Visible\" />\n                        </Trigger>\n                        <MultiTrigger>\n                            <MultiTrigger.Conditions>\n                                <Condition Property=\"ResizeMode\" Value=\"CanResizeWithGrip\" />\n                                <Condition Property=\"WindowState\" Value=\"Normal\" />\n                            </MultiTrigger.Conditions>\n                            <Setter TargetName=\"ResizeGrip\" Property=\"Visibility\" Value=\"Visible\" />\n                        </MultiTrigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n        <Setter Property=\"WindowChrome.WindowChrome\">\n            <Setter.Value>\n                <WindowChrome CornerRadius=\"0\" ResizeBorderThickness=\"3\" GlassFrameThickness=\"0\" UseAeroCaptionButtons=\"False\" />\n            </Setter.Value>\n        </Setter>\n    </Style>\n\n\t<Style x:Name=\"NoTitlebar\" TargetType=\"windows:FancyWindow\">\n\t\t<Setter Property=\"ResizeMode\" Value=\"NoResize\" />\n\t\t<Setter Property=\"UseLayoutRounding\" Value=\"True\" />\n\t\t<Setter Property=\"WindowStyle\" Value=\"None\" />\n\t</Style>\n\n\t<Style TargetType=\"{x:Type Button}\">\n        <Setter Property=\"Foreground\" Value=\"{StaticResource ForegroundColorBrush}\"></Setter>\n        <Setter Property=\"FontSize\" Value=\"13\"></Setter>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Button}\">\n                    <Grid>\n                        <Border Name=\"BorderPressed\" Background=\"{StaticResource HighlightColorBrush}\" Opacity=\"1\" VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Stretch\"/>\n                        <ContentPresenter VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" x:Name=\"MainContent\" />\n                    </Grid>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"True\">\n                            <Setter TargetName=\"BorderPressed\" Property=\"Background\" Value=\"{StaticResource HighlightColorBrush2}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsPressed\" Value=\"True\">\n                            <Setter TargetName=\"BorderPressed\" Property=\"Background\" Value=\"{StaticResource BlueColorBrush}\" />\n                        </Trigger>\n                        <Trigger Property=\"IsEnabled\" Value=\"False\">\n                            <Setter Property=\"Foreground\" Value=\"{StaticResource WindowBackgroundColorBrush}\" />\n                        </Trigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n    </Style>\n</ResourceDictionary>"
  },
  {
    "path": "src/fusion/win/ToolTipImplementation.cs",
    "content": "﻿using System.Windows;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class ToolTipImplementation\n\t{\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\tToolTip.Implementation.Set = (self, toolTip) =>\n\t\t\t{\n\t\t\t\tself.BindNativeProperty(dispatcher, \"tooltip\", toolTip, (FrameworkElement element, string value) =>\n\t\t\t\t\telement.ToolTip =\n\t\t\t\t\t\tstring.IsNullOrEmpty(value)\n\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t: new System.Windows.Controls.ToolTip { Content = value });\n\n\t\t\t\treturn self;\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/Transformation.cs",
    "content": "﻿using System;\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace Outracks.Fusion.Windows\n{\n\tclass Transformation\n\t{\n\t\tstatic Dispatcher _dispatcher;\n\t\tpublic static void Initialize(Dispatcher dispatcher)\n\t\t{\n\t\t\t_dispatcher = dispatcher;\n\t\t\tFusion.Transformation.Initialize(Transform);\n\t\t}\n\n\t\tstatic IControl Transform(IControl ctrl, IObservable<Matrix> matrix)\n\t\t{\n\t\t\treturn Control.Create(\n\t\t\t\tself =>\n\t\t\t\t{\n\t\t\t\t\tctrl.Mount(\n\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAvailableSize = self.AvailableSize,\n\t\t\t\t\t\t\tIsRooted = self.IsRooted,\n\t\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(ctrl.DesiredSize),\n\t\t\t\t\t\t});\n\n\t\t\t\t\tvar nativeThing = ctrl.NativeHandle as FrameworkElement;\n\t\t\t\t\tif (nativeThing == null)\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\tvar wrapper = new Canvas\n\t\t\t\t\t{\n\t\t\t\t\t\tChildren =\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnativeThing\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tself.BindNativeDefaults(wrapper, _dispatcher);\n\t\t\t\t\tself.BindNativeProperty(\n\t\t\t\t\t\tFusion.Application.MainThread,\n\t\t\t\t\t\t\"transform\",\n\t\t\t\t\t\tmatrix,\n\t\t\t\t\t\tmat =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//element.RenderTransformOrigin = new System.Windows.Point(element.Width / 2, element.Height / 2);\n\t\t\t\t\t\t\tnativeThing.LayoutTransform = mat.ToWpfScaleRotation();\n\t\t\t\t\t\t});\n\n\n\n\t\t\t\t\treturn wrapper;\n\t\t\t\t}).WithSize(\n\t\t\t\t\t\tRectangle\n\t\t\t\t\t\t\t.FromPositionSize(\n\t\t\t\t\t\t\t\tPoint.Create(ctrl.DesiredSize.Width.Div(-2), ctrl.DesiredSize.Height.Div(-2)),\n\t\t\t\t\t\t\t\tctrl.DesiredSize)\n\t\t\t\t\t\t\t.Transpose()\n\t\t\t\t\t\t\t.Transform(matrix)\n\t\t\t\t\t\t\t.Transpose()\n\t\t\t\t\t\t\t.Size);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/VerticalSynchronization.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing System.Windows.Forms;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tpublic interface IVSyncContext\n\t{\n\t\tvoid WaitForVBlank();\n\t}\n\n\tpublic class SimulatedVSync : IVSyncContext\n\t{\n\t\treadonly Stopwatch _stopWatch = new Stopwatch();\n\t\tpublic void WaitForVBlank()\n\t\t{\n\t\t\tvar elapsedTime = _stopWatch.ElapsedMilliseconds;\n\t\t\tif (elapsedTime < 16)\n\t\t\t{\n\t\t\t\tThread.Sleep((int)(16 - elapsedTime));\n\t\t\t}\n\t\t\t_stopWatch.Restart();\n\t\t}\n\t}\n\n\tpublic class VsyncContext : IVSyncContext\n\t{\n\t\tD3DKMT_WAITFORVERTICALBLANKEVENT _waitforverticalblankevent;\n\n\t\tinternal VsyncContext(D3DKMT_WAITFORVERTICALBLANKEVENT waitforverticalblankevent)\n\t\t{\n\t\t\t_waitforverticalblankevent = waitforverticalblankevent;\n\t\t}\n\n\t\tpublic void WaitForVBlank()\n\t\t{\n\t\t\tD3DKMTWaitForVerticalBlankEvent(ref _waitforverticalblankevent);\n\t\t}\n\n\t\t[DllImport(\"gdi32.dll\")]\n\t\tstatic extern uint D3DKMTWaitForVerticalBlankEvent(ref D3DKMT_WAITFORVERTICALBLANKEVENT pData);\n\t}\n\n\tpublic static class VerticalSynchronization\n\t{\n\t\t/// <summary>\n\t\t/// Make sure to call this after a Window context is made!\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\tpublic static IVSyncContext CreateContext()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar openAdapter = new D3DKMT_OPENADAPTERFROMHDC();\n\t\t\t\tvar waitForVblankEvent = new D3DKMT_WAITFORVERTICALBLANKEVENT();\n\n\t\t\t\tvar hdc = CreateDC(Screen.PrimaryScreen.DeviceName, null, null, IntPtr.Zero);\n\t\t\t\topenAdapter.hDc = hdc;\n\t\t\t\tvar result = D3DKMTOpenAdapterFromHdc(ref openAdapter);\n\t\t\t\tif (result != 0)\n\t\t\t\t\tthrow new Exception(\"D3DKMTOpenAdapterFromHdc failed\");\n\n\t\t\t\twaitForVblankEvent.hAdapter = openAdapter.hAdapter;\n\t\t\t\twaitForVblankEvent.hDevice = 0;\n\t\t\t\twaitForVblankEvent.VidPnSourceId = openAdapter.VidPnSourceId;\n\n\t\t\t\treturn new VsyncContext(waitForVblankEvent);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tReportFactory.FallbackReport.Error(e);\n\t\t\t}\n\n\t\t\treturn new SimulatedVSync();\n\t\t}\n\n\t\t[DllImport(\"gdi32.dll\")]\n\t\tstatic extern IntPtr CreateDC(string lpszDriver, string lpszDevice,\n\t\t   string lpszOutput, IntPtr lpInitData);\n\n\t\t[DllImport(\"gdi32.dll\")]\n\t\tstatic extern uint D3DKMTOpenAdapterFromHdc(ref D3DKMT_OPENADAPTERFROMHDC pData);\n\t}\n\n\tstruct D3DKMT_OPENADAPTERFROMHDC\n\t{\n\t\tpublic IntPtr hDc;\n\t\tpublic uint hAdapter;\n\t\tpublic uint AdapterLuidLowPart;\n\t\tpublic uint AdapterLuidHighPart;\n\t\tpublic uint VidPnSourceId;\n\t}\n\n\tstruct D3DKMT_WAITFORVERTICALBLANKEVENT\n\t{\n\t\tpublic uint hAdapter;\n\t\tpublic uint hDevice;\n\t\tpublic uint VidPnSourceId;\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WinApi.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Runtime.InteropServices;\nusing System.Windows;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class WinApi\n\t{\n\t\tpublic static IntPtr HWND_TOP = new IntPtr(0);\n\t\tpublic static IntPtr HWND_BOTTOM = new IntPtr(1);\n\t\tpublic static IntPtr HWND_TOPMOST = new IntPtr(-1);\n\t\tpublic static IntPtr HWND_NOTOPMOST = new IntPtr(-2);\n\n\t\t/*\n\t\tpublic static IObservable<Rectangle<Points>> NativeScreenFrame(this FrameworkElement element, System.Windows.Window window)\n\t\t{\n\t\t\treturn Observable.Defer(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tvar windowMoved = Observable.FromEventPattern(window, \"LocationChanged\").Select(_ => Unit.Default);\n\t\t\t\t\tvar layoutUpdated = Observable.FromEventPattern(element, \"LayoutUpdated\").Select(_ => Unit.Default);\n\t\t\t\t\tvar couldHaveMovedOnscreen = windowMoved.Merge(layoutUpdated).StartWith(Unit.Default);\n\n\t\t\t\t\treturn couldHaveMovedOnscreen\n\t\t\t\t\t\t.Where(_ => element.Dispatcher.Invoke(() => PresentationSource.FromVisual(element) != null))\n\t\t\t\t\t\t.Select(_ => element.Dispatcher.Invoke(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar dpi = element.GetDpi();\n\t\t\t\t\t\t\tvar topLeft = element.PointToScreen(new System.Windows.Point(0, 0));\n\t\t\t\t\t\t\tvar bottomRight = element.PointToScreen(new System.Windows.Point(element.ActualWidth, element.ActualHeight));\n\n\t\t\t\t\t\t\treturn Rectangle.FromSides<Pixels>(topLeft.X, topLeft.Y, bottomRight.X, bottomRight.Y)\n\t\t\t\t\t\t\t\t.Mul(dpi.Reciprocal());\n\t\t\t\t\t\t}))\n\t\t\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t\t\t.Replay(1)\n\t\t\t\t\t\t.RefCount();\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IObservable<Rectangle<Points>> NativeWindowFrame(this FrameworkElement element)\n\t\t{\n\t\t\treturn Observable\n\t\t\t\t.Defer(() => element.Dispatcher.Invoke(() =>\n\t\t\t\t\tObservable\n\t\t\t\t\t\t.FromEventPattern(element, \"LayoutUpdated\")\n\t\t\t\t\t\t.Select(_ => Unit.Default)\n\t\t\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t\t\t.Select(_ =>\n\t\t\t\t\t\t\telement.Dispatcher.Invoke(() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar window = System.Windows.Window.GetWindow(element);\n\t\t\t\t\t\t\t\tvar topLeft = element.TranslatePoint(new System.Windows.Point(0, 0), window);\n\t\t\t\t\t\t\t\tvar bottomRight = element.TranslatePoint(\n\t\t\t\t\t\t\t\t\tnew System.Windows.Point(element.ActualWidth, element.ActualHeight),\n\t\t\t\t\t\t\t\t\twindow);\n\t\t\t\t\t\t\t\treturn Rectangle.FromSides<Points>(topLeft.X, topLeft.Y, bottomRight.X, bottomRight.Y);\n\t\t\t\t\t\t\t}))))\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Replay(1)\n\t\t\t\t.RefCount();\n\t\t}\n\t\t*/\n\n\t\t[DllImport(\"user32.dll\", SetLastError = true)]\n\t\tpublic static extern IntPtr DefWindowProcW(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);\n\n\t\tpublic static void BringInFrontOf(IntPtr hwnd, IntPtr parent)\n\t\t{\n\t\t\tSetWindowPos(hwnd, parent, 0, 0, 0, 0, /*SWP_SHOWWINDOW |*/ SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE /*| SWP_ASYNCWINDOWPOS*/);\n\t\t}\n\n\t\tpublic static void ActivateWindow(IntPtr hwnd)\n\t\t{\n\t\t\tSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE);\n\t\t}\n\t\tpublic static IDisposable SubscribeWindowFrame(IntPtr hwnd, IObservable<Rectangle<Points>> frame, Optional<IntPtr> parent = default(Optional<IntPtr>))\n\t\t{\n\t\t\treturn frame\n\t\t\t\t.Select(r => Rectangle.FromPositionSize(r.Position.Round(), r.Size.Round()))\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Subscribe(s =>\n\t\t\t\t{\n\t\t\t\t\tvar flags = SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE;\n\t\t\t\t\tif (!parent.HasValue)\n\t\t\t\t\t\tflags |= SWP_NOZORDER;\n\n\t\t\t\t\tSetWindowPos(\n\t\t\t\t\t\thwnd,\n\t\t\t\t\t\tparent.Or(IntPtr.Zero),\n\t\t\t\t\t\t(int)s.Left(), (int)s.Top(),\n\t\t\t\t\t\t(int) s.Width, (int) s.Height,\n\t\t\t\t\t\tflags);\n\t\t\t\t});\n\t\t}\n\n\t\t[DllImport(\"user32.dll\")]\n\t\tpublic static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);\n\n\t\t[DllImport(\"user32.dll\", SetLastError = true)]\n\t\tprivate static extern int GetWindowLong(IntPtr hWnd, int nIndex);\n\n\n\t\tpublic static IDisposable SetWindowParent(IntPtr child, IntPtr parent)\n\t\t{\n\t\t\tSetParent(child, parent);\n\t\t\treturn Disposable.Create(() => SetParent(child, IntPtr.Zero));\n\t\t}\n\n\t\t[DllImport(\"user32\")]\n\t\tpublic static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent);\n\n\t\t[DllImport(\"user32\")]\n\t\tpublic static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);\n\n\n\t\tpublic static bool SetWindowPos(IntPtr hWnd, Optional<Point<Pixels>> position, Optional<Size<Pixels>> size, Optional<bool> hasZeroArea, int uFlags)\n\t\t{\n\t\t\tvar p = position.Or(new Point<Pixels>(0,0));\n\t\t\tvar s = size.Or(new Size<Pixels>(0,0));\n\n\t\t\tif (hasZeroArea == true)\n\t\t\t\tuFlags |= SWP_HIDEWINDOW;\n\n\t\t\tif (hasZeroArea == false)\n\t\t\t\tuFlags |= SWP_SHOWWINDOW;\n\n\t\t\tif (position.HasValue || size.HasValue || hasZeroArea.HasValue)\n\t\t\t\treturn SetWindowPos(hWnd, HWND_TOP, (int)p.X, (int)p.Y, (int)s.Width, (int)s.Height, uFlags\n\t\t\t\t\t| (position.HasValue ? 0 : SWP_NOMOVE)\n\t\t\t\t\t| (size.HasValue ? 0 : SWP_NOSIZE));\n\n\t\t\treturn false;\n\t\t}\n\n\n\t\tpublic static bool SetWindowPos(IntPtr hWnd, Rectangle<Points> frame, int uFlags)\n\t\t{\n\t\t\treturn SetWindowPos(hWnd, HWND_TOP, (int) frame.Left(), (int) frame.Top(), (int) frame.Width, (int) frame.Height, uFlags);\n\n\t\t}\n\n\t\t[DllImport(\"user32.dll\")]\n\t\tpublic static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab);\n\n\t\tpublic const int SWP_ASYNCWINDOWPOS = 0x4000;\n\t\tpublic const int SWP_NOZORDER = 0x0004;\n\t\tpublic const int SWP_NOACTIVATE = 0x0010;\n\t\tconst int SWP_HIDEWINDOW = 0x0080;\n\t\tpublic const int SWP_NOMOVE = 0x0002;\n\t\tpublic const int SWP_NOSIZE = 0x0001;\n\t\tpublic const int SWP_NOCOPYBITS = 0x0100;\n\t\tconst int SWP_SHOWWINDOW = 0x0040;\n\t\tpublic const int GWL_STYLE = -16;\n\t\tpublic const int GWL_EXSTYLE = -20;\n\t\tpublic const int WS_CLIPCHILDREN = 0x02000000;\n\t\tpublic const int WS_EX_TRANSPARENT = 0x00000020;\n\n\t\t[DllImport(\"user32.dll\")]\n\t\t[return: MarshalAs(UnmanagedType.Bool)]\n\t\tpublic static extern bool ShowWindow(IntPtr hWnd, ShowWindowEnum flags);\n\n\t\tpublic enum ShowWindowEnum\n\t\t{\n\t\t\tHide = 0,\n\t\t\tShowNormal = 1, ShowMinimized = 2, ShowMaximized = 3,\n\t\t\tMaximize = 3, ShowNormalNoActivate = 4, Show = 5,\n\t\t\tMinimize = 6, ShowMinNoActivate = 7, ShowNoActivate = 8,\n\t\t\tRestore = 9, ShowDefault = 10, ForceMinimized = 11\n\t\t};\n\t}\n\n\tstatic class VisualExtensions\n\t{\n\t\tpublic static Ratio<Pixels, Points> GetDpi(this Visual visual)\n\t\t{\n\t\t\tvar source = PresentationSource.FromVisual(visual);\n\t\t\tvar dpi = new Ratio<Pixels, Points>(1.0);\n\t\t\tif (source != null && source.CompositionTarget != null)\n\t\t\t\tdpi = new Ratio<Pixels, Points>(source.CompositionTarget.TransformToDevice.M11);\n\n\t\t\treturn dpi;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WinFormMenuBuilder.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class WinFormMenuBuilder\n\t{\n\t\tpublic static IDisposable Populate(Menu menu, System.Windows.Forms.ContextMenu mainMenu)\n\t\t{\n\t\t\treturn menu.Items\n\t\t\t\t.ObserveOn(DispatcherScheduler.Current)\n\t\t\t\t.UnsafeAsObservableList()\n\t\t\t\t.Select(CreateItem)\n\t\t\t\t.DisposeElements(i => i.Tag as IDisposable ?? Disposable.Empty)\n\t\t\t\t.Subscribe(change => change.ApplyLegacy(mainMenu.MenuItems));\n\t\t}\n\n\t\tpublic static System.Windows.Forms.MenuItem CreateItem(MenuItem item)\n\t\t{\n\t\t\tvar menuItem = new System.Windows.Forms.MenuItem();\n\n\t\t\tAction click = () => { };\n\t\t\tmenuItem.Click += (s, a) => click();\n\n\t\t\tmenuItem.Tag = Disposable.Combine(\n\t\t\t\titem.Menu.Select(\n\t\t\t\t\tsubmenu => submenu.Items\n\t\t\t\t\t\t.ObserveOn(DispatcherScheduler.Current)\n\t\t\t\t\t\t.UnsafeAsObservableList()\n\t\t\t\t\t\t.Select(CreateItem)\n\t\t\t\t\t\t.DisposeElements(i => i.Tag as IDisposable ?? Disposable.Empty)\n\t\t\t\t\t\t.Subscribe(change => change.ApplyLegacy(menuItem.MenuItems)))\n\t\t\t\t\t.Or(Disposable.Empty),\n\n\t\t\t\titem.Command.Action\n\t\t\t\t\t.CombineLatest(item.Name)\n\t\t\t\t\t.ObserveOn(DispatcherScheduler.Current)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\tcmdName =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmenuItem.Text = cmdName.Item2;\n\t\t\t\t\t\t\tclick = () => cmdName.Item1.Do(x => x());\n\t\t\t\t\t\t}),\n\n\t\t\t\titem.IsToggled\n\t\t\t\t\t.ObserveOn(DispatcherScheduler.Current)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\tisToggled =>\n\t\t\t\t\t\t\tmenuItem.Checked = isToggled));\n\n\t\t\treturn menuItem;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WinFormMenuShortcutExtensions.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Windows.Forms;\n\nnamespace Outracks.Fusion.Windows\n{\n\tstatic class WinFormMenuShortcutExtensions\n\t{\n\t\tpublic static Shortcut ToFormShortcut(this HotKey hotKey)\n\t\t{\n\t\t\tconst int shiftFlag = 0x10000;\n\t\t\tconst int ctrlFlag = 0x20000;\n\t\t\tconst int altFlag = 0x40000;\n\n\t\t\tvar modifierFlag = 0;\n\n\t\t\tif (hotKey.Modifier.HasFlag(ModifierKeys.Shift))\n\t\t\t\tmodifierFlag |= shiftFlag;\n\n\t\t\tif (hotKey.Modifier.HasFlag(ModifierKeys.Control))\n\t\t\t\tmodifierFlag |= ctrlFlag;\n\n\t\t\tif (hotKey.Modifier.HasFlag(ModifierKeys.Alt))\n\t\t\t\tmodifierFlag |= altFlag;\n\n\t\t\tvar shortcutCode = modifierFlag | (int)hotKey.Key;\n\t\t\tif (!IsValidShortcut(shortcutCode))\n\t\t\t\tthrow new InvalidEnumArgumentException(\"Not supported hotkey \" + hotKey.ToString());\n\n\t\t\treturn (Shortcut)shortcutCode;\n\t\t}\n\n\t\tstatic bool IsValidShortcut(int shortcutCode)\n\t\t{\n\t\t\tvar values = Enum.GetValues(typeof(Shortcut)).Cast<int>();\n\t\t\treturn values.Contains(shortcutCode);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WinFormsMessageBox.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Windows.Forms;\nusing System.Windows.Interop;\nusing IWin32Window = System.Windows.Forms.IWin32Window;\n\nnamespace Outracks.Fusion.Windows\n{\n\tclass WinFormsMessageBox : IMessageBox\n\t{\n\t\tpublic static void Initialize()\n\t\t{\n\t\t\tDialogs.MessageBox.Implementation = new WinFormsMessageBox();\n\t\t}\n\n\t\tpublic void BringToFront()\n\t\t{\n\t\t\tSystem.Windows.Application.Current.Dispatcher.Invoke(() => {\n\t\t\t\t// Bring all open windows to front.\n\t\t\t\tforeach (var window in OpenedWindows())\n\t\t\t\t{\n\t\t\t\t\t// https://stackoverflow.com/questions/257587/bring-a-window-to-the-front-in-wpf\n\t\t\t\t\twindow.Activate();\n\n\t\t\t\t\tif (!window.Topmost)\n\t\t\t\t\t{\n\t\t\t\t\t\twindow.Topmost = true;  // important\n\t\t\t\t\t\twindow.Topmost = false; // important\n\t\t\t\t\t}\n\n\t\t\t\t\twindow.Focus();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic bool ShowConfirm(string text, string caption, MessageBoxType type)\n\t\t{\n\t\t\treturn System.Windows.Application.Current.Dispatcher.Invoke(() => {\n\t\t\t\tvar owner = Owner();\n\t\t\t\tvar result = MessageBox.Show(owner, text, caption,\n\t\t\t\t\tSystem.Windows.Forms.MessageBoxButtons.YesNo, Icon(type));\n\t\t\t\treturn result == System.Windows.Forms.DialogResult.Yes;\n\t\t\t});\n\t\t}\n\n\t\tpublic void Show(string text, string caption, MessageBoxType type)\n\t\t{\n\t\t\tSystem.Windows.Application.Current.Dispatcher.Invoke(() => {\n\t\t\t\tvar owner = Owner();\n\t\t\t\tMessageBox.Show(owner, text, caption,\n\t\t\t\t\tSystem.Windows.Forms.MessageBoxButtons.OK, Icon(type));\n\t\t\t});\n\t\t}\n\n\t\tstatic MessageBoxIcon Icon(MessageBoxType type)\n\t\t{\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\tcase MessageBoxType.Error:\n\t\t\t\treturn MessageBoxIcon.Error;\n\t\t\tcase MessageBoxType.Information:\n\t\t\t\treturn MessageBoxIcon.Information;\n\t\t\tdefault:\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tstatic IWin32Window Owner()\n\t\t{\n\t\t\t// Last window is top-most (after BringToFront).\n\t\t\tvar window = OpenedWindows().LastOrDefault();\n\t\t\treturn window != null\n\t\t\t\t? new WindowWrapper(window)\n\t\t\t\t: null;\n\t\t}\n\n\t\tstatic IEnumerable<System.Windows.Window> OpenedWindows()\n\t\t{\n\t\t\tforeach (var obj in System.Windows.Application.Current.Windows)\n\t\t\t\tif (obj is System.Windows.Window wnd && wnd.IsVisible &&\n\t\t\t\t\t\t// FIXME: Hardcoded string.\n\t\t\t\t\t\twnd.Title.Contains(\"fuse X\"))\n\t\t\t\t\tyield return wnd;\n\t\t}\n\n\t\tclass WindowWrapper : IWin32Window\n\t\t{\n\t\t\tpublic IntPtr Handle { get; }\n\n\t\t\tpublic WindowWrapper(System.Windows.Window window)\n\t\t\t{\n\t\t\t\tHandle = new WindowInteropHelper(window).Handle;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/WindowImplementation.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Interop;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic static class WindowImplementation\n\t{\n\t\tconst int TitleBarHeight = 28;\n\n\t\tpublic static System.Windows.Window Initialize(Window model)\n\t\t{\n\t\t\tvar dispatcher = Fusion.Application.MainThread;\n\n\t\t\tvar windowSubject = new BehaviorSubject<Optional<WindowWithOverlays>>(Optional.None());\n\n\t\t\tvar contentContainer = new Canvas()\n\t\t\t{\n\t\t\t\t// This is needed for native overlays to work\n\t\t\t\tClipToBounds = true,\n\t\t\t};\n\n\t\t\tvar ret = new FancyWindow(model.Style == WindowStyle.Regular || model.Style == WindowStyle.Fat)\n\t\t\t{\n\t\t\t\tContent = contentContainer\n\t\t\t};\n\n\t\t\tvar menu = ret.Menu;\n\n\t\t\tvar focused = new Subject<Unit>();\n\t\t\tmodel.Focused.Execute.Sample(focused).Subscribe(c => c());\n\t\t\tret.Activated += (sender, args) => focused.OnNext(Unit.Default);\n\n\t\t\tvar availableSize = DataBinding\n\t\t\t\t.ObservableFromNativeEvent<SizeChangedEventArgs>(contentContainer, \"SizeChanged\")\n\t\t\t\t.Select(e => e.NewSize.ToFusion())\n\t\t\t\t.Replay(1);\n\n\t\t\tavailableSize.Connect();\n\n\t\t\tvar content = model.Content;\n\t\t\t\t//.SetNativeWindow(windowSubject)\n\t\t\t\t//.SetDensity(ret.DensityFactor);\n\t\t\tvar transize = availableSize.Transpose();\n\t\t\tcontent.Mount(\n\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t{\n\t\t\t\t\tAvailableSize = transize,\n\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(transize),\n\t\t\t\t\tIsRooted = Observable\n\t\t\t\t\t\t.FromEventPattern<DependencyPropertyChangedEventArgs>(ret, \"IsVisibleChanged\")\n\t\t\t\t\t\t.Select(arg => ret.IsVisible)\n\t\t\t\t\t\t.Replay(1).RefCount(),\n\t\t\t\t});\n\n\t\t\tcontent.BindNativeProperty(dispatcher, \"Background\", model.Background, color =>\n\t\t\t\tmenu.Background = ret.Background = new SolidColorBrush(color.ToColor()));\n\n\t\t\tcontent.BindNativeProperty(dispatcher, \"Foreground\", model.Foreground, color =>\n\t\t\t\tmenu.Foreground = ret.Foreground = new SolidColorBrush(color.ToColor()));\n\n\t\t\tcontent.BindNativeProperty(dispatcher, \"BorderBrush\", model.Border.Brush, color =>\n\t\t\t\tret.BorderBrush = new SolidColorBrush(color.ToColor()));\n\n\t\t\tcontent.BindNativeProperty(dispatcher, \"BorderThickness\", model.Border.Thickness, thickness =>\n\t\t\t\tret.BorderThickness = new System.Windows.Thickness(thickness));\n\n\n\t\t\tFusion.Application.MainThread\n\t\t\t\t.InvokeAsync(() => content.NativeHandle)\n\t\t\t\t.ToObservable()\t\t\t\t.OfType<UIElement>()\n\t\t\t\t.Subscribe(nativeContent =>\n\t\t\t\t\tcontentContainer.Children.Add(nativeContent));\n\n\t\t\tvar windowState =\n\t\t\t\tmodel.State\n\t\t\t\t\t.Or(Property.Default<Optional<WindowState>>())\n\t\t\t\t\t.Or(WindowState.Normal)\n\t\t\t\t\t.AutoInvalidate()\n\t\t\t\t\t.PreventFeedback();\n\n\t\t\twindowState.Subscribe(state => dispatcher.InvokeAsync(() =>\n\t\t\t\tret.WindowState = state == WindowState.Normal ? System.Windows.WindowState.Normal : System.Windows.WindowState.Maximized));\n\n\t\t\tret.StateChanged += (sender, args) =>\n\t\t\t\twindowState.Write(\n\t\t\t\t\tret.WindowState == System.Windows.WindowState.Maximized\n\t\t\t\t\t\t? WindowState.Maximized\n\t\t\t\t\t\t: WindowState.Normal);\n\n\t\t\tmodel.Size.Do(\n\t\t\t\tmaybeSize =>\n\t\t\t\t{\n\t\t\t\t\tvar size = maybeSize\n\t\t\t\t\t\t.Or(Size.Create<Points>(Double.NaN, Double.NaN))\n\t\t\t\t\t\t.AutoInvalidate(TimeSpan.FromSeconds(2))\n\t\t\t\t\t\t.PreventFeedback();\n\n\t\t\t\t\tbool setByUs = false;\n\n\t\t\t\t\tsize.Subscribe(s => dispatcher.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tsetByUs = true;\n\t\t\t\t\t\tret.Width = (float)s.Width;\n\t\t\t\t\t\tvar newHeight = s.Height + (TitleBarHeight);\n\t\t\t\t\t\tret.Height = (float) newHeight;\n\t\t\t\t\t\tsetByUs = false;\n\t\t\t\t\t}));\n\n\t\t\t\t\tret.SizeChanged += (s, a) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (setByUs) return;\n\n\t\t\t\t\t\tvar contentSize = new Size<Points>(a.NewSize.Width, a.NewSize.Height - (TitleBarHeight));\n\t\t\t\t\t\tsize.Write(contentSize);\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\tmodel.Position.Do(\n\t\t\t\tmaybePosition =>\n\t\t\t\t{\n\t\t\t\t\tvar pos = maybePosition\n\t\t\t\t\t\t.Or(new Point<Points>(double.NaN, double.NaN))\n\t\t\t\t\t\t.AutoInvalidate(TimeSpan.FromSeconds(2))\n\t\t\t\t\t\t.PreventFeedback();\n\t\t\t\t\t\t// TODO: ConnectWhile() ?\n\n\t\t\t\t\tbool setByUs = false;\n\n\t\t\t\t\tpos.Subscribe(p => dispatcher.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tsetByUs = true;\n\t\t\t\t\t\tret.Left = p.X;\n\t\t\t\t\t\tret.Top = p.Y;\n\t\t\t\t\t\tsetByUs = false;\n\t\t\t\t\t}));\n\n\t\t\t\t\tFusion.Application.MainThread.Schedule(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tret.LocationChanged += (s, args) =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (setByUs) return;\n\n\t\t\t\t\t\t\tvar sender = s as FancyWindow;\n\t\t\t\t\t\t\tif (sender == null) return;\n\n\t\t\t\t\t\t\tpos.Write(new Point<Points>(sender.Left, sender.Top));\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\tmodel.TopMost.Do(topMost =>\n\t\t\t\ttopMost.Subscribe(t => dispatcher.Schedule(() =>\n\t\t\t\t{\n\t\t\t\t\tret.Topmost = t;\n\t\t\t\t\tret.Show();\n\t\t\t\t})));\n\n\t\t\tmodel.Size.Do(s =>\n\t\t\t\ts.IsReadOnly.Subscribe(isReadOnly => dispatcher.Schedule(() =>\n\t\t\t\t{\n\t\t\t\t\tif (isReadOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tret.ResizeMode = ResizeMode.NoResize;\n\t\t\t\t\t\tret.WindowStartupLocation = WindowStartupLocation.CenterScreen;\n\t\t\t\t\t}\n\t\t\t\t})));\n\n\n\t\t\tvar closed = new Subject<Unit>();\n\t\t\tret.Closed += (s, a) => closed.OnNext(Unit.Default);\n\t\t\tmodel.Closed.Execute.Sample(closed).Subscribe(e => e());\n\n\t\t\tmodel.Title.Subscribe(title => dispatcher.Schedule(() =>\n\t\t\t{\n\t\t\t\tret.Title = model.HideTitle ? \"\" : title;\n\t\t\t}));\n\n\t\t\tvar hidden = false;\n\t\t\tmodel.Menu.Do(m => WindowsMenuBuilder.Populate(m, menu, ret, dispatcher));\n\n\t\t\tret.KeyUp += (s, e) => {\n\t\t\t\tif (hidden && e.Key == System.Windows.Input.Key.System)\n\t\t\t\t\tmenu.Visibility = menu.Visibility == Visibility.Collapsed\n\t\t\t\t\t\t? Visibility.Visible\n\t\t\t\t\t\t: Visibility.Collapsed;\n\t\t\t};\n\n\t\t\tmodel.HideMenu.Do(hideMenu =>\n\t\t\t\thideMenu.Subscribe(value => dispatcher.Schedule(() => {\n\t\t\t\t\thidden = value;\n\t\t\t\t\tmenu.Visibility = value\n\t\t\t\t\t\t? Visibility.Collapsed\n\t\t\t\t\t\t: Visibility.Visible;\n\t\t\t\t})));\n\n\t\t\tDataBinding\n\t\t\t\t.ObservableFromNativeEvent<EventArgs>(ret, \"Loaded\")\n\t\t\t\t.Subscribe(_ => windowSubject.OnNext(ret));\n\n\t\t\tDataBinding\n\t\t\t\t.ObservableFromNativeEvent<EventArgs>(ret, \"LayoutUpdated\")\n\t\t\t\t.Select(a => PresentationSource.FromVisual(ret))\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Subscribe(\n\t\t\t\t\tpresentation =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (presentation == null)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tvar winHandle = new WindowInteropHelper(ret).Handle;\n\t\t\t\t\t\tWindowPlacement.SetPlacement(winHandle, WindowPlacement.GetPlacement(winHandle));\n\t\t\t\t\t});\n\n\t\t\tret.Closing += (s, a) =>\n\t\t\t{\n\t\t\t\tmodel.Closed.Execute.Take(1).Subscribe(e => e());\n\t\t\t\tExitIfLastVisibleWindow(ret);\n\t\t\t};\n\n\t\t\tret.IsVisibleChanged += (s, a) =>\n\t\t\t{\n\t\t\t\tif (ret.IsVisible == false)\n\t\t\t\t\tExitIfLastVisibleWindow(ret);\n\t\t\t};\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tstatic void ExitIfLastVisibleWindow(System.Windows.Window ret)\n\t\t{\n\t\t\tforeach (var windowObject in System.Windows.Application.Current.Windows)\n\t\t\t{\n\t\t\t\tvar window = windowObject as System.Windows.Window;\n\t\t\t\tif (window == null ||\n\t\t\t\t\t    window.GetType().Namespace.StartsWith(\"Microsoft.\") ||\n\t\t\t\t\t    window.Title == \"Console output\")\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (window != ret && window is OverlayWindow == false && window.IsVisible)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tFusion.Application.Exit(0);\n\t\t}\n\n\t\tstatic void Print(object content, int indentation)\n\t\t{\n\t\t\tConsole.WriteLine(new string(' ', indentation) + content);\n\n\t\t\tvar fe = content as Panel;\n\t\t\tif (fe == null)\n\t\t\t\treturn;\n\n\t\t\tforeach (var child in fe.Children)\n\t\t\t\tPrint(child, indentation + 1);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/fusion/win/WindowPlacement.cs",
    "content": "﻿using System;\nusing System.Runtime.InteropServices;\n\nnamespace Outracks.Fusion.Windows\n{\n\t[StructLayout(LayoutKind.Sequential)]\n\tpublic struct RECT\n\t{\n\t\tpublic int Left;\n\t\tpublic int Top;\n\t\tpublic int Right;\n\t\tpublic int Bottom;\n\n\t\tpublic RECT(int left, int top, int right, int bottom)\n\t\t{\n\t\t\tLeft = left;\n\t\t\tTop = top;\n\t\t\tRight = right;\n\t\t\tBottom = bottom;\n\t\t}\n\t}\n\n\t[StructLayout(LayoutKind.Sequential)]\n\tpublic struct POINT\n\t{\n\t\tpublic int X;\n\t\tpublic int Y;\n\n\t\tpublic POINT(int x, int y)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t}\n\t}\n\n\t[StructLayout(LayoutKind.Sequential)]\n\tpublic struct WINDOWPLACEMENT\n\t{\n\t\tpublic int Length;\n\t\tpublic int Flags;\n\t\tpublic int ShowCmd;\n\t\tpublic POINT MinPosition;\n\t\tpublic POINT MaxPosition;\n\t\tpublic RECT NormalPosition;\n\t}\n\n\tpublic static class WindowPlacement\n\t{\n\t\t[DllImport(\"user32.dll\")]\n\t\tprivate static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl);\n\n\t\t[DllImport(\"user32.dll\")]\n\t\tprivate static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);\n\n\t\tprivate const int SW_SHOWNORMAL = 1;\n\t\tprivate const int SW_SHOWMINIMIZED = 2;\n\n\t\tpublic static void SetPlacement(IntPtr windowHandle, WINDOWPLACEMENT winPlacement)\n\t\t{\n\t\t\twinPlacement.Length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));\n\t\t\twinPlacement.Flags = 0;\n\t\t\twinPlacement.ShowCmd = (winPlacement.ShowCmd == SW_SHOWMINIMIZED ? SW_SHOWNORMAL : winPlacement.ShowCmd);\n\t\t\tSetWindowPlacement(windowHandle, ref winPlacement);\n\t\t}\n\n\t\tpublic static WINDOWPLACEMENT GetPlacement(IntPtr windowHandle)\n\t\t{\n\t\t\tWINDOWPLACEMENT placement;\n\t\t\tGetWindowPlacement(windowHandle, out placement);\n\t\t\treturn placement;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WindowWithOverlays.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Windows.Input;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class WindowWithOverlays : DpiAwareWindow\n\t{\n\t\treadonly BehaviorSubject<IImmutableList<Tuple<HotKey, System.Windows.Controls.MenuItem, ICommand>>> _bindings = new BehaviorSubject<IImmutableList<Tuple<HotKey, System.Windows.Controls.MenuItem, ICommand>>>(ImmutableList<Tuple<HotKey, System.Windows.Controls.MenuItem, ICommand>>.Empty);\n\n\t\tpublic WindowWithOverlays()\n\t\t{\n\t\t\tvar hostWindow = this;\n\t\t\thostWindow._bindings.ObserveOn(Fusion.Application.MainThread).SubscribeUsing(binding => hostWindow.Bind(binding));\n\t\t}\n\n\t\tpublic IDisposable AddOverlay(string name, WindowWithOverlays overlayWindow = null, int zIndex = 0)\n\t\t{\n\t\t\tvar hostWindow = this;\n\t\t\treturn Disposable.Combine(\n\t\t\t\toverlayWindow == null\n\t\t\t\t\t? Disposable.Empty\n\t\t\t\t\t: hostWindow._bindings.ObserveOn(Fusion.Application.MainThread).SubscribeUsing(overlayWindow.Bind),\n\t\t\t\toverlayWindow == null\n\t\t\t\t\t? Disposable.Empty\n\t\t\t\t\t: overlayWindow._bindings.ObserveOn(Fusion.Application.MainThread).SubscribeUsing(hostWindow.Bind));\n\t\t}\n\n\t\tpublic IDisposable AddInputBinding(\n\t\t\tHotKey hotkey,\n\t\t\tSystem.Windows.Controls.MenuItem item,\n\t\t\tICommand command)\n\t\t{\n\t\t\tvar binding = Tuple.Create(hotkey, item, command);\n\t\t\t_bindings.OnNext(_bindings.Value.Add(binding));\n\t\t\treturn Disposable.Create(() => _bindings.OnNext(_bindings.Value.Remove(binding)));\n\t\t}\n\n\t\tIDisposable Bind(IImmutableList<Tuple<HotKey, System.Windows.Controls.MenuItem, ICommand>> bindings)\n\t\t{\n\t\t\treturn Disposable.Combine(\n\t\t\t\tbindings.Select(\n\t\t\t\t\targs =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hotkey = args.Item1;\n\t\t\t\t\t\tvar item = args.Item2;\n\t\t\t\t\t\tvar command = args.Item3;\n\n\t\t\t\t\t\tvar binding = new InputBinding(command, hotkey.ToWpfGesture());\n\t\t\t\t\t\titem.InputGestureText = ((KeyGesture)binding.Gesture).DisplayString;\n\n\t\t\t\t\t\tInputBindings.Add(binding);\n\t\t\t\t\t\treturn Disposable.Create(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tInputBindings.Remove(binding);\n\t\t\t\t\t\t});\n\t\t\t\t\t}));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WindowsMenuBuilder.cs",
    "content": "﻿using System;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class WindowsMenuBuilder\n\t{\n\t\tpublic static IDisposable PopulateContextMenu(Menu menu, System.Windows.Controls.ContextMenu contextMenu, WindowWithOverlays inputBindings, IScheduler dispatcher)\n\t\t{\n\t\t\treturn CreateSubMenu(menu, contextMenu.Items, inputBindings, dispatcher, false);\n\t\t}\n\n\t\tpublic static IDisposable Populate(Menu menu, System.Windows.Controls.Menu mainMenu, WindowWithOverlays inputBindings, IScheduler dispatcher)\n\t\t{\n\t\t\treturn CreateSubMenu(menu, mainMenu.Items, inputBindings, dispatcher, false);\n\t\t}\n\n\t\tpublic static System.Windows.Controls.Control CreateItem(MenuItem item, WindowWithOverlays inputBindings, IScheduler dispatcher, bool applyStyle)\n\t\t{\n\t\t\tif (item.IsSeparator)\n\t\t\t\treturn new Separator();\n\n\t\t\tvar menuItem = new System.Windows.Controls.MenuItem();\n\t\t\tif (applyStyle)\n\t\t\t\tmenuItem.Foreground = Brushes.Black;\n\n\t\t\tAction click = () => { };\n\t\t\tmenuItem.Click += (s, a) => click();\n\t\t\tmenuItem.Tag =\n\t\t\t\tDisposable.Combine(\n\t\t\t\t\titem.Menu.Select(submenu => CreateSubMenu(submenu, menuItem.Items, inputBindings, dispatcher, true)).Or(Disposable.Empty),\n\t\t\t\t\titem.Command.Action.CombineLatest(item.Name).ObserveOn(dispatcher).SubscribeUsing(cmdName =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cmd = cmdName.Item1;\n\t\t\t\t\t\tvar name = cmdName.Item2;\n\t\t\t\t\t\tvar command = new WpfCommand(cmd);\n\t\t\t\t\t\tmenuItem.Header = name;\n\t\t\t\t\t\tmenuItem.Command = command;\n\t\t\t\t\t\treturn item.Hotkey != HotKey.None && inputBindings != null\n\t\t\t\t\t\t\t? inputBindings.AddInputBinding(item.Hotkey, menuItem, command)\n\t\t\t\t\t\t\t: Disposable.Empty;\n\t\t\t\t\t}),\n\t\t\t\t\titem.IsToggled.Subscribe(isToggled =>\n\t\t\t\t\t{\n\t\t\t\t\t\tdispatcher.Schedule(() => { menuItem.IsChecked = isToggled; });\n\t\t\t\t\t}));\n\t\t\treturn menuItem;\n\t\t}\n\n\t\tstatic IDisposable CreateSubMenu(Menu menu, ItemCollection nativeMenu, WindowWithOverlays inputBindings, IScheduler dispatcher, bool applyStyle)\n\t\t{\n\t\t\treturn menu.Items\n\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t.UnsafeAsObservableList()\n\t\t\t\t.Select(item => CreateItem(item, inputBindings, dispatcher, applyStyle))\n\t\t\t\t.DisposeElements(item => item.Tag as IDisposable ?? Disposable.Empty)\n\t\t\t\t.Subscribe(change => change.ApplyLegacy(nativeMenu));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WindowsTrayApplication.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class WindowsTrayApplication : ITrayApplication\n\t{\n\t\treadonly BalloonNotifier _notifier;\n\t\treadonly NotifyIcon _notifyIcon;\n\t\treadonly System.Windows.Threading.Dispatcher _scheduler;\n\n\t\tpublic WindowsTrayApplication(IObservable<string> title, Menu menu, IObservable<Icon> icon)\n\t\t{\n\t\t\tSystem.Windows.Forms.Application.EnableVisualStyles();\n\t\t\tSystem.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);\n\n\t\t\tvar container = new Container();\n\t\t\t_notifyIcon = new NotifyIcon(container)\n\t\t\t{\n\t\t\t\tContextMenu = new System.Windows.Forms.ContextMenu()\n\t\t\t};\n\n\t\t\t_scheduler = System.Windows.Threading.Dispatcher.CurrentDispatcher;\n\n\t\t\t_notifier = new BalloonNotifier(_notifyIcon, _scheduler);\n\n\t\t\tUserClicked =\n\t\t\t\tObservable.Merge(\n\t\t\t\t\tDataBinding.ObservableFromNativeEvent<MouseEventArgs>(_notifyIcon, \"MouseDoubleClick\"),\n\t\t\t\t\tDataBinding.ObservableFromNativeEvent<MouseEventArgs>(_notifyIcon, \"MouseClick\"))\n\t\t\t\t.Where(a => a.Button != MouseButtons.Right)\n\t\t\t\t.Select(a => a.Clicks);\n\n\t\t\t_notifyIcon.Visible = true;\n\n\t\t\tif (menu != default(Menu))\n\t\t\t{\n\t\t\t\t_notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();\n\t\t\t\tWinFormMenuBuilder.Populate(menu, _notifyIcon.ContextMenu);\n\t\t\t}\n\n\t\t\tif (icon != null)\n\t\t\t\ticon.ObserveOn(_scheduler).Subscribe(i =>\n\t\t\t\t{\n\t\t\t\t\tusing (var stream = i.GetStream())\n\t\t\t\t\t\t_notifyIcon.Icon = new System.Drawing.Icon(stream);\n\t\t\t\t});\n\n\t\t\tif (title != null)\n\t\t\t\ttitle.ObserveOn(_scheduler).Subscribe(t => _notifyIcon.Text = t);\n\t\t}\n\n\t\tpublic IObservable<int> UserClicked { get; private set; }\n\n\t\tpublic async Task<NotificationFeedback> Show(Notification notification)\n\t\t{\n\t\t\tif (_notifier == null)\n\t\t\t\tthrow new InvalidOperationException(\"Application have not been started yet\");\n\n\t\t\treturn await _notifier.Show(notification);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_scheduler.InvokeAsync(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\t_notifier.Dispose();\n\t\t\t\t\t_notifyIcon.Dispose();\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/fusion/win/WpfCommand.cs",
    "content": "using System;\nusing System.Windows.Input;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class WpfCommand : ICommand\n\t{\n\t\treadonly Optional<Action> _execute;\n\n\t\tpublic WpfCommand(Optional<Action> handler)\n\t\t{\n\t\t\t_execute = handler;\n\t\t}\n\n\t\tpublic bool CanExecute(object parameter)\n\t\t{\n\t\t\treturn _execute.HasValue;\n\t\t}\n\n\t\tpublic void Execute(object parameter)\n\t\t{\n\t\t\t_execute.Do(x => x());\n\t\t}\n#pragma warning disable\n\t\tpublic event EventHandler CanExecuteChanged;\n#pragma warning restore\n\t}\n}"
  },
  {
    "path": "src/fusion/win/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"AvalonEdit\" version=\"6.0.1\" targetFramework=\"net45\" />\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"Ookii.Dialogs.Wpf\" version=\"3.0.1\" targetFramework=\"net46\" />\n  <package id=\"SharpDX\" version=\"4.2.0\" targetFramework=\"net46\" />\n  <package id=\"SharpDX.Direct3D9\" version=\"4.2.0\" targetFramework=\"net46\" />\n  <package id=\"SharpDX.Mathematics\" version=\"4.2.0\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/mac/logserver/.gitignore",
    "content": "*.swp\na.out\nclient\nfuse-logserver\ntest-client\n"
  },
  {
    "path": "src/mac/logserver/Makefile",
    "content": "CC=g++\nCFLAGS=-std=c++0x -Wall -Wextra -Weffc++ \nall: main.cpp socketserver.cpp logger.cpp singleproc.cpp\n\t$(CC) $(CFLAGS) main.cpp socketserver.cpp logger.cpp singleproc.cpp -o fuse-logserver\n\ntest-client: testclient.cpp\n\t$(CC) $(CFLAGS) testclient.cpp -o test-client\n"
  },
  {
    "path": "src/mac/logserver/logger.cpp",
    "content": "#include \"logger.h\"\n#include <iostream>\n#include <cstdio>\n#include <sys/stat.h>\n\nusing namespace std;\n\nLogger::Logger(string filename, size_t max_file_size, unsigned int backup_count) :\n\tfilename(filename), max_file_size(max_file_size), backup_count(backup_count)\n{\n\tcout << \"Logging to '\" << filename << \"'\" << endl;\n\topen();\n}\n\nvoid Logger::open()\n{\n\tensure_dir_exists();\n\tlogfile.open(filename, ofstream::app);\n}\n\nvoid Logger::log(std::string content)\n{\n\tensure_file_exists();\n\tpossibly_rotate(content.length());\n\tif (content.length() + 2 < max_file_size)\n\t{\n\t\tlogfile << content << endl;\n\t}\n\telse\n\t{\n\t\tlogfile.write(content.c_str(), max_file_size - 6);\n\t\tlogfile << \"(..)\" << endl;\n\t}\n}\n\nvoid Logger::possibly_rotate(size_t pending_content_length)\n{\n\tstruct stat stat_buf = stat_or_throw(filename);\n\tif (stat_buf.st_size + pending_content_length > max_file_size)\n\t{\n\t\tlogfile.close();\n\t\trotate();\n\t\topen();\n\t}\n}\n\nstruct stat Logger::stat_or_throw(const string& filename) const\n{\n\tstruct stat stat_buf;\n\tint rc = stat(filename.c_str(), &stat_buf);\n\tif (rc != 0)\n\t{\n\t\tthrow runtime_error(string(\"Could not stat '\" + filename + \"': \" + strerror(errno)));\n\t}\n\treturn stat_buf;\n}\n\nvoid Logger::rotate() const\n{\n\tfor(int i = backup_count-1; i > 0; i--)\n\t{\n\t\trename_if_exists(filename + \".\" + to_string(i), filename + \".\" + to_string(i + 1));\n\t}\n\trename_if_exists(filename, filename + \".1\");\n}\n\nvoid Logger::rename_if_exists(const std::string& old_name, const std::string& new_name) const\n{\n\tif (exists(old_name))\n\t{\n\t\tif (rename(old_name.c_str(), new_name.c_str()) != 0)\n\t\t{\n\t\t\tthrow runtime_error(string(\"Could not rename '\" + old_name + \"' to '\" + new_name + \"': \" + strerror(errno)));\n\t\t}\n\t}\n}\n\nbool Logger::exists(const std::string& name) const\n{\n\tstruct stat stat_buf;\n\tint rc = stat(name.c_str(), &stat_buf);\n\tif (rc == 0)\n\t{\n\t\treturn true;\n\t}\n\tif (errno == ENOENT)\n\t{\n\t\treturn false;\n\t}\n\tthrow runtime_error(string(\"Could not get stat of '\" + name + \"': \" + strerror(errno)));\n}\n\nvoid Logger::ensure_file_exists()\n{\n\tif (!exists(filename))\n\t{\n\t\tcout << \"Log file '\" << filename << \"' went away, re-opening.\" << endl;\n\t\ttry\n\t\t{\n\t\t\tlogfile.close();\n\t\t}\n\t\tcatch(...)\n\t\t{\n\t\t}\n\t\topen();\n\t}\n}\n\nvoid Logger::ensure_dir_exists()\n{\n\t#if defined(WIN32) || defined(_WIN32)\n\t#define PATH_SEPARATOR \"\\\\\"\n\t#else\n\t#define PATH_SEPARATOR \"/\"\n\t#endif\n\tstring logdir = filename.substr(0, filename.find_last_of(PATH_SEPARATOR));\n\tif (mkdir(logdir.c_str(), 0755) != 0)\n\t{\n\t\tif (errno != EEXIST)\n\t\t{\n\t\t\tthrow runtime_error(string(\"Could not create '\" + logdir + \"': \" + strerror(errno)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/mac/logserver/logger.h",
    "content": "#ifndef LOGGER_H\n#define LOGGER_H\n#include <string>\n#include <fstream>\n\nclass Logger\n{\npublic:\n\tLogger(std::string filename, size_t max_file_size, unsigned int backup_count);\n\n\tvoid log(std::string content);\nprivate:\n\tstd::string filename;\n\tsize_t max_file_size;\n\tunsigned int backup_count;\n\tstd::ofstream logfile;\n\n\tvoid open();\n\tvoid possibly_rotate(size_t pending_content_length);\n\tvoid rotate() const;\n\tvoid rename_if_exists(const std::string& old_name, const std::string& new_name) const;\n\tbool exists(const std::string& name) const;\n\tstruct stat stat_or_throw(const std::string& filename) const;\n\tvoid ensure_file_exists();\n\tvoid ensure_dir_exists();\n};\n#endif\n"
  },
  {
    "path": "src/mac/logserver/main.cpp",
    "content": "#include <iostream>\n#include <stdexcept>\n#include <pwd.h>\n#include <signal.h>\n\n#include \"logger.h\"\n#include \"socketserver.h\"\n#include \"singleproc.h\"\n\nusing std::cerr;\nusing std::cout;\nusing std::endl;\nusing std::string;\nusing std::runtime_error;\nusing std::exception;\nusing std::chrono::seconds;\n\nstring home();\nstring log_name(int argc, const char* const argv[]);\nstring socket_name();\nstring socket_name(int argc, const char* const argv[]);\nvoid set_signal_handler();\nvoid signaled(int signal);\n\nbool terminate = false;\n\nint main(int argc, char* argv[])\n{\n\ttry\n\t{\n\t\tif (!acquire_lock(socket_name() + \".pid\", seconds(2)))\n\t\t{\n\t\t\tcout << \"A log server is already running\" << endl;\n\t\t\treturn 1;\n\t\t}\n\t\tif (argc == 1)\n\t\t{\n\t\t\t//Using production settings\n\t\t}\n\t\telse if (argc == 3)\n\t\t{\n\t\t\tcout << \"WARNING: Using settings meant for testing only!\" << endl;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow runtime_error(\"This command takes no parameters\"); //None that you should know about, anyway\n\t\t}\n\t\tset_signal_handler();\n\t\tconst off_t max_file_size(500000);\n\t\tconst unsigned int backup_count(5);\n\t\tLogger logger(log_name(argc, argv), max_file_size, backup_count);\n\t\tSocketServer server(socket_name(argc, argv), logger);\n\t\twhile(!terminate)\n\t\t{\n\t\t\tserver.receive();\n\t\t}\n\t}\n\tcatch (const runtime_error& e)\n\t{\n\t\tcerr << \"ERROR: \" << e.what() << endl;\n\t\treturn 2;\n\t}\n\tcatch (const exception& e)\n\t{\n\t\tcerr << \"ERROR: An unknown exception occured\" << endl;\n\t\treturn 2;\n\t}\n\tcout << \"Logserver stopped gracefully\" << endl;\n}\n\nstring home()\n{\n\tconst char* homedir;\n\n\tif ((homedir = getenv(\"HOME\")) == NULL) {\n\t\thomedir = getpwuid(getuid())->pw_dir;\n\t}\n\treturn string(homedir);\n}\n\nstring log_name(int argc, const char* const argv[])\n{\n\tif (argc == 3)\n\t{\n\t\treturn argv[2];\n\t}\n\telse\n\t{\n\t\treturn home() + \"/.fuse/logs/fuse.log\";\n\t}\n}\n\nstring socket_name()\n{\n\treturn home() + \"/.fuse/logserver\";\n}\n\nstring socket_name(int argc, const char* const argv[])\n{\n\tif (argc == 3)\n\t{\n\t\treturn argv[1];\n\t}\n\telse\n\t{\n\t\treturn socket_name();\n\t}\n}\n\nvoid set_signal_handler()\n{\n\tstruct sigaction call_signaled;\n\tcall_signaled.sa_handler = signaled;\n\tsigemptyset(&call_signaled.sa_mask);\n\tcall_signaled.sa_flags = 0;\n\tif (sigaction(SIGINT, &call_signaled, 0) != 0)\n\t{\n\t\tthrow runtime_error(string(\"Could not set signal handler: \") + strerror(errno));\n\t}\n}\n\nvoid signaled(int)\n{\n\tterminate = true;\n}\n"
  },
  {
    "path": "src/mac/logserver/singleproc.cpp",
    "content": "#include <iostream>\n#include <stdexcept>\n#include <thread>\n#include <chrono>\n#include <sys/types.h>\n#include <unistd.h>\n#include <pwd.h>\n#include <stdio.h>\n#include <signal.h>\n#include <libproc.h>\n\nusing namespace std;\nusing namespace std::chrono;\n\nnamespace {\n\tbool is_running(pid_t pid);\n\tstring get_path(int pid);\n\tbool atomically_create_lock_file(const string& lockfilename, int my_pid);\n\tint try_read_pid_from(const string& lockfilename);\n\tvoid unlink_if_exists(const string& lockfilename);\n\tvoid remove_lock_file_if_needed(const string& lockfilename, const string& path_to_this_program);\n}\n\nbool acquire_lock(const string& lockfilename, seconds timeout)\n{\n\tpid_t my_pid = getpid();\n\tcout << \"Trying to lock \" << lockfilename << endl;\n\n\tauto start = high_resolution_clock::now();\n\twhile (duration_cast<seconds>(high_resolution_clock::now()-start) < timeout)\n\t{\n\t\tif (atomically_create_lock_file(lockfilename, my_pid))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tremove_lock_file_if_needed(lockfilename, get_path(my_pid));\n\t\tthis_thread::sleep_for(chrono::milliseconds(100));\n\t}\n\treturn false;\n}\n\nnamespace {\n\n\tclass no_such_process : public runtime_error\n\t{\n\tpublic:\n\t\tno_such_process(const string& what_arg) : runtime_error(what_arg){}\n\t};\n\n\t//Atomically tries to create a file lockfilename, and writes my_pid to it\n\t//Returns true if it could do that, false if the file already exits\n\t//In any other error case it throws runtime_error\n\tbool atomically_create_lock_file(const string& lockfilename, int my_pid)\n\t{\n\t\tFILE* fd = fopen(lockfilename.c_str(), \"wx\");\n\t\tif (fd != NULL)\n\t\t{\n\t\t\tif(fprintf(fd, \"%d\", my_pid) < 0)\n\t\t\t{\n\t\t\t\tfclose(fd);\n\t\t\t\tthrow runtime_error(\"Could not write to file file '\" + lockfilename + \"': \" + strerror(errno));\n\t\t\t}\n\t\t\tfclose(fd);\n\t\t\tcout << \"Created lock file for process \" << my_pid << endl;\n\t\t\treturn true;\n\t\t}\n\t\telse if (errno == EEXIST)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tthrow runtime_error(\"Could not open file '\" + lockfilename+ \"': \" + strerror(errno));\n\t}\n\n\t//Deletes lockfilename if it contains a pid that's not currently running,\n\t//a pid that belongs to another program than ourself, or if the file is corrupt.\n\tvoid remove_lock_file_if_needed(const string& lockfilename, const string& path_to_this_program)\n\t{\n\t\tint pid = try_read_pid_from(lockfilename);\n\t\tif (pid > 0)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!is_running(pid) || (get_path(pid) != path_to_this_program))\n\t\t\t\t{\n\t\t\t\t\tunlink_if_exists(lockfilename);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(const no_such_process&)\n\t\t\t{\n\t\t\t\t//Process went away in the mean time\n\t\t\t\tunlink_if_exists(lockfilename);\n\t\t\t}\n\t\t}\n\t\telse if(pid == -2) //File is corrupt, delete it\n\t\t{\n\t\t\tcout << \"Deleting corrupted lock file '\" << lockfilename << \"'\" << endl;\n\t\t\tunlink_if_exists(lockfilename);\n\t\t}\n\t}\n\n\t//Tries to read a pid from the file lockfilename\n\t//Returns the pid if successfull, -1 if it can't open the file, -2 if it can't read the file\n\tint try_read_pid_from(const string& lockfilename)\n\t{\n\t\tFILE* fd2 = fopen(lockfilename.c_str(), \"r\");\n\t\tif (fd2 == NULL)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\tint pid;\n\t\tif (fscanf(fd2, \"%d\", &pid) != 1)\n\t\t{\n\t\t\tfclose(fd2);\n\t\t\treturn -2;\n\t\t}\n\t\tfclose(fd2);\n\t\treturn pid;\n\t}\n\n\t//Checks if process pid is running.\n\t//Throws runtime_error if the process is running but can't be signaled, if it is owned by another user\n\tbool is_running(pid_t pid)\n\t{\n\t\tif (kill(pid,0) == 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if (errno != ESRCH)\n\t\t{\n\t\t\tthrow runtime_error(\"Could not signal existing process \" + to_string(pid));\n\t\t}\n\t\treturn false;\n\t}\n\n\t//Gets the full path for process pid\n\t//Throws no_such_process if is unable to do so, for instance if process pid no longer exists\n\tstring get_path(int pid)\n\t{\n\t\tchar pathbuf[PROC_PIDPATHINFO_MAXSIZE];\n\t\tif(proc_pidpath (pid, pathbuf, sizeof(pathbuf)) <0)\n\t\t{\n\t\t\tthrow no_such_process(\"Could not get path of process \" + to_string(pid) + \": \" + strerror(errno));\n\t\t}\n\t\treturn string(pathbuf);\n\t}\n\n\t//Unlinks lockfilename if it exists\n\t//If the file exists, but can't be unlinked, throws runtime_error\n\tvoid unlink_if_exists(const string& lockfilename)\n\t{\n\t\tcout << \"Deleting '\" << lockfilename << \"'\" << endl;\n\t\tif (unlink(lockfilename.c_str()) != 0 && errno != ENOENT)\n\t\t{\n\t\t\tthrow new runtime_error(\"Couldn't delete '\" + lockfilename + \"': \" + strerror(errno));\n\t\t}\n\t}\n}\n\n/* int main() */\n/* { */\n/*\t   string lockfilename = socket_name() + \".pid\"; */\n/*\t   bool got_it = acquire_lock(lockfilename); */\n/*\t   cout << \"Lock acquired?\" << got_it << endl; */\n/*\t   while (true); */\n/* } */\n"
  },
  {
    "path": "src/mac/logserver/singleproc.h",
    "content": "#pragma once\n#include <string>\n\nbool acquire_lock(const std::string& lockfilename, std::chrono::seconds timeout);\n"
  },
  {
    "path": "src/mac/logserver/socketserver.cpp",
    "content": "#include <string>\n#include <iostream>\n#include <stdexcept>\n#include <sys/socket.h>\n#include <sys/un.h>\n\n#include \"socketserver.h\"\n\nusing std::cout;\nusing std::cerr;\nusing std::endl;\nusing std::string;\nusing std::runtime_error;\nusing std::exception;\n\nstatic sockaddr_un server_address(const string& socket_name);\n\nSocketServer::SocketServer(string name, Logger& logger) : name(name), logger(logger)\n{\n\tcout << \"Starting logserver on '\" << name << \"'\" << endl;\n\tvalidate_name();\n\tcreate_socket();\n\tbind_socket();\n\tset_timeout(std::chrono::milliseconds(100));\n\tcout << \"Logserver successfully started\" << endl;\n}\n\nvoid SocketServer::receive()\n{\n\tsocklen_t _;\n\tint bytes_received = recvfrom(fd, &buffer, buffer_size, 0, 0, &_);\n\tif (bytes_received == -1 )\n\t{\n\t\tif (errno == EINTR)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tif (errno != EWOULDBLOCK)\n\t\t{\n\t\t\tthrow runtime_error(string(\"Couldn't recvfrom: \") + strerror(errno));\n\t\t}\n\t}\n\telse\n\t{\n\t\tlogger.log(string(buffer, bytes_received));\n\t}\n}\n\nvoid SocketServer::validate_name() const\n{\n\tsocklen_t address_length = sizeof(struct sockaddr_un);\n\n\tif (name.length() + 1 > address_length)\n\t{\n\t\tthrow runtime_error(\"Invalid socket name. '\" + name + \"' is longer than \" + std::to_string(address_length -1) + \" characters.\");\n\t}\n}\n\nvoid SocketServer::create_socket()\n{\n\tif ((fd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0)\n\t{\n\t\tthrow runtime_error(string(\"Could not create socket: \") + strerror(errno));\n\t}\n}\n\nvoid SocketServer::bind_socket()\n{\n\tcout << \"Binding to socket '\" << name << \"'\" << endl;\n\tsockaddr_un address = server_address(name);\n\tif (unlink(name.c_str()) < 0)\n\t{\n\t\tif (errno != ENOENT)\n\t\t{\n\t\t\tthrow runtime_error(\"Couldn't unlink socket '\" + name + \"'\");\n\t\t}\n\t}\n\tif (bind(fd, (const sockaddr *) &address, sizeof(address)) < 0)\n\t{\n\t\tclose(fd);\n\t\tthrow runtime_error(\"Couldn't bind socket '\" + name + \"': \" + strerror(errno));\n\t}\n}\n\nvoid SocketServer::set_timeout(std::chrono::milliseconds timeout)\n{\n\tconst auto sec = std::chrono::duration_cast<std::chrono::seconds>(timeout);\n\ttimeval tv;\n\ttv.tv_sec = sec.count();\n\ttv.tv_usec = std::chrono::duration_cast<std::chrono::microseconds>(timeout - sec).count();\n\tif (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(timeval)) < 0)\n\t{\n\t\tthrow runtime_error(\"Couldn't set socket timeout\");\n\t}\n}\n\nstatic sockaddr_un server_address(const string& socket_name)\n{\n\tsockaddr_un address;\n\tmemset(&address, 0, sizeof(address));\n\taddress.sun_family = AF_UNIX;\n\tstrcpy(address.sun_path, socket_name.c_str());\n\treturn address;\n}\n"
  },
  {
    "path": "src/mac/logserver/socketserver.h",
    "content": "#ifndef SOCKETSERVER_H\n#define SOCKETSERVER_H\n#include \"logger.h\"\n\nclass SocketServer\n{\npublic:\n\tSocketServer(std::string name, Logger& logger);\n\tvoid receive();\n\nprivate:\n\tvoid validate_name() const;\n\tvoid create_socket();\n\tvoid bind_socket();\n\tvoid set_timeout(std::chrono::milliseconds timeout);\n\n\tconst std::string name;\n\tint fd;\n\tLogger& logger;\n\tstatic const std::size_t buffer_size = 100000;\n\tchar buffer[buffer_size];\n};\n#endif\n"
  },
  {
    "path": "src/mac/logserver/test.sh",
    "content": "#!/bin/bash\nset -e\n\nSOCKET_NAME=/tmp/fuse-logserver.socket\nLOG_FILE=/tmp/fuse-logserver.log\nNOF_PROCESSES=40\nCALLS_PER_PROCESS=1000\nSLEEP=5\n\nNOF_LINES=$((NOF_PROCESSES * CALLS_PER_PROCESS))\n\necho\necho -e \"\\033[0;35mRunning test with $NOF_PROCESSES processes sending $CALLS_PER_PROCESS calls each, for a total of $NOF_LINES. Sleeping $SLEEP ms. between each call\\033[0m\"\necho\n\nmake\nmake test-client\n\nrm -f $LOG_FILE $SOCKET_NAME\necho \"Starting logserver\"\n./fuse-logserver $SOCKET_NAME $LOG_FILE &\nPID=$!\nsleep 1 #TODO wait for socket to open\necho \"Starting test client\"\n./test-client $SOCKET_NAME ohai $CALLS_PER_PROCESS $NOF_PROCESSES $SLEEP\necho \"Killing logserver\"\nkill -2 $PID\n\nLINES=$(grep ohai $LOG_FILE | wc -l | awk '{print $1}')\nPROCESSES=$(sort $LOG_FILE | uniq | wc -l | awk '{print $1}')\n\nif [ \"$LINES\" -ne $NOF_LINES ]; then\n    echo\n    echo -e \"\\033[0;31mERROR: Expeced $NOF_LINES lines, got $LINES\\033[0m\"\n    echo\n\texit 1\nfi\n\nif [ \"$PROCESSES\" -ne $NOF_PROCESSES ]; then\n    echo\n    echo -e \"\\033[0;31mERROR: Expeced $NOF_PROCESSES processes, got $PROCESSES\\033[0m\"\n    echo\n\texit 1\nfi\n\necho\necho -e \"\\033[0;32mSUCCESS!\\033[0m\"\necho\n"
  },
  {
    "path": "src/mac/logserver/testclient.cpp",
    "content": "#include <string>\n#include <vector>\n#include <iostream>\n#include <chrono>\n#include <thread>\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <sys/un.h>\n#include <stdio.h>\n#include <string.h>\n#include <unistd.h>\n#include <sys/wait.h>\n\nusing namespace std;\nusing std::chrono::milliseconds;\n\nint log_to(string socket, string content);\nint log_to(string socket, string content, int nof_times, milliseconds sleep);\n\nint main(int argc, char *argv[])\n{\n\tif (argc != 6)\n\t{\n\t\tcerr << \"USAGE : \" << argv[0] << \" <socket name> <string to log> <times to log per process> <number of processes> <sleep (ms) between log call>\" << endl;\n\t\treturn 1;\n\t}\n\n\tstring socket_name(argv[1]);\n\tstring content(argv[2]);\n\tint nof_times(atoi(argv[3]));\n\tint nof_procs(atoi(argv[4]));\n\tint sleep(atoi(argv[5]));\n\n\tif (nof_procs == 1)\n\t{\n\t\treturn log_to(socket_name, content, nof_times, milliseconds(sleep));\n\t}\n\n\tstd::vector<pid_t> pids(nof_procs);\n\tfor(std::vector<pid_t>::size_type i = 0; i < pids.size(); i++)\n\t{\n\t\tpid_t pid = fork();\n\t\tif (pid > 0)\n\t\t{\n\t\t\tpids[i] = pid;\n\t\t}\n\t\telse if (pid == 0)\n\t\t{\n\t\t\treturn log_to(socket_name, content, nof_times, milliseconds(sleep));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcerr << \"Unable to fork!\" << endl;\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tbool failed = false;\n\tfor(const auto& pid : pids)\n\t{\n\t\tint status;\n\t\tpid_t result = waitpid(pid, &status, 0);\n\t\tif (result == -1)\n\t\t{\n\t\t\tcerr << \"Error waiting for '\" << pid << \"': Result '\" << result << \"', error '\" << strerror(errno) << \"'\" << endl;\n\t\t\tfailed = true;\n\t\t}\n\t\tif (!WIFEXITED(status))\n\t\t{\n\t\t\tcerr << \"Error in pid '\" << pid << \"', it didn't stop normally\" << endl;\n\t\t\tfailed = true;\n\t\t}\n\t\tif (WEXITSTATUS(status))\n\t\t{\n\t\t\tcerr << \"Error in pid '\" << pid << \"', exited with status '\" << WEXITSTATUS(status) << \"'\" << endl;\n\t\t\tfailed = true;\n\t\t}\n\t}\n\treturn int(failed);\n}\n\nint log_to(string socket_name, string content, int nof_times, milliseconds sleep)\n{\n\tint result = 0;\n\tfor (int i = 0; i < nof_times; i++)\n\t{\n\t\tif (sleep > milliseconds(0))\n\t\t{\n\t\t\tthis_thread::sleep_for(sleep);\n\t\t}\n\t\tif((result = log_to(socket_name, content)) != 0)\n\t\t{\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn 0;\n}\n\nint log_to(string socket_name, string content)\n{\n\tstruct sockaddr_un name;\n\n\t/* Create socket on which to send. */\n\tint sock = socket(AF_UNIX, SOCK_DGRAM, 0);\n\tif (sock < 0)\n\t{\n\t\tperror(\"opening datagram socket\");\n\t\treturn 1;\n\t}\n\n\t/* Construct name of socket to send to. */\n\tname.sun_family = AF_UNIX;\n\tstrcpy(name.sun_path, socket_name.c_str());\n\n\t/* Send message. */\n\tstring message(to_string(getpid()) + \" \" + content);\n\tif (sendto(sock, message.c_str(), message.length(), 0, (const struct sockaddr *)&name, sizeof(struct sockaddr_un)) < 0)\n\t{\n\t\tperror(\"sending datagram message\");\n\t\treturn 1;\n\t}\n\tif (close(sock) <0 )\n\t{\n\t\tperror(\"closing socket\");\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n"
  },
  {
    "path": "src/mac/menu-bar/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"filename\": \"AppIcon-16.png\",\n      \"size\": \"16x16\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-16@2x.png\",\n      \"size\": \"16x16\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-32.png\",\n      \"size\": \"32x32\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-32@2x.png\",\n      \"size\": \"32x32\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-128.png\",\n      \"size\": \"128x128\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-128@2x.png\",\n      \"size\": \"128x128\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-256.png\",\n      \"size\": \"256x256\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-256@2x.png\",\n      \"size\": \"256x256\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-512.png\",\n      \"size\": \"512x512\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-512@2x.png\",\n      \"size\": \"512x512\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    }\n  ],\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"xcode\"\n  }\n}"
  },
  {
    "path": "src/mac/menu-bar/Assets.xcassets/Contents.json",
    "content": "﻿{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "src/mac/menu-bar/Entitlements.plist",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/mac/menu-bar/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDisplayName</key>\n\t<string>fuse X (menu bar)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.fuse-x.menu-bar</string>\n\t<key>CFBundleName</key>\n\t<string>fuse X (menu bar)</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>10.10</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>CFBundleIconFile</key>\n\t<string>Fuse</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>VERSION_NUMBER</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>LSUIElement</key>\n\t<true/>\n\t<key>NSUserNotificationAlertStyle</key>\n\t<string>alert</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>© Build &amp; Run</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/mac/menu-bar/Main.cs",
    "content": "﻿using Outracks.Fusion;\n\nnamespace Outracks.Mac.MenuBarApp\n{\n\tstatic class MainClass\n\t{\n\t\tstatic void Main()\n\t\t{\n\t\t\tFuse.Tray.Program.Start(Icon.FromResource(\"Outracks.Mac.MenuBarApp.Resources.Fuse.icns\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/mac/menu-bar/MainMenu.xib",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<archive type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"7.10\">\n\t<data>\n\t\t<int key=\"IBDocument.SystemTarget\">1060</int>\n\t\t<string key=\"IBDocument.SystemVersion\">10D573</string>\n\t\t<string key=\"IBDocument.InterfaceBuilderVersion\">762</string>\n\t\t<string key=\"IBDocument.AppKitVersion\">1038.29</string>\n\t\t<string key=\"IBDocument.HIToolboxVersion\">460.00</string>\n\t\t<object class=\"NSMutableDictionary\" key=\"IBDocument.PluginVersions\">\n\t\t\t<string key=\"NS.key.0\">com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t<string key=\"NS.object.0\">762</string>\n\t\t</object>\n\t\t<object class=\"NSMutableArray\" key=\"IBDocument.EditedObjectIDs\">\n\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t<integer value=\"29\" />\n\t\t</object>\n\t\t<object class=\"NSArray\" key=\"IBDocument.PluginDependencies\">\n\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t</object>\n\t\t<object class=\"NSMutableDictionary\" key=\"IBDocument.Metadata\">\n\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t<object class=\"NSArray\" key=\"dict.sortedKeys\" id=\"0\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t</object>\n\t\t\t<object class=\"NSMutableArray\" key=\"dict.values\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t</object>\n\t\t</object>\n\t\t<object class=\"NSMutableArray\" key=\"IBDocument.RootObjects\" id=\"1048\">\n\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t<object class=\"NSCustomObject\" id=\"1021\">\n\t\t\t\t<string key=\"NSClassName\">NSApplication</string>\n\t\t\t</object>\n\t\t\t<object class=\"NSCustomObject\" id=\"1014\">\n\t\t\t\t<string key=\"NSClassName\">FirstResponder</string>\n\t\t\t</object>\n\t\t\t<object class=\"NSCustomObject\" id=\"1050\">\n\t\t\t\t<string key=\"NSClassName\">NSApplication</string>\n\t\t\t</object>\n\t\t\t<object class=\"NSMenu\" id=\"649796088\">\n\t\t\t\t<string key=\"NSTitle\">AMainMenu</string>\n\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t<object class=\"NSMenuItem\" id=\"694149608\">\n\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"649796088\" />\n\t\t\t\t\t\t<string key=\"NSTitle\">TestOutlet</string>\n\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t<object class=\"NSCustomResource\" key=\"NSOnImage\" id=\"35465992\">\n\t\t\t\t\t\t\t<string key=\"NSClassName\">NSImage</string>\n\t\t\t\t\t\t\t<string key=\"NSResourceName\">NSMenuCheckmark</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<object class=\"NSCustomResource\" key=\"NSMixedImage\" id=\"502551668\">\n\t\t\t\t\t\t\t<string key=\"NSClassName\">NSImage</string>\n\t\t\t\t\t\t\t<string key=\"NSResourceName\">NSMenuMixedState</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"110575045\">\n\t\t\t\t\t\t\t<string key=\"NSTitle\">MacCocoaApp</string>\n\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"238522557\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">About TestOutlet</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"304266470\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"609285721\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Preferences…</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">,</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"481834944\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1046388886\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Services</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"752062318\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Services</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSName\">_NSServicesMenu</string>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"646227648\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"755159360\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Hide TestOutlet</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">h</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"342932134\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Hide Others</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">h</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1572864</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"908899353\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Show All</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1056857174\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"632727374\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"110575045\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Quit TestOutlet</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">q</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t<string key=\"NSName\">_NSAppleMenu</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"NSMenuItem\" id=\"379814623\">\n\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"649796088\" />\n\t\t\t\t\t\t<string key=\"NSTitle\">File</string>\n\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"720053764\">\n\t\t\t\t\t\t\t<string key=\"NSTitle\">File</string>\n\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"705341025\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">New</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">n</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"722745758\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Open…</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">o</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1025936716\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Open Recent</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"1065607017\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Open Recent</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"759406840\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"1065607017\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Clear Menu</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSName\">_NSRecentDocumentsMenu</string>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"425164168\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"776162233\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Close</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">w</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1023925487\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Save</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">s</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"117038363\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Save As…</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">S</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1179648</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"579971712\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Revert to Saved</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1010469920\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"294629803\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Page Setup...</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">P</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1179648</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSToolTip\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"49223823\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"720053764\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Print…</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">p</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"NSMenuItem\" id=\"952259628\">\n\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"649796088\" />\n\t\t\t\t\t\t<string key=\"NSTitle\">Edit</string>\n\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"789758025\">\n\t\t\t\t\t\t\t<string key=\"NSTitle\">Edit</string>\n\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1058277027\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Undo</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">z</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"790794224\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Redo</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">Z</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1179648</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1040322652\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"296257095\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Cut</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">x</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"860595796\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Copy</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">c</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"29853731\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Paste</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">v</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"82994268\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Paste and Match Style</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">V</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1572864</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"437104165\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Delete</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"583158037\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Select All</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">a</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"212016141\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"892235320\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Find</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"963351320\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Find</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"447796847\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"963351320\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Find…</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">f</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">1</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"326711663\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"963351320\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Find Next</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">g</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">2</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"270902937\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"963351320\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Find Previous</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">G</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1179648</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">3</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"159080638\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"963351320\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Use Selection for Find</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">e</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">7</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"88285865\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"963351320\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Jump to Selection</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">j</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"972420730\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Spelling and Grammar</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"769623530\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Spelling and Grammar</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"679648819\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"769623530\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Show Spelling and Grammar</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">:</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"96193923\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"769623530\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Check Document Now</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">;</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"859480356\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"769623530\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"948374510\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"769623530\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Check Spelling While Typing</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"967646866\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"769623530\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Check Grammar With Spelling</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"795346622\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"769623530\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Correct Spelling Automatically</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"507821607\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Substitutions</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"698887838\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Substitutions</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"65139061\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"698887838\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Show Substitutions</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"19036812\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"698887838\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"605118523\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"698887838\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Smart Copy/Paste</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">f</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">1</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"197661976\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"698887838\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Smart Quotes</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">g</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">2</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"672708820\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"698887838\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Smart Dashes</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"708854459\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"698887838\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Smart Links</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">G</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1179648</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">3</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"537092702\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"698887838\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Text Replacement</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"288088188\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Transformations</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"579392910\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Transformations</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1060694897\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"579392910\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Make Upper Case</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"879586729\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"579392910\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Make Lower Case</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"56570060\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"579392910\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Capitalize</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"676164635\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"789758025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Speech</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"785027613\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Speech</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"731782645\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"785027613\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Start Speaking</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"680220178\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"785027613\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Stop Speaking</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"NSMenuItem\" id=\"302598603\">\n\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"649796088\" />\n\t\t\t\t\t\t<string key=\"NSTitle\">Format</string>\n\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"941447902\">\n\t\t\t\t\t\t\t<string key=\"NSTitle\">Format</string>\n\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"792887677\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"941447902\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Font</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"786677654\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Font</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"159677712\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Show Fonts</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">t</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"305399458\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Bold</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">b</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">2</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"814362025\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Italic</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">i</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">1</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"330926929\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Underline</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">u</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"533507878\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"158063935\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Bigger</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">+</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">3</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"885547335\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Smaller</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">-</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSTag\">4</int>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"901062459\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"767671776\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Kern</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"175441468\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Kern</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"252969304\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"175441468\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Use Default</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"766922938\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"175441468\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Use None</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"677519740\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"175441468\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Tighten</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"238351151\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"175441468\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Loosen</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"691570813\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Ligature</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"1058217995\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Ligature</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"706297211\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"1058217995\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Use Default</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"568384683\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"1058217995\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Use None</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"663508465\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"1058217995\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Use All</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"769124883\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Baseline</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"18263474\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Baseline</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"257962622\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"18263474\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Use Default</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"644725453\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"18263474\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Superscript</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1037576581\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"18263474\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Subscript</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"941806246\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"18263474\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Raise</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1045724900\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"18263474\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Lower</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"739652853\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1012600125\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Show Colors</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">C</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"214559597\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"596732606\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Copy Style</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">c</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1572864</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"393423671\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"786677654\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Paste Style</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">v</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1572864</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSName\">_NSFontMenu</string>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"215659978\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"941447902\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Text</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"446991534\">\n\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Text</string>\n\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"875092757\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Align Left</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">{</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"630155264\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Center</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">|</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"945678886\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Justify</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"512868991\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Align Right</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">}</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"163117631\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"31516759\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Writing Direction</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"956096989\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Writing Direction</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"257099033\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Paragraph</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"551969625\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string type=\"base64-UTF8\" key=\"NSTitle\">CURlZmF1bHQ</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"249532473\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string type=\"base64-UTF8\" key=\"NSTitle\">CUxlZnQgdG8gUmlnaHQ</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"607364498\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string type=\"base64-UTF8\" key=\"NSTitle\">CVJpZ2h0IHRvIExlZnQ</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"508151438\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"981751889\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Selection</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"380031999\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string type=\"base64-UTF8\" key=\"NSTitle\">CURlZmF1bHQ</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"825984362\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string type=\"base64-UTF8\" key=\"NSTitle\">CUxlZnQgdG8gUmlnaHQ</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"560145579\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"956096989\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string type=\"base64-UTF8\" key=\"NSTitle\">CVJpZ2h0IHRvIExlZnQ</string>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"908105787\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"644046920\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Show Ruler</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"231811626\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Copy Ruler</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">c</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1310720</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"883618387\">\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"446991534\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Paste Ruler</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">v</string>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1310720</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"NSMenuItem\" id=\"586577488\">\n\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"649796088\" />\n\t\t\t\t\t\t<string key=\"NSTitle\">View</string>\n\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"466310130\">\n\t\t\t\t\t\t\t<string key=\"NSTitle\">View</string>\n\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"102151532\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"466310130\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Show Toolbar</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">t</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1572864</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"237841660\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"466310130\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Customize Toolbar…</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"NSMenuItem\" id=\"713487014\">\n\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"649796088\" />\n\t\t\t\t\t\t<string key=\"NSTitle\">Window</string>\n\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"835318025\">\n\t\t\t\t\t\t\t<string key=\"NSTitle\">Window</string>\n\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"1011231497\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"835318025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Minimize</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">m</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"575023229\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"835318025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Zoom</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"299356726\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"835318025\" />\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsDisabled\">YES</bool>\n\t\t\t\t\t\t\t\t\t<bool key=\"NSIsSeparator\">YES</bool>\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"625202149\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"835318025\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">Bring All to Front</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t<string key=\"NSName\">_NSWindowsMenu</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"NSMenuItem\" id=\"448692316\">\n\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"649796088\" />\n\t\t\t\t\t\t<string key=\"NSTitle\">Help</string>\n\t\t\t\t\t\t<string key=\"NSKeyEquiv\" />\n\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t<string key=\"NSAction\">submenuAction:</string>\n\t\t\t\t\t\t<object class=\"NSMenu\" key=\"NSSubmenu\" id=\"992780483\">\n\t\t\t\t\t\t\t<string key=\"NSTitle\">Help</string>\n\t\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"NSMenuItems\">\n\t\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t\t<object class=\"NSMenuItem\" id=\"105068016\">\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMenu\" ref=\"992780483\" />\n\t\t\t\t\t\t\t\t\t<string key=\"NSTitle\">TestOutlet Help</string>\n\t\t\t\t\t\t\t\t\t<string key=\"NSKeyEquiv\">?</string>\n\t\t\t\t\t\t\t\t\t<int key=\"NSKeyEquivModMask\">1048576</int>\n\t\t\t\t\t\t\t\t\t<int key=\"NSMnemonicLoc\">2147483647</int>\n\t\t\t\t\t\t\t\t\t<reference key=\"NSOnImage\" ref=\"35465992\" />\n\t\t\t\t\t\t\t\t\t<reference key=\"NSMixedImage\" ref=\"502551668\" />\n\t\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t</object>\n\t\t\t\t\t\t\t<string key=\"NSName\">_NSHelpMenu</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<string key=\"NSName\">_NSMainMenu</string>\n\t\t\t</object>\n\t\t\t<object class=\"NSCustomObject\" id=\"755631768\">\n\t\t\t\t<string key=\"NSClassName\">NSFontManager</string>\n\t\t\t</object>\n\t\t\t<object class=\"NSCustomObject\" id=\"947627720\">\n\t\t\t\t<string key=\"NSClassName\">Outracks.Fusion.AppDelegate</string>\n\t\t\t</object>\n\t\t</object>\n\t\t<object class=\"IBObjectContainer\" key=\"IBDocument.Objects\">\n\t\t\t<object class=\"NSMutableArray\" key=\"connectionRecords\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">performMiniaturize:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"1011231497\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">37</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">arrangeInFront:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"625202149\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">39</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">print:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"49223823\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">86</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">runPageLayout:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"294629803\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">87</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">clearRecentDocuments:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"759406840\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">127</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">orderFrontStandardAboutPanel:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1021\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"238522557\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">142</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">performClose:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"776162233\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">193</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleContinuousSpellChecking:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"948374510\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">222</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">undo:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"1058277027\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">223</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">copy:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"860595796\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">224</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">checkSpelling:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"96193923\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">225</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">paste:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"29853731\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">226</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">stopSpeaking:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"680220178\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">227</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">cut:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"296257095\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">228</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">showGuessPanel:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"679648819\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">230</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">redo:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"790794224\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">231</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">selectAll:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"583158037\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">232</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">startSpeaking:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"731782645\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">233</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">delete:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"437104165\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">235</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">performZoom:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"575023229\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">240</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">performFindPanelAction:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"447796847\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">241</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">centerSelectionInVisibleArea:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"88285865\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">245</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleGrammarChecking:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"967646866\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">347</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleSmartInsertDelete:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"605118523\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">355</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleAutomaticQuoteSubstitution:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"197661976\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">356</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleAutomaticLinkDetection:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"708854459\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">357</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">saveDocument:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"1023925487\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">362</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">saveDocumentAs:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"117038363\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">363</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">revertDocumentToSaved:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"579971712\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">364</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">runToolbarCustomizationPalette:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"237841660\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">365</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleToolbarShown:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"102151532\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">366</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">hide:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"755159360\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">367</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">hideOtherApplications:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"342932134\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">368</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">unhideAllApplications:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"908899353\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">370</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">newDocument:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"705341025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">373</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">openDocument:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"722745758\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">374</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">addFontTrait:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"755631768\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"305399458\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">421</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">addFontTrait:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"755631768\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"814362025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">422</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">modifyFont:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"755631768\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"885547335\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">423</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">orderFrontFontPanel:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"755631768\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"159677712\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">424</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">modifyFont:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"755631768\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"158063935\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">425</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">raiseBaseline:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"941806246\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">426</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">lowerBaseline:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"1045724900\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">427</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">copyFont:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"596732606\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">428</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">subscript:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"1037576581\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">429</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">superscript:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"644725453\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">430</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">tightenKerning:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"677519740\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">431</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">underline:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"330926929\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">432</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">orderFrontColorPanel:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"1012600125\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">433</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">useAllLigatures:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"663508465\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">434</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">loosenKerning:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"238351151\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">435</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">pasteFont:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"393423671\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">436</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">unscript:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"257962622\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">437</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">useStandardKerning:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"252969304\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">438</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">useStandardLigatures:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"706297211\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">439</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">turnOffLigatures:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"568384683\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">440</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">turnOffKerning:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"766922938\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">441</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">terminate:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1050\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"632727374\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">449</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleAutomaticSpellingCorrection:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"795346622\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">456</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">orderFrontSubstitutionsPanel:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"65139061\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">458</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleAutomaticDashSubstitution:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"672708820\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">461</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleAutomaticTextReplacement:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"537092702\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">463</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">uppercaseWord:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"1060694897\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">464</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">capitalizeWord:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"56570060\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">467</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">lowercaseWord:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"879586729\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">468</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">pasteAsPlainText:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"82994268\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">486</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">performFindPanelAction:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"326711663\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">487</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">performFindPanelAction:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"270902937\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">488</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">performFindPanelAction:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"159080638\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">489</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">showHelp:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"105068016\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">493</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">alignCenter:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"630155264\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">518</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">pasteRuler:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"883618387\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">519</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">toggleRuler:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"644046920\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">520</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">alignRight:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"512868991\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">521</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">copyRuler:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"231811626\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">522</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">alignJustified:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"945678886\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">523</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">alignLeft:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"875092757\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">524</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">makeBaseWritingDirectionNatural:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"551969625\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">525</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">makeBaseWritingDirectionLeftToRight:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"249532473\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">526</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">makeBaseWritingDirectionRightToLeft:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"607364498\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">527</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">makeTextWritingDirectionNatural:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"380031999\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">528</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">makeTextWritingDirectionLeftToRight:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"825984362\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">529</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBActionConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">makeTextWritingDirectionRightToLeft:</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"560145579\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">530</int>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBConnectionRecord\">\n\t\t\t\t\t<object class=\"IBOutletConnection\" key=\"connection\">\n\t\t\t\t\t\t<string key=\"label\">delegate</string>\n\t\t\t\t\t\t<reference key=\"source\" ref=\"1021\" />\n\t\t\t\t\t\t<reference key=\"destination\" ref=\"947627720\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<int key=\"connectionID\">534</int>\n\t\t\t\t</object>\n\t\t\t</object>\n\t\t\t<object class=\"IBMutableOrderedSet\" key=\"objectRecords\">\n\t\t\t\t<object class=\"NSArray\" key=\"orderedObjects\">\n\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">0</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"0\" />\n\t\t\t\t\t\t<reference key=\"children\" ref=\"1048\" />\n\t\t\t\t\t\t<nil key=\"parent\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">-2</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1021\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"0\" />\n\t\t\t\t\t\t<string key=\"objectName\">File's Owner</string>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">-1</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1014\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"0\" />\n\t\t\t\t\t\t<string key=\"objectName\">First Responder</string>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">-3</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1050\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"0\" />\n\t\t\t\t\t\t<string key=\"objectName\">Application</string>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">29</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"649796088\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"713487014\" />\n\t\t\t\t\t\t\t<reference ref=\"694149608\" />\n\t\t\t\t\t\t\t<reference ref=\"952259628\" />\n\t\t\t\t\t\t\t<reference ref=\"379814623\" />\n\t\t\t\t\t\t\t<reference ref=\"586577488\" />\n\t\t\t\t\t\t\t<reference ref=\"302598603\" />\n\t\t\t\t\t\t\t<reference ref=\"448692316\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"0\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">19</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"713487014\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"835318025\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"649796088\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">56</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"694149608\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"110575045\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"649796088\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">217</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"952259628\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"789758025\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"649796088\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">83</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"379814623\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"720053764\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"649796088\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">81</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"720053764\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"1023925487\" />\n\t\t\t\t\t\t\t<reference ref=\"117038363\" />\n\t\t\t\t\t\t\t<reference ref=\"49223823\" />\n\t\t\t\t\t\t\t<reference ref=\"722745758\" />\n\t\t\t\t\t\t\t<reference ref=\"705341025\" />\n\t\t\t\t\t\t\t<reference ref=\"1025936716\" />\n\t\t\t\t\t\t\t<reference ref=\"294629803\" />\n\t\t\t\t\t\t\t<reference ref=\"776162233\" />\n\t\t\t\t\t\t\t<reference ref=\"425164168\" />\n\t\t\t\t\t\t\t<reference ref=\"579971712\" />\n\t\t\t\t\t\t\t<reference ref=\"1010469920\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"379814623\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">75</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1023925487\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">80</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"117038363\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">78</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"49223823\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">72</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"722745758\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">82</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"705341025\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">124</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1025936716\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"1065607017\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">77</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"294629803\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">73</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"776162233\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">79</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"425164168\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">112</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"579971712\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">74</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1010469920\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"720053764\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">125</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1065607017\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"759406840\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"1025936716\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">126</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"759406840\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"1065607017\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">205</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"789758025\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"437104165\" />\n\t\t\t\t\t\t\t<reference ref=\"583158037\" />\n\t\t\t\t\t\t\t<reference ref=\"1058277027\" />\n\t\t\t\t\t\t\t<reference ref=\"212016141\" />\n\t\t\t\t\t\t\t<reference ref=\"296257095\" />\n\t\t\t\t\t\t\t<reference ref=\"29853731\" />\n\t\t\t\t\t\t\t<reference ref=\"860595796\" />\n\t\t\t\t\t\t\t<reference ref=\"1040322652\" />\n\t\t\t\t\t\t\t<reference ref=\"790794224\" />\n\t\t\t\t\t\t\t<reference ref=\"892235320\" />\n\t\t\t\t\t\t\t<reference ref=\"972420730\" />\n\t\t\t\t\t\t\t<reference ref=\"676164635\" />\n\t\t\t\t\t\t\t<reference ref=\"507821607\" />\n\t\t\t\t\t\t\t<reference ref=\"288088188\" />\n\t\t\t\t\t\t\t<reference ref=\"82994268\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"952259628\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">202</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"437104165\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">198</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"583158037\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">207</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1058277027\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">214</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"212016141\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">199</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"296257095\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">203</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"29853731\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">197</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"860595796\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">206</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1040322652\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">215</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"790794224\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">218</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"892235320\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"963351320\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">216</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"972420730\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"769623530\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">200</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"769623530\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"948374510\" />\n\t\t\t\t\t\t\t<reference ref=\"96193923\" />\n\t\t\t\t\t\t\t<reference ref=\"679648819\" />\n\t\t\t\t\t\t\t<reference ref=\"967646866\" />\n\t\t\t\t\t\t\t<reference ref=\"859480356\" />\n\t\t\t\t\t\t\t<reference ref=\"795346622\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"972420730\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">219</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"948374510\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"769623530\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">201</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"96193923\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"769623530\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">204</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"679648819\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"769623530\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">220</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"963351320\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"270902937\" />\n\t\t\t\t\t\t\t<reference ref=\"88285865\" />\n\t\t\t\t\t\t\t<reference ref=\"159080638\" />\n\t\t\t\t\t\t\t<reference ref=\"326711663\" />\n\t\t\t\t\t\t\t<reference ref=\"447796847\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"892235320\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">213</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"270902937\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"963351320\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">210</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"88285865\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"963351320\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">221</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"159080638\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"963351320\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">208</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"326711663\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"963351320\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">209</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"447796847\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"963351320\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">57</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"110575045\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"238522557\" />\n\t\t\t\t\t\t\t<reference ref=\"755159360\" />\n\t\t\t\t\t\t\t<reference ref=\"908899353\" />\n\t\t\t\t\t\t\t<reference ref=\"632727374\" />\n\t\t\t\t\t\t\t<reference ref=\"646227648\" />\n\t\t\t\t\t\t\t<reference ref=\"609285721\" />\n\t\t\t\t\t\t\t<reference ref=\"481834944\" />\n\t\t\t\t\t\t\t<reference ref=\"304266470\" />\n\t\t\t\t\t\t\t<reference ref=\"1046388886\" />\n\t\t\t\t\t\t\t<reference ref=\"1056857174\" />\n\t\t\t\t\t\t\t<reference ref=\"342932134\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"694149608\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">58</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"238522557\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">134</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"755159360\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">150</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"908899353\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">136</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"632727374\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">144</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"646227648\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">129</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"609285721\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">143</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"481834944\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">236</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"304266470\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">131</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1046388886\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"752062318\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">149</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1056857174\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">145</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"342932134\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"110575045\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">130</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"752062318\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"1046388886\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">24</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"835318025\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"299356726\" />\n\t\t\t\t\t\t\t<reference ref=\"625202149\" />\n\t\t\t\t\t\t\t<reference ref=\"575023229\" />\n\t\t\t\t\t\t\t<reference ref=\"1011231497\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"713487014\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">92</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"299356726\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"835318025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">5</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"625202149\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"835318025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">239</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"575023229\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"835318025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">23</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1011231497\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"835318025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">295</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"586577488\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"466310130\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"649796088\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">296</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"466310130\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"102151532\" />\n\t\t\t\t\t\t\t<reference ref=\"237841660\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"586577488\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">297</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"102151532\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"466310130\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">298</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"237841660\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"466310130\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">211</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"676164635\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"785027613\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">212</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"785027613\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"680220178\" />\n\t\t\t\t\t\t\t<reference ref=\"731782645\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"676164635\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">195</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"680220178\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"785027613\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">196</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"731782645\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"785027613\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">346</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"967646866\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"769623530\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">348</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"507821607\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"698887838\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">349</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"698887838\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"605118523\" />\n\t\t\t\t\t\t\t<reference ref=\"197661976\" />\n\t\t\t\t\t\t\t<reference ref=\"708854459\" />\n\t\t\t\t\t\t\t<reference ref=\"65139061\" />\n\t\t\t\t\t\t\t<reference ref=\"19036812\" />\n\t\t\t\t\t\t\t<reference ref=\"672708820\" />\n\t\t\t\t\t\t\t<reference ref=\"537092702\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"507821607\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">350</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"605118523\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"698887838\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">351</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"197661976\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"698887838\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">354</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"708854459\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"698887838\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">375</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"302598603\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"941447902\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"649796088\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">376</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"941447902\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"792887677\" />\n\t\t\t\t\t\t\t<reference ref=\"215659978\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"302598603\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">377</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"792887677\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"786677654\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"941447902\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">388</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"786677654\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"159677712\" />\n\t\t\t\t\t\t\t<reference ref=\"305399458\" />\n\t\t\t\t\t\t\t<reference ref=\"814362025\" />\n\t\t\t\t\t\t\t<reference ref=\"330926929\" />\n\t\t\t\t\t\t\t<reference ref=\"533507878\" />\n\t\t\t\t\t\t\t<reference ref=\"158063935\" />\n\t\t\t\t\t\t\t<reference ref=\"885547335\" />\n\t\t\t\t\t\t\t<reference ref=\"901062459\" />\n\t\t\t\t\t\t\t<reference ref=\"767671776\" />\n\t\t\t\t\t\t\t<reference ref=\"691570813\" />\n\t\t\t\t\t\t\t<reference ref=\"769124883\" />\n\t\t\t\t\t\t\t<reference ref=\"739652853\" />\n\t\t\t\t\t\t\t<reference ref=\"1012600125\" />\n\t\t\t\t\t\t\t<reference ref=\"214559597\" />\n\t\t\t\t\t\t\t<reference ref=\"596732606\" />\n\t\t\t\t\t\t\t<reference ref=\"393423671\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"792887677\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">389</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"159677712\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">390</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"305399458\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">391</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"814362025\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">392</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"330926929\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">393</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"533507878\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">394</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"158063935\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">395</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"885547335\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">396</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"901062459\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">397</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"767671776\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"175441468\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">398</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"691570813\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"1058217995\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">399</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"769124883\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"18263474\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">400</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"739652853\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">401</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1012600125\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">402</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"214559597\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">403</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"596732606\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">404</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"393423671\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"786677654\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">405</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"18263474\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"257962622\" />\n\t\t\t\t\t\t\t<reference ref=\"644725453\" />\n\t\t\t\t\t\t\t<reference ref=\"1037576581\" />\n\t\t\t\t\t\t\t<reference ref=\"941806246\" />\n\t\t\t\t\t\t\t<reference ref=\"1045724900\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"769124883\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">406</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"257962622\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"18263474\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">407</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"644725453\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"18263474\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">408</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1037576581\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"18263474\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">409</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"941806246\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"18263474\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">410</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1045724900\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"18263474\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">411</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1058217995\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"706297211\" />\n\t\t\t\t\t\t\t<reference ref=\"568384683\" />\n\t\t\t\t\t\t\t<reference ref=\"663508465\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"691570813\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">412</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"706297211\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"1058217995\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">413</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"568384683\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"1058217995\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">414</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"663508465\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"1058217995\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">415</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"175441468\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"252969304\" />\n\t\t\t\t\t\t\t<reference ref=\"766922938\" />\n\t\t\t\t\t\t\t<reference ref=\"677519740\" />\n\t\t\t\t\t\t\t<reference ref=\"238351151\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"767671776\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">416</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"252969304\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"175441468\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">417</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"766922938\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"175441468\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">418</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"677519740\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"175441468\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">419</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"238351151\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"175441468\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">420</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"755631768\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"0\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">450</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"288088188\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"579392910\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">451</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"579392910\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"1060694897\" />\n\t\t\t\t\t\t\t<reference ref=\"879586729\" />\n\t\t\t\t\t\t\t<reference ref=\"56570060\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"288088188\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">452</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"1060694897\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"579392910\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">453</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"859480356\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"769623530\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">454</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"795346622\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"769623530\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">457</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"65139061\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"698887838\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">459</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"19036812\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"698887838\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">460</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"672708820\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"698887838\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">462</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"537092702\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"698887838\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">465</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"879586729\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"579392910\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">466</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"56570060\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"579392910\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">485</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"82994268\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"789758025\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">490</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"448692316\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"992780483\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"649796088\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">491</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"992780483\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"105068016\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"448692316\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">492</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"105068016\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"992780483\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">496</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"215659978\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"446991534\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"941447902\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">497</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"446991534\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"875092757\" />\n\t\t\t\t\t\t\t<reference ref=\"630155264\" />\n\t\t\t\t\t\t\t<reference ref=\"945678886\" />\n\t\t\t\t\t\t\t<reference ref=\"512868991\" />\n\t\t\t\t\t\t\t<reference ref=\"163117631\" />\n\t\t\t\t\t\t\t<reference ref=\"31516759\" />\n\t\t\t\t\t\t\t<reference ref=\"908105787\" />\n\t\t\t\t\t\t\t<reference ref=\"644046920\" />\n\t\t\t\t\t\t\t<reference ref=\"231811626\" />\n\t\t\t\t\t\t\t<reference ref=\"883618387\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"215659978\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">498</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"875092757\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">499</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"630155264\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">500</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"945678886\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">501</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"512868991\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">502</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"163117631\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">503</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"31516759\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"956096989\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">504</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"908105787\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">505</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"644046920\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">506</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"231811626\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">507</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"883618387\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"446991534\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">508</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"956096989\" />\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"children\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<reference ref=\"257099033\" />\n\t\t\t\t\t\t\t<reference ref=\"551969625\" />\n\t\t\t\t\t\t\t<reference ref=\"249532473\" />\n\t\t\t\t\t\t\t<reference ref=\"607364498\" />\n\t\t\t\t\t\t\t<reference ref=\"508151438\" />\n\t\t\t\t\t\t\t<reference ref=\"981751889\" />\n\t\t\t\t\t\t\t<reference ref=\"380031999\" />\n\t\t\t\t\t\t\t<reference ref=\"825984362\" />\n\t\t\t\t\t\t\t<reference ref=\"560145579\" />\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"31516759\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">509</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"257099033\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">510</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"551969625\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">511</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"249532473\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">512</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"607364498\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">513</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"508151438\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">514</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"981751889\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">515</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"380031999\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">516</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"825984362\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">517</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"560145579\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"956096989\" />\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBObjectRecord\">\n\t\t\t\t\t\t<int key=\"objectID\">533</int>\n\t\t\t\t\t\t<reference key=\"object\" ref=\"947627720\" />\n\t\t\t\t\t\t<reference key=\"parent\" ref=\"0\" />\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t</object>\n\t\t\t<object class=\"NSMutableDictionary\" key=\"flattenedProperties\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<object class=\"NSArray\" key=\"dict.sortedKeys\">\n\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t<string>-3.IBPluginDependency</string>\n\t\t\t\t\t<string>112.IBPluginDependency</string>\n\t\t\t\t\t<string>112.ImportedFromIB2</string>\n\t\t\t\t\t<string>124.IBPluginDependency</string>\n\t\t\t\t\t<string>124.ImportedFromIB2</string>\n\t\t\t\t\t<string>125.IBPluginDependency</string>\n\t\t\t\t\t<string>125.ImportedFromIB2</string>\n\t\t\t\t\t<string>125.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>126.IBPluginDependency</string>\n\t\t\t\t\t<string>126.ImportedFromIB2</string>\n\t\t\t\t\t<string>129.IBPluginDependency</string>\n\t\t\t\t\t<string>129.ImportedFromIB2</string>\n\t\t\t\t\t<string>130.IBPluginDependency</string>\n\t\t\t\t\t<string>130.ImportedFromIB2</string>\n\t\t\t\t\t<string>130.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>131.IBPluginDependency</string>\n\t\t\t\t\t<string>131.ImportedFromIB2</string>\n\t\t\t\t\t<string>134.IBPluginDependency</string>\n\t\t\t\t\t<string>134.ImportedFromIB2</string>\n\t\t\t\t\t<string>136.IBPluginDependency</string>\n\t\t\t\t\t<string>136.ImportedFromIB2</string>\n\t\t\t\t\t<string>143.IBPluginDependency</string>\n\t\t\t\t\t<string>143.ImportedFromIB2</string>\n\t\t\t\t\t<string>144.IBPluginDependency</string>\n\t\t\t\t\t<string>144.ImportedFromIB2</string>\n\t\t\t\t\t<string>145.IBPluginDependency</string>\n\t\t\t\t\t<string>145.ImportedFromIB2</string>\n\t\t\t\t\t<string>149.IBPluginDependency</string>\n\t\t\t\t\t<string>149.ImportedFromIB2</string>\n\t\t\t\t\t<string>150.IBPluginDependency</string>\n\t\t\t\t\t<string>150.ImportedFromIB2</string>\n\t\t\t\t\t<string>19.IBPluginDependency</string>\n\t\t\t\t\t<string>19.ImportedFromIB2</string>\n\t\t\t\t\t<string>195.IBPluginDependency</string>\n\t\t\t\t\t<string>195.ImportedFromIB2</string>\n\t\t\t\t\t<string>196.IBPluginDependency</string>\n\t\t\t\t\t<string>196.ImportedFromIB2</string>\n\t\t\t\t\t<string>197.IBPluginDependency</string>\n\t\t\t\t\t<string>197.ImportedFromIB2</string>\n\t\t\t\t\t<string>198.IBPluginDependency</string>\n\t\t\t\t\t<string>198.ImportedFromIB2</string>\n\t\t\t\t\t<string>199.IBPluginDependency</string>\n\t\t\t\t\t<string>199.ImportedFromIB2</string>\n\t\t\t\t\t<string>200.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>200.IBPluginDependency</string>\n\t\t\t\t\t<string>200.ImportedFromIB2</string>\n\t\t\t\t\t<string>200.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>201.IBPluginDependency</string>\n\t\t\t\t\t<string>201.ImportedFromIB2</string>\n\t\t\t\t\t<string>202.IBPluginDependency</string>\n\t\t\t\t\t<string>202.ImportedFromIB2</string>\n\t\t\t\t\t<string>203.IBPluginDependency</string>\n\t\t\t\t\t<string>203.ImportedFromIB2</string>\n\t\t\t\t\t<string>204.IBPluginDependency</string>\n\t\t\t\t\t<string>204.ImportedFromIB2</string>\n\t\t\t\t\t<string>205.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>205.IBPluginDependency</string>\n\t\t\t\t\t<string>205.ImportedFromIB2</string>\n\t\t\t\t\t<string>205.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>206.IBPluginDependency</string>\n\t\t\t\t\t<string>206.ImportedFromIB2</string>\n\t\t\t\t\t<string>207.IBPluginDependency</string>\n\t\t\t\t\t<string>207.ImportedFromIB2</string>\n\t\t\t\t\t<string>208.IBPluginDependency</string>\n\t\t\t\t\t<string>208.ImportedFromIB2</string>\n\t\t\t\t\t<string>209.IBPluginDependency</string>\n\t\t\t\t\t<string>209.ImportedFromIB2</string>\n\t\t\t\t\t<string>210.IBPluginDependency</string>\n\t\t\t\t\t<string>210.ImportedFromIB2</string>\n\t\t\t\t\t<string>211.IBPluginDependency</string>\n\t\t\t\t\t<string>211.ImportedFromIB2</string>\n\t\t\t\t\t<string>212.IBPluginDependency</string>\n\t\t\t\t\t<string>212.ImportedFromIB2</string>\n\t\t\t\t\t<string>212.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>213.IBPluginDependency</string>\n\t\t\t\t\t<string>213.ImportedFromIB2</string>\n\t\t\t\t\t<string>214.IBPluginDependency</string>\n\t\t\t\t\t<string>214.ImportedFromIB2</string>\n\t\t\t\t\t<string>215.IBPluginDependency</string>\n\t\t\t\t\t<string>215.ImportedFromIB2</string>\n\t\t\t\t\t<string>216.IBPluginDependency</string>\n\t\t\t\t\t<string>216.ImportedFromIB2</string>\n\t\t\t\t\t<string>217.IBPluginDependency</string>\n\t\t\t\t\t<string>217.ImportedFromIB2</string>\n\t\t\t\t\t<string>218.IBPluginDependency</string>\n\t\t\t\t\t<string>218.ImportedFromIB2</string>\n\t\t\t\t\t<string>219.IBPluginDependency</string>\n\t\t\t\t\t<string>219.ImportedFromIB2</string>\n\t\t\t\t\t<string>220.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>220.IBPluginDependency</string>\n\t\t\t\t\t<string>220.ImportedFromIB2</string>\n\t\t\t\t\t<string>220.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>221.IBPluginDependency</string>\n\t\t\t\t\t<string>221.ImportedFromIB2</string>\n\t\t\t\t\t<string>23.IBPluginDependency</string>\n\t\t\t\t\t<string>23.ImportedFromIB2</string>\n\t\t\t\t\t<string>236.IBPluginDependency</string>\n\t\t\t\t\t<string>236.ImportedFromIB2</string>\n\t\t\t\t\t<string>239.IBPluginDependency</string>\n\t\t\t\t\t<string>239.ImportedFromIB2</string>\n\t\t\t\t\t<string>24.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>24.IBPluginDependency</string>\n\t\t\t\t\t<string>24.ImportedFromIB2</string>\n\t\t\t\t\t<string>24.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>29.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>29.IBPluginDependency</string>\n\t\t\t\t\t<string>29.ImportedFromIB2</string>\n\t\t\t\t\t<string>29.WindowOrigin</string>\n\t\t\t\t\t<string>29.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>295.IBPluginDependency</string>\n\t\t\t\t\t<string>296.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>296.IBPluginDependency</string>\n\t\t\t\t\t<string>296.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>297.IBPluginDependency</string>\n\t\t\t\t\t<string>298.IBPluginDependency</string>\n\t\t\t\t\t<string>346.IBPluginDependency</string>\n\t\t\t\t\t<string>346.ImportedFromIB2</string>\n\t\t\t\t\t<string>348.IBPluginDependency</string>\n\t\t\t\t\t<string>348.ImportedFromIB2</string>\n\t\t\t\t\t<string>349.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>349.IBPluginDependency</string>\n\t\t\t\t\t<string>349.ImportedFromIB2</string>\n\t\t\t\t\t<string>349.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>350.IBPluginDependency</string>\n\t\t\t\t\t<string>350.ImportedFromIB2</string>\n\t\t\t\t\t<string>351.IBPluginDependency</string>\n\t\t\t\t\t<string>351.ImportedFromIB2</string>\n\t\t\t\t\t<string>354.IBPluginDependency</string>\n\t\t\t\t\t<string>354.ImportedFromIB2</string>\n\t\t\t\t\t<string>375.IBPluginDependency</string>\n\t\t\t\t\t<string>376.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>376.IBPluginDependency</string>\n\t\t\t\t\t<string>377.IBPluginDependency</string>\n\t\t\t\t\t<string>388.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>388.IBPluginDependency</string>\n\t\t\t\t\t<string>389.IBPluginDependency</string>\n\t\t\t\t\t<string>390.IBPluginDependency</string>\n\t\t\t\t\t<string>391.IBPluginDependency</string>\n\t\t\t\t\t<string>392.IBPluginDependency</string>\n\t\t\t\t\t<string>393.IBPluginDependency</string>\n\t\t\t\t\t<string>394.IBPluginDependency</string>\n\t\t\t\t\t<string>395.IBPluginDependency</string>\n\t\t\t\t\t<string>396.IBPluginDependency</string>\n\t\t\t\t\t<string>397.IBPluginDependency</string>\n\t\t\t\t\t<string>398.IBPluginDependency</string>\n\t\t\t\t\t<string>399.IBPluginDependency</string>\n\t\t\t\t\t<string>400.IBPluginDependency</string>\n\t\t\t\t\t<string>401.IBPluginDependency</string>\n\t\t\t\t\t<string>402.IBPluginDependency</string>\n\t\t\t\t\t<string>403.IBPluginDependency</string>\n\t\t\t\t\t<string>404.IBPluginDependency</string>\n\t\t\t\t\t<string>405.IBPluginDependency</string>\n\t\t\t\t\t<string>406.IBPluginDependency</string>\n\t\t\t\t\t<string>407.IBPluginDependency</string>\n\t\t\t\t\t<string>408.IBPluginDependency</string>\n\t\t\t\t\t<string>409.IBPluginDependency</string>\n\t\t\t\t\t<string>410.IBPluginDependency</string>\n\t\t\t\t\t<string>411.IBPluginDependency</string>\n\t\t\t\t\t<string>412.IBPluginDependency</string>\n\t\t\t\t\t<string>413.IBPluginDependency</string>\n\t\t\t\t\t<string>414.IBPluginDependency</string>\n\t\t\t\t\t<string>415.IBPluginDependency</string>\n\t\t\t\t\t<string>416.IBPluginDependency</string>\n\t\t\t\t\t<string>417.IBPluginDependency</string>\n\t\t\t\t\t<string>418.IBPluginDependency</string>\n\t\t\t\t\t<string>419.IBPluginDependency</string>\n\t\t\t\t\t<string>450.IBPluginDependency</string>\n\t\t\t\t\t<string>451.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>451.IBPluginDependency</string>\n\t\t\t\t\t<string>452.IBPluginDependency</string>\n\t\t\t\t\t<string>453.IBPluginDependency</string>\n\t\t\t\t\t<string>454.IBPluginDependency</string>\n\t\t\t\t\t<string>457.IBPluginDependency</string>\n\t\t\t\t\t<string>459.IBPluginDependency</string>\n\t\t\t\t\t<string>460.IBPluginDependency</string>\n\t\t\t\t\t<string>462.IBPluginDependency</string>\n\t\t\t\t\t<string>465.IBPluginDependency</string>\n\t\t\t\t\t<string>466.IBPluginDependency</string>\n\t\t\t\t\t<string>485.IBPluginDependency</string>\n\t\t\t\t\t<string>490.IBPluginDependency</string>\n\t\t\t\t\t<string>491.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>491.IBPluginDependency</string>\n\t\t\t\t\t<string>492.IBPluginDependency</string>\n\t\t\t\t\t<string>496.IBPluginDependency</string>\n\t\t\t\t\t<string>497.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>497.IBPluginDependency</string>\n\t\t\t\t\t<string>498.IBPluginDependency</string>\n\t\t\t\t\t<string>499.IBPluginDependency</string>\n\t\t\t\t\t<string>5.IBPluginDependency</string>\n\t\t\t\t\t<string>5.ImportedFromIB2</string>\n\t\t\t\t\t<string>500.IBPluginDependency</string>\n\t\t\t\t\t<string>501.IBPluginDependency</string>\n\t\t\t\t\t<string>502.IBPluginDependency</string>\n\t\t\t\t\t<string>503.IBPluginDependency</string>\n\t\t\t\t\t<string>504.IBPluginDependency</string>\n\t\t\t\t\t<string>505.IBPluginDependency</string>\n\t\t\t\t\t<string>506.IBPluginDependency</string>\n\t\t\t\t\t<string>507.IBPluginDependency</string>\n\t\t\t\t\t<string>508.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>508.IBPluginDependency</string>\n\t\t\t\t\t<string>509.IBPluginDependency</string>\n\t\t\t\t\t<string>510.IBPluginDependency</string>\n\t\t\t\t\t<string>511.IBPluginDependency</string>\n\t\t\t\t\t<string>512.IBPluginDependency</string>\n\t\t\t\t\t<string>513.IBPluginDependency</string>\n\t\t\t\t\t<string>514.IBPluginDependency</string>\n\t\t\t\t\t<string>515.IBPluginDependency</string>\n\t\t\t\t\t<string>516.IBPluginDependency</string>\n\t\t\t\t\t<string>517.IBPluginDependency</string>\n\t\t\t\t\t<string>56.IBPluginDependency</string>\n\t\t\t\t\t<string>56.ImportedFromIB2</string>\n\t\t\t\t\t<string>57.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>57.IBPluginDependency</string>\n\t\t\t\t\t<string>57.ImportedFromIB2</string>\n\t\t\t\t\t<string>57.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>58.IBPluginDependency</string>\n\t\t\t\t\t<string>58.ImportedFromIB2</string>\n\t\t\t\t\t<string>72.IBPluginDependency</string>\n\t\t\t\t\t<string>72.ImportedFromIB2</string>\n\t\t\t\t\t<string>73.IBPluginDependency</string>\n\t\t\t\t\t<string>73.ImportedFromIB2</string>\n\t\t\t\t\t<string>74.IBPluginDependency</string>\n\t\t\t\t\t<string>74.ImportedFromIB2</string>\n\t\t\t\t\t<string>75.IBPluginDependency</string>\n\t\t\t\t\t<string>75.ImportedFromIB2</string>\n\t\t\t\t\t<string>77.IBPluginDependency</string>\n\t\t\t\t\t<string>77.ImportedFromIB2</string>\n\t\t\t\t\t<string>78.IBPluginDependency</string>\n\t\t\t\t\t<string>78.ImportedFromIB2</string>\n\t\t\t\t\t<string>79.IBPluginDependency</string>\n\t\t\t\t\t<string>79.ImportedFromIB2</string>\n\t\t\t\t\t<string>80.IBPluginDependency</string>\n\t\t\t\t\t<string>80.ImportedFromIB2</string>\n\t\t\t\t\t<string>81.IBEditorWindowLastContentRect</string>\n\t\t\t\t\t<string>81.IBPluginDependency</string>\n\t\t\t\t\t<string>81.ImportedFromIB2</string>\n\t\t\t\t\t<string>81.editorWindowContentRectSynchronizationRect</string>\n\t\t\t\t\t<string>82.IBPluginDependency</string>\n\t\t\t\t\t<string>82.ImportedFromIB2</string>\n\t\t\t\t\t<string>83.IBPluginDependency</string>\n\t\t\t\t\t<string>83.ImportedFromIB2</string>\n\t\t\t\t\t<string>92.IBPluginDependency</string>\n\t\t\t\t\t<string>92.ImportedFromIB2</string>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"NSMutableArray\" key=\"dict.values\">\n\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{522, 812}, {146, 23}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{436, 809}, {64, 6}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{753, 187}, {275, 113}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{608, 612}, {275, 83}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{453, 408}, {254, 283}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{187, 434}, {243, 243}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{608, 612}, {167, 43}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{753, 217}, {238, 103}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{608, 612}, {241, 103}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{613, 618}, {194, 73}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{525, 802}, {197, 73}}</string>\n\t\t\t\t\t<string>{{346, 722}, {402, 20}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{74, 862}</string>\n\t\t\t\t\t<string>{{6, 978}, {478, 20}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{563, 648}, {231, 43}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{475, 832}, {234, 43}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{746, 287}, {220, 133}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{608, 612}, {215, 63}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{497, 648}, {83, 43}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{580, 408}, {175, 283}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{753, 197}, {170, 63}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{684, 668}, {142, 23}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{674, 260}, {204, 183}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>{{878, 180}, {164, 173}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{355, 508}, {183, 183}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{23, 794}, {245, 183}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{411, 488}, {196, 203}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>{{145, 474}, {199, 203}}</string>\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t\t<string>com.apple.InterfaceBuilder.CocoaPlugin</string>\n\t\t\t\t\t<integer value=\"1\" />\n\t\t\t\t</object>\n\t\t\t</object>\n\t\t\t<object class=\"NSMutableDictionary\" key=\"unlocalizedProperties\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<reference key=\"dict.sortedKeys\" ref=\"0\" />\n\t\t\t\t<object class=\"NSMutableArray\" key=\"dict.values\">\n\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t</object>\n\t\t\t</object>\n\t\t\t<nil key=\"activeLocalization\" />\n\t\t\t<object class=\"NSMutableDictionary\" key=\"localizations\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<reference key=\"dict.sortedKeys\" ref=\"0\" />\n\t\t\t\t<object class=\"NSMutableArray\" key=\"dict.values\">\n\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t</object>\n\t\t\t</object>\n\t\t\t<nil key=\"sourceID\" />\n\t\t\t<int key=\"maxID\">534</int>\n\t\t</object>\n\t\t<object class=\"IBClassDescriber\" key=\"IBDocument.Classes\">\n\t\t\t<object class=\"NSMutableArray\" key=\"referencedPartialClassDescriptions\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">AppDelegate</string>\n\t\t\t\t\t<string key=\"superclassName\">NSResponder</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBUserSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\" />\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t</object>\n\t\t\t<object class=\"NSMutableArray\" key=\"referencedPartialClassDescriptionsV3.2+\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSApplication</string>\n\t\t\t\t\t<string key=\"superclassName\">NSResponder</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"822405504\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSApplication.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSApplication</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"850738725\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSApplicationScripting.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSApplication</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"624831158\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSColorPanel.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSApplication</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSHelpManager.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSApplication</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSPageLayout.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSApplication</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSBrowser</string>\n\t\t\t\t\t<string key=\"superclassName\">NSControl</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSBrowser.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSControl</string>\n\t\t\t\t\t<string key=\"superclassName\">NSView</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"310914472\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSControl.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSDocument</string>\n\t\t\t\t\t<string key=\"superclassName\">NSObject</string>\n\t\t\t\t\t<object class=\"NSMutableDictionary\" key=\"actions\">\n\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t<object class=\"NSArray\" key=\"dict.sortedKeys\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<string>printDocument:</string>\n\t\t\t\t\t\t\t<string>revertDocumentToSaved:</string>\n\t\t\t\t\t\t\t<string>runPageLayout:</string>\n\t\t\t\t\t\t\t<string>saveDocument:</string>\n\t\t\t\t\t\t\t<string>saveDocumentAs:</string>\n\t\t\t\t\t\t\t<string>saveDocumentTo:</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"dict.values\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSDocument.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSDocument</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSDocumentScripting.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSDocumentController</string>\n\t\t\t\t\t<string key=\"superclassName\">NSObject</string>\n\t\t\t\t\t<object class=\"NSMutableDictionary\" key=\"actions\">\n\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t<object class=\"NSArray\" key=\"dict.sortedKeys\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<string>clearRecentDocuments:</string>\n\t\t\t\t\t\t\t<string>newDocument:</string>\n\t\t\t\t\t\t\t<string>openDocument:</string>\n\t\t\t\t\t\t\t<string>saveAllDocuments:</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t\t<object class=\"NSMutableArray\" key=\"dict.values\">\n\t\t\t\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t\t<string>id</string>\n\t\t\t\t\t\t</object>\n\t\t\t\t\t</object>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSDocumentController.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSFontManager</string>\n\t\t\t\t\t<string key=\"superclassName\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"946436764\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSFontManager.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSFormatter</string>\n\t\t\t\t\t<string key=\"superclassName\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSFormatter.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSMatrix</string>\n\t\t\t\t\t<string key=\"superclassName\">NSControl</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSMatrix.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSMenu</string>\n\t\t\t\t\t<string key=\"superclassName\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"1056362899\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSMenu.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSMenuItem</string>\n\t\t\t\t\t<string key=\"superclassName\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"472958451\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSMenuItem.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSMovieView</string>\n\t\t\t\t\t<string key=\"superclassName\">NSView</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSMovieView.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSAccessibility.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"822405504\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"850738725\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"624831158\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"310914472\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSDictionaryController.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSDragging.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"946436764\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSFontPanel.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSKeyValueBinding.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"1056362899\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSNibLoading.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSOutlineView.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSPasteboard.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSSavePanel.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"809545482\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSTableView.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSToolbarItem.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\" id=\"260078765\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSView.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSArchiver.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSClassDescription.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSError.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSFileManager.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSKeyValueCoding.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSKeyValueObserving.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSKeyedArchiver.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSObject.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSObjectScripting.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSPortCoder.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSRunLoop.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSScriptClassDescription.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSScriptWhoseTests.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSThread.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSURL.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSURLConnection.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">Foundation.framework/Headers/NSURLDownload.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSResponder</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSInterfaceStyle.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSResponder</string>\n\t\t\t\t\t<string key=\"superclassName\">NSObject</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSResponder.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSTableView</string>\n\t\t\t\t\t<string key=\"superclassName\">NSControl</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"809545482\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSText</string>\n\t\t\t\t\t<string key=\"superclassName\">NSView</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSText.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSTextView</string>\n\t\t\t\t\t<string key=\"superclassName\">NSText</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSTextView.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSView</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSClipView.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSView</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"472958451\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSView</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSRulerView.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSView</string>\n\t\t\t\t\t<string key=\"superclassName\">NSResponder</string>\n\t\t\t\t\t<reference key=\"sourceIdentifier\" ref=\"260078765\" />\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSWindow</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSDrawer.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSWindow</string>\n\t\t\t\t\t<string key=\"superclassName\">NSResponder</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSWindow.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t\t<object class=\"IBPartialClassDescription\">\n\t\t\t\t\t<string key=\"className\">NSWindow</string>\n\t\t\t\t\t<object class=\"IBClassDescriptionSource\" key=\"sourceIdentifier\">\n\t\t\t\t\t\t<string key=\"majorKey\">IBFrameworkSource</string>\n\t\t\t\t\t\t<string key=\"minorKey\">AppKit.framework/Headers/NSWindowScripting.h</string>\n\t\t\t\t\t</object>\n\t\t\t\t</object>\n\t\t\t</object>\n\t\t</object>\n\t\t<int key=\"IBDocument.localizationMode\">0</int>\n\t\t<string key=\"IBDocument.TargetRuntimeIdentifier\">IBCocoaFramework</string>\n\t\t<object class=\"NSMutableDictionary\" key=\"IBDocument.PluginDeclaredDependencyDefaults\">\n\t\t\t<string key=\"NS.key.0\">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>\n\t\t\t<integer value=\"1060\" key=\"NS.object.0\" />\n\t\t</object>\n\t\t<object class=\"NSMutableDictionary\" key=\"IBDocument.PluginDeclaredDevelopmentDependencies\">\n\t\t\t<string key=\"NS.key.0\">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>\n\t\t\t<integer value=\"3000\" key=\"NS.object.0\" />\n\t\t</object>\n\t\t<bool key=\"IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion\">YES</bool>\n\t\t<string key=\"IBDocument.LastKnownRelativeProjectPath\">../MacCocoaApp.xcodeproj</string>\n\t\t<int key=\"IBDocument.defaultPropertyAccessControl\">3</int>\n\t\t<object class=\"NSMutableDictionary\" key=\"IBDocument.LastKnownImageSizes\">\n\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t<object class=\"NSArray\" key=\"dict.sortedKeys\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<string>NSMenuCheckmark</string>\n\t\t\t\t<string>NSMenuMixedState</string>\n\t\t\t</object>\n\t\t\t<object class=\"NSMutableArray\" key=\"dict.values\">\n\t\t\t\t<bool key=\"EncodedWithXMLCoder\">YES</bool>\n\t\t\t\t<string>{9, 8}</string>\n\t\t\t\t<string>{7, 2}</string>\n\t\t\t</object>\n\t\t</object>\n\t</data>\n</archive>\n"
  },
  {
    "path": "src/mac/menu-bar/fuse X (menu bar).csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{4264877D-5E9A-4FF7-9B70-5DE41D3E5535}</ProjectGuid>\n    <ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>Outracks.Mac.MenuBarApp</RootNamespace>\n    <AssemblyName>fuse X (menu bar)</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>$(SolutionDir)bin\\$(Configuration)</OutputPath>\n    <DefineConstants>DEBUG;</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <EnableCodeSigning>false</EnableCodeSigning>\n    <CodeSigningKey>Mac Developer</CodeSigningKey>\n    <CreatePackage>false</CreatePackage>\n    <EnablePackageSigning>false</EnablePackageSigning>\n    <IncludeMonoRuntime>false</IncludeMonoRuntime>\n    <UseSGen>true</UseSGen>\n    <UseRefCounting>true</UseRefCounting>\n    <HttpClientHandler>HttpClientHandler</HttpClientHandler>\n    <LinkMode>None</LinkMode>\n    <XamMacArch></XamMacArch>\n    <AOTMode>None</AOTMode>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>$(SolutionDir)bin\\$(Configuration)</OutputPath>\n    <DefineConstants></DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <EnableCodeSigning>false</EnableCodeSigning>\n    <CreatePackage>false</CreatePackage>\n    <EnablePackageSigning>false</EnablePackageSigning>\n    <IncludeMonoRuntime>true</IncludeMonoRuntime>\n    <UseSGen>true</UseSGen>\n    <UseRefCounting>true</UseRefCounting>\n    <CodeSignEntitlements>Entitlements.plist</CodeSignEntitlements>\n    <LinkMode>None</LinkMode>\n    <HttpClientHandler>HttpClientHandler</HttpClientHandler>\n    <XamMacArch></XamMacArch>\n    <AOTMode>None</AOTMode>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Xamarin.Mac\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\Contents.json\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-128.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-128%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-16.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-16%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-256.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-256%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-32.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-32%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-512.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-512%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\Contents.json\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Resources\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Info.plist\" />\n    <None Include=\"Entitlements.plist\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Main.cs\" />\n    <EmbeddedResource Include=\"Resources\\Fuse.icns\" />\n  </ItemGroup>\n  <ItemGroup>\n    <InterfaceDefinition Include=\"MainMenu.xib\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fuse\\tray\\fuse-tray.csproj\">\n      <Project>{A7F96918-8029-4EF4-A4EA-686A4B59FD61}</Project>\n      <Name>fuse-tray</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\mac\\Outracks.Fusion.Mac.csproj\">\n      <Project>{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}</Project>\n      <Name>Outracks.Fusion.Mac</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"..\\msbuild\\Xamarin.Mac.CSharp.targets\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/mac/msbuild/FrameworkList.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FileList Name=\"Xamarin.Mac\" TargetFrameworkDirectory=\"/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac\">\n  <File AssemblyName=\"FSharp.Core\" Version=\"3.99.4.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"I18N.CJK\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"I18N.MidEast\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"I18N.Other\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"I18N.Rare\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"I18N.West\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"I18N\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Microsoft.CSharp\" Version=\"2.0.5.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Mono.CSharp\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Mono.CompilerServices.SymbolWriter\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Mono.Data.Sqlite\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Mono.Data.Tds\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Mono.Security\" Version=\"2.0.5.0\" PublicKeyToken=\"0738eb9f132ed756\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"OpenTK\" Version=\"0.0.0.0\" PublicKeyToken=\"84e04ff9cfb79065\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ComponentModel.Composition\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ComponentModel.DataAnnotations\" Version=\"2.0.5.0\" PublicKeyToken=\"31bf3856ad364e35\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Core\" Version=\"2.0.5.0\" PublicKeyToken=\"7cec85d7bea7798e\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Data.DataSetExtensions\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Data.Services.Client\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Data\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.Compression.FileSystem\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.Compression\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IdentityModel\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Json\" Version=\"2.0.5.0\" PublicKeyToken=\"31bf3856ad364e35\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Http.WinHttpHandler\" Version=\"2.0.5.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Http\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net\" Version=\"2.0.5.0\" PublicKeyToken=\"7cec85d7bea7798e\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Numerics.Vectors\" Version=\"2.0.5.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Numerics\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.Context\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Serialization\" Version=\"2.0.5.0\" PublicKeyToken=\"7cec85d7bea7798e\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security\" Version=\"2.0.5.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel.Internals\" Version=\"0.0.0.0\" PublicKeyToken=\"31bf3856ad364e35\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel.Web\" Version=\"2.0.5.0\" PublicKeyToken=\"7cec85d7bea7798e\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel\" Version=\"2.0.5.0\" PublicKeyToken=\"31bf3856ad364e35\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Transactions\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Web.Services\" Version=\"2.0.5.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Windows\" Version=\"2.0.5.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.Linq\" Version=\"2.0.5.0\" PublicKeyToken=\"31bf3856ad364e35\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.Serialization\" Version=\"2.0.5.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml\" Version=\"2.0.5.0\" PublicKeyToken=\"7cec85d7bea7798e\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System\" Version=\"2.0.5.0\" PublicKeyToken=\"7cec85d7bea7798e\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Xamarin.Mac\" Version=\"0.0.0.0\" PublicKeyToken=\"84e04ff9cfb79065\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"mscorlib\" Version=\"2.0.5.0\" PublicKeyToken=\"7cec85d7bea7798e\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Microsoft.Win32.Primitives\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Microsoft.Win32.Registry.AccessControl\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"Microsoft.Win32.Registry\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.AppContext\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Buffers\" Version=\"4.0.99.0\" PublicKeyToken=\"cc7b13ffcd2ddd51\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Collections.Concurrent\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Collections.NonGeneric\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Collections.Specialized\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Collections\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ComponentModel.Annotations\" Version=\"4.2.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ComponentModel.EventBasedAsync\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ComponentModel.Primitives\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ComponentModel.TypeConverter\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ComponentModel\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Console\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Data.Common\" Version=\"4.2.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Data.SqlClient\" Version=\"4.2.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.Contracts\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.Debug\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.FileVersionInfo\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.Process\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.StackTrace\" Version=\"4.1.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.TextWriterTraceListener\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.Tools\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.TraceEvent\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.TraceSource\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Diagnostics.Tracing\" Version=\"4.2.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Drawing.Common\" Version=\"4.0.0.0\" PublicKeyToken=\"cc7b13ffcd2ddd51\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Drawing.Primitives\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Dynamic.Runtime\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Globalization.Calendars\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Globalization.Extensions\" Version=\"4.1.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Globalization\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.Compression.ZipFile\" Version=\"4.0.1.0\" PublicKeyToken=\"b77a5c561934e089\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.FileSystem.AccessControl\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.FileSystem.DriveInfo\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.FileSystem.Primitives\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.FileSystem.Watcher\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.FileSystem\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.IsolatedStorage\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.MemoryMappedFiles\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.Pipes\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO.UnmanagedMemoryStream\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.IO\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Linq.Expressions\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Linq.Parallel\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Linq.Queryable\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Linq\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Memory\" Version=\"4.0.99.0\" PublicKeyToken=\"cc7b13ffcd2ddd51\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.AuthenticationManager\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Cache\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.HttpListener\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Mail\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.NameResolution\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.NetworkInformation\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Ping\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Primitives\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Requests\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Security\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.ServicePoint\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Sockets\" Version=\"4.2.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.Utilities\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.WebHeaderCollection\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.WebSockets.Client\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Net.WebSockets\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ObjectModel\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.DispatchProxy\" Version=\"4.0.3.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.Emit.ILGeneration\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.Emit.Lightweight\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.Emit\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.Extensions\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.Primitives\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection.TypeExtensions\" Version=\"4.1.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Reflection\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Resources.Reader\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Resources.ReaderWriter\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Resources.ResourceManager\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Resources.Writer\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.CompilerServices.VisualC\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Extensions\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Handles\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.InteropServices.RuntimeInformation\" Version=\"4.0.3.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.InteropServices.WindowsRuntime\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.InteropServices\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Loader\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Numerics\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Serialization.Formatters\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Serialization.Json\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Serialization.Primitives\" Version=\"4.2.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime.Serialization.Xml\" Version=\"4.1.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Runtime\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.AccessControl\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Claims\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Algorithms\" Version=\"4.3.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Cng\" Version=\"4.2.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Csp\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.DeriveBytes\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Encoding\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Encryption.Aes\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Encryption.ECDiffieHellman\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Encryption.ECDsa\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Encryption\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Hashing.Algorithms\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Hashing\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.OpenSsl\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Pkcs\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.Primitives\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.ProtectedData\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.RSA\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.RandomNumberGenerator\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Cryptography.X509Certificates\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Principal.Windows\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.Principal\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Security.SecureString\" Version=\"4.1.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel.Duplex\" Version=\"4.0.3.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel.Http\" Version=\"4.1.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel.NetTcp\" Version=\"4.1.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel.Primitives\" Version=\"4.2.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceModel.Security\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ServiceProcess.ServiceController\" Version=\"4.2.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Text.Encoding.CodePages\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Text.Encoding.Extensions\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Text.Encoding\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Text.RegularExpressions\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.AccessControl\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.Overlapped\" Version=\"4.1.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.Tasks.Extensions\" Version=\"4.2.0.0\" PublicKeyToken=\"cc7b13ffcd2ddd51\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.Tasks.Parallel\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.Tasks\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.Thread\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.ThreadPool\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading.Timer\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Threading\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.ValueTuple\" Version=\"4.0.3.0\" PublicKeyToken=\"cc7b13ffcd2ddd51\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.ReaderWriter\" Version=\"4.1.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.XDocument\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.XPath.XDocument\" Version=\"4.1.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.XPath.XmlDocument\" Version=\"4.0.2.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.XPath\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.XmlDocument\" Version=\"4.0.1.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.XmlSerializer\" Version=\"4.0.10.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"System.Xml.Xsl.Primitives\" Version=\"4.0.0.0\" PublicKeyToken=\"b03f5f7f11d50a3a\" ProcessorArchitecture=\"MSIL\" />\n  <File AssemblyName=\"netstandard\" Version=\"2.1.0.0\" PublicKeyToken=\"cc7b13ffcd2ddd51\" ProcessorArchitecture=\"MSIL\" />\n</FileList>"
  },
  {
    "path": "src/mac/msbuild/Xamarin.ImplicitFacade.targets",
    "content": "<!--\n***********************************************************************************************\nXamarin.ImplicitFacade.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nCopyright (c) 2017, 2020 Microsoft Corp. (www.microsoft.com)\n***********************************************************************************************\n-->\n\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<!-- Support for netstandard\n\t\t This logic is a modified copy of the logic in Microsoft.NETFramework.CurrentVersion.targets.\n\t\t XI/XM Mobile/XM Modern builds do not import Microsoft.NETFramework.CurrentVersion.targets,\n\t\t since their TVI is not NETFramework. However it is needed to successfully consume netstandard\n\t\t nuget packages.\n\t-->\n\n\t<!-- Implicitly references all portable design-time facades if the user is referencing a System.Runtime-based portable library -->\n\t<PropertyGroup>\n\t\t<ImplicitlyExpandDesignTimeFacades>true</ImplicitlyExpandDesignTimeFacades>\n\t\t<CheckForSystemRuntimeDependency>true</CheckForSystemRuntimeDependency>\n\n\t\t<ResolveReferencesDependsOn>\n\t\t\t$(ResolveReferencesDependsOn);\n\t\t\tImplicitlyExpandDesignTimeFacades\n\t\t</ResolveReferencesDependsOn>\n\n\t\t<ImplicitlyExpandDesignTimeFacadesDependsOn>\n\t\t\t$(ImplicitlyExpandDesignTimeFacadesDependsOn);\n\t\t\tGetReferenceAssemblyPaths\n\t\t</ImplicitlyExpandDesignTimeFacadesDependsOn>\n\n\t\t<_NETBuildExtensionsTaskAssembly>$(MSBuildExtensionsPath)\\Microsoft\\Microsoft.NET.Build.Extensions\\tools\\net472\\Microsoft.NET.Build.Extensions.Tasks.dll</_NETBuildExtensionsTaskAssembly>\n\t</PropertyGroup>\n\n\t<!-- Implicitly references all portable design-time facades if the user is referencing a System.Runtime-based portable library -->\n\n\t<UsingTask\n\t\tTaskName=\"GetDependsOnNETStandard\"\n\t\tCondition=\"Exists('$(_NETBuildExtensionsTaskAssembly)')\"\n\t\tAssemblyFile=\"$(_NETBuildExtensionsTaskAssembly)\" />\n\n\t<Target Name=\"ImplicitlyExpandDesignTimeFacades\" DependsOnTargets=\"$(ImplicitlyExpandDesignTimeFacadesDependsOn)\">\n\t\t<ItemGroup>\n\t\t\t<_Xamarin_CandidateNETStandardReferences Include=\"@(Reference);@(_ResolvedProjectReferencePaths)\" />\n\t\t\t<_Xamarin_InboxNETStandardFolders Include=\"$(TargetFrameworkDirectory)\" />\n\t\t</ItemGroup>\n\n\t\t<PropertyGroup>\n\t\t\t<!-- Does one of our dependencies reference a System.Runtime-based portable library? -->\n\t\t\t<_HasReferenceToSystemRuntime Condition=\"'$(DependsOnSystemRuntime)' == 'true'\">true</_HasReferenceToSystemRuntime>\n\t\t\t<_HasReferenceToSystemRuntime Condition=\"'%(_ResolvedProjectReferencePaths.TargetPlatformIdentifier)' == 'Portable'\">true</_HasReferenceToSystemRuntime>\n\t\t\t<_HasReferenceToSystemRuntime Condition=\"'%(ReferenceDependencyPaths.Filename)' == 'System.Runtime'\">true</_HasReferenceToSystemRuntime>\n\n\t\t\t<_Xamarin_NETStandardInbox Condition=\"'$(_Xamarin_NETStandardInbox)' == '' and Exists('%(_Xamarin_InboxNETStandardFolders.Identity)\\netstandard.dll')\">true</_Xamarin_NETStandardInbox>\n\n\t\t\t<!--\n\t\t\t\tThis is `true` if any of the references depends on `netstandard`.\n\n\t\t\t\tIn cases where `ResolveAssemblyReference` task does get run, it populates `$(_DependsOnNETStandard)` property, so we don't\n\t\t\t\tneed to check this again.\n\t\t\t-->\n\t\t\t<_Xamarin_DependsOnNETStandard Condition=\"'$(_Xamarin_DependsOnNETStandard)' == ''\">$(_DependsOnNETStandard)</_Xamarin_DependsOnNETStandard>\n\t\t</PropertyGroup>\n\n\t\t<!--\n\t\t     Facades are expanded if we have a reference that depends on System.Runtime .\n\n\t\t     XI, XM/Mobile and XM/Modern projects have `$(TargetFrameworkIdentifier) != .NETFramework`, so Microsoft.NET.Build.Extensions\n\t\t     (which provides support for ns 2.0 projects) doesn't get imported. And netstandard.dll reference, even if required, doesn't\n\t\t     get added.\n\n\t\t     So, we need to check if any references depend on `netstandard`. And if so, expand the facades, which include netstandard.dll .\n\n\t\t     If $(_HasReferenceToSystemRuntime) is true, then the facades are going to be expanded anyway, so don't run this.\n\t\t-->\n\t\t<GetDependsOnNETStandard\n\t\t\tCondition=\"'$(_HasReferenceToSystemRuntime)' != 'true' and '$(_Xamarin_DependsOnNETStandard)' == '' and '@(_Xamarin_CandidateNETStandardReferences)' != ''\n\t\t\t\tand Exists('$(_NETBuildExtensionsTaskAssembly)')\"\n\t\t\tReferences=\"@(_Xamarin_CandidateNETStandardReferences)\">\n\t\t\t<Output TaskParameter=\"DependsOnNETStandard\" PropertyName=\"_Xamarin_DependsOnNETStandard\" />\n\t\t</GetDependsOnNETStandard>\n\n\t\t<ItemGroup Condition=\"'$(_HasReferenceToSystemRuntime)' == 'true' or ('$(_Xamarin_NETStandardInbox)' == 'true' and '$(_Xamarin_DependsOnNETStandard)' == 'true')\">\n\t\t\t<_DesignTimeFacadeAssemblies Include=\"%(DesignTimeFacadeDirectories.Identity)*.dll\"/>\n\n\t\t\t<_DesignTimeFacadeAssemblies_Names Include=\"@(_DesignTimeFacadeAssemblies->'%(FileName)')\">\n\t\t\t\t<OriginalIdentity>%(_DesignTimeFacadeAssemblies.Identity)</OriginalIdentity>\n\t\t\t</_DesignTimeFacadeAssemblies_Names>\n\n\t\t\t<_ReferencePath_Names Include=\"@(ReferencePath->'%(FileName)')\">\n\t\t\t\t<OriginalIdentity>%(ReferencePath.Identity)</OriginalIdentity>\n\t\t\t</_ReferencePath_Names>\n\n\t\t\t<_DesignTimeFacadeAssemblies_Names Remove=\"@(_ReferencePath_Names)\"/>\n\n\t\t\t<ReferencePath Include=\"@(_DesignTimeFacadeAssemblies_Names->'%(OriginalIdentity)')\">\n\t\t\t\t<WinMDFile>false</WinMDFile>\n\t\t\t\t<CopyLocal>false</CopyLocal>\n\t\t\t\t<ResolvedFrom>ImplicitlyExpandDesignTimeFacades</ResolvedFrom>\n\t\t\t</ReferencePath>\n\t\t\t<_ResolveAssemblyReferenceResolvedFiles Include=\"@(ReferencePath)\" Condition=\"'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'\" />\n\t\t</ItemGroup>\n\n\t\t<Message Importance=\"Low\" Text=\"Including @(ReferencePath)\" Condition=\"'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'\" />\n\t</Target>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.AppExtension.CSharp.targets",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.AppExtension.CSharp.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2014 Xamarin. All rights reserved.\n***********************************************************************************************\n-->\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\n\t<PropertyGroup>\n\t\t<!-- Version/fx properties -->\n\t\t<TargetFrameworkVersion Condition=\"'$(TargetFrameworkIdentifier)' == '' And '$(TargetFrameworkVersion)' ==''\">v4.5</TargetFrameworkVersion>\n\n\t\t<!-- This must be set before importing Microsoft.CSharp.targets -->\n\t\t<!-- See Xamarin.iOS.AppExtension.CSharp.targets for a detailed explanation of this variable -->\n\t\t<CopyNuGetImplementations Condition=\"'$(CopyNuGetImplementations)' == ''\">true</CopyNuGetImplementations>\n\t</PropertyGroup>\n\n\t<Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" Condition=\"'$(UsingAppleNETSdk)' != 'true'\" />\n\t<Import Project=\"Xamarin.Mac.AppExtension.Common.targets\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.AppExtension.Common.props",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.AppExtension.Common.props\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file defines default properties for OS X App Extension projects.\n\nCopyright (C) 2013-2014 Xamarin. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props')\"/>\n\n\t<PropertyGroup>\n\t\t<IsXPCService Condition=\"'$(IsXPCService)' == ''\">false</IsXPCService>\n\t</PropertyGroup>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props')\"/>\n\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.AppExtension.Common.targets",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.AppExtension.Common.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2013-2014 Xamarin. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<PropertyGroup>\n\t\t<IsAppExtension>True</IsAppExtension>\n\t</PropertyGroup>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.Common.targets\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.AppExtension.Common.props\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\" \n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n  \n\t<!-- Override GetTargetPath, Build, and Rebuild -->\n\t<Target Name=\"GetBundleTargetPath\" DependsOnTargets=\"_GenerateBundleName;$(GetTargetPathDependsOn)\" Outputs=\"@(_AppExtensionBundlePath)\" />\n\t<Target Name=\"Build\"   Condition=\"'$(_InvalidConfigurationWarning)' != 'true'\" DependsOnTargets=\"_EnabledLocalSigning;_GenerateBundleName;$(BuildDependsOn)\" Outputs=\"$(_AppExtensionBundlePath)\" />\n\t<Target Name=\"Rebuild\" Condition=\"'$(_InvalidConfigurationWarning)' != 'true'\" DependsOnTargets=\"_EnabledLocalSigning;_GenerateBundleName;$(RebuildDependsOn)\" Outputs=\"$(_AppExtensionBundlePath)\" />\n\n\t<Target Name=\"_EnabledLocalSigning\" DependsOnTargets=\"_DetectSigningIdentity\">\n\t\t<PropertyGroup>\n\t\t\t<CodesignEntitlements Condition=\"'$(CodesignEntitlements)' == ''\">Entitlements.plist</CodesignEntitlements>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<Target Name=\"CreateIpa\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.CSharp.targets",
    "content": "<!--\n***********************************************************************************************\nXamarin.Mac.CSharp.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2014 Xamarin. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\t\n\t<PropertyGroup>\n\t\t<!-- Version/fx properties -->\n\t\t<TargetFrameworkVersion Condition=\"'$(TargetFrameworkIdentifier)' == '' And '$(TargetFrameworkVersion)' == ''\">v4.5</TargetFrameworkVersion>\n\t</PropertyGroup>\n\n\t<Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" Condition=\"'$(UsingAppleNETSdk)' != 'true'\" />\n\n\t<Import Project=\"Xamarin.Mac.Common.targets\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.Common.props",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.Common.props\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file defines default properties for iOS projects.\n\nCopyright (C) 2013-2014 Xamarin. All rights reserved.\n***********************************************************************************************\n-->\n\n<!-- Unlike Xamarin.Mac.Common.targets, which is not shared by the ObjC Bindings targets (yet), \n     Xamarin.Mac.Common.props is shared and truely common. -->\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props')\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Shared.props\" />\n\n\t<!-- Story-time! MigrateToNewXMIdentifier is special because it un-does a lie we started telling from the \n\tbeginning of Full (called Xamarin.Mac 4.5 back then). Back then, we released Modern (called Mobile) and \n\twhen many customers upgraded from Classic they broke in terrible ways as none of their nugets worked. \n\tNo nugets in the wild had heard of the Xamarin.Mac TFI and thus didn't support it. To \"fix\" this use case,\n\twe created Full (XM 4.5) and _lied_ with our TFI claiming to be .NETFramework. Well we were close enough\n\tfor a vast majority of packages to work. However, this made creating Full specific package flavors impossible.\n\tNow that we're getting \"real\" nuget support, we need to stop lying without breaking the world. We're starting by\n\tallowing \"opt-in\" MigrateToNewXMIdentifier which will swap your declared TFI to the new hotness.\n\t-->\n\t<PropertyGroup Condition=\" '$(MigrateToNewXMIdentifier)' == 'true' And '$(TargetFrameworkIdentifier)' != 'Xamarin.Mac' And '$(UseXamMacFullFramework)' == 'true' \">\n\t\t<TargetFrameworkIdentifier>Xamarin.Mac.NET</TargetFrameworkIdentifier>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<!-- Opt-in to filter out assemblies denied loading by mono, to avoid bundling them.\n\t\t     This should only be for non-Modern profiles, since people who are recompiling for\n\t\t     Modern aren't shipping windows bits.\n\t\t     -->\n\t\t<FilterDeniedAssemblies Condition=\"'$(TargetFrameworkIdentifier)' != 'Xamarin.Mac'\">true</FilterDeniedAssemblies>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<CodesignProvision Condition=\"'$(CodesignProvision)' == ''\"></CodesignProvision>\n\t\t<CodesignEntitlements Condition=\"'$(CodesignEntitlements)' == ''\"></CodesignEntitlements>\n\t\t<CodesignExtraArgs Condition=\"'$(CodesignExtraArgs)' == ''\"></CodesignExtraArgs>\n\t\t<CreatePackage Condition=\"'$(CreatePackage)' == ''\">false</CreatePackage>\n\t\t<HttpClientHandler Condition=\"'$(HttpClientHandler)' == ''\">HttpClientHandler</HttpClientHandler>\n\t\t<EnablePackageSigning Condition=\"'$(EnablePackageSigning)' == ''\">false</EnablePackageSigning>\n\t\t<PackageSigningKey Condition=\"'$(PackageSigningKey)' == ''\"></PackageSigningKey>\n\t\t<ProductDefinition Condition=\"'$(ProductDefinition)' == ''\"></ProductDefinition>\n\t\t<PackagingExtraArgs Condition=\"'$(PackagingExtraArgs)' == ''\"></PackagingExtraArgs>\n\t\t<I18n Condition=\"'$(I18n)' == ''\"></I18n>\n\t\t<IncludeMonoRuntime Condition=\"'$(IncludeMonoRuntime)' == ''\">true</IncludeMonoRuntime>\n\t\t<IsAppExtension Condition=\"'$(IsAppExtension)' == ''\">False</IsAppExtension>\n\t\t<EnableSGenConc Condition=\"'$(EnableSGenConc)' == ''\">false</EnableSGenConc>\n\t\t<AotScope Condition=\"'$(AotScope)' == ''\">None</AotScope>\n\t\t<ArchiveOnBuild Condition=\"'$(ArchiveOnBuild)' == ''\">False</ArchiveOnBuild>\n\t\t<Profiling Condition=\"'$(MtouchProfiling)' == ''\">False</Profiling>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(TargetFrameworkName)' == 'Full'\">\n\t\t<AssemblySearchPaths>$(_XamarinSdkRoot)/lib/reference/full;$(_XamarinSdkRoot)/lib/mono;$(AssemblySearchPaths)</AssemblySearchPaths>\n\t\t<ImplicitlyExpandNETStandardFacades>False</ImplicitlyExpandNETStandardFacades>\n\t</PropertyGroup>\n\n\t<!-- Do not resolve from the GAC in Modern or Full unless allow-unsafe-gac-resolution is passed in -->\n\t<PropertyGroup Condition=\"'$(TargetFrameworkName)' != 'System' And !$(_BundlerArguments.Contains('--allow-unsafe-gac-resolution'))\" >\n\t\t<AssemblySearchPaths>$([System.String]::Copy('$(AssemblySearchPaths)').Replace('{GAC}',''))</AssemblySearchPaths>\n\t\t<AssemblySearchPaths Condition=\"'$(MSBuildRuntimeVersion)' != ''\">$(AssemblySearchPaths.Split(';'))</AssemblySearchPaths>\n\t</PropertyGroup>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props')\"/>\n\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.Common.targets",
    "content": "<!--\n***********************************************************************************************\nXamarin.Mac.Common.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2014 Xamarin. All rights reserved.\n***********************************************************************************************\n-->\n\n<!-- Xamarin.Mac.Common.targets currently is not shared with Xamarin.Mac.ObjCBinding targets,\n     so be careful not to add fixes here that should go into Xamarin.Mac.Common.props which is shared -->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.Common.props\" />\n\t\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Shared.targets\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\n\t<PropertyGroup>\n\t\t<_CanOutputAppBundle>False</_CanOutputAppBundle>\n\t\t<_CanOutputAppBundle Condition=\"'$(OutputType)' == 'Exe' Or '$(IsAppExtension)' == 'true'\">true</_CanOutputAppBundle>\n\n\t\t<_CanArchive>False</_CanArchive>\n\t\t<_CanArchive Condition=\"'$(OutputType)' == 'Exe'\">true</_CanArchive>\n\n\t\t<_RequireProvisioningProfile>False</_RequireProvisioningProfile>\n\t\t<_RequireProvisioningProfile Condition=\"'$(CodesignProvision)' != ''\">True</_RequireProvisioningProfile>\n\n\t\t<_PreparedResourceRules></_PreparedResourceRules>\n\t\t<_AppBundleName>$(AssemblyName)</_AppBundleName>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(UsingAppleNETSdk)' != 'true'\">\n\t\t<BuildDependsOn>\n\t\t\tBuildOnlySettings;\n\t\t\t_CollectBundleResources;\n\t\t\t_PackLibraryResources;\n\t\t\t_UnpackLibraryResources;\n\t\t\t$(BuildDependsOn);\n\t\t\t_GenerateBundleName;\n\t\t\t_CreateAppBundle;\n\t\t\tCodesign;\n\t\t\t_CreateInstaller;\n\t\t\tArchive;\n\t\t</BuildDependsOn>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<CreateAppBundleDependsOn Condition=\"'$(UsingAppleNETSdk)' != 'true'\">\n\t\t\t_DetectSigningIdentity;\n\t\t\t_CopyResourcesToBundle;\n\t\t\t_SmeltMetal;\n\t\t\t_ForgeMetal;\n\t\t\t_TemperMetal;\n\t\t\t_CompileEntitlements;\n\t\t\t_CompileAppManifest;\n\t\t\t_ParseBundlerArguments;\n\t\t\t_CompileToNative;\n\t\t\t_CreatePkgInfo;\n\t\t\t_CopyAppExtensionsToBundle;\n\t\t\t_ReadAppExtensionDebugSymbolProperties;\n\t\t\t_GenerateAppExtensionDebugSymbols;\n\t\t\t_PrepareDebugSymbolGeneration;\n\t\t\t_GenerateDebugSymbols;\n\t\t</CreateAppBundleDependsOn>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<_CodesignAppBundleDependsOn>\n\t\t\t_CreateAppBundle;\n\t\t\t_EmbedProvisionProfile;\n\t\t\t_CodesignNativeLibraries;\n\t\t\t_CollectFrameworks;\n\t\t\t_CodesignFrameworks;\n\t\t</_CodesignAppBundleDependsOn>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(UsingAppleNETSdk)' != 'true'\">\n\t\t<CleanDependsOn>\n\t\t\t$(CleanDependsOn);\n\t\t\t_CleanAppBundle;\n\t\t\t_CleanIntermediateToolOutput;\n\t\t</CleanDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CleanAppBundle\" Condition=\"'$(_CanOutputAppBundle)' == 'true'\" DependsOnTargets=\"_GenerateBundleName\">\n\t\t<RemoveDir Directories=\"$(_AppBundlePath)\" />\n\t</Target>\n\n\t<Target Name=\"_CleanIntermediateToolOutput\">\n\t\t<RemoveDir Directories=\"$(IntermediateOutputPath)actool\" />\n\t\t<RemoveDir Directories=\"$(IntermediateOutputPath)ibtool\" />\n\t\t<RemoveDir Directories=\"$(IntermediateOutputPath)metal\" />\n\t\t<RemoveDir Directories=\"$(IntermediateOutputPath)scntool\" />\n\t\t<RemoveDir Directories=\"$(IntermediateOutputPath)TextureAtlas\" />\n\t\t<RemoveDir Directories=\"$(IntermediateOutputPath)\" />\n\t</Target>\n\n\t<Target Name=\"_CodesignAppBundle\" Condition=\"'$(_RequireCodeSigning)'\" DependsOnTargets=\"$(_CodesignAppBundleDependsOn)\">\n\t\t<Codesign\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tToolExe=\"$(CodesignExe)\"\n\t\t\tToolPath=\"$(CodesignPath)\"\n\t\t\tCodesignAllocate=\"$(_CodesignAllocate)\"\n\t\t\tKeychain=\"$(CodesignKeychain)\"\n\t\t\tEntitlements=\"$(IntermediateOutputPath)Entitlements.xcent\"\n\t\t\tResources=\"$(AppBundleDir)\"\n\t\t\tSigningKey=\"$(_CodeSigningKey)\"\n\t\t\tExtraArgs=\"$(CodesignExtraArgs)\"\n\t\t\tIsAppExtension=\"$(IsAppExtension)\"\n\t\t\tUseHardenedRuntime=\"$(UseHardenedRuntime)\"\n\t\t\tUseSecureTimestamp=\"$(UseHardenedRuntime)\"\n\t\t\t>\n\t\t</Codesign>\n\t</Target>\n\n\t<Target Name=\"_CodesignVerify\" Condition=\"'$(_RequireCodeSigning)'\" DependsOnTargets=\"_CodesignAppBundle\">\n\t\t<CodesignVerify\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tToolExe=\"$(CodesignExe)\"\n\t\t\tToolPath=\"$(CodesignPath)\"\n\t\t\tCodesignAllocate=\"$(_CodesignAllocate)\"\n\t\t\tResource=\"$(AppBundleDir)\"\n\t\t>\n\t\t</CodesignVerify>\n\t</Target>\n\n\t<Target Name=\"_CompileTextureAtlases\" DependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_CoreCompileTextureAtlases\" />\n\n\t<Target Name=\"_CoreCompileTextureAtlases\">\n\t\t<TextureAtlas\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tToolExe=\"$(TextureAtlasExe)\"\n\t\t\tToolPath=\"$(TextureAtlasPath)\"\n\t\t\tAtlasTextures=\"@(AtlasTexture)\"\n\t\t\tIntermediateOutputPath=\"$(IntermediateOutputPath)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tSdkBinPath=\"$(_SdkBinPath)\"\n\t\t\tSdkUsrPath=\"$(_SdkUsrPath)\">\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"FileWrites\" />\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</TextureAtlas>\n\t</Target>\n\n\t<Target Name=\"_CompileProductDefinition\" Condition=\"$(CreatePackage)\" DependsOnTargets=\"_DetectAppManifest;_ComputeTargetArchitectures\">\n\t\t<CompileProductDefinition\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tProductDefinition=\"$(ProductDefinition)\"\n\t\t\tOutputDirectory = \"$(IntermediateOutputPath)\"\n\t\t\tTargetArchitectures = \"$(TargetArchitectures)\"\n\t\t\tAppManifest = \"$(_AppManifest)\">\n\t\t\t<Output TaskParameter=\"CompiledProductDefinition\" PropertyName=\"_CompiledProductDefinition\" />\n\t\t</CompileProductDefinition>\n\t</Target>\n\n\t<Target Name=\"_CreateInstaller\" Condition=\"$(CreatePackage)\" DependsOnTargets=\"Codesign;_CompileProductDefinition\">\n\t\t<CreateInstallerPackage\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tOutputDirectory = \"$(TargetDir)\"\n\t\t\tName = \"$(AssemblyName)\"\n\t\t\tAppManifest=\"$(_AppManifest)\"\n\t\t\tProjectPath= \"$(MSBuildProjectFullPath)\"\n\t\t\tAppBundleDir= \"$(AppBundleDir)\"\n\t\t\tMainAssembly= \"$(TargetPath)\"\n\t\t\tEnablePackageSigning = \"$(EnablePackageSigning)\"\n\t\t\tProductDefinition = \"$(_CompiledProductDefinition)\"\n\t\t\tPackageSigningKey = \"$(PackageSigningKey)\"\n\t\t\tPackagingExtraArgs = \"$(PackagingExtraArgs)\">\n\t\t</CreateInstallerPackage>\n\t</Target>\n\n\t<PropertyGroup>\n\t\t<CompileToNativeDependsOn>\n\t\t\t_ComputeLinkMode;\n\t\t\t_ComputeTargetFrameworkMoniker;\n\t\t\t_DetectAppManifest;\n\t\t\t_DetectSdkLocations;\n\t\t\t_GenerateBundleName;\n\t\t\tResolveReferences;\n\t\t\t_CompileEntitlements;\n\t\t\t_CompileAppManifest;\n\t\t\t_GetNativeExecutableName;\n\t\t\t_GetCompileToNativeInputs;\n\t\t\t_ExpandNativeReferences;\n\t\t\t_ComputeTargetArchitectures;\n\t\t</CompileToNativeDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CompileToNative\" DependsOnTargets=\"$(CompileToNativeDependsOn)\"\n\t\tCondition = \"'$(UsingAppleNETSdk)' != 'true'\"\n\t\tInputs=\"@(_CompileToNativeInput);@(_FileNativeReference);@(BundleDependentFiles)\"\n\t\tOutputs=\"$(_AppBundlePath)Contents\\MacOS\\$(_AppBundleName);$(DeviceSpecificOutputPath)bundler.stamp\">\n<!--\n\t\t<Mmp\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tAppBundleDir=\"$(AppBundleDir)\"\n\t\t\tOutputPath=\"$(OutputPath)\"\n\t\t\tApplicationName=\"$(_AppBundleName)\"\n\t\t\tMainAssembly=\"$(OutputPath)$(TargetName)$(TargetExt)\"\n\t\t\tMinimumOSVersion=\"$(_MinimumOSVersion)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tArchitecture=\"$(TargetArchitectures)\"\n\t\t\tArchiveSymbols=\"$(MonoSymbolArchive)\"\n\t\t\tCustomBundleName=\"$(_CustomBundleName)\"\n\t\t\tLinkMode=\"$(_LinkMode)\"\n\t\t\tDebug=\"$(_BundlerDebug)\"\n\t\t\tHttpClientHandler=\"$(HttpClientHandler)\"\n\t\t\tI18n=\"$(I18n)\"\n\t\t\tProfiling=\"$(Profiling)\"\n\t\t\tExtraArgs=\"$(_BundlerArguments)\"\n\t\t\tNativeReferences=\"@(_FrameworkNativeReference);@(_FileNativeReference)\"\n\t\t\tReferences=\"@(ReferencePath);@(_BundlerReferencePath)\"\n\t\t\tResponseFilePath=\"$(IntermediateOutputPath)response-file.rsp\"\n\t\t\tSdkRoot=\"$(_SdkDevPath)\"\n\t\t\tIntermediateOutputPath=\"$(IntermediateOutputPath)mmp-cache\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\tIsAppExtension=\"$(IsAppExtension)\"\n\t\t\tIsXPCService=\"$(IsXPCService)\"\n\t\t\tEnableSGenConc=\"$(EnableSGenConc)\"\n\t\t\tAotMode=\"$(AOTMode)\"\n\t\t\tHybridAOT=\"$(HybridAOT)\"\n\t\t\tExplicitAotAssemblies=\"$(ExplicitAotAssemblies)\"\n\t\t\tStandardOutputImportance=\"High\"\n\t\t\tXamarinSdkRoot=\"$(_XamarinSdkRoot)\"\n\t\t\t>\n\t\t</Mmp>\n-->\n\t\t<Touch\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tAlwaysCreate=\"true\"\n\t\t\tFiles=\"$(DeviceSpecificOutputPath)bundler.stamp\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"TouchedFiles\" ItemName=\"FileWrites\" />\n\t\t</Touch>\n\t</Target>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.msbuild.targets\" />\n\n\t<PropertyGroup>\n\t\t<ArchiveDependsOn>\n\t\t\t_CoreArchive\n\t\t</ArchiveDependsOn>\n\t</PropertyGroup>\n\t\n\t<Target Name=\"Archive\" Condition=\"'$(_CanArchive)' == 'true'\" DependsOnTargets=\"$(ArchiveDependsOn)\" />\n\t\n\t<Target Name=\"_CoreArchive\" Condition=\"'$(ArchiveOnBuild)' == 'true'\" DependsOnTargets=\"$(Codesign)\">\n\t\t<Error Text=\"Code signing must be enabled to create an Xcode archive.\" Condition=\"'$(_CodeSigningKey)' == ''\" />\n\n\t\t<Archive\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tAppBundleDir=\"$(AppBundleDir)\"\n\t\t\tInsightsApiKey=\"$(XamarinInsightsApiKey)\"\n\t\t\tSigningKey=\"$(_CodeSigningKey)\"\n\t\t\tProjectName=\"$(MSBuildProjectName)\"\n\t\t\tProjectGuid=\"$(ProjectGuid)\"\n\t\t\tProjectTypeGuids=\"$(ProjectTypeGuids)\"\n\t\t\tOutputPath=\"$(OutputPath)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tCustomBundleName=\"$(_CustomBundleName)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"ArchiveDir\" PropertyName=\"ArchiveDir\" />\n\t\t</Archive>\n\t</Target>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.FSharp.targets",
    "content": "<!--\n  Xamarin.Mac.FSharp.targets\n\n  Authors:\n    Dave Thomas <dave.thomas@xamarin.com>\n\n  Copyright 2014 Xamarin Inc. All Rights Reserved.\n-->\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\t\n\t<PropertyGroup>\n\t\t<!-- Version/fx properties -->\n\t\t<TargetFrameworkVersion Condition=\"'$(TargetFrameworkIdentifier)' == '' And '$(TargetFrameworkVersion)' ==''\">v4.5</TargetFrameworkVersion>\n\n\t\t<!-- This should be done in the F# target files, but _DebugFileExt is not an upstream\n\t\t     msbuild feature yet, so F# doesn't have this. Once, upstream F# adds it, we can\n\t\t     remove this -->\n\t\t<_DebugFileExt Condition=\"'$(FscDebugFileExt)' != ''\">$(FscDebugFileExt)</_DebugFileExt>\n\t\t<_DebugFileExt Condition=\"'$(_DebugFileExt)' == ''\">.mdb</_DebugFileExt>\n\t</PropertyGroup>\n\n\t    <Import Condition=\"Exists('$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\FSharp\\Microsoft.FSharp.Targets')\"\n\t\t        Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)\\FSharp\\Microsoft.FSharp.Targets\" />\n\n        <Import Condition=\"!$(MSBuildAllProjects.Contains('Microsoft.FSharp.Targets')) and Exists('$(MSBuildExtensionsPath32)\\..\\Microsoft SDKs\\F#\\3.1\\Framework\\v4.0\\Microsoft.FSharp.Targets')\"\n                Project=\"$(MSBuildExtensionsPath32)\\..\\Microsoft SDKs\\F#\\3.1\\Framework\\v4.0\\Microsoft.FSharp.Targets\" />\n\n        <Import Condition=\"!$(MSBuildAllProjects.Contains('Microsoft.FSharp.Targets')) and Exists('$(MSBuildExtensionsPath32)\\..\\Microsoft SDKs\\F#\\3.0\\Framework\\v4.0\\Microsoft.FSharp.Targets')\"\n                Project=\"$(MSBuildExtensionsPath32)\\..\\Microsoft SDKs\\F#\\3.0\\Framework\\v4.0\\Microsoft.FSharp.Targets\" />\n\n        <Import Condition=\"!$(MSBuildAllProjects.Contains('Microsoft.FSharp.Targets')) and Exists('$(MSBuildFrameworkToolsPath32)\\Microsoft.FSharp.Targets')\"\n                Project=\"$(MSBuildFrameworkToolsPath32)\\Microsoft.FSharp.Targets\" />\n\n        <Import Condition=\"!$(MSBuildAllProjects.Contains('Microsoft.FSharp.Targets')) and Exists('$(MSBuildBinPath)\\Microsoft.FSharp.Targets')\"\n                Project=\"$(MSBuildBinPath)\\Microsoft.FSharp.Targets\" />\n\n\t<Import Project=\"Xamarin.Mac.Common.targets\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.ObjCBinding.CSharp.props",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.ObjcBinding.CSharp.props\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2014 Xamarin Inc. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props\"\n\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props')\"/>\n\t\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.Common.props\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props\"\n\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props')\"/>\n\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.ObjCBinding.CSharp.targets",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.ObjcBinding.CSharp.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2014 Xamarin Inc. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\t\n\t<!-- This is used to set that we're a binding project. It must be set before including Xamarin.Shared.props -->\n\t<PropertyGroup>\n\t\t<IsBindingProject>true</IsBindingProject>\n\t</PropertyGroup>\n\n\t<!-- Due to IDE/template bugs, many bindings projects exist in the wild without correct TFI/TFV tags.\n\tIn addition, System is not supported, so treat System as Modern or Full, depending on TFV being set.\n\tMicrosoft.CSharp.targets gives TargetFrameworkVersion / TargetFrameworkIdentifier default values, so we _must_ do this _before_ \n\timport Microsoft.CSharp.targets. However, we can't do most of Xamarin.Mac.ObjCBinding.CSharp.props before it. -->\n\n\t<Choose>\n\t\t<When Condition=\" '$(UseXamMacFullFramework)' == '' And ( '$(TargetFrameworkVersion)' == 'v2.0' Or '$(TargetFrameworkVersion)' == '' ) And '$(UsingAppleNETSdk)' != 'true'\">\n\t\t\t<PropertyGroup>\n\t\t\t\t<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n\t\t\t\t<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>\n\t\t\t</PropertyGroup>\n\t\t</When>\n\t\t<When Condition=\"'$(UsingAppleNETSdk)' != 'true'\">\n\t\t\t<PropertyGroup>\n\t\t\t\t<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n\t\t\t\t<UseXamMacFullFramework>true</UseXamMacFullFramework>\n\t\t\t\t<TargetFrameworkIdentifier></TargetFrameworkIdentifier>\n\t\t\t</PropertyGroup>\n\t\t</When>\n\t</Choose>\n\n\t<Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" Condition=\"'$(UsingAppleNETSdk)' != 'true'\" />\n\t\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.ObjCBinding.CSharp.props\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.ObjCBinding.Common.targets\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Shared.targets\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.ObjCBinding.Common.props",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.ObjCBinding.Common.props\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file defines default properties for iOS projects.\n\nCopyright (C) 2014 Xamarin. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props')\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props')\"/>\n\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.ObjCBinding.Common.targets",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.ObjCBinding.Common.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2014 Xamarin Inc. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.ObjCBinding.Common.props\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\" \n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.msbuild.targets\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.TargetFrameworkFix.targets",
    "content": "<!--\n***********************************************************************************************\nXamarin.Mac.TargetFrameworkFix.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (c) 2018 Microsoft Corp. (www.microsoft.com)\n***********************************************************************************************\n-->\n\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<!-- Hack associated with TargetFrameworkDirectory. Needs to be shared by xbuild and msbuild for now. -->\n\n\t<!-- Location of Libraries -->\n\t<Target Name=\"FixTargetFrameworkDirectory\" AfterTargets=\"FixDesignTimeFacades\" Condition=\"('$(OS)' != 'Windows_NT')\">\n\t\t<PropertyGroup>\n\t\t\t<!-- For Modern / Full we overwrite TargetFrameworkDirectory to resolve non XM assemblies from our location only -->\n\t\t\t<TargetFrameworkDirectory Condition=\"'$(TargetFrameworkName)' != 'System'\">$(_XamarinBclPath);@(DesignTimeFacadeDirectories)</TargetFrameworkDirectory>\n\n\t\t\t<!-- For system we extend, not overwrite TargetFrameworkDirectory. -->\n\t\t\t<!-- mscorlib, System, and other BCL libs must come from Mono System to prevent corlib mistmatches. Xamarin.Mac.dll must come from XM/lib/mono/4.5/ -->\n\t\t\t<!-- If we find cases of other non-XM assemblies being resolved from XM paths, we can look into using CandidateAssemblyFiles but it is msbuild only. -->\n\t\t\t<TargetFrameworkDirectory Condition=\"'$(TargetFrameworkName)' == 'System'\">$(TargetFrameworkDirectory);$(_XamarinBclPath)</TargetFrameworkDirectory>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<Target Name=\"FixDesignTimeFacades\" AfterTargets=\"GetReferenceAssemblyPaths\" Condition=\"('$(OS)' != 'Windows_NT')\">\n\t\t<ItemGroup>\n\t\t\t<DesignTimeFacadeDirectories Remove=\"@(DesignTimeFacadeDirectories)\" />\n\t\t\t<DesignTimeFacadeDirectories Include=\"$(_XamarinBclPath)Facades/\" />\n\t\t</ItemGroup>\n\t</Target>\n</Project>\n\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Mac.msbuild.targets",
    "content": "﻿<!--\n***********************************************************************************************\nXamarin.Mac.msbuild.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (c) 2017 Microsoft Corp. (www.microsoft.com)\n***********************************************************************************************\n-->\n\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<!-- MSBuild specific hacks - Teach msbuild where to find our BCL and facades -->\n\n\t<!-- Location of mscorlib -->\n\t<PropertyGroup Condition=\"'$(OS)' != 'Windows_NT'\">\n\t\t<FrameworkPathOverride Condition=\"'$(TargetFrameworkName)' != 'System'\">$(_XamarinBclPath)</FrameworkPathOverride>\n\t</PropertyGroup>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Mac.TargetFrameworkFix.targets\"/>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Shared.ObjCBinding.targets",
    "content": "<!--\n***********************************************************************************************\nXamarin.Shared.ObjCBinding.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2020 Microsoft. All rights reserved.\n***********************************************************************************************\n-->\n\n<!-- This file is shared between Xamarin.iOS and Xamarin.Mac, but only included for binding projects -->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<!-- Add our own pre-build steps -->\n\t<PropertyGroup Condition=\"'$(UsingAppleNETSdk)' != 'true'\">\n\t\t<BuildDependsOn>\n\t\t\tBuildOnlySettings;\n\t\t\t_CreateGeneratedSourcesDir;\n\t\t\t_CreateEmbeddedResources;\n\t\t\t$(BuildDependsOn)\n\t\t</BuildDependsOn>\n\t</PropertyGroup>\n\n\t<!-- Add our own Clean steps -->\n\t<PropertyGroup Condition=\"'$(UsingAppleNETSdk)' != 'true'\">\n\t\t<CleanDependsOn>\n\t\t\t_CleanGeneratedSources;\n\t\t\t$(CleanDependsOn)\n\t\t</CleanDependsOn>\n\t</PropertyGroup>\n\n\t<!-- Create a directory to contain the generated sources -->\n\t<Target Name=\"_CreateGeneratedSourcesDir\">\n\t\t<MakeDir Directories=\"$(GeneratedSourcesDir)\" />\n\t</Target>\n\n\t<!-- Clean the generated sources -->\n\t<Target Name=\"_CleanGeneratedSources\">\n\t\t<RemoveDir Directories=\"$(GeneratedSourcesDir)\" Condition=\"Exists ('$(GeneratedSourcesDir)')\" />\n\t</Target>\n\n\t<Target Name=\"_CollectGeneratedSources\"\n\t\tDependsOnTargets=\"_GenerateBindings;_CompressNativeFrameworkResources\"\n\t\tCondition=\"'$(DesignTimeBuild)' != 'true'\"\n\t>\n\n\t\t<ReadLinesFromFile File=\"$(_GeneratedSourcesFileList)\" >\n\t\t\t<Output TaskParameter=\"Lines\" ItemName=\"GeneratedSources\" />\n\t\t</ReadLinesFromFile>\n\n\t\t<CreateItem Include=\"@(ObjcBindingCoreSource)\">\n\t\t\t<Output TaskParameter=\"Include\" ItemName=\"Compile\" />\n\t\t</CreateItem>\n\n\t\t<CreateItem Include=\"@(GeneratedSources)\">\n\t\t\t<Output TaskParameter=\"Include\" ItemName=\"Compile\" />\n\t\t</CreateItem>\n\n\t\t<ItemGroup>\n\t\t\t<EmbeddedResource Include=\"@(ObjcBindingNativeLibrary)\">\n\t\t\t\t<Type>Non-Resx</Type>\n\t\t\t\t<WithCulture>false</WithCulture>\n\t\t\t</EmbeddedResource>\n\t\t</ItemGroup>\n\t</Target>\n\n\t<!--\n\n\t\tWe can't just use @(_NativeFramework) as the input to the\n\t\t_CompressNativeFrameworkResources task, because _NativeFramework is a\n\t\tlist of directories, and MSBuild doesn't do dependency checks\n\t\tcorrectly when inputs are directories. So instead get all the files\n\t\tfrom every framework, and use that as the inputs.\n\n\t\tAdditionally we add two metadatas on each file:\n\n\t\t* The path to the framework the file belongs to\n\t\t* The path to the zip file where the compressed directory will be stored\n\n\t\tThen when we compress the frameworks in\n\t\t_CompressNativeFrameworkResources, we use the zip file metadata as the\n\t\toutput, which means MSBuild will batch the call to\n\t\t_CompressNativeFrameworkResources, and call\n\t\t_CompressNativeFrameworkResources once for each zip file, passing in\n\t\tonly the inputs that correspond to that zip file. This effectively\n\t\tmeans that _CompressNativeFrameworkResources will be called once for\n\t\teach framework we want to compress, which is exactly what we want.\n\n\t-->\n\t<Target Name=\"_CollectNativeFrameworkResources\" Returns=\"@(_NativeFrameworkResource)\" DependsOnTargets=\"_PrepareNativeReferences\">\n\t\t<ItemGroup>\n\t\t\t<_NativeFrameworkResource Include=\"%(_NativeFramework.Identity)\\**\\*.*\" Condition=\"'%(_NativeFramework.Identity)' != ''\">\n\t\t\t\t<FrameworkPath>%(_NativeFramework.Identity)</FrameworkPath>\n\t\t\t\t<ZipFile>$(IntermediateOutputPath)%(_NativeFramework.Filename)%(_NativeFramework.Extension)</ZipFile>\n\t\t\t</_NativeFrameworkResource>\n\t\t\t<_NativeFrameworkResource Include=\"%(ObjCBindingNativeFramework.Identity)\\**\\*.*\" Condition=\"'%(ObjCBindingNativeFramework.Identity)' != ''\">\n\t\t\t\t<FrameworkPath>%(ObjCBindingNativeFramework.Identity)</FrameworkPath>\n\t\t\t\t<ZipFile>$(IntermediateOutputPath)%(ObjCBindingNativeFramework.Filename)%(ObjCBindingNativeFramework.Extension)</ZipFile>\n\t\t\t</_NativeFrameworkResource>\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_CreateEmbeddedResources\" DependsOnTargets=\"_CollectBundleResources\">\n\t\t<CreateEmbeddedResources \n\t\t\tSessionId=\"$(BuildSessionId)\" \n\t\t\tBundleResources=\"@(_BundleResourceWithLogicalName)\" \n\t\t\tPrefix=\"$(_EmbeddedResourcePrefix)\">\n\t\t\t\n\t\t\t<Output ItemName=\"EmbeddedResource\" TaskParameter=\"EmbeddedResources\" />\n\t\t</CreateEmbeddedResources>\n\t</Target>\n\n\t<Target Name=\"_CompressNativeFrameworkResources\" Inputs=\"@(_NativeFrameworkResource)\" Outputs=\"%(_NativeFrameworkResource.ZipFile)\" DependsOnTargets=\"_CollectNativeFrameworkResources\">\n\t\t<Delete SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" Files=\"%(_NativeFrameworkResource.ZipFile)\" />\n\n\t\t<Zip\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tToolExe=\"$(ZipExe)\"\n\t\t\tToolPath=\"$(ZipPath)\"\n\t\t\tRecursive=\"true\"\n\t\t\tSymlinks=\"true\"\n\t\t\tSources=\"%(_NativeFrameworkResource.FrameworkPath)\"\n\t\t\tOutputFile=\"%(_NativeFrameworkResource.ZipFile)\"\n\t\t\tWorkingDirectory=\"%(_NativeFrameworkResource.FrameworkPath)\" >\n\t\t</Zip>\n\n\t\t<ItemGroup>\n\t\t\t<EmbeddedResource Include=\"%(_NativeFrameworkResource.ZipFile)\">\n\t\t\t\t<Type>Non-Resx</Type>\n\t\t\t\t<WithCulture>false</WithCulture>\n\t\t\t</EmbeddedResource>\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_PrepareNativeReferences\" Condition=\"'$(DesignTimeBuild)' != 'true'\">\n\t\t<PrepareNativeReferences\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tIntermediateOutputPath=\"$(IntermediateOutputPath)\"\n\t\t\tNativeReferences=\"@(NativeReference)\"\n\t\t>\n\t\t\t<Output ItemName=\"EmbeddedResource\" TaskParameter=\"EmbeddedResources\" Condition=\"'$(NoBindingEmbedding)' != 'true'\"/>\n\t\t\t<Output ItemName=\"_NativeFramework\" TaskParameter=\"NativeFrameworks\" Condition=\"'$(NoBindingEmbedding)' != 'true'\"/>\n\t\t\t<Output ItemName=\"Compile\" TaskParameter=\"LinkWithAttributes\" />\n\t\t</PrepareNativeReferences>\n\t</Target>\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Shared.Stubs.targets",
    "content": "<!--\n***********************************************************************************************\nXamarin.Shared.Stubs.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2013-2016 Xamarin Inc. All rights reserved.\n***********************************************************************************************\n-->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<!-- These \"stub\" targets are declared to prevent other (Windows specific) external targets from firing.\n\t     They are required as we share use of @(NativeReference) with ClickOnce, and if we don't stub then it can do the wrong thing.\n\t     Example: https://github.com/xamarin/xamarin-macios/issues/3876\n\t-->\n\t<Target Name=\"GenerateManifests\"\n\t      Condition=\"'$(GenerateClickOnceManifests)'=='true' or '@(NativeReference)'!='' or '@(ResolvedIsolatedComModules)'!='' or '$(GenerateAppxManifest)' == 'true'\"\n\t/>\n\n\t<Target Name=\"GenerateApplicationManifest\" \n\t\tInputs=\"$(MSBuildAllProjects);@(AppConfigWithTargetPath);$(_DeploymentBaseManifest);@(ResolvedIsolatedComModules);@(_DeploymentManifestDependencies);@(_DeploymentResolvedManifestEntryPoint);@(_DeploymentManifestFiles)\"\n\t\tOutputs=\"@(ApplicationManifest)\" />\n\n\t<Target Name=\"ResolveNativeReferences\"\n\t\tCondition=\"'@(NativeReference)'!=''\" />\n</Project>\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Shared.props",
    "content": "<!--\n***********************************************************************************************\nXamarin.Shared.props\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2020 Microsoft. All rights reserved.\n***********************************************************************************************\n-->\n\n<!-- This is shared between Xamarin.iOS and Xamarin.Mac -->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\n\t<PropertyGroup Condition=\"'$(_PlatformName)' == ''\">\n\t\t<_PlatformName Condition=\"'$(TargetFrameworkIdentifier)' == 'Xamarin.iOS'\">iOS</_PlatformName>\n\t\t<_PlatformName Condition=\"'$(TargetFrameworkIdentifier)' == 'Xamarin.MacCatalyst'\">iOS</_PlatformName>\n\t\t<_PlatformName Condition=\"'$(TargetFrameworkIdentifier)' == 'Xamarin.TVOS'\">tvOS</_PlatformName>\n\t\t<_PlatformName Condition=\"'$(TargetFrameworkIdentifier)' == 'Xamarin.WatchOS'\">watchOS</_PlatformName>\n\t\t<_PlatformName Condition=\"'$(TargetFrameworkIdentifier)' == 'Xamarin.MacCatalyst'\">MacCatalyst</_PlatformName>\n\t\t<_PlatformName Condition=\"'$(_PlatformName)' == ''\">macOS</_PlatformName> <!-- detecting Xamarin.Mac is a bit more complicated, so just fall back to macOS if none of the others match -->\n\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<!-- _XamarinSdkRoot\n\t\t\tXamarin.Mac: Defaults to XamarinMacFrameworkRoot, otherwise /Library/Frameworks/Xamarin.Mac.framework/Versions/Current\n\t\t\tXamarin.iOS: Defaults to MonoTouchSdkRoot, otherwise use MD_MTOUCH_SDK_ROOT, otherwise /Library/Frameworks/Xamarin.iOS.framework/Versions/Current\n\t\t-->\n\t\t<_XamarinSdkRoot Condition=\"'$(_XamarinSdkRoot)' == '' And '$(_PlatformName)' == 'macOS' \">$(XamarinMacFrameworkRoot)</_XamarinSdkRoot>\n\t\t<_XamarinSdkRoot Condition=\"'$(_XamarinSdkRoot)' == '' And '$(_PlatformName)' == 'macOS' \">/Library/Frameworks/Xamarin.Mac.framework/Versions/Current</_XamarinSdkRoot>\n\t\t<_XamarinSdkRoot Condition=\"'$(_XamarinSdkRoot)' == '' And '$(_PlatformName)' != 'macOS' \">$(MonoTouchSdkRoot)</_XamarinSdkRoot>\n\t\t<_XamarinSdkRoot Condition=\"'$(_XamarinSdkRoot)' == '' And '$(_PlatformName)' != 'macOS' \">$(MD_MTOUCH_SDK_ROOT)</_XamarinSdkRoot>\n\t\t<_XamarinSdkRoot Condition=\"'$(_XamarinSdkRoot)' == '' And '$(_PlatformName)' != 'macOS' \">/Library/Frameworks/Xamarin.iOS.framework/Versions/Current</_XamarinSdkRoot>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<!--\n\t\t     We don't want to use the Platform variable for conditional logic.\n\t\t     Switching to a new property allows us to potentially switch from\n\t\t     device to simulator builds dynamically based on the user's\n\t\t     selection when starting the project. This allows us to eventually\n\t\t     even (optionally) switch back to AnyCPU platform in the IDE,\n\t\t     therefore fixing a key pain point in managing solution\n\t\t     configurations.\n\n\t\t     Additionally, we cannot use $(Platform) in conditions on props,\n\t\t     because VS interprets them as valid platforms for the current\n\t\t     project and makes them available for solution configurations,\n\t\t     which fails miserably for iOS class library projects. By using\n\t\t     another property name, we \"opt out\" of this \"smart\" behavior\n\t\t-->\n\t\t<ComputedPlatform Condition=\"'$(ComputedPlatform)' == ''\">$(Platform)</ComputedPlatform>\n\t\t<ComputedPlatform Condition=\"'$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst' And '$(ComputedPlatform)' == 'AnyCPU'\">iPhone</ComputedPlatform>\n\t</PropertyGroup>\n\n\t<Choose>\n\t\t<!-- If TargetFrameworkIdentifier is 'Xamarin.Mac', then we're in Modern mode -->\n\t\t<When Condition=\"'$(TargetFrameworkIdentifier)' == 'Xamarin.Mac'\">\n\t\t\t<PropertyGroup>\n\t\t\t\t<TargetFrameworkName>Modern</TargetFrameworkName>\n\t\t\t\t<_XamarinBclPath>$(_XamarinSdkRoot)/lib/mono/Xamarin.Mac/</_XamarinBclPath>\n\t\t\t</PropertyGroup>\n\t\t</When>\n\t\t<!-- If TargetFrameworkIdentifier is not 'Xamarin.Mac', but we're still a macOS app and UseXamMacFullFramework is true, then we're in Full mode -->\n\t\t<When Condition=\"'$(TargetFrameworkIdentifier)' != 'Xamarin.Mac' And '$(_PlatformName)' == 'macOS' And '$(UseXamMacFullFramework)' == 'true'\">\n\t\t\t<PropertyGroup>\n\t\t\t\t<TargetFrameworkName>Full</TargetFrameworkName>\n\t\t\t\t<_XamarinBclPath>$(_XamarinSdkRoot)/lib/mono/4.5/</_XamarinBclPath>\n\t\t\t</PropertyGroup>\n\t\t</When>\n\t\t<!-- If the two other conditions don't match, but we're still a macOS app, then we're in System mode -->\n\t\t<When Condition=\"'$(_PlatformName)' == 'macOS'\">\n\t\t\t<PropertyGroup>\n\t\t\t\t<TargetFrameworkName>System</TargetFrameworkName>\n\t\t\t\t<_XamarinBclPath>$(_XamarinSdkRoot)/lib/mono/4.5/</_XamarinBclPath>\n\t\t\t</PropertyGroup>\n\t\t</When>\n\t</Choose>\n\t<PropertyGroup Condition=\"'$(_XamarinBclPath)' == ''\">\n\t\t<_XamarinBclPath Condition=\"'$(_PlatformName)' == 'MacCatalyst'\">$(_XamarinSdkRoot)/lib/mono/Xamarin.MacCatalyst/</_XamarinBclPath>\n\t\t<_XamarinBclPath Condition=\"'$(_PlatformName)' == 'iOS'\">$(_XamarinSdkRoot)/lib/mono/Xamarin.iOS/</_XamarinBclPath>\n\t\t<_XamarinBclPath Condition=\"'$(_PlatformName)' == 'tvOS'\">$(_XamarinSdkRoot)/lib/mono/Xamarin.TVOS/</_XamarinBclPath>\n\t\t<_XamarinBclPath Condition=\"'$(_PlatformName)' == 'watchOS'\">$(_XamarinSdkRoot)/lib/mono/Xamarin.WatchOS/</_XamarinBclPath>\n\t</PropertyGroup>\n\t<PropertyGroup>\n\t\t<_XamarinPlatformAssemblyName Condition=\"'$(_PlatformName)' == 'MacCatalyst'\">Xamarin.MacCatalyst.dll</_XamarinPlatformAssemblyName>\n\t\t<_XamarinPlatformAssemblyName Condition=\"'$(_PlatformName)' == 'iOS'\">Xamarin.iOS.dll</_XamarinPlatformAssemblyName>\n\t\t<_XamarinPlatformAssemblyName Condition=\"'$(_PlatformName)' == 'tvOS'\">Xamarin.TVOS.dll</_XamarinPlatformAssemblyName>\n\t\t<_XamarinPlatformAssemblyName Condition=\"'$(_PlatformName)' == 'watchOS'\">Xamarin.WatchOS.dll</_XamarinPlatformAssemblyName>\n\t\t<_XamarinPlatformAssemblyName Condition=\"'$(_PlatformName)' == 'macOS'\">Xamarin.Mac.dll</_XamarinPlatformAssemblyName>\n\t\t<_XamarinPlatformAssemblyPath>$(_XamarinBclPath)$(_XamarinPlatformAssemblyName)</_XamarinPlatformAssemblyPath>\n\t</PropertyGroup>\n\n\t<!-- Sometimes we've used different variable names for the same thing for Xamarin.iOS and Xamarin.Mac projects. Here we try to unify those variables -->\n\t<PropertyGroup>\n\t\t<!-- ResourcePrefix -->\n\t\t<MonoMacResourcePrefix Condition=\"'$(_PlatformName)' == 'macOS' And '$(MonoMacResourcePrefix)' == ''\">Resources</MonoMacResourcePrefix>\n\t\t<XamMacResourcePrefix Condition=\"'$(_PlatformName)' == 'macOS' And '$(XamMacResourcePrefix)' == ''\">$(MonoMacResourcePrefix)</XamMacResourcePrefix>\n\t\t<XamMacResourcePrefix Condition=\"'$(_PlatformName)' == 'macOS' And '$(XamMacResourcePrefix)' == ''\">Resources</XamMacResourcePrefix>\n\t\t<IPhoneResourcePrefix Condition=\"'$(_PlatformName)' != 'macOS' And '$(IPhoneResourcePrefix)' == ''\">Resources</IPhoneResourcePrefix>\n\t\t<_ResourcePrefix Condition=\"'$(_PlatformName)' == 'macOS'\">$(XamMacResourcePrefix)</_ResourcePrefix>\n\t\t<_ResourcePrefix Condition=\"'$(_PlatformName)' != 'macOS'\">$(IPhoneResourcePrefix)</_ResourcePrefix>\n\n\t\t<!-- SdkVersion -->\n\t\t<_SdkVersion Condition=\"'$(_PlatformName)' == 'macOS'\">$(MacOSXSdkVersion)</_SdkVersion>\n\t\t<_SdkVersion Condition=\"'$(_PlatformName)' != 'macOS'\">$(MtouchSdkVersion)</_SdkVersion>\n\n\t\t<!-- RequireCodeSigning -->\n\t\t<!-- iOS/watchOS/tvOS is simple: device builds require code signing, simulator builds do not. This is a big lie, for some simulator builds need to be signed, but the _DetectCodeSigning task handles those cases. -->\n\t\t<_RequireCodeSigning Condition=\"'$(_PlatformName)' != 'macOS' And '$(_RequireCodeSigning)' == ''\">false</_RequireCodeSigning> <!-- Xamarin.iOS builds are not signed by default -->\n\t\t<_RequireCodeSigning Condition=\"'$(_PlatformName)' != 'macOS' And '$(ComputedPlatform)' == 'iPhone'\">true</_RequireCodeSigning> <!-- except that device builds must be signed -->\n\t\t<!-- macOS is a bit more complicated:\n\t\t\t* 'EnableCodeSigning' specifies whether the app is signed or not, and this defaults to false if it's not set.\n\t\t\t* Extensions are special, because they must be signed. However, due to historical reasons, extension projects will have set EnableCodeSigning=false. So we do the following:\n\t\t\t    * If we're an extension, and code signing is disabled: enable code signing, set the code signing key (_CodeSigningKey) to '-', and pass this value to the _DetectCodeSigning task.\n\t\t-->\n\t\t<_RequireCodeSigning Condition=\"'$(_PlatformName)' == 'macOS' And '$(_RequireCodeSigning)' == ''\">$(EnableCodeSigning)</_RequireCodeSigning> <!-- Xamarin.Mac projects use the 'EnableCodeSigning' variable to enable code signing -->\n\t\t<_RequireCodeSigning Condition=\"'$(_PlatformName)' == 'macOS' And '$(_RequireCodeSigning)' == ''\">false</_RequireCodeSigning> <!-- Xamarin.Mac projects: disable by default -->\n\t\t<_CodeSigningKey Condition=\"'$(_PlatformName)' == 'macOS' And '$(IsAppExtension)' == 'true' And '$(_CodeSigningKey)' == '' And '$(_RequireCodeSigning)' == 'false'\">-</_CodeSigningKey> <!-- Set _CodeSigningKey to '-' if we're an extension where code signing is not requested -->\n\t\t<_RequireCodeSigning Condition=\"'$(_PlatformName)' == 'macOS' And '$(IsAppExtension)' == 'true'\">true</_RequireCodeSigning> <!-- But extensions must be signed, so make sure they are -->\n\n\t\t<!-- SpecifiedCodeSigningKey -->\n\t\t<_SpecifiedCodesignKey Condition=\"'$(_PlatformName)' == 'macOS'\">$(CodeSigningKey)</_SpecifiedCodesignKey> <!-- Xamarin.Mac projects use 'CodeSigningKey' -->\n\t\t<_SpecifiedCodesignKey Condition=\"'$(_PlatformName)' != 'macOS'\">$(CodesignKey)</_SpecifiedCodesignKey> <!-- Xamarin.iOS projects use 'CodesignKey' -->\n\n\t\t<!-- TargetArchitectures -->\n\t\t<TargetArchitectures Condition=\"'$(TargetArchitectures)' == '' And '$(_PlatformName)' == 'macOS'\">$(XamMacArch)</TargetArchitectures>\n\t\t<TargetArchitectures Condition=\"'$(TargetArchitectures)' == '' And '$(_PlatformName)' != 'macOS'\">$(MtouchArch)</TargetArchitectures>\n\t\t<!-- The default architecture for Xamarin.Mac is x86_64 -->\n\t\t<TargetArchitectures Condition=\"'$(TargetArchitectures)' == '' And '$(_PlatformName)' == 'macOS'\">x86_64</TargetArchitectures>\n\t\t<!-- There should always be an MtouchArch value in newer projects, but for older projects default to old values -->\n\t\t<TargetArchitectures Condition=\"'$(TargetArchitectures)' == '' And '$(_PlatformName)' != 'macOS' And '$(ComputedPlatform)' == 'iPhoneSimulator'\">i386</TargetArchitectures>\n\t\t<TargetArchitectures Condition=\"'$(TargetArchitectures)' == '' And '$(_PlatformName)' != 'macOS' And '$(ComputedPlatform)' == 'iPhone' And '$(TargetFrameworkIdentifier)' == 'Xamarin.WatchOS'\">ARMv7k</TargetArchitectures>\n\t\t<TargetArchitectures Condition=\"'$(TargetArchitectures)' == '' And '$(_PlatformName)' != 'macOS' And '$(ComputedPlatform)' == 'iPhone' And '$(TargetFrameworkIdentifier)' == 'Xamarin.TVOS'\">ARM64</TargetArchitectures>\n\t\t<TargetArchitectures Condition=\"'$(TargetArchitectures)' == '' And '$(_PlatformName)' != 'macOS' And '$(ComputedPlatform)' == 'iPhone'\">ARMv7</TargetArchitectures>\n\n\t\t<!-- Debug -->\n\t\t<!-- Xamarin.Mac: use MmpDebug -->\n\t\t<_BundlerDebug Condition=\"'$(_BundlerDebug)' == '' And '$(_PlatformName)' == 'macOS'\">$(MmpDebug)</_BundlerDebug>\n\t\t<!-- Xamarin.iOS: Use MtouchDebug -->\n\t\t<_BundlerDebug Condition=\"'$(_BundlerDebug)' == '' And '$(_PlatformName)' != 'macOS'\">$(MtouchDebug)</_BundlerDebug>\n\t\t<!-- Otherwise the default is true if we're building a Debug configuration -->\n\t\t<_BundlerDebug Condition=\"'$(_BundlerDebug)' == '' And '$(Configuration)' == 'Debug'\">true</_BundlerDebug>\n\t\t<!-- As a last resort, the default is false for all platforms -->\n\t\t<_BundlerDebug Condition=\"'$(_BundlerDebug)' == ''\">false</_BundlerDebug>\n\n\t\t<!-- Extra arguments -->\n\t\t<_BundlerArguments Condition=\"'$(_PlatformName)' == 'macOS'\">$(MonoBundlingExtraArgs)</_BundlerArguments>\n\t\t<_BundlerArguments Condition=\"'$(_PlatformName)' != 'macOS'\">$(MtouchExtraArgs)</_BundlerArguments>\n\n\t\t<!-- NoSymbolStrip -->\n\t\t<!-- Xamarin.Mac never had an equivalent for MtouchNoSymbolStrip and was never stripped -> true -->\n\t\t<!-- default to 'false' -->\n\t\t<_NoSymbolStrip Condition=\"'$(_PlatformName)' != 'macOS'\">$(MtouchNoSymbolStrip)</_NoSymbolStrip>\n\t\t<_NoSymbolStrip Condition=\"'$(_PlatformName)' == 'macOS'\">true</_NoSymbolStrip>\n\t\t<_NoSymbolStrip Condition=\"'$(_NoSymbolStrip)' == ''\">false</_NoSymbolStrip>\n\n\t\t<!-- NoDSymUtil -->\n\t\t<!-- Xamarin.Mac never had an equivalent for MtouchNoDSymUtil and never produced them -> now, produce them by default when archiving -->\n\t\t<_NoDSymUtil Condition=\"'$(_PlatformName)' != 'macOS'\">$(MtouchNoDSymUtil)</_NoDSymUtil>\n\t\t<_NoDSymUtil Condition=\"'$(_PlatformName)' == 'macOS' And '$(ArchiveOnBuild)' != 'true'\">true</_NoDSymUtil>\n\t\t<_NoDSymUtil Condition=\"'$(_NoDSymUtil)' == ''\">false</_NoDSymUtil>\n\n\t\t<!-- DeviceSpecificIntermediateOutputPath -->\n\t\t<!--\n\t\t\tWe don't need this value for Xamarin.Mac, but many of the targets\n\t\t\tthat can be shared need to use this for Xamarin.iOS, so set this\n\t\t\tvalue for Xamarin.Mac as well. It will always be the default\n\t\t\tIntermediateOutputPath for Xamarin.Mac, while for Xamarin.iOS it\n\t\t\tmight be changed in _ComputeTargetArchitectures.\n\t\t-->\n\t\t<DeviceSpecificIntermediateOutputPath>$(IntermediateOutputPath)</DeviceSpecificIntermediateOutputPath>\n\t\t<!-- Make sure DeviceSpecificOutputPath is a relative path, we depend\n\t\t     on this elsewhere (we prepend the project's directory). When\n\t\t     using dotnet IntermediateOutputPath (and thus\n\t\t     DeviceSpecificIntermediateOutputPath) might be a full path, so\n\t\t     handle this by calculating the corresponding relative path for\n\t\t     DeviceSpecificOutputPath. -->\n\t\t<DeviceSpecificOutputPath>$(OutputPath)</DeviceSpecificOutputPath>\n\t\t<DeviceSpecificOutputPath Condition=\"$([System.IO.Path]::IsPathRooted('$(DeviceSpecificOutputPath)')) == 'true'\">$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)','$(OutputPath)'))</DeviceSpecificOutputPath>\n\n\t\t<!-- OptimizePNGs:\n\t\t\tdefault to false if a binding project (both XI and XM)\n\t\t\totherwise default to false if a Xamarin.Mac project\n\t\t\totherwise default to true for Xamarin.iOS\n\t\t-->\n\t\t<OptimizePNGs Condition=\"'$(IsBindingProject)' == 'true' And '$(OptimizePNGs)' == ''\">false</OptimizePNGs>\n\t\t<OptimizePNGs Condition=\"'$(_PlatformName)' == 'macOS' And '$(OptimizePNGs)' == ''\">false</OptimizePNGs>\n\t\t<OptimizePNGs Condition=\"'$(_PlatformName)' != 'macOS' And '$(OptimizePNGs)' == ''\">true</OptimizePNGs>\n\n\t\t<!-- OptimizePropertyLists:\n\t\t\tdefault to false if a binding project (both XI and XM)\n\t\t\totherwise default to false if a Xamarin.Mac project\n\t\t\totherwise default to true for Xamarin.iOS\n\t\t-->\n\t\t<OptimizePropertyLists Condition=\"'$(IsBindingProject)' == 'true' And '$(OptimizePropertyLists)' == ''\">false</OptimizePropertyLists>\n\t\t<OptimizePropertyLists Condition=\"'$(_PlatformName)' == 'macOS' And '$(OptimizePropertyLists)' == ''\">false</OptimizePropertyLists>\n\t\t<OptimizePropertyLists Condition=\"'$(_PlatformName)' != 'macOS' And '$(OptimizePropertyLists)' == ''\">true</OptimizePropertyLists>\n\n\t\t<!-- EnableOnDemandResources: default to true for Xamarin.iOS and false for Xamarin.Mac -->\n\t\t<EnableOnDemandResources Condition=\"'$(_PlatformName)' == 'macOS' And '$(EnableOnDemandResources)' == ''\">false</EnableOnDemandResources>\n\t\t<EnableOnDemandResources Condition=\"'$(_PlatformName)' != 'macOS' And '$(EnableOnDemandResources)' == ''\">true</EnableOnDemandResources>\n\n\t\t<!-- This is the prefix used for embedded resources, both for library projects and binding projects -->\n\t\t<_EmbeddedResourcePrefix Condition=\"'$(_PlatformName)' == 'macOS'\">xammac</_EmbeddedResourcePrefix>\n\t\t<_EmbeddedResourcePrefix Condition=\"'$(_PlatformName)' != 'macOS'\">monotouch</_EmbeddedResourcePrefix>\n\n\t\t<_AppBundleManifestRelativePath Condition=\"'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'\">Contents/</_AppBundleManifestRelativePath>\n\n\t\t<AppBundleExtension Condition=\"'$(AppBundleExtension)' == '' And '$(IsAppExtension)' == 'true' And '$(IsXpcService)' == 'true'\">.xpc</AppBundleExtension>\n\t\t<AppBundleExtension Condition=\"'$(AppBundleExtension)' == '' And '$(IsAppExtension)' == 'true'\">.appex</AppBundleExtension>\n\t\t<AppBundleExtension Condition=\"'$(AppBundleExtension)' == ''\">.app</AppBundleExtension>\n\n\t\t<!-- Accept 'UseInterpreter' as an alternative for 'MtouchInterpreter', so that we have the same variable name as Android -->\n\t\t<MtouchInterpreter Condition=\"'$(MtouchInterpreter)' == '' And '$(UseInterpreter)' == 'True'\">all</MtouchInterpreter>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(IsBindingProject)' == 'true'\">\n\t\t<BaseLibDllPath Condition=\"'$(OS)' == 'Unix'\">$(_XamarinPlatformAssemblyPath)</BaseLibDllPath>\n\n\t\t<BTouchToolPath Condition=\"'$(OS)' == 'Unix' And '$(BTouchToolPath)' == ''\">$(_XamarinSdkRoot)/bin/</BTouchToolPath>\n\t\t<BTouchToolPath Condition=\"'$(OS)' != 'Unix' And '$(_PlatformName)' != 'macOS' And '$(BTouchToolPath)' == ''\">$(MSBuildExtensionsPath)\\Xamarin\\iOS\\</BTouchToolPath>\n\n\t\t<BTouchToolExe  Condition=\"'$(OS)' == 'Unix' And '$(BTouchToolExe)' == ''\">bgen</BTouchToolExe>\n\t\t<BTouchToolExe  Condition=\"'$(OS)' != 'Unix' And '$(BTouchToolExe)' == ''\">bgen.exe</BTouchToolExe>\n\n\t\t<GeneratedSourcesDir Condition=\"'$(GeneratedSourcesDir)' == ''\">$(IntermediateOutputPath)$(_PlatformName)</GeneratedSourcesDir>\n\t\t<GeneratedSourcesDir Condition=\"'$(GeneratedSourcesDir)' != '' and !HasTrailingSlash ('$(GeneratedSourcesDir)')\">$(GeneratedSourcesDir)\\</GeneratedSourcesDir>\n\t\t<_GeneratedSourcesFileList>$(GeneratedSourcesDir)sources.list</_GeneratedSourcesFileList>\n\n\t\t<ProcessEnums Condition=\"'$(ProcessEnums)' == ''\">false</ProcessEnums>\n\n\t\t<!-- The generated binding code is unsafe, so make sure to allow unsafe code when compiling the C# code -->\n\t\t<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n\n\t\t<!-- Build bindings with the latest (stable) version of C#\n\n\t\t     We require C# 8 for nullability support. However we allow custom\n\t\t     code to be included inside binding projects and we should not\n\t\t     support anything (stable) that the C# compiler (installed\n\t\t     separately) allow, so `latest` it is.\n\t\t-->\n\t\t<LangVersion>latest</LangVersion>\n\t</PropertyGroup>\n\n\t<Target Name=\"_ComputeTargetFrameworkMoniker\" Condition=\"'$(_ComputedTargetFrameworkMoniker)' == ''\">\n\t\t<PropertyGroup>\n\t\t\t<!-- Get the TargetFrameworkMoniker and store it in our own variable so that it's overridable while only affecting the parts of the build that we care about.\n\t\t\t\t This is overridability is a workaround while we wait for .NET 5 to be able to give us the TFM we're supposed to get during the build. -->\n\t\t\t<_ComputedTargetFrameworkMoniker>$(TargetFrameworkMoniker)</_ComputedTargetFrameworkMoniker>\n\t\t\t<!-- Detect the Mobile condition and set the computed Mobile TFM our tooling expects -->\n\t\t\t<_ComputedTargetFrameworkMoniker Condition=\"'$(_PlatformName)' == 'macOS' And '$(_ComputedTargetFrameworkMoniker)' == 'Xamarin.Mac,Version=v2.0'\">Xamarin.Mac,Version=v2.0,Profile=Mobile</_ComputedTargetFrameworkMoniker>\n\t\t\t<!-- Detect the Full condition and set the computed TFM our tooling expects -->\n\t\t\t<_ComputedTargetFrameworkMoniker Condition=\"'$(_PlatformName)' == 'macOS' And '$(UseXamMacFullFramework)' == 'true' And $([MSBuild]::ValueOrDefault('$(_ComputedTargetFrameworkMoniker),', '').StartsWith('.NETFramework,', StringComparison.OrdinalIgnoreCase))\">Xamarin.Mac,Version=v4.5,Profile=Full</_ComputedTargetFrameworkMoniker>\n\t\t\t<!-- Detect the System condition and set the computed TFM our tooling expects -->\n\t\t\t<_ComputedTargetFrameworkMoniker Condition=\"'$(_PlatformName)' == 'macOS' And '$(UseXamMacFullFramework)' != 'true' And $([MSBuild]::ValueOrDefault('$(_ComputedTargetFrameworkMoniker),', '').StartsWith('.NETFramework,', StringComparison.OrdinalIgnoreCase))\">Xamarin.Mac,Version=v4.5,Profile=System</_ComputedTargetFrameworkMoniker>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<!-- When looking for related files to copy, look for Mono debugging files as well -->\n\t<PropertyGroup>\n\t\t<AllowedReferenceRelatedFileExtensions>\n\t\t\t$(AllowedReferenceRelatedFileExtensions);\n\t\t\t.dll.mdb;\n\t\t\t.exe.mdb;\n\t\t\t.pdb\n\t\t</AllowedReferenceRelatedFileExtensions>\n\t</PropertyGroup>\n\n\t<!-- This is used to determine if VS is connected to mac. -->\n\t<PropertyGroup>\n\t\t<IsMacEnabled Condition=\"'$(IsMacEnabled)' == '' And !$([MSBuild]::IsOSPlatform('windows'))\">true</IsMacEnabled>\n\t\t<IsMacEnabled Condition=\"'$(IsMacEnabled)' == '' And  $([MSBuild]::IsOSPlatform('windows'))\">false</IsMacEnabled>\n\t\t<MtouchTargetsEnabled Condition=\"'$(_PlatformName)' != 'macOS'\">$(IsMacEnabled)</MtouchTargetsEnabled>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<!-- Enable nuget package conflict resolution -->\n\t\t<ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<_IsUnifiedDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)__UNIFIED__($|;)'))</_IsUnifiedDefined>\n\t\t<_IsMobileDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)__MOBILE__($|;)'))</_IsMobileDefined>\n\t\t<_IsIOSDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)__IOS__($|;)'))</_IsIOSDefined>\n\t\t<_IsTVOSDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)__TVOS__($|;)'))</_IsTVOSDefined>\n\t\t<_IsWatchOSDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)__WATCHOS__($|;)'))</_IsWatchOSDefined>\n\t\t<_IsMacOSDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)__MACOS__($|;)'))</_IsMacOSDefined>\n\t\t<_IsMacCatalystDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)__MACCATALYST__($|;)'))</_IsMacCatalystDefined>\n\n\t\t<DefineConstants Condition=\"!$(_IsUnifiedDefined)\">__UNIFIED__;$(DefineConstants)</DefineConstants>\n\t\t<DefineConstants Condition=\"!$(_IsMobileDefined) And '$(_PlatformName)' != 'macOS'\">__MOBILE__;$(DefineConstants)</DefineConstants>\n\t\t<DefineConstants Condition=\"!$(_IsIOSDefined) And '$(_PlatformName)' == 'iOS'\">__IOS__;$(DefineConstants)</DefineConstants>\n\t\t<DefineConstants Condition=\"!$(_IsTVOSDefined) And '$(_PlatformName)' == 'tvOS'\">__TVOS__;$(DefineConstants)</DefineConstants>\n\t\t<DefineConstants Condition=\"!$(_IsWatchOSDefined) And '$(_PlatformName)' == 'watchOS'\">__WATCHOS__;$(DefineConstants)</DefineConstants>\n\t\t<DefineConstants Condition=\"!$(_IsMacOSDefined) And '$(_PlatformName)' == 'macOS'\">__MACOS__;$(DefineConstants)</DefineConstants>\n\t\t<DefineConstants Condition=\"!$(_IsIOSDefined) And '$(_PlatformName)' == 'MacCatalyst'\">__IOS__;$(DefineConstants)</DefineConstants> <!-- We define __IOS__ for MacCatalyst as well for now -->\n\t\t<DefineConstants Condition=\"!$(_IsMacCatalystDefined) And '$(_PlatformName)' == 'MacCatalyst'\">__MACCATALYST__;$(DefineConstants)</DefineConstants>\n\t</PropertyGroup>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n\n"
  },
  {
    "path": "src/mac/msbuild/Xamarin.Shared.targets",
    "content": "<!--\n***********************************************************************************************\nXamarin.Shared.targets\n\nWARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have\n  created a backup copy.  Incorrect changes to this file will make it\n  impossible to load or build your projects from the command-line or the IDE.\n\nThis file imports the version- and platform-specific targets for the project importing\nthis file. This file also defines targets to produce an error if the specified targets\nfile does not exist, but the project is built anyway (command-line or IDE build).\n\nCopyright (C) 2018 Microsoft. All rights reserved.\n***********************************************************************************************\n-->\n\n<!-- This is shared between Xamarin.iOS and Xamarin.Mac -->\n\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\n\t<PropertyGroup Condition=\"'$(_TaskAssemblyName)' == ''\">\n\t\t<_TaskAssemblyName Condition=\"'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS' Or '$(_PlatformName)' == 'MacCatalyst'\">$(MSBuildThisFileDirectory)..\\iOS\\Xamarin.iOS.Tasks.dll</_TaskAssemblyName>\n\t\t<_TaskAssemblyName Condition=\"'$(_PlatformName)' == 'macOS'\">$(MSBuildThisFileDirectory)Xamarin.Mac.Tasks.dll</_TaskAssemblyName>\n\t</PropertyGroup>\n\n\t<!-- Tasks that override built-in tasks to support remoting from VS/Windows -->\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.Copy\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.Delete\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.Exec\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.MakeDir\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.Move\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.RemoveDir\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.Touch\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Microsoft.Build.Tasks.WriteLinesToFile\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\n\t<!-- Xamarin.iOS-specific tasks. Some of these are duplicated with the Xamarin.Mac ones below, and should eventually be re-namespaced to be in Xamarin.MacDev -->\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ACTool\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ALToolUpload\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ALToolValidate\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.Archive\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.BTouch\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CodesignVerify\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CollectAssetPacks\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CollectITunesArtwork\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CollectITunesSourceFiles\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CompileAppManifest\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CompileEntitlements\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CompileITunesMetadata\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CompileSceneKitAssets\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CreateAssetPack\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CreateBindingResourcePackage\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CreateDebugConfiguration\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CreateDebugSettings\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.CreateEmbeddedResources\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.DetectDebugNetworkConfiguration\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.DetectSdkLocations\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.DetectSigningIdentity\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.FindWatchOS2AppBundle\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.GetDirectories\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.GetFiles\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.GetMlaunchArguments\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.IBTool\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.Metal\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.MetalLib\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.MTouch\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.OptimizeImage\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.OptimizePropertyList\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ParseDeviceSpecificBuildInformation\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.PrepareNativeReferences\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ResolveNativeWatchApp\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ResolveUniversalTypeIdentifiers\" AssemblyFile=\"Xamarin.iOS.Tasks.dll\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ScnTool\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.TextureAtlas\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.ValidateAppBundleTask\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.VerifyXcodeVersion\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' != 'macOS'\" TaskName=\"Xamarin.iOS.Tasks.WriteAssetPackManifest\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\n\t<!-- Xamarin.Mac-specific tasks. Some of these are duplicated with the Xamarin.iOS ones above, and should eventually be re-namespaced to be in Xamarin.MacDev -->\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.ACTool\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.Archive\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.BTouch\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.CodesignVerify\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.CompileAppManifest\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.CompileEntitlements\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.CompileSceneKitAssets\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.CreateBindingResourcePackage\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.CreateEmbeddedResources\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.DetectSdkLocations\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.DetectSigningIdentity\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.IBTool\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.Metal\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.MetalLib\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.Mmp\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.PrepareNativeReferences\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.ScnTool\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask Condition=\"'$(_PlatformName)' == 'macOS'\" TaskName=\"Xamarin.Mac.Tasks.TextureAtlas\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\n\t<!-- Tasks shared between Xamarin.iOS and Xamarin.Mac -->\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.ArTool\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.AOTCompile\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.Codesign\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.CollectBundleResources\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.CollectFrameworks\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.ComputeBundleResourceOutputPaths\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.CoreMLCompiler\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.CreateAssetPackManifest\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.CreateInstallerPackage\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.CreatePkgInfo\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.CompileProductDefinition\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.Ditto\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.DSymUtil\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.EmbedProvisionProfile\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.FindItemWithLogicalName\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.GenerateBundleName\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.GetFullPath\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.GetMinimumOSVersion\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.GetNativeExecutableName\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.GetPropertyListValue\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.PackLibraryResources\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.ParseBundlerArguments\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.PrepareResourceRules\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.PropertyListEditor\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.ReadItemsFromFile\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.ResolveNativeReferences\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.SmartCopy\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.SpotlightIndexer\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.SymbolStrip\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.UnpackLibraryResources\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.WriteItemsToFile\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\t<UsingTask TaskName=\"Xamarin.MacDev.Tasks.Zip\" AssemblyFile=\"$(_TaskAssemblyName)\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')\"/>\n\n\t<!--\n\t\t@(NativeReference) are not safe to use as an Input to a task, as frameworks are a directory and will appears unbuilt every time.\n\t\tSo we split it into two camps as a prebuild step\n\t-->\n\t<Target Name=\"_ExpandNativeReferences\" Condition=\"'$(DesignTimeBuild)' != 'true'\" DependsOnTargets=\"_DetectSdkLocations;_ComputeTargetArchitectures\">\n\t\t<ItemGroup>\n\t\t\t<_XCFrameworkNativeReference Include=\"@(NativeReference -> '%(Identity)/.')\" Condition=\"'%(Extension)' == '.xcframework'\" />\n\t\t\t<_FrameworkNativeReference Include=\"@(NativeReference -> '%(Identity)/%(Filename)')\" Condition=\"'%(Extension)' == '.framework'\" />\n\t\t\t<_FileNativeReference Include=\"@(NativeReference)\" Condition=\"'%(Extension)' != '.framework' And '%(Extension)' != '.xcframework'\" />\n\t\t</ItemGroup>\n\t\t<ResolveNativeReferences\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '$(IsBindingProject)' != 'true'\"\n\t\t\tArchitectures=\"$(TargetArchitectures)\"\n\t\t\tNativeReferences=\"@(_XCFrameworkNativeReference);@(_FrameworkNativeReference)\"\n\t\t\tReferences=\"@(ReferencePath)\"\n\t\t\tSdkIsSimulator=\"$(_SdkIsSimulator)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"NativeFrameworks\" ItemName=\"_FrameworkNativeReference\" />\n\t\t</ResolveNativeReferences>\n\t</Target>\n\t\n\t<PropertyGroup>\n\t\t<BindingResourcePath>$(ProjectDir)$(OutputPath)$(AssemblyName).resources</BindingResourcePath>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CreateBindingResourcePackage\" Condition=\"'$(DesignTimeBuild)' != 'true'\"\n\t\tDependsOnTargets=\"_ExpandNativeReferences\"\n\t\tInputs=\"$(MSBuildAllProjects);$(MSBuildProjectFullPath);@(ObjcBindingApiDefinition);@(ObjcBindingCoreSource);@(ReferencePath);@(ObjcBindingNativeLibrary);@(_FrameworkNativeReference);@(_FileNativeReference)\"\n\t\tOutputs=\"$(BindingResourcePath)/manifest\">\n\t\t<CreateBindingResourcePackage Condition=\"'$(IsMacEnabled)' == 'true' And '$(NoBindingEmbedding)' == 'true' And '$(SkipBindingResourcePackage)' != 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tOutputPath=\"$(OutputPath)\"\n\t\t\tNativeReferences=\"@(NativeReference)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tBindingAssembly=\"@(IntermediateAssembly)\">\n\t\t\t<Output TaskParameter=\"Manifest\" ItemName=\"_BundleResourceManifest\" />\n\t\t</CreateBindingResourcePackage>\n\t</Target>\n\n\t<!-- Cleaning via FileWrites leaves empty framework directories on disk, so nuke via RemoveDir -->\n\t<PropertyGroup>\n\t\t<CleanDependsOn>\n\t\t\t$(CleanDependsOn);\n\t\t\t_CleanBindingResourcePackage\n\t\t</CleanDependsOn>\n\t</PropertyGroup>\n\t<Target Name=\"_CleanBindingResourcePackage\">\n\t\t<RemoveDir Directories=\"$(BindingResourcePath);\" />  \n\t</Target>\n\t\n\t<Target Name=\"_AddExtraReferences\" BeforeTargets=\"ResolveAssemblyReferences\" Condition=\"'$(DisableExtraReferences)' != 'true' And '$(UsingAppleNETSdk)' != 'true'\">\n\t\t<ItemGroup>\n\t\t\t<!-- https://github.com/mono/mono/issues/13483 -->\n\t\t\t<Reference Include=\"System.Drawing.Common.dll\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<PropertyGroup Condition=\"'$(IsBindingProject)' != 'true'\">\n\t\t<_CollectBundleResourcesDependsOn>\n\t\t\t_CompileImageAssets;\n\t\t\t_CompileInterfaceDefinitions;\n\t\t\t_CompileSceneKitAssets;\n\t\t\t_CompileColladaAssets;\n\t\t\t_CompileTextureAtlases;\n\t\t\t_CompileCoreMLModels;\n\t\t\t$(_CollectBundleResourcesDependsOn);\n\t\t</_CollectBundleResourcesDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CollectBundleResources\" DependsOnTargets=\"$(_CollectBundleResourcesDependsOn)\">\n\t\t<CollectBundleResources\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tOptimizePropertyLists=\"$(OptimizePropertyLists)\"\n\t\t\tOptimizePNGs=\"$(OptimizePNGs)\"\n\t\t\tBundleResources=\"@(Content);@(BundleResource)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"BundleResourcesWithLogicalNames\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</CollectBundleResources>\n\t</Target>\n\n\t<PropertyGroup>\n\t\t<_CompileAppManifestDependsOn>\n\t\t\t$(_CompileAppManifestDependsOn);\n\t\t\t_DetectSdkLocations;\n\t\t\t_GetMinimumOSVersion;\n\t\t\t_GenerateBundleName;\n\t\t\t_DetectSigningIdentity;\n\t\t\t_ComputeTargetFrameworkMoniker;\n\t\t</_CompileAppManifestDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CompileAppManifest\"\n\t\tDependsOnTargets=\"$(_CompileAppManifestDependsOn)\"\n\t\tInputs=\"$(_AppManifest);@(_PartialAppManifest)\"\n\t\tOutputs=\"$(_AppBundlePath)$(_AppBundleManifestRelativePath)Info.plist\" >\n\t\t<CompileAppManifest\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tAppleShortVersion=\"$(AppleShortVersion)\"\n\t\t\tApplicationTitle=\"$(ApplicationTitle)\"\n\t\t\tApplicationVersion=\"$(ApplicationVersion)\"\n\t\t\tAppBundleName=\"$(_AppBundleName)\"\n\t\t\tAppManifest=\"$(_AppManifest)\"\n\t\t\tAppManifestBundleDirectory=\"$(_AppBundlePath)$(_AppBundleManifestRelativePath)\"\n\t\t\tAssemblyName=\"$(AssemblyName)\"\n\t\t\tBundleIdentifier=\"$(_BundleIdentifier)\"\n\t\t\tDebug=\"$(_BundlerDebug)\"\n\t\t\tDefaultSdkVersion=\"$(_SdkVersion)\"\n\t\t\tGenerateApplicationManifest=\"$(GenerateApplicationManifest)\"\n\t\t\tIsAppExtension=\"$(IsAppExtension)\"\n\t\t\tIsWatchApp=\"$(IsWatchApp)\"\n\t\t\tIsWatchExtension=\"$(IsWatchExtension)\"\n\t\t\tIsXPCService=\"$(IsXPCService)\"\n\t\t\tMinimumOSVersion=\"$(_MinimumOSVersion)\"\n\t\t\tPartialAppManifests=\"@(_PartialAppManifest)\"\n\t\t\tResourceRules=\"$(_PreparedResourceRules)\"\n\t\t\tTargetArchitectures=\"$(TargetArchitectures)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tSdkPlatform=\"$(_SdkPlatform)\"\n\t\t\tSdkIsSimulator=\"$(_SdkIsSimulator)\"\n\t\t\tDebugIPAddresses=\"$(_DebugIPAddresses)\"\n\t\t\t>\n\t\t</CompileAppManifest>\n\n\t\t<RemoveDir SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" Directories=\"$(AppBundleDir).dSYM\" />\n\t\t<Delete SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" Files=\"$(DeviceSpecificOutputPath)*.bcsymbolmap\" />\n\t</Target>\n\n\t<PropertyGroup>\n\t\t<_CompileEntitlementsDependsOn>\n\t\t\t$(_CompileEntitlementsDependsOn);\n\t\t\t_DetectSdkLocations;\n\t\t\t_GenerateBundleName;\n\t\t\t_DetectSigningIdentity;\n\t\t\t_ComputeTargetFrameworkMoniker;\n\t\t</_CompileEntitlementsDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CompileEntitlements\"\n\t\tCondition=\"'$(_RequireCodeSigning)' == 'true' Or ('$(CodesignEntitlements)' != '' And '$(_PlatformName)' != 'macOS')\"\n\t\tDependsOnTargets=\"$(_CompileEntitlementsDependsOn)\"\n\t\tOutputs=\"$(DeviceSpecificIntermediateOutputPath)Entitlements.xcent\">\n\t\t<CompileEntitlements\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tAppBundleDir=\"$(AppBundleDir)\"\n\t\t\tAppIdentifier=\"$(_AppIdentifier)\"\n\t\t\tBundleIdentifier=\"$(_BundleIdentifier)\"\n\t\t\tEntitlements=\"$(CodesignEntitlements)\"\n\t\t\tCompiledEntitlements=\"$(DeviceSpecificIntermediateOutputPath)Entitlements.xcent\"\n\t\t\tIsAppExtension=\"$(IsAppExtension)\"\n\t\t\tProvisioningProfile=\"$(_ProvisioningProfile)\"\n\t\t\tSdkIsSimulator=\"$(_SdkIsSimulator)\"\n\t\t\tSdkPlatform=\"$(_SdkPlatform)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tDebug=\"$(_BundlerDebug)\"\n\t\t\t>\n\n\t\t\t<!-- $(_CompiledEntitlements) will be passed to the MTouch task, it's used to embed the entitlements in the executable -->\n\t\t\t<Output TaskParameter=\"EntitlementsInExecutable\" PropertyName=\"_CompiledEntitlements\" />\n\n\t\t\t<!-- $(_CompiledCodesignEntitlements) will be used only with Codesign tasks when building for device. MUST NOT BE SET for iOS Simulator builds. -->\n\t\t\t<Output TaskParameter=\"EntitlementsInSignature\" PropertyName=\"_CompiledCodesignEntitlements\" />\n\t\t</CompileEntitlements>\n\t</Target>\n\n\t<Target Name=\"_CompileInterfaceDefinitions\" DependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_ComputeTargetArchitectures;_BeforeCoreCompileInterfaceDefinitions;_ReadCoreCompileInterfaceDefinitions;_CoreCompileInterfaceDefinitions\" />\n\n\t<Target Name=\"_BeforeCoreCompileInterfaceDefinitions\"\n\t\tInputs=\"@(InterfaceDefinition)\"\n\t\tOutputs=\"$(_IBToolCache)\">\n\n\t\t<!-- If any InterfaceDefinition is newer than the generated items list, we delete them so that the _CoreCompileInterfaceDefinitions \n\t\t     target runs again and updates those lists for the next run\n\t\t-->\n\t\t<Delete Files=\"$(_IBToolCache)\" />\n\t</Target>\n\n\t<Target Name=\"_ReadCoreCompileInterfaceDefinitions\"\tDependsOnTargets=\"_BeforeCoreCompileInterfaceDefinitions\">\n\t\t<!-- If _BeforeCoreCompileInterfaceDefinitions did not delete the generated items lists from _CoreCompileInterfaceDefinitions, then we read them\n\t\t     since that target won't run and we need to the output items that are cached in those files which includes full metadata -->\n\t\t<ReadItemsFromFile File=\"$(_IBToolCache)\" Condition=\"Exists('$(_IBToolCache)')\">\n\t\t\t<Output TaskParameter=\"Items\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</ReadItemsFromFile>\n\t</Target>\n\n\t<Target Name=\"_CoreCompileInterfaceDefinitions\"\n\t\tInputs=\"@(InterfaceDefinition)\"\n\t\tOutputs=\"$(_IBToolCache)\"\n\t\tDependsOnTargets=\"_BeforeCoreCompileInterfaceDefinitions;_GetMinimumOSVersion;_DetectSigningIdentity\">\n\n\t\t<IBTool\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tToolExe=\"$(IBToolExe)\"\n\t\t\tToolPath=\"$(IBToolPath)\"\n\t\t\tAppManifest=\"$(_AppManifest)\"\n\t\t\tBundleIdentifier=\"$(_BundleIdentifier)\"\n\t\t\tEnableOnDemandResources=\"$(EnableOnDemandResources)\"\n\t\t\tInterfaceDefinitions=\"@(InterfaceDefinition)\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tMinimumOSVersion=\"$(_MinimumOSVersion)\"\n\t\t\tIsWatchApp=\"$(IsWatchApp)\"\n\t\t\tIsWatch2App=\"$(IsWatch2App)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tSdkBinPath=\"$(_SdkBinPath)\"\n\t\t\tSdkUsrPath=\"$(_SdkUsrPath)\"\n\t\t\tSdkRoot=\"$(_SdkRoot)\"\n\t\t\tSdkPlatform=\"$(_SdkPlatform)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\">\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_BundleResourceWithLogicalName\" />\n\n\t\t\t<!-- Local items to be persisted to items files -->\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_IBTool_BundleResources\" />\n\t\t</IBTool>\n\n\t\t<!-- Cached the generated outputs items for incremental build support -->\n\t\t<WriteItemsToFile Items=\"@(_IBTool_BundleResources)\" ItemName=\"_BundleResourceWithLogicalName\" File=\"$(_IBToolCache)\" Overwrite=\"true\" IncludeMetadata=\"true\" />\n\t\t<ItemGroup>\n\t\t\t<FileWrites Include=\"$(_IBToolCache)\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_CompileImageAssets\" DependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_ComputeTargetArchitectures;_BeforeCoreCompileImageAssets;_ReadCompileImageAssets;_CoreCompileImageAssets\" />\n\n\t<Target Name=\"_BeforeCoreCompileImageAssets\"\n\t\tInputs=\"@(ImageAsset);$(_AppManifest)\"\n\t\tOutputs=\"$(_ACTool_PartialAppManifestCache);$(_ACTool_BundleResourceCache)\">\n\n\t\t<!-- If any ImageAsset or AppManifest is newer than the generated items list, we delete them so that the _CoreCompileImageAssets\n\t\t     target runs again and updates those lists for the next run\n\t\t-->\n\t\t<Delete Files=\"$(_ACTool_PartialAppManifestCache);$(_ACTool_BundleResourceCache)\" />\n\t\t<RemoveDir Directories=\"$(DeviceSpecificIntermediateOutputPath)actool\" />\n\t</Target>\n\n\t<Target Name=\"_ReadCompileImageAssets\"\n\t\tDependsOnTargets=\"_BeforeCoreCompileImageAssets\">\n\n\t\t<!-- If _BeforeCoreCompileImageAssets did not delete the generated items lists from _CoreCompileImageAsset, then we read them\n\t\t     since that target won't run and we need the output items that are cached in those files, which includes full metadata -->\n\t\t<ReadItemsFromFile File=\"$(_ACTool_PartialAppManifestCache)\" Condition=\"Exists('$(_ACTool_PartialAppManifestCache)')\">\n\t\t\t<Output TaskParameter=\"Items\" ItemName=\"_PartialAppManifest\" />\n\t\t</ReadItemsFromFile>\n\t\t<ReadItemsFromFile File=\"$(_ACTool_BundleResourceCache)\" Condition=\"Exists('$(_ACTool_BundleResourceCache)')\">\n\t\t\t<Output TaskParameter=\"Items\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</ReadItemsFromFile>\n\t</Target>\n\n\t<Target Name=\"_CoreCompileImageAssets\"\n\t\tInputs=\"@(ImageAsset);$(_AppManifest)\"\n\t\tOutputs=\"$(_ACTool_PartialAppManifestCache);$(_ACTool_BundleResourceCache)\"\n\t\tDependsOnTargets=\"_DetectAppManifest;_GetMinimumOSVersion;_DetectSdkLocations;_BeforeCoreCompileImageAssets;_GetMinimumOSVersion;_DetectSigningIdentity;_ComputeTargetFrameworkMoniker\">\n\n\t\t<ACTool\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '@(ImageAsset)' != ''\"\n\t\t\tToolExe=\"$(ACToolExe)\"\n\t\t\tToolPath=\"$(ACToolPath)\"\n\t\t\tAppManifest=\"$(_AppManifest)\"\n\t\t\tBundleIdentifier=\"$(_BundleIdentifier)\"\n\t\t\tDeviceModel=\"$(TargetDeviceModel)\"\n\t\t\tDeviceOSVersion=\"$(TargetDeviceOSVersion)\"\n\t\t\tEnableOnDemandResources=\"$(EnableOnDemandResources)\"\n\t\t\tImageAssets=\"@(ImageAsset)\"\n\t\t\tMinimumOSVersion=\"$(_MinimumOSVersion)\"\n\t\t\tOptimizePNGs=\"$(OptimizePNGs)\"\n\t\t\tOutputPath=\"$(DeviceSpecificOutputPath)\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tIsWatchApp=\"$(IsWatchApp)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tSdkBinPath=\"$(_SdkBinPath)\"\n\t\t\tSdkUsrPath=\"$(_SdkUsrPath)\"\n\t\t\tSdkPlatform=\"$(_SdkPlatform)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"PartialAppManifest\" ItemName=\"_PartialAppManifest\" />\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_BundleResourceWithLogicalName\" />\n\n\t\t\t<!-- Local items to be persisted to items files -->\n\t\t\t<Output TaskParameter=\"PartialAppManifest\" ItemName=\"_ACTool_PartialAppManifest\" />\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_ACTool_BundleResources\" />\n\t\t</ACTool>\n\n\t\t<!-- Cache the generated outputs items for incremental build support -->\n\t\t<WriteItemsToFile Items=\"@(_ACTool_PartialAppManifest)\" ItemName=\"_PartialAppManifest\" File=\"$(_ACTool_PartialAppManifestCache)\" Overwrite=\"true\" IncludeMetadata=\"true\" />\n\t\t<WriteItemsToFile Items=\"@(_ACTool_BundleResources)\" ItemName=\"_BundleResourceWithLogicalName\" File=\"$(_ACTool_BundleResourceCache)\" Overwrite=\"true\" IncludeMetadata=\"true\" />\n\t\t<ItemGroup>\n\t\t\t<FileWrites Include=\"$(_ACTool_PartialAppManifestCache);$(_ACTool_BundleResourceCache)\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_CompileSceneKitAssets\" DependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_ComputeTargetArchitectures;_BeforeCoreCompileSceneKitAssets;_ReadCoreCompileSceneKitAssets;_CoreCompileSceneKitAssets\" />\n\n\t<Target Name=\"_BeforeCoreCompileSceneKitAssets\"\n\t\tInputs=\"@(SceneKitAsset)\"\n\t\tOutputs=\"$(_SceneKitCache)\">\n\n\t\t<!-- If any SceneKitAsset is newer than the generated items list, we delete them so that the _CoreCompileSceneKitAssets \n\t\t     target runs again and updates those lists for the next run\n\t\t-->\n\t\t<Delete Files=\"$(_SceneKitCache)\" />\n\t</Target>\n\n\t<Target Name=\"_ReadCoreCompileSceneKitAssets\"\n\t\tDependsOnTargets=\"_BeforeCoreCompileSceneKitAssets\">\n\n\t\t<!-- If _BeforeCoreCompileSceneKitAssets did not delete the generated items lists from _CoreCompileSceneKitAssets, then we read them\n\t\t     since that target won't run and we need to the output items that are cached in those files which includes full metadata -->\n\t\t<ReadItemsFromFile File=\"$(_SceneKitCache)\" Condition=\"Exists('$(_SceneKitCache)')\">\n\t\t\t<Output TaskParameter=\"Items\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</ReadItemsFromFile>\n\t</Target>\n\n\t<Target Name=\"_CoreCompileSceneKitAssets\"\n\t\tInputs=\"@(SceneKitAsset)\"\n\t\tOutputs=\"$(_SceneKitCache)\"\n\t\tDependsOnTargets=\"_BeforeCoreCompileSceneKitAssets;_GenerateBundleName;_ComputeTargetFrameworkMoniker\">\n\n\t\t<CompileSceneKitAssets\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tAppBundleName=\"$(_AppBundleName)$(AppBundleExtension)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tToolExe=\"$(CopySceneKitAssetsExe)\"\n\t\t\tToolPath=\"$(CopySceneKitAssetsPath)\"\n\t\t\tSceneKitAssets=\"@(SceneKitAsset)\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tIsWatchApp=\"$(IsWatchApp)\"\n\t\t\tSdkPlatform=\"$(_SdkPlatform)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tSdkRoot=\"$(_SdkRoot)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\">\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_BundleResourceWithLogicalName\" />\n\n\t\t\t<!-- Local items to be persisted to items files -->\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_SceneKitAssets_BundleResources\" />\n\t\t</CompileSceneKitAssets>\n\n\t\t<WriteItemsToFile Items=\"@(_SceneKitAssets_BundleResources)\" ItemName=\"_BundleResourceWithLogicalName\" File=\"$(_SceneKitCache)\" Overwrite=\"true\" IncludeMetadata=\"true\" />\n\t\t<ItemGroup>\n\t\t\t<FileWrites Include=\"$(_SceneKitCache)\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<!-- Collada assets -->\n\n\t<PropertyGroup>\n\t\t<CompileColladaAssetsDependsOn>\n\t\t\t_CollectColladaAssets;\n\t\t\t_CoreCompileColladaAssets\n\t\t</CompileColladaAssetsDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CompileColladaAssets\" Condition=\"'$(_CanOutputAppBundle)' == 'true'\" DependsOnTargets=\"$(CompileColladaAssetsDependsOn)\" />\n\n\t<Target Name=\"_CollectColladaAssets\">\n\t\t<CollectBundleResources\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tBundleResources=\"@(Collada)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\">\n\t\t\t<Output TaskParameter=\"BundleResourcesWithLogicalNames\" ItemName=\"_ColladaAssetWithLogicalName\" />\n\t\t</CollectBundleResources>\n\t</Target>\n\n\t<Target Name=\"_CoreCompileColladaAssets\"\n\t\tDependsOnTargets=\"_CollectColladaAssets;_DetectSdkLocations;_ComputeTargetFrameworkMoniker\"\n\t\tInputs=\"@(_ColladaAssetWithLogicalName)\"\n\t\tOutputs=\"$(DeviceSpecificIntermediateOutputPath)%(_ColladaAssetWithLogicalName.LogicalName)\"\n\t\t>\n\n\t\t<ScnTool\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tToolExe=\"$(ScnToolExe)\"\n\t\t\tToolPath=\"$(ScnToolPath)\"\n\t\t\tSdkRoot=\"$(_SdkRoot)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tInputScene=\"%(_ColladaAssetWithLogicalName.Identity)\"\n\t\t\tOutputScene=\"$(DeviceSpecificIntermediateOutputPath)%(_ColladaAssetWithLogicalName.LogicalName)\">\n\t\t</ScnTool>\n\n\t\t<CreateItem Include=\"$(DeviceSpecificIntermediateOutputPath)%(_ColladaAssetWithLogicalName.LogicalName)\" AdditionalMetadata=\"LogicalName=%(_ColladaAssetWithLogicalName.LogicalName);Optimize='False'\">\n\t\t\t<Output TaskParameter=\"Include\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</CreateItem>\n\t</Target>\n\n\t<Target Name=\"_ComputeTargetArchitectures\" DependsOnTargets=\"_ComputeTargetFrameworkMoniker\">\n\t\t<!--\n\t\t\tFor now, this target is mostly for Xamarin.iOS, but in order to\n\t\t\tuse the same variables elsewhere, we have code for Xamarin.Mac\n\t\t\tthat outputs the same variables. However, as build logic between\n\t\t\tXamarin.iOS and Xamarin.Mac converges, more and more of this logic\n\t\t\twill apply to Xamarin.Mac as well.\n\t\t-->\n\t\t<ParseDeviceSpecificBuildInformation\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(DeviceSpecificBuild)' == 'true' And '$(TargetiOSDevice)' != '' And '$(_CanDeployToDeviceOrSimulator)' == 'true' And '$(_PlatformName)' != 'macOS'\"\n\t\t\tArchitectures=\"$(TargetArchitectures)\"\n\t\t\tIntermediateOutputPath=\"$(IntermediateOutputPath)\"\n\t\t\tOutputPath=\"$(OutputPath)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tTargetiOSDevice=\"$(TargetiOSDevice)\"\n\t\t>\n\t\t\t<Output TaskParameter=\"DeviceSpecificIntermediateOutputPath\" PropertyName=\"DeviceSpecificIntermediateOutputPath\" />\n\t\t\t<Output TaskParameter=\"DeviceSpecificOutputPath\" PropertyName=\"DeviceSpecificOutputPath\" />\n\t\t\t<Output TaskParameter=\"TargetArchitectures\" PropertyName=\"TargetArchitectures\" />\n\t\t\t<Output TaskParameter=\"TargetDeviceModel\" PropertyName=\"TargetDeviceModel\" />\n\t\t\t<Output TaskParameter=\"TargetDeviceOSVersion\" PropertyName=\"TargetDeviceOSVersion\" />\n\t\t</ParseDeviceSpecificBuildInformation>\n\n\t\t<PropertyGroup>\n\t\t\t<_MtouchSymbolsList>$(DeviceSpecificIntermediateOutputPath)mtouch-symbols.list</_MtouchSymbolsList>\n\n\t\t\t<!-- actool output caches -->\n\t\t\t<_ACTool_PartialAppManifestCache>$(DeviceSpecificIntermediateOutputPath)actool\\_PartialAppManifest.items</_ACTool_PartialAppManifestCache>\n\t\t\t<_ACTool_BundleResourceCache>$(DeviceSpecificIntermediateOutputPath)actool\\_BundleResourceWithLogicalName.items</_ACTool_BundleResourceCache>\n\n\t\t\t<!-- coremlc output caches -->\n\t\t\t<_CoreMLModel_PartialAppManifestCache>$(DeviceSpecificIntermediateOutputPath)coremlc\\_PartialAppManifest.items</_CoreMLModel_PartialAppManifestCache>\n\t\t\t<_CoreMLModel_BundleResourceCache>$(DeviceSpecificIntermediateOutputPath)coremlc\\_BundleResourceWithLogicalName.items</_CoreMLModel_BundleResourceCache>\n\n\t\t\t<!-- ibtool output caches -->\n\t\t\t<_IBToolCache>$(DeviceSpecificIntermediateOutputPath)ibtool\\_BundleResourceWithLogicalName.items</_IBToolCache>\n\n\t\t\t<!-- scntool output caches -->\n\t\t\t<_SceneKitCache>$(DeviceSpecificIntermediateOutputPath)copySceneKitAssets\\_BundleResourceWithLogicalName.items</_SceneKitCache>\n\n\t\t\t<!-- TextureAtlas output caches -->\n\t\t\t<_TextureAtlasCache>$(DeviceSpecificIntermediateOutputPath)atlas\\_BundleResourceWithLogicalName.items</_TextureAtlasCache>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<!-- TODO: check for duplicate items -->\n\t<Target Name=\"_ComputeBundleResourceOutputPaths\" DependsOnTargets=\"_CollectBundleResources;_GenerateBundleName;_DetectSigningIdentity\">\n\t\t<ComputeBundleResourceOutputPaths\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tAppResourcesPath=\"$(_AppResourcesPath)\"\n\t\t\tBundleIdentifier=\"$(_BundleIdentifier)\"\n\t\t\tBundleResources=\"@(_BundleResourceWithLogicalName)\"\n\t\t\tEnableOnDemandResources=\"$(EnableOnDemandResources)\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tOutputPath=\"$(DeviceSpecificOutputPath)\"\n\t\t>\n\t\t\t<Output TaskParameter=\"BundleResourcesWithOutputPaths\" ItemName=\"_BundleResourceWithOutputPath\"/>\n\t\t</ComputeBundleResourceOutputPaths>\n\t</Target>\n\n\t<Target Name=\"_CopyResourcesToBundle\" DependsOnTargets=\"_ComputeBundleResourceOutputPaths\"\n\t\tInputs = \"@(_BundleResourceWithOutputPath)\"\n\t\tOutputs = \"@(_BundleResourceWithOutputPath -> '%(OutputPath)')\" >\n\t\t<SmartCopy\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSourceFiles = \"@(_BundleResourceWithOutputPath)\"\n\t\t\tDestinationFiles = \"@(_BundleResourceWithOutputPath -> '%(OutputPath)')\"\n\t\t/>\n\t</Target>\n\n\t<Target Name=\"_CreateAppBundle\" Condition=\"'$(_CanOutputAppBundle)' == 'true' And '$(IsAppDistribution)' != 'true'\" DependsOnTargets=\"$(CreateAppBundleDependsOn)\" />\n\n\t<Target Name=\"_ComputePkgInfoPath\" DependsOnTargets=\"_GenerateBundleName\">\n\t\t<PropertyGroup>\n\t\t\t<_PkgInfoPath Condition=\"'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'\">$(_AppBundlePath)Contents\\PkgInfo</_PkgInfoPath>\n\t\t\t<_PkgInfoPath Condition=\"'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'\">$(_AppBundlePath)PkgInfo</_PkgInfoPath>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<Target Name=\"_CreatePkgInfo\" Condition=\"'$(IsAppExtension)' == 'false'\" DependsOnTargets=\"_ComputePkgInfoPath\" Outputs=\"$(_PkgInfoPath)\">\n\t\t<CreatePkgInfo SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" OutputPath=\"$(_PkgInfoPath)\" />\n\t</Target>\n\n\t<Target Name=\"_CompileCoreMLModels\" DependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_ComputeTargetArchitectures;_BeforeCompileCoreMLModels;_ReadCompileCoreMLModels;_CoreCompileCoreMLModels\" />\n\n\t<Target Name=\"_BeforeCompileCoreMLModels\"\n\t\tInputs=\"@(CoreMLModel);$(_AppManifest)\"\n\t\tOutputs=\"$(_CoreMLModel_PartialAppManifestCache);$(_CoreMLModel_BundleResourceCache)\">\n\t\t<!-- If any CoreMLModel or AppManifest is newer than the generated items list, we delete them so that the _CoreCompileCoreMLModels\n\t\t     target runs again and updates those lists for the next run\n\t\t-->\n\t\t<Delete Files=\"$(_CoreMLModel_PartialAppManifestCache);$(_CoreMLModel_BundleResourceCache)\" />\n\t\t<RemoveDir Directories=\"$(DeviceSpecificIntermediateOutputPath)coremlc\" />\n\t</Target>\n\n\t<Target Name=\"_ReadCompileCoreMLModels\"\tDependsOnTargets=\"_BeforeCompileCoreMLModels\">\n\t\t<!-- If _BeforeCompileCoreMLModels did not delete the generated items lists from _CoreCompileCoreMLModels, then we read them\n\t\t     since that target won't run and we need the output items that are cached in those files, which includes full metadata -->\n\t\t<ReadItemsFromFile File=\"$(_CoreMLModel_PartialAppManifestCache)\" Condition=\"Exists('$(_CoreMLModel_PartialAppManifestCache)')\">\n\t\t\t<Output TaskParameter=\"Items\" ItemName=\"_PartialAppManifest\" />\n\t\t</ReadItemsFromFile>\n\t\t<ReadItemsFromFile File=\"$(_CoreMLModel_BundleResourceCache)\" Condition=\"Exists('$(_CoreMLModel_BundleResourceCache)')\">\n\t\t\t<Output TaskParameter=\"Items\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</ReadItemsFromFile>\n\t</Target>\n\n\t<Target Name=\"_CoreCompileCoreMLModels\" \n\t\tInputs=\"@(CoreMLModel);$(_AppManifest)\"\n\t\tOutputs=\"$(_CoreMLModel_PartialAppManifestCache);$(_CoreMLModel_BundleResourceCache)\"\n\t\tDependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_BeforeCompileCoreMLModels\">\n\n\t\t<CoreMLCompiler\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tToolExe=\"$(CoreMLCompilerExe)\"\n\t\t\tToolPath=\"$(CoreMLCompilerPath)\"\n\t\t\tModels=\"@(CoreMLModel)\"\n\t\t\tEnableOnDemandResources=\"$(EnableOnDemandResources)\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\">\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t\t<Output TaskParameter=\"PartialAppManifests\" ItemName=\"_PartialAppManifest\" />\n\n\t\t\t<!-- Local items to be persisted to items files -->\n\t\t\t<Output TaskParameter=\"PartialAppManifests\" ItemName=\"_CoreMLModel_PartialAppManifest\" />\n\t\t\t<Output TaskParameter=\"BundleResources\" ItemName=\"_CoreMLModel_BundleResources\" />\n\t\t</CoreMLCompiler>\n\n\t\t<!-- Cache the generated outputs items for incremental build support -->\n\t\t<WriteItemsToFile Items=\"@(_CoreMLModel_PartialAppManifest)\" ItemName=\"_PartialAppManifest\" File=\"$(_CoreMLModel_PartialAppManifestCache)\" Overwrite=\"true\" IncludeMetadata=\"true\" />\n\t\t<WriteItemsToFile Items=\"@(_CoreMLModel_BundleResources)\" ItemName=\"_BundleResourceWithLogicalName\" File=\"$(_CoreMLModel_BundleResourceCache)\" Overwrite=\"true\" IncludeMetadata=\"true\" />\n\t\t<ItemGroup>\n\t\t\t<FileWrites Include=\"$(_CoreMLModel_PartialAppManifestCache);$(_CoreMLModel_BundleResourceCache)\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_SmeltMetal\" Condition=\"'$(_CanOutputAppBundle)' == 'true' And '@(Metal)' != ''\" DependsOnTargets=\"_DetectSdkLocations;_ComputeTargetFrameworkMoniker;_GetMinimumOSVersion\">\n\t\t<Metal\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' and '%(Metal.Identity)' != ''\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tMinimumOSVersion=\"$(_MinimumOSVersion)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tSdkIsSimulator=\"$(_SdkIsSimulator)\"\n\t\t\tSdkRoot=\"$(_SdkRoot)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\tSourceFile=\"@(Metal)\">\n\t\t\t<Output TaskParameter=\"OutputFile\" ItemName=\"_SmeltedMetal\" />\n\t\t</Metal>\n\t</Target>\n\n\t<Target Name=\"_ForgeMetal\" Condition=\"'$(_CanOutputAppBundle)' == 'true' And '@(_SmeltedMetal)' != ''\" DependsOnTargets=\"_SmeltMetal\"\n\t\tInputs=\"@(_SmeltedMetal)\" Outputs=\"$(DeviceSpeficicIntermediateOutputPath)metal\\default.metal-ar\">\n\t\t<ArTool\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' and '$(_IsXcode8)' == 'false'\"\n\t\t\tItems=\"@(_SmeltedMetal)\"\n\t\t\tArchive=\"$(DeviceSpecificIntermediateOutputPath)metal\\default.metal-ar\">\n\t\t</ArTool>\n\n\t\t<ItemGroup>\n\t\t\t<_ForgedMetal Condition=\"'$(_IsXcode8)' == 'false'\" Include=\"$(DeviceSpecificIntermediateOutputPath)metal\\default.metal-ar\" />\n\t\t\t<_ForgedMetal Condition=\"'$(_IsXcode8)' == 'true'\" Include=\"@(_SmeltedMetal)\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_TemperMetal\" Condition=\"'$(_CanOutputAppBundle)' == 'true' And '@(_ForgedMetal)' != ''\" DependsOnTargets=\"_ForgeMetal;_GenerateBundleName\"\n\t\tInputs=\"@(_ForgedMetal)\" Outputs=\"$(_AppResourcesPath)default.metallib\">\n\t\t<MetalLib\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tItems=\"@(_ForgedMetal)\"\n\t\t\tSdkDevPath=\"$(_SdkDevPath)\"\n\t\t\tSdkRoot=\"$(_SdkRoot)\"\n\t\t\tOutputLibrary=\"$(_AppResourcesPath)default.metallib\">\n\t\t</MetalLib>\n\t</Target>\n\n\t<Target Name=\"_DetectAppManifest\">\n\t\t<!--\n\t\t\tThis targets runs for Library projects as well, so that Library\n\t\t\tprojects can specify an Info.plist with MinimumOSVersion to pass\n\t\t\tto actool, ibtool, and other Xcode tools.\n\n\t\t\tRef: https://bugzilla.xamarin.com/show_bug.cgi?id=34736\n\t\t-->\n\t\t<FindItemWithLogicalName\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tLogicalName=\"Info.plist\"\n\t\t\tItems=\"@(None)\">\n\t\t\t<Output TaskParameter=\"Item\" PropertyName=\"_AppManifest\" />\n\t\t</FindItemWithLogicalName>\n\t\t<FindItemWithLogicalName Condition=\"'$(_AppManifest)' == '' And '$(_CanOutputAppBundle)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tLogicalName=\"Info.plist\"\n\t\t\tItems=\"@(BundleResource)\">\n\t\t\t<Output TaskParameter=\"Item\" PropertyName=\"_AppManifest\" />\n\t\t</FindItemWithLogicalName>\n\t\t<FindItemWithLogicalName Condition=\"'$(_AppManifest)' == '' And '$(_CanOutputAppBundle)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tResourcePrefix=\"$(_ResourcePrefix)\"\n\t\t\tLogicalName=\"Info.plist\"\n\t\t\tItems=\"@(Content)\">\n\t\t\t<Output TaskParameter=\"Item\" PropertyName=\"_AppManifest\" />\n\t\t</FindItemWithLogicalName>\n\t\t<Error Condition=\"'$(_AppManifest)' == '' And '$(_CanOutputAppBundle)' == 'true'\" Text=\"Info.plist not found.\"/>\n\t\t<PropertyGroup>\n\t\t\t<_AppBundleManifestPath>$(_AppBundlePath)$(_AppBundleManifestRelativePath)$(_AppManifest)</_AppBundleManifestPath>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<PropertyGroup Condition=\"'$(IsBindingProject)' == 'true'\">\n\t\t<!-- Add our own pre and post build steps -->\n\t\t<!-- Override the CoreCompile Target to use bgen -->\n\t\t<CompileDependsOn>\n\t\t\t_GenerateBindings;\n\t\t\t_PrepareNativeReferences;\n\t\t\t_CollectGeneratedSources;\n\t\t\t$(CompileDependsOn)\n\t\t\t_CreateBindingResourcePackage;\n\t\t</CompileDependsOn>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<_GenerateBindingsDependsOn>\n\t\t\t_ComputeTargetFrameworkMoniker;\n\t\t\t$(_GenerateBindingsDependsOn);\n\t\t</_GenerateBindingsDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_GenerateBindings\"\n\t\tInputs=\"$(MSBuildAllProjects);@(ObjcBindingApiDefinition);@(ObjcBindingCoreSource);@(ReferencePath);@(ObjcBindingNativeLibrary)\"\n\t\tOutputs=\"$(_GeneratedSourcesFileList)\"\n\t\tDependsOnTargets=\"$(_GenerateBindingsDependsOn)\"\n\t\tCondition=\"'$(IsBindingProject)' == 'true' And '$(DesignTimeBuild)' != 'true'\">\n\n\t\t<ItemGroup>\n\t\t\t<BTouchReferencePath Include=\"@(ReferenceCopyLocalPaths)\" Condition=\"'%(Extension)' == '.dll'\" />\n\t\t</ItemGroup>\n\n\t\t<PropertyGroup>\n\t\t\t<BTouchEmitDebugInformation>false</BTouchEmitDebugInformation>\n\t\t\t<BTouchEmitDebugInformation Condition=\"'$(Debug)' != ''\">true</BTouchEmitDebugInformation>\n\t\t</PropertyGroup>\n\n\t\t<MakeDir SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" Directories=\"$(GeneratedSourcesDir)\" />\n\n\t\t<BTouch\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tOutputPath=\"$(OutputPath)\"\n\t\t\tObjectiveCLibraries=\"@(ObjcBindingNativeLibrary)\"\n\t\t\tAdditionalLibPaths=\"$(AdditionalLibPaths)\"\n\t\t\tAllowUnsafeBlocks=\"$(AllowUnsafeBlocks)\"\n\t\t\tApiDefinitions=\"@(ObjcBindingApiDefinition)\"\n\t\t\tAttributeAssembly=\"$(_GeneratorAttributeAssembly)\"\n\t\t\tBaseLibDll=\"$(BaseLibDllPath)\"\n\t\t\tCoreSources=\"@(ObjcBindingCoreSource)\"\n\t\t\tDefineConstants=\"$(DefineConstants)\"\n\t\t\tEmitDebugInformation=\"$(BTouchEmitDebugInformation)\"\n\t\t\tExtraArgs=\"$(BTouchExtraArgs)\"\n\t\t\tGeneratedSourcesDir=\"$(GeneratedSourcesDir)\"\n\t\t\tGeneratedSourcesFileList=\"$(_GeneratedSourcesFileList)\"\n\t\t\tNamespace=\"$(Namespace)\"\n\t\t\tOutputAssembly=\"$(OutputAssembly)\"\n\t\t\tProcessEnums=\"$(ProcessEnums)\"\n\t\t\tProjectDir=\"$(MSBuildProjectDirectory)\"\n\t\t\tReferences=\"@(ReferencePath);@(BTouchReferencePath)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tBTouchToolPath=\"$(BTouchToolPath)\"\n\t\t\tBTouchToolExe=\"$(BTouchToolExe)\"\n\t\t\tStandardOutputImportance=\"High\"\n\t\t\t>\n\t\t</BTouch>\n\t</Target>\n\n\t<Target Name=\"_GetCompileToNativeInputs\"\n\t\tDependsOnTargets=\"ResolveReferences\">\n\t\t<ItemGroup>\n\t\t\t<!-- Skip the reference assemblies. Execution may fail at runtime if they're copied to the .app (instead of the implementation assembly), or AOT will fail in both 'mtouch' and 'mmp'. Similar to: https://github.com/xamarin/xamarin-macios/issues/3199 -->\n\t\t\t<!-- Remove exact references, such as if a package had a framework reference to 'System' that we already have -->\n\t\t\t<!-- This is exactly what \"Microsoft.NuGet.Build.Tasks\"'s 'ResolveNuGetPackageAssets' target is doing -->\n\t\t\t<!-- Effectively 'ResolveNuGetPackageAssets' computes the NuGet packages using their json asset file, adds the full assemblies to 'ReferenceCopyLocalPaths' and outputs the resolved references via '_ReferencesFromNuGetPackages' -->\n\t\t\t<ReferencePath Remove=\"@(_ReferencesFromNuGetPackages)\" />\n\t\t\t<!-- It seems newer version of the .NET SDK uses the 'ResolvedCompileFileDefinitions' property instead of '_ReferencesFromNuGetPackages' -->\n\t\t\t<ReferencePath Remove=\"@(ResolvedCompileFileDefinitions)\" />\n\t\t\t<_BundlerReferencePath Include=\"@(ReferenceCopyLocalPaths)\" Condition=\"'%(Extension)' == '.dll'\" />\n\t\t\t<_CompileToNativeInput Include=\"$(TargetDir)$(TargetFileName);@(_BundlerReferencePath)\" />\n\t\t\t<_CompileToNativeInput Condition=\"'@(_ResolvedAppExtensionReferences)' != ''\" Include=\"%(_ResolvedAppExtensionReferences.Identity)\\..\\bundler.stamp\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_GetMinimumOSVersion\" DependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_ComputeTargetFrameworkMoniker\">\n\t\t<GetMinimumOSVersion\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tAppManifest=\"$(_AppManifest)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"MinimumOSVersion\" PropertyName=\"_MinimumOSVersion\" />\n\t\t</GetMinimumOSVersion>\n\t</Target>\n\n\t<Target Name=\"_DetectSigningIdentity\" Condition=\"'$(_CanOutputAppBundle)' == 'true'\" DependsOnTargets=\"_DetectAppManifest;_DetectSdkLocations;_ComputeTargetFrameworkMoniker;_GenerateBundleName\">\n\t\t<DetectSigningIdentity\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tApplicationId=\"$(ApplicationId)\"\n\t\t\tAppBundleName=\"$(_AppBundleName)\"\n\t\t\tAppManifest=\"$(_AppManifest)\"\n\t\t\tGenerateApplicationManifest=\"$(GenerateApplicationManifest)\"\n\t\t\tKeychain=\"$(CodesignKeychain)\"\n\t\t\tRequireCodeSigning=\"$(_RequireCodeSigning)\"\n\t\t\tRequireProvisioningProfile=\"$(_RequireProvisioningProfile)\"\n\t\t\tSdkIsSimulator=\"$(_SdkIsSimulator)\"\n\t\t\tSdkPlatform=\"$(_SdkPlatform)\"\n\t\t\tProvisioningProfile=\"$(CodesignProvision)\"\n\t\t\tSigningKey=\"$(_SpecifiedCodesignKey)\"\n\t\t\tDetectedCodeSigningKey=\"$(_CodeSigningKey)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\t>\n\n\t\t\t<Output TaskParameter=\"DetectedAppId\" PropertyName=\"_AppIdentifier\" />\n\t\t\t<Output TaskParameter=\"DetectedBundleId\" PropertyName=\"_BundleIdentifier\" />\n\t\t\t<Output TaskParameter=\"DetectedCodeSigningKey\" PropertyName=\"_CodeSigningKey\" />\n\t\t\t<Output TaskParameter=\"DetectedCodesignAllocate\" PropertyName=\"_CodesignAllocate\" />\n\t\t\t<Output TaskParameter=\"DetectedDistributionType\" PropertyName=\"_DistributionType\" />\n\t\t\t<Output TaskParameter=\"DetectedProvisioningProfile\" PropertyName=\"_ProvisioningProfile\" />\n\t\t</DetectSigningIdentity>\n\n\t\t<PropertyGroup>\n\t\t\t<_EmbeddedProvisionProfilePath Condition=\"'$(_EmbeddedProvisionProfilePath)' == '' And ('$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst')\">$(_AppBundlePath)Contents\\embedded.provisionprofile</_EmbeddedProvisionProfilePath>\n\t\t\t<_EmbeddedProvisionProfilePath Condition=\"'$(_EmbeddedProvisionProfilePath)' == '' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS')\">$(_AppBundlePath)embedded.mobileprovision</_EmbeddedProvisionProfilePath>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<Target Name=\"_DetectSdkLocations\" DependsOnTargets=\"_ComputeTargetArchitectures;_ComputeTargetFrameworkMoniker\">\n\t\t<DetectSdkLocations\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tTargetArchitectures=\"$(TargetArchitectures)\"\n\t\t\t>\n\n\t\t\t<Output TaskParameter=\"SdkVersion\" PropertyName=\"_SdkVersion\" />\n\t\t\t<Output TaskParameter=\"SdkRoot\" PropertyName=\"_SdkRoot\" />\n\t\t\t<Output TaskParameter=\"SdkBinPath\" PropertyName=\"_SdkBinPath\" />\n\t\t\t<Output TaskParameter=\"SdkDevPath\" PropertyName=\"_SdkDevPath\" />\n\t\t\t<Output TaskParameter=\"SdkUsrPath\" PropertyName=\"_SdkUsrPath\" />\n\t\t\t<Output TaskParameter=\"SdkPlatform\" PropertyName=\"_SdkPlatform\" />\n\t\t\t<Output TaskParameter=\"SdkIsSimulator\" PropertyName=\"_SdkIsSimulator\" />\n\t\t\t<Output TaskParameter=\"IsXcode8\" PropertyName=\"_IsXcode8\" />\n\t\t\t<Output TaskParameter=\"XamarinSdkRoot\" PropertyName=\"_XamarinSdkRoot\" />\n\t\t</DetectSdkLocations>\n\t</Target>\n\n\t<Target Name=\"_EmbedProvisionProfile\" Condition=\"'$(_ProvisioningProfile)' != ''\" DependsOnTargets=\"_GenerateBundleName;_DetectSigningIdentity\"\n\t\tOutputs=\"$(_EmbeddedProvisionProfilePath)\">\n\t\t<EmbedProvisionProfile\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tAppBundleDir=\"$(AppBundleDir)\"\n\t\t\tProvisioningProfile=\"$(_ProvisioningProfile)\"\n\t\t\tTargetFrameworkMoniker=\"$(_ComputedTargetFrameworkMoniker)\"\n\t\t\tEmbeddedProvisionProfilePath=\"$(_EmbeddedProvisionProfilePath)\"\n\t\t\t>\n\t\t</EmbedProvisionProfile>\n\t</Target>\n\n\t<Target Name=\"_PackLibraryResources\" Condition=\"'$(_CanOutputAppBundle)' == 'false'\" DependsOnTargets=\"_CollectBundleResources\">\n\t\t<PackLibraryResources\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tPrefix=\"$(_EmbeddedResourcePrefix)\"\n\t\t\tBundleResourcesWithLogicalNames=\"@(_BundleResourceWithLogicalName)\">\n\t\t\t<Output TaskParameter=\"EmbeddedResources\" ItemName=\"EmbeddedResource\" />\n\t\t</PackLibraryResources>\n\t</Target>\n\n\t<Target Name=\"_UnpackLibraryResources\" Condition=\"'$(_CanOutputAppBundle)' == 'true'\" DependsOnTargets=\"ResolveReferences;_CollectBundleResources\">\n\t\t<UnpackLibraryResources\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tPrefix=\"$(_EmbeddedResourcePrefix)\"\n\t\t\tNoOverwrite=\"@(_BundleResourceWithLogicalName)\"\n\t\t\tIntermediateOutputPath=\"$(DeviceSpecificIntermediateOutputPath)\"\n\t\t\tTargetFrameworkDirectory=\"$(TargetFrameworkDirectory)\"\n\t\t\tReferencedLibraries=\"@(ReferencePath);@(ReferenceDependencyPaths)\">\n\t\t\t<Output TaskParameter=\"BundleResourcesWithLogicalNames\" ItemName=\"_BundleResourceWithLogicalName\" />\n\t\t</UnpackLibraryResources>\n\t</Target>\n\n\t<Target Name=\"_ParseBundlerArguments\">\n\t\t<ParseBundlerArguments\n\t\t\tExtraArgs=\"$(_BundlerArguments)\"\n\t\t\tNoSymbolStrip=\"$(_NoSymbolStrip)\"\n\t\t\tNoDSymUtil=\"$(_NoDSymUtil)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"CustomBundleName\" PropertyName=\"_CustomBundleName\" />\n\t\t\t<Output TaskParameter=\"EnvironmentVariables\" ItemName=\"_BundlerEnvironmentVariables\" />\n\t\t\t<Output TaskParameter=\"MarshalManagedExceptionMode\" PropertyName=\"_MarshalManagedExceptionMode\" />\n\t\t\t<Output TaskParameter=\"MarshalObjectiveCExceptionMode\" PropertyName=\"_MarshalObjectiveCExceptionMode\" />\n\t\t\t<Output TaskParameter=\"NoSymbolStrip\" PropertyName=\"_NoSymbolStrip\"/>\n\t\t\t<Output TaskParameter=\"NoDSymUtil\" PropertyName=\"_NoDSymUtil\"/>\n\t\t\t<Output TaskParameter=\"Optimize\" PropertyName=\"_BundlerOptimize\"/>\n\t\t\t<Output TaskParameter=\"Registrar\" PropertyName=\"_BundlerRegistrar\" />\n\t\t\t<Output TaskParameter=\"Verbosity\" PropertyName=\"_BundlerVerbosity\" />\n\t\t\t<Output TaskParameter=\"XmlDefinitions\" ItemName=\"_BundlerXmlDefinitions\" />\n\t\t</ParseBundlerArguments>\n\n\t\t<PropertyGroup>\n\t\t\t<_CustomBundleName Condition=\"'$(_CustomBundleName)' == ''\">MonoBundle</_CustomBundleName>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<!-- Code signing -->\n\n\t<PropertyGroup>\n\t\t<CoreCodesignDependsOn>\n\t\t\t$(CoreCodesignDependsOn);\n\t\t\t_CodesignAppBundle;\n\t\t\t_CodesignVerify;\n\t\t</CoreCodesignDependsOn>\n\n\t\t<CodesignDependsOn>\n\t\t\t$(CodesignDependsOn);\n\t\t\tBeforeCodeSign;\n\t\t\tCoreCodeSign;\n\t\t\tAfterCodeSign;\n\t\t</CodesignDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"BeforeCodesign\" />\n\t<Target Name=\"CoreCodesign\" DependsOnTargets=\"$(CoreCodesignDependsOn)\" />\n\t<Target Name=\"AfterCodesign\" />\n\n\t<Target Name=\"Codesign\" Condition=\"'$(_CanOutputAppBundle)' == 'true'\" DependsOnTargets=\"$(CodesignDependsOn)\" />\n\n\t<PropertyGroup>\n\t\t<_CodesignNativeLibrariesDependsOn>\n\t\t\t$(_CodesignNativeLibrariesDependsOn);\n\t\t\t_DetectSigningIdentity;\n\t\t\t_CompileToNative;\n\t\t</_CodesignNativeLibrariesDependsOn>\n\t</PropertyGroup>\n\n\t<!-- Note:\n\t\tAlways codesign *.dylibs even for Simulator builds for iOS/tvOS/watchOS. We use $(_CanOutputAppBundle) because dylibs can exist in app extensions as well.\n\t\tFor macOS we sign if _RequireCodeSigning is true\n\t-->\n\t<Target Name=\"_CodesignNativeLibraries\" Condition=\"'$(_CanOutputAppBundle)' == 'true' And ('$(_RequireCodeSigning)' == 'true' Or '$(_PlatformName)' != 'macOS')\" DependsOnTargets=\"$(_CodesignNativeLibrariesDependsOn)\">\n\n\t\t<PropertyGroup>\n\t\t\t<_CodesignDisableTimestamp>False</_CodesignDisableTimestamp>\n\t\t\t<_CodesignDisableTimestamp Condition=\"'$(_SdkIsSimulator)' == 'true' Or '$(_BundlerDebug)' == 'true'\">True</_CodesignDisableTimestamp>\n\t\t\t<_LibraryCodeSigningKey>$(_CodeSigningKey)</_LibraryCodeSigningKey>\n\t\t\t<_LibraryCodeSigningKey Condition=\"'$(_LibraryCodeSigningKey)' == ''\">-</_LibraryCodeSigningKey>\n\t\t</PropertyGroup>\n\n\t\t<ItemGroup Condition=\"'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'\">\n\t\t\t<_CodesignNativeLibrary Include=\"$(_AppContentsPath)\\**\\*.dylib\" />\n\t\t\t<_CodesignNativeLibrary Include=\"$(_AppResourcesPath)\\**\\*.metallib\" />\n\t\t</ItemGroup>\n\t\t<ItemGroup Condition=\"'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'\">\n\t\t\t<_CodesignNativeLibrary\n\t\t\t\tInclude=\"$(_AppBundlePath)\\**\\*.dylib;$(_AppBundlePath)\\**\\*.metallib\"\n\t\t\t\tExclude=\"$(_AppBundlePath)\\Watch\\**;$(_AppBundlePath)\\PlugIns\\**\"\n\t\t\t\t/>\n\t\t</ItemGroup>\n\n\t\t<Codesign\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCodesignAllocate=\"$(_CodesignAllocate)\"\n\t\t\tDisableTimestamp=\"$(_CodesignDisableTimestamp)\"\n\t\t\tExtraArgs=\"$(CodesignExtraArgs)\"\n\t\t\tIsAppExtension=\"$(IsAppExtension)\"\n\t\t\tKeychain=\"$(CodesignKeychain)\"\n\t\t\tResources=\"@(_CodesignNativeLibrary)\"\n\t\t\tSigningKey=\"$(_LibraryCodeSigningKey)\"\n\t\t\tStampPath=\"$(DeviceSpecificIntermediateOutputPath)codesign\\\"\n\t\t\tToolExe=\"$(CodesignExe)\"\n\t\t\tToolPath=\"$(CodesignPath)\"\n\t\t\tUseSecureTimestamp=\"$(UseHardenedRuntime)\"\n\t\t\t>\n\t\t</Codesign>\n\t</Target>\n\n\t<PropertyGroup>\n\t\t<_CollectFrameworksDependsOn>\n\t\t\t$(_CollectFrameworksDependsOn);\n\t\t\t_CompileToNative;\n\t\t</_CollectFrameworksDependsOn>\n\t</PropertyGroup>\n\n\t<Target Name=\"_CollectFrameworks\" Condition=\"'$(_CanOutputAppBundle)' == 'true'\" DependsOnTargets=\"$(_CollectFrameworksDependsOn)\">\n\t\t<PropertyGroup>\n\t\t\t<_FrameworksDirectory Condition=\"'$(_FrameworksDirectory)' == '' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS')\">$(_AppBundlePath)/Frameworks</_FrameworksDirectory>\n\t\t\t<_FrameworksDirectory Condition=\"'$(_FrameworksDirectory)' == '' And ('$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst')\">$(_AppBundlePath)/Contents/Frameworks</_FrameworksDirectory>\n\t\t</PropertyGroup>\n\t\t<CollectFrameworks\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tFrameworksDirectory=\"$(_FrameworksDirectory)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"Frameworks\" ItemName=\"_Frameworks\"/>\n\t\t</CollectFrameworks>\n\t</Target>\n\n\t<Target Name=\"_CodesignFrameworks\" Condition=\"'$(_CanOutputAppBundle)' == 'true' And '@(_Frameworks)' != ''\" DependsOnTargets=\"_DetectSigningIdentity;_CollectFrameworks\"\n\t\tInputs=\"%(_Frameworks.Identity)\" Outputs=\"$(DeviceSpecificIntermediateOutputPath)codesign\\%(_Frameworks.Filename)%(_Frameworks.Extension)\">\n\n\t\t<PropertyGroup>\n\t\t\t<_CodesignDisableTimestamp>False</_CodesignDisableTimestamp>\n\t\t\t<_CodesignDisableTimestamp Condition=\"'$(_SdkIsSimulator)' == 'true' Or '$(_BundlerDebug)' == 'true'\">True</_CodesignDisableTimestamp>\n\t\t\t<_FrameworkCodeSigningKey>$(_CodeSigningKey)</_FrameworkCodeSigningKey>\n\t\t\t<_FrameworkCodeSigningKey Condition=\"'$(_FrameworkCodeSigningKey)' == ''\">-</_FrameworkCodeSigningKey>\n\t\t</PropertyGroup>\n\n\t\t<Codesign\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tToolExe=\"$(CodesignExe)\"\n\t\t\tToolPath=\"$(CodesignPath)\"\n\t\t\tCodesignAllocate=\"$(_CodesignAllocate)\"\n\t\t\tDisableTimestamp=\"$(_CodesignDisableTimestamp)\"\n\t\t\tKeychain=\"$(CodesignKeychain)\"\n\t\t\tResources=\"@(_Frameworks)\"\n\t\t\tSigningKey=\"$(_FrameworkCodeSigningKey)\"\n\t\t\tExtraArgs=\"$(CodesignExtraArgs)\"\n\t\t\t>\n\t\t</Codesign>\n\n\t\t<MakeDir SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" Directories=\"$(DeviceSpecificIntermediateOutputPath)codesign\" />\n\n\t\t<Touch\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tAlwaysCreate=\"true\"\n\t\t\tFiles=\"$(DeviceSpecificIntermediateOutputPath)codesign\\%(_Frameworks.Filename)%(_Frameworks.Extension)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"TouchedFiles\" ItemName=\"FileWrites\" />\n\t\t</Touch>\n\t</Target>\n\n\t<!-- LinkMode -->\n\t<PropertyGroup>\n\t\t<_ComputeLinkModeDependsOn>\n\t\t\t$(_ComputeLinkModeDependsOn);\n\t\t\t_DetectSdkLocations;\n\t\t</_ComputeLinkModeDependsOn>\n\t</PropertyGroup>\n\t<Target Name=\"_ComputeLinkMode\" DependsOnTargets=\"$(_ComputeLinkModeDependsOn)\">\n\t\t<PropertyGroup>\n\t\t\t<_LinkMode Condition=\"'$(_LinkMode)' == '' And '$(_PlatformName)' == 'macOS'\">$(LinkMode)</_LinkMode>\n\t\t\t<_LinkMode Condition=\"'$(_LinkMode)' == '' And '$(_PlatformName)' != 'macOS'\">$(MtouchLink)</_LinkMode>\n\t\t\t<_LinkMode Condition=\"'$(_LinkMode)' == ''\">$(_DefaultLinkMode)</_LinkMode> <!-- Let the .NET targets chime in -->\n\t\t\t<_LinkMode Condition=\"'$(_LinkMode)' == '' And '$(_PlatformName)' == 'macOS'\">None</_LinkMode> <!-- Linking is off by default for macOS apps -->\n\t\t\t<_LinkMode Condition=\"'$(_LinkMode)' == '' And '$(_PlatformName)' != 'macOS'\">SdkOnly</_LinkMode> <!-- Default linking is SdkOnly for iOS/tvOS/watchOS apps -->\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<Target Name=\"_ExtendAppExtensionReferences\" DependsOnTargets=\"_ResolveAppExtensionReferences\" Condition=\" '@(AdditionalAppExtensions)' != ''\">\n\t<!-- The idea here is that after _ResolveAppExtensionReferences we inject the 3rd party extensions into the list being processed later for embedding and code signing.\n\t\t- _ResolvedAppExtensionReferences is an item group of the path, so that's easy.\n\t\t- _AppExtensionCodesignProperties less so. It is generated by reading codesign.items generated by the c# tasks during build, which we don't have. \n\t\tWe also don't have a concrete list of types that get serialized, so I dug for every property referenced and set what I believe are sane values.-->\n\t\t<ItemGroup>\n\t\t\t<_ResolvedAppExtensionReferences Include=\"%(AdditionalAppExtensions.Identity)/%(AdditionalAppExtensions.BuildOutput)/%(AdditionalAppExtensions.Name).appex\" />\n\n\t\t\t<_AppExtensionCodesignProperties Include=\"%(AdditionalAppExtensions.Name).appex\">\n\t\t\t\t<Entitlements Condition=\"Exists('%(AdditionalAppExtensions.Identity)/%(AdditionalAppExtensions.Name).entitlements')\">%(AdditionalAppExtensions.Identity)/%(AdditionalAppExtensions.Name).entitlements</Entitlements>\n\t\t\t\t<SigningKey>$(CodesignKey)</SigningKey>\n\t\t\t\t<Keychain>$(CodesignKeychain)</Keychain>\n\t\t\t\t<DisableTimestamp>False</DisableTimestamp>\n\t\t\t\t<DisableTimestamp Condition=\"'$(_SdkIsSimulator)' == 'true' Or '$(_BundlerDebug)' == 'true'\">True</DisableTimestamp>\n\t\t\t\t<CodesignAllocate>$(_CodesignAllocate)</CodesignAllocate>\n\t\t\t\t<ResourceRules>$(CodesignResourceRules)</ResourceRules>\n\t\t\t\t<NativeExecutable>%(AdditionalAppExtensions.Filename)</NativeExecutable>\n\t\t\t</_AppExtensionCodesignProperties> \n\t\t</ItemGroup>\n\t</Target>\n\n\t<Target Name=\"_PrepareResourceRules\" DependsOnTargets=\"_DetectSdkLocations;_GenerateBundleName\">\n\t\t<PrepareResourceRules\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '$(CodesignResourceRules)' != '' And '$(ComputedPlatform)' == 'iPhone'\"\n\t\t\tAppBundleDir=\"$(AppBundleDir)\"\n\t\t\tResourceRules=\"$(CodesignResourceRules)\"\n\t\t\tSdkVersion=\"$(_SdkVersion)\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"PreparedResourceRules\" PropertyName=\"_PreparedResourceRules\"/>\n\t\t</PrepareResourceRules>\n\t</Target>\n\n\t<!-- App extensions -->\n\n\t<Target Name=\"_AssignAppExtensionConfiguration\" Condition=\"'@(_AppExtensionReference)' != ''\">\n\t\t<!-- assign configs if building a solution file -->\n\t\t<AssignProjectConfiguration\n\t\t\tProjectReferences = \"@(_AppExtensionReference)\"\n\t\t\tSolutionConfigurationContents = \"$(CurrentSolutionConfigurationContents)\"\n\t\t\tCondition=\"'$(CurrentSolutionConfigurationContents)' != ''\">\n\n\t\t\t<Output TaskParameter=\"AssignedProjects\" ItemName=\"_AppExtensionReferenceWithConfiguration\"/>\n\t\t</AssignProjectConfiguration>\n\n\t\t<!-- Else, just -->\n\t\t<CreateItem Include=\"@(_AppExtensionReference)\"\n\t\t\t\t\tCondition=\"'$(CurrentSolutionConfigurationContents)' == ''\">\n\t\t\t<Output TaskParameter=\"Include\" ItemName=\"_AppExtensionReferenceWithConfiguration\"/>\n\t\t</CreateItem>\n\t</Target>\n\n\t<Target Name=\"_SeparateAppExtensionReferences\" BeforeTargets=\"AssignProjectConfiguration\">\n\t\t<CreateItem Include=\"@(ProjectReference)\" PreserveExistingMetadata=\"true\" Condition=\"'%(Identity)' != '' And '%(ProjectReference.IsAppExtension)' == 'true'\">\n\t\t\t<Output ItemName=\"_AppExtensionReference\" TaskParameter=\"Include\" />\n\t\t</CreateItem>\n\n\t\t<ItemGroup>\n\t\t\t<ProjectReference Remove=\"@(_AppExtensionReference)\" />\n\t\t</ItemGroup>\n\t</Target>\n\n\t<!-- Split App Extension projects into 2 lists\n\t\t_AppExtensionReferenceWithConfigurationExistent: Projects existent on disk\n\t\t_AppExtensionReferenceWithConfigurationNonExistent: Projects non-existent on disk -->\n\t<Target Name=\"_SplitAppExtensionReferencesByExistent\" DependsOnTargets=\"_AssignAppExtensionConfiguration\">\n\t\t<CreateItem Include=\"@(_AppExtensionReferenceWithConfiguration)\" Condition=\"'@(_AppExtensionReferenceWithConfiguration)' != ''\">\n\t\t\t<Output TaskParameter=\"Include\" ItemName=\"_AppExtensionReferenceWithConfigurationExistent\"\n\t\t\t\tCondition=\"Exists ('%(_AppExtensionReferenceWithConfiguration.Identity)')\"/>\n\n\t\t\t<Output TaskParameter=\"Include\" ItemName=\"_AppExtensionReferenceWithConfigurationNonExistent\"\n\t\t\t\tCondition=\"!Exists ('%(_AppExtensionReferenceWithConfiguration.Identity)')\"/>\n\t\t</CreateItem>\n\t</Target>\n\n\t<Target Name=\"_ResolveAppExtensionReferences\" DependsOnTargets=\"_SplitAppExtensionReferencesByExistent\">\n\t\t<PropertyGroup>\n\t\t\t<!-- When building a .sln with msbuild, the dependent projects may not be built. So, always build\n\t\t\t     the referenced projects unless building from IDE. -->\n\t\t\t<_BuildReferencedExtensionProjects Condition=\"'$(BuildingInsideVisualStudio)' != 'true'\">true</_BuildReferencedExtensionProjects>\n\t\t</PropertyGroup>\n\n\t\t<!-- If the referenced projects have already been built, then just get the target paths -->\n\t\t<MSBuild\n\t\t\tProjects=\"@(_AppExtensionReferenceWithConfigurationExistent)\"\n\t\t\tTargets=\"GetBundleTargetPath\"\n\t\t\tProperties=\"%(_AppExtensionReferenceWithConfigurationExistent.SetConfiguration); %(_AppExtensionReferenceWithConfigurationExistent.SetPlatform)\"\n\t\t\tCondition=\"'@(_AppExtensionReferenceWithConfigurationExistent)' != '' and '$(_BuildReferencedExtensionProjects)' != 'true'\">\n\n\t\t\t<Output TaskParameter=\"TargetOutputs\" ItemName=\"_ResolvedAppExtensionReferences\" Condition=\"'%(_AppExtensionReferenceWithConfigurationExistent.ReferenceOutputAssembly)' != 'false'\"/>\n\t\t</MSBuild>\n\n\t\t<!-- Build the referenced project if required -->\n\t\t<MSBuild\n\t\t\tProjects=\"@(_AppExtensionReferenceWithConfigurationExistent)\"\n\t\t\tProperties=\"%(_AppExtensionReferenceWithConfigurationExistent.SetConfiguration); %(_AppExtensionReferenceWithConfigurationExistent.SetPlatform)\"\n\t\t\tCondition=\"'@(_AppExtensionReferenceWithConfigurationExistent)' != '' and '$(_BuildReferencedExtensionProjects)' == 'true' \">\n\n\t\t\t<Output TaskParameter=\"TargetOutputs\" ItemName=\"_ResolvedAppExtensionReferences\" Condition=\"'%(_AppExtensionReferenceWithConfigurationExistent.ReferenceOutputAssembly)' != 'false'\"/>\n\t\t</MSBuild>\n\n\t\t<Warning Text=\"Referenced $(_PlatformName) App Extension Project %(_AppExtensionReferenceWithConfigurationNonExistent.Identity) not found, ignoring.\"\n\t\t\t Condition=\"'@(_AppExtensionReferenceWithConfigurationNonExistent)' != ''\"/>\n\t</Target>\n\n\t<Target Name=\"_PlaceAppExtensions\" DependsOnTargets=\"_ExtendAppExtensionReferences;_ResolveAppExtensionReferences\">\n\t\t<ItemGroup>\n\t\t\t<!-- Add a 'ContainerName' metadata to indicate where the extension should go inside the container's app bundle -->\n\t\t\t<_ResolvedAppExtensionReferences Condition=\"'%(_ResolvedAppExtensionReferences.Extension)' == '.appex'\">\n\t\t\t\t<ContainerName>PlugIns</ContainerName>\n\t\t\t</_ResolvedAppExtensionReferences>\n\t\t\t<_ResolvedAppExtensionReferences Condition=\"'%(_ResolvedAppExtensionReferences.Extension)' == '.xpc'\">\n\t\t\t\t<ContainerName>XPCServices</ContainerName>\n\t\t\t</_ResolvedAppExtensionReferences>\n\t\t</ItemGroup>\n\n\t\t<PropertyGroup>\n\t\t\t<_AppExtensionRoot Condition=\"'$(_PlatformName)' == 'macOS'\">$(_AppBundlePath)Contents\\</_AppExtensionRoot>\n\t\t\t<_AppExtensionRoot Condition=\"'$(_PlatformName)' != 'macOS'\">$(_AppBundlePath)</_AppExtensionRoot>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<Target Name=\"_CopyAppExtensionsToBundle\"\n\t\t\tDependsOnTargets=\"_ExtendAppExtensionReferences;_ResolveAppExtensionReferences;_PlaceAppExtensions\"\n\t\t\tInputs=\"@(_ResolvedAppExtensionReferences)\"\n\t\t\tOutputs=\"$(_AppExtensionRoot)%(_ResolvedAppExtensionReferences.ContainerName)\\%(_ResolvedAppExtensionReferences.FileName)%(_ResolvedAppExtensionReferences.Extension)\"\n\t\t\t>\n\t\t<MakeDir\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tDirectories=\"$(_AppExtensionRoot)%(_ResolvedAppExtensionReferences.ContainerName)\"\n\t\t/>\n\n\t\t<Ditto\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tToolExe=\"$(DittoExe)\"\n\t\t\tToolPath=\"$(DittoPath)\"\n\t\t\tSource=\"@(_ResolvedAppExtensionReferences)\"\n\t\t\tDestination=\"$(_AppExtensionRoot)%(_ResolvedAppExtensionReferences.ContainerName)\\%(_ResolvedAppExtensionReferences.FileName)%(_ResolvedAppExtensionReferences.Extension)\"\n\t\t/>\n\n\t\t<!-- Delete any code signatures and dSYM dirs since they are now invalid -->\n\t\t<RemoveDir\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tDirectories=\"$(_AppExtensionRoot)%(_ResolvedAppExtensionReferences.ContainerName)\\%(_ResolvedAppExtensionReferences.FileName)%(_ResolvedAppExtensionReferences.Extension)\\_CodeSignature;\n\t\t\t\t\t\t$(_AppBundlePath)..\\%(_ResolvedAppExtensionReferences.FileName)%(_ResolvedAppExtensionReferences.Extension).dSYM\"\n\t\t/>\n\t</Target>\n\n\t<Target Name=\"_GetNativeExecutableName\" DependsOnTargets=\"_DetectAppManifest;_GenerateBundleName;_CompileAppManifest\">\n\t\t<GetNativeExecutableName\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tAppManifest=\"$(_AppBundlePath)$(_AppBundleManifestRelativePath)Info.plist\"\n\t\t\t>\n\t\t\t<Output TaskParameter=\"ExecutableName\" PropertyName=\"_ExecutableName\" />\n\t\t</GetNativeExecutableName>\n\n\t\t<PropertyGroup>\n\t\t\t<_NativeExecutable Condition=\"'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'\">$(_AppBundlePath)$(_ExecutableName)</_NativeExecutable>\n\t\t\t<_NativeExecutable Condition=\"'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'\">$(_AppBundlePath)Contents\\MacOS\\$(_ExecutableName)</_NativeExecutable>\n\t\t</PropertyGroup>\n\t</Target>\n\n\t<Target Name=\"_ReadAppExtensionDebugSymbolProperties\">\n\t\t<ReadItemsFromFile File=\"%(_ResolvedAppExtensionReferences.Identity)\\..\\dsym.items\" Condition=\"Exists('%(_ResolvedAppExtensionReferences.Identity)\\..\\dsym.items')\">\n\t\t\t<Output TaskParameter=\"Items\" ItemName=\"_AppExtensionDebugSymbolProperties\" />\n\t\t</ReadItemsFromFile>\n\t</Target>\n\n\t<Target Name=\"_GenerateAppExtensionDebugSymbols\" Condition=\"'$(ComputedPlatform)' == 'iPhone' And '$(IsAppExtension)' == 'false'\"\n\t\tDependsOnTargets=\"_ParseBundlerArguments;_CompileToNative;_ReadAppExtensionDebugSymbolProperties\"\n\t\tInputs=\"$(_AppBundlePath)PlugIns\\%(_AppExtensionDebugSymbolProperties.Identity)\\%(_AppExtensionDebugSymbolProperties.NativeExecutable)\"\n\t\tOutputs=\"$(AppBundleDir)\\..\\%(_AppExtensionDebugSymbolProperties.Identity).dSYM\\Contents\\Info.plist\">\n\n\t\t<RemoveDir SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" Directories=\"$(AppBundleDir)\\..\\%(_AppExtensionDebugSymbolProperties.Identity).dSYM\" />\n\n\t\t<!-- run dsymutil on the main bundle -->\n\t\t<DSymUtil\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '%(_AppExtensionDebugSymbolProperties.NoDSymUtil)' == 'false'\"\n\t\t\tAppBundleDir=\"$(_AppBundlePath)PlugIns\\%(_AppExtensionDebugSymbolProperties.Identity)\"\n\t\t\tArchitectures=\"%(_AppExtensionDebugSymbolProperties.CompiledArchitectures)\"\n\t\t\tDSymDir=\"$(AppBundleDir)\\..\\%(_AppExtensionDebugSymbolProperties.Identity).dSYM\"\n\t\t\tExecutable=\"$(_AppBundlePath)PlugIns\\%(_AppExtensionDebugSymbolProperties.Identity)\\%(_AppExtensionDebugSymbolProperties.NativeExecutable)\"\n\t\t\tToolExe=\"$(DSymUtilExe)\"\n\t\t\tToolPath=\"$(DSymUtilPath)\"\n\t\t>\n\t\t</DSymUtil>\n\n\t\t<!-- strip the debug symbols from the $(_NativeExecutable) -->\n\t\t<SymbolStrip\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '%(_AppExtensionDebugSymbolProperties.NoSymbolStrip)' == 'false'\"\n\t\t\tExecutable=\"$(_AppBundlePath)PlugIns\\%(_AppExtensionDebugSymbolProperties.Identity)\\%(_AppExtensionDebugSymbolProperties.NativeExecutable)\"\n\t\t\tIsFramework=\"false\"\n\t\t\tSymbolFile=\"%(_AppExtensionDebugSymbolProperties.SymbolsList)\"\n\t\t>\n\t\t</SymbolStrip>\n\n\t\t<!-- touch the dSYM Info.plist so that its mtime is newer than the stripped $(_NativeExecutable) -->\n\t\t<Touch\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '%(_AppExtensionDebugSymbolProperties.NoSymbolStrip)' == 'false'\"\n\t\t\tFiles=\"$(AppBundleDir)\\..\\%(_AppExtensionDebugSymbolProperties.Identity).dSYM\\Contents\\Info.plist\"\n\t\t>\n\t\t</Touch>\n\t</Target>\n\n\t<Target Name=\"_CopyUserFrameworkDebugSymbols\" Condition=\"('$(_PlatformName)' == 'macOS') Or ('$(ComputedPlatform)' == 'iPhone' And '$(IsWatchApp)' == 'false')\" DependsOnTargets=\"_CompileToNative;_ParseBundlerArguments;\"\n\t\tInputs=\"%(_FrameworkNativeReference.Name)\"\n\t\tOutputs=\"$(AppBundleDir)\\..\\%(_FrameworkNativeReference.Filename).framework.dSYM\\Contents\\Info.plist\"\n\t\t>\n\n\t\t<PropertyGroup>\n\t\t\t<_Source>$([System.IO.Path]::GetDirectoryName(%(_FrameworkNativeReference.Name)))\\..\\dSYMs\\%(_FrameworkNativeReference.Filename).framework.dSYM\\</_Source>\n\t\t\t<_Destination>$(AppBundleDir)\\..\\%(_FrameworkNativeReference.Filename).framework.dSYM</_Destination>\n\t\t</PropertyGroup>\n\n\t\t<RemoveDir SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" Directories=\"$(_Destination)\" />\n\n\t\t<!-- if available copy the provided user frameworks .dSYM -->\n\t\t<Ditto\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And Exists ('$(_Source)')\"\n\t\t\tSource=\"$(_Source)\"\n\t\t\tDestination=\"$(_Destination)\"\n\t\t>\n\t\t</Ditto>\n\t</Target>\n\n\t<Target Name=\"_GenerateFrameworkDebugSymbols\" Condition=\"('$(_PlatformName)' == 'macOS') Or ('$(ComputedPlatform)' == 'iPhone' And '$(IsWatchApp)' == 'false')\" DependsOnTargets=\"_CopyUserFrameworkDebugSymbols;_CollectFrameworks\"\n\t\tInputs=\"%(_Frameworks.Identity)\"\n\t\tOutputs=\"$(AppBundleDir)\\..\\%(_Frameworks.Filename).framework.dSYM\\Contents\\Info.plist\"\n\t\t>\n\n\t\t<PropertyGroup>\n\t\t\t<_Destination>$(AppBundleDir)\\..\\%(_Frameworks.Filename).framework.dSYM</_Destination>\n\t\t</PropertyGroup>\n\n\t\t<!-- if the user framework does not provide it's own dSYM then we try to build one -->\n\t\t<ItemGroup Condition=\"'$(IsMacEnabled)' == 'true' And !Exists (_Destination)\">\n\t\t\t<!-- run dsymutil on embedded frameworks -->\n\t\t\t<DSymUtil\n\t\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\t\tCondition=\"'$(_NoDSymUtil)' == 'false'\"\n\t\t\t\tAppBundleDir=\"$(AppBundleDir)\"\n\t\t\t\tArchitectures=\"\"\n\t\t\t\tDSymDir=\"$(_Destination)\"\n\t\t\t\tExecutable=\"%(_Frameworks.Identity)\"\n\t\t\t\tToolExe=\"$(DSymUtilExe)\"\n\t\t\t\tToolPath=\"$(DSymUtilPath)\">\n\t\t\t</DSymUtil>\n\n\t\t\t<!-- strip embedded frameworks -->\n\t\t\t<SymbolStrip\n\t\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\t\tCondition=\"'$(_NoSymbolStrip)' == 'false'\"\n\t\t\t\tExecutable=\"%(_Frameworks.Identity)\"\n\t\t\t\tIsFramework=\"true\"\n\t\t\t\tSymbolFile=\"\"\n\t\t\t>\n\t\t\t</SymbolStrip>\n\t\t</ItemGroup>\n\n\t\t<!-- _GenerateDebugSymbols will run spotlight to index the dSYMs -->\n\t</Target>\n\n\t<Target Name=\"_PrepareDebugSymbolGeneration\" Condition=\"('$(_PlatformName)' == 'macOS') Or ('$(ComputedPlatform)' == 'iPhone' And '$(IsWatchApp)' == 'false')\" DependsOnTargets=\"_CompileToNative;_ParseBundlerArguments\"\n\t\t\tInputs=\"$(_NativeExecutable)\" Outputs=\"$(DeviceSpecificOutputPath)dsym.items\">\n\n\t\t<!-- For App Extensions, we delay running dsymutil & strip until it has been copied into the main app bundle... -->\n\t\t<!-- This needs to be executed in a task (and not here inside the target) so the execution always occur on the mac, even when the build is done from Windows -->\n\t\t<GetFullPath SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true'\" RelativePath=\"$(_MtouchSymbolsList)\">\n\t\t\t<Output TaskParameter=\"FullPath\" PropertyName=\"_SymbolsListFullPath\" />\n\t\t</GetFullPath>\n\n\t\t<!-- For App Extensions, we delay running dsymutil & strip until it has been copied into the main app bundle... -->\n\t\t<PropertyGroup>\n\t\t\t<!-- [System.IO.Path]::GetFileName() is safe to use -->\n\t\t\t<_NativeExecutableFileName>$([System.IO.Path]::GetFileName('$(_NativeExecutable)'))</_NativeExecutableFileName>\n\t\t\t<_AppBundleFileName>$([System.IO.Path]::GetFileName('$(AppBundleDir)'))</_AppBundleFileName>\n\t\t</PropertyGroup>\n\n\t\t<ItemGroup>\n\t\t\t<_AppExtensionDebugSymbolProperties Remove=\"@(_AppExtensionDebugSymbolProperties)\" />\n\n\t\t\t<_AppExtensionDebugSymbolProperties Include=\"$(_AppBundleFileName)\">\n\t\t\t\t<CompiledArchitectures>$(_CompiledArchitectures)</CompiledArchitectures>\n\t\t\t\t<NativeExecutable>$(_NativeExecutableFileName)</NativeExecutable>\n\t\t\t\t<NoSymbolStrip>$(_NoSymbolStrip)</NoSymbolStrip>\n\t\t\t\t<SymbolsList>$(_SymbolsListFullPath)</SymbolsList>\n\t\t\t\t<NoDSymUtil>$(_NoDSymUtil)</NoDSymUtil>\n\t\t\t</_AppExtensionDebugSymbolProperties>\n\t\t</ItemGroup>\n\n\t\t<WriteItemsToFile\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true'\"\n\t\t\tItems=\"@(_AppExtensionDebugSymbolProperties)\"\n\t\t\tItemName=\"_AppExtensionDebugSymbolProperties\"\n\t\t\tFile=\"$(DeviceSpecificOutputPath)dsym.items\"\n\t\t\tIncludeMetadata=\"true\"\n\t\t\tOverwrite=\"true\"\n\t\t/>\n\t</Target>\n\n\t<Target Name=\"_GenerateDebugSymbols\" Condition=\"('$(_PlatformName)' == 'macOS') Or ('$(ComputedPlatform)' == 'iPhone' And '$(IsWatchApp)' == 'false')\" DependsOnTargets=\"_CompileToNative;_ParseBundlerArguments;_GenerateFrameworkDebugSymbols;_GenerateAppExtensionDebugSymbols;_PrepareDebugSymbolGeneration\"\n\t\tInputs=\"$(_NativeExecutable)\" Outputs=\"$(AppBundleDir).dSYM\\Contents\\Info.plist\">\n\n\t\t<RemoveDir SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true' And '$(IsAppExtension)' == 'false'\" Directories=\"$(AppBundleDir).dSYM\" />\n\t\t<Delete SessionId=\"$(BuildSessionId)\" Condition=\"'$(IsMacEnabled)' == 'true' And '$(IsAppExtension)' == 'false'\" Files=\"$(DeviceSpecificOutputPath)*.bcsymbolmap\" />\n\n\t\t<!-- run dsymutil on the main bundle -->\n\t\t<DSymUtil\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '$(_NoDSymUtil)' == 'false' And '$(IsAppExtension)' == 'false'\"\n\t\t\tAppBundleDir=\"$(AppBundleDir)\"\n\t\t\tArchitectures=\"$(_CompiledArchitectures)\"\n\t\t\tDSymDir=\"$(AppBundleDir).dSYM\"\n\t\t\tExecutable=\"$(_NativeExecutable)\"\n\t\t\tToolExe=\"$(DSymUtilExe)\"\n\t\t\tToolPath=\"$(DSymUtilPath)\"\n\t\t>\n\t\t</DSymUtil>\n\n\t\t<!-- strip the debug symbols from the $(_NativeExecutable) -->\n\t\t<SymbolStrip\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '$(_NoSymbolStrip)' == 'false' And '$(IsAppExtension)' == 'false'\"\n\t\t\tExecutable=\"$(_NativeExecutable)\"\n\t\t\tIsFramework=\"false\"\n\t\t\tSymbolFile=\"$(_MtouchSymbolsList)\"\n\t\t>\n\t\t</SymbolStrip>\n\n\t\t<!-- touch the dSYM Info.plist so that its mtime is newer than the stripped $(_NativeExecutable) -->\n\t\t<Touch\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '$(_NoSymbolStrip)' == 'false' And '$(IsAppExtension)' == 'false' And Exists('$(AppBundleDir).dSYM')\"\n\t\t\tFiles=\"$(AppBundleDir).dSYM\\Contents\\Info.plist\"\n\t\t>\n\t\t</Touch>\n\n\t\t<!-- make sure spotlight indexes everything we've built -->\n\t\t<SpotlightIndexer\n\t\t\tSessionId=\"$(BuildSessionId)\"\n\t\t\tCondition=\"'$(IsMacEnabled)' == 'true' And '$(_NoDSymUtil)' == 'false' And '$(IsAppExtension)' == 'false'\"\n\t\t\tInput=\"$(AppBundleDir)/../\"\n\t\t>\n\t\t</SpotlightIndexer>\n\t</Target>\n\n\t<Target Name=\"_GenerateBundleName\" Condition=\"'$(_CanOutputAppBundle)' == 'true'\" DependsOnTargets=\"_ComputeTargetArchitectures;_ParseBundlerArguments\">\n\t\t<PropertyGroup Condition=\"'$(AppBundleDir)' == ''\">\n\t\t\t<AppBundleDir Condition=\"'$(IsAppDistribution)' != 'true'\">$(DeviceSpecificOutputPath)$(_AppBundleName)$(AppBundleExtension)</AppBundleDir>\n\t\t\t<AppBundleDir Condition=\"'$(IsAppDistribution)' == 'true'\">$(ArchivePath)\\Products\\Applications\\$(_AppBundleName)$(AppBundleExtension)</AppBundleDir>\n\t\t</PropertyGroup>\n\t\t<PropertyGroup>\n\t\t\t<_AppBundlePath>$(AppBundleDir)\\</_AppBundlePath>\n\t\t\t<_AppResourcesPath Condition=\"'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'\">$(_AppBundlePath)Contents\\Resources\\</_AppResourcesPath>\n\t\t\t<_AppResourcesPath Condition=\"'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'\">$(_AppBundlePath)</_AppResourcesPath>\n\n\t\t\t<_AppContentsPath Condition=\"'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'\">$(_AppBundlePath)Contents\\$(_CustomBundleName)</_AppContentsPath>\n\t\t\t<_AppContentsPath Condition=\"'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'\">$(_AppBundlePath)</_AppContentsPath>\n\t\t</PropertyGroup>\n\t\t<PropertyGroup Condition=\"'$(IsAppExtension)' == 'true'\">\n\t\t\t<!-- needed for GetTargetPath/Build/Rebuild task outputs -->\n\t\t\t<_AppExtensionBundlePath>$(MSBuildProjectDirectory)\\$(AppBundleDir)</_AppExtensionBundlePath>\n\t\t</PropertyGroup>\n\t\t<ItemGroup Condition=\"'$(IsAppExtension)' == 'true'\">\n\t\t\t<_AppExtensionBundlePath Include=\"$(MSBuildProjectDirectory)\\$(AppBundleDir)\">\n\t\t\t\t<!-- We need this metadata to fix the source in VS -->\n\t\t\t\t<BuildSessionId>$(BuildSessionId)</BuildSessionId>\n\t\t\t\t<BuildServerPath>..\\..\\$(BuildAppName)\\$(BuildSessionId)\\$(AppBundleDir)</BuildServerPath>\n\t\t\t</_AppExtensionBundlePath>\n\t\t</ItemGroup>\n\t</Target>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Shared.ObjCBinding.targets\" Condition=\"'$(IsBindingProject)' == 'true'\" />\n\n\t<!-- Xamarin.ImplicitFacade.targets will detect if we need to add an implicit reference to netstandard.dll -->\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.ImplicitFacade.targets\" Condition=\"!('$(_PlatformName)' == 'macOS' And '$(TargetFrameworkName)' == 'System')\"/>\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)Xamarin.Shared.Stubs.targets\" />\n\n\t<Import Project=\"$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets\"\n\t\t\tCondition=\"Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')\"/>\n</Project>\n"
  },
  {
    "path": "src/mac/studio/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"filename\": \"AppIcon-16.png\",\n      \"size\": \"16x16\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-16@2x.png\",\n      \"size\": \"16x16\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-32.png\",\n      \"size\": \"32x32\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-32@2x.png\",\n      \"size\": \"32x32\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-128.png\",\n      \"size\": \"128x128\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-128@2x.png\",\n      \"size\": \"128x128\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-256.png\",\n      \"size\": \"256x256\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-256@2x.png\",\n      \"size\": \"256x256\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-512.png\",\n      \"size\": \"512x512\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-512@2x.png\",\n      \"size\": \"512x512\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    }\n  ],\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"xcode\"\n  }\n}"
  },
  {
    "path": "src/mac/studio/Assets.xcassets/Contents.json",
    "content": "﻿{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "src/mac/studio/Entitlements.plist",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/mac/studio/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDisplayName</key>\n\t<string>fuse X</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.fuse-x.studio</string>\n\t<key>CFBundleName</key>\n\t<string>fuse X</string>\n\t<key>CFBundleVersion</key>\n\t<string>VERSION_NUMBER</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>10.10</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>CFBundleIconFile</key>\n\t<string>FuseBigSur</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>VERSION_NUMBER</string>\n\t<key>MonoMinimumVersion</key>\n\t<string>6.4</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>© Build &amp; Run</string>\n\n\t<key>CFBundleDocumentTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeExtensions</key>\n\t\t\t<array>\n\t\t\t\t<string>unoproj</string>\n\t\t\t</array>\n\t\t\t<key>CFBundleTypeIconFile</key>\n\t\t\t<string>Unoproj</string>\n\t\t\t<key>CFBundleTypeName</key>\n\t\t\t<string>fuse X Project</string>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Editor</string>\n\t\t\t<key>NSDocumentClass</key>\n\t\t\t<string>ObservableNSDocument</string>\n\t\t\t<key>LSHandlerRank</key>\n\t\t\t<string>Owner</string>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/mac/studio/Main.cs",
    "content": "﻿namespace Outracks.Mac.Studio\n{\n\tstatic class MainClass\n\t{\n\t\tstatic void Main(string[] args)\n\t\t{\n\t\t\tFuse.Studio.Program.Main(args);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/mac/studio/fuse X.csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{F431473B-DA4A-4335-BF9C-4841ED71E799}</ProjectGuid>\n    <ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>Outracks.Mac.Studio</RootNamespace>\n    <AssemblyName>fuse X</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>$(SolutionDir)bin\\$(Configuration)</OutputPath>\n    <DefineConstants>DEBUG;</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <EnableCodeSigning>false</EnableCodeSigning>\n    <CodeSigningKey>Mac Developer</CodeSigningKey>\n    <CreatePackage>false</CreatePackage>\n    <EnablePackageSigning>false</EnablePackageSigning>\n    <IncludeMonoRuntime>false</IncludeMonoRuntime>\n    <UseSGen>true</UseSGen>\n    <UseRefCounting>true</UseRefCounting>\n    <HttpClientHandler>HttpClientHandler</HttpClientHandler>\n    <LinkMode>None</LinkMode>\n    <XamMacArch></XamMacArch>\n    <AOTMode>None</AOTMode>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>$(SolutionDir)bin\\$(Configuration)</OutputPath>\n    <DefineConstants></DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <EnableCodeSigning>false</EnableCodeSigning>\n    <CreatePackage>false</CreatePackage>\n    <EnablePackageSigning>false</EnablePackageSigning>\n    <IncludeMonoRuntime>true</IncludeMonoRuntime>\n    <UseSGen>true</UseSGen>\n    <UseRefCounting>true</UseRefCounting>\n    <CodeSignEntitlements>Entitlements.plist</CodeSignEntitlements>\n    <LinkMode>None</LinkMode>\n    <HttpClientHandler>HttpClientHandler</HttpClientHandler>\n    <XamMacArch></XamMacArch>\n    <AOTMode>None</AOTMode>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"PresentationCore\">\n      <HintPath>..\\wpf\\PresentationCore.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Xamarin.Mac\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\Contents.json\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-128.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-128%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-16.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-16%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-256.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-256%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-32.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-32%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-512.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-512%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\Contents.json\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Folder Include=\"Resources\\\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Info.plist\" />\n    <None Include=\"Entitlements.plist\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Main.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\fuse\\studio\\fuse-studio.csproj\">\n      <Project>{490EF7E5-46FF-4DF3-8342-530429CA65B5}</Project>\n      <Name>fuse-studio</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\mac\\Outracks.Fusion.Mac.csproj\">\n      <Project>{4B9EC6E2-AA97-48DE-9891-2C1D24A4D383}</Project>\n      <Name>Outracks.Fusion.Mac</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"..\\msbuild\\Xamarin.Mac.CSharp.targets\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/IEngine.cs",
    "content": "using System.Collections.Generic;\nusing Outracks.IO;\nusing Uno.Compiler;\nusing Uno.Compiler.Core;\n\nnamespace Outracks.CodeCompletion\n{\n    public interface IEngine\n    {\n        Compiler Compiler { get; }\n\n\t\tSourcePackage MainPackage { get; }\n\n\t    void Invalidate();\n\n\t\tIEnumerable<AbsoluteFilePath> AllSourceFiles { get; }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/IGoToDefinitionFactory.cs",
    "content": "﻿using Outracks.IO;\nusing Uno;\nusing Uno.Compiler;\nusing Uno.Compiler.Core;\n\nnamespace Outracks.CodeCompletion\n{\n\tpublic class GotoDefinitionData\n\t{\n\t\tpublic SourcePackage MainPackage { get; private set; }\n\t\tpublic Compiler Compiler { get; private set; }\n\t\tpublic AbsoluteFilePath FilePath { get; private set; }\n\t\tpublic string SrcCode { get; private set; }\n\t\tpublic int CaretOffset { get; private set; }\n\n        public GotoDefinitionData(SourcePackage mainPackage, Compiler compiler, AbsoluteFilePath filePath, string srcCode, int caretOffset)\n\t\t{\n\t\t\tMainPackage = mainPackage;\n\t\t\tCompiler = compiler;\n\t\t\tFilePath = filePath;\n\t\t\tSrcCode = srcCode;\n\t\t\tCaretOffset = caretOffset;\n\t\t}\n\t}\n\n\tpublic interface IGotoDefinitionFactory\n\t{\n\t\tbool TryGotoDefinitionBasedOnSyntax(SyntaxLanguageType type, GotoDefinitionData gotoDefinitionData, out Source source);\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/ISuggestionsFactory.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.IO;\nusing Uno.Compiler;\nusing Uno.Compiler.Core;\n\nnamespace Outracks.CodeCompletion\n{\n\tpublic class SuggestionDependentData\n\t{\n\t\tpublic SourcePackage MainPackage { get; private set; }\n        public Compiler Compiler { get; private set; }\n\t\tpublic AbsoluteFilePath FilePath { get; private set; }\n\t\tpublic string SrcCode { get; private set; }\n\t\tpublic int CaretOffset { get; private set; }\n\n        public SuggestionDependentData(SourcePackage mainPackage, Compiler compiler, AbsoluteFilePath filePath, string srcCode, int caretOffset)\n\t\t{\n\t\t\tMainPackage = mainPackage;\n\t\t\tCompiler = compiler;\n\t\t\tFilePath = filePath;\n\t\t\tSrcCode = srcCode;\n\t\t\tCaretOffset = caretOffset;\n\t\t}\n\t}\n\n\tpublic interface ISuggestionsFactory\n\t{\n\t\t bool SuggestionsBasedOnSyntax(SyntaxLanguageType type, SuggestionDependentData suggestionData, out IList<SuggestItem> suggestItems);\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/Outracks.CodeCompletion.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Core\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Core.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"IEngine.cs\" />\n    <Compile Include=\"IGoToDefinitionFactory.cs\" />\n    <Compile Include=\"ISuggestionsFactory.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SuggestItem.cs\" />\n    <Compile Include=\"SyntaxLanguage.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeCompletion\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/SuggestItem.cs",
    "content": "using System;\n\nnamespace Outracks.CodeCompletion\n{\n\tpublic enum SuggestItemType\n\t{\n\t\tKeyword,\n\t\tNamespace,\n\t\tClass,\n\t\tStruct,\n\t\tInterface,\n\t\tDelegate,\n\t\tGenericParameterType,\n\t\tEnum,\n\t\tEnumValue,\n\t\tConstant,\n\t\tField,\n\t\tVariable,\n\t\tMethodArgument,\n\t\tMethod,\n\t\tProperty,\n\t\tEvent,\n\t\tMetaProperty,\n\t\tBlock,\n\t\tBlockFactory,\n\t\tImporter,\n\t\tDirectory,\n\t\tFile,\n\t\tTypeAlias,\n\t\tError,\n        Constructor //Need some way to differentiate between methods and constructors..\n\t}\n\n\tpublic enum SuggestItemPriority\n\t{\n\t\tNormal,\n\t\tHigh\n\t}\n\n\tpublic interface IAutoCompleteCodeEditor\n\t{\n\t\tint GetCaretOffset();\n\t\tvoid InsertText(int offset, string text);\n\t\tvoid SetCarretPos(int offset);\n\t\tvoid RequestIntelliPrompt();\n\t}\n\n    public struct MethodArgument\n    {\n        public string Name;\n        public string ArgType;\n        public bool IsOut;\n        public MethodArgument(string name, string argType, bool isOut = false)\n        {\n            Name = name;\n            ArgType = argType;\n            IsOut = isOut;\n        }\n    }\n\n\tpublic class SuggestItem\n\t{\n\t\tpublic string Text { get; private set; }\n\t\tpublic SuggestItemType Type { get; private set; }\n\t\tpublic Func<string> HtmlDescriptionProvider { get; private set; }\n\t\tpublic Func<string> AutoCompletePreText { get; private set; }\n        public Func<string> AutoCompletePostText { get; private set; }\n        public Func<string> AutoCompleteDescriptionText { get; private set; } //Verbose description text\n        public string[] AutoCompleteAccessModifiers { get; private set; }\n        public string[] AutoCompleteFieldModifiers { get; private set; }\n        public MethodArgument[] AutoCompleteMethodArguments { get; private set; }\n\t\tpublic Action<IAutoCompleteCodeEditor> CommitAction { get; private set; }\n\t\tpublic SuggestItemPriority Priority { get; private set; }\n\n\t\tpublic SuggestItem(\n\t\t\tstring text,\n\t\t\tFunc<string> htmlDescriptionProvider,\n\t\t\tSuggestItemType type,\n\t\t\tFunc<string> autoCompletePreText = null,\n            Func<string> autoCompletePostText = null,\n            Func<string> autoCompleteDescriptionText = null,\n            string[] autoCompleteAccessModifiers = null,\n            string[] autoCompleteFieldModifiers = null,\n            MethodArgument[] arguments = null,\n\t\t\tAction<IAutoCompleteCodeEditor> commitAction = null,\n\t\t\tSuggestItemPriority priority = SuggestItemPriority.Normal)\n\t\t{\n\t\t\tthis.Text = text;\n\t\t\tthis.HtmlDescriptionProvider = htmlDescriptionProvider;\n\t\t\tthis.Type = type;\n\t\t\tthis.AutoCompletePreText = autoCompletePreText;\n            this.AutoCompletePostText = autoCompletePostText;\n            this.AutoCompleteDescriptionText = autoCompleteDescriptionText;\n            this.AutoCompleteAccessModifiers = autoCompleteAccessModifiers;\n            this.AutoCompleteFieldModifiers = autoCompleteFieldModifiers;\n            this.AutoCompleteMethodArguments = arguments;\n\t\t\tthis.CommitAction = commitAction;\n\t\t\tthis.Priority = priority;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Text + \" (\" + Type.ToString() + \")\";\n\t\t}\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/SyntaxLanguage.cs",
    "content": "namespace Outracks.CodeCompletion\n{\n\tpublic enum SyntaxLanguageType\n\t{\n\t\tUnknown,\n\t\tUno,\n\t\tUX\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/AmbientParser/Context.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Uno;\nusing Uno.Compiler.API.Domain.Graphics;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Core;\n\nnamespace Outracks.UnoDevelop.CodeNinja.AmbientParser\n{\n    public class Context\n    {\n        public List<Node> NodePath { get; private set; }\n\n        public Compiler Compiler;\n        public Namespace Root;\n\n        public bool expectsConstructor = false;\n\n\n\n        public bool InTypeBody\n        {\n            get\n            {\n                if (NodePath.Count == 0) return false;\n\n                var last = Enumerable.Last(NodePath);\n                return\n                    last.TypeOrNamespace != null && (\n                    last.Type == NodeType.Class ||\n                    last.Type == NodeType.Struct ||\n                    last.Type == NodeType.Field);\n            }\n        }\n\n        public Namescope TypeOrNamespace\n        {\n            get { return TypeOrNamespaces.FirstOrDefault(); }\n        }\n\n        public IEnumerable<Namescope> TypeOrNamespaces\n        {\n            get { return NodePath.Reverse<Node>().Select(n => n.TypeOrNamespace).NotNull(); }\n        }\n\n        public IEnumerable<BlockBase> BlockBasePath\n        {\n            get { return NodePath.Reverse<Node>().Select(n => n.BlockBase).NotNull(); }\n        }\n\n        public Node DrawStatementNode\n        {\n            get { return NodesOfType(NodeType.DrawStatement).FirstOrDefault(); }\n        }\n\n        public Node MetaPropertyNode\n        {\n            get { return NodesOfType(NodeType.MetaProperty).FirstOrDefault(); }\n        }\n\n        IEnumerable<Node> NodesOfType(NodeType type)\n        {\n            return NodePath.Reverse<Node>().Where(n => n.Type == type);\n        }\n\n        public Node InlineBlock\n        {\n            get\n            {\n                return NodePath.LastOrDefault(x => x.Type == NodeType.InlineBlock);\n            }\n        }\n\n        public Node Block\n        {\n            get\n            {\n                return NodePath.LastOrDefault(x => x.Type == NodeType.Block);\n            }\n        }\n\n        public BlockBase BlockBase\n        {\n            get\n            {\n                foreach (var n in NodePath.Reverse<Node>())\n                {\n                    if (n.BlockBase != null) return n.BlockBase;\n                }\n                return null;\n            }\n        }\n\n        bool Visit(MetaProperty mp, Node n, int offset)\n        {\n            n.MetaProperty = mp;\n            // Check if we are not inside the right node\n            if (!(n.StartOffset < offset && n.EndOffset >= offset)) return false;\n\n            NodePath.Add(n);\n            if (n.Children != null)\n            {\n                foreach (var c in n.Children)\n                {\n                    if (Visit(mp, c, offset)) return false;\n                }\n            }\n\n            return true;\n        }\n\n        bool Visit(BlockBase b, Node n, int offset)\n        {\n            n.BlockBase = b;\n            // Check if we are not inside the right node\n            if (!(n.StartOffset < offset && n.EndOffset >= offset)) return false;\n\n            NodePath.Add(n);\n\n            // Add metaproperties from lambda draw.\n            var metaProperties = new List<MetaProperty>();\n            foreach (var i in b.Members)\n            {\n                if (i.Type == BlockMemberType.Apply)\n                {\n                    var applyItem = i as Apply;\n                    if (applyItem.Block.Parent == b)\n                    {\n                        foreach(var c in applyItem.Block.Members)\n                        {\n                            if(c.Type == BlockMemberType.MetaProperty)\n                            {\n                                metaProperties.Add(c as MetaProperty);\n                            }\n                        }\n                    }\n                }\n            }\n\n            if (n.Children != null)\n                foreach (var c in n.Children)\n                {\n                    foreach (var db in b.EnumerateNestedScopes())\n                    {\n                        if (Visit(db, c, offset)) return true;\n                    }\n\n                    if (c.Type == NodeType.MetaProperty)\n                    {\n                        foreach (var m in metaProperties)\n                        {\n                            if(m.Name == c.Name)\n                            {\n                                if (Visit(m, c, offset)) return true;\n                            }\n                        }\n                    }\n\n                    foreach (var i in b.Members)\n                    {\n                        if (i.Type == BlockMemberType.Apply && c.Type == NodeType.Apply)\n                        {\n                            c.ApplyItem = i as Apply;\n                            continue;\n                        }\n\n                        if (i.Type == BlockMemberType.MetaProperty && c.Type == NodeType.MetaProperty)\n                        {\n                            var mp = i as MetaProperty;\n                            if (mp.Name == c.Name)\n                            {\n                                if (Visit(mp, c, offset)) return true;\n                            }\n\n                        }\n                    }\n\n                    if (Visit(b, c, offset)) return true;\n                }\n\n            return true;\n        }\n\n        bool Visit(Member m, Node n, int offset)\n        {\n            n.Member = m;\n            // Check if we are not inside the right node\n            if (!(n.StartOffset < offset && n.EndOffset >= offset)) return false;\n\n            NodePath.Add(n);\n\n            if (n.Children != null)\n                foreach (var c in n.Children)\n                {\n                    if (m is Method)\n                    {\n                        var method = m as Method;\n\n                        foreach (var db in method.DrawBlocks)\n                        {\n                            if (Visit(db, c, offset)) return true;\n                        }\n                    }\n\n                    if (Visit(m, c, offset)) return true;\n                }\n\n            return true;\n        }\n\n\n        bool Visit(Namescope scope, Node n, int offset)\n        {\n            n.TypeOrNamespace = scope;\n            if (scope is ClassType)\n            {\n                n.BlockBase = (scope as ClassType).Block;\n            }\n\n            if (scope is Block) return Visit(scope as Block, n, offset);\n\n            var name = n.Name;\n            if (n.Name != \"<root>\" && name.Contains('<')) name = name.Substring(0, name.IndexOf('<'));\n\n            // Check if we are not inside the right node\n            if (!(n.StartOffset < offset && n.EndOffset >= offset)) return false;\n\n            NodePath.Add(n);\n\n            if (n.Children != null)\n            {\n                foreach (var c in n.Children)\n                {\n                    // If current scope is a data type, check if a type member has a match with the child node, if so let them have precedence\n                    if (scope is DataType)\n                    {\n                        var dt = scope as DataType;\n\n                        if (c.Type == NodeType.Constructor)\n                        {\n                            foreach (var m in dt.Constructors)\n                            {\n                                if (m.Source.Offset == c.StartOffset)\n                                {\n                                    if (Visit(m, c, offset)) return true;\n                                }\n                            }\n                        }\n                        else\n                        {\n                            foreach (var m in dt.EnumerateMembers())\n                            {\n                                if (m.Name == c.Name)\n                                {\n                                    if (Visit(m, c, offset)) return true;\n                                }\n                            }\n                        }\n                    }\n\n                    // Check if a child scope has a match with the child node, if so let them have precedence\n                    foreach (var cn in scope.EnumerateNestedScopes())\n                    {\n                        if (cn.Name == c.Name)\n                        {\n                            if (Visit(cn, c, offset)) return true;\n                        }\n                    }\n                    if (Visit(scope, c, offset)) return true;\n                }\n            }\n\n            return true;\n        }\n\n        public IEnumerable<string> Usings\n        {\n            get\n            {\n                foreach (var n in NodePath)\n                {\n                    if ((n.Type == NodeType.Namespace || n.Type == NodeType.Root) && n.Children != null)\n                    {\n                        foreach (var u in n.Children)\n                        {\n                            if (u.Type == NodeType.Using) yield return u.Name;\n                        }\n                    }\n                }\n            }\n        }\n\n        public IEnumerable<string> UsingStatics\n        {\n            get\n            {\n                foreach (var n in NodePath)\n                {\n                    if ((n.Type == NodeType.Namespace || n.Type == NodeType.Root) && n.Children != null)\n                    {\n                        foreach (var u in n.Children)\n                        {\n                            if (u.Type == NodeType.UsingStatic) yield return u.Name;\n                        }\n                    }\n                }\n            }\n        }\n\n        public Source Source;\n\n        public Context(Compiler compiler, Source src, ParseResult parseResult, int offset, int length)\n        {\n            if (compiler == null)\n                return;\n\n            Source = src;\n\n            Compiler = compiler;\n            Root = compiler.Data.IL;\n            NodePath = new List<Node>();\n\n            offset -= length - parseResult.CodeLengthAtParseTime;\n\n            Visit(Root, parseResult.Root, offset);\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/AmbientParser/ICodeReader.cs",
    "content": "﻿namespace Outracks.UnoDevelop.CodeNinja.AmbientParser\n{\n    public interface ICodeReader<out T>\n    {\n        T PeekTokenReverse();\n        T ReadTokenReverse();\n        T ReadToken();\n        T PeekToken();\n        int Offset { get; set; }\n        int Length { get; }\n        string PeekTextReverse(int charCount);\n        string PeekText(int charCount);\n        string ReadText(int charCount);\n        string ReadTextReverse(int charCount);\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/AmbientParser/IUnoCodeReader.cs",
    "content": "﻿using Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.AmbientParser\n{\n    public interface IUnoCodeReader : ICodeReader<TokenType>\n    {\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/AmbientParser/Node.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Uno.Compiler.API.Domain.Graphics;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\n\nnamespace Outracks.UnoDevelop.CodeNinja.AmbientParser\n{\n    public enum NodeType\n    {\n        Root,\n        Using,\n        UsingStatic,\n        Namespace,\n        Class,\n        Block,\n        Struct,\n        Interface,\n        Enum,\n        Delegate,\n        Field,\n        Method,\n        Apply,\n        Constructor,\n        Operator,\n        Property,\n        GetScope,\n        SetScope,\n        Indexer,\n        MetaProperty,\n        MetaPropertyDefinition,\n        MetaPropertyDefinitionScope,\n        DrawStatement,\n        InlineBlock,\n        Catch,\n        Event,\n        AddScope,\n        RemoveScope,\n    }\n\n    public static class NodeTypeHelpers\n    {\n        public static bool IsMethodNode (this NodeType nt)\n        {\n            switch (nt)\n            {\n                case NodeType.Root:\n                case NodeType.Using:\n                case NodeType.UsingStatic:\n                case NodeType.Namespace:\n                case NodeType.Class:\n                case NodeType.Block:\n                case NodeType.Struct:\n                case NodeType.Enum:\n                case NodeType.Delegate:\n                case NodeType.Field:\n                case NodeType.Apply:\n                case NodeType.Indexer:\n                case NodeType.Property:\n                case NodeType.MetaProperty:\n                case NodeType.MetaPropertyDefinition:\n                case NodeType.DrawStatement:\n                case NodeType.InlineBlock:\n                case NodeType.Catch:\n                case NodeType.Event:\n                    return false;\n\n                case NodeType.Method:\n                case NodeType.Constructor:\n                case NodeType.Operator:\n                case NodeType.GetScope:\n                case NodeType.SetScope:\n                case NodeType.AddScope:\n                case NodeType.RemoveScope:\n                case NodeType.MetaPropertyDefinitionScope:\n                    return true;\n\n                default:\n                    throw new Exception(\"Unknown node type\");\n            }\n        }\n    }\n\n    public class Node\n    {\n        public int StartOffset, EndOffset;\n        public NodeType Type;\n\n        public Namescope TypeOrNamespace;\n        public Member Member;\n        public BlockBase BlockBase;\n        public Apply ApplyItem;\n        public MetaProperty MetaProperty;\n\n        List<Node> _children;\n\n        public void AddChild(Node n)\n        {\n            if (_children == null) _children = new List<Node>();\n            _children.Add(n);\n        }\n\n        public IEnumerable<Node> Children\n        {\n            get\n            {\n                return _children;\n            }\n        }\n\n        string _name;\n        public string Name\n        {\n            get { return _name; }\n        }\n        public string BaseClassName;\n\n        public string DrawStatementBlockList;\n\n        public Node(int startOffset, int endOffset, NodeType type, string name)\n        {\n            StartOffset = startOffset;\n            EndOffset = endOffset;\n            Type = type;\n            _name = name;\n        }\n\n        public override string ToString()\n        {\n            return Type.ToString().ToLower() + \" \" + Name;\n        }\n    }\n\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/AmbientParser/Parser.ClassBody.cs",
    "content": "﻿using System.Linq;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.AmbientParser\n{\n    public partial class Parser\n    {\n        void ParseClassOrBlockBody(Node c)\n        {\n            while (NextToken != TokenType.EndOfFile)\n            {\n                int start = NextTokenOffset;\n\n                if (Parse(TokenType.RightCurlyBrace)) break;\n\n                if (Contextual(Tokens.Apply))\n                {\n                    ParseNodeTo(c, NextToken == TokenType.Identifier ? NextTokenValue : \"apply\", LastTokenOffset, TokenType.Semicolon, NodeType.Apply, true);\n                    continue;\n                }\n\n                if (ParseModifier()) continue;\n\n                if (ParseTypeOrBlockDeclaration(c))\n                {\n                    continue;\n                }\n\n                if (Contextual(Tokens.Meta))\n                {\n                    Parse(TokenType.Identifier);\n                    Parse(TokenType.LeftCurlyBrace);\n                    ParseClassOrBlockBody(c);\n                    continue;\n                }\n\n                // Operators (operator <return_type> (...))\n                if (Parse(TokenType.Operator))\n                {\n                    ParseDataType();\n                    ParseFunctionWithParameterList(c, NodeType.Operator, \"\", start);\n                    continue;\n                }\n\n                int dataTypeStart = _pos;\n                if (ParseDataType())\n                {\n                    int dataTypeEnd = _pos;\n\n                    // Indexers\n                    if (Parse(TokenType.This))\n                    {\n                        ParseParameterList(TokenType.LeftSquareBrace, TokenType.RightSquareBrace);\n\n                        if (Parse(TokenType.LeftCurlyBrace))\n                        {\n                            var p = new Node(start, 0, NodeType.Indexer, \"Item\");\n                            ParseGetSetScope(p);\n                            p.EndOffset = LastTokenOffset;\n                            c.AddChild(p);\n                            continue;\n                        }\n                    }\n\n                    // Operators (<return_type> operator <op>(...))\n                    if (Parse(TokenType.Operator))\n                    {\n                        Consume(); // consume operator name\n                        ParseFunctionWithParameterList(c, NodeType.Operator, LastTokenValue, start);\n                        continue;\n                    }\n\n                    // Constructors\n                    if (NextToken == TokenType.LeftParen)\n                    {\n                        ParseFunctionWithParameterList(c, NodeType.Constructor, LastTokenValue, start);\n                        continue;\n                    }\n\n                    string name;\n                    // Fields, methods, properties or meta properties\n                    if (ParseName(out name))\n                    {\n                        // Fields without initializer\n                        if (Parse(TokenType.Semicolon))\n                        {\n                            c.AddChild(new Node(start, LastTokenOffset, NodeType.Field, name));\n                            continue;\n                        }\n\n                        // Fields with initializer\n                        if (Parse(TokenType.Assign))\n                        {\n                            ParseNodeTo(c, name, start, TokenType.Semicolon, NodeType.Field);\n                            continue;\n                        }\n\n                        // Properties\n                        if (Parse(TokenType.LeftCurlyBrace))\n                        {\n                            var p = new Node(start, 0, NodeType.Property, name);\n                            ParseGetSetScope(p);\n                            p.EndOffset = LastTokenOffset;\n                            c.AddChild(p);\n                            continue;\n                        }\n\n                        // Generic method arguments\n                        if (Parse(TokenType.LessThan))\n                        {\n                            while (true)\n                            {\n                                if (Parse(TokenType.GreaterThan)) break;\n                                if (Parse(TokenType.EndOfFile)) return;\n                                Consume();\n                            }\n                        }\n\n                        // Methods\n                        if (ParseFunctionWithParameterList(c, NodeType.Method, name, start))\n                        {\n                            continue;\n                        }\n\n                        // Fall through to handle meta properties with types\n                    }\n\n                    ParseMetaProperty(start, c, dataTypeStart, dataTypeEnd);\n                }\n                else\n                {\n                    // Else ignore unrecognized token\n                    Consume();\n                }\n            }\n        }\n\n        void ParseMetaProperty(int start, Node c, int dataTypeStart, int dataTypeEnd)\n        {\n            // Meta properties\n            var metaName = LastTokenValue;\n            if (Parse(TokenType.Colon))\n            {\n                int scopeCount = 0;\n                var meta = new Node(start, 0, NodeType.MetaProperty, metaName);\n                c.AddChild(meta);\n\n                int defCount = 1;\n\n                var def = new Node(LastTokenOffset, 0, NodeType.MetaPropertyDefinition, \"Definition\" + defCount);\n                meta.AddChild(def);\n\n                while (NextToken != TokenType.EndOfFile)\n                {\n                    if (scopeCount < 1)\n                    {\n                        if (NextToken == TokenType.Semicolon || NextToken == TokenType.Comma)\n                        {\n                            def.EndOffset = LastTokenOffset;\n                            if (def.Children != null) def.Children.First().EndOffset = LastTokenOffset;\n\n                            if (Parse(TokenType.Comma))\n                            {\n                                defCount++;\n                                def = new Node(LastTokenOffset, 0, NodeType.MetaPropertyDefinition, \"Definition\" + defCount);\n                                meta.AddChild(def);\n                                continue;\n                            }\n                            else if (Parse(TokenType.Semicolon))\n                            {\n                                break;\n                            }\n                        }\n                        if (Parse(TokenType.LeftCurlyBrace))\n                        {\n                            scopeCount++;\n                            def.AddChild(new Node(LastTokenOffset, _code.Length - 1, NodeType.MetaPropertyDefinitionScope, \"DefinitionScope\"));\n                            continue;\n                        }\n                    }\n                    if (Parse(TokenType.LeftParen)) scopeCount++;\n                    else if (Parse(TokenType.RightParen)) scopeCount--;\n                    else if (Parse(TokenType.LeftCurlyBrace)) scopeCount++;\n                    else if (Parse(TokenType.RightCurlyBrace)) scopeCount--;\n                    else Consume();\n\n                    if (scopeCount < 0) break;\n                }\n                def.EndOffset = LastTokenOffset;\n                meta.EndOffset = LastTokenOffset;\n                if (def.Children != null) { if (def.Children.First().EndOffset == _code.Length - 1) def.Children.First().EndOffset = LastTokenOffset; }\n\n            }\n        }\n\n        bool ParseParameterList(TokenType leftParen = TokenType.LeftParen, TokenType rightParen = TokenType.RightParen)\n        {\n            if (!Parse(leftParen)) return false;\n\n            while (NextToken != TokenType.EndOfFile)\n            {\n                Parse(TokenType.Out);\n                Parse(TokenType.Ref);\n\n                ParseDataType();\n                Parse(TokenType.Identifier);\n\n                if (Parse(TokenType.Comma)) continue;\n                if (NextToken == TokenType.LeftParen) ParseParameterList(leftParen, rightParen);\n                if (Parse(rightParen)) return true;\n                Consume();\n                //break;\n            }\n            return true;\n        }\n\n        void ParseDrawStatement(Node func)\n        {\n            int blockListStart = NextTokenOffset;\n\n            var ds = new Node(LastTokenOffset, -1, NodeType.DrawStatement, \"DrawStatement\");\n            func.AddChild(ds);\n\n            while (NextToken != TokenType.EndOfFile)\n            {\n                if (Parse(TokenType.Semicolon))\n                {\n                    ds.DrawStatementBlockList = _code.Substring(blockListStart, LastTokenOffset - blockListStart);\n                    ds.EndOffset = LastTokenOffset;\n                    return;\n                }\n\n                if (Parse(TokenType.LeftCurlyBrace))\n                {\n                    ds.DrawStatementBlockList = _code.Substring(blockListStart, LastTokenOffset - blockListStart);\n                    var ib = new Node(LastTokenOffset, -1, NodeType.InlineBlock, \"InlineBlock\");\n                    ParseClassOrBlockBody(ib);\n                    ib.EndOffset = LastTokenOffset;\n                    ds.EndOffset = LastTokenOffset;\n                    ds.AddChild(ib);\n                    return;\n                }\n\n                Consume();\n            }\n        }\n\n        bool ParseFunctionBody(Node func)\n        {\n            if (!Parse(TokenType.LeftCurlyBrace)) return false;\n\n            int scopeCount = 1;\n            while (scopeCount != 0 && NextToken != TokenType.EndOfFile)\n            {\n                if (Contextual(Tokens.Draw))\n                {\n                    ParseDrawStatement(func);\n                    continue;\n                }\n\n                if (Parse(TokenType.Catch))\n                {\n                    Node n = new Node(-1, -1, NodeType.Catch, \"\");\n                    func.AddChild(n);\n\n                    var start = LastTokenOffset;\n                    n.StartOffset = start;\n                    n.EndOffset = int.MaxValue;\n\n                    if (!ParseTo(TokenType.LeftCurlyBrace)) return true;\n                    Consume();\n\n                    ScopeScan();\n\n                    n.EndOffset = LastTokenOffset;\n\n                    continue;\n                }\n\n                if (Parse(TokenType.LeftCurlyBrace)) { scopeCount++; continue; }\n                else if (Parse(TokenType.RightCurlyBrace)) { scopeCount--; continue; }\n                Consume();\n            }\n\n            return true;\n        }\n\n        void ParseGetSetScope(Node p)\n        {\n            while (NextToken != TokenType.EndOfFile)\n            {\n                while (ParseModifier()) { }\n\n                if (NextToken == TokenType.Identifier && NextTokenValue == \"get\")\n                {\n                    Consume();\n\n                    if (Parse(TokenType.Semicolon)) continue;\n\n                    var getStart = NextTokenOffset;\n                    var func = new Node(getStart, -1, NodeType.GetScope, \"GetScope\");\n                    if (ParseFunctionBody(func))\n                    {\n                        func.EndOffset = LastTokenOffset;\n                        p.AddChild(func);\n                    }\n                }\n                else if (NextToken == TokenType.Identifier && NextTokenValue == \"set\")\n                {\n                    Consume();\n\n                    if (Parse(TokenType.Semicolon)) continue;\n\n                    var getStart = NextTokenOffset;\n                    var func = new Node(getStart, -1, NodeType.SetScope, \"SetScope\");\n                    if (ParseFunctionBody(func))\n                    {\n                        func.EndOffset = LastTokenOffset;\n                        p.AddChild(func);\n                    }\n                }\n                else if (Parse(TokenType.RightCurlyBrace)) break;\n                else Consume();\n            }\n        }\n\n        bool ParseFunctionWithParameterList(Node c, NodeType type, string name, int start)\n        {\n            if (!ParseParameterList()) return false;\n\n            // Bodyless function\n            if (Parse(TokenType.Semicolon))\n            {\n                c.AddChild(new Node(start, LastTokenOffset, type, name));\n                return true;\n            }\n\n            if (Parse(TokenType.Colon))\n            {\n                if (Parse(TokenType.Base) && Parse(TokenType.LeftParen))\n                {\n                    ScopeScan(TokenType.LeftParen, TokenType.RightParen);\n                }\n                else\n                {\n                    while (true)\n                    {\n                        if (NextToken == TokenType.LeftCurlyBrace) break;\n                        if (NextToken == TokenType.EndOfFile) return true;\n                        Consume();\n                    }\n                }\n            }\n\n            // Function body\n            var func = new Node(start, LastTokenOffset, type, name);\n            if (ParseFunctionBody(func))\n            {\n                func.EndOffset = LastTokenOffset;\n                c.AddChild(func);\n                return true;\n            }\n\n            return false;\n        }\n\n        void ParseEventBody(Node p)\n        {\n            while (NextToken != TokenType.EndOfFile)\n            {\n                if (NextTokenValue == Tokens.Add)\n                {\n                    Consume();\n\n                    var getStart = NextTokenOffset;\n                    var func = new Node(getStart, -1, NodeType.AddScope, \"AddScope\");\n                    if (ParseFunctionBody(func))\n                    {\n                        func.EndOffset = LastTokenOffset;\n                        p.AddChild(func);\n                    }\n                }\n                else if (NextTokenValue == Tokens.Remove)\n                {\n                    Consume();\n\n                    var getStart = NextTokenOffset;\n                    var func = new Node(getStart, -1, NodeType.RemoveScope, \"RemoveScope\");\n                    if (ParseFunctionBody(func))\n                    {\n                        func.EndOffset = LastTokenOffset;\n                        p.AddChild(func);\n                    }\n                }\n                else if (Parse(TokenType.Semicolon)) break;\n                else if (Parse(TokenType.RightCurlyBrace)) break;\n                else Consume();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/AmbientParser/Parser.Root.cs",
    "content": "﻿using System.Collections.Generic;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.AmbientParser\n{\n    public partial class Parser\n    {\n        void ParseRoot(Node parent)\n        {\n            while (NextToken != TokenType.EndOfFile)\n            {\n                if (Parse(TokenType.RightCurlyBrace)) break;\n\n                if (Parse(TokenType.Using))\n                {\n                    var usingType = Parse(TokenType.Static) ? NodeType.UsingStatic : NodeType.Using;\n                    TokenType hit;\n                    int startOffset = LastTokenOffset;\n                    var usingName = NextToken == TokenType.Identifier ? ParseStringTo(out hit, TokenType.Semicolon) : \"using\";\n                    parent.AddChild(new Node(LastTokenOffset, startOffset, usingType, usingName));\n                    continue;\n                }\n\n                if (Parse(TokenType.Namespace))\n                {\n                    TokenType hit;\n                    var name = ParseStringTo(out hit, TokenType.LeftCurlyBrace);\n                    if (hit == TokenType.EndOfFile) return;\n\n                    List<Node> namespaces = null;\n                    Node ns = parent;\n\n                    namespaces = new List<Node>();\n                    var parts = name.Split('.');\n\n                    for (int i = 0; i < parts.Length; i++)\n                    {\n                        var nc = new Node(LastTokenOffset, -1, NodeType.Namespace, parts[i]);\n                        if (ns != null) ns.AddChild(nc);\n                        namespaces.Add(nc);\n                        ns = nc;\n                    }\n\n                    ParseRoot(ns);\n\n                    if (namespaces != null)\n                        foreach (var nns in namespaces) nns.EndOffset = NextTokenOffset;\n                    else\n                        ns.EndOffset = NextTokenOffset;\n\n                    continue;\n                }\n\n                if (ParseTypeOrBlockDeclaration(parent))\n                {\n                    continue;\n                }\n\n                // Skip unknown tokens\n                Consume();\n            }\n        }\n\n        void SkipAttributes()\n        {\n            while (Parse(TokenType.LeftSquareBrace))\n            {\n                int c = 1;\n                while (c > 0)\n                {\n                    if (Parse(TokenType.LeftSquareBrace)\n                        || Parse(TokenType.LeftParen)\n                        || Parse(TokenType.LeftCurlyBrace))\n                    {\n                        c++;\n                        continue;\n                    }\n                    else if (Parse(TokenType.RightSquareBrace)\n                        || Parse(TokenType.RightParen)\n                        || Parse(TokenType.RightCurlyBrace))\n                    {\n                        c--;\n                        continue;\n                    }\n                    else if (NextToken == TokenType.EndOfFile) break;\n                    else Consume();\n                }\n            }\n        }\n\n        bool ParseTypeOrBlockDeclaration(Node parent)\n        {\n            SkipAttributes();\n\n            while (ParseModifier()) { }\n\n            if (Contextual(Tokens.Block))\n            {\n                TokenType terminator;\n                var c = new Node(LastTokenOffset, -1, NodeType.Block, ParseStringTo(out terminator, TokenType.Colon, TokenType.LeftCurlyBrace));\n                if (terminator == TokenType.EndOfFile) return false;\n\n                ParseClassOrBlockBody(c);\n                c.EndOffset = LastTokenOffset;\n\n                parent.AddChild(c);\n                return true;\n            }\n\n            if (Parse(TokenType.Class))\n            {\n                TokenType terminator;\n                var c = new Node(LastTokenOffset, -1, NodeType.Class, ParseStringTo(out terminator, TokenType.Colon, TokenType.LeftCurlyBrace, TokenType.LessThan));\n\n                if (terminator == TokenType.LessThan)\n                {\n                    while (true)\n                    {\n                        if (Parse(TokenType.Colon)) { terminator = TokenType.Colon; break; }\n                        if (Parse(TokenType.LeftCurlyBrace)) { terminator = TokenType.LeftCurlyBrace; break; }\n                        if (Parse(TokenType.EndOfFile)) { break; }\n                        Consume();\n                    }\n                }\n\n                TokenType hit;\n                if (terminator == TokenType.Colon)\n                {\n                    c.BaseClassName = ParseStringTo(out hit, TokenType.LeftCurlyBrace, TokenType.LessThan);\n\n                    if (hit == TokenType.EndOfFile) return false;\n                }\n\n                ParseClassOrBlockBody(c);\n\n                c.EndOffset = LastTokenOffset;\n\n                parent.AddChild(c);\n                return true;\n            }\n\n            if (Parse(TokenType.Interface))\n            {\n                TokenType terminator;\n                var c = new Node(LastTokenOffset, -1, NodeType.Interface, ParseStringTo(out terminator, TokenType.Colon, TokenType.LeftCurlyBrace, TokenType.LessThan));\n\n                if (terminator == TokenType.LessThan)\n                {\n                    while (true)\n                    {\n                        if (Parse(TokenType.Colon)) { terminator = TokenType.Colon; break; }\n                        if (Parse(TokenType.LeftCurlyBrace)) { terminator = TokenType.LeftCurlyBrace; break; }\n                        if (Parse(TokenType.EndOfFile)) { break; }\n                        Consume();\n                    }\n                }\n\n                TokenType hit;\n                if (terminator == TokenType.Colon)\n                {\n                    c.BaseClassName = ParseStringTo(out hit, TokenType.LeftCurlyBrace, TokenType.LessThan);\n\n                    if (hit == TokenType.EndOfFile) return false;\n                }\n\n                ParseClassOrBlockBody(c);\n\n                c.EndOffset = LastTokenOffset;\n\n                parent.AddChild(c);\n                return true;\n            }\n\n            if (Parse(TokenType.Struct))\n            {\n                TokenType hit;\n                var c = new Node(LastTokenOffset, -1, NodeType.Struct, ParseStringTo(out hit, TokenType.LeftCurlyBrace));\n                if (hit == TokenType.EndOfFile) return false;\n\n                ParseClassOrBlockBody(c);\n\n                c.EndOffset = LastTokenOffset;\n\n                parent.AddChild(c);\n                return true;\n            }\n\n            if (Parse(TokenType.Enum))\n            {\n                TokenType hit;\n                var c = new Node(LastTokenOffset, -1, NodeType.Enum, ParseStringTo(out hit, TokenType.LeftCurlyBrace));\n                if (hit == TokenType.EndOfFile) return false;\n\n                TokenType terminator;\n                while (true)\n                {\n                    SkipAttributes();\n                    ParseStringTo(out terminator, TokenType.Comma, TokenType.RightCurlyBrace);\n                    if (terminator == TokenType.RightCurlyBrace || terminator == TokenType.EndOfFile) break;\n                }\n\n                c.EndOffset = LastTokenOffset;\n\n                parent.AddChild(c);\n                return true;\n            }\n\n            if (Parse(TokenType.Delegate))\n            {\n                ParseNodeTo(parent, \"delegate\", LastTokenOffset, TokenType.Semicolon, NodeType.Delegate);\n                return true;\n            }\n\n            if (Parse(TokenType.Event))\n            {\n                ParseDataType();\n\n                TokenType hit;\n                var c = new Node(LastTokenOffset, -1, NodeType.Event, ParseStringTo(out hit, TokenType.LeftCurlyBrace, TokenType.Semicolon));\n                if (hit == TokenType.EndOfFile) return false;\n\n                if(hit != TokenType.Semicolon)\n                    ParseEventBody(c);\n\n                c.EndOffset = LastTokenOffset;\n\n                parent.AddChild(c);\n                return true;\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/AmbientParser/Parser.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Uno.Compiler;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.AmbientParser\n{\n    public class ParseResult\n    {\n        public Node Root;\n        public int CodeLengthAtParseTime;\n\n        public ParseResult(int codeLengthAtParseTime)\n        {\n            CodeLengthAtParseTime = codeLengthAtParseTime;\n        }\n    }\n\n    public partial class Parser\n    {\n        readonly Token[] _tokens;\n        readonly string _code;\n        int _pos;\n\n        public static ParseResult Parse(string code)\n        {\n            return new Parser(Lexer.Tokenize(new SourceFile(\"(unknown)\", code), code), code).Parse();\n        }\n\n        public static ParseResult Parse(IEnumerable<Token> tokens, string code)\n        {\n            return new Parser(tokens, code).Parse();\n        }\n\n        Parser(IEnumerable<Token> tokens, string code)\n        {\n            _tokens = tokens.ToArray();\n            _code = code;\n        }\n\n        ParseResult Parse()\n        {\n            var root = new Node(0, int.MaxValue, NodeType.Root, \"<root>\");\n\n            ParseRoot(root);\n\n            return new ParseResult(_code.Length) { Root = root };\n        }\n\n        string LastTokenValue\n        {\n            get\n            {\n                return _tokens[_pos - 1].Value;\n            }\n        }\n\n        int LastTokenOffset\n        {\n            get\n            {\n                return _tokens[_pos - 1].Offset;\n            }\n        }\n\n        int NextTokenOffset\n        {\n            get\n            {\n                if (_pos < _tokens.Length) return _tokens[_pos].Offset;\n                else return _code.Length - 1;\n            }\n        }\n\n        void Consume()\n        {\n            if (NextToken != TokenType.EndOfFile) _pos++;\n        }\n\n        TokenType LastToken\n        {\n            get\n            {\n                return _tokens[_pos-1].Type;\n            }\n        }\n\n        TokenType NextToken\n        {\n            get\n            {\n                if (_pos < _tokens.Length) return _tokens[_pos].Type;\n                else return TokenType.EndOfFile;\n            }\n        }\n\n        string NextTokenValue\n        {\n            get\n            {\n                return _tokens[_pos].Value;\n            }\n        }\n\n        bool Parse(TokenType t)\n        {\n            if (NextToken == t)\n            {\n                Consume();\n                return true;\n            }\n            return false;\n        }\n\n        bool Contextual(string keyword)\n        {\n            if (NextTokenValue == keyword)\n            {\n                Consume();\n                return true;\n            }\n            return false;\n        }\n\n        string ParseStringTo(out TokenType hitTerminator, params TokenType[] terminators)\n        {\n            string s = \"\";\n            while (NextToken != TokenType.EndOfFile)\n            {\n                bool found = false;\n                foreach (var t in terminators) if (NextToken == t) { found = true; break; }\n                if (found) break;\n                s += NextTokenValue;\n                Consume();\n            }\n            hitTerminator = NextToken;\n            Consume();\n            return s;\n        }\n\n        bool ParseNodeTo(Node parent, string name, int startOffset, TokenType terminator, NodeType nt, bool parseName = false)\n        {\n            while (true)\n            {\n                Consume();\n                if (NextToken == terminator || NextToken == TokenType.EndOfFile)\n                {\n                    Consume();\n                    parent.AddChild(new Node(startOffset, LastTokenOffset, nt, name));\n                    return NextToken != TokenType.EndOfFile;\n                }\n\n                if(parseName)\n                    name += NextTokenValue;\n            }\n        }\n\n        bool ParseTo(TokenType t)\n        {\n            while (NextToken != t)\n            {\n                if (NextToken == TokenType.EndOfFile) return false;\n                Consume();\n            }\n            return true;\n        }\n\n        bool ParseModifier()\n        {\n            switch (NextToken)\n            {\n                case TokenType.Public:\n                case TokenType.Private:\n                case TokenType.Protected:\n                case TokenType.Virtual:\n                case TokenType.Abstract:\n                case TokenType.Extern:\n                case TokenType.Override:\n                case TokenType.Static:\n                case TokenType.Const:\n                    Consume();\n                    return true;\n                case TokenType.Identifier:\n                    if (NextTokenValue == Tokens.Meta)\n                    {\n                        Consume();\n                        return true;\n                    }\n                    break;\n            }\n            return false;\n        }\n\n        void ScopeScan(TokenType leftBrace = TokenType.LeftCurlyBrace, TokenType rightBrace = TokenType.RightCurlyBrace)\n        {\n            int scopeCount = 1;\n\n            while (scopeCount > 0)\n            {\n                if (NextToken == leftBrace) { Consume(); scopeCount++; continue; }\n                if (NextToken == rightBrace) { Consume(); scopeCount--; continue; }\n                if (NextToken == TokenType.EndOfFile) break;\n                Consume();\n            }\n        }\n\n        bool ParseTypeAlias()\n        {\n            foreach (var t in TypeAliases.AllAliases)\n            {\n                if (NextTokenValue == t) { Consume(); return true; }\n            }\n            return false;\n        }\n\n        bool ParseDataType()\n        {\n            var old = _pos;\n\n            if (ParseTypeAlias() || Parse(TokenType.Void))\n            {\n                while (Parse(TokenType.LeftSquareBrace))\n                {\n                    Parse(TokenType.RightSquareBrace);\n                }\n\n                return true;\n            }\n\n            while (true)\n            {\n                if (NextToken == TokenType.Identifier)\n                {\n                    Consume();\n                    if (Parse(TokenType.Period)) continue;\n                    else if (Parse(TokenType.LessThan))\n                    {\n                        while (true)\n                        {\n                            if (ParseDataType())\n                            {\n                                if (Parse(TokenType.Comma)) continue;\n                                else if (Parse(TokenType.GreaterThan))\n                                {\n                                    while (Parse(TokenType.LeftSquareBrace))\n                                    {\n                                        Parse(TokenType.RightSquareBrace);\n                                    }\n                                    return true;\n\n                                }\n                                else\n                                {\n                                    _pos = old;\n                                    return false;\n                                }\n                            }\n                            else\n                            {\n                                _pos = old;\n                                return false;\n                            }\n                        }\n                    }\n                    else\n                    {\n                        while (Parse(TokenType.LeftSquareBrace))\n                        {\n                            Parse(TokenType.RightSquareBrace);\n                        }\n                        return true;\n                    }\n                }\n                else\n                {\n                    _pos = old;\n                    return false;\n                }\n            }\n        }\n\n        bool ParseName(out string name)\n        {\n            name = \"\";\n            if (NextToken != TokenType.Identifier) return false;\n\n            while (true)\n            {\n                if (Parse(TokenType.Identifier) || Parse(TokenType.Period))\n                {\n                    name += LastTokenValue;\n                }\n                else break;\n            }\n\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.DrawStatement.cs",
    "content": "﻿using Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        void ComputeDrawstatementSuggestions()\n        {\n            TokenType tt;\n            var memberExp = FindMemberExpression(out tt, true);\n\n            if (memberExp == \"\")\n            {\n                var funcCompiler = CreateFunctionCompiler(_methodNode);\n\n                if (!funcCompiler.Function.IsStatic) SuggestKeywords(\"this\");\n\n                SuggestUsingOrApply(\"\", true, true);\n                SuggestLocals(funcCompiler);\n                return;\n            }\n\n            var dte = Parser.ParseExpression(_compiler.Log, _source, memberExp);\n            var methodCompiler = CreateFunctionCompiler(_methodNode);\n\n            if (!dte.IsInvalid)\n            {\n                TrySuggestMembers(methodCompiler, dte, true);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.FunctionBody.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing Uno.Compiler.API.Domain.AST.Statements;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.Core.Syntax.Binding;\nusing Uno.Compiler.Core.Syntax.Compilers;\nusing Uno.Compiler.Frontend.Analysis;\nusing Parser = Uno.Compiler.Frontend.Analysis.Parser;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        public FunctionCompiler CreateFunctionCompiler(Node methodNode)\n        {\n            int startOffset;\n           var functionBody = ParseFunctionBody(methodNode, out startOffset);\n\n            // Find the function we are inside\n            Function func = null;\n            int funcDist = int.MaxValue;\n            if (methodNode != null && _context.TypeOrNamespace is DataType)\n            {\n                foreach (var f in (_context.TypeOrNamespace as DataType).EnumerateFunctions()\n\t\t\t\t\t.Where(m => m.Source.FullPath == _source.FullPath))\n                {\n                    int dist = Math.Abs(f.Source.Offset - methodNode.StartOffset);\n                    if (dist < funcDist)\n                    {\n                        func = f;\n                        funcDist = dist;\n                    }\n                }\n            }\n\n            // Construct a function compiler for the context\n            FunctionCompiler funcCompiler;\n            if (func != null)\n            {\n                funcCompiler = new FunctionCompiler(_compiler, func, _compiler.TypeBuilder.Parameterize(func.DeclaringType), functionBody);\n                try\n                {\n                    funcCompiler.Compile();\n                }\n                catch (Exception) { }\n            }\n            else\n            {\n                funcCompiler = new FunctionCompiler(_compiler, _context.TypeOrNamespace);\n            }\n\n            return funcCompiler;\n        }\n\n        public AstScope ParseFunctionBody(Node methodNode, out int startOffset)\n        {\n            string funcCode = \"{\";\n\n            var funcStart = 0;\n            if (methodNode != null)\n            {\n                funcStart = GetScopeStart(methodNode.StartOffset);\n                if (funcStart <= _reader.Offset)\n                {\n                    funcCode = _reader.PeekTextReverse(_reader.Offset - funcStart);\n                }\n            }\n\n            startOffset = funcStart;\n\n            return Parser.ParseStatement(_compiler.Log, _source, funcCode) as AstScope;\n        }\n\n        public PartialExpression ResolveStringInFunctionContext(Node methodNode, string memberExp, Source src, FunctionCompiler fc = null)\n        {\n            var funcCompiler = fc ?? CreateFunctionCompiler(methodNode);\n\n            // Parse the member expression\n            var dte = Parser.ParseExpression(_compiler.Log, src, memberExp, fc != null && fc.MetaProperty != null ? ParseContext.MetaProperty : ParseContext.Default);\n\n            if (!dte.IsInvalid)\n            {\n                // Resolve the member expresion\n                return funcCompiler.ResolveExpression(dte, null);\n            }\n\n            return null;\n        }\n\n        void ComputeFunctionBodySuggestions(bool isFieldInitializer = false)\n        {\n            _exceptionTypesOnly = InCatchBlockHeader();\n\n            TokenType t;\n            string memberExp = FindMemberExpression(out t, false);\n\n            if (IsBeforeScopeStart(_methodNode))\n            {\n                var startOffs = _reader.Offset;\n                bool done = false;\n                bool isInArgumentList = true;\n                while (!done && _reader.Offset > 0)\n                {\n                    switch (_reader.ReadTokenReverse())\n                    {\n                        case TokenType.Colon:\n                            isInArgumentList = false;\n                            done = true;\n                            break;\n\n                        case TokenType.LeftParen:\n                        case TokenType.RightParen:\n                            done = true;\n                            break;\n\n\t\t\t\t\t\tcase TokenType.LeftSquareBrace:\n\t\t                    _reader.Offset++; //Step ahead to allow the attribute suggester to re-read the left square brace\n\t\t                    SuggestAttributesIfInsideAttributeDeclaration();\n\t\t\t                return; //If there's no attribute the expression is invalid anyway\n                    }\n                }\n\n                if (isInArgumentList)\n                {\n                    // In argument list\n                    if (memberExp == \"\" && !_exceptionTypesOnly)\n                        SuggestKeywords(\"out\", \"ref\");\n\n                    _reader.Offset = startOffs;\n                    SuggestExtensionMethod();\n                    SuggestTypes(memberExp, isFieldInitializer, false);\n                }\n            }\n            else\n            {\n                if (memberExp == \"\")\n                {\n                    SuggestKeywords(\"new\", \"true\", \"false\", \"null\", \"ref\", \"out\", \"import\");\n\n                    if (!isFieldInitializer)\n                        SuggestKeywords(\"debug_log\", \"var\", \"for\", \"foreach\", \"case\", \"default\", \"break\", \"if\", \"while\", \"do\", \"switch\", \"try\", \"else\", \"catch\", \"throw\", \"draw\", \"return\", \"assert\");\n                }\n\n                var last = Enumerable.Last(_context.NodePath);\n                var isMetaPropertyDefinitionScope = last != null && last.Type == NodeType.MetaPropertyDefinitionScope;\n\n                var funcCompiler = CreateFunctionCompiler(_methodNode);\n                if (!funcCompiler.Function.IsStatic && memberExp == \"\") SuggestKeywords(\"this\");\n\n                // Parse the member expression\n                var dte = Parser.ParseExpression(_compiler.Log, _source, memberExp, isMetaPropertyDefinitionScope ? ParseContext.MetaProperty : ParseContext.Default);\n\n                if (isMetaPropertyDefinitionScope)\n                {\n                    SuggestBlock();\n                }\n\n                if (!dte.IsInvalid)\n                {\n                    // Resolve the member expression\n                    TrySuggestMembers(funcCompiler, dte, false);\n                }\n                else\n                {\n                    if (memberExp == \"\")\n                    {\n                        foreach (string u in _context.Usings)\n                        {\n                            TrySuggestMembers(funcCompiler, Parser.ParseExpression(_compiler.Log, _source, u, ParseContext.Default), false);\n                        }\n\n                        SuggestTypeMembers(funcCompiler.Function.DeclaringType, AccessorLevel.Private, true, false, true, null);\n\n                        if (!funcCompiler.Function.IsStatic)\n                            SuggestTypeMembers(funcCompiler.Function.DeclaringType, AccessorLevel.Private, false, false, true, null);\n\n                        SuggestTypes(memberExp, true, false);\n                        SuggestLocals(funcCompiler);\n                    }\n                    else\n                    {\n                        SuggestTypes(memberExp, true, false);\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.MemberExpression.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Uno;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        string _memberExpression = null;\n        public string MemberExpression\n        {\n            get { return _memberExpression; }\n        }\n\n        public string FindMemberExpression(out TokenType terminatingToken, bool inTypeBody, bool skipToFirstPeriod = true)\n        {\n            var offset = _reader.Offset;\n            int firstPeriod = skipToFirstPeriod ? -1 : offset;\n\n            Func<string> value = () =>\n            {\n                _reader.ReadToken();\n                if (firstPeriod != -1)\n                {\n                    var s = _reader.ReadText(firstPeriod - _reader.Offset).Trim();\n                    _reader.Offset = offset;\n                    return _memberExpression = s;\n                }\n                else\n                {\n                    _reader.Offset = offset;\n                    return _memberExpression = \"\";\n                }\n            };\n\n            int scopes = 0;\n            int parens = 0;\n            int triangleParens = 0;\n\n            var tokenHistory = new List<TokenType>();\n\n            while (true)\n            {\n                var t = _reader.ReadTokenReverse();\n                tokenHistory.Add(t);\n\n                switch (t)\n                {\n                    case TokenType.Period:\n                        {\n                            if (firstPeriod == -1)\n                            {\n                                firstPeriod = _reader.Offset;\n                                continue;\n                            }\n                        }\n                        break;\n\n                    case TokenType.RightSquareBrace:\n                    case TokenType.RightParen:\n                        {\n                            if (parens == 0)\n                            {\n                                var o2 = _reader.Offset;\n                                _reader.ReadToken();\n                                var t2 = _reader.ReadToken();\n                                _reader.Offset = o2;\n                                if (t2 != TokenType.Period && t2 != TokenType.LeftSquareBrace)\n                                {\n                                    terminatingToken = t;\n                                    return value();\n                                }\n                            }\n                            parens++;\n                        }\n                        continue;\n\n                    case TokenType.LeftSquareBrace:\n                    case TokenType.LeftParen:\n                        {\n                            if (parens == 0) { terminatingToken = t; return value(); }\n                            --parens;\n                            continue;\n                        }\n\n                    case TokenType.RightCurlyBrace:\n                        {\n                            if (inTypeBody || parens == 0) { terminatingToken = t; return value(); }\n                            scopes++; continue;\n                        }\n                    case TokenType.LeftCurlyBrace:\n                        {\n                            if (scopes == 0) { terminatingToken = t; return value(); }\n                            scopes--;\n                        }\n                        break;\n\n                    case TokenType.New:\n                    case TokenType.Import:\n                    case TokenType.Static:\n                    case TokenType.Using:\n                    case TokenType.Comma:\n                    case TokenType.Assign:\n                    case TokenType.Plus:\n                    case TokenType.Minus:\n                    case TokenType.Mul:\n                    case TokenType.Div:\n                    case TokenType.Mod:\n                    case TokenType.AddAssign:\n                    case TokenType.MinusAssign:\n                    case TokenType.MulAssign:\n                    case TokenType.DivAssign:\n                    case TokenType.ModAssign:\n                    case TokenType.NotEqual:\n                    case TokenType.Equal:\n                    case TokenType.LessOrEqual:\n                    case TokenType.GreaterOrEqual:\n                    case TokenType.LogAnd:\n                    case TokenType.LogOr:\n                    case TokenType.ExclamationMark:\n                    case TokenType.BitwiseAnd:\n                    case TokenType.BitwiseOr:\n                    case TokenType.BitwiseXor:\n                    case TokenType.BitwiseAndAssign:\n                    case TokenType.BitwiseOrAssign:\n                    case TokenType.BitwiseXorAssign:\n                        {\n                            if (scopes == 0 && parens == 0) { terminatingToken = t; return value(); }\n                        }\n                        break;\n                    case TokenType.GreaterThan:\n                        {\n                            if(triangleParens > 0 || (tokenHistory.Count > 1 && tokenHistory[tokenHistory.Count-2] == TokenType.Period))\n                            {\n                                ++triangleParens;\n                            }\n                            else\n                            {\n                                if (scopes == 0 && parens == 0) { terminatingToken = t; return value(); }\n                            }\n                        }\n                        break;\n                    case TokenType.LessThan:\n                        {\n                            if (triangleParens > 0) triangleParens--;\n                            else\n                            {\n                                if (scopes == 0 && parens == 0) { terminatingToken = t; return value(); }\n                            }\n                        }\n                        break;\n\n                    case TokenType.Colon:\n                    case TokenType.Semicolon:\n                        {\n                            if (scopes == 0) { terminatingToken = t; return value(); }\n                        }\n                        break;\n\n                    case TokenType.EndOfFile:\n                        terminatingToken = t;\n                        return \"\";\n\n                    case TokenType.This: break;\n\n                    case TokenType.Identifier:\n                        {\n                            var w = _reader.PeekTokenReverse();\n\n                            if (scopes == 0 && parens == 0 &&  w == TokenType.Whitespace)\n                            {\n                                _reader.ReadTokenReverse();\n                                w = _reader.PeekTokenReverse();\n                                if (scopes == 0 && parens == 0 && (w == TokenType.Identifier || TypeAliases.HasAlias(w.ToLiteral())))\n                                {\n                                    terminatingToken = t;\n                                    return value();\n                                }\n                                _reader.ReadToken();\n\n                                var o2 = _reader.Offset;\n                                t = _reader.ReadToken();\n                                var t1 = _reader.PeekToken();\n                                _reader.Offset = o2;\n\n                                if (t1 == TokenType.LeftParen)\n                                {\n                                    _reader.ReadTokenReverse();\n                                    terminatingToken = t;\n                                    return value();\n                                }\n                            }\n                        }\n                        break;\n\n                    default:\n                        {\n                            if (Tokens.IsReserved(t.ToLiteral()))\n                            {\n                                if (scopes == 0 && parens == 0) { terminatingToken = t; return value(); }\n                            }\n                        }\n                        break;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.PeekHelpers.cs",
    "content": "﻿using System.Linq;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        TokenType FindFirstReverse(params TokenType[] tokens)\n        {\n            var start = _reader.Offset;\n\n            while (true)\n            {\n                var t = _reader.ReadTokenReverse();\n                if (tokens.Contains(t))\n                {\n                    _reader.Offset = start;\n                    return t;\n                }\n                if (_reader.Offset == 0)\n                {\n                    _reader.Offset = start;\n                    return 0;\n                }\n            }\n        }\n\n        bool IsBeforeScopeStart(Node n)\n        {\n            if (n == null) return false;\n\n            var offset = _reader.Offset;\n\n            _reader.Offset = n.StartOffset;\n            while (true)\n            {\n                var t = _reader.ReadToken();\n                if (t == TokenType.EndOfFile || t == TokenType.LeftCurlyBrace) break;\n            }\n\n            var res = _reader.Offset > offset;\n            _reader.Offset = offset;\n            return res;\n        }\n\n        int GetScopeStart(int startOffset)\n        {\n            var offset = _reader.Offset;\n\n            _reader.Offset = startOffset;\n            while (true)\n            {\n                var t = _reader.ReadToken();\n                if (t == (TokenType)(-1) || t == TokenType.EndOfFile || t == TokenType.LeftCurlyBrace)\n                {\n                    _reader.ReadTokenReverse();\n                    break;\n                }\n            }\n\n            var res = _reader.Offset;\n            _reader.Offset = offset;\n            return res;\n        }\n\n        bool InNameDeclarationOrOperatorPosition()\n        {\n            int offset = _reader.Offset;\n\n            if (offset < 1) return false;\n\n            char c = _reader.ReadTextReverse(1)[0];\n\n            TokenType t;\n\n            if (char.IsLetterOrDigit(c) || c == '_')\n            {\n                 t = _reader.ReadTokenReverse();\n\n                if (t != TokenType.Whitespace)\n                {\n                    _reader.Offset = offset;\n                    return false;\n                }\n\n            }\n            else if (char.IsWhiteSpace(c))\n            {\n                t = _reader.PeekToken();\n                if (t != TokenType.Whitespace)\n                {\n                    _reader.Offset = offset;\n                    return false;\n                }\n            }\n            else\n            {\n                _reader.Offset = offset;\n                return false;\n            }\n\n            t = _reader.ReadTokenReverse();\n            _reader.Offset = offset;\n\n            if (t == TokenType.Identifier || t == TokenType.GreaterThan || t == TokenType.Void)\n            {\n                return true;\n            }\n\n            // Checks if we are working with a nested generic identifier.\n            if (t == TokenType.Shr)\n            {\n                int lessThanCount = 0;\n                int identifierCount = 0;\n                while(lessThanCount >= identifierCount - 1)\n                {\n                    t = _reader.ReadTokenReverse();\n                    if(t == TokenType.LessThan)\n                    {\n                        ++lessThanCount;\n                    }\n                    else if (t == TokenType.Identifier || t == TokenType.GreaterThan || t == TokenType.Void)\n                    {\n                        ++identifierCount;\n                    }\n                }\n\n                return lessThanCount == 2;\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.QuickWins.New.cs",
    "content": "﻿using Outracks.CodeCompletion;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.Core.Syntax.Binding;\nusing Uno.Compiler.Core.Syntax.Compilers;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        bool TrySuggestVariableDeclarationType()\n        {\n            int start = _reader.Offset;\n\n            bool foundIdentifier = false;\n            string variableName = \"\";\n            int variableNameStart = 0;\n\n            // Check to see if this is a variable declaration\n            _reader.ReadTokenReverse();\n            var currentToken = _reader.ReadTokenReverse();\n            if (currentToken == TokenType.New) currentToken = _reader.ReadTokenReverse();\n            while (currentToken == TokenType.Whitespace) currentToken = _reader.ReadTokenReverse();\n            if (currentToken == TokenType.Assign)\n            {\n                // Looks like it; let's try to get the type\n                currentToken = _reader.ReadTokenReverse();\n                while (currentToken == TokenType.Whitespace) { variableNameStart = _reader.Offset; currentToken = _reader.ReadTokenReverse(); }\n                if (currentToken == TokenType.Identifier)\n                {\n                    variableName = _reader.PeekText(variableNameStart - _reader.Offset);\n                    int endOffset;\n                    do\n                    {\n                        endOffset = _reader.Offset;\n                        currentToken = _reader.ReadTokenReverse();\n                    } while (currentToken == TokenType.Whitespace);\n\n\n                    if (currentToken == TokenType.Identifier || currentToken == TokenType.GreaterThan)\n                    {\n                        // If this isn't a type, then fuck my uncle and call me.. nevermind\n                        bool done = false;\n                        int paramLevel = 0;\n                        while (!done)\n                        {\n                            switch (currentToken)\n                            {\n                                case TokenType.Identifier:\n                                    currentToken = _reader.ReadTokenReverse();\n                                    break;\n\n                                case TokenType.GreaterThan:\n                                    paramLevel++;\n                                    currentToken = _reader.ReadTokenReverse();\n                                    break;\n\n                                case TokenType.Shr:\n                                    paramLevel += 2;\n                                    currentToken = _reader.ReadTokenReverse();\n                                    break;\n\n                                case TokenType.LessThan:\n                                    paramLevel--;\n                                    currentToken = _reader.ReadTokenReverse();\n                                    break;\n\n                                case TokenType.Shl:\n                                    paramLevel -= 2;\n                                    currentToken = _reader.ReadTokenReverse();\n                                    break;\n\n                                case TokenType.Period:\n                                    currentToken = _reader.ReadTokenReverse();\n                                    break;\n\n                                case TokenType.Comma:\n                                case TokenType.Whitespace:\n                                    if (paramLevel <= 0)\n                                    {\n                                        done = true;\n                                    }\n                                    else\n                                    {\n                                        currentToken = _reader.ReadTokenReverse();\n                                    }\n                                    break;\n\n                                default:\n                                    done = true;\n                                    break;\n                            }\n                        }\n                        var type = _reader.ReadText(endOffset - _reader.Offset).Trim();\n                        var functionCompiler = new FunctionCompiler(_context.Compiler, _context.TypeOrNamespace);\n                        var pe = ResolveStringInFunctionContext(_methodNode, type, _source, functionCompiler) as PartialType;\n                        if (pe != null)\n                        {\n                            Suggest(SuggestItemType.Class, pe.Type, type, null, null, null, null, null, null, null, SuggestItemPriority.High);\n                            foundIdentifier = true;\n                        }\n                    }\n                }\n            }\n\n            // Try to find variable declaration for variable.\n            if(!foundIdentifier)\n                foundIdentifier = TrySuggestVariableTypes(variableName);\n\n            _reader.Offset = start;\n            return foundIdentifier;\n        }\n\n        bool TrySuggestVariableTypes(string varName)\n        {\n            if (varName == \"\") return false;\n\n            var functionCompiler = new FunctionCompiler(_context.Compiler, _context.TypeOrNamespace);\n            DataType dt = functionCompiler.Function.DeclaringType;\n            if (dt != null)\n            {\n                foreach (var member in dt.Fields)\n                {\n                    if (!CompatibleAccessor(AccessorLevel.Private, member)) continue;\n                    if (member.Modifiers.HasFlag(Modifiers.Generated)) continue;\n                    if ((_context.TypeOrNamespace is DataType) &&\n                        !IsMemberAccessible(member, (_context.TypeOrNamespace as DataType))) continue;\n\n                    if (member.Name == varName)\n                    {\n                        string type = member.ReturnType.FullName;\n                        var typeExps = type.Split(\".\");\n                        var currentType = \"\";\n\n                        for (var i = typeExps.Length - 1; i >= 0; --i)\n                        {\n                            currentType = currentType == \"\" ? typeExps[i] : typeExps[i] + \".\" + currentType;\n                            var pe =\n                                ResolveStringInFunctionContext(_methodNode, currentType, _source, functionCompiler) as\n                                PartialType;\n                            if (pe != null) break;\n                        }\n\n                        Suggest(SuggestItemType.Class, member.ReturnType, currentType, null, null, null, null, null, null, null, SuggestItemPriority.High);\n                        return true;\n                    }\n                }\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.QuickWins.cs",
    "content": "﻿using System.Linq;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        ConfidenceLevel ComputeQuickWins()\n        {\n            // Completion on strings in import/apply\n            if (SuggestImportApplyFiles()) return ConfidenceLevel.Exact;\n\n            // early-out of strings and comments\n            switch (_reader.PeekToken())\n            {\n                case TokenType.String:\n                case TokenType.SingleLineComment:\n                case TokenType.MultiLineComment:\n                    return ConfidenceLevel.Exact;\n            }\n\n            // Scan backwards to find first significant token\n            int start = _reader.Offset;\n            bool scan = true;\n            bool readmultiple = false;\n            _context.expectsConstructor = false;\n            while (scan)\n            {\n                var t = _reader.ReadTokenReverse();\n\n                switch (t)\n                {\n                    case TokenType.New:\n                         {\n                            if (start - _reader.Offset >= 4 && char.IsWhiteSpace(_reader.PeekText(4)[3]))\n                            {\n                                _reader.Offset = start;\n                                var qualifier = _reader.ReadBackwardsTo(TokenType.New).Trim();\n\n                                if (qualifier != \"\")\n                                {\n                                    //There is a qualifier and a new token, this means we're good to complete to constructors\n                                    _context.expectsConstructor = true;\n                                }\n\n                                if (!TrySuggestVariableDeclarationType())\n                                    return ConfidenceLevel.Failed;\n\n                                if (qualifier.Contains('.'))\n                                {\n                                    qualifier = qualifier.Substring(0, qualifier.LastIndexOf('.'));\n                                    SuggestTypes(qualifier, false, false);\n                                }\n                                else\n                                {\n                                    SuggestTypes(\"\", false, false);\n                                }\n                            }\n                            return ConfidenceLevel.Exact;\n                        }\n\n                    case TokenType.Override:\n                        SuggestOverrides();\n                        return ConfidenceLevel.Faulty;\n\n                    case TokenType.Import:\n                        _reader.Offset = start;\n                        SuggestImports();\n                        return ConfidenceLevel.Exact;\n\n                    case TokenType.For:\n                    case TokenType.Foreach:\n                    case TokenType.Switch:\n                    case TokenType.If:\n                    case TokenType.While:\n                        _reader.Offset = start;\n                        return readmultiple ? ConfidenceLevel.Failed : ConfidenceLevel.Exact;\n\n\n                    case TokenType.StringLiteral:\n                    case TokenType.FloatLiteral:\n                    case TokenType.DoubleLiteral:\n                    case TokenType.HexadecimalLiteral:\n                    case TokenType.DecimalLiteral:\n                        _reader.Offset = start;\n                        if (readmultiple) return ConfidenceLevel.Failed;\n                        else return ConfidenceLevel.Exact;\n\n\n                    case TokenType.Using:\n                        {\n                            _reader.Offset = start;\n                            var qualifier = _reader.ReadBackwardsTo(TokenType.Using);\n                            if (!qualifier.Contains(','))\n                            {\n                                _reader.Offset = start;\n                                if (FindFirstReverse(TokenType.Using, TokenType.Static) != TokenType.Static)\n                                {\n                                    SuggestUsingOrApply(qualifier.Trim(), true, false);\n                                }\n                                else\n                                {\n                                    _reader.Offset = start;\n                                    SuggestUsingOrApply(_reader.ReadBackwardsTo(TokenType.Static).Trim(), true);\n                                    foreach (var u in _context.Usings)\n                                    {\n                                        var ns = _context.Compiler.ILFactory.GetEntity(_context.Root.Source, u, _context.Root);\n                                        if (ns is Namespace) Suggest(\n                                            from dt in (ns as Namespace).Types\n                                            where dt.IsStatic\n                                            select dt);\n                                    }\n                                }\n                                return ConfidenceLevel.Exact;\n                            }\n                            return ConfidenceLevel.Failed;\n                        }\n\n                    case TokenType.Namespace:\n                    case TokenType.Class:\n                    case TokenType.Struct:\n                    case TokenType.Enum:\n                        // Entity name - no suggestions\n                        return ConfidenceLevel.Exact;\n\n                    case TokenType.Colon:\n                        {\n                            if (TokenType.Class == FindFirstReverse(TokenType.Class, TokenType.Semicolon, TokenType.LeftCurlyBrace, TokenType.RightCurlyBrace))\n                            {\n                                // Base type, suggest all types\n                                _reader.Offset = start;\n                                var temp = _reader.ReadBackwardsTo(TokenType.Colon, TokenType.Comma);\n                                var qualifier = temp.Trim();\n\n                                var memberExp = \"\";\n                                if (qualifier.LastIndexOf('.') != -1)\n                                {\n                                    var x = qualifier.LastIndexOf('.');\n                                    memberExp = qualifier.Substring(0, x);\n                                }\n\n                                _reader.ReadTextReverse(temp.Length);\n                                _reader.ReadTextReverse(_reader.ReadBackwardsTo(TokenType.Identifier).Length);\n                                var className = _reader.ReadBackwardsTo(TokenType.Whitespace).Trim();\n                                SuggestTypes(memberExp, true, false, SuggestTypesMode.Everything, true);\n                                _suggestions.RemoveAll(x => x.Text == className);\n                                return ConfidenceLevel.Exact;\n                            }\n                        }\n                        break;\n\n\n\n                    case TokenType.Semicolon:\n                    case TokenType.LeftCurlyBrace:\n                    case TokenType.RightCurlyBrace:\n                    case TokenType.LeftSquareBrace:\n                    case TokenType.LeftParen:\n                    case TokenType.RightParen:\n                        // More complex case, fall through to AST-based analysis\n                        _reader.Offset = start;\n                        scan = false;\n                        return ConfidenceLevel.Failed;\n\n                    case TokenType.Null:\n                        return ConfidenceLevel.Exact;\n                }\n\n                readmultiple = true;\n            }\n\n            return ConfidenceLevel.Failed;\n\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.Suggest.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Outracks.CodeCompletion;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.Graphics;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    enum SuggestionFilter\n    {\n        NoTypes = 0,\n        Classes = 0x1,\n        Structs = 0x2,\n        Enums = 0x4,\n        Delegates = 0x8,\n        Interfaces = 0x10,\n        TypeAliases = 0x20,\n\n        AllTypes = Classes | Structs | Enums | Delegates | Interfaces | TypeAliases,\n\n        UsingStaticMembers = 0x40,\n\n        Blocks = 0x80,\n    }\n\n    public partial class CodeCompleter\n    {\n        List<SuggestItem> _suggestions = new List<SuggestItem>();\n        HashSet<string> _suggestionNames = new HashSet<string>();\n\n        void Suggest(\n            SuggestItemType type,\n            object docObject,\n            string suggestionText,\n            Func<string> pretext = null,\n            Func<string> posttext = null,\n            Func<string> desctext = null,\n            string[] accessModifiers = null,\n            string[] fieldModifiers = null,\n            MethodArgument[] arguments = null,\n            Action<IAutoCompleteCodeEditor> commitAction = null,\n            SuggestItemPriority priority = SuggestItemPriority.Normal,\n\t\t\tbool omitDuplicates = true)\n        {\n\t\t\tif (omitDuplicates && _suggestionNames.Contains(suggestionText))\n\t\t\t\treturn;\n            if (suggestionText.StartsWith(\".\"))\n\t\t\t\treturn;\n            if (type == SuggestItemType.Class && _context.expectsConstructor)\n            {\n                type = SuggestItemType.Constructor;\n                var dt = (DataType)docObject;\n                foreach (var ctor in dt.Constructors)\n                {\n                    desctext = () => \"\";\n                    var args = new List<MethodArgument>();\n                    for (var i = 0; i < ctor.Parameters.Length; i++)\n                    {\n                        var arg = ctor.Parameters[i];\n                        args.Add(new MethodArgument(arg.Name, arg.Type.Name, arg.Modifier == ParameterModifier.Out));\n                    }\n                    arguments = args.ToArray();\n                    //This repetition is pretty ugly.. Oh well\n                    var item = new SuggestItem(\n                            suggestionText,\n                            () => (DocumentationHinter.CreateHtmlHint(docObject, _context.Compiler, _context.Usings) ?? \"\"),\n                            type,\n                            pretext,\n                            posttext,\n                            desctext,\n                            accessModifiers,\n                            fieldModifiers,\n                            arguments,\n                            commitAction,\n                            priority);\n\t\t\t\t\t_suggestions.Add(item);\n                }\n            } else {\n\t\t\t\tif (desctext == null) desctext = () => \"\"+type;\n                _suggestions.Add(\n                        new SuggestItem(\n                            suggestionText,\n                            () => (DocumentationHinter.CreateHtmlHint(docObject, _context.Compiler, _context.Usings) ?? \"\"),\n                            type,\n                            pretext,\n                            posttext,\n                            desctext,\n                            accessModifiers,\n                            fieldModifiers,\n                            arguments,\n                            commitAction,\n                            priority)\n                        );\n\t\t\t}\n\n\t\t\tif(omitDuplicates)\n\t\t\t\t_suggestionNames.Add(suggestionText);\n        }\n\n        void Suggest(IEnumerable<Block> e)\n        {\n            foreach (var b in e)\n            {\n                Suggest(SuggestItemType.Block, b, b.Name);\n            }\n        }\n\n        void Suggest(IEnumerable<Namescope> e, string ignoredClassName = null, SuggestTypesMode mode = SuggestTypesMode.Everything)\n        {\n            foreach (var n in e) Suggest(n, ignoredClassName, mode);\n        }\n\n        void Suggest(Namescope ns, string ignoredClassName = null, SuggestTypesMode mode = SuggestTypesMode.Everything)\n        {\n            if (ns is Namespace)\n                Suggest(SuggestItemType.Namespace, ns, ns.Name);\n            if (ns is ClassType)\n            {\n                if (ignoredClassName == null || ignoredClassName != ns.Name)\n                {\n                    if (_exceptionTypesOnly)\n                    {\n                        var ct = ns as ClassType;\n                        if (!ct.Equals(_context.Compiler.ILFactory.Essentials.Exception) && !ct.IsSubclassOf(_context.Compiler.ILFactory.Essentials.Exception)) return;\n                    }\n\n                    string n = ns.Name;\n\n                    var sit = SuggestItemType.Class;\n\n                    if (mode == SuggestTypesMode.Blocks)\n                    {\n                        if (n.EndsWith(\"BlockFactory\"))\n                        {\n                            n = n.Substring(0, n.Length - \"BlockFactory\".Length);\n                            sit = SuggestItemType.BlockFactory;\n                        }\n                        else return;\n                    }\n                    else if (mode == SuggestTypesMode.Importers)\n                    {\n                        if (n.EndsWith(\"Importer\"))\n                        {\n                            n = n.Substring(0, n.Length - \"Importer\".Length);\n                            sit = SuggestItemType.Importer;\n                        }\n                        else return;\n                    }\n                    else if (mode == SuggestTypesMode.Attributes)\n                    {\n                        if (n.EndsWith(\"Attribute\"))\n                        {\n                            n = n.Substring(0, n.Length - \"Attribute\".Length);\n                            sit = SuggestItemType.Class;\n                        }\n                        else return;\n                    }\n\n                    Suggest(sit, ns, n);\n                }\n            }\n\n\n            if (mode == SuggestTypesMode.Everything)\n            {\n                if (!_exceptionTypesOnly && ns is InterfaceType)\n                    Suggest(SuggestItemType.Interface, ns, ns.Name);\n\n                if (!_exceptionTypesOnly && ns is StructType)\n                    Suggest(SuggestItemType.Struct, ns, ns.Name);\n\n                if (!_exceptionTypesOnly && ns is DelegateType)\n                    Suggest(SuggestItemType.Delegate, ns, ns.Name);\n\n                if (!_exceptionTypesOnly && ns is EnumType)\n                    Suggest(SuggestItemType.Enum, ns, ns.Name);\n\n                if (ns is GenericParameterType)\n                {\n                    Suggest(SuggestItemType.GenericParameterType, ns, ns.Name);\n                }\n            }\n        }\n\n        void SuggestKeywords(params string[] keywords)\n        {\n            foreach (var k in keywords)\n            {\n                Suggest(SuggestItemType.Keyword, k, k);\n            }\n        }\n\n        bool SuggestAttributesIfInsideAttributeDeclaration()\n        {\n            // Check if we are inside an attribute declaration\n            var offs = _reader.Offset;\n            while (true)\n            {\n                var t = _reader.ReadTokenReverse();\n\n                switch (t)\n                {\n                    case TokenType.Identifier:\n                    case TokenType.Whitespace:\n                    case TokenType.Period:\n                        continue;\n\n                    case TokenType.LeftSquareBrace:\n                        {\n                            _reader.Offset = offs;\n                            var memberExp = FindMemberExpression(out t, false);\n\n                            SuggestTypes(memberExp, false, false, SuggestTypesMode.Attributes);\n                            return true;\n                        }\n                }\n                break;\n            }\n\n            _reader.Offset = offs;\n            return false;\n        }\n\n        void SuggestExtensionMethod()\n        {\n            var offs = _reader.Offset;\n            var foundThis = false;\n\n            while (true)\n            {\n                var t = _reader.ReadTokenReverse();\n                switch (t)\n                {\n                    case TokenType.Whitespace:\n                        continue;\n                    case TokenType.This:\n                        foundThis = true;\n                        break;\n                }\n                break;\n            }\n\n            _reader.Offset = offs;\n            if(!foundThis)\n                SuggestKeywords(\"this\");\n        }\n\n        void SuggestRootItems()\n        {\n            if (SuggestAttributesIfInsideAttributeDeclaration()) return;\n\n            SuggestKeywords(\"using\", \"static\", \"namespace\", \"class\", \"struct\", \"block\", \"enum\", \"delegate\", \"public\", \"partial\", \"intrinsic\", \"drawable\", \"private\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestBlock.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.Graphics;\nusing Uno.Compiler.API.Domain.IL.Expressions;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Core.Syntax.Compilers;\nusing Uno.Compiler.Frontend.Analysis;\nusing Uno.Logging;\nusing Node = Outracks.UnoDevelop.CodeNinja.AmbientParser.Node;\nusing Parser = Uno.Compiler.Frontend.Analysis.Parser;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        void SuggestBlock()\n        {\n            TokenType tt;\n            var memberExp = FindMemberExpression(out tt, true);\n\n            // Build block\n            var methodCompiler = CreateFunctionCompiler(_methodNode);\n            _compiler.BlockBuilder.Build();\n\n            var dte = Parser.ParseExpression(_compiler.Log, _source, memberExp, _context.MetaPropertyNode != null ? ParseContext.MetaProperty : ParseContext.Default);\n\n            if (dte.IsInvalid)\n\t        {\n\t\t\t\tSuggestForBlock(methodCompiler, memberExp);\n\t        }\n\n            if (_context.MetaPropertyNode != null)\n            {\n                SuggestForMetaproperty(methodCompiler, memberExp);\n            }\n        }\n\n        void SuggestForBlock(FunctionCompiler methodCompiler, string memberExp)\n        {\n            if (memberExp == \"\")\n            {\n                var last = Enumerable.Last(_context.NodePath);\n\n                SuggestKeywordsIfCan(last);\n                SuggestKeywords(TypeAliases.AllAliases.ToArray());\n\n                var lastInlineBlock = _context.InlineBlock;\n                var lastBlock = _context.Block;\n                if (lastBlock != null && lastBlock.BlockBase is Block)\n                {\n                    var b = (Block)lastBlock.BlockBase;\n                    SuggestBlockItems(b);\n                }\n                else if (lastInlineBlock != null && lastInlineBlock.Children != null)\n                {\n                    SuggestForInlineBlock(methodCompiler, lastInlineBlock);\n                }\n            }\n\n            SuggestTerminals();\n            SuggestKeywords(\"vertex_attrib\", \"sample\", \"import\", \"req\", \"tag\");\n\n            SuggestTypes(memberExp, true, true);\n        }\n\n        void SuggestForInlineBlock(FunctionCompiler methodCompiler, Node lastInlineBlock)\n        {\n            foreach (var c in lastInlineBlock.Children)\n            {\n                switch (c.Type)\n                {\n                    case NodeType.Apply:\n                        SuggestForApplyBlockItems(c);\n                        break;\n                    case NodeType.MetaProperty:\n                        SuggestMetaproperty(methodCompiler, c);\n                        break;\n                }\n            }\n        }\n\n        void SuggestMetaproperty(FunctionCompiler methodCompiler, Node c)\n        {\n            var mp = c.MetaProperty ?? ResolveMetaproperty(methodCompiler, c);\n            if (mp == null) return;\n\n            var m = new GetMetaProperty(_source,\n                                            mp.ReturnType,\n                                            c.Name);\n            Suggest(SuggestItemType.MetaProperty, m, m.Name);\n        }\n\n        void SuggestForApplyBlockItems(Node c)\n        {\n            var log = new Log(new StringWriter());\n            var dte = Parser.ParseExpression(log,\n                                             _source,\n                                             c.Name,\n                                             ParseContext.MetaProperty);\n            if (log.ErrorCount != 0) return;\n            var b = _context.Compiler.NameResolver.GetBlock(\n                                                   _context.TypeOrNamespace as\n                                                   ClassType,\n                                                   dte);\n            if (b != null) SuggestBlockItems(b);\n        }\n\n        void SuggestForMetaproperty(FunctionCompiler methodCompiler, string memberExp)\n        {\n            var mpn = _context.MetaPropertyNode;\n\n            var mp = mpn.MetaProperty;\n            if (mp == null)\n            {\n                mp = ResolveMetaproperty(methodCompiler, mpn) ?? new MetaProperty(Source.Unknown,\n                                                                                _context.BlockBase,\n                                                                                _context.Compiler.ILFactory.Essentials.Object,\n                                                                                mpn.Name,\n                                                                                0);\n            }\n\n            var fc = new FunctionCompiler(_compiler, mp);\n\n            // Parse the member expression\n            var dte = Parser.ParseExpression(_compiler.Log, _source, memberExp, ParseContext.MetaProperty);\n\n            if (memberExp == \"\")\n            {\n                if (!methodCompiler.Function.IsStatic) SuggestKeywords(\"this\");\n                SuggestKeywords(\"debug_log\",\n                                \"var\",\n                                \"for\",\n                                \"pixel\",\n                                \"prev\",\n                                \"foreach\",\n                                \"case\",\n                                \"default\",\n                                \"break\",\n                                \"if\",\n                                \"while\",\n                                \"do\",\n                                \"switch\",\n                                \"try\",\n                                \"else\",\n                                \"catch\",\n                                \"throw\",\n                                \"draw\",\n                                \"return\",\n                                \"assert\");\n\n                // Suggest static members\n                foreach (string u in _context.Usings)\n                {\n                    TrySuggestMembers(methodCompiler,\n                                      Parser.ParseExpression(_compiler.Log, _source, u, ParseContext.MetaProperty),\n                                      false);\n                }\n            }\n\n            if (!dte.IsInvalid)\n            {\n                TrySuggestMembers(fc, dte, true);\n                TrySuggestMembers(methodCompiler, dte, true);\n            }\n            else\n                SuggestLocals(methodCompiler);\n        }\n\n\n        void SuggestKeywordsIfCan(Node last)\n        {\n            var metapropertyDef = last.Type == NodeType.MetaPropertyDefinitionScope ||\n                last.Type == NodeType.MetaPropertyDefinition;\n\n            var childrenIsNotMetapropertyDef = last.Children == null ||\n                 last.Children.LastOrDefault(x => x.Type == NodeType.MetaPropertyDefinition) == null;\n\n            if (!metapropertyDef &&\n                childrenIsNotMetapropertyDef)\n            {\n                SuggestKeywords(\"drawable\", \"pixel\", \"vertex\", \"volatile\", \"init\", \"apply\");\n            }\n\n            if (last.Type == NodeType.MetaProperty)\n            {\n                SuggestKeywords(\"is\", \"as\");\n            }\n        }\n\n        static MetaProperty ResolveMetaproperty(FunctionCompiler methodCompiler, Node metaPropertyNode)\n        {\n            MetaProperty mp;\n            var function = methodCompiler.Function as Method;\n            if (function == null) return null;\n            foreach (var block in function.DrawBlocks)\n            {\n                mp = ResolveForEachMetaProperty(block.Members, metaPropertyNode);\n                if (mp != null) return mp;\n\n                foreach (var item in block.Members)\n                {\n                    var apply = item as Apply;\n                    if (apply != null && apply.Block != null)\n                    {\n                        mp = ResolveForEachMetaProperty(apply.Block.Members, metaPropertyNode);\n                        if (mp != null) return mp;\n                    }\n                }\n            }\n\n            return null;\n        }\n\n        static MetaProperty ResolveForEachMetaProperty(IEnumerable<BlockMember> blockItems, Node metaPropertyNode)\n        {\n            return blockItems.OfType<MetaProperty>()\n                .FirstOrDefault(\n                    metaproperty => metaPropertyNode.StartOffset >= metaproperty.Source.Offset\n                    && metaproperty.Name == metaPropertyNode.Name\n                );\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestFiles.cs",
    "content": "﻿using System.IO;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Outracks.IO;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        bool SuggestImportApplyFiles()\n        {\n            if (_reader.PeekToken() == TokenType.StringLiteral)\n            {\n                int offset = _reader.Offset;\n\n                if (_reader.ReadTokenReverse() == TokenType.LeftParen)\n                {\n                    _reader.Offset += 2;\n                    string prefix = _reader.PeekText(offset - _reader.Offset);\n                    _reader.Offset -= 2;\n\n                    string[] filters = new[] { \"*.*\" };\n\n                    while (true)\n                    {\n                        int lastOFfset = _reader.Offset;\n                        var t = _reader.ReadTokenReverse();\n                        if (t == TokenType.Identifier)\n                        {\n                            var id = _reader.PeekText(lastOFfset - _reader.Offset);\n                            if (id == \"Texture2D\") filters = new[] { \"*.png\", \"*.jpg\", \"*.tga\" };\n                            if (id == \"TextureCube\") filters = new[] { \"*.png\", \"*.jpg\", \"*.tga\" };\n                            if (id == \"Model\") filters = new[] { \"*.dae\", \"*.fbx\" };\n                            continue;\n                        }\n                        else if (t == TokenType.Period) continue;\n                        else if (t == TokenType.Whitespace) continue;\n                        else if (t == TokenType.Import)\n                        {\n                            var srcpath = Path.GetDirectoryName(_source.FullPath).ToUnixPath();\n                            var path = srcpath;\n\n                            prefix = prefix.ToUnixPath();\n                            if (prefix.Contains('/'))\n                            {\n                                prefix = prefix.Substring(0, prefix.LastIndexOf('/'));\n                                path += \"/\" + prefix;\n                            }\n\n                            if (!(File.Exists(path) || Directory.Exists(path)))\n                                return true;\n\n                            foreach (var filter in filters)\n                            {\n                                foreach (var f in Directory.GetFiles(path, filter).Select(AbsoluteFilePath.Parse))\n                                {\n\t                                var ff = f.RelativeTo(AbsoluteDirectoryPath.Parse(path)).NativeRelativePath.ToUnixPath();\n                                    Suggest(SuggestItemType.File, new FileEntity(ff), ff);\n                                }\n                            }\n\n                            foreach (var f in Directory.GetDirectories(path).Select(AbsoluteFilePath.Parse))\n                            {\n\t\t\t\t\t\t\t\tvar ff = f.RelativeTo(AbsoluteDirectoryPath.Parse(path)).NativeRelativePath.ToUnixPath();\n                                Suggest(SuggestItemType.Directory, new FileEntity(ff), ff);\n                            }\n\n                            return true;\n                        }\n                        else break;\n                    }\n                }\n\n                _reader.Offset = offset;\n            }\n\n            return false;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestImportAndApply.cs",
    "content": "﻿using Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        void SuggestImports()\n        {\n            TokenType t;\n            SuggestTypes(FindMemberExpression(out t, _context.InTypeBody), false, false, SuggestTypesMode.Importers);\n        }\n\n        void SuggestBlockFactories()\n        {\n            TokenType t;\n            SuggestTypes(FindMemberExpression(out t, _context.InTypeBody), false, false, SuggestTypesMode.Blocks);\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestMembers.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Outracks.CodeCompletion;\nusing Uno;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.AST.Expressions;\nusing Uno.Compiler.API.Domain.Graphics;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Core.Syntax.Binding;\nusing Uno.Compiler.Core.Syntax.Compilers;\nusing Expression = Uno.Compiler.API.Domain.AST.Expressions.AstExpression;\nusing ExpressionType = Uno.Compiler.API.Domain.AST.Expressions.AstExpressionType;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        List<Method> FindAllExtensionTypeMethods(FunctionCompiler fc, Source source)\n        {\n            var usings = fc.Compiler.NameResolver.TryGetUsings(fc.Namescope, source);\n\n            var staticClasses = new HashSet<DataType>();\n            for (var scope = fc.Namescope; scope != null; scope = scope.Parent)\n            {\n                var ns = scope as Namespace;\n\n                if (ns != null)\n                    foreach (var dt in ns.Types)\n                        if (dt.IsStatic && !dt.IsGenericDefinition)\n                            staticClasses.Add(dt);\n            }\n\n            if (usings != null)\n            {\n                foreach (var ns in usings.Namespaces)\n                    foreach (var dt in ns.Types)\n                        if (dt.IsStatic && !dt.IsGenericDefinition)\n                            staticClasses.Add(dt);\n\n                foreach (var dt in usings.Types)\n                    if (dt.IsStatic && !dt.IsGenericDefinition)\n                        staticClasses.Add(dt);\n            }\n\n            if (staticClasses.Count == 0)\n                return null;\n\n            var extensionMethods = new List<Method>();\n\n            foreach (var dt in staticClasses)\n                foreach (var m in dt.Methods)\n                    if (m.IsStatic &&\n                        m.Parameters.Length > 0 && m.Parameters[0].Modifier == ParameterModifier.This)\n                        extensionMethods.Add(m);\n\n            if (extensionMethods.Count == 0)\n                return null;\n\n            return extensionMethods;\n        }\n\n        bool TrySuggestMembers(FunctionCompiler fc, Expression dte, bool includeBlocks)\n        {\n            var pe = fc.ResolveExpression(dte, null);\n            fc.Compiler.AstProcessor.Process();\n\n            if (pe != null)\n            {\n                var extensionTypeMethods = FindAllExtensionTypeMethods(fc, dte.Source);\n                switch (pe.ExpressionType)\n                {\n                    case PartialExpressionType.Namespace: SuggestNamespaceMembers((pe as PartialNamespace).Namespace, includeBlocks); break;\n                    case PartialExpressionType.Type: SuggestTypeMembers((pe as PartialType).Type, AccessorLevel.Unknown, true, includeBlocks, true, extensionTypeMethods); break;\n                    case PartialExpressionType.Block: SuggestBlockItems((pe as PartialBlock).Block); break;\n                    case PartialExpressionType.Variable: SuggestTypeMembers((pe as PartialVariable).Variable.ValueType, AccessorLevel.Unknown, false, false, true, extensionTypeMethods); break;\n\t\t\t\t\tcase PartialExpressionType.Parameter: SuggestTypeMembers((pe as PartialParameter).Function.Match(f => f.Parameters, l => l.Parameters)[(pe as PartialParameter).Index].Type, AccessorLevel.Unknown, false, false, true, extensionTypeMethods); break;\n                    case PartialExpressionType.Field: SuggestTypeMembers((pe as PartialField).Field.ReturnType, AccessorLevel.Unknown, false, false, true, extensionTypeMethods); break;\n                    case PartialExpressionType.Event: break;\n                    case PartialExpressionType.Property: SuggestTypeMembers((pe as PartialProperty).Property.ReturnType, AccessorLevel.Unknown, false, false, true, extensionTypeMethods); break;\n                    case PartialExpressionType.Indexer: SuggestTypeMembers((pe as PartialIndexer).Indexer.ReturnType, AccessorLevel.Unknown, false, false, true, extensionTypeMethods); break;\n                    case PartialExpressionType.ArrayElement: SuggestTypeMembers((pe as PartialArrayElement).ElementType, AccessorLevel.Unknown, false, false, true, extensionTypeMethods); break;\n                    case PartialExpressionType.MethodGroup: break;\n\n                    case PartialExpressionType.This:\n                        {\n                            if (fc.Function != null && fc.Function.DeclaringType != null)\n                                SuggestTypeMembers(fc.Function.DeclaringType, AccessorLevel.Private, fc.Function.IsStatic, false, true, extensionTypeMethods);\n                        }\n                        break;\n\n                    case PartialExpressionType.Value:\n                        {\n                            SuggestTypeMembers((pe as PartialValue).Value.ReturnType, AccessorLevel.Unknown, false, false, true, extensionTypeMethods);\n\n                            if (dte.ExpressionType == ExpressionType.Identifier)\n                            {\n                                var lastNamescope = Enumerable.Last(_context.NodePath).TypeOrNamespace;\n                                if (lastNamescope != null)\n                                {\n                                    var identifier = dte as AstIdentifier;\n                                    var pt = _context.Compiler.NameResolver.TryResolveMemberRecursive(lastNamescope, identifier, null);\n                                    if (pt == null) pt = _context.Compiler.NameResolver.TryResolveUsingNamespace(lastNamescope, identifier, null);\n                                    if (pt is PartialType) SuggestTypeMembers((pt as PartialType).Type, AccessorLevel.Public, true, true, true, extensionTypeMethods);\n                                }\n                            }\n                        }\n                        break;\n\n                    default: return false;\n                }\n                return true;\n            }\n\n            return false;\n        }\n\n        HashSet<object> _added = new HashSet<object>();\n\n        void SuggestNamespaceMembers(Namespace n, bool includeBlocks)\n        {\n            HashSet<string> addedTypes = new HashSet<string>();\n\n            if (includeBlocks)\n            {\n                foreach (var b in n.Blocks)\n                    Suggest(SuggestItemType.Block, b, b.Name);\n            }\n\n            foreach (var t in n.Types)\n            {\n                if (addedTypes.Contains(t.Name)) continue;\n                addedTypes.Add(t.Name);\n\n                if (t is RefArrayType) continue;\n                if (t is DelegateType)\n                {\n                    Suggest(SuggestItemType.Delegate, t, t.Name);\n                }\n                else if (t is ClassType)\n                {\n                    Suggest(SuggestItemType.Class, t, t.Name);\n                }\n                else if (t is StructType)\n                {\n                    Suggest(SuggestItemType.Struct, t, t.Name);\n                }\n                else if (t is InterfaceType)\n                {\n                    Suggest(SuggestItemType.Interface, t, t.Name);\n                }\n                else if (t is EnumType)\n                {\n                    Suggest(SuggestItemType.Enum, t, t.Name);\n                }\n            }\n\n            foreach (var nk in n.Namespaces)\n                Suggest(SuggestItemType.Namespace, nk, nk.Name);\n        }\n\n\n        enum AccessorLevel\n        {\n            Unknown,\n            Private,\n            Protected,\n            Public\n        }\n\n        bool CompatibleAccessor(AccessorLevel level, Member m)\n        {\n            return CompatibleAccessor(level, m.Modifiers);\n        }\n\n        bool CompatibleAccessor(AccessorLevel level, Modifiers m)\n        {\n            switch (level)\n            {\n                case AccessorLevel.Public: return m.HasFlag(Modifiers.Public);\n                case AccessorLevel.Protected: return m.HasFlag(Modifiers.Public) | m.HasFlag(Modifiers.Protected);\n            }\n\n            return true;\n        }\n\n        void SuggestTypeMembers(DataType dt, AccessorLevel accessorLevel, bool staticContext, bool metaContext, bool recurseToBase, List<Method> extensionTypeMethods)\n        {\n            // Suggest base type members\n            if (recurseToBase && dt.Base != null)\n                SuggestTypeMembers(dt.Base, accessorLevel == AccessorLevel.Public ? AccessorLevel.Public : AccessorLevel.Protected, staticContext, metaContext, recurseToBase, extensionTypeMethods);\n\n            SuggestInterfaceType(dt, staticContext, metaContext, recurseToBase, extensionTypeMethods);\n\n            SuggestEnumsInStaticContext(dt, staticContext);\n\n            var ct = dt as ClassType;\n            dt.PopulateMembers();\n\n            if (metaContext && ct != null && ct.Block != null)\n                SuggestBlockItems(ct.Block);\n\n            SuggestSwizzlerType(dt);\n\n            SuggestField(dt, accessorLevel, staticContext);\n\n            SuggestEvents(dt, accessorLevel, staticContext);\n\n            SuggestMethods(dt, accessorLevel, staticContext);\n\n            SuggestProperties(dt, accessorLevel, staticContext);\n\n            SuggestLiterals(dt, accessorLevel);\n\n            SuggestExtensionTypeMethods(extensionTypeMethods, ct);\n\n            SuggestStaticContext(dt, staticContext);\n\n\t        SuggestHasFlagForEnums(dt);\n        }\n\n\t    void SuggestInterfaceType(\n\t\t\tDataType dt,\n\t\t\tbool staticContext,\n\t\t\tbool metaContext,\n\t\t\tbool recurseToBase,\n\t\t\tList<Method> extensionTypeMethods)\n        {\n            if (recurseToBase && dt is InterfaceType)\n            {\n                var it = dt as InterfaceType;\n                foreach (var bit in it.Interfaces)\n                    SuggestTypeMembers(\n\t\t\t\t\t\tbit,\n\t\t\t\t\t\tAccessorLevel.Public,\n\t\t\t\t\t\tstaticContext,\n\t\t\t\t\t\tmetaContext,\n\t\t\t\t\t\trecurseToBase,\n\t\t\t\t\t\textensionTypeMethods);\n            }\n        }\n\n        void SuggestEnumsInStaticContext(DataType dt, bool staticContext)\n        {\n            if (dt is EnumType && staticContext)\n            {\n                var et = dt as EnumType;\n                foreach (var v in et.Literals) Suggest(SuggestItemType.EnumValue, v, v.Name);\n            }\n        }\n\n        void SuggestStaticContext(DataType dt, bool staticContext)\n        {\n            if (!staticContext) return;\n\n            foreach (var innertype in dt.NestedTypes)\n            {\n                if (innertype.Modifiers.HasFlag(Modifiers.Generated)) continue;\n                if ((_context.TypeOrNamespace is DataType) &&\n                    !IsMemberAccessible(innertype.Modifiers, dt, (_context.TypeOrNamespace as DataType))) continue;\n                var it = SuggestItemType.Class;\n                if (innertype is EnumType) it = SuggestItemType.Enum;\n                if (innertype is DelegateType) it = SuggestItemType.Delegate;\n                if (innertype is ClassType)\n                {\n                    switch (innertype.TypeType)\n                    {\n                        case TypeType.Class:\n                            it = SuggestItemType.Class;\n                            break;\n                        case TypeType.Struct:\n                            it = SuggestItemType.Struct;\n                            break;\n                        case TypeType.Interface:\n                            it = SuggestItemType.Interface;\n                            break;\n                    }\n                }\n                Suggest(it, innertype, innertype.Name);\n            }\n        }\n\n        void SuggestExtensionTypeMethods(IEnumerable<Method> extensionTypeMethods, ClassType ct)\n        {\n            if (extensionTypeMethods == null) return;\n            foreach (var extTypeMethod in extensionTypeMethods.Where(\n\t\t\t\textTypeMethod =>\n\t\t\t\t\textTypeMethod.Parameters.Length > 0 &&\n\t\t\t\t\textTypeMethod.Parameters[0].Type == ct))\n            {\n                Suggest(SuggestItemType.Method, extTypeMethod, extTypeMethod.Name);\n            }\n        }\n\n        void SuggestLiterals(DataType dt, AccessorLevel accessorLevel)\n        {\n            foreach (var c in dt.Literals)\n            {\n                if (!CompatibleAccessor(accessorLevel, c.Modifiers)) continue;\n                if ((_context.TypeOrNamespace is DataType) &&\n                    !IsMemberAccessible(c, (_context.TypeOrNamespace as DataType))) continue;\n                if (_added.Contains(c.Name)) continue;\n                _added.Add(c.Name);\n                Suggest(SuggestItemType.Constant, c, c.Name);\n            }\n        }\n\n        void SuggestProperties(DataType dt, AccessorLevel accessorLevel, bool staticContext)\n        {\n            foreach (var member in dt.Properties)\n            {\n                if (!CompatibleAccessor(accessorLevel, member)) continue;\n                if (member.IsStatic != staticContext) continue;\n                if (!(dt is ArrayType) && member.Modifiers.HasFlag(Modifiers.Generated)) continue;\n                if ((_context.TypeOrNamespace is DataType) &&\n                    !IsMemberAccessible(member, (_context.TypeOrNamespace as DataType))) continue;\n                if (_added.Contains(member)) continue;\n                _added.Add(member.OverriddenProperty);\n\n                var mods = new List<string>();\n                if (member.SetMethod == null) mods.Add(\"readonly\"); //Hackish but want to display readonly for properties too\n\n                Suggest(SuggestItemType.Property, member, member.Name, null, null, () => member.ReturnType.ToString(), mods.ToArray(), null, null, null, SuggestItemPriority.Normal);\n            }\n        }\n\n\t\tstring HashMethod(string name, MethodArgument[] args){\n\t\t\tvar build = new StringBuilder ();\n\t\t\tbuild.Append (name);\n\t\t\targs.Each (arg => {\n\t\t\t\tbuild.Append (arg.IsOut.ToString());\n\t\t\t\tbuild.Append (arg.Name);\n\t\t\t\tbuild.Append (arg.ArgType);\n\t\t\t});\n\t\t\treturn build.ToString ();\n\t\t}\n\n\t\tMethodArgument[] GetMethodArgsFromMethod(Method m)\n\t\t{\n\t\t\treturn m.Parameters.Select (arg =>\n\t\t\t\tnew MethodArgument (arg.Name, arg.Type.ToString (), arg.Modifier == ParameterModifier.Out)\n\t\t\t).ToArray();\n\t\t}\n\n        void SuggestMethods(DataType dt, AccessorLevel accessorLevel, bool staticContext)\n        {\n            foreach (var member in dt.Methods)\n            {\n                if (!CompatibleAccessor(accessorLevel, member)) continue;\n                if (member.IsStatic != staticContext) continue;\n                if (member.Modifiers.HasFlag(Modifiers.Generated)) continue;\n                if ((_context.TypeOrNamespace is DataType) &&\n\t\t\t\t\t!IsMemberAccessible(member, (_context.TypeOrNamespace as DataType))) continue;\n\t\t\t\tvar args = GetMethodArgsFromMethod (member);\n\t\t\t\tvar hash = HashMethod (member.Name, args);\n                if (_added.Contains(hash)) continue;\n\t\t\t\tif (member.OverriddenMethod != null) {\n\t\t\t\t\tvar om = member.OverriddenMethod;\n\t\t\t\t\t_added.Add (HashMethod (om.Name, GetMethodArgsFromMethod (om)));\n\t\t\t\t}\n\n                var priority = SuggestItemPriority.Normal;\n\n                var accessMods = new List<string>();\n                foreach (string mod in member.Modifiers.ToString().ToLower().Split(\", \"))\n                {\n                    accessMods.Add(mod);\n                }\n\n                Suggest(SuggestItemType.Method, member, member.Name, null, null, () => member.ReturnType.ToString(), accessMods.ToArray(), null, args, null, priority, false);\n\t\t\t\t_added.Add (hash);\n            }\n        }\n\n        void SuggestEvents(DataType dt, AccessorLevel accessorLevel, bool staticContext)\n        {\n            foreach (var member in dt.Events)\n            {\n                if (!CompatibleAccessor(accessorLevel, member)) continue;\n                if (member.IsStatic != staticContext) continue;\n                if (member.Modifiers.HasFlag(Modifiers.Generated)) continue;\n                if ((_context.TypeOrNamespace is DataType) &&\n                    !IsMemberAccessible(member, (_context.TypeOrNamespace as DataType))) continue;\n                var it = SuggestItemType.Field;\n                it = SuggestItemType.Event;\n                Suggest(it, member, member.Name);\n            }\n        }\n\n        void SuggestField(DataType dt, AccessorLevel accessorLevel, bool staticContext)\n        {\n            foreach (var member in dt.Fields)\n            {\n                if (!CompatibleAccessor(accessorLevel, member)) continue;\n                if (member.IsStatic != staticContext) continue;\n                if (member.Modifiers.HasFlag(Modifiers.Generated)) continue;\n                if ((_context.TypeOrNamespace is DataType) &&\n                    !IsMemberAccessible(member, (_context.TypeOrNamespace as DataType))) continue;\n                var it = SuggestItemType.Field;\n                var accessMods = new List<string>();\n                var fieldMods = new List<string>();\n                foreach (var s in member.Modifiers.ToString().ToLower().Split(\", \")) accessMods.Add(s);\n                if (member.FieldModifiers.HasFlag(FieldModifiers.ReadOnly)) fieldMods.Add(\"readonly\");\n                if (member.FieldModifiers.HasFlag(FieldModifiers.Const)) fieldMods.Add(\"const\");\n                var priority = SuggestItemPriority.Normal;\n                Suggest(it, member, member.Name, null, null, () => member.ReturnType.ToString(), accessMods.ToArray(), null, null, null, priority);\n            }\n        }\n\n        void SuggestSwizzlerType(DataType dt)\n        {\n            if (dt.Fields.Count <= 4 && (\n\t\t\t\tIsOfSwizzlerType(\"Float\", dt.QualifiedName) ||\n                IsOfSwizzlerType(\"Int\", dt.QualifiedName) ||\n\t\t\t\tIsOfSwizzlerType(\"UInt\", dt.QualifiedName) ||\n                IsOfSwizzlerType(\"Short\", dt.QualifiedName) ||\n                IsOfSwizzlerType(\"UShort\", dt.QualifiedName) ||\n                IsOfSwizzlerType(\"Byte\", dt.QualifiedName) ||\n                IsOfSwizzlerType(\"SByte\", dt.QualifiedName)))\n            {\n                var nameTemplate = dt.Name.Substring(0, dt.Name.Length - 1);\n                for (var i = 2; i <= dt.Fields.Count; ++i)\n                {\n                    var dummyDt = new StructType(dt.Source, dt.Parent, null, dt.Modifiers, nameTemplate + i);\n                    SuggestSwizzlerTypes(dt, dummyDt, \"\", 0, i, SuggestItemPriority.Normal);\n                }\n            }\n        }\n\n        void SuggestTerminals()\n        {\n            SuggestBlockItems(_compiler.BlockBuilder.TerminalProperties, \"(terminal property)\");\n        }\n\n        void SuggestBlockItems(Block b, string fixedSourceString = null)\n        {\n            foreach (var k in b.NestedBlocks)\n            {\n                Suggest(SuggestItemType.Block, k, k.Name);\n            }\n\n            for (int i = b.Members.Count-1; i >= 0; i--)\n            {\n                var bi = b.Members[i];\n                switch (bi.Type)\n                {\n                    case BlockMemberType.Node: break;\n                    case BlockMemberType.Apply: SuggestBlockItems((bi as Apply).Block, fixedSourceString); break;\n                    case BlockMemberType.MetaProperty:\n                        {\n                            var mp = (bi as MetaProperty);\n                            if (_added.Contains(mp.Name)) continue;\n\n                            foreach (var s in _added)\n                            {\n                                if (s is Property && (s as Property).Name == mp.Name) { _added.Add(mp.Name); }\n                                if (s is Field && (s as Field).Name == mp.Name) { _added.Add(mp.Name); }\n                                if (s is Literal && (s as Literal).Name == mp.Name) { _added.Add(mp.Name); }\n                            }\n                            if (_added.Contains(mp)) continue;\n                            _added.Add(mp.Name);\n\n                            Suggest(SuggestItemType.MetaProperty, mp, mp.Name);\n                        }\n                        break;\n                }\n            }\n        }\n\n        bool IsOfSwizzlerType(string type, string qualifiedName)\n        {\n            string template = \"Uno.\" + type;\n            if(qualifiedName.Substring(0, qualifiedName.Length - 1) != template)\n                return false;\n\n            for(int i = 2;i <= 4;++i)\n            {\n                if(qualifiedName == template + i.ToString())\n                {\n                    return true;\n                }\n            }\n\n            return false;\n        }\n\n        void SuggestSwizzlerTypes(DataType dt, DataType dummyDt, string value, int depth, int maxDepth, SuggestItemPriority priority)\n        {\n            if(depth == maxDepth)\n            {\n                Suggest(SuggestItemType.Field, dummyDt, value, null,null, () => dt.ToString(), null, null, null, null, priority);\n                return;\n            }\n\n            foreach(var c in dt.Fields)\n            {\n                SuggestSwizzlerTypes(dt, dummyDt, value + c.Name, depth + 1, maxDepth, priority);\n            }\n        }\n\n\t    void SuggestHasFlagForEnums(DataType dt)\n\t    {\n\t\t    if (dt.TypeType != TypeType.Enum)\n\t\t\t    return;\n\n\t\t\tSuggest(SuggestItemType.Method, dt, \"HasFlag\");\n\t    }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestNodePathTypes.cs",
    "content": "﻿using Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno.Compiler.API.Domain.IL;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        void SuggestNodePathTypes(string ignoredClassName = null)\n        {\n            foreach (var n in _context.NodePath)\n            {\n                if (n.Type != NodeType.Root)\n                    Suggest(n.TypeOrNamespace, ignoredClassName);\n                if (n.TypeOrNamespace is Namespace)\n                    Suggest((n.TypeOrNamespace as Namespace).Types, ignoredClassName);\n                if (n.TypeOrNamespace is DataType)\n                    Suggest((n.TypeOrNamespace as DataType).NestedTypes, ignoredClassName);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestOverrides.cs",
    "content": "﻿using System;\nusing Outracks.CodeCompletion;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    static class CodeCompleterHelperMethods\n    {\n        // TODO: Move method out from here\n        public static string ProtectionModifierKeywords(this Modifiers m)\n        {\n            if (m.HasFlag(Modifiers.Internal) && m.HasFlag(Modifiers.Protected)) return \"protected internal \";\n            else if (m.HasFlag(Modifiers.Private)) return \"private\";\n            else if (m.HasFlag(Modifiers.Protected)) return \"protected\";\n            else if (m.HasFlag(Modifiers.Public)) return \"public\";\n            else throw new Exception(\"Invalid protection modifiers\");\n        }\n    }\n\n    public partial class CodeCompleter\n    {\n        string GetLineIndent()\n        {\n            int ofs = _reader.Offset;\n\n            string indent = \"\";\n            while (true)\n            {\n                var t = _reader.ReadTextReverse(1);\n\n                if (t == null || t == \"\\n\")\n                {\n                    _reader.Offset = ofs;\n                    return indent;\n                }\n\n\n                if (t[0] == ' ') indent += \" \";\n\t\t\t\telse if (t[0] == '\\t') indent += \"\\t\";\n                else indent = \"\";\n            }\n        }\n\n        void SuggestOverrides()\n        {\n            if (!(_context.TypeOrNamespace is DataType)) return;\n\n\n            bool hasProtectionModifiers = false;\n            int pp = _reader.Offset;\n            while (true)\n            {\n                switch (_reader.ReadTokenReverse())\n                {\n                    case TokenType.Public:\n                    case TokenType.Protected:\n                    case TokenType.Private:\n                    case TokenType.Internal:\n                        hasProtectionModifiers = true;\n                        break;\n\n                    case TokenType.Whitespace: continue;\n                }\n                break;\n            }\n            _reader.Offset = pp;\n\n            while (char.IsWhiteSpace(_reader.ReadText(1)[0]))\n            {\n            }\n\n            var dt = _context.TypeOrNamespace as DataType;\n            var bt = dt.Base;\n\n            while (bt != null)\n            {\n                foreach (var kk in bt.EnumerateMembers())\n                {\n                    var k = kk;\n                    if (k.IsVirtual)\n                    {\n                        bool found = false;\n                        foreach (var u in dt.EnumerateMembers())\n                        {\n                            if (k.Name == u.Name && (k.GetType().Equals(u.GetType())))\n                            {\n                                found = true;\n                            }\n                        }\n\n                        if (!found)\n                        {\n                            switch (k.MemberType)\n                            {\n                                case MemberType.Method:\n                                    {\n                                        var meth = k as Method;\n                                        Suggest(\n                                                SuggestItemType.Method,\n                                                k,\n                                                k.Name,\n                                                () =>\n                                                {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstring indent = \"\";//GetLineIndent();\n                                                        string pretext = k.ReturnType.ToString() + \" \" + meth.Name + \"(\";\n                                                        for (int i = 0; i < meth.Parameters.Length; i++)\n                                                        {\n                                                            if (i > 0) pretext += \", \";\n                                                            pretext += meth.Parameters[i].Type.ToString() + \" \" + meth.Parameters[i].Name;\n                                                        }\n                                                        pretext += \")\\n\" + indent + \"{\\n\" + indent + \"\\t\";\n\n                                                        if (!(meth.ReturnType is VoidType)) pretext += \"return \";\n                                                        pretext += \"base.\" + meth.Name + \"(\";\n\n                                                        for (int i = 0; i < meth.Parameters.Length; i++)\n                                                        {\n                                                            if (i > 0) pretext += \", \";\n                                                            pretext += meth.Parameters[i].Name;\n                                                        }\n\n                                                        pretext += \");\";\n                                                        return pretext;\n                                                    },\n                                                () => \"\\n\" + \"}\\n\",\n                                                () => \"\", //TODO: Build description here\n                                                null, //TODO: Insert access modifiers here\n                                                null, //TODO: Insert field modifiers here\n                                                null, //TODO: Insert method arguments here\n                                                (e) =>\n                                                {\n                                                    if (!hasProtectionModifiers)\n                                                        e.InsertText(_reader.Offset-1, meth.Modifiers.ProtectionModifierKeywords() + \" \");\n                                                }\n                                            );\n                                    }\n                                    break;\n                                case MemberType.Property:\n                                    {\n                                        Suggest(SuggestItemType.Property, k, k.Name);\n                                    }\n                                    break;\n                                case MemberType.Event:\n                                    {\n                                        Suggest(SuggestItemType.Property, k, k.Name);\n                                    }\n                                    break;\n                            }\n\n                        }\n                    }\n                }\n\n                bt = bt.Base;\n            }\n\n\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestTypes.cs",
    "content": "﻿using System.Linq;\nusing Outracks.CodeCompletion;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Core.Syntax.Binding;\nusing Uno.Compiler.Core.Syntax.Compilers;\nusing Uno.Compiler.Frontend.Analysis;\nusing Parser = Uno.Compiler.Frontend.Analysis.Parser;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        bool InCatchBlockHeader()\n        {\n            if (_context.NodePath.Count == 0) return false;\n\n            // If we are in a catch block before the first curly brace\n            if (Enumerable.Last(_context.NodePath).Type == NodeType.Catch)\n            {\n                var oldOffset = _reader.Offset;\n                _reader.Offset = Enumerable.Last(_context.NodePath).StartOffset;\n                while (true)\n                {\n                    var t = _reader.ReadToken();\n                    if (t == TokenType.LeftCurlyBrace) break;\n                    if (_reader.Offset > oldOffset)\n                    {\n                        _reader.Offset = oldOffset;\n                        return true;\n                    }\n                    if (t == TokenType.EndOfFile) break;\n                }\n            }\n            return false;\n        }\n\n        // ICKKKKKKK\n        bool _exceptionTypesOnly;\n\n        enum SuggestTypesMode\n        {\n            Importers,\n            Blocks,\n            Attributes,\n            Everything\n        }\n\n        void SuggestTypes(string memberExp, bool includeStaticMembers, bool metaContext, SuggestTypesMode mode = SuggestTypesMode.Everything, bool onlyClassTypes = false)\n        {\n            _exceptionTypesOnly = InCatchBlockHeader();\n\n            SourceObject item = _context.TypeOrNamespace;\n\n            // Suggest generic arguments\n            if (mode == SuggestTypesMode.Everything)\n            {\n                var vdt = _context.TypeOrNamespace as DataType;\n                while (vdt != null)\n                {\n                    if (vdt.GenericParameters != null)\n                        foreach (var t in vdt.GenericParameters) Suggest(t);\n                    vdt = vdt.Parent as DataType;\n                }\n\n            }\n\n            if (memberExp == \"\")\n            {\n                foreach (var u in _context.Usings)\n                {\n                    var ns = _context.Compiler.ILFactory.GetEntity(_context.Root.Source, u, _context.Root) as Namespace;\n                    if (ns != null)\n                    {\n                        foreach(var i in ns.Types)\n                        {\n                            if (!onlyClassTypes || (i.TypeType == TypeType.Class || i.TypeType == TypeType.Interface))\n                                Suggest(i, null, mode);\n                        }\n                        if (mode == SuggestTypesMode.Blocks) Suggest(ns.Blocks);\n                    }\n                }\n\n                if (mode == SuggestTypesMode.Everything)\n                {\n                    FunctionCompiler fc = null;\n                    foreach (var us in _context.UsingStatics)\n                    {\n                        var dte = Parser.ParseExpression(_compiler.Log, _source, us, metaContext ? ParseContext.MetaProperty : ParseContext.Default);\n                        if (!dte.IsInvalid)\n                        {\n                            if (fc == null) fc = CreateFunctionCompiler(_methodNode);\n                            TrySuggestMembers(fc, dte, true);\n                        }\n                    }\n\n                    SuggestNodePathTypes();\n                }\n            }\n\n            if (memberExp != \"\")\n            {\n                item = ResolveStringInFunctionContext(_methodNode, memberExp, _source, new FunctionCompiler(_context.Compiler, _context.TypeOrNamespace));\n                if (mode == SuggestTypesMode.Everything && memberExp.EndsWith(\"<\")) SuggestKeywords(TypeAliases.AllAliases.ToArray());\n\n                if (item is PartialNamespace)\n                {\n                    var ns = (item as PartialNamespace).Namespace;\n                    Suggest(ns.Namespaces, null, mode);\n                    Suggest(ns.Types, null, mode);\n\n                    if (mode == SuggestTypesMode.Blocks) Suggest(ns.Blocks);\n                }\n\n                if (includeStaticMembers && item is PartialType)\n                {\n                    var dt = (item as PartialType).Type;\n                    SuggestTypeMembers(dt, AccessorLevel.Public, true, metaContext, false, null);\n                }\n\n            }\n            else\n            {\n                if (mode == SuggestTypesMode.Everything && !_exceptionTypesOnly)\n                {\n                    SuggestKeywords(TypeAliases.AllAliases.ToArray());\n                    SuggestKeywords(\"void\");\n                }\n\n                while (item != null)\n                {\n                    if (item is Namespace)\n                    {\n                        var ns = item as Namespace;\n                        Suggest(ns.Namespaces, null, mode);\n                        Suggest(ns.Types, null, mode);\n\n                        if (mode == SuggestTypesMode.Blocks) Suggest(ns.Blocks);\n\n                        item = ns.Parent;\n                    }\n                    else if (includeStaticMembers && item is DataType)\n                    {\n                        var dt = item as DataType;\n                        SuggestTypeMembers(dt, AccessorLevel.Private, true, metaContext, false, null);\n\n                        item = dt.Parent;\n                        metaContext = false;\n                    }\n                    else if (item is DataType)\n                    {\n                        var dt = item as DataType;\n                        item = dt.Parent;\n                        if (dt.Block != null && mode == SuggestTypesMode.Blocks) Suggest(dt.Block.NestedBlocks);\n                    }\n                    else break;\n                }\n            }\n        }\n\n        void SuggestLocals(FunctionCompiler func)\n        {\n            foreach (var vs in func.VariableScopeStack)\n            {\n                foreach (var v in vs.Variables)\n                    Suggest(SuggestItemType.Variable, v.Value, v.Value.Name);\n            }\n\n            foreach (var p in func.Function.Parameters)\n                Suggest(SuggestItemType.MethodArgument, p, p.Name);\n        }\n\n\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.SuggestUsing.cs",
    "content": "﻿using System.Linq;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Types;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        void SuggestUsingOrApply(string qualifier, bool includeTypes = false, bool includeBlocks = false)\n        {\n            if (!qualifier.Contains('.'))\n            {\n                if (includeTypes) SuggestTypes(\"\", false, false, SuggestTypesMode.Everything);\n                if (includeBlocks) SuggestTypes(\"\", false, false, SuggestTypesMode.Blocks);\n            }\n            else\n            {\n                var p = qualifier.Split('.');\n\n                Namescope ns = _context.Root;\n                foreach (var pp in p.Take(p.Length - 1))\n                {\n                    if (ns is Namespace)\n                    {\n                        foreach (var nn in (ns as Namespace).Namespaces)\n                        {\n                            if (nn.Name == pp)\n                            {\n                                ns = nn;\n                                break;\n                            }\n                        }\n                        if (includeTypes)\n                        {\n                            foreach (var nn in (ns as Namespace).Types)\n                            {\n                                if (nn.Name == pp)\n                                {\n                                    ns = nn;\n                                    break;\n                                }\n                            }\n                        }\n                    }\n                    if (includeTypes && ns is DataType)\n                    {\n                        foreach (var nn in (ns as DataType).NestedTypes)\n                        {\n                            if (nn.Name == pp)\n                            {\n                                ns = nn;\n                                break;\n                            }\n                        }\n                    }\n                }\n\n                if (ns is Namespace)\n                {\n                    Suggest((ns as Namespace).Namespaces);\n\n                    if (includeTypes)\n                    {\n                        Suggest((ns as Namespace).Types);\n                    }\n\n                    if (includeBlocks)\n                    {\n                        Suggest((ns as Namespace).Blocks);\n                    }\n                }\n                else if (includeTypes && ns is DataType)\n                {\n                    Suggest((ns as DataType).NestedTypes);\n\n                    if (includeBlocks)\n                    {\n                        Suggest((ns as ClassType).Block.NestedBlocks);\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.TypeBody.cs",
    "content": "﻿using Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public partial class CodeCompleter\n    {\n        bool IsInsideMethodArgumentDeclaration()\n        {\n            var offs = _reader.Offset;\n            while (true)\n            {\n                var t = _reader.ReadTokenReverse();\n                switch (t)\n                {\n                    case TokenType.Identifier:\n                    case TokenType.Whitespace:\n                    case TokenType.Period:\n                    case TokenType.This:\n                        continue;\n\n                    case TokenType.LeftParen:\n                    {\n                        _reader.Offset = offs;\n                        return true;\n                    }\n                }\n                break;\n            }\n\n            _reader.Offset = offs;\n            return false;\n        }\n\n        void ComputeTypeBodySuggestions()\n        {\n            if (SuggestAttributesIfInsideAttributeDeclaration())\n                return;\n\n            if (IsInsideMethodArgumentDeclaration())\n                SuggestExtensionMethod();\n\n            TokenType t;\n            string memberExp = FindMemberExpression(out t, true);\n\n            if (memberExp == \"\")\n                SuggestKeywords(\"public\", \"private\", \"meta\", \"protected\", \"abstract\", \"override\", \"readonly\", \"static\", \"class\", \"event\", \"struct\", \"enum\", \"delegate\");\n\n            SuggestBlock();\n            SuggestTypes(memberExp, false, true);\n            SuggestNodePathTypes();\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeCompleter/CodeCompleter.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.Core;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja.CodeCompleter\n{\n    public enum ConfidenceLevel\n    {\n        Exact,\n        Faulty,\n        Failed\n    }\n\n    public partial class CodeCompleter\n    {\n\t\treadonly Compiler _compiler;\n        readonly IUnoCodeReader _reader;\n        readonly Context _context;\n        readonly Source _source;\n        Node _methodNode;\n\n        public Context Context { get { return _context; } }\n\n        public CodeCompleter(Compiler compiler, Source src, IUnoCodeReader codeReader, int caret, ParseResult parseResult)\n        {\n            _compiler = compiler;\n            _reader = codeReader;\n            _source = src;\n            _context = new Context(_compiler, src, parseResult, caret, codeReader.Length);\n        }\n\n        public IEnumerable<SuggestItem> SuggestCompletion(string lastTextEntered, out ConfidenceLevel confidence)\n        {\n            confidence = ConfidenceLevel.Exact;\n            if (_compiler == null) return new List<SuggestItem>();\n\n            _suggestions = new List<SuggestItem>();\n            confidence = ComputeSuggestions(lastTextEntered);\n\n\t\t\tif (_compiler == null) confidence = ConfidenceLevel.Faulty;\n\n            return _suggestions;\n        }\n\n        ConfidenceLevel ComputeSuggestions(string lastTextEntered)\n        {\n            if (InNameDeclarationOrOperatorPosition()) return ConfidenceLevel.Exact;\n\n            _methodNode = _context.NodePath.LastOrDefault(x => NodeTypeHelpers.IsMethodNode(x.Type));\n\n            ConfidenceLevel conf = ComputeQuickWins();\n            if (conf != ConfidenceLevel.Failed) return conf;\n\n            if (lastTextEntered == \" \") return ConfidenceLevel.Exact;\n\n            if (_context.NodePath.Count < 2)\n            {\n                SuggestRootItems();\n                return ConfidenceLevel.Exact;\n            }\n\n            switch (Enumerable.Last(_context.NodePath).Type)\n            {\n                case NodeType.Block:\n                case NodeType.MetaProperty:\n                case NodeType.MetaPropertyDefinition:\n                    {\n                        SuggestBlock();\n                        return ConfidenceLevel.Faulty;\n                    }\n\n                case NodeType.Apply:\n                    {\n                        SuggestUsingOrApply(_reader.ReadBackwardsTo(Tokens.Apply).Trim(), true, true);\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.Using:\n                    {\n                        SuggestUsingOrApply(_reader.ReadBackwardsTo(TokenType.Using, TokenType.Comma).Trim());\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.Class:\n                case NodeType.Struct:\n                    {\n                        ComputeTypeBodySuggestions();\n                        return ConfidenceLevel.Faulty;\n                    }\n\n                case NodeType.Method:\n                case NodeType.Catch:\n                case NodeType.GetScope:\n                case NodeType.AddScope:\n                case NodeType.RemoveScope:\n                case NodeType.MetaPropertyDefinitionScope:\n                    {\n                        ComputeFunctionBodySuggestions();\n                        return ConfidenceLevel.Exact;\n                    }\n                case NodeType.DrawStatement:\n                    {\n                        ComputeDrawstatementSuggestions();\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.Field:\n                    {\n                        ComputeFunctionBodySuggestions(true);\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.Property:\n                case NodeType.Indexer:\n                    {\n                        var p = Enumerable.Last(_context.NodePath);\n\n                        bool hasGet = false;\n                        bool hasSet = false;\n                        if (p.Children != null)\n                        {\n                            foreach (var c in p.Children)\n                            {\n                                if (c.Type == NodeType.GetScope) hasGet = true;\n                                if (c.Type == NodeType.SetScope) hasSet = true;\n                            }\n                        }\n                        SuggestKeywords(\"public\", \"protected\", \"private\", \"internal\");\n                        if (!hasGet) SuggestKeywords(\"get\");\n                        if (!hasSet) SuggestKeywords(\"set\");\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.SetScope:\n                    {\n                        ComputeFunctionBodySuggestions();\n                        SuggestKeywords(\"value\");\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.Operator:\n                    {\n                        ComputeFunctionBodySuggestions();\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.Constructor:\n                    {\n                        ComputeFunctionBodySuggestions();\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.Root:\n                case NodeType.Namespace:\n                    {\n                        SuggestRootItems();\n                        return ConfidenceLevel.Exact;\n                    }\n\n                case NodeType.InlineBlock:\n                    {\n                        SuggestBlock();\n                        return ConfidenceLevel.Faulty;\n                    }\n            }\n\n            return ConfidenceLevel.Faulty;\n        }\n\n        bool IsMemberAccessible(Modifiers memberModifiers, DataType memberDeclType, DataType accessingType)\n        {\n            if (memberModifiers.HasFlag(Modifiers.Public)) return true;\n\n            if (accessingType.Equals(memberDeclType)) return true;\n\n            if (memberModifiers.HasFlag(Modifiers.Protected))\n            {\n                if (accessingType.IsSubclassOf(memberDeclType)) return true;\n            }\n\n            return accessingType.IsChildClassOf(memberDeclType);\n        }\n\n        bool IsMemberAccessible(Member member, DataType accessingType)\n        {\n            return IsMemberAccessible(member.Modifiers, member.DeclaringType, accessingType);\n        }\n    }\n\n    public static class ICodeReaderHelpers\n    {\n        public static string ReadBackwardsTo(this IUnoCodeReader r, params TokenType[] tokenTypes)\n        {\n            var offset = r.Offset;\n            while (true)\n            {\n                var tt = r.PeekTokenReverse();\n                if (tt == TokenType.EndOfFile)\n                {\n                    return r.ReadText(offset - r.Offset);\n                }\n                if (tokenTypes.Contains(tt))\n                {\n                    return r.ReadText(offset - r.Offset);\n                }\n                var k = r.ReadTokenReverse();\n                if (k == TokenType.EndOfFile) return null;\n            }\n        }\n\n        public static string ReadBackwardsTo(this IUnoCodeReader r, string token)\n        {\n            var offset = r.Offset;\n            while (true)\n            {\n                var tt = r.PeekTokenReverse();\n                if (tt == TokenType.EndOfFile)\n                {\n                    return r.ReadText(offset - r.Offset);\n                }\n                if (tt == TokenType.Identifier)\n                {\n                    var text = r.ReadText(offset - r.Offset);\n                    if (text.StartsWith(token))\n                        return text;\n                }\n                var k = r.ReadTokenReverse();\n                if (k == TokenType.EndOfFile) return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeNinjaBuild.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing Outracks.IO;\nusing Uno.Build;\nusing Uno.Compiler;\nusing Uno.Compiler.API.Backends;\nusing Uno.Compiler.API.Domain.AST;\nusing Uno.Compiler.Core;\nusing Uno.Compiler.Frontend.Analysis;\nusing Uno.IO;\nusing Uno.Logging;\nusing Uno.ProjectFormat;\nusing Uno.UX.Markup.CodeGeneration;\n\nnamespace Outracks.UnoDevelop.CodeNinja\n{\n\tpublic interface IEditorManager\n\t{\n\t\tDateTime GetLastWriteTime(AbsoluteFilePath filePath);\n\n\t\tbool IsOpen(AbsoluteFilePath filePath);\n\n\t\tstring ReadAllText(AbsoluteFilePath filePath);\n\t}\n\n\tpublic class DummyEditorManager : IEditorManager\n\t{\n\t\tpublic DateTime GetLastWriteTime(AbsoluteFilePath filePath)\n\t\t{\n\t\t\treturn DateTime.Now;\n\t\t}\n\n\t\tpublic bool IsOpen(AbsoluteFilePath filePath)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic string ReadAllText(AbsoluteFilePath filePath)\n\t\t{\n\t\t\treturn File.ReadAllText(filePath.NativePath);\n\t\t}\n\t}\n\n\n\tpublic interface ILog\n\t{\n\t\tTextWriter TextWriter { get; }\n\n\t\tvoid Mute();\n\t\tvoid Unmute();\n\t\tvoid Clear();\n\t}\n\n\tpublic class DummyLogger : ILog\n\t{\n\t\tpublic void Clear() { }\n\n\t\tpublic StringBuilder sb = new StringBuilder();\n\n\t\tpublic DummyLogger()\n\t\t{\n\t\t\t_tw = new StringWriter(sb);\n\t\t}\n\n\t\tStringWriter _tw;\n\t\tpublic TextWriter TextWriter\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _tw;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Show()\n\t\t{\n\t\t}\n\n\t\tpublic void Mute()\n\t\t{\n\t\t}\n\n\t\tpublic void Unmute()\n\t\t{\n\t\t}\n\t}\n\n\t[Flags]\n\tenum DirtyFlag\n\t{\n\t\tNone,\n\t\tDirty\n\t}\n\n\tpublic enum ExecuteStatus\n\t{\n\t\tError,\n\t\tFatal,\n\t\tNotDirty,\n\t\tSuccess\n\t}\n\n\tclass ASTLocalCacheData\n\t{\n\t\tpublic string Name;\n\t\tpublic DateTime Timestamp;\n\t\tpublic List<AstDocument> Ast;\n\t}\n\n\tpublic class CodeNinjaBuild\n\t{\n\t\treadonly IEditorManager _editors;\n\t\treadonly ILog _logWriter;\n\t\treadonly Log _log;\n\t\treadonly Compiler _compiler;\n\t\treadonly string _extraCode;\n\t\treadonly AbsoluteFilePath _extraCodeSource;\n\t\treadonly List<RelativeFilePath> _filePaths;\n\t\treadonly AbsoluteDirectoryPath _projDir;\n\t\tstatic readonly List<SourcePackage> _packages = new List<SourcePackage>();\n\n\t\tpublic readonly SourcePackage ProjectPackage;\n\n\t\tpublic Compiler Compiler\n\t\t{\n\t\t\tget { return _compiler; }\n\t\t}\n\n\t\tpublic CodeNinjaBuild(ILog logWriter, Project project, IEditorManager editors, SourcePackage mainPackage, List<SourcePackage> referencedPackages, string extraCode = null, AbsoluteFilePath extraSourcePath = null)\n\t\t{\n\t\t\t_log = new Log(logWriter.TextWriter);\n\t\t\t_log.MaxErrorCount = 0;\n\n\t\t\t_logWriter = logWriter;\n\t\t\t_editors = editors;\n\n\t\t\t//var newPackages = new List<SourcePackage>();\n\t\t\t//mainPackage = Uno.Build.Packages.PackageResolver.ResolvePackages(_log, project, newPackages);\n\n\t\t\tAddNotAddedPackages(referencedPackages);\n\t\t\tmainPackage.References.Clear();\n\t\t\t_packages.Each(p => mainPackage.References.Add(p));\n\n\t\t\tProjectPackage = mainPackage;\n\n\t\t\t_extraCode = extraCode;\n\t\t\t_extraCodeSource = extraSourcePath;\n\n\t\t\tvar configuration = new CodeNinjaBuildTarget();\n\t\t\tvar backend = configuration.CreateBackend();\n\n\t\t\tvar projectDir = project.RootDirectory;\n\t\t\tvar rootDir = AbsoluteDirectoryPath.Parse(Path.Combine(projectDir, \".CodeNinja\"));\n\n\t\t\t_compiler = new Compiler(\n\t\t\t\t_log,\n\t\t\t\tbackend,\n\t\t\t\tProjectPackage,\n\t\t\t\tnew CompilerOptions\n\t\t\t\t{\n\t\t\t\t\tDebug = true,\n\t\t\t\t\tCodeCompletionMode = true,\n\t\t\t\t\tOutputDirectory = (rootDir / \"Output\").ToString(),\n\t\t\t\t\tBuildTarget = \"CodeNinja\",\n\t\t\t\t\tStrip = false\n\t\t\t\t});\n\n\t\t\t_projDir = AbsoluteDirectoryPath.Parse(ProjectPackage.SourceDirectory);\n\t\t\t_filePaths = project.SourceFiles.Select(x => x.UnixPath).Select(RelativeFilePath.Parse).ToList();\n\t\t}\n\n\t\tvoid AddNotAddedPackages(IEnumerable<SourcePackage> sourcePackages)\n\t\t{\n\t\t\t// TODO: Fix this hack...\n\n\t\t\tvar sourcePackagesArr = sourcePackages as SourcePackage[] ?? sourcePackages.ToArray();\n\t\t\tforeach (var package in sourcePackagesArr)\n\t\t\t{\n\t\t\t\tvar found = _packages.FirstOrDefault(p => PackageEqual(p, package));\n\t\t\t\tif(found == null)\n\t\t\t\t\t_packages.Add(package);\n\t\t\t}\n\n\t\t\tforeach (var package in _packages.ToArray())\n\t\t\t{\n\t\t\t\tvar found = sourcePackagesArr.FirstOrDefault(p => PackageEqual(p, package));\n\t\t\t\tif (found == null)\n\t\t\t\t\t_packages.Remove(package);\n\t\t\t}\n\t\t}\n\n\t\tbool PackageEqual(SourcePackage a, SourcePackage b)\n\t\t{\n\t\t\treturn a.Name == b.Name;\n\t\t}\n\n\t\tpublic IEnumerable<AbsoluteFilePath> FilePaths\n\t\t{\n\t\t\tget { return _filePaths.Select(f => _projDir / f); }\n\t\t}\n\n\t\tAbsoluteFilePath GetAbsolutePath(SourcePackage p, RelativeFilePath s)\n\t\t{\n\t\t\treturn AbsoluteDirectoryPath.Parse(p.SourceDirectory) / s;\n\t\t}\n\n\t\tpublic void MuteLog()\n\t\t{\n\t\t\t_logWriter.Mute();\n\t\t}\n\n\t\tpublic void UnmuteLog()\n\t\t{\n\t\t\t_logWriter.Unmute();\n\t\t}\n\n\t\tpublic ExecuteStatus Execute()\n\t\t{\n\t\t\t_logWriter.Clear();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (_extraCode != null)\n\t\t\t\t{\n\t\t\t\t\tvar ast = new List<AstDocument>();\n\t\t\t\t\tvar parser = new Parser(_log, ProjectPackage, _extraCodeSource.NativePath, _extraCode);\n\t\t\t\t\tparser.Parse(ast);\n\n\t\t\t\t\t// Don't check for error, just add the AST anyway\n\t\t\t\t\t_compiler.AstProcessor.AddRange(ast);\n\t\t\t\t}\n\n\t\t\t\tvar dirtyFlag = DirtyFlag.None;\n\t\t\t\tforeach (var pack in _packages)\n\t\t\t\t{\n\t\t\t\t\tforeach (var file in pack.SourceFiles)\n\t\t\t\t\t{\n\t\t\t\t\t\tdirtyFlag |= TryParse(pack, GetAbsolutePath(pack, RelativeFilePath.Parse(file.UnixPath))) ? DirtyFlag.None : DirtyFlag.Dirty;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tBuildUX();\n\n\t\t\t\tforeach (var path in ProjectPackage.SourceFiles)\n\t\t\t\t{\n\t\t\t\t\tdirtyFlag |= TryParse(ProjectPackage, _projDir / RelativeFilePath.Parse(path.UnixPath)) ? DirtyFlag.None : DirtyFlag.Dirty;\n\t\t\t\t}\n\n\t\t\t\tif (!dirtyFlag.HasFlag(DirtyFlag.Dirty))\n\t\t\t\t{\n\t\t\t\t\treturn ExecuteStatus.NotDirty;\n\t\t\t\t}\n\n\t\t\t\t_compiler.InitializeIL();\n\t\t\t\t_compiler.TypeBuilder.Build();\n\t\t\t\t_compiler.BlockBuilder.Build();\n\n\t\t\t\tvar errors = _compiler.Log.ErrorCount;\n\t\t\t\treturn errors == 0 ? ExecuteStatus.Success : ExecuteStatus.Error;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tReportFactory.FallbackReport.Exception(\"CodeNinjaBuild failed: \", e);\n\t\t\t\treturn ExecuteStatus.Fatal;\n\t\t\t}\n\t\t}\n\n\t\tprivate void BuildUX()\n\t\t{\n\t\t\tProjectPackage.SourceFiles.Clear();\n\t\t\tProjectPackage.SourceFiles.AddRange(_filePaths.Select(f => (FileItem) f.NativeRelativePath));\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tUXProcessor.Build(Disk.Default, new[] {ProjectPackage});\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\tbool TryParse(SourcePackage package, AbsoluteFilePath path)\n\t\t{\n\t\t\tvar compilerPath = path.NativePath;\n\n\t\t\tvar sourceTimestamp = _editors.GetLastWriteTime(path);\n\t\t\tvar cachedData = _astCache.FirstOrDefault(x => x.Name == compilerPath);\n\t\t\tif (cachedData == null)\n\t\t\t{\n\t\t\t\tcachedData = new ASTLocalCacheData() { Name = compilerPath, Timestamp = sourceTimestamp };\n\t\t\t\t_astCache.Add(cachedData);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (TryLoadParsedFileFromCache(sourceTimestamp, cachedData, _compiler))\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar parser = new Parser(_log, package, compilerPath, _editors.ReadAllText(path));\n\t\t\t\tvar ast = new List<AstDocument>();\n\n\t\t\t\tparser.Parse(ast);\n\t\t\t\t_compiler.AstProcessor.AddRange(ast);\n\t\t\t\tcachedData.Ast = ast;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Temporary optimization, until compiler has better file management.\n\t\treadonly static List<ASTLocalCacheData> _astCache = new List<ASTLocalCacheData>();\n\n\t\tstatic bool TryLoadParsedFileFromCache(DateTime sourceTimestamp, ASTLocalCacheData cacheData, Compiler compiler)\n\t\t{\n\t\t\tif (cacheData.Timestamp < sourceTimestamp || cacheData.Ast == null) return false;\n\n\t\t\tcompiler.AstProcessor.AddRange(cacheData.Ast);\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\n\tclass CodeNinjaBuildTarget : BuildTarget\n\t{\n\t\tpublic override string Identifier\n\t\t{\n\t\t\tget { return \"codeninja\"; }\n\t\t}\n\n\t\tpublic override string ProjectGroup\n\t\t{\n\t\t\tget { return \"CodeNinja\"; }\n\t\t}\n\n\t\tpublic override Backend CreateBackend()\n\t\t{\n\t\t\treturn new DefaultBackend();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/CodeReader.cs",
    "content": "﻿using Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno.Compiler;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja\n{\n    public class CodeReader : IUnoCodeReader\n    {\n        private readonly string _s;\n        private int _p;\n        private readonly Token[] _tokens;\n\n        public CodeReader(string s, int caret)\n        {\n            _s = s;\n            _p = caret;\n            _tokens = Lexer.Tokenize(new SourceFile(\"(unknown)\", s), s).ToArray();\n        }\n\n        private TokenType Token(bool peek, bool reverse = false)\n        {\n            for (int i = 0; i < _tokens.Length; i++)\n            {\n                Token token = _tokens[i];\n                int ol = token.Offset + token.Length;\n\n                if (ol <= _p) continue;\n\n                if (reverse)\n                {\n                    if (i <= 0) return TokenType.EndOfFile;\n\n                    token = _tokens[i - 1];\n                    if (!peek)\n                        _p = token.Offset;\n                }\n                else\n                {\n                    if (!peek)\n                        _p = i < _tokens.Length - 1 ? ol : _s.Length - 1;\n                }\n                return token.Type;\n            }\n            return TokenType.EndOfFile;\n        }\n\n        public TokenType PeekTokenReverse()\n        {\n            return Token(true, true);\n        }\n\n        public TokenType ReadTokenReverse()\n        {\n            return Token(false, true);\n        }\n\n        public TokenType ReadToken()\n        {\n            return Token(false);\n        }\n\n        public TokenType PeekToken()\n        {\n            return Token(true);\n        }\n\n        public int Offset\n        {\n            get { return _p; }\n            set { _p = value; }\n        }\n\n        public string PeekTextReverse(int charCount)\n        {\n            return _s.Substring(_p - charCount, charCount);\n        }\n\n        public string ReadText(int charCount)\n        {\n            var r = _s.Substring(_p, charCount);\n            _p += charCount;\n            return r;\n        }\n\n        public string ReadTextReverse(int charCount)\n        {\n            _p -= charCount;\n            return _s.Substring(_p, charCount);\n        }\n\n        public string PeekText(int charCount)\n        {\n            return _s.Substring(_p, charCount);\n        }\n\n        public int Length\n        {\n            get { return _s.Length; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/DocumentationComment.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Uno.Compiler\n{\n    public class DocumentationComment\n    {\n        public Dictionary<string, string> Params = new Dictionary<string, string>();\n\n        public string ReturnValue;\n\n        public string Summary;\n\n        public string Body;\n\n        public DocumentationComment(string comment)\n        {\n            try\n            {\n                comment = comment.Trim();\n\n                var lines = comment.Split('\\n');\n\n                Body = \"\";\n\n                foreach (var line in lines)\n                {\n                    var l = line.Trim('/', '*', ' ', '\\t', '\\r');\n\n                    if (l.ToLower().StartsWith(\"@param\"))\n                    {\n                        l = l.Substring(\"@param \".Length);\n                        var x = l.IndexOf(' ');\n                        if (x != -1)\n                        {\n                            var pname = l.Substring(0, x).Trim();\n                            var pdoc = l.Substring(x, l.Length - x).Trim();\n                            Params.Add(pname, pdoc);\n                        }\n                        continue;\n                    }\n                    else if (l.ToLower().StartsWith(\"@return\"))\n                    {\n                        l = l.Substring(\"@return \".Length);\n                        ReturnValue = l;\n                        continue;\n                    }\n                    else\n                    {\n                        if (Summary == null && l.Length > 0) Summary = l;\n                        else Body += l + \" \";\n                    }\n                }\n            }\n            catch (Exception)\n            {\n            }\n        }\n    }\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/DocumentationHinter/DocumentationCache.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Xml;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\n\nnamespace Outracks.UnoDevelop.CodeNinja\n{\n    public static class DocumentationCache\n    {\n        static string CacheFilePath\n        {\n            get\n            {\n                var dirPath = Path.Combine(Path.GetTempPath(), \"RealtimeStudio\");\n                var filePath = Path.Combine(dirPath, \"DocumentationCache.xml\");\n                Directory.CreateDirectory(dirPath);\n                return filePath;\n            }\n        }\n\n        static async Task<Dictionary<string, Entry>> LoadCache()\n        {\n            var documentation = new Dictionary<string, Entry>();\n\n            using(var fileStream = new FileStream(CacheFilePath, FileMode.Open, FileAccess.Read))\n            using (var reader = XmlReader.Create(fileStream, new XmlReaderSettings { Async = true }))\n            while (await reader.ReadAsync())\n            {\n                if (reader.NodeType != XmlNodeType.Element || reader.Name != \"Element\") continue;\n\n                string key = null;\n                string value = null;\n                string url = null;\n                var hasMoreContent = false;\n\n                using (var subReader = reader.ReadSubtree())\n                while (await subReader.ReadAsync())\n                {\n                    if (subReader.Name == \"Key\")\n                        key = await subReader.ReadElementContentAsStringAsync();\n\n                    if (subReader.Name == \"Value\")\n                        value = await subReader.ReadElementContentAsStringAsync();\n\n                    if (subReader.Name == \"Url\")\n                        url = await subReader.ReadElementContentAsStringAsync();\n\n                    if (subReader.Name == \"HasMoreContent\")\n                        hasMoreContent = subReader.ReadElementContentAsBoolean();\n                }\n\n                if (key != null) documentation.Add(key, new Entry(value, url, hasMoreContent));\n            }\n            return documentation;\n        }\n\n        public class Entry\n        {\n            public readonly string Documentation;\n            public readonly string Url;\n            public readonly bool HasMoreContent;\n\n            public Entry(string doc, string url, bool hasMoreContent)\n            {\n                Documentation = doc;\n                Url = url;\n                HasMoreContent = hasMoreContent;\n            }\n        }\n\n        static Dictionary<string, Entry> _documentation;\n\n        public static async void Update()\n        {\n            try\n            {\n                if (_documentation == null && File.Exists(CacheFilePath))\n                    _documentation = await LoadCache();\n            }\n            catch (Exception) { /* NOTE: We should log this.. */ }\n            try\n            {\n                var client = new HttpClient();\n                var response = await client.GetAsync(\"https://beta.outracks.com/api/v1/docs/intellisense\"); //TODO: Use updated URL if we start using this again\n                if (!response.IsSuccessStatusCode) return;\n\n                using (var responseStream = await response.Content.ReadAsStreamAsync())\n                using (var fileStream = File.Create(CacheFilePath))\n                    await responseStream.CopyToAsync(fileStream);\n\n                _documentation = await LoadCache();\n            }\n            catch (Exception) { /* NOTE: We should log this.. */ }\n        }\n\n        public static Entry GetEntry(string key)\n        {\n            if (_documentation == null) return null;\n\n            if (_documentation.ContainsKey(key))\n            {\n                LastAccessedEntry = _documentation[key];\n                return LastAccessedEntry;\n            }\n            return null;\n        }\n\n        public static void LaunchHelpForLastAccessedEntry()\n        {\n            if (LastAccessedEntry != null)\n                Process.Start(LastAccessedEntry.Url);\n            else\n                Process.Start(\"http://beta.outracks.com/docs\"); //TODO: Use updated URL if we start using this again\n        }\n\n        public static Entry LastAccessedEntry { get; private set; }\n\n        public static string GetILID(Entity e)\n        {\n            if (e is DataType)\n            {\n                if (e is VoidType) return \"\";\n\n                var dt = (e as DataType);\n\n                if (dt is GenericParameterType)\n                {\n                    return dt.Name;\n                }\n\n                dt = dt.MasterDefinition;\n\n\n\n                string s;\n\n                if (dt.Parent != null)\n                    s = GetILID(dt.Parent) + \".\" + dt.Name;\n                else\n                    s = dt.Name;\n\n                if (dt.IsGenericDefinition)\n                {\n                    s += \"`\" + (dt as GenericType).GenericParameters.Length;\n                }\n\n                return s;\n            }\n            else if (e is Member)\n            {\n                var m = (e as Member).MasterDefinition;\n\n                if (m is Constructor)\n                {\n                    var ctor = m as Constructor;\n\n                    var s = GetILID(m.DeclaringType) + \"..ctor\";\n\n                    if (ctor.Parameters.Count() > 0)\n                    {\n                        s += \"(\";\n                        foreach (var p in ctor.Parameters)\n                        {\n                            if (p != ctor.Parameters.First()) s += \",\";\n                            s += GetILID(p.Type);\n                        }\n                        s += \")\";\n                    }\n\n                    return s;\n                }\n                else if (m is Method)\n                {\n                    var method = m as Method;\n\n                    if (m.DeclaringType == null)\n                        return \"\";\n\n                    var s = GetILID(m.DeclaringType) + \".\" + m.Name;\n\n                    if (method.Parameters.Any())\n                    {\n                        s += \"(\";\n                        foreach (var p in method.Parameters)\n                        {\n                            if (p != method.Parameters.First()) s += \",\";\n                            s += GetILID(p.Type);\n                        }\n                        s += \")\";\n                    }\n\n                    return s;\n                }\n            }\n\n            return e.ToString();\n        }\n\n        public static Entry GetEntry(Entity e)\n        {\n            return GetEntry(GetILID(e));\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/DocumentationHinter/DocumentationHinter.Helpers.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Security;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.Graphics;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja\n{\n    public static partial class DocumentationHinter\n    {\n        public static string SafeXml(string s)\n        {\n            return SecurityElement.Escape(s);\n        }\n\n        public static string IdentifierToHtmlString(string id)\n        {\n            id = SafeXml(id);\n            if (Tokens.IsReserved(id)) return Color(id, \"blue\");\n            return id;\n        }\n\n        public static string DataTypeToHtmlString(DataType dt, IEnumerable<string> usings)\n        {\n            if (dt == null) return \"\";\n\n            string type;\n            if (TypeAliases.TryGetTypeFromAlias(dt.FullName, out type)) return \"<span style=\\\"color: blue;\\\">\" + dt.FullName + \"</span>\";\n\n            string name = SafeXml(dt.ToString());\n\n            foreach (var u in usings.OrderByDescending((s) => s.Length))\n            {\n                if (name.StartsWith(u))\n                {\n                    name = name.Substring(Math.Min(name.Length,u.Length+1));\n                    break;\n                }\n            }\n\n            var p = name.LastIndexOf('.') + 1;\n            if (p == 0)\n            {\n                return \"<span style=\\\"color: green;\\\">\" + name + \"</span>\";\n            }\n            else\n            {\n                var head = name.Substring(0, p);\n                var tail = name.Substring(p);\n                return head + \"<span style=\\\"color: green;\\\">\" + tail + \"</span>\";\n            }\n        }\n\n        public static string CreateHtmlHint(MetaProperty mp, IEnumerable<string> usings, string fixedSourceString)\n        {\n            string defs = \" :<br />\";\n\n            if (mp.Definitions != null && mp.Definitions.Length > 0)\n            {\n                foreach (var k in mp.Definitions)\n                {\n                    foreach (var r in k.Requirements)\n                    {\n                        defs += \"&nbsp;&nbsp;&nbsp;&nbsp;\" + SafeXml(r.ToString()).Replace(\"req(\", \"<span style=\\\"color: blue;\\\">req</span>(\");\n                        defs += \"<br />\";\n                    }\n                    defs += \"&nbsp;&nbsp;&nbsp;&nbsp;\" + SafeXml(k.Value.ToString());\n\n                    if (k != mp.Definitions.Last())\n                    {\n                        defs += \",<br /><br />\";\n                    }\n                    else defs += \";<br /><br />\";\n                }\n            }\n            else\n            {\n                defs = \"<br /><em>undefined</em><br /><br />\";\n            }\n\n            if (fixedSourceString == null && !mp.Source.FullPath.Contains('<'))\n            {\n                fixedSourceString = \"Declared in <span style=\\\"color: gray;\\\">\" + SafeXml(Path.GetFileName(mp.Source.FullPath)) + \"</span>\";\n            }\n\n            return DataTypeToHtmlString(mp.ReturnType, usings) + \" \" + mp.Name + defs + fixedSourceString;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/DocumentationHinter/DocumentationHinter.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing Uno.Compiler.API;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.Graphics;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Expressions;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\n\nnamespace Outracks.UnoDevelop.CodeNinja\n{\n    public class FileEntity { public string Path; public FileEntity(string path) { Path = path; } }\n    public class DirectoryEntity { public string Path; public DirectoryEntity(string path) { Path = path; } }\n\n    public static partial class DocumentationHinter\n    {\n        static string Keyword(string text) { return \"<span style=\\\"color: blue;\\\">\" + text + \"</span>\"; }\n        static string Color(string text, string color) { return \"<span style=\\\"color: \" + color + \";\\\">\" + text + \"</span>\"; }\n\n        static string TrimSafe(string namePath, Context context)\n        {\n            foreach (var u in context.Usings.OrderByDescending((s) => s.Length))\n            {\n                if (namePath.StartsWith(u)) return SafeXml(namePath.Substring(u.Length, namePath.Length - u.Length));\n            }\n            return SafeXml(namePath);\n        }\n\n        static string Trim(string namePath, Context context)\n        {\n            foreach (var u in context.Usings.OrderByDescending((s) => s.Length))\n            {\n                if (namePath.StartsWith(u)) return SafeXml(namePath.Substring(u.Length, namePath.Length - u.Length));\n            }\n            return namePath;\n        }\n\n        static string StripHTML(string inputString)\n        {\n            return Regex.Replace(inputString, \"<.*?>\", string.Empty);\n        }\n\n\n        public static Entity LastHintedEntity { get; set; }\n\n        public static string CreateHtmlHint(object obj, ICompiler compiler, IEnumerable<string> usings)\n        {\n            var documentation = \"\";\n\n            if (obj is Entity)\n            {\n                var doc = DocumentationCache.GetEntry(obj as Entity);\n\n                if (doc != null && doc.Documentation != null && doc.Documentation.Length > 0)\n                {\n                    var fullDoc = doc.Documentation.Replace(\"@\", \"\");\n\n                    documentation = \"<br />\" + StripHTML(fullDoc) + \"<br /><br /><em>Press F1 for more documentation</em>\";\n                }\n\n                LastHintedEntity = obj as Entity;\n            }\n\n            if (obj is GetMetaProperty)\n            {\n                var rmp = obj as GetMetaProperty;\n                return DataTypeToHtmlString(rmp.ReturnType, usings) + \" \" + rmp.Name + \" \" + Color(\"<em>(meta property)</em>\", \"gray\") + documentation;\n            }\n            else if (obj is InvalidExpression)\n            {\n                return null;\n            }\n            else if (obj is ClassType)\n            {\n                var dt = obj as ClassType;\n                return Keyword(\"class\") + \" \" + SafeXml(dt.QualifiedName) + documentation;\n            }\n            else if (obj is Namespace)\n            {\n                var dt = obj as Namespace;\n                return Keyword(\"namespace \") + \" \" + SafeXml(dt.QualifiedName) + documentation;\n            }\n            else if (obj is string)\n            {\n                string type;\n                if (TypeAliases.TryGetTypeFromAlias(obj as string, out type))\n                {\n                    var s = compiler.ILFactory.GetEntity(Source.Unknown, type);\n                    return (s != null ? (CreateHtmlHint(s, compiler, usings) ?? \"\") : \"\") + \"<br /><br /><em><strong>\" + obj as string + \"</strong> is a type alias for \" + SafeXml(type) + \"</em>\";\n                }\n\n                return Keyword(SafeXml(obj as string)) + \" (keyword)\";\n            }\n            else if (obj is StructType)\n            {\n                var dt = obj as StructType;\n                return Keyword(\"struct\") + \" \" + SafeXml(dt.QualifiedName) + documentation;\n            }\n            else if (obj is InterfaceType)\n            {\n                var dt = obj as InterfaceType;\n                return Keyword(\"interface\") + \" \" + SafeXml(dt.QualifiedName) + documentation;\n            }\n            else if (obj is DelegateType)\n            {\n                var dt = obj as DelegateType;\n                return Keyword(\"delegate\") + \" \" + SafeXml(dt.ToString()) + documentation;\n            }\n            else if (obj is EnumType)\n            {\n                var dt = obj as EnumType;\n                return Keyword(\"enum\") + \" \" + SafeXml(dt.QualifiedName) + documentation;\n            }\n            else if (obj is Variable)\n            {\n                var v = obj as Variable;\n                return DataTypeToHtmlString(v.ValueType, usings) + \" \" + SafeXml(v.Name) + \" (local variable)\";\n            }\n            else if (obj is Block)\n            {\n                var b = obj as Block;\n                return SafeXml(b.Name) + \" (meta property block)\" + documentation;\n            }\n            else if (obj is Parameter)\n            {\n                var p = obj as Parameter;\n                return DataTypeToHtmlString(p.Type, usings) + \" \" + SafeXml(p.Name) + \" (method argument)\";\n            }\n            else if (obj is GenericParameterType)\n            {\n                var gpt = obj as GenericParameterType;\n\n                if (gpt.IsGenericMethodParameter)\n                    return SafeXml(gpt.ToString()) + \" : generic parameter type of method \" + SafeXml(gpt.GenericMethodParent.ToString());\n                else\n                    return SafeXml(gpt.ToString()) + \" : generic parameter type of type \" + SafeXml(gpt.GenericTypeParent.ToString());\n            }\n            else\n            {\n                var usingList = usings as IList<string> ?? usings.ToList();\n                if (obj is Property)\n                {\n                    var p = obj as Property;\n\n                    return\n                        DataTypeToHtmlString(p.ReturnType, usingList) + \" \" + DataTypeToHtmlString(p.DeclaringType, usingList) + \".\" + p.Name + \" { \" +\n\t\t\t\t\t\t(p.GetMethod != null && p.GetMethod.Body != null ? \"get; \" : \"\") +\n\t\t\t\t\t\t(p.SetMethod != null && p.SetMethod.Body != null ? \"set; \" : \"\") +\n                        \"} \" + documentation;\n                }\n                else if (obj is Field)\n                {\n                    var f = obj as Field;\n\n                    return\n                        DataTypeToHtmlString(f.ReturnType, usingList) + \" \" + DataTypeToHtmlString(f.DeclaringType, usingList) + \".\" + f.Name + documentation;\n                }\n                else if (obj is Constructor)\n                {\n                    var c = obj as Constructor;\n\n                    string s = \"(\";\n                    foreach (var arg in c.Parameters)\n                    {\n                        if (arg != c.Parameters[0]) s += \", \";\n                        s += DataTypeToHtmlString(arg.Type, usingList) + \" \" + arg.Name;\n                        if (arg.OptionalDefault != null) s += \" = \" + SafeXml(arg.OptionalDefault.ToString());\n                    }\n                    s += \")\";\n\n                    var overloads = c.DeclaringType.Constructors.Count;\n                    if (overloads > 1)\n                        s += Color(\" <em>(+\" + (overloads - 1) + \" overloads)</em>\", \"gray\");\n\n                    return\n                        DataTypeToHtmlString(c.ReturnType, usingList) + \" \" + DataTypeToHtmlString(c.DeclaringType, usingList) + s + documentation;\n                }\n                else if (obj is Method)\n                {\n                    var m = obj as Method;\n\n                    string s = \"(\";\n                    foreach (var arg in m.Parameters)\n                    {\n                        if (arg != (m as Method).Parameters[0]) s += \", \";\n                        s += DataTypeToHtmlString(arg.Type, usingList) + \" \" + arg.Name;\n                        if (arg.OptionalDefault != null) s += \" = \" + SafeXml(arg.OptionalDefault.ToString());\n                    }\n                    s += \")\";\n\n                    var overloads = 0;\n                    var bt = m.DeclaringType;\n\n                    while (bt != null)\n                    {\n                        foreach (var om in bt.Methods)\n                            if (om.Name == m.Name)\n                                overloads++;\n\n                        bt = bt.Base;\n                    }\n\n                    if (overloads > 1)\n                        s += Color(\" <em>(+\" + (overloads - 1) + \" overloads)</em>\", \"gray\");\n\n                    return\n                        DataTypeToHtmlString(m.ReturnType, usingList) + \" \" + DataTypeToHtmlString(m.DeclaringType, usingList) + \".\" + SafeXml(m.Name) + s + documentation;\n                }\n                else if (obj is MetaProperty)\n                {\n                    return CreateHtmlHint(obj as MetaProperty, usingList, null);\n                }\n                else if (obj is FileEntity)\n                {\n                    return SafeXml((obj as FileEntity).Path) + \" <em>(external file)</em>\";\n                }\n                else if (obj is DirectoryEntity)\n                {\n                    return SafeXml((obj as FileEntity).Path) + \" <em>(external directory)</em>\";\n                }\n            }\n\n            if (obj == null) return null;\n\n            return documentation;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/GoToDefinition.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Core;\nusing Uno.Compiler.Core.Syntax.Binding;\nusing Uno.Compiler.Core.Syntax.Compilers;\nusing Uno.Compiler.Frontend.Analysis;\nusing Uno.Logging;\n\nnamespace Outracks.UnoDevelop.CodeNinja\n{\n    public static class GoToDefinition\n    {\n\t\tpublic static SourceObject TryGetSourceObject(Compiler compiler, Source src, IUnoCodeReader codeReader, ParseResult parseResult)\n        {\n            try\n            {\n                int start, length;\n                string memberExp;\n\t\t\t\treturn Compute(compiler, src, codeReader, parseResult, out start, out length, out memberExp);\n            }\n            catch (MaxErrorException)\n            {\n                return null;\n            }\n        }\n\n        public static SourceObject Compute(\n            Compiler compiler,\n            Source src,\n            IUnoCodeReader codeReader,\n            ParseResult parseResult,\n            out int rangeStart,\n            out int rangeLength,\n            out string memberExp)\n        {\n            var cc = new CodeCompleter.CodeCompleter(compiler, src, codeReader, codeReader.Offset, parseResult);\n            return Compute(src, codeReader, cc, out rangeStart, out rangeLength, out memberExp);\n        }\n\n        static SourceObject Compute(\n            Source src,\n            IUnoCodeReader codeReader,\n            CodeCompleter.CodeCompleter codeCompleter,\n            out int rangeStart,\n            out int rangeLength,\n            out string memberExp)\n        {\n            memberExp = \"\";\n            rangeStart = 0;\n            rangeLength = 0;\n            try\n            {\n                memberExp = FindMemberExpression(codeReader, out rangeStart, out rangeLength, codeCompleter);\n\n                if (memberExp == null || codeCompleter.Context.NodePath == null)\n                    return null;\n\n                var methodNode = codeCompleter.Context.NodePath.LastOrDefault(x => NodeTypeHelpers.IsMethodNode(x.Type));\n\n                var fc = codeCompleter.CreateFunctionCompiler(methodNode);\n                var pe = codeCompleter.ResolveStringInFunctionContext(methodNode, memberExp, src, fc);\n\n\t\t\t\tif ((pe == null || pe.IsInvalid) && fc.Namescope != null)\n\t\t\t\t{\n\t\t\t\t\tvar compute = ResolveStringWhenClassDeclaration(memberExp, fc);\n\t\t\t\t\tif (compute != null)\n\t\t\t\t\t\treturn compute;\n\t\t\t\t}\n\n\t            return ResolvePartialExpression(pe);\n            }\n            catch (Exception e)\n            {\n                if (e is MaxErrorException) throw;\n                return null;\n            }\n        }\n\n\t\tstatic SourceObject ResolveStringWhenClassDeclaration(string memberExp, FunctionCompiler fc)\n\t    {\n\t\t    var classScope = fc.Namescope as ClassType;\n\t\t\tif (classScope == null) return null;\n\n\t\t\tvar found = classScope.Properties.FirstOrDefault(property => property.Name == memberExp) as SourceObject;\n\t\t\tif (found != null)\n\t\t\t\treturn found;\n\n\t\t\tfound = classScope.Fields.FirstOrDefault(field => field.Name == memberExp);\n\t\t\tif (found != null)\n\t\t\t\treturn found;\n\n\t\t\tfound = classScope.Methods.FirstOrDefault(method => method.Name == memberExp);\n\t\t\tif (found != null)\n\t\t\t\treturn found;\n\n\t\t\treturn null;\n\t    }\n\n\t    public static SourceObject ResolvePartialExpression(PartialExpression pe)\n        {\n            if (pe == null) return null;\n\n            switch (pe.ExpressionType)\n            {\n                case PartialExpressionType.Namespace:\n                    return ((PartialNamespace)pe).Namespace;\n\n                case PartialExpressionType.Type:\n                    return ((PartialType)pe).Type;\n\n                case PartialExpressionType.Block:\n                    return ((PartialBlock)pe).Block;\n\n                case PartialExpressionType.Value:\n                    return ((PartialValue)pe).Value;\n\n                case PartialExpressionType.Variable:\n                    return ((PartialVariable)pe).Variable;\n\n                case PartialExpressionType.Parameter:\n                    {\n                        var pp = (pe as PartialParameter);\n\t\t\t\t\t\treturn pp.Function.Match(f => f.Parameters, l => l.Parameters)[pp.Index];\n                    }\n\n                case PartialExpressionType.Field:\n                    return ((PartialField)pe).Field;\n\n                case PartialExpressionType.Property:\n                    return ((PartialProperty)pe).Property;\n\n                case PartialExpressionType.Event:\n                    return ((PartialEvent)pe).Event;\n\n                case PartialExpressionType.Indexer:\n                    return ((PartialIndexer)pe).Indexer;\n\n                case PartialExpressionType.ArrayElement:\n                    return ((PartialArrayElement)pe).Object;\n\n                case PartialExpressionType.MethodGroup:\n                    // TODO: resolve overload based on argument list (if available) to resolve correct method;\n                    return ((PartialMethodGroup)pe).Methods[0];\n\n                default:\n                    return null;\n            }\n        }\n\n        public static string FindMemberExpression(\n            IUnoCodeReader codeReader,\n            out int rangeStart,\n            out int rangeLength,\n            CodeCompleter.CodeCompleter cc)\n        {\n            rangeStart = codeReader.Offset;\n            rangeLength = codeReader.Offset;\n\n            // Skip to end of identifier;\n            while (true)\n            {\n                var cs = codeReader.PeekText(1);\n                if (string.IsNullOrEmpty(cs)) return null;\n                var c = cs[0];\n                if (char.IsLetterOrDigit(c) || c == '_') codeReader.ReadText(1);\n                else break;\n            }\n            int rangeEnd = codeReader.Offset;\n\n            if (cc.Context.NodePath == null) return null;\n\n            TokenType tt;\n            var memberExp = cc.FindMemberExpression(out tt, false, false);\n\n            rangeStart = rangeEnd - memberExp.Length;\n            rangeLength = memberExp.Length;\n\n            return memberExp;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/Outracks.CodeCompletion.CodeNinja.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion.CodeNinja</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.CodeNinja</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"System.Net.Http\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Build\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Build.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Core\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Frontend\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Frontend.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.ProjectFormat\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.ProjectFormat.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.UX.Markup\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.UX.Markup.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AmbientParser\\Context.cs\" />\n    <Compile Include=\"AmbientParser\\ICodeReader.cs\" />\n    <Compile Include=\"AmbientParser\\IUnoCodeReader.cs\" />\n    <Compile Include=\"AmbientParser\\Node.cs\" />\n    <Compile Include=\"AmbientParser\\Parser.ClassBody.cs\" />\n    <Compile Include=\"AmbientParser\\Parser.cs\" />\n    <Compile Include=\"AmbientParser\\Parser.Root.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.DrawStatement.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.FunctionBody.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.MemberExpression.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.PeekHelpers.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.QuickWins.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.QuickWins.New.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.Suggest.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestBlock.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestFiles.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestImportAndApply.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestMembers.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestNodePathTypes.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestOverrides.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestTypes.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.SuggestUsing.cs\" />\n    <Compile Include=\"CodeCompleter\\CodeCompleter.TypeBody.cs\" />\n    <Compile Include=\"CodeNinjaBuild.cs\" />\n    <Compile Include=\"CodeReader.cs\" />\n    <Compile Include=\"DocumentationComment.cs\" />\n    <Compile Include=\"DocumentationHinter\\DocumentationCache.cs\" />\n    <Compile Include=\"DocumentationHinter\\DocumentationHinter.cs\" />\n    <Compile Include=\"DocumentationHinter\\DocumentationHinter.Helpers.cs\" />\n    <Compile Include=\"GoToDefinition.cs\" />\n    <Compile Include=\"ParameterInfoSuggester.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/ParameterInfoSuggester.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\nusing Uno.Compiler.Core;\nusing Uno.Compiler.Core.Syntax.Binding;\nusing Uno.Compiler.Frontend.Analysis;\n\nnamespace Outracks.UnoDevelop.CodeNinja\n{\n    public static class ParameterInfoSuggester\n    {\n        static void FindArgListStart(IUnoCodeReader codeReader, out int currentArgIndex)\n        {\n            int parenCount = 0;\n            currentArgIndex = 0;\n\n            while (true)\n            {\n                var c = codeReader.ReadTokenReverse();\n                switch (c)\n                {\n                    case TokenType.EndOfFile:\n                        return;\n\n                    case TokenType.LeftParen:\n                        if (parenCount == 0) return;\n                        parenCount--;\n                        break;\n\n                    case TokenType.RightParen:\n                        parenCount++;\n                        break;\n\n                    case TokenType.Comma:\n                        if (parenCount == 0) currentArgIndex++;\n                        break;\n                }\n            }\n        }\n\n        public static void Suggest(Compiler compiler, ParseResult parseResult, IUnoCodeReader codeReader, Source src, List<Function> pinfo, out int highlightArgument, out int range, out IEnumerable<string> usings)\n        {\n            highlightArgument = 0;\n            range = 0;\n\n            usings = new List<string>();\n\n            try\n            {\n                // Scan backwards to find function argument list start\n                var caret = codeReader.Offset;\n                FindArgListStart(codeReader, out highlightArgument);\n                range = caret - codeReader.Offset;\n\n\n                TokenType tt;\n                var cc = new CodeCompleter.CodeCompleter(compiler, src, codeReader, caret, parseResult);\n\n                var memberExp = cc.FindMemberExpression(out tt, false, false);\n\n                if (tt == TokenType.Import)\n                {\n                    memberExp += \"Importer\";\n                }\n                else if (memberExp == \"sample\")\n                {\n                    pinfo.Add(new Method(src, null, null, 0, \"sample\", compiler.ILFactory.Essentials.Float4, new[]\n                    {\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Texture2D, \"texture\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Float2, \"texCoord\", null),\n                    }, null));\n\n                    pinfo.Add(new Method(src, null, null,  0, \"sample\", compiler.ILFactory.Essentials.Float4, new[]\n                    {\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Texture2D, \"texture\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Float2, \"texCoord\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.SamplerState, \"samplerState\", null),\n                    }, null));\n\n                    pinfo.Add(new Method(src, null, null, 0, \"sample\", compiler.ILFactory.Essentials.Float4, new[]\n                    {\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.TextureCube, \"texture\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Float3, \"texCoord\", null),\n                    }, null));\n\n                    pinfo.Add(new Method(src, null, null, 0, \"sample\", compiler.ILFactory.Essentials.Float4, new[]\n                    {\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.TextureCube, \"texture\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Float3, \"texCoord\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.SamplerState, \"samplerState\", null),\n                    }, null));\n                }\n                else if (memberExp == \"vertex_attrib\")\n                {\n                    var gpt = new GenericParameterType(src, compiler.ILFactory.Essentials.Object, \"T\");\n                    var gptarray = compiler.TypeBuilder.GetArray(gpt);\n                    var ushortArray = compiler.TypeBuilder.GetArray(compiler.ILFactory.Essentials.UShort);\n\n                    pinfo.Add(new Method(src, null, null, 0, \"vertex_attrib\", gpt, new[]\n                    {\n                        new Parameter(src, null, 0, gptarray, \"vertexArray\", null)\n                    }, null));\n\n                    pinfo.Add(new Method(src, null, null, 0, \"vertex_attrib\", gpt, new[]\n                    {\n                        new Parameter(src, null, 0, gptarray, \"vertexArray\", null),\n                        new Parameter(src, null, 0, ushortArray, \"indexArray\", null),\n                    }, null));\n\n                    pinfo.Add(new Method(src, null, null, 0, \"vertex_attrib<T>\", gpt, new[]\n                    {\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.VertexAttributeType, \"vertexAttributeType\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.VertexBuffer, \"vertexBuffer\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Int, \"stride\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Int, \"offset\", null),\n                    }, null));\n\n                    pinfo.Add(new Method(src, null, null, 0, \"vertex_attrib<T>\", gpt, new[]\n                    {\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.VertexAttributeType, \"vertexAttributeType\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.VertexBuffer, \"vertexBuffer\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Int, \"stride\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.Int, \"offset\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.IndexType, \"indexType\", null),\n                        new Parameter(src, null, 0, compiler.ILFactory.Essentials.IndexBuffer, \"indexBuffer\", null),\n                    }, null));\n                }\n\n                usings = cc.Context.Usings;\n\n                if (cc.Context.NodePath == null || cc.Context.NodePath.Count == 0) return;\n\n                var pe = cc.ResolveStringInFunctionContext(cc.Context.NodePath.LastOrDefault(x => NodeTypeHelpers.IsMethodNode(x.Type)), memberExp, src);\n\n\n\n                if (pe != null)\n                {\n                    DataType dt = null;\n                    string methodName = null;\n\n                    if (pe.ExpressionType == PartialExpressionType.MethodGroup)\n                    {\n                        var mg = pe as PartialMethodGroup;\n\n                        if (mg.Object != null)\n                            dt = mg.Object.ReturnType;\n                        else\n                            dt = mg.Methods[0].DeclaringType;\n\n                        methodName = mg.Methods[0].Name;\n                    }\n                    else if (pe.ExpressionType == PartialExpressionType.Type)\n                    {\n                        var pdt = pe as PartialType;\n\n                        foreach (var c in pdt.Type.Constructors)\n                        {\n                            pinfo.Add(c);\n                        }\n                        return;\n                    }\n\n                    var hidden = new HashSet<Method>();\n\n                    while (dt != null)\n                    {\n                        foreach (var m in dt.Methods)\n                        {\n                            if (!hidden.Contains(m))\n                            {\n                                if (m.Name == methodName)\n                                {\n                                    pinfo.Add(m);\n                                }\n                            }\n                            if (m.OverriddenMethod != null)\n                                hidden.Add(m.OverriddenMethod);\n                        }\n\n                        dt = dt.Base;\n                    }\n                }\n            }\n            catch (Exception) {  }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeCompletion.CodeNinja\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/CodeReader.cs",
    "content": "﻿using Uno.Compiler;\nusing Uno.Compiler.Frontend.Parser;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\n\nnamespace Outracks.CodeNinja.Tests\n{\n    internal class CodeReader : ICodeReader\n    {\n        private readonly string _s;\n        private int _p;\n        private readonly Lexer.Token[] _tokens;\n\n        public CodeReader(string s, int caret)\n        {\n            _s = s;\n            _p = caret;\n            _tokens = Lexer.Lex(s, false, false, true);\n        }\n\n        private TokenType Token(bool peek, bool reverse = false)\n        {\n            for (int i = 0; i < _tokens.Length; i++)\n            {\n                Lexer.Token token = _tokens[i];\n                int ol = token.Offset + token.Length;\n\n                if (ol <= _p) continue;\n\n                if (reverse)\n                {\n                    if (i <= 0) return TokenType.StartOfFile;\n\n                    token = _tokens[i - 1];\n                    if (!peek)\n                        _p = token.Offset;\n                }\n                else\n                {\n                    if (!peek)\n                        _p = i < _tokens.Length - 1 ? ol : _s.Length - 1;\n                }\n                return token.Type;\n            }\n            return TokenType.EndOfFile;\n        }\n\n        public TokenType PeekTokenReverse()\n        {\n            return Token(true, true);\n        }\n\n        public TokenType ReadTokenReverse()\n        {\n            return Token(false, true);\n        }\n\n        public TokenType ReadToken()\n        {\n            return Token(false);\n        }\n\n        public TokenType PeekToken()\n        {\n            return Token(true);\n        }\n\n        public int Offset\n        {\n            get { return _p; }\n            set { _p = value; }\n        }\n\n        public string PeekTextReverse(int charCount)\n        {\n            return _s.Substring(_p - charCount, charCount);\n        }\n\n        public string ReadText(int charCount)\n        {\n            var r = _s.Substring(_p, charCount);\n            _p += charCount;\n            return r;\n        }\n\n        public string ReadTextReverse(int charCount)\n        {\n            _p -= charCount;\n            return _s.Substring(_p, charCount);\n        }\n\n        public string PeekText(int charCount)\n        {\n            return _s.Substring(_p, charCount);\n        }\n\n        public int Length\n        {\n            get { return _s.Length; }\n        }\n    }\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/DummyEngine.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.CodeCompletion;\nusing Outracks.IO;\nusing Uno.Compiler;\nusing Uno.Compiler.Core;\n\nnamespace Outracks.CodeNinja.Tests\n{\n    public class DummyEngine : IEngine\n    {\n        readonly Compiler _compiler;\n        public Compiler Compiler { get { return _compiler; } }\n\t    public SourcePackage MainPackage { get; private set; }\n\t    public void Invalidate() {}\n\t    public IEnumerable<AbsoluteFilePath> AllSourceFiles { get; private set; }\n\n        public DummyEngine(Compiler compiler)\n        {\n            _compiler = compiler;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Loggers/ConsoleLogger.cs",
    "content": "﻿using System;\n\nnamespace Outracks.CodeNinja.Tests.Loggers\n{\n    public class ConsoleLogger : ILogger\n    {\n        private readonly bool _onlyShowFailedTests;\n        private ConsoleColor _originalColor = Console.ForegroundColor;\n\n        public ConsoleLogger(bool onlyShowFailedTests)\n        {\n            _onlyShowFailedTests = onlyShowFailedTests;\n        }\n        public void TestStarted(int count, string displayName)\n        {\n            _originalColor = Console.ForegroundColor;\n            Console.Write(count.ToString(\"000: \") + displayName + \": \");\n        }\n\n        public void TestPassed(string displayName)\n        {\n            if (_onlyShowFailedTests)\n            {\n                var cursorTop = Console.CursorTop;\n                Console.SetCursorPosition(0, cursorTop);\n                for (int i = 0; i < Console.WindowWidth; i++)\n                    Console.Write(\" \");\n                Console.SetCursorPosition(0, cursorTop);\n            }\n            else\n            {\n                Console.ForegroundColor = ConsoleColor.Green;\n                Console.WriteLine(\"PASSED\");\n            }\n            Console.ForegroundColor = _originalColor;\n        }\n\n        public void TestFailed(string displayName, Exception e)\n        {\n            Console.ForegroundColor = ConsoleColor.Red;\n            Console.Write(\"FAILED \");\n            Console.ForegroundColor = ConsoleColor.DarkRed;\n            Console.WriteLine(\"(\" + e.Message + \")\");\n            Console.ForegroundColor = _originalColor;\n        }\n\n        public void LogMessage(string message)\n        {\n            Console.WriteLine(message);\n        }\n    }\n\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Loggers/ILogger.cs",
    "content": "﻿using System;\n\nnamespace Outracks.CodeNinja.Tests.Loggers\n{\n    public interface ILogger\n    {\n        void TestStarted(int count, string displayName);\n        void TestPassed(string displayName);\n        void TestFailed(string displayName, Exception e);\n        void LogMessage(string message);\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Loggers/TeamCityLogger.cs",
    "content": "﻿using System;\n\nnamespace Outracks.CodeNinja.Tests.Loggers\n{\n    public class TeamCityLogger : ILogger\n    {\n        public void TestStarted(int count, string displayName)\n        {\n            Write(\"testStarted name='{0}'\", displayName);\n        }\n\n        public void TestPassed(string displayName)\n        {\n            Write(\"testFinished name='{0}'\", displayName);\n        }\n\n        public void TestFailed(string displayName, Exception e)\n        {\n            Write(\"testFailed name='{0}' details='{1}'\", displayName, e.Message);\n        }\n\n        public void LogMessage(string message)\n        {\n            Write(message);\n        }\n\n        private static void Write(string formatString, params object[] objects)\n        {\n            Write(String.Format(formatString, objects));\n        }\n\n        private static void Write(string message)\n        {\n            Console.WriteLine(\"##teamcity[\" + message + \"]\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Outracks.CodeCompletion.CodeNinja.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{2615DA34-B3AC-4ADC-A005-E947851E201F}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion.CodeNinja.Tests</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.CodeNinja.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Core\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.ProjectFormat\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.ProjectFormat.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"DummyEngine.cs\" />\n    <Compile Include=\"Loggers\\ConsoleLogger.cs\" />\n    <Compile Include=\"Loggers\\ILogger.cs\" />\n    <Compile Include=\"Loggers\\TeamCityLogger.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Tests\\Arrays.cs\">\n      <SubType>Code</SubType>\n    </Compile>\n    <Compile Include=\"Tests\\ClassBody.cs\" />\n    <Compile Include=\"Tests\\ClassBody2.cs\" />\n    <Compile Include=\"Test.cs\" />\n    <Compile Include=\"Tests\\ClassBody3.cs\" />\n    <Compile Include=\"Tests\\ClassBody4.cs\" />\n    <Compile Include=\"Tests\\ClassBody5.cs\" />\n    <Compile Include=\"Tests\\ClassBody6.cs\" />\n    <Compile Include=\"Tests\\ClassBody7.cs\" />\n    <Compile Include=\"Tests\\ClassBody8.cs\" />\n    <Compile Include=\"Tests\\Comments.cs\" />\n    <Compile Include=\"Tests\\CompileErrors.cs\" />\n    <Compile Include=\"Tests\\Context.cs\" />\n    <Compile Include=\"Tests\\Delegate.cs\" />\n    <Compile Include=\"Tests\\DemoTest.cs\" />\n    <Compile Include=\"Tests\\DrawScope.cs\" />\n    <Compile Include=\"Tests\\EnumTest.cs\" />\n    <Compile Include=\"Tests\\Event.cs\" />\n    <Compile Include=\"Tests\\ExtensionTypeMethod.cs\" />\n    <Compile Include=\"Tests\\Floats.cs\" />\n    <Compile Include=\"Tests\\GDC.cs\" />\n    <Compile Include=\"Tests\\GenericsTest.cs\" />\n    <Compile Include=\"Tests\\GetSet.cs\" />\n    <Compile Include=\"Tests\\ImportAndApply.cs\" />\n    <Compile Include=\"Tests\\Interface.cs\" />\n    <Compile Include=\"Tests\\iterator.cs\" />\n    <Compile Include=\"Tests\\Jonny1.cs\" />\n    <Compile Include=\"Tests\\Keywords.cs\" />\n    <Compile Include=\"Tests\\KrissTests3.cs\" />\n    <Compile Include=\"Tests\\KristianTests.cs\" />\n    <Compile Include=\"Tests\\KristianTests2.cs\" />\n    <Compile Include=\"Tests\\List.cs\" />\n    <Compile Include=\"Tests\\Locals.cs\" />\n    <Compile Include=\"Tests\\loops.cs\" />\n    <Compile Include=\"Tests\\MetaProperties.cs\" />\n    <Compile Include=\"Tests\\MethodBody.cs\" />\n    <Compile Include=\"Tests\\MethodBody2.cs\" />\n    <Compile Include=\"Tests\\MethodBody3.cs\" />\n    <Compile Include=\"Tests\\MethodBody4.cs\" />\n    <Compile Include=\"Tests\\MethodBody5.cs\" />\n    <Compile Include=\"Tests\\MethodBody6.cs\" />\n    <Compile Include=\"Tests\\MethodBody7.cs\" />\n    <Compile Include=\"Tests\\MethodReturn.cs\" />\n    <Compile Include=\"Tests\\MethodVariables.cs\" />\n    <Compile Include=\"Tests\\NewTest.cs\" />\n    <Compile Include=\"Tests\\NoHintScenarios.cs\" />\n    <Compile Include=\"Tests\\Numbers.cs\" />\n    <Compile Include=\"Tests\\Override.cs\" />\n    <Compile Include=\"Tests\\PrivateMembers.cs\" />\n    <Compile Include=\"Tests\\StaticMemberAccess.cs\" />\n    <Compile Include=\"Tests\\SwitchCase.cs\" />\n    <Compile Include=\"Tests\\SwizzlerTypes.cs\" />\n    <Compile Include=\"Tests\\TryCatch.cs\" />\n    <Compile Include=\"Tests\\Using_.cs\" />\n    <Compile Include=\"Tests\\Using_Static.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.5\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeNinja.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Test.cs",
    "content": "﻿using System;\nusing System.Runtime.CompilerServices;\nusing Uno;\nusing Uno.ProjectFormat;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class TestException : Exception\n    {\n        public TestException(string message) : base(message)\n        {\n        }\n    }\n\n    public abstract class Test\n    {\n\t    static Project _project;\n\n        static Test()\n        {\n\t\t\t_project = new Project(\"Test\");\n\n            //_solution = Solution.Create(new FilePath(\"Tests/Tests.unosln\"));\n\n            //var proj = Project.Load(new FilePath(\"Tests/Tests.unoproj\"));\n            //proj.OnCreate();\n\n            //_solution.Children.Add(proj);\n            //_solution.StartupProject = proj;\n\n\t\t\t_project.MutablePackageReferences.Add(new PackageReference(Source.Unknown, \"UnoCore\"));\n\t\t\t/*_project.PackageReferences.Add(new PackageReference(\"FuseCore\"));\n\t\t\t_project.PackageReferences.Add(new PackageReference(\"Fuse.Animations\"));\n\t\t\t_project.PackageReferences.Add(new PackageReference(\"Fuse.Drawing\"));\n\t\t\t_project.PackageReferences.Add(new PackageReference(\"Fuse.Drawing.Primitives\"));\n\t\t\t_project.PackageReferences.Add(new PackageReference(\"Fuse.Entities\"));\n\t\t\t_project.PackageReferences.Add(new PackageReference(\"Fuse.Elements\"));\n\t\t\t_project.PackageReferences.Add(new PackageReference(\"Fuse.Controls\"));*/\n\n\t\t}\n\n\t    protected void AssertCode(string code, [CallerMemberName] string path = \"\")\n\t    {\n\t    }\n#if false\n        DummyLogger _log;\n\n        protected void AssertCode(string code, [CallerMemberName] string path = \"\")\n        {\n            int caret = 0;\n            var assertCodeSnippets = GetAsserts(ref code, ref caret);\n\n\t        var ubProject = _project;\n\n\t        var filePath = AbsoluteDirectoryPath.Parse(Directory.GetCurrentDirectory()) / new FileName(path);\n\t\t\t_log = new DummyLogger();\n            var editors = new DummyEditorManager();\n\t        var mainPackage = new PackageCache(new Log(_log.TextWriter), ubProject.Config).GetPackage(ubProject);\n\t\t\tmainPackage.SetCacheDirectory((AbsoluteDirectoryPath.Parse(mainPackage.CacheDirectory) / new DirectoryName(\"CodeCompletion\")).NativePath);\n            var build = new CodeNinjaBuild(_log, ubProject, editors, mainPackage, mainPackage.References.ToList(), code, filePath);\n\n            build.Execute();\n\n            var engine = new DummyEngine(build.Compiler);\n            var codeCompleter = new CodeCompleter(engine.Compiler,\n\t\t\t\tnew Source(build.ProjectPackage, filePath.NativePath),\n                new CodeReader(code, caret),\n                caret,\n                Parser.Parse(code));\n\n            if (codeCompleter.Context.NodePath.Count < 1)\n            {\n                throw new TestException(\"Invalid node path was generated for the test case\");\n            }\n\n            ConfidenceLevel confidenceLevel;\n            var suggestions = codeCompleter.SuggestCompletion(\"\", out confidenceLevel);\n\n            if (assertCodeSnippets != null)\n            {\n                foreach (var codeSnippet in assertCodeSnippets)\n                    OnAssert(code, codeSnippet, suggestions);\n            }\n\n        }\n\n        static IEnumerable<string> GetAsserts(ref string code, ref int caret)\n        {\n            string[] items = null;\n            while (code.Contains('$'))\n            {\n                caret = code.IndexOf('$');\n                int e = code.IndexOf(')', caret);\n\n                string macro = code.Substring(caret + 2, e - caret - 2);\n                code = code.Substring(0, caret) + \";\" + code.Substring(e + 1, code.Length - e - 1);\n\n                items = macro.Split(',');\n                for (int k = 0; k < items.Length; k++)\n                    items[k] = items[k].Trim();\n            }\n            return items;\n        }\n\n        void OnAssert(string sourceCode, string code, IEnumerable<SuggestItem> suggestions)\n        {\n            bool testIsInverted = false;\n            if (code.Contains('!'))\n            {\n                testIsInverted = true;\n                code = code.Trim('!');\n            }\n\n            bool found = suggestions.Any(suggestion => suggestion.Text == code);\n\n            string expression = string.Format(\"{0} should {2}be among [{1}]\",\n                                              code,\n                                              string.Join(\",\", suggestions.Select(x => x.Text)),\n                                              testIsInverted ? \"not \" : \"\");\n\n            bool leftHandValue = !testIsInverted; // expected\n            bool rightHandValue = found; // actual\n            bool result = testIsInverted ^ found;\n\n            if (!result)\n            {\n                throw new TestException(expression + \"\\n\\n Compiler log: \" + _log.sb.ToString() + \"\\n\\nSource code:\\n\" + sourceCode);\n                //Assert.True(result, expression);\n            }\n        }\n#endif\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Arrays.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Arrays : Test\n\t{\n\t\t[Test]\n\t\tpublic void Arrays00()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo: Uno.Application\n{\n\tpublic Foo()\n\t{\n\t\tvar k = new int[100];\n\t\tk[0].$(Equals, !Length);\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Arrays01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tpublic Foo()\n\t{\n\t\tvar k = new int[100];\n\t\tk.$(Equals, Length);\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Arrays02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tpublic int somenum;\n\tprivate int anothernum;\n}\nclass c\n{\n\tc()\n\t{\n\t\tvar arr = new b[100];\n\t\tarr[0].$(somenum,!anothernum)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Arrays03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tint numA;\n\tstatic int numC;\n\tclass c\n\t{\n\t\tint numB;\n\t\tclass d\n\t\t{\n\t\t\t$(!numA,!numB,numC)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Arrays04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tint numA;\n\tstatic int numC;\n\tclass c\n\t{\n\t\tint numB;\n\t\tclass d\n\t\t{\n\t\t\tvoid Foo()\n\t\t\t{\n\t\t\t\tvar k = new b();\n\n\t\t\t\tk.$(numA,!numB,!numC)\n\t\t\t}\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody : Test\n\t{\n\t\tpublic void ClassBody00()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\nusing Fuse;\n\nnamespace StandardLib.UI\n{\n\tclass PointerEventTest\n\t{\n\t\tclass SomeClass\n\t\t{\n\t\t\tpublic event $(PointerEventArgs)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b<T>\n{\n\tpublic static int Tx;\n\n\tpublic void Foo()\n\t{\n\t\tb<T>.$(!Uno, Tx)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Fuse.Drawing.Primitives;\n\nnamespace RenderingTests\n{\n\tpublic static class Verifier\n\t{\n\t\tpublic static extern bool Verify(string testName);\n\t}\n\n\tclass Main : Uno.Application\n\t{\n\t\tframebuffer f = new framebuffer(int2(128, 128), Uno.Graphics.$(Format)\n\n\t\tpublic override void Draw()\n\t\t{\n\t\t\tdraw Quad\n\t\t\t{\n\t\t\t\tPixelColor : float4(1, 0, 0, 1);\n\t\t\t};\n\n\t\t\tVerifier.Verify(\"\"foobar\"\");\n\n\t\t}\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n        [Test]\n        public void ClassBody03()\n        {\n            AssertCode(\n@\"\n\nclass b<T>\n{\n\tpublic static int Tx;\n\n\tpublic void Foo()\n\t{\n\t\tb<int>.Tx.$(ToString, !T)\n\t}\n}\n\n\"\n            );\n        }\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody2.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody2 : Test\n\t{\n\t\t[Test]\n\t\tpublic void ClassBody200()\n\t\t{\n\t\t\tAssertCode(\n@\"﻿public class A : Uno.Application\n{\n\tpublic void F() {}\n}\n\npublic class B\n{\n\tpublic void C()\n\t{\n\t\t$(!F)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody201()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A  : Uno.Application\n{\n\tpublic void F() {}\n}\n\npublic class B\n{\n\t$(!F)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody202()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A : Uno.Application\n{\n\tpublic framebuffer f = new framebuffer(int2(100, 100), Uno.Graphics.Format.RGBA_8_8_8_8_UInt_Normalize, true);\n\n\tpublic void F()\n\t{\n\t\tthis.F().$(!f)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody203()\n\t\t{\n\t\t\tAssertCode(\n@\"\npublic class a : Uno.Application{}\n\npublic class C<T>: Uno.Collections.List<T>\n{\n\t$(Uno)\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody3.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody3 : Test\n\t{\n\t\t[Test]\n\t\tpublic void ClassBody300()\n\t\t{\n\t\t\tAssertCode(\n@\"public class C<T>\n{\n\tT[] foo;\n\t$(Uno)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody301()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class Foo<T>\n{\n\tT[] data = new T[100];\n\n\tpublic T this[int index]\n    {\n        get { return data[index]; }\n        set { data[index] = value; }\n    }\n\n\t$(Uno)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody302()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\ndrawable class Bart\n{\n\tmeta int foo;\n\ttexture2D moo: import \"\"boo.png\"\";\n\t$(Uno)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody303()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\nclass Foo: Uno.Application\n{\n\tpublic Foo(): base(\"\"asd\"\") {}\n\n\t$(Uno)\n\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody4.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody4 : Test\n\t{\n\t\t[Test]\n\t\tpublic void ClassBody400()\n\t\t{\n\t\t\tAssertCode(\n@\"public class b\n{\n\tpublic $(class)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody401()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tprivate $(class)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody402()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tprivate class c\n\t{\n\t\t$(b,c)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody403()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tprivate class c\n\t{\n\t\tpublic class d\n\t\t{\n\t\t\t$(b,c,d)\n\t\t}\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody5.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody5 : Test\n\t{\n\t\t[Test]\n\t\tpublic void ClassBody500()\n\t\t{\n\t\t\tAssertCode(\n@\"public class b\n{\n\tpublic class c\n\t{\n\t\t$(b,c)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody501()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tpublic class c\n\t{\n\t\tpublic class d\n\t\t{\n\t\t\t$(b,c,d)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody502()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tpublic class c\n\t{\n\n\t}\n}\npublic class d\n{\n\t$(!c)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody503()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tpublic class c\n\t{\n\n\t}\n}\npublic class d\n{\n\tpublic class e : $(b,d,!e)\n\t{\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody6.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody6 : Test\n\t{\n\t\t[Test]\n\t\tpublic void ClassBody600()\n\t\t{\n\t\t\tAssertCode(\n@\"public class b\n{\n\tpublic class c\n\t{\n\n\t}\n}\npublic class d\n{\n\tpublic class e : b.$(c, !d, !e)\n\t{\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody601()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tpublic int abc;\n\tprivate int efg;\n\tprotected int hij;\n}\nclass c : b\n{\n\tc()\n\t{\n\t\t$(abc,hij,!efg)\n\t}\n\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody602()\n\t\t{\n\t\t\tAssertCode(\n@\"\nclass b\n{\n\tpublic int abc;\n\tprivate int efg;\n\tprotected int hij;\n}\nclass c\n{\n\tb test;\n\tc()\n\t{\n\t\t test.$(abc,!efg,!hij)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody603()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tp$(private,public,protected)\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody7.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody7 : Test\n\t{\n\t\t[Test]\n\t\tpublic void ClassBody700()\n\t\t{\n\t\t\tAssertCode(\n@\"abstract class b\n{\n\t$(abstract)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody701()\n\t\t{\n\t\t\tAssertCode(\n@\"\nabstract class b\n{\n\tpublic abstract void somemethod();\n\tpublic virtual void someothermethod()\n\t{\n\t}\n}\nabstract class c : b\n{\n\n}\n\nclass d : $(b,c)\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody702()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\t$(class)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody703()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\tpublic void Derp()\n\t{\n\t\t$(!class)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody704()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class Foo<T>\n{\n\tT[] data = new $(T)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody705()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class Foo<T>\n{\n\tT[] data = new$(!T)\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ClassBody8.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ClassBody8 : Test\n\t{\n\t\t[Test]\n\t\tpublic void ClassBody800()\n\t\t{\n\t\t\tAssertCode(\n@\"public class Foo\n{\n\tUno.Exception ex = new Uno.$(Exception)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassBody801()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\npublic class Foo\n{\n\tException ex = new $(Exception)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t    [Test]\n\t    public void ClassBody802()\n\t    {\n\t\t    AssertCode(\n\t\t\t    @\"\n\nusing Uno;\nusing Fuse;\n\nnamespace StandardLib.UI\n{\n\tclass PointerEventTest : Test\n\t{\n\t\tclass SomeClass\n\t\t{\n\t\t\tpublic $(event)\n\t\t}\n\n\t\tpublic PointerEventTest()\n\t\t\t: base(\"\"PointerEventTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new PointerEventArgs(float2(1.0f, 2.0f), PointerEventType.Click);\n\t\t\tassert(a is PointerEventArgs);\n\t\t\tassert(a is EventArgs);\n\t\t\tassert(compare(a.Position, float2(1.0f, 2.0f)));\n\t\t\tassert(a.Type == PointerEventType.Click);\n\t\t\tassert(compare(a.WorldPosition, float3(0.0f)));\n\t\t\tassert(!a.Handled);\n\t\t}\n\t}\n}\n\");\n\t    }\n\n\t    [Test]\n\t    public void ClassBody803()\n\t    {\n\t\t    AssertCode(\n\t\t\t\t@\"\nusing Uno;\n\nnamespace Fuse.Gestures\n{\n\tclass ClickedArgs\n\t{\n\t\tpublic bool IsHandled()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n}\n\npublic partial class MainView\n{\n\tvoid ButtonClicked(object sender, Fuse.Gestures.ClickedArgs args)\n\t{\n\t\targs.$(IsHandled)\n\t}\n}\n\");\n\t    }\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Comments.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Comments : Test\n\t{\n\t\t[Test]\n\t\tpublic void Comments00()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo\n{\n\tvoid Bar()\n\t{\n\t\tUno.$(Array)\n\t\t// hello\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Comments01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Unol\n{\n    public class List<T>\n    {\n        T[] data;\n        int used;\n        /*\n        class Enumerator: IEnumerator<T>\n        {\n            List<T> list;\n            int pos = -1;\n            public Enumerator(List<T> list)\n            {\n                this.list = list;\n            }\n            public bool MoveNext()\n            {\n                pos++;\n                return pos < list.Count;\n            }\n            public T Current { get { return list[pos]; } }\n        }\n\n        public IEnumerator<T> GetEnumerator() { return new Enumerator(this); }\n        */\n        public List()\n        {\n            data = null;\n            used = 0;\n        }\n\n        public T[] ToArray()\n        {\n            var t = new T[used];\n            for (int i = 0; i < used; i++) t[i] = data[i];\n            return t;\n        }\n\n        void ensureCapacity()\n        {\n            if (data == null)\n            {\n                data = new T[2];\n            }\n            else if (used + 1 == data.Length)\n            {\n                var newData = new T[data.Length * 2];\n\n                for (int i = 0; i < used; i++)\n                {\n                    newData[i] = data[i];\n                }\n\n                data = newData;\n            }\n        }\n\n        public int Count\n        {\n            get { return used; }\n        }\n\n        public void Add(T item)\n        {\n            ensureCapacity();\n            data[used++] = item;\n        }\n\n        public void Insert(int index, T item)\n        {\n            ensureCapacity();\n            for (int i = used; i >= index; i--)\n            {\n                data[i + 1] = data[i];\n            }\n            data[index] = item;\n            used++;\n        }\n\n        public void Remove(T item)\n        {\n            for (int i = 0; i < used; i++)\n            {\n                if (data[i] == item)\n                {\n                    RemoveAt(i);\n                    return;\n                }\n            }\n            throw new Exception(\"\"List does not contain the given item\"\");\n        }\n\n        public void RemoveAt(int index)\n        {\n            for (int i = index; i < used - 1; i++)\n            {\n                data[i] = data[i + 1];\n            }\n            used = used - 1;\n        }\n\n        public void Clear()\n        {\n            used = 0;\n        }\n\n        public bool Contains(T item)\n        {\n            for (int i = 0; i < used; i++)\n            {\n                if (data[i] == item) return true;\n            }\n            return false;\n        }\n\n\t\tpublic void Sort(Comparison<T> comparer)\n        {\n\t\t\tUno.$(Array)\n            //Array.(data, compaer, 0, used);\n        }\n\n        public T this[int index]\n        {\n            get { return data[index]; }\n            set { data[index] = value; }\n        }\n\n\n\n    }\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/CompileErrors.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class CompileErrors : Test\n    {\n        [Test]\n        public void CompileErrors01()\n        {\n            AssertCode(@\"\nclass Foo\n{\n    int fieldTest;\n    void Draw()\n    {\n        int lol = $(fieldTest)\n    }\n}\n            \");\n        }\n\n        [Test]\n        public void CompileErrors02()\n        {\n            AssertCode(@\"\nclass Foo\n{\n    void Draw()\n    {\n        int lol = $(fieldTest)\n    }\n    int fieldTest;\n}\n            \");\n        }\n\n        [Test]\n        public void CompileErrors03()\n        {\n            AssertCode(@\"\nclass Foo\n{\n    void Draw()\n    {\n        bool foo = true;\n        int lol = $(fieldTest)\n    }\n    int fieldTest;\n}\n            \");\n        }\n\n        [Test]\n        public void CompileErrors04()\n        {\n            AssertCode(@\"\nclass Foo\n{\n    void Draw()\n    {\n        draw\n        {\n            $(fieldTest)\n        }\n    }\n    int fieldTest;\n}\n            \");\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Context.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Context : Test\n\t{\n\t\t[Test]\n\t\tpublic void Context00()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno.Collections;\n\nclass a : Uno.Application{}\n\ndrawable class BoardRenderer\n{\n\tpublic const int MaxVertices = 15000;\n\n\tfloat2[] vertices = new float2[MaxVertices];\n\tfloat2[] tcs = new float2[MaxVertices];\n\tfloat3[] DasColor = new float3[MaxVertices];\n\tfloat3[] PlayerOwn = new float3[MaxVertices];\n\tfloat[] Armies = new float[MaxVertices];\n\tfloat2[] SeaLines = new float2[250];\n\n\tmeta int VertexCount;\n\tmeta int TexCount;\n\n\tpublic void BuildBoard(List<float3> tiles,List<float2> lines)\n\t{\n\t\tint c = 0;\n\t\tfor (int i = 0; i < tiles.Count; i++)\n\t\t{\n\t\t\tvar t = tiles[i];\n\t\t\tvertices[c+1] = float2(t.X + t.X, t.Y);\n\t\t\tvertices[c+2] = float2(t.X + t.X, t.Y);\n\n\t\t\tvertices[c+4] = float2(t.X + t.X, t.Y + t.X);\n\t\t\tvertices[c+5] = float2(t.X, t.Y + t.Y);\n\n\t\t\ttcs[c+0] = float2(0,0);\n\t\t\ttcs[c+1] = float2(1,0);\n\t\t\ttcs[c+2] = float2(1,1);\n\t\t\ttcs[c+3] = float2(0,0);\n\t\t\ttcs[c+4] = float2(1,1);\n\t\t\ttcs[c+5] = float2(0,1);\n\t\t\tc += 6;\n\t\t}\n\n\n\t\t$(int,float,double,bool,!public,!private,!class);\n\t}\n\n\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Delegate.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Delegate : Test\n\t{\n\t\t[Test]\n\t\tpublic void Delegate00()\n\t\t{\n\t\t\tAssertCode(\n@\"class b\n{\n\tstatic int theInt = 0;\n\tpublic void addAnInt(int a)\n\t{\n\t\ttheInt += a;\n\t}\n\tpublic void subtractAnInt(int a)\n\t{\n\t\ttheInt -= a;\n\t}\n\tdelegate void voidDelegate(int i);\n\tpublic void derp()\n\t{\n\t\t$(voidDelegate)\n\t\tvoidDelegate del1,del2,del3;\n\n\t}\n\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Delegate01()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\n\nclass b\n{\n\tstatic int theInt = 0;\n\tpublic void addAnInt(int a)\n\t{\n\t\ttheInt += a;\n\t}\n\tpublic void subtractAnInt(int a)\n\t{\n\t\ttheInt -= a;\n\t}\n\tdelegate void voidDelegate(int i);\n\tpublic void derp()\n\t{\n\t\tvoidDelegate del1,del2,del3;\n\n\t\tdel1 = addAnInt;\n\t\tdel2 = subtractAnInt;\n\t\tdel3 = (voidDelegate)Delegate.$(Combine,Remove)\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Delegate02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tstatic int theInt = 0;\n\tpublic void addAnInt(int a)\n\t{\n\t\ttheInt += a;\n\t}\n\tpublic void subtractAnInt(int a)\n\t{\n\t\ttheInt -= a;\n\t}\n\tdelegate void voidDelegate(int i);\n\tpublic void derp()\n\t{\n\t\tvoidDelegate del1,del2,del3;\n\n\t\tdel1 = addAnInt;\n\t\tdel2 = subtractAnInt;\n\t\tdel3 = (voidDelegate)Delegate.Combine(del1,del2);\n\t\t$(del1,del2,del3)\n\t}\n\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/DemoTest.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class DemoTest : Test\n\t{\n\t\tpublic void DemoTest00()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\nusing Fuse.Entities;\n\npublic class Landscape : Entit$(Uno,Entity)\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void DemoTest01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Fuse.Entities;\nusing Uno.Geometry;\n\npublic class Landscape : Fuse.Entity\n{\n\n\tapply $(DefaultShading)\n\n\tpublic Landscape()\n\t{\n\t\tCollider = new BoxCollider(Box(float3(10.0f,0.0f,10.0f),float3(-10.0f,0.0f,-10.0f)));\n\t}\n\n\tTransform: this.Transform;\n}\n\n\"\n\t\t\t);\n\t\t}\n\n        /*[Test]\n        public void DemoTest02()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\n\nusing Uno.Geometry;\n\npublic class Landscape : Entity\n{\n\n    apply DefaultShading;\n\n    public Landscape()\n    {\n        Collider = new BoxCollider(Box(float3(10.0f,0.0f,10.0f),float3(-10.0f,0.0f,-10.0f)));\n    }\n\n    Transform: this.Transform;\n    Camera: Context.$(Camera)\n\n    public override void OnDraw(Fuse.Entities.RenderingPass pass)\n    {\n        draw;\n    }\n\n}\n\n\"\n            );\n        }*/\n\n        [Test]\n\t\tpublic void DemoTest03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Fuse;\nusing Fuse.Entities;\nusing Uno.Geometry;\n\npublic class Landscape : Entity\n{\n\n\tapply DefaultShading;\n\n\n\tstatic int gridx = 100;\n\tstatic int gridz = 100;\n\tstatic int numCells = gridx * gridz;\n\tstatic float trisize = 50.0f / (float)gridz;\n\n\tprotected float2[] verts = new Float2[numCells * 3 * 2];//2 tri per cell, 3 vert per tri\n\n\tpublic Landscape()\n\t{\n\t\tCollider = new BoxCollider(Box(float3(10.0f,0.0f,10.0f),float3(-10.0f,0.0f,-10.0f)));\n\n\t\tint currentindex = 0;\n\t\tfor(int z=0; z < gridz;z++)\n\t\t{\n\t\t\tfloat z1 = (float)z / (float)gridz;\n\t\t\tfloat z2 = ((float)z +1.0f) / (float)gridz;\n\n\t\t\tfor(int x=0;x<gridx;x++)\n\t\t\t{\n\t\t\t\tfloat x1 = (float)x / (float)gridx;\n\t\t\t\tfloat x2 = ((float)x +1.0f) / (float)gridx;\n\n\t\t\t\tverts[currentindex + 0] = float2(x1,z1);\n\t\t\t\tverts[currentindex + 1] = float2(x1,z2);\n\t\t\t\tverts[currentindex + 2] = float2(x2,z1);\n\n\t\t\t\tverts[currentindex + 3] = float2(x2,z1);\n\t\t\t\tverts[currentindex + 4] = float2(x1,z2);\n\t\t\t\tverts[currentindex + 5] = float2(x2,z2);\n\t\t\t}\n\t\t}\n\t}\n\n\tTransform: this.Transform;\n\tCamera: Camera.Current;\n\n\tfloat2 Vert: $(vertex_attrib)\n\n\tpublic override void OnDraw(RenderingPass pass)\n\t{\n\t\tdraw\n\t\t{\n\n\t\t};\n\n\t}\n\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/DrawScope.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class DrawScope : Test\n\t{\n\t\t[Test]\n\t\tpublic void DrawScope00()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo: Uno.Application\n{\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\t$(drawable, Bar, ClipPosition)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tapply $(Uno)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\t$(apply)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void DrawScope03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.$(DefaultShading)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void DrawScope04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\t$(drawable, Bar, DiffuseColor)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\t$(ClipPosition, PixelColor, BlendSrc)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope06()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\tPrimitiveType: Uno.Graphics.PrimitiveType.$(Triangles,!DiffuseColor,!Uno)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope07()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\ndrawable class Bar: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\n\t\tfor (int i = 0; i < 10; i++) draw Sphere, $(Uno) { Position : float3(i, 0, 0); };\n\n\t\tdraw\n\t\t{\n\n\n\t\t};\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope08()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\tPixelColor: $(sample)\n\t\t};\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void DrawScope09()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\n\nnamespace BaseTest\n{\n    class App : Uno.Application\n    {\n        public override void Draw()\n        {\n\t\t\tdraw Sphere\n\t\t\t{\n\t\t\t\tapply DefaultShading;\n\n\t\t\t\t$(Time)\n\t\t\t}\n        }\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope10()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\n\nnamespace BaseTest\n{\n    class App : Uno.Application\n    {\n\t\tblock Derp\n\t\t{\n\t\t\tfloat3 Herp: float3(2.0f);\n\t\t\t$(Herp)\n\t\t}\n\n        public override void Draw()\n        {\n\t\t\tdraw Sphere\n\t\t\t{\n\t\t\t\tapply DefaultShading;\n\n\t\t\t}\n        }\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DrawScope11()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\n\nnamespace BaseTest\n{\n    class App : Uno.Application\n    {\n\t\tblock Derp\n\t\t{\n\t\t\tfloat3 Herp: float3(2.0f);\n\n\t\t}\n\n        public override void Draw()\n        {\n\t\t\tdraw Sphere\n\t\t\t{\n\t\t\t\tapply DefaultShading;\n\t\t\t\tfloat3 Color: float3(2.0f);\n\t\t\t\t$(Color)\n\t\t\t}\n        }\n    }\n}\"\n            );\n\t\t}\n\n        [Test]\n        public void DrawScope12()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\nusing Uno.Math;\n\nclass App : Uno.Application\n{\n\tblock Test : $(DefaultShading)\n\t{\n\t}\n\n\tpublic override void Draw()\n\t{\n\t\tdraw $(DefaultShading) Cube\n\t\t{\n\t\t\tPixelColor: float4($(Sin)(0.5f), 0.5f, 0.0f, 1);\n\t\t};\n\t}\n}\"\n            );\n        }\n        [Test]\n        public void DrawScope13()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\nusing Uno.Math;\nusing Uno.Vector;\n\nclass App : Uno.Application\n{\n\tblock Test : DefaultShading\n\t{\n\t}\n\n\tpublic override void Draw()\n\t{\n\t\tvar aspect = Context.Aspect;\n\t\tfloat time = (float)Time.FrameTime;\n\n\t\tdraw\n\t\t{\n\t\t\tfloat2 []vertices: new []\n\t\t\t{\n\t\t\t\tfloat2(-1, -1),\n\t\t\t\tfloat2(1, -1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(-1,1),\n\t\t\t\tfloat2(-1,-1)\n\t\t\t};\n\n\t\t\tfloat2 FragCoord: float2(pixel ClipPosition.X, pixel ClipPosition.Y / aspect);\n\n\t\t\tClipPosition: float4(vertex_attrib(vertices), 0, 1);\n\t\t\tPixelColor:\n\t\t\t{\n\t\t\t\tfloat3 rayOrigin = float3(0, 0, 1);\n\t\t\t\tfloat3 rayStart = rayOrigin + float3(0, 0, 20);\n\t\t\t\tfloat3 rayDir = Normalize(float3(FragCoord,0) - rayStart);\n\n\t\t\t\tfloat t = 0;\n\t\t\t\tfor(int i = 0;$(i) < 32;++i)\n\t\t\t\t{\n\t\t\t\t\tfloat3 p = rayStart + rayDir * $(t);\n\t\t\t\t\tfloat d = ParseScene(p, time);\n\t\t\t\t\tif(d < 0.01f)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat3 norm = $(GenNormal)(p, time);\n\t\t\t\t\t\tfloat diff = Max(0.05f, Dot(norm, float3(0.33f)));\n\t\t\t\t\t\treturn diff * float4(1, 0, 0, 1);\n\t\t\t\t\t}\n\t\t\t\t\tt += d;\n\t\t\t\t}\n\n\t\t\t\treturn float4(0);\n\t\t\t};\n\t\t};\n\t}\n\n\tpublic static float3 GenNormal(float3 p, float t)\n\t{\n\t\tfloat3 normal;\n\t\tfloat3 precis = float3(0.01f, 0, 0);\n\t\tnormal.X = ParseScene(p + precis.XYZ, t) - ParseScene(p - precis.XYZ, t);\n\t\tnormal.Y = ParseScene(p + precis.YXZ, t) - ParseScene(p - precis.YXZ, t);\n\t\tnormal.Z = ParseScene(p + precis.YZX, t) - ParseScene(p - precis.YZX, t);\n\t\treturn Normalize(normal);\n\t}\n\n\tpublic static float ParseScene(float3 p, float t)\n\t{\n\t\tfloat d = Length(p) - 0.2f;\n\t\tfloat c = 2.4f * Cos(2.0f*t);\n\t\tfloat f = Sin(c*p.X)*Sin(c*p.X)*Sin(c*p.Y);\n\t\treturn d + f;\n\t}\n}\"\n            );\n        }\n\n        [Test]\n        public void DrawScope14()\n        {\n            AssertCode(\n@\"\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\nusing Uno.Math;\nusing Uno.Vector;\nusing Uno.Matrix;\n\nclass App : Uno.Application\n{\n\tpublic override void Draw()\n\t{\n\t\tvar aspect = Context.Aspect;\n\t\tfloat time = (float)Time.FrameTime;\n\n\t\tdraw\n\t\t{\n\t\t\tfloat2 []vertices: new []\n\t\t\t{\n\t\t\t\tfloat2(-1, -1),\n\t\t\t\tfloat2(1, -1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(-1,1),\n\t\t\t\tfloat2(-1,-1)\n\t\t\t};\n\n\t\t\tfloat2 FragCoord: float2(pixel ClipPosition.X, pixel ClipPosition.Y / aspect);\n            float2 Test: $(FragCoord);\n\t\t};\n\t}\n}\"\n            );\n        }\n\n        [Test]\n        public void DrawScope15()\n        {\n            AssertCode(\n@\"\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\nusing Uno.Math;\nusing Uno.Vector;\nusing Uno.Matrix;\n\nclass App : Uno.Application\n{\n    block Triangle\n    {\n        public float2 man: float2(0);\n    };\n\n\tpublic override void Draw()\n\t{\n\t\tvar aspect = Context.Aspect;\n\t\tfloat time = (float)Time.FrameTime;\n\n    \tdraw\n\t\t{\n            apply DefaultShading;\n\t\t\tfloat2 []vertices: new []\n\t\t\t{\n\t\t\t\tfloat2(-1, -1),\n\t\t\t\tfloat2(1, -1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(-1,1),\n\t\t\t\tfloat2(-1,-1)\n\t\t\t};\n\n\t\t\tpublic float2 Foo: float2(pixel ClipPosition.X, pixel ClipPosition.Y / aspect);\n\t\t};\n\n\t\tdraw\n\t\t{\n            apply Triangle;\n\t\t\tfloat2 []vertices: new []\n\t\t\t{\n\t\t\t\tfloat2(-1, -1),\n\t\t\t\tfloat2(1, -1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(-1,1),\n\t\t\t\tfloat2(-1,-1)\n\t\t\t};\n\n            float2 Test: ClipPosition.$(X,!Abs,!pixel)\n\t\t};\n\t}\n}\"\n            );\n        }\n\n        [Test]\n        public void DrawScope16()\n        {\n            AssertCode(\n@\"\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\nusing Uno.Math;\nusing Uno.Vector;\nusing Uno.Matrix;\n\nclass App : Uno.Application\n{\n    block Triangle\n    {\n        public float2 man: float2(0);\n    }\n\n\tpublic override void Draw()\n\t{\n\t\tvar aspect = Context.Aspect;\n\t\tfloat time = (float)Time.FrameTime;\n\n    \t/*draw\n\t\t{\n            apply DefaultShading;\n\t\t\tfloat2 []vertices: new []\n\t\t\t{\n\t\t\t\tfloat2(-1, -1),\n\t\t\t\tfloat2(1, -1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(-1,1),\n\t\t\t\tfloat2(-1,-1)\n\t\t\t};\n\n\t\t\tpublic float2 Foo: float2(pixel ClipPosition.X, pixel ClipPosition.Y / aspect);\n\t\t};*/\n\n\t\tdraw\n\t\t{\n            apply Triangle;\n\t\t\tfloat2 []vertices: new []\n\t\t\t{\n\t\t\t\tfloat2(-1, -1),\n\t\t\t\tfloat2(1, -1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(1,1),\n\t\t\t\tfloat2(-1,1),\n\t\t\t\tfloat2(-1,-1)\n\t\t\t};\n\n            float2 Test: $(vertices, man)\n\t\t};\n\t}\n}\"\n            );\n        }\n\n        public void DrawScope17()\n        {\n            AssertCode(\n@\"\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\n\nclass Foo: Application\n{\n\tfloat Bar: 1.0f;\n\n\tblock baraaa\n\t{\n\t\tapply Fuse.Entities.DefaultShading;\n\t}\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this, baraaa, Cube, Default$(DefaultShading, DefaultMaterial, !new)\n\t\t{\n\t\t\tfloat2 FragCoord: float2(pixel ClipPosition.X, pixel ClipPosition.Y);\n\t\t\tFragCoord: prev;\n\t\t};\n\t}\n}\"\n            );\n        }\n\n        [Test]\n        public void DrawScope18()\n        {\n            AssertCode(\n@\"\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Math;\n\nclass Foo: Application\n{\n\tfloat Bar: Sin(0.5f);\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this, Cube,\n\t\t{\n\t\t\tapply DefaultShading;\n            float3 foo: float3(1,0,1);\n\t\t\tfloat2 FragCoord: float2(pixel ClipPosition.X, pixel ClipPosition.Y);\n\t\t\tFragCoord: prev.$(X, Y, !DefaultMaterial);\n\t\t};\n\t}\n}\"\n            );\n        }\n\n        [Test]\n        public void DrawScope19()\n        {\n            AssertCode(\n@\"\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Math;\n\nclass Foo: Application\n{\n\tfloat Bar: Sin(0.5f);\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this, Cube,\n\t\t{\n\t\t\tapply DefaultShading;\n            float3 foo: float3(1,0,1);\n\t\t\tfloat2 FragCoord: float2(pixel ClipPosition.X, pixel ClipPosition.Y);\n\t\t\t$(FragCoord)\n\t\t};\n\t}\n}\"\n            );\n        }\n\n    }\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/EnumTest.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n\tpublic class EnumTest : Test\n\t{\n\t\t[Test]\n\t\tpublic void EnumTest01()\n\t\t{\n\t\t\tAssertCode(@\"\nenum Test\n{\n\tFoo\n}\n\nclass Lol\n{\n\tpublic void Bar()\n\t{\n\t\tTest test;\n\t\ttest.$(HasFlag)\n\t}\n}\n\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Event.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Event : Test\n    {\n        [Test]\n        public void Event01()\n        {\n            AssertCode(\n@\"\nclass Foo\n{\n    public event Uno.Action Event\n    {\n        add {\n        }\n\n        remove {\n        }\n    }\n\n    public float2 test;\n\n    public void Draw()\n    {\n       $(test)\n    }\n}\n\"\n                );\n        }\n\n        [Test]\n        public void Event02()\n        {\n            AssertCode(\n@\"\nclass Foo\n{\n    public event Uno.Action Event;\n\n    public float2 test;\n\n    public void Draw()\n    {\n       $(test)\n    }\n}\n\"\n                );\n        }\n\n        [Test]\n        public void Event03()\n        {\n            AssertCode(\n@\"\nclass Foo\n{\n    public float2 test;\n\n    public event Uno.Action Event\n    {\n        add {\n            $(test)\n        }\n\n        remove {\n        }\n    }\n\n    public void Draw()\n    {\n    }\n}\n\"\n                );\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ExtensionTypeMethod.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ExtensionTypeMethod : Test\n    {\n\t\t[Test]\n        public void ExtensionTypeMethod00()\n        {\n            AssertCode(\n@\"\nnamespace UnoExtensions\n{\n    public static class StringExtensions\n    {\n        public static string Hello(this string self)\n        {\n            return \"\"\n            Hello,\n            \"\" + self;\n        }\n\n        public void Foo(this int self)\n        {\n        }\n    }\n}\nnamespace CompilerTests.General\n{\n    using UnoExtensions;\n\n    class ExtensionMethods\n    {\n        public static void Run()\n        {\n            assert(\"\"foo\"\".$(Hello, !Foo) == \"\"Hello, foo\"\");\n        }\n    }\n            \");\n        }\n\n        [Test]\n        public void ExtensionTypeMethod01()\n        {\n            AssertCode(\n@\"\n    namespace Bar\n    {\n        class Git\n        {\n            void Foo($(this)\n        }\n    } \");\n        }\n\n        [Test]\n        public void ExtensionTypeMethod02()\n        {\n            AssertCode(\n@\"\n    namespace Bar\n    {\n        class Git\n        {\n            void Foo($(this)) {}\n        }\n    }\n            \");\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Floats.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Floats : Test\n\t{\n\t\t[Test]\n\t\tpublic void Floats00()\n\t\t{\n\t\t\tAssertCode(\n@\"public class b\n{\n\tfloat3x3 berp = float3x3.$(Identity)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b{float3x3 berp=float3x3.$(Identity)}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tfloat4x4 berp = float4x4.$(Identity)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tfloat4x4 berp = Uno.Float4x4.$(Identity)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tpublic void Verrdpp()\n\t{\n\t\tfloat3x3 berp = float3x3.$(Identity)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tpublic void Verrdpp()\n\t{\n\t\tfloat4x4 berp = float4x4.$(Identity)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats06()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tpublic void c()\n\t{\n\t\tfloat4x4 herp = float4x4.Identity;\n\t\therp.$(M11,M12,M13,M14,M21,M22,M23,M24,M31,M32,M33,M34,M41,M42,M43,M44)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats07()\n\t\t{\n\t\t\tAssertCode(\n@\"\npublic class b\n{\n\tpublic void c()\n\t{\n\t\tfloat3x3 derp = float3x3.Identity;\n\t\tfloat herk = derp.$(M11,M12,M13,M21,M22,M23,M31,M32,M33)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats08()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class b\n{\n\tpublic void c()\n\t{\n\t\tfloat3 der = float3(1.0f);\n\t\tder.$(X,Y,Z)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats09()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tb()\n\t{\n\t\tfloat2 temp2 = float2(1.0f);\n\t\tfloat4x4 test = float4x4(float4($(temp2)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats10()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tb()\n\t{\n\t\tfloat2 temp2 = float2(1.0f);\n\t\tfloat4x4 test = float4x4(float4(temp2.YX,$(temp2)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Floats11()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tb()\n\t{\n\t\tfloat2 temp2 = float2(1.0f);\n\t\tfloat4x4 test = float4x4(float4(float4x4( float4(1.0f),float4(1.0f),float4(1.0f),float4(1.0f) ).$(M11,M12,M13,M14)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/GDC.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class GDC : Test\n\t{\n\t\t[Test]\n\t\tpublic void GDC00()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\npublic class PrismDofGlowEntity3D : Entity\n{\n\tpublic static float DofFocalPlane = 0.0f;\n\tpublic static float DofFocalRange = 400.0f;\n\n\tpublic static texture2D DofBlurredTexture = null;\n}\n\nblock PrismDofGlowBlock\n{\n\t $(float,int,PixelColor,pixel,texture2D)\n\tfloat DofFocalPlane: PrismDofGlowEntity3D.DofFocalPlane;\n\tfloat DofFocalRange: PrismDofGlowEntity3D.DofFocalRange;\n\ttexture2D DofBlurredTexture: PrismDofGlowEntity3D.DofBlurredTexture;\n\n\tfloat DofLol: req(ViewPosition as float3) Math.Clamp(Math.Abs(-ViewPosition.Z - DofFocalPlane) / DofFocalRange, 0.0f, 1.0f);\n\tpixel float2 CornerVec: ClipPosition.XY / ClipPosition.W;\n\tfloat2 viewportSize: float2((float)Uno.Application.Viewport.Size.X, (float)Uno.Application.Viewport.Size.Y);\n\tfloat2 viewportPos: float2((float)Uno.Application.Viewport.Position.X, (float)Uno.Application.Framebuffer.Size.Y - (float)Uno.Application.Viewport.Bottom);\n\tfloat2 framebufferSize: float2((float)Uno.Application.Framebuffer.Size.X, (float)Uno.Application.Framebuffer.Size.Y);\n\tpixel float2 ScreenSpaceUv: ((CornerVec * .5f + .5f) * viewportSize + viewportPos) / framebufferSize;\n\tpixel float4 Blurred: sample(DofBlurredTexture, ScreenSpaceUv);\n\n\tfloat4 OriginalColor: req(prev PixelColor) prev PixelColor * (1.0f - DofLol) + Blurred * DofLol;\n\tPixelColor: OriginalColor;\n\tPixelColor: prev;//+ Blurred;\n\n\tpixel float vignette: Math.Pow(Vector.Length(CornerVec) / .78f, 2.8f) * .1f;\n\tPixelColor: prev - float4(float3(vignette),0.0f);\n}\n\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\nclass Dust : Entity\n{\n    public static Random random = null;\n\n    class Particle\n    {\n        public float3 Pos;\n        public float Scale, Rot;\n        public double TimeScalar1;\n        public double TimeScalar2;\n        public float3 MoveVector;\n\n        public Particle()\n        {\n            Pos = Dust.random.NextFloat3() * 400.0f - 200.0f;\n            Scale = (Dust.random.NextFloat() * .1f + .9f) * .23f;\n\t\t\tRot = Dust.random.NextFloat() * 2.0f * PIf;\n            TimeScalar1 = (double)(Dust.random.NextFloat() * .6f + .4f) * .9f;\n            TimeScalar2 = (double)(Dust.random.NextFloat() * .8f + .2f) * .6f;\n            MoveVector = Normalize(Dust.random.NextFloat3() - .5f) * 2.0f;\n        }\n\t}\n\t$(Particle)\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Dust : Entity\n{\n    public static Random random = null;\n\n    class Particle\n    {\n        public float3 Pos;\n        public float Scale, Rot;\n        public double TimeScalar1;\n        public double TimeScalar2;\n        public float3 MoveVector;\n\n        public Particle()\n        {\n            Pos = Dust.random.NextFloat3() * 400.0f - 200.0f;\n            Scale = (Dust.random.NextFloat() * .1f + .9f) * .23f;\n\t\t\tRot = Dust.random.NextFloat() * 2.0f * PIf;\n            TimeScalar1 = (double)(Dust.random.NextFloat() * .6f + .4f) * .9f;\n            TimeScalar2 = (double)(Dust.random.NextFloat() * .8f + .2f) * .6f;\n            MoveVector = Normalize(Dust.random.NextFloat3() - .5f) * 2.0f;\n        }\n\t\tpublic $(Particle)\n\t}\n\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic drawable class Quad\n{\n\n\tprotected float2[] verts = new []\n\t{\n\t\t$(!draw,!try,!throw,float2,float3)\n\t\tfloat2(-1.0f, -1.0f),\n\t\tfloat2( 1.0f, -1.0f),\n\t\tfloat2( 1.0f,  1.0f),\n\t\tfloat2(-1.0f,  1.0f),\n\t};\n\tprotected ushort[] indices = new ushort[]\n\t{\n\t\t0, 1, 2,\n\t\t2, 3, 0,\n\t};\n\n\tfloat2 CornerVec: vertex_attrib(verts, indices);\n\tfloat2 Uv: CornerVec * .5f + .5f;\n\n\tVertexCount: 6;\n\tClipPosition: float4(CornerVec, 0, 1);\n\tPixelColor: float4(1);\n\n\tpublic void TestDraw() { draw { ClipPosition: float4(CornerVec * .5f, 0, 1); }; }\n}\n\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n$(block)\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nblock $(!using,!class,!enum,!partial,!namespace)\n{\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC06()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class Fairground_canon : Entity\n{\n\tapply DefaultShading;\n\tapply Model(\"\"../Data/fairground_canon.FBX\"\", Uno.Importers.ModelImportFlags.DefaultBatch);\n\n\ttexture2D LightMap : import Texture2D(\"\"../Data/fairground_canon_lightmap.png\"\");\n\n\n\ttexture2D diffuseAtlas : import Texture2D(\"\"../Data/fairground_canon.png\"\");\n\t//float4 lightmapSampled : sample(LightMap, TexCoord1);\n\tDiffuseMap : diffuseAtlas;\n\n\tpublic Fairground_canon()\n\t{\n\t\tCollider = new Fuse.Entities.BoxCollider(Uno.Geometry.Box(float3(-10), float3(10)));\n\t}\n\n\tTransform: this.Transform;\n\n\n\tpublic override void OnDraw(RenderingPass pass)\n\t{\n\t\tif(pass is FairgroundPipeline.CompositingPass)\n\t\t{\n\t\t\tdraw $(float,int,!enum,Uno,pass,this)\n\t\t\t\t{\n\n\t\t\t\t\tSpecular : 0;\n\n\t\t\t\t\tPixelColor : DiffuseMapColor;\n\t\t\t\t\tapply FairGroundLightMap;\n\t\t\t\t\tapply FairgroundBloomBlock;\n\t\t\t\t};\n\t\t\t\tTransform.Position = float3(30.638f, -24.051f, 28.206f);\n\t\t}\n\t\telse if(pass is FairgroundPipeline.BlurBufferPass)\n\t\t{\n\t\t\tdraw\n\t\t\t{\n\n\t\t\t\tSpecular : 0;\n\t\t\t\tPixelColor : DiffuseMapColor;\n\t\t\t\tapply FairGroundLightMap;\n\t\t\t\tapply BloomPowBlock;\n\t\t\t};\n\t\t\tTransform.Position = float3(30.638f, -24.051f, 28.206f);\n\t\t}\n\t\telse draw;\n\t}\n}\n\n\"\n            );\n\t\t}\n\n        /*[Test]\n        public void GDC07()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Uno.Graphics;\nusing Fuse;\nusing Fuse.Entities;\n\n\npublic class Fairground_canon : Entity\n{\n    public override void OnDraw(RenderingPass pass)\n    {\n        if(pass is $(!pass)) FairgroundPipeline.CompositingPass)\n        {\n\n        }\n\n    }\n}\n\n\"\n            );\n        }*/\n\n        [Test]\n\t\tpublic void GDC08()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Uno.Content.Models\n{\n\tpublic static class ModelReader\n\t{\n\t\tpublic static ModelParameterList<T> ReadParameterList<T>(Reader r, ModelParameter[] parameters, ModelParameterValueType itemType)\n\t\t{\n\t\t\t$(r,parameters,itemType)\n\t\t\tvar items = new ModelParameter<T>[r.ReadCompressedInt()];\n\t\t\tfor (int i = 0; i < items.Length; i++) items[i] = (ModelParameter<T>)parameters[r.ReadCompressedInt()];\n\t\t\treturn new ModelParameterList<T>(itemType, items);\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC09()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Uno.Content.Models\n{\n\tpublic static class ModelReader\n\t{\n\t\tpublic static ModelParameterList<T> ReadParameterList<T>(Reader r, ModelParameter[] parameters, ModelParameterValueType itemType)\n\t\t{\n\t\t\tthis.$(!Assert,!Application,!Int)\n\t\t\tvar items = new ModelParameter<T>[r.ReadCompressedInt()];\n\t\t\tfor (int i = 0; i < items.Length; i++) items[i] = (ModelParameter<T>)parameters[r.ReadCompressedInt()];\n\t\t\treturn new ModelParameterList<T>(itemType, items);\n\t\t}\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC10()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Uno.Content.Models\n{\n\tpublic static class ModelReader\n\t{\n\t\tpublic static ModelParameterList<T> ReadParameterList<T>(Reader r, ModelParameter[] parameters, ModelParameterValueType itemType)\n\t\t{\n\t\t\t$(!public,!private,!abstract)\n\t\t\tvar items = new ModelParameter<T>[r.ReadCompressedInt()];\n\t\t\tfor (int i = 0; i < items.Length; i++) items[i] = (ModelParameter<T>)parameters[r.ReadCompressedInt()];\n\t\t\treturn new ModelParameterList<T>(itemType, items);\n\t\t}\n\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC11()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Uno.Content.Models\n{\n\tpublic static class ModelReader\n\t{\n\t\tpublic static ModelParameterList<T> ReadParameterList<T>(Reader r, ModelParameter[] parameters, ModelParameterValueType itemType)\n\t\t{\n\t\t\tvar items = new ModelParameter<T>[r.ReadCompressedInt()];\n\t\t\tfor (int i = 0; i < items.Length; i++) items[i] = (ModelParameter<T>)parameters[r.ReadCompressedInt()];\n\t\t\treturn new ModelParameterList<T>(itemType, items);\n\t\t}\n\t\t$(float,int,double)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC12()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Uno.Content.Models\n{\n\tpublic static class ModelReader\n\t{\n\t\tpublic static ModelParameterList<T> ReadParameterList<T>(Reader r, ModelParameter[] parameters, ModelParameterValueType itemType)\n\t\t{\n\t\t\tvar items = new ModelParameter<T>[r.ReadCompressedInt()];\n\t\t\tfor (int i = 0; i < items.Length; i++) items[i] = (ModelParameter<T>)parameters[r.ReadCompressedInt()];\n\t\t\treturn new ModelParameterList<T>(itemType, items);\n\t\t}\n\t\tpublic static FullsampledSpline<T> ReadAnimationSampledSpline<T>(Reader r, int keyStride, Func<Reader, T> readKey)\n\t\t{\n\t\t\t$(!class,!namespace,!using)\n\t\t}\n\t}\n\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GDC13()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace StandardLib.Scenes\n{\n\tclass Entity3DTest\n\t{\n\t\tpublic Entity3DTest()\n\t\t{\n\n\t\t}\n\t\tclass someRenderer : Renderer {}\n\t\tpublic void Run()\n\t\t{\n\t\t\tEntity aEntity = new Entity();\n\t\t\tChildren3D aChild = new Children3D(aEntity);\n\t\t\taEntity.Components.Add(aChild);\n\n\t\t\tbool tempBool = aEntity.HasChildren;\n\n\t\t\tChildren3D tempchild = aEntity.Children;\n\n\t\t\tEntity aParent = aEntity.Parent;\n\n\t\t\tTransform tempTrans = new Transform();\n\t\t\tTransform tempTrans2 = new Transform(float3(1.0f),float4(1.0f),float3(1.0f));\n\t\t\tTransform tempTrans3 = aEntity.Transform;\n\t\t\taEntity.Transform = tempTrans;\n\t\t\taEntity.Transform = tempTrans2;\n\n\t\t\tsomeRenderer tempRender = new someRenderer();\n\t\t\tsomeRenderer tempRender2 = new someRenderer();\n\t\t\taEntity.Renderer = tempRender;\n\t\t\taEntity.Renderer = tempRender2;\n\t\t\tRenderer tempRender3 = aEntity.Renderer;\n\n\t\t\tMeshBinding aMeshbind = aEntity.MeshBinding;\n\t\t\tassert(aMeshbind == null);\n\t\t\tMeshBinding bMeshBind = new MeshBinding();\n\t\t\tMeshBinding cMeshBind = new MeshBinding();\n\t\t\taEntity.MeshBinding = bMeshBind;\n\t\t\tassert(aEntity.MeshBinding == bMeshBind);\n\t\t\taEntity.MeshBinding = cMeshBind;\n\t\t\tassert(aEntity.MeshBinding == cMeshBind);\n\n\t\t\tCollider aCollid = aEntity.Collider;\n\t\t\tassert(aCollid == $(null,!nullReferenceException)\n\n\n\t\t}\n\t}\n}\"\n            );\n\t\t}\n\n        [Test]\n        public void GDC14()\n        {\n            AssertCode(\n@\"\n\n\nnamespace StandardLib.Scenes\n{\n\tclass DrawTest : Entity\n\t{\n        protected void override OnDraw()\n        {\n            draw $(this, Uno, float, int)\n        }\n\t}\n}\"\n            );\n        }\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/GenericsTest.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n\tclass GenericsTest : Test\n\t{\n\t\t[Test]\n\t\tpublic void Generics00()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\nclass MyType\n{\n\tpublic int Blam(){\n\t\treturn 1;\n\t}\n}\n\nclass GenericType<T>\n{\n\tpublic T a;\n\tpublic GenericType(){}\n}\n\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tvar item = new GenericType<MyType>();\n\t\titem.a.$(Blam)\n\t}\n}\"\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/GetSet.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class GetSet : Test\n\t{\n\t\t[Test]\n\t\tpublic void GetSet00()\n\t\t{\n\t\t\tAssertCode(\n@\"[Ignore(\"\"Deadlock\"\")]\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t}\n\n\tpublic bool K\n\t{\n\t\t$(get,set,!K,!Uno);\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetSet01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n[Ignore(\"\"Deadlock\"\")]\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t}\n\n\tpublic bool K\n\t{\n\t\tget { return true; }\n\t\t$(set,!K,!Uno);\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetSet02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t}\n\n\tpublic bool K\n\t{\n\t\tset { }\n\t\t$(get,!K,!Uno);\n\t}\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetSet03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t}\n\n\tpublic bool K\n\t{\n\t\tget{ return true;}\n\t\tset { }\n\t\t$(!K,!Uno);\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GetSet04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t}\n\n\tpublic bool K\n\t{\n\t\tget{ return true;}\n\t\tset { $(value)}\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/ImportAndApply.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class ImportAndApply : Test\n\t{\n\t\t[Test]\n\t\tpublic void ImportAndApply00()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo\n{\n\ttexture2D tex = import $(Uno, !Texture2D)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ImportAndApply01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Graphics;\n\nclass Foo\n{\n\ttexture2D tex = import $(Texture2D, !int, !Texture2DImporter)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ImportAndApply02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Graphics;\n\nblock DefaultShading\n{\n\n}\n\nclass Foo\n{\n\tapply $(DefaultShading)\n\n\tvoid Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\ttexture2D DiffuseMap: import Texture2D();\n\n\t\t};\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ImportAndApply03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\tapply Uno.$(!DefaultShading)\n\n\tvoid Draw()\n\t{\n\t\tdraw\n\t\t{\n\n\n\t\t};\n\t}\n}\"\n            );\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Interface.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Interface : Test\n    {\n        [Test]\n        public void Interface01()\n        {\n            AssertCode(\n@\"\ninterface IRolf\n{\n    IRolf Rolf { get; }\n}\n\nclass Bar\n{\n    IRolf IRolf.Rolf\n    {\n        get\n        {\n            return null;\n        }\n    }\n\n    public Bar()\n    {\n        $(Test)\n    }\n\n    void Test()\n    {\n    }\n}\n\"\n                );\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Jonny1.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Jonny1 : Test\n\t{\n\t\t[Test]\n\t\tpublic void Jonny100()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo\n{\n    int a = 1;\n    void Bar()\n    {\n        $(Uno)\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Jonny101()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo\n{\n    float2 a;\n    void Bar()\n    {\n        if(a == float2(0,0)){\n            $(Uno)\n        }\n    }\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Keywords.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Keywords : Test\n    {\n        [Test]\n        public void Keywords00()\n        {\n            AssertCode(\n@\"\n\nclass Foo: Application\n{\n\tfloat Bar: Sin(0.5f);\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this, Cube,\n\t\t{\n\t\t\tapply DefaultShading;\n\t\t\tfloat2 FragCoord: float2(pixel ClipPosition.X, pixel ClipPosition.Y);\n\t\t\tFragCoord: $(prev)\n\t\t};\n\t}\n}\n\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/KrissTests3.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class KrissTests3 : Test\n\t{\n\t\t[Test]\n\t\tpublic void KrissTests300()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Collections;\n\nclass A\n{\n    public A()\n    {\n        List<int> a = new $(!<root>)\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KrissTests301()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass A\n{\n    public A()\n    {\n        $(!<root>)\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KrissTests302()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass A\n{\n\t$(!<root>)\n\n    public A()\n    {\n\n    }\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/KristianTests.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class KristianTests : Test\n\t{\n\t\t[Test]\n\t\tpublic void KristianTests00()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic float[][] GenerateNoise(int size, int blockSize)\n\t\t{\n\t\t\tfloat[][] noise = new float[size][size];\n\t\t\t$(for, while, do)\n\t\t}\n\n\n        public override void Draw()\n        {\n\t\t\tdraw Quad\n\t\t\t{\n\n\t\t\t}\n        }\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic float[] GenerateNoise(int size, int blockSize)\n\t\t{\n\t\t\tfloat[] texture = new float[size*size];\n\n\t\t\tfloat[] gradients = new float[$(size) / blockSize];\n\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic float[] GenerateNoise(int size, int blockSize)\n\t\t{\n\t\t\tfloat[] texture = new float[size*size];\n\n\t\t\tfloat[] gradients = new float[size / $(blockSize)];\n\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic float[] GenerateNoise(int size, int blockSize)\n\t\t{\n\t\t\tfloat[] texture = new float[size*size];\n\t\t\tif (blockSize % size != 0) throw new Exception(\"\"Size must be a multiple of blocksize\"\");\n\t\t\tfloat[] gradients = new float[(int)(size/blockSize) * (int)(size/blockSize)];\n\t\t\t$(for)\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic float[] GenerateNoise(int size, int blockSize)\n\t\t{\n\t\t\tfloat[] texture = new float[size*size];\n\t\t\tif (blockSize % size != 0) throw new Exception(\"\"Size must be a multiple of blocksize\"\");\n\t\t\tint gradientSize = (int)(size/blockSize) * (int)(size/blockSize);\n\t\t\tfloat[] gradients = new float[$(gradientSize)];\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic float[] GenerateNoise(int size, int blockSize)\n\t\t{\n\t\t\tfloat[] texture = new float[size*size];\n\t\t\tif (blockSize % size != 0) throw new Exception(\"\"Size must be a multiple of blocksize\"\");\n\t\t\tint gradientSize = (int)(size/blockSize) + 1;\n\t\t\tfloat2[] gradients = new float2[gradientSize * gradientSize];\n\t\t\tvar random = new Random(123123);\n\t\t\tfor (int i = 0; i < gradientSize * gradientSize; i++)\n\t\t\t{\n\t\t\t\tgradients[i] = random.NextFloat2();\n\t\t\t}\n\n\t\t\tfloat cbx = 0.0f;\n\t\t\tfloat cby = 0.0f;\n\n\t\t\tfor (int y = 0; y < size; y++)\n\t\t\t{\n\t\t\t\tfor (int x = 0; x < size; x++)\n\t\t\t\t{\n\t\t\t\t\tfloat2 grad1 = float2(x,y) - float2(cbx, cby);\n\t\t\t\t\tfloat2 grad2 = float2(x,y) - float2(cbx +  blockSize, cby);\n\t\t\t\t\tfloat2 grad3 = float2(x,y) - float2(cbx, cby + blockSize);\n\t\t\t\t\tfloat2 grad4 = float2(x,y) - float2(cbx + blockSize, cby + blockSize);\n\n\t\t\t\t\tfloat d1 = Vector.Dot(grad1, gradients[(int)cbx + size * (int)cby]);\n\t\t\t\t\tfloat d2 = Vector.Dot(grad2, gradients[(int)cbx + 1 + size  * (int)cby]);\n\t\t\t\t\tfloat d3 = Vector.Dot(grad3, gradients[(int)cbx  + size * ((int)cby + 1)]);\n\t\t\t\t\tfloat d4 = Vector.Dot(grad4, gradients[(int)cbx + 1 + size * ((int)cby + 1)]);\n\n\t\t\t\t\tfloat xPos = (x % blockSize) / blockSize;\n\t\t\t\t\tfloat yPos = (y % blockSize) / blockSize;\n\n\t\t\t\t\tfloat xx = Math.Lerp(d1, d2, xPos);\n\t\t\t\t\tfloat xxx = Math.Lerp(d3, d4, xPos);\n\t\t\t\t\tfloat res = Math.Lerp(xx, xxx, yPos);\n\n\t\t\t\t\ttexture[y * size + x] = $(res);\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests06()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n\tclass Test5\n\t{\n\n\t\tpublic class Ball\n\t\t{\n\t\t\tpublic float3 Position { get; set; }\n\t\t\tCamera camera = new Camera();\n\t\t\t$(camera)\n\t\t}\n\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests07()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTestTest\n{\n\tclass Test5\n\t{\n\n\t\tpublic class Ball\n\t\t{\n\t\t\tpublic float3 Position { get; set; }\n\t\t\tpublic float Radius { get { return 20f; } }\n\n            public void Normalize()\n            {\n                Radius=1;\n            }\n\n\t\t\tpublic Ball(float3 position)\n\t\t\t{\n\t\t\t\tPosition = position;\n\n\t\t\t}\n\n\t\t}\n\n\t\tpublic Test5()\n\t\t{\n\t\t\tballs = new List<Ball>();\n\t\t\tUno.UI.Window.MouseDown += OnMouseDown;\n\n\t\t}\n\n\t\tList<Ball> balls;\n\n\t\tpublic void Foo()\n\t\t{\n\t\t\tint2 mPos = arg.Position;\n\t\t\tforeach (Ball b in balls)\n\t\t\t{\n\t\t\t\tb.$(Position,Radius,Normalize)\n\t\t\t}\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests08()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Spindler\n{\n\tclass SpindleInputController{}\n\n    class App : Uno.Application\n    {\n\t\tSpindle spindle;\n\t\tSpindleInputController spindleInput;\n\t\tpublic override void Load()\n\t\t{\n\t\t\tbase.Load();\n\t\t\tspindle = new Spindle();\n\t\t\t$(spindleInput)\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests09()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Spindler\n{\n\tclass SpindleInputController\n\t{}\n\n    class App : Uno.Application\n    {\n\t\tSpindle spindle;\n\t\tSpindleInputController spindleInput;\n\t\tpublic override void Load()\n\t\t{\n\t\t\tbase.Load();\n\t\t\tspindle = new Spindle();\n\t\t\tspindleInput = new $(SpindleInputController)\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests10()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Spindler\n{\n\tclass SpindleController\n\t{\n\t\tSpindle spindle;\n\t\tpublic SpindleController(Spindle spindle)\n\t\t{\n\t\t\tthis.$(spindle)\n\t\t}\n\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests11()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Spindler\n{\n\tclass SpindleController\n\t{\n\t\tSpindle spindle;\n\t\tpublic SpindleController(Spindle spindle)\n\t\t{\n\t\t\tthis.spindle = $(spindle)\n\t\t}\n\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests12()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Spindler\n{\n\tclass Test\n\t{\n\t\tprivate float s;\n\t\tpublic float S\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn $(s)\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\ts = value;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n        /*[Test]\n        public void KristianTests13()\n        {\n            AssertCode(\n@\"\n\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\nusing Uno.Platform;\nusing Uno.UI;\n\nnamespace GameOfLife\n{\n    class App : Uno.Application\n    {\n        public void OnKeyUp(object sender, KeyEventArgs arg)\n        {\n            if (arg.$(IsAltKeyPressed, IsControlKeyPressed, Equals, GetHashCode, IsHandled, Key, IsMetaKeyPressed, IsShiftKeyPressed, ToString)\n        }\n    }\n}\n\n\"\n            );\n        }\n\n\n        [Test]\n        public void KristianTests14()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\nusing Uno.UI;\n\nnamespace IntellisenseTestTest\n{\n    class Test5\n    {\n\n        public void OnKeyDown(object sender, Uno.UI.KeyEventArgs arg)\n        {\n            if (arg.$(Alt, Control, Equals, GetHashCode, Handled, KeyCode, KeyData, Meta, Shift, ToString)\n        }\n    }\n}\n\n\"\n            );\n        }*/\n\n        /*[Test]\n        public void KristianTests15()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Fuse;\nusing Fuse.Elements;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\n\nnamespace IntellisenseTestTest\n{\n    class Test5\n    {\n        public bool WDown = false;\n        public bool SDown = false;\n        public bool ADown = false;\n        public bool DDown = false;\n        public void OnKeyDown(object sender, Uno.UI.KeyEventArgs arg)\n        {\n            if (arg.KeyCode == Keys.W) $(WDown, SDown, ADown, DDown)\n        }\n    }\n}\n\n\"\n            );\n        }*/\n\n        [Test]\n\t\tpublic void KristianTests16()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTest2\n{\n    class App : Uno.Application\n    {\n        public override void Draw()\n        {\n\t\t\tApp.Current.$(ClearColor)\n        }\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests17()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTest2\n{\n    class App : Uno.Application\n    {\n\n\t\tconst int size = 50;\n\t\tfloat[] heights = new float[size];\n\n\t\tpublic override void Load()\n\t\t{\n\t\t\tbase.Load();\n\n\t\t}\n\n\t\tapply DefaultShading;\n        public override void Draw()\n        {\n\t\t\tfloat cubeSize = 5f;\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\tdraw Cube\n\t\t\t\t{\n\t\t\t\t\tPosition: prev + i * cubeSize;\n\t\t\t\t\tScale: float3(cubeSize, heights[$(i)]), 0);\n\t\t\t\t};\n\t\t\t}\n        }\n    }\n}\n\n\"\n            );\n\t\t}\n\n        /*[Test]\n        public void KristianTests18()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\nusing Uno.Content;\nusing Uno.Content.Models;\n\nnamespace IntellisenseTest2\n{\n    class App : Uno.Application\n    {\n        public List<float> MergeSort(List<float> list)\n        {\n            if (list.Count <= 1) return list;\n            var left = new List<float>();\n            var right = new List<float();\n            int middle = list.Count / 2;\n            for (int i = 0; i < middle; i++)\n            {\n                left.Add(list[i]);\n                right.$(Add, Clear, Contains, Count, Equals, GetEnumerator, GetHashCode, Insert, Remove, RemoveAt, Sort, ToArray, ToString);\n            }\n        }\n    }\n}\n\n\"\n            );\n        }*/\n\n        [Test]\n\t\tpublic void KristianTests19()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace IntellisenseTest2\n{\n    class App : Uno.Application\n    {\n\n\t\tconst int size = 128;\n\t\tList<float> heights = new List<float>();\n\t\tList<float> sortedHeights = new List<float>();\n\n\t\tdouble time = 0.0;\n\n\t\tpublic override void Load()\n\t\t{\n\t\t\tbase.Load();\n\t\t\tvar random = new Random((int)Time.FrameTime);\n\t\t\tfor (int i = 0; i < size; i++)\n\t\t\t{\n\t\t\t\theights.Add(random.NextFloat(0f, 100f));\n\t\t\t}\n\t\t\t$(sortedHeights)\n\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests20()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Othello\n{\n    class App : Uno.Application\n    {\n        public override void Draw()\n        {\n\t\t\tfloat size = 5f;\n            int a = 0;\n\t\t\tfloat test = $(a);\n\t\t\tdraw Cube\n\t\t\t{\n\t\t\t\tScale: float3(boardSize * $(size)\n\t\t\t};\n\n        }\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests21()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n        public override void Load()\n        {\n\t\t\tList<List<float>> $(!List)\n\n        }\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests22()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\t\tPlane plane;\n\n\t\tpublic override void Load()\n\t\t{\n\t\t\t$(plane)\n\n\t\t}\n\n\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests23()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Collections;\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\n\t\tapply DefaultShading;\n\t\tpublic override void Draw()\n\t\t{\n\n\t\t\tList<float> floats = new $(List<float>)\n\n\t\t}\n\n    }\n}\n\"\n            );\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/KristianTests2.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class KristianTests2 : Test\n\t{\n\t\t/*[Test]\n\t\tpublic void KristianTests200()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\nusing Uno.Audio;\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tpublic override void Load()\n\t\t{\n\t\t\tSoundSourceNode ssn = new $(SoundSourceNode)\n\t\t}\n\n    }\n}\n\n\"\n\t\t\t);\n\t\t}*/\n\n\t\t/*\n\t\t[Test]\n\t\tpublic void KristianTests201()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.Audio;\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tpublic override void Load()\n\t\t{\n\t\t\tList<GainNode> gainNodes = new $(List<GainNode>)\n\t\t}\n    }\n}\n\n\"\n\t\t\t);\n\t\t}*/\n\n\t\t[Test]\n\t\tpublic void KristianTests202()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tpublic override void Load()\n\t\t{\n\t\t\tfloat[] floats = new $(float)\n\t\t}\n\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests203()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tclass Foo\n\t\t{\n\t\t}\n\n\t\tpublic override void Load()\n\t\t{\n\t\t\t$(Foo)\n\t\t}\n\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests204()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tclass Foo\n\t\t{\n\t\t}\n\n\t\tpublic override void Load()\n\t\t{\n\t\t\tFoo foo = new $(Foo)\n\t\t}\n\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests205()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tpublic class Foo\n\t\t{\n\t\t\tpublic class Bar\n\t\t\t{\n\t\t\t\tpublic class FooBar\n\t\t\t\t{\n\t\t\t\t\tFoo foo = new $(Foo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests206()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic override void Load()\n\t\t{\n\t\t\tbase.Load();\n\t\t}\n\n\t\tblock FooBlock\n\t\t{\n\t\t\tapply DefaultShading;\n\t\t}\n\n\t\tapply $(FooBlock)\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests207()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tpublic override void Load()\n\t\t{\n\t\t\tvar tex = $(import)\n\t\t}\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests208()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\t\tfloat3[] positions = new float3[100];\n\t\tpublic override void Load()\n\t\t{\n\n\t\t\tfor (int i = 0; i < positions.$(Length)\n\t\t}\n\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests209()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Collections;\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\t\tList<float> list = new List<float>();\n\t\tpublic override void Load()\n\t\t{\n\n\t\t\tfor (int i = 0; i < list.$(Count)\n\t\t}\n\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests210()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\t\tpublic class Node\n\t\t{\n\t\t\tNode parent;\n\t\t\tList<Node> children = new List<Node>();\n\n\t\t\tpublic Node()\n\t\t\t{\n\t\t\t\t$(children);\n\t\t\t}\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\tpublic void KristianTests211()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\t\tapply DefaultShading;\n\n\t\t$(CameraPosition)\n\n\t\tpublic override void Draw()\n\t\t{\n\t\t\tbase.Draw();\n\n\t\t\tdraw Cone\n\t\t\t{\n\t\t\t\tScale: 50f;\n\t\t\t};\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void KristianTests212()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\n\t\tapply DefaultShading;\n\n\t\tCameraPosition: float3(0, 100,0);\n\t\tDictionary<float, int> dict = new Dictionary<float, int>();\n\t\tpublic override void Draw()\n\t\t{\n\t\t\tbase.Draw();\n\n\t\t\t$(dict)\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\tpublic void KristianTests213()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace DummyProj\n{\n    class App : Uno.Application\n    {\n\t\tapply DefaultShading;\n\t\tpublic override void Load()\n\t\t{\n\t\t\tbase.Load();\n\t\t}\n\n\t\tpublic override void Draw()\n\t\t{\n\t\t\tbase.Draw();\n\t\t\tdraw Cone\n\t\t\t{\n\t\t\t\t$(Diffuse)\n\t\t\t};\n\t\t}\n\t}\n}\n\"\n            );\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/List.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class List : Test\n\t{\n\t\t[Test]\n\t\tpublic void List00()\n\t\t{\n\t\t\tAssertCode(\n@\"namespace Unol\n{\n    public class List<T>\n    {\n        T[] data;\n        int used;\n        /*\n        class Enumerator: IEnumerator<T>\n        {\n            List<T> list;\n            int pos = -1;\n            public Enumerator(List<T> list)\n            {\n                this.list = list;\n            }\n            public bool MoveNext()\n            {\n                pos++;\n                return pos < list.Count;\n            }\n            public T Current { get { return list[pos]; } }\n        }\n\n        public IEnumerator<T> GetEnumerator() { return new Enumerator(this); }\n        */\n        public List()\n        {\n            data =$(null) null;\n            used = 0;\n        }\n\n        public T[] ToArray()\n        {\n            var t = new T[used];\n            for (int i = 0; i < used; i++) t[i] = data[$(i, used)i];\n            return t;\n        }\n\n        void ensureCapacity()\n        {\n            if (data == null)\n            {\n                data = new T[2];\n            }\n            else if ($(used)used + 1 == data.$(Length)Length)\n            {\n                var newData = new T[data.Length *$(data) 2];\n\n                for (int i = 0; i < used; i++)\n                {\n                    newData[i] = data[i];\n                }\n\n                data = newData;\n            }\n        }\n\n        public int Count\n        {\n            get { return used; }\n        }\n\n        public void Add(T item)\n        {\n            ensureCapacity();\n            data[used++] = item;\n        }\n\n        public void Insert(int index, T item)\n        {\n            ensureCapacity();\n            for (int i = used; i >= index; i--)\n            {\n                data[i + 1] = data[i];\n            }\n            data[index] = item;\n            used++;\n        }\n\n        public void Remove(T item)\n        {\n            for (int i = 0; i < used; i++)\n            {\n                if (data[i] == item)\n                {\n                    RemoveAt(i);\n                    return;\n                }\n            }\n            throw new Exception(\"\"List does not contain the given item\"\");\n        }\n\n        public void RemoveAt(int index)\n        {\n            for (int i = index; i < used - 1; i++)\n            {\n                data[i] = data[i + 1];\n            }\n            used = used - 1;\n        }\n\n        public void Clear()\n        {\n            used = 0;\n        }\n\n        public bool Contains(T item)\n        {\n            for (int i = 0; i < used; i++)\n            {\n                if (data[i] == item) return true;\n            }\n            return false;\n        }\n\n        public T this[int index]\n        {\n            get { return data[index]; }\n            set { data[index] = value; }\n        }\n\n\t\tpublic void Sort(Comparison<T> comparer)\n        {\n\t\t\tUno.$(Array)\n        }\n\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void List01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Collections;\npublic class a : Uno.Application{}\n\nclass b\n{\n \tList<int> derp;\n\tb()\n\t{\n\t\tderp.$(Add,Sort)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Locals.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Locals : Test\n\t{\n\t\t[Test]\n\t\tpublic void Locals00()\n\t\t{\n\t\t\tAssertCode(\n@\"public class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t\t$(a)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Locals01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tif (1 == 2)\n\t\t{\n\t\t\tint a;\n\t\t}\n\t\t$(!a)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Locals02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t}\n\n\tpublic bool K\n\t{\n\t\tget\n\t\t{\n\t\t\t$(!a)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Locals03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t}\n\n\tpublic bool K\n\t{\n\t\tget\n\t\t{\n\t\t\tint a;\n\t\t\tif (1 == 2)\n\t\t\t{\n\t\t\t\t$(a)\n\t\t\t}\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MetaProperties.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MetaProperties : Test\n\t{\n\t\tpublic void MetaProperties00()\n\t\t{\n\t\t\tAssertCode(\n@\"[Ignore]\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this\n\t\t{\n\t\t\tint Foo: $(Diffuse)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void MetaProperties01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n[Ignore]\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\tint Foo: 1+1, $(Diffuse)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void MetaProperties02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n[Ignore]\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tint Foo: 1+1, $(Diffuse)\n\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void MetaProperties03()\n\t\t{\n\t\t\tAssertCode(\n@\"\nclass Foo: Uno.Application\n{\n\tfloat Bar: 1.0f;\n\n\tblock baraaa\n\t{\n        apply Fuse.Entities.DefaultShading;\n\t\tint Foo: 1+1, $(Diffuse);\n\t}\n\n\tpublic override void Draw()\n\t{\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\tpublic void MetaProperties04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this\n\t\t{\n\t\t\t$(AmbientLightColor)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void MetaProperties05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n[Ignore]\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this\n\t\t{\n\t\t\tfloat foo: AmbientLightColor.$(X, !Diffuse)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\tpublic void MetaProperties06()\n\t\t{\n\t\t\tAssertCode(\n@\"\n[Ignore]\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw this\n\t\t{\n\t\t\tfloat foo: 1, AmbientLightColor.$(X, !Diffuse)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MetaProperties07()\n\t\t{\n\t\t\tAssertCode(\n@\"\n[Ignore]\nclass Foo: Uno.Application\n{\n\tapply Fuse.Entities.DefaultShading;\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n\t\t\tfloat foo: { $(!apply)\n\t\t}\n\t}\n}\n\n\n\n\"\n\t\t\t);\n\t\t}\n\n        public void MetaProperties08()\n        {\n            AssertCode(\n@\"\nclass Foo: Fuse.Entities.Material\n{\n    apply Fuse.Entities.DefaultShading;\n    PixelColor:\n    {\n        $(TexCoord)\n    };\n}\n\n\n\n\"\n            );\n        }\n\n        public void MetaProperties09()\n        {\n            AssertCode(\n@\"\nclass Foo: Uno.Application\n{\n\tfloat Bar: 1.0f;\n\n\tpublic override void Draw()\n\t{\n\t\tdraw\n\t\t{\n            apply Fuse.Entities.DefaultShading;\n\t\t\tPixelColor:\n            {\n                $(TexCoord)\n            };\n\t\t}\n\t}\n}\n\"\n            );\n        }\n\n        [Test]\n        public void MetaProperties10()\n        {\n            AssertCode(\n@\"\nclass Foo: Uno.Application\n{\n    float2 foo = float2(200, 0);\n    float2 lol: float2(0, 0);\n\tpublic override Draw()\n    {\n        draw\n        {\n            PixelColor: this.$(foo)\n        };\n    }\n}\n\"\n            );\n        }\n\n        /*[Test]\n        public void MetaProperties11()\n        {\n            AssertCode(\n@\"\nclass Foo: Uno.Application\n{\n    float3 test: float3(0);\n\tfloat3 Bar: prev.$(X, Item)\n}\n\"\n            );\n        }\n\n        [Test]\n        public void MetaProperties12()\n        {\n            AssertCode(\n@\"\nclass Foo: Uno.Application\n{\n    float3 test: float3(0);\n\tfloat3 Bar: (prev+float3(0)).$(X, Item)\n}\n\"\n            );\n        }*/\n\n        [Test]\n        public void MetaProperties13()\n        {\n            AssertCode(\n@\"\nclass Foo: Uno.Application\n{\n    float3 test: float3(0);\n\tfloat3 Bar: (prev PixelColor).$(X,Y,Z,W,!DefaultShading)\n}\n\"\n            );\n        }\n\n        public void MetaProperties14()\n        {\n            AssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n    apply Default$(DefaultShading);\n}\n\"\n            );\n        }\n\n        [Test]\n        public void MetaProperties15()\n        {\n            AssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n    float2 Test: float2(0);\n    $(Test)\n}\n\"\n            );\n        }\n\n        [Test]\n        public void MetaProperties16()\n        {\n            AssertCode(\n@\"\n\nclass Foo: Uno.Application\n{\n    block Triangle\n    {\n        float2 Test: float2(0);\n        $(Test)\n    }\n}\n\"\n            );\n        }\n\n\t\t[Test]\n\t\tpublic void MetaProperties17()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\tblock Test\n\t{\n\t\tfloat3 foo: float3(0,0,0);\n\t\tfloat3 lol: req(foo) float3(0,1,1),\n\t\t\tfoo.XYY;\n\n\t\tlol: Uno.Vector.$(Cross,!CullFace);\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MetaProperties18()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\tblock Test\n\t{\n\t\tfloat3 foo: float3(0,0,0);\n\t\tfloat3 lol: req(foo) float3(0,1,1),\n\t\t\tfoo.XYY;\n\n\t\tlol: req(Cull$(CullFace)\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n        /*[Test]\n        public void MetaProperties08()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing Fuse;\nusing Fuse.Entities;\nusing Fuse.Entities.Primitives;\n\nusing static Uno.Vector;\nusing static Uno.Math;\n\nblock ObeliskMaterial : Fuse.Entities.DefaultShading\n{\n    PixelColor:$(!apply) float4(1, 0, 0, 1);\n}\n\n\"\n            );\n        }*/\n\n    }\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodBody.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodBody : Test\n\t{\n\t\t[Test]\n\t\tpublic void MethodBody00()\n\t\t{\n\t\t\tAssertCode(\n@\"public class A\n{\n\tframebuffer f = new framebuffer(int2(100, 100), Uno.Graphics.Format.RGBA_8_8_8_8_UInt_Normalize, true);\n\n\tstatic int poop;\n\n\tpublic void F()\n\t{\n\t\t$(f,poop)\n\t}\n\n\tpublic static void G()\n\t{\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint $(!Parse)\n\t}\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Math;\n\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tSin($(this)\n\t}\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tint k = Sin(this.GetHashCode());\n\t\tif (k == k)\n\t\t{\n\t\t\tUno.Content.Splines.Spline.$(!k, !Bar, !GetHashCode)\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\t1.0f$(!Equals, !MaxValue)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Foo\n{\n\tbool Bar()\n\t{\n\t\tvar a = true;\n\t\tif (a) return !a;\n\t\telse $(a)\n\t}\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodBody2.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodBody2 : Test\n\t{\n\t\t[Test]\n\t\tpublic void MethodBody200()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\n\nclass Stack<T>\n{\n\tT[] data;\n\tint index;\n\n\tpublic Stack(int size)\n\t{\n\t\tif (size <= 0) throw new Exception(\"\"Stack size must be positive and greater than zero\"\");\n\t\tdata = new T[size];\n\t\tindex = 0;\n\t}\n\n\tpublic void Push(T item)\n\t{\n\t\tif (index >= data.$(Length)\n\t}\n\n\tpublic T Pop()\n\t{\n\t\tif (index <= 0) throw new Exception(\"\"Stack underflow occurred\"\");\n\t\treturn data[--index];\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody201()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass Interpreter\n{\n\tpublic void Run(string[] input)\n\t{\n\t\tif (input.Length > 25) throw new Exception(\"\"Input must be 25 or less characters tall\"\");\n\t\tforeach (var s in input)\n\t\t{\n\t\t\tif (s.Length > 80) throw new Exception(\"\"Input must be 80 or less characters wide\"\");\n\t\t}\n\n\t\tstring[] grid = new String[25];\n\t\tfor (int i = 0; i < 25; i++)\n\t\t{\n\t\t\tgrid[i] = \"\"\"\";\n\t\t\tfor (int j = 0; j < 80; j++)\n\t\t\t{\n\t\t\t\tif (i < input.Length && j < input[i].Length)\n\t\t\t\t{\n\t\t\t\t\tgrid[i] += input[i][j];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgrid[i] += ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar ip = int2(0);\n\t\tvar ipDir = int2(1, 0);\n\t\tvar stack = new Stack<$(int)\n\t\twhile (true)\n\t\t{\n\t\t\tswitch (grid[ip.Y][ip.X])\n\t\t\t{\n\n\t\t\t}\n\t\t\tip += ipDir;\n\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t/*[Test]\n\t\tpublic void MethodBody202()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.UI;\n\nnamespace StandardLib.UI\n{\n\tclass PointerEventTest : Test\n\t{\n\t\tclass SomeClass\n\t\t{\n\t\t\tpublic event PointerEventHandler SomePointerEvent;\n\n\t\t\tpublic void OnSomePointerEvent(float2 pos, $(PointerEventType))\n\t\t\t{\n\t\t\t\tif (SomePointerEvent != null) SomePointerEvent(this, new PointerEventArgs(\n\t\t\t}\n\t\t}\n\n\t\tpublic PointerEventTest()\n\t\t\t: base(\"\"PointerEventTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new PointerEventArgs(float2(1.0f, 2.0f), PointerEventType.Click);\n\t\t\tassert(a is PointerEventArgs);\n\t\t\tassert(a is EventArgs);\n\t\t\tassert(compare(a.Position, float2(1.0f, 2.0f)));\n\t\t\tassert(a.Type == PointerEventType.Click);\n\t\t\tassert(compare(a.WorldPosition, float3(0.0f)));\n\t\t\tassert(!a.Handled);\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}*/\n\n\t\t[Test]\n\t\tpublic void MethodBody203()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.IO;\n\nnamespace StandardLib.IO\n{\n\tclass WriterTest : Test\n\t{\n\t\tclass SomeWriter : Writer\n\t\t{\n\t\t\tbyte[] internalData;\n\t\t\tbool isOpen = true;\n\t\t\tint position = 0;\n\n\t\t\tpublic override int Length { get { return internalData.Length; } }\n\t\t\tpublic override int Position { get { return position; } }\n\n\t\t\tpublic SomeWriter(int size)\n\t\t\t{\n\t\t\t\tinternalData = new byte[size];\n\t\t\t}\n\n\t\t\tvoid addByte(byte b)\n\t\t\t{\n\t\t\t\tif (!isOpen) throw new Exception(\"\"Stream is closed\"\");\n\t\t\t\tif (Position >= Length) throw new Exception(\"\"Buffer overflow has occurred\"\");\n\t\t\t}\n\n\t\t\tpublic override void Close()\n\t\t\t{\n\t\t\t\tisOpen = false;\n\t\t\t}\n\n\t\t\tpublic override void Write(byte[] data)\n\t\t\t{\n\t\t\t\tforeach (var b in data) addByte(b);\n\t\t\t}\n\n\t\t\tpublic override void Write(bool data)\n\t\t\t{\n\t\t\t\tWrite(data ? 1 : 0);\n\t\t\t}\n\n\t\t\tpublic override void Write(byte data)\n\t\t\t{\n\t\t\t\taddByte(data);\n\t\t\t}\n\n\t\t\tpublic override void Write(double data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 8; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(float data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 4; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(int data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 4; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(long data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 8; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(sbyte data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 8; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(short data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 2; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(uint data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 4; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(ulong data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 8; i++) addByte(0);\n\t\t\t}\n\n\t\t\tpublic override void Write(ushort data)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < 2; i++) addByte(0);\n\t\t\t}\n\t\t}\n\n\t\tpublic WriterTest()\n\t\t\t: base(\"\"WriterTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic void TestWriter(Writer w)\n\t\t{\n\t\t\t$(w)\n\n\t\t\tvar originalLength = w.Length;\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 0);\n\n\t\t\tw.Write(new byte[] { 1, 2, 3, 4, 5, 6 });\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 6);\n\n\t\t\tw.Write(false);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 10);\n\n\t\t\tw.Write((byte)12);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 11);\n\n\t\t\tw.Write(4.0);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 19);\n\n\t\t\tw.Write(2.4f);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 23);\n\n\t\t\tw.Write(5);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 27);\n\n\t\t\tw.Write((long)12343344);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 35);\n\n\t\t\tw.Write((sbyte)-12);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 36);\n\n\t\t\tw.Write((short)4);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 38);\n\n\t\t\tw.Write((uint)3244444);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 42);\n\n\t\t\tw.Write((ulong)23494949999);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 50);\n\n\t\t\tw.Write((ushort)6);\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 52);\n\n\t\t\tw.Write(byte2(23, 255));\n\t\t\tassert(w.Length == originalLength);\n\t\t\tassert(w.Position == 54);\n\n\t\t\tw.Write(byte4(1, 2, 3, 4));\n\t\t\tassert(\n\n\t\t\tw.Close();\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tTestWriter(new SomeWriter(200));\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t/*[Test]\n\t\tpublic void MethodBody204()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.UI;\n\nnamespace StandardLib.UI\n{\n\tclass WindowTest : Test\n\t{\n\t\tclass SomeClass\n\t\t{\n\t\t\tpublic event ResizeEventHandler Resize;\n\t\t\tpublic event ClosingEventHandler Closing;\n\n\t\t\tpublic void OnResize()\n\t\t\t{\n\t\t\t\tif (Resize != null) Resize(this, EventArgs.Empty);\n\t\t\t}\n\n\t\t\tpublic void OnClosing(ClosingEventArgs e)\n\t\t\t{\n\t\t\t\tif (Closing != null) Closing(this, e);\n\t\t\t}\n\t\t}\n\n\t\tclass CrapWindow : Window\n\t\t{\n\t\t\tpublic CrapWindow()\n\t\t\t{\n\t\t\t\tIsSoftKeyboardShowing = false;\n\t\t\t}\n\n\t\t\tpublic override void Close()\n\t\t\t{\n\t\t\t}\n\n\t\t\tpublic override string Title { get; set; }\n\t\t\tpublic override MouseCursor Cursor { get; set; }\n\t\t\tpublic override int2 Size { get; set; }\n\t\t\tpublic override bool Fullscreen { get; set; }\n\n\t\t\tpublic override bool HasSoftKeyboard { get { return true; } }\n\n\t\t\tpublic bool IsSoftKeyboardShowing { get; private set; }\n\t\t\tpublic override void ShowSoftKeyboard(KeyboardType type)\n\t\t\t{\n\t\t\t\tIsSoftKeyboardShowing = true;\n\t\t\t}\n\n\t\t\tpublic override void HideSoftKeyboard()\n\t\t\t{\n\t\t\t\tIsSoftKeyboardShowing = false;\n\t\t\t}\n\t\t}\n\n\t\tbool resizeHandled = false;\n\t\tvoid resizeHandler(object sender, EventArgs e)\n\t\t{\n\t\t\tresizeHandled = true;\n\t\t}\n\n\t\tbool closingHandled = false;\n\t\tvoid closingHandler(object sender, ClosingEventArgs e)\n\t\t{\n\t\t\tclosingHandled = e.Cancel;\n\t\t}\n\n\t\tpublic WindowTest()\n\t\t\t: base(\"\"WindowTest\"\")\n\t\t{\n\t\t}\n\n\t\tbool mouseDownHandled = false;\n\t\tvoid mouseDownHandler(object sender, MouseEventArgs e)\n\t\t{\n\t\t\tmouseDownHandled = true;\n\t\t}\n\n\t\tbool mouseUpHandled = false;\n\t\tvoid mouseUpHandler(object sender, MouseEventArgs e)\n\t\t{\n\t\t\tmouseUpHandled = true;\n\t\t}\n\n\t\tbool mouseMoveHandled = false;\n\t\tvoid mouseMoveHandler(object sender, MouseEventArgs e)\n\t\t{\n\t\t\tmouseMoveHandled = true;\n\t\t}\n\n\t\tbool mouseWheelHandled = false;\n\t\tvoid mouseWheelHandler(object sender, MouseEventArgs e)\n\t\t{\n\t\t\tmouseWheelHandled = true;\n\t\t}\n\n\t\tbool touchDownHandled = false;\n\t\tvoid touchDownHandler(object sender, TouchEventArgs e)\n\t\t{\n\t\t\ttouchDownHandled = true;\n\t\t}\n\n\t\tbool touchUpHandled = false;\n\t\tvoid touchUpHandler(object sender, TouchEventArgs e)\n\t\t{\n\t\t\ttouchUpHandled = true;\n\t\t}\n\n\t\tbool touchMoveHandled = false;\n\t\tvoid touchMoveHandler(object sender, TouchEventArgs e)\n\t\t{\n\t\t\ttouchMoveHandled = true;\n\t\t}\n\n\t\tbool keyDownHandled = false;\n\t\tvoid keyDownHandler(object sender, KeyEventArgs e)\n\t\t{\n\t\t\tkeyDownHandled = true;\n\t\t}\n\n\t\tbool keyUpHandled = false;\n\t\tvoid keyUpHandler(object sender, KeyEventArgs e)\n\t\t{\n\t\t\tkeyUpHandled = true;\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new ClosingEventArgs();\n\t\t\tassert(a is ClosingEventArgs);\n\t\t\tassert(a is EventArgs);\n\t\t\tassert(!a.Cancel);\n\n\t\t\tvar b = new SomeClass();\n\t\t\tassert(!resizeHandled);\n\t\t\tb.OnResize();\n\t\t\tassert(!resizeHandled);\n\t\t\tb.Resize += resizeHandler;\n\t\t\tassert(!resizeHandled);\n\t\t\tb.OnResize();\n\t\t\tassert(resizeHandled);\n\n\t\t\tassert(!closingHandled);\n\t\t\tb.OnClosing(new ClosingEventArgs());\n\t\t\tassert(!closingHandled);\n\t\t\tb.Closing += closingHandler;\n\t\t\tassert(!closingHandled);\n\t\t\tb.OnClosing(new ClosingEventArgs());\n\t\t\tassert(!closingHandled);\n\t\t\tvar c = new ClosingEventArgs();\n\t\t\tc.Cancel = true;\n\t\t\tb.OnClosing(c);\n\t\t\tassert(closingHandled);\n\n\t\t\tWindow d = new CrapWindow();\n\t\t\tassert(d is Window);\n\t\t\td.Close();\n\t\t\td.Title = \"\"hi mom\"\";\n\t\t\tassert(d.Title == \"\"hi mom\"\");\n\t\t\td.Cursor = MouseCursor.Crosshair;\n\t\t\tassert(d.Cursor == MouseCursor.Crosshair);\n\t\t\td.Cursor = MouseCursor.ResizeNorth;\n\t\t\tassert(d.Cursor == MouseCursor.ResizeNorth);\n\t\t\td.Cursor = MouseCursor.Progress;\n\t\t\tassert(d.Cursor == MouseCursor.Progress);\n\t\t\td.Size = int2(500, 400);\n\t\t\tassert(d.Size == int2(500, 400));\n\t\t\td.Fullscreen = true;\n\t\t\tassert(d.Fullscreen);\n\t\t\td.Fullscreen = false;\n\t\t\tassert(!d.Fullscreen);\n\t\t\tassert(d.HasSoftKeyboard);\n\t\t\tassert(!((CrapWindow)d).IsSoftKeyboardShowing);\n\t\t\td.ShowSoftKeyboard(KeyboardType.Phone);\n\t\t\tassert(((CrapWindow)d).IsSoftKeyboardShowing);\n\t\t\td.HideSoftKeyboard();\n\t\t\tassert(!((CrapWindow)d).IsSoftKeyboardShowing);\n\t\t\tresizeHandled = false;\n\t\t\tassert(!mouseDownHandled);\n\t\t\tassert(!mouseUpHandled);\n\t\t\tassert(!mouseMoveHandled);\n\t\t\tassert(!mouseWheelHandled);\n\t\t\tassert(!touchDownHandled);\n\t\t\tassert(!touchUpHandled);\n\t\t\tassert(!touchMoveHandled);\n\t\t\tassert(!keyDownHandled);\n\t\t\tassert(!keyUpHandled);\n\t\t\tassert(!resizeHandled);\n\t\t\td.OnMouseDown(new MouseEventArgs(2, 4));\n\t\t\td.OnMouseUp(new MouseEventArgs(-12, 8444));\n\t\t\td.OnMouseMove(new MouseEventArgs(566, 34));\n\t\t\td.OnMouseWheel(new MouseEventArgs(234, 234));\n\t\t\td.OnTouchDown(new TouchEventArgs(0, float2(.4f, .5f)));\n\t\t\td.OnTouchUp(new TouchEventArgs(667, float2(.8f, .2f)));\n\t\t\td.OnTouchMove(new TouchEventArgs(-7, float2(.04f, .244f)));\n\t\t\td.OnKeyDown(new KeyEventArgs(Keys.B));\n\t\t\td.OnKeyUp(new KeyEventArgs(Keys.Space));\n\t\t\td.OnResize(EventArgs.Empty);\n\t\t\tassert(!mouseDownHandled);\n\t\t\tassert(!mouseUpHandled);\n\t\t\tassert(!mouseMoveHandled);\n\t\t\tassert(!mouseWheelHandled);\n\t\t\tassert(!touchDownHandled);\n\t\t\tassert(!touchUpHandled);\n\t\t\tassert(!touchMoveHandled);\n\t\t\tassert(!keyDownHandled);\n\t\t\tassert(!keyUpHandled);\n\t\t\tassert(!resizeHandled);\n\t\t\td.MouseDown += mouseDownHandler;\n\t\t\td.MouseUp += mouseUpHandler;\n\t\t\td.MouseMove += mouseMoveHandler;\n\t\t\td.MouseWheel += mouseWheelHandler;\n\t\t\td.TouchDown += touchDownHandler;\n\t\t\td.TouchUp += touchUpHandler;\n\t\t\td.TouchMove += touchMoveHandler;\n\t\t\td.KeyDown += keyDownHandler;\n\t\t\td.KeyUp += keyUpHandler;\n\t\t\td.Resize += resizeHandler;\n\t\t\td.OnMouseDown(new MouseEventArgs(2, 4));\n\t\t\td.OnMouseUp(new MouseEventArgs(-12, 8444));\n\t\t\td.OnMouseMove(new MouseEventArgs(566, 34));\n\t\t\td.OnMouseWheel(new MouseEventArgs(234, 234));\n\t\t\td.OnTouchDown(new TouchEventArgs(0, float2(.4f, .5f)));\n\t\t\td.OnTouchUp(new TouchEventArgs(667, float2(.8f, .2f)));\n\t\t\td.OnTouchMove(new TouchEventArgs(-7, float2(.04f, .244f)));\n\t\t\td.OnKeyDown(new KeyEventArgs(Keys.B));\n\t\t\td.OnKeyUp(new KeyEventArgs(Keys.Space));\n\t\t\td.OnResize(EventArgs.Empty);\n\t\t\tassert(mouseDownHandled);\n\t\t\tassert(mouseUpHandled);\n\t\t\tassert(mouseMoveHandled);\n\t\t\tassert(mouseWheelHandled);\n\t\t\tassert(touchDownHandled);\n\t\t\tassert(touchUpHandled);\n\t\t\tassert(touchMoveHandled);\n\t\t\tassert(keyDownHandled);\n\t\t\tassert(keyUpHandled);\n\t\t\tassert(resizeHandled);\n\t\t\tmouseDownHandled = mouseUpHandled = mouseMoveHandled = mouseWheelHandled = false;\n\t\t\ttouchDownHandled = touchUpHandled = touchMoveHandled = false;\n\t\t\tkeyDownHandled = keyUpHandled = false;\n\t\t\tresizeHandled = false;\n\t\t\tassert(!mouseDownHandled);\n\t\t\tassert(!mouseUpHandled);\n\t\t\tassert(!mouseMoveHandled);\n\t\t\tassert(!mouseWheelHandled);\n\t\t\tassert(!touchDownHandled);\n\t\t\tassert(!touchUpHandled);\n\t\t\tassert(!touchMoveHandled);\n\t\t\tassert(!keyDownHandled);\n\t\t\tassert(!keyUpHandled);\n\t\t\tassert(!resizeHandled);\n\t\t\tWindowHelpers.EmulateMouseAsTouchEvents(d);\n\t\t\td.OnMouseDown(new MouseEventArgs(3, 4));\n\t\t\td.OnMouseMove(new MouseEventArgs(6, 8));\n\t\t\td.OnMouseUp(new MouseEventArgs(1, 1));\n\t\t\tassert(mouseDownHandled);\n\t\t\tassert(mouseUpHandled);\n\t\t\tassert(mouseMoveHandled);\n\t\t\tassert(touchDownHandled);\n\t\t\tassert(touchUpHandled);\n\t\t\tassert(touchMoveHandled);\n\t\t\tmouseDownHandled = mouseUpHandled = mouseMoveHandled = false;\n\t\t\ttouchDownHandled = touchUpHandled = touchMoveHandled = false;\n\t\t\tvar e = new CrapWindow();\n\t\t\te.OnTouchDown(new TouchEventArgs(4, float2(4.0f, 5.0f)));\n\t\t\te.OnTouchMove(new TouchEventArgs(4, float2(8.0f, 2.0f)));\n\t\t\te.OnTouchUp(new TouchEventArgs(4, float2(6.2f, 87.0f)));\n\t\t\tassert(!mouseDownHandled);\n\t\t\tassert(!mouseUpHandled);\n\t\t\tassert(!mouseMoveHandled);\n\t\t\tassert(!touchDownHandled);\n\t\t\tassert(!touchUpHandled);\n\t\t\tassert(!touchMoveHandled);\n\t\t\te.($MouseDown, !Handled)\n\t\t\tWindowHelpers.EmulateTouchAsMouseEvents(e);\n\t\t\te.OnTouchDown(new TouchEventArgs(4, float2(4.0f, 5.0f)));\n\t\t\te.OnTouchMove(new TouchEventArgs(4, float2(8.0f, 2.0f)));\n\t\t\te.OnTouchUp(new TouchEventArgs(4, float2(6.2f, 87.0f)));\n\t\t\tassert(mouseDownHandled);\n\t\t\tassert(mouseUpHandled);\n\t\t\tassert(mouseMoveHandled);\n\t\t\tassert(touchDownHandled);\n\t\t\tassert(touchUpHandled);\n\t\t\tassert(touchMoveHandled);\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}*/\n\n\t\t[Test]\n\t\tpublic void MethodBody205()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace StandardLib.Scenes\n{\n\tclass DistanceSorterTest : Test\n\t{\n\t\tpublic DistanceSorterTest()\n\t\t\t: base(\"\"DistanceSorterTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new DistanceSorter<$(int)\n\t\t}\n\t}\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody206()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass FOo\n{\n\tvoid Bar()\n\t{\n\t\tnull.$(!Uno, !if, !null)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody207()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace StandardLib.Scenes\n{\n\tclass AnimationTest : Test\n\t{\n\t\tclass BasicAnimation : Animation\n\t\t{\n\t\t\tdouble[] times = new [] { 0.0, .1, 2, .3 };\n\t\t\tdouble[] values = new [] { 1.0, 2.0, 3.0, 4.0 };\n\t\t\tTransitionType[] transitionTypes = new [] { TransitionType.Linear, TransitionType.Linear, TransitionType.Linear, TransitionType.Linear };\n\t\t\tTransitionModifier[] transitionModifiers = new [] { TransitionModifier.None, TransitionModifier.None, TransitionModifier.None, TransitionModifier.None };\n\n\t\t\tpublic override double GetLength()\n\t\t\t{\n\t\t\t\treturn .4;\n\t\t\t}\n\n\t\t\tpublic float CurrentValue = default(float);\n\n\t\t\tprotected override void update(double time)\n\t\t\t{\n\t\t\t\tCurrentValue = (float)getValue(time, values, values, times, transitionTypes, transitionModifiers, values.Length);\n\t\t\t}\n\t\t}\n\n\t\tpublic AnimationTest()\n\t\t\t: base(\"\"AnimationTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new BasicAnimation();\n\t\t\t$(assert)\n\t\t}\n\t}\n}\"\n            );\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodBody3.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodBody3 : Test\n\t{\n\t\t[Test]\n\t\tpublic void MethodBody300()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\n\nclass Stack<T>\n{\n\tT[] data;\n\tint index;\n\n\tpublic Stack(int size)\n\t{\n\t\tif (size <= 0) throw new Exception(\"\"Stack size must be positive and greater than zero\"\");\n\t\tdata = new T[size];\n\t\tindex = 0;\n\t}\n\n\tpublic void Push(T item)\n\t{\n\t\tif ($(index)\n\t}\n\n\tpublic T Pop()\n\t{\n\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody301()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Stack<T>\n{\n\t$(T)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody302()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass Stack<T>\n{\n\tT[] data;\n\tint index;\n\n\tpublic Stack(int size)\n\t{\n\t\tif (size <= 0) throw new Exception(\"\"Stack size must be positive and greater than zero\"\");\n\t\tdata = new T[size];\n\t\tindex = 0;\n\t}\n\n\tpublic void Push(T item)\n\t{\n\t\tif ($(index)\n\t}\n\n\tpublic $(T)\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody303()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass Stack<T>\n{\n\tT[] data;\n\tint index;\n\n\tpublic Stack(int size)\n\t{\n\t\tif (size <= 0) throw new Exception(\"\"Stack size must be positive and greater than zero\"\");\n\t\tdata = new $(T)\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodBody4.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodBody4 : Test\n\t{\n\t\t[Test]\n\t\tpublic void MethodBody400()\n\t\t{\n\t\t\tAssertCode(\n@\"public class A\n{\n\tpublic void F()\n\t{\n\t\tint a;\n\t\tint p = $(Uno, int, a)\n\t}\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody401()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint b;\n\t\tint $(!ToString, !GetHashCode)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody402()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tA a = new $(A, Uno)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody403()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tframebuffer f = new framebuffer(int2(100, 100), Uno.Graphics.Format.RGBA_8_8_8_8_UInt_Normalize, true);\n\n\tpublic void F()\n\t{\n\t\t$(f)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody404()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tframebuffer f = new framebuffer(int2(100, 100), Uno.Graphics.Format.RGBA_8_8_8_8_UInt_Normalize, true);\n\n\tstatic int poop;\n\n\tpublic void F()\n\t{\n\n\t}\n\n\tpublic static void G()\n\t{\n\t\t$(poop,!f)\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodBody5.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodBody5 : Test\n\t{\n\t\t[Test]\n\t\tpublic void MethodBody500()\n\t\t{\n\t\t\tAssertCode(\n@\"static class ArrayTest\n{\n\tpublic static void Run()\n\t{\n\t\tint[] foo = new [] { 2, 1, 3 };\n\n\t\t$(foo, Uno)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody501()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace Uno\n{\n\tpublic class Foo\n\t{\n\t\tpublic void Sort(Comparison<T> comparer)\n\t\t{\n\t\t\t$(Uno)\n\t\t\t//Array.(data, comparer, 0, used);\n\t\t}\n\t}\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t/*[Test]\n\t\tpublic void MethodBody502()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class Foo: Uno.Application\n{\n\tpublic Foo()\n\t{\n\t\t$(Clear)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}*/\n\n\t\t[Test]\n\t\tpublic void MethodBody503()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace dfhagds\n{\n    class App : Uno.Application\n    {\n        public override void Draw()\n        {\n\n\t\t\t$(App)\n\n        }\n    }\n}\n\"\n            );\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodBody6.cs",
    "content": "namespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodBody6 : Test\n\t{\n\t\t/*[Test]\n\t\tpublic void MethodBody600()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\n\nclass Interpreter\n{\n\tpublic void Run(string[] input)\n\t{\n\t\tif (input.Length > 25) throw new Exception(\"\"Input must be 25 or less characters tall\"\");\n\t\tforeach (var s in input)\n\t\t{\n\t\t\tif (s.Length > 80) throw new Exception(\"\"Input must be 80 or less characters wide\"\");\n\t\t}\n\n\t\tstring[] grid = new String[25];\n\t\tfor (int i = 0; i < 25; i++)\n\t\t{\n\t\t\tgrid[i] = \"\"\"\";\n\t\t\tfor (int j = 0; j < 80; j++)\n\t\t\t{\n\t\t\t\tif (i < input.Length && j < input[i].Length)\n\t\t\t\t{\n\t\t\t\t\tgrid[i] += input[i][j];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgrid[i] += ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar ip = int2(0);\n\t\tvar ipDir = int2(1, 0);\n\t\tvar stack = new Stack<int>(1000);\n\t\tvar random = new Random(12345);\n\t\tbool done = false;\n\t\twhile (!done)\n\t\t{\n\t\t\tvar c = grid[ip.Y][ip.X];\n\t\t\tif (c >= '0' && c <= '9')\n\t\t\t{\n\t\t\t\tstack.Push((int)c - '0');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (c)\n\t\t\t\t{\n\t\t\t\t\tcase '+':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a + b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '-':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b - a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a * b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '/':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b / a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '%':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b % a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '!': stack.Push(stack.Pop() == 0 ? 1 : 0); break;\n\n\t\t\t\t\tcase '\\'':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b > a ? 1 : 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '>': ipDir = int2( 1,  0); break;\n\t\t\t\t\tcase '<': ipDir = int2(-1,  0); break;\n\t\t\t\t\tcase '^': ipDir = int2( 0, -1); break;\n\t\t\t\t\tcase 'v': ipDir = int2( 0,  1); break;\n\n\t\t\t\t\tcase '?':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (random.NextInt(4))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tipDir = int2( 1,  0);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 1: ipDir = int2(-1,  0); break;\n\t\t\t\t\t\t\t\tcase 2: ipDir = int2( 0, -1); break;\n\t\t\t\t\t\t\t\tcase 3: ipDir = int2( 0,  1); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '_':\n\t\t\t\t\t\tswitch (stack.Pop())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0: ipDir = int2( 1,  0); break;\n\t\t\t\t\t\t\tdefault: ipDir = int2(-1,  0); break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '|':\n\t\t\t\t\t\tswitch (stack.Pop())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0: ipDir = int2( 0,  1); break;\n\t\t\t\t\t\t\tdefault: ipDir = int2( 0, -1); break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '\"\"':\n\t\t\t\t\t\t// TODO: string mode\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ':':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a);\n\t\t\t\t\t\t\tstack.Push(a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a);\n\t\t\t\t\t\t\tstack.Push(b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '$': stack.Pop(); break;\n\n\t\t\t\t\tcase '.': Uno.Platform.System.Log(stack.Pop().ToString()); break;\n\t\t\t\t\tcase ',': Uno.Platform.System.Log(((char)stack.Pop()).ToString()); break;\n\n\t\t\t\t\tcase '#':\n\t\t\t\t}\n\t\t\t}\n\t\t\tip = int2((ip.X + ipDir.X) % 80, (ip.Y + ipDir.Y) % 25);\n\n\t\t\tbreak;\n\t\t}\n\n\t\tstatic void step($(ref,out)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody601()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass Interpreter\n{\n\tpublic void Run(string[] input)\n\t{\n\t\tif (input.Length > 25) throw new Exception(\"\"Input must be 25 or less characters tall\"\");\n\t\tforeach (var s in input)\n\t\t{\n\t\t\tif (s.Length > 80) throw new Exception(\"\"Input must be 80 or less characters wide\"\");\n\t\t}\n\n\t\tstring[] grid = new String[25];\n\t\tfor (int i = 0; i < 25; i++)\n\t\t{\n\t\t\tgrid[i] = \"\"\"\";\n\t\t\tfor (int j = 0; j < 80; j++)\n\t\t\t{\n\t\t\t\tif (i < input.Length && j < input[i].Length)\n\t\t\t\t{\n\t\t\t\t\tgrid[i] += input[i][j];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgrid[i] += ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar ip = int2(0);\n\t\tvar ipDir = int2(1, 0);\n\t\tvar stack = new Stack<int>(1000);\n\t\tvar random = new Random(12345);\n\t\tbool done = false;\n\t\twhile (!done)\n\t\t{\n\t\t\tvar c = grid[ip.Y][ip.X];\n\t\t\tif (c >= '0' && c <= '9')\n\t\t\t{\n\t\t\t\tstack.Push((int)c - '0');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (c)\n\t\t\t\t{\n\t\t\t\t\tcase '+':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a + b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '-':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b - a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '*':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a * b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '/':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b / a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '%':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b % a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '!': stack.Push(stack.Pop() == 0 ? 1 : 0); break;\n\n\t\t\t\t\tcase '\\'':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(b > a ? 1 : 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '>': ipDir = int2( 1,  0); break;\n\t\t\t\t\tcase '<': ipDir = int2(-1,  0); break;\n\t\t\t\t\tcase '^': ipDir = int2( 0, -1); break;\n\t\t\t\t\tcase 'v': ipDir = int2( 0,  1); break;\n\n\t\t\t\t\tcase '?':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (random.NextInt(4))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tipDir = int2( 1,  0);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 1: ipDir = int2(-1,  0); break;\n\t\t\t\t\t\t\t\tcase 2: ipDir = int2( 0, -1); break;\n\t\t\t\t\t\t\t\tcase 3: ipDir = int2( 0,  1); break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '_':\n\t\t\t\t\t\tswitch (stack.Pop())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0: ipDir = int2( 1,  0); break;\n\t\t\t\t\t\t\tdefault: ipDir = int2(-1,  0); break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '|':\n\t\t\t\t\t\tswitch (stack.Pop())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0: ipDir = int2( 0,  1); break;\n\t\t\t\t\t\t\tdefault: ipDir = int2( 0, -1); break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '\"\"':\n\t\t\t\t\t\t// TODO: string mode\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ':':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a);\n\t\t\t\t\t\t\tstack.Push(a);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar a = stack.Pop();\n\t\t\t\t\t\t\tvar b = stack.Pop();\n\t\t\t\t\t\t\tstack.Push(a);\n\t\t\t\t\t\t\tstack.Push(b);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '$': stack.Pop(); break;\n\n\t\t\t\t\tcase '.': Uno.Platform.System.Log(stack.Pop().ToString()); break;\n\t\t\t\t\tcase ',': Uno.Platform.System.Log(((char)stack.Pop()).ToString()); break;\n\n\t\t\t\t\tcase '#':\n\t\t\t\t}\n\t\t\t}\n\t\t\tstep($(ref)\n\n\t\t\tbreak;\n\t\t}\n\n\t\tstatic void step(ref int2 ip, int2 ipDir)\n\t\t{\n\t\t\tip = int2((ip.X + ipDir.X) % 80, (ip.Y + ipDir.Y) % 25);\n\t\t}\n\t}\n}\"\n\t\t\t);\n\t\t}*/\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodBody7.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodBody7 : Test\n\t{\n\t\t[Test]\n\t\tpublic void MethodBody700()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace StandardLib.UI\n{\n\tclass PointerEventTest : Test\n\t{\n\t\tpublic PointerEventTest()\n\t\t\t: base(\"\"PointerEventTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new PointerEventArgs($(float2)\n\t\t\tassert(a is PointerEventArgs);\n\t\t\tassert(a is EventArgs);\n\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody701()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace StandardLib.UI\n{\n\tclass EventArgsTest : Test\n\t{\n\t\tclass SomeClass\n\t\t{\n\t\t\tpublic event EventHandler SomeEvent;\n\n\t\t\tpublic void OnSomeEvent()\n\t\t\t{\n\t\t\t\tif (SomeEvent != $(null)\n\t\t\t}\n\t\t}\n\n\t\tpublic EventArgsTest()\n\t\t\t: base(\"\"EventArgsTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = EventArgs.Empty;\n\t\t\tassert(a is EventArgs);\n\n\t\t\tvar b = new SomeClass();\n\t\t\thandled = false;\n\t\t\tassert(!handled);\n\t\t\tb.OnSomeEvent();\n\t\t\tassert(!handled);\n\t\t\tb.SomeEvent += someHandler;\n\t\t\tassert(!handled);\n\t\t\tb.OnSomeEvent();\n\t\t\tassert(handled);\n\t\t}\n\n\t\tbool handled;\n\t\tvoid someHandler(object sender, EventArgs e)\n\t\t{\n\t\t\thandled = true;\n\t\t\tassert(e is EventArgs);\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n        [Test]\n        public void MethodBody702()\n        {\n            AssertCode(\n            @\"\n                class Foo\n                {\n                    public void Test(int foo=0)\n                    {\n                        $(foo)\n                    }\n                }\n            \");\n        }\n\n        [Test]\n        public void MethodBody703()\n        {\n            AssertCode(\n            @\"\n                class Foo\n                {\n                    public void foobar(float2 targetPos = float2(0))\n                    {\n                        $(targetPos)\n                    }\n                }\n            \");\n        }\n\n        [Test]\n        public void MethodBody704()\n        {\n            AssertCode(\n            @\"\n                class Foo\n                {\n                    public void foobar(Uno.UI.Element el, float2 targetPos = float2(0))\n                    {\n                        $(el, targetPos)\n                    }\n                }\n            \");\n        }\n\n\t\t/*[Test]\n\t\tpublic void MethodBody702()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.UI;\n\nnamespace StandardLib.UI\n{\n\tclass PointerEventTest : Test\n\t{\n\t\tpublic PointerEventTest()\n\t\t\t: base(\"\"PointerEventTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new PointerEventArgs(float2(1.0f, 2.0f), $(PointerEventType, !a)\n\t\t\tassert(a is PointerEventArgs);\n\t\t\tassert(a is EventArgs);\n\n\t\t}\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodBody703()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.UI;\n\nnamespace StandardLib.UI\n{\n\tclass PointerEventTest : Test\n\t{\n\t\tpublic PointerEventTest()\n\t\t\t: base(\"\"PointerEventTest\"\")\n\t\t{\n\t\t}\n\n\t\tpublic override void Run()\n\t\t{\n\t\t\tvar a = new PointerEventArgs(float2(1.0f, 2.0f), PointerEventType.Click);\n\t\t\tassert(a is PointerEventArgs);\n\t\t\tassert(a is EventArgs);\n\t\t\tassert(compare(a.Position, float2(1.0f, 2.0f));\n\t\t\tassert(a.Type == $(PointerEventType)\n\t\t}\n\t}\n}\n\"\n\t\t\t);\n\t\t}*/\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodReturn.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodReturn : Test\n    {\n        [Test]\n        public void MethodReturn01()\n        {\n            AssertCode(\n@\"\nclass Bar\n{\n    Bar GetBar()\n    {\n        return this;\n    }\n\n    void Foo()\n    {\n        GetBar().$(Foo)\n    }\n}\n\");\n        }\n\n        [Test]\n        public void MethodReturn02()\n        {\n            AssertCode(\n@\"\nclass Bar\n{\n    void Foo()\n    {\n        GetBar().$(Foo)\n    }\n\n    Bar GetBar()\n    {\n        return this;\n    }\n}\n\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/MethodVariables.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class MethodVariables : Test\n\t{\n\t\t[Test]\n\t\tpublic void MethodVariables00()\n\t\t{\n\t\t\tAssertCode(\n@\"public class b\n{\n\tpublic void c(int derk)\n\t{\n\t\t$(derk)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodVariables01()\n\t\t{\n\t\t\tAssertCode(\n@\"\npublic class b\n{\n\tpublic void c(int derk)\n\t{\n\t\tif($(derk)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodVariables02()\n\t\t{\n\t\t\tAssertCode(\n@\"\npublic class b\n{\n\tpublic int c(int derk)\n\t{\n\t\treturn $(derk)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodVariables03()\n\t\t{\n\t\t\tAssertCode(\n@\"\npublic class b\n{\n\tpublic int c(int derk)\n\t{\n\t\t\treturn derk;\n\t}\n\tpublic int d()\n\t{\n\t\treturn $(!derk)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MethodVariables04()\n\t\t{\n\t\t\tAssertCode(\n@\"\npublic class b\n{\n\tint e  = 5;\n\tpublic int c(int derk)\n\t{\n\t\t\treturn derk;\n\t}\n\tpublic int d()\n\t{\n\t\treturn $(e)\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/NewTest.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class NewTest : Test\n    {\n\t\t[Test]\n        public void NewTest00()\n        {\n            AssertCode(\n@\"\nusing Uno.Collections;\n\nclass A\n{\n    public A()\n    {\n        List<int> a = new $(List<int>)\n    }\n}\n\n\"\n            );\n        }\n\n        [Test]\n        public void NewTest01()\n        {\n            AssertCode(\n@\"\n\nenum A\n{\n    A, B\n}\n\nclass B\n{\n    A a = $(A)\n}\"\n            );\n        }\n\n\t\t[Test]\n        public void NewTest03()\n        {\n            AssertCode(\n@\"\n    using Uno.Collections;\n\n    class Foo\n    {\n        List<int> bar;\n        void foo()\n        {\n            bar = new $(List<int>)\n        }\n\n\");\n\n        }\n\n        [Test]\n        public void NewTest04()\n        {\n            AssertCode(\n@\"\n\n    class Foo\n    {\n        Uno.Application bar;\n        void foo()\n        {\n            bar = new $(Uno.Application)\n        }\n\");\n\n        }\n\n        [Test]\n        public void NewTest05()\n        {\n            AssertCode(\n@\"\n\nclass A\n{\n    public A()\n    {\n        Uno.Collections.List<int> a = new $(Uno.Collections.List<int>)\n    }\n}\n\n\"\n            );\n        }\n\n        [Test]\n        public void NewTest06()\n        {\n            AssertCode(\n@\"\nusing Uno;\n\nclass A\n{\n    Uno.Collections.List<int> a;\n    public A()\n    {\n        a = new $(!Collections.List<int>)\n    }\n}\n\n\"\n            );\n        }\n    }\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/NoHintScenarios.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class NoHintScenarios : Test\n\t{\n\t\t[Test]\n\t\tpublic void NoHintScenarios00()\n\t\t{\n\t\t\tAssertCode(\n@\"class Bar\n{\n    string Foo()\n    {\n        return \"\"fooo $(!Uno, !using, !public)\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoHintScenarios01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Bar\n{\n    string Foo()\n    {\n        return \"\"$(!Uno, !using, !public)\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoHintScenarios02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Bar\n{\n    string Foo()\n    {\n        return \"\"asd\"\".$(Equals)\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoHintScenarios03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Bar\n{\n    string Foo()\n    {\n        return // $(!Uno)\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoHintScenarios04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Bar\n{\n    string Foo()\n    {\n        /*\n\n            return $(!Uno)\n\n        */\n    }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoHintScenarios05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\npublic class A\n{\n\tpublic void F()\n\t{\n\t\tint b;\n\t\tint a = new int();\n\n\t\t// asd\n        $(Uno);\n\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoHintScenarios06()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Uno.Content;\nusing Uno.Content.Models;\n\nnamespace BaseTest\n{\n\tclass A\n\t{\n\t\tpublic A(string lol)\n\t\t{\n\t\t}\n\t}\n\n\tclass B\n\t{\n\t\tpublic B()\n\t\t\t: $(!Uno, !int, !BaseStructure, !BaseVertex)\n\t\t{\n\t\t}\n\t}\n\n    class App : Uno.Application\n    {\n        public override void Draw()\n        {\n        }\n    }\n}\n\n\"\n            );\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoHintScenarios07()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\nusing Uno.Audio;\nusing Uno.Content;\nusing Uno.Content.Models;\n\nnamespace BaseTest\n{\n\tclass A\n\t{\n\t\tpublic A(string lol)\n\t\t{\n\t\t}\n\t}\n\n\tclass B\n\t{\n\t\tpublic B()\n\t\t\t: b$(!Uno, !int, !BaseStructure, !BaseVertex)\n\t\t{\n\t\t}\n\t}\n\n    class App : Uno.Application\n    {\n        public override void Draw()\n        {\n        }\n    }\n}\"\n            );\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Numbers.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Numbers : Test\n\t{\n\t\t[Test]\n\t\tpublic void Numbers00()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo\n{\n\tvoid Bar()\n\t{\n\t\t1.$(!ToString, !GetHashCode)\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Override.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Override : Test\n\t{\n\t\t[Test]\n\t\tpublic void Override00()\n\t\t{\n\t\t\tAssertCode(\n@\"class A\n{\n\tpublic void B() {}\n\tpublic virtual void C() {}\n\n\tpublic float D { get { return 0.0f; } set { } }\n\tpublic abstract float E { get { return 0.0f; } set { } }\n\n}\n\nclass G: A\n{\n\toverride $(!B, C, E, !D)\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/PrivateMembers.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class PrivateMembers : Test\n\t{\n\t\t[Test]\n\t\tpublic void PrivateMembers00()\n\t\t{\n\t\t\tAssertCode(\n@\"public class A\n{\n\tint p;\n\n\tpublic void F() { $(p) }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PrivateMembers01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\npublic class A\n{\n\tint p { get { return 1; } }\n\n\tpublic void F() { $(p) }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PrivateMembers02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\npublic class A\n{\n\tint p() { return 1; }\n\n\tpublic void F() { $(p) }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PrivateMembers03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\npublic class A\n{\n\tprotected int p;\n}\n\n\npublic class Baaa: Uno.Application\n{\n\tpublic void F() { $(Draw) }\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PrivateMembers04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\npublic class A\n{\n\tprivate int k;\n\tprotected int p;\n}\n\n\npublic class Baaa: A\n{\n\tpublic void F() { $(p, !k) }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PrivateMembers05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno.Graphics;\n\nclass Bar\n{\n\tTexture2D t = new Texture2D();\n\n\tpublic int k;\n\n\tpublic Bar()\n\t{\n\t\t$(k, t)\n\t}\n\n\tpublic void Foo()\n\t{\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/StaticMemberAccess.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class StaticMemberAccess : Test\n\t{\n\t\t[Test]\n\t\tpublic void StaticMemberAccess00()\n\t\t{\n\t\t\tAssertCode(\n@\"class Foo\n{\n\tvoid Bar()\n\t{\n\t\tUno.Math.$(Log, !Foobar)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StaticMemberAccess01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tMath.$(Log, !Foobar)\n\t}\n}\"\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/SwitchCase.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class SwitchCase : Test\n\t{\n\t\t[Test]\n\t\tpublic void SwitchCase00()\n\t\t{\n\t\t\tAssertCode(\n@\"class b\n{\n\tb()\n\t{\n\t\tint num = 0;\n\t\tswitch(num)\n\t\t{\n\t\t \t$(case)\n\t\t}\n\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SwitchCase01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tb()\n\t{\n\t\tint num = 0;\n\t\tswitch(num)\n\t\t{\n\t\t \tcase 0:\n\t\t\t\t$(break)\n\t\t}\n\n\t}\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SwitchCase02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tb()\n\t{\n\t\tint num = 0;\n\t\tswitch(num)\n\t\t{\n\t\t \tcase 0:\n\t\t\t\tbreak;\n\t\t\t$(case,default)\n\t\t}\n\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SwitchCase03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tb()\n\t{\n\t\tint num = 0;\n\t\tswitch(num)\n\t\t{\n\t\t \tcase 0:\n\t\t\t\tbreak;\n\t\t\tcase:\n\t\t\t\tbreak;\n\t\t\t$(case,default)\n\t\t}\n\n\t}\n}\n\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SwitchCase04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass b\n{\n\tpublic void derp()\n\t{\n\t\ttry\n\t\t{\n\t\t\tint i = 5;\n\t\t}\n\t\tcatch($(Exception,IndexOutOfRangeException,InvalidCastException,InvalidOperationException,!int,!float,!double,!bool)\n\t}\n\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/SwizzlerTypes.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class SwizzlerTypes : Test\n    {\n        [Test]\n        public void SwizzlerTypes01()\n        {\n            AssertCode(\n@\"\nclass Foo : Uno.Application\n{\n\tpublic override void Draw()\n\t{\n\t\tdraw this, Cube,\n\t\t{\n\t\t\tapply DefaultShading;\n\t\t\tfloat2 FragCoord: float2(pixel ClipPosition.X, pixel ClipPosition.Y);\n\t\t\tFragCoord: prev.$(XY, YX, !YZ)\n\t\t};\n\t}\n}\n\");\n        }\n\n        [Test]\n        public void SwizzlerTypes02()\n        {\n            AssertCode(\n@\"\nclass Foo\n{\n    public sbyte2 test;\n\tpublic void Test()\n\t{\n        test.$(X, XX, !YZ)\n\t}\n}\n\");\n        }\n\n        [Test]\n        public void SwizzlerTypes03()\n        {\n            AssertCode(\n@\"\nclass Foo\n{\n    public ushort4 test;\n\tpublic void Test()\n\t{\n        test.$(X, XX, YZW, WWWW)\n\t}\n}\n\");\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/TryCatch.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class TryCatch : Test\n\t{\n\t\t[Test]\n\t\tpublic void TryCatch00()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\n\nclass b\n{\n\tpublic void derp()\n\t{\n\t\ttry\n\t\t{\n\t\t\tint i = 5;\n\t\t}\n\t\tcatch($(Exception,IndexOutOfRangeException,InvalidCastException,InvalidOperationException,!int,!float,!double,!bool)\n\t}\n\n}\"\n\t\t\t);\n\t\t}\n\n        [Test]\n        public void TryCatch01()\n        {\n            AssertCode(\n@\"using Uno;\n\nclass b\n{\n\tpublic void derp()\n\t{\n\t\ttry\n\t\t{\n\t\t\tint i = 5;\n\t\t}\n\t\tcatch(Exception e)\n        {\n        }\n\t}\n\n    public void Foo()\n    {\n        int test = 20;\n        $(test)\n    }\n\n}\"\n            );\n        }\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Using_.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Using_ : Test\n\t{\n\t\t[Test]\n\t\tpublic void Using_00()\n\t\t{\n\t\t\tAssertCode(\n@\"using $(Uno, OpenGL, !Static, !Platform);\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Using_01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno, $(!Uno)\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Using_02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass Bar\n{\n\tvoid Foo() { $(Math, Matrix, Vector); }\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Using_03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass Bar: $(!Application)\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Using_04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nclass Bar: $(Application, Vector, !UInt)\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Using_05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\n\nnamespace hah\n{\n\tpublic class Bar: Application\n\t{\n\t\t$(Uno, Application, Float, Vector)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Using_06()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nnamespace hah\n{\n\tpublic class Bar: Application\n\t{\n\t\t$(Uno, !Application, !Float, !Vector)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/Using_Static.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class Using_Static : Test\n\t{\n\t\t[Test]\n\t\tpublic void Using_Static00()\n\t\t{\n\t\t\tAssertCode(\n@\"using Uno;\nusing $(Math, Matrix, Vector);\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n        public void Using_Static01()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing $(Uno, !Math)Uno.Math;\nusing Matrix;\n\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\tMath.A$(Abs);\n\t}\n}\"\n            );\n        }\n\n\t\t[Test]\n\t\tpublic void Using_Static02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nusing Uno;\nusing $(Uno, !Math)Uno.Math;\nusing Matrix;\n\nclass Foo\n{\n\tvoid Bar()\n\t{\n\t\t$(Abs, Sin, Sqrt, PI, Transpose);\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n        [Test]\n        public void Using_Static03()\n        {\n            AssertCode(\n@\"\n\nusing Uno;\nusing $(Uno, !Math)Uno.Math;\nusing $(Foo)Foo;\n\nclass Foo\n{\n    public static int i;\n\tvoid Bar()\n\t{\n\t}\n}\n\nclass Test\n{\n    Test()\n    {\n        ++i;\n    }\n}\n\"\n            );\n        }\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/iterator.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class iterator : Test\n\t{\n\t\t[Test]\n\t\tpublic void iterator00()\n\t\t{\n\t\t\tAssertCode(\n@\"public class derp\n{\n\tpublic void derk()\n\t{\n\t\tfor(int i = 0;$(i) i < 4;i++)\n\t\t{\n\t\t}\n\t}\n\n}\n\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/Tests/loops.cs",
    "content": "using NUnit.Framework;\n\nnamespace Outracks.CodeNinja.Tests.Tests\n{\n    public class loops : Test\n\t{\n\t\t[Test]\n\t\tpublic void loops00()\n\t\t{\n\t\t\tAssertCode(\n@\"class b\n{\n\tpublic void Foo()\n\t{\n\t\tfor(int i=0;$(i)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t/*[Test]\n\t\tpublic void loops01()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tpublic void Foo()\n\t{\n\t\tfor(int i=0;$(!if,!while,!var)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}*/\n\n\t\t/*[Test]\n\t\tpublic void loops02()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tpublic void Foo()\n\t{\n\t\tfor(int i=0;$(!int)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}*/\n\n\t\t[Test]\n\t\tpublic void loops03()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\n\nclass b\n{\n\tpublic void Foo()\n\t{\n\t\tdo\n\t\t{\n\t\t// TODO: also check that it does _not_ suggest stuff like if/try/else\n\t\t}$(while)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void loops04()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tpublic void Foo()\n\t{\n\t\t$(foreach)\n\t}\n}\n\n\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void loops05()\n\t\t{\n\t\t\tAssertCode(\n@\"\n\nclass b\n{\n\tpublic void Foo()\n\t{\n\t\twhile($(true, false)\n\t}\n}\"\n\t\t\t);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.CodeNinja.Tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/GotoDefinitionFactory.cs",
    "content": "﻿using Outracks.CodeCompletion;\nusing Outracks.CodeCompletionFactory.UXNinja;\nusing Outracks.UnoDevelop.CodeNinja;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Uno;\nusing CodeReader = Outracks.UnoDevelop.CodeNinja.CodeReader;\n\nnamespace Outracks.CodeCompletionFactory\n{\n\tpublic class GotoDefinitionFactory : IGotoDefinitionFactory\n\t{\n\t\tpublic bool TryGotoDefinitionBasedOnSyntax(SyntaxLanguageType type, GotoDefinitionData gotoDefinitionData, out Source source)\n\t\t{\n\t\t\tsource = null;\n\t\t\tvar invalidType = false;\n\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\t\tcase SyntaxLanguageType.Uno:\n\t\t\t\t\tsource = GoToDefinitionUno(gotoDefinitionData);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SyntaxLanguageType.UX:\n\t\t\t\t\tsource = GoToDefinitionUX(gotoDefinitionData);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tinvalidType = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn !invalidType && source != null;\n\t\t}\n\n\t\tSource GoToDefinitionUX(GotoDefinitionData gotoDefinitionData)\n\t\t{\n\t\t\tvar sourceEntity = SourceEntityFactoryUX.GetDataTypeFromOffset(\n\t\t\t\tgotoDefinitionData.FilePath,\n\t\t\t\tgotoDefinitionData.SrcCode,\n\t\t\t\tgotoDefinitionData.CaretOffset,\n\t\t\t\tgotoDefinitionData.Compiler);\n\n\t\t\treturn sourceEntity == null ? null : sourceEntity.Source;\n\t\t}\n\n\t\tSource GoToDefinitionUno(GotoDefinitionData gotoDefinitionData)\n\t\t{\n\t\t\tif (gotoDefinitionData.Compiler == null)\n\t\t\t\treturn null;\n\n\t\t\tvar sourceEntity = GoToDefinition.TryGetSourceObject(\n\t\t\t\tgotoDefinitionData.Compiler,\n\t\t\t\tnew Source(gotoDefinitionData.MainPackage, gotoDefinitionData.FilePath.NativePath),\n\t\t\t\tnew CodeReader(gotoDefinitionData.SrcCode, gotoDefinitionData.CaretOffset),\n\t\t\t\tParser.Parse(gotoDefinitionData.SrcCode));\n\n\t\t\treturn sourceEntity == null ? null : sourceEntity.Source;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/Outracks.CodeCompletion.NRefactoryInterop.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{5A43F127-3217-4BEA-93F0-13903B240B5A}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.NRefactoryInterop</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"ICSharpCode.NRefactory, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d4bfe873e7598c49, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\3rdparty\\ICSharpCode.NRefactory.dll</HintPath>\n    </Reference>\n    <Reference Include=\"ICSharpCode.NRefactory.Xml, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d4bfe873e7598c49, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\3rdparty\\ICSharpCode.NRefactory.Xml.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Core\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Frontend\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Frontend.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.UX.Markup\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.UX.Markup.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"GotoDefinitionFactory.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SuggestionsFactory.cs\" />\n    <Compile Include=\"UXNinja\\Attribute.cs\" />\n    <Compile Include=\"UXNinja\\CodeReader.cs\" />\n    <Compile Include=\"UXNinja\\Context.cs\" />\n    <Compile Include=\"UXNinja\\CreateUXSuggestions.cs\" />\n    <Compile Include=\"UXNinja\\ElementContext.cs\" />\n    <Compile Include=\"UXNinja\\NRefactoryExtensions.cs\" />\n    <Compile Include=\"UXNinja\\SourceEntityFactoryUX.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja\\Outracks.CodeCompletion.UXNinja.csproj\">\n      <Project>{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeCompletionFactory\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/SuggestionsFactory.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Outracks.CodeCompletionFactory.UXNinja;\nusing Outracks.UnoDevelop.CodeNinja.AmbientParser;\nusing Outracks.UnoDevelop.CodeNinja.CodeCompleter;\nusing Uno;\nusing CodeReader = Outracks.UnoDevelop.CodeNinja.CodeReader;\n\nnamespace Outracks.CodeCompletionFactory\n{\n\tpublic class SuggestionsFactory : ISuggestionsFactory\n\t{\n\t\tpublic bool SuggestionsBasedOnSyntax(SyntaxLanguageType type, SuggestionDependentData suggestionData, out IList<SuggestItem> suggestItems)\n\t\t{\n\t\t\tsuggestItems = null;\n\t\t\tvar invalidType = false;\n\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\t\tcase SyntaxLanguageType.Uno:\n\t\t\t\t\tsuggestItems = SuggestionsUno(suggestionData);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SyntaxLanguageType.UX:\n\t\t\t\t\tsuggestItems = SuggestionsUX(suggestionData);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tinvalidType = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn !invalidType;\n\t\t}\n\n\t\tIList<SuggestItem> SuggestionsUX(SuggestionDependentData suggestionData)\n\t\t{\n            var suggestions = CreateUXSuggestions.Do(suggestionData.Compiler,\n                suggestionData.FilePath,\n                suggestionData.SrcCode,\n                suggestionData.CaretOffset);\n\n            var suggestionsList = suggestions.GroupBy(s => s.Text).Select(g => g.First()).OrderByDescending(s => s.Priority).ToList();\n\n            return suggestionsList;\n\t\t}\n\n\t\tIList<SuggestItem> SuggestionsUno(SuggestionDependentData suggestionData)\n\t\t{\n\t\t\tvar suggestions = ResolveSuggestions(suggestionData);\n\t\t\tsuggestions = suggestions as IList<SuggestItem> ?? suggestions.ToList();\n            return suggestions.OrderBy(s => s.Text).OrderByDescending(s => s.Priority).ToList();\n\t\t}\n\n\t\tIEnumerable<SuggestItem> ResolveSuggestions(SuggestionDependentData suggestionData)\n\t\t{\n\t\t\tif (suggestionData.Compiler == null)\n\t\t\t\treturn Enumerable.Empty<SuggestItem>();\n\n\t\t\tvar codeCompleter = new CodeCompleter(suggestionData.Compiler,\n\t\t\t\tnew Source(suggestionData.MainPackage, suggestionData.FilePath.NativePath),\n\t\t\t\tnew CodeReader(suggestionData.SrcCode, suggestionData.CaretOffset),\n\t\t\t\tsuggestionData.CaretOffset,\n\t\t\t\tParser.Parse(suggestionData.SrcCode));\n\n\t\t\tConfidenceLevel level;\n\t\t\tvar suggestions = codeCompleter.SuggestCompletion(\"\", out level);\n\t\t\treturn suggestions;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/UXNinja/Attribute.cs",
    "content": "﻿using System;\nusing ICSharpCode.NRefactory.Xml;\nusing Outracks.UnoDevelop.UXNinja;\nusing Uno;\nusing Uno.Compiler;\n\nnamespace Outracks.CodeCompletionFactory.UXNinja\n{\n\tpublic class Attribute : IAttributeContext\n\t{\n\t\treadonly SourceFile _file;\n\t\treadonly AXmlAttribute _attribute;\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _attribute.LocalName; }\n\t\t}\n\n\t\tpublic string NamespacePrefix\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar name = _attribute.Name;\n\t\t\t\tvar idxOfDelimeter = name.IndexOf(\":\", StringComparison.Ordinal);\n\n\t\t\t\treturn idxOfDelimeter > 0 ? name.Substring(0, idxOfDelimeter) : \"\";\n\t\t\t}\n\t\t}\n\n\t\tpublic string Value\n\t\t{\n\t\t\tget { return _attribute.Value; }\n\t\t}\n\n\t\tpublic string FullName\n\t\t{\n\t\t\tget { return _attribute.Name; }\n\t\t}\n\n\t\tpublic Source Source\n\t\t{\n\t\t\tget { return _file.GetSourceFromOffsets(_attribute.StartOffset, _attribute.EndOffset); }\n\t\t}\n\n\t\tpublic bool IsNamespaceDeclaration\n\t\t{\n\t\t\tget { return _attribute.IsNamespaceDeclaration; }\n\t\t}\n\n\t\tpublic T GetBackingStore<T>() where T : class\n\t\t{\n\t\t\treturn _attribute as T;\n\t\t}\n\n\t\tpublic Attribute(SourceFile file, AXmlAttribute attribute)\n\t\t{\n\t\t\t_file = file;\n\t\t\t_attribute = attribute;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/UXNinja/CodeReader.cs",
    "content": "﻿using Outracks.UnoDevelop.UXNinja;\n\nnamespace Outracks.CodeCompletionFactory.UXNinja\n{\n\tclass CodeReader : ICodeReader\n\t{\n\t\tpublic TokenType PeekTokenReverse()\n\t\t{\n\t\t\treturn (TokenType) 0;\n\t\t}\n\n\t\tpublic TokenType ReadTokenReverse()\n\t\t{\n\t\t\treturn (TokenType) 0;\n\t\t}\n\n\t\tpublic TokenType ReadToken()\n\t\t{\n\t\t\treturn (TokenType) 0;\n\t\t}\n\n\t\tpublic TokenType PeekToken()\n\t\t{\n\t\t\treturn (TokenType) 0;\n\t\t}\n\n\t\tpublic int Offset { get; set; }\n\t\tpublic int Length { get; private set; }\n\t\tpublic string PeekTextReverse(int charCount)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic string PeekText(int charCount)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic string ReadText(int charCount)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic string ReadTextReverse(int charCount)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/UXNinja/Context.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Editor;\nusing ICSharpCode.NRefactory.Xml;\nusing Outracks.IO;\nusing Outracks.UnoDevelop.UXNinja;\nusing Uno;\nusing Uno.Compiler;\n\nnamespace Outracks.CodeCompletionFactory.UXNinja\n{\n\tpublic class Context : IContext\n\t{\n\t    readonly SourceFile _file;\n\t\treadonly AXmlDocument _document;\n\t\treadonly int _caret;\n\t\treadonly IElementContext _root;\n\t\treadonly IDictionary<string, string> _namespaceDeclarations = new Dictionary<string, string>();\n\t\treadonly IElementContext _targetElement;\n\n\t\tpublic ContextType Type\n\t\t{\n\t\t\tget { return FindContextType(); }\n\t\t}\n\n\t\tContextType FindContextType()\n\t\t{\n\t\t\tvar lastElement = _targetElement;\n\t\t\tif (lastElement == null)\n\t\t\t\treturn ContextType.None;\n\n\t\t\tvar startTag = lastElement.GetBackingStore<AXmlElement>().StartTag;\n\t\t\tif (lastElement.Attributes.Any())\n\t\t\t{\n\t\t\t\tif (lastElement.Attributes.Any(attrib => attrib.GetBackingStore<AXmlAttribute>().ValueSegment.IsOffsetInsideSegment(_caret)))\n\t\t\t\t{\n\t\t\t\t\treturn ContextType.StartTagAttributeValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (startTag.NameSegment.EndOffset >= _caret)\n\t\t\t\t\treturn ContextType.StartTagName;\n\t\t\t}\n\n\t\t\treturn ContextType.StartTagAttributeName;\n\t\t}\n\n\t\tpublic Source SourceLocation\n\t\t{\n\t\t\tget { return _file.GetSourceFromOffsets(_document.StartOffset, _document.EndOffset); }\n\t\t}\n\n\t\tpublic IDictionary<string, string> NamespaceDeclarations\n\t\t{\n\t\t\tget { return _namespaceDeclarations; }\n\t\t}\n\n\t\tpublic IElementContext TargetElement\n\t\t{\n\t\t\tget { return _targetElement; }\n\t\t}\n\n\t\tIElementContext FindTargetElement()\n\t\t{\n\t\t\tvar elements = _root.TraverseSelfAndAllChildren();\n\t\t\tforeach (var elm in elements)\n\t\t\t{\n\t\t\t\tif (elm.StartTagSource != Source.Unknown\n\t\t\t\t\t&& elm.StartTagSource.Offset <= _caret\n\t\t\t\t\t&& elm.StartTagSource.EndOffset >= _caret)\n\t\t\t\t{\n\t\t\t\t\treturn elm;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tContext(SourceFile file, AXmlDocument document, int caret)\n\t\t{\n\t\t\t_file = file;\n\t\t\t_document = document;\n\t\t\t_caret = caret;\n\t\t\tvar root = document.Children.OfType<AXmlElement>().FirstOrDefault();\n\t\t\t_root = root == null ? null : new ElementContext(file, root, null);\n\t\t\t_targetElement = _root == null ? null : FindTargetElement();\n\t\t\tInitNamespaces();\n\t\t}\n\n\t\tpublic static Context CreateContext(AbsoluteFilePath filePath, string code, int offset, SourcePackage package)\n\t\t{\n\t\t\tvar parser = new AXmlParser();\n\t\t\tvar result = parser.Parse(new StringTextSource(code));\n            var file = new SourceFile(package, filePath.NativePath, code);\n\t\t\treturn new Context(file, result, offset);\n\t\t}\n\n\t\tvoid InitNamespaces()\n\t\t{\n\t\t\tif (_targetElement == null)\n\t\t\t\treturn;\n\n\t\t\tvar elements = _targetElement.TraverseAncestors();\n\t\t\tforeach (var element in elements)\n\t\t\t{\n\t\t\t\tvar nsDeclarations = element.Attributes.Where(x => x.IsNamespaceDeclaration);\n\t\t\t\tnsDeclarations.Each(ns => _namespaceDeclarations.Add(ns.Value, ns.Name));\n\t\t\t}\n\t\t}\n\n\t\tpublic IElementContext Root\n\t\t{\n\t\t\tget { return _root; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/UXNinja/CreateUXSuggestions.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Outracks.IO;\nusing Outracks.UnoDevelop.UXNinja;\nusing Uno.Compiler.API;\n\nnamespace Outracks.CodeCompletionFactory.UXNinja\n{\n\tclass CreateUXSuggestions\n\t{\n\t\tpublic static IEnumerable<SuggestItem> Do(ICompiler compiler, AbsoluteFilePath filePath, string code, int caret)\n\t\t{\n\t\t\treturn new CreateUXSuggestions().CreateSuggestionsInternal(compiler, filePath, code, caret);\n\t\t}\n\n\t\tIEnumerable<SuggestItem> CreateSuggestionsInternal(ICompiler compiler, AbsoluteFilePath file, string code, int caret)\n\t\t{\n\t\t\tif (compiler == null)\n\t\t\t\treturn Enumerable.Empty<SuggestItem>();\n\n\t\t\tvar suggestions = SuggestionParser.GetSuggestions(\n\t\t\t\tcompiler,\n\t\t\t\tContext.CreateContext(\n\t\t\t\t\tfile,\n\t\t\t\t\tcode,\n\t\t\t\t\tcaret,\n\t\t\t\t\tcompiler.Input.Package),\n\t\t\t\tcaret,\n\t\t\t\tnew CodeReader());\n\n\t\t\treturn suggestions;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/UXNinja/ElementContext.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing ICSharpCode.NRefactory.Xml;\nusing Outracks.UnoDevelop.UXNinja;\nusing Uno;\nusing Uno.Compiler;\n\nnamespace Outracks.CodeCompletionFactory.UXNinja\n{\n\tpublic class ElementContext : IElementContext\n\t{\n\t\treadonly SourceFile _file;\n\t\treadonly AXmlElement _element;\n\t\treadonly ElementContext _parent;\n\t\treadonly ElementContext []_children;\n\t\treadonly IAttributeContext[] _attributes;\n\n\t\tpublic string NamespacePrefix\n\t\t{\n\t\t\tget { return _element.Prefix; }\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget { return _element.LocalName; }\n\t\t}\n\n\t\tpublic IEnumerable<IAttributeContext> Attributes\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _attributes;\n\t\t\t}\n\t\t}\n\n\t\tpublic Source StartTagSource\n\t\t{\n\t\t\tget { return _element.StartTag == null ? Source.Unknown : _file.GetSourceFromOffsets(_element.StartTag.StartOffset, _element.StartTag.EndOffset); }\n\t\t}\n\n\t\tpublic Source EndTagSource\n\t\t{\n\t\t\tget { return _element.EndTag == null ? Source.Unknown : _file.GetSourceFromOffsets(_element.EndTag.StartOffset, _element.EndTag.EndOffset); }\n\t\t}\n\n\t\tpublic ElementContext(SourceFile file, AXmlElement element, ElementContext parent)\n\t\t{\n\t\t\t_file = file;\n\t\t\t_element = element;\n\t\t\t_parent = parent;\n\t\t\t_children = _element.Children\n\t\t\t\t.OfType<AXmlElement>()\n\t\t\t\t.Select(elm => new ElementContext(_file, elm, this)).ToArray();\n\n\t\t\t_attributes = _element.Attributes.Select(a => new Attribute(_file, a)).ToArray();\n\t\t}\n\n\t\tpublic IElementContext Parent\n\t\t{\n\t\t\tget { return _parent; }\n\t\t}\n\n\t\tpublic IEnumerable<IElementContext> Children\n\t\t{\n\t\t\tget { return _children; }\n\t\t}\n\n\t\tpublic T GetBackingStore<T>() where T : class\n\t\t{\n\t\t\treturn _element as T;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/UXNinja/NRefactoryExtensions.cs",
    "content": "﻿using ICSharpCode.NRefactory.Editor;\n\nnamespace Outracks.CodeCompletionFactory.UXNinja\n{\n\tstatic class NRefactoryExtensions\n\t{\n\t\tpublic static bool IsOffsetInsideSegment(this ISegment segment, int offset)\n\t\t{\n\t\t\treturn segment.Offset < offset && offset < segment.EndOffset;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/UXNinja/SourceEntityFactoryUX.cs",
    "content": "﻿using System.Linq;\nusing Outracks.IO;\nusing Outracks.UnoDevelop.UXNinja;\nusing Uno;\nusing Uno.Compiler.API;\nusing Uno.UX.Markup;\n\nnamespace Outracks.CodeCompletionFactory.UXNinja\n{\n\tpublic static class SourceEntityFactoryUX\n\t{\n\t\tpublic static SourceObject GetDataTypeFromOffset(AbsoluteFilePath filePath, string code, int textOffset, ICompiler compiler)\n\t\t{\n\t\t\tvar context = Context.CreateContext(filePath, code, textOffset, compiler.Input.Package);\n\n\t\t\tforeach (var defaultNamespace in Configuration.DefaultNamespaces)\n\t\t\t{\n\t\t\t\tif (context.NamespaceDeclarations.ContainsKey(defaultNamespace)) continue;\n\t\t\t\tcontext.NamespaceDeclarations.Add(defaultNamespace, \"\");\n\t\t\t}\n\n\t\t\tvar targetElement = GetTargetElement(context, textOffset);\n\t\t\tif (targetElement == null)\n\t\t\t\treturn null;\n\n\t\t\tvar dataType = targetElement.ToDataType(compiler.Utilities.FindAllTypes(), context.NamespaceDeclarations);\n\t\t\tif (dataType == null)\n\t\t\t\treturn null;\n\n\t\t\tvar properties = PropertyHelper.GetAllWriteableProperties(dataType).ToList();\n\t\t\tforeach (var attribute in targetElement.Attributes.Where(attribute =>\n\t\t\t\ttextOffset >= attribute.Source.Offset && textOffset <= attribute.Source.EndOffset))\n\t\t\t{\n\t\t\t\treturn properties.FirstOrDefault(p => p.Name == attribute.Name);\n\t\t\t}\n\n\t\t\treturn dataType;\n\t\t}\n\n\t\tpublic static IElementContext GetTargetElement(IContext context, int offset)\n\t\t{\n\t\t\treturn context.Root.TraverseSelfAndAllChildren()\n\t\t\t\t.FirstOrDefault(element => IsOffsetInsideElement(element, offset));\n\t\t}\n\n\t\tpublic static bool IsOffsetInsideElement(IElementContext element, int offset)\n\t\t{\n\t\t\tvar isInsideStartTag = element.StartTagSource.Offset <= offset && element.StartTagSource.EndOffset >= offset;\n\t\t\tvar isInsideEndTag = element.EndTagSource.Offset <= offset && element.EndTagSource.EndOffset >= offset;\n\t\t\treturn isInsideStartTag || isInsideEndTag;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.NRefactoryInterop/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/ContextType.cs",
    "content": "﻿namespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic enum ContextType\n\t{\n\t\tNone,\n\t\tDefault,\n\t\tStartTagName,\n\t\tStartTagAttributeName,\n\t\tStartTagAttributeValue\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/DataTypeHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic static class DataTypeHelper\n\t{\n\t\tpublic static bool IsOfType(this DataType dt, Type type)\n\t\t{\n\t\t\t// Early out test\n\t\t\tif (dt.Name != type.Name)\n\t\t\t\treturn false;\n\n\t\t\treturn dt.FullName == type.FullName;\n\t\t}\n\n\t\tpublic static DataType ResolveDataTypeFromName(string name, IEnumerable<DataType> dataTypes, IEnumerable<KeyValuePair<string, string>> namespaces)\n\t\t{\n\t\t\tvar namespacePrefix = ExtractNamespacePrefix(name);\n\t\t\tvar nameExclPrefix = ExtractNameExclPrefix(name);\n\n\t\t\tvar elmNamespaces = ResolveNamespacesForNamespacePrefix(namespacePrefix, namespaces);\n\t\t\treturn dataTypes.FirstOrDefault(d => IsNameThisDataType(nameExclPrefix, elmNamespaces, d));\n\t\t}\n\n\t\tpublic static string ExtractNamespacePrefix(string name)\n\t\t{\n\t\t\tvar idxNsDelimiter = name.IndexOf(\":\", StringComparison.Ordinal);\n\t\t\tvar namespacePrefix = idxNsDelimiter >= 0 ? name.Substring(0, idxNsDelimiter) : \"\";\n\n\t\t\treturn namespacePrefix;\n\t\t}\n\n\t\tpublic static string ExtractNameExclPrefix(string name)\n\t\t{\n\t\t\tvar idxNsDelimiter = name.IndexOf(\":\", StringComparison.Ordinal);\n\t\t\tvar nameExclPrefix = idxNsDelimiter + 1 < name.Length\n\t\t\t\t&& idxNsDelimiter >= 0 ? name.Substring(idxNsDelimiter + 1) : name;\n\n\t\t\treturn nameExclPrefix;\n\t\t}\n\n\t\tpublic static IEnumerable<string> ResolveNamespacesForNamespacePrefix(string namespacePrefix, IEnumerable<KeyValuePair<string, string>> namespaces)\n\t\t{\n\t\t\tvar elmNamespaces = new List<string>();\n\n\t\t\tforeach (var namesp in namespaces)\n\t\t\t{\n\t\t\t\tif(namesp.Value == namespacePrefix)\n\t\t\t\t\telmNamespaces.Add(namesp.Key);\n\t\t\t}\n\n\t\t\treturn elmNamespaces;\n\t\t}\n\n\t\tpublic static bool IsNameThisDataType(string name, IEnumerable<string> elmNamespaces, DataType dataType)\n\t\t{\n\t\t\tvar dataFullName = dataType.QualifiedName;\n\n\t\t\treturn (dataType.Parent != null && dataType.Parent.IsRoot && dataFullName == name)\n\t\t\t\t|| elmNamespaces.Select(elmNamespace => elmNamespace + \".\" + name).Any(fullName => fullName == dataFullName);\n\t\t}\n\n\t\tpublic static string GetQualifiedNamespaceForElement(IElementContext element)\n\t\t{\n\t\t\treturn element.Name.Contains('.')\n\t\t\t\t? element.Name.Substring(0, element.Name.LastIndexOf('.'))\n\t\t\t\t: null;\n\t\t}\n\n\t\tstatic string[] GetNamespacesForElement(IElementContext element, IDictionary<string, string> namespaceDeclarations)\n\t\t{\n\t\t\tvar ns = GetQualifiedNamespaceForElement(element);\n\t\t\tif (ns != null) return new string[] { ns };\n\t\t\treturn namespaceDeclarations.Keys.ToArray();\n\t\t}\n\n\t\tpublic static IEnumerable<DataType> GetDataTypesForElement(IElementContext element, DataTypes dataTypes, IDictionary<string, string> namespaceDeclarations)\n\t\t{\n\t\t\tvar ns = GetNamespacesForElement(element, namespaceDeclarations);\n\t\t\treturn GetDataTypesInNamespaces(dataTypes, ns);\n\t\t}\n\n\t\tstatic IEnumerable<DataType> GetDataTypesInNamespaces(DataTypes dataTypes, params string[] ns)\n\t\t{\n\t\t\treturn dataTypes.AccessibleUxTypes.Where(d => IsParentNamespaceInContextNamespaces(d, ns));\n\t\t}\n\n\t\tstatic bool IsParentNamespaceInContextNamespaces(DataType dataType, ICollection<string> namespaceDeclarations)\n\t\t{\n\t\t\tif (dataType.Parent == null || dataType.Parent.NamescopeType != NamescopeType.Namespace)\n\t\t\t\treturn false;\n\n\t\t\treturn dataType.Parent.IsRoot\n\t\t\t\t|| namespaceDeclarations.Contains(dataType.Parent.FullName)\n\t\t\t\t|| TypeAliases.HasAlias(dataType.QualifiedName);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/DataTypes.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Uno.Compiler.API;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic class DataTypes\n\t{\n\t\treadonly ICompiler _compiler;\n\t\treadonly DataType []_accessibleUxTypes;\n\n\t\tpublic DataTypes(ICompiler compiler, Func<IEnumerable<DataType>, IEnumerable<DataType>> customUxClasses)\n\t\t{\n\t\t\t_compiler = compiler;\n\n\t\t\tvar compiledTypes = _compiler.Utilities\n\t\t\t\t.FindAllTypes()\n\t\t\t\t.Where(IsDataTypeAccessible)\n\t\t\t\t.ToArray();\n\n\t\t\t_accessibleUxTypes = customUxClasses(compiledTypes)\n\t\t\t\t.Concat(compiledTypes)\n\t\t\t\t.ToArray();\n\t\t}\n\n\t\tpublic DataType []AccessibleUxTypes\n\t\t{\n\t\t\tget { return _accessibleUxTypes; }\n\t\t}\n\n\t\tpublic Namespace RootNamespace\n\t\t{\n\t\t\tget { return _compiler.Data.IL; }\n\t\t}\n\n\t\tstatic bool IsDataTypeAccessible(DataType dataType)\n\t\t{\n\t\t\treturn dataType.Modifiers.HasFlag(Modifiers.Public) &&\n\t\t\t\t!dataType.IsStatic;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/ElementContextExtensions.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Uno.Compiler.API.Domain.IL;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic static class ElementContextExtensions\n\t{\n\t\tpublic static DataType ToDataType(this IElementContext element, IEnumerable<DataType> dataTypes, IEnumerable<KeyValuePair<string, string>> namespaces)\n\t\t{\n\t\t\tif (element.Name.Contains('.'))\n\t\t\t{\n\t\t\t\treturn dataTypes.FirstOrDefault(d => d.QualifiedName == element.Name);\n\t\t\t}\n\n\t\t\tvar elmNamespaces = DataTypeHelper.ResolveNamespacesForNamespacePrefix(element.NamespacePrefix, namespaces);\n\n\t\t\treturn dataTypes.FirstOrDefault(d => DataTypeHelper.IsNameThisDataType(element.Name, elmNamespaces, d));\n\t\t}\n\n\t\tpublic static bool HasAttributeWithNamespace(this IElementContext element, string ns, string attributeName)\n\t\t{\n\t\t\treturn element.Attributes.Any(attr => attr.NamespacePrefix == ns && attr.Name == attributeName);\n\t\t}\n\n\t\tpublic static string GetAttributeValue(this IElementContext element, string ns, string attributeName)\n\t\t{\n\t\t\tvar attrib = element.Attributes.FirstOrDefault(attr => attr.NamespacePrefix == ns && attr.Name == attributeName);\n\t\t\treturn attrib == null ? null : attrib.Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/EndTagNameSuggestion.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.CodeCompletion;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tclass EndTagNameSuggestion : ISuggestion\n\t{\n\t\treadonly IElementContext _lastElement;\n\n\t\tpublic EndTagNameSuggestion(IElementContext lastElement)\n\t\t{\n\t\t\t_lastElement = lastElement;\n\t\t}\n\n\t\tpublic IEnumerable<SuggestItem> Suggest()\n\t\t{\n\t\t\tif (_lastElement == null) yield break;\n\n\t\t\tyield return SuggestionHelper.Suggest(SuggestItemType.Property, null, _lastElement.Name, null, null, AutoCompletePropertyOnCommit);\n\t\t}\n\n\t\tvoid AutoCompletePropertyOnCommit(IAutoCompleteCodeEditor autoCompleteCodeEditor)\n\t\t{\n\t\t\tautoCompleteCodeEditor.InsertText(autoCompleteCodeEditor.GetCaretOffset(), \">\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/IAttributeContext.cs",
    "content": "﻿using Uno;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic interface IAttributeContext\n\t{\n\t\tstring Name { get; }\n\n\t\tstring NamespacePrefix { get; }\n\n\t\tstring FullName { get; }\n\n\t\tstring Value { get; }\n\n\t\tSource Source { get; }\n\n\t\tbool IsNamespaceDeclaration { get; }\n\n\t\tT GetBackingStore<T>() where T : class;\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/ICodeReader.cs",
    "content": "﻿using Outracks.UnoDevelop.CodeNinja.AmbientParser;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic interface ICodeReader : ICodeReader<TokenType>\n\t{\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/IContext.cs",
    "content": "﻿using System.Collections.Generic;\nusing Uno;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic interface IContext\n\t{\n\t\tContextType Type { get; }\n\n\t\tSource SourceLocation { get; }\n\n\t\tIDictionary<string, string> NamespaceDeclarations { get; }\n\n\t\tIElementContext Root { get; }\n\n\t\tIElementContext TargetElement { get; }\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/IElementContext.cs",
    "content": "﻿using System.Collections.Generic;\nusing Uno;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic interface IElementContext\n\t{\n\t\tstring NamespacePrefix { get; }\n\n\t\tstring Name { get; }\n\n\t\tIEnumerable<IAttributeContext> Attributes { get; }\n\n\t\tIEnumerable<IElementContext> Children { get; }\n\n\t\tSource StartTagSource { get; }\n\n\t\tSource EndTagSource { get; }\n\n\t\tIElementContext Parent { get; }\n\n\t\tT GetBackingStore<T>() where T : class;\n\t}\n\n\tpublic static class ElementContextTraversing\n\t{\n\t\tpublic static IEnumerable<IElementContext> TraverseSelfAndAllChildren(this IElementContext element)\n\t\t{\n\t\t\tyield return element;\n\n\t\t\tforeach (var child in element.Children)\n\t\t\t{\n\t\t\t\tforeach (var i in TraverseSelfAndAllChildren(child))\n\t\t\t\t\tyield return i;\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<IElementContext> TraverseAllChildren(this IElementContext element)\n\t\t{\n\t\t\tforeach (var child in element.Children)\n\t\t\t{\n\t\t\t\tforeach (var i in TraverseSelfAndAllChildren(child))\n\t\t\t\t\tyield return i;\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<IElementContext> TraverseAncestors(this IElementContext element)\n\t\t{\n\t\t\tif (element.Parent == null)\n\t\t\t\tyield break;\n\n\t\t\tyield return element.Parent;\n\t\t\tforeach (var parent in TraverseAncestors(element.Parent))\n\t\t\t{\n\t\t\t\tyield return parent;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/ISuggestion.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.CodeCompletion;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tinterface ISuggestion\n\t{\n\t\tIEnumerable<SuggestItem> Suggest();\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/MemberHelper.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tstatic class MemberHelper\n\t{\n\t\tpublic static IEnumerable<Member> GetAllPublicEvents(DataType dataType)\n\t\t{\n\t\t\tif (dataType.Base != null)\n\t\t\t\tforeach(var evt in GetAllPublicEvents(dataType.Base))\n\t\t\t\t\tyield return evt;\n\n\t\t\tforeach (var evt in dataType.Events.Where(e => e.IsPublic))\n\t\t\t\tyield return evt;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/Outracks.CodeCompletion.UXNinja.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion.UXNinja</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.UXNinja</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.UX.Markup\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.UX.Markup.dll</HintPath>\n    </Reference>\n    <Reference Include=\"UnoCore\">\n      <HintPath>..\\..\\simulator\\common\\bin\\UnoCore.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ContextType.cs\" />\n    <Compile Include=\"DataTypeHelper.cs\" />\n    <Compile Include=\"DataTypes.cs\" />\n    <Compile Include=\"ElementContextExtensions.cs\" />\n    <Compile Include=\"EndTagNameSuggestion.cs\" />\n    <Compile Include=\"IAttributeContext.cs\" />\n    <Compile Include=\"IContext.cs\" />\n    <Compile Include=\"IElementContext.cs\" />\n    <Compile Include=\"ISuggestion.cs\" />\n    <Compile Include=\"ICodeReader.cs\" />\n    <Compile Include=\"MemberHelper.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"PropertyHelper.cs\" />\n    <Compile Include=\"ResolveUxClasses.cs\" />\n    <Compile Include=\"StandardAttributesSuggestion.cs\" />\n    <Compile Include=\"StartTagAttributeNameSuggestion.cs\" />\n    <Compile Include=\"StartTagAttributeValueSuggestion.cs\" />\n    <Compile Include=\"StartTagNameSuggestion.cs\" />\n    <Compile Include=\"SuggestionHelper.cs\" />\n    <Compile Include=\"SuggestionParser.cs\" />\n    <Compile Include=\"TokenType.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5c6c19f4-c5c4-4f8b-bae4-a92e6c0d62bb}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3aab1db2-fcb7-495d-addf-11131dcf821a}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.UnoDevelop.UXNinja\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/PropertyHelper.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.UX;\nusing Property = Uno.Compiler.API.Domain.IL.Members.Property;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic static class PropertyHelper\n\t{\n\t\tpublic static bool IsMemberAListAndDataTypeCompatibleWithIt(DataType dataType, DataType member)\n\t\t{\n\t\t\treturn IsList(member) && member.GenericArguments != null && member.GenericArguments.Any(dataType.IsCompatibleWith);\n\t\t}\n\n\t\tstatic bool IsList(DataType dataType)\n\t\t{\n\t\t\tif (dataType.Interfaces != null)\n\t\t\t{\n\t\t\t\tif (dataType.Interfaces.Any(IsList))\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn dataType.MasterDefinition.QualifiedName == \"Uno.Collections.IList\";\n\t\t}\n\n\t\tpublic static IEnumerable<Property> GetAllComponentPrimaryOrContentProperties(DataType dataType)\n\t\t{\n\t\t\treturn GetAllWriteableProperties(dataType).Where(p => p.Attributes.Any(a => IsAttributeComponentPrimaryOrContent(a.ReturnType)));\n\t\t}\n\n\t\tpublic static IEnumerable<Property> GetAllWriteableProperties(DataType dataType)\n\t\t{\n\t\t\tif(dataType.Base != null)\n\t\t\t\tforeach (var prop in GetAllWriteableProperties(dataType.Base))\n\t\t\t\t\tyield return prop;\n\n\t\t\tforeach (var prop in dataType.Properties.Where(IsPropertyWriteable))\n\t\t\t\tyield return prop;\n\t\t}\n\n\t\tpublic static IEnumerable<Parameter> GetAllConstructorArguments(DataType dt)\n\t\t{\n\t\t\tforeach (var constructor in dt.Constructors.Where(c => c.Attributes.Any(a => a.ReturnType.IsOfType(typeof(UXConstructorAttribute)))))\n\t\t\t{\n\t\t\t\tforeach (var arg in constructor.Parameters)\n\t\t\t\t{\n\t\t\t\t\tyield return arg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsAttributeComponentPrimaryOrContent(DataType attribute)\n\t\t{\n\t\t\treturn attribute.IsOfType(typeof(UXComponentsAttribute)) || attribute.IsOfType(typeof(UXPrimaryAttribute)) || attribute.IsOfType(typeof(UXContentAttribute));\n\t\t}\n\n\t\tstatic bool IsPropertyWriteable(Property property)\n\t\t{\n\t\t\treturn property.IsPublic &&\n\t\t\t\t\t((property.GetMethod != null && property.SetMethod != null && property.SetMethod.IsPublic) ||\n\t\t\t\t\t IsList(property.ReturnType) ||\n\t\t\t\t\t property.GetMethod == null);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/ResolveUxClasses.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tstatic class ResolveUxClasses\n\t{\n\t\tpublic static IEnumerable<DataType> GetUxClassTypes(IContext context, IEnumerable<DataType> dataTypes, Namespace rootNamespace)\n\t\t{\n\t\t\tif (context.Root == null)\n\t\t\t\treturn Enumerable.Empty<DataType>();\n\n\t\t\tvar uxClasses = context.Root\n\t\t\t\t.TraverseAllChildren()\n\t\t\t\t.Where(elm => elm.HasAttributeWithNamespace(\"ux\", \"Class\"))\n\t\t\t\t.Select(elm =>\n\t\t\t\t{\n\t\t\t\t\tvar className = elm.GetAttributeValue(\"ux\", \"Class\");\n\t\t\t\t\tvar ns = GetParentNamespaceForUxClassName(className, rootNamespace);\n\n\t\t\t\t\tvar fakeType = new ClassType(elm.StartTagSource, ns, \"\", Modifiers.Generated | Modifiers.Public, className);\n\t\t\t\t\treturn new { Type = fakeType, Element = elm };\n\t\t\t\t})\n\t\t\t\t.ToArray();\n\n\t\t\tforeach (var klass in uxClasses)\n\t\t\t{\n\t\t\t\t// ReSharper disable once PossibleMultipleEnumeration\n\t\t\t\tvar types = dataTypes.Concat(uxClasses.Select(c => c.Type));\n\t\t\t\tklass.Type.SetBase(klass.Element.ToDataType(types, context.NamespaceDeclarations));\n\n\t\t\t\tvar properties = klass.Element.TraverseAllChildren()\n\t\t\t\t\t.Where(x => x.HasAttributeWithNamespace(\"ux\", \"Property\"));\n\t\t\t\tklass.Type.Properties.AddRange(properties.Select(prop =>\n\t\t\t\t{\n\t\t\t\t\tvar propertyName = prop.GetAttributeValue(\"ux\", \"Property\");\n\t\t\t\t\tvar propType = prop.ToDataType(types, context.NamespaceDeclarations) ?? DataType.Void;\n\n\t\t\t\t\treturn new Property(\n\t\t\t\t\t\tprop.StartTagSource,\n\t\t\t\t\t\t\"\",\n\t\t\t\t\t\tModifiers.Public | Modifiers.PropertyMember,\n\t\t\t\t\t\tpropertyName,\n\t\t\t\t\t\tklass.Type,\n\t\t\t\t\t\tpropType);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\treturn uxClasses.Select(c => c.Type);\n\t\t}\n\n\t\tstatic Namespace GetParentNamespaceForUxClassName(string className, Namespace rootNamespace)\n\t\t{\n\t\t\tvar ns = rootNamespace;\n\n\t\t\tvar namespacePath = GetQualifiedNamespacePartsForString(className);\n\t\t\tforeach (var segment in namespacePath)\n\t\t\t{\n\t\t\t\tns = ns.Namespaces.FirstOrDefault(x => x.Name == segment) ?? new Namespace(ns, segment);\n\t\t\t}\n\n\t\t\treturn ns;\n\t\t}\n\n\t\tstatic IEnumerable<string> GetQualifiedNamespacePartsForString(this string name)\n\t\t{\n\t\t\treturn name.Contains('.')\n\t\t\t\t? name.Substring(0, name.LastIndexOf('.')).Split('.')\n\t\t\t\t: Enumerable.Empty<string>();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/StandardAttributesSuggestion.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.UX.Markup.Common;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tclass StandardAttributesSuggestion : ISuggestion\n\t{\n\t\treadonly DataTypes _dataTypes;\n\t\treadonly IElementContext _targetElement;\n\t\treadonly IElementContext _parentElement;\n\t\treadonly string _attributeName;\n\t\treadonly ICodeReader _codeReader;\n\t\treadonly IDictionary<string, string> _namespaces;\n\n\t\tstatic readonly string[] _standardAttributeNames = { \"xmlns\" };\n\t\tpublic static IEnumerable<string> StandardAttributeNames\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tforeach (var name in _standardAttributeNames)\n\t\t\t\t\tyield return name;\n\n\t\t\t\tforeach (var name in Attributes.Values)\n\t\t\t\t\tyield return \"ux:\" + name;\n\t\t\t}\n\t\t}\n\n\t\tpublic StandardAttributesSuggestion(DataTypes dataTypes, IElementContext targetElement, IElementContext parentElement, string attributeName, ICodeReader codeReader, IDictionary<string, string> namespaces)\n\t\t{\n\t\t\t_dataTypes = dataTypes;\n\t\t\t_targetElement = targetElement;\n\t\t\t_parentElement = parentElement;\n\t\t\t_attributeName = attributeName;\n\t\t\t_codeReader = codeReader;\n\t\t\t_namespaces = namespaces;\n\t\t}\n\n\t\tpublic IEnumerable<SuggestItem> Suggest()\n\t\t{\n\t\t\tswitch (_attributeName)\n\t\t\t{\n\t\t\t\tcase \"ux:Binding\":\n\t\t\t\t\treturn SuggestBindingValues();\n\n\t\t\t\t// TODO: Implement ux code reader\n\t\t\t\t/*case \"ux:Ref\":\n\t\t\t\t\treturn SuggestReferenceValue();*/\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tIEnumerable<SuggestItem> SuggestBindingValues()\n\t\t{\n\t\t\tvar dataType = _parentElement.ToDataType(_dataTypes.AccessibleUxTypes, _namespaces);\n\t\t\tif (dataType == null) return null;\n\n\t\t\tvar properties = PropertyHelper.GetAllWriteableProperties(dataType);\n\t\t\treturn properties.Select(p => SuggestionHelper.Suggest(SuggestItemType.Property, p, p.Name));\n\t\t}\n\n\t\tIEnumerable<SuggestItem> SuggestReferenceValue()\n\t\t{\n\t\t\tvar nameAttributes = FindUXNameAttributes(_codeReader);\n\t\t\tvar namesToDataTypes = ResolveNamesAndTypes(_dataTypes, nameAttributes, _namespaces);\n\n\t\t\tvar elementDataType = _targetElement.ToDataType(_dataTypes.AccessibleUxTypes, _namespaces);\n\t\t\tif (elementDataType == null) return null;\n\n\t\t\treturn namesToDataTypes.Where(d => d.Value == elementDataType).Select(n => SuggestionHelper.Suggest(SuggestItemType.Variable, n.Value, n.Key));\n\t\t}\n\n\t\tpublic static IEnumerable<KeyValuePair<string, DataType>> ResolveNamesAndTypes(DataTypes dataTypes,\n\t\t\tIEnumerable<KeyValuePair<string, string>> nameAttributes, IDictionary<string, string> namespaces)\n\t\t{\n\t\t\tvar nameToDataType = new Dictionary<string, DataType>();\n\t\t\tforeach (var nameAttribute in nameAttributes)\n\t\t\t{\n\t\t\t\tvar dataType = DataTypeHelper.ResolveDataTypeFromName(nameAttribute.Key, dataTypes.AccessibleUxTypes, namespaces);\n\t\t\t\tif (dataType == null) continue;\n\n\t\t\t\tnameToDataType.Add(nameAttribute.Value, dataType);\n\t\t\t}\n\n\t\t\treturn nameToDataType;\n\t\t}\n\n\t\tpublic static IEnumerable<KeyValuePair<string, string>> FindUXNameAttributes(ICodeReader codeReader)\n\t\t{\n\t\t\tvar offset = codeReader.Offset;\n\t\t\tcodeReader.Offset = 0;\n\n\t\t\tvar nameAttributes = new Dictionary<string, string>();\n\t\t\tvar lastTagName = \"\";\n\t\t\tvar lastAttributeName = \"\";\n\n\t\t\twhile (codeReader.Offset < codeReader.Length)\n\t\t\t{\n\t\t\t\tswitch (codeReader.PeekToken())\n\t\t\t\t{\n\t\t\t\t\tcase TokenType.StartTagName:\n\t\t\t\t\t\tlastTagName = ParseTokenText(codeReader);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TokenType.StartTagAttributeName:\n\t\t\t\t\t\tlastAttributeName = ParseTokenText(codeReader);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TokenType.StartTagAttributeValueText:\n\t\t\t\t\t\tstring attributeValue = ParseTokenText(codeReader);\n\t\t\t\t\t\tif (lastAttributeName == \"ux:Name\")\n\t\t\t\t\t\t\tnameAttributes.Add(lastTagName, attributeValue);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcodeReader.ReadToken();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcodeReader.Offset = offset;\n\n\t\t\treturn nameAttributes;\n\t\t}\n\n\t\tpublic static string ParseTokenText(ICodeReader reader)\n\t\t{\n\t\t\tvar offsetStart = reader.Offset;\n\t\t\treader.ReadToken();\n\t\t\tvar offsetEnd = reader.Offset;\n\t\t\treturn reader.PeekTextReverse(offsetEnd - offsetStart);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/StartTagAttributeNameSuggestion.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Outracks.CodeCompletion;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Expressions;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.UX;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tclass StartTagAttributeNameSuggestion : ISuggestion\n\t{\n\t\treadonly DataTypes _dataTypes;\n\t\treadonly IElementContext _elementContext;\n\t\treadonly IDictionary<string, string> _namespaceDeclarations;\n\n\t\tpublic StartTagAttributeNameSuggestion(DataTypes dataTypes, IElementContext elementContext, IDictionary<string, string> namespaceDeclarations)\n\t\t{\n\t\t\t_dataTypes = dataTypes;\n\t\t\t_elementContext = elementContext;\n\t\t\t_namespaceDeclarations = namespaceDeclarations;\n\t\t}\n\n\t\tpublic IEnumerable<SuggestItem> Suggest()\n\t\t{\n\t\t\tif (_elementContext == null) return Enumerable.Empty<SuggestItem>();\n\n\t\t\tvar suggestItems = PossibleStandardAttribs();\n\n\t\t\tvar dataType = _elementContext.ToDataType(_dataTypes.AccessibleUxTypes, _namespaceDeclarations);\n\t\t\tif(dataType == null)\n\t\t\t\treturn suggestItems;\n\n\t\t\tvar possibleArguments = Task.Run(() => PossibleArguments(dataType));\n\t\t\tvar possibleProperties = Task.Run(() => PossibleProperties (dataType));\n\t\t\tvar possibleEvents = Task.Run(() => PossibleEvents (dataType));\n\n\t\t\treturn suggestItems\n\t\t\t\t.Concat(possibleArguments.Result)\n\t\t\t\t.Concat(possibleProperties.Result)\n\t\t\t\t.Concat(possibleEvents.Result);\n\t\t}\n\n\t\tIEnumerable<SuggestItem> PossibleStandardAttribs()\n\t\t{\n\t\t\tvar standardSuggestions = StandardAttributesSuggestion.StandardAttributeNames.Where(IsAttributeNotDefinedAlready);\n\t\t\tvar suggestItems = standardSuggestions.Select(\n\t\t\t\ts =>\n\t\t\t\t\tSuggestionHelper.Suggest(\n\t\t\t\t\t\tSuggestItemType.Property,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\ts,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tAutoCompletePropertyOnCommit));\n\n\t\t\treturn suggestItems;\n\t\t}\n\n\t\tIEnumerable<SuggestItem> PossibleEvents(DataType dataType)\n\t\t{\n\t\t\tvar validEvents = MemberHelper.GetAllPublicEvents(dataType)\n\t\t\t\t.Where(e => IsAttributeNotDefinedAlready(e.Name) && IsMemberNotHidden(e));\n\n\t\t\tvar suggestItems = validEvents\n\t\t\t\t.Select(e => SuggestionHelper.Suggest(SuggestItemType.Event, e, e.Name, null, null, AutoCompletePropertyOnCommit));\n\n\t\t\treturn suggestItems;\n\t\t}\n\n\t\tIEnumerable<SuggestItem> PossibleArguments(DataType dataType)\n\t\t{\n\t\t\tvar args = PropertyHelper.GetAllConstructorArguments(dataType);\n\t\t\tvar uxParameter = args.Select(p => p.Attributes.FirstOrDefault(a => a.ReturnType.IsOfType(typeof(UXParameterAttribute))));\n\n\t\t\tvar uxParameterValue = uxParameter.Where(p => p != null)\n\t\t\t\t\t\t\t\t\t.Select(p => p.Arguments[0].ActualValue as Constant)\n\t\t\t\t\t\t\t\t\t.Where(p => p != null)\n\t\t\t\t\t\t\t\t\t.Select(p => (string)p.Value);\n\n\t\t\tvar validArgs = uxParameterValue.Where(p => IsAttributeNotDefinedAlready(p));\n\n\t\t\tvar suggestItems = validArgs\n\t\t\t\t.Select(uxParam => SuggestionHelper.Suggest(SuggestItemType.Property, uxParameter, uxParam, null, null, AutoCompletePropertyOnCommit));\n\n\t\t\treturn suggestItems;\n\t\t}\n\n\t\tbool IsParameterValid(Parameter param)\n\t\t{\n\t\t\treturn IsAttributeNotDefinedAlready(param.Name) && param.Attributes.OfType<UXParameterAttribute>().Any();\n\t\t}\n\n\t\tIEnumerable<SuggestItem> PossibleProperties(DataType dataType)\n\t\t{\n\t\t\tvar properties = PropertyHelper.GetAllWriteableProperties(dataType);\n\t\t\tvar validAttributes = properties.Where(p => IsAttributeNotDefinedAlready(p.Name) && IsMemberNotHidden(p));\n\n\t\t\tvar suggestItems = validAttributes\n\t\t\t\t.Select(p => SuggestionHelper.Suggest(SuggestItemType.Property, p, p.Name, null, null, AutoCompletePropertyOnCommit));\n\n\t\t\treturn suggestItems;\n\t\t}\n\n\t\tbool IsAttributeNotDefinedAlready(string name)\n\t\t{\n\t\t\treturn _elementContext.Attributes == null || _elementContext.Attributes.All(attribute => attribute.FullName != name);\n\t\t}\n\n\t\tbool IsMemberNotHidden(Member member)\n\t\t{\n\t\t\treturn true;\n\t\t\t\t// The Fuse.Designer.HideAttribute si only intended for tooling, not UX accessibility\n\t\t\t\t/*member.Attributes.All(a => a.DataType.Name != \"HideAttribute\");*/\n\t\t}\n\n\t\tvoid AutoCompletePropertyOnCommit(IAutoCompleteCodeEditor editor)\n\t\t{\n\t\t\teditor.InsertText(editor.GetCaretOffset(), \"=\\\"\\\"\");\n\t\t\teditor.SetCarretPos(editor.GetCaretOffset() - 1);\n\t\t\teditor.RequestIntelliPrompt();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/StartTagAttributeValueSuggestion.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tclass StartTagAttributeValueSuggestion : ISuggestion\n\t{\n\t\treadonly DataTypes _dataTypes;\n\t\treadonly IElementContext _targetElement;\n\t\treadonly IElementContext _parentElement;\n\t\treadonly IAttributeContext _lastAttribute;\n\t\treadonly ICodeReader _codeReader;\n\t\treadonly IDictionary<string, string> _namespaceDeclarations;\n\n\t\tpublic StartTagAttributeValueSuggestion(\n\t\t\t\tDataTypes dataTypes,\n\t\t\t\tIElementContext targetElement,\n\t\t\t\tIElementContext parentElement,\n\t\t\t\tIAttributeContext lastAttribute,\n\t\t\t\tICodeReader codeReader,\n\t\t\t\tIDictionary<string, string> namespaceDeclarations)\n\t\t{\n\t\t\t_dataTypes = dataTypes;\n\t\t\t_targetElement = targetElement;\n\t\t\t_parentElement = parentElement;\n\t\t\t_lastAttribute = lastAttribute;\n\t\t\t_codeReader = codeReader;\n\t\t\t_namespaceDeclarations = namespaceDeclarations;\n\t\t}\n\n\t\tpublic IEnumerable<SuggestItem> Suggest()\n\t\t{\n\t\t\tif (_targetElement == null || _lastAttribute == null) return Enumerable.Empty<SuggestItem>();\n\n\t\t\tif (_lastAttribute.NamespacePrefix == \"ux\" && _parentElement != null)\n\t\t\t\treturn new StandardAttributesSuggestion(_dataTypes, _targetElement, _parentElement,\n\t\t\t\t\t_lastAttribute.FullName, _codeReader, _namespaceDeclarations).Suggest();\n\n\t\t\tvar dataType = _targetElement.ToDataType(_dataTypes.AccessibleUxTypes, _namespaceDeclarations);\n\t\t\tif (dataType == null) return Enumerable.Empty<SuggestItem>();\n\n\t\t\tvar properties = PropertyHelper.GetAllWriteableProperties(dataType);\n\t\t\tvar lastAttributeProperty = properties.FirstOrDefault(p => _lastAttribute.Name == p.Name);\n\t\t\tif (lastAttributeProperty == null) return Enumerable.Empty<SuggestItem>();\n\n\t\t\treturn SuggestValuesForProperty(lastAttributeProperty);\n\t\t}\n\n\t\tIEnumerable<SuggestItem> SuggestValuesForProperty(Property lastAttributeProperty)\n\t\t{\n\t\t\tvar valueDataType = lastAttributeProperty.ReturnType;\n\t\t\tif (valueDataType.BuiltinType != 0)\n\t\t\t\treturn SuggestIntristic(valueDataType);\n\n\t\t\tif (valueDataType.TypeType == TypeType.Enum)\n\t\t\t\treturn SuggestEnumLiterals(valueDataType as EnumType);\n\n\t\t\t// TODO: Implement ux code reader\n\t\t\t/*if (valueDataType.Master.FullName == \"Uno.UX.Property<>\")\n\t\t\t\treturn SuggestDesignerProperty(valueDataType);*/\n\n\t\t\treturn null;\n\t\t}\n\n\t\tIEnumerable<SuggestItem> SuggestIntristic(DataType dataType)\n\t\t{\n\t\t\tswitch (dataType.BuiltinType)\n\t\t\t{\n\t\t\t\tcase BuiltinType.Bool:\n\t\t\t\t\treturn SuggestBool(dataType);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tIEnumerable<SuggestItem> SuggestEnumLiterals(EnumType enumType)\n\t\t{\n\t\t\treturn enumType.Literals.Select(l => SuggestionHelper.Suggest(SuggestItemType.Constant, l, l.Name));\n\t\t}\n\n\t\tIEnumerable<SuggestItem> SuggestDesignerProperty(DataType valueType)\n\t\t{\n\t\t\t_codeReader.ReadTokenReverse();\n\t\t\tvar nameAttributes = StandardAttributesSuggestion.FindUXNameAttributes(_codeReader);\n\t\t\tvar dataTypes = StandardAttributesSuggestion.ResolveNamesAndTypes(_dataTypes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  nameAttributes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  _namespaceDeclarations);\n\n\t\t\tvar attributeValue = StandardAttributesSuggestion.ParseTokenText(_codeReader);\n\t\t\tif (!attributeValue.Contains(\".\"))\n\t\t\t{\n\t\t\t\treturn dataTypes.Select(n => SuggestionHelper.Suggest(SuggestItemType.Variable, n.Value, n.Key));\n\t\t\t}\n\n\t\t\tvar valuePieces = attributeValue.Split('.');\n\t\t\tvar dataType = dataTypes.FirstOrDefault(d => d.Key == valuePieces[0]).Value;\n\t\t\tif (dataType == null) return null;\n\n\t\t\tvar properties = PropertyHelper.GetAllWriteableProperties(dataType);\n\t\t\tvar propertiesOfRightType = properties.Where(p => p.ReturnType == valueType.GenericArguments[0]);\n\n\t\t\treturn propertiesOfRightType.Select(p => SuggestionHelper.Suggest(SuggestItemType.Property, p, valuePieces[0] + \".\" + p.Name));\n\t\t}\n\n\t\tIEnumerable<SuggestItem> SuggestBool(DataType dataType)\n\t\t{\n\t\t\treturn new List<SuggestItem>()\n\t\t\t{\n\t\t\t\tSuggestionHelper.Suggest(SuggestItemType.Keyword, dataType, \"true\"),\n\t\t\t\tSuggestionHelper.Suggest(SuggestItemType.Keyword, dataType, \"false\")\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/StartTagNameSuggestion.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Outracks.CodeCompletion;\nusing Uno.Compiler.API.Domain;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.Compiler.API.Domain.IL.Members;\nusing Uno.Compiler.API.Domain.IL.Types;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tclass StartTagNameSuggestion : ISuggestion\n\t{\n\t\treadonly DataTypes _dataTypes;\n\t\treadonly IElementContext _parentElement;\n\t\treadonly IElementContext _targetElement;\n\t\treadonly IDictionary<string, string> _namespaceDeclarations;\n\n\t\tpublic StartTagNameSuggestion(DataTypes dataTypes, IElementContext parentElement, IElementContext targetElement, IDictionary<string, string> namespaceDeclarations)\n\t\t{\n\t\t\t_dataTypes = dataTypes;\n\t\t\t_parentElement = parentElement;\n\t\t\t_targetElement = targetElement;\n\t\t\t_namespaceDeclarations = namespaceDeclarations;\n\t\t}\n\n\t\tpublic IEnumerable<SuggestItem> Suggest()\n\t\t{\n\t\t\tif (_parentElement == null)\n\t\t\t{\n\t\t\t\tvar dataTypes = DataTypeHelper.GetDataTypesForElement(_targetElement, _dataTypes, _namespaceDeclarations);\n\t\t\t\treturn ConvertNamescopesToSuggestions(dataTypes);\n\t\t\t}\n\n\t\t\tvar allTypes = _dataTypes.AccessibleUxTypes;\n\t\t\tvar concreteTypes = allTypes.Where(dataType => !dataType.Modifiers.HasFlag(Modifiers.Abstract))\n\t\t\t\t.ToArray();\n\n\t\t\tvar parentDataType = _parentElement.ToDataType(_parentElement.Name == \"App\" ? allTypes : concreteTypes, _namespaceDeclarations);\n\t\t\tif (parentDataType == null) return Enumerable.Empty<SuggestItem>();\n\n\t\t\tvar parentPublicProperties = Task.Run(() => PropertyHelper.GetAllComponentPrimaryOrContentProperties(parentDataType));\n\n\t\t\tvar hasPrefix = HasTargetNamespacePrefix();\n\t\t\tif (hasPrefix)\n\t\t\t\treturn HandleNamespacePrefix(concreteTypes, parentPublicProperties);\n\n\t\t\tvar ns = DataTypeHelper.GetQualifiedNamespaceForElement(_targetElement);\n\t\t\tvar types = HandleNonNamespacePrefix(DataTypeHelper.GetDataTypesForElement(_targetElement, _dataTypes, _namespaceDeclarations).ToArray(), parentPublicProperties);\n\n\t\t\tif (ns != null)\n\t\t\t{\n\t\t\t\treturn types.Concat(ConvertNamescopesToSuggestions(GetNamespacesInNamespace(ns)));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn types\n\t\t\t\t\t.Concat(ConvertNamescopesToSuggestions(GetNamespacesInRoot()))\n\t\t\t\t\t.Concat(_namespaceDeclarations.Values.Where(nss => nss != \"\")\n\t\t\t\t\t\t.Select(nss => SuggestionHelper.Suggest(SuggestItemType.Namespace, null, nss + \":\")));\n\t\t\t}\n\t\t}\n\n\t\tIEnumerable<SuggestItem> HandleNamespacePrefix(IEnumerable<DataType> dataTypes, Task<IEnumerable<Property>> parentProperties)\n\t\t{\n\t\t\tvar ns = DataTypeHelper.ResolveNamespacesForNamespacePrefix(\n\t\t\t\t_targetElement.NamespacePrefix,\n\t\t\t\t_namespaceDeclarations);\n\n\t\t\treturn ConvertNamescopesToSuggestions(\n\t\t\t\tdataTypes.Where(d =>\n\t\t\t\t\t\tIsDataTypeInNamespaces(d, ns)\n\t\t\t\t\t\t&& IsDataTypeValidAsChildInParent(d, parentProperties.Result)));\n\t\t}\n\n\t\tIEnumerable<SuggestItem> HandleNonNamespacePrefix(IEnumerable<DataType> dataTypes, Task<IEnumerable<Property>> parentProperties)\n\t\t{\n\t\t\treturn ConvertNamescopesToSuggestions(\n\t\t\t\tdataTypes.Where(d => IsDataTypeValidAsChildInParent(d, parentProperties.Result)));\n\t\t}\n\n\t\tIEnumerable<Namescope> GetNamespacesInRoot()\n\t\t{\n\t\t\treturn _dataTypes.RootNamespace.Namespaces;\n\t\t}\n\n\t\tIEnumerable<Namescope> GetNamespacesInNamespace(string ns)\n\t\t{\n\t\t\tvar nss = ns.Split('.');\n\n\t\t\tvar r = _dataTypes.RootNamespace;\n\n\t\t\tforeach (var p in nss)\n\t\t\t{\n\t\t\t\tif (r == null) break;\n\t\t\t\tr = r.Namespaces.FirstOrDefault(x => x.Name == p);\n\t\t\t}\n\n\t\t\tif (r != null)\n\t\t\t\tforeach (var c in r.Namespaces)\n\t\t\t\t\tyield return c;\n\t\t}\n\n\t\tIEnumerable<SuggestItem> ConvertNamescopesToSuggestions(IEnumerable<Namescope> dataTypes)\n\t\t{\n\t\t\treturn dataTypes.Select(d =>\n\t\t\t\t{\n\t\t\t\t\tvar itemType = SuggestItemType.Class;\n\t\t\t\t\tif (d is Namespace) itemType = SuggestItemType.Namespace;\n\t\t\t\t\treturn SuggestionHelper.Suggest(itemType, d, TypeAliases.HasAlias(d.QualifiedName) ? d.FullName : d.Name);\n\t\t\t\t});\n\t\t}\n\n\t\tstatic bool IsDataTypeInNamespaces(DataType dataType, IEnumerable<string> nsNames)\n\t\t{\n\t\t\tvar parent = dataType.Parent;\n\t\t\treturn parent != null\n\t\t\t\t&& parent.NamescopeType == NamescopeType.Namespace\n\t\t\t\t&& nsNames.Contains(parent.FullName);\n\t\t}\n\n\t\tstatic bool IsDataTypeValidAsChildInParent(DataType dataType, IEnumerable<Property> parentPublicProperties)\n\t\t{\n\t\t\treturn parentPublicProperties.Any(publicProperty => IsCompatibleAsDataInMember(dataType, publicProperty.ReturnType));\n\t\t}\n\n\t\tstatic bool IsCompatibleAsDataInMember(DataType data, DataType member)\n\t\t{\n\t\t\tif (data.IsCompatibleWith(member))\n\t\t\t\treturn true;\n\n\t\t\tif (IsCompatibleAsDataInInterfaces(data, member.Interfaces))\n\t\t\t\treturn true;\n\n\t\t\tif (PropertyHelper.IsMemberAListAndDataTypeCompatibleWithIt(data, member))\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tstatic bool IsCompatibleAsDataInInterfaces(DataType data, IEnumerable<InterfaceType> interfaceTypes)\n\t\t{\n\t\t\tif (interfaceTypes == null) return false;\n\t\t\tforeach (var interfaceType in interfaceTypes)\n\t\t\t{\n\t\t\t\tif (data.IsCompatibleWith(interfaceType))\n\t\t\t\t\treturn true;\n\n\t\t\t\tif (PropertyHelper.IsMemberAListAndDataTypeCompatibleWithIt(data, interfaceType))\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tbool HasTargetNamespacePrefix()\n\t\t{\n\t\t\treturn !string.IsNullOrEmpty(_targetElement.NamespacePrefix);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/SuggestionHelper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Outracks.CodeCompletion;\nusing Outracks.UnoDevelop.CodeNinja;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tstatic class SuggestionHelper\n\t{\n\t\tpublic static SuggestItem Suggest(SuggestItemType type,\n\t\t\tobject docObject,\n\t\t\tstring name,\n\t\t\tFunc<string> pretext = null,\n\t\t\tFunc<string> posttext = null,\n\t\t\tAction<IAutoCompleteCodeEditor> commitAction = null,\n\t\t\tSuggestItemPriority priority = SuggestItemPriority.Normal)\n\t\t{\n\t\t\treturn new SuggestItem(\n\t\t\t\tname,\n\t\t\t\t() => (DocumentationHinter.CreateHtmlHint(docObject, null, new List<string>()) ?? \"\"),\n\t\t\t\ttype,\n\t\t\t\tpretext,\n\t\t\t\tposttext,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tcommitAction,\n\t\t\t\tpriority);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/SuggestionParser.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.CodeCompletion;\nusing Uno.Compiler.API;\nusing Uno.UX.Markup;\n\nnamespace Outracks.UnoDevelop.UXNinja\n{\n\tpublic static class SuggestionParser\n\t{\n\t\tpublic static IEnumerable<SuggestItem> GetSuggestions(\n\t\t\tICompiler compiler,\n\t\t\tIContext context,\n\t\t\tint offset,\n\t\t\tICodeReader codeReader)\n\t\t{\n\t\t\tvar parentElement = context.TargetElement == null ? null : context.TargetElement.Parent;\n\n\t\t\tforeach (var defaultNamespace in Configuration.DefaultNamespaces.Concat(new [] { \"Uno\" }))\n\t\t\t{\n\t\t\t\tif (context.NamespaceDeclarations.ContainsKey(defaultNamespace))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcontext.NamespaceDeclarations.Add(defaultNamespace, \"\");\n\t\t\t}\n\n\t\t\tvar dataTypes = new DataTypes(compiler, compiledTypes => ResolveUxClasses.GetUxClassTypes(context, compiledTypes, compiler.Data.IL));\n\n\t\t\tswitch (context.Type)\n\t\t\t{\n\t\t\t\tcase ContextType.StartTagName:\n\t\t\t\t\treturn new StartTagNameSuggestion(\n\t\t\t\t\t\tdataTypes,\n\t\t\t\t\t\tparentElement,\n\t\t\t\t\t\tcontext.TargetElement,\n\t\t\t\t\t\tcontext.NamespaceDeclarations).Suggest();\n\n\t\t\t\tcase ContextType.StartTagAttributeName:\n\t\t\t\t\treturn new StartTagAttributeNameSuggestion(\n\t\t\t\t\t\tdataTypes,\n\t\t\t\t\t\tcontext.TargetElement,\n\t\t\t\t\t\tcontext.NamespaceDeclarations).Suggest();\n\n\t\t\t\tcase ContextType.StartTagAttributeValue:\n\t\t\t\t\treturn new StartTagAttributeValueSuggestion(\n\t\t\t\t\t\tdataTypes,\n\t\t\t\t\t\tcontext.TargetElement,\n\t\t\t\t\t\tparentElement,\n\t\t\t\t\t\tGetCurrentAttributeContext(context.TargetElement, offset),\n\t\t\t\t\t\tcodeReader,\n\t\t\t\t\t\tcontext.NamespaceDeclarations).Suggest();\n\t\t\t}\n\n\t\t\treturn Enumerable.Empty<SuggestItem>();\n\t\t}\n\n\t\tstatic IAttributeContext GetCurrentAttributeContext(IElementContext targetElement, int offset)\n\t\t{\n\t\t\treturn targetElement.Attributes.FirstOrDefault(attribute => attribute.Source.EndOffset >= offset);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/TokenType.cs",
    "content": "﻿namespace Outracks.UnoDevelop.UXNinja\n{\n\t// Tokens ID's are compatible with actipro XML token ID's\n\tpublic enum TokenType\n\t{\n\t\tNone = 12000,\n\t\tEntity = 12001,\n\t\tIdentifier = 12002,\n\t\tWhitespace = 12003,\n\t\tStartTagText = 12004,\n\t\tStartTagStartDelimiter = 12005,\n\t\tStartTagEndDelimiter = 12006,\n\t\tStartTagName = 12007,\n\t\tStartTagAttributeName = 12008,\n\t\tStartTagNextTagStartDelimiter = 12009,\n\t\tStartTagAttributeValueText = 12010,\n\t\tStartTagAttributeValueStartDelimiter = 12011,\n\t\tStartTagAttributeValueEndDelimiter = 12012,\n\t\tEndTagText = 12013,\n\t\tEndTagStartDelimiter = 12014,\n\t\tEndTagEndDelimiter = 12015,\n\t\tCommentText = 12016,\n\t\tCommentStartDelimiter = 12017,\n\t\tCommentEndDelimiter = 12018,\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests/Outracks.CodeCompletion.UXNinja.PerformanceTests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{E40C711E-19CE-4885-A4F4-0D477E0F6852}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Uno.UXNinja.PerformanceTests</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.UXNinja.PerformanceTests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SomeTest.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.csproj\">\n      <Project>{99ff164f-a691-4952-8ec8-577eb8c49f41}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja.PerformanceTests.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeCompletion.UXNinja.PerformanceTests\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests/SomeTest.cs",
    "content": "﻿using Uno.UXNinja.PerformanceTests.Core;\nusing Uno.UXNinja.PerformanceTests.Core.Attributes;\n\nnamespace Uno.UXNinja.PerformanceTests.Tests\n{\n    public class SomeTest : TestBase\n    {\n        [PerformanceTest(\"Some description here\")]\n        public void Test01()\n        {\n            TestPerformance(\n@\"\n    <App>\n        <Text $\n    </App>\n\"\n                );\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Client/BasicTypes/CommandLineOptions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Mono.Options;\n\nnamespace Uno.UXNinja.PerformanceTests.Client.BasicTypes\n{\n    public class CommandLineOptions\n    {\n        public List<string> Paths;\n        public string LogDirectoryName;\n        public TimeSpan TestTimeout;\n        public string BuildNumber;\n        public string BranchName;\n        public string UnoLibraryPath;\n\n        public static CommandLineOptions From(string[] args)\n        {\n            var help = false;\n            var commandOptions = new CommandLineOptions\n            {\n                TestTimeout = TimeSpan.FromMinutes(2),\n                UnoLibraryPath = \"..\\\\..\\\\..\\\\Outracks.CodeCompletion.UXNinja.TestsCommon\\\\TestData\\\\Outracks.UXNinja.Tests.Library.unoproj\"\n            };\n\n            var p = new OptionSet\n            {\n                { \"h|?|help\", \"Show help\", v => help = v != null},\n                { \"l|logdirectory=\", \"Output directory\", v => commandOptions.LogDirectoryName=v },\n                { \"o|timeout=\", \"Timeout for individual tests (in seconds)\", (int v) => { commandOptions.TestTimeout = TimeSpan.FromSeconds(v); }},\n                { \"b|branch-name=\", \"Branch name.\", v => commandOptions.BranchName=v },\n                { \"unolib-path=\", \"Uno library path\", v => commandOptions.UnoLibraryPath=v },\n                { \"build-number=\", \"Team City build number\", v => commandOptions.BuildNumber=v },\n            };\n\n            try\n            {\n                var extra = p.Parse(args);\n                commandOptions.Paths = extra;\n            }\n            catch (OptionException e)\n            {\n                Console.WriteLine(e);\n                PrintHelpAndExit(p);\n            }\n            if (help)\n            {\n                PrintHelpAndExit(p);\n            }\n\n            if (string.IsNullOrEmpty(commandOptions.LogDirectoryName))\n            {\n                throw new ArgumentException(\"Output directory is required\");\n            }\n\n            return commandOptions;\n        }\n\n        private static void PrintHelpAndExit(OptionSet p)\n        {\n            Console.WriteLine(\"USAGE: performancetest [OPTIONS] [PATHS TO SEARCH]\");\n            Console.WriteLine();\n            Console.WriteLine(\"EXAMPLES:\");\n            Console.WriteLine(\"performancetest -logdirectory=PerformanceLogResuts\");\n            Console.WriteLine(@\"performancetest Path\\Projects -logdirectory=PerformanceLogResuts\");\n            Console.WriteLine(@\"performancetest Path\\Projects\\Foo.unoproj Path\\Projects\\Bar.unoproj -logdirectory=PerformanceLogResuts\");\n            Console.WriteLine(@\"performancetest Path\\Projects Path\\OtherProjects\\Foo.unoproj -logdirectory=PerformanceLogResuts\");\n            Console.WriteLine();\n            Console.WriteLine(\"OPTIONS\");\n            p.WriteOptionDescriptions(Console.Out);\n            Environment.Exit(-1);\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Client/BasicTypes/Mono.Options/Options.cs",
    "content": "﻿//\n// Options.cs\n//\n// Authors:\n//  Jonathan Pryor <jpryor@novell.com>\n//  Federico Di Gregorio <fog@initd.org>\n//  Rolf Bjarne Kvinge <rolf@xamarin.com>\n//\n// Copyright (C) 2008 Novell (http://www.novell.com)\n// Copyright (C) 2009 Federico Di Gregorio.\n// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\n// Compile With:\n//   gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll\n//   gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll\n//\n// The LINQ version just changes the implementation of\n// OptionSet.Parse(IEnumerable<string>), and confers no semantic changes.\n\n//\n// A Getopt::Long-inspired option parsing library for C#.\n//\n// NDesk.Options.OptionSet is built upon a key/value table, where the\n// key is a option format string and the value is a delegate that is\n// invoked when the format string is matched.\n//\n// Option format strings:\n//  Regex-like BNF Grammar:\n//    name: .+\n//    type: [=:]\n//    sep: ( [^{}]+ | '{' .+ '}' )?\n//    aliases: ( name type sep ) ( '|' name type sep )*\n//\n// Each '|'-delimited name is an alias for the associated action.  If the\n// format string ends in a '=', it has a required value.  If the format\n// string ends in a ':', it has an optional value.  If neither '=' or ':'\n// is present, no value is supported.  `=' or `:' need only be defined on one\n// alias, but if they are provided on more than one they must be consistent.\n//\n// Each alias portion may also end with a \"key/value separator\", which is used\n// to split option values if the option accepts > 1 value.  If not specified,\n// it defaults to '=' and ':'.  If specified, it can be any character except\n// '{' and '}' OR the *string* between '{' and '}'.  If no separator should be\n// used (i.e. the separate values should be distinct arguments), then \"{}\"\n// should be used as the separator.\n//\n// Options are extracted either from the current option by looking for\n// the option name followed by an '=' or ':', or is taken from the\n// following option IFF:\n//  - The current option does not contain a '=' or a ':'\n//  - The current option requires a value (i.e. not a Option type of ':')\n//\n// The `name' used in the option format string does NOT include any leading\n// option indicator, such as '-', '--', or '/'.  All three of these are\n// permitted/required on any named option.\n//\n// Option bundling is permitted so long as:\n//   - '-' is used to start the option group\n//   - all of the bundled options are a single character\n//   - at most one of the bundled options accepts a value, and the value\n//     provided starts from the next character to the end of the string.\n//\n// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value'\n// as '-Dname=value'.\n//\n// Option processing is disabled by specifying \"--\".  All options after \"--\"\n// are returned by OptionSet.Parse() unchanged and unprocessed.\n//\n// Unprocessed options are returned from OptionSet.Parse().\n//\n// Examples:\n//  int verbose = 0;\n//  OptionSet p = new OptionSet ()\n//    .Add (\"v\", v => ++verbose)\n//    .Add (\"name=|value=\", v => Console.WriteLine (v));\n//  p.Parse (new string[]{\"-v\", \"--v\", \"/v\", \"-name=A\", \"/name\", \"B\", \"extra\"});\n//\n// The above would parse the argument string array, and would invoke the\n// lambda expression three times, setting `verbose' to 3 when complete.\n// It would also print out \"A\" and \"B\" to standard output.\n// The returned array would contain the string \"extra\".\n//\n// C# 3.0 collection initializers are supported and encouraged:\n//  var p = new OptionSet () {\n//    { \"h|?|help\", v => ShowHelp () },\n//  };\n//\n// System.ComponentModel.TypeConverter is also supported, allowing the use of\n// custom data types in the callback type; TypeConverter.ConvertFromString()\n// is used to convert the value option to an instance of the specified\n// type:\n//\n//  var p = new OptionSet () {\n//    { \"foo=\", (Foo f) => Console.WriteLine (f.ToString ()) },\n//  };\n//\n// Random other tidbits:\n//  - Boolean options (those w/o '=' or ':' in the option format string)\n//    are explicitly enabled if they are followed with '+', and explicitly\n//    disabled if they are followed with '-':\n//      string a = null;\n//      var p = new OptionSet () {\n//        { \"a\", s => a = s },\n//      };\n//      p.Parse (new string[]{\"-a\"});   // sets v != null\n//      p.Parse (new string[]{\"-a+\"});  // sets v != null\n//      p.Parse (new string[]{\"-a-\"});  // sets v == null\n//\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Security.Permissions;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\n#if LINQ\nusing System.Linq;\n#endif\n\n#if TEST\nusing NDesk.Options;\n#endif\n\n#if NDESK_OPTIONS\nnamespace NDesk.Options\n#else\nnamespace Mono.Options\n#endif\n{\n    static class StringCoda\n    {\n        public static IEnumerable<string> WrappedLines(string self, params int[] widths)\n        {\n            IEnumerable<int> w = widths;\n            return WrappedLines(self, w);\n        }\n\n        public static IEnumerable<string> WrappedLines(string self, IEnumerable<int> widths)\n        {\n            if (widths == null)\n                throw new ArgumentNullException(\"widths\");\n            return CreateWrappedLinesIterator(self, widths);\n        }\n\n        private static IEnumerable<string> CreateWrappedLinesIterator(string self, IEnumerable<int> widths)\n        {\n            if (string.IsNullOrEmpty(self))\n            {\n                yield return string.Empty;\n                yield break;\n            }\n            using (IEnumerator<int> ewidths = widths.GetEnumerator())\n            {\n                bool? hw = null;\n                int width = GetNextWidth(ewidths, int.MaxValue, ref hw);\n                int start = 0, end;\n                do\n                {\n                    end = GetLineEnd(start, width, self);\n                    char c = self[end - 1];\n                    if (char.IsWhiteSpace(c))\n                        --end;\n                    bool needContinuation = end != self.Length && !IsEolChar(c);\n                    string continuation = \"\";\n                    if (needContinuation)\n                    {\n                        --end;\n                        continuation = \"-\";\n                    }\n                    string line = self.Substring(start, end - start) + continuation;\n                    yield return line;\n                    start = end;\n                    if (char.IsWhiteSpace(c))\n                        ++start;\n                    width = GetNextWidth(ewidths, width, ref hw);\n                } while (start < self.Length);\n            }\n        }\n\n        private static int GetNextWidth(IEnumerator<int> ewidths, int curWidth, ref bool? eValid)\n        {\n            if (!eValid.HasValue || (eValid.HasValue && eValid.Value))\n            {\n                curWidth = (eValid = ewidths.MoveNext()).Value ? ewidths.Current : curWidth;\n                // '.' is any character, - is for a continuation\n                const string minWidth = \".-\";\n                if (curWidth < minWidth.Length)\n                    throw new ArgumentOutOfRangeException(\"widths\",\n                            string.Format(\"Element must be >= {0}, was {1}.\", minWidth.Length, curWidth));\n                return curWidth;\n            }\n            // no more elements, use the last element.\n            return curWidth;\n        }\n\n        private static bool IsEolChar(char c)\n        {\n            return !char.IsLetterOrDigit(c);\n        }\n\n        private static int GetLineEnd(int start, int length, string description)\n        {\n            int end = Math.Min(start + length, description.Length);\n            int sep = -1;\n            for (int i = start; i < end; ++i)\n            {\n                if (description[i] == '\\n')\n                    return i + 1;\n                if (IsEolChar(description[i]))\n                    sep = i + 1;\n            }\n            if (sep == -1 || end == description.Length)\n                return end;\n            return sep;\n        }\n    }\n\n    public class OptionValueCollection : IList, IList<string>\n    {\n        List<string> values = new List<string>();\n        OptionContext c;\n\n        internal OptionValueCollection(OptionContext c)\n        {\n            this.c = c;\n        }\n\n        #region ICollection\n        void ICollection.CopyTo(Array array, int index) { (values as ICollection).CopyTo(array, index); }\n        bool ICollection.IsSynchronized { get { return (values as ICollection).IsSynchronized; } }\n        object ICollection.SyncRoot { get { return (values as ICollection).SyncRoot; } }\n        #endregion\n\n        #region ICollection<T>\n        public void Add(string item) { values.Add(item); }\n        public void Clear() { values.Clear(); }\n        public bool Contains(string item) { return values.Contains(item); }\n        public void CopyTo(string[] array, int arrayIndex) { values.CopyTo(array, arrayIndex); }\n        public bool Remove(string item) { return values.Remove(item); }\n        public int Count { get { return values.Count; } }\n        public bool IsReadOnly { get { return false; } }\n        #endregion\n\n        #region IEnumerable\n        IEnumerator IEnumerable.GetEnumerator() { return values.GetEnumerator(); }\n        #endregion\n\n        #region IEnumerable<T>\n        public IEnumerator<string> GetEnumerator() { return values.GetEnumerator(); }\n        #endregion\n\n        #region IList\n        int IList.Add(object value) { return (values as IList).Add(value); }\n        bool IList.Contains(object value) { return (values as IList).Contains(value); }\n        int IList.IndexOf(object value) { return (values as IList).IndexOf(value); }\n        void IList.Insert(int index, object value) { (values as IList).Insert(index, value); }\n        void IList.Remove(object value) { (values as IList).Remove(value); }\n        void IList.RemoveAt(int index) { (values as IList).RemoveAt(index); }\n        bool IList.IsFixedSize { get { return false; } }\n        object IList.this[int index] { get { return this[index]; } set { (values as IList)[index] = value; } }\n        #endregion\n\n        #region IList<T>\n        public int IndexOf(string item) { return values.IndexOf(item); }\n        public void Insert(int index, string item) { values.Insert(index, item); }\n        public void RemoveAt(int index) { values.RemoveAt(index); }\n\n        private void AssertValid(int index)\n        {\n            if (c.Option == null)\n                throw new InvalidOperationException(\"OptionContext.Option is null.\");\n            if (index >= c.Option.MaxValueCount)\n                throw new ArgumentOutOfRangeException(\"index\");\n            if (c.Option.OptionValueType == OptionValueType.Required &&\n                    index >= values.Count)\n                throw new OptionException(string.Format(\n                            c.OptionSet.MessageLocalizer(\"Missing required value for option '{0}'.\"), c.OptionName),\n                        c.OptionName);\n        }\n\n        public string this[int index]\n        {\n            get\n            {\n                AssertValid(index);\n                return index >= values.Count ? null : values[index];\n            }\n            set\n            {\n                values[index] = value;\n            }\n        }\n        #endregion\n\n        public List<string> ToList()\n        {\n            return new List<string>(values);\n        }\n\n        public string[] ToArray()\n        {\n            return values.ToArray();\n        }\n\n        public override string ToString()\n        {\n            return string.Join(\", \", values.ToArray());\n        }\n    }\n\n    public class OptionContext\n    {\n        private Option option;\n        private string name;\n        private int index;\n        private OptionSet set;\n        private OptionValueCollection c;\n\n        public OptionContext(OptionSet set)\n        {\n            this.set = set;\n            this.c = new OptionValueCollection(this);\n        }\n\n        public Option Option\n        {\n            get { return option; }\n            set { option = value; }\n        }\n\n        public string OptionName\n        {\n            get { return name; }\n            set { name = value; }\n        }\n\n        public int OptionIndex\n        {\n            get { return index; }\n            set { index = value; }\n        }\n\n        public OptionSet OptionSet\n        {\n            get { return set; }\n        }\n\n        public OptionValueCollection OptionValues\n        {\n            get { return c; }\n        }\n    }\n\n    public enum OptionValueType\n    {\n        None,\n        Optional,\n        Required,\n    }\n\n    public abstract class Option\n    {\n        string prototype, description;\n        string[] names;\n        OptionValueType type;\n        int count;\n        string[] separators;\n        bool hidden;\n\n        protected Option(string prototype, string description)\n            : this(prototype, description, 1, false)\n        {\n        }\n\n        protected Option(string prototype, string description, int maxValueCount)\n            : this(prototype, description, maxValueCount, false)\n        {\n        }\n\n        protected Option(string prototype, string description, int maxValueCount, bool hidden)\n        {\n            if (prototype == null)\n                throw new ArgumentNullException(\"prototype\");\n            if (prototype.Length == 0)\n                throw new ArgumentException(\"Cannot be the empty string.\", \"prototype\");\n            if (maxValueCount < 0)\n                throw new ArgumentOutOfRangeException(\"maxValueCount\");\n\n            this.prototype = prototype;\n            this.description = description;\n            this.count = maxValueCount;\n            this.names = (this is OptionSet.Category)\n                // append GetHashCode() so that \"duplicate\" categories have distinct\n                // names, e.g. adding multiple \"\" categories should be valid.\n                ? new[] { prototype + this.GetHashCode() }\n                : prototype.Split('|');\n\n            if (this is OptionSet.Category)\n                return;\n\n            this.type = ParsePrototype();\n            this.hidden = hidden;\n\n            if (this.count == 0 && type != OptionValueType.None)\n                throw new ArgumentException(\n                        \"Cannot provide maxValueCount of 0 for OptionValueType.Required or \" +\n                            \"OptionValueType.Optional.\",\n                        \"maxValueCount\");\n            if (this.type == OptionValueType.None && maxValueCount > 1)\n                throw new ArgumentException(\n                        string.Format(\"Cannot provide maxValueCount of {0} for OptionValueType.None.\", maxValueCount),\n                        \"maxValueCount\");\n            if (Array.IndexOf(names, \"<>\") >= 0 &&\n                    ((names.Length == 1 && this.type != OptionValueType.None) ||\n                     (names.Length > 1 && this.MaxValueCount > 1)))\n                throw new ArgumentException(\n                        \"The default option handler '<>' cannot require values.\",\n                        \"prototype\");\n        }\n\n        public string Prototype { get { return prototype; } }\n        public string Description { get { return description; } }\n        public OptionValueType OptionValueType { get { return type; } }\n        public int MaxValueCount { get { return count; } }\n        public bool Hidden { get { return hidden; } }\n\n        public string[] GetNames()\n        {\n            return (string[])names.Clone();\n        }\n\n        public string[] GetValueSeparators()\n        {\n            if (separators == null)\n                return new string[0];\n            return (string[])separators.Clone();\n        }\n\n        protected static T Parse<T>(string value, OptionContext c)\n        {\n            Type tt = typeof(T);\n            bool nullable = tt.IsValueType && tt.IsGenericType &&\n                !tt.IsGenericTypeDefinition &&\n                tt.GetGenericTypeDefinition() == typeof(Nullable<>);\n            Type targetType = nullable ? tt.GetGenericArguments()[0] : typeof(T);\n            TypeConverter conv = TypeDescriptor.GetConverter(targetType);\n            T t = default(T);\n            try\n            {\n                if (value != null)\n                    t = (T)conv.ConvertFromString(value);\n            }\n            catch (Exception e)\n            {\n                throw new OptionException(\n                        string.Format(\n                            c.OptionSet.MessageLocalizer(\"Could not convert string `{0}' to type {1} for option `{2}'.\"),\n                            value, targetType.Name, c.OptionName),\n                        c.OptionName, e);\n            }\n            return t;\n        }\n\n        internal string[] Names { get { return names; } }\n        internal string[] ValueSeparators { get { return separators; } }\n\n        static readonly char[] NameTerminator = new char[] { '=', ':' };\n\n        private OptionValueType ParsePrototype()\n        {\n            char type = '\\0';\n            List<string> seps = new List<string>();\n            for (int i = 0; i < names.Length; ++i)\n            {\n                string name = names[i];\n                if (name.Length == 0)\n                    throw new ArgumentException(\"Empty option names are not supported.\", \"prototype\");\n\n                int end = name.IndexOfAny(NameTerminator);\n                if (end == -1)\n                    continue;\n                names[i] = name.Substring(0, end);\n                if (type == '\\0' || type == name[end])\n                    type = name[end];\n                else\n                    throw new ArgumentException(\n                            string.Format(\"Conflicting option types: '{0}' vs. '{1}'.\", type, name[end]),\n                            \"prototype\");\n                AddSeparators(name, end, seps);\n            }\n\n            if (type == '\\0')\n                return OptionValueType.None;\n\n            if (count <= 1 && seps.Count != 0)\n                throw new ArgumentException(\n                        string.Format(\"Cannot provide key/value separators for Options taking {0} value(s).\", count),\n                        \"prototype\");\n            if (count > 1)\n            {\n                if (seps.Count == 0)\n                    this.separators = new string[] { \":\", \"=\" };\n                else if (seps.Count == 1 && seps[0].Length == 0)\n                    this.separators = null;\n                else\n                    this.separators = seps.ToArray();\n            }\n\n            return type == '=' ? OptionValueType.Required : OptionValueType.Optional;\n        }\n\n        private static void AddSeparators(string name, int end, ICollection<string> seps)\n        {\n            int start = -1;\n            for (int i = end + 1; i < name.Length; ++i)\n            {\n                switch (name[i])\n                {\n                    case '{':\n                        if (start != -1)\n                            throw new ArgumentException(\n                                    string.Format(\"Ill-formed name/value separator found in \\\"{0}\\\".\", name),\n                                    \"prototype\");\n                        start = i + 1;\n                        break;\n                    case '}':\n                        if (start == -1)\n                            throw new ArgumentException(\n                                    string.Format(\"Ill-formed name/value separator found in \\\"{0}\\\".\", name),\n                                    \"prototype\");\n                        seps.Add(name.Substring(start, i - start));\n                        start = -1;\n                        break;\n                    default:\n                        if (start == -1)\n                            seps.Add(name[i].ToString());\n                        break;\n                }\n            }\n            if (start != -1)\n                throw new ArgumentException(\n                        string.Format(\"Ill-formed name/value separator found in \\\"{0}\\\".\", name),\n                        \"prototype\");\n        }\n\n        public void Invoke(OptionContext c)\n        {\n            OnParseComplete(c);\n            c.OptionName = null;\n            c.Option = null;\n            c.OptionValues.Clear();\n        }\n\n        protected abstract void OnParseComplete(OptionContext c);\n\n        public override string ToString()\n        {\n            return Prototype;\n        }\n    }\n\n    public abstract class ArgumentSource\n    {\n        protected ArgumentSource()\n        {\n        }\n\n        public abstract string[] GetNames();\n        public abstract string Description { get; }\n        public abstract bool GetArguments(string value, out IEnumerable<string> replacement);\n\n        public static IEnumerable<string> GetArgumentsFromFile(string file)\n        {\n            return GetArguments(File.OpenText(file), true);\n        }\n\n        public static IEnumerable<string> GetArguments(TextReader reader)\n        {\n            return GetArguments(reader, false);\n        }\n\n        // Cribbed from mcs/driver.cs:LoadArgs(string)\n        static IEnumerable<string> GetArguments(TextReader reader, bool close)\n        {\n            try\n            {\n                StringBuilder arg = new StringBuilder();\n\n                string line;\n                while ((line = reader.ReadLine()) != null)\n                {\n                    int t = line.Length;\n\n                    for (int i = 0; i < t; i++)\n                    {\n                        char c = line[i];\n\n                        if (c == '\"' || c == '\\'')\n                        {\n                            char end = c;\n\n                            for (i++; i < t; i++)\n                            {\n                                c = line[i];\n\n                                if (c == end)\n                                    break;\n                                arg.Append(c);\n                            }\n                        }\n                        else if (c == ' ')\n                        {\n                            if (arg.Length > 0)\n                            {\n                                yield return arg.ToString();\n                                arg.Length = 0;\n                            }\n                        }\n                        else\n                            arg.Append(c);\n                    }\n                    if (arg.Length > 0)\n                    {\n                        yield return arg.ToString();\n                        arg.Length = 0;\n                    }\n                }\n            }\n            finally\n            {\n                if (close)\n                    reader.Close();\n            }\n        }\n    }\n\n    public class ResponseFileSource : ArgumentSource\n    {\n        public override string[] GetNames()\n        {\n            return new string[] { \"@file\" };\n        }\n\n        public override string Description\n        {\n            get { return \"Read response file for more options.\"; }\n        }\n\n        public override bool GetArguments(string value, out IEnumerable<string> replacement)\n        {\n            if (string.IsNullOrEmpty(value) || !value.StartsWith(\"@\"))\n            {\n                replacement = null;\n                return false;\n            }\n            replacement = GetArgumentsFromFile(value.Substring(1));\n            return true;\n        }\n    }\n\n    [Serializable]\n    public class OptionException : Exception\n    {\n        private string option;\n\n        public OptionException()\n        {\n        }\n\n        public OptionException(string message, string optionName)\n            : base(message)\n        {\n            this.option = optionName;\n        }\n\n        public OptionException(string message, string optionName, Exception innerException)\n            : base(message, innerException)\n        {\n            this.option = optionName;\n        }\n\n        protected OptionException(SerializationInfo info, StreamingContext context)\n            : base(info, context)\n        {\n            this.option = info.GetString(\"OptionName\");\n        }\n\n        public string OptionName\n        {\n            get { return this.option; }\n        }\n\n        [SecurityPermission(SecurityAction.LinkDemand, SerializationFormatter = true)]\n        public override void GetObjectData(SerializationInfo info, StreamingContext context)\n        {\n            base.GetObjectData(info, context);\n            info.AddValue(\"OptionName\", option);\n        }\n    }\n\n    public delegate void OptionAction<TKey, TValue>(TKey key, TValue value);\n\n    public class OptionSet : KeyedCollection<string, Option>\n    {\n        public OptionSet()\n            : this(delegate(string f) { return f; })\n        {\n        }\n\n        public OptionSet(Converter<string, string> localizer)\n        {\n            this.localizer = localizer;\n            this.roSources = new ReadOnlyCollection<ArgumentSource>(sources);\n        }\n\n        Converter<string, string> localizer;\n\n        public Converter<string, string> MessageLocalizer\n        {\n            get { return localizer; }\n        }\n\n        List<ArgumentSource> sources = new List<ArgumentSource>();\n        ReadOnlyCollection<ArgumentSource> roSources;\n\n        public ReadOnlyCollection<ArgumentSource> ArgumentSources\n        {\n            get { return roSources; }\n        }\n\n\n        protected override string GetKeyForItem(Option item)\n        {\n            if (item == null)\n                throw new ArgumentNullException(\"option\");\n            if (item.Names != null && item.Names.Length > 0)\n                return item.Names[0];\n            // This should never happen, as it's invalid for Option to be\n            // constructed w/o any names.\n            throw new InvalidOperationException(\"Option has no names!\");\n        }\n\n        [Obsolete(\"Use KeyedCollection.this[string]\")]\n        protected Option GetOptionForName(string option)\n        {\n            if (option == null)\n                throw new ArgumentNullException(\"option\");\n            try\n            {\n                return base[option];\n            }\n            catch (KeyNotFoundException)\n            {\n                return null;\n            }\n        }\n\n        protected override void InsertItem(int index, Option item)\n        {\n            base.InsertItem(index, item);\n            AddImpl(item);\n        }\n\n        protected override void RemoveItem(int index)\n        {\n            Option p = Items[index];\n            base.RemoveItem(index);\n            // KeyedCollection.RemoveItem() handles the 0th item\n            for (int i = 1; i < p.Names.Length; ++i)\n            {\n                Dictionary.Remove(p.Names[i]);\n            }\n        }\n\n        protected override void SetItem(int index, Option item)\n        {\n            base.SetItem(index, item);\n            AddImpl(item);\n        }\n\n        private void AddImpl(Option option)\n        {\n            if (option == null)\n                throw new ArgumentNullException(\"option\");\n            List<string> added = new List<string>(option.Names.Length);\n            try\n            {\n                // KeyedCollection.InsertItem/SetItem handle the 0th name.\n                for (int i = 1; i < option.Names.Length; ++i)\n                {\n                    Dictionary.Add(option.Names[i], option);\n                    added.Add(option.Names[i]);\n                }\n            }\n            catch (Exception)\n            {\n                foreach (string name in added)\n                    Dictionary.Remove(name);\n                throw;\n            }\n        }\n\n        public OptionSet Add(string header)\n        {\n            if (header == null)\n                throw new ArgumentNullException(\"header\");\n            Add(new Category(header));\n            return this;\n        }\n\n        internal sealed class Category : Option\n        {\n            // Prototype starts with '=' because this is an invalid prototype\n            // (see Option.ParsePrototype(), and thus it'll prevent Category\n            // instances from being accidentally used as normal options.\n            public Category(string description)\n                : base(\"=:Category:= \" + description, description)\n            {\n            }\n\n            protected override void OnParseComplete(OptionContext c)\n            {\n                throw new NotSupportedException(\"Category.OnParseComplete should not be invoked.\");\n            }\n        }\n\n\n        public new OptionSet Add(Option option)\n        {\n            base.Add(option);\n            return this;\n        }\n\n        sealed class ActionOption : Option\n        {\n            Action<OptionValueCollection> action;\n\n            public ActionOption(string prototype, string description, int count, Action<OptionValueCollection> action)\n                : this(prototype, description, count, action, false)\n            {\n            }\n\n            public ActionOption(string prototype, string description, int count, Action<OptionValueCollection> action, bool hidden)\n                : base(prototype, description, count, hidden)\n            {\n                if (action == null)\n                    throw new ArgumentNullException(\"action\");\n                this.action = action;\n            }\n\n            protected override void OnParseComplete(OptionContext c)\n            {\n                action(c.OptionValues);\n            }\n        }\n\n        public OptionSet Add(string prototype, Action<string> action)\n        {\n            return Add(prototype, null, action);\n        }\n\n        public OptionSet Add(string prototype, string description, Action<string> action)\n        {\n            return Add(prototype, description, action, false);\n        }\n\n        public OptionSet Add(string prototype, string description, Action<string> action, bool hidden)\n        {\n            if (action == null)\n                throw new ArgumentNullException(\"action\");\n            Option p = new ActionOption(prototype, description, 1,\n                    delegate(OptionValueCollection v) { action(v[0]); }, hidden);\n            base.Add(p);\n            return this;\n        }\n\n        public OptionSet Add(string prototype, OptionAction<string, string> action)\n        {\n            return Add(prototype, null, action);\n        }\n\n        public OptionSet Add(string prototype, string description, OptionAction<string, string> action)\n        {\n            return Add(prototype, description, action, false);\n        }\n\n        public OptionSet Add(string prototype, string description, OptionAction<string, string> action, bool hidden)\n        {\n            if (action == null)\n                throw new ArgumentNullException(\"action\");\n            Option p = new ActionOption(prototype, description, 2,\n                    delegate(OptionValueCollection v) { action(v[0], v[1]); }, hidden);\n            base.Add(p);\n            return this;\n        }\n\n        sealed class ActionOption<T> : Option\n        {\n            Action<T> action;\n\n            public ActionOption(string prototype, string description, Action<T> action)\n                : base(prototype, description, 1)\n            {\n                if (action == null)\n                    throw new ArgumentNullException(\"action\");\n                this.action = action;\n            }\n\n            protected override void OnParseComplete(OptionContext c)\n            {\n                action(Parse<T>(c.OptionValues[0], c));\n            }\n        }\n\n        sealed class ActionOption<TKey, TValue> : Option\n        {\n            OptionAction<TKey, TValue> action;\n\n            public ActionOption(string prototype, string description, OptionAction<TKey, TValue> action)\n                : base(prototype, description, 2)\n            {\n                if (action == null)\n                    throw new ArgumentNullException(\"action\");\n                this.action = action;\n            }\n\n            protected override void OnParseComplete(OptionContext c)\n            {\n                action(\n                        Parse<TKey>(c.OptionValues[0], c),\n                        Parse<TValue>(c.OptionValues[1], c));\n            }\n        }\n\n        public OptionSet Add<T>(string prototype, Action<T> action)\n        {\n            return Add(prototype, null, action);\n        }\n\n        public OptionSet Add<T>(string prototype, string description, Action<T> action)\n        {\n            return Add(new ActionOption<T>(prototype, description, action));\n        }\n\n        public OptionSet Add<TKey, TValue>(string prototype, OptionAction<TKey, TValue> action)\n        {\n            return Add(prototype, null, action);\n        }\n\n        public OptionSet Add<TKey, TValue>(string prototype, string description, OptionAction<TKey, TValue> action)\n        {\n            return Add(new ActionOption<TKey, TValue>(prototype, description, action));\n        }\n\n        public OptionSet Add(ArgumentSource source)\n        {\n            if (source == null)\n                throw new ArgumentNullException(\"source\");\n            sources.Add(source);\n            return this;\n        }\n\n        protected virtual OptionContext CreateOptionContext()\n        {\n            return new OptionContext(this);\n        }\n\n        public List<string> Parse(IEnumerable<string> arguments)\n        {\n            if (arguments == null)\n                throw new ArgumentNullException(\"arguments\");\n            OptionContext c = CreateOptionContext();\n            c.OptionIndex = -1;\n            bool process = true;\n            List<string> unprocessed = new List<string>();\n            Option def = Contains(\"<>\") ? this[\"<>\"] : null;\n            ArgumentEnumerator ae = new ArgumentEnumerator(arguments);\n            foreach (string argument in ae)\n            {\n                ++c.OptionIndex;\n                if (argument == \"--\")\n                {\n                    process = false;\n                    continue;\n                }\n                if (!process)\n                {\n                    Unprocessed(unprocessed, def, c, argument);\n                    continue;\n                }\n                if (AddSource(ae, argument))\n                    continue;\n                if (!Parse(argument, c))\n                    Unprocessed(unprocessed, def, c, argument);\n            }\n            if (c.Option != null)\n                c.Option.Invoke(c);\n            return unprocessed;\n        }\n\n        class ArgumentEnumerator : IEnumerable<string>\n        {\n            List<IEnumerator<string>> sources = new List<IEnumerator<string>>();\n\n            public ArgumentEnumerator(IEnumerable<string> arguments)\n            {\n                sources.Add(arguments.GetEnumerator());\n            }\n\n            public void Add(IEnumerable<string> arguments)\n            {\n                sources.Add(arguments.GetEnumerator());\n            }\n\n            public IEnumerator<string> GetEnumerator()\n            {\n                do\n                {\n                    IEnumerator<string> c = sources[sources.Count - 1];\n                    if (c.MoveNext())\n                        yield return c.Current;\n                    else\n                    {\n                        c.Dispose();\n                        sources.RemoveAt(sources.Count - 1);\n                    }\n                } while (sources.Count > 0);\n            }\n\n            IEnumerator IEnumerable.GetEnumerator()\n            {\n                return GetEnumerator();\n            }\n        }\n\n        bool AddSource(ArgumentEnumerator ae, string argument)\n        {\n            foreach (ArgumentSource source in sources)\n            {\n                IEnumerable<string> replacement;\n                if (!source.GetArguments(argument, out replacement))\n                    continue;\n                ae.Add(replacement);\n                return true;\n            }\n            return false;\n        }\n\n        private static bool Unprocessed(ICollection<string> extra, Option def, OptionContext c, string argument)\n        {\n            if (def == null)\n            {\n                extra.Add(argument);\n                return false;\n            }\n            c.OptionValues.Add(argument);\n            c.Option = def;\n            c.Option.Invoke(c);\n            return false;\n        }\n\n        private readonly Regex ValueOption = new Regex(\n            @\"^(?<flag>--|-|/)(?<name>[^:=]+)((?<sep>[:=])(?<value>.*))?$\");\n\n        protected bool GetOptionParts(string argument, out string flag, out string name, out string sep, out string value)\n        {\n            if (argument == null)\n                throw new ArgumentNullException(\"argument\");\n\n            flag = name = sep = value = null;\n            Match m = ValueOption.Match(argument);\n            if (!m.Success)\n            {\n                return false;\n            }\n            flag = m.Groups[\"flag\"].Value;\n            name = m.Groups[\"name\"].Value;\n            if (m.Groups[\"sep\"].Success && m.Groups[\"value\"].Success)\n            {\n                sep = m.Groups[\"sep\"].Value;\n                value = m.Groups[\"value\"].Value;\n            }\n            return true;\n        }\n\n        protected virtual bool Parse(string argument, OptionContext c)\n        {\n            if (c.Option != null)\n            {\n                ParseValue(argument, c);\n                return true;\n            }\n\n            string f, n, s, v;\n            if (!GetOptionParts(argument, out f, out n, out s, out v))\n                return false;\n\n            Option p;\n            if (Contains(n))\n            {\n                p = this[n];\n                c.OptionName = f + n;\n                c.Option = p;\n                switch (p.OptionValueType)\n                {\n                    case OptionValueType.None:\n                        c.OptionValues.Add(n);\n                        c.Option.Invoke(c);\n                        break;\n                    case OptionValueType.Optional:\n                    case OptionValueType.Required:\n                        ParseValue(v, c);\n                        break;\n                }\n                return true;\n            }\n            // no match; is it a bool option?\n            if (ParseBool(argument, n, c))\n                return true;\n            // is it a bundled option?\n            if (ParseBundledValue(f, string.Concat(n + s + v), c))\n                return true;\n\n            return false;\n        }\n\n        private void ParseValue(string option, OptionContext c)\n        {\n            if (option != null)\n                foreach (string o in c.Option.ValueSeparators != null\n                        ? option.Split(c.Option.ValueSeparators, c.Option.MaxValueCount - c.OptionValues.Count, StringSplitOptions.None)\n                        : new string[] { option })\n                {\n                    c.OptionValues.Add(o);\n                }\n            if (c.OptionValues.Count == c.Option.MaxValueCount ||\n                    c.Option.OptionValueType == OptionValueType.Optional)\n                c.Option.Invoke(c);\n            else if (c.OptionValues.Count > c.Option.MaxValueCount)\n            {\n                throw new OptionException(localizer(string.Format(\n                                \"Error: Found {0} option values when expecting {1}.\",\n                                c.OptionValues.Count, c.Option.MaxValueCount)),\n                        c.OptionName);\n            }\n        }\n\n        private bool ParseBool(string option, string n, OptionContext c)\n        {\n            Option p;\n            string rn;\n            if (n.Length >= 1 && (n[n.Length - 1] == '+' || n[n.Length - 1] == '-') &&\n                    Contains((rn = n.Substring(0, n.Length - 1))))\n            {\n                p = this[rn];\n                string v = n[n.Length - 1] == '+' ? option : null;\n                c.OptionName = option;\n                c.Option = p;\n                c.OptionValues.Add(v);\n                p.Invoke(c);\n                return true;\n            }\n            return false;\n        }\n\n        private bool ParseBundledValue(string f, string n, OptionContext c)\n        {\n            if (f != \"-\")\n                return false;\n            for (int i = 0; i < n.Length; ++i)\n            {\n                Option p;\n                string opt = f + n[i].ToString();\n                string rn = n[i].ToString();\n                if (!Contains(rn))\n                {\n                    if (i == 0)\n                        return false;\n                    throw new OptionException(string.Format(localizer(\n                                    \"Cannot bundle unregistered option '{0}'.\"), opt), opt);\n                }\n                p = this[rn];\n                switch (p.OptionValueType)\n                {\n                    case OptionValueType.None:\n                        Invoke(c, opt, n, p);\n                        break;\n                    case OptionValueType.Optional:\n                    case OptionValueType.Required:\n                        {\n                            string v = n.Substring(i + 1);\n                            c.Option = p;\n                            c.OptionName = opt;\n                            ParseValue(v.Length != 0 ? v : null, c);\n                            return true;\n                        }\n                    default:\n                        throw new InvalidOperationException(\"Unknown OptionValueType: \" + p.OptionValueType);\n                }\n            }\n            return true;\n        }\n\n        private static void Invoke(OptionContext c, string name, string value, Option option)\n        {\n            c.OptionName = name;\n            c.Option = option;\n            c.OptionValues.Add(value);\n            option.Invoke(c);\n        }\n\n        private const int OptionWidth = 29;\n        private const int Description_FirstWidth = 80 - OptionWidth;\n        private const int Description_RemWidth = 80 - OptionWidth - 2;\n\n        public void WriteOptionDescriptions(TextWriter o)\n        {\n            foreach (Option p in this)\n            {\n                int written = 0;\n\n                if (p.Hidden)\n                    continue;\n\n                Category c = p as Category;\n                if (c != null)\n                {\n                    WriteDescription(o, p.Description, \"\", 80, 80);\n                    continue;\n                }\n\n                if (!WriteOptionPrototype(o, p, ref written))\n                    continue;\n\n                if (written < OptionWidth)\n                    o.Write(new string(' ', OptionWidth - written));\n                else\n                {\n                    o.WriteLine();\n                    o.Write(new string(' ', OptionWidth));\n                }\n\n                WriteDescription(o, p.Description, new string(' ', OptionWidth + 2),\n                        Description_FirstWidth, Description_RemWidth);\n            }\n\n            foreach (ArgumentSource s in sources)\n            {\n                string[] names = s.GetNames();\n                if (names == null || names.Length == 0)\n                    continue;\n\n                int written = 0;\n\n                Write(o, ref written, \"  \");\n                Write(o, ref written, names[0]);\n                for (int i = 1; i < names.Length; ++i)\n                {\n                    Write(o, ref written, \", \");\n                    Write(o, ref written, names[i]);\n                }\n\n                if (written < OptionWidth)\n                    o.Write(new string(' ', OptionWidth - written));\n                else\n                {\n                    o.WriteLine();\n                    o.Write(new string(' ', OptionWidth));\n                }\n\n                WriteDescription(o, s.Description, new string(' ', OptionWidth + 2),\n                        Description_FirstWidth, Description_RemWidth);\n            }\n        }\n\n        void WriteDescription(TextWriter o, string value, string prefix, int firstWidth, int remWidth)\n        {\n            bool indent = false;\n            foreach (string line in GetLines(localizer(GetDescription(value)), firstWidth, remWidth))\n            {\n                if (indent)\n                    o.Write(prefix);\n                o.WriteLine(line);\n                indent = true;\n            }\n        }\n\n        bool WriteOptionPrototype(TextWriter o, Option p, ref int written)\n        {\n            string[] names = p.Names;\n\n            int i = GetNextOptionIndex(names, 0);\n            if (i == names.Length)\n                return false;\n\n            if (names[i].Length == 1)\n            {\n                Write(o, ref written, \"  -\");\n                Write(o, ref written, names[0]);\n            }\n            else\n            {\n                Write(o, ref written, \"      --\");\n                Write(o, ref written, names[0]);\n            }\n\n            for (i = GetNextOptionIndex(names, i + 1);\n                    i < names.Length; i = GetNextOptionIndex(names, i + 1))\n            {\n                Write(o, ref written, \", \");\n                Write(o, ref written, names[i].Length == 1 ? \"-\" : \"--\");\n                Write(o, ref written, names[i]);\n            }\n\n            if (p.OptionValueType == OptionValueType.Optional ||\n                    p.OptionValueType == OptionValueType.Required)\n            {\n                if (p.OptionValueType == OptionValueType.Optional)\n                {\n                    Write(o, ref written, localizer(\"[\"));\n                }\n                Write(o, ref written, localizer(\"=\" + GetArgumentName(0, p.MaxValueCount, p.Description)));\n                string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0\n                    ? p.ValueSeparators[0]\n                    : \" \";\n                for (int c = 1; c < p.MaxValueCount; ++c)\n                {\n                    Write(o, ref written, localizer(sep + GetArgumentName(c, p.MaxValueCount, p.Description)));\n                }\n                if (p.OptionValueType == OptionValueType.Optional)\n                {\n                    Write(o, ref written, localizer(\"]\"));\n                }\n            }\n            return true;\n        }\n\n        static int GetNextOptionIndex(string[] names, int i)\n        {\n            while (i < names.Length && names[i] == \"<>\")\n            {\n                ++i;\n            }\n            return i;\n        }\n\n        static void Write(TextWriter o, ref int n, string s)\n        {\n            n += s.Length;\n            o.Write(s);\n        }\n\n        private static string GetArgumentName(int index, int maxIndex, string description)\n        {\n            if (description == null)\n                return maxIndex == 1 ? \"VALUE\" : \"VALUE\" + (index + 1);\n            string[] nameStart;\n            if (maxIndex == 1)\n                nameStart = new string[] { \"{0:\", \"{\" };\n            else\n                nameStart = new string[] { \"{\" + index + \":\" };\n            for (int i = 0; i < nameStart.Length; ++i)\n            {\n                int start, j = 0;\n                do\n                {\n                    start = description.IndexOf(nameStart[i], j);\n                } while (start >= 0 && j != 0 ? description[j++ - 1] == '{' : false);\n                if (start == -1)\n                    continue;\n                int end = description.IndexOf(\"}\", start);\n                if (end == -1)\n                    continue;\n                return description.Substring(start + nameStart[i].Length, end - start - nameStart[i].Length);\n            }\n            return maxIndex == 1 ? \"VALUE\" : \"VALUE\" + (index + 1);\n        }\n\n        private static string GetDescription(string description)\n        {\n            if (description == null)\n                return string.Empty;\n            StringBuilder sb = new StringBuilder(description.Length);\n            int start = -1;\n            for (int i = 0; i < description.Length; ++i)\n            {\n                switch (description[i])\n                {\n                    case '{':\n                        if (i == start)\n                        {\n                            sb.Append('{');\n                            start = -1;\n                        }\n                        else if (start < 0)\n                            start = i + 1;\n                        break;\n                    case '}':\n                        if (start < 0)\n                        {\n                            if ((i + 1) == description.Length || description[i + 1] != '}')\n                                throw new InvalidOperationException(\"Invalid option description: \" + description);\n                            ++i;\n                            sb.Append(\"}\");\n                        }\n                        else\n                        {\n                            sb.Append(description.Substring(start, i - start));\n                            start = -1;\n                        }\n                        break;\n                    case ':':\n                        if (start < 0)\n                            goto default;\n                        start = i + 1;\n                        break;\n                    default:\n                        if (start < 0)\n                            sb.Append(description[i]);\n                        break;\n                }\n            }\n            return sb.ToString();\n        }\n\n        private static IEnumerable<string> GetLines(string description, int firstWidth, int remWidth)\n        {\n            return StringCoda.WrappedLines(description, firstWidth, remWidth);\n        }\n    }\n}\n\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Client/Outracks.CodeCompletion.UXNinja.PerformanceTests.Client.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{BEB02E7E-2436-4D51-8688-27FEB4A72DBC}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion.UXNinja.PerformanceTests.Client</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.UXNinja.PerformanceTests.Client</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"BasicTypes\\CommandLineOptions.cs\" />\n    <Compile Include=\"BasicTypes\\Mono.Options\\Options.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core\\Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.csproj\">\n      <Project>{99ff164f-a691-4952-8ec8-577eb8c49f41}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja.PerformanceTests.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Client/Program.cs",
    "content": "﻿using Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.Runner;\nusing Uno.UXNinja.PerformanceTests.Client.BasicTypes;\n\nnamespace Uno.UXNinja.PerformanceTests.Client\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            var options = CommandLineOptions.From(args);\n            new PerformanceTestRunner().DiscoverAndRun(GetFromCommandLineOptions(options));\n        }\n\n        static RunnerOptions GetFromCommandLineOptions(CommandLineOptions options)\n        {\n            return new RunnerOptions()\n            {\n                Paths = options.Paths,\n                LogDirectoryName = options.LogDirectoryName,\n                TestTimeout = options.TestTimeout,\n                BuildNumber = options.BuildNumber,\n                BranchName = options.BranchName,\n                UnoLibraryPath = options.UnoLibraryPath\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Client/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeCompletion.UXNinja.PerformanceTests.Client\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Client/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Attributes/IgnorePerformanceTestAttribute.cs",
    "content": "﻿using System;\n\nnamespace Uno.UXNinja.PerformanceTests.Core.Attributes\n{\n    public class IgnorePerformanceTestAttribute : Attribute\n    {\n        public string Reason { get; set; }\n\n        public IgnorePerformanceTestAttribute()\n        { }\n\n        public IgnorePerformanceTestAttribute(string reason)\n        {\n            Reason = reason;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Attributes/PerformanceTestAttribute.cs",
    "content": "﻿using System;\n\nnamespace Uno.UXNinja.PerformanceTests.Core.Attributes\n{\n    [AttributeUsage(AttributeTargets.Method)]\n    public class PerformanceTestAttribute : Attribute\n    {\n        public string Description { get; set; }\n\n        public PerformanceTestAttribute()\n        { }\n\n        public PerformanceTestAttribute(string description)\n        {\n            Description = description;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Context/IContext.cs",
    "content": "﻿using Uno.UXNinja.PerformanceTests.Core.Loggers;\n\nnamespace Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.Context\n{\n    public interface IContext\n    {\n        IResultLogger Logger { get; set; }\n\n        string UnoLibraryPath { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Context/UxPerformanceTestContext.cs",
    "content": "﻿using Uno.UXNinja.PerformanceTests.Core.Loggers;\n\nnamespace Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.Context\n{\n    public class UxPerformanceTestContext : IContext\n    {\n        public UxPerformanceTestContext(IResultLogger currentLogger, string unoLibraryPath)\n        {\n            Logger = currentLogger;\n            UnoLibraryPath = unoLibraryPath;\n        }\n\n        public IResultLogger Logger { get; set; }\n\n        public string UnoLibraryPath { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/BaseResultLogger.cs",
    "content": "﻿using System;\nusing System.IO;\nusing Uno.UXNinja.PerformanceTests.Core.Loggers.LoggersEntities;\n\nnamespace Uno.UXNinja.PerformanceTests.Core.Loggers\n{\n    public abstract class BaseResultLogger : IResultLogger\n    {\n        protected string _logDirectoryPath;\n        protected string _logFileName;\n        protected string _targetName;\n        protected string _branchName;\n        protected ProjectEntity _project;\n\n        public BaseResultLogger(string logDirectoryName, string branchName, string buildNumber)\n        {\n            var currDate = DateTime.Now;\n            _logDirectoryPath = GetLogDirectoryFullPath(currDate, logDirectoryName, buildNumber);\n            _branchName = branchName;\n        }\n\n        public void LogTimeEvent(string name, string description, double seconds)\n        {\n            _project.Events.Add(new EventEntity(name, description, seconds * 1000));\n        }\n\n        public void LogError(string message)\n        {\n            if (_project != null)\n            {\n                _project.Events.Clear();\n                _project.ErrorMessage = message;\n            }\n        }\n\n        public virtual void ProjectStarted(string projectName)\n        {\n            _project = new ProjectEntity(_branchName, _targetName, projectName);\n            _logFileName = Path.Combine(_logDirectoryPath, projectName + \".xml\");\n        }\n\n        public abstract void ProjectFinished();\n\n        protected abstract string GetLogDirectoryFullPath(DateTime currDate, string logDirectoryName, string buildNumber);\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/IResultLogger.cs",
    "content": "﻿namespace Uno.UXNinja.PerformanceTests.Core.Loggers\n{\n    public interface IResultLogger\n    {\n        void LogTimeEvent(string name, string description, double seconds);\n\n        void LogError(string message);\n\n        void ProjectStarted(string projectName);\n\n        void ProjectFinished();\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/LoggersEntities/EventEntity.cs",
    "content": "﻿namespace Uno.UXNinja.PerformanceTests.Core.Loggers.LoggersEntities\n{\n    public class EventEntity\n    {\n        public EventEntity()\n        { }\n\n        public EventEntity(string name, string description, double durationInMs)\n        {\n            Name = name;\n            DurationInMs = durationInMs;\n            Description = description;\n        }\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public double DurationInMs { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/LoggersEntities/ProjectEntity.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Uno.UXNinja.PerformanceTests.Core.Loggers.LoggersEntities\n{\n    public class ProjectEntity\n    {\n        public ProjectEntity()\n        {\n            Events = new List<EventEntity>();\n        }\n\n        public ProjectEntity(string branchName, string target, string projectName)\n            : this()\n        {\n            Name = projectName;\n            BranchName = branchName;\n            StartDate = DateTime.Now;\n        }\n\n        public string Name { get; set; }\n\n        public string BranchName { get; set; }\n\n        public DateTime StartDate { get; set; }\n\n        public string ErrorMessage { get; set; }\n\n        public string TestDescription { get; set; }\n\n        public List<EventEntity> Events { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/ResultFileLogger.cs",
    "content": "﻿using System;\nusing System.IO;\nusing Uno.UXNinja.PerformanceTests.Core.Loggers.LoggersEntities;\n\nnamespace Uno.UXNinja.PerformanceTests.Core.Loggers\n{\n    public class ResultFileLogger : BaseResultLogger\n    {\n        public ResultFileLogger(string logDirectoryName, string branchName, string buildNumber)\n            : base(logDirectoryName, branchName, buildNumber)\n        {\n            if (!Directory.Exists(_logDirectoryPath))\n                Directory.CreateDirectory(_logDirectoryPath);\n        }\n\n        #region Override Methods\n\n        public override void ProjectStarted(string projectName)\n        {\n            base.ProjectStarted(projectName);\n\n            if (File.Exists(_logFileName))\n                File.Delete(_logFileName);\n        }\n\n        public override void ProjectFinished()\n        {\n            if (_project != null)\n                File.WriteAllText(_logFileName, _project.ToXmlString<ProjectEntity>());\n        }\n\n        protected override string GetLogDirectoryFullPath(DateTime currDate, string logDirectoryName, string buildNumber)\n        {\n            var sessionDirectoryName = string.IsNullOrEmpty(buildNumber) ? currDate.Ticks.ToString() : buildNumber;\n            var dateDirectoryName = string.IsNullOrEmpty(_branchName) ? Path.Combine(logDirectoryName, \"unnamed\", currDate.ToString(\"MM_dd_yyy\"))\n                                                                      : Path.Combine(logDirectoryName, _branchName, currDate.ToString(\"MM_dd_yyy\"));\n\n            var num = GetNumberOfSessionDirectories(dateDirectoryName);\n            return Path.Combine(dateDirectoryName, string.Format(\"{0}__{1}\", num + 1, sessionDirectoryName));\n        }\n\n        #endregion\n\n        #region Private Methods\n\n        private int GetNumberOfSessionDirectories(string dateDirectoryName)\n        {\n            if (!Directory.Exists(dateDirectoryName))\n                return 0;\n\n            return Directory.GetDirectories(dateDirectoryName).Length;\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/ResultFtpLogger.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Net;\nusing System.Text;\nusing Uno.UXNinja.PerformanceTests.Core.Loggers.LoggersEntities;\n\nnamespace Uno.UXNinja.PerformanceTests.Core.Loggers\n{\n    public class ResultFtpLogger : BaseResultLogger\n    {\n        public ResultFtpLogger(string logDirectoryName, string branchName, string buildNumber)\n            : base(logDirectoryName, branchName, buildNumber)\n        {\n            CreateDirectory(_logDirectoryPath);\n        }\n\n        #region Override Methods\n\n        public override void ProjectStarted(string projectName)\n        {\n            base.ProjectStarted(projectName);\n            DeleteFileIfExists(_logFileName);\n        }\n\n        public override void ProjectFinished()\n        {\n            if (_project != null)\n                UploadFile(_logFileName);\n        }\n\n        protected override string GetLogDirectoryFullPath(DateTime currDate, string logDirectoryName, string buildNumber)\n        {\n            var sessionDirectoryName = string.IsNullOrEmpty(buildNumber) ? currDate.Ticks.ToString() : buildNumber;\n\n            var baseUri = new Uri(logDirectoryName);\n            var dateDirectoryUri = string.IsNullOrEmpty(_branchName) ? new Uri(baseUri, string.Format(\"unnamed/{0}/\", currDate.ToString(\"MM_dd_yyy\")))\n                                                                     : new Uri(baseUri, string.Format(\"{0}/{1}/\", _branchName, currDate.ToString(\"MM_dd_yyy\")));\n\n            var num = GetNumberOfSessionDirectories(dateDirectoryUri.ToString());\n            return new Uri(dateDirectoryUri, string.Format(\"{0}__{1}/\", num + 1, sessionDirectoryName)).ToString();\n        }\n\n        #endregion\n\n        #region Private Methods\n\n        private void DeleteFileIfExists(string path)\n        {\n            var request = GetFtpWebRequest(path);\n            request.Method = WebRequestMethods.Ftp.DeleteFile;\n\n            try\n            {\n                FtpWebResponse response = (FtpWebResponse)request.GetResponse();\n                response.Close();\n            }\n            catch (WebException ex)\n            {\n                FtpWebResponse response = (FtpWebResponse)ex.Response;\n                response.Close();\n                if (response.StatusCode != FtpStatusCode.ActionNotTakenFileUnavailable)\n                {\n                    throw ex;\n                }\n            }\n        }\n\n        private void CreateDirectory(string path)\n        {\n            var request = GetFtpWebRequest(path);\n            request.Method = WebRequestMethods.Ftp.MakeDirectory;\n\n            try\n            {\n                FtpWebResponse response = (FtpWebResponse)request.GetResponse();\n                response.Close();\n            }\n            catch (WebException ex)\n            {\n                FtpWebResponse response = (FtpWebResponse)ex.Response;\n                response.Close();\n                if (response.StatusCode != FtpStatusCode.ActionNotTakenFileUnavailable)\n                {\n                    throw ex;\n                }\n            }\n        }\n\n        private void UploadFile(string path)\n        {\n            var content = Encoding.UTF8.GetBytes(XmlTools.ToXmlString<ProjectEntity>(_project));\n            var request = GetFtpWebRequest(path);\n            request.Method = WebRequestMethods.Ftp.UploadFile;\n\n            request.ContentLength = content.Length;\n            Stream requestStream = request.GetRequestStream();\n            requestStream.Write(content, 0, content.Length);\n            requestStream.Close();\n\n            FtpWebResponse response = (FtpWebResponse)request.GetResponse();\n            response.Close();\n        }\n\n        private int GetNumberOfSessionDirectories(string path)\n        {\n            var res = 0;\n            var request = GetFtpWebRequest(path);\n            request.Method = WebRequestMethods.Ftp.ListDirectory;\n            try\n            {\n                FtpWebResponse response = (FtpWebResponse)request.GetResponse();\n                using (StreamReader reader = new StreamReader(response.GetResponseStream()))\n                {\n                    res = reader.ReadToEnd().Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).Length;\n                }\n                response.Close();\n            }\n            catch (WebException ex)\n            {\n                FtpWebResponse response = (FtpWebResponse)ex.Response;\n                response.Close();\n                if (response.StatusCode != FtpStatusCode.ActionNotTakenFileUnavailable)\n                {\n                    throw ex;\n                }\n            }\n            return res;\n        }\n\n        private FtpWebRequest GetFtpWebRequest(string requestUri)\n        {\n            return (FtpWebRequest)FtpWebRequest.Create(requestUri);\n        }\n\n        #endregion\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/ResultLoggersFactory.cs",
    "content": "﻿namespace Uno.UXNinja.PerformanceTests.Core.Loggers\n{\n    public class ResultLoggersFactory\n    {\n        public static IResultLogger GetLogger(string outputDirectory, string branchName, string buildNumber)\n        {\n            if (outputDirectory.StartsWith(\"ftp://\"))\n            {\n                return new ResultFtpLogger(outputDirectory, branchName, buildNumber);\n            }\n            return new ResultFileLogger(outputDirectory, branchName, buildNumber);\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Loggers/XmlTool.cs",
    "content": "﻿using System.IO;\nusing System.Xml.Serialization;\n\nnamespace Uno.UXNinja.PerformanceTests.Core.Loggers\n{\n    public static class XmlTools\n    {\n        public static string ToXmlString<T>(this T input)\n        {\n            using (var writer = new StringWriter())\n            {\n                input.ToXml(writer);\n                return writer.ToString();\n            }\n        }\n\n        public static void ToXml<T>(this T objectToSerialize, StringWriter writer)\n        {\n            new XmlSerializer(typeof(T)).Serialize(writer, objectToSerialize);\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{99FF164F-A691-4952-8EC8-577EB8C49F41}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion.UXNinja.PerformanceTests.Core</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.UXNinja.PerformanceTests.Core</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin/$(Configuration)</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Uno.Build\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Build.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Core\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.ProjectFormat\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.ProjectFormat.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Attributes\\IgnorePerformanceTestAttribute.cs\" />\n    <Compile Include=\"Attributes\\PerformanceTestAttribute.cs\" />\n    <Compile Include=\"Context\\IContext.cs\" />\n    <Compile Include=\"Loggers\\BaseResultLogger.cs\" />\n    <Compile Include=\"Loggers\\IResultLogger.cs\" />\n    <Compile Include=\"Loggers\\LoggersEntities\\EventEntity.cs\" />\n    <Compile Include=\"Loggers\\LoggersEntities\\ProjectEntity.cs\" />\n    <Compile Include=\"Loggers\\ResultFileLogger.cs\" />\n    <Compile Include=\"Loggers\\ResultFtpLogger.cs\" />\n    <Compile Include=\"Loggers\\ResultLoggersFactory.cs\" />\n    <Compile Include=\"Loggers\\XmlTool.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Runner\\RunnerOptions.cs\" />\n    <Compile Include=\"TestBase.cs\" />\n    <Compile Include=\"Runner\\PerformanceTestRunner.cs\" />\n    <Compile Include=\"Context\\UxPerformanceTestContext.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5c6c19f4-c5c4-4f8b-bae4-a92e6c0d62bb}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.NRefactoryInterop\\Outracks.CodeCompletion.NRefactoryInterop.csproj\">\n      <Project>{5a43f127-3217-4bea-93f0-13903b240b5a}</Project>\n      <Name>Outracks.CodeCompletion.NRefactoryInterop</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja.TestsCommon\\Outracks.CodeCompletion.UXNinja.TestsCommon.csproj\">\n      <Project>{544abbd9-1326-4184-b026-54eb4c9fad33}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja.TestsCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja\\Outracks.CodeCompletion.UXNinja.csproj\">\n      <Project>{3c19f9aa-9c81-426f-a0ea-b046aae755ee}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3aab1db2-fcb7-495d-addf-11131dcf821a}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196b010d-ad36-4947-95aa-14fc4a27bd18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeCompletion.UXNinja.PerformanceTests.Core\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Runner/PerformanceTestRunner.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading;\nusing Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.Context;\nusing Uno.UXNinja.PerformanceTests.Core;\nusing Uno.UXNinja.PerformanceTests.Core.Attributes;\nusing Uno.UXNinja.PerformanceTests.Core.Loggers;\n\nnamespace Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.Runner\n{\n    public class PerformanceTestRunner\n    {\n        public void DiscoverAndRun(RunnerOptions options)\n        {\n            var logger = ResultLoggersFactory.GetLogger(options.LogDirectoryName, options.BranchName, options.BuildNumber);\n            foreach (var c in GetClassesWithTests(options))\n            {\n                var testMethods = c.GetMethods().Where(m => m.GetCustomAttribute<PerformanceTestAttribute>() != null\n                                                            && m.GetCustomAttribute<IgnorePerformanceTestAttribute>() == null);\n\n                logger.ProjectStarted(c.Name);\n\n                Thread t = new Thread(() =>\n                {\n                    foreach (var method in testMethods)\n                    {\n                        TestBase classInstance = (TestBase)Activator.CreateInstance(c, null);\n                        classInstance.SetupContext(new UxPerformanceTestContext(logger, options.UnoLibraryPath));\n                        method.Invoke(classInstance, null);\n                    }\n                });\n\n                t.Start();\n                if (!t.Join(options.TestTimeout))\n                {\n                    t.Abort();\n                    logger.LogError(\"The operation has timed-out\");\n                }\n\n                logger.ProjectFinished();\n            }\n        }\n\n        private IEnumerable<Type> GetClassesWithTests(RunnerOptions options)\n        {\n            var res = new List<Type>();\n\n            //add current path to search paths\n            options.Paths.Add(Directory.GetCurrentDirectory());\n\n            foreach (var path in options.Paths)\n            {\n                var di = new DirectoryInfo(path);\n                foreach (var fi in di.EnumerateFiles(\"*.dll\", SearchOption.AllDirectories))\n                {\n                    var assembly = Assembly.LoadFile(fi.FullName);\n                    res.AddRange(assembly.GetTypes().Where(t => t.BaseType == typeof(TestBase)));\n                }\n            }\n\n            return res.GroupBy(u => u.GUID).Select(u => u.First());\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/Runner/RunnerOptions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.Runner\n{\n    public class RunnerOptions\n    {\n        public List<string> Paths { get; set; }\n        public string LogDirectoryName { get; set; }\n        public TimeSpan TestTimeout { get; set; }\n        public string BuildNumber { get; set; }\n        public string BranchName { get; set; }\n        public string UnoLibraryPath { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/TestBase.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing Outracks.CodeCompletionFactory.UXNinja;\nusing Outracks.IO;\nusing Outracks.UnoDevelop.CodeNinja;\nusing Outracks.UnoDevelop.UXNinja;\nusing Uno.Build.Packages;\nusing Uno.Logging;\nusing Uno.ProjectFormat;\nusing Uno.UXNinja.PerformanceTests.Core.Attributes;\nusing Uno.UXNinja.TestsCommon;\nusing IContext = Outracks.CodeCompletion.UXNinja.PerformanceTests.Core.Context.IContext;\n\nnamespace Uno.UXNinja.PerformanceTests.Core\n{\n    public abstract class TestBase\n    {\n        private static Project _project;\n        private static DummyEditorManager _editors;\n        private IContext _context;\n\n        public double ExecutionTime { get; private set; }\n\n        static TestBase()\n        {\n            _editors = new DummyEditorManager();\n            _project = new Project(\"Test\");\n        }\n\n        internal void SetupContext(IContext context)\n        {\n            _context = context;\n        }\n\n        protected void TestPerformance(string code, [CallerMemberName] string testName = \"\")\n        {\n            ConfigureProjectReferences();\n\n            //get calling method info\n            StackTrace stackTrace = new StackTrace();\n            var callingMethod = stackTrace.GetFrame(1).GetMethod();\n            var testAttribute = (PerformanceTestAttribute)callingMethod.GetCustomAttributes(typeof(PerformanceTestAttribute), true)[0];\n\n            var caret = GetCaret(ref code);\n            var filePath = AbsoluteDirectoryPath.Parse(Directory.GetCurrentDirectory()) / new FileName(testName);\n\n            var log = new DummyLogger();\n            var context = Context.CreateContext(filePath, code, caret, new DummySourcePackage());\n            var mainPackage = PackageCache.GetPackage(new Log(log.TextWriter), _project);\n            mainPackage.SetCacheDirectory((AbsoluteDirectoryPath.Parse(mainPackage.CacheDirectory) / new DirectoryName(\"UxCompletion\")).NativePath);\n\n            var build = new CodeNinjaBuild(log, _project, _editors, mainPackage, mainPackage.References.ToList(), code, filePath);\n            build.Execute();\n\n            Stopwatch sw = new Stopwatch();\n            sw.Start();\n            SuggestionParser.GetSuggestions(build.Compiler, context, caret, new DummyReader());\n            sw.Stop();\n\n            if (_context == null)\n                throw new ArgumentNullException(\"_context\");\n\n            _context.Logger.LogTimeEvent(testName, testAttribute.Description, sw.ElapsedMilliseconds / 1000f);\n        }\n\n        private int GetCaret(ref string code)\n        {\n            var caret = 0;\n            if (code.Contains(\"$\"))\n            {\n                caret = code.IndexOf(\"$\");\n                code = code.Substring(0, caret) + code.Substring(caret + 1, code.Length - caret - 1);\n            }\n            return caret;\n        }\n\n        private void ConfigureProjectReferences()\n        {\n            _project.MutablePackageReferences.Clear();\n            _project.MutableProjectReferences.Clear();\n\n            if (!File.Exists(_context.UnoLibraryPath))\n            {\n                throw new FileNotFoundException(\"Unable to load uno library project with test elements and controls\");\n            }\n\n            _project.MutableProjectReferences.Add(new ProjectReference(new DummySource(), _context.UnoLibraryPath));\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.PerformanceTests.Core/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/Outracks.CodeCompletion.UXNinja.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{A6525BC0-989C-407F-8B9B-51246D9E50B4}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.CodeCompletion.UXNinja.Tests</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.UXNinja.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"Uno.Build\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Build.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Core\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.ProjectFormat\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.ProjectFormat.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"TestBase.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Tests\\StartAttributeName.cs\" />\n    <Compile Include=\"Tests\\StartTagName.cs\" />\n    <Compile Include=\"Tests\\ValueSuggestion.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.NRefactoryInterop\\Outracks.CodeCompletion.NRefactoryInterop.csproj\">\n      <Project>{5A43F127-3217-4BEA-93F0-13903B240B5A}</Project>\n      <Name>Outracks.CodeCompletion.NRefactoryInterop</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja.TestsCommon\\Outracks.CodeCompletion.UXNinja.TestsCommon.csproj\">\n      <Project>{544ABBD9-1326-4184-B026-54EB4C9FAD33}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja.TestsCommon</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion\\Outracks.CodeCompletion.csproj\">\n      <Project>{3AAB1DB2-FCB7-495D-ADDF-11131DCF821A}</Project>\n      <Name>Outracks.CodeCompletion</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja\\Outracks.CodeCompletion.UXNinja.csproj\">\n      <Project>{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Uno.UXNinja.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/TestBase.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing Outracks.CodeCompletion;\nusing Outracks.CodeCompletionFactory.UXNinja;\nusing Outracks.IO;\nusing Outracks.UnoDevelop.CodeNinja;\nusing Outracks.UnoDevelop.UXNinja;\nusing Uno.Build.Packages;\nusing Uno.Logging;\nusing Uno.ProjectFormat;\nusing Uno.UXNinja.TestsCommon;\n\nnamespace Uno.UXNinja.Tests\n{\n    public class TestException : Exception\n    {\n        public TestException(string message)\n            : base(message)\n        {\n        }\n    }\n\n    public class TestBase\n    {\n        static Project _project;\n        static DummyEditorManager _editors;\n\n        static TestBase()\n        {\n            var unoprojfile = AbsoluteDirectoryPath.Parse(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) / \"..\" / \"..\" / \"..\" / \"Outracks.CodeCompletion.UXNinja.TestsCommon\" / \"TestData\" / new FileName(\"Outracks.UXNinja.Tests.Library.unoproj\");\n            var relativeUnoprojFile = unoprojfile.RelativeTo(DirectoryPath.GetCurrentDirectory());\n\n            _editors = new DummyEditorManager();\n            _project = new Project(\"Test\");\n            _project.MutablePackageReferences.Clear();\n            _project.MutableProjectReferences.Clear();\n            _project.MutableProjectReferences.Add(new ProjectReference(new DummySource(), relativeUnoprojFile.NativeRelativePath));\n        }\n\n        public void AssertUX(string code, [CallerMemberName] string path = \"\")\n        {\n            int caret = 0;\n            var assertCodeSnippets = GetAsserts(ref code, ref caret);\n            var filePath = AbsoluteDirectoryPath.Parse(Directory.GetCurrentDirectory()) / new FileName(path);\n\n            var log = new DummyLogger();\n            var context = Context.CreateContext(filePath, code, caret, new DummySourcePackage());\n            var mainPackage = PackageCache.GetPackage(new Log(log.TextWriter), _project);\n            mainPackage.SetCacheDirectory((AbsoluteDirectoryPath.Parse(mainPackage.CacheDirectory) / new DirectoryName(\"UxCompletion\")).NativePath);\n\n            var build = new CodeNinjaBuild(log, _project, _editors, mainPackage, mainPackage.References.ToList(), code, filePath);\n            build.Execute();\n\n            var suggestions = SuggestionParser.GetSuggestions(build.Compiler, context, caret, new DummyReader());\n\n            if (assertCodeSnippets != null)\n            {\n                foreach (var codeSnippet in assertCodeSnippets)\n                    OnAssert(code, codeSnippet, suggestions, log);\n            }\n        }\n\n        IEnumerable<string> GetAsserts(ref string code, ref int caret)\n        {\n            string[] items = null;\n            while (code.Contains('$'))\n            {\n                caret = code.IndexOf('$');\n                int e = code.IndexOf(')', caret);\n\n                string macro = code.Substring(caret + 2, e - caret - 2);\n                code = code.Substring(0, caret) + code.Substring(e + 1, code.Length - e - 1);\n\n                items = macro.Split(',');\n                for (int k = 0; k < items.Length; k++)\n                    items[k] = items[k].Trim();\n            }\n            return items;\n        }\n\n        void OnAssert(string sourceCode, string codeSnippet, IEnumerable<SuggestItem> suggestions, DummyLogger log)\n        {\n            bool testIsInverted = false;\n            if (codeSnippet.Contains('!'))\n            {\n                testIsInverted = true;\n                codeSnippet = codeSnippet.Trim('!');\n            }\n\n            bool found = suggestions.Any(suggestion => suggestion.Text == codeSnippet);\n\n            string expression = string.Format(\"{0} should {2}be among [{1}]\",\n                                              codeSnippet,\n                                              string.Join(\",\", suggestions.Select(x => x.Text)),\n                                              testIsInverted ? \"not \" : \"\");\n\n            bool result = testIsInverted ^ found;\n\n            if (!result)\n            {\n                throw new TestException(expression + \"\\n\\n Compiler log: \" + log.sb.ToString() + \"\\n\\nSource code:\\n\" + sourceCode);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/Tests/StartAttributeName.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Uno.UXNinja.Tests.Tests\n{\n    public class StartAttributeName : TestBase\n    {\n        [Test]\n        [Ignore(\"ux:Path isn't expected attribute for App tag https://github.com/fusetools/Fuse/issues/825\")]\n        public void StartAttributeName01()\n        {\n            AssertUX(\n                @\"\n                <App $(ux:ClearColor, ux:Name, ux:ClassName, !ux:Path)>\n                </App>\n                \"\n            );\n        }\n\n        [Test]\n        public void StartAttributeName02()\n        {\n            AssertUX(\n                @\"\n                <App>\n                    <Panel $(ux:Name, ux:ClassName, Width, Height, !Orientation, !ItemSpacing, !HasChildren)\n                \"\n            );\n        }\n\n        [Test]\n        public void StartAttributeName03()\n        {\n            AssertUX(\n                @\"\n                <App>\n                    <StackPanel $(Orientation, ItemSpacing)\n                </App>\n                \"\n            );\n        }\n\n        [Test]\n        public void StartAttributeName04()\n        {\n            AssertUX(\n                @\"\n                <App>\n                    <Text $(IsMultiline, Content, !Orientation, !ItemSpacing, !ActualSize)\n                </App>\n                \"\n            );\n        }\n\n        [Test]\n        public void StartAttributeName05()\n        {\n            AssertUX(\n                @\"\n                <App xmlns:usp=\"\"Custom.Controls\"\">\n                    <usp:Button $(Text, Clicked)\n                </App>\n                \"\n            );\n        }\n\n\t\t[Test]\n\t\tpublic void StartAttributeName_UXClass0()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel ux:Class='Foo'/>\n\t\t\t\t\t<Foo $(Width,Height)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartAttributeName_UXClass1()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel ux:Class='Foo'>\n\t\t\t\t\t\t<string ux:Property='Message' />\n\t\t\t\t\t</Panel>\n\t\t\t\t\t<Foo $(Width,Height,Message)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartAttributeName_UXClass2()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel ux:Class='Foo'>\n\t\t\t\t\t\t<string ux:Property='Message' />\n\t\t\t\t\t</Panel>\n\t\t\t\t\t<Foo ux:Class='Bar' />\n\t\t\t\t\t<Foo $(Width,Height,Message)\n\t\t\t\t\t<Bar $(Width,Height,Message)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartAttributeName_UXClass3()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel ux:Class='Foo'>\n\t\t\t\t\t\t<string ux:Property='Message' />\n\t\t\t\t\t</Panel>\n\t\t\t\t\t<Panel ux:Class='Bar'>\n\t\t\t\t\t\t<Foo ux:Property='Wut' />\n\t\t\t\t\t</Panel>\n\t\t\t\t\t<Foo $(Width,Height,Message) ux:Name='A' />\n\t\t\t\t\t<Bar $(Width,Height,Wut) />\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/Tests/StartTagName.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Uno.UXNinja.Tests.Tests\n{\n\tpublic class StartTagName : TestBase\n\t{\n\t\t[Test]\n\t\tpublic void Empty()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"$(!App, !Panel, !Text, !Foo)\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName01()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<$(App, Panel, Text, !Foo)\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName02()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<$(Panel, Text, !App)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName03()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel>\n\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t<$(!Text, !Panel)\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Panel>\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName04()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel>\n\t\t\t\t\t\t<$(Panel, Text, !Button)\n\t\t\t\t\t</Panel>\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName05()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App xmlns:usp=\"\"Custom.Controls\"\">\n\t\t\t\t\t<Panel>\n\t\t\t\t\t\t<usp:$(Button, !Text, !Panel)\n\t\t\t\t\t</Panel>\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName06()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<$(Text)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName07()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Fuse.$(Text)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName_UXClass0()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel ux:Class='Foo' />\n\t\t\t\t\t<$(Text, Foo)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void StartTagName_UXClass1()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<Panel ux:Class='Foo'>\n\t\t\t\t\t\t<Text ux:Class='Bar' />\n\t\t\t\t\t</Panel>\n\t\t\t\t\t<$(Text, Foo, Bar)\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName_Namespaces()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<App>\n\t\t\t\t\t<$(Custom) />\n\t\t\t\t\t<Custom.$(Controls,!Text,!Panel) />\n\t\t\t\t\t<Custom.Controls.$(Button,!Text,!Panel) />\n\t\t\t\t</App>\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName_StaticClass()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<$(NotStaticClass,!StaticClass)\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartTagName_CustomNSScope()\n\t\t{\n\t\t\tAssertUX(\n\t\t\t\t@\"\n\t\t\t\t<Custom.Controls.Button xmlns:foo='Fuse'>\n\t\t\t\t\t<foo:$(Text)\n\t\t\t\t\"\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/Tests/ValueSuggestion.cs",
    "content": "﻿using NUnit.Framework;\n\nnamespace Uno.UXNinja.Tests.Tests\n{\n\t//[Ignore(\"This is not yet implemented for our text plugin API.\")]\n    public class ValueSuggestion : TestBase\n    {\n        [Test]\n        public void Binding01()\n        {\n            AssertUX(\n                @\"\n                <App>\n                    <StackPanel>\n                        <Panel ux:Binding=\"\"$(Appearance)\"\"\n                </App>\n                \"\n            );\n        }\n\n        [Test]\n        public void Enum01()\n        {\n            AssertUX(\n                @\"\n                <App>\n                    <StackPanel Orientation=\"\"$(Horizontal, Vertical)\"\"\n                </App>\n                \"\n            );\n        }\n\n        [Test]\n        public void Enum02()\n        {\n            AssertUX(\n                @\"\n                <App>\n                    <StackPanel Orientation=\"\"$(Horizontal, Vertical, !Front)\"\"\n                \"\n            );\n        }\n\n        [Test]\n        public void Bool01()\n        {\n            AssertUX(\n               @\"\n                <App>\n                    <Text IsMultiline=\"\"$(true, false, !null)\n                \"\n           );\n        }\n    }\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.Tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/DummyReader.cs",
    "content": "﻿using Outracks.UnoDevelop.UXNinja;\n\nnamespace Uno.UXNinja.TestsCommon\n{\n    public class DummyReader : ICodeReader\n    {\n        public TokenType PeekTokenReverse()\n        {\n            return (TokenType) 0;\n        }\n\n        public TokenType ReadTokenReverse()\n        {\n            return (TokenType) 0;\n        }\n\n        public TokenType ReadToken()\n        {\n            return (TokenType) 0;\n        }\n\n        public TokenType PeekToken()\n        {\n            return (TokenType) 0;\n        }\n\n        public int Offset { get; set; }\n        public int Length { get; private set; }\n        public string PeekTextReverse(int charCount)\n        {\n            return null;\n        }\n\n        public string PeekText(int charCount)\n        {\n            return null;\n        }\n\n        public string ReadText(int charCount)\n        {\n            return null;\n        }\n\n        public string ReadTextReverse(int charCount)\n        {\n            return null;\n        }\n    }\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/DummySource.cs",
    "content": "﻿namespace Uno.UXNinja.TestsCommon\n{\n    public class DummySource : Source\n    {\n        public DummySource()\n            : base(new DummySourcePackage(), string.Empty)\n        { }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/DummySourcePackage.cs",
    "content": "﻿using Uno.Compiler;\n\nnamespace Uno.UXNinja.TestsCommon\n{\n    public class DummySourcePackage : SourcePackage\n    {\n        public DummySourcePackage() : base(\"DummyPackage\", \"1.0.0\")\n        { }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/Outracks.CodeCompletion.UXNinja.TestsCommon.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{544ABBD9-1326-4184-B026-54EB4C9FAD33}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Uno.UXNinja.TestsCommon</RootNamespace>\n    <AssemblyName>Outracks.CodeCompletion.UXNinja.TestsCommon</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"DummyReader.cs\" />\n    <Compile Include=\"DummySource.cs\" />\n    <Compile Include=\"DummySourcePackage.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.CodeNinja\\Outracks.CodeCompletion.CodeNinja.csproj\">\n      <Project>{5C6C19F4-C5C4-4F8B-BAE4-A92E6C0D62BB}</Project>\n      <Name>Outracks.CodeCompletion.CodeNinja</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Outracks.CodeCompletion.UXNinja\\Outracks.CodeCompletion.UXNinja.csproj\">\n      <Project>{3C19F9AA-9C81-426F-A0EA-B046AAE755EE}</Project>\n      <Name>Outracks.CodeCompletion.UXNinja</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.CodeCompletion.UXNinja.TestsCommon\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/App.uno",
    "content": "using Uno;\nusing Uno.Compiler;\nusing Uno.Collections;\nusing Uno.UX;\n\nnamespace Fuse\n{\n    public abstract class AppBase : Uno.Application\n    {\n        [UXPrimary]\n        /** The @Node.Children of the virtual root @Node of the @App.\n            Note that the virtual root node might be different from the @RootViewport depending\n            on platform. */\n        public abstract IList<Node> Children\n        {\n            get;\n        }\n        \n        [UXContent]\n\t\t/** The @Node.Resources of the virtual root node of the @App.\n\t\t\tNote that the virtual root node might be different from the @RootViewport depending\n\t\t\ton platform */\n\t\tpublic IList<Resource> Resources { get { return new List<Resource>(); } }\n    }\n    \n    \n    [IgnoreMainClass]\n    public abstract class App : AppBase\n    {\n        public override IList<Node> Children { get { return new List<Node>(); } }\n        \n        public static new App Current\n        {\n            get { return Uno.Application.Current as App; }\n        }\n\n        protected virtual void OnDraw() {}\n\n        protected virtual void OnUpdate() {}\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Attributes.uno",
    "content": "using Uno;\n\nnamespace Fuse\n{\n    public class HideAttribute: Attribute {}\n    public class OptionalHideAttribute: Attribute {}\n\n    public class InlineAttribute: Attribute {}\n\n    public class ExtensionAttribute: Attribute {}\n    public class ChildExtensionAttribute: Attribute {}\n\n    public class DefaultInstanceAttribute: Attribute\n    {\n        public string TargetProperty;\n        public string Type;\n        public DefaultInstanceAttribute(string targetProperty, string type)\n        {\n            TargetProperty = targetProperty;\n            Type = type;\n        }\n    }\n\n\n    public class IconAttribute: Attribute\n    {\n        public string Path;\n        public IconAttribute([Filename] string path)\n        {\n            Path = path;\n        }\n    }\n\n    public class PriorityAttribute : Attribute\n    {\n        public int Priority;\n        public PriorityAttribute(int Priority = 0)\n        {\n            this.Priority = Priority;\n        }\n    }\n\n    public class GroupAttribute: Attribute\n    {\n        public string Name;\n        public int Priority;\n        public GroupAttribute(string name, int priority = 0) { Name = name; Priority = priority; }\n    }\n\n    public class HidesAttribute: Attribute\n    {\n        public string TargetProperty;\n        public HidesAttribute(string targetProperty) { TargetProperty = targetProperty; }\n    }\n\n    public class AdvancedAttribute: Attribute {}\n\n    public class SpawnableAttribute : Attribute { }\n\n    public class SpawnsAttribute: Attribute\n    {\n        public string SourceType;\n        public string TargetProperty;\n        public SpawnsAttribute(string sourceType, string targetProperty)\n        {\n            SourceType = sourceType;\n            TargetProperty = targetProperty;\n        }\n    }\n\n    public class TransitionAttribute: Attribute\n    {\n        public string IncomingType;\n        public string TargetType;\n        public string TargetProperty;\n        public TransitionAttribute(string incomingType, string targetType, string targetProperty)\n        {\n            IncomingType = incomingType;\n            TargetType = targetType;\n            TargetProperty = targetProperty;\n        }\n    }\n\n    public class DragDropPriorityAttribute: Attribute {}\n\n    public class DesignerNameAttribute: Attribute\n    {\n        public string Name;\n        public DesignerNameAttribute(string name) { Name = name; }\n    }\n\n    public class ComponentOfAttribute: Attribute\n    {\n        public string EntityClass;\n        public ComponentOfAttribute(string entityClass) { EntityClass = entityClass; }\n    }\n\n    public class DefaultComponentAttribute: Attribute\n    {\n        public string ComponentClass;\n        public DefaultComponentAttribute(string componentClass) { ComponentClass = componentClass; }\n    }\n\n    public class RequiredComponentAttribute: Attribute\n    {\n        public string ComponentClass;\n        public RequiredComponentAttribute(string componentClass) { ComponentClass = componentClass; }\n    }\n\n    public class ColorAttribute : Attribute {}\n    public class ThicknessAttribute: Attribute {}\n\n    public class RangeAttribute : Attribute\n    {\n        public float Min;\n        public float Max;\n        public float Exponent = 1;\n        public RangeAttribute(float min, float max) { Min = min; Max = max; }\n        public RangeAttribute(float min, float max, float exponent) { Min = min; Max = max; Exponent = exponent; }\n    }\n\n    public class IntervalAttribute : Attribute\n    {\n        public float Interval;\n        public IntervalAttribute(float interval) { Interval = interval; }\n    }\n\n    public class RecursionSafeAttribute : Attribute {}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Button.uno",
    "content": "using Fuse;\nusing Uno;\nusing Uno.Platform;\nusing Uno.UX;\nusing Uno.Collections.EnumerableExtensions;\n\nnamespace Custom.Controls\n{\n    public class Button: Panel\n    {\n        [Group(\"Events\")]\n        public event ClickedHandler Clicked;\n\n        string _text;\n        [Group(\"Common\"), DesignerName(\"Text\")]\n        public string Text\n        {\n            get { return _text; }\n            set { _text = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Clicked.uno",
    "content": "using Uno;\n\nnamespace Fuse\n{\n\tpublic delegate void ClickedHandler(object sender, EventArgs args);\n\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Element.uno",
    "content": "using Uno;\nusing Uno.Collections;\n\nnamespace Fuse\n{\n    public abstract class Element : Node\n    {\n        internal float2 _actualSize;\n\n        [Hide]\n        public float2 ActualSize\n        {\n            get { return _actualSize; }\n        }\n\n        float _width;\n        public float Width\n        {\n            get { return _width; }\n            set { _width = value; }\n        }\n\n        float _height;\n        public float Height\n        {\n            get { return _height; }\n            set { _height = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Node.uno",
    "content": "using Uno;\nusing Uno.Collections;\n\nnamespace Fuse\n{\n    public abstract partial class Node\n    {\n        Node _host;\n        public Node ParentNode { get { return _host; } }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Orientation.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Uno.UX;\n\nnamespace Fuse\n{\n    public enum Orientation\n    {\n        Horizontal,\n        Vertical\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Outracks.UXNinja.Tests.Library.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Uno.Collections\",\n    \"Uno.Geometry\"\n  ],\n  \"Includes\": [\n    \"App.uno:SourceFile\",\n    \"Attributes.uno:SourceFile\",\n    \"Button.uno:SourceFile\",\n    \"Clicked.uno:SourceFile\",\n    \"Element.uno:SourceFile\",\n    \"Node.uno:SourceFile\",\n    \"Orientation.uno:SourceFile\",\n    \"Panel.uno:SourceFile\",\n    \"StackPanel.uno:SourceFile\",\n    \"Text.uno:SourceFile\",\n    \"StaticClass.uno:SourceFile\"\n  ]\n}"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Panel.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Uno.UX;\n\nnamespace Fuse\n{\n    public class Panel : Element\n    {\n        IList<Element> _children = null;\n        [UXPrimary]\n        public IList<Element> Children\n        {\n            get { return _children; }\n        }\n\n        Element _appearance;\n        [DesignerName(\"Appearance\"), Group(\"Style\")]\n        public Element Appearance\n        {\n            get { return _appearance; }\n            set { _appearance = value; }\n        }\n\n        [Hide]\n        public bool HasChildren { get { return _children != null && _children.Count > 0; } }    \n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/StackPanel.uno",
    "content": "using Uno;\nusing Uno.UX;\nusing Uno.Collections;\n\nnamespace Fuse\n{\n    public class StackPanel : Panel\n    {\n        Orientation _orientation;\n        [Group(\"Layout\")]\n        public Orientation Orientation\n        {\n            get { return _orientation; }\n            set { _orientation = value; }\n        }\n\n        float _itemSpacing;\n        [Group(\"Layout\")]\n        public float ItemSpacing\n        {\n            get { return _itemSpacing; }\n            set { _itemSpacing = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/StaticClass.uno",
    "content": "using Uno;\nusing Uno.UX;\n\nnamespace Fuse\n{\n\tpublic static class StaticClass\n\t{\n\t}\n\n\tpublic class NotStaticClass\n\t{\n\t}\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/TestData/Text.uno",
    "content": "using Uno;\nusing Uno.UX;\n\nnamespace Fuse\n{\n    public class Text: Element\n    {\n        string _content;\n        [Group(\"Common\"), UXContent]\n        public string Content\n        {\n            get { return _content; }\n            set { _content = value; }\n        }\n\n        bool _isMultiline;\n        public bool IsMultiline\n        {\n            get { return _isMultiline; }\n            set { _isMultiline = value; }\n        }\n    }\n}\n"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/ninja/Outracks.CodeCompletion.UXNinja.TestsCommon/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n</packages>"
  },
  {
    "path": "src/preview/app/Application.uno",
    "content": "using Uno;\nusing Fuse;\n\npublic partial class Application\n{\n\tpublic Application()\n\t{\n\t\tnew ForeignAccelerometer.AccelerometerModule();\n\t\tInitializeUX();\n\t}\n}\n"
  },
  {
    "path": "src/preview/app/Application.ux",
    "content": "<App ux:Class=\"Application\" ux:AutoCtor=\"false\">\n\t<Panel Color=\"BG\">\n\t\t<MainView />\n\t</Panel>\n</App>"
  },
  {
    "path": "src/preview/app/Components/ActivityIndicator.ux",
    "content": "<Panel ux:Class=\"ActivityIndicator\">\n\t<JavaScript>\n\t\tfunction genPoints(samples, randomize){\n\t\t\tvar out = []\n\t\t\tvar rnd = 1.0\n\t\t\tif(randomize)\n\t\t\t\trnd = Math.random() * samples\n\n\t\t\tvar offset = 2/samples\n\t\t\tvar increment = 3.14 * (3 - Math.sqrt(5))\n\n\t\t\tfor(var i = 0; i<samples;i++){\n\t\t\t\tvar y = ((i * offset) - 1) + (offset / 2)\n\t\t\t\tvar r = Math.sqrt(1 - Math.pow(y,2))\n\n\t\t\t\tvar phi = ((i + rnd) % samples) * increment\n\n\t\t\t\tvar x = Math.cos(phi) * r\n\t\t\t\tvar z = Math.sin(phi) * r\n\n\t\t\t\tout.push({pos:[x,y,z], rot:[3.14,3.14,0]})\n\t\t\t}\n\t\t\t\t\n\t\t\treturn out\n\t\t}\n\t\tmodule.exports = {\n\t\t\tpoints : genPoints(48, true)\n\t\t}\n\t</JavaScript>\n\n\t<Circle ux:Class=\"SpinnyDisc\" Color=\"Highlight\" Width=\"20\" Height=\"20\"/>\n\n\t<Viewport Perspective=\"3\" PerspectiveRelativeTo=\"Width\">\n\t\t<Panel>\n\t\t\t<Rotation ux:Name=\"rot\"/>\n\t\t\t<!--WhileVisible>\n\t\t\t\t<Cycle Target=\"rot.DegreesX\" Low=\"0\" High=\"360\" Frequency=\"0.1\" Waveform=\"Sawtooth\"/>\n\t\t\t\t<Cycle Target=\"rot.DegreesY\" Low=\"0\" High=\"360\" Frequency=\"0.12\" Waveform=\"Sawtooth\"/>\n\t\t\t\t<Cycle Target=\"rot.DegreesZ\" Low=\"0\" High=\"360\" Frequency=\"0.14\" Waveform=\"Sawtooth\"/>\n\t\t\t</WhileVisible-->\n\t\t\t<Each Items=\"{points}\">\n\t\t\t\t<SpinnyDisc>\n\t\t\t\t\t<Translation Vector=\"{pos} * 90\"/>\n\t\t\t\t\t<Rotation EulerAngle=\"{rot}\"/>\n\t\t\t\t</SpinnyDisc>\n\t\t\t</Each>\n\t\t</Panel>\n\t</Viewport>\n</Panel>"
  },
  {
    "path": "src/preview/app/Components/BasicButton.ux",
    "content": "<Container ux:Class=\"BasicButton\" Subtree=\"grid\">\n\t<string ux:Property=\"Text\" />\n\t<Rectangle ux:Binding=\"Children\" ux:Name=\"rect\" Height=\"40\" Width=\"168\" Padding=\"0,8\" CornerRadius=\"4\" Color=\"HighlightBG\">\n\t\t<Grid ux:Name=\"grid\" Columns=\"auto,auto\" Alignment=\"Center\" CellSpacing=\"8\">\n\t\t\t<Text Value=\"{Property Text}\" TextAlignment=\"Center\" Alignment=\"Center\" TextColor=\"White\" />\n\t\t</Grid>\n\t\t<Tapped>\n\t\t\t<Change rect.Color=\"Highlight\" Duration=\"0.1\" />\n\t\t</Tapped>\n\t\t<WhilePressed>\n\t\t\t<Change rect.Color=\"Highlight\" DurationBack=\"0.1\" />\n\t\t</WhilePressed>\n\t</Rectangle>\n</Container>"
  },
  {
    "path": "src/preview/app/Components/CancelButton.ux",
    "content": "<Panel ux:Class=\"CancelButton\" Margin=\"0,0,0,24\" HitTestMode=\"LocalBoundsAndChildren\" Alignment=\"Center\" Clicked=\"{onBackButton}\">\n\t<Grid Columns=\"16,auto\" CellSpacing=\"8\">\n\t\t<CrossIcon/>\n\t\t<Text FontSize=\"16\" Color=\"DefaultText\" Value=\"Cancel\" TextAlignment=\"Left\"/>\n\t</Grid>\n</Panel>\n"
  },
  {
    "path": "src/preview/app/Components/ErrorView.ux",
    "content": "<Rectangle ux:Class=\"ErrorView\" Color=\"#DB688240\" CornerRadius=\"4\" Padding=\"16\">\n\t<string ux:Property=\"Message\" />\n\t<Grid Columns=\"20,1*\" CellSpacing=\"16\">\n\t\t<AlertCircle/>\n\t\t<Text Value=\"{Property Message}\" TextWrapping=\"Wrap\" TextColor=\"FocusedText\"/>\n\t</Grid>\n</Rectangle>"
  },
  {
    "path": "src/preview/app/Components/ManualSetupPageIndicator.ux",
    "content": "<Grid Columns=\"8,32,8\" Rows=\"16\" ux:Class=\"ManualSetupPageIndicator\" Alignment=\"BottomCenter\" Margin=\"0,32\" Progress=\"0\">\n\t<float ux:Property=\"Progress\"/>\n\n\t<Circle Height=\"100%\" Color=\"Highlight\"/>\n\n\t<Rectangle LayoutRole=\"Inert\" Alignment=\"Left\" Height=\"1\" Width=\"{Property Progress} * 100%\" Color=\"Highlight\"/>\n\t<Rectangle Alignment=\"Left\" Height=\"1\" Width=\"100%\" Color=\"LightGrey\"/>\n\n\t<Circle ux:Name=\"lastCircle\" Height=\"100%\" StrokeColor=\"LightGrey\" StrokeWidth=\"1\"/>\n\n\t<WhileTrue Value=\"{Property Progress} > 0.9\">\n\t\t<Change lastCircle.StrokeColor=\"0\" Duration=\"0.2\"/>\n\t\t<Change lastCircle.Color=\"Highlight\" Duration=\"0.2\"/>\n\t</WhileTrue>\n</Grid>"
  },
  {
    "path": "src/preview/app/Components/PageContent.ux",
    "content": "<DockPanel ux:Class=\"PageContent\" Margin=\"24, 24, 24, 0\" >\n\t<string ux:Property=\"Title\" />\n\t<string ux:Property=\"SubTitle\" />\n\t<StackPanel Dock=\"Top\">\n\t\t<Text Alignment=\"Left\" Value=\"{ReadProperty Title}\" TextColor=\"HighlightText\" FontSize=\"24\" />\n\t\t<Text Value=\"{ReadProperty SubTitle}\" TextWrapping=\"Wrap\" TextColor=\"DefaultText\" Margin=\"0, 16, 0, 0\" />\n\t</StackPanel>\n</DockPanel>"
  },
  {
    "path": "src/preview/app/Components/SegmentedInput.ux",
    "content": "<StackPanel ux:Class=\"SegmentedInput\" HitTestMode=\"LocalBounds\" ItemSpacing=\"10\">\n    <string ux:Property=\"Label\" />\n    <string ux:Property=\"Code\" />\n\n    <JavaScript>\n        var Observable = require(\"FuseJS/Observable\");\n\n        var editMode = Observable(false);\n        function enterEditMode() {\n            editMode.value = true;\n        };\n        function exitEditMode() {\n            editMode.value = false;\n        };\n\n        var codeLength = 5;\n        var code = this.Code;\n        var splitCode = code.map(function(item) {\n            var entered = item.split(\"\");\n            while (entered.length < codeLength) {\n                entered.push(\"\");\n            }\n            return entered;\n        }).expand();\n\n        var symbols = splitCode.map(function(item, index) {\n            var obj = {symbol: item.toUpperCase(), selected: false};\n            if (index == code.value.length) {\n                obj.selected = true;\n            }\n            return obj;\n        });\n\n        module.exports = {\n            code: code,\n            codeLength: codeLength,\n            symbols: symbols,\n            editMode: editMode,\n            enterEditMode: enterEditMode,\n            exitEditMode: exitEditMode\n        };\n    </JavaScript>\n\n    <Rectangle ux:Class=\"SymbolBox\">\n        <string ux:Property=\"Symbol\" />\n        <WhileTrue Value=\"{editMode}\">\n            <Change backgroundRect.Margin=\"8,0\" Delay=\"0.2\" DelayBack=\"0\" />\n            <Change backgroundRect.CornerRadius=\"1\" Delay=\"0.2\" DelayBack=\"0\" />\n            <Change backgroundRect.Opacity=\"1\" Delay=\"0.2\" DelayBack=\"0\" />\n            <Change label.Opacity=\"1\" Delay=\"0.2\" Duration=\"0.42\" Easing=\"ExponentialOut\" EasingBack=\"ExponentialIn\" />\n        </WhileTrue>\n\n        <WhileTrue Value=\"{selected} && {editMode}\">\n            <Change backgroundRect.Color=\"Highlight\" Delay=\"0.2\" Duration=\"0.42\" Easing=\"ExponentialOut\" EasingBack=\"ExponentialIn\" />\n        </WhileTrue>\n\n        <Text ux:Name=\"label\" Alignment=\"Center\" Value=\"{ReadProperty Symbol}\" FontSize=\"32\" Color=\"Highlight\" Opacity=\"0\" />\n        <Rectangle ux:Name=\"backgroundRect\" Color=\"#979797\" Height=\"1\" Alignment=\"Bottom\" Opacity=\"0\">\n            <LayoutAnimation>\n                <Move X=\"1\" Y=\"1\" RelativeTo=\"PositionChange\" Duration=\"0.42\" Easing=\"ExponentialOut\" EasingBack=\"ExponentialIn\" />\n                <Resize X=\"1\" Y=\"1\" RelativeTo=\"SizeChange\" Duration=\"0.42\" Easing=\"ExponentialOut\" EasingBack=\"ExponentialIn\" />\n            </LayoutAnimation>\n        </Rectangle>\n    </Rectangle>\n\n    <Clicked>\n        <GiveFocus Target=\"codeInput\" />\n    </Clicked>\n\n    <TextInput ux:Name=\"codeInput\" AutoCorrectHint=\"Disabled\" Value=\"{code}\" MaxLength=\"{codeLength}\"\n        Layer=\"Background\" Visibility=\"Hidden\" HitTestMode=\"None\"\n        Focus.Gained=\"{enterEditMode}\" Focus.Lost=\"{exitEditMode}\"/>\n\n    <Panel Height=\"24\">\n        <Text Value=\"{ReadProperty Label}\" FontSize=\"20\" Color=\"HintGrey\" Alignment=\"TopLeft\" TransformOrigin=\"TopLeft\" ux:Name=\"descriptor\">\n            <Translation ux:Name=\"labelTrans\" Y=\"2.2\" RelativeTo=\"ParentSize\" />\n            <Translation ux:Name=\"labelTransX\" X=\"0.05\" RelativeTo=\"ParentSize\" />\n            <WhileTrue Value=\"{editMode}\">\n                <Change labelTrans.Y=\"0\" Delay=\"0.2\" Duration=\"0.42\" Easing=\"ExponentialOut\" EasingBack=\"ExponentialIn\" />\n                <Change labelTransX.X=\"0\" Delay=\"0.2\" Duration=\"0.42\" Easing=\"ExponentialOut\" EasingBack=\"ExponentialIn\" />\n                <Change descriptor.Color=\"FocusedText\" Delay=\"0.2\" Duration=\"0.42\" Easing=\"ExponentialOut\" EasingBack=\"ExponentialIn\" />\n                <Change boxStroke.Color=\"#97979700\" Delay=\"0.2\" Duration=\"0.2\" DurationBack=\"0.2\"  />\n            </WhileTrue>\n        </Text>\n    </Panel>\n\n    <Rectangle  Height=\"60\" Padding=\"10,0\" CornerRadius=\"4\">\n        <Stroke Width=\"1\" Color=\"HintGrey\" ux:Name=\"boxStroke\"/>\n        <Grid ColumnCount=\"{codeLength}\" Height=\"40\">\n            <Each Items=\"{symbols}\">\n                <SymbolBox Symbol=\"{symbol}\" />\n            </Each>\n        </Grid>\n    </Rectangle>\n</StackPanel>\n"
  },
  {
    "path": "src/preview/app/ForeignAccelerometer/Accelerometer.uno",
    "content": "using Uno;\nusing Uno.Compiler.ExportTargetInterop;\n\nnamespace ForeignAccelerometer\n{\n\tpublic class AccelerometerUpdatedArgs : EventArgs\n\t{\n\t\tpublic float3 Value { get; private set; }\n\n\t\tpublic AccelerometerUpdatedArgs(float3 value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\t}\n\n\tpublic delegate void AccelerometerUpdated(object sender, AccelerometerUpdatedArgs args);\n\t\n\tpublic delegate void AccelerometerUpdatedInternal(float x, float y, float z);\n\n\tpublic class Accelerometer\n\t{\n\t\tpublic event AccelerometerUpdated Updated;\n\n\t\textern(Android) Accelerometer_Android _androidImpl;\n\t\textern(iOS) Accelerometer_iOS _iosImpl;\n\n\t\tpublic Accelerometer()\n\t\t{\n\t\t\tif defined(Android)\n\t\t\t{\n\t\t\t\t_androidImpl = new Accelerometer_Android(OnUpdate);\n\t\t\t}\n\t\t\telse if defined(iOS)\n\t\t\t{\n\t\t\t\t_iosImpl = new Accelerometer_iOS(OnUpdate);\n\t\t\t}\n\t\t}\n\n\t\tvoid OnUpdate(float x, float y, float z)\n\t\t{\n\t\t\tif(Updated != null)\n\t\t\t{\n\t\t\t\tvar args = new AccelerometerUpdatedArgs(float3(x, y, z));\n\t\t\t\tUpdated(this, args);\n\t\t\t}\n\t\t}\n\n\t\textern(Android)\n\t\tpublic void Start() { _androidImpl.Start(); }\n\t\textern(Android)\n\t\tpublic void Stop() { _androidImpl.Stop(); }\n\n\t\textern(iOS)\n\t\tpublic void Start() { _iosImpl.Start(); }\n\t\textern(iOS)\n\t\tpublic void Stop() { _iosImpl.Stop(); }\n\n\t\textern(!MOBILE)\n\t\tpublic void Start() {}\n\t\textern(!MOBILE)\n\t\tpublic void Stop() {}\n\t}\n}\n"
  },
  {
    "path": "src/preview/app/ForeignAccelerometer/AccelerometerImpl.hh",
    "content": "#import <Foundation/Foundation.h>\n#import <CoreMotion/CoreMotion.h>\n\ntypedef void (^AccelerometerCallback)(float, float, float);\n\n@interface AccelerometerImpl : NSObject\n\n-(id) initWithCallback: (AccelerometerCallback) callback;\n-(void) start;\n-(void) stop;\n\n@property (nonatomic, copy) AccelerometerCallback callback;\n@property (strong) NSOperationQueue *operationQueue;\n@property (strong) CMMotionManager *motionManager;\n\n@end"
  },
  {
    "path": "src/preview/app/ForeignAccelerometer/AccelerometerImpl.java",
    "content": "package com.samples;\n\nimport android.hardware.*;\nimport android.content.Context;\nimport com.foreign.ForeignAccelerometer.AccelerometerUpdatedInternal_float_float_float;\nimport com.fuse.Activity;\n\npublic class AccelerometerImpl\n{\n\tSensorEventListener _listener;\n\tSensorManager _manager;\n\tSensor _sensor;\n\n\tpublic AccelerometerImpl(final AccelerometerUpdatedInternal_float_float_float handler)\n\t{\n\t\t_listener = new SensorEventListener() {\n\t\t\t@Override\n\t\t\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\t\tfloat[] values = event.values;\n\t\t\t\thandler.run(values[0], values[1], values[2]);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onAccuracyChanged(android.hardware.Sensor s, int a) {}\n\t\t};\n\n\t\tContext context = (Context)Activity.getRootActivity();\n\t\t_manager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);\n\t\t_sensor = _manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);\n\t}\n\n\tpublic void start() {\n\t\t_manager.registerListener(_listener, _sensor, SensorManager.SENSOR_DELAY_GAME);\n\t}\n\n\tpublic void stop() {\n\t\t_manager.unregisterListener(_listener);\n\t}\n}"
  },
  {
    "path": "src/preview/app/ForeignAccelerometer/AccelerometerImpl.mm",
    "content": "#import \"AccelerometerImpl.hh\"\n#import <Uno/Memory.h>\n\n@implementation AccelerometerImpl\n\n-(id) initWithCallback: (AccelerometerCallback) callback\n{\n\tself = [super init];\n\n\tif(self != nil)\n\t{\n\t\tself.callback = callback;\n\t\tself.operationQueue = [[NSOperationQueue alloc] init];\n\t\tself.motionManager = [[CMMotionManager alloc] init];\n\t}\n\n\treturn self;\n}\n\n-(void) start\n{\n\t[self.motionManager startAccelerometerUpdatesToQueue: self.operationQueue\n\t\twithHandler: ^void (CMAccelerometerData *data, NSError *error) {\n\t\t\tuAutoReleasePool pool;\n\n\t\t\tif(error != nil) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tCMAcceleration accel = [data acceleration];\n\n\t\t\tself.callback((float)accel.x, (float)accel.y, (float)accel.z);\n\t\t}];\n}\n\n-(void) stop\n{\n\t[self.motionManager stopAccelerometerUpdates];\n}\n\n@end\n"
  },
  {
    "path": "src/preview/app/ForeignAccelerometer/AccelerometerModule.uno",
    "content": "using Uno;\nusing Uno.UX;\nusing Fuse.Scripting;\nusing Fuse;\n\nnamespace ForeignAccelerometer\n{\n\t[UXGlobalModule]\n\tpublic class AccelerometerModule : NativeEventEmitterModule\n\t{\n\t\tstatic readonly AccelerometerModule _instance;\n\n\t\treadonly Accelerometer _accelerometer;\n\n\t\tpublic AccelerometerModule() : base(false, \"update\")\n\t\t{\n\t\t\tif(_instance != null) return;\n\t\t\tResource.SetGlobalKey(_instance = this, \"Accelerometer\");\n\t\t\t_accelerometer = new Accelerometer();\n\n\t\t\tAddMember(new NativeFunction(\"start\", (NativeCallback)_start));\n\t\t\tAddMember(new NativeFunction(\"stop\", (NativeCallback)_stop));\n\t\t}\n\n\t\tvoid OnUpdated(object sender, AccelerometerUpdatedArgs args)\n\t\t{\n\t\t\tvar v = args.Value;\n\t\t\tEmit(\"update\", Time.FrameTime, v.X, v.Y, v.Z);\n\t\t}\n\n\t\tobject _start(Context c, object[] args)\n\t\t{\n\t\t\t_accelerometer.Updated += OnUpdated;\n\t\t\t_accelerometer.Start();\n\t\t\treturn null;\n\t\t}\n\n\t\tobject _stop(Context c, object[] args)\n\t\t{\n\t\t\t_accelerometer.Stop();\n\t\t\t_accelerometer.Updated -= OnUpdated;\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "src/preview/app/ForeignAccelerometer/Accelerometer_Android.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Uno.Compiler.ExportTargetInterop;\n\n\nnamespace ForeignAccelerometer\n{\n\textern(Android)\n\tinternal class Accelerometer_Android\t\n\t{\n\t\textern(Android) Java.Object _impl;\n\n\t\tpublic Accelerometer_Android(AccelerometerUpdatedInternal updateDelegate)\n\t\t{\n\t\t\tInit(updateDelegate);\n\t\t}\n\n\t\t[Foreign(Language.Java)]\n\t\tprotected extern(Android) void Init(AccelerometerUpdatedInternal updateDelegate)\n\t\t@{\n\t\t\tcom.samples.AccelerometerImpl impl = new com.samples.AccelerometerImpl(updateDelegate);\n\t\t\t@{Accelerometer_Android:Of(_this)._impl:Set(impl)};\n\t\t@}\n\n\t\t[Foreign(Language.Java)]\n\t\tpublic extern(Android) void Start()\n\t\t@{\n\t\t\tcom.samples.AccelerometerImpl impl = (com.samples.AccelerometerImpl) @{Accelerometer_Android:Of(_this)._impl:Get()};\n\t\t\timpl.start();\n\t\t@}\n\n\t\t[Foreign(Language.Java)]\n\t\tpublic extern(Android) void Stop()\n\t\t@{\n\t\t\tcom.samples.AccelerometerImpl impl = (com.samples.AccelerometerImpl) @{Accelerometer_Android:Of(_this)._impl:Get()};\n\t\t\timpl.stop();\n\t\t@}\n\t}\n}\n\n"
  },
  {
    "path": "src/preview/app/ForeignAccelerometer/Accelerometer_iOS.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Uno.Compiler.ExportTargetInterop;\n\nnamespace ForeignAccelerometer\n{\n\t[Require(\"Source.Include\", \"AccelerometerImpl.hh\")]\n\textern(iOS)\n\tinternal class Accelerometer_iOS\n\t{\n\t\textern(iOS) ObjC.Object _impl;\n\n\t\tpublic Accelerometer_iOS(AccelerometerUpdatedInternal updateDelegate)\n\t\t{\n\t\t\tInit(updateDelegate);\n\t\t}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tprotected extern(iOS) void Init(AccelerometerUpdatedInternal updateDelegate)\n\t\t@{\n\t\t\tAccelerometerImpl *impl = [[AccelerometerImpl alloc] initWithCallback: ^(float x, float y, float z) {\n\t\t\t\t// Normalize acceleration\n\t\t\t\tx *= -9.81f;\n\t\t\t\ty *= -9.81f;\n\t\t\t\tz *= -9.81f;\n\n\t\t\t\tupdateDelegate(x, y, z);\n\t\t\t}];\n\t\t\t@{Accelerometer_iOS:Of(_this)._impl:Set(impl)};\n\t\t@}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic extern(iOS) void Start()\n\t\t@{\n\t\t\tAccelerometerImpl *impl = (AccelerometerImpl *) @{Accelerometer_iOS:Of(_this)._impl:Get()};\n\t\t\t[impl start];\n\t\t@}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic extern(iOS) void Stop()\n\t\t@{\n\t\t\tAccelerometerImpl *impl = (AccelerometerImpl *) @{Accelerometer_iOS:Of(_this)._impl:Get()};\n\t\t\t[impl stop];\n\t\t@}\n\t}\n}\n"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/BundleManager.uno",
    "content": "using Uno.IO;\nusing Uno.Collections;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Fuse.Simulator\n{\n\tclass BundleManager\n\t{\n\t\treadonly List<BundleFile> _defaultFiles;\n\n\t\tpublic BundleManager()\n\t\t{\n\t\t\t_defaultFiles = new List<BundleFile>();\n\t\t\t_defaultFiles.AddRange(GetBundle().Files);\n\t\t\tResetBundle(GetBundle().ToString());\n\t\t}\n\n\t\tpublic Bundle GetBundle()\n\t\t{\n\t\t\treturn Bundle.Get(\"FusePreview\");\n\t\t}\n\n\t\tpublic void ResetBundle(string bundleName)\n\t\t{\n\t\t\tOutracks.Simulator.Runtime.Bundle.Initialize(bundleName);\n\t\t\t// TODO: We need to be able to delete stuff from a bundle...\n\t\t}\n\n\t\tpublic void CreateCopyOfBundleTo(Bundle bundle, string relativePath, BytecodeCache bc)\n\t\t{\n\t\t\t// TODO: Zip files instead of just saving them.\n\t\t\tvar dataDir = GetDataDir();\n\t\t\tvar bundlePath = Path.Combine(dataDir, relativePath, \"bundle\");\n\n\t\t\tvar byteCodeDir = Path.Combine(dataDir, relativePath, \"bytecode\");\n\t\t\tCreateDirectoryRecursive(byteCodeDir);\n\t\t\tusing(var writer = new System.IO.BinaryWriter(File.Open(Path.Combine(byteCodeDir, \"bc\"), FileMode.Create)))\n\t\t\t\tbc.WriteDataTo(writer);\n\n\t\t\tvar files = bundle.Files.Except(_defaultFiles);\n\t\t\tforeach(var file in files)\n\t\t\t{\n\t\t\t\tvar basePath = Path.Combine(bundlePath, file.DirectoryName);\n\t\t\t\tif(file.DirectoryName != null)\n\t\t\t\t\tCreateDirectoryRecursive(basePath);\n\n\t\t\t\tdebug_log(\"Creating file: \" + Path.Combine(basePath, file.Name));\n\t\t\t\tFile.WriteAllBytes(Path.Combine(basePath, file.Name), file.ReadAllBytes());\n\t\t\t}\n\t\t}\n\n\t\tpublic BytecodeCache UpdateBundleFrom(Bundle bundle, string relativePath)\n\t\t{\n\t\t\tResetBundle(bundle.ToString());\n\t\t\tvar dataDir = GetDataDir();\n\t\t\tvar bundlePath = Path.Combine(dataDir, relativePath, \"bundle\");\n\t\t\tUpdateBundleFromRecursive(bundle, bundlePath, \"\");\n\n\t\t\tvar byteCodeDir = Path.Combine(dataDir, relativePath, \"bytecode\");\n\t\t\tusing(var reader = new System.IO.BinaryReader(File.OpenRead(Path.Combine(byteCodeDir, \"bc\"))))\n\t\t\t\treturn BytecodeCache.ReadDataFrom(reader);\n\t\t}\n\n\t\tpublic bool HasBundle(string relativePath)\n\t\t{\n\t\t\tvar dataDir = GetDataDir();\n\t\t\treturn Directory.Exists(Path.Combine(dataDir, relativePath));\n\t\t}\n\n\t\tvoid UpdateBundleFromRecursive(Bundle bundle, string path, string relPath)\n\t\t{\n\t\t\tforeach(var file in Directory.EnumerateFiles(path)) \n\t\t\t{\n\t\t\t\tvar sourcePath = Path.Combine(relPath, Path.GetFileName(file)).ToUnixPath();\n\t\t\t\tdebug_log(\"Loading \" + sourcePath);\n\t\t\t\tOutracks.Simulator.Runtime.Bundle.AddOrUpdateFile(sourcePath, File.ReadAllBytes(file));\n\t\t\t}\n\n\t\t\tforeach(var dir in Directory.EnumerateDirectories(path)) \n\t\t\t{\n\t\t\t\tvar dirName = dir.Split(new char[] { Path.DirectorySeparatorChar }).Last();\n\t\t\t\tUpdateBundleFromRecursive(bundle, Path.Combine(path, dirName), Path.Combine(relPath, dirName));\n\t\t\t}\n\t\t}\n\n\t\tvoid CreateDirectoryRecursive(string path)\n\t\t{\n\t\t\tif(Directory.Exists(path))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tCreateDirectoryRecursive(Path.GetDirectoryName(path));\n\t\t\tDirectory.CreateDirectory(path);\n\t\t}\n\n\t\tpublic static string GetDataDir()\n\t\t{\n\t\t\tvar dataDir = Directory.GetUserDirectory(UserDirectory.Data);\n\t\t\tif defined(DOTNET)\n\t\t\t{\n\t\t\t\tdataDir = Path.Combine(dataDir, \".fuse\");\n\t\t\t}\n\t\t\treturn dataDir;\n\t\t}\n\t}\n\n\tstatic class BundleManagerExtensions\n\t{\n\t\tpublic static IEnumerable<T> Except<T>(this IEnumerable<T> first, IEnumerable<T> second)\n\t\t{\n\t\t\tList<T> result = new List<T>();\n\t\t\tforeach(var source in first)\n\t\t\t{\n\t\t\t\tif(!second.Contains(source))\n\t\t\t\t\tresult.Add(source);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static string ToUnixPath(this string str)\n\t\t{\n\t\t\treturn str.Replace('\\\\', '/');\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/DeviceInfo.uno",
    "content": "using System;\nusing Uno;\nusing Uno.Compiler.ExportTargetInterop;\nusing Uno.IO;\nusing Uno.Net;\nusing Uno.Collections;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Fuse.Controls;\nusing Fuse.Elements;\n\nnamespace Fuse.Simulator\n{\t\n\t[ForeignInclude(Language.Java, \"android.os.Build\")]\n\t[ForeignInclude(Language.ObjC, \"UIKit/UIKit.h\")]\n\tpublic extern(Android || iOS) static class DeviceInfo\n\t{\n\t\tpublic static string Name { get { return GetName(); }}\n\n\t\tpublic static string GUID { get { return GetGUID(); }}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic static extern(iOS) string GetName()\n\t\t@{\n\t\t\treturn [[UIDevice currentDevice] name];\n\t\t@}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic static extern(iOS) string GetGUID()\n\t\t@{\n\t\t\treturn [[[UIDevice currentDevice] identifierForVendor] UUIDString];\n\t\t@}\n\n\t\t[Foreign(Language.Java)]\n\t\tpublic static extern(Android) string GetName()\n\t\t@{\n\t\t\treturn Build.MODEL;\n\t\t@}\n\t\t\n\t\t[Foreign(Language.Java)]\n\t\tpublic static extern(Android) string GetGUID()\n\t\t@{\n\t\t\treturn Build.SERIAL;\n\t\t@}\n\t}\n\n\t[DotNetType(\"System.Guid\")]\n\textern(DotNet) public struct Guid\n\t{\n\t\tprivate extern int _foo;\n\t\tpublic static extern Guid NewGuid();\n\t\tpublic extern override string ToString();\n\t}\n\t\n\tpublic extern(DotNet) static class DeviceInfo\n\t{\n\t\t/******************************** NOTE *****************************************\n\t\t * Before changing the value of 'Name' make sure to find all references to the string 'Viewport',\n\t\t * since there are code out there depending on that specific string!\n\t\t *******************************************************************************/\n\t\tpublic static readonly string Name = \"Viewport\";\n\t\tpublic static readonly string GUID;\n\n\t\tstatic DeviceInfo()\n\t\t{\n\t\t\tGUID = Guid.NewGuid().ToString();\n\t\t}\t\t\n\t}\n\n\tpublic extern(!(DotNet || Android || iOS)) static class DeviceInfo\n\t{\n\t\tpublic static readonly string Name = \"\";\n\t\tpublic static readonly string GUID = \"00000000-0000-0000-0000-000000000000\";\n\t}\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/DiagnosticsManager.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Protocol;\nusing Uno.Diagnostics;\nusing Outracks.Simulator;\n\nnamespace Fuse.Simulator\n{\n\tclass DiagnosticsManager : IDisposable\n\t{\n\t\treadonly ISimulatorClient _client;\n\t\treadonly object _mutex = new object();\n\t\tDictionary<Fuse.Diagnostic, Outracks.Simulator.Protocol.Diagnostic> _activeDiagnostics = new Dictionary<Fuse.Diagnostic, Outracks.Simulator.Protocol.Diagnostic>();\n\n\t\tpublic event Action<Fuse.Diagnostic> DiagnosticReported;\n\t\tpublic event Action<Fuse.Diagnostic> DiagnosticDismissed;\n\n\t\tpublic DiagnosticsManager(ISimulatorClient client)\n\t\t{\n\t\t\t_client = client;\n\t\t\tFuse.Diagnostics.DiagnosticReported += OnDiagnosticReported;\n\t\t\tFuse.Diagnostics.DiagnosticDismissed += OnDiagnosticDismissed;\n\t\t\tLog.SetHandler(SendDebugLog);\n\t\t}\n\n\t\tvoid OnDiagnosticReported(Fuse.Diagnostic d)\n\t\t{\n\t\t\tlock(_mutex)\n\t\t\t{\n\t\t\t\tUpdateManager.PostAction(Closure.Apply<Fuse.Diagnostic>(FireDiagnosticReported, d));\n\t\t\t\tvar diag = new Outracks.Simulator.Protocol.Diagnostic(DeviceInfo.GUID, DeviceInfo.Name, d.Message, d.ToString(), d.FilePath, d.LineNumber, 0);\n\t\t\t\t_client.Send(diag);\n\t\t\t\t_activeDiagnostics.Add(d, diag);\n\t\t\t}\n\t\t}\n\n\t\tvoid FireDiagnosticReported(Fuse.Diagnostic d)\n\t\t{\n\t\t\tif(DiagnosticReported != null)\n\t\t\t\tDiagnosticReported(d);\n\t\t}\n\n\t\tvoid OnDiagnosticDismissed(Fuse.Diagnostic d)\n\t\t{\n\t\t\tlock(_mutex)\n\t\t\t{\n\t\t\t\tUpdateManager.PostAction(Closure.Apply<Fuse.Diagnostic>(FireDiagnosticDismissed, d));\n\t\t\t\tOutracks.Simulator.Protocol.Diagnostic diag;\n\t\t\t\tif (_activeDiagnostics.TryGetValue(d, out diag))\n\t\t\t\t{\n\t\t\t\t\t_client.Send(new DismissDiagnostic(DeviceInfo.GUID, DeviceInfo.Name, diag.DiagnosticId));\n\t\t\t\t\t_activeDiagnostics.Remove(d);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid FireDiagnosticDismissed(Fuse.Diagnostic d)\n\t\t{\n\t\t\tif(DiagnosticDismissed != null)\n\t\t\t\tDiagnosticDismissed(d);\n\t\t}\n\n\t\tvoid DismissAllActiveDiagnostics()\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t{\n\t\t\t\tforeach (var k in _activeDiagnostics)\n\t\t\t\t{\n\t\t\t\t\t_client.Send(new DismissDiagnostic(DeviceInfo.GUID, DeviceInfo.Name, k.Value.DiagnosticId));\n\t\t\t\t}\n\t\t\t\t_activeDiagnostics.Clear();\n\t\t\t}\n\t\t}\n\n\t\tvoid SendDebugLog(LogLevel level, string message)\n\t\t{\n\t\t\t_client.Send(new DebugLog(DeviceInfo.GUID, DeviceInfo.Name, message));\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tFuse.Diagnostics.DiagnosticReported -= OnDiagnosticReported;\n\t\t\tFuse.Diagnostics.DiagnosticDismissed -= OnDiagnosticDismissed;\n\t\t\tLog.SetHandler(null);\n\t\t\tDismissAllActiveDiagnostics();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/Fuse.Simulator.unoproj",
    "content": "{\n  \"RootNamespace\":\"Fuse.Simulator\",\n  \"Title\": \"Fuse Simulator\",\n  \"Version\": \"1.0.0\",\n  \"VersionCode\": 1,\n  \"Description\": \"Simulator for Fuse projects\",\n  \"Publisher\": \"Build & Run\",\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\",\n    \"Uno.Net.Sockets\",\n    \"Fuse.Preview.Core\",\n    \"Outracks.Simulator\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/Logger.uno",
    "content": "namespace Fuse.Simulator\n{\n\tstatic class Logger\n\t{\n\t\tpublic static void Info(string message)\n\t\t{\n\t\t\tif defined(!RELEASE)\n\t\t\t\tdebug_log(message);\n\t\t}\n\n\t\tpublic static void Error(string message)\n\t\t{\n\t\t\tif defined(!RELEASE)\n\t\t\t\tdebug_log(message);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/RecentProjects.uno",
    "content": "using Uno.IO;\nusing Uno.Collections;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Protocol;\nusing Uno;\n\nnamespace Fuse.Simulator\n{\n\tclass BytecodeCache\n\t{\n\t\tpublic readonly ProjectBytecode Bytecode;\n\t\tpublic readonly BytecodeUpdated []BytecodeUpdates;\n\n\t\tpublic BytecodeCache(ProjectBytecode bytecode, BytecodeUpdated []bytecodeUpdates)\n\t\t{\n\t\t\tBytecode = bytecode;\n\t\t\tBytecodeUpdates = bytecodeUpdates;\n\t\t}\n\n\t\tpublic void WriteDataTo(System.IO.BinaryWriter writer)\n\t\t{\n\t\t\tBytecode.WriteDataTo(writer);\n\t\t\twriter.Write(BytecodeUpdates.Length);\n\t\t\tfor(var i = 0;i < BytecodeUpdates.Length;++i)\n\t\t\t{\n\t\t\t\tBytecodeUpdates[i].WriteDataTo(writer);\n\t\t\t}\n\t\t}\n\n\t\tpublic static BytecodeCache ReadDataFrom(System.IO.BinaryReader reader)\n\t\t{\n\t\t\tvar bytecode = ProjectBytecode.ReadDataFrom(reader);\n\t\t\tvar length = reader.ReadInt32();\n\t\t\tvar updates = new BytecodeUpdated[length];\n\t\t\tfor(var i = 0;i < length;++i)\n\t\t\t{\n\t\t\t\tupdates[i] = BytecodeUpdated.ReadDataFrom(reader);\n\t\t\t}\n\t\t\treturn new BytecodeCache(bytecode, updates);\n\t\t}\n\t}\n\n\tclass Project\n\t{\n\t\tpublic readonly int Identifier;\n\t\tpublic readonly string Name;\n\t\tpublic readonly string CachePath;\n\t\t\n\t\tpublic Project(int identifier, string name, string cachePath)\n\t\t{\n\t\t\tIdentifier = identifier;\n\t\t\tName = name;\n\t\t\tCachePath = cachePath;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Project: { Identifier: \" + Identifier + \", Name: \" + Name + \", CachePath: \" + CachePath + \" }\";\n\t\t}\n\t}\n\n\tclass RecentProjects\n\t{\n\t\treadonly string _configPath;\n\t\treadonly Dictionary<int, Project> _recentProjects = new Dictionary<int, Project>();\n\t\treadonly BundleManager _bundleManager;\n\n\t\tpublic IEnumerable<Project> Projects\n\t\t{\n\t\t\tget { return _recentProjects.Values; }\n\t\t}\n\n\t\tpublic event Action<IEnumerable<Project>> RecentProjectsChanged;\n\n\t\tpublic RecentProjects(BundleManager bundleManager)\n\t\t{\n\t\t\t_bundleManager = bundleManager;\n\t\t\t_configPath = Path.Combine(BundleManager.GetDataDir(), \"recentProjects\");\n\t\t\tTryLoadRecentList(_configPath);\n\t\t}\n\n\t\tpublic Project AddProject(string name)\n\t\t{\n\t\t\tvar identifier = NextIdentifier();\n\t\t\tvar cachePath = identifier.ToString();\n\t\t\tvar project = new Project(identifier, name, cachePath);\n\t\t\t_recentProjects[identifier] = project;\n\t\t\tSaveRecentList(_configPath);\n\t\t\tOnRecentProjectsChanged();\n\t\t\treturn project;\n\t\t}\n\n\t\tvoid SaveRecentList(string configPath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar stream = File.Open(configPath, FileMode.Create);\n\t\t\t\tusing(var writer = new StreamWriter(stream))\n\t\t\t\t{\n\t\t\t\t\twriter.WriteLine(Projects.Count());\n\t\t\t\t\tforeach(var project in Projects)\n\t\t\t\t\t{\n\t\t\t\t\t\twriter.WriteLine(project.Identifier);\n\t\t\t\t\t\twriter.WriteLine(project.Name);\n\t\t\t\t\t\twriter.WriteLine(project.CachePath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tLogger.Error(\"Failed to save recent projects: + \" + e.ToString());\n\t\t\t}\n\t\t}\n\n\t\tvoid TryLoadRecentList(string configPath)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar stream = File.OpenRead(configPath);\n\t\t\t\tusing(var reader = new StreamReader(stream))\n\t\t\t\t{\n\t\t\t\t\tint length = int.Parse(reader.ReadLine());\n\t\t\t\t\tfor(var i = 0;i < length;++i)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar project = new Project(int.Parse(reader.ReadLine()), reader.ReadLine(), reader.ReadLine());\n\t\t\t\t\t\t_recentProjects[project.Identifier] = project;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tLogger.Error(\"Failed to load recent projects: + \" + e.ToString());\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsCached(Project project)\n\t\t{\n\t\t\treturn _bundleManager.HasBundle(project.CachePath);\n\t\t}\n\n\t\tpublic void UpdateCache(Project project, BytecodeCache bc)\n\t\t{\n\t\t\tOnRecentProjectsChanged();\n\t\t\t_bundleManager.CreateCopyOfBundleTo(_bundleManager.GetBundle(), project.CachePath, bc);\n\t\t}\n\n\t\tpublic BytecodeCache GetCache(Project project)\n\t\t{\n\t\t\treturn _bundleManager.UpdateBundleFrom(_bundleManager.GetBundle(), project.CachePath);\n\t\t}\n\n\t\tpublic Project GetProject(int identifier)\n\t\t{\n\t\t\treturn _recentProjects[identifier];\n\t\t}\n\n\t\tvoid OnRecentProjectsChanged()\n\t\t{\n\t\t\tif(RecentProjectsChanged != null)\n\t\t\t\tRecentProjectsChanged(Projects);\n\t\t}\n\n\t\tpublic int NextIdentifier()\n\t\t{\n\t\t\tint id = 0;\n\t\t\tforeach(var key in _recentProjects.Keys)\n\t\t\t{\n\t\t\t\tid = Math.Max(id, key);\n\t\t\t}\n\t\t\treturn ++id;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/ScreenSettings.uno",
    "content": "using Uno.Compiler.ExportTargetInterop;\n\nnamespace Fuse.Simulator\n{\n\textern(!MOBILE) static class ScreenIdle\n\t{\n\t\tpublic static void Enable() {}\n\t\tpublic static void Disable() {}\n\t}\n\n\textern(Android) static class ScreenIdle\n\t{\n\t\t[Foreign(Language.Java)]\n\t\tpublic static void Enable()\n\t\t@{\n\t\t\tcom.fuse.Activity.getRootActivity().getWindow().clearFlags(\n\t\t\t\tandroid.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n\t\t@}\n\n\t\t[Foreign(Language.Java)]\n\t\tpublic static void Disable()\n\t\t@{\n\t\t\tcom.fuse.Activity.getRootActivity().getWindow().addFlags(\n\t\t\t\tandroid.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n\t\t@}\n\t}\n\n\t[ForeignInclude(Language.ObjC, \"UIKit/UIKit.h\")]\n\textern(iOS) static class ScreenIdle\n\t{\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic static void Enable()\n\t\t@{\n\t\t\t[[UIApplication sharedApplication] setIdleTimerDisabled:NO];\n\t\t@}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic static void Disable()\n\t\t@{\n\t\t\t[[UIApplication sharedApplication] setIdleTimerDisabled:YES];\n\t\t@}\n\t}\n\n\tenum ScreenOrientationType\n\t{\n\t\tPortrait = 0,\n\t\tLandscape = 1,\n\t\tSensor = 2\n\t}\n\n\textern(!MOBILE) static class ScreenOrientation\n\t{\n\t\tpublic static void Request(ScreenOrientationType orientation)\n\t\t{\n\t\t}\n\t}\n\n\textern(Android) static class ScreenOrientation\n\t{\n\t\t[Foreign(Language.Java)]\n\t\tpublic static void Request(ScreenOrientationType orientation)\n\t\t@{\n\t\t\tint orient = 0;\n\t\t\tif(orientation == 0)\n\t\t\t\torient = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;\n\t\t\telse if(orientation == 1)\n\t\t\t\torient = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;\n\t\t\telse if(orientation == 2)\n\t\t\t\torient = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR;\n\n\t\t\tcom.fuse.Activity.getRootActivity().setRequestedOrientation(orient);\n\t\t@}\n\t}\n\n\t[ForeignInclude(Language.ObjC, \"UIKit/UIKit.h\")]\n\textern(iOS) static class ScreenOrientation\n\t{\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic static void Request(ScreenOrientationType orientation)\n\t\t@{\n\t\t@}\n\t}\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/ScreenSettings.uxl",
    "content": "<Extensions Backend=\"CPlusPlus\" Condition=\"IOS\">\n\t<!--<Require AppDelegate.HeaderFile.Declaration>\n\t<![CDATA[\n\t\t@interface CustomizedOrientation\n\t\t{\n\t\t\t- (void)setPrefferedOrientation:(int)orientation;\n\t\t}\n\t]]>\n\t</Require AppDelegate.HeaderFile.Declaration>\n\n\t<Require AppDelegate.Implements=\"CustomizedOrientation\" />-->\n\n\t<Require AppDelegate.SourceFile.ImplementationScope>\n\t<![CDATA[\n\t\t/*\n\t\t- (void)setPrefferedOrientation:(int)orientation\n\t\t{\n\t\t}\n\n\t\t- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation \n\t\t{\n\t\t\treturn UIInterfaceOrientationUnknown;\n\t\t}*/\n\t]]>\n\t</Require>\n</Extensions>"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/SimulatorClient.uno",
    "content": "using Uno;\nusing Uno.Net;\nusing Uno.Net.Sockets;\nusing Uno.Collections;\nusing Outracks.Simulator;\nusing Uno.Threading;\nusing Outracks;\nusing System.IO;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.UnoHost;\n\nnamespace Fuse.Simulator\n{\n\tstatic class ConnectToFirstRespondingEndpoint\n\t{\n\t\tpublic static Task<Socket> Execute(IEnumerable<IPEndPoint> simulatorEndpoints)\n\t\t{\n\t\t\tvar isNotConnected = new AutoResetEvent(true);\n\t\t\tvar socketTasks = new List<Task<Socket>>();\n\t\t\tforeach (var endpoint in simulatorEndpoints)\n\t\t\t\tsocketTasks.Add(Tasks.Run<Socket>(new ConnectToEndpointClosure(endpoint, isNotConnected).Execute));\n\n\t\t\treturn Tasks.WaitForFirstResult<Socket>(socketTasks, OnNoResult);\n\t\t}\n\n\t\tstatic Socket OnNoResult(IEnumerable<Exception> exceptions)\n\t\t{\n\t\t\tthrow new AggregateException(exceptions.ToArray()); // TODO: misplaced information\n\t\t}\n\t}\n\n\tclass ConnectToEndpointClosure\n\t{\n\t\treadonly IPEndPoint _endpoint;\n\t\treadonly EventWaitHandle _isNotConnected;\n\n\t\tpublic ConnectToEndpointClosure(IPEndPoint endpoint, EventWaitHandle isNotConnected)\n\t\t{\n\t\t\t_endpoint = endpoint;\n\t\t\t_isNotConnected = isNotConnected;\n\t\t}\n\n\t\tpublic Socket Execute()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n\t\t\t\tsocket.Connect(_endpoint);\n\n\t\t\t\tif (_isNotConnected.WaitOne(0) == false)\n\t\t\t\t{\n\t\t\t\t\tsocket.Dispose();\n\t\t\t\t\tthrow new Exception(\"Connection already established\");\n\t\t\t\t}\n\n\t\t\t\treturn socket;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow e;// TODO: misplaced information\n\t\t\t}\n\t\t}\n\t}\n\n\tinterface ISimulatorClient : IDisposable\n\t{\n\t\tUno.Threading.ConcurrentQueue<IBinaryMessage> IncommingMessages { get; }\n\t\tvoid Send(IBinaryMessage message);\n\t\tISimulatorClient Clone();\n\t}\n\n\tclass OfflineClient : ISimulatorClient\n\t{\n\t\treadonly Uno.Threading.ConcurrentQueue<IBinaryMessage> messages = new Uno.Threading.ConcurrentQueue<IBinaryMessage>();\n\t\treadonly BytecodeCache _bytecodeCache;\n\t\tpublic OfflineClient(BytecodeCache bytecodeCache)\n\t\t{\n\t\t\t_bytecodeCache = bytecodeCache;\n\t\t\tmessages.Enqueue(new BytecodeGenerated(bytecodeCache.Bytecode));\n\t\t\tfor(var i = 0;i < bytecodeCache.BytecodeUpdates.Length;++i)\n\t\t\t{\n\t\t\t\tmessages.Enqueue(bytecodeCache.BytecodeUpdates[i]);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Send(IBinaryMessage message)\n\t\t{\n\t\t}\n\n\t\tpublic ISimulatorClient Clone()\n\t\t{\n\t\t\treturn new OfflineClient(_bytecodeCache);\n\t\t}\n\n\t\tpublic Uno.Threading.ConcurrentQueue<IBinaryMessage> IncommingMessages\n\t\t{\n\t\t\tget { return messages; }\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t}\n\t}\n\n\tclass SimulatorClient : ISimulatorClient\n\t{\n\t\treadonly Socket _socket;\n\t\treadonly NetworkStream _stream;\n\t\treadonly BinaryWriter _writer;\n\t\treadonly BinaryReader _reader;\n\t\treadonly Uno.Threading.ConcurrentQueue<IBinaryMessage> _messagesFromClient = new Uno.Threading.ConcurrentQueue<IBinaryMessage>();\n\t\treadonly Uno.Threading.ConcurrentQueue<IBinaryMessage> _messagesToClient = new Uno.Threading.ConcurrentQueue<IBinaryMessage>();\n\t\treadonly Thread _readWorker;\n\t\treadonly Thread _writeWorker;\n\t\treadonly EndPoint _endpoint;\n\n\t\tpublic Uno.Threading.ConcurrentQueue<IBinaryMessage> IncommingMessages \n\t\t{ \n\t\t\tget { return _messagesToClient; } \n\t\t}\n\n\t\tpublic void Send(IBinaryMessage message)\n\t\t{\n\t\t\t_messagesFromClient.Enqueue(message);\n\t\t}\n\n\t\tpublic SimulatorClient(Socket socket)\n\t\t{\n\t\t\t_socket = socket;\n\t\t\t_endpoint = _socket.RemoteEndPoint;\n\t\t\t_stream = new NetworkStream(_socket);\n\t\t\t_writer = new BinaryWriter(_stream);\n\t\t\t_reader = new BinaryReader(_stream);\n\t\t\t\n\t\t\t_readWorker = new Thread(ReadLoop);\n\t\t\t_writeWorker = new Thread(WriteLoop);\n\n\t\t\tif defined(DotNet)\n\t\t\t{\n\t\t\t\t_readWorker.IsBackground = true;\n\t\t\t\t_readWorker.Name = \"Read from \" + _socket.RemoteEndPoint;\n\t\t\t\t_writeWorker.IsBackground = true;\n\t\t\t\t_writeWorker.Name = \"Write to \" + _socket.RemoteEndPoint;\n\n\t\t\t}\n\n\t\t\t_readWorker.Start();\n\t\t\t_writeWorker.Start();\n\t\t}\n\n\t\tpublic ISimulatorClient Clone()\n\t\t{\n\t\t\tvar socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n\t\t\tLogger.Info(\"Cloning connection: \" + _endpoint);\n\t\t\tsocket.Connect(_endpoint);\n\t\t\treturn new SimulatorClient(socket);\n\t\t}\n\n\t\t// no volative in UNO, boo :(\n\t\tbool _running = true;\n\n\t\tvoid ReadLoop()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (_running)\n\t\t\t\t{\n\t\t\t\t\twhile (_socket.Poll(0, SelectMode.Read))\n\t\t\t\t\t\t_messagesToClient.Enqueue(BinaryMessage.ReadFrom(_reader));\n\n\t\t\t\t\tThread.Sleep(10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\t_messagesToClient.Enqueue(new Error(ExceptionInfo.Capture(e)));\n\t\t\t}\n\t\t}\n\n\t\tvoid WriteLoop()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (_running)\n\t\t\t\t{\n\t\t\t\t\tIBinaryMessage message;\n\t\t\t\t\twhile (_messagesFromClient.TryDequeue(out message))\n\t\t\t\t\t\tmessage.WriteTo(_writer);\n\n\t\t\t\t\tThread.Sleep(10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_messagesToClient.Enqueue(new Error(ExceptionInfo.Capture(e)));\n\t\t\t\t_running = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_running = false;\n\t\t\t\n\t\t\t_readWorker.Join();\n\t\t\t_writeWorker.Join();\n\n\t\t\t_stream.Dispose();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_socket.Shutdown(SocketShutdown.Both);\n\t\t\t\t_socket.Close();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tLogger.Error(e.Message);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/SimulatorJS.uno",
    "content": "using Uno;\nusing Fuse.Scripting;\nusing Uno.Net;\nusing Uno.Net.Sockets;\nusing Uno.Threading;\nusing Uno.IO;\nusing Outracks;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.Runtime;\nusing Uno.Collections;\n\nnamespace Fuse.Simulator \n{\n\tdelegate T ResultFactory<T>(object[] args);\n\tclass FactoryClosure<T>\n\t{\n\t\tResultFactory<T> _factory;\n\t\tobject[] _args;\n\t\tPromise<T> _promise;\n\n\t\tpublic FactoryClosure(ResultFactory<T> factory, object[] args, Promise<T> promise)\n\t\t{\n\t\t\t_factory = factory;\n\t\t\t_args = args;\n\t\t\t_promise = promise;\n\t\t}\n\n\t\tpublic void Run()\n\t\t{\n\t\t\tT res = default(T);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tres = _factory(_args);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_promise.Reject(e);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_promise.Resolve(res);\n\t\t}\n\t}\n\n\tclass RecentProjectsCallback\n\t{\n\t\treadonly Context _ctx;\n\t\treadonly Function _callback;\n\t\tProject[] _projects;\n\n\t\tpublic RecentProjectsCallback(Context ctx, Function callback)\n\t\t{\n\t\t\t_ctx = ctx;\n\t\t\t_callback = callback;\n\t\t}\n\n\t\tpublic void Update(IEnumerable<Project> projects)\n\t\t{\n\t\t\t_projects = FilterOnlyCachedProjects(projects);\n\t\t\t_ctx.Invoke(UpdateJS);\n\t\t}\n\n\t\tProject[] FilterOnlyCachedProjects(IEnumerable<Project> projects)\n\t\t{\n\t\t\tvar projectsCached = new List<Project>();\n\t\t\tforeach(var proj in projects)\n\t\t\t{\n\t\t\t\tif(SimulatorManager.RecentProjects.IsCached(proj))\n\t\t\t\t\tprojectsCached.Add(proj);\n\t\t\t}\n\t\t\treturn projectsCached.ToArray();\n\t\t}\n\n\t\tvoid UpdateJS(Context ctx)\n\t\t{\n\t\t\t_callback.Call(ctx, Converter(ctx, _projects));\n\t\t}\n\n\t\tobject Converter(Context c, Project []project)\n\t\t{\n\t\t\tvar projObjs = new List<object>();\n\t\t\tforeach(var proj in project)\n\t\t\t{\n\t\t\t\tprojObjs.Add(CreateProjectObject(proj, c));\n\t\t\t}\n\t\t\treturn c.NewArray(projObjs.ToArray());\n\t\t}\n\n\t\tstatic Fuse.Scripting.Object CreateProjectObject(Project project, Context ctx)\n\t\t{\n\t\t\tvar o = ctx.NewObject();\n\t\t\to[\"id\"] = project.Identifier;\n\t\t\to[\"name\"] = project.Name;\n\t\t\treturn o;\n\t\t}\n\t}\n\n\tpublic class SimulatorJS : NativeModule\n\t{\n\t\tRecentProjectsCallback _recentProjectsCallback;\n\t\tpublic SimulatorJS()\n\t\t{\n\t\t\tAddMember(new NativePromise<ProxyConnection,object>(\"connectToProxy\", ConnectToProxy, Converter));\n\t\t\tAddMember(new NativeFunction(\"listenForRecentProjects\", ListenForRecentProjects));\n\t\t\tAddMember(new NativePromise<ClientInfo,object>(\"openProject\", OpenProject, Converter));\n\t\t\tAddMember(new NativePromise<int,object>(\"restartProjectRuntime\", RestartProjectRuntime, Converter));\n\t\t\tAddMember(new NativeFunction(\"requestScreenOrientation\", RequestScreenOrientation));\n\t\t}\n\n\t\tProxyConnection ConnectToProxy(object[] args)\n\t\t{\n\t\t\tif(args[0] is Fuse.Scripting.Array)\n\t\t\t{\n\t\t\t\tvar rawAddresses = (Fuse.Scripting.Array)args[0];\n\t\t\t\tvar addresses = new IPAddress[rawAddresses.Length];\n\t\t\t\tfor(var i = 0;i < addresses.Length;++i)\n\t\t\t\t{\n\t\t\t\t\taddresses[i] = IPAddress.Parse((string)rawAddresses[i]);\n\t\t\t\t}\n\n\t\t\t\treturn ProxyConnection.Connect(addresses);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn ProxyConnection.Connect(IPAddress.Parse((string)args[0]));\n\t\t\t}\n\t\t}\n\n\t\tobject ListenForRecentProjects(Context c, object[] args)\n\t\t{\n\t\t\tvar callback = (Function)args[0];\n\t\t\tvar recentProjects = SimulatorManager.RecentProjects;\n\t\t\tif(_recentProjectsCallback != null)\n\t\t\t\trecentProjects.RecentProjectsChanged -= _recentProjectsCallback.Update;\n\t\t\t\n\t\t\t_recentProjectsCallback = new RecentProjectsCallback(c, callback);\n\t\t\trecentProjects.RecentProjectsChanged += _recentProjectsCallback.Update;\n\t\t\t_recentProjectsCallback.Update(recentProjects.Projects);\n\t\t\treturn null;\n\t\t}\n\n\t\tFuture<ClientInfo> OpenProject(object[] args)\n\t\t{\n\t\t\tvar promise = new Promise<ClientInfo>();\n\t\t\tUpdateManager.PostAction(new FactoryClosure<ClientInfo>(OpenProjectInternal, args, promise).Run);\n\t\t\treturn promise;\n\t\t}\n\n\t\tClientInfo OpenProjectInternal(object[] args)\n\t\t{\n\t\t\tvar id = Marshal.ToInt(args[0]);\n\t\t\tvar proj = SimulatorManager.RecentProjects.GetProject(id);\n\t\t\tvar bc = SimulatorManager.RecentProjects.GetCache(proj);\n\t\t\treturn new ClientInfo(proj.Name, SimulatorManager.AddProjectRuntime(id, new OfflineClient(bc)));\n\t\t}\n\n\t\tobject RequestScreenOrientation(Context c, object[] args)\n\t\t{\n\t\t\tvar orientationRaw = (string)args[0];\n\t\t\tScreenOrientationType orientation;\n\t\t\tif(!Enum.TryParse(orientationRaw, true, out orientation))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Invalid orientation identifier: \" + orientationRaw);\n\t\t\t}\n\t\t\tUpdateManager.PostAction(Outracks.Simulator.Closure.Apply<ScreenOrientationType>(ScreenOrientation.Request, orientation));\n\t\t\treturn null;\n\t\t}\n\n\t\tFuture<int> RestartProjectRuntime(object[] args)\n\t\t{\n\t\t\tvar promise = new Promise<int>();\n\t\t\tUpdateManager.PostAction(new FactoryClosure<int>(RestartProjectRuntimeInternal, args, promise).Run);\n\t\t\treturn promise;\n\t\t}\n\n\t\tint RestartProjectRuntimeInternal(object[] args)\n\t\t{\n\t\t\treturn SimulatorManager.RestartRuntime(Marshal.ToInt(args[0]));\n\t\t}\n\n\t\tobject Converter(Context c, ProxyConnection owner)\n\t\t{\n\t\t\treturn c.Unwrap(owner);\n\t\t}\n\n\t\tobject Converter(Context c, ClientInfo owner)\n\t\t{\n\t\t\treturn owner.CreateScriptObject(c);\n\t\t}\n\n\t\tobject Converter(Context c, int owner)\n\t\t{\n\t\t\treturn owner;\n\t\t}\n\t}\n\n\tclass ProxyConnection\n\t{\n\t\treadonly Socket _socket;\n\t\treadonly NetworkStream _networkStream;\n\t\t\n\t\tstatic ProxyConnection()\n\t\t{\n\t\t\tScriptClass.Register(typeof(ProxyConnection),\n\t\t\t\tnew ScriptPromise<ProxyConnection,ClientInfo,Fuse.Scripting.Object>(\"connectToHost\", ExecutionThread.MainThread, ConnectToHost, Converter),\n\t\t\t\tnew ScriptMethod<ProxyConnection>(\"disconnect\", Disconnect));\n\t\t}\n\n\t\tProxyConnection(Socket socket)\n\t\t{\n\t\t\t_socket = socket;\n\t\t\t_networkStream = new NetworkStream(_socket);\n\t\t}\n\n\t\tpublic static ProxyConnection Connect(IPAddress address)\n\t\t{\n\t\t\tvar socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n\t\t\tsocket.Connect(ToProxyEndpoint(address));\n\t\t\treturn new ProxyConnection(socket);\n\t\t}\n\n\t\tpublic static ProxyConnection Connect(IPAddress []addresses)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar socket = ConnectToFirstRespondingEndpoint.Execute(addresses.Select(ToProxyEndpoint)).Result;\n\t\t\t\treturn new ProxyConnection(socket);\n\t\t\t}\n\t\t\tcatch(AggregateException e)\n\t\t\t{\n\t\t\t\tif(e.InnerExceptions != null && e.InnerExceptions.Count > 0)\n\t\t\t\t\tthrow e.InnerExceptions.First();\n\t\t\t\telse\n\t\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\tstatic IPEndPoint ToProxyEndpoint(IPAddress address)\n\t\t{\n\t\t\treturn new IPEndPoint(address, 12124);\n\t\t}\n\n\t\tstatic void Disconnect(ProxyConnection owner, object []args)\n\t\t{\n\t\t\towner._socket.Dispose();\n\t\t}\n\n\t\tstatic Future<ClientInfo> ConnectToHost(Context context, ProxyConnection owner, object []args)\n\t\t{\n\t\t\tvar promise = new Promise<ClientInfo>();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar code = (string)args[0];\n\t\t\t\tpromise.Resolve(owner.ConnectToHostInner(code));\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tpromise.Reject(e);\n\t\t\t}\n\t\t\treturn promise;\n\t\t}\n\n\t\tClientInfo ConnectToHostInner(string code)\n\t\t{\n\t\t\tvar writer = new System.IO.BinaryWriter(_networkStream);\n\t\t\tvar reader = new System.IO.BinaryReader(_networkStream);\n\t\t\twriter.Write(code);\n\t\t\twriter.Write(\"\"); // TODO: This is defines!\n\n\t\t\tvar initialState = reader.ReadString();\n\n\t\t\tif(\"SUCCESS\".Equals(initialState) == false)\n\t\t\t\tthrow new Exception(\"Failed to request a preview host\");\n\n\t\t\tif (\"DESIGNER_NOT_RUNNING\".Equals(initialState))\n\t\t\t\tthrow new Exception(\"Incorrect code\");\n\t\t\t\n\t\t\tvar endpointCount = reader.ReadInt32();\n\t\t\tvar endpoints = new IPEndPoint[endpointCount];\n\t\t\tfor (int i = 0; i < endpoints.Length; i++)\n\t\t\t{\n\t\t\t\tvar simulatorAddress = reader.ReadString();\n\t\t\t\tvar simulatorPort = reader.ReadInt32();\n\t\t\t\tendpoints[i] = new IPEndPoint(IPAddress.Parse(simulatorAddress), simulatorPort);\n\t\t\t}\n\n\t\t\tvar projectName = reader.ReadString();\n\t\t\tLogger.Info(\"Project Name: \" + projectName);\n\t\t\tforeach(var endpoint in endpoints)\n\t\t\t{\n\t\t\t\tLogger.Info(\"Endpoint to host: \" + endpoint.ToString());\n\t\t\t}\n\t\t\t\n\t\t\tvar packageCount = reader.ReadInt32();\n\t\t\tfor(var i = 0;i < packageCount;++i)\n\t\t\t{\n\t\t\t\tvar name = reader.ReadString();\n\t\t\t\tvar version = reader.ReadString();\n\t\t\t\tLogger.Info(\"Package: \" + name + \", \" + version);\n\t\t\t}\n\n\t\t\tvar projectCount = reader.ReadInt32();\n\t\t\tfor(var i = 0;i < projectCount;++i)\n\t\t\t{\n\t\t\t\tvar name = reader.ReadString();\n\t\t\t\tLogger.Info(\"Project: \" + name);\n\t\t\t}\n\n\t\t\tvar hostSocket = ConnectToFirstRespondingEndpoint.Execute(endpoints).Result;\n\t\t\tLogger.Info(\"Made connection to an host!\");\n\t\t\t\n\t\t\tvar project = FindRecentProjectOrCreate(projectName); // TODO: Base it on a unique identifier...\n\t\t\treturn new ClientInfo(projectName, SimulatorManager.AddProjectRuntime(project.Identifier, new SimulatorClient(hostSocket)));\n\t\t}\n\n\t\tstatic Project FindRecentProjectOrCreate(string projectName)\n\t\t{\n\t\t\tvar recentProjects = SimulatorManager.RecentProjects;\n\n\t\t\tforeach(var proj in recentProjects.Projects)\n\t\t\t{\n\t\t\t\tif(proj.Name == projectName)\n\t\t\t\t\treturn proj;\n\t\t\t}\n\n\t\t\treturn recentProjects.AddProject(projectName);\n\t\t}\n\n\t\tstatic Fuse.Scripting.Object Converter(Context c, ClientInfo owner)\n\t\t{\n\t\t\treturn owner.CreateScriptObject(c);\n\t\t}\n\t}\n\n\tclass ClientInfo\n\t{\n\t\treadonly int _id;\n\t\treadonly string _projectName;\n\n\t\tpublic ClientInfo(string projectName, int id)\n\t\t{\n\t\t\t_id = id;\n\t\t\t_projectName = projectName;\n\t\t}\n\n\t\tpublic Fuse.Scripting.Object CreateScriptObject(Context c)\n\t\t{\n\t\t\tvar o = c.NewObject();\n\t\t\to[\"id\"] = _id;\n\t\t\to[\"projectName\"] = _projectName;\n\t\t\treturn o;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/SimulatorManager.uno",
    "content": "using Uno;\nusing Uno.Net;\nusing Uno.Net.Sockets;\nusing Uno.Collections;\nusing Outracks.Simulator;\nusing Uno.Threading;\nusing Outracks;\nusing System.IO;\nusing Outracks.Simulator.Client;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.Runtime;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Fuse.Simulator\n{\n\tclass ProjectRuntime : IDisposable\n\t{\n\t\tpublic readonly ISimulatorClient Client;\n\t\tpublic readonly int ProjectId;\n\n\t\tpublic bool IsDisposed { get; private set; }\n\n\t\tpublic ProjectRuntime(int projectId, ISimulatorClient client)\n\t\t{\n\t\t\tProjectId = projectId;\n\t\t\tClient = client;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tClient.Dispose();\n\t\t\tIsDisposed = true;\n\t\t}\n\t}\n\n\tstatic class SimulatorManager\n\t{\n\t\tstatic readonly Dictionary<int,ProjectRuntime> _projectRuntimes = new Dictionary<int,ProjectRuntime>();\n\t\tpublic static readonly RecentProjects RecentProjects = new RecentProjects(new BundleManager());\n\n\t\tstatic int _uniqueId;\n\n\t\tstatic IReflection _reflection;\n\t\tpublic static IReflection Reflection\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif(_reflection == null)\n\t\t\t\t\t_reflection = CreateReflection();\n\t\t\t\treturn _reflection;\n\t\t\t}\n\t\t}\n\n\t\tstatic IReflection CreateReflection()\n\t\t{\n\t\t\tif defined(DotNet)\n\t\t\t\treturn new DotNetReflection();\n\t\t\tif defined(CPLUSPLUS)\n\t\t\t\treturn new NativeReflection(new SimpleTypeMap());\n\t\t}\n\n\t\tpublic static int AddProjectRuntime(int projectId, ISimulatorClient client)\n\t\t{\n\t\t\t_projectRuntimes[++_uniqueId] = new ProjectRuntime(projectId, client);\n\t\t\treturn _uniqueId;\n\t\t}\n\n\t\tpublic static ProjectRuntime GetProjectRuntime(int id)\n\t\t{\n\t\t\treturn _projectRuntimes[id];\n\t\t}\n\n\t\tpublic static int RestartRuntime(int id)\n\t\t{\n\t\t\tvar oldRuntime = _projectRuntimes[id];\n\t\t\tKillClient(id);\n\t\t\tvar newClient = oldRuntime.Client.Clone();\n\t\t\treturn AddProjectRuntime(oldRuntime.ProjectId, newClient);\n\t\t}\n\n\t\tpublic static void KillClient(int id)\n\t\t{\n\t\t\tif(!_projectRuntimes.ContainsKey(id))\n\t\t\t\treturn;\n\n\t\t\tvar runtime = _projectRuntimes[id];\n\t\t\tif(runtime.IsDisposed)\n\t\t\t\treturn;\n\n\t\t\truntime.Dispose();\n\t\t\tLogger.Info(\"Client was killed: \" + id);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/app/Fuse.Simulator/SimulatorView.uno",
    "content": "using Uno;\nusing Uno.Platform;\nusing Fuse.Controls;\nusing Fuse.Drawing;\nusing Uno.Net;\nusing Uno.Net.Sockets;\nusing Uno.Collections;\nusing Outracks.Simulator;\nusing Uno.Threading;\nusing Outracks;\nusing System.IO;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.Runtime;\nusing Outracks.Simulator.Bytecode;\nusing Uno.UX;\nusing Uno.Compiler.ExportTargetInterop;\nusing Fuse.Scripting;\n\nnamespace Fuse.Simulator\n{\n\tenum UserErrorType\n\t{\n\t\tNormal,\n\t\tFatal\n\t}\n\n\tclass UserError\n\t{\n\t\tpublic readonly UserErrorType ErrorType;\n\t\tpublic readonly string Message;\n\n\t\tpublic UserError(UserErrorType errorType, string message)\n\t\t{\n\t\t\tErrorType = errorType;\n\t\t\tMessage = message;\n\t\t}\n\t}\n\n\tclass ErrorToJSCallback\n\t{\n\t\treadonly Context _ctx;\n\t\treadonly Function _callback;\n\t\tUno.Threading.ConcurrentQueue<UserError> _errorMessages\n\t\t\t= new Uno.Threading.ConcurrentQueue<UserError>();\n\n\t\tpublic ErrorToJSCallback(Context ctx, Function callback)\n\t\t{\n\t\t\t_ctx = ctx;\n\t\t\t_callback = callback;\n\t\t}\n\n\t\tpublic void Error(UserError error)\n\t\t{\n\t\t\t_errorMessages.Enqueue(error);\n\t\t\t_ctx.Invoke(UpdateJS);\n\t\t}\n\n\t\tvoid UpdateJS(Context ctx)\n\t\t{\n\t\t\tUserError error;\n\t\t\twhile(_errorMessages.TryDequeue(out error))\n\t\t\t\t_callback.Call(_ctx, error.ErrorType.ToString(), error.Message);\n\t\t}\n\t}\n\n\tpublic class SimulatorViewHost : Panel\n\t{\n\t\tstatic SimulatorViewHost()\n\t\t{\n\t\t\tScriptClass.Register(typeof(SimulatorViewHost),\n\t\t\t\tnew ScriptMethod<SimulatorViewHost>(\"onError\", OnError),\n\t\t\t\tnew ScriptMethod<SimulatorViewHost>(\"emulateBackbutton\", EmulateBackbutton));\n\t\t}\n\n\t\tErrorToJSCallback _errorToJSCallback;\n\t\tstatic object OnError(Context ctx, SimulatorViewHost owner, object []args)\n\t\t{\n\t\t\towner._errorToJSCallback = new ErrorToJSCallback(ctx, (Function)args[0]);\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic void EmulateBackbutton(SimulatorViewHost owner)\n\t\t{\n\t\t\tFuse.Input.Keyboard.EmulateBackButtonTap();\n\t\t}\n\n\t\tint _simulatorId;\n\t\tpublic int SimulatorId\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _simulatorId;\n\t\t\t}\n\t\t\tset\n\t\t\t{\n\t\t\t\tif(_simulatorId != value)\n\t\t\t\t{\n\t\t\t\t\tif(_simulatorId != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tCleanup(_simulatorId);\n\t\t\t\t\t}\n\n\t\t\t\t\t_simulatorId = value;\n\t\t\t\t\tvar simulatorView = new SimulatorView(_simulatorId);\n\t\t\t\t\tsimulatorView.DiagnosticReported += OnDiagnosticsReported;\n\t\t\t\t\tsimulatorView.FatalException += OnFatalException;\n\t\t\t\t\tChildren.Add(simulatorView);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid OnDiagnosticsReported(Fuse.Diagnostic d)\n\t\t{\n\t\t\tif(d.Type == DiagnosticType.UserError || d.Type == DiagnosticType.InternalError)\n\t\t\t{\n\t\t\t\tif(_errorToJSCallback != null)\n\t\t\t\t\t_errorToJSCallback.Error(new UserError(UserErrorType.Normal, d.Message.ToString()));\n\t\t\t}\n\t\t}\n\n\t\tvoid OnFatalException(Exception exception)\n\t\t{\n\t\t\tif(_errorToJSCallback != null)\n\t\t\t\t_errorToJSCallback.Error(new UserError(UserErrorType.Fatal, exception.Message));\n\t\t}\n\n\t\tprotected override void OnUnrooted()\n\t\t{\n\t\t\tCleanup(SimulatorId);\n\t\t}\n\n\t\tvoid Cleanup(int simId)\n\t\t{\n\t\t\tforeach(var child in Children)\n\t\t\t{\n\t\t\t\tif(child is IDisposable)\n\t\t\t\t\t((IDisposable)child).Dispose();\n\t\t\t\tif(child is SimulatorView)\n\t\t\t\t{\n\t\t\t\t\t((SimulatorView)child).DiagnosticReported -= OnDiagnosticsReported;\n\t\t\t\t\t((SimulatorView)child).FatalException -= OnFatalException;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tChildren.Clear();\n\t\t\tSimulatorManager.KillClient(simId);\n\t\t}\n\t}\n\n\t[Require(\"Entity\", \"Uno.UX.SimulatedProperties.Set(Uno.UX.PropertyObject,string,object,Uno.UX.IPropertyListener)\")]\n\t[Require(\"Entity\", \"Uno.UX.SimulatedProperties.Get(Uno.UX.PropertyObject,string)\")]\n\tpublic class SimulatorView : Panel, IDisposable, Fuse.IRootVisualProvider\n\t{\n\t\treadonly ISimulatorClient _client;\n\t\treadonly IReflection _reflection;\n\t\treadonly Project _project;\n\t\treadonly List<BytecodeUpdated> _bytecodeUpdates = new List<BytecodeUpdated>();\n\t\treadonly DiagnosticsManager _diagnosticsManager;\n\t\tProjectBytecode _lastBytecode;\n\t\tobject _previousState = null;\n\n\t\tpublic event Action<Fuse.Diagnostic> DiagnosticReported\n\t\t{\n\t\t\tadd { _diagnosticsManager.DiagnosticReported += value; }\n\t\t\tremove { _diagnosticsManager.DiagnosticReported -= value; }\n\t\t}\n\n\t\tpublic event Action<Fuse.Diagnostic> DiagnosticDismissed\n\t\t{\n\t\t\tadd { _diagnosticsManager.DiagnosticDismissed += value; }\n\t\t\tremove { _diagnosticsManager.DiagnosticDismissed -= value; }\n\t\t}\n\n\t\tpublic event Action<Exception> FatalException;\n\n\t\tpublic SimulatorView(int id)\n\t\t{\n\t\t\tvar runtime = SimulatorManager.GetProjectRuntime(id);\n\t\t\t_client = runtime.Client;\n\t\t\t_reflection = SimulatorManager.Reflection;\n\t\t\t_project = SimulatorManager.RecentProjects.GetProject(runtime.ProjectId);\n\t\t\t_diagnosticsManager = new DiagnosticsManager(_client);\n\t\t\tSendClientInfo();\n\t\t\tUpdateManager.AddAction(Update);\n\t\t\tScreenIdle.Disable();\n\t\t\tAppInstance.UnhandledException += OnUnhandledException;\n\t\t}\n\n\t\tfloat4 _clearColor;\n\t\tpublic float4 ClearColor\n\t\t{\n\t\t\tget { return _clearColor; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tbase.Background = new SolidColor(value);\n\t\t\t\t_clearColor = value;\n\t\t\t}\n\t\t}\n\n\t\tnew public float4 Background\n\t\t{\n\t\t\tget { return ClearColor; }\n\t\t\tset { ClearColor = value; }\n\t\t}\n\n\t\tVisual Fuse.IRootVisualProvider.Root { get { return RootViewport; } }\n\n\t\tpublic Fuse.App AppInstance\n\t\t{\n\t\t\tget { return (Fuse.App)CoreApp.Current; }\n\t\t}\n\n\t\tpublic RootViewport RootViewport\n\t\t{\n\t\t\tget { return AppInstance.RootViewport; }\n\t\t}\n\n\t\tvoid Reset()\n\t\t{\n\t\t\tChildren.Clear();\n\t\t\tClearColor = float4(1,1,1,1);\n\t\t\t_previousState = RootViewport.SavePreviewState();\n\t\t}\n\n\t\tvoid SendClientInfo()\n\t\t{\n\t\t\t_client.Send(new RegisterName(DeviceInfo.GUID, DeviceInfo.Name));\n\t\t}\n\n\t\tvoid Update()\n\t\t{\n\t\t\tIBinaryMessage message;\n\t\t\twhile (_client.IncommingMessages.TryDequeue(out message))\n\t\t\t{\n\t\t\t\tvar bcg = message.TryParse(BytecodeGenerated.MessageType, (Func<System.IO.BinaryReader, BytecodeGenerated>)BytecodeGenerated.ReadDataFrom);\n\t\t\t\tif (bcg.HasValue)\n\t\t\t\t{\n\t\t\t\t\tReifyBytecode(bcg.Value);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar bu = message.TryParse(BytecodeUpdated.MessageType, (Func<System.IO.BinaryReader, BytecodeUpdated>)BytecodeUpdated.ReadDataFrom);\n\t\t\t\tif (bu.HasValue)\n\t\t\t\t{\n\t\t\t\t\tUpdateBytecode(bu.Value);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar err = message.TryParse(Outracks.Simulator.Protocol.Error.MessageType, (Func<System.IO.BinaryReader, Outracks.Simulator.Protocol.Error>)Outracks.Simulator.Protocol.Error.ReadDataFrom);\n\t\t\t\tif (err.HasValue)\n\t\t\t\t\tLogger.Error(\"Error: \" + err.Value.ToString());\n\t\t\t}\n\t\t}\n\n\t\tvoid ReifyBytecode(BytecodeGenerated bytecodeGenerated)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tLogger.Info(\"Got reify!\");\n\t\t\t\tReset();\n\t\t\t\tvar reify = bytecodeGenerated.Bytecode.Reify;\n\t\t\t\tnew ScopeClosure(new Outracks.Simulator.Runtime.Environment(Optional.None<Outracks.Simulator.Runtime.Environment>()), _reflection).Execute(reify, this);\n\t\t\t\t_lastBytecode = bytecodeGenerated.Bytecode;\n\t\t\t\tUpdateCache();\n\t\t\t\tRootViewport.RestorePreviewState(_previousState);\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tReportBytecodeExceptions(e);\n\t\t\t}\n\t\t}\n\n\t\tvoid UpdateBytecode(BytecodeUpdated bytecodeUpdated)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tLogger.Info(\"Got update!\");\n\t\t\t\tvar updateFunc = bytecodeUpdated.Function;\n\t\t\t\tnew ScopeClosure(new Outracks.Simulator.Runtime.Environment(Optional.None<Outracks.Simulator.Runtime.Environment>()), _reflection).Execute(updateFunc, this);\n\t\t\t\t_bytecodeUpdates.Add(bytecodeUpdated);\n\t\t\t\tUpdateCache();\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\tReportBytecodeExceptions(e);\n\t\t\t}\n\t\t}\n\n\t\tvoid ReportBytecodeExceptions(Exception e)\n\t\t{\n\t\t\tif(e is TypeNotFound)\n\t\t\t{\n\t\t\t\te = new Exception(\"Type '\" + ((TypeNotFound)e).Type + \"' could not be found. The preview app doesn't support custom Uno code.\");\n\t\t\t}\n\n\t\t\tif(FatalException != null)\n\t\t\t\tFatalException(e);\n\t\t}\n\n\t\tvoid UpdateCache()\n\t\t{\n\t\t\t// TODO: Enabling caching for recent project list\n\t\t\t//if(_lastBytecode == null) return;\n\n\t\t\t//SimulatorManager.RecentProjects.UpdateCache(_project, new BytecodeCache(_lastBytecode, _bytecodeUpdates.ToArray()));\n\t\t}\n\n\t\tvoid OnUnhandledException(object sender, UnhandledExceptionArgs args)\n\t\t{\n\t\t\tif(FatalException != null)\n\t\t\t\tFatalException(args.Exception);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tAppInstance.UnhandledException -= OnUnhandledException;\n\t\t\tScreenIdle.Enable();\n\t\t\t_diagnosticsManager.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/app/FuseRx.js",
    "content": "var Rx = require('rx.all');\nvar Observable = require('FuseJS/Observable');\n\nvar rxObservableProto = Rx.Observable.prototype;\nrxObservableProto.toFuseObservable = function(errorObservable) {\n\tvar obs = Observable();\n\tthis.subscribe(function (a) {\n\t\tobs.value = a;\n\t}, function (e) {\n\t\tif(errorObservable != null)\n\t\t\terrorObservable.value = e;\n\t},\n\tfunction () {\n\t\t// TODO: OnCompleted?\n\t}); // What to do with the subscription (dispose)? \n\treturn obs;\n};\n\nvar fuseObservableProto = Observable.prototype;\nfuseObservableProto.toRxObservable = function() {\n\tvar self = this;\n\treturn Rx.Observable.create(function (observer) {\n\t\tvar onNext = function (a) {\n\t\t\tobserver.onNext(a.value);\n\t\t};\n\n\t\tself.addSubscriber(onNext);\n\n\t\treturn function () {\n\t\t\tself.removeSubscriber(onNext);\n\t\t};\n\t});\n};\n\nmodule.exports = Rx;\n\n"
  },
  {
    "path": "src/preview/app/MainView.ux",
    "content": "<Panel ux:Class=\"MainView\">\n\t<Resources/>\n\t<Fuse.Simulator.SimulatorJS ux:Global=\"SimulatorAPI\" />\n\t<Router BackButtonAction=\"None\" ux:Name=\"router\" />\n\n\t<JavaScript>\n\t\tmodule.exports = {\n\t\t\tonBackButton: function() {\n\t\t\t\trouter.goBack();\n\t\t\t}\n\t\t};\n\t</JavaScript>\n\n\t<OnBackButton Handler=\"{onBackButton}\" />\n\t<Navigator DefaultPath=\"setupPage\" Reuse=\"None\">\n\t\t<SetupPage ux:Template=\"setupPage\" router=\"router\"/>\n\t\t<AppViewPage ux:Template=\"appViewPage\" router=\"router\" />\n\t\t<ErrorPage ux:Template=\"errorPage\" router=\"router\" />\n\t</Navigator>\n</Panel>\n\n"
  },
  {
    "path": "src/preview/app/Pages/AppViewPage.ux",
    "content": "<Page ux:Class=\"AppViewPage\">\n\t<JavaScript>\n\t\tvar ShakeRecognizer = require(\"ShakeRecognizer\");\n\t\tvar simulatorAPI = require('SimulatorAPI');\n\t\tvar Observable = require('FuseJS/Observable');\n\t\tvar rx = require('rx.all');\n\t\tvar Lifecycle = require(\"FuseJS/Lifecycle\");\n\n\t\tvar simulatorId = this.Parameter.map(function(param) {\n\t\t\treturn param.simulatorId;\n\t\t});\n\n\t\tvar errorMessage = new Observable();\n\t\tsimulatorHost.onError(\n\t\t\tfunction(type, error) {\n\t\t\t\tif(type == 0)\n\t\t\t\t\terrorMessage.value = error;\n\t\t\t\telse if(type == 1)\n\t\t\t\t\tgotoFatalErrorPage(error);\n\t\t\t});\n\n\t\tShakeRecognizer.start();\n\n\t\tLifecycle.on(\"enteringInteractive\", function() {\n\t\t\tShakeRecognizer.start();\n\t\t});\n\n\t\tLifecycle.on(\"enteringBackground\", function() {\n\t\t\tShakeRecognizer.stop();\n\t\t});\n\n\t\tvar showDevMenu = ShakeRecognizer.shaked\n\t\t\t.filter(function(shaked) {\n\t\t\t\treturn shaked;\n\t\t\t});\n\t\tshowDevMenu.value = false;\n\n\t\tfunction closeDevMenu() {\n\t\t\tshowDevMenu.value = false;\n\t\t}\n\n\t\tfunction goHome() {\n\t\t\trouter.goto(\"setupPage\");\n\t\t}\n\n\t\tfunction emulateBackButton() {\n\t\t\tsimulatorHost.emulateBackbutton();\n\t\t}\n\n\t\tfunction requestSensor() {\n\t\t\tsimulatorAPI.requestScreenOrientation(\"Sensor\");\n\t\t}\n\n\t\tfunction gotoFatalErrorPage(message) {\n\t\t\trouter.goto(\"errorPage\", { errorMessage: message, simulatorId: simulatorId.value });\n\t\t}\n\n\t\tfunction restart() {\n\t\t\tsimulatorAPI.restartProjectRuntime(simulatorId.value)\n\t\t\t\t.then(function(newSimId) {\n\t\t\t\t\trouter.goto(\"appViewPage\", { simulatorId: newSimId });\n\t\t\t\t})\n\t\t\t\t.catch(function(error) {\n\t\t\t\t\trouter.goto(\"setupPage\");\n\t\t\t\t});\n\t\t};\n\n\t\tvar hasError = errorMessage.map(function(m) \n\t\t{\n\t\t\treturn true;\n\t\t});\n\n\t\tmodule.disposed.push(function() {\n\t\t\tShakeRecognizer.stop();\n\t\t});\n\t\tmodule.exports = {\n\t\t\tid: simulatorId,\n\t\t\tshowDevMenu: showDevMenu,\n\t\t\tcloseDevMenu: closeDevMenu,\n\t\t\tgoHome: goHome,\n\t\t\temulateBackButton: emulateBackButton,\n\t\t\thasError: hasError,\n\t\t\trequestSensor: requestSensor,\n\t\t\trestart: restart\n\t\t};\n\t</JavaScript>\n\t<Activated Handler=\"{requestSensor}\" />\n\t<Router ux:Dependency=\"router\" />\n\n\t<Container ux:Class=\"Notification\" HitTestMode=\"None\" Subtree=\"subtree\" NotDone=\"True\">\n\t\t<string ux:Property=\"Text\" />\n\t\t<bool ux:Property=\"NotDone\" />\n\t\t<Rectangle ux:Name=\"rect\" Opacity=\"0\" ux:Binding=\"Children\" Color=\"#eee\" Padding=\"24\">\n\t\t\t<Activated>\n\t\t\t\t<Change rect.Opacity=\"1\" Duration=\"0.5\" DelayBack=\"2.0\" />\n\t\t\t</Activated>\n\t\t\t<Activated>\n\t\t\t\t<Set this.NotDone=\"False\" Delay=\"3\" />\n\t\t\t</Activated>\n\t\t\t<Grid Columns=\"auto,1*\" CellSpacing=\"12\">\n\t\t\t\t<Panel ux:Name=\"subtree\" />\n\t\t\t\t<Text Value=\"{Property Text}\" Alignment=\"VerticalCenter\" TextWrapping=\"Wrap\" />\n\t\t\t</Grid>\n\t\t</Rectangle>\n\t</Container>\n\n\t<Panel>\n\t\t<WhileTrue Value=\"{showDevMenu}\">\n\t\t\t<Vibrate Duration=\".4\" />\n\t\t\t<ClientPanel Color=\"#15191ebb\">\n\t\t\t\t<Panel>\n\t\t\t\t\t<Rectangle Color=\"#15191e\" CornerRadius=\"4\" Alignment=\"VerticalCenter\" Margin=\"28\">\n\t\t\t\t\t\t<Shadow Size=\"5\" />\n\t\t\t\t\t\t\t<!--<Text TextColor=\"HighlightText\" Value=\"Dev Menu\" Dock=\"Top\" />-->\n\t\t\t\t\t\t<StackPanel Margin=\"16\" ItemSpacing=\"16\">\n\t\t\t\t\t\t\t<Text TextAlignment=\"Center\" FontSize=\"24\" Color=\"#808080\">Preview Menu</Text>\n\t\t\t\t\t\t\t<BasicButton Text=\"Home\" Clicked=\"{goHome}\" />\n\t\t\t\t\t\t\t<BasicButton Text=\"Emulate back\" Dock=\"Bottom\" Clicked=\"{emulateBackButton}\" />\n\t\t\t\t\t\t\t<BasicButton Text=\"Restart\" Dock=\"Bottom\" Clicked=\"{restart}\" />\n\t\t\t\t\t\t\t<BasicButton Text=\"Close\" Dock=\"Bottom\" Clicked=\"{closeDevMenu}\" />\n\t\t\t\t\t\t</StackPanel>\n\t\t\t\t\t</Rectangle>\n\t\t\t\t</Panel>\n\t\t\t\t<Panel HitTestMode=\"LocalBounds\" Clicked=\"{closeDevMenu}\" />\n\t\t\t</ClientPanel>\n\t\t</WhileTrue>\n\t\t<ClientPanel>\n\t\t\t<StackPanel Alignment=\"Bottom\">\n\t\t\t\t<Notification Text=\"Shake to open Preview Menu\">\n\t\t\t\t\t<ShakeIcon Width=\"28\" Height=\"41\" />\n\t\t\t\t</Notification>\n\t\t\t\t<WhileTrue Value=\"{hasError}\">\n\t\t\t\t\t<Notification NotDone=\"{hasError}\" Text=\"An error occured, see fuse X (studio) for info.\">\n\t\t\t\t\t\t<AlertCircle Width=\"22\" Height=\"22\" />\n\t\t\t\t\t</Notification>\n\t\t\t\t</WhileTrue>\n\t\t\t</StackPanel>\n\t\t</ClientPanel>\n\t\t<Fuse.Simulator.SimulatorViewHost ux:Name=\"simulatorHost\" SimulatorId=\"{id}\" />\n\t</Panel>\n</Page>"
  },
  {
    "path": "src/preview/app/Pages/CodePage.ux",
    "content": "<Page ux:Class=\"CodePage\">\n\t<JavaScript>\n\t\tvar Observable = require(\"FuseJS/Observable\");\n\t\tvar proxyState = require('ProxyState');\n\t\t\n\t\tvar code = Observable(\"\");\n\t\tvar errorMessage = new Observable(\"\");\n\n\t\tvar proxy = null;\n\t\tfunction connectToHost(code) {\n\t\t\tproxy = proxyState.getProxy();\n\t\t\tproxy.connectToHost(code.toUpperCase())\n\t\t\t\t.then(function(simulator) {\n\t\t\t\t\tclearState();\n\t\t\t\t\trouter.goto(\"appViewPage\", { simulatorId: simulator.id });\n\t\t\t\t})\n\t\t\t\t.catch(function(error) {\n\t\t\t\t\terrorMessage.value = error;//\"Connection to the host failed because: '\" + error + \"'.\\nThe code was incorrect or make sure fuse X (studio) is running on your computer\";\n\t\t\t\t});\n\t\t}\n\n\t\tcode.map(function(c) { return c.length == 5; })\n\t\t\t.onValueChanged(module, function(item) {\n\t\t\t\terrorMessage.value = \"\";\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\tconnectToHost(code.value);\n\t\t\t\t}\n\t\t\t});\n\n\t\tfunction clearState() {\n\t\t\tcode.value = \"\";\n\t\t\terrorMessage.value = \"\";\n\t\t\tif(proxy != null)\n\t\t\t\tproxy.disconnect();\n\t\t}\n\n\t\tmodule.exports = {\n\t\t\tcode: code,\n\t\t\tsync: function() {\n\t\t\t\tconnectToHost(code.value);\n\t\t\t},\n\t\t\terrorMessage: errorMessage,\n\t\t\tisError : errorMessage.map(function(e) { return e != \"\" && e != null; }),\n\t\t\tclearState: clearState\n\t\t};\n\t</JavaScript>\n\t<Router ux:Dependency=\"router\" />\n\t<Deactivated> \n\t\t<Callback Handler=\"{clearState}\" />\n\t</Deactivated>\n\t\n\t<PageContent Title=\"Code\" SubTitle=\"Enter the unique project code displayed in fuse X (studio).\">\n\t\t<DockPanel>\n\t\t\t<StackPanel Alignment=\"VerticalCenter\" >\n\t\t\t\t<SegmentedInput Label=\"Enter Code\" Code=\"{code}\" />\n\t\t\t\t<WhileFalse ux:Name=\"hideIndicator\">\n\t\t\t\t\t<WhileTrue Value=\"{isError}\">\n\t\t\t\t\t\t<ErrorView Message=\"{errorMessage}\" Margin=\"0,8,0,0\" />\n\t\t\t\t\t</WhileTrue>\n\t\t\t\t</WhileFalse>\n\t\t\t</StackPanel>\n\n\t\t\t<WhileKeyboardVisible>\n\t\t\t\t<Change showSyncButton.Value=\"false\" />\n\t\t\t\t<!--<Change hideIndicator.Value=\"true\" />-->\n\t\t\t</WhileKeyboardVisible>\n\t\t\t<WhileTrue ux:Name=\"showSyncButton\" Value=\"true\">\n\t\t\t\t<StackPanel Dock=\"Bottom\" >\n\t\t\t\t\t<BasicButton Margin=\"0,24\" Text=\"Sync\" Clicked=\"{sync}\" >\n\t\t\t\t\t\t<SyncIcon Width=\"18\" />\n\t\t\t\t\t</BasicButton>\n\t\t\t\t</StackPanel>\n\t\t\t</WhileTrue>\n\n\t\t</DockPanel>\n\t</PageContent>\n</Page>"
  },
  {
    "path": "src/preview/app/Pages/DescriptionPage.ux",
    "content": "<Page ux:Class=\"DescriptionPage\">\n\t<Panel ux:Class=\"CycleContainer\" ProgressOffset=\"0\">\n\t\t<float ux:Property=\"ProgressOffset\" />\n\t\t<Element ux:Dependency=\"FirstIcon\" ux:Binding=\"Children\" />\n\t\t<Element ux:Dependency=\"SecondIcon\" ux:Binding=\"Children\" />\n\t\t<Timeline ux:Name=\"timeline\" >\n\t\t\t<Change Target=\"FirstIcon.Opacity\">\n\t\t\t\t<Keyframe Value=\"0.0\" Time=\"0\"/>\n\t\t\t\t<Keyframe Value=\"1.0\" Time=\"0.5\"/>\n\t\t\t\t<Keyframe Value=\"1.0\" Time=\"1.0\" />\n\t\t\t\t<Keyframe Value=\"0.0\" Time=\"1.5\" />\n\t\t\t\t<Keyframe Value=\"0.0\" Time=\"2.5\" />\n\t\t\t\t<Keyframe Value=\"0.0\" Time=\"3.0\" />\n\t\t\t</Change>\n\n\t\t\t<Change Target=\"SecondIcon.Opacity\">\n\t\t\t\t<Keyframe Value=\"0.0\" Time=\"0\" />\n\t\t\t\t<Keyframe Value=\"0.0\" Time=\"1.5\" />\n\t\t\t\t<Keyframe Value=\"1.0\" Time=\"2.0\" />\n\t\t\t\t<Keyframe Value=\"1.0\" Time=\"2.5\" />\n\t\t\t\t<Keyframe Value=\"0.0\" Time=\"3.0\" />\n\t\t\t</Change>\n\t\t</Timeline>\n\t\t<WhileActive>\n\t\t\t<Cycle Target=\"timeline.Progress\" Low=\"0\" High=\"1\" Frequency=\"0.5\" Waveform=\"Sawtooth\" />\n\t\t</WhileActive>\n\t</Panel>\n\t<PageContent Title=\"Live Preview\" SubTitle=\"To connect to a project tap the &quot;Devices&quot; button in fuse X (studio). You’ll need this info to sync to your project.\">\n\t\t<ScreenShot Dock=\"Top\" Margin=\"0,40,0,0\"/>\n\t\t<Grid ColumnCount=\"2\" RowCount=\"2\" Alignment=\"VerticalCenter\">\n\t\t\t\t<StackPanel Alignment=\"Left\" ItemSpacing=\"12\">\n\t\t\t\t\t<StackPanel Height=\"25\" Orientation=\"Horizontal\" ItemSpacing=\"12\">\n\t\t\t\t\t\t<QRCodeIcon />\n\t\t\t\t\t\t<Text Alignment=\"Center\" Color=\"DefaultText\" Value=\"Scan QR code\" />\n\t\t\t\t\t</StackPanel>\n\t\t\t\t\t<Clicked>\n\t\t\t\t\t\t<GoForward />\n\t\t\t\t\t</Clicked>\n\t\t\t\t</StackPanel>\n\n\t\t\t\t<StackPanel Alignment=\"Right\" ItemSpacing=\"12\">\n\t\t\t\t\t<StackPanel Height=\"25\" Orientation=\"Horizontal\" ItemSpacing=\"12\">\n\t\t\t\t\t\t<Text Alignment=\"Center\" Color=\"DefaultText\" Value=\"Manual setup\" />\n\t\t\t\t\t\t<ManualSetupIcon />\n\t\t\t\t\t</StackPanel>\n\t\t\t\t\t<Clicked>\n\t\t\t\t\t\t<GoBack />\n\t\t\t\t\t</Clicked>\n\t\t\t\t</StackPanel>\n\n\t\t\t\t<CycleContainer Row=\"1\" ColumnSpan=\"2\" Alignment=\"Center\" FirstIcon=\"rightIcon\" SecondIcon=\"leftIcon\" Margin=\"12,12\">\n\t\t\t\t\t<SwipeRightIcon ux:Name=\"rightIcon\" ux:AutoBind=\"false\" />\n\t\t\t\t\t<SwipeLeftIcon ux:Name=\"leftIcon\" ux:AutoBind=\"false\" />\n\t\t\t\t</CycleContainer>\n\t\t\t</Grid>\n\t</PageContent>\n</Page>\t"
  },
  {
    "path": "src/preview/app/Pages/ErrorPage.ux",
    "content": "<Page ux:Class=\"ErrorPage\">\n\t<Router ux:Dependency=\"router\" />\n\n\t<JavaScript>\n\t\tvar simulatorAPI = require('SimulatorAPI');\n\n\t\tvar errorMessage = this.Parameter.map(function(param) {\n\t\t\treturn param.errorMessage;\n\t\t});\n\n\t\tvar simulatorId = this.Parameter.map(function(param) {\n\t\t\treturn param.simulatorId;\n\t\t});\n\n\t\tvar currentSimId = -1;\n\t\tsimulatorId.onValueChanged(module, function(simId) {\n\t\t\tcurrentSimId = simId;\n\t\t});\n\n\t\tfunction restart() {\n\t\t\tsimulatorAPI.restartProjectRuntime(currentSimId)\n\t\t\t\t.then(function(newSimId) {\n\t\t\t\t\trouter.goto(\"appViewPage\", { simulatorId: newSimId });\n\t\t\t\t})\n\t\t\t\t.catch(function(error) {\n\t\t\t\t\trouter.goto(\"setupPage\");\n\t\t\t\t});\n\t\t};\n\n\t\treturn module.exports = {\n\t\t\terrorMessage: errorMessage,\n\t\t\trestart: restart\n\t\t};\n\t</JavaScript>\n\n\t<Android.StatusBarConfig Color=\"BG\" IsVisible=\"True\" />\n\t<iOS.StatusBarConfig Style=\"Light\" Animation=\"Slide\" IsVisible=\"True\" />\n\t<ClientPanel>\n\t\t<PageContent Title=\"Error\">\n\t\t\t<ErrorView Alignment=\"Top\" Message=\"{errorMessage}\" />\n\t\t\t<BasicButton Text=\"Restart\" Dock=\"Bottom\" Clicked=\"{restart}\" Margin=\"0,16\" />\n\t\t</PageContent>\n\t</ClientPanel>\n</Page>"
  },
  {
    "path": "src/preview/app/Pages/OpenPage.ux",
    "content": "<Page ux:Class=\"OpenPage\">\n\t<UserEvent ux:Name=\"OnConnectedEvent\"/>\n\t<OnUserEvent ux:Class=\"OnConnected\" EventName=\"OnConnectedEvent\"/>\n\t<JavaScript>\n\t\tvar Observable = require('FuseJS/Observable');\n\t\tvar simulatorAPI = require('SimulatorAPI');\n\t\tvar proxyState = require('ProxyState');\n\t\tvar environment = require('FuseJS/Environment')\n\n\t\tvar platformInfo = {\n\t\t\tandroid: environment.android,\n\t\t\tiOS: environment.iOS,\n\t\t\tmobile: environment.mobile\n\t\t}\n\n\t\tvar ipAddress = Observable(\"\");\n\t\tvar errorMessage = Observable(\"\");\n\t\tvar hasConnected = Observable(false);\n\n\t\tfunction onConnect() {\n\t\t\terrorMessage.value = \"\";\n\t\t\tisBusy.activate();\n\t\t\tsimulatorAPI\n\t\t\t\t.connectToProxy(ipAddress.value)\n\t\t\t\t.then(onConnected)\n\t\t\t\t.catch(function(error) {\n\t\t\t\t\tif(hasConnected.value) return;\n\n\t\t\t\t\terrorMessage.value = error + \".\\nMake sure the IP address is correct and try again\"\n\t\t\t\t\tisBusy.deactivate();\n\t\t\t\t});\n\t\t}\n\n\t\tfunction onConnected(proxy) {\n\t\t\tif(hasConnected.value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thasConnected.value = true;\n\n\t\t\tisBusy.deactivate();\n\t\t\tproxyState.setProxy(proxy);\n\t\t\tOnConnectedEvent.raise();\n\t\t}\n\n\n\t\tfunction clearState() {\n\t\t\terrorMessage.value = \"\";\n\t\t\thasConnected.value = false;\n\t\t}\n\n\t\tmodule.exports = {\n\t\t\tipAddress: ipAddress,\n\t\t\tonConnect: onConnect,\n\t\t\terrorMessage: errorMessage,\n\t\t\tisError : errorMessage.map(function(e) { return e != \"\" && e != null; }),\n\t\t\tclearState: clearState,\n\t\t\tenvironment: platformInfo\n\t\t};\n\t</JavaScript>\n\n\t<WhileInactive>\n\t\t<Callback Handler=\"{clearState}\" />\n\t</WhileInactive>\n\n\t<Panel ux:Class=\"MyLoadingIndicator\" ThemeColor=\"#1565C0\">\n\t\t<float4 ux:Property=\"ThemeColor\" />\n\t\t<Circle ux:Name=\"rotatingStroke\" Opacity=\"0.4\" Width=\"50\" Height=\"50\" StartAngleDegrees=\"-45\" EndAngleDegrees=\"45\">\n\t\t\t<Stroke Width=\"2\" Color=\"{ReadProperty ThemeColor}\" />\n\t\t</Circle>\n\t\t<Circle Color=\"{ReadProperty ThemeColor}\" Width=\"20\" Height=\"20\">\n\t\t\t<Timeline ux:Name=\"myTimeline\">\n\t\t\t\t<Scale Factor=\".5\" Duration=\".25\" Easing=\"CircularOut\" EasingBack=\"CircularIn\" />\n\t\t\t\t<Scale Factor=\"2\" Duration=\".25\" Delay=\".25\" Easing=\"BounceOut\" EasingBack=\"BounceIn\" />\n\t\t\t</Timeline>\n\t\t</Circle>\n\t\t<WhileFalse>\n\t\t\t<Cycle Target=\"myTimeline.TargetProgress\" Low=\"0\" High=\"1\" Frequency=\".5\" />\n\t\t\t<Spin Target=\"rotatingStroke\" Frequency=\"1\" />\n\t\t</WhileFalse>\n\t</Panel>\n\n\t<PageContent Title=\"Manual connection\" SubTitle=\"Enter the IP address of the computer running fuse X (studio)\">\n\t\t<DockPanel Dock=\"Fill\" >\n\t\t\t<Panel>\n\t\t\t\t<StackPanel Alignment=\"VerticalCenter\">\n\t\t\t\t\t<Rectangle CornerRadius=\"4\" >\n\t\t\t\t\t\t<Stroke Width=\"1\" Color=\"HintGrey\" ux:Name=\"boxStroke\"/>\n\t\t\t\t\t\t<!-- Use a different InputHint on Android. iOS doesn't give the user . in Phone -->\n\t\t\t\t\t\t<Android>\n\t\t\t\t\t\t\t<TextInput ux:Name=\"androidInput\" AutoCorrectHint=\"Disabled\" Height=\"60\" Value=\"{ipAddress}\" Margin=\"16,0,0,0\"  TextColor=\"Highlight\" FontSize=\"20\" PlaceholderColor=\"HintGrey\" InputHint=\"Phone\" PlaceholderText=\"eg: 127.0.0.1\" CaretColor=\"Highlight\">\n\t\t\t\t\t\t\t\t<WhileFocused>\n\t\t\t\t\t\t\t\t\t<Change boxStroke.Color=\"FocusedText\"/>\n\t\t\t\t\t\t\t\t</WhileFocused>\n\t\t\t\t\t\t\t\t<Activated>\n\t\t\t\t\t\t\t\t\t<GiveFocus Target=\"androidInput\"/>\n\t\t\t\t\t\t\t\t</Activated>\n\t\t\t\t\t\t\t</TextInput>\n\t\t\t\t\t\t</Android>\n\t\t\t\t\t\t<!-- Default InputHint for iOS and preview -->\n\t\t\t\t\t\t<WhileFalse Value=\"{environment.android}\">\n\t\t\t\t\t\t\t<TextInput ux:Name=\"commonInput\" AutoCorrectHint=\"Disabled\" Height=\"60\" Value=\"{ipAddress}\" Margin=\"16,0,0,0\" TextColor=\"Highlight\" FontSize=\"20\" PlaceholderColor=\"HintGrey\" InputHint=\"Decimal\" PlaceholderText=\"eg: 127.0.0.1\" CaretColor=\"Highlight\">\n\t\t\t\t\t\t\t\t<WhileFocused>\n\t\t\t\t\t\t\t\t\t<Change boxStroke.Color=\"FocusedText\"/>\n\t\t\t\t\t\t\t\t</WhileFocused>\n\t\t\t\t\t\t\t\t<Activated>\n\t\t\t\t\t\t\t\t\t<GiveFocus Target=\"commonInput\"/>\n\t\t\t\t\t\t\t\t</Activated>\n\t\t\t\t\t\t\t</TextInput>\n\t\t\t\t\t\t</WhileFalse>\n\t\t\t\t\t</Rectangle>\n\t\t\t\t\t<Panel>\n\t\t\t\t\t\t<Busy ux:Name=\"isBusy\" IsActive=\"false\" />\n\t\t\t\t\t\t<WhileKeyboardVisible>\n\t\t\t\t\t\t\t<Change hideIndicator.Value=\"true\" />\n\t\t\t\t\t\t</WhileKeyboardVisible>\n\t\t\t\t\t\t<WhileFalse ux:Name=\"hideIndicator\">\n\t\t\t\t\t\t\t<WhileFalse Value=\"{isError}\">\n\t\t\t\t\t\t\t\t<WhileBusy>\n\t\t\t\t\t\t\t\t\t<MyLoadingIndicator ux:Name=\"loadingPanel\" ThemeColor=\"Highlight\" Margin=\"16\" />\n\t\t\t\t\t\t\t\t\t<!-- <Change loadingPanel.Opacity=\"1\" Duration=\".4\" /> -->\n\t\t\t\t\t\t\t\t</WhileBusy>\n\t\t\t\t\t\t\t</WhileFalse>\n\t\t\t\t\t\t\t<!--Error box TODO: clear errors -->\n\t\t\t\t\t\t\t<WhileTrue Value=\"{isError}\">\n\t\t\t\t\t\t\t\t<ErrorView Message=\"{errorMessage}\" Margin=\"0,16,0,0\" />\n\t\t\t\t\t\t\t</WhileTrue>\n\t\t\t\t\t\t</WhileFalse>\n\t\t\t\t\t</Panel>\n\t\t\t\t</StackPanel>\n\t\t\t</Panel>\n\t\t\t<StackPanel Dock=\"Bottom\">\n\t\t\t\t<BasicButton Margin=\"0,24\" Clicked=\"{onConnect}\" Text=\"Connect\">\n\t\t\t\t\t<ConnectIcon Width=\"18\" />\n\t\t\t\t</BasicButton>\n\t\t\t</StackPanel>\n\t\t</DockPanel>\n\n\t</PageContent>\n</Page>\n"
  },
  {
    "path": "src/preview/app/Pages/ProjectsPage.ux",
    "content": "<Page ux:Class=\"ProjectsPage\">\n\t<Router ux:Dependency=\"router\" />\n\t<JavaScript>\n\t\tvar projects = require('Projects');\n\t\tvar simulatorAPI = require('SimulatorAPI');\n\n\t\tfunction requestPortrait() {\n\t\t\tsimulatorAPI.requestScreenOrientation(\"Portrait\");\n\t\t}\n\n\t\tfunction openProject() {\n\t\t\trouter.push(\"openProject\");\n\t\t}\n\n\t\tfunction openRecentProject(item) {\n\t\t\tsimulatorAPI.openProject(item.data.id)\n\t\t\t\t.then(function(simulator) {\n\t\t\t\t\trouter.push(\"appViewPage\", { simulatorId: simulator.id });\n\t\t\t\t})\n\t\t\t\t.catch(function(error) {\n\t\t\t\t});\n\t\t}\n\n\t\tmodule.exports = {\n\t\t\tprojects: projects.getProjects(),\n\t\t\topenProject: openProject,\n\t\t\topenRecentProject: openRecentProject,\n\t\t\trequestPortrait: requestPortrait\n\t\t};\n\t</JavaScript>\n\t<Activated Handler=\"{requestPortrait}\" />\n\t<Android.StatusBarConfig Color=\"BG\" IsVisible=\"True\" />\n\t<iOS.StatusBarConfig Style=\"Light\" Animation=\"Slide\" IsVisible=\"True\" />\n\t<ClientPanel>\n\t\t<PageContent Title=\"Live Preview\" SubTitle=\"To connect to a project tap the &quot;Devices&quot; button in fuse X (studio). You’ll need this info to sync to your project.\">\n\t\t\t<ScreenShot Dock=\"Top\"  Margin=\"0,40,0,0\"/>\n\t\t\t<BasicButton Clicked=\"{openProject}\" Dock=\"Bottom\" Text=\"Get started\" Margin=\"0,16,0,24\" /> <!-- Change Dock to Dock=\"Top\" when recent projects are enabled-->\n\t\t</PageContent>\n\t</ClientPanel>\n</Page>"
  },
  {
    "path": "src/preview/app/Pages/QRCodePage.ux",
    "content": "<Page ux:Class=\"QRCodePage\">\n\t<Router ux:Dependency=\"router\" />\n\n\t<JavaScript>\n\t\tvar Observable = require('FuseJS/Observable');\n\t\tvar simulatorAPI = require('SimulatorAPI');\n\t\tvar Permissions = require(\"BarcodeScanner/Permissions\");\n\t\tvar environment = require('FuseJS/Environment');\n\t\tvar showBarcode = new Observable(true);\n\t\tvar errorMessage = new Observable(\"\");\n\n\t\tvar BarcodeScanner = barcodeScanner;\n\n\t\tBarcodeScanner.onCodeScanned(result => {\n\t\t\tif(!environment.mobile)\n\t\t\t{\n\t\t\t\terrorMessage.value = 'Unsupported platform';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\terrorMessage.value = '';\n\t\t\tvar lines = result.split('\\n');\n\t\t\tvar addresses = lines.slice(0,lines.length-1);\n\t\t\tvar code = lines[lines.length-1].split(\"Code:\")[1];\n\t\t\tisBusy.activate();\n\t\t\tstopQrCode();\n\t\t\tsimulatorAPI\n\t\t\t\t.connectToProxy(addresses)\n\t\t\t\t.then(function(proxy) {\n\t\t\t\t\tproxy.connectToHost(code.toUpperCase())\n\t\t\t\t\t\t.then(function(simulator) {\n\t\t\t\t\t\t\tisBusy.deactivate();\n\t\t\t\t\t\t\trouter.goto(\"appViewPage\", { simulatorId: simulator.id });\n\t\t\t\t\t\t})\n\t\t\t\t.catch(function(error) {\n\t\t\t\t\terrorMessage.value = error;\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(function(error) {\n\t\t\t\terrorMessage.value = error + \"\\nMake sure the IP address is correct and try again\"\n\t\t\t\tisBusy.deactivate();\n\t\t\t});\n\t\t})\n\n\t\tfunction startQrCode() {\n\t\t\tif(!environment.mobile)\n\t\t\t{\n\t\t\t\terrorMessage.value = 'Unsupported platform';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tPermissions.requrestCamera().then(() => {\n\t\t\t\terrorMessage.value = '';\n\t\t\t\tshowBarcode.value = true;\n\t\t\t\tBarcodeScanner\n\t\t\t\t\t.start()\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tconsole.log(\"Barcode scanner started\")\n\t\t\t\t\t})\n\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\terrorMessage.value = \"Failed to start barcode scanner: \" + err\n\t\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\terrorMessage.value = \"Failed to acquire camera permission: \" + err\n\t\t\t})\n\t\t}\n\n\t\tfunction stopQrCode() {\n\t\t\tif(!environment.mobile)\n\t\t\t{\n\t\t\t\terrorMessage.value = 'Unsupported platform';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\terrorMessage.value = '';\n\t\t\tshowBarcode.value = false;\n\t\t\tBarcodeScanner\n\t\t\t\t.stop()\n\t\t\t\t.then(() => console.log(\"Barcode scanner stopped\"))\n\t\t\t\t.catch(err => errorMessage.value = \"Failed to stop barcode scanner: \" + err);\n\t\t}\n\n\t\tmodule.exports = {\n\t\t\terrorMessage: errorMessage,\n\t\t\tstartQrCode: startQrCode,\n\t\t\tstopQrCode: stopQrCode,\n\t\t\tshowBarcode: showBarcode\n\t\t};\n\t</JavaScript>\n\t<PageContent Title=\"Scan QR code\" SubTitle=\"Ensure camera permissions are granted.\">\n\t\t<Busy ux:Name=\"isBusy\" IsActive=\"false\" />\n\t\t<WhileString Value=\"{errorMessage}\" Test=\"IsNotEmpty\">\n\t\t\t<ErrorView Message=\"{errorMessage}\" Margin=\"0,16,0,0\" Dock=\"Bottom\"/>\n\t\t\t<BasicButton Text=\"Scan QR code\" Clicked=\"{startQrCode}\">\n\t\t\t\t<QRCodeIconWhite />\n\t\t\t</BasicButton>\n\t\t</WhileString>\n\t\t<WhileString Value=\"{errorMessage}\" Test=\"IsEmpty\">\n\t\t\t<WhileBusy>\n\t\t\t\t<MyLoadingIndicator ux:Name=\"loadingPanel\" ThemeColor=\"Highlight\" Margin=\"16\" />\n\t\t\t</WhileBusy>\n\t\t</WhileString>\n\t\t<NativeViewHost ux:Name=\"barcodeContainer\" Dock=\"Fill\" Margin=\"0,16,0,0\" Visibility=\"Collapsed\">\n\t\t\t<BarcodeScanner ux:Name=\"barcodeScanner\" />\n\t\t</NativeViewHost>\n\t\t<WhileTrue Value=\"{showBarcode}\">\n\t\t\t<Change barcodeContainer.Visibility=\"Visible\" />\n\t\t</WhileTrue>\n\t</PageContent>\n\t<Deactivated>\n\t\t<Callback Handler=\"{stopQrCode}\"/>\n\t</Deactivated>\n\t<Activated>\n\t\t<Callback Handler=\"{startQrCode}\"/>\n\t</Activated>\n</Page>"
  },
  {
    "path": "src/preview/app/Pages/SetupPage.ux",
    "content": "<Page ux:Class=\"SetupPage\">\n\t<Router ux:Dependency=\"router\" />\n\t<JavaScript>\n\t\tvar projects = require('Projects');\n\t\tvar simulatorAPI = require('SimulatorAPI');\n\n\t\tfunction requestPortrait() {\n\t\t\tsimulatorAPI.requestScreenOrientation(\"Portrait\");\n\t\t}\n\n\t\tmodule.exports = {\n\t\t\tprojects: projects.getProjects(),\n\t\t\trequestPortrait: requestPortrait\n\t\t};\n\t</JavaScript>\n\t<Activated Handler=\"{requestPortrait}\" />\n\t<Android.StatusBarConfig Color=\"BG\" IsVisible=\"True\" />\n\t<iOS.StatusBarConfig Style=\"Light\" Animation=\"Slide\" IsVisible=\"True\" />\n\n\t<ClientPanel>\n\t\t<AttractorConfig Unit=\"Normalized\" Easing=\"CircularInOut\" Duration=\"0.4\" ux:Global=\"asNormalized\" />\n\n\t\t<DockPanel>\n\t\t\t<ManualSetupPageIndicator Dock=\"Bottom\" ux:Name=\"pageIndicator\" Progress=\"attract({Property pageControl.ActiveIndex} - 2, asNormalized)\" Opacity=\"0\">\n\t\t\t\t<WhileTrue Value=\"{Property pageControl.ActiveIndex} > 1\">\n\t\t\t\t\t<Change pageIndicator.Opacity=\"1\" Duration=\"0.2\"/>\n\t\t\t\t</WhileTrue>\n\t\t\t</ManualSetupPageIndicator>\n\n\t\t\t<PageControl ux:Name=\"pageControl\" Active=\"firstPage\">\n\t\t\t\t<QRCodePage ux:Name=\"qrCodePage\" router=\"router\"/>\n\t\t\t\t<DescriptionPage ux:Name=\"firstPage\"/>\n\t\t\t\t<OpenPage ux:Name=\"manualSetupPage\">\n\t\t\t\t\t<WhileActive>\n\t\t\t\t\t\t<Change pageControl.AllowedSwipeDirections=\"Forward\"/>\n\t\t\t\t\t</WhileActive>\n\t\t\t\t\t<OnConnected>\n\t\t\t\t\t\t<GoBack/>\n\t\t\t\t\t</OnConnected>\n\t\t\t\t</OpenPage>\n\t\t\t\t<CodePage router=\"router\" />\n\t\t\t</PageControl>\n\t\t</DockPanel>\n\t</ClientPanel>\n</Page>"
  },
  {
    "path": "src/preview/app/Projects.js",
    "content": "var Observable = require('FuseJS/Observable');\nvar simulatorAPI = require('SimulatorAPI');\n\nvar projects = new Observable();\nsimulatorAPI.listenForRecentProjects(function(projs) {\n\tprojects.replaceAll(projs);\n});\n\nmodule.exports = {\n\tgetProjects: function() {\n\t\treturn projects;\n\t}\n};"
  },
  {
    "path": "src/preview/app/ProxyState.js",
    "content": "var globalProxy = null;\n\nmodule.exports = {\n\tgetProxy: function() {\n\t\treturn globalProxy;\n\t},\n\tsetProxy: function(proxy) {\n\t\tglobalProxy = proxy;\n\t}\n};"
  },
  {
    "path": "src/preview/app/Resources.ux",
    "content": "<Panel ux:Class=\"Resources\">\n\t<Panel>\n\t\t<float4 ux:Global=\"Highlight\" ux:Value=\"#4953d7\" />\n\t\t<float4 ux:Global=\"HighlightBG\" ux:Value=\"#4953d7\" />\n\t\t<float4 ux:Global=\"HighlightText\" ux:Value=\"#4953d7\" />\n\t\t<float4 ux:Global=\"DefaultText\" ux:Value=\"#808080\" />\n\t\t<float4 ux:Global=\"HintGrey\" ux:Value=\"#7f7f7f\" />\n\t\t<float4 ux:Global=\"LightGrey\" ux:Value=\"#cccccc\" />\n\t\t<float4 ux:Global=\"FocusedText\" ux:Value=\"#e6e6e6\" />\n\t\t<float4 ux:Global=\"BG\" ux:Value=\"#15191e\" />\n\t</Panel>\n\t\n\n\t<!--- Images -->\n\t<Image ux:Class=\"AlertCircle\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/alert-circle.png\"/>\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/alert-circle@2x.png\"/>\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/alert-circle@3x.png\"/>\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image ux:Class=\"ScreenShot\" Width=\"176\" Height=\"100\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/Studio-Devices-Button.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/Studio-Devices-Button@2x.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/Studio-Devices-Button@3x.png\" />\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image ux:Class=\"SyncIcon\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/sync-icon.png\"/>\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/sync-icon@2x.png\"/>\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/sync-icon@3x.png\"/>\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image ux:Class=\"ConnectIcon\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/connect-icon.png\"/>\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/connect-icon@2x.png\"/>\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/connect-icon@3x.png\"/>\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Panel ux:Class=\"CrossIcon\">\n\t\t<Rectangle Color=\"DefaultText\" Height=\"2\" Width=\"16\" CornerRadius=\"4\">\n\t\t\t<Rotation Degrees=\"45\"/>\n\t\t</Rectangle>\n\t\t<Rectangle Color=\"DefaultText\" Height=\"2\" Width=\"16\" CornerRadius=\"4\">\n\t\t\t<Rotation Degrees=\"-45\"/>\n\t\t</Rectangle>\n\t</Panel>\n\n\t<Image ux:Class=\"ShakeIcon\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/shake.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/shake@2x.png\" />\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/shake@3x.png\" />\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image Height=\"20\" ux:Class=\"ManualSetupIcon\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/Manual.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/Manual@2x.png\" />\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/Manual@3x.png\" />\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image Width=\"25\" Height=\"25\" ux:Class=\"QRCodeIcon\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/QR-Code.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/QR-Code@2x.png\" />\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/QR-Code@3x.png\" />\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image Width=\"25\" Height=\"25\" ux:Class=\"QRCodeIconWhite\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/QR-Code-White.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/QR-Code-White@2x.png\" />\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/QR-Code-White@3x.png\" />\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image Width=\"30\" Height=\"31\" ux:Class=\"SwipeLeftIcon\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/Swipe-Left.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/Swipe-Left@2x.png\" />\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/Swipe-Left@3x.png\" />\n\t\t</MultiDensityImageSource>\n\t</Image>\n\n\t<Image Width=\"30\" Height=\"31\" ux:Class=\"SwipeRightIcon\">\n\t\t<MultiDensityImageSource>\n\t\t\t<FileImageSource Density=\"1\" File=\"Assets/Swipe-Right.png\" />\n\t\t\t<FileImageSource Density=\"2\" File=\"Assets/Swipe-Right@2x.png\" />\n\t\t\t<FileImageSource Density=\"3\" File=\"Assets/Swipe-Right@3x.png\" />\n\t\t</MultiDensityImageSource>\n\t</Image>\n</Panel>\n"
  },
  {
    "path": "src/preview/app/ShakeRecognizer.js",
    "content": "var accelerometer = require(\"Accelerometer\");\nvar Observable = require('FuseJS/Observable');\nvar rx = require('rx.all');\n\nfunction add(a,b) {\n\treturn a + b;\n}\n\nfunction ShakeRecognizer() {\n\tthis.shaked = new Observable(false); \n\tthis.sampleData = new rx.Subject();\n\tthis.onCount = 0;\n\tthis.isStarted = false;\n\n\tvar self = this;\n\tthis.sampleData\n\t\t.scan(function(acc,x) \n\t\t{ \n\t\t\tif(acc.length >= 7)\n\t\t\t\tacc.shift();\n\t\t\tacc.push(Math.sqrt(x[1]*x[1] + x[2]*x[2]));\n\t\t\treturn acc;\n\t\t}, [])\n\t\t.subscribe(function(y) {\n\t\t\tvar avg = y.reduce(add, 0);\n\t\t\tavg /= y.length;\n\n\t\t\tvar variance = y.map(function(a) { return (a-avg)*(a-avg); })\n\t\t\t\t.reduce(add, 0);\n\t\t\tvariance /= y.length;\n\n\t\t\tif(variance > 70. && !self.shaked.value)\n\t\t\t\tself.shaked.value = true;\n\t\t\telse\n\t\t\t\tself.shaked.value = false;\n\t\t});\n\n\taccelerometer.on(\"update\", function(time, x, y, z) {\n\t\tself.sampleData.onNext([time,x,y,z]);\n\t});\n}\n\nShakeRecognizer.prototype.start = function() {\n\t++this.onCount;\n\tif(this.onCount > 1 || this.isStarted) return;\n\n\taccelerometer.start();\n\tthis.isStarted = true;\n}\n\nShakeRecognizer.prototype.stop = function() {\n\t--this.onCount;\n\tif(this.onCount > 0 || this.isStarted == false)\n\t\treturn;\n\n\taccelerometer.stop();\n\tthis.onCount = 0;\n\tthis.isStarted = false;\n}\n\nvar recognizer = new ShakeRecognizer();\nmodule.exports = recognizer;"
  },
  {
    "path": "src/preview/app/build.sh",
    "content": "#!/bin/sh\nSELF=`echo $0 | sed 's/\\\\\\\\/\\\\//g'`\ncd \"`dirname \"$SELF\"`\" || exit 1\nnpx uno build $@ -DREFLECTION -DSIMULATOR -DDESIGNER -DPREVIEW"
  },
  {
    "path": "src/preview/app/fuse-preview.unoproj",
    "content": "{\n  \"BuildCondition\": \"CPLUSPLUS || DOTNET\", // Skips building by 'uno doctor'.\n  \"Title\": \"fuse X Preview\",\n  \"Description\": \"fuse X is a development tool for creating mobile user experiences. It lets you iterate on your designs while previewing the changes in real-time on one or more mobile devices.\\n\\nNote: A computer running _fuse X_ (https://fuse-x.com/) is required in order to utilize this app. This app is merely the client for previewing the work you perform on your development computer.\",\n  \"Publisher\": \"Build & Run\",\n  \"Android\": {\n    \"Package\": \"com.fuse.preview\",\n    \"VersionCode\": 19,\n    \"Icons\": {\n      \"MDPI\": \"AppStoreAssets/Android/App Icon/ic_launcher_MDPI.png\",\n      \"HDPI\": \"AppStoreAssets/Android/App Icon/ic_launcher_HDPI.png\",\n      \"XHDPI\": \"AppStoreAssets/Android/App Icon/ic_launcher_XHDPI.png\",\n      \"XXHDPI\": \"AppStoreAssets/Android/App Icon/ic_launcher_XXHDPI.png\",\n      \"XXXHDPI\": \"AppStoreAssets/Android/App Icon/ic_launcher_XXXHDPI.png\"\n    },\n    \"Key\": {\n      \"Alias\": \"application\",\n      \"AliasPassword\": \"__REDACTED__\",\n      \"Store\": \"release.keystore\",\n      \"StorePassword\": \"__REDACTED__\"\n    },\n    \"Geo\": {\n      \"ApiKey\": \"__REDACTED__\"\n    }\n  },\n  \"iOS\": {\n    \"BundleIdentifier\": \"com.fuse.preview\",\n    \"BundleVersion\": 26,\n    \"BundleShortVersionString\": \"2.9.0\",\n    \"StatusBarStyle\": \"LightContent\",\n    \"Icons\": {\n      \"iPhone_20_2x\": \"AppStoreAssets/iOS/Icon-20@2x.png\",\n      \"iPhone_20_3x\": \"AppStoreAssets/iOS/Icon-20@3x.png\",\n      \"iPhone_29_2x\": \"AppStoreAssets/iOS/Icon-29@2x.png\",\n      \"iPhone_29_3x\": \"AppStoreAssets/iOS/Icon-29@3x.png\",\n      \"iPhone_40_2x\": \"AppStoreAssets/iOS/Icon-40@2x.png\",\n      \"iPhone_40_3x\": \"AppStoreAssets/iOS/Icon-40@3x.png\",\n      \"iPhone_60_2x\": \"AppStoreAssets/iOS/Icon-60@2x.png\",\n      \"iPhone_60_3x\": \"AppStoreAssets/iOS/Icon-60@3x.png\",\n      \"iPad_20_1x\": \"AppStoreAssets/iOS/Icon-20@2x.png\",\n      \"iPad_20_2x\": \"AppStoreAssets/iOS/Icon-20@2x.png\",\n      \"iPad_29_1x\": \"AppStoreAssets/iOS/Icon-29.png\",\n      \"iPad_29_2x\": \"AppStoreAssets/iOS/Icon-29@2x.png\",\n      \"iPad_40_1x\": \"AppStoreAssets/iOS/Icon-40.png\",\n      \"iPad_40_2x\": \"AppStoreAssets/iOS/Icon-40@2x.png\",\n      \"iPad_76_1x\": \"AppStoreAssets/iOS/Icon-76.png\",\n      \"iPad_76_2x\": \"AppStoreAssets/iOS/Icon-76@2x.png\",\n      \"iPad_83.5_2x\": \"AppStoreAssets/iOS/Icon-83.5@2x.png\",\n      \"iOS_Marketing_1024_1x\": \"AppStoreAssets/iOS/iTunesArtwork@2x.png\"\n    },\n    \"LaunchScreen\": {\n      \"BackgroundColor\": {\n        \"Red\": \"0.064908516839378261\",\n        \"Green\": \"0.064908516839378261\",\n        \"Blue\": \"0.064908516839378261\"\n      },\n      \"Image\": \"AppStoreAssets/iOS/Launch.png\",\n      \"Width\": 120,\n      \"Height\": 120\n    }\n  },\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\",\n    \"Fuse.Vibration\",\n    \"Fuse.Charting\",\n    \"Fuse.UXKits.Alive\",\n    \"Fuse.Controls.CameraView\",\n    \"Fuse.WebSockets\",\n    \"Fuse.Share\",\n    \"Fuse.Launcher\",\n    \"Fuse.Maps\",\n    \"Fuse.Camera\",\n    \"Fuse.Audio\",\n    \"Fuse.CameraRoll\",\n    \"Fuse.LocalNotifications\",\n    \"Fuse.GeoLocation\",\n    \"Fuse.Alerts\",\n    \"Fuse.Auth\",\n    \"Fuse.Sensor\",\n    \"Fuse.Preview.Core\",\n    \"BarcodeScanner\"\n  ],\n  \"Projects\": [\n    \"Fuse.Simulator/Fuse.Simulator.unoproj\"\n  ],\n  \"Includes\": [\n    \"*\",\n    \"Projects.js:Bundle\",\n    \"ProxyState.js:Bundle\",\n    \"ForeignAccelerometer/AccelerometerModule.uno\",\n    \"ForeignAccelerometer/Accelerometer_Android.uno\",\n    \"ForeignAccelerometer/Accelerometer_iOS.uno\",\n    \"ForeignAccelerometer/Accelerometer.uno\",\n    \"ForeignAccelerometer/AccelerometerImpl.java:Java:Android\",\n    \"ForeignAccelerometer/AccelerometerImpl.hh:CHeader:iOS\",\n    \"ForeignAccelerometer/AccelerometerImpl.mm:CSource:iOS\",\n    \"rx.all.js:Bundle\",\n    \"FuseRX.js:Bundle\",\n    \"ShakeRecognizer.js:Bundle\"\n  ]\n}\n"
  },
  {
    "path": "src/preview/app/rx.all.js",
    "content": "/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/\n(function(a){function b(a){return a&&a.Object===Object?a:null}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a){return function(){try{return a.apply(this,arguments)}catch(b){return Za.e=b,Za}}}function e(a){throw a}function f(a,b){if(_a&&b.stack&&\"object\"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(db)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join(\"\\n\"+db+\"\\n\");a.stack=g(e)}}function g(a){for(var b=a.split(\"\\n\"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];h(f)||i(f)||!f||c.push(f)}return c.join(\"\\n\")}function h(a){var b=k(a);if(!b)return!1;var c=b[0],d=b[1];return c===bb&&d>=cb&&Gg>=d}function i(a){return-1!==a.indexOf(\"(module.js:\")||-1!==a.indexOf(\"(node.js:\")}function j(){if(_a)try{throw new Error}catch(a){var b=a.stack.split(\"\\n\"),c=b[0].indexOf(\"@\")>0?b[1]:b[2],d=k(c);if(!d)return;return bb=d[0],d[1]}}function k(a){var b=/at .+ \\((.+):(\\d+):(?:\\d+)\\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\\d+):(?:\\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(b,c,d,e,f,g){var h=Sb(b),i=h.length,j=Sb(c),k=j.length;if(i!==k&&!e)return!1;for(var l,m=i;m--;)if(l=h[m],!(e?l in c:Pb.call(c,l)))return!1;for(var n=e;++m<i;){l=h[m];var o,p=b[l],q=c[l];if(!(o===a?d(p,q,e,f,g):o))return!1;n||(n=\"constructor\"===l)}if(!n){var r=b.constructor,s=c.constructor;if(r!==s&&\"constructor\"in b&&\"constructor\"in c&&!(\"function\"==typeof r&&r instanceof r&&\"function\"==typeof s&&s instanceof s))return!1}return!0}function m(a,b,c){switch(c){case sb:case tb:return+a===+b;case ub:return a.name===b.name&&a.message===b.message;case xb:return a!==+a?b!==+b:a===+b;case zb:case Bb:return a===b+\"\"}return!1}function n(a){return!!a&&\"object\"==typeof a}function o(a){return\"number\"==typeof a&&a>-1&&a%1===0&&Rb>=a}function p(a){return n(a)&&o(a.length)&&!!Nb[Qb.call(a)]}function q(a,b){for(var c=-1,d=a.length;++c<d;)if(b(a[c],c,a))return!0;return!1}function r(b,c,d,e,f,g){var h=-1,i=b.length,j=c.length;if(i!==j&&!(e&&j>i))return!1;for(;++h<i;){var k,l=b[h],m=c[h];if(k!==a){if(k)continue;return!1}if(e){if(!q(c,function(a){return l===a||d(l,a,e,f,g)}))return!1}else if(l!==m&&!d(l,m,e,f,g))return!1}return!0}function s(a,b,c,d,e,f){var g=Ub(a),h=Ub(b),i=rb,j=rb;g||(i=Qb.call(a),i===qb?i=yb:i!==yb&&(g=p(a))),h||(j=Qb.call(b),j===qb&&(j=yb));var k=i===yb&&!Tb(a),n=j===yb&&!Tb(b),o=i===j;if(o&&!g&&!k)return m(a,b,i);if(!d){var q=k&&Pb.call(a,\"__wrapped__\"),s=n&&Pb.call(b,\"__wrapped__\");if(q||s)return c(q?a.value():a,s?b.value():b,d,e,f)}if(!o)return!1;e||(e=[]),f||(f=[]);for(var t=e.length;t--;)if(e[t]===a)return f[t]===b;e.push(a),f.push(b);var u=(g?r:l)(a,b,c,d,e,f);return e.pop(),f.pop(),u}function t(a,b,c,d,e){return a===b?!0:null==a||null==b||!ba(a)&&!n(b)?a!==a&&b!==b:s(a,b,t,c,d,e)}function u(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function v(a,b){this.id=a,this.value=b}function w(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function x(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function y(a){this._s=a,this.isDisposed=!1}function z(a){this._s=a}function A(a){this._s=a,this._l=a.length,this._i=0}function B(a){this._a=a}function C(a){this._a=a,this._l=G(a),this._i=0}function D(a){return\"number\"==typeof a&&Pa.isFinite(a)}function E(b){var c,d=b[kb];if(!d&&\"string\"==typeof b)return c=new z(b),c[kb]();if(!d&&b.length!==a)return c=new B(b),c[kb]();if(!d)throw new TypeError(\"Object is not iterable\");return b[kb]()}function F(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function G(a){var b=+a.length;return isNaN(b)?0:0!==b&&D(b)?(b=F(b)*Math.floor(Math.abs(b)),0>=b?0:b>ld?ld:b):b}function H(a,b){return pc(a)||(a=wc),new nd(b,a)}function I(a,b){this.observer=a,this.parent=b}function J(a,b){return a.amb(b)}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function M(){return[]}function K(){return!1}function M(){return[]}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function N(a){return function(b){return a.subscribe(b)}}function O(a){return a.toArray()}function P(a){return a.length>0}function Q(a){return{\"@@iterator\":function(){return{next:function(){return{done:!1,value:a}}}}}}function Q(a){return{\"@@iterator\":function(){return{next:function(){return{done:!1,value:a}}}}}}function R(a,b,c){var d=ob(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Xa(e)&&(e=dd(e)),(nb(e)||mb(e))&&(e=md(e)),e}).concatAll()}function S(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function T(a){this.comparer=a,this.set=[]}function U(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if(\"undefined\"==typeof g)return a;e=g}return e}}function V(a){if(0===a.length)throw new eb;return a[0]}function W(a,b,c,d){var e=ob(b,c,3);return new xg(function(b){return a.subscribe(new gf(b,a,e,d))},a)}function X(a){return a?Sc.isObservable(a)?a:Xa(a)?Sc.fromPromise(a):aa(a)||_(a)?qf.call(this,a):Ya(a)?$.call(this,a):nb(a)||mb(a)?Y.call(this,a):ba(a)?Z.call(this,a):a:a}function Y(a){return Sc.from(a).concatMap(function(a){return Sc.isObservable(a)||ba(a)?X.call(null,a):Qa.Observable.just(a)}).toArray()}function Z(b){function c(b,c){d[c]=a,f.push(b.map(function(a){d[c]=a}))}for(var d=new b.constructor,e=Object.keys(b),f=[],g=0,h=e.length;h>g;g++){var i=e[g],j=X.call(this,b[i]);j&&Sc.isObservable(j)?c(j,i):d[i]=b[i]}return Sc.forkJoin.apply(Sc,f).map(function(){return d})}function $(a){var b=this;return new xg(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function _(a){return Ya(a.next)&&Ya(a[\"throw\"])}function aa(a){var b=a.constructor;return b?\"GeneratorFunction\"===b.name||\"GeneratorFunction\"===b.displayName?!0:_(b.prototype):!1}function ba(a){return Object==a.constructor}function ca(a,b,c,d){var e=new Cg;return d.push(da(e,b,c)),a.apply(b,d),e.asObservable()}function da(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(Ya(c)){if(e=$a(c).apply(b,e),e===Za)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function ea(a,b,c,d){var e=new Cg;return d.push(fa(e,b,c)),a.apply(b,d),e.asObservable()}function fa(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(Ya(c)){var f=$a(c).apply(b,f);if(f===Za)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function ga(a){return Pa.StaticNodeList?a instanceof Pa.StaticNodeList||a instanceof Pa.NodeList:\"[object NodeList]\"===Object.prototype.toString.call(a)}function ha(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function ia(a,b,c){var d=new _b,e=Object.prototype.toString.call(a);if(ga(a)||\"[object HTMLCollection]\"===e)for(var f=0,g=a.length;g>f;f++)d.add(ia(a.item(f),b,c));else a&&d.add(new ha(a,b,c));return d}function ja(a,b,c){return new xg(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(Sa))){if(f)return d.onError(f);var e=$a(c).apply(null,j);if(e===Za)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new jc(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function O(a){return a.toArray()}function ka(a,b){return a.groupJoin(this,b,jd,function(a,b){return b})}function la(a){var b=this;return new xg(function(c){var d=new Bg,e=new _b,f=new lc(e);return c.onNext(Yb(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Xa(a)&&(a=dd(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Bg,c.onNext(Yb(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ma(a){var b=this;return new xg(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Xa(b)&&(b=dd(b));var i=new hc;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Ra,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Bg,c.onNext(Yb(h,g)),d()}))}var e=new ic,f=new _b(e),g=new lc(f),h=new Bg;return c.onNext(Yb(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function na(a,b){return new Hf(a,b)}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function oa(a){this.patterns=a}function pa(a,b){this.expression=a,this.selector=b}function qa(a){return function(b){a.onError(b)}}function ra(a,b){return function(){var c=$a(a.selector).apply(a,arguments);return c===Za?b.onError(c.e):void b.onNext(c)}}function sa(a,b,c){var d=a.get(b);if(!d){var e=new Pf(b,c);return a.set(b,e),e}return d}function ta(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new Of;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function ua(a,b){return new Qf(a,b)}function va(a,b,c){return new xg(function(d){var e=a,f=oc(b);return c.scheduleRecursiveFuture(0,e,function(a,b){if(f>0){var g=c.now();e=new Date(e.getTime()+f),e.getTime()<=g&&(e=new Date(g+f))}d.onNext(a),b(a+1,new Date(e))})})}function wa(a,b,c){return a===b?new xg(function(a){return c.schedulePeriodic(0,b,function(b){return a.onNext(b),b+1})}):gd(function(){return va(new Date(c.now()+a),b,c)})}function xa(a,b,c){return new xg(function(d){var e,f=!1,g=new ic,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;\"E\"===a.value.kind?(i=[],i.push(a),h=a.value.error,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new hc,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveFuture(null,b,function(a,b){var e,g,k,l;if(null===h){j=!0;do k=null,i.length>0&&i[0].timestamp-c.now()<=0&&(k=i.shift().value),null!==k&&k.accept(d);while(null!==k);l=!1,g=0,i.length>0?(l=!0,g=Math.max(0,i[0].timestamp-c.now())):f=!1,e=h,j=!1,null!==e?d.onError(e):l&&b(null,g)}}))))}),new jc(e,g)},a)}function ya(a,b,c){return gd(function(){return xa(a,b-c.now(),c)})}function za(a,b,c){var d,e;return Ya(b)?e=b:(d=b,e=c),new xg(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=$a(e)(a);if(c===Za)return b.onError(c.e);var d=new hc;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new _b,h=!1,i=new ic;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new jc(i,g)},a)}function Aa(a,b){return new xg(function(c){var d,e=!1,f=new ic,g=0,h=a.subscribe(function(a){var h=$a(b)(a);if(h===Za)return c.onError(h.e);Xa(h)&&(h=dd(h)),e=!0,d=a,g++;var i=g,j=new hc;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new jc(h,f)},a)}function O(a){return a.toArray()}function O(a){return a.toArray()}function Ba(a,b,c,d){return Ya(b)&&(d=c,c=b,b=sd()),Sc.isObservable(d)||(d=yd(new _f)),new xg(function(e){function f(a){function b(){return l=c===k}var c=k,f=new hc;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(d.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new ic,i=new ic,j=new hc;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=$a(c)(a);if(b===Za)return e.onError(b.e);f(Xa(b)?dd(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new jc(h,i)},a)}function Ca(a,b,c,d){return pc(c)&&(d=c,c=yd(new _f)),c instanceof Error&&(c=yd(c)),pc(d)||(d=Bc),Sc.isObservable(c)||(c=yd(new _f)),new xg(function(e){function f(){var a=g;k.setDisposable(d.scheduleFuture(null,b,function(){j=g===a,j&&(Xa(c)&&(c=dd(c)),i.setDisposable(c.subscribe(e)))}))}var g=0,h=new hc,i=new ic,j=!1,k=new ic;return i.setDisposable(h),f(),h.setDisposable(a.subscribe(function(a){j||(g++,e.onNext(a),f())},function(a){j||(g++,e.onError(a))},function(){j||(g++,e.onCompleted())})),new jc(i,k)},a)}function Da(a){return{\"@@transducer/init\":function(){return a},\"@@transducer/step\":function(a,b){return a.onNext(b)},\"@@transducer/result\":function(a){return a.onCompleted()}}}function Ea(a){this.predicate=a}function Fa(a){this.predicate=a}function Ga(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return dc})}(g)}}var Ha={\"function\":!0,object:!0},Ia=Ha[typeof exports]&&exports&&!exports.nodeType?exports:null,Ja=Ha[typeof module]&&module&&!module.nodeType?module:null,Ka=b(Ia&&Ja&&\"object\"==typeof global&&global),La=b(Ha[typeof self]&&self),Ma=b(Ha[typeof window]&&window),Na=Ja&&Ja.exports===Ia?Ia:null,Oa=b(Ha[typeof this]&&this),Pa=Ka||Ma!==(Oa&&Oa.window)&&Ma||La||Oa||Function(\"return this\")(),Qa={internals:{},config:{Promise:Pa.Promise},helpers:{}},Ra=Qa.helpers.noop=function(){},Sa=Qa.helpers.identity=function(a){return a},Ta=Qa.helpers.defaultNow=Date.now,Ua=Qa.helpers.defaultComparer=function(a,b){return Vb(a,b)},Va=Qa.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Wa=(Qa.helpers.defaultKeySerializer=function(a){return a.toString()},Qa.helpers.defaultError=function(a){throw a}),Xa=Qa.helpers.isPromise=function(a){return!!a&&\"function\"!=typeof a.subscribe&&\"function\"==typeof a.then},Ya=Qa.helpers.isFunction=function(){var a=function(a){return\"function\"==typeof a||!1};return a(/x/)&&(a=function(a){return\"function\"==typeof a&&\"[object Function]\"==toString.call(a)}),a}(),Za={e:{}},$a=Qa.internals.tryCatch=function(a){if(!Ya(a))throw new TypeError(\"fn must be a function\");return d(a)};Qa.config.longStackSupport=!1;var _a=!1,ab=$a(function(){throw new Error})();_a=!!ab.e&&!!ab.e.stack;var bb,cb=j(),db=\"From previous event:\",eb=Qa.EmptyError=function(){this.message=\"Sequence contains no elements.\",Error.call(this)};eb.prototype=Object.create(Error.prototype),eb.prototype.name=\"EmptyError\";var fb=Qa.ObjectDisposedError=function(){this.message=\"Object has been disposed\",Error.call(this)};fb.prototype=Object.create(Error.prototype),fb.prototype.name=\"ObjectDisposedError\";var gb=Qa.ArgumentOutOfRangeError=function(){this.message=\"Argument out of range\",Error.call(this)};gb.prototype=Object.create(Error.prototype),gb.prototype.name=\"ArgumentOutOfRangeError\";var hb=Qa.NotSupportedError=function(a){this.message=a||\"This operation is not supported\",Error.call(this)};hb.prototype=Object.create(Error.prototype),hb.prototype.name=\"NotSupportedError\";var ib=Qa.NotImplementedError=function(a){this.message=a||\"This operation is not implemented\",Error.call(this)};ib.prototype=Object.create(Error.prototype),ib.prototype.name=\"NotImplementedError\";var jb=Qa.helpers.notImplemented=function(){throw new ib},kb=(Qa.helpers.notSupported=function(){throw new hb},\"function\"==typeof Symbol&&Symbol.iterator||\"_es6shim_iterator_\");Pa.Set&&\"function\"==typeof(new Pa.Set)[\"@@iterator\"]&&(kb=\"@@iterator\");var lb=Qa.doneEnumerator={done:!0,value:a},mb=Qa.helpers.isIterable=function(b){return b&&b[kb]!==a},nb=Qa.helpers.isArrayLike=function(b){return b&&b.length!==a};Qa.helpers.iterator=kb;var ob=Qa.internals.bindCallback=function(a,b,c){if(\"undefined\"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},pb=[\"toString\",\"toLocaleString\",\"valueOf\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"constructor\"],qb=(pb.length,\"[object Arguments]\"),rb=\"[object Array]\",sb=\"[object Boolean]\",tb=\"[object Date]\",ub=\"[object Error]\",vb=\"[object Function]\",wb=\"[object Map]\",xb=\"[object Number]\",yb=\"[object Object]\",zb=\"[object RegExp]\",Ab=\"[object Set]\",Bb=\"[object String]\",Cb=\"[object WeakMap]\",Db=\"[object ArrayBuffer]\",Eb=\"[object Float32Array]\",Fb=\"[object Float64Array]\",Gb=\"[object Int8Array]\",Hb=\"[object Int16Array]\",Ib=\"[object Int32Array]\",Jb=\"[object Uint8Array]\",Kb=\"[object Uint8ClampedArray]\",Lb=\"[object Uint16Array]\",Mb=\"[object Uint32Array]\",Nb={};Nb[Eb]=Nb[Fb]=Nb[Gb]=Nb[Hb]=Nb[Ib]=Nb[Jb]=Nb[Kb]=Nb[Lb]=Nb[Mb]=!0,Nb[qb]=Nb[rb]=Nb[Db]=Nb[sb]=Nb[tb]=Nb[ub]=Nb[vb]=Nb[wb]=Nb[xb]=Nb[yb]=Nb[zb]=Nb[Ab]=Nb[Bb]=Nb[Cb]=!1;var Ob=Object.prototype,Pb=Ob.hasOwnProperty,Qb=Ob.toString,Rb=Math.pow(2,53)-1,Sb=Object.keys||function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable(\"toString\"),c=[\"toString\",\"toLocaleString\",\"valueOf\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"constructor\"],d=c.length;return function(e){if(\"object\"!=typeof e&&(\"function\"!=typeof e||null===e))throw new TypeError(\"Object.keys called on non-object\");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}(),ba=Qa.internals.isObject=function(a){var b=typeof a;return!!a&&(\"object\"===b||\"function\"===b)},Tb=function(){try{Object({toString:0}+\"\")}catch(a){return function(){return!1}}return function(a){return\"function\"!=typeof a.toString&&\"string\"==typeof(a+\"\")}}(),Ub=Array.isArray||function(a){return n(a)&&o(a.length)&&Qb.call(a)===rb},Vb=Qa.internals.isEqual=function(a,b){return t(a,b)},Wb=({}.hasOwnProperty,Array.prototype.slice,Qa.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Xb=Qa.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Yb=Qa.internals.addRef=function(a,b){return new xg(function(c){return new jc(b.getDisposable(),a.subscribe(c))})};v.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Zb=Qa.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},$b=Zb.prototype;$b.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},$b.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},$b.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},$b.peek=function(){return this.items[0].value},$b.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},$b.dequeue=function(){var a=this.peek();return this.removeAt(0),a},$b.enqueue=function(a){var b=this.length++;this.items[b]=new v(Zb.count++,a),this.percolate(b)},$b.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Zb.count=0;var _b=Qa.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];this.disposables=c,this.isDisposed=!1,this.length=c.length},ac=_b.prototype;ac.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},ac.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},ac.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var bc=Qa.Disposable=function(a){this.isDisposed=!1,this.action=a||Ra};bc.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var cc=bc.create=function(a){return new bc(a)},dc=bc.empty={dispose:Ra},ec=bc.isDisposable=function(a){return a&&Ya(a.dispose)},fc=bc.checkDisposed=function(a){if(a.isDisposed)throw new fb},gc=bc._fixup=function(a){return ec(a)?a:dc},hc=Qa.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};hc.prototype.getDisposable=function(){return this.current},hc.prototype.setDisposable=function(a){if(this.current)throw new Error(\"Disposable has already been assigned\");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},hc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var ic=Qa.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ic.prototype.getDisposable=function(){return this.current},ic.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},ic.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var jc=Qa.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};jc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var kc=Qa.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};kc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var lc=Qa.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?dc:new a(this)},b}();w.prototype.dispose=function(){this.scheduler.schedule(this,x)};var mc=Qa.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Va,this.disposable=new hc};mc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},mc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},mc.prototype.isCancelled=function(){return this.disposable.isDisposed},mc.prototype.invokeCore=function(){return gc(this.action(this.scheduler,this.state))};var nc=Qa.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new ib},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new ib},a.now=Ta,a.prototype.now=Ta,a.normalize=function(a){return 0>a&&(a=0),a},a}(),oc=nc.normalize,pc=nc.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),dc}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new _b;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),dc}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new _b;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(nc.prototype),function(a){a.schedulePeriodic=function(a,b,c){if(\"undefined\"==typeof Pa.setInterval)throw new hb;b=oc(b);var d=a,e=Pa.setInterval(function(){d=c(d)},b);return cc(function(){Pa.clearInterval(e)})}}(nc.prototype),function(a){a.catchError=a[\"catch\"]=function(a){return new Cc(this,a)}}(nc.prototype);var qc,rc,sc=Qa.internals.SchedulePeriodicRecursive=function(){function a(a){return function(b,c){c(0,a._period);var d=$a(a._action)(a._state);d===Za&&(a._cancel.dispose(),e(d.e)),a._state=d}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new hc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a(this))),b},b}(),tc=function(a){function b(){a.call(this)}return Wb(b,a),b.prototype.schedule=function(a,b){return gc(b(this,a))},b}(nc),uc=nc.immediate=new tc,vc=function(a){function b(){for(;d.length>0;){var a=d.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var d;return Wb(c,a),c.prototype.schedule=function(a,c){var f=new mc(this,a,c,this.now());if(d)d.enqueue(f);else{d=new Zb(4),d.enqueue(f);var g=$a(b)();d=null,g===Za&&e(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!d},c}(nc),wc=nc.currentThread=new vc,xc=function(){var a,b=Ra;if(Pa.setTimeout)a=Pa.setTimeout,b=Pa.clearTimeout;else{if(!Pa.WScript)throw new hb;a=function(a,b){Pa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),yc=xc.setTimeout,zc=xc.clearTimeout;!function(){function a(b){if(f)yc(function(){a(b)},0);else{var c=d[b];if(c){f=!0;var g=$a(c)();rc(b),f=!1,g===Za&&e(g.e)}}}function b(){if(!Pa.postMessage||Pa.importScripts)return!1;var a=!1,b=Pa.onmessage;return Pa.onmessage=function(){a=!0},Pa.postMessage(\"\",\"*\"),Pa.onmessage=b,a}var c=1,d={},f=!1;rc=function(a){delete d[a]};var g=new RegExp(\"^\"+String(toString).replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\").replace(/toString| for [^\\]]+/g,\".*?\")+\"$\"),h=\"function\"==typeof(h=Ka&&Na&&Ka.setImmediate)&&!g.test(h)&&h;if(Ya(h))qc=function(b){var e=c++;return d[e]=b,h(function(){a(e)}),e};else if(\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process))qc=function(b){var e=c++;return d[e]=b,process.nextTick(function(){a(e)}),e};else if(b()){var i=\"ms.rx.schedule\"+Math.random(),j=function(b){\"string\"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))};Pa.addEventListener(\"message\",j,!1),qc=function(a){var b=c++;return d[b]=a,Pa.postMessage(i+b,\"*\"),b}}else if(Pa.MessageChannel){var k=new Pa.MessageChannel;k.port1.onmessage=function(b){a(b.data)},qc=function(a){var b=c++;return d[b]=a,k.port2.postMessage(b),b}}else qc=\"document\"in Pa&&\"onreadystatechange\"in Pa.document.createElement(\"script\")?function(b){var e=Pa.document.createElement(\"script\"),f=c++;return d[f]=b,e.onreadystatechange=function(){a(f),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},Pa.document.documentElement.appendChild(e),f}:function(b){var e=c++;return d[e]=b,yc(function(){a(e)},0),e}}();var Ac=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){a.setDisposable(bc._fixup(b(c,d)))}}function d(a){this._id=a,this.isDisposed=!1}function e(a){this._id=a,this.isDisposed=!1}function f(a,b,c){return function(){b(a,c)}}return Wb(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,rc(this._id))},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,zc(this._id))},b.prototype.schedule=function(a,b){var e=new hc,f=qc(c(e,b,this,a));return new jc(e,new d(f))},b.prototype._scheduleFuture=function(a,b,d){if(0===b)return this.schedule(a,d);var f=new hc,g=yc(c(f,d,this,a),b);return new jc(f,new e(g))},b.prototype.scheduleLongRunning=function(a,b){var c=cc(Ra);return qc(f(a,b,c)),c},b}(nc),Bc=nc[\"default\"]=nc.async=new Ac,Cc=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return Wb(b,a),b.prototype.schedule=function(a,b){return this._scheduler.schedule(a,this._wrap(b))},b.prototype._scheduleFuture=function(a,b,c){return this._scheduler.schedule(a,b,this._wrap(c))},b.prototype.now=function(){return this._scheduler.now()},b.prototype._clone=function(a){return new b(a,this._handler)},b.prototype._wrap=function(a){var b=this;return function(c,d){var f=$a(a)(b._getRecursiveWrapper(c),d);return f===Za?(b._handler(f.e)||e(f.e),dc):gc(f)}},b.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},b.prototype.schedulePeriodic=function(a,b,c){var d=this,f=!1,g=new hc;return g.setDisposable(this._scheduler.schedulePeriodic(a,b,function(a){if(f)return null;var b=$a(c)(a);return b===Za?(f=!0,d._handler(b.e)||e(b.e),g.dispose(),null):b})),g},b}(nc),Dc=Qa.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new ib},a.prototype._acceptObserver=function(a,b,c){throw new ib},a.prototype.accept=function(a,b,c){return a&&\"object\"==typeof a?this._acceptObserver(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return pc(a)||(a=uc),new xg(function(c){return a.schedule(b,function(a,b){b._acceptObserver(c),\"N\"===b.kind&&c.onCompleted()})})},a}(),Ec=function(a){function b(a){this.value=a,this.kind=\"N\"}return Wb(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObserver=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return\"OnNext(\"+this.value+\")\"},b}(Dc),Fc=function(a){function b(a){this.error=a,this.kind=\"E\"}return Wb(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObserver=function(a){return a.onError(this.error)},b.prototype.toString=function(){return\"OnError(\"+this.error+\")\"},b}(Dc),Gc=function(a){function b(){this.kind=\"C\"}return Wb(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObserver=function(a){return a.onCompleted()},b.prototype.toString=function(){return\"OnCompleted()\"},b}(Dc),Hc=Dc.createOnNext=function(a){return new Ec(a)},Ic=Dc.createOnError=function(a){return new Fc(a)},Jc=Dc.createOnCompleted=function(){return new Gc},Kc=Qa.Observer=function(){};Kc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Kc.prototype.asObserver=function(){var a=this;return new Oc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Kc.prototype.checked=function(){return new Pc(this)};var Lc=Kc.create=function(a,b,c){return a||(a=Ra),b||(b=Wa),c||(c=Ra),new Oc(a,b,c)};Kc.fromNotifier=function(a,b){var c=ob(a,b,1);return new Oc(function(a){return c(Hc(a))},function(a){return c(Ic(a))},function(){return c(Jc())})},Kc.prototype.notifyOn=function(a){return new Rc(a,this)},Kc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Mc,Nc=Qa.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Wb(b,a),b.prototype.next=jb,b.prototype.error=jb,b.prototype.completed=jb,b.prototype.onNext=function(a){!this.isStopped&&this.next(a);\n},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Kc),Oc=Qa.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Nc),Pc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=$a(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&e(b.e)},c.onError=function(a){this.checkAccess();var b=$a(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&e(b.e)},c.onCompleted=function(){this.checkAccess();var a=$a(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&e(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error(\"Re-entrancy detected\");if(2===this._state)throw new Error(\"Observer completed\");0===this._state&&(this._state=1)},b}(Kc),Qc=Qa.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new ic}function c(a,b){return function(){a.onNext(b)}}function d(a,b){return function(){a.onError(b)}}function f(a){return function(){a.onCompleted()}}function g(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=$a(c)();return d===Za?(a.queue=[],a.hasFaulted=!0,e(d.e)):void b(a)}return Wb(b,a),b.prototype.next=function(a){this.queue.push(c(this.observer,a))},b.prototype.error=function(a){this.queue.push(d(this.observer,a))},b.prototype.completed=function(){this.queue.push(f(this.observer))},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,g))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Nc),Rc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Qc),Sc=Qa.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function b(){if(Qa.config.longStackSupport&&_a){var b=this._subscribe,c=$a(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf(\"\\n\")+1),this._subscribe=a(this,b)}}return Mc=b.prototype,b.isObservable=function(a){return a&&Ya(a.subscribe)},Mc.subscribe=Mc.forEach=function(a,b,c){return this._subscribe(\"object\"==typeof a?a:Lc(a,b,c))},Mc.subscribeOnNext=function(a,b){return this._subscribe(Lc(\"undefined\"!=typeof b?function(c){a.call(b,c)}:a))},Mc.subscribeOnError=function(a,b){return this._subscribe(Lc(null,\"undefined\"!=typeof b?function(c){a.call(b,c)}:a))},Mc.subscribeOnCompleted=function(a,b){return this._subscribe(Lc(null,null,\"undefined\"!=typeof b?function(){a.call(b)}:a))},b}(),Tc=Qa.ObservableBase=function(a){function b(a){return a&&Ya(a.dispose)?a:Ya(a)?cc(a):dc}function c(a,c){var d=c[0],f=c[1],g=$a(f.subscribeCore).call(f,d);g!==Za||d.fail(Za.e)||e(Za.e),d.setDisposable(b(g))}function d(){a.call(this)}return Wb(d,a),d.prototype._subscribe=function(a){var b=new yg(a),d=[b,this];return wc.scheduleRequired()?wc.schedule(d,c):c(null,d),b},d.prototype.subscribeCore=jb,d}(Sc),Uc=Qa.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=Ya(d)?d:null,this.selector=ob(Ya(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.o=a,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},Wb(c,Nc),c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.next=function(a){var b=this.i++,c=$a(this.selector)(a,b,this.source);return c===Za?this.o.onError(c.e):(Xa(c)&&(c=dd(c)),(nb(c)||mb(c))&&(c=Sc.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onCompleted()},b}(Tc),Vc=Qa.internals.Enumerable=function(){};y.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var Wc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=$a(a.e.next).call(a.e);if(c===Za)return a.o.onError(c.e);if(c.done)return a.o.onCompleted();var e=c.value;Xa(e)&&(e=dd(e));var f=new hc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic,d={isDisposed:!1,o:a,subscription:b,e:this.sources[kb]()},e=wc.scheduleRecursive(d,c);return new kc([b,e,new y(d)])},Wb(d,Nc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.o.onError(a)},d.prototype.completed=function(){this._recurse(this._state)},b}(Tc);Vc.prototype.concat=function(){return new Wc(this)};var Xc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=$a(a.e.next).call(a.e);if(c===Za)return a.o.onError(c.e);if(c.done)return null!==a.lastError?a.o.onError(a.lastError):a.o.onCompleted();var e=c.value;Xa(e)&&(e=dd(e));var f=new hc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic,d={isDisposed:!1,e:this.sources[kb](),subscription:b,lastError:null,o:a},e=wc.scheduleRecursive(d,c);return new kc([b,e,new y(d)])},Wb(d,Nc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.lastError=a,this._recurse(this._state)},d.prototype.completed=function(){this._state.o.onCompleted()},b}(Tc);Vc.prototype.catchError=function(){return new Xc(this)};var Yc=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Wb(b,a),b.prototype[kb]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?lb:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Vc),Zc=Vc.repeat=function(a,b){return new Yc(a,b)},$c=function(a){function b(a,b,c){this.s=a,this.fn=b?ob(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Wb(b,a),b.prototype[kb]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:lb},b}(Vc),_c=Vc.of=function(a,b,c){return new $c(a,b,c)},ad=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Rc(this._s,a))},b}(Tc);Mc.observeOn=function(a){return new ad(this,a)};var bd=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new w(a,c.subscribe(e)))}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc,d=new ic;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(Tc);Mc.subscribeOn=function(a){return new bd(this,a)};var cd=function(a){function b(b,c){this._p=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];c.onNext(d),c.onCompleted()}function d(a,b){var c=b[0],d=b[1];c.onError(d)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc,e=this,f=this._p;return Ya(f)&&(f=$a(f)(),f===Za)?(a.onError(f.e),b):(f.then(function(d){b.setDisposable(e._s.schedule([a,d],c))},function(c){b.setDisposable(e._s.schedule([a,c],d))}),b)},b}(Tc),dd=Sc.fromPromise=function(a,b){return b||(b=Bc),new cd(a,b)};Mc.toPromise=function(a){if(a||(a=Qa.config.Promise),!a)throw new hb(\"Promise type not provided nor in Rx.config.Promise\");var b=this;return new a(function(a,c){var d;b.subscribe(function(a){d=a},c,function(){a(d)})})};var ed=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},Wb(c,Nc),c.prototype.next=function(a){this.a.push(a)},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onNext(this.a),this.o.onCompleted()},b}(Tc);Mc.toArray=function(){return new ed(this)},Sc.create=function(a,b){return new xg(a,b)};var fd=function(a){function b(b){this._f=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=$a(this._f)();return b===Za?yd(b.e).subscribe(a):(Xa(b)&&(b=dd(b)),b.subscribe(a))},b}(Tc),gd=Sc.defer=function(a){return new fd(a)},hd=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.scheduler=b}function d(a,b){return b.onCompleted(),dc}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){var a=this.observer;return this.scheduler===uc?d(null,a):this.scheduler.schedule(a,d)},b}(Tc),id=new hd(uc),jd=Sc.empty=function(a){return pc(a)||(a=uc),a===uc?id:new hd(a)},kd=function(a){function b(b,c,d){this._iterable=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){var f=$a(b.next).call(b);if(f===Za)return a.onError(f.e);if(f.done)return a.onCompleted();var g=f.value;return Ya(c)&&(g=$a(c)(g,d),g===Za)?a.onError(g.e):(a.onNext(g),void e(d+1))}}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=Object(this._iterable),d=E(b);return this._scheduler.scheduleRecursive(0,c(a,d,this._fn))},b}(Tc),ld=Math.pow(2,53)-1;z.prototype[kb]=function(){return new A(this._s)},A.prototype[kb]=function(){return this},A.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:lb},B.prototype[kb]=function(){return new C(this._a)},C.prototype[kb]=function(){return this},C.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:lb};var md=Sc.from=function(a,b,c,d){if(null==a)throw new Error(\"iterable cannot be null.\");if(b&&!Ya(b))throw new Error(\"mapFn when provided must be a function\");if(b)var e=ob(b,c,2);return pc(d)||(d=wc),new kd(a,e,d)},nd=function(a){function b(b,c){this._args=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b.length;return function(d,e){c>d?(a.onNext(b[d]),e(d+1)):a.onCompleted()}}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._args))},b}(Tc),od=Sc.fromArray=function(a,b){return pc(b)||(b=wc),new nd(a,b)},pd=function(a){function b(b,c,d,e,f){this._initialState=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,a.call(this)}function c(a,b){if(a.first)a.first=!1;else if(a.newState=$a(a.self._itrFn)(a.newState),a.newState===Za)return a.o.onError(a.newState.e);var c=$a(a.self._cndFn)(a.newState);if(c===Za)return a.o.onError(c.e);if(c){var d=$a(a.self._resFn)(a.newState);if(d===Za)return a.o.onError(d.e);a.o.onNext(d),b(a)}else a.o.onCompleted()}return Wb(b,a),b.prototype.subscribeCore=function(a){var b={o:a,self:this,first:!0,newState:this._initialState};return this._s.scheduleRecursive(b,c)},b}(Tc);Sc.generate=function(a,b,c,d,e){return pc(e)||(e=wc),new pd(a,b,c,d,e)},Sc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new nd(b,wc)},Sc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new nd(c,a)},Sc.ofArrayChanges=function(a){if(!Array.isArray(a))throw new TypeError(\"Array.observe only accepts arrays.\");if(\"function\"!=typeof Array.observe&&\"function\"!=typeof Array.unobserve)throw new TypeError(\"Array.observe is not supported on your platform\");return new xg(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Array.observe(a,c),function(){Array.unobserve(a,c)}})},Sc.ofObjectChanges=function(a){if(null==a)throw new TypeError(\"object must not be null or undefined.\");if(\"function\"!=typeof Object.observe&&\"function\"!=typeof Object.unobserve)throw new TypeError(\"Object.observe is not supported on your platform\");return new xg(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Object.observe(a,c),function(){Object.unobserve(a,c)}})};var qd=function(a){function b(){a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return dc},b}(Tc),rd=new qd,sd=Sc.never=function(){return rd},td=function(a){function b(b,c){this._o=b,this._keys=Object.keys(b),this._scheduler=c,a.call(this)}function c(a,b,c){return function(d,e){if(d<c.length){var f=c[d];a.onNext([f,b[f]]),e(d+1)}else a.onCompleted()}}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._o,this._keys))},b}(Tc);Sc.pairs=function(a,b){return b||(b=wc),new td(a,b)};var ud=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){b>d?(c.onNext(a+d),e(d+1)):c.onCompleted()}}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.scheduler.scheduleRecursive(0,c(this.start,this.rangeCount,a))},b}(Tc);Sc.range=function(a,b,c){return pc(c)||(c=wc),new ud(a,b,c)};var vd=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new I(a,this);return b.run()},b}(Tc);I.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount,a)},Sc.repeat=function(a,b,c){return pc(c)||(c=wc),new vd(a,b,c)};var wd=function(a){function b(b,c){this._value=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),dc}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=[this._value,a];return this._scheduler===uc?c(null,b):this._scheduler.schedule(b,c)},b}(Tc),xd=(Sc[\"return\"]=Sc.just=function(a,b){return pc(b)||(b=uc),new wd(a,b)},function(a){function b(b,c){this._error=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onError(c),dc}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=[this._error,a];return this._scheduler===uc?c(null,b):this._scheduler.schedule(b,c)},b}(Tc)),yd=Sc[\"throw\"]=function(a,b){return pc(b)||(b=uc),new xd(a,b)},zd=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=dc,c=$a(this._resFn)();if(c===Za)return new jc(yd(c.e).subscribe(a),b);c&&(b=c);var d=$a(this._obsFn)(c);return d===Za?new jc(yd(d.e).subscribe(a),b):new jc(d.subscribe(a),b)},b}(Tc);Sc.using=function(a,b){return new zd(a,b)},Mc.amb=function(a){var b=this;return new xg(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g=\"L\",h=\"R\",i=new hc,j=new hc;Xa(a)&&(a=dd(a));var k=Lc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Lc(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new jc(i,j)})},Sc.amb=function(){var a,b=sd();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=J(b,a[d]);return b};var Ad=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc,c=new ic;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new Bd(a,c,this._fn))),c},b}(Tc),Bd=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=$a(this._fn)(a);if(b===Za)return this._o.onError(b.e);Xa(b)&&(b=dd(b));var c=new hc;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Nc);Mc[\"catch\"]=function(a){return Ya(a)?new Ad(this,a):Cd([this,a])};var Cd=Sc[\"catch\"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return _c(a).catchError()};Mc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Fd.apply(this,b)};var Dd=function(a){function b(b,c){this._params=b,this._cb=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._params.length,c=new Array(b),d={hasValue:u(b,K),hasValueAll:!1,isDone:u(b,K),values:new Array(b)},e=0;b>e;e++){var f=this._params[e],g=new hc;c[e]=g,Xa(f)&&(f=dd(f)),g.setDisposable(f.subscribe(new Ed(a,e,this._cb,d)))}return new kc(c)},b}(Tc),Ed=function(a){function b(b,c,d,e){this._o=b,this._i=c,this._cb=d,this._state=e,a.call(this)}function c(a){return function(b,c){return c!==a}}return Wb(b,a),b.prototype.next=function(a){if(this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll||(this._state.hasValueAll=this._state.hasValue.every(Sa))){var b=$a(this._cb).apply(null,this._state.values);if(b===Za)return this._o.onError(b.e);this._o.onNext(b)}else this._state.isDone.filter(c(this._i)).every(Sa)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._state.isDone[this._i]=!0,this._state.isDone.every(Sa)&&this._o.onCompleted()},b}(Nc),Fd=Sc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Ya(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Dd(b,d)};Mc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Id.apply(null,a)};var Gd=function(a){function b(b,c){this._s=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._s.o.onNext(a)},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.i++,this._fn(this._s)},b}(Nc),Hd=function(a){function b(b){this._sources=b,a.call(this)}function c(a,b){if(!a.disposable.isDisposed){if(a.i===a.sources.length)return a.o.onCompleted();var c=a.sources[a.i];Xa(c)&&(c=dd(c));var d=new hc;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Gd(a,b)))}}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic,d=cc(Ra),e={o:a,i:0,subscription:b,disposable:d,sources:this._sources},f=uc.scheduleRecursive(e,c);return new kc([b,d,f])},b}(Tc),Id=Sc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new Hd(a)};Mc.concatAll=function(){return this.merge(1)};var Jd=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new _b;return b.add(this.source.subscribe(new Kd(a,this.maxConcurrent,b))),b},b}(Tc),Kd=function(a){function b(b,c,d){this.o=b,this.max=c,this.g=d,this.done=!1,this.q=[],this.activeCount=0,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return Wb(b,a),b.prototype.handleSubscribe=function(a){var b=new hc;this.g.add(b),Xa(a)&&(a=dd(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.next=function(a){this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a)},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,0===this.activeCount&&this.o.onCompleted()},Wb(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.q.length>0?this.parent.handleSubscribe(this.parent.q.shift()):(this.parent.activeCount--,this.parent.done&&0===this.parent.activeCount&&this.parent.o.onCompleted())},b}(Nc);Mc.merge=function(a){return\"number\"!=typeof a?Ld(this,a):new Jd(this,a)};var Ld=Sc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(pc(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=uc,b=0;d>b;b++)c.push(arguments[b]);else for(a=uc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),H(a,c).mergeAll()},Md=function(a){function b(b){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new _b,c=new hc;return b.add(c),c.setDisposable(this.source.subscribe(new Nd(a,b))),b},b}(Tc),Nd=function(a){function b(b,c){this.o=b,this.g=c,this.done=!1,a.call(this)}function c(b,c){this.parent=b,this.sad=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=new hc;this.g.add(b),Xa(a)&&(a=dd(a)),b.setDisposable(a.subscribe(new c(this,b)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.done=!0,1===this.g.length&&this.o.onCompleted()},Wb(c,a),c.prototype.next=function(a){this.parent.o.onNext(a)},c.prototype.error=function(a){this.parent.o.onError(a)},c.prototype.completed=function(){this.parent.g.remove(this.sad),this.parent.done&&1===this.parent.g.length&&this.parent.o.onCompleted()},b}(Nc);Mc.mergeAll=function(){return new Md(this)};var Od=Qa.CompositeError=function(a){this.innerErrors=a,this.message=\"This contains multiple errors. Check the innerErrors\",Error.call(this)};Od.prototype=Object.create(Error.prototype),Od.prototype.name=\"CompositeError\";var Pd=function(a){function b(b){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new _b,c=new hc,d={isStopped:!1,errors:[],o:a};return b.add(c),c.setDisposable(this.source.subscribe(new Qd(b,d))),b},b}(Tc),Qd=function(a){function b(b,c){this._group=b,this._state=c,a.call(this)}function c(a,b){0===b.length?a.onCompleted():1===b.length?a.onError(b[0]):a.onError(new Od(b))}function d(b,c,d){this._inner=b,this._group=c,this._state=d,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=new hc;this._group.add(b),Xa(a)&&(a=dd(a)),b.setDisposable(a.subscribe(new d(b,this._group,this._state)))},b.prototype.error=function(a){this._state.errors.push(a),this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},b.prototype.completed=function(){this._state.isStopped=!0,1===this._group.length&&c(this._state.o,this._state.errors)},Wb(d,a),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.errors.push(a),this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},d.prototype.completed=function(){this._group.remove(this._inner),this._state.isStopped&&1===this._group.length&&c(this._state.o,this._state.errors)},b}(Nc);Sc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=H(null,a);return new Pd(d)},Mc.onErrorResumeNext=function(a){if(!a)throw new Error(\"Second observable is required\");return Td([this,a])};var Rd=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(a.pos<a.sources.length){var c=a.sources[a.pos++];Xa(c)&&(c=dd(c));var d=new hc;a.subscription.setDisposable(d),d.setDisposable(c.subscribe(new Sd(a,b)))}else a.o.onCompleted()}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic,d={pos:0,subscription:b,o:a,sources:this.sources},e=uc.scheduleRecursive(d,c);return new jc(b,e)},b}(Tc),Sd=function(a){function b(b,c){this._state=b,this._recurse=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._state.o.onNext(a)},b.prototype.error=function(){this._recurse(this._state)},b.prototype.completed=function(){this._recurse(this._state)},b}(Nc),Td=Sc.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Rd(a)},Ud=function(a){function b(b,c){this._s=b,this._o=Xa(c)?dd(c):c,this._open=!1,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc;b.setDisposable(this._s.subscribe(new Vd(a,this))),Xa(this._o)&&(this._o=dd(this._o));var c=new hc;return c.setDisposable(this._o.subscribe(new Wd(a,this,c))),new jc(b,c)},b}(Tc),Vd=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._p._open&&this._o.onCompleted()},b}(Nc),Wd=function(a){function b(b,c,d){this._o=b,this._p=c,this._r=d,a.call(this)}return Wb(b,a),b.prototype.next=function(){this._p._open=!0,this._r.dispose()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=function(){this._r.dispose()},b}(Nc);Mc.skipUntil=function(a){return new Ud(this,a)};var Xd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,Nc.call(this)}function d(a,b){this.parent=a,this.id=b,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic,d=this.source.subscribe(new c(a,b));return new jc(d,b)},Wb(c,Nc),c.prototype.next=function(a){var b=new hc,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Xa(a)&&(a=dd(a)),b.setDisposable(a.subscribe(new d(this,c)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.stopped=!0,!this.hasLatest&&this.o.onCompleted()},Wb(d,Nc),d.prototype.next=function(a){this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.error=function(a){this.parent.latest===this.id&&this.parent.o.onError(a)},d.prototype.completed=function(){this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.stopped&&this.parent.o.onCompleted())},b}(Tc);Mc[\"switch\"]=Mc.switchLatest=function(){return new Xd(this)};var Yd=function(a){function b(b,c){this.source=b,this.other=Xa(c)?dd(c):c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return new jc(this.source.subscribe(a),this.other.subscribe(new Zd(a)))},b}(Tc),Zd=function(a){function b(b){this._o=b,a.call(this)}return Wb(b,a),b.prototype.next=function(){this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.onCompleted=Ra,b}(Nc);Mc.takeUntil=function(a){return new Yd(this,a)};var $d=function(a){function b(b,c,d){this._s=b,this._ss=c,this._cb=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._ss.length,c={hasValue:u(b,K),hasValueAll:!1,values:new Array(b)},d=this._ss.length,e=new Array(d+1),f=0;d>f;f++){var g=this._ss[f],h=new hc;Xa(g)&&(g=dd(g)),h.setDisposable(g.subscribe(new _d(a,f,c))),e[f]=h}var i=new hc;return i.setDisposable(this._s.subscribe(new ae(a,this._cb,c))),e[d]=i,new kc(e)},b}(Tc),_d=function(a){function b(b,c,d){this._o=b,this._i=c,this._state=d,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._state.values[this._i]=a,this._state.hasValue[this._i]=!0,this._state.hasValueAll=this._state.hasValue.every(Sa)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=Ra,b}(Nc),ae=function(a){function b(b,c,d){this._o=b,this._cb=c,this._state=d,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=[a].concat(this._state.values);if(this._state.hasValueAll){var c=$a(this._cb).apply(null,b);return c===Za?this._o.onError(c.e):void this._o.onNext(c)}},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.withLatestFrom=function(){if(0===arguments.length)throw new Error(\"invalid arguments\");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Ya(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new $d(this,b,d)};var be=function(a){function b(b,c){this._s=b,this._cb=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._s.length,c=new Array(b),d=u(b,K),e=u(b,M),f=0;b>f;f++){var g=this._s[f],h=new hc;c[f]=h,Xa(g)&&(g=dd(g)),h.setDisposable(g.subscribe(new ce(a,f,this,e,d)))}return new kc(c)},b}(Tc),ce=function(a){function b(b,c,d,e,f){this._o=b,this._i=c,this._p=d,this._q=e,this._d=f,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return Wb(b,a),b.prototype.next=function(a){if(this._q[this._i].push(a),this._q.every(c)){var b=this._q.map(d),f=$a(this._p._cb).apply(null,b);if(f===Za)return this._o.onError(f.e);this._o.onNext(f)}else this._d.filter(e(this._i)).every(Sa)&&this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._d[this._i]=!0,this._d.every(Sa)&&this._o.onCompleted()},b}(Nc);Mc.zip=function(){if(0===arguments.length)throw new Error(\"invalid arguments\");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Ya(b[a-1])?b.pop():L;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new be(b,d)},Sc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];Array.isArray(b[0])&&(b=Ya(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)};var de=function(a){function b(b,c){this.sources=b,this._cb=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){for(var b=this.sources,c=b.length,d=new Array(c),e={q:u(c,M),done:u(c,K),cb:this._cb,o:a},f=0;c>f;f++)!function(a){var c=b[a],f=new hc;(nb(c)||mb(c))&&(c=md(c)),d[a]=f,f.setDisposable(c.subscribe(new ee(e,a)))}(f);return new kc(d)},b}(Tc),ee=function(a){function b(b,c){this._s=b,this._i=c,a.call(this)}function c(a){return a.length>0}function d(a){return a.shift()}function e(a){return function(b,c){return c!==a}}return Wb(b,a),b.prototype.next=function(a){if(this._s.q[this._i].push(a),this._s.q.every(c)){var b=this._s.q.map(d),f=$a(this._s.cb).apply(null,b);if(f===Za)return this._s.o.onError(f.e);this._s.o.onNext(f)}else this._s.done.filter(e(this._i)).every(Sa)&&this._s.o.onCompleted()},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.done[this._i]=!0,this._s.done.every(Sa)&&this._s.o.onCompleted()},b}(Nc);Mc.zipIterable=function(){if(0===arguments.length)throw new Error(\"invalid arguments\");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Ya(b[a-1])?b.pop():L,e=this;return b.unshift(e),new de(b,d)},Mc.asObservable=function(){return new xg(N(this),this)},Mc.bufferWithCount=Mc.bufferCount=function(a,b){return\"number\"!=typeof b&&(b=a),this.windowWithCount(a,b).flatMap(O).filter(P)};var fe=function(a){function b(b){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ge(a))},b}(Tc),ge=function(a){function b(b){this._o=b,a.call(this)}return Wb(b,a),b.prototype.next=function(a){a.accept(this._o)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.dematerialize=function(){return new fe(this)};var he=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){\nreturn this.source.subscribe(new ie(a,this.keyFn,this.comparer))},b}(Tc),ie=function(a){function b(b,c,d){this.o=b,this.keyFn=c,this.comparer=d,this.hasCurrentKey=!1,this.currentKey=null,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b,c=a;return Ya(this.keyFn)&&(c=$a(this.keyFn)(a),c===Za)?this.o.onError(c.e):this.hasCurrentKey&&(b=$a(this.comparer)(this.currentKey,c),b===Za)?this.o.onError(b.e):void(this.hasCurrentKey&&b||(this.hasCurrentKey=!0,this.currentKey=c,this.o.onNext(a)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.o.onCompleted()},b}(Nc);Mc.distinctUntilChanged=function(a,b){return b||(b=Ua),new he(this,a,b)};var je=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||Ya(b._oN)?Lc(b._oN||Ra,b._oE||Ra,b._oC||Ra):b._oN,this.isStopped=!1,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},Wb(c,Nc),c.prototype.next=function(a){var b=$a(this.t.onNext).call(this.t,a);b===Za&&this.o.onError(b.e),this.o.onNext(a)},c.prototype.error=function(a){var b=$a(this.t.onError).call(this.t,a);return b===Za?this.o.onError(b.e):void this.o.onError(a)},c.prototype.completed=function(){var a=$a(this.t.onCompleted).call(this.t);return a===Za?this.o.onError(a.e):void this.o.onCompleted()},b}(Tc);Mc[\"do\"]=Mc.tap=Mc.doAction=function(a,b,c){return new je(this,a,b,c)},Mc.doOnNext=Mc.tapOnNext=function(a,b){return this.tap(\"undefined\"!=typeof b?function(c){a.call(b,c)}:a)},Mc.doOnError=Mc.tapOnError=function(a,b){return this.tap(Ra,\"undefined\"!=typeof b?function(c){a.call(b,c)}:a)},Mc.doOnCompleted=Mc.tapOnCompleted=function(a,b){return this.tap(Ra,null,\"undefined\"!=typeof b?function(){a.call(b)}:a)};var ke=function(a){function b(b,c,d){this.source=b,this._fn=ob(c,d,0),a.call(this)}function c(a,b){this.isDisposed=!1,this._s=a,this._fn=b}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=$a(this.source.subscribe).call(this.source,a);return b===Za&&(this._fn(),e(b.e)),new c(b,this._fn)},c.prototype.dispose=function(){if(!this.isDisposed){var a=$a(this._s.dispose).call(this._s);this._fn(),a===Za&&e(a.e)}},b}(Tc);Mc[\"finally\"]=function(a,b){return new ke(this,a,b)};var le=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Ra,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Tc);Mc.ignoreElements=function(){return new le(this)};var me=function(a){function b(b,c){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ne(a))},b}(Tc),ne=function(a){function b(b){this._o=b,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._o.onNext(Hc(a))},b.prototype.error=function(a){this._o.onNext(Ic(a)),this._o.onCompleted()},b.prototype.completed=function(){this._o.onNext(Jc()),this._o.onCompleted()},b}(Nc);Mc.materialize=function(){return new me(this)},Mc.repeat=function(a){return Zc(this,a).concat()},Mc.retry=function(a){return Zc(this,a).catchError()};var oe=function(a){function b(a){return{isDisposed:!1,dispose:function(){this.isDisposed||(this.isDisposed=!0,a.isDisposed=!0)}}}function c(b,c){this.source=b,this._notifier=c,a.call(this)}return Wb(c,a),c.prototype.subscribeCore=function(a){var c,d=new Bg,e=new Bg,f=this._notifier(d),g=f.subscribe(e),h=this.source[\"@@iterator\"](),i={isDisposed:!1},j=new ic,k=wc.scheduleRecursive(null,function(b,f){if(!i.isDisposed){var g=h.next();if(g.done)return void(c?a.onError(c):a.onCompleted());var k=g.value;Xa(k)&&(k=dd(k));var l=new hc,m=new hc;j.setDisposable(new jc(m,l)),l.setDisposable(k.subscribe(function(b){a.onNext(b)},function(b){m.setDisposable(e.subscribe(f,function(b){a.onError(b)},function(){a.onCompleted()})),d.onNext(b),l.dispose()},function(){a.onCompleted()}))}});return new kc([g,j,k,b(i)])},c}(Tc);Mc.retryWhen=function(a){return new oe(Q(this),a)};var pe=function(a){function b(a){return{isDisposed:!1,dispose:function(){this.isDisposed||(this.isDisposed=!0,a.isDisposed=!0)}}}function c(b,c){this.source=b,this._notifier=c,a.call(this)}return Wb(c,a),c.prototype.subscribeCore=function(a){var c,d=new Bg,e=new Bg,f=this._notifier(d),g=f.subscribe(e),h=this.source[\"@@iterator\"](),i={isDisposed:!1},j=new ic,k=wc.scheduleRecursive(null,function(b,f){if(!i.isDisposed){var g=h.next();if(g.done)return void(c?a.onError(c):a.onCompleted());var k=g.value;Xa(k)&&(k=dd(k));var l=new hc,m=new hc;j.setDisposable(new jc(m,l)),l.setDisposable(k.subscribe(function(b){a.onNext(b)},function(b){a.onError(b)},function(){m.setDisposable(e.subscribe(f,function(b){a.onError(b)},function(){a.onCompleted()})),d.onNext(null),l.dispose()}))}});return new kc([g,j,k,b(i)])},c}(Tc);Mc.repeatWhen=function(a){return new pe(Q(this),a)};var qe=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new re(a,this))},b}(Tc),re=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=$a(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?$a(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Za?this._o.onError(this._a.e):(this._o.onNext(this._a),void this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._hv&&this._hs&&this._o.onNext(this._s),this._o.onCompleted()},b}(Nc);Mc.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new qe(this,c,b,a)};var se=function(a){function b(b,c){this.source=b,this._c=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new te(a,this._c))},b}(Tc),te=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._o.onNext(this._q.shift())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.skipLast=function(a){if(0>a)throw new gb;return new se(this,a)},Mc.startWith=function(){var a,b=0;arguments.length&&pc(arguments[0])?(a=arguments[0],b=1):a=uc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Id.apply(null,[od(c,a),this])};var ue=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(;this._q.length>0;)this._o.onNext(this._q.shift());this._o.onCompleted()},b}(Nc);Mc.takeLast=function(a){if(0>a)throw new gb;var b=this;return new xg(function(c){return b.subscribe(new ue(c,a))},b)};var ve=function(a){function b(b,c){this._o=b,this._c=c,this._q=[],a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._q.push(a),this._q.length>this._c&&this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._q),this._o.onCompleted()},b}(Nc);Mc.takeLastBuffer=function(a){if(0>a)throw new gb;var b=this;return new xg(function(c){return b.subscribe(new ve(c,a))},b)},Mc.windowWithCount=Mc.windowCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new gb;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new gb;return new xg(function(d){function e(){var a=new Bg;i.push(a),d.onNext(Yb(a,g))}var f=new hc,g=new lc(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},Mc.selectConcat=Mc.concatMap=function(a,b,c){return Ya(a)&&Ya(b)?this.concatMap(function(c,d){var e=a(c,d);return Xa(e)&&(e=dd(e)),(nb(e)||mb(e))&&(e=md(e)),e.map(function(a,e){return b(c,a,d,e)})}):Ya(a)?R(this,a,c):R(this,function(){return a})},Mc.concatMapObserver=Mc.selectConcatObserver=function(a,b,c,d){var e=this,f=ob(a,d,2),g=ob(b,d,1),h=ob(c,d,0);return new xg(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Xa(d)&&(d=dd(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Xa(c)&&(c=dd(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Xa(b)&&(b=dd(b)),a.onNext(b),a.onCompleted()})},this).concatAll()};var we=function(a){function b(b,c){this._o=b,this._d=c,this._f=!1,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._f=!0,this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){!this._f&&this._o.onNext(this._d),this._o.onCompleted()},b}(Nc);Mc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new xg(function(a){return c.subscribe(new we(a,b))},c)},T.prototype.push=function(a){var b=-1===S(this.set,a,this.comparer);return b&&this.set.push(a),b};var xe=function(a){function b(b,c,d){this.source=b,this._keyFn=c,this._cmpFn=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ye(a,this._keyFn,this._cmpFn))},b}(Tc),ye=function(a){function b(b,c,d){this._o=b,this._keyFn=c,this._h=new T(d),a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=a;return Ya(this._keyFn)&&(b=$a(this._keyFn)(a),b===Za)?this._o.onError(b.e):void(this._h.push(b)&&this._o.onNext(a))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.distinct=function(a,b){return b||(b=Ua),new xe(this,a,b)},Mc.groupBy=function(a,b){return this.groupByUntil(a,b,sd)},Mc.groupByUntil=function(b,c,d){var e=this;return new xg(function(f){var g=new Of,h=new _b,i=new lc(h),j=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(e){var k=$a(b)(e);if(k===Za)return g.forEach(j(k.e)),f.onError(k.e);var l=!1,m=g.get(k);if(m===a&&(m=new Bg,g.set(k,m),l=!0),l){var n=new Ag(k,m,i),o=new Ag(k,m),p=$a(d)(o);if(p===Za)return g.forEach(j(p.e)),f.onError(p.e);f.onNext(n);var q=new hc;h.add(q),q.setDisposable(p.take(1).subscribe(Ra,function(a){g.forEach(j(a)),f.onError(a)},function(){g[\"delete\"](k)&&m.onCompleted(),h.remove(q)}))}var r=e;return Ya(c)&&(r=$a(c)(e),r===Za)?(g.forEach(j(r.e)),f.onError(r.e)):void m.onNext(r)},function(a){g.forEach(j(a)),f.onError(a)},function(){g.forEach(function(a){a.onCompleted()}),f.onCompleted()})),i},e)};var ze=function(a){function b(b,c,d){this.source=b,this.selector=ob(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,Nc.call(this)}return Wb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},Wb(d,Nc),d.prototype.next=function(a){var b=$a(this.selector)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void this.o.onNext(b)},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Tc);Mc.map=Mc.select=function(a,b){var c=\"function\"==typeof a?a:function(){return a};return this instanceof ze?this.internalMap(c,b):new ze(this,c,b)},Mc.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error(\"List of properties cannot be empty.\");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(U(b,a))},Mc.flatMap=Mc.selectMany=Mc.mergeMap=function(a,b,c){return new Uc(this,a,b,c).mergeAll()},Mc.flatMapObserver=Mc.selectManyObserver=function(a,b,c,d){var e=this;return new xg(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Xa(c)&&(c=dd(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Xa(c)&&(c=dd(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Xa(a)&&(a=dd(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Mc.flatMapLatest=Mc.switchMap=function(a,b,c){return new Uc(this,a,b,c).switchLatest()};var Ae=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._r=b,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},Wb(c,Nc),c.prototype.next=function(a){this._r<=0?this._o.onNext(a):this._r--},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Mc.skip=function(a){if(0>a)throw new gb;return new Ae(this,a)};var Be=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ce(a,this))},b}(Tc),Ce=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!1,a.call(this)}return Wb(b,a),b.prototype.next=function(a){if(!this._r){var b=$a(this._p._fn)(a,this._i++,this._p);if(b===Za)return this._o.onError(b.e);this._r=!b}this._r&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.skipWhile=function(a,b){var c=ob(a,b,3);return new Be(this,c)};var De=function(a){function b(b,c){this.source=b,this._count=c,a.call(this)}function c(a,b){this._o=a,this._c=b,this._r=b,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this._count))},Wb(c,Nc),c.prototype.next=function(a){this._r-->0&&(this._o.onNext(a),this._r<=0&&this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._o.onCompleted()},b}(Tc);Mc.take=function(a,b){if(0>a)throw new gb;return 0===a?jd(b):new De(this,a)};var Ee=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Fe(a,this))},b}(Tc),Fe=function(a){function b(b,c){this._o=b,this._p=c,this._i=0,this._r=!0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){return this._r&&(this._r=$a(this._p._fn)(a,this._i++,this._p),this._r===Za)?this._o.onError(this._r.e):void(this._r?this._o.onNext(a):this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.takeWhile=function(a,b){var c=ob(a,b,3);return new Ee(this,c)};var Ge=function(a){function b(b,c,d){this.source=b,this.predicate=ob(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},Wb(d,Nc),d.prototype.next=function(a){var b=$a(this.predicate)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void(b&&this.o.onNext(a))},d.prototype.error=function(a){this.o.onError(a)},d.prototype.completed=function(){this.o.onCompleted()},b}(Tc);Mc.filter=Mc.where=function(a,b){return this instanceof Ge?this.internalFilter(a,b):new Ge(this,a,b)};var He=function(a){function b(b,c,d){this.source=b,this._k=c,this._c=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ie(a,this._k,this._c))},b}(Tc),Ie=function(a){function b(b,c,d){this._o=b,this._k=c,this._c=d,this._v=null,this._hv=!1,this._l=[],a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=$a(this._k)(a);if(b===Za)return this._o.onError(b.e);var c=0;if(this._hv){if(c=$a(this._c)(b,this._v),c===Za)return this._o.onError(c.e)}else this._hv=!0,this._v=b;c>0&&(this._v=b,this._l=[]),c>=0&&this._l.push(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._l),this._o.onCompleted()},b}(Nc),Je=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ke(a,this))},b}(Tc),Ke=function(a){function b(b,c){this._o=b,this._p=c,this._fn=c.accumulator,this._hs=c.hasSeed,this._s=c.seed,this._ha=!1,this._a=null,this._hv=!1,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){return!this._hv&&(this._hv=!0),this._ha?this._a=$a(this._fn)(this._a,a,this._i,this._p):(this._a=this._hs?$a(this._fn)(this._s,a,this._i,this._p):a,this._ha=!0),this._a===Za?this._o.onError(this._a.e):void this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv&&this._o.onNext(this._a),!this._hv&&this._hs&&this._o.onNext(this._s),!this._hv&&!this._hs&&this._o.onError(new eb),this._o.onCompleted()},b}(Nc);Mc.reduce=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Je(this,c,b,a)};var Le=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Me(a,this._fn,this.source))},b}(Tc),Me=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=$a(this._fn)(a,this._i++,this._s);return b===Za?this._o.onError(b.e):void(Boolean(b)&&(this._o.onNext(!0),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Nc);Mc.some=function(a,b){var c=ob(a,b,3);return new Le(this,c)};var Ne=function(a){function b(b){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Oe(a))},b}(Tc),Oe=function(a){function b(b){this._o=b,a.call(this)}return Wb(b,a),b.prototype.next=function(){this._o.onNext(!1),this._o.onCompleted()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(Nc);Mc.isEmpty=function(){return new Ne(this)};var Pe=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Qe(a,this._fn,this.source))},b}(Tc),Qe=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=$a(this._fn)(a,this._i++,this._s);return b===Za?this._o.onError(b.e):void(Boolean(b)||(this._o.onNext(!1),this._o.onCompleted()))},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!0),this._o.onCompleted()},b}(Nc);Mc.every=function(a,b){var c=ob(a,b,3);return new Pe(this,c)};var Re=function(a){function b(b,c,d){var e=+d||0;Math.abs(e)===1/0&&(e=0),this.source=b,this._elem=c,this._n=e,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(!1),a.onCompleted(),dc):this.source.subscribe(new Se(a,this._elem,this._n))},b}(Tc),Se=function(a){function b(b,c,d){this._o=b,this._elem=c,this._n=d,this._i=0,a.call(this)}function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}return Wb(b,a),b.prototype.next=function(a){this._i++>=this._n&&c(a,this._elem)&&(this._o.onNext(!0),this._o.onCompleted())},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(!1),this._o.onCompleted()},b}(Nc);Mc.includes=function(a,b){return new Re(this,a,b)};var Te=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ue(a,this._fn,this.source))},b}(Tc),Ue=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){if(this._fn){var b=$a(this._fn)(a,this._i++,this._s);if(b===Za)return this._o.onError(b.e);Boolean(b)&&this._c++}else this._c++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Nc);Mc.count=function(a,b){var c=ob(a,b,3);return new Te(this,c)};var Ve=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),dc):this.source.subscribe(new We(a,this._e,this._n))},b}(Tc),We=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._o.onNext(this._i),this._o.onCompleted()),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(-1),this._o.onCompleted()},b}(Nc);Mc.indexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new Ve(this,a,c)};var Xe=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Ye(a,this._fn,this.source))},b}(Tc),Ye=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._i=0,this._c=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){if(this._fn){var b=$a(this._fn)(a,this._i++,this._s);if(b===Za)return this._o.onError(b.e);this._c+=b}else this._c+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._c),this._o.onCompleted()},b}(Nc);Mc.sum=function(a,b){var c=ob(a,b,3);return new Xe(this,c)},Mc.minBy=function(a,b){return b||(b=Va),new He(this,a,function(a,c){return-1*b(a,c)})},Mc.min=function(a){return this.minBy(Sa,a).map(V)},Mc.maxBy=function(a,b){return b||(b=Va),new He(this,a,b)},Mc.max=function(a){return this.maxBy(Sa,a).map(V)};var Ze=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new $e(a,this._fn,this.source))},b}(Tc),$e=function(a){function b(b,c,d){this._o=b,this._fn=c,this._s=d,this._c=0,this._t=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){if(this._fn){var b=$a(this._fn)(a,this._c++,this._s);if(b===Za)return this._o.onError(b.e);this._t+=b}else this._c++,this._t+=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){return 0===this._c?this._o.onError(new eb):(this._o.onNext(this._t/this._c),void this._o.onCompleted())},b}(Nc);Mc.average=function(a,b){var c,d=this;return Ya(a)&&(c=ob(a,b,3)),new Ze(d,c)},Mc.sequenceEqual=function(a,b){var c=this;return b||(b=Ua),new xg(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){if(h.length>0){var c=h.shift(),e=$a(b)(c,a);if(e===Za)return d.onError(e.e);e||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(nb(a)||mb(a))&&(a=md(a)),Xa(a)&&(a=dd(a));var j=a.subscribe(function(a){if(g.length>0){var c=g.shift(),f=$a(b)(c,a);if(f===Za)return d.onError(f.e);f||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new jc(i,j)},c)};var _e=function(a){function b(b,c,d){this.source=b,this._i=c,this._d=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new af(a,this._i,this._d))},b}(Tc),af=function(b){function c(a,c,d){this._o=a,this._i=c,this._d=d,b.call(this)}return Wb(c,b),c.prototype.next=function(a){0===this._i--&&(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._d===a?this._o.onError(new gb):(this._o.onNext(this._d),this._o.onCompleted())},c}(Nc);Mc.elementAt=function(a,b){if(0>a)throw new gb;return new _e(this,a,b)};var bf=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return Wb(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=$a(this._obj.predicate)(a,this._i++,this._s);if(c===Za)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);if(b){if(this._hv)return this._o.onError(new Error(\"Sequence contains more than one matching element\"));this._hv=!0,this._v=a}},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new eb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Nc);Mc.single=function(a,b){var c={},d=this;if(c=\"object\"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Ya(c.predicate)){var e=c.predicate;c.predicate=ob(e,c.thisArg,3)}return new xg(function(a){return d.subscribe(new bf(a,c,d))},d)};var cf=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new df(a,this._obj,this.source))},b}(Tc),df=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,b.call(this)}return Wb(c,b),c.prototype.next=function(a){if(this._obj.predicate){var b=$a(this._obj.predicate)(a,this._i++,this._s);if(b===Za)return this._o.onError(b.e);Boolean(b)&&(this._o.onNext(a),this._o.onCompleted())}else this._obj.predicate||(this._o.onNext(a),this._o.onCompleted())},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._obj.defaultValue===a?this._o.onError(new eb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Nc);Mc.first=function(){var a={};if(a=\"object\"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Ya(a.predicate)){var b=a.predicate;a.predicate=ob(b,a.thisArg,3)}return new cf(this,a)};var ef=function(a){function b(b,c){this.source=b,this._obj=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new ff(a,this._obj,this.source))},b}(Tc),ff=function(b){function c(a,c,d){this._o=a,this._obj=c,this._s=d,this._i=0,this._hv=!1,this._v=null,b.call(this)}return Wb(c,b),c.prototype.next=function(a){var b=!1;if(this._obj.predicate){var c=$a(this._obj.predicate)(a,this._i++,this._s);if(c===Za)return this._o.onError(c.e);Boolean(c)&&(b=!0)}else this._obj.predicate||(b=!0);b&&(this._hv=!0,this._v=a)},c.prototype.error=function(a){this._o.onError(a)},c.prototype.completed=function(){this._hv?(this._o.onNext(this._v),this._o.onCompleted()):this._obj.defaultValue===a?this._o.onError(new eb):(this._o.onNext(this._obj.defaultValue),this._o.onCompleted())},c}(Nc);Mc.last=function(){var a={};if(a=\"object\"==typeof arguments[0]?arguments[0]:{predicate:arguments[0],thisArg:arguments[1],defaultValue:arguments[2]},Ya(a.predicate)){var b=a.predicate;a.predicate=ob(b,a.thisArg,3)}return new ef(this,a)};var gf=function(a){function b(b,c,d,e){this._o=b,this._s=c,this._cb=d,this._y=e,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=$a(this._cb)(a,this._i,this._s);return b===Za?this._o.onError(b.e):void(b?(this._o.onNext(this._y?this._i:a),this._o.onCompleted()):this._i++)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._y&&this._o.onNext(-1),this._o.onCompleted()},b}(Nc);Mc.find=function(a,b){return W(this,a,b,!1)},Mc.findIndex=function(a,b){return W(this,a,b,!0)};var hf=function(a){function b(b){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new jf(a))},b}(Tc),jf=function(a){function b(b){this._o=b,this._s=new Pa.Set,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._s.add(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._s),this._o.onCompleted()},b}(Nc);Mc.toSet=function(){if(\"undefined\"==typeof Pa.Set)throw new TypeError;return new hf(this)};var kf=function(a){function b(b,c,d){this.source=b,this._k=c,this._e=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new lf(a,this._k,this._e))},b}(Tc),lf=function(a){function b(b,c,d){this._o=b,this._k=c,this._e=d,this._m=new Pa.Map,a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=$a(this._k)(a);if(b===Za)return this._o.onError(b.e);var c=a;return this._e&&(c=$a(this._e)(a),c===Za)?this._o.onError(c.e):void this._m.set(b,c)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onNext(this._m),this._o.onCompleted()},b}(Nc);Mc.toMap=function(a,b){if(\"undefined\"==typeof Pa.Map)throw new TypeError;return new kf(this,a,b)};var mf=function(a){function b(b,c,d){this.source=b,this._b=c,this._e=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new nf(a,this._b,this._e))},b}(Tc),nf=function(a){function b(b,c,d){this._o=b,this._b=c,this._e=d,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._i>=this._b&&(this._e===this._i?this._o.onCompleted():this._o.onNext(a)),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.slice=function(a,b){var c=a||0;if(0>c)throw new Qa.ArgumentOutOfRangeError;if(\"number\"==typeof b&&c>b)throw new Qa.ArgumentOutOfRangeError;return new mf(this,c,b)};var of=function(a){function b(b,c,d){this.source=b,this._e=c,this._n=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._n<0?(a.onNext(-1),a.onCompleted(),dc):this.source.subscribe(new pf(a,this._e,this._n))},b}(Tc),pf=function(a){function b(b,c,d){this._o=b,this._e=c,this._n=d,this._v=0,this._hv=!1,this._i=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._i>=this._n&&a===this._e&&(this._hv=!0,this._v=this._i),this._i++},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._hv?this._o.onNext(this._v):this._o.onNext(-1),this._o.onCompleted()},b}(Nc);Mc.lastIndexOf=function(a,b){var c=+b||0;return Math.abs(c)===1/0&&(c=0),new of(this,a,c)},Sc.wrap=function(a){function b(){return Sc.spawn.call(this,a.apply(this,arguments))}return b.__generatorFunction__=a,b};var qf=Sc.spawn=function(){for(var a=arguments[0],b=this,c=[],d=1,e=arguments.length;e>d;d++)c.push(arguments[d]);return new xg(function(d){function e(b){var c=$a(a.next).call(a,b);return c===Za?d.onError(c.e):void g(c)}function f(b){var c=$a(a.next).call(a,b);return c===Za?d.onError(c.e):void g(c)}function g(a){if(a.done)return d.onNext(a.value),void d.onCompleted();var c=X.call(b,a.value),g=null,i=!1;Sc.isObservable(c)?h.add(c.subscribe(function(a){i=!0,g=a},f,function(){i&&e(g)})):f(new TypeError(\"type not supported\"))}var h=new _b;return Ya(a)&&(a=a.apply(b,c)),a&&Ya(a.next)?(e(),h):(d.onNext(a),d.onCompleted())})};Sc.start=function(a,b,c){return rf(a,b,c)()};var rf=Sc.toAsync=function(a,b,c){return pc(c)||(c=Bc),function(){var d=arguments,e=new Cg;return c.schedule(null,function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};Sc.fromCallback=function(a,b,c){return function(){\"undefined\"==typeof b&&(b=this);\nfor(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return ca(a,b,c,e)}},Sc.fromNodeCallback=function(a,b,c){return function(){\"undefined\"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return ea(a,b,c,e)}},ha.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},Qa.config.useNativeEvents=!1;var sf=function(a){function b(b,c,d){this._el=b,this._n=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return Ya(b)&&(c=$a(b).apply(null,arguments),c===Za)?a.onError(c.e):void a.onNext(c)}}return Wb(b,a),b.prototype.subscribeCore=function(a){return ia(this._el,this._n,c(a,this._fn))},b}(Tc);Sc.fromEvent=function(a,b,c){return a.addListener?uf(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Qa.config.useNativeEvents||\"function\"!=typeof a.on||\"function\"!=typeof a.off?new sf(a,b,c).publish().refCount():uf(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var tf=function(a){function b(b,c,d){this._add=b,this._del=c,this._fn=d,a.call(this)}function c(a,b){return function(){var c=arguments[0];return Ya(b)&&(c=$a(b).apply(null,arguments),c===Za)?a.onError(c.e):void a.onNext(c)}}function d(a,b,c){this._del=a,this._fn=b,this._ret=c,this.isDisposed=!1}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=c(a,this._fn),e=this._add(b);return new d(this._del,b,e)},d.prototype.dispose=function(){this.isDisposed||(Ya(this._del)&&this._del(this._fn,this._ret),this.isDisposed=!0)},b}(Tc),uf=Sc.fromEventPattern=function(a,b,c){return new tf(a,b,c).publish().refCount()};Sc.startAsync=function(a){var b=$a(a)();return b===Za?yd(b.e):dd(b)};var vf=function(a){function b(b,c){this.source=b,this.controller=new Bg,this.paused=!0,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,a.call(this)}return Wb(b,a),b.prototype._subscribe=function(a){var b=this.source.publish(),c=b.subscribe(a),d=dc,e=this.pauser.startWith(!this.paused).distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=dc)});return new kc([c,d,e])},b.prototype.pause=function(){this.paused=!0,this.controller.onNext(!1)},b.prototype.resume=function(){this.paused=!1,this.controller.onNext(!0)},b}(Sc);Mc.pausable=function(a){return new vf(this,a)};var wf=function(b){function c(a,c){this.source=a,this.controller=new Bg,this.paused=!0,c&&c.subscribe?this.pauser=this.controller.merge(c):this.pauser=this.controller,b.call(this)}return Wb(c,b),c.prototype._subscribe=function(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ja(this.source,this.pauser.startWith(!this.paused).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!==d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f},c.prototype.pause=function(){this.paused=!0,this.controller.onNext(!1)},c.prototype.resume=function(){this.paused=!1,this.controller.onNext(!0)},c}(Sc);Mc.pausableBuffered=function(a){return new wf(this,a)};var xf=function(a){function b(b,c,d){a.call(this),this.subject=new yf(c,d),this.source=b.multicast(this.subject).refCount()}return Wb(b,a),b.prototype._subscribe=function(a){return this.source.subscribe(a)},b.prototype.request=function(a){return this.subject.request(null==a?-1:a)},b}(Sc),yf=function(a){function b(b,c){null==b&&(b=!0),a.call(this),this.subject=new Bg,this.enableQueue=b,this.queue=b?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=c||wc}return Wb(b,a),Xb(b.prototype,Kc,{_subscribe:function(a){return this.subject.subscribe(a)},onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(Dc.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(Dc.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(Dc.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||\"N\"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),\"N\"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.schedule(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,cc(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),b}(Sc);Mc.controlled=function(a,b){return a&&pc(a)&&(b=a,a=!0),null==a&&(a=!0),new xf(this,a,b)};var zf=function(a){function b(b){a.call(this),this.source=b}function c(a,b){return b.source.request(1)}Wb(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new jc(this.subscription,Bc.schedule(this,c))};var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d,this.scheduleDisposable=null}function c(a,b){return b.observable.source.request(1)}return Wb(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.scheduleDisposable=Bc.schedule(this,c)},b.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(Nc);return b}(Sc);xf.prototype.stopAndWait=function(){return new zf(this)};var Af=function(a){function b(b,c){a.call(this),this.source=b,this.windowSize=c}function c(a,b){return b.source.request(b.windowSize)}Wb(b,a),b.prototype._subscribe=function(a){return this.subscription=this.source.subscribe(new d(a,this,this.subscription)),new jc(this.subscription,Bc.schedule(this,c))};var d=function(a){function b(b,c,d){this.observer=b,this.observable=c,this.cancel=d,this.received=0,this.scheduleDisposable=null,a.call(this)}function c(a,b){return b.observable.source.request(b.observable.windowSize)}return Wb(b,a),b.prototype.completed=function(){this.observer.onCompleted(),this.dispose()},b.prototype.error=function(a){this.observer.onError(a),this.dispose()},b.prototype.next=function(a){this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received&&(this.scheduleDisposable=Bc.schedule(this,c))},b.prototype.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),this.scheduleDisposable&&(this.scheduleDisposable.dispose(),this.scheduleDisposable=null),a.prototype.dispose.call(this)},b}(Nc);return b}(Sc);xf.prototype.windowed=function(a){return new Af(this,a)},Mc.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener(\"drain\",b),c.subscribe(function(b){!a.write(b)&&c.pause()},function(b){a.emit(\"error\",b)},function(){!a._isStdio&&a.end(),a.removeListener(\"drain\",b)}),c.resume(),a};var Bf=function(a){function b(b,c,d){this.source=b,this._fn1=c,this._fn2=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=this.source.multicast(this._fn1());return new jc(this._fn2(b).subscribe(a),b.connect())},b}(Tc);Mc.multicast=function(a,b){return Ya(a)?new Bf(this,a,b):new Ef(this,a)},Mc.publish=function(a){return a&&Ya(a)?this.multicast(function(){return new Bg},a):this.multicast(new Bg)},Mc.share=function(){return this.publish().refCount()},Mc.publishLast=function(a){return a&&Ya(a)?this.multicast(function(){return new Cg},a):this.multicast(new Cg)},Mc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Dg(b)},a):this.multicast(new Dg(a))},Mc.shareValue=function(a){return this.publishValue(a).refCount()},Mc.replay=function(a,b,c,d){return a&&Ya(a)?this.multicast(function(){return new Eg(b,c,d)},a):this.multicast(new Eg(b,c,d))},Mc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Cf=function(a,b){this._s=a,this._o=b};Cf.prototype.dispose=function(){if(!this._s.isDisposed&&null!==this._o){var a=this._s.observers.indexOf(this._o);this._s.observers.splice(a,1),this._o=null}};var Df=function(a){function b(b){this.source=b,this._count=0,this._connectableSubscription=null,a.call(this)}function c(a,b){this._p=a,this._s=b,this.isDisposed=!1}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=this.source.subscribe(a);return 1===++this._count&&(this._connectableSubscription=this.source.connect()),new c(this,b)},c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.dispose(),0===--this._p._count&&this._p._connectableSubscription.dispose())},b}(Tc),Ef=Qa.ConnectableObservable=function(a){function b(b,c){this.source=b,this._connection=null,this._source=b.asObservable(),this._subject=c,a.call(this)}function c(a,b){this._p=a,this._s=b}return Wb(b,a),c.prototype.dispose=function(){this._s&&(this._s.dispose(),this._s=null,this._p._connection=null)},b.prototype.connect=function(){if(!this._connection){if(this._subject.isStopped)return dc;var a=this._source.subscribe(this._subject);this._connection=new c(this,a)}return this._connection},b.prototype._subscribe=function(a){return this._subject.subscribe(a)},b.prototype.refCount=function(){return new Df(this)},b}(Sc);Mc.singleInstance=function(){function a(){return d||(d=!0,b=c[\"finally\"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new xg(function(b){return a().subscribe(b)})},Mc.join=function(a,b,c,d){var e=this;return new xg(function(f){var g=new _b,h=!1,i=!1,j=0,k=0,l=new Of,m=new Of,n=function(a){f.onError(a)};return g.add(e.subscribe(function(a){var c=j++,e=new hc;l.set(c,a),g.add(e);var i=$a(b)(a);return i===Za?f.onError(i.e):(e.setDisposable(i.take(1).subscribe(Ra,n,function(){l[\"delete\"](c)&&0===l.size&&h&&f.onCompleted(),g.remove(e)})),void m.forEach(function(b){var c=$a(d)(a,b);return c===Za?f.onError(c.e):void f.onNext(c)}))},n,function(){h=!0,(i||0===l.size)&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new hc;m.set(b,a),g.add(e);var h=$a(c)(a);return h===Za?f.onError(h.e):(e.setDisposable(h.take(1).subscribe(Ra,n,function(){m[\"delete\"](b)&&0===m.size&&i&&f.onCompleted(),g.remove(e)})),void l.forEach(function(b){var c=$a(d)(b,a);return c===Za?f.onError(c.e):void f.onNext(c)}))},n,function(){i=!0,(h||0===m.size)&&f.onCompleted()})),g},e)},Mc.groupJoin=function(a,b,c,d){var e=this;return new xg(function(f){function g(a){}var h=new _b,i=new lc(h),j=new Of,k=new Of,l=0,m=0,g=function(a){return function(b){b.onError(a)}};return h.add(e.subscribe(function(a){var c=new Bg,e=l++;j.set(e,c);var m=$a(d)(a,Yb(c,i));if(m===Za)return j.forEach(g(m.e)),f.onError(m.e);f.onNext(m),k.forEach(function(a){c.onNext(a)});var n=new hc;h.add(n);var o=$a(b)(a);return o===Za?(j.forEach(g(o.e)),f.onError(o.e)):void n.setDisposable(o.take(1).subscribe(Ra,function(a){j.forEach(g(a)),f.onError(a)},function(){j[\"delete\"](e)&&c.onCompleted(),h.remove(n)}))},function(a){j.forEach(g(a)),f.onError(a)},function(){f.onCompleted()})),h.add(a.subscribe(function(a){var b=m++;k.set(b,a);var d=new hc;h.add(d);var e=$a(c)(a);return e===Za?(j.forEach(g(e.e)),f.onError(e.e)):(d.setDisposable(e.take(1).subscribe(Ra,function(a){j.forEach(g(a)),f.onError(a)},function(){k[\"delete\"](b),h.remove(d)})),void j.forEach(function(b){b.onNext(a)}))},function(a){j.forEach(g(a)),f.onError(a)})),i},e)},Mc.buffer=function(){return this.window.apply(this,arguments).flatMap(O)},Mc.window=function(a,b){return 1===arguments.length&&\"function\"!=typeof arguments[0]?la.call(this,a):\"function\"==typeof a?ma.call(this,a):ka.call(this,a,b)};var Ff=function(a){function b(b){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Gf(a))},b}(Tc),Gf=function(a){function b(b){this._o=b,this._p=null,this._hp=!1,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._hp?this._o.onNext([this._p,a]):this._hp=!0,this._p=a},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.pairwise=function(){return new Ff(this)},Mc.partition=function(a,b){var c=ob(a,b,3);return[this.filter(a,b),this.filter(function(a,b,d){return!c(a,b,d)})]};var Hf=function(a){function b(a,b){this.c=a,this.s=b}return Wb(b,a),b.prototype[kb]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(Vc);Mc.letBind=Mc.let=function(a){return a(this)},Sc[\"if\"]=function(a,b,c){return gd(function(){return c||(c=jd()),Xa(b)&&(b=dd(b)),Xa(c)&&(c=dd(c)),\"function\"==typeof c.now&&(c=jd(c)),a()?b:c})},Sc[\"for\"]=Sc.forIn=function(a,b,c){return _c(a,b,c).concat()};var If=Sc[\"while\"]=Sc.whileDo=function(a,b){return Xa(b)&&(b=dd(b)),na(a,b).concat()};Mc.doWhile=function(a){return Id([this,If(a,this)])},Sc[\"case\"]=function(a,b,c){return gd(function(){Xa(c)&&(c=dd(c)),c||(c=jd()),pc(c)&&(c=jd(c));var d=b[a()];return Xa(d)&&(d=dd(d)),d||c})};var Jf=function(a){function b(b,c,d){this.source=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b){var c,d=a[0],e=a[1];if(!(d.q.length>0))return void(d.isAcquired=!1);c=d.q.shift();var f=new hc;d.d.add(f),f.setDisposable(c.subscribe(new Kf(d,e,f))),b([d,e])}return Wb(b,a),b.prototype._ensureActive=function(a){var b=!1;a.q.length>0&&(b=!a.isAcquired,a.isAcquired=!0),b&&a.m.setDisposable(this._scheduler.scheduleRecursive([a,this],c))},b.prototype.subscribeCore=function(a){var b=new ic,c=new _b(b),d={q:[],m:b,d:c,activeCount:0,isAcquired:!1,o:a};return d.q.push(this.source),d.activeCount++,this._ensureActive(d),c},b}(Tc),Kf=function(a){function b(b,c,d){this._s=b,this._p=c,this._m1=d,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._s.o.onNext(a);var b=$a(this._p._fn)(a);return b===Za?this._s.o.onError(b.e):(this._s.q.push(b),this._s.activeCount++,void this._p._ensureActive(this._s))},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.d.remove(this._m1),this._s.activeCount--,0===this._s.activeCount&&this._s.o.onCompleted()},b}(Nc);Mc.expand=function(a,b){return pc(b)||(b=wc),new Jf(this,a,b)};var Lf=function(a){function b(b,c){this._sources=b,this._cb=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){if(0===this._sources.length)return a.onCompleted(),dc;for(var b=this._sources.length,c={finished:!1,hasResults:new Array(b),hasCompleted:new Array(b),results:new Array(b)},d=new _b,e=0,f=this._sources.length;f>e;e++){var g=this._sources[e];Xa(g)&&(g=dd(g)),d.add(g.subscribe(new Mf(a,c,e,this._cb,d)))}return d},b}(Tc),Mf=function(a){function b(b,c,d,e,f){this._o=b,this._s=c,this._i=d,this._cb=e,this._subs=f,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._s.finished||(this._s.hasResults[this._i]=!0,this._s.results[this._i]=a)},b.prototype.error=function(a){this._s.finished=!0,this._o.onError(a),this._subs.dispose()},b.prototype.completed=function(){if(!this._s.finished){if(!this._s.hasResults[this._i])return this._o.onCompleted();this._s.hasCompleted[this._i]=!0;for(var a=0;a<this._s.results.length;a++)if(!this._s.hasCompleted[a])return;this._s.finished=!0;var b=$a(this._cb).apply(null,this._s.results);if(b===Za)return this._o.onError(b.e);this._o.onNext(b),this._o.onCompleted()}},b}(Nc);Sc.forkJoin=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=Ya(b[a-1])?b.pop():L;return Array.isArray(b[0])&&(b=b[0]),new Lf(b,d)},Mc.forkJoin=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Sc.forkJoin.apply(null,b)},Mc.manySelect=Mc.extend=function(a,b){pc(b)||(b=Qa.Scheduler.immediate);var c=this;return gd(function(){var d;return c.map(function(a){var b=new Nf(a);return d&&d.onNext(a),d=b,b}).tap(Ra,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Nf=function(a){function b(b){a.call(this),this.head=b,this.tail=new Cg}return Wb(b,a),Xb(b.prototype,Kc,{_subscribe:function(a){var b=new _b;return b.add(wc.schedule(this,function(c,d){a.onNext(d.head),b.add(d.tail.mergeAll().subscribe(a))})),b},onCompleted:function(){this.onNext(Sc.empty())},onError:function(a){this.onNext(Sc[\"throw\"](a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),b}(Sc),Of=Pa.Map||function(){function b(){this.size=0,this._values=[],this._keys=[]}return b.prototype[\"delete\"]=function(a){var b=this._keys.indexOf(a);return-1===b?!1:(this._values.splice(b,1),this._keys.splice(b,1),this.size--,!0)},b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1===c?a:this._values[c]},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);return-1===c?(this._keys.push(a),this._values.push(b),this.size++):this._values[c]=b,this},b.prototype.forEach=function(a,b){for(var c=0;c<this.size;c++)a.call(b,this._values[c],this._keys[c])},b}();oa.prototype.and=function(a){return new oa(this.patterns.concat(a))},oa.prototype.thenDo=function(a){return new pa(this,a)},pa.prototype.activate=function(a,b,c){for(var d=[],e=qa(b),f=0,g=this.expression.patterns.length;g>f;f++)d.push(sa(a,this.expression.patterns[f],e));var h=new ta(d,ra(this,b),function(){for(var a=0,b=d.length;b>a;a++)d[a].removeActivePlan(h);c(h)});for(f=0,g=d.length;g>f;f++)d[f].addActivePlan(h);return h},ta.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},ta.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),\"C\"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var Pf=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new hc,this.isDisposed=!1}Wb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if(\"E\"===a.kind)return this.onError(a.error);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Ra,c.completed=Ra,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(Nc);Mc.and=function(a){return new oa([this,a])},Mc.thenDo=function(a){return new oa([this]).thenDo(a)},Sc.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new xg(function(b){var c=[],d=new Of,e=Lc(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){return yd(h).subscribe(b)}var i=new _b;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};var Qf=function(a){function b(b,c){this._dt=b,this._s=c,a.call(this)}function c(a,b){b.onNext(0),b.onCompleted()}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._s.scheduleFuture(a,this._dt,c)},b}(Tc),Rf=Sc.interval=function(a,b){return wa(a,a,pc(b)?b:Bc)};Sc.timer=function(b,c,d){var e;return pc(d)||(d=Bc),null!=c&&\"number\"==typeof c?e=c:pc(c)&&(d=c),(b instanceof Date||\"number\"==typeof b)&&e===a?ua(b,d):b instanceof Date&&e!==a?va(b,c,d):wa(b,e,d)};Mc.delay=function(){var a=arguments[0];if(\"number\"==typeof a||a instanceof Date){var b=a,c=arguments[1];return pc(c)||(c=Bc),b instanceof Date?ya(this,b,c):xa(this,b,c)}if(Sc.isObservable(a)||Ya(a))return za(this,a,arguments[1]);throw new Error(\"Invalid arguments\")};var Sf=function(a){function b(b,c,d){pc(d)||(d=Bc),this.source=b,this._dt=c,this._s=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic;return new jc(this.source.subscribe(new Tf(a,this._dt,this._s,b)),b)},b}(Tc),Tf=function(a){function b(b,c,d,e){this._o=b,this._d=c,this._scheduler=d,this._c=e,this._v=null,this._hv=!1,this._id=0,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._hv=!0,this._v=a;var b=++this._id,c=new hc;this._c.setDisposable(c),c.setDisposable(this._scheduler.scheduleFuture(this,this._d,function(c,d){d._hv&&d._id===b&&d._o.onNext(a),d._hv=!1}))},b.prototype.error=function(a){this._c.dispose(),this._o.onError(a),this._hv=!1,this._id++},b.prototype.completed=function(){this._c.dispose(),this._hv&&this._o.onNext(this._v),this._o.onCompleted(),this._hv=!1,this._id++},b}(Nc);Mc.debounce=function(){if(Ya(arguments[0]))return Aa(this,arguments[0]);if(\"number\"==typeof arguments[0])return new Sf(this,arguments[0],arguments[1]);throw new Error(\"Invalid arguments\")},Mc.windowWithTime=Mc.windowTime=function(a,b,c){var d,e=this;return null==b&&(d=a),pc(c)||(c=Bc),\"number\"==typeof b?d=b:pc(b)&&(d=a,c=b),new xg(function(b){function f(){var a=new hc,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleFuture(null,o,function(){if(g){var a=new Bg;k.push(a),b.onNext(Yb(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new ic,m=0;return g=new _b(l),h=new lc(g),k.push(new Bg),b.onNext(Yb(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},Mc.windowWithTimeOrCount=Mc.windowTimeOrCount=function(a,b,c){var d=this;return pc(c)||(c=Bc),new xg(function(e){function f(b){var d=new hc;g.setDisposable(d),d.setDisposable(c.scheduleFuture(null,a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Bg,e.onNext(Yb(l,i)),f(a)}}))}var g=new ic,h=new _b(g),i=new lc(h),j=0,k=0,l=new Bg;return e.onNext(Yb(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new Bg,e.onNext(Yb(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},Mc.bufferWithTime=Mc.bufferTime=function(a,b,c){return this.windowWithTime(a,b,c).flatMap(O)},Mc.bufferWithTimeOrCount=Mc.bufferTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).flatMap(O)};var Uf=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Vf(a,this._s))},b}(Tc),Vf=function(a){function b(b,c){this._o=b,this._s=c,this._l=c.now(),a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=this._s.now(),c=b-this._l;this._l=b,this._o.onNext({value:a,interval:c})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.timeInterval=function(a){return pc(a)||(a=Bc),new Uf(this,a)};var Wf=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Xf(a,this._s))},b}(Tc),Xf=function(a){function b(b,c){this._o=b,this._s=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._o.onNext({value:a,timestamp:this._s.now()})},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.timestamp=function(a){return pc(a)||(a=Bc),new Wf(this,a)};var Yf=function(a){function b(b,c){this.source=b,this._sampler=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b={o:a,atEnd:!1,value:null,hasValue:!1,sourceSubscription:new hc};return b.sourceSubscription.setDisposable(this.source.subscribe(new $f(b))),new jc(b.sourceSubscription,this._sampler.subscribe(new Zf(b)))},b}(Tc),Zf=function(a){function b(b){this._s=b,a.call(this)}return Wb(b,a),b.prototype._handleMessage=function(){this._s.hasValue&&(this._s.hasValue=!1,this._s.o.onNext(this._s.value)),this._s.atEnd&&this._s.o.onCompleted()},b.prototype.next=function(){this._handleMessage()},b.prototype.error=function(a){this._s.onError(a)},b.prototype.completed=function(){this._handleMessage()},b}(Nc),$f=function(a){function b(b){this._s=b,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._s.hasValue=!0,this._s.value=a},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.atEnd=!0,this._s.sourceSubscription.dispose()},b}(Nc);Mc.sample=function(a,b){return pc(b)||(b=Bc),\"number\"==typeof a?new Yf(this,Rf(a,b)):new Yf(this,a)};var _f=Qa.TimeoutError=function(a){this.message=a||\"Timeout has occurred\",this.name=\"TimeoutError\",Error.call(this)};_f.prototype=Object.create(Error.prototype),Mc.timeout=function(){var a=arguments[0];if(a instanceof Date||\"number\"==typeof a)return Ca(this,a,arguments[1],arguments[2]);if(Sc.isObservable(a)||Ya(a))return Ba(this,a,arguments[1],arguments[2]);throw new Error(\"Invalid arguments\")};var ag=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,a.call(this)}function c(a,b){if(a.hasResult&&a.o.onNext(a.result),a.first)a.first=!1;else if(a.newState=$a(a.self._itrFn)(a.newState),a.newState===Za)return a.o.onError(a.newState.e);if(a.hasResult=$a(a.self._cndFn)(a.newState),a.hasResult===Za)return a.o.onError(a.hasResult.e);if(a.hasResult){if(a.result=$a(a.self._resFn)(a.newState),a.result===Za)return a.o.onError(a.result.e);var c=$a(a.self._timeFn)(a.newState);if(c===Za)return a.o.onError(c.e);b(a,c)}else a.o.onCompleted()}return Wb(b,a),b.prototype.subscribeCore=function(a){var b={o:a,self:this,newState:this._state,first:!0,hasResult:!1};return this._s.scheduleRecursiveFuture(b,new Date(this._s.now()),c)},b}(Tc);Sc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return pc(f)||(f=Bc),new ag(a,b,c,d,e,f)};var bg=function(a){function b(b,c,d,e,f,g){this._state=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._timeFn=f,this._s=g,a.call(this)}function c(a,b){if(a.hasResult&&a.o.onNext(a.result),a.first)a.first=!1;else if(a.newState=$a(a.self._itrFn)(a.newState),a.newState===Za)return a.o.onError(a.newState.e);if(a.hasResult=$a(a.self._cndFn)(a.newState),a.hasResult===Za)return a.o.onError(a.hasResult.e);if(a.hasResult){if(a.result=$a(a.self._resFn)(a.newState),a.result===Za)return a.o.onError(a.result.e);var c=$a(a.self._timeFn)(a.newState);if(c===Za)return a.o.onError(c.e);b(a,c)}else a.o.onCompleted()}return Wb(b,a),b.prototype.subscribeCore=function(a){var b={o:a,self:this,newState:this._state,first:!0,hasResult:!1};return this._s.scheduleRecursiveFuture(b,0,c)},b}(Tc);Sc.generateWithRelativeTime=function(a,b,c,d,e,f){return pc(f)||(f=Bc),new bg(a,b,c,d,e,f)};var cg=function(a){function b(b,c,d){this.source=b,this._dt=c,this._s=d,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];e.setDisposable(c.subscribe(d))}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic;return b.setDisposable(this._s.scheduleFuture([this.source,a,b],this._dt,c)),b},b}(Tc);Mc.delaySubscription=function(a,b){return pc(b)||(b=Bc),new cg(this,a,b)};var dg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new eg(a,this))},b}(Tc),eg=function(a){function b(b,c){this._o=b,this._s=c._s,this._d=c._d,this._q=[],a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0&&a-this._q[0].interval>=this._d;)this._o.onNext(this._q.shift().value);this._o.onCompleted()},b}(Nc);Mc.skipLastWithTime=function(a,b){return pc(b)||(b=Bc),new dg(this,a,b)};var fg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new gg(a,this._d,this._s))},b}(Tc),gg=function(a){function b(b,c,d){this._o=b,this._d=c,this._s=d,this._q=[],a.call(this)}return Wb(b,a),b.prototype.next=function(a){var b=this._s.now();for(this._q.push({interval:b,value:a});this._q.length>0&&b-this._q[0].interval>=this._d;)this._q.shift()},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){for(var a=this._s.now();this._q.length>0;){var b=this._q.shift();a-b.interval<=this._d&&this._o.onNext(b.value)}this._o.onCompleted()},b}(Nc);Mc.takeLastWithTime=function(a,b){return pc(b)||(b=Bc),new fg(this,a,b)},Mc.takeLastBufferWithTime=function(a,b){var c=this;return pc(b)||(b=Bc),new xg(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)};var hg=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,a.call(this)}function c(a,b){b.onCompleted()}return Wb(b,a),b.prototype.subscribeCore=function(a){return new jc(this._s.scheduleFuture(a,this._d,c),this.source.subscribe(a))},b}(Tc);Mc.takeWithTime=function(a,b){return pc(b)||(b=Bc),new hg(this,a,b)};var ig=function(a){function b(b,c,d){this.source=b,this._d=c,this._s=d,this._open=!1,a.call(this)}function c(a,b){b._open=!0}return Wb(b,a),b.prototype.subscribeCore=function(a){return new jc(this._s.scheduleFuture(this,this._d,c),this.source.subscribe(new jg(a,this)))},b}(Tc),jg=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.skipWithTime=function(a,b){return pc(b)||(b=Bc),new ig(this,a,b)};var kg=function(a){function b(b,c,d){this.source=b,this._st=c,this._s=d,a.call(this)}function c(a,b){b._open=!0}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._open=!1,new jc(this._s.scheduleFuture(this,this._st,c),this.source.subscribe(new lg(a,this)))},b}(Tc),lg=function(a){function b(b,c){this._o=b,this._p=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){this._p._open&&this._o.onNext(a)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._o.onCompleted()},b}(Nc);Mc.skipUntilWithTime=function(a,b){return pc(b)||(b=Bc),new kg(this,a,b)},Mc.takeUntilWithTime=function(a,b){pc(b)||(b=Bc);var c=this;return new xg(function(d){return new jc(b.scheduleFuture(d,a,function(a,b){b.onCompleted()}),c.subscribe(d))},c)},Mc.throttle=function(a,b){pc(b)||(b=Bc);var c=+a||0;if(0>=c)throw new RangeError(\"windowDuration cannot be less or equal zero.\");var d=this;return new xg(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var mg=function(a){function b(b,c){this._o=b,this._xform=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){\nvar b=$a(this._xform[\"@@transducer/step\"]).call(this._xform,this._o,a);b===Za&&this._o.onError(b.e)},b.prototype.error=function(a){this._o.onError(a)},b.prototype.completed=function(){this._xform[\"@@transducer/result\"](this._o)},b}(Nc);Mc.transduce=function(a){var b=this;return new xg(function(c){var d=a(Da(c));return b.subscribe(new mg(c,d))},b)};var ng=function(a){function b(b){this.source=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc,c=new _b,d={hasCurrent:!1,isStopped:!1,o:a,g:c};return c.add(b),b.setDisposable(this.source.subscribe(new og(d))),c},b}(Tc),og=function(a){function b(b){this._s=b,a.call(this)}function c(b,c){this._s=b,this._i=c,a.call(this)}return Wb(b,a),b.prototype.next=function(a){if(!this._s.hasCurrent){this._s.hasCurrent=!0,Xa(a)&&(a=dd(a));var b=new hc;this._s.g.add(b),b.setDisposable(a.subscribe(new c(this._s,b)))}},b.prototype.error=function(a){this._s.o.onError(a)},b.prototype.completed=function(){this._s.isStopped=!0,!this._s.hasCurrent&&1===this._s.g.length&&this._s.o.onCompleted()},Wb(c,a),c.prototype.next=function(a){this._s.o.onNext(a)},c.prototype.error=function(a){this._s.o.onError(a)},c.prototype.completed=function(){this._s.g.remove(this._i),this._s.hasCurrent=!1,this._s.isStopped&&1===this._s.g.length&&this._s.o.onCompleted()},b}(Nc);Mc.switchFirst=function(){return new ng(this)},Mc.flatMapFirst=Mc.exhaustMap=function(a,b,c){return new Uc(this,a,b,c).switchFirst()},Mc.flatMapWithMaxConcurrent=Mc.flatMapMaxConcurrent=function(a,b,c,d){return new Uc(this,b,c,d).merge(a)};var pg=Qa.VirtualTimeScheduler=function(a){function b(b,c){this.clock=b,this.comparer=c,this.isEnabled=!1,this.queue=new Zb(1024),a.call(this)}Wb(b,a);var c=b.prototype;return c.now=function(){return this.toAbsoluteTime(this.clock)},c.schedule=function(a,b){return this.scheduleAbsolute(a,this.clock,b)},c.scheduleFuture=function(a,b,c){var d=b instanceof Date?this.toRelativeTime(b-this.now()):this.toRelativeTime(b);return this.scheduleRelative(a,d,c)},c.add=jb,c.toAbsoluteTime=jb,c.toRelativeTime=jb,c.schedulePeriodic=function(a,b,c){var d=new sc(this,a,b,c);return d.start()},c.scheduleRelative=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsolute(a,d,c)},c.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},c.stop=function(){this.isEnabled=!1},c.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new gb;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},c.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new gb;0!==c&&this.advanceTo(b)},c.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new gb;this.clock=b},c.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},c.scheduleAbsolute=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new mc(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},b}(nc);Qa.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Va;a.call(this,d,e)}Wb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toAbsoluteTime=function(a){return new Date(a).getTime()},c.toRelativeTime=function(a){return a},b}(Qa.VirtualTimeScheduler),Ea.prototype.equals=function(a){return a===this?!0:null==a?!1:\"N\"!==a.kind?!1:this.predicate(a.value)},Fa.prototype.equals=function(a){return a===this?!0:null==a?!1:\"E\"!==a.kind?!1:this.predicate(a.error)};var qg=Qa.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return\"function\"==typeof b?new rg(a,new Ea(b)):new rg(a,Dc.createOnNext(b))},onError:function(a,b){return\"function\"==typeof b?new rg(a,new Fa(b)):new rg(a,Dc.createOnError(b))},onCompleted:function(a){return new rg(a,Dc.createOnCompleted())},subscribe:function(a,b){return new sg(a,b)}},rg=Qa.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||Ua};rg.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},rg.prototype.toString=function(){return this.value.toString()+\"@\"+this.time};var sg=Qa.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};sg.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},sg.prototype.toString=function(){return\"(\"+this.subscribe+\", \"+(this.unsubscribe===Number.MAX_VALUE?\"Infinite\":this.unsubscribe)+\")\"};var tg=Qa.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};tg.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var ug=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}Wb(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new rg(this.scheduler.clock,Dc.createOnNext(a)))},c.onError=function(a){this.messages.push(new rg(this.scheduler.clock,Dc.createOnError(a)))},c.onCompleted=function(){this.messages.push(new rg(this.scheduler.clock,Dc.createOnCompleted()))},b}(Kc);Ga.prototype.then=function(b,c){var d=this;this.subscriptions.push(new sg(this.scheduler.clock));var e,f=this.subscriptions.length-1,g=Qa.Observer.create(function(c){var h=b(c);if(h&&\"function\"==typeof h.then)e=h;else{var i=d.scheduler.clock;e=new Ga(d.scheduler,[Qa.ReactiveTest.onNext(i,a),Qa.ReactiveTest.onCompleted(i)])}var j=d.observers.indexOf(g);d.observers.splice(j,1),d.subscriptions[f]=new sg(d.subscriptions[f].subscribe,d.scheduler.clock)},function(a){c(a);var b=d.observers.indexOf(g);d.observers.splice(b,1),d.subscriptions[f]=new sg(d.subscriptions[f].subscribe,d.scheduler.clock)});return this.observers.push(g),e||new Ga(this.scheduler,this.messages)};var vg=function(a){function b(b,c){a.call(this);var d,e,f=this;this.scheduler=b,this.messages=c,this.subscriptions=[],this.observers=[];for(var g=0,h=this.messages.length;h>g;g++)d=this.messages[g],e=d.value,function(a){b.scheduleAbsolute(null,d.time,function(){for(var b=f.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return dc})}(e)}return Wb(b,a),b.prototype._subscribe=function(a){var b=this;this.observers.push(a),this.subscriptions.push(new sg(this.scheduler.clock));var c=this.subscriptions.length-1;return cc(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new sg(b.subscriptions[c].subscribe,b.scheduler.clock)})},b}(Sc),wg=function(a){function b(b,c){a.call(this),this.scheduler=b,this.messages=c,this.subscriptions=[]}return Wb(b,a),b.prototype._subscribe=function(a){var b,c,d=this;this.subscriptions.push(new sg(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new _b,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelative(null,b.time,function(){return c.accept(a),dc}))}(c);return cc(function(){d.subscriptions[e]=new sg(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})},b}(Sc);Qa.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function c(){a.call(this,0,b)}return Wb(c,a),c.prototype.scheduleAbsolute=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsolute.call(this,b,c,d)},c.prototype.add=function(a,b){return a+b},c.prototype.toAbsoluteTime=function(a){return new Date(a).getTime()},c.prototype.toRelativeTime=function(a){return a},c.prototype.startScheduler=function(a,b){b||(b={}),null==b.created&&(b.created=qg.created),null==b.subscribed&&(b.subscribed=qg.subscribed),null==b.disposed&&(b.disposed=qg.disposed);var c,d,e=this.createObserver();return this.scheduleAbsolute(null,b.created,function(){return c=a(),dc}),this.scheduleAbsolute(null,b.subscribed,function(){return d=c.subscribe(e),dc}),this.scheduleAbsolute(null,b.disposed,function(){return d.dispose(),dc}),this.start(),e},c.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new vg(this,a)},c.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new wg(this,a)},c.prototype.createResolvedPromise=function(a,b){return new Ga(this,[Qa.ReactiveTest.onNext(a,b),Qa.ReactiveTest.onCompleted(a)])},c.prototype.createRejectedPromise=function(a,b){return new Ga(this,[Qa.ReactiveTest.onError(a,b)])},c.prototype.createObserver=function(){return new ug(this)},c}(pg);var xg=Qa.AnonymousObservable=function(a){function b(a){return a&&Ya(a.dispose)?a:Ya(a)?cc(a):dc}function c(a,c){var d=c[0],f=c[1],g=$a(f.__subscribe).call(f,d);g!==Za||d.fail(Za.e)||e(Za.e),d.setDisposable(b(g))}function d(b,c){this.source=c,this.__subscribe=b,a.call(this)}return Wb(d,a),d.prototype._subscribe=function(a){var b=new yg(a),d=[b,this];return wc.scheduleRequired()?wc.schedule(d,c):c(null,d),b},d}(Sc),yg=function(a){function b(b){a.call(this),this.observer=b,this.m=new hc}Wb(b,a);var c=b.prototype;return c.next=function(a){var b=$a(this.observer.onNext).call(this.observer,a);b===Za&&(this.dispose(),e(b.e))},c.error=function(a){var b=$a(this.observer.onError).call(this.observer,a);this.dispose(),b===Za&&e(b.e)},c.completed=function(){var a=$a(this.observer.onCompleted).call(this.observer);this.dispose(),a===Za&&e(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Nc),zg=function(a){function b(b,c){this._m=b,this._u=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return new jc(this._m.getDisposable(),this._u.subscribe(a))},b}(Tc),Ag=function(a){function b(b,c,d){a.call(this),this.key=b,this.underlyingObservable=d?new zg(d,c):c}return Wb(b,a),b.prototype._subscribe=function(a){return this.underlyingObservable.subscribe(a)},b}(Sc),Bg=Qa.Subject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Wb(b,a),Xb(b.prototype,Kc.prototype,{_subscribe:function(a){return fc(this),this.isStopped?this.hasError?(a.onError(this.error),dc):(a.onCompleted(),dc):(this.observers.push(a),new Cf(this,a))},hasObservers:function(){return fc(this),this.observers.length>0},onCompleted:function(){if(fc(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(fc(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(fc(this),!this.isStopped)for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),b.create=function(a,b){return new Fg(a,b)},b}(Sc),Cg=Qa.AsyncSubject=function(a){function b(){a.call(this),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Wb(b,a),Xb(b.prototype,Kc.prototype,{_subscribe:function(a){return fc(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),dc):(this.observers.push(a),new Cf(this,a))},hasObservers:function(){return fc(this),this.observers.length>0},onCompleted:function(){var a,b;if(fc(this),!this.isStopped){this.isStopped=!0;var d=c(this.observers),b=d.length;if(this.hasValue)for(a=0;b>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;b>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(fc(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){fc(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.error=null,this.value=null}}),b}(Sc),Dg=Qa.BehaviorSubject=function(a){function b(b){a.call(this),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Wb(b,a),Xb(b.prototype,Kc.prototype,{_subscribe:function(a){return fc(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),dc):(this.observers.push(a),a.onNext(this.value),new Cf(this,a))},getValue:function(){return fc(this),this.hasError&&e(this.error),this.value},hasObservers:function(){return fc(this),this.observers.length>0},onCompleted:function(){if(fc(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=c(this.observers),d=b.length;d>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(fc(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onError(a);this.observers.length=0}},onNext:function(a){if(fc(this),!this.isStopped){this.value=a;for(var b=0,d=c(this.observers),e=d.length;e>b;b++)d[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.error=null}}),b}(Sc),Eg=Qa.ReplaySubject=function(a){function b(a,b){return cc(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(b,c,d){this.bufferSize=null==b?e:b,this.windowSize=null==c?e:c,this.scheduler=d||wc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this)}var e=Math.pow(2,53)-1;return Wb(d,a),Xb(d.prototype,Kc.prototype,{_subscribe:function(a){fc(this);var c=new Qc(this.scheduler,a),d=b(this,c);this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d},hasObservers:function(){return fc(this),this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(fc(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var d=0,e=c(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(fc(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var d=0,e=c(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(fc(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,d=c(this.observers),e=d.length;e>b;b++){var f=d[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),d}(Sc),Fg=Qa.AnonymousSubject=function(a){function b(b,c){this.observer=b,this.observable=c,a.call(this)}return Wb(b,a),Xb(b.prototype,Kc.prototype,{_subscribe:function(a){return this.observable.subscribe(a)},onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),b}(Sc);Qa.Pauser=function(a){function b(){a.call(this)}return Wb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Bg),\"function\"==typeof define&&\"object\"==typeof define.amd&&define.amd?(Pa.Rx=Qa,define(function(){return Qa})):Ia&&Ja?Na?(Ja.exports=Qa).Rx=Qa:Ia.Rx=Qa:Pa.Rx=Qa;var Gg=j()}).call(this);\n//# sourceMappingURL=rx.all.map"
  },
  {
    "path": "src/preview/core/Application.uno",
    "content": "using System;\nusing Uno;\nusing Uno.IO;\nusing Uno.UX;\nusing Uno.Net;\nusing Uno.Collections;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Fuse.Controls;\nusing Fuse.Elements;\nusing Fuse.Input;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class FusionInterop\n\t{\n\t\tpublic static void OnPointerPressed(object obj, Action<float2> handler)\n\t\t{\n\t\t\tvar visual = obj as Element;\n\t\t\tif (visual == null)\n\t\t\t\treturn;\n\n\t\t\tvisual.HitTestMode = HitTestMode.LocalBounds;\n\t\t\tPointer.Pressed.AddHandler(visual, new FusionInterop { _handler = handler }.Handler);\n\t\t}\n\n\t\tpublic static void OnPointerMoved(object obj, Action<float2> handler)\n\t\t{\n\t\t\tvar visual = obj as Element;\n\t\t\tif (visual == null)\n\t\t\t\treturn;\n\n\t\t\tvisual.HitTestMode = HitTestMode.LocalBounds;\n\t\t\tPointer.Moved.AddHandler(visual, new FusionInterop { _handler = handler }.Handler);\n\t\t}\n\n\t\tAction<float2> _handler;\n\n\t\tvoid Handler(object sender, PointerPressedArgs args)\n\t\t{\n\t\t\t_handler(args.WindowPoint);\n\t\t}\n\t\t\n\t\tvoid Handler(object sender, PointerMovedArgs args)\n\t\t{\n\t\t\t_handler(args.WindowPoint);\n\t\t}\n\n\t\tpublic static IList<object> HitTest(float2 point)\n\t\t{\n\t\t\tvar visual = Outracks.Simulator.Client.Context.App;\n\t\t\tvar query = new HitTestQuery();\n\t\t\tvar args = new HitTestContext(point, query.Select);\n\t\t\tvisual.HitTest(args);\n\t\t\targs.Dispose();\n\t\t\treturn query.HitObjects;\n\t\t}\n\t}\n\n\tclass HitTestQuery\n\t{\n\t\tpublic readonly List<object> HitObjects = new List<object>(); \n\t\tpublic void Select(HitTestResult result)\n\t\t{\n\t\t\tHitObjects.Add(result.HitObject);\n\t\t}\n\t}\n}\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Runtime;\n\tusing Bytecode;\n\tusing Protocol;\n\tusing Runtime;\n\tusing Fuse;\n\tusing Fuse.Input;\n\t\n\t\n\tpublic class Application : Fuse.App, IPointerEventResponder\n\t{\n\t\tState _state = new Uninitialized();\n\t\tIPointerEventResponder _defaultPointerEventResponder;\n\t\treadonly ConcurrentQueue<Action> _dispatcher = new ConcurrentQueue<Action>();\n\n\t\tpublic IReflection Reflection { get; set; }\n\n\t\tpublic Application(IPEndPoint[] proxyEndpoints, string project, string[] defines)\n\t\t{\n\t\t\tContext.SetGlobals(proxyEndpoints, project, defines);\n\n\t\t\t_defaultPointerEventResponder = Pointer.EventResponder;\n\t\t\tPointer.EventResponder = this;\n\t\t\tUnhandledException += OnUnhandledException;\n\n\t\t\tvar fakeApp = new FakeApp(this);\n\t\t\tUserAppState.Default = UserAppState.Save(fakeApp);\n\n\t\t\tif defined(CPLUSPLUS)\n\t\t\t\tResetEverything(true, new Panel());\n\n\t\t\t_developerMenu = new Outracks.Simulator.DeveloperMenu();\n\t\t}\n\n\t\tpublic void ResetEverything(bool initial, object overlay = null)\n\t\t{\n\t\t\tvar fakeApp = new FakeApp(this);\n\n\t\t\tContext.SetApp(fakeApp);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach (var panel in Children)\n\t\t\t\t\t((Panel)panel).Children.Clear();\n\n\t\t\t\tChildren.Clear();\n\t\t\t} \n\t\t\tcatch( Exception e ) \n\t\t\t{\n\t\t\t\tFuse.Diagnostics.UnknownException(\"Failed to properly reset. Try exiting Fuse and restarting.\",\n\t\t\t\t\te, this );\n\t\t\t}\n\t\t\t\n\t\t\tvar p = new Panel();\n\n\t\t\tif (overlay != null)\n\t\t\t\tp.Children.Add((Node)overlay);\n\t\t\telse if (Children.Count > 0 && ((Panel)Children[0]).Children.Count > 0)\n\t\t\t\tp.Children.Add((Node)((Panel)Children[0]).Children[0]);\n\n\t\t\tp.Children.Add(fakeApp);\n\t\t\tChildren.Add(p);\n\t\t}\n\n\n\t\t// Detect three-finger left swipe for developer menu\n\t\tList<PointerPressedArgs> pointers = new List<PointerPressedArgs>();\n\t\t\n\t\tpublic void OnPointerPressed(PointerPressedArgs args)\n\t\t{\n\t\t\tif defined(!DOTNET)\n\t\t\t{\n\t\t\t\tpointers.Add(args);\n\t\t\t\tif (pointers.Count == 3)\n\t\t\t\t\tFuse.Timer.Wait(1, ShowDeveloperMenu);\n\t\t\t}\n\t\t\t\n\t\t\t//SetState(_state.OnPointerPressed(args));\n\t\t\t//if (!args.IsHandled)\n\t\t\t\t_defaultPointerEventResponder.OnPointerPressed(args);\n\t\t}\n\n\t\tOutracks.Simulator.DeveloperMenu _developerMenu;\n\n\t\tvoid ShowDeveloperMenu()\n\t\t{\n\t\t\tif (pointers.Count != 3) return;\n\n\t\t\t// Cancel other gestures\n\t\t\tfor (int i = 0; i < pointers.Count; i++)\n\t\t\t{\n\t\t\t\tif (pointers[i].TryHardCapture(this, DoNothing))\n\t\t\t\t\tpointers[i].ReleaseCapture(this);\n\t\t\t}\n\n\t\t\tif (!Children.Contains(_developerMenu))\n\t\t\t{\n\t\t\t\tChildren.Insert(0, _developerMenu);\n\t\t\t}\n\t\t}\n\n\t\tvoid DoNothing() { }\n\n\t\tpublic void OnPointerMoved(PointerMovedArgs args)\n\t\t{\n\t\t\t//SetState(_state.OnPointerPressed(args));\n\t\t\t//if (!args.Handled)\n\t\t\t\t_defaultPointerEventResponder.OnPointerMoved(args);\n\t\t}\n\n\t\tpublic void OnPointerReleased(PointerReleasedArgs args)\n\t\t{\n\t\t\tfor (int i = 0; i < pointers.Count; i++)\n\t\t\t\tif (pointers[i].PointIndex == args.PointIndex)\n\t\t\t\t{\n\t\t\t\t\tpointers.RemoveAt(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t//SetState(_state.OnPointerPressed(args));\n\t\t\t//if (!args.Handled)\n\t\t\t\t_defaultPointerEventResponder.OnPointerReleased(args);\n\t\t}\n\n\t\tpublic void OnPointerWheelMoved(PointerWheelMovedArgs args)\n\t\t{\n\t\t\t//SetState(_state.OnPointerPressed(args));\n\t\t\t//if (!args.Handled)\n\t\t\t\t_defaultPointerEventResponder.OnPointerWheelMoved(args);\n\t\t}\n\n\n\t\tConcurrentQueue<Exception> _exception = new ConcurrentQueue<Exception>();\n \n\t\tvoid OnUnhandledException(object sender, UnhandledExceptionArgs args)\n\t\t{\n\t\t\targs.IsHandled = true;\n\t\t\t_exception.Enqueue(args.Exception);\n\t\t}\n\n\t\tprotected override void OnUpdate()\n\t\t{\n\t\t\tException exception = null, t;\n\t\t\t//drop all but last one\n\t\t\twhile (_exception.TryDequeue(out t))\n\t\t\t\texception = t;\n\t\t\tif (exception != null)\n\t\t\t{\n\t\t\t\t//A quick fix, a more proper fix would be https://github.com/fusetools/Fuse/issues/2174\n\t\t\t\tif (_state is Faulted)\n\t\t\t\t{\n\t\t\t\t\t//debug_log exception.Message;\n\t\t\t\t\t//debug_log \"Failure state within a failed state. Simply ignoring that.\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tResetEverything(false);\n\t\t\t\t\tSetState(_state.OnException(exception));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAction action;\n\t\t\twhile (_dispatcher.TryDequeue(out action))\n\t\t\t\taction();\n\n\t\t\tSetState(_state.OnUpdate());\n\t\t\tbase.OnUpdate();\n\t\t}\n\n\t\tvoid SetState(State nextState)\n\t\t{\n\t\t\twhile (nextState != _state)\n\t\t\t{\n\t\t\t\t_state.OnLeaveState();\n\t\t\t\t_state = nextState;\n\t\t\t\tnextState = _state.OnEnterState();\n\t\t\t}\n\t\t}\n\t}\n\n\tabstract class State\n\t{\n\t\tpublic virtual State OnEnterState()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic virtual void OnLeaveState()\n\t\t{\n\t\t}\n\n\t\tpublic virtual State OnUpdate()\n\t\t{\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic abstract State OnException(Exception e);\n\t}\n\n}\n"
  },
  {
    "path": "src/preview/core/ApplicationStates.uno",
    "content": "using Uno;\nusing Uno.IO;\nusing Uno.Net;\nusing Uno.Net.Sockets;\nusing Uno.Collections;\nusing Uno.Compiler.ExportTargetInterop;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Fuse.Controls;\nusing Fuse.Elements;\nusing Fuse.Input;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\tusing Protocol;\n\tusing Runtime;\n\tusing UnoHost;\n\n\n\t// Uninitialized state\n\n\tsealed class Uninitialized : State\n\t{\n\t\tpublic override State OnUpdate()\n\t\t{\n\t\t\tif (((Application)Uno.Application.Current).Reflection != null)\n\t\t\t\treturn new ConnectingToProxy();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override State OnException(Exception e)\n\t\t{\n\t\t\treturn new Faulted(isOnline: false, exception: e, buttons: new DialogButton(\"Try again\", this));\n\t\t}\n\t}\n\n\t// Connecting states\n\n\tabstract class Connecting : State\n\t{\n\t\tpublic override State OnException(Exception e)\n\t\t{\n\t\t\tif (e is Outracks.Simulator.DesignerNotRunning)\n\t\t\t\treturn new DesignerNotRunning();\n\t\t\treturn new FailedToConnect(e);\n\t\t}\n\t}\n\n\n\tsealed class ConnectingToProxy : Connecting\n\t{\n\t\treadonly IPEndPoint[] _proxyEndpoints;\n\t\tTask<IPEndPoint[]> _connecting;\n\n\t\tpublic ConnectingToProxy(IPEndPoint[] proxyEndpoints)\n\t\t{\n\t\t\t_proxyEndpoints = proxyEndpoints;\n\t\t}\n\n\t\tpublic ConnectingToProxy()\n\t\t{\n\t\t\t_proxyEndpoints = Context.ProxyEndpoints;\n\t\t}\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\tif defined(DOTNET)\n\t\t\t{\n\t\t\t\tvar args = Uno.Environment.GetCommandLineArgs();\n\t\t\t\tvar index = Array.IndexOf(args, \"--host\");\n\t\t\t\tif (index != -1)\n\t\t\t\t{\n\t\t\t\t\treturn new ConnectingToHost(new [] { new IPEndPoint(IPAddress.Parse(args[index+1]), int.Parse(args[index+2])) });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_connecting = ProxyClient.GetSimulatorEndpoint(_proxyEndpoints, Context.Project, Context.Defines);\n\t\t\tif defined(!DOTNET)\n\t\t\t{\n\t\t\t\tLoadingScreen.Show(Context.App, \"Connecting\", \"Connecting to computer...\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\tLoadingScreen.Show(Context.App, \"Loading\", \"Loading project...\");\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override State OnUpdate()\n\t\t{\n\t\t\tif (_connecting.IsCompleted)\n\t\t\t\treturn new ConnectingToHost(_connecting.Result);\n\t\t\t\n\t\t\treturn this;\n\t\t}\n\t}\n\n\tsealed class ConnectingToHost : Connecting\n\t{\n\t\treadonly IPEndPoint[] _simulatorEndpoints;\n\n\t\tpublic ConnectingToHost(IEnumerable<IPEndPoint> simulatorEndpoints)\n\t\t{\n\t\t\t_simulatorEndpoints = simulatorEndpoints.ToArray();\n\t\t}\n\n\t\tTask<Socket> _connecting;\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\t_connecting = ConnectToFirstRespondingEndpoint.Execute(_simulatorEndpoints);\n\t\t\tif defined(!DOTNET)\n\t\t\t{\n\t\t\t\tLoadingScreen.Show(Context.App, \"Connecting\", \"Fetching project data from computer\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tLoadingScreen.Show(Context.App, \"Loading\", \"Loading data...\");\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override State OnUpdate()\n\t\t{\n\t\t\tif (_connecting.IsCompleted)\n\t\t\t{\n\t\t\t\tvar client = new SimulatorClient(_connecting.Result);\n\t\t\t\tUno.Platform.CoreApp.Terminating += Closure.ToAppStateChangeHandler(client.Dispose);\n\t\t\t\treturn new Idle(client);\n\t\t\t}\n\t\t\t\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t// Connected states\n\n\tabstract class Connected : State\n\t{\n\t\tprotected readonly ISimulatorClient Client;\n\n\t\tprotected Connected(\n\t\t\tISimulatorClient client)\n\t\t{\n\t\t\tClient = client;\n\t\t}\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\tif defined(PREVIEW)\n\t\t\t\tLog.SetHandler(SendDebugLog);\n\t\t\telse\n\t\t\t\tthrow new InvalidOperationException(\"PREVIEW is not defined\");\n\n\t\t\tClient.Send(new RegisterName(DeviceInfo.GUID, DeviceInfo.Name));\n\t\t\tFuse.Diagnostics.DiagnosticReported += OnDiagnosticReported;\n\t\t\tFuse.Diagnostics.DiagnosticDismissed += OnDiagnosticDismissed;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void OnLeaveState()\n\t\t{\n\t\t\tFuse.Diagnostics.DiagnosticReported -= OnDiagnosticReported;\n\t\t\tFuse.Diagnostics.DiagnosticDismissed -= OnDiagnosticDismissed;\n\t\t}\n\n\t\tpublic override State OnException(Exception e)\n\t\t{\n\t\t\tvar exceptions = Exceptions.Unpack(e);\n\t\t\tExceptions.Send(Client, exceptions);\n\t\t\tvar f = exceptions.Count == 1 ? exceptions[0] : e;\n\t\t\treturn OnFaulted(f);\n\t\t}\n\n\t\tprotected abstract State OnFaulted(Exception e);\n\n\t\tpublic override State OnUpdate()\n\t\t{\n\t\t\tIBinaryMessage message;\n\t\t\twhile (Client.IncommingMessages.TryDequeue(out message))\n\t\t\t{\n\t\t\t\tvar newState = NextState(message);\n\t\t\t\tif (newState != this) \n\t\t\t\t\treturn newState;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tState NextState(IBinaryMessage message)\n\t\t{\n\t\t\tvar bcg = message.TryParse(BytecodeGenerated.MessageType, (Func<System.IO.BinaryReader, BytecodeGenerated>)BytecodeGenerated.ReadDataFrom);\n\n\t\t\tif (bcg.HasValue)\n\t\t\t\treturn OnReify(bcg.Value);\n\n\t\t\tvar bu = message.TryParse(BytecodeUpdated.MessageType, (Func<System.IO.BinaryReader, BytecodeUpdated>)BytecodeUpdated.ReadDataFrom);\n\t\t\tif (bu.HasValue)\n\t\t\t\treturn OnExecute(bu.Value);\n\n\t\t\tvar e = message.TryParse(Error.MessageType, (Func<System.IO.BinaryReader, Error>)Error.ReadDataFrom);\n\t\t\tif (e.HasValue)\n\t\t\t\treturn OnConnectionError(e.Value);\n\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected virtual State OnReify(BytecodeGenerated reify)\n\t\t{\n\t\t\treturn new Reifying(Client, reify);\n\t\t}\n\n\t\tprotected virtual State OnExecute(BytecodeUpdated args)\n\t\t{\n\t\t\tVirtualMachine.Execute(args.Function);\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected virtual State OnConnectionError(Error error)\n\t\t{\n\t\t\treturn new ConnectionLost(error.Exception);\n\t\t}\n\n\t\tstatic Dictionary<Fuse.Diagnostic, Protocol.Diagnostic> _activeDiagnostics = new Dictionary<Fuse.Diagnostic, Protocol.Diagnostic>();\n\t\tstatic object _mutex = new object();\n\n\t\tprivate void OnDiagnosticReported(Fuse.Diagnostic d)\n\t\t{\n\t\t\tlock(_mutex)\n\t\t\t{\n\t\t\t\tvar diag = new Protocol.Diagnostic(DeviceInfo.GUID, DeviceInfo.Name, d.Message, d.ToString(), d.FilePath, d.LineNumber, 0);\n\t\t\t\tClient.Send(diag);\n\t\t\t\t_activeDiagnostics.Add(d, diag);\n\t\t\t}\n\t\t}\n\n\t\tprivate void OnDiagnosticDismissed(Fuse.Diagnostic d)\n\t\t{\n\t\t\tlock(_mutex)\n\t\t\t{\n\t\t\t\tProtocol.Diagnostic diag;\n\t\t\t\tif (_activeDiagnostics.TryGetValue(d, out diag))\n\t\t\t\t{\n\t\t\t\t\tClient.Send(new DismissDiagnostic(DeviceInfo.GUID, DeviceInfo.Name, diag.DiagnosticId));\n\t\t\t\t\t_activeDiagnostics.Remove(d);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void DismissAllActiveDiagnostics()\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t{\n\t\t\t\tforeach (var k in _activeDiagnostics)\n\t\t\t\t{\n\t\t\t\t\tClient.Send(new DismissDiagnostic(DeviceInfo.GUID, DeviceInfo.Name, k.Value.DiagnosticId));\n\t\t\t\t}\n\t\t\t\t_activeDiagnostics.Clear();\n\t\t\t}\n\t\t}\n\n\t\tprivate void SendDebugLog(Uno.Diagnostics.LogLevel level, string text)\n\t\t{\n\t\t\tClient.Send(new DebugLog(DeviceInfo.GUID, DeviceInfo.Name, text));\n\t\t}\n\t}\n\n\tsealed class Idle : Connected\n\t{\n\t\tpublic Idle(ISimulatorClient client) \n\t\t\t: base(client) \n\t\t{ }\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\tbase.OnEnterState();\n\t\t\tLoadingScreen.Show(Context.App, \"Loading\", \"Starting project...\");\n\t\t\treturn this;\n\t\t}\n\n\t\tprotected override State OnFaulted(Exception e)\n\t\t{\n\t\t\treturn new Faulted(Client.IsOnline, e, new DialogButton(\"Try again\", this));\n\t\t}\n\n\t}\n\n\tsealed class Reifying : Connected\n\t{\n\t\treadonly BytecodeGenerated _reify;\n\n\t\tpublic Reifying(ISimulatorClient client, BytecodeGenerated reify)\n\t\t\t: base(client)\n\t\t{\n\t\t\t_reify = reify;\n\t\t}\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\tbase.OnEnterState();\n\t\t\tDismissAllActiveDiagnostics();\n\n\t\t\tobject previousState = null;\n\t\t\tif (Context.App.RootViewport != null)\n\t\t\t\tpreviousState = Context.App.RootViewport.SavePreviewState();\n\n\t\t\t//prepare for new nodes\n\t\t\tUserAppState.Default.ApplyTo(Context.App);\n\t\t\tif (Context.App.RootViewport != null)\n\t\t\t\tContext.App.RootViewport.RestorePreviewState(previousState);\n\n\t\t\tVirtualMachine.Execute(_reify.Bytecode.Reify, Context.App);\n\t\t\tvar userState = UserAppState.Save(Context.App);\n\n\t\t\treturn new Running(Client, userState, _reify);\n\t\t}\n\n\t\tprotected override State OnFaulted(Exception e)\n\t\t{\n\t\t\treturn new Faulted(Client.IsOnline, e, new DialogButton(\"Try again\", new ConnectingToProxy()));\n\t\t}\n\t}\n\n\t// HACK: This avoids missing entity causing https://github.com/fusetools/Fuse/issues/3149\n\t[Require(\"Entity\", \"Uno.UX.SimulatedProperties.Set(Uno.UX.PropertyObject,string,object,Uno.UX.IPropertyListener)\")]\n\t[Require(\"Entity\", \"Uno.UX.SimulatedProperties.Get(Uno.UX.PropertyObject,string)\")]\n\tpublic static class VirtualMachine\n\t{\n\t\tpublic static object Execute(Lambda lambda, params object[] arguments)\n\t\t{\n\t\t\treturn Execute(((Application)Uno.Application.Current).Reflection, lambda, arguments);\n\t\t}\n\n\t\tpublic static object Execute(IReflection reflection, Lambda lambda, params object[] arguments)\n\t\t{\n\t\t\treturn new ScopeClosure(new Outracks.Simulator.Runtime.Environment(Optional.None<Outracks.Simulator.Runtime.Environment>()), reflection).Execute(lambda, arguments);\n\t\t}\n\t}\n\n\tsealed class Running : Connected\n\t{\n\t\treadonly BytecodeGenerated _runningReify;\n\t\tfloat _zoomWhenRooted;\n\n\t\tUserAppState _userApp;\n\n\t\tpublic Running(\n\t\t\tISimulatorClient client,\n\t\t\tUserAppState userApp,\n\t\t\tBytecodeGenerated runningReify)\n\t\t\t: base(client)\n\t\t{\n\t\t\t_userApp = userApp;\n\t\t\t_runningReify = runningReify;\n\t\t}\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\tbase.OnEnterState();\n\t\t\t_userApp.ApplyTo(Context.App);\n\t\t\t_zoomWhenRooted = QueryDensity();\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override void OnLeaveState()\n\t\t{\n\t\t\tbase.OnLeaveState();\n\t\t\t_userApp = UserAppState.Save(Context.App);\n\t\t}\n\n\t\tpublic override State OnUpdate()\n\t\t{\n\t\t\tvar currentZoom = QueryDensity();\n\t\t\tif (currentZoom != _zoomWhenRooted)\n\t\t\t{\n\t\t\t\tdebug_log \"Density changed, reifying\";\n\t\t\t\treturn new Reifying(Client, _runningReify);\n\t\t\t}\n\t\t\t\t\n\t\t\treturn base.OnUpdate();\n\t\t}\n\n\t\tprotected override State OnFaulted(Exception e)\n\t\t{\n\t\t\treturn new Faulted(Client.IsOnline, e, new DialogButton(\"Restart\", new ConnectingToProxy()));\n\t\t}\n\n\t\tstatic float QueryDensity()\n\t\t{\n\t\t\treturn Uno.Platform.Displays.MainDisplay.Density;\n\t\t}\n\t}\n\n\tinternal static class Exceptions\n\t{\n\t\tpublic static void Send(ISimulatorClient client, List<Exception> exceptions)\n\t\t{\n\t\t\tfor (var i = 0; i < exceptions.Count; ++i)\n\t\t\t{\n\t\t\t\tvar unpacked = exceptions[i];\n\t\t\t\tclient.Send(new UnhandledException(DeviceInfo.GUID, DeviceInfo.Name, unpacked.Message, unpacked.StackTrace, unpacked.GetType().ToString()));\n\t\t\t}\n\t\t}\n\n\t\tpublic static List<Exception> Unpack(Exception e)\n\t\t{\n\t\t\tif (e is AggregateException)\n\t\t\t{\n\t\t\t\tvar aggregate = (AggregateException)e;\n\n\t\t\t\tvar exceptions = new List<Exception>();\n\t\t\t\tforeach (var inner in aggregate.InnerExceptions)\n\t\t\t\t\texceptions.AddRange(Unpack(inner));\n\t\t\t\treturn exceptions;\n\t\t\t}\n\t\t\telse if (e.InnerException != null)\n\t\t\t{\n\t\t\t\treturn Unpack(e.InnerException);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn new List<Exception> { e };\n\t\t\t}\n\t\t}\n\t}\n\n\t// Error states\n\n\tsealed class Faulted : ShowingModalDialog\n\t{\n\t\tpublic Faulted(bool isOnline, Exception exception, params DialogButton[] buttons)\n\t\t\t: base(\n\t\t\t\t\"Oops! Something went wrong here.\",\n\t\t\t\texception.Message + (isOnline ? \"\\n\\nPlease refer to the log for details.\" : \"\"),\n\t\t\t\t\"\",\n\t\t\t\tbuttons)\n\t\t{ }\n\t}\n\n\tsealed class ConnectionLost : ShowingModalDialog \n\t{\n\t\tpublic ConnectionLost(Exception exception)\n\t\t\t: this(ExceptionInfo.Capture(exception))\n\t\t{ }\n\n\t\tpublic ConnectionLost(ExceptionInfo exception)\n\t\t\t: base(\n\t\t\t\t\"Connection lost\",\n\t\t\t\texception.Message,\n\t\t\t\t\"\",\n\t\t\t\tnew DialogButton(\"Change IP\", new ChangeIp()),\n\t\t\t\tnew DialogButton(\"Reconnect\", new ConnectingToProxy()))\n\t\t{ }\n\t}\n\n\tsealed class FailedToConnect : ShowingModalDialog\n\t{\n\t\tpublic FailedToConnect(Exception exception)\n\t\t\t: base(\n\t\t\t\t\"Failed to connect\",\n\t\t\t\t\"Please check that this device is connected to the same network as your computer.\",\n\t\t\t\texception.Message,\n\t\t\t\tnew DialogButton(\"Change IP\", new ChangeIp()),\n\t\t\t\tnew DialogButton(\"Try again\", new ConnectingToProxy()))\n\t\t{ }\n\t}\n\n\tsealed class DesignerNotRunning : ShowingModalDialog\n\t{\n\t\tpublic DesignerNotRunning()\n\t\t\t: base(\n\t\t\t\t\"Fuse not running\",\n\t\t\t\t\"Please check that this project is open in Fuse on your computer.\",\n\t\t\t\t\"\",\n\t\t\t\tnew DialogButton(\"Change IP\", new ChangeIp()),\n\t\t\t\tnew DialogButton(\"Try again\", new ConnectingToProxy()))\n\t\t{ }\n\t}\n\n\tsealed class ChangeIp : ShowingPrompt\n\t{\n\t\tpublic ChangeIp(string body = \"\")\n\t\t\t: base(\"Connect to IP\", body + \"\\nE.g. '192.168.1.1'\")\n\t\t{\n\t\t}\n\n\t\tprotected override State OnOk(string input)\n\t\t{\n\t\t\tvar endpoints = new[]\n\t\t\t{\n\t\t\t\tnew IPEndPoint(IPAddress.Parse(input), Context.ProxyEndpoints[0].Port)\n\t\t\t};\n\t\t\treturn new ConnectingToProxy(endpoints);\n\t\t}\n\n\t\tprotected override State OnCancel()\n\t\t{\n\t\t\treturn new ConnectingToProxy();\n\t\t}\n\n\t\tpublic override State OnException(Exception e)\n\t\t{\n\t\t\treturn new ChangeIp(e.Message);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/core/Context.uno",
    "content": "using Uno;\nusing Uno.IO;\nusing Uno.UX;\nusing Uno.Net;\nusing Uno.Collections;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Fuse.Controls;\nusing Fuse.Elements;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\tusing Protocol;\n\tusing Runtime;\n\tusing Fuse;\n\tusing Fuse.Input;\n\t\n\tpublic enum InputMode\n\t{\n\t\tInteractive,\n\t\tDesign,\n\t}\n\n\tpublic static class Context\n\t{\n\t\tpublic static InputMode InputMode { get; private set; }\n\t\tpublic static FakeApp App { get; private set; }\n\t\tpublic static IPEndPoint[] ProxyEndpoints { get; private set; }\n\t\tpublic static string Project { get; private set; }\n\t\tpublic static string[] Defines { get; private set; }\n\n\t\tpublic static IReflection Reflection { get; set; }\n\n\t\tpublic static void SetApp(FakeApp app)\n\t\t{\n\t\t\tApp = app;\n\t\t}\n\n\t\tpublic static void SetGlobals(IPEndPoint[] proxyEndpoints, string project, string[] defines)\n\t\t{\n\t\t\tProxyEndpoints = proxyEndpoints;\n\t\t\tProject = project;\n\t\t\tDefines = defines;\n\t\t}\n\t}\n\t\n}\n"
  },
  {
    "path": "src/preview/core/DashedBrush.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Uno.Collections.EnumerableExtensions;\nusing Uno.Graphics;\nusing Uno.UX;\nusing Fuse.Drawing;\nusing Fuse;\n\npublic sealed class DashedSolidColor : DynamicBrush\n{\n\tstatic Selector _colorName = \"Color\";\n\tstatic Selector _dashSizeName = \"DashSize\";\n\n\tfloat4 _color;\n\t[UXOriginSetter(\"SetColor\")]\n\tpublic float4 Color\n\t{\n\t\tget { return _color; }\n\t\tset\n\t\t{\n\t\t\tif (_color != value)\n\t\t\t{\n\t\t\t\t_color = value;\n\t\t\t\tOnPropertyChanged(_colorName);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfloat _dashSize;\n\tpublic float DashSize\n\t{\n\t\tget { return _dashSize; }\n\t\tset\n\t\t{\n\t\t\tif(_dashSize != value)\n\t\t\t{\n\t\t\t\t_dashSize = value;\n\t\t\t\tOnPropertyChanged(_dashSizeName);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void SetColor(float4 c, IPropertyListener origin)\n\t{\n\t\tif (_color != c)\n\t\t{\n\t\t\t_color = c;\n\t\t\tOnPropertyChanged(_colorName, origin);\n\t\t}\n\t}\n\n\t// Needed for data binding\n\tinternal void SetColor(float4 c)\n\t{\n\t\tColor = c;\n\t}\n\n\tpublic override bool IsCompletelyTransparent { get { return base.IsCompletelyTransparent || Color.W == 0; } }\n\n\tstatic float Box(float2 p, float2 b)\n\t{\n\t\tfloat2 d = Math.Abs(p) - b;\n\t\treturn Math.Min(Math.Max(d.X,d.Y),0.0f) + Vector.Length(Math.Max(d,0.0f));\n\t}\n\n\tstatic float2 Rep(float2 p, float2 c)\n\t{\n\t\treturn Math.Mod(p,c)-0.5f*c;\n\t}\n\n\tfloat2 p: req(TexCoord as float2) pixel TexCoord.XY * CanvasSize.XY;\n\tfloat t:\n\t{\n\t\tfloat2 nRep = CanvasSize.XY / DashSize;\n\t\tint2 iRep = (int2)nRep;\n\t\tif(Math.Mod(iRep.X,2) == 0)\n\t\t\t++iRep.X;\t\t\t\n\t\tif(Math.Mod(iRep.Y,2) == 0)\n\t\t\t++iRep.Y;\n\t\t\t\t\n\t\tnRep = CanvasSize.XY / (float2)iRep;\n\t\tfloat t = Box(Rep(p,nRep*2)+float2(DashSize),float2(DashSize));\n\t\treturn -Math.Floor(t);\n\t};\n\tFinalColor: Math.Lerp(float4(0), Color, Math.Clamp(t,0.f,1.f));\n\n\tpublic DashedSolidColor()\n\t{\n\t\t_color = float4(1);\n\t}\n\n\tpublic DashedSolidColor(float4 color)\n\t{\n\t\t_color = color;\n\t}\n}"
  },
  {
    "path": "src/preview/core/DeveloperMenu.ux",
    "content": "﻿<Panel ux:Class=\"Outracks.Simulator.DeveloperMenu\" Color=\"#000C\" Clicked=\"Close\" >\n  <ClientPanel>\n\t  <Button Alignment=\"TopLeft\" Margin=\"20\" Text=\"Go back\" Clicked=\"GoBack\" />\n    <StackPanel Alignment=\"Center\">\n      <Text Alignment=\"Center\" Color=\"White\">Fuse Preview Menu</Text>\n      <Text Alignment=\"Center\" Color=\"#ddd\">Tap to dismiss</Text>\n    </StackPanel>\n  </ClientPanel>\n  <AddingAnimation>\n\t  <Change this.Opacity=\"0\" Easing=\"CubicIn\" Duration=\"0.3\" />\n    <Scale Factor=\"1.2\" Duration=\"0.3\" Easing=\"BackIn\" />\n  </AddingAnimation>\n  <RemovingAnimation>\n    <Change this.Opacity=\"0\" Easing=\"CubicOut\" Duration=\"0.3\" />\n    <Scale Factor=\"0.8\" Duration=\"0.3\" Easing=\"CubicOut\" />\n  </RemovingAnimation>\n</Panel>"
  },
  {
    "path": "src/preview/core/DeveloperMenu.ux.uno",
    "content": "﻿\nnamespace Outracks.Simulator\n{\n\tpublic partial class DeveloperMenu\n\t{\n\t\tvoid GoBack(object sender, Uno.EventArgs args)\n\t\t{\n\t\t\tFuse.Input.Keyboard.EmulateBackButtonTap();\n\t\t}\n\n\t\tvoid Close(object sender, Uno.EventArgs args)\n\t\t{\n\t\t\tParent.BeginRemoveVisual(this);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/core/DeviceInfo.uno",
    "content": "using System;\nusing Uno;\nusing Uno.Compiler.ExportTargetInterop;\nusing Uno.IO;\nusing Uno.Net;\nusing Uno.Collections;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Fuse.Controls;\nusing Fuse.Elements;\n\nnamespace Outracks.Simulator.Client\n{\n\t[ForeignInclude(Language.Java, \"android.os.Build\")]\n\t[ForeignInclude(Language.ObjC, \"UIKit/UIKit.h\")]\n\tpublic extern(Android || iOS) static class DeviceInfo\n\t{\n\t\tpublic static string Name { get { return GetName(); }}\n\n\t\tpublic static string GUID { get { return GetGUID(); }}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic static extern(iOS) string GetName()\n\t\t@{\n\t\t\treturn [[UIDevice currentDevice] name];\n\t\t@}\n\n\t\t[Foreign(Language.ObjC)]\n\t\tpublic static extern(iOS) string GetGUID()\n\t\t@{\n\t\t\treturn [[[UIDevice currentDevice] identifierForVendor] UUIDString];\n\t\t@}\n\n\t\t[Foreign(Language.Java)]\n\t\tpublic static extern(Android) string GetName()\n\t\t@{\n\t\t\treturn Build.MODEL;\n\t\t@}\n\t\t\n\t\t[Foreign(Language.Java)]\n\t\tpublic static extern(Android) string GetGUID()\n\t\t@{\n\t\t\treturn Build.SERIAL;\n\t\t@}\n\t}\n\n\t[DotNetType(\"System.Guid\")]\n\textern(DotNet) public struct Guid\n\t{\n\t\tprivate extern int _foo;\n\t\tpublic static extern Guid NewGuid();\n\t\tpublic extern override string ToString();\n\t}\n\t\n\tpublic extern(DotNet) static class DeviceInfo\n\t{\n\t\t/******************************** NOTE *****************************************\n\t\t * Before changing the value of 'Name' make sure to find all references to the string 'Viewport',\n\t\t * since there are code out there depending on that specific string!\n\t\t *******************************************************************************/\n\t\tpublic static readonly string Name = \"Viewport\";\n\t\tpublic static readonly string GUID;\n\n\t\tstatic DeviceInfo()\n\t\t{\n\t\t\tGUID = Guid.NewGuid().ToString();\n\t\t}\t\t\n\t}\n\n\tpublic extern(!(DotNet || Android || iOS)) static class DeviceInfo\n\t{\n\t\tpublic static readonly string Name = \"\";\n\t\tpublic static readonly string GUID = \"00000000-0000-0000-0000-000000000000\";\n\t}\n}\n"
  },
  {
    "path": "src/preview/core/Dialogs/LoadingScreen.ux",
    "content": "<Panel ux:Class=\"Outracks.Simulator.Client.Dialogs.LoadingScreen\">\n\n\t<string ux:Property=\"Header\" />\n\t<string ux:Property=\"Message\" />\n\n\t<StackPanel Alignment=\"Center\" Padding=\"40\">\n\t\t<Text Value=\"{Property Header}\" FontSize=\"40\" Margin=\"0,0,0,20\" TextAlignment=\"Center\" TextWrapping=\"Wrap\"\n\t\t      Color=\"#808080\" />\n\t\t<Text Value=\"{Property Message}\" Margin=\"0,0,0,20\" TextWrapping=\"Wrap\"\n\t\t      Color=\"#e6e6e6\" />\n\t</StackPanel>\n\n</Panel>"
  },
  {
    "path": "src/preview/core/Dialogs/ModalButton.ux",
    "content": "<ButtonBase ux:Class=\"Outracks.Simulator.Client.Dialogs.ModalButton\" HitTestMode=\"LocalBoundsAndChildren\">\n    <Text ux:Name=\"Button_Text\"\n        Value=\"{Property this.Text}\" FontSize=\"16\" TextColor=\"#707aff\" Alignment=\"Center\" TextAlignment=\"Center\">\n    </Text>\n\n    <WhilePressed>\n        <Change Target=\"Button_Text.TextColor\" Value=\"#4953d7\" />\n    </WhilePressed>\n    <WhileDisabled>\n        <Change Target=\"Button_Text.Opacity\" Value=\"0.5\" />\n    </WhileDisabled>\n</ButtonBase>\n"
  },
  {
    "path": "src/preview/core/Dialogs/ModalDialog.ux",
    "content": "<Panel ux:Class=\"Outracks.Simulator.Client.Dialogs.ModalDialog\">\n\t\n\t<string ux:Property=\"Header\" />\n\t<string ux:Property=\"Body\" />\n\t<string ux:Property=\"Details\" />\n\n\t<ClientPanel>\n\n\t\t<Grid Rows=\"1*,auto\">\n\n\t\t\t<Grid Rows=\"1*,1*,2*\" Margin=\"40\">\n\n\t\t\t\t<Image File=\"../fight.png\" Width=\"300\" />\n\n\t\t\t\t<Text Value=\"{Property Header}\" FontSize=\"25\" TextAlignment=\"Center\" Alignment=\"VerticalCenter\" TextWrapping=\"Wrap\"\n\t\t\t\t      Color=\"#808080\" />\n\n\t\t\t\t<Panel>\n\t\t\t\t\t<ScrollView Margin=\"0,10,0,10\">\n\t\t\t\t\t\t<StackPanel>\n\t\t\t\t\t\t\t<Text Value=\"{Property Body}\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Alignment=\"HorizontalCenter\" FontSize=\"15\" Margin=\"0,0,0,20\"\n\t\t\t\t\t\t\t      Color=\"#e6e6e6\" />\n\t\t\t\t\t\t\t<Panel>\n\t\t\t\t\t\t\t\t<WhileString Test=\"IsNotEmpty\" Value=\"{Property Details}\">\n\t\t\t\t\t\t\t\t\t<ScrollView Margin=\"0,0,0,20\" AllowedScrollDirections=\"Horizontal\" MaxHeight=\"200\">\n\t\t\t\t\t\t\t\t\t\t<StackPanel>\n\t\t\t\t\t\t\t\t\t\t\t<Text Value=\"{Property Details}\" FontSize=\"10\"\n\t\t\t\t\t\t\t\t\t\t\t      Color=\"#e6e6e6\" />\n\t\t\t\t\t\t\t\t\t\t</StackPanel>\n\t\t\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t\t\t</WhileString>\n\t\t\t\t\t\t\t</Panel>\n\t\t\t\t\t\t</StackPanel>\n\t\t\t\t\t</ScrollView>\n\t\t\t\t</Panel>\n\n\t\t\t</Grid>\n\n\t\t\t<Grid DefaultRow=\"auto\" Margin=\"15\" ux:Name=\"ButtonGrid\" />\n\n\t\t</Grid>\n\n\t</ClientPanel>\n\n</Panel>"
  },
  {
    "path": "src/preview/core/EmptyClass.cs",
    "content": "﻿namespace Outracks.Simulator.Client\n{\n\tpublic class EmptyClass\n\t{\n\t\tpublic EmptyClass ()\n\t\t{\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "src/preview/core/FakeApp.uno",
    "content": "using Uno;\nusing Uno.IO;\nusing Uno.UX;\nusing Uno.Net;\nusing Uno.Collections;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Fuse.Controls;\nusing Fuse.Elements;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\tusing Protocol;\n\tusing Runtime;\n\tusing Fuse;\n\tusing Fuse.Input;\n\n\tpublic class FakeApp : Panel, Fuse.IRootVisualProvider\n\t{\n\t\treadonly App _app;\n\t\t\n\t\tpublic AppBase App { get { return _app; } }\n\n\t\tVisual Fuse.IRootVisualProvider.Root { get { return RootViewport; } }\n\n\t\tpublic FakeApp(App app)\n\t\t{\n\t\t\t_app = app;\n\t\t\tBackground = Uno.Color.Parse(\"#31343a\");\n\t\t\tClearColor = Uno.Color.Parse(\"#31343a\");\n\t\t}\n\n\t\tnew public float4 Background\n\t\t{\n\t\t\tget { return _app.Background; }\n\t\t\tset { _app.Background = value; }\n\t\t}\n\n\t\tnew public IList<Resource> Resources\n\t\t{\n\t\t\tget { return _app.Resources; }\n\t\t}\n\n\t\tpublic float4 ClearColor\n\t\t{\n\t\t\tget { return _app.Background; }\n\t\t\tset { _app.Background = value; }\n\t\t}\n\n\t\tpublic RootViewport RootViewport\n\t\t{\n\t\t\tget { return _app.RootViewport; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/core/Fuse.Preview.Core.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{41764897-B354-499D-A31A-6A1D3BB9E158}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Fuse.Preview.Core</RootNamespace>\n    <AssemblyName>Outracks.Fuse.Preview.Core</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196b010d-ad36-4947-95aa-14fc4a27bd18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335BB78-0B8A-4D2F-919F-2E6F08883D51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\unohost\\common\\Outracks.UnoHost.csproj\">\n      <Project>{f2aeb321-51e5-40b8-9cf0-53c930e631f0}</Project>\n      <Name>Outracks.UnoHost</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n    <None Include=\"ProxyClient.uno\" />\n    <None Include=\"DeveloperMenu.ux\" />\n    <None Include=\"SimulatorClient.uno\" />\n    <None Include=\"Dialogs\\LoadingScreen.ux\" />\n    <None Include=\"Dialogs\\ModalDialog.ux\" />\n    <None Include=\"Application.uno\" />\n    <None Include=\"ApplicationStates.uno\" />\n    <None Include=\"Context.uno\" />\n    <None Include=\"DeviceInfo.uno\" />\n    <None Include=\"FakeApp.uno\" />\n    <None Include=\"ModalDialog.uno\" />\n    <None Include=\"UserAppState.uno\" />\n    <None Include=\"DashedBrush.uno\" />\n    <None Include=\"DeveloperMenu.ux.uno\" />\n    <None Include=\"Reflection\\NativeReflection.uno\" />\n    <None Include=\"Reflection\\ReflectionCache.uno\" />\n    <None Include=\"Reflection\\ReflectionExtensions.uno\" />\n    <None Include=\"Reflection\\DotNetReflection.uxl\" />\n    <None Include=\"Reflection\\DotNetReflection.uno\" />\n    <None Include=\"fight.png\" />\n    <None Include=\"Fuse.Preview.Core.unoproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"EmptyClass.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n  </ItemGroup>\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <PostBuildEvent Condition=\" '$(OS)' == 'Windows_NT' \">\n      pushd $(SolutionDir)\n      node_modules\\.bin\\uno doctor --configuration=$(Configuration) src/simulator src/preview\n      popd\n      rmdir /s /q $(ProjectDir)\\..\\build\\Fuse.Preview.App\n    </PostBuildEvent>\n    <PostBuildEvent Condition=\" '$(OS)' != 'Windows_NT' \">\n      pushd $(SolutionDir)\n      node_modules\\.bin\\uno doctor --configuration=$(Configuration) src/simulator src/preview\n      popd\n      rm -rf $(ProjectDir)/../build/Fuse.Preview.App\n    </PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "src/preview/core/Fuse.Preview.Core.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Runtime_005CReflection/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/preview/core/Fuse.Preview.Core.unoproj",
    "content": "{\n\t\"Copyright\": \"Copyright (c) Build & Run\",\n\t\"Title\": \"Fuse Preview Core\",\n\t\"Description\": \"Fuse Preview Core for Fuse Preview\",\n\t\"Publisher\": \"Build & Run\",\n\t\"Packages\": [\n\t\t\"Uno.Threading\",\n\t\t\"Fuse.Controls\",\n\t\t\"Fuse.Controls.Native\",\n\t\t\"Fuse.Controls.Panels\",\n\t\t\"Fuse.Controls.ScrollView\",\n\t\t\"Fuse.Controls.Primitives\",\n\t\t\"Fuse.Elements\",\n\t\t\"Fuse.Reactive\",\n\t\t\"Fuse.Triggers\",\n\t\t\"Fuse.Animations\",\n\t\t\"Fuse.Common\",\n\t\t\"Fuse.Marshal\",\n\t\t\"Fuse.Reactive.Bindings\",\n\t\t\"Fuse.Reactive.Expressions\",\n\t\t\"Fuse.Scripting.JavaScript\",\n\t\t\"Fuse.Nodes\",\n\t\t\"Uno.Collections\",\n\t\t\"Uno.Net.Sockets\",\n\t\t\"Fuse.Gestures\",\n\t\t\"Fuse.Android\",\n\t\t\"Fuse.iOS\",\n\t\t\"Fuse.Desktop\",\n\t\t\"Fuse.Designer\",\n\t\t\"Fuse.Drawing\"\n\t],\n\t\"Projects\": [\n\t\t\"../../simulator/common/Outracks.Simulator.unoproj\",\n\t],\n\t\"Includes\": [\n\t\t\"fight.png:Bundle\",\n\t\t\"*.uno:SourceFile\",\n\t\t\"*.ux:UXFile\",\n\t\t\"./Dialogs/*.ux:UXFile\",\n\t\t\"./Reflection/*.uno\",\n\t\t\"./Reflection/*.uxl\",\n\t],\n}\n\n\n"
  },
  {
    "path": "src/preview/core/ModalDialog.uno",
    "content": "using Uno;\nusing Uno.IO;\nusing Uno.UX;\nusing Uno.Collections;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Fuse.Controls;\nusing Fuse.Elements;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\tusing Dialogs;\n\tusing Protocol;\n\tusing Runtime;\n\n\tclass LoadingScreen\n\t{\n\t\tpublic static void Show(FakeApp app, string header, string message)\n\t\t{\n\t\t\tUserAppState.Default.ApplyTo(app);\n\t\t\tapp.Children.Add(new Outracks.Simulator.Client.Dialogs.LoadingScreen()\n\t\t\t{\n\t\t\t\tHeader = header,\n\t\t\t\tMessage = message,\n\t\t\t});\n\t\t}\n\n\t}\n\n\tclass ModalDialog\n\t{\n\t\tpublic static void ShowPrompt(FakeApp app, string header, string body, Control inputControl, IEnumerable<Control> buttons)\n\t\t{\n\t\t\tvar stackPanel = new StackPanel()\n\t\t\t{\n\t\t\t\tAlignment = Alignment.Center,\n\t\t\t\tPadding = float4(40),\n\t\t\t\tChildren = \n\t\t\t\t{\n\t\t\t\t\tnew Text()\n\t\t\t\t\t{\n\t\t\t\t\t\tMargin = float4(0, 0, 0, 20),\n\t\t\t\t\t\tValue = header,\n\t\t\t\t\t\tFontSize = 40,\n\t\t\t\t\t\tTextAlignment = TextAlignment.Center,\n\t\t\t\t\t\tTextWrapping = TextWrapping.Wrap,\n\t\t\t\t\t},\n\t\t\t\t\tnew Text()\n\t\t\t\t\t{\n\t\t\t\t\t\tMargin = float4(0, 0, 0, 20),\n\t\t\t\t\t\tValue = body,\n\t\t\t\t\t\tTextWrapping = TextWrapping.Wrap,\n\t\t\t\t\t},\n\t\t\t\t\tinputControl,\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar buttonPanel = new StackPanel()\n\t\t\t{\n\t\t\t\tMargin = float4(0, 0, 0, 20),\n\t\t\t\tOrientation = Fuse.Layouts.Orientation.Horizontal,\n\t\t\t\tAlignment = Alignment.Center,\n\t\t\t};\n\n\t\t\tforeach (var btn in buttons)\n\t\t\t\tbuttonPanel.Children.Add(btn);\n\n\t\t\tstackPanel.Children.Add(buttonPanel);\n\t\t\tvar root = new ClientPanel();\n\t\t\troot.Children.Add(stackPanel);\n\n\t\t\tUserAppState.Default.ApplyTo(Context.App);\n\t\t\tapp.Children.Add(root);\n\t\t}\n\n\t\tpublic static void Show(FakeApp app, string header, string body, string details, IEnumerable<Control> buttons)\n\t\t{\n\t\t\tvar dialog = new Outracks.Simulator.Client.Dialogs.ModalDialog\n\t\t\t{\n\t\t\t\tHeader = header,\n\t\t\t\tBody = body,\n\t\t\t\tDetails = details,\n\t\t\t};\n\n\t\t\tvar buttonArray = buttons.ToArray();\n\t\t\tdialog.ButtonGrid.ColumnCount = buttonArray.Length;\n\t\t\tforeach (var btn in buttonArray)\n\t\t\t{\n\t\t\t\tdialog.ButtonGrid.Children.Add(btn);\n\t\t\t}\n\n\t\t\tUserAppState.Default.ApplyTo(Context.App);\n\t\t\tapp.Children.Clear();\n\t\t\tapp.Children.Add(dialog);\n\t\t}\n\t}\n\n\tabstract class ShowingPrompt : State\n\t{\n\t\treadonly string _header;\n\t\treadonly string _body;\n\n\t\tTextInput _input;\n\t\tbool _okClicked;\n\t\tbool _cancelClicked;\n\n\t\tprotected ShowingPrompt(\n\t\t\tstring header,\n\t\t\tstring body)\n\t\t{\n\t\t\t_header = header;\n\t\t\t_body = body;\n\t\t}\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\tvar ok = new Button()\n\t\t\t{\n\t\t\t\tMargin = float4(20),\n\t\t\t\tText = \"Ok\",\n\t\t\t};\n\t\t\tFuse.Gestures.Clicked.AddHandler(ok, OnOkClicked);\n\n\t\t\tvar cancel = new Button()\n\t\t\t{\n\t\t\t\tMargin = float4(20),\n\t\t\t\tText = \"Cancel\",\n\t\t\t};\n\t\t\tFuse.Gestures.Clicked.AddHandler(cancel, OnCancelClicked);\n\n\t\t\t_input = new TextBox()\n\t\t\t{\n\t\t\t\t\n\t\t\t};\n\n\t\t\tdebug_log \"# \" + _header;\n\t\t\tdebug_log _body;\n\n\t\t\tModalDialog.ShowPrompt(Context.App, _header, _body, _input, new Control[] { cancel, ok});\n\t\t\treturn this;\n\t\t}\n\n\t\tvoid OnOkClicked(object s, Fuse.Gestures.ClickedArgs args)\n\t\t{\n\t\t\t_okClicked = true;\n\t\t}\n\n\t\tvoid OnCancelClicked(object s, Fuse.Gestures.ClickedArgs args)\n\t\t{\n\t\t\t_cancelClicked = true;\n\t\t}\n\n\t\tprotected abstract State OnOk(string text);\n\n\t\tprotected abstract State OnCancel();\n\n\t\tpublic override State OnUpdate()\n\t\t{\n\t\t\tif (_cancelClicked)\n\t\t\t\treturn OnCancel();\n\n\t\t\tif (_okClicked)\n\t\t\t\treturn OnOk(_input.Value);\n\n\t\t\treturn this;\n\t\t}\n\t}\n\n\tclass ShowingModalDialog : State\n\t{\n\t\treadonly string _header;\n\t\treadonly string _body;\n\t\treadonly string _details;\n\t\treadonly DialogButton[] _buttons;\n\n\t\tOptional<DialogButton> _clickedButton;\n\n\t\tpublic ShowingModalDialog(\n\t\t\tstring header,\n\t\t\tstring body,\n\t\t\tstring details,\n\t\t\tparams DialogButton[] buttons)\n\t\t{\n\t\t\t_header = header;\n\t\t\t_body = body;\n\t\t\t_details = details;\n\t\t\t_buttons = buttons;\n\t\t}\n\n\t\tpublic override State OnEnterState()\n\t\t{\n\t\t\tvar buttons = new List<Control>();\n\t\t\tforeach (var button in _buttons)\n\t\t\t{\n\t\t\t\tvar node = new ModalButton()\n\t\t\t\t{\n\t\t\t\t\tText = button.Text,\n\t\t\t\t};\n\n\t\t\t\tvar action = Closure.Apply(OnButtonClicked, button);\n\t\t\t\tvar handler = (Fuse.Gestures.ClickedHandler) new ForgetAction<object, Fuse.Gestures.ClickedArgs>(action).Execute;\n\t\t\t\tFuse.Gestures.Clicked.AddHandler(node, handler);\n\t\t\t\tbuttons.Add(node);\n\t\t\t}\n\n\t\t\tModalDialog.Show(Context.App, _header, _body, _details, buttons);\n\n\t\t\treturn this;\n\t\t}\n\n\t\tvoid OnButtonClicked(DialogButton button)\n\t\t{\n\t\t\t_clickedButton = Optional.Some(button);\n\t\t}\n\n\t\tpublic override State OnUpdate()\n\t\t{\n\t\t\tif (_clickedButton.HasValue)\n\t\t\t\treturn _clickedButton.Value.Destination;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override State OnException(Exception e)\n\t\t{\n\t\t\tdebug_log(e.Message);\n\t\t\treturn this;\n\t\t}\n\t}\n\n\tsealed class DialogButton\n\t{\n\t\tpublic readonly string Text;\n\t\tpublic readonly State Destination;\n\n\t\tpublic DialogButton(string text, State destination)\n\t\t{\n\t\t\tText = text;\n\t\t\tDestination = destination;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/core/ProxyClient.uno",
    "content": "using System;\nusing Uno;\nusing Uno.Collections;\nusing System.IO;\nusing Uno.Net;\nusing Uno.Net.Sockets;\n\nnamespace Outracks.Simulator\n{\n\tpublic class FailedToConnectToProxy : Exception\n\t{\n\t\tpublic readonly ImmutableList<Exception> InnerExceptions;\n\n\t\tpublic FailedToConnectToProxy(IEnumerable<Exception> innerExceptions)\n\t\t\t: base(\"Failed to connect to proxy:\\n\" + innerExceptions.ToIndentedLines()) // TODO: move this view logic away from here\n\t\t{\n\t\t\tInnerExceptions = innerExceptions.ToImmutableList();\n\t\t}\n\t}\n\n\tpublic class DesignerNotRunning : Exception\n\t{\n\t}\n\n\tpublic class ProxyClient\n\t{\n\t\tpublic static Task<IPEndPoint[]> GetSimulatorEndpoint(IEnumerable<IPEndPoint> proxyEndpoints, string project, IEnumerable<string> defines)\n\t\t{\n\t\t\tvar tasks = new List<Task<IPEndPoint[]>>();\n\n\t\t\tforeach (var endpoint in proxyEndpoints)\n\t\t\t\ttasks.Add(\n\t\t\t\t\tTasks.Run<IPEndPoint[]>(\n\t\t\t\t\t\tnew GetSimulatorEndpoint(endpoint, project, defines.ToArray()).Execute));\n\n\t\t\treturn Tasks.WaitForFirstResult<IPEndPoint[]>(tasks, OnNoResult);\n\t\t}\n\n\t\tstatic IPEndPoint[] OnNoResult(IEnumerable<Exception> exceptions)\n\t\t{\n\t\t\tforeach (var exception in exceptions)\n\t\t\t{\n\t\t\t\tif (exception is DesignerNotRunning)\n\t\t\t\t{\n\t\t\t\t\tthrow new DesignerNotRunning();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new FailedToConnectToProxy(exceptions);\n\t\t}\n\t}\n\n\tclass GetSimulatorEndpoint\n\t{\n\t\treadonly IPEndPoint proxy;\n\t\treadonly string project;\n\t\treadonly string[] defines;\n\n\t\tpublic GetSimulatorEndpoint(IPEndPoint proxy, string project, string[] defines)\n\t\t{\n\t\t\tthis.proxy = proxy;\n\t\t\tthis.project = project;\n\t\t\tthis.defines = defines;\n\t\t}\n\n\t\tpublic IPEndPoint[] Execute()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n\n\t\t\t\tsocket.Connect(proxy);\n\n\t\t\t\tusing (var stream = new NetworkStream(socket))\n\t\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t\tusing (var reader = new BinaryReader(stream))\n\t\t\t\t{\n\t\t\t\t\twriter.Write(project);\n\t\t\t\t\twriter.Write(string.Join(\" \", defines));\n\n\t\t\t\t\tvar initialState = reader.ReadString();\n\n\t\t\t\t\tif (\"DESIGNER_NOT_RUNNING\".Equals(initialState))\n\t\t\t\t\t\tthrow new DesignerNotRunning();\n\n\t\t\t\t\tif (\"SUCCESS\".Equals(initialState) == false)\n\t\t\t\t\t\tthrow new Exception(\"Failed to request host.\");\n\n\t\t\t\t\tvar endpointCount = reader.ReadInt32();\n\t\t\t\t\tvar endpoints = new IPEndPoint[endpointCount];\n\t\t\t\t\tfor (int i = 0; i < endpoints.Length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar simulatorAddress = reader.ReadString();\n\t\t\t\t\t\tvar simulatorPort = reader.ReadInt32();\n\n\t\t\t\t\t\tendpoints[i] = new IPEndPoint(IPAddress.Parse(simulatorAddress), simulatorPort);\n\t\t\t\t\t}\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tsocket.Shutdown(SocketShutdown.Both);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// We may already be connected\n\t\t\t\t\t}\n\n\t\t\t\t\treturn endpoints;\n\t\t\t\t}\n\n\t\t\t\t// UnoBug: this code is unreachable, but uno disagrees\n\t\t\t\tthrow new Exception(\"Call Tom Curise\");\n\t\t\t}\n\t\t\tcatch (DesignerNotRunning)\n\t\t\t{\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToConnectToEndPoint(proxy, e);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/core/Reflection/DotNetReflection.uno",
    "content": "using Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Runtime;\nusing Uno;\nusing Uno.Compiler.ExportTargetInterop;\n\nnamespace Outracks.Simulator.Client\n{\n\t[DotNetType]\n\tpublic class DotNetReflection : IReflection\n\t{\n\t\tpublic static DotNetReflection Load(string outputDir)\n\t\t{\n\t\t\tthrow new Uno.Exception(\"Not DotNet backend\");\n\t\t}\n\n\t\tpublic object CallDynamic(object instance, string methodName, params object[] arguments) { throw new Exception(); }\n\t\tpublic object CallStatic(string typeName, string methodName, params object[] arguments) { throw new Exception(); }\n\n\t\tpublic void SetPropertyValue(object instance, string propertyName, object value) { throw new Exception(); }\n\t\tpublic object GetPropertyValue(object instance, string propertyName) { throw new Exception(); }\n\n\t\tpublic object GetStaticPropertyOrFieldValue(string typeName, string memberName) { throw new Exception(); }\n\n\t\tpublic object CreateDelegate(object instance, string methodName, string[] methodArgumentTypes, string delegateTypeName) { throw new Exception(); }\n\n\t\tpublic void AddEventHandler(object instance, string member, object handlerDelegate) { throw new Exception(); }\n\t\tpublic void RemoveEventHandler(object instance, string member, object handlerDelegate) { throw new Exception(); }\n\n\t\tpublic object Instantiate(string typeName, params object[] args) { throw new Exception(); }\n\t\tpublic bool IsSubtype(object obj, string typeName) { throw new Exception(); }\n\t\tpublic bool IsType(object obj, string typeName) { throw new Exception(); }\n\t\tpublic object GetEnumValue(string enumType, string valueName) { throw new Exception(); }\n\t}\n\n\n\t// Since DotNetReflection is implementing the .Net build of IReflection we have to wrap it in an uno class\n\tpublic class DotNetReflectionWrapper : IReflection\n\t{\n\t\tpublic DotNetReflection _reflection { get; set; }\n\n\t\tpublic DotNetReflectionWrapper(DotNetReflection reflection)\n\t\t{\n\t\t\t_reflection = reflection;\n\t\t}\n\n\t\tpublic object CallDynamic(object instance, string methodName, params object[] arguments) \n\t\t{\n\t\t\treturn _reflection.CallDynamic(instance, methodName, arguments); \n\t\t}\n\n\t\tpublic object CallStatic(string typeName, string methodName, params object[] arguments)\n\t\t{\n\t\t\treturn _reflection.CallStatic(typeName, methodName, arguments);\n\t\t}\n\n\t\tpublic void SetPropertyValue(object instance, string propertyName, object value)\n\t\t{\n\t\t\t_reflection.SetPropertyValue(instance, propertyName, value);\n\t\t}\n\t\tpublic object GetPropertyValue(object instance, string propertyName)\n\t\t{\n\t\t\treturn _reflection.GetPropertyValue(instance, propertyName);\n\t\t}\n\n\t\tpublic object GetStaticPropertyOrFieldValue(string typeName, string memberName)\n\t\t{\n\t\t\treturn _reflection.GetStaticPropertyOrFieldValue(typeName, memberName);\n\t\t}\n\n\t\tpublic object CreateDelegate(object instance, string methodName, string[] methodArgumentTypes, string delegateTypeName)\n\t\t{\n\t\t\treturn _reflection.CreateDelegate(instance, methodName, methodArgumentTypes, delegateTypeName);\n\t\t}\n\n\t\tpublic void AddEventHandler(object instance, string member, object handlerDelegate)\n\t\t{\n\t\t\t_reflection.AddEventHandler(instance, member, handlerDelegate);\n\t\t}\n\t\tpublic void RemoveEventHandler(object instance, string member, object handlerDelegate)\n\t\t{\n\t\t\t_reflection.RemoveEventHandler(instance, member, handlerDelegate);\n\t\t}\n\n\t\tpublic object Instantiate(string typeName, params object[] args)\n\t\t{\n\t\t\treturn _reflection.Instantiate(typeName, args);\n\t\t}\n\t\tpublic bool IsSubtype(object obj, string typeName)\n\t\t{\n\t\t\treturn _reflection.IsSubtype(obj, typeName);\n\t\t}\n\t\tpublic bool IsType(object obj, string typeName)\n\t\t{\n\t\t\treturn _reflection.IsType(obj, typeName);\n\t\t}\n\t\tpublic object GetEnumValue(string enumType, string valueName)\n\t\t{\n\t\t\treturn _reflection.GetEnumValue(enumType, valueName);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/core/Reflection/DotNetReflection.uxl",
    "content": "<Extensions Backend=\"CIL\">\n    <Require Assembly=\"@(Config.Fuse.Simulator:Path)\" />\n</Extensions>"
  },
  {
    "path": "src/preview/core/Reflection/NativeReflection.uno",
    "content": "using Uno;\nusing Uno.Text;\nusing Uno.Collections;\nusing Uno.Compiler.ExportTargetInterop;\nusing Uno.Reflection;\nusing Outracks.Simulator.Runtime;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\n\tpublic interface ITypeMap\n\t{\n\t\tType ResolveType(string typeName);\n\t}\n\n\textern(CPLUSPLUS && REFLECTION)\n\tpublic class SimpleTypeMap : ITypeMap\n\t{\n\t\t// TODO: This mapping should be done offline\n\t\tDictionary<string, Type> _builtins = new Dictionary<string, Type>\n\t\t{\n\t\t\t{ \"object\", typeof(object) },\n\t\t\t{ \"string\", typeof(string) },\n\t\t\t{ \"texture2D\", typeof(texture2D) },\n\t\t\t{ \"textureCube\", typeof(textureCube) },\n\t\t\t{ \"bool\", typeof(bool) },\n\t\t\t{ \"char\", typeof(char) },\n\t\t\t{ \"byte\", typeof(byte) },\n\t\t\t{ \"byte2\", typeof(byte2) },\n\t\t\t{ \"byte4\", typeof(byte4) },\n\t\t\t{ \"sbyte\", typeof(sbyte) },\n\t\t\t{ \"sbyte2\", typeof(sbyte2) },\n\t\t\t{ \"sbyte4\", typeof(sbyte4) },\n\t\t\t{ \"short\", typeof(short) },\n\t\t\t{ \"short2\", typeof(short2) },\n\t\t\t{ \"short4\", typeof(short4) },\n\t\t\t{ \"ushort\", typeof(ushort) },\n\t\t\t{ \"ushort2\", typeof(ushort2) },\n\t\t\t{ \"ushort4\", typeof(ushort4) },\n\t\t\t{ \"int\", typeof(int) },\n\t\t\t{ \"int2\", typeof(int2) },\n\t\t\t{ \"int3\", typeof(int3) },\n\t\t\t{ \"int4\", typeof(int4) },\n\t\t\t{ \"uint\", typeof(uint) },\n\t\t\t{ \"long\", typeof(long) },\n\t\t\t{ \"ulong\", typeof(ulong) },\n\t\t\t{ \"float\", typeof(float) },\n\t\t\t{ \"float2\", typeof(float2) },\n\t\t\t{ \"float3\", typeof(float3) },\n\t\t\t{ \"float4\", typeof(float4) },\n\t\t\t{ \"float2x2\", typeof(float2x2) },\n\t\t\t{ \"float3x3\", typeof(float3x3) },\n\t\t\t{ \"float4x4\", typeof(float4x4) },\n\t\t\t{ \"double\", typeof(double) },\n\t\t};\n\t\n\t\tpublic Type ResolveType(string typeName)\n\t\t{\n\t\t\treturn ResolveType(TypeName.Parse(typeName));\n\t\t}\n\n\t\tType ResolveType(TypeName typeName)\n\t\t{\n\t\t\tvar t = Type.GetType(typeName.WithGenericSuffix.FullName);\n\n\t\t\tif (t == null && !_builtins.TryGetValue(typeName.FullName, out t))\n\t\t\t\tthrow new InvalidOperationException(\"'\" + typeName + \"' was not found\");\n\n\t\t\tif (typeName.IsParameterizedGenericType)\n\t\t\t\tt = t.MakeGenericType(typeName.GenericArgumentsRecursively.Select((Func<TypeName, Type>)ResolveType).ToArray());\n\n\t\t\tif (t.ContainsGenericParameters)\n\t\t\t\tthrow new InvalidOperationException(\"'\" + typeName + \"' is not a closed type\");\n\n\t\t\treturn t;\n\t\t}\n\t}\n\n\tinterface IProperty\n\t{\n\t\tType DeclaringType { get; }\n\t\tIFunction GetMethod { get; }\n\t\tIFunction SetMethod { get; }\n\t}\n\n\tinterface IEvent\n\t{\n\t\tType DeclaringType { get; }\n\t\tIFunction AddMethod { get; }\n\t\tIFunction RemoveMethod { get; }\n\t}\n\n\textern(CPLUSPLUS && REFLECTION)\n\tpublic sealed class NativeReflection : IReflection\n\t{\n\t\treadonly ITypeMap _typeMap;\n\n\t\tpublic NativeReflection(ITypeMap typeMap)\n\t\t{\n\t\t\t_typeMap = typeMap;\n\t\t}\n\n\t\tpublic object GetPropertyValue(object obj, string propertyName)\n\t\t{\n\t\t\tvar prop = ResolveProperty(obj, propertyName, null);\n\t\t\tvar getter = prop.GetMethod;\n\t\t\tif (getter == null)\n\t\t\t\tthrow new InvalidOperationException(\"Property '\" + prop.DeclaringType + \".\" + propertyName + \"' has no getter\");\n\n\t\t\treturn prop.GetMethod.TryInvoke(obj, new object[0]);\n\t\t}\n\n\t\tpublic void SetPropertyValue(object obj, string propertyName, object value)\n\t\t{\n\t\t\tvar prop = ResolveProperty(obj, propertyName, value != null ? value.GetType() : null);\n\t\t\tvar setter = prop.SetMethod;\n\t\t\tif (setter == null)\n\t\t\t\tthrow new InvalidOperationException(\"Property '\" + prop.DeclaringType + \".\" + propertyName + \"' has no setter\");\n\n\t\t\tsetter.TryInvoke(obj, new[] { value });\n\t\t}\n\n\t\tIProperty ResolveProperty(object obj, string propertyName, Type propertyType)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\tthrow new ArgumentNullException(\"obj\");\n\n\t\t\tvar objType = obj.GetType();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn objType.GetProperty(propertyName, propertyType);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new MemberNotFound(objType.FullName, propertyName);\n\t\t\t}\n\n\t\t}\n\n\t\tpublic object CreateDelegate(object instance, string methodName, string[] methodArgumentTypes, string delegateTypeName)\n\t\t{\n\t\t\tvar type = instance.GetType();\n\n\t\t\tvar method = methodArgumentTypes != null\n\t\t\t\t? type.GetMethod(methodName, methodArgumentTypes.Select<string, Type>(_typeMap.ResolveType).ToArray())\n\t\t\t\t: type.GetMethod(methodName);\n\n\t\t\tif (method == null)\n\t\t\t\tthrow new MemberNotFound(type.FullName, methodName);\n\n\t\t\treturn method.CreateDelegate(_typeMap.ResolveType(delegateTypeName), instance);\n\t\t}\n\n\n\t\tpublic void AddEventHandler(object instance, string member, object handlerDelegate)\n\t\t{\n\t\t\tvar type = instance.GetType();\n\n\t\t\tvar theEvent = type.GetEvent(member, handlerDelegate.GetType());\n\t\t\tif (theEvent == null)\n\t\t\t\tthrow new MemberNotFound(type.FullName, member);\n\n\t\t\tvar adder = theEvent.AddMethod;\n\t\t\tif (adder == null)\n\t\t\t\tthrow new InvalidOperationException(\"Event '\" + theEvent.DeclaringType + \".\" + member + \"' has no add method\");\n\n\t\t\tadder.TryInvoke(instance, new []{ handlerDelegate });\n\t\t}\n\n\t\tpublic void RemoveEventHandler(object instance, string member, object handlerDelegate)\n\t\t{\n\t\t\tvar type = instance.GetType();\n\n\t\t\tvar theEvent = type.GetEvent(member, handlerDelegate.GetType());\n\t\t\tif (theEvent == null)\n\t\t\t\tthrow new MemberNotFound(type.FullName, member);\n\n\t\t\tvar remover = theEvent.AddMethod;\n\t\t\tif (remover == null)\n\t\t\t\tthrow new InvalidOperationException(\"Event '\" + theEvent.DeclaringType + \".\" + member + \"' has no remover method\");\n\n\t\t\tremover.TryInvoke(instance, new []{ handlerDelegate });\n\t\t}\n\n\t\tpublic object CallDynamic(object obj, string methodName, params object[] arguments)\n\t\t{\n\t\t\tvar type = obj.GetType();\n\n\t\t\treturn type.FindUnambiguousMethod(methodName, arguments).TryInvoke(obj, arguments);\n\t\t}\n\n\n\t\tpublic object Instantiate(string typeName, params object[] args)\n\t\t{\n\t\t\treturn CallStatic(typeName, \".ctor\", args);\n\t\t}\n\n\t\tpublic object CallStatic(string typeName, string methodName, params object[] arguments)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\treturn type.FindUnambiguousMethod(methodName, arguments).TryInvoke(null, arguments);\n\t\t}\n\n\t\tpublic void SetStaticField(string typeName, string fieldName, object value)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\tvar field = type.GetField(fieldName);//.Name, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);\n\t\t\tif (field == null)\n\t\t\t\tthrow new MemberNotFound(typeName, fieldName);\n\n\t\t\tfield.SetValue(null, value);\n\t\t}\n\n\t\tpublic object GetStaticPropertyOrFieldValue(string typeName, string memberName)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\tvar prop = type.GetProperty(memberName, null);\n\t\t    if (prop != null && prop.GetMethod != null)\n\t\t        return prop.GetMethod.Invoke(null, new object[0]);\n\n\t\t\tvar field = type.GetField(memberName);\n\t\t\tif (field != null)\n\t\t\t\treturn field.GetValue(null);\n\n\t\t\tthrow new MemberNotFound(typeName, memberName);\n\t\t}\n\n\t\tpublic bool IsSubtype(object obj, string typeName)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null) return false;\n\t\t\treturn type.IsInstanceOfType(obj);\n\t\t}\n\n\t\tpublic bool IsType(object obj, string typeName)\n\t\t{\n\t\t\treturn obj.GetType().FullName == typeName;\n\t\t}\n\n\t\tpublic object GetEnumValue(string enumType, string valueName)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(enumType);\n\t\t\treturn Enum.Parse(type, valueName);\n\t\t}\n\n\t}\n\n\textern(CPLUSPLUS && REFLECTION)\n\tstatic class TryInvokeExtension\n\t{\n\t\tpublic static IFunction FindUnambiguousMethod(this Type type, string methodName, object[] arguments)\n\t\t{\n\t\t\tvar methods = new List<IFunction>();\n\n\t\t\tfor (var t = type; t != null; t = t.BaseType)\n\t\t\t{\n\t\t\t\tforeach (var m in t.GetMethods())\n\t\t\t\t{\n\t\t\t\t\tif (m.Name == methodName && m.ParametersMatch(arguments))\n\t\t\t\t\t\tmethods.Add(m);\n\n\t\t\t\t\tif (methods.Count >= 2)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (methods.Count > 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (methods.Count == 0)\n\t\t\t\tthrow new MemberNotFound(type.FullName, methodName);\n\n\t\t\tif (methods.Count > 1)\n\t\t\t\tthrow new UnambiguousMethodNotFound(type.FullName, methodName);\n\n\t\t\treturn methods[0];\n\t\t}\n\n\t\tpublic static bool ParametersMatch(this IFunction m, object[] arguments)\n\t\t{\n\t\t\tvar prms = m.ParameterTypes;\n\t\t\tif (prms.Length != arguments.Length)\n\t\t\t\treturn false;\n\n\t\t\tfor (int i = 0; i < prms.Length; i++)\n\t\t\t{\n\t\t\t\tvar param = prms[i];\n\t\t\t\tvar arg = arguments[i];\n\n\t\t\t\tif (arg == null)\n\t\t\t\t{\n\t\t\t\t\t// all non-value types can accept null\n\t\t\t\t\tif (param.IsValueType)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!param.IsInstanceOfType(arg))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static IFunction GetMethod(this Type type, string name, params Type[] parameterTypes)\n\t\t{\n\t\t    for (var t = type; t != null; t = t.BaseType)\n\t\t    {\n\t\t        foreach (var f in t.GetMethods())\n\t\t        {\n\t\t            if (f.Name != name ||\n                        f.ParameterTypes.Length != parameterTypes.Length)\n\t\t                continue;\n\n\t\t            var found = true;\n\t\t            for (int i = 0; i < parameterTypes.Length; i++)\n\t\t            {\n\t\t                if (parameterTypes[i] != null && !parameterTypes[i].IsSubclassOf(f.ParameterTypes[i]))\n\t\t                {\n\t\t                    found = false;\n\t\t                    break;\n\t\t                }\n\t\t            }\n\n\t\t            if (found)\n\t\t                return f;\n\t\t        }\n\t\t    }\n\n\t\t    return null;\n\t\t}\n\n\t\tpublic static CppFunction[] GetMethods(this Type type)\n\t\t{\n\t\t\treturn CppReflection.GetFunctions(type);\n\t\t}\n\n\t\tpublic static IProperty GetProperty(this Type type, string name, Type propertyType)\n\t\t{\n\t\t\treturn new CppProperty(type, propertyType, name);\n\t\t}\n\n\t\tpublic static IField GetField(this Type type, string name)\n\t\t{\n\t\t    if (type == null)\n\t\t        return null;\n\t\t    var f = CppReflection.FindField(type, name);\n\t\t\treturn f.IsNull ? GetField(type.BaseType, name) : (IField)f;\n\t\t}\n\n\t\tpublic static IEvent GetEvent(this Type type, string name, Type propertyType)\n\t\t{\n\t\t\treturn new CppEvent(type, propertyType, name);\n\t\t}\n\n\t\tpublic static bool IsInstanceOfType(this Type type, object obj)\n\t\t{\n\t\t\treturn obj.GetType().IsSubclassOf(type);\n\t\t}\n\n\t\tpublic static object TryInvoke(this IFunction mi, object obj, params object[] value)\n\t\t{\n\t\t\treturn mi.Invoke(obj, value);\n\t\t}\n\n\t}\n\n\textern(CPLUSPLUS && REFLECTION)\n\tclass CppEvent : IEvent\n\t{\n\t\treadonly Type _declaringType;\n\t\treadonly Type _type;\n\t\treadonly string _name;\n\n\t\tpublic CppEvent(Type declaringType, Type type, string name)\n\t\t{\n\t\t\t_declaringType = declaringType;\n\t\t\t_type = type;\n\t\t\t_name = name;\n\t\t}\n\n\t    public Type DeclaringType\n\t    {\n\t        get { return _declaringType; }\n\t    }\n\n\t\tpublic IFunction AddMethod\n\t\t{\n\t\t\tget { return _declaringType.GetMethod(\"add_\" + _name, _type); }\n\t\t}\n\n\t\tpublic IFunction RemoveMethod\n\t\t{\n\t\t\tget { return _declaringType.GetMethod(\"remove_\" + _name, _type); }\n\t\t}\n\t}\n\n\textern(CPLUSPLUS && REFLECTION)\n\tclass CppProperty : IProperty\n\t{\n\t\treadonly Type _declaringType;\n\t\treadonly Type _type;\n\t\treadonly string _name;\n\n\t\tpublic CppProperty(Type declaringType, Type type, string name)\n\t\t{\n\t\t\t_declaringType = declaringType;\n\t\t\t_type = type;\n\t\t\t_name = name;\n\t\t}\n\n\t    public Type DeclaringType\n\t    {\n\t        get { return _declaringType; }\n\t    }\n\n\t\tpublic IFunction GetMethod\n\t\t{\n\t\t\tget { return _declaringType.GetMethod(\"get_\" + _name); }\n\t\t}\n\n\t\tpublic IFunction SetMethod\n\t\t{\n\t\t\tget { return _declaringType.GetMethod(\"set_\" + _name, _type); }\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/preview/core/Reflection/ReflectionCache.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Uno.Reflection;\nusing Uno.Compiler.ExportTargetInterop;\nusing Outracks.Simulator.Runtime;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\n\textern(CPLUSPLUS && REFLECTION) internal static class ReflectionCache\n    {\n    \tstatic readonly Dictionary<Type, CppFunction[]> _functionCache;\n    \tstatic readonly Dictionary<Type, CppField[]> _fieldCache;\n    \tstatic readonly List<Dictionary<TypeName, Type>> _typeCache;\n\n    \tstatic ReflectionCache()\n    \t{\n    \t\t_functionCache = new Dictionary<Type, CppFunction[]>();\n    \t\t_fieldCache = new Dictionary<Type, CppField[]>();\n    \t\t_typeCache = new List<Dictionary<TypeName, Type>>();\n    \t}\n\n    \tpublic static CppFunction[] GetFunctions(Type type)\n    \t{\n    \t\tif (_functionCache.ContainsKey(type))\n    \t\t\treturn _functionCache[type];\n\n    \t\tvar functions = new List<CppFunction>();\n    \t\tvar t = type;\n\n    \t\twhile (t != null)\n    \t\t{\n    \t\t\tfunctions.AddRange(CppReflection.GetFunctions(t));\n    \t\t\tt = t.BaseType;\n    \t\t}\n\n    \t\tvar array = functions.ToArray();\n    \t\t_functionCache.Add(type, array);\n    \t\treturn array;\n    \t}\n\n    \tpublic static CppField[] GetFields(Type type)\n    \t{\n    \t\tif (_fieldCache.ContainsKey(type))\n    \t\t\treturn _fieldCache[type];\n\n    \t\tvar fields = new List<CppField>();\n    \t\tvar t = type;\n\n    \t\twhile (t != null)\n    \t\t{\n    \t\t\tfields.AddRange(CppReflection.GetFields(t));\n    \t\t\tt = t.BaseType;\n    \t\t}\n\n    \t\tvar array = fields.ToArray();\n    \t\t_fieldCache.Add(type, array);\n    \t\treturn array;\n    \t}\n\n    \tpublic static Type GetType(TypeName typeName)\n    \t{\n    \t\tforeach (var dict in _typeCache)\n\t    \t\tif (dict.ContainsKey(typeName))\n\t    \t\t\treturn dict[typeName];\n\n    \t\treturn null;\n    \t}\n\n    \tpublic static void AddToTypeCache(Dictionary<TypeName, Type> typeDictionary)\n    \t{\n    \t\t_typeCache.Add(typeDictionary);\n    \t}\n    }\n}\n"
  },
  {
    "path": "src/preview/core/Reflection/ReflectionExtensions.uno",
    "content": "using Uno;\nusing Uno.Collections;\nusing Uno.Compiler.ExportTargetInterop;\nusing Uno.Reflection;\nusing Outracks.Simulator.Runtime;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\n\textern(CPLUSPLUS && REFLECTION) internal static class ReflectionExtensions\n\t{\n\t\tstatic readonly string PropGetPrefix = \"get_\";\n\t\tstatic readonly string PropSetPrefix = \"set_\";\n\t\tstatic readonly string EventAdderPrefix = \"add_\";\n\t\tstatic readonly string EventRemovePrefix = \"remove_\";\n\t\tstatic readonly TypeMemberName ConstructorName = new TypeMemberName(\".ctor\");\n\n\t\tpublic static Type[] GetTypes(this object[] objects)\n\t\t{\n\t\t\tif (objects == null)\n\t\t\t\treturn null;\n\n\t\t\tvar types = new Type[objects.Length];\n\t\t\tfor (int i = 0; i < objects.Length; i++)\n\t\t\t\ttypes[i] = objects[i].GetType();\n\n\t\t\treturn types;\n\t\t}\n\n\t\tpublic static Type[] FindTypes(this TypeName[] typeName)\n\t\t{\n\t\t\tvar types = new Type[typeName.Length];\n\n\t\t\tfor (int i = 0; i < typeName.Length; i++)\n\t\t\t\ttypes[i] = typeName[i].FindType();\n\n\t\t\treturn types;\n\t\t}\n\n\t\tpublic static Type FindType(this TypeName typeName)\n\t\t{\n\t\t\treturn ReflectionCache.GetType(typeName) ?? Type.GetType(typeName.FullName, true);\n\t\t}\n\n\t\tpublic static CppFunction FindConstructor(this Type type, params Type[] paramTypes)\n\t\t{\n\t\t\treturn type.FindFunction(ConstructorName, paramTypes);\n\t\t}\n\n\t\tpublic static CppFunction FindPropertyGetter(this Type type, TypeMemberName typeMemberName)\n\t\t{\n\t\t\tvar getterName = new TypeMemberName(PropGetPrefix + typeMemberName.Name);\n\t\t\treturn type.FindFunction(getterName);\n\t\t}\n\n\t\tpublic static CppFunction FindPropertySetter(this Type type, TypeMemberName typeMemberName, Type argType)\n\t\t{\n\t\t\tvar setterName = new TypeMemberName(PropSetPrefix + typeMemberName.Name);\n\t\t\treturn type.FindFunction(setterName, argType);\n\t\t}\n\n\t\tpublic static CppFunction FindEventAddFunction(this Type type, TypeMemberName typeMemberName, object delegateObj)\n\t\t{\n\t\t\tvar eventAddName = new TypeMemberName(EventAdderPrefix + typeMemberName.Name);\n\t\t\treturn type.FindFunction(eventAddName, delegateObj.GetType());\n\t\t}\n\n\t\tpublic static CppFunction FindEventRemoveFunction(this Type type, TypeMemberName typeMemberName, object delegateObj)\n\t\t{\n\t\t\tvar eventRemoveName = new TypeMemberName(EventRemovePrefix + typeMemberName.Name);\n\t\t\treturn type.FindFunction(eventRemoveName, delegateObj.GetType());\n\t\t}\n\n\t\tpublic static CppField FindField(this Type type, TypeMemberName fieldName)\n\t\t{\n\t\t\tvar fields = ReflectionCache.GetFields(type);\n\t\t\tfor (int i = 0; i < fields.Length; i++)\n\t\t\t{\n\t\t\t\tvar f = fields[i];\n\t\t\t\tif (f.Name == fieldName.Name)\n\t\t\t\t\treturn f;\n\t\t\t}\n\t\t\treturn CppField.Null;\n\t\t}\n\n\t\tpublic static Type[] GetParameterTypes(this Signature methodSignature)\n\t\t{\n\t\t\tvar parameters = methodSignature.Parameters;\n        \tvar types = new Type[parameters.Count];\n\n        \tfor (int i = 0; i < parameters.Count; i++)\n        \t{\n        \t\ttypes[i] = parameters[i].Type.FindType();\n        \t}\n\n        \treturn types;\n\t\t}\n\n\t\tpublic static CppFunction FindFunction(this Type type, TypeMemberName memberName, params Type[] paramTypes)\n\t\t{\n\t\t\treturn FindFunctionOverload(FindFunctionsByName(type, memberName), paramTypes);\n\t\t}\n\n\t\tstatic CppFunction FindFunctionOverload(CppFunction[] functions, Type[] paramTypes)\n\t\t{\n\t\t\tfor (int i = 0; i < functions.Length; i++)\n\t\t\t{\n\t\t\t\tif (CheckArgumentTypes(functions[i].ParameterTypes, paramTypes))\n\t\t\t\t\treturn functions[i];\n\t\t\t}\n\n\t\t\treturn CppFunction.Null;\n\t\t}\n\n\t\tstatic bool CheckArgumentTypes(Type[] paramTypes, Type[] argumentTypes)\n\t\t{\n\t\t\tif (paramTypes.Length != argumentTypes.Length)\n\t\t\t\treturn false;\n\n\t\t\tfor (int i = 0; i < paramTypes.Length; i++)\n\t\t\t{\n\t\t\t\tvar param = paramTypes[i];\n\t\t\t\tvar arg = argumentTypes[i];\n\t\t\t\tif (!arg.IsSubclassOf(param))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic CppFunction[] FindFunctionsByName(Type type, TypeMemberName memberName)\n\t\t{\n\t\t\tvar name = memberName.Name;\n\t\t\tvar functions = ReflectionCache.GetFunctions(type);\n\t\t\tvar matchingFunctions = new List<CppFunction>();\n\t\t\tfor (int i = 0; i < functions.Length; i++)\n\t\t\t{\n\t\t\t\tif (functions[i].Name == name)\n\t\t\t\t\tmatchingFunctions.Add(functions[i]);\n\t\t\t}\n\t\t\treturn matchingFunctions.ToArray();\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/preview/core/SimulatorClient.uno",
    "content": "using System;\nusing Uno;\nusing Uno.Collections;\nusing System.IO;\nusing Uno.Net;\nusing Uno.Net.Sockets;\nusing Uno.Threading;\nusing Uno.Collections;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Simulator\n{\n\tusing UnoHost;\n\tusing Protocol;\n\t\n\tpublic interface ISimulatorClient : IDisposable\n\t{\n\t\tConcurrentQueue<IBinaryMessage> IncommingMessages { get; }\n\n\t\tvoid Send(IBinaryMessage message);\n\n\t\tbool IsOnline { get; }\n\t}\n\n\tpublic class OfflineSimulatorClient : ISimulatorClient\n\t{\n\t\treadonly ConcurrentQueue<IBinaryMessage> _messagesFromClient = new ConcurrentQueue<IBinaryMessage>();\n\t\treadonly ConcurrentQueue<IBinaryMessage> _messagesToClient = new ConcurrentQueue<IBinaryMessage>();\n\n\t\tpublic OfflineSimulatorClient(params IBinaryMessage[] initialMessages)\n\t\t{\n\t\t\tforeach (var msg in initialMessages)\n\t\t\t\t_messagesToClient.Enqueue(msg);\n\t\t}\n\n\t\tpublic ConcurrentQueue<IBinaryMessage> IncommingMessages\n\t\t{\n\t\t\tget { return _messagesToClient; }\n\t\t}\n\n\t\tpublic void Send(IBinaryMessage message)\n\t\t{\n\t\t\t_messagesFromClient.Enqueue(message);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t\n\t\t}\n\n\t\tpublic bool IsOnline\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class FailedToConnectToEndPoint : Exception\n\t{\n\t\tpublic FailedToConnectToEndPoint(IPEndPoint endpoint, Exception e)\n\t\t\t: base(endpoint.ToString() + \": \" + e.Message)\n\t\t{ }\n\t}\n\n\tpublic class FailedToConnectToSimulator : Exception\n\t{\n\t\tpublic readonly ImmutableList<Exception> InnerExceptions;\n\n\t\tpublic FailedToConnectToSimulator(IEnumerable<Exception> innerExceptions)\n\t\t\t: base(\"Failed to connect to simulator host: \" + innerExceptions.ToIndentedLines())\n\t\t{\n\t\t\tInnerExceptions = innerExceptions.ToImmutableList();\n\t\t}\n\t}\n\n\tpublic static class ToIndentedLinesExtension\n\t{\n\t\tpublic static string ToIndentedLines(this IEnumerable<Exception> innerExceptions)\n\t\t{\n\t\t\tvar s = \"\";\n\t\t\tforeach (var e in innerExceptions)\n\t\t\t\ts += \"    \" + e.Message + \"\\n\";\n\t\t\treturn s;\n\t\t}\n\t}\n\n\tpublic static class ConnectToFirstRespondingEndpoint\n\t{\n\t\tpublic static Task<Socket> Execute(IEnumerable<IPEndPoint> simulatorEndpoints)\n\t\t{\n\t\t\tvar isNotConnected = new AutoResetEvent(true);\n\t\t\tvar socketTasks = new List<Task<Socket>>();\n\t\t\tforeach (var endpoint in simulatorEndpoints)\n\t\t\t\tsocketTasks.Add(Tasks.Run<Socket>(new ConnectToEndpointClosure(endpoint, isNotConnected).Execute));\n\n\t\t\treturn Tasks.WaitForFirstResult<Socket>(socketTasks, OnNoResult);\n\t\t}\n\n\t\tstatic Socket OnNoResult(IEnumerable<Exception> exceptions)\n\t\t{\n\t\t\tthrow new FailedToConnectToSimulator(exceptions); // TODO: misplaced information\n\t\t}\n\t}\n\n\tclass ConnectionAlreadyEstablished : Exception\n\t{\n\t\tpublic ConnectionAlreadyEstablished()\n\t\t\t: base(\"Connection already established\")\n\t\t{\n\t\t}\n\t}\n\n\tclass ConnectToEndpointClosure\n\t{\n\t\treadonly IPEndPoint _endpoint;\n\t\treadonly EventWaitHandle _isNotConnected;\n\n\t\tpublic ConnectToEndpointClosure(IPEndPoint endpoint, EventWaitHandle isNotConnected)\n\t\t{\n\t\t\t_endpoint = endpoint;\n\t\t\t_isNotConnected = isNotConnected;\n\t\t}\n\n\t\tpublic Socket Execute()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\n\t\t\t\tsocket.Connect(_endpoint);\n\n\t\t\t\tif (_isNotConnected.WaitOne(0) == false)\n\t\t\t\t{\n\t\t\t\t\tsocket.Dispose();\n\t\t\t\t\tthrow new ConnectionAlreadyEstablished();\n\t\t\t\t}\n\n\t\t\t\treturn socket;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToConnectToEndPoint(_endpoint, e);// TODO: misplaced information\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic class SimulatorClient : ISimulatorClient\n\t{\n\t\treadonly Socket _socket;\n\t\treadonly NetworkStream _stream;\n\t\treadonly BinaryWriter _writer;\n\t\treadonly BinaryReader _reader;\n\t\treadonly ConcurrentQueue<IBinaryMessage> _messagesFromClient = new ConcurrentQueue<IBinaryMessage>();\n\t\treadonly ConcurrentQueue<IBinaryMessage> _messagesToClient = new ConcurrentQueue<IBinaryMessage>();\n\t\treadonly Thread _readWorker;\n\t\treadonly Thread _writeWorker;\n\t\t//readonly IDisposable _alsoReceieveMessagesFromPipe;\n\n\t\tpublic ConcurrentQueue<IBinaryMessage> IncommingMessages \n\t\t{ \n\t\t\tget { return _messagesToClient; } \n\t\t}\n\n\t\tpublic void Send(IBinaryMessage message)\n\t\t{\n\t\t\t_messagesFromClient.Enqueue(message);\n\t\t}\n\n\t\tpublic SimulatorClient(Socket socket)\n\t\t{\n\t\t\t_socket = socket;\n\t\t\t_stream = new NetworkStream(_socket);\n\t\t\t_writer = new BinaryWriter(_stream);\n\t\t\t_reader = new BinaryReader(_stream);\n\t\t\t\n\t\t\t_readWorker = new Thread(ReadLoop);\n\t\t\t_writeWorker = new Thread(WriteLoop);\n\n\t\t\tif defined(DotNet)\n\t\t\t{\n\t\t\t\t_readWorker.IsBackground = true;\n\t\t\t\t_readWorker.Name = \"Read from \" + _socket.RemoteEndPoint;\n\t\t\t\t_writeWorker.IsBackground = true;\n\t\t\t\t_writeWorker.Name = \"Write to \" + _socket.RemoteEndPoint;\n\n\t\t\t}\n\n\t\t\t_readWorker.Start();\n\t\t\t_writeWorker.Start();\n\t\t}\n\n\t\t// no volative in UNO, boo :(\n\t\tbool _running = true;\n\n\t\tvoid ReadLoop()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (_running)\n\t\t\t\t{\n\t\t\t\t\twhile (_socket.Poll(0, SelectMode.Read))\n\t\t\t\t\t\t_messagesToClient.Enqueue(BinaryMessage.ReadFrom(_reader));\n\n\t\t\t\t\tThread.Sleep(10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e)\n\t\t\t{\n\t\t\t\t_messagesToClient.Enqueue(new Error(ExceptionInfo.Capture(e)));\n\t\t\t}\n\t\t}\n\n\t\tvoid WriteLoop()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (_running)\n\t\t\t\t{\n\t\t\t\t\tIBinaryMessage message;\n\t\t\t\t\twhile (_messagesFromClient.TryDequeue(out message))\n\t\t\t\t\t\tmessage.WriteTo(_writer);\n\n\t\t\t\t\tThread.Sleep(10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_messagesToClient.Enqueue(new Error(ExceptionInfo.Capture(e)));\n\t\t\t\t_running = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_running = false;\n\t\t\t\n\t\t\t//_alsoReceieveMessagesFromPipe.Dispose();\n\n\t\t\t_readWorker.Join();\n\t\t\t_writeWorker.Join();\n\n\t\t\t_stream.Dispose();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_socket.Shutdown(SocketShutdown.Both);\n\t\t\t\t_socket.Close();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tdebug_log(e.Message);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsOnline\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "src/preview/core/UserAppState.uno",
    "content": "﻿using Uno;\nusing Uno.IO;\nusing Uno.Collections;\nusing Fuse;\nusing Uno.Diagnostics;\nusing Uno.UX;\nusing Fuse.Controls;\nusing Fuse.Elements;\n\nnamespace Outracks.Simulator.Client\n{\n\tusing Bytecode;\n\tusing Protocol;\n\tusing Runtime;\n\n\tsealed class UserAppState\n\t{\n\t\t// This list should be up-to-date with https://www.fusetools.com/docs/fuse/app\n\n\t\tpublic readonly float4 Background;\n\t\tpublic readonly Node[] Children;\n\t\t// (Current)\n\t\t// (PreviousUpdateDuration)\n\t\tpublic readonly Resource[] Resources;\n\t\tpublic readonly float4 ClearColor;\n\t\t// FrameInterval?\n\t\t// FrameTime?\n\n\t\tpublic UserAppState(\n\t\t\tfloat4 background,\n\t\t\tNode[] children,\n\t\t\tResource[] resources,\n\t\t\tfloat4 clearColor)\n\t\t{\n\t\t\tBackground = background;\n\t\t\tChildren = children;\n\t\t\tResources = resources;\n\t\t\tClearColor = clearColor;\n\t\t}\n\n\t\tpublic static UserAppState Default { get; set; }\n\n\t\tpublic static UserAppState Save(FakeApp app)\n\t\t{\n\t\t\treturn new UserAppState(\n\t\t\t\tapp.Background,\n\t\t\t\tapp.Children.ToArray(),\n\t\t\t\tapp.Resources.ToArray(),\n\t\t\t\tapp.ClearColor);\n\t\t}\n\n\t\tpublic void ApplyTo(FakeApp app)\n\t\t{\n\t\t\tif (app.Background != Background) app.Background = Background;\n\t\t\tSetIfNotEqual(app.Children, Children);\n\t\t\tSetIfNotEqual(app.Resources, Resources);\n\t\t\tif (app.ClearColor != ClearColor) app.ClearColor = ClearColor;\n\t\t}\n\n\t\tstatic void SetIfNotEqual<T>(IList<T> list, T[] elements)\n\t\t{\n\t\t\tif (!SequenceEquals(list, elements))\n\t\t\t\tSetSequence(list, elements);\n\t\t}\n\n\t\tstatic void SetSequence<T>(IList<T> list, T[] elements)\n\t\t{\n\t\t\tlist.Clear();\n\t\t\tlist.AddRange(elements);\n\t\t}\n\n\t\tstatic bool SequenceEquals<T>(IList<T> left, T[] right)\n\t\t{\n\t\t\tif (left.Count != right.Length) \n\t\t\t\treturn false;\n\n\t\t\tfor (int i = 0; i < right.Length; i++)\n\t\t\t{\n\t\t\t\tif ((object)left[i] != (object)right[i]) \n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/core/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/preview/core/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n</packages>"
  },
  {
    "path": "src/preview/service/AndroidPortReverser.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing Outracks;\nusing Uno.Build.Adb;\nusing Uno.Configuration;\n\nnamespace Fuse.Preview\n{\n\tpublic class AndroidReversePortFailed : Exception\n\t{\n\t\tpublic readonly int RemotePort;\n\t\tpublic readonly int LocalPort;\n\t\tpublic readonly string Output;\n\n\t\tpublic AndroidReversePortFailed(int remotePort, int localPort, string output, string error)\n\t\t\t: base(\"Tried to reverse adb port 'tcp:\" + remotePort + \"' 'tcp:\" + localPort + \"'. However failed with: \" + error)\n\t\t{\n\t\t\tRemotePort = remotePort;\n\t\t\tLocalPort = localPort;\n\t\t\tOutput = output;\n\t\t}\n\t}\n\n\tpublic class AndroidPortReverser\n\t{\n\t\t/// <exception cref=\"AndroidReversePortFailed\"></exception>\n\t\tpublic void ReversePort(int remotePort, int localPort)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (new AdbRunner(Uno.Diagnostics.Shell.Default)\n\t\t\t\t\t\t.Run(\"reverse tcp:\" + remotePort + \" tcp:\" + localPort) != 0)\n\t\t\t\t\tthrow new AndroidReversePortFailed(remotePort, localPort, \"\", \"\");\n\t\t\t}\n\t\t\tcatch (AndroidReversePortFailed)\n\t\t\t{\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new AndroidReversePortFailed(remotePort, localPort, \"\", e.Message);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static class AndroidPortReverserExtensions\n\t{\n\t\tpublic static void ReversePortOrLogErrors(this AndroidPortReverser portReverser, IReport log, int remotePort, int localPort)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tportReverser.ReversePort(remotePort, localPort);\n\t\t\t}\n\t\t\tcatch (AndroidReversePortFailed e)\n\t\t\t{\n\t\t\t\tlog.Exception(\"Failed to reverse port\", e);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/ApplicationClassGenerator.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing Outracks.IO;\nusing Outracks.IPC;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Protocol;\n\nnamespace Fuse.Preview\n{\n\tpublic static class ApplicationClassGenerator\n\t{\n\t\tpublic static string CreateApplicationClass(BuildProject args, string projectName,  TypeName generatedClassName)\n\t\t{\n\t\t\treturn CreateApplicationClass(\n\t\t\t\tNetworkHelper\n\t\t\t\t\t.GetInterNetworkIps()\n\t\t\t\t\t.Select(ip => new IPEndPoint(ip, 12124)),\n\t\t\t\tAbsoluteFilePath.Parse(args.ProjectPath),\n\t\t\t\targs.Defines,\n\t\t\t\tprojectName,\n\t\t\t\targs.OutputDir,\n\t\t\t\tgeneratedClassName);\n\t\t}\n\n\t\tpublic static IEnumerable<string> Dependencies\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tyield return \"Fuse.Preview.Core\";\n\t\t\t\tyield return \"Outracks.Simulator\";\n\t\t\t\tyield return \"UnoCore\";\n\t\t\t\tyield return \"Uno.Collections\";\n\t\t\t\tyield return \"Uno.Net.Sockets\";\n\t\t\t}\n\t\t}\n\n\t\tstatic string CreateApplicationClass(\n\t\t\tIEnumerable<IPEndPoint> proxyEndpoints,\n\t\t\tAbsoluteFilePath projectPath,\n\t\t\tIEnumerable<string> defines,\n\t\t\tstring projectName,\n\t\t\tstring outputDir,\n\t\t\tTypeName generatedClassName)\n\t\t{\n\t\t\treturn DefaultUsings.Select(n => \"using \" + n.FullName + \";\").Join(\"\\n\") +\n@\"\nnamespace \" + generatedClassName.ContainingType.Value.FullName + @\"\n{\n\tpublic class \" + generatedClassName.Name + @\" : Outracks.Simulator.Client.Application\n\t{\n\t\tpublic GeneratedApplication()\n\t\t\t: base(\n\t\t\t\tnew []\n\t\t\t\t{\" +\n\t\t\t\t\tproxyEndpoints.Select(proxy => \"new Uno.Net.IPEndPoint(Uno.Net.IPAddress.Parse(\\\"\" + proxy.Address + \"\\\"), \" + proxy.Port + \")\").Join(\", \") +\n\t\t\t\t@\"},\" +\n\t\t\t\t\"\\\"\" + projectPath.NativePath.Replace(\"\\\\\", \"\\\\\\\\\") + \"\\\",\" +\n\t\t\t\t@\"new string[]\n\t\t\t\t{ \" +\n\t\t\t\t\tdefines.Select(d => \"\\\"\" + d + \"\\\"\").Join(\", \") +\n\t\t\t\t@\"})\n\t\t{\n\t\t\t\"+\"Runtime.Bundle.Initialize(\\\"\"+ projectName +\"\\\");\\n\" + @\"\n\t\t\tif defined(DotNet)\n\t\t\t\tReflection = new DotNetReflectionWrapper(DotNetReflection.Load(\" + \"\\\"\" + outputDir.Replace(\"\\\\\", \"/\") + \"\\\"\" + @\"));\n\t\t\tif defined(CPLUSPLUS)\n\t\t\t\tReflection = new NativeReflection(new SimpleTypeMap());\n\t\t}\n\t}\n}\";\n\t\t}\n\n\t\tstatic IEnumerable<NamespaceName> DefaultUsings\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tyield return new NamespaceName(\"Uno\");\n\t\t\t\tyield return new NamespaceName(\"Uno.Collections\");\n\t\t\t\tyield return new NamespaceName(\"Uno.UX\");\n\t\t\t\tyield return new NamespaceName(\"Uno.IO\");\n\t\t\t\tyield return new NamespaceName(\"Outracks.Simulator\");\n\t\t\t\tyield return new NamespaceName(\"Outracks.Simulator.Bytecode\");\n\t\t\t\tyield return new NamespaceName(\"Outracks.Simulator.Runtime\");\n\t\t\t\tyield return new NamespaceName(\"Outracks.Simulator.Client\");\n\t\t\t}\n\t\t}\n\n\t}\n\n}\n\n"
  },
  {
    "path": "src/preview/service/AssemblyBuilt.cs",
    "content": "using System.IO;\nusing Outracks.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class AssemblyBuilt : IBinaryMessage\n\t{\n\t\tpublic static string MessageType = \"AssemblyBuilt\";\n\t\tpublic string Type { get { return MessageType; } }\n\t\tpublic AbsoluteFilePath Assembly { get; set; }\n\n\t\tpublic AbsoluteDirectoryPath BuildDirectory { get { return Assembly.ContainingDirectory; } }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(Assembly.NativePath);\n\t\t}\n\n\t\tpublic static AssemblyBuilt ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new AssemblyBuilt\n\t\t\t{\n\t\t\t\tAssembly = AbsoluteFilePath.Parse(reader.ReadString()),\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/AssetsWatcher.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Text;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator.Bytecode;\nusing Uno.Build.FuseJS;\nusing Uno.Configuration;\n\nnamespace Fuse.Preview\n{\n\tclass AssetsWatcher : IDisposable\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly IScheduler _scheduler;\n\t\treadonly FileSender<ProjectDependency> _dependencyFileSender;\n\t\treadonly FileSender<AbsoluteFilePath> _bundleFileSender;\n\t\treadonly ReifyerLogAdapter _logAdapter = new ReifyerLogAdapter();\n\t\treadonly Lazy<Transpiler> _transpiler;\n\t\treadonly Subject<string> _logMessages = new Subject<string>();\n\n\t\tpublic IObservable<string> LogMessages\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _logAdapter.Events.Select(x => x.ToString())\n\t\t\t\t\t.Merge(_logMessages.Select(s => s + '\\n'));\n\t\t\t}\n\t\t}\n\n\t\tpublic AssetsWatcher(IFileSystem fileSystem, IObservable<AbsoluteDirectoryPath> projectRootDirectory, IScheduler scheduler)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_scheduler = scheduler;\n\t\t\t_dependencyFileSender = FileSourceSender.Create(fileSystem);\n\t\t\t_bundleFileSender = BundleFileSender.Create(fileSystem, projectRootDirectory);\n\t\t\t_transpiler = new Lazy<Transpiler>(() => new Transpiler(_logAdapter.Log, UnoConfig.Current));\n\t\t}\n\n\t\tpublic IObservable<CoalesceEntry> UpdateChangedDependencies(IObservable<IImmutableSet<ProjectDependency>> dependencies)\n\t\t{\n\t\t\treturn WatchSet(\n\t\t\t\tdependencies,\n\t\t\t\tonItemAdded: projDep =>\n\t\t\t\t{\n\t\t\t\t\tvar path = AbsoluteFilePath.Parse(projDep.Path);\n\t\t\t\t\treturn Watch(path)\n\t\t\t\t\t\t.Select(data => _dependencyFileSender.CreateMessages(data.WithMetadata(projDep)))\n\t\t\t\t\t\t.Switch();\n\t\t\t\t});\n\t\t}\n\n\t\tpublic IObservable<CoalesceEntry> UpdateChangedBundleFiles(IObservable<IImmutableSet<AbsoluteFilePath>> bundleFiles)\n\t\t{\n\t\t\treturn WatchSet(\n\t\t\t\tbundleFiles,\n\t\t\t\tonItemAdded: bundleFile =>\n\t\t\t\t{\n\t\t\t\t\treturn Watch(bundleFile)\n\t\t\t\t\t\t.Select(d => _bundleFileSender.CreateMessages(d))\n\t\t\t\t\t\t.Switch();\n\t\t\t\t});\n\t\t}\n\n\t\tpublic IObservable<CoalesceEntry> UpdateChangedFuseJsFiles(IObservable<IImmutableSet<AbsoluteFilePath>> fuseJsFiles)\n\t\t{\n\t\t\treturn WatchSet(\n\t\t\t\tfuseJsFiles,\n\t\t\t\tonItemAdded: bundleFile =>\n\t\t\t\t{\n\t\t\t\t\treturn Watch(bundleFile)\n\t\t\t\t\t\t.Select(TranspileJs)\n\t\t\t\t\t\t.NotNone()\n\t\t\t\t\t\t.Select(d => _bundleFileSender.CreateMessages(d))\n\t\t\t\t\t\t.Switch();\n\t\t\t\t});\n\t\t}\n\n\t\tOptional<FileDataWithMetadata<AbsoluteFilePath>> TranspileJs(FileDataWithMetadata<AbsoluteFilePath> jsFile)\n\t\t{\n\t\t\tstring output;\n\t\t\tif (_transpiler.Value.TryTranspile(jsFile.Metadata.NativePath, Encoding.UTF8.GetString(jsFile.Data), out output))\n\t\t\t{\n\t\t\t\t// Bundle transpiled code with the original source file metadata\n\t\t\t\treturn FileDataWithMetadata.Create(jsFile.Metadata, Encoding.UTF8.GetBytes(output));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_logAdapter.Error(jsFile.Metadata);\n\n\t\t\t\t// Don't propagate result\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tIObservable<TOut> WatchSet<T, TOut>(IObservable<IEnumerable<T>> sets, Func<T, IObservable<TOut>> onItemAdded)\n\t\t{\n\t\t\treturn sets\n\t\t\t\t.CachePerElement(\n\t\t\t\t\tdata => data,\n\t\t\t\t\t(data) =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar disposable = new BehaviorSubject<Optional<IDisposable>>(Optional.None());\n\t\t\t\t\t\tvar proxy = new Subject<TOut>();\n\t\t\t\t\t\tvar changes = Observable.Create<TOut>(\n\t\t\t\t\t\t\tobserver =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar dis = proxy.Subscribe(observer);\n\n\t\t\t\t\t\t\t\tif(!disposable.Value.HasValue)\n\t\t\t\t\t\t\t\t\tdisposable.OnNext(Optional.Some(onItemAdded(data).Subscribe(proxy)));\n\n\t\t\t\t\t\t\t\treturn dis;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn new\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchanges,\n\t\t\t\t\t\t\tdispose = disposable\n\t\t\t\t\t\t};\n\t\t\t\t\t}, v => v.dispose.Value.Do(d => d.Dispose()))\n\t\t\t\t.Select(p => p.Select(v => v.changes).Merge())\n\t\t\t\t.Switch();\n\t\t}\n\n\t\tIObservable<FileDataWithMetadata<AbsoluteFilePath>> Watch(AbsoluteFilePath path)\n\t\t{\n\t\t\treturn _fileSystem\n\t\t\t\t.Watch(path)\n\t\t\t\t.CatchAndRetry(delay: TimeSpan.FromSeconds(1), scheduler: _scheduler)\n\t\t\t\t.Throttle(TimeSpan.FromSeconds(1.0 / 30.0), _scheduler)\n\t\t\t\t.StartWith(Unit.Default)\n\t\t\t\t.Select(_ => path)\n\t\t\t\t.DiffFileContent(_fileSystem)\n\t\t\t\t.CatchAndRetry(TimeSpan.FromSeconds(20),\n\t\t\t\t\te =>\n\t\t\t\t\t{\n\t\t\t\t\t\t_logMessages.OnNext(\"Failed to load '\" + path.NativePath + \"': \" + (e.InnerException != null ? e.InnerException.Message : e.Message));\n\t\t\t\t\t});\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif (_transpiler.IsValueCreated)\n\t\t\t\t_transpiler.Value.Dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/BinaryMessageStreams.cs",
    "content": "using System;\nusing System.IO;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading;\nusing Outracks.IPC;\n\nnamespace Outracks\n{\n\tpublic static class BinaryMessageStreams\n\t{\n\t\tpublic static IDisposable BeginWritingMessages(this PipeName pipe, string processName, Action<Exception> onWriteError, params IObservable<IBinaryMessage>[] messages)\n\t\t{\n\t\t\tvar ctSource = new CancellationTokenSource();\n\t\t\tvar queue = new DispatcherQueue<IBinaryMessage>();\n\t\t\tvar writeThread = new Thread(() =>\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tusing (var stream = Pipe.Connect(pipe).Result)\n\t\t\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t\t\t{\n\t\t\t\t\t\tqueue.Dispatch(message => message.WriteTo(writer), ctSource.Token);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tonWriteError(e);\n\t\t\t\t}\n\t\t\t})\n\t\t\t{\n\t\t\t\tName = \"Write binary messages to \" + processName,\n\t\t\t\tIsBackground = true,\n\t\t\t};\n\n\t\t\twriteThread.Start();\n\n\t\t\treturn Disposable.Combine(\n\t\t\t\tDisposable.Create(ctSource.Cancel),\n\t\t\t\tmessages.Merge().Subscribe(queue.Enqueue));\n\t\t}\n\n\t\tpublic static IDisposable BeginWritingMessages(this Stream stream, string processName, Action<Exception> onWriteError, params IObservable<IBinaryMessage>[] messages)\n\t\t{\n\t\t\tvar ctSource = new CancellationTokenSource();\n\t\t\tvar queue = new DispatcherQueue<IBinaryMessage>();\n\t\t\tvar writeThread = new Thread(() =>\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t\t\t{\n\t\t\t\t\t\tqueue.Dispatch(message => message.WriteTo(writer), ctSource.Token);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tonWriteError(e);\n\t\t\t\t}\n\t\t\t})\n\t\t\t{\n\t\t\t\tName = \"Write binary messages to \" + processName,\n\t\t\t\tIsBackground = true,\n\t\t\t};\n\n\t\t\twriteThread.Start();\n\n\t\t\treturn Disposable.Combine(\n\t\t\t\tDisposable.Create(ctSource.Cancel),\n\t\t\t\tmessages.Merge().Subscribe(queue.Enqueue));\n\t\t}\n\n\n\t\tpublic static IConnectableObservable<IBinaryMessage> ReadMessages(this PipeName pipe, string processName)\n\t\t{\n\t\t\treturn Observable\n\t\t\t\t.Defer(() => Pipe.Host(pipe).ToObservable())\n\t\t\t\t.Select(p => p.ReadMessages(processName))\n\t\t\t\t.Concat()\n\t\t\t\t.Publish();\n\t\t}\n\n\t\tpublic static IObservable<IBinaryMessage> ReadMessages(this Stream stream, string processName)\n\t\t{\n\t\t\treturn new BinaryReader(stream).ReadMessages(processName).RefCount();\n\t\t}\n\n\t\tstatic IConnectableObservable<IBinaryMessage> ReadMessages(this BinaryReader reader, string processName)\n\t\t{\n\t\t\treturn Observable.Create<IBinaryMessage>(listener =>\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar ctSource = new CancellationTokenSource();\n\n\t\t\t\t\tvar readThread = new Thread(() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tusing (reader)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\twhile (!ctSource.IsCancellationRequested)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tvar msg = BinaryMessage.ReadFrom(reader);\n\t\t\t\t\t\t\t\t\t\t\tlistener.OnNext(msg);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch (EndOfStreamException)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Expected exception so swallow it\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch (IOException e)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tint forciblyClosedConnection = -2146232800;\n\t\t\t\t\t\t\t\t\tif (e.HResult != forciblyClosedConnection)\n\t\t\t\t\t\t\t\t\t\tthrow;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlistener.OnError(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfinally\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlistener.OnCompleted();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t{\n\t\t\t\t\t\tName = \"Read binary messages from \" + processName,\n\t\t\t\t\t\tIsBackground = true\n\t\t\t\t\t};\n\n\t\t\t\t\treadThread.Start();\n\n\t\t\t\t\treturn Disposable.Create(() => ctSource.Cancel());\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tlistener.OnError(e);\n\n\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.Publish();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/BuildCanceledException.cs",
    "content": "using System;\n\nnamespace Outracks.Building\n{\n\tpublic class BuildCanceledException : Exception\n\t{\n\t\tpublic BuildCanceledException() : base(\"Build was canceled\")\n\t\t{ }\n\t}\n}"
  },
  {
    "path": "src/preview/service/BuildIssueDetected.cs",
    "content": "using System;\nusing System.IO;\nusing Outracks;\nusing Outracks.Simulator;\nusing GuidSerializer = Outracks.Simulator.GuidSerializer;\n\nnamespace Fuse.Preview\n{\n\tpublic enum BuildIssueType\n\t{\n\t\tFatalError,\n\t\tError,\n\t\tWarning,\n\t\tMessage,\n\t}\n\n\tpublic sealed class BuildIssueDetected : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"BuildIssueDetected\";\n\n\t\tpublic string Type\n\t\t{\n\t\t\tget { return MessageType; }\n\t\t}\n\n\t\tpublic Guid BuildId { get; private set; }\n\t\tpublic BuildIssueType Severity { get; private set; }\n\t\tpublic string Code { get; private set; }\n\t\tpublic string Message { get; private set; }\n\t\tpublic Optional<SourceReference> Source { get; private set; }\n\n\t\tpublic BuildIssueDetected(\n\t\t\tBuildIssueType type,\n\t\t\tstring code,\n\t\t\tstring message,\n\t\t\tOptional<SourceReference> source,\n\t\t\tGuid buildId)\n\t\t{\n\t\t\tBuildId = buildId;\n\t\t\tSeverity = type;\n\t\t\tCode = code;\n\t\t\tMessage = message;\n\t\t\tSource = source;\n\t\t}\n\t\tBuildIssueDetected() { }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.WriteGuid(BuildId);\n\t\t\twriter.Write(Severity.ToString());\n\t\t\twriter.Write(Code);\n\t\t\twriter.Write(Message);\n\t\t\tOptional.Write(writer, Source, (Action<BinaryWriter, SourceReference>) SourceReference.Write);\n\t\t}\n\n\t\tpublic static BuildIssueDetected ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new BuildIssueDetected\n\t\t\t{\n\t\t\t\tBuildId = GuidSerializer.ReadGuid(reader),\n\t\t\t\tSeverity = (BuildIssueType)Enum.Parse(typeof(BuildIssueType), reader.ReadString()),\n\t\t\t\tCode = reader.ReadString(),\n\t\t\t\tMessage = reader.ReadString(),\n\t\t\t\tSource = Optional.Read(reader, (Func<BinaryReader, SourceReference>)SourceReference.Read),\n\t\t\t};\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\n\t\t\t\t\"{0}: {1} {2}: {3}\",\n\t\t\t\tSource.ToCanonicalForm(),\n\t\t\t\tSeverity, Code,\n\t\t\t\tMessage);\n\t\t}\n\t}\n\n\t// Be careful changing the names, it means the API changes!\n\tpublic enum BuildIssueTypeData\n\t{\n\t\tUnknown,\n\t\tFatalError,\n\t\tError,\n\t\tWarning,\n\t\tMessage,\n\t}\n\n}"
  },
  {
    "path": "src/preview/service/BuildLogged.cs",
    "content": "using System;\nusing System.IO;\nusing Outracks;\nusing Outracks.Simulator;\nusing GuidSerializer = Outracks.Simulator.GuidSerializer;\n\nnamespace Fuse.Preview\n{\n\tpublic sealed class BuildLogged : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"BuildLogged\";\n\n\t\tpublic string Type\n\t\t{\n\t\t\tget { return MessageType; }\n\t\t}\n\n\t\tpublic Guid BuildId { get; private set; }\n\t\tpublic string Text { get; private set; }\n\t\tpublic Optional<ConsoleColor> Color { get; private set; }\n\n\t\tpublic BuildLogged(string text, Optional<ConsoleColor> color, Guid buildId)\n\t\t{\n\t\t\tBuildId = buildId;\n\t\t\tText = text;\n\t\t\tColor = color;\n\t\t}\n\t\tBuildLogged() { }\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Text;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.WriteGuid(BuildId);\n\t\t\twriter.Write(Text);\n\t\t}\n\n\t\tpublic static BuildLogged ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new BuildLogged\n\t\t\t{\n\t\t\t\tBuildId = GuidSerializer.ReadGuid(reader),\n\t\t\t\tText = reader.ReadString()\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/BuildOutputDirGenerator.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Threading;\nusing Outracks;\nusing Outracks.IO;\n\nnamespace Fuse.Preview\n{\n\tpublic class BuildOutputDirLock\n\t{\n\t\tpublic readonly AbsoluteDirectoryPath BuildDir;\n\t\treadonly Action _disposed;\n\t\tint _refCount;\n\t\tvolatile bool _isDisposed;\n\t\treadonly object _mutex = new object();\n\n\t\tpublic BuildOutputDirLock(AbsoluteDirectoryPath buildDir, Action disposed)\n\t\t{\n\t\t\tBuildDir = buildDir;\n\t\t\t_disposed = disposed;\n\t\t}\n\n\t\tpublic Optional<IDisposable> Lock()\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t{\n\t\t\t\tif (_isDisposed)\n\t\t\t\t\treturn Optional.None();\n\n\t\t\t\tInterlocked.Increment(ref _refCount);\n\t\t\t}\n\t\t\treturn Optional.Some(DisposeFactory());\n\t\t}\n\n\t\tpublic IDisposable DisposeFactory()\n\t\t{\n\t\t\treturn Disposable.Create(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tInterlocked.Decrement(ref _refCount);\n\n\t\t\t\t\tlock (_mutex)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_refCount > 0)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t_disposed();\n\t\t\t\t\t\t_isDisposed = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n\n\tpublic class BuildOutputDirGenerator\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly ConcurrentDictionary<AbsoluteDirectoryPath, BuildOutputDirLock> _lockedBuildDirectories = new ConcurrentDictionary<AbsoluteDirectoryPath, BuildOutputDirLock>();\n\n\t\tpublic BuildOutputDirGenerator(IFileSystem fileSystem)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t}\n\n\t\tpublic AbsoluteDirectoryPath Acquire(AbsoluteDirectoryPath baseDirectory)\n\t\t{\n\t\t\tvar buildLock = new Optional<BuildOutputDirLock>();\n\t\t\t_fileSystem.MakeUnique(baseDirectory,\n\t\t\t\tcreateName: no => baseDirectory.Rename(MakePathUnique.CreateNumberName(baseDirectory.Name, no)),\n\t\t\t\tcondition: p =>\n\t\t\t\t{\n\t\t\t\t\tbuildLock = new BuildOutputDirLock(\n\t\t\t\t\t\tp,\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBuildOutputDirLock tmp;\n\t\t\t\t\t\t\tvar tries = 5;\n\t\t\t\t\t\t\twhile (!_lockedBuildDirectories.TryRemove(p, out tmp) && tries >= 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t--tries;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\tvar result = _lockedBuildDirectories.AddOrUpdate(\n\t\t\t\t\t\tp,\n\t\t\t\t\t\tbuildLock.Value,\n\t\t\t\t\t\t(buildOut, oldLock) => oldLock);\n\n\t\t\t\t\t// If we did update an already lock - try to iterate over other possibilities.\n\t\t\t\t\treturn result != buildLock;\n\t\t\t\t});\n\n\t\t\tbuildLock.Do(bl => bl.Lock());\n\t\t\treturn buildLock\n\t\t\t\t.OrThrow(new Exception(\"Failed to generate a build output directory.\"))\n\t\t\t\t.BuildDir;\n\t\t}\n\n\t\tpublic IDisposable Lock(AbsoluteDirectoryPath outputDir)\n\t\t{\n\t\t\treturn GetLockedDirectory(outputDir) // First check if we already have a lock for the directory\n\t\t\t\t.Or(() => GetLockedDirectory(Acquire(outputDir))) // Else acquire a new lock\n\t\t\t\t.SelectMany(d => d.Lock()) // Do the locking\n\t\t\t\t.Or(Disposable.Empty); // We don't care if we fail to lock\n\t\t}\n\n\t\tpublic void Release(AbsoluteDirectoryPath outputDir)\n\t\t{\n\t\t\tGetLockedDirectory(outputDir).Select(d => d.DisposeFactory()).Do(d => d.Dispose());\n\t\t}\n\n\t\tOptional<BuildOutputDirLock> GetLockedDirectory(AbsoluteDirectoryPath outputDir)\n\t\t{\n\t\t\tBuildOutputDirLock tmp;\n\t\t\treturn _lockedBuildDirectories.TryGetValue(outputDir, out tmp) ? Optional.Some(tmp) : Optional.None();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/BuildProject.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class BuildProject : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"BuildProject\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic Guid Id { get; set; }\n\t\tpublic string ProjectPath { get; private set; }\n\t\tpublic ImmutableList<string> Defines { get; private set; }\n\t\tpublic bool BuildLibraries { get; private set; }\n\t\tpublic bool Verbose { get; private set; }\n\t\tpublic string OutputDir { get; set; }\n\n\t\tpublic BuildProject(\n\t\t\tstring projectPath,\n\t\t\tImmutableList<string> defines,\n\t\t\tbool buildLibraries,\n\t\t\tbool verbose,\n\t\t\tstring outputDir = \"\")\n\t\t{\n\t\t\tProjectPath = projectPath;\n\t\t\tDefines = defines;\n\t\t\tBuildLibraries = buildLibraries;\n\t\t\tVerbose = verbose;\n\t\t\tOutputDir = outputDir;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.WriteGuid(Id);\n\t\t\twriter.Write(ProjectPath);\n\t\t\tList.Write(writer, Defines, (Action<string, BinaryWriter>)WriteDefine);\n\t\t\twriter.Write(BuildLibraries);\n\t\t\twriter.Write(Verbose);\n\t\t\twriter.Write(OutputDir);\n\t\t}\n\n\t\tpublic static BuildProject ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar id = reader.ReadGuid();\n\t\t\tvar projectPath = reader.ReadString();\n\t\t\tvar defines = List.Read(reader, (Func<BinaryReader, string>)ReadDefine);\n\t\t\tvar buildLibraries = reader.ReadBoolean();\n\t\t\tvar verbose = reader.ReadBoolean();\n\t\t\tvar outputDir = reader.ReadString();\n\t\t\treturn new BuildProject(projectPath, defines, buildLibraries, verbose, outputDir)\n\t\t\t{\n\t\t\t\tId = id,\n\t\t\t};\n\t\t}\n\n\t\tstatic void WriteDefine(string str, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(str);\n\t\t}\n\n\t\tstatic string ReadDefine(BinaryReader reader)\n\t\t{\n\t\t\treturn reader.ReadString();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/Builder.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator.Parser;\nusing Outracks.Simulator.Protocol;\nusing Uno.Logging;\n\nnamespace Fuse.Preview\n{\n\tpublic interface ISimulatorBuilder\n\t{\n\t\tOptional<ProjectBuild> TryBuild(BuildProject args, Log log);\n\t}\n\n\tpublic class Builder\n\t{\n\t\treadonly ISubject<Optional<ProjectBuild>> _result = new ReplaySubject<Optional<ProjectBuild>>(1);\n\t\treadonly ISimulatorBuilder _simulatorBuilder;\n\n\t\tpublic Builder(ISimulatorBuilder simulatorBuilder)\n\t\t{\n\t\t\t_simulatorBuilder = simulatorBuilder;\n\t\t}\n\n\t\tpublic IObservable<Optional<ProjectBuild>> Result\n\t\t{\n\t\t\tget { return _result; }\n\t\t}\n\n\n\t\treadonly object _buildLock = new object();\n\t\t/// <remarks> This function updates the Result property as a side-effect </remarks>\n\t\t/// <returns> (Started (LogEvent)* [AssemblyBuilt] Ended)* </returns>\n\t\tpublic IObservable<IBinaryMessage> Build(IObservable<BuildProject> args)\n\t\t{\n\t\t\treturn args\n\t\t\t\t.Switch(a => Observable.Defer(() =>\n\t\t\t\t{\n\t\t\t\t\tvar log = new LogSubject(a.Id);\n\t\t\t\t\treturn Observable\n\t\t\t\t\t\t.Start(\n\t\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlock (_buildLock)\n\t\t\t\t\t\t\t\t\treturn _simulatorBuilder.TryBuild(a, log.Log);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t.Do(_result.OnNext)\n\t\t\t\t\t\t.SelectMany(result =>\n\t\t\t\t\t\t\tresult.HasValue\n\t\t\t\t\t\t\t\t? new IBinaryMessage[]\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnew AssemblyBuilt { Assembly = AbsoluteFilePath.Parse(result.Value.Assembly) },\n\t\t\t\t\t\t\t\t\tnew Ended { Command = a, Success = true, BuildDirectory = AbsoluteDirectoryPath.Parse(a.OutputDir) },\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t: new IBinaryMessage[]\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnew Ended { Command = a, Success = false, BuildDirectory = AbsoluteDirectoryPath.Parse(a.OutputDir) }\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t.StartWith(new Started { Command = a })\n\t\t\t\t\t\t.Merge(log.Messages);\n\t\t\t\t}));\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/CacheCleaner.cs",
    "content": "﻿using System;\nusing System.IO;\nusing Outracks.IO;\n\nnamespace Fuse.Preview\n{\n\tpublic class CacheCleaner\n\t{\n\t\treadonly IFileSystem _fs;\n\t\treadonly string _version;\n\n\t\tpublic CacheCleaner(IFileSystem fs, string version)\n\t\t{\n\t\t\t_fs = fs;\n\t\t\t_version = version;\n\t\t}\n\n\t\tpublic void CleanIfNecessary(AbsoluteDirectoryPath cacheDirectory)\n\t\t{\n\t\t\tvar versionFile = cacheDirectory / new FileName(\".fuse-version\");\n\t\t\tif (ShouldClean(versionFile))\n\t\t\t{\n\t\t\t\tTryClean(versionFile, cacheDirectory);\n\t\t\t}\n\t\t}\n\n\t\tbool ShouldClean(AbsoluteFilePath versionFile)\n\t\t{\n\t\t\tif (!_fs.Exists(versionFile))\n\t\t\t\treturn true;\n\n\t\t\tstring version = _fs.ReadAllText(versionFile, 3);\n\n\t\t\tif (version != _version)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\tvoid TryClean(AbsoluteFilePath versionFile, AbsoluteDirectoryPath cacheDirectory)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_fs.Delete(cacheDirectory);\n\t\t\t\t_fs.Create(cacheDirectory);\n\t\t\t\tWriteVersion(versionFile, _version);\n\t\t\t}\n\t\t\tcatch (IOException) { }\n\t\t\tcatch (UnauthorizedAccessException) { }\n\t\t}\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"UnauthorizedAccessException\"></exception>\n\t\tvoid WriteVersion(AbsoluteFilePath versionFile, string version)\n\t\t{\n\t\t\tusing(var stream = _fs.Create(versionFile))\n\t\t\tusing (var streamWriter = new StreamWriter(stream))\n\t\t\t{\n\t\t\t\tstreamWriter.WriteLine(version);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/CoalesceCache.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks;\n\nnamespace Fuse.Preview\n{\n\t// This message is sent from Studio, and requests to add a coalesce entry\n\tpublic class CoalesceEntry\n\t{\n\t\t/* Unique key for the same type of data, that means if another CoalesceEntry with the same coalesce key exist, the new CoalesceEntry supersede it.\n\t\t   So that old entries having that key should be removed. */\n\t\tpublic string CoalesceKey;\n\n\t\t/* The binary stream can be zero which basically means that the entry is removed, however we can't remove it from the registry,\n\t\tsince clients also need to know if the entry has been removed.*/\n\t\tpublic Optional<IBinaryMessage> BlobData;\n\n\t\tpublic bool AddFirst;\n\t}\n\n\t// This message is sent from a preview client to request replay from the server from a specific point, zero means from the beginning.\n\tclass RequestReplayFrom\n\t{\n\t\tpublic int UniqueQueueIdx = 0;\n\t}\n\n\tclass CoalesceEntryCacheData\n\t{\n\t\tpublic CoalesceEntry Entry;\n\t\tpublic int QueueIdx;\n\t}\n\n\tclass CoalesceEntryCache\n\t{\n\t\treadonly Dictionary<string, CoalesceEntry> _coalesceEntries = new Dictionary<string, CoalesceEntry>();\n\t\treadonly LinkedList<CoalesceEntryCacheData> _coalesceEntryQueue = new LinkedList<CoalesceEntryCacheData>();\n\t\treadonly Subject<CoalesceEntryCacheData> _hotEntries = new Subject<CoalesceEntryCacheData>();\n\t\tint _queueIdx;\n\n\t\tobject _mutex = new object();\n\t\tpublic void Add(CoalesceEntry entry)\n\t\t{\n\t\t\tlock(_mutex)\n\t\t\t{\n\t\t\t\tvar node = entry.AddFirst ? _coalesceEntryQueue.First : _coalesceEntryQueue.Last;\n\t\t\t\twhile (node != null)\n\t\t\t\t{\n\t\t\t\t\tvar next = entry.AddFirst ? node.Next : node.Previous;\n\t\t\t\t\tif (node.Value.Entry.CoalesceKey == entry.CoalesceKey)\n\t\t\t\t\t{\n\t\t\t\t\t\t_coalesceEntryQueue.Remove(node);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tnode = next;\n\t\t\t\t}\n\n\t\t\t\t_coalesceEntries[entry.CoalesceKey] = entry;\n\n\t\t\t\tvar cacheEntry = new CoalesceEntryCacheData()\n\t\t\t\t{\n\t\t\t\t\tEntry = entry,\n\t\t\t\t\tQueueIdx = _queueIdx++\n\t\t\t\t};\n\n\t\t\t\tif (entry.AddFirst)\n\t\t\t\t\t_coalesceEntryQueue.AddFirst(cacheEntry);\n\t\t\t\telse\n\t\t\t\t\t_coalesceEntryQueue.AddLast(cacheEntry);\n\n\t\t\t\t_hotEntries.OnNext(cacheEntry);\n\t\t\t}\n\t\t}\n\n\t\t// Unique queue index is basically an index which doesn't change when items before it has been popped.\n\t\tpublic IObservable<CoalesceEntryCacheData> ReplayFrom(int uniqueQueueIdx)\n\t\t{\n\t\t\treturn Observable.Create<CoalesceEntryCacheData>(observer =>\n\t\t\t{\n\t\t\t\tlock (_mutex)\n\t\t\t\t{\n\t\t\t\t\treturn _coalesceEntryQueue.Where(e => e.QueueIdx > uniqueQueueIdx)\n\t\t\t\t\t\t.ToObservable()\n\t\t\t\t\t\t.Merge(_hotEntries)\n\t\t\t\t\t\t.Subscribe(observer);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic IObservable<Unit> HasEntry(string coalesceKey)\n\t\t{\n\t\t\treturn Observable.Create<Unit>(\n\t\t\t\tobserver =>\n\t\t\t\t{\n\t\t\t\t\tlock (_mutex)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_coalesceEntries.ContainsKey(coalesceKey))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tobserver.OnNext(Unit.Default);\n\t\t\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn _hotEntries\n\t\t\t\t\t\t\t\t.Where(e => e.Entry.CoalesceKey == coalesceKey)\n\t\t\t\t\t\t\t\t.Select(e => Unit.Default)\n\t\t\t\t\t\t\t\t.FirstAsync()\n\t\t\t\t\t\t\t\t.Subscribe(observer);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n\n\tstatic class CoalesceExtensions\n\t{\n\t\tpublic static CoalesceEntry ToCoalesceEntry(\n\t\t\tthis IBinaryMessage message, string coalesceKey, bool addFirst = false)\n\t\t{\n\t\t\treturn new CoalesceEntry()\n\t\t\t{\n\t\t\t\tBlobData = Optional.Some(message),\n\t\t\t\tCoalesceKey = coalesceKey,\n\t\t\t\tAddFirst = addFirst\n\t\t\t};\n\t\t}\n\n\t\tpublic static IObservable<CoalesceEntry> ToCoalesceEntry(\n\t\t\tthis IObservable<IBinaryMessage> message, string coalesceKey, bool addFirst = false)\n\t\t{\n\t\t\treturn message.Select(\n\t\t\t\tm => new CoalesceEntry()\n\t\t\t\t{\n\t\t\t\t\tBlobData = Optional.Some(m),\n\t\t\t\t\tCoalesceKey = coalesceKey,\n\t\t\t\t\tAddFirst = addFirst\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static IObservable<CoalesceEntry> ToCoalesceEntry(\n\t\t\tthis IObservable<Optional<IBinaryMessage>> message, string coalesceKey, bool addFirst = false)\n\t\t{\n\t\t\treturn message.Select(\n\t\t\t\tm => new CoalesceEntry()\n\t\t\t\t{\n\t\t\t\t\tBlobData = m,\n\t\t\t\t\tCoalesceKey = coalesceKey,\n\t\t\t\t\tAddFirst = addFirst\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/CodeGenerator.cs",
    "content": "﻿using System;\n\nnamespace Fuse.Preview\n{\n\tpublic class Code\n\t{\n\t\treadonly string _code;\n\n\t\tpublic Code(string code)\n\t\t{\n\t\t\t_code = code;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn _code;\n\t\t}\n\t}\n\n\tclass CodeGenerator\n\t{\n\t\tstatic readonly char []_tableData;\n\n\t\tstatic CodeGenerator()\n\t\t{\n\t\t\t_tableData = new char[26 + 10];\n\t\t\tvar idx = 0;\n\t\t\tfor (var i = 0; i < 26; ++i)\n\t\t\t{\n\t\t\t\t// Create alphabet\n\t\t\t\t_tableData[idx++] = (char)(i + 65);\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < 10; ++i)\n\t\t\t{\n\t\t\t\t// Create digits\n\t\t\t\t_tableData[idx++] = (char)(i + 48);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Code CreateRandomCode(int numSymbols)\n\t\t{\n\t\t\tvar code = \"\";\n\t\t\tvar rand = new Random();\n\t\t\tfor (var i = 0; i < numSymbols; ++i)\n\t\t\t{\n\t\t\t\tcode += _tableData[rand.Next(_tableData.Length)];\n\t\t\t}\n\t\t\treturn new Code(code);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Ended.cs",
    "content": "using System.IO;\nusing Outracks.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class Ended : IBinaryMessage\n\t{\n\t\tpublic static string MessageType = \"Ended\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic IBinaryMessage Command { get; set; }\n\t\tpublic bool Success { get; set; }\n\t\tpublic AbsoluteDirectoryPath BuildDirectory { get; set; }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\tCommand.WriteTo(writer);\n\t\t\twriter.Write(Success);\n\t\t\tAbsoluteDirectoryPath.Write(writer, BuildDirectory);\n\t\t}\n\n\t\tpublic static Ended ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new Ended\n\t\t\t{\n\t\t\t\tCommand = BinaryMessage.ReadFrom(reader),\n\t\t\t\tSuccess = reader.ReadBoolean(),\n\t\t\t\tBuildDirectory = AbsoluteDirectoryPath.Read(reader)\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/ErrorListAdapter.cs",
    "content": "using System;\nusing Uno;\nusing Uno.Logging;\n\nnamespace Fuse.Preview\n{\n\tclass ErrorListAdapter : IErrorList\n\t{\n\t\treadonly Guid _buildId;\n\t\treadonly IProgress<BuildIssueDetected> _events;\n\n\t\tpublic ErrorListAdapter(Guid buildId, IProgress<BuildIssueDetected> events)\n\t\t{\n\t\t\t_buildId = buildId;\n\t\t\t_events = events;\n\t\t}\n\n\t\tpublic void AddFatalError(Source src, string code, string msg)\n\t\t{\n\t\t\tReport(new BuildIssueDetected(BuildIssueType.FatalError, code, msg, src.ToSourceReference(), _buildId));\n\t\t}\n\n\t\tpublic void AddError(Source src, string code, string msg)\n\t\t{\n\t\t\tReport(new BuildIssueDetected(BuildIssueType.Error, code, msg, src.ToSourceReference(), _buildId));\n\t\t}\n\n\t\tpublic void AddWarning(Source src, string code, string msg)\n\t\t{\n\t\t\tReport(new BuildIssueDetected(BuildIssueType.Warning, code, msg, src.ToSourceReference(), _buildId));\n\t\t}\n\n\t\tpublic void AddMessage(Source src, string code, string msg)\n\t\t{\n\t\t\tReport(new BuildIssueDetected(BuildIssueType.Message, code, msg, src.ToSourceReference(), _buildId));\n\t\t}\n\n\t\tvoid Report(BuildIssueDetected ev)\n\t\t{\n\t\t\t_events.Report(ev);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/FileDataWithMetadata.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing Outracks;\nusing Outracks.IO;\n\nnamespace Fuse.Preview\n{\n\tpublic static class FileDataWithMetadata\n\t{\n\t\tpublic static FileDataWithMetadata<T> Create<T>(T metadata, byte[] data)\n\t\t{\n\t\t\treturn new FileDataWithMetadata<T>(metadata, data);\n\t\t}\n\n\t\tpublic static IObservable<FileDataWithMetadata<AbsoluteFilePath>> DiffFileContent(this IObservable<AbsoluteFilePath> observable, IFileSystem fs)\n\t\t{\n\t\t\treturn observable.DiffFileContent(fs, _ => _);\n\t\t}\n\n\t\tpublic static IObservable<FileDataWithMetadata<T>> DiffFileContent<T>(this IObservable<T> observable, IFileSystem fs, Func<T, AbsoluteFilePath> path)\n\t\t{\n\t\t\treturn observable.Select(\n\t\t\t\tdep =>\n\t\t\t\t{\n\t\t\t\t\tusing(var stream = fs.Read(path(dep), 10))\n\t\t\t\t\t\treturn Create(dep, stream.ReadAllBytes());\n\t\t\t\t})\n\t\t\t\t.BufferPrevious()\n\t\t\t\t.Where(buffer =>\n\t\t\t\t{\n\t\t\t\t\tvar prev = buffer.Previous;\n\t\t\t\t\tvar cur = buffer.Current;\n\n\t\t\t\t\t// Just go on, if no previous version exist.\n\t\t\t\t\tif (prev.HasValue == false)\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t// Check if the byte sequences aren't equal\n\t\t\t\t\t// to filter out equal sequences.\n\t\t\t\t\treturn EqualsFast(prev.Value.Data, cur.Data) == false;\n\t\t\t\t})\n\t\t\t\t.Select(b => b.Current);\n\t\t}\n\n\t\t// Apps made in Fuse may have pretty big assets as movies etc.\n\t\t// where the byte sequence equals (linq) method performs really bad\n\t\t// So this is just a faster solution\n\t\tstatic bool EqualsFast(byte []a, byte []b)\n\t\t{\n\t\t\tif (a.Length != b.Length)\n\t\t\t\treturn false;\n\n\t\t\tfor (int i = 0; i < a.Length; ++i)\n\t\t\t{\n\t\t\t\tif (a[i] != b[i])\n\t\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic class FileDataWithMetadata<T>\n\t{\n\t\tpublic readonly T Metadata;\n\t\tpublic readonly byte[] Data;\n\n\t\tpublic FileDataWithMetadata(T metadata, byte[] data)\n\t\t{\n\t\t\tMetadata = metadata;\n\t\t\tData = data;\n\t\t}\n\n\t\tpublic FileDataWithMetadata<TIn> WithMetadata<TIn>(TIn metadata)\n\t\t{\n\t\t\treturn new FileDataWithMetadata<TIn>(metadata, Data);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/FileSender.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.CodeGeneration;\nusing Outracks.Simulator.Protocol;\n\nnamespace Fuse.Preview\n{\n\tpublic class FileSender<T>\n\t{\n\t\treadonly Func<FileDataWithMetadata<T>, IObservable<Statement>> _statementToExecute;\n\n\t\tpublic FileSender(Func<FileDataWithMetadata<T>, IObservable<Statement>> statementToExecute)\n\t\t{\n\t\t\t_statementToExecute = statementToExecute;\n\t\t}\n\n\t\tpublic IObservable<CoalesceEntry> CreateMessages(FileDataWithMetadata<T> file)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn _statementToExecute(file)\n\t\t\t\t\t.Select(s => new[] { s }.MakeExecute())\n\t\t\t\t\t.ToCoalesceEntry(file.Metadata.ToString(), addFirst: true);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Observable.Return(new BytecodeUpdated(new Lambda(Signature.Action(), Enumerable.Empty<BindVariable>(), Enumerable.Empty<Statement>())))\n\t\t\t\t\t.ToCoalesceEntry(\"invalid-file-dependency\");\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static class MakeExecuteExtension\n\t{\n\t\tpublic static BytecodeUpdated MakeExecute(this IEnumerable<Statement> statements)\n\t\t{\n\t\t\treturn new BytecodeUpdated(MakeLambda(statements));\n\t\t}\n\n\t\tpublic static Lambda MakeLambda(this IEnumerable<Statement> statements)\n\t\t{\n\t\t\treturn new Lambda(\n\t\t\t\tnew Signature(ImmutableList<Parameter>.Empty, Optional.None()),\n\t\t\t\tlocalVariables: new BindVariable[0],\n\t\t\t\tstatements: statements);\n\t\t}\n\t}\n\n\tpublic static class FileSourceSender\n\t{\n\t\tpublic static FileSender<ProjectDependency> Create(IFileSystem fileSystem)\n\t\t{\n\t\t\treturn new FileSender<ProjectDependency>(\n\t\t\t\tstatementToExecute: file =>\n\t\t\t\t\tObservable.Return(ImportExpression.UpdateFile(\n\t\t\t\t\t\tdescriptor: file.Metadata.Descriptor,\n\t\t\t\t\t\tdata: file.Data)));\n\t\t}\n\t}\n\n\tpublic static class BundleFileSender\n\t{\n\t\tpublic static FileSender<AbsoluteFilePath> Create(IFileSystem fileSystem, IObservable<AbsoluteDirectoryPath> project)\n\t\t{\n\t\t\treturn new FileSender<AbsoluteFilePath>(\n\t\t\t\tstatementToExecute: file =>\n\t\t\t\t\tproject.Select(projDir =>\n\t\t\t\t\t\tBundleFiles.AddOrUpdateFile(\n\t\t\t\t\t\t\tdescriptor: file.Metadata.RelativeTo(projDir).NativeRelativePath.ToUnixPath(),\n\t\t\t\t\t\t\tdata: file.Data)));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/GenerateBytecode.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class GenerateBytecode : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"GenerateBytecode\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic Guid Id { get; private set; }\n\t\tpublic ImmutableList<UxFileContents> UxFiles { get; private set; }\n\n\t\tpublic GenerateBytecode(Guid id, ImmutableList<UxFileContents> uxFiles)\n\t\t{\n\t\t\tId = id;\n\t\t\tUxFiles = uxFiles;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.WriteGuid(Id);\n\t\t\tList.Write(writer, UxFiles, (Action<UxFileContents, BinaryWriter>)UxFileContents.Write);\n\t\t}\n\n\t\tpublic static GenerateBytecode ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar id = reader.ReadGuid();\n\t\t\tvar uxFiles = List.Read(reader, (Func<BinaryReader, UxFileContents>)UxFileContents.Read);\n\t\t\treturn new GenerateBytecode(id, uxFiles);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/IErrorHelper.cs",
    "content": "using System.Collections.Generic;\nusing Uno.Build;\n\nnamespace Fuse.Preview\n{\n\tpublic interface IErrorHelper\n\t{\n\t\tvoid OnBuildFailed(BuildResult build);\n\t}\n\n\tpublic class CombinedErrorHelper : IErrorHelper\n\t{\n\t\tpublic IEnumerable<IErrorHelper> Helpers { get; set; }\n\n\t\tpublic void OnBuildFailed(BuildResult build)\n\t\t{\n\t\t\tforeach (var helper in Helpers)\n\t\t\t\thelper.OnBuildFailed(build);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/IProjectAndServer.cs",
    "content": "using System;\nusing Outracks.Simulator.Protocol;\n\nnamespace Fuse.Preview\n{\n\tpublic interface IProjectAndServer\n\t{\n\t\tIObservable<BuildProject> BuildProject { get; }\n\t\tProjectPreview Preview { get; }\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/InternalBuildError.cs",
    "content": "﻿using System;\nusing Outracks.Simulator;\n\nnamespace Fuse.Preview\n{\n\tpublic class InternalBuildError : BuildFailed\n\t{\n\t\tpublic InternalBuildError(Exception innerException)\n\t\t\t: base(/*Language.Current.InternalBuildError*/\"Internal build error\", innerException)\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/LogSubject.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing Outracks;\nusing Outracks.Simulator.Parser;\nusing Uno.Logging;\n\nnamespace Fuse.Preview\n{\n\tclass LogSubject\n\t{\n\t\tpublic LogSubject(Guid id)\n\t\t{\n\t\t\tvar buildEvents = new Subject<IBinaryMessage>();\n\t\t\tvar loggedEvents = new AccumulatingProgress<IBinaryMessage>(buildEvents.ToProgress());\n\t\t\tvar errorList = new ErrorListAdapter(id, loggedEvents);\n\t\t\tvar textWriter = new TextWriterAdapter(id, loggedEvents);\n\n\t\t\tLog = new Log(errorList, textWriter);\n\t\t\tMessages = buildEvents;\n\t\t}\n\n\t\tpublic Log Log { get; private set; }\n\t\tpublic IObservable<IBinaryMessage> Messages { get; private set; }\n\t}\n}"
  },
  {
    "path": "src/preview/service/MarkupErrorLog.cs",
    "content": "using System;\nusing Outracks;\nusing Outracks.Simulator;\nusing Uno.UX.Markup.Common;\n\nnamespace Fuse.Preview\n{\n\tpublic class MarkupErrorLog : IMarkupErrorLog\n\t{\n\t\treadonly Guid _buildId;\n\t\treadonly IObserver<IBinaryMessage> _observer;\n\n\t\tpublic MarkupErrorLog(IObserver<IBinaryMessage> observer, Guid buildId)\n\t\t{\n\t\t\t_buildId = buildId;\n\t\t\t_observer = observer;\n\t\t}\n\n\t\tpublic void ReportError(string message)\n\t\t{\n\t\t\t_observer.OnNext(\n\t\t\t\tnew BuildIssueDetected(\n\t\t\t\t\tBuildIssueType.Error, \"\", message,\n\t\t\t\t\tOptional.None<SourceReference>(),\n\t\t\t\t\t_buildId));\n\t\t}\n\n\t\tpublic void ReportWarning(string message)\n\t\t{\n\t\t\t_observer.OnNext(\n\t\t\t\tnew BuildIssueDetected(\n\t\t\t\t\tBuildIssueType.Warning, \"\", message,\n\t\t\t\t\tOptional.None<SourceReference>(),\n\t\t\t\t\t_buildId));\n\t\t}\n\n\t\tpublic void ReportError(string path, int line, string message)\n\t\t{\n\t\t\t_observer.OnNext(\n\t\t\t\tnew BuildIssueDetected(\n\t\t\t\t\tBuildIssueType.Error, \"\", message,\n\t\t\t\t\tnew SourceReference((path), new TextPosition(new LineNumber(line), new CharacterNumber(1))),\n\t\t\t\t\t_buildId));\n\t\t}\n\n\t\tpublic void ReportWarning(string path, int line, string message)\n\t\t{\n\t\t\t_observer.OnNext(\n\t\t\t\tnew BuildIssueDetected(\n\t\t\t\t\tBuildIssueType.Warning, \"\", message,\n\t\t\t\t\tnew SourceReference((path), new TextPosition(new LineNumber(line), new CharacterNumber(1))),\n\t\t\t\t\t_buildId));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/MarkupParser.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing Fuse.Preview;\nusing Outracks.Simulator.Protocol;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class MarkupParser\n\t{\n\t\treadonly UxParser _parser;\n\t\treadonly ProjectBuild _build;\n\n\t\tpublic MarkupParser(ProjectBuild build, UxParser parser)\n\t\t{\n\t\t\t_parser = parser;\n\t\t\t_build = build;\n\t\t}\n\n\t\tpublic Optional<ProjectMarkup> TryParseDocuments(GenerateBytecode a, IObserver<IBinaryMessage> buildEvents, Guid buildId)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new ProjectMarkup(ParseDocument(ImmutableList.ToImmutableList(a.UxFiles), buildEvents, buildId), _build);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"InvalidMarkup\"></exception>\n\t\t/// <exception cref=\"CyclicClassHierarchy\"></exception>\n\t\t/// <exception cref=\"TypeNotFound\"></exception>\n\t\t/// <exception cref=\"UnknownBaseClass\"></exception>\n\t\t/// <exception cref=\"UnknownMemberType\"></exception>\n\t\t/// <exception cref=\"UnknownError\"></exception>\n\t\t/// <exception cref=\"UserCodeContainsErrors\">(Base exception type for all exceptions above)</exception>\n\t\t/// <exception cref=\"TypeNameCollision\"></exception>\n\t\tpublic Project ParseDocument(System.Collections.Immutable.ImmutableList<UxFileContents> documents, IObserver<IBinaryMessage> buildEvents, Guid buildId)\n\t\t{\n\t\t\treturn _parser.Parse(\n\t\t\t\tdocuments: documents,\n\t\t\t\treporter: new MarkupErrorLog(buildEvents, buildId));\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/OutputDirGenerator.cs",
    "content": "using System;\nusing System.IO;\nusing Outracks.IO;\n\nnamespace Fuse.Preview\n{\n\tpublic class LockFile : IDisposable\n\t{\n\t\treadonly AbsoluteFilePath _path;\n\t\treadonly FileStream _handle;\n\n\t\tpublic LockFile(AbsoluteFilePath path)\n\t\t{\n\t\t\t_path = path;\n\t\t\t_handle = new FileStream(path.NativePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);\n\t\t\tif (_handle.Length < 1)\n\t\t\t{\n\t\t\t\t_handle.WriteByte((byte)'f');\n\t\t\t\t_handle.Flush();\n\t\t\t}\n\t\t\t_handle.Lock(0, 1); // Actually lock a portion of the file\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_handle.Dispose();\n\t\t}\n\t}\n\n\tpublic class OutputDirWithLock\n\t{\n\t\tpublic readonly AbsoluteDirectoryPath OutputDir;\n\t\tpublic readonly LockFile LockFile;\n\n\t\tpublic OutputDirWithLock(AbsoluteDirectoryPath outputDir, LockFile lockFile)\n\t\t{\n\t\t\tOutputDir = outputDir;\n\t\t\tLockFile = lockFile;\n\t\t}\n\t}\n\n\tpublic class FailedToCreateOutputDir : Exception\n\t{\n\t\tpublic FailedToCreateOutputDir(AbsoluteDirectoryPath basePath, Exception innerException)\n\t\t\t: base(\"Failed to create or reuse output dir in '\" + basePath.NativePath + \"'\" + \": \" + innerException.Message, innerException)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class OutputDirGenerator\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\n\t\tpublic OutputDirGenerator(IFileSystem fileSystem)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t}\n\n\t\t/// <exception cref=\"FailedToCreateOutputDir\"></exception>\n\t\tpublic OutputDirWithLock CreateOrReuseOutputDir(AbsoluteDirectoryPath baseDir)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tconst int fileInUse = 0x20;\n\t\t\t\tconst int fileLocked = 0x21;\n\n\t\t\t\tLockFile lockFile = null;\n\t\t\t\tvar path = _fileSystem.MakeUnique(baseDir,\n\t\t\t\t\tcreateName: no => baseDir.Rename(MakePathUnique.CreateNumberName(baseDir.Name, no)),\n\t\t\t\t\tcondition: p =>\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!_fileSystem.Exists(p))\n\t\t\t\t\t\t\t\t_fileSystem.Create(p);\n\n\t\t\t\t\t\t\tvar lockFilePath = p / new FileName(\".lock\");\n\t\t\t\t\t\t\tlockFile = new LockFile(lockFilePath);\n\t\t\t\t\t\t\treturn false; // If the file wasn't locked, break creating of unique directories.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (IOException e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar win32ErrorCode = e.HResult & 0xFFFF;\n\t\t\t\t\t\t\tif (win32ErrorCode == fileLocked || win32ErrorCode == fileInUse)\n\t\t\t\t\t\t\t\treturn true; // If the file was locked, continue creating unique directories.\n\t\t\t\t\t\t\tthrow;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\treturn new OutputDirWithLock(path, lockFile);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new FailedToCreateOutputDir(baseDir, e);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/BinaryEncoding.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Outracks;\nusing Uno.Collections;\n\nnamespace Fuse.Preview\n{\n\tstatic class BinaryEncoding\n\t{\n\t\tpublic static void WriteArray<T>(this BinaryWriter streamWriter, IEnumerable<T> list, Action<BinaryWriter, T> write)\n\t\t{\n\t\t\tvar array = list.ToArray();\n\t\t\tstreamWriter.Write(array.Length);\n\t\t\tforeach (var i in array)\n\t\t\t{\n\t\t\t\twrite(streamWriter, i);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void WriteTaggedValue(this BinaryWriter writer, object value)\n\t\t{\n\t\t\tWriteValue(writer, value, tagType: writer.Write);\n\t\t}\n\n\t\tpublic static void WriteValue(this BinaryWriter writer, object value, Action<string> tagType = null)\n\t\t{\n\t\t\ttagType = tagType ?? (typeTag => { });\n\n\t\t\tvar valueType = value.GetType();\n\t\t\tif (valueType.IsArray)\n\t\t\t{\n\t\t\t\ttagType(valueType.GetElementType().FullName + \"[]\");\n\n\t\t\t\tvar array = ((Array) value);\n\t\t\t\twriter.Write(array.Length);\n\t\t\t\tfor (int i = 0; i < array.Length; i++)\n\t\t\t\t\twriter.WriteValue(array.GetValue(i));\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttagType(valueType.FullName);\n\n\t\t\tif (value is int) writer.Write((int)value);\n\t\t\telse if (value is bool) writer.Write((bool)value);\n\t\t\telse if (value is string) writer.Write((string)value);\n\t\t\telse throw new NotSupportedException(\"Unsopported argument type: \" + value.GetType());\n\t\t}\n\n\t\tpublic static object ReadTaggedValue(this BinaryReader reader)\n\t\t{\n\t\t\treturn reader.ReadValue(typeTag: reader.ReadString());\n\t\t}\n\n\t\tpublic static object ReadValue(this BinaryReader reader, string typeTag)\n\t\t{\n\t\t\tif (typeTag == typeof(int).FullName) return reader.ReadInt32();\n\t\t\tif (typeTag == typeof(bool).FullName) return reader.ReadBoolean();\n\t\t\tif (typeTag == typeof(string).FullName) return reader.ReadString();\n\t\t\tif (typeTag.EndsWith(\"[]\"))\n\t\t\t{\n\t\t\t\tvar elementTypeTag = typeTag.BeforeLast(\"[]\");\n\t\t\t\tvar elementType = Type.GetType(elementTypeTag);\n\t\t\t\tvar array = Array.CreateInstance(elementType, reader.ReadInt32());\n\t\t\t\tfor (int i = 0; i < array.Length; i++)\n\t\t\t\t\tarray.SetValue(ReadValue(reader, elementTypeTag), i);\n\t\t\t\treturn array;\n\t\t\t}\n\t\t\tthrow new NotSupportedException(\"Unsupported parameter type: \" + typeTag);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/EnsureSingleInstance.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Threading;\nusing Outracks;\n\nnamespace Fuse.Preview\n{\n\tpublic interface IEnsureSingleInstance : IDisposable\n\t{\n\t\tbool IsAlreadyRunning();\n\t}\n\n\tclass EnsureSingleInstanceWin : IEnsureSingleInstance\n\t{\n\t\treadonly Mutex _mutex;\n\t\treadonly bool _createdNew;\n\n\t\tpublic EnsureSingleInstanceWin(string name)\n\t\t{\n\t\t\t_mutex = new Mutex(true, name, out _createdNew);\n\t\t}\n\n\t\tpublic bool IsAlreadyRunning()\n\t\t{\n\t\t\treturn !_createdNew;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif (_createdNew)\n\t\t\t\t_mutex.ReleaseMutex();\n\n\t\t\t_mutex.Dispose();\n\t\t}\n\t}\n\n\tclass EnsureSingleInstanceMac : IEnsureSingleInstance\n\t{\n\t\treadonly FileStream _stream;\n\t\treadonly bool _isSingle = true;\n\t\treadonly IReport _report;\n\n\t\tconst int FileLocked = -2147024863;\n\n\t\tpublic EnsureSingleInstanceMac(string name, IReport report)\n\t\t{\n\t\t\t_report = report;\n\t\t\t_stream = File.OpenWrite(\"/tmp/\" + name + Environment.UserDomainName + \"_\" + Environment.UserName);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_stream.Lock(0, _stream.Length);\n\t\t\t\t_report.Info(\"Successfully locked\");\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tif (e.HResult == FileLocked)\n\t\t\t\t\t_isSingle = false;\n\t\t\t\telse\n\t\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsAlreadyRunning()\n\t\t{\n\t\t\treturn !_isSingle;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_report.Info(\"Disposing lock\");\n\t\t\t_stream.Unlock(0, _stream.Length);\n\t\t\t_stream.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/Factory.cs",
    "content": "using System.IO;\n\nnamespace Fuse.Preview\n{\n\tpublic static class PlatformFactory\n\t{\n\t\tpublic static IPlatform Create()\n\t\t{\n\t\t\tif (Path.DirectorySeparatorChar == '\\\\')\n\t\t\t\treturn new WindowsPlatform();\n\t\t\telse\n\t\t\t\treturn new MacPlatform();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/IPlatform.cs",
    "content": "using System.IO;\nusing System.Reflection;\n\nnamespace Fuse.Preview\n{\n\tpublic interface IPlatform\n\t{\n\t\tIProcess StartProcess(Assembly assembly, params string[] args);\n\n\t\tIProcess StartSingleProcess(Assembly assembly, params string[] args);\n\n\t\tStream CreateStream(string name);\n\n\t\tIEnsureSingleInstance EnsureSingleInstance();\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/IProcess.cs",
    "content": "using System.Collections.Generic;\nusing System.IO;\n\nnamespace Fuse.Preview\n{\n\tpublic interface IProcess\n\t{\n\t\tStream OpenStream(string name);\n\t\tIList<string> Arguments { get; }\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/Mac.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing Outracks;\nusing Outracks.IPC;\nusing Uno.Diagnostics;\n\nnamespace Fuse.Preview\n{\n\tpublic class MacPlatform : IPlatform\n\t{\n\t\tpublic IProcess StartProcess(Assembly assembly, params string[] args)\n\t\t{\n\t\t\tvar exePath = assembly.CodeBase.StripPrefix(\"file://\").StripSuffix(\".exe\");\n\n\t\t\tvar startInfo = new ProcessStartInfo\n\t\t\t{\n\t\t\t\tUseShellExecute = false,\n\t\t\t\tRedirectStandardInput = true,\n\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\tRedirectStandardError = true,\n\t\t\t\tCreateNoWindow = true,\n\t\t\t\tFileName = exePath,\n\t\t\t\tArguments = ProcessArguments.PackList(args)\n\t\t\t};\n\n#if DEBUG\n\t\t\tConsole.WriteLine(\"Starting \" + exePath + \" \" + string.Join(\" \", args));\n#endif\n\t\t\tProcess.Start(startInfo);\n\t\t\treturn new MacProcess(args);\n\t\t}\n\n\t\tpublic Stream CreateStream(string name)\n\t\t{\n\t\t\tvar pipeName = new PipeName(GetProcessIdentifier() + name);\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new UnixSocketStream(pipeName, SocketUsage.Host);\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tUnixSocketStream.Unlink(pipeName);\n\t\t\t}\n\n\t\t\treturn new UnixSocketStream(pipeName, SocketUsage.Host);\n\t\t}\n\n\t\tpublic IEnsureSingleInstance EnsureSingleInstance()\n\t\t{\n\t\t\treturn new EnsureSingleInstanceMac(GetProcessIdentifier(), ReportFactory.FallbackReport);\n\t\t}\n\n\t\tpublic IProcess StartSingleProcess(Assembly assembly, params string[] args)\n\t\t{\n\t\t\tusing (var ensureSingleInstance = new EnsureSingleInstanceMac(args.Join(\"-\"), ReportFactory.FallbackReport))\n\t\t\t{\n\t\t\t\tif (ensureSingleInstance.IsAlreadyRunning())\n\t\t\t\t\treturn new MacProcess(args);\n\t\t\t}\n\n\t\t\treturn StartProcess(assembly, args);\n\t\t}\n\n\t\tstring GetProcessIdentifier()\n\t\t{\n\t\t\treturn Environment.GetCommandLineArgs().Skip(1).Join(\"-\");\n\t\t}\n\t}\n\n\tclass MacProcess : IProcess\n\t{\n\t\tpublic MacProcess(IList<string> arguments)\n\t\t{\n\t\t\tArguments = arguments;\n\t\t}\n\n\t\tpublic IList<string> Arguments { get; private set; }\n\n\t\tpublic Stream OpenStream(string name)\n\t\t{\n\t\t\treturn new UnixSocketStream(new PipeName(GetProcessIdentifier() + name), SocketUsage.Client);\n\t\t}\n\n\t\tpublic string GetProcessIdentifier()\n\t\t{\n\t\t\treturn Arguments.Join(\"-\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/Platform/MethodCall.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Linq.Expressions;\n\nnamespace Fuse.Preview\n{\n\tpublic class MethodCall\n\t{\n\t\tpublic string Method { get; private set; }\n\n\t\tpublic object[] Arguments { get; private set; }\n\n\t\tpublic static MethodCall FromExpression<T>(Expression<Action<T>> command)\n\t\t{\n\t\t\tvar call = command.Body as MethodCallExpression;\n\t\t\tif (call == null)\n\t\t\t\tthrow new NotSupportedException(\"Not method call: \" + command.Body);\n\n\t\t\tvar args = new object[call.Arguments.Count];\n\t\t\tfor (int i =0; i<call.Arguments.Count; i++)\n\t\t\t{\n\t\t\t\tvar arg = call.Arguments[i];\n\t\t\t\tvar lambda = Expression.Lambda(arg, command.Parameters);\n\t\t\t\tvar d = lambda.Compile();\n\t\t\t\tvar value = d.DynamicInvoke(new object[1]);\n\t\t\t\targs[i] = value;\n\t\t\t}\n\n\t\t\treturn new MethodCall\n\t\t\t{\n\t\t\t\tArguments = args,\n\t\t\t\tMethod = call.Method.Name,\n\t\t\t};\n\t\t}\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\tpublic void WriteTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(Method);\n\t\t\twriter.Write(Arguments.Length);\n\t\t\tforeach (var argument in Arguments)\n\t\t\t\twriter.WriteTaggedValue(argument);\n\t\t}\n\n\t\t/// <exception cref=\"IOException\"></exception>\n\t\t/// <exception cref=\"NotSupportedException\"></exception>\n\t\tpublic static MethodCall ReadFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new MethodCall\n\t\t\t{\n\t\t\t\tMethod = reader.ReadString(),\n\t\t\t\tArguments = Enumerable\n\t\t\t\t\t.Range(0, reader.ReadInt32())\n\t\t\t\t\t.Select(_ => reader.ReadTaggedValue())\n\t\t\t\t\t.ToArray(),\n\t\t\t};\n\t\t}\n\n\t\tpublic void InvokeOn(object self)\n\t\t{\n\t\t\tvar method = self.GetType().GetMethod(Method);\n\t\t\tmethod.Invoke(self, Arguments);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/Platform/ProcessArguments.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Outracks;\n\nnamespace Fuse.Preview\n{\n\tstatic class ProcessArguments\n\t{\n\t\tpublic static IEnumerable<string> UnpackList(string arguments)\n\t\t{\n\t\t\tvar characters = new List<char>();\n\n\t\t\tbool isQuoted = false;\n\t\t\tfor (int i = 0; i < arguments.Length; i++)\n\t\t\t{\n\t\t\t\tvar c = arguments[i];\n\t\t\t\tif (c == '\"')\n\t\t\t\t{\n\t\t\t\t\tisQuoted = characters.Count == 0;\n\t\t\t\t}\n\t\t\t\telse if (c == ' ' && !isQuoted && characters.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tyield return new string(characters.ToArray());\n\t\t\t\t\tcharacters.Clear();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcharacters.Add(c);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (characters.Count > 0)\n\t\t\t\tyield return new string(characters.ToArray());\n\t\t}\n\n\t\tpublic static string PackList(IEnumerable<string> arguments)\n\t\t{\n\t\t\treturn arguments.Select(Uno.Extensions.QuoteSpace).Join(\" \");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/ProcessLog.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.IO;\nusing System.Reactive.Linq;\nusing System.Threading;\n\nnamespace Fuse.Preview\n{\n\tclass ProcessLog\n\t{\n\t\tstatic readonly IPlatform Platform = PlatformFactory.Create();\n\n\t\tstatic bool _readFromCalledBefore = false;\n\t\tpublic static IObservable<string> ReadFrom(IProcess process)\n\t\t{\n\t\t\tif (_readFromCalledBefore)\n\t\t\t\tthrow new InvalidOperationException(\"ProcessLog.ReadFrom is expected to only be called once!\");\n\t\t\t_readFromCalledBefore = true;\n\n\t\t\tvar logRead =  Observable.Create<string>(\n\t\t\t\tobserver =>\n\t\t\t\t{\n\t\t\t\t\tvar readThread = new Thread(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile (true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tusing (var reader = new BinaryReader(process.OpenStream(\"log\")))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\twhile (true)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tvar text = reader.ReadString();\n\t\t\t\t\t\t\t\t\t\t\tobserver.OnNext(text);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tThread.Sleep(16);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t{\n\t\t\t\t\t\tName = \"ProcessLog Read Thread\",\n\t\t\t\t\t\tIsBackground = true\n\t\t\t\t\t};\n\t\t\t\t\treadThread.Start();\n\n\t\t\t\t\treturn () => readThread.Abort();\n\t\t\t\t})\n\t\t\t.Publish()\n\t\t\t.RefCount();\n\n\t\t\treturn logRead;\n\t\t}\n\n\t\tstatic readonly ConcurrentQueue<string> Queue = new ConcurrentQueue<string>();\n\t\tstatic readonly AutoResetEvent Signal = new AutoResetEvent(false);\n\n\t\tpublic static void StartWriteThread()\n\t\t{\n\t\t\tvar writeThread = new Thread(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\twhile (true)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tWriteChunks(Platform.CreateStream(\"log\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tThread.Sleep(16);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t{\n\t\t\t\tName = \"ProcessLog Pump Thread\",\n\t\t\t\tIsBackground = true,\n\t\t\t};\n\n\t\t\twriteThread.Start();\n\t\t}\n\n\t\tstatic void WriteChunks(Stream stream)\n\t\t{\n\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tstring message;\n\t\t\t\twhile (Queue.TryDequeue(out message))\n\t\t\t\t\twriter.Write(message);\n\n\t\t\t\tSignal.WaitOne();\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Append(string message)\n\t\t{\n\t\t\tQueue.Enqueue(message);\n\t\t\tSignal.Set();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Platform/Windows.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.IO.Pipes;\nusing System.Linq;\nusing System.Reflection;\nusing Outracks;\n\nnamespace Fuse.Preview\n{\n\tpublic class WindowsPlatform : IPlatform\n\t{\n\t\tpublic IProcess StartProcess(Assembly assembly, params string[] args)\n\t\t{\n\t\t\tvar exePath = assembly.CodeBase.StripPrefix(\"file:///\");\n\n\t\t\tvar startInfo = new ProcessStartInfo\n\t\t\t{\n\t\t\t\tUseShellExecute = false,\n\t\t\t\tRedirectStandardInput = true,\n\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\tRedirectStandardError = true,\n\t\t\t\tCreateNoWindow = true,\n\t\t\t\tFileName = exePath,\n\t\t\t\tArguments = ProcessArguments.PackList(args),\n\t\t\t};\n\n#if DEBUG\n\t\t\tConsole.WriteLine(\"Starting \" + exePath + \" \" + string.Join(\" \", args));\n#endif\n\t\t\tProcess.Start(startInfo);\n\t\t\treturn new WindowsProcess(args);\n\t\t}\n\n\t\tpublic Stream CreateStream(string name)\n\t\t{\n\t\t\tvar stream = new NamedPipeServerStream(GetProcessIdentifier() + name);\n\t\t\tstream.WaitForConnection();\n\t\t\treturn stream;\n\t\t}\n\n\t\tpublic IEnsureSingleInstance EnsureSingleInstance()\n\t\t{\n\t\t\treturn new EnsureSingleInstanceWin(GetProcessIdentifier());\n\t\t}\n\n\t\tpublic IProcess StartSingleProcess(Assembly assembly, params string[] args)\n\t\t{\n\t\t\tusing (var ensureSingleInstance = new EnsureSingleInstanceWin(args.Join(\"-\")))\n\t\t\t{\n\t\t\t\tif (ensureSingleInstance.IsAlreadyRunning())\n\t\t\t\t\treturn new WindowsProcess(args);\n\t\t\t}\n\n\t\t\treturn StartProcess(assembly, args);\n\t\t}\n\n\t\tstatic string GetProcessIdentifier()\n\t\t{\n\t\t\treturn Environment.GetCommandLineArgs().Skip(1).Join(\"-\");\n\t\t}\n\t}\n\n\tclass WindowsProcess : IProcess\n\t{\n\t\tpublic WindowsProcess(IList<string> arguments)\n\t\t{\n\t\t\tArguments = arguments;\n\t\t}\n\n\t\tpublic IList<string> Arguments { get; private set; }\n\n\t\tpublic Stream OpenStream(string name)\n\t\t{\n\t\t\tvar stream = new NamedPipeClientStream(GetProcessIdentifier() + name);\n\t\t\tstream.Connect();\n\t\t\treturn stream;\n\t\t}\n\n\t\tpublic string GetProcessIdentifier()\n\t\t{\n\t\t\treturn Arguments.Join(\"-\");\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/preview/service/PreviewService.cs",
    "content": "using System;\nusing Outracks;\nusing Outracks.Fuse.Auth;\nusing Outracks.IO;\n\nnamespace Fuse.Preview\n{\n\tpublic class PreviewService : IDisposable\n\t{\n\t\treadonly ReplayQueueSubject<string> _logMessages = new ReplayQueueSubject<string>();\n\t\tpublic IObservable<string> LogMessages\n\t\t{\n\t\t\tget { return _logMessages; }\n\t\t}\n\n\t\treadonly IShell _shell;\n\t\treadonly BuildOutputDirGenerator _buildOutputDirGenerator;\n\t\treadonly ProxyServer _proxy;\n\n\t\tpublic PreviewService()\n\t\t{\n\t\t\t_shell = new Shell();\n\t\t\t_buildOutputDirGenerator = new BuildOutputDirGenerator(_shell);\n\t\t\t_proxy = ProxyServer.Start(_logMessages.OnNext);\n\t\t}\n\n\t\tpublic void UpdateReversedPorts(bool shouldUpdate)\n\t\t{\n\t\t\t_proxy.UpdateReversedPorts(shouldUpdate);\n\t\t}\n\n\t\tpublic ProjectPreview StartPreview(IProjectLike project)\n\t\t{\n\t\t\treturn new ProjectPreview(project, _shell, _buildOutputDirGenerator, _proxy);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_proxy.Dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/PreviewTarget.cs",
    "content": "using Uno.Build;\nusing Uno.Build.Targets;\n\nnamespace Fuse.Preview\n{\n\tpublic static class PreviewTarget\n\t{\n\t\tpublic static readonly BuildTarget Android = new AndroidBuild();\n\t\tpublic static readonly BuildTarget iOS = new iOSBuild();\n\t\tpublic static readonly BuildTarget Native = new NativeBuild();\n\t\tpublic static readonly BuildTarget DotNet = new DotNetBuild();\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/Program.cs",
    "content": "namespace Fuse.Preview\n{\n\tpublic static class Program\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tProjectProcess.Run(args);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/ProjectBuild.cs",
    "content": "using System.IO;\nusing Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class ProjectBuild : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"BuiltAssembly\";\n\n\t\tpublic readonly string Project;\n\t\tpublic readonly string Assembly;\n\t\tpublic readonly IDataTypeProvider TypeInfo;\n\n\t\tpublic ProjectBuild(\n\t\t\tstring project,\n\t\t\tstring assembly,\n\t\t\tIDataTypeProvider typeInfo)\n\t\t{\n\t\t\tProject = project;\n\t\t\tAssembly = assembly;\n\t\t\tTypeInfo = typeInfo;\n\t\t}\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(Assembly);\n\t\t}\n\n\t\tpublic static SerializedData ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new SerializedData\n\t\t\t{\n\t\t\t\tAssembly = reader.ReadString(),\n\t\t\t};\n\t\t}\n\n\t\tpublic class SerializedData\n\t\t{\n\t\t\tpublic string Assembly { get; set; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/ProjectMarkup.cs",
    "content": "﻿using Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic sealed class ProjectMarkup\n\t{\n\t\tpublic readonly Project Project;\n\t\tpublic readonly ProjectBuild Build;\n\n\t\tpublic ProjectMarkup(Project project, ProjectBuild build)\n\t\t{\n\t\t\tProject = project;\n\t\t\tBuild = build;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/ProjectPreview.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading.Tasks;\nusing Outracks;\nusing Outracks.Fuse.Auth;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.Runtime;\nusing Uno.ProjectFormat;\n\nnamespace Fuse.Preview\n{\n\t// These are temporary interfaces while refactoring\n\tpublic interface IProjectLike\n\t{\n\t\tIObservable<string> Name { get; }\n\n\t\tIObservable<IBinaryMessage> Mutations { get; }\n\n\t\tIObservable<IEnumerable<DocumentSource>> LatestSource { get; }\n\n\t\tIObservable<AbsoluteDirectoryPath> BuildOutputDirectory { get; }\n\n\t\tIObservable<AbsoluteDirectoryPath> RootDirectory { get; }\n\n\t\tIObservable<IImmutableSet<AbsoluteFilePath>> BundleFiles { get; }\n\n\t\tIObservable<IImmutableSet<AbsoluteFilePath>> FuseJsFiles { get; }\n\n\t\tIObservable<IImmutableSet<PackageReference>> PackageReferences { get; }\n\n\t\tIObservable<IImmutableSet<ProjectReference>> ProjectReferences { get; }\n\t}\n\n\n\tpublic class DocumentSource\n\t{\n\t\tpublic IDocumentLike LiveDocument { get; set; }\n\t\tpublic UxFileContents FileContents { get; set; }\n\t}\n\n\tpublic interface IDocumentLike\n\t{\n\t\tvoid UpdateSimulatorIds();\n\t}\n\n\tpublic class ProjectPreview : IDisposable\n\t{\n\t\treadonly IProjectLike _project;\n\t\treadonly IConnectableObservable<SimulatorHost> _simulatorHost;\n\t\treadonly BuildOutputDirGenerator _buildOutputDirGenerator;\n\t\treadonly AssetsWatcher _assetsWatcher;\n\t\treadonly Subject<object> _rebuild = new Subject<object>();\n\t\treadonly Subject<object> _refresh = new Subject<object>();\n\t\treadonly Subject<string> _logMessages = new Subject<string>();\n\t\treadonly ProxyServer _proxy;\n\n\t\tbool _isDisposed;\n\t\treadonly IDisposable _dispose;\n\n\t\tpublic IObservable<string> LogMessages\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _assetsWatcher.LogMessages\n\t\t\t\t\t.Merge(_logMessages.Select(s => s + '\\n'));\n\t\t\t}\n\t\t}\n\n\t\tpublic ProjectPreview(\n\t\t\tIProjectLike project,\n\t\t\tIFileSystem shell,\n\t\t\tBuildOutputDirGenerator buildOutputDirGenerator,\n\t\t\tProxyServer proxy)\n\t\t{\n\t\t\tName = project.Name;\n\t\t\tvar simulatorHost = ProjectProcess.SpawnAsync().Replay(1);\n\n\t\t\tvar simulatorMessages = simulatorHost.Switch(p => p.Messages.RefCount()).Publish().RefCount();\n\n\t\t\tvar assemblyBuilt = simulatorMessages.TryParse(AssemblyBuilt.MessageType, AssemblyBuilt.ReadDataFrom);\n\t\t\tvar bytecodeGenerated = simulatorMessages.TryParse(BytecodeGenerated.MessageType, BytecodeGenerated.ReadDataFrom);\n\t\t\tvar bytecodeUpdated = simulatorMessages.TryParse(BytecodeUpdated.MessageType, BytecodeUpdated.ReadDataFrom);\n\n\t\t\t_project = project;\n\t\t\t_buildOutputDirGenerator = buildOutputDirGenerator;\n\t\t\t_proxy = proxy;\n\t\t\t_simulatorHost = simulatorHost;\n\t\t\t_assetsWatcher = new AssetsWatcher(shell, project.RootDirectory, Scheduler.Default);\n\n\t\t\tvar bytecode = bytecodeGenerated.Select(msg => msg.Bytecode);\n\n\t\t\t_coalesceEntryCache = new CoalesceEntryCache();\n\t\t\tvar assets = project.BundleFiles.CombineLatest(project.FuseJsFiles, (a, b) => a.Concat(b));\n\t\t\tvar reifyMessages = ReifyProject(bytecode, bytecodeUpdated, _coalesceEntryCache, assets);\n\n\t\t\tvar dependencyMessages = _assetsWatcher.UpdateChangedDependencies(bytecode.Select(bc => bc.Dependencies.ToImmutableHashSet()));\n\t\t\tvar bundleFileMessages = _assetsWatcher.UpdateChangedBundleFiles(project.BundleFiles);\n\t\t\tvar fuseJsFileMessages = _assetsWatcher.UpdateChangedFuseJsFiles(project.FuseJsFiles);\n\n\t\t\t_dispose = Observable.Merge(\n\t\t\t\t\tbundleFileMessages,\n\t\t\t\t\tdependencyMessages,\n\t\t\t\t\tfuseJsFileMessages,\n\t\t\t\t\treifyMessages)\n\t\t\t\t.Subscribe(e => _coalesceEntryCache.Add(e));\n\n\t\t\tvar incommingMessages = new Subject<IBinaryMessage>();\n\n\t\t\tvar clientAdded = new Subject<string>();\n\t\t\tvar clientRemoved = new Subject<string>();\n\n\t\t\tvar socketServer = SocketServer.Start(\n\t\t\t\tport: 0,\n\t\t\t\tclientRun: (clientStream, endPoint) =>\n\t\t\t\t{\n\t\t\t\t\tbool isDisconnected = false;\n\n\t\t\t\t\tvar writeMessages = _coalesceEntryCache\n\t\t\t\t\t\t.ReplayFrom(-1)\n\t\t\t\t\t\t.ObserveOn(TaskPoolScheduler.Default)\n\t\t\t\t\t\t.Subscribe(cacheEntry =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (isDisconnected)\n\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tusing (var memoryStream = new MemoryStream())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tusing (var memoryStreamWriter = new BinaryWriter(memoryStream))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// ReSharper disable once AccessToDisposedClosure\n\t\t\t\t\t\t\t\t\t\tcacheEntry.Entry.BlobData.Do(message => message.WriteTo(memoryStreamWriter));\n\t\t\t\t\t\t\t\t\t\tclientStream.Write(memoryStream.ToArray(), 0, (int)memoryStream.Length);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tisDisconnected = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\tvar clientInfo = Optional.None<RegisterName>();\n\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tusing (var binaryStream = new BinaryReader(clientStream))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile (true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar msg = BinaryMessage.ReadFrom(binaryStream);\n\n\t\t\t\t\t\t\t\tif (!clientInfo.HasValue)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tclientInfo = BinaryMessage.TryParse(msg, RegisterName.MessageType, RegisterName.ReadDataFrom);\n\n\t\t\t\t\t\t\t\t\tif (clientInfo.HasValue)\n\t\t\t\t\t\t\t\t\t\tclientAdded.OnNext(clientInfo.Value.DeviceId);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tincommingMessages.OnNext(msg);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\tif (clientInfo.HasValue)\n\t\t\t\t\t\t\tclientRemoved.OnNext(clientInfo.Value.DeviceId);\n\n\t\t\t\t\t\twriteMessages.Dispose();\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\tAssembly = assemblyBuilt;\n\t\t\tPort = socketServer.LocalEndPoint.Port;\n\t\t\tBytecode = bytecodeGenerated;\n\t\t\tPackageReferences = project.PackageReferences;\n\t\t\tProjectReferences = project.ProjectReferences;\n\n\t\t\tClientAdded = clientAdded;\n\t\t\tClientRemoved = clientRemoved;\n\n\t\t\tMessages = Observable.Merge(\n\t\t\t\tincommingMessages,\n\t\t\t\tsimulatorMessages);\n\t\t\tAccessCode = CodeGenerator.CreateRandomCode(5);\n\n\t\t}\n\n\t\tpublic IDisposable Start(\n\t\t\tIObservable<BuildProject> buildArgs,\n\t\t\tIScheduler scheduler = null)\n\t\t{\n\t\t\tscheduler = scheduler ?? Scheduler.Default;\n\n\t\t\tvar refresh = _refresh.Merge(Messages.TryParse(ReifyRequired.MessageType, ReifyRequired.ReadDataFrom));\n\n\t\t\tvar disposable = _simulatorHost.SubscribeUsing(host =>\n\t\t\t{\n\t\t\t\tvar endedMessages = host.Messages.TryParse(Ended.MessageType, Ended.ReadDataFrom);\n\n\t\t\t\treturn Disposable.Combine(\n\t\t\t\t\tDisposable.Create(() => _proxy.RemoveProject(Port)),\n\n\t\t\t\t\t_project.Mutations\n\t\t\t\t\t\t.Merge(_project.Mutations\n\t\t\t\t\t\t\t.OfType<ReifyRequired>().StartWith(new ReifyRequired())\n\t\t\t\t\t\t\t.WithLatestFromBuffered(_project.LatestSource, (signal, data) => data.ToArray())\n\t\t\t\t\t\t\t.Do(\n\t\t\t\t\t\t\t\tdocs =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach (var doc in docs)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdoc.LiveDocument.UpdateSimulatorIds();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.Throttle(TimeSpan.FromSeconds(1.0 / 20.0), scheduler)\n\t\t\t\t\t\t\t.ObserveOn(Application.MainThread)\n\t\t\t\t\t\t\t.Select(docs => (IBinaryMessage)new GenerateBytecode(Guid.NewGuid(), List.ToImmutableList(docs.Select(doc => doc.FileContents)))))\n\t\t\t\t\t\t.Merge(_rebuild.StartWith(new object())\n\t\t\t\t\t\t\t.CombineLatest(buildArgs, (_, t) => t)\n\t\t\t\t\t\t\t.WithLatestFromBuffered(_project.BuildOutputDirectory, (args, buildDir) =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar output = _buildOutputDirGenerator.Acquire(buildDir / new DirectoryName(\"dotnet\") / new DirectoryName(\"preview\"));\n\t\t\t\t\t\t\t\targs.OutputDir = output.NativePath;\n\t\t\t\t\t\t\t\targs.Id = Guid.NewGuid();\n\n\t\t\t\t\t\t\t\treturn args;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.Do(args => _proxy.AddProject(\n\t\t\t\t\t\t\t\tPort,\n\t\t\t\t\t\t\t\tAccessCode.ToString(),\n\t\t\t\t\t\t\t\targs.ProjectPath,\n\t\t\t\t\t\t\t\targs.Defines.ToArray())))\n\t\t\t\t\t\t.Merge(refresh\n\t\t\t\t\t\t\t.WithLatestFromBuffered(_project.LatestSource, (signal, data) => data.ToArray())\n\t\t\t\t\t\t\t.Select(docs => new GenerateBytecode(Guid.NewGuid(), List.ToImmutableList(docs.Select(doc => doc.FileContents))))\n\t\t\t\t\t\t\t.SkipUntil(endedMessages))\n\t\t\t\t\t\t.Subscribe(host.Send),\n\n\t\t\t\t\tendedMessages.Subscribe(ended =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (ended.Command.Type == BuildProject.MessageType)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_buildOutputDirGenerator.Release(ended.BuildDirectory);\n\t\t\t\t\t\t\tRefresh();\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t});\n\n\t\t\t_simulatorHost.Connect();\n\n\t\t\treturn disposable;\n\t\t}\n\n\t\tpublic void Refresh()\n\t\t{\n\t\t\t_refresh.OnNext(new object());\n\t\t}\n\n\t\tpublic void Rebuild()\n\t\t{\n\t\t\t_rebuild.OnNext(new object());\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Prevents the specified build output directory from being overwritten by a rebuild, since that will fail if the assembly is loaded by a viewport\n\t\t/// </summary>\n\t\tpublic IDisposable LockBuild(AbsoluteDirectoryPath outputDir)\n\t\t{\n\t\t\treturn _buildOutputDirGenerator.Lock(outputDir);\n\t\t}\n\n\t\tIObservable<CoalesceEntry> ReifyProject(IObservable<ProjectBytecode> bytecode, IObservable<BytecodeUpdated> bytecodeUpdated, CoalesceEntryCache cache, IObservable<IEnumerable<AbsoluteFilePath>> assets)\n\t\t{\n\t\t\tint idx = 0;\n\t\t\tvar bytecodeUpdates = bytecodeUpdated.Select(m => m.ToCoalesceEntry(BytecodeUpdated.MessageType + (++idx)))\n\t\t\t\t.Publish()\n\t\t\t\t.RefCount();\n\n\t\t\tvar clearOldUpdates = bytecodeUpdates\n\t\t\t\t.Buffer(bytecode)\n\t\t\t\t.Select(\n\t\t\t\t\toldUpdates =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedUpdates = new List<CoalesceEntry>();\n\t\t\t\t\t\tforeach (var oldUpdate in oldUpdates)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcachedUpdates.Add(new CoalesceEntry()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tBlobData = Optional.None(),\n\t\t\t\t\t\t\t\tCoalesceKey = oldUpdate.CoalesceKey\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn cachedUpdates;\n\t\t\t\t\t})\n\t\t\t\t\t.SelectMany(t => t);\n\n\t\t\tvar reify = bytecode.WithLatestFromBuffered(assets, (bc, ass) =>\n\t\t\t{\n\t\t\t\tvar waitForDependencies = Task.WaitAll(new []\n\t\t\t\t{\n\t\t\t\t\tbc.Dependencies.Select(d => cache.HasEntry(d.ToString()))\n\t\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t\t.FirstAsync()\n\t\t\t\t\t\t.ToTask(),\n\t\t\t\t\tass.Select(d => cache.HasEntry(d.ToString()))\n\t\t\t\t\t\t.ToObservableEnumerable()\n\t\t\t\t\t\t.FirstAsync()\n\t\t\t\t\t\t.ToTask()\n\t\t\t\t}, TimeSpan.FromSeconds(60));\n\n\t\t\t\tif (waitForDependencies == false)\n\t\t\t\t{\n\t\t\t\t\tthrow new TimeoutException(\"Failed to load all assets dependencies.\");\n\t\t\t\t}\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn new BytecodeGenerated(\n\t\t\t\t\t\t\tnew ProjectBytecode(\n\t\t\t\t\t\t\t\treify: new Lambda(\n\t\t\t\t\t\t\t\t\tSignature.Action(Variable.This),\n\t\t\t\t\t\t\t\t\tEnumerable.Empty<BindVariable>(),\n\t\t\t\t\t\t\t\t\tnew[]\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tExpressionConverter.BytecodeFromSimpleLambda(() => ObjectTagRegistry.Clear()),\n\n\t\t\t\t\t\t\t\t\t\tnew CallLambda(bc.Reify, new ReadVariable(Variable.This)),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tmetadata: bc.Metadata,\n\t\t\t\t\t\t\t\tdependencies: bc.Dependencies))\n\t\t\t\t\t\t.ToCoalesceEntry(BytecodeGenerated.MessageType);\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\treturn new BytecodeUpdated(\n\t\t\t\t\t\t\tnew Lambda(\n\t\t\t\t\t\t\t\tSignature.Action(),\n\t\t\t\t\t\t\t\tEnumerable.Empty<BindVariable>(),\n\t\t\t\t\t\t\t\tEnumerable.Empty<Statement>()))\n\t\t\t\t\t\t.ToCoalesceEntry(\"invalid-byte-code\");\n\t\t\t\t}\n\t\t\t})\n\t\t\t.CatchAndRetry(TimeSpan.FromSeconds(15),\n\t\t\t\te =>\n\t\t\t\t{\n\t\t\t\t\t_logMessages.OnNext(\"Failed to refresh because: \" + e.Message);\n\t\t\t\t});\n\n\t\t\treturn Observable.Merge(clearOldUpdates, reify, bytecodeUpdates);\n\t\t}\n\n\t\tpublic IObservable<CoalesceEntry> GetPreviewCache()\n\t\t{\n\t\t\treturn _coalesceEntryCache.ReplayFrom(-1).Select(c => c.Entry);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tif (_isDisposed)\n\t\t\t\treturn;\n\n\t\t\t_dispose.Dispose();\n\t\t\t_assetsWatcher.Dispose();\n\n\t\t\t_isDisposed = true;\n\t\t}\n\n\t\tpublic IObservable<BytecodeGenerated> Bytecode { get; private set; }\n\n\t\tpublic IObservable<AssemblyBuilt> Assembly { get; private set; }\n\n\t\tpublic int Port { get; private set; }\n\n\t\tpublic IObservable<string> ClientRemoved { get; set; }\n\t\tpublic IObservable<string> ClientAdded { get; set; }\n\n\t\tpublic IObservable<IBinaryMessage> Messages { get; private set; }\n\n\t\tpublic readonly Code AccessCode;\n\t\treadonly CoalesceEntryCache _coalesceEntryCache;\n\n\t\tpublic IObservable<IImmutableSet<PackageReference>> PackageReferences { get; private set; }\n\n\t\tpublic IObservable<IImmutableSet<ProjectReference>> ProjectReferences { get; private set; }\n\n\t\tpublic readonly IObservable<string> Name;\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/ProjectProcess.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Reflection;\nusing Outracks;\nusing Outracks.Fuse;\nusing Outracks.Fuse.Analytics;\nusing Outracks.Fuse.Auth;\nusing Outracks.Simulator.Protocol;\n\nnamespace Fuse.Preview\n{\n\tpublic static class ProjectProcess\n\t{\n\t\tstatic readonly IPlatform Platform = PlatformFactory.Create();\n\n\t\tstatic readonly Assembly EntryAssembly = typeof (Program).Assembly;\n\t\tconst string MagicArgument = \"start\";\n\n\t\tpublic static IObservable<SimulatorHost> SpawnAsync()\n\t\t{\n\t\t\treturn Observable\n\t\t\t\t.Start(() => Spawn())\n\t\t\t\t.Catch((Exception e) =>\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(e);\n\t\t\t\t\treturn Observable.Never<SimulatorHost>();\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static SimulatorHost Spawn()\n\t\t{\n\t\t\tvar previewHost = Platform.StartProcess(EntryAssembly, MagicArgument, Guid.NewGuid().ToString());\n\n\t\t\tvar inputStream = previewHost.OpenStream(\"input\");\n\t\t\tvar outputStream = previewHost.OpenStream(\"output\");\n\n\t\t\t// TODO: for the simulator to shut down properly i think this stream needs to be ended\n\t\t\tvar input = new Subject<IBinaryMessage>();\n\t\t\tvar output = outputStream.ReadMessages(\"Simulator\").Publish();\n\t\t\tvar subscription = inputStream.BeginWritingMessages(\"Simulator\", ex => Console.WriteLine(\"fuse X failed to write message to simulator: \" + ex), input);\n\n\t\t\treturn new SimulatorHost(input.OnNext, output);\n\t\t}\n\n\t\tpublic static void Run(string[] args)\n\t\t{\n\t\t\tif (args.FirstOrDefault() != MagicArgument)\n\t\t\t\treturn;\n\n\t\t\tif (args.Length < 2)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"Expected second argument to be the unique identifier for the pipe.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar systemId = SystemGuidLoader.LoadOrCreateOrEmpty();\n\t\t\tvar sessionId = Guid.NewGuid();\n\t\t\tvar reporter = ReportFactory.GetReporter(systemId, sessionId, \"SimulatorHost\");\n\t\t\tAppDomain.CurrentDomain.ReportUnhandledExceptions(reporter);\n\n\t\t\tvar inputPipe = Platform.CreateStream(\"input\");\n\t\t\tvar outputPipe = Platform.CreateStream(\"output\");\n\n\t\t\tvar input = ReadInput(inputPipe);\n\n\t\t\tvar output = Run(input, SystemInfoFactory.GetBuildVersion(typeof(FuseApi).Assembly));\n\n\t\t\tusing (output.WriteOutput(outputPipe))\n\t\t\tusing (input.Connect())\n\t\t\t{\n\t\t\t\tinput.LastAsync().Wait();\n\t\t\t}\n\t\t}\n\n\t\tstatic IConnectableObservable<IBinaryMessage> ReadInput(Stream inputPipe)\n\t\t{\n\t\t\treturn inputPipe.ReadMessages(\"Designer\").Publish();\n\t\t}\n\n\t\tstatic IDisposable WriteOutput(this IObservable<IBinaryMessage> messages, Stream stream)\n\t\t{\n\t\t\tvar writer = new BinaryWriter(stream);\n\n\t\t\treturn Disposable.Combine(\n\t\t\t\tstream, writer,\n\t\t\t\tmessages.Subscribe(message => message.WriteTo(writer)));\n\t\t}\n\n\t\tpublic static IObservable<IBinaryMessage> Run(IObservable<IBinaryMessage> input, string version)\n\t\t{\n\t\t\tvar builder = new Builder(new UnoBuild(version));\n\t\t\tvar reifier = new Reifier(builder);\n\t\t\tvar updater = new Updater(reifier);\n\n\t\t\treturn Observable.Merge(\n\t\t\t\tbuilder.Build(input.TryParse(BuildProject.MessageType, BuildProject.ReadDataFrom)),\n\t\t\t\treifier.Reify(input.TryParse(GenerateBytecode.MessageType, GenerateBytecode.ReadDataFrom)),\n\t\t\t\tupdater.Update(input.TryParse(UpdateAttribute.MessageType, UpdateAttribute.ReadDataFrom)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyTitle(\"Outracks.Simulator.Proxy\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: InternalsVisibleTo(\"Fuse.Preview.Tests\")]\n[assembly: InternalsVisibleTo(\"Fuse.Preview.Tests\")]\n"
  },
  {
    "path": "src/preview/service/Proxy/ProxyProjectEntry.cs",
    "content": "using Uno.ProjectFormat;\n\nnamespace Fuse.Preview\n{\n\tclass ProxyProjectEntry\n\t{\n\t\tpublic int Port { get; set; }\n\t\tpublic string Code { get; set; }\n\n\t\tpublic Project Project { get; set; }\n\t\tpublic string[] Defines { get; set; }\n\t}\n}"
  },
  {
    "path": "src/preview/service/Proxy/ProxyServer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing Outracks;\nusing Outracks.IPC;\nusing Uno.ProjectFormat;\n\nnamespace Fuse.Preview\n{\n\tpublic class ProxyServer : IDisposable\n\t{\n\t\tpublic static ProxyServer Start(Action<string> log)\n\t\t{\n\t\t\treturn new ProxyServer(\n\t\t\t\tlog,\n\t\t\t\tnew AndroidPortReverser(),\n\t\t\t\tport: 12124);\n\t\t}\n\n\t\treadonly Dictionary<int, ProxyProjectEntry> _projects = new Dictionary<int, ProxyProjectEntry>();\n\t\treadonly ISocketServer _socketServer;\n\n\t\treadonly Action<string> _logWarning;\n\t\treadonly AndroidPortReverser _portReverser;\n\t\tbool _hasReversedPort;\n\n\t\tpublic ProxyServer(Action<string> logWarning, AndroidPortReverser portReverser, int port)\n\t\t{\n\t\t\t_socketServer = SocketServer.Start(port, ClientThread);\n\t\t\t_logWarning = logWarning;\n\t\t\t_portReverser = portReverser;\n\t\t\t_isEmpty.OnNext(Unit.Default);\n\t\t}\n\n\t\treadonly Subject<Unit> _isEmpty = new Subject<Unit>();\n\t\tpublic IObservable<Unit> IsEmpty\n\t\t{\n\t\t\tget { return _isEmpty; }\n\t\t}\n\n\t\tpublic void AddProject(int port, string code, string projectPath, string[] defines)\n\t\t{\n\t\t\tlock (_projects)\n\t\t\t{\n\t\t\t\t_projects[port] = new ProxyProjectEntry\n\t\t\t\t{\n\t\t\t\t\tPort = port,\n\t\t\t\t\tCode = code,\n\t\t\t\t\tProject = Project.Load(projectPath),\n\t\t\t\t\tDefines = defines,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tpublic void RemoveProject(int port)\n\t\t{\n\t\t\tlock (_projects)\n\t\t\t{\n\t\t\t\t_projects.Remove(port);\n\t\t\t\tif(_projects.Count <= 0)\n\t\t\t\t\t_isEmpty.OnNext(Unit.Default);\n\t\t\t}\n\t\t}\n\n\t\tpublic void UpdateReversedPorts(bool shouldUpdate)\n\t\t{\n\t\t\tif (_hasReversedPort && shouldUpdate == false)\n\t\t\t\treturn;\n\n\t\t\t_portReverser.ReversePortOrLogErrors(\n\t\t\t\tReportFactory.FallbackReport,\n\t\t\t\tremotePort: _socketServer.LocalEndPoint.Port,\n\t\t\t\tlocalPort: _socketServer.LocalEndPoint.Port);\n\n\t\t\t_hasReversedPort = true;\n\t\t}\n\n\t\tvoid ClientThread(NetworkStream stream, EndPoint proxyClientAddress)\n\t\t{\n\t\t\tusing (var streamReader = new BinaryReader(stream))\n\t\t\tusing (var streamWriter = new BinaryWriter(stream))\n\t\t\t{\n\t\t\t\tbool codeIsIncorrect = true;\n\t\t\t\twhile (codeIsIncorrect)\n\t\t\t\t{\n\t\t\t\t\tvar codeOrPath = streamReader.ReadString();\n\t\t\t\t\tvar code = \"\";\n\t\t\t\t\tvar path = \"\";\n\t\t\t\t\tif (codeOrPath.Contains(Path.DirectorySeparatorChar))\n\t\t\t\t\t\tpath = codeOrPath;\n\t\t\t\t\telse\n\t\t\t\t\t\tcode = codeOrPath;\n\n\t\t\t\t\tvar defines = streamReader.ReadString().Split(\" \").Where(d => !string.IsNullOrWhiteSpace(d)).ToArray();\n\n\t\t\t\t\tGetMatchingProject(path, code, defines).MatchWith(\n\t\t\t\t\t\tsome: entry =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// ReSharper disable AccessToDisposedClosure\n\t\t\t\t\t\t\tstreamWriter.Write(\"SUCCESS\");\n\t\t\t\t\t\t\tWriteEndPoints(streamWriter, entry.Port);\n\t\t\t\t\t\t\tstreamWriter.Write(entry.Project.Name);\n\n\t\t\t\t\t\t\tstreamWriter.WriteArray(\n\t\t\t\t\t\t\t\tentry.Project.PackageReferences,\n\t\t\t\t\t\t\t\t(writer, data) =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twriter.Write(data.PackageName);\n\t\t\t\t\t\t\t\t\twriter.Write(data.PackageVersion ?? \"0.0.0\");\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tstreamWriter.WriteArray(\n\t\t\t\t\t\t\t\tentry.Project.ProjectReferences,\n\t\t\t\t\t\t\t\t(writer, data) =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twriter.Write(data.ProjectPath);\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tcodeIsIncorrect = false;\n\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnone: () => streamWriter.Write(\"DESIGNER_NOT_RUNNING\"));\n\n\n\t\t\t\t\tstreamWriter.Flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tOptional<ProxyProjectEntry> GetMatchingProject(string path, string code, string[] defines)\n\t\t{\n\t\t\tProxyProjectEntry[] entries;\n\t\t\tlock (_projects)\n\t\t\t\tentries = _projects.Values.ToArray();\n\n\t\t\tforeach (var entry in entries)\n\t\t\t{\n\t\t\t\tvar match = entry.Project.FullPath == path || entry.Code == code;\n\n\t\t\t\t//Ignore defines for now https://github.com/fusetools/Fuse/issues/2359#issuecomment-256032410\n\t\t\t\tif (match && !defines.SetEquals(entry.Defines))\n\t\t\t\t{\n\t\t\t\t\t_logWarning(\"Warning: The preview running on the device has a different set of defines than the one running on your computer. This is normally OK.\");\n\n\t\t\t\t\tif (defines.Any())\n\t\t\t\t\t\t_logWarning(\"The defines on the device are: \" + (\"'\" + string.Join(\"','\", defines) + \"'.\"));\n\t\t\t\t\telse\n\t\t\t\t\t\t_logWarning(\"There are no defines on your device.\");\n\n\t\t\t\t\tif (entry.Defines.Any())\n\t\t\t\t\t\t_logWarning(\"The defines on the your computer are: \" + (\"'\" + string.Join(\"','\", entry.Defines) + \"'.\"));\n\t\t\t\t\telse\n\t\t\t\t\t\t_logWarning(\"There are no defines on your computer.\");\n\t\t\t\t}\n\n\t\t\t\tif (match)\n\t\t\t\t\treturn entry;\n\t\t\t}\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\n\t\tstatic void WriteEndPoints(BinaryWriter streamWriter, int port)\n\t\t{\n\t\t\tvar endPoints = NetworkHelper\n\t\t\t\t.GetInterNetworkIps()\n\t\t\t\t.Select(ip => new IPEndPoint(ip, port))\n\t\t\t\t.ToArray();\n\n\t\t\tstreamWriter.Write(endPoints.Length);\n\t\t\tforeach (var endPoint in endPoints)\n\t\t\t{\n\t\t\t\tstreamWriter.Write(endPoint.Address.ToString());\n\t\t\t\tstreamWriter.Write(endPoint.Port);\n\t\t\t}\n\n\t\t\tstreamWriter.Flush();\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_socketServer.Dispose();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/Proxy/ProxyServerFailed.cs",
    "content": "using System;\n\nnamespace Fuse.Preview\n{\n\tclass ProxyServerFailed : Exception\n\t{\n\t\tpublic ProxyServerFailed(string message) : base(message) { }\n\t}\n}"
  },
  {
    "path": "src/preview/service/RebuildRequired.cs",
    "content": "using System.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class RebuildRequired : IBinaryMessage\n\t{\n\t\tpublic static string MessageType = \"RebuildRequired\";\n\t\tpublic string Type { get { return MessageType; } }\n\t\tpublic void WriteDataTo(BinaryWriter writer) { }\n\n\t\tpublic static RebuildRequired ReadDataFrom(BinaryReader arg)\n\t\t{\n\t\t\treturn new RebuildRequired();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Reifier.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.CodeGeneration;\nusing Outracks.Simulator.Parser;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Fuse.Preview\n{\n\tpublic class Reifier\n\t{\n\t\treadonly ISubject<Optional<ProjectMarkup>> _result = new ReplaySubject<Optional<ProjectMarkup>>(1);\n\t\treadonly Builder _builder;\n\n\t\tpublic Reifier(Builder builder)\n\t\t{\n\t\t\t_builder = builder;\n\t\t}\n\n\t\tpublic IObservable<Optional<ProjectMarkup>> Result\n\t\t{\n\t\t\tget { return _result; }\n\t\t}\n\n\t\t/// <remarks> This function will update Result as a side-effect </remarks>\n\t\t/// <returns> (RebuildRequired | (Started (LogEvent)* [BytecodeGenerated] Ended))* </returns>\n\t\tpublic IObservable<IBinaryMessage> Reify(IObservable<GenerateBytecode> args)\n\t\t{\n\t\t\treturn _builder.Result.Switch(maybeBuild =>\n\t\t\t\tmaybeBuild.MatchWith(\n\t\t\t\t\tnone: () =>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Can't do any reifying without a build\n\t\t\t\t\t\t_result.OnNext(Optional.None());\n\t\t\t\t\t\treturn args.Select(arg =>\n\t\t\t\t\t\t\t(IBinaryMessage)new RebuildRequired());\n\t\t\t\t\t},\n\t\t\t\t\tsome: build =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar markupParser = new MarkupParser(\n\t\t\t\t\t\t\tbuild,\n\t\t\t\t\t\t\tnew UxParser(\n\t\t\t\t\t\t\t\tbuild.Project,\n\t\t\t\t\t\t\t\tnew GhostCompilerFactory(build.TypeInfo)));\n\n\t\t\t\t\t\t// Let's answer those reify calls with some proper bytecode and build events\n\t\t\t\t\t\treturn args\n\t\t\t\t\t\t\t.Select(a =>\n\t\t\t\t\t\t\t\tObservable.Create<IBinaryMessage>(observer =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tobserver.OnNext(new Started { Command = a });\n\n\t\t\t\t\t\t\t\t\tvar markup = markupParser.TryParseDocuments(a, observer, a.Id);\n\t\t\t\t\t\t\t\t\t_result.OnNext(markup);\n\n\t\t\t\t\t\t\t\t\tvar bytecode = TryCompile(markup, observer, a.Id);\n\t\t\t\t\t\t\t\t\tif (bytecode.HasValue)\n\t\t\t\t\t\t\t\t\t\tobserver.OnNext(new BytecodeGenerated(bytecode.Value));\n\n\t\t\t\t\t\t\t\t\tobserver.OnNext(new Ended { Command = a, Success = bytecode.HasValue, BuildDirectory = AbsoluteFilePath.Parse(build.Assembly).ContainingDirectory });\n\n\t\t\t\t\t\t\t\t\tobserver.OnCompleted();\n\n\t\t\t\t\t\t\t\t\treturn Disposable.Empty;\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t.Concat();\n\t\t\t\t\t}));\n\n\t\t}\n\n\t\tstatic Optional<ProjectBytecode> TryCompile(Optional<ProjectMarkup> markup, IObserver<IBinaryMessage> buildEvents, Guid buildId)\n\t\t{\n\t\t\treturn markup.SelectMany(m => TryCompile(m, buildEvents, buildId));\n\t\t}\n\n\t\tstatic Optional<ProjectBytecode> TryCompile(ProjectMarkup markup, IObserver<IBinaryMessage> buildEvents, Guid buildId)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar projectDirectory = Path.GetDirectoryName(markup.Build.Project);\n\t\t\t\tvar dependencies =\n\t\t\t\t\tImmutableList.ToImmutableList(\n\t\t\t\t\t\tmarkup.Project.RootClasses\n\t\t\t\t\t\t\t.SelectMany(node => ImportExpression.FindFiles(node, projectDirectory))\n\t\t\t\t\t\t\t.Distinct());\n\n\t\t\t\tvar ids = ProjectObjectIdentifiers.Create(markup.Project, markup.Build.TypeInfo,\n\t\t\t\t\tonError: e => ReportFactory.FallbackReport.Exception(\"Failed to create identifiers for document\", e));\n\n\t\t\t\tvar ctx = new Context(\n\t\t\t\t\tnames: new UniqueNames(),\n\t\t\t\t\ttryGetTagHash: ids.TryGetIdentifier,\n\t\t\t\t\tprojectDirectory: projectDirectory,\n\t\t\t\t\ttypesDeclaredInUx: markup.Project\n\t\t\t\t\t\t.AllNodesInProject()\n\t\t\t\t\t\t.OfType<ClassNode>()\n\t\t\t\t\t\t.Where(c => c.Simulate)\n\t\t\t\t\t\t.Select(c => c.GetTypeName())\n\t\t\t\t\t\t.ToImmutableHashSet());\n\n\t\t\t\tvar reify = markup.Project.GenerateGlobalScopeConstructor(ctx);\n\t\t\t\tvar metadata = markup.Project.GenerateMetadata(ids);\n\t\t\t\treturn new ProjectBytecode(reify, dependencies, metadata);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tbuildEvents.OnNext(new BuildIssueDetected(BuildIssueType.Error, \"\", e.Message, Optional.None(), buildId));\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/ReifyEventsDaemon.cs",
    "content": "﻿using Outracks.Fuse.Protocol;\n\nnamespace Fuse.Preview\n{\n\t[PayloadTypeName(\"Fuse.ReifyFileSuccessEvent\")]\n\tpublic class ReifyFileSuccessEvent : IEventData\n\t{\n\t\tpublic string Path;\n\t\tpublic string Message;\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Successfully reified file: \\\"\" + Path + \"\\\"\" + (string.IsNullOrEmpty(Message) ? \"\" : (\". Additional info: \" + Message));\n\t\t}\n\t}\n\n\t[PayloadTypeName(\"Fuse.ReifyFileErrorEvent\")]\n\tpublic class ReifyFileErrorEvent : IEventData\n\t{\n\t\tpublic string Path;\n\t\tpublic string Message;\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Error reifying file: \\\"\" + Path + \"\\\": \" + Message;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/ReifyerLogAdapter.cs",
    "content": "using System;\nusing System.IO;\nusing System.Reactive.Subjects;\nusing System.Text;\nusing Outracks.Fuse.Protocol;\nusing Outracks.IO;\nusing Uno;\nusing Uno.Logging;\n\nnamespace Fuse.Preview\n{\n\tclass ReifyerLogAdapter\n\t{\n\t\treadonly StringBuilderProgress _progress;\n\n\t\treadonly Log _log;\n\t\tpublic Log Log { get { return _log; } }\n\n\t\treadonly Subject<IEventData> _events = new Subject<IEventData>();\n\t\tpublic IObservable<IEventData> Events { get { return _events; } }\n\n\t\tpublic ReifyerLogAdapter()\n\t\t{\n\t\t\t_progress = new StringBuilderProgress();\n\t\t\tvar errorList = new StringProgressErrorListAdapter(_progress);\n\t\t\tvar textWriter = new StringProgressTextWriterAdapter(_progress);\n\t\t\t_log = new Log(errorList, textWriter);\n\t\t}\n\n\t\tpublic void Success(AbsoluteFilePath path)\n\t\t{\n\t\t\t_events.OnNext(new ReifyFileSuccessEvent()\n\t\t\t{\n\t\t\t\tPath = path.NativePath,\n\t\t\t\tMessage = _progress.Flush()\n\t\t\t});\n\t\t}\n\n\t\tpublic void Error(AbsoluteFilePath path)\n\t\t{\n\t\t\t_events.OnNext(new ReifyFileErrorEvent()\n\t\t\t{\n\t\t\t\tPath = path.NativePath,\n\t\t\t\tMessage = _progress.Flush()\n\t\t\t});\n\t\t}\n\t}\n\n\tclass StringBuilderProgress : IProgress<string>\n\t{\n\t\treadonly StringBuilder _sb = new StringBuilder();\n\n\t\tpublic void Report(string value)\n\t\t{\n\t\t\t_sb.Append(value);\n\t\t}\n\n\t\tpublic string Flush()\n\t\t{\n\t\t\tvar ret = _sb.ToString();\n\n\t\t\t_sb.Clear();\n\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\t// TODO: Consider not throwing away additional semantics\n\tclass StringProgressErrorListAdapter : IErrorList\n\t{\n\t\treadonly IProgress<string> _progress;\n\n\t\tpublic StringProgressErrorListAdapter(IProgress<string> progress)\n\t\t{\n\t\t\t_progress = progress;\n\t\t}\n\n\t\tpublic void AddError(Source src, string code, string msg)\n\t\t{\n\t\t\t_progress.Report(\"Error: \" + msg);\n\t\t}\n\n\t\tpublic void AddFatalError(Source src, string code, string msg)\n\t\t{\n\t\t\t_progress.Report(\"Fatal error: \" + msg);\n\t\t}\n\n\t\tpublic void AddMessage(Source src, string code, string msg)\n\t\t{\n\t\t\t_progress.Report(msg);\n\t\t}\n\n\t\tpublic void AddWarning(Source src, string code, string msg)\n\t\t{\n\t\t\t_progress.Report(\"Warning: \" + msg);\n\t\t}\n\t}\n\n\tclass StringProgressTextWriterAdapter : TextWriter\n\t{\n\t\treadonly IProgress<string> _progress;\n\n\t\tpublic StringProgressTextWriterAdapter(IProgress<string> progress)\n\t\t{\n\t\t\t_progress = progress;\n\t\t}\n\n\t\tpublic override void Write(char value)\n\t\t{\n\t\t\tWrite(new string(value, 1));\n\t\t}\n\n\t\tpublic override void WriteLine(string value)\n\t\t{\n\t\t\tWrite(value + \"\\n\");\n\t\t}\n\n\t\tpublic override void WriteLine()\n\t\t{\n\t\t\tWrite(\"\\n\");\n\t\t}\n\n\t\tpublic override void Write(string value)\n\t\t{\n\t\t\t_progress.Report(value);\n\t\t}\n\n\t\tpublic override Encoding Encoding\n\t\t{\n\t\t\tget { return Encoding.UTF8; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/RunFailed.cs",
    "content": "using System;\n\nnamespace Fuse.Preview\n{\n\tpublic class RunFailed : Exception\n\t{\n\t\tpublic RunFailed(Exception innerException)\n\t\t\t: base(innerException.Message)\n\t\t{ }\n\t}\n}"
  },
  {
    "path": "src/preview/service/SimulatorBuild.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Protocol;\nusing Uno;\nusing Uno.Build;\nusing Uno.ProjectFormat;\nusing StringSplitting = Outracks.Simulator.StringSplitting;\n\nnamespace Fuse.Preview\n{\n\tpublic class SimulatorBuilder\n\t{\n\t\treadonly IFileSystem _fileSystem;\n\t\treadonly CacheCleaner _cacheCleaner;\n\t\treadonly bool _isHost;\n\t\treadonly Action<LockFile> _registerLock;\n\t\treadonly OutputDirGenerator _outputDirGenerator;\n\n\t\tpublic SimulatorBuilder(\n\t\t\tIFileSystem fileSystem,\n\t\t\tCacheCleaner cacheCleaner,\n\t\t\tbool isHost, Action<LockFile> registerLock)\n\t\t{\n\t\t\t_fileSystem = fileSystem;\n\t\t\t_cacheCleaner = cacheCleaner;\n\t\t\t_isHost = isHost;\n\t\t\t_registerLock = registerLock;\n\t\t\t_outputDirGenerator = new OutputDirGenerator(_fileSystem);\n\t\t}\n\n\t\t/// <exception cref=\"Exception\"></exception>\n\t\t/// <exception cref=\"FailedToCreateOutputDir\"></exception>\n\t\tpublic SimulatorUnoProject CreateSimulatorProject(BuildProject args)\n\t\t{\n\t\t\treturn CreateSimulatorProject(\n\t\t\t\targs,\n\t\t\t\tPreviewTarget.DotNet,\n\t\t\t\tfalse,\n\t\t\t\tfalse);\n\t\t}\n\n\t\t/// <exception cref=\"Exception\"></exception>\n\t\t/// <exception cref=\"FailedToCreateOutputDir\"></exception>\n\t\tpublic SimulatorUnoProject CreateSimulatorProject(BuildProject args, BuildTarget target, bool directToDevice, bool quitAfterApkLaunch)\n\t\t{\n\t\t\tvar project = AbsoluteFilePath.Parse(args.ProjectPath);\n\t\t\tvar buildProject = Project.Load(project.NativePath);\n\t\t\tvar projectDir = project.ContainingDirectory;\n\n\t\t\tvar basePath = AbsoluteDirectoryPath.Parse(buildProject.GetOutputDirectory(\"Preview\", target)).ContainingDirectory;\n\n\t\t\tvar outputDir = FindOutputDir(args, basePath);\n\n\t\t\tvar preambleDir = outputDir / \"preamble\";\n\t\t\tvar cacheDir = outputDir / \"cache\";\n\n\t\t\t_cacheCleaner.CleanIfNecessary(cacheDir);\n\t\t\tSetCacheDir(buildProject, projectDir, cacheDir);\n\n\t\t\tvar applicationClassName = TypeName.Parse(\"Outracks.Simulator.GeneratedApplication\");\n\t\t\tvar applicationClass = ApplicationClassGenerator.CreateApplicationClass(args, buildProject.Name, applicationClassName);\n\t\t\tvar dependencies = ApplicationClassGenerator.Dependencies;\n\n\t\t\tAddPreamble(buildProject, preambleDir, projectDir, applicationClass, dependencies);\n\t\t\tAddIcons(buildProject, preambleDir, projectDir);\n\t\t\tChangePackageName(buildProject);\n\t\t\tChangeTitle(buildProject, oldTitle => oldTitle + \" (preview)\");\n\n\t\t\tvar buildOptions = new BuildOptions\n\t\t\t{\n\t\t\t\tOutputDirectory = outputDir.NativePath,\n\t\t\t\tConfiguration = BuildConfiguration.Preview,\n\t\t\t\tMainClass = applicationClassName.FullName,\n\t\t\t\tStrip = target.Identifier != PreviewTarget.DotNet.Identifier,\n\t\t\t};\n\n\t\t\tforeach (var define in args.Defines.UnionOne(\"Designer\"))\n\t\t\t\tbuildOptions.Defines.Add(define);\n\n\t\t\tif (target.Identifier == PreviewTarget.DotNet.Identifier)\n\t\t\t\tbuildOptions.Defines.Add(\"LIBRARY\");\n\n\t\t\tif (target.Identifier == PreviewTarget.iOS.Identifier && !directToDevice)\n\t\t\t{\n\t\t\t\t// 17.12.15 - Prevent double building when exporting to iOS. (Uno bug)\n\t\t\t\tbuildOptions.RunArguments = \"debug\";\n\t\t\t\tbuildOptions.NativeBuild = false;\n\t\t\t}\n\n\t\t\tif (quitAfterApkLaunch)\n\t\t\t\tbuildOptions.RunArguments += \" -L\";\n\n\t\t\treturn new SimulatorUnoProject(buildProject, buildOptions, \"\", args.Verbose, args.BuildLibraries);\n\t\t}\n\n\t\tAbsoluteDirectoryPath FindOutputDir(BuildProject args, AbsoluteDirectoryPath basePath)\n\t\t{\n\t\t\tif (string.IsNullOrWhiteSpace(args.OutputDir))\n\t\t\t{\n\t\t\t\tvar outputDirWithLock =\n\t\t\t\t\t_outputDirGenerator.CreateOrReuseOutputDir(_isHost ? basePath / \"previewhost\" : basePath / \"preview\");\n\t\t\t\t_registerLock(outputDirWithLock.LockFile);\n\t\t\t\treturn outputDirWithLock.OutputDir;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn AbsoluteDirectoryPath.Parse(args.OutputDir);\n\t\t\t}\n\t\t}\n\n\t\tpublic void ChangePackageName(Project buildProject)\n\t\t{\n\t\t\tvar androidPreviewPackageName = buildProject.GetString(\"Android.PreviewPackage\");\n\t\t\tif(!string.IsNullOrEmpty(androidPreviewPackageName))\n\t\t\t\tbuildProject.MutableProperties[\"Android.Package\"] = new SourceValue(buildProject.Source, androidPreviewPackageName);\n\n\t\t\tvar iosPreviewBundleIdName = buildProject.GetString(\"iOS.PreviewBundleIdentifier\");\n\t\t\tif (!string.IsNullOrEmpty(iosPreviewBundleIdName))\n\t\t\t\tbuildProject.MutableProperties[\"iOS.BundleIdentifier\"] = new SourceValue(buildProject.Source, iosPreviewBundleIdName);\n\t\t}\n\n\t\tvoid ChangeTitle(Project buildProject, Func<string,string> title)\n\t\t{\n\t\t\tbuildProject.MutableProperties[\"Title\"] = new SourceValue(buildProject.Source, title(buildProject.GetString(\"Title\")));\n\t\t}\n\n\t\tvoid SetCacheDir(Project buildProject, AbsoluteDirectoryPath projectDir, AbsoluteDirectoryPath cacheDir)\n\t\t{\n\t\t\tbuildProject.MutableProperties[\"CacheDirectory\"] = new SourceValue(buildProject.Source, cacheDir.RelativeTo(projectDir).NativeRelativePath.ToUnixPath());\n\t\t}\n\n\t\tvoid AddPreamble(Project buildProject, AbsoluteDirectoryPath preambleDir, AbsoluteDirectoryPath projectDir, string preamble, IEnumerable<string> dependencies)\n\t\t{\n\t\t\tforeach (var dependency in dependencies)\n\t\t\t\tbuildProject.MutablePackageReferences.Add(PackageReference.FromString(dependency));\n\n\t\t\tvar preambleCode = preamble;\n\t\t\tvar preambleCodeFile = preambleDir / new FileName(\"$.uno\");\n\n\t\t\t_fileSystem.Create(preambleCodeFile.ContainingDirectory);\n\t\t\t_fileSystem.ForceWriteText(preambleCodeFile, preambleCode);\n\n\t\t\tvar relativeGeneratedCodeFile = preambleCodeFile.RelativeTo(projectDir);\n\t\t\tbuildProject.MutableIncludeItems.Add(\n\t\t\t\tnew IncludeItem(\n\t\t\t\t\tbuildProject.Source,\n\t\t\t\t\tIncludeItemType.SourceFile,\n\t\t\t\t\trelativeGeneratedCodeFile.NativeRelativePath.ToUnixPath()));\n\t\t}\n\n\t\tvoid AddIcons(Project buildProject, AbsoluteDirectoryPath preambleDir, AbsoluteDirectoryPath projectDir)\n\t\t{\n\t\t\tvar iconsAsm =  typeof (SimulatorBuilder).Assembly;\n\n\t\t\tvar icons = new[]\n\t\t\t{\n\t\t\t\t\"Android_HDPI.png\",\n\t\t\t\t\"Android_LDPI.png\",\n\t\t\t\t\"Android_MDPI.png\",\n\t\t\t\t\"Android_XHDPI.png\",\n\t\t\t\t\"Android_XXHDPI.png\",\n\t\t\t\t\"Android_XXXHDPI.png\",\n\t\t\t\t\"iOS_iPad_29_1x.png\",\n\t\t\t\t\"iOS_iPad_29_2x.png\",\n\t\t\t\t\"iOS_iPad_40_2x.png\",\n\t\t\t\t\"iOS_iPad_76_1x.png\",\n\t\t\t\t\"iOS_iPad_76_2x.png\",\n\t\t\t\t\"iOS_iPhone_29_2x.png\",\n\t\t\t\t\"iOS_iPhone_29_3x.png\",\n\t\t\t\t\"iOS_iPhone_40_2x.png\",\n\t\t\t\t\"iOS_iPhone_40_3x.png\",\n\t\t\t\t\"iOS_iPhone_60_2x.png\",\n\t\t\t\t\"iOS_iPhone_60_3x.png\",\n\t\t\t};\n\n\t\t\tforeach (var icon in icons)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar fileName = new FileName(icon);\n\t\t\t\t\tvar dstPath = preambleDir / fileName;\n\t\t\t\t\tvar srcResourceName = \"Fuse.Preview.Icons.\" + icon;\n\n\t\t\t\t\tusing (_fileSystem.BackupAndDeleteFile(dstPath))\n\t\t\t\t\t{\n\t\t\t\t\t\tusing (var dst = _fileSystem.CreateNew(dstPath))\n\t\t\t\t\t\tusing (var src = iconsAsm.GetManifestResourceStream(srcResourceName))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (src == null) throw new Exception(\"Embedded resource not found: \" + srcResourceName);\n\t\t\t\t\t\t\tsrc.CopyTo(dst);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar relativeIconPath = dstPath.RelativeTo(projectDir).NativeRelativePath.ToUnixPath();\n\n\t\t\t\t\tvar platform = StringSplitting.BeforeFirst(icon, \"_\");\n\t\t\t\t\tvar name = StringSplitting.BeforeLast(StringSplitting.AfterFirst(icon, \"_\"), \".\");\n\n\t\t\t\t\tbuildProject.MutableProperties[platform + \".Icons.\" + name] = new SourceValue(buildProject.Source, relativeIconPath);\n\n\t\t\t\t}\n\t\t\t\tcatch (Exception)\n\t\t\t\t{\n\t\t\t\t\t// TODO: probably report something?\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tpublic class SimulatorUnoProject\n\t{\n\t\tpublic readonly Project Project;\n\t\tpublic readonly BuildOptions Options;\n\t\tpublic readonly string Tag;\n\t\tpublic readonly bool IsVerboseBuild;\n\t\tpublic readonly bool BuildLibraries;\n\n\t\tpublic SimulatorUnoProject(Project project, BuildOptions options, string tag, bool isVerboseBuild, bool buildLibraries)\n\t\t{\n\t\t\tProject = project;\n\t\t\tOptions = options;\n\t\t\tTag = tag;\n\t\t\tIsVerboseBuild = isVerboseBuild;\n\t\t\tBuildLibraries = buildLibraries;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/SimulatorHost.cs",
    "content": "using System;\nusing System.Reactive.Subjects;\nusing Outracks;\n\nnamespace Fuse.Preview\n{\n\tpublic class SimulatorHost\n\t{\n\t\treadonly Action<IBinaryMessage> _send;\n\n\t\tpublic IConnectableObservable<IBinaryMessage> Messages { get; private set; }\n\n\t\tpublic void Send(IBinaryMessage message)\n\t\t{\n\t\t\t_send(message);\n\t\t}\n\n\t\tpublic SimulatorHost(Action<IBinaryMessage> send, IConnectableObservable<IBinaryMessage> messages)\n\t\t{\n\t\t\t_send = send;\n\t\t\tMessages = messages;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/SocketServer.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Sockets;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing Outracks;\n\nnamespace Fuse.Preview\n{\n\tpublic interface ISocketServer : IDisposable\n\t{\n\t\tIPEndPoint LocalEndPoint { get; }\n\t}\n\n\tpublic class SocketServer : ISocketServer\n\t{\n\t\tpublic static ISocketServer Start(int port, Action<NetworkStream, EndPoint> clientRun)\n\t\t{\n\t\t\tvar server = new SocketServer(new TcpListener(IPAddress.Any, port), clientRun);\n\t\t\tserver.Run();\n\t\t\treturn server;\n\t\t}\n\n\t\treadonly TcpListener _listener;\n\t\treadonly Action<NetworkStream, EndPoint> _clientRun;\n\t\treadonly CancellationTokenSource _cancelSource = new CancellationTokenSource();\n\t\treadonly AutoResetEvent _doneCanceling = new AutoResetEvent(false);\n\n\t\tpublic IPEndPoint LocalEndPoint\n\t\t{\n\t\t\tget { return (IPEndPoint)_listener.Server.LocalEndPoint; }\n\t\t}\n\n\t\tSocketServer(TcpListener listener, Action<NetworkStream, EndPoint> clientRun)\n\t\t{\n\t\t\t_listener = listener;\n\t\t\t_clientRun = clientRun;\n\t\t}\n\n\t\tvoid Run()\n\t\t{\n\t\t\tif (Environment.OSVersion.Platform != PlatformID.Unix && Environment.OSVersion.Platform != PlatformID.MacOSX)\n\t\t\t{\n\t\t\t\t// Disable inheritance of server-socket, so child processes (like ADB) won't keep\n\t\t\t\t// a valid handle to that socket open until the child-process itself dies.\n\t\t\t\t//\n\t\t\t\t// This is needed due to the unfortunate combination of Process.Start enabling\n\t\t\t\t// handle-inheritance without providing an escape-hatch, and BCL deciding to\n\t\t\t\t// create all handles with inheritance enabled, again without any opt-out option.\n\t\t\t\t//\n\t\t\t\t// If this fails, there's little useful we can do.\n\t\t\t\tif (SocketWin32.SetHandleInformation(_listener.Server.Handle, SocketWin32.HANDLE_FLAGS.INHERIT, SocketWin32.HANDLE_FLAGS.None) == false)\n\t\t\t\t\tDebug.Write(\"Failed to disable handle-inheritance for socket!\");\n\t\t\t}\n\n\t\t\t_listener.Start();\n\n\t\t\tvar thread = new Thread(RunInternal)\n\t\t\t{\n\t\t\t\tName = \"Listen for connections on \" +_listener.LocalEndpoint,\n\t\t\t\tIsBackground = true\n\t\t\t};\n\t\t\tthread.Start(_cancelSource.Token);\n\t\t}\n\n\t\tvoid RunInternal(object cancellationToken)\n\t\t{\n\t\t\tvar cancel = (CancellationToken) cancellationToken;\n\t\t\tvar clientsConnected = new BehaviorSubject<ImmutableList<TcpClient>>(ImmutableList<TcpClient>.Empty);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (!cancel.IsCancellationRequested)\n\t\t\t\t{\n\t\t\t\t\tif (!_listener.Pending())\n\t\t\t\t\t{\n\t\t\t\t\t\tThread.Sleep(50);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar client = _listener.AcceptTcpClient();\n\n\t\t\t\t\tclientsConnected.OnNext(clientsConnected.Value.Add(client));\n\t\t\t\t\tvar stream = client.GetStream();\n\t\t\t\t\tnew Thread(() =>\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_clientRun(stream, client.Client.RemoteEndPoint);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tReportFactory.FallbackReport.Warn(\"Exception from SocketServer client thread : '\" + e.Message + \"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinally\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclient.Close();\n\t\t\t\t\t\t\tclientsConnected.OnNext(clientsConnected.Value.Remove(client));\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t{\n\t\t\t\t\t\tName = \"Socket server client thread\",\n\t\t\t\t\t\tIsBackground = true,\n\t\t\t\t\t}.Start();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tvar clients = clientsConnected.Value.ToArray();\n\t\t\t\tforeach (var client in clients)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tclient.Close();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t_doneCanceling.Set();\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_cancelSource.Cancel();\n\t\t\t_listener.Stop();\n\t\t\t_doneCanceling.WaitOne(5000);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/SourceToSourceReference.cs",
    "content": "using System;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Uno;\n\nnamespace Fuse.Preview\n{\n\tstatic class SourceToSourceReference\n\t{\n\t\tpublic static Optional<SourceReference> ToSourceReference(this Source src)\n\t\t{\n\t\t\tif (src.IsUnknown)\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar path = AbsoluteFilePath.TryParse(src.FullPath);\n\n\t\t\tif (path.HasValue)\n\t\t\t\treturn new SourceReference(path.Value.NativePath, src.ToLocation());\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tpublic static TextPosition ToLocation(this Source src)\n\t\t{\n\t\t\tvar from = new TextPosition(new LineNumber(Math.Max(src.Line, 1)), new CharacterNumber(Math.Max(src.Column + 1, 1)));\n\n\t\t\t// TODO: (needs TextRegion in uno, or maybe i can just remove this? maybe change to optional end in SourceReference\n\t\t\t//var to = new TextPosition(new LineNumber(Math.Max(src.EndLine, 1)), new CharacterNumber(Math.Max(src.EndColumn + 1, 1)));\n\t\t\t//if (to > from)\n\t\t\t//\treturn new TextRegion(from, to);\n\n\t\t\treturn from;\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/Started.cs",
    "content": "using System.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class Started : IBinaryMessage\n\t{\n\t\tpublic static string MessageType = \"Started\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic IBinaryMessage Command { get; set; }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\tCommand.WriteTo(writer);\n\t\t}\n\n\t\tpublic static Started ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new Started\n\t\t\t{\n\t\t\t\tCommand = BinaryMessage.ReadFrom(reader)\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/TextWriterAdapter.cs",
    "content": "using System;\nusing System.IO;\nusing System.Text;\nusing Outracks;\n\nnamespace Fuse.Preview\n{\n\tpublic class TextWriterAdapter : TextWriter\n\t{\n\t\treadonly Guid _buildId;\n\t\treadonly IProgress<IBinaryMessage> _dst;\n\n\t\tpublic TextWriterAdapter(Guid buildId, IProgress<IBinaryMessage> dst)\n\t\t{\n\t\t\t_buildId = buildId;\n\t\t\t_dst = dst;\n\t\t}\n\n\t\tpublic override void Write(char value)\n\t\t{\n\t\t\tWrite(new string(value, 1));\n\t\t}\n\n\t\tpublic override void WriteLine(string value)\n\t\t{\n\t\t\tWrite(value + \"\\n\");\n\t\t}\n\n\t\tpublic override void WriteLine()\n\t\t{\n\t\t\tWrite(\"\\n\");\n\t\t}\n\n\t\tpublic override void Write(string value)\n\t\t{\n\t\t\t// TODO: fix all colors\n\t\t\t_dst.Report(new BuildLogged(\n\t\t\t\tvalue,\n\t\t\t\tConsole.ForegroundColor == ConsoleColor.Red\n\t\t\t\t\t? Optional.Some(ConsoleColor.Red)\n\t\t\t\t\t: Optional.None<ConsoleColor>(),\n\t\t\t\t_buildId));\n\t\t}\n\n\t\tpublic override Encoding Encoding\n\t\t{\n\t\t\tget { return Encoding.UTF8; }\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/preview/service/UnoBuild.cs",
    "content": "using System;\nusing System.Threading;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator.Parser;\nusing Outracks.Simulator.Protocol;\nusing Uno;\nusing Uno.Build;\nusing Uno.Build.Packages;\nusing Uno.Build.Targets;\nusing Uno.IO;\nusing Uno.Logging;\nusing LogLevel = Uno.Logging.LogLevel;\n\nnamespace Fuse.Preview\n{\n\tclass UnoBuild : ISimulatorBuilder\n\t{\n\t\t#pragma warning disable 0414\n\t\tLockFile lockFile = null;\n\t\t#pragma warning restore 0414\n\t\tpublic UnoBuild(string version)\n\t\t{\n\t\t\t_fileSystem = new Shell();\n\t\t\tvar cacheCleaner = new CacheCleaner(_fileSystem, version);\n\t\t\t_simulatorBuilder = new SimulatorBuilder(_fileSystem, cacheCleaner, isHost: true, registerLock: (e) => lockFile = e);\n\t\t}\n\n\t\treadonly SimulatorBuilder _simulatorBuilder;\n\t\treadonly IFileSystem _fileSystem;\n\n\t\tpublic Optional<ProjectBuild> TryBuild(BuildProject args, Log logger)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar project = _simulatorBuilder.CreateSimulatorProject(args);\n\n\t\t\t\tvar libraryBuilder = new LibraryBuilder(logger);\n\t\t\t\tvar projectBuilder = new ProjectBuilder(logger, PreviewTarget.DotNet, project.Options);\n\n\t\t\t\tif (project.IsVerboseBuild)\n\t\t\t\t\tlogger.Level = LogLevel.Verbose;\n\n\t\t\t\tif (project.BuildLibraries)\n\t\t\t\t\tlibraryBuilder.Build();\n\n\t\t\t\tvar buildResult = projectBuilder.Build(project.Project);\n\n\t\t\t\tif (buildResult.ErrorCount != 0)\n\t\t\t\t{\n\t\t\t\t\treturn Optional.None();\n\t\t\t\t}\n\n\t\t\t\tvar b = new LocalBuild(buildResult, AbsoluteFilePath.Parse(args.ProjectPath));\n\t\t\t\treturn new ProjectBuild(b.Path.NativePath, b.SaveSimulatorMetadata(_fileSystem).NativePath, b.GetTypeInformation());\n\t\t\t}\n\t\t\tcatch (ThreadAbortException)\n\t\t\t{\n\t\t\t}\n\t\t\tcatch (SourceException e)\n\t\t\t{\n\t\t\t\tlogger.Error(e.Source, null, e.Message);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlogger.Error(e.Message);\n\t\t\t}\n\t\t\treturn Optional.None();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/UnoBuildWrapper.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.Reactive;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Outracks;\nusing Outracks.Building;\nusing Outracks.IO;\nusing Outracks.Simulator.Parser;\nusing Outracks.Simulator.Protocol;\nusing Uno.Build;\nusing Uno.Build.Packages;\nusing Uno.Build.Targets;\nusing Uno.Compiler.Backends.CIL;\nusing Uno.IO;\nusing Uno.Logging;\nusing Uno.UX.Markup.Reflection;\nusing LogLevel = Uno.Logging.LogLevel;\n\nnamespace Fuse.Preview\n{\n\tpublic class UnoBuildWrapper\n\t{\n\t\t#pragma warning disable 0414\n\t\tstatic LockFile lockFile = null;\n\t\t#pragma warning restore 0414\n\t\tpublic static UnoBuildWrapper Create(IFileSystem shell, string version, IObserver<IBinaryMessage> buildEvents, bool isHost, params IErrorHelper[] errorHelpers)\n\t\t{\n\t\t\tvar cacheCleaner = new CacheCleaner(shell, version);\n\t\t\tvar simulatorBuilder = new SimulatorBuilder(shell, cacheCleaner, isHost: isHost, registerLock: (e) => lockFile = e);\n\n\t\t\treturn new UnoBuildWrapper(\n\t\t\t\tsimulatorBuilder,\n\t\t\t\tbuildEvents,\n\t\t\t\tshell,\n\t\t\t\terrorHelpers);\n\t\t}\n\n\t\treadonly SimulatorBuilder _simulatorBuilder;\n\t\treadonly IProgress<IBinaryMessage> _buildEvents;\n\t\treadonly IErrorHelper _errorHelpers;\n\n\t\tpublic UnoBuildWrapper(SimulatorBuilder simulatorBuilder, IObserver<IBinaryMessage> buildEvents, IFileSystem fileSystem, params IErrorHelper[] errorHelpers)\n\t\t{\n\t\t\t_simulatorBuilder = simulatorBuilder;\n\t\t\t_buildEvents = buildEvents.ToProgress();\n\t\t\t_errorHelpers = new CombinedErrorHelper\n\t\t\t{\n\t\t\t\tHelpers = errorHelpers\n\t\t\t};\n\t\t}\n\n\t\t/// <exception cref=\"BuildFailed\"></exception>\n\t\t/// <exception cref=\"FailedToCreateOutputDir\"></exception>\n\t\tpublic Task<BuildResult> BuildUno(Guid id, BuildProject args, BuildTarget previewTarget, bool directToDevice, CancellationToken cancellationToken, bool quitAfterApkLaunch)\n\t\t{\n\t\t\targs.Id = id;\n\n\t\t\tvar loggedEvents = new AccumulatingProgress<IBinaryMessage>(_buildEvents);\n\t\t\tvar errorList = new ErrorListAdapter(id, loggedEvents);\n\t\t\tvar textWriter = new TextWriterAdapter(id, loggedEvents);\n\n\t\t\tvar tcs = new TaskCompletionSource<BuildResult>();\n\n\t\t\tvar project = _simulatorBuilder.CreateSimulatorProject(args, previewTarget, directToDevice, quitAfterApkLaunch);\n\n\t\t\tvar thread = new Thread(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tvar logger = new Log(errorList, textWriter);\n\t\t\t\t\tif (project.IsVerboseBuild)\n\t\t\t\t\t\tlogger.Level = LogLevel.Verbose;\n\n\t\t\t\t\tif (project.BuildLibraries)\n\t\t\t\t\t\tnew LibraryBuilder(logger).Build();\n\n\t\t\t\t\t_buildEvents.Report(\n\t\t\t\t\t\tnew Started\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCommand = args\n\t\t\t\t\t\t});\n\n\t\t\t\t\tvar faulty = false;\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar buildResult =\n\t\t\t\t\t\t\tnew ProjectBuilder(\n\t\t\t\t\t\t\t\t\tlogger,\n\t\t\t\t\t\t\t\t\tpreviewTarget,\n\t\t\t\t\t\t\t\t\tproject.Options)\n\t\t\t\t\t\t\t\t.Build(project.Project);\n\n\t\t\t\t\t\tif (buildResult.ErrorCount != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_errorHelpers.OnBuildFailed(buildResult);\n\n\t\t\t\t\t\t\ttcs.SetException(new UserCodeContainsErrors());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttcs.SetResult(buildResult);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (e is ThreadAbortException)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\ttcs.TrySetException(new InternalBuildError(e));\n\t\t\t\t\t\tfaulty = true;\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\t_buildEvents.Report(\n\t\t\t\t\t\t\tnew Ended\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tCommand = args,\n\t\t\t\t\t\t\t\tSuccess = !faulty,\n\t\t\t\t\t\t\t\tBuildDirectory = AbsoluteDirectoryPath.Parse(project.Project.OutputDirectory)\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t{\n\t\t\t\tName = \"Build \" + project.Project.Name + \" in \" + project.Options.OutputDirectory,\n\t\t\t\tPriority = ThreadPriority.Normal,\n\t\t\t\tIsBackground = true,\n\t\t\t};\n\n\t\t\tthread.Start();\n\t\t\tcancellationToken.Register(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tthread.Abort();\n\t\t\t\t\tthread.Join();\n\t\t\t\t\ttcs.TrySetException(new BuildCanceledException());\n\t\t\t\t});\n\n\t\t\treturn tcs.Task;\n\t\t}\n\t}\n\n\tclass CilBackendEarlyOut : Exception\n\t{\n\t}\n\n\tpublic class LocalBuild\n\t{\n\t\treadonly BuildResult _buildResult;\n\t\tpublic readonly AbsoluteFilePath Path;\n\n\t\tpublic LocalBuild(BuildResult buildResult, AbsoluteFilePath path)\n\t\t{\n\t\t\t_buildResult = buildResult;\n\t\t\tPath = path;\n\t\t}\n\n\t\tpublic AbsoluteFilePath SaveSimulatorMetadata(IFileSystem fileSystem)\n\t\t{\n\t\t\tvar cilBackend = (CilResult)_buildResult.BackendResult;\n\t\t\tif (cilBackend == null)\n\t\t\t\tthrow new CilBackendEarlyOut();\n\n\t\t\treturn AbsoluteFilePath.Parse(Outracks.Simulator.Client.DotNetBuild.SaveMetadata(_buildResult));\n\t\t}\n\n\t\tpublic IDataTypeProvider GetTypeInformation()\n\t\t{\n\t\t\treturn new CompilerDataTypeProvider(_buildResult.Compiler);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/UpdateAttribute.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class UpdateAttribute : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"UpdateAttribute\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic Guid Id { get; set; }\n\t\tpublic ObjectIdentifier Object { get; private set; }\n\t\tpublic string Property { get; private set; }\n\t\tpublic Optional<string> Value { get; private set; }\n\n\t\tpublic SourceReference Source { get; private set; }\n\n\t\tpublic UpdateAttribute(\n\t\t\tObjectIdentifier obj,\n\t\t\tstring property,\n\t\t\tOptional<string> value,\n\t\t\tSourceReference source)\n\t\t{\n\t\t\tObject = obj;\n\t\t\tProperty = property;\n\t\t\tValue = value;\n\t\t\tSource = source;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Set \" + Object + \".\" + Property + \" = \" + Value;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.WriteGuid(Id);\n\t\t\tObject.Write(writer);\n\t\t\twriter.Write(Property);\n\t\t\tOptional.Write(writer, Value, writer.Write);\n\t\t\tSourceReference.Write(writer, Source);\n\t\t}\n\n\t\tpublic static UpdateAttribute ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar id = reader.ReadGuid();\n\t\t\tvar obj = ObjectIdentifier.Read(reader);\n\t\t\tvar property = reader.ReadString();\n\t\t\tvar value = Optional.Read(reader, (Func<string>)reader.ReadString);\n\t\t\tvar source = SourceReference.Read(reader);\n\n\t\t\treturn new UpdateAttribute(obj, property, value, source)\n\t\t\t{\n\t\t\t\tId = id,\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/service/Updater.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.CodeGeneration;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.Runtime;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Fuse.Preview\n{\n\tpublic class Updater\n\t{\n\t\treadonly Reifier _reifier;\n\n\t\tpublic Updater(Reifier reifier)\n\t\t{\n\t\t\t_reifier = reifier;\n\t\t}\n\n\t\tpublic IObservable<IBinaryMessage> Update(IObservable<UpdateAttribute> args)\n\t\t{\n\t\t\treturn _reifier.Result.Switch(maybeBuild =>\n\t\t\t\tmaybeBuild.MatchWith(\n\t\t\t\t\tnone: () => args.Select(arg => (IBinaryMessage)new ReifyRequired()),\n\t\t\t\t\tsome: m =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar objectIdentifiers = ProjectObjectIdentifiers.Create(m.Project, m.Build.TypeInfo,\n\t\t\t\t\t\t\tonError: e => ReportFactory.FallbackReport.Exception(\"Failed to create identifiers for document\", e));\n\n\t\t\t\t\t\tvar valueParser = new ValueParser(m.Build.TypeInfo, m.Build.Project);\n\n\t\t\t\t\t\tvar context = new Context(\n\t\t\t\t\t\t\tnew UniqueNames(), null, null,\n\t\t\t\t\t\t\ttypesDeclaredInUx: m.Project\n\t\t\t\t\t\t\t\t.AllNodesInProject()\n\t\t\t\t\t\t\t\t.OfType<ClassNode>()\n\t\t\t\t\t\t\t\t.Where(c => c.Simulate)\n\t\t\t\t\t\t\t\t.Select(c => c.GetTypeName())\n\t\t\t\t\t\t\t\t.ToImmutableHashSet());\n\n\t\t\t\t\t\treturn args\n\t\t\t\t\t\t\t.SelectMany(p =>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (p.Value.HasValue && ContainsUXExpression(p.Value.Value))\n\t\t\t\t\t\t\t\t\treturn new IBinaryMessage[] { new ReifyRequired() };\n\n\t\t\t\t\t\t\t\tif (p.Property.StartsWith(\"ux:\", StringComparison.InvariantCultureIgnoreCase))\n\t\t\t\t\t\t\t\t\treturn new IBinaryMessage[] { new ReifyRequired() };\n\n\t\t\t\t\t\t\t\tif (p.Property.Contains(\".\"))\n\t\t\t\t\t\t\t\t\treturn new IBinaryMessage[] { new ReifyRequired() };\n\n\t\t\t\t\t\t\t\tif (p.Property == \"Layer\")\n\t\t\t\t\t\t\t\t\treturn new IBinaryMessage[] { new ReifyRequired() };\n\n\t\t\t\t\t\t\t\tvar node = objectIdentifiers.TryGetNode(p.Object);\n\n\t\t\t\t\t\t\t\tif (!node.HasValue)\n\t\t\t\t\t\t\t\t\treturn new IBinaryMessage[] { new ReifyRequired() };\n\n\t\t\t\t\t\t\t\t// If this attribute contained an UX expression last reify,\n\t\t\t\t\t\t\t\t// we must require reify to remove old binding objects.\n\t\t\t\t\t\t\t\tvar currentValue = node.Value.RawProperties\n\t\t\t\t\t\t\t\t\t.Where(x => x.Name == p.Property)\n\t\t\t\t\t\t\t\t\t.Select(x => x.Value)\n\t\t\t\t\t\t\t\t\t.FirstOrDefault();\n\t\t\t\t\t\t\t\tif (ContainsUXExpression(currentValue))\n\t\t\t\t\t\t\t\t\treturn new IBinaryMessage[] { new ReifyRequired() };\n\n\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar message = Execute(p.Object, instance =>\n\t\t\t\t\t\t\t\t\t\tnew SingleProperties(node.Value, context, instance)\n\t\t\t\t\t\t\t\t\t\t\t.UpdateValue(p.Property, p.Value, valueParser));\n\n\t\t\t\t\t\t\t\t\treturn new[]\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tnew Started { Command = p },\n\t\t\t\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\t\t\t\tnew Ended { Command = p, Success = true, BuildDirectory = AbsoluteFilePath.Parse(m.Build.Assembly).ContainingDirectory }\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch (Exception)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn new IBinaryMessage[] { new ReifyRequired()  };\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}));\n\t\t}\n\n\t\tpublic static IBinaryMessage ExecuteMultiple(ObjectIdentifier id, Func<Expression, Statement[]> objectTransform)\n\t\t{\n\t\t\treturn new BytecodeUpdated(\n\t\t\t\tnew Lambda(\n\t\t\t\t\tSignature.Action(),\n\t\t\t\t\tEnumerable.Empty<BindVariable>(),\n\t\t\t\t\tnew[] { ExecuteStatementMultiple(id, objectTransform) }));\n\t\t}\n\n\t\tstatic Statement ExecuteStatementMultiple(ObjectIdentifier id, Func<Expression, Statement[]> objectTransform)\n\t\t{\n\t\t\treturn new CallStaticMethod(\n\t\t\t\tTryExecuteOnObjectsWithTag,\n\t\t\t\tnew StringLiteral(id.ToString()),\n\t\t\t\tnew Lambda(\n\t\t\t\t\tSignature.Action(Variable.This),\n\t\t\t\t\tEnumerable.Empty<BindVariable>(),\n\t\t\t\t\tobjectTransform(new ReadVariable(Variable.This))));\n\t\t}\n\n\t\tpublic static IBinaryMessage Execute(ObjectIdentifier id, Func<Expression, Statement> objectTransform)\n\t\t{\n\t\t\treturn new BytecodeUpdated(\n\t\t\t\tnew Lambda(\n\t\t\t\t\tSignature.Action(),\n\t\t\t\t\tEnumerable.Empty<BindVariable>(),\n\t\t\t\t\tnew[] { ExecuteStatement(id, objectTransform) }));\n\t\t}\n\n\t\tstatic Statement ExecuteStatement(ObjectIdentifier id, Func<Expression, Statement> objectTransform)\n\t\t{\n\t\t\treturn new CallStaticMethod(\n\t\t\t\tTryExecuteOnObjectsWithTag,\n\t\t\t\tnew StringLiteral(id.ToString()),\n\t\t\t\tnew Lambda(\n\t\t\t\t\tSignature.Action(Variable.This),\n\t\t\t\t\tEnumerable.Empty<BindVariable>(),\n\t\t\t\t\tnew[]\n\t\t\t\t{\n\t\t\t\t\tobjectTransform(new ReadVariable(Variable.This))\n\t\t\t\t}));\n\t\t}\n\n\t\tstatic StaticMemberName TryExecuteOnObjectsWithTag\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new StaticMemberName(\n\t\t\t\t\tTypeName.Parse(typeof(ObjectTagRegistry).FullName),\n\t\t\t\t\tnew TypeMemberName(\"TryExecuteOnObjectsWithTag\"));\n\t\t\t}\n\t\t}\n\n\t\t// This methods checks if \"str\" contains an unescaped '{' followed by an unescaped '}'\n\t\tstatic bool ContainsUXExpression(string str)\n\t\t{\n\t\t\tif (str == null) return false;\n\n\t\t\tfor (int i = 0; i < str.Length; i++)\n\t\t\t{\n\t\t\t\tswitch (str[i])\n\t\t\t\t{\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase '{':\n\t\t\t\t\t\tfor (int j = i + 1; j < str.Length; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (str[j])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\tcase '}':\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/service/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Reactive\" publicKeyToken=\"94bc3704cddfc263\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.0.0\" newVersion=\"4.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/preview/service/fuse-preview.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{59E1073A-9B45-41F3-AB94-958A9D18FB72}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Fuse.Preview</RootNamespace>\n    <AssemblyName>fuse-preview</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"Uno.Collections\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Uno.Collections.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"Uno.Build\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Build.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Backends.CIL\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Backends.CIL.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Configuration\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Configuration.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.ProjectFormat\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.ProjectFormat.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.UX.Markup\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.UX.Markup.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AndroidPortReverser.cs\" />\n    <Compile Include=\"ApplicationClassGenerator.cs\" />\n    <Compile Include=\"AssemblyBuilt.cs\" />\n    <Compile Include=\"AssetsWatcher.cs\" />\n    <Compile Include=\"BinaryMessageStreams.cs\" />\n    <Compile Include=\"BuildCanceledException.cs\" />\n    <Compile Include=\"BuildIssueDetected.cs\" />\n    <Compile Include=\"BuildLogged.cs\" />\n    <Compile Include=\"BuildProject.cs\" />\n    <Compile Include=\"Ended.cs\" />\n    <Compile Include=\"GenerateBytecode.cs\" />\n    <Compile Include=\"InternalBuildError.cs\" />\n    <Compile Include=\"MarkupParser.cs\" />\n    <Compile Include=\"Platform\\EnsureSingleInstance.cs\" />\n    <Compile Include=\"Platform\\BinaryEncoding.cs\" />\n    <Compile Include=\"Builder.cs\" />\n    <Compile Include=\"BuildOutputDirGenerator.cs\" />\n    <Compile Include=\"CacheCleaner.cs\" />\n    <Compile Include=\"CoalesceCache.cs\" />\n    <Compile Include=\"CodeGenerator.cs\" />\n    <Compile Include=\"ErrorListAdapter.cs\" />\n    <Compile Include=\"FileDataWithMetadata.cs\" />\n    <Compile Include=\"FileSender.cs\" />\n    <Compile Include=\"IErrorHelper.cs\" />\n    <Compile Include=\"Platform\\IProcess.cs\" />\n    <Compile Include=\"Platform\\Factory.cs\" />\n    <Compile Include=\"Platform\\IPlatform.cs\" />\n    <Compile Include=\"IProjectAndServer.cs\" />\n    <Compile Include=\"LogSubject.cs\" />\n    <Compile Include=\"OutputDirGenerator.cs\" />\n    <Compile Include=\"Platform\\Mac.cs\" />\n    <Compile Include=\"Platform\\ProcessArguments.cs\" />\n    <Compile Include=\"Platform\\Windows.cs\" />\n    <Compile Include=\"PreviewService.cs\" />\n    <Compile Include=\"PreviewTarget.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"ProjectBuild.cs\" />\n    <Compile Include=\"ProjectMarkup.cs\" />\n    <Compile Include=\"ProjectProcess.cs\" />\n    <Compile Include=\"ProjectPreview.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Platform\\MethodCall.cs\" />\n    <Compile Include=\"Platform\\ProcessLog.cs\" />\n    <Compile Include=\"Proxy\\ProxyProjectEntry.cs\" />\n    <Compile Include=\"Proxy\\ProxyServer.cs\" />\n    <Compile Include=\"Proxy\\ProxyServerFailed.cs\" />\n    <Compile Include=\"RebuildRequired.cs\" />\n    <Compile Include=\"Reifier.cs\" />\n    <Compile Include=\"ReifyerLogAdapter.cs\" />\n    <Compile Include=\"ReifyEventsDaemon.cs\" />\n    <Compile Include=\"RunFailed.cs\" />\n    <Compile Include=\"SimulatorBuild.cs\" />\n    <Compile Include=\"SimulatorHost.cs\" />\n    <Compile Include=\"SocketServer.cs\" />\n    <Compile Include=\"SourceToSourceReference.cs\" />\n    <Compile Include=\"Started.cs\" />\n    <Compile Include=\"TextWriterAdapter.cs\" />\n    <Compile Include=\"MarkupErrorLog.cs\" />\n    <Compile Include=\"UnoBuild.cs\" />\n    <Compile Include=\"UnoBuildWrapper.cs\" />\n    <Compile Include=\"UpdateAttribute.cs\" />\n    <Compile Include=\"Updater.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3c1c1047-8830-498e-882a-503c0956cbe3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fuse\\Common\\Outracks.Fuse.csproj\">\n      <Project>{AA6DFB99-345F-4214-9A79-076829C0F777}</Project>\n      <Name>Outracks.Fuse</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8dfb02e0-acbf-4432-8dd9-56712e206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{E8884270-5F2C-4076-86D0-456B831BE3E5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\Android_HDPI.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\Android_LDPI.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\Android_MDPI.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\Android_XHDPI.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\Android_XXHDPI.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\Android_XXXHDPI.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPad_29_1x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPad_29_2x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPad_40_2x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPad_76_1x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPad_76_2x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPhone_29_2x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPhone_29_3x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPhone_40_2x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPhone_40_3x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPhone_60_2x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <EmbeddedResource Include=\"Icons\\iOS_iPhone_60_3x.png\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/preview/service/fuse-preview.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Platform/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/preview/service/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/preview/tests/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n    <startup> \n        <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\n    </startup>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.7.0.0\" newVersion=\"4.7.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Threading.Tasks.Extensions\" publicKeyToken=\"cc7b13ffcd2ddd51\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.2.0.1\" newVersion=\"4.2.0.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Runtime.CompilerServices.Unsafe\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.4.1\" newVersion=\"4.0.4.1\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Reactive\" publicKeyToken=\"94bc3704cddfc263\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.4.0.0\" newVersion=\"4.4.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Xml.XmlDocument\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/preview/tests/BinaryEncodingTest.cs",
    "content": "﻿using System.IO;\nusing NUnit.Framework;\n\nnamespace Fuse.Preview.Tests\n{\n\t[TestFixture]\n\tclass BinaryEncodingTest\n\t{\n\t\t[Test]\n\t\tpublic void Integers()\n\t\t{\n\t\t\tTest(1337);\n\t\t\tTest(-7);\n\t\t\tTest(0);\n\t\t\tTest(int.MaxValue);\n\t\t\tTest(int.MinValue);\n\t\t\tTest(new[] { 1, -4, 3301 });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Booleans()\n\t\t{\n\t\t\tTest(true);\n\t\t\tTest(false);\n\t\t\tTest(new[] { true, false, true, true });\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Strings()\n\t\t{\n\t\t\tTest(\"C=\");\n\t\t\tTest(\"\");\n\t\t\tTest(\"  \");\n\t\t\tTest(new[] { \"Hey this is a string..\", \"{}7}112[{[$€^£@ £12.2,,3|23425\", \" ...four\" });\n\t\t}\n\n\t\tstatic void Test(object value)\n\t\t{\n\t\t\tusing (var stream = new MemoryStream())\n\t\t\tusing (var reader = new BinaryReader(stream))\n\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t{\n\t\t\t\twriter.WriteTaggedValue(value);\n\t\t\t\tvar length = stream.Position;\n\t\t\t\tstream.Seek(0, SeekOrigin.Begin);\n\t\t\t\tAssert.That(value, Is.EqualTo(reader.ReadTaggedValue()));\n\t\t\t\tAssert.That(stream.Position, Is.EqualTo(length));\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/tests/BinaryMessageStreamsTest.cs",
    "content": "﻿using System.IO;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing NUnit.Framework;\nusing Outracks.IPC;\n\nnamespace Outracks.UnoHost.Tests\n{\n\t[TestFixture]\n\tpublic class BinaryMessageStreamsTest\n\t{\n\t\t[Test]\n\t\tpublic void DataAndTypeAreReadWriteInvariant()\n\t\t{\n\t\t\tvar pipe = PipeName.New();\n\n\t\t\tvar outbox = new []\n\t\t\t{\n\t\t\t\tBinaryMessage.Compose(\"Elm1\", writer => { }),\n\t\t\t\tBinaryMessage.Compose(\"Elm1\", writer => { }),\n\t\t\t\tBinaryMessage.Compose(\"Elm2\", writer => writer.Write(new byte[] { 13, 37 })),\n\t\t\t\tBinaryMessage.Compose(\"Elm3\", writer => writer.Write(new byte[] { 19, 11 })),\n\t\t\t\tBinaryMessage.Compose(\"Elm4\", writer => { })\n\t\t\t};\n\n\t\t\tpipe.BeginWritingMessages(\"Test\", ex => Assert.Fail(\"Write failed: \" + ex.Message), outbox.ToObservable());\n\n\t\t\tvar inbox = pipe.ReadMessages(\"test\").RefCount().ToEnumerable().Take(outbox.Length).ToArray();\n\n\t\t\tAssert.AreEqual(outbox.Length, inbox.Length);\n\n\t\t\tfor (int i = 0; i < outbox.Length; i++)\n\t\t\t{\n\t\t\t\tAssert.AreEqual(outbox[i].Type, inbox[i].Type);\n\t\t\t\tCollectionAssert.AreEqual(outbox[i].DumpBytes(), inbox[i].DumpBytes());\n\t\t\t}\n\t\t}\n\n\t}\n\n\tstatic class Helpers\n\t{\n\t\tpublic static byte[] DumpBytes(this IBinaryMessage message)\n\t\t{\n\t\t\tusing (var buffer = new MemoryStream())\n\t\t\tusing (var writer = new BinaryWriter(buffer))\n\t\t\t{\n\t\t\t\tmessage.WriteDataTo(writer);\n\t\t\t\treturn buffer.ToArray();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/tests/BinaryMessageStreamsTestsUsingPipes.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Net.Sockets;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reflection;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing Outracks.Diagnostics;\nusing Outracks.IPC;\n\nnamespace Outracks.Tests\n{\n\tpublic class BinaryMessageStreamsTestsUsingPipes\n\t{\n\t\tPipeName _pipeName;\n\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_pipeName = new PipeName(Guid.NewGuid());\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tif (!Platform.IsMac)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tFile.Delete(Path.Combine(UnixSocketStream.SocketDirectory, _pipeName.ToString()));\n\t\t}\n\n\t\t#region ReadMessags\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic async Task CanReadAMessage()\n\t\t{\n\t\t\tWriteMessagesToCurrentPipe(IntMessage.Compose(42));\n\t\t\tAssert.AreEqual(42, await _pipeName.ReadMessages(\"name\").RefCount().SelectSome(IntMessage.TryParse).FirstAsync());\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic async Task CompletesAtClosedPipe()\n\t\t{\n\t\t\tWriteMessagesToCurrentPipe(IntMessage.Compose(42));\n\t\t\tint result = -1;\n\t\t\tvar completed = new TaskCompletionSource<Exception>();\n\t\t\tusing (_pipeName.ReadMessages(\"name\").RefCount().SelectSome(IntMessage.TryParse)\n\t\t\t\t.Subscribe(\n\t\t\t\t\ti => result = i,\n\t\t\t\t\te => completed.SetResult(e),\n\t\t\t\t\t() => completed.SetResult(null)))\n\t\t\t{\n\t\t\t\tvar exception = await completed.Task;\n\t\t\t\tAssert.AreEqual(42, result);\n\t\t\t\tAssert.IsNull(exception);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t//Characterization test, not sure if this is the desired behaviour\n\t\tpublic async Task CompletesWhenClientCrashes()\n\t\t{\n\t\t\tvar messageToSend = GetMessageAsBase64ForUseInTestProcess(IntMessage.Compose(42)); //Paste this in the testprocess if the format changes\n\t\t\tvar result = new TaskCompletionSource<int>();\n\t\t\tvar completed = new TaskCompletionSource<Exception>();\n\t\t\tvar p = RunTestProcess(\"CompletesWhenClientCrashes \" + _pipeName);\n\t\t\tusing (_pipeName.ReadMessages(\"name\").RefCount().SelectSome(IntMessage.TryParse)\n\t\t\t\t.Subscribe(\n\t\t\t\t\ti => result.SetResult(i),\n\t\t\t\t\te => completed.SetResult(e),\n\t\t\t\t\t() => completed.SetResult(null)))\n\t\t\t{\n\t\t\t\tawait result.Task;\n\t\t\t\tp.Kill();\n\t\t\t\tp.WaitForExit();\n\t\t\t\tConsole.WriteLine();\n\t\t\t\tvar exception = await completed.Task;\n\t\t\t\tAssert.IsNull(exception);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t//Characterization test\n\t\tpublic async Task ErrorsWhenCannotCreateHost()\n\t\t{\n\t\t\tvar error = new TaskCompletionSource<Exception>();\n\t\t\tvar blockThePipe = Pipe.Host(_pipeName);\n\t\t\tawait Task.Run(() => Pipe.Connect(_pipeName).Result.Dispose()); //Make sure we got time to block it before continuing\n\t\t\t_pipeName.ReadMessages(\"name\").RefCount().Subscribe(\n\t\t\t\ti => { },\n\t\t\t\te => { error.SetResult(e); },\n\t\t\t\t() => { }\n\t\t\t);\n\t\t\tvar exception = await error.Task;\n\t\t\tif (Platform.IsMac)\n\t\t\t{\n                Assert.IsInstanceOf<SocketException>(exception);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n                Assert.IsInstanceOf<IOException>(exception);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region BeginWritingMessages\n\n\t\t//Happy day \"CanWriteAMessage\" is tested through CanCommunicate()\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[Ignore(\"Times out randomly on AppVeyor\")]\n\t\tpublic async Task WritingNotifiesCallbackWhenHostHasClosed()\n\t\t{\n\t\t\tvar wroteMessage = new TaskCompletionSource<Unit>();\n\t\t\tvar hostClosed = new AutoResetEvent(false);\n\t\t\tvar exception = new TaskCompletionSource<Exception>();\n\t\t\tvar disposed = false;\n\t\t\tvar hostTask = Pipe.Host(_pipeName);\n\t\t\tvar task = Task.Run(() =>\n\t\t\t{\n\t\t\t\tusing (_pipeName.BeginWritingMessages(\"name\", e => exception.SetResult(e), Observable.Create<IBinaryMessage>(obs =>\n\t\t\t\t{\n\t\t\t\t\tobs.OnNext(IntMessage.Compose(42));\n\t\t\t\t\twroteMessage.SetResult(Unit.Default);\n\t\t\t\t\thostClosed.WaitOne();\n\t\t\t\t\tobs.OnNext(IntMessage.Compose(43));\n\t\t\t\t\treturn Disposable.Create(() => disposed = true);\n\t\t\t\t}))){}\n\t\t\t});\n\t\t\tvar host = await hostTask;\n\t\t\tawait wroteMessage.Task;\n\t\t\tusing (var reader = new BinaryReader(host))\n\t\t\t{\n\t\t\t\tvar msg = IntMessage.TryParse(BinaryMessage.ReadFrom(reader));\n\t\t\t\tAssert.AreEqual(42, msg.Value);\n\t\t\t}\n\t\t\tAssert.IsFalse(exception.Task.IsCompleted);\n\t\t\thost.Close();\n\t\t\thostClosed.Set();\n\t\t\tawait task;\n\t\t\tAssert.IsNotNull(await exception.Task);\n\t\t\tAssert.IsTrue(disposed);\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[Ignore(\"Times out randomly on Travis\")]\n\t\tpublic async Task WritingNotifiesCallbackWhenHostHasCrashed()\n\t\t{\n\t\t\tvar hostCrashed = new AutoResetEvent(false);\n\t\t\tvar exception = new TaskCompletionSource<Exception>();\n\t\t\tvar disposed = false;\n\t\t\tvar p = RunTestProcess(\"NotifiesCallbackWhenHostCrashes \" + _pipeName);\n\t\t\tThread.Sleep(1000);\n\t\t\tvar task = Task.Run(() =>\n\t\t\t{\n\t\t\t\tusing(_pipeName.BeginWritingMessages(\"name\", e => exception.SetResult(e), Observable.Create<IBinaryMessage>(obs =>\n\t\t\t\t{\n\t\t\t\t\tobs.OnNext(IntMessage.Compose(42));\n\t\t\t\t\thostCrashed.WaitOne();\n\t\t\t\t\tobs.OnNext(IntMessage.Compose(43));\n\t\t\t\t\treturn Disposable.Create(() => disposed = true);\n\t\t\t\t}))){}\n\t\t\t});\n\t\t\tThread.Sleep(1000); //Give writing thread time to connect, if we kill the host too early, Connect() will block\n\t\t\tAssert.IsFalse(exception.Task.IsCompleted);\n\t\t\tp.Kill();\n\t\t\tp.WaitForExit();\n\t\t\thostCrashed.Set();\n\t\t\tawait task;\n\t\t\tAssert.IsNotNull(await exception.Task);\n\t\t\tAssert.IsTrue(disposed);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region EndToEnd\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic async Task CanCommunicate()\n\t\t{\n\t\t\tException error = null;\n\t\t\tusing (_pipeName.BeginWritingMessages(\"name\", e => { error = e; }, Observable.Return(IntMessage.Compose(42))))\n\t\t\t{\n\t\t\t\tvar msg = await _pipeName.ReadMessages(\"name\").RefCount().SelectSome(IntMessage.TryParse).FirstAsync();\n\t\t\t\tAssert.AreEqual(42, msg);\n\t\t\t\tAssert.IsNull(error);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t[Ignore(\"This is currently not the case, maybe it should be?\")] //Just wrote this as an experiment, and left it in in case we want it later\n\t\tpublic async Task ReaderCompletesWhenWriterCompletes()\n\t\t{\n\t\t\tException writeError = null;\n\t\t\tException readError = null;\n\t\t\tvar result = -1;\n\t\t\tvar completed = new TaskCompletionSource<Unit>();\n\t\t\tusing (_pipeName.BeginWritingMessages(\"name\", e => { writeError = e; }, Observable.Return(IntMessage.Compose(42))))\n\t\t\t{\n\t\t\t\tusing (_pipeName.ReadMessages(\"name\").RefCount().SelectSome(IntMessage.TryParse)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\ti => result = i,\n\t\t\t\t\t\te => readError = e,\n\t\t\t\t\t\t() => completed.SetResult(Unit.Default)))\n\t\t\t\t{\n\t\t\t\t\tawait completed.Task;\n\t\t\t\t\tAssert.AreEqual(42, result);\n\t\t\t\t\tAssert.IsNull(writeError);\n\t\t\t\t\tAssert.IsNull(readError);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\t//Characterization test, see individual comments\n\t\tpublic void WhatHappensWhenWriterErrors()\n\t\t{\n\t\t\tvar readerGotOnError = new TaskCompletionSource<Exception>();\n\t\t\tvar readerGotOnCompleted = new TaskCompletionSource<Unit>();\n\t\t\tvar writerGotErrorCallback = new TaskCompletionSource<Exception>();\n\t\t\tvar disposed = false;\n\n\t\t\tAssert.Throws<Exception>( //TODO Not sure I like this behavior\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tusing (_pipeName.BeginWritingMessages(\n\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\te => { writerGotErrorCallback.SetResult(e); },\n\t\t\t\t\t\tOneMessageThenError(42, new Exception(\"fail\"), () => disposed = true)))\n\t\t\t\t\t{\n\t\t\t\t\t\tusing (_pipeName.ReadMessages(\"name\").RefCount().SelectSome(IntMessage.TryParse)\n\t\t\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\t\t\ti => { },\n\t\t\t\t\t\t\t\te => readerGotOnError.SetResult(e),\n\t\t\t\t\t\t\t\t() => readerGotOnCompleted.SetResult(Unit.Default)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTask.WaitAny(readerGotOnError.Task, readerGotOnCompleted.Task, writerGotErrorCallback.Task);\n\t\t\t\t\t\t\t//TODO If we decide it shouldn't throw on OnError, here we can assert the desired behaviour\n\t\t\t\t\t\t\t//I'd prefer it if the reader completed at least.\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tAssert.IsFalse(disposed); //TODO I'd prefer this to be true\n\t\t}\n\t\t#endregion\n\n\t\tstatic string GetMessageAsBase64ForUseInTestProcess(IBinaryMessage msg)\n\t\t{\n\t\t\tusing (var m = new MemoryStream())\n\t\t\tusing (var w = new BinaryWriter(m))\n\t\t\t{\n\t\t\t\tmsg.WriteTo(w);\n\t\t\t\tm.Seek(0, SeekOrigin.Begin);\n\t\t\t\treturn Convert.ToBase64String(m.GetBuffer(), 0, (int)m.Length);\n\t\t\t}\n\t\t}\n\n\t\tstatic Process RunTestProcess(string argument)\n\t\t{\n\t\t\treturn Helpers.RunTestProcess(argument, Assembly.GetExecutingAssembly());\n\n\t\t}\n\n\t\tvoid WriteMessagesToCurrentPipe(params IBinaryMessage[] messages)\n\t\t{\n\t\t\tTask.Run(() =>\n\t\t\t{\n\t\t\t\tusing (var stream = Pipe.Connect(_pipeName).Result)\n\t\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t\t{\n\t\t\t\t\tforeach (var message in messages)\n\t\t\t\t\t{\n\t\t\t\t\t\tmessage.WriteTo(writer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tIObservable<IBinaryMessage> OneMessageThenError(int i, Exception error, Action dispose)\n\t\t{\n\t\t\treturn Observable.Create<IBinaryMessage>(obs =>\n\t\t\t{\n\t\t\t\tobs.OnNext(IntMessage.Compose(i));\n\t\t\t\tobs.OnError(error);\n\t\t\t\treturn dispose;\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/tests/BinaryMessageStreamsTestsUsingStreams.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\n\nnamespace Outracks.Tests\n{\n\tpublic class BinaryMessageStreamsTestsUsingStreams\n\t{\n\t\tstatic int _forciblyClosedConnection = -2146232800;\n\n\t\t#region ReadMessages\n\n\t\t[Test]\n\t\tpublic async Task CanReadAMessage()\n\t\t{\n\t\t\tusing (var inbox = StreamWithMessages(IntMessage.Compose(42)))\n\t\t\t{\n\t\t\t\tAssert.AreEqual(42, await inbox.ReadMessages(\"name\").SelectSome(IntMessage.TryParse).FirstAsync());\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CompletesAtEndOfStream()\n\t\t{\n\t\t\tusing (var inbox = StreamWithMessages(IntMessage.Compose(42)))\n\t\t\t{\n\t\t\t\tint result = -1;\n\t\t\t\tvar completed = new TaskCompletionSource<Exception>();\n\t\t\t\tusing (inbox.ReadMessages(\"name\").SelectSome(IntMessage.TryParse)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\ti => result = i,\n\t\t\t\t\t\te => completed.SetResult(e),\n\t\t\t\t\t\t() => completed.SetResult(null)))\n\t\t\t\t{\n\t\t\t\t\tvar exception = await completed.Task;\n\t\t\t\t\tAssert.AreEqual(42, result);\n\t\t\t\t\tAssert.IsNull(exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task CompletesAtClosedConnection()\n\t\t{\n\t\t\tusing (var messages = StreamWithMessages(IntMessage.Compose(42)))\n\t\t\tusing (var closingStream = new ReadThenThrowStream(messages, new IOException(\"\", _forciblyClosedConnection)))\n\t\t\t{\n\t\t\t\tint result = -1;\n\t\t\t\tvar completed = new TaskCompletionSource<Exception>();\n\t\t\t\tusing (closingStream.ReadMessages(\"name\").SelectSome(IntMessage.TryParse)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\ti => result = i,\n\t\t\t\t\t\te => completed.SetResult(e),\n\t\t\t\t\t\t() => completed.SetResult(null)))\n\t\t\t\t{\n\t\t\t\t\tvar exception = await completed.Task;\n\t\t\t\t\tAssert.AreEqual(42, result);\n\t\t\t\t\tAssert.IsNull(exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic async Task ErrorsAtOtherExceptions()\n\t\t{\n\t\t\tusing (var messages = StreamWithMessages(IntMessage.Compose(42)))\n\t\t\tusing (var closingStream = new ReadThenThrowStream(messages, new Exception(\"Alderaan destroyed\")))\n\t\t\t{\n\t\t\t\tint result = -1;\n\t\t\t\tvar completed = new TaskCompletionSource<Exception>();\n\t\t\t\tusing (closingStream.ReadMessages(\"name\").SelectSome(IntMessage.TryParse)\n\t\t\t\t\t.Subscribe(\n\t\t\t\t\t\ti => result = i,\n\t\t\t\t\t\te => completed.SetResult(e),\n\t\t\t\t\t\t() => completed.SetResult(null)))\n\t\t\t\t{\n\t\t\t\t\tvar exception = await completed.Task;\n\t\t\t\t\tAssert.AreEqual(42, result);\n\t\t\t\t\tAssert.AreEqual(\"Alderaan destroyed\", exception.Message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region BeginWritingMessages\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic async Task CanWriteAMessage()\n\t\t{\n\t\t\tusing (var stream = new MemoryStream())\n\t\t\t{\n\t\t\t\tException exception = null;\n\t\t\t\tvar message = IntMessage.Compose(42);\n\t\t\t\tvar notifyingStream = new NotifyingStream(stream, (int)LengthOf(message));\n\t\t\t\tusing (notifyingStream.BeginWritingMessages(\"name\", e => exception = e, Observable.Return(message)))\n\t\t\t\t{\n\t\t\t\t\tawait notifyingStream.Task;\n\t\t\t\t\tvar msg = IntMessage.TryParse(MessageFromStream(stream));\n\t\t\t\t\tAssert.AreEqual(42, msg.Value);\n\t\t\t\t\tAssert.IsNull(exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic async Task NotifiesOnWriteError()\n\t\t{\n\t\t\tvar stream = new CantDoAnythingStream();\n\t\t\tvar source = new TaskCompletionSource<Unit>();\n\t\t\tusing (stream.BeginWritingMessages(\"name\",\n\t\t\t\te =>\n\t\t\t\t{\n\t\t\t\t\tsource.SetResult(Unit.Default);\n\t\t\t\t},\n\t\t\t\tObservable.Return(IntMessage.Compose(42))))\n\t\t\t{\n\t\t\t\tawait source.Task;\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnsubscribesToMessagesWhenDisposed()\n\t\t{\n\t\t\tvar disposed = false;\n\t\t\tvar messages = Observable.Create<IBinaryMessage>(obs =>\n\t\t\t{\n\t\t\t\treturn Disposable.Create(() => { disposed = true; });\n\t\t\t});\n\t\t\tvar write = new MemoryStream().BeginWritingMessages(\"name\", _ => { }, messages);\n\t\t\twrite.Dispose();\n\t\t\tAssert.IsTrue(disposed);\n\t\t}\n\n\t\t#endregion\n\n\t\tlong LengthOf(IBinaryMessage message)\n\t\t{\n\t\t\tusing (var stream = new MemoryStream())\n\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t{\n\t\t\t\tmessage.WriteTo(writer);\n\t\t\t\treturn stream.Length;\n\t\t\t}\n\t\t}\n\n\t\tIBinaryMessage MessageFromStream(MemoryStream stream)\n\t\t{\n\t\t\tstream.Seek(0, SeekOrigin.Begin);\n\t\t\tusing (var reader = new BinaryReader(stream))\n\t\t\t{\n\t\t\t\treturn BinaryMessage.ReadFrom(reader);\n\t\t\t}\n\t\t}\n\n\t\tMemoryStream StreamWithMessages(params IBinaryMessage[] messages)\n\t\t{\n\t\t\tvar memoryStream = new MemoryStream();\n\t\t\tvar writer = new BinaryWriter(memoryStream);\n\t\t\tforeach (var message in messages)\n\t\t\t{\n\t\t\t\tmessage.WriteTo(writer);\n\t\t\t}\n\t\t\tmemoryStream.Seek(0, SeekOrigin.Begin);\n\t\t\treturn memoryStream;\n\t\t}\n\t}\n\n\tstatic class IntMessage\n\t{\n\t\tprivate const string Name = \"Int\";\n\n\t\tpublic static IBinaryMessage Compose(int i)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Name, writer => { writer.Write(i); });\n\t\t}\n\n\t\tpublic static Optional<int> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Name, reader =>\n\t\t\t\treader.ReadInt32());\n\t\t}\n\t}\n\n\tpublic class CantDoAnythingStream : Stream\n\t{\n\t\tpublic override int Read(byte[] buffer, int offset, int count) { throw new NotImplementedException(); }\n\t\tpublic override void Write(byte[] buffer, int offset, int count) { throw new NotImplementedException(); }\n\t\tpublic override void Flush() { throw new NotImplementedException(); }\n\t\tpublic override long Seek(long offset, SeekOrigin origin) { throw new NotImplementedException(); }\n\t\tpublic override void SetLength(long value) { throw new NotImplementedException(); }\n\t\tpublic override bool CanRead { get { return false; } }\n\t\tpublic override bool CanSeek { get { return false; } }\n\t\tpublic override bool CanWrite { get { return false; } }\n\t\tpublic override long Length { get { throw new NotImplementedException(); } }\n\t\tpublic override long Position { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } }\n\t}\n\n\tpublic class NotifyingStream : CantDoAnythingStream\n\t{\n\t\tprivate readonly int _notifyWhenBytesWritten;\n\t\tprivate readonly TaskCompletionSource<Unit> _completed = new TaskCompletionSource<Unit>();\n\t\tprivate readonly MemoryStream _stream;\n\n\t\tpublic Task Task { get { return _completed.Task; }}\n\n\t\tpublic NotifyingStream(MemoryStream stream, int notifyWhenBytesWritten)\n\t\t{\n\t\t\t_stream = stream;\n\t\t\t_notifyWhenBytesWritten = notifyWhenBytesWritten;\n\t\t}\n\n\t\tpublic override void Write(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\t_stream.Write(buffer, offset, count);\n\t\t\tif (_stream.Length == _notifyWhenBytesWritten)\n\t\t\t{\n\t\t\t\t_completed.SetResult(Unit.Default);\n\t\t\t}\n\t\t\telse if (_stream.Length > _notifyWhenBytesWritten)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"More bytes than \" + _notifyWhenBytesWritten + \" were written, something is weird in your test.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool CanWrite { get { return true; } }\n\t}\n\n\tpublic class ReadThenThrowStream : CantDoAnythingStream\n\t{\n\t\tprivate readonly MemoryStream _firstReturnThis;\n\t\tprivate readonly Exception _thenThrowThis;\n\n\t\tpublic ReadThenThrowStream(MemoryStream firstReturnThis, Exception thenThrowThis)\n\t\t{\n\t\t\t_firstReturnThis = firstReturnThis;\n\t\t\t_thenThrowThis = thenThrowThis;\n\t\t}\n\n\t\tpublic override int Read(byte[] buffer, int offset, int count)\n\t\t{\n\t\t\tif (count > _firstReturnThis.Length - _firstReturnThis.Position)\n\t\t\t{\n\t\t\t\tthrow _thenThrowThis;\n\t\t\t}\n\t\t\treturn _firstReturnThis.Read(buffer, offset, count);\n\t\t}\n\t\tpublic override bool CanRead { get { return true; } }\n\t}\n}"
  },
  {
    "path": "src/preview/tests/CreateOrReuseOutputDir.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing Outracks.IO;\n\nnamespace Fuse.Preview.Tests\n{\n\tpublic class CreateOrReuseOutputDir\n\t{\n\t\tstatic OutputDirWithLock TestOutputDirGen(RelativeDirectoryPath basePath)\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar generator = new OutputDirGenerator(shell);\n\t\t\tvar baseP = Assembly.GetExecutingAssembly().GetCodeBaseFilePath().ContainingDirectory / basePath;\n\t\t\treturn generator.CreateOrReuseOutputDir(baseP);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDirInUse()\n\t\t{\n\t\t\tvar name0 = \"TestDirInUse\";\n\t\t\tvar name1 = \"TestDirInUse1\";\n\n\t\t\tvar result0 = TestOutputDirGen(RelativeDirectoryPath.Parse(name0));\n\t\t\tvar result1 = TestOutputDirGen(RelativeDirectoryPath.Parse(name0));\n\n\t\t\t// Expects the base path to\n\t\t\tAssert.True(result0.OutputDir.Name == new DirectoryName(name0));\n\t\t\tAssert.True(result1.OutputDir.Name == new DirectoryName(name1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDirInUseSimultaneously()\n\t\t{\n\t\t\tvar name = \"TestDirInUseSim\";\n\n\t\t\tvar listOfPossibilities = new List<DirectoryName>\n\t\t\t{\n\t\t\t\tnew DirectoryName(\"TestDirInUseSim\"),\n\t\t\t\tnew DirectoryName(\"TestDirInUseSim1\"),\n\t\t\t\tnew DirectoryName(\"TestDirInUseSim2\"),\n\t\t\t\tnew DirectoryName(\"TestDirInUseSim3\"),\n\t\t\t\tnew DirectoryName(\"TestDirInUseSim4\")\n\t\t\t};\n\n\t\t\tvar result0 = Task.Run(() => TestOutputDirGen(RelativeDirectoryPath.Parse(name)));\n\t\t\tvar result1 = Task.Run(() => TestOutputDirGen(RelativeDirectoryPath.Parse(name)));\n\t\t\tvar result2 = Task.Run(() => TestOutputDirGen(RelativeDirectoryPath.Parse(name)));\n\t\t\tvar result3 = Task.Run(() => TestOutputDirGen(RelativeDirectoryPath.Parse(name)));\n\t\t\tvar result4 = Task.Run(() => TestOutputDirGen(RelativeDirectoryPath.Parse(name)));\n\n\t\t\t// Expects the base path to\n\t\t\tAssert.True(listOfPossibilities.Remove(result0.Result.OutputDir.Name));\n\t\t\tAssert.True(listOfPossibilities.Remove(result1.Result.OutputDir.Name));\n\t\t\tAssert.True(listOfPossibilities.Remove(result2.Result.OutputDir.Name));\n\t\t\tAssert.True(listOfPossibilities.Remove(result3.Result.OutputDir.Name));\n\t\t\tAssert.True(listOfPossibilities.Remove(result4.Result.OutputDir.Name));\n\n\t\t\tforeach (var r in new[] { result0, result1, result2, result3, result4 })\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tr.Result.LockFile.Dispose();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(\"Got error while trying to dispose lock in {0}: {1}\", r.Result.OutputDir, e);\n\t\t\t\t\tthrow;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDirReuse()\n\t\t{\n\t\t\tvar name0 = \"TestDirReuse\";\n\n\t\t\tvar result0 = TestOutputDirGen(RelativeDirectoryPath.Parse(name0));\n\t\t\tresult0.LockFile.Dispose();\n\t\t\tvar result1 = TestOutputDirGen(RelativeDirectoryPath.Parse(name0));\n\n\t\t\t// Expects the base path to\n\t\t\tAssert.True(result0.OutputDir.Name == new DirectoryName(name0));\n\t\t\tAssert.True(result1.OutputDir.Name == new DirectoryName(name0));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/tests/Fuse.Preview.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{03CC1EEC-6596-40D6-B219-00168563ADD5}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Fuse.Preview.Tests</RootNamespace>\n    <AssemblyName>Fuse.Preview.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <None Include=\"App.config\" />\n    <None Include=\"packages.config\">\n      <SubType>Designer</SubType>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"BinaryEncodingTest.cs\" />\n    <Compile Include=\"BinaryMessageStreamsTest.cs\" />\n    <Compile Include=\"BinaryMessageStreamsTestsUsingPipes.cs\" />\n    <Compile Include=\"BinaryMessageStreamsTestsUsingStreams.cs\" />\n    <Compile Include=\"CreateOrReuseOutputDir.cs\" />\n    <Compile Include=\"ReifyProcessTests.cs\" />\n    <Compile Include=\"MethodCallTest.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\testproc\\Outracks.TestProcess.csproj\">\n      <Project>{83411ce7-b65f-4eee-9e9c-0a94a5007fc8}</Project>\n      <Name>Outracks.TestProcess</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\Tests\\Outracks.Tests.csproj\">\n      <Project>{1a7cf40d-c7a7-4c85-a092-73142bb90b93}</Project>\n      <Name>Outracks.Tests</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fuse\\Tests\\Outracks.Fuse.Tests.csproj\">\n      <Project>{3921C434-B199-4A60-ADD2-192EB2AC4D76}</Project>\n      <Name>Outracks.Fuse.Tests</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\win\\Outracks.Fusion.Windows.csproj\" Condition=\" '$(OS)' == 'Windows_NT'\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\Service\\fuse-preview.csproj\">\n      <Project>{59E1073A-9B45-41F3-AB94-958A9D18FB72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Reference Include=\"Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Castle.Core.4.4.0\\lib\\net45\\Castle.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"Microsoft.Reactive.Testing, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Reactive.Testing.4.4.1\\lib\\net46\\Microsoft.Reactive.Testing.dll</HintPath>\n    </Reference>\n    <Reference Include=\"NSubstitute, Version=4.2.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NSubstitute.4.2.2\\lib\\net46\\NSubstitute.dll</HintPath>\n    </Reference>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <SpecificVersion>False</SpecificVersion>\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/preview/tests/MethodCallTest.cs",
    "content": "﻿using System.IO;\nusing NUnit.Framework;\n\nnamespace Fuse.Preview.Tests\n{\n\t[TestFixture]\n\tclass MethodCallTest\n\t{\n\t\tconst string Arg1 = \"one\";\n\t\tconst int Arg2 = 7;\n\t\tconst bool Arg3 = true;\n\t\tstatic readonly string[] Arg4 = { \".is\", \"91=\", \"1\" };\n\n\t\t[Test]\n\t\tpublic void Parsing()\n\t\t{\n\t\t\tvar firstCall = MethodCall.FromExpression((TestClass test) => test.FirstMethod(Arg1, Arg2, Arg3, Arg4));\n\t\t\tAssert.That(firstCall.Method, Is.EqualTo(\"FirstMethod\"));\n\t\t\tAssert.That(firstCall.Arguments, Is.EquivalentTo(new object[] { Arg1, Arg2, Arg3, Arg4 }));\n\n\t\t\tvar secondCall = MethodCall.FromExpression((TestClass test) => test.SecondMethod(Arg1, Arg2, Arg3, Arg4));\n\t\t\tAssert.That(secondCall.Method, Is.EqualTo(\"SecondMethod\"));\n\t\t\tAssert.That(secondCall.Arguments, Is.EquivalentTo(new object[] { Arg1, Arg2, Arg3, Arg4 }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Encoding()\n\t\t{\n\t\t\tvar call = MethodCall.FromExpression((TestClass test) => test.FirstMethod(Arg1, Arg2, Arg3, Arg4));\n\n\t\t\tusing (var stream = new MemoryStream())\n\t\t\tusing (var reader = new BinaryReader(stream))\n\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t{\n\t\t\t\tcall.WriteTo(writer);\n\t\t\t\tvar length = stream.Position;\n\t\t\t\tstream.Seek(0, SeekOrigin.Begin);\n\t\t\t\tvar readCall = MethodCall.ReadFrom(reader);\n\t\t\t\tAssert.That(readCall.Method, Is.EqualTo(call.Method));\n\t\t\t\tAssert.That(readCall.Arguments, Is.EquivalentTo(call.Arguments));\n\t\t\t\tAssert.That(stream.Position, Is.EqualTo(length));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Invoking()\n\t\t{\n\t\t\tvar firstCall = MethodCall.FromExpression((TestClass test) => test.FirstMethod(Arg1, Arg2, Arg3, Arg4));\n\t\t\tvar firstTest = new TestClass();\n\t\t\tfirstCall.InvokeOn(firstTest);\n\t\t\tAssert.That(firstTest.Called, Is.EqualTo(\"FirstMethod\"));\n\t\t\tAssert.That(firstTest.Arg1, Is.EqualTo(Arg1));\n\t\t\tAssert.That(firstTest.Arg2, Is.EqualTo(Arg2));\n\t\t\tAssert.That(firstTest.Arg3, Is.EqualTo(Arg3));\n\t\t\tAssert.That(firstTest.Arg4, Is.EqualTo(Arg4));\n\n\t\t\tvar secondCall = MethodCall.FromExpression((TestClass test) => test.SecondMethod(Arg1, Arg2, Arg3, Arg4));\n\t\t\tvar secondTest = new TestClass();\n\t\t\tsecondCall.InvokeOn(secondTest);\n\t\t\tAssert.That(secondTest.Called, Is.EqualTo(\"SecondMethod\"));\n\t\t\tAssert.That(secondTest.Arg1, Is.EqualTo(Arg1));\n\t\t\tAssert.That(secondTest.Arg2, Is.EqualTo(Arg2));\n\t\t\tAssert.That(secondTest.Arg3, Is.EqualTo(Arg3));\n\t\t\tAssert.That(secondTest.Arg4, Is.EqualTo(Arg4));\n\t\t}\n\t}\n\n\tclass TestClass\n\t{\n\t\tpublic string Called = \"\";\n\t\tpublic string Arg1 = null;\n\t\tpublic int Arg2 = -1;\n\t\tpublic bool Arg3 = false;\n\t\tpublic string[] Arg4 = null;\n\n\t\tpublic void FirstMethod(string arg1, int arg2, bool arg3, string[] arg4)\n\t\t{\n\t\t\tCalled = \"FirstMethod\";\n\t\t\tArg1 = arg1;\n\t\t\tArg2 = arg2;\n\t\t\tArg3 = arg3;\n\t\t\tArg4 = arg4;\n\t\t}\n\n\t\tpublic void SecondMethod(string arg1, int arg2, bool arg3, string[] arg4)\n\t\t{\n\t\t\tCalled = \"SecondMethod\";\n\t\t\tArg1 = arg1;\n\t\t\tArg2 = arg2;\n\t\t\tArg3 = arg3;\n\t\t\tArg4 = arg4;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/preview/tests/ReifyProcessTests.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Text;\nusing Microsoft.Reactive.Testing;\nusing NSubstitute;\nusing NUnit.Framework;\nusing Outracks;\nusing Outracks.IO;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Fuse.Preview.Tests\n{\n\t[TestFixture]\n\tclass ReifyProcessTests : ReactiveTest\n\t{\n\t\tAssetsWatcher CreateAssetsWatcher(TestScheduler scheduler, Recorded<Notification<byte[]>> []fileChanges)\n\t\t{\n\t\t\tvar fileSystem = Substitute.For<IFileSystem>();\n\t\t\tSetFilesChanges(fileSystem, Optional.None(), fileChanges, scheduler);\n\t\t\treturn new AssetsWatcher(fileSystem, Observable.Return(DirectoryPath.GetTempPath()), scheduler);\n\t\t}\n\n\t\tstatic Recorded<Notification<byte[]>>[] CreateFileChangesForDiff()\n\t\t{\n\t\t\treturn new[]\n\t\t\t{\n\t\t\t\tOnNext(0, new byte[]{ }),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(1).Ticks, Encoding.UTF8.GetBytes(\"let foo = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(2).Ticks, Encoding.UTF8.GetBytes(\"let foo = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(3).Ticks, Encoding.UTF8.GetBytes(\"\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(4).Ticks, Encoding.UTF8.GetBytes(\"let foo = 0;\"))\n\t\t\t};\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestBundleFileDiffing()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\t\t\tvar assetsWatcher = CreateAssetsWatcher(scheduler, CreateFileChangesForDiff());\n\n\t\t\tvar path = AbsoluteFilePath.Parse(\"/c/Foo.png\");\n\n\t\t\tvar whatHappened = assetsWatcher.UpdateChangedBundleFiles(Observable.Return(ImmutableHashSet.Create(path))).Check();\n\t\t\tscheduler.Start();\n\n\t\t\tAssert.AreEqual(4, whatHappened.Results.Count, \"Seems like our file diffing routine is broken, got incorrect number of file changed events.\");\n\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestDependencyDiffing()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\t\t\tvar assetsWatcher = CreateAssetsWatcher(scheduler, CreateFileChangesForDiff());\n\n\t\t\tvar path = AbsoluteFilePath.Parse(\"/c/Foo.png\");\n\n\t\t\tvar whatHappened = assetsWatcher.UpdateChangedDependencies(\n\t\t\t\tObservable.Return(ImmutableHashSet.Create(new ProjectDependency(path.NativePath, \"Foo\")))).Check();\n\n\t\t\tscheduler.Start();\n\n\t\t\tAssert.AreEqual(4, whatHappened.Results.Count, \"Seems like our file diffing routine is broken, got incorrect number of file changed events.\");\n\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestJsFileDiffing()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\t\t\tusing(var assetsWatcher = CreateAssetsWatcher(scheduler, CreateFileChangesForDiff()))\n\t\t\t{\n\t\t\t\tvar path = AbsoluteFilePath.Parse(\"/c/Foo.js\");\n\n\t\t\t\tvar whatHappened = assetsWatcher.UpdateChangedFuseJsFiles(\n\t\t\t\t\tObservable.Return(ImmutableHashSet.Create(path))).Check();\n\n\t\t\t\tscheduler.Start();\n\n\t\t\t\tAssert.AreEqual(4, whatHappened.Results.Count, \"Seems like our file diffing routine is broken, got incorrect number of file changed events.\");\n\t\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestThrottle()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\t\t\tvar assetsWatcher = CreateAssetsWatcher(scheduler, new[]\n\t\t\t{\n\t\t\t\tOnNext(TimeSpan.FromMilliseconds(0).Ticks, Encoding.UTF8.GetBytes(\"a\")),\n\t\t\t\tOnNext(TimeSpan.FromMilliseconds(1).Ticks, Encoding.UTF8.GetBytes(\"bb\")),\n\t\t\t\tOnNext(TimeSpan.FromMilliseconds(2).Ticks, Encoding.UTF8.GetBytes(\"ccc\")),\n\t\t\t\tOnNext(TimeSpan.FromMilliseconds(2000).Ticks, Encoding.UTF8.GetBytes(\"ccc\")),\n\t\t\t});\n\n\t\t\tvar path = AbsoluteFilePath.Parse(\"/c/Foo.js\");\n\n\t\t\tvar whatHappened = assetsWatcher.UpdateChangedBundleFiles(Observable.Return(ImmutableHashSet.Create(path))).Check();\n\n\t\t\tscheduler.Start();\n\n\t\t\tAssert.AreEqual(2, whatHappened.Results.Count, \"Seems like our throttle is broken, got incorrect number of file changed events.\\n{0}\", string.Join(\"\\n\", whatHappened.Results.Select(e => e.CoalesceKey + \": \" + e.BlobData.ToString())));\n\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddingMoreFiles()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\n\t\t\tvar foo = AbsoluteFilePath.Parse(\"/c/Foo.js\");\n\t\t\tvar bar = AbsoluteFilePath.Parse(\"/c/Bar.js\");\n\t\t\tvar lol = AbsoluteFilePath.Parse(\"/c/lol.js\");\n\n\t\t\tvar fileSystem = Substitute.For<IFileSystem>();\n\t\t\tSetFilesChanges(fileSystem, foo, new []\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let foo = 0;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, bar, new []\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let bar = 0;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, lol, new []\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let lol = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(1).Ticks, Encoding.UTF8.GetBytes(\"let lol = 1;\"))\n\t\t\t}, scheduler);\n\n\t\t\tvar assetsWatcher = new AssetsWatcher(fileSystem, Observable.Return(DirectoryPath.GetTempPath()), scheduler);\n\n\t\t\tvar whatHappened = assetsWatcher.UpdateChangedBundleFiles(\n\t\t\t\tscheduler.CreateColdObservable(\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(0).Ticks, ImmutableHashSet.Create(foo)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(1).Ticks, ImmutableHashSet.Create(foo, bar)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(2).Ticks, ImmutableHashSet.Create(foo, bar, lol))\n\t\t\t\t)).Check();\n\n\t\t\tscheduler.Start();\n\n\t\t\tAssert.AreEqual(3, whatHappened.Results.Count, \"Seems like adding more files doesn't work, got incorrect number of file changed events.\\n{0}\", string.Join(\"\\n\", whatHappened.Results.Select(e => e.CoalesceKey + \": \" + e.BlobData.ToString())));\n\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddingMoreFiles1()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\n\t\t\tvar foo = AbsoluteFilePath.Parse(\"/c/Foo.js\");\n\t\t\tvar bar = AbsoluteFilePath.Parse(\"/c/Bar.js\");\n\t\t\tvar lol = AbsoluteFilePath.Parse(\"/c/lol.js\");\n\n\t\t\tvar fileSystem = Substitute.For<IFileSystem>();\n\t\t\tSetFilesChanges(fileSystem, foo, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let foo = 0;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, bar, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let bar = 0;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, lol, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let lol = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(3).Ticks, Encoding.UTF8.GetBytes(\"let lol = 1;\"))\n\t\t\t}, scheduler);\n\n\t\t\tvar assetsWatcher = new AssetsWatcher(fileSystem, Observable.Return(DirectoryPath.GetTempPath()), scheduler);\n\n\t\t\tvar whatHappened = assetsWatcher.UpdateChangedBundleFiles(\n\t\t\t\tscheduler.CreateColdObservable(\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(0).Ticks, ImmutableHashSet.Create(foo)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(1).Ticks, ImmutableHashSet.Create(foo, bar)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(2).Ticks, ImmutableHashSet.Create(foo, bar, lol))\n\t\t\t\t)).Check();\n\n\t\t\tscheduler.Start();\n\n\t\t\tAssert.AreEqual(4, whatHappened.Results.Count, \"Seems like adding more files doesn't work, got incorrect number of file changed events.\\n{0}\", string.Join(\"\\n\", whatHappened.Results.Select(e => e.CoalesceKey + \": \" + e.BlobData.ToString())));\n\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddingMoreAndRemovingFiles()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\n\t\t\tvar foo = AbsoluteFilePath.Parse(\"/c/Foo.js\");\n\t\t\tvar bar = AbsoluteFilePath.Parse(\"/c/Bar.js\");\n\t\t\tvar lol = AbsoluteFilePath.Parse(\"/c/lol.js\");\n\n\t\t\tvar fileSystem = Substitute.For<IFileSystem>();\n\t\t\tSetFilesChanges(fileSystem, foo, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let foo = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(4).Ticks, Encoding.UTF8.GetBytes(\"let foo = 40;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, bar, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let bar = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(5).Ticks, Encoding.UTF8.GetBytes(\"let bar = 50;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, lol, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let lol = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(3).Ticks, Encoding.UTF8.GetBytes(\"let lol = 10;\"))\n\t\t\t}, scheduler);\n\n\t\t\tvar assetsWatcher = new AssetsWatcher(fileSystem, Observable.Return(DirectoryPath.GetTempPath()), scheduler);\n\n\t\t\tvar whatHappened = assetsWatcher.UpdateChangedBundleFiles(\n\t\t\t\tscheduler.CreateColdObservable(\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(0).Ticks, ImmutableHashSet.Create(foo)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(1).Ticks, ImmutableHashSet.Create(foo, bar)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(2).Ticks, ImmutableHashSet.Create(foo, bar, lol)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(2.5).Ticks, ImmutableHashSet.Create(foo, bar)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(3).Ticks, ImmutableHashSet.Create(foo))\n\t\t\t\t)).Check();\n\n\t\t\tscheduler.Start();\n\n\t\t\tAssert.AreEqual(4, whatHappened.Results.Count, \"Seems like adding and removing files doesn't work, got incorrect number of file changed events.\\n{0}\", string.Join(\"\\n\", whatHappened.Results.Select(e => e.CoalesceKey + \": \" + e.BlobData.ToString())));\n\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestAddingMoreAndRemovingFiles1()\n\t\t{\n\t\t\tvar scheduler = new TestScheduler();\n\n\t\t\tvar foo = AbsoluteFilePath.Parse(\"/c/Foo.js\");\n\t\t\tvar bar = AbsoluteFilePath.Parse(\"/c/Bar.js\");\n\t\t\tvar lol = AbsoluteFilePath.Parse(\"/c/lol.js\");\n\n\t\t\tvar fileSystem = Substitute.For<IFileSystem>();\n\t\t\tSetFilesChanges(fileSystem, foo, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let foo = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(4).Ticks, Encoding.UTF8.GetBytes(\"let foo = 40;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(7.1).Ticks, Encoding.UTF8.GetBytes(\"let foo = 700;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, bar, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let bar = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(5).Ticks, Encoding.UTF8.GetBytes(\"let bar = 50;\"))\n\t\t\t}, scheduler);\n\t\t\tSetFilesChanges(fileSystem, lol, new[]\n\t\t\t{\n\t\t\t\tOnNext(0, Encoding.UTF8.GetBytes(\"let lol = 0;\")),\n\t\t\t\tOnNext(TimeSpan.FromSeconds(6).Ticks, Encoding.UTF8.GetBytes(\"let lol = 10;\"))\n\t\t\t}, scheduler);\n\n\t\t\tvar assetsWatcher = new AssetsWatcher(fileSystem, Observable.Return(DirectoryPath.GetTempPath()), scheduler);\n\n\t\t\tvar whatHappened = assetsWatcher.UpdateChangedBundleFiles(\n\t\t\t\tscheduler.CreateColdObservable(\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(0).Ticks, ImmutableHashSet.Create(foo)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(1).Ticks, ImmutableHashSet.Create(foo, bar)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(2).Ticks, ImmutableHashSet.Create(foo, bar, lol)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(6).Ticks, ImmutableHashSet.Create(foo, bar)),\n\t\t\t\t\tOnNext(TimeSpan.FromSeconds(7).Ticks, ImmutableHashSet.Create(foo))\n\t\t\t\t)).Check();\n\n\t\t\tscheduler.Start();\n\n\t\t\tAssert.AreEqual(6, whatHappened.Results.Count, \"Seems like adding and removing files doesn't work, got incorrect number of file changed events.\\n{0}\", string.Join(\"\\n\", whatHappened.Results.Select(e => e.CoalesceKey + \": \" + e.BlobData.ToString())));\n\t\t\tAssert.IsNull(whatHappened.Error, \"Did not expect any errors in the observable stream.\");\n\t\t}\n\n\t\tstatic void SetFilesChanges(IFileSystem fileSystem, Optional<AbsoluteFilePath> path, Recorded<Notification<byte[]>>[] fileChanges, TestScheduler scheduler)\n\t\t{\n\t\t\tvar hotChanges = fileChanges.Skip(1).ToArray();\n\t\t\tfileSystem.Watch(path.Or(Arg.Any<AbsoluteFilePath>()))\n\t\t\t\t.Returns(scheduler.CreateHotObservable(hotChanges).Select(_ => Unit.Default));\n\n\t\t\tfileSystem.OpenRead(path.Or(Arg.Any<AbsoluteFilePath>())).Returns(new MemoryStream(fileChanges.First().Value.Value));\n\t\t\tscheduler.CreateHotObservable(hotChanges)\n\t\t\t\t.Subscribe(bytes => fileSystem.OpenRead(path.Or(Arg.Any<AbsoluteFilePath>())).Returns(new MemoryStream(bytes)));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/preview/tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Castle.Core\" version=\"4.4.0\" targetFramework=\"net46\" />\n  <package id=\"Microsoft.Reactive.Testing\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"NSubstitute\" version=\"4.2.2\" targetFramework=\"net46\" />\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net45\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/simulator/common/Bytecode/Exceptions.cs",
    "content": "using System;\nusing Uno;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class InvalidDataException : Exception\n\t{\n\t}\n\n\tpublic class NonExhaustiveMatch : Exception\n\t{\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Expression.cs",
    "content": "\nusing Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic abstract class Expression : Statement\n//\t\t, IMatchTypes<\n//\t\t\tReadVariable,\n\n//\t\t\tLiteral,\n//\t\t\tLambda,\n//\t\t\tMethodGroup,\n\n//\t\t\tIsType,\n//\t\t\tLogicalOr,\n\n//\t\t\tInstantiate,\n//\t\t\tCallSimulatedMethod,\n\n//\t\t\tCallStaticMethod,\n//\t\t\tCallDynamicMethod,\n//\t\t\tReadStaticField,\n//\t\t\tReadProperty,\n//\t\t\tWriteProperty,\n//\t\t\tAddEventHandler,\n//\t\t\tRemoveEventHandler>\n\t{\n\t\tpublic abstract char ExpressionId { get; }\n\t\tprotected abstract void WriteExpression(BinaryWriter writer);\n\n\t\tpublic T Match<T>(\n\t\t\tFunc<ReadVariable, T> a1,\n\t\t\tFunc<Literal, T> a2,\n\t\t\tFunc<Lambda, T> a3,\n\t\t\tFunc<MethodGroup, T> a4,\n\t\t\tFunc<IsType, T> a5,\n\t\t\tFunc<LogicalOr, T> a6,\n\t\t\tFunc<Instantiate, T> a7,\n\t\t\tFunc<CallLambda, T> a8,\n\t\t\tFunc<CallStaticMethod, T> a9,\n\t\t\tFunc<CallDynamicMethod, T> a10,\n\t\t\tFunc<ReadStaticField, T> a11,\n\t\t\tFunc<ReadProperty, T> a12,\n\t\t\tFunc<WriteProperty, T> a13,\n\t\t\tFunc<AddEventHandler, T> a15,\n\t\t\tFunc<RemoveEventHandler, T> a16)\n\t\t{\n\t\t\tvar self = this;\n\t\t\tvar t1 = self as ReadVariable; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as Literal; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as Lambda; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as MethodGroup; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as IsType; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = self as LogicalOr; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as Instantiate; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as CallLambda; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as CallStaticMethod; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as CallDynamicMethod; if (t10 != null) return a10(t10);\n\t\t\tvar t11 = self as ReadStaticField; if (t11 != null) return a11(t11);\n\t\t\tvar t12 = self as ReadProperty; if (t12 != null) return a12(t12);\n\t\t\tvar t13 = self as WriteProperty; if (t13 != null) return a13(t13);\n\t\t\tvar t15 = self as AddEventHandler; if (t15 != null) return a15(t15);\n\t\t\tvar t16 = self as RemoveEventHandler; if (t16 != null) return a16(t16);\n\t\t\tthrow new NonExhaustiveMatch();\n\t\t}\n\n\t\tpublic void Match(\n\t\t\tAction<ReadVariable> a1,\n\t\t\tAction<Literal> a2,\n\t\t\tAction<Lambda> a3,\n\t\t\tAction<MethodGroup> a4,\n\t\t\tAction<IsType> a5,\n\t\t\tAction<LogicalOr> a6,\n\t\t\tAction<Instantiate> a7,\n\t\t\tAction<CallLambda> a8,\n\t\t\tAction<CallStaticMethod> a9,\n\t\t\tAction<CallDynamicMethod> a10,\n\t\t\tAction<ReadStaticField> a11,\n\t\t\tAction<ReadProperty> a12,\n\t\t\tAction<WriteProperty> a13,\n\t\t\tAction<AddEventHandler> a15,\n\t\t\tAction<RemoveEventHandler> a16)\n\t\t{\n\t\t\tvar self = this;\n\t\t\tvar t1 = self as ReadVariable; if (t1 != null) { a1(t1); return; }\n\t\t\tvar t2 = self as Literal; if (t2 != null) { a2(t2); return; }\n\t\t\tvar t3 = self as Lambda; if (t3 != null) { a3(t3); return; }\n\t\t\tvar t4 = self as MethodGroup; if (t4 != null) { a4(t4); return; }\n\t\t\tvar t5 = self as IsType; if (t5 != null)  { a5(t5); return; }\n\t\t\tvar t6 = self as LogicalOr; if (t6 != null) { a6(t6); return; }\n\t\t\tvar t7 = self as Instantiate; if (t7 != null) { a7(t7); return; }\n\t\t\tvar t8 = self as CallLambda; if (t8 != null) { a8(t8); return; }\n\t\t\tvar t9 = self as CallStaticMethod; if (t9 != null) { a9(t9); return; }\n\t\t\tvar t10 = self as CallDynamicMethod; if (t10 != null) { a10(t10); return; }\n\t\t\tvar t11 = self as ReadStaticField; if (t11 != null) { a11(t11); return; }\n\t\t\tvar t12 = self as ReadProperty; if (t12 != null) { a12(t12); return; }\n\t\t\tvar t13 = self as WriteProperty; if (t13 != null) { a13(t13); return; }\n\t\t\tvar t15 = self as AddEventHandler; if (t15 != null) { a15(t15); return; }\n\t\t\tvar t16 = self as RemoveEventHandler; if (t16 != null) { a16(t16); return; }\n\t\t\tthrow new NonExhaustiveMatch();\n\t\t}\n\n\t\tpublic static void Write(Expression expression, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(expression.ExpressionId);\n\t\t\texpression.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteStatement(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(this, writer);\n\t\t}\n\n\t\tnew public static Func<BinaryReader, Expression> Read = _Read;\n\n\t\tnew public static Expression _Read(BinaryReader reader)\n\t\t{\n\t\t\tvar c = reader.ReadChar();\n\t\t\tswitch (c)\n\t\t\t{\n\t\t\t\tcase ExpressionIdRegistry.ReadVariable: return ReadVariable.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.Literal: return Literal.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.Lambda: return Lambda.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.MethodGroup: return MethodGroup.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.IsType: return IsType.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.LogicalOr: return LogicalOr.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.Instantiate: return Instantiate.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.CallLambda: return CallLambda.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.CallStaticMethod: return CallStaticMethod.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.CallDynamicMethod: return CallDynamicMethod.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.ReadStaticField: return ReadStaticField.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.ReadProperty: return ReadProperty.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.WriteProperty: return WriteProperty.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.AddEventHandler: return AddEventHandler.Read(reader);\n\t\t\t\tcase ExpressionIdRegistry.RemoveEventHandler: return RemoveEventHandler.Read(reader);\n\t\t\t}\n\t\t\tthrow new InvalidDataException();\n\t\t}\n\n\t\tpublic override char StatementId\n\t\t{\n\t\t\tget { return StatementIdRegistry.Expression; }\n\t\t}\n\n\t\tpublic static Expression Throw(Exception e)\n\t\t{\n\t\t\tthrow e;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/ExpressionIdRegistry.cs",
    "content": "namespace Outracks.Simulator.Bytecode\n{\n\tstatic class ExpressionIdRegistry\n\t{\n\t\tpublic const char ReadVariable = 'a';\n\t\tpublic const char Literal = 'b';\n\t\tpublic const char Lambda = 'c';\n\t\tpublic const char MethodGroup = 'd';\n\t\tpublic const char IsType = 'e';\n\t\tpublic const char LogicalOr = 'f';\n\t\tpublic const char Instantiate = 'g';\n\t\tpublic const char CallLambda = 'h';\n\t\tpublic const char CallStaticMethod = 'i';\n\t\tpublic const char CallDynamicMethod = 'j';\n\t\tpublic const char ReadStaticField = 'k';\n\t\tpublic const char ReadProperty = 'l';\n\t\tpublic const char WriteProperty = 'm';\n\t\tpublic const char AddEventHandler = 'n';\n\t\tpublic const char RemoveEventHandler = 'o';\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Expressions.cs",
    "content": "using Uno;\nusing Uno.Collections;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class LogicalOr : Expression\n\t{\n\t\tpublic readonly Expression Left;\n\t\tpublic readonly Expression Right;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.LogicalOr; } }\n\n\t\tpublic LogicalOr(Expression left, Expression right)\n\t\t{\n\t\t\tLeft = left;\n\t\t\tRight = right;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"(\" + Left + \" || \" + Right + \")\";\n\t\t}\n\n\t\tpublic static void Write(LogicalOr o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Left, writer);\n\t\t\tExpression.Write(Right, writer);\n\t\t}\n\n\t\tnew public static LogicalOr Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Left = Expression.Read(reader);\n\t\t\tvar _Right = Expression.Read(reader);\n\t\t\treturn new LogicalOr(\n\t\t\t\t_Left,\n\t\t\t\t_Right);\n\t\t}\n\t}\n\n\tpublic sealed class IsType : Expression\n\t{\n\t\tpublic readonly Expression Object;\n\t\tpublic readonly TypeName Type;\n\t\tpublic readonly bool IncludeSubtypes;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.IsType; } }\n\n\t\tpublic IsType(Expression o, TypeName type, bool includeSubtypes = true)\n\t\t{\n\t\t\tObject = o;\n\t\t\tType = type;\n\t\t\tIncludeSubtypes = includeSubtypes;\n\t\t}\n\n\t\tpublic static void Write(IsType o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Object, writer);\n\t\t\tTypeName.Write(Type, writer);\n\t\t\twriter.Write(IncludeSubtypes);\n\t\t}\n\n\t\tnew public static IsType Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Object = Expression.Read(reader);\n\t\t\tvar _Type = TypeName.Read(reader);\n\t\t\tvar _IncludeSubtypes = reader.ReadBoolean();\n\t\t\treturn new IsType(\n\t\t\t\t_Object,\n\t\t\t\t_Type,\n\t\t\t\t_IncludeSubtypes);\n\t\t}\n\t}\n\n\tpublic sealed class ReadVariable : Expression\n\t{\n\t\tpublic readonly Variable Variable;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.ReadVariable; } }\n\n\t\tpublic ReadVariable(Variable variable)\n\t\t{\n\t\t\tVariable = variable;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Variable.Name;\n\t\t}\n\n\t\tpublic static void Write(ReadVariable o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tVariable.Write(Variable, writer);\n\t\t}\n\n\t\tnew public static ReadVariable Read(BinaryReader reader)\n\t\t{\n\t\t\tvar variable = Variable.Read(reader);\n\t\t\treturn new ReadVariable(\n\t\t\t\tvariable);\n\t\t}\n\t}\n\n\tpublic sealed class Instantiate : Expression\n\t{\n\t\tpublic readonly TypeName Type;\n\t\tpublic readonly ImmutableList<Expression> Arguments;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.Instantiate; } }\n\n\t\tpublic Instantiate(TypeName type, params Expression[] arguments)\n\t\t\t: this(type, ((IEnumerable<Expression>)arguments).ToImmutableList())\n\t\t{ }\n\n\t\tpublic Instantiate(TypeName type, ImmutableList<Expression> arguments)\n\t\t{\n\t\t\tType = type;\n\t\t\tArguments = arguments;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"new \" + Type.FullName + \"(\" + Arguments.JoinToString(\", \") + \")\";\n\t\t}\n\n\t\tpublic static void Write(Instantiate o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tTypeName.Write(Type, writer);\n\t\t\tList.Write(writer, Arguments, Expression.Write);\n\t\t}\n\n\t\tnew public static Instantiate Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Type = TypeName.Read(reader);\n\t\t\tvar _Arguments = List.Read(reader, Expression.Read);\n\t\t\treturn new Instantiate(\n\t\t\t\t_Type,\n\t\t\t\t_Arguments);\n\t\t}\n\t}\n\n\tpublic sealed class CallLambda : Expression\n\t{\n\t\tpublic readonly Expression Lambda;\n\t\tpublic readonly ImmutableList<Expression> Arguments;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.CallLambda; } }\n\n\t\tpublic CallLambda(Expression lambda, params Expression[] arguments)\n\t\t\t: this(lambda, ((IEnumerable<Expression>)arguments).ToImmutableList())\n\t\t{ }\n\n\t\tpublic CallLambda(Expression lanbda, ImmutableList<Expression> arguments)\n\t\t{\n\t\t\tLambda = lanbda;\n\t\t\tArguments = arguments;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Lambda + \"(\" + Arguments.JoinToString(\", \") + \")\";\n\t\t}\n\n\t\tpublic static void Write(CallLambda o, BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(o.Lambda, writer);\n\t\t\tList.Write(writer, o.Arguments, Expression.Write);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tCallLambda.Write(this, writer);\n\t\t}\n\n\t\tnew public static CallLambda Read(BinaryReader reader)\n\t\t{\n\t\t\tvar lambda = Expression.Read(reader);\n\t\t\tvar arguments = List.Read(reader, Expression.Read);\n\t\t\treturn new CallLambda(\n\t\t\t\tlambda,\n\t\t\t\targuments);\n\t\t}\n\t}\n\n\tpublic sealed class CallStaticMethod : Expression\n\t{\n\t\tpublic readonly StaticMemberName StaticMethod;\n\t\tpublic readonly ImmutableList<Expression> Arguments;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.CallStaticMethod; } }\n\n\t\tpublic CallStaticMethod(StaticMemberName staticMethod, params Expression[] arguments)\n\t\t\t: this(staticMethod, ((IEnumerable<Expression>)arguments).ToImmutableList())\n\t\t{ }\n\n\t\tpublic CallStaticMethod(StaticMemberName staticMethod, ImmutableList<Expression> arguments)\n\t\t{\n\t\t\tStaticMethod = staticMethod;\n\t\t\tArguments = arguments;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn StaticMethod + \"(\" + Arguments.JoinToString(\", \") + \")\";\n\t\t}\n\n\t\tpublic static void Write(CallStaticMethod o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tStaticMemberName.Write(StaticMethod, writer);\n\t\t\tList.Write(writer, Arguments, Expression.Write);\n\t\t}\n\n\t\tnew public static CallStaticMethod Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _StaticMethod = StaticMemberName.Read(reader);\n\t\t\tvar _Arguments = List.Read(reader, Expression.Read);\n\t\t\treturn new CallStaticMethod(\n\t\t\t\t_StaticMethod,\n\t\t\t\t_Arguments);\n\t\t}\n\t}\n\n\tpublic sealed class CallDynamicMethod : Expression\n\t{\n\t\tpublic readonly Expression Object;\n\t\tpublic readonly TypeMemberName Method;\n\t\tpublic readonly ImmutableList<Expression> Arguments;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.CallDynamicMethod; } }\n\n\t\tpublic CallDynamicMethod(Expression o, TypeMemberName method, params Expression[] arguments)\n\t\t\t: this(o, method, ((IEnumerable<Expression>)arguments).ToImmutableList())\n\t\t{ }\n\n\t\tpublic CallDynamicMethod(Expression o, TypeMemberName method, ImmutableList<Expression> arguments)\n\t\t{\n\t\t\tObject = o;\n\t\t\tMethod = method;\n\t\t\tArguments = arguments;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Object + \".\" + Method.Name + \"(\" + Arguments.JoinToString(\", \") + \")\";\n\t\t}\n\n\t\tpublic static void Write(CallDynamicMethod o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Object, writer);\n\t\t\tTypeMemberName.Write(Method, writer);\n\t\t\tList.Write(writer, Arguments, Expression.Write);\n\t\t}\n\n\t\tnew public static CallDynamicMethod Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Object = Expression.Read(reader);\n\t\t\tvar _Method = TypeMemberName.Read(reader);\n\t\t\tvar _Arguments = List.Read(reader, Expression.Read);\n\t\t\treturn new CallDynamicMethod(\n\t\t\t\t_Object,\n\t\t\t\t_Method,\n\t\t\t\t_Arguments);\n\t\t}\n\t}\n\n\tpublic sealed class ReadStaticField : Expression\n\t{\n\t\tpublic readonly StaticMemberName Field;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.ReadStaticField; } }\n\n\t\tpublic ReadStaticField(StaticMemberName field)\n\t\t{\n\t\t\tField = field;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Field.TypeName.FullName + \".\" + Field.MemberName.Name;\n\t\t}\n\n\t\tpublic static void Write(ReadStaticField o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tStaticMemberName.Write(Field, writer);\n\t\t}\n\n\t\tnew public static ReadStaticField Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Field = StaticMemberName.Read(reader);\n\t\t\treturn new ReadStaticField(\n\t\t\t\t_Field);\n\t\t}\n\t}\n\n\tpublic sealed class ReadProperty : Expression\n\t{\n\t\tpublic readonly Expression Object;\n\t\tpublic readonly TypeMemberName Property;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.ReadProperty; } }\n\n\t\tpublic ReadProperty(Expression o, TypeMemberName property)\n\t\t{\n\t\t\tObject = o;\n\t\t\tProperty = property;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Object + \".\" + Property.Name;\n\t\t}\n\n\t\tpublic static void Write(ReadProperty o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Object, writer);\n\t\t\tTypeMemberName.Write(Property, writer);\n\t\t}\n\n\t\tnew public static ReadProperty Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Object = Expression.Read(reader);\n\t\t\tvar _Property = TypeMemberName.Read(reader);\n\t\t\treturn new ReadProperty(\n\t\t\t\t_Object,\n\t\t\t\t_Property);\n\t\t}\n\t}\n\n\n\tpublic sealed class WriteProperty : Expression\n\t{\n\t\tpublic readonly Expression Object;\n\t\tpublic readonly TypeMemberName Property;\n\t\tpublic readonly Expression Value;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.WriteProperty; } }\n\n\t\tpublic WriteProperty(Expression o, TypeMemberName property, Expression value)\n\t\t{\n\t\t\tObject = o;\n\t\t\tProperty = property;\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Object + \".\" + Property.Name + \" = \" + Value;\n\t\t}\n\n\t\tpublic static void Write(WriteProperty o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Object, writer);\n\t\t\tTypeMemberName.Write(Property, writer);\n\t\t\tExpression.Write(Value, writer);\n\t\t}\n\n\t\tnew public static WriteProperty Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Object = Expression.Read(reader);\n\t\t\tvar _Property = TypeMemberName.Read(reader);\n\t\t\tvar _Value = Expression.Read(reader);\n\t\t\treturn new WriteProperty(\n\t\t\t\t_Object,\n\t\t\t\t_Property,\n\t\t\t\t_Value);\n\t\t}\n\t}\n\n\tpublic sealed class AddEventHandler : Expression\n\t{\n\t\tpublic readonly Expression Object;\n\t\tpublic readonly TypeMemberName Event;\n\t\tpublic readonly Expression Handler;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.AddEventHandler; } }\n\n\t\tpublic AddEventHandler(Expression o, TypeMemberName ev, Expression handler)\n\t\t{\n\t\t\tObject = o;\n\t\t\tEvent = ev;\n\t\t\tHandler = handler;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Object + \".\" + Event.Name + \" += \" + Handler;\n\t\t}\n\n\t\tpublic static void Write(AddEventHandler o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Object, writer);\n\t\t\tTypeMemberName.Write(Event, writer);\n\t\t\tExpression.Write(Handler, writer);\n\t\t}\n\n\t\tnew public static AddEventHandler Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Object = Expression.Read(reader);\n\t\t\tvar _Event = TypeMemberName.Read(reader);\n\t\t\tvar _Handler = Expression.Read(reader);\n\t\t\treturn new AddEventHandler(\n\t\t\t\t_Object,\n\t\t\t\t_Event,\n\t\t\t\t_Handler);\n\t\t}\n\t}\n\n\tpublic sealed class RemoveEventHandler : Expression\n\t{\n\t\tpublic readonly Expression Object;\n\t\tpublic readonly TypeMemberName Event;\n\t\tpublic readonly Expression Handler;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.RemoveEventHandler; } }\n\n\t\tpublic RemoveEventHandler(Expression o, TypeMemberName ev, Expression handler)\n\t\t{\n\t\t\tObject = o;\n\t\t\tEvent = ev;\n\t\t\tHandler = handler;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Object + \".\" + Event.Name + \" -= \" + Handler;\n\t\t}\n\n\t\tpublic static void Write(RemoveEventHandler o, BinaryWriter writer)\n\t\t{\n\t\t\to.WriteExpression(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Object, writer);\n\t\t\tTypeMemberName.Write(Event, writer);\n\t\t\tExpression.Write(Handler, writer);\n\t\t}\n\n\t\tnew public static RemoveEventHandler Read(BinaryReader reader)\n\t\t{\n\t\t\tvar _Object = Expression.Read(reader);\n\t\t\tvar _Event = TypeMemberName.Read(reader);\n\t\t\tvar _Handler = Expression.Read(reader);\n\t\t\treturn new RemoveEventHandler(\n\t\t\t\t_Object,\n\t\t\t\t_Event,\n\t\t\t\t_Handler);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Lambda.cs",
    "content": "using System;\nusing System.IO;\nusing Uno.Collections;\nusing Uno;\nusing Uno.Text;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class BindVariable\n\t{\n\t\tpublic readonly Variable Variable;\n\t\tpublic readonly Expression Expression;\n\n\t\tpublic BindVariable(Variable variable, Expression expression)\n\t\t{\n\t\t\tVariable = variable;\n\t\t\tExpression = expression;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"var \" + Variable.Name + \" = \" + Expression;\n\t\t}\n\n\t\tpublic static readonly Action<BindVariable, BinaryWriter> Write = _Write;\n\n\t\tpublic static void _Write(BindVariable s, BinaryWriter writer)\n\t\t{\n\t\t\tVariable.Write(s.Variable, writer);\n\t\t\tExpression.Write(s.Expression, writer);\n\t\t}\n\n\t\tpublic static readonly Func<BinaryReader, BindVariable> Read = _Read;\n\n\t\tpublic static BindVariable _Read(BinaryReader reader)\n\t\t{\n\t\t\tvar variable = Variable.Read(reader);\n\t\t\tvar expression = Expression.Read(reader);\n\t\t\treturn new BindVariable(\n\t\t\t\tvariable,\n\t\t\t\texpression);\n\t\t}\n\t}\n\n\tpublic sealed class Lambda : Expression\n\t{\n\t\tstatic int fguid = 0;\n\n\n\t\tpublic static Lambda Action(Func<Expression, Statement> body)\n\t\t{\n\t\t\tvar a = new Variable(\"a\" + fguid++);\n\t\t\treturn new Lambda(\n\t\t\t\tSignature.Action(a),\n\t\t\t\tnew BindVariable[0],\n\t\t\t\tnew [] { body(new ReadVariable(a)) });\n\t\t}\n\n\t\tpublic static Lambda Func(Func<Expression, Statement> body)\n\t\t{\n\t\t\tvar a = new Variable(\"a\" + fguid++);\n\t\t\treturn new Lambda(\n\t\t\t\tSignature.Func(TypeName.Parse(\"object\"), a),\n\t\t\t\tnew BindVariable[0],\n\t\t\t\tnew[] { body(new ReadVariable(a)) });\n\t\t}\n\n\t\tpublic static Lambda Action(Func<Expression,Expression, Statement> body)\n\t\t{\n\t\t\tvar a = new Variable(\"a\" + fguid++);\n\t\t\tvar b = new Variable(\"a\" + fguid++);\n\t\t\treturn new Lambda(\n\t\t\t\tSignature.Action(a,b),\n\t\t\t\tnew BindVariable[0],\n\t\t\t\tnew[] { body(\n\t\t\t\t\tnew ReadVariable(a),\n\t\t\t\t\tnew ReadVariable(b)) });\n\t\t}\n\n\t\tpublic readonly Signature Signature;\n\t\tpublic readonly ImmutableList<BindVariable> LocalVariables;\n\t\tpublic readonly ImmutableList<Statement> Statements;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.Lambda; } }\n\n\t\tpublic Lambda(\n\t\t\tSignature signature,\n\t\t\tIEnumerable<BindVariable> localVariables,\n\t\t\tIEnumerable<Statement> statements)\n\t\t\t: this(signature, localVariables.ToImmutableList(), statements.ToImmutableList())\n\t\t{ }\n\n\t\tpublic Lambda(\n\t\t\tSignature signature,\n\t\t\tImmutableList<BindVariable> localVariables,\n\t\t\tImmutableList<Statement> statements)\n\t\t{\n\t\t\tSignature = signature;\n\t\t\tLocalVariables = localVariables;\n\t\t\tStatements = statements;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar code = new StringBuilder();\n\t\t\tforeach (var stmnt in LocalVariables)\n\t\t\t\tcode.Append(AddStatementSeparator(stmnt));\n\t\t\tforeach (var stmnt in Statements)\n\t\t\t\tcode.Append(AddStatementSeparator(stmnt));\n\n\t\t\treturn Signature + \" => \\n\" +\n\t\t\t\t\"{\\n\" +\n\t\t\t\t\tcode.ToString().Indent() +\n\t\t\t\t\"\\n}\";\n\t\t}\n\n\t\tstatic string AddStatementSeparator(object s)\n\t\t{\n\t\t\treturn s + \";\\n\";\n\t\t}\n\n\t\tpublic static void Write(Lambda l, BinaryWriter writer)\n\t\t{\n\t\t\tSignature.Write(l.Signature, writer);\n\t\t\tList.Write(writer, l.LocalVariables, BindVariable.Write);\n\t\t\tList.Write(writer, l.Statements, Statement.Write);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tLambda.Write(this, writer);\n\t\t}\n\n\t\tnew public static Lambda Read(BinaryReader reader)\n\t\t{\n\t\t\tvar signature = Signature.Read(reader);\n\t\t\tvar localVariables = List.Read(reader, BindVariable.Read);\n\t\t\tvar statements = List.Read(reader, Statement.Read);\n\t\t\treturn new Lambda(\n\t\t\t\tsignature,\n\t\t\t\tlocalVariables,\n\t\t\t\tstatements);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Literal.cs",
    "content": "using Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic abstract class Literal : Expression\n//\t\t, IMatchTypes<\n//\t\t\tBooleanLiteral,\n//\t\t\tStringLiteral,\n//\t\t\tNumberLiteral,\n//\t\t\tEnumLiteral,\n//\t\t\tBlobLiteral>\n\t{\n\t\tpublic abstract char LiteralId { get; }\n\t\tprotected abstract void WriteLiteral(BinaryWriter writer);\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.Literal; } }\n\n\t\tpublic T Match<T>(\n\t\t\tFunc<BooleanLiteral, T> a1,\n\t\t\tFunc<StringLiteral, T> a2,\n\t\t\tFunc<NumberLiteral, T> a3,\n\t\t\tFunc<EnumLiteral, T> a4,\n\t\t\tFunc<BlobLiteral, T> a5)\n\t\t{\n\t\t\tvar self = this;\n\t\t\tvar t1 = self as BooleanLiteral; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as StringLiteral; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as NumberLiteral; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as EnumLiteral; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = self as BlobLiteral; if (t5 != null) return a5(t5);\n\t\t\tthrow new NonExhaustiveMatch();\n\t\t}\n\n\t\tpublic void Match(\n\t\t\tAction<BooleanLiteral> a1,\n\t\t\tAction<StringLiteral> a2,\n\t\t\tAction<NumberLiteral> a3,\n\t\t\tAction<EnumLiteral> a4,\n\t\t\tAction<BlobLiteral> a5)\n\t\t{\n\t\t\tvar self = this;\n\t\t\tvar t1 = self as BooleanLiteral; if (t1 != null) { a1(t1); return; }\n\t\t\tvar t2 = self as StringLiteral; if (t2 != null) { a2(t2); return; }\n\t\t\tvar t3 = self as NumberLiteral; if (t3 != null) { a3(t3); return; }\n\t\t\tvar t4 = self as EnumLiteral; if (t4 != null) { a4(t4); return; }\n\t\t\tvar t5 = self as BlobLiteral; if (t5 != null) { a5(t5); return; }\n\t\t\tthrow new NonExhaustiveMatch();\n\t\t}\n\n\t\tpublic static void Write(Literal literal, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(literal.LiteralId);\n\t\t\tliteral.WriteLiteral(writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tLiteral.Write(this, writer);\n\t\t}\n\n\t\tnew public static Literal Read(BinaryReader reader)\n\t\t{\n\t\t\tvar token = reader.ReadChar();\n\t\t\tswitch (token)\n\t\t\t{\n\t\t\t\tcase LiteralIdRegistry.BooleanLiteral: return BooleanLiteral.Read(reader);\n\t\t\t\tcase LiteralIdRegistry.StringLiteral: return StringLiteral.Read(reader);\n\t\t\t\tcase LiteralIdRegistry.NumberLiteral: return NumberLiteral.Read(reader);\n\t\t\t\tcase LiteralIdRegistry.EnumLiteral: return EnumLiteral.Read(reader);\n\t\t\t\tcase LiteralIdRegistry.BlobLiteral: return BlobLiteral.Read(reader);\n\t\t\t}\n\t\t\tthrow new InvalidDataException();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/LiteralIdRegistry.cs",
    "content": "namespace Outracks.Simulator.Bytecode\n{\n\tstatic class LiteralIdRegistry\n\t{\n\t\tpublic const char BooleanLiteral = 'b';\n\t\tpublic const char StringLiteral = 's';\n\t\tpublic const char NumberLiteral = 'n';\n\t\tpublic const char EnumLiteral = 'e';\n\t\tpublic const char BlobLiteral = 'd';\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Literals.cs",
    "content": "using System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class BlobLiteral : Literal\n\t{\n\t\tpublic readonly byte[] Bytes;\n\n\t\tpublic override char LiteralId { get { return LiteralIdRegistry.BlobLiteral; } }\n\n\t\tpublic BlobLiteral(byte[] bytes)\n\t\t{\n\t\t\tBytes = bytes;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"new byte[\" + Bytes.Length + \"]\";\n\t\t}\n\n\t\tpublic static void Write(BlobLiteral blob, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(blob.Bytes.Length);\n\t\t\twriter.Write(blob.Bytes);\n\t\t}\n\n\t\tprotected override void WriteLiteral(BinaryWriter writer)\n\t\t{\n\t\t\tBlobLiteral.Write(this, writer);\n\t\t}\n\n\t\tnew public static BlobLiteral Read(BinaryReader reader)\n\t\t{\n\t\t\tvar length = reader.ReadInt32();\n\t\t\tvar bytes = reader.ReadBytes(length);\n\t\t\treturn new BlobLiteral(bytes);\n\t\t}\n\t}\n\n\tpublic class BooleanLiteral : Literal\n\t{\n\t\tpublic readonly bool BooleanValue;\n\n\t\tpublic override char LiteralId { get { return LiteralIdRegistry.BooleanLiteral; } }\n\n\t\tpublic BooleanLiteral(bool booleanValue)\n\t\t{\n\t\t\tBooleanValue = booleanValue;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn BooleanValue.ToString();\n\t\t}\n\n\t\tpublic static void Write(BooleanLiteral l, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(l.BooleanValue);\n\t\t}\n\n\t\tprotected override void WriteLiteral(BinaryWriter writer)\n\t\t{\n\t\t\tBooleanLiteral.Write(this, writer);\n\t\t}\n\n\t\tnew public static BooleanLiteral Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new BooleanLiteral(\n\t\t\t\treader.ReadBoolean());\n\t\t}\n\t}\n\n\tpublic class StringLiteral : Literal\n\t{\n\t\tpublic readonly string StringValue;\n\n\t\tpublic override char LiteralId { get { return LiteralIdRegistry.StringLiteral; } }\n\n\t\tpublic StringLiteral(string stringValue)\n\t\t{\n\t\t\tStringValue = stringValue;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"\\\"\" + StringValue + \"\\\"\";\n\t\t}\n\n\t\tpublic static void Write(StringLiteral l, BinaryWriter writer)\n\t\t{\n\t\t\tOptional.Write(writer, l.StringValue.ToOptional(), WriteString);\n\t\t}\n\n\t\tprotected override void WriteLiteral(BinaryWriter writer)\n\t\t{\n\t\t\tStringLiteral.Write(this, writer);\n\t\t}\n\n\t\tstatic void WriteString(string str, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(str);\n\t\t}\n\n\t\tnew public static StringLiteral Read(BinaryReader reader)\n\t\t{\n\t\t\tvar maybeString = Optional.Read(reader, (Func<BinaryReader, string>)ReadString);\n\t\t\treturn new StringLiteral(\n\t\t\t\tmaybeString.HasValue\n\t\t\t\t\t? maybeString.Value\n\t\t\t\t\t: null);\n\t\t}\n\n\t\tstatic string ReadString(BinaryReader reader)\n\t\t{\n\t\t\treturn reader.ReadString();\n\t\t}\n\t}\n\n\tpublic enum NumberType\n\t{\n\t\tDouble,\n\t\tFloat,\n\t\tInt,\n\t\tUInt,\n\t\tShort,\n\t\tUShort,\n\t\tSByte,\n\t\tByte,\n\t}\n\n\tpublic class NumberLiteral : Literal\n\t{\n\t\tpublic readonly NumberType NumberType;\n\t\tpublic readonly double DoubleValue;\n\n\t\tpublic override char LiteralId { get { return LiteralIdRegistry.NumberLiteral; } }\n\n\t\tpublic NumberLiteral(NumberType numberType, double doubleValue)\n\t\t{\n\t\t\tDoubleValue = doubleValue;\n\t\t\tNumberType = numberType;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn DoubleValue.ToString();\n\t\t}\n\n\t\tpublic static void Write(NumberLiteral l, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write((int) l.NumberType);\n\t\t\twriter.Write(l.DoubleValue);\n\t\t}\n\n\t\tprotected override void WriteLiteral(BinaryWriter writer)\n\t\t{\n\t\t\tNumberLiteral.Write(this, writer);\n\t\t}\n\n\t\tnew public static NumberLiteral Read(BinaryReader reader)\n\t\t{\n\t\t\tvar nubmerType =(NumberType)reader.ReadInt32();\n\t\t\tvar doubleValue =reader.ReadDouble();\n\t\t\treturn new NumberLiteral(\n\t\t\t\tnubmerType,\n\t\t\t\tdoubleValue);\n\t\t}\n\t}\n\n\tpublic class EnumLiteral : Literal\n\t{\n\t\tpublic readonly StaticMemberName Value;\n\n\t\tpublic override char LiteralId { get { return LiteralIdRegistry.EnumLiteral; } }\n\n\t\tpublic EnumLiteral(StaticMemberName value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Value.ToString();\n\t\t}\n\n\t\tpublic static void Write(EnumLiteral l, BinaryWriter writer)\n\t\t{\n\t\t\tStaticMemberName.Write(l.Value, writer);\n\t\t}\n\n\t\tprotected override void WriteLiteral(BinaryWriter writer)\n\t\t{\n\t\t\tEnumLiteral.Write(this, writer);\n\t\t}\n\n\t\tnew public static EnumLiteral Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new EnumLiteral(\n\t\t\t\tStaticMemberName.Read(reader));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/MethodGroup.cs",
    "content": "\nusing Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class MethodGroup : Expression\n\t{\n\t\tpublic readonly Expression Object;\n\t\tpublic readonly TypeMemberName MethodName;\n\t\tpublic readonly Optional<Signature> MethodSignature;\n\t\tpublic readonly TypeName DelegateType;\n\n\t\tpublic override char ExpressionId { get { return ExpressionIdRegistry.MethodGroup; } }\n\n\t\tpublic MethodGroup(Expression o, TypeMemberName methodName, Optional<Signature> methodSignature, TypeName delegateType)\n\t\t{\n\t\t\tObject = o;\n\t\t\tMethodName = methodName;\n\t\t\tMethodSignature = methodSignature;\n\t\t\tDelegateType = delegateType;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"((\" + DelegateType + \")(\" + Object + \").\" + MethodName + \")\";\n\t\t}\n\n\t\tpublic static void Write(MethodGroup l, BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(l.Object, writer);\n\t\t\tTypeMemberName.Write(l.MethodName, writer);\n\t\t\tOptional.Write(writer, l.MethodSignature, Signature.Write);\n\t\t\tTypeName.Write(l.DelegateType, writer);\n\t\t}\n\n\t\tprotected override void WriteExpression(BinaryWriter writer)\n\t\t{\n\t\t\tMethodGroup.Write(this, writer);\n\t\t}\n\n\t\tnew public static MethodGroup Read(BinaryReader reader)\n\t\t{\n\t\t\tvar a = Expression.Read(reader);\n\t\t\tvar b = TypeMemberName.Read(reader);\n\t\t\tvar c = Optional.Read(reader, Signature.Read);\n\t\t\tvar d = TypeName.Read(reader);\n\t\t\treturn new MethodGroup(\n\t\t\t\ta,\n\t\t\t\tb,\n\t\t\t\tc,\n\t\t\t\td);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/NamespaceName.cs",
    "content": "using System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class NamespaceName : IEquatable<NamespaceName>\n\t{\n\t\tpublic readonly string FullName;\n\t\tpublic NamespaceName(string fullName)\n\t\t{\n\t\t\tFullName = fullName;\n\t\t}\n\n\t\tpublic bool Equals(NamespaceName other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn string.Equals(FullName, other.FullName);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is NamespaceName && Equals((NamespaceName)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (FullName != null ? FullName.GetHashCode() : 0);\n\t\t}\n\n\t\tpublic static bool operator ==(NamespaceName left, NamespaceName right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(NamespaceName left, NamespaceName right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn FullName;\n\t\t}\n\n\t\tpublic static Action<NamespaceName, BinaryWriter> Write = _Write;\n\n\t\tpublic static void _Write(NamespaceName name, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(name.FullName);\n\t\t}\n\n\t\tpublic static Func<BinaryReader, NamespaceName> Read = _Read;\n\n\t\tpublic static NamespaceName _Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new NamespaceName(reader.ReadString());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Parameter.cs",
    "content": "using System.IO;\nusing Uno.Collections;\nusing Uno;\nusing Uno.Text;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class Parameter\n\t{\n\t\tpublic readonly TypeName Type;\n\t\tpublic readonly Variable Name;\n\n\t\tpublic Parameter(\n\t\t\tTypeName type,\n\t\t\tVariable name)\n\t\t{\n\t\t\tType = type;\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic static Func<BinaryReader, Parameter> Read = _Read;\n\n\t\tstatic Parameter _Read(BinaryReader reader)\n\t\t{\n\t\t\tvar type = TypeName.Read(reader);\n\t\t\tvar name = Variable.Read(reader);\n\t\t\treturn new Parameter(type, name);\n\t\t}\n\n\t\tpublic static Action<Parameter, BinaryWriter> Write = _Write;\n\n\t\tstatic void _Write(Parameter p, BinaryWriter writer)\n\t\t{\n\t\t\tTypeName.Write(p.Type, writer);\n\t\t\tVariable.Write(p.Name, writer);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Type + \" \" + Name;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/ProjectBytecode.cs",
    "content": "﻿using Uno;\nusing Uno.Collections;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class ProjectBytecode\n\t{\n\t\tpublic readonly Lambda Reify;\n\t\tpublic readonly ImmutableList<ProjectDependency> Dependencies;\n\t\tpublic readonly ProjectMetadata Metadata;\n\n\t\tpublic ProjectBytecode(\n\t\t\tLambda reify,\n\t\t\tIEnumerable<ProjectDependency> dependencies,\n\t\t\tProjectMetadata metadata)\n\t\t{\n\t\t\tReify = reify;\n\t\t\tDependencies = dependencies.ToImmutableList();\n\t\t\tMetadata = metadata;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Reify.ToString();\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\tMetadata.WriteDataTo(writer);\n\t\t\tLambda.Write(Reify, writer);\n\t\t\tList.Write(writer, Dependencies, (Action<ProjectDependency, BinaryWriter>)ProjectDependency.Write);\n\t\t}\n\n\t\tpublic static ProjectBytecode ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar metadata = ProjectMetadata.ReadDataFrom(reader);\n\t\t\tvar lambda = Lambda.Read(reader);\n\t\t\tvar dependencies = List.Read(reader, (Func<BinaryReader, ProjectDependency>)ProjectDependency.Read);\n\t\t\treturn new ProjectBytecode(lambda, dependencies, metadata);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/ProjectDependency.cs",
    "content": "using System.IO;\nusing Uno;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class ProjectDependency : IEquatable<ProjectDependency>\n\t{\n\t\tpublic readonly string Path;\n\t\tpublic readonly string Descriptor;\n\n\t\tpublic ProjectDependency(string path, string descriptor)\n\t\t{\n\t\t\tPath = path;\n\t\t\tDescriptor = descriptor;\n\t\t}\n\n\t\tpublic static void Write( ProjectDependency dependency, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(dependency.Path);\n\t\t\twriter.Write(dependency.Descriptor);\n\t\t}\n\n\t\tpublic static ProjectDependency Read(BinaryReader reader)\n\t\t{\n\t\t\tvar path = reader.ReadString();\n\t\t\tvar descriptor = reader.ReadString();\n\t\t\treturn new ProjectDependency(path, descriptor);\n\t\t}\n\n\t\tpublic bool Equals(ProjectDependency other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn Path.Equals(other.Path) && string.Equals(Descriptor, other.Descriptor);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is ProjectDependency && Equals((ProjectDependency)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\t//unchecked\n\t\t\t{\n\t\t\t\treturn (Path.GetHashCode() * 397) ^ Descriptor.GetHashCode();\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(ProjectDependency left, ProjectDependency right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(ProjectDependency left, ProjectDependency right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{ Path: \" + Path + \", Descriptor: \" + Descriptor + \" }\";\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/ProjectMetadata.cs",
    "content": "﻿using Uno;\nusing Uno.Collections;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class ProjectMetadata\n\t{\n\t\tpublic readonly ImmutableList<KeyValuePair<ObjectIdentifier, IEnumerable<ObjectIdentifier>>> ElementTypeHierarchy;\n\t\tpublic readonly ImmutableList<PrecompiledElement> PrecompiledElements;\n\n\t\tpublic ProjectMetadata(\n\t\t\tImmutableList<KeyValuePair<ObjectIdentifier, IEnumerable<ObjectIdentifier>>> hierarchy,\n\t\t\tImmutableList<PrecompiledElement> elements)\n\t\t{\n\t\t\tElementTypeHierarchy = hierarchy;\n\t\t\tPrecompiledElements = elements;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\tList.Write(writer, ElementTypeHierarchy, (Action<KeyValuePair<ObjectIdentifier, IEnumerable<ObjectIdentifier>>, BinaryWriter>)WriteType);\n\t\t\tList.Write(writer, PrecompiledElements, (Action<PrecompiledElement, BinaryWriter>)PrecompiledElement.Write);\n\t\t}\n\n\t\tpublic static ProjectMetadata ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar hierarchy = List.Read(reader, (Func<BinaryReader, KeyValuePair<ObjectIdentifier, IEnumerable<ObjectIdentifier>>>)ReadType);\n\t\t\tvar elements = List.Read(reader, (Func<BinaryReader, PrecompiledElement>)PrecompiledElement.Read);\n\t\t\treturn new ProjectMetadata(hierarchy, elements);\n\t\t}\n\n\t\tstatic void WriteType(KeyValuePair<ObjectIdentifier, IEnumerable<ObjectIdentifier>> type, BinaryWriter writer)\n\t\t{\n\t\t\tObjectIdentifier.Write(type.Key, writer);\n\t\t\tList.Write(writer, type.Value, (Action<ObjectIdentifier, BinaryWriter>)ObjectIdentifier.Write);\n\t\t}\n\n\t\tstatic KeyValuePair<ObjectIdentifier, IEnumerable<ObjectIdentifier>> ReadType(BinaryReader reader)\n\t\t{\n\t\t\tvar key = ObjectIdentifier.Read(reader);\n\t\t\tvar value = List.Read(reader, (Func<BinaryReader, ObjectIdentifier>)ObjectIdentifier.Read);\n\t\t\treturn new KeyValuePair<ObjectIdentifier, IEnumerable<ObjectIdentifier>>(key, value);\n\t\t}\n\t}\n\n\tpublic class PrecompiledElement\n\t{\n\t\tpublic readonly ObjectIdentifier Id;\n\t\tpublic readonly string Source;\n\n\t\tpublic PrecompiledElement(ObjectIdentifier id, string source)\n\t\t{\n\t\t\tId = id;\n\t\t\tSource = source;\n\t\t}\n\n\t\tpublic static void Write(PrecompiledElement dependency, BinaryWriter writer)\n\t\t{\n\t\t\tObjectIdentifier.Write(dependency.Id, writer);\n\t\t\twriter.Write(dependency.Source);\n\t\t}\n\n\t\tpublic static PrecompiledElement Read(BinaryReader reader)\n\t\t{\n\t\t\tvar id = ObjectIdentifier.Read(reader);\n\t\t\tvar source = reader.ReadString();\n\t\t\treturn new PrecompiledElement(id, source);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Source;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Signature.cs",
    "content": "using System.IO;\nusing Uno.Collections;\nusing Uno;\nusing Uno.Text;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class Signature\n\t{\n\t\tpublic static Signature Action(params Variable[] variables)\n\t\t{\n\t\t\tvar parameters = new Parameter[variables.Length];\n\t\t\tfor (int i = 0; i < variables.Length; i++)\n\t\t\t\tparameters[i] = new Parameter(TypeName.Parse(\"object\"), variables[i]);\n\t\t\treturn new Signature(new ImmutableList<Parameter>(parameters), Optional.None<TypeName>());\n\t\t}\n\n\t\tpublic static Signature Func(TypeName returnType, params Variable[] variables)\n\t\t{\n\t\t\tvar parameters = new Parameter[variables.Length];\n\t\t\tfor (int i = 0; i < variables.Length; i++)\n\t\t\t\tparameters[i] = new Parameter(TypeName.Parse(\"object\"), variables[i]);\n\t\t\treturn new Signature(new ImmutableList<Parameter>(parameters), Optional.Some(returnType));\n\t\t}\n\n\t\tpublic readonly ImmutableList<Parameter> Parameters;\n\t\tpublic readonly Optional<TypeName> ReturnType;\n\n\t\tpublic Signature(\n\t\t\tImmutableList<Parameter> parameters,\n\t\t\tOptional<TypeName> returnType)\n\t\t{\n\t\t\tParameters = parameters;\n\t\t\tReturnType = returnType;\n\t\t}\n\n\t\tpublic static void Write(Signature s, BinaryWriter writer)\n\t\t{\n\t\t\tList.Write(writer, s.Parameters, Parameter.Write);\n\t\t\tOptional.Write(writer, s.ReturnType, TypeName.Write);\n\t\t}\n\n\t\tpublic static readonly Func<BinaryReader, Signature> Read = _Read;\n\n\t\tpublic static Signature _Read(BinaryReader reader)\n\t\t{\n\t\t\tvar parameters = List.Read(reader, Parameter.Read);\n\t\t\tvar returnType = Optional.Read(reader, TypeName.Read);\n\t\t\treturn new Signature(\n\t\t\t\tparameters,\n\t\t\t\treturnType);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tvar names = new string[Parameters.Count];\n\t\t\tfor (int i = 0; i < Parameters.Count; i++)\n\t\t\t\tnames[i] = Parameters[i].ToString();\n\n\t\t\treturn \"(\" + names.Join(\", \") + \")\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Statement.cs",
    "content": "using Uno.Collections;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic abstract class Statement\n//\t\t: IMatchTypes<\n//\t\t\tNoOperation,\n//\t\t\tBindVariable,\n//\t\t\tExpression,\n//\t\t\tReturn>\n\t{\n\t\tpublic abstract char StatementId { get; }\n\n\t\tpublic T Match<T>(\n\t\t\tFunc<NoOperation, T> a1,\n\t\t\tFunc<Expression, T> a3,\n\t\t\tFunc<Return, T> a4)\n\t\t{\n\t\t\tvar self = this;\n\t\t\tvar t1 = self as NoOperation; if (t1 != null) return a1(t1);\n\t\t\tvar t3 = self as Expression; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as Return; if (t4 != null) return a4(t4);\n\t\t\tthrow new NonExhaustiveMatch();\n\t\t}\n\n\t\tpublic void Match(\n\t\t\tAction<NoOperation> a1,\n\t\t\tAction<Expression> a3,\n\t\t\tAction<Return> a4)\n\t\t{\n\t\t\tvar self = this;\n\t\t\tvar t1 = self as NoOperation; if (t1 != null) { a1(t1); return; }\n\t\t\tvar t3 = self as Expression; if (t3 != null) { a3(t3); return; }\n\t\t\tvar t4 = self as Return; if (t4 != null) { a4(t4); return; }\n\t\t\tthrow new NonExhaustiveMatch();\n\t\t}\n\n\t\tpublic static void Write(Statement statement, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(statement.StatementId);\n\t\t\tstatement.WriteStatement(writer);\n\t\t}\n\n\t\tprotected abstract void WriteStatement(BinaryWriter writer);\n\n\t\tpublic static readonly Func<BinaryReader, Statement> Read = _Read;\n\n\t\tpublic static Statement _Read(BinaryReader reader)\n\t\t{\n\t\t\tvar c = reader.ReadChar();\n\t\t\tswitch (c)\n\t\t\t{\n\t\t\t\tcase StatementIdRegistry.NoOperation: return NoOperation.Read(reader);\n\t\t\t\tcase StatementIdRegistry.Expression: return Expression.Read(reader);\n\t\t\t\tcase StatementIdRegistry.Return: return Return.Read(reader);\n\t\t\t}\n\t\t\tthrow new InvalidDataException();\n\t\t}\n\n\t\tpublic static Statement Nop()\n\t\t{\n\t\t\treturn new NoOperation(\"NOP\");\n\t\t}\n\n\t\tpublic static Statement operator +(Statement left, Statement right)\n\t\t{\n\t\t\treturn new CallLambda(\n\t\t\t\tnew Lambda(\n\t\t\t\t\tSignature.Action(),\n\t\t\t\t\tImmutableList<BindVariable>.Empty,\n\t\t\t\t\tList.Create<Statement>(left, right)));\n\t\t}\n\n\t\tpublic static IEnumerable<Statement> operator +(Statement statement, IEnumerable<Statement> statements)\n\t\t{\n\t\t\treturn ((IEnumerable<Statement>)new[] { statement }).Union(statements);\n\t\t}\n\n\t\tpublic static IEnumerable<Statement> operator +(IEnumerable<Statement> statements, Statement statement)\n\t\t{\n\t\t\treturn statements.Union(new[] { statement });\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/StatementIdRegistry.cs",
    "content": "namespace Outracks.Simulator.Bytecode\n{\n\tstatic class StatementIdRegistry\n\t{\n\t\tpublic const char NoOperation = 'n';\n\t\tpublic const char Expression = 'e';\n\t\tpublic const char Return = 'r';\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Statements.cs",
    "content": "using System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class NoOperation : Statement\n\t{\n\t\tpublic readonly Optional<string> Description;\n\n\t\tpublic NoOperation(Optional<string> description = default(Optional<string>))\n\t\t{\n\t\t\tDescription = description;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"// \" + Description;\n\t\t}\n\n\t\tprotected override void WriteStatement(BinaryWriter writer)\n\t\t{\n\t\t\tOptional.Write(writer, Description, writer.Write);\n\t\t}\n\n\t\tnew public static NoOperation Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new NoOperation(Optional.Read(reader, Serialization.ReadString));\n\t\t}\n\n\t\tpublic override char StatementId { get { return StatementIdRegistry.NoOperation; } }\n\t}\n\n\tpublic class Return : Statement\n\t{\n\t\tpublic readonly Expression Value;\n\t\tpublic Return(Expression value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"return \" + Value;\n\t\t}\n\n\t\tprotected override void WriteStatement(BinaryWriter writer)\n\t\t{\n\t\t\tExpression.Write(Value, writer);\n\t\t}\n\n\t\tnew public static Return Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new Return(Expression.Read(reader));\n\t\t}\n\n\t\tpublic override char StatementId { get { return StatementIdRegistry.Return; } }\n\t}\n\n\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/StaticMemberName.cs",
    "content": "using Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class StaticMemberName : IEquatable<StaticMemberName>\n\t{\n\t\tpublic static StaticMemberName Parse(string value)\n\t\t{\n\t\t\treturn new StaticMemberName(\n\t\t\t\tTypeName.Parse(value.BeforeLast(\".\")),\n\t\t\t\tnew TypeMemberName(value.AfterLast(\".\")));\n\t\t}\n\n\t\tpublic readonly TypeName TypeName;\n\t\tpublic readonly TypeMemberName MemberName;\n\n\t\tpublic StaticMemberName(TypeName typeName, TypeMemberName memberName)\n\t\t{\n\t\t\tTypeName = typeName;\n\t\t\tMemberName = memberName;\n\t\t}\n\n\t\tpublic bool Equals(StaticMemberName other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn TypeName.Equals(other.TypeName) && Equals(MemberName, other.MemberName);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is StaticMemberName && Equals((StaticMemberName)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (TypeName.GetHashCode() * 397) ^ (MemberName != null ? MemberName.GetHashCode() : 0);\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(StaticMemberName left, StaticMemberName right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(StaticMemberName left, StaticMemberName right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn TypeName.FullName + \".\" + MemberName.Name;\n\t\t}\n\n\t\tpublic static void Write(StaticMemberName m, BinaryWriter writer)\n\t\t{\n\t\t\tTypeName.Write(m.TypeName, writer);\n\t\t\tTypeMemberName.Write(m.MemberName, writer);\n\t\t}\n\n\t\tpublic static StaticMemberName Read(BinaryReader reader)\n\t\t{\n\t\t\tvar typeName =TypeName.Read(reader);\n\t\t\tvar memberName =TypeMemberName.Read(reader);\n\t\t\treturn new StaticMemberName(\n\t\t\t\ttypeName,\n\t\t\t\tmemberName);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/TypeMemberName.cs",
    "content": "using Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed class TypeMemberName : IEquatable<TypeMemberName>\n\t{\n\t\tpublic readonly string Name;\n\n\t\tpublic TypeMemberName(string name)\n\t\t{\n\t\t\tif (name == null) throw new ArgumentNullException(name);\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic static StaticMemberName operator +(TypeName typeName, TypeMemberName memberName)\n\t\t{\n\t\t\treturn new StaticMemberName(typeName, memberName);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar other = obj as TypeMemberName;\n\t\t\treturn other != null && Equals(other);\n\t\t}\n\n\t\tpublic bool Equals(TypeMemberName other)\n\t\t{\n\t\t\treturn other.Name == Name;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Name.GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Name;\n\t\t}\n\n\t\tpublic static TypeMemberName Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new TypeMemberName(reader.ReadString());\n\t\t}\n\n\t\tpublic static void Write(TypeMemberName name, BinaryWriter writer)\n\t\t{\n\t\t\tname.Write(writer);\n\t\t}\n\n\t\tpublic void Write(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(Name);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/TypeName.cs",
    "content": "using System.IO;\nusing Uno;\nusing Uno.Text;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic sealed partial class TypeName : IEquatable<TypeName>\n\t{\n\t\tpublic readonly Optional<TypeName> ContainingType;\n\t\tpublic readonly string Surname;\n\t\tpublic readonly ImmutableList<TypeName> GenericArguments;\n\n\t\tpublic TypeName(Optional<TypeName> containingType, string surname, ImmutableList<TypeName> genericArguments)\n\t\t{\n\t\t\tContainingType = containingType;\n\t\t\tSurname = surname;\n\t\t\tGenericArguments = genericArguments;\n\t\t}\n\n\t\tpublic string FullName\n        {\n\t        get\n\t        {\n\t\t        return (ContainingType.HasValue ? ContainingType.Value.FullName + \".\" : \"\") + Name;\n\t        }\n        }\n\n\t\tpublic bool IsParameterizedGenericType\n\n\t\t{\n\t\t\tget { return GenericArguments.Count != 0 || (ContainingType.HasValue && ContainingType.Value.IsParameterizedGenericType); }\n\t\t}\n\n\t\tpublic TypeName WithGenericSuffix\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new TypeName(\n\t\t\t\t\tContainingType.HasValue ? Optional.Some(ContainingType.Value.WithGenericSuffix) : Optional.None<TypeName>(),\n\t\t\t\t\tSurname + (GenericArguments.Count == 0 ? \"\" : \"`\" + GenericArguments.Count),\n\t\t\t\t\tImmutableList<TypeName>.Empty);\n\t\t\t}\n\t\t}\n\n\t\tpublic ImmutableList<TypeName> GenericArgumentsRecursively\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tvar args = new List<TypeName>();\n\t\t\t\tvar typeName = this;\n\t\t\t\twhile (typeName.ContainingType.HasValue)\n\t\t\t\t{\n\t\t\t\t\targs.AddRange(typeName.GenericArguments);\n\t\t\t\t\ttypeName = typeName.ContainingType.Value;\n\t\t\t\t}\n\t\t\t\treturn args.ToImmutableList();\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn GenericArguments.Count != 0\n\t\t\t\t\t? Surname + \"<\" + GenericArguments.JoinToString(\",\") + \">\"\n\t\t\t\t\t: Surname;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn FullName;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn FullName.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is TypeName && Equals((TypeName)obj);\n\t\t}\n\n\t\tpublic bool Equals(TypeName other)\n\t\t{\n\t\t\treturn FullName == other.FullName;\n\t\t}\n\n\t\tpublic static bool operator ==(TypeName a, TypeName b)\n\t\t{\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic static bool operator !=(TypeName a, TypeName b)\n\t\t{\n\t\t\treturn !a.Equals(b);\n\t\t}\n\n\t\tpublic static Action<TypeName, BinaryWriter> Write = _Write;\n\n\t\tpublic static void _Write(TypeName name, BinaryWriter writer)\n\t\t{\n\t\t\tname._Write(writer);\n\t\t}\n\n\t\tpublic void _Write(BinaryWriter writer)\n\t\t{\n\t\t\tOptional.Write(writer, ContainingType, TypeName.Write);\n\t\t\twriter.Write(Surname);\n\t\t\tList.Write(writer, GenericArguments, TypeName.Write);\n\t\t}\n\n\t\tpublic static Func<BinaryReader, TypeName> Read = _Read;\n\n\t\tpublic static TypeName _Read(BinaryReader reader)\n\t\t{\n\t\t\tvar containingType = Optional.Read(reader, TypeName.Read);\n\t\t\tvar surname =reader.ReadString();\n\t\t\tvar genericArguments =List.Read(reader, TypeName.Read);\n\n\t\t\treturn new TypeName(\n\t\t\t\tcontainingType,\n\t\t\t\tsurname,\n\t\t\t\tgenericArguments);\n\t\t}\n\n\t\tpublic TypeName Parameterize(params TypeName[] methodArgumentTypes)\n\t\t{\n\t\t\treturn new TypeName(ContainingType, Surname, ((IEnumerable<TypeName>)methodArgumentTypes).ToImmutableList());\n\t\t}\n\n\t\tpublic static TypeName Parse(string name)\n\t\t{\n\t\t\treturn TypeNameParser.Parse(name);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/TypeNameParser.cs",
    "content": "using Uno;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class TypeNameParser\n\t{\n\t\treadonly List<string> _tokens;\n\t\tint _idx;\n\n\t\tpublic static TypeName Parse(string typeName)\n\t\t{\n\t\t\treturn new TypeNameParser(TypeNameTokenizer.Tokenize(typeName)).ParseTypeName();\n\t\t}\n\n\t\tpublic TypeNameParser(List<string> tokens)\n\t\t{\n\t\t\t_tokens = tokens;\n\t\t}\n\n\t\tstatic List<TypeName> NoTypes { get { return new List<TypeName>();} }\n\n\t\tstring Cur { get { return _tokens[_idx]; } }\n\n\t\tpublic TypeName ParseTypeName(Optional<TypeName> containingType = default(Optional<TypeName>))\n\t\t{\n\t\t\tvar typeName = ParseSingleTypeName(containingType);\n\t\t\tParsePossibleDot();\n\t\t\tif (_idx < _tokens.Count && !TypeNameTokenizer.IsSpecialChar(Cur[0]))\n\t\t\t{\n\t\t\t\tvar tmp = ParseTypeName(typeName);\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn typeName;\n\t\t}\n\n\t\tTypeName ParseSingleTypeName(Optional<TypeName> containingType = default(Optional<TypeName>))\n\t\t{\n\t\t\tvar typeName = new TypeName(containingType, _tokens[_idx++], ParsePossibleGenericArguments().ToImmutableList());\n\t\t\treturn typeName;\n\t\t}\n\n\t\tList<TypeName> ParsePossibleGenericArguments()\n\t\t{\n\t\t\tvar genericArugments = NoTypes;\n\t\t\tif (_idx >= _tokens.Count || !(Cur == \"<\"))\n\t\t\t\treturn genericArugments;\n\t\t\t_idx++; //Skip '<'\n\t\t\twhile (!(Cur == \">\"))\n\t\t\t{\n\t\t\t\tgenericArugments.Add(ParseTypeName());\n\t\t\t\tif (Cur == \",\")\n\t\t\t\t{\n\t\t\t\t\t_idx++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t_idx++; //Skip '>'\n\t\t\treturn genericArugments;\n\t\t}\n\n\t\tvoid ParsePossibleDot()\n\t\t{\n\t\t\tif (_idx < _tokens.Count && Cur == \".\")\n\t\t\t\t_idx++;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/TypeNameTokenizer.cs",
    "content": "﻿using Uno;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class TypeNameTokenizer\n\t{\n\t\treadonly string _name;\n\t\tint _idx;\n\t\treadonly List<string> _tokens = new List<string>();\n\n\t\tpublic static List<string> Tokenize(string name)\n\t\t{\n\t\t\tvar tokenizer = new TypeNameTokenizer(name);\n\t\t\ttokenizer.Tokenize();\n\t\t\treturn tokenizer._tokens;\n\t\t}\n\n\t\tpublic static bool IsSpecialChar(char c)\n\t\t{\n\t\t\treturn c == '.' || c == '<' || c == '>' || c == ',';\n\t\t}\n\n\t\tTypeNameTokenizer(string name)\n\t\t{\n\t\t\t_name = name;\n\t\t}\n\n\t\tvoid Tokenize()\n\t\t{\n\t\t\twhile (_idx < _name.Length)\n\t\t\t{\n\t\t\t\tswitch (_name[_idx]) {\n\t\t\t\t\tcase '.':\n\t\t\t\t\t\t_tokens.Add(\".\");\n\t\t\t\t\t\t_idx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '<':\n\t\t\t\t\t\t_tokens.Add(\"<\");\n\t\t\t\t\t\t_idx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '>':\n\t\t\t\t\t\t_tokens.Add(\">\");\n\t\t\t\t\t\t_idx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ',':\n\t\t\t\t\t\t_tokens.Add(\",\");\n\t\t\t\t\t\t_idx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tReadName();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid ReadName()\n\t\t{\n\t\t\tvar end = _idx + 1;\n\t\t\twhile (end < _name.Length && !IsSpecialChar(_name[end]))\n\t\t\t{\n\t\t\t\tend++;\n\t\t\t}\n\t\t\t_tokens.Add(_name.Substring(_idx, end - _idx));\n\t\t\t_idx = end;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Bytecode/Variable.cs",
    "content": "using Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator.Bytecode\n{\n\tpublic class Variable : IEquatable<Variable>\n\t{\n\t\tpublic readonly string Name;\n\n\t\tpublic static readonly Variable This = new Variable(\"this\");\n\n\t\tpublic Variable(string name)\n\t\t{\n\t\t\tName = name;\n\t\t}\n\n\t\tpublic bool Equals(Variable other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn String.Equals(Name, other.Name);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is Variable && Equals((Variable)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn (Name != null ? Name.GetHashCode() : 0);\n\t\t}\n\n\t\tpublic static bool operator ==(Variable left, Variable right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(Variable left, Variable right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Name;\n\t\t}\n\n\t\tpublic static readonly Action<Variable, BinaryWriter> Write = _Write;\n\n\t\tpublic static void _Write( Variable v, BinaryWriter writer)\n\t\t{\n\t\t\tv._Write(writer);\n\t\t}\n\n\t\tpublic void _Write(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(Name);\n\t\t}\n\n\t\tpublic static readonly Func<BinaryReader, Variable> Read = _Read;\n\n\t\tpublic static Variable _Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new Variable(\n\t\t\t\treader.ReadString());\n\t\t}\n\n\t\tpublic static string GetName(Variable arg)\n\t\t{\n\t\t\treturn arg.Name;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/BinaryMessage.cs",
    "content": "using System;\nusing Uno;\nusing System.IO;\nusing Uno.Compiler.ExportTargetInterop;\n\nnamespace Outracks\n{\n\tpublic interface IBinaryMessage\n\t{\n\t\tstring Type { get; }\n\n\t\tvoid WriteDataTo(BinaryWriter writer);\n\t}\n\n\tpublic static class BinaryMessage\n\t{\n\t\tpublic static Optional<T> TryParse<T>(this IBinaryMessage message, string type, Func<BinaryReader, T> action)\n\t\t{\n\t\t\tif (type != message.Type)\n\t\t\t\treturn Optional.None<T>();\n\n\t\t\tusing (var buffer = new Uno.IO.MemoryStream())\n\t\t\tusing (var bufferWriter = new BinaryWriter(buffer))\n\t\t\tusing (var bufferReader = new BinaryReader(buffer))\n\t\t\t{\n\t\t\t\tmessage.WriteDataTo(bufferWriter);\n\t\t\t\tbuffer.Seek(0, Uno.IO.SeekOrigin.Begin);\n\t\t\t\treturn action(bufferReader);\n\t\t\t}\n\n\t\t\tthrow new Exception(\"It has happened.\");\n\t\t}\n\n\t\tpublic static T[] SubArray<T>(this T[] data, int index, int length)\n\t\t{\n\t\t\tT[] result = new T[length];\n\t\t\tArray.Copy(data, index, result, 0, length);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static extern IBinaryMessage ReadFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar type = reader.ReadString();\n\t\t\tvar length = reader.ReadInt32();\n\t\t\tvar data = reader.ReadBytes(length);\n\t\t\treturn Compose(type, new WriteClosure { Data = data }.Execute);\n\t\t}\n\n\t\tclass WriteClosure\n\t\t{\n\t\t\tpublic byte[] Data;\n\n\t\t\tpublic void Execute(BinaryWriter writer)\n\t\t\t{\n\t\t\t\twriter.Write(Data);\n\t\t\t}\n\t\t}\n\n\t\tpublic static extern void WriteTo(this IBinaryMessage message, BinaryWriter writer)\n\t\t{\n\t\t\tusing (var buffer = new Uno.IO.MemoryStream())\n\t\t\tusing (var bufferWriter = new BinaryWriter(buffer))\n\t\t\t{\n\t\t\t\tmessage.WriteDataTo(bufferWriter);\n\t\t\t\tvar length = (int) buffer.Position;\n\n\t\t\t\twriter.Write(message.Type);\n\t\t\t\twriter.Write(length);\n\t\t\t\twriter.Write(buffer.GetBuffer().SubArray(0, length));\n\t\t\t}\n\t\t}\n\n\t\tpublic static extern IBinaryMessage Compose(string type, Action<BinaryWriter> write)\n\t\t{\n\t\t\treturn new ComposedMessage()\n\t\t\t{\n\t\t\t\tType = type,\n\t\t\t\tWrite = write,\n\t\t\t};\n\t\t}\n\n\t\tclass ComposedMessage : IBinaryMessage\n\t\t{\n\t\t\tpublic string Type { get; set; }\n\t\t\tpublic Action<BinaryWriter> Write { get; set; }\n\n\t\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t\t{\n\t\t\t\tWrite(writer);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Common/CharacterNumber.cs",
    "content": "using Uno;\n\nnamespace Outracks.Simulator\n{\n\t/// <summary>\n\t/// 1-indexed column/character index.\n\t/// One tab advances one Character.\n\t/// One multi-byte character advances one Character.\n\t/// The first character of a line will always have Character == 1, indifferent of CR.\n\t/// </summary>\n\tpublic struct CharacterNumber //: IComparable<CharacterNumber>, IEquatable<CharacterNumber>\n\t{\n\t\treadonly int _characterMinusOne;\n\n\t\tpublic CharacterNumber(int character)\n\t\t{\n\t\t\tif (character <= 0) throw new ArgumentOutOfRangeException(\"character\", \"CharacterNumber must be >= 1\");\n\t\t\t_characterMinusOne = character - 1;\n\t\t}\n\n\t\tpublic static implicit operator int(CharacterNumber line)\n\t\t{\n\t\t\treturn line._characterMinusOne + 1;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ((int) this).ToString();\n\t\t}\n\n\t\tpublic bool Equals(CharacterNumber other)\n\t\t{\n\t\t\treturn _characterMinusOne == other._characterMinusOne;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is CharacterNumber && Equals((CharacterNumber)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator ==(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator <(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne < right._characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne > right._characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator <=(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne <= right._characterMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >=(CharacterNumber left, CharacterNumber right)\n\t\t{\n\t\t\treturn left._characterMinusOne >= right._characterMinusOne;\n\t\t}\n\n\t\t/*\n\t\tpublic int CompareTo(CharacterNumber other)\n\t\t{\n\t\t\treturn _characterMinusOne.CompareTo(other._characterMinusOne);\n\t\t}\n\t\t*/\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/Closure.cs",
    "content": "using System;\nusing Uno.Collections;\nusing Uno;\nusing Uno.Platform;\n\nnamespace Outracks.Simulator\n{\n\tpublic static class Closure\n\t{\n\t\tpublic static Action<TArg2> ApplyFirst<TArg1, TArg2>(Action<TArg1, TArg2> action, TArg1 arg1)\n\t\t{\n\t\t\treturn new ApplyFirst<TArg1, TArg2>(action, arg1).Execute;\n\t\t}\n\n\t\tpublic static Action<TArg1> ApplySecond<TArg1, TArg2>(Action<TArg1, TArg2> action, TArg2 arg2)\n\t\t{\n\t\t\treturn new ApplySecond<TArg1, TArg2>(action, arg2).Execute;\n\t\t}\n\n\t\tpublic static Func<TArg, TResult> Return<TArg, TResult>(TResult result)\n\t\t{\n\t\t\treturn new Forget<TArg, TResult>(result).Execute;\n\t\t}\n\n\t\tpublic static Action Apply<T>(this Action<T> action, T arg)\n\t\t{\n\t\t\treturn new Apply<T>(action, arg).Execute;\n\t\t}\n\n\t\tpublic static Action<TArg1, TArg2> Forget<TArg1, TArg2>(this Action action)\n\t\t{\n\t\t\treturn new ForgetAction<TArg1, TArg2>(action).Execute;\n\t\t}\n\n\t\tpublic static EventHandler ToEventHandler(this Action action)\n\t\t{\n\t\t\treturn new ForgetAction<object, EventArgs>(action).Execute;\n\t\t}\n\n\t\tpublic static ApplicationStateTransitionHandler ToAppStateChangeHandler(this Action action)\n\t\t{\n\t\t\treturn new ForgetAction<ApplicationState>(action).Execute;\n\t\t}\n\t}\n\n\n\tclass Forget<TArg, TResult>\n\t{\n\t\treadonly TResult _result;\n\t\tpublic Forget(TResult result)\n\t\t{\n\t\t\t_result = result;\n\t\t}\n\n\t\tpublic TResult Execute(TArg _)\n\t\t{\n\t\t\treturn _result;\n\t\t}\n\t}\n\n\tpublic class ForgetAction<TArg1>\n\t{\n\t\treadonly Action _action;\n\n\t\tpublic ForgetAction(Action action)\n\t\t{\n\t\t\t_action = action;\n\t\t}\n\n\t\tpublic void Execute(TArg1 arg1)\n\t\t{\n\t\t\t_action();\n\t\t}\n\t}\n\n\n\tpublic class ForgetAction<TArg1, TArg2>\n\t{\n\t\treadonly Action _action;\n\n\t\tpublic ForgetAction(Action action)\n\t\t{\n\t\t\t_action = action;\n\t\t}\n\n\t\tpublic void Execute(TArg1 arg1, TArg2 arg2)\n\t\t{\n\t\t\t_action();\n\t\t}\n\t}\n\n\tclass Forget<TArg1, TArg2, TResult>\n\t{\n\t\treadonly TResult _result;\n\t\tpublic Forget(TResult result)\n\t\t{\n\t\t\t_result = result;\n\t\t}\n\n\t\tpublic TResult Execute(TArg1 arg1, TArg2 arg2)\n\t\t{\n\t\t\treturn _result;\n\t\t}\n\t}\n\n\tclass Apply<TArg1>\n\t{\n\t\treadonly Action<TArg1> _action;\n\t\treadonly TArg1 _arg1;\n\n\t\tpublic Apply(Action<TArg1> action, TArg1 arg1)\n\t\t{\n\t\t\t_action = action;\n\t\t\t_arg1 = arg1;\n\t\t}\n\n\t\tpublic void Execute()\n\t\t{\n\t\t\t_action(_arg1);\n\t\t}\n\t}\n\n\tclass ApplyFirst<TArg1, TArg2>\n\t{\n\t\treadonly Action<TArg1, TArg2> _action;\n\t\treadonly TArg1 _arg1;\n\t\tpublic ApplyFirst(Action<TArg1, TArg2> action, TArg1 arg1)\n\t\t{\n\t\t\t_action = action;\n\t\t\t_arg1 = arg1;\n\t\t}\n\n\t\tpublic void Execute(TArg2 arg2)\n\t\t{\n\t\t\t_action(_arg1, arg2);\n\t\t}\n\t}\n\n\tclass ApplySecond<TArg1, TArg2>\n\t{\n\t\treadonly Action<TArg1, TArg2> _action;\n\t\treadonly TArg2 _arg2;\n\t\tpublic ApplySecond(Action<TArg1, TArg2> action, TArg2 arg2)\n\t\t{\n\t\t\t_action = action;\n\t\t\t_arg2 = arg2;\n\t\t}\n\n\t\tpublic void Execute(TArg1 arg1)\n\t\t{\n\t\t\t_action(arg1, _arg2);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/simulator/common/Common/ConcurrentQueue.cs",
    "content": "using Uno;\nusing Uno.Collections;\n\nusing Uno.Threading;\n\nnamespace Outracks.Simulator\n{\n\tpublic class ConcurrentQueue<T>\n\t{\n\t\treadonly Queue<T> _queue;\n\t\treadonly object _mutex;\n\n\t\tpublic ConcurrentQueue()\n\t\t{\n\t\t\t_queue = new Queue<T>();\n\t\t\t_mutex = new object();\n\t\t}\n\n\t\tpublic void Enqueue(T data)\n\t\t{\n\t\t\tlock (_mutex)\n\t\t\t\t_queue.Enqueue(data);\n\t\t}\n\n\t\tpublic bool TryDequeue(out T data)\n\t\t{\n\t\t\tbool result = false;\n\t\t\tdata = default(T);\n\t\t\tlock (_mutex)\n\t\t\t{\n\t\t\t\tif (_queue.Count != 0)\n\t\t\t\t{\n\t\t\t\t\tdata = _queue.Dequeue();\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Common/ImmutableList.cs",
    "content": "using System;\nusing Uno.Collections;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator\n{\n\tpublic class ImmutableList<T> : IEnumerable<T>\n\t{\n\t\tpublic static ImmutableList<T> Empty\n\t\t{\n\t\t\tget { return new ImmutableList<T>(new T[0]); }\n\t\t}\n\n\n\t\treadonly T[] _array;\n\t\tinternal ImmutableList(T[] array)\n\t\t{\n\t\t\t_array = array;\n\t\t}\n\n\t\tpublic int Count\n\t\t{\n\t\t\tget { return _array.Length; }\n\t\t}\n\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\treturn ((IEnumerable<T>)_array).GetEnumerator();\n\t\t}\n\n\t\tpublic ImmutableList<T> Add(T element)\n\t\t{\n\t\t\tvar copy = new T[Count + 1];\n\t\t\tArray.Copy(_array, copy, Count);\n\t\t\tcopy[Count] = element;\n\t\t\treturn new ImmutableList<T>(copy);\n\t\t}\n\n\t\tpublic ImmutableList<T> InsertRange(int index, IEnumerable<T> items)\n\t\t{\n\t\t\tvar itemsArray = items.ToArray();\n\t\t\tvar copy = new T[Count + itemsArray.Length];\n\t\t\tfor (int i = 0; i < itemsArray.Length; i++)\n\t\t\t\tcopy[i] = itemsArray[i];\n\t\t\tfor (int i = 0; i < Count; i++)\n\t\t\t\tcopy[itemsArray.Length + i] = _array[i];\n\t\t\treturn new ImmutableList<T>(copy);\n\t\t}\n\n\t\tpublic ImmutableList<T> Replace(T element, T replacement)\n\t\t{\n\t\t\tvar copy = new T[Count];\n\t\t\tfor (int i = 0; i < Count; i++)\n\t\t\t\tcopy[i] = _array[i].Equals(element)\n\t\t\t\t\t? replacement\n\t\t\t\t\t: _array[i];\n\t\t\treturn new ImmutableList<T>(copy);\n\t\t}\n\n\t\tpublic T Get(int i)\n\t\t{\n\t\t\treturn _array[i];\n\t\t}\n\n\t\tpublic T this[int i]\n\t\t{\n\t\t\tget { return _array[i]; }\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"[\" + ((IEnumerable<T>)this).JoinToString(\", \") + \"]\";\n\t\t}\n\t}\n\n\n\tpublic static class List\n\t{\n\t\tpublic static ImmutableList<T> ToList<T>(this Optional<T> element)\n\t\t{\n\t\t\tif (!element.HasValue)\n\t\t\t\treturn ImmutableList<T>.Empty;\n\n\t\t\tvar array = new T[1];\n\t\t\tarray[0] = element.Value;\n\t\t\treturn new ImmutableList<T>(array);\n\t\t}\n\n\t\tpublic static ImmutableList<T> Create<T>(params T[] elements)\n\t\t{\n\t\t\treturn new ImmutableList<T>(elements); // TODO: consider if we should copy array\n\t\t}\n\n\t\tpublic static ImmutableList<T> ToImmutableList<T>(this IEnumerable<T> self)\n\t\t{\n\t\t\treturn new ImmutableList<T>(self.ToArray());\n\t\t}\n\n\t\tpublic static void Write<T>(ImmutableList<T> array, BinaryWriter writer, Action<T, BinaryWriter> elementWriter)\n\t\t{\n\t\t\tWrite(writer, array, elementWriter);\n\t\t}\n\n\t\tpublic static void Write<T>(this BinaryWriter writer, IEnumerable<T> array, Action<T, BinaryWriter> elementWriter)\n\t\t{\n\t\t\twriter.Write(array.Count());\n\t\t\tforeach (var elm in array)\n\t\t\t\telementWriter(elm, writer);\n\t\t}\n\n\t\tpublic static void Write<T>(this BinaryWriter writer, ImmutableList<T> array, Action<T, BinaryWriter> elementWriter)\n\t\t{\n\t\t\twriter.Write(array.Count);\n\t\t\tforeach (var elm in array)\n\t\t\t\telementWriter(elm, writer);\n\t\t}\n\n\t\tpublic static ImmutableList<T> Read<T>(BinaryReader reader, Func<BinaryReader, T> elementReader)\n\t\t{\n\t\t\treturn ReadImmutableList(reader, elementReader);\n\t\t}\n\n\t\tpublic static void WriteImmutableList(BinaryWriter writer, IEnumerable<object> elements, Action<object> writeElement)\n\t\t{\n\t\t\tvar elementsArray = elements.ToArray();\n\t\t\twriter.Write(elementsArray.Length);\n\t\t\tforeach (var element in elementsArray)\n\t\t\t\twriteElement(element);\n\t\t}\n\n\t\tpublic static ImmutableList<T> ReadImmutableList<T>(this BinaryReader reader, Func<BinaryReader, T> elementReader)\n\t\t{\n\t\t\tvar array = new T[reader.ReadInt32()];\n\t\t\tfor (int i = 0; i < array.Length; i++)\n\t\t\t\tarray[i] = elementReader(reader);\n\t\t\treturn new ImmutableList<T>(array);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/LineNumber.cs",
    "content": "using Uno;\n\nnamespace Outracks.Simulator\n{\n\t/// <summary>\n\t/// 1-indexed line number\n\t/// </summary>\n\tpublic struct LineNumber //: IComparable<LineNumber>, IEquatable<LineNumber>\n\t{\n\t\treadonly int _lineMinusOne;\n\n\t\tpublic LineNumber(int line)\n\t\t{\n\t\t\tif (line <= 0) throw new ArgumentOutOfRangeException(\"line\", \"LineNumber must be >= 1\");\n\t\t\t_lineMinusOne = line - 1;\n\t\t}\n\n\t\tpublic static implicit operator int(LineNumber line)\n\t\t{\n\t\t\treturn line._lineMinusOne + 1;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn ((int)this).ToString();\n\t\t}\n\n\t\tpublic bool Equals(LineNumber other)\n\t\t{\n\t\t\treturn _lineMinusOne == other._lineMinusOne;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is LineNumber && Equals((LineNumber)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator ==(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator <(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne < right._lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne > right._lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator <=(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne <= right._lineMinusOne;\n\t\t}\n\n\t\tpublic static bool operator >=(LineNumber left, LineNumber right)\n\t\t{\n\t\t\treturn left._lineMinusOne >= right._lineMinusOne;\n\t\t}\n\n\t\t/*\n\t\tpublic int CompareTo(LineNumber other)\n\t\t{\n\t\t\treturn _lineMinusOne.CompareTo(other._lineMinusOne);\n\t\t}\n\t\t*/\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/MissingStuff.cs",
    "content": "﻿using Uno;\nusing System.IO;\nusing Uno.Compiler.ExportTargetInterop;\n\nnamespace System.IO\n{\n\t[DotNetType]\n\tpublic class BinaryWriter : IDisposable\n\t{\n\t\treadonly Uno.IO.BinaryWriter _writer;\n\n\t\tpublic void Write(float value) { _writer.Write(value); }\n\t\tpublic void Write(double value) { _writer.Write(value); }\n\n\t\tpublic void Write(string value) { _writer.Write(value); }\n\t\tpublic void Write(int value) { _writer.Write(value); }\n\t\tpublic void Write(char value) { _writer.Write(value); }\n\t\tpublic void Write(bool value) { _writer.Write(value); }\n\t\tpublic void Write(byte[] bytes) { _writer.Write(bytes); }\n\n\t\tpublic BinaryWriter(Uno.IO.Stream stream) { _writer = new Uno.IO.BinaryWriter(stream); }\n\t\tpublic void Dispose() { _writer.Dispose(); }\n\t}\n}\n\nnamespace System.IO\n{\n\t[DotNetType]\n\tpublic class BinaryReader : IDisposable\n\t{\n\t\treadonly Uno.IO.BinaryReader _reader;\n\n\t\tpublic float ReadSingle() { return _reader.ReadFloat(); }\n\t\tpublic double ReadDouble() { return _reader.ReadDouble(); }\n\n\t\tpublic string ReadString() { return _reader.ReadString(); }\n\t\tpublic int ReadInt32() { return _reader.ReadInt(); }\n\t\tpublic char ReadChar() { return _reader.ReadChar(); }\n\t\tpublic bool ReadBoolean() { return _reader.ReadBoolean(); }\n\t\tpublic byte[] ReadBytes(int length) { return _reader.ReadBytes(length); }\n\t\tpublic BinaryReader(Uno.IO.Stream stream) { _reader = new Uno.IO.BinaryReader(stream); }\n\n\t\tpublic void Dispose() { _reader.Dispose(); }\n\t}\n}\n\nnamespace Outracks.Simulator\n{\n\tpublic static class GuidSerializer\n\t{\n\t\t// TODO: Uno.Guid lacks to/from byte array. Should have used that.\n\t\t// TODO2: Uno lacks the ability to add overloads by means of extension methods, so this can't be named Write(). Should have been named that.\n\t\tpublic static void WriteGuid(this BinaryWriter writer, Guid guid)\n\t\t{\n\t\t\twriter.Write(guid.ToString());\n\t\t}\n\n\t\tpublic static Guid ReadGuid(this BinaryReader reader)\n\t\t{\n\t\t\treturn new Guid(reader.ReadString());\n\t\t}\n\t}\n\n\tstatic class Serialization\n\t{\n\t\tpublic static Func<BinaryReader, string> ReadString = _ReadString;\n\n\t\tpublic static string _ReadString(this BinaryReader reader)\n\t\t{\n\t\t\treturn reader.ReadString();\n\t\t}\n\t}\n\n\tpublic class DummyApplication : Application\n\t{\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Common/Optionals/Operators/Combine.cs",
    "content": "﻿using System;\nusing Uno;\n\nnamespace Outracks\n{\n\tpublic static partial class Optional\n\t{\n\t\tpublic static Optional<T5> Combine<T1, T2, T3, T4, T5>(Optional<T1> o1, Optional<T2> o2, Optional<T3> o3, Optional<T4> o4, Func<T1,T2,T3,T4,T5> combine)\n\t\t{\n\t\t\tif (o1.HasValue && o2.HasValue && o3.HasValue && o4.HasValue)\n\t\t\t\treturn combine(o1.Value, o2.Value, o3.Value, o4.Value);\n\n\t\t\treturn None();\n\t\t}\n\n\t\tpublic static Optional<T3> Combine<T1, T2, T3>(Optional<T1> o1, Optional<T2> o2, Func<T1, T2, T3> o3)\n\t\t{\n\t\t\tif (o1.HasValue && o2.HasValue)\n\t\t\t\treturn o3(o1.Value, o2.Value);\n\n\t\t\treturn None();\n\t\t}\n\n\t\tpublic static Optional<Tuple<T1, T2, T3>> Combine<T1, T2, T3>(Optional<T1> o1, Optional<T2> o2, Optional<T3> o3)\n\t\t{\n\t\t\tif (o1.HasValue && o2.HasValue && o3.HasValue)\n\t\t\t\treturn Tuple.Create(o1.Value, o2.Value, o3.Value);\n\n\t\t\treturn None();\n\t\t}\n\t\tpublic static Optional<Tuple<T1, T2>> Combine<T1, T2>(Optional<T1> o1, Optional<T2> o2)\n\t\t{\n\t\t\tif (o1.HasValue && o2.HasValue)\n\t\t\t\treturn Tuple.Create(o1.Value, o2.Value);\n\n\t\t\treturn None();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/Optionals/Operators/Or.cs",
    "content": "﻿using Uno;\nusing Uno.Collections;\n\nnamespace Outracks\n{\n\tpublic static partial class Optional\n\t{\n\t\tpublic static T Or<T>(this Optional<T> self, T fallback)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? self.Value\n\t\t\t\t: fallback;\n\t\t}\n\n\t\tpublic static Optional<T> Or<T>(this Optional<T> self, Optional<T> fallback)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? self\n\t\t\t\t: fallback;\n\t\t}\n\n\t\tpublic static T Or<T>(this Optional<T> self, Func<T> fallback)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? self.Value\n\t\t\t\t: fallback();\n\t\t}\n\n\t\tpublic static Optional<T> Or<T>(this Optional<T> self, Func<Optional<T>> fallback)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? Some(self.Value)\n\t\t\t\t: fallback();\n\t\t}\n\n\t\tpublic static T OrDefault<T>(this Optional<T> self)\n\t\t{\n\t\t\treturn self.Or(default(T));\n\t\t}\n\n\t\tpublic static IEnumerable<T> OrEmpty<T>(this Optional<IEnumerable<T>> self)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? self.Value\n\t\t\t\t: new T[0];\n\t\t}\n\n\t\tpublic static T OrThrow<T>(this Optional<T> self)\n\t\t{\n\t\t\treturn self.Value;\n\t\t}\n\n\t\tpublic static T OrThrow<T>(this Optional<T> self, Exception e)\n\t\t{\n\t\t\tif (!self.HasValue)\n\t\t\t\tthrow e;\n\t\t\treturn self.Value;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/Optionals/Operators/Select.cs",
    "content": "﻿using System;\nusing Uno;\n\nnamespace Outracks\n{\n\tpublic static partial class Optional\n\t{\n\t\tpublic static Optional<TResult> Select<T, TResult>(this Optional<T> self, Func<T, TResult> transform)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? Optional.Some(transform(self.Value))\n\t\t\t\t: Optional.None<TResult>();\n\t\t}\n\n\t\tpublic static Optional<TResult> SelectMany<T, TResult>(this Optional<T> self, Func<T, Optional<TResult>> transform)\n\t\t{\n\t\t\treturn self.HasValue\n\t\t\t\t? transform(self.Value)\n\t\t\t\t: Optional.None<TResult>();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/Optionals/Operators/Serialization.cs",
    "content": "﻿using System;\nusing Uno;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic static partial class Optional\n\t{\n\t\tpublic static Optional<T> Read<T>(BinaryReader reader, Func<T> readSome)\n\t\t{\n\t\t\treturn reader.ReadBoolean()\n\t\t\t\t? Optional.Some(readSome())\n\t\t\t\t: Optional.None<T>();\n\t\t}\n\n\t\tpublic static Optional<T> Read<T>(BinaryReader reader, Func<BinaryReader, T> readSome)\n\t\t{\n\t\t\treturn reader.ReadBoolean()\n\t\t\t\t? Optional.Some(readSome(reader))\n\t\t\t\t: Optional.None<T>();\n\t\t}\n\n\t\tpublic static void Write<T>(BinaryWriter writer, Optional<T> optional, Action<BinaryWriter, T> writeSome)\n\t\t{\n\t\t\tif (optional.HasValue)\n\t\t\t{\n\t\t\t\twriter.Write(true);\n\t\t\t\twriteSome(writer, optional.Value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twriter.Write(false);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Write<T>(BinaryWriter writer, Optional<T> optional, Action<T, BinaryWriter> writeSome)\n\t\t{\n\t\t\tif (optional.HasValue)\n\t\t\t{\n\t\t\t\twriter.Write(true);\n\t\t\t\twriteSome(optional.Value, writer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twriter.Write(false);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Write<T>(BinaryWriter writer, Optional<T> optional, Action<T> writeSome)\n\t\t{\n\t\t\tif (optional.HasValue)\n\t\t\t{\n\t\t\t\twriter.Write(true);\n\t\t\t\twriteSome(optional.Value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twriter.Write(false);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/Optionals/Operators/TryGetValue.cs",
    "content": "﻿using Uno;\nusing Uno.Collections;\n\nnamespace Outracks\n{\n\tpublic static partial class Optional\n\t{\n\t\tpublic static Optional<TValue> TryGetValue<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key)\n\t\t{\n\t\t\tTValue value;\n\t\t\tif (dict.TryGetValue(key, out value))\n\t\t\t\treturn Optional.Some<TValue>(value);\n\n\t\t\treturn Optional.None<TValue>();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Common/Optionals/Optional.cs",
    "content": "﻿using System;\nusing Uno;\nusing Uno.Collections;\nusing System.IO;\n\nnamespace Outracks\n{\n\tpublic static class NullToNone\n\t{\n\t\t/// <summary>\n\t\t/// Convert null to None and other values to Some(T)\n\t\t/// </summary>\n\t\tpublic static Optional<T> ToOptional<T>(this T value) where T : class\n\t\t{\n\t\t\treturn value != null\n\t\t\t\t? Optional.Some(value)\n\t\t\t\t: Optional.None();\n\t\t}\n\t}\n\n\tpublic class None\n\t{\n\t}\n\n\tpublic static partial class Optional\n\t{\n\t\tpublic static Optional<T> Some<T>(T value)\n\t\t{\n\t\t\treturn new Optional<T>(true, value);\n\t\t}\n\n\t\tpublic static Optional<T> None<T>()\n\t\t{\n\t\t\treturn new Optional<T>(false);\n\t\t}\n\n\t\tpublic static None None()\n\t\t{\n\t\t\treturn new None();\n\t\t}\n\t}\n\n\tpublic struct Optional<T> : IEquatable<Optional<T>>, IEnumerable<T>\n\t{\n\t\treadonly bool _hasValue;\n\t\treadonly T _value;\n\n\t\tpublic bool HasValue\n\t\t{\n\t\t\tget { return _hasValue; }\n\t\t}\n\n\t\tpublic T Value\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (!_hasValue) throw new InvalidOperationException();\n\t\t\t\treturn _value;\n\t\t\t}\n\t\t}\n\n\t\tinternal Optional(bool hasValue, T value = default(T))\n\t\t{\n\t\t\t_hasValue = hasValue;\n\t\t\t_value = value;\n\t\t}\n\n\t\tpublic Optional<TAs> As<TAs>()\n\t\t{\n\t\t\tif (!_hasValue)\n\t\t\t\treturn Optional.None<TAs>();\n\n\t\t\tif (!(_value is TAs))\n\t\t\t\treturn Optional.None<TAs>();\n\n\t\t\treturn Optional.Some<TAs>((TAs)(object)_value);\n\t\t}\n\n\t\tpublic static implicit operator Optional<T>(T value)\n\t\t{\n\t\t\treturn new Optional<T>(true, value);\n\t\t}\n\n\t\tpublic static implicit operator Optional<T>(None value)\n\t\t{\n\t\t\treturn new Optional<T>(false, default(T));\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Optional<T> && Equals((Optional<T>)obj);\n\t\t}\n\n\t\tpublic bool Equals(Optional<T> other)\n\t\t{\n\t\t\tif (_hasValue != other._hasValue)\n\t\t\t\treturn false;\n\n\t\t\tif (Object.ReferenceEquals(_value, null))\n\t\t\t\treturn Object.ReferenceEquals(other._value, null);\n\n\t\t\treturn _value.Equals(other._value);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\tif (!_hasValue || Object.ReferenceEquals(_value, null))\n\t\t\t\t\treturn 0;\n\n\t\t\t\treturn _value.GetHashCode();\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(Optional<T> left, Optional<T> right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Optional<T> left, Optional<T> right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\t//public Optional<TResult> As<TResult>() where TResult : T\n\t\t//{\n\t\t//\treturn _hasValue && _value is TResult\n\t\t//\t\t? Optional.Some((TResult)_value)\n\t\t//\t\t: Optional.None();\n\t\t//}\n\n\t\tpublic Optional<T> Where(Func<T, bool> predicate)\n\t\t{\n\t\t\treturn _hasValue && predicate(_value)\n\t\t\t\t? Optional.Some(_value)\n\t\t\t\t: Optional.None();\n\t\t}\n\n\t\tpublic void Do(Action<T> some)\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\tsome(_value);\n\t\t}\n\n\n\t\tpublic void Do(Action<T> some, Action none)\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\tsome(_value);\n\t\t\telse\n\t\t\t\tnone();\n\t\t}\n\n\t\tpublic void MatchWith(Action<T> some, Action none)\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\tsome(_value);\n\t\t\telse\n\t\t\t\tnone();\n\t\t}\n\n\t\tpublic TResult MatchWith<TResult>(\n\t\t\tFunc<T, TResult> some,\n\t\t\tFunc<TResult> none)\n\t\t{\n\t\t\treturn _hasValue ? some(_value) : none();\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn HasValue\n\t\t\t\t? \"Some {\" + Value + \"}\"\n\t\t\t\t: \"None\";\n\t\t}\n\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\treturn (new T[] { _value }).AsEnumerable().GetEnumerator();\n\n\t\t\treturn (new T[0]).AsEnumerable().GetEnumerator();\n\t\t}\n\n\t\t//IEnumerator IEnumerable.GetEnumerator()\n\t\t//{\n\t\t//\treturn GetEnumerator();\n\t\t//}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/SourceReference.cs",
    "content": "using Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator\n{\n\tpublic class SourceReference\n\t{\n\t\tpublic SourceReference(\n\t\t\tstring file,\n\t\t\tOptional<TextPosition> location)\n\t\t{\n\t\t\tFile = file;\n\t\t\tLocation = location;\n\t\t}\n\n\t\tpublic readonly string File;\n\t\tpublic readonly Optional<TextPosition> Location;\n\n\t\tpublic static SourceReference Read(BinaryReader r)\n\t\t{\n\t\t\tvar file = r.ReadString();\n\t\t\tvar location = Optional.Read(r, (Func<BinaryReader, TextPosition>)TextPosition.Read);\n\n\t\t\treturn new SourceReference(file, location);\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter w, SourceReference s)\n\t\t{\n\t\t\tw.Write(s.File);\n\t\t\tOptional.Write(w, s.Location, (Action<BinaryWriter, TextPosition>)TextPosition.Write);\n\t\t}\n\t}\n\n\tpublic static class SourceReferenceCanonicalization\n\t{\n\t\tpublic static string ToCanonicalForm(this Optional<SourceReference> src)\n\t\t{\n\t\t\treturn src.HasValue ? ToCanonicalForm(src.Value) : \"?\";\n\t\t}\n\n\t\tpublic static string ToCanonicalForm(this SourceReference src)\n\t\t{\n\t\t\treturn src.File +\n\t\t\t\t(src.Location.HasValue\n\t\t\t\t\t? \"(\" + src.Location.Value.ToCanonicalForm() + \")\"\n\t\t\t\t\t: \"\");\n\t\t}\n\n\t\tstatic string ToCanonicalForm(this TextPosition pos)\n\t\t{\n\t\t\treturn pos.Line + \",\" + pos.Character;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/StringExtensions.cs",
    "content": "﻿using Uno.Collections;\nusing Uno;\nusing Uno.Text;\n\nnamespace Outracks.Simulator\n{\n\tpublic static class IndentString\n\t{\n\t\tpublic static string Indent(this string str)\n\t\t{\n\t\t\treturn str.Split('\\n').Select((Func<string, string>)PrefixWithTab).Join(\"\\n\");\n\t\t}\n\n\t\tstatic string PrefixWithTab(string s)\n\t\t{\n\t\t\treturn \"\\t\" + s;\n\t\t}\n\t}\n\n\tpublic static class StringSplitting\n\t{\n\t\tpublic static int OrdinalLastIndexOf(this string str, string seperator)\n\t\t{\n\t\t\tfor (int i = str.Length - seperator.Length; i-- > 0;)\n\t\t\t{\n\t\t\t\tint j = 0;\n\t\t\t\twhile (j < seperator.Length && str[i + j] == seperator[j])\n\t\t\t\t\tj++;\n\t\t\t\tif (j == seperator.Length)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic static int OrdinalIndexOf(this string str, string seperator)\n\t\t{\n\t\t\treturn str.IndexOf(seperator);\n\t\t}\n\n\t\tpublic static string AfterLast(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.OrdinalLastIndexOf(seperator);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new Exception();\n\t\t\treturn s.Substring(index + seperator.Length);\n\t\t}\n\n\t\tpublic static string BeforeLast(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.OrdinalLastIndexOf(seperator);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new Exception();\n\t\t\treturn s.Substring(0, index);\n\n\t\t}\n\n\t\tpublic static string AfterFirst(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.IndexOf(seperator);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new Exception();\n\t\t\treturn s.Substring(index + seperator.Length);\n\t\t}\n\n\t\tpublic static string BeforeFirst(this string s, string seperator)\n\t\t{\n\t\t\tvar index = s.IndexOf(seperator);\n\t\t\tif (index == -1)\n\t\t\t\tthrow new Exception();\n\t\t\treturn s.Substring(0, index);\n\n\t\t}\n\n\t\tpublic static string JoinToString<T>(this IEnumerable<T> objects, string separator)\n\t\t{\n            var sb = new StringBuilder();\n\n\t        var isFirst = true;\n\t\t\tforeach (var obj in objects)\n\t        {\n\t\t        if (isFirst)\n\t\t\t        isFirst = false;\n\t\t\t\telse\n\t\t\t        sb.Append(separator);\n\t\t        sb.Append(obj.ToString());\n\t        }\n\n\t        return sb.ToString();\n\t\t}\n\n        public static string Join(this IEnumerable<string> si, string separator)\n        {\n            var sb = new StringBuilder();\n\n\t        var isFirst = true;\n\t\t\tforeach (var part in si)\n\t        {\n\t\t        if (isFirst)\n\t\t\t        isFirst = false;\n\t\t\t\telse\n\t\t\t        sb.Append(separator);\n\t\t        sb.Append(part);\n\t        }\n\n\t        return sb.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "src/simulator/common/Common/Tasks.cs",
    "content": "using Uno;\nusing Uno.Collections;\n\nusing Uno.Threading;\n\nnamespace Outracks.Simulator\n{\n\tpublic class Task<T>\n\t{\n\t\tinternal readonly Mutex Mutex = new Mutex();\n\n\t\treadonly Action _wait;\n\n\t\tinternal Task(Action wait)\n\t\t{\n\t\t\t_wait = wait;\n\t\t}\n\n\t\tpublic bool IsCompleted { get; internal set; }\n\n\t\tpublic bool IsFaulted { get; internal set; }\n\n\t\tpublic Exception Exception { get; internal set; }\n\n\t\tT _result;\n\t\tpublic T Result\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\t_wait();\n\n\t\t\t\tif (IsFaulted)\n\t\t\t\t\tthrow Exception; // TODO: don't mess up stack trace\n\n\t\t\t\treturn _result;\n\t\t\t}\n\t\t\tinternal set { _result = value; }\n\t\t}\n\t}\n\n\n\tpublic static class Tasks\n\t{\n\t\tpublic static Task<T> WaitForFirstResult<T>(IEnumerable<Task<T>> tasks, Func<IEnumerable<Exception>, T> onNoResult)\n\t\t{\n\t\t\treturn Run<T>(new WaitForFirstResult<T>(tasks, onNoResult).Execute);\n\t\t}\n\n\t\tpublic static Task<T> Run<T>(Func<T> method)\n\t\t{\n\t\t\tvar t = new TaskThread<T>(method);\n\n\t\t\tif defined(DotNet)\n\t\t\t{\n\t\t\t\tt.Thread.IsBackground = true;\n\t\t\t}\n\n\t\t\tt.Thread.Start();\n\n\t\t\treturn t.Task;\n\t\t}\n\t}\n\n\n\tclass TaskThread<T>\n\t{\n\t\tpublic readonly Task<T> Task;\n\t\tpublic readonly Thread Thread;\n\n\t\treadonly Func<T> _func;\n\n\t\tpublic TaskThread(Func<T> func)\n\t\t{\n\t\t\t_func = func;\n\t\t\tThread = new Thread(Run);\n\t\t\tTask = new Task<T>(Thread.Join);\n\t\t}\n\n\t\tvoid Run()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tTask.Result = _func();\n\t\t\t\tTask.IsCompleted = true;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tTask.Exception = e;\n\t\t\t\tTask.IsFaulted = true;\n\t\t\t\tTask.IsCompleted = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tclass WaitForFirstResult<T>\n\t{\n\t\treadonly List<Task<T>> _pending;\n\t\treadonly Func<IEnumerable<Exception>, T> _onNoResult;\n\n\t\tpublic WaitForFirstResult(\n\t\t\tIEnumerable<Task<T>> pending,\n\t\t\tFunc<IEnumerable<Exception>, T> onNoResult)\n\t\t{\n\t\t\t_pending = pending.ToList();\n\t\t\t_onNoResult = onNoResult;\n\t\t}\n\n\t\tpublic T Execute()\n\t\t{\n\t\t\tvar exceptions = new List<Exception>();\n\n\t\t\twhile (_pending.Count != 0)\n\t\t\t{\n\t\t\t\tforeach (var task in _pending.ToArray())\n\t\t\t\t{\n\t\t\t\t\tif (task.IsCompleted)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (task.IsFaulted)\n\t\t\t\t\t\t\texceptions.Add(task.Exception);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn task.Result;\n\n\t\t\t\t\t\t_pending.Remove(task);\n\t\t\t\t\t}\n\n\t\t\t\t\tThread.Sleep(10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn _onNoResult(exceptions);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/simulator/common/Common/TextOffset.cs",
    "content": "using Uno;\n\nnamespace Outracks.Simulator\n{\n\tpublic class TextOffset //: IComparable<TextOffset>\n\t{\n\t\treadonly int _offset;\n\n\t\tpublic TextOffset(int offset)\n\t\t{\n\t\t\t_offset = offset;\n\t\t}\n\n\t\tpublic static implicit operator int(TextOffset d)\n\t\t{\n\t\t\treturn d._offset;\n\t\t}\n\n\t\t/*\n\t\tpublic int CompareTo(TextOffset other)\n\t\t{\n\t\t\treturn _offset.CompareTo(other._offset);\n\t\t}\n\t\t*/\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"@\"+_offset;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _offset.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is TextOffset && Equals((TextOffset)obj);\n\t\t}\n\n\t\tpublic bool Equals(TextOffset other)\n\t\t{\n\t\t\treturn _offset == other._offset;\n\t\t}\n\n\t\tpublic static bool operator ==(TextOffset a, TextOffset b)\n\t\t{\n\t\t\tif ((object)a == null)\n\t\t\t\treturn (object)b == null;\n\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic static bool operator !=(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\n\t\tpublic static bool operator <(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset < b._offset;\n\t\t}\n\n\t\tpublic static bool operator >(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset > b._offset;\n\t\t}\n\n\t\tpublic static bool operator <=(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset <= b._offset;\n\t\t}\n\n\t\tpublic static bool operator >=(TextOffset a, TextOffset b)\n\t\t{\n\t\t\treturn a._offset >= b._offset;\n\t\t}\n\t}\n\n\t/*public static class TextIntervalLength\n\t{\n\t\tpublic static int Length(this Interval<TextOffset> interval)\n\t\t{\n\t\t\tvar min = interval.MinExcluded ? interval.Min + 1 : interval.Min;\n\t\t\tvar max = interval.MaxExcluded ? interval.Max + 1 : interval.Max;\n\n\t\t\treturn max - min;\n\t\t}\n\t}*/\n}"
  },
  {
    "path": "src/simulator/common/Common/TextOffsetConversion.cs",
    "content": "using Uno;\n\nnamespace Outracks.Simulator\n{\n\tpublic static class TextOffsetConversion\n\t{\n\t\t/// <summary>\n\t\t/// Returns the offset in the data string based on this text position.\n\t\t/// A multi-byte character advances the offset with one.\n\t\t/// A newline advances the offset with one, and offset is not affected by CR.\n\t\t/// </summary>\n\t\t/// <returns></returns>\n\t\t//[Pure]\n\t\tpublic static TextOffset ToOffset(this TextPosition pos, string data)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(data))\n\t\t\t\tthrow new ArgumentNullException(data);\n\n\t\t\tvar lines = data.Split('\\n');\n\t\t\tif (pos.Line < 1 || pos.Line > lines.Length)\n\t\t\t\tthrow new IndexOutOfRangeException(); //(\"Text offset is out of range\");\n\n\t\t\tvar sizeOfDataBefore = 0;\n\t\t\tfor (var i = 0; i < pos.Line - 1; ++i)\n\t\t\t{\n\t\t\t\tsizeOfDataBefore += lines[i].Replace(\"\\r\", \"\").Length + 1;\n\t\t\t}\n\n\t\t\tvar line = lines[pos.Line - 1].Replace(\"\\r\", \"\");\n\t\t\tif (pos.Character < 1 || pos.Character - 1 > line.Length)\n\t\t\t\tthrow new IndexOutOfRangeException(); //(\"Text offset is out of range\");\n\n\t\t\treturn new TextOffset(sizeOfDataBefore + pos.Character - 1);\n\t\t}\n\n\t\t//[Pure]\n\t\tpublic static TextPosition ToPosition(this TextOffset offset, string data)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(data))\n\t\t\t\tthrow new ArgumentNullException(data);\n\n\t\t\tvar lines = data.Replace(\"\\r\", \"\").Split('\\n');\n\t\t\tvar numLinesBeforeOffset = 0;\n\t\t\tvar pos = 0;\n\t\t\tfor (var i = 0; i < lines.Length; ++i)\n\t\t\t{\n\t\t\t\tif (offset < pos + lines[i].Length + 1)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t++numLinesBeforeOffset;\n\t\t\t\tpos += lines[i].Length + 1;\n\t\t\t}\n\n\t\t\tvar character = offset - pos;\n\n\t\t\treturn new TextPosition(\n\t\t\t\tnew LineNumber(numLinesBeforeOffset + 1),\n\t\t\t\tnew CharacterNumber(character + 1));\n\t\t}\n\n\t\t//[Pure]\n\t\tpublic static TextPosition OffsetBy(this TextPosition pos, int characters, string code)\n\t\t{\n\t\t\treturn new TextOffset(pos.ToOffset(code) + characters).ToPosition(code);\n\t\t}\n\n\t\t/*\n\t\t//[Pure]\n\t\tpublic static TextRegion OffsetBy(this TextRegion region, int characters, string code)\n\t\t{\n\t\t\treturn new TextRegion(\n\t\t\t\tregion.From.OffsetBy(characters, code),\n\t\t\t\tregion.To.OffsetBy(characters, code));\n\t\t}\n\t\t*/\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Common/TextPosition.cs",
    "content": "using Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator\n{\n\tpublic struct TextPosition //: IEquatable<TextPosition>\n\t{\n\t\tpublic readonly LineNumber Line;\n\t\tpublic readonly CharacterNumber Character;\n\n\t\tpublic TextPosition(LineNumber line, CharacterNumber character)\n\t\t{\n\t\t\tLine = line;\n\t\t\tCharacter = character;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Line + \":\" + Character;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn Line.GetHashCode() ^ Character.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\treturn obj is TextPosition && Equals((TextPosition)obj);\n\t\t}\n\n\t\tpublic bool Equals(TextPosition other)\n\t\t{\n\t\t\treturn Line == other.Line && Character == other.Character;\n\t\t}\n\n\t\tpublic static bool operator ==(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic static bool operator !=(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\n\t\tpublic static bool operator <(TextPosition a, TextPosition b)\n\t\t{\n\t\t\tif (a.Line < b.Line) return true;\n\t\t\tif (a.Line > b.Line) return false;\n\t\t\treturn a.Character < b.Character;\n\t\t}\n\n\t\tpublic static bool operator >(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn a != b && !(a < b);\n\t\t}\n\n\t\tpublic static bool operator <=(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn  a == b || a < b;\n\t\t}\n\n\t\tpublic static bool operator >=(TextPosition a, TextPosition b)\n\t\t{\n\t\t\treturn a == b || a > b;\n\t\t}\n\n\t\tpublic static TextPosition Read(BinaryReader reader)\n\t\t{\n\t\t\tvar line = reader.ReadInt32();\n\t\t\tvar character = reader.ReadInt32();\n\t\t\treturn new TextPosition(\n\t\t\t\tnew LineNumber(line),\n\t\t\t\tnew CharacterNumber(character));\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, TextPosition value)\n\t\t{\n\t\t\twriter.Write(value.Line);\n\t\t\twriter.Write(value.Character);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/simulator/common/EmptyClass.cs",
    "content": "﻿namespace Outracks.Simulator\n{\n\tpublic class EmptyClass\n\t{\n\t\tpublic EmptyClass ()\n\t\t{\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "src/simulator/common/Messages/BytecodeGenerated.cs",
    "content": "using System.IO;\nusing Uno;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tusing Bytecode;\n\n\tpublic sealed class BytecodeGenerated : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"BytecodeGenerated\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic ProjectBytecode Bytecode { get; private set; }\n\n\t\tpublic BytecodeGenerated(ProjectBytecode bytecode)\n\t\t{\n\t\t\tBytecode = bytecode;\n\t\t}\n\n\t\tBytecodeGenerated() { }\n\n\t\tpublic static string BinaryFormat\n\t\t{\n\t\t\tget { return \"bc4\"; } // change this whenever write changes\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\tBytecode.WriteDataTo(writer);\n\t\t}\n\n\t\tpublic static BytecodeGenerated ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar bytecode = ProjectBytecode.ReadDataFrom(reader);\n\t\t\treturn new BytecodeGenerated(bytecode);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"BytecodeGenerated: \" + Bytecode.Reify.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Messages/BytecodeUpdated.cs",
    "content": "using System.IO;\nusing Uno;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic sealed class BytecodeUpdated : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"BytecodeUpdated\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic Lambda Function { get; private set; }\n\n\t\tpublic BytecodeUpdated(Lambda function)\n\t\t{\n\t\t\tFunction = function;\n\t\t}\n\n\t\tBytecodeUpdated() { }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\tLambda.Write(Function, writer);\n\t\t}\n\n\t\tpublic static BytecodeUpdated ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar function = Lambda.Read(reader);\n\n\t\t\treturn new BytecodeUpdated(function);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"BytecodeUpdated: \" + Function.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Messages/DebugLog.cs",
    "content": "using System;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tusing Bytecode;\n\n\tpublic sealed class DebugLog : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"DebugLog\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic string DeviceId { get; private set; }\n\t\tpublic string DeviceName { get; private set; }\n\t\tpublic string Message { get; private set; }\n\n\t\tpublic DebugLog(string deviceId, string deviceName, string message)\n\t\t{\n\t\t\tDeviceId = deviceId;\n\t\t\tDeviceName = deviceName;\n\t\t\tMessage = message;\n\t\t}\n\t\tDebugLog() { }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(DeviceId);\n\t\t\twriter.Write(DeviceName);\n\t\t\twriter.Write(Message);\n\t\t}\n\n\t\tpublic static DebugLog ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar deviceId = reader.ReadString();\n\t\t\tvar deviceName = reader.ReadString();\n\t\t\tvar message = reader.ReadString();\n\t\t\treturn new DebugLog(deviceId, deviceName, message);\n\t\t}\n\t}\n\n\n\tpublic sealed class TriggerProgress : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"TriggerProgress\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\t\tpublic double Progress { get; private set; }\n\n\t\tpublic TriggerProgress(double progress)\n\t\t{\n\t\t\tProgress = progress;\n\t\t}\n\t\tTriggerProgress() { }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(Progress);\n\t\t}\n\n\t\tpublic static TriggerProgress ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar progress = reader.ReadDouble();\n\t\t\treturn new TriggerProgress(progress);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Messages/Diagnostic.cs",
    "content": "﻿using System;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic enum DiagnosticType\n\t{\n\t\tError,\n\t\tWarning,\n\t\tInternalError,\n\t\tDeprecated,\n\t\tUnsupported,\n\t\tPerformanceWarning\n\t}\n\n\tpublic sealed class Diagnostic : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"Diagnostic\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic DiagnosticType DiagnosticType { get; private set; }\n\n\t\tpublic string DeviceId { get; private set; }\n\t\tpublic string DeviceName { get; private set; }\n\n\t\tstatic int _idEnumerator = 0;\n\t\t/// <summary>\n\t\t/// An int that uniquely this diagnostic in the context of this DeviceId.\n\t\t/// Temporal diagnostics can be dismissed later by sending a DismissDiagnostic message with this ID.\n\t\t/// </summary>\n\t\tpublic int DiagnosticId { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Appropriate value to display in diagnostic listing\n\t\t/// </summary>\n\t\tpublic string Message { get; private set; }\n\n\t\t/// <summary>\n\t\t/// All details of this diagnostic\n\t\t/// </summary>\n\t\tpublic string Details { get; private set; }\n\n\t\t/// <summary>\n\t\t/// Project-releative path to the source file for this diagnostic\n\t\t/// If SourceFile is null, LineNumber/ColumnNumber is not used\n\t\t/// </summary>\n\t\tpublic string SourceFile { get; private set; }\n\n\t\t/// <summary>\n\t\t/// The line number whithin the SourceFile of the diagnostic.\n\t\t///\n\t\t/// If SourceFile is null, this property is not used\n\t\t/// </summary>\n\t\tpublic int LineNumber { get; private set; }\n\n\t\t/// <summary>\n\t\t/// The column number whithin the SourceFile and LineNumber of the diagnostic.\n\t\t///\n\t\t/// If SourceFile is null, this property is not used\n\t\t/// If -1, the whole line is the source.\n\t\t/// </summary>\n\t\tpublic int ColumnNumber { get; private set; }\n\n\n\t\t/// <summary>\n\t\t///\n\t\t/// </summary>\n\t\t/// <param name=\"deviceId\"></param>\n\t\t/// <param name=\"deviceName\"></param>\n\t\t/// <param name=\"message\"></param>\n\t\t/// <param name=\"details\"></param>\n\t\t/// <param name=\"sourceFile\"></param>\n\t\t/// <param name=\"lineNumber\"></param>\n\t\t/// <param name=\"columnNumber\"></param>\n\t\t/// <param name=\"diagnosticId\">Pass -1 to get an auto-generated Id</param>\n\t\tpublic Diagnostic(string deviceId, string deviceName, string message, string details, string sourceFile, int lineNumber, int columnNumber, int diagnosticId = -1)\n\t\t{\n\t\t\tDeviceId = deviceId;\n\t\t\tDeviceName = deviceName;\n\t\t\tDiagnosticId = (diagnosticId == -1 ? _idEnumerator++ : diagnosticId);\n\t\t\tMessage = message;\n\t\t\tDetails = details ?? \"\";\n\t\t\tSourceFile = sourceFile ?? \"\";\n\t\t\tLineNumber = lineNumber;\n\t\t\tColumnNumber = columnNumber;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(DeviceId);\n\t\t\twriter.Write(DeviceName);\n\t\t\twriter.Write(Message);\n\t\t\twriter.Write(Details);\n\t\t\twriter.Write(SourceFile);\n\t\t\twriter.Write(LineNumber);\n\t\t\twriter.Write(ColumnNumber);\n\t\t\twriter.Write(DiagnosticId);\n\t\t}\n\n\t\tpublic static Diagnostic ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar deviceId = reader.ReadString();\n\t\t\tvar deviceName = reader.ReadString();\n\t\t\tvar message = reader.ReadString();\n\t\t\tvar details = NullIfEmpty(reader.ReadString());\n\t\t\tvar sourceFile = NullIfEmpty(reader.ReadString());\n\t\t\tvar lineNumber = reader.ReadInt32();\n\t\t\tvar columnNumber = reader.ReadInt32();\n\t\t\tvar diagnosticId = reader.ReadInt32();\n\t\t\treturn new Diagnostic(deviceId, deviceName, message, details, sourceFile, lineNumber, columnNumber, diagnosticId);\n\t\t}\n\n\t\tstatic string NullIfEmpty(string s)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(s)) return null;\n\t\t\treturn s;\n\t\t}\n\t}\n\n\tpublic sealed class DismissDiagnostic : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"DismissDiagnostic\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic string DeviceId { get; private set; }\n\t\tpublic string DeviceName { get; private set; }\n\n\t\t/// <summary>\n\t\t/// A GUID that identifies this diagnostic to dismiss.\n\t\t/// </summary>\n\t\tpublic int DiagnosticId { get; private set; }\n\n\t\tpublic DismissDiagnostic(string deviceId, string deviceName, int diagnosticId)\n\t\t{\n\t\t\tDeviceId = deviceId;\n\t\t\tDeviceName = deviceName;\n\t\t\tDiagnosticId = diagnosticId;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(DeviceId);\n\t\t\twriter.Write(DeviceName);\n\t\t\twriter.Write(DiagnosticId);\n\t\t}\n\n\t\tpublic static DismissDiagnostic ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar deviceId = reader.ReadString();\n\t\t\tvar deviceName = reader.ReadString();\n\t\t\tvar diagnosticId = reader.ReadInt32();\n\t\t\treturn new DismissDiagnostic(deviceId, deviceName, diagnosticId);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Messages/Error.cs",
    "content": "using System.IO;\nusing Uno;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic sealed class Error : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"Error\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic ExceptionInfo Exception { get; private set; }\n\n\t\tpublic Error(ExceptionInfo exception)\n\t\t{\n\t\t\tException = exception;\n\t\t}\n\t\tError() { }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\tExceptionInfo.Write(Exception, writer);\n\t\t}\n\n\t\tpublic static Error ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tdebug_log \"Read Error\";\n\n\t\t\tvar exception = ExceptionInfo.Read(reader);\n\t\t\treturn new Error(exception);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"Error: \" + Exception.Message.ToString();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Messages/ExceptionInfo.cs",
    "content": "using System.IO;\nusing Uno;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic sealed class ExceptionInfo\n\t{\n\t\tpublic readonly TypeName Type;\n\t\tpublic readonly string Message;\n\t\tpublic readonly string StackTrace;\n\t\tpublic readonly ImmutableList<ExceptionInfo> InnerExceptions;\n\n\t\tpublic ExceptionInfo(\n\t\t\tTypeName type,\n\t\t\tstring message,\n\t\t\tstring stackTrace,\n\t\t\tImmutableList<ExceptionInfo> innerExceptions)\n\t\t{\n\t\t\tType = type;\n\t\t\tMessage = message;\n\t\t\tStackTrace = stackTrace;\n\t\t\tInnerExceptions = innerExceptions;\n\t\t}\n\t\tpublic static ExceptionInfo Capture(Exception e)\n\t\t{\n\t\t\treturn new ExceptionInfo(\n\t\t\t\tTypeName.Parse(e.GetType().ToString()),\n\t\t\t\te.Message,\n\t\t\t\te.StackTrace,\n\t\t\t\tImmutableList<ExceptionInfo>.Empty);\n\t\t\t//new ImmutableList<ExceptionInfo>(\n\t\t\t\t//\te.InnerException == null\n\t\t\t\t//\t\t? new Error[0]\n\t\t\t\t//\t\t: new Error[] { ExceptionInfo.Capture(e.InnerException) }));\n\t\t}\n\n\t\tpublic static void Write(ExceptionInfo e, BinaryWriter writer)\n\t\t{\n\t\t\tTypeName.Write(e.Type, writer);\n\t\t\twriter.Write(e.Message);\n\t\t\twriter.Write(e.StackTrace);\n\t\t\tList.Write<ExceptionInfo>(writer, e.InnerExceptions, ExceptionInfo.Write);\n\t\t}\n\n\t\tpublic static ExceptionInfo Read(BinaryReader reader)\n\t\t{\n\t\t\tvar type = TypeName.Read(reader);\n\t\t\tvar message = reader.ReadString();\n\t\t\tvar stackTrace = reader.ReadString();\n\t\t\tvar innerExceptions = List.Read<ExceptionInfo>(reader, ExceptionInfo.Read);\n\t\t\treturn new ExceptionInfo(type, message, stackTrace, innerExceptions);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Messages/RegisterName.cs",
    "content": "using System;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tusing Bytecode;\n\n\tpublic sealed class Ready : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"Ready\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t}\n\n\t\tpublic static Ready ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new Ready();\n\t\t}\n\t}\n\n\tpublic sealed class RegisterName : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"RegisterName\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic string DeviceId { get; private set; }\n\t\tpublic string DeviceName { get; private set; }\n\n\t\tpublic RegisterName(string deviceId, string deviceName)\n\t\t{\n\t\t\tDeviceId = deviceId;\n\t\t\tDeviceName = deviceName;\n\t\t}\n\n\t\tRegisterName() {}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(DeviceId);\n\t\t\twriter.Write(DeviceName);\n\t\t}\n\n\t\tpublic static RegisterName ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar deviceId = reader.ReadString();\n\t\t\tvar deviceName = reader.ReadString();\n\t\t\treturn new RegisterName(deviceId, deviceName);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Messages/UnhandledException.cs",
    "content": "using System;\nusing System.IO;\nusing Uno;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tusing Bytecode;\n\n\tpublic sealed class UnhandledException : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"UnhandledException\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic string DeviceId { get; private set; }\n\t\tpublic string DeviceName { get; private set; }\n\t\tpublic string Message { get; private set; }\n\t\tpublic string StackTrace { get; private set; }\n\t\tpublic string ExceptionType { get; private set; }\n\n\t\tpublic UnhandledException(\n\t\t\tstring deviceId,\n\t\t\tstring deviceName,\n\t\t\tstring message,\n\t\t\tstring stackTrace,\n\t\t\tstring type)\n\t\t{\n\t\t\tDeviceId = deviceId;\n\t\t\tDeviceName = deviceName;\n\t\t\tMessage = message;\n\t\t\tStackTrace = stackTrace;\n\t\t\tExceptionType = type;\n\t\t}\n\t\tUnhandledException() { }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(DeviceId);\n\t\t\twriter.Write(DeviceName);\n\t\t\twriter.Write(Message);\n\t\t\twriter.Write(StackTrace);\n\t\t\twriter.Write(Type);\n\t\t}\n\n\t\tpublic static UnhandledException ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\tvar deviceId = reader.ReadString();\n\t\t\tvar deviceName = reader.ReadString();\n\t\t\tvar message = reader.ReadString();\n\t\t\tvar stackTrace = reader.ReadString();\n\t\t\tvar type = reader.ReadString();\n\t\t\treturn new UnhandledException(deviceId, deviceName, message, stackTrace, type);\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/simulator/common/ObjectIdentifier.cs",
    "content": "﻿using Uno;\nusing System.IO;\n\nnamespace Outracks.Simulator\n{\n\tpublic sealed class ObjectIdentifier : IEquatable<ObjectIdentifier>\n\t{\n\t\tpublic static readonly ObjectIdentifier None = new ObjectIdentifier(\"N/A\", 0);\n\n\t\tpublic static void Write(ObjectIdentifier id, BinaryWriter writer)\n\t\t{\n\t\t\tid.Write(writer);\n\t\t}\n\n\t\tpublic void Write(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(_string);\n\t\t\twriter.Write(Document);\n\t\t}\n\n\t\tpublic static ObjectIdentifier Read(BinaryReader reader)\n\t\t{\n\t\t\tvar str = reader.ReadString();\n\t\t\tvar document = reader.ReadString();\n\n\t\t\treturn new ObjectIdentifier(\n\t\t\t\tstr: str,\n\t\t\t\tdocument: document);\n\t\t}\n\n\t\tpublic readonly string Document;\n\n\t\treadonly string _string;\n\n\t\tpublic ObjectIdentifier(string document, int tagIndex)\n\t\t{\n\t\t\t_string = document + \"#\" + tagIndex;\n\t\t\tDocument = document;\n\t\t}\n\n\t\tpublic ObjectIdentifier(string str, string document = \"N/A\")\n\t\t{\n\t\t\t_string = str;\n\t\t\tDocument = document;\n\t\t}\n\n\t\tpublic bool Equals(ObjectIdentifier other)\n\t\t{\n\t\t\tif (ReferenceEquals(null, other)) return false;\n\t\t\tif (ReferenceEquals(this, other)) return true;\n\t\t\treturn _string.Equals(other._string);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\treturn obj is ObjectIdentifier && Equals((ObjectIdentifier)obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn _string.GetHashCode();\n\t\t}\n\n\t\tpublic static bool operator ==(ObjectIdentifier left, ObjectIdentifier right)\n\t\t{\n\t\t\treturn Equals(left, right);\n\t\t}\n\n\t\tpublic static bool operator !=(ObjectIdentifier left, ObjectIdentifier right)\n\t\t{\n\t\t\treturn !Equals(left, right);\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn _string;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Outracks.Simulator.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{3335BB78-0B8A-4D2F-919F-2E6F08883D51}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Simulator</RootNamespace>\n    <AssemblyName>Outracks.Simulator.Protocol</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>bin\\</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <ItemGroup>\n    <None Include=\"Bytecode\\Exceptions.cs\" />\n    <None Include=\"Bytecode\\Expression.cs\" />\n    <None Include=\"Bytecode\\ExpressionIdRegistry.cs\" />\n    <None Include=\"Bytecode\\Expressions.cs\" />\n    <None Include=\"Bytecode\\Lambda.cs\" />\n    <None Include=\"Bytecode\\Literal.cs\" />\n    <None Include=\"Bytecode\\LiteralIdRegistry.cs\" />\n    <None Include=\"Bytecode\\Literals.cs\" />\n    <None Include=\"Bytecode\\MethodGroup.cs\" />\n    <None Include=\"Bytecode\\NamespaceName.cs\" />\n    <None Include=\"Bytecode\\Parameter.cs\" />\n    <None Include=\"Bytecode\\ProjectBytecode.cs\" />\n    <None Include=\"Bytecode\\ProjectDependency.cs\" />\n    <None Include=\"Bytecode\\ProjectMetadata.cs\" />\n    <None Include=\"Bytecode\\Signature.cs\" />\n    <None Include=\"Bytecode\\Statement.cs\" />\n    <None Include=\"Bytecode\\StatementIdRegistry.cs\" />\n    <None Include=\"Bytecode\\Statements.cs\" />\n    <None Include=\"Bytecode\\StaticMemberName.cs\" />\n    <None Include=\"Bytecode\\TypeMemberName.cs\" />\n    <None Include=\"Bytecode\\TypeName.cs\" />\n    <None Include=\"Bytecode\\TypeNameParser.cs\" />\n    <None Include=\"Bytecode\\TypeNameTokenizer.cs\" />\n    <None Include=\"Bytecode\\Variable.cs\" />\n    <None Include=\"Common\\BinaryMessage.cs\" />\n    <None Include=\"Common\\CharacterNumber.cs\" />\n    <None Include=\"Common\\Closure.cs\" />\n    <None Include=\"Common\\ImmutableList.cs\" />\n    <None Include=\"Common\\LineNumber.cs\" />\n    <None Include=\"Common\\MissingStuff.cs\" />\n    <None Include=\"Common\\SourceReference.cs\" />\n    <None Include=\"Common\\StringExtensions.cs\" />\n    <None Include=\"Common\\TextOffset.cs\" />\n    <None Include=\"Common\\TextOffsetConversion.cs\" />\n    <None Include=\"Common\\TextPosition.cs\" />\n    <None Include=\"Messages\\DebugLog.cs\" />\n    <None Include=\"Messages\\Diagnostic.cs\" />\n    <None Include=\"Messages\\Error.cs\" />\n    <None Include=\"Messages\\ExceptionInfo.cs\" />\n    <None Include=\"Messages\\RegisterName.cs\" />\n    <None Include=\"Messages\\UnhandledException.cs\" />\n    <None Include=\"Runtime\\*.cs\" />\n    <None Include=\"Runtime\\IReflection.cs\" />\n    <None Include=\"EmptyClass.cs\" />\n    <None Include=\"ObjectIdentifier.cs\" />\n    <None Include=\"*.uno\" />\n    <None Include=\"*.ux\" />\n    <None Include=\"*.unoproj\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Messages\\BytecodeGenerated.cs\" />\n    <None Include=\"Messages\\BytecodeUpdated.cs\" />\n    <None Include=\"Bytecode\\Exceptions.cs\" />\n    <None Include=\"Common\\Optionals\\Operators\\Combine.cs\" />\n    <None Include=\"Common\\Optionals\\Operators\\Or.cs\" />\n    <None Include=\"Common\\Optionals\\Operators\\Select.cs\" />\n    <None Include=\"Common\\Optionals\\Operators\\Serialization.cs\" />\n    <None Include=\"Common\\Optionals\\Operators\\TryGetValue.cs\" />\n    <None Include=\"Common\\Optionals\\Optional.cs\" />\n  </ItemGroup>\n  <PropertyGroup>\n    <PostBuildEvent>\n      pushd $(SolutionDir)\n      node_modules\\.bin\\uno build dotnet -DLIBRARY -DPREVIEW -DDESIGNER -DREFLECTION \"$(ProjectDir)\\Outracks.Simulator.unoproj\" --configuration=$(Configuration) --output-dir=$(ProjectDir)$(OutDir) --no-strip\n      popd\n    </PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "src/simulator/common/Outracks.Simulator.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Bytecode_005CNames/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Common/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/simulator/common/Outracks.Simulator.unoproj",
    "content": "{\n    \"Packages\": [\n        \"Uno.Collections\",\n        \"Uno.Threading\",\n        \"Uno.Net.Sockets\"\n    ],\n    \"Includes\": [\n        \"*.cs:SourceFile\",\n        \"Bytecode/*.cs:SourceFile\",\n        \"Common/*.uxl\",\n        \"Common/*.cs:SourceFile\",\n        \"Common/Optionals/*.cs:SourceFile\",\n        \"Common/Optionals/Operators/*.cs:SourceFile\",\n        \"Messages/*.cs:SourceFile\",\n        \"Runtime/*.cs:SourceFile\",\n    ]\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/ArrayStream.cs",
    "content": "﻿using System;\nusing Uno;\nusing Uno.IO;\nusing Uno.Collections;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tpublic class ArrayStream : Uno.IO.Stream\n\t{\n\t\tprivate byte[] _buffer = new byte[0];\n\t\tprivate int _nextIncrease = 256;\n\t\tprivate long _length;\n\n\n\t\tpublic override bool CanRead\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool CanWrite\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool CanSeek\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tpublic override bool CanTimeout\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic override long Length\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _length;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Capacity\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _buffer.Length;\n\t\t\t}\n\t\t}\n\n\t\tpublic override long Position { get; set; }\n\n\t\tpublic ArrayStream(byte[] buffer)\n\t\t{\n\t\t\t_buffer = buffer;\n\t\t\t_length = _buffer.Length;\n\t\t}\n\n\t\tpublic override void Write(byte[] src, int byteOffset, int byteCount)\n\t\t{\n\t\t\tEnsureCapacity(byteCount);\n\t\t\tfor (int i = byteOffset; i < byteOffset + byteCount; i++)\n\t\t\t{\n\t\t\t\t_buffer[(int)Position] = src[i];\n\t\t\t\tPosition += 1;\n\t\t\t}\n\t\t\tif (Position > Length)\n\t\t\t{\n\t\t\t\t_length = Position;\n\t\t\t}\n\t\t}\n\n\t\tpublic override int Read(byte[] dst, int byteOffset, int byteCount)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tfor (; i < byteCount && Position + i < Length; i++)\n\t\t\t{\n\t\t\t\tdst[i + byteOffset] = _buffer[(int)Position + i];\n\t\t\t}\n\t\t\tPosition += i;\n\t\t\treturn i;\n\t\t}\n\n\t\tpublic override long Seek(long byteOffset, SeekOrigin origin)\n\t\t{\n\t\t\tswitch (origin)\n\t\t\t{\n\t\t\t\tcase SeekOrigin.Begin:\n\t\t\t\t\tPosition = byteOffset;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SeekOrigin.End:\n\t\t\t\t\tPosition = Length + byteOffset;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tPosition = Position + byteOffset;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn Position;\n\t\t}\n\n\t\tprivate void EnsureCapacity(int byteCount)\n\t\t{\n\t\t\tif (Position + byteCount <= Capacity)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (Position + byteCount <= Capacity + _nextIncrease)\n\t\t\t{\n\t\t\t\tResizeTo(Capacity + _nextIncrease);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tResizeTo((int)Position + byteCount);\n\t\t\t}\n\t\t}\n\n\t\tprivate void ResizeTo(int newSize)\n\t\t{\n\t\t\tvar newBuffer = new byte[newSize];\n\t\t\tArray.Copy(_buffer, newBuffer, _buffer.Length);\n\t\t\t_buffer = newBuffer;\n\t\t\t_nextIncrease = Capacity;\n\t\t}\n\n\t\tpublic virtual byte[] GetBuffer()\n\t\t{\n\t\t\treturn _buffer;\n\t\t}\n\n\t\tpublic override void SetLength(long value)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic override void Flush()\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/Bundle.cs",
    "content": "using Uno.Collections;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tpublic static class Bundle\n\t{\n\t\tstatic Uno.IO.Bundle _bundle;\n\t\tpublic static void Initialize(string projectName)\n\t\t{\n\t\t\t_bundle = Uno.IO.Bundle.Get(projectName);\n\t\t}\n\n\t\textern(PREVIEW)\n\t\tpublic static void AddOrUpdateFile(string projectRelativeFilePath, byte[] data)\n\t\t{\n\t\t\t// Must change TypeScript extension to JavaScript for Fuselibs to pick it up.\n\t\t\tif (projectRelativeFilePath.EndsWith(\".ts\"))\n\t\t\t\tprojectRelativeFilePath = projectRelativeFilePath.Substring(0, projectRelativeFilePath.Length - 3) + \".js\";\n\n\t\t\tforeach (var exisitingFile in _bundle.Files)\n\t\t\t{\n\t\t\t\tif (exisitingFile.SourcePath == projectRelativeFilePath)\n\t\t\t\t{\n\t\t\t\t\t//debug_log \"Update \" + projectRelativeFilePath + \" with \" + data.Length + \" bytes\";\n\t\t\t\t\texisitingFile.Update(data);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//debug_log \"Create \" + projectRelativeFilePath + \" with \" + data.Length + \" bytes\";\n\t\t\t_bundle.CreateFile(projectRelativeFilePath, data);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/FileCache.cs",
    "content": "using Uno;\nusing Uno.UX;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tpublic class FileCache\n\t{\n\t\tstatic readonly Dictionary<string, UxFileSource> _cache = new Dictionary<string, UxFileSource>();\n\n\t\tpublic static void Update(string path, byte[] bytes)\n\t\t{\n\t\t\tUxFileSource fs = null;\n\t\t\tif (_cache.TryGetValue(path, out fs))\n\t\t\t\tfs.Update(bytes);\n\t\t\telse\n\t\t\t\t_cache[path] = new UxFileSource(path, bytes);\n\t\t}\n\n\t\tpublic static UxFileSource GetFileSource(string path)\n\t\t{\n\t\t\treturn _cache[path];\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/IReflection.cs",
    "content": "using Uno;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tusing Bytecode;\n\n\tpublic class MemberNotFound : Exception\n\t{\n\t\tpublic readonly string Type;\n\t\tpublic readonly string Member;\n\n\t\tpublic MemberNotFound(string type, string member)\n\t\t\t: base(\"Member '\" + member + \"' could not be found on object of type '\" + type + \"'\")\n\t\t{\n\t\t\tType = type;\n\t\t\tMember = member;\n\t\t}\n\t}\n\n\tpublic class TypeNotFound : Exception\n\t{\n\t\tpublic readonly string Type;\n\n\t\tpublic TypeNotFound(string type)\n\t\t\t: base(\"Type '\" + type + \"' could not be found (recompile required?)\")\n\t\t{\n\t\t\tType = type;\n\t\t}\n\t}\n\n\tpublic class UnambiguousMethodNotFound : Exception\n\t{\n\t\tpublic readonly string Type;\n\t\tpublic readonly string Member;\n\n\t\tpublic UnambiguousMethodNotFound(string type, string member)\n\t\t\t: base(\"Call to '\" + member + \"' method is ambigious on object of type '\" + type + \"'\")\n\t\t{\n\t\t\tType = type;\n\t\t\tMember = member;\n\t\t}\n\t}\n\n\tpublic interface IReflection\n\t{\n\t\tobject CallDynamic(object instance, string methodName, params object[] arguments);\n\t\tobject CallStatic(string typeName, string methodName, params object[] arguments);\n\n\t\tvoid SetPropertyValue(object instance, string propertyName, object value);\n\t\tobject GetPropertyValue(object instance, string propertyName);\n\n\t\tobject GetStaticPropertyOrFieldValue(string typeName, string memberName);\n\n\t\tobject CreateDelegate(object instance, string methodName, string[] methodArgumentTypes, string delegateTypeName);\n\n\t\tvoid AddEventHandler(object instance, string member, object handlerDelegate);\n\t\tvoid RemoveEventHandler(object instance, string member, object handlerDelegate);\n\n\t\tobject Instantiate(string typeName, params object[] args);\n\t\tbool IsSubtype(object obj, string typeName);\n\t\tbool IsType(object obj, string typeName);\n\t\tobject GetEnumValue(string enumType, string valueName);\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Runtime/ObjectTagRegistry.cs",
    "content": "﻿using System;\nusing Uno;\nusing Uno.IO;\nusing Uno.Net;\nusing Uno.UX;\nusing Uno.Collections;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tusing Protocol;\n\n\tpublic static class ObjectTagRegistry\n\t{\n\t\tstatic int _visualId = 0;\n\t\tstatic readonly Dictionary<string, List<object>> _tagToObjects = new Dictionary<string, List<object>>();\n\n\t\tpublic static Dictionary<string, List<object>> TagToObjects { get { return _tagToObjects; } }\n\t\tpublic static Dictionary<object, string> ObjectToTag = new Dictionary<object,string>();\n\n\t\tpublic static event Action<object, int, string> OnObjectTagRegistered;\n\n\n\t\tpublic static void Clear()\n\t\t{\n\t\t\tTagToObjects.Clear();\n\t\t\tObjectToTag.Clear();\n\t\t}\n\n\t\tpublic static object RegisterObjectTag(object obj, string tagHash)\n\t\t{\n\t\t\tList<object> objects = null;\n\t\t\tif (!_tagToObjects.TryGetValue(tagHash, out objects))\n\t\t\t\t_tagToObjects[tagHash] = objects = new List<object>();\n\n\t\t\tobjects.Add(obj);\n\n\t\t\tObjectToTag[obj] = tagHash;\n\n\t\t\tif (OnObjectTagRegistered != null)\n\t\t\t\tOnObjectTagRegistered(obj, ++_visualId, tagHash);\n\n\t\t\tforeach (var each in _eaches)\n\t\t\t\teach.OnObjectCreated(tagHash, obj);\n\n\n\t\t\treturn obj;\n\t\t}\n\n\t\tpublic static void DisposeAndUnregister(string tag)\n\t\t{\n\t\t\tvar objects = GetObjectsWithTag(tag);\n\t\t\t_tagToObjects.Remove(tag);\n\n\t\t\tforeach (var obj in objects)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar disposable = obj as IDisposable;\n\t\t\t\t\tif (disposable != null)\n\t\t\t\t\t\tdisposable.Dispose();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tdebug_log e.ToString();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static void TryExecuteOnObjectsWithTag(string tag, Action<object> action)\n\t\t{\n\t\t\tforeach (var obj in GetObjectsWithTag(tag))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\taction(obj);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tdebug_log e.ToString();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static object GetFirstObjectWithTag(string tag)\n\t\t{\n\t\t\tforeach (var obj in GetObjectsWithTag(tag))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treturn obj;\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tdebug_log\n\t\t\t\t\te.ToString();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static IEnumerable<object> GetObjectsWithTag(string tag)\n\t\t{\n\t\t\tList<object> objects = null;\n\t\t\tif (_tagToObjects.TryGetValue(tag, out objects))\n\t\t\t\treturn objects;\n\n\t\t\treturn new object[0];\n\t\t}\n\n\n\t\tpublic static string GetTagHash(object obj)\n\t\t{\n\t\t\tstring tagHash = null;\n\t\t\tObjectToTag.TryGetValue(obj, out tagHash);\n\t\t\treturn tagHash;\n\t\t}\n\n\t\tpublic static IDisposable Each(string tag, Func<object, object> func)\n\t\t{\n\t\t\tvar each = new CurrentEach\n\t\t\t{\n\t\t\t\t_id = tag,\n\t\t\t\t_func = func,\n\t\t\t};\n\n\t\t\tforeach (var obj in GetObjectsWithTag(tag))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\teach.OnObjectCreated(obj);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tdebug_log e.ToString();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_eaches.Add(each);\n\n\t\t\treturn each;\n\t\t}\n\n\t\tstatic List<CurrentEach> _eaches = new List<CurrentEach>();\n\n\t\tclass CurrentEach : IDisposable\n\t\t{\n\t\t\tpublic string _id;\n\t\t\tpublic Func<object, object> _func;\n\n\t\t\treadonly List<IDisposable> _garbage = new List<IDisposable>();\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\t_eaches.Remove(this);\n\t\t\t\tforeach (var disposable in _garbage)\n\t\t\t\t\tdisposable.Dispose();\n\t\t\t}\n\n\t\t\tpublic void OnObjectCreated(string id, object obj)\n\t\t\t{\n\t\t\t\tif (id != _id)\n\t\t\t\t\treturn;\n\n\t\t\t\tOnObjectCreated(obj);\n\t\t\t}\n\n\t\t\tpublic void OnObjectCreated(object obj)\n\t\t\t{\n\t\t\t\tvar disposable = _func(obj) as IDisposable;\n\t\t\t\tif (disposable != null)\n\t\t\t\t\t_garbage.Add(disposable);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/Scope.cs",
    "content": "using Uno;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tusing Bytecode;\n\n\t// This object is mutable because it can be captured by lambdas before all variables are bound due to function scoping\n\tpublic sealed class Environment\n\t{\n\t\treadonly Dictionary<Variable, object> _variableBindings = new Dictionary<Variable, object>();\n\n\t\treadonly Optional<Environment> _parent;\n\n\t\tpublic Environment(Optional<Environment> parent)\n\t\t{\n\t\t\t_parent = parent;\n\t\t}\n\n\t\tpublic void Bind( ImmutableList<Parameter> parameters, object[] arguments)\n\t\t{\n\t\t\tfor (int i = 0; i < parameters.Count; i++)\n\t\t\t\tBind(parameters.Get(i).Name, arguments[i]);\n\t\t}\n\n\t\tpublic void Bind(Variable variable, object value)\n\t\t{\n\t\t\t_variableBindings.Add(variable, value);\n\t\t}\n\n\t\tpublic object GetValue(Variable variable)\n\t\t{\n\t\t\tobject value;\n\t\t\tif (_variableBindings.TryGetValue(variable, out value))\n\t\t\t\treturn value;\n\n\t\t\tif (_parent.HasValue)\n\t\t\t\treturn _parent.Value.GetValue(variable);\n\n\t\t\tthrow new VariableNotBound(variable);\n\t\t}\n\t}\n\n\tpublic class VariableNotBound : Exception\n\t{\n\t\tpublic readonly Variable Variable;\n\n\t\tpublic VariableNotBound(Variable variable)\n\t\t\t: base(\"Element '\" + variable.Name + \"' was referenced before it was initialized\")\n\t\t{\n\t\t\tVariable = variable;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Runtime/UxFileSource.cs",
    "content": "using Uno;\nusing Uno.UX;\nusing Uno.IO;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tpublic class UxFileSource : FileSource\n\t{\n\t\tbyte[] _bytes;\n\n\t\tpublic UxFileSource(string path, byte[] bytes)\n\t\t\t: base(path)\n\t\t{\n\t\t\t_bytes = bytes;\n\t\t}\n\n\t\tpublic void Update(byte[] newBytes)\n\t\t{\n\t\t\t_bytes = newBytes;\n\t\t\tOnDataChanged();\n\t\t}\n\n\t\tpublic override Stream OpenRead()\n\t\t{\n\t\t\t// TODO: this should be MemoryStream. ArrayStream is temp and defined in Simulator.Common\n\t\t\treturn new ArrayStream(_bytes);\n\t\t}\n\n\t\tpublic override byte[] ReadAllBytes()\n\t\t{\n\t\t\treturn _bytes;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/UxProperty.cs",
    "content": "using Uno;\nusing Uno.UX;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tpublic class UxProperty<T> : Property<T>\n\t{\n\t\treadonly Action<object, object, object> _setter;\n\t\treadonly Func<object, object> _getter;\n\t\treadonly Uno.UX.PropertyObject _obj;\n\t\treadonly bool _supportsOriginSetter;\n\n\t\tpublic UxProperty(\n\t\t\tAction<object, object, object> setter,\n\t\t\tFunc<object, object> getter,\n\t\t\tUno.UX.PropertyObject obj,\n\t\t\tstring name,\n\t\t\tbool supportsOriginSetter)\n\t\t\t: base(new Uno.UX.Selector(name))\n\t\t{\n\t\t\t_setter = setter;\n\t\t\t_getter = getter;\n\t\t\t_obj = obj;\n\t\t\t_supportsOriginSetter = supportsOriginSetter;\n\t\t}\n\n\t\tpublic override Uno.UX.PropertyObject Object\n\t\t{\n\t\t\tget { return _obj; }\n\t\t}\n\n\t\tpublic override bool SupportsOriginSetter\n\t\t{\n\t\t\tget { return _supportsOriginSetter; }\n\t\t}\n\n\t\textern(DESIGNER)\n\t\tpublic override void Set(Uno.UX.PropertyObject obj, T value, Uno.UX.IPropertyListener origin)\n\t\t{\n\t\t\t_setter(obj, value, origin);\n\t\t}\n\n\t\textern(DESIGNER)\n\t\tpublic override T Get(PropertyObject obj)\n\t\t{\n\t\t\tvar res = _getter(obj);\n\t\t\treturn res == null ? (typeof(T) == typeof(string) ? (T)(object)\"\" : default(T)) : (T)res;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/UxTemplate.cs",
    "content": "using Uno;\nusing Uno.UX;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tpublic class UxTemplate : Template\n\t{\n\t\treadonly Func<object> _create;\n\n\t\tpublic UxTemplate(\n\t\t\tFunc<object> create,\n\t\t\tstring matchCase,\n\t\t\tbool isDefault)\n\t\t\t: base (matchCase, isDefault)\n\t\t{\n\t\t\t_create = create;\n\t\t}\n\n\t\tpublic override object New()\n\t\t{\n\t\t\treturn _create();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/common/Runtime/VirtualMachine.cs",
    "content": "using Uno;\nusing Uno.Collections;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tusing Bytecode;\n\n\tpublic class ScopeClosure\n\t{\n\t\treadonly Environment _scope;\n\t\treadonly IReflection _reflection;\n\n\t\tpublic ScopeClosure(Environment scope, IReflection reflection)\n\t\t{\n\t\t\t_reflection = reflection;\n\t\t\t_scope = scope;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Execute a lambda defined in _scope\n\t\t/// </summary>\n\n\t\tpublic object Execute(Lambda lambda, params object[] arguments)\n\t\t{\n\t\t\tvar bodyEnv = new Environment(_scope);\n\t\t\tvar bodyClosure = new ScopeClosure(bodyEnv, _reflection);\n\n\t\t\tbodyEnv.Bind(lambda.Signature.Parameters, arguments);\n\n\t\t\tforeach (var b in lambda.LocalVariables)\n\t\t\t\tbodyEnv.Bind(b.Variable, bodyClosure.Evaluate(b.Expression));\n\n\t\t\treturn bodyClosure.Execute(lambda.Statements);\n\t\t}\n\n\t\tobject Execute(IEnumerable<Statement> statements)\n\t\t{\n\t\t\tforeach (var statement in statements)\n\t\t\t{\n\t\t\t\tvar e = statement as Expression;\n\t\t\t\tif (e != null)\n\t\t\t\t{\n\t\t\t\t\tEvaluate(e);\n\t\t\t\t}\n\n\t\t\t\tvar r = statement as Return;\n\t\t\t\tif (r != null)\n\t\t\t\t{\n\t\t\t\t\treturn Evaluate(r.Value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tobject Evaluate(Expression expression)\n\t\t{\n\t\t\treturn expression.Match<object>(Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate,Evaluate);\n\t\t}\n\n\t\tobject Evaluate(ReadVariable e)\n\t\t{\n\t\t\treturn _scope.GetValue(e.Variable);\n\t\t}\n\n\t\tobject Evaluate(Bytecode.MethodGroup g)\n\t\t{\n\t\t\tstring[] parameters = null;\n\t\t\tif (g.MethodSignature.HasValue)\n\t\t\t{\n\t\t\t\tvar sigParams = g.MethodSignature.Value.Parameters;\n\t\t\t\tparameters = new string[sigParams.Count];\n\t\t\t\tfor (int i = 0; i < sigParams.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tparameters[i] = sigParams[i].Type.FullName;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn _reflection.CreateDelegate(Evaluate(g.Object), g.MethodName.Name, parameters, g.DelegateType.FullName);\n\t\t}\n\n\t\tobject Evaluate(IsType t)\n\t\t{\n\t\t\treturn t.IncludeSubtypes\n\t\t\t\t? _reflection.IsSubtype(Evaluate(t.Object), t.Type.FullName)\n\t\t\t\t: _reflection.IsType(Evaluate(t.Object), t.Type.FullName);\n\t\t}\n\n\t\tobject Evaluate(LogicalOr o)\n\t\t{\n\t\t\treturn (bool)Evaluate(o.Left) || (bool)Evaluate(o.Right);\n\t\t}\n\n\t\tobject Evaluate(Instantiate i)\n\t\t{\n\t\t\treturn _reflection.Instantiate(i.Type.FullName, Evaluate(i.Arguments));\n\t\t}\n\n\t\tobject Evaluate(CallLambda i)\n\t\t{\n\t\t\treturn Execute(Evaluate(i.Lambda), Evaluate(i.Arguments));\n\t\t}\n\n\t\tobject Evaluate(CallStaticMethod m)\n\t\t{\n\t\t\treturn _reflection.CallStatic(m.StaticMethod.TypeName.FullName, m.StaticMethod.MemberName.Name, Evaluate(m.Arguments));\n\t\t}\n\n\t\tobject Evaluate(CallDynamicMethod m)\n\t\t{\n\t\t\treturn _reflection.CallDynamic(Evaluate(m.Object), m.Method.Name, Evaluate(m.Arguments));\n\t\t}\n\n\t\tobject Evaluate(ReadStaticField e)\n\t\t{\n\t\t\treturn _reflection.GetStaticPropertyOrFieldValue(e.Field.TypeName.FullName, e.Field.MemberName.Name);\n\t\t}\n\n\t\tobject Evaluate(ReadProperty e)\n\t\t{\n\t\t\treturn _reflection.GetPropertyValue(Evaluate(e.Object), e.Property.Name);\n\t\t}\n\n\t\tobject Evaluate(WriteProperty p)\n\t\t{\n\t\t\t_reflection.SetPropertyValue(Evaluate(p.Object), p.Property.Name, Evaluate(p.Value));\n\t\t\treturn null;\n\t\t}\n\n\t\tobject Evaluate(AddEventHandler e)\n\t\t{\n\t\t\t_reflection.AddEventHandler(Evaluate(e.Object), e.Event.Name, Evaluate(e.Handler));\n\t\t\treturn null;\n\t\t}\n\n\t\tobject Evaluate(RemoveEventHandler e)\n\t\t{\n\t\t\t_reflection.RemoveEventHandler(Evaluate(e.Object), e.Event.Name, Evaluate(e.Handler));\n\t\t\treturn null;\n\t\t}\n\n\t\tobject[] Evaluate(ImmutableList<Expression> arguments)\n\t\t{\n\t\t\tvar objects = new object[arguments.Count];\n\t\t\tfor (int i = 0; i < arguments.Count; i++)\n\t\t\t{\n\t\t\t\tobjects[i] = Evaluate(arguments[i]);\n\t\t\t}\n\t\t\treturn objects;\n\t\t}\n\n\t\t// Lambdas\n\n\t\tobject Execute(object lambda, object[] arguments)\n\t\t{\n\t\t\tvar f0 = lambda as Func<object>;\n\t\t\tif (f0 != null) return f0();\n\t\t\tvar f1 = lambda as Func<object, object>;\n\t\t\tif (f1 != null) return f1(arguments[0]);\n\t\t\tvar f2 = lambda as Func<object, object, object>;\n\t\t\tif (f2 != null) return f2(arguments[0], arguments[1]);\n\t\t\tvar f3 = lambda as Func<object, object, object, object>;\n\t\t\tif (f3 != null) return f3(arguments[0], arguments[1], arguments[2]);\n\t\t\tvar f4 = lambda as Func<object, object, object, object, object>;\n\t\t\tif (f4 != null) return f4(arguments[0], arguments[1], arguments[2], arguments[3]);\n\t\t\tvar f5 = lambda as Func<object, object, object, object, object, object>;\n\t\t\tif (f5 != null) return f5(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);\n\t\t\tvar f6 = lambda as Func<object, object, object, object, object, object, object>;\n\t\t\tif (f6 != null) return f6(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n\t\t\tvar f7 = lambda as Func<object, object, object, object, object, object, object, object>;\n\t\t\tif (f7 != null) return f7(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);\n\t\t\tvar f8 = lambda as Func<object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f8 != null) return f8(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7]);\n\t\t\tvar f9 = lambda as Func<object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f9 != null) return f9(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8]);\n\t\t\tvar f10 = lambda as Func<object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f10 != null) return f10(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9]);\n\t\t\tvar f11 = lambda as Func<object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f11 != null) return f11(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10]);\n\t\t\tvar f12 = lambda as Func<object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f12 != null) return f12(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11]);\n\t\t\tvar f13 = lambda as Func<object, object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f13 != null) return f13(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12]);\n\t\t\tvar f14 = lambda as Func<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f14 != null) return f14(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], arguments[13]);\n\t\t\tvar f15 = lambda as Func<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f15 != null) return f15(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], arguments[13], arguments[14]);\n\t\t\tvar f16 = lambda as Func<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (f16 != null) return f16(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], arguments[13], arguments[14], arguments[15]);\n\n\t\t\tvar a0 = lambda as Action;\n\t\t\tif (a0 != null) a0();\n\t\t\tvar a1 = lambda as Action<object>;\n\t\t\tif (a1 != null) a1(arguments[0]);\n\t\t\tvar a2 = lambda as Action<object, object>;\n\t\t\tif (a2 != null) a2(arguments[0], arguments[1]);\n\t\t\tvar a3 = lambda as Action<object, object, object>;\n\t\t\tif (a3 != null) a3(arguments[0], arguments[1], arguments[2]);\n\t\t\tvar a4 = lambda as Action<object, object, object, object>;\n\t\t\tif (a4 != null) a4(arguments[0], arguments[1], arguments[2], arguments[3]);\n\t\t\tvar a5 = lambda as Action<object, object, object, object, object>;\n\t\t\tif (a5 != null) a5(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);\n\t\t\tvar a6 = lambda as Action<object, object, object, object, object, object>;\n\t\t\tif (a6 != null) a6(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n\t\t\tvar a7 = lambda as Action<object, object, object, object, object, object, object>;\n\t\t\tif (a7 != null) a7(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);\n\t\t\tvar a8 = lambda as Action<object, object, object, object, object, object, object, object>;\n\t\t\tif (a8 != null) a8(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7]);\n\t\t\tvar a9 = lambda as Action<object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a9 != null) a9(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8]);\n\t\t\tvar a10 = lambda as Action<object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a10 != null) a10(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9]);\n\t\t\tvar a11 = lambda as Action<object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a11 != null) a11(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10]);\n\t\t\tvar a12 = lambda as Action<object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a12 != null) a12(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11]);\n\t\t\tvar a13 = lambda as Action<object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a13 != null) a13(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12]);\n\t\t\tvar a14 = lambda as Action<object, object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a14 != null) a14(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], arguments[13]);\n\t\t\tvar a15 = lambda as Action<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a15 != null) a15(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], arguments[13], arguments[14]);\n\t\t\tvar a16 = lambda as Action<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>;\n\t\t\tif (a16 != null) a16(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9], arguments[10], arguments[11], arguments[12], arguments[13], arguments[14], arguments[15]);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tobject Evaluate(Lambda p)\n\t\t{\n\t\t\tif (p.Signature.ReturnType.HasValue)\n\t\t\t{\n\t\t\t\tswitch (p.Signature.Parameters.Count)\n\t\t\t\t{\n\t\t\t\t\tcase 0: return (Func<object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 1: return (Func<object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 2: return (Func<object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 3: return (Func<object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 4: return (Func<object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 5: return (Func<object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 6: return (Func<object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 7: return (Func<object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 8: return (Func<object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 9: return (Func<object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 10: return (Func<object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 11: return (Func<object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 12: return (Func<object, object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 13: return (Func<object, object, object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 14: return (Func<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t\tcase 15: return (Func<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Func;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (p.Signature.Parameters.Count)\n\t\t\t\t{\n\t\t\t\t\tcase 0: return (Action)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 1: return (Action<object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 2: return (Action<object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 3: return (Action<object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 4: return (Action<object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 5: return (Action<object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 6: return (Action<object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 7: return (Action<object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 8: return (Action<object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 9: return (Action<object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 10: return (Action<object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 11: return (Action<object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 12: return (Action<object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 13: return (Action<object, object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 14: return (Action<object, object, object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t\tcase 15: return (Action<object, object, object, object, object, object, object, object, object, object, object, object, object, object, object>)new LambdaClosure(p, Execute).Action;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new Exception(\"Illegal parameter count\");\n\t\t}\n\n\t\t// Literals\n\n\t\tobject Evaluate(Literal e)\n\t\t{\n\t\t\treturn e.Match<object>(Evaluate, Evaluate, Evaluate, Evaluate, Evaluate);\n\t\t}\n\n\t\tobject Evaluate(BlobLiteral e) { return e.Bytes; }\n\n\t\tobject Evaluate(BooleanLiteral e) { return e.BooleanValue; }\n\n\t\tobject Evaluate(StringLiteral e) { return e.StringValue; }\n\n\t\tobject Evaluate(NumberLiteral l)\n\t\t{\n\t\t\tswitch (l.NumberType)\n\t\t\t{\n\t\t\t\tcase NumberType.Double: return (double)l.DoubleValue;\n\t\t\t\tcase NumberType.Float: return (float)l.DoubleValue;\n\t\t\t\tcase NumberType.Int: return (int)l.DoubleValue;\n\t\t\t\tcase NumberType.UInt: return (uint)l.DoubleValue;\n\t\t\t\tcase NumberType.Short: return (short)l.DoubleValue;\n\t\t\t\tcase NumberType.UShort: return (ushort)l.DoubleValue;\n\t\t\t\tcase NumberType.SByte: return (sbyte)l.DoubleValue;\n\t\t\t\tcase NumberType.Byte: return (byte)l.DoubleValue;\n\t\t\t}\n\t\t\tthrow new ArgumentException(\"Invalid number type \" + l.NumberType);\n\t\t}\n\n\t\tobject Evaluate(EnumLiteral i)\n\t\t{\n\t\t\treturn _reflection.GetEnumValue(i.Value.TypeName.FullName, i.Value.MemberName.Name);\n\t\t}\n\n\n\t}\n\n\n\tclass LambdaClosure\n\t{\n\t\treadonly Lambda _lambda;\n\t\treadonly Func<Lambda, object[], object> _execute;\n\n\t\tpublic LambdaClosure(Lambda lambda, Func<Lambda, object[], object> execute)\n\t\t{\n\t\t\t_lambda = lambda;\n\t\t\t_execute = execute;\n\t\t}\n\n\t\tpublic void Action()\n\t\t{\n\t\t\tFunc();\n\t\t}\n\n\t\tpublic void Action(object a1)\n\t\t{\n\t\t\tFunc(a1);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2)\n\t\t{\n\t\t\tFunc(a1, a2);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3)\n\t\t{\n\t\t\tFunc(a1, a2, a3);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13, object a14)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13, object a14, object a15)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);\n\t\t}\n\n\t\tpublic void Action(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13, object a14, object a15, object a16)\n\t\t{\n\t\t\tFunc(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);\n\t\t}\n\n\t\tpublic object Func()\n\t\t{\n\t\t\treturn _execute(_lambda, new object[0]);\n\t\t}\n\n\t\tpublic object Func(object a1)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3)\n\t\t{\n\t\t\treturn _execute(_lambda, new [] { a1, a2, a3 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13, object a14)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13, object a14, object a15)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 });\n\t\t}\n\n\t\tpublic object Func(object a1, object a2, object a3, object a4, object a5, object a6, object a7, object a8, object a9, object a10, object a11, object a12, object a13, object a14, object a15, object a16)\n\t\t{\n\t\t\treturn _execute(_lambda, new[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 });\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/common/Runtime/WeakDictionary.cs",
    "content": "using Uno;\nusing Uno.IO;\nusing Uno.UX;\nusing Uno.Net;\nusing Uno.Collections;\nusing Uno.Diagnostics;\n\nnamespace Outracks.Simulator.Runtime\n{\n\tpublic class HashableWeakReference\n\t{\n\t\treadonly Uno.WeakReference<object> _reference;\n\n\t\tpublic HashableWeakReference(Uno.WeakReference<object> reference)\n\t\t{\n\t\t\t_reference = reference;\n\t\t}\n\n\t\tpublic bool TryGetTarget(out object obj)\n\t\t{\n\t\t\treturn _reference.TryGetTarget(out obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tobject obj;\n\t\t\tif (!_reference.TryGetTarget(out obj)) return 0;\n\t\t\treturn obj.GetHashCode();\n\n\t\t}\n\n\t\tpublic override bool Equals(object that)\n\t\t{\n\t\t\tif (ReferenceEquals(this, that)) return true;\n\t\t\tobject a = null;\n\t\t\tobject b = null;\n\t\t\tif (!_reference.TryGetTarget(out a))\n\t\t\t\treturn false;\n\t\t\tif (!(that is HashableWeakReference) || !((HashableWeakReference) that)._reference.TryGetTarget(out b))\n\t\t\t\treturn false;\n\t\t\treturn a.Equals(b);\n\t\t}\n\t}\n\n\tpublic class WeakDictionary<TKey, TValue>\n\t{\n\t\treadonly Uno.Collections.Dictionary<HashableWeakReference, TValue> _dictionary =\n\t\t\tnew Uno.Collections.Dictionary<HashableWeakReference, TValue>();\n\n\t\tpublic Uno.Collections.IEnumerable<Uno.Collections.KeyValuePair<HashableWeakReference, TValue>> AsEnumerable()\n\t\t{\n\t\t\treturn _dictionary;\n\t\t}\n\n\t\tpublic void Clear()\n\t\t{\n\t\t\t_dictionary.Clear();\n\t\t}\n\n\t\tpublic bool TryGetValue(TKey key, out TValue value)\n\t\t{\n\t\t\treturn _dictionary.TryGetValue(GetKey(key), out value);\n\t\t}\n\n\t\tpublic bool Remove(HashableWeakReference key)\n\t\t{\n\t\t\treturn _dictionary.Remove(key);\n\t\t}\n\n\t\tpublic TValue this[TKey key]\n\t\t{\n\t\t\tget { return _dictionary[GetKey(key)]; }\n\t\t\tset { _dictionary[GetKey(key)] = value; }\n\t\t}\n\n\t\tstatic HashableWeakReference GetKey(TKey obj)\n\t\t{\n\t\t\treturn new HashableWeakReference(new Uno.WeakReference<object>(obj));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/BuildFailed.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Simulator\n{\n\tpublic abstract class BuildFailed : Exception\n\t{\n\t\tprotected BuildFailed(string reason, Exception innerException = null)\n\t\t\t: base(reason, innerException)\n\t\t{ }\n\n\t\tprotected BuildFailed()\n\t\t{ }\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Context.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tpublic sealed class Context\n\t{\n\t\tpublic readonly UniqueNames Names;\n\t\tpublic readonly Func<Node, Optional<ObjectIdentifier>> TryGetTagHash;\n\t\tpublic readonly string ProjectDirectory;\n\n\t\treadonly ImmutableHashSet<TypeName> _typesDeclaredInUx;\n\n\t\tpublic Context(UniqueNames names, Func<Node, Optional<ObjectIdentifier>> tryGetTagHash, string projectDirectory, ImmutableHashSet<TypeName> typesDeclaredInUx)\n\t\t{\n\t\t\tNames = names;\n\t\t\tTryGetTagHash = tryGetTagHash;\n\t\t\tProjectDirectory = projectDirectory;\n\t\t\t_typesDeclaredInUx = typesDeclaredInUx;\n\t\t}\n\n\t\tpublic Context With(UniqueNames names = null)\n\t\t{\n\t\t\treturn new Context(names ?? Names, TryGetTagHash, ProjectDirectory, _typesDeclaredInUx);\n\t\t}\n\n\t\tpublic Optional<Expression> TryGetUxConstructorFunction(TypeName typeName)\n\t\t{\n\t\t\treturn IsDeclaredInUx(typeName)\n\t\t\t\t? Optional.Some<Expression>(new ReadVariable(typeName.GetUxConstructorFunctionName()))\n\t\t\t\t: Optional.None<Expression>();\n\t\t}\n\n\n\t\tpublic bool IsDeclaredInUx(Property property)\n\t\t{\n\t\t\treturn IsDeclaredInUx(property.Facet.DeclaringType.GetTypeName());\n\t\t}\n\n\t\tbool IsDeclaredInUx(TypeName typeName)\n\t\t{\n\t\t\treturn _typesDeclaredInUx.Contains(typeName);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Declarations.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Runtime;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tstatic class Declarations\n\t{\n\t\tpublic static IEnumerable<BindVariable> GetDeclarations(this IEnumerable<Node> nodes, Context ctx)\n\t\t{\n\t\t\treturn nodes.SelectMany(n => n.GetDeclaration(ctx));\n\t\t}\n\n\t\tstatic Optional<BindVariable> GetDeclaration(this Node n, Context ctx)\n\t\t{\n\t\t\treturn from valueExpression in n.GetDeclarationExpression(ctx)\n\t\t\t\tselect new BindVariable(ctx.Names[n], valueExpression);\n\t\t}\n\n\t\tstatic Optional<Expression> GetDeclarationExpression(this Node node, Context ctx)\n\t\t{\n\t\t\treturn node.MatchWith<Optional<Expression>>(\n\t\t\t\t(DocumentScope ds) => ds.MatchWith(\n\t\t\t\t\t(ClassNode cn) => cn.GetClassExpression(ctx),\n\t\t\t\t\t(TemplateNode fn) => fn.GetTemplateExpression(ctx)),\n\n\t\t\t\t(ObjectNode n) => n.MatchWith(\n\t\t\t\t\t(BoxedValueNode bvn) =>\n\t\t\t\t\t\tbvn.Value.GetExpression(ctx),\n\n\t\t\t\t\t(NewObjectNode non) =>\n\t\t\t\t\t\tnon.GetDeclarationExpression(ctx),\n\n\t\t\t\t\t(ResourceRefNode rfn) =>\n\t\t\t\t\t\tExpression.Throw(new InvalidUXIL(\"ResourceRefNodes do not need instantiation\")),\n\n\t\t\t\t\t(NameTableNode ntn) =>\n\t\t\t\t\t\tntn.GetDeclarationExpression(ctx)),\n\t\t\t\t(PropertyNode n) => Optional.None(),\n                (DependencyNode n) => Optional.None());\n\t\t}\n\n\t\tstatic readonly TypeName NameTable = TypeName.Parse(\"Uno.UX.NameTable\");\n\n\t\tstatic Expression GetDeclarationExpression(this NameTableNode ntn, Context ctx)\n\t\t{\n\t\t\treturn new Instantiate(\n\t\t\t\tNameTable,\n\t\t\t\tnew Expression[]\n\t\t\t\t{\n\t\t\t\t\tntn.ParentTable == null\n\t\t\t\t\t\t? new StringLiteral(null)\n\t\t\t\t\t\t: ntn.ParentTable.GetExpression(ctx),\n\n\t\t\t\t\tCreateArray(\n\t\t\t\t\t\tTypeName.Parse(\"Uno.String\"),\n\t\t\t\t\t\tctx.Names,\n\t\t\t\t\t\tntn.Entries.Select(e => new StringLiteral(e.Name)))\n\t\t\t\t});\n\t\t}\n\n\t\tstatic Expression CreateArray(TypeName elementType, UniqueNames names, IEnumerable<Expression> elements)\n\t\t{\n\t\t\tvar list = names.GetUniqueName();\n\t\t\tnames = names.Reserve(list);\n\n\t\t\treturn new CallLambda(\n\t\t\t\tnew Lambda(\n\t\t\t\t\tSignature.Func(TypeName.Parse(\"Uno.Object\")),\n\t\t\t\t\tnew[] { new BindVariable(list, new Instantiate(ObjectList.Parameterize(elementType))), },\n\t\t\t\t\telements\n\t\t\t\t\t\t.Select(e => (Statement)new CallDynamicMethod(new ReadVariable(list), new TypeMemberName(\"Add\"), e))\n\t\t\t\t\t\t.Concat(new [] { new Return(new CallDynamicMethod(new ReadVariable(list), new TypeMemberName(\"ToArray\"))) })));\n\t\t}\n\n\t\tstatic readonly TypeName ObjectList = TypeName.Parse(\"Uno.Collections.List<Uno.Object>\");\n\n\t\tstatic Expression GetDeclarationExpression(this NewObjectNode non, Context ctx)\n\t\t{\n\t\t\tvar typeName = non.DataType.GetTypeName();\n\t\t\tvar arguments = non.ConstructorArguments().GetExpressions(ctx);\n\n\t\t\treturn Instantiate(typeName, arguments, ctx, ctx.TryGetTagHash(non));\n\t\t}\n\n\t\tpublic static Expression Instantiate(this TypeName typeName, Expression[] arguments, Context ctx, Optional<ObjectIdentifier> tagHash)\n\t\t{\n\t\t\tvar obj = ctx.TryGetUxConstructorFunction(typeName).MatchWith(\n\t\t\t\tsome: ex => (Expression)new CallLambda(ex, arguments),\n\t\t\t\tnone: () =>  (Expression)new Instantiate(typeName, arguments));\n\n\t\t\tif (!tagHash.HasValue)\n\t\t\t\treturn obj;\n\n\t\t\treturn ExpressionConverter.BytecodeFromSimpleLambda(() =>\n\t\t\t\tObjectTagRegistry.RegisterObjectTag(obj, tagHash.Value.ToString()));\n\t\t}\n\n\t\t// UXIL extensions:\n\t\tpublic static Variable GetUxConstructorFunctionName(this ClassNode classNode)\n\t\t{\n\t\t\treturn GetUxConstructorFunctionName(TypeName.Parse(classNode.GetGeneratedClassQualifiedName()));\n\t\t}\n\t\tpublic static Variable GetUxConstructorFunctionName(this TypeName typeName)\n\t\t{\n\t\t\treturn new Variable(\"new_\" + typeName.FullName);\n\t\t}\n\t\tpublic static string GetGeneratedClassQualifiedName(this ClassNode node)\n\t\t{\n\t\t\tif (node.IsInnerClass) return GetGeneratedClassQualifiedName(GetParentClass(node)) + \".\" + node.GeneratedClassName.FullName;\n\t\t\treturn node.GeneratedClassName.FullName;\n\t\t}\n\n\t\tpublic static ClassNode GetParentClass(this Node node)\n\t\t{\n\t\t\tvar p = node.ParentScope;\n\t\t\twhile (p != null && !(p is ClassNode))\n\t\t\t{\n\t\t\t\tp = p.ParentScope;\n\t\t\t}\n\t\t\treturn p as ClassNode;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Exceptions.cs",
    "content": "﻿namespace Outracks.Simulator.CodeGeneration\n{\n\tclass MissingAppTag : BuildFailed\n\t{\n\t\tpublic override string Message\n\t\t{\n\t\t\tget { return \"Couldn't find an App tag in any of the included UX files. Have you forgot to include the UX file that contains the app tag?\"; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/FileSources.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Runtime;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tpublic static class BundleFiles\n\t{\n\t\tpublic static Expression AddOrUpdateFile(string descriptor, byte[] data)\n\t\t{\n\t\t\treturn new CallStaticMethod(\n\t\t\t\tAddOrUpdateFileMethod,\n\t\t\t\tnew StringLiteral(descriptor),\n\t\t\t\tnew BlobLiteral(data));\n\t\t}\n\n\t\tstatic readonly StaticMemberName AddOrUpdateFileMethod = new StaticMemberName(\n\t\t\tTypeName.Parse(\"Outracks.Simulator.Runtime.Bundle\"),\n\t\t\tnew TypeMemberName(\"AddOrUpdateFile\"));\n\t}\n\n\tpublic static class ImportExpression\n\t{\n\t\tpublic static Expression GetExpression(this BundleFileSource node, Context ctx)\n\t\t{\n\t\t\treturn ExpressionConverter.BytecodeFromSimpleLambda(() =>\n\t\t\t\tFileCache.GetFileSource(node.GetDescriptor(ctx.ProjectDirectory)));\n\t\t}\n\n\t\tpublic static IEnumerable<ProjectDependency> FindFiles(ClassNode document, string projectDirectory)\n\t\t{\n\t\t\treturn document\n\t\t\t\t.AllNodesInDocument()\n\t\t\t\t.SelectMany(\n\t\t\t\t\tnode =>\n\t\t\t\t\t\tEnumerable.Union(\n\t\t\t\t\t\t\tnode.ReferencePropertiesWithValues.Select(p => p.Source),\n\t\t\t\t\t\t\tnode.ListPropertiesWithValues.SelectMany(p => p.Sources)))\n\t\t\t\t.OfType<BundleFileSource>()\n\t\t\t\t.Select(bs => new ProjectDependency(\n\t\t\t\t\tpath: bs.Path,\n\t\t\t\t\tdescriptor: bs.GetDescriptor(projectDirectory)));\n\t\t}\n\n\t\tstatic string GetDescriptor(this BundleFileSource bs, string projectDirectory)\n\t\t{\n\t\t\t// TODO: replace with new UXIL propery\n\t\t\treturn bs.Path.RelativeTo(projectDirectory).Replace('\\\\', '/');\n\t\t}\n\n\t\tpublic static Statement UpdateFile(string descriptor, byte[] data)\n\t\t{\n\t\t\treturn ExpressionConverter.BytecodeFromSimpleLambda(() =>\n\t\t\t\tFileCache.Update(descriptor, data));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/CodeGeneration/FindNodesInScope.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tstatic class FindNodesInScope\n\t{\n\t\t// Local scopes\n\t\tpublic static Node[] NodesToInitializeInScope(this DocumentScope scope)\n\t\t{\n\t\t\treturn scope\n\t\t\t\t.NodesDeclaredInScope().Where(n => n is NewObjectNode || n is NameTableNode)\n\t\t\t\t.Concat(new [] { scope })\n\t\t\t\t.ToArray();\n\t\t}\n\n\t\tpublic static Node[] NodesDeclaredInScope(this DocumentScope scope)\n\t\t{\n\t\t\treturn scope.InstantiationOrder\n\t\t\t\t.OfType<NodeSource>()\n\t\t\t\t.Select(n => n.Node)\n\t\t\t\t.OrderByDescending(IsInnerClassDeclaration)\n\t\t\t\t.Where(n => IsDeclaredInScope(n, scope))\n\t\t\t\t.ToArray();\n\t\t}\n\n\t\tstatic bool IsDeclaredInScope(Node n, DocumentScope scope)\n\t\t{\n\t\t\treturn\n\t\t\t\tn != scope && // not the scope node itself\n\t\t\t\tn.InstanceType != InstanceType.Global &&\n\t\t\t\t(n.Scope == scope || IsInnerClassDeclaration(n));\n\t\t}\n\n\t\tstatic bool IsInnerClassDeclaration(Node n)\n\t\t{\n\t\t\treturn n is TemplateNode || (n is ClassNode && ((ClassNode)n).IsInnerClass == true);\n\t\t}\n\n\t\t// Global scope\n\n\t\tpublic static Node[] NodesToInitializeInScope(this Project scope)\n\t\t{\n\t\t\treturn scope\n\t\t\t\t.NodesDeclaredInScope()\n\t\t\t\t.Distinct()\n\t\t\t\t.Where(n => n is NewObjectNode || n is BoxedValueNode)\n\t\t\t\t.ToArray();\n\t\t}\n\n\t\tpublic static Node[] NodesDeclaredInScope(this Project globalScope)\n\t\t{\n\t\t\treturn globalScope.RootClasses.SelectMany(doc => doc.GlobalNodes().Concat(new [] { doc })).ToArray();\n\t\t}\n\n\t\tstatic IEnumerable<Node> GlobalNodes(this ClassNode document)\n\t\t{\n\t\t\treturn document\n\t\t\t\t.AllNodesInDocument()\n\t\t\t\t.Where(IsGlobalDeclaration);\n\t\t}\n\n\t\tpublic static bool IsGlobalDeclaration(this Node n)\n\t\t{\n\t\t\treturn n.InstanceType == InstanceType.Global;\n\t\t}\n\n\t\tpublic static bool IsOuterClassDeclaration(this Node n)\n\t\t{\n\t\t\treturn n is ClassNode && ((ClassNode)n).IsInnerClass == false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/GetExpression.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup;\nusing Uno.UX.Markup.UXIL;\nusing String = Uno.UX.Markup.String;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tstatic class ExpressionGenerator\n\t{\n\t\tpublic static Expression GetValueExpression(this Property property, Context ctx)\n\t\t{\n\t\t\treturn property.MatchWith(\n\t\t\t\t(BindableProperty p) => p.MatchWith(\n\t\t\t\t\t(ListProperty l) => Expression.Throw(new InvalidUXIL(\"Setting value of list property is illegal\")),\n\t\t\t\t\t(ReferenceProperty r) => r.Source.GetExpression(ctx)),\n\t\t\t\t(AtomicProperty p) => p.Value.GetExpression(ctx),\n\t\t\t\t(DelegateProperty p) => Expression.Throw(new NotImplementedException(\"Setting value of delegate property not supported\")));\n\t\t}\n\n\t\tpublic static Expression[] GetExpressions(this IEnumerable<ValueSource> args, Context ctx)\n\t\t{\n\t\t\treturn args.Select(arg => arg.GetExpression(ctx)).ToArray();\n\t\t}\n\n\t\tpublic static Expression GetExpression(this ValueSource src, Context ctx)\n\t\t{\n\t\t\treturn src.MatchWith(\n\t\t\t\t(ReferenceSource rs) => rs.GetExpression(ctx),\n\t\t\t\t(AtomicValueSource avs) => avs.Value.GetExpression(ctx));\n\t\t}\n\n\t\tpublic static Expression GetExpression(this ReferenceSource v, Context ctx)\n\t\t{\n\t\t\treturn v.MatchWith(\n\t\t\t\t(BundleFileSource s) => s.GetExpression(ctx),\n\t\t\t\t(NodeSource s) => s.Node.GetExpression(ctx),\n\t\t\t\t(UXPropertySource s) => s.GetPropertyExpression(ctx),\n\t\t\t\t(UXPropertyAccessorSource s) => s.GetPropertyExpression(ctx));\n\t\t}\n\n\t\tpublic static Expression GetExpression(this Node node, Context ctx)\n\t\t{\n\t\t\tvar resourceNode = node as ResourceRefNode;\n\t\t\tif (resourceNode != null)\n\t\t\t{\n\t\t\t\tvar globalName = new Variable(resourceNode.StaticRefId);\n\t\t\t\tif (ctx.Names.Contains(globalName))\n\t\t\t\t\treturn new ReadVariable(globalName);\n\n\t\t\t\treturn new ReadStaticField(StaticMemberName.Parse(resourceNode.StaticRefId));\n\t\t\t}\n\n\t\t\treturn new ReadVariable(ctx.Names[node]);\n\t\t}\n\n\t\tstatic Expression GetExpression(this GlobalReferenceValue grv, Context ctx)\n\t\t{\n\t\t\tif (grv.ResolvedValue != null)\n\t\t\t\treturn grv.ResolvedValue.GetExpression(ctx);\n\n\t\t\tvar globalName = new Variable(grv.ToLiteral());\n\t\t\tif (ctx.Names.Contains(globalName))\n\t\t\t\treturn new ReadVariable(globalName);\n\n\t\t\treturn new ReadStaticField(StaticMemberName.Parse(grv.ToLiteral()));\n\t\t}\n\n\t\tpublic static Expression GetExpression(this AtomicValue value, Context ctx)\n\t\t{\n\t\t\treturn value.MatchWith(\n\t\t\t\t(Bool v) => new BooleanLiteral(v.Value),\n\t\t\t\t(EnumValue v) => new EnumLiteral(v.GetEnumValueName()),\n\t\t\t\t(ReferenceValue v) => v.Value.GetExpression(ctx),\n\t\t\t\t(String v) => new StringLiteral(v.Value),\n\t\t\t\t(Scalar v) => v.GetExpression(),\n\t\t\t\t(Vector v) => v.GetExpression(),\n\t\t\t\t(GlobalReferenceValue grv) => grv.GetExpression(ctx),\n\t\t\t\t(Size v) => v.GetExpression(),\n\t\t\t\t(Size2 v) => v.GetExpression(),\n\t\t\t\t(Selector v) => v.GetExpression());\n\t\t}\n\n\t\tstatic Expression GetExpression(this Selector sel)\n\t\t{\n\t\t\treturn new Instantiate(TypeName.Parse(\"Uno.UX.Selector\"), new StringLiteral(sel.Value));\n\t\t}\n\n\t\tstatic Expression GetExpression(this Vector vector)\n\t\t{\n\t\t\treturn new Instantiate(vector.TypeName, vector.Components.Select(GetExpression).ToImmutableList());\n\t\t}\n\n\t\tstatic Expression GetExpression(this Size s)\n\t\t{\n\t\t\treturn new Instantiate(TypeName.Parse(\"Uno.UX.Size\"), new NumberLiteral(NumberType.Float, s.Value), new EnumLiteral(new StaticMemberName(TypeName.Parse(\"Uno.UX.Unit\"), new TypeMemberName(s.Unit))));\n\t\t}\n\n\t\tstatic Expression GetExpression(this Size2 s)\n\t\t{\n\t\t\treturn new Instantiate(TypeName.Parse(\"Uno.UX.Size2\"), GetExpression(s.X), GetExpression(s.Y));\n\t\t}\n\n\t\tstatic Expression GetExpression(this Scalar v)\n\t\t{\n\t\t\tvar obj = v.ObjectValue;\n\n\t\t\tif (obj is double) return new NumberLiteral(NumberType.Double, (double) obj);\n\t\t\tif (obj is float) return new NumberLiteral(NumberType.Float, (float)obj);\n\t\t\tif (obj is int) return new NumberLiteral(NumberType.Int, (int)obj);\n\t\t\tif (obj is uint) return new NumberLiteral(NumberType.UInt, (uint)obj);\n\t\t\tif (obj is short) return new NumberLiteral(NumberType.Short , (short)obj);\n\t\t\tif (obj is ushort) return new NumberLiteral(NumberType.UShort, (ushort)obj);\n\t\t\tif (obj is sbyte) return new NumberLiteral(NumberType.SByte, (sbyte)obj);\n\t\t\tif (obj is byte) return new NumberLiteral(NumberType.Byte, (byte)obj);\n\n\t\t\tthrow new Exception(\"Unknown scalar: \" + v);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Initialization.EventBindings.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tclass EventBindings\n\t{\n\t\treadonly Node _self;\n\t\treadonly Context _ctx;\n\n\t\tpublic EventBindings(Node self, Context ctx)\n\t\t{\n\t\t\t_self = self;\n\t\t\t_ctx = ctx;\n\t\t}\n\n\t\tpublic IEnumerable<Statement> SetEventBindings()\n\t\t{\n\t\t\tforeach (var e in _self.EventsWithHandler)\n\t\t\t{\n\t\t\t\tStatement ret = null;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tret = HookEvent(e);\n\t\t\t\t}\n\t\t\t\tcatch (Exception ex)\n\t\t\t\t{\n\t\t\t\t\tConsole.Error.WriteLine(\"WARNING: \" + ex.Message);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield return ret;\n\t\t\t}\n\t\t}\n\n\t\tStatement HookEvent(Event e)\n\t\t{\n\t\t\tvar handler = e.Handler.MatchWith(\n\t\t\t\t(EventMethod m) => GetMethodGroupExpression(e, m),\n\t\t\t\t(EventBinding b) => GetMethodGroupExpression(e, b));\n\n\t\t\treturn e.Facet.MatchWith(\n\t\t\t\t(IAttachedEvent a) => HookAttachedEvent(a, handler),\n\t\t\t\t(IRegularEvent r) => HookRegularEvent(e, handler));\n\t\t}\n\n\t\tExpression GetMethodGroupExpression(Event e, EventMethod b)\n\t\t{\n\t\t\tthrow new NotSupportedException(\"Binding '\" + b.Name + \"' to Uno event handler method isn't supported.\");\n#if false\n\t\t\tvar objectName = new Variable(b.Name.BeforeFirst(\".\"));\n\t\t\tvar methodName = new TypeMemberName(b.Name.AfterFirst(\".\"));\n\n\t\t\tvar delegateName = TypeName.Parse(e.Facet.DelegateName);\n\t\t\treturn new MethodGroup(\n\t\t\t\tnew ReadVariable(objectName),\n\t\t\t\tmethodName,\n\t\t\t\tOptional.None(),\n\t\t\t\tdelegateName);\n#endif\n\t\t}\n\n\t\tExpression GetMethodGroupExpression(Event e, EventBinding b)\n\t\t{\n\t\t\tvar delegateName = TypeName.Parse(e.Facet.DelegateName);\n\t\t\treturn new MethodGroup(\n\t\t\t\tb.Binding.GetExpression(_ctx),\n\t\t\t\tOnEvent,\n\t\t\t\tOnEventSignature,\n\t\t\t\tdelegateName);\n\t\t}\n\n\t\tStatement HookAttachedEvent(IAttachedEvent a, Expression handler)\n\t\t{\n\t\t\treturn new CallStaticMethod(a.GetStaticMemberName(), This, handler);\n\t\t}\n\n\t\tStatement HookRegularEvent(Event e, Expression handler)\n\t\t{\n\t\t\treturn new AddEventHandler(This, e.GetMemberName(), handler);\n\t\t}\n\n\t\tstatic TypeMemberName OnEvent\n\t\t{\n\t\t\tget { return new TypeMemberName(\"OnEvent\"); }\n\t\t}\n\n\t\tstatic Signature OnEventSignature\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn new Signature(\n\t\t\t\t\tList.Create(\n\t\t\t\t\t\tnew Parameter(Object, new Variable(\"o\")),\n\t\t\t\t\t\tnew Parameter(EventArgs, new Variable(\"a\"))),\n\t\t\t\t\tOptional.None());\n\t\t\t}\n\t\t}\n\n\t\tstatic TypeName Object\n\t\t{\n\t\t\tget { return TypeName.Parse(\"Uno.Object\"); }\n\t\t}\n\n\t\tstatic TypeName EventArgs\n\t\t{\n\t\t\tget { return TypeName.Parse(\"Uno.EventArgs\"); }\n\t\t}\n\n\t\tExpression This\n\t\t{\n\t\t\tget { return new ReadVariable(_ctx.Names[_self]); }\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Initialization.ListProperties.cs",
    "content": "﻿using System.Collections.Generic;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tclass ListProprties\n\t{\n\t\treadonly Node _self;\n\t\treadonly Context _ctx;\n\n\t\tpublic ListProprties(Node self, Context ctx)\n\t\t{\n\t\t\t_self = self;\n\t\t\t_ctx = ctx;\n\t\t}\n\n\t\tpublic IEnumerable<Statement> SetListProperties()\n\t\t{\n\t\t\tforeach (var prop in _self.ListPropertiesWithValues)\n\t\t\t{\n\t\t\t\tforeach (var value in prop.Sources)\n\t\t\t\t\tyield return AddToList(prop, value.GetExpression(_ctx));\n\t\t\t}\n\t\t}\n\n\t\tStatement AddToList(Property prop, Expression value)\n\t\t{\n\t\t\tif (prop.IsAttachedProperty())\n\t\t\t\treturn new NoOperation(\"attached list property not supported\");\n\n\t\t\tvar list = new ReadProperty(This, prop.GetMemberName());\n\t\t\treturn new CallDynamicMethod(list, Add, value);\n\t\t}\n\n\t\tstatic TypeMemberName Add\n\t\t{\n\t\t\tget { return new TypeMemberName(\"Add\"); }\n\t\t}\n\n\n\t\tExpression This\n\t\t{\n\t\t\tget { return new ReadVariable(_ctx.Names[_self]); }\n\t\t}\n\n\t}\n}\n\n"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Initialization.SingleProperties.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Protocol;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tpublic class SingleProperties\n\t{\n\t\treadonly Node _self;\n\t\treadonly Context _ctx;\n\t\treadonly Expression _selfExpression;\n\n\t\tpublic SingleProperties(Node self, Context ctx, Expression selfExpression = null)\n\t\t{\n\t\t\t_self = self;\n\t\t\t_ctx = ctx;\n\t\t\t_selfExpression = selfExpression ?? new ReadVariable(_ctx.Names[_self]);\n\t\t}\n\n\t\tpublic IEnumerable<Statement> InitializeValues()\n\t\t{\n\t\t\treturn _self\n\t\t\t\t.SinglePropertiesWithValues()\n\t\t\t\t.Select(InitializeValue);\n\t\t}\n\n\t\tStatement InitializeValue(Property property)\n\t\t{\n\t\t\treturn UpdateValue(property, property.GetValueExpression(_ctx));\n\t\t}\n\n\t\tpublic Statement UpdateValue(string propertyName, Optional<string> maybeValue, ValueParser valueParser)\n\t\t{\n\t\t\tforeach (var p in _self.Properties)\n\t\t\t{\n\t\t\t\tif (p.Facet.Name == propertyName || p.Facet.Name.EndsWith(\".\"+propertyName))\n\t\t\t\t\treturn UpdateValue(p, maybeValue, valueParser);\n\t\t\t}\n\n\t\t\tthrow new Exception(\"Property not found: \" + propertyName);\n\t\t}\n\n\t\tStatement UpdateValue(Property property, Optional<string> maybeValue, ValueParser valueParser)\n\t\t{\n\t\t\t// TODO: we should ensure that the bytecode is evaluated in the declaring environment of the object, until then reference properties can't be set\n\t\t\t// It could be that it's actually false that AtomicValue can be reference type, but hard to know\n\t\t\t// I'll just avoid setting reference properties i guess\n\t\t\t// ..I can't know what is a reference property in the tool, i should probably trigger reify from the simulator in response to setting the property\n\n\n\t\t\treturn property.MatchWith(\n\t\t\t\t(BindableProperty bp) =>\n\t\t\t\t{\n\t\t\t\t\tif (bp.BindableType.FullName == \"Fuse.Drawing.Brush\")\n\t\t\t\t\t{\n\t\t\t\t\t\tvar solidColorBrush = TypeName.Parse(\"Fuse.Drawing.StaticSolidColor\");\n\t\t\t\t\t\tvar float4 = TypeName.Parse(\"float4\");\n\t\t\t\t\t\treturn maybeValue\n\t\t\t\t\t\t\t.Select(value => valueParser.Parse(value, float4, FileSourceInfo.Unknown))\n\t\t\t\t\t\t\t.MatchWith(\n\t\t\t\t\t\t\t\tsome: v => UpdateValue(property, new Instantiate(solidColorBrush, v.GetExpression(_ctx))),\n\t\t\t\t\t\t\t\tnone: () => ResetProperty(property));\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow new ReifyRequired();\n\t\t\t\t},\n\t\t\t\t(AtomicProperty p) => maybeValue\n\t\t\t\t\t.Select(value => valueParser.Parse(value, property.Facet.DataType, FileSourceInfo.Unknown))\n\t\t\t\t\t.MatchWith(\n\t\t\t\t\t\tsome: v => UpdateValue(property, v.GetExpression(_ctx)),\n\t\t\t\t\t\tnone: () => ResetProperty(property)),\n\t\t\t\t(DelegateProperty dp) =>\n\t\t\t\t{\n\t\t\t\t\tthrow new ReifyRequired();\n\t\t\t\t});\n\t\t}\n\n\t\tStatement ResetProperty(Property p)\n\t\t{\n\t\t\t//var resetMethod = p.GetResetMethod();\n\t\t\t//if (resetMethod.HasValue)\n\t\t\t//\treturn new CallStaticMethod(resetMethod.Value, _selfExpression);\n\n\t\t\t//// It's all a lie\n\n\t\t\t//if (p.Facet.DataType.FullName == \"float\" && p.Facet.Name == \"Opacity\")\n\t\t\t//\treturn UpdateValue(p, new NumberLiteral(NumberType.Float, 1.0));\n\n\t\t\t//var knownBrushProperties = new[]\n\t\t\t//{\n\t\t\t//\t\"Background\"\n\t\t\t//};\n\t\t\t//if (p.Facet.DataType.FullName == \"Fuse.Drawing.Brush\" && knownBrushProperties.Contains(p.Facet.Name))\n\t\t\t//\treturn UpdateValue(p, new StringLiteral(null));\n\n\t\t\t//var knownValueTypes = new[]\n\t\t\t//{\n\t\t\t//\t\"Fuse.Elements.Alignment\",\n\t\t\t//\t\"Fuse.Layouts.Dock\",\n\t\t\t//\t\"Fuse.Controls.TextAlignment\",\n\t\t\t//\t\"Fuse.Layouts.Orientation\",\n\t\t\t//\t\"Uno.UX.Size\", \"Uno.UX.Size2\",\n\t\t\t//\t\"float\", \"float2\", \"float4\",\n\t\t\t//};\n\t\t\t//if (knownValueTypes.Contains(p.Facet.DataType.FullName))\n\t\t\t//\treturn UpdateValue(p, new Instantiate(TypeName.Parse(p.Facet.DataType.FullName)));\n\n\t\t\tthrow new ReifyRequired();\n\t\t}\n\n\t\tStatement UpdateValue(Property prop, Expression value)\n\t\t{\n\t\t\tvar setArgs = new[] { _selfExpression, value };\n\n\t\t\tif (prop.IsAttachedProperty())\n\t\t\t{\n\t\t\t\tvar setMethod = prop.GetSetMethodName();\n\n\t\t\t\treturn new CallStaticMethod(setMethod, setArgs);\n\t\t\t}\n\n\t\t\tif (_ctx.IsDeclaredInUx(prop))\n\t\t\t{\n\t\t\t\tvar nameString = new StringLiteral(prop.GetMemberName().Name);\n\t\t\t\tvar nameSelector = new Instantiate(TypeName.Parse(\"Uno.UX.Selector\"), nameString);\n\t\t\t\tvar origin = new StringLiteral(null); // dummy origin\n\n\t\t\t\treturn new CallStaticMethod(\n\t\t\t\t\t\tStaticMemberName.Parse(\"Uno.UX.SimulatedProperties.Set\"),\n\t\t\t\t\t\t_selfExpression, nameString, value, origin)\n\t\t\t\t\t+ new CallStaticMethod(\n\t\t\t\t\t\tStaticMemberName.Parse(\"Uno.UX.PropertyObject.EmulatePropertyChanged\"),\n\t\t\t\t\t\t_selfExpression, nameSelector, origin);\n\t\t\t}\n\n\t\t\treturn new WriteProperty(_selfExpression, prop.GetMemberName(), value);\n\t\t}\n\t}\n\n\n\n}\n\n"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Initialization.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tstatic class Initializations\n\t{\n\t\tpublic static IEnumerable<Statement> GetInitializations(this IEnumerable<Node> nodes, Context ctx)\n\t\t{\n\t\t\treturn nodes.SelectMany(n => InitializeObject(n, ctx));\n\t\t}\n\n\t\tstatic IEnumerable<Statement> InitializeObject(this Node node, Context ctx)\n\t\t{\n\t\t\treturn new[]\n\t\t\t{\n\t\t\t\tnew SingleProperties(node, ctx).InitializeValues(),\n\t\t\t\tnew ListProprties(node, ctx).SetListProperties(),\n\t\t\t\tnew EventBindings(node, ctx).SetEventBindings()\n\t\t\t}.SelectMany(s => s);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/InvalidUXIL.cs",
    "content": "﻿using System;\n\nnamespace Outracks.Simulator\n{\n\tpublic class InvalidUXIL : Exception\n\t{\n\t\tpublic InvalidUXIL(string message) : base(message)\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Paths.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tstatic class Paths\n\t{\n\t\tpublic static string RelativeTo(this string toPath, string fromPath)\n\t\t{\n\t\t\tif (string.IsNullOrEmpty(fromPath)) throw new ArgumentNullException(\"fromPath\");\n\t\t\tif (string.IsNullOrEmpty(toPath)) throw new ArgumentNullException(\"toPath\");\n\n\t\t\tvar fromUri = new Uri(fromPath);\n\t\t\tvar toUri = new Uri(toPath);\n\n\t\t\tif (fromUri.Scheme != toUri.Scheme)\n\t\t\t\treturn toPath; // path can't be made relative.\n\n\t\t\tvar relativeUri = fromUri.MakeRelativeUri(toUri);\n\t\t\tvar relativePath = Uri.UnescapeDataString(relativeUri.ToString());\n\n\t\t\tif (toUri.Scheme.Equals(\"file\", StringComparison.InvariantCultureIgnoreCase))\n\t\t\t{\n\t\t\t\trelativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);\n\t\t\t}\n\n\t\t\treturn relativePath;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/ReifyRequired.cs",
    "content": "using System;\nusing System.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class ReifyRequired : Exception, IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"ReifyRequired\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic ReifyRequired() : base(\"Reify is required\")\n\t\t{\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t}\n\n\t\tpublic static ReifyRequired ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new ReifyRequired();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/Scopes.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tpublic static class Scopes\n\t{\n\t\tpublic static Lambda GenerateScopeConstructor(this DocumentScope scope, TypeName simulatedType, TypeName producedType, Context ctx)\n\t\t{\n\t\t\tvar nodesToDeclare = scope.NodesDeclaredInScope();\n\t\t\tvar nodesToInitialize = scope.NodesToInitializeInScope();\n\n\t\t\tvar usedNames = ctx.Names;\n\t\t\tvar self = usedNames.GetUniqueName();\n\t\t\tvar names = usedNames.Add(scope, self).GenerateNames(nodesToDeclare);\n\t\t\tvar newCtx = ctx.With(names: names);\n\n            var parameters = ImmutableList<Parameter>.Empty;\n\n            var cs = scope as ClassNode;\n            if (cs != null)\n            {\n                parameters = cs.DeclaredDependencies\n                    .Select(x => new Parameter(TypeName.Parse(x.ResultingType.FullName), names[x]))\n                    .ToImmutableList();\n            }\n\n\t\t\tvar isApp = parameters.Count == 0 && producedType == App;\n\n\t\t\tif (isApp)\n\t\t\t\tparameters = List.Create(new Parameter(App, Variable.This));\n\n\t\t\tvar baseParameters = scope.Properties\n                .Where(x => x.Facet.IsConstructorArgument && x.HasValue)\n                .Select(x =>\n                {\n                    if (x is ReferenceProperty) return ((ReferenceProperty)x).Source.GetExpression(newCtx);\n                    else if (x is AtomicProperty) return ((AtomicProperty)x).Value.GetExpression(newCtx);\n                    else throw new Exception(\"Unsupported constructor argument property type\");\n                })\n                .ToArray();\n\n\t\t\treturn new Lambda(\n\t\t\t\tnew Signature(\n\t\t\t\t\tparameters: parameters,\n\t\t\t\t\treturnType: producedType),\n\t\t\t\tlocalVariables:\n                    new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tnew BindVariable(self,\n \t\t\t\t\t\t\tisApp\n\t\t\t\t\t\t\t? new ReadVariable(Variable.This) // use object passed to ctor as this for the App tag\n\t\t\t\t\t\t\t: producedType.Instantiate(baseParameters, newCtx, newCtx.TryGetTagHash(scope)))\n\t\t\t\t\t}\n                    .Concat(nodesToDeclare.GetDeclarations(newCtx)),\n\t\t\t\tstatements:\n\t\t\t\t\tnodesToInitialize\n\t\t\t\t\t\t.GetInitializations(newCtx)\n\t\t\t\t\t\t.Concat(new [] { new Return(new ReadVariable(self)) }));\n\t\t}\n\n\t\tstatic TypeName App { get { return TypeName.Parse(\"Fuse.App\"); } }\n\n\t\tpublic static Lambda GenerateGlobalScopeConstructor(this Project globalScope, Context ctx)\n\t\t{\n\t\t\tvar nodesToDeclare = globalScope.NodesDeclaredInScope();\n\t\t\tvar nodesToInitialize = globalScope.NodesToInitializeInScope();\n\n\t\t\t// Making a new name for the transformed application ctor that takes an App as parameter\n\t\t\t// This is so we can still keep the regular ctor for use in other ux files\n\t\t\tvar mutatingAppCtorName = ctx.Names.GetUniqueName();\n\t\t\tvar names = ctx.Names.Reserve(mutatingAppCtorName).GenerateNames(nodesToDeclare);\n\t\t\tvar newCtx = ctx.With(names: names);\n\n\t\t\tvar declarations = nodesToDeclare.GetDeclarations(newCtx).ToImmutableList();\n\n\t\t\tvar appCtor = declarations.FirstOrDefault(decl => decl.IsAppConstructor());\n\t\t\tif (appCtor == null)\n\t\t\t\tthrow new MissingAppTag();\n\n\t\t\treturn new Lambda(\n\t\t\t\tSignature.Action(Variable.This),\n\t\t\t\tlocalVariables:\n\t\t\t\t\tdeclarations,\n\t\t\t\tstatements:\n\t\t\t\t\tnodesToInitialize.GetInitializations(newCtx)\n\t\t\t\t\t\t.Concat(nodesToDeclare.RegisterGlobalKeys(newCtx))\n\t\t\t\t\t\t.Concat(new [] { new CallLambda(new ReadVariable(appCtor.Variable), new ReadVariable(Variable.This)) }));\n\t\t}\n\n\n\t\tstatic IEnumerable<Statement> RegisterGlobalKeys(this IEnumerable<Node> nodes, Context ctx)\n\t\t{\n\t\t\tforeach (var node in nodes)\n\t\t\t{\n\t\t\t\tif (node.IsGlobalDeclaration())\n\t\t\t\t{\n\t\t\t\t\tyield return new CallStaticMethod(\n\t\t\t\t\t\tSetGlobalKey,\n\t\t\t\t\t\tnode.GetExpression(ctx),\n\t\t\t\t\t\tnew StringLiteral(node.Name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic StaticMemberName SetGlobalKey = new StaticMemberName(\n\t\t\tTypeName.Parse(\"Uno.UX.Resource\"),\n\t\t\tnew TypeMemberName(\"SetGlobalKey\"));\n\n\t}\n\n\tstatic class UseSimulatorApp\n\t{\n\t\tpublic static bool IsAppConstructor(this BindVariable bind)\n\t\t{\n\t\t\tvar lambda = bind.Expression as Lambda;\n\t\t\treturn lambda != null && lambda.Signature.ReturnType == App;\n\t\t}\n\n\t\tstatic TypeName App { get { return TypeName.Parse(\"Fuse.App\"); } }\n\t}\n\n}\n\n\n\n"
  },
  {
    "path": "src/simulator/main/CodeGeneration/UxClasses.cs",
    "content": "using Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tstatic class ClassExpression\n\t{\n\t\tpublic static Expression GetClassExpression(this ClassNode cn, Context ctx)\n\t\t{\n\t\t\treturn cn.GenerateScopeConstructor(\n\t\t\t\tsimulatedType: cn.GeneratedClassName.ToTypeName(),\n\t\t\t\tproducedType: cn.BaseType.GetTypeName(),\n\t\t\t\tctx: ctx);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/simulator/main/CodeGeneration/UxFactories.cs",
    "content": "using Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Runtime;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tpublic static class FactoryExpression\n\t{\n\t\tpublic static Expression GetTemplateExpression(this TemplateNode tn, Context ctx)\n\t\t{\n\t\t\treturn new Instantiate(\n\t\t\t\tTypeName.Parse(typeof(UxTemplate).FullName),\n\t\t\t\ttn.GenerateScopeConstructor(\n\t\t\t\t\tsimulatedType: tn.ProducedType.GetTypeName(),\n\t\t\t\t\tproducedType: tn.ProducedType.GetTypeName(),\n\t\t\t\t\tctx: ctx),\n                new StringLiteral(tn.Case),\n                new BooleanLiteral(tn.IsDefaultCase));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/CodeGeneration/UxProperties.cs",
    "content": "using Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.UXIL;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.CodeGeneration\n{\n\tstatic class PropertyExpression\n\t{\n\t\tpublic static Expression GetPropertyExpression(this UXPropertyAccessorSource s, Context ctx)\n\t\t{\n\t\t\tvar property = s.Property;\n\t\t\treturn GetPropertyExpression(ctx, property, Optional.None());\n\t\t}\n\n\t\tpublic static Expression GetPropertyExpression(this UXPropertySource s, Context ctx)\n\t\t{\n\t\t\tvar obj = s.Node.GetExpression(ctx);\n\t\t\tvar property = s.Property.Property;\n\t\t\treturn GetPropertyExpression(ctx, property, obj);\n\t\t}\n\n\t\tstatic Expression GetPropertyExpression(Context ctx, Property property, Optional<Expression> maybeObj)\n\t\t{\n\t\t\tvar propertyName = property.GetMemberName();\n\t\t\tvar propertyType = property.Facet.DataType.GetTypeName();\n\n\t\t\tvar vars = ctx.Names;\n\n\t\t\tvar propObj = vars.GetUniqueName();\n\t\t\tvars = vars.Reserve(propObj);\n\n\t\t\tvar value = vars.GetUniqueName();\n\t\t\tvars = vars.Reserve(value);\n\n\t\t\tvar origin = vars.GetUniqueName();\n\t\t\tvars = vars.Reserve(origin);\n\n\t\t\tif (ctx.IsDeclaredInUx(property))\n\t\t\t{\n\t\t\t\tvar setter = new Lambda(\n\t\t\t\t\tsignature: Signature.Action(propObj, value, origin),\n\t\t\t\t\tlocalVariables: new BindVariable[0],\n\t\t\t\t\tstatements: new Statement[]\n\t\t\t\t\t{\n\t\t\t\t\t\tnew CallStaticMethod(\n\t\t\t\t\t\t\tStaticMemberName.Parse(\"Uno.UX.SimulatedProperties.Set\"),\n\t\t\t\t\t\t\tnew ReadVariable(propObj),\n\t\t\t\t\t\t\tnew StringLiteral(propertyName.Name),\n\t\t\t\t\t\t\tnew ReadVariable(value),\n\t\t\t\t\t\t\tnew ReadVariable(origin))\n\t\t\t\t\t});\n\n\t\t\t\tvar getter = new Lambda(\n\t\t\t\t\tsignature: new Signature(List.Create(new Parameter(TypeName.Parse(\"object\"), propObj)), propertyType),\n\t\t\t\t\tlocalVariables: new BindVariable[0],\n\t\t\t\t\tstatements: new Statement[]\n\t\t\t\t\t{\n\t\t\t\t\t\tnew Return(\n\t\t\t\t\t\t\tnew CallStaticMethod(\n\t\t\t\t\t\t\t\tStaticMemberName.Parse(\"Uno.UX.SimulatedProperties.Get\"),\n\t\t\t\t\t\t\t\tnew ReadVariable(propObj),\n\t\t\t\t\t\t\t\tnew StringLiteral(propertyName.Name))),\n\t\t\t\t\t});\n\n\t\t\t\tvar mp = (IMutableProperty)property.Facet;\n\n\t\t\t\treturn new Instantiate(\n\t\t\t\t\tUxPropertyType.Parameterize(propertyType),\n\t\t\t\t\tsetter,\n\t\t\t\t\tgetter,\n\t\t\t\t\tmaybeObj.Or((Expression)new StringLiteral(null)),\n\t\t\t\t\t// the only null we've got is string\n\t\t\t\t\tnew StringLiteral(propertyName.Name),\n\t\t\t\t\tnew BooleanLiteral(mp.OriginSetterName != null)\n\t\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar obj = maybeObj.Or((Expression)new ReadVariable(propObj));\n\n\t\t\t\tvar setter = new Lambda(\n\t\t\t\t\tsignature: Signature.Action(propObj, value, origin),\n\t\t\t\t\tlocalVariables: new BindVariable[0],\n\t\t\t\t\tstatements: new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tproperty.SetValueStatement(ctx, obj, new ReadVariable(value), new ReadVariable(origin))\n\t\t\t\t\t});\n\n\t\t\t\tvar getter = new Lambda(\n\t\t\t\t\tsignature: new Signature(List.Create(new Parameter(TypeName.Parse(\"object\"), propObj)), propertyType),\n\t\t\t\t\tlocalVariables: new BindVariable[0],\n\t\t\t\t\tstatements: new[]\n\t\t\t\t\t{\n\t\t\t\t\t\tnew Return(property.GetValueStatement(ctx, obj))\n\t\t\t\t\t});\n\n\t\t\t\tvar mp = (IMutableProperty)property.Facet;\n\n\t\t\t\treturn new Instantiate(\n\t\t\t\t\tUxPropertyType.Parameterize(propertyType),\n\t\t\t\t\tsetter,\n\t\t\t\t\tgetter,\n\t\t\t\t\tmaybeObj.Or((Expression)new StringLiteral(null)),\n\t\t\t\t\t// the only null we've got is string\n\t\t\t\t\tnew StringLiteral(propertyName.Name),\n\t\t\t\t\tnew BooleanLiteral(mp.OriginSetterName != null)\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Statement SetValueStatement(this Property property, Context ctx, Expression obj, Expression value, Expression origin)\n\t\t{\n\t\t\tvar mp = (IMutableProperty)property.Facet;\n\t\t\treturn mp.OriginSetterName != null\n\t\t\t\t? (Statement)new CallDynamicMethod(obj, new TypeMemberName(mp.OriginSetterName), value, origin)\n\t\t\t\t: property.IsAttachedProperty()\n\t\t\t\t\t? (Statement)new CallStaticMethod(property.GetSetMethodName(), obj, value)\n\t\t\t\t\t: (Statement)new WriteProperty(obj, property.GetMemberName(), value);\n\t\t}\n\n\t\tpublic static Expression GetValueStatement(this Property property, Context ctx, Expression obj)\n\t\t{\n\t\t\treturn property.IsAttachedProperty()\n\t\t\t\t? (Expression)new CallStaticMethod(property.GetGetMethodName(), obj)\n\t\t\t\t: (Expression)new ReadProperty(obj, property.GetMemberName());\n\t\t}\n\t\tstatic TypeName UxPropertyType\n\t\t{\n\t\t\tget { return TypeName.Parse(\"Outracks.Simulator.Runtime.UxProperty<T>\"); }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/ExpressionConverter.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Reflection;\nusing Outracks.Simulator.Bytecode;\nusing Expression = Outracks.Simulator.Bytecode.Expression;\n\nnamespace Outracks.Simulator\n{\n\tpublic static class ExpressionConverter\n\t{\n\t\tpublic static Expression BytecodeFromSimpleLambda(Expression<Action> expression)\n\t\t{\n\t\t\treturn ToBytecode(expression.Body);\n\t\t}\n\n\t\tpublic static Expression ToBytecode(System.Linq.Expressions.Expression expression)\n\t\t{\n\t\t\tvar e = expression as MethodCallExpression;\n\t\t\tif (e == null)\n\t\t\t\tthrow new Exception(\"Expression must be method call\");\n\n\t\t\tif (!e.Method.IsStatic)\n\t\t\t\tthrow new Exception(\"Method call must be static\");\n\n\t\t\treturn new CallStaticMethod(\n\t\t\t\tnew StaticMemberName(\n\t\t\t\t\tTypeName.Parse(e.Method.DeclaringType.FullName),\n\t\t\t\t\tnew TypeMemberName(e.Method.Name)),\n\t\t\t\te.Arguments.Select(EvaluateToBytecode).ToArray());\n\t\t}\n\n\t\tstatic Expression EvaluateToBytecode(System.Linq.Expressions.Expression expression)\n\t\t{\n\t\t\treturn ConstantToByteCode(Evaluate(expression));\n\t\t}\n\n\t\tstatic object Evaluate(System.Linq.Expressions.Expression expression)\n\t\t{\n\t\t\tif (expression == null)\n\t\t\t\treturn null;\n\n\t\t\tvar ce = expression as ConstantExpression;\n\t\t\tif (ce != null) return ce.Value;\n\n\t\t\tvar mce = expression as MethodCallExpression;\n\t\t\tif (mce != null) return mce.Method.Invoke(Evaluate(mce.Object), mce.Arguments.Select(Evaluate).ToArray());\n\n\t\t\tvar me = expression as MemberExpression;\n\t\t\tif (me == null) throw new Exception(\"Expression not supported: \" + expression);\n\n\t\t\tvar member = me.Member;\n\t\t\tvar field = member as FieldInfo;\n\t\t\tif (field != null)\n\t\t\t\treturn field.GetValue(Evaluate(me.Expression));\n\n\t\t\tvar prop = member as PropertyInfo;\n\t\t\tif (prop != null)\n\t\t\t\treturn prop.GetValue(Evaluate(me.Expression));\n\n\t\t\tthrow new Exception(\"Expression not supported: \" + expression);\n\t\t}\n\n\t\tstatic Expression ConstantToByteCode(object obj)\n\t\t{\n\t\t\tvar e = obj as Expression; if (e != null) return e;\n\t\t\tvar b = obj as byte[]; if (b != null) return new BlobLiteral(b);\n\t\t\tvar s = obj as string; if (s != null) return new StringLiteral(s);\n\t\t\tif (obj is bool) return new BooleanLiteral((bool) obj);\n\t\t\tif (obj is byte) return new NumberLiteral(NumberType.Byte, (byte) obj);\n\t\t\tif (obj is double) return new NumberLiteral(NumberType.Double, (double) obj);\n\t\t\tif (obj is float) return new NumberLiteral(NumberType.Float, (float) obj);\n\t\t\tif (obj is int) return new NumberLiteral(NumberType.Int, (int) obj);\n\t\t\tif (obj is sbyte) return new NumberLiteral(NumberType.SByte, (sbyte) obj);\n\t\t\tif (obj is short) return new NumberLiteral(NumberType.Short, (short) obj);\n\t\t\tif (obj is uint) return new NumberLiteral(NumberType.UInt, (uint) obj);\n\t\t\tif (obj is ushort) return new NumberLiteral(NumberType.UShort, (ushort) obj);\n\n\t\t\tthrow new Exception(\"Constant not supported: \" + obj);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/MetadataGenerator.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.UXIL;\nusing Uno.Collections;\nusing Uno.Compiler.API.Domain.IL;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator\n{\n\tpublic static class MetadataGenerator\n\t{\n\t\tpublic static ProjectMetadata GenerateMetadata(\n\t\t\tthis Project project,\n\t\t\tProjectObjectIdentifiers ids)\n\t\t{\n\t\t\tvar hierarchy = new ConcurrentDictionary<ObjectIdentifier, IEnumerable<ObjectIdentifier>>();\n\t\t\tvar precompiledElements = new List<PrecompiledElement>();\n\n\t\t\tvar nodeWorklist = new ConcurrentQueue<Node>();\n\t\t\tvar typeWorklist = new ConcurrentQueue<DataType>();\n\n\t\t\tforeach (var doc in project.RootClasses)\n\t\t\t\tnodeWorklist.Enqueue(doc.Root);\n\n\t\t\tNode node;\n\t\t\twhile (nodeWorklist.TryDequeue(out node))\n\t\t\t{\n\t\t\t\tAddMetadata(node, ids, hierarchy,\n\t\t\t\t\tdt =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar uxClass = dt as ClassNode;\n\t\t\t\t\t\tif (uxClass != null)\n\t\t\t\t\t\t\treturn ids\n\t\t\t\t\t\t\t\t.TryGetIdentifier(uxClass)\n\t\t\t\t\t\t\t\t.Select(id => new ObjectIdentifier(id.ToString()))\n\t\t\t\t\t\t\t\t.ToList();\n\n\t\t\t\t\t\treturn TryGetUnoDataType(dt)\n\t\t\t\t\t\t\t.MatchWith(\n\t\t\t\t\t\t\t\tnone: () => ImmutableList<ObjectIdentifier>.Empty,\n\t\t\t\t\t\t\t\tsome: unoDataType =>\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttypeWorklist.Enqueue(unoDataType);\n\n\t\t\t\t\t\t\t\t\treturn List.Create(new ObjectIdentifier(unoDataType.FullName));\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\tforeach (var child in node.Children)\n\t\t\t\t\tnodeWorklist.Enqueue(child);\n\t\t\t}\n\n\t\t\tDataType type;\n\t\t\twhile (typeWorklist.TryDequeue(out type))\n\t\t\t{\n\t\t\t\tif (IsUxDeclarable(type))\n\t\t\t\t\tprecompiledElements.Add(new PrecompiledElement(\n\t\t\t\t\t\tid: new ObjectIdentifier(type.FullName),\n\t\t\t\t\t\tsource:\n\t\t\t\t\t\t\t\"<\" + type.Base.FullName + \" ux:Class=\\\"\"+ type.FullName +\"\\\">\" +\n\t\t\t\t\t\t\t\ttype.Properties\n\t\t\t\t\t\t\t\t\t.Where(p => IsUxDeclarable(p.ReturnType))\n\t\t\t\t\t\t\t\t\t.Select(p => \"<\" + p.ReturnType.FullName + \" ux:Property=\\\"\" + p.Name + \"\\\" />\")\n\t\t\t\t\t\t\t\t\t.Join(\"\") +\n\t\t\t\t\t\t\t\"</\" + type.Base.FullName + \">\"));\n\n\t\t\t\thierarchy.AddOrUpdate(\n\t\t\t\t\tkey: new ObjectIdentifier(type.FullName),\n\t\t\t\t\taddValueFactory: _ =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar baseType = type.Base;\n\t\t\t\t\t\tif (baseType == null)\n\t\t\t\t\t\t\treturn ImmutableList<ObjectIdentifier>.Empty;\n\n\t\t\t\t\t\ttypeWorklist.Enqueue(baseType);\n\t\t\t\t\t\treturn List.Create(new ObjectIdentifier(baseType.FullName));\n\t\t\t\t\t},\n\t\t\t\t\tupdateValueFactory: (_, v) => v);\n\t\t\t}\n\n\t\t\treturn new ProjectMetadata(hierarchy.ToImmutableList(), precompiledElements.ToImmutableList());\n\t\t}\n\n\t\tstatic bool IsUxDeclarable(DataType type)\n\t\t{\n\t\t\treturn IsUxLike(type)\n\t\t\t\t&& type.Base != null\n\t\t\t\t&& IsUxLike(type.Base);\n\t\t}\n\n\t\tstatic bool IsUxLike(DataType type)\n\t\t{\n\t\t\treturn !type.IsGenericType && !type.IsGenericParameterization && !type.IsGenericDefinition && !type.IsArray;\n\t\t}\n\n\t\tpublic static Optional<DataType> TryGetUnoDataType(IDataType type)\n\t\t{\n\t\t\tif (type == null)\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar tryGetUnoTypeByName = TryGetUnoTypeByNameFactory(type);\n\n\t\t\tvar unoType = tryGetUnoTypeByName(type.QualifiedName);\n\t\t\tif (unoType == null)\n\t\t\t\treturn Optional.None();\n\n\t\t\treturn unoType;\n\t\t}\n\n\t\tstatic Func<string, DataType> TryGetUnoTypeByNameFactory(IDataType type)\n\t\t{\n\t\t\ttype = type.ActualIDataTypeImpl ?? type;\n\n\t\t\tvar cField = type.GetType().GetField(\"_c\", BindingFlags.NonPublic | BindingFlags.Instance);\n\t\t\tif (cField == null) // not available on deferred generic type etc\n\t\t\t\treturn name => null;\n\n\t\t\tvar c = cField.GetValue(type) as CompilerDataTypeProvider;\n\t\t\tif (c == null)\n\t\t\t\tthrow new Exception(\"UXIL private field hack broke\");\n\n\t\t\tvar tryGetUnoTypeByNameMethod = c.GetType().GetMethod(\"TryGetUnoTypeByName\", BindingFlags.NonPublic | BindingFlags.Instance);\n\t\t\tif (tryGetUnoTypeByNameMethod == null)\n\t\t\t\tthrow new Exception(\"UXIL private field hack broke\");\n\n\t\t\treturn name => tryGetUnoTypeByNameMethod.Invoke(c, new object[] { name }) as DataType;\n\t\t}\n\n\t\tstatic void AddMetadata(\n\t\t\tNode node,\n\t\t\tProjectObjectIdentifiers ids,\n\t\t\tConcurrentDictionary<ObjectIdentifier, IEnumerable<ObjectIdentifier>> metadata,\n\t\t\tFunc<IDataType, ImmutableList<ObjectIdentifier>> enqueue)\n\t\t{\n\t\t\tids.TryGetIdentifier(node).Do(id =>\n\t\t\t\tmetadata.AddOrUpdate(\n\t\t\t\t\tkey: id,\n\t\t\t\t\taddValueFactory: _ =>\n\t\t\t\t\t\tnode.MatchWith(\n\t\t\t\t\t\t\t(DocumentScope ds) => ds.MatchWith(\n\t\t\t\t\t\t\t\t(ClassNode cn) => enqueue(cn.BaseType),\n\t\t\t\t\t\t\t\t(TemplateNode tn) => enqueue(tn.ProducedType)),\n\t\t\t\t\t\t\t(ObjectNode on) => enqueue(on.DataType),\n\t\t\t\t\t\t\t(PropertyNode pn) => ImmutableList<ObjectIdentifier>.Empty,\n\t\t\t\t\t\t\t(DependencyNode dn) => ImmutableList<ObjectIdentifier>.Empty),\n\t\t\t\t\tupdateValueFactory: (_, v) => v));\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Outracks.Simulator.Main.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{E8884270-5F2C-4076-86D0-456B831BE3E5}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Simulator</RootNamespace>\n    <AssemblyName>Fuse.Simulator</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>obj/</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <UseVSHostingProcess>true</UseVSHostingProcess>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>obj/</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.IO.Compression\" />\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Build\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Build.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.API\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.API.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Compiler.Backends.CIL\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Compiler.Backends.CIL.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.UX.Markup\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.UX.Markup.dll</HintPath>\n    </Reference>\n    <Reference Include=\"UnoCore\">\n      <HintPath>..\\common\\bin\\UnoCore.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"BuildFailed.cs\" />\n    <Compile Include=\"CodeGeneration\\Paths.cs\" />\n    <Compile Include=\"UxFileContents.cs\" />\n    <Compile Include=\"Parser\\AccumulatingProgress.cs\" />\n    <Compile Include=\"Parser\\Caching\\CachingCompiler.cs\" />\n    <Compile Include=\"Parser\\Caching\\CachingDataType.cs\" />\n    <Compile Include=\"Parser\\Exceptions.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\GhostCompiler.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\GhostCompilerFactory.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\GhostDataType.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\GhostGlobalResource.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\GhostProperty.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\GlobalResourceNode.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\IMemberNode.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\OuterClassNode.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\PropertyNode.cs\" />\n    <Compile Include=\"Parser\\Ghosting\\UxXmlExtensions.cs\" />\n    <Compile Include=\"Parser\\HasErrorsErrorLogWrapper.cs\" />\n    <Compile Include=\"Parser\\ParsedDocument.cs\" />\n    <Compile Include=\"Parser\\UxParser.cs\" />\n    <Compile Include=\"CodeGeneration\\ReifyRequired.cs\" />\n    <Compile Include=\"CodeGeneration\\Context.cs\" />\n    <Compile Include=\"CodeGeneration\\Declarations.cs\" />\n    <Compile Include=\"CodeGeneration\\Exceptions.cs\" />\n    <Compile Include=\"CodeGeneration\\FileSources.cs\" />\n    <Compile Include=\"CodeGeneration\\FindNodesInScope.cs\" />\n    <Compile Include=\"CodeGeneration\\GetExpression.cs\" />\n    <Compile Include=\"CodeGeneration\\Initialization.cs\" />\n    <Compile Include=\"CodeGeneration\\Initialization.EventBindings.cs\" />\n    <Compile Include=\"CodeGeneration\\Initialization.ListProperties.cs\" />\n    <Compile Include=\"CodeGeneration\\Initialization.SingleProperties.cs\" />\n    <Compile Include=\"CodeGeneration\\Scopes.cs\" />\n    <Compile Include=\"CodeGeneration\\UxClasses.cs\" />\n    <Compile Include=\"CodeGeneration\\UxFactories.cs\" />\n    <Compile Include=\"CodeGeneration\\UxProperties.cs\" />\n    <Compile Include=\"CodeGeneration\\InvalidUXIL.cs\" />\n    <Compile Include=\"MetadataGenerator.cs\" />\n    <Compile Include=\"ExpressionConverter.cs\" />\n    <Compile Include=\"ProjectObjectIdentifiers.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Runtime\\DotNetBuild.cs\" />\n    <Compile Include=\"Runtime\\DotNetReflection.cs\" />\n    <Compile Include=\"Runtime\\MemoizingTypeMap.cs\" />\n    <Compile Include=\"Runtime\\TypeAliasNameResolver.cs\" />\n    <Compile Include=\"Runtime\\TypeMap.cs\" />\n    <Compile Include=\"UniqueNames.cs\" />\n    <Compile Include=\"UXIL\\Marshalling.cs\" />\n    <Compile Include=\"UXIL\\MatchWith.cs\" />\n    <Compile Include=\"ValueParser.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335BB78-0B8A-4D2F-919F-2E6F08883D51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Collections\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Uno.Collections.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/simulator/main/Parser/AccumulatingProgress.cs",
    "content": "using System;\nusing System.Collections.Immutable;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class AccumulatingProgress<T> : IProgress<T>\n\t{\n\t\treadonly IProgress<T> _progress;\n\n\t\tSystem.Collections.Immutable.ImmutableList<T> _reportedProgress = ImmutableList.Create<T>();\n\n\t\tpublic System.Collections.Immutable.ImmutableList<T> GetProgressSoFar()\n\t\t{\n\t\t\treturn _reportedProgress;\n\t\t}\n\n\t\tpublic AccumulatingProgress(IProgress<T> progress)\n\t\t{\n\t\t\t_progress = progress;\n\t\t}\n\n\t\tpublic void Report(T value)\n\t\t{\n\t\t\t_reportedProgress = _reportedProgress.Add(value);\n\t\t\t_progress.Report(value);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/Caching/CachingCompiler.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class CachingCompiler : IDataTypeProvider\n\t{\n\t\treadonly IDataTypeProvider _baseCompiler;\n\t\treadonly IDataType[] _dataTypes;\n\t\tpublic CachingCompiler(IDataTypeProvider baseCompiler)\n\t\t{\n\t\t\t_baseCompiler = baseCompiler;\n\t\t\t_dataTypes = baseCompiler.DataTypes.Select(Cache).ToArray();\n\t\t}\n\n\t\treadonly Dictionary<string, IDataType> _nameToType = new Dictionary<string, IDataType>();\n\t\tpublic IDataType TryGetTypeByName(string name)\n\t\t{\n\t\t\tIDataType dt;\n\t\t\tif (!_nameToType.TryGetValue(name, out dt))\n\t\t\t\t_nameToType[name] = dt = Cache(_baseCompiler.TryGetTypeByName(name));\n\t\t\treturn dt;\n\t\t}\n\n\t\treadonly Dictionary<string, IDataType> _genericAliasToType = new Dictionary<string, IDataType>();\n\t\tpublic IDataType GetTypeByGenericAlias(string alias)\n\t\t{\n\t\t\tIDataType dt;\n\t\t\tif (!_genericAliasToType.TryGetValue(alias, out dt))\n\t\t\t\t_genericAliasToType[alias] = dt = Cache(_baseCompiler.GetTypeByGenericAlias(alias));\n\t\t\treturn dt;\n\t\t}\n\n\t\treadonly Dictionary<string, IDataType> _valueBindingAliasToType = new Dictionary<string, IDataType>();\n\t\tpublic IDataType GetTypeByValueBindingAlias(string alias)\n\t\t{\n\t\t\tIDataType dt;\n\t\t\tif (!_valueBindingAliasToType.TryGetValue(alias, out dt))\n\t\t\t\t_valueBindingAliasToType[alias] = dt = Cache(_baseCompiler.GetTypeByValueBindingAlias(alias));\n\t\t\treturn dt;\n\t\t}\n\n\t\tIDataType Cache(IDataType dt)\n\t\t{\n\t\t\tif (dt == null) return null;\n\t\t\treturn new CachingDataType(dt);\n\t\t}\n\n\t\tpublic IDataType GetAttachedPropertyTypeByName(string name)\n\t\t{\n\t\t\treturn _baseCompiler.GetAttachedPropertyTypeByName(name);\n\t\t}\n\n\t\tpublic IEnumerable<IDataType> DataTypes\n\t\t{\n\t\t\tget { return _dataTypes; }\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/Caching/CachingDataType.cs",
    "content": "using System.Collections.Generic;\nusing Uno.UX;\nusing Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tclass CachingDataType : IDataType\n\t{\n\t\treadonly IDataType _dataType;\n\t\tpublic CachingDataType(IDataType dataType)\n\t\t{\n\t\t\t_dataType = dataType;\n\t\t}\n\n\t\treadonly Dictionary<string, bool> _implements = new Dictionary<string, bool>();\n\t\tpublic bool Implements(IDataType interfaceType)\n\t\t{\n\t\t\tvar name = interfaceType.FullName;\n\t\t\tbool ret;\n\t\t\tif (!_implements.TryGetValue(name, out ret))\n\t\t\t\t_implements[name] = ret = _dataType.Implements(\n\t\t\t\t\tinterfaceType is CachingDataType\n\t\t\t\t\t\t? ((CachingDataType)interfaceType)._dataType\n\t\t\t\t\t\t: interfaceType);\n\t\t\treturn ret;\n\t\t}\n\n\t\tstring _qualifiedName;\n\t\tpublic string QualifiedName\n\t\t{\n\t\t\tget { return _qualifiedName ?? (_qualifiedName = _dataType.QualifiedName); }\n\t\t}\n\n\t\tstring _fullName;\n\t\tpublic string FullName\n\t\t{\n\t\t\tget { return _fullName ?? (_fullName = _dataType.FullName); }\n\t\t}\n\n\t\t#region Forwarding to _dataType\n\n\t\tpublic bool IsInnerClass\n\t\t{\n\t\t\tget { return _dataType.IsInnerClass; }\n\t\t}\n\n\t\tpublic bool IsFreestanding\n\t\t{\n\t\t\tget { return _dataType.IsFreestanding; }\n\t\t}\n\n\t\tpublic IDataType ActualIDataTypeImpl\n\t\t{\n\t\t\tget { return _dataType.ActualIDataTypeImpl; }\n\t\t}\n\n\t\tpublic AutoGenericInfo AutoGenericInfo\n\t\t{\n\t\t\tget { return _dataType.AutoGenericInfo; }\n\t\t}\n\n\t\tpublic ValueBindingInfo ValueBindingInfo\n\t\t{\n\t\t\tget { return _dataType.ValueBindingInfo; }\n\t\t}\n\n\t\tpublic bool HasUXConstructor\n\t\t{\n\t\t\tget { return _dataType.HasUXConstructor; }\n\t\t}\n\n\t\tpublic bool IsValueType\n\t\t{\n\t\t\tget { return _dataType.IsValueType; }\n\t\t}\n\n\t\tpublic bool IsString\n\t\t{\n\t\t\tget { return _dataType.IsString; }\n\t\t}\n\n\t\tpublic string ImplicitPropertySetter\n\t\t{\n\t\t\tget { return _dataType.ImplicitPropertySetter; }\n\t\t}\n\n\t\tpublic IEnumerable<IProperty> Properties\n\t\t{\n\t\t\tget { return _dataType.Properties; }\n\t\t}\n\n\t\tpublic IEnumerable<IEvent> Events\n\t\t{\n\t\t\tget { return _dataType.Events; }\n\t\t}\n\n\t\tpublic IEnumerable<IGlobalResource> GlobalResources\n\t\t{\n\t\t\tget { return _dataType.GlobalResources; }\n\t\t}\n\n\t\tpublic ContentMode ContentMode\n\t\t{\n\t\t\tget { return _dataType.ContentMode; }\n\t\t}\n\n\t\tpublic bool IsGenericParametrization\n\t\t{\n\t\t\tget { return _dataType.IsGenericParametrization; }\n\t\t}\n\t\tpublic IEnumerable<string> Metadata\n\t\t{\n\t\t\tget { return _dataType.Metadata; }\n\t\t}\n\n\t\tpublic bool IsGlobalModule\n\t\t{\n\t\t\tget { return _dataType.IsGlobalModule; }\n\t\t}\n\n\t\tpublic string UXFunctionName\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _dataType.UXFunctionName;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetMissingPropertyHint(string propname)\n\t\t{\n\t\t\treturn _dataType.GetMissingPropertyHint(propname);\n\t\t}\n\n\t\tpublic int GenericParameterCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _dataType.GenericParameterCount;\n\t\t\t}\n\t\t}\n\n\t\tpublic string UXUnaryOperatorName\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _dataType.UXUnaryOperatorName;\n\t\t\t}\n\t\t}\n\n\t\tpublic IDataType UXTestBootstrapper\n\t\t{\n\t\t\tget { return _dataType.UXTestBootstrapper; }\n\t\t}\n\n\t\tpublic IEnumerable<string> UXTestBootstrapperFor\n\t\t{\n\t\t\tget { return _dataType.UXTestBootstrapperFor; }\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Parser/Exceptions.cs",
    "content": "﻿namespace Outracks.Simulator.Parser\n{\n\tpublic class UserCodeContainsErrors : BuildFailed\n\t{\n\t\tpublic override string Message\n\t\t{\n\t\t\tget { return \"Errors were encountered while building the project\"; }\n\t\t}\n\t}\n\n\tclass UnknownError : UserCodeContainsErrors\n\t{\n\t\treadonly string _message;\n\t\tpublic override string Message { get { return _message; } }\n\n\t\tpublic UnknownError(string message)\n\t\t{\n\t\t\t_message = message;\n\t\t}\n\n\t}\n\n\tclass InvalidMarkup : UserCodeContainsErrors\n\t{\n\t\tpublic readonly string File;\n\t\tpublic readonly Optional<TextPosition> Position;\n\t\treadonly string _message;\n\t\tpublic override string Message { get { return _message; } }\n\n\t\tpublic InvalidMarkup(string file, Optional<TextPosition> position, string message)\n\t\t{\n\t\t\tFile = file;\n\t\t\tPosition = position;\n\t\t\t_message = message;\n\t\t}\n\t}\n\n\tclass TypeNotFound : UserCodeContainsErrors\n\t{\n\t\tpublic readonly string TypeName;\n\t\tpublic readonly string File;\n\n\t\tpublic TypeNotFound(string typeName, string file)\n\t\t{\n\t\t\tTypeName = typeName;\n\t\t\tFile = file;\n\t\t}\n\t}\n\n\tclass UnknownBaseClass : UserCodeContainsErrors\n\t{\n\t\tpublic readonly string BaseClassName;\n\t\tpublic readonly string DeclaredClassName;\n\t\tpublic readonly string DeclaringFile;\n\n\t\tpublic UnknownBaseClass(string baseClassName, string declaredClassName, string declaringFile)\n\t\t{\n\t\t\tBaseClassName = baseClassName;\n\t\t\tDeclaredClassName = declaredClassName;\n\t\t\tDeclaringFile = declaringFile;\n\t\t}\n\t}\n\n\tclass UnknownMemberType : UserCodeContainsErrors\n\t{\n\t\tpublic readonly string TypeName;\n\t\tpublic readonly string MemberName;\n\t\tpublic readonly string DeclaringClassName;\n\t\tpublic readonly string DeclaringFile;\n\n\t\tpublic UnknownMemberType(IMemberNode member, OuterClassNode declaringNode)\n\t\t\t: this(member.TypeName, member.Name, declaringNode.GeneratedTypeName, declaringNode.DeclaringFile)\n\t\t{ }\n\n\t\tpublic UnknownMemberType(string typeName, string memberName, string declaringClassName, string declaringFile)\n\t\t{\n\t\t\tTypeName = typeName;\n\t\t\tMemberName = memberName;\n\t\t\tDeclaringClassName = declaringClassName;\n\t\t\tDeclaringFile = declaringFile;\n\t\t}\n\t}\n\n\tclass CyclicClassHierarchy : UserCodeContainsErrors\n\t{\n\t}\n\n\tclass TypeNameCollision : UserCodeContainsErrors\n\t{\n\t\tpublic readonly string TypeName;\n\t\tpublic TypeNameCollision(string typeName)\n\t\t{\n\t\t\tTypeName = typeName;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/GhostCompiler.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class GhostCompiler : IDataTypeProvider\n\t{\n\t\treadonly IDataTypeProvider _baseCompiler;\n\t\treadonly IImmutableList<IDataType> _ghostTypes;\n\t\treadonly Dictionary<string, IDataType> _ghostTypeDict = new Dictionary<string, IDataType>();\n\t\treadonly Dictionary<string, IDataType> _nameToTypeCache = new Dictionary<string, IDataType>(); // optimization\n\n\t\tpublic GhostCompiler(IDataTypeProvider baseCompiler, IImmutableList<IDataType> ghostTypes)\n\t\t{\n\t\t\t_baseCompiler = baseCompiler;\n\t\t\t_ghostTypes = ghostTypes;\n\t\t\tforeach (var t in ghostTypes) _ghostTypeDict.Add(t.FullName, t);\n\t\t}\n\n\t\tpublic IDataType TryGetTypeByName(string name)\n\t\t{\n\t\t\tIDataType res;\n\t\t\tif (!_nameToTypeCache.TryGetValue(name, out res))\n\t\t\t{\n\t\t\t\tif (!_ghostTypeDict.TryGetValue(name, out res))\n\t\t\t\t\tres = _baseCompiler.TryGetTypeByName(name);\n\t\t\t\tif (res != null) _nameToTypeCache.Add(name, res);\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic IDataType GetTypeByGenericAlias(string alias)\n\t\t{\n\t\t\treturn _ghostTypes.FirstOrDefault(d => d.AutoGenericInfo != null && d.AutoGenericInfo.Alias == alias) ?? _baseCompiler.GetTypeByGenericAlias(alias);\n\t\t}\n\n\t\tpublic IDataType GetTypeByValueBindingAlias(string alias)\n\t\t{\n\t\t\tif (alias == null)\n\t\t\t\talias = \"Data\"; // TODO: Was found in the CompilerReflection implementation, i don't know if it is needed. It may be a workaround for empty string...anyways, wut?\n\n\t\t\treturn _ghostTypes.FirstOrDefault(d => d.ValueBindingInfo != null && d.ValueBindingInfo.Alias == alias) ?? _baseCompiler.GetTypeByValueBindingAlias(alias);\n\t\t}\n\n\t\tpublic IDataType GetAttachedPropertyTypeByName(string name)\n\t\t{\n\t\t\treturn _baseCompiler.GetAttachedPropertyTypeByName(name);\n\t\t}\n\n\t\tpublic IEnumerable<IDataType> DataTypes\n\t\t{\n\t\t\tget { return _ghostTypes.Concat(_baseCompiler.DataTypes.Except(_ghostTypes, new DataTypeNameEquality())); }\n\t\t}\n\t}\n\n\tclass DataTypeNameEquality : IEqualityComparer<IDataType>\n\t{\n\t\tpublic bool Equals(IDataType x, IDataType y)\n\t\t{\n\t\t\treturn x.FullName == y.FullName;\n\t\t}\n\n\t\tpublic int GetHashCode(IDataType obj)\n\t\t{\n\t\t\treturn obj.FullName.GetHashCode();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/GhostCompilerFactory.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Linq;\nusing System.Xml;\nusing System.Xml.Linq;\nusing Outracks.Simulator.Protocol;\nusing Uno.UX.Markup;\nusing Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class GhostCompilerFactory\n\t{\n\t\treadonly IDataTypeProvider _realCompiler;\n\t\tpublic GhostCompilerFactory(IDataTypeProvider realCompiler)\n\t\t{\n\t\t\t_realCompiler = realCompiler;\n\t\t}\n\n\t\t/// <exception cref=\"InvalidMarkup\"></exception>\n\t\t/// <exception cref=\"CyclicClassHierarchy\"></exception>\n\t\t/// <exception cref=\"TypeNotFound\"></exception>\n\t\t/// <exception cref=\"UnknownBaseClass\"></exception>\n\t\t/// <exception cref=\"UnknownMemberType\"></exception>\n\t\t/// <exception cref=\"TypeNameCollision\"></exception>\n\t\tpublic IDataTypeProvider CreateGhostCompiler(System.Collections.Immutable.ImmutableList<UxFileContents> documents)\n\t\t{\n\t\t\treturn new GhostCompiler(_realCompiler, CreateGhostDataTypes(documents));\n\t\t}\n\n\t\t/// <exception cref=\"InvalidMarkup\"></exception>\n\t\t/// <exception cref=\"CyclicClassHierarchy\"></exception>\n\t\t/// <exception cref=\"TypeNotFound\"></exception>\n\t\t/// <exception cref=\"UnknownBaseClass\"></exception>\n\t\t/// <exception cref=\"UnknownMemberType\"></exception>\n\t\t/// <exception cref=\"TypeNameCollision\"></exception>\n\t\tIImmutableList<IDataType> CreateGhostDataTypes(System.Collections.Immutable.ImmutableList<UxFileContents> documents)\n\t\t{\n\t\t\tvar parsedDocuments = ParseDocuments(documents);\n\t\t\tvar nodes = parsedDocuments.SelectMany(OuterClassNode.GetOuterClassNodes);\n\t\t\tvar orderedNodes = OrderByDependencies(nodes);\n\n\t\t\tvar generatedDataTypes = new Dictionary<string, GhostDataType>();\n\t\t\tforeach (var node in orderedNodes)\n\t\t\t{\n\t\t\t\tvar n = node;\n\t\t\t\tvar baseType = TryGetDataType(node.BaseTypeName, generatedDataTypes)\n\t\t\t\t\t.OrThrow(new UnknownBaseClass(node.BaseTypeName, n.GeneratedTypeName, n.DeclaringFile));\n\n\t\t\t\tgeneratedDataTypes[node.GeneratedTypeName] = new GhostDataType(\n\t\t\t\t\tn.GeneratedTypeName,\n\t\t\t\t\tbaseType,\n\n\t\t\t\t\tglobalResources: self => n.GlobalResources.Select(\n\t\t\t\t\t\tr => new GhostGlobalResource(\n\t\t\t\t\t\t\tfullPath: n.GeneratedTypeName + \".\" + r.Name,\n\t\t\t\t\t\t\tdataType: GetMemberDataType(r, n, generatedDataTypes),\n\t\t\t\t\t\t\tglobalSymbol: r.Name)),\n\n\t\t\t\t\tdeclaredProperties: self => n.Properties.Select(\n\t\t\t\t\t\tp => new GhostProperty(\n\t\t\t\t\t\t\tname: p.Name,\n\t\t\t\t\t\t\tdataType: GetMemberDataType(p, n, generatedDataTypes),\n\t\t\t\t\t\t\tdeclaringType: self)));\n\t\t\t}\n\n\t\t\tforeach (var ghostType in generatedDataTypes.Values)\n\t\t\t\tghostType.CompleteType();\n\n\t\t\treturn ImmutableList.ToImmutableList<IDataType>(generatedDataTypes.Values);\n\t\t}\n\n\t\t/// <exception cref=\"UnknownMemberType\"></exception>\n\t\tIDataType GetMemberDataType(IMemberNode member, OuterClassNode declaringNode, IDictionary<string, GhostDataType> generatedDataTypes)\n\t\t{\n\t\t\treturn TryGetDataType(member.TypeName, generatedDataTypes)\n\t\t\t\t.OrThrow(new UnknownMemberType(member, declaringNode));\n\t\t}\n\n\t\tOptional<IDataType> TryGetDataType(string name, IDictionary<string, GhostDataType> generatedDataTypes)\n\t\t{\n\t\t\treturn generatedDataTypes.TryGetValue(name).Select(t => (IDataType)t).Or(TryGetCompiledType(name));\n\t\t}\n\n\t\tOptional<IDataType> TryGetCompiledType(string typeName)\n\t\t{\n\t\t\tvar baseDataType = _realCompiler.TryGetTypeByName(typeName);\n\t\t\tif (baseDataType != null)\n\t\t\t\treturn Optional.Some(baseDataType);\n\n\t\t\tforeach (var ns in Configuration.DefaultNamespaces)\n\t\t\t{\n\t\t\t\tvar bd = _realCompiler.TryGetTypeByName(ns + \".\" + typeName);\n\t\t\t\tif (bd != null)\n\t\t\t\t\treturn Optional.Some(bd);\n\t\t\t}\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\t/// <exception cref=\"InvalidMarkup\"></exception>\n\t\tstatic IImmutableList<ParsedDocument> ParseDocuments(System.Collections.Immutable.ImmutableList<UxFileContents> documents)\n\t\t{\n\t\t\treturn ImmutableList.ToImmutableList(\n\t\t\t\tdocuments.Select(doc => new ParsedDocument(ParseXml(doc), doc.Path)));\n\t\t}\n\n\t\t/// <exception cref=\"InvalidMarkup\"></exception>\n\t\tstatic XElement ParseXml(UxFileContents document)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tusing (var stream = ToMemoryStream(document.Contents))\n\t\t\t\t\treturn XmlHelpers.ReadAllXml(stream, LoadOptions.SetLineInfo, true).Root;\n\t\t\t}\n\t\t\tcatch (XmlException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidMarkup(\n\t\t\t\t\tdocument.Path,\n\t\t\t\t\tnew TextPosition(new LineNumber(e.LineNumber + 1), new CharacterNumber(e.LinePosition + 1)),\n\t\t\t\t\te.Message);\n\t\t\t}\n\t\t\tcatch (MarkupException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidMarkup(\n\t\t\t\t\tdocument.Path,\n\t\t\t\t\tOptional.None(),\n\t\t\t\t\te.Message);\n\t\t\t}\n\t\t}\n\n\t\tstatic Stream ToMemoryStream(string data)\n\t\t{\n\t\t\tvar stream = new MemoryStream();\n\t\t\tvar writer = new StreamWriter(stream);\n\t\t\twriter.Write(data);\n\t\t\twriter.Flush();\n\t\t\tstream.Position = 0;\n\t\t\treturn stream;\n\t\t}\n\n\t\t/// <exception cref=\"TypeNameCollision\"></exception>\n\t\t/// <exception cref=\"CyclicClassHierarchy\"></exception>\n\t\tstatic IEnumerable<OuterClassNode> OrderByDependencies(IEnumerable<OuterClassNode> unorderedNodes)\n\t\t{\n\t\t\tvar nodes = MapNodesByName(unorderedNodes);\n\n\t\t\tvar visited = new Dictionary<OuterClassNode, bool>();\n\t\t\tvar sorted = new List<OuterClassNode>();\n\n\t\t\tAction<OuterClassNode> visit = null;\n\t\t\tvisit = (item) =>\n\t\t\t{\n\t\t\t\tbool inProcess;\n\t\t\t\tvar alreadyVisited = visited.TryGetValue(item, out inProcess);\n\n\t\t\t\tif (alreadyVisited && inProcess)\n\t\t\t\t\tthrow new CyclicClassHierarchy();\n\n\t\t\t\tif (!alreadyVisited)\n\t\t\t\t{\n\t\t\t\t\tvisited[item] = true;\n\n\t\t\t\t\tOuterClassNode dependency;\n\t\t\t\t\tif (nodes.TryGetValue(item.BaseTypeName, out dependency))\n\t\t\t\t\t\tvisit(dependency);\n\n\t\t\t\t\tvisited[item] = false;\n\t\t\t\t\tsorted.Add(item);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tforeach (var item in nodes.Values)\n\t\t\t\tvisit(item);\n\n\t\t\treturn sorted;\n\t\t}\n\n\t\t/// <exception cref=\"TypeNameCollision\"></exception>\n\t\tstatic Dictionary<string, OuterClassNode> MapNodesByName(IEnumerable<OuterClassNode> unorderedNodes)\n\t\t{\n\t\t\tvar nodes = new Dictionary<string, OuterClassNode>();\n\t\t\tforeach (var n in unorderedNodes)\n\t\t\t{\n\t\t\t\tif (nodes.ContainsKey(n.GeneratedTypeName))\n\t\t\t\t\tthrow new TypeNameCollision(n.GeneratedTypeName);\n\n\t\t\t\tnodes.Add(n.GeneratedTypeName, n);\n\t\t\t}\n\t\t\treturn nodes;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/GhostDataType.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Uno.UX;\nusing Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tclass GhostDataType : IDataType\n\t{\n\t\treadonly string _name;\n\t\treadonly IDataType _baseType;\n\t\treadonly Func<GhostDataType, IEnumerable<IGlobalResource>> _globalResourcesFactory;\n\t\treadonly Func<GhostDataType, IEnumerable<IProperty>> _declaredPropertiesFactory;\n\n\t\tImmutableList<IGlobalResource> _globalResources;\n\t\tImmutableList<IProperty> _declaredProperties;\n\n\t\tpublic GhostDataType(\n\t\t\tstring name,\n\t\t\tIDataType baseType,\n\t\t\tFunc<GhostDataType, IEnumerable<IGlobalResource>> globalResources,\n\t\t\tFunc<GhostDataType, IEnumerable<IProperty>> declaredProperties)\n\t\t{\n\t\t\tif (string.IsNullOrWhiteSpace(name))\n\t\t\t\tthrow new ArgumentNullException(\"name\");\n\t\t\tif (baseType == null)\n\t\t\t\tthrow new ArgumentNullException(\"baseType\");\n\n\t\t\t_name = name;\n\t\t\t_baseType = baseType;\n\t\t\t_globalResourcesFactory = globalResources;\n\t\t\t_declaredPropertiesFactory = declaredProperties;\n\t\t}\n\n\t\tpublic void CompleteType()\n\t\t{\n\t\t\tif (_globalResources != null)\n\t\t\t\tthrow new InvalidOperationException(\"Ghost type \"+_name+\" is already completed\");\n\n\t\t\t_globalResources = _globalResourcesFactory(this).ToImmutableList();\n\t\t\t_declaredProperties = _declaredPropertiesFactory(this).ToImmutableList();\n\t\t}\n\n\t\tpublic bool IsInnerClass\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n\t\tpublic bool IsFreestanding\n\t\t{\n\t\t\tget { return _baseType.IsFreestanding; }\n\t\t}\n\n\t\tpublic string QualifiedName\n\t\t{\n\t\t\tget { return _name; }\n\t\t}\n\n\t\tpublic string FullName\n\t\t{\n\t\t\tget { return _name; }\n\t\t}\n\n\t\tpublic IEnumerable<IGlobalResource> GlobalResources\n\t\t{\n\t\t\tget { return _globalResources.Union(_baseType.GlobalResources, new GlobalResourceEqualityComparer()); }\n\t\t}\n\t\tpublic IEnumerable<IProperty> Properties\n\t\t{\n\t\t\tget { return _baseType.Properties.Union(DeclaredUXProperties); }\n\t\t}\n\n\t\tpublic IEnumerable<IProperty> DeclaredUXProperties\n\t\t{\n\t\t\tget { return _declaredProperties; }\n\t\t}\n\n\t\t#region Forwarding to _baseType\n\n\t\tpublic bool Implements(IDataType interfaceType)\n\t\t{\n\t\t\treturn _baseType.Implements(interfaceType);\n\t\t}\n\n\t\tpublic bool IsGenericParametrization\n\t\t{\n\t\t\tget { return _baseType.IsGenericParametrization; }\n\t\t}\n\n\t\tpublic IDataType ActualIDataTypeImpl\n\t\t{\n\t\t\tget { return _baseType.ActualIDataTypeImpl; }\n\t\t}\n\n\t\tpublic AutoGenericInfo AutoGenericInfo\n\t\t{\n\t\t\tget { return _baseType.AutoGenericInfo; }\n\t\t}\n\n\t\tpublic ValueBindingInfo ValueBindingInfo\n\t\t{\n\t\t\tget { return _baseType.ValueBindingInfo; }\n\t\t}\n\n\t\tpublic bool HasUXConstructor\n\t\t{\n\t\t\tget { return _baseType.HasUXConstructor; }\n\t\t}\n\n\t\tpublic bool IsValueType\n\t\t{\n\t\t\tget { return _baseType.IsValueType; }\n\t\t}\n\n\t\tpublic bool IsString\n\t\t{\n\t\t\tget { return _baseType.IsString; }\n\t\t}\n\n\t\tpublic string ImplicitPropertySetter\n\t\t{\n\t\t\tget { return _baseType.ImplicitPropertySetter; }\n\t\t}\n\n\t\tpublic IEnumerable<IEvent> Events\n\t\t{\n\t\t\tget { return _baseType.Events; }\n\t\t}\n\n\t\tpublic ContentMode ContentMode\n\t\t{\n\t\t\tget { return _baseType.ContentMode; }\n\t\t}\n\n\t\tpublic IEnumerable<string> Metadata\n\t\t{\n\t\t\tget { return _baseType.Metadata; }\n\t\t}\n\n\t\tpublic bool IsGlobalModule\n\t\t{\n\t\t\tget { return _baseType.IsGlobalModule; }\n\t\t}\n\n\t\tpublic string UXFunctionName\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _baseType.UXFunctionName;\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetMissingPropertyHint(string propname)\n\t\t{\n\t\t\treturn _baseType.GetMissingPropertyHint(propname);\n\t\t}\n\n\t\tpublic int GenericParameterCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _baseType.GenericParameterCount;\n\t\t\t}\n\t\t}\n\n\t\tpublic string UXUnaryOperatorName\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _baseType.UXUnaryOperatorName;\n\t\t\t}\n\t\t}\n\n\t\tpublic IDataType UXTestBootstrapper\n\t\t{\n\t\t\tget { return _baseType.UXTestBootstrapper; }\n\t\t}\n\n\t\tpublic IEnumerable<string> UXTestBootstrapperFor\n\t\t{\n\t\t\tget { return _baseType.UXTestBootstrapperFor; }\n\t\t}\n\n\t\t#endregion\n\t}\n\n\tclass GlobalResourceEqualityComparer : IEqualityComparer<IGlobalResource>\n\t{\n\t\tpublic bool Equals(IGlobalResource x, IGlobalResource y)\n\t\t{\n\t\t\treturn x.GlobalSymbol.Equals(y.GlobalSymbol);\n\t\t}\n\n\t\tpublic int GetHashCode(IGlobalResource obj)\n\t\t{\n\t\t\treturn obj.GlobalSymbol.GetHashCode();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/GhostGlobalResource.cs",
    "content": "using Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tclass GhostGlobalResource : IGlobalResource\n\t{\n\t\tpublic GhostGlobalResource(string fullPath, IDataType dataType, string globalSymbol)\n\t\t{\n\t\t\tGlobalSymbol = globalSymbol;\n\t\t\tDataType = dataType;\n\t\t\tFullPath = fullPath;\n\t\t}\n\n\t\tpublic string FullPath { get; private set; }\n\t\tpublic IDataType DataType { get; private set; }\n\t\tpublic string GlobalSymbol { get; private set; }\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/GhostProperty.cs",
    "content": "using System;\nusing Uno.UX.Markup.Reflection;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class GhostProperty : IMutableProperty\n\t{\n\t\treadonly string _name;\n\t\treadonly IDataType _dataType;\n\t\treadonly IDataType _declaringType;\n\n\t\tpublic GhostProperty(string name, IDataType dataType, IDataType declaringType)\n\t\t{\n\t\t\t_name = name;\n\t\t\t_dataType = dataType;\n\t\t\t_declaringType = declaringType;\n\t\t}\n\n\t\tpublic bool Accepts(IDataType type)\n\t\t{\n\t\t\treturn type.Implements(DataType);\n\t\t}\n\n\t\tpublic IDataType DeclaringType { get { return _declaringType; } }\n\t\tpublic string Name { get { return _name; } }\n\t\tpublic IDataType DataType { get { return _dataType; } }\n\n\t\tpublic bool CanGet { get { return true; } }\n\t\tpublic bool CanSet { get { return true; } }\n\n\t\tpublic bool IsUXOnlyAutoIfClassProperty { get { return false; } }\n\t\tpublic bool IsUXAutoNameTableProperty { get { return false; } }\n\t\tpublic bool IsUXAutoClassNameProperty { get { return false; } }\n\n\t\tpublic bool IsUXNameProperty { get { return false; } }\n\t\tpublic bool IsUXFileNameProperty { get { return false; } }\n\t\tpublic bool IsConstructorArgument { get { return false; } }\n\t\tpublic bool IsStyleList { get { return false; } }\n\t\tpublic bool IsActualDataTypeAvailable { get { return true; } }\n\t\tpublic bool IsOfGenericArgumentType { get { return false; } }\n\n\t\tpublic IDataType ListItemType\n\t\t{\n\t\t\tget { throw new InvalidOperationException(); }\n\t\t}\n\n\t\tpublic PropertyType PropertyType\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (DataType.IsValueType || DataType.IsString) return PropertyType.Atomic;\n\t\t\t\telse return PropertyType.Atomic;\n\t\t\t}\n\t\t}\n\n\t\tpublic AutoBindingType AutoBindingType\n\t\t{\n\t\t\tget { return AutoBindingType.None; }\n\t\t}\n\n\t\tpublic string StyleListAddMethod\n\t\t{\n\t\t\tget { throw new InvalidOperationException(); }\n\t\t}\n\n\t\tpublic string OriginSetterName\n\t\t{\n\t\t\tget { throw new InvalidOperationException(); }\n\t\t}\n\n\t\tpublic string ValueChangedEvent\n\t\t{\n\t\t\tget { throw new InvalidOperationException(); }\n\t\t}\n\n\t\tpublic int UXArgumentIndex\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsUXVerbatim\n\t\t{\n\t\t\tget { return false; }\n\t\t}\n\n        public string UXAuxNameTable\n        {\n            get\n            {\n                return null;\n            }\n        }\n\n        public IdentifierScope UXIdentifierScope\n        {\n            get\n            {\n                return IdentifierScope.Globals;\n            }\n        }\n    }\n}"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/GlobalResourceNode.cs",
    "content": "using System.Collections.Generic;\nusing System.Xml.Linq;\n\nnamespace Outracks.Simulator.Parser\n{\n\tsealed class GlobalResourceNode : IMemberNode\n\t{\n\t\tpublic static IEnumerable<GlobalResourceNode> GetGlobalResourcesIn(XElement elm)\n\t\t{\n\t\t\tforeach (var child in elm.DescendantsInDocumentScope())\n\t\t\t{\n\t\t\t\tvar globalAttr = child.TryGetUxAttribute(\"Global\");\n\t\t\t\tif (globalAttr.HasValue)\n\t\t\t\t\tyield return new GlobalResourceNode(globalAttr.Value, child.Name.LocalName);\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name { get; private set; }\n\t\tpublic string TypeName { get; private set; }\n\n\t\tpublic GlobalResourceNode(string name, string typeName)\n\t\t{\n\t\t\tName = name;\n\t\t\tTypeName = typeName;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/IMemberNode.cs",
    "content": "namespace Outracks.Simulator.Parser\n{\n\tinterface IMemberNode\n\t{\n\t\tstring TypeName { get; }\n\t\tstring Name { get; }\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/OuterClassNode.cs",
    "content": "using System.Collections.Generic;\nusing System.IO;\nusing System.Xml.Linq;\n\nnamespace Outracks.Simulator.Parser\n{\n\tclass OuterClassNode\n\t{\n\t\tpublic static IEnumerable<OuterClassNode> GetOuterClassNodes(ParsedDocument doc)\n\t\t{\n\t\t\tvar root = doc.RootElement;\n\t\t\t{\n\t\t\t\tvar classAttrValue = root.TryGetUxAttribute(\"Class\");\n\t\t\t\tvar classNameAttrValue = root.TryGetUxAttribute(\"ClassName\");\n\t\t\t\tvar className = classAttrValue.Or(classNameAttrValue);\n\t\t\t\tvar classNameForApp = Path.GetFileNameWithoutExtension(doc.Path);\n\n\t\t\t\tif (className.HasValue || IsApp(root))\n\t\t\t\t\tyield return new OuterClassNode(\n\t\t\t\t\t\tclassName.Or(classNameForApp),\n\t\t\t\t\t\troot.Name.LocalName,\n\t\t\t\t\t\tdoc.Path,\n\t\t\t\t\t\tGlobalResourceNode.GetGlobalResourcesIn(root),\n\t\t\t\t\t\tPropertyNode.GetPropertiesIn(root));\n\t\t\t}\n\n\t\t\tforeach (var child in doc.RootElement.Descendants())\n\t\t\t{\n\t\t\t\tvar simulateAttrValue = child.TryGetUxAttribute(\"Simulate\");\n\t\t\t\tif (simulateAttrValue.HasValue &&\n\t\t\t\t\t\tbool.TryParse(simulateAttrValue.Value, out bool simulate) &&\n\t\t\t\t\t\t!simulate)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar classAttrValue = child.TryGetUxAttribute(\"Class\");\n\t\t\t\tif (classAttrValue.HasValue)\n\t\t\t\t\tyield return new OuterClassNode(\n\t\t\t\t\t\tclassAttrValue.Value,\n\t\t\t\t\t\tchild.Name.LocalName,\n\t\t\t\t\t\tdoc.Path,\n\t\t\t\t\t\tGlobalResourceNode.GetGlobalResourcesIn(child),\n\t\t\t\t\t\tPropertyNode.GetPropertiesIn(child));\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsApp(XElement element)\n\t\t{\n\t\t\treturn element.Name.LocalName == \"App\" || element.Name.LocalName == \"Fuse.App\";\n\t\t}\n\n\t\tpublic readonly string DeclaringFile;\n\t\tpublic readonly string GeneratedTypeName;\n\t\tpublic readonly string BaseTypeName;\n\t\tpublic readonly ImmutableList<GlobalResourceNode> GlobalResources;\n\t\tpublic readonly ImmutableList<PropertyNode> Properties;\n\n\t\tpublic OuterClassNode(\n\t\t\tstring generatedTypeName,\n\t\t\tstring baseTypeName,\n\t\t\tstring declaringFile,\n\t\t\tIEnumerable<GlobalResourceNode> globalResources,\n\t\t\tIEnumerable<PropertyNode> properties)\n\t\t{\n\t\t\tGeneratedTypeName = generatedTypeName;\n\t\t\tBaseTypeName = baseTypeName;\n\t\t\tDeclaringFile = declaringFile;\n\t\t\tProperties = properties.ToImmutableList();\n\t\t\tGlobalResources = globalResources.ToImmutableList();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/PropertyNode.cs",
    "content": "using System.Collections.Generic;\nusing System.Xml.Linq;\n\nnamespace Outracks.Simulator.Parser\n{\n\tsealed class PropertyNode : IMemberNode\n\t{\n\t\tpublic static IEnumerable<PropertyNode> GetPropertiesIn(XElement elm)\n\t\t{\n\t\t\tforeach (var child in elm.DescendantsInDocumentScope())\n\t\t\t{\n\t\t\t\tvar globalAttr = child.TryGetUxAttribute(\"Property\");\n\t\t\t\tif (globalAttr.HasValue)\n\t\t\t\t\tyield return new PropertyNode(globalAttr.Value, child.Name.LocalName);\n\t\t\t}\n\t\t}\n\n\t\tpublic string Name { get; private set; }\n\t\tpublic string TypeName { get; private set; }\n\n\t\tpublic PropertyNode(string name, string typeName)\n\t\t{\n\t\t\tName = name;\n\t\t\tTypeName = typeName;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/Ghosting/UxXmlExtensions.cs",
    "content": "using System.Collections.Generic;\nusing System.Xml.Linq;\nusing Uno.UX.Markup;\n\nnamespace Outracks.Simulator.Parser\n{\n\tstatic class UxXmlExtensions\n\t{\n\t\tpublic static IEnumerable<XElement> DescendantsInDocumentScope(this XElement element, XElement parentScope = null)\n\t\t{\n\t\t\tparentScope = parentScope ?? element;\n\n\t\t\tforeach (var child in element.Elements())\n\t\t\t{\n\t\t\t\tyield return child;\n\t\t\t\tif (!child.TryGetUxAttribute(\"Class\").HasValue)\n\t\t\t\t\tforeach (var nonDirectChild in DescendantsInDocumentScope(child, parentScope))\n\t\t\t\t\t\tyield return nonDirectChild;\n\t\t\t}\n\t\t}\n\n\n\t\tpublic static Optional<string> TryGetUxAttribute(this XElement elm, string name)\n\t\t{\n\t\t\tforeach (var t in elm.Attributes())\n\t\t\t{\n\t\t\t\tif (t.Name.NamespaceName == Configuration.UXNamespace && t.Name.LocalName == name)\n\t\t\t\t\treturn t.Value;\n\t\t\t}\n\n\t\t\treturn Optional.None();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/HasErrorsErrorLogWrapper.cs",
    "content": "﻿using Uno.UX.Markup.Common;\n\nnamespace Outracks.Simulator.Parser\n{\n\tclass HasErrorsErrorLogWrapper : IMarkupErrorLog\n\t{\n\t\tpublic bool HasErrors { get; private set; }\n\n\t\treadonly IMarkupErrorLog _innerLog;\n\n\t\tpublic HasErrorsErrorLogWrapper(IMarkupErrorLog innerLog)\n\t\t{\n\t\t\t_innerLog = innerLog;\n\t\t}\n\n\t\tpublic void ReportError(string message)\n\t\t{\n\t\t\tHasErrors = true;\n\t\t\t_innerLog.ReportError(message);\n\t\t}\n\n\t\tpublic void ReportWarning(string message)\n\t\t{\n\t\t\t_innerLog.ReportWarning(message);\n\t\t}\n\n\t\tpublic void ReportError(string path, int line, string message)\n\t\t{\n\t\t\tHasErrors = true;\n\t\t\t_innerLog.ReportError(path, line, message);\n\t\t}\n\n\t\tpublic void ReportWarning(string path, int line, string message)\n\t\t{\n\t\t\t_innerLog.ReportWarning(path, line, message);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Parser/ParsedDocument.cs",
    "content": "using System.Xml.Linq;\n\nnamespace Outracks.Simulator.Parser\n{\n\tclass ParsedDocument\n\t{\n\t\tpublic readonly XElement RootElement;\n\t\tpublic readonly string Path;\n\n\t\tpublic ParsedDocument(XElement rootElement, string path)\n\t\t{\n\t\t\tRootElement = rootElement;\n\t\t\tPath = path;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Parser/UxParser.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Xml;\nusing Outracks.Simulator.Protocol;\nusing Uno.UX.Markup;\nusing Uno.UX.Markup.Common;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.Parser\n{\n\tpublic class UxParser\n\t{\n\t\treadonly string _project;\n\t\treadonly GhostCompilerFactory _ghostCompilerFactory;\n\n\t\tpublic UxParser(\n\t\t\tstring project,\n\t\t\tGhostCompilerFactory ghostCompilerFactory)\n\t\t{\n\t\t\t_project = project;\n\t\t\t_ghostCompilerFactory = ghostCompilerFactory;\n\t\t}\n\n\t\t/// <exception cref=\"UserCodeContainsErrors\"></exception>\n\t\tpublic Project Parse(System.Collections.Immutable.ImmutableList<UxFileContents> documents, IMarkupErrorLog reporter)\n\t\t{\n\t\t\tconst string restartSuggestion = \"Restarting Fuse might be required for changes in Uno code to take effect\";\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar ghostCompiler = _ghostCompilerFactory.CreateGhostCompiler(documents);\n\t\t\t\tvar docs = Parse(documents, ghostCompiler, reporter);\n\t\t\t\treturn docs;\n\t\t\t}\n\t\t\tcatch (InvalidMarkup e)\n\t\t\t{\n\t\t\t\treporter.ReportError(e.File, e.Position.HasValue ? e.Position.Value.Line : 1, e.Message);\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (CyclicClassHierarchy)\n\t\t\t{\n\t\t\t\treporter.ReportError(\"UX class hierarchy contains cycles\");\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (TypeNotFound e)\n\t\t\t{\n\t\t\t\treporter.ReportError(e.File, 1, \"Type \" + e.TypeName + \" not found (\" + restartSuggestion + \")\");\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (UnknownBaseClass e)\n\t\t\t{\n\t\t\t\treporter.ReportError(e.DeclaringFile, 1, \"Unknown base class \" + e.BaseClassName + \" for class \" + e.DeclaredClassName + \" (\" + restartSuggestion + \")\");\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (UnknownMemberType e)\n\t\t\t{\n\t\t\t\treporter.ReportError(e.DeclaringFile, 1, \"Unknown type \" + e.TypeName + \" for member \"+ e.MemberName+\" in \" + e.DeclaringClassName + \".\");\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch(TypeNameCollision e)\n\t\t\t{\n\t\t\t\treporter.ReportError(\"Multiple definitions of type \" + e.TypeName + \" in project\");\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (UnknownError e)\n\t\t\t{\n\t\t\t\t// TODO: this reports an unavidable already reported NRE.. should get rid of that somehow\n\t\t\t\treporter.ReportError(e.Message);\n\t\t\t\tthrow;\n\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"UserCodeContainsErrors\"></exception>\n\t\tProject Parse(IEnumerable<UxFileContents> documents, IDataTypeProvider ghostCompiler, IMarkupErrorLog log)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar markupErrorLog = new HasErrorsErrorLogWrapper(log);\n\n\t\t\t\tvar result = Compiler.Compile(\n\t\t\t\t\tghostCompiler,\n\t\t\t\t\tdocuments.Select(x => new Compiler.UXSource(x.Path, x.Contents)),\n\t\t\t\t\tPath.GetDirectoryName(_project),\n\t\t\t\t\t\"Project\",\n\t\t\t\t\tnull,\n\t\t\t\t\tmarkupErrorLog);\n\n\t\t\t\tif (result == null)\n\t\t\t\t\tthrow new UserCodeContainsErrors();\n\n\t\t\t\tif (markupErrorLog.HasErrors)\n\t\t\t\t\tthrow new UserCodeContainsErrors();\n\n\t\t\t\treturn result;\n\n\t\t\t}\n\t\t\tcatch (UserCodeContainsErrors)\n\t\t\t{\n\t\t\t\tthrow;\n\t\t\t}\n\t\t\tcatch (XmlException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidMarkup(\n\t\t\t\t\te.SourceUri,\n\t\t\t\t\tnew TextPosition(new LineNumber(e.LineNumber + 1), new CharacterNumber(e.LinePosition + 1)),\n\t\t\t\t\te.Message);\n\t\t\t}\n\t\t\tcatch (MarkupException e)\n\t\t\t{\n\t\t\t\tthrow new InvalidMarkup(\n\t\t\t\t\te.Source,\n\t\t\t\t\tOptional.None(),\n\t\t\t\t\te.Message);\n\t\t\t}\n\t\t\tcatch (Exception e) // this dumb\n\t\t\t{\n\t\t\t\tthrow new UnknownError(e.Message);\n\t\t\t}\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "src/simulator/main/ProjectObjectIdentifiers.cs",
    "content": "using System;\nusing System.Collections.Immutable;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator\n{\n\tpublic class ProjectObjectIdentifiers\n\t{\n\t\tpublic static ProjectObjectIdentifiers Create(Project project, IDataTypeProvider typeInfo, Action<Exception> onError)\n\t\t{\n\t\t\tvar idToNode = ImmutableDictionary.CreateBuilder<ObjectIdentifier, Node>();\n\t\t\tvar nodeToId = ImmutableDictionary.CreateBuilder<Node, ObjectIdentifier>();\n\n\n\t\t\tforeach (var kp in project.Documents)\n\t\t\t{\n\t\t\t\tvar path = kp.Key;\n\t\t\t\tvar document = kp.Value;\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar index = 0;\n\t\t\t\t\tforeach (var node in document.NodesInDocumentOrder)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar id = new ObjectIdentifier(path, index);\n\t\t\t\t\t\tidToNode[id] = node;\n\t\t\t\t\t\tnodeToId[node] = id;\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tonError(e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new ProjectObjectIdentifiers\n\t\t\t{\n\t\t\t\t_idToNode = idToNode.ToImmutable(),\n\t\t\t\t_nodeToId = nodeToId.ToImmutable(),\n\t\t\t};\n\t\t}\n\n\t\tImmutableDictionary<ObjectIdentifier, Node> _idToNode;\n\t\tImmutableDictionary<Node, ObjectIdentifier> _nodeToId;\n\n\t\tpublic Optional<Node> TryGetNode(ObjectIdentifier id)\n\t\t{\n\t\t\tNode node;\n\t\t\tif (_idToNode.TryGetValue(id, out node))\n\t\t\t\treturn node;\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tpublic Optional<ObjectIdentifier> TryGetIdentifier(Node node)\n\t\t{\n\t\t\tObjectIdentifier id;\n\t\t\tif (_nodeToId.TryGetValue(node, out id))\n\t\t\t\treturn id;\n\n\t\t\treturn Optional.None();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n[assembly: AssemblyTitle(\"Outracks.Simulator.Host\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: InternalsVisibleTo(\"Outracks.Simulator.Tests\")]\n"
  },
  {
    "path": "src/simulator/main/Runtime/DotNetBuild.cs",
    "content": "using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing Uno.Build;\nusing Uno.Compiler.Backends.CIL;\n\nnamespace Outracks.Simulator.Client\n{\n\tpublic class DotNetBuild\n\t{\n\t\tpublic static string SaveMetadata(BuildResult buildResult)\n\t\t{\n\t\t\tvar cilBackend = (CilResult)buildResult.BackendResult;\n\t\t\tvar assemblyPath = GetDllPath(buildResult);\n\n\t\t\tvar metadata = new DotNetBuild(\n\t\t\t\tassembly: Path.GetFileName(assemblyPath),\n\t\t\t\tentrypointClass: buildResult.Compiler.Data.MainClass.FullName,\n\t\t\t\tgeneratedTypeNames:\n\t\t\t\t\tcilBackend.AllUnoTypeNames.ToDictionary(\n\t\t\t\t\t\tkeySelector: name => name,\n\t\t\t\t\t\telementSelector: cilBackend.GetCilTypeFromUnoName));\n\n\t\t\tusing (var metadataFile = File.OpenWrite(GetMetadataPath(buildResult.OutputDirectory)))\n\t\t\t\tmetadata.WriteTo(metadataFile);\n\n\t\t\treturn assemblyPath;\n\t\t}\n\n\t\tpublic static string GetDllPath(BuildResult buildResult)\n\t\t{\n\t\t\tvar cilBackend = (CilResult)buildResult.BackendResult;\n\t\t\tvar outputDir = buildResult.OutputDirectory;\n\t\t\tvar assemblyName = cilBackend.AssemblyName;\n\t\t\tvar dllFilename = assemblyName + \".dll\";\n\t\t\treturn Path.Combine(outputDir, dllFilename);\n\t\t}\n\n\t\tpublic static string GetMetadataPath(string outputDir)\n\t\t{\n\t\t\treturn Path.Combine(outputDir, \"metadata.json\");\n\t\t}\n\n\t\tpublic static DotNetBuild LoadMetadata(string outputDir)\n\t\t{\n\t\t\tusing (var stream = File.OpenRead(GetMetadataPath(outputDir)))\n\t\t\t\treturn ReadFrom(stream);\n\t\t}\n\n\t\tpublic static DotNetBuild ReadFrom(Stream stream)\n\t\t{\n\t\t\treturn Parse(JToken.ReadFrom(new JsonTextReader(new StreamReader(stream))));\n\t\t}\n\n\t\tpublic static DotNetBuild Parse(JToken json)\n\t\t{\n\t\t\treturn new DotNetBuild(\n\t\t\t\tassembly: json[\"Assembly\"].ToObject<string>(),\n\t\t\t\tentrypointClass: json[\"EntrypointClass\"].ToObject<string>(),\n\t\t\t\tgeneratedTypeNames: json[\"GeneratedTypeNames\"].ToObject<Dictionary<JToken, JToken>>().ToDictionary(\n\t\t\t\t\tkv => kv.Key.ToObject<string>(),\n\t\t\t\t\tkv => kv.Value.ToObject<string>()));\n\t\t}\n\n\t\tpublic void WriteTo(Stream stream)\n\t\t{\n\t\t\tusing (var writer = new JsonTextWriter(new StreamWriter(stream)))\n\t\t\t\tSerialize().WriteTo(writer);\n\t\t}\n\n\t\tpublic JObject Serialize()\n\t\t{\n\t\t\treturn new JObject\n\t\t\t{\n\t\t\t\t{ \"Assembly\", JToken.FromObject(Assembly) },\n\t\t\t\t{ \"EntrypointClass\", JToken.FromObject(EntrypointClass) },\n\t\t\t\t{ \"GeneratedTypeNames\", JToken.FromObject(GeneratedTypeNames) },\n\t\t\t};\n\t\t}\n\n\t\tpublic readonly string Assembly;\n\t\tpublic readonly string EntrypointClass;\n\t\tpublic readonly IDictionary<string, string> GeneratedTypeNames;\n\n\t\tpublic DotNetBuild(\n\t\t\tstring assembly,\n\t\t\tstring entrypointClass,\n\t\t\tIDictionary<string, string> generatedTypeNames)\n\t\t{\n\t\t\tAssembly = assembly;\n\t\t\tEntrypointClass = entrypointClass;\n\t\t\tGeneratedTypeNames = generatedTypeNames;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Runtime/DotNetReflection.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.ExceptionServices;\nusing System.Runtime.InteropServices;\nusing System.Runtime.Serialization;\nusing Outracks.Simulator.Runtime;\nusing Uno;\n\nnamespace Outracks.Simulator.Client\n{\n\tpublic interface ITypeMap\n\t{\n\t\tType ResolveType(string typeName);\n\t}\n\n\tpublic class DotNetReflection : IReflection\n\t{\n\t\tpublic static DotNetReflection Load(string outputDir)\n\t\t{\n\t\t\treturn Load(outputDir, DotNetBuild.LoadMetadata(outputDir));\n\t\t}\n\n\t\tpublic static DotNetReflection Load(string outputDir, DotNetBuild metadata)\n\t\t{\n\t\t\tSetUnmanagedLibraryDirectory(outputDir);\n\n\t\t\tvar main = Assembly.LoadFrom(Path.Combine(outputDir, metadata.Assembly));\n\t\t\tvar assemblies = new List<Assembly> {main};\n\t\t\tassemblies.Add(typeof(string).Assembly);\n\t\t\tassemblies.Add(typeof(DotNetReflection).Assembly);\n\t\t\tassemblies.Add(typeof(Application).Assembly);\n\n\t\t\tforeach (var name in main.GetReferencedAssemblies())\n\t\t\t\tassemblies.Add(GetAssembly(outputDir, name));\n\n\t\t\t// Workaround errors in empty app when drag-dropping from toolbar\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.DatePicker\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.Native\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.Navigation\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.Panels\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.Primitives\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.ScrollView\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.TimePicker\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.Video\")));\n\t\t\tassemblies.Add(GetAssembly(outputDir, new AssemblyName(\"Fuse.Controls.WebView\")));\n\n\t\t\treturn new DotNetReflection(\n\t\t\t\tnew MemoizingTypeMap(\n\t\t\t\t\tnew TypeMap(\n\t\t\t\t\t\tnew TypeAliasNameResolver2(metadata.GeneratedTypeNames),\n\t\t\t\t\t\tassemblies.ToArray()\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tstatic Assembly GetAssembly(string outputDir, AssemblyName name)\n\t\t{\n\t\t\t// Don't load assemblies we already have, to avoid type confusion (TypeLoadException).\n\t\t\tforeach (var asm in AppDomain.CurrentDomain.GetAssemblies())\n\t\t\t\tif (asm.GetName().Name == name.Name)\n\t\t\t\t\treturn asm;\n\n\t\t\tvar filename = Path.Combine(outputDir, name.Name + \".dll\");\n\t\t\treturn File.Exists(filename)\n\t\t\t\t? Assembly.LoadFrom(filename)\n\t\t\t\t: typeof(Application).Assembly;\n\t\t}\n\n\t\tstatic void SetUnmanagedLibraryDirectory(string dir)\n\t\t{\n\t\t\t// We need a workaround for Windows\n\t\t\tif (Path.DirectorySeparatorChar == '\\\\')\n\t\t\t{\n\t\t\t\t// Problem #1\n\t\t\t\t// - Uno.Native.dll & related unmanaged libraries are copied by 'uno build' to the output directory of Outracks.Simulator.unoproj\n\t\t\t\t// - fuse-preview.csproj depends on Outracks.Simulator.dll, and indirectly on Uno.Native.dll, but without copying the unmanaged libraries\n\t\t\t\t// - At runtime, Uno.Native.dll lazy loads it's unmanaged libraries, but a since a diffent Uno.Native.dll than we think is used, it doesn't find the unmanaged libraries (on Windows)\n\n\t\t\t\t// We can make Windows find the correct unmanaged libraries using this system call.\n\t\t\t\tSetDllDirectory(dir);\n\t\t\t}\n\n\t\t\t// Problem #2\n\t\t\t// - Uno.Native.dll uses a Initialize(string dllDir) method to initialize itself\n\t\t\t// - When lazy initializing, dllDir is detected automatically based on the location of the calling assembly\n\t\t\t// - Since Fuse Studio also has a copy of the calling assembly (UnoCore.dll), there are no unmanaged libraries at this location either\n\n\t\t\t// We can solve this by calling Initialize(string dllDir) ourselves.\n\n\t\t\t// Problem #3\n\t\t\t// - Uno.Native.dll and related unmanaged libraries are considered legacy code, and currently in the process of being removed\n\t\t\t// - When removed, Uno.Native.dll and Initialize(string dllDir) will no longer exist, so the following code would stop working\n\n\t\t\t// We can solve this by loading Uno.Native.dll using reflection and just early-out if things don't exist.\n\n\t\t\tvar asm = Assembly.LoadFrom(Path.Combine(dir, \"Uno.Native.dll\"));\n\t\t\tif (asm == null) return;\n\n\t\t\tvar type = asm.GetType(\"Uno.Native.NativeLib\");\n\t\t\tif (type == null) return;\n\n\t\t\tvar method = type.GetMethod(\"Initialize\", new[] { typeof(string) });\n\t\t\tif (method == null) return;\n\n\t\t\tmethod.Invoke(null, new object[] { dir });\n\n\t\t\t// - The above code is eventually safe to remove, but SetDllDirectory() will likely still be needed because of the 'copy of UnoCore.dll'-fluke\n\t\t\t// - In the future, UnoHost will likely be moved completely to Uno where we have more control over this, so Fuse Studio don't have to deal with such things.\n\t\t}\n\n\t\t[DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n\t\tstatic extern bool SetDllDirectory(string path);\n\t\treadonly ITypeMap _typeMap;\n\n\t\tpublic DotNetReflection(ITypeMap typeMap)\n\t\t{\n\t\t\t_typeMap = typeMap;\n\t\t}\n\n\t\tpublic object GetPropertyValue(object obj, string propertyName)\n\t\t{\n\t\t\tvar prop = ResolveProperty(obj, propertyName);\n\t\t\tvar getter = prop.GetMethod;\n\t\t\tif (getter == null)\n\t\t\t\tthrow new InvalidOperationException(\"Property \" + propertyName + \" has no getter\");\n\n\t\t\treturn prop.GetMethod.TryInvoke(obj, new object[0]);\n\t\t}\n\n\t\tpublic void SetPropertyValue(object obj, string propertyName, object value)\n\t\t{\n\t\t\tvar prop = ResolveProperty(obj, propertyName);\n\t\t\tvar setter = prop.SetMethod;\n\t\t\tif (setter == null)\n\t\t\t\tthrow new InvalidOperationException(\"Property \" + propertyName + \" has no setter\");\n\n\t\t\tsetter.TryInvoke(obj, new[] { value });\n\t\t}\n\n\t\tstatic PropertyInfo ResolveProperty(object obj, string propertyName)\n\t\t{\n\t\t\tif (obj == null)\n\t\t\t\tthrow new ArgumentNullException(\"obj\");\n\n\t\t\tvar objType = obj.GetType();\n\t\t\tvar props = objType.GetProperties();\n\n\t\t\tfor (var type = objType; type != null; type = type.BaseType)\n\t\t\t{\n\t\t\t\tvar p = props.FirstOrDefault(x => x.DeclaringType == type && x.Name == propertyName);\n\t\t\t\tif (p != null)\n\t\t\t\t\treturn p;\n\t\t\t}\n\n\t\t\tthrow new MemberNotFound(objType.FullName, propertyName);\n\t\t}\n\n\t\tpublic object CreateDelegate(object instance, string methodName, string[] methodArgumentTypes, string delegateTypeName)\n\t\t{\n\t\t\tvar type = instance.GetType();\n\n\t\t\tvar method = methodArgumentTypes != null\n\t\t\t\t? type.GetMethod(\n\t\t\t\t\tmethodName,\n\t\t\t\t\tmethodArgumentTypes.Select(_typeMap.ResolveType).ToArray())\n\t\t\t\t: type.GetMethod(methodName);\n\n\t\t\tif (method == null)\n\t\t\t\tthrow new MemberNotFound(type.FullName, methodName);\n\n\t\t\treturn method.CreateDelegate(_typeMap.ResolveType(delegateTypeName), instance);\n\t\t}\n\n\t\tpublic void AddEventHandler(object instance, string member, object handlerDelegate)\n\t\t{\n\t\t\tvar type = instance.GetType();\n\t\t\tvar theEvent = type.GetEvent(member);\n\t\t\tif (theEvent == null)\n\t\t\t\tthrow new MemberNotFound(type.FullName, member);\n\n\t\t\ttheEvent.AddEventHandler(instance, ((Delegate)handlerDelegate).Cast(theEvent.EventHandlerType));\n\t\t}\n\n\t\tpublic void RemoveEventHandler(object instance, string member, object handlerDelegate)\n\t\t{\n\t\t\tvar type = instance.GetType();\n\t\t\tvar theEvent = type.GetEvent(member);\n\t\t\tif (theEvent == null)\n\t\t\t\tthrow new MemberNotFound(type.FullName, member);\n\n\t\t\ttheEvent.RemoveEventHandler(instance, ((Delegate)handlerDelegate).Cast(theEvent.EventHandlerType));\n\t\t}\n\n\t\tpublic object CallDynamic(object obj, string methodName, params object[] arguments)\n\t\t{\n\t\t\tvar type = obj.GetType();\n\n\t\t\treturn FindUnambiguousMethod(type, methodName, arguments).TryInvoke(obj, arguments);\n\t\t}\n\n\t\tpublic object CallStatic(string typeName, string methodName, params object[] arguments)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\treturn FindUnambiguousMethod(type, methodName, arguments).TryInvoke(null, arguments);\n\t\t}\n\n\t\tstatic MethodInfo FindUnambiguousMethod(Type type, string methodName, object[] arguments)\n\t\t{\n\t\t\tvar methods = type.GetMethods()\n\t\t\t\t.Where(m => m.Name == methodName)\n\t\t\t\t.Where(m => m.GetParameters().ParametersMatch(arguments))\n\t\t\t\t.Take(2)\n\t\t\t\t.ToArray();\n\n\t\t\tif (methods.Length == 0)\n\t\t\t\tthrow new MemberNotFound(type.FullName, methodName);\n\n\t\t\tif (methods.Length > 1)\n\t\t\t\tthrow new UnambiguousMethodNotFound(type.FullName, methodName);\n\n\t\t\treturn methods[0];\n\t\t}\n\n\t\tpublic object CallStatic(string typeName, string methodName, string[] genericArguments, object[] arguments)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\tvar method = type.GetMethod(methodName).MakeGenericMethod(genericArguments.Select(t => _typeMap.ResolveType(t)).ToArray());\n\t\t\tif (method == null)\n\t\t\t\tthrow new MemberNotFound(type.FullName, methodName);\n\n\t\t\treturn method.TryInvoke(null, arguments);\n\t\t}\n\n\t\tpublic void SetStaticField(string typeName, string fieldName, object value)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\tvar field = type.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);\n\t\t\tif (field == null)\n\t\t\t\tthrow new MemberNotFound(typeName, fieldName);\n\n\t\t\tTryInvokeExtension.Try(\n\t\t\t\t() =>\n\t\t\t\t{\n\t\t\t\t\tfield.SetValue(null, value);\n\t\t\t\t\treturn null;\n\t\t\t\t});\n\t\t}\n\n\t\tpublic object GetStaticPropertyOrFieldValue(string typeName, string memberName)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\tvar prop = type.GetProperty(memberName);\n\t\t\tif (prop != null)\n\t\t\t\treturn prop.GetMethod.Invoke(null, new object[0]);\n\n\t\t\tvar field = type.GetField(memberName);\n\t\t\tif (field != null)\n\t\t\t\treturn field.GetValue(null);\n\n\t\t\tthrow new MemberNotFound(typeName, memberName);\n\t\t}\n\n\t\tpublic  object Instantiate(string typeName, params object[] args)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null)\n\t\t\t\tthrow new TypeNotFound(typeName);\n\n\t\t\treturn TryInvokeExtension.Try(\n\t\t\t\t() => (type.IsValueType && args.Length == 0)\n\t\t\t\t\t? FormatterServices.GetUninitializedObject(type)\n\t\t\t\t\t: type.GetConstructors().First(c => c.GetParameters().ParametersMatch(args)).Invoke(args));\n\t\t}\n\n\t\tpublic bool IsSubtype(object obj, string typeName)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(typeName);\n\t\t\tif (type == null) return false;\n\t\t\treturn type.IsInstanceOfType(obj);\n\t\t}\n\n\t\tpublic bool IsType(object obj, string typeName)\n\t\t{\n\t\t\treturn obj.GetType().FullName == typeName;\n\t\t}\n\n\t\tpublic object GetEnumValue(string enumType, string valueName)\n\t\t{\n\t\t\tvar type = _typeMap.ResolveType(enumType);\n\t\t\treturn Enum.Parse(type, valueName);\n\t\t}\n\t}\n\n\tpublic static class DelegateUtility\n\t{\n\t\tpublic static bool ParametersMatch(this ParameterInfo[] prms, object[] arguments)\n\t\t{\n\t\t\tif (arguments.Length > prms.Length)\n\t\t\t\treturn false;\n\n\t\t\tfor (int i = 0; i < prms.Length; i++)\n\t\t\t{\n\t\t\t\tvar param = prms[i];\n\t\t\t\tif (arguments.Length < i + 1)\n\t\t\t\t{\n\t\t\t\t\treturn param.HasDefaultValue;\n\t\t\t\t}\n\t\t\t\tvar arg = arguments[i];\n\n\t\t\t\tif (arg == null)\n\t\t\t\t{\n\t\t\t\t\t// all non-value types can accept null\n\t\t\t\t\tif (param.ParameterType.IsValueType)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!param.ParameterType.IsInstanceOfType(arg))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t// From http://code.logos.com/blog/2008/07/casting_delegates.html\n\t\tpublic static Delegate Cast(this Delegate source, Type type)\n\t\t{\n\t\t\tif (source == null)\n\t\t\t\treturn null;\n\n\t\t\tDelegate[] delegates = source.GetInvocationList();\n\t\t\tif (delegates.Length == 1)\n\t\t\t\treturn Delegate.CreateDelegate(type,\n\t\t\t\t\tdelegates[0].Target, delegates[0].Method);\n\n\t\t\tDelegate[] delegatesDest = new Delegate[delegates.Length];\n\t\t\tfor (int nDelegate = 0; nDelegate < delegates.Length; nDelegate++)\n\t\t\t\tdelegatesDest[nDelegate] = Delegate.CreateDelegate(type,\n\t\t\t\t\tdelegates[nDelegate].Target, delegates[nDelegate].Method);\n\t\t\treturn Delegate.Combine(delegatesDest);\n\t\t}\n\t}\n\tstatic class TryInvokeExtension\n\t{\n\t\tpublic static object TryInvoke(this MethodInfo mi, object obj, params object[] value)\n\t\t{\n\t\t\treturn Try(() => mi.Invoke(obj, value));\n\t\t}\n\n\t\tpublic static object Try(Func<object> func)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn func();\n\t\t\t}\n\t\t\tcatch (TargetInvocationException tie)\n\t\t\t{\n\t\t\t\tExceptionDispatchInfo.Capture(tie.InnerException ?? tie).Throw();\n\t\t\t\tthrow tie.InnerException ?? tie; // this will never happen\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Runtime/MemoizingTypeMap.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Outracks.Simulator.Client\n{\n\tpublic class MemoizingTypeMap : ITypeMap\n\t{\n\t\treadonly IDictionary<string, Type> _cache = new Dictionary<string, Type>();\n\t\treadonly ITypeMap _typeMap;\n\t\tpublic MemoizingTypeMap(ITypeMap typeMap)\n\t\t{\n\t\t\t_typeMap = typeMap;\n\t\t}\n\n\t\tpublic Type ResolveType(string typeName)\n\t\t{\n\t\t\tType type;\n\t\t\tif (!_cache.TryGetValue(typeName, out type))\n\t\t\t\t_cache[typeName] = type = _typeMap.ResolveType(typeName);\n\t\t\treturn type;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/Runtime/TypeAliasNameResolver.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Uno.Compiler.API.Domain;\n\nnamespace Outracks.Simulator.Client\n{\n\tpublic class TypeAliasNameResolver2 : ITypeAliasNameResolver\n\t{\n\t\treadonly IDictionary<string, string> _cilTypeMap;\n\n\t\tpublic TypeAliasNameResolver2(IDictionary<string, string> cilTypeMap)\n\t\t{\n\t\t\t_cilTypeMap = cilTypeMap;\n\n\t\t\t// HACK: Add missing UnoCore types.\n\t\t\t// We should probably figure out why this happen in the first place.\n\t\t\tAddMissing(\"Uno.Collections.List`1\", \"System.Collections.Generic.List`1\");\n\t\t}\n\n\t\tpublic string Resolve(string typeName)\n\t\t{\n\t\t\tstring aliasedTypeName;\n\t\t\tif (!TypeAliases.TryGetAliasFromType(typeName, out aliasedTypeName))\n\t\t\t\taliasedTypeName = typeName;\n\n\t\t\t//if (aliasedTypeName.Contains(\"`\"))\n\t\t\t//\taliasedTypeName = aliasedTypeName.BeforeFirst(\"`\") + \"<\" + new string(',', int.Parse(aliasedTypeName.AfterFirst(\"`\"))-1) + \">\";\n\n\t\t\tstring cilType;\n\t\t\tif (_cilTypeMap.TryGetValue(aliasedTypeName, out cilType))\n\t\t\t\treturn cilType;\n\n\t\t\treturn typeName;\n\t\t}\n\n\t\tvoid AddMissing(string key, string value)\n\t\t{\n\t\t\tif (!_cilTypeMap.ContainsKey(key))\n\t\t\t\t_cilTypeMap[key] = value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/main/Runtime/TypeMap.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reflection;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Runtime;\n\nnamespace Outracks.Simulator.Client\n{\n\tpublic interface ITypeAliasNameResolver\n\t{\n\t\tstring Resolve(string typeName);\n\t}\n\n\tpublic class TypeMap : ITypeMap\n\t{\n\t\treadonly ITypeAliasNameResolver _aliases;\n\t\treadonly Assembly[] _assemblies;\n\n\t\tpublic TypeMap(\n\t\t\tITypeAliasNameResolver aliases,\n\t\t\tparams Assembly[] assemblies)\n\t\t{\n\t\t\t_aliases = aliases;\n\t\t\t_assemblies = assemblies.ToArray();\n\t\t}\n\n\t\tpublic Type ResolveType(string typeNameString)\n\t\t{\n\t\t\tvar typeName = TypeName.Parse(typeNameString);\n\n\t\t\tif (typeName.IsParameterizedGenericType)\n\t\t\t\treturn TryResolveGenericType(typeName);\n\n\t\t\treturn AntialiasAndLoad(typeName);\n\t\t}\n\n\t\tType TryResolveGenericType(TypeName typeName)\n\t\t{\n\t\t\tvar genericType = AntialiasAndLoad(typeName.WithGenericSuffix);\n\t\t\tvar typeArguments = typeName.GenericArgumentsRecursively.Select(AntialiasAndLoad);\n\n\t\t\treturn genericType.MakeGenericType(typeArguments.ToArray());\n\t\t}\n\n\t\tType AntialiasAndLoad(TypeName typeName)\n\t\t{\n\t\t\tvar resolvingTypeName = typeName.IsParameterizedGenericType\n\t\t\t\t? typeName.WithGenericSuffix\n\t\t\t\t: typeName;\n\t\t\treturn LoadType(Antialias(resolvingTypeName));\n\t\t}\n\n\t\tType LoadType(TypeName typeName)\n\t\t{\n\t\t\tforeach (var ass in _assemblies)\n\t\t\t{\n\t\t\t\tvar type = ass.GetType(typeName.FullName);\n\t\t\t\tif (type != null)\n\t\t\t\t\treturn type;\n\t\t\t}\n\n\t\t\tthrow new TypeNotFound(typeName.FullName);\n\t\t}\n\n\t\tTypeName Antialias(TypeName typeName)\n\t\t{\n\t\t\treturn TypeName.Parse(_aliases.Resolve(typeName.FullName));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/UXIL/Marshalling.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml;\nusing System.Xml.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Uno.UX.Markup;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator.UXIL\n{\n\tpublic static class Marshalling\n\t{\n\t\tpublic static IEnumerable<ValueSource> ConstructorArguments(this NewObjectNode self)\n\t\t{\n\t\t\t\tvar args = self.DataType.Properties.Where(x => x.IsConstructorArgument);\n\t\t\t\tforeach (var arg in args)\n\t\t\t\t{\n\t\t\t\t\tvar p = self.Properties.FirstOrDefault(a => a.Facet == arg);\n\t\t\t\t\tif (p is AtomicProperty)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar ap = (AtomicProperty)p;\n\t\t\t\t\t\tif (ap.Value != null)\n\t\t\t\t\t\t    yield return new AtomicValueSource(ap.Value);\n\t\t\t\t\t}\n\t\t\t\t\telse if (p is ReferenceProperty)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar rp = (ReferenceProperty)p;\n\t\t\t\t\t\tif (rp.Source != null)\n\t\t\t\t\t\t    yield return rp.Source;\n\t\t\t\t\t}\n\t\t\t\t\telse throw new Exception(\"Unhandled constructor argument type: \" + p.GetType().FullName);\n\t\t\t\t}\n\n\t\t}\n\n\t\tpublic static Optional<TextPosition> TryGetTextPosition(this XObject element)\n\t\t{\n\t\t\tIXmlLineInfo info = element;\n\t\t\tif (!info.HasLineInfo())\n\t\t\t\treturn Optional.None();\n\n\t\t\treturn new TextPosition(\n\t\t\t\tnew LineNumber(info.LineNumber),\n\t\t\t\tnew CharacterNumber(info.LinePosition));\n\n\t\t}\n\n\t\tpublic static IEnumerable<Node> AllNodesInProject(this Project project)\n\t\t{\n\t\t\treturn project.RootClasses\n\t\t\t\t.SelectMany(AllNodesInDocument)\n\t\t\t\t.Distinct();\n\t\t}\n\n\t\tpublic static IEnumerable<Node> AllNodesInDocument(this ClassNode document)\n\t\t{\n\t\t\treturn document.AllScopes\n\t\t\t\t.SelectMany(scope => scope.NodesIncludingRoot)\n\t\t\t\t.Distinct();\n\t\t}\n\n\t\tpublic static TypeName GetTypeName(this IDataType dt)\n\t\t{\n\t\t\treturn TypeName.Parse(dt.QualifiedName);\n\t\t}\n\n\t\tpublic static TypeMemberName GetMemberName(this Event ev)\n\t\t{\n\t\t\treturn new TypeMemberName(ev.Facet.Name);\n\t\t}\n\n\t\tpublic static TypeMemberName GetMemberName(this Property p)\n\t\t{\n\t\t\treturn new TypeMemberName(p.Facet.Name);\n\t\t}\n\n\t\tpublic static StaticMemberName GetStaticMemberName(this IAttachedEvent a)\n\t\t{\n\t\t\treturn new StaticMemberName(\n\t\t\t\ta.DeclaringType.GetTypeName(),\n\t\t\t\tnew TypeMemberName(a.AddMethodName));\n\t\t}\n\n\n\t\tpublic static bool IsAttachedProperty(this Property p)\n\t\t{\n\t\t\treturn p.Facet is IAttachedProperty;\n\t\t}\n\n\t\tpublic static StaticMemberName GetEnumValueName(this EnumValue v)\n\t\t{\n\t\t\treturn new StaticMemberName(\n\t\t\t\tv.Enum.GetTypeName(),\n\t\t\t\tnew TypeMemberName(v.Enum.Literals.First(l => l.Value == v.LiteralIntValue).Name));\n\t\t}\n\n\t\tpublic static Optional<StaticMemberName> GetResetMethod(this Property p)\n\t\t{\n\t\t\tif (p.IsAttachedProperty())\n\t\t\t\treturn new StaticMemberName(\n\t\t\t\t\tp.Facet.DeclaringType.GetTypeName(),\n\t\t\t\t\tnew TypeMemberName(\"Reset\" + p.Facet.Name.AfterLast(\".\")));\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\n\t\tpublic static bool IsSize(this Property p)\n\t\t{\n\t\t\treturn p.Facet.DataType.FullName == \"Uno.UX.Size\";\n\t\t}\n\n\t\tpublic static bool IsSize2(this Property p)\n\t\t{\n\t\t\treturn p.Facet.DataType.FullName == \"Uno.UX.Size2\";\n\t\t}\n\n\t\tpublic static StaticMemberName GetSetMethodName(this Property p)\n\t\t{\n\t\t\tvar ap = (IAttachedProperty)p.Facet;\n\t\t\treturn new StaticMemberName(\n\t\t\t\tp.Facet.DeclaringType.GetTypeName(),\n\t\t\t\tnew TypeMemberName(ap.SetMethodName));\n\t\t}\n\n\t\tpublic static StaticMemberName GetGetMethodName(this Property p)\n\t\t{\n\t\t\tvar ap = (IAttachedProperty)p.Facet;\n\t\t\treturn new StaticMemberName(\n\t\t\t\tp.Facet.DeclaringType.GetTypeName(),\n\t\t\t\tnew TypeMemberName(ap.GetMethodName));\n\t\t}\n\n\t\tpublic static StaticMemberName GetPropertyObjectField(this Property p)\n\t\t{\n\t\t\treturn new StaticMemberName(\n\t\t\t\tp.Facet.DeclaringType.GetTypeName(),\n\t\t\t\tnew TypeMemberName(p.Facet.Name + \"Property\"));\n\t\t}\n\n\t\tpublic static IEnumerable<Property> SinglePropertiesWithValues(this Node node)\n\t\t{\n\t\t\treturn Enumerable.Union<Property>(\n\t\t\t\tnode.MutableAtomicPropertiesWithValues,\n\t\t\t\tnode.MutableReferencePropertiesWithValues);\n\t\t}\n\n\t\tpublic static TypeName ToTypeName(this TypeNameHelper tnh)\n\t\t{\n\t\t\treturn TypeName.Parse(tnh.FullName);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/UXIL/MatchWith.cs",
    "content": "using System;\nusing System.Linq;\nusing Outracks.Simulator.Bytecode;\nusing Uno.UX.Markup;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\nusing EventHandler = Uno.UX.Markup.UXIL.EventHandler;\nusing String = Uno.UX.Markup.String;\n\nnamespace Outracks.Simulator.UXIL\n{\n\tpublic static class MatchWithExtensions\n\t{\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis IEvent self,\n\t\t\tFunc<IAttachedEvent, T> a1,\n\t\t\tFunc<IRegularEvent, T> a2)\n\t\t{\n\t\t\tvar t1 = self as IAttachedEvent; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as IRegularEvent; if (t2 != null) return a2(t2);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis IProperty self,\n\t\t\tFunc<IAttachedProperty, T> a1,\n\t\t\tFunc<IProperty, T> a2)\n\t\t{\n\t\t\tvar t1 = self as IAttachedProperty; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self; if (t2 != null) return a2(t2);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis Node self,\n\t\t\tFunc<DocumentScope, T> a1,\n\t\t\tFunc<ObjectNode, T> a2,\n\t\t\tFunc<PropertyNode, T> a3,\n\t\t\tFunc<DependencyNode, T> a4)\n\t\t{\n\t\t\tvar t1 = self as DocumentScope; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as ObjectNode; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as PropertyNode; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as DependencyNode; if (t4 != null) return a4(t4);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis ObjectNode self,\n\t\t\tFunc<BoxedValueNode, T> a1,\n\t\t\tFunc<NewObjectNode, T> a2,\n\t\t\tFunc<ResourceRefNode, T> a3,\n\t\t\tFunc<NameTableNode, T> a4)\n\t\t{\n\t\t\tvar t1 = self as BoxedValueNode; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as NewObjectNode; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as ResourceRefNode; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as NameTableNode; if (t4 != null) return a4(t4);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis DocumentScope self,\n\t\t\tFunc<ClassNode, T> a1,\n\t\t\tFunc<TemplateNode, T> a3)\n\t\t{\n\t\t\tvar t1 = self as ClassNode; if (t1 != null) return a1(t1);\n\t\t\tvar t3 = self as TemplateNode; if (t3 != null) return a3(t3);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis ValueSource self,\n\t\t\tFunc<ReferenceSource, T> a1,\n\t\t\tFunc<AtomicValueSource, T> a2)\n\t\t{\n\t\t\tvar t1 = self as ReferenceSource; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as AtomicValueSource; if (t2 != null) return a2(t2);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis ReferenceSource self,\n\t\t\tFunc<BundleFileSource, T> a1,\n\t\t\tFunc<NodeSource, T> a2,\n\t\t\tFunc<UXPropertySource, T> a3,\n\t\t\tFunc<UXPropertyAccessorSource, T> a4)\n\t\t{\n\t\t\tvar t1 = self as BundleFileSource; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as NodeSource; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as UXPropertySource; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as UXPropertyAccessorSource; if (t4 != null) return a4(t4);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis AtomicValue self,\n\t\t\tFunc<Bool, T> a1,\n\t\t\tFunc<EnumValue, T> a2,\n\t\t\tFunc<ReferenceValue, T> a3,\n\t\t\tFunc<String, T> a4,\n\t\t\tFunc<Scalar, T> a6,\n\t\t\tFunc<Vector, T> a5,\n\t\t\tFunc<GlobalReferenceValue, T> a7,\n\t\t\tFunc<Size, T> a8,\n\t\t\tFunc<Size2, T> a9,\n\t\t\tFunc<Selector, T> a10)\n\t\t{\n\t\t\tvar t1 = self as Bool; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as EnumValue; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as ReferenceValue; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = self as String; if (t4 != null) return a4(t4);\n\t\t\tvar t6 = self as Scalar; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = self as GlobalReferenceValue; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = self as Size; if (t8 != null) return a8(t8);\n\t\t\tvar t9 = self as Size2; if (t9 != null) return a9(t9);\n\t\t\tvar t10 = self as Selector; if (t10 != null) return a10(t10);\n\t\t\treturn a5(new Vector(self));\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis Property self,\n\t\t\tFunc<BindableProperty, T> a1,\n\t\t\tFunc<AtomicProperty, T> a2,\n\t\t\tFunc<DelegateProperty, T> a3)\n\t\t{\n\t\t\tvar t1 = self as BindableProperty; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as AtomicProperty; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = self as DelegateProperty; if (t3 != null) return a3(t3);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis BindableProperty self,\n\t\t\tFunc<ListProperty, T> a1,\n\t\t\tFunc<ReferenceProperty, T> a2)\n\t\t{\n\t\t\tvar t1 = self as ListProperty; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as ReferenceProperty; if (t2 != null) return a2(t2);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tpublic static T MatchWith<T>(\n\t\t\tthis EventHandler self,\n\t\t\tFunc<EventMethod, T> a1,\n\t\t\tFunc<EventBinding, T> a2)\n\t\t{\n\t\t\tvar t1 = self as EventMethod; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = self as EventBinding; if (t2 != null) return a2(t2);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\t}\n\n\tpublic class Vector\n\t{\n\t\treadonly object _self;\n\t\tpublic Vector(object self)\n\t\t{\n\t\t\t_self = self;\n\n\t\t\tTypeName = TypeName.Parse(\n\t\t\t\tMatchWith(\n\t\t\t\t\t(Vector<int> v) => \"Uno.Int\" + v.ComponentCount,\n\t\t\t\t\t(Vector<uint> v) => \"Uno.UInt\" + v.ComponentCount,\n\t\t\t\t\t(Vector<short> v) => \"Uno.Short\" + v.ComponentCount,\n\t\t\t\t\t(Vector<byte> v) => \"Uno.Byte\" + v.ComponentCount,\n\t\t\t\t\t(Vector<ushort> v) => \"Uno.UShort\" + v.ComponentCount,\n\t\t\t\t\t(Vector<sbyte> v) => \"Uno.Sbyte\" + v.ComponentCount,\n\t\t\t\t\t(Vector<float> v) => \"Uno.Float\" + v.ComponentCount,\n\t\t\t\t\t(Vector<double> v) => \"Uno.Double\" + v.ComponentCount));\n\n\t\t\tComponents = MatchWith(\n\t\t\t\t(Vector<int> v) => v.Components.Cast<Scalar>().ToArray(),\n\t\t\t\t(Vector<uint> v) => v.Components.Cast<Scalar>().ToArray(),\n\t\t\t\t(Vector<short> v) => v.Components.Cast<Scalar>().ToArray(),\n\t\t\t\t(Vector<byte> v) => v.Components.Cast<Scalar>().ToArray(),\n\t\t\t\t(Vector<ushort> v) => v.Components.Cast<Scalar>().ToArray(),\n\t\t\t\t(Vector<sbyte> v) => v.Components.Cast<Scalar>().ToArray(),\n\t\t\t\t(Vector<float> v) => v.Components.Cast<Scalar>().ToArray(),\n\t\t\t\t(Vector<double> v) => v.Components.Cast<Scalar>().ToArray());\n\t\t}\n\n\t\tpublic readonly TypeName TypeName;\n\t\tpublic readonly Scalar[] Components;\n\n\t\tpublic T MatchWith<T>(\n\t\t\tFunc<Vector<int>, T> a1,\n\t\t\tFunc<Vector<uint>, T> a2,\n\t\t\tFunc<Vector<short>, T> a3,\n\t\t\tFunc<Vector<byte>, T> a4,\n\t\t\tFunc<Vector<ushort>, T> a5,\n\t\t\tFunc<Vector<sbyte>, T> a6,\n\t\t\tFunc<Vector<float>, T> a7,\n\t\t\tFunc<Vector<double>, T> a8)\n\t\t{\n\t\t\tvar t1 = _self as Vector<int>; if (t1 != null) return a1(t1);\n\t\t\tvar t2 = _self as Vector<uint>; if (t2 != null) return a2(t2);\n\t\t\tvar t3 = _self as Vector<short>; if (t3 != null) return a3(t3);\n\t\t\tvar t4 = _self as Vector<byte>; if (t4 != null) return a4(t4);\n\t\t\tvar t5 = _self as Vector<ushort>; if (t5 != null) return a5(t5);\n\t\t\tvar t6 = _self as Vector<sbyte>; if (t6 != null) return a6(t6);\n\t\t\tvar t7 = _self as Vector<float>; if (t7 != null) return a7(t7);\n\t\t\tvar t8 = _self as Vector<double>; if (t8 != null) return a8(t8);\n\t\t\tthrow new ArgumentException();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/UniqueNames.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.CodeGeneration;\nusing Uno.UX;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator\n{\n\tpublic class UniqueNames\n\t{\n\t\treadonly ImmutableDictionary<object, Variable> _names;\n\t\treadonly ImmutableDictionary<Variable, object> _namesInverse;\n\n\t\tpublic UniqueNames()\n\t\t\t: this(\n\t\t\t\tImmutableDictionary<object, Variable>.Empty,\n\t\t\t\tImmutableDictionary<Variable, object>.Empty)\n\t\t{ }\n\n\t\tUniqueNames(\n\t\t\tImmutableDictionary<object, Variable> names,\n\t\t\tImmutableDictionary<Variable, object> namesInverse)\n\t\t{\n\t\t\t_names = names;\n\t\t\t_namesInverse = namesInverse;\n\t\t}\n\n\t\tpublic Variable this[Node node]\n\t\t{\n\t\t\tget { return _names[node]; }\n\t\t}\n\n\t\tpublic UniqueNames GenerateNames(IEnumerable<Node> nodes)\n\t\t{\n\t\t\tvar names = _names.ToBuilder();\n\t\t\tvar usedNames = _namesInverse.ToBuilder();\n\t\t\tforeach (var node in nodes)\n\t\t\t{\n\t\t\t\tif (!names.ContainsKey(node))\n\t\t\t\t{\n\t\t\t\t\tvar name = GetName(node, usedNames);\n\t\t\t\t\t// Beware! we might hide names, but that's how ux works\n\t\t\t\t\tusedNames[name] = node;\n\t\t\t\t\tnames[node] = name;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new UniqueNames(names.ToImmutable(), usedNames.ToImmutable());\n\t\t}\n\n\t\tVariable GetName(Node node, IDictionary<Variable, object> usedNames)\n\t\t{\n\t\t\tvar cn = node as ClassNode;\n\t\t\tif (cn != null)\n\t\t\t\treturn cn.GetUxConstructorFunctionName();\n\n\t\t\tvar rn = node as NewObjectNode;\n\t\t\tif (rn != null && rn.InstanceType == InstanceType.Global)\n\t\t\t\treturn new Variable(rn.Scope.GeneratedClassName + \".\" + rn.Name);\n\n\t\t\tvar bvn = node as BoxedValueNode;\n\t\t\tif (bvn != null && bvn.InstanceType == InstanceType.Global)\n\t\t\t\treturn new Variable(bvn.Scope.GeneratedClassName + \".\" + bvn.Name);\n\n\t\t\tif (rn != null && string.IsNullOrEmpty(rn.Name) == false)\n\t\t\t\treturn new Variable(rn.Name);\n\n\t\t\treturn GetUniqueName(usedNames);\n\t\t}\n\n\n\t\tpublic Variable GetUniqueName()\n\t\t{\n\t\t\treturn GetUniqueName(_namesInverse);\n\t\t}\n\n\t\tstatic Variable GetUniqueName(IDictionary<Variable, object> usedNames)\n\t\t{\n\t\t\tfor (int index = usedNames.Count; ; index++)\n\t\t\t{\n\t\t\t\tvar tryName = new Variable(index + \"#\");\n\t\t\t\tif (!usedNames.ContainsKey(tryName))\n\t\t\t\t\treturn tryName;\n\t\t\t}\n\t\t}\n\n\t\tpublic UniqueNames Reserve(Variable variable)\n\t\t{\n\t\t\tvar obj = new object();\n\t\t\treturn new UniqueNames(_names.SetItem(obj, variable), _namesInverse.SetItem(variable, obj));\n\t\t}\n\n\t\tpublic UniqueNames Add(Node fn, Variable parameter)\n\t\t{\n\t\t\treturn new UniqueNames(_names.SetItem(fn, parameter), _namesInverse.SetItem(parameter, fn));\n\t\t}\n\n\t\tpublic bool Contains(Node node)\n\t\t{\n\t\t\treturn _names.ContainsKey(node);\n\t\t}\n\n\t\tpublic bool Contains(Variable var)\n\t\t{\n\t\t\treturn _namesInverse.ContainsKey(var);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/UxFileContents.cs",
    "content": "using System.IO;\n\nnamespace Outracks.Simulator.Protocol\n{\n\tpublic class UxFileContents\n\t{\n\t\tpublic string Path { get; set; }\n\t\tpublic string Contents { get; set; }\n\n\t\tpublic static void Write(UxFileContents str, BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(str.Path);\n\t\t\twriter.Write(str.Contents);\n\t\t}\n\n\t\tpublic static UxFileContents Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new UxFileContents\n\t\t\t{\n\t\t\t\tPath = reader.ReadString(),\n\t\t\t\tContents = reader.ReadString(),\n\t\t\t};\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/simulator/main/ValueParser.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Reflection;\nusing Outracks.Simulator.Bytecode;\nusing Uno.Collections;\nusing Uno.Compiler;\nusing Uno.Logging;\nusing Uno.UX.Markup;\nusing Uno.UX.Markup.CompilerReflection;\nusing Uno.UX.Markup.Reflection;\nusing Uno.UX.Markup.UXIL;\n\nnamespace Outracks.Simulator\n{\n\tpublic class ValueParser\n\t{\n\t\treadonly IDataTypeProvider _compiler;\n\t\treadonly Compiler _valueParser;\n\n\t\tpublic ValueParser(IDataTypeProvider compiler, string project)\n\t\t{\n\t\t\t_compiler = compiler;\n\t\t\tvar valueParserCtor = GetUxilCompilerCtor();\n\t\t\t_valueParser = (Compiler)valueParserCtor.Invoke(\n\t\t\t\tnew object[]\n\t\t\t\t{\n\t\t\t\t\tcompiler,\n\t\t\t\t\tPath.GetDirectoryName(project),\n\t\t\t\t\tnull,\n\t\t\t\t\tnew MarkupErrorLog(new Log(Console.Error, Console.Error), SourcePackage.Unknown)\n\t\t\t\t});\n\n\t\t}\n\n\t\tinternal static ConstructorInfo GetUxilCompilerCtor()\n\t\t{\n\t\t\tvar valueParserType = typeof(Compiler);\n\t\t\tvar ctors = valueParserType.GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance);\n\t\t\treturn ctors.First();\n\t\t}\n\n\t\tpublic AtomicValue Parse(string value, TypeName typeName, FileSourceInfo sourceInfo)\n\t\t{\n\t\t\tvar dataType = _compiler.TryGetTypeByName(typeName.FullName);\n\t\t\tif (dataType == null)\n\t\t\t\tthrow new Exception(\"Data type not found: \" + typeName.FullName);\n\n\t\t\treturn Parse(value, dataType, sourceInfo);\n\t\t}\n\n\t\tpublic AtomicValue Parse(string value, IDataType dataType, FileSourceInfo sourceInfo)\n\t\t{\n\t\t\tvar parsedValue = _valueParser.Parse(value, dataType, sourceInfo);\n\t\t\tif (parsedValue == null)\n\t\t\t\tthrow new Exception(\"Failed to parse property value: \" + value);\n\n\t\t\treturn parsedValue;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/main/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/simulator/main/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/simulator/tests/Bytecode/TypeNameParseTests.cs",
    "content": "﻿using NUnit.Framework;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Simulator.Protocol.Tests.Bytecode\n{\n\tclass TypeNameParserTests\n\t{\n\t\t[Test]\n\t\tpublic void ParsesSingleClass()\n\t\t{\n\t\t\tvar clas = TypeNameParser.Parse(\"Class\");\n\t\t\tAssert.AreEqual(\"Class\", clas.Surname);\n\t\t\tAssert.False(clas.ContainingType.HasValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParsesClassInNamespace()\n\t\t{\n\t\t\tvar clas = TypeNameParser.Parse(\"Ns1.Ns2.Class\");\n\t\t\tAssert.AreEqual(\"Class\", clas.Surname);\n\t\t\tvar ns2 = clas.ContainingType.Value;\n\t\t\tAssert.AreEqual(\"Ns2\", ns2.Surname);\n\t\t\tvar ns1 = ns2.ContainingType.Value;\n\t\t\tAssert.AreEqual(\"Ns1\", ns1.Surname);\n\t\t\tAssert.False(ns1.ContainingType.HasValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParsesSingleGenericClass()\n\t\t{\n\t\t\tvar clas = TypeNameParser.Parse(\"Class<T>\");\n\t\t\tAssert.AreEqual(\"Class\", clas.Surname);\n\t\t\tAssert.AreEqual(1, clas.GenericArguments.Count);\n\t\t\tvar t = clas.GenericArguments.Get(0);\n\t\t\tAssert.AreEqual(\"T\", t.Surname);\n\t\t\tAssert.False(clas.ContainingType.HasValue);\n\t\t\tAssert.False(t.ContainingType.HasValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParsesMultipleGenericClass()\n\t\t{\n\t\t\tvar clas = TypeNameParser.Parse(\"Class<T1,T2>\");\n\t\t\tAssert.AreEqual(\"Class\", clas.Surname);\n\t\t\tAssert.AreEqual(2, clas.GenericArguments.Count);\n\t\t\tvar t1 = clas.GenericArguments.Get(0);\n\t\t\tAssert.AreEqual(\"T1\", t1.Surname);\n\t\t\tvar t2 = clas.GenericArguments.Get(1);\n\t\t\tAssert.AreEqual(\"T2\", t2.Surname);\n\t\t\tAssert.False(clas.ContainingType.HasValue);\n\t\t\tAssert.False(t1.ContainingType.HasValue);\n\t\t\tAssert.False(t2.ContainingType.HasValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParsesGenericClassWithNamespacedParameter()\n\t\t{\n\t\t\tvar clas = TypeNameParser.Parse(\"Class<T1.T2>\");\n\t\t\tAssert.AreEqual(\"Class\", clas.Surname);\n\t\t\tAssert.AreEqual(1, clas.GenericArguments.Count);\n\t\t\tvar t2 = clas.GenericArguments.Get(0);\n\t\t\tAssert.AreEqual(\"T2\", t2.Surname);\n\t\t\tvar t1 = t2.ContainingType.Value;\n\t\t\tAssert.AreEqual(\"T1\", t1.Surname);\n\t\t\tAssert.False(t1.ContainingType.HasValue);\n\t\t\tAssert.False(clas.ContainingType.HasValue);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParsesComplicatedType()\n\t\t{\n\t\t\tvar inner = TypeNameParser.Parse(\"Ns1.Class<T1,T2.T3>.Inner\");\n\t\t\tAssert.AreEqual(\"Inner\", inner.Surname);\n\t\t\tvar clas = inner.ContainingType.Value;\n\t\t\tAssert.AreEqual(0, inner.GenericArguments.Count);\n\t\t\tAssert.AreEqual(\"Class\", clas.Surname);\n\t\t\tvar ns1 = clas.ContainingType.Value;\n\t\t\tAssert.AreEqual(\"Ns1\", ns1.Surname);\n\t\t\tAssert.False(ns1.ContainingType.HasValue);\n\t\t\tvar t1 = clas.GenericArguments.Get(0);\n\t\t\tAssert.AreEqual(\"T1\", t1.Surname);\n\t\t\tvar t3 = clas.GenericArguments.Get(1);\n\t\t\tAssert.AreEqual(\"T3\", t3.Surname);\n\t\t\tAssert.AreEqual(\"T2\", t3.ContainingType.Value.Surname);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/tests/Bytecode/TypeNameTests.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Simulator.Protocol.Tests.Bytecode\n{\n\tclass TypeNameTests\n\t{\n\t\t[Test]\n\t\tpublic void ClassWithoutNamespace()\n\t\t{\n\t\t\tvar type = TypeName.Parse(\"Class\");\n\t\t\tAssertTypeName(\"Class\", \"Class\", \"Class\", new List<string>(), new List<string>(), type);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClassInNamespace()\n\t\t{\n\t\t\tvar type = TypeName.Parse(\"Ns1.Ns2.Class\");\n\t\t\tAssertTypeName(\"Class\", \"Ns1.Ns2.Class\", \"Ns1.Ns2.Class\", new List<string>(), new List<string>(), type);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TypeWithGenericArgument()\n\t\t{\n\t\t\tvar type = TypeName.Parse(\"Ns1.Class<T1>\");\n\t\t\tAssertTypeName(\"Class\", \"Ns1.Class<T1>\", \"Ns1.Class`1\", new List<string> { \"T1\" }, new List<string> {\"T1\"}, type);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TypeWithGenericArguments()\n\t\t{\n\t\t\tvar type = TypeName.Parse(\"Ns1.Class<T1,T2>\");\n\t\t\tAssertTypeName(\"Class\", \"Ns1.Class<T1,T2>\", \"Ns1.Class`2\", new List<string> { \"T1\", \"T2\" }, new List<string>{\"T1\", \"T2\"}, type);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void InnerTypeInGenericClass()\n\t\t{\n\t\t\tvar type = TypeName.Parse(\"Ns1.Class<T1,T2>.Inner\");\n\t\t\tAssertTypeName(\"Inner\", \"Ns1.Class<T1,T2>.Inner\", \"Ns1.Class`2.Inner\", new List<string>(), new List<string> { \"T1\", \"T2\" }, type);\n\t\t}\n\n\t\tstatic void AssertTypeName(string classname, string fullName, string withGenericSuffix, List<string> genericArguments, List<string> genericArgumentsRecursively, TypeName typeName)\n\t\t{\n\t\t\tAssert.AreEqual(classname, typeName.Surname);\n\t\t\tif (genericArguments.Count > 0)\n\t\t\t{\n\t\t\t\tvar fullNames = typeName.GenericArguments.Select(a => a.FullName);\n\t\t\t\tAssert.AreEqual(genericArguments, fullNames);\n\t\t\t\tAssert.AreEqual(classname + \"<\" + string.Join(\",\", fullNames) + \">\", typeName.Name);\n\t\t\t}\n\t\t\tAssert.AreEqual(genericArgumentsRecursively, typeName.GenericArgumentsRecursively.Select(a => a.FullName));\n\t\t\tAssert.AreEqual(fullName, typeName.FullName);\n\t\t\tAssert.AreEqual(genericArgumentsRecursively.Count > 0, typeName.IsParameterizedGenericType);\n\t\t\tAssert.AreEqual(withGenericSuffix, typeName.WithGenericSuffix.FullName);\n\t\t\tAssert.AreEqual(fullName, typeName.ToString());\n\t\t\tAssertWriteRead(typeName);\n\t\t}\n\n\t\tstatic void AssertWriteRead(TypeName typeName)\n\t\t{\n\t\t\tusing (var stream = new MemoryStream())\n\t\t\tusing (var writer = new BinaryWriter(stream))\n\t\t\t{\n\t\t\t\ttypeName._Write(writer);\n\t\t\t\tstream.Seek(0, SeekOrigin.Begin);\n\t\t\t\tusing (var reader = new BinaryReader(stream))\n\t\t\t\t{\n\t\t\t\t\tvar readTypeName = TypeName._Read(reader);\n\t\t\t\t\tAssert.AreEqual(typeName, readTypeName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/tests/CompiledTypeReflectionTests.cs",
    "content": "﻿using System.Linq;\nusing System.Reflection;\nusing NUnit.Framework;\nusing Outracks.Simulator.Client;\n\nnamespace Outracks.Simulator.Runtime.Tests\n{\n\tpublic class MyType\n\t{\n\t\tpublic void M1(int i) { }\n\t\tpublic void M2(int i, int j = 0) { }\n\n\t}\n\n\tpublic class CompiledTypeReflectionTests\n\t{\n\t\t[Test]\n\t\tpublic void MathcesCorrectArguments()\n\t\t{\n\t\t\tAssert.True(ParamsFor(\"M1\").ParametersMatch(new object[] { 1 }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoesntMatchTooFewArguments()\n\t\t{\n\t\t\tAssert.False(ParamsFor(\"M1\").ParametersMatch(new object[] { }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoesntMatchTooManyArguments()\n\t\t{\n\t\t\tAssert.False(ParamsFor(\"M1\").ParametersMatch(new object[] { 1, 2 }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoesntMatchWrongTypes()\n\t\t{\n\t\t\tAssert.False(ParamsFor(\"M1\").ParametersMatch(new object[] { \"foo\" }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MatchesGivenDefaultArgument()\n\t\t{\n\t\t\tAssert.True(ParamsFor(\"M2\").ParametersMatch(new object[] { 1, 2 }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MatchesNonGivenDefaultArgument()\n\t\t{\n\t\t\tAssert.True(ParamsFor(\"M2\").ParametersMatch(new object[] { 1 }));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoesntMatchGivenDefaultArgumentOfWrongType()\n\t\t{\n\t\t\tAssert.False(ParamsFor(\"M2\").ParametersMatch(new object[] { 1, \"foo\" }));\n\t\t}\n\n\t\tstatic ParameterInfo[] ParamsFor(string method)\n\t\t{\n\t\t\treturn typeof(MyType).GetMethods().First(m => m.Name == method).GetParameters();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/tests/Outracks.Simulator.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{D1011D5C-56A1-4947-80FD-BF6FE8E955EB}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.Simulator.Tests</RootNamespace>\n    <AssemblyName>Outracks.Simulator.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Bytecode\\TypeNameTests.cs\" />\n    <Compile Include=\"CompiledTypeReflectionTests.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Bytecode\\TypeNameParseTests.cs\" />\n    <Compile Include=\"TypeNameTokenizerTests.cs\" />\n    <Compile Include=\"ValueParserTests.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{e8884270-5f2c-4076-86d0-456b831be3e5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Service Include=\"{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/simulator/tests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Outracks.Simulator.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Outracks.Simulator.Tests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"5d200247-7c8e-47ec-8f92-d75ff9b4a1d6\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "src/simulator/tests/TypeNameTokenizerTests.cs",
    "content": "﻿using System.Collections.Generic;\nusing NUnit.Framework;\nusing Outracks.Simulator.Bytecode;\n\nnamespace Outracks.Simulator.Protocol.Tests\n{\n\tclass TypeNameTokenizerTests\n\t{\n\t\t[Test]\n\t\tpublic void TokenizesSingleClass()\n\t\t{\n\t\t\tAssert.AreEqual(new List<string> { \"Class\" }, TypeNameTokenizer.Tokenize(\"Class\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TokenizesClassInNamespace()\n\t\t{\n\t\t\tAssert.AreEqual(new List<string> { \"Ns\", \".\", \"Class\" }, TypeNameTokenizer.Tokenize(\"Ns.Class\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TokenizesGenericClass()\n\t\t{\n\t\t\tAssert.AreEqual(new List<string> { \"Class\", \"\" + \"<\", \"T\", \">\" }, TypeNameTokenizer.Tokenize(\"Class<T>\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TokenizesGenericClassWithMultipleTypes()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew List<string> { \"Class\", \"<\", \"T1\", \",\", \"T2\", \">\" },\n\t\t\t\tTypeNameTokenizer.Tokenize(\"Class<T1,T2>\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TokenizesComplicatedType()\n\t\t{\n\t\t\tAssert.AreEqual(\n\t\t\t\tnew List<string> { \"Ns\", \".\", \"Class\", \"<\", \"T1\", \",\", \"T2\", \".\", \"T3\", \">\", \".\", \"Delegate\" },\n\t\t\t\tTypeNameTokenizer.Tokenize(\"Ns.Class<T1,T2.T3>.Delegate\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXAutoBind/UXAutoBind.ux",
    "content": "<App>\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXBinding/UXBinding.uno",
    "content": "using Uno;\nusing Uno.UX;\n\npublic class BindingTestClass1\n{\n\tpublic object P1 { get; set; }\n\tpublic BindingTestBaseClass P2 { get; set; }\n\tpublic BindingTestClass2 P3 { get; set; }\n\tpublic BindingTestInterface P4 { get; set; }\n}\n\npublic interface BindingTestInterface{ }\n\npublic class BindingTestBaseClass { }\n\npublic class BindingTestClass2 : BindingTestBaseClass, BindingTestInterface { }"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXBinding/UXBinding.ux",
    "content": "<App>\n\t<BindingTestClass1 ux:AutoBind=\"false\">\n\n\t\t<object ux:Binding=\"P1\"/>\n\t\t<BindingTestClass2 ux:Binding=\"P2\"/>\n\t\t<BindingTestClass2 ux:Binding=\"P3\"/>\n\t\t<BindingTestClass2 ux:Binding=\"P4\"/>\n\n\t</BindingTestClass1>\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXCascade/UXCascade.uno",
    "content": "using Uno;\nusing Uno.UX;\nusing Fuse;"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXCascade/UXCascade.ux",
    "content": "<App>\n\n\t<Panel>\n\t\t<Style>\n\t\t\t<Panel Background=\"Red\"/>\n\t\t</Style>\n\n\t\t<Panel>\n\t\t\t<Style>\n\t\t\t\t<Panel Background=\"Blue\"/>\n\t\t\t</Style>\n\t\t\t<Panel/>\n\t\t</Panel>\n\t</Panel>\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXClass/UXClass.uno",
    "content": "using Uno;\nusing Uno.UX;\nusing Fuse;\n\npublic class UXClassTest\n{\n\tpublic UXClassTest()\n\t{\n\t\tvar mc = new MyClass();\n\t\tdebug_log(\"String: \" + mc.MyString);\n\t\tdebug_log(\"Int: \" + mc.MyInt);\n\t}\n}\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXClass/UXClass.ux",
    "content": "<App>\n\t<object ux:Class=\"MyClass\" ux:AutoBind=\"false\">\n\t\t<string ux:Name=\"MyString\" ux:Value=\"TestValue1\" ux:AutoBind=\"false\"/>\n\t\t<int ux:Name=\"MyInt\" ux:Value=\"1245\" ux:AutoBind=\"false\"/>\n\t</object>\n\n\t<UXClassTest ux:AutoBind=\"false\"/>\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXConstructor/UXConstructor.uno",
    "content": "using Uno;\nusing Uno.UX;\n\npublic class UXValueTestClass\n{\n\tstring _string1;\n\tint _int1;\n\tfloat _float1;\n\n   [UXConstructor]\n\tpublic UXValueTestClass\n\t\t([UXParameter(\"String1\")]string s1,\n\t\t [UXParameter(\"Int1\")]int i1,\n\t\t [UXParameter(\"Float1\")]float f1)\n\t{\n\t\t_string1 = s1;\n\t\t_int1 = i1;\n\t\t_float1 = f1;\n\n\t\tdebug_log(\"String1: \" + _string1);\n\t\tdebug_log(\"Int1: \" + _int1);\n\t\tdebug_log(\"Float1: \" + _float1);\n\t}\n}\n\npublic class UXValueTestClass2\n{\n\tpublic UXValueTestClass2(){}\n\n\tpublic UXValueTestClass2(int foo)\n\t{\n\t\tdebug_log(\"FOOO: \" + foo);\n\t}\n}"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXConstructor/UXConstructor.ux",
    "content": "<App>\n\t<UXValueTestClass ux:AutoBind=\"false\" String1=\"Foobar\" Int1=\"1231\" Float1=\"0.0\"/>\n\t<UXValueTestClass ux:AutoBind=\"false\" String1=\"Foo\" Int1=\"-1203231\" Float1=\"-223004.23\"/>\n\t<UXValueTestClass ux:AutoBind=\"false\" String1=\"Bar\" Int1=\"1231\" Float1=\"0.23\"/>\n\t<UXValueTestClass ux:AutoBind=\"false\" String1=\"Fooobetibaaaarbar\" Int1=\"1\" Float1=\"204423.231123\"/>\n\n\n\t<UXValueTestClass2 ux:AutoBind=\"false\" ux:Value=\"1231\"/>\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXFeaturesTestApp.unoproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project Format=\"1.0\">\n    <References>\n        <PackageReference Name=\"Fuse.Animations\" />\n        <PackageReference Name=\"Fuse.BasicTheme\" />\n        <PackageReference Name=\"Fuse.Controls\" />\n        <PackageReference Name=\"Fuse.Designer\" />\n        <PackageReference Name=\"Fuse.Drawing\" />\n        <PackageReference Name=\"Fuse.Drawing.Primitives\" />\n        <PackageReference Name=\"Fuse.Effects\" />\n        <PackageReference Name=\"Fuse.Elements\" />\n        <PackageReference Name=\"Fuse.Entities\" />\n        <PackageReference Name=\"Fuse.Gestures\" />\n        <PackageReference Name=\"Fuse.Navigation\" />\n        <PackageReference Name=\"Fuse.Shapes\" />\n        <PackageReference Name=\"Fuse.Triggers\" />\n        <PackageReference Name=\"Fuse.Reactive\" />\n        <PackageReference Name=\"FuseCore\" />\n        <PackageReference Name=\"Uno.Collections\" />\n        <PackageReference Name=\"Uno.Geometry\" />\n    </References>\n    <Files>\n\n\t\t<UXFile Name=\"UXBinding/UXBinding.ux\"/>\n\t\t<SourceFile Name=\"UXBinding/UXBinding.uno\"/>\n\n\t\t<UXFile Name=\"UXClass/UXClass.ux\"/>\n\t\t<SourceFile Name=\"UXClass/UXClass.uno\"/>\n\n\t\t<UXFile Name=\"UXGenerateFactory/UXGenerateFactory.ux\"/>\n\t\t<SourceFile Name=\"UXGenerateFactory/UXGenerateFactory.uno\"/>\n\n\t\t<UXFile Name=\"UXName/UXName.ux\"/>\n\t\t<SourceFile Name=\"UXName/UXName.uno\"/>\n\n\t\t<UXFile Name=\"UXGlobal/UXGlobal.ux\" />\n\t\t<SourceFile Name=\"UXGlobal/UXGlobal.uno\"/>\n\n\t\t<UXFile Name=\"UXConstructor/UXConstructor.ux\"/>\n\t\t<SourceFile Name=\"UXConstructor/UXConstructor.uno\"/>\n\n\t\t<UXFile Name=\"UXValue/UXValue.ux\"/>\n\t\t<SourceFile Name=\"UXValue/UXValue.uno\"/>\n\n\t\t<UXFile Name=\"UXResource/UXResource.ux\"/>\n\t\t<SourceFile Name=\"UXResource/UXResource.uno\"/>\n\n    </Files>\n</Project>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXGenerateFactory/UXGenerateFactory.uno",
    "content": "using Uno;\nusing Fuse;\nusing Uno.UX;\n\npublic class GenerateFactoryTest\n{\n\tIFactory _factory;\n\tpublic IFactory Factory\n\t{\n\t\tget { return _factory; }\n\t\tset\n\t\t{\n\t\t\t_factory = value;\n\t\t\tvar test = (TestClass)value.New();\n\t\t\tdebug_log(\"Factory: \" + test);\n\t\t\tdebug_log(\"Value: \" + test.Foo);\n\t\t}\n\t}\n}\n\npublic class TestClass\n{\n\tpublic string Foo { get; set; }\n\n}"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXGenerateFactory/UXGenerateFactory.ux",
    "content": "<App>\n\t<GenerateFactoryTest ux:AutoBind=\"false\">\n\t\t<TestClass ux:Generate=\"Factory\" ux:Binding=\"Factory\" Foo=\"testtest\"/>\n\t</GenerateFactoryTest>\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXGenerateTemplate/UXGenerateTemplate.ux",
    "content": "<Panel ux:Generate=\"Template\">\n</Panel>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXGlobal/UXGlobal.uno",
    "content": "using Uno;\nusing Uno.UX;\n\npublic class UXGlobalTestClass\n{\n\tpublic string StringProp { get; set; }\n}\n\npublic class DebugLogGlobalTestClass\n{\n\tUXGlobalTestClass _prop;\n\tpublic UXGlobalTestClass Prop\n\t{\n\t\tget { return _prop; }\n\t\tset\n\t\t{\n\t\t\t_prop = value;\n\t\t\tdebug_log(\"StringProp: \" + value.StringProp);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXGlobal/UXGlobal.ux",
    "content": "<App>\n\t<UXGlobalTestClass ux:Global=\"Global1\" StringProp=\"TestString1\" />\n\t<UXGlobalTestClass ux:Global=\"Global2\" StringProp=\"TestString2\" />\n\t<UXGlobalTestClass ux:Global=\"Global3\" StringProp=\"TestString3\" />\n\t<UXGlobalTestClass ux:Global=\"Global4\" StringProp=\"TestString4\" />\n\n\t<DebugLogGlobalTestClass Prop=\"Global1\" ux:AutoBind=\"false\"/>\n\t<DebugLogGlobalTestClass Prop=\"Global2\" ux:AutoBind=\"false\"/>\n\t<DebugLogGlobalTestClass Prop=\"Global3\" ux:AutoBind=\"false\"/>\n\t<DebugLogGlobalTestClass Prop=\"Global4\" ux:AutoBind=\"false\"/>\n\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXKey/UXKey.ux",
    "content": "<App>\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXName/UXName.uno",
    "content": "using Uno;\n\npublic class NameTestDummyClass\n{\n}"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXName/UXName.ux",
    "content": "<App>\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName\"/>\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName1\"/>\n\t<NameTestDummyClass ux:AutoBind=\"false\" />\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName2\"/>\n\t<NameTestDummyClass ux:AutoBind=\"false\" />\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName3\"/>\n\t<NameTestDummyClass ux:AutoBind=\"false\" />\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName4\"/>\n\t<NameTestDummyClass ux:AutoBind=\"false\" />\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName5\"/>\n\t<NameTestDummyClass ux:AutoBind=\"false\" />\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName6\"/>\n\t<NameTestDummyClass ux:AutoBind=\"false\" />\n\t<NameTestDummyClass ux:AutoBind=\"false\" ux:Name=\"MyName7\"/>\n\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXResource/UXResource.uno",
    "content": "using Uno;\nusing Uno.UX;\nusing Fuse;\n\nclass UXResourceTestClass : Node\n{\n\tUXResourceTestClass2 _res;\n\tpublic UXResourceTestClass2 Res\n\t{\n\t\tget { return _res; }\n\t\tset\n\t\t{\n\t\t\t_res = value;\n\t\t\tdebug_log(\"Value: \" + value);\n\t\t}\n\t}\n\n}\n\nclass UXResourceTestClass2 : Node\n{\n}\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXResource/UXResource.ux",
    "content": "<App>\n\t<Panel>\n\t\t<UXResourceTestClass2 ux:Key=\"testResource\"/>\n\n\t\t<Panel>\n\t\t\t<UXResourceTestClass ux:AutoBind=\"false\" ux:Name=\"testObject\"/>\n\t\t\t<ResourceBinding Target=\"testObject.Res\" Key=\"testResource\"/>\n\t\t</Panel>\n\t</Panel>\n\n</App>\n"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXValue/UXValue.uno",
    "content": "using Uno;\nusing Uno.UX;"
  },
  {
    "path": "src/simulator/tests/UXFeaturesTestApp/UXValue/UXValue.ux",
    "content": "<App>\n\n\t<string ux:AutoBind=\"false\" ux:Value=\"foobar\"/>\n\n\t<float ux:AutoBind=\"false\" ux:Value=\"1231.123123\"/>\n\t<float2 ux:AutoBind=\"false\" ux:Value=\"1.0,2.0\"/>\n\t<float3 ux:AutoBind=\"false\" ux:Value=\"1.0,2.0,3.0\"/>\n\t<float4 ux:AutoBind=\"false\" ux:Value=\"1.0,3.0,3.0,4.0\"/>\n\n\t<int ux:AutoBind=\"false\" ux:Value=\"10\"/>\n\t<int2 ux:AutoBind=\"false\" ux:Value=\"1,2\"/>\n\t<int3 ux:AutoBind=\"false\" ux:Value=\"1,2,3\"/>\n\t<int4 ux:AutoBind=\"false\" ux:Value=\"1,2,3,4\"/>\n\n\t<bool ux:AutoBind=\"false\" ux:Value=\"true\"/>\n\t<bool ux:AutoBind=\"false\" ux:Value=\"false\"/>\n\n\n</App>\n"
  },
  {
    "path": "src/simulator/tests/ValueParserTests.cs",
    "content": "﻿using System.Linq;\nusing NUnit.Framework;\n\nnamespace Outracks.Simulator.Tests\n{\n\t[TestFixture]\n\tclass ValueParserTests\n\t{\n\t\t[Test]\n\t\tpublic void TestUXILCompilerConstructorInterface()\n\t\t{\n\t\t\tvar ctor = ValueParser.GetUxilCompilerCtor();\n\t\t\tAssert.IsNotNull(ctor, \"Failed to find an UXIL Constructor.\");\n\t\t\tvar parameters = ctor.GetParameters().Select(p => p.ParameterType.FullName);\n\t\t\tAssert.That(\n\t\t\t\tparameters,\n\t\t\t\tIs.EqualTo(\n\t\t\t\t\tnew[]\n\t\t\t\t\t{\n\t\t\t\t\t\t\"Uno.UX.Markup.Reflection.IDataTypeProvider\",\n\t\t\t\t\t\t\"System.String\",\n\t\t\t\t\t\t\"Uno.UX.Markup.AST.Element\",\n\t\t\t\t\t\t\"Uno.UX.Markup.Common.IMarkupErrorLog\",\n\t\t\t\t\t}),\n\t\t\t\t\"Constructor parameters doesn't match the expected parameters.\");\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/simulator/tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/simulator/tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/sketch2fuse/CHANGELOG.md",
    "content": "- Opacity on layers now translate to opacity on the resulting ux panel\n- Fixed a bug where shadows where flipped in the X-direction in UX compared to Sketch\n- Shadow mode set to `PerPixel` in UX to yield the expected result\n- Shadows on texts in Sketch now supported\n- Warn about not supporting inner shadows in UX\n- Fixed a bug where shapes split into multiple parts by scissoring where ignored\n- Set TextWrapping mode to Wrap on all texts in UX for better default behavior\n- Multiple text styles on one text object in Sketch now gives warning when generating UX\n\n"
  },
  {
    "path": "src/sketch2fuse/Command/Command.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{C8EF4AC7-129C-4B5C-BEC7-C57AACAA7887}</ProjectGuid>\n    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Command</RootNamespace>\n    <AssemblyName>Command</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Mono.Options, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null\">\n      <HintPath>..\\node_modules\\%40fuse-open\\uno\\bin\\Mono.Options.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Logger.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SketchConverter\\SketchConverter.csproj\">\n      <Project>{b086e390-ce62-4c90-9214-9e828de7af33}</Project>\n      <Name>SketchConverter</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/sketch2fuse/Command/Logger.cs",
    "content": "﻿using System;\nusing SketchConverter;\nusing SketchConverter.API;\n\nnamespace Command\n{\n\tinternal class Logger : ILogger\n\t{\n\t\tpublic void Info(string info)\n\t\t{\n\t\t\tConsole.WriteLine(\"INFO: \" + info);\n\t\t}\n\n\t\tpublic void Warning(string warning)\n\t\t{\n\t\t\tConsole.WriteLine(\"WARNING: \" + warning);\n\t\t}\n\n\t\tpublic void Error(string error)\n\t\t{\n\t\t\tConsole.WriteLine(\"ERROR: \" + error);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/Command/Program.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Mono.Options;\nusing SketchConverter;\nusing SketchConverter.SketchParser;\nusing SketchConverter.UxBuilder;\n\nnamespace Command\n{\n\tinternal static class Program\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tvar sketchFilePaths = new List<string>();\n\t\t\tstring outputDir = null;\n\t\t\t#pragma warning disable 0219\n\t\t\tvar watch = false;\n\t\t\t#pragma warning restore 0219\n\t\t\tvar showHelp = false;\n\t\t\tvar app = false;\n\n\t\t\tvar options = new OptionSet\n\t\t\t{\n\t\t\t\t{\"i=\", \"Sketch file to import. Specify multiple sketch-files by using the -i option for each file.\", p => sketchFilePaths.Add(p)},\n\t\t\t\t{\"o=\", \"Destination Fuse project directory\", p => outputDir = p},\n\t\t\t\t{\"a|app\", \"Write output to MainView.ux inside an app tag\", a => app = (a != null)},\n\t\t\t\t{\"w|watch\", \"Watch .sketch file for changes\", w => watch = (w != null)},\n\t\t\t\t{\"h|?|help\", \"Display this help message\", v => showHelp = (v != null)}\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tvar extra = options.Parse(args);\n\t\t\t\tif (extra.Count > 0)\n\t\t\t\t{\n\t\t\t\t\tforeach (var arg in extra)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(\"Unknown argument: '\" + arg + \"'\");\n\t\t\t\t\t\tPrintUsage(options);\n\t\t\t\t\t}\n\t\t\t\t\tEnvironment.Exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(OptionException e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"Error: \" + e.Message);\n\t\t\t\tPrintUsage(options);\n\t\t\t\tEnvironment.Exit(1);\n\t\t\t}\n\n\t\t\tif (showHelp)\n\t\t\t{\n\t\t\t\tPrintUsage(options);\n\t\t\t\tEnvironment.Exit(0);\n\t\t\t}\n\n\t\t\tif (sketchFilePaths.Count == 0 || string.IsNullOrEmpty(outputDir))\n\t\t\t{\n\t\t\t\tPrintUsage(options);\n\t\t\t\tEnvironment.Exit(1);\n\t\t\t}\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar logger = new Logger();\n\t\t\t\tvar builder = app ? (IUxBuilder) new ArtboardUxBuilder(logger) : (IUxBuilder) new SymbolsUxBuilder(logger);\n\t\t\t\tvar parser = new SketchParser(logger);\n\t\t\t\tvar converter = new Converter(parser, builder, logger);\n\t\t\t\tconverter.Convert(sketchFilePaths, outputDir);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"Error: \" + e.Message);\n\t\t\t\tEnvironment.Exit(1);\n\t\t\t}\n\n\t\t}\n\n\t\tstatic void PrintUsage(OptionSet opts)\n\t\t{\n\t\t\tConsole.WriteLine(\"Usage: SketchImporter [--watch] -i SketchFile.sketch -o MyFuseProject/\");\n\t\t\tConsole.WriteLine();\n\t\t\tConsole.WriteLine(\"Options:\");\n\t\t\topts.WriteOptionDescriptions(Console.Out);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/Command/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Command\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Command\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"C8EF4AC7-129C-4B5C-BEC7-C57AACAA7887\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "src/sketch2fuse/Command/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n</packages>"
  },
  {
    "path": "src/sketch2fuse/EndToEndTests/EndToEnd.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Text;\nusing NUnit.Framework;\n\nnamespace EndToEndTests\n{\n\tpublic class EndToEnd\n\t{\n\t\tprivate static readonly string Command;\n\t\tprivate static readonly string AssemblyDirectory;\n\t\tprivate static readonly string FilesDirectory;\n\t\tprivate static readonly string TempDirectory;\n\n\t\tstatic EndToEnd()\n\t\t{\n\t\t\tvar codeBase = Assembly.GetExecutingAssembly().CodeBase;\n\t\t\tvar uri = new UriBuilder(codeBase);\n\t\t\tvar path = Uri.UnescapeDataString(uri.Path);\n\t\t\tAssemblyDirectory = Path.GetDirectoryName(path);\n\t\t\tFilesDirectory = Path.Combine(AssemblyDirectory, \"..\", \"..\", \"..\", \"files\", \"Sketch43\");\n\t\t\tAssert.That(FilesDirectory, Does.Exist);\n\t\t\tCommand = Path.Combine(AssemblyDirectory, \"Command.exe\");\n\t\t\tAssert.That(Command, Does.Exist);\n\t\t\tTempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n\t\t}\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tDirectory.CreateDirectory(TempDirectory);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tDirectory.Delete(TempDirectory, true);\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic void ByDefaultPrintsUsageAndReturnsNonZero()\n\t\t{\n\t\t\tvar result = RunToCompletion(\"\");\n\t\t\tAssert.AreEqual(1, result.ExitCode);\n\t\t\tAssert.That(result.StdOut, Does.Contain(\"Usage\"));\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic void PrintsHelpAndReturnsZero()\n\t\t{\n\t\t\tvar result = RunToCompletion(\"-h\");\n\t\t\tAssert.AreEqual(0, result.ExitCode);\n\t\t\tAssert.That(result.StdOut, Does.Contain(\"Usage\"));\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic void UnknownParameterPrintsErrorAndUsageAndReturnsNonZero()\n\t\t{\n\t\t\tvar result = RunToCompletion(\"--use-emacs\");\n\t\t\tAssert.AreEqual(1, result.ExitCode);\n\t\t\tAssert.That(result.StdOut, Does.Contain(\"Unknown argument: '--use-emacs'\"));\n\t\t\tAssert.That(result.StdOut, Does.Contain(\"Usage\"));\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic void ConvertsSketchToUx()\n\t\t{\n\t\t\tvar arguments = \"-i=\" + Path.Combine(FilesDirectory, \"Rectangle.Sketch\") + \" -o=\" + TempDirectory;\n\t\t\tvar result = RunToCompletion(arguments);\n\t\t\tAssert.AreEqual(0, result.ExitCode);\n\t\t\tCheckGeneratedUxClass(\"Sketch.Rectangle\");\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic void ConvertsTwoSketchFilesToUx()\n\t\t{\n\t\t\tvar arguments = \"-i=\" + Path.Combine(FilesDirectory, \"Rectangle.sketch\") +\n\t\t\t\t\t\t\t\" -i=\" + Path.Combine(FilesDirectory, \"Star.sketch\") +\n\t\t\t\t\t\t\t\" -o=\" + TempDirectory;\n\t\t\tvar result = RunToCompletion(arguments);\n\t\t\tAssert.AreEqual(0, result.ExitCode);\n\t\t\tCheckGeneratedUxClass(\"Sketch.Rectangle\");\n\t\t\tCheckGeneratedUxClass(\"Sketch.Star\");\n\t\t}\n\n\t\t[Test]\n\t\t[Timeout(10000)]\n\t\tpublic void ConvertValidSketchFileToUx()\n\t\t{\n\t\t\tvar arguments = \"-i=\" + Path.Combine(FilesDirectory, \"Rectangle.sketch\") +\n\t\t\t\t\t\t\t\" -i=\" + Path.Combine(FilesDirectory, \"NoSuchFile.sketch\") +\n\t\t\t\t\t\t\t\" -o=\" + TempDirectory;\n\t\t\tvar result = RunToCompletion(arguments);\n\t\t\tAssert.AreEqual(0, result.ExitCode);\n\t\t\tCheckGeneratedUxClass(\"Sketch.Rectangle\");\n\t\t\tAssert.That(result.StdOut, Does.Contain(\"Can't convert non-existing Sketch-file\"));\n\t\t}\n\n\t\tprivate static void CheckGeneratedUxClass(string classname)\n\t\t{\n\t\t\tvar uxfile = Path.Combine(TempDirectory, classname + \".ux\");\n\t\t\tAssert.That(uxfile, Does.Exist);\n\t\t\tvar content = File.ReadAllLines(uxfile);\n\t\t\tAssert.That(content[0], Does.StartWith(\"<Panel ux:Class=\\\"\" + classname + \"\\\"\"));\n\t\t\tAssert.That(content.Last(), Is.EqualTo(\"</Panel>\"));\n\t\t}\n\n\t\tprivate static ProcessResult RunToCompletion(string arguments)\n\t\t{\n\t\t\tvar stdout = new StringBuilder();\n\t\t\tvar stderr = new StringBuilder();\n\t\t\tvar p = new Process\n\t\t\t{\n\t\t\t\tStartInfo = new ProcessStartInfo\n\t\t\t\t{\n\t\t\t\t\tFileName = Command,\n\t\t\t\t\tArguments = arguments,\n\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\tRedirectStandardError = true,\n\t\t\t\t\tRedirectStandardOutput = true\n\t\t\t\t}\n\t\t\t};\n\t\t\tp.OutputDataReceived += (sender, args) => stdout.Append(args.Data ?? \"\");\n\t\t\tp.ErrorDataReceived += (sender, args) => stderr.Append(args.Data ?? \"\");\n\t\t\tp.Start();\n\t\t\tp.BeginOutputReadLine();\n\t\t\tp.BeginErrorReadLine();\n\t\t\tp.WaitForExit();\n\t\t\tvar result = new ProcessResult(stdout.ToString(), stderr.ToString(), p.ExitCode);\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tpublic class ProcessResult\n\t{\n\t\tpublic readonly string StdOut;\n\t\tpublic readonly string StdErr;\n\t\tpublic readonly int ExitCode;\n\n\t\tpublic ProcessResult(string stdOut, string stdErr, int exitCode)\n\t\t{\n\t\t\tStdOut = stdOut;\n\t\t\tStdErr = stdErr;\n\t\t\tExitCode = exitCode;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/EndToEndTests/EndToEndTests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{54732A2D-CA63-40FE-BECF-EB8040A67099}</ProjectGuid>\n    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>EndToEndTests</RootNamespace>\n    <AssemblyName>EndToEndTests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb\">\n      <HintPath>..\\packages\\NUnit.3.9.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"EndToEnd.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Command\\Command.csproj\">\n      <Project>{c8ef4ac7-129c-4b5c-bec7-c57aacaa7887}</Project>\n      <Name>Command</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/sketch2fuse/EndToEndTests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"EndToEndTests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"EndToEndTests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"54732A2D-CA63-40FE-BECF-EB8040A67099\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "src/sketch2fuse/EndToEndTests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"NUnit\" version=\"3.9.0\" targetFramework=\"net45\" />\n  <package id=\"NUnit.Console\" version=\"3.7.0\" targetFramework=\"net45\" />\n  <package id=\"NUnit.ConsoleRunner\" version=\"3.7.0\" targetFramework=\"net45\" />\n  <package id=\"NUnit.Extension.NUnitProjectLoader\" version=\"3.5.0\" targetFramework=\"net45\" />\n  <package id=\"NUnit.Extension.NUnitV2Driver\" version=\"3.6.0\" targetFramework=\"net45\" />\n  <package id=\"NUnit.Extension.NUnitV2ResultWriter\" version=\"3.5.0\" targetFramework=\"net45\" />\n  <package id=\"NUnit.Extension.TeamCityEventListener\" version=\"1.0.2\" targetFramework=\"net45\" />\n  <package id=\"NUnit.Extension.VSProjectLoader\" version=\"3.5.0\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/sketch2fuse/GitVersion.yml",
    "content": "mode: ContinuousDeployment\nbranches:\n  master:\n    tag: 'master'\nignore:\n  sha: []\n"
  },
  {
    "path": "src/sketch2fuse/NuGet.Config",
    "content": "<configuration>\n  <config>\n    <add key=\"repositoryPath\" value=\"..\\..\\packages\" />\n  </config>\n</configuration>\n"
  },
  {
    "path": "src/sketch2fuse/README.md",
    "content": "## Building\n\n### Windows\nWe use Visual Studio 2015 and 2017 for development, but other IDEs might also work.\n\nUse `build.bat` to build from the command line. (`build.sh` can also be used, it just delegates to `build.bat` on Windows)\n\n### macOS\nMono 4 is required, we normally use 4.4.2. We use [Rider](https://www.jetbrains.com/rider/) for development, but other IDEs might also work.\n\nUse `build.sh` to build from the command line\n\n## Running\nThere's a command line tool meant for internal use that runs the converter on a Sketch file. Run it without parameters for usage information:\n\n```\nCommand/bin/Debug/Command.exe\n```\n\n## Testing\nThere are two types of tests, NUnit tests and the regression tests. A shortcut `./test.sh` will run all of them.\n\n### NUnit tests\nThese are the normal unit and system tests.\n\nWe recommend running these with the test runner in your favorite IDE, but they are also run by the shortcut `./test.sh`\n\n### Regression tests\nThe regression tests run the converter on a set of known `.sketch` files and compare the results to reference `.ux` files. In case of any differences, the test fails. The user can then select whether the new result is correct, and replace the reference `.ux` file.\n\nThis can be run by `RegressionTests/bin/Debug/RegressionTests.exe`, but is also run by the shortcut `./test.sh`. Run  `RegressionTests/bin/Debug/RegressionTests.exe -h` for help.\n\n## Distribution\n\n### Versioning\nWe're using [GitVersion](http://gitversion.readthedocs.io) for versioning.\n\n#### Official releases\nTo make an official release, simply create a tag with the desired version number. Remember to push the tag. This can be done from any branch, GitVersion only cares about the tag. Early on in the project we'll just release from master, but as the project gets more serious we'll release from proper release branches.\n\n##### Example\nDo `git tag 0.2.0` and `git push origin 0.2.0`. When you trigger this in TeamCity from master or a release branch, it gets version `0.2.0`, which also ends up as the version of the NuGet package.\n\n#### Arbitrary releases from master / feature branches\nSome times you need a NuGet package from a feature branch or master, to test in Fuse. Any time a build triggers from an untagged commit, GitVersion computes a version number automatically, which gets set in the NuGet package.\n\n##### Examples\nSay the last tagged release was 0.2.0, and your branch is some commits ahead of this tag. New versions automatically get bumped to 0.2.1, with the branch name and a pre-release number appended. For instance, the branch `feature/foo` gets versions like `0.2.1-foo001`, `0.2.1-foo002` and so on. `master` gets versions like `0.2.1-master0001`.\n\n#### Pre releases from release branches\nAgain, GitVersion computes a version number automatically, which gets set in the NuGet package.\n\n##### Examples\nSay you're on a release branch `release/0.3`, but haven't tagged a commit as the official `0.3.0` yet. It then gets versions like `0.3.0-beta0000`, `0.3.0-beta0001` etc.\n\n### NuGet\nTeamCity automatically creates NuGet packages, which get published to its internal feed. They get their versions set automatically by the versioning scheme mentioned above.\n\n### Upgrading the version used in Fuse\nTo upgrade the version of Sketch2Fuse used in Fuse, simply switch the version specified in `src/Fuse/Studio/packages.config`, and it will download the correct package from TeamCity's NuGet feed.\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/ColorPrinter.cs",
    "content": "﻿using System;\n\nnamespace RegressionTests\n{\n\tinternal class ColorPrinter : IDisposable\n\t{\n\t\tprivate readonly ConsoleColor _previous;\n\n\t\tpublic ColorPrinter(ConsoleColor color)\n\t\t{\n\t\t\t_previous = Console.ForegroundColor;\n\t\t\tConsole.ForegroundColor = color;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tConsole.ForegroundColor = _previous;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/ColoredDiffPrinter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace RegressionTests\n{\n\tpublic static class ColoredDiffPrinter\n\t{\n\t\tpublic static void Print(IEnumerable<FileDiff> diffs)\n\t\t{\n\t\t\tforeach (var diff in diffs)\n\t\t\t{\n\t\t\t\tConsole.WriteLine(diff.Summary);\n\t\t\t\tforeach (var line in diff.Diff.Split('\\n'))\n\t\t\t\t{\n\t\t\t\t\tusing (new ColorPrinter(ColorForDiffLine(line)))\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(line);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static ConsoleColor ColorForDiffLine(string line)\n\t\t{\n\t\t\tif (line.StartsWith(\"-\"))\n\t\t\t{\n\t\t\t\treturn ConsoleColor.DarkRed;\n\t\t\t}\n\t\t\tif (line.StartsWith(\"+\"))\n\t\t\t{\n\t\t\t\treturn ConsoleColor.DarkGreen;\n\t\t\t}\n\t\t\treturn ConsoleColor.White;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/CommandRunner.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection;\nusing System.Text;\n\nnamespace RegressionTests\n{\n\tinternal static class CommandRunner\n\t{\n\t\tprivate static readonly string Command = FindCommand();\n\n\t\tprivate static string FindCommand()\n\t\t{\n\t\t\tvar codeBase = Assembly.GetExecutingAssembly().CodeBase;\n\t\t\tvar uri = new UriBuilder(codeBase);\n\t\t\tvar path = Uri.UnescapeDataString(uri.Path);\n\t\t\tvar assemblyDirectory = Path.GetDirectoryName(path);\n\t\t\treturn Path.Combine(assemblyDirectory, \"Command.exe\");\n\t\t}\n\n\t\tpublic static CommandResult Run(string arguments)\n\t\t{\n\t\t\tvar p = new Process\n\t\t\t{\n\t\t\t\tStartInfo = new ProcessStartInfo\n\t\t\t\t{\n\t\t\t\t\tFileName = Command,\n\t\t\t\t\tArguments = arguments,\n\t\t\t\t\tCreateNoWindow = true,\n\t\t\t\t\tUseShellExecute = false,\n\t\t\t\t\tRedirectStandardOutput = true,\n\t\t\t\t\tRedirectStandardError = true\n\t\t\t\t}\n\t\t\t};\n\t\t\tvar stdOut = new StringBuilder();\n\t\t\tvar stdErr = new StringBuilder();\n\t\t\tp.OutputDataReceived += (sender, args) => {\n\t\t\t\tConsole.WriteLine(args.Data);\n\t\t\t\tstdOut.AppendLine(args.Data);\n\t\t\t};\n\t\t\tp.ErrorDataReceived += (sender, args) => {\n\t\t\t\tConsole.Error.WriteLine(args.Data);\n\t\t\t\tstdErr.AppendLine(args.Data);\n\t\t\t};\n\t\t\tp.Start();\n\t\t\tp.BeginOutputReadLine();\n\t\t\tp.BeginErrorReadLine();\n\t\t\tp.WaitForExit();\n\t\t\treturn new CommandResult(p.ExitCode, stdOut.ToString(), stdErr.ToString());\n\t\t}\n\t}\n\n\tinternal class CommandResult\n\t{\n\t\tpublic readonly int ExitCode;\n\t\tpublic readonly string StdOut;\n\t\tpublic readonly string StdErr;\n\n\t\tpublic CommandResult(int exitCode, string stdOut, string stdErr)\n\t\t{\n\t\t\tExitCode = exitCode;\n\t\t\tStdOut = stdOut;\n\t\t\tStdErr = stdErr;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/DirectoryDiffer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing DiffPlex;\nusing DiffPlex.DiffBuilder;\nusing DiffPlex.DiffBuilder.Model;\n\nnamespace RegressionTests\n{\n\tpublic static class DirectoryDiffer\n\t{\n\t\tpublic static List<FileDiff> Diff(string oldDir, string newDir)\n\t\t{\n\t\t\tAssertHasNoUnexpectedSubdirs(oldDir);\n\t\t\tAssertHasNoUnexpectedSubdirs(newDir);\n\t\t\tvar diffs = new List<FileDiff>();\n\t\t\tif (Directory.Exists(oldDir))\n\t\t\t{\n\t\t\t\tforeach (var oldFile in Directory.GetFiles(oldDir))\n\t\t\t\t{\n\t\t\t\t\tvar fileName = Path.GetFileName(oldFile);\n\t\t\t\t\tvar newFile = Path.Combine(newDir, fileName);\n\t\t\t\t\tif (!File.Exists(newFile))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar sb = new StringBuilder();\n\t\t\t\t\t\tforeach (var line in File.ReadAllLines(oldFile))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb.Append(\"-\" + line + \"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiffs.Add(new FileDiff(oldDir, newDir, fileName, DiffType.Deleted, sb.ToString()));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar diffBuilder = new InlineDiffBuilder(new Differ());\n\t\t\t\t\t\tvar diff = diffBuilder.BuildDiffModel(File.ReadAllText(oldFile), File.ReadAllText(newFile));\n\t\t\t\t\t\tif (diff.Lines.Any(l => l.Type == ChangeType.Inserted || l.Type == ChangeType.Deleted))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar sb = new StringBuilder();\n\t\t\t\t\t\t\tforeach (var line in diff.Lines)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch (line.Type)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase ChangeType.Inserted:\n\t\t\t\t\t\t\t\t\t\tsb.Append(\"+\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase ChangeType.Deleted:\n\t\t\t\t\t\t\t\t\t\tsb.Append(\"-\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tsb.Append(\" \");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsb.Append(line.Text + \"\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdiffs.Add(new FileDiff(oldDir, newDir, fileName, DiffType.Modified, sb.ToString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Directory.Exists(newDir))\n\t\t\t{\n\t\t\t\tforeach (var newFile in Directory.GetFiles(newDir))\n\t\t\t\t{\n\t\t\t\t\tvar fileName = Path.GetFileName(newFile);\n\t\t\t\t\tvar oldFile = Path.Combine(oldDir, fileName);\n\t\t\t\t\tif (!File.Exists(oldFile))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar sb = new StringBuilder();\n\t\t\t\t\t\tforeach (var line in File.ReadAllLines(newFile))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb.Append(\"+\" + line + \"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdiffs.Add(new FileDiff(oldDir, newDir, fileName, DiffType.Added, sb.ToString()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn diffs;\n\t\t}\n\n\t\tprivate static void AssertHasNoUnexpectedSubdirs(string dir)\n\t\t{\n\t\t\tif (Directory.Exists(dir) && Directory.GetDirectories(dir).Any(UnexpectedDir))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"A subdirectory exists in '\" + dir + \"', we don't support that.\");\n\t\t\t}\n\t\t}\n\n\t\tprivate static readonly IEnumerable<string> ValidSubdirs = new[] { \"images\" };\n\t\tprivate static bool UnexpectedDir(string dir)\n\t\t{\n\t\t\tvar index = dir.LastIndexOf(Path.DirectorySeparatorChar);\n\t\t\tvar dirName = index == -1 ? dir : dir.Remove(0, index + 1);\n\t\t\treturn !ValidSubdirs.Contains(dirName);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/FileDiff.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace RegressionTests\n{\n\tpublic class FileDiff\n\t{\n\t\tpublic string OldFile => Path.Combine(OldDir, FileName);\n\t\tpublic string NewFile => Path.Combine(NewDir, FileName);\n\t\tpublic readonly string OldDir;\n\t\tpublic readonly string NewDir;\n\t\tpublic readonly string FileName;\n\t\tpublic readonly DiffType DiffType;\n\t\tpublic readonly string Diff;\n\n\t\tpublic FileDiff(string oldDir, string newDir, string fileName, DiffType diffType, string diff)\n\t\t{\n\t\t\tOldDir = oldDir;\n\t\t\tNewDir = newDir;\n\t\t\tFileName = fileName;\n\t\t\tDiffType = diffType;\n\t\t\tDiff = diff;\n\t\t}\n\n\t\tpublic string Summary\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tswitch (DiffType)\n\t\t\t\t{\n\t\t\t\t\tcase DiffType.Added:\n\t\t\t\t\t\treturn \"added file \" + FileName;\n\t\t\t\t\tcase DiffType.Modified:\n\t\t\t\t\t\treturn \"changed file \" + FileName;\n\t\t\t\t\tcase DiffType.Deleted:\n\t\t\t\t\t\treturn \"deleted file \" + FileName;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new NotImplementedException();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic enum DiffType\n\t{\n\t\tAdded,\n\t\tDeleted,\n\t\tModified\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/InteractiveDiffAccepter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace RegressionTests\n{\n\tinternal static class InteractiveDiffAccepter\n\t{\n\t\t/// <summary>\n\t\t/// Return `true` if all diffs were accepted\n\t\t/// </summary>\n\t\tpublic static bool Run(IReadOnlyCollection<TestResult> diffs)\n\t\t{\n\t\t\tLog.Info(\"\");\n\t\t\tLog.Info(\"Running in interactive mode. Here are the changes:\");\n\t\t\tvar accepted = 0;\n\t\t\tusing (var it = diffs.GetEnumerator())\n\t\t\t{\n\t\t\t\tvar running = it.MoveNext();\n\t\t\t\twhile (running)\n\t\t\t\t{\n\t\t\t\t\tvar testResult = it.Current;\n\t\t\t\t\tLog.Info(\"Test : \" + testResult.Test.Name);\n\t\t\t\t\tColoredDiffPrinter.Print(testResult.Diff);\n\t\t\t\t\tvar answer = Log.Prompt(\"Accept this change? [y,n,q,a,?]?\");\n\t\t\t\t\tswitch (answer)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"y\":\n\t\t\t\t\t\t\taccepted++;\n\t\t\t\t\t\t\tAccept(testResult);\n\t\t\t\t\t\t\trunning = it.MoveNext();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"n\":\n\t\t\t\t\t\t\trunning = it.MoveNext();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"q\":\n\t\t\t\t\t\t\trunning = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"a\":\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\taccepted++;\n\t\t\t\t\t\t\t\tAccept(it.Current);\n\t\t\t\t\t\t\t} while (it.MoveNext());\n\t\t\t\t\t\t\trunning = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tLog.Info(\"y - accept this change\");\n\t\t\t\t\t\t\tLog.Info(\"n - do not accept this change\");\n\t\t\t\t\t\t\tLog.Info(\"q - quit; do not accept this change or any of the remaining ones\");\n\t\t\t\t\t\t\tLog.Info(\"a - accept this change and all later changes in the entire test run\");\n\t\t\t\t\t\t\tLog.Info(\"? - print help\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn accepted == diffs.Count();\n\t\t}\n\n\t\tprivate static void Accept(TestResult testResult)\n\t\t{\n\t\t\tforeach (var diff in testResult.Diff)\n\t\t\t{\n\t\t\t\tif (!Directory.Exists(diff.OldDir))\n\t\t\t\t{\n\t\t\t\t\tDirectory.CreateDirectory(diff.OldDir);\n\t\t\t\t}\n\t\t\t\tFile.Copy(diff.NewFile, diff.OldFile, true);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/Log.cs",
    "content": "﻿using System;\n\nnamespace RegressionTests\n{\n\tinternal static class Log\n\t{\n\t\tpublic static void Info(string message)\n\t\t{\n\t\t\tusing (new ColorPrinter(ConsoleColor.Blue))\n\t\t\t\tConsole.WriteLine(message);\n\t\t}\n\n\t\tpublic static void Success(string message)\n\t\t{\n\t\t\tusing (new ColorPrinter(ConsoleColor.DarkGreen))\n\t\t\t\tConsole.WriteLine(message);\n\t\t}\n\n\t\tpublic static void Warn(string message)\n\t\t{\n\t\t\tusing (new ColorPrinter(ConsoleColor.DarkYellow))\n\t\t\t\tConsole.WriteLine(message);\n\t\t}\n\n\t\tpublic static void Error(string message)\n\t\t{\n\t\t\tusing (new ColorPrinter(ConsoleColor.DarkRed))\n\t\t\t\tConsole.WriteLine(message);\n\t\t}\n\n\t\tpublic static string Prompt(string message)\n\t\t{\n\t\t\tusing (new ColorPrinter(ConsoleColor.Blue))\n\t\t\t{\n\t\t\t\tConsole.Write(message);\n\t\t\t\treturn Console.ReadLine();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/OutputCleaner.cs",
    "content": "﻿using System.Text.RegularExpressions;\n\nnamespace RegressionTests\n{\n\tpublic static class OutputCleaner\n\t{\n\t\t//Just removes paths typically found in our output. Will probably need updating now and again\n\t\t//Not the most robus code, but it's only for internal use anyway\n\t\tpublic static string RemovePaths(string str)\n\t\t{\n\t\t\tvar preceding = @\"(\\s|^|'|\\()\";\n\t\t\tvar fileName = @\"([\\S\\.]+.(ux|sketch|png))\";\n\t\t\tvar windowsRegex = new Regex(preceding + @\"\\w:[\\S\\\\]*\\\\\" + fileName);\n\t\t\tvar windowsReplaced = windowsRegex.Replace(str, \"$1<path removed>$2\");\n\n\t\t\tvar macRegex = new Regex(preceding + @\"/[\\S/]+/\" + fileName);\n\t\t\treturn macRegex.Replace(windowsReplaced, \"$1<path removed>$2\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/Program.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing Mono.Options;\n\nnamespace RegressionTests\n{\n\tinternal class Program\n\t{\n\t\tpublic static void Main(string[] args)\n\t\t{\n\t\t\tvar showHelp = false;\n\t\t\tvar interactive = false;\n\t\t\tvar enableTeamCityMessages = false;\n\t\t\tvar options = new OptionSet\n\t\t\t{\n\t\t\t\t{\"h|help\", \"Print help\", v => showHelp = true},\n\t\t\t\t{\"i|interactive\", \"Interactive mode to prompt for updating reference files\", v => interactive = true},\n\t\t\t\t{\"teamcity\", \"Enable TeamCity service messages\", t => enableTeamCityMessages = true},\n\t\t\t};\n\t\t\toptions.Parse(args);\n\n\t\t\tif (showHelp)\n\t\t\t{\n\t\t\t\tShowHelp(options);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (RunTests(interactive, enableTeamCityMessages))\n\t\t\t{\n\t\t\t\tEnvironment.Exit(1);\n\t\t\t}\n\t\t}\n\n\t\tprivate static void ShowHelp(OptionSet options)\n\t\t{\n\t\t\tvar message = @\"Usage: RegressionTests [<options>]\n\nRuns the converter on all files in SKETCH_FILES_DIR.\nThen compares the results to reference files.\nFails if any conversion fails, or a file differs from its reference.\n\nInteractive mode:\nRun with -i to get prompted whether to replace the reference files with\nthe new results\n\nIgnoring tests:\nA file in `files/Sketch43` can be ignored by adding a `.ignore` file next\nto it, for instance:\n```\nfiles/Sketch43/ColoredArialText.sketch\nfiles/Sketch43/ColoredArialText.sketch.ignore\n```\n\nOptions:\n\";\n\t\t\tConsole.WriteLine(message.Replace(\"SKETCH_FILES_DIR\", TestFinder.SketchFilesDir));\n\t\t\toptions.WriteOptionDescriptions(Console.Out);\n\t\t}\n\n\t\tprivate static bool RunTests(bool interactive, bool enableTeamCityMessages)\n\t\t{\n\t\t\tLog.Info(\"Starting test run. Build directory is \" + OutputRootDir);\n\t\t\tif (enableTeamCityMessages) TeamCityReporter.TestSuiteStarted();\n\t\t\tvar testResults = TestFinder.FindTests().Select(t => enableTeamCityMessages ? RunTestWithTCOutput(t) : RunTest(t)).ToList();\n\t\t\tif (enableTeamCityMessages) TeamCityReporter.TestSuiteFinished();\n\t\t\tLog.Info(\"\");\n\t\t\tLog.Info(\"SUMMARY:\");\n\n\t\t\tforeach (var testResult in testResults)\n\t\t\t{\n\t\t\t\tswitch (testResult.Result)\n\t\t\t\t{\n\t\t\t\t\tcase Result.Failed:\n\t\t\t\t\t\tLog.Error(testResult.ToString());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Result.Passed:\n\t\t\t\t\t\tLog.Success(testResult.ToString());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Result.Ignored:\n\t\t\t\t\t\tLog.Warn(testResult.ToString());\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar failures = testResults.Count(tr => tr.Result == Result.Failed);\n\t\t\tvar passes = testResults.Count(tr => tr.Result == Result.Passed);\n\t\t\tvar ignores = testResults.Count(tr => tr.Result == Result.Ignored);\n\n\t\t\tLog.Info(\"\");\n\t\t\tLog.Info(\"STATISTICS:\");\n\n\t\t\tLog.Success(\"Passed tests : \" + passes);\n\t\t\tLog.Error(\"Failed tests : \" + failures);\n\t\t\tLog.Warn(\"Ignored tests: \" + ignores);\n\n\t\t\tif (interactive)\n\t\t\t{\n\t\t\t\treturn !InteractiveDiffAccepter.Run(testResults.Where(t => t.Diff != null).ToList());\n\t\t\t}\n\n\t\t\treturn failures != 0;\n\t\t}\n\n\t\tprivate static TestResult RunTest(Test test)\n\t\t{\n\t\t\tLog.Info(\"\");\n\t\t\tif (File.Exists(test.Path + \".ignore\"))\n\t\t\t{\n\t\t\t\tLog.Warn(\"Ignoring : \" + test);\n\t\t\t\treturn new TestResult(test, Result.Ignored);\n\t\t\t}\n\n\t\t\tLog.Info(\"Running : \" + test);\n\t\t\tvar outputDir = Path.Combine(OutputRootDir, test.Name);\n\t\t\tDirectory.CreateDirectory(outputDir);\n\t\t\tvar result = CommandRunner.Run(\"-i \" + test.Path + \" -o \" + outputDir);\n\t\t\tif (result.ExitCode != 0)\n\t\t\t{\n\t\t\t\tLog.Error(\"Failed to convert: \" + test);\n\t\t\t\treturn new TestResult(test, Result.Failed);\n\t\t\t}\n\n\t\t\tFile.WriteAllText(Path.Combine(outputDir, \"stdout\"), OutputCleaner.RemovePaths(result.StdOut));\n\t\t\tFile.WriteAllText(Path.Combine(outputDir, \"stderr\"), OutputCleaner.RemovePaths(result.StdErr));\n\n\t\t\tvar oldDir = test.Path.Replace(\".sketch\", \".reference\");\n\n\t\t\tvar diffs = DirectoryDiffer.Diff(oldDir, outputDir);\n\n\t\t\tif (diffs.Any())\n\t\t\t{\n\t\t\t\tLog.Error(\"Failed with diff : \" + test);\n\t\t\t\tforeach (var diff in diffs)\n\t\t\t\t{\n\t\t\t\t\tLog.Info(diff.Summary);\n\t\t\t\t\tLog.Info(diff.Diff);\n\t\t\t\t}\n\t\t\t\treturn new TestResult(test, Result.Failed, diffs);\n\t\t\t}\n\n\t\t\tLog.Success(\"Passed : \" + test);\n\t\t\treturn new TestResult(test, Result.Passed);\n\t\t}\n\n\t\tprivate static TestResult RunTestWithTCOutput(Test test)\n\t\t{\n\t\t\tTeamCityReporter.TestStarted(test);\n\t\t\tvar result = RunTest(test);\n\t\t\tTeamCityReporter.TestResult(result);\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate static readonly string OutputRootDir = CreateOutputRootDir();\n\n\t\tprivate static string CreateOutputRootDir()\n\t\t{\n\t\t\tvar dir = Path.Combine(Path.GetTempPath() + \"SketchConverterRegressionTests\");\n\t\t\tif (Directory.Exists(dir))\n\t\t\t{\n\t\t\t\tDirectory.Delete(dir, true);\n\t\t\t}\n\t\t\tDirectory.CreateDirectory(dir);\n\t\t\treturn dir;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"RegressionTests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"RegressionTests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"42B45B5F-5F3F-4790-85FE-D21D0D3F0C92\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/RegressionTests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{42B45B5F-5F3F-4790-85FE-D21D0D3F0C92}</ProjectGuid>\n    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>RegressionTests</RootNamespace>\n    <AssemblyName>RegressionTests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"DiffPlex, Version=1.4.1.0, Culture=neutral, PublicKeyToken=1d35e91d1bd7bc0f\">\n      <HintPath>..\\packages\\DiffPlex.1.4.1\\lib\\netstandard1.0\\DiffPlex.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Mono.Options, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null\">\n      <HintPath>..\\node_modules\\%40fuse-open\\uno\\bin\\Mono.Options.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n      <HintPath>..\\packages\\System.Runtime.InteropServices.RuntimeInformation.4.3.0\\lib\\net45\\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ColoredDiffPrinter.cs\" />\n    <Compile Include=\"ColorPrinter.cs\" />\n    <Compile Include=\"CommandRunner.cs\" />\n    <Compile Include=\"FileDiff.cs\" />\n    <Compile Include=\"InteractiveDiffAccepter.cs\" />\n    <Compile Include=\"Log.cs\" />\n    <Compile Include=\"OutputCleaner.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Result.cs\" />\n    <Compile Include=\"TeamCityReporter.cs\" />\n    <Compile Include=\"Test.cs\" />\n    <Compile Include=\"TestFinder.cs\" />\n    <Compile Include=\"TestResult.cs\" />\n    <Compile Include=\"DirectoryDiffer.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Command\\Command.csproj\">\n      <Project>{c8ef4ac7-129c-4b5c-bec7-c57aacaa7887}</Project>\n      <Name>Command</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/Result.cs",
    "content": "﻿namespace RegressionTests\n{\n\tinternal enum Result\n\t{\n\t\tPassed,\n\t\tFailed,\n\t\tIgnored\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/TeamCityReporter.cs",
    "content": "﻿using System;\n\nnamespace RegressionTests\n{\n\tstatic class TeamCityReporter\n\t{\n\t\tpublic static void TestSuiteStarted()\n\t\t{\n\t\t\tConsole.WriteLine(\"##teamcity[testSuiteStarted name='RegressionTests']\");\n\t\t}\n\n\t\tpublic static void TestSuiteFinished()\n\t\t{\n\t\t\tConsole.WriteLine(\"##teamcity[testSuiteFinished name='RegressionTests']\");\n\t\t}\n\n\t\tpublic static void TestStarted(Test test)\n\t\t{\n\t\t\tConsole.WriteLine(\"##teamcity[testStarted name='\" + test.Name + \"' captureStandardOutput='true']\");\n\t\t}\n\n\t\tpublic static void TestResult(TestResult test)\n\t\t{\n\t\t\tswitch (test.Result)\n\t\t\t{\n\t\t\t\tcase Result.Ignored:\n\t\t\t\t\tTestIgnored(test.Test);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Result.Failed:\n\t\t\t\t\tTestFailed(test.Test);\n\t\t\t\t\tbreak;\n\t\t\t\t default:\n\t\t\t\t\t break;\n\t\t\t}\n\t\t\tTestFinished(test.Test);\n\t\t}\n\n\t\tprivate static void TestFailed(Test test)\n\t\t{\n\t\t\tConsole.WriteLine(\"##teamcity[testFailed name='\" + test.Name + \"']\");\n\t\t}\n\n\t\tprivate static void TestFinished(Test test)\n\t\t{\n\t\t\tConsole.WriteLine(\"##teamcity[testFinished name='\" + test.Name + \"']\");\n\t\t}\n\n\t\tprivate static void TestIgnored(Test test)\n\t\t{\n\t\t\tConsole.WriteLine(\"##teamcity[testIgnored name='\" + test.Name + \"']\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/Test.cs",
    "content": "﻿namespace RegressionTests\n{\n\tinternal class Test\n\t{\n\t\tpublic readonly string Name;\n\t\tpublic readonly string Path;\n\n\t\tpublic Test(string name, string path)\n\t\t{\n\t\t\tName = name;\n\t\t\tPath = path;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Name + \" (\" + Path + \")\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/TestFinder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n\nnamespace RegressionTests\n{\n\tinternal static class TestFinder\n\t{\n\t\tpublic static readonly string SketchFilesDir = Path.Combine(\"files\", \"Sketch43\");\n\t\tprivate static readonly string TestDirectory = FindTestDirectory();\n\n\t\tpublic static IEnumerable<Test> FindTests()\n\t\t{\n\t\t\treturn Directory.GetFiles(TestDirectory, \"*.sketch\")\n\t\t\t\t.Select(path => new Test(Path.GetFileNameWithoutExtension(path), path));\n\t\t}\n\n\t\tprivate static string FindTestDirectory()\n\t\t{\n\t\t\tvar directory = new DirectoryInfo(Directory.GetCurrentDirectory());\n\t\t\twhile (directory.Parent != null)\n\t\t\t{\n\t\t\t\tvar maybe = Path.Combine(directory.FullName, SketchFilesDir);\n\t\t\t\tif (Directory.Exists(maybe))\n\t\t\t\t{\n\t\t\t\t\treturn maybe;\n\t\t\t\t}\n\t\t\t\tdirectory = directory.Parent;\n\t\t\t}\n\t\t\tthrow new Exception(\"Didn't find test directory\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/TestResult.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace RegressionTests\n{\n\tinternal class TestResult\n\t{\n\t\tpublic readonly Test Test;\n\t\tpublic readonly Result Result;\n\t\tpublic readonly List<FileDiff> Diff;\n\n\t\tpublic TestResult(Test test, Result result, List<FileDiff> diff = null )\n\t\t{\n\t\t\tTest = test;\n\t\t\tResult = result;\n\t\t\tDiff = diff;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn string.Format(\"{0,-7} : {1}\", Result, Test);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"DiffPlex\" version=\"1.4.1\" targetFramework=\"net45\" />\n  <package id=\"Microsoft.NETCore.Platforms\" version=\"1.1.0\" targetFramework=\"net45\" />\n  <package id=\"NETStandard.Library\" version=\"1.6.1\" targetFramework=\"net45\" />\n  <package id=\"System.Collections\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Collections.Concurrent\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Diagnostics.Debug\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Diagnostics.Tools\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Diagnostics.Tracing\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Globalization\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.IO\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.IO.Compression\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Linq\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Linq.Expressions\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Net.Http\" version=\"4.3.4\" targetFramework=\"net45\" />\n  <package id=\"System.Net.Primitives\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.ObjectModel\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reflection\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reflection.Extensions\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reflection.Primitives\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Resources.ResourceManager\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Runtime\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Runtime.Extensions\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Runtime.InteropServices\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Runtime.InteropServices.RuntimeInformation\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Runtime.Numerics\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Text.Encoding\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Text.Encoding.Extensions\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Text.RegularExpressions\" version=\"4.3.1\" targetFramework=\"net45\" />\n  <package id=\"System.Threading\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Threading.Tasks\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Xml.ReaderWriter\" version=\"4.3.0\" targetFramework=\"net45\" />\n  <package id=\"System.Xml.XDocument\" version=\"4.3.0\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/sketch2fuse/RegressionTestsTests/DirectoryDifferTests.cs",
    "content": "﻿using System;\nusing System.IO;\nusing NUnit.Framework;\nusing RegressionTests;\n\nnamespace RegressionTestsTests\n{\n\tpublic class DirectoryDifferTests\n\t{\n\t\tprivate static readonly string TestDir = Path.Combine(Path.GetTempPath() + Guid.NewGuid());\n\t\tprivate static readonly string OldDir = Path.Combine(TestDir, \"Old\");\n\t\tprivate static readonly string NewDir = Path.Combine(TestDir, \"New\");\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tDirectory.CreateDirectory(TestDir);\n\t\t\tDirectory.CreateDirectory(OldDir);\n\t\t\tDirectory.CreateDirectory(NewDir);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tDirectory.Delete(TestDir, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TwoEmptyDirs()\n\t\t{\n\t\t\tAssert.AreEqual(0, DirectoryDiffer.Diff(OldDir, NewDir).Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FailsOnUnexpectedSubDirectories()\n\t\t{\n\t\t\t//The only subdirectories created in the ux writer is a potential folder for images. Throw if we\n\t\t\t//find any other subfolders since we don't support that yet in the differ\n\t\t\t//Can add it later if we start using it in the ux writer\n\t\t\t//This test is here to let us know if the ux writer started doing that, so we notice that we have to start supporting it in the differ too.\n\t\t\tvar subDir = Path.Combine(NewDir, \"foo\");\n\t\t\tDirectory.CreateDirectory(subDir);\n\t\t\tFile.WriteAllText(Path.Combine(OldDir, \"justToNotTriggerEmptyDirException\"), \"\");\n\t\t\tAssert.That(() => DirectoryDiffer.Diff(OldDir, NewDir),\n\t\t\t\tThrows.TypeOf<Exception>().With.Message\n\t\t\t\t\t.EqualTo(\"A subdirectory exists in '\" + NewDir + \"', we don't support that.\"));\n\t\t\tAssert.That(() => DirectoryDiffer.Diff(NewDir, OldDir),\n\t\t\t\tThrows.TypeOf<Exception>().With.Message\n\t\t\t\t\t.EqualTo(\"A subdirectory exists in '\" + NewDir + \"', we don't support that.\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void DoNotFailOnExpectedSubDirectories()\n\t\t{\n\t\t\t//Ignore subfolder called `images` in the differ. We probably don't want to diff these anyway\n\t\t\t//Can add it later if we start using it in the ux writer\n\t\t\t//This test is here to let us know if the ux writer started doing that, so we notice that we have to start supporting it in the differ too.\n\t\t\tvar subDir = Path.Combine(NewDir, \"images\");\n\t\t\tDirectory.CreateDirectory(subDir);\n\t\t\tFile.WriteAllText(Path.Combine(OldDir, \"justToNotTriggerEmptyDirException\"), \"\");\n\t\t\tAssert.DoesNotThrow(() => DirectoryDiffer.Diff(OldDir, NewDir));\n\t\t\tAssert.DoesNotThrow(() => DirectoryDiffer.Diff(NewDir, OldDir));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FileRemoved()\n\t\t{\n\t\t\tvar oldFile = Path.Combine(OldDir, \"oldfile\");\n\t\t\tFile.WriteAllText(oldFile, \"foo\\nbar\");\n\n\t\t\tvar diff = DirectoryDiffer.Diff(OldDir, NewDir);\n\n\t\t\tvar expected = \"-foo\\n-bar\\n\";\n\t\t\tAssert.That(diff.Count, Is.EqualTo(1));\n\t\t\tAssert.That(diff[0].Diff, Is.EqualTo(expected));\n\t\t\tAssert.That(diff[0].DiffType, Is.EqualTo(DiffType.Deleted));\n\t\t\tAssert.That(diff[0].OldFile, Is.EqualTo(oldFile));\n\t\t\tAssert.That(diff[0].NewFile, Is.EqualTo(Path.Combine(NewDir, \"oldfile\")));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FileAdded()\n\t\t{\n\t\t\tvar newFile = Path.Combine(NewDir, \"newfile\");\n\t\t\tFile.WriteAllText(newFile, \"foo\\nbar\");\n\n\t\t\tvar diff = DirectoryDiffer.Diff(OldDir, NewDir);\n\n\t\t\tvar expected = \"+foo\\n+bar\\n\";\n\t\t\tAssert.That(diff.Count, Is.EqualTo(1));\n\t\t\tAssert.That(diff[0].Diff, Is.EqualTo(expected));\n\t\t\tAssert.That(diff[0].DiffType, Is.EqualTo(DiffType.Added));\n\t\t\tAssert.That(diff[0].OldFile, Is.EqualTo(Path.Combine(OldDir, \"newfile\")));\n\t\t\tAssert.That(diff[0].NewFile, Is.EqualTo(newFile));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void FileModified()\n\t\t{\n\t\t\tvar oldFile = Path.Combine(OldDir, \"file\");\n\t\t\tvar newFile = Path.Combine(NewDir, \"file\");\n\t\t\tFile.WriteAllText(oldFile, \"1\\n2\\n3\\n4\");\n\t\t\tFile.WriteAllText(newFile, \"1\\na\\nb\\n4\");\n\n\t\t\tvar diff = DirectoryDiffer.Diff(OldDir, NewDir);\n\n\t\t\tvar expected = \" 1\\n-2\\n-3\\n+a\\n+b\\n 4\\n\";\n\t\t\tAssert.That(diff.Count, Is.EqualTo(1));\n\t\t\tAssert.That(diff[0].Diff, Is.EqualTo(expected));\n\t\t\tAssert.That(diff[0].DiffType, Is.EqualTo(DiffType.Modified));\n\t\t\tAssert.That(diff[0].OldFile, Is.EqualTo(oldFile));\n\t\t\tAssert.That(diff[0].NewFile, Is.EqualTo(newFile));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoChanges()\n\t\t{\n\t\t\tFile.WriteAllText(Path.Combine(OldDir, \"file\"), \"1\\n2\\n3\\n4\");\n\t\t\tFile.WriteAllText(Path.Combine(NewDir, \"file\"), \"1\\n2\\n3\\n4\");\n\n\t\t\tvar diff = DirectoryDiffer.Diff(OldDir, NewDir);\n\n\t\t\tAssert.That(diff.Count, Is.EqualTo(0));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void MultipleChanges()\n\t\t{\n\t\t\tvar oldFile = Path.Combine(OldDir, \"oldfile\");\n\t\t\tvar newFile = Path.Combine(NewDir, \"newfile\");\n\t\t\tvar oldChangedFile = Path.Combine(OldDir, \"changedfile\");\n\t\t\tvar newChangedFile = Path.Combine(NewDir, \"changedfile\");\n\t\t\tFile.WriteAllText(oldFile, \"foo\\nbar\");\n\t\t\tFile.WriteAllText(newFile, \"foo\\nbar\");\n\t\t\tFile.WriteAllText(oldChangedFile, \"1\\n2\\n3\\n4\");\n\t\t\tFile.WriteAllText(newChangedFile, \"1\\na\\nb\\n4\");\n\n\t\t\tvar diff = DirectoryDiffer.Diff(OldDir, NewDir);\n\n\t\t\tAssert.That(diff.Count, Is.EqualTo(3));\n\n\t\t\tAssert.That(diff[0].DiffType, Is.EqualTo(DiffType.Modified));\n\t\t\tAssert.That(diff[0].OldFile, Is.EqualTo(oldChangedFile));\n\t\t\tAssert.That(diff[0].NewFile, Is.EqualTo(newChangedFile));\n\t\t\tAssert.That(diff[0].Diff, Is.EqualTo(\" 1\\n-2\\n-3\\n+a\\n+b\\n 4\\n\"));\n\n\t\t\tAssert.That(diff[1].DiffType, Is.EqualTo(DiffType.Deleted));\n\t\t\tAssert.That(diff[1].OldFile, Is.EqualTo(oldFile));\n\t\t\tAssert.That(diff[1].NewFile, Is.EqualTo(Path.Combine(NewDir, \"oldfile\")));\n\t\t\tAssert.That(diff[1].Diff, Is.EqualTo(\"-foo\\n-bar\\n\"));\n\n\t\t\tAssert.That(diff[2].DiffType, Is.EqualTo(DiffType.Added));\n\t\t\tAssert.That(diff[2].OldFile, Is.EqualTo(Path.Combine(OldDir, \"newfile\")));\n\t\t\tAssert.That(diff[2].NewFile, Is.EqualTo(newFile));\n\t\t\tAssert.That(diff[2].Diff, Is.EqualTo(\"+foo\\n+bar\\n\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ReferenceDirDoesntExist()\n\t\t{\n\t\t\tDirectory.Delete(OldDir);\n\n\t\t\tvar newFile = Path.Combine(NewDir, \"newfile\");\n\t\t\tFile.WriteAllText(newFile, \"foo\\nbar\");\n\n\t\t\tvar diff = DirectoryDiffer.Diff(OldDir, NewDir);\n\n\t\t\tvar expected = \"+foo\\n+bar\\n\";\n\t\t\tAssert.That(diff.Count, Is.EqualTo(1));\n\t\t\tAssert.That(diff[0].Diff, Is.EqualTo(expected));\n\t\t\tAssert.That(diff[0].DiffType, Is.EqualTo(DiffType.Added));\n\t\t\tAssert.That(diff[0].OldFile, Is.EqualTo(Path.Combine(OldDir, \"newfile\")));\n\t\t\tAssert.That(diff[0].NewFile, Is.EqualTo(newFile));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OutputDirDoesntExist()\n\t\t{\n\t\t\tDirectory.Delete(NewDir);\n\n\t\t\tvar oldFile = Path.Combine(OldDir, \"oldfile\");\n\t\t\tFile.WriteAllText(oldFile, \"foo\\nbar\");\n\n\t\t\tvar diff = DirectoryDiffer.Diff(OldDir, NewDir);\n\n\t\t\tvar expected = \"-foo\\n-bar\\n\";\n\t\t\tAssert.That(diff.Count, Is.EqualTo(1));\n\t\t\tAssert.That(diff[0].Diff, Is.EqualTo(expected));\n\t\t\tAssert.That(diff[0].DiffType, Is.EqualTo(DiffType.Deleted));\n\t\t\tAssert.That(diff[0].OldFile, Is.EqualTo(oldFile));\n\t\t\tAssert.That(diff[0].NewFile, Is.EqualTo(Path.Combine(NewDir, \"oldfile\")));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTestsTests/OutputCleanerTests.cs",
    "content": "﻿using NUnit.Framework;\nusing RegressionTests;\n\nnamespace RegressionTestsTests\n{\n\tpublic class OutputCleanerTests\n\t{\n\t\t[Test]\n\t\tpublic void LeavesMostThingsAlone_WhichSoundsNiceWhyDontPeopleJustLeaveMeAloneToo()\n\t\t{\n\t\t\tAssert.That(OutputCleaner.RemovePaths(\"\"), Is.EqualTo(\"\"));\n\t\t\tAssert.That(OutputCleaner.RemovePaths(\"foo\"), Is.EqualTo(\"foo\"));\n\t\t\tAssert.That(OutputCleaner.RemovePaths(\"not/a/path.ux\"), Is.EqualTo(\"not/a/path.ux\"));\n\t\t\tAssert.That(OutputCleaner.RemovePaths(\"not\\\\a\\\\path.ux\"), Is.EqualTo(\"not\\\\a\\\\path.ux\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RemovesMacPaths()\n\t\t{\n\t\t\tAssert.AreEqual(\"<path removed>lol.ux\", OutputCleaner.RemovePaths(\"/tmp/lol.ux\"));\n\t\t\tAssert.AreEqual(\"<path removed>lal.sketch\", OutputCleaner.RemovePaths(\"/var/tmp/lal.sketch\"));\n\t\t\tAssert.AreEqual(\"<path removed>lal.ux\", OutputCleaner.RemovePaths(\"/var/t-m-p/lal.ux\"));\n\t\t\tAssert.AreEqual(\n\t\t\t\t\"INFO: Wrote 'Sketch.FillFlatColor' to '<path removed>Sketch.FillFlatColor.ux'\",\n\t\t\t\tOutputCleaner.RemovePaths(\"INFO: Wrote 'Sketch.FillFlatColor' to '/var/folders/dj/qjbkn7k520n2229lwtx1hg6c0000gn/T/SketchConverterRegressionTests/AllFillTypes/Sketch.FillFlatColor.ux'\"));\n\t\t\tAssert.AreEqual(\n\t\t\t\t\"INFO: Converting <path removed>AllFillTypes.sketch created with Sketch 48.2 variant NONAPPSTORE build97\",\n\t\t\t\tOutputCleaner.RemovePaths(\"INFO: Converting /Users/knatten/code/SketchImporter/files/Sketch43/AllFillTypes.sketch created with Sketch 48.2 variant NONAPPSTORE build97\"));\n\t\t\tAssert.AreEqual(\n\t\t\t\t\"Running : desert-moon-zwj-sketch43 (<path removed>desert-moon-zwj-sketch43.sketch)\",\n\t\t\t\tOutputCleaner.RemovePaths(\"Running : desert-moon-zwj-sketch43 (/Users/knatten/code/SketchImporter/files/Sketch43/desert-moon-zwj-sketch43.sketch)\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void RemovesWindowsPaths()\n\t\t{\n\t\t\tAssert.AreEqual(@\"<path removed>lol.ux\", OutputCleaner.RemovePaths(@\"C:\\dir\\lol.ux\"));\n\t\t\tAssert.AreEqual(@\"<path removed>lal.sketch\", OutputCleaner.RemovePaths(@\"C:\\dir\\dar\\lal.sketch\"));\n\t\t\tAssert.AreEqual(@\"<path removed>lal.ux\", OutputCleaner.RemovePaths(@\"C:\\dir\\d-a-r\\lal.ux\"));\n\t\t\tAssert.AreEqual(\n\t\t\t\t@\"INFO: Wrote 'Sketch.FillFlatColor' to '<path removed>Sketch.FillFlatColor.ux'\",\n\t\t\t\tOutputCleaner.RemovePaths(@\"INFO: Wrote 'Sketch.FillFlatColor' to 'C:\\BuildAgent-1\\temp\\buildTmp\\SketchConverterRegressionTests\\AllFillTypes\\Sketch.FillFlatColor.ux'\"));\n\t\t\tAssert.AreEqual(\n\t\t\t\t@\"INFO: Converting <path removed>AllFillTypes.sketch created with Sketch 48.2 variant NONAPPSTORE build97\",\n\t\t\t\tOutputCleaner.RemovePaths(@\"INFO: Converting C:\\BuildAgent-1\\temp\\buildTmp\\SketchConverterRegressionTests\\AllFillTypes\\AllFillTypes.sketch created with Sketch 48.2 variant NONAPPSTORE build97\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/RegressionTestsTests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"RegressionTestsTests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"RegressionTestsTests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"CD83B172-60DE-4677-9A5D-0B3699A1D15C\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "src/sketch2fuse/RegressionTestsTests/RegressionTestsTests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{CD83B172-60DE-4677-9A5D-0B3699A1D15C}</ProjectGuid>\n    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>RegressionTestsTests</RootNamespace>\n    <AssemblyName>RegressionTestsTests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb\">\n      <HintPath>..\\packages\\NUnit.3.5.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"DirectoryDifferTests.cs\" />\n    <Compile Include=\"OutputCleanerTests.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\RegressionTests\\RegressionTests.csproj\">\n      <Project>{42b45b5f-5f3f-4790-85fe-d21d0d3f0c92}</Project>\n      <Name>RegressionTests</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/sketch2fuse/RegressionTestsTests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"NUnit\" version=\"3.5.0\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/sketch2fuse/Sketch2Fuse.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.25420.1\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SketchConverter\", \"SketchConverter\\SketchConverter.csproj\", \"{B086E390-CE62-4C90-9214-9E828DE7AF33}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SketchConverterTests\", \"SketchConverterTests\\SketchConverterTests.csproj\", \"{D7DBE4E2-7E7F-4B7D-BFF5-2B9883555330}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Command\", \"Command\\Command.csproj\", \"{C8EF4AC7-129C-4B5C-BEC7-C57AACAA7887}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"EndToEndTests\", \"EndToEndTests\\EndToEndTests.csproj\", \"{54732A2D-CA63-40FE-BECF-EB8040A67099}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"RegressionTests\", \"RegressionTests\\RegressionTests.csproj\", \"{42B45B5F-5F3F-4790-85FE-D21D0D3F0C92}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"RegressionTestsTests\", \"RegressionTestsTests\\RegressionTestsTests.csproj\", \"{CD83B172-60DE-4677-9A5D-0B3699A1D15C}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B086E390-CE62-4C90-9214-9E828DE7AF33}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{D7DBE4E2-7E7F-4B7D-BFF5-2B9883555330}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{D7DBE4E2-7E7F-4B7D-BFF5-2B9883555330}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{D7DBE4E2-7E7F-4B7D-BFF5-2B9883555330}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{D7DBE4E2-7E7F-4B7D-BFF5-2B9883555330}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C8EF4AC7-129C-4B5C-BEC7-C57AACAA7887}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C8EF4AC7-129C-4B5C-BEC7-C57AACAA7887}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C8EF4AC7-129C-4B5C-BEC7-C57AACAA7887}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C8EF4AC7-129C-4B5C-BEC7-C57AACAA7887}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{54732A2D-CA63-40FE-BECF-EB8040A67099}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{54732A2D-CA63-40FE-BECF-EB8040A67099}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{54732A2D-CA63-40FE-BECF-EB8040A67099}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{54732A2D-CA63-40FE-BECF-EB8040A67099}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{42B45B5F-5F3F-4790-85FE-D21D0D3F0C92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{42B45B5F-5F3F-4790-85FE-D21D0D3F0C92}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{42B45B5F-5F3F-4790-85FE-D21D0D3F0C92}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{42B45B5F-5F3F-4790-85FE-D21D0D3F0C92}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CD83B172-60DE-4677-9A5D-0B3699A1D15C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CD83B172-60DE-4677-9A5D-0B3699A1D15C}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CD83B172-60DE-4677-9A5D-0B3699A1D15C}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CD83B172-60DE-4677-9A5D-0B3699A1D15C}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/API/Factory.cs",
    "content": "﻿using SketchConverter.UxBuilder;\n\nnamespace SketchConverter.API\n{\n    public static class Factory\n    {\n        public static IConverter CreateConverterWithSymbolsUxBuilder(ILogger logger)\n        {\n            return new Converter(new SketchParser.SketchParser(logger), new SymbolsUxBuilder(logger), logger);\n        }\n    }\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/API/IConverter.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace SketchConverter.API\n{\n\tpublic interface IConverter\n\t{\n\t\tvoid Convert(IEnumerable<string> sketchFilePath, string outputdirPath);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/API/ILogger.cs",
    "content": "﻿namespace SketchConverter.API\n{\n\tpublic interface ILogger\n\t{\n\t\tvoid Info(string info);\n\t\tvoid Warning(string warning);\n\t\tvoid Error(string error);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/CompatibilityChecker.cs",
    "content": "﻿using System.Globalization;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json.Linq;\nusing SketchConverter.API;\nusing SketchConverter.SketchParser; // for ISketchArchive\n\nnamespace SketchConverter\n{\n\tpublic static class CompatibilityChecker\n\t{\n\t\t// A sketch file archive (unzipped sketch file) contains a file called meta.json\n\t\t// which contains version information. An archive can have for example have version 97, but\n\t\t// compatibility version 93. This is the oldest version it is backwards compatible with.\n\t\tpublic static readonly int SketchCompatibilityVersion = 93;\n\n\t\tpublic static void Check(string sketchFilePath,\n\t\t\t\t\t\t\t\t ISketchArchive sketchArchive,\n\t\t\t\t\t\t\t\t ILogger log)\n\t\t{\n\t\t\tvar meta = LoadMetaDataAsync(sketchArchive).Result;\n\t\t\tlog.Info(\"You are running Sketch2Fuse compatible with Sketch format \" +\n\t\t\t\t\t \"version \" + SketchCompatibilityVersion);\n\t\t\tlog.Info(\"Converting \" + sketchFilePath + \" created with Sketch \"\n\t\t\t\t\t + meta.AppVersion + \" variant \" + meta.Variant + \" build\" +\n\t\t\t\t\t meta.Version);\n\n\t\t\tif (meta.CompatibilityVersion > SketchCompatibilityVersion)\n\t\t\t{\n\t\t\t\tlog.Warning(\n\t\t\t\t\t\"The sketch file you are converting to UX has been created with a newer version of Sketch than the converter supports.\");\n\t\t\t}\n\t\t\telse if (meta.CompatibilityVersion < SketchCompatibilityVersion)\n\t\t\t{\n\t\t\t\tlog.Warning(\n\t\t\t\t\t\"The sketch file was created with an older version than Sketch2Fuse supports, please open the file in Sketch and save it as with the newer version if you experence any problems.\");\n\t\t\t}\n\t\t}\n\n\t\tpublic struct SketchMeta\n\t\t{\n\t\t\tpublic double AppVersion;\n\t\t\tpublic int CompatibilityVersion;\n\t\t\tpublic int Version;\n\t\t\tpublic int Build;\n\t\t\tpublic string Variant;\n\t\t}\n\n\t\tprivate static async Task<SketchMeta> LoadMetaDataAsync(ISketchArchive sketchArchive)\n\t\t{\n\t\t\tusing (var infoStream = sketchArchive.OpenFile(\"meta.json\"))\n\t\t\t{\n\t\t\t\tvar json = JObject.Parse(await infoStream.ReadToStringAsync().ConfigureAwait(false));\n\t\t\t\tvar appversion = double.Parse((string) json[\"appVersion\"], CultureInfo.InvariantCulture);\n\t\t\t\t// The first version of the open Sketch format doesn't have compatibilityVersion field.\n\t\t\t\t// ref TestProject.sketch. 2017-12-06 anette\n\t\t\t\tvar compatibilityVersion = json[\"compatibilityVersion\"] != null ? int.Parse((string) json[\"compatibilityVersion\"]) : -1;\n\t\t\t\tvar version = int.Parse((string) json[\"version\"]);\n\t\t\t\tvar build = (int) json[\"build\"];\n\t\t\t\tvar variant = (string) json[\"variant\"];\n\n\t\t\t\treturn new SketchMeta()\n\t\t\t\t{\n\t\t\t\t\tAppVersion = appversion,\n\t\t\t\t\tCompatibilityVersion =\n\t\t\t\t\t\tcompatibilityVersion,\n\t\t\t\t\tVersion = version,\n\t\t\t\t\tBuild = build,\n\t\t\t\t\tVariant = variant\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/Converter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Mono.Unix;\nusing Mono.Unix.Native;\nusing SketchConverter.API;\nusing SketchConverter.SketchParser;\nusing SketchConverter.UxBuilder;\n\nnamespace SketchConverter\n{\n\tpublic class Converter : IConverter\n\t{\n\t\tprivate readonly IUxBuilder _builder;\n\t\tprivate readonly ISketchParser _parser;\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic Converter(ISketchParser parser, IUxBuilder builder, ILogger log)\n\t\t{\n\t\t\t_parser = parser;\n\t\t\t_builder = builder;\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic void Convert(IEnumerable<string> sketchFilePath, string outputdirPath)\n\t\t{\n\t\t\tif (OutputDirectoryNotValid(outputdirPath)) return;\n\t\t\tvar validInputPaths = ValidInputFiles(sketchFilePath);\n\n\t\t\tforeach (var validInputPath in validInputPaths)\n\t\t\t{\n\t\t\t\tusing (var stream = File.Open(validInputPath, FileMode.Open))\n\t\t\t\tusing (var sketchArchive = new SketchArchive())\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tsketchArchive.Load(stream);\n\t\t\t\t\t\tCompatibilityChecker.Check(validInputPath, sketchArchive, _log);\n\t\t\t\t\t\tvar document = _parser.Parse(sketchArchive);\n\t\t\t\t\t\t_builder.Build(document, outputdirPath);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (AggregateException ae)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (var e in ae.Flatten().InnerExceptions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_log.Error(validInputPath + \" : \" + e.Message);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\t_log.Error(validInputPath + \" : \" + e.Message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tprivate IEnumerable<string> ValidInputFiles(IEnumerable<string> inputFilePaths)\n\t\t{\n\t\t\tforeach (var sketchFilePath in inputFilePaths)\n\t\t\t{\n\t\t\t\tif (!File.Exists(sketchFilePath))\n\t\t\t\t{\n\t\t\t\t\t_log.Error(\"Can't convert non-existing Sketch-file \" + sketchFilePath);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tyield return sketchFilePath;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate bool OutputDirectoryNotValid(string outputdirPath)\n\t\t{\n\t\t\tif (!Directory.Exists(outputdirPath))\n\t\t\t{\n\t\t\t\t_log.Error(\"Output directory \" + outputdirPath + \" does not exist\");\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (Environment.OSVersion.Platform == PlatformID.MacOSX ||\n\t\t\t\tEnvironment.OSVersion.Platform == PlatformID.Unix)\n\t\t\t{\n\t\t\t\tvar ufi = new UnixFileInfo(outputdirPath);\n\t\t\t\t// accessible for writing\n\t\t\t\tif (!ufi.CanAccess(AccessModes.W_OK))\n\t\t\t\t{\n\t\t\t\t\t_log.Error(\"Can't access output directory \" + outputdirPath);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tDirectory.GetAccessControl(outputdirPath);\n\t\t\t\t}\n\t\t\t\tcatch (UnauthorizedAccessException e)\n\t\t\t\t{\n\t\t\t\t\t_log.Error(e.Message);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/Optional.cs",
    "content": "﻿using System;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace SketchConverter\n{\n\tpublic static class NullToNone\n\t{\n\t\t/// <summary>\n\t\t/// Convert null to None and other values to Some(T)\n\t\t/// </summary>\n\t\tpublic static Optional<T> ToOptional<T>(this T value) where T : class\n\t\t{\n\t\t\treturn value != null\n\t\t\t\t? Optional.Some(value)\n\t\t\t\t: Optional.None();\n\t\t}\n\t}\n\n\tpublic class None\n\t{\n\t}\n\n\tpublic static partial class Optional\n\t{\n\t\tpublic static Optional<T> Some<T>(T value)\n\t\t{\n\t\t\treturn new Optional<T>(true, value);\n\t\t}\n\n\t\tpublic static Optional<T> None<T>()\n\t\t{\n\t\t\treturn new Optional<T>(false);\n\t\t}\n\n\t\tpublic static None None()\n\t\t{\n\t\t\treturn new None();\n\t\t}\n\t}\n\n\tpublic struct Optional<T> : IEquatable<Optional<T>>, IEnumerable<T>\n\t{\n\t\treadonly bool _hasValue;\n\t\treadonly T _value;\n\n\t\tpublic bool HasValue\n\t\t{\n\t\t\tget { return _hasValue; }\n\t\t}\n\n\t\tpublic T Value\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (!_hasValue) throw new InvalidOperationException();\n\t\t\t\treturn _value;\n\t\t\t}\n\t\t}\n\n\t\tinternal Optional(bool hasValue, T value = default(T))\n\t\t{\n\t\t\t_hasValue = hasValue;\n\t\t\t_value = value;\n\t\t}\n\n\t\tpublic static implicit operator Optional<T>(T value)\n\t\t{\n\t\t\treturn new Optional<T>(true, value);\n\t\t}\n\n\t\tpublic static implicit operator Optional<T>(None value)\n\t\t{\n\t\t\treturn new Optional<T>(false);\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\treturn obj is Optional<T> && Equals((Optional<T>)obj);\n\t\t}\n\n\t\tpublic bool Equals(Optional<T> other)\n\t\t{\n\t\t\treturn _hasValue.Equals(other._hasValue) && EqualityComparer<T>.Default.Equals(_value, other._value);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (_hasValue.GetHashCode() * 397) ^ EqualityComparer<T>.Default.GetHashCode(_value);\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(Optional<T> left, Optional<T> right)\n\t\t{\n\t\t\treturn left.Equals(right);\n\t\t}\n\n\t\tpublic static bool operator !=(Optional<T> left, Optional<T> right)\n\t\t{\n\t\t\treturn !left.Equals(right);\n\t\t}\n\n\t\tpublic Optional<TResult> As<TResult>() where TResult : T\n\t\t{\n\t\t\treturn _hasValue && _value is TResult\n\t\t\t\t? Optional.Some((TResult)_value)\n\t\t\t\t: Optional.None();\n\t\t}\n\n\t\tpublic Optional<T> Where(Func<T, bool> predicate)\n\t\t{\n\t\t\treturn _hasValue && predicate(_value)\n\t\t\t\t? Optional.Some(_value)\n\t\t\t\t: Optional.None();\n\t\t}\n\n\t\tpublic void Do(Action<T> some)\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\tsome(_value);\n\t\t}\n\n\n\t\tpublic void Do(Action<T> some, Action none)\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\tsome(_value);\n\t\t\telse\n\t\t\t\tnone();\n\t\t}\n\n\t\tpublic void MatchWith(Action<T> some, Action none)\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\tsome(_value);\n\t\t\telse\n\t\t\t\tnone();\n\t\t}\n\n\t\tpublic TResult MatchWith<TResult>(\n\t\t\tFunc<T, TResult> some,\n\t\t\tFunc<TResult> none)\n\t\t{\n\t\t\treturn _hasValue ? some(_value) : none();\n\t\t}\n\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn HasValue\n\t\t\t\t? \"Some {\" + Value + \"}\"\n\t\t\t\t: \"None\";\n\t\t}\n\n\t\tpublic IEnumerator<T> GetEnumerator()\n\t\t{\n\t\t\tif (_hasValue)\n\t\t\t\tyield return _value;\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"SketchConverter\")]\n[assembly: AssemblyDescription(\"Sketch to .ux converter\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Build & Run\")]\n[assembly: AssemblyProduct(\"SketchConverter\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"B086E390-CE62-4C90-9214-9E828DE7AF33\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/Result.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace SketchConverter\n{\n\tpublic static class Result\n\t{\n\t\tpublic static Ok<T> Ok<T>(T value)\n\t\t{\n\t\t\treturn new Ok<T>(value);\n\t\t}\n\n\t\tpublic static Err<T> Err<T>(string error)\n\t\t{\n\t\t\treturn new Err<T>(error);\n\t\t}\n\n\t\tpublic static Err Err(string error)\n\t\t{\n\t\t\treturn new Err(error);\n\t\t}\n\t}\n\n\tpublic class Result<T>\n\t{\n\t\tpublic T Expect(string message = null)\n\t\t{\n\t\t\tvar ok = this as Ok<T>;\n\t\t\tif (ok != null)\n\t\t\t\treturn ok.Value;\n\n\t\t\tvar err = this as Err<T>;\n\t\t\tif (err != null)\n\t\t\t\tthrow new Exception(((message == null) ? \"\" : (message + \": \")) + err.Message);\n\n\t\t\tthrow new Exception(\"Internal error\");\n\t\t}\n\n\t\tpublic static implicit operator Result<T>(T value)\n\t\t{\n\t\t\treturn new Ok<T>(value);\n\t\t}\n\n\t\tpublic static implicit operator Result<T>(Err error)\n\t\t{\n\t\t\treturn new Err<T>(error.Message);\n\t\t}\n\t}\n\n\tpublic class Ok<T> : Result<T>\n\t{\n\t\tpublic readonly T Value;\n\n\t\tpublic Ok(T value)\n\t\t{\n\t\t\tValue = value;\n\t\t}\n\n\t}\n\n\tpublic class Err<T> : Result<T>\n\t{\n\t\tpublic readonly string Message;\n\n\t\tpublic Err(string message)\n\t\t{\n\t\t\tMessage = message;\n\t\t}\n\t}\n\n\tpublic class Err\n\t{\n\t\tpublic readonly string Message;\n\n\t\tpublic Err(string message)\n\t\t{\n\t\t\tMessage = message;\n\t\t}\n\t}\n\n\tpublic static class ResultExtensions\n\t{\n\t\tpublic static IEnumerable<T> SelectOk<T>(this IEnumerable<Result<T>> self)\n\t\t{\n\t\t\treturn self\n\t\t\t\t.Where(v => v is Ok<T>)\n\t\t\t\t.Select(v => ((Ok<T>) v).Value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchConverter.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{B086E390-CE62-4C90-9214-9E828DE7AF33}</ProjectGuid>\n    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>SketchConverter</RootNamespace>\n    <AssemblyName>SketchConverter</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpZipLib.1.3.3\\lib\\net45\\ICSharpCode.SharpZipLib.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Mono.Posix\">\n      <HintPath>..\\..\\..\\packages\\Mono.Posix-4.5.4.5.0\\lib\\net45\\Mono.Posix.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Newtonsoft.Json\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Newtonsoft.Json.dll</HintPath>\n    </Reference>\n    <Reference Include=\"plist-cil, Version=2.1.0.0, Culture=neutral, PublicKeyToken=ec2cb9e1a719933d, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\plist-cil.2.1.0\\lib\\netstandard1.3\\plist-cil.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Buffers.4.4.0\\lib\\netstandard1.1\\System.Buffers.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.IO.FileSystem.4.3.0\\lib\\net46\\System.IO.FileSystem.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.IO.FileSystem.Primitives.4.3.0\\lib\\net46\\System.IO.FileSystem.Primitives.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Memory.4.5.0\\lib\\netstandard1.1\\System.Memory.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Numerics\" />\n    <Reference Include=\"System.Reflection.TypeExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reflection.TypeExtensions.4.3.0\\lib\\net46\\System.Reflection.TypeExtensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.0\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.Serialization\" />\n    <Reference Include=\"System.Runtime.Serialization.Formatters, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.Serialization.Formatters.4.3.0\\lib\\net46\\System.Runtime.Serialization.Formatters.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.Serialization.Primitives, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.Serialization.Primitives.4.3.0\\lib\\net46\\System.Runtime.Serialization.Primitives.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Xml.XmlDocument.4.3.0\\lib\\net46\\System.Xml.XmlDocument.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"API\\Factory.cs\" />\n    <Compile Include=\"API\\IConverter.cs\" />\n    <Compile Include=\"API\\ILogger.cs\" />\n    <Compile Include=\"CompatibilityChecker.cs\" />\n    <Compile Include=\"Converter.cs\" />\n    <Compile Include=\"Optional.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Result.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchArtboard.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchBitmap.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchGroup.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchLayer.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchRectangle.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchShapeGroup.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchShapePath.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchSymbolInstance.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchSymbolMaster.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\Layers\\SketchText.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\SketchDocument.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\SketchEntity.cs\" />\n    <Compile Include=\"SketchModel\\Entities\\SketchPage.cs\" />\n    <Compile Include=\"SketchModel\\Types\\ISketchBrush.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchAlignment.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchAttributedString.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchBlur.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchBorder.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchColor.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchCurvePoint.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchFill.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchGradientStop.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchImage.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchLinearGradientBrush.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchPath.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchPoint.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchRect.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchShadow.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchSolidColorBrush.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchStringAttribute.cs\" />\n    <Compile Include=\"SketchModel\\Types\\SketchStyle.cs\" />\n    <Compile Include=\"SketchParser\\AttributedStringParser.cs\" />\n    <Compile Include=\"SketchParser\\Exceptions.cs\" />\n    <Compile Include=\"SketchParser\\ISketchArchive.cs\" />\n    <Compile Include=\"SketchParser\\SketchArchive.cs\" />\n    <Compile Include=\"SketchParser\\SketchParser.cs\" />\n    <Compile Include=\"SketchParser\\SketchParserInternal.cs\" />\n    <Compile Include=\"Transforms\\ITransform.cs\" />\n    <Compile Include=\"Transforms\\TextPropertyTransform.cs\" />\n    <Compile Include=\"UxBuilder\\ArtboardUxBuilder.cs\" />\n    <Compile Include=\"UxBuilder\\AssetEmitter.cs\" />\n    <Compile Include=\"UxBuilder\\Geometry.cs\" />\n    <Compile Include=\"UxBuilder\\IUxBuilder.cs\" />\n    <Compile Include=\"UxBuilder\\LayoutBuilder.cs\" />\n    <Compile Include=\"UxBuilder\\NameValidator.cs\" />\n    <Compile Include=\"UxBuilder\\SketchCurvePointsToSvg.cs\" />\n    <Compile Include=\"UxBuilder\\SymbolClassNameBuilder.cs\" />\n    <Compile Include=\"UxBuilder\\SymbolsUxBuilder.cs\" />\n    <Compile Include=\"UxBuilder\\UXBuilder.cs\" />\n    <Compile Include=\"UxBuilder\\Exceptions.cs\" />\n    <Compile Include=\"UxBuilder\\UXNode.cs\" />\n    <Compile Include=\"UxBuilder\\UxSize.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchArtboard.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchArtboard : SketchLayer\n\t{\n\t\tpublic SketchArtboard(SketchLayer parentLayer) : base(parentLayer)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchBitmap.cs",
    "content": "﻿using SketchConverter.SketchParser;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchBitmap : SketchLayer\n\t{\n\t\tpublic readonly SketchImage Image;\n\t\tpublic new SketchStyle Style { get { return ((SketchLayer)this).Style.Value; } }\n\n\t\tpublic SketchBitmap(SketchLayer layer, SketchImage image) : base(layer)\n\t\t{\n\t\t\tif (!layer.Style.HasValue)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException($\"Expected '{layer.Name}' to have a style, but didn't find one.\");\n\t\t\t}\n\t\t\tImage = image;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchGroup.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchGroup : SketchLayer\n\t{\n\t\tpublic SketchGroup(SketchLayer parentLayer) : base(parentLayer)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchLayer.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchLayer : SketchEntity\n\t{\n\t\tpublic SketchLayer Parent { get; set; } //Can't be readonly due to circular dependency :(\n\t\tpublic readonly SketchRect Frame;\n\t\tpublic readonly string Name;\n\t\tpublic readonly bool NameIsFixed;\n\t\tpublic readonly SketchAlignment Alignment;\n\t\tpublic readonly double Rotation;\n\t\tpublic readonly bool IsFlippedVertical;\n\t\tpublic readonly bool IsFlippedHorizontal;\n\t\tpublic readonly IReadOnlyList<SketchLayer> Layers;\n\t\tpublic readonly Optional<SketchStyle> Style;\n\n\t\tpublic SketchLayer(SketchLayer layer)\n\t\t\t: this(layer.Id,\n\t\t\t\tlayer.Parent,\n\t\t\t\tlayer.Frame,\n\t\t\t\tlayer.Name,\n\t\t\t\tlayer.NameIsFixed,\n\t\t\t\tlayer.Alignment,\n\t\t\t\tlayer.Rotation,\n\t\t\t\tlayer.IsFlippedVertical,\n\t\t\t\tlayer.IsFlippedHorizontal,\n\t\t\t\tlayer.Style,\n\t\t\t\tlayer.Layers)\n\t\t{\n\t\t}\n\n\t\t// possibly temp while refactoring\n\t\tpublic SketchLayer(SketchLayer layer, IReadOnlyList<SketchLayer> children)\n\t\t\t: this(layer.Id,\n\t\t\t\tlayer.Parent,\n\t\t\t\tlayer.Frame,\n\t\t\t\tlayer.Name,\n\t\t\t\tlayer.NameIsFixed,\n\t\t\t\tlayer.Alignment,\n\t\t\t\tlayer.Rotation,\n\t\t\t\tlayer.IsFlippedVertical,\n\t\t\t\tlayer.IsFlippedHorizontal,\n\t\t\t\tlayer.Style,\n\t\t\t\tchildren)\n\t\t{\n\t\t}\n\n\t\tpublic SketchLayer(\n\t\t\tGuid id,\n\t\t\tSketchLayer parent,\n\t\t\tSketchRect frame,\n\t\t\tstring name,\n\t\t\tbool nameIsFixed,\n\t\t\tSketchAlignment alignment,\n\t\t\tdouble rotation,\n\t\t\tbool flippedVertical,\n\t\t\tbool flippedHorizontal,\n\t\t\tOptional<SketchStyle> style,\n\t\t\tIReadOnlyList<SketchLayer> children) : base(id)\n\t\t{\n\t\t\tParent = parent;\n\t\t\tFrame = frame;\n\t\t\tName = name;\n\t\t\tNameIsFixed = nameIsFixed;\n\t\t\tAlignment = alignment;\n\t\t\tRotation = rotation;\n\t\t\tIsFlippedVertical = flippedVertical;\n\t\t\tIsFlippedHorizontal = flippedHorizontal;\n\t\t\tStyle = style;\n\t\t\tLayers = children;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchRectangle.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchRectangle : SketchShapePath\n\t{\n\t\tpublic SketchRectangle(SketchLayer layer, SketchPath path, SketchBooleanOperation operation)\n\t\t\t: base(layer, path, operation)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchShapeGroup.cs",
    "content": "﻿using SketchConverter.SketchParser;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchShapeGroup : SketchLayer\n\t{\n\t\tpublic readonly bool HasClippingMask;\n\t\tpublic new SketchStyle Style { get { return ((SketchLayer)this).Style.Value; } }\n\n\t\tpublic SketchShapeGroup(\n\t\t\tSketchLayer parentLayer,\n\t\t\tbool hasClippingMask\n\t\t\t): base(parentLayer)\n\t\t{\n\t\t\tif (!parentLayer.Style.HasValue)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException($\"Expected '{parentLayer.Name}' to have a style, but didn't find one.\");\n\t\t\t}\n\t\t\tHasClippingMask = hasClippingMask;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchShapePath.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic enum SketchBooleanOperation\n\t{\n\t\tNoOperation = -1,\n\t\tUnion = 0,\n\t\tSubtraction = 1,\n\t\tIntersection = 2,\n\t\tDifference = 3\n\t}\n\n\tpublic class SketchShapePath : SketchLayer\n\t{\n\t\tpublic readonly SketchPath Path;\n\t\tpublic readonly SketchBooleanOperation BooleanOperation;\n\n\t\tpublic SketchShapePath(\n\t\t\tSketchLayer layer,\n\t\t\tSketchPath path,\n\t\t\tSketchBooleanOperation operation)\n\t\t\t: base(layer)\n\t\t{\n\t\t\tPath = path;\n\t\t\tBooleanOperation = operation;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchSymbolInstance.cs",
    "content": "﻿using System;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchSymbolInstance : SketchLayer\n\t{\n\t\tpublic readonly Guid SymbolId;\n\n\t\tpublic SketchSymbolInstance(SketchLayer layer, Guid symbolId) :base(layer)\n\t\t{\n\t\t\tSymbolId = symbolId;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchSymbolMaster.cs",
    "content": "using System;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchSymbolMaster : SketchLayer\n\t{\n\t\tpublic readonly Guid SymbolId;\n\t\tpublic SketchSymbolMaster(SketchLayer parentLayer, Guid symbolId) : base(parentLayer)\n\t\t{\n\t\t\tSymbolId = symbolId;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/Layers/SketchText.cs",
    "content": "﻿using SketchConverter.SketchParser;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchText : SketchLayer\n\t{\n\t\tpublic readonly SketchAttributedString AttributedString;\n\t\tpublic readonly SketchTextBoxAlignment TextBoxAlignment;\n\t\tpublic new SketchStyle Style { get { return ((SketchLayer)this).Style.Value; } }\n\n\t\tpublic SketchText(SketchLayer layer,\n\t\t\tSketchAttributedString attributedString,\n\t\t\tSketchTextBoxAlignment textBoxAlignment) : base(layer)\n\t\t{\n\t\t\tif (!layer.Style.HasValue)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException($\"Expected '{layer.Name}' to have a style, but didn't find one.\");\n\t\t\t}\n\t\t\tAttributedString = attributedString;\n\t\t\tTextBoxAlignment = textBoxAlignment;\n\t\t}\n\t}\n\n\tpublic enum SketchTextBoxAlignment\n\t{\n\t\tAuto,\n\t\tFixed\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/SketchDocument.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchDocument : SketchEntity\n\t{\n\t\tpublic readonly IReadOnlyList<SketchPage> Pages;\n\n\t\tpublic SketchDocument(Guid id, IReadOnlyList<SketchPage> pages) : base(id)\n\t\t{\n\t\t\tPages = pages;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/SketchEntity.cs",
    "content": "using System;\n\nnamespace SketchConverter.SketchModel\n\n{\n\tpublic class SketchEntity\n\t{\n\t\tpublic readonly Guid Id;\n\n\t\tpublic SketchEntity(Guid id)\n\t\t{\n\t\t\tId = id;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Entities/SketchPage.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchPage : SketchEntity\n\t{\n\t\tpublic readonly SketchRect Frame;\n\t\tpublic readonly string Name;\n\t\tpublic readonly IReadOnlyList<SketchLayer> Layers;\n\n\t\tpublic SketchPage(Guid id, SketchRect frame, string name, IReadOnlyList<SketchLayer> layers)\n\t\t\t: base(id)\n\t\t{\n\t\t\tFrame = frame;\n\t\t\tName = name;\n\t\t\tLayers = layers;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/ISketchBrush.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\t//\n\tpublic interface ISketchBrush { }\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchAlignment.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic struct SketchAxisAlignment\n\t{\n\t\t// TODO: Some of these options are mutually exclusive, that is,\n\t\t// only *one* of AlignStart and AlignEnd can be active if FixSize == true.\n\t\t// Should somehow make this state uninstantiable.\n\n\t\tpublic readonly bool AlignStart;\n\t\tpublic readonly bool AlignEnd;\n\t\tpublic readonly bool FixSize;\n\n\t\tpublic SketchAxisAlignment(bool alignStart, bool alignEnd, bool fixSize)\n\t\t{\n\t\t\tAlignStart = alignStart;\n\t\t\tAlignEnd = alignEnd;\n\t\t\tFixSize = fixSize;\n\t\t}\n\t}\n\n\tpublic struct SketchAlignment\n\t{\n\t\tpublic readonly SketchAxisAlignment Horizontal;\n\t\tpublic readonly SketchAxisAlignment Vertical;\n\n\t\tpublic SketchAlignment(SketchAxisAlignment horizontal, SketchAxisAlignment vertical)\n\t\t{\n\t\t\tHorizontal = horizontal;\n\t\t\tVertical = vertical;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchAttributedString.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchAttributedString\n\t{\n\t\tpublic readonly string Contents;\n\t\tpublic readonly IReadOnlyList<SketchStringAttribute> Attributes;\n\n\t\tpublic SketchAttributedString(string contents, IReadOnlyList<SketchStringAttribute> attributes)\n\t\t{\n\t\t\tContents = contents;\n\t\t\tAttributes = attributes;\n\t\t}\n\n\t}\n\n\tpublic enum SketchTextAlignment\n\t{\n\t\tLeft,\n\t\tRight,\n\t\tCenter,\n\t\tJustified,\n\t\tNatural\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchBlur.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n    public class SketchBlur\n    {\n        public readonly SketchPoint Center;\n        public readonly int MotionAngle;\n        public readonly double Radius;\n        public readonly SketchBlurType BlurType;\n\n        public SketchBlur(SketchPoint center, int motionAngle, double radius, SketchBlurType blurType)\n        {\n            Center = center;\n            MotionAngle = motionAngle;\n            Radius = radius;\n            BlurType = blurType;\n        }\n\n        public enum SketchBlurType\n        {\n            Gaussian = 0,\n            Motion = 1,\n            Zoom = 2,\n            Background = 3\n        }\n    }\n}"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchBorder.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchBorder\n\t{\n\t\tpublic readonly bool IsEnabled;\n\t\tpublic readonly ISketchBrush Brush;\n\t\tpublic readonly double Thickness;\n\t\tpublic readonly SketchBorderPosition Position;\n\n\t\tpublic SketchBorder(bool isEnabled, ISketchBrush brush, double thickness, SketchBorderPosition position)\n\t\t{\n\t\t\tIsEnabled = isEnabled;\n\t\t\tBrush = brush;\n\t\t\tThickness = thickness;\n\t\t\tPosition = position;\n\t\t}\n\t}\n\n\tpublic enum SketchBorderPosition\n\t{\n\t\tCenter,\n\t\tInside,\n\t\tOutside\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchColor.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchColor\n\t{\n\t\tpublic readonly double Red;\n\t\tpublic readonly double Green;\n\t\tpublic readonly double Blue;\n\t\tpublic readonly double Alpha;\n\n\t\tpublic SketchColor(double red, double green, double blue, double alpha)\n\t\t{\n\t\t\tRed = red;\n\t\t\tGreen = green;\n\t\t\tBlue = blue;\n\t\t\tAlpha = alpha;\n\t\t}\n\n\t\tpublic SketchColor()\n\t\t\t: this(1,1,1,1)\n\t\t{\n\t\t}\n\n\t\tpublic static SketchColor Black = new SketchColor(0, 0, 0, 1);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchCurvePoint.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n    public class SketchCurvePoint\n    {\n        public readonly SketchPoint Point;\n        public readonly SketchPoint CurveFrom;\n        public readonly SketchPoint CurveTo;\n        public readonly double CornerRadius;\n        public readonly CurveMode Mode;\n        public readonly bool HasCurveFrom;\n        public readonly bool HasCurveTo;\n\n\n        //[JsonConverter(typeof(StringEnumConverter))] can we use this?\n        public enum CurveMode\n        {\n            Line = 1,\n            Curve = 2,\n            Asymmetric = 3,\n            Disconnected = 4\n        }\n\n        public SketchCurvePoint(\n            SketchPoint point,\n            SketchPoint curveFrom,\n            SketchPoint curveTo,\n            double cornerRadius,\n            CurveMode mode,\n            bool hasCurveFrom,\n            bool hasCurveTo)\n        {\n            Point = point;\n            CurveFrom = curveFrom;\n            CurveTo = curveTo;\n            CornerRadius = cornerRadius;\n            Mode = mode;\n            HasCurveFrom = hasCurveFrom;\n            HasCurveTo = hasCurveTo;\n        }\n    }\n}"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchFill.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchFill\n\t{\n\t\tpublic readonly bool IsEnabled;\n\t\tpublic readonly ISketchBrush Brush;\n\n\t\tpublic SketchFill(bool isEnabled, ISketchBrush brush)\n\t\t{\n\t\t\tIsEnabled = isEnabled;\n\t\t\tBrush = brush;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchGradientStop.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchGradientStop\n\t{\n\t\tpublic readonly SketchColor Color;\n\t\tpublic readonly double Position;\n\n\t\tpublic SketchGradientStop(SketchColor color, double position)\n\t\t{\n\t\t\tColor = color;\n\t\t\tPosition = position;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchImage.cs",
    "content": "﻿using System.IO;\n\nnamespace SketchConverter.SketchModel\n{\n    public class SketchImage\n    {\n        public string Path { get; }\n        readonly byte[] _data;\n\n        public SketchImage(string path, byte[] data)\n        {\n            Path = path;\n            _data = data;\n        }\n\n        public SketchImage(string path, Stream stream)\n        {\n            Path = path;\n\n            using (var memoryStream = new MemoryStream())\n            {\n                stream.CopyTo(memoryStream);\n                _data = memoryStream.ToArray();\n            }\n        }\n\n        public Stream Open() => new MemoryStream(_data);\n    }\n}"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchLinearGradientBrush.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchLinearGradientBrush : ISketchBrush\n\t{\n\t\tpublic readonly SketchPoint From;\n\t\tpublic readonly SketchPoint To;\n\n\t\tpublic readonly IReadOnlyList<SketchGradientStop> Stops;\n\n\t\tpublic SketchLinearGradientBrush(SketchPoint fromPoint, SketchPoint toPoint, IReadOnlyList<SketchGradientStop> stops)\n\t\t{\n\t\t\tFrom = fromPoint;\n\t\t\tTo = toPoint;\n\t\t\tStops = stops;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchPath.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace SketchConverter.SketchModel\n{\n    public class SketchPath\n    {\n        public readonly IList<SketchCurvePoint> Points;\n        public readonly bool IsClosed;\n\n        public SketchPath(IList<SketchCurvePoint> points,\n            bool isClosed)\n        {\n            Points = points;\n            IsClosed = isClosed;\n        }\n    }\n}"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchPoint.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic struct SketchPoint\n\t{\n\t\tpublic readonly double X;\n\t\tpublic readonly double Y;\n\n\t\tpublic SketchPoint(double x, double y)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t}\n\n\t\tpublic static SketchPoint operator /(SketchPoint a, SketchPoint b)\n\t\t\t=> new SketchPoint(a.X / b.X, a.Y / b.Y);\n\n\t\tpublic static SketchPoint operator *(SketchPoint a, SketchPoint b)\n\t\t\t=> new SketchPoint(a.X * b.X, a.Y * b.Y);\n\n\t\tpublic static SketchPoint operator +(SketchPoint a, SketchPoint b)\n\t\t\t=> new SketchPoint(a.X + b.X, a.Y + b.Y);\n\n\t\tpublic static SketchPoint operator -(SketchPoint a, SketchPoint b)\n\t\t\t=> new SketchPoint(a.X - b.X, a.Y - b.Y);\n\n\t\tpublic static SketchPoint operator *(SketchPoint point, double scale)\n\t\t\t=> new SketchPoint(point.X * scale, point.Y * scale);\n\n\t\tpublic static SketchPoint operator /(SketchPoint point, double scale)\n\t\t\t=> new SketchPoint(point.X / scale, point.Y / scale);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchRect.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchRect\n\t{\n\t\tpublic readonly double X;\n\t\tpublic readonly double Y;\n\n\t\tpublic readonly double Width;\n\t\tpublic readonly double Height;\n\n\t\tpublic readonly bool ConstrainProportions;\n\n\t\tpublic SketchRect(double x, double y, double width, double height, bool constrainProportions)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t\tWidth = width;\n\t\t\tHeight = height;\n\t\t\tConstrainProportions = constrainProportions;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchShadow.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchShadow\n\t{\n\t\tpublic readonly bool IsEnabled;\n\t\tpublic readonly SketchColor Color;\n\t\tpublic readonly SketchPoint Offset;\n\t\tpublic readonly double BlurRadius;\n\t\tpublic readonly double Spread;\n\n\t\tpublic SketchShadow(bool isEnabled, SketchColor color, SketchPoint offset, double blurRadius, double spread)\n\t\t{\n\t\t\tIsEnabled = isEnabled;\n\t\t\tColor = color;\n\t\t\tOffset = offset;\n\t\t\tBlurRadius = blurRadius;\n\t\t\tSpread = spread;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchSolidColorBrush.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n\tpublic class SketchSolidColorBrush : ISketchBrush\n\t{\n\t\tpublic readonly SketchColor Color;\n\n\t\tpublic SketchSolidColorBrush(SketchColor color)\n\t\t{\n\t\t\tColor = color;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchStringAttribute.cs",
    "content": "﻿namespace SketchConverter.SketchModel\n{\n    public class SketchStringAttribute\n    {\n        public readonly SketchColor Color;\n        public readonly double FontSize;\n        public readonly SketchTextAlignment Alignment;\n\n        public SketchStringAttribute(SketchColor color, double fontSize, SketchTextAlignment alignment)\n        {\n            Color = color;\n            FontSize = fontSize;\n            Alignment = alignment;\n        }\n    }\n}"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchModel/Types/SketchStyle.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace SketchConverter.SketchModel\n{\n\tpublic class SketchStyle\n\t{\n\t\tpublic readonly IReadOnlyList<SketchFill> Fills;\n\t\tpublic readonly IReadOnlyList<SketchBorder> Borders;\n\t\tpublic readonly IReadOnlyList<SketchShadow> Shadows;\n\t\tpublic readonly IReadOnlyList<SketchShadow> InnerShadows;\n\t\tpublic readonly Optional<SketchBlur> Blur;\n\t\tpublic readonly Optional<double> Opacity;\n\n\t\tpublic SketchStyle(\n\t\t\tIReadOnlyList<SketchFill> fills,\n\t\t\tIReadOnlyList<SketchBorder> borders,\n\t\t\tIReadOnlyList<SketchShadow> shadows,\n\t\t\tIReadOnlyList<SketchShadow> innerShadows,\n\t\t\tOptional<SketchBlur> blur,\n\t\t\tOptional<double> opacity)\n\t\t{\n\t\t\tFills = fills;\n\t\t\tBorders = borders;\n\t\t\tShadows = shadows;\n\t\t\tInnerShadows = innerShadows;\n\t\t\tBlur = blur;\n\t\t\tOpacity = opacity;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchParser/AttributedStringParser.cs",
    "content": "﻿using System;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\nusing Claunia.PropertyList;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverter.SketchParser\n{\n\tpublic class AttributedStringParser\n\t{\n\t\tpublic AttributedStringParser(ILogger log)\n\t\t{\n\t\t\t_log = log;\n\t\t}\n\n\t\tNSKeyedArchive _archive;\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic SketchAttributedString Parse(string base64Plist)\n\t\t{\n\t\t\tvar binaryPlist = Convert.FromBase64String(base64Plist);\n\t\t\tvar archiveRoot = PropertyListParser.Parse(binaryPlist) as NSDictionary;\n\t\t\t_archive = new NSKeyedArchive(archiveRoot);\n\n\t\t\tvar root = _archive.Parse() as NSDictionary;\n\n\t\t\t// We can have more than one attribute for a text object in Sketch\n\t\t\tvar attributes = root.Get(\"NSAttributes\") ?? new NSArray(0);\n\n\t\t\tvar attributeDicts = attributes as NSArray;\n\t\t\tif (attributeDicts == null)\n\t\t\t{\n\t\t\t\tvar singleAttribute = attributes as NSDictionary;\n\n\t\t\t\tattributeDicts =\n\t\t\t\t\t(singleAttribute == null)\n\t\t\t\t\t? new NSArray(0)\n\t\t\t\t\t: new NSArray(singleAttribute);\n\t\t\t}\n\n\t\t\tvar content = root.GetAs<NSString>(\"NSString\").Content;\n\t\t\tvar sketchStringAttributes = attributeDicts\n\t\t\t\t.Cast<NSDictionary>()\n\t\t\t\t.Select(ParseAttribute)\n\t\t\t\t.ToList();\n\t\t\treturn new SketchAttributedString\n\t\t\t(\n\t\t\t\tcontent,\n\t\t\t\tsketchStringAttributes\n\t\t\t);\n\t\t}\n\n\t\tSketchStringAttribute ParseAttribute(NSDictionary attributeDict)\n\t\t{\n\t\t\tvar fontDescriptorAttributes = attributeDict\n\t\t\t\t.GetAs<NSDictionary>(\"MSAttributedStringFontAttribute\")\n\t\t\t\t.GetAs<NSDictionary>(\"NSFontDescriptorAttributes\");\n\n\t\t\tvar alignment = SketchTextAlignment.Left;\n\n\t\t\tif (attributeDict.ContainsKey(\"NSParagraphStyle\"))\n\t\t\t{\n\t\t\t\tvar paragraphStyle = attributeDict.GetAs<NSDictionary>(\"NSParagraphStyle\");\n\t\t\t\tif (paragraphStyle.ContainsKey(\"NSAlignment\"))\n\t\t\t\t{\n\t\t\t\t\talignment = ParseAlignment(paragraphStyle.GetAs<NSNumber>(\"NSAlignment\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Looks like the color format of text objects in Sketch has changed between version 91 and 93\n\t\t\t// I've only found MSAttributedStringColorDictionaryAttribute in version 93. 2018-01-05 anette\n\t\t\tvar sketchColor = SketchColor.Black;\n\t\t\tif (attributeDict.ContainsKey(\"NSColor\"))\n\t\t\t{\n\t\t\t\tvar nsDictionaryColor = attributeDict.GetAs<NSDictionary>(\"NSColor\");\n\t\t\t\tsketchColor = ParseColor(nsDictionaryColor);\n\t\t\t}\n\t\t\telse if (attributeDict.ContainsKey(\"MSAttributedStringColorDictionaryAttribute\"))\n\t\t\t{\n\t\t\t\tvar components = attributeDict.GetAs<NSDictionary>(\"MSAttributedStringColorDictionaryAttribute\");\n\t\t\t\tsketchColor = new SketchColor(\n\t\t\t\t\tdouble.Parse(components[\"red\"].ToString()),\n\t\t\t\t\tdouble.Parse(components[\"green\"].ToString()),\n\t\t\t\t\tdouble.Parse(components[\"blue\"].ToString()),\n\t\t\t\t\tcomponents.ContainsKey(\"alpha\") ? double.Parse(components[\"alpha\"].ToString()) : 1.0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_log.Warning(\"Could not find color property for text object. Default to black.\");\n\t\t\t}\n\t\t\tvar fontSize = (double) fontDescriptorAttributes.GetAs<NSNumber>(\"NSFontSizeAttribute\");\n\t\t\treturn new SketchStringAttribute\n\t\t\t(\n\t\t\t\tsketchColor,\n\t\t\t\tfontSize,\n\t\t\t\talignment\n\t\t\t);\n\t\t}\n\n\t\tSketchTextAlignment ParseAlignment(NSNumber code)\n\t\t{\n\t\t\t// Note: These are only correct on macOS, because of course they use slightly different values on iOS...\n\t\t\tswitch ((int) code)\n\t\t\t{\n\t\t\t\tcase 0: return SketchTextAlignment.Left;\n\t\t\t\tcase 1: return SketchTextAlignment.Right;\n\t\t\t\tcase 2: return SketchTextAlignment.Center;\n\t\t\t\tcase 3: return SketchTextAlignment.Justified;\n\t\t\t\tcase 4: return SketchTextAlignment.Natural;\n\t\t\t\tdefault: throw new SketchParserException(\"Invalid text alignment\");\n\t\t\t}\n\t\t}\n\n\t\tSketchColor ParseColor(NSDictionary color)\n\t\t{\n\t\t\tvar rgbStringData = color[\"NSRGB\"] as NSData;\n\t\t\tvar rgbString = Encoding.ASCII.GetString(rgbStringData.Bytes).TrimEnd('\\0');\n\n\t\t\tvar components = rgbString\n\t\t\t\t.Split(' ', '\\t')\n\t\t\t\t.Where(x => !string.IsNullOrWhiteSpace(x))\n\t\t\t\t.Select(ParseNumber)\n\t\t\t\t.ToArray();\n\n\t\t\treturn new SketchColor\n\t\t\t(\n\t\t\t\tcomponents[0],\n\t\t\t\tcomponents[1],\n\t\t\t\tcomponents[2],\n\t\t\t\t(components.Length == 4)\n\t\t\t\t\t? components[3]\n\t\t\t\t\t: 1.0\n\t\t\t);\n\t\t}\n\n\t\tstatic double ParseNumber(string number) =>\n\t\t\tdouble.Parse(number, CultureInfo.InvariantCulture);\n\t}\n\n\tpublic class NSKeyedArchiveException : Exception\n\t{\n\t\tpublic NSKeyedArchiveException(string message) : base(message)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class NSKeyedArchive\n\t{\n\t\tNSDictionary _archive;\n\n\t\tNSArray _objects;\n\t\tNSArray Objects => _objects ?? (_objects = _archive.GetAs<NSArray>(\"$objects\"));\n\n\t\tpublic NSObject RootObject => ResolveObject(_archive.GetAs<NSDictionary>(\"$top\")[\"root\"]);\n\n\t\tpublic NSKeyedArchive(NSDictionary archive)\n\t\t{\n\t\t\t_archive = archive;\n\n\t\t\tvar archiverName = (string) _archive.GetAs<NSString>(\"$archiver\");\n\t\t\tif (archiverName != \"NSKeyedArchiver\")\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Invalid NSKeyedArchiver dictionary\", nameof(archive));\n\t\t\t}\n\n\t\t\tvar version = _archive.GetAs<NSNumber>(\"$version\");\n\t\t\tif (version.ToInt() != 100000)\n\t\t\t{\n\t\t\t\tthrow new ArgumentException(\"Unsupported NSKeyedArchiver version\", nameof(archive));\n\t\t\t}\n\t\t}\n\n\t\tpublic NSObject Parse() => ResolveObject(RootObject);\n\n\t\tNSObject ResolveObject(NSObject obj)\n\t\t{\n\t\t\tvar uid = obj as UID;\n\t\t\tif (uid != null)\n\t\t\t{\n\t\t\t\treturn ResolveObject(ObjectById(uid.ToInt32()));\n\t\t\t}\n\n\t\t\tvar dict = obj as NSDictionary;\n\t\t\tif (dict != null)\n\t\t\t{\n\t\t\t\tforeach (var key in dict.Keys.ToArray())\n\t\t\t\t{\n\t\t\t\t\tdict[key] = ResolveObject(dict[key]);\n\t\t\t\t}\n\n\t\t\t\tif (dict.ContainsKey(\"CF$UID\"))\n\t\t\t\t{\n\t\t\t\t\treturn ResolveObjectReference(dict);\n\t\t\t\t}\n\n\t\t\t\tvar classInfo = dict.Get(\"$class\") as NSDictionary;\n\t\t\t\tif (classInfo != null && classInfo.ContainsKey(\"$classes\"))\n\t\t\t\t{\n\t\t\t\t\treturn ResolveObjectWithClassInfo(dict, classInfo);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar array = obj as NSArray;\n\t\t\tif (array != null)\n\t\t\t{\n\t\t\t\tfor (var i = 0; i < array.Count; i++)\n\t\t\t\t{\n\t\t\t\t\tarray[i] = ResolveObject(array[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn obj;\n\t\t}\n\n\t\tpublic NSObject ResolveObjectWithClassInfo(NSDictionary dict, NSDictionary classInfo)\n\t\t{\n\t\t\tvar classes = classInfo.GetAs<NSArray>(\"$classes\");\n\n\t\t\tif (classes.Contains(\"NSDictionary\")) return ParseArchivedDictionary(dict);\n\t\t\tif (classes.Contains(\"NSArray\")) return ParseArchivedArray(dict);\n\t\t\tif (classes.Contains(\"NSString\")) return ParseArchivedString(dict);\n\n\t\t\treturn dict;\n\t\t}\n\n\t\tpublic NSObject ResolveObjectReference(NSDictionary reference)\n\t\t{\n\t\t\treturn ResolveObject(ObjectById(ParseObjectReferenceId(reference)));\n\t\t}\n\n\t\tpublic int ParseObjectReferenceId(NSDictionary reference)\n\t\t{\n\t\t\treturn (int)reference.GetAs<NSNumber>(\"CF$UID\");\n\t\t}\n\n\t\tpublic NSDictionary ParseClassInfo(NSDictionary @object)\n\t\t{\n\t\t\treturn ResolveObject(@object[\"$class\"]) as NSDictionary;\n\t\t}\n\n\t\tpublic NSArray ParseArchivedArray(NSDictionary archivedArray)\n\t\t{\n\t\t\tvar objects = archivedArray.GetAs<NSArray>(\"NS.objects\");\n\n\t\t\tvar resolvedArray = new NSArray();\n\n\t\t\tforeach(var @object in objects)\n\t\t\t{\n\t\t\t\tresolvedArray.Add(ResolveObject(@object));\n\t\t\t}\n\n\t\t\treturn resolvedArray;\n\t\t}\n\n\t\tpublic NSString ParseArchivedString(NSDictionary archivedString)\n\t\t{\n\t\t\treturn archivedString.GetAs<NSString>(\"NS.string\");\n\t\t}\n\n\t\tpublic NSDictionary ParseArchivedDictionary(NSDictionary archivedDictionary)\n\t\t{\n\t\t\tvar keys = archivedDictionary.GetAs<NSArray>(\"NS.keys\");\n\t\t\tvar objects = archivedDictionary.GetAs<NSArray>(\"NS.objects\");\n\n\t\t\tif (keys == null || objects == null)\n\t\t\t\tthrow new NSKeyedArchiveException(\"Invalid archived NSDictionary\");\n\n\t\t\tif(keys.Count != objects.Count)\n\t\t\t\tthrow new NSKeyedArchiveException(\"NSDictionary: Different number of keys and values\");\n\n\t\t\tvar dict = new NSDictionary();\n\n\t\t\tfor(var i = 0; i < keys.Count; ++i)\n\t\t\t{\n\t\t\t\tvar stringKey = ResolveObject(keys[i]) as NSString;\n\t\t\t\tif (stringKey == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new NSKeyedArchiveException(\"Non-string keys in archived NSDictionaries are not supported\");\n\t\t\t\t}\n\n\t\t\t\tvar value = ResolveObject(objects[i]);\n\n\t\t\t\tdict.Add((string)stringKey, value);\n\t\t\t}\n\n\t\t\treturn dict;\n\t\t}\n\n\t\tT ObjectByIdAs<T>(int id) where T : NSObject => Objects.GetAs<T>(id);\n\n\t\tNSObject ObjectById(int id) => ObjectByIdAs<NSObject>(id);\n\t}\n\n\tstatic class NSArrayExtensions\n\t{\n\t\tpublic static T GetAs<T>(this NSArray array, int index)\n\t\t\twhere T : NSObject\n\t\t{\n\t\t\treturn array[index] as T;\n\t\t}\n\t}\n\n\tstatic class NSDictionaryExtensions\n\t{\n\t\tpublic static T GetAs<T>(this NSDictionary dict, string key)\n\t\t\twhere T : NSObject\n\t\t{\n\t\t\treturn dict[key] as T;\n\t\t}\n\t}\n\n\tstatic class UIDExtensions\n\t{\n\t\tpublic static int ToInt32(this UID uid)\n\t\t{\n\t\t\tif (uid == null)\n\t\t\t\treturn 0;\n\n\t\t\tif (uid.Bytes.Length == 1)\n\t\t\t{\n\t\t\t\treturn uid.Bytes[0];\n\t\t\t}\n\n\t\t\tvar bytes = uid.Bytes.Reverse().ToArray();\n\n\t\t\treturn bytes.TryConvert(x => (int)BitConverter.ToInt16(x, 0))\n\t\t\t\t   ?? bytes.TryConvert(x => BitConverter.ToInt32(x, 0))\n\t\t\t\t   ?? 0;\n\t\t}\n\n\t\tstatic T? TryConvert<T>(this byte[] bytes, Func<byte[], T> convertFn)\n\t\t\twhere T : struct\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn convertFn(bytes);\n\t\t\t}\n\t\t\tcatch\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchParser/Exceptions.cs",
    "content": "﻿using System;\n\nnamespace SketchConverter.SketchParser\n{\n\tpublic class SketchParserException : Exception\n\t{\n\t\tpublic SketchParserException(string message, Exception innerException = null) : base(message, innerException)\n\t\t{\n\t\t}\n\t}\n\n\tpublic class InvalidAttributeException : Exception\n\t{\n\t\tpublic string Key { get; }\n\t\tpublic string ExpectedValue { get; }\n\t\tpublic string ActualValue { get; }\n\n\t\tpublic InvalidAttributeException(string key, string expectedValue, string actualValue)\n\t\t\t: base($\"Expected value for '{key}' to equal '{expectedValue}', got '{actualValue}\")\n\t\t{\n\t\t\tKey = key;\n\t\t\tExpectedValue = expectedValue;\n\t\t\tActualValue = actualValue;\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchParser/ISketchArchive.cs",
    "content": "﻿using System;\nusing System.IO;\n\nnamespace SketchConverter.SketchParser\n{\n\tpublic interface ISketchArchive : IDisposable\n\t{\n\t\tStream OpenFile(string path);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchParser/SketchArchive.cs",
    "content": "using System;\nusing System.IO;\nusing ICSharpCode.SharpZipLib.Zip;\n\nnamespace SketchConverter.SketchParser\n{\n\tpublic class SketchArchive : ISketchArchive\n\t{\n\t\tZipFile _zip;\n\n\t\tpublic SketchArchive(Stream sketchFileStream)\n\t\t{\n\t\t\t_zip = new ZipFile(sketchFileStream);\n\t\t}\n\n\t\tpublic SketchArchive()\n\t\t{\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_zip?.Close();\n\t\t}\n\n\t\tpublic Stream OpenFile(string path)\n\t\t{\n\t\t\tvar entryIndex = _zip.FindEntry(path, true);\n\t\t\tif (entryIndex < 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn _zip.GetInputStream(entryIndex);\n\t\t}\n\n\t\tpublic void Load(FileStream stream)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_zip = new ZipFile(stream);\n\t\t\t}\n\t\t\tcatch (ZipException zipException)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException(\"Can't open sketch file. This file might be on an old format. <ADD SOME HELPFUL HINT?>: \" + zipException.Message, zipException);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException(\"Can't open sketch file: \" + e.Message, e);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchParser/SketchParser.cs",
    "content": "using System.Threading.Tasks;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverter.SketchParser\n{\n\tpublic interface ISketchParser\n\t{\n\t\tSketchDocument Parse(ISketchArchive stream);\n\t}\n\n\tpublic class SketchParser : ISketchParser\n\t{\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic SketchParser(ILogger log)\n\t\t{\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic SketchDocument Parse(ISketchArchive stream)\n\t\t{\n\t\t\treturn ParseAsync(stream).Result;\n\t\t}\n\n\t\tprivate async Task<SketchDocument> ParseAsync(ISketchArchive stream)\n\t\t{\n\t\t\treturn await new SketchParserInternal(stream, _log).ParseDocumentAsync();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/SketchParser/SketchParserInternal.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json.Linq;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverter.SketchParser\n{\n\tinternal class SketchParserInternal\n\t{\n\t\tprivate readonly ISketchArchive _archive;\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic SketchParserInternal(ISketchArchive archive, ILogger log)\n\t\t{\n\t\t\t_archive = archive;\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic async Task<SketchDocument> ParseDocumentAsync()\n\t\t{\n\t\t\tvar documentJson = await ReadJsonFileAsync(\"document.json\").ConfigureAwait(false);\n\t\t\tExpectClass(\"document\", documentJson);\n\n\t\t\tvar pages = await Task.WhenAll(\n\t\t\t\tdocumentJson[\"pages\"].Cast<JObject>().Select(ParsePageFileReferenceAsync)).ConfigureAwait(false);\n\n\t\t\treturn new SketchDocument(ParseEntityId(documentJson), pages);\n\t\t}\n\n\t\tasync Task<JObject> ReadJsonFileAsync(string path)\n\t\t{\n\t\t\tusing (var jsonStream = _archive.OpenFile(path))\n\t\t\t{\n\t\t\t\treturn JObject.Parse(await jsonStream.ReadToStringAsync().ConfigureAwait(false));\n\t\t\t}\n\t\t}\n\n\t\tasync Task<SketchPage> ParsePageFileReferenceAsync(JObject reference)\n\t\t{\n\t\t\tExpectStringAttributeEquals(\"_ref_class\", \"MSImmutablePage\", reference);\n\n\t\t\tvar path = ParseFileReferencePath(reference) + \".json\";\n\t\t\treturn ParsePage(await ReadJsonFileAsync(path).ConfigureAwait(false));\n\t\t}\n\n\t\tstring ParseFileReferencePath(JObject reference)\n\t\t{\n\t\t\tExpectClass(\"MSJSONFileReference\", reference);\n\t\t\treturn (string)reference[\"_ref\"];\n\t\t}\n\n\t\tstatic readonly string[] ImageFileExtensions = {\"png\", \"jpg\", \"jpeg\"};\n\n\t\tSketchImage ParseImageFileReference(JObject reference)\n\t\t{\n\t\t\tvar imageName = ParseFileReferencePath(reference);\n\n\t\t\tforeach(var ext in ImageFileExtensions)\n\t\t\t{\n\t\t\t\tvar path = imageName + \".\" + ext;\n\t\t\t\tvar stream = _archive.OpenFile(path);\n\t\t\t\tif(stream == null)\n\t\t\t\t\tcontinue;\n\n\t\t\t\treturn new SketchImage(path, stream);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tSketchBitmap ParseBitmap(JObject bitmapJson)\n\t\t{\n\t\t\treturn new SketchBitmap(\n\t\t\t\tParseCommonLayerProperties(bitmapJson),\n\t\t\t\tParseImageFileReference((JObject) bitmapJson[\"image\"]));\n\t\t}\n\n\t\tstatic bool GetBit(byte bits, byte index)\n\t\t{\n\t\t\treturn ((bits >> index) & 1) == 1;\n\t\t}\n\n\t\tSketchAxisAlignment ParseAlignmentAxis(byte code)\n\t\t{\n\t\t\treturn new SketchAxisAlignment(GetBit(code, 2), GetBit(code, 0), GetBit(code, 1));\n\t\t}\n\n\t\tSketchAlignment ParseAlignment(JObject layer)\n\t\t{\n\t\t\tvar constraintCode = (uint)layer[\"resizingConstraint\"];\n\t\t\t// For whatever reason, flags in this constant are active when the corresponding bit is zero.\n\t\t\t// So we flip the bits and truncate to the maximum of 6 flags\n\t\t\tvar constraintFlags = (~constraintCode) & 0x3F;\n\n\t\t\treturn new SketchAlignment(\n\t\t\t\tParseAlignmentAxis((byte)constraintFlags),\n\t\t\t\tParseAlignmentAxis((byte)(constraintFlags >> 3))\n\t\t\t);\n\t\t}\n\n\t\tResult<SketchLayer> ParseLayer(JObject layerJson)\n\t\t{\n\t\t\tvar layerClass = (string)layerJson[\"_class\"];\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tswitch (layerClass)\n\t\t\t\t{\n\t\t\t\t\tcase \"rectangle\": return ParseRectangle(layerJson);\n\t\t\t\t\tcase \"shapeGroup\": return ParseShapeGroup(layerJson);\n\t\t\t\t\tcase \"artboard\": return ParseArtboard(layerJson);\n\t\t\t\t\tcase \"group\": return ParseGroup(layerJson);\n\t\t\t\t\tcase \"bitmap\": return ParseBitmap(layerJson);\n\t\t\t\t\tcase \"text\": return ParseText(layerJson);\n\n\t\t\t\t\tcase \"symbolMaster\": return ParseSymbolMaster(layerJson);\n\t\t\t\t\tcase \"symbolInstance\": return ParseSymbolInstance(layerJson);\n\n\t\t\t\t\t// star is a separate class, and has properties like radius. Do we want a SketchStar-class?\n\t\t\t\t\t// Do we need it?\n\t\t\t\t\tcase \"star\":\n\t\t\t\t\tcase \"triangle\":\n\t\t\t\t\tcase \"polygon\":\n\t\t\t\t\tcase \"oval\"\n\t\t\t\t\t: // oval stores it's control points as circle and the shape is determined by the bounding box, might have to handle this differently than path. Or calculate the path coordinates\n\t\t\t\t\tcase \"shapePath\": return ParseShapePath(layerJson, layerClass);\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvar warning = \"Skipping layer '\" + (string) layerJson[\"name\"] + \"' of unsupported type '\" + layerClass + \"'\";\n\t\t\t\t\t\t_log.Warning(warning);\n\t\t\t\t\t\treturn Result.Err(warning);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tvar name = (string) layerJson[\"name\"];\n\t\t\t\tvar displayName = (name != null) ? \"'\" + name + \"'\" : \"with unknown name\";\n\t\t\t\tvar error = \"Failed to parse layer \" + displayName + \", skipping it. The exception was :'\" + e.Message + \"'\";\n\t\t\t\t_log.Error(error);\n\t\t\t\treturn Result.Err(error);\n\t\t\t}\n\t\t}\n\n\t\tprivate SketchLayer ParseShapePath(JObject layerJson, string layerClass)\n\t\t{\n\t\t\t// We will parse multiple classes as shape path\n\t\t\t//ExpectClass(\"shapePath\", layerJson);\n\t\t\treturn new SketchShapePath(\n\t\t\t\tParseCommonLayerProperties(layerJson),\n\t\t\t\tParsePath((JObject)layerJson[\"path\"]),\n\t\t\t\tParseBooleanOperation(layerJson));\n\t\t}\n\n\t\tprivate SketchBooleanOperation ParseBooleanOperation(JObject layerJson)\n\t\t{\n\t\t\tvar operation = (int) layerJson[\"booleanOperation\"];\n\t\t\tswitch (operation)\n\t\t\t{\n\t\t\t\tcase -1:\n\t\t\t\t\treturn SketchBooleanOperation.NoOperation;\n\t\t\t\tcase 0:\n\t\t\t\t\treturn SketchBooleanOperation.Union;\n\t\t\t\tcase 1:\n\t\t\t\t\treturn SketchBooleanOperation.Subtraction;\n\t\t\t\tcase 2:\n\t\t\t\t\treturn SketchBooleanOperation.Intersection;\n\t\t\t\tcase 3:\n\t\t\t\t\treturn SketchBooleanOperation.Difference;\n\t\t\t\tdefault:\n\t\t\t\t\t_log.Error($\"Parser: {operation} is not a valid boolean operation in Sketch. Falling back to no operation\");\n\t\t\t\t\treturn SketchBooleanOperation.NoOperation;\n\t\t\t}\n\t\t}\n\n\t\tprivate SketchPath ParsePath(JObject path)\n\t\t{\n\t\t\tvar isClosed = (bool) path[\"isClosed\"];\n\t\t\tvar pointsJson = (JArray) path[\"points\"];\n\t\t\tvar points = pointsJson.Cast<JObject>().Select(ParseCurvePoint);\n\n\t\t\treturn new SketchPath(points.ToList(), isClosed);\n\t\t}\n\n\t\tprivate SketchCurvePoint ParseCurvePoint(JObject curvePointJson)\n\t\t{\n\t\t\tExpectClass(\"curvePoint\", curvePointJson);\n\n\t\t\tvar hasCurveFrom = (bool) curvePointJson[\"hasCurveFrom\"];\n\t\t\tvar hasCurveTo = (bool) curvePointJson[\"hasCurveTo\"];\n\n\t\t\tvar mode = ParseCurvePointMode(curvePointJson);\n\n\t\t\tvar point = ParsePoint((string) curvePointJson[\"point\"]);\n\t\t\tvar curveFrom = hasCurveFrom ? ParsePoint((string) curvePointJson[\"curveFrom\"]) : point;\n\t\t\tvar curveTo = hasCurveTo ? ParsePoint((string)curvePointJson[\"curveTo\"]) : point;\n\t\t\tvar cornerRadius = (double?) curvePointJson[\"cornerRadius\"] ?? 0.0;\n\n\t\t\treturn new SketchCurvePoint(\n\t\t\t\tpoint: point,\n\t\t\t\tcurveFrom: curveFrom ,\n\t\t\t\tcurveTo: curveTo,\n\t\t\t\tcornerRadius: cornerRadius,\n\t\t\t\tmode: mode,\n\t\t\t\thasCurveFrom: hasCurveFrom,\n\t\t\t\thasCurveTo: hasCurveTo);\n\t\t}\n\n\t\tprivate SketchCurvePoint.CurveMode ParseCurvePointMode(JObject curvePointJson)\n\t\t{\n\t\t\tvar mode = (int)curvePointJson[\"curveMode\"];\n\t\t\tswitch (mode)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\treturn SketchCurvePoint.CurveMode.Line;\n\t\t\t\tcase 2:\n\t\t\t\t\treturn SketchCurvePoint.CurveMode.Curve;\n\t\t\t\tcase 3:\n\t\t\t\t\treturn SketchCurvePoint.CurveMode.Asymmetric;\n\t\t\t\tcase 4:\n\t\t\t\t\treturn SketchCurvePoint.CurveMode.Disconnected;\n\t\t\t\tdefault:\n\t\t\t\t\t_log.Warning(\"Parse error: Unrecognized curve mode: \" + mode + \" fallback to Line\");\n\t\t\t\t\treturn SketchCurvePoint.CurveMode.Line;\n\t\t\t}\n\t\t}\n\n\t\tprivate SketchSymbolInstance ParseSymbolInstance(JObject symbolInstanceJson)\n\t\t{\n\t\t\tExpectClass(\"symbolInstance\", symbolInstanceJson);\n\n\t\t\treturn new SketchSymbolInstance(\n\t\t\t\tParseCommonLayerProperties(symbolInstanceJson),\n\t\t\t\tParseSymbolID(symbolInstanceJson));\n\t\t}\n\n\n\t\tSketchAttributedString ParseAttributedString(JObject attributedStringJson)\n\t\t{\n\t\t\tExpectClass(\"MSAttributedString\", attributedStringJson);\n\n\t\t\tvar archive = (string)((JObject) attributedStringJson[\"archivedAttributedString\"])[\"_archive\"];\n\t\t\treturn new AttributedStringParser(_log).Parse(archive ?? \"\");\n\t\t}\n\n\t\tSketchText ParseText(JObject textJson)\n\t\t{\n\t\t\tExpectClass(\"text\", textJson);\n\n\t\t\treturn new SketchText(\n\t\t\t\tParseCommonLayerProperties(textJson),\n\t\t\t\tParseAttributedString((JObject) textJson[\"attributedString\"]),\n\t\t\t\tParseTextBehaviour((int?)textJson[\"textBehaviour\"] ?? 0)\n\t\t\t);\n\t\t}\n\n\t\tSketchTextBoxAlignment ParseTextBehaviour(int code)\n\t\t{\n\t\t\tswitch(code)\n\t\t\t{\n\t\t\t\tcase 0: return SketchTextBoxAlignment.Auto;\n\t\t\t\tcase 1: return SketchTextBoxAlignment.Fixed;\n\t\t\t\tdefault: throw new SketchParserException($\"Invalid text behaviour: {code}\");\n\t\t\t}\n\t\t}\n\n\t\tSketchArtboard ParseArtboard(JObject artboardJson)\n\t\t{\n\t\t\tExpectClass(\"artboard\", artboardJson);\n\n\t\t\treturn new SketchArtboard(\n\t\t\t\tParseCommonLayerProperties(artboardJson));\n\t\t}\n\n\t\tpublic SketchSymbolMaster ParseSymbolMaster(JObject symbolMasterJson)\n\t\t{\n\t\t\tExpectClass(\"symbolMaster\", symbolMasterJson);\n\t\t\treturn new SketchSymbolMaster(\n\t\t\t\tParseCommonLayerProperties(symbolMasterJson),\n\t\t\t\tParseSymbolID(symbolMasterJson));\n\t\t}\n\n\t\tprivate static Guid ParseSymbolID(JObject symbolJson)\n\t\t{\n\t\t\tJToken idNode;\n\t\t\tif (symbolJson[\"symbolID\"] != null) idNode = symbolJson[\"symbolID\"];\n\t\t\telse throw new SketchParserException(\"Expected symbol ID\");\n\t\t\tvar idString = (string) idNode;\n\t\t\tGuid id;\n\t\t\tif (!Guid.TryParse(idString, out id))\n\t\t\t{\n\t\t\t\tthrow new SketchParserException(\"Invalid symbol ID: \" + idString);\n\t\t\t}\n\t\t\treturn id;\n\t\t}\n\n\t\tSketchRectangle ParseRectangle(JObject rectangleJson)\n\t\t{\n\t\t\tExpectClass(\"rectangle\", rectangleJson);\n\n\t\t\tvar layer = ParseCommonLayerProperties(rectangleJson);\n\t\t\tvar curvePoints = ParsePath((JObject)rectangleJson[\"path\"]);\n\n\t\t\treturn new SketchRectangle(layer, curvePoints, ParseBooleanOperation(rectangleJson));\n\t\t}\n\n\t\tSketchGroup ParseGroup(JObject groupJson)\n\t\t{\n\t\t\tExpectClass(\"group\", groupJson);\n\n\t\t\treturn new SketchGroup(ParseCommonLayerProperties(groupJson));\n\t\t}\n\n\t\tSketchLayer ParseCommonLayerProperties(JObject layerJson)\n\t\t{\n\t\t\tvar children = ParseChildLayers(layerJson).ToList();\n\t\t\tvar parent = new SketchLayer(\n\t\t\t\tParseEntityId(layerJson),\n\t\t\t\tnull, //Parent has to be set later, since it doesn't exist yet\n\t\t\t\tParseFrame(layerJson),\n\t\t\t\t(string) layerJson[\"name\"],\n\t\t\t\t(bool?) layerJson[\"nameIsFixed\"] ?? false,\n\t\t\t\tParseAlignment(layerJson),\n\t\t\t\t(double?) layerJson[\"rotation\"] ?? 0,\n\t\t\t\t(bool?) layerJson[\"isFlippedVertical\"] ?? false,\n\t\t\t\t(bool?) layerJson[\"isFlippedHorizontal\"] ?? false,\n\t\t\t\tParseStyle(layerJson),\n\t\t\t\tchildren\n\t\t\t);\n\n\t\t\tforeach (var child in children)\n\t\t\t{\n\t\t\t\tchild.Parent = parent; //Parent doesn't exist until children are done parsing, so set it here\n\t\t\t}\n\n\t\t\treturn parent;\n\t\t}\n\n\n\t\tIEnumerable<SketchLayer> ParseChildLayers(JObject layer)\n\t\t{\n\t\t\tvar layersJson = (JArray)layer[\"layers\"];\n\t\t\treturn layersJson == null ? new List<SketchLayer>() : (layersJson.Cast<JObject>().Select(ParseLayer).SelectOk());\n\t\t}\n\n\t\tSketchColor ParseColor(JObject colorJson)\n\t\t{\n\t\t\tExpectClass(\"color\", colorJson);\n\n\t\t\treturn new SketchColor(\n\t\t\t\t(float?)colorJson[\"red\"] ?? 0,\n\t\t\t\t(float?)colorJson[\"green\"] ?? 0,\n\t\t\t\t(float?)colorJson[\"blue\"] ?? 0,\n\t\t\t\t(float?)colorJson[\"alpha\"] ?? 0\n\t\t\t);\n\t\t}\n\n\t\tSketchSolidColorBrush ParseSolidColorBrush(JObject brushJson)\n\t\t{\n\t\t\treturn new SketchSolidColorBrush(ParseColor((JObject) brushJson[\"color\"]));\n\t\t}\n\n\t\tSketchGradientStop ParseGradientStop(JObject gradientStopJson)\n\t\t{\n\t\t\tExpectClass(\"gradientStop\", gradientStopJson);\n\n\t\t\treturn new SketchGradientStop(\n\t\t\t\tParseColor((JObject) gradientStopJson[\"color\"]),\n\t\t\t\t(double?) gradientStopJson[\"position\"] ?? 0);\n\t\t}\n\n\t\tISketchBrush ParseGradientBrush(JObject brushJson)\n\t\t{\n\t\t\tvar gradientJson = (JObject)brushJson[\"gradient\"];\n\n\t\t\tExpectClass(\"gradient\", gradientJson);\n\n\t\t\tvar gradientType = (int?) gradientJson[\"gradientType\"] ?? 0;\n\t\t\tif (gradientType != 0)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException(\"Only linear gradients are supported\");\n\t\t\t}\n\n\t\t\tvar stops = ((JArray) gradientJson[\"stops\"])\n\t\t\t\t.Cast<JObject>()\n\t\t\t\t.Select(ParseGradientStop);\n\n\t\t\treturn new SketchLinearGradientBrush(\n\t\t\t\tParsePoint((string)gradientJson[\"from\"]),\n\t\t\t\tParsePoint((string)gradientJson[\"to\"]),\n\t\t\t\tstops.ToList()\n\t\t\t);\n\t\t}\n\n\t\tISketchBrush ParseFill(JObject fillJson)\n\t\t{\n\t\t\tvar fillType = (int?) fillJson[\"fillType\"] ?? 0;\n\t\t\tswitch (fillType)\n\t\t\t{\n\t\t\t\tcase 0: return ParseSolidColorBrush(fillJson);\n\t\t\t\tcase 1: return ParseGradientBrush(fillJson);\n\t\t\t\tcase 4: throw new SketchParserException(\"Image/Pattern fill is not supported\");\n\t\t\t\tcase 5: throw new SketchParserException(\"Noise fill is not supported\");\n\t\t\t\tdefault: throw new SketchParserException(\"Unknown fill type '\" + fillType + \"'\");\n\t\t\t}\n\t\t}\n\n\t\tSketchShadow ParseShadow(JObject shadowJson)\n\t\t{\n\t\t\tExpectedClasses(shadowJson, \"shadow\", \"innerShadow\");\n\n\t\t\treturn new SketchShadow(\n\t\t\t\t(bool?)shadowJson[\"isEnabled\"] ?? false,\n\t\t\t\tParseColor((JObject)shadowJson[\"color\"]),\n\t\t\t\tnew SketchPoint(\n\t\t\t\t\tParseNumber((string)shadowJson[\"offsetX\"] ?? \"0\"),\n\t\t\t\t\tParseNumber((string)shadowJson[\"offsetY\"] ?? \"0\")\n\t\t\t\t),\n\t\t\t\tParseNumber((string)shadowJson[\"blurRadius\"] ?? \"0\"),\n\t\t\t\tParseNumber((string)shadowJson[\"spread\"] ?? \"0\")\n\t\t\t);\n\t\t}\n\n\t\tSketchBorderPosition ParseBorderPosition(JObject borderJson)\n\t\t{\n\t\t\tif (borderJson[\"position\"] == null)\n\t\t\t{\n\t\t\t\tthrow new NoNullAllowedException($\"Expected Sketch border to have a position\");\n\t\t\t}\n\n\t\t\tvar pos = 0;\n\t\t\tpos = (int) borderJson[\"position\"];\n\n\t\t\tswitch (pos)\n\t\t\t{\n\t\t\t\tcase 0: return SketchBorderPosition.Center;\n\t\t\t\tcase 1: return SketchBorderPosition.Inside;\n\t\t\t\tcase 2: return SketchBorderPosition.Outside;\n\t\t\t\tdefault: throw new SketchParserException($\"Unknown border position: {pos}\");\n\t\t\t}\n\t\t}\n\n\t\tOptional<SketchStyle> ParseStyle(JObject layerJson)\n\t\t{\n\t\t\tvar styleJson = (JObject)layerJson[\"style\"];\n\t\t\tif (styleJson == null)\n\t\t\t\treturn Optional.None();\n\n\t\t\tExpectClass(\"style\", styleJson);\n\n\t\t\treturn new SketchStyle(\n\t\t\t\tParseFills(styleJson),\n\t\t\t\tParseBorders(styleJson),\n\t\t\t\tParseShadows(styleJson[\"shadows\"]),\n\t\t\t\tParseShadows(styleJson[\"innerShadows\"]),\n\t\t\t\tParseBlur(styleJson),\n\t\t\t\tParseOpacity(styleJson));\n\t\t}\n\n\t\tprivate List<SketchFill> ParseFills(JObject styleJson)\n\t\t{\n\t\t\tif (styleJson[\"fills\"] == null)\n\t\t\t\treturn new List<SketchFill>();\n\n\t\t\treturn ((JArray) styleJson[\"fills\"])\n\t\t\t\t.Cast<JObject>()\n\t\t\t\t.Select(fillJson => new SketchFill\n\t\t\t\t(\n\t\t\t\t\t(bool?) fillJson[\"isEnabled\"] ?? false,\n\t\t\t\t\tParseFill(fillJson)\n\t\t\t\t))\n\t\t\t\t.EmptyIfNull()\n\t\t\t\t.ToList();\n\t\t}\n\n\t\tprivate List<SketchBorder> ParseBorders(JObject styleJson)\n\t\t{\n\t\t\tif (styleJson[\"borders\"] == null)\n\t\t\t\treturn new List<SketchBorder>();\n\n\t\t\treturn ((JArray) styleJson[\"borders\"])\n\t\t\t\t.Cast<JObject>()\n\t\t\t\t.Select(borderJson => new SketchBorder\n\t\t\t\t(\n\t\t\t\t\t(bool?) borderJson[\"isEnabled\"] ?? false,\n\t\t\t\t\tParseFill(borderJson),\n\t\t\t\t\t(double?) borderJson[\"thickness\"] ?? 0,\n\t\t\t\t\tParseBorderPosition(borderJson)\n\t\t\t\t))\n\t\t\t\t.EmptyIfNull()\n\t\t\t\t.ToList();\n\t\t}\n\n\t\tprivate List<SketchShadow> ParseShadows(JToken styleJson)\n\t\t{\n\t\t\tif (styleJson == null)\n\t\t\t\treturn new List<SketchShadow>();\n\n\t\t\tvar shadowArray = styleJson as JArray;\n\t\t\treturn shadowArray != null ? shadowArray.Cast<JObject>().Select(ParseShadow).ToList() : new List<SketchShadow>();\n\t\t}\n\n\t\tprivate Optional<SketchBlur> ParseBlur(JObject styleJson)\n\t\t{\n\t\t\tvar blurJson = (JObject)styleJson[\"blur\"];\n\t\t\tif (blurJson == null)\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar enabled = (bool?) blurJson[\"isEnabled\"] ?? false;\n\t\t\tif (!enabled)\n\t\t\t\treturn Optional.None();\n\n\t\t\treturn new SketchBlur(\n\t\t\t\tParsePoint((string) blurJson[\"center\"]),\n\t\t\t\t(int?) blurJson[\"motionAngle\"] ?? 0,\n\t\t\t\t(double?) blurJson[\"radius\"] ?? 0.0,\n\t\t\t\tParseBlurType(blurJson));\n\t\t}\n\n\t\tprivate Optional<double> ParseOpacity(JObject styleJson)\n\t\t{\n\t\t\tvar contextSettings = (JObject) styleJson[\"contextSettings\"];\n\t\t\tif (contextSettings != null)\n\t\t\t{\n\t\t\t\tvar opacity = (double?) contextSettings[\"opacity\"];\n\t\t\t\tif (opacity != null)\n\t\t\t\t{\n\t\t\t\t\treturn opacity.Value;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tprivate SketchBlur.SketchBlurType ParseBlurType(JObject blurJson)\n\t\t{\n\t\t\tvar type = (int)blurJson[\"type\"];\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\treturn SketchBlur.SketchBlurType.Gaussian;\n\t\t\t\tcase 1:\n\t\t\t\t\treturn SketchBlur.SketchBlurType.Motion;\n\t\t\t\tcase 2:\n\t\t\t\t\treturn SketchBlur.SketchBlurType.Zoom;\n\t\t\t\tcase 3:\n\t\t\t\t\treturn SketchBlur.SketchBlurType.Background;\n\t\t\t\tdefault:\n\t\t\t\t\t_log.Warning(\"Parse error: Unrecognized blur type: \" + type + \" fallback to Gaussian\");\n\t\t\t\t\treturn SketchBlur.SketchBlurType.Gaussian;\n\t\t\t}\n\t\t}\n\n\n\t\tSketchShapeGroup ParseShapeGroup(JObject shapeGroupJson)\n\t\t{\n\t\t\tExpectClass(\"shapeGroup\", shapeGroupJson);\n\t\t\tvar hasClippingMask = (bool) shapeGroupJson[\"hasClippingMask\"];\n\n\t\t\treturn new SketchShapeGroup(\n\t\t\t\tParseCommonLayerProperties(shapeGroupJson),\n\t\t\t\thasClippingMask);\n\t\t}\n\n\t\tSketchRect ParseFrame(JObject layerJson)\n\t\t{\n\t\t\treturn ParseRect((JObject) layerJson[\"frame\"]);\n\t\t}\n\n\t\t// Format of a 2D point is {double, double}, we let double.Parse in ParseNumber\n\t\t// check that the two words separated by a comma is actually valid formats of\n\t\t// double values. Extract to matches that are not whitespace, separated by `,`\n\t\t// and by some optional whitespace.\n\t\tstatic readonly Regex PointRegex = new Regex(@\"{\\s*(\\S+),\\s*(\\S+)\\s*}\", RegexOptions.Compiled);\n\n\t\tdouble ParseNumber(string number)\n\t\t{\n\t\t\treturn double.Parse(number, CultureInfo.InvariantCulture);\n\t\t}\n\n\t\tSketchPoint ParsePoint(string point)\n\t\t{\n\t\t\tvar match = PointRegex.Match(point);\n\t\t\tif (!match.Success)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException(\"Invalid 2D point\");\n\t\t\t}\n\n\t\t\tvar x = ParseNumber(match.Groups[1].Value);\n\t\t\tvar y = ParseNumber(match.Groups[2].Value);\n\n\t\t\treturn new SketchPoint(x, y);\n\t\t}\n\n\t\tSketchRect ParseRect(JObject rectJson)\n\t\t{\n\t\t\tExpectClass(\"rect\", rectJson);\n\t\t\treturn new SketchRect(\n\t\t\t\t(double) rectJson[\"x\"],\n\t\t\t\t(double) rectJson[\"y\"],\n\t\t\t\t(double) rectJson[\"width\"],\n\t\t\t\t(double) rectJson[\"height\"],\n\t\t\t\t(bool) rectJson[\"constrainProportions\"]\n\t\t\t);\n\t\t}\n\n\t\tSketchPage ParsePage(JObject pageJson)\n\t\t{\n\t\t\tExpectClass(\"page\", pageJson);\n\t\t\treturn new SketchPage(\n\t\t\t\tParseEntityId(pageJson),\n\t\t\t\tParseRect((JObject) pageJson[\"frame\"]),\n\t\t\t\t(string) pageJson[\"name\"],\n\t\t\t\t((JArray)pageJson[\"layers\"])\n\t\t\t\t.Cast<JObject>()\n\t\t\t\t.Select(ParseLayer)\n\t\t\t\t.SelectOk()\n\t\t\t\t.ToList()\n\t\t\t);\n\t\t}\n\n\t\tGuid ParseEntityId(JObject source)\n\t\t{\n\t\t\t// Currently the objectID isn't used for anything so returning Guid.Empty\n\t\t\t// if parsing the objectID fails doesn't cause problems. But it might in\n\t\t\t// the future is we start using it. 2017-12-05 anette\n\t\t\tJToken idNode;\n\t\t\tif (source[\"do_objectID\"] != null)\n\t\t\t{\n\t\t\t\tidNode = source[\"do_objectID\"];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_log.Warning(\"Parser: Expected object ID, using empty Guid\");\n\t\t\t\treturn Guid.Empty;\n\t\t\t}\n\t\t\tvar idString = (string) idNode;\n\t\t\tGuid id;\n\t\t\tif (!Guid.TryParse(idString, out id))\n\t\t\t{\n\t\t\t\t_log.Warning(\"Parser: Invalid object ID \" + idString + \", using empty Guid\");\n\t\t\t\treturn Guid.Empty;\n\t\t\t}\n\t\t\treturn id;\n\t\t}\n\n\t\tvoid ExpectStringAttributeEquals(string key, string expectedValue, JObject obj)\n\t\t{\n\t\t\tvar actualValue = (string) obj[key];\n\t\t\tif (expectedValue != actualValue)\n\t\t\t{\n\t\t\t\tthrow new InvalidAttributeException(key, expectedValue, actualValue);\n\t\t\t}\n\t\t}\n\n\t\tvoid ExpectClass(string expectedClass, JObject obj)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tExpectStringAttributeEquals(\"_class\", expectedClass, obj);\n\t\t\t}\n\n\t\t\tcatch (InvalidAttributeException e)\n\t\t\t{\n\t\t\t\tthrow new SketchParserException($\"Attempted to parse Sketch class '{e.ExpectedValue}', got '{e.ActualValue}'\");\n\t\t\t}\n\t\t}\n\n\t\tvoid ExpectedClasses(JObject obj, params string[] expectedClasses)\n\t\t{\n\t\t\tvar actualValue = (string) obj[\"_class\"];\n\t\t\tif (!expectedClasses.ToList().Contains(actualValue))\n\t\t\t{\n\t\t\t\tthrow new SketchParserException($\"Attempted to parse Sketch class of either '{expectedClasses}', but was '{actualValue}'\");\n\t\t\t}\n\t\t}\n\t}\n\n\tinternal static class Extensions\n\t{\n\t\tpublic static IEnumerable<T> EmptyIfNull<T>(this IEnumerable<T> self)\n\t\t{\n\t\t\treturn self ?? new T[0];\n\t\t}\n\n\t\tpublic static async Task<string> ReadToStringAsync(this Stream stream, Encoding encoding = null)\n\t\t{\n\t\t\tusing (var text = new StreamReader(stream, encoding ?? Encoding.UTF8))\n\t\t\t{\n\t\t\t\treturn await text.ReadToEndAsync();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/Transforms/ITransform.cs",
    "content": "﻿using SketchImporter.UxGenerator;\n\nnamespace SketchConverter.Transforms\n{\n\tpublic interface ITransform\n\t{\n\t\tvoid Apply(UxNode uxClass);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/Transforms/TextPropertyTransform.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing SketchConverter.API;\nusing SketchConverter.UxBuilder;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverter.Transforms\n{\n\tpublic class TextPropertyTransform : ITransform\n\t{\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic TextPropertyTransform(ILogger log)\n\t\t{\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic void Apply(UxNode uxClass)\n\t\t{\n\t\t\tvar propertyValues = new List<PropertyValue>();\n\t\t\tApply(uxClass, propertyValues);\n\t\t\tfor(var i = propertyValues.Count-1; i>=0; i--)\n\t\t\t{\n                uxClass.Children.Insert(0,StringProperty(propertyValues[i].Name));\n\t\t\t\tuxClass.Attributes.Add(propertyValues[i].Name, new UxString(propertyValues[i].DefaultValue));\n\t\t\t}\n\t\t}\n\n\t\tprivate void Apply(UxNode uxClass, List<PropertyValue> propertyValues)\n\t\t{\n\t\t\tforeach (var child in uxClass.Children.Where(c => c is UxNode).Cast<UxNode>())\n\t\t\t{\n\t\t\t\tApply(child, propertyValues);\n\t\t\t}\n\n\t\t\tif (uxClass.ClassName == \"Text\")\n\t\t\t{\n\t\t\t\tvar layerName = uxClass.SketchLayerName;\n\t\t\t\tswitch (NameValidator.NameIsValid(layerName))\n\t\t\t\t{\n\t\t\t\t\tcase NameValidity.InvalidCharacter:\n                        _log.Warning($\"Could not create a text property for the layer '{layerName}', as it contains an invalid character. Please only use the letters a-z, numbers, or underscores, and don't start the name with a number.\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase NameValidity.InvalidKeyword:\n                        _log.Warning($\"Could not create a text property for the layer '{layerName}', as '{layerName}' is a reserved word. Please choose another name.\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase NameValidity.Valid:\n\t\t\t\t\t\tif (propertyValues.Any(p => p.Name.Equals(layerName)))\n\t\t\t\t\t\t{\n                            _log.Warning($\"Could not create a text property for the layer '{layerName}', as a text property for another layer with the same name has already been created. Please use unique names for text layers within the same symbol.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar defaultValue = (UxString) uxClass.Attributes[\"Value\"];\n\t\t\t\t\t\t\tpropertyValues.Add(new PropertyValue(layerName, defaultValue.Value));\n\t\t\t\t\t\t\tuxClass.Attributes[\"Value\"] = new UxString(\"{Property \" + layerName + \"}\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new NotImplementedException(\"Internal error\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static UxNode StringProperty(string name)\n\t\t{\n\t\t\tvar property = new UxNode(\"string\");\n\t\t\tproperty.Attributes[\"ux:Property\"] = new UxString(name);\n\t\t\treturn property;\n\t\t}\n\n\t\tprivate class PropertyValue\n\t\t{\n\t\t\tpublic readonly string Name;\n\t\t\tpublic readonly string DefaultValue;\n\n\t\t\tpublic PropertyValue(string name, string defaultValue)\n\t\t\t{\n\t\t\t\tName = name;\n\t\t\t\tDefaultValue = defaultValue;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/ArtboardUxBuilder.cs",
    "content": "﻿using System.IO;\nusing System.Linq;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic class ArtboardUxBuilder : IUxBuilder\n\t{\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic ArtboardUxBuilder(ILogger log)\n\t\t{\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic void Build(SketchDocument document, string outputDirectory)\n\t\t{\n\t\t\tvar symbols = document\n\t\t\t\t.Pages\n\t\t\t\t.AsEnumerable()\n\t\t\t\t.SelectMany(page => page.Layers.OfType<SketchSymbolMaster>());\n\n\t\t\tvar symbolClassNameBuilder = new SymbolClassNameBuilder();\n\t\t\tsymbolClassNameBuilder.Init(symbols);\n\n\t\t\tvar appNode = new UxNode { ClassName = \"App\" };\n\t\t\tvar pageControl = new UxNode { ClassName = \"PageControl\" };\n\t\t\tappNode.Children.Add(pageControl);\n\n\t\t\tvar artboards = document.Pages\n\t\t\t\t.AsEnumerable()\n\t\t\t\t.Reverse()\n\t\t\t\t.SelectMany(page => page.Layers\n\t\t\t\t\t.OfType<SketchArtboard>()\n\t\t\t\t\t.Reverse());\n\n\t\t\tvar builder = new UxBuilder(symbolClassNameBuilder, new AssetEmitter(outputDirectory, _log), _log);\n\n\t\t\tvar pages = artboards.Select(builder.BuildPage);\n\t\t\tpageControl.Children.AddRange(pages);\n\n\t\t\tvar serializerContext = new UxSerializerContext();\n\t\t\tvar ux = appNode.SerializeUx(serializerContext);\n\n\t\t\tvar outputFilePath =  Path.Combine(outputDirectory, \"MainView.ux\");\n\t\t\tFile.WriteAllText(outputFilePath, ux);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/AssetEmitter.cs",
    "content": "﻿using System;\nusing System.IO;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic interface IAssetEmitter\n\t{\n\t\tvoid Write(SketchImage image);\n\t}\n\n\tclass AssetEmitter : IAssetEmitter\n\t{\n\t\tprivate readonly string _outputDirectory;\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic AssetEmitter(string outputDirectory, ILogger log)\n\t\t{\n\t\t\t_outputDirectory = outputDirectory;\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic void Write(SketchImage image)\n\t\t{\n\t\t\tvar path = image.Path;\n\n\t\t\tusing (var stream = image.Open())\n\t\t\tusing (var ms = new MemoryStream())\n\t\t\t{\n\t\t\t\tstream.CopyTo(ms);\n\t\t\t\tvar data = ms.ToArray();\n\t\t\t\tWrite(path, data);\n\t\t\t}\n\t\t}\n\n\t\tprivate void Write(string path, byte[] data)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar assetRelativeDir = Path.GetDirectoryName(path);\n\t\t\t\tvar assetDir = Path.Combine(_outputDirectory, assetRelativeDir);\n\t\t\t\tvar assetPath = Path.Combine(assetDir, Path.GetFileName(path));\n\t\t\t\tDirectory.CreateDirectory(assetDir);\n\t\t\t\tFile.WriteAllBytes(assetPath, data);\n\t\t\t\t_log.Info(\"Wrote \" + path + \" to \" + assetPath);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\t_log.Error(\"Writing asset failed \" + e.Message);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/Exceptions.cs",
    "content": "﻿using System;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic class UxBuilderException : Exception\n\t{\n\t\tpublic UxBuilderException(string message)\n\t\t\t: base(message)\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/Geometry.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic static class Geometry\n\t{\n\t\tpublic static bool IsAxisAlignedRectangle(SketchPath path)\n\t\t{\n\t\t\treturn path.Points.Count == 4\n\t\t\t\t   && path.IsClosed\n\t\t\t\t   && path.Points.All(p => p.Mode == SketchCurvePoint.CurveMode.Line)\n\t\t\t\t   && EdgesAreAxisAligned(path.Points);\n\t\t}\n\n\t\t// public static for testing purposes\n\t\t// Check that the four edges of a quadrilateral are axis aligned.\n\t\t// The coordinates for paths in the sketch format is saved as a unit square. Width\n\t\t// and height is deteremined by the size of the layer.\n\t\tpublic static bool EdgesAreAxisAligned(IList<SketchCurvePoint> pathPoints)\n\t\t{\n\t\t\tif (pathPoints.Count != 4)\n\t\t\t{\n\t\t\t\tthrow new UxBuilderException(\"Checking if quadrilateral is axis aligned, expecting four points\");\n\t\t\t}\n\n\t\t\tvar edge1 = pathPoints[0].Point - pathPoints[1].Point;\n\t\t\tvar edge2 = pathPoints[1].Point - pathPoints[2].Point;\n\t\t\tvar edge3 = pathPoints[2].Point - pathPoints[3].Point;\n\t\t\tvar edge4 = pathPoints[3].Point - pathPoints[0].Point;\n\n\t\t\tvar angle1 = edge1.Dot(edge2);\n\t\t\tvar angle2 = edge2.Dot(edge3);\n\t\t\tvar angle3 = edge3.Dot(edge4);\n\n\t\t\treturn\n\t\t\t\t(edge1.Y.Equals(0) && edge2.X.Equals(0) || edge1.X.Equals(0) && edge2.Y.Equals(0)) &&\n\t\t\t\tangle1.Equals(0) &&\n\t\t\t\tangle2.Equals(0) &&\n\t\t\t\tangle3.Equals(0);\n\t\t}\n\n\t\tprivate static double Dot(this SketchPoint point, SketchPoint other)\n\t\t{\n\t\t\tvar res = point.X * other.X + point.Y * other.Y;\n\t\t\treturn res;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/IUxBuilder.cs",
    "content": "﻿using SketchConverter.SketchModel;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic interface IUxBuilder\n\t{\n\t\tvoid Build(SketchDocument document, string outputDirectory);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/LayoutBuilder.cs",
    "content": "﻿using SketchConverter.SketchModel;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic class LayoutBuilder\n\t{\n\t\treadonly SketchLayer _layer;\n\n\t\tSketchRect Frame => _layer.Frame;\n\t\tSketchAlignment Alignment => _layer.Alignment;\n\n\t\tpublic LayoutBuilder(SketchLayer layer)\n\t\t{\n\t\t\t_layer = layer;\n\t\t}\n\n\t\tenum UxAxisAlignment\n\t\t{\n\t\t\tDefault,\n\t\t\tCenter,\n\t\t\tStart,\n\t\t\tEnd\n\t\t}\n\n\t\tclass UxInterval\n\t\t{\n\t\t\tpublic UxSize Start { get; set; }\n\t\t\tpublic UxSize End { get; set; }\n\n\t\t\tpublic static UxVector CombineAxes(UxInterval horizontal, UxInterval vertical)\n\t\t\t{\n\t\t\t\treturn new UxVector(\n\t\t\t\t\thorizontal.Start,\n\t\t\t\t\tvertical.Start,\n\t\t\t\t\thorizontal.End,\n\t\t\t\t\tvertical.End\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tstruct UxAxisLayout\n\t\t{\n\t\t\tpublic UxAxisAlignment Alignment { get; set; }\n\t\t\tpublic UxSize Offset { get; set; }\n\t\t\tpublic UxFloat2 Margin { get; set; }\n\t\t\tpublic UxSize Size { get; set; }\n\t\t}\n\n\t\tstring BuildHorizontalAlignmentString(UxAxisAlignment aa)\n\t\t{\n\t\t\tswitch (aa)\n\t\t\t{\n\t\t\t\tcase UxAxisAlignment.Start: return \"Left\";\n\t\t\t\tcase UxAxisAlignment.End: return \"Right\";\n\t\t\t\tcase UxAxisAlignment.Center: return \"Center\";\n\t\t\t\tdefault: return \"\";\n\t\t\t}\n\t\t}\n\n\t\tstring BuildVerticalAlignmentString(UxAxisAlignment aa)\n\t\t{\n\t\t\tswitch (aa)\n\t\t\t{\n\t\t\t\tcase UxAxisAlignment.Start: return \"Top\";\n\t\t\t\tcase UxAxisAlignment.End: return \"Bottom\";\n\t\t\t\tcase UxAxisAlignment.Center: return \"Center\";\n\t\t\t\tdefault: return \"\";\n\t\t\t}\n\t\t}\n\n\t\tstring BuildUxAlignmentString(UxAxisAlignment horizontal, UxAxisAlignment vertical)\n\t\t{\n\t\t\tif (horizontal == UxAxisAlignment.Default\n\t\t\t\t&& vertical == UxAxisAlignment.Default)\n\t\t\t{\n\t\t\t\treturn \"Default\";\n\t\t\t}\n\n\t\t\tif (horizontal == UxAxisAlignment.Center\n\t\t\t\t&& vertical == UxAxisAlignment.Center)\n\t\t\t{\n\t\t\t\treturn \"Center\";\n\t\t\t}\n\n\t\t\tif (horizontal == UxAxisAlignment.Center\n\t\t\t\t&& vertical == UxAxisAlignment.Default)\n\t\t\t{\n\t\t\t\treturn \"HorizontalCenter\";\n\t\t\t}\n\n\t\t\tif (horizontal == UxAxisAlignment.Default\n\t\t\t\t&& vertical == UxAxisAlignment.Center)\n\t\t\t{\n\t\t\t\treturn \"VerticalCenter\";\n\t\t\t}\n\n\t\t\treturn BuildVerticalAlignmentString(vertical) + BuildHorizontalAlignmentString(horizontal);\n\t\t}\n\n\t\tUxSize AnchorForAlignment(UxAxisAlignment alignment)\n\t\t{\n\t\t\tswitch (alignment)\n\t\t\t{\n\t\t\t\tcase UxAxisAlignment.Start: return UxSize.Percent(0);\n\t\t\t\tcase UxAxisAlignment.End: return UxSize.Percent(100);\n\t\t\t\tdefault: return UxSize.Percent(50);\n\t\t\t}\n\t\t}\n\n\t\tUxAxisLayout BuildAxisLayout(SketchAxisAlignment sa, float start, float size, float parentSize)\n\t\t{\n\t\t\tvar end = parentSize - (start + size);\n\n\t\t\tvar layout = new UxAxisLayout()\n\t\t\t{\n\t\t\t\tAlignment = UxAxisAlignment.Start,\n\t\t\t\tOffset = UxSize.Points(0),\n\t\t\t\tMargin = new UxFloat2(0,0),\n\t\t\t\tSize = null\n\t\t\t};\n\n\t\t\tif (sa.FixSize)\n\t\t\t{\n\t\t\t\tlayout.Size = UxSize.Points(size);\n\n\t\t\t\tif (sa.AlignStart)\n\t\t\t\t{\n\t\t\t\t\tlayout.Margin.X = start;\n\t\t\t\t\tlayout.Alignment = UxAxisAlignment.Start;\n\t\t\t\t}\n\t\t\t\telse if (sa.AlignEnd)\n\t\t\t\t{\n\t\t\t\t\tlayout.Margin.Y = end;\n\t\t\t\t\tlayout.Alignment = UxAxisAlignment.End;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlayout.Alignment = UxAxisAlignment.Center;\n\n\t\t\t\t\tvar offset = start + 0.5f * (size - parentSize);\n\t\t\t\t\tlayout.Offset = UxSize.Percent(100 * offset / parentSize );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(sa.AlignStart && sa.AlignEnd)\n\t\t\t\t{\n\t\t\t\t\tlayout.Alignment = UxAxisAlignment.Default;\n\t\t\t\t\tlayout.Margin.X = start;\n\t\t\t\t\tlayout.Margin.Y = end;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlayout.Size = UxSize.Percent(100 * size / parentSize);\n\n\t\t\t\t\tif(sa.AlignStart)\n\t\t\t\t\t{\n\t\t\t\t\t\tlayout.Alignment = UxAxisAlignment.Start;\n\t\t\t\t\t\tlayout.Offset = UxSize.Points(start);\n\t\t\t\t\t}\n\t\t\t\t\telse if(sa.AlignEnd)\n\t\t\t\t\t{\n\t\t\t\t\t\tlayout.Alignment = UxAxisAlignment.End;\n\t\t\t\t\t\tlayout.Offset = UxSize.Points(-end);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlayout.Alignment = UxAxisAlignment.Start;\n\t\t\t\t\t\tlayout.Offset = UxSize.Percent(100 * start / parentSize);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn layout;\n\t\t}\n\n\t\tpublic UxNode Build(UxNode node)\n\t\t{\n\t\t\tvar alignment = _layer.Alignment;\n\n\t\t\tvar frame = _layer.Frame;\n\t\t\tvar parentFrame = _layer.Parent.Frame;\n\n\t\t\tvar attributes = node.Attributes;\n\n\t\t\tvar horizontal = BuildAxisLayout(alignment.Horizontal,\n\t\t\t\t(float)frame.X,\n\t\t\t\t(float)frame.Width,\n\t\t\t\t(float?)parentFrame?.Width ?? 0);\n\n\t\t\tvar vertical = BuildAxisLayout(alignment.Vertical,\n\t\t\t\t(float)frame.Y,\n\t\t\t\t(float)frame.Height,\n\t\t\t\t(float?)parentFrame?.Height ?? 0);\n\n\t\t\tif (horizontal.Size != null)\n\t\t\t\tattributes[\"Width\"] = horizontal.Size;\n\n\t\t\tif (vertical.Size != null)\n\t\t\t\tattributes[\"Height\"] = vertical.Size;\n\n\t\t\tvar alignmentString = BuildUxAlignmentString(horizontal.Alignment, vertical.Alignment);\n\t\t\tif (alignmentString == \"Default\")\n\t\t\t{\n\t\t\t\t// If alignment is Default, we don't need to specify Width|Height=\"100%\"\n\t\t\t\tif (horizontal.Size == UxSize.Percent(100)) attributes.Remove(\"Width\");\n\t\t\t\tif (vertical.Size == UxSize.Percent(100)) attributes.Remove(\"Height\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tattributes[\"Alignment\"] = new UxString(alignmentString);\n\t\t\t}\n\n\t\t\tif (horizontal.Offset != null || vertical.Offset != null)\n\t\t\t{\n\t\t\t\tvar horizontalOffset = horizontal.Offset ?? UxSize.Points(0);\n\t\t\t\tvar verticalOffset = vertical.Offset ?? UxSize.Points(0);\n\n\t\t\t\tif (horizontalOffset.Value != 0 || verticalOffset.Value != 0)\n\t\t\t\t{\n\t\t\t\t\tattributes[\"Offset\"] = new UxVector(horizontalOffset, verticalOffset);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar hMargin = horizontal.Margin;\n\t\t\tvar vMargin = vertical.Margin;\n\n\t\t\tattributes[\"Margin\"] = new UxFloat4(\n\t\t\t\thMargin.X,\n\t\t\t\tvMargin.X,\n\t\t\t\thMargin.Y,\n\t\t\t\tvMargin.Y);\n\n\t\t\treturn node;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/NameValidator.cs",
    "content": "﻿using System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic static class NameValidator\n\t{\n\t\tpublic static NameValidity NameIsValid(string name)\n\t\t{\n\t\t\tif (!ValidCharacters.IsMatch(name))\n\t\t\t\treturn NameValidity.InvalidCharacter;\n\t\t\tif (UnoKeywords.Contains(name))\n\t\t\t\treturn NameValidity.InvalidKeyword;\n\t\t\tif (CSharpKeywords.Contains(name))\n\t\t\t\treturn NameValidity.InvalidKeyword;\n\t\t\treturn NameValidity.Valid;\n\t\t}\n\n\t\tprivate static readonly Regex ValidCharacters = new Regex(\"^[A-Za-z_][A-Za-z0-9_]*$\", RegexOptions.Compiled);\n\n\t\t//Taken from https://github.com/fusetools/uno/blob/0a1f0982cf0048937bd934bf7b1839599c0663bf/src/compiler/Uno.Compiler.Frontend/Analysis/Tokens.cs#L15\n\t\tprivate static readonly string[] UnoKeywords = {\n\t\t\t\"add\", \"apply\", \"block\", \"draw\", \"draw_dispose\", \"drawable\", \"get\", \"global\", \"immutable\", \"interpolate\",\n\t\t\t\"intrinsic\", \"local\", \"meta\", \"norm\", \"partial\", \"pixel\", \"pixel_sampler\", \"prev\", \"remove\", \"req\", \"sample\", \"set\",\n\t\t\t\"swizzler\", \"tag\", \"undefined\", \"var\", \"vertex\", \"vertex_attrib\", \"vertex_texture\", \"where\", \"yield\"\n\t\t};\n\n\t\t//Taken from https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/\n\t\tprivate static readonly string[] CSharpKeywords = {\n\t\t\t\"abstract\", \"add\", \"alias\", \"as\", \"ascending\", \"async\", \"await\", \"base\", \"bool\", \"break\", \"byte\", \"case\", \"catch\",\n\t\t\t\"char\", \"checked\", \"class\", \"const\", \"continue\", \"decimal\", \"default\", \"delegate\", \"descending\", \"do\", \"double\",\n\t\t\t\"dynamic\", \"else\", \"enum\", \"event\", \"explicit\", \"extern\", \"false\", \"finally\", \"fixed\", \"float\", \"for\", \"foreach\",\n\t\t\t\"from\", \"get\", \"global\", \"goto\", \"group\", \"if\", \"implicit\", \"in\", \"int\", \"interface\", \"internal\", \"into\", \"is\",\n\t\t\t\"join\", \"let\", \"lock\", \"long\", \"nameof\", \"namespace\", \"new\", \"null\", \"object\", \"operator\", \"orderby\", \"out\",\n\t\t\t\"override\", \"params\", \"partial\", \"private\", \"protected\", \"public\", \"readonly\", \"ref\", \"remove\", \"return\", \"sbyte\",\n\t\t\t\"sealed\", \"select\", \"set\", \"short\", \"sizeof\", \"stackalloc\", \"static\", \"static\", \"string\", \"struct\", \"switch\", \"this\",\n\t\t\t\"throw\", \"true\", \"try\", \"typeof\", \"uint\", \"ulong\", \"unchecked\", \"unsafe\", \"ushort\", \"using\", \"using\", \"value\", \"var\",\n\t\t\t\"virtual\", \"void\", \"volatile\", \"when\", \"where\", \"while\", \"yield\"\n\t\t};\n\t}\n\n\tpublic enum NameValidity\n\t{\n\t\tValid,\n\t\tInvalidCharacter,\n\t\tInvalidKeyword\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/SketchCurvePointsToSvg.cs",
    "content": "﻿using System.Globalization;\nusing System.Text;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic static class SketchCurvePointsToSvg\n\t{\n\t\tpublic static string ToSvgString(SketchPath path)\n\t\t{\n\t\t\tvar svg = new StringBuilder();\n\t\t\tusing (var point = path.Points.GetEnumerator())\n\t\t\t{\n\t\t\t\tpoint.MoveNext();\n\t\t\t\tvar first = point.Current;\n\t\t\t\tsvg.MoveTo(first.Point);\n\t\t\t\tvar previous = first;\n\t\t\t\twhile (point.MoveNext())\n\t\t\t\t{\n\t\t\t\t\tsvg.Append(PointToSvg(previous, point.Current));\n\t\t\t\t\tprevious = point.Current;\n\t\t\t\t}\n\t\t\t\tif (path.IsClosed)\n\t\t\t\t{\n\t\t\t\t\tsvg.Append(PointToSvg(previous, first));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn svg.ToString();\n\t\t}\n\n\t\tprivate static string PointToSvg(SketchCurvePoint previous, SketchCurvePoint current)\n\t\t{\n\t\t\tvar svg = new StringBuilder();\n\t\t\tif (previous.Mode == SketchCurvePoint.CurveMode.Line &&\n\t\t\t\tcurrent.Mode == SketchCurvePoint.CurveMode.Line)\n\t\t\t{\n\t\t\t\tsvg.LineTo(current.Point);\n\t\t\t}\n\t\t\telse if (previous.Mode != SketchCurvePoint.CurveMode.Line\n\t\t\t\t\t && !current.HasCurveTo)\n\t\t\t{\n\t\t\t\t// We only have one control point and the simplest solution would be a\n\t\t\t\t// quadratic Bezier curve represented with the Q format in SVG\n\t\t\t\t// UX path currently doesn't support Q-format, so we have to calculate\n\t\t\t\t// the control points for a cubic Bezier curve.\n\t\t\t\t// 2017-11-28 anette\n\t\t\t\tvar c0 = previous.Point + (previous.CurveFrom - previous.Point) * 2.0 / 3.0;\n\t\t\t\tvar c1 = current.Point + (previous.CurveFrom - current.Point) * 2.0 / 3.0;\n\t\t\t\tsvg.CubicBezierTo(c0, c1, current.Point);\n\t\t\t}\n\t\t\telse if (current.Mode != SketchCurvePoint.CurveMode.Line &&\n\t\t\t\t\t !previous.HasCurveFrom)\n\t\t\t{\n\t\t\t\t// See comment above about quadratic vs cubic Bezier curves\n\t\t\t\tvar c0 = previous.Point + (current.CurveTo - previous.Point) * 2.0 / 3.0;\n\t\t\t\tvar c1 = current.Point + (current.CurveTo - current.Point) * 2.0 / 3.0;\n\t\t\t\tsvg.CubicBezierTo(c0, c1, current.Point);\n\t\t\t}\n\t\t\telse if (previous.Mode != SketchCurvePoint.CurveMode.Line\n\t\t\t\t\t && current.HasCurveTo)\n\t\t\t{\n\t\t\t\tsvg.CubicBezierTo(previous.CurveFrom, current.CurveTo, current.Point);\n\t\t\t}\n\t\t\treturn svg.ToString();\n\t\t}\n\n\t\tpublic static string CoordinatesToSvg(SketchPoint point)\n\t\t{\n\t\t\t//Due to floating point precision, we don't want to write the final digits, to avoid slight changes to the generated ux on different systems\n\t\t\t//The choice of 13 is arbitrary.\n\t\t\treturn point.X.ToString(\"G13\",CultureInfo.InvariantCulture) + \" \" + point.Y.ToString(\"G13\",CultureInfo.InvariantCulture);\n\t\t}\n\n\t\tprivate static void CubicBezierTo(this StringBuilder svgString,\n\t\t\t\t\t\t\t\t\t\t  SketchPoint c0,\n\t\t\t\t\t\t\t\t\t\t  SketchPoint c1,\n\t\t\t\t\t\t\t\t\t\t  SketchPoint endPoint)\n\t\t{\n\t\t\tsvgString.Append(\" C \")\n\t\t\t\t\t .Append(CoordinatesToSvg(c0))\n\t\t\t\t\t .Append(\" \")\n\t\t\t\t\t .Append(CoordinatesToSvg(c1))\n\t\t\t\t\t .Append(\" \")\n\t\t\t\t\t .Append(CoordinatesToSvg(endPoint));\n\t\t}\n\n\t\tprivate static void LineTo(this StringBuilder svgString,\n\t\t\t\t\t\t\t\t   SketchPoint to)\n\t\t{\n\t\t\tsvgString.Append(\" L \")\n\t\t\t\t\t .Append(CoordinatesToSvg(to));\n\t\t}\n\n\t\tprivate static void MoveTo(this StringBuilder svgString,\n\t\t\t\t\t\t\t\t   SketchPoint to)\n\t\t{\n\t\t\tsvgString.Append(\"M \")\n\t\t\t\t\t .Append(CoordinatesToSvg(to));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/SymbolClassNameBuilder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic class SymbolClassNameBuilder\n\t{\n\t\tprivate const string Prefix = \"Sketch\";\n\t\tprivate readonly Dictionary<Guid, string> _symbolClasses = new Dictionary<Guid, string>();\n\n\t\tpublic void Init(IEnumerable<SketchSymbolMaster> symbols)\n\t\t{\n\t\t\tforeach (var symbol in symbols)\n\t\t\t{\n\t\t\t\tAdd(symbol);\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetClassName(SketchSymbolMaster symbolMaster)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn _symbolClasses[symbolMaster.SymbolId];\n\t\t\t}\n\t\t\tcatch (KeyNotFoundException)\n\t\t\t{\n\t\t\t\tthrow new UxBuilderException(\"Could not find symbol master '\" + symbolMaster.Name + \"' (SymbolId '\"+ symbolMaster.SymbolId +\"').\");\n\t\t\t}\n\t\t}\n\n\t\tpublic string GetClassName(SketchSymbolInstance symbolInstance)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn _symbolClasses[symbolInstance.SymbolId];\n\t\t\t}\n\t\t\tcatch (KeyNotFoundException)\n\t\t\t{\n\t\t\t\tthrow new UxBuilderException(\"The symbol '\" + symbolInstance.Name + \"' is an instance of a symbol we can't find. Could it be that it's defined in another Sketch file? That is currently not supported. (SymbolId '\" + symbolInstance.SymbolId + \"')\");\n\t\t\t}\n\t\t}\n\n\t\tprivate void Add(SketchSymbolMaster symbol)\n\t\t{\n\t\t\t_symbolClasses.Add(symbol.SymbolId, Prefix + \".\" + symbol.Name);\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/SymbolsUxBuilder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\nusing SketchConverter.Transforms;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic class SymbolsUxBuilder : IUxBuilder\n\t{\n\t\tprivate readonly ILogger _log;\n\n\t\tpublic SymbolsUxBuilder(ILogger log)\n\t\t{\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic void Build(SketchDocument document, string outputDirectory)\n\t\t{\n\t\t\tvar symbols = document\n\t\t\t\t.Pages\n\t\t\t\t.AsEnumerable()\n\t\t\t\t.SelectMany(page => page.Layers.OfType<SketchSymbolMaster>())\n\t\t\t\t.Where(s => NameIsValidOrLog(s.Name))\n\t\t\t\t.ToList();\n\n\t\t\t//We don't actually need to remove duplicates, since the ux builder will overwrite symbols with the same name anyway.\n\t\t\tLogDuplicateSymbolNames(symbols);\n\n\t\t\tif (!symbols.Any())\n\t\t\t{\n\t\t\t\t_log.Info(\"No UX generated because no Sketch symbols found in sketch file. Sketchy :)\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar symbolClassNameBuilder = new SymbolClassNameBuilder();\n\t\t\tsymbolClassNameBuilder.Init(symbols);\n\n\t\t\tvar builder = new UxBuilder(symbolClassNameBuilder, new AssetEmitter(outputDirectory, _log),  _log);\n\t\t\tvar serializerContext = new UxSerializerContext();\n\n\t\t\t// write one file per uxClass\n\t\t\tforeach (var symbol in symbols)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar uxClass = builder.BuildSymbolClass(symbol);\n\t\t\t\t\tApplyTransforms(uxClass);\n\t\t\t\t\tvar ux = uxClass.SerializeUx(serializerContext);\n\t\t\t\t\tvar className = uxClass.Attributes[\"ux:Class\"] as UxString;\n\t\t\t\t\tif (className != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (symbol.Layers.Any())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar outputFilePath = Path.Combine(outputDirectory, className.Value + \".ux\");\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tFile.WriteAllText(outputFilePath, ux);\n\t\t\t\t\t\t\t\t_log.Info($\"Wrote '{className.Value}' to '{outputFilePath}'\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t_log.Error(\"Can't write file '\" + outputFilePath + \"' \" + e.Message);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_log.Warning($\"Skipping symbol '{className.Value}' which has no supported layers.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_log.Error(\"Can't write file for ux:Class without name\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\t_log.Error(\"Failed to convert '\" + symbol.Name + \"': \" + e.Message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void ApplyTransforms(UxNode uxClass)\n\t\t{\n\t\t\tvar transforms = new ITransform[] {new TextPropertyTransform(_log)};\n\t\t\tforeach (var transform in transforms)\n\t\t\t{\n\t\t\t\ttransform.Apply(uxClass);\n\t\t\t}\n\t\t}\n\n\t\tprivate bool NameIsValidOrLog(string name)\n\t\t{\n\t\t\tvar validity = NameValidator.NameIsValid(name);\n\t\t\tif (validity == NameValidity.InvalidCharacter)\n\t\t\t{\n\t\t\t\t_log.Error($\"The symbol name '{name}' contains an invalid character. Please only use the letters a-z, numbers, or underscores, and don't start the name with a number.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (validity == NameValidity.InvalidKeyword)\n\t\t\t{\n\t\t\t\t_log.Error($\"The symbol name '{name}' is a reserved word. Please choose another name.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate void LogDuplicateSymbolNames(IEnumerable<SketchSymbolMaster> symbols)\n\t\t{\n\t\t\tvar seen = new HashSet<string>();\n\t\t\tforeach (var symbol in symbols)\n\t\t\t{\n\t\t\t\tif (seen.Contains(symbol.Name))\n\t\t\t\t{\n\t\t\t\t\t_log.Error($\"More than one symbol named '{symbol.Name}' was found! Only generating ux for one of them. Please make sure symbol names are unique.\");\n\t\t\t\t}\n\t\t\t\tseen.Add(symbol.Name);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/UXBuilder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\nusing SketchConverter.SketchParser;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverter.UxBuilder\n{\n\tpublic class UxBuilder\n\t{\n\t\tprivate readonly ILogger _log;\n\t\tprivate readonly SymbolClassNameBuilder _symbolClassNameBuilder;\n\t\tprivate readonly IAssetEmitter _assetEmitter;\n\n\t\tpublic UxBuilder(SymbolClassNameBuilder symbolClassNameBuilder, IAssetEmitter assetEmitter, ILogger log)\n\t\t{\n\t\t\t_symbolClassNameBuilder = symbolClassNameBuilder;\n\t\t\t_assetEmitter = assetEmitter;\n\t\t\t_log = log;\n\t\t}\n\n\t\tpublic UxNode BuildSymbolClass(SketchSymbolMaster symbol)\n\t\t{\n\t\t\tvar symbolClassNode = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Panel\",\n\t\t\t\tSketchLayerName = symbol.Name,\n\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable> {\n\t\t\t\t\t{\"ux:Class\", new UxString(_symbolClassNameBuilder.GetClassName(symbol))},\n\t\t\t\t\t{\"Width\", UxSize.Points((float) symbol.Frame.Width)},\n\t\t\t\t\t{\"Height\", UxSize.Points((float) symbol.Frame.Height)}\n\t\t\t\t}\n\t\t\t};\n\t\t\tAddChildrenLayers(symbolClassNode, symbol);\n\t\t\treturn symbolClassNode;\n\t\t}\n\n\t\tpublic UxNode BuildPage(SketchLayer parent)\n\t\t{\n\t\t\tvar pageNode = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Panel\",\n\t\t\t\tSketchLayerName = parent.Name,\n\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable> {\n\t\t\t\t\t{\"ClipToBounds\", new UxString(\"true\")}\n\t\t\t\t}\n\t\t\t};\n\t\t\tAddChildrenLayers(pageNode, parent);\n\t\t\treturn pageNode;\n\t\t}\n\n\t\t//Public just for tests\n\t\tpublic UxNode BuildLayer(SketchLayer layer)\n\t\t{\n\t\t\tvar node = BuildLayerInternal(layer);\n\n\t\t\tlayer.Style.Do(style =>\n\t\t\t\tstyle.Opacity.Where(opacity => opacity < 1).Do(opacity =>\n\t\t\t\t\tnode.Attributes[\"Opacity\"] = new UxFloat((float) opacity)));\n\n\t\t\tif (layer.Layers.Any())\n\t\t\t{\n\t\t\t\tvar hasMaskedChild = HasMaskedChild(layer);\n\t\t\t\tif (hasMaskedChild) AddUnsupportedMaskingWarning(node, layer.Name);\n\n\t\t\t\t// Skip processing children if we found a direct child that is a mask. 2017-12-12 anette\n\t\t\t\t// SketchShapeGroup is a SketchParentLayer but BuildShapeGroup handles it's own children.\n\t\t\t\t// This is inconsistent and should be cleaned up. 2017-12-06 anette\n\t\t\t\tif(!hasMaskedChild && !(layer is SketchShapeGroup))\n\t\t\t\t{\n\t\t\t\t\tvar children = layer.Layers\n\t\t\t\t\t\t.Select(BuildLayer)\n\t\t\t\t\t\t.ToList();\n\n\t\t\t\t\tchildren.Reverse();\n\n\t\t\t\t\tnode.Children.AddRange(children);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Flip and rotate the panel. Order of transformations matter,\n\t\t\t// we first flip (done by rotating 180 around the X/Y-axis),\n\t\t\t// then the actual rotation (around the implicit Z-axis)\n\t\t\tif (layer.IsFlippedVertical)\n\t\t\t{\n\t\t\t\tnode.Children.Add(new UxRotation(180, UxRotation.RotationAxis.X));\n\t\t\t}\n\t\t\tif (layer.IsFlippedHorizontal)\n\t\t\t{\n\t\t\t\tnode.Children.Add(new UxRotation(180, UxRotation.RotationAxis.Y));\n\t\t\t}\n\t\t\tif (!layer.Rotation.Equals(0))\n\t\t\t{\n\t\t\t\tnode.Children.Add(new UxRotation(layer.Rotation));\n\t\t\t}\n\n\n\t\t\tnode.Children.Insert(0, new UxComment(layer.Name));\n\n\t\t\treturn node;\n\t\t}\n\n\t\tprivate void AddUnsupportedMaskingWarning(UxNode node, string layerName)\n\t\t{\n\t\t\t_log.Warning(\"Masked shapes are not supported \" + layerName);\n\t\t\tnode.Children.Add(new UxComment(\"Masked shape group is not supported in UX\"));\n\t\t}\n\n\t\tprivate static bool HasMaskedChild(SketchLayer parent)\n\t\t{\n\t\t\tvar hasMaskChild = parent.Layers\n\t\t\t\t.Select(l => l as SketchShapeGroup)\n\t\t\t\t.Where(l => l != null)\n\t\t\t\t.Any(sg => sg.HasClippingMask);\n\n\t\t\treturn hasMaskChild;\n\t\t}\n\n\t\tUxNode BuildLayerInternal(SketchLayer layer)\n\t\t{\n\t\t\tvar group = layer as SketchGroup;\n\t\t\tif (group != null)\n\t\t\t{\n\t\t\t\treturn BuildGroup(group);\n\t\t\t}\n\n\t\t\tvar rectangle = layer as SketchRectangle;\n\t\t\tif (rectangle != null)\n\t\t\t{\n\t\t\t\treturn BuildRectangle(rectangle);\n\t\t\t}\n\n\t\t\tvar shapeGroup = layer as SketchShapeGroup;\n\t\t\tif (shapeGroup != null)\n\t\t\t{\n\t\t\t\treturn BuildShapeGroup(shapeGroup);\n\t\t\t}\n\n\t\t\tvar bitmap = layer as SketchBitmap;\n\t\t\tif (bitmap != null)\n\t\t\t{\n\t\t\t\treturn BuildBitmap(bitmap);\n\t\t\t}\n\n\t\t\tvar text = layer as SketchText;\n\t\t\tif (text != null)\n\t\t\t{\n\t\t\t\treturn BuildText(text);\n\t\t\t}\n\n\t\t\tvar symbolInstance = layer as SketchSymbolInstance;\n\t\t\tif (symbolInstance != null)\n\t\t\t{\n\t\t\t\treturn BuildSymbolInstance(symbolInstance);\n\t\t\t}\n\n\t\t\tvar shapePath = layer as SketchShapePath;\n\t\t\tif (shapePath != null)\n\t\t\t{\n\t\t\t\treturn BuildShapePath(shapePath);\n\t\t\t}\n\n\t\t\tvar warning = $\"Unimplemented layer type: {layer.GetType().Name}\";\n\t\t\t_log.Warning(warning);\n\t\t\tvar groupNode = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Panel\",\n\t\t\t\tSketchLayerName = layer.Name\n\t\t\t};\n\t\t\tgroupNode.Children.Add(new UxComment(warning));\n\t\t\treturn groupNode;\n\t\t}\n\n\t\tprivate UxNode BuildShapePath(SketchShapePath shapePath)\n\t\t{\n\t\t\tvar svgString = SketchCurvePointsToSvg.ToSvgString(shapePath.Path);\n\t\t\tvar node = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Path\",\n\t\t\t\tSketchLayerName = shapePath.Name,\n\t\t\t\tAttributes =\n\t\t\t\t{\n\t\t\t\t\t[\"Data\"] = new UxString(svgString),\n\t\t\t\t\t[\"StretchMode\"] = new UxString(\"Fill\")\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn BuildLayout(shapePath, node);\n\t\t}\n\n\t\tprivate UxNode BuildSymbolInstance(SketchSymbolInstance symbolInstance)\n\t\t{\n\t\t\tvar className = _symbolClassNameBuilder.GetClassName(symbolInstance);\n\t\t\tvar node = new UxNode {\n\t\t\t\tClassName = className,\n\t\t\t\tSketchLayerName = symbolInstance.Name\n\t\t\t};\n\n\t\t\treturn BuildLayout(symbolInstance, node);\n\t\t}\n\n\t\tUxNode BuildGroup(SketchGroup group)\n\t\t{\n\t\t\tif (group.Layers.Count == 0)\n\t\t\t{\n\t\t\t\treturn new NullNode(new UxComment(\"Skipped empty group '\" + group.Name + \"'\"));\n\t\t\t}\n\t\t\tvar node = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Panel\",\n\t\t\t\tSketchLayerName = group.Name\n\t\t\t};\n\t\t\treturn BuildLayout(group, node);\n\t\t}\n\n\t\tUxNode BuildRectangle(SketchRectangle rectangle)\n\t\t{\n\t\t\t// Is axis aligned rectangle\n\t\t\tif (rectangle.Path == null)\n\t\t\t\tthrow new SketchParserException(\"Rectangle has no path\");\n\t\t\tif (rectangle.Path.Points == null)\n\t\t\t\tthrow new SketchParserException(\"Rectangle.Path has no points\");\n\t\t\tif (Geometry.IsAxisAlignedRectangle(rectangle.Path))\n\t\t\t{\n\t\t\t\t// Create a Ux Rectangle if we have an axis aligned quadrilateral\n\t\t\t\tvar node = new UxNode\n\t\t\t\t{\n\t\t\t\t\tClassName = \"Rectangle\",\n\t\t\t\t\tSketchLayerName = rectangle.Name\n\t\t\t\t};\n\t\t\t\tif (rectangle.Path.Points.Any(p => p.CornerRadius > 0.0))\n\t\t\t\t{\n\t\t\t\t\tvar cr = rectangle.Path.Points.Select(p => p.CornerRadius).ToList();\n\t\t\t\t\tnode.Attributes[\"CornerRadius\"]\n\t\t\t\t\t\t= new UxFloat4(\n\t\t\t\t\t\t\t(float) cr[0],\n\t\t\t\t\t\t\t(float) cr[1],\n\t\t\t\t\t\t\t(float) cr[2],\n\t\t\t\t\t\t\t(float) cr[3]\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn BuildLayout(rectangle, node);\n\t\t\t}\n\t\t\t// transformed rectangle, not axis aligned anymore or have less than or\n\t\t\t// more than four corners\n\t\t\treturn BuildShapePath(rectangle);\n\t\t}\n\n\n\n\t\tUxNode BuildShapeGroup(SketchShapeGroup shapeGroupLayer)\n\t\t{\n\t\t\tvar groupNode = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Panel\",\n\t\t\t\tSketchLayerName = shapeGroupLayer.Name\n\t\t\t};\n\n\t\t\tif (shapeGroupLayer.Layers.Count == 0)\n\t\t\t{\n\t\t\t\t_log.Warning($\"Shape group {shapeGroupLayer.Name} has no layers\");\n\t\t\t\treturn groupNode;\n\t\t\t}\n\n\t\t\t// Warn if we have any combined shapes, as it is currently not supported\n\t\t\tvar combinedShapes = shapeGroupLayer\n\t\t\t                     .Layers.Cast<SketchShapePath>()\n\t\t\t                     .Where(shape => shape.BooleanOperation !=\n\t\t\t                                     SketchBooleanOperation.NoOperation);\n\t\t\tif (combinedShapes.Any())\n\t\t\t{\n\t\t\t\tgroupNode.Children.Add(new UxComment(\"Combined shapes are not supported in UX\"));\n\t\t\t\t_log.Warning(\"Combined shapes are not supported \" + shapeGroupLayer.Name + \" with \" + combinedShapes.Count() + \" number of combined layers\");\n\t\t\t\treturn groupNode;\n\t\t\t}\n\n\t\t\tvar shapeNodes = shapeGroupLayer\n\t\t\t                 .Layers\n\t\t\t                 .Cast<SketchShapePath>()\n\t\t\t                 .Where(shape => shape.BooleanOperation ==\n\t\t\t                                 SketchBooleanOperation.NoOperation)\n\t\t\t                 .Select(BuildLayer);\n\t\t\tforeach (var shapeNode in shapeNodes)\n\t\t\t{\n\t\t\t\tApplyShapeStyle(shapeGroupLayer, shapeNode);\n\t\t\t\tgroupNode.Children.Add(shapeNode);\n\t\t\t}\n\n\t\t\treturn BuildLayout(shapeGroupLayer, groupNode);\n\t\t}\n\n\t\tUxNode BuildText(SketchText text)\n\t\t{\n\t\t\tvar uxNode = new UxNode {\n\t\t\t\tClassName=\"Text\",\n\t\t\t\tSketchLayerName = text.Name\n\t\t\t};\n\n\t\t\tif (text.AttributedString.Attributes.Count > 1)\n\t\t\t{\n\t\t\t\t_log.Warning($\"UX Builder: Multiple text styles on the same text element not supported in UX. Found {text.AttributedString.Attributes.Count} text styles on {text.Name}, using just one of them.\");\n\t\t\t}\n\t\t\tvar stringAttributes = text.AttributedString.Attributes.First();\n\n\t\t\tuxNode.Attributes[\"Color\"] = SketchColorToFloat4(stringAttributes.Color);\n\t\t\tuxNode.Attributes[\"FontSize\"] = new UxFloat((float)stringAttributes.FontSize);\n\t\t\tuxNode.Attributes[\"Value\"] = new UxString(text.AttributedString.Contents);\n\t\t\tuxNode.Attributes[\"TextTruncation\"] = new UxString(\"None\");\n\t\t\tuxNode.Attributes[\"TextWrapping\"] = new UxString(\"Wrap\");\n\n\t\t\tif (stringAttributes.Alignment != SketchTextAlignment.Left)\n\t\t\t{\n\t\t\t\tuxNode.Attributes[\"TextAlignment\"] = new UxString(BuildTextAlignment(stringAttributes.Alignment));\n\t\t\t}\n\n\t\t\tuxNode.Children.AddRange(BuildShadows(text.Name, text.Style));\n\n\t\t\tif (text.Style.Borders.Count > 0)\n\t\t\t{\n\t\t\t\t_log.Warning($\"UX Builder: Borders on Sketch texts not supported in UX (Sketch object: {text.Name}).\");\n\t\t\t}\n\n\t\t\tif (text.Style.Fills.Count > 0)\n\t\t\t{\n\t\t\t\t_log.Warning($\"UX Builder: Fills on Sketch texts not supported in UX (Sketch object: {text.Name}). Using text style color instead.\");\n\t\t\t}\n\n\t\t\treturn BuildLayout(text, uxNode);\n\t\t}\n\n\t\tprivate IEnumerable<IUxSerializeable> BuildShadows(string layerName, SketchStyle style)\n\t\t{\n\t\t\treturn style.Shadows\n\t\t\t\t.Where(x => x.IsEnabled)\n\t\t\t\t.Select(x => BuildShadow(x, true))\n\t\t\t\t.Concat(InnerShadowWarning(layerName, style.InnerShadows.Count));\n\t\t}\n\n\t\tprivate IEnumerable<IUxSerializeable> InnerShadowWarning(string layerName, int numInnerShadows)\n\t\t{\n\t\t\tif (numInnerShadows > 0)\n\t\t\t{\n\t\t\t\t_log.Warning(\n\t\t\t\t\t$\"UX Builder: Inner shadows not supported. {layerName} has {numInnerShadows} shadow\" +\n\t\t\t\t\t(numInnerShadows > 1 ? \"s.\" : \".\"));\n\t\t\t\tyield return new UxComment(\"Inner shadow not supported in UX\");\n\t\t\t}\n\t\t}\n\n\t\tstring BuildTextAlignment(SketchTextAlignment alignment)\n\t\t{\n\t\t\tswitch (alignment)\n\t\t\t{\n\t\t\t\tcase SketchTextAlignment.Center: return \"Center\";\n\t\t\t\tcase SketchTextAlignment.Right: return \"Right\";\n\t\t\t\tdefault: return \"Left\";\n\t\t\t}\n\t\t}\n\n\t\tprivate void AddChildrenLayers(UxNode node, SketchLayer parent)\n\t\t{\n\t\t\tvar hasMaskedChildLayer = HasMaskedChild(parent);\n\t\t\tif (hasMaskedChildLayer)\n\t\t\t{\n\t\t\t\t_log.Warning(\"Masked shapes are not supported \" + parent.Name);\n\t\t\t\tnode.Children.Add(new UxComment(\"Masked shape group is not supported in UX\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnode.Children = parent.Layers\n\t\t\t\t\t.AsEnumerable()\n\t\t\t\t\t.Reverse()\n\t\t\t\t\t.Select(BuildLayer)\n\t\t\t\t\t.Cast<IUxSerializeable>()\n\t\t\t\t\t.ToList();\n\t\t\t}\n\t\t}\n\n\t\tUxNode BuildLayout(SketchLayer layer, UxNode targetNode)\n\t\t{\n\t\t\treturn new LayoutBuilder(layer).Build(targetNode);\n\t\t}\n\n\t\treadonly HashSet<string> _exportedAssets = new HashSet<string>();\n\n\t\tvoid ExportImage(SketchImage image)\n\t\t{\n\t\t\tif (_exportedAssets.Contains(image.Path))\n\t\t\t\treturn;\n\n\t\t\t_exportedAssets.Add(image.Path);\n\t\t\t_assetEmitter.Write(image);\n\t\t}\n\n\t\tUxNode BuildBitmap(SketchBitmap bitmap)\n\t\t{\n\t\t\tvar imagePath = bitmap.Image.Path;\n\t\t\tExportImage(bitmap.Image);\n\n\t\t\tvar imageNode = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Image\",\n\t\t\t\tSketchLayerName = bitmap.Name,\n\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable>\n\t\t\t\t{\n\t\t\t\t\t{\"File\", new UxString(imagePath)}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\timageNode.Children.AddRange(BuildShadows(bitmap.Name, bitmap.Style));\n\n\t\t\treturn BuildLayout(bitmap, imageNode);\n\t\t}\n\n\t\tUxNode BuildSolidColorBrush(SketchSolidColorBrush brush)\n\t\t{\n\t\t\treturn new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"SolidColor\",\n\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable>()\n\t\t\t\t{\n\t\t\t\t\t{ \"Color\", SketchColorToFloat4(brush.Color) }\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tUxNode BuildLinearGradientBrush(SketchLinearGradientBrush brush)\n\t\t{\n\t\t\treturn new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"LinearGradient\",\n\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable>\n\t\t\t\t{\n\t\t\t\t\t{\"StartPoint\", SketchPointToFloat2(brush.From)},\n\t\t\t\t\t{\"EndPoint\", SketchPointToFloat2(brush.To)}\n\t\t\t\t},\n\t\t\t\tChildren = brush.Stops.Select(stop => new UxNode\n\t\t\t\t{\n\t\t\t\t\tClassName = \"GradientStop\",\n\t\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable>\n\t\t\t\t\t{\n\t\t\t\t\t\t{\"Color\", SketchColorToFloat4(stop.Color)},\n\t\t\t\t\t\t{\"Offset\", new UxFloat((float)stop.Position)}\n\t\t\t\t\t}\n\t\t\t\t}).Cast<IUxSerializeable>().ToList()\n\t\t\t};\n\t\t}\n\n\t\tUxNode BuildBrush(ISketchBrush brush)\n\t\t{\n\t\t\tvar solidColorBrush = brush as SketchSolidColorBrush;\n\t\t\tif (solidColorBrush != null)\n\t\t\t{\n\t\t\t\treturn BuildSolidColorBrush(solidColorBrush);\n\t\t\t}\n\n\t\t\tvar linearGradientBrush = brush as SketchLinearGradientBrush;\n\t\t\tif (linearGradientBrush != null)\n\t\t\t{\n\t\t\t\treturn BuildLinearGradientBrush(linearGradientBrush);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tUxNode BuildShadow(SketchShadow shadow, bool perPixel)\n\t\t{\n\t\t\tvar dx = shadow.Offset.X;\n\t\t\tvar dy = shadow.Offset.Y;\n\t\t\t// atan2 will give us the angle in the correct quadrant with cartesian coordinates.\n\t\t\t// Sketch uses screen coordinates which resulted in the shadow being flipped in the X-direction\n\t\t\t// We therefore call atan2 with -dx. This gives us the right result. 2018-02-05 anette\n\t\t\tvar angle = (180 / Math.PI) * Math.Atan2(dy, -dx);\n\t\t\tvar distance = Math.Sqrt(dx*dx + dy*dy);\n\n\t\t\tvar node = new UxNode\n\t\t\t{\n\t\t\t\tClassName = \"Shadow\",\n\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable>\n\t\t\t\t{\n\t\t\t\t\t{\"Angle\", new UxFloat((float) angle)},\n\t\t\t\t\t{\"Distance\", new UxFloat((float) distance)},\n\t\t\t\t\t{\"Color\", SketchColorToFloat4(shadow.Color)},\n\t\t\t\t\t{\"Size\", new UxFloat((float) shadow.BlurRadius)}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif(perPixel)\n\t\t\t{\n\t\t\t\tnode.Attributes[\"Mode\"] = new UxString(\"PerPixel\");\n\t\t\t}\n\n\t\t\treturn node;\n\t\t}\n\n\t\tvoid ApplyShapeStyle(SketchShapeGroup layer, UxNode targetNode)\n\t\t{\n\t\t\tvar style = layer.Style;\n\n\t\t\tif (style.Blur.HasValue)\n\t\t\t{\n\t\t\t\t_log.Warning($\"Skipping {style.Blur.Value.BlurType} blur on {layer.Name}. Not supported in UX\");\n\t\t\t}\n\n\t\t\ttargetNode.Children.AddRange(BuildShadows(layer.Name, layer.Style));\n\n\t\t\tvar fillNodes = style.Fills\n\t\t\t\t.Where(fill => fill.IsEnabled)\n\t\t\t\t.Select(x => BuildBrush(x.Brush));\n\t\t\ttargetNode.Children.AddRange(fillNodes);\n\n\t\t\tvar strokeNodes = style.Borders\n\t\t\t\t.Where(border => border.IsEnabled)\n\t\t\t\t.Select(border => new UxNode\n\t\t\t\t{\n\t\t\t\t\tClassName = \"Stroke\",\n\t\t\t\t\tAttributes = new Dictionary<string, IUxSerializeable>\n\t\t\t\t\t{\n\t\t\t\t\t\t{\"Width\", new UxFloat((float) border.Thickness)},\n\t\t\t\t\t\t{\"Alignment\", new UxString(border.Position.ToString())}\n\t\t\t\t\t},\n\t\t\t\t\tChildren = new List<IUxSerializeable> {BuildBrush(border.Brush)}\n\t\t\t\t});\n\t\t\ttargetNode.Children.AddRange(strokeNodes);\n\t\t}\n\n\t\tUxFloat4 SketchColorToFloat4(SketchColor color)\n\t\t{\n\t\t\treturn new UxFloat4(\n\t\t\t\t(float)color.Red,\n\t\t\t\t(float)color.Green,\n\t\t\t\t(float)color.Blue,\n\t\t\t\t(float)color.Alpha\n\t\t\t);\n\t\t}\n\n\t\tUxFloat2 SketchPointToFloat2(SketchPoint point)\n\t\t{\n\t\t\treturn new UxFloat2(\n\t\t\t\t(float)point.X,\n\t\t\t\t(float)point.Y\n\t\t\t);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/UXNode.cs",
    "content": "﻿using System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Linq;\n\nnamespace SketchImporter.UxGenerator\n{\n\tpublic class UxSerializerContext\n\t{\n\t\tpublic int IndentLevel { get; set; } = 0;\n\t\tpublic string SingleIndent { get; set; } = \"\\t\";\n\n\t\tpublic string Indentation\n\t\t{\n\t\t\tget {\n\t\t\t\tvar indent = \"\";\n\t\t\t\tfor (var i = 0; i < IndentLevel; ++i) {\n\t\t\t\t\tindent += SingleIndent;\n\t\t\t\t}\n\t\t\t\treturn indent;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Indent(string str)\n\t\t{\n\t\t\treturn Indentation + str;\n\t\t}\n\n\t\tpublic UxSerializerContext WithIndent(int relativeIndentLevel = 1)\n\t\t{\n\t\t\treturn new UxSerializerContext\n\t\t\t{\n\t\t\t\tIndentLevel = IndentLevel + relativeIndentLevel,\n\t\t\t\tSingleIndent = SingleIndent\n\t\t\t};\n\t\t}\n\n\t\tpublic UxSerializerContext WithUnindent(int relativeIndentLevel = 1) => WithIndent(-relativeIndentLevel);\n\t}\n\n\tpublic interface IUxSerializeable\n\t{\n\t\tstring SerializeUx(UxSerializerContext ctx);\n\t}\n\n\t[DebuggerDisplay(\"{Value}\")]\n\tpublic class UxString : IUxSerializeable\n\t{\n\t\tpublic string Value;\n\t\tpublic UxString(string value) { Value = value; }\n\t\tpublic string SerializeUx(UxSerializerContext ctx) => Value;\n\t}\n\n\tstatic class UxSerializationHelpers\n\t{\n\t\tpublic static string SerializeComponentFloatExact(params float[] components)\n\t\t\t=> string.Join(\", \", components.Select(x => x.ToString(CultureInfo.InvariantCulture)));\n\n\t\tpublic static string SerializeComponentFloat(params float[] components)\n\t\t{\n\t\t\tvar canBeFloat2 = components.Length == 4 &&\n\t\t\t\t\t\t\t  components[0].Equals(components[2]) &&\n\t\t\t\t\t\t\t  components[1].Equals(components[3]);\n\n\t\t\tif(canBeFloat2)\n\t\t\t{\n\t\t\t\treturn SerializeComponentFloat(components[0], components[1]);\n\t\t\t}\n\n\t\t\tif(components.Length == 2 && components[0] == components[1])\n\t\t\t{\n\t\t\t\treturn SerializeComponentFloatExact(components[0]);\n\t\t\t}\n\n\t\t\treturn SerializeComponentFloatExact(components);\n\t\t}\n\t}\n\n\t[DebuggerDisplay(\"{X},{Y},{Z},{W}\")]\n\tpublic class UxFloat4 : IUxSerializeable\n\t{\n\t\tpublic float X, Y, Z, W;\n\n\t\tpublic UxFloat4(float x, float y, float z, float w)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t\tZ = z;\n\t\t\tW = w;\n\t\t}\n\n\t\tpublic string SerializeUx(UxSerializerContext ctx) =>\n\t\t\tUxSerializationHelpers.SerializeComponentFloat(X, Y, Z, W);\n\t}\n\n\t[DebuggerDisplay(\"{X},{Y}\")]\n\tpublic class UxFloat2 : IUxSerializeable\n\t{\n\t\tpublic float X, Y;\n\n\t\tpublic UxFloat2(float x, float y)\n\t\t{\n\t\t\tX = x;\n\t\t\tY = y;\n\t\t}\n\n\t\tpublic string SerializeUx(UxSerializerContext ctx) =>\n\t\t\tUxSerializationHelpers.SerializeComponentFloat(X, Y);\n\t}\n\n\t[DebuggerDisplay(\"{Value}\")]\n\tpublic class UxFloat : IUxSerializeable\n\t{\n\t\tpublic float Value;\n\n\t\tpublic UxFloat(float value) { Value = value; }\n\n\t\tpublic string SerializeUx(UxSerializerContext ctx) =>\n\t\t\tUxSerializationHelpers.SerializeComponentFloat(Value);\n\n\t\tpublic static explicit operator UxFloat(float value) => new UxFloat(value);\n\t\tpublic static explicit operator UxFloat(double value) => new UxFloat((float)value);\n\t}\n\n\tpublic class UxVector : IUxSerializeable, IEnumerable<IUxSerializeable>\n\t{\n\t\treadonly List<IUxSerializeable> _components = new List<IUxSerializeable>();\n\t\tpublic IEnumerable<IUxSerializeable> Components => _components;\n\n\t\tpublic UxVector(params IUxSerializeable[] components)\n\t\t{\n\t\t\t_components.AddRange(components);\n\t\t}\n\n\t\tpublic UxVector(params float[] components)\n\t\t{\n\t\t\tnew UxVector(components.Select(x => new UxFloat(x)).ToArray());\n\t\t}\n\n\t\tpublic string SerializeUx(UxSerializerContext ctx)\n\t\t{\n\t\t\treturn string.Join(\", \", Components.Select(x => x.SerializeUx(ctx)));\n\t\t}\n\n\t\tpublic void Append(IUxSerializeable component)\n\t\t{\n\t\t\t_components.Add(component);\n\t\t}\n\n\t\tpublic IEnumerator<IUxSerializeable> GetEnumerator()\n\t\t{\n\t\t\treturn _components.GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator()\n\t\t{\n\t\t\treturn GetEnumerator();\n\t\t}\n\t}\n\n\tpublic enum UxUnit\n\t{\n\t\tPercent,\n\t\tPixels,\n\t\tPoints\n\t}\n\n\t[DebuggerDisplay(\"{Content}\")]\n\tpublic class UxComment : IUxSerializeable\n\t{\n\t\tpublic UxComment(string content)\n\t\t{\n\t\t\tContent = content;\n\t\t}\n\n\t\tpublic string Content { get; set; }\n\n\t\tpublic string SerializeUx(UxSerializerContext ctx)\n\t\t{\n\t\t\treturn ctx.Indent($\"<!-- {Content} -->\");\n\t\t}\n\t}\n\n\t[DebuggerDisplay(\"{X},{Y},{Z}\")]\n\tpublic class UxRotation : IUxSerializeable\n\t{\n\t\tpublic enum RotationAxis\n\t\t{\n\t\t\tX,\n\t\t\tY,\n\t\t\tZ\n\t\t}\n\t\tpublic UxRotation(double degrees, RotationAxis axis = RotationAxis.Z)\n\t\t{\n\t\t\t// Sketch rotates in the oposite direction, so we need the negated value. 2017-12-12 anette\n\t\t\tDegrees = -degrees;\n\t\t\tAxis = axis;\n\t\t}\n\n\t\tpublic double Degrees { get; set; }\n\t\tpublic RotationAxis Axis { get; set; }\n\n\t\tpublic string SerializeUx(UxSerializerContext ctx)\n\t\t{\n\t\t\tstring attributeName;\n\t\t\tswitch (Axis)\n\t\t\t{\n\t\t\t\tcase RotationAxis.X:\n\t\t\t\t\tattributeName = \"DegreesX\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase RotationAxis.Y:\n\t\t\t\t\tattributeName = \"DegreesY\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tattributeName = \"Degrees\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn ctx.Indent($\"<Rotation {attributeName}=\\\"{Degrees}\\\" />\");\n\t\t}\n\t}\n\n\t[DebuggerDisplay(\"{ClassName} (From layer: '{SketchLayerName}')\")]\n\tpublic class UxNode : IUxSerializeable\n\t{\n\t\t//TODO make stuff readonly here, and probably in the rest of the model too. Transforms can instead return new trees.\n\t\tpublic string ClassName { get; set; }\n\t\tpublic string SketchLayerName { get; set; } // TODO I don't like that we're using null to mean \"no layer\" here\n\t\tpublic string UxName { get; set; } = null;\n\t\tpublic Dictionary<string, IUxSerializeable> Attributes { get; set; } = new Dictionary<string, IUxSerializeable>();\n\t\tpublic List<IUxSerializeable> Children { get; set; } = new List<IUxSerializeable>(); //TODO would be much nicer if this was a list of UxNode, then we'd have to cast less (UxComment can inherit UxNode?)\n\n\t\tpublic UxNode() { }\n\n\t\tpublic UxNode(string className) : base()\n\t\t{\n\t\t\tClassName = className;\n\t\t}\n\n\t\tpublic virtual string SerializeUx(UxSerializerContext ctx)\n\t\t{\n\t\t\tvar str = ctx.Indent(\"<\" + ClassName);\n\n\t\t\tif(UxName != null) {\n\t\t\t\tstr += $\" ux:Name=\\\"{UxName}\\\"\";\n\t\t\t}\n\n\t\t\tif (Attributes != null && Attributes.Count > 0)\n\t\t\t{\n\t\t\t\tstr += \" \" + string.Join(\" \", Attributes.Select(x => x.Key + \"=\\\"\" + x.Value.SerializeUx(ctx) + '\"'));\n\t\t\t}\n\n\t\t\tif(Children == null || Children.Count == 0) {\n\t\t\t\treturn str + \" />\";\n\t\t\t}\n\n\t\t\tstr += \">\\n\";\n\t\t\tstr += string.Join(\"\\n\", Children.Select(child => child.SerializeUx(ctx.WithIndent())));\n\t\t\tstr += \"\\n\" + ctx.Indent(\"</\" + ClassName + \">\");\n\n\t\t\treturn str;\n\t\t}\n\t}\n\n\tpublic class NullNode : UxNode\n\t{\n\t\tprivate readonly UxComment _comment;\n\n\t\tpublic NullNode(UxComment comment)\n\t\t{\n\t\t\t_comment = comment;\n\t\t}\n\n\t\tpublic override string SerializeUx(UxSerializerContext ctx)\n\t\t{\n\t\t\treturn _comment.SerializeUx(ctx);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/UxBuilder/UxSize.cs",
    "content": "﻿using System.Diagnostics;\n\nnamespace SketchImporter.UxGenerator\n{\n\t[DebuggerDisplay(\"{Value} {Unit}\")]\n\tpublic class UxSize : IUxSerializeable\n\t{\n\t\tprotected bool Equals(UxSize other)\n\t\t{\n\t\t\treturn Value.Equals(other.Value) && Unit == other.Unit;\n\t\t}\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tif (ReferenceEquals(null, obj)) return false;\n\t\t\tif (ReferenceEquals(this, obj)) return true;\n\t\t\tif (obj.GetType() != this.GetType()) return false;\n\t\t\treturn Equals((UxSize) obj);\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\tunchecked\n\t\t\t{\n\t\t\t\treturn (Value.GetHashCode() * 397) ^ (int) Unit;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Value { get; set; }\n\t\tpublic UxUnit Unit { get; set; } = UxUnit.Points;\n\n\t\tpublic UxSize(float value, UxUnit unit)\n\t\t{\n\t\t\tValue = value;\n\t\t\tUnit = unit;\n\t\t}\n\n\t\tpublic static implicit operator UxSize(UxFloat value) => new UxSize(value.Value, UxUnit.Points);\n\n\t\tUxSize WithValue(float value)\n\t\t{\n\t\t\treturn new UxSize(value, Unit);\n\t\t}\n\n\t\tpublic static UxSize operator *(UxSize size, float factor)\n\t\t\t=> size.WithValue(size.Value * factor);\n\n\t\tpublic static UxSize operator /(UxSize size, float divisor)\n\t\t\t=> size.WithValue(size.Value / divisor);\n\n\t\tpublic static bool operator ==(UxSize a, UxSize b)\n\t\t{\n\t\t\treturn a?.Value == b?.Value\n\t\t\t\t   && a?.Unit == b?.Unit;\n\t\t}\n\n\t\tpublic static bool operator !=(UxSize a, UxSize b)\n\t\t{\n\t\t\treturn !(a == b);\n\t\t}\n\n\t\tpublic static UxSize Points(float value)\n\t\t\t=> new UxSize(value, UxUnit.Points);\n\n\t\tpublic static UxSize Percent(float value)\n\t\t\t=> new UxSize(value, UxUnit.Percent);\n\n\t\tpublic static UxSize Pixels(float value)\n\t\t\t=> new UxSize(value, UxUnit.Pixels);\n\n\t\tstring SerializeUnit()\n\t\t{\n\t\t\tswitch (Unit)\n\t\t\t{\n\t\t\t\tcase UxUnit.Percent:\n\t\t\t\t\treturn \"%\";\n\t\t\t\tcase UxUnit.Pixels:\n\t\t\t\t\treturn \"px\";\n\t\t\t\tcase UxUnit.Points:\n\t\t\t\tdefault:\n\t\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\n\t\tpublic string SerializeUx(UxSerializerContext ctx)\n\t\t{\n\t\t\treturn new UxFloat(Value).SerializeUx(ctx) + SerializeUnit();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Xml.XmlDocument\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.IO.FileSystem.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.0.2.0\" newVersion=\"4.0.2.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/sketch2fuse/SketchConverter/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Mono.Posix-4.5\" version=\"4.5.0\" targetFramework=\"net45\" />\n  <package id=\"plist-cil\" version=\"2.1.0\" targetFramework=\"net46\" />\n  <package id=\"SharpZipLib\" version=\"1.3.3\" targetFramework=\"net46\" />\n  <package id=\"System.Buffers\" version=\"4.4.0\" targetFramework=\"net46\" />\n  <package id=\"System.Diagnostics.Debug\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Globalization\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.IO.FileSystem\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.IO.FileSystem.Primitives\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Linq\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Memory\" version=\"4.5.0\" targetFramework=\"net46\" />\n  <package id=\"System.Reflection\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Reflection.TypeExtensions\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Resources.ResourceManager\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Extensions\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Numerics\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Serialization.Formatters\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.Serialization.Primitives\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Text.RegularExpressions\" version=\"4.3.1\" targetFramework=\"net46\" />\n  <package id=\"System.Threading\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Xml.XmlDocument\" version=\"4.3.0\" targetFramework=\"net46\" />\n  <package id=\"System.Xml.XmlSerializer\" version=\"4.3.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/AttributedStringParserTests.cs",
    "content": "﻿using System.CodeDom;\nusing System.Linq;\nusing NUnit.Framework;\nusing SketchConverter.SketchModel;\nusing SketchConverter.SketchParser;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class AttributedStringParserTests\n\t{\n\t\t[Test]\n\t\tpublic void ParseColoredTextSymbolVersion91()\n\t\t{\n\t\t\t// copy paste of _archive property on archevedAttributedString in TextSymbol from json-dump of TestProject.sketch\n\t\t\t// Sketch version 91\n\t\t\tvar jsonobj = @\"YnBsaXN0MDDUAQIDBAUGZ2hYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QGQcIDxAcHR4fJysyNT9CRUlNVVZXWFldYWNVJG51bGzTCQoLDA0OWE5TU3RyaW5nViRjbGFzc1xOU0F0dHJpYnV0ZXOAAoAYgANSQWHTERIKExcbV05TLmtleXNaTlMub2JqZWN0c6MUFRaABIAFgAajGBkagAeAC4APgBdXTlNDb2xvcl8QEE5TUGFyYWdyYXBoU3R5bGVfEB9NU0F0dHJpYnV0ZWRTdHJpbmdGb250QXR0cmlidXRl1CAhIgojJCUmVU5TUkdCXE5TQ29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZUYxIDEgMQAQAYAIgArSKAopKlROU0lEEAGACdIsLS4vWiRjbGFzc25hbWVYJGNsYXNzZXNcTlNDb2xvclNwYWNlojAxXE5TQ29sb3JTcGFjZVhOU09iamVjdNIsLTM0V05TQ29sb3KiMzHVNjcKODk6Ozw9PVpOU1RhYlN0b3BzW05TQWxpZ25tZW50XE5TVGV4dEJsb2Nrc1tOU1RleHRMaXN0c4AAEAKADoAMgAzSEgpAQaCADdIsLUNEV05TQXJyYXmiQzHSLC1GR18QF05TTXV0YWJsZVBhcmFncmFwaFN0eWxlo0ZIMV8QEE5TUGFyYWdyYXBoU3R5bGXSCkpLTF8QGk5TRm9udERlc2NyaXB0b3JBdHRyaWJ1dGVzgBaAENMREgpOUVSiT1CAEYASolJTgBOAFIAVXxATTlNGb250U2l6ZUF0dHJpYnV0ZV8QE05TRm9udE5hbWVBdHRyaWJ1dGUjQDAAAAAAAABdSGVsdmV0aWNhTmV1ZdIsLVpbXxATTlNNdXRhYmxlRGljdGlvbmFyeaNaXDFcTlNEaWN0aW9uYXJ50iwtXl9fEBBOU0ZvbnREZXNjcmlwdG9yomAxXxAQTlNGb250RGVzY3JpcHRvctIsLVxiolwx0iwtZGVfEBJOU0F0dHJpYnV0ZWRTdHJpbmeiZjFfEBJOU0F0dHJpYnV0ZWRTdHJpbmdfEA9OU0tleWVkQXJjaGl2ZXLRaWpUcm9vdIABAAgAEQAaACMALQAyADcAUwBZAGAAaQBwAH0AfwCBAIMAhgCNAJUAoACkAKYAqACqAK4AsACyALQAtgC+ANEA8wD8AQIBDwEkASsBLQEvATEBNgE7AT0BPwFEAU8BWAFlAWgBdQF+AYMBiwGOAZkBpAGwAb0ByQHLAc0BzwHRAdMB2AHZAdsB4AHoAesB8AIKAg4CIQImAkMCRQJHAk4CUQJTAlUCWAJaAlwCXgJ0AooCkwKhAqYCvALAAs0C0gLlAugC+wMAAwMDCAMdAyADNQNHA0oDTwAAAAAAAAIBAAAAAAAAAGsAAAAAAAAAAAAAAAAAAANR\";\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar stringParser = new AttributedStringParser(logger);\n\t\t\tvar sketchString = stringParser.Parse(jsonobj);\n\n\t\t\tAssert.That(sketchString, Is.Not.Null);\n\t\t\tAssert.That(sketchString.Attributes.Count, Is.EqualTo(1));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Red, Is.EqualTo(1));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Green, Is.EqualTo(1));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Blue, Is.EqualTo(1));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Alpha, Is.EqualTo(1));\n\n\t\t\tAssert.That(sketchString.Contents, Is.EqualTo(\"Aa\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseColoredTextSymbolVersion93()\n\t\t{\n\t\t\t// copy paste of _archive property on archevedAttributedString in TextSymbol from json-dump of DefaultText.sketch\n\t\t\t// Sketch version 93\n\t\t\tvar jsonobj = @\"YnBsaXN0MDDUAQIDBAUGX2BYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK8QHAcIDxAcHR4fKywtLi8wMTIzOT1FRkdISUxQWFtVJG51bGzTCQoLDA0OWE5TU3RyaW5nViRjbGFzc1xOU0F0dHJpYnV0ZXOAAoAbgANbVGhlIGNvbnRlbnTTERIKExcbV05TLmtleXNaTlMub2JqZWN0c6MUFRaABIAFgAajGBkagAeAEYAZgBBfECpNU0F0dHJpYnV0ZWRTdHJpbmdDb2xvckRpY3Rpb25hcnlBdHRyaWJ1dGVfEB9NU0F0dHJpYnV0ZWRTdHJpbmdGb250QXR0cmlidXRlXxAQTlNQYXJhZ3JhcGhTdHlsZdMREgogJRukISIjJIAIgAmACoALpCYnKCmADIANgA6AD4AQU3JlZFVhbHBoYVRibHVlVWdyZWVuIz/nrQ5gAAAAIz/wAAAAAAAAIz/sIMZAAAAAIz+vTqY/////0jQ1NjdaJGNsYXNzbmFtZVgkY2xhc3Nlc1xOU0RpY3Rpb25hcnmiNjhYTlNPYmplY3TSCjo7PF8QGk5TRm9udERlc2NyaXB0b3JBdHRyaWJ1dGVzgBiAEtMREgo+QUSiP0CAE4AUokJDgBWAFoAXXxATTlNGb250U2l6ZUF0dHJpYnV0ZV8QE05TRm9udE5hbWVBdHRyaWJ1dGUjQCgAAAAAAABdSGVsdmV0aWNhTmV1ZdI0NUpLXxATTlNNdXRhYmxlRGljdGlvbmFyeaNKNjjSNDVNTl8QEE5TRm9udERlc2NyaXB0b3KiTzhfEBBOU0ZvbnREZXNjcmlwdG9y1FFSUwpUVVZXWk5TVGFiU3RvcHNbTlNBbGlnbm1lbnRfEB9OU0FsbG93c1RpZ2h0ZW5pbmdGb3JUcnVuY2F0aW9ugAAQBBABgBrSNDVZWl8QEE5TUGFyYWdyYXBoU3R5bGWiWTjSNDVcXV8QEk5TQXR0cmlidXRlZFN0cmluZ6JeOF8QEk5TQXR0cmlidXRlZFN0cmluZ18QD05TS2V5ZWRBcmNoaXZlctFhYlRyb290gAEACAARABoAIwAtADIANwBWAFwAYwBsAHMAgACCAIQAhgCSAJkAoQCsALAAsgC0ALYAugC8AL4AwADCAO8BEQEkASsBMAEyATQBNgE4AT0BPwFBAUMBRQFHAUsBUQFWAVwBZQFuAXcBgAGFAZABmQGmAakBsgG3AdQB1gHYAd8B4gHkAeYB6QHrAe0B7wIFAhsCJAIyAjcCTQJRAlYCaQJsAn8CiAKTAp8CwQLDAsUCxwLJAs4C4QLkAukC/gMBAxYDKAMrAzAAAAAAAAACAQAAAAAAAABjAAAAAAAAAAAAAAAAAAADMg==\";\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar stringParser = new AttributedStringParser(logger);\n\t\t\tvar sketchString = stringParser.Parse(jsonobj);\n\n\t\t\tAssert.That(sketchString, Is.Not.Null);\n\t\t\tAssert.That(sketchString.Attributes.Count, Is.EqualTo(1));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Red, Is.EqualTo(0.73987501859664895));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Green, Is.EqualTo(0.061146922409534399));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Blue, Is.EqualTo(0.87900078296661399));\n\t\t\tAssert.That(sketchString.Attributes.First().Color.Alpha, Is.EqualTo(1));\n\n\t\t\tAssert.That(sketchString.Contents, Is.EqualTo(\"The content\"));\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/CompatibilityCheckerTest.cs",
    "content": "﻿using System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing NSubstitute;\nusing NUnit.Framework;\nusing SketchConverter;\nusing SketchConverter.SketchParser;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class CompatibilityCheckerTest\n\t{\n\t\t[Test]\n\t\tpublic void SketchFileProducedWithNewerVersionThanSupportedGivesWarning()\n\t\t{\n\t\t\tvar archive = Substitute.For<ISketchArchive>();\n\t\t\tvar appVerion = 3.14;\n\t\t\tvar version = CompatibilityChecker.SketchCompatibilityVersion + 1;\n\t\t\tvar compatibiltyVersion = version;\n\n\t\t\tvar json = GenerateMetaJson(appVerion, compatibiltyVersion, version);\n\t\t\tusing (var jsonStream = new MemoryStream(Encoding.ASCII.GetBytes(json))) {\n\t\t\t\tarchive.OpenFile(\"meta.json\")\n\t\t\t\t\t   .Returns(jsonStream);\n\n\t\t\t\tvar log = new MessageListLogger();\n\n\t\t\t\tCompatibilityChecker.Check(\"dummy.sketch\", archive, log);\n\n\t\t\t\tAssert.AreEqual(1, log.ErrorsAndWarnings().Count);\n\t\t\t\tAssert.AreEqual(3, log.Messages.Count);\n\t\t\t\tAssert.That(log.ErrorsAndWarnings().First(),\n\t\t\t\t\t\t\tDoes.StartWith(\"WARNING:\" +\"\\t\" + \"The sketch file you are converting to UX has been created with a newer version\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchFileProducedWithOlderVersionThanSupportedGivesWarning()\n\t\t{\n\t\t\tvar archive = Substitute.For<ISketchArchive>();\n\t\t\tvar appVerion = 3.14;\n\t\t\tvar version = CompatibilityChecker.SketchCompatibilityVersion - 3;\n\t\t\tvar compatibiltyVersion = version;\n\n\t\t\tvar json = GenerateMetaJson(appVerion, compatibiltyVersion, version);\n\t\t\tusing (var jsonStream = new MemoryStream(Encoding.ASCII.GetBytes(json))) {\n\t\t\t\tarchive.OpenFile(\"meta.json\")\n\t\t\t\t\t   .Returns(jsonStream);\n\n\t\t\t\tvar log = new MessageListLogger();\n\n\t\t\t\tCompatibilityChecker.Check(\"dummy.sketch\", archive, log);\n\n\t\t\t\tAssert.AreEqual(1, log.ErrorsAndWarnings().Count);\n\t\t\t\tAssert.AreEqual(3, log.Messages.Count);\n\t\t\t\tAssert.That(log.ErrorsAndWarnings().First(),\n\t\t\t\t\t\t\tDoes.StartWith(\"WARNING:\" +\"\\t\" + \"The sketch file was created with an older version\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SketchFileWithoutCompatibilityVersionDoesNotFail()\n\t\t{\n\t\t\t// The first sketch-files in the open format doesn't seem to have compatibilityVersion field\n\t\t\tvar archive = Substitute.For<ISketchArchive>();\n\t\t\tvar appVersion = 3.14;\n\t\t\tvar version = 91;\n\n\t\t\tvar json =\n\t\t\t\t@\"{\n\t\t\t\t'appVersion': '\" + appVersion + @\"',\n\t\t\t\t'build': 45422,\n\t\t\t\t'variant': 'NONAPPSTORE',\n\t\t\t\t'version': '\" + version + @\"'\n\t\t\t}\";\n\n\t\t\tusing (var jsonStream = new MemoryStream(Encoding.ASCII.GetBytes(json))) {\n\t\t\t\tarchive.OpenFile(\"meta.json\")\n\t\t\t\t\t.Returns(jsonStream);\n\n\t\t\t\tvar log = new MessageListLogger();\n\n\t\t\t\tCompatibilityChecker.Check(\"dummy.sketch\", archive, log);\n\n\t\t\t\tAssert.AreEqual(1, log.ErrorsAndWarnings().Count);\n\t\t\t\tAssert.AreEqual(3, log.Messages.Count);\n\t\t\t\tAssert.That(log.ErrorsAndWarnings().First(),\n\t\t\t\t\tDoes.StartWith(\"WARNING:\" +\"\\t\" + \"The sketch file was created with an older version\"));\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IsCultureInsensitive()\n\t\t{\n\t\t\tvar archive = Substitute.For<ISketchArchive>();\n\t\t\tvar appVerion = 3.14;\n\t\t\tvar version = CompatibilityChecker.SketchCompatibilityVersion;\n\t\t\tvar compatibiltyVersion = version;\n\n\t\t\tvar json = GenerateMetaJson(appVerion, compatibiltyVersion, version);\n\t\t\tusing (var jsonStream = new MemoryStream(Encoding.ASCII.GetBytes(json)))\n\t\t\t{\n\t\t\t\tarchive.OpenFile(\"meta.json\")\n\t\t\t\t\t.Returns(jsonStream);\n\n\t\t\t\tvar log = new MessageListLogger();\n\n\t\t\t\tThread.CurrentThread.CurrentCulture = new CultureInfo(\"nb-NO\");\n\t\t\t\tCompatibilityChecker.Check(\"dummy.sketch\", archive, log);\n\t\t\t}\n\t\t}\n\n\t\tprivate static string GenerateMetaJson(double appVerion,\n\t\t\t\t\t\t\t\t\t\t\t  int compatibilityVersion,\n\t\t\t\t\t\t\t\t\t\t\t  int version)\n\t\t{\n\t\t\treturn\n\t\t\t@\"{\n\t\t\t\t'appVersion': '\" + appVerion + @\"',\n\t\t\t\t'build': 45422,\n\t\t\t\t'compatibilityVersion': '\" + compatibilityVersion + @\"',\n\t\t\t\t'variant': 'NONAPPSTORE',\n\t\t\t\t'version': '\" + version + @\"'\n\t\t\t}\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/ConverterTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing NSubstitute;\nusing NSubstitute.ExceptionExtensions;\nusing NUnit.Framework;\nusing SketchConverter;\nusing SketchConverter.SketchModel;\nusing SketchConverter.SketchParser;\nusing SketchConverter.UxBuilder;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class ConverterTests\n\t{\n\t\t[Test]\n\t\tpublic void WhenOneFileDoesntExist_ReportsErrorAndKeepsConverting()\n\t\t{\n\t\t\tvar parser = Substitute.For<ISketchParser>();\n\t\t\tvar guid = Guid.NewGuid();\n\t\t\tvar sketchDocument = new SketchDocument(guid, new List<SketchPage>());\n\t\t\tparser.Parse(Arg.Any<SketchArchive>()).Returns(_ => sketchDocument);\n\n\t\t\tvar builder = Substitute.For<IUxBuilder>();\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar converter = new Converter(parser, builder, log);\n\n\t\t\tvar doesntExist = Path.Combine(TempDirectory, \"IDontExist.sketch\");\n\t\t\tvar arrowSketch = Path.Combine(FilesDirectory, \"Arrow.sketch\");\n\t\t\tconverter.Convert(new[] { doesntExist, arrowSketch }, TempDirectory);\n\n\t\t\t//Got error for the first file\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tAssert.That(log.ErrorsAndWarnings()[0], Does.Match(\"Can't convert non-existing Sketch-file.*IDontExist.sketch\"));\n\n\t\t\t//Called builder for the second file, and only that\n\t\t\tbuilder.ReceivedWithAnyArgs(1).Build(null, null);\n\t\t\tbuilder.Received(1).Build(sketchDocument, TempDirectory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConvertingNonZipArchiveSketchFileReportsError()\n\t\t{\n\t\t\tvar invalidSketchArchive = Path.Combine(Path.GetTempPath(), \"invalid.sketch\");\n\t\t\tusing (var sw = new StreamWriter(invalidSketchArchive))\n\t\t\t{\n\t\t\t\tsw.WriteLine(\"This is not a sketch archive\");\n\t\t\t}\n\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar converter = new Converter(new SketchParser(log), new SymbolsUxBuilder(log), log);\n\t\t\tconverter.Convert(new [] {invalidSketchArchive}, Path.GetTempPath());\n\t\t\tAssert.That(log.ErrorsAndWarnings().First(), Does.Match(invalidSketchArchive.Replace(@\"\\\",@\"\\\\\") + \".*Can't open sketch file. This file might be on an old format.\"));\n\n\t\t\tFile.Delete(invalidSketchArchive);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CanBeCalledTwice()\n\t\t{\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar converter = new Converter(new SketchParser(log), new SymbolsUxBuilder(log), log);\n\t\t\tvar arrowSketch = Path.Combine(FilesDirectory, \"Arrow.sketch\");\n\t\t\tAssert.That(File.Exists(arrowSketch));\n\t\t\tconverter.Convert(new [] {arrowSketch}, TempDirectory);\n\t\t\tAssert.That(log.ErrorsAndWarnings(), Is.Empty);\n\t\t\tconverter.Convert(new [] {arrowSketch}, TempDirectory);\n\t\t\tAssert.That(log.ErrorsAndWarnings(), Is.Empty);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void WhenOneFileFailsParsing_ReportsErrorAndKeepsConverting()\n\t\t{\n\t\t\tvar parser = Substitute.For<ISketchParser>();\n\t\t\tvar guid = Guid.NewGuid();\n\t\t\tvar sketchDocument = new SketchDocument(guid, new List<SketchPage>());\n\t\t\tparser.Parse(Arg.Any<SketchArchive>()).Returns(\n\t\t\t\t_ => { throw new SketchParserException(\"Whenever I adjust my sail, I fail.\"); },\n\t\t\t\t_ => sketchDocument);\n\n\t\t\tvar builder = Substitute.For<IUxBuilder>();\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar converter = new Converter(parser, builder, log);\n\n\t\t\t//Just some arbitrary valid sketch files to make sure `Load` works\n\t\t\tvar arrowSketch = Path.Combine(FilesDirectory, \"Arrow.sketch\");\n\t\t\tvar lineSketch = Path.Combine(FilesDirectory, \"Line.sketch\");\n\t\t\tconverter.Convert(new [] {arrowSketch, lineSketch}, TempDirectory);\n\n\t\t\t//Got error for the first file\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tAssert.That(log.ErrorsAndWarnings()[0], Does.Match(\"Arrow.sketch.*I fail\"));\n\n\t\t\t//Called builder for the second file, and only that\n\t\t\tbuilder.ReceivedWithAnyArgs(1).Build(null, null);\n\t\t\tbuilder.Received(1).Build(sketchDocument, TempDirectory);\n\t\t}\n\n\t\t[Test]\n\t\t//This is important since we for instance parse pages in parallel\n\t\tpublic void ReportsAggregateExceptions()\n\t\t{\n\t\t\tvar manyExceptions = new AggregateException(new List<Exception> {new Exception(\"foo\"), new Exception(\"bar\")});\n\t\t\tvar parser = Substitute.For<ISketchParser>();\n\t\t\tparser.Parse(Arg.Any<SketchArchive>()).Throws(manyExceptions);\n\n\t\t\tvar builder = Substitute.For<IUxBuilder>();\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar converter = new Converter(parser, builder, log);\n\n\t\t\t//Arbitrary existing file, just so we can get to `parser.Parse()`\n\t\t\tvar arrowSketch = Path.Combine(FilesDirectory, \"Arrow.sketch\");\n\n\t\t\tconverter.Convert(new [] {arrowSketch}, TempDirectory);\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.EqualTo(2));\n\t\t\tAssert.That(log.ErrorsAndWarnings(), Has.Some.Match(\"foo\"));\n\t\t\tAssert.That(log.ErrorsAndWarnings(), Has.Some.Match(\"bar\"));\n\t\t}\n\n\t\tstatic ConverterTests()\n\t\t{\n\t\t\tvar codeBase = Assembly.GetExecutingAssembly().CodeBase;\n\t\t\tvar uri = new UriBuilder(codeBase);\n\t\t\tvar path = Uri.UnescapeDataString(uri.Path);\n\t\t\tAssemblyDirectory = Path.GetDirectoryName(path);\n\t\t\tFilesDirectory = Path.Combine(AssemblyDirectory, \"..\", \"..\", \"..\", \"files\", \"Sketch43\");\n\t\t\tAssert.That(FilesDirectory, Does.Exist);\n\t\t\tTempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n\t\t}\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\tDirectory.CreateDirectory(TempDirectory);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void TearDown()\n\t\t{\n\t\t\tDirectory.Delete(TempDirectory, true);\n\t\t}\n\n\t\tprivate static readonly string AssemblyDirectory;\n\t\tprivate static readonly string FilesDirectory;\n\t\tprivate static readonly string TempDirectory;\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/CurvePointUtils.cs",
    "content": "﻿using System.Collections.Generic;\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverterTests\n{\n\tpublic class CornerRadius\n\t{\n\t\tpublic readonly double TopLeft;\n\t\tpublic readonly double TopRight;\n\t\tpublic readonly double BottomRight;\n\t\tpublic readonly double BottomLeft;\n\n\t\tpublic CornerRadius(double radius)\n\t\t{\n\t\t\tTopLeft = TopRight = BottomRight = BottomLeft = radius;\n\t\t}\n\t}\n\n\tpublic class CurvePointUtils\n\t{\n\t\t// create CurvePoint representing a straight line with corner radius = 0\n\t\tpublic static SketchCurvePoint LinePoint(double x, double y, double cornerRadius = 0)\n\t\t{\n\t\t\tvar p = new SketchPoint(x, y);\n\t\t\treturn new SketchCurvePoint(\n\t\t\t\tp,\n\t\t\t\tp,\n\t\t\t\tp,\n\t\t\t\tcornerRadius,\n\t\t\t\tSketchCurvePoint.CurveMode.Line, false, false\n\t\t\t);\n\t\t}\n\n\t\tpublic static SketchCurvePoint CurvePoint(double[] p,\n\t\t\t\t\t\t\t\t\t\t\t\t  double[] f,\n\t\t\t\t\t\t\t\t\t\t\t\t  double[] t,\n\t\t\t\t\t\t\t\t\t\t\t\t  double cr = 0)\n\t\t{\n\t\t\treturn CurvePoint(\n\t\t\t\tnew[]\n\t\t\t\t{\n\t\t\t\t\tp[0], p[1], f[0], f[1], t[0], t[1]\n\t\t\t\t},\n\t\t\t\tcr);\n\t\t}\n\n\t\tpublic static SketchCurvePoint CurvePoint(double[] pts,\n\t\t\t\t\t\t\t\t\t\t   double cornerRadius = 0)\n\t\t{\n\t\t\treturn new SketchCurvePoint(\n\t\t\t\tpoint: new SketchPoint(pts[0], pts[1]),\n\t\t\t\tcurveFrom: new SketchPoint(pts[2], pts[3]),\n\t\t\t\tcurveTo: new SketchPoint(pts[4], pts[5]),\n\t\t\t\tcornerRadius: cornerRadius,\n\t\t\t\tmode: SketchCurvePoint.CurveMode.Curve,\n\t\t\t\thasCurveFrom: true,\n\t\t\t\thasCurveTo: true\n\t\t\t);\n\t\t}\n\n\t\tpublic static IList<SketchCurvePoint> RectanglePath(CornerRadius cornerRadii)\n\t\t{\n\t\t\treturn new List<SketchCurvePoint>\n\t\t\t{\n\t\t\t\tLinePoint(0, 0, cornerRadii.TopLeft),\n\t\t\t\tLinePoint(1, 0, cornerRadii.TopRight),\n\t\t\t\tLinePoint(1, 1, cornerRadii.BottomRight),\n\t\t\t\tLinePoint(0, 1, cornerRadii.BottomLeft)\n\t\t\t};\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/DocumentBuilder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing NUnit.Framework.Constraints;\nusing SketchConverter;\nusing SketchConverter.SketchModel;\n\nnamespace SketchConverterTests\n{\n\tpublic static class DocumentBuilder\n\t{\n\t\tpublic static SketchSymbolInstance SymbolInstanceOf(SketchSymbolMaster symbol, string name = null)\n\t\t{\n\t\t\treturn new SketchSymbolInstance(\n\t\t\t\tSketchLayer(id: Guid.NewGuid(), frame: Frame, name:name),\n\t\t\t\tsymbol.SymbolId);\n\t\t}\n\n\t\tpublic static SketchDocument SketchDocument()\n\t\t{\n\t\t\tvar document = new SketchDocument(Guid.NewGuid(),new List<SketchPage>\n\t\t\t\t{\n\t\t\t\t\tnew SketchPage\n\t\t\t\t\t(\n\t\t\t\t\t\tGuid.NewGuid(),\n\t\t\t\t\t\tFrame,\n\t\t\t\t\t\t\"Symbols\",\n\t\t\t\t\t\tnew List<SketchLayer>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn document;\n\t\t}\n\n\t\tpublic static SketchSymbolMaster SketchSymbolMaster(string symbolName)\n\t\t{\n\t\t\tvar sketchPath =\n\t\t\t\tnew SketchPath(\n\t\t\t\t\tCurvePointUtils.RectanglePath(\n\t\t\t\t\t\tnew CornerRadius(0)),\n\t\t\t\t\ttrue);\n\t\t\tvar rectangle = new SketchRectangle(\n\t\t\t\tSketchLayer(frame: Frame),\n\t\t\t\tsketchPath, SketchBooleanOperation.NoOperation);\n\n\t\t\tvar sketchSymbolMaster = new SketchSymbolMaster(\n\t\t\t\t\tSketchLayer(id:Guid.NewGuid(), name:symbolName, frame: Frame,\n\t\t\t\t\tchildren: new List<SketchLayer> {rectangle}),\n\t\t\t\tGuid.NewGuid()\n\t\t\t);\n\t\t\trectangle.Parent = sketchSymbolMaster;\n\t\t\treturn sketchSymbolMaster;\n\t\t}\n\n\t\tpublic static SketchRectangle Rectangle(string name)\n\t\t{\n\t\t\treturn new SketchRectangle(\n\t\t\t\tSketchLayer(id: Guid.NewGuid(), name: name, frame: Frame),\n\t\t\t\tnew SketchPath(CurvePointUtils.RectanglePath(new CornerRadius(0)),\n\t\t\t\t\t\t\t   true),\n\t\t\t\tSketchBooleanOperation.NoOperation);\n\t\t}\n\n\t\tpublic static SketchSymbolMaster SketchSymbolMasterWithNoLayers(string symbolName)\n\t\t{\n\t\t\treturn new SketchSymbolMaster(\n\t\t\t\tSketchLayer(id: Guid.NewGuid(), name:symbolName, frame:Frame),\n\t\t\t\tGuid.NewGuid());\n\t\t}\n\n\t\tprivate static SketchLayer SketchLayer(\n\t\t\tGuid id = default(Guid),\n\t\t\tSketchLayer parent = null,\n\t\t\tSketchRect frame = null,\n\t\t\tstring name = null,\n\t\t\tbool nameIsFixed = false,\n\t\t\tdouble rotation = 0,\n\t\t\tbool flippedVertically = false,\n\t\t\tbool flippedHorizontally = false,\n\t\t\tIReadOnlyList<SketchLayer> children = null)\n\t\t{\n\t\t\tvar alignment = new SketchAlignment(\n\t\t\t\tnew SketchAxisAlignment(false, false, false),\n\t\t\t\tnew SketchAxisAlignment(false, false, false)); //Can make parameter later if needed\n\t\t\treturn new SketchLayer(\n\t\t\t\tid,\n\t\t\t\tparent,\n\t\t\t\tframe,\n\t\t\t\tname,\n\t\t\t\tnameIsFixed,\n\t\t\t\talignment,\n\t\t\t\trotation,\n\t\t\t\tflippedVertically,\n\t\t\t\tflippedHorizontally,\n\t\t\t\tOptional.None(),\n\t\t\t\tchildren ?? new List<SketchLayer>());\n\t\t}\n\n\t\tpublic static SketchDocument WithSymbol(this SketchDocument document, SketchSymbolMaster symbol)\n\t\t{\n\t\t\t// Fixme just find the Symbols page\n\t\t\tAssert.That(document.Pages.Count == 1);\n\t\t\tAssert.That(document.Pages.First().Name == \"Symbols\");\n\t\t\tvar firstPage = document.Pages.First();\n\t\t\tvar newLayers = new List<SketchLayer>(firstPage.Layers) {symbol};\n\t\t\tvar newPage = new SketchPage(Guid.NewGuid(), firstPage.Frame, firstPage.Name, newLayers);\n\t\t\treturn new SketchDocument(document.Id, new List<SketchPage>{newPage});\n\t\t}\n\n\t\tpublic static SketchSymbolMaster WithLayer(this SketchSymbolMaster symbol, SketchLayer layer)\n\t\t{\n\t\t\tvar newLayers = new List<SketchLayer>(symbol.Layers) {layer};\n\t\t\tvar newParent = new SketchLayer(symbol, newLayers);\n\t\t\tvar newSymbol = new SketchSymbolMaster(newParent, symbol.SymbolId);\n\t\t\tlayer.Parent = newSymbol;\n\t\t\treturn newSymbol;\n\t\t}\n\n\t\tprivate static readonly SketchRect Frame = new SketchRect(0, 0, 100, 100, false);\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/GeometryTests.cs",
    "content": "﻿using System.Collections.Generic;\nusing NUnit.Framework;\nusing SketchConverter.SketchModel;\nusing SketchConverter.UxBuilder;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class GeometryTests\n\t{\n\t\t[TestCase(new []{0.5, 0.0},new []{1.0, 0.0}, new []{1.0, 1.0}, new []{0.0, 1.0})] // first point moved\n\t\t[TestCase(new []{0.0, 0.0},new []{1.0, 0.2}, new []{1.0, 1.0}, new []{0.0, 1.0})] // second point moved\n\t\t[TestCase(new []{0.0, 0.0},new []{1.0, 0.0}, new []{0.9, 0.9}, new []{0.0, 1.0})] // third point moved\n\t\t[TestCase(new []{0.0, 0.0},new []{1.0, 0.0}, new []{1.0, 1.0}, new []{0.25, 0.75})] // fourth point moved\n\t\t[TestCase(new []{0.5, 0.0},new []{1.0, 0.5}, new []{0.5, 1.0}, new []{0.0, 0.5})] // rotated square\n\t\t[TestCase(new []{0.0, 0.0},new []{5.0, 0.0}, new []{5.0+3.0, 4.0}, new []{3.0, 4.0})] // rhombus (pythagoras <3)\n\t\tpublic void QuadrilateralIsNotRectangle(double [] p1, double [] p2, double [] p3, double [] p4)\n\t\t{\n\t\t\tvar points = new List<SketchCurvePoint>\n\t\t\t{\n\t\t\t\tCurvePointUtils.LinePoint(p1[0], p1[1]),\n\t\t\t\tCurvePointUtils.LinePoint(p2[0], p2[1]),\n\t\t\t\tCurvePointUtils.LinePoint(p3[0], p3[1]),\n\t\t\t\tCurvePointUtils.LinePoint(p4[0], p4[1]),\n\t\t\t};\n\n\t\t\tAssert.That(Geometry.EdgesAreAxisAligned(points), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OpenAxisAlignedPathWithFourPointsIsARectangle()\n\t\t{\n\t\t\tvar rectangle = new SketchPath(CurvePointUtils.RectanglePath(new CornerRadius(0)), false);\n\t\t\tAssert.That(Geometry.IsAxisAlignedRectangle(rectangle), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClosedAxisAlignedPathWithFourPointsIsARectangle()\n\t\t{\n\t\t\tvar rectangle = new SketchPath(CurvePointUtils.RectanglePath(new CornerRadius(0)), true);\n\t\t\tAssert.That(Geometry.IsAxisAlignedRectangle(rectangle), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PathWithMoreThanFourPointsIsNotRectangle()\n\t\t{\n\t\t\tvar points = CurvePointUtils.RectanglePath(new CornerRadius(0));\n\t\t\tpoints.Add(CurvePointUtils.LinePoint(0.5, 0.5));\n\t\t\tvar path = new SketchPath(points, true);\n\t\t\tAssert.That(Geometry.IsAxisAlignedRectangle(path), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void PathWithLessThanFourPointsIsNotARectangle()\n\t\t{\n\t\t\tvar path = new SketchPath(new List<SketchCurvePoint>(), false);\n\t\t\tAssert.That(Geometry.IsAxisAlignedRectangle(path), Is.False);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/MessageListLogger.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing SketchConverter;\nusing SketchConverter.API;\n\nnamespace SketchConverterTests\n{\n\tclass MessageListLogger : ILogger\n\t{\n\t\tpublic void Info(string info)\n\t\t{\n\t\t\tMessages.Add(\"INFO:\\t\" + info);\n\t\t}\n\n\t\tpublic void Warning(string warning)\n\t\t{\n\t\t\tMessages.Add(\"WARNING:\\t\" + warning);\n\t\t}\n\n\t\tpublic void Error(string error)\n\t\t{\n\t\t\tMessages.Add(\"ERROR:\\t\" + error);\n\t\t}\n\n\t\tpublic IList<string> Messages = new List<string>();\n\n\t\tpublic IList<string> ErrorsAndWarnings()\n\t\t{\n\t\t\treturn Messages.Where(m => !m.StartsWith(\"INFO:\")).ToList();\n\t\t}\n\n\t\tpublic IEnumerable<string> Warnings()\n\t\t{\n\t\t\treturn Messages\n\t\t\t\t.Where(m => m.StartsWith(\"WARNING:\"))\n\t\t\t\t.Select(e => e.Replace(\"WARNING:\\t\",\"\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/NameValidatorTests.cs",
    "content": "﻿using NUnit.Framework;\nusing SketchConverter.UxBuilder;\n\nnamespace SketchConverterTests\n{\n\tpublic class NameValidatorTests\n\t{\n\t\t[Test]\n\t\tpublic void NameIsValid_ValidNames([Values(\"a\", \"aAaa\", \"A1\", \"a_1\", \"_a\", \"_1\")] string name)\n\t\t{\n\t\t\tAssert.That(NameValidator.NameIsValid(name), Is.EqualTo(NameValidity.Valid));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NameIsValid_InvalidCharacters([Values(\"1\", \"1A\", \"\", \"a B\", \"aå\", \"a-b\", \"a.b\")] string name)\n\t\t{\n\t\t\tAssert.That(NameValidator.NameIsValid(name), Is.EqualTo(NameValidity.InvalidCharacter));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NameIsValid_UnoKeywords([Values(\"draw\", \"local\", \"add\")] string name)\n\t\t{\n\t\t\tAssert.That(NameValidator.NameIsValid(name), Is.EqualTo(NameValidity.InvalidKeyword));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NameIsValid_CSharpKeywords([Values(\"async\", \"string\", \"class\")] string name)\n\t\t{\n\t\t\tAssert.That(NameValidator.NameIsValid(name), Is.EqualTo(NameValidity.InvalidKeyword));\n\t\t}\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"SketchConverterTests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"SketchConverterTests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"D7DBE4E2-7E7F-4B7D-BFF5-2B9883555330\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/ResultTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing SketchConverter;\n\nnamespace SketchConverterTests\n{\n\tpublic class ResultTests\n\t{\n\t\t[Test]\n\t\tpublic void OkIsOk()\n\t\t{\n\t\t\tAssert.That(Result.Ok(\"yeah\"), Is.InstanceOf(typeof(Ok<string>)));\n\t\t\tAssert.That(Result.Ok(42), Is.InstanceOf(typeof(Ok<int>)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ErrIsErr()\n\t\t{\n\t\t\tAssert.That(Result.Err<double>(\"Couldn't parse that one!\"), Is.InstanceOf(typeof(Err<double>)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExpectReturnsValueWhenOk()\n\t\t{\n\t\t\tAssert.That(\n\t\t\t\tResult.Ok(2).Expect(),\n\t\t\t\tIs.EqualTo(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExpectThrowsWhenErr()\n\t\t{\n\t\t\tvar e = Result.Err<int>(\"Failed!\");\n\n\t\t\tAssert.That(\n\t\t\t\t() => e.Expect(),\n\t\t\t\tThrows.TypeOf<Exception>().With.Message.EqualTo(\"Failed!\"));\n\n\t\t\tAssert.That(\n\t\t\t\t() => e.Expect(\"Expected a value\"),\n\t\t\t\tThrows.TypeOf<Exception>().With.Message.EqualTo(\"Expected a value: Failed!\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ConvenienceOperators()\n\t\t{\n\t\t\tvar v = OneReasonResultOperatorIsUseful();\n\t\t\tAssert.That(v.Expect(), Is.EqualTo(42));\n\n\t\t\tvar e = OneReasonErrorOperatorIsUseful();\n\t\t\tAssert.That(() => e.Expect(), Throws.TypeOf<Exception>().With.Message.EqualTo(\"nope\"));\n\n\t\t\t//Another reason operators are nice:\n\t\t\t#pragma warning disable 0219\n\t\t\tvar values = new List<Result<int>> {1, 2, 3, Result.Err(\"failed\"), 5};\n\t\t\t#pragma warning restore 0219\n\t\t}\n\n\t\tprivate static Result<int> OneReasonResultOperatorIsUseful()\n\t\t{\n\t\t\treturn 42; //Don't have to write \"return Result.Ok(42)\"\n\t\t}\n\n\t\tprivate static Result<int> OneReasonErrorOperatorIsUseful()\n\t\t{\n\t\t\treturn Result.Err(\"nope\"); //Don't have to specify type: \"return Result.Err<int>(\"nope\")\"\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SelectOkSelectsOk()\n\t\t{\n\t\t\tvar values = new List<Result<int>>() {Result.Ok(1), Result.Err<int>(\"failed\")};\n\t\t\tvar ok = values.SelectOk();\n\t\t\tAssert.That(ok, Is.EqualTo(new List<int>(){1}));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/SketchConverterTests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{D7DBE4E2-7E7F-4B7D-BFF5-2B9883555330}</ProjectGuid>\n    <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>SketchConverterTests</RootNamespace>\n    <AssemblyName>SketchConverterTests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc\">\n      <HintPath>..\\packages\\Castle.Core.4.2.0\\lib\\net45\\Castle.Core.dll</HintPath>\n    </Reference>\n    <Reference Include=\"NSubstitute, Version=3.1.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca\">\n      <HintPath>..\\packages\\NSubstitute.3.1.0\\lib\\net45\\NSubstitute.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51\">\n      <HintPath>..\\packages\\System.Threading.Tasks.Extensions.4.3.0\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb\">\n      <HintPath>..\\packages\\NUnit.3.5.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AttributedStringParserTests.cs\" />\n    <Compile Include=\"CompatibilityCheckerTest.cs\" />\n    <Compile Include=\"ConverterTests.cs\" />\n    <Compile Include=\"CurvePointUtils.cs\" />\n    <Compile Include=\"DocumentBuilder.cs\" />\n    <Compile Include=\"GeometryTests.cs\" />\n    <Compile Include=\"NameValidatorTests.cs\" />\n    <Compile Include=\"ResultTests.cs\" />\n    <Compile Include=\"SketchPathToSvgTests.cs\" />\n    <Compile Include=\"Snippets.cs\" />\n    <Compile Include=\"MessageListLogger.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SketchParserTests.cs\" />\n    <Compile Include=\"SymbolClassNameBuilderTests.cs\" />\n    <Compile Include=\"SymbolsUxBuilderTests.cs\" />\n    <Compile Include=\"Transforms\\TextPropertyTransformTests.cs\" />\n    <Compile Include=\"UxBuilderTests.cs\" />\n    <Compile Include=\"UxNodeTests.cs\" />\n    <Compile Include=\"UxSizeTests.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SketchConverter\\SketchConverter.csproj\">\n      <Project>{b086e390-ce62-4c90-9214-9e828de7af33}</Project>\n      <Name>SketchConverter</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/SketchParserTests.cs",
    "content": "﻿using System;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing NSubstitute;\nusing NUnit.Framework;\nusing SketchConverter;\nusing SketchConverter.API;\nusing SketchConverter.SketchModel;\nusing SketchConverter.SketchParser;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class SketchParserTests\n\t{\n\t\t[Test]\n\t\tpublic void ParseLayerWithoutVerticalFlipPropertyDoesNotCrash()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.ShapeWithoutFlippedProps);\n\t\t\tvar log = new MessageListLogger();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tvar shapePath = sketchDocument.Pages[0].Layers[0] as SketchShapePath;\n\t\t\tAssert.NotNull(shapePath);\n\t\t\tAssert.That(shapePath.Path.IsClosed, Is.False);\n\t\t\tAssert.That(shapePath.IsFlippedVertical, Is.False);\n\t\t\tAssert.That(shapePath.IsFlippedHorizontal, Is.False);\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.Zero);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseLayerWithVerticalFlip()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.ShapeWithVerticalFlip);\n\t\t\tvar log = new MessageListLogger();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tvar shapePath = sketchDocument.Pages[0].Layers[0] as SketchShapePath;\n\t\t\tAssert.NotNull(shapePath);\n\t\t\tAssert.That(shapePath.Path.IsClosed, Is.False);\n\t\t\tAssert.That(shapePath.IsFlippedVertical, Is.True);\n\t\t\tAssert.That(shapePath.IsFlippedHorizontal, Is.False);\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.Zero);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseShapeGroupWithClippingMaskOn()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.MaskedShapeGroup);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tAssert.That(sketchDocument.Pages.Count, Is.EqualTo(1));\n\t\t\tvar shapeGroup = sketchDocument.Pages.First().Layers.First() as SketchShapeGroup;\n\t\t\tAssert.That(shapeGroup, Is.Not.Null);\n\t\t\tAssert.That(shapeGroup.HasClippingMask, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseSketchRectangleTest()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.RectangleJson);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tAssert.AreEqual(1, sketchDocument.Pages.Count);\n\t\t\tAssert.NotNull(sketchDocument.Pages[0].Layers);\n\t\t\tAssert.IsInstanceOf(typeof(SketchRectangle), sketchDocument.Pages[0].Layers[0]);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseSketchSymbolWithRectangleTest()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.SymbolMaster);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tAssert.NotNull(sketchDocument);\n\t\t\tAssert.AreEqual(1, sketchDocument.Pages.Count);\n\t\t\tAssert.NotNull(sketchDocument.Pages[0].Layers);\n\t\t\tAssert.IsInstanceOf(typeof(SketchSymbolMaster), sketchDocument.Pages[0].Layers[0]);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseNestedSketchSymbolTest()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.SymbolMasterWithInstance);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\t\t\tAssert.NotNull(sketchDocument);\n\t\t\tAssert.AreEqual(1, sketchDocument.Pages.Count);\n\t\t\tAssert.NotNull(sketchDocument.Pages[0].Layers);\n\t\t\tAssert.IsInstanceOf<SketchSymbolMaster>(sketchDocument.Pages[0].Layers[0]);\n\n\t\t\tvar symbolMaster = sketchDocument.Pages[0].Layers[0] as SketchSymbolMaster;\n\t\t\tAssert.AreEqual(\"Rectangle\", symbolMaster.Name);\n\t\t\tAssert.AreEqual(1, symbolMaster.Layers.Count(l => l.GetType() == typeof(SketchSymbolInstance)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseShapePathWithStraightLine()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.ShapePathJson);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\t\t\tAssert.NotNull(sketchDocument);\n\t\t\tAssert.AreEqual(1, sketchDocument.Pages.Count);\n\t\t\tAssert.NotNull(sketchDocument.Pages[0].Layers);\n\t\t\tAssert.IsInstanceOf<SketchShapePath>(sketchDocument.Pages[0].Layers[0]);\n\n\t\t\tvar shapePath = sketchDocument.Pages[0].Layers[0] as SketchShapePath;\n\t\t\tAssert.IsFalse(shapePath.Path.IsClosed);\n\t\t\tAssert.AreEqual(2, shapePath.Path.Points.Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseShapePathWithLinesAndCurves()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.VectorPath);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tvar shapePath = sketchDocument.Pages[0].Layers[0] as SketchShapePath;\n\t\t\tAssert.NotNull(shapePath);\n\t\t\tAssert.IsFalse(shapePath.Path.IsClosed);\n\t\t\tAssert.AreEqual(11, shapePath.Path.Points.Count);\n\n\t\t\tAssert.AreEqual(6, shapePath.Path.Points.Count(p => p.Mode == SketchCurvePoint.CurveMode.Line));\n\t\t\tAssert.AreEqual(5, shapePath.Path.Points.Count(p => p.Mode == SketchCurvePoint.CurveMode.Curve));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseStarShape()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.Star);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tvar shapePath = sketchDocument.Pages[0].Layers[0] as SketchShapePath;\n\t\t\tAssert.NotNull(shapePath);\n\t\t\tAssert.AreEqual(10, shapePath.Path.Points.Count);\n\t\t\tAssert.AreEqual(10, shapePath.Path.Points.Count(p => p.Mode == SketchCurvePoint.CurveMode.Line));\n\t\t\tAssert.That(shapePath.Path.IsClosed, Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseCurve()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.Path1);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tvar shapePath = sketchDocument.Pages[0].Layers[0] as SketchShapePath;\n\t\t\tAssert.NotNull(shapePath);\n\t\t\tAssert.That(shapePath.Path.IsClosed, Is.False);\n\t\t\tAssert.AreEqual(2, shapePath.Path.Points.Count);\n\t\t\tAssert.AreEqual(1, shapePath.Path.Points.Count(p => p.Mode == SketchCurvePoint.CurveMode.Line));\n\t\t\tAssert.AreEqual(1, shapePath.Path.Points.Count(p => p.Mode == SketchCurvePoint.CurveMode.Curve));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseThreePntCurve()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.Path2);\n\t\t\tvar log = Substitute.For<ILogger>();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tvar shapePath = sketchDocument.Pages[0].Layers[0] as SketchShapePath;\n\t\t\tAssert.NotNull(shapePath);\n\t\t\tAssert.That(shapePath.Path.IsClosed, Is.False);\n\t\t\tAssert.AreEqual(3, shapePath.Path.Points.Count);\n\t\t\tAssert.AreEqual(2, shapePath.Path.Points.Count(p => p.Mode == SketchCurvePoint.CurveMode.Line));\n\t\t\tAssert.AreEqual(1, shapePath.Path.Points.Count(p => p.Mode == SketchCurvePoint.CurveMode.Curve));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseErrorInLayerLogsAndSkips()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.PathInvalidJson);\n\t\t\tvar log = new MessageListLogger();\n\n\t\t\tvar document = new SketchParser(log).Parse(mockSketchArchive);\n\t\t\tAssert.That(document.Pages.Count, Is.EqualTo(1));\n\t\t\tAssert.That(document.Pages[0].Layers.Count, Is.EqualTo(0));\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tAssert.That(log.ErrorsAndWarnings()[0], Does.Match(\"Failed to parse layer\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ParseEmptySketchDocument()\n\t\t{\n\t\t\t// Create Sketch document where page has an empty layer list\n\t\t\t// When saving an empty sketch file, the document-class doesn't have an do_objectID\n\n\t\t\tvar mockSketchArchive = Substitute.For<ISketchArchive>();\n\t\t\tmockSketchArchive\n\t\t\t\t.OpenFile(\"document.json\")\n\t\t\t\t.Returns(\n\t\t\t\t\tnew MemoryStream(Encoding.ASCII.GetBytes(\n\t\t\t\t\t\t@\"{\n\t\t\t\t\t\t\t'_class': 'document',\n\t\t\t\t\t\t\t'pages': []\n\t\t\t\t\t\t }\"\n\t\t\t\t\t)));\n\n\t\t\tvar log = new MessageListLogger();\n\n\t\t\tvar sketchDocument = new SketchParser(log).Parse(mockSketchArchive);\n\n\t\t\tAssert.NotNull(sketchDocument);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnsupportedLayerWarnsAndSkips()\n\t\t{\n\t\t\tvar mockSketchArchive = MockSketchArchive.Create(Snippets.JellyfishLayerJson);\n\t\t\tvar log = new MessageListLogger();\n\n\t\t\tvar document = new SketchParser(log).Parse(mockSketchArchive);\n\t\t\tAssert.That(document.Pages.Count, Is.EqualTo(1));\n\t\t\tAssert.That(document.Pages[0].Layers.Count, Is.EqualTo(0));\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tAssert.That(log.ErrorsAndWarnings()[0], Does.Match(\"Skipping layer 'Jellyfish' of unsupported type 'jellyfish'\"));\n\t\t}\n\n\n\t\t// Hide all the uglyness of building a mock sketch archive\n\t\tstatic class MockSketchArchive\n\t\t{\n\t\t\tpublic static ISketchArchive Create(string pageContent)\n\t\t\t{\n\t\t\t\tvar pageGuid = Guid.NewGuid();\n\t\t\t\tvar document = GenerateDocumentJson(new[] {pageGuid});\n\t\t\t\tvar mockSketchArchive = Substitute.For<ISketchArchive>();\n\t\t\t\tmockSketchArchive.OpenFile(\"document.json\").Returns(document);\n\t\t\t\tmockSketchArchive.OpenFile(\"pages/\" + pageGuid + \".json\")\n\t\t\t\t\t.Returns(GenerateSketchPage(pageGuid, pageContent));\n\t\t\t\treturn mockSketchArchive;\n\t\t\t}\n\n\t\t\tstatic Stream GenerateDocumentJson(Guid[] ids)\n\t\t\t{\n\t\t\t\tvar jsondoc =\n\t\t\t\t\t@\"{\"\"_class\"\": \"\"document\"\", \"\"do_objectID\"\": \"\"\" + Guid.NewGuid() + @\"\"\",\"\"pages\"\": [\";\n\n\t\t\t\tforeach (var id in ids)\n\t\t\t\t{\n\t\t\t\t\tjsondoc += PageRef(id);\n\t\t\t\t}\n\t\t\t\tjsondoc += @\"]}\";\n\n\t\t\t\tvar memstream = new MemoryStream(Encoding.ASCII.GetBytes(jsondoc));\n\n\t\t\t\treturn memstream;\n\t\t\t}\n\n\t\t\tstatic Stream GenerateSketchPage(Guid id, string content)\n\t\t\t{\n\t\t\t\tvar json = @\"{\"\"_class\"\":\"\"page\"\",\"\"do_objectID\"\":\"\"\" + id + @\"\"\",\"\"name\"\":\"\"somename\"\",\" + Frame() +\n\t\t\t\t\t\t   @\",\"\"layers\"\":[\";\n\t\t\t\tjson += content;\n\t\t\t\tjson += @\"]}\";\n\t\t\t\tvar memstream = new MemoryStream(Encoding.ASCII.GetBytes(json));\n\t\t\t\treturn memstream;\n\t\t\t}\n\n\t\t\tprivate static string PageRef(Guid id)\n\t\t\t{\n\t\t\t\treturn @\"\n\t\t\t{\n\t\t\t\t\"\"_class\"\": \"\"MSJSONFileReference\"\",\n\t\t\t\t\"\"_ref\"\": \"\"pages/\" + id\n\t\t\t\t\t   + @\"\"\",\n\t\t\t\t\"\"_ref_class\"\": \"\"MSImmutablePage\"\"\n\t\t\t},\";\n\t\t\t}\n\n\t\t\tprivate static string Frame()\n\t\t\t{\n\t\t\t\treturn @\"\n\t\t\t\t\"\"frame\"\": {\n\t\t\t\t\"\"_class\"\": \"\"rect\"\",\n\t\t\t\t\"\"constrainProportions\"\": false,\n\t\t\t\t\"\"height\"\": 100,\n\t\t\t\t\"\"width\"\": 100,\n\t\t\t\t\"\"x\"\": 0,\n\t\t\t\t\"\"y\"\": 0\n\t\t\t}\";\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/SketchPathToSvgTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Threading;\nusing NUnit.Framework;\nusing SketchConverter.SketchModel;\nusing SketchConverter.UxBuilder;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class SketchPathToSvgTests\n\t{\n\t\t[Test]\n\t\tpublic void LocaleDecimalSeparatorIgnored()\n\t\t{\n\t\t\tThread.CurrentThread.CurrentCulture = new CultureInfo(\"nb-NO\"); // make `,` the decimal separator\n\t\t\tvar points = StraightLine(new SketchPoint(3.14, 2.1), new SketchPoint(13.1, 4.1));\n\t\t\tvar svg = SketchCurvePointsToSvg.ToSvgString(new SketchPath(points: points, isClosed: false));\n\n\t\t\tAssert.That(svg.Contains(\",\"), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StraightLineToSvgString()\n\t\t{\n\t\t\tvar points = StraightLine(new SketchPoint(10.0, 2.0), new SketchPoint(10.0, 10.0));\n\t\t\tvar path = new SketchPath(points: points, isClosed: false);\n\n\t\t\tvar svg = SketchCurvePointsToSvg.ToSvgString(path);\n\n\t\t\tAssert.That(svg, Does.Match(\"^M 10 2 L 10 10$\"));\n\n\t\t}\n\n\t\tprivate static List<SketchCurvePoint> StraightLine(SketchPoint p1, SketchPoint p2)\n\t\t{\n\t\t\tvar points = new List<SketchCurvePoint>()\n\t\t\t{\n\t\t\t\tnew SketchCurvePoint(\n\t\t\t\t\tpoint: p1,\n\t\t\t\t\tcurveFrom: p1,\n\t\t\t\t\tcurveTo: p1,\n\t\t\t\t\tcornerRadius: 0,\n\t\t\t\t\tmode: SketchCurvePoint.CurveMode.Line,\n\t\t\t\t\thasCurveFrom: false,\n\t\t\t\t\thasCurveTo: false\n\t\t\t\t),\n\t\t\t\tnew SketchCurvePoint(\n\t\t\t\t\tpoint: p2,\n\t\t\t\t\tcurveFrom: p2,\n\t\t\t\t\tcurveTo: p2,\n\t\t\t\t\tcornerRadius: 0,\n\t\t\t\t\tmode: SketchCurvePoint.CurveMode.Line,\n\t\t\t\t\thasCurveFrom: true,\n\t\t\t\t\thasCurveTo: true)\n\t\t\t};\n\t\t\treturn points;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ClosedStarPolygon()\n\t\t{\n\t\t\tvar points = new[]\n\t\t\t{\n\t\t\t\tCurvePointUtils.LinePoint(0.5, 0.75),\n\t\t\t\tCurvePointUtils.LinePoint(0.20610737385376349, 0.90450849718747373),\n\t\t\t\tCurvePointUtils.LinePoint(0.26223587092621159, 0.57725424859373686),\n\t\t\t\tCurvePointUtils.LinePoint(0.024471741852423179, 0.34549150281252639),\n\t\t\t\tCurvePointUtils.LinePoint(0.35305368692688166, 0.29774575140626314),\n\t\t\t\tCurvePointUtils.LinePoint(0.49999999999999989, 0),\n\t\t\t\tCurvePointUtils.LinePoint(0.64694631307311823, 0.29774575140626314),\n\t\t\t\tCurvePointUtils.LinePoint(0.97552825814757682, 0.34549150281252616),\n\t\t\t\tCurvePointUtils.LinePoint(0.73776412907378841, 0.57725424859373675),\n\t\t\t\tCurvePointUtils.LinePoint(0.79389262614623668, 0.90450849718747361),\n\t\t\t};\n\t\t\tvar path = new SketchPath(points, true);\n\n\t\t\tvar svg = SketchCurvePointsToSvg.ToSvgString(path);\n\n\t\t\tAssert.That(svg, Does.Match(\"^M 0.5 0.75 L 0.2061073738538 0.9045084971875 L 0.2622358709262 0.5772542485937 L 0.02447174185242 0.3454915028125 L 0.3530536869269 0.2977457514063 L 0.5 0 L 0.6469463130731 0.2977457514063 L 0.9755282581476 0.3454915028125 L 0.7377641290738 0.5772542485937 L 0.7938926261462 0.9045084971875 L 0.5 0.75$\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void Oval()\n\t\t{\n\t\t\tvar points = new[]\n\t\t\t{\n\t\t\t\tCurvePointUtils.CurvePoint(new[]\n\t\t\t\t{\n\t\t\t\t\t0.5, 1, 0.77614237490000004, 1, 0.22385762510000001, 1\n\t\t\t\t}),\n\t\t\t\tCurvePointUtils.CurvePoint(new[]\n\t\t\t\t{\n\t\t\t\t\t1, 0.5, 1, 0.22385762510000001, 1, 0.77614237490000004\n\t\t\t\t}),\n\t\t\t\tCurvePointUtils.CurvePoint(new[]\n\t\t\t\t{\n\t\t\t\t\t0.5, 0, 0.22385762510000001, 0, 0.77614237490000004, 0\n\t\t\t\t}),\n\t\t\t\tCurvePointUtils.CurvePoint(new[]\n\t\t\t\t{\n\t\t\t\t\t0, 0.5, 0, 0.77614237490000004, 0, 0.22385762510000001\n\t\t\t\t}),\n\t\t\t};\n\n\t\t\tvar oval = new SketchPath(points, true);\n\t\t\tvar svg = SketchCurvePointsToSvg.ToSvgString(oval);\n\t\t\tAssert.That(svg, Does.Match(\"^M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1$\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CurveFromFirstPoint()\n\t\t{\n\t\t\tvar points = new[]\n\t\t\t{\n\t\t\t\tCurvePointUtils.CurvePoint(new[] {0.0, 0.0},\n\t\t\t\t\t\t\t\t\t\t   new[] {123.20975114271207, 8.196425347535656},\n\t\t\t\t\t\t\t\t\t\t   new[] {-123.20975114271207, -8.1964253475356769}),\n\t\t\t\tCurvePointUtils.LinePoint(94.613074518933793, 99)\n\t\t\t};\n\n\t\t\tvar curve = new SketchPath(points, false);\n\t\t\tvar svg = SketchCurvePointsToSvg.ToSvgString(curve);\n\t\t\tConsole.WriteLine(svg);\n\t\t\tAssert.That(svg, Does.Match(\"^M 0 0 C 82.13983409514 5.464283565024 113.6775256015 38.46428356502 94.61307451893 99$\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void StartWithCurve()\n\t\t{\n\t\t\tvar points = new[]\n\t\t\t{\n\t\t\t\tCurvePointUtils.CurvePoint(new [] {0.0, 100, 0, 0, 0, 200}),\n\t\t\t\tCurvePointUtils.LinePoint(50, 0),\n\t\t\t\tCurvePointUtils.LinePoint(100, 100)\n\t\t\t};\n\t\t\tvar curve = new SketchPath(points, false);\n\t\t\tvar svg = SketchCurvePointsToSvg.ToSvgString(curve);\n\t\t\tConsole.WriteLine(svg);\n\t\t\tAssert.That(svg, Does.Match(\"^M 0 100 C 0 33.33333333333 16.66666666667 0 50 0 L 100 100$\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EndWithCurve()\n\t\t{\n\t\t\tvar points = new[]\n\t\t\t{\n\t\t\t\tCurvePointUtils.LinePoint(0, 100),\n\t\t\t\tCurvePointUtils.LinePoint(50, 0),\n\t\t\t\tCurvePointUtils.CurvePoint(new []{100.0, 100, 100, 200, 100, 0})\n\t\t\t};\n\n\t\t\tvar curve = new SketchPath(points, false);\n\t\t\tvar svg = SketchCurvePointsToSvg.ToSvgString(curve);\n\t\t\tConsole.WriteLine(svg);\n\t\t\tAssert.That(svg, Does.Match(\"M 0 100 L 50 0 C 83.33333333333 0 100 33.33333333333 100 100$\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CoordinatesToSvgSkipsLastDecimals()\n\t\t{\n\t\t\tAssert.That(SketchCurvePointsToSvg.CoordinatesToSvg(new SketchPoint(Math.PI/10, Math.PI*10)),\n\t\t\t\tIs.EqualTo(\"0.314159265359 31.4159265359\"));\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/Snippets.cs",
    "content": "﻿namespace SketchConverterTests\n{\n    public struct Snippets\n    {\n        public static string VectorPath = @\"{\n    \"\"_class\"\": \"\"shapePath\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"2AAC3597-8B21-4582-BC7B-D47DBE4A3F9A\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 597.9919340738268,\n        \"\"width\"\": 455.8110146848459,\n        \"\"x\"\": 2.842170943040401e-14,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": false,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": [\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.43473009273778507, 0.29591833558407304}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{0.25633927421791997, 0.76035028972095409}\"\",\n                \"\"hasCurveFrom\"\": true,\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0.3455346834778526, 0.5281343126525142}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.74519147737071856, 0.33224433767914169}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.74519147737071856, 0.33224433767914169}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.74519147737071856, 0.33224433767914169}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{1, 0.54002305996649025}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{1, 0.54002305996649025}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{1, 0.54002305996649025}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.92810719751330206, 0.77829445943056719}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.92810719751330206, 0.77829445943056719}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.92810719751330206, 0.77829445943056719}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.41190847716714685, 0.84552467226323136}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.41190847716714685, 0.84552467226323136}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.41190847716714685, 0.84552467226323136}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.39386885990233539, 1}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.39386885990233539, 1}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.39386885990233539, 1}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.097350685383343752, 0.58855789103398981}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{0.34959681107097373, 0.70706649200660898}\"\",\n                \"\"hasCurveFrom\"\": true,\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0.22347374822715893, 0.64781219152029912}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.32569538943127874, 0.43604877919914464}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{-0.13099401866459132, 0.64399734073383663}\"\",\n                \"\"hasCurveFrom\"\": true,\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0.097350685383343752, 0.54002305996649025}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.20136343347978919, 0.10331409681890499}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{0.45002734538276828, 0.24010001371707759}\"\",\n                \"\"hasCurveFrom\"\": true,\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0.32569538943127874, 0.17170705526799129}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.47613979849720089, 0.03002846159060505}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.47613979849720089, 0.03002846159060505}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.47613979849720089, 0.03002846159060505}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.71770784194637294, 0.20450562684133039}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{0.64572077067586608, -0.048411141566665872}\"\",\n                \"\"hasCurveFrom\"\": true,\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0.68171430631111951, 0.078047242637332259}\"\"\n            }\n        ]\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\";\n\n\n        public static readonly string Star = @\"{\n    \"\"_class\"\": \"\"star\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"5062A1ED-DC37-43BD-8584-63061E58E180\"\",\n    \"\"edited\"\": false,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 149,\n        \"\"width\"\": 166,\n        \"\"x\"\": -4.062309147502248,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"numberOfPoints\"\": 5,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": true,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": [\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.5, 0.75}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.5, 0.75}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.5, 0.75}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.20610737385376349, 0.90450849718747373}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.20610737385376349, 0.90450849718747373}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.20610737385376349, 0.90450849718747373}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.26223587092621159, 0.57725424859373686}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.26223587092621159, 0.57725424859373686}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.26223587092621159, 0.57725424859373686}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.024471741852423179, 0.34549150281252639}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.024471741852423179, 0.34549150281252639}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.024471741852423179, 0.34549150281252639}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.35305368692688166, 0.29774575140626314}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.35305368692688166, 0.29774575140626314}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.35305368692688166, 0.29774575140626314}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.49999999999999989, 0}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.49999999999999989, 0}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.49999999999999989, 0}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.64694631307311823, 0.29774575140626314}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.64694631307311823, 0.29774575140626314}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.64694631307311823, 0.29774575140626314}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.97552825814757682, 0.34549150281252616}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.97552825814757682, 0.34549150281252616}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.97552825814757682, 0.34549150281252616}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.73776412907378841, 0.57725424859373675}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.73776412907378841, 0.57725424859373675}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.73776412907378841, 0.57725424859373675}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.79389262614623668, 0.90450849718747361}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.79389262614623668, 0.90450849718747361}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.79389262614623668, 0.90450849718747361}\"\"\n            }\n        ]\n    },\n    \"\"radius\"\": 0.5,\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\";\n\n\n        public static string ShapePathJson = @\"{\n    \"\"_class\"\": \"\"shapePath\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"14022049-0A0D-4460-A58D-3A723F1C232C\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 82,\n        \"\"width\"\": 107,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": false,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": [\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.0093457943925233603, 0.012195121951219514}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.0093457943925233603, 0.012195121951219514}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.0046728971962616802, 0.0060975609756097572}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.018691588785046721, 0.024390243902439029}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.018691588785046721, 0.024390243902439029}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.99532710280373837, 0.99390243902439024}\"\"\n            }\n        ]\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\";\n\n        public static string RectangleJson = @\"{\n    \"\"_class\"\": \"\"rectangle\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"ED225A48-7D11-4D2B-A98E-ED7950E23DBC\"\",\n    \"\"edited\"\": false,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"fixedRadius\"\": 0,\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 107,\n        \"\"width\"\": 147,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"hasConvertedToNewRoundCorners\"\": true,\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": true,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": [\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0, 0}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0, 0}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0, 0}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{1, 0}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{1, 0}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{1, 0}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{1, 1}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{1, 1}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{1, 1}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0, 1}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0, 1}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0, 1}\"\"\n            }\n        ]\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\";\n\n        public static readonly string SymbolMaster\n            = @\"{\n    \"\"_class\"\": \"\"symbolMaster\"\",\n    \"\"backgroundColor\"\": {\n        \"\"_class\"\": \"\"color\"\",\n        \"\"alpha\"\": 1,\n        \"\"blue\"\": 1,\n        \"\"green\"\": 1,\n        \"\"red\"\": 1\n    },\n    \"\"changeIdentifier\"\": 0,\n    \"\"do_objectID\"\": \"\"66DD1205-C68F-4A27-8257-DBC46F9F4AB7\"\",\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 107,\n        \"\"width\"\": 147,\n        \"\"x\"\": 100,\n        \"\"y\"\": 0\n    },\n    \"\"hasBackgroundColor\"\": false,\n    \"\"hasClickThrough\"\": true,\n    \"\"horizontalRulerData\"\": {\n        \"\"_class\"\": \"\"rulerData\"\",\n        \"\"base\"\": 0,\n        \"\"guides\"\": []\n    },\n    \"\"includeBackgroundColorInExport\"\": true,\n    \"\"includeBackgroundColorInInstance\"\": false,\n    \"\"includeInCloudUpload\"\": true,\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"layers\"\": [\n        {\n            \"\"_class\"\": \"\"shapeGroup\"\",\n            \"\"clippingMaskMode\"\": 0,\n            \"\"do_objectID\"\": \"\"4EFE06E8-D0CE-4BE9-9AF3-423AF7F953BA\"\",\n            \"\"exportOptions\"\": {\n                \"\"_class\"\": \"\"exportOptions\"\",\n                \"\"exportFormats\"\": [],\n                \"\"includedLayerIds\"\": [],\n                \"\"layerOptions\"\": 0,\n                \"\"shouldTrim\"\": false\n            },\n            \"\"frame\"\": {\n                \"\"_class\"\": \"\"rect\"\",\n                \"\"constrainProportions\"\": false,\n                \"\"height\"\": 107,\n                \"\"width\"\": 147,\n                \"\"x\"\": 0,\n                \"\"y\"\": 0\n            },\n            \"\"hasClickThrough\"\": false,\n            \"\"hasClippingMask\"\": false,\n            \"\"isFlippedHorizontal\"\": false,\n            \"\"isFlippedVertical\"\": false,\n            \"\"isLocked\"\": false,\n            \"\"isVisible\"\": true,\n            \"\"layerListExpandedType\"\": 1,\n            \"\"layers\"\": [\n                {\n                    \"\"_class\"\": \"\"rectangle\"\",\n                    \"\"booleanOperation\"\": -1,\n                    \"\"do_objectID\"\": \"\"ED225A48-7D11-4D2B-A98E-ED7950E23DBC\"\",\n                    \"\"edited\"\": false,\n                    \"\"exportOptions\"\": {\n                        \"\"_class\"\": \"\"exportOptions\"\",\n                        \"\"exportFormats\"\": [],\n                        \"\"includedLayerIds\"\": [],\n                        \"\"layerOptions\"\": 0,\n                        \"\"shouldTrim\"\": false\n                    },\n                    \"\"fixedRadius\"\": 0,\n                    \"\"frame\"\": {\n                        \"\"_class\"\": \"\"rect\"\",\n                        \"\"constrainProportions\"\": false,\n                        \"\"height\"\": 107,\n                        \"\"width\"\": 147,\n                        \"\"x\"\": 0,\n                        \"\"y\"\": 0\n                    },\n                    \"\"hasConvertedToNewRoundCorners\"\": true,\n                    \"\"isFlippedHorizontal\"\": false,\n                    \"\"isFlippedVertical\"\": false,\n                    \"\"isLocked\"\": false,\n                    \"\"isVisible\"\": true,\n                    \"\"layerListExpandedType\"\": 0,\n                    \"\"name\"\": \"\"Path\"\",\n                    \"\"nameIsFixed\"\": false,\n                    \"\"path\"\": {\n                        \"\"_class\"\": \"\"path\"\",\n                        \"\"isClosed\"\": true,\n                        \"\"pointRadiusBehaviour\"\": 1,\n                        \"\"points\"\": [\n                            {\n                                \"\"_class\"\": \"\"curvePoint\"\",\n                                \"\"cornerRadius\"\": 0,\n                                \"\"curveFrom\"\": \"\"{0, 0}\"\",\n                                \"\"curveMode\"\": 1,\n                                \"\"curveTo\"\": \"\"{0, 0}\"\",\n                                \"\"hasCurveFrom\"\": false,\n                                \"\"hasCurveTo\"\": false,\n                                \"\"point\"\": \"\"{0, 0}\"\"\n                            },\n                            {\n                                \"\"_class\"\": \"\"curvePoint\"\",\n                                \"\"cornerRadius\"\": 0,\n                                \"\"curveFrom\"\": \"\"{1, 0}\"\",\n                                \"\"curveMode\"\": 1,\n                                \"\"curveTo\"\": \"\"{1, 0}\"\",\n                                \"\"hasCurveFrom\"\": false,\n                                \"\"hasCurveTo\"\": false,\n                                \"\"point\"\": \"\"{1, 0}\"\"\n                            },\n                            {\n                                \"\"_class\"\": \"\"curvePoint\"\",\n                                \"\"cornerRadius\"\": 0,\n                                \"\"curveFrom\"\": \"\"{1, 1}\"\",\n                                \"\"curveMode\"\": 1,\n                                \"\"curveTo\"\": \"\"{1, 1}\"\",\n                                \"\"hasCurveFrom\"\": false,\n                                \"\"hasCurveTo\"\": false,\n                                \"\"point\"\": \"\"{1, 1}\"\"\n                            },\n                            {\n                                \"\"_class\"\": \"\"curvePoint\"\",\n                                \"\"cornerRadius\"\": 0,\n                                \"\"curveFrom\"\": \"\"{0, 1}\"\",\n                                \"\"curveMode\"\": 1,\n                                \"\"curveTo\"\": \"\"{0, 1}\"\",\n                                \"\"hasCurveFrom\"\": false,\n                                \"\"hasCurveTo\"\": false,\n                                \"\"point\"\": \"\"{0, 1}\"\"\n                            }\n                        ]\n                    },\n                    \"\"resizingConstraint\"\": 63,\n                    \"\"resizingType\"\": 0,\n                    \"\"rotation\"\": 0,\n                    \"\"shouldBreakMaskChain\"\": false\n                }\n            ],\n            \"\"name\"\": \"\"Rectangle\"\",\n            \"\"nameIsFixed\"\": false,\n            \"\"resizingConstraint\"\": 63,\n            \"\"resizingType\"\": 0,\n            \"\"rotation\"\": 0,\n            \"\"shouldBreakMaskChain\"\": false,\n            \"\"style\"\": {\n                \"\"_class\"\": \"\"style\"\",\n                \"\"borders\"\": [\n                    {\n                        \"\"_class\"\": \"\"border\"\",\n                        \"\"color\"\": {\n                            \"\"_class\"\": \"\"color\"\",\n                            \"\"alpha\"\": 1,\n                            \"\"blue\"\": 0.1652514934539795,\n                            \"\"green\"\": 0.3430676162242889,\n                            \"\"red\"\": 0.5435072779655457\n                        },\n                        \"\"fillType\"\": 0,\n                        \"\"isEnabled\"\": true,\n                        \"\"position\"\": 1,\n                        \"\"thickness\"\": 3\n                    }\n                ],\n                \"\"endDecorationType\"\": 0,\n                \"\"fills\"\": [\n                    {\n                        \"\"_class\"\": \"\"fill\"\",\n                        \"\"color\"\": {\n                            \"\"_class\"\": \"\"color\"\",\n                            \"\"alpha\"\": 1,\n                            \"\"blue\"\": 0.4370815277361734,\n                            \"\"green\"\": 0.5846576038671782,\n                            \"\"red\"\": 0.7510097789115646\n                        },\n                        \"\"fillType\"\": 0,\n                        \"\"isEnabled\"\": true,\n                        \"\"noiseIndex\"\": 0,\n                        \"\"noiseIntensity\"\": 0,\n                        \"\"patternFillType\"\": 1,\n                        \"\"patternTileScale\"\": 1\n                    }\n                ],\n                \"\"miterLimit\"\": 10,\n                \"\"startDecorationType\"\": 0\n            },\n            \"\"windingRule\"\": 1\n        }\n    ],\n    \"\"name\"\": \"\"Rectangle\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"resizesContent\"\": false,\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": true,\n    \"\"style\"\": {\n        \"\"_class\"\": \"\"style\"\",\n        \"\"endDecorationType\"\": 0,\n        \"\"miterLimit\"\": 10,\n        \"\"startDecorationType\"\": 0\n    },\n    \"\"symbolID\"\": \"\"6E15C8FA-A704-4824-AEDC-48889D668772\"\",\n    \"\"verticalRulerData\"\": {\n        \"\"_class\"\": \"\"rulerData\"\",\n        \"\"base\"\": 0,\n        \"\"guides\"\": []\n    }\n}\";\n\n        public static readonly string SymbolMasterWithInstance\n            = @\"{\n    \"\"_class\"\": \"\"symbolMaster\"\",\n    \"\"backgroundColor\"\": {\n        \"\"_class\"\": \"\"color\"\",\n        \"\"alpha\"\": 1,\n        \"\"blue\"\": 1,\n        \"\"green\"\": 1,\n        \"\"red\"\": 1\n    },\n    \"\"changeIdentifier\"\": 0,\n    \"\"do_objectID\"\": \"\"2177332F-2E5A-4815-BD5A-A3744EC9E6E9\"\",\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 107,\n        \"\"width\"\": 147,\n        \"\"x\"\": 347,\n        \"\"y\"\": 0\n    },\n    \"\"hasBackgroundColor\"\": false,\n    \"\"hasClickThrough\"\": true,\n    \"\"horizontalRulerData\"\": {\n        \"\"_class\"\": \"\"rulerData\"\",\n        \"\"base\"\": 0,\n        \"\"guides\"\": []\n    },\n    \"\"includeBackgroundColorInExport\"\": true,\n    \"\"includeBackgroundColorInInstance\"\": false,\n    \"\"includeInCloudUpload\"\": true,\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"layers\"\": [\n        {\n            \"\"_class\"\": \"\"symbolInstance\"\",\n            \"\"do_objectID\"\": \"\"F06205E4-53CC-4441-9567-0827A11C72A7\"\",\n            \"\"exportOptions\"\": {\n                \"\"_class\"\": \"\"exportOptions\"\",\n                \"\"exportFormats\"\": [],\n                \"\"includedLayerIds\"\": [],\n                \"\"layerOptions\"\": 0,\n                \"\"shouldTrim\"\": false\n            },\n            \"\"frame\"\": {\n                \"\"_class\"\": \"\"rect\"\",\n                \"\"constrainProportions\"\": false,\n                \"\"height\"\": 107,\n                \"\"width\"\": 147,\n                \"\"x\"\": 0,\n                \"\"y\"\": 0\n            },\n            \"\"horizontalSpacing\"\": 0,\n            \"\"isFlippedHorizontal\"\": false,\n            \"\"isFlippedVertical\"\": false,\n            \"\"isLocked\"\": false,\n            \"\"isVisible\"\": true,\n            \"\"layerListExpandedType\"\": 0,\n            \"\"masterInfluenceEdgeMaxXPadding\"\": 0,\n            \"\"masterInfluenceEdgeMaxYPadding\"\": 0,\n            \"\"masterInfluenceEdgeMinXPadding\"\": 0,\n            \"\"masterInfluenceEdgeMinYPadding\"\": 0,\n            \"\"name\"\": \"\"Rectangle\"\",\n            \"\"nameIsFixed\"\": false,\n            \"\"overrideValues\"\": [],\n            \"\"overrides\"\": {},\n            \"\"resizingConstraint\"\": 63,\n            \"\"resizingType\"\": 0,\n            \"\"rotation\"\": 0,\n            \"\"scale\"\": 1,\n            \"\"shouldBreakMaskChain\"\": false,\n            \"\"style\"\": {\n                \"\"_class\"\": \"\"style\"\",\n                \"\"endDecorationType\"\": 0,\n                \"\"miterLimit\"\": 10,\n                \"\"startDecorationType\"\": 0\n            },\n            \"\"symbolID\"\": \"\"6E15C8FA-A704-4824-AEDC-48889D668772\"\",\n            \"\"verticalSpacing\"\": 0\n        }\n    ],\n    \"\"name\"\": \"\"Rectangle\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"resizesContent\"\": false,\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": true,\n    \"\"style\"\": {\n        \"\"_class\"\": \"\"style\"\",\n        \"\"endDecorationType\"\": 0,\n        \"\"miterLimit\"\": 10,\n        \"\"startDecorationType\"\": 0\n    },\n    \"\"symbolID\"\": \"\"9C67445D-C26C-4030-A930-6789D3FF0A5F\"\",\n    \"\"verticalRulerData\"\": {\n        \"\"_class\"\": \"\"rulerData\"\",\n        \"\"base\"\": 0,\n        \"\"guides\"\": []\n    }\n        }\";\n\n        public static string Path1 = @\"\n{\n    \"\"_class\"\": \"\"shapePath\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"7BC24E16-A230-467D-95FE-AAC843FF6EE5\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 108.18359375,\n        \"\"width\"\": 93.63795696362324,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": false,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": [\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{1.2320975114271207, 0.08196425347535656}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{-1.2320975114271207, -0.081964253475356769}\"\",\n                \"\"hasCurveFrom\"\": true,\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0, 0}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.94613074518933793, 0.99999999999999989}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.94613074518933793, 0.99999999999999989}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.94613074518933793, 0.99999999999999989}\"\"\n            }\n        ]\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\n\";\n        public static string Path2 = @\"\n{\n    \"\"_class\"\": \"\"shapePath\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"B97607D4-D0D0-44B7-9655-3ADC9F1A376E\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 93.8828125,\n        \"\"width\"\": 162.2734375,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": false,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": [\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0, 0.99999999999999989}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0, 0.99999999999999989}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0, 0.99999999999999989}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.71461746239970425, 2.8191568720124848e-17}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{0.20676330886792837, -3.1097098177818892e-17}\"\",\n                \"\"hasCurveFrom\"\": true,\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0.46069038563381631, 0}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{1, 1}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{1, 1}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{1, 1}\"\"\n            }\n        ]\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\";\n\n\n        public static string PathInvalidJson = @\"\n{\n    \"\"_class\"\": \"\"shapePath\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"7BC24E16-A230-467D-95FE-AAC843FF6EE5\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 108.18359375,\n        \"\"width\"\": 93.63795696362324,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": \"\"wrong\"\",\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": [\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{1.2320975114271207, 0.08196425347535656}\"\",\n                \"\"curveMode\"\": 2,\n                \"\"curveTo\"\": \"\"{-1.2320975114271207, -0.081964253475356769}\"\",\n                \"\"hasCurveFrom\"\": \"\"foo\"\",\n                \"\"hasCurveTo\"\": true,\n                \"\"point\"\": \"\"{0, 0}\"\"\n            },\n            {\n                \"\"_class\"\": \"\"curvePoint\"\",\n                \"\"cornerRadius\"\": 0,\n                \"\"curveFrom\"\": \"\"{0.94613074518933793, 0.99999999999999989}\"\",\n                \"\"curveMode\"\": 1,\n                \"\"curveTo\"\": \"\"{0.94613074518933793, 0.99999999999999989}\"\",\n                \"\"hasCurveFrom\"\": false,\n                \"\"hasCurveTo\"\": false,\n                \"\"point\"\": \"\"{0.94613074518933793, 0.99999999999999989}\"\"\n            }\n        ]\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n}\n\";\n\n       public static string JellyfishLayerJson = @\"\n\n{\n    \"\"_class\"\": \"\"jellyfish\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"7BC24E16-A230-467D-95FE-AAC843FF6EE5\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 100,\n        \"\"width\"\": 120,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"name\"\": \"\"Jellyfish\"\",\n    \"\"nameIsFixed\"\": false,\n\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n}\n\";\n\n        public static string MaskedShapeGroup =\n            @\"{\n    \"\"_class\"\": \"\"shapeGroup\"\",\n    \"\"clippingMaskMode\"\": 0,\n    \"\"do_objectID\"\": \"\"1424E84F-1C34-4355-A543-B76FEBDCB4F2\"\",\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 101,\n        \"\"width\"\": 60,\n        \"\"x\"\": 38,\n        \"\"y\"\": 80\n    },\n    \"\"hasClickThrough\"\": false,\n    \"\"hasClippingMask\"\": true,\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 1,\n    \"\"layers\"\": [],\n    \"\"name\"\": \"\"ShapeGroup\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false,\n    \"\"style\"\": {\n        \"\"_class\"\": \"\"style\"\",\n        \"\"borders\"\": [\n            {\n                \"\"_class\"\": \"\"border\"\",\n                \"\"color\"\": {\n                    \"\"_class\"\": \"\"color\"\",\n                    \"\"alpha\"\": 1,\n                    \"\"blue\"\": 1,\n                    \"\"green\"\": 1,\n                    \"\"red\"\": 1\n                },\n                \"\"fillType\"\": 0,\n                \"\"isEnabled\"\": true,\n                \"\"position\"\": 1,\n                \"\"thickness\"\": 1\n            }\n        ],\n        \"\"endDecorationType\"\": 0,\n        \"\"fills\"\": [\n            {\n                \"\"_class\"\": \"\"fill\"\",\n                \"\"color\"\": {\n                    \"\"_class\"\": \"\"color\"\",\n                    \"\"alpha\"\": 1,\n                    \"\"blue\"\": 1,\n                    \"\"green\"\": 0,\n                    \"\"red\"\": 0\n                },\n                \"\"fillType\"\": 0,\n                \"\"isEnabled\"\": true,\n                \"\"noiseIndex\"\": 0,\n                \"\"noiseIntensity\"\": 0,\n                \"\"patternFillType\"\": 1,\n                \"\"patternTileScale\"\": 1\n            }\n        ],\n        \"\"miterLimit\"\": 10,\n        \"\"startDecorationType\"\": 0\n    },\n    \"\"windingRule\"\": 1\n}\";\n\n    public static string ShapeWithVerticalFlip = @\"{\n    \"\"_class\"\": \"\"shapePath\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"14022049-0A0D-4460-A58D-3A723F1C232C\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 82,\n        \"\"width\"\": 107,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isFlippedVertical\"\": true,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": false,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": []\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\";\n\n\n        public static string ShapeWithoutFlippedProps = @\"{\n    \"\"_class\"\": \"\"shapePath\"\",\n    \"\"booleanOperation\"\": -1,\n    \"\"do_objectID\"\": \"\"14022049-0A0D-4460-A58D-3A723F1C232C\"\",\n    \"\"edited\"\": true,\n    \"\"exportOptions\"\": {\n        \"\"_class\"\": \"\"exportOptions\"\",\n        \"\"exportFormats\"\": [],\n        \"\"includedLayerIds\"\": [],\n        \"\"layerOptions\"\": 0,\n        \"\"shouldTrim\"\": false\n    },\n    \"\"frame\"\": {\n        \"\"_class\"\": \"\"rect\"\",\n        \"\"constrainProportions\"\": false,\n        \"\"height\"\": 82,\n        \"\"width\"\": 107,\n        \"\"x\"\": 0,\n        \"\"y\"\": 0\n    },\n    \"\"isFlippedHorizontal\"\": false,\n    \"\"isLocked\"\": false,\n    \"\"isVisible\"\": true,\n    \"\"layerListExpandedType\"\": 0,\n    \"\"name\"\": \"\"Path\"\",\n    \"\"nameIsFixed\"\": false,\n    \"\"path\"\": {\n        \"\"_class\"\": \"\"path\"\",\n        \"\"isClosed\"\": false,\n        \"\"pointRadiusBehaviour\"\": 1,\n        \"\"points\"\": []\n    },\n    \"\"resizingConstraint\"\": 63,\n    \"\"resizingType\"\": 0,\n    \"\"rotation\"\": 0,\n    \"\"shouldBreakMaskChain\"\": false\n}\";\n    }\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/SymbolClassNameBuilderTests.cs",
    "content": "﻿using System.Collections.Generic;\nusing NUnit.Framework;\nusing SketchConverter.SketchModel;\nusing SketchConverter.UxBuilder;\n\nnamespace SketchConverterTests\n{\n\tpublic class SymbolClassNameBuilderTests\n\t{\n\t\tprivate SymbolClassNameBuilder _builder;\n\t\tprivate SketchSymbolMaster _symbolMaster;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_builder = new SymbolClassNameBuilder();\n\t\t\t_symbolMaster = DocumentBuilder.SketchSymbolMaster(\"TheArtistFormerlyKnownAsPrince\");\n\t\t\t_builder.Init(new List<SketchSymbolMaster> {_symbolMaster});\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GivenIdOfExistingSymbolReturnsThat()\n\t\t{\n\t\t\tAssert.That(\n\t\t\t\t_builder.GetClassName(_symbolMaster),\n\t\t\t\tDoes.Contain(\"TheArtistFormerlyKnownAsPrince\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GivenIdOfNonExistingSymbolMasterThrows()\n\t\t{\n\t\t\tvar otherSymbol = DocumentBuilder.SketchSymbolMaster(\"OtherSymbol\");\n\t\t\tvar message = \"Could not find symbol master 'OtherSymbol' (SymbolId '\"+ otherSymbol.SymbolId + \"').\";\n\t\t\tAssert.That(\n\t\t\t\t() => _builder.GetClassName(otherSymbol),\n\t\t\t\tThrows.TypeOf<UxBuilderException>().With.Message.EqualTo(message));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SymbolInstanceReferringToNonExistingSymbolMasterThrows()\n\t\t{\n\t\t\tvar instance = DocumentBuilder.SymbolInstanceOf(DocumentBuilder.SketchSymbolMaster(\"OtherMaster\"), \"Cymbal\");\n\t\t\tvar message = \"The symbol 'Cymbal' is an instance of a symbol we can't find. Could it be that it's defined in another Sketch file? That is currently not supported. (SymbolId '\" + instance.SymbolId + \"')\";\n\t\t\tAssert.That(\n\t\t\t\t() => _builder.GetClassName(instance),\n\t\t\t\tThrows.TypeOf<UxBuilderException>().With.Message.EqualTo(message));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/SymbolsUxBuilderTests.cs",
    "content": "﻿using System.IO;\nusing System.Linq;\nusing NUnit.Framework;\nusing SketchConverter.UxBuilder;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class SymbolsUxBuilderTests\n\t{\n\t\tprivate string _outputDirectory;\n\n\t\t[SetUp]\n\t\tpublic void FixtureSetup()\n\t\t{\n\t\t\t_outputDirectory = Path.Combine(TestContext.CurrentContext.WorkDirectory, \"Sketch\");\n\t\t\tDirectory.CreateDirectory(_outputDirectory);\n\t\t}\n\n\t\t[TearDown]\n\t\tpublic void CleanUpTestDirectory()\n\t\t{\n\t\t\t// delete files in _outputDirectory between each test method so that we can\n\t\t\t// reuse symbol names and also not leave a mess.\n\t\t\tDirectory.Delete(_outputDirectory, true);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NoSymbolsInSketchDocumentProducesInfo()\n\t\t{\n\t\t\tvar document = DocumentBuilder.SketchDocument();\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\n\t\t\tbuilder.Build(document, _outputDirectory);\n\t\t\tvar files = Directory.EnumerateFiles(_outputDirectory);\n\t\t\tAssert.IsEmpty(files);\n\t\t\tAssert.AreEqual(1, logger.Messages.Count);\n\t\t\tAssert.That(logger.Messages.First(), Does.Match(\"INFO.*No UX generated\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void OneSymbolCreateOneUxClass()\n\t\t{\n\t\t\tvar sketchSymbolMaster = DocumentBuilder.SketchSymbolMaster(\"MySymbol\");\n\t\t\tvar document = DocumentBuilder.SketchDocument()\n\t\t\t\t.WithSymbol(sketchSymbolMaster);\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\n\t\t\tbuilder.Build(document, _outputDirectory);\n\n\t\t\tvar files = Directory.EnumerateFiles(_outputDirectory);\n\t\t\tAssert.AreEqual(1, files.Count());\n\t\t\tAssert.IsTrue(files.First().EndsWith(\"MySymbol.ux\"));\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic void TwoSketchSymbolsProducesTwoUxClassesInTwoFiles()\n\t\t{\n\t\t\tvar document = DocumentBuilder.SketchDocument()\n\t\t\t\t.WithSymbol(DocumentBuilder.SketchSymbolMaster(\"MySymbol\").WithLayer(DocumentBuilder.Rectangle(\"R\")))\n\t\t\t\t.WithSymbol(DocumentBuilder.SketchSymbolMaster(\"MySymbol2\").WithLayer(DocumentBuilder.Rectangle(\"R2\")));\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\n\t\t\tbuilder.Build(document, _outputDirectory);\n\n\n\t\t\tvar files = Directory.EnumerateFiles(_outputDirectory).ToList();\n\t\t\tAssert.AreEqual(2, files.Count());\n\t\t\tAssert.IsTrue(files.First().EndsWith(\"MySymbol.ux\"));\n\t\t\tAssert.IsTrue(files.Last().EndsWith(\"MySymbol2.ux\"));\n\t\t\tAssert.AreEqual(0, logger.ErrorsAndWarnings().Count);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void NestedSketchSymbolCreatesUxInstance()\n\t\t{\n\t\t\tvar childSymbol = DocumentBuilder.SketchSymbolMaster(\"Inner\").WithLayer(DocumentBuilder.Rectangle(\"R1\"));\n\n\t\t\tvar document = DocumentBuilder.SketchDocument()\n\t\t\t\t.WithSymbol(childSymbol)\n\t\t\t\t.WithSymbol(DocumentBuilder.SketchSymbolMaster(\"Outer\").WithLayer(DocumentBuilder.SymbolInstanceOf(childSymbol)));\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\t\t\tbuilder.Build(document, _outputDirectory);\n\n\t\t\tvar files = Directory.EnumerateFiles(_outputDirectory);\n\t\t\tAssert.AreEqual(2, files.Count());\n\t\t\tAssert.IsTrue(files.First().EndsWith(\"Inner.ux\"));\n\t\t\tAssert.IsTrue(files.Last().EndsWith(\"Outer.ux\"));\n\t\t\tAssert.AreEqual(0, logger.ErrorsAndWarnings().Count);\n\n\t\t\tvar ux = File.ReadAllText(files.Last());\n\n\t\t\tAssert.IsTrue(ux.Contains(\"<Sketch.Inner\"));\n\t\t\tAssert.IsTrue(ux.Contains(\"</Sketch.Inner>\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SymbolWithNoLayersDoesNotGetWritten()\n\t\t{\n\t\t\tvar document = DocumentBuilder.SketchDocument()\n\t\t\t\t.WithSymbol(DocumentBuilder.SketchSymbolMasterWithNoLayers(\"Harry\"));\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\t\t\tbuilder.Build(document, _outputDirectory);\n\n\t\t\tvar file = Directory.EnumerateFiles(_outputDirectory);\n\t\t\tAssert.AreEqual(0, file.Count());\n\n\t\t\tAssert.AreEqual(1, logger.ErrorsAndWarnings().Count);\n\t\t\tAssert.That(logger.ErrorsAndWarnings().First(),\n\t\t\t\tDoes.Match(\"Skipping symbol 'Sketch.Harry' which has no supported layers.\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SymbolWithInvalidCharacterInNameGetsSkippedAndLogged()\n\t\t{\n\t\t\tvar sketchSymbolMaster = DocumentBuilder.SketchSymbolMaster(\"a b\");\n\t\t\tvar document = DocumentBuilder.SketchDocument()\n\t\t\t\t.WithSymbol(sketchSymbolMaster);\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\n\t\t\tbuilder.Build(document, _outputDirectory);\n\n\t\t\tvar files = Directory.EnumerateFiles(_outputDirectory);\n\t\t\tAssert.That(files.Count(), Is.EqualTo(0));\n\t\t\tAssert.That(logger.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tAssert.That(logger.ErrorsAndWarnings()[0], Does.Contain(\"The symbol name 'a b' contains an invalid character\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SymbolWithReservedNameGetsSkippedAndLogged()\n\t\t{\n\t\t\tvar sketchSymbolMaster = DocumentBuilder.SketchSymbolMaster(\"class\");\n\t\t\tvar document = DocumentBuilder.SketchDocument()\n\t\t\t\t.WithSymbol(sketchSymbolMaster);\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\n\t\t\tbuilder.Build(document, _outputDirectory);\n\n\t\t\tvar files = Directory.EnumerateFiles(_outputDirectory);\n\t\t\tAssert.That(files.Count(), Is.EqualTo(0));\n\t\t\tAssert.That(logger.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tAssert.That(logger.ErrorsAndWarnings()[0], Does.Contain(\"The symbol name 'class' is a reserved word.\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TwoSymbolsWithSameNameGivesErrorAndOnlyWritesOne()\n\t\t{\n\t\t\tvar document = DocumentBuilder.SketchDocument()\n\t\t\t\t.WithSymbol(DocumentBuilder.SketchSymbolMaster(\"NameOfTheGame\").WithLayer(DocumentBuilder.Rectangle(\"R\")))\n\t\t\t\t.WithSymbol(DocumentBuilder.SketchSymbolMaster(\"NameOfTheGame\").WithLayer(DocumentBuilder.Rectangle(\"R\")));\n\n\t\t\tvar logger = new MessageListLogger();\n\t\t\tvar builder = new SymbolsUxBuilder(logger);\n\n\t\t\tbuilder.Build(document, _outputDirectory);\n\n\n\t\t\tvar files = Directory.EnumerateFiles(_outputDirectory).ToList();\n\t\t\tAssert.That(files.Count(), Is.EqualTo(1));\n\t\t\tAssert.That(files.First(), Does.EndWith(\"NameOfTheGame.ux\"));\n\t\t\tAssert.That(logger.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tAssert.That(logger.ErrorsAndWarnings()[0], Does.Match(\"More than one symbol named 'NameOfTheGame' was found!\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/Transforms/TextPropertyTransformTests.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing NUnit.Framework;\nusing SketchConverter.Transforms;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverterTests.Transforms\n{\n\tpublic class TextPropertyTransformTests\n\t{\n\t\t[Test]\n\t\tpublic void CreatesPropertyForStringValue()\n\t\t{\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar transform = new TextPropertyTransform(log);\n\n\t\t\tvar node = new UxNode(\"Panel\");\n\t\t\tnode.Children.Add(CreateTextNode(\"TextLayer\", \"Guten Tag!\"));\n\n\t\t\ttransform.Apply(node);\n\n\t\t\tvar propertyShouldBeFirstElement = (UxNode)node.Children.ToList()[0];\n\t\t\tAssertHasAttribute(propertyShouldBeFirstElement, \"ux:Property\", \"TextLayer\");\n\n\t\t\tvar texts = node.ChildrenOfClass(\"Text\").ToList();\n\t\t\tAssert.That(texts.Count(), Is.EqualTo(1));\n\t\t\tAssertHasAttribute(texts[0], \"Value\", \"{Property TextLayer}\");\n\n\t\t\tAssertHasAttribute(node, \"TextLayer\", \"Guten Tag!\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CreatesPropertiesForSeveralStringValues()\n\t\t{\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar transform = new TextPropertyTransform(log);\n\n\t\t\tvar node = new UxNode(\"Panel\");\n\t\t\tnode.Children.Add(CreateTextNode(\"FirstLayer\", \"Guten Tag!\"));\n\t\t\tnode.Children.Add(CreateTextNode(\"OtherLayer\", \"Wie geht's?\"));\n\n\t\t\ttransform.Apply(node);\n\n\t\t\tvar firstPropertyShouldBeFirstElement = (UxNode)node.Children.ToList()[0];\n\t\t\tAssertHasAttribute(firstPropertyShouldBeFirstElement, \"ux:Property\", \"FirstLayer\");\n\n\t\t\tvar secondPropertyShouldBeSecondElement = (UxNode)node.Children.ToList()[1];\n\t\t\tAssertHasAttribute(secondPropertyShouldBeSecondElement, \"ux:Property\", \"OtherLayer\");\n\n\t\t\tvar texts = node.ChildrenOfClass(\"Text\").ToList();\n\t\t\tAssert.That(texts.Count(), Is.EqualTo(2));\n\t\t\tAssertHasAttribute(texts[0], \"Value\", \"{Property FirstLayer}\");\n\t\t\tAssertHasAttribute(texts[1], \"Value\", \"{Property OtherLayer}\");\n\n\t\t\tAssertHasAttribute(node, \"FirstLayer\", \"Guten Tag!\");\n\t\t\tAssertHasAttribute(node, \"OtherLayer\", \"Wie geht's?\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void SkipsAndLogsInvalidNames()\n\t\t{\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar transform = new TextPropertyTransform(log);\n\n\t\t\tvar node = new UxNode(\"Panel\");\n\t\t\tnode.Children.Add(CreateTextNode(\"I have a space\", \"Ohayou Gozaimasu!\"));\n\t\t\tnode.Children.Add(CreateTextNode(\"var\", \"Konbanwa\"));\n\n\t\t\ttransform.Apply(node);\n\n\t\t\tvar stringProperties = node.Children.Where(c => c is UxNode).Cast<UxNode>().Where(c => c.ClassName == \"string\");\n\t\t\tAssert.That(stringProperties.Count(), Is.EqualTo(0));\n\n\t\t\tAssert.That(node.Attributes.Keys, Does.Not.Contain(\"var\"));\n\t\t\tAssert.That(node.Attributes.Keys, Does.Not.Contain(\"I have a space\"));\n\n\t\t\tAssert.That(log.Warnings(), Does.Contain(\"Could not create a text property for the layer 'var', as 'var' is a reserved word. Please choose another name.\"));\n\t\t\tAssert.That(log.Warnings(), Does.Contain(\"Could not create a text property for the layer 'I have a space', as it contains an invalid character. Please only use the letters a-z, numbers, or underscores, and don't start the name with a number.\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void GivenDuplicateNamesCreatesPropertyForOneAndLogsErrorForTheOther()\n\t\t{\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar transform = new TextPropertyTransform(log);\n\n\t\t\tvar node = new UxNode(\"Panel\");\n\t\t\tnode.Children.Add(CreateTextNode(\"Strata\", \"Grata\"));\n\t\t\tnode.Children.Add(CreateTextNode(\"Strata\", \"NonGrata\"));\n\n\t\t\ttransform.Apply(node);\n\n\t\t\tAssertHasAttribute((UxNode)node.Children.ToList()[0], \"ux:Property\", \"Strata\");\n\t\t\tAssertHasAttribute(node.ChildrenOfClass(\"Text\").ToList()[0], \"Value\", \"{Property Strata}\");\n\t\t\tAssertHasAttribute(node, \"Strata\", \"Grata\");\n\n\t\t\tAssert.That(log.Warnings().Count(), Is.EqualTo(1));\n\t\t\tAssert.That(log.Warnings().First(), Is.EqualTo(\"Could not create a text property for the layer 'Strata', as a text property for another layer with the same name has already been created. Please use unique names for text layers within the same symbol.\"));\n\t\t}\n\n\t\tprivate UxNode CreateTextNode(string layerName, string value)\n\t\t{\n\t\t\tvar text = new UxNode(\"Text\") {SketchLayerName = layerName};\n\t\t\ttext.Attributes[\"Value\"] = new UxString(value);\n\t\t\treturn text;\n\t\t}\n\n\t\tprivate void AssertHasAttribute(UxNode node, string name, string value)\n\t\t{\n\t\t\tvar attributes = node.Attributes;\n\t\t\tAssert.That(attributes.Keys, Does.Contain(name));\n\t\t\tAssert.That(((UxString)attributes[name]).Value, Is.EqualTo(value));\n\t\t}\n\t}\n\n\tpublic static class Extensions\n\t{\n\t\tpublic static IEnumerable<UxNode> ChildrenOfClass(this UxNode node, string className)\n\t\t{\n\t\t\treturn node.Children\n\t\t\t\t.Where(c => c is UxNode && ((UxNode) c).ClassName == className)\n\t\t\t\t.Cast<UxNode>();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/UxBuilderTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing NSubstitute;\nusing NUnit.Framework;\nusing SketchConverter;\nusing SketchConverter.SketchModel;\nusing SketchConverter.UxBuilder;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class UxBuilderTests\n\t{\n\t\tprivate readonly bool Mask = true; // make it more readable where masking is set\n\n\t\t[Test]\n\t\tpublic void BuildUxForSketchShapeGroupWithMaskingGivesUnsupportedWarnings()\n\t\t{\n\t\t\tvar shapeGroup = new SketchShapeGroup(\n\t\t\t\tnew SketchLayer(CreateLayer(5, 5), new List<SketchLayer>()),\n\t\t\t\tMask);\n\n\t\t\tvar parentGroup =\n\t\t\t\tnew SketchGroup(\n\t\t\t\t\tnew SketchLayer(\n\t\t\t\t\t\tnew SketchLayer(\n\t\t\t\t\t\t\tGuid.Empty,\n\t\t\t\t\t\t\tnew SketchLayer(\n\t\t\t\t\t\t\t\tCreateLayer(20,20),\n\t\t\t\t\t\t\t\tnew List<SketchLayer>()),\n\t\t\t\t\t\t\tnew SketchRect(0, 0, 10, 10, false),\n\t\t\t\t\t\t\t\"Dummy\",\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\tDummyAlignment(),\n\t\t\t\t\t\t\t0, false, false,\n\t\t\t\t\t\t\tOptional.None(),\n\t\t\t\t\t\t\tnew List<SketchLayer>()),\n\t\t\t\t\t\tnew List<SketchLayer>{shapeGroup}));\n\t\t\tshapeGroup.Parent = parentGroup;\n\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar uxBuilder = new UxBuilder(new SymbolClassNameBuilder(), Substitute.For<IAssetEmitter>(), log);\n\n\t\t\tvar uxNode = uxBuilder.BuildLayer(parentGroup);\n\t\t\tAssert.That(uxNode, Is.Not.Null);\n\n\t\t\tvar ux = uxNode.SerializeUx(new UxSerializerContext());\n\t\t\tAssert.That(ux, Is.EqualTo(\"<Panel Width=\\\"50%\\\" Height=\\\"50%\\\" Alignment=\\\"TopLeft\\\" Margin=\\\"0\\\">\\n\\t<!-- Dummy -->\\n\\t<!-- Masked shape group is not supported in UX -->\\n</Panel>\"));\n\t\t\tAssert.That(log.ErrorsAndWarnings().First(), Does.Match(\"WARNING:\\tMasked shapes are not supported Dummy\"));\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void BuildUxForSketchShapeGroupWithoutMaskingGivesNoWarnings()\n\t\t{\n\t\t\tvar rectangle = new SketchRectangle(\n\t\t\t\tCreateLayer(5,5),\n\t\t\t\tnew SketchPath(CurvePointUtils.RectanglePath(new CornerRadius(2)), true),\n\t\t\t\tSketchBooleanOperation.NoOperation);\n\n\t\t\tvar parentGroup =\n\t\t\t\tnew SketchGroup(\n\t\t\t\t\tnew SketchLayer(\n\t\t\t\t\t\tnew SketchLayer(\n\t\t\t\t\t\t\tGuid.Empty,\n\t\t\t\t\t\t\tnew SketchLayer(\n\t\t\t\t\t\t\t\tCreateLayer(20,20),\n\t\t\t\t\t\t\t\tnew List<SketchLayer>()),\n\t\t\t\t\t\t\tnew SketchRect(0, 0, 10, 10, false),\n\t\t\t\t\t\t\t\"Dummy\",\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\tDummyAlignment(),\n\t\t\t\t\t\t\t0, false, false,\n\t\t\t\t\t\t\tOptional.None(),\n\t\t\t\t\t\t\tnew List<SketchLayer>()),\n\t\t\t\t\t\tnew List<SketchLayer>{rectangle}));\n\t\t\trectangle.Parent = parentGroup;\n\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar uxBuilder = new UxBuilder(new SymbolClassNameBuilder(), Substitute.For<IAssetEmitter>(), log);\n\n\t\t\tvar uxNode = uxBuilder.BuildLayer(parentGroup);\n\t\t\tAssert.That(uxNode, Is.Not.Null);\n\n\t\t\tvar ux = uxNode.SerializeUx(new UxSerializerContext());\n\n\t\t\tAssert.That(ux, Is.EqualTo(\"<Panel Width=\\\"50%\\\" Height=\\\"50%\\\" Alignment=\\\"TopLeft\\\" Margin=\\\"0\\\">\\n\\t<!-- Dummy -->\\n\\t<Rectangle CornerRadius=\\\"2\\\" Width=\\\"50%\\\" Height=\\\"50%\\\" Alignment=\\\"TopLeft\\\" Margin=\\\"0\\\">\\n\\t\\t<!-- Dummy -->\\n\\t</Rectangle>\\n</Panel>\"));\n\t\t\tAssert.That(log.ErrorsAndWarnings(), Is.Empty);\n\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnimplementedLayerTypeFailsGracefullyWithWarning()\n\t\t{\n\t\t\tvar log = new MessageListLogger();\n\t\t\tvar builder = new UxBuilder(new SymbolClassNameBuilder(), Substitute.For<IAssetEmitter>(), log);\n\t\t\tvar uxNode = builder.BuildLayer(new UnimplementedLayerType());\n\t\t\tAssert.That(log.ErrorsAndWarnings().Count, Is.EqualTo(1));\n\t\t\tvar expected = \"Unimplemented layer type: UnimplementedLayerType\";\n\t\t\tAssert.That(log.ErrorsAndWarnings()[0], Does.Match(expected));\n\t\t\tvar ux = uxNode.SerializeUx(new UxSerializerContext());\n\t\t\tAssert.That(ux, Does.Match(\"<!-- \" + expected + \" -->\"));\n\t\t}\n\n\t\t[Test]\n\t\tpublic void EmptyGroupReturnsNullNode()\n\t\t{\n\t\t\tvar noLayers = new List<SketchLayer>();\n\t\t\tvar emptyGroup = new SketchGroup(new SketchLayer(CreateLayer(10, 10), noLayers));\n\t\t\tvar builder = new UxBuilder(new SymbolClassNameBuilder(), Substitute.For<IAssetEmitter>(), new MessageListLogger());\n\t\t\tvar uxNode = builder.BuildLayer(emptyGroup);\n\t\t\tAssert.That(uxNode, Is.InstanceOf(typeof(NullNode)));\n\t\t}\n\n\t\tprivate static SketchAlignment DummyAlignment()\n\t\t{\n\t\t\treturn new SketchAlignment(\n\t\t\t\tnew SketchAxisAlignment(false, false, false),\n\t\t\t\tnew SketchAxisAlignment(false, false, false));\n\t\t}\n\n\t\tprivate static SketchLayer CreateLayer(double width, double height)\n\t\t{\n\t\t\treturn new SketchLayer(Guid.Empty, null, new SketchRect(0, 0, width, height, false),\n\t\t\t\t\"Dummy\", false, DummyAlignment(), 0, false, false, CreateStyle(), new List<SketchLayer>());\n\t\t}\n\n\t\tprivate static SketchStyle CreateStyle()\n\t\t{\n\t\t\treturn new SketchStyle(new List<SketchFill>(), new List<SketchBorder>(), new List<SketchShadow>(), new List<SketchShadow>(), Optional.None(), Optional.None());\n\t\t}\n\t}\n\n\tclass UnimplementedLayerType : SketchLayer\n\t{\n\t\tpublic UnimplementedLayerType()\n\t\t\t: base(new SketchLayer(\n\t\t\t\t       Guid.Empty,\n\t\t\t\t       null,\n\t\t\t\t       null,\n\t\t\t\t       \"\",\n\t\t\t\t       false,\n\t\t\t\t       new SketchAlignment(),\n\t\t\t\t       0,\n\t\t\t\t       false,\n\t\t\t\t       false,\n\t\t\t\t       Optional.None(),\n\t\t\t\t       new List<SketchLayer>()\n\t\t\t       ))\n\t\t{\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/UxNodeTests.cs",
    "content": "﻿using NUnit.Framework;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverterTests\n{\n\tpublic class UxNodeTests\n\t{\n\t\t[Test]\n\t\tpublic void WritesCommentsForNullNodes()\n\t\t{\n\t\t\tvar uxNode = new NullNode(new UxComment(\"Please skip me\"));\n\t\t\tvar ux = uxNode.SerializeUx(new UxSerializerContext());\n\t\t\tAssert.That(ux, Is.EqualTo(\"<!-- Please skip me -->\"));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/UxSizeTests.cs",
    "content": "﻿using NUnit.Framework;\nusing SketchImporter.UxGenerator;\n\nnamespace SketchConverterTests\n{\n\t[TestFixture]\n\tpublic class UxSizeTests\n\t{\n\t\t[Test]\n\t\tpublic void TestUxSizeEqualsUxSizeWithSameValuesReturnsTrue()\n\t\t{\n\t\t\tvar s1 = new UxSize(3.2f, UxUnit.Percent);\n\t\t\tvar s2 = new UxSize(3.2f, UxUnit.Percent);\n\t\t\tAssert.That(s1.Equals(s2), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEqualReferenceVariableReturnsTrue()\n\t\t{\n\t\t\tvar s1 = new UxSize(3.2f, UxUnit.Percent);\n\t\t\tvar s2 = s1;\n\t\t\tAssert.That(s1.Equals(s2), Is.True);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEqualDifferentUxSizeReturnsFalse()\n\t\t{\n\t\t\tvar s1 = new UxSize(3.2f, UxUnit.Percent);\n\t\t\tAssert.That(s1.Equals(new UxSize(3.2f, UxUnit.Points)), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEqualOtherTypeReturnsFalse()\n\t\t{\n\t\t\tvar s1 = new UxSize(3.2f, UxUnit.Percent);\n\t\t\tAssert.That(s1.Equals(new object()), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestEqualNullReturnsFalse()\n\t\t{\n\t\t\tvar s1 = new UxSize(3.2f, UxUnit.Percent);\n\t\t\tAssert.That(s1.Equals(null), Is.False);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void TestGetHashCode()\n\t\t{\n\t\t\tvar s1 = new UxSize(3.2f, UxUnit.Percent);\n\t\t\tvar s2 = new UxSize(3.2f, UxUnit.Pixels);\n\t\t\tvar s3 = new UxSize(3.2f, UxUnit.Percent);\n\n\n\t\t\tAssert.That(s1.GetHashCode(), Is.Not.EqualTo(s2.GetHashCode()));\n\t\t\tAssert.That(s1.GetHashCode(), Is.EqualTo(s3.GetHashCode()));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/sketch2fuse/SketchConverterTests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Castle.Core\" version=\"4.2.0\" targetFramework=\"net45\" />\n  <package id=\"NSubstitute\" version=\"3.1.0\" targetFramework=\"net45\" />\n  <package id=\"NUnit\" version=\"3.5.0\" targetFramework=\"net45\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.3.0\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/sketch2fuse/build.bat",
    "content": "@echo off\npushd \"%~dp0\"\n\nif \"%1\" == \"--release\" (\n\tset config=\"Release\"\n) else (\n\tset config=\"Debug\"\n)\n\nREM If we already have a VS environment set up, just use that\nif defined VSINSTALLDIR (\n\tgoto :BUILD\n)\n\nREM First try to locate VS 2017. Since a user can have multiple installations\nREM of VS 2017 at the same time a utility named vswhere to find a useful candidate.\nif not exist \"packages\\vswhere\\tools\\vswhere.exe\" (\n\tnuget install vswhere -ExcludeVersion -OutputDirectory packages\n )\n\nfor /f \"usebackq tokens=1* delims=: \" %%i in (`packages\\vswhere\\tools\\vswhere -products * -latest -requires Microsoft.Component.MSBuild`) do (\n  if /i \"%%i\"==\"installationPath\" (\n\tset vsdir=%%j\n  )\n)\n\nif exist \"%vsdir%\\Common7\\Tools\\VsMSBuildCmd.bat\" (\n\tcall \"%vsdir%\\Common7\\Tools\\VsMSBuildCmd.bat\"\n\trem Running VsMSBuildCmd unfortunately changes current dir to %HOMEPATH%\n\trem We have already pushd so lets just cd back\n\tcd \"%~dp0\"\n\tgoto :BUILD\n)\n\nREM Fall back to VS 2015 Environment setup\nif not defined VSINSTALLDIR (\n\tif defined VS140COMNTOOLS (\n\t\tcall \"%VS140COMNTOOLS%\\vsvars32.bat\"\n\t\tgoto :BUILD\n\t)\n)\n\n:BUILD\nREM Nuget restore\necho Nuget restore\n%NUGETEXE% restore\n\nREM Build Sketch2Fuse\necho Build %config%\nmsbuild /m /p:Configuration=%config% Sketch2Fuse.sln || goto ERROR\npause\n\n:SUCCESS\npopd && exit /b 0\n\n:ERROR\npause\npopd && exit /b 1\n"
  },
  {
    "path": "src/sketch2fuse/build.sh",
    "content": "#!/bin/bash\ntrap 'echo BUILD FAILED!; exit 1' ERR\ncd \"`dirname \"$0\"`\"\n\nCONFIGURATION=\"Debug\"\n\n# Automatically init on first run\nif [ ! -f .build-inited ]; then\n    DO_INIT=\"1\"\nfi\n\nfor arg in \"$@\"; do\n    case $arg in\n    --debug)\n        CONFIGURATION=\"Debug\"\n        ;;\n    --release)\n        CONFIGURATION=\"Release\"\n        ;;\n    -h|--help)\n        echo \"Available options:\"\n        echo \"\"\n        echo \"    --release   Uses release configuration\"\n        echo \"    --debug     Uses debug configuration (default)\"\n        echo \"\"\n        exit 0\n        ;;\n    *)\n        echo \"ERROR: Invalid argument '$arg'\" >&2\n        exit 1\n        ;;\n    esac\ndone\n\n\nif [ \"$OSTYPE\" = msys ]; then\n    BAT_ARGUMENT=\"--debug\"\n    if [ \"$CONFIGURATION\" == \"Release\" ]; then\n        BAT_ARGUMENT=\"--release\"\n    fi\n    cmd //c build.bat $BAT_ARGUMENT\n    exit $?\nfi\n\nnuget restore\n\nMSBUILD=\"/Library/Frameworks/Mono.framework/Versions/4.4.2/bin/msbuild\"\nif [ ! -f \"$MSBUILD\" ]; then\n    echo \"ERROR: '$MSBUILD' was not found. Please install: http://download.mono-project.com/archive/4.4.2/macos-10-universal/MonoFramework-MDK-4.4.2.11.macos10.xamarin.universal.pkg\" >&2\n    exit 1\nfi\n\n\"$MSBUILD\" Sketch2Fuse.sln /p:Configuration=$CONFIGURATION\n"
  },
  {
    "path": "src/sketch2fuse/command.sh",
    "content": "#!/bin/bash\nset -e\n\nMONO=mono\nif [ \"$OSTYPE\" == \"msys\" ]; then\n    MONO=\"\"\nfi\n\n$MONO Command/bin/Debug/Command.exe $*\n"
  },
  {
    "path": "src/sketch2fuse/docs/documentation.md",
    "content": "## Workflow\nBecause Fuse has a complex and flexible UI system, it's not a realistic goal to import a Sketch file and turn it into a complete Fuse app. Rather, we have aimed for a more meaningful integration with Sketch that leverages the best qualities of both programs. \n\nThis integration will import your Sketch Symbols and interpret them into Fuse `ux:Classes`. Then allowing you to quickly assemble these components using Fuse's layout and animation into a prototype or app. Any changes made to the Symbols in Sketch, will be reflected in Fuse. This allows you to iterate extremely quickly on an idea. _Note: This integration is one-way ie: changes made in Sketch will reflect in Fuse, but changes made in Fuse won't reflect in Sketch. Your Sketch files will remain the source of truth for these components._ \n\nThis workflow enables testing and iterating on by quickly creating prototypes. Once a direction has been decided, thoses components can be developed to be more dynamic and responsive to user input. \n\n## Getting Started\n\n### Watching a sketch file. \nIn order to make the integration work, there are a few steps to follow:\n- Step1: In the same folder as your `.unoproj` file, you will need to create a file with the file-type `.sketchfiles`. This file will need to have the same name as your `.unoproj`. _For instance: `MyApp.unoproj.` will need `MyApp.sketchfiles`_\n- Step 2: Inside this file you need to specify a list of paths to Sketch files you want to import. The file paths can be relative or absolut so you can link to a Sketch file anyway on your system. Here is an example:\n```\n[\n  \"MySketchFile.sketch\", //Inside the app folder\n  \"Assets/MySketchFile.sketch\", //Relative to the App folder\n  \"/Users/Me/SomeFolder/MySketchFolder/MySketchFile.sketch\" //Absolute file path\n]\n```\n\nStarting Fuse will import all the Symbols in the specified Sketch files into your project. The imported Classes have the naming convention `Sketch.ClassName.ux` to distinguish them from other `ux:Classes`. You will see them if you open Fuse Studio, under the Classes tab, or in the `SketchSymbols` folder that has been created in your project. You can include them in your app the same way you would any other class: `<Sketch.ClassName/>`\n\nAll changes saved to those Sketch files will reflect in Fuse.\n\n## Best practices\n\n### Editing generated UX\nIn the current iteration of the importer, any edits you make to the generated UX files will be overwritten the next time that Sketch file has been saved. Currently, the best way to break this link is to manually copy the UX into a new class with a different name and edit that. \n\n### Naming\n- Make sure all your symbol names are unique. If there are two or more symbols with the same name, the importer will only import one of them.\n- Symbol names cannot contain any special characters,symbols or spaces. Numbers and `_` are supported but the symbol name cannot begin with a number.\n- If you want your text objects to be imported as a `ux:Property` (so you can re-use them in the same way as text overrides) you need to ensure that the layer names are unique. Text elements that have the same name won't be interpreted as a `ux:Property`, they will just be imported as plain Text elements.\n\n## Known limitations\n\nThere are some aspects of Sketch that we either can't represent in UX or haven't yet added support for.\n\n### General features\n- **Library symbols** The importer can only interpret symbols from files included in the project. So if you have references to symbols in a seperate Library file which isn't included, those symbols won't be recognised. The solution is to include the central library file, or to `Detach Symbol` in Sketch manually.\n\n### Layers\nThese properties are not supported on any type of layer (shapes, groups, images etc)\n- **Export options** for all types of layers are ignored.\n- **Blur** settings are currently ignored for all blurs (gaussian, motion, zoom and background blur).\n- **Blending Modes** are currently not supported. Objects will be imported but the blending mode will be ignored.\n- **Layer opacity** is currently not supported. Right now your only option for controlling transparency from Sketch is by tweaking color alpha values.\n- **Masking** Fuse doesn't support masking in the same way Sketch does. Masked shapes are ignored.\n\n### Fills\n- **Single color** and **linear gradient** are the only supported fills at the moment. In other words: image, pattern, noise, radial gradient and angular gradients are not supported.\n\n### Shapes\n- **Compound / combined shapes**, shapes created with union, intersection and other boolean operators are not supported. A possible workaround is to flatten them to a sinle path when possible. Another option would be to create a copy of the shape and flatten it to a bitmap, which can then be used in Fuse\n- **Rounded corners** on path/shape vertices are not supported except for on rectangles. If you need rounding on a general shape you can use `convert path to outlines` and manually round the corners in Sketch.\n- **Border placement** (center, inside, outside) is ignored and the border is always centered.\n- **Border styles** like ends, joins, start arrow, end arrow, dashes and gaps are not supported. Rounded end caps are not supported on all target platforms.\n\n### Images\n- **Color adjustment** of images are ignored.\n\n### Text/font\n- **Text on path** is not supported. The text and path are converted, but text doesn't follow the path.\n- **Fonts** Using custom fonts in Fuse requires having copies of the `.ttf` or `.otf` files in your project folder. We don't currently support automatic adding of these fonts from the Sketch file to the projec folder, so all custom fonts get stripped in the conversion and the system font is used. You can manually set up a global font and apply that to text instances later.\n- **Text styles / decoration** are ignored. Only text content, font size and color is converted.\n- **Text shadows** currently not supported and also missing a proper warning.\n\n### Shadows\n- **Inner shadows** are not supported.\n\n"
  },
  {
    "path": "src/sketch2fuse/files/README.md",
    "content": "## Sketch test files\n\n### How to add test file\nThe regression tests currently converts symbols for all sketch files\nunder the folder `files/Sketch43`: \n\n1. Open Sketch and create an example\n1. Create a symbol for each part you want the converter to process\n1. All symbols are saved in a separate Symbols page, to reduce noise you can remove the other pages in the document\n1. Run the regression test with the `-i`-option. Accept all changes for the new file\n1. Commit both sketch-file and reference files produced by the regression test.\n\nRegression tests can be run with the command \n\n`mono ./RegressionTest/bin/Debug/RegressionTest.exe -i`\n\n**Make sure you've built the regression test project so it uses the correct converter executable.**\n\n### sketch43-file-unpacking.py\n\nThis script unpacks all Sketch-files in the `Sketch43`-folder. Each sketch\nfile becomes a subfolder under `files/output`. This is a development tool\nfor inspecting the json-files that are zipped into the sketch zip-file.\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AllFillTypes.reference/Sketch.FillFlatColor.ux",
    "content": "<Panel ux:Class=\"Sketch.FillFlatColor\" Width=\"269\" Height=\"151\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AllFillTypes.reference/Sketch.FillLinearGradient.ux",
    "content": "<Panel ux:Class=\"Sketch.FillLinearGradient\" Width=\"251\" Height=\"136\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<LinearGradient StartPoint=\"0.5, 0\" EndPoint=\"0.5, 1\">\n\t\t\t\t<GradientStop Color=\"1, 0.04598721, 0.04598721, 1\" Offset=\"0\" />\n\t\t\t\t<GradientStop Color=\"0.847, 0.847, 0.847, 1\" Offset=\"1\" />\n\t\t\t</LinearGradient>\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AllFillTypes.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AllFillTypes.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>AllFillTypes.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nERROR: Failed to parse layer 'Rectangle 3', skipping it. The exception was :'Only linear gradients are supported'\nERROR: Failed to parse layer 'Rectangle 4', skipping it. The exception was :'Only linear gradients are supported'\nERROR: Failed to parse layer 'Rectangle 5', skipping it. The exception was :'Image/Pattern fill is not supported'\nERROR: Failed to parse layer 'Rectangle 6', skipping it. The exception was :'Noise fill is not supported'\nINFO: Wrote 'Sketch.FillFlatColor' to '<path removed>Sketch.FillFlatColor.ux'\nINFO: Wrote 'Sketch.FillLinearGradient' to '<path removed>Sketch.FillLinearGradient.ux'\nWARNING: Skipping symbol 'Sketch.FillRadialGradient' which has no supported layers.\nWARNING: Skipping symbol 'Sketch.FillAngularGradient' which has no supported layers.\nWARNING: Skipping symbol 'Sketch.FillPatternFill' which has no supported layers.\nWARNING: Skipping symbol 'Sketch.FillNoiseFill' which has no supported layers.\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AmericanTypewriter.reference/Sketch.Text.ux",
    "content": "<Panel ux:Class=\"Sketch.Text\" Width=\"136\" Height=\"22\" SomeText=\"This is some text\">\n\t<string ux:Property=\"SomeText\" />\n\t<Text Color=\"0, 0, 0, 1\" FontSize=\"18\" Value=\"{Property SomeText}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Width=\"100%\" Height=\"100%\" Alignment=\"BottomLeft\" Margin=\"0\">\n\t\t<!-- SomeText -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AmericanTypewriter.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AmericanTypewriter.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>AmericanTypewriter.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.Text' to '<path removed>Sketch.Text.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Arrow.reference/Sketch.Arrow.ux",
    "content": "<Panel ux:Class=\"Sketch.Arrow\" Width=\"128\" Height=\"119\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Line -->\n\t\t<Path Data=\"M 0.99609375 0.9957983193277 L 0.00390625 0.004201680672269\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"4\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.3143694, 0.8883757, 0.7598996, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Arrow.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Arrow.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Arrow.sketch created with Sketch 48 variant BETA build97\nINFO: Wrote 'Sketch.Arrow' to '<path removed>Sketch.Arrow.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AssymetricPath.reference/Sketch.Asymmetric.ux",
    "content": "<Panel ux:Class=\"Sketch.Asymmetric\" Width=\"201\" Height=\"103\">\n\t<Panel Width=\"99.50249%\" Height=\"99.46087%\" Alignment=\"TopLeft\" Offset=\"1.164215E-13%, 0.5391292%\" Margin=\"0\">\n\t\t<!-- Asymmetric -->\n\t\t<Path Data=\"M 0 1 C 0.2115320189033 0.2303477315743 0.37819868557 -0.09503107613177 0.5 0.02386357688175 C 0.8333333333333 0.3492422576454 1 0.6746210653515 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"0%, 1.387173E-14%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AssymetricPath.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/AssymetricPath.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>AssymetricPath.sketch created with Sketch 47.1 variant NONAPPSTORE build95\nINFO: Wrote 'Sketch.Asymmetric' to '<path removed>Sketch.Asymmetric.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/Sketch.BackgroundBlurOval.ux",
    "content": "<Panel ux:Class=\"Sketch.BackgroundBlurOval\" Width=\"136\" Height=\"135\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- BackgrBlurOval -->\n\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"6\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0, 0, 0, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/Sketch.DisabledBlurRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.DisabledBlurRectangle\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- DisabledBlurRect -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/Sketch.GaussianBlurRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.GaussianBlurRectangle\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/Sketch.MotionBlurRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.MotionBlurRectangle\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/Sketch.NoBlurRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.NoBlurRectangle\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- NoBlurRect -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/Sketch.ZoomBlurRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.ZoomBlurRectangle\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Blurs.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Blurs.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nWARNING: Skipping Gaussian blur on Rectangle. Not supported in UX\nINFO: Wrote 'Sketch.GaussianBlurRectangle' to '<path removed>Sketch.GaussianBlurRectangle.ux'\nWARNING: Skipping Motion blur on Rectangle 2. Not supported in UX\nINFO: Wrote 'Sketch.MotionBlurRectangle' to '<path removed>Sketch.MotionBlurRectangle.ux'\nWARNING: Skipping Zoom blur on Rectangle 2. Not supported in UX\nINFO: Wrote 'Sketch.ZoomBlurRectangle' to '<path removed>Sketch.ZoomBlurRectangle.ux'\nWARNING: Skipping Background blur on BackgrBlurOval. Not supported in UX\nINFO: Wrote 'Sketch.BackgroundBlurOval' to '<path removed>Sketch.BackgroundBlurOval.ux'\nINFO: Wrote 'Sketch.NoBlurRectangle' to '<path removed>Sketch.NoBlurRectangle.ux'\nINFO: Wrote 'Sketch.DisabledBlurRectangle' to '<path removed>Sketch.DisabledBlurRectangle.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/BooleanOperations.reference/Sketch.Difference.ux",
    "content": "<Panel ux:Class=\"Sketch.Difference\" Width=\"150\" Height=\"150\">\n\t<Panel>\n\t\t<!-- Difference -->\n\t\t<!-- Combined shapes are not supported in UX -->\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/BooleanOperations.reference/Sketch.Intersection.ux",
    "content": "<Panel ux:Class=\"Sketch.Intersection\" Width=\"50\" Height=\"50\">\n\t<Panel>\n\t\t<!-- Intersection -->\n\t\t<!-- Combined shapes are not supported in UX -->\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/BooleanOperations.reference/Sketch.Subtraction.ux",
    "content": "<Panel ux:Class=\"Sketch.Subtraction\" Width=\"100\" Height=\"100\">\n\t<Panel>\n\t\t<!-- Subtraction -->\n\t\t<!-- Combined shapes are not supported in UX -->\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/BooleanOperations.reference/Sketch.Union.ux",
    "content": "<Panel ux:Class=\"Sketch.Union\" Width=\"150\" Height=\"150\">\n\t<Panel>\n\t\t<!-- Union -->\n\t\t<!-- Combined shapes are not supported in UX -->\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/BooleanOperations.reference/Sketch.UnionDifference.ux",
    "content": "<Panel ux:Class=\"Sketch.UnionDifference\" Width=\"150\" Height=\"150\">\n\t<Panel>\n\t\t<!-- UnionDifference -->\n\t\t<!-- Combined shapes are not supported in UX -->\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/BooleanOperations.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/BooleanOperations.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>BooleanOperations.sketch created with Sketch 47 variant BETA build95\nWARNING: Combined shapes are not supported Union with 2 number of combined layers\nINFO: Wrote 'Sketch.Union' to '<path removed>Sketch.Union.ux'\nWARNING: Combined shapes are not supported Subtraction with 2 number of combined layers\nINFO: Wrote 'Sketch.Subtraction' to '<path removed>Sketch.Subtraction.ux'\nWARNING: Combined shapes are not supported Intersection with 2 number of combined layers\nINFO: Wrote 'Sketch.Intersection' to '<path removed>Sketch.Intersection.ux'\nWARNING: Combined shapes are not supported Difference with 2 number of combined layers\nINFO: Wrote 'Sketch.Difference' to '<path removed>Sketch.Difference.ux'\nWARNING: Combined shapes are not supported UnionDifference with 3 number of combined layers\nINFO: Wrote 'Sketch.UnionDifference' to '<path removed>Sketch.UnionDifference.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ColoredArialText.reference/Sketch.ColoredText.ux",
    "content": "<Panel ux:Class=\"Sketch.ColoredText\" Width=\"401\" Height=\"41\" TextField=\"Orange is the new black\">\n\t<string ux:Property=\"TextField\" />\n\t<Text Color=\"0.961711, 0.6503673, 0.1385423, 1\" FontSize=\"36\" Value=\"{Property TextField}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- TextField -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ColoredArialText.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ColoredArialText.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>ColoredArialText.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.ColoredText' to '<path removed>Sketch.ColoredText.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/CombinedShapeSymbol.reference/Sketch.CombinedShapeSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.CombinedShapeSymbol\" Width=\"200\" Height=\"100\">\n\t<Panel>\n\t\t<!-- Combined Shape -->\n\t\t<!-- Combined shapes are not supported in UX -->\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/CombinedShapeSymbol.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/CombinedShapeSymbol.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>CombinedShapeSymbol.sketch created with Sketch 48 variant BETA build97\nWARNING: Combined shapes are not supported Combined Shape with 2 number of combined layers\nINFO: Wrote 'Sketch.CombinedShapeSymbol' to '<path removed>Sketch.CombinedShapeSymbol.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.AutoTextBoxInGroup.ux",
    "content": "<Panel ux:Class=\"Sketch.AutoTextBoxInGroup\" Width=\"149\" Height=\"71\" AutoTextBox=\"Auto text box\">\n\t<string ux:Property=\"AutoTextBox\" />\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group 3 -->\n\t\t<Text Color=\"0, 0, 0, 1\" FontSize=\"20\" Value=\"{Property AutoTextBox}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"99.32886%\" Height=\"39.43662%\" Alignment=\"BottomLeft\" Offset=\"0.3355705%, 0\" Margin=\"0\">\n\t\t\t<!-- AutoTextBox -->\n\t\t</Text>\n\t\t<Panel Width=\"20.80537%\" Height=\"43.66197%\" Alignment=\"TopLeft\" Offset=\"20.13423%, 16.90141%\" Margin=\"0\">\n\t\t\t<!-- Rectangle 2 -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t\t<Panel Width=\"20.80537%\" Height=\"47.88733%\" Alignment=\"TopLeft\" Offset=\"9.395973%, 0%\" Margin=\"0\">\n\t\t\t<!-- Rectangle -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.AutoTextBoxSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.AutoTextBoxSymbol\" Width=\"149\" Height=\"28\" AutoTextBox=\"Auto text box\">\n\t<string ux:Property=\"AutoTextBox\" />\n\t<Text Color=\"0, 0, 0, 1\" FontSize=\"20\" Value=\"{Property AutoTextBox}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"99.32886%\" Height=\"100%\" Alignment=\"BottomLeft\" Offset=\"0.5033557%, 0\" Margin=\"0\">\n\t\t<!-- AutoTextBox -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.FixedTextBoxInGroup.ux",
    "content": "<Panel ux:Class=\"Sketch.FixedTextBoxInGroup\" Width=\"198\" Height=\"88\" FixedTextBox=\"Fixed text box\">\n\t<string ux:Property=\"FixedTextBox\" />\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group 4 -->\n\t\t<Text Color=\"0, 0, 0, 1\" FontSize=\"20\" Value=\"{Property FixedTextBox}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"52.0202%\" Height=\"63.63636%\" Alignment=\"TopLeft\" Offset=\"47.9798%, 36.36364%\" Margin=\"0\">\n\t\t\t<!-- FixedTextBox -->\n\t\t</Text>\n\t\t<Panel Width=\"32.82828%\" Height=\"37.5%\" Alignment=\"TopLeft\" Offset=\"66.66666%, 0%\" Margin=\"0\">\n\t\t\t<!-- Rectangle 5 -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t\t<Panel Width=\"32.82828%\" Height=\"36.36364%\" Alignment=\"TopLeft\" Offset=\"8.585858%, 22.72727%\" Margin=\"0\">\n\t\t\t<!-- Rectangle 4 -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t\t<Panel Width=\"27.27273%\" Height=\"37.5%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Rectangle 3 -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.FixedTextBoxSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.FixedTextBoxSymbol\" Width=\"104\" Height=\"56\" FixedTextBox=\"Fixed text box\">\n\t<string ux:Property=\"FixedTextBox\" />\n\t<Text Color=\"0, 0, 0, 1\" FontSize=\"20\" Value=\"{Property FixedTextBox}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- FixedTextBox -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.NonAsciiSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.NonAsciiSymbol\" Width=\"199\" Height=\"21\" NonAscii=\"ÆØÅ ◊∑ÄÖ∏ŒˆÜ˜‡˘∫É°∆\">\n\t<string ux:Property=\"NonAscii\" />\n\t<Text Color=\"0, 0, 0, 1\" FontSize=\"18\" Value=\"{Property NonAscii}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"99.49749%\" Height=\"100%\" Alignment=\"BottomLeft\" Offset=\"0.2512563%, 0\" Margin=\"0\">\n\t\t<!-- NonAscii -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.RichTextSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.RichTextSymbol\" Width=\"173\" Height=\"35\" RichText=\"Title\nWith some more text underneath\">\n\t<string ux:Property=\"RichText\" />\n\t<Text Color=\"0.739875, 0.06114692, 0.8790008, 1\" FontSize=\"18\" Value=\"{Property RichText}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"101.7341%\" Height=\"100%\" Alignment=\"BottomLeft\" Offset=\"-0.867052%, 0\" Margin=\"0\">\n\t\t<!-- RichText -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.TextInACircle.ux",
    "content": "<Panel ux:Class=\"Sketch.TextInACircle\" Width=\"137\" Height=\"234\" CircleText=\"Text around a circle æøå\">\n\t<string ux:Property=\"CircleText\" />\n\t<Panel Width=\"161.3139%\" Height=\"45.72649%\" Alignment=\"TopLeft\" Offset=\"-30.6287%, 27.18042%\" Margin=\"0\">\n\t\t<!-- Group 2 -->\n\t\t<Text Color=\"0, 0, 0, 1\" FontSize=\"18\" Value=\"{Property CircleText}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"89.59276%\" Height=\"19.62617%\" Alignment=\"BottomLeft\" Offset=\"10.181%, -86\" Margin=\"0\">\n\t\t\t<!-- CircleText -->\n\t\t</Text>\n\t\t<Panel Width=\"49.77375%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Oval -->\n\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t\t<Rotation DegreesX=\"-180\" />\n\t\t<Rotation DegreesY=\"-180\" />\n\t\t<Rotation Degrees=\"82\" />\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.TextOnAPath.ux",
    "content": "<Panel ux:Class=\"Sketch.TextOnAPath\" Width=\"324\" Height=\"63\" PathText=\"Some text along the line\">\n\t<string ux:Property=\"PathText\" />\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<Text Color=\"0, 0, 0, 1\" FontSize=\"18\" Value=\"{Property PathText}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"91.66666%\" Height=\"33.33333%\" Alignment=\"TopLeft\" Offset=\"4.012346%, 19.04762%\" Margin=\"0\">\n\t\t\t<!-- PathText -->\n\t\t</Text>\n\t\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Path Data=\"M 0 1 C 0.01494810337153 0.3333333333333 0.0795084463813 1.398210878903E-17 0.1936810290293 0 C 0.3649399030013 0 0.4920208355225 0.5917112145772 0.6804667182119 0.5917112145772 C 0.8060973066714 0.5917112145772 0.9126084006008 0.3944741430515 1 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"-4.386066E-15%, 0%\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.TextStyleSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.TextStyleSymbol\" Width=\"61\" Height=\"15\" TextField=\"Other text\">\n\t<string ux:Property=\"TextField\" />\n\t<Text Color=\"0, 0, 0, 1\" FontSize=\"12\" Value=\"{Property TextField}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- TextField -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/Sketch.TextSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.TextSymbol\" Width=\"80\" Height=\"17\" TextContent=\"The content\">\n\t<string ux:Property=\"TextContent\" />\n\t<Text Color=\"0.739875, 0.06114692, 0.8790008, 1\" FontSize=\"12\" Value=\"{Property TextContent}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Width=\"81.25%\" Height=\"82.35294%\" Alignment=\"BottomLeft\" Offset=\"0%, -1\" Margin=\"0\">\n\t\t<!-- TextContent -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DefaultText.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>DefaultText.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.TextSymbol' to '<path removed>Sketch.TextSymbol.ux'\nINFO: Wrote 'Sketch.TextStyleSymbol' to '<path removed>Sketch.TextStyleSymbol.ux'\nWARNING: UX Builder: Multiple text styles on the same text element not supported in UX. Found 3 text styles on RichText, using just one of them.\nINFO: Wrote 'Sketch.RichTextSymbol' to '<path removed>Sketch.RichTextSymbol.ux'\nINFO: Wrote 'Sketch.TextOnAPath' to '<path removed>Sketch.TextOnAPath.ux'\nINFO: Wrote 'Sketch.TextInACircle' to '<path removed>Sketch.TextInACircle.ux'\nINFO: Wrote 'Sketch.NonAsciiSymbol' to '<path removed>Sketch.NonAsciiSymbol.ux'\nINFO: Wrote 'Sketch.AutoTextBoxSymbol' to '<path removed>Sketch.AutoTextBoxSymbol.ux'\nINFO: Wrote 'Sketch.FixedTextBoxSymbol' to '<path removed>Sketch.FixedTextBoxSymbol.ux'\nINFO: Wrote 'Sketch.AutoTextBoxInGroup' to '<path removed>Sketch.AutoTextBoxInGroup.ux'\nINFO: Wrote 'Sketch.FixedTextBoxInGroup' to '<path removed>Sketch.FixedTextBoxInGroup.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DisconnectedPath.reference/Sketch.Disconnected.ux",
    "content": "<Panel ux:Class=\"Sketch.Disconnected\" Width=\"200\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Disconnected -->\n\t\t<Path Data=\"M 0 1 C 0.1666666666667 0.3333333333333 0.3333333333333 0 0.5 0 C 0.5 0.6666666666667 0.6666666666667 1 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DisconnectedPath.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DisconnectedPath.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>DisconnectedPath.sketch created with Sketch 47.1 variant NONAPPSTORE build95\nINFO: Wrote 'Sketch.Disconnected' to '<path removed>Sketch.Disconnected.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DuplicatedSymbolName.reference/Sketch.DuplicatedSymbolName.ux",
    "content": "<Panel ux:Class=\"Sketch.DuplicatedSymbolName\" Width=\"83\" Height=\"101\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DuplicatedSymbolName.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/DuplicatedSymbolName.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>DuplicatedSymbolName.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nERROR: More than one symbol named 'DuplicatedSymbolName' was found! Only generating ux for one of them. Please make sure symbol names are unique.\nINFO: Wrote 'Sketch.DuplicatedSymbolName' to '<path removed>Sketch.DuplicatedSymbolName.ux'\nINFO: Wrote 'Sketch.DuplicatedSymbolName' to '<path removed>Sketch.DuplicatedSymbolName.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/Sketch.EditedRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.EditedRectangle\" Width=\"100\" Height=\"200\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/Sketch.MorphedRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.MorphedRectangle\" Width=\"200\" Height=\"200\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- MorphedRectangle -->\n\t\t<Path Data=\"M 1 0 L 1 1 L 0 1 L 1 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/Sketch.RotatedRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.RotatedRectangle\" Width=\"142\" Height=\"142\">\n\t<Panel Width=\"70.42254%\" Height=\"70.42254%\" Alignment=\"TopLeft\" Offset=\"14.78873%, 14.78873%\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t\t<Rotation Degrees=\"45\" />\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/Sketch.ShearedRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.ShearedRectangle\" Width=\"152\" Height=\"100\">\n\t<Panel Width=\"99.67619%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Path Data=\"M 0.3399680297014 0 L 1 0 L 0.6600319702986 1 L 0 1 L 0.3399680297014 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/Sketch.TransformedRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.TransformedRectangle\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"-2.384186E-05%, 0%\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Path Data=\"M 1 0 L 0 0 L 0.9999997615815 1 L 2.384184654148E-07 1 L 1 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/Sketch.Trapese.ux",
    "content": "<Panel ux:Class=\"Sketch.Trapese\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Path Data=\"M 0.2637109375 0 L 0.7362890625 0 L 1 1 L 0 1 L 0.2637109375 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/EditedRectangles.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>EditedRectangles.sketch created with Sketch 47 variant BETA build95\nINFO: Wrote 'Sketch.EditedRectangle' to '<path removed>Sketch.EditedRectangle.ux'\nINFO: Wrote 'Sketch.MorphedRectangle' to '<path removed>Sketch.MorphedRectangle.ux'\nINFO: Wrote 'Sketch.RotatedRectangle' to '<path removed>Sketch.RotatedRectangle.ux'\nINFO: Wrote 'Sketch.TransformedRectangle' to '<path removed>Sketch.TransformedRectangle.ux'\nINFO: Wrote 'Sketch.ShearedRectangle' to '<path removed>Sketch.ShearedRectangle.ux'\nINFO: Wrote 'Sketch.Trapese' to '<path removed>Sketch.Trapese.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Empty.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Empty.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Empty.sketch created with Sketch 47.1 variant NONAPPSTORE build95\nWARNING: Parser: Expected object ID, using empty Guid\nINFO: No UX generated because no Sketch symbols found in sketch file. Sketchy :)\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/Sketch.FlippedGroup.ux",
    "content": "<Panel ux:Class=\"Sketch.FlippedGroup\" Width=\"136\" Height=\"144\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group 2 -->\n\t\t<Panel Width=\"68.33353%\" Height=\"68.36752%\" Alignment=\"TopLeft\" Offset=\"15.62787%, 12.9503%\" Margin=\"0\">\n\t\t\t<!-- Path 2 -->\n\t\t\t<Path Data=\"M 0 0.4099908741023 L 0.4460510276996 0 L 0.5489891135303 0.4739118358926 L 1 0.4099908741023 L 0.8870160985247 0.8577947069793 L 0.3051994451683 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.2886557, 0.5645519, 0.8862387, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t\t<Rotation Degrees=\"45\" />\n\t\t</Panel>\n\t\t<Panel Width=\"55.88235%\" Height=\"49.30556%\" Alignment=\"TopLeft\" Offset=\"19.85294%, 50.69444%\" Margin=\"0\">\n\t\t\t<!-- Triangle 2 -->\n\t\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t\t<Rotation DegreesX=\"-180\" />\n\t\t</Panel>\n\t\t<Panel Width=\"68.33353%\" Height=\"68.36752%\" Alignment=\"TopLeft\" Offset=\"15.62787%, 12.9503%\" Margin=\"0\">\n\t\t\t<!-- Path 2 -->\n\t\t\t<Path Data=\"M 0 0.4099908741023 L 0.4460510276996 0 L 0.5489891135303 0.4739118358926 L 1 0.4099908741023 L 0.8870160985247 0.8577947069793 L 0.3051994451683 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t\t<Rotation DegreesX=\"-180\" />\n\t\t<Rotation DegreesY=\"-180\" />\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/Sketch.FlippedVerticallyPolygon.ux",
    "content": "<Panel ux:Class=\"Sketch.FlippedVerticallyPolygon\" Width=\"79\" Height=\"99\">\n\t<Panel Width=\"99.34294%\" Height=\"99.5873%\" Alignment=\"TopLeft\" Offset=\"0.627997%, 0%\" Margin=\"0\">\n\t\t<!-- Polygon -->\n\t\t<Path Data=\"M 0.6180339887499 0 L 1 1 L 0.2360679774998 1 L 0 0.3819660112501 L 0.6180339887499 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Rotation DegreesX=\"-180\" />\n\t\t<Rotation DegreesY=\"-180\" />\n\t</Panel>\n\t<Panel Width=\"99.34294%\" Height=\"99.5873%\" Alignment=\"TopLeft\" Offset=\"0.627997%, 0%\" Margin=\"0\">\n\t\t<!-- Polygon -->\n\t\t<Path Data=\"M 0.6180339887499 0 L 1 1 L 0.2360679774998 1 L 0 0.3819660112501 L 0.6180339887499 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Rotation DegreesY=\"-180\" />\n\t</Panel>\n\t<Panel Width=\"99.34294%\" Height=\"99.5873%\" Alignment=\"TopLeft\" Offset=\"0.627997%, 0%\" Margin=\"0\">\n\t\t<!-- Polygon -->\n\t\t<Path Data=\"M 0.6180339887499 0 L 1 1 L 0.2360679774998 1 L 0 0.3819660112501 L 0.6180339887499 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"1, 0.9262327, 0, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/Sketch.Rotated30.ux",
    "content": "<Panel ux:Class=\"Sketch.Rotated30\" Width=\"200\" Height=\"200\">\n\t<Panel Width=\"110%\" Height=\"109%\" Alignment=\"TopLeft\" Offset=\"0%, -9%\" Margin=\"0\">\n\t\t<!-- Rotated30 -->\n\t\t<Panel Width=\"45.45454%\" Height=\"45.41285%\" Alignment=\"TopLeft\" Offset=\"45.90909%, 8.715596%\" Margin=\"0\">\n\t\t\t<!-- Triangle -->\n\t\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t\t<Rotation Degrees=\"30\" />\n\t\t</Panel>\n\t\t<Panel Width=\"90.90909%\" Height=\"91.74312%\" Alignment=\"TopLeft\" Offset=\"0%, 8.256881%\" Margin=\"0\">\n\t\t\t<!-- Group -->\n\t\t\t<Panel Width=\"1%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"49.5%, 0%\" Margin=\"0\">\n\t\t\t\t<!-- Line -->\n\t\t\t\t<Path Data=\"M 0.5 0 L 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"100%\" Height=\"1%\" Alignment=\"TopLeft\" Offset=\"0%, 49.5%\" Margin=\"0\">\n\t\t\t\t<!-- Line -->\n\t\t\t\t<Path Data=\"M 1 0.5 L 0 0.5\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/Sketch.Rotated30FlippedHorizontally.ux",
    "content": "<Panel ux:Class=\"Sketch.Rotated30FlippedHorizontally\" Width=\"217\" Height=\"219\">\n\t<Panel Width=\"46.08295%\" Height=\"45.20548%\" Alignment=\"TopLeft\" Offset=\"45.18492%, 8.411252%\" Margin=\"0\">\n\t\t<!-- Triangle -->\n\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Rotation DegreesY=\"-180\" />\n\t\t<Rotation Degrees=\"30\" />\n\t</Panel>\n\t<Panel Width=\"92.1659%\" Height=\"91.3242%\" Alignment=\"TopLeft\" Offset=\"0%, 8.675799%\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<Panel Width=\"1%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"49.5%, 0%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 0.5 0 L 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t\t<Panel Width=\"100%\" Height=\"1%\" Alignment=\"TopLeft\" Offset=\"0%, 49.5%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 1 0.5 L 0 0.5\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/Sketch.Rotated30FlippedVertically.ux",
    "content": "<Panel ux:Class=\"Sketch.Rotated30FlippedVertically\" Width=\"217\" Height=\"219\">\n\t<Panel Width=\"46.08295%\" Height=\"45.20548%\" Alignment=\"TopLeft\" Offset=\"45.18492%, 8.387332%\" Margin=\"0\">\n\t\t<!-- Triangle -->\n\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Rotation DegreesX=\"-180\" />\n\t\t<Rotation Degrees=\"30\" />\n\t</Panel>\n\t<Panel Width=\"92.1659%\" Height=\"91.3242%\" Alignment=\"TopLeft\" Offset=\"0%, 8.675799%\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<Panel Width=\"1%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"49.5%, 0%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 0.5 0 L 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t\t<Panel Width=\"100%\" Height=\"1%\" Alignment=\"TopLeft\" Offset=\"0%, 49.5%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 1 0.5 L 0 0.5\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/Sketch.Triangle.ux",
    "content": "<Panel ux:Class=\"Sketch.Triangle\" Width=\"200\" Height=\"200\">\n\t<Panel Width=\"50%\" Height=\"49.5%\" Alignment=\"TopLeft\" Offset=\"49%, 0%\" Margin=\"0\">\n\t\t<!-- Triangle -->\n\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<Panel Width=\"1%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"49.5%, 0%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 0.5 0 L 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t\t<Panel Width=\"100%\" Height=\"1%\" Alignment=\"TopLeft\" Offset=\"0%, 49.5%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 1 0.5 L 0 0.5\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/Sketch.VerticalFlip.ux",
    "content": "<Panel ux:Class=\"Sketch.VerticalFlip\" Width=\"200\" Height=\"200\">\n\t<Panel Width=\"50%\" Height=\"49.5%\" Alignment=\"TopLeft\" Offset=\"49%, 0%\" Margin=\"0\">\n\t\t<!-- Triangle -->\n\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Rotation DegreesX=\"-180\" />\n\t</Panel>\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<Panel Width=\"1%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"49.5%, 0%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 0.5 0 L 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t\t<Panel Width=\"100%\" Height=\"1%\" Alignment=\"TopLeft\" Offset=\"0%, 49.5%\" Margin=\"0\">\n\t\t\t<!-- Line -->\n\t\t\t<Path Data=\"M 1 0.5 L 0 0.5\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Path>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/FlippedAndRotated.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>FlippedAndRotated.sketch created with Sketch 48.1 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.Triangle' to '<path removed>Sketch.Triangle.ux'\nINFO: Wrote 'Sketch.VerticalFlip' to '<path removed>Sketch.VerticalFlip.ux'\nINFO: Wrote 'Sketch.Rotated30FlippedVertically' to '<path removed>Sketch.Rotated30FlippedVertically.ux'\nINFO: Wrote 'Sketch.Rotated30FlippedHorizontally' to '<path removed>Sketch.Rotated30FlippedHorizontally.ux'\nINFO: Wrote 'Sketch.Rotated30' to '<path removed>Sketch.Rotated30.ux'\nINFO: Wrote 'Sketch.FlippedVerticallyPolygon' to '<path removed>Sketch.FlippedVerticallyPolygon.ux'\nINFO: Wrote 'Sketch.FlippedGroup' to '<path removed>Sketch.FlippedGroup.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Group.reference/Sketch.GroupSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.GroupSymbol\" Width=\"199\" Height=\"134\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group 3 -->\n\t\t<Panel Width=\"48.24121%\" Height=\"81.34328%\" Alignment=\"TopLeft\" Offset=\"0%, 18.65672%\" Margin=\"0\">\n\t\t\t<!-- Group 2 -->\n\t\t\t<Panel Width=\"65.625%\" Height=\"54.12844%\" Alignment=\"TopLeft\" Offset=\"14.58333%, 45.87156%\" Margin=\"0\">\n\t\t\t\t<!-- Oval -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"0.721193, 0.9127496, 0.5272029, 1\" />\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"67.70834%\" Height=\"55.04587%\" Alignment=\"TopLeft\" Offset=\"32.29167%, 18.34862%\" Margin=\"0\">\n\t\t\t\t<!-- Rectangle -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"67.70834%\" Height=\"55.04587%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Rectangle -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t</Panel>\n\t\t<Panel Width=\"45.22613%\" Height=\"59.70149%\" Alignment=\"TopLeft\" Offset=\"54.77387%, 0%\" Margin=\"0\">\n\t\t\t<!-- Group -->\n\t\t\t<Panel Width=\"66.66666%\" Height=\"75%\" Alignment=\"TopLeft\" Offset=\"33.33333%, 25%\" Margin=\"0\">\n\t\t\t\t<!-- Rectangle -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"0.2886557, 0.5645519, 0.8862387, 1\" />\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"66.66666%\" Height=\"75%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Rectangle -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Group.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Group.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Group.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.GroupSymbol' to '<path removed>Sketch.GroupSymbol.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ImageSymbol.reference/Sketch.ImageSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.ImageSymbol\" Width=\"128\" Height=\"128\">\n\t<Image File=\"images/13992fa7f2f88277da1c09fabe8ca9f43e23684f.png\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- grim-icon -->\n\t</Image>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ImageSymbol.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ImageSymbol.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>ImageSymbol.sketch created with Sketch 47.1 variant NONAPPSTORE build95\nINFO: Wrote images/13992fa7f2f88277da1c09fabe8ca9f43e23684f.png to <path removed>13992fa7f2f88277da1c09fabe8ca9f43e23684f.png\nINFO: Wrote 'Sketch.ImageSymbol' to '<path removed>Sketch.ImageSymbol.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/InnerShadow.reference/Sketch.InnerShadowRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.InnerShadowRectangle\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<!-- Inner shadow not supported in UX -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/InnerShadow.reference/Sketch.OuterAndInnerShadow.ux",
    "content": "<Panel ux:Class=\"Sketch.OuterAndInnerShadow\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle 3 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"135\" Distance=\"7.071068\" Color=\"0.2886557, 0.5645519, 0.8862387, 1\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<!-- Inner shadow not supported in UX -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/InnerShadow.reference/Sketch.TwoInnerShadows.ux",
    "content": "<Panel ux:Class=\"Sketch.TwoInnerShadows\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<!-- Inner shadow not supported in UX -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/InnerShadow.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/InnerShadow.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>InnerShadow.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nWARNING: UX Builder: Inner shadows not supported. Rectangle has 1 shadow.\nINFO: Wrote 'Sketch.InnerShadowRectangle' to '<path removed>Sketch.InnerShadowRectangle.ux'\nWARNING: UX Builder: Inner shadows not supported. Rectangle 2 has 2 shadows.\nINFO: Wrote 'Sketch.TwoInnerShadows' to '<path removed>Sketch.TwoInnerShadows.ux'\nWARNING: UX Builder: Inner shadows not supported. Rectangle 3 has 1 shadow.\nINFO: Wrote 'Sketch.OuterAndInnerShadow' to '<path removed>Sketch.OuterAndInnerShadow.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/LayerOpacity.reference/Sketch.Rectangles.ux",
    "content": "<Panel ux:Class=\"Sketch.Rectangles\" Width=\"306\" Height=\"212\">\n\t<Panel Width=\"90.52287%\" Height=\"79.71698%\" Alignment=\"TopLeft\" Offset=\"9.477124%, 20.28302%\" Margin=\"0\" Opacity=\"0.5\">\n\t\t<!-- Group_50 -->\n\t\t<Panel Width=\"74.00722%\" Height=\"89.94083%\" Alignment=\"TopLeft\" Offset=\"25.99278%, 10.05917%\" Margin=\"0\" Opacity=\"0.5\">\n\t\t\t<!-- Green_50 -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.2557843, 0.4596164, 0.01991642, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t\t<Panel Width=\"53.4296%\" Height=\"83.43195%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Blue_100 -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.2886557, 0.5645519, 0.8862387, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t</Panel>\n\t<Panel Width=\"73.85621%\" Height=\"68.39622%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Red_100 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"1, 0, 0, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/LayerOpacity.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/LayerOpacity.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>LayerOpacity.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.Rectangles' to '<path removed>Sketch.Rectangles.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Line.reference/Sketch.Line.ux",
    "content": "<Panel ux:Class=\"Sketch.Line\" Width=\"107\" Height=\"82\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Line -->\n\t\t<Path Data=\"M 0.004672897196262 0.00609756097561 L 0.9953271028037 0.9939024390244\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"5\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0, 0, 0, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Line.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Line.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Line.sketch created with Sketch 48 variant BETA build97\nINFO: Wrote 'Sketch.Line' to '<path removed>Sketch.Line.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/LineWithoutSymbol.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/LineWithoutSymbol.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>LineWithoutSymbol.sketch created with Sketch 48 variant BETA build97\nINFO: No UX generated because no Sketch symbols found in sketch file. Sketchy :)\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MaskedTriangle.reference/Sketch.GroupWithMaskSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.GroupWithMaskSymbol\" Width=\"148\" Height=\"178\">\n\t<Panel Width=\"88.51351%\" Height=\"67.97753%\" Alignment=\"TopLeft\" Offset=\"0%, 32.02247%\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<!-- Masked shape group is not supported in UX -->\n\t</Panel>\n\t<Panel Width=\"89.18919%\" Height=\"77.52809%\" Alignment=\"TopLeft\" Offset=\"10.81081%, 0%\" Margin=\"0\">\n\t\t<!-- Oval -->\n\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"1, 0.9614078, 0.4768387, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MaskedTriangle.reference/Sketch.MaskedTriangle.ux",
    "content": "<Panel ux:Class=\"Sketch.MaskedTriangle\" Width=\"141\" Height=\"143\">\n\t<!-- Masked shape group is not supported in UX -->\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MaskedTriangle.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MaskedTriangle.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>MaskedTriangle.sketch created with Sketch 48.1 variant NONAPPSTORE build97\nWARNING: Masked shapes are not supported MaskedTriangle\nINFO: Wrote 'Sketch.MaskedTriangle' to '<path removed>Sketch.MaskedTriangle.ux'\nWARNING: Masked shapes are not supported Group\nINFO: Wrote 'Sketch.GroupWithMaskSymbol' to '<path removed>Sketch.GroupWithMaskSymbol.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Masks.reference/Sketch.AlphaMask.ux",
    "content": "<Panel ux:Class=\"Sketch.AlphaMask\" Width=\"129\" Height=\"129\">\n\t<!-- Masked shape group is not supported in UX -->\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Masks.reference/Sketch.AlphaMaskedRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.AlphaMaskedRectangle\" Width=\"194\" Height=\"165\">\n\t<!-- Masked shape group is not supported in UX -->\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Masks.reference/Sketch.PentagonMask.ux",
    "content": "<Panel ux:Class=\"Sketch.PentagonMask\" Width=\"100\" Height=\"100\">\n\t<!-- Masked shape group is not supported in UX -->\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Masks.reference/Sketch.RectangleMask.ux",
    "content": "<Panel ux:Class=\"Sketch.RectangleMask\" Width=\"100\" Height=\"100\">\n\t<!-- Masked shape group is not supported in UX -->\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Masks.reference/Sketch.StarMaskedIcon.ux",
    "content": "<Panel ux:Class=\"Sketch.StarMaskedIcon\" Width=\"100\" Height=\"100\">\n\t<!-- Masked shape group is not supported in UX -->\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Masks.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Masks.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Masks.sketch created with Sketch 48.1 variant NONAPPSTORE build97\nWARNING: Masked shapes are not supported RectangleMask\nINFO: Wrote 'Sketch.RectangleMask' to '<path removed>Sketch.RectangleMask.ux'\nWARNING: Masked shapes are not supported PentagonMask\nINFO: Wrote 'Sketch.PentagonMask' to '<path removed>Sketch.PentagonMask.ux'\nWARNING: Masked shapes are not supported StarMaskedIcon\nINFO: Wrote 'Sketch.StarMaskedIcon' to '<path removed>Sketch.StarMaskedIcon.ux'\nWARNING: Masked shapes are not supported AlphaMask\nINFO: Wrote 'Sketch.AlphaMask' to '<path removed>Sketch.AlphaMask.ux'\nWARNING: Masked shapes are not supported AlphaMaskedRectangle\nINFO: Wrote 'Sketch.AlphaMaskedRectangle' to '<path removed>Sketch.AlphaMaskedRectangle.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.Circle.ux",
    "content": "<Panel ux:Class=\"Sketch.Circle\" Width=\"75\" Height=\"75\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Circle -->\n\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"3\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.GreenArrow.ux",
    "content": "<Panel ux:Class=\"Sketch.GreenArrow\" Width=\"38\" Height=\"29\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Line -->\n\t\t<Path Data=\"M 0.01315789473684 0.9827586206897 L 0.9868421052632 0.01724137931034\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.2557843, 0.4596164, 0.01991642, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.HandDrawnHeart.ux",
    "content": "<Panel ux:Class=\"Sketch.HandDrawnHeart\" Width=\"94\" Height=\"86\">\n\t<Panel Width=\"99.79787%\" Height=\"99.21504%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Heart -->\n\t\t<Path Data=\"M 0.4693040536624 0.2793558680524 C 0.3528959028398 0.04166589071556 -0.06947151250564 0.02108493497518 0.009848570727567 0.3501037541338 C 0.04595880332237 0.499888595546 0.112512328101 0.4619116061188 0.2528746085949 0.5850237585303 C 0.4383952388834 0.7477444270117 0.3668460676179 0.8663369096149 0.4273440482069 0.995685445605 C 0.4378337416204 1.018113078277 0.4415346459063 0.9468005229698 0.455071851185 0.9264416028907 C 0.498491285886 0.8611420980999 0.5396274549386 0.7912492896275 0.5969729605438 0.7405765513946 C 0.6973765105537 0.6518560360968 0.8193582638472 0.5966271641932 0.9231824073455 0.5128007529925 C 0.9499273851694 0.4912071675982 0.9750231196481 0.4618943688293 0.9851622022379 0.4271570527933 C 1.056052119506 0.1842824694067 0.8626462569666 -0.07594843724612 0.6236747821973 0.02066040888936 C 0.545434652732 0.05229049627294 0.5140879365841 0.1651203871602 0.4811422997157 0.2304744586175 C 0.4811422997157 0.2304744586175 0.477196217698 0.2467682617624 0.4693040536624 0.2793558680524\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"0%, 1.665498E-14%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9689626, 0.3075799, 0.3075799, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8578337, 0, 0, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.Oval.ux",
    "content": "<Panel ux:Class=\"Sketch.Oval\" Width=\"150\" Height=\"75\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Oval -->\n\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.6985475, 0.9321322, 0.8798505, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.5435073, 0.3430676, 0.1652515, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.PathWithOneRoundedCorner.ux",
    "content": "<Panel ux:Class=\"Sketch.PathWithOneRoundedCorner\" Width=\"151\" Height=\"125\">\n\t<Panel Width=\"99.5825%\" Height=\"99.67525%\" Alignment=\"TopLeft\" Offset=\"0.1810844%, 0.2091309%\" Margin=\"0\">\n\t\t<!-- PathWithOneRoundedCorner -->\n\t\t<Path Data=\"M 0.307341747329 0.2146683394167 L 0 0.4871469797668 L 0.307341747329 0.5662789655272 L 0.1536708736645 0.9312141138042 L 0.4591811956545 1 L 0.9307797148846 0.8936232853863 L 0.5408549724783 0.8009473147414 L 0.8332595627864 0.4871469797668 C 1.090195981989 0.3005409658025 1.050190378837 0.1552252946458 0.7132427533316 0.0511999662968 C 0.3762951278261 -0.05282536205225 0.2409947924919 0.001664095654393 0.307341747329 0.2146683394167\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"0%, 5.702862E-15%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.739875, 0.06114692, 0.8790008, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.Polygon.ux",
    "content": "<Panel ux:Class=\"Sketch.Polygon\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"98%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Polygon -->\n\t\t<Path Data=\"M 0.5 0 L 0.9755282581476 0.3454915028125 L 0.7938926261462 0.9045084971875 L 0.2061073738538 0.9045084971875 L 0.02447174185242 0.3454915028125 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.ReallyRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.ReallyRectangle\" Width=\"185\" Height=\"158\">\n\t<Panel Width=\"99.87331%\" Height=\"99.77749%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- ReallyRectangle -->\n\t\t<Path Data=\"M 0 0.2388126269885 L 0.3618181818182 0 L 0.7685412262156 0.2388126269885 L 1 0.5 L 0.7685412262156 1 L 0.3618181818182 0.420783983349 L 0 1 L 0 0.2388126269885\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"3.076515E-14%, 0%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<LinearGradient StartPoint=\"0, 0.2334181\" EndPoint=\"0.5, 1\">\n\t\t\t\t<GradientStop Color=\"0.7662883, 1, 0.3528054, 1\" Offset=\"0\" />\n\t\t\t\t<GradientStop Color=\"0.2585623, 0.5777633, 0.1297717, 1\" Offset=\"1\" />\n\t\t\t</LinearGradient>\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.Star.ux",
    "content": "<Panel ux:Class=\"Sketch.Star\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"91%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Star -->\n\t\t<Path Data=\"M 0.5 0.75 L 0.2061073738538 0.9045084971875 L 0.2622358709262 0.5772542485937 L 0.02447174185242 0.3454915028125 L 0.3530536869269 0.2977457514063 L 0.5 0 L 0.6469463130731 0.2977457514063 L 0.9755282581476 0.3454915028125 L 0.7377641290738 0.5772542485937 L 0.7938926261462 0.9045084971875 L 0.5 0.75\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/Sketch.Triangle.ux",
    "content": "<Panel ux:Class=\"Sketch.Triangle\" Width=\"103\" Height=\"84\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Triangle -->\n\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.2886557, 0.5645519, 0.8862387, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MiscShapePaths.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>MiscShapePaths.sketch created with Sketch 47 variant BETA build95\nINFO: Wrote 'Sketch.Star' to '<path removed>Sketch.Star.ux'\nINFO: Wrote 'Sketch.Polygon' to '<path removed>Sketch.Polygon.ux'\nINFO: Wrote 'Sketch.Triangle' to '<path removed>Sketch.Triangle.ux'\nINFO: Wrote 'Sketch.PathWithOneRoundedCorner' to '<path removed>Sketch.PathWithOneRoundedCorner.ux'\nINFO: Wrote 'Sketch.ReallyRectangle' to '<path removed>Sketch.ReallyRectangle.ux'\nINFO: Wrote 'Sketch.Circle' to '<path removed>Sketch.Circle.ux'\nINFO: Wrote 'Sketch.Oval' to '<path removed>Sketch.Oval.ux'\nINFO: Wrote 'Sketch.HandDrawnHeart' to '<path removed>Sketch.HandDrawnHeart.ux'\nINFO: Wrote 'Sketch.GreenArrow' to '<path removed>Sketch.GreenArrow.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MultipleStyledText.reference/Sketch.RainbowGrowingSize.ux",
    "content": "<Panel ux:Class=\"Sketch.RainbowGrowingSize\" Width=\"264\" Height=\"28\" RainbowGrowingSize=\"This text gets bigger and bigger\">\n\t<string ux:Property=\"RainbowGrowingSize\" />\n\t<Text Color=\"0.8162038, 0.007513228, 0.106696, 1\" FontSize=\"10\" Value=\"{Property RainbowGrowingSize}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"100%\" Height=\"100%\" Alignment=\"BottomLeft\" Margin=\"0\">\n\t\t<!-- RainbowGrowingSize -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MultipleStyledText.reference/Sketch.RainbowGrowingSizeVertical.ux",
    "content": "<Panel ux:Class=\"Sketch.RainbowGrowingSizeVertical\" Width=\"76\" Height=\"116\" RainbowGrowingSize=\"This\ntext\ngets\nbigger\nand\nbigger\">\n\t<string ux:Property=\"RainbowGrowingSize\" />\n\t<Text Color=\"0.8162038, 0.007513228, 0.106696, 1\" FontSize=\"10\" Value=\"{Property RainbowGrowingSize}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"100%\" Height=\"100%\" Alignment=\"BottomLeft\" Margin=\"0\">\n\t\t<!-- RainbowGrowingSize -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MultipleStyledText.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/MultipleStyledText.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>MultipleStyledText.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nWARNING: UX Builder: Multiple text styles on the same text element not supported in UX. Found 6 text styles on RainbowGrowingSize, using just one of them.\nINFO: Wrote 'Sketch.RainbowGrowingSize' to '<path removed>Sketch.RainbowGrowingSize.ux'\nWARNING: UX Builder: Multiple text styles on the same text element not supported in UX. Found 6 text styles on RainbowGrowingSize, using just one of them.\nINFO: Wrote 'Sketch.RainbowGrowingSizeVertical' to '<path removed>Sketch.RainbowGrowingSizeVertical.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/NestedSymbol.reference/Sketch.MySymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.MySymbol\" Width=\"165\" Height=\"163\">\n\t<Panel Width=\"67.27273%\" Height=\"63.80368%\" Alignment=\"TopLeft\" Offset=\"32.72727%, 36.19632%\" Margin=\"0\">\n\t\t<!-- Oval -->\n\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n\t<Panel Width=\"58.78788%\" Height=\"57.05521%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/NestedSymbol.reference/Sketch.NestedSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.NestedSymbol\" Width=\"240\" Height=\"206\">\n\t<Sketch.MySymbol Width=\"68.75%\" Height=\"79.12621%\" Alignment=\"TopLeft\" Offset=\"17.91667%, 12.13592%\" Margin=\"0\">\n\t\t<!-- MySymbol -->\n\t</Sketch.MySymbol>\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle CornerRadius=\"50\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"1, 0.9599364, 0.4568931, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/NestedSymbol.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/NestedSymbol.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>NestedSymbol.sketch created with Sketch 48 variant BETA build97\nINFO: Wrote 'Sketch.MySymbol' to '<path removed>Sketch.MySymbol.ux'\nINFO: Wrote 'Sketch.NestedSymbol' to '<path removed>Sketch.NestedSymbol.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/OpenFilledPath.reference/Sketch.OpenFilled.ux",
    "content": "<Panel ux:Class=\"Sketch.OpenFilled\" Width=\"99\" Height=\"100\">\n\t<Panel Width=\"98.7571%\" Height=\"99.29297%\" Alignment=\"TopLeft\" Offset=\"0.80887%, 0.3398438%\" Margin=\"0\">\n\t\t<!-- Path 2 -->\n\t\t<Path Data=\"M 0 0 L 1 0 L 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/OpenFilledPath.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/OpenFilledPath.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>OpenFilledPath.sketch created with Sketch 47.1 variant NONAPPSTORE build95\nINFO: Wrote 'Sketch.OpenFilled' to '<path removed>Sketch.OpenFilled.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Oval.reference/Sketch.Oval.ux",
    "content": "<Panel ux:Class=\"Sketch.Oval\" Width=\"142\" Height=\"61\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Oval -->\n\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Oval.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Oval.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Oval.sketch created with Sketch 48 variant BETA build97\nINFO: Wrote 'Sketch.Oval' to '<path removed>Sketch.Oval.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/Sketch.Curve.ux",
    "content": "<Panel ux:Class=\"Sketch.Curve\" Width=\"95\" Height=\"110\">\n\t<Panel Width=\"98.56627%\" Height=\"98.34872%\" Alignment=\"TopLeft\" Offset=\"0.9046053%, 0.8061079%\" Margin=\"0\">\n\t\t<!-- Path -->\n\t\t<Path Data=\"M 0 0 C 0.8213983409514 0.05464283565024 1.136775256015 0.3879761689836 0.9461307451893 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"3\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/Sketch.EndWithCurve.ux",
    "content": "<Panel ux:Class=\"Sketch.EndWithCurve\" Width=\"199\" Height=\"100\">\n\t<Panel Width=\"99.66041%\" Height=\"99.79688%\" Alignment=\"TopLeft\" Offset=\"0%, 1.705303E-13%\" Margin=\"0\">\n\t\t<!-- EndWithCurve -->\n\t\t<Path Data=\"M 0 1 L 0.5 0 C 0.8330313236559 -1.139182341347E-15 0.9996979903226 0.3333333333333 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/Sketch.Mirrored.ux",
    "content": "<Panel ux:Class=\"Sketch.Mirrored\" Width=\"199\" Height=\"100\">\n\t<Panel Width=\"99.66041%\" Height=\"99.79688%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Mirrored -->\n\t\t<Path Data=\"M 0 1 C 0.1666666666667 0.3333333333333 0.3333333333333 2.041077998579E-17 0.5 0 C 0.6666666666667 0 0.8333333333333 0.3333333333333 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/Sketch.MirroredCurve.ux",
    "content": "<Panel ux:Class=\"Sketch.MirroredCurve\" Width=\"163\" Height=\"95\">\n\t<Panel Width=\"99.55425%\" Height=\"98.82401%\" Alignment=\"TopLeft\" Offset=\"0.2396472%, 0.1644737%\" Margin=\"0\">\n\t\t<!-- Path -->\n\t\t<Path Data=\"M 0 1 C 0.137842205912 0.3333333333333 0.2914056677899 -2.073139878521E-17 0.4606903856338 0 C 0.6299751034777 1.879437914675E-17 0.8097449749331 0.3333333333333 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/Sketch.StartWithCurve.ux",
    "content": "<Panel ux:Class=\"Sketch.StartWithCurve\" Width=\"200\" Height=\"100\">\n\t<Panel Width=\"99.16933%\" Height=\"99.79688%\" Alignment=\"TopLeft\" Offset=\"0.4927825%, -1.136868E-13%\" Margin=\"0\">\n\t\t<!-- StartWithCurve -->\n\t\t<Path Data=\"M 7.277979918411E-05 1 C -0.003997489163574 0.3333333333333 0.1626570475366 7.594548942314E-16 0.5000363898996 0 L 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/Sketch.Straight.ux",
    "content": "<Panel ux:Class=\"Sketch.Straight\" Width=\"199\" Height=\"100\">\n\t<Panel Width=\"99.66041%\" Height=\"99.79688%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Straight -->\n\t\t<Path Data=\"M 0 1 L 0.5 0 L 1 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Paths.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Paths.sketch created with Sketch 47.1 variant NONAPPSTORE build95\nINFO: Wrote 'Sketch.Curve' to '<path removed>Sketch.Curve.ux'\nINFO: Wrote 'Sketch.MirroredCurve' to '<path removed>Sketch.MirroredCurve.ux'\nINFO: Wrote 'Sketch.Straight' to '<path removed>Sketch.Straight.ux'\nINFO: Wrote 'Sketch.Mirrored' to '<path removed>Sketch.Mirrored.ux'\nINFO: Wrote 'Sketch.EndWithCurve' to '<path removed>Sketch.EndWithCurve.ux'\nINFO: Wrote 'Sketch.StartWithCurve' to '<path removed>Sketch.StartWithCurve.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Properties.reference/Sketch.SomeTexts.ux",
    "content": "<Panel ux:Class=\"Sketch.SomeTexts\" Width=\"85\" Height=\"14\" TextInGroup=\"Hi there\" SimpleText=\"Head line\">\n\t<string ux:Property=\"SimpleText\" />\n\t<string ux:Property=\"TextInGroup\" />\n\t<Text Color=\"0, 0, 0, 1\" FontSize=\"12\" Value=\"{Property SimpleText}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Width=\"60%\" Height=\"100%\" Alignment=\"BottomLeft\" Offset=\"20%, 0\" Margin=\"0\">\n\t\t<!-- SimpleText -->\n\t</Text>\n\t<Panel Width=\"100%\" Height=\"450%\" Alignment=\"TopLeft\" Offset=\"0%, 100%\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Group 2 -->\n\t\t\t<Text Color=\"0, 0, 0, 1\" FontSize=\"12\" Value=\"{Property TextInGroup}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Width=\"50.58823%\" Height=\"22.22222%\" Alignment=\"BottomLeft\" Offset=\"24.70588%, -31\" Margin=\"0\">\n\t\t\t\t<!-- TextInGroup -->\n\t\t\t</Text>\n\t\t\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Rectangle -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t\t</Stroke>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Properties.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Properties.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Properties.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.SomeTexts' to '<path removed>Sketch.SomeTexts.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Rectangle.reference/Sketch.Rectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.Rectangle\" Width=\"147\" Height=\"107\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Rectangle -->\n\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.7510098, 0.5846576, 0.4370815, 1\" />\n\t\t\t\t<Stroke Width=\"3\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.5435073, 0.3430676, 0.1652515, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Rectangle.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Rectangle.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Rectangle.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.Rectangle' to '<path removed>Sketch.Rectangle.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/RotatedLayer.reference/Sketch.RotatedLayerSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.RotatedLayerSymbol\" Width=\"138\" Height=\"138\">\n\t<Panel Width=\"72.46377%\" Height=\"72.46377%\" Alignment=\"TopLeft\" Offset=\"13.76812%, 13.76812%\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.4941505, 0.8262341, 0.1298773, 0.4693727\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n\t<Panel Width=\"72.46377%\" Height=\"72.46377%\" Alignment=\"TopLeft\" Offset=\"13.76812%, 13.76812%\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t\t<Rotation Degrees=\"30\" />\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/RotatedLayer.reference/Sketch.Spiral.ux",
    "content": "<Panel ux:Class=\"Sketch.Spiral\" Width=\"142\" Height=\"142\">\n\t<Panel Width=\"70.42254%\" Height=\"70.42254%\" Alignment=\"TopLeft\" Offset=\"14.78873%, 14.78873%\" Margin=\"0\" Opacity=\"0.6\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.2886557, 0.5645519, 0.8862387, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t\t<Rotation Degrees=\"75\" />\n\t</Panel>\n\t<Panel Width=\"70.42254%\" Height=\"70.42254%\" Alignment=\"TopLeft\" Offset=\"14.78873%, 14.78873%\" Margin=\"0\" Opacity=\"0.7\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.4941505, 0.8262341, 0.1298773, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t\t<Rotation Degrees=\"60\" />\n\t</Panel>\n\t<Panel Width=\"70.42254%\" Height=\"70.42254%\" Alignment=\"TopLeft\" Offset=\"14.78873%, 14.78873%\" Margin=\"0\" Opacity=\"0.8\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t\t<Rotation Degrees=\"45\" />\n\t</Panel>\n\t<Panel Width=\"70.42254%\" Height=\"70.42254%\" Alignment=\"TopLeft\" Offset=\"14.78873%, 14.78873%\" Margin=\"0\" Opacity=\"0.9030797\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t\t<Rotation Degrees=\"30\" />\n\t</Panel>\n\t<Panel Width=\"70.42254%\" Height=\"70.42254%\" Alignment=\"TopLeft\" Offset=\"14.78873%, 14.78873%\" Margin=\"0\">\n\t\t<!-- Rectangle 2 -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"1, 0, 0, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t\t<Rotation Degrees=\"15\" />\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/RotatedLayer.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/RotatedLayer.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>RotatedLayer.sketch created with Sketch 48.1 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.RotatedLayerSymbol' to '<path removed>Sketch.RotatedLayerSymbol.ux'\nINFO: Wrote 'Sketch.Spiral' to '<path removed>Sketch.Spiral.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/RoundedRectanglesGroup.reference/Sketch.RoundedGroup.ux",
    "content": "<Panel ux:Class=\"Sketch.RoundedGroup\" Width=\"175\" Height=\"109\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Group -->\n\t\t<Panel Width=\"52%\" Height=\"75.22935%\" Alignment=\"TopLeft\" Offset=\"48%, 24.77064%\" Margin=\"0\">\n\t\t\t<!-- Rectangle 2 -->\n\t\t\t<Rectangle CornerRadius=\"8\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t\t<Panel Width=\"44.57143%\" Height=\"74.31193%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Rectangle -->\n\t\t\t<Rectangle CornerRadius=\"8\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t\t</Stroke>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/RoundedRectanglesGroup.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/RoundedRectanglesGroup.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>RoundedRectanglesGroup.sketch created with Sketch 48 variant BETA build97\nINFO: Wrote 'Sketch.RoundedGroup' to '<path removed>Sketch.RoundedGroup.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ScissoredPolygons.reference/Sketch.ScissoredPathOneCurve.ux",
    "content": "<Panel ux:Class=\"Sketch.ScissoredPathOneCurve\" Width=\"192\" Height=\"197\">\n\t<Panel Width=\"99.21875%\" Height=\"99.67283%\" Alignment=\"TopLeft\" Offset=\"0.4923503%, 0.1824239%\" Margin=\"0\">\n\t\t<!-- Path 2 -->\n\t\t<Path Data=\"M 0.08876722440945 0 C 0.200384131671 0.1245084581667 0.1707950568679 0.2370806559638 0 0.3377165933913 C 0 0.3377165933913 0.08925251531059 0.5024104614691 0.2677575459318 0.8317981976247 L 1 1 C 0.6666666666667 0.7526276350953 0.5 0.6289414526429 0.5 0.6289414526429 C 0.3878909667542 0.3782401973462 0.4077673884514 0.2811652442623 0.5596292650919 0.3377165933913 C 0.7114911417323 0.3942679425203 0.8244203849519 0.4913428956041 0.8984169947507 0.6289414526429 C 0.8984169947507 0.6289414526429 0.8881301946632 0.4551693954284 0.8675565944882 0.1076252809995 L 0.4241715879265 9.046637970964E-17 L 0.4241715879265 9.046637970964E-17\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"1, 0.697897, 0.697897, 1\" />\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ScissoredPolygons.reference/Sketch.ScissoredPentagon.ux",
    "content": "<Panel ux:Class=\"Sketch.ScissoredPentagon\" Width=\"216\" Height=\"205\">\n\t<Panel Width=\"99.50869%\" Height=\"99.71655%\" Alignment=\"TopLeft\" Offset=\"0.2456545%, 0%\" Margin=\"0\">\n\t\t<!-- ScissoredPentagon -->\n\t\t<Path Data=\"M 0 0 L 1 1\" StretchMode=\"Fill\" Width=\"50%\" Height=\"38.1966%\" Alignment=\"TopLeft\" Offset=\"50%, 0%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9273586, 0.5729759, 1, 1\" />\n\t\t\t<Stroke Width=\"4\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Path Data=\"M 1 1 L 0.2360679774998 1 L 0 0\" StretchMode=\"Fill\" Width=\"80.9017%\" Height=\"61.8034%\" Alignment=\"TopLeft\" Offset=\"0%, 38.1966%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9273586, 0.5729759, 1, 1\" />\n\t\t\t<Stroke Width=\"4\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ScissoredPolygons.reference/Sketch.ScissoredRectangle.ux",
    "content": "<Panel ux:Class=\"Sketch.ScissoredRectangle\" Width=\"150\" Height=\"150\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Path Data=\"M 0 0 L 0 1\" StretchMode=\"Fill\" Width=\"0.6666667%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"100%, 0%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"4\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Path Data=\"M 0 1 L 0 0\" StretchMode=\"Fill\" Width=\"0.6666667%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"4\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ScissoredPolygons.reference/Sketch.ScissoredTree.ux",
    "content": "<Panel ux:Class=\"Sketch.ScissoredTree\" Width=\"188\" Height=\"166\">\n\t<Panel Width=\"99.59068%\" Height=\"99.28229%\" Alignment=\"TopLeft\" Offset=\"0.2244016%, 0.2211973%\" Margin=\"0\">\n\t\t<!-- Path 3 -->\n\t\t<Path Data=\"M 1 0 L 0.0805827511881 0 L 0 1\" StretchMode=\"Fill\" Width=\"80.3384%\" Height=\"62.36401%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.3827645, 0.7135417, 0, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Path Data=\"M 0.05950632625395 0.2665440010152 L 0 0.9462280312163 L 0.3769204699503 0.5657001459298 L 0.7692611839132 1 L 1 0.8087050314066 L 0.6094103027564 0.3943594949559 L 0.9703739267962 0.06579531755599 L 0.3769204699503 0\" StretchMode=\"Fill\" Width=\"73.87286%\" Height=\"74.71262%\" Alignment=\"TopLeft\" Offset=\"26.12714%, 25.28738%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.3827645, 0.7135417, 0, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ScissoredPolygons.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ScissoredPolygons.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>ScissoredPolygons.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.ScissoredPentagon' to '<path removed>Sketch.ScissoredPentagon.ux'\nINFO: Wrote 'Sketch.ScissoredRectangle' to '<path removed>Sketch.ScissoredRectangle.ux'\nINFO: Wrote 'Sketch.ScissoredPathOneCurve' to '<path removed>Sketch.ScissoredPathOneCurve.ux'\nINFO: Wrote 'Sketch.ScissoredTree' to '<path removed>Sketch.ScissoredTree.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ShadowedText.reference/Sketch.InnerShadowedText.ux",
    "content": "<Panel ux:Class=\"Sketch.InnerShadowedText\" Width=\"479\" Height=\"51\" Text_with_inner_shad=\"Text_with_inner_shadow\">\n\t<string ux:Property=\"Text_with_inner_shad\" />\n\t<Text Color=\"0.8162038, 0.007513228, 0.106696, 1\" FontSize=\"36\" Value=\"{Property Text_with_inner_shad}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"100%\" Height=\"100%\" Alignment=\"BottomLeft\" Margin=\"0\">\n\t\t<!-- Text_with_inner_shad -->\n\t\t<!-- Inner shadow not supported in UX -->\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ShadowedText.reference/Sketch.MultipleShadowedText.ux",
    "content": "<Panel ux:Class=\"Sketch.MultipleShadowedText\" Width=\"192\" Height=\"28\" Multiple_shadows=\"Multiple shadows\">\n\t<string ux:Property=\"Multiple_shadows\" />\n\t<Text Color=\"0.8162038, 0.007513228, 0.106696, 1\" FontSize=\"20\" Value=\"{Property Multiple_shadows}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"99.47916%\" Height=\"100%\" Alignment=\"BottomLeft\" Offset=\"0.2604167%, 0\" Margin=\"0\">\n\t\t<!-- Multiple_shadows -->\n\t\t<Shadow Angle=\"135\" Distance=\"7.071068\" Color=\"0.3143694, 0.8883757, 0.7598996, 1\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t<Shadow Angle=\"45\" Distance=\"7.071068\" Color=\"0.961711, 0.6503673, 0.1385423, 1\" Size=\"4\" Mode=\"PerPixel\" />\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ShadowedText.reference/Sketch.ShadowedText.ux",
    "content": "<Panel ux:Class=\"Sketch.ShadowedText\" Width=\"320\" Height=\"28\" This_is_a_text_width=\"This_is_a_text_width_shadow\">\n\t<string ux:Property=\"This_is_a_text_width\" />\n\t<Text Color=\"0.8162038, 0.007513228, 0.106696, 1\" FontSize=\"20\" Value=\"{Property This_is_a_text_width}\" TextTruncation=\"None\" TextWrapping=\"Wrap\" TextAlignment=\"Center\" Width=\"99.6875%\" Height=\"100%\" Alignment=\"BottomLeft\" Offset=\"0.15625%, 0\" Margin=\"0\">\n\t\t<!-- This_is_a_text_width -->\n\t\t<Shadow Angle=\"135\" Distance=\"14.14214\" Color=\"0, 0, 0, 1\" Size=\"4\" Mode=\"PerPixel\" />\n\t</Text>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ShadowedText.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/ShadowedText.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>ShadowedText.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.ShadowedText' to '<path removed>Sketch.ShadowedText.ux'\nWARNING: UX Builder: Borders on Sketch texts not supported in UX (Sketch object: Multiple_shadows).\nWARNING: UX Builder: Fills on Sketch texts not supported in UX (Sketch object: Multiple_shadows). Using text style color instead.\nINFO: Wrote 'Sketch.MultipleShadowedText' to '<path removed>Sketch.MultipleShadowedText.ux'\nWARNING: UX Builder: Inner shadows not supported. Text_with_inner_shad has 1 shadow.\nINFO: Wrote 'Sketch.InnerShadowedText' to '<path removed>Sketch.InnerShadowedText.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Shadows.reference/Sketch.FilledOvalSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.FilledOvalSymbol\" Width=\"100\" Height=\"100\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- FilledOval -->\n\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"116.565\" Distance=\"11.18034\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<SolidColor Color=\"0.961711, 0.6503673, 0.1385423, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Shadows.reference/Sketch.RectGrid.ux",
    "content": "<Panel ux:Class=\"Sketch.RectGrid\" Width=\"121\" Height=\"114\">\n\t<Panel Width=\"41.32232%\" Height=\"43.85965%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- UpperLeft -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"-45\" Distance=\"7.071068\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<Stroke Width=\"2\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n\t<Panel Width=\"41.32232%\" Height=\"43.85965%\" Alignment=\"TopLeft\" Offset=\"58.67768%, 0%\" Margin=\"0\">\n\t\t<!-- UpperRight -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"-135\" Distance=\"7.071068\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<Stroke Width=\"2\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n\t<Panel Width=\"41.32232%\" Height=\"43.85965%\" Alignment=\"TopLeft\" Offset=\"0%, 56.14035%\" Margin=\"0\">\n\t\t<!-- LowerLeft -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"45\" Distance=\"7.071068\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<Stroke Width=\"2\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n\t<Panel Width=\"41.32232%\" Height=\"43.85965%\" Alignment=\"TopLeft\" Offset=\"58.67768%, 56.14035%\" Margin=\"0\">\n\t\t<!-- LowerRight -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"135\" Distance=\"7.071068\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<Stroke Width=\"2\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Shadows.reference/Sketch.RectangleSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.RectangleSymbol\" Width=\"95\" Height=\"85\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"135\" Distance=\"7.071068\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<Stroke Width=\"2\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Shadows.reference/Sketch.RotatedPathSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.RotatedPathSymbol\" Width=\"173\" Height=\"121\">\n\t<Panel Width=\"89.59538%\" Height=\"68.59504%\" Alignment=\"TopLeft\" Offset=\"5.202312%, 15.70248%\" Margin=\"0\">\n\t\t<!-- RotatedPath -->\n\t\t<Path Data=\"M 0.04775064917203 0.2184510009597 L 0 0.6953367100138 L 0.06997636008675 0.8814768034488 L 0.3642624020568 1 L 0.62016659311 0.8128506991487 L 0.9614603284765 0.8814768034488 L 0.9954348146226 0.5481567168311 C 1.011830211569 0.4028777887813 0.9840638135144 0.3373262466095 0.9121356204578 0.3515020903159 C 0.8042433308729 0.3727658558753 0.8010700282381 0.3704423318241 0.7637837222786 0.4592995243276 C 0.7389261849722 0.5185376526633 0.699461381569 0.4382548115407 0.6453893120688 0.2184510009597 C 0.6330783496242 0.02411989849566 0.59257368713 -0.04055543258608 0.523875324586 0.02442500771451 C 0.455176962042 0.08940544801509 0.4208277807701 0.2096888900596 0.4208277807701 0.385275333848 C 0.4334286465238 0.4788108677071 0.4222843098895 0.5535078631309 0.3873947708672 0.6093663201193 C 0.3525052318449 0.6652247771078 0.2986472343478 0.6448215760117 0.2258207783761 0.5481567168311 C 0.1790439469438 0.6084901090293 0.1546397385853 0.5686225044336 0.1526081533006 0.4285539030441 C 0.1505765680158 0.2884853016545 0.1156240666397 0.2184510009597 0.04775064917203 0.2184510009597\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"0%, 1.712151E-14%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"135\" Distance=\"7.071068\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<Stroke Width=\"2\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.2886557, 0.5645519, 0.8862387, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t\t<Rotation Degrees=\"195\" />\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Shadows.reference/Sketch.TriangleSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.TriangleSymbol\" Width=\"115\" Height=\"97\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Triangle -->\n\t\t<Path Data=\"M 0.5 0 L 1 1 L 0 1 L 0.5 0\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Shadow Angle=\"-45\" Distance=\"14.14214\" Color=\"0, 0, 0, 0.5\" Size=\"4\" Mode=\"PerPixel\" />\n\t\t\t<Stroke Width=\"3\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.8162038, 0.007513228, 0.106696, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Shadows.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Shadows.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Shadows.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nINFO: Wrote 'Sketch.RectangleSymbol' to '<path removed>Sketch.RectangleSymbol.ux'\nINFO: Wrote 'Sketch.RotatedPathSymbol' to '<path removed>Sketch.RotatedPathSymbol.ux'\nINFO: Wrote 'Sketch.TriangleSymbol' to '<path removed>Sketch.TriangleSymbol.ux'\nINFO: Wrote 'Sketch.FilledOvalSymbol' to '<path removed>Sketch.FilledOvalSymbol.ux'\nINFO: Wrote 'Sketch.RectGrid' to '<path removed>Sketch.RectGrid.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Star.reference/Sketch.Star.ux",
    "content": "<Panel ux:Class=\"Sketch.Star\" Width=\"158\" Height=\"135\">\n\t<Panel Width=\"99.92113%\" Height=\"99.83093%\" Alignment=\"TopLeft\" Offset=\"0.03943617%, 0%\" Margin=\"0\">\n\t\t<!-- Star -->\n\t\t<Path Data=\"M 0.5 0.75 L 0.2061073738538 0.9045084971875 L 0.2622358709262 0.5772542485937 L 0.02447174185242 0.3454915028125 L 0.3530536869269 0.2977457514063 L 0.5 0 L 0.6469463130731 0.2977457514063 L 0.9755282581476 0.3454915028125 L 0.7377641290738 0.5772542485937 L 0.7938926261462 0.9045084971875 L 0.5 0.75\" StretchMode=\"Fill\" Width=\"105.1462%\" Height=\"110.5573%\" Alignment=\"TopLeft\" Offset=\"-2.573111%, 0%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.9707752, 0.9072384, 0.1094621, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Star.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/Star.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>Star.sketch created with Sketch 48 variant BETA build97\nINFO: Wrote 'Sketch.Star' to '<path removed>Sketch.Star.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/SymbolNames.reference/Sketch.DuplicateName.ux",
    "content": "<Panel ux:Class=\"Sketch.DuplicateName\" Width=\"128\" Height=\"99\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/SymbolNames.reference/Sketch.OkSymbol.ux",
    "content": "<Panel ux:Class=\"Sketch.OkSymbol\" Width=\"90\" Height=\"86\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Rectangle -->\n\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<SolidColor Color=\"0.847, 0.847, 0.847, 1\" />\n\t\t\t<Stroke Width=\"1\" Alignment=\"Inside\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Rectangle>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/SymbolNames.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/SymbolNames.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>SymbolNames.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nERROR: The symbol name 'Symbol With Space' contains an invalid character. Please only use the letters a-z, numbers, or underscores, and don't start the name with a number.\nERROR: The symbol name 'class' is a reserved word. Please choose another name.\nERROR: More than one symbol named 'DuplicateName' was found! Only generating ux for one of them. Please make sure symbol names are unique.\nINFO: Wrote 'Sketch.OkSymbol' to '<path removed>Sketch.OkSymbol.ux'\nINFO: Wrote 'Sketch.DuplicateName' to '<path removed>Sketch.DuplicateName.ux'\nINFO: Wrote 'Sketch.DuplicateName' to '<path removed>Sketch.DuplicateName.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/TestProject.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/TestProject.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>TestProject.sketch created with Sketch 44.1 variant NONAPPSTORE build91\nWARNING: The sketch file was created with an older version than Sketch2Fuse supports, please open the file in Sketch and save it as with the newer version if you experence any problems.\nINFO: No UX generated because no Sketch symbols found in sketch file. Sketchy :)\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/VectorPath.reference/Sketch.Path.ux",
    "content": "<Panel ux:Class=\"Sketch.Path\" Width=\"457\" Height=\"599\">\n\t<Panel Width=\"99.73982%\" Height=\"99.83171%\" Alignment=\"TopLeft\" Offset=\"0.1447793%, 0.1526404%\" Margin=\"0\">\n\t\t<!-- Path -->\n\t\t<Path Data=\"M 0.3455346834779 0.5281343126525 C 0.4049982896511 0.3733236612736 0.5382172209488 0.3080270029491 0.7451914773707 0.3322443376791 L 1 0.5400230599665 L 0.9281071975133 0.7782944594306 L 0.4119084771671 0.8455246722632 L 0.3938688599023 1 C 0.3643541606814 0.8047109946711 0.307555790123 0.6873150585112 0.2234737482272 0.6478121915203 C 0.09735068538334 0.588557891034 -0.1309940186646 0.6439973407338 0.09735068538334 0.5400230599665 C 0.3256953894313 0.4360487791991 0.4500273453828 0.2401000137171 0.3256953894313 0.171707055268 C 0.242807418797 0.1261117496353 0.2929555551523 0.07888555174281 0.4761397984972 0.03002846159061 C 0.5891937799496 -0.02226460718091 0.6577186158876 -0.006258346832 0.6817143063111 0.07804724263733\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"6.235415E-15%, 0%\" Margin=\"0\">\n\t\t\t<!-- Path -->\n\t\t\t<Stroke Width=\"1\" Alignment=\"Center\">\n\t\t\t\t<SolidColor Color=\"0.592, 0.592, 0.592, 1\" />\n\t\t\t</Stroke>\n\t\t</Path>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/VectorPath.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/VectorPath.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>VectorPath.sketch created with Sketch 48 variant BETA build97\nINFO: Wrote 'Sketch.Path' to '<path removed>Sketch.Path.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/desert-moon-zwj-sketch43.reference/Sketch.Desert_Moon.ux",
    "content": "<Panel ux:Class=\"Sketch.Desert_Moon\" Width=\"191\" Height=\"500\">\n\t<Panel Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t<!-- Desert Moon -->\n\t\t<Panel Width=\"92.1466%\" Height=\"35.2%\" Alignment=\"TopLeft\" Offset=\"3.664922%, 1.4%\" Margin=\"0\">\n\t\t\t<!-- Moon -->\n\t\t\t<Panel Width=\"27.84091%\" Height=\"27.84091%\" Alignment=\"TopLeft\" Offset=\"36.36364%, 36.36364%\" Margin=\"0\">\n\t\t\t\t<!-- 4 -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<Shadow Angle=\"180\" Distance=\"0\" Color=\"0.282353, 0.7843137, 0.8392157, 1\" Size=\"20\" Mode=\"PerPixel\" />\n\t\t\t\t\t<!-- Inner shadow not supported in UX -->\n\t\t\t\t\t<SolidColor Color=\"0.8156863, 0.9921569, 1, 1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t</Panel>\n\t\t<Panel Width=\"82.72251%\" Height=\"30.6%\" Alignment=\"TopLeft\" Offset=\"7.329843%, 5.8%\" Margin=\"0\">\n\t\t\t<!-- Stars Large -->\n\t\t\t<Panel Width=\"1.898734%\" Height=\"1.960784%\" Alignment=\"TopLeft\" Offset=\"0%, 71.89542%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"2.531646%\" Height=\"2.614379%\" Alignment=\"TopLeft\" Offset=\"97.46835%, 63.39869%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.898734%\" Height=\"1.960784%\" Alignment=\"TopLeft\" Offset=\"78.48101%, 98.03922%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"2.531646%\" Height=\"2.614379%\" Alignment=\"TopLeft\" Offset=\"20.25316%, 88.23529%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"2.531646%\" Height=\"2.614379%\" Alignment=\"TopLeft\" Offset=\"34.81013%, 83.66013%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"2.531646%\" Height=\"2.614379%\" Alignment=\"TopLeft\" Offset=\"17.72152%, 13.0719%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"2.531646%\" Height=\"2.614379%\" Alignment=\"TopLeft\" Offset=\"63.29114%, 0%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t</Panel>\n\t\t<Panel Width=\"90.57591%\" Height=\"34.4%\" Alignment=\"TopLeft\" Offset=\"2.879581%, 4.7%\" Margin=\"0\" Opacity=\"0.3\">\n\t\t\t<!-- Stars Small -->\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"0.5780347%, 69.76744%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"98.84393%, 38.37209%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"0%, -5.684342E-12%\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"80.34682%, 22.67442%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"74.56647%, 10.46512%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"59.53757%, 19.76744%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"68.78613%, 33.72093%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"71.09827%, 73.25581%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"90.17341%, 85.46512%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"56.6474%, 98.83721%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"19.07514%, 84.30232%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"45.66474%, 74.4186%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"-1.421085E-12%, 0%\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"11.56069%, 45.93023%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"22.54335%, 21.51163%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"1.156069%\" Height=\"1.162791%\" Alignment=\"TopLeft\" Offset=\"41.6185%, 0%\" Margin=\"0\">\n\t\t\t\t<!-- star -->\n\t\t\t\t<Path Data=\"M 0.5 1 C 0.7761423749 1 1 0.7761423749 1 0.5 C 1 0.2238576251 0.7761423749 0 0.5 0 C 0.2238576251 0 0 0.2238576251 0 0.5 C 0 0.7761423749 0.2238576251 1 0.5 1\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<SolidColor Color=\"1\" />\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t\t<Rotation Degrees=\"-270\" />\n\t\t</Panel>\n\t\t<Panel Width=\"100%\" Height=\"59.8%\" Alignment=\"TopLeft\" Offset=\"0%, 40.2%\" Margin=\"0\">\n\t\t\t<!-- Desert -->\n\t\t\t<Panel Width=\"32.98429%\" Height=\"14.71572%\" Alignment=\"TopLeft\" Offset=\"-16.23037%, 57.52509%\" Margin=\"0\">\n\t\t\t\t<!-- Shadow Mask Bottom -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<LinearGradient StartPoint=\"0.5, 0\" EndPoint=\"0.5, 1\">\n\t\t\t\t\t\t<GradientStop Color=\"0.2117647, 0.5568628, 0.6431373, 1\" Offset=\"0\" />\n\t\t\t\t\t\t<GradientStop Color=\"0.08235294, 0.3921569, 0.4941176, 1\" Offset=\"1\" />\n\t\t\t\t\t</LinearGradient>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"20.94241%\" Height=\"12.70903%\" Alignment=\"TopLeft\" Offset=\"86.38744%, 19.73244%\" Margin=\"0\">\n\t\t\t\t<!-- Shadow Mask Top -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<LinearGradient StartPoint=\"0.5, 0\" EndPoint=\"0.5, 1\">\n\t\t\t\t\t\t<GradientStop Color=\"0.2117647, 0.5568628, 0.6431373, 1\" Offset=\"0\" />\n\t\t\t\t\t\t<GradientStop Color=\"0.08235294, 0.3921569, 0.4941176, 1\" Offset=\"1\" />\n\t\t\t\t\t</LinearGradient>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"47.64398%\" Height=\"12.70903%\" Alignment=\"TopLeft\" Offset=\"62.30367%, 12.70903%\" Margin=\"0\">\n\t\t\t\t<!-- Shadow Mask Top -->\n\t\t\t\t<Rectangle Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<LinearGradient StartPoint=\"0.5, 0\" EndPoint=\"0.5, 1\">\n\t\t\t\t\t\t<GradientStop Color=\"0.2117647, 0.5568628, 0.6431373, 1\" Offset=\"0\" />\n\t\t\t\t\t\t<GradientStop Color=\"0.08235294, 0.3921569, 0.4941176, 1\" Offset=\"1\" />\n\t\t\t\t\t</LinearGradient>\n\t\t\t\t</Rectangle>\n\t\t\t</Panel>\n\t\t\t<Panel Width=\"20.74214%\" Height=\"9.374535%\" Alignment=\"TopLeft\" Offset=\"80.89111%, 27.82638%\" Margin=\"0\" Opacity=\"0.8270172\">\n\t\t\t\t<!-- Sand Dune Detail -->\n\t\t\t\t<Path Data=\"M 0 0.1917724489961 C 0.3049075945899 0.4102837902731 0.8860853196085 1.069486207115 0.9591877509813 0.9940153413375 C 1 0.9518808225544 1 0.9207999102795 1 0.1917724492867 C 1 -0.2397155614388 0.6791642855389 0.1917724489961 0 0.1917724489961\" StretchMode=\"Fill\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Offset=\"7.174032E-14%, 0%\" Margin=\"0\">\n\t\t\t\t\t<!-- Path -->\n\t\t\t\t\t<LinearGradient StartPoint=\"0.3240517, 1.155005\" EndPoint=\"0.1891075, -0.4699041\">\n\t\t\t\t\t\t<GradientStop Color=\"0.09019608, 0.4, 0.4980392, 1\" Offset=\"0\" />\n\t\t\t\t\t\t<GradientStop Color=\"0.03137255, 0.2862745, 0.3647059, 1\" Offset=\"1\" />\n\t\t\t\t\t</LinearGradient>\n\t\t\t\t</Path>\n\t\t\t</Panel>\n\t\t</Panel>\n\t\t<Panel Width=\"99.47644%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t<!-- bg -->\n\t\t\t<Rectangle CornerRadius=\"100\" Width=\"100%\" Height=\"100%\" Alignment=\"TopLeft\" Margin=\"0\">\n\t\t\t\t<!-- Path -->\n\t\t\t\t<LinearGradient StartPoint=\"0.5, 0\" EndPoint=\"0.5, 0.4295463\">\n\t\t\t\t\t<GradientStop Color=\"0.02745098, 0.1411765, 0.3215686, 1\" Offset=\"0\" />\n\t\t\t\t\t<GradientStop Color=\"0.2352941, 0.7137255, 0.7490196, 1\" Offset=\"1\" />\n\t\t\t\t</LinearGradient>\n\t\t\t</Rectangle>\n\t\t</Panel>\n\t</Panel>\n</Panel>"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/desert-moon-zwj-sketch43.reference/stderr",
    "content": "\n"
  },
  {
    "path": "src/sketch2fuse/files/Sketch43/desert-moon-zwj-sketch43.reference/stdout",
    "content": "INFO: You are running Sketch2Fuse compatible with Sketch format version 93\nINFO: Converting <path removed>desert-moon-zwj-sketch43.sketch created with Sketch 48.2 variant NONAPPSTORE build97\nERROR: Failed to parse layer 'bg', skipping it. The exception was :'Noise fill is not supported'\nERROR: Failed to parse layer 'Sand Dune Detail', skipping it. The exception was :'Noise fill is not supported'\nERROR: Failed to parse layer 'Sand Dune', skipping it. The exception was :'Noise fill is not supported'\nERROR: Failed to parse layer '1', skipping it. The exception was :'Only linear gradients are supported'\nERROR: Failed to parse layer '2', skipping it. The exception was :'Only linear gradients are supported'\nERROR: Failed to parse layer '3', skipping it. The exception was :'Only linear gradients are supported'\nWARNING: Skipping Gaussian blur on Shadow Mask Top. Not supported in UX\nWARNING: Skipping Gaussian blur on Shadow Mask Top. Not supported in UX\nWARNING: Skipping Gaussian blur on Shadow Mask Bottom. Not supported in UX\nWARNING: UX Builder: Inner shadows not supported. 4 has 1 shadow.\nINFO: Wrote 'Sketch.Desert_Moon' to '<path removed>Sketch.Desert_Moon.ux'\n\n"
  },
  {
    "path": "src/sketch2fuse/files/sketch43-file-unpacking.py",
    "content": "#!/usr/bin/python\nimport json\nimport zipfile\nimport os\nimport shutil\nfrom glob import glob\n\n## TODO Handle command line arguments\n\ndef extractincurrentdir(file):\n    zip_ref = zipfile.ZipFile(file) # create zipfile object\n    zip_ref.extractall() # extract file to current dir\n    zip_ref.close() # close file    \n\n# make these input parameters?\ntest_file_directory = \"Sketch43\"\noutput_dir = \"output\"\nupdate = False # Bad boy, bad boy, what U gonna do? What U gonna do when they come for U\n\nif not update:\n    os.mkdir(output_dir)\n\ncurr_dir = os.getcwd()\n\nfiles = os.listdir(test_file_directory)\n\nfor file in files:\n    basename = os.path.basename(file)\n    name, ext = os.path.splitext(basename)\n    if ext != '.sketch': continue # skipping .DS_Store in MacOS\n    sketch_file_dir = os.path.join(output_dir, name)\n    if update and os.path.isdir(sketch_file_dir):\n        continue # if the output dirctory already exists and we just want to update, skip this\n\n    print file\n    \n    os.mkdir(sketch_file_dir)\n    shutil.copy(os.path.join(test_file_directory, file), sketch_file_dir)\n\n    os.chdir(sketch_file_dir)\n    \n    # unzip sketch\n    extractincurrentdir(file)\n    \n    # make json files pretty\n    # find all json files\n    json_files =  [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.json'))]\n\n    for json_file in json_files:\n        with open(json_file, 'r+') as file_handle:\n            json_str = json.dumps(json.load(file_handle), sort_keys=True, indent=4)\n            file_handle.seek(0)     # reset file to start position\n            file_handle.write(json_str) # write formatted json\n            file_handle.truncate()  # get rid of potential garbage at end of file\n                \n    os.chdir(curr_dir)\n"
  },
  {
    "path": "src/sketch2fuse/regression-tests.sh",
    "content": "#!/bin/bash\nset -e\n\nMONO=mono\nif [ \"$OSTYPE\" == \"msys\" ]; then\n    MONO=\"\"\nfi\n\n$MONO RegressionTests/bin/Debug/RegressionTests.exe $*\n"
  },
  {
    "path": "src/sketch2fuse/test.sh",
    "content": "#!/bin/bash\nset -e\n\nMONO=mono\nif [ \"$OSTYPE\" == \"msys\" ]; then\n    MONO=\"\"\nfi\n\n$MONO ./packages/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe --skipnontestassemblies $(find . -name '*Tests.dll' | grep '/bin/')\n\n./regression-tests.sh\n"
  },
  {
    "path": "src/unohost/common/Graphics/FramebufferHandle.cs",
    "content": "using System.IO;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class FramebufferHandle\n\t{\n\t\treadonly int _handle;\n\t\tpublic FramebufferHandle(int handle)\n\t\t{\n\t\t\t_handle = handle;\n\t\t}\n\n\t\tpublic static implicit operator int(FramebufferHandle handle)\n\t\t{\n\t\t\treturn handle._handle;\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter w, FramebufferHandle h)\n\t\t{\n\t\t\tw.Write(h._handle);\n\t\t}\n\n\t\tpublic static FramebufferHandle Read(BinaryReader r)\n\t\t{\n\t\t\treturn new FramebufferHandle(r.ReadInt32());\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{Framebuffer \" + _handle + \"}\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Graphics/FramebufferInfo.cs",
    "content": "using System.IO;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class FramebufferInfo\n\t{\n\t\tpublic FramebufferHandle Handle { get; private set; }\n\n\t\tpublic Optional<RenderbufferHandle> Depthbuffer { get; private set; }\n\t\tpublic Optional<RenderbufferHandle> Stencilbuffer { get; private set; }\n\t\tpublic Optional<TextureHandle> Colorbuffer { get; private set; }\n\n\t\tpublic bool IsRealBackbuffer\n\t\t{\n\t\t\tget { return Handle == new FramebufferHandle(0); }\n\t\t}\n\n\t\tpublic bool HasCombinedDepthStencil\n\t\t{\n\t\t\tget { return Depthbuffer == Stencilbuffer; }\n\t\t}\n\n\t\tpublic FramebufferInfo(\n\t\t\tFramebufferHandle handle,\n\t\t\tOptional<RenderbufferHandle> depthbuffer,\n\t\t\tOptional<RenderbufferHandle> stencilbuffer,\n\t\t\tOptional<TextureHandle> colorbuffer)\n\t\t{\n\t\t\tColorbuffer = colorbuffer;\n\t\t\tDepthbuffer = depthbuffer;\n\t\t\tStencilbuffer = stencilbuffer;\n\t\t\tHandle = handle;\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{Handle = \" + Handle + \", Colorbuffer = \" + Colorbuffer + \", Depthbuffer = \" + Depthbuffer + \"}\";\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter writer, FramebufferInfo info)\n\t\t{\n\t\t\tFramebufferHandle.Write(writer, info.Handle);\n\t\t\tOptional.Write(writer, info.Depthbuffer, buf => RenderbufferHandle.Write(writer, buf));\n\t\t\tOptional.Write(writer, info.Stencilbuffer, buf => RenderbufferHandle.Write(writer, buf));\n\t\t\tOptional.Write(writer, info.Colorbuffer, buf => TextureHandle.Write(writer, buf));\n\t\t}\n\n\t\tpublic static FramebufferInfo Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new FramebufferInfo(\n\t\t\t\tFramebufferHandle.Read(reader),\n\t\t\t\tOptional.Read(reader, () => RenderbufferHandle.Read(reader)),\n\t\t\t\tOptional.Read(reader, () => RenderbufferHandle.Read(reader)),\n\t\t\t\tOptional.Read(reader, () => TextureHandle.Read(reader)));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Graphics/RenderbufferHandle.cs",
    "content": "﻿using System.IO;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class RenderbufferHandle\n\t{\n\t\treadonly int _handle;\n\t\tpublic RenderbufferHandle(int handle)\n\t\t{\n\t\t\t_handle = handle;\n\t\t}\n\n\t\tpublic static implicit operator int(RenderbufferHandle handle)\n\t\t{\n\t\t\treturn handle._handle;\n\t\t}\n\n\t\tpublic bool IsValid()\n\t\t{\n\t\t\treturn _handle > 0;\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter w, RenderbufferHandle h)\n\t\t{\n\t\t\tw.Write(h._handle);\n\t\t}\n\n\t\tpublic static RenderbufferHandle Read(BinaryReader r)\n\t\t{\n\t\t\treturn new RenderbufferHandle(r.ReadInt32());\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{Renderbuffer \" + _handle + \"}\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Graphics/TextureHandle.cs",
    "content": "using System.IO;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class TextureHandle\n\t{\n\t\treadonly int _handle;\n\t\tpublic TextureHandle(int handle)\n\t\t{\n\t\t\t_handle = handle;\n\t\t}\n\n\t\tpublic static implicit operator int(TextureHandle handle)\n\t\t{\n\t\t\treturn handle._handle;\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter w, TextureHandle h)\n\t\t{\n\t\t\tw.Write(h._handle);\n\t\t}\n\n\t\tpublic static TextureHandle Read(BinaryReader r)\n\t\t{\n\t\t\treturn new TextureHandle(r.ReadInt32());\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn \"{Texture \" + _handle + \"}\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Input/Cursor.cs",
    "content": "namespace Outracks.UnoHost\n{\n\tpublic enum Cursor\n\t{\n\t\tNone,\n\t\tDefault,\n\n\t\tPointer,\n\n\t\tText,\n\n\t\tGrab,\n\t\tGrabbing,\n\n\t\tSizeH,\n\t\tSizeV,\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Input/InputState.cs",
    "content": "using System.IO;\n\nnamespace Outracks.UnoHost\n{\n\tpublic struct InputState\n\t{\n\t\tpublic readonly ModifierKeys Modifiers;\n\t\tpublic readonly MouseButtons PressedButons;\n\n\t\tpublic InputState(ModifierKeys modifiers, MouseButtons pressedButons)\n\t\t{\n\t\t\tModifiers = modifiers;\n\t\t\tPressedButons = pressedButons;\n\t\t}\n\n\t\tpublic static void Write(BinaryWriter w, InputState s)\n\t\t{\n\t\t\tw.Write((int)s.Modifiers);\n\t\t\tw.Write((int)s.PressedButons);\n\t\t}\n\n\t\tpublic static InputState Read(BinaryReader r)\n\t\t{\n\t\t\treturn new InputState(\n\t\t\t\t(ModifierKeys)r.ReadInt32(),\n\t\t\t\t(MouseButtons)r.ReadInt32());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Input/ModifierKeys.cs",
    "content": "using System;\n\nnamespace Outracks.UnoHost\n{\n\t[Flags]\n\tpublic enum ModifierKeys\n\t{\n\t\tNone = 0,\n\t\tAlt = 1 << 0,\n\t\tControl = 1 << 1,\n\t\tShift = 1 << 2,\n\t\tWindows = 1 << 3,\n\t\tCommand = 1 << 3,\n\t\tMeta = 1 << 4,\n\t}\n}\n"
  },
  {
    "path": "src/unohost/common/Input/MouseButton.cs",
    "content": "namespace Outracks.UnoHost\n{\n\tpublic enum MouseButton\n\t{\n\t\tLeft = 1,\n\t\tMiddle = 2,\n\t\tRight = 3,\n\t\tX1 = 4,\n\t\tX2 = 5,\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Input/MouseButtons.cs",
    "content": "using System;\n\nnamespace Outracks.UnoHost\n{\n\t[Flags]\n\tpublic enum MouseButtons\n\t{\n\t\tNone = 0,\n\t\tLeft = 1 << 0,\n\t\tMiddle = 1 << 1,\n\t\tRight = 1 << 2,\n\t\tX1 = 1 << 3,\n\t\tX2 = 1 << 4,\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Outracks.UnoHost.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{F2AEB321-51E5-40B8-9CF0-53C930E631F0}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.UnoHost</RootNamespace>\n    <AssemblyName>Outracks.UnoHost</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <UseVSHostingProcess>true</UseVSHostingProcess>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Collections.Immutable\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"UnoCore\">\n      <HintPath>..\\..\\simulator\\common\\bin\\UnoCore.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Plugins\\FusionImplementation.cs\" />\n    <Compile Include=\"Plugins\\Plugin.cs\" />\n    <Compile Include=\"Protocol\\OpenGLVersionMessage.cs\" />\n    <Compile Include=\"Protocol\\WindowFocusMessage.cs\" />\n    <Compile Include=\"Graphics\\FramebufferHandle.cs\" />\n    <Compile Include=\"Graphics\\FramebufferInfo.cs\" />\n    <Compile Include=\"Graphics\\RenderbufferHandle.cs\" />\n    <Compile Include=\"Graphics\\TextureHandle.cs\" />\n    <Compile Include=\"Input\\Cursor.cs\" />\n    <Compile Include=\"Input\\InputState.cs\" />\n    <Compile Include=\"Input\\MouseButton.cs\" />\n    <Compile Include=\"Input\\MouseButtons.cs\" />\n    <Compile Include=\"Input\\ModifierKeys.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Platform\\UnoGraphicsContext.cs\" />\n    <Compile Include=\"Platform\\UnoWindow.cs\" />\n    <Compile Include=\"UnoHostControl.cs\" />\n    <Compile Include=\"UnoHostProject.cs\" />\n    <Compile Include=\"UnoHostProcess.cs\" />\n    <Compile Include=\"UnoHostArgs.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\preview\\service\\fuse-preview.csproj\">\n      <Project>{59e1073a-9b45-41f3-ab94-958a9d18fb72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335BB78-0B8A-4D2F-919F-2E6F08883D51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{E8884270-5F2C-4076-86D0-456B831BE3E5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/unohost/common/Outracks.UnoHost.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Graphics/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Input/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Plugins/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=UnoHandles/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/unohost/common/Platform/UnoGraphicsContext.cs",
    "content": "using OpenGL;\nusing Uno;\nusing Uno.Platform;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class UnoGraphicsContext : GraphicsContextBackend\n\t{\n\t\treadonly UnoWindow _unoWindow;\n\t\tGLFramebufferHandle _handle;\n\n\t\tpublic UnoGraphicsContext(UnoWindow window)\n\t\t{\n\t\t\t_unoWindow = window;\n\t\t}\n\n        public void ChangeBackbuffer(GLFramebufferHandle handle)\n        {\n            _handle = handle;\n\t        var app = Application.Current;\n\t\t\tif (app != null && app.GraphicsController != null)\n\t\t\t\tapp.GraphicsController.UpdateBackbuffer();\n        }\n\n\t\tpublic override GLFramebufferHandle GetBackbufferGLHandle()\n\t\t{\n\t\t\treturn _handle;\n\t\t}\n\n\t\tpublic override Int2 GetBackbufferSize()\n\t\t{\n\t\t\treturn _unoWindow.GetClientSize();\n\t\t}\n\n\t\tpublic override Int2 GetBackbufferOffset()\n\t\t{\n\t\t\treturn new Int2(0,0);\n\t\t}\n\n\t\tpublic override Recti GetBackbufferScissor()\n\t\t{\n\t\t\treturn new Recti(new Int2(0,0), _unoWindow.GetClientSize());\n\t\t}\n\n\t\tpublic override int GetRealBackbufferHeight()\n\t\t{\n\t\t\treturn _unoWindow.GetClientSize().Y;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/common/Platform/UnoWindow.cs",
    "content": "using Uno;\nusing Uno.Platform;\nusing Uno.Platform.Internal;\nusing Math = System.Math;\n\nnamespace Outracks.UnoHost\n{\n\tpublic interface IUnoCallbacks\n\t{\n\t\tvoid SetCursor(Cursor toCursor);\n\t}\n\n\tpublic class UnoWindow : WindowBackend\n\t{\n\t\treadonly IUnoCallbacks _callbacks;\n\n\t\tpublic UnoWindow(IUnoCallbacks callbacks)\n\t\t{\n\t\t\t_callbacks = callbacks;\n\t\t\tSize = new Size<Pixels>();\n\t\t\tDensity = new Ratio<Pixels, Points>();\n\t\t}\n\n\t\t#region Size and density (read-only)\n\t\tpublic Size<Pixels> Size { get; private set; }\n\n\t\tpublic Ratio<Pixels, Points> Density { get; private set; }\n\n\t\tpublic void ChangeSize(Size<Pixels> size, Ratio<Pixels, Points> density)\n\t\t{\n\t\t\tSize = size;\n\t\t\tDensity = density;\n\t\t\tBootstrapper.OnWindowSizeChanged(this);\n\t\t}\n\n\t\tpublic override void SetClientSize(Int2 size)\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\n\t\tpublic override Int2 GetClientSize()\n\t\t{\n\t\t\treturn new Int2(Math.Max(1, (int)Size.Width), Math.Max(1, (int)Size.Height));\n\t\t}\n\n\t\tpublic override float GetDensity()\n\t\t{\n\t\t\treturn (float)Density.Value;\n\t\t}\n\t\t#endregion\n\n\t\t#region Text Input (mutable)\n\t\tint _enableText = 0;\n\t\tpublic override void BeginTextInput(TextInputHint hint)\n\t\t{\n\t\t\t_enableText++;\n\t\t}\n\n\t\tpublic override void EndTextInput()\n\t\t{\n\t\t\t_enableText = Math.Max(0, _enableText - 1);\n\t\t}\n\n\t\tpublic override bool IsTextInputActive()\n\t\t{\n\t\t\treturn _enableText > 0;\n\t\t}\n\t\t#endregion\n\n\t\t#region Cursor (mutable, one-way)\n\t\tPointerCursor _cursor;\n\n\t\tpublic override PointerCursor GetPointerCursor()\n\t\t{\n\t\t\treturn _cursor;\n\t\t}\n\n\t\tpublic override void SetPointerCursor(PointerCursor p)\n\t\t{\n\t\t\t_cursor = p;\n\t\t\t_callbacks.SetCursor(ToCursor(p));\n\t\t}\n\n\t\tpublic static Cursor ToCursor(PointerCursor cursor)\n\t\t{\n\t\t\tswitch (cursor)\n\t\t\t{\n\t\t\t\tcase PointerCursor.None: return Cursor.None;\n\t\t\t\tcase PointerCursor.Pointer: return Cursor.Pointer;\n\t\t\t\tcase PointerCursor.IBeam: return Cursor.Text;\n\t\t\t\tdefault:\n\t\t\t\t// TODO: report warning?\n\t\t\t\tcase PointerCursor.Default:\n\t\t\t\t\treturn Cursor.Default;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Title (constant)\n\t\tpublic override string GetTitle()\n\t\t{\n\t\t\treturn \"NDEv6\";\n\t\t}\n\n\t\tpublic override void SetTitle(string title)\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\t\t#endregion\n\n\t\t#region Fullscreen (constant)\n\t\tpublic override bool GetFullscreen()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void SetFullscreen(bool fullscreen)\n\t\t{\n\t\t\t// do nothing\n\t\t}\n\t\t#endregion\n\n\t\t#region OnscreenKeyboard (constant)\n\t\tpublic override bool HasOnscreenKeyboardSupport()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override bool IsOnscreenKeyboardVisible()\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\n\t\t#region Input state (TODO)\n\t\tInputState _globalInputStateHack;\n\n\t\tpublic void SetGlobalInputState(InputState state)\n\t\t{\n\t\t\t_globalInputStateHack = state;\n\t\t}\n\n\t\tpublic override bool GetKeyState(Key key)\n\t\t{\n\t\t\tvar modifierKey = ToModifierKey((Key)key);\n\t\t\treturn modifierKey != ModifierKeys.None && _globalInputStateHack.Modifiers.HasFlag(modifierKey);\n\t\t}\n\n\t\tpublic static ModifierKeys ToModifierKey(Key keys)\n\t\t{\n\t\t\tswitch (keys)\n\t\t\t{\n\t\t\t\tcase Key.ShiftKey:\n\t\t\t\t\treturn ModifierKeys.Shift;\n\t\t\t\tcase Key.AltKey:\n\t\t\t\t\treturn ModifierKeys.Alt;\n\t\t\t\tcase Key.ControlKey:\n\t\t\t\t\treturn ModifierKeys.Control;\n\t\t\t\tcase Key.MetaKey:\n\t\t\t\t\treturn ModifierKeys.Meta;\n\t\t\t\tcase Key.OSKey:\n\t\t\t\t\treturn ModifierKeys.Windows | ModifierKeys.Command;\n\t\t\t\tdefault:\n\t\t\t\t\treturn ModifierKeys.None;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool GetMouseButtonState(Uno.Platform.MouseButton button)\n\t\t{\n\t\t\t// TODO: Implement this.\n\t\t\treturn false;\n\t\t}\n\t\t#endregion\n\n\t\tpublic override void Close()\n\t\t{\n\t\t\t// do nothing ?\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/common/Plugins/FusionImplementation.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Uno;\nusing Application = Outracks.Fusion.Application;\n\nnamespace Outracks.UnoHost\n{\n\tpublic static class FusionImplementation\n\t{\n\t\tstatic dynamic _reflection;\n\n\t\tpublic static void Initialize(IScheduler mainThreadDispatcher, AbsoluteFilePath userData, dynamic reflection)\n\t\t{\n\t\t\tUserSettings.Settings = PersistentSettings.Load(usersettingsfile: userData);\n\n\t\t\tAxis2DExtensions.ShouldFlip = false;\n\t\t\tApplication.MainThread = mainThreadDispatcher;\n\t\t\t_reflection = reflection;\n\n\n\t\t\tPointer.Implementation.MakeHittable = (control, space, callbacks) =>\n\t\t\t{\n\t\t\t\tvar o = control.NativeHandle;\n\n\t\t\t\treflection.CallStatic(\"Outracks.UnoHost.FusionInterop\", \"OnPointerPressed\", o, new Action<Float2>(pos =>\n\t\t\t\t\tcallbacks.OnPressed(new Pointer.OnPressedArgs(new Point<Points>(pos.X, pos.Y), 1))));\n\n\t\t\t\treflection.CallStatic(\"Outracks.UnoHost.FusionInterop\", \"OnPointerMoved\", o, new Action<Float2>(pos =>\n\t\t\t\t\tcallbacks.OnMoved(new Point<Points>(pos.X, pos.Y))));\n\n\t\t\t\treturn control;\n\t\t\t};\n\n\t\t\tLayout.Implementation.LayerControls = (childFactory) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar control = reflection.Instantiate(\"Fuse.Controls.Panel\");\n\n\t\t\t\t\tBindNativeDefaults(self, control);\n\n\t\t\t\t\tvar element = control as dynamic;\n\n\t\t\t\t\tself.BindList(\n\t\t\t\t\t\tlist: childFactory(self).Select(Enumerable.Reverse),\n\t\t\t\t\t\tadd: child =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchild.Mount(\n\t\t\t\t\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tIsRooted = self.IsRooted,\n\t\t\t\t\t\t\t\t\tAvailableSize = self.AvailableSize,\n\t\t\t\t\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(self.NativeFrame.Size),\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tvar nativeChild = child.NativeHandle as dynamic;\n\t\t\t\t\t\t\tif (nativeChild != null)\n\t\t\t\t\t\t\t\telement.Children.Add(nativeChild);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tremove: child =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar nativeChild = child.NativeHandle as dynamic;\n\t\t\t\t\t\t\tif (nativeChild != null)\n\t\t\t\t\t\t\t\telement.Children.Remove(nativeChild);\n\n\t\t\t\t\t\t\tchild.Mount(MountLocation.Unmounted);\n\t\t\t\t\t\t});\n\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\n\t\t\tShapes.Implementation.RectangleFactory = (stroke, brush, cornerRadius) =>\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar control = _reflection.Instantiate(\"Fuse.Controls.Rectangle\");\n\n\t\t\t\t\tBindNativeDefaults(self, control);\n\t\t\t\t\tBindShapeProperties(self, control, brush, stroke);\n\n\t\t\t\t\treturn control;\n\t\t\t\t});\n\t\t}\n\n\t\tpublic static void BindShapeProperties(this IMountLocation self, object obj, Brush fill, Stroke stroke)\n\t\t{\n\t\t\tvar control = obj as dynamic;\n\n\t\t\tcontrol.Stroke = _reflection.Instantiate(\"Fuse.Drawing.Stroke\") as dynamic;\n\t\t\tself.BindNativeProperty(fill, f => control.Color = new Float4(f.R, f.G, f.B, f.A));\n\t\t\tself.BindNativeProperty(stroke.Brush.CombineLatest(stroke.DashArray),\n\t\t\t\tt =>\n\t\t\t\t{\n\t\t\t\t\tvar s = t.Item1;\n\t\t\t\t\tvar dashArray = t.Item2;\n\t\t\t\t\t//Reflection.CallStatic(\"Fuse.Diagnostics\",\"UserWarning\", \"Setting stroke of \" + obj.GetHashCode() + \" to \" + s, obj, null, 0, null);\n\t\t\t\t\tif (dashArray == StrokeDashArray.Solid)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontrol.Stroke.Color = new Float4(s.R, s.G, s.B, s.A);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!_reflection.IsSubtype(control.Stroke.Brush, \"DashedSolidColor\"))\n\t\t\t\t\t\t\tcontrol.Stroke.Brush = _reflection.Instantiate(\"DashedSolidColor\", new Float4(s.R, s.G, s.B, s.A)) as dynamic;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcontrol.Stroke.Brush.Color = new Float4(s.R, s.G, s.B, s.A);\n\n\t\t\t\t\t\tcontrol.Stroke.Brush.DashSize = (float)dashArray.Data[0];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tself.BindNativeProperty(stroke.Thickness, s => control.Stroke.Width = (float)s);\n\t\t}\n\n\t\tpublic static void BindNativeDefaults(this IMountLocation self, object obj)\n\t\t{\n\t\t\tvar element = obj as dynamic;\n\n\t\t\tvar frame = self.NativeFrame;\n\n\t\t\tself.BindNativeProperty(frame.Left(), left =>\n\t\t\t\telement.X = _reflection.CallStatic(\"Uno.UX.Size\", \"Points\", (float)left) as dynamic);\n\t\t\tself.BindNativeProperty(frame.Top(), top =>\n\t\t\t\telement.Y = _reflection.CallStatic(\"Uno.UX.Size\", \"Points\", (float)top) as dynamic);\n\t\t\tself.BindNativeProperty(frame.Height, height =>\n\t\t\t\telement.Height = _reflection.CallStatic(\"Uno.UX.Size\", \"Points\", (float)height) as dynamic);\n\t\t\tself.BindNativeProperty(frame.Width, width =>\n\t\t\t\telement.Width = _reflection.CallStatic(\"Uno.UX.Size\", \"Points\", (float)width) as dynamic);\n\t\t}\n\n\t\tpublic static void BindNativeProperty<TValue>(\n\t\t\tthis IMountLocation control,\n\t\t\tIObservable<TValue> value,\n\t\t\tAction<TValue> update)\n\t\t{\n\t\t\tvalue\n\t\t\t\t.ConnectWhile(control.IsRooted)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Subscribe(update);\n\t\t}\n\n\t\tpublic static void BindList<T>(\n\t\t\tthis IMountLocation self,\n\t\t\tIObservable<IEnumerable<T>> list,\n\t\t\tAction<T> add,\n\t\t\tAction<T> remove)\n\t\t{\n\t\t\tlist\n\t\t\t\t// IMPORTANT: ConnectWhile has to be done first since else we'll lose all changes done to the children list while the ctrl is unrooted.\n\t\t\t\t// which breaks diffing, and we get dangling views (views that aren't removed).\n\t\t\t\t.ConnectWhile(self.IsRooted)\n\t\t\t\t.DiffSequence()\n\t\t\t\t.Subscribe(children =>\n\t\t\t\t{\n\t\t\t\t\tforeach (var child in children.Removed)\n\t\t\t\t\t{\n\t\t\t\t\t\tremove(child);\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach (var child in children.Added)\n\t\t\t\t\t{\n\t\t\t\t\t\tadd(child);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "src/unohost/common/Plugins/Plugin.cs",
    "content": "﻿using System;\nusing System.Collections.Immutable;\nusing System.IO;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Reflection;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Application = Uno.Application;\n\nnamespace Outracks.UnoHost\n{\n\tpublic sealed class LoadPlugin : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"UnoHost.LoadPlugin\";\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic static LoadPlugin FromType<T>()\n\t\t{\n\t\t\tvar type = typeof (T);\n\t\t\treturn new LoadPlugin\n\t\t\t{\n\t\t\t\t_assemblyName = type.Assembly.GetCodeBaseFilePath().NativePath,\n\t\t\t\t_typeName = type.FullName,\n\t\t\t};\n\t\t}\n\n\t\tpublic Type LoadType()\n\t\t{\n\t\t\treturn Assembly.LoadFrom(_assemblyName).GetType(_typeName);\n\t\t}\n\n\t\tstring _assemblyName;\n\t\tstring _typeName;\n\n\t\tpublic override bool Equals(object obj)\n\t\t{\n\t\t\tvar that = obj as LoadPlugin;\n\t\t\treturn that != null\n\t\t\t\t&& that._assemblyName == _assemblyName\n\t\t\t\t&& that._typeName == _typeName;\n\t\t}\n\n\t\tpublic override int GetHashCode()\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(_assemblyName);\n\t\t\twriter.Write(_typeName);\n\t\t}\n\n\t\tpublic static LoadPlugin ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new LoadPlugin\n\t\t\t{\n\t\t\t\t_assemblyName = reader.ReadString(),\n\t\t\t\t_typeName = reader.ReadString(),\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic interface IPluginFactory\n\t{\n\t\tPlugin Create(PluginContext context);\n\t}\n\n\tpublic class PluginContext\n\t{\n\t\tpublic IObservable<IBinaryMessage> Input { get; set; }\n\t\tpublic IObservable<double> PerFrame { get; set; }\n\t\tpublic IScheduler Dispatcher { get; set; }\n\n\t\tpublic dynamic Reflection\n\t\t{\n\t\t\tget { return (Application.Current as dynamic).Reflection; }\n\t\t}\n\t}\n\n\tpublic class Plugin\n\t{\n\t\tpublic IObservable<IBinaryMessage> Output { get; set; }\n\t\tpublic IControl Overlay { get; set; }\n\t}\n\n\tpublic static class PluginLoader\n\t{\n\t\tpublic static IObservable<IBinaryMessage> LoadPlugin<T>(this IUnoHostControl control, IObservable<IBinaryMessage> input)\n\t\t{\n\t\t\treturn Observable\n\t\t\t\t.Create<IBinaryMessage>(async observer =>\n\t\t\t\t{\n\t\t\t\t\tvar outputSub = control.Messages.Subscribe(observer.OnNext);\n\n\t\t\t\t\tvar ping = UnoHost.LoadPlugin.FromType<T>();\n\t\t\t\t\tvar gotPong = control.Messages.TryParse(UnoHost.LoadPlugin.MessageType, UnoHost.LoadPlugin.ReadDataFrom)\n\t\t\t\t\t\t.Where(pong => ping.Equals(pong))\n\t\t\t\t\t\t.FirstAsync().ToTask();\n\n\t\t\t\t\tcontrol.MessagesTo.OnNext(ping);\n\n\t\t\t\t\tawait gotPong;\n\n\t\t\t\t\tvar inputSub = input.Subscribe(control.MessagesTo.OnNext);\n\n\t\t\t\t\treturn Disposable.Combine(outputSub, inputSub);\n\t\t\t\t})\n\t\t\t\t.Publish().RefCount();\n\t\t}\n\t}\n\n\tpublic class PluginManager\n\t{\n\t\tpublic static object Initialize(\n\t\t\tIObservable<IBinaryMessage> messagesFrom,\n\t\t\tIObserver<IBinaryMessage> messagesTo,\n\t\t\tIScheduler dispatcher,\n\t\t\tIObservable<double> perFrame,\n\t\t\tSize<IObservable<Points>> size)\n\t\t{\n\t\t\tvar pluginManager = new PluginManager(\n\t\t\t\tnew PluginContext\n\t\t\t\t{\n\t\t\t\t\tInput = messagesFrom,\n\t\t\t\t\tPerFrame = perFrame,\n\t\t\t\t\tDispatcher = dispatcher\n\t\t\t\t});\n\n\t\t\tpluginManager.Overlay.Mount(\n\t\t\t\tnew MountLocation.Mutable\n\t\t\t\t{\n\t\t\t\t\tAvailableSize = size,\n\t\t\t\t\tNativeFrame = ObservableMath.RectangleWithSize(size),\n\t\t\t\t\tIsRooted = Observable.Return(true),\n\t\t\t\t});\n\n\t\t\tpluginManager.Output.Subscribe(messagesTo);\n\n\t\t\treturn pluginManager.Overlay.NativeHandle;\n\t\t}\n\n\t\tpublic PluginManager(PluginContext context)\n\t\t{\n\t\t\tvar plugins = context.Input\n\t\t\t\t.TryParse(LoadPlugin.MessageType, LoadPlugin.ReadDataFrom)\n\t\t\t\t.Select(loadMessage =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(\"Loading plugin from \" + loadMessage);\n\t\t\t\t\t\tvar pluginFactory = (IPluginFactory)Activator.CreateInstance(loadMessage.LoadType());\n\t\t\t\t\t\tvar plugin = pluginFactory.Create(context);\n\t\t\t\t\t\tConsole.WriteLine(\"Success!\");\n\n\t\t\t\t\t\t// send message back so we can wait for it before we start pushing input\n\t\t\t\t\t\tplugin.Output = plugin.Output.StartWith(loadMessage);\n\n\t\t\t\t\t\treturn plugin;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(\"Failed: \" + e);\n\t\t\t\t\t\tthrow;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.Retry()\n\t\t\t\t.Scan(ImmutableList<Plugin>.Empty, (list, plugin) => list.Add(plugin))\n\t\t\t\t.Replay(1);\n\n\t\t\tplugins.Connect();\n\n\t\t\tOutput = plugins\n\t\t\t\t.SelectPerElement(p => p.Output)\n\t\t\t\t.Select(outputs => outputs.Merge())\n\t\t\t\t.Switch();\n\n\t\t\tOverlay = plugins\n\t\t\t\t.SelectPerElement(p => p.Overlay)\n\t\t\t\t.Layer();\n\t\t}\n\n\t\tpublic IObservable<IBinaryMessage> Output { get; set; }\n\t\tpublic IControl Overlay { get; set; }\n\t}\n}\n"
  },
  {
    "path": "src/unohost/common/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.Fuse.Native.UnoCoreInterop\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/unohost/common/Protocol/OpenGLVersionMessage.cs",
    "content": "﻿namespace Outracks.UnoHost\n{\n\tpublic class OpenGlVersionMessage\n\t{\n\t\tpublic const string Type = \"OpenGLVersionMessage\";\n\t\tpublic static IBinaryMessage Compose(OpenGlVersion openGlVersion)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer =>\n\t\t\t{\n\t\t\t\twriter.Write(openGlVersion.GlVersion);\n\t\t\t\twriter.Write(openGlVersion.GlVendor);\n\t\t\t\twriter.Write(openGlVersion.GlRenderer);\n\t\t\t});\n\t\t}\n\n\t\tpublic static Optional<OpenGlVersion> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, reader =>\n\t\t\t\tnew OpenGlVersion(reader.ReadString(), reader.ReadString(), reader.ReadString()));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/common/Protocol/WindowFocusMessage.cs",
    "content": "﻿namespace Outracks.UnoHost\n{\n\tpublic enum FocusState\n\t{\n\t\tFocused,\n\t\tBlurred\n\t}\n\n\tpublic class WindowFocusMessage\n\t{\n\t\tconst string Type = \"Windows.WindowFocus\";\n\t\tpublic static IBinaryMessage Compose(FocusState focusState)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer =>\n\t\t\t\twriter.Write((int)focusState));\n\t\t}\n\n\t\tpublic static Optional<FocusState> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, reader =>\n\t\t\t\t(FocusState)reader.ReadInt32());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/common/UnoHostArgs.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Outracks.IO;\nusing Outracks.IPC;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class UnoHostArgs\n\t{\n\t\tpublic static UnoHostArgs RemoveFrom(IList<string> args, IFileSystem fs)\n\t\t{\n\t\t\tvar argsAsString = args.Select(Uno.Extensions.QuoteSpace).Join(\" \");\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar unohostArgs = new UnoHostArgs()\n\t\t\t\t{\n\t\t\t\t\tAssemblyPath = args.TryRemoveAt(0)\n\t\t\t\t\t\t.SelectMany(fs.TryResolveAbsolutePath)\n\t\t\t\t\t\t.SelectMany(v => v is AbsoluteFilePath\n\t\t\t\t\t\t\t? Optional.Some((AbsoluteFilePath)v)\n\t\t\t\t\t\t\t: Optional.None())\n\t\t\t\t\t\t.OrThrow()\n\t\t\t\t};\n\t\t\t\tunohostArgs.IsDebug = args.TryGetAt(0).Select(arg => arg.Contains(\"--debug\")).Or(false);\n\t\t\t\tif (unohostArgs.IsDebug) // We don't have the pipes so lets return\n\t\t\t\t{\n\t\t\t\t\tunohostArgs.UserDataPath = FilePath.CreateTempFile();\n\t\t\t\t\treturn unohostArgs;\n\t\t\t\t}\n\n\t\t\t\tunohostArgs.InputPipe = args.TryRemoveAt(0).SelectMany(PipeName.TryParse).OrThrow();\n\t\t\t\tunohostArgs.OutputPipe = args.TryRemoveAt(0).SelectMany(PipeName.TryParse).OrThrow();\n\t\t\t\tunohostArgs.UserDataPath = args.TryRemoveAt(0).SelectMany(AbsoluteFilePath.TryParse).OrThrow();\n\n\t\t\t\treturn unohostArgs;\n\t\t\t}\n\t\t\tcatch (Exception)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Failed to parse UnoHost arguments '\" + argsAsString + \"'\");\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<string> Serialize()\n\t\t{\n\t\t\tyield return AssemblyPath.NativePath;\n\t\t\tyield return InputPipe.ToString();\n\t\t\tyield return OutputPipe.ToString();\n\t\t\tyield return UserDataPath.ToString();\n\t\t}\n\n\t\tpublic AbsoluteFilePath MetadataPath\n\t\t{\n\t\t\tget { return AssemblyPath.ContainingDirectory / new FileName(\"metadata.json\"); }\n\t\t}\n\n\t\tpublic AbsoluteFilePath AssemblyPath { get; set; }\n\n\t\tpublic PipeName InputPipe { get; set; }\n\t\tpublic PipeName OutputPipe { get; set; }\n\t\tpublic bool IsDebug { get; set; }\n\t\tpublic AbsoluteFilePath UserDataPath { get; set; }\n\t}\n}"
  },
  {
    "path": "src/unohost/common/UnoHostControl.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reactive.Subjects;\nusing System.Reflection;\nusing Outracks.Diagnostics;\nusing Outracks.IO;\n\nnamespace Outracks.Fusion\n{\n\tpublic static class UnoHostControl\n\t{\n\t\tstatic IUnoHostControlFactory _factory;\n\t\tpublic static IUnoHostControl Create(AbsoluteFilePath assemblyPath, Command onFocused, Menu contextMenu, AbsoluteFilePath userDataPath, IExternalApplication unohost, Action<IUnoHostControl> initialize, Action<OpenGlVersion> gotVersion, params string[] arguments)\n\t\t{\n\t\t\treturn GetImplementation().Create(assemblyPath, onFocused, contextMenu, userDataPath, unohost, initialize, gotVersion, arguments);\n\t\t}\n\n\t\tstatic IUnoHostControlFactory GetImplementation()\n\t\t{\n\t\t\tif (_factory != null)\n\t\t\t\treturn _factory;\n\n\t\t\tif (Platform.IsMac)\n\t\t\t\tAssembly.Load(\"UnoHost\");\n\t\t\tif (Platform.IsWindows)\n\t\t\t\tAssembly.Load(\"unohost\");\n\n\t\t\treturn _factory = ImplementationLocator.CreateInstance<IUnoHostControlFactory>();\n\t\t}\n\t}\n\n\n\tpublic interface IUnoHostControlFactory\n\t{\n\t\tIUnoHostControl Create(\n\t\t\tAbsoluteFilePath assemblyPath,\n\t\t\tCommand onFocused,\n\t\t\tMenu contextMenu,\n\t\t\tAbsoluteFilePath userDataPath,\n\t\t\tIExternalApplication unohost,\n\t\t\tAction<IUnoHostControl> initialize,\n\t\t\tAction<OpenGlVersion> gotVersion,\n\t\t\tparams string[] arguments);\n\t}\n\n\tpublic interface IUnoHostControl : IDisposable\n\t{\n\t\tIControl Control { get; }\n\t\tIConnectableObservable<IBinaryMessage> Messages { get; }\n\t\tIObserver<IBinaryMessage> MessagesTo { get; }\n\t\tIObservable<Process> Process { get; }\n\t}\n\n\t// Temporary duplicate of message declared in Simulator.Common (dependency from fusion to unohost needs to be reversed)\n\tpublic sealed class Ready : IBinaryMessage\n\t{\n\t\tpublic static readonly string MessageType = \"Ready\";\n\n\t\tpublic string Type { get { return MessageType; } }\n\n\t\tpublic void WriteDataTo(BinaryWriter writer)\n\t\t{\n\t\t}\n\n\t\tpublic static Ready ReadDataFrom(BinaryReader reader)\n\t\t{\n\t\t\treturn new Ready();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/common/UnoHostProcess.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.IO;\nusing Outracks.IPC;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class UnoHostProcess : IDisposable\n\t{\n\t\tpublic static UnoHostProcess Spawn(AbsoluteFilePath assembly, IObservable<IBinaryMessage> messagesToUnoHost, AbsoluteFilePath userDataPath, IExternalApplication application, IEnumerable<string> moreArgs)\n\t\t{\n\t\t\tvar args = new UnoHostArgs\n\t\t\t{\n\t\t\t\tAssemblyPath = assembly,\n\t\t\t\tOutputPipe = PipeName.New(),\n\t\t\t\tInputPipe = PipeName.New(),\n\t\t\t\tUserDataPath = userDataPath,\n\t\t\t};\n\n\t\t\tvar disp = args.InputPipe.BeginWritingMessages(\"UnoHost\", ex => Console.WriteLine(\"fuse X failed to write message to UnoHost: \" + ex), messagesToUnoHost);\n\n\t\t\treturn new UnoHostProcess\n\t\t\t{\n\t\t\t\tMessages = args.OutputPipe.ReadMessages(\"UnoHost\"),\n\t\t\t\tProcess = Observable.Start(() => application.Start(args.Serialize().Concat(moreArgs))),\n\t\t\t\tDisposables = Disposable.Combine(disp)\n\t\t\t};\n\t\t}\n\n\t\tpublic IConnectableObservable<IBinaryMessage> Messages;\n\t\tIDisposable Disposables { get; set; }\n\n\t\tpublic IObservable<Process> Process\n\t\t{\n\t\t\tget; private set;\n\t\t}\n\n\t\tpublic IObservable<T> Receieve<T>(Func<IBinaryMessage, Optional<T>> tryParse)\n\t\t{\n\t\t\treturn Messages.SelectSome(tryParse);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tProcess.Take(1).Do(p => p.CloseMainWindow()).Subscribe();\n\t\t\tDisposables.Dispose();\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "src/unohost/common/UnoHostProject.cs",
    "content": "using System;\nusing System.Reflection;\nusing Outracks.IO;\nusing Outracks.Simulator.Bytecode;\nusing Outracks.Simulator.Client;\n\nnamespace Outracks.UnoHost\n{\n\tpublic class UnoHostProject\n\t{\n\t\tpublic static UnoHostProject Load(AbsoluteFilePath metadataFile, IFileSystem fileSystem)\n\t\t{\n\t\t\tusing (var file = fileSystem.OpenRead(metadataFile))\n\t\t\t\treturn new UnoHostProject(metadataFile, DotNetBuild.ReadFrom(file));\n\t\t}\n\n\t\treadonly AbsoluteDirectoryPath _metadataDir;\n\t\treadonly DotNetBuild _build;\n\t\treadonly Lazy<Assembly> _assembly;\n\n\t\tpublic Assembly Assembly => _assembly.Value;\n\n\t\tpublic UnoHostProject (AbsoluteFilePath metadataPath, DotNetBuild build)\n\t\t{\n\t\t\t_build = build;\n\t\t\t_metadataDir = metadataPath.ContainingDirectory;\n\t\t\t_assembly = new Lazy<Assembly>(() => Assembly.LoadFrom((_metadataDir / build.Assembly).NativePath));\n\t\t}\n\n\t\tpublic void ExecuteStartupCode()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tLoadFrom(TypeName.Parse(_build.EntrypointClass), _assembly.Value)\n\t\t\t\t\t.GetConstructor(new Type[0])\n\t\t\t\t\t.Invoke(new object[0]);\n\t\t\t}\n\t\t\tcatch (TargetInvocationException tie)\n\t\t\t{\n\t\t\t\ttie.InnerException.RethrowWithStackTrace();\n\t\t\t\tthrow tie.InnerException;\n\t\t\t}\n\t\t}\n\n\t\tstatic Type LoadFrom(TypeName typeName, Assembly assembly)\n\t\t{\n\t\t\tif (typeName.IsParameterizedGenericType)\n\t\t\t\tthrow new Exception(\"Type is a parameterized generic type\");\n\n\t\t\tvar name = typeName.FullName;\n\t\t\tvar type = assembly.GetType(name);\n\t\t\tif (type == null)\n\t\t\t\tthrow new Exception(\"Could not load type \" + typeName.FullName);\n\t\t\treturn type;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "src/unohost/common/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n      <dependentAssembly>\n        <assemblyIdentity name=\"System.Reactive\" publicKeyToken=\"94bc3704cddfc263\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-4.4.0.0\" newVersion=\"4.4.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/unohost/common/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/unohost/mac/AppDelegate.cs",
    "content": "﻿using System;\nusing AppKit;\n\nnamespace Outracks.UnoHost.Mac\n{\n\tclass ShutdownException : Exception\n\t{\n\t}\n\n\tpublic partial class AppDelegate : NSApplicationDelegate\n\t{\n\t\tpublic static bool ThrowOnTerminate { get; set; }\n\n\t\tpublic override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override NSApplicationTerminateReply ApplicationShouldTerminate (NSApplication sender)\n\t\t{\n\t\t\tif (!ThrowOnTerminate)\n\t\t\t\treturn NSApplicationTerminateReply.Now;\n\n\t\t\tNSApplication.SharedApplication.BeginInvokeOnMainThread(() =>\n\t\t\t{\n\t\t\t\tthrow new ShutdownException();\n\t\t\t});\n\n\t\t\treturn NSApplicationTerminateReply.Later;\n\t\t}\n\t}\n\n\t/*\n\tpublic partial class AppDelegate : NSApplicationDelegate, IMainThread\n\t{\n\t\tvoid Initialize()\n        {\n        }\n\n        partial void HandleFileOpen(NSObject sender)\n        {\n            var dialog = new NSOpenPanel()\n            {\n                Title = \"Select your .unoproj\",\n                Prompt = \"Build & Run\",\n                AllowedFileTypes = new[] { \"unoproj\" },\n            };\n\n            dialog.Begin(result => {\n            });\n        }\n\n        partial void HandleFileClose(NSObject sender)\n        {\n            var keyWindow = NSApplication.SharedApplication.KeyWindow;\n\n            if (keyWindow != null)\n                keyWindow.Close();\n        }\n\n        partial void HandleViewRefresh(NSObject sender)\n        {\n        }\n\n        partial void HandleViewEnableFullscreen(NSObject sender)\n        {\n        }\n\n        partial void HandleWindowOutput(NSObject sender)\n        {\n        }\n\n        public override void FinishedLaunching(NSObject notification)\n        {\n            Initialize();\n        }\n\n        public override void WillTerminate(NSNotification notification)\n        {\n        }\n\n        public override bool OpenFile(NSApplication sender, string filename)\n        {\n            return true;\n        }\n\n        void IMainThread.EnsureMainThread()\n        {\n            NSApplication.EnsureUIThread();\n        }\n    }\n    */\n}\n"
  },
  {
    "path": "src/unohost/mac/AppDelegate.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\n\nusing Foundation;\n\nnamespace Outracks.UnoHost.Mac\n{\n\t[Register (\"AppDelegate\")]\n\tpartial class AppDelegate\n\t{\n\t\t/*[Action (\"HandleFileClose:\")]\n\t\tpartial void HandleFileClose (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleFileOpen:\")]\n\t\tpartial void HandleFileOpen (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleViewEnableFullscreen:\")]\n\t\tpartial void HandleViewEnableFullscreen (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleViewRefresh:\")]\n\t\tpartial void HandleViewRefresh (Foundation.NSObject sender);\n\n\t\t[Action (\"HandleWindowOutput:\")]\n\t\tpartial void HandleWindowOutput (Foundation.NSObject sender);*/\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"filename\": \"AppIcon-16.png\",\n      \"size\": \"16x16\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-16@2x.png\",\n      \"size\": \"16x16\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-32.png\",\n      \"size\": \"32x32\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-32@2x.png\",\n      \"size\": \"32x32\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-128.png\",\n      \"size\": \"128x128\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-128@2x.png\",\n      \"size\": \"128x128\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-256.png\",\n      \"size\": \"256x256\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-256@2x.png\",\n      \"size\": \"256x256\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-512.png\",\n      \"size\": \"512x512\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"filename\": \"AppIcon-512@2x.png\",\n      \"size\": \"512x512\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    }\n  ],\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"xcode\"\n  }\n}"
  },
  {
    "path": "src/unohost/mac/Assets.xcassets/Contents.json",
    "content": "﻿{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "src/unohost/mac/Dispatcher.cs",
    "content": "﻿using System.Threading;\nusing CoreFoundation;\n\nnamespace Outracks.UnoHost.Mac\n{\n\tpublic class Dispatcher : SingleThreadDispatcherBase\n\t{\n\t\tpublic Dispatcher(Thread thread) : base(thread) { }\n\n\t\tprotected override void Flush()\n\t\t{\n\t\t\tif (RunningOnDispatcherThread)\n\t\t\t\tDrain();\n\t\t\telse\n\t\t\t\tDispatchQueue.MainQueue.DispatchAsync(Drain);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/DisplayLinkView.cs",
    "content": "using System;\nusing System.Collections.Concurrent;\nusing System.Runtime.InteropServices;\nusing AppKit;\nusing CoreGraphics;\nusing CoreVideo;\nusing Foundation;\nusing OpenGL;\n\nnamespace Outracks.UnoHost.Mac\n{\n\tstatic class CGLErrorExtensions\n\t{\n\t\tpublic static void ThrowIfFailed(this CGLErrorCode errorCode, string methodName)\n\t\t{\n\t\t\tif (errorCode != CGLErrorCode.NoError)\n\t\t\t\tthrow new Exception(methodName + \" failed: \" + errorCode);\n\t\t}\n\t}\n\n\tabstract class DisplayLinkView : NSOpenGLView\n\t{\n\t\tstatic readonly ConcurrentDictionary<DisplayLinkView, DisplayLinkView> _views = new ConcurrentDictionary<DisplayLinkView, DisplayLinkView>();\n\t\tstatic CVDisplayLink _displayLink;\n\n\t\treadonly Action<Action> _invokeOnMainThread;\n\n\n\t\tpublic override bool IsOpaque\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tprotected DisplayLinkView(Action<Action> invokeOnMainThread, CGRect frame)\n\t\t\t: base(frame, CreatePixelFormat())\n\t\t{\n\t\t\t_invokeOnMainThread = invokeOnMainThread;\n\t\t}\n\n\t\tpublic static NSOpenGLPixelFormat CreatePixelFormat()\n\t\t{\n\t\t\tvar attribs = new object[] {\n\t\t\t\tNSOpenGLPixelFormatAttribute.Accelerated,\n\t\t\t\tNSOpenGLPixelFormatAttribute.DoubleBuffer,\n\t\t\t\tNSOpenGLPixelFormatAttribute.AllowOfflineRenderers,\n\t\t\t\tNSOpenGLPixelFormatAttribute.ColorSize, 24,\n\t\t\t\tNSOpenGLPixelFormatAttribute.DepthSize, 16};\n\n\t\t\tvar pixelFormat = new NSOpenGLPixelFormat(attribs);\n\t\t\treturn pixelFormat;\n\t\t}\n\n\t\tpublic override void Update()\n\t\t{\n\t\t\tOpenGLContext.Update();\n\t\t}\n\n\t\tpublic override void DrawRect(CGRect dirtyRect)\n\t\t{\n\t\t\tDraw();\n\t\t}\n\n\t\tpublic override void PrepareOpenGL()\n\t\t{\n\t\t\tbase.PrepareOpenGL();\n\n\t\t\tOpenGLContext.SwapInterval = true;\n\t\t\t_views.TryAdd(this, this);\n\n\t\t\tif (_displayLink != null)\n\t\t\t\treturn;\n\n\t\t\tSetupDisplayLink();\n\t\t}\n\n\t\tvoid SetupDisplayLink()\n\t\t{\n\t\t\t_displayLink = new CVDisplayLink();\n\n\t\t\t// Set the renderer output callback function\n\t\t\t_displayLink.SetOutputCallback(DisplayLinkOutputCallback);\n\n\t\t\t// Set the display link for the current renderer\n\t\t\tvar cglContext = OpenGLContext.CGLContext;\n\t\t\tvar cglPixelFormat = PixelFormat.CGLPixelFormat;\n\t\t\t_displayLink.SetCurrentDisplay(cglContext, cglPixelFormat);\n\t\t\t_displayLink.Start();\n\t\t}\n\n\t\tvoid Draw()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_invokeOnMainThread(OnDraw);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tConsole.Error.WriteLine(\"Draw: \" + e);\n\t\t\t}\n\t\t}\n\n\t\tprotected abstract void OnDraw();\n\n\t\tbool _disposed = false;\n\t\tprotected override void Dispose (bool disposing)\n\t\t{\n\t\t\tif (_disposed)\n\t\t\t\treturn;\n\n\t\t\tif (disposing)\n\t\t\t{\n\t\t\t\tDisplayLinkView tmp;\n\t\t\t\t_views.TryRemove(this, out tmp);\n\n\t\t\t\tif(_views.IsEmpty)\n\t\t\t\t\tDeAllocate ();\n\t\t\t}\n\t\t\tbase.Dispose (disposing);\n\n\t\t\t_disposed = true;\n\t\t}\n\n\t\tvoid DeAllocate()\n\t\t{\n\t\t\tif (_displayLink == null)\n\t\t\t\treturn;\n\n\t\t\t_displayLink.Stop();\n\t\t\t_displayLink.Dispose();\n\t\t\t_displayLink = null;\n\t\t}\n\n\t\t// Private Callback function for CVDisplayLink\n\t\tstatic CVReturn DisplayLinkOutputCallback (CVDisplayLink displayLink, ref CVTimeStamp inNow, ref CVTimeStamp inOutputTime, CVOptionFlags flagsIn, ref CVOptionFlags flagsOut)\n\t\t{\n\t\t\t//CVReturn result = GetFrameForTime (inOutputTime);\n\t\t\tCVReturn result = CVReturn.Success;\n\n\t\t\tusing (new NSAutoreleasePool ())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tforeach(var view in _views)\n\t\t\t\t\t\tview.Value.Draw ();\n\t\t\t\t}\n\t\t\t\tcatch(Exception e)\n\t\t\t\t{\n\t\t\t\t\tConsole.Error.WriteLine(e);\n\t\t\t\t\tresult = CVReturn.Error;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/Entitlements.plist",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/unohost/mac/FusionSupport/EventIntercepter.cs",
    "content": "﻿using System;\nusing AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tclass EventIntercepter\n\t{\n\t\tpublic static NSEvent TransformLocationOfEvent(NSView view, NSEvent nsEvent)\n\t\t{\n\t\t\tif(!IsMouseEvent(nsEvent.Type))\n\t\t\t\treturn nsEvent;\n\n\t\t\tvar newLocation = view.ConvertPointFromView(nsEvent.LocationInWindow, null);\n\t\t\tif(IsMouseEnterExitEvent(nsEvent.Type))\n\t\t\t\treturn CreateMouseEnterExitEvent(nsEvent, newLocation);\n\n\t\t\treturn NSEvent.MouseEvent(\n\t\t\t\tnsEvent.Type,\n\t\t\t\tnewLocation,\n\t\t\t\tnsEvent.ModifierFlags,\n\t\t\t\tnsEvent.Timestamp,\n\t\t\t\tnsEvent.WindowNumber,\n\t\t\t\tnull,\n\t\t\t\tnsEvent.EventNumber,\n\t\t\t\tnsEvent.ClickCount,\n\t\t\t\tnsEvent.Pressure);\n\t\t}\n\n\t\tstatic NSEvent CreateMouseEnterExitEvent(NSEvent nsEvent, CGPoint location)\n\t\t{\n\t\t\treturn NSEvent.EnterExitEvent(\n\t\t\t\tnsEvent.Type,\n\t\t\t\tlocation,\n\t\t\t\tnsEvent.ModifierFlags,\n\t\t\t\tnsEvent.Timestamp,\n\t\t\t\tnsEvent.WindowNumber,\n\t\t\t\tnull,\n\t\t\t\tnsEvent.EventNumber,\n\t\t\t\tnsEvent.TrackingNumber,\n\t\t\t\tIntPtr.Zero);\n\t\t}\n\n\t\tstatic bool IsMouseEvent(NSEventType type)\n\t\t{\n\t\t\tswitch (type)\n\t\t\t{\n\t\t\t\tcase NSEventType.LeftMouseDown:\n\t\t\t\tcase NSEventType.LeftMouseUp:\n\t\t\t\tcase NSEventType.LeftMouseDragged:\n\t\t\t\tcase NSEventType.RightMouseDown:\n\t\t\t\tcase NSEventType.RightMouseUp:\n\t\t\t\tcase NSEventType.RightMouseDragged:\n\t\t\t\tcase NSEventType.OtherMouseDown:\n\t\t\t\tcase NSEventType.OtherMouseUp:\n\t\t\t\tcase NSEventType.OtherMouseDragged:\n\t\t\t\tcase NSEventType.MouseEntered:\n\t\t\t\tcase NSEventType.MouseMoved:\n\t\t\t\tcase NSEventType.MouseExited:\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tstatic bool IsMouseEnterExitEvent(NSEventType type)\n\t\t{\n\t\t\tswitch(type)\n\t\t\t{\n\t\t\t\tcase NSEventType.MouseEntered:\n\t\t\t\tcase NSEventType.MouseExited:\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/FusionSupport/Quad.cs",
    "content": "using System;\nusing OpenTK.Graphics.OpenGL;\n\nnamespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tpublic class Quad\n\t{\n\t\tconst string vertSource =\n\t\t\t@\"\nuniform vec2 position;\nuniform vec2 size;\nuniform vec4 clipRect;\n\nattribute vec2 vertex;\nvarying vec2 texCoord;\nvoid main()\n{\n\tvec2 pos = position + vertex * size;\n    texCoord = clipRect.xy + vec2(vertex.x, vertex.y) * clipRect.zw;\n    gl_Position = vec4(pos,0,1);\n}\n\";\n\n\t\tconst string fragSource =\n\t\t\t@\"\nuniform sampler2DRect tex;\nuniform int hasTexture;\nuniform vec2 texSize;\nvarying vec2 texCoord;\nvoid main()\n{\n    if(hasTexture == 1)\n      gl_FragColor = texture2DRect(tex, vec2(texCoord.x, texCoord.y) * texSize);\n    else\n      gl_FragColor = vec4(texCoord.xy*.5 + .5, 0.3, 1);\n}\n\";\n\n\t\tbyte []vertexData = new byte[]\n\t\t{\n\t\t\t0, 0,\n\t\t\t1, 0,\n\t\t\t1, 1,\n\t\t\t1, 1,\n\t\t\t0, 1,\n\t\t\t0, 0,\n\t\t};\n\n\t\tint _vbo;\n\t\tint _program;\n\n\t\tint _textureLoc;\n\t\tint _positionLoc;\n\t\tint _sizeLoc;\n\t\tint _clipLoc;\n\n\t\tint _vertexLoc;\n\n\t\tbool _inited = false;\n\n\t\tpublic Quad()\n\t\t{\n\t\t}\n\n\t\tpublic void Render(TextureTarget target, TextureHandle texture, Size<Pixels> textureSize, Rectangle<ClipSpaceUnits> rectangle, Rectangle<ClipSpaceUnits> clip)\n\t\t{\n\t\t\tInit ();\n\n\t\t\tGL.UseProgram (_program);\n\t\t\tGL.ActiveTexture(TextureUnit.Texture0);\n\t\t\tGL.BindTexture (target, texture);\n\t\t\tGL.Uniform1 (_textureLoc, 0);\n\t\t\tGL.Uniform1 (GL.GetUniformLocation(_program, \"hasTexture\"), 1);\n\t\t\tGL.Uniform2 (GL.GetUniformLocation(_program, \"texSize\"), (float)textureSize.Width, (float)textureSize.Height);\n\n\t\t\tGL.Uniform2 (_positionLoc, rectangle.Position.X, rectangle.Position.Y);\n\t\t\tGL.Uniform2 (_sizeLoc, rectangle.Size.Width, rectangle.Size.Height);\n\t\t\tGL.Uniform4(_clipLoc, (float)clip.Position.X, (float)clip.Position.Y, (float)clip.Size.Width, (float)clip.Size.Height);\n\n\t\t\tGL.BindBuffer(BufferTarget.ArrayBuffer, _vbo);\n\t\t\tGL.VertexAttribPointer (_vertexLoc, 2, VertexAttribPointerType.Byte, false, 0, 0);\n\t\t\tGL.EnableVertexAttribArray (_vertexLoc);\n\n\t\t\tGL.DrawArrays(BeginMode.Triangles, 0, 6);\n\t\t}\n\n\t\tpublic void Render(Rectangle<ClipSpaceUnits> rectangle)\n\t\t{\n\t\t\tInit ();\n\n\t\t\tGL.UseProgram (_program);\n\t\t\tGL.Uniform1 (GL.GetUniformLocation(_program, \"hasTexture\"), 0);\n\n\t\t\tGL.Uniform2 (_positionLoc, rectangle.Position.X, rectangle.Position.Y);\n\t\t\tGL.Uniform2 (_sizeLoc, rectangle.Size.Width, rectangle.Size.Height);\n\n\t\t\tGL.BindBuffer(BufferTarget.ArrayBuffer, _vbo);\n\t\t\tGL.VertexAttribPointer (_vertexLoc, 2, VertexAttribPointerType.Byte, false, 0, 0);\n\t\t\tGL.EnableVertexAttribArray (_vertexLoc);\n\n\t\t\tGL.UseProgram(_program);\n\t\t\tGL.DrawArrays(BeginMode.Triangles, 0, 6);\n\t\t}\n\n\t\tvoid Init()\n\t\t{\n\t\t\tif (_inited)\n\t\t\t\treturn;\n\n\t\t\tGL.GenBuffers(1, out _vbo);\n\t\t\tGL.BindBuffer(BufferTarget.ArrayBuffer, _vbo);\n\t\t\tGL.BufferData(BufferTarget.ArrayBuffer, new IntPtr(vertexData.Length), vertexData, BufferUsageHint.StaticDraw);\n\n\t\t\tvar vertShader = ShaderHelper.CompileShader(ShaderType.VertexShader, vertSource);\n\t\t\tvar fragShader = ShaderHelper.CompileShader(ShaderType.FragmentShader, fragSource);\n\t\t\t_program = ShaderHelper.LinkProgram(vertShader, fragShader);\n\n\t\t\t_textureLoc = GL.GetUniformLocation (_program, \"tex\");\n\t\t\t_positionLoc = GL.GetUniformLocation (_program, \"position\");\n\t\t\t_sizeLoc = GL.GetUniformLocation (_program, \"size\");\n\t\t\t_clipLoc = GL.GetUniformLocation(_program, \"clipRect\");\n\t\t\t_vertexLoc = GL.GetAttribLocation (_program, \"vertex\");\n\t\t\t_inited = true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/FusionSupport/ServerView.cs",
    "content": "using System;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing AppKit;\nusing CoreAnimation;\nusing CoreGraphics;\nusing CoreVideo;\nusing Foundation;\nusing OpenGL;\nusing OpenTK.Graphics.OpenGL;\nusing Outracks.Fusion.Mac;\nusing GL = OpenTK.Graphics.OpenGL.GL;\n\nnamespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tclass UnoHostLayer : CAOpenGLLayer\n\t{\n\t\treadonly Action _draw;\n\t\tint _dirtyVersion;\n\t\tint _version;\n\n\t\tpublic UnoHostLayer(Action draw)\n\t\t{\n\t\t\t_draw = draw;\n\t\t\tbase.Asynchronous = true;\n\t\t\tbase.NeedsDisplayOnBoundsChange = true;\n\t\t}\n\n\t\tpublic void MakeDirty()\n\t\t{\n\t\t\tInterlocked.Increment(ref _dirtyVersion);\n\t\t}\n\n\t\tpublic override bool CanDrawInCGLContext(\n\t\t\tCGLContext glContext,\n\t\t\tCGLPixelFormat pixelFormat,\n\t\t\tdouble timeInterval,\n\t\t\tref CVTimeStamp timeStamp)\n\t\t{\n\t\t\treturn _version != _dirtyVersion;\n\t\t}\n\n\t\tpublic override void DrawInCGLContext(CGLContext glContext, CGLPixelFormat pixelFormat, double timeInterval, ref CVTimeStamp timeStamp)\n\t\t{\n\t\t\t_version = _dirtyVersion;\n\t\t\t_draw();\n\t\t\tbase.DrawInCGLContext(glContext, pixelFormat, timeInterval, ref timeStamp);\n\t\t}\n\t}\n\n\tpublic class ServerView : NSView, ICursorRectControl\n\t{\n\t\tpublic readonly ISubject<NSEvent> Events = new Subject<NSEvent>();\n\n\t\treadonly NSTrackingArea _trackingArea;\n\t\treadonly SurfaceCache _surfaceCache;\n\t\treadonly Quad _quad = new Quad();\n\t\treadonly UnoHostLayer _backedLayer;\n\n\t\treadonly ISubject<Size<Points>> _size = new ReplaySubject<Size<Points>>(1);\n\t\tpublic IObservable<Size<Points>> Size { get { return _size.DistinctUntilChanged(); } }\n\n\t\treadonly BehaviorSubject<FocusState> _focus = new BehaviorSubject<FocusState>(FocusState.Blurred);\n\t\tpublic IObservable<FocusState> Focus\n\t\t{\n\t\t\tget { return _focus; }\n\t\t}\n\n\t\treadonly BehaviorSubject<Ratio<Pixels, Points>> _density;\n\t\tpublic IObservable<Ratio<Pixels, Points>> Density { get { return _density.DistinctUntilChanged(); } }\n\n\t\tpublic override bool IsOpaque\n\t\t{\n\t\t\tget { return true; }\n\t\t}\n\n\t\tinternal ServerView(SurfaceCache surfaceCache, Optional<CGRect> frame = default(Optional<CGRect>))\n\t\t\t: base(frame.Or(new CGRect()))\n\t\t{\n\t\t\t_surfaceCache = surfaceCache;\n\t\t\t_backedLayer = new UnoHostLayer(OnDraw);\n\t\t\tsurfaceCache.SurfaceSwapped.Subscribe(_ => _backedLayer.MakeDirty());\n\t\t\tWantsLayer = true;\n\n\t\t\t_trackingArea = new NSTrackingArea(\n\t\t\t\tnew CGRect(),\n\t\t\t\tNSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect | NSTrackingAreaOptions.MouseMoved | NSTrackingAreaOptions.MouseEnteredAndExited,\n\t\t\t\tthis,\n\t\t\t\tnull);\n\t\t\tAddTrackingArea(_trackingArea);\n\n\t\t\t_density = new BehaviorSubject<Ratio<Pixels, Points>>(GetDensity());\n\t\t}\n\n\t\tpublic Action<NSView> ResetCursorRectsHandler { get; set; }\n\t\tpublic override void ResetCursorRects()\n\t\t{\n\t\t\tif (ResetCursorRectsHandler != null)\n\t\t\t\tResetCursorRectsHandler(this);\n\t\t}\n\n\t\t[Export(\"viewDidChangeBackingProperties\")]\n\t\tpublic void ViewDidChangeBackingProperties()\n\t\t{\n\t\t\tvar density = GetDensity();\n\t\t\t_density.OnNext(density);\n\t\t\t_backedLayer.ContentsScale = (float) density;\n\n\t\t\t// Force update size of backed layer when density changes\n\t\t\t// Issue: https://github.com/fusetools/Fuse/issues/2738\n\t\t\tSetFrameSize(Frame.Size + new CGSize(1, 1));\n\t\t\tSetFrameSize(Frame.Size - new CGSize(1, 1));\n\t\t}\n\n\t\tRatio<Pixels, Points> GetDensity()\n\t\t{\n\t\t\treturn new Ratio<Pixels, Points>(ConvertSizeToBacking(new CGSize(1, 1)).Width);\n\t\t}\n\n\t\tpublic override CALayer MakeBackingLayer()\n\t\t{\n\t\t\treturn _backedLayer;\n\t\t}\n\n\t\t#region EventOverriding\n\t\tpublic override bool AcceptsFirstResponder()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override bool BecomeFirstResponder()\n\t\t{\n\t\t\t_focus.OnNext(FocusState.Focused);\n\t\t\treturn base.BecomeFirstResponder();\n\t\t}\n\n\t\tpublic override bool ResignFirstResponder()\n\t\t{\n\t\t\t_focus.OnNext(FocusState.Blurred);\n\t\t\treturn base.ResignFirstResponder();\n\t\t}\n\n\t\tpublic override bool AcceptsFirstMouse(NSEvent theEvent)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override void MouseDown(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t\tif(theEvent.Window != null)\n\t\t\t\ttheEvent.Window.MakeFirstResponder(this);\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\t// Custom event loop to handle mouse dragging outside of window\n\t\t\t\ttheEvent = Window.NextEventMatchingMask(NSEventMask.LeftMouseDragged | NSEventMask.LeftMouseUp);\n\n\t\t\t\tif(theEvent == null)\n\t\t\t\t\tbreak;\n\n\t\t\t\tForwardEvent(theEvent);\n\t\t\t\tif (theEvent.Type == NSEventType.LeftMouseUp)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tpublic override void MouseUp(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void MouseDragged(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void RightMouseDown(NSEvent theEvent)\n\t\t{\n\t\t\t_focus.OnNext(FocusState.Focused); // Give focus on right click too\n\t\t\tbase.RightMouseDown(theEvent); // Handle context menu\n\t\t}\n\n\t\tpublic override void RightMouseUp(NSEvent theEvent)\n\t\t{\n\t\t\tbase.RightMouseUp(theEvent); // Handle context menu\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void RightMouseDragged(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void OtherMouseDown(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void OtherMouseUp(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void OtherMouseDragged(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void MouseEntered(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void MouseMoved(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void MouseExited(NSEvent theEvent)\n\t\t{\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void ScrollWheel(NSEvent theEvent)\n\t\t{\n\t\t\tbase.ScrollWheel(theEvent);\n\t\t\tForwardEvent(theEvent);\n\t\t}\n\n\t\tpublic override void KeyDown(NSEvent theEvent)\n\t\t{\n\t\t\t// Clone key events to avoid crashing the application when reading\n\t\t\t// Characters or CharactersIgnoringModifiers on a different thread\n\t\t\tForwardEvent(NSEvent.KeyEvent(\n\t\t\t\ttheEvent.Type,\n\t\t\t\ttheEvent.LocationInWindow,\n\t\t\t\ttheEvent.ModifierFlags,\n\t\t\t\ttheEvent.Timestamp,\n\t\t\t\ttheEvent.WindowNumber,\n\t\t\t\ttheEvent.Context,\n\t\t\t\ttheEvent.Characters,\n\t\t\t\ttheEvent.CharactersIgnoringModifiers,\n\t\t\t\ttheEvent.IsARepeat,\n\t\t\t\ttheEvent.KeyCode\n\t\t\t));\n\t\t}\n\n\t\tpublic override void KeyUp(NSEvent theEvent)\n\t\t{\n\t\t\t// Clone key events to avoid crashing the application when reading\n\t\t\t// Characters or CharactersIgnoringModifiers on a different thread\n\t\t\tForwardEvent(NSEvent.KeyEvent(\n\t\t\t\ttheEvent.Type,\n\t\t\t\ttheEvent.LocationInWindow,\n\t\t\t\ttheEvent.ModifierFlags,\n\t\t\t\ttheEvent.Timestamp,\n\t\t\t\ttheEvent.WindowNumber,\n\t\t\t\ttheEvent.Context,\n\t\t\t\ttheEvent.Characters,\n\t\t\t\ttheEvent.CharactersIgnoringModifiers,\n\t\t\t\ttheEvent.IsARepeat,\n\t\t\t\ttheEvent.KeyCode\n\t\t\t));\n\t\t}\n\t\t#endregion\n\n\t\tvoid ForwardEvent(NSEvent theEvent)\n\t\t{\n\t\t\tEvents.OnNext(EventIntercepter.TransformLocationOfEvent(this, theEvent));\n\t\t}\n\n\t\tpublic override void SetFrameSize(CGSize newSize)\n\t\t{\n\t\t\tbase.SetFrameSize(newSize);\n\t\t\t_size.OnNext(new Size<Points>((double)newSize.Width, (double)newSize.Height));\n\t\t}\n\n\t\tpublic override void ViewWillDraw()\n\t\t{\n\t\t\t_backedLayer.MakeDirty();\n\t\t}\n\n\t\tvoid OnDraw()\n\t\t{\n\t\t\tGL.ClearColor(0.0f, 0.0f, 0.0f, .0f);\n\t\t\tGL.Clear(ClearBufferMask.ColorBufferBit);\n\n\t\t\t_surfaceCache.GetCurrentFrontTexture().Do(\n\t\t\t\ttexture =>\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tvar clipRect = Rectangle.FromSides<ClipSpaceUnits>(0, 0, 1, 1);\n\n\t\t\t\t\t\t_quad.Render(TextureTarget.TextureRectangle, texture, texture.Size,\n\t\t\t\t\t\t\tRectangle.FromSides<ClipSpaceUnits>(-1, -1, 1, 1), clipRect);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(e);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t_surfaceCache.WipeUnusedSurfaces();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/FusionSupport/ShaderHelper.cs",
    "content": "using System;\nusing OpenTK.Graphics.OpenGL;\n\nnamespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tpublic static class ShaderHelper\n\t{\n\t\tpublic static int CompileShader(ShaderType type, string source)\n\t\t{\n\t\t\tint handle = GL.CreateShader(type);\n\t\t\tGL.ShaderSource(handle, source);\n\t\t\tGL.CompileShader(handle);\n\n\t\t\tint compileStatus;\n\t\t\tGL.GetShader(handle, ShaderParameter.CompileStatus, out compileStatus);\n\t\t\tif (compileStatus != 1)\n\t\t\t{\n\t\t\t\tstring log = GL.GetShaderInfoLog(handle);\n\t\t\t\tthrow new Exception(((((\"Error compiling shader (\" + (object)type) + \"):\\n\\n\") + log) + \"\\n\\nSource:\\n\\n\") + source);\n\t\t\t}\n\n\t\t\treturn handle;\n\t\t}\n\n\t\tpublic static int LinkProgram(int vertexShader, int fragmentShader)\n\t\t{\n\t\t\tint handle = GL.CreateProgram();\n\t\t\tGL.AttachShader(handle, vertexShader);\n\t\t\tGL.AttachShader(handle, fragmentShader);\n\t\t\tGL.LinkProgram(handle);\n\n\t\t\tint linkStatus;\n\t\t\tGL.GetProgram(handle, ProgramParameter.LinkStatus, out linkStatus);\n\t\t\tif (linkStatus != 1)\n\t\t\t{\n\t\t\t\tstring log = GL.GetProgramInfoLog(handle);\n\t\t\t\tthrow new Exception(\"Error linking shader program:\\n\\n\" + log);\n\t\t\t}\n\n\t\t\tGL.UseProgram(handle);\n\t\t\treturn handle;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/FusionSupport/SurfaceCache.cs",
    "content": "﻿using System;\nusing System.Collections.Concurrent;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing Outracks.UnoHost.Mac.UnoView.RenderTargets;\n\nnamespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tclass SurfaceCache\n\t{\n\t\treadonly ConcurrentQueue<SurfaceCacheItem> _surfacesToBeWiped = new ConcurrentQueue<SurfaceCacheItem>();\n\t\tSurfaceCacheItem _backSurface;\n\t\tSurfaceCacheItem _frontSurface;\n\n\t\treadonly Subject<Unit> _surfaceSwapped = new Subject<Unit>();\n\t\tpublic IObservable<Unit> SurfaceSwapped { get { return _surfaceSwapped; } }\n\n\t\tpublic Optional<TextureInfo> GetCurrentFrontTexture()\n\t\t{\n\t\t\t//THIS METHOD MUST BE CALLED IN THE RIGHT GL CONTEXT\n\t\t\treturn _frontSurface\n\t\t\t\t.ToOptional()\n\t\t\t\t.Select(surface => new TextureInfo(surface.GetOrCreateTexture(), surface.Surface.Size));\n\t\t}\n\n\t\tpublic void SwapAndUpdateCache(int surfaceId)\n\t\t{\n\t\t\tvar newFrontSurface = GetSurfaceFromCache(surfaceId)\n\t\t\t\t.Or(() => CreatCacheItem(surfaceId));\n\t\t\tnewFrontSurface.Do(Swap);\n\t\t}\n\n\t\tpublic void WipeUnusedSurfaces()\n\t\t{\n\t\t\t//THIS METHOD MUST BE CALLED IN THE RIGHT GL CONTEXT\n\t\t\tSurfaceCacheItem item;\n\t\t\twhile(_surfacesToBeWiped.TryDequeue(out item))\n\t\t\t\titem.Dispose();\n\t\t}\n\n\t\tvoid Swap(SurfaceCacheItem newFrontSurface)\n\t\t{\n\t\t\tif (GetSurfaceId(newFrontSurface) != GetSurfaceId(_backSurface))\n\t\t\t{\n\t\t\t\t// If new surface hasn't been cached, then pin the old one for deletion\n\t\t\t\tif(_backSurface != null)\n\t\t\t\t\tPinSurfaceItemForWipe(_backSurface);\n\t\t\t}\n\n\t\t\t_backSurface = _frontSurface;\n\t\t\t_frontSurface = newFrontSurface;\n\t\t\t_surfaceSwapped.OnNext(Unit.Default);\n\t\t}\n\n\t\tvoid PinSurfaceItemForWipe(SurfaceCacheItem item)\n\t\t{\n            item.ThrowIfNull(\"item\");\n            _surfacesToBeWiped.Enqueue(item);\n\t\t}\n\n\t\tOptional<SurfaceCacheItem> GetSurfaceFromCache(int surfaceId)\n\t\t{\n\t\t\tif (GetSurfaceId(_backSurface).Or(-1) == surfaceId)\n\t\t\t\treturn _backSurface;\n\n\t\t\tif (GetSurfaceId(_frontSurface).Or(-1) == surfaceId)\n\t\t\t\treturn _frontSurface;\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\t\tstatic Optional<int> GetSurfaceId(SurfaceCacheItem item)\n\t\t{\n\t\t\tif (item == null)\n\t\t\t\treturn Optional.None();\n\n\t\t\treturn item.Surface.GetSurfaceId();\n\t\t}\n\n\t\tOptional<SurfaceCacheItem> CreatCacheItem(int surfaceId)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new SurfaceCacheItem(IOSurfaceObject.CreateFromLookup(surfaceId));\n\t\t\t}\n\t\t\tcatch(FailedToLookupSurface)\n\t\t\t{\n\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/FusionSupport/SurfaceCacheItem.cs",
    "content": "using System;\nusing OpenTK.Graphics.OpenGL;\nusing Outracks.UnoHost.Mac.UnoView.RenderTargets;\n\nnamespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tclass SurfaceCacheItem : IDisposable\n\t{\n\t\tpublic readonly IOSurfaceObject Surface;\n\t\tOptional<TextureHandle> _texture;\n\n\t\tpublic SurfaceCacheItem(IOSurfaceObject surface)\n\t\t{\n\t\t\tSurface = surface;\n\t\t}\n\n\t\tpublic TextureHandle GetOrCreateTexture()\n\t\t{\n\t\t\tif (!_texture.HasValue)\n\t\t\t\t_texture = Surface.CreateTexture();\n\n\t\t\treturn _texture.Value;\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_texture.Do(texture => GL.DeleteTexture(texture));\n\t\t\tSurface.Dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/FusionSupport/TextureInfo.cs",
    "content": "namespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tclass TextureInfo\n\t{\n\t\tpublic readonly TextureHandle Handle;\n\t\tpublic readonly Size<Pixels> Size;\n\n\t\tpublic TextureInfo(TextureHandle handle, Size<Pixels> size)\n\t\t{\n\t\t\tHandle = handle;\n\t\t\tSize = size;\n\t\t}\n\n\t\tpublic static implicit operator TextureHandle(TextureInfo info)\n\t\t{\n\t\t\treturn info.Handle;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/FusionSupport/UnoHostViewFactory.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing AppKit;\nusing Outracks.UnoHost.Mac.Protocol;\n\nnamespace Outracks.UnoHost.Mac.FusionSupport\n{\n\tpublic class UnoHostViewFactory\n\t{\n\t\tpublic IObservable<FocusState> Focus { get; private set; }\n\t\tpublic NSView View { get; private set; }\n\n\t\tpublic static UnoHostViewFactory Create(IObservable<IBinaryMessage> messagesFromHost, IObserver<IBinaryMessage> messagesToHost)\n\t\t{\n\t\t\tvar surfaceCache = new SurfaceCache();\n\n\t\t\tvar serverView = new ServerView(surfaceCache)\n\t\t\t{\n\t\t\t\tWantsBestResolutionOpenGLSurface = true\n\t\t\t};\n\n\t\t\tObservable\n\t\t\t\t.Merge(\n\t\t\t\t\tserverView.Events.Select(CocoaEventMessage.Compose),\n\t\t\t\t\tserverView.Size.CombineLatest(serverView.Density, (s,d) => ResizeMessage.Compose(new SizeData(s, d))))\n\t\t\t\t.Subscribe(messagesToHost.OnNext);\n\n\t\t\tmessagesFromHost\n\t\t\t\t.SelectSome(NewSurfaceMessage.TryParse)\n\t\t\t\t.Subscribe(surfaceCache.SwapAndUpdateCache, e => Console.WriteLine(e));\n\n\t\t\treturn new UnoHostViewFactory()\n\t\t\t{\n\t\t\t\tView = serverView,\n\t\t\t\tFocus = serverView.Focus\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDisplayName</key>\n\t<string>Fuse</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.fuse-x.unohost</string>\n\t<key>CFBundleName</key>\n\t<string>UnoHost</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>10.10</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>CFBundleIconFile</key>\n\t<string>Icon</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>VERSION_NUMBER</string>\n\t<key>MonoMinimumVersion</key>\n\t<string>6.4</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>© Build &amp; Run</string>\n\t<key>LSBackgroundOnly</key>\n\t<true />\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<true/>\n\t</dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "src/unohost/mac/MonoMacEnums.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing AppKit;\nusing Uno.Platform;\n\nnamespace Outracks.UnoHost.Mac\n{\n\tpublic static class MonoMacEnums\n\t{\n\t\tpublic static Optional<Key> InterpretAsKeyEvent(this NSEvent theEvent)\n\t\t{\n\t\t\treturn ((NSKey)theEvent.KeyCode).ToKey()\n\t\t\t\t.Or(((NSFunctionKey)theEvent.KeyCode).ToKey());\n\t\t}\n\n\t\tpublic static Optional<string> InterpretAsTextEvent(this NSEvent theEvent)\n\t\t{\n\t\t\tif (!IsTextInputEvent (theEvent.ModifierFlags))\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar characters = theEvent.Characters.Where (CharacterIsNotSpecial).ToArray();\n\t\t\tif (characters.Length == 0)\n\t\t\t\treturn Optional.None();\n\n\t\t\treturn new String(characters);\n\t\t}\n\n\t\tstatic bool IsTextInputEvent(NSEventModifierMask modifierFlags)\n\t\t{\n\t\t\treturn (modifierFlags & NSEventModifierMask.CommandKeyMask) == 0;\n\t\t}\n\n\t\tstatic bool CharacterIsNotSpecial(char character)\n\t\t{\n\t\t\treturn char.IsLetterOrDigit (character) || char.IsSymbol (character) || char.IsWhiteSpace (character) || char.IsPunctuation (character) || char.IsNumber (character) || char.IsSeparator (character);\n\t\t}\n\n\t\t/*\n\t\tpublic static NSEventModifierMask ToNSEventModifierMask(this ModifierKeys keys)\n\t\t{\n\t\t\tvar mask = (NSEventModifierMask)0;\n\n\t\t\tif (keys.HasFlag (ModifierKeys.Alt))\n\t\t\t\tmask |= NSEventModifierMask.AlternateKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Command))\n\t\t\t\tmask |= NSEventModifierMask.CommandKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Control))\n\t\t\t\tmask |= NSEventModifierMask.ControlKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Shift))\n\t\t\t\tmask |= NSEventModifierMask.ShiftKeyMask;\n\n\t\t\treturn mask;\n\t\t}\n\n\t\tpublic static ModifierKeys ToModifierKeys(this NSEventModifierMask mask)\n\t\t{\n\t\t\tvar keys = ModifierKeys.None;\n\n\t\t\tif (mask.HasFlag (NSEventModifierMask.CommandKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Command | ModifierKeys.Meta;\n\t\t\tif (mask.HasFlag (NSEventModifierMask.ControlKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Control;\n\t\t\tif (mask.HasFlag (NSEventModifierMask.ShiftKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Shift;\n\t\t\tif (mask.HasFlag (NSEventModifierMask.AlternateKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Alt;\n\n\t\t\treturn keys;\n\t\t}\n\t\t*/\n\t\tpublic static MouseButtons ToMouseButtons(this uint nsButtons)\n\t\t{\n\t\t\tvar buttons = MouseButtons.None;\n\n\t\t\tif ((nsButtons & (1 << 0)) != 0)\n\t\t\t\tbuttons |= MouseButtons.Left;\n\t\t\tif ((nsButtons & (1 << 1)) != 0)\n\t\t\t\tbuttons |= MouseButtons.Right;\n\t\t\tif ((nsButtons & (1 << 2)) != 0)\n\t\t\t\tbuttons |= MouseButtons.Middle;\n\t\t\t// TODO: maybe incorrect\n\t\t\treturn buttons;\n\t\t}\n\t\t/*\n\t\tpublic static string ToKeyEquivalent (this Key key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase Key.None: return \"\";\n\t\t\t\tcase Key.Space: return \" \";\n\t\t\t\tcase Key.D0: return \"0\";\n\t\t\t\tcase Key.D1: return \"1\";\n\t\t\t\tcase Key.D2: return \"2\";\n\t\t\t\tcase Key.D3: return \"3\";\n\t\t\t\tcase Key.D4: return \"4\";\n\t\t\t\tcase Key.D5: return \"5\";\n\t\t\t\tcase Key.D6: return \"6\";\n\t\t\t\tcase Key.D7: return \"7\";\n\t\t\t\tcase Key.D8: return \"8\";\n\t\t\t\tcase Key.D9: return \"9\";\n\t\t\t\tcase Key.Plus: return \"+\";\n\t\t\t\tcase Key.Minus: return \"-\";\n\t\t\t\tcase Key.NumPad0: return \"0\";\n\t\t\t\tcase Key.NumPad1: return \"1\";\n\t\t\t\tcase Key.NumPad2: return \"2\";\n\t\t\t\tcase Key.NumPad3: return \"3\";\n\t\t\t\tcase Key.NumPad4: return \"4\";\n\t\t\t\tcase Key.NumPad5: return \"5\";\n\t\t\t\tcase Key.NumPad6: return \"6\";\n\t\t\t\tcase Key.NumPad7: return \"7\";\n\t\t\t\tcase Key.NumPad8: return \"8\";\n\t\t\t\tcase Key.NumPad9: return \"9\";\n\t\t\t\tcase Key.Add: return \"+\";\n\t\t\t\tcase Key.Subtract: return \"-\";\n\t\t\t}\n\t\t\treturn key.ToString ().ToLower ();\n\t\t}\n\t\t*/\n\n\t\tpublic static Optional<Key> ToKey (this NSKey key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase NSKey.Delete:\n\t\t\t\t\treturn Key.Backspace;\n\t\t\t\tcase NSKey.Tab:\n\t\t\t\t\treturn Key.Tab;\n\t\t\t\tcase NSKey.Return:\n\t\t\t\t\treturn Key.Enter;\n\t\t\t\tcase NSKey.Shift:\n\t\t\t\tcase NSKey.RightShift:\n\t\t\t\t\treturn Key.ShiftKey;\n\t\t\t\tcase NSKey.Control:\n\t\t\t\tcase NSKey.RightControl:\n\t\t\t\t\treturn Key.ControlKey;\n\n\t\t\t\tcase NSKey.CapsLock:\n\t\t\t\t\treturn Key.CapsLock;\n\n\t\t\t\tcase NSKey.Escape:\n\t\t\t\t\treturn Key.Escape;\n\n\t\t\t\tcase NSKey.Space:\n\t\t\t\t\treturn Key.Space;\n\n\t\t\t\tcase NSKey.PageUp:\n\t\t\t\t\treturn Key.PageUp;\n\n\t\t\t\tcase NSKey.PageDown:\n\t\t\t\t\treturn Key.PageDown;\n\n\t\t\t\tcase NSKey.End:\n\t\t\t\t\treturn Key.End;\n\n\t\t\t\tcase NSKey.Home:\n\t\t\t\t\treturn Key.Home;\n\n\t\t\t\tcase NSKey.LeftArrow:\n\t\t\t\t\treturn Key.Left;\n\n\t\t\t\tcase NSKey.UpArrow:\n\t\t\t\t\treturn Key.Up;\n\n\t\t\t\tcase NSKey.RightArrow:\n\t\t\t\t\treturn Key.Right;\n\n\t\t\t\tcase NSKey.DownArrow:\n\t\t\t\t\treturn Key.Down;\n\n\t\t\t\tcase NSKey.ForwardDelete:\n\t\t\t\t\treturn Key.Delete;\n\n\t\t\t\tcase NSKey.D0:\n\t\t\t\t\treturn Key.D0;\n\n\t\t\t\tcase NSKey.D1:\n\t\t\t\t\treturn Key.D1;\n\n\t\t\t\tcase NSKey.D2:\n\t\t\t\t\treturn Key.D2;\n\n\t\t\t\tcase NSKey.D3:\n\t\t\t\t\treturn Key.D3;\n\n\t\t\t\tcase NSKey.D4:\n\t\t\t\t\treturn Key.D4;\n\n\t\t\t\tcase NSKey.D5:\n\t\t\t\t\treturn Key.D5;\n\n\t\t\t\tcase NSKey.D6:\n\t\t\t\t\treturn Key.D6;\n\n\t\t\t\tcase NSKey.D7:\n\t\t\t\t\treturn Key.D7;\n\n\t\t\t\tcase NSKey.D8:\n\t\t\t\t\treturn Key.D8;\n\n\t\t\t\tcase NSKey.D9:\n\t\t\t\t\treturn Key.D9;\n\n\t\t\t\tcase NSKey.A:\n\t\t\t\t\treturn Key.A;\n\n\t\t\t\tcase NSKey.B:\n\t\t\t\t\treturn Key.B;\n\n\t\t\t\tcase NSKey.C:\n\t\t\t\t\treturn Key.C;\n\n\t\t\t\tcase NSKey.D:\n\t\t\t\t\treturn Key.D;\n\n\t\t\t\tcase NSKey.E:\n\t\t\t\t\treturn Key.E;\n\n\t\t\t\tcase NSKey.F:\n\t\t\t\t\treturn Key.F;\n\n\t\t\t\tcase NSKey.G:\n\t\t\t\t\treturn Key.G;\n\n\t\t\t\tcase NSKey.H:\n\t\t\t\t\treturn Key.H;\n\n\t\t\t\tcase NSKey.I:\n\t\t\t\t\treturn Key.I;\n\n\t\t\t\tcase NSKey.J:\n\t\t\t\t\treturn Key.J;\n\n\t\t\t\tcase NSKey.K:\n\t\t\t\t\treturn Key.K;\n\n\t\t\t\tcase NSKey.L:\n\t\t\t\t\treturn Key.L;\n\n\t\t\t\tcase NSKey.M:\n\t\t\t\t\treturn Key.M;\n\n\t\t\t\tcase NSKey.N:\n\t\t\t\t\treturn Key.N;\n\n\t\t\t\tcase NSKey.O:\n\t\t\t\t\treturn Key.O;\n\n\t\t\t\tcase NSKey.P:\n\t\t\t\t\treturn Key.P;\n\n\t\t\t\tcase NSKey.Q:\n\t\t\t\t\treturn Key.Q;\n\n\t\t\t\tcase NSKey.R:\n\t\t\t\t\treturn Key.R;\n\n\t\t\t\tcase NSKey.S:\n\t\t\t\t\treturn Key.S;\n\n\t\t\t\tcase NSKey.T:\n\t\t\t\t\treturn Key.T;\n\n\t\t\t\tcase NSKey.U:\n\t\t\t\t\treturn Key.U;\n\n\t\t\t\tcase NSKey.V:\n\t\t\t\t\treturn Key.V;\n\n\t\t\t\tcase NSKey.W:\n\t\t\t\t\treturn Key.W;\n\n\t\t\t\tcase NSKey.X:\n\t\t\t\t\treturn Key.X;\n\n\t\t\t\tcase NSKey.Y:\n\t\t\t\t\treturn Key.Y;\n\t\t\t\tcase NSKey.Z:\n\t\t\t\t\treturn Key.Z;\n\n\t\t\t\tcase NSKey.Keypad0:\n\t\t\t\t\treturn Key.NumPad0;\n\n\t\t\t\tcase NSKey.Keypad1:\n\t\t\t\t\treturn Key.NumPad1;\n\n\t\t\t\tcase NSKey.Keypad2:\n\t\t\t\t\treturn Key.NumPad2;\n\n\t\t\t\tcase NSKey.Keypad3:\n\t\t\t\t\treturn Key.NumPad3;\n\n\t\t\t\tcase NSKey.Keypad4:\n\t\t\t\t\treturn Key.NumPad4;\n\n\t\t\t\tcase NSKey.Keypad5:\n\t\t\t\t\treturn Key.NumPad5;\n\n\t\t\t\tcase NSKey.Keypad6:\n\t\t\t\t\treturn Key.NumPad6;\n\n\t\t\t\tcase NSKey.Keypad7:\n\t\t\t\t\treturn Key.NumPad7;\n\n\t\t\t\tcase NSKey.Keypad8:\n\t\t\t\t\treturn Key.NumPad8;\n\n\t\t\t\tcase NSKey.Keypad9:\n\t\t\t\t\treturn Key.NumPad9;\n\n\t\t\t\tcase NSKey.F1:\n\t\t\t\t\treturn Key.F1;\n\n\t\t\t\tcase NSKey.F2:\n\t\t\t\t\treturn Key.F2;\n\n\t\t\t\tcase NSKey.F3:\n\t\t\t\t\treturn Key.F3;\n\n\t\t\t\tcase NSKey.F4:\n\t\t\t\t\treturn Key.F4;\n\n\t\t\t\tcase NSKey.F5:\n\t\t\t\t\treturn Key.F5;\n\n\t\t\t\tcase NSKey.F6:\n\t\t\t\t\treturn Key.F6;\n\n\t\t\t\tcase NSKey.F7:\n\t\t\t\t\treturn Key.F7;\n\n\t\t\t\tcase NSKey.F8:\n\t\t\t\t\treturn Key.F8;\n\n\t\t\t\tcase NSKey.F9:\n\t\t\t\t\treturn Key.F9;\n\n\t\t\t\tcase NSKey.F10:\n\t\t\t\t\treturn Key.F10;\n\n\t\t\t\tcase NSKey.F11:\n\t\t\t\t\treturn Key.F11;\n\n\t\t\t\tcase NSKey.F12:\n\t\t\t\t\treturn Key.F12;\n\n\t\t\t\tcase NSKey.Command:\n\t\t\t\t\treturn Key.OSKey;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic static Optional<Key> ToKey(this NSFunctionKey key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase NSFunctionKey.Menu:\n\t\t\t\t\treturn Key.AltKey;\n\n\t\t\t\tcase NSFunctionKey.Break:\n\t\t\t\t\treturn Key.Break;\n\n\t\t\t\tcase NSFunctionKey.Insert:\n\t\t\t\t\treturn Key.Insert;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "src/unohost/mac/Program.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing AppKit;\nusing Outracks.Extensions;\nusing Outracks.Fuse.Analytics;\nusing Outracks.Fusion;\nusing Outracks.IO;\nusing Outracks.UnoHost.Mac.Protocol;\nusing Outracks.UnoHost.Mac.UnoView;\nusing Outracks.UnoHost.Mac.UnoView.RenderTargets;\nusing Application = Uno.Application;\n\nnamespace Outracks.UnoHost.Mac\n{\n\tpublic class Program\n\t{\n\t\tstatic Program()\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n#if DEBUG\n\t\t\tConsoleExtensions.RedirectStreamsToLogFiles(\"unohost\");\n#endif\n\t\t}\n\n\t\t[STAThread]\n\t\tpublic static void Main(string[] argsArray)\n\t\t{\n\t\t\tvar shell = new Shell();\n\t\t\tvar systemId = SystemGuidLoader.LoadOrCreateOrEmpty();\n\t\t\tvar sessionId = Guid.NewGuid();\n\t\t\tvar log = ReportFactory.GetReporter(systemId, sessionId, \"UnoHost\");\n\t\t\tvar descriptiveString = \"UnoHost (\" + argsArray.Select(Uno.Extensions.QuoteSpace).Join(\" \") + \")\";\n\t\t\ttry\n\t\t\t{\n\t\t\t\tAppDomain.CurrentDomain.ReportUnhandledExceptions(log);\n\n\t\t\t\tvar dispatcher = new Dispatcher(Thread.CurrentThread);\n\n\t\t\t\tlog.Info(\"Starting \" + descriptiveString, ReportTo.LogAndUser);\n\t\t\t\tvar argsList = argsArray.ToList();\n\n\t\t\t\tvar args = UnoHostArgs.RemoveFrom(argsList, shell);\n\n\t\t\t\tNSApplication.Init();\n\n\t\t\t\tNSApplication.SharedApplication.Delegate = new AppDelegate();\n\t\t\t\tAppDelegate.ThrowOnTerminate = false;\n\n\t\t\t\tAction exit = () =>\n\t\t\t\t{\n\t\t\t\t\tlog.Info(\"Stopping \" + descriptiveString);\n\t\t\t\t\tNSApplication.SharedApplication.Terminate(NSApplication.SharedApplication);\n\t\t\t\t};\n\t\t\t\tConsole.CancelKeyPress += (sender, e) => exit();\n\n\t\t\t\tNSApplication.CheckForIllegalCrossThreadCalls = false;\n\n\t\t\t\t// Load metadata\n\t\t\t\tvar unoHostProject = UnoHostProject.Load(args.MetadataPath, shell);\n\n\t\t\t\tAction<Exception> onLostConnection = exception =>\n\t\t\t\t{\n\t\t\t\t\tif (exception == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tlog.Info(\"CommunicationProtocol closed\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlog.Exception(\"CommunicationProtocol failed\", exception);\n\t\t\t\t\t}\n\t\t\t\t\texit();\n\t\t\t\t};\n\n\t\t\t\tvar renderTarget = new IOSurfaceRenderTarget();\n\t\t\t\tvar glView = new UnoView.UnoView(dispatcher, log, renderTarget)\n\t\t\t\t{\n\t\t\t\t\tWantsBestResolutionOpenGLSurface = true\n\t\t\t\t};\n\t\t\t\tglView.PrepareOpenGL(); // We have to call this method manually because the view isn't bound to a window\n\n\t\t\t\tvar openGlVersion = new Subject<OpenGlVersion>();\n\n\t\t\t\tvar messagesTo = new Subject<IBinaryMessage>();\n\t\t\t\tvar output = Observable.Merge(\n\t\t\t\t\tmessagesTo,\n\t\t\t\t\topenGlVersion.Select(OpenGlVersionMessage.Compose),\n\t\t\t\t\trenderTarget.SurfaceRendered.Select(NewSurfaceMessage.Compose));\n\n\t\t\t\tif (!args.IsDebug)\n\t\t\t\t\targs.OutputPipe.BeginWritingMessages(\n\t\t\t\t\t\t\"Designer\",\n\t\t\t\t\t\tex => Console.WriteLine(\"UnoHost failed to write message to designer: \" + ex),\n\t\t\t\t\t\toutput.ObserveOn(new QueuedDispatcher()));\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tglView.Initialize(unoHostProject, openGlVersion);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tConsole.Error.WriteLine(\"Initialize: \" + e);\n\t\t\t\t\tlog.Exception(\"Initialize failed\", e);\n\t\t\t\t}\n\n\t\t\t\tvar messagesFrom = args.InputPipe\n\t\t\t\t\t.ReadMessages(\"Designer\")\n\t\t\t\t\t.RefCount()\n\t\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t\t.Publish();\n\n\t\t\t\tmessagesFrom.SelectSome(CocoaEventMessage.TryParse)\n\t\t\t\t\t.Subscribe(e => EventProcesser.SendEvent(glView, e), onLostConnection, () => onLostConnection(null));\n\n\t\t\t\t// Fuselibs fails during construction if we don't get this, and we can't wait for it because we are dispatching responses on our queue\n\t\t\t\tglView.Resize(new SizeData(Size.Create<Points>(0,0), 1.0));\n\t\t\t\tmessagesFrom.SelectSome(ResizeMessage.TryParse)\n\t\t\t\t\t.Subscribe(glView.Resize, onLostConnection, () => onLostConnection(null));\n\n\t\t\t\tvar size = glView.Size.Transpose();\n\n\n\t\t\t\t// Run the uno entrypoints, this initializes Uno.Application.Current\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tunoHostProject.ExecuteStartupCode();\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tConsole.Error.WriteLine(\"ExecuteStartupCode: \" + e);\n\t\t\t\t\tlog.Exception(\"ExecuteStartupCode failed\", e);\n\t\t\t\t}\n\n\t\t\t\tvar app = Application.Current as dynamic;\n\n\n\t\t\t\t// Init plugins\n\n\t\t\t\tFusionImplementation.Initialize(dispatcher, args.UserDataPath, app.Reflection);\n\t\t\t\tvar overlay = PluginManager.Initialize(messagesFrom, messagesTo, dispatcher, glView.PerFrame, size);\n\t\t\t\tapp.ResetEverything(true, overlay);\n\n\n\t\t\t\t// Ready to go\n\n\t\t\t\tmessagesFrom.Connect();\n\t\t\t\tmessagesTo.OnNext(new Ready());\n\n\t\t\t\tNSApplication.SharedApplication.Run();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlog.Exception(\"Exception in \" + descriptiveString, e);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\n\n[assembly: AssemblyTitle(\"Outracks.UnoHost.Mac\")]\n[assembly: AssemblyDescription(\"\")]\n"
  },
  {
    "path": "src/unohost/mac/Protocol/CocoaEventMessage.cs",
    "content": "using System;\nusing System.Runtime.InteropServices;\nusing AppKit;\nusing Foundation;\n\nnamespace Outracks.UnoHost.Mac.Protocol\n{\n\tstatic class CocoaEventMessage\n\t{\n\t\tconst string Name = \"OSX.CocoaEvent\";\n\n\t\tpublic static IBinaryMessage Compose(NSEvent nsEvent)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Name, writer =>\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar data = NSKeyedArchiver.ArchivedDataWithRootObject(nsEvent, false, out NSError error);\n\n\t\t\t\t\tif (error != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tConsole.WriteLine(error);\n\t\t\t\t\t\twriter.Write(0);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar managedData = new byte[data.Length];\n\t\t\t\t\tMarshal.Copy(data.Bytes, managedData, 0, (int)data.Length);\n\n\t\t\t\t\twriter.Write((int)data.Length);\n\t\t\t\t\twriter.Write(managedData);\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t\tConsole.WriteLine(e);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tpublic static Optional<NSEvent> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Name, reader =>\n\t\t\t{\n\t\t\t\tvar length = reader.ReadInt32();\n\n\t\t\t\tif (length == 0)\n\t\t\t\t\treturn null;\n\n\t\t\t\tvar data = reader.ReadBytes(length);\n\t\t\t\tvar nsData = NSData.FromArray(data);\n\t\t\t\treturn (NSEvent)NSKeyedUnarchiver.UnarchiveObject(nsData);\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/Protocol/NewSurfaceMessage.cs",
    "content": "using Outracks.UnoHost.Mac.UnoView.RenderTargets;\n\nnamespace Outracks.UnoHost.Mac.Protocol\n{\n\tstatic class NewSurfaceMessage\n\t{\n\t\tconst string Name = \"OSX.NewSurface\";\n\n\t\tpublic static IBinaryMessage Compose(IOSurfaceObject surface)\n\t\t{\n\t\t\treturn Compose(surface.GetSurfaceId());\n\t\t}\n\n\t\tpublic static IBinaryMessage Compose(int surfaceId)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Name, writer =>\n\t\t\t\twriter.Write(surfaceId));\n\t\t}\n\n\t\tpublic static Optional<int> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Name, reader =>\n\t\t\t\treader.ReadInt32());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/Protocol/ResizeMessage.cs",
    "content": "namespace Outracks.UnoHost.Mac.Protocol\n{\n\tclass SizeData\n\t{\n\t\tpublic readonly Size<Points> Size;\n\t\tpublic readonly Ratio<Pixels, Points> Density;\n\n\t\tpublic SizeData(Size<Points> size, Ratio<Pixels, Points> density)\n\t\t{\n\t\t\tSize = size;\n\t\t\tDensity = density;\n\t\t}\n\t}\n\n\tstatic class ResizeMessage\n\t{\n\t\tconst string Name = \"OSX.Resize\";\n\n\t\tpublic static IBinaryMessage Compose(SizeData sizeData)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Name, writer =>\n\t\t\t{\n\t\t\t\twriter.Write((int)sizeData.Size.Width);\n\t\t\t\twriter.Write((int)sizeData.Size.Height);\n\t\t\t\twriter.Write((double)sizeData.Density);\n\t\t\t});\n\t\t}\n\n\t\tpublic static Optional<SizeData> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Name, reader =>\n\t\t\t\tnew SizeData(\n\t\t\t\t\tnew Size<Points>(reader.ReadInt32(), reader.ReadInt32()),\n\t\t\t\t\treader.ReadDouble())\n\t\t\t);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/UnoHost.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{486BE0C3-2ED8-4AB4-9488-C004C247C719}</ProjectGuid>\n    <ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>Outracks.UnoHost.Mac</RootNamespace>\n    <AssemblyName>UnoHost</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>$(SolutionDir)bin\\$(Configuration)</OutputPath>\n    <DefineConstants>DEBUG;</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <EnableCodeSigning>false</EnableCodeSigning>\n    <CodeSigningKey>Mac Developer</CodeSigningKey>\n    <CreatePackage>false</CreatePackage>\n    <EnablePackageSigning>false</EnablePackageSigning>\n    <IncludeMonoRuntime>false</IncludeMonoRuntime>\n    <UseSGen>true</UseSGen>\n    <UseRefCounting>true</UseRefCounting>\n    <HttpClientHandler>HttpClientHandler</HttpClientHandler>\n    <LinkMode>None</LinkMode>\n    <XamMacArch></XamMacArch>\n    <AOTMode>None</AOTMode>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>$(SolutionDir)bin\\$(Configuration)</OutputPath>\n    <DefineConstants></DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <EnableCodeSigning>false</EnableCodeSigning>\n    <CreatePackage>false</CreatePackage>\n    <EnablePackageSigning>false</EnablePackageSigning>\n    <IncludeMonoRuntime>true</IncludeMonoRuntime>\n    <UseSGen>true</UseSGen>\n    <UseRefCounting>true</UseRefCounting>\n    <CodeSignEntitlements>Entitlements.plist</CodeSignEntitlements>\n    <LinkMode>None</LinkMode>\n    <HttpClientHandler>HttpClientHandler</HttpClientHandler>\n    <XamMacArch></XamMacArch>\n    <AOTMode>None</AOTMode>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Mono.Options\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Mono.Options.dll</HintPath>\n    </Reference>\n    <Reference Include=\"OpenTK\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\xamarin-mac\\OpenTK.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"UnoCore\">\n      <HintPath>..\\..\\simulator\\common\\bin\\UnoCore.dll</HintPath>\n    </Reference>\n    <Reference Include=\"WindowsBase\" />\n    <Reference Include=\"Xamarin.Mac\" />\n    <Reference Include=\"Uno.Common\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\uno\\bin\\Uno.Common.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\Contents.json\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-128.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-128%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-16.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-16%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-256.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-256%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-32.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-32%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-512.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\AppIcon.appiconset\\AppIcon-512%402x.png\" />\n    <ImageAsset Include=\"Assets.xcassets\\Contents.json\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AppDelegate.cs\" />\n    <Compile Include=\"AppDelegate.designer.cs\">\n      <DependentUpon>AppDelegate.cs</DependentUpon>\n    </Compile>\n    <Compile Include=\"MonoMacEnums.cs\" />\n    <Compile Include=\"UnoHostControlImplementation.cs\" />\n    <Compile Include=\"UnoView\\MonoMacGL.cs\" />\n    <Compile Include=\"UnoView\\MonoMacGL.Dispose.cs\" />\n    <Compile Include=\"UnoView\\MonoMacEnums.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Protocol\\CocoaEventMessage.cs\" />\n    <Compile Include=\"UnoView\\RenderTargets\\IOSurfaceTexture.cs\" />\n    <Compile Include=\"DisplayLinkView.cs\" />\n    <Compile Include=\"UnoView\\EventProcesser.cs\" />\n    <Compile Include=\"UnoView\\RenderTargets\\IOSurfaceObject.cs\" />\n    <Compile Include=\"UnoView\\RenderTargets\\IOSurfaceFramebuffer.cs\" />\n    <Compile Include=\"UnoView\\RenderTargets\\IOSurfaceRenderTargetBuffer.cs\" />\n    <Compile Include=\"Protocol\\NewSurfaceMessage.cs\" />\n    <Compile Include=\"Protocol\\ResizeMessage.cs\" />\n    <Compile Include=\"UnoView\\RenderTargets\\IRenderTarget.cs\" />\n    <Compile Include=\"UnoView\\RenderTargets\\IOSurfaceRenderTarget.cs\" />\n    <Compile Include=\"UnoView\\UnoView.cs\" />\n    <Compile Include=\"FusionSupport\\EventIntercepter.cs\" />\n    <Compile Include=\"FusionSupport\\Quad.cs\" />\n    <Compile Include=\"FusionSupport\\ServerView.cs\" />\n    <Compile Include=\"FusionSupport\\ShaderHelper.cs\" />\n    <Compile Include=\"FusionSupport\\SurfaceCache.cs\" />\n    <Compile Include=\"FusionSupport\\SurfaceCacheItem.cs\" />\n    <Compile Include=\"FusionSupport\\TextureInfo.cs\" />\n    <Compile Include=\"FusionSupport\\UnoHostViewFactory.cs\" />\n    <Compile Include=\"UnoView\\RenderTargets\\BackbufferRenderTarget.cs\" />\n    <Compile Include=\"Dispatcher.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196b010d-ad36-4947-95aa-14fc4a27bd18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8DFB02E0-ACBF-4432-8DD9-56712E206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\mac\\Outracks.Fusion.Mac.csproj\">\n      <Project>{4b9ec6e2-aa97-48de-9891-2c1d24a4d383}</Project>\n      <Name>Outracks.Fusion.Mac</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\preview\\service\\fuse-preview.csproj\">\n      <Project>{59e1073a-9b45-41f3-ab94-958a9d18fb72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.UnoHost.csproj\">\n      <Project>{F2AEB321-51E5-40B8-9CF0-53C930E631F0}</Project>\n      <Name>Outracks.UnoHost</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"Entitlements.plist\" />\n    <None Include=\"Info.plist\" />\n    <None Include=\"packages.config\" />\n    <None Include=\"Resources\\Icon.icns\" />\n  </ItemGroup>\n  <Import Project=\"..\\..\\mac\\msbuild\\Xamarin.Mac.CSharp.targets\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n</Project>"
  },
  {
    "path": "src/unohost/mac/UnoHost.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=UnoHandles/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=UnoView/@EntryIndexedValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=UnoViews/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=UnoViews_005CUnoHandles/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=UnoView_005CUnoHandles/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/unohost/mac/UnoHostControlImplementation.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing Outracks.IO;\nusing Outracks.UnoHost;\nusing Outracks.UnoHost.Mac.FusionSupport;\n\nnamespace Outracks.Fusion.Mac\n{\n\tpublic class UnoHostControlFactory : IUnoHostControlFactory\n\t{\n\t\tpublic IUnoHostControl Create(\n\t\t\tAbsoluteFilePath assemblyPath,\n\t\t\tCommand onFocused,\n\t\t\tMenu contextMenu,\n\t\t\tAbsoluteFilePath userDataPath,\n\t\t\tIExternalApplication unoHostApp,\n\t\t\tAction<IUnoHostControl> initialize,\n\t\t\tAction<OpenGlVersion> gotVersion,\n\t\t\tparams string[] arguments)\n\t\t{\n\t\t\tvar dispatcher = Fusion.Application.MainThread;\n\n\t\t\tvar messagesToHost = new Subject<IBinaryMessage>();\n\n\t\t\tvar unoHost = UnoHostProcess.Spawn(assemblyPath, messagesToHost, userDataPath, unoHostApp, /*TODO*/new List<string>());\n\n\t\t\tvar control = new UnoHostControlImplementation()\n\t\t\t{\n\t\t\t\tDisposables = Disposable.Combine(unoHost),\n\t\t\t\tMessages = unoHost.Messages,\n\t\t\t\tMessagesTo = messagesToHost,\n\t\t\t\tProcess = unoHost.Process,\n\t\t\t};\n\n\t\t\tcontrol.Control =\n\t\t\t\tControl.Create(self =>\n\t\t\t\t{\n\t\t\t\t\tvar view = UnoHostViewFactory.Create(unoHost.Messages, messagesToHost);\n\n\t\t\t\t\tself.BindNativeDefaults(view.View, dispatcher);\n\n\t\t\t\t\tview.Focus\n\t\t\t\t\t\t.Where(foc => foc == FocusState.Focused)\n\t\t\t\t\t\t.WithLatestFromBuffered(onFocused.Execute.ConnectWhile(self.IsRooted), (_, c) => c)\n\t\t\t\t\t\t.Subscribe(c => c());\n\n\t\t\t\t\tunoHost.Messages\n\t\t\t\t\t\t.SelectMany(m => m.TryParse(Ready.MessageType, Ready.ReadDataFrom))\n\t\t\t\t\t\t.Take(1)\n\t\t\t\t\t\t.Subscribe(_ => initialize(control));\n\n\t\t\t\t\tunoHost.Messages\n\t\t\t\t\t\t.SelectSome(OpenGlVersionMessage.TryParse)\n\t\t\t\t\t\t.Subscribe(gotVersion);\n\n\t\t\t\t\tunoHost.Messages.Connect();\n\n\t\t\t\t\treturn view.View;\n\t\t\t\t}).SetContextMenu(contextMenu);\n\n\t\t\treturn control;\n\t\t}\n\t}\n\n\tclass UnoHostControlImplementation : IUnoHostControl\n\t{\n\t\tpublic IDisposable Disposables { get; set; }\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDisposables.Dispose();\n\t\t}\n\n\t\tpublic IConnectableObservable<IBinaryMessage> Messages { get; set; }\n\n\t\tpublic IObserver<IBinaryMessage> MessagesTo { get; set; }\n\n\t\tpublic IControl Control { get; set; }\n\t\tpublic IObservable<Process> Process { get; set; }\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/UnoView/EventProcesser.cs",
    "content": "using AppKit;\nusing CoreGraphics;\n\nnamespace Outracks.UnoHost.Mac.UnoView\n{\n\tstatic class EventProcesser\n\t{\n\t\t// TODO: move to Fusion.Mac, reverse dependency\n\t\tpublic static CGSize ToSize(this Size<Points> size)\n\t\t{\n\t\t\treturn new CGSize(size.Width, size.Height);\n\t\t}\n\n\t\tpublic static void SendEvent(NSView view, NSEvent nsEvent)\n\t\t{\n\t\t\tswitch (nsEvent.Type)\n\t\t\t{\n\t\t\t\t// Mouse left button\n\t\t\t\tcase NSEventType.LeftMouseDown: view.MouseDown(nsEvent); break;\n\t\t\t\tcase NSEventType.LeftMouseUp: view.MouseUp(nsEvent); break;\n\t\t\t\tcase NSEventType.LeftMouseDragged: view.MouseDragged(nsEvent); break;\n\n\t\t\t\t// Mouse right button\n\t\t\t\tcase NSEventType.RightMouseDown: view.RightMouseDown(nsEvent); break;\n\t\t\t\tcase NSEventType.RightMouseUp: view.RightMouseUp(nsEvent); break;\n\t\t\t\tcase NSEventType.RightMouseDragged: view.RightMouseDragged(nsEvent); break;\n\n\t\t\t\t// Mouse other button\n\t\t\t\tcase NSEventType.OtherMouseDown: view.OtherMouseDown(nsEvent); break;\n\t\t\t\tcase NSEventType.OtherMouseUp: view.OtherMouseUp(nsEvent); break;\n\t\t\t\tcase NSEventType.OtherMouseDragged: view.OtherMouseDragged(nsEvent); break;\n\n\t\t\t\t// Mouse move\n\t\t\t\tcase NSEventType.MouseEntered: view.MouseEntered(nsEvent); break;\n\t\t\t\tcase NSEventType.MouseMoved: view.MouseMoved(nsEvent); break;\n\t\t\t\tcase NSEventType.MouseExited: view.MouseExited(nsEvent); break;\n\n\t\t\t\t// Mouse scroll\n\t\t\t\tcase NSEventType.ScrollWheel: view.ScrollWheel(nsEvent); break;\n\n\t\t\t\t// Keys\n\t\t\t\tcase NSEventType.KeyDown: view.KeyDown(nsEvent); break;\n\n\t\t\t\tcase NSEventType.KeyUp: view.KeyUp(nsEvent); break;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/UnoView/MonoMacEnums.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing AppKit;\nusing Uno.Platform;\n\nnamespace Outracks.UnoHost.Mac.UnoView\n{\n\tpublic static class MonoMacEnums\n\t{\n\t\tpublic static Optional<Key> InterpretAsKeyEvent(this NSEvent theEvent)\n\t\t{\n\t\t\treturn ((NSKey)theEvent.KeyCode).ToKey()\n\t\t\t\t.Or(((NSFunctionKey)theEvent.KeyCode).ToKey());\n\t\t}\n\n\t\tpublic static Optional<string> InterpretAsTextEvent(this NSEvent theEvent)\n\t\t{\n\t\t\tif (!IsTextInputEvent(theEvent.ModifierFlags))\n\t\t\t\treturn Optional.None();\n\n\t\t\tvar characters = theEvent.Characters.Where(CharacterIsNotSpecial).ToArray();\n\t\t\tif (characters.Length == 0)\n\t\t\t\treturn Optional.None();\n\n\t\t\treturn new String(characters);\n\t\t}\n\n\t\tstatic bool IsTextInputEvent(NSEventModifierMask modifierFlags)\n\t\t{\n\t\t\treturn (modifierFlags & NSEventModifierMask.CommandKeyMask) == 0;\n\t\t}\n\n\t\tstatic bool CharacterIsNotSpecial(char character)\n\t\t{\n\t\t\treturn char.IsLetterOrDigit(character) || char.IsSymbol(character) || char.IsWhiteSpace(character) || char.IsPunctuation(character) || char.IsNumber(character) || char.IsSeparator(character);\n\t\t}\n\n\t\t/*\n\t\tpublic static NSEventModifierMask ToNSEventModifierMask(this ModifierKeys keys)\n\t\t{\n\t\t\tvar mask = (NSEventModifierMask)0;\n\n\t\t\tif (keys.HasFlag (ModifierKeys.Alt))\n\t\t\t\tmask |= NSEventModifierMask.AlternateKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Command))\n\t\t\t\tmask |= NSEventModifierMask.CommandKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Control))\n\t\t\t\tmask |= NSEventModifierMask.ControlKeyMask;\n\t\t\tif (keys.HasFlag (ModifierKeys.Shift))\n\t\t\t\tmask |= NSEventModifierMask.ShiftKeyMask;\n\n\t\t\treturn mask;\n\t\t}\n\n\t\tpublic static ModifierKeys ToModifierKeys(this NSEventModifierMask mask)\n\t\t{\n\t\t\tvar keys = ModifierKeys.None;\n\n\t\t\tif (mask.HasFlag (NSEventModifierMask.CommandKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Command | ModifierKeys.Meta;\n\t\t\tif (mask.HasFlag (NSEventModifierMask.ControlKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Control;\n\t\t\tif (mask.HasFlag (NSEventModifierMask.ShiftKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Shift;\n\t\t\tif (mask.HasFlag (NSEventModifierMask.AlternateKeyMask))\n\t\t\t\tkeys |= ModifierKeys.Alt;\n\n\t\t\treturn keys;\n\t\t}\n\t\t*/\n\t\tpublic static MouseButtons ToMouseButtons(this uint nsButtons)\n\t\t{\n\t\t\tvar buttons = MouseButtons.None;\n\n\t\t\tif ((nsButtons & (1 << 0)) != 0)\n\t\t\t\tbuttons |= MouseButtons.Left;\n\t\t\tif ((nsButtons & (1 << 1)) != 0)\n\t\t\t\tbuttons |= MouseButtons.Right;\n\t\t\tif ((nsButtons & (1 << 2)) != 0)\n\t\t\t\tbuttons |= MouseButtons.Middle;\n\t\t\t// TODO: maybe incorrect\n\t\t\treturn buttons;\n\t\t}\n\t\t/*\n\t\tpublic static string ToKeyEquivalent (this Key key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase Key.None: return \"\";\n\t\t\t\tcase Key.Space: return \" \";\n\t\t\t\tcase Key.D0: return \"0\";\n\t\t\t\tcase Key.D1: return \"1\";\n\t\t\t\tcase Key.D2: return \"2\";\n\t\t\t\tcase Key.D3: return \"3\";\n\t\t\t\tcase Key.D4: return \"4\";\n\t\t\t\tcase Key.D5: return \"5\";\n\t\t\t\tcase Key.D6: return \"6\";\n\t\t\t\tcase Key.D7: return \"7\";\n\t\t\t\tcase Key.D8: return \"8\";\n\t\t\t\tcase Key.D9: return \"9\";\n\t\t\t\tcase Key.Plus: return \"+\";\n\t\t\t\tcase Key.Minus: return \"-\";\n\t\t\t\tcase Key.NumPad0: return \"0\";\n\t\t\t\tcase Key.NumPad1: return \"1\";\n\t\t\t\tcase Key.NumPad2: return \"2\";\n\t\t\t\tcase Key.NumPad3: return \"3\";\n\t\t\t\tcase Key.NumPad4: return \"4\";\n\t\t\t\tcase Key.NumPad5: return \"5\";\n\t\t\t\tcase Key.NumPad6: return \"6\";\n\t\t\t\tcase Key.NumPad7: return \"7\";\n\t\t\t\tcase Key.NumPad8: return \"8\";\n\t\t\t\tcase Key.NumPad9: return \"9\";\n\t\t\t\tcase Key.Add: return \"+\";\n\t\t\t\tcase Key.Subtract: return \"-\";\n\t\t\t}\n\t\t\treturn key.ToString ().ToLower ();\n\t\t}\n\t\t*/\n\n\t\tpublic static Optional<Key> ToKey(this NSKey key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase NSKey.Delete:\n\t\t\t\t\treturn Key.Backspace;\n\t\t\t\tcase NSKey.Tab:\n\t\t\t\t\treturn Key.Tab;\n\t\t\t\tcase NSKey.Return:\n\t\t\t\t\treturn Key.Enter;\n\t\t\t\tcase NSKey.Shift:\n\t\t\t\tcase NSKey.RightShift:\n\t\t\t\t\treturn Key.ShiftKey;\n\t\t\t\tcase NSKey.Control:\n\t\t\t\tcase NSKey.RightControl:\n\t\t\t\t\treturn Key.ControlKey;\n\n\t\t\t\tcase NSKey.CapsLock:\n\t\t\t\t\treturn Key.CapsLock;\n\n\t\t\t\tcase NSKey.Escape:\n\t\t\t\t\treturn Key.Escape;\n\n\t\t\t\tcase NSKey.Space:\n\t\t\t\t\treturn Key.Space;\n\n\t\t\t\tcase NSKey.PageUp:\n\t\t\t\t\treturn Key.PageUp;\n\n\t\t\t\tcase NSKey.PageDown:\n\t\t\t\t\treturn Key.PageDown;\n\n\t\t\t\tcase NSKey.End:\n\t\t\t\t\treturn Key.End;\n\n\t\t\t\tcase NSKey.Home:\n\t\t\t\t\treturn Key.Home;\n\n\t\t\t\tcase NSKey.LeftArrow:\n\t\t\t\t\treturn Key.Left;\n\n\t\t\t\tcase NSKey.UpArrow:\n\t\t\t\t\treturn Key.Up;\n\n\t\t\t\tcase NSKey.RightArrow:\n\t\t\t\t\treturn Key.Right;\n\n\t\t\t\tcase NSKey.DownArrow:\n\t\t\t\t\treturn Key.Down;\n\n\t\t\t\tcase NSKey.ForwardDelete:\n\t\t\t\t\treturn Key.Delete;\n\n\t\t\t\tcase NSKey.D0:\n\t\t\t\t\treturn Key.D0;\n\n\t\t\t\tcase NSKey.D1:\n\t\t\t\t\treturn Key.D1;\n\n\t\t\t\tcase NSKey.D2:\n\t\t\t\t\treturn Key.D2;\n\n\t\t\t\tcase NSKey.D3:\n\t\t\t\t\treturn Key.D3;\n\n\t\t\t\tcase NSKey.D4:\n\t\t\t\t\treturn Key.D4;\n\n\t\t\t\tcase NSKey.D5:\n\t\t\t\t\treturn Key.D5;\n\n\t\t\t\tcase NSKey.D6:\n\t\t\t\t\treturn Key.D6;\n\n\t\t\t\tcase NSKey.D7:\n\t\t\t\t\treturn Key.D7;\n\n\t\t\t\tcase NSKey.D8:\n\t\t\t\t\treturn Key.D8;\n\n\t\t\t\tcase NSKey.D9:\n\t\t\t\t\treturn Key.D9;\n\n\t\t\t\tcase NSKey.A:\n\t\t\t\t\treturn Key.A;\n\n\t\t\t\tcase NSKey.B:\n\t\t\t\t\treturn Key.B;\n\n\t\t\t\tcase NSKey.C:\n\t\t\t\t\treturn Key.C;\n\n\t\t\t\tcase NSKey.D:\n\t\t\t\t\treturn Key.D;\n\n\t\t\t\tcase NSKey.E:\n\t\t\t\t\treturn Key.E;\n\n\t\t\t\tcase NSKey.F:\n\t\t\t\t\treturn Key.F;\n\n\t\t\t\tcase NSKey.G:\n\t\t\t\t\treturn Key.G;\n\n\t\t\t\tcase NSKey.H:\n\t\t\t\t\treturn Key.H;\n\n\t\t\t\tcase NSKey.I:\n\t\t\t\t\treturn Key.I;\n\n\t\t\t\tcase NSKey.J:\n\t\t\t\t\treturn Key.J;\n\n\t\t\t\tcase NSKey.K:\n\t\t\t\t\treturn Key.K;\n\n\t\t\t\tcase NSKey.L:\n\t\t\t\t\treturn Key.L;\n\n\t\t\t\tcase NSKey.M:\n\t\t\t\t\treturn Key.M;\n\n\t\t\t\tcase NSKey.N:\n\t\t\t\t\treturn Key.N;\n\n\t\t\t\tcase NSKey.O:\n\t\t\t\t\treturn Key.O;\n\n\t\t\t\tcase NSKey.P:\n\t\t\t\t\treturn Key.P;\n\n\t\t\t\tcase NSKey.Q:\n\t\t\t\t\treturn Key.Q;\n\n\t\t\t\tcase NSKey.R:\n\t\t\t\t\treturn Key.R;\n\n\t\t\t\tcase NSKey.S:\n\t\t\t\t\treturn Key.S;\n\n\t\t\t\tcase NSKey.T:\n\t\t\t\t\treturn Key.T;\n\n\t\t\t\tcase NSKey.U:\n\t\t\t\t\treturn Key.U;\n\n\t\t\t\tcase NSKey.V:\n\t\t\t\t\treturn Key.V;\n\n\t\t\t\tcase NSKey.W:\n\t\t\t\t\treturn Key.W;\n\n\t\t\t\tcase NSKey.X:\n\t\t\t\t\treturn Key.X;\n\n\t\t\t\tcase NSKey.Y:\n\t\t\t\t\treturn Key.Y;\n\t\t\t\tcase NSKey.Z:\n\t\t\t\t\treturn Key.Z;\n\n\t\t\t\tcase NSKey.Keypad0:\n\t\t\t\t\treturn Key.NumPad0;\n\n\t\t\t\tcase NSKey.Keypad1:\n\t\t\t\t\treturn Key.NumPad1;\n\n\t\t\t\tcase NSKey.Keypad2:\n\t\t\t\t\treturn Key.NumPad2;\n\n\t\t\t\tcase NSKey.Keypad3:\n\t\t\t\t\treturn Key.NumPad3;\n\n\t\t\t\tcase NSKey.Keypad4:\n\t\t\t\t\treturn Key.NumPad4;\n\n\t\t\t\tcase NSKey.Keypad5:\n\t\t\t\t\treturn Key.NumPad5;\n\n\t\t\t\tcase NSKey.Keypad6:\n\t\t\t\t\treturn Key.NumPad6;\n\n\t\t\t\tcase NSKey.Keypad7:\n\t\t\t\t\treturn Key.NumPad7;\n\n\t\t\t\tcase NSKey.Keypad8:\n\t\t\t\t\treturn Key.NumPad8;\n\n\t\t\t\tcase NSKey.Keypad9:\n\t\t\t\t\treturn Key.NumPad9;\n\n\t\t\t\tcase NSKey.F1:\n\t\t\t\t\treturn Key.F1;\n\n\t\t\t\tcase NSKey.F2:\n\t\t\t\t\treturn Key.F2;\n\n\t\t\t\tcase NSKey.F3:\n\t\t\t\t\treturn Key.F3;\n\n\t\t\t\tcase NSKey.F4:\n\t\t\t\t\treturn Key.F4;\n\n\t\t\t\tcase NSKey.F5:\n\t\t\t\t\treturn Key.F5;\n\n\t\t\t\tcase NSKey.F6:\n\t\t\t\t\treturn Key.F6;\n\n\t\t\t\tcase NSKey.F7:\n\t\t\t\t\treturn Key.F7;\n\n\t\t\t\tcase NSKey.F8:\n\t\t\t\t\treturn Key.F8;\n\n\t\t\t\tcase NSKey.F9:\n\t\t\t\t\treturn Key.F9;\n\n\t\t\t\tcase NSKey.F10:\n\t\t\t\t\treturn Key.F10;\n\n\t\t\t\tcase NSKey.F11:\n\t\t\t\t\treturn Key.F11;\n\n\t\t\t\tcase NSKey.F12:\n\t\t\t\t\treturn Key.F12;\n\n\t\t\t\tcase NSKey.Command:\n\t\t\t\t\treturn Key.OSKey;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\n\t\tpublic static Optional<Key> ToKey(this NSFunctionKey key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase NSFunctionKey.Menu:\n\t\t\t\t\treturn Key.AltKey;\n\n\t\t\t\tcase NSFunctionKey.Break:\n\t\t\t\t\treturn Key.Break;\n\n\t\t\t\tcase NSFunctionKey.Insert:\n\t\t\t\t\treturn Key.Insert;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn Optional.None();\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "src/unohost/mac/UnoView/MonoMacGL.Dispose.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing OpenTK.Graphics.OpenGL;\n\nnamespace Outracks.UnoHost.Mac.UnoView\n{\n\tpartial class MonoMacGL\n\t{\n\t\tvoid AddContextObject(TextureDisposable obj) { _textures.AddLast(obj); }\n\t\tvoid AddContextObject(FramebufferDisposable obj) { _framebuffers.AddLast(obj); }\n\t\tvoid AddContextObject(BufferDisposable obj) { _buffers.AddLast(obj); }\n\t\tvoid AddContextObject(RenderbufferDisposable obj) { _renderbuffers.AddLast(obj); }\n\t\tvoid AddContextObject(ShaderDisposable obj) { _shaders.AddLast(obj); }\n\t\tvoid AddContextObject(ProgramDisposable obj) { _programs.AddLast(obj); }\n\n\t\tpublic void DisposeContext()\n\t\t{\n\t\t\tDisposeAndRemoveObjects(_textures);\n\t\t\tDisposeAndRemoveObjects(_framebuffers);\n\t\t\tDisposeAndRemoveObjects(_buffers);\n\t\t\tDisposeAndRemoveObjects(_renderbuffers);\n\t\t\tDisposeAndRemoveObjects(_shaders);\n\t\t\tDisposeAndRemoveObjects(_programs);\n\t\t}\n\n\t\tvoid DisposeAndRemoveObject<T>(LinkedList<T> objects, int handle) where T : IContextObjectDisposable\n\t\t{\n\t\t\tvar obj = objects.FirstOrDefault(o => o.HandleName == handle);\n\t\t\tif (obj == null) throw new Exception(\"Trying to dispose object not created by this instance of IGL\");\n\t\t\tobj.Dispose();\n\t\t\tobjects.Remove(obj);\n\t\t}\n\n\t\tvoid DisposeAndRemoveObjects<T>(LinkedList<T> objects) where T : IContextObjectDisposable\n\t\t{\n\t\t\tforeach (var obj in objects) obj.Dispose();\n\t\t\tobjects.Clear();\n\t\t}\n\n\t\tinterface IContextObjectDisposable\n\t\t{\n\t\t\tint HandleName { get; }\n\n\t\t\tvoid Dispose();\n\t\t}\n\n\t\tclass TextureDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic TextureDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteTexture(HandleName);\n\t\t\t}\n\t\t}\n\n\t\tclass FramebufferDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic FramebufferDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tvar handle = HandleName;\n\t\t\t\tGL.DeleteFramebuffers(1, ref handle);\n\t\t\t}\n\t\t}\n\n\t\tclass BufferDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic BufferDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tvar handle = HandleName;\n\t\t\t\tGL.DeleteBuffers(1, ref handle);\n\t\t\t}\n\t\t}\n\n\t\tclass RenderbufferDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic RenderbufferDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tvar handle = HandleName;\n\t\t\t\tGL.DeleteRenderbuffers(1, ref handle);\n\t\t\t}\n\t\t}\n\n\t\tclass ShaderDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic ShaderDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteShader(HandleName);\n\t\t\t}\n\t\t}\n\n\t\tclass ProgramDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic ProgramDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\t// OMG! MonoMac doesn´t expose GL.DeleteProgram(HandleName), and instead exposes a NV only extension...\n\t\t\t\t// A pull request will be made. For now let it be a memory leak.\n\t\t\t\t// Also MonoMac hasn´t released anything since 2011.\n\t\t\t\t//   -- Emil\n\t\t\t\t// Update: this is still a problem in 2017 using the latest OpenTK released by the Xamarin guys...Insane\n\t\t\t\t//OpenGL.GL.DeleteProgram(HandleName);\n\t\t\t}\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "src/unohost/mac/UnoView/MonoMacGL.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Security;\nusing OpenGL;\nusing OpenTK.Graphics.OpenGL;\nusing Uno;\nusing GL = OpenTK.Graphics.OpenGL.GL;\n\n#pragma warning disable 3019\n#pragma warning disable 1591\n#pragma warning disable 1572\n#pragma warning disable 1573\n\n\nnamespace Outracks.UnoHost.Mac.UnoView\n{\n\tpublic partial class MonoMacGL : IGL\n\t{\n\t\tinternal const string Library = \"/System/Library/Frameworks/OpenGL.framework/OpenGL\";\n\t\t[SuppressUnmanagedCodeSecurity()]\n\t\t[DllImport(Library, EntryPoint = \"glGenerateMipmap\", ExactSpelling = true)]\n\t\tinternal extern static void glGenerateMipmap(GenerateMipmapTarget target);\n\n\t\t// Note: Workaround for InvalidProgramException\n\t\tGLFramebufferHandle _currentFramebufferBinding;\n\t\tGLRenderbufferHandle _currentRenderbufferBinding;\n\n\t\treadonly LinkedList<TextureDisposable> _textures = new LinkedList<TextureDisposable>();\n\t\treadonly LinkedList<FramebufferDisposable> _framebuffers = new LinkedList<FramebufferDisposable>();\n\t\treadonly LinkedList<BufferDisposable> _buffers = new LinkedList<BufferDisposable>();\n\t\treadonly LinkedList<RenderbufferDisposable> _renderbuffers = new LinkedList<RenderbufferDisposable>();\n\t\treadonly LinkedList<ShaderDisposable> _shaders = new LinkedList<ShaderDisposable>();\n\t\treadonly LinkedList<ProgramDisposable> _programs = new LinkedList<ProgramDisposable>();\n\n\t\tpublic MonoMacGL()\n\t\t{\n\t\t\tGL.Enable(EnableCap.VertexProgramPointSize);\n\t\t\tGL.Enable(EnableCap.Texture2D);\n\t\t\tGL.Enable(EnableCap.TextureCubeMap);\n\t\t}\n\n\t\tpublic GLError GetError()\n\t\t{\n\t\t\treturn (GLError)GL.GetError();\n\t\t}\n\n\t\tpublic int GetInteger(GLIntegerName pname)\n\t\t{\n\t\t\tint result;\n\t\t\tGL.GetInteger((GetPName)pname, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic Int4 GetInteger(GLInteger4Name name)\n\t\t{\n\t\t\tvar v = new int[4];\n\t\t\tGL.GetInteger((GetPName)name, v);\n\t\t\treturn new Int4(v[0], v[1], v[2], v[3]);\n\t\t}\n\n\t\tpublic void Finish()\n\t\t{\n\t\t\tGL.Finish ();\n\t\t}\n\n\t\tpublic void Flush()\n\t\t{\n\t\t\tGL.Flush ();\n\t\t}\n\n\t\tpublic bool HasGetShaderPrecisionFormat { get { return false; }}\n\n\t\tpublic GLShaderPrecisionFormat GetShaderPrecisionFormat(GLShaderType shader, GLShaderPrecision precision)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\n\t\tpublic GLFramebufferStatus CheckFramebufferStatus(GLFramebufferTarget target)\n\t\t{\n\t\t\treturn (GLFramebufferStatus)GL.CheckFramebufferStatus((FramebufferTarget)target);\n\t\t}\n\n\t\tpublic void Clear(GLClearBufferMask mask)\n\t\t{\n\t\t\tGL.Clear((ClearBufferMask)mask);\n\t\t}\n\n\t\tpublic void ClearColor(float red, float green, float blue, float alpha)\n\t\t{\n\t\t\tGL.ClearColor(red, green, blue, alpha);\n\t\t}\n\n\t\tpublic void ClearDepth(float depth)\n\t\t{\n\t\t\t// Note: Must cast to double, else OpenTK will call glClearDepthf which is not available on ATI drivers\n\t\t\tGL.ClearDepth((double)depth);\n\t\t}\n\n\t\tpublic void ColorMask(bool red, bool green, bool blue, bool alpha)\n\t\t{\n\t\t\tGL.ColorMask(red, green, blue, alpha);\n\t\t}\n\n\t\tpublic void DepthMask(bool flag)\n\t\t{\n\t\t\tGL.DepthMask(flag);\n\t\t}\n\n\t\tpublic GLTextureHandle CreateTexture()\n\t\t{\n\t\t\tvar texture = GL.GenTexture();\n\t\t\tAddContextObject(new TextureDisposable (texture));\n\t\t\treturn (GLTextureHandle) texture;\n\t\t}\n\n\t\tpublic void DeleteTexture(GLTextureHandle texture)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_textures, (int) texture);\n\t\t}\n\n\t\tpublic void ActiveTexture(GLTextureUnit texture)\n\t\t{\n\t\t\tGL.ActiveTexture((TextureUnit)texture);\n\t\t}\n\n\t\tpublic void BindTexture(GLTextureTarget target, GLTextureHandle texture)\n\t\t{\n\t\t\tGL.BindTexture((TextureTarget)target, (int) texture);\n\t\t}\n\n\t\tpublic void TexParameter(GLTextureTarget target, GLTextureParameterName pname, GLTextureParameterValue param)\n\t\t{\n\t\t\tGL.TexParameter((TextureTarget)target, (TextureParameterName)pname, (int)param);\n\t\t}\n\n\t\tpublic void TexImage2D(GLTextureTarget target, int level, GLPixelFormat internalFormat, int width, int height, int border, GLPixelFormat format, GLPixelType type, IntPtr data)\n\t\t{\n\t\t\tGL.TexImage2D(\n\t\t\t\t(TextureTarget)target, level,\n\t\t\t\t(PixelInternalFormat)internalFormat, width, height, border,\n\t\t\t\t(PixelFormat)format, (PixelType)type,\n\t\t\t\tdata);\n\t\t}\n\n\t\tpublic void TexSubImage2D(GLTextureTarget target, int level, int xoffset, int yoffset, int width, int height, GLPixelFormat format, GLPixelType type, IntPtr data)\n\t\t{\n\t\t\tGL.TexSubImage2D((TextureTarget)target, level,\n\t\t\t\txoffset, yoffset, width, height,\n\t\t\t\t(PixelFormat)format, (PixelType)type,\n\t\t\t\tdata);\n\t\t}\n\n\t\tpublic void GenerateMipmap(GLTextureTarget target)\n\t\t{\n\t\t\tglGenerateMipmap((GenerateMipmapTarget)target);\n\t\t}\n\n\t\tpublic void PixelStore(GLPixelStoreParameter pname, int param)\n\t\t{\n\t\t\tGL.PixelStore((PixelStoreParameter)pname, param);\n\t\t}\n\n\t\tpublic GLRenderbufferHandle CreateRenderbuffer()\n\t\t{\n\t\t\tint r;\n\t\t\tGL.GenRenderbuffers(1, out r);\n\t\t\tAddContextObject(new RenderbufferDisposable (r));\n\t\t\treturn (GLRenderbufferHandle) r;\n\t\t}\n\n\t\tpublic void DeleteRenderbuffer(GLRenderbufferHandle renderbuffer)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_renderbuffers, (int) renderbuffer);\n\t\t}\n\n\t\tpublic void BindRenderbuffer(GLRenderbufferTarget target, GLRenderbufferHandle renderbuffer)\n\t\t{\n\t\t\t_currentRenderbufferBinding = renderbuffer;\n\t\t\tGL.BindRenderbuffer((RenderbufferTarget)target, (int) renderbuffer);\n\t\t}\n\n\t\tpublic void RenderbufferStorage(GLRenderbufferTarget target, GLRenderbufferStorage internalFormat, int width, int height)\n\t\t{\n\t\t\tGL.RenderbufferStorage(\n\t\t\t\t(RenderbufferTarget)target,\n\t\t\t\t(RenderbufferStorage)internalFormat,\n\t\t\t\twidth, height);\n\t\t}\n\n\t\tpublic GLFramebufferHandle CreateFramebuffer()\n\t\t{\n\t\t\tint r;\n\t\t\tGL.GenFramebuffers(1, out r);\n\t\t\tAddContextObject(new FramebufferDisposable (r));\n\t\t\treturn (GLFramebufferHandle) r;\n\t\t}\n\n\t\tpublic void DeleteFramebuffer(GLFramebufferHandle fb)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_framebuffers, (int) fb);\n\t\t}\n\n\t\tpublic void BindFramebuffer(GLFramebufferTarget target, GLFramebufferHandle fb)\n\t\t{\n\t\t\t_currentFramebufferBinding = fb;\n\t\t\tGL.BindFramebuffer((FramebufferTarget)target, (int) fb);\n\t\t}\n\n\t\tpublic void FramebufferTexture2D(GLFramebufferTarget target, GLFramebufferAttachment attachment, GLTextureTarget textarget, GLTextureHandle texture, int level)\n\t\t{\n\t\t\tGL.FramebufferTexture2D(\n\t\t\t\t(FramebufferTarget)target,\n\t\t\t\t(FramebufferAttachment)attachment,\n\t\t\t\t(TextureTarget)textarget, (int) texture, level);\n\t\t}\n\n\t\tpublic void FramebufferRenderbuffer(GLFramebufferTarget target, GLFramebufferAttachment attachment, GLRenderbufferTarget renderbuffertarget, GLRenderbufferHandle renderbuffer)\n\t\t{\n\t\t\tGL.FramebufferRenderbuffer(\n\t\t\t\t(FramebufferTarget)target,\n\t\t\t\t(FramebufferAttachment)attachment,\n\t\t\t\t(RenderbufferTarget)renderbuffertarget, (int) renderbuffer);\n\t\t}\n\n\t\tpublic void UseProgram(GLProgramHandle program)\n\t\t{\n\t\t\tGL.UseProgram((int) program);\n\t\t}\n\n\t\tpublic void BindAttribLocation(GLProgramHandle handle, int index, string name)\n\t\t{\n\t\t\tGL.BindAttribLocation((int) handle, index, name);\n\t\t}\n\n\t\tpublic int GetAttribLocation(GLProgramHandle program, string name)\n\t\t{\n\t\t\treturn GL.GetAttribLocation((int) program, name);\n\t\t}\n\n\t\tpublic int GetUniformLocation(GLProgramHandle program, string name)\n\t\t{\n\t\t\treturn GL.GetUniformLocation((int) program, name);\n\t\t}\n\n\t\tpublic void Uniform1(int location, int value)\n\t\t{\n\t\t\tGL.Uniform1(location, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Int2 value)\n\t\t{\n\t\t\tGL.Uniform2(location, value.X, value.Y);\n\t\t}\n\n\t\tpublic void Uniform3(int location, Int3 value)\n\t\t{\n\t\t\tGL.Uniform3(location, value.X, value.Y, value.Z);\n\t\t}\n\n\t\tpublic void Uniform4(int location, Int4 value)\n\t\t{\n\t\t\tGL.Uniform4(location, value.X, value.Y, value.Z, value.W);\n\t\t}\n\n\t\tpublic void Uniform1(int location, float value)\n\t\t{\n\t\t\tGL.Uniform1(location, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Float2 value)\n\t\t{\n\t\t\tGL.Uniform2(location, value.X, value.Y);\n\t\t}\n\n\t\tpublic void Uniform3(int location, Float3 value)\n\t\t{\n\t\t\tGL.Uniform3(location, value.X, value.Y, value.Z);\n\t\t}\n\n\t\tpublic void Uniform4(int location, Float4 value)\n\t\t{\n\t\t\tGL.Uniform4(location, value.X, value.Y, value.Z, value.W);\n\t\t}\n\n\t\tpublic void UniformMatrix2(int location, bool transpose, Float2x2 value)\n\t\t{\n\t\t\tGL.UniformMatrix2(location, 1, transpose, ref value.M11);\n\t\t}\n\n\t\tpublic void UniformMatrix3(int location, bool transpose, Float3x3 value)\n\t\t{\n\t\t\tGL.UniformMatrix3(location, 1, transpose, ref value.M11);\n\t\t}\n\n\t\tpublic void UniformMatrix4(int location, bool transpose, Float4x4 value)\n\t\t{\n\t\t\tGL.UniformMatrix4(location, 1, transpose, ref value.M11);\n\t\t}\n\n\t\tpublic void Uniform1(int location, int[] value)\n\t\t{\n\t\t\tGL.Uniform1(location, value.Length, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Int2[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (int* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform2(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform3(int location, Int3[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (int* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform3(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform4(int location, Int4[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (int* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform4(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform1(int location, float[] value)\n\t\t{\n\t\t\tGL.Uniform1(location, value.Length, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Float2[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (float* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform2(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform3(int location, Float3[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (float* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform3(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform4(int location, Float4[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (float* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform4(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void UniformMatrix2(int location, bool transpose, Float2x2[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t\tGL.UniformMatrix2(location, value.Length, transpose, ref value[0].M11);\n\t\t}\n\n\t\tpublic void UniformMatrix3(int location, bool transpose, Float3x3[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t\tGL.UniformMatrix3(location, value.Length, transpose, ref value[0].M11);\n\t\t}\n\n\t\tpublic void UniformMatrix4(int location, bool transpose, Float4x4[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t\tGL.UniformMatrix4(location, value.Length, transpose, ref value[0].M11);\n\t\t}\n\n\t\tpublic void EnableVertexAttribArray(int index)\n\t\t{\n\t\t\tGL.EnableVertexAttribArray(index);\n\t\t}\n\n\t\tpublic void DisableVertexAttribArray(int index)\n\t\t{\n\t\t\tGL.DisableVertexAttribArray(index);\n\t\t}\n\n\t\tpublic void VertexAttribPointer(int index, int size, GLDataType type, bool normalized, int stride, int offset)\n\t\t{\n\t\t\tGL.VertexAttribPointer(index, size, (VertexAttribPointerType)type, normalized, stride, offset);\n\t\t}\n\n\t\tpublic void DrawArrays(GLPrimitiveType mode, int first, int count)\n\t\t{\n\t\t\tGL.DrawArrays((BeginMode)mode, first, count);\n\t\t}\n\n\t\tpublic void DrawElements(GLPrimitiveType mode, int count, GLIndexType type, int offset)\n\t\t{\n\t\t\tGL.DrawElements((BeginMode)mode, count, (DrawElementsType)type, offset);\n\t\t}\n\n\t\tpublic GLBufferHandle CreateBuffer()\n\t\t{\n\t\t\tint r;\n\t\t\tGL.GenBuffers(1, out r);\n\t\t\tAddContextObject(new BufferDisposable (r));\n\t\t\treturn (GLBufferHandle) r;\n\t\t}\n\n\t\tpublic void DeleteBuffer(GLBufferHandle buffer)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_buffers, (int) buffer);\n\t\t}\n\n\t\tpublic void BindBuffer(GLBufferTarget target, GLBufferHandle buffer)\n\t\t{\n\t\t\tGL.BindBuffer((BufferTarget)target, (int) buffer);\n\t\t}\n\n\t\tpublic void BufferData(GLBufferTarget target, int sizeInBytes, IntPtr data, GLBufferUsage usage)\n\t\t{\n\t\t\tGL.BufferData((BufferTarget)target, (IntPtr)sizeInBytes, data, (BufferUsageHint)usage);\n\t\t}\n\n\t\tpublic void BufferSubData(GLBufferTarget target, int offset, int sizeInBytes, IntPtr data)\n\t\t{\n\t\t\tGL.BufferSubData((BufferTarget)target, (IntPtr)offset, (IntPtr)sizeInBytes, data);\n\t\t}\n\n\t\tpublic void Enable(GLEnableCap cap)\n\t\t{\n\t\t\tGL.Enable((EnableCap)cap);\n\t\t}\n\n\t\tpublic void Disable(GLEnableCap cap)\n\t\t{\n\t\t\tGL.Disable((EnableCap)cap);\n\t\t}\n\n\t\tpublic bool IsEnabled(GLEnableCap cap)\n\t\t{\n\t\t\treturn GL.IsEnabled((EnableCap)cap);\n\t\t}\n\n\t\tpublic void BlendFunc(GLBlendingFactor src, GLBlendingFactor dst)\n\t\t{\n\t\t\tGL.BlendFunc((BlendingFactorSrc)src, (BlendingFactorDest)dst);\n\t\t}\n\n\t\tpublic void BlendFuncSeparate(GLBlendingFactor srcRGB, GLBlendingFactor dstRGB, GLBlendingFactor srcAlpha, GLBlendingFactor dstAlpha)\n\t\t{\n\t\t\tGL.BlendFuncSeparate(\n\t\t\t\t(BlendingFactorSrc)srcRGB, (BlendingFactorDest)dstRGB,\n\t\t\t\t(BlendingFactorSrc)srcAlpha, (BlendingFactorDest)dstAlpha);\n\t\t}\n\n\t\tpublic void BlendEquation(GLBlendEquation mode)\n\t\t{\n\t\t\tGL.BlendEquation((BlendEquationMode)mode);\n\t\t}\n\n\t\tpublic void BlendEquationSeparate(GLBlendEquation modeRgb, GLBlendEquation modeAlpha)\n\t\t{\n\t\t\tGL.BlendEquationSeparate((BlendEquationMode)modeRgb, (BlendEquationMode)modeAlpha);\n\t\t}\n\n\t\tpublic void CullFace(GLCullFaceMode mode)\n\t\t{\n\t\t\tGL.CullFace((CullFaceMode)mode);\n\t\t}\n\n\t\tpublic void FrontFace(GLFrontFaceDirection mode)\n\t\t{\n\t\t\tGL.FrontFace((FrontFaceDirection)mode);\n\t\t}\n\n\t\tpublic void DepthFunc(GLDepthFunction func)\n\t\t{\n\t\t\tGL.DepthFunc((DepthFunction)func);\n\t\t}\n\n\t\tpublic void Scissor(int x, int y, int width, int height)\n\t\t{\n\t\t\tGL.Scissor(x, y, width, height);\n\t\t}\n\n\t\tpublic void Viewport(int x, int y, int width, int height)\n\t\t{\n\t\t\tGL.Viewport(x, y, width, height);\n\t\t}\n\n\t\tpublic void LineWidth(float width)\n\t\t{\n\t\t\tGL.LineWidth(width);\n\t\t}\n\n\t\tpublic void PolygonOffset(float factor, float units)\n\t\t{\n\t\t\tGL.PolygonOffset(factor, units);\n\t\t}\n\n\t\tpublic void DepthRange(float zNear, float zFar)\n\t\t{\n\t\t\tGL.DepthRange(zNear, zFar);\n\t\t}\n\n\t\tpublic GLShaderHandle CreateShader(GLShaderType type)\n\t\t{\n\t\t\tvar shader = GL.CreateShader((ShaderType)type);\n\t\t\tAddContextObject(new ShaderDisposable (shader));\n\t\t\treturn (GLShaderHandle) shader;\n\t\t}\n\n\t\tpublic void DeleteShader(GLShaderHandle shader)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_shaders, (int) shader);\n\t\t}\n\n\t\tpublic void ShaderSource(GLShaderHandle shader, string source)\n\t\t{\n\t\t\tGL.ShaderSource((int) shader, source);\n\t\t}\n\n\t\tpublic void ReadPixels(int x, int y, int width, int height, GLPixelFormat format, GLPixelType type, byte[] buffer)\n\t\t{\n\t\t\tGL.ReadPixels(x, y, width, height, (PixelFormat)format, (PixelType)type, buffer);\n\t\t}\n\n\t\tpublic void CompileShader(GLShaderHandle shader)\n\t\t{\n\t\t\tGL.CompileShader((int) shader);\n\t\t}\n\n\t\tpublic int GetShaderParameter(GLShaderHandle shader, GLShaderParameter pname)\n\t\t{\n\t\t\tint result;\n\t\t\tGL.GetShader((int) shader, (ShaderParameter)pname, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic string GetShaderInfoLog(GLShaderHandle shader)\n\t\t{\n\t\t\treturn GL.GetShaderInfoLog((int) shader);\n\t\t}\n\n\t\tpublic GLProgramHandle CreateProgram()\n\t\t{\n\t\t\tvar program = GL.CreateProgram();\n\t\t\tAddContextObject(new ProgramDisposable (program));\n\t\t\treturn (GLProgramHandle) program;\n\t\t}\n\n\t\tpublic void DeleteProgram(GLProgramHandle program)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_programs, (int) program);\n\t\t}\n\n\t\tpublic void AttachShader(GLProgramHandle program, GLShaderHandle shader)\n\t\t{\n\t\t\tGL.AttachShader((int) program, (int) shader);\n\t\t}\n\n\t\tpublic void DetachShader(GLProgramHandle program, GLShaderHandle shader)\n\t\t{\n\t\t\tGL.DetachShader((int) program, (int) shader);\n\t\t}\n\n\t\tpublic void LinkProgram(GLProgramHandle program)\n\t\t{\n\t\t\tGL.LinkProgram((int) program);\n\t\t}\n\n\t\tpublic int GetProgramParameter(GLProgramHandle program, GLProgramParameter pname)\n\t\t{\n\t\t\tint result;\n\t\t\tGL.GetProgram((int) program, (ProgramParameter)pname, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic string GetProgramInfoLog(GLProgramHandle program)\n\t\t{\n\t\t\treturn GL.GetProgramInfoLog((int) program);\n\t\t}\n\n\t\tpublic string GetString(GLStringName name)\n\t\t{\n\t\t\tvar result = GL.GetString((StringName)name);\n\n\t\t\tif (string.IsNullOrEmpty(result))\n\t\t\t{\n\t\t\t\tswitch (name)\n\t\t\t\t{\n\t\t\t\t\t// HACK: Hard-code strings.\n\n\t\t\t\t\t// Did not run on macOS Catalina with latest Mono/Xamarin.Mac/Xcode\n\t\t\t\t\t// before doing this.\n\n\t\t\t\t\tcase GLStringName.Version:\n\t\t\t\t\t\treturn \"2.1\";\n\n\t\t\t\t\tcase GLStringName.Renderer:\n\t\t\t\t\tcase GLStringName.Vendor:\n\t\t\t\t\t\treturn \"(null)\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic GLRenderbufferHandle GetRenderbufferBinding()\n\t\t{\n\t\t\treturn _currentRenderbufferBinding;\n\t\t\t//return OpenGL.GL.GetInteger(OpenGL.GetPName.RenderbufferBinding);\n\t\t}\n\n\t\tpublic GLFramebufferHandle GetFramebufferBinding()\n\t\t{\n\t\t\treturn _currentFramebufferBinding;\n\t\t\t//return OpenGL.GL.GetInteger(OpenGL.GetPName.FramebufferBinding);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/UnoView/RenderTargets/BackbufferRenderTarget.cs",
    "content": "using AppKit;\n\nnamespace Outracks.UnoHost.Mac.UnoView.RenderTargets\n{\n\tclass BackbufferRenderTarget : IRenderTarget\n\t{\n\t\tpublic int GetFramebufferHandle(Size<Pixels> size)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic void Flush(NSOpenGLContext ctx)\n\t\t{\n\t\t\tctx.FlushBuffer();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/UnoView/RenderTargets/IOSurfaceFramebuffer.cs",
    "content": "using System;\nusing OpenTK.Graphics.OpenGL;\n\nnamespace Outracks.UnoHost.Mac.UnoView.RenderTargets\n{\n\tstatic class IOSurfaceFramebuffer\n\t{\n\t\tpublic static FramebufferInfo CreateFramebuffer(this IOSurfaceObject surface)\n\t\t{\n\t\t\tvar size = surface.Size.Max(1, 1);\n\n\t\t\tvar handles = new int[1];\n\t\t\tGL.GenFramebuffers(1, handles);\n\t\t\tvar handle = new FramebufferHandle(handles[0]);\n\t\t\tGL.BindFramebuffer(FramebufferTarget.Framebuffer, handle);\n\n\t\t\tvar depthbuffer = CreateDepthBuffer(size);\n\t\t\tGL.FramebufferRenderbuffer(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, RenderbufferTarget.Renderbuffer, depthbuffer);\n\n\t\t\tvar colorbuffer = IOSurfaceTexture.Create(size, surface);\n\t\t\tGL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, TextureTarget.TextureRectangle, colorbuffer, 0);\n\n\t\t\tCheckStatus();\n\n\t\t\treturn new FramebufferInfo(handle, depthbuffer, Optional.None(), colorbuffer);\n\t\t}\n\n\t\tstatic RenderbufferHandle CreateDepthBuffer(Size<Pixels> size)\n\t\t{\n\t\t\tvar handles = new int[1];\n\t\t\tGL.GenRenderbuffers(1, handles);\n\t\t\tvar depth = new RenderbufferHandle(handles[0]);\n\t\t\tResizeDepthBuffer(depth, size);\n\t\t\treturn depth;\n\t\t}\n\n\t\tstatic void ResizeDepthBuffer(RenderbufferHandle renderbuffer, Size<Pixels> size)\n\t\t{\n\t\t\tGL.BindRenderbuffer(RenderbufferTarget.Renderbuffer, renderbuffer);\n\t\t\tGL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.DepthComponent16, (int)size.Width, (int)size.Height);\n\t\t\tGL.BindRenderbuffer(RenderbufferTarget.Renderbuffer, 0);\n\t\t}\n\n\t\tstatic void CheckStatus()\n\t\t{\n\t\t\tvar result = GL.CheckFramebufferStatus(FramebufferTarget.Framebuffer);\n\t\t\tif (result != FramebufferErrorCode.FramebufferComplete)\n\t\t\t\tthrow new Exception(\"Failed to create framebuffer (\" + result + \"). Try updating to your graphics card drivers.\");\n\t\t}\n\n\n\t\tpublic static TextureHandle CreateTexture(this IOSurfaceObject surface)\n\t\t{\n\t\t\treturn IOSurfaceTexture.Create(surface.Size, surface);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/UnoView/RenderTargets/IOSurfaceObject.cs",
    "content": "using System;\nusing System.Runtime.InteropServices;\nusing Foundation;\nusing ObjCRuntime;\n\nnamespace Outracks.UnoHost.Mac.UnoView.RenderTargets\n{\n\tclass FailedToLookupSurface : Exception\n\t{\n\t\tpublic FailedToLookupSurface(int surfaceId) : base(\"Failed to lookup an IOSurfaceObject with ID: \" + surfaceId)\n\t\t{}\n\t}\n\n\tclass IOSurfaceObject : IDisposable, INativeObject\n\t{\n\t\tpublic readonly Size<Pixels> Size;\n\t\treadonly IntPtr _ioSurfaceHandle;\n\t\tbool _isDisposed;\n\n\t\tpublic static IOSurfaceObject Create(Size<Pixels> size)\n\t\t{\n\t\t\tvar width = (int) size.Width;\n\t\t\tvar height = (int) size.Height;\n\t\t\tif (width == 0 || height == 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"size\", \"IOSurfaceObject dimensions must be greater or equal to 1\");\n\n\t\t\tusing(var properties = NSDictionary.FromObjectsAndKeys(\n\t\t\t\tnew object[] {\n\t\t\t\t\twidth, // IOSurfaceWidth\n\t\t\t\t\theight, // IOSurfaceHeight\n\t\t\t\t\t4, // IOSurfaceBytesPerElement\n\t\t\t\t\ttrue // IOSurfaceIsGlobal\n\t\t\t\t},\n\t\t\t\tnew object[] {\n\t\t\t\t\t\"IOSurfaceWidth\",\n\t\t\t\t\t\"IOSurfaceHeight\",\n\t\t\t\t\t\"IOSurfaceBytesPerElement\",\n\t\t\t\t\t\"IOSurfaceIsGlobal\"\n\t\t\t\t}))\n\t\t\t\t{\n\t\t\t\t\tvar surface = new IOSurfaceObject(IOSurfaceCreate(properties.Handle));\n\t\t\t\t\treturn surface;\n\t\t\t\t}\n\t\t}\n\n\t\t/// <exception cref=\"FailedToLookupSurface\"></exception>\n\t\tpublic static IOSurfaceObject CreateFromLookup(int surfaceId)\n\t\t{\n\t\t\tvar surface = IOSurfaceLookup(surfaceId);\n\t\t\tif(surface == IntPtr.Zero)\n\t\t\t\tthrow new FailedToLookupSurface(surfaceId);\n\n\t\t\treturn new IOSurfaceObject(surface);\n\t\t}\n\n\t\tpublic IntPtr Handle { get { return _ioSurfaceHandle; } }\n\n\t\tIOSurfaceObject(IntPtr ioSurfaceHandle)\n\t\t{\n\t\t\t_ioSurfaceHandle = ioSurfaceHandle;\n\t\t\tSize = new Size<Pixels>(IOSurfaceGetWidth(ioSurfaceHandle), IOSurfaceGetHeight(ioSurfaceHandle));\n\t\t}\n\n\t\t~IOSurfaceObject()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tpublic void Dispose(bool disposing)\n\t\t{\n\t\t\tif (_isDisposed)\n\t\t\t\treturn;\n\n\t\t\tCFRelease(_ioSurfaceHandle);\n\t\t\t_isDisposed = true;\n\t\t}\n\n\t\tpublic int GetSurfaceId()\n\t\t{\n\t\t\treturn IOSurfaceGetID(_ioSurfaceHandle);\n\t\t}\n\n\t\tconst string CoreFoundationLibrary = \"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation\";\n\t\tconst string IOSurfaceLibrary = \"/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface\";\n\n\t\t[DllImport(IOSurfaceLibrary)]\n\t\tstatic extern IntPtr IOSurfaceCreate(IntPtr dictionaryRefProperties);\n\n\t\t[DllImport(IOSurfaceLibrary)]\n\t\tstatic extern IntPtr IOSurfaceLookup(int surfaceId);\n\n\t\t[DllImport(IOSurfaceLibrary)]\n\t\tstatic extern int IOSurfaceGetWidth(IntPtr surfaceRef);\n\n\t\t[DllImport(IOSurfaceLibrary)]\n\t\tstatic extern int IOSurfaceGetHeight(IntPtr surfaceRef);\n\n\t\t[DllImport(IOSurfaceLibrary)]\n\t\tstatic extern int IOSurfaceGetID(IntPtr surfaceRef);\n\n\t\t[DllImport(CoreFoundationLibrary)]\n\t\tstatic extern void CFRelease(IntPtr cf);\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/UnoView/RenderTargets/IOSurfaceRenderTarget.cs",
    "content": "using System.Reactive.Subjects;\nusing AppKit;\nusing OpenTK.Graphics.OpenGL;\n\nnamespace Outracks.UnoHost.Mac.UnoView.RenderTargets\n{\n\tclass IOSurfaceRenderTarget : IRenderTarget\n\t{\n\t\tOptional<IOSurfaceRenderTargetBuffer> _frontbuffer;\n\t\tOptional<IOSurfaceRenderTargetBuffer> _backbuffer;\n\n\t\tpublic readonly ISubject<IOSurfaceObject> SurfaceRendered = new Subject<IOSurfaceObject>();\n\n\t\tpublic int GetFramebufferHandle(Size<Pixels> size)\n\t\t{\n\t\t\tif (_backbuffer.HasValue && _backbuffer.Value.Size == size)\n\t\t\t\treturn _backbuffer.Value.Handle;\n\n\t\t\t_backbuffer.Do(buffer => buffer.Dispose());\n\t\t\t_backbuffer = new IOSurfaceRenderTargetBuffer(size);\n\n\t\t\treturn _backbuffer.Value.Handle;\n\t\t}\n\n\t\tpublic void Flush(NSOpenGLContext ctx)\n\t\t{\n\t\t\tGL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);\n\t\t\tGL.Flush(); // We flush to be sure the framebuffer texture has the data we want\n\n\t\t\tSurfaceRendered.OnNext(_backbuffer.Value.Surface);\n\n\t\t\tSwap();\n\t\t}\n\n\t\tvoid Swap()\n\t\t{\n\t\t\tvar tmp = _frontbuffer;\n\t\t\t_frontbuffer = _backbuffer;\n\t\t\t_backbuffer = tmp;\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/UnoView/RenderTargets/IOSurfaceRenderTargetBuffer.cs",
    "content": "using System;\nusing OpenTK.Graphics.OpenGL;\n\nnamespace Outracks.UnoHost.Mac.UnoView.RenderTargets\n{\n\tclass IOSurfaceRenderTargetBuffer : IDisposable\n\t{\n\t\tpublic readonly IOSurfaceObject Surface;\n\t\tpublic readonly Size<Pixels> Size;\n\t\tOptional<FramebufferInfo> _framebufferInfo;\n\n\t\tpublic IOSurfaceRenderTargetBuffer(Size<Pixels> size)\n\t\t{\n\t\t\tSize = size;\n\t\t\tSurface = IOSurfaceObject.Create(new Size<Pixels>(size.Width, size.Height));\n\t\t}\n\n\t\tpublic int Handle\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (!_framebufferInfo.HasValue)\n\t\t\t\t\t_framebufferInfo = Surface.CreateFramebuffer();\n\n\t\t\t\treturn _framebufferInfo.Value.Handle;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_framebufferInfo.Do(Delete);\n\t\t\tSurface.Dispose();\n\t\t}\n\n\t\tstatic void Delete(FramebufferInfo framebufferInfo)\n\t\t{\n\t\t\tframebufferInfo.Colorbuffer.Do(tex => GL.DeleteTexture(tex));\n\t\t\tframebufferInfo.Depthbuffer.Do(renderBuffer => GL.DeleteRenderbuffers(1, new int[] { renderBuffer }));\n\t\t\tframebufferInfo.Stencilbuffer.Do(renderBuffer => GL.DeleteRenderbuffers(1, new int[] { renderBuffer }));\n\t\t\tGL.DeleteFramebuffers(1, new int[] { framebufferInfo.Handle });\n\t\t}\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\treturn Surface.Handle + \" (\" + Size + \")\";\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/UnoView/RenderTargets/IOSurfaceTexture.cs",
    "content": "using System;\nusing System.Runtime.InteropServices;\nusing OpenGL;\nusing OpenTK.Graphics.OpenGL;\nusing GL = OpenTK.Graphics.OpenGL.GL;\n\nnamespace Outracks.UnoHost.Mac.UnoView.RenderTargets\n{\n\tstatic class IOSurfaceTexture\n\t{\n\t\tpublic static TextureHandle Create(Size<Pixels> size, IOSurfaceObject surface)\n\t\t{\n\t\t\tGL.ActiveTexture(TextureUnit.Texture0);\n\t\t\tvar texture = new TextureHandle(GL.GenTexture());\n\t\t\tGL.BindTexture(TextureTarget.TextureRectangle, texture);\n\t\t\tGL.TexParameter(TextureTarget.TextureRectangle, TextureParameterName.TextureMagFilter, (int)(TextureMagFilter.Nearest));\n\t\t\tGL.TexParameter(TextureTarget.TextureRectangle, TextureParameterName.TextureMinFilter, (int)(TextureMinFilter.Linear));\n\t\t\tGL.TexParameter(TextureTarget.TextureRectangle, TextureParameterName.TextureWrapS, (int)(TextureWrapMode.ClampToEdge));\n\t\t\tGL.TexParameter(TextureTarget.TextureRectangle, TextureParameterName.TextureWrapT, (int)(TextureWrapMode.ClampToEdge));\n\t\t\tResize(texture, size, surface);\n\t\t\treturn texture;\n\t\t}\n\n\t\tpublic static void Resize(TextureHandle texture, Size<Pixels> size, IOSurfaceObject surface)\n\t\t{\n\t\t\tGL.BindTexture(TextureTarget.TextureRectangle, texture);\n\t\t\tCGLTexImageIOSurface2D(\n\t\t\t\tCGLContext.CurrentContext.Handle,\n\t\t\t\t(int)TextureTarget.TextureRectangle,\n\t\t\t\t(int)PixelInternalFormat.Rgba,\n\t\t\t\t(int)size.Width,\n\t\t\t\t(int)size.Height,\n\t\t\t\t(int)PixelFormat.Bgra,\n\t\t\t\t(int)PixelType.UnsignedInt8888Reversed,\n\t\t\t\tsurface.Handle,\n\t\t\t\t0);\n\t\t\tGL.BindTexture(TextureTarget.TextureRectangle, 0);\n\t\t}\n\n\t\tconst string GraphicsLibrary = \"/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL\";\n\t\t[DllImport(GraphicsLibrary)]\n\t\tstatic extern void CGLTexImageIOSurface2D(IntPtr ctx, int target, int internalFormat, int width, int height, int format, int type, IntPtr ioSurface, int plane);\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/UnoView/RenderTargets/IRenderTarget.cs",
    "content": "using System;\nusing AppKit;\n\nnamespace Outracks.UnoHost.Mac.UnoView.RenderTargets\n{\n\tinterface IRenderTarget\n\t{\n\t\t/// <exception cref=\"ArgumentOutOfRangeException\">Dimensions of size is less than 1</exception>\n\t\tint GetFramebufferHandle(Size<Pixels> size);\n\n\t\tvoid Flush(NSOpenGLContext ctx);\n\t}\n}"
  },
  {
    "path": "src/unohost/mac/UnoView/UnoView.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Subjects;\nusing AppKit;\nusing CoreGraphics;\nusing OpenGL;\nusing Outracks.UnoHost.Mac.Protocol;\nusing Outracks.UnoHost.Mac.UnoView.RenderTargets;\nusing Uno;\nusing Uno.IO;\nusing Uno.Platform;\nusing Uno.Platform.Internal;\n\nnamespace Outracks.UnoHost.Mac.UnoView\n{\n\tsealed class UnoView : DisplayLinkView, IUnoCallbacks\n\t{\n\t\tint _currentFrame = 0;\n\t\treadonly IRenderTarget _renderTarget;\n\t\treadonly IReport _log;\n\n\t\tNSEventModifierMask _modifierFlags;\n\n\t\treadonly UnoWindow _unoWindow;\n\t\treadonly UnoGraphicsContext _unoGraphics;\n\n\t\treadonly Subject<double> _perFrame = new Subject<double>();\n\t\treadonly Stopwatch _stopwatch = Stopwatch.StartNew();\n\n\t\tpublic IObservable<double> PerFrame\n\t\t{\n\t\t\tget { return _perFrame; }\n\t\t}\n\n\t\tpublic UnoView(IScheduler dispatcher, IReport log, IRenderTarget renderTarget)\n\t\t\t: base(v => dispatcher.Schedule(v), new CGRect(0, 0, 0, 0))\n\t\t{\n\t\t\t_renderTarget = renderTarget;\n\t\t\t_log = log;\n\n\t\t\t_unoWindow = new UnoWindow(this);\n\t\t\t_unoGraphics = new UnoGraphicsContext(_unoWindow);\n\n\t\t\tReshape();\n\t\t}\n\n\t\tpublic void Initialize(UnoHostProject project, IObserver<OpenGlVersion> glObserver)\n\t\t{\n\t\t\tBundle.Initialize(project.Assembly);\n\n\t\t\tIGL gl = new MonoMacGL();\n#if DEBUG\n\t\t\tGL.Initialize(gl, true);\n#else\n\t\t\tGL.Initialize(gl, false);\n#endif\n\t\t\tGraphicsContextBackend.SetInstance(_unoGraphics);\n\t\t\tWindowBackend.SetInstance(_unoWindow);\n\t\t\tglObserver.OnNext(\n\t\t\t\tnew OpenGlVersion(\n\t\t\t\t\tgl.GetString(GLStringName.Version),\n\t\t\t\t\tgl.GetString(GLStringName.Vendor),\n\t\t\t\t\tgl.GetString(GLStringName.Renderer)));\n\n\t\t}\n\n\t\tpublic override bool AcceptsFirstResponder()\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t#region Cursor\n\t\tNSCursor _cursor;\n\t\tpublic override void ResetCursorRects()\n\t\t{\n\t\t\tif (_cursor != null)\n\t\t\t{\n\t\t\t\tAddCursorRect(Bounds, _cursor);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbase.ResetCursorRects();\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetCursor(Cursor cursor)\n\t\t{\n\t\t\t_cursor = cursor.ToCursor();\n\t\t\tWindow.InvalidateCursorRectsForView(this);\n\t\t}\n\t\t#endregion\n\n\t\t#region Resize\n\t\tSize<Pixels> _unoSize = new Size<Pixels>(1,1);\n\t\tRatio<Pixels, Points> _unoDensity = new Ratio<Pixels, Points>(1);\n\n\t\treadonly BehaviorSubject<Size<Points>> _size = new BehaviorSubject<Size<Points>>(new Size<Points>(0, 0));\n\n\t\tpublic IObservable<Size<Points>> Size\n\t\t{\n\t\t\tget { return _size; }\n\t\t}\n\n\t\tpublic void Resize(SizeData sizeData)\n\t\t{\n\t\t\t_unoSize = sizeData.Size * sizeData.Density;\n\t\t\t_unoDensity = sizeData.Density;\n\n\t\t\tSetFrameSize(sizeData.Size.ToSize());\n\n\t\t\t_unoWindow.ChangeSize(_unoSize, _unoDensity);\n\t\t\t_size.OnNext(sizeData.Size);\n\n\t\t\tReshape();\n\t\t}\n\t\t#endregion\n\n\t\t#region Update and Draw\n\t\tprotected override void OnDraw()\n\t\t{\n\t\t\tOpenGLContext.CGLContext.Lock().ThrowIfFailed(\"CGLContext.Lock()\");\n\t\t\ttry\n\t\t\t{\n\t\t\t\tOpenGLContext.MakeCurrentContext();\n\n\t\t\t\t_perFrame.OnNext(_stopwatch.Elapsed.TotalSeconds);\n\n\t\t\t\t_log.TrySomethingBlocking(Bootstrapper.OnUpdate);\n\n\t\t\t\tif (_unoWindow.Size.HasZeroArea())\n\t\t\t\t\treturn;\n\n\t\t\t\t// This fixes rendering on Xcode 10 (macOS Mojave) and newer.\n\t\t\t\t// https://github.com/xamarin/xamarin-macios/issues/4959#issuecomment-621914507\n\t\t\t\tif (OpenGLContext.View == null)\n\t\t\t\t\tOpenGLContext.View = this;\n\n\t\t\t\tif(Application.Current != null && Bootstrapper.DrawNextFrame)\n\t\t\t\t{\n\t\t\t\t\t_unoGraphics.ChangeBackbuffer((GLFramebufferHandle) _renderTarget.GetFramebufferHandle(_unoWindow.Size));\n\t\t\t\t\t_log.TrySomethingBlocking(Bootstrapper.OnDraw);\n\t\t\t\t\t_renderTarget.Flush(OpenGLContext);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\t++_currentFrame;\n\t\t\t\tOpenGLContext.CGLContext.Unlock().ThrowIfFailed(\"CGLContext.Unlock()\");\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Keyboard and Text Input\n\t\tpublic override void KeyDown(NSEvent theEvent)\n\t\t{\n\t\t\t_modifierFlags = theEvent.ModifierFlags;\n\t\t\tif (_unoWindow.IsTextInputActive())\n\t\t\t{\n\t\t\t\ttheEvent.InterpretAsTextEvent().Do(\n\t\t\t\t\ttext => _log.Try(() => Bootstrapper.OnTextInput(_unoWindow, text), false),\n\t\t\t\t\t() => { });\n\t\t\t}\n\n\t\t\ttheEvent.InterpretAsKeyEvent().Do(\n\t\t\t\tkey => _log.Try(() => Bootstrapper.OnKeyDown(_unoWindow, (Key)key), false),\n\t\t\t\t() => { });\n\t\t}\n\n\t\tpublic override void KeyUp(NSEvent theEvent)\n\t\t{\n\t\t\t_modifierFlags = theEvent.ModifierFlags;\n\n\t\t\ttheEvent.InterpretAsKeyEvent().Do(\n\t\t\t\tkey => _log.Try(() => Bootstrapper.OnKeyUp(_unoWindow, (Key)key), false),\n\t\t\t\t() => { });\n\t\t}\n\t\t#endregion\n\n\t\t#region Mouse Down\n\t\tpublic override void MouseDown(NSEvent a) { MouseDownInternal(a, Uno.Platform.MouseButton.Left); }\n\t\tpublic override void RightMouseDown(NSEvent a) { MouseDownInternal(a, Uno.Platform.MouseButton.Right); }\n\t\tpublic override void OtherMouseDown(NSEvent a) { MouseDownInternal(a, Uno.Platform.MouseButton.Middle); }\n\n\t\tvoid MouseDownInternal(NSEvent a, Uno.Platform.MouseButton button)\n\t\t{\n\t\t\t_modifierFlags = a.ModifierFlags;\n\n\t\t\tvar pos = GetPosition(a);\n\t\t\t_log.Try(() => Bootstrapper.OnMouseDown(_unoWindow, (int)pos.X, (int)pos.Y, button), false);\n\t\t}\n\t\t#endregion\n\n\t\t#region Mouse Up\n\t\tpublic override void MouseUp(NSEvent a) { MouseUpInternal(a, Uno.Platform.MouseButton.Left); }\n\t\tpublic override void RightMouseUp(NSEvent a) { MouseUpInternal(a, Uno.Platform.MouseButton.Right); }\n\t\tpublic override void OtherMouseUp(NSEvent a) { MouseUpInternal(a, Uno.Platform.MouseButton.Middle); }\n\n\t\tvoid MouseUpInternal(NSEvent a, Uno.Platform.MouseButton button)\n\t\t{\n\t\t\t_modifierFlags = a.ModifierFlags;\n\n\t\t\tvar pos = GetPosition(a);\n\t\t\t_log.Try(() => Bootstrapper.OnMouseUp(_unoWindow, (int)pos.X, (int)pos.Y, button), false);\n\t\t}\n\t\t#endregion\n\n\t\t#region Mouse Moved\n\t\tpublic override void MouseDragged(NSEvent a) { MouseMovedInternal(a); }\n\t\tpublic override void RightMouseDragged(NSEvent a) { MouseMovedInternal(a); }\n\t\tpublic override void OtherMouseDragged(NSEvent a) { MouseMovedInternal(a); }\n\t\tpublic override void MouseMoved(NSEvent a) { MouseMovedInternal(a); }\n\n\t\tint _lastMouseMovedFrame = -1;\n\t\tvoid MouseMovedInternal(NSEvent a)\n\t\t{\n\t\t\t_modifierFlags = a.ModifierFlags;\n\n\t\t\t// Only send one mouse moved event per frame (ignore the rest)\n\t\t\t// Issue: https://github.com/fusetools/Fuse/issues/2479\n\t\t\tif (_currentFrame != _lastMouseMovedFrame)\n\t\t\t{\n\t\t\t\tvar pos = GetPosition(a);\n\t\t\t\t_log.Try(() => Bootstrapper.OnMouseMove(_unoWindow, (int)pos.X, (int)pos.Y), false);\n\t\t\t\t_lastMouseMovedFrame = _currentFrame;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Mouse Enter/Leave\n\t\tpublic override void MouseEntered(NSEvent a)\n\t\t{\n\t\t\t_modifierFlags = a.ModifierFlags;\n\n\t\t\t//var pos = GetPosition(a);\n\t\t\t//Log.Try(() => Bootstrapper.OnMouseEnter(_unoWindow, (int)pos.X, (int)pos.Y), false);\n\t\t}\n\n\t\tpublic override void MouseExited(NSEvent a)\n\t\t{\n\t\t\t_modifierFlags = a.ModifierFlags;\n\t\t\t_log.Try(() => Bootstrapper.OnMouseOut(_unoWindow), false);\n\t\t}\n\t\t#endregion\n\n\t\t#region Mouse Scroll\n\t\tpublic override void ScrollWheel(NSEvent a)\n\t\t{\n\t\t\t_modifierFlags = a.ModifierFlags;\n\t\t\tvar deltaMode = a.HasPreciseScrollingDeltas ? WheelDeltaMode.DeltaPixel : WheelDeltaMode.DeltaLine;\n\n\t\t\t_modifierFlags = a.ModifierFlags;\n\t\t\t_log.Try(() => Bootstrapper.OnMouseWheel(_unoWindow, (float)a.ScrollingDeltaX, (float)a.ScrollingDeltaY, (int)deltaMode), false);\n\t\t}\n\t\t#endregion\n\n\t\tpublic bool GetKeyStateOnlyWorksForModifiers(Key key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase Key.ControlKey:\n\t\t\t\t\treturn (_modifierFlags & NSEventModifierMask.ControlKeyMask) != 0;\n\t\t\t\tcase Key.ShiftKey:\n\t\t\t\t\treturn (_modifierFlags & NSEventModifierMask.ShiftKeyMask) != 0;\n\t\t\t\tcase Key.AltKey:\n\t\t\t\t\treturn (_modifierFlags & NSEventModifierMask.AlternateKeyMask) != 0;\n\t\t\t\tcase Key.OSKey:\n\t\t\t\tcase Key.MetaKey:\n\t\t\t\t\treturn (_modifierFlags & NSEventModifierMask.CommandKeyMask) != 0;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tPoint<Pixels> GetPosition(NSEvent a)\n\t\t{\n\t\t\tvar p = a.LocationInWindow;\n\t\t\tvar hostPoint = new Point<Points>((double)p.X, (double)p.Y) * _unoDensity;\n\t\t\treturn new Point<Pixels>(hostPoint.X, (double)_unoSize.Height - (double)hostPoint.Y);\n\t\t}\n\t}\n\n\tpublic static class CursorExtensionMethods\n\t{\n\t\tpublic static NSCursor ToCursor(this Cursor cursor)\n\t\t{\n\t\t\tswitch (cursor)\n\t\t\t{\n\t\t\tcase Cursor.Default:\n\t\t\t\treturn NSCursor.ArrowCursor;\n\t\t\tcase Cursor.Grab:\n\t\t\t\treturn NSCursor.OpenHandCursor;\n\t\t\tcase Cursor.Grabbing:\n\t\t\t\treturn NSCursor.ClosedHandCursor;\n\t\t\tcase Cursor.Pointer:\n\t\t\t\treturn NSCursor.PointingHandCursor;\n\t\t\tcase Cursor.SizeH:\n\t\t\t\treturn NSCursor.ResizeLeftRightCursor;\n\t\t\tcase Cursor.SizeV:\n\t\t\t\treturn NSCursor.ResizeUpDownCursor;\n\t\t\tcase Cursor.Text:\n\t\t\t\treturn NSCursor.IBeamCursor;\n\t\t\tdefault:\n\t\t\t\tthrow new NotSupportedException ();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/mac/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/unohost/mac/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/unohost/tests/Outracks.UnoHost.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props\" Condition=\"Exists('..\\..\\..\\packages\\NUnit.3.12.0\\build\\NUnit.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{F506CC63-838F-4907-A573-BADD1C2D9CA1}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.UnoHost.Tests</RootNamespace>\n    <AssemblyName>Outracks.UnoHost.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <VisualStudioVersion Condition=\"'$(VisualStudioVersion)' == ''\">10.0</VisualStudioVersion>\n    <VSToolsPath Condition=\"'$(VSToolsPath)' == ''\">$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)</VSToolsPath>\n    <ReferencePath>$(ProgramFiles)\\Common Files\\microsoft shared\\VSTT\\$(VisualStudioVersion)\\UITestExtensionPackages</ReferencePath>\n    <IsCodedUITest>False</IsCodedUITest>\n    <TestProjectType>UnitTest</TestProjectType>\n    <NuGetPackageImportStamp>\n    </NuGetPackageImportStamp>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\NUnit.3.12.0\\lib\\net45\\nunit.framework.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Test.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196B010D-AD36-4947-95AA-14FC4A27BD18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.UnoHost.csproj\">\n      <Project>{F2AEB321-51E5-40B8-9CF0-53C930E631F0}</Project>\n      <Name>Outracks.UnoHost</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VSToolsPath)\\TeamTest\\Microsoft.TestTools.targets\" Condition=\"Exists('$(VSToolsPath)\\TeamTest\\Microsoft.TestTools.targets')\" />\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/unohost/tests/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Outracks.UnoHost.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Outracks.UnoHost.Tests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2022 Build & Run\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"7d7aa509-47ff-49b4-b89c-d5510f11d2d4\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "src/unohost/tests/Test.cs",
    "content": "﻿\nusing NUnit.Framework;\n\nnamespace Outracks.UnoHost.Tests\n{\n\t[TestFixture]\n\tpublic class Test\n\t{\n\t\t// So apparently we need a test in all test projects for TC to be green. This can be removed when we have real tests.\n\t\t[Test]\n\t\tpublic void TheTruthIsOutThere()\n\t\t{\n\t\t\tAssert.IsTrue(true);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/tests/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/unohost/tests/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"NUnit\" version=\"3.12.0\" targetFramework=\"net45\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/unohost/win/ContextCreationFailed.cs",
    "content": "﻿using System;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tclass ContextCreationFailed : Exception\n\t{\n\t\tpublic ContextCreationFailed(string functionName, uint errorCode)\n\t\t\t: base(functionName + \" returned error code \" + errorCode)\n\t\t{\n\t\t}\n\t\tpublic ContextCreationFailed(string message)\n\t\t\t: base(\"Failed to create OpenGL context (\"+message+\")\")\n\t\t{\n\t\t}\n\n\n\t\tpublic ContextCreationFailed(Exception innerException)\n\t\t\t: base(\"Failed to create OpenGL context\", innerException)\n\t\t{\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/ContextFactory.cs",
    "content": "﻿using System;\nusing OpenTK.Graphics;\nusing OpenTK.Platform;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tstatic class ContextFactory\n\t{\n\t\tpublic static GraphicsContext CreateContext(IWindowInfo window)\n\t\t{\n\t\t\tException innerException = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar result = new GraphicsContext(new GraphicsMode(32, 24), window, 2, 0, GraphicsContextFlags.AngleD3D9);\n\n\t\t\t\tresult.MakeCurrent(window);\n\t\t\t\tresult.LoadAll();\n\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tinnerException = e;\n\t\t\t}\n\n\t\t\tthrow new ContextCreationFailed(innerException);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/win/Egl.cs",
    "content": "using System;\nusing System.Runtime.InteropServices;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tstatic class Egl\n\t{\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglGetCurrentSurface\")]\n\t\tpublic static extern IntPtr GetCurrentSurface(int readdraw);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglQuerySurfacePointerANGLE\")]\n\t\tpublic static extern bool QuerySurfacePointer(IntPtr display, IntPtr surface, int attribute, ref IntPtr outSurface);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglQuerySurface\")]\n\t\tpublic static extern bool QuerySurface(IntPtr display, IntPtr surface, int attribute, ref int value);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglGetCurrentDisplay\")]\n\t\tpublic static extern IntPtr GetCurrentDisplay();\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglGetConfigs\")]\n\t\tpublic static extern bool GetConfigs(IntPtr display, IntPtr[] configs, int configSize, ref int numConfigs);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglGetConfigAttrib\")]\n\t\tpublic static extern bool GetConfigAttrib(IntPtr display, IntPtr config, int attrib, ref int value);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglChooseConfig\")]\n\t\tpublic static extern bool ChooseConfig(IntPtr display, int[] attribList, IntPtr[] configs, int configSize, ref int numConfigs);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglCreatePbufferFromClientBuffer\")]\n\t\tpublic static extern IntPtr CreatePbufferFromClientBuffer(IntPtr display, int buftype, IntPtr buffer, IntPtr config, int[] attribList);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglBindTexImage\")]\n\t\tpublic static extern void BindTexImage(IntPtr display, IntPtr surface, int buffer);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglCreateContext\")]\n\t\tpublic static extern IntPtr CreateContext(IntPtr display, IntPtr[] configs, IntPtr shareContext, int[] attribList);\n\n\t\t[DllImport(\"libEGL.dll\", EntryPoint = \"eglGetError\")]\n\t\tpublic static extern int GetError();\n\n\t\tpublic const int EGL_NONE = 0x3038;\n\t\tpublic const int EGL_WIDTH = 0x3057;\n\t\tpublic const int EGL_HEIGHT = 0x3056;\n\t\tpublic const int EGL_TEXTURETARGET = 0x3081;\n\t\tpublic const int EGL_TEXTURE_2D = 0x305F;\n\t\tpublic const int EGL_TEXTURE_FORMAT = 0x3080;\n\t\tpublic const int EGL_TEXTURE_RGBA = 0x305E;\n\t\tpublic const int EGL_COLOR_BUFFER_TYPE = 0x303F;\n\t\tpublic const int EGL_ALPHA_SIZE = 0x3021;\n\t\tpublic const int EGL_RED_SIZE = 0x3024;\n\t\tpublic const int EGL_GREEN_SIZE = 0x3023;\n\t\tpublic const int EGL_BLUE_SIZE = 0x3022;\n\t\tpublic const int EGL_SURFACE_TYPE = 0x3033;\n\t\tpublic const int EGL_PBUFFER_BIT = 0x0001;\n\t\tpublic const int EGL_BACK_BUFFER = 0x3084;\n\t\tpublic const int EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200;\n\t}\n}"
  },
  {
    "path": "src/unohost/win/Job.cs",
    "content": "﻿using System;\nusing System.Diagnostics;\nusing System.Runtime.ConstrainedExecution;\nusing System.Runtime.InteropServices;\nusing System.Security;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class Job : IDisposable\n\t{\n\t\tprivate IntPtr _handle;\n\t\tprivate bool _disposed;\n\n\t\tpublic Job()\n\t\t{\n\t\t\t_handle = CreateJobObject(IntPtr.Zero, null);\n\n\t\t\tvar info = new JOBOBJECT_BASIC_LIMIT_INFORMATION\n\t\t\t{\n\t\t\t\tLimitFlags = 0x2000\n\t\t\t};\n\n\t\t\tvar extendedInfo = new JOBOBJECT_EXTENDED_LIMIT_INFORMATION\n\t\t\t{\n\t\t\t\tBasicLimitInformation = info\n\t\t\t};\n\n\t\t\tint length = Marshal.SizeOf(typeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION));\n\t\t\tIntPtr extendedInfoPtr = Marshal.AllocHGlobal(length);\n\t\t\tMarshal.StructureToPtr(extendedInfo, extendedInfoPtr, false);\n\n\t\t\tif (!SetInformationJobObject(_handle, JobObjectInfoType.ExtendedLimitInformation, extendedInfoPtr, (uint)length))\n\t\t\t\tthrow new Exception(string.Format(\"Unable to set information.  Error: {0}\", Marshal.GetLastWin32Error()));\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing)\n\t\t{\n\t\t\tif (_disposed)\n\t\t\t\treturn;\n\n\t\t\tif (disposing) { }\n\n\t\t\tClose();\n\t\t\t_disposed = true;\n\t\t}\n\n\t\tpublic void Close()\n\t\t{\n\t\t\tCloseHandle(_handle);\n\t\t\t_handle = IntPtr.Zero;\n\t\t}\n\n\t\tpublic bool AddProcess(IntPtr processHandle)\n\t\t{\n\t\t\treturn AssignProcessToJobObject(_handle, processHandle);\n\t\t}\n\n\t\tpublic bool AddProcess(int processId)\n\t\t{\n\t\t\treturn AddProcess(Process.GetProcessById(processId).Handle);\n\t\t}\n\n\t\t[DllImport(\"kernel32.dll\", CharSet = CharSet.Unicode)]\n\t\tstatic extern IntPtr CreateJobObject(IntPtr a, string lpName);\n\n\t\t[DllImport(\"kernel32.dll\")]\n\t\tstatic extern bool SetInformationJobObject(IntPtr hJob, JobObjectInfoType infoType, IntPtr lpJobObjectInfo, UInt32 cbJobObjectInfoLength);\n\n\t\t[DllImport(\"kernel32.dll\", SetLastError = true)]\n\t\tstatic extern bool AssignProcessToJobObject(IntPtr job, IntPtr process);\n\n\t\t[DllImport(\"kernel32.dll\", SetLastError = true)]\n\t\t[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]\n\t\t[SuppressUnmanagedCodeSecurity]\n\t\t[return: MarshalAs(UnmanagedType.Bool)]\n\t\tstatic extern bool CloseHandle(IntPtr hObject);\n\t}\n\n\t#region Helper classes\n\n\t[StructLayout(LayoutKind.Sequential)]\n\tstruct IO_COUNTERS\n\t{\n\t\tpublic UInt64 ReadOperationCount;\n\t\tpublic UInt64 WriteOperationCount;\n\t\tpublic UInt64 OtherOperationCount;\n\t\tpublic UInt64 ReadTransferCount;\n\t\tpublic UInt64 WriteTransferCount;\n\t\tpublic UInt64 OtherTransferCount;\n\t}\n\n\n\t[StructLayout(LayoutKind.Sequential)]\n\tstruct JOBOBJECT_BASIC_LIMIT_INFORMATION\n\t{\n\t\tpublic Int64 PerProcessUserTimeLimit;\n\t\tpublic Int64 PerJobUserTimeLimit;\n\t\tpublic UInt32 LimitFlags;\n\t\tpublic UIntPtr MinimumWorkingSetSize;\n\t\tpublic UIntPtr MaximumWorkingSetSize;\n\t\tpublic UInt32 ActiveProcessLimit;\n\t\tpublic UIntPtr Affinity;\n\t\tpublic UInt32 PriorityClass;\n\t\tpublic UInt32 SchedulingClass;\n\t}\n\n\t[StructLayout(LayoutKind.Sequential)]\n\tpublic struct SECURITY_ATTRIBUTES\n\t{\n\t\tpublic UInt32 nLength;\n\t\tpublic IntPtr lpSecurityDescriptor;\n\t\tpublic Int32 bInheritHandle;\n\t}\n\n\t[StructLayout(LayoutKind.Sequential)]\n\tstruct JOBOBJECT_EXTENDED_LIMIT_INFORMATION\n\t{\n\t\tpublic JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;\n\t\tpublic IO_COUNTERS IoInfo;\n\t\tpublic UIntPtr ProcessMemoryLimit;\n\t\tpublic UIntPtr JobMemoryLimit;\n\t\tpublic UIntPtr PeakProcessMemoryUsed;\n\t\tpublic UIntPtr PeakJobMemoryUsed;\n\t}\n\n\tpublic enum JobObjectInfoType\n\t{\n\t\tAssociateCompletionPortInformation = 7,\n\t\tBasicLimitInformation = 2,\n\t\tBasicUIRestrictions = 4,\n\t\tEndOfJobTimeInformation = 6,\n\t\tExtendedLimitInformation = 9,\n\t\tSecurityLimitInformation = 5,\n\t\tGroupInformation = 11\n\t}\n\n\t#endregion\n\n}"
  },
  {
    "path": "src/unohost/win/OpenTKGL.Dispose.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing OpenTK.Graphics.ES20;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tpartial class OpenTKGL\n\t{\n\t\tvoid AddContextObject(TextureDisposable obj) { _textures.AddLast(obj); }\n\t\tvoid AddContextObject(FramebufferDisposable obj) { _framebuffers.AddLast(obj); }\n\t\tvoid AddContextObject(BufferDisposable obj) { _buffers.AddLast(obj); }\n\t\tvoid AddContextObject(RenderbufferDisposable obj) { _renderbuffers.AddLast(obj); }\n\t\tvoid AddContextObject(ShaderDisposable obj) { _shaders.AddLast(obj); }\n\t\tvoid AddContextObject(ProgramDisposable obj) { _programs.AddLast(obj); }\n\n\t\tpublic void DisposeContext()\n\t\t{\n\t\t\tDisposeAndRemoveObjects(_textures);\n\t\t\tDisposeAndRemoveObjects(_framebuffers);\n\t\t\tDisposeAndRemoveObjects(_buffers);\n\t\t\tDisposeAndRemoveObjects(_renderbuffers);\n\t\t\tDisposeAndRemoveObjects(_shaders);\n\t\t\tDisposeAndRemoveObjects(_programs);\n\t\t}\n\n\n\t\tvoid DisposeAndRemoveObject<T>(LinkedList<T> objects, int handle) where T : IContextObjectDisposable\n\t\t{\n\t\t\tvar obj = objects.FirstOrDefault(o => o.HandleName == handle);\n\t\t\tif (obj == null) throw new InvalidOperationException(\"Trying to dispose object not created by this instance of IGL\");\n\n\t\t\tobj.Dispose();\n\t\t\tobjects.Remove(obj);\n\t\t}\n\n\t\tvoid DisposeAndRemoveObjects<T>(LinkedList<T> objects) where T : IContextObjectDisposable\n\t\t{\n\t\t\tforeach (var obj in objects) obj.Dispose();\n\t\t\tobjects.Clear();\n\t\t}\n\n\n\t\tinterface IContextObjectDisposable\n\t\t{\n\t\t\tint HandleName { get; }\n\n\t\t\tvoid Dispose();\n\t\t}\n\n\t\tclass TextureDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic TextureDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteTexture(HandleName);\n\t\t\t}\n\t\t}\n\n\t\tclass FramebufferDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic FramebufferDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteFramebuffer(HandleName);\n\t\t\t}\n\t\t}\n\n\t\tclass BufferDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic BufferDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteBuffer(HandleName);\n\t\t\t}\n\t\t}\n\n\t\tclass RenderbufferDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic RenderbufferDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteRenderbuffer(HandleName);\n\t\t\t}\n\t\t}\n\n\t\tclass ShaderDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic ShaderDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteShader(HandleName);\n\t\t\t}\n\t\t}\n\n\t\tclass ProgramDisposable : IContextObjectDisposable\n\t\t{\n\t\t\tpublic int HandleName { get; private set; }\n\n\t\t\tpublic ProgramDisposable(int handleName)\n\t\t\t{\n\t\t\t\tHandleName = handleName;\n\t\t\t}\n\n\t\t\tpublic void Dispose()\n\t\t\t{\n\t\t\t\tGL.DeleteProgram(HandleName);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/OpenTKGL.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing OpenGL;\nusing OpenTK.Graphics.ES20;\nusing Uno;\nusing Uno.Diagnostics;\nusing GL = OpenTK.Graphics.ES20.GL;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tpartial class OpenTKGL : IGL\n\t{\n\t\t// Note: Workaround for InvalidProgramException\n\t\tGLFramebufferHandle _currentFramebufferBinding;\n\t\tGLRenderbufferHandle _currentRenderbufferBinding;\n\n\t\treadonly LinkedList<TextureDisposable> _textures = new LinkedList<TextureDisposable>();\n\t\treadonly LinkedList<FramebufferDisposable> _framebuffers = new LinkedList<FramebufferDisposable>();\n\t\treadonly LinkedList<BufferDisposable> _buffers = new LinkedList<BufferDisposable>();\n\t\treadonly LinkedList<RenderbufferDisposable> _renderbuffers = new LinkedList<RenderbufferDisposable>();\n\t\treadonly LinkedList<ShaderDisposable> _shaders = new LinkedList<ShaderDisposable>();\n\t\treadonly LinkedList<ProgramDisposable> _programs = new LinkedList<ProgramDisposable>();\n\n\t\tpublic GLError GetError()\n\t\t{\n\t\t\treturn (GLError)GL.GetError();\n\t\t}\n\n\t\tpublic void Finish()\n\t\t{\n\t\t\tGL.Finish();\n\t\t}\n\n\t\tpublic void Flush()\n\t\t{\n\t\t\tGL.Flush();\n\t\t}\n\n\t\tpublic int GetInteger(GLIntegerName pname)\n\t\t{\n\t\t\treturn GL.GetInteger((GetPName)pname);\n\t\t}\n\n\t\tpublic Int4 GetInteger(GLInteger4Name name)\n\t\t{\n\t\t\tvar v = new int[4];\n\t\t\tGL.GetInteger((GetPName)name, v);\n\t\t\treturn new Int4(v[0], v[1], v[2], v[3]);\n\t\t}\n\n\t\tpublic GLFramebufferStatus CheckFramebufferStatus(GLFramebufferTarget target)\n\t\t{\n\t\t\treturn (GLFramebufferStatus)GL.CheckFramebufferStatus((FramebufferTarget)target);\n\t\t}\n\n\t\tpublic void Clear(GLClearBufferMask mask)\n\t\t{\n\t\t\tGL.Clear((ClearBufferMask)mask);\n\t\t}\n\n\t\tpublic void ClearColor(float red, float green, float blue, float alpha)\n\t\t{\n\t\t\tGL.ClearColor(red, green, blue, alpha);\n\t\t}\n\n\t\tpublic void ClearDepth(float depth)\n\t\t{\n\t\t\tGL.ClearDepth(depth);\n\t\t}\n\n\t\tpublic void ColorMask(bool red, bool green, bool blue, bool alpha)\n\t\t{\n\t\t\tGL.ColorMask(red, green, blue, alpha);\n\t\t}\n\n\t\tpublic void DepthMask(bool flag)\n\t\t{\n\t\t\tGL.DepthMask(flag);\n\t\t}\n\n\t\tpublic GLTextureHandle CreateTexture()\n\t\t{\n\t\t\tint texture = GL.GenTexture();\n\t\t\tAddContextObject(new TextureDisposable(texture));\n\n\t\t\treturn (GLTextureHandle) texture;\n\t\t}\n\n\t\tpublic void DeleteTexture(GLTextureHandle texture)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_textures, (int) texture);\n\t\t}\n\n\t\tpublic void ActiveTexture(GLTextureUnit texture)\n\t\t{\n\t\t\tGL.ActiveTexture((TextureUnit)texture);\n\t\t}\n\n\t\tpublic void BindTexture(GLTextureTarget target, GLTextureHandle texture)\n\t\t{\n\t\t\tGL.BindTexture((TextureTarget)target, (int) texture);\n\t\t}\n\n\t\tpublic void TexParameter(GLTextureTarget target, GLTextureParameterName pname, GLTextureParameterValue param)\n\t\t{\n\t\t\tGL.TexParameter((TextureTarget)target, (TextureParameterName)pname, (int)param);\n\t\t}\n\n\t\tpublic void TexImage2D(GLTextureTarget target, int level, GLPixelFormat internalFormat, int width, int height, int border, GLPixelFormat format, GLPixelType type, IntPtr data)\n\t\t{\n\t\t\tGL.TexImage2D((TextureTarget2d)target, level,\n\t\t\t\t\t(TextureComponentCount)internalFormat, width, height, border,\n\t\t\t\t\t(PixelFormat)format, (PixelType)type,\n\t\t\t\t\tdata);\n\t\t}\n\n\t\tpublic void TexSubImage2D(GLTextureTarget target, int level, int xoffset, int yoffset, int width, int height, GLPixelFormat format, GLPixelType type, IntPtr data)\n\t\t{\n\t\t\tGL.TexSubImage2D((TextureTarget2d)target, level,\n\t\t\t\txoffset, yoffset, width, height,\n\t\t\t\t(PixelFormat)format, (PixelType)type,\n\t\t\t\tdata);\n\t\t}\n\n\t\tpublic void GenerateMipmap(GLTextureTarget target)\n\t\t{\n\t\t\tGL.GenerateMipmap((TextureTarget)target);\n\t\t}\n\n\t\tpublic void PixelStore(GLPixelStoreParameter pname, int param)\n\t\t{\n\t\t\tGL.PixelStore((PixelStoreParameter)pname, param);\n\t\t}\n\n\t\tpublic GLRenderbufferHandle CreateRenderbuffer()\n\t\t{\n\t\t\tint r;\n\t\t\tGL.GenRenderbuffers(1, out r);\n\t\t\tAddContextObject(new RenderbufferDisposable(r));\n\t\t\treturn (GLRenderbufferHandle) r;\n\t\t}\n\n\t\tpublic void DeleteRenderbuffer(GLRenderbufferHandle renderbuffer)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_renderbuffers, (int) renderbuffer);\n\t\t}\n\n\t\tpublic void BindRenderbuffer(GLRenderbufferTarget target, GLRenderbufferHandle renderbuffer)\n\t\t{\n\t\t\t_currentRenderbufferBinding = renderbuffer;\n\t\t\tGL.BindRenderbuffer((RenderbufferTarget)target, (int) renderbuffer);\n\t\t}\n\n\t\tpublic void RenderbufferStorage(GLRenderbufferTarget target, GLRenderbufferStorage internalFormat, int width, int height)\n\t\t{\n\t\t\tGL.RenderbufferStorage((RenderbufferTarget)target, (RenderbufferInternalFormat)internalFormat, width, height);\n\t\t}\n\n\t\tpublic GLFramebufferHandle CreateFramebuffer()\n\t\t{\n\t\t\tint r;\n\t\t\tGL.GenFramebuffers(1, out r);\n\t\t\tAddContextObject(new FramebufferDisposable(r));\n\t\t\treturn (GLFramebufferHandle) r;\n\t\t}\n\n\t\tpublic void DeleteFramebuffer(GLFramebufferHandle fb)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_framebuffers, (int) fb);\n\t\t}\n\n\t\tpublic void BindFramebuffer(GLFramebufferTarget target, GLFramebufferHandle fb)\n\t\t{\n\t\t\t//if (!AppDomain.CurrentDomain.IsDefaultAppDomain())\n\t\t\t//\tSystem.Diagnostics.Debug.WriteLine(AppDomain.CurrentDomain.FriendlyName + \" bound \" + fb);\n\t\t\t_currentFramebufferBinding = fb;\n\t\t\tGL.BindFramebuffer((FramebufferTarget)target, (int) fb);\n\t\t}\n\n\t\tpublic void FramebufferTexture2D(GLFramebufferTarget target, GLFramebufferAttachment attachment, GLTextureTarget textarget, GLTextureHandle texture, int level)\n\t\t{\n\t\t\tGL.FramebufferTexture2D((FramebufferTarget)target, (FramebufferAttachment)attachment, (TextureTarget2d)textarget, (int)texture, level);\n\t\t}\n\n\t\tpublic void FramebufferRenderbuffer(GLFramebufferTarget target, GLFramebufferAttachment attachment, GLRenderbufferTarget renderbuffertarget, GLRenderbufferHandle renderbuffer)\n\t\t{\n\t\t\tGL.FramebufferRenderbuffer((FramebufferTarget)target, (FramebufferAttachment)attachment, (RenderbufferTarget)renderbuffertarget, (int)renderbuffer);\n\t\t}\n\n\t\tpublic void UseProgram(GLProgramHandle program)\n\t\t{\n\t\t\tGL.UseProgram((int) program);\n\t\t}\n\n\t\tpublic void BindAttribLocation(GLProgramHandle handle, int index, string name)\n\t\t{\n\t\t\tGL.BindAttribLocation((int) handle, index, name);\n\t\t}\n\n\t\tpublic int GetAttribLocation(GLProgramHandle program, string name)\n\t\t{\n\t\t\treturn GL.GetAttribLocation((int) program, name);\n\t\t}\n\n\t\tpublic int GetUniformLocation(GLProgramHandle program, string name)\n\t\t{\n\t\t\treturn GL.GetUniformLocation((int) program, name);\n\t\t}\n\n\t\tpublic void Uniform1(int location, int value)\n\t\t{\n\t\t\tGL.Uniform1(location, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Int2 value)\n\t\t{\n\t\t\tGL.Uniform2(location, value.X, value.Y);\n\t\t}\n\n\t\tpublic void Uniform3(int location, Int3 value)\n\t\t{\n\t\t\tGL.Uniform3(location, value.X, value.Y, value.Z);\n\t\t}\n\n\t\tpublic void Uniform4(int location, Int4 value)\n\t\t{\n\t\t\tGL.Uniform4(location, value.X, value.Y, value.Z, value.W);\n\t\t}\n\n\t\tpublic void Uniform1(int location, float value)\n\t\t{\n\t\t\tGL.Uniform1(location, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Float2 value)\n\t\t{\n\t\t\tGL.Uniform2(location, value.X, value.Y);\n\t\t}\n\n\t\tpublic void Uniform3(int location, Float3 value)\n\t\t{\n\t\t\tGL.Uniform3(location, value.X, value.Y, value.Z);\n\t\t}\n\n\t\tpublic void Uniform4(int location, Float4 value)\n\t\t{\n\t\t\tGL.Uniform4(location, value.X, value.Y, value.Z, value.W);\n\t\t}\n\n\t\tpublic void UniformMatrix2(int location, bool transpose, Float2x2 value)\n\t\t{\n\t\t\tGL.UniformMatrix2(location, 1, transpose, ref value.M11);\n\t\t}\n\n\t\tpublic void UniformMatrix3(int location, bool transpose, Float3x3 value)\n\t\t{\n\t\t\tGL.UniformMatrix3(location, 1, transpose, ref value.M11);\n\t\t}\n\n\t\tpublic void UniformMatrix4(int location, bool transpose, Float4x4 value)\n\t\t{\n\t\t\t// Who is always changing this function creating a temp array? Please stop committing your workarounds. Thanks\n\t\t\tGL.UniformMatrix4(location, 1, transpose, ref value.M11);\n\t\t}\n\n\t\tpublic void Uniform1(int location, int[] value)\n\t\t{\n\t\t\tGL.Uniform1(location, value.Length, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Int2[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (int* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform2(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform3(int location, Int3[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (int* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform3(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform4(int location, Int4[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (int* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform4(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform1(int location, float[] value)\n\t\t{\n\t\t\tGL.Uniform1(location, value.Length, value);\n\t\t}\n\n\t\tpublic void Uniform2(int location, Float2[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (float* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform2(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform3(int location, Float3[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (float* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform3(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void Uniform4(int location, Float4[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t{\n\t\t\t\tunsafe\n\t\t\t\t{\n\t\t\t\t\tfixed (float* p = &value[0].X)\n\t\t\t\t\t\tGL.Uniform4(location, value.Length, p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic void UniformMatrix2(int location, bool transpose, Float2x2[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t\tGL.UniformMatrix2(location, value.Length, transpose, ref value[0].M11);\n\t\t}\n\n\t\tpublic void UniformMatrix3(int location, bool transpose, Float3x3[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t\tGL.UniformMatrix3(location, value.Length, transpose, ref value[0].M11);\n\t\t}\n\n\t\tpublic void UniformMatrix4(int location, bool transpose, Float4x4[] value)\n\t\t{\n\t\t\tif (value.Length > 0)\n\t\t\t\tGL.UniformMatrix4(location, value.Length, transpose, ref value[0].M11);\n\t\t}\n\n\t\tpublic void EnableVertexAttribArray(int index)\n\t\t{\n\t\t\tGL.EnableVertexAttribArray(index);\n\t\t}\n\n\t\tpublic void DisableVertexAttribArray(int index)\n\t\t{\n\t\t\tGL.DisableVertexAttribArray(index);\n\t\t}\n\n\t\tpublic void VertexAttribPointer(int index, int size, GLDataType type, bool normalized, int stride, int offset)\n\t\t{\n\t\t\tGL.VertexAttribPointer(index, size, (VertexAttribPointerType)type, normalized, stride, offset);\n\t\t}\n\n\t\tpublic void DrawArrays(GLPrimitiveType mode, int first, int count)\n\t\t{\n\t\t\tGL.DrawArrays((PrimitiveType)mode, first, count);\n\t\t}\n\n\t\tpublic void DrawElements(GLPrimitiveType mode, int count, GLIndexType type, int offset)\n\t\t{\n\t\t\tGL.DrawElements((BeginMode)mode, count, (DrawElementsType)type, offset);\n\t\t}\n\n\t\tpublic GLBufferHandle CreateBuffer()\n\t\t{\n\t\t\tint r;\n\t\t\tGL.GenBuffers(1, out r);\n\t\t\tAddContextObject(new BufferDisposable(r));\n\t\t\treturn (GLBufferHandle) r;\n\t\t}\n\n\t\tpublic void DeleteBuffer(GLBufferHandle buffer)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_buffers, (int) buffer);\n\t\t}\n\n\t\tpublic void BindBuffer(GLBufferTarget target, GLBufferHandle buffer)\n\t\t{\n\t\t\tGL.BindBuffer((BufferTarget)target, (int) buffer);\n\t\t}\n\n\t\tpublic void BufferData(GLBufferTarget target, int sizeInBytes, IntPtr data, GLBufferUsage usage)\n\t\t{\n\t\t\tGL.BufferData((BufferTarget)target, (IntPtr)sizeInBytes, data, (BufferUsageHint)usage);\n\t\t}\n\n\t\tpublic void BufferSubData(GLBufferTarget target, int offset, int sizeInBytes, IntPtr data)\n\t\t{\n\t\t\tGL.BufferSubData((BufferTarget)target, (IntPtr)offset, (IntPtr)sizeInBytes, data);\n\t\t}\n\n\t\tpublic void Enable(GLEnableCap cap)\n\t\t{\n\t\t\tGL.Enable((EnableCap)cap);\n\t\t}\n\n\t\tpublic void Disable(GLEnableCap cap)\n\t\t{\n\t\t\tGL.Disable((EnableCap)cap);\n\t\t}\n\n\t\tpublic bool IsEnabled(GLEnableCap cap)\n\t\t{\n\t\t\treturn GL.IsEnabled((EnableCap)cap);\n\t\t}\n\n\t\tpublic void BlendFunc(GLBlendingFactor src, GLBlendingFactor dst)\n\t\t{\n\t\t\tGL.BlendFunc((BlendingFactorSrc)src, (BlendingFactorDest)dst);\n\t\t}\n\n\t\tpublic void BlendFuncSeparate(GLBlendingFactor srcRGB, GLBlendingFactor dstRGB, GLBlendingFactor srcAlpha, GLBlendingFactor dstAlpha)\n\t\t{\n\t\t\tGL.BlendFuncSeparate((BlendingFactorSrc)srcRGB, (BlendingFactorDest)dstRGB,\n\t\t\t\t(BlendingFactorSrc)srcAlpha, (BlendingFactorDest)dstAlpha);\n\t\t}\n\n\t\tpublic void BlendEquation(GLBlendEquation mode)\n\t\t{\n\t\t\tGL.BlendEquation((BlendEquationMode)mode);\n\t\t}\n\n\t\tpublic void BlendEquationSeparate(GLBlendEquation modeRgb, GLBlendEquation modeAlpha)\n\t\t{\n\t\t\tGL.BlendEquationSeparate((BlendEquationMode)modeRgb, (BlendEquationMode)modeAlpha);\n\t\t}\n\n\t\tpublic void CullFace(GLCullFaceMode mode)\n\t\t{\n\t\t\tGL.CullFace((CullFaceMode)mode);\n\t\t}\n\n\t\tpublic void FrontFace(GLFrontFaceDirection mode)\n\t\t{\n\t\t\tGL.FrontFace((FrontFaceDirection)mode);\n\t\t}\n\n\t\tpublic void DepthFunc(GLDepthFunction func)\n\t\t{\n\t\t\tGL.DepthFunc((DepthFunction)func);\n\t\t}\n\n\t\tpublic void Scissor(int x, int y, int width, int height)\n\t\t{\n\t\t\tGL.Scissor(x, y, width, height);\n\t\t}\n\n\t\tpublic void Viewport(int x, int y, int width, int height)\n\t\t{\n\t\t\tGL.Viewport(x, y, width, height);\n\t\t}\n\n\t\tpublic void LineWidth(float width)\n\t\t{\n\t\t\tGL.LineWidth(width);\n\t\t}\n\n\t\tpublic void PolygonOffset(float factor, float units)\n\t\t{\n\t\t\tGL.PolygonOffset(factor, units);\n\t\t}\n\n\t\tpublic void DepthRange(float zNear, float zFar)\n\t\t{\n\t\t\tGL.DepthRange(zNear, zFar);\n\t\t}\n\n\t\tpublic GLShaderHandle CreateShader(GLShaderType type)\n\t\t{\n\t\t\tint shaderName = GL.CreateShader((ShaderType)type);\n\t\t\tAddContextObject(new ShaderDisposable(shaderName));\n\t\t\treturn (GLShaderHandle) shaderName;\n\t\t}\n\n\t\tpublic void DeleteShader(GLShaderHandle shader)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_shaders, (int) shader);\n\t\t}\n\n\t\tpublic void ShaderSource(GLShaderHandle shader, string source)\n\t\t{\n\t\t\tGL.ShaderSource((int) shader, source);\n\t\t}\n\n\t\tpublic void ReadPixels(int x, int y, int width, int height, GLPixelFormat format, GLPixelType type, byte[] buffer)\n\t\t{\n\t\t\tGL.ReadPixels(x, y, width, height, (PixelFormat)format, (PixelType)type, buffer);\n\t\t}\n\n\t\tpublic void CompileShader(GLShaderHandle shader)\n\t\t{\n\t\t\tGL.CompileShader((int) shader);\n\t\t}\n\n\t\tpublic int GetShaderParameter(GLShaderHandle shader, GLShaderParameter pname)\n\t\t{\n\t\t\tint result;\n\t\t\tGL.GetShader((int) shader, (ShaderParameter)pname, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic string GetShaderInfoLog(GLShaderHandle shader)\n\t\t{\n\t\t\treturn GL.GetShaderInfoLog((int) shader);\n\t\t}\n\n\t\tpublic bool HasGetShaderPrecisionFormat { get { return false; }}\n\n\t\tpublic GLShaderPrecisionFormat GetShaderPrecisionFormat(GLShaderType shader, GLShaderPrecision precision)\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic GLProgramHandle CreateProgram()\n\t\t{\n\t\t\tint programName = GL.CreateProgram();\n\t\t\tAddContextObject(new ProgramDisposable(programName));\n\n\t\t\treturn (GLProgramHandle) programName;\n\t\t}\n\n\t\tpublic void DeleteProgram(GLProgramHandle program)\n\t\t{\n\t\t\tDisposeAndRemoveObject(_programs, (int) program);\n\t\t}\n\n\t\tpublic void AttachShader(GLProgramHandle program, GLShaderHandle shader)\n\t\t{\n\t\t\tGL.AttachShader((int) program, (int) shader);\n\t\t}\n\n\t\tpublic void DetachShader(GLProgramHandle program, GLShaderHandle shader)\n\t\t{\n\t\t\tGL.DetachShader((int) program, (int) shader);\n\t\t}\n\n\t\tpublic void LinkProgram(GLProgramHandle program)\n\t\t{\n\t\t\tGL.LinkProgram((int) program);\n\t\t}\n\n\t\tpublic int GetProgramParameter(GLProgramHandle program, GLProgramParameter pname)\n\t\t{\n\t\t\tint result;\n\t\t\tGL.GetProgram((int) program, (GetProgramParameterName)pname, out result);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic string GetProgramInfoLog(GLProgramHandle program)\n\t\t{\n\t\t\treturn GL.GetProgramInfoLog((int) program);\n\t\t}\n\n\n\t\tpublic string GetString(GLStringName name)\n\t\t{\n\t\t\tvar value = GL.GetString((StringName)name);\n\n\t\t\tif (name == GLStringName.Version && value.Contains(\"ANGLE\"))\n\t\t\t\treturn \"2.1\";\n\n\t\t\treturn value;\n\t\t}\n\n\t\tpublic GLRenderbufferHandle GetRenderbufferBinding()\n\t\t{\n\t\t\treturn _currentRenderbufferBinding;\n\t\t\t//return OpenTK.Graphics.OpenGL.OpenTKWrapper.GetInteger(OpenTK.Graphics.OpenGL.GetPName.RenderbufferBinding);\n\t\t}\n\n\t\tpublic GLFramebufferHandle GetFramebufferBinding()\n\t\t{\n\t\t\treturn _currentFramebufferBinding;\n\t\t\t//return OpenTK.Graphics.OpenGL.OpenTKWrapper.GetInteger(OpenTK.Graphics.OpenGL.GetPName.FramebufferBinding);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/win/Program.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Threading;\nusing System.Windows.Forms;\nusing Outracks.Extensions;\nusing Outracks.Fuse.Analytics;\nusing Outracks.Fusion;\nusing Outracks.Fusion.Windows;\nusing Outracks.IO;\nusing Outracks.UnoHost.Windows.Protocol;\nusing Application = Uno.Application;\nusing Cursors = System.Windows.Forms.Cursors;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tclass Program\n\t{\n\t\tstatic Program()\n\t\t{\n\t\t\tThread.CurrentThread.SetInvariantCulture();\n#if DEBUG\n\t\t\tConsoleExtensions.RedirectStreamsToLogFiles(\"unohost\");\n#endif\n\t\t}\n\n\t\t[STAThread]\n\t\tstatic void Main(string[] argsArray)\n\t\t{\n#if DEBUG\n\t\t\tConsole.WriteLine(DateTime.Now);\n\t\t\tConsole.WriteLine(\"Arguments: \" + argsArray.Join(\", \"));\n#endif\n\t\t\tvar shell = new Shell();\n\t\t\tvar systemId = SystemGuidLoader.LoadOrCreateOrEmpty();\n\t\t\tvar sessionId = Guid.NewGuid();\n\t\t\tvar log = ReportFactory.GetReporter(systemId, sessionId, \"UnoHost\");\n\t\t\tAppDomain.CurrentDomain.ReportUnhandledExceptions(log);\n\n\t\t\tDpiAwareness.SetDpiAware(DpiAwareness.ProcessDpiAwareness.SystemAware);\n\n\t\t\tNativeResources.Load();\n\n\t\t\tvar args = UnoHostArgs.RemoveFrom(argsArray.ToList(), shell);\n\n\t\t\t// Load metadata\n\t\t\tvar unoHostProject = UnoHostProject.Load(args.MetadataPath, shell);\n\n\t\t\tvar form = new DpiAwareForm()\n\t\t\t{\n\t\t\t\tFormBorderStyle = FormBorderStyle.None,\n\t\t\t\tShowInTaskbar = false\n\t\t\t};\n\n#if DEBUG\n\t\t\t// Flush logs to disk\n\t\t\tvoid FlushConsole()\n\t\t\t{\n\t\t\t\tConsole.Error.Flush();\n\t\t\t\tConsole.Out.Flush();\n\t\t\t}\n\n\t\t\tAppDomain.CurrentDomain.UnhandledException += (_, __) => FlushConsole();\n\t\t\tform.FormClosing += (_, __) => FlushConsole();\n\t\t\tform.Load += (_, __) => FlushConsole();\n\t\t\tFlushConsole();\n#endif\n\n\t\t\t//if (args.IsDebug)\n\t\t\t//\tInitDebugMode(form);\n\n\t\t\tvar unoControl = new UnoControl(form, log);\n\t\t\tform.Controls.Add(unoControl);\n\t\t\tform.ShowIcon = false;\n\n\n\t\t\tvar openGlVersion = new Subject<OpenGlVersion>();\n\t\t\tvar backgroundQueue = new QueuedDispatcher();\n\t\t\tvar lostFocus = Observable.FromEventPattern(unoControl, \"LostFocus\").ObserveOn(backgroundQueue);\n\n\t\t\tvar messagesTo = new Subject<IBinaryMessage>();\n\n\t\t\tvar output = Observable.Merge(\n\t\t\t\tmessagesTo.Do(message => Console.WriteLine(message.Type)),\n\t\t\t\topenGlVersion.Select(OpenGlVersionMessage.Compose),\n\t\t\t\tObservable.FromEventPattern(unoControl, \"GotFocus\").Select(_ => WindowFocusMessage.Compose(FocusState.Focused)),\n\t\t\t\tlostFocus.Select(_ => WindowFocusMessage.Compose(FocusState.Blurred)),\n\t\t\t\tlostFocus.Select(_ => WindowContextMenuMessage.Compose(false)),\n\t\t\t\tObservable.FromEventPattern<System.Windows.Forms.MouseEventArgs>(unoControl, \"MouseUp\")\n\t\t\t\t\t.Where(m => m.EventArgs.Button == System.Windows.Forms.MouseButtons.Right)\n\t\t\t\t\t.Select(_ => WindowContextMenuMessage.Compose(true)),\n\t\t\t\tObservable.FromEventPattern<System.Windows.Forms.MouseEventArgs>(unoControl, \"MouseDown\")\n\t\t\t\t\t.Select(_ => WindowContextMenuMessage.Compose(false)),\n\t\t\t\tObservable.FromEventPattern<System.Windows.Forms.MouseEventArgs>(unoControl, \"MouseWheel\")\n\t\t\t\t\t.Select(m => WindowMouseScrollMessage.Compose(m.EventArgs.Delta)),\n\t\t\t\tObservable.FromEventPattern<KeyEventArgs>(unoControl, \"KeyDown\")\n\t\t\t\t\t.Select(m => WindowKeyDown.Compose(m.EventArgs.KeyCode)),\n\t\t\t\tObservable.FromEventPattern<KeyEventArgs>(unoControl, \"KeyUp\")\n\t\t\t\t\t.Select(m => WindowKeyUp.Compose(m.EventArgs.KeyCode)));\n\n\t\t\targs.OutputPipe.BeginWritingMessages(\n\t\t\t\t\"Designer\",\n\t\t\t\tex => Console.WriteLine(\"UnoHost failed to write message to designer: \" + ex),\n\t\t\t\toutput.ObserveOn(new QueuedDispatcher()));\n\n\t\t\tunoControl.Initialize(unoHostProject, openGlVersion);\n\n\t\t\t// Set hand cursor so we know when we're interacting with the UnoHost and not in the designer\n\t\t\tunoControl.Cursor = Cursors.Hand;\n\n\t\t\t// notify studio about the window\n\t\t\tmessagesTo.OnNext(WindowCreatedMessage.Compose(form.Handle));\n\n\t\t\tvar dispatcher = new PollingDispatcher(Thread.CurrentThread);\n\n\t\t\tunoControl.PerFrame.Subscribe(f => dispatcher.DispatchCurrent());\n\n\n\t\t\tvar density = Observable.Return(new Ratio<Points, Pixels>(1));\n\n\t\t\tvar size = Observable.FromEventPattern(unoControl, \"SizeChanged\")\n\t\t\t\t.StartWith(new EventPattern<object>(null, null))\n\t\t\t\t.Select(_ => unoControl.Size.ToSize())\n\t\t\t\t.CombineLatest(density, (s, d) => s.Mul(d))\n\t\t\t\t.Transpose();\n\n\t\t\tvar messagesFrom = args.InputPipe\n\t\t\t\t.ReadMessages(\"Designer\")\n\t\t\t\t.RefCount()\n\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t.Publish();\n\t\t\tmessagesFrom\n\t\t\t\t.SelectSome(MouseEventMessage.TryParse)\n\t\t\t\t.Subscribe(unoControl.OnMouseEvent);\n\n\t\t\tmessagesFrom.Subscribe(next => { }, e => form.Exit(1), () => form.Exit(0));\n\n\t\t\tmessagesFrom\n\t\t\t\t.SelectSome(SetSurfaceMessage.TryParse)\n\t\t\t\t.Subscribe(texture => unoControl.SetBackingSurface(texture));\n\n\t\t\t// Run the uno entrypoints, this initializes Uno.Application.Current\n\n\t\t\tunoHostProject.ExecuteStartupCode();\n\t\t\tvar app = Application.Current as dynamic;\n\n\n\t\t\t// Init plugins\n\n\t\t\tFusionImplementation.Initialize(dispatcher, args.UserDataPath, app.Reflection);\n\t\t\tvar overlay = PluginManager.Initialize(messagesFrom, messagesTo, dispatcher, unoControl.PerFrame, size);\n\t\t\tapp.ResetEverything(true, overlay);\n\n\n\t\t\t// Ready to go\n\n\t\t\tmessagesFrom.Connect();\n\t\t\tmessagesTo.OnNext(new Ready());\n\n\t\t\tunoControl.Run();\n\t\t}\n\n\t\tpublic static void InitDebugMode(DpiAwareForm form)\n\t\t{\n\t\t\tform.FormBorderStyle = FormBorderStyle.Sizable;\n\t\t\tform.Size = new System.Drawing.Size(1000, 1000);\n\t\t\tform.StartPosition = FormStartPosition.CenterScreen;\n\t\t\tform.FpsProfiler\n\t\t\t\t.GetAverageFramesPerSecond(40)\n\t\t\t\t.Subscribe(fps => form.Text = fps.ToString());\n\t\t\tform.Show();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/win/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Windows.Media;\n\n[assembly: AssemblyTitle(\"unohost\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: DisableDpiAwareness]\n"
  },
  {
    "path": "src/unohost/win/Protocol/EventMessage.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Outracks.UnoHost.Windows.Protocol\n{\n\tpublic enum MouseEventType\n\t{\n\t\tMouseDown,\n\t\tMouseUp,\n\t\tMouseMove\n\t}\n\n\tpublic class MouseEventArgs\n\t{\n\t\tpublic readonly MouseEventType EventType;\n\t\tpublic readonly Point<Pixels> Position;\n\n\t\tpublic MouseEventArgs(MouseEventType eventType, Point<Pixels> position)\n\t\t{\n\t\t\tEventType = eventType;\n\t\t\tPosition = position;\n\t\t}\n\t}\n\n\tpublic static class MouseEventMessage\n\t{\n\t\tconst string Type = \"Windows.MouseEvent\";\n\n\t\tpublic static IBinaryMessage Compose(MouseEventArgs eventArgs)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer =>\n\t\t\t{\n\t\t\t\twriter.Write((int)eventArgs.EventType);\n\t\t\t\twriter.Write((double)eventArgs.Position.X);\n\t\t\t\twriter.Write((double)eventArgs.Position.Y);\n\t\t\t});\n\t\t}\n\n\t\tpublic static Optional<MouseEventArgs> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type,\n\t\t\t\treader =>\n\t\t\t\t{\n\t\t\t\t\tvar type = (MouseEventType)reader.ReadInt32();\n\t\t\t\t\treturn new MouseEventArgs(type, new Point<Pixels>(reader.ReadDouble(), reader.ReadDouble()));\n\t\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/Protocol/SetSurfaceMessage.cs",
    "content": "using System;\nusing System.IO;\nusing System.Reactive;\n\nnamespace Outracks.UnoHost.Windows.Protocol\n{\n\tpublic class TextureWithSize\n\t{\n\t\tpublic readonly IntPtr D3DTextureHandle;\n\t\tpublic readonly Size<Pixels> Size;\n\t\tpublic readonly Ratio<Pixels, Points> Dpi;\n\n\t\tpublic TextureWithSize(IntPtr d3DTextureHandle, Size<Pixels> size, Ratio<Pixels,Points> dpi)\n\t\t{\n\t\t\tD3DTextureHandle = d3DTextureHandle;\n\t\t\tSize = size;\n\t\t\tDpi = dpi;\n\t\t}\n\n\t\tpublic void Write(BinaryWriter writer)\n\t\t{\n\t\t\twriter.Write(D3DTextureHandle.ToInt32());\n\t\t\twriter.Write((double)Size.Width);\n\t\t\twriter.Write((double)Size.Height);\n\t\t\twriter.Write(Dpi);\n\t\t}\n\n\t\tpublic static TextureWithSize Read(BinaryReader reader)\n\t\t{\n\t\t\treturn new TextureWithSize(\n\t\t\t\tnew IntPtr(reader.ReadInt32()),\n\t\t\t\tnew Size<Pixels>(reader.ReadDouble(), reader.ReadDouble()),\n\t\t\t\treader.ReadDouble());\n\t\t}\n\t}\n\n\tpublic static class SetSurfaceMessage\n\t{\n\t\tconst string Type = \"Windows.SetSurface\";\n\n\t\tpublic static IBinaryMessage Compose(TextureWithSize textureWithSize)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, textureWithSize.Write);\n\t\t}\n\n\t\tpublic static Optional<TextureWithSize> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, TextureWithSize.Read);\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/Protocol/WindowContextMenuMessage.cs",
    "content": "namespace Outracks.UnoHost.Windows.Protocol\n{\n\tpublic static class WindowContextMenuMessage\n\t{\n\t\tconst string Type = \"Windows.WindowContextMenuMessage\";\n\n\t\tpublic static IBinaryMessage Compose(bool show)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer => writer.Write(show));\n\t\t}\n\n\t\tpublic static Optional<bool> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, reader => reader.ReadBoolean());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/Protocol/WindowCreatedMessage.cs",
    "content": "using System;\n\nnamespace Outracks.UnoHost.Windows.Protocol\n{\n\tpublic static class WindowCreatedMessage\n\t{\n\t\tconst string Type = \"Windows.WindowCreated\";\n\n\t\tpublic static IBinaryMessage Compose(IntPtr hwnd)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer =>\n\t\t\t\twriter.Write(hwnd.ToInt32()));\n\t\t}\n\n\t\tpublic static Optional<IntPtr> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, reader =>\n\t\t\t\tnew IntPtr(reader.ReadInt32()));\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/Protocol/WindowKeyBoard.cs",
    "content": "﻿using System.Windows.Forms;\n\nnamespace Outracks.UnoHost.Windows.Protocol\n{\n\tpublic static class WindowKeyDown\n\t{\n\t\tconst string Type = \"Windows.WindowKeyDown\";\n\n\t\tpublic static IBinaryMessage Compose(Keys keys)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer => writer.Write((int)keys));\n\t\t}\n\n\t\tpublic static Optional<Keys> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, reader => (Keys)reader.ReadInt32());\n\t\t}\n\t}\n\n\tpublic static class WindowKeyUp\n\t{\n\t\tconst string Type = \"Windows.WindowKeyUp\";\n\n\t\tpublic static IBinaryMessage Compose(Keys keys)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer => writer.Write((int)keys));\n\t\t}\n\n\t\tpublic static Optional<Keys> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, reader => (Keys)reader.ReadInt32());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/Protocol/WindowMouseScrollMessage.cs",
    "content": "﻿namespace Outracks.UnoHost.Windows.Protocol\n{\n\tpublic static class WindowMouseScrollMessage\n\t{\n\t\tconst string Type = \"Windows.WindowMouseScrollMessage\";\n\n\t\tpublic static IBinaryMessage Compose(int delta)\n\t\t{\n\t\t\treturn BinaryMessage.Compose(Type, writer => writer.Write(delta));\n\t\t}\n\n\t\tpublic static Optional<int> TryParse(IBinaryMessage message)\n\t\t{\n\t\t\treturn message.TryParse(Type, reader => reader.ReadInt32());\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/unohost/win/UnoControl.cs",
    "content": "using System;\nusing System.Diagnostics;\nusing System.Reactive.Subjects;\nusing System.Windows.Forms;\nusing OpenGL;\nusing OpenTK;\nusing OpenTK.Graphics;\nusing OpenTK.Platform;\nusing Outracks.UnoHost.Windows.Protocol;\nusing Uno.IO;\nusing Uno.Platform;\nusing Uno.Platform.Internal;\nusing Application = Uno.Application;\nusing MouseEventArgs = Outracks.UnoHost.Windows.Protocol.MouseEventArgs;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tclass UnoControl : UserControl, IUnoCallbacks\n\t{\n\t\treadonly DpiAwareForm _form;\n\t\treadonly IReport _log;\n\t\treadonly UnoWindow _unoWindow;\n\t\treadonly UnoGraphicsContext _unoGraphics;\n\t\treadonly GraphicsContext _glContext;\n\n\t\tpublic UnoControl(DpiAwareForm form, IReport log)\n\t\t{\n\t\t\t_form = form;\n\t\t\t_log = log;\n\n\t\t\tSetStyle(ControlStyles.Opaque, true);\n\t\t\tSetStyle(ControlStyles.UserPaint, true);\n\t\t\tSetStyle(ControlStyles.AllPaintingInWmPaint, true);\n\t\t\tDoubleBuffered = false;\n\t\t\tDock = DockStyle.Fill;\n\n\t\t\t// set up an OpenTK context\n\t\t\tToolkit.Init(new ToolkitOptions { Backend = PlatformBackend.PreferNative });\n\t\t\tvar windowInfo = Utilities.CreateAngleWindowInfo(Utilities.CreateWindowsWindowInfo(Handle));\n\t\t\t_glContext = ContextFactory.CreateContext(windowInfo);\n\t\t\t_glContext.SwapInterval = 0;\n\n\t\t\t_unoWindow = new UnoWindow(this);\n\t\t\t_unoGraphics = new UnoGraphicsContext(_unoWindow);\n\n\n\t\t\t_form.PreviewKeyDown += (sender, e) =>\n\t\t\t{\n\t\t\t\t// TODO: By doing this the tab key will not be sent to wpf at all, it should be treated as IsInputKey only when not handled by Uno. A better solution could be done by reading http://msdn.microsoft.com/en-us/library/ms742474%28v=vs.110%29.aspx and http://blogs.msdn.com/b/nickkramer/archive/2006/06/09/623203.aspx\n\n\t\t\t\tvar codeWithoutModifiers = e.KeyCode & (~Keys.Control) & (~Keys.Shift);\n\n\t\t\t\tswitch (codeWithoutModifiers)\n\t\t\t\t{\n\t\t\t\t\tcase Keys.Left:\n\t\t\t\t\tcase Keys.Right:\n\t\t\t\t\tcase Keys.Up:\n\t\t\t\t\tcase Keys.Down:\n\t\t\t\t\tcase Keys.Tab:\n\t\t\t\t\t\te.IsInputKey = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tFocus();\n\t\t}\n\n\t\tpublic void Initialize(UnoHostProject project, IObserver<OpenGlVersion> glObserver)\n\t\t{\n\t\t\tBundle.Initialize(project.Assembly);\n\n\t\t\tIGL gl = new OpenTKGL();\n#if DEBUG\n\t\t\tGL.Initialize(gl, true);\n#else\n\t\t\tGL.Initialize(gl, false);\n#endif\n\t\t\tGraphicsContextBackend.SetInstance(_unoGraphics);\n\t\t\tWindowBackend.SetInstance(_unoWindow);\n\t\t\tglObserver.OnNext(\n\t\t\t\tnew OpenGlVersion(\n\t\t\t\t\tgl.GetString(GLStringName.Version),\n\t\t\t\t\tgl.GetString(GLStringName.Vendor),\n\t\t\t\t\tgl.GetString(GLStringName.Renderer)));\n\n\t\t\t// Hook up size / dpi changed\n\n\t\t\t_form.DpiChanged += (s, a) =>\n\t\t\t{\n\t\t\t\t_unoWindow.ChangeSize(Size.ToPixelSize(), _form.Density);\n\t\t\t\tPerformRepaint();\n\t\t\t};\n\n\t\t\tResize += (s, a) =>\n\t\t\t{\n\t\t\t\t_unoWindow.ChangeSize(Size.ToPixelSize(), _form.Density);\n\t\t\t\tPerformRepaint();\n\t\t\t};\n\n\t\t\t_form.Closed += (s, a) => Bootstrapper.OnAppTerminating(_unoWindow);\n\n\n\t\t\t// Hook up mouse events\n\n\t\t\tMouseDown += (s, a) =>\n\t\t\t\t_log.TrySomethingBlocking(\n\t\t\t\t\t() =>\n\t\t\t\t\t{\n\t\t\t\t\t\tif (a.Button == System.Windows.Forms.MouseButtons.Right)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tBootstrapper.OnMouseDown(_unoWindow, a.X, a.Y, a.Button.ToUno());\n\t\t\t\t\t});\n\n\t\t\tMouseUp += (s, a) =>\n\t\t\t\t_log.TrySomethingBlocking(() => Bootstrapper.OnMouseUp(_unoWindow, a.X, a.Y, a.Button.ToUno()));\n\n\t\t\tMouseMove += (s, a) =>\n\t\t\t\t_log.TrySomethingBlocking(() => Bootstrapper.OnMouseMove(_unoWindow, a.X, a.Y));\n\n\t\t\t//control.MouseEnter += (s, a) =>\n\t\t\t//\tlog.TrySomethingBlocking(() => toApp.OnPointerEvent(new PointerEnterEventArgs(WinFormsInputState.Query())));\n\n\t\t\tMouseLeave += (s, a) =>\n\t\t\t\t_log.TrySomethingBlocking(() => Bootstrapper.OnMouseOut(_unoWindow));\n\n\t\t\tMouseWheel += (s, a) =>\n\t\t\t{\n\t\t\t\tvar numLinesPerScroll = SystemInformation.MouseWheelScrollLines;\n\t\t\t\tvar deltaMode = numLinesPerScroll > 0\n\t\t\t\t\t? WheelDeltaMode.DeltaLine\n\t\t\t\t\t: WheelDeltaMode.DeltaPage;\n\n\t\t\t\tvar delta = deltaMode == WheelDeltaMode.DeltaLine\n\t\t\t\t\t? (a.Delta / 120.0f) * (float)numLinesPerScroll\n\t\t\t\t\t: a.Delta / 120.0f;\n\n\t\t\t\t_log.TrySomethingBlocking(() => Bootstrapper.OnMouseWheel(_unoWindow, 0, delta, (int)deltaMode));\n\t\t\t};\n\n\n\t\t\t// Hook up keyboard events\n\n\t\t\tKeyDown += (s, a) =>\n\t\t\t\t_log.TrySomethingBlocking(() =>\n\t\t\t\t\ta.Handled = a.KeyCode.ToKey().MatchWith(\n\t\t\t\t\t\tkey => Bootstrapper.OnKeyDown(_unoWindow, key),\n\t\t\t\t\t\t() => false));\n\n\t\t\tKeyUp += (s, a) =>\n\t\t\t\t_log.TrySomethingBlocking(() =>\n\t\t\t\t\ta.Handled = a.KeyCode.ToKey().MatchWith(\n\t\t\t\t\t\tkey => Bootstrapper.OnKeyUp(_unoWindow, key),\n\t\t\t\t\t\t() => false));\n\n\t\t\tKeyPress += (s, a) =>\n\t\t\t\t_log.TrySomethingBlocking(() =>\n\t\t\t\t{\n\t\t\t\t\tif (!char.IsControl(a.KeyChar))\n\t\t\t\t\t\ta.Handled = Bootstrapper.OnTextInput(_unoWindow, a.KeyChar.ToString());\n\t\t\t\t});\n\n\t\t\t_unoWindow.ChangeSize(_form.Size.ToPixelSize(), _form.Density);\n\t\t}\n\n\t\tpublic void OnMouseEvent(MouseEventArgs args)\n\t\t{\n\t\t\tswitch (args.EventType)\n\t\t\t{\n\t\t\t\tcase MouseEventType.MouseDown:\n\t\t\t\t\tBootstrapper.OnMouseDown(_unoWindow, (int)args.Position.X, (int)args.Position.Y, Uno.Platform.MouseButton.Left);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MouseEventType.MouseUp:\n\t\t\t\t\tBootstrapper.OnMouseUp(_unoWindow, (int)args.Position.X, (int)args.Position.Y, Uno.Platform.MouseButton.Left);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MouseEventType.MouseMove:\n\t\t\t\t\tBootstrapper.OnMouseMove(_unoWindow, (int) args.Position.X, (int) args.Position.Y);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tprotected override CreateParams CreateParams\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tconst int CS_VREDRAW = 0x1;\n\t\t\t\tconst int CS_HREDRAW = 0x2;\n\t\t\t\tconst int CS_OWNDC = 0x20;\n\n\t\t\t\tvar cp = base.CreateParams;\n\n\t\t\t\t// Setup necessary class style for OpenGL on windows\n\t\t\t\tcp.ClassStyle |= CS_VREDRAW | CS_HREDRAW | CS_OWNDC;\n\n\t\t\t\treturn cp;\n\t\t\t}\n\t\t}\n\n\t\treadonly Stopwatch _timer = Stopwatch.StartNew();\n\t\treadonly ISubject<double> _perFrame = new Subject<double>();\n\t\tpublic IObservable<double> PerFrame { get { return _perFrame; } }\n\n\t\t/*\n\t\t * STAThread will run the message pumping system in WinForms when the main thread is waiting on a wait handle\n\t\t * So it basically 'yields', which can make 'PerformRepaint' to run again during 'Bootstrapper.OnUpdate' or 'Bootstrapper.OnDraw'\n\t\t * which fuselibs doesn't expect of course. So yeah, Windows COM pattern sucks at times. It could be solved by listening for Paint on the control\n\t\t * however the performance isn't as good as current approach.\n\t\t */\n\t\tbool _isInFuselibs = false;\n\n\t\tpublic void SetBackingSurface(TextureWithSize texture)\n\t\t{\n\t\t\t_unoWindow.ChangeSize(texture.Size, texture.Dpi);\n\n\t\t\tvar display = Egl.GetCurrentDisplay();\n\t\t\tvar emptyAttribs = new[]\n\t\t\t{\n\t\t\t\tEgl.EGL_RED_SIZE, 8,\n\t\t\t\tEgl.EGL_GREEN_SIZE, 8,\n\t\t\t\tEgl.EGL_BLUE_SIZE, 8,\n\t\t\t\tEgl.EGL_ALPHA_SIZE, 8,\n\t\t\t\tEgl.EGL_NONE\n\t\t\t};\n\n\t\t\tvar configs = new IntPtr[1];\n\t\t\tint numConfigs = 0;\n\t\t\tvar foundConfig = Egl.ChooseConfig(display, emptyAttribs, configs, 1, ref numConfigs);\n\t\t\tif (!foundConfig)\n\t\t\t\treturn;\n\n\t\t\tvar pbufferAttribs = new[]\n\t\t\t{\n\t\t\t\tEgl.EGL_WIDTH, (int)texture.Size.Width,\n\t\t\t\tEgl.EGL_HEIGHT, (int)texture.Size.Height,\n\t\t\t\tEgl.EGL_TEXTURETARGET, Egl.EGL_TEXTURE_2D,\n\t\t\t\tEgl.EGL_TEXTURE_FORMAT, Egl.EGL_TEXTURE_RGBA,\n\t\t\t\tEgl.EGL_NONE\n\t\t\t};\n\n\t\t\tvar surface = Egl.CreatePbufferFromClientBuffer(display, Egl.EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE, texture.D3DTextureHandle, configs[0], pbufferAttribs);\n\n\t\t\tvar tex = GL.CreateTexture();\n\t\t\tGL.BindTexture(GLTextureTarget.Texture2D, tex);\n\n\t\t\tEgl.BindTexImage(display, surface, Egl.EGL_BACK_BUFFER);\n\n\t\t\tGL.TexParameter(GLTextureTarget.Texture2D, GLTextureParameterName.MinFilter, GLTextureParameterValue.Nearest);\n\t\t\tGL.TexParameter(GLTextureTarget.Texture2D, GLTextureParameterName.MagFilter, GLTextureParameterValue.Nearest);\n\t\t\tGL.BindTexture(GLTextureTarget.Texture2D, GLTextureHandle.Zero);\n\n\t\t\tvar framebuf = GL.CreateFramebuffer();\n\t\t\tGL.BindFramebuffer(GLFramebufferTarget.Framebuffer, framebuf);\n\t\t\tGL.FramebufferTexture2D(GLFramebufferTarget.Framebuffer, GLFramebufferAttachment.ColorAttachment0, GLTextureTarget.Texture2D, tex, 0);\n\n\t\t\t_unoGraphics.ChangeBackbuffer(framebuf);\n\t\t\tPerformRepaint();\n\t\t}\n\n\t\tpublic void PerformRepaint()\n\t\t{\n\t\t\tif (_isInFuselibs)\n\t\t\t\treturn;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (_unoWindow.Size.HasZeroArea())\n\t\t\t\t\treturn;\n\n\t\t\t\tif (Application.Current == null)\n\t\t\t\t\treturn;\n\n\t\t\t\t_isInFuselibs = true;\n\t\t\t\t_perFrame.OnNext(_timer.Elapsed.TotalSeconds);\n\t\t\t\t_log.TrySomethingBlocking(Bootstrapper.OnUpdate);\n\n\t\t\t\tGL.ClearDepth(1);\n\t\t\t\tGL.Clear(GLClearBufferMask.ColorBufferBit | GLClearBufferMask.DepthBufferBit);\n\n\t\t\t\t_log.TrySomethingBlocking(Bootstrapper.OnDraw);\n\n\t\t\t\t_glContext.SwapBuffers();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\t_isInFuselibs = false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetCursor(Cursor toCursor) { }\n\n\t\tpublic void Run()\n\t\t{\n\t\t\t_form.MainLoop(PerformRepaint);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/unohost/win/UnoHostControlImplementation.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing System.Runtime.InteropServices;\nusing System.Windows;\nusing System.Windows.Forms;\nusing System.Windows.Input;\nusing System.Windows.Interop;\nusing System.Windows.Media;\nusing Outracks.IO;\nusing Outracks.UnoHost;\nusing Outracks.UnoHost.Windows.Protocol;\nusing SharpDX;\nusing SharpDX.Direct3D9;\nusing MouseEventArgs = Outracks.UnoHost.Windows.Protocol.MouseEventArgs;\n\nnamespace Outracks.Fusion.Windows\n{\n\tpublic class UnoHostControlFactory : IUnoHostControlFactory\n\t{\n\t\tpublic IUnoHostControl Create(\n\t\t\tAbsoluteFilePath assemblyPath,\n\t\t\tCommand onFocused,\n\t\t\tMenu contextMenu,\n\t\t\tAbsoluteFilePath userDataPath,\n\t\t\tIExternalApplication application,\n\t\t\tAction<IUnoHostControl> initialize,\n\t\t\tAction<OpenGlVersion> gotVersion,\n\t\t\tparams string[] arguments)\n\t\t{\n\t\t\tvar useWindowBasedSurface = true;\n\n\t\t\tvar dispatcher = Fusion.Application.MainThread;\n\n\t\t\tvar messagesToHost = new Subject<IBinaryMessage>();\n\n\t\t\tvar unoHost = UnoHostProcess.Spawn(assemblyPath, messagesToHost, userDataPath, application, /*TODO*/new List<string>());\n\n\t\t\tunoHost.Process.Subscribe(process => new Job().AddProcess(process.Id));\n\n\t\t\tvar windowCreated = unoHost.Receieve(WindowCreatedMessage.TryParse).Replay(1);\n\t\t\twindowCreated.Connect();\n\n\t\t\tvar control = new UnoHostControlImplementation()\n\t\t\t{\n\t\t\t\t_disposable = unoHost,\n\t\t\t\tMessages = unoHost.Messages,\n\t\t\t\tMessagesTo = messagesToHost,\n\t\t\t\tProcess = unoHost.Process,\n\t\t\t};\n\n\t\t\tcontrol.Control =\n\t\t\t\tControl.Create(location =>\n\t\t\t\t{\n\t\t\t\t\tif (useWindowBasedSurface)\n\t\t\t\t\t\treturn CreateWindowBasedSurface(dispatcher, location, contextMenu, unoHost, onFocused, windowCreated, initialize, control, gotVersion);\n\t\t\t\t\telse\n\t\t\t\t\t\treturn CreateTextureBasedSurface(dispatcher, location, messagesToHost);\n\t\t\t\t});\n\n\t\t\treturn control;\n\t\t}\n\n\t\tstatic object CreateWindowBasedSurface(\n\t\t\t\tIScheduler dispatcher,\n\t\t\t\tIMountLocation location,\n\t\t\t\tMenu contextMenu,\n\t\t\t\tUnoHostProcess unoHost,\n\t\t\t\tCommand onFocused,\n\t\t\t\tIConnectableObservable<IntPtr> windowCreated,\n\t\t\t\tAction<IUnoHostControl> initialize,\n\t\t\t\tUnoHostControlImplementation control,\n\t\t\t\tAction<OpenGlVersion> gotVersion)\n\t\t{\n\t\t\tvar dummyControl = Shapes.Rectangle();\n\t\t\tdummyControl.Mount(location);\n\t\t\tvar dummyElement = (FrameworkElement)dummyControl.NativeHandle;\n\n\t\t\tlocation.IsRooted\n\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t.SubscribeUsing(\n\t\t\t\t\trooted => rooted\n\t\t\t\t\t\t? ContextMenuImplementation.AddMenuTemporarily(dummyElement, contextMenu, dispatcher)\n\t\t\t\t\t\t: Disposable.Empty);\n\n\t\t\tvar mainWindow = DataBinding\n\t\t\t\t.ObservableFromNativeEvent<object>(dummyElement, \"LayoutUpdated\")\n\t\t\t\t.StartWith(new object())\n\t\t\t\t.Select(\n\t\t\t\t\t_ =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hwndSource1 = PresentationSource.FromVisual(dummyElement);\n\t\t\t\t\t\tif (hwndSource1 == null)\n\t\t\t\t\t\t\treturn Optional.None<System.Windows.Window>();\n\n\t\t\t\t\t\tvar window = hwndSource1.RootVisual as System.Windows.Window;\n\t\t\t\t\t\tif (window == null)\n\t\t\t\t\t\t\treturn Optional.None<System.Windows.Window>();\n\n\t\t\t\t\t\treturn Optional.Some(window);\n\t\t\t\t\t})\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.NotNone()\n\t\t\t\t.Replay(1).RefCount();\n\n\t\t\tvar mainWindowHandle = mainWindow.Select(\n\t\t\t\t\tcurrentWindow =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar hwndSource = (HwndSource)PresentationSource.FromVisual(currentWindow);\n\t\t\t\t\t\tif (hwndSource == null)\n\t\t\t\t\t\t\treturn Optional.None();\n\n\t\t\t\t\t\treturn Optional.Some(hwndSource.Handle);\n\t\t\t\t\t})\n\t\t\t\t.NotNone()\n\t\t\t\t.Replay(1);\n\n\t\t\tmainWindowHandle.Connect();\n\n\t\t\tvar focused = unoHost.Receieve(WindowFocusMessage.TryParse)\n\t\t\t\t.Where(focusState => focusState == FocusState.Focused);\n\n\t\t\tfocused.CombineLatest(mainWindowHandle, (a, b) => b)\n\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t.Subscribe(t => WinApi.ShowWindow(t, WinApi.ShowWindowEnum.ShowNoActivate));\n\n\t\t\tunoHost.Receieve(WindowContextMenuMessage.TryParse)\n\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t.Subscribe(t => dummyElement.ContextMenu.IsOpen = t);\n\n\t\t\tunoHost.Receieve(WindowMouseScrollMessage.TryParse)\n\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t.Subscribe(\n\t\t\t\t\tdeltaWheel =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar delta = deltaWheel;\n\t\t\t\t\t\tvar routedEvent = Mouse.MouseWheelEvent;\n\n\t\t\t\t\t\tdummyElement.RaiseEvent(\n\t\t\t\t\t\t\tnew MouseWheelEventArgs(\n\t\t\t\t\t\t\t\tMouse.PrimaryDevice,\n\t\t\t\t\t\t\t\tEnvironment.TickCount,\n\t\t\t\t\t\t\t\tdelta)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tRoutedEvent = routedEvent,\n\t\t\t\t\t\t\t\tSource = dummyElement\n\t\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t// This is a fix for a commit that \"fixed\" handling the shortcuts, but broke just\n\t\t\t// plain typing in a TextInput.\n\t\t\t// See https://github.com/fusetools/Fuse/issues/3342\n\t\t\t// and https://github.com/fusetools/Fuse/issues/3887\n\n\t\t\t// Workaround to fix a problem with handling shortcut keys in the application while\n\t\t\t// the viewport has focus and the user is typing in an TextInput in the app.\n\t\t\t// We have give the main window focus to handle the shortcut keys, but then\n\t\t\t// the viewport will lose focus. Current work around is to only do this when\n\t\t\t// the user presses down Ctrl.\n\n\t\t\tunoHost.Receieve(WindowKeyDown.TryParse)\n\t\t\t\t.WithLatestFromBuffered(mainWindow, (t, w) => new { Keys = t, Window = w })\n\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t.Subscribe(\n\t\t\t\t\tt =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar modifiers = System.Windows.Input.Keyboard.PrimaryDevice.Modifiers;\n\t\t\t\t\t\tvar alt = modifiers.HasFlag(System.Windows.Input.ModifierKeys.Alt);\n\n\t\t\t\t\t\t// Activate the main window if the Ctrl-key was pressed.\n\t\t\t\t\t\t// Ctrl + Alt means AltGr which we want to keep in the Uno host e.g. for the '@' key on Nordic keyboards.\n\t\t\t\t\t\tif (t.Keys == Keys.ControlKey && !alt)\n\t\t\t\t\t\t\tt.Window.Activate();\n\t\t\t\t\t});\n\n\t\t\tfocused\n\t\t\t\t.WithLatestFromBuffered(onFocused.Execute.ConnectWhile(dummyControl.IsRooted), (_, c) => c)\n\t\t\t\t.Subscribe(c => c());\n\n\t\t\tvar overlayForm = new OverlayForm();\n\n\t\t\tObservable\n\t\t\t\t.CombineLatest(\n\t\t\t\t\twindowCreated,\n\t\t\t\t\tmainWindowHandle,\n\t\t\t\t\t(viewportHwnd, mainHwnd) => new\n\t\t\t\t\t{\n\t\t\t\t\t\tViewportHwnd = viewportHwnd,\n\t\t\t\t\t\tMainHwnd = mainHwnd,\n\t\t\t\t\t})\n\t\t\t\t.ObserveOn(dispatcher)\n\t\t\t\t.SubscribeUsing(\n\t\t\t\t\tt =>\n\t\t\t\t\t\toverlayForm.BindTo(t.ViewportHwnd, t.MainHwnd, dummyControl, dummyElement.GetDpi()));\n\n\t\t\tunoHost.Messages\n\t\t\t\t.TryParse(Ready.MessageType, Ready.ReadDataFrom)\n\t\t\t\t.Take(1)\n\t\t\t\t.Subscribe(_ => initialize(control));\n\n\t\t\tunoHost.Messages\n\t\t\t\t.SelectSome(OpenGlVersionMessage.TryParse)\n\t\t\t\t.Subscribe(gotVersion);\n\n\t\t\tunoHost.Messages.Connect();\n\n\t\t\treturn dummyElement;\n\t\t}\n\n\t\t[StructLayout(LayoutKind.Sequential)]\n\t\tstruct Vertex\n\t\t{\n\t\t\tpublic Vector4 Position;\n\t\t\tpublic Vector2 UV;\n\t\t\tpublic SharpDX.Color Color;\n\t\t}\n\n\t\t// Create a texture based surface where a DX9 texture is shared with the UnoHost and used as backbuffer in the UnoHost.\n\t\tstatic FrameworkElement CreateTextureBasedSurface(IScheduler dispatcher, IMountLocation location, IObserver<IBinaryMessage> messagesToHost)\n\t\t{\n\t\t\tvar d3dSource = new D3DImage(2.0 * 96.0, 2.0 * 96.0);\n\t\t\tvar hInstance = Marshal.GetHINSTANCE(typeof(UnoHostControlImplementation).Module);\n\t\t\tvar hwnd = CreateWindowEx(0, \"button\", \"Dummy\", WindowStyles.WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, IntPtr.Zero, IntPtr.Zero, hInstance, IntPtr.Zero);\n\n\t\t\tvar device = new DeviceEx(\n\t\t\t\tnew Direct3DEx(),\n\t\t\t\t0,\n\t\t\t\tDeviceType.Hardware,\n\t\t\t\thwnd,\n\t\t\t\tCreateFlags.HardwareVertexProcessing | CreateFlags.Multithreaded | CreateFlags.FpuPreserve,\n\t\t\t\tnew PresentParameters((int)1, (int)1)\n\t\t\t\t{\n\t\t\t\t\tWindowed = true,\n\t\t\t\t\tSwapEffect = SwapEffect.Discard,\n\t\t\t\t\tBackBufferFormat = Format.A8R8G8B8\n\t\t\t\t});\n\n\t\t\tvar vertices = new VertexBuffer(device, 4 * 28, Usage.WriteOnly, VertexFormat.None, Pool.Default);\n\n\t\t\tvertices.Lock(0, 0, LockFlags.None).WriteRange(new[] {\n\t\t\t\tnew Vertex() { Position = new Vector4(-1, -1, 0, 1.0f), UV = new Vector2(0,0), Color = SharpDX.Color.White },\n\t\t\t\tnew Vertex() { Position = new Vector4(1, -1, 0, 1.0f), UV = new Vector2(1,0), Color = SharpDX.Color.White },\n\t\t\t\tnew Vertex() { Position = new Vector4(-1, 1, 0, 1.0f), UV = new Vector2(0,1), Color = SharpDX.Color.White },\n\t\t\t\tnew Vertex() { Position = new Vector4(1, 1, 0, 1.0f), UV = new Vector2(1,1), Color = SharpDX.Color.White },\n\t\t\t});\n\t\t\tvertices.Unlock();\n\n\t\t\tvar vertexElems = new[] {\n\t\t\t\tnew VertexElement(0, 0, DeclarationType.Float4, DeclarationMethod.Default, DeclarationUsage.Position, 0),\n\t\t\t\tnew VertexElement(0, 16, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),\n\t\t\t\tnew VertexElement(0, 24, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),\n\t\t\t\tVertexElement.VertexDeclarationEnd\n\t\t\t};\n\t\t\tvar vertexDecl = new VertexDeclaration(device, vertexElems);\n\n\t\t\tvar image = new System.Windows.Controls.Image\n\t\t\t{\n\t\t\t\tSource = d3dSource\n\t\t\t};\n\n\t\t\tdevice.SetRenderState(RenderState.Lighting, false);\n\t\t\tdevice.SetRenderState(RenderState.CullMode, Cull.Clockwise);\n\n\t\t\tvar lastFrameTime = TimeSpan.FromSeconds(0);\n\t\t\tvar currentSize = new Size<Pixels>();\n\t\t\tObservable.FromEventPattern(\n\t\t\t\t\thandler =>\n\t\t\t\t\t{\n\t\t\t\t\t\tCompositionTarget.Rendering += handler;\n\t\t\t\t\t},\n\t\t\t\t\thandler =>\n\t\t\t\t\t{\n\t\t\t\t\t\tCompositionTarget.Rendering -= handler;\n\t\t\t\t\t})\n\t\t\t\t.Subscribe(\n\t\t\t\t\tevt =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar frameArgs = (RenderingEventArgs)evt.EventArgs;\n\t\t\t\t\t\tif (lastFrameTime == frameArgs.RenderingTime) return;\n\n\t\t\t\t\t\tlastFrameTime = frameArgs.RenderingTime;\n\t\t\t\t\t\td3dSource.Lock();\n\t\t\t\t\t\tdevice.Clear(ClearFlags.Target | ClearFlags.ZBuffer, SharpDX.Color.Black, 1.0f, 0);\n\t\t\t\t\t\tdevice.BeginScene();\n\n\t\t\t\t\t\tdevice.SetStreamSource(0, vertices, 0, 28);\n\t\t\t\t\t\tdevice.VertexDeclaration = vertexDecl;\n\t\t\t\t\t\tdevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);\n\n\t\t\t\t\t\tdevice.EndScene();\n\t\t\t\t\t\td3dSource.AddDirtyRect(new Int32Rect(0, 0, (int)currentSize.Width, (int)currentSize.Height));\n\t\t\t\t\t\td3dSource.Unlock();\n\t\t\t\t\t});\n\n\t\t\tlocation.NativeFrame\n\t\t\t\t.Size\n\t\t\t\t.Transpose()\n\t\t\t\t.ConnectWhile(location.IsRooted)\n\t\t\t\t.DistinctUntilChanged()\n\t\t\t\t.Where(s => !s.HasZeroArea())\n\t\t\t\t.CombineLatest(image.GetDpi(), (size, dpi) =>\n\t\t\t\t{\n\t\t\t\t\tvar pixelSize = size * dpi;\n\t\t\t\t\treturn new { pixelSize, dpi };\n\t\t\t\t})\n\t\t\t\t.ObserveOn(Fusion.Application.MainThread)\n\t\t\t\t.Subscribe(\n\t\t\t\t\tdata =>\n\t\t\t\t\t{\n\t\t\t\t\t\tvar size = data.pixelSize;\n\t\t\t\t\t\tdevice.Reset(new PresentParameters((int)size.Width, (int)size.Height)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tWindowed = true,\n\t\t\t\t\t\t\tSwapEffect = SwapEffect.Discard,\n\t\t\t\t\t\t\tBackBufferFormat = Format.A8R8G8B8\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tvar surface = Surface.CreateRenderTarget(device, (int)size.Width, (int)size.Height, Format.A8R8G8B8, MultisampleType.None, 0, false);\n\t\t\t\t\t\tdevice.SetRenderTarget(0, surface);\n\n\t\t\t\t\t\td3dSource.Lock();\n\t\t\t\t\t\td3dSource.SetBackBuffer(D3DResourceType.IDirect3DSurface9, surface.NativePointer);\n\t\t\t\t\t\td3dSource.Unlock();\n\n\t\t\t\t\t\tvar sharedTexHandle = IntPtr.Zero;\n\t\t\t\t\t\tvar texture = new Texture(device, (int)size.Width, (int)size.Height, 1, Usage.NonSecure, Format.A8R8G8B8, Pool.Default, ref sharedTexHandle);\n\t\t\t\t\t\tdevice.SetTexture(0, texture);\n\n\t\t\t\t\t\tcurrentSize = size;\n\t\t\t\t\t\tmessagesToHost.OnNext(SetSurfaceMessage.Compose(new TextureWithSize(sharedTexHandle, size, data.dpi)));\n\t\t\t\t\t});\n\n\t\t\timage.MouseDown += (s, a) => image.CaptureMouse();\n\t\t\timage.MouseUp += (s, a) => image.ReleaseMouseCapture();\n\n\t\t\tObservable.FromEventPattern<System.Windows.Input.MouseEventArgs>(image, \"MouseDown\")\n\t\t\t\t.Select(a => a.EventArgs.GetPosition(image).ToFusion())\n\t\t\t\t.WithLatestFromBuffered(image.GetDpi(), (loc, dpi) => loc * dpi)\n\t\t\t\t.ObserveOn(TaskPoolScheduler.Default)\n\t\t\t\t.Select(pixelLoc => MouseEventMessage.Compose(new MouseEventArgs(MouseEventType.MouseDown, pixelLoc)))\n\t\t\t\t.Subscribe(messagesToHost);\n\n\t\t\tObservable.FromEventPattern<System.Windows.Input.MouseEventArgs>(image, \"MouseUp\")\n\t\t\t\t.Select(a => a.EventArgs.GetPosition(image).ToFusion())\n\t\t\t\t.WithLatestFromBuffered(image.GetDpi(), (loc, dpi) => loc * dpi)\n\t\t\t\t.ObserveOn(TaskPoolScheduler.Default)\n\t\t\t\t.Select(pixelLoc => MouseEventMessage.Compose(new MouseEventArgs(MouseEventType.MouseUp, pixelLoc)))\n\t\t\t\t.Subscribe(messagesToHost);\n\n\t\t\t/*Observable.FromEventPattern<System.Windows.Input.MouseEventArgs>(image, \"MouseMove\")\n\t\t\t\t.Sample(TimeSpan.FromMilliseconds(1))\n\t\t\t\t.Select(a => a.EventArgs.GetPosition(image).ToFusion())\n\t\t\t\t.WithLatestFrom(image.GetDpi(), (loc, dpi) => loc * dpi)\n\t\t\t\t.ObserveOn(TaskPoolScheduler.Default)\n\t\t\t\t.Select(pixelLoc => MouseEventMessage.Compose(new MouseEventArgs(MouseEventType.MouseMove, pixelLoc)))\n\t\t\t\t.Subscribe(messagesToHost);*/\n\n\t\t\tlocation.BindNativeDefaults(image, dispatcher);\n\t\t\treturn image;\n\t\t}\n\n\t\t[DllImport(\"user32.dll\", SetLastError = true)]\n\t\tstatic extern IntPtr CreateWindowEx(\n\t\t\tuint dwExStyle,\n\t\t\t[MarshalAs(UnmanagedType.LPStr)] string lpClassName,\n\t\t\t[MarshalAs(UnmanagedType.LPStr)] string lpWindowName,\n\t\t\tWindowStyles dwStyle,\n\t\t\tint x,\n\t\t\tint y,\n\t\t\tint nWidth,\n\t\t\tint nHeight,\n\t\t\tIntPtr hWndParent,\n\t\t\tIntPtr hMenu,\n\t\t\tIntPtr hInstance,\n\t\t\tIntPtr lpParam);\n\n\t}\n\n\t[Flags()]\n\tenum WindowStyles : uint\n\t{\n\t\t/// <summary>The window has a thin-line border.</summary>\n\t\tWS_BORDER = 0x800000,\n\n\t\t/// <summary>The window has a title bar (includes the WS_BORDER style).</summary>\n\t\tWS_CAPTION = 0xc00000,\n\n\t\t/// <summary>The window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.</summary>\n\t\tWS_CHILD = 0x40000000,\n\n\t\t/// <summary>Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.</summary>\n\t\tWS_CLIPCHILDREN = 0x2000000,\n\n\t\t/// <summary>\n\t\t/// Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated.\n\t\t/// If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.\n\t\t/// </summary>\n\t\tWS_CLIPSIBLINGS = 0x4000000,\n\n\t\t/// <summary>The window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function.</summary>\n\t\tWS_DISABLED = 0x8000000,\n\n\t\t/// <summary>The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.</summary>\n\t\tWS_DLGFRAME = 0x400000,\n\n\t\t/// <summary>\n\t\t/// The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style.\n\t\t/// The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.\n\t\t/// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.\n\t\t/// </summary>\n\t\tWS_GROUP = 0x20000,\n\n\t\t/// <summary>The window has a horizontal scroll bar.</summary>\n\t\tWS_HSCROLL = 0x100000,\n\n\t\t/// <summary>The window is initially maximized.</summary>\n\t\tWS_MAXIMIZE = 0x1000000,\n\n\t\t/// <summary>The window has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary> \n\t\tWS_MAXIMIZEBOX = 0x10000,\n\n\t\t/// <summary>The window is initially minimized.</summary>\n\t\tWS_MINIMIZE = 0x20000000,\n\n\t\t/// <summary>The window has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.</summary>\n\t\tWS_MINIMIZEBOX = 0x20000,\n\n\t\t/// <summary>The window is an overlapped window. An overlapped window has a title bar and a border.</summary>\n\t\tWS_OVERLAPPED = 0x0,\n\n\t\t/// <summary>The window is an overlapped window.</summary>\n\t\tWS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_SIZEFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,\n\n\t\t/// <summary>The window is a pop-up window. This style cannot be used with the WS_CHILD style.</summary>\n\t\tWS_POPUP = 0x80000000u,\n\n\t\t/// <summary>The window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.</summary>\n\t\tWS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU,\n\n\t\t/// <summary>The window has a sizing border.</summary>\n\t\tWS_SIZEFRAME = 0x40000,\n\n\t\t/// <summary>The window has a sizing border. Same as the WS_SIZEBOX style.</summary>\n\t\tWS_THICKFRAME = 0x00040000,\n\n\t\t/// <summary>The window has a window menu on its title bar. The WS_CAPTION style must also be specified.</summary>\n\t\tWS_SYSMENU = 0x80000,\n\n\t\t/// <summary>\n\t\t/// The window is a control that can receive the keyboard focus when the user presses the TAB key.\n\t\t/// Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.\n\t\t/// You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.\n\t\t/// For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function.\n\t\t/// </summary>\n\t\tWS_TABSTOP = 0x10000,\n\n\t\t/// <summary>The window is initially visible. This style can be turned on and off by using the ShowWindow or SetWindowPos function.</summary>\n\t\tWS_VISIBLE = 0x10000000,\n\n\t\t/// <summary>The window has a vertical scroll bar.</summary>\n\t\tWS_VSCROLL = 0x200000\n\t}\n\n\tpublic class UnoHostControlImplementation : IUnoHostControl\n\t{\n\t\tpublic IDisposable _disposable;\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\t_disposable.Dispose();\n\t\t}\n\n\t\tpublic IControl Control { get; set; }\n\t\tpublic IConnectableObservable<IBinaryMessage> Messages { get; set; }\n\t\tpublic IObserver<IBinaryMessage> MessagesTo { get; set; }\n\t\tpublic IObservable<Process> Process { get; set; }\n\t}\n}\n"
  },
  {
    "path": "src/unohost/win/WinFormsInputState.cs",
    "content": "﻿using ModifierKeys = Uno.Platform.EventModifiers;\n\nnamespace Outracks.UnoCore.WinFormsSupport\n{\n\t/*\n\tpublic static class WinFormsInputState\n\t{\n\t\tpublic static InputState Query()\n\t\t{\n\t\t\treturn new InputState(\n\t\t\t\tGetModifierKeysState(),\n\t\t\t\tGetMouseButtonState());\n\t\t}\n\n\t\tpublic static ModifierKeys GetModifierKeysState()\n\t\t{\n\t\t\treturn\n\t\t\t\tGetState(ModifierKeys.AltKey) |\n\t\t\t\tGetState(ModifierKeys.ControlKey) |\n\t\t\t\tGetState(ModifierKeys.ShiftKey) |\n\t\t\t\tGetState(ModifierKeys.MetaKey);\n\t\t}\n\n\t\tpublic static MouseButtons GetMouseButtonState()\n\t\t{\n\t\t\treturn\n\t\t\t\tGetState(MouseButtons.Left) |\n\t\t\t\tGetState(MouseButtons.Middle) |\n\t\t\t\tGetState(MouseButtons.Right) |\n\t\t\t\tGetState(MouseButtons.X1) |\n\t\t\t\tGetState(MouseButtons.X2);\n\t\t}\n\n\t\tstatic ModifierKeys GetState(ModifierKeys key)\n\t\t{\n\t\t\treturn (GetKeyState(key.ToKeys() | Keys.Modifiers) & 0x8000) != 0 || System.Windows.Forms.Control.ModifierKeys.HasFlag(key.ToKeys())\n\t\t\t\t? key\n\t\t\t\t: 0;\n\t\t}\n\n\t\tstatic MouseButtons GetState(MouseButtons button)\n\t\t{\n\t\t\treturn (GetKeyState(button.ToKeys()) & 0x8000) != 0\n\t\t\t\t? button\n\t\t\t\t: MouseButtons.None;\n\t\t}\n\n\t\tpublic static bool GetKeyStateOnlyWorksForModifiers(Key key)\n\t\t{\n\t\t\tvar modifierKey = key.ToModifierKey();\n\t\t\treturn GetState(modifierKey).HasFlag(modifierKey);\n\t\t}\n\n\t\tstatic ModifierKeys ToModifierKey(this Key key)\n\t\t{\n\t\t\t// You may think this function do not belong here, however it is platform dependent.\n\t\t\t// Control key is both ControlKey and Metakey on Windows\n\t\t\t// While on Mac control key is only ControlKey, while Command is both OSKey and Metakey.\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase Key.ControlKey:\n\t\t\t\t\treturn ModifierKeys.ControlKey;\n\t\t\t\tcase Key.MetaKey:\n\t\t\t\t\treturn ModifierKeys.MetaKey;\n\t\t\t\tcase Key.AltKey:\n\t\t\t\t\treturn ModifierKeys.AltKey;\n\t\t\t\tcase Key.ShiftKey:\n\t\t\t\t\treturn ModifierKeys.ShiftKey;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t[DllImport(\"user32.dll\")]\n\t\tstatic extern short GetKeyState(Keys vKey);\n\n\t\tstatic Keys ToKeys(this ModifierKeys key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase ModifierKeys.AltKey:\n\t\t\t\t\treturn Keys.Alt;\n\n\t\t\t\tcase ModifierKeys.ControlKey:\n\t\t\t\t\treturn Keys.Control;\n\n\t\t\t\tcase ModifierKeys.MetaKey:\n\t\t\t\t\treturn Keys.Control;\n\n\t\t\t\tcase ModifierKeys.ShiftKey:\n\t\t\t\t\treturn Keys.Shift;\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t\tstatic Keys ToKeys(this MouseButtons button)\n\t\t{\n\t\t\tswitch (button)\n\t\t\t{\n\t\t\t\tcase MouseButtons.Left:\n\t\t\t\t\treturn Keys.LButton;\n\n\t\t\t\tcase MouseButtons.Middle:\n\t\t\t\t\treturn Keys.MButton;\n\n\t\t\t\tcase MouseButtons.Right:\n\t\t\t\t\treturn Keys.RButton;\n\n\t\t\t\tcase MouseButtons.X1:\n\t\t\t\t\treturn Keys.XButton1;\n\n\t\t\t\tcase MouseButtons.X2:\n\t\t\t\t\treturn Keys.XButton2;\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\t}*/\n}\n"
  },
  {
    "path": "src/unohost/win/WinFormsMarshalling.cs",
    "content": "using System.Windows.Forms;\nusing System.Windows.Media;\nusing OpenGL;\nusing Outracks.Fusion.Windows;\nusing Uno.Platform;\n\nnamespace Outracks.UnoHost.Windows\n{\n\tstatic class WinFormsMarshalling\n\t{\n\t\tpublic static Uno.Platform.MouseButton ToUno(this System.Windows.Forms.MouseButtons buttons)\n\t\t{\n\t\t\tif (buttons.HasFlag(System.Windows.Forms.MouseButtons.Left)) return Uno.Platform.MouseButton.Left;\n\t\t\tif (buttons.HasFlag(System.Windows.Forms.MouseButtons.Right)) return Uno.Platform.MouseButton.Right;\n\t\t\tif (buttons.HasFlag(System.Windows.Forms.MouseButtons.Middle)) return Uno.Platform.MouseButton.Middle;\n\t\t\tif (buttons.HasFlag(System.Windows.Forms.MouseButtons.XButton1)) return Uno.Platform.MouseButton.X1;\n\t\t\tif (buttons.HasFlag(System.Windows.Forms.MouseButtons.XButton2)) return Uno.Platform.MouseButton.X2;\n\t\t\treturn 0;\n\t\t}\n\n\n\t\tpublic static void Clear(this IGL gl, Color color, float depth)\n\t\t{\n\t\t\tgl.ClearColor(\n\t\t\t\t((float)color.R) / 255,\n\t\t\t\t((float)color.G) / 255,\n\t\t\t\t((float)color.B) / 255,\n\t\t\t\t((float)color.A) / 255);\n\t\t\tgl.ClearDepth(depth);\n\t\t\tgl.Clear(GLClearBufferMask.ColorBufferBit | GLClearBufferMask.DepthBufferBit);\n\t\t}\n\n\n\t\tpublic static Point<Pixels> ToPoint(this System.Drawing.Point point)\n\t\t{\n\t\t\treturn new Point<Pixels>(point.X, point.Y);\n\t\t}\n\n\t\tpublic static Size<Pixels> ToSize(this System.Drawing.Size size)\n\t\t{\n\t\t\treturn new Size<Pixels>(size.Width, size.Height);\n\t\t}\n\n\t\tpublic static MouseButton ToMouseButton(this System.Windows.Forms.MouseButtons mb)\n\t\t{\n\t\t\tswitch (mb)\n\t\t\t{\n\t\t\t\tdefault:\n\t\t\t\t\t// TODO: report warning ?\n\t\t\t\tcase System.Windows.Forms.MouseButtons.Left:\n\t\t\t\t\treturn MouseButton.Left;\n\t\t\t\tcase System.Windows.Forms.MouseButtons.Middle:\n\t\t\t\t\treturn MouseButton.Middle;\n\t\t\t\tcase System.Windows.Forms.MouseButtons.Right:\n\t\t\t\t\treturn MouseButton.Right;\n\t\t\t\tcase System.Windows.Forms.MouseButtons.XButton1:\n\t\t\t\t\treturn MouseButton.X1;\n\t\t\t\tcase System.Windows.Forms.MouseButtons.XButton2:\n\t\t\t\t\treturn MouseButton.X2;\n\t\t\t}\n\t\t}\n\n\t\tpublic static void SetCursor(this Control control, Cursor cursor)\n\t\t{\n\t\t\tif (cursor == Cursor.None)\n\t\t\t\tSystem.Windows.Forms.Cursor.Hide();\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontrol.Cursor = cursor.ToCursor();\n\t\t\t\tSystem.Windows.Forms.Cursor.Show();\n\t\t\t}\n\t\t}\n\n\t\tpublic static System.Windows.Forms.Cursor ToCursor(this Cursor cursor)\n\t\t{\n\t\t\tswitch (cursor)\n\t\t\t{\n\t\t\t\tcase Cursor.Default: return Cursors.Default;\n\t\t\t\tcase Cursor.Pointer: return Cursors.Default;\n\t\t\t\tcase Cursor.Text: return Cursors.Default;\n\t\t\t\tcase Cursor.SizeH: return Cursors.SizeWE;\n\t\t\t\tcase Cursor.SizeV: return Cursors.SizeNS;\n\t\t\t\tcase Cursor.Grab: return NativeResources.GrabCursor;\n\t\t\t\tcase Cursor.Grabbing: return NativeResources.GrabbingCursor;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static Size<Pixels> ToPixelSize(this System.Drawing.Size size)\n\t\t{\n\t\t\treturn new Size<Pixels>(size.Width, size.Height);\n\t\t}\n\n\t\tpublic static Rectangle<Pixels> ToPixelRectangle(this System.Drawing.Rectangle rect)\n\t\t{\n\t\t\treturn Rectangle.FromSides<Pixels>(rect.Left, rect.Top, rect.Right, rect.Bottom);\n\t\t}\n\n\t\tpublic static Optional<Key> ToKey(this Keys key)\n\t\t{\n\t\t\tswitch (key)\n\t\t\t{\n\t\t\t\tcase Keys.Back: return Key.Backspace;\n\n\t\t\t\tcase Keys.RWin:\n\t\t\t\tcase Keys.LWin:\n\t\t\t\t\treturn Key.OSKey;\n\n\t\t\t\tcase Keys.Tab: return Key.Tab;\n\t\t\t\tcase Keys.Enter: return Key.Enter;\n\n\t\t\t\tcase Keys.ShiftKey: return Key.ShiftKey;\n\t\t\t\tcase Keys.ControlKey: return Key.ControlKey;\n\t\t\t\tcase Keys.Alt: return Key.AltKey;\n\n\t\t\t\tcase Keys.CapsLock: return Key.CapsLock;\n\t\t\t\tcase Keys.Escape: return Key.Escape;\n\t\t\t\tcase Keys.Space: return Key.Space;\n\t\t\t\tcase Keys.PageUp: return Key.PageUp;\n\t\t\t\tcase Keys.PageDown: return Key.PageDown;\n\t\t\t\tcase Keys.End: return Key.End;\n\t\t\t\tcase Keys.Home: return Key.Home;\n\n\t\t\t\tcase Keys.Left: return Key.Left;\n\t\t\t\tcase Keys.Up: return Key.Up;\n\t\t\t\tcase Keys.Right: return Key.Right;\n\t\t\t\tcase Keys.Down: return Key.Down;\n\n\t\t\t\tcase Keys.Insert: return Key.Insert;\n\t\t\t\tcase Keys.Delete: return Key.Delete;\n\n\t\t\t\t//case WinForms.Keys.Oemplus: return Key.Plus;\n\t\t\t\t//case WinForms.Keys.OemMinus: return Key.Minus;\n\n\t\t\t\t//case WinForms.Keys.Add: return Key.Add;\n\t\t\t\t//case WinForms.Keys.Subtract: return Key.Subtract;\n\t\t\t}\n\n\t\t\tif (Keys.D0 <= key && key <= Keys.D9)\n\t\t\t\treturn Key.D0 + (key - Keys.D0);\n\n\t\t\tif (Keys.A <= key && key <= Keys.Z)\n\t\t\t\treturn Key.A + (key - Keys.A);\n\n\t\t\tif (Keys.NumPad0 <= key && key <= Keys.NumPad9)\n\t\t\t\treturn Optional.None();\n\n\t\t\tif (Keys.F1 <= key && key <= Keys.F12)\n\t\t\t\treturn Key.F1 + (key - Keys.F1);\n\n\n\t\t\treturn Optional.None();\n\t\t}\n\n\n\t}\n}"
  },
  {
    "path": "src/unohost/win/app.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <runtime>\n    <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n      <dependentAssembly>\n        <assemblyIdentity name=\"Newtonsoft.Json\" publicKeyToken=\"30ad4fe6b2a6aeed\" culture=\"neutral\" />\n        <bindingRedirect oldVersion=\"0.0.0.0-12.0.0.0\" newVersion=\"12.0.0.0\" />\n      </dependentAssembly>\n    </assemblyBinding>\n  </runtime>\n</configuration>"
  },
  {
    "path": "src/unohost/win/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<asmv1:assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv1=\"urn:schemas-microsoft-com:asm.v1\" xmlns:asmv2=\"urn:schemas-microsoft-com:asm.v2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n\t<assemblyIdentity version=\"1.0.0.0\" name=\"Outracks.Fuse.UnoHost\"/>\n\t<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n\t\t<security>\n\t\t\t<requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n\t\t\t\t<!-- UAC Manifest Options\n\t\t\t\t\t\tIf you want to change the Windows User Account Control level replace the \n\t\t\t\t\t\trequestedExecutionLevel node with one of the following.\n\n\t\t\t\t<requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n\t\t\t\t<requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n\t\t\t\t<requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n\t\t\t\t\t\tSpecifying requestedExecutionLevel node will disable file and registry virtualization.\n\t\t\t\t\t\tIf you want to utilize File and Registry Virtualization for backward \n\t\t\t\t\t\tcompatibility then delete the requestedExecutionLevel node.\n\t\t\t\t-->\n\t\t\t\t<requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\" />\n\t\t\t</requestedPrivileges>\n\t\t</security>\n\t</trustInfo>\n\n\t<compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n\t\t<application>\n\t\t\t<!-- A list of all Windows versions that this application is designed to work with. \n\t\t\tWindows will automatically select the most compatible environment.-->\n\n\t\t\t<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"></supportedOS>\n\n\t\t\t<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n\n\t\t\t<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"></supportedOS>\n\n\t\t\t<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->\n\t\t\t<supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"/>\n\n\t\t\t<!-- Windows 10 -->\n\t\t\t<supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n\t\t</application>\n\t</compatibility>\n\n\t<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n\t<!-- <dependency>\n\t\t<dependentAssembly>\n\t\t\t<assemblyIdentity\n\t\t\t\t\ttype=\"win32\"\n\t\t\t\t\tname=\"Microsoft.Windows.Common-Controls\"\n\t\t\t\t\tversion=\"6.0.0.0\"\n\t\t\t\t\tprocessorArchitecture=\"*\"\n\t\t\t\t\tpublicKeyToken=\"6595b64144ccf1df\"\n\t\t\t\t\tlanguage=\"*\"\n\t\t\t\t/>\n\t\t</dependentAssembly>\n\t</dependency>-->\n\n</asmv1:assembly>\n"
  },
  {
    "path": "src/unohost/win/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Microsoft.Bcl.Immutable\" version=\"1.0.34\" targetFramework=\"net45\" />\n  <package id=\"SharpDX\" version=\"4.2.0\" targetFramework=\"net46\" />\n  <package id=\"SharpDX.Direct3D9\" version=\"4.2.0\" targetFramework=\"net46\" />\n  <package id=\"SharpDX.Mathematics\" version=\"4.2.0\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Reactive.Windows.Threading\" version=\"4.4.1\" targetFramework=\"net46\" />\n  <package id=\"System.Runtime.CompilerServices.Unsafe\" version=\"4.5.3\" targetFramework=\"net46\" />\n  <package id=\"System.Threading.Tasks.Extensions\" version=\"4.5.4\" targetFramework=\"net46\" />\n  <package id=\"System.ValueTuple\" version=\"4.5.0\" targetFramework=\"net46\" />\n</packages>"
  },
  {
    "path": "src/unohost/win/unohost-win.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"..\\..\\..\\node_modules\\@fuse-open\\opentk\\ANGLE.props\" Condition=\"Exists('..\\..\\..\\node_modules\\@fuse-open\\opentk\\ANGLE.props')\" />\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <Import Project=\"..\\..\\GlobalAssemblyInfo.targets\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{DDA536E3-A637-4A6D-B0F6-EA0BAB92AFF7}</ProjectGuid>\n    <OutputType>WinExe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Outracks.UnoHost.Windows</RootNamespace>\n    <AssemblyName>unohost</AssemblyName>\n    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <OutputPath>$(SolutionDir)bin/$(Configuration)</OutputPath>\n    <RestorePackages>true</RestorePackages>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <UseVSHostingProcess>true</UseVSHostingProcess>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <Prefer32Bit>false</Prefer32Bit>\n  </PropertyGroup>\n  <PropertyGroup>\n    <StartupObject />\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationManifest>app.manifest</ApplicationManifest>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>Icon.ico</ApplicationIcon>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"OpenTK, Version=3.2.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\node_modules\\%40fuse-open\\opentk\\OpenTK.dll</HintPath>\n    </Reference>\n    <Reference Include=\"Outracks.Simulator\">\n      <HintPath>..\\..\\simulator\\common\\bin\\Outracks.Simulator.dll</HintPath>\n    </Reference>\n    <Reference Include=\"SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpDX.4.2.0\\lib\\net45\\SharpDX.dll</HintPath>\n    </Reference>\n    <Reference Include=\"SharpDX.Direct3D9, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpDX.Direct3D9.4.2.0\\lib\\net45\\SharpDX.Direct3D9.dll</HintPath>\n    </Reference>\n    <Reference Include=\"SharpDX.Mathematics, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\SharpDX.Mathematics.4.2.0\\lib\\net45\\SharpDX.Mathematics.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.4.4.1\\lib\\net46\\System.Reactive.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Reactive.Windows.Threading, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Reactive.Windows.Threading.4.4.1\\lib\\net46\\System.Reactive.Windows.Threading.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\netstandard1.0\\System.Runtime.CompilerServices.Unsafe.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\portable-net45+win8+wp8+wpa81\\System.Threading.Tasks.Extensions.dll</HintPath>\n    </Reference>\n    <Reference Include=\"System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\System.ValueTuple.4.5.0\\lib\\netstandard1.0\\System.ValueTuple.dll</HintPath>\n    </Reference>\n    <Reference Include=\"UnoCore\">\n      <HintPath>..\\..\\simulator\\common\\bin\\UnoCore.dll</HintPath>\n    </Reference>\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Collections.Immutable, Version=1.0.34.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n      <HintPath>..\\..\\..\\packages\\Microsoft.Bcl.Immutable.1.0.34\\lib\\portable-net45+win8+wp8+wpa81\\System.Collections.Immutable.dll</HintPath>\n      <Private>True</Private>\n    </Reference>\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Job.cs\" />\n    <Compile Include=\"Egl.cs\" />\n    <Compile Include=\"Protocol\\EventMessage.cs\" />\n    <Compile Include=\"Protocol\\SetSurfaceMessage.cs\" />\n    <Compile Include=\"Protocol\\WindowKeyBoard.cs\" />\n    <Compile Include=\"Protocol\\WindowContextMenuMessage.cs\" />\n    <Compile Include=\"Protocol\\WindowCreatedMessage.cs\" />\n    <Compile Include=\"Protocol\\WindowMouseScrollMessage.cs\" />\n    <Compile Include=\"ContextCreationFailed.cs\" />\n    <Compile Include=\"ContextFactory.cs\" />\n    <Compile Include=\"OpenTKGL.Dispose.cs\" />\n    <Compile Include=\"OpenTKGL.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"UnoHostControlImplementation.cs\" />\n    <Compile Include=\"UnoControl.cs\">\n      <SubType>UserControl</SubType>\n    </Compile>\n    <Compile Include=\"WinFormsInputState.cs\" />\n    <Compile Include=\"WinFormsMarshalling.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n    <None Include=\"app.manifest\" />\n    <None Include=\"packages.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\..\\common\\math\\Outracks.Math.csproj\">\n      <Project>{3C1C1047-8830-498E-882A-503C0956CBE3}</Project>\n      <Name>Outracks.Math</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\common\\core\\Outracks.Core.csproj\">\n      <Project>{196b010d-ad36-4947-95aa-14fc4a27bd18}</Project>\n      <Name>Outracks.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\core\\Outracks.Fusion.Core.csproj\">\n      <Project>{8dfb02e0-acbf-4432-8dd9-56712e206968}</Project>\n      <Name>Outracks.Fusion.Core</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\fusion\\win\\Outracks.Fusion.Windows.csproj\">\n      <Project>{55c9979b-c90e-426f-8c75-dcce6f193d23}</Project>\n      <Name>Outracks.Fusion.Windows</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\preview\\service\\fuse-preview.csproj\">\n      <Project>{59e1073a-9b45-41f3-ab94-958a9d18fb72}</Project>\n      <Name>fuse-preview</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\common\\Outracks.Simulator.csproj\">\n      <Project>{3335bb78-0b8a-4d2f-919f-2e6f08883d51}</Project>\n      <Name>Outracks.Simulator</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\..\\simulator\\main\\Outracks.Simulator.Main.csproj\">\n      <Project>{E8884270-5F2C-4076-86D0-456B831BE3E5}</Project>\n      <Name>Outracks.Simulator.Main</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\common\\Outracks.UnoHost.csproj\">\n      <Project>{F2AEB321-51E5-40B8-9CF0-53C930E631F0}</Project>\n      <Name>Outracks.UnoHost</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Icon.ico\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "templates/files/application-class/_filename_",
    "content": "﻿using Uno;\nusing Uno.Collections;\nusing Uno.Graphics;\n\n_$$include_namespace\nnamespace _$namespace$_\n{\n\tpublic class App : Application\n\t{\n\t\tpublic override void Draw()\n\t\t{\n\t\t}\n\t}\n}\ninclude_namespace$$_\n_$$exclude_namespace\npublic class App : Application\n{\n\tpublic override void Draw()\n\t{\n\t}\n}\nexclude_namespace$$_"
  },
  {
    "path": "templates/files/application-class/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"Application Class\">\n\t<Description>Create an Application Class</Description>\n\t<FileExt>.uno</FileExt>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/files/empty-uno-class/_filename_",
    "content": "﻿using Uno;\nusing Uno.Collections;\nusing Fuse;\n_$$include_namespace\nnamespace _$namespace$_\n{\n\tpublic class _$typename$_\n\t{\n\t}\n}\ninclude_namespace$$_\n_$$exclude_namespace\npublic class _$typename$_\n{\n}\nexclude_namespace$$_"
  },
  {
    "path": "templates/files/empty-uno-class/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"Empty Uno class\" Priority=\"90\">\n\t<Description>Create an empty Uno Class</Description>\n\t<FileExt>.uno</FileExt>\n\t<Alias>uno</Alias>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/files/empty-uno-interface/_filename_",
    "content": "﻿using Uno;\nusing Uno.Collections;\nusing Fuse;\n_$$include_namespace\nnamespace _$namespace$_\n{\n\tpublic interface _$typename$_\n\t{\n\t}\n}\ninclude_namespace$$_\n_$$exclude_namespace\npublic interface _$typename$_\n{\n}\nexclude_namespace$$_"
  },
  {
    "path": "templates/files/empty-uno-interface/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"Empty Uno interface\" Priority=\"80\">\n\t<Description>Create an empty Uno Interface</Description>\n\t<FileExt>.uno</FileExt>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/files/js/_filename_",
    "content": "var Observable = require('FuseJS/Observable');\nmodule.exports = {\n\n};"
  },
  {
    "path": "templates/files/js/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"JavaScript file\" Priority=\"90\">\n\t<Description>Create a JavaScript file with an observable</Description>\n\t<FileExt>.js</FileExt>\n\t<Alias>js</Alias>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/files/json/_filename_",
    "content": "{}"
  },
  {
    "path": "templates/files/json/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"Empty JSON file\" Priority=\"90\">\n\t<Description>Create an empty JSON file</Description>\n\t<FileExt>.json</FileExt>\n\t<Alias>json</Alias>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/files/ux/_filename_",
    "content": "﻿<Panel ux:Class=\"_$fulltypename$_\">\n</Panel>"
  },
  {
    "path": "templates/files/ux/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"UX File\" Priority=\"100\">\n\t<Description>A simple .ux file.</Description>\n\t<FileExt>.ux</FileExt>\n\t<Alias>ux</Alias>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/projects/app/.gitattributes",
    "content": "* text=auto\n"
  },
  {
    "path": "templates/projects/app/.gitignore",
    "content": ".uno/\nbuild/\nnode_modules/\n"
  },
  {
    "path": "templates/projects/app/.vscode/.gitignore",
    "content": "ipch/\n"
  },
  {
    "path": "templates/projects/app/.vscode/settings.json",
    "content": "{\n    \"files.exclude\": {\n        \"**/.uno\": true,\n        \"**/build\": true,\n        \"**/node_modules\": true\n    }\n}"
  },
  {
    "path": "templates/projects/app/MainView.ux",
    "content": "<App>\n</App>"
  },
  {
    "path": "templates/projects/app/_filename_.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}\n"
  },
  {
    "path": "templates/projects/app/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"fuse X project\">\n\t<Description>Create a project with a single empty view</Description>\n\t<Alias>app</Alias>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/projects/app/package.json",
    "content": "{\n  \"name\": \"_$filename$_\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"@fuse-open/tsconfig\": \"~2.7.0\",\n    \"@fuse-open/types\": \"~2.7.1\"\n  },\n  \"scripts\": {\n    \"android\": \"uno build android --run\",\n    \"android-emu\": \"uno build android-emu --run\",\n    \"ios\": \"uno build ios --debug\",\n    \"ios-sim\": \"uno build ios-sim --run\",\n    \"dotnet\": \"uno build dotnet --run\",\n    \"native\": \"uno build native --run\",\n    \"clean\": \"uno clean\"\n  }\n}\n"
  },
  {
    "path": "templates/projects/app/tsconfig.json",
    "content": "{\n  \"extends\": \"@fuse-open/tsconfig\"\n}"
  },
  {
    "path": "templates/projects/example/.gitattributes",
    "content": "* text=auto\n"
  },
  {
    "path": "templates/projects/example/.gitignore",
    "content": ".uno/\nbuild/\nnode_modules/\n"
  },
  {
    "path": "templates/projects/example/.vscode/.gitignore",
    "content": "ipch/\n"
  },
  {
    "path": "templates/projects/example/.vscode/settings.json",
    "content": "{\n    \"files.exclude\": {\n        \"**/.uno\": true,\n        \"**/build\": true,\n        \"**/node_modules\": true\n    }\n}"
  },
  {
    "path": "templates/projects/example/Logic.ts",
    "content": "interface Item {\n    color: number[];\n    height: number;\n}\n\nexport default class Model {\n    items: Item[] = [];\n\n    addItem(): void {\n        this.items.push({\n            color: [Math.random(), Math.random(), Math.random(), 1],\n            height: (Math.random() + 1.0) * 80\n        });\n    }\n}\n"
  },
  {
    "path": "templates/projects/example/MainView.ux",
    "content": "<App>\n\t<ClientPanel>\n\t\t<Page ux:Class=\"PageWithTitle\" ux:Name=\"self\" HitTestMode=\"LocalBoundsAndChildren\">\n\t\t\t<DockLayout />\n\n\t\t\t<float4 ux:Property=\"HeaderColor\" />\n\t\t\t<float4 ux:Property=\"HeaderTextColor\" />\n\t\t\t<string ux:Property=\"Instructions\" />\n\n\t\t\t<StackPanel Dock=\"Top\">\n\t\t\t\t<Panel Color=\"{Property self.HeaderColor}\" Height=\"45\">\n\t\t\t\t\t<Text Value=\"{Property self.Title}\" FontSize=\"22\"\n\t\t\t\t\t\t  Alignment=\"Center\" TextColor=\"{Property self.HeaderTextColor}\"/>\n\t\t\t\t</Panel>\n\t\t\t</StackPanel>\n\n\t\t\t<Panel Height=\"10%\" Color=\"#0008\" Alignment=\"Bottom\">\n\t\t\t\t<WhileActive Invert=\"true\" Threshold=\"0.4\">\n\t\t\t\t\t<Move RelativeTo=\"Size\" Y=\"1\" Duration=\"0.4\" Easing=\"CircularInOut\"/>\n\t\t\t\t</WhileActive>\n\t\t\t\t<Text Value=\"{Property self.Instructions}\" Margin=\"20\" TextColor=\"#fff\" Alignment=\"Center\" />\n\t\t\t</Panel>\n\t\t</Page>\n\n\t\t<PageControl>\n\t\t\t<PageWithTitle Title=\"Basic animation\" HeaderColor=\"#595FFF\" HeaderTextColor=\"#fff\"\n\t\t\t\t\t\t   Color=\"#FEFDFC\" Instructions=\"Tap and hold the rectangle\">\n\t\t\t\t<Panel>\n\t\t\t\t\t<Rectangle ux:Name=\"myRectangle\" Color=\"#4894E5\" Width=\"80\" Height=\"80\" CornerRadius=\"0\">\n\t\t\t\t\t\t<WhilePressed>\n\t\t\t\t\t\t\t<Rotate Degrees=\"45\" Easing=\"CubicInOut\" Duration=\"0.5\" />\n\t\t\t\t\t\t\t<Scale  Factor=\"2\"   Easing=\"CubicInOut\" Duration=\"0.5\" />\n\t\t\t\t\t\t\t<Change myRectangle.Color=\"#FC5185\"      Duration=\"0.3\" />\n\t\t\t\t\t\t\t<Change myRectangle.CornerRadius=\"15\" \t Duration=\"0.3\" />\n\t\t\t\t\t\t</WhilePressed>\n\t\t\t\t\t</Rectangle>\n\t\t\t\t</Panel>\n\t\t\t</PageWithTitle>\n\n\t\t\t<PageWithTitle Title=\"Logic with TypeScript\" HeaderColor=\"#F68FD7\" HeaderTextColor=\"#FFF\" Color=\"#FFF\"\n\t\t\t\t\t\t   Instructions=\"Tap the screen to add items\" Model=\"Logic\">\n\t\t\t\t<Panel Tapped=\"{addItem}\">\n\t\t\t\t\t<ScrollView>\n\t\t\t\t\t\t<Panel>\n\t\t\t\t\t\t\t<ColumnLayout ColumnCount=\"3\"/>\n\t\t\t\t\t\t\t<Each Items=\"{items}\">\n\t\t\t\t\t\t\t\t<Rectangle ux:Name=\"item\" Color=\"{color}\" Height=\"{height}\" Margin=\"5\" CornerRadius=\"5\">\n\t\t\t\t\t\t\t\t\t<AddingAnimation>\n\t\t\t\t\t\t\t\t\t\t<Change item.Opacity=\"0\" Duration=\"0.3\" />\n\t\t\t\t\t\t\t\t\t</AddingAnimation>\n\t\t\t\t\t\t\t\t</Rectangle>\n\t\t\t\t\t\t\t</Each>\n\t\t\t\t\t\t</Panel>\n\t\t\t\t\t</ScrollView>\n\t\t\t\t</Panel>\n\t\t\t</PageWithTitle>\n\n\t\t\t<PageWithTitle Title=\"Realtime effects\" HeaderColor=\"#2CAE3F\" HeaderTextColor=\"#fff\"\n\t\t\t\t\t\t   Color=\"#FFF\" Instructions=\"Use the slider to blur the logo\">\n\t\t\t\t<Grid RowCount=\"2\">\n\t\t\t\t\t<Path Width=\"75%\" Data=\"M 432,1.7 H 404.3 L 377.5,42.8 350.8,1.7 h -27.7 l 40.6,62.3 -40.6,62.3 h 27.7 l 26.7,-41.1 26.8,41.1 H 432 L 391.4,64 Z M 203.5,80.9 c -4.7,-2.2 -9.9,-3.6 -14.9,-5.3 -3.7,-1.3 -7.7,-2 -11,-3.8 -1.9,-1 -3.8,-4 -3.6,-6 0.1,-2.2 2.1,-4.9 4,-6.4 1.7,-1.3 4.5,-1.4 6.8,-1.6 7.9,-0.6 15.1,1.9 21.8,6.8 L 214,50.9 c -9,-8.6 -27.3,-11.7 -41.4,-7.3 -11.6,3.6 -18,11.8 -18.2,23.1 -0.2,10.1 5,16.7 17,20.9 5.8,2 11.8,3.3 17.6,5.2 4.2,1.4 8.1,3.5 7.7,8.8 -0.4,5.5 -4.5,7.2 -9.2,8 -10.3,1.7 -19.5,-1.4 -28.2,-7.5 l -8.3,13.2 c 0.8,0.8 1.7,1.5 2.5,2.1 5.3,4.3 12,6.3 18.6,7.5 11.1,2 22.2,1.6 32.3,-4.3 8,-4.7 12.1,-11.9 11.9,-21.2 -0.1,-8.8 -5,-14.9 -12.8,-18.5 z M 30.1,7.1 c -11,5.2 -15.3,15 -16,26.6 -0.2,3.7 0,7.4 0,11.7 H 0 v 16.3 h 14.2 v 64.4 H 33.6 V 61.5 H 53.1 V 45.1 H 33.8 c 0,-5.2 -0.5,-9.7 0.1,-14 1.1,-7.4 6,-10.8 13.5,-9.9 2.3,0.5 4.6,1.1 6.9,1.8 L 62.5,9.1 c -11,-6.3 -21.7,-7 -32.4,-2 z m 90.8,42.2 c 0,14.2 0,28.3 0,42.5 0.1,2 -0.3,4 -1.1,5.9 -4.2,7.5 -14.1,11.6 -22,9.5 -6.8,-1.8 -10.7,-8 -11,-17.7 0,-1.4 0,-2.7 0,-4.1 0,-12.1 0,-29.8 0,-42 h -19 c 0.2,17.9 -0.3,37.6 0.6,55.4 0.6,11.3 5.8,21 17.3,25.1 2.9,1 5.9,1.7 9,2.1 4.8,0.5 9.6,-0.1 14.1,-1.7 2.3,-0.9 4.6,-2 6.6,-3.4 2.2,-1.5 4.2,-3.1 6.4,-4.6 0.3,2.3 0.5,4 0.7,5.6 0.1,1.1 0.2,2.6 1.1,2.6 h 16 v -81 h -18.7 v 5.8 z m 155.2,75.6 c 7.1,-1.8 13.8,-5.2 19.4,-10 0.7,-0.6 3.5,-2.5 3.5,-3.3 0,-0.5 -1,-1.1 -1.3,-1.4 -1.5,-1.3 -3,-2.6 -4.6,-3.8 -0.5,-0.4 -6.9,-5.9 -7.1,-5.7 -9.5,9.5 -20.3,11.5 -32.1,6.6 -7.2,-3 -9.8,-9.4 -10.3,-17.7 h 57 c 1.6,-10.8 -0.6,-23 -5.5,-31.3 -4.5,-8 -12.2,-13.7 -21.1,-15.7 -24.9,-5.9 -46.5,9.1 -49.6,35.3 -2,16.9 2.4,32 17.5,41.3 10.1,6.5 22.5,8.5 34.2,5.7 z M 263.2,56.8 c 11.2,-0.1 18.8,7.5 18.3,18.6 h -37.3 c -0.7,-10.5 7.6,-18.6 19,-18.6 z\" Color=\"Black\">\n\t\t\t\t\t\t<Blur ux:Name=\"myBlur\" Radius=\"0\"/>\n\t\t\t\t\t</Path>\n\t\t\t\t\t<Slider Margin=\"40,0\" Alignment=\"VerticalCenter\">\n\t\t\t\t\t\t<ProgressAnimation>\n\t\t\t\t\t\t\t<Change myBlur.Radius=\"10\" />\n\t\t\t\t\t\t</ProgressAnimation>\n\t\t\t\t\t</Slider>\n\t\t\t\t</Grid>\n\t\t\t</PageWithTitle>\n\t\t</PageControl>\n\t</ClientPanel>\n</App>\n\n"
  },
  {
    "path": "templates/projects/example/_filename_.unoproj",
    "content": "{\n  \"Packages\": [\n    \"Fuse\",\n    \"FuseJS\"\n  ],\n  \"Includes\": [\n    \"*\"\n  ]\n}\n"
  },
  {
    "path": "templates/projects/example/manifest.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<TemplateManifest Name=\"Example project\" Priority=\"100\">\n\t<Description>Create a project based on a small example app</Description>\n\t<Alias>example</Alias>\n</TemplateManifest>\n"
  },
  {
    "path": "templates/projects/example/package.json",
    "content": "{\n  \"name\": \"_$filename$_\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"@fuse-open/tsconfig\": \"~2.7.0\",\n    \"@fuse-open/types\": \"~2.7.1\"\n  },\n  \"scripts\": {\n    \"android\": \"uno build android --run\",\n    \"android-emu\": \"uno build android-emu --run\",\n    \"ios\": \"uno build ios --debug\",\n    \"ios-sim\": \"uno build ios-sim --run\",\n    \"dotnet\": \"uno build dotnet --run\",\n    \"native\": \"uno build native --run\",\n    \"clean\": \"uno clean\"\n  }\n}\n"
  },
  {
    "path": "templates/projects/example/tsconfig.json",
    "content": "{\n  \"extends\": \"@fuse-open/tsconfig\"\n}"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"extends\": \"@fuse-open/tsconfig\"\n}"
  }
]